From: Andrea Amorese Date: Tue, 25 Jan 2022 13:40:39 +0000 (+0100) Subject: Built motion from commit cd2650be.|2.5.49 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22javascript:;/%22card-image.png//%27?a=commitdiff_plain;h=7d1022ec882d6a0d54706e688c3c0d9d5e39b18d;p=motion2.git Built motion from commit cd2650be.|2.5.49 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 7e636f1..2ac7f49 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-01-25T13:03:29.874Z", + "time": "2022-01-25T13:27:46.823Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 1faa62a..5c81ce4 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-01-25T13:03:29.874Z", + "time": "2022-01-25T13:27:46.823Z", "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 b9608cc..4291c27 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 _0x7d6f=['contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action','STRING','contactManager','integration','urlForward','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'];(function(_0x1e43f9,_0x4cfd94){var _0x38b551=function(_0x4e2ece){while(--_0x4e2ece){_0x1e43f9['push'](_0x1e43f9['shift']());}};_0x38b551(++_0x4cfd94);}(_0x7d6f,0x194));var _0xf7d6=function(_0x3901bb,_0x466c23){_0x3901bb=_0x3901bb-0x0;var _0x184b6c=_0x7d6f[_0x3901bb];return _0x184b6c;};'use strict';var Sequelize=require(_0xf7d6('0x0'));module[_0xf7d6('0x1')]={'name':{'type':Sequelize[_0xf7d6('0x2')],'get':function(_0x3c8b18){return this[_0xf7d6('0x3')](_0xf7d6('0x4'));}},'action':{'type':Sequelize[_0xf7d6('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0xf7d6('0x6'),_0xf7d6('0x7'),'motionbar','jscripty',_0xf7d6('0x8'),'browser',_0xf7d6('0x9'),_0xf7d6('0xa')]],'msg':_0xf7d6('0xb')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0xf7d6('0x5')](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[_0xf7d6('0x5')](0x1000),'comment':_0xf7d6('0xc')},'data3':{'type':Sequelize[_0xf7d6('0x5')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0xf7d6('0x5')](0x1000),'comments':_0xf7d6('0xd')},'data5':{'type':Sequelize[_0xf7d6('0x5')](0x1000),'comments':_0xf7d6('0xe')},'data6':{'type':Sequelize['STRING'],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize['TEXT'],'comments':_0xf7d6('0xf')}}; \ No newline at end of file +var _0x7fa0=['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[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','action','contactManager','integration','motionbar','jscripty','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','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)]'];(function(_0x1ee8bb,_0x115351){var _0x214208=function(_0x3d625f){while(--_0x3d625f){_0x1ee8bb['push'](_0x1ee8bb['shift']());}};_0x214208(++_0x115351);}(_0x7fa0,0x1f4));var _0x07fa=function(_0x534f59,_0x2dbb84){_0x534f59=_0x534f59-0x0;var _0x2790f0=_0x7fa0[_0x534f59];return _0x2790f0;};'use strict';var Sequelize=require(_0x07fa('0x0'));module[_0x07fa('0x1')]={'name':{'type':Sequelize[_0x07fa('0x2')],'get':function(_0x5829a8){return this['getDataValue'](_0x07fa('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x07fa('0x4'),_0x07fa('0x5'),_0x07fa('0x6'),_0x07fa('0x7'),'urlForward','browser',_0x07fa('0x8'),_0x07fa('0x9')]],'msg':_0x07fa('0xa')}},'comment':_0x07fa('0xa')},'data1':{'type':Sequelize[_0x07fa('0xb')](0x1000),'comment':_0x07fa('0xc')},'data2':{'type':Sequelize[_0x07fa('0xb')](0x1000),'comment':_0x07fa('0xd')},'data3':{'type':Sequelize[_0x07fa('0xb')](0x1000),'comment':_0x07fa('0xe')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x07fa('0xf')},'data5':{'type':Sequelize[_0x07fa('0xb')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize['STRING'],'comments':_0x07fa('0x10')},'data7':{'type':Sequelize[_0x07fa('0x11')],'comments':_0x07fa('0x12')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 71dafe1..e6dbd4d 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 _0xff6d=['send','body','Action','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','name'];(function(_0x3b6f21,_0x39a703){var _0x30adb5=function(_0xdbb543){while(--_0xdbb543){_0x3b6f21['push'](_0x3b6f21['shift']());}};_0x30adb5(++_0x39a703);}(_0xff6d,0x165));var _0xdff6=function(_0x5c4e16,_0x113035){_0x5c4e16=_0x5c4e16-0x0;var _0x36044a=_0xff6d[_0x5c4e16];return _0x36044a;};'use strict';var emlformat=require(_0xdff6('0x0'));var rimraf=require(_0xdff6('0x1'));var zipdir=require(_0xdff6('0x2'));var jsonpatch=require(_0xdff6('0x3'));var rp=require(_0xdff6('0x4'));var moment=require('moment');var BPromise=require(_0xdff6('0x5'));var Mustache=require(_0xdff6('0x6'));var util=require(_0xdff6('0x7'));var path=require('path');var sox=require(_0xdff6('0x8'));var csv=require(_0xdff6('0x9'));var ejs=require(_0xdff6('0xa'));var fs=require('fs');var fs_extra=require(_0xdff6('0xb'));var _=require(_0xdff6('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xdff6('0xd'));var toCsv=require(_0xdff6('0x9'));var querystring=require(_0xdff6('0xe'));var Papa=require(_0xdff6('0xf'));var Redis=require(_0xdff6('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xdff6('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xdff6('0x12'));var config=require(_0xdff6('0x13'));var licenseUtil=require(_0xdff6('0x14'));var db=require(_0xdff6('0x15'))['db'];function respondWithStatusCode(_0x168c06,_0x5c757a){_0x5c757a=_0x5c757a||0xcc;return function(_0x27614a){if(_0x27614a){return _0x168c06[_0xdff6('0x16')](_0x5c757a);}return _0x168c06[_0xdff6('0x17')](_0x5c757a)[_0xdff6('0x18')]();};}function respondWithResult(_0x311418,_0x1ced4){_0x1ced4=_0x1ced4||0xc8;return function(_0x46e492){if(_0x46e492){return _0x311418['status'](_0x1ced4)[_0xdff6('0x19')](_0x46e492);}};}function respondWithFilteredResult(_0x988019,_0x4b3521){return function(_0x5891dd){if(_0x5891dd){var _0x3b1fa5=typeof _0x4b3521[_0xdff6('0x1a')]===_0xdff6('0x1b')&&typeof _0x4b3521[_0xdff6('0x1c')]===_0xdff6('0x1b');var _0xbfb2a4=_0x5891dd[_0xdff6('0x1d')];var _0x57526c=_0x3b1fa5?0x0:_0x4b3521[_0xdff6('0x1a')];var _0x3e21e6=_0x3b1fa5?_0x5891dd['count']:_0x4b3521[_0xdff6('0x1a')]+_0x4b3521[_0xdff6('0x1c')];var _0x427288;if(_0x3e21e6>=_0xbfb2a4){_0x3e21e6=_0xbfb2a4;_0x427288=0xc8;}else{_0x427288=0xce;}_0x988019[_0xdff6('0x17')](_0x427288);return _0x988019[_0xdff6('0x1e')](_0xdff6('0x1f'),_0x57526c+'-'+_0x3e21e6+'/'+_0xbfb2a4)[_0xdff6('0x19')](_0x5891dd);}return null;};}function patchUpdates(_0x5268a3){return function(_0x50f6c7){try{jsonpatch['apply'](_0x50f6c7,_0x5268a3,!![]);}catch(_0xa08e48){return BPromise[_0xdff6('0x20')](_0xa08e48);}return _0x50f6c7[_0xdff6('0x21')]();};}function saveUpdates(_0xd9e297,_0x40b194){return function(_0x533720){if(_0x533720){return _0x533720[_0xdff6('0x22')](_0xd9e297)[_0xdff6('0x23')](function(_0x7391c6){return _0x7391c6;});}return null;};}function removeEntity(_0x378b4c,_0x4321ee){return function(_0x128e4b){if(_0x128e4b){return _0x128e4b[_0xdff6('0x24')]()[_0xdff6('0x23')](function(){_0x378b4c[_0xdff6('0x17')](0xcc)[_0xdff6('0x18')]();});}};}function handleEntityNotFound(_0x519083,_0x5c66d3){return function(_0x5640cc){if(!_0x5640cc){_0x519083['sendStatus'](0x194);}return _0x5640cc;};}function handleError(_0x4b6124,_0x462d24){_0x462d24=_0x462d24||0x1f4;return function(_0x270947){logger[_0xdff6('0x25')](_0x270947['stack']);if(_0x270947[_0xdff6('0x26')]){delete _0x270947[_0xdff6('0x26')];}_0x4b6124[_0xdff6('0x17')](_0x462d24)[_0xdff6('0x27')](_0x270947);};}exports['update']=function(_0xe3cad7,_0x8ef806){if(_0xe3cad7[_0xdff6('0x28')]['id']){delete _0xe3cad7[_0xdff6('0x28')]['id'];}return db[_0xdff6('0x29')][_0xdff6('0x2a')]({'where':{'id':_0xe3cad7['params']['id']}})[_0xdff6('0x23')](handleEntityNotFound(_0x8ef806,null))[_0xdff6('0x23')](saveUpdates(_0xe3cad7[_0xdff6('0x28')],null))[_0xdff6('0x23')](respondWithResult(_0x8ef806,null))['catch'](handleError(_0x8ef806,null));};exports[_0xdff6('0x24')]=function(_0x39df51,_0x2cfb42){return db[_0xdff6('0x29')][_0xdff6('0x2a')]({'where':{'id':_0x39df51[_0xdff6('0x2b')]['id']}})['then'](handleEntityNotFound(_0x2cfb42,null))['then'](removeEntity(_0x2cfb42,null))['catch'](handleError(_0x2cfb42,null));}; \ No newline at end of file +var _0x512c=['sendStatus','error','stack','name','send','body','Action','find','catch','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','update','then','destroy'];(function(_0x5b5d2d,_0x1eed73){var _0x2883c4=function(_0x467945){while(--_0x467945){_0x5b5d2d['push'](_0x5b5d2d['shift']());}};_0x2883c4(++_0x1eed73);}(_0x512c,0x1b7));var _0xc512=function(_0x19fcae,_0x459694){_0x19fcae=_0x19fcae-0x0;var _0x2d2725=_0x512c[_0x19fcae];return _0x2d2725;};'use strict';var emlformat=require(_0xc512('0x0'));var rimraf=require(_0xc512('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc512('0x2'));var rp=require('request-promise');var moment=require(_0xc512('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc512('0x4'));var util=require(_0xc512('0x5'));var path=require(_0xc512('0x6'));var sox=require(_0xc512('0x7'));var csv=require(_0xc512('0x8'));var ejs=require(_0xc512('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc512('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc512('0xb'));var deskjs=require(_0xc512('0xc'));var toCsv=require(_0xc512('0x8'));var querystring=require(_0xc512('0xd'));var Papa=require('papaparse');var Redis=require(_0xc512('0xe'));var authService=require(_0xc512('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xc512('0x10'));var hardwareService=require(_0xc512('0x11'));var logger=require(_0xc512('0x12'))(_0xc512('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc512('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa0b4b8,_0x13f6e1){_0x13f6e1=_0x13f6e1||0xcc;return function(_0x20f977){if(_0x20f977){return _0xa0b4b8['sendStatus'](_0x13f6e1);}return _0xa0b4b8[_0xc512('0x15')](_0x13f6e1)[_0xc512('0x16')]();};}function respondWithResult(_0x170665,_0x5ea067){_0x5ea067=_0x5ea067||0xc8;return function(_0x3c2c04){if(_0x3c2c04){return _0x170665[_0xc512('0x15')](_0x5ea067)[_0xc512('0x17')](_0x3c2c04);}};}function respondWithFilteredResult(_0x9b63e0,_0x570314){return function(_0x5c7e54){if(_0x5c7e54){var _0xd6d099=typeof _0x570314[_0xc512('0x18')]===_0xc512('0x19')&&typeof _0x570314['limit']===_0xc512('0x19');var _0x1ca632=_0x5c7e54[_0xc512('0x1a')];var _0x4a41eb=_0xd6d099?0x0:_0x570314[_0xc512('0x18')];var _0xbeb118=_0xd6d099?_0x5c7e54[_0xc512('0x1a')]:_0x570314[_0xc512('0x18')]+_0x570314[_0xc512('0x1b')];var _0xc2d78c;if(_0xbeb118>=_0x1ca632){_0xbeb118=_0x1ca632;_0xc2d78c=0xc8;}else{_0xc2d78c=0xce;}_0x9b63e0['status'](_0xc2d78c);return _0x9b63e0['set'](_0xc512('0x1c'),_0x4a41eb+'-'+_0xbeb118+'/'+_0x1ca632)[_0xc512('0x17')](_0x5c7e54);}return null;};}function patchUpdates(_0x3a8c7e){return function(_0x29b104){try{jsonpatch[_0xc512('0x1d')](_0x29b104,_0x3a8c7e,!![]);}catch(_0x5c6336){return BPromise['reject'](_0x5c6336);}return _0x29b104[_0xc512('0x1e')]();};}function saveUpdates(_0x1d8da8,_0x3a0fa7){return function(_0x5960d2){if(_0x5960d2){return _0x5960d2[_0xc512('0x1f')](_0x1d8da8)[_0xc512('0x20')](function(_0xe16123){return _0xe16123;});}return null;};}function removeEntity(_0x3e24ad,_0x58ccfe){return function(_0x2e880a){if(_0x2e880a){return _0x2e880a[_0xc512('0x21')]()[_0xc512('0x20')](function(){_0x3e24ad[_0xc512('0x15')](0xcc)[_0xc512('0x16')]();});}};}function handleEntityNotFound(_0x43db34,_0x467660){return function(_0x4c75b2){if(!_0x4c75b2){_0x43db34[_0xc512('0x22')](0x194);}return _0x4c75b2;};}function handleError(_0x1927ac,_0xc375e1){_0xc375e1=_0xc375e1||0x1f4;return function(_0x37f18c){logger[_0xc512('0x23')](_0x37f18c[_0xc512('0x24')]);if(_0x37f18c[_0xc512('0x25')]){delete _0x37f18c['name'];}_0x1927ac[_0xc512('0x15')](_0xc375e1)[_0xc512('0x26')](_0x37f18c);};}exports[_0xc512('0x1f')]=function(_0x2b31b4,_0x3a43af){if(_0x2b31b4[_0xc512('0x27')]['id']){delete _0x2b31b4[_0xc512('0x27')]['id'];}return db[_0xc512('0x28')][_0xc512('0x29')]({'where':{'id':_0x2b31b4['params']['id']}})[_0xc512('0x20')](handleEntityNotFound(_0x3a43af,null))[_0xc512('0x20')](saveUpdates(_0x2b31b4[_0xc512('0x27')],null))['then'](respondWithResult(_0x3a43af,null))[_0xc512('0x2a')](handleError(_0x3a43af,null));};exports['destroy']=function(_0x43b7b5,_0x71dafa){return db[_0xc512('0x28')]['find']({'where':{'id':_0x43b7b5['params']['id']}})[_0xc512('0x20')](handleEntityNotFound(_0x71dafa,null))[_0xc512('0x20')](removeEntity(_0x71dafa,null))[_0xc512('0x2a')](handleError(_0x71dafa,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 5e60bf3..2e216ad 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 _0xf3e2=['moment','bluebird','request-promise','path','../../config/environment','exports','define','Action','tools_actions','lodash','util','../../config/logger','api'];(function(_0x51ef52,_0x30301d){var _0x521960=function(_0x579b92){while(--_0x579b92){_0x51ef52['push'](_0x51ef52['shift']());}};_0x521960(++_0x30301d);}(_0xf3e2,0x168));var _0x2f3e=function(_0xca5fbd,_0x479c8e){_0xca5fbd=_0xca5fbd-0x0;var _0x5ee881=_0xf3e2[_0xca5fbd];return _0x5ee881;};'use strict';var _=require(_0x2f3e('0x0'));var util=require(_0x2f3e('0x1'));var logger=require(_0x2f3e('0x2'))(_0x2f3e('0x3'));var moment=require(_0x2f3e('0x4'));var BPromise=require(_0x2f3e('0x5'));var rp=require(_0x2f3e('0x6'));var fs=require('fs');var path=require(_0x2f3e('0x7'));var rimraf=require('rimraf');var config=require(_0x2f3e('0x8'));var attributes=require('./action.attributes');module[_0x2f3e('0x9')]=function(_0xd3f5b,_0x3a0b5a){return _0xd3f5b[_0x2f3e('0xa')](_0x2f3e('0xb'),attributes,{'tableName':_0x2f3e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8998=['Action','tools_actions','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','exports'];(function(_0xa5a920,_0x2d8772){var _0x596618=function(_0x5eab42){while(--_0x5eab42){_0xa5a920['push'](_0xa5a920['shift']());}};_0x596618(++_0x2d8772);}(_0x8998,0x1ca));var _0x8899=function(_0x72eab2,_0x18f554){_0x72eab2=_0x72eab2-0x0;var _0x160c8a=_0x8998[_0x72eab2];return _0x160c8a;};'use strict';var _=require(_0x8899('0x0'));var util=require(_0x8899('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8899('0x2'));var BPromise=require(_0x8899('0x3'));var rp=require(_0x8899('0x4'));var fs=require('fs');var path=require(_0x8899('0x5'));var rimraf=require(_0x8899('0x6'));var config=require(_0x8899('0x7'));var attributes=require(_0x8899('0x8'));module[_0x8899('0x9')]=function(_0x333623,_0x28947d){return _0x333623['define'](_0x8899('0xa'),attributes,{'tableName':_0x8899('0xb'),'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 58dbc78..aff3c30 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 _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(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x53ec,0x192));var _0xc53e=function(_0x1d7c83,_0x2d8f2d){_0x1d7c83=_0x1d7c83-0x0;var _0x283ef2=_0x53ec[_0x1d7c83];return _0x283ef2;};'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 +var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x54b7a3,_0x103608){var _0x1813f1=function(_0x300fa7){while(--_0x300fa7){_0x54b7a3['push'](_0x54b7a3['shift']());}};_0x1813f1(++_0x103608);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xc4aa[_0x5d2803];return _0xdcad2c;};'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')]('Action,\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/action/index.js b/server/api/action/index.js index 9a59d4c..ac1ef91 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 _0xdd3b=['delete','/:id','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./action.controller','put','isAuthenticated','update'];(function(_0x583a65,_0x5a0be4){var _0x4d8c44=function(_0x487f84){while(--_0x487f84){_0x583a65['push'](_0x583a65['shift']());}};_0x4d8c44(++_0x5a0be4);}(_0xdd3b,0x103));var _0xbdd3=function(_0x3584ac,_0x53b3f5){_0x3584ac=_0x3584ac-0x0;var _0x42a40d=_0xdd3b[_0x3584ac];return _0x42a40d;};'use strict';var multer=require(_0xbdd3('0x0'));var util=require(_0xbdd3('0x1'));var path=require(_0xbdd3('0x2'));var timeout=require(_0xbdd3('0x3'));var express=require(_0xbdd3('0x4'));var router=express[_0xbdd3('0x5')]();var fs_extra=require(_0xbdd3('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xbdd3('0x7'));var config=require(_0xbdd3('0x8'));var controller=require(_0xbdd3('0x9'));router[_0xbdd3('0xa')]('/:id',auth[_0xbdd3('0xb')](),controller[_0xbdd3('0xc')]);router[_0xbdd3('0xd')](_0xbdd3('0xe'),auth[_0xbdd3('0xb')](),controller['destroy']);module[_0xbdd3('0xf')]=router; \ No newline at end of file +var _0x550a=['../../components/interaction/service','../../config/environment','./action.controller','/:id','delete','isAuthenticated','destroy','exports','path','connect-timeout','express','Router','fs-extra'];(function(_0x196f02,_0x5265c0){var _0x153425=function(_0x8851a8){while(--_0x8851a8){_0x196f02['push'](_0x196f02['shift']());}};_0x153425(++_0x5265c0);}(_0x550a,0xe5));var _0xa550=function(_0x30a613,_0x4b26e6){_0x30a613=_0x30a613-0x0;var _0x435f89=_0x550a[_0x30a613];return _0x435f89;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa550('0x0'));var timeout=require(_0xa550('0x1'));var express=require(_0xa550('0x2'));var router=express[_0xa550('0x3')]();var fs_extra=require(_0xa550('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa550('0x5'));var config=require(_0xa550('0x6'));var controller=require(_0xa550('0x7'));router['put'](_0xa550('0x8'),auth['isAuthenticated'](),controller['update']);router[_0xa550('0x9')](_0xa550('0x8'),auth[_0xa550('0xa')](),controller[_0xa550('0xb')]);module[_0xa550('0xc')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 38e0198..173ed16 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 _0x2eb2=['TEXT','exports','STRING'];(function(_0x365a23,_0x5d9cf7){var _0x41537d=function(_0xae9a02){while(--_0xae9a02){_0x365a23['push'](_0x365a23['shift']());}};_0x41537d(++_0x5d9cf7);}(_0x2eb2,0x19f));var _0x22eb=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x2eb2[_0x46aff0];return _0x9d78cf;};'use strict';var Sequelize=require('sequelize');module[_0x22eb('0x0')]={'name':{'type':Sequelize[_0x22eb('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x22eb('0x1')]},'parent':{'type':Sequelize[_0x22eb('0x1')]},'table':{'type':Sequelize[_0x22eb('0x1')]},'conditions':{'type':Sequelize[_0x22eb('0x2')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x8ef6=['STRING','TEXT','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8ef6,0xf2));var _0x68ef=function(_0x168d64,_0x221658){_0x168d64=_0x168d64-0x0;var _0x43c715=_0x8ef6[_0x168d64];return _0x43c715;};'use strict';var Sequelize=require(_0x68ef('0x0'));module[_0x68ef('0x1')]={'name':{'type':Sequelize[_0x68ef('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x68ef('0x2')]},'parent':{'type':Sequelize[_0x68ef('0x2')]},'table':{'type':Sequelize[_0x68ef('0x2')]},'conditions':{'type':Sequelize[_0x68ef('0x3')]},'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 807fed9..f1b600a 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 _0x4790=['save','update','then','destroy','CustomReports','stack','name','send','AnalyticCustomReport','rawAttributes','key','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','includeAll','include','catch','params','fields','options','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%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','IS\x20NOT\x20EMPTY','rules','group','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','findAll','keyBy','select','from','table','MetricId','metric','function','replace','groupBy','orderBy','DESC','field','joins','parse','parentKey','foreignTable','format','%s.%s\x20=\x20%s.%s','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','join','operator','Please\x20insert\x20at\x20least\x20one\x20field','alias','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','child_process','fork','../../components/export/','savename','countTable','runReport','SUM(%s)','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject'];(function(_0x490be3,_0xf0fca3){var _0x3f5140=function(_0x15fa80){while(--_0x15fa80){_0x490be3['push'](_0x490be3['shift']());}};_0x3f5140(++_0xf0fca3);}(_0x4790,0x84));var _0x0479=function(_0x50e40b,_0x338d17){_0x50e40b=_0x50e40b-0x0;var _0x2608b7=_0x4790[_0x50e40b];return _0x2608b7;};'use strict';var emlformat=require(_0x0479('0x0'));var rimraf=require(_0x0479('0x1'));var zipdir=require(_0x0479('0x2'));var jsonpatch=require(_0x0479('0x3'));var rp=require(_0x0479('0x4'));var moment=require(_0x0479('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0479('0x6'));var util=require(_0x0479('0x7'));var path=require(_0x0479('0x8'));var sox=require(_0x0479('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0479('0xa'));var _=require(_0x0479('0xb'));var squel=require(_0x0479('0xc'));var crypto=require('crypto');var jsforce=require(_0x0479('0xd'));var deskjs=require(_0x0479('0xe'));var toCsv=require(_0x0479('0xf'));var querystring=require(_0x0479('0x10'));var Papa=require(_0x0479('0x11'));var Redis=require('ioredis');var authService=require(_0x0479('0x12'));var qs=require(_0x0479('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0479('0x14'));var logger=require(_0x0479('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x0479('0x16'));var licenseUtil=require(_0x0479('0x17'));var db=require('../../mysqldb')['db'];var dbH=require(_0x0479('0x18'))[_0x0479('0x19')];function respondWithStatusCode(_0x1d7828,_0x4bfb59){_0x4bfb59=_0x4bfb59||0xcc;return function(_0x5ea6aa){if(_0x5ea6aa){return _0x1d7828[_0x0479('0x1a')](_0x4bfb59);}return _0x1d7828[_0x0479('0x1b')](_0x4bfb59)['end']();};}function respondWithResult(_0x4b58db,_0x5b1b22){_0x5b1b22=_0x5b1b22||0xc8;return function(_0x5f0243){if(_0x5f0243){return _0x4b58db[_0x0479('0x1b')](_0x5b1b22)[_0x0479('0x1c')](_0x5f0243);}};}function respondWithFilteredResult(_0x2d5d15,_0x15fa6a){return function(_0x34f302){if(_0x34f302){var _0x13d590=typeof _0x15fa6a['offset']===_0x0479('0x1d')&&typeof _0x15fa6a[_0x0479('0x1e')]===_0x0479('0x1d');var _0x258b43=_0x34f302[_0x0479('0x1f')];var _0x85b8b2=_0x13d590?0x0:_0x15fa6a[_0x0479('0x20')];var _0x70a67a=_0x13d590?_0x34f302[_0x0479('0x1f')]:_0x15fa6a[_0x0479('0x20')]+_0x15fa6a[_0x0479('0x1e')];var _0x2e9233;if(_0x70a67a>=_0x258b43){_0x70a67a=_0x258b43;_0x2e9233=0xc8;}else{_0x2e9233=0xce;}_0x2d5d15['status'](_0x2e9233);return _0x2d5d15['set'](_0x0479('0x21'),_0x85b8b2+'-'+_0x70a67a+'/'+_0x258b43)[_0x0479('0x1c')](_0x34f302);}return null;};}function patchUpdates(_0x1c9f0e){return function(_0xeeb3ef){try{jsonpatch[_0x0479('0x22')](_0xeeb3ef,_0x1c9f0e,!![]);}catch(_0x30cfa7){return BPromise[_0x0479('0x23')](_0x30cfa7);}return _0xeeb3ef[_0x0479('0x24')]();};}function saveUpdates(_0x3f61d7,_0x5d5a52){return function(_0x581785){if(_0x581785){return _0x581785[_0x0479('0x25')](_0x3f61d7)[_0x0479('0x26')](function(_0x51b8b6){return _0x51b8b6;});}return null;};}function removeEntity(_0x581178,_0x36257a){return function(_0x2c9bf5){if(_0x2c9bf5){return _0x2c9bf5[_0x0479('0x27')]()['then'](function(){var _0x2fb922=_0x2c9bf5['get']({'plain':!![]});var _0x2da530=_0x0479('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x2da530,'resourceId':_0x2fb922['id']}})[_0x0479('0x26')](function(){return _0x2c9bf5;});})['then'](function(){_0x581178['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x53508c,_0x113ca9){return function(_0x546851){if(!_0x546851){_0x53508c[_0x0479('0x1a')](0x194);}return _0x546851;};}function handleError(_0x284b45,_0x544c14){_0x544c14=_0x544c14||0x1f4;return function(_0x51efa1){logger['error'](_0x51efa1[_0x0479('0x29')]);if(_0x51efa1[_0x0479('0x2a')]){delete _0x51efa1[_0x0479('0x2a')];}_0x284b45[_0x0479('0x1b')](_0x544c14)[_0x0479('0x2b')](_0x51efa1);};}exports['index']=function(_0x408c3a,_0x23b8a3){var _0x348a66={},_0x1aeede={},_0x190932={'count':0x0,'rows':[]};var _0x2aef6b=_['map'](db[_0x0479('0x2c')][_0x0479('0x2d')],function(_0x19f386){return{'name':_0x19f386['fieldName'],'type':_0x19f386['type'][_0x0479('0x2e')]};});_0x1aeede[_0x0479('0x2f')]=_[_0x0479('0x30')](_0x2aef6b,_0x0479('0x2a'));_0x1aeede[_0x0479('0x31')]=_[_0x0479('0x32')](_0x408c3a[_0x0479('0x31')]);_0x1aeede[_0x0479('0x33')]=_['intersection'](_0x1aeede[_0x0479('0x2f')],_0x1aeede[_0x0479('0x31')]);_0x348a66['attributes']=_[_0x0479('0x34')](_0x1aeede[_0x0479('0x2f')],qs['fields'](_0x408c3a['query']['fields']));_0x348a66[_0x0479('0x35')]=_0x348a66[_0x0479('0x35')][_0x0479('0x36')]?_0x348a66['attributes']:_0x1aeede[_0x0479('0x2f')];if(!_0x408c3a['query'][_0x0479('0x37')](_0x0479('0x38'))){_0x348a66['limit']=qs['limit'](_0x408c3a[_0x0479('0x31')][_0x0479('0x1e')]);_0x348a66[_0x0479('0x20')]=qs['offset'](_0x408c3a[_0x0479('0x31')]['offset']);}_0x348a66[_0x0479('0x39')]=qs[_0x0479('0x3a')](_0x408c3a[_0x0479('0x31')][_0x0479('0x3a')]);_0x348a66['where']=qs['filters'](_[_0x0479('0x3b')](_0x408c3a[_0x0479('0x31')],_0x1aeede[_0x0479('0x33')]),_0x2aef6b);if(_0x408c3a[_0x0479('0x31')][_0x0479('0x3c')]){_0x348a66[_0x0479('0x3d')]=_['merge'](_0x348a66[_0x0479('0x3d')],{'$or':_[_0x0479('0x30')](_0x2aef6b,function(_0x3f43bd){if(_0x3f43bd[_0x0479('0x3e')]!==_0x0479('0x3f')){var _0x2803a2={};_0x2803a2[_0x3f43bd[_0x0479('0x2a')]]={'$like':'%'+_0x408c3a[_0x0479('0x31')]['filter']+'%'};return _0x2803a2;}})});}_0x348a66=_[_0x0479('0x40')]({},_0x348a66,_0x408c3a['options']);var _0x3977e6={'where':_0x348a66[_0x0479('0x3d')]};return db['AnalyticCustomReport'][_0x0479('0x1f')](_0x3977e6)['then'](function(_0x372a51){_0x190932[_0x0479('0x1f')]=_0x372a51;if(_0x408c3a[_0x0479('0x31')][_0x0479('0x41')]){_0x348a66[_0x0479('0x42')]=[{'all':!![]}];}return db['AnalyticCustomReport']['findAll'](_0x348a66);})[_0x0479('0x26')](function(_0x3c24c2){_0x190932['rows']=_0x3c24c2;return _0x190932;})[_0x0479('0x26')](respondWithFilteredResult(_0x23b8a3,_0x348a66))[_0x0479('0x43')](handleError(_0x23b8a3,null));};exports['show']=function(_0x59246a,_0xb3749b){var _0x24ff72={'raw':![],'where':{'id':_0x59246a[_0x0479('0x44')]['id']}},_0x4a5426={};_0x4a5426[_0x0479('0x2f')]=_['keys'](db[_0x0479('0x2c')][_0x0479('0x2d')]);_0x4a5426[_0x0479('0x31')]=_[_0x0479('0x32')](_0x59246a[_0x0479('0x31')]);_0x4a5426[_0x0479('0x33')]=_[_0x0479('0x34')](_0x4a5426[_0x0479('0x2f')],_0x4a5426[_0x0479('0x31')]);_0x24ff72[_0x0479('0x35')]=_[_0x0479('0x34')](_0x4a5426[_0x0479('0x2f')],qs['fields'](_0x59246a[_0x0479('0x31')][_0x0479('0x45')]));_0x24ff72[_0x0479('0x35')]=_0x24ff72[_0x0479('0x35')][_0x0479('0x36')]?_0x24ff72[_0x0479('0x35')]:_0x4a5426[_0x0479('0x2f')];if(_0x59246a[_0x0479('0x31')][_0x0479('0x41')]){_0x24ff72[_0x0479('0x42')]=[{'all':!![]}];}_0x24ff72=_[_0x0479('0x40')]({},_0x24ff72,_0x59246a[_0x0479('0x46')]);return db[_0x0479('0x2c')][_0x0479('0x47')](_0x24ff72)[_0x0479('0x26')](handleEntityNotFound(_0xb3749b,null))[_0x0479('0x26')](respondWithResult(_0xb3749b,null))[_0x0479('0x43')](handleError(_0xb3749b,null));};exports[_0x0479('0x48')]=function(_0x4615fd,_0x241715){return db[_0x0479('0x2c')][_0x0479('0x48')](_0x4615fd['body'],{})[_0x0479('0x26')](function(_0x3d65dc){var _0x3462e5=_0x4615fd[_0x0479('0x49')][_0x0479('0x4a')]({'plain':!![]});if(!_0x3462e5)throw new Error(_0x0479('0x4b'));if(_0x3462e5[_0x0479('0x4c')]==='user'){var _0x547622=_0x3d65dc[_0x0479('0x4a')]({'plain':!![]});var _0x16c467=_0x0479('0x4d');return db[_0x0479('0x4e')]['find']({'where':{'name':_0x16c467,'userProfileId':_0x3462e5[_0x0479('0x4f')]},'raw':!![]})[_0x0479('0x26')](function(_0x2c28e9){if(_0x2c28e9&&_0x2c28e9[_0x0479('0x50')]===0x0){return db[_0x0479('0x51')][_0x0479('0x48')]({'name':_0x547622[_0x0479('0x2a')],'resourceId':_0x547622['id'],'type':_0x0479('0x28'),'sectionId':_0x2c28e9['id']},{})[_0x0479('0x26')](function(){return _0x3d65dc;});}else{return _0x3d65dc;}})[_0x0479('0x43')](function(_0x544a8e){logger['error'](_0x0479('0x52'),_0x544a8e);throw _0x544a8e;});}return _0x3d65dc;})[_0x0479('0x26')](respondWithResult(_0x241715,0xc9))[_0x0479('0x43')](handleError(_0x241715,null));};exports[_0x0479('0x25')]=function(_0x1c4d90,_0x3483b9){if(_0x1c4d90[_0x0479('0x53')]['id']){delete _0x1c4d90['body']['id'];}return db[_0x0479('0x2c')][_0x0479('0x47')]({'where':{'id':_0x1c4d90[_0x0479('0x44')]['id']}})[_0x0479('0x26')](handleEntityNotFound(_0x3483b9,null))[_0x0479('0x26')](saveUpdates(_0x1c4d90[_0x0479('0x53')],null))[_0x0479('0x26')](respondWithResult(_0x3483b9,null))[_0x0479('0x43')](handleError(_0x3483b9,null));};exports['destroy']=function(_0x24e0e9,_0x3d9ac1){return db[_0x0479('0x2c')]['find']({'where':{'id':_0x24e0e9[_0x0479('0x44')]['id']}})[_0x0479('0x26')](handleEntityNotFound(_0x3d9ac1,null))[_0x0479('0x26')](removeEntity(_0x3d9ac1,null))[_0x0479('0x43')](handleError(_0x3d9ac1,null));};exports[_0x0479('0x54')]=function(_0x159f0,_0x4ed115){var _0x77839a=0xa;var _0x465915=['join',_0x0479('0x55'),_0x0479('0x56'),_0x0479('0x57')];var _0xfd6658={'SUM':'SUM(%s)','COUNT':_0x0479('0x58'),'COUNT DISTINCT':_0x0479('0x59'),'MAX':_0x0479('0x5a'),'MIN':_0x0479('0x5b'),'AVG':_0x0479('0x5c'),'GROUP_CONCAT':_0x0479('0x5d'),'GROUP_CONCAT ASC':_0x0479('0x5e'),'GROUP_CONCAT DESC':_0x0479('0x5f')};var _0x1b1187={'SEC_TO_TIME':_0x0479('0x60'),'DATE':_0x0479('0x61'),'HOUR':_0x0479('0x62'),'ROUND':_0x0479('0x63'),'UNIX_TIMESTAMP':_0x0479('0x64')};var _0x4b1932=function(_0x7a7200){return!_[_0x0479('0x65')]([_0x0479('0x66'),_0x0479('0x67'),_0x0479('0x68'),_0x0479('0x69')],_0x7a7200);};var _0x4045c3=function(_0x303182){if(!_0x303182||!_0x303182[_0x0479('0x6a')]['length']){return'';}for(var _0x36b3e9='(',_0x323aba=0x0;_0x323aba<_0x303182[_0x0479('0x6a')][_0x0479('0x36')];_0x323aba+=0x1){_0x323aba>0x0&&(_0x36b3e9+='\x20'+_0x303182['operator']+'\x20');_0x36b3e9+=_0x303182[_0x0479('0x6a')][_0x323aba]['group']?_0x4045c3(_0x303182[_0x0479('0x6a')][_0x323aba][_0x0479('0x6b')]):_0x303182[_0x0479('0x6a')][_0x323aba]['field']+'\x20'+_0x303182[_0x0479('0x6a')][_0x323aba][_0x0479('0x6c')]+(_0x4b1932(_0x303182[_0x0479('0x6a')][_0x323aba][_0x0479('0x6c')])?'\x20'+_0x303182[_0x0479('0x6a')][_0x323aba][_0x0479('0x6d')]:'');}return _0x36b3e9+')';};var _0x251d00={'where':{'id':_0x159f0[_0x0479('0x44')]['id']}},_0x4428f8,_0x2c734b,_0x2779fa,_0x616007,_0xacc7e9;_0x251d00=_[_0x0479('0x40')]({},_0x251d00,_0x159f0[_0x0479('0x46')]);return db[_0x0479('0x2c')][_0x0479('0x47')](_0x251d00)['then'](function(_0x23c881){if(_0x23c881){_0x4428f8=_0x23c881;return _0x23c881[_0x0479('0x6e')]();}return null;})[_0x0479('0x26')](function(_0x368d7a){if(_0x368d7a){if(!_0x368d7a[_0x0479('0x36')]){throw new db[(_0x0479('0x6f'))][(_0x0479('0x70'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2c734b=_0x368d7a;return db[_0x0479('0x71')][_0x0479('0x72')]({'raw':!![]});}return null;})['then'](function(_0x246e9f){if(_0x246e9f){_0x2779fa=_[_0x0479('0x73')](_0x246e9f,'id');var _0xe7edd4;var _0x530339=squel[_0x0479('0x74')]();_0x530339[_0x0479('0x75')](_0x4428f8[_0x0479('0x76')]);for(var _0x41e716=0x0;_0x41e716<_0x2c734b[_0x0479('0x36')];_0x41e716+=0x1){_0xe7edd4=_0x2c734b[_0x41e716]['MetricId']?_0x2779fa[_0x2c734b[_0x41e716][_0x0479('0x77')]][_0x0479('0x78')]:_0x2c734b[_0x41e716]['field'];_0xe7edd4=_0x2c734b[_0x41e716][_0x0479('0x79')]?_[_0x0479('0x7a')](_0xfd6658[_0x2c734b[_0x41e716]['function']],'%s',_0xe7edd4):_0xe7edd4;_0xe7edd4=_0x2c734b[_0x41e716]['format']?_[_0x0479('0x7a')](_0x1b1187[_0x2c734b[_0x41e716]['format']],'%s',_0xe7edd4):_0xe7edd4;if(_0x2c734b[_0x41e716][_0x0479('0x7b')]){_0x530339[_0x0479('0x6b')](_0xe7edd4);}_0x2c734b[_0x41e716][_0x0479('0x7c')]&&_0x530339[_0x0479('0x39')](_0xe7edd4,_0x2c734b[_0x41e716]['orderBy']===_0x0479('0x7d')?![]:!![]);_0x530339[_0x0479('0x7e')](_0xe7edd4,_0x2c734b[_0x41e716]['alias']||_0xe7edd4);}if(_0x4428f8['joins']){_0x4428f8[_0x0479('0x7f')]=JSON[_0x0479('0x80')](_0x4428f8[_0x0479('0x7f')]);for(var _0x2c0d6a=0x0;_0x2c0d6a<_0x4428f8[_0x0479('0x7f')]['length'];_0x2c0d6a+=0x1){if(_0x4428f8[_0x0479('0x7f')][_0x2c0d6a][_0x0479('0x3e')]&&_[_0x0479('0x65')](_0x465915,_0x4428f8[_0x0479('0x7f')][_0x2c0d6a][_0x0479('0x3e')])&&_0x4428f8[_0x0479('0x7f')][_0x2c0d6a][_0x0479('0x81')]&&_0x4428f8['joins'][_0x2c0d6a][_0x0479('0x82')]&&_0x4428f8[_0x0479('0x7f')][_0x2c0d6a]['foreignKey']){_0x530339[_0x4428f8[_0x0479('0x7f')][_0x2c0d6a]['type']](_0x4428f8[_0x0479('0x7f')][_0x2c0d6a][_0x0479('0x82')],null,util[_0x0479('0x83')](_0x0479('0x84'),_0x4428f8[_0x0479('0x76')],_0x4428f8['joins'][_0x2c0d6a][_0x0479('0x81')],_0x4428f8[_0x0479('0x7f')][_0x2c0d6a][_0x0479('0x82')],_0x4428f8[_0x0479('0x7f')][_0x2c0d6a][_0x0479('0x85')]));}}}if(_0x4428f8[_0x0479('0x86')]){_0x4428f8[_0x0479('0x86')]=JSON['parse'](_0x4428f8[_0x0479('0x86')]);_0x530339[_0x0479('0x3d')](_0x4045c3(_0x4428f8[_0x0479('0x86')][_0x0479('0x6b')]));}_0xacc7e9=_0x530339[_0x0479('0x87')]();_0x530339['limit'](_0x77839a);_0x530339[_0x0479('0x20')](0x0);logger[_0x0479('0x88')](_0x0479('0x89'),_0x530339[_0x0479('0x8a')]());return dbH[_0x0479('0x8b')][_0x0479('0x31')](_0x530339[_0x0479('0x8a')](),{'type':dbH[_0x0479('0x8b')][_0x0479('0x8c')][_0x0479('0x8d')]});}})[_0x0479('0x26')](respondWithResult(_0x4ed115,null))['catch'](handleError(_0x4ed115,null));};function runReport(_0x15dfcf,_0x2cd4cb,_0x4a95e3){var _0x4af242=_0x2cd4cb[_0x0479('0x2a')];var _0x203d00=0xa;var _0x4f8c70=[_0x0479('0x8e'),_0x0479('0x55'),'right_join',_0x0479('0x57')];var _0x29b963={'SUM':'SUM(%s)','COUNT':_0x0479('0x58'),'COUNT DISTINCT':_0x0479('0x59'),'MAX':'MAX(%s)','MIN':_0x0479('0x5b'),'AVG':_0x0479('0x5c'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x0479('0x5e'),'GROUP_CONCAT DESC':_0x0479('0x5f')};var _0x1be678={'SEC_TO_TIME':_0x0479('0x60'),'DATE':_0x0479('0x61'),'HOUR':_0x0479('0x62'),'ROUND':_0x0479('0x63'),'UNIX_TIMESTAMP':_0x0479('0x64')};var _0x52255c=function(_0x167dab){return!_[_0x0479('0x65')]([_0x0479('0x66'),'IS\x20NOT\x20NULL',_0x0479('0x68'),_0x0479('0x69')],_0x167dab);};var _0x4bc8a8=function(_0x45a66a){if(!_0x45a66a||!_0x45a66a[_0x0479('0x6a')][_0x0479('0x36')]){return'';}for(var _0x183a20='(',_0x3ab5bb=0x0;_0x3ab5bb<_0x45a66a[_0x0479('0x6a')]['length'];_0x3ab5bb+=0x1){_0x3ab5bb>0x0&&(_0x183a20+='\x20'+_0x45a66a[_0x0479('0x8f')]+'\x20');_0x183a20+=_0x45a66a[_0x0479('0x6a')][_0x3ab5bb][_0x0479('0x6b')]?_0x4bc8a8(_0x45a66a[_0x0479('0x6a')][_0x3ab5bb][_0x0479('0x6b')]):_0x45a66a[_0x0479('0x6a')][_0x3ab5bb][_0x0479('0x7e')]+'\x20'+_0x45a66a['rules'][_0x3ab5bb][_0x0479('0x6c')]+(_0x52255c(_0x45a66a[_0x0479('0x6a')][_0x3ab5bb][_0x0479('0x6c')])?'\x20'+_0x45a66a['rules'][_0x3ab5bb]['value']:'');}return _0x183a20+')';};var _0x56b2e2={'where':{'id':_0x15dfcf['id']}},_0xfa4d22,_0x1e6ad9,_0x5b3332,_0x34552a,_0x4cbf5e;_0x56b2e2=_[_0x0479('0x40')]({},_0x56b2e2,_0x4a95e3);return db['AnalyticCustomReport'][_0x0479('0x47')](_0x56b2e2)[_0x0479('0x26')](function(_0x123923){if(_0x123923){_0xfa4d22=_0x123923;return _0x123923[_0x0479('0x6e')]();}return null;})[_0x0479('0x26')](function(_0x1ebaf3){if(_0x1ebaf3){if(!_0x1ebaf3[_0x0479('0x36')]){throw new db[(_0x0479('0x6f'))][(_0x0479('0x70'))](_0x0479('0x90'),0x193);}_0x1e6ad9=_0x1ebaf3;return db[_0x0479('0x71')][_0x0479('0x72')]({'raw':!![]});}return null;})['then'](function(_0x4a4233){if(_0x4a4233){_0x5b3332=_[_0x0479('0x73')](_0x4a4233,'id');var _0x1931d2;var _0x4ab75f=squel[_0x0479('0x74')]();_0x4ab75f['from'](_0xfa4d22[_0x0479('0x76')]);for(var _0x163054=0x0;_0x163054<_0x1e6ad9[_0x0479('0x36')];_0x163054+=0x1){_0x1931d2=_0x1e6ad9[_0x163054]['MetricId']?_0x5b3332[_0x1e6ad9[_0x163054]['MetricId']][_0x0479('0x78')]:_0x1e6ad9[_0x163054][_0x0479('0x7e')];_0x1931d2=_0x1e6ad9[_0x163054]['function']?_[_0x0479('0x7a')](_0x29b963[_0x1e6ad9[_0x163054][_0x0479('0x79')]],'%s',_0x1931d2):_0x1931d2;_0x1931d2=_0x1e6ad9[_0x163054][_0x0479('0x83')]?_[_0x0479('0x7a')](_0x1be678[_0x1e6ad9[_0x163054]['format']],'%s',_0x1931d2):_0x1931d2;if(_0x1e6ad9[_0x163054][_0x0479('0x7b')]){_0x4ab75f[_0x0479('0x6b')](_0x1931d2);}_0x1e6ad9[_0x163054][_0x0479('0x7c')]&&_0x4ab75f[_0x0479('0x39')](_0x1931d2,_0x1e6ad9[_0x163054][_0x0479('0x7c')]===_0x0479('0x7d')?![]:!![]);_0x4ab75f['field'](_0x1931d2,_0x1e6ad9[_0x163054][_0x0479('0x91')]||_0x1931d2);}if(_0xfa4d22[_0x0479('0x7f')]){_0xfa4d22['joins']=JSON[_0x0479('0x80')](_0xfa4d22['joins']);for(var _0x243553=0x0;_0x243553<_0xfa4d22[_0x0479('0x7f')][_0x0479('0x36')];_0x243553+=0x1){if(_0xfa4d22[_0x0479('0x7f')][_0x243553][_0x0479('0x3e')]&&_['includes'](_0x4f8c70,_0xfa4d22[_0x0479('0x7f')][_0x243553][_0x0479('0x3e')])&&_0xfa4d22[_0x0479('0x7f')][_0x243553][_0x0479('0x81')]&&_0xfa4d22[_0x0479('0x7f')][_0x243553][_0x0479('0x82')]&&_0xfa4d22['joins'][_0x243553][_0x0479('0x85')]){_0x4ab75f[_0xfa4d22['joins'][_0x243553][_0x0479('0x3e')]](_0xfa4d22['joins'][_0x243553][_0x0479('0x82')],null,util[_0x0479('0x83')](_0x0479('0x84'),_0xfa4d22[_0x0479('0x76')],_0xfa4d22[_0x0479('0x7f')][_0x243553]['parentKey'],_0xfa4d22[_0x0479('0x7f')][_0x243553][_0x0479('0x82')],_0xfa4d22[_0x0479('0x7f')][_0x243553][_0x0479('0x85')]));}}}if(_0xfa4d22['conditions']){_0xfa4d22['conditions']=JSON['parse'](_0xfa4d22['conditions']);_0x4ab75f['where'](_0x4bc8a8(_0xfa4d22[_0x0479('0x86')][_0x0479('0x6b')]));}_0x4cbf5e=_0x4ab75f['clone']();_0x4ab75f[_0x0479('0x1e')](_0x203d00);_0x4ab75f[_0x0479('0x20')](0x0);return;}})[_0x0479('0x26')](function(){if(_0x2cd4cb[_0x0479('0x92')]===_0x0479('0x93')){return null;}var _0x547455=_[_0x0479('0x40')](_0x2cd4cb,{'name':_0x2cd4cb[_0x0479('0x94')]||_0x2cd4cb[_0x0479('0x2a')]||_0xfa4d22[_0x0479('0x2a')],'basename':_0x4af242,'savename':util[_0x0479('0x83')](_0x0479('0x95'),_0x2cd4cb[_0x0479('0x2a')]||_0xfa4d22[_0x0479('0x2a')],require(_0x0479('0x96'))[_0x0479('0x97')](0x4),_0x2cd4cb['output']||_0x0479('0x98')),'reportId':_0xfa4d22['id'],'reportType':_0x0479('0x99')});return db[_0x0479('0x9a')][_0x0479('0x48')](_0x547455,{'raw':!![]});})[_0x0479('0x26')](function(_0x384492){if(_0xfa4d22[_0x0479('0x76')]==='cdr'){_0x4cbf5e[_0x0479('0x3d')](_0xfa4d22[_0x0479('0x76')]+_0x0479('0x9b'),_0x2cd4cb['startDate'],_0x2cd4cb[_0x0479('0x9c')]);}else{_0x4cbf5e[_0x0479('0x3d')](_0xfa4d22[_0x0479('0x76')]+_0x0479('0x9d'),_0x2cd4cb[_0x0479('0x9e')],_0x2cd4cb['endDate']);}if(_0x384492){logger[_0x0479('0x9f')](_0x0479('0xa0'),_0x4cbf5e['toString']());require(_0x0479('0xa1'))[_0x0479('0xa2')](path[_0x0479('0x8e')](__dirname,_0x0479('0xa3'),_0x384492[_0x0479('0x92')]),[_0x384492['id'],_0x4cbf5e['toString'](),path[_0x0479('0x8e')](__dirname,'../../files/reports',_0x384492[_0x0479('0xa4')]),_0x4af242]);return _0x384492;}else{var _0x56b051=squel[_0x0479('0x74')]();_0x56b051['from']('('+_0x4cbf5e[_0x0479('0x8a')]()+')',_0x0479('0xa5'));_0x56b051[_0x0479('0x7e')]('COUNT(*)',_0x0479('0x1f'));_0x4cbf5e[_0x0479('0x1e')](_0x2cd4cb['limit']||_0x203d00);_0x4cbf5e[_0x0479('0x20')](_0x2cd4cb['offset']||0x0);return dbH[_0x0479('0x8b')][_0x0479('0x31')](_0x56b051[_0x0479('0x8a')](),{'type':dbH[_0x0479('0x8b')][_0x0479('0x8c')][_0x0479('0x8d')]})[_0x0479('0x26')](function(_0x18eb7d){if(!_0x18eb7d[_0x0479('0x36')]){_0x34552a=0x0;}else{_0x34552a=_0x18eb7d[0x0][_0x0479('0x1f')]||0x0;}return dbH[_0x0479('0x8b')][_0x0479('0x31')](_0x4cbf5e['toString'](),{'type':dbH['sequelize'][_0x0479('0x8c')][_0x0479('0x8d')]});})[_0x0479('0x26')](function(_0xadfb68){return{'rows':_0xadfb68||[],'count':_0x34552a};});}});}exports['run']=function(_0x298b8d,_0x1eb909){return runReport(_0x298b8d[_0x0479('0x44')],_0x298b8d['query'],_0x298b8d['options'])[_0x0479('0x26')](respondWithResult(_0x1eb909,null))['catch'](handleError(_0x1eb909,null));};exports[_0x0479('0xa6')]=runReport;exports[_0x0479('0x31')]=function(_0x262bd8,_0x749cd1){var _0x28fe84=0xa;var _0x21aa55=[_0x0479('0x8e'),_0x0479('0x55'),'right_join',_0x0479('0x57')];var _0x4e5486={'SUM':_0x0479('0xa7'),'COUNT':_0x0479('0x58'),'COUNT DISTINCT':_0x0479('0x59'),'MAX':_0x0479('0x5a'),'MIN':_0x0479('0x5b'),'AVG':_0x0479('0x5c'),'GROUP_CONCAT':_0x0479('0x5d'),'GROUP_CONCAT ASC':_0x0479('0x5e'),'GROUP_CONCAT DESC':_0x0479('0x5f')};var _0x163910={'SEC_TO_TIME':_0x0479('0x60'),'DATE':_0x0479('0x61'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x0479('0x64')};var _0x202a07=function(_0x570ab1){return!_[_0x0479('0x65')]([_0x0479('0x66'),_0x0479('0x67'),'IS\x20EMPTY',_0x0479('0x69')],_0x570ab1);};var _0x30168a=function(_0x1a722c){if(!_0x1a722c||!_0x1a722c[_0x0479('0x6a')]['length']){return'';}for(var _0x599a3e='(',_0x412da2=0x0;_0x412da2<_0x1a722c[_0x0479('0x6a')][_0x0479('0x36')];_0x412da2+=0x1){_0x412da2>0x0&&(_0x599a3e+='\x20'+_0x1a722c[_0x0479('0x8f')]+'\x20');_0x599a3e+=_0x1a722c[_0x0479('0x6a')][_0x412da2][_0x0479('0x6b')]?_0x30168a(_0x1a722c['rules'][_0x412da2][_0x0479('0x6b')]):_0x1a722c[_0x0479('0x6a')][_0x412da2][_0x0479('0x7e')]+'\x20'+_0x1a722c['rules'][_0x412da2][_0x0479('0x6c')]+(_0x202a07(_0x1a722c['rules'][_0x412da2][_0x0479('0x6c')])?'\x20'+_0x1a722c[_0x0479('0x6a')][_0x412da2]['value']:'');}return _0x599a3e+')';};var _0x597116={'where':{'id':_0x262bd8['params']['id']}},_0xb3a73e,_0x523c2c,_0x3d7ad1,_0x415d4d,_0x53140b;_0x597116=_[_0x0479('0x40')]({},_0x597116,_0x262bd8[_0x0479('0x46')]);return db[_0x0479('0x2c')][_0x0479('0x47')](_0x597116)['then'](function(_0x3a2f1c){if(_0x3a2f1c){_0xb3a73e=_0x3a2f1c;return _0x3a2f1c[_0x0479('0x6e')]();}return null;})[_0x0479('0x26')](function(_0x3a1d27){if(_0x3a1d27){if(!_0x3a1d27[_0x0479('0x36')]){throw new db[(_0x0479('0x6f'))][(_0x0479('0x70'))](_0x0479('0x90'),0x193);}_0x523c2c=_0x3a1d27;return db[_0x0479('0x71')][_0x0479('0x72')]({'raw':!![]});}return null;})['then'](function(_0x215d0d){if(_0x215d0d){_0x3d7ad1=_[_0x0479('0x73')](_0x215d0d,'id');var _0x2ec52c;var _0x2b9d98=squel[_0x0479('0x74')]();_0x2b9d98['from'](_0xb3a73e[_0x0479('0x76')]);for(var _0x3e63a0=0x0;_0x3e63a0<_0x523c2c[_0x0479('0x36')];_0x3e63a0+=0x1){_0x2ec52c=_0x523c2c[_0x3e63a0][_0x0479('0x77')]?_0x3d7ad1[_0x523c2c[_0x3e63a0]['MetricId']]['metric']:_0x523c2c[_0x3e63a0][_0x0479('0x7e')];_0x2ec52c=_0x523c2c[_0x3e63a0][_0x0479('0x79')]?_[_0x0479('0x7a')](_0x4e5486[_0x523c2c[_0x3e63a0][_0x0479('0x79')]],'%s',_0x2ec52c):_0x2ec52c;_0x2ec52c=_0x523c2c[_0x3e63a0][_0x0479('0x83')]?_['replace'](_0x163910[_0x523c2c[_0x3e63a0][_0x0479('0x83')]],'%s',_0x2ec52c):_0x2ec52c;if(_0x523c2c[_0x3e63a0][_0x0479('0x7b')]){_0x2b9d98['group'](_0x2ec52c);}_0x523c2c[_0x3e63a0][_0x0479('0x7c')]&&_0x2b9d98[_0x0479('0x39')](_0x2ec52c,_0x523c2c[_0x3e63a0][_0x0479('0x7c')]===_0x0479('0x7d')?![]:!![]);_0x2b9d98[_0x0479('0x7e')](_0x2ec52c,_0x523c2c[_0x3e63a0][_0x0479('0x91')]||_0x2ec52c);}if(_0xb3a73e['joins']){_0xb3a73e[_0x0479('0x7f')]=JSON[_0x0479('0x80')](_0xb3a73e[_0x0479('0x7f')]);for(var _0x448ed9=0x0;_0x448ed9<_0xb3a73e[_0x0479('0x7f')][_0x0479('0x36')];_0x448ed9+=0x1){if(_0xb3a73e[_0x0479('0x7f')][_0x448ed9]['type']&&_['includes'](_0x21aa55,_0xb3a73e[_0x0479('0x7f')][_0x448ed9][_0x0479('0x3e')])&&_0xb3a73e[_0x0479('0x7f')][_0x448ed9][_0x0479('0x81')]&&_0xb3a73e[_0x0479('0x7f')][_0x448ed9]['foreignTable']&&_0xb3a73e[_0x0479('0x7f')][_0x448ed9]['foreignKey']){_0x2b9d98[_0xb3a73e[_0x0479('0x7f')][_0x448ed9]['type']](_0xb3a73e[_0x0479('0x7f')][_0x448ed9][_0x0479('0x82')],null,util[_0x0479('0x83')](_0x0479('0x84'),_0xb3a73e[_0x0479('0x76')],_0xb3a73e[_0x0479('0x7f')][_0x448ed9][_0x0479('0x81')],_0xb3a73e[_0x0479('0x7f')][_0x448ed9][_0x0479('0x82')],_0xb3a73e['joins'][_0x448ed9][_0x0479('0x85')]));}}}if(_0xb3a73e[_0x0479('0x86')]){_0xb3a73e[_0x0479('0x86')]=JSON[_0x0479('0x80')](_0xb3a73e[_0x0479('0x86')]);_0x2b9d98[_0x0479('0x3d')](_0x30168a(_0xb3a73e[_0x0479('0x86')][_0x0479('0x6b')]));}_0x53140b=_0x2b9d98['clone']();_0x2b9d98['limit'](_0x28fe84);_0x2b9d98['offset'](0x0);logger['debug'](_0x0479('0x89'),_0x2b9d98[_0x0479('0x8a')]());return dbH['sequelize']['query'](_0x2b9d98['toString'](),{'type':dbH[_0x0479('0x8b')][_0x0479('0x8c')]['SELECT']});}})[_0x0479('0x26')](function(){return{'sql':_0x53140b['toString']()};})[_0x0479('0x26')](respondWithResult(_0x749cd1,null))[_0x0479('0x43')](handleError(_0x749cd1,null));}; \ No newline at end of file +var _0x6587=['reject','save','update','then','get','CustomReports','destroy','end','error','stack','name','index','map','fieldName','type','key','model','keys','filters','intersection','fields','query','length','attributes','nolimit','order','sort','where','filter','merge','VIRTUAL','options','AnalyticCustomReport','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','role','Reports','UserProfileSection','autoAssociation','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','table','MetricId','metric','field','function','replace','format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','toString','sequelize','SELECT','join','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','ValidationErrorItem','AnalyticMetric','select','from','groupBy','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','QueryTypes','run','COUNT(%s)','SEC_TO_TIME(%s)','Limited\x20Query:','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply'];(function(_0x31752d,_0x2efff8){var _0x29da67=function(_0x296d74){while(--_0x296d74){_0x31752d['push'](_0x31752d['shift']());}};_0x29da67(++_0x2efff8);}(_0x6587,0x86));var _0x7658=function(_0x3ae2b2,_0x2d936f){_0x3ae2b2=_0x3ae2b2-0x0;var _0x1dbf00=_0x6587[_0x3ae2b2];return _0x1dbf00;};'use strict';var emlformat=require(_0x7658('0x0'));var rimraf=require(_0x7658('0x1'));var zipdir=require(_0x7658('0x2'));var jsonpatch=require(_0x7658('0x3'));var rp=require(_0x7658('0x4'));var moment=require(_0x7658('0x5'));var BPromise=require(_0x7658('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x7658('0x7'));var csv=require(_0x7658('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7658('0x9'));var _=require(_0x7658('0xa'));var squel=require('squel');var crypto=require(_0x7658('0xb'));var jsforce=require(_0x7658('0xc'));var deskjs=require(_0x7658('0xd'));var toCsv=require(_0x7658('0x8'));var querystring=require('querystring');var Papa=require(_0x7658('0xe'));var Redis=require('ioredis');var authService=require(_0x7658('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7658('0x10'));var logger=require('../../config/logger')(_0x7658('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7658('0x12'));var db=require(_0x7658('0x13'))['db'];var dbH=require(_0x7658('0x13'))[_0x7658('0x14')];function respondWithStatusCode(_0x434eef,_0x2ee4e6){_0x2ee4e6=_0x2ee4e6||0xcc;return function(_0x66fe0c){if(_0x66fe0c){return _0x434eef[_0x7658('0x15')](_0x2ee4e6);}return _0x434eef[_0x7658('0x16')](_0x2ee4e6)['end']();};}function respondWithResult(_0x5b64ee,_0x3a7dd6){_0x3a7dd6=_0x3a7dd6||0xc8;return function(_0x181a82){if(_0x181a82){return _0x5b64ee[_0x7658('0x16')](_0x3a7dd6)[_0x7658('0x17')](_0x181a82);}};}function respondWithFilteredResult(_0x3cd4ca,_0x411502){return function(_0x1970e8){if(_0x1970e8){var _0x292510=typeof _0x411502[_0x7658('0x18')]==='undefined'&&typeof _0x411502[_0x7658('0x19')]===_0x7658('0x1a');var _0x12b4ce=_0x1970e8[_0x7658('0x1b')];var _0x46af94=_0x292510?0x0:_0x411502[_0x7658('0x18')];var _0x3e31a6=_0x292510?_0x1970e8[_0x7658('0x1b')]:_0x411502['offset']+_0x411502['limit'];var _0x386ea7;if(_0x3e31a6>=_0x12b4ce){_0x3e31a6=_0x12b4ce;_0x386ea7=0xc8;}else{_0x386ea7=0xce;}_0x3cd4ca['status'](_0x386ea7);return _0x3cd4ca['set'](_0x7658('0x1c'),_0x46af94+'-'+_0x3e31a6+'/'+_0x12b4ce)['json'](_0x1970e8);}return null;};}function patchUpdates(_0x46f6c0){return function(_0x17da85){try{jsonpatch[_0x7658('0x1d')](_0x17da85,_0x46f6c0,!![]);}catch(_0x2b5d50){return BPromise[_0x7658('0x1e')](_0x2b5d50);}return _0x17da85[_0x7658('0x1f')]();};}function saveUpdates(_0x562d06,_0x28267e){return function(_0x1c6a19){if(_0x1c6a19){return _0x1c6a19[_0x7658('0x20')](_0x562d06)['then'](function(_0x5b80f6){return _0x5b80f6;});}return null;};}function removeEntity(_0x299187,_0x5e791d){return function(_0xea7f3e){if(_0xea7f3e){return _0xea7f3e['destroy']()[_0x7658('0x21')](function(){var _0x1a8f3e=_0xea7f3e[_0x7658('0x22')]({'plain':!![]});var _0x3eacf=_0x7658('0x23');return db['UserProfileResource'][_0x7658('0x24')]({'where':{'type':_0x3eacf,'resourceId':_0x1a8f3e['id']}})[_0x7658('0x21')](function(){return _0xea7f3e;});})[_0x7658('0x21')](function(){_0x299187['status'](0xcc)[_0x7658('0x25')]();});}};}function handleEntityNotFound(_0xbc14c3,_0x1e98aa){return function(_0x32c518){if(!_0x32c518){_0xbc14c3[_0x7658('0x15')](0x194);}return _0x32c518;};}function handleError(_0x305ff5,_0x4514c0){_0x4514c0=_0x4514c0||0x1f4;return function(_0x38cd80){logger[_0x7658('0x26')](_0x38cd80[_0x7658('0x27')]);if(_0x38cd80[_0x7658('0x28')]){delete _0x38cd80['name'];}_0x305ff5['status'](_0x4514c0)['send'](_0x38cd80);};}exports[_0x7658('0x29')]=function(_0x12e48d,_0x532223){var _0x17e481={},_0x54164d={},_0x3d7f26={'count':0x0,'rows':[]};var _0x13b005=_[_0x7658('0x2a')](db['AnalyticCustomReport']['rawAttributes'],function(_0x1fb721){return{'name':_0x1fb721[_0x7658('0x2b')],'type':_0x1fb721[_0x7658('0x2c')][_0x7658('0x2d')]};});_0x54164d[_0x7658('0x2e')]=_['map'](_0x13b005,_0x7658('0x28'));_0x54164d['query']=_[_0x7658('0x2f')](_0x12e48d['query']);_0x54164d[_0x7658('0x30')]=_[_0x7658('0x31')](_0x54164d[_0x7658('0x2e')],_0x54164d['query']);_0x17e481['attributes']=_[_0x7658('0x31')](_0x54164d[_0x7658('0x2e')],qs[_0x7658('0x32')](_0x12e48d[_0x7658('0x33')][_0x7658('0x32')]));_0x17e481['attributes']=_0x17e481['attributes'][_0x7658('0x34')]?_0x17e481[_0x7658('0x35')]:_0x54164d[_0x7658('0x2e')];if(!_0x12e48d[_0x7658('0x33')]['hasOwnProperty'](_0x7658('0x36'))){_0x17e481[_0x7658('0x19')]=qs[_0x7658('0x19')](_0x12e48d[_0x7658('0x33')][_0x7658('0x19')]);_0x17e481[_0x7658('0x18')]=qs[_0x7658('0x18')](_0x12e48d[_0x7658('0x33')][_0x7658('0x18')]);}_0x17e481[_0x7658('0x37')]=qs[_0x7658('0x38')](_0x12e48d['query'][_0x7658('0x38')]);_0x17e481[_0x7658('0x39')]=qs['filters'](_['pick'](_0x12e48d['query'],_0x54164d[_0x7658('0x30')]),_0x13b005);if(_0x12e48d['query'][_0x7658('0x3a')]){_0x17e481['where']=_[_0x7658('0x3b')](_0x17e481[_0x7658('0x39')],{'$or':_[_0x7658('0x2a')](_0x13b005,function(_0x2530d6){if(_0x2530d6[_0x7658('0x2c')]!==_0x7658('0x3c')){var _0x137896={};_0x137896[_0x2530d6['name']]={'$like':'%'+_0x12e48d['query'][_0x7658('0x3a')]+'%'};return _0x137896;}})});}_0x17e481=_[_0x7658('0x3b')]({},_0x17e481,_0x12e48d[_0x7658('0x3d')]);var _0x4b53a6={'where':_0x17e481[_0x7658('0x39')]};return db[_0x7658('0x3e')][_0x7658('0x1b')](_0x4b53a6)[_0x7658('0x21')](function(_0x3ad989){_0x3d7f26[_0x7658('0x1b')]=_0x3ad989;if(_0x12e48d['query'][_0x7658('0x3f')]){_0x17e481[_0x7658('0x40')]=[{'all':!![]}];}return db[_0x7658('0x3e')][_0x7658('0x41')](_0x17e481);})[_0x7658('0x21')](function(_0x4d9522){_0x3d7f26[_0x7658('0x42')]=_0x4d9522;return _0x3d7f26;})[_0x7658('0x21')](respondWithFilteredResult(_0x532223,_0x17e481))[_0x7658('0x43')](handleError(_0x532223,null));};exports[_0x7658('0x44')]=function(_0x19fd89,_0x3a90c3){var _0x39354a={'raw':![],'where':{'id':_0x19fd89[_0x7658('0x45')]['id']}},_0x1a059b={};_0x1a059b['model']=_[_0x7658('0x2f')](db[_0x7658('0x3e')][_0x7658('0x46')]);_0x1a059b[_0x7658('0x33')]=_[_0x7658('0x2f')](_0x19fd89['query']);_0x1a059b['filters']=_[_0x7658('0x31')](_0x1a059b[_0x7658('0x2e')],_0x1a059b[_0x7658('0x33')]);_0x39354a[_0x7658('0x35')]=_[_0x7658('0x31')](_0x1a059b[_0x7658('0x2e')],qs[_0x7658('0x32')](_0x19fd89[_0x7658('0x33')][_0x7658('0x32')]));_0x39354a[_0x7658('0x35')]=_0x39354a[_0x7658('0x35')][_0x7658('0x34')]?_0x39354a['attributes']:_0x1a059b[_0x7658('0x2e')];if(_0x19fd89[_0x7658('0x33')]['includeAll']){_0x39354a[_0x7658('0x40')]=[{'all':!![]}];}_0x39354a=_[_0x7658('0x3b')]({},_0x39354a,_0x19fd89[_0x7658('0x3d')]);return db[_0x7658('0x3e')][_0x7658('0x47')](_0x39354a)[_0x7658('0x21')](handleEntityNotFound(_0x3a90c3,null))[_0x7658('0x21')](respondWithResult(_0x3a90c3,null))[_0x7658('0x43')](handleError(_0x3a90c3,null));};exports['create']=function(_0x31f7e9,_0x146bca){return db[_0x7658('0x3e')][_0x7658('0x48')](_0x31f7e9[_0x7658('0x49')],{})[_0x7658('0x21')](function(_0x5dea3f){var _0x6f3b9c=_0x31f7e9[_0x7658('0x4a')]['get']({'plain':!![]});if(!_0x6f3b9c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x6f3b9c[_0x7658('0x4b')]===_0x7658('0x4a')){var _0x111e9d=_0x5dea3f[_0x7658('0x22')]({'plain':!![]});var _0x318934=_0x7658('0x4c');return db[_0x7658('0x4d')][_0x7658('0x47')]({'where':{'name':_0x318934,'userProfileId':_0x6f3b9c['userProfileId']},'raw':!![]})[_0x7658('0x21')](function(_0xa55d18){if(_0xa55d18&&_0xa55d18[_0x7658('0x4e')]===0x0){return db['UserProfileResource'][_0x7658('0x48')]({'name':_0x111e9d[_0x7658('0x28')],'resourceId':_0x111e9d['id'],'type':_0x7658('0x23'),'sectionId':_0xa55d18['id']},{})[_0x7658('0x21')](function(){return _0x5dea3f;});}else{return _0x5dea3f;}})[_0x7658('0x43')](function(_0x5599f6){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5599f6);throw _0x5599f6;});}return _0x5dea3f;})['then'](respondWithResult(_0x146bca,0xc9))[_0x7658('0x43')](handleError(_0x146bca,null));};exports[_0x7658('0x20')]=function(_0x3b1725,_0x2aa186){if(_0x3b1725[_0x7658('0x49')]['id']){delete _0x3b1725[_0x7658('0x49')]['id'];}return db[_0x7658('0x3e')][_0x7658('0x47')]({'where':{'id':_0x3b1725['params']['id']}})[_0x7658('0x21')](handleEntityNotFound(_0x2aa186,null))[_0x7658('0x21')](saveUpdates(_0x3b1725[_0x7658('0x49')],null))[_0x7658('0x21')](respondWithResult(_0x2aa186,null))['catch'](handleError(_0x2aa186,null));};exports[_0x7658('0x24')]=function(_0x18472a,_0x4e662d){return db[_0x7658('0x3e')][_0x7658('0x47')]({'where':{'id':_0x18472a['params']['id']}})[_0x7658('0x21')](handleEntityNotFound(_0x4e662d,null))['then'](removeEntity(_0x4e662d,null))[_0x7658('0x43')](handleError(_0x4e662d,null));};exports[_0x7658('0x4f')]=function(_0xf332cf,_0x1cee2f){var _0x55edd2=0xa;var _0x39a32a=['join',_0x7658('0x50'),_0x7658('0x51'),_0x7658('0x52')];var _0x4fb6ae={'SUM':_0x7658('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x7658('0x54'),'MAX':_0x7658('0x55'),'MIN':_0x7658('0x56'),'AVG':_0x7658('0x57'),'GROUP_CONCAT':_0x7658('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x7658('0x59')};var _0x3abc3d={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x7658('0x5a'),'HOUR':_0x7658('0x5b'),'ROUND':_0x7658('0x5c'),'UNIX_TIMESTAMP':_0x7658('0x5d')};var _0x21e08a=function(_0x759c15){return!_[_0x7658('0x5e')]([_0x7658('0x5f'),'IS\x20NOT\x20NULL',_0x7658('0x60'),_0x7658('0x61')],_0x759c15);};var _0x4be057=function(_0x2ef899){if(!_0x2ef899||!_0x2ef899[_0x7658('0x62')]['length']){return'';}for(var _0x114709='(',_0x165a87=0x0;_0x165a87<_0x2ef899[_0x7658('0x62')][_0x7658('0x34')];_0x165a87+=0x1){_0x165a87>0x0&&(_0x114709+='\x20'+_0x2ef899[_0x7658('0x63')]+'\x20');_0x114709+=_0x2ef899['rules'][_0x165a87][_0x7658('0x64')]?_0x4be057(_0x2ef899['rules'][_0x165a87][_0x7658('0x64')]):_0x2ef899[_0x7658('0x62')][_0x165a87]['field']+'\x20'+_0x2ef899[_0x7658('0x62')][_0x165a87][_0x7658('0x65')]+(_0x21e08a(_0x2ef899[_0x7658('0x62')][_0x165a87][_0x7658('0x65')])?'\x20'+_0x2ef899['rules'][_0x165a87][_0x7658('0x66')]:'');}return _0x114709+')';};var _0x388193={'where':{'id':_0xf332cf[_0x7658('0x45')]['id']}},_0x19e3ad,_0x2729f8,_0x48d823,_0x4b4003,_0xe0f458;_0x388193=_[_0x7658('0x3b')]({},_0x388193,_0xf332cf[_0x7658('0x3d')]);return db[_0x7658('0x3e')]['find'](_0x388193)[_0x7658('0x21')](function(_0x4a1eba){if(_0x4a1eba){_0x19e3ad=_0x4a1eba;return _0x4a1eba[_0x7658('0x67')]();}return null;})[_0x7658('0x21')](function(_0x19b70e){if(_0x19b70e){if(!_0x19b70e['length']){throw new db[(_0x7658('0x68'))]['ValidationErrorItem'](_0x7658('0x69'),0x193);}_0x2729f8=_0x19b70e;return db['AnalyticMetric'][_0x7658('0x41')]({'raw':!![]});}return null;})[_0x7658('0x21')](function(_0x266cae){if(_0x266cae){_0x48d823=_[_0x7658('0x6a')](_0x266cae,'id');var _0x206aa5;var _0x472b17=squel['select']();_0x472b17['from'](_0x19e3ad[_0x7658('0x6b')]);for(var _0xd239ea=0x0;_0xd239ea<_0x2729f8['length'];_0xd239ea+=0x1){_0x206aa5=_0x2729f8[_0xd239ea][_0x7658('0x6c')]?_0x48d823[_0x2729f8[_0xd239ea][_0x7658('0x6c')]][_0x7658('0x6d')]:_0x2729f8[_0xd239ea][_0x7658('0x6e')];_0x206aa5=_0x2729f8[_0xd239ea][_0x7658('0x6f')]?_[_0x7658('0x70')](_0x4fb6ae[_0x2729f8[_0xd239ea][_0x7658('0x6f')]],'%s',_0x206aa5):_0x206aa5;_0x206aa5=_0x2729f8[_0xd239ea][_0x7658('0x71')]?_['replace'](_0x3abc3d[_0x2729f8[_0xd239ea][_0x7658('0x71')]],'%s',_0x206aa5):_0x206aa5;if(_0x2729f8[_0xd239ea]['groupBy']){_0x472b17[_0x7658('0x64')](_0x206aa5);}_0x2729f8[_0xd239ea]['orderBy']&&_0x472b17[_0x7658('0x37')](_0x206aa5,_0x2729f8[_0xd239ea][_0x7658('0x72')]===_0x7658('0x73')?![]:!![]);_0x472b17[_0x7658('0x6e')](_0x206aa5,_0x2729f8[_0xd239ea][_0x7658('0x74')]||_0x206aa5);}if(_0x19e3ad[_0x7658('0x75')]){_0x19e3ad[_0x7658('0x75')]=JSON[_0x7658('0x76')](_0x19e3ad[_0x7658('0x75')]);for(var _0x35d3d1=0x0;_0x35d3d1<_0x19e3ad[_0x7658('0x75')][_0x7658('0x34')];_0x35d3d1+=0x1){if(_0x19e3ad[_0x7658('0x75')][_0x35d3d1][_0x7658('0x2c')]&&_[_0x7658('0x5e')](_0x39a32a,_0x19e3ad[_0x7658('0x75')][_0x35d3d1][_0x7658('0x2c')])&&_0x19e3ad['joins'][_0x35d3d1][_0x7658('0x77')]&&_0x19e3ad[_0x7658('0x75')][_0x35d3d1][_0x7658('0x78')]&&_0x19e3ad[_0x7658('0x75')][_0x35d3d1][_0x7658('0x79')]){_0x472b17[_0x19e3ad['joins'][_0x35d3d1][_0x7658('0x2c')]](_0x19e3ad[_0x7658('0x75')][_0x35d3d1][_0x7658('0x78')],null,util[_0x7658('0x71')](_0x7658('0x7a'),_0x19e3ad[_0x7658('0x6b')],_0x19e3ad[_0x7658('0x75')][_0x35d3d1]['parentKey'],_0x19e3ad[_0x7658('0x75')][_0x35d3d1]['foreignTable'],_0x19e3ad['joins'][_0x35d3d1]['foreignKey']));}}}if(_0x19e3ad[_0x7658('0x7b')]){_0x19e3ad[_0x7658('0x7b')]=JSON[_0x7658('0x76')](_0x19e3ad[_0x7658('0x7b')]);_0x472b17[_0x7658('0x39')](_0x4be057(_0x19e3ad[_0x7658('0x7b')][_0x7658('0x64')]));}_0xe0f458=_0x472b17[_0x7658('0x7c')]();_0x472b17[_0x7658('0x19')](_0x55edd2);_0x472b17[_0x7658('0x18')](0x0);logger[_0x7658('0x7d')]('Limited\x20Query:',_0x472b17[_0x7658('0x7e')]());return dbH[_0x7658('0x7f')][_0x7658('0x33')](_0x472b17[_0x7658('0x7e')](),{'type':dbH[_0x7658('0x7f')]['QueryTypes'][_0x7658('0x80')]});}})['then'](respondWithResult(_0x1cee2f,null))[_0x7658('0x43')](handleError(_0x1cee2f,null));};function runReport(_0xf9cda7,_0x24bf1a,_0x358783){var _0x3227b3=_0x24bf1a[_0x7658('0x28')];var _0x1b4443=0xa;var _0xbbaba0=[_0x7658('0x81'),_0x7658('0x50'),_0x7658('0x51'),_0x7658('0x52')];var _0x178f08={'SUM':_0x7658('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x7658('0x54'),'MAX':_0x7658('0x55'),'MIN':_0x7658('0x56'),'AVG':_0x7658('0x57'),'GROUP_CONCAT':_0x7658('0x58'),'GROUP_CONCAT ASC':_0x7658('0x82'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x221e21={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x7658('0x5a'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x7658('0x5d')};var _0xb2a5cb=function(_0x25c170){return!_[_0x7658('0x5e')]([_0x7658('0x5f'),_0x7658('0x83'),_0x7658('0x60'),'IS\x20NOT\x20EMPTY'],_0x25c170);};var _0x26a01c=function(_0x4dc042){if(!_0x4dc042||!_0x4dc042[_0x7658('0x62')]['length']){return'';}for(var _0x8c6eed='(',_0x3ea1f2=0x0;_0x3ea1f2<_0x4dc042[_0x7658('0x62')]['length'];_0x3ea1f2+=0x1){_0x3ea1f2>0x0&&(_0x8c6eed+='\x20'+_0x4dc042[_0x7658('0x63')]+'\x20');_0x8c6eed+=_0x4dc042[_0x7658('0x62')][_0x3ea1f2][_0x7658('0x64')]?_0x26a01c(_0x4dc042[_0x7658('0x62')][_0x3ea1f2][_0x7658('0x64')]):_0x4dc042['rules'][_0x3ea1f2][_0x7658('0x6e')]+'\x20'+_0x4dc042[_0x7658('0x62')][_0x3ea1f2][_0x7658('0x65')]+(_0xb2a5cb(_0x4dc042[_0x7658('0x62')][_0x3ea1f2]['condition'])?'\x20'+_0x4dc042[_0x7658('0x62')][_0x3ea1f2][_0x7658('0x66')]:'');}return _0x8c6eed+')';};var _0x22f480={'where':{'id':_0xf9cda7['id']}},_0x150ee3,_0xc27e59,_0x499fb4,_0xb34186,_0x2f879c;_0x22f480=_[_0x7658('0x3b')]({},_0x22f480,_0x358783);return db[_0x7658('0x3e')]['find'](_0x22f480)[_0x7658('0x21')](function(_0x546fdd){if(_0x546fdd){_0x150ee3=_0x546fdd;return _0x546fdd[_0x7658('0x67')]();}return null;})[_0x7658('0x21')](function(_0x36baf7){if(_0x36baf7){if(!_0x36baf7['length']){throw new db[(_0x7658('0x68'))][(_0x7658('0x84'))](_0x7658('0x69'),0x193);}_0xc27e59=_0x36baf7;return db[_0x7658('0x85')]['findAll']({'raw':!![]});}return null;})[_0x7658('0x21')](function(_0x5d2f72){if(_0x5d2f72){_0x499fb4=_['keyBy'](_0x5d2f72,'id');var _0x59af5a;var _0x558f06=squel[_0x7658('0x86')]();_0x558f06[_0x7658('0x87')](_0x150ee3['table']);for(var _0x151a8a=0x0;_0x151a8a<_0xc27e59[_0x7658('0x34')];_0x151a8a+=0x1){_0x59af5a=_0xc27e59[_0x151a8a][_0x7658('0x6c')]?_0x499fb4[_0xc27e59[_0x151a8a]['MetricId']][_0x7658('0x6d')]:_0xc27e59[_0x151a8a][_0x7658('0x6e')];_0x59af5a=_0xc27e59[_0x151a8a][_0x7658('0x6f')]?_[_0x7658('0x70')](_0x178f08[_0xc27e59[_0x151a8a][_0x7658('0x6f')]],'%s',_0x59af5a):_0x59af5a;_0x59af5a=_0xc27e59[_0x151a8a][_0x7658('0x71')]?_[_0x7658('0x70')](_0x221e21[_0xc27e59[_0x151a8a][_0x7658('0x71')]],'%s',_0x59af5a):_0x59af5a;if(_0xc27e59[_0x151a8a][_0x7658('0x88')]){_0x558f06['group'](_0x59af5a);}_0xc27e59[_0x151a8a][_0x7658('0x72')]&&_0x558f06[_0x7658('0x37')](_0x59af5a,_0xc27e59[_0x151a8a][_0x7658('0x72')]===_0x7658('0x73')?![]:!![]);_0x558f06[_0x7658('0x6e')](_0x59af5a,_0xc27e59[_0x151a8a]['alias']||_0x59af5a);}if(_0x150ee3[_0x7658('0x75')]){_0x150ee3['joins']=JSON[_0x7658('0x76')](_0x150ee3['joins']);for(var _0x5f27d6=0x0;_0x5f27d6<_0x150ee3[_0x7658('0x75')][_0x7658('0x34')];_0x5f27d6+=0x1){if(_0x150ee3['joins'][_0x5f27d6][_0x7658('0x2c')]&&_['includes'](_0xbbaba0,_0x150ee3[_0x7658('0x75')][_0x5f27d6][_0x7658('0x2c')])&&_0x150ee3[_0x7658('0x75')][_0x5f27d6][_0x7658('0x77')]&&_0x150ee3[_0x7658('0x75')][_0x5f27d6][_0x7658('0x78')]&&_0x150ee3['joins'][_0x5f27d6]['foreignKey']){_0x558f06[_0x150ee3[_0x7658('0x75')][_0x5f27d6][_0x7658('0x2c')]](_0x150ee3[_0x7658('0x75')][_0x5f27d6][_0x7658('0x78')],null,util[_0x7658('0x71')](_0x7658('0x7a'),_0x150ee3[_0x7658('0x6b')],_0x150ee3[_0x7658('0x75')][_0x5f27d6][_0x7658('0x77')],_0x150ee3[_0x7658('0x75')][_0x5f27d6][_0x7658('0x78')],_0x150ee3[_0x7658('0x75')][_0x5f27d6][_0x7658('0x79')]));}}}if(_0x150ee3[_0x7658('0x7b')]){_0x150ee3['conditions']=JSON['parse'](_0x150ee3[_0x7658('0x7b')]);_0x558f06[_0x7658('0x39')](_0x26a01c(_0x150ee3['conditions']['group']));}_0x2f879c=_0x558f06['clone']();_0x558f06[_0x7658('0x19')](_0x1b4443);_0x558f06[_0x7658('0x18')](0x0);return;}})[_0x7658('0x21')](function(){if(_0x24bf1a[_0x7658('0x89')]===_0x7658('0x8a')){return null;}var _0x37c47e=_['merge'](_0x24bf1a,{'name':_0x24bf1a[_0x7658('0x8b')]||_0x24bf1a[_0x7658('0x28')]||_0x150ee3[_0x7658('0x28')],'basename':_0x3227b3,'savename':util[_0x7658('0x71')](_0x7658('0x8c'),_0x24bf1a[_0x7658('0x28')]||_0x150ee3[_0x7658('0x28')],require(_0x7658('0x8d'))[_0x7658('0x8e')](0x4),_0x24bf1a[_0x7658('0x89')]||_0x7658('0x8f')),'reportId':_0x150ee3['id'],'reportType':_0x7658('0x90')});return db[_0x7658('0x91')][_0x7658('0x48')](_0x37c47e,{'raw':!![]});})[_0x7658('0x21')](function(_0x8b650){if(_0x150ee3[_0x7658('0x6b')]===_0x7658('0x92')){_0x2f879c[_0x7658('0x39')](_0x150ee3['table']+_0x7658('0x93'),_0x24bf1a[_0x7658('0x94')],_0x24bf1a[_0x7658('0x95')]);}else{_0x2f879c[_0x7658('0x39')](_0x150ee3[_0x7658('0x6b')]+_0x7658('0x96'),_0x24bf1a[_0x7658('0x94')],_0x24bf1a[_0x7658('0x95')]);}if(_0x8b650){logger[_0x7658('0x97')](_0x7658('0x98'),_0x2f879c['toString']());require(_0x7658('0x99'))[_0x7658('0x9a')](path[_0x7658('0x81')](__dirname,_0x7658('0x9b'),_0x8b650['output']),[_0x8b650['id'],_0x2f879c[_0x7658('0x7e')](),path[_0x7658('0x81')](__dirname,_0x7658('0x9c'),_0x8b650[_0x7658('0x9d')]),_0x3227b3]);return _0x8b650;}else{var _0x1c4fab=squel[_0x7658('0x86')]();_0x1c4fab['from']('('+_0x2f879c[_0x7658('0x7e')]()+')',_0x7658('0x9e'));_0x1c4fab[_0x7658('0x6e')]('COUNT(*)','count');_0x2f879c[_0x7658('0x19')](_0x24bf1a[_0x7658('0x19')]||_0x1b4443);_0x2f879c[_0x7658('0x18')](_0x24bf1a[_0x7658('0x18')]||0x0);return dbH[_0x7658('0x7f')]['query'](_0x1c4fab['toString'](),{'type':dbH[_0x7658('0x7f')]['QueryTypes'][_0x7658('0x80')]})['then'](function(_0x38f1db){if(!_0x38f1db['length']){_0xb34186=0x0;}else{_0xb34186=_0x38f1db[0x0]['count']||0x0;}return dbH[_0x7658('0x7f')][_0x7658('0x33')](_0x2f879c['toString'](),{'type':dbH[_0x7658('0x7f')][_0x7658('0x9f')][_0x7658('0x80')]});})[_0x7658('0x21')](function(_0x4c6984){return{'rows':_0x4c6984||[],'count':_0xb34186};});}});}exports[_0x7658('0xa0')]=function(_0x525c1a,_0x68f88f){return runReport(_0x525c1a[_0x7658('0x45')],_0x525c1a[_0x7658('0x33')],_0x525c1a['options'])['then'](respondWithResult(_0x68f88f,null))[_0x7658('0x43')](handleError(_0x68f88f,null));};exports['runReport']=runReport;exports[_0x7658('0x33')]=function(_0x5d9593,_0x2032ec){var _0xdff702=0xa;var _0x1fe8af=[_0x7658('0x81'),_0x7658('0x50'),_0x7658('0x51'),_0x7658('0x52')];var _0x4df91b={'SUM':'SUM(%s)','COUNT':_0x7658('0xa1'),'COUNT DISTINCT':_0x7658('0x54'),'MAX':'MAX(%s)','MIN':_0x7658('0x56'),'AVG':_0x7658('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x7658('0x82'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x136867={'SEC_TO_TIME':_0x7658('0xa2'),'DATE':_0x7658('0x5a'),'HOUR':_0x7658('0x5b'),'ROUND':_0x7658('0x5c'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x3b6cea=function(_0x4ed555){return!_[_0x7658('0x5e')](['IS\x20NULL',_0x7658('0x83'),_0x7658('0x60'),'IS\x20NOT\x20EMPTY'],_0x4ed555);};var _0x2ab11c=function(_0x3e2a86){if(!_0x3e2a86||!_0x3e2a86[_0x7658('0x62')][_0x7658('0x34')]){return'';}for(var _0x3ec776='(',_0x28f2da=0x0;_0x28f2da<_0x3e2a86[_0x7658('0x62')][_0x7658('0x34')];_0x28f2da+=0x1){_0x28f2da>0x0&&(_0x3ec776+='\x20'+_0x3e2a86[_0x7658('0x63')]+'\x20');_0x3ec776+=_0x3e2a86[_0x7658('0x62')][_0x28f2da][_0x7658('0x64')]?_0x2ab11c(_0x3e2a86[_0x7658('0x62')][_0x28f2da][_0x7658('0x64')]):_0x3e2a86[_0x7658('0x62')][_0x28f2da][_0x7658('0x6e')]+'\x20'+_0x3e2a86[_0x7658('0x62')][_0x28f2da][_0x7658('0x65')]+(_0x3b6cea(_0x3e2a86[_0x7658('0x62')][_0x28f2da][_0x7658('0x65')])?'\x20'+_0x3e2a86[_0x7658('0x62')][_0x28f2da][_0x7658('0x66')]:'');}return _0x3ec776+')';};var _0x4f7bf9={'where':{'id':_0x5d9593[_0x7658('0x45')]['id']}},_0x5c6905,_0x3ea35d,_0x69bfbb,_0x39806d,_0x4a5786;_0x4f7bf9=_['merge']({},_0x4f7bf9,_0x5d9593[_0x7658('0x3d')]);return db[_0x7658('0x3e')][_0x7658('0x47')](_0x4f7bf9)[_0x7658('0x21')](function(_0x129d94){if(_0x129d94){_0x5c6905=_0x129d94;return _0x129d94[_0x7658('0x67')]();}return null;})[_0x7658('0x21')](function(_0x1bf195){if(_0x1bf195){if(!_0x1bf195[_0x7658('0x34')]){throw new db[(_0x7658('0x68'))][(_0x7658('0x84'))](_0x7658('0x69'),0x193);}_0x3ea35d=_0x1bf195;return db[_0x7658('0x85')][_0x7658('0x41')]({'raw':!![]});}return null;})[_0x7658('0x21')](function(_0x46d576){if(_0x46d576){_0x69bfbb=_['keyBy'](_0x46d576,'id');var _0xf93bd8;var _0x503524=squel[_0x7658('0x86')]();_0x503524[_0x7658('0x87')](_0x5c6905[_0x7658('0x6b')]);for(var _0x3faf48=0x0;_0x3faf48<_0x3ea35d[_0x7658('0x34')];_0x3faf48+=0x1){_0xf93bd8=_0x3ea35d[_0x3faf48][_0x7658('0x6c')]?_0x69bfbb[_0x3ea35d[_0x3faf48][_0x7658('0x6c')]][_0x7658('0x6d')]:_0x3ea35d[_0x3faf48][_0x7658('0x6e')];_0xf93bd8=_0x3ea35d[_0x3faf48][_0x7658('0x6f')]?_[_0x7658('0x70')](_0x4df91b[_0x3ea35d[_0x3faf48][_0x7658('0x6f')]],'%s',_0xf93bd8):_0xf93bd8;_0xf93bd8=_0x3ea35d[_0x3faf48][_0x7658('0x71')]?_[_0x7658('0x70')](_0x136867[_0x3ea35d[_0x3faf48][_0x7658('0x71')]],'%s',_0xf93bd8):_0xf93bd8;if(_0x3ea35d[_0x3faf48][_0x7658('0x88')]){_0x503524[_0x7658('0x64')](_0xf93bd8);}_0x3ea35d[_0x3faf48][_0x7658('0x72')]&&_0x503524[_0x7658('0x37')](_0xf93bd8,_0x3ea35d[_0x3faf48][_0x7658('0x72')]===_0x7658('0x73')?![]:!![]);_0x503524[_0x7658('0x6e')](_0xf93bd8,_0x3ea35d[_0x3faf48][_0x7658('0x74')]||_0xf93bd8);}if(_0x5c6905[_0x7658('0x75')]){_0x5c6905[_0x7658('0x75')]=JSON[_0x7658('0x76')](_0x5c6905['joins']);for(var _0x2e1721=0x0;_0x2e1721<_0x5c6905[_0x7658('0x75')][_0x7658('0x34')];_0x2e1721+=0x1){if(_0x5c6905[_0x7658('0x75')][_0x2e1721]['type']&&_[_0x7658('0x5e')](_0x1fe8af,_0x5c6905['joins'][_0x2e1721][_0x7658('0x2c')])&&_0x5c6905[_0x7658('0x75')][_0x2e1721][_0x7658('0x77')]&&_0x5c6905[_0x7658('0x75')][_0x2e1721][_0x7658('0x78')]&&_0x5c6905[_0x7658('0x75')][_0x2e1721]['foreignKey']){_0x503524[_0x5c6905[_0x7658('0x75')][_0x2e1721][_0x7658('0x2c')]](_0x5c6905[_0x7658('0x75')][_0x2e1721][_0x7658('0x78')],null,util[_0x7658('0x71')]('%s.%s\x20=\x20%s.%s',_0x5c6905[_0x7658('0x6b')],_0x5c6905[_0x7658('0x75')][_0x2e1721][_0x7658('0x77')],_0x5c6905[_0x7658('0x75')][_0x2e1721]['foreignTable'],_0x5c6905[_0x7658('0x75')][_0x2e1721][_0x7658('0x79')]));}}}if(_0x5c6905[_0x7658('0x7b')]){_0x5c6905[_0x7658('0x7b')]=JSON[_0x7658('0x76')](_0x5c6905[_0x7658('0x7b')]);_0x503524['where'](_0x2ab11c(_0x5c6905[_0x7658('0x7b')][_0x7658('0x64')]));}_0x4a5786=_0x503524[_0x7658('0x7c')]();_0x503524[_0x7658('0x19')](_0xdff702);_0x503524[_0x7658('0x18')](0x0);logger[_0x7658('0x7d')](_0x7658('0xa3'),_0x503524[_0x7658('0x7e')]());return dbH[_0x7658('0x7f')][_0x7658('0x33')](_0x503524[_0x7658('0x7e')](),{'type':dbH[_0x7658('0x7f')][_0x7658('0x9f')][_0x7658('0x80')]});}})[_0x7658('0x21')](function(){return{'sql':_0x4a5786[_0x7658('0x7e')]()};})[_0x7658('0x21')](respondWithResult(_0x2032ec,null))[_0x7658('0x43')](handleError(_0x2032ec,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 2f22d79..d47b6f7 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 _0x4b94=['../../config/logger','api','moment','bluebird','path','rimraf','./analyticCustomReport.attributes','exports','AnalyticCustomReport','analytics_custom_reports','util'];(function(_0x221888,_0x1d2891){var _0x18bc6c=function(_0x485060){while(--_0x485060){_0x221888['push'](_0x221888['shift']());}};_0x18bc6c(++_0x1d2891);}(_0x4b94,0x6d));var _0x44b9=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0x4b94[_0x3740fe];return _0x55492b;};'use strict';var _=require('lodash');var util=require(_0x44b9('0x0'));var logger=require(_0x44b9('0x1'))(_0x44b9('0x2'));var moment=require(_0x44b9('0x3'));var BPromise=require(_0x44b9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x44b9('0x5'));var rimraf=require(_0x44b9('0x6'));var config=require('../../config/environment');var attributes=require(_0x44b9('0x7'));module[_0x44b9('0x8')]=function(_0x34e9fc,_0xa1719){return _0x34e9fc['define'](_0x44b9('0x9'),attributes,{'tableName':_0x44b9('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x29a4=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./analyticCustomReport.attributes','exports','define','analytics_custom_reports'];(function(_0x4c7fb5,_0x2548ef){var _0x2e10ac=function(_0xf7e27c){while(--_0xf7e27c){_0x4c7fb5['push'](_0x4c7fb5['shift']());}};_0x2e10ac(++_0x2548ef);}(_0x29a4,0xc0));var _0x429a=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x29a4[_0x21a9d9];return _0x46adce;};'use strict';var _=require('lodash');var util=require(_0x429a('0x0'));var logger=require(_0x429a('0x1'))(_0x429a('0x2'));var moment=require(_0x429a('0x3'));var BPromise=require(_0x429a('0x4'));var rp=require(_0x429a('0x5'));var fs=require('fs');var path=require(_0x429a('0x6'));var rimraf=require('rimraf');var config=require(_0x429a('0x7'));var attributes=require(_0x429a('0x8'));module[_0x429a('0x9')]=function(_0x418cea,_0x1c5fec){return _0x418cea[_0x429a('0xa')]('AnalyticCustomReport',attributes,{'tableName':_0x429a('0xb'),'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 815f230..bf8bceb 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 _0x8a7d=['info','AnalyticCustomReport,\x20%s,\x20%s','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result','catch','lodash','util','moment','bluebird','../../config/utils','client','http','request','then'];(function(_0x5cb6b3,_0x4d8ada){var _0x2bed40=function(_0x560c87){while(--_0x560c87){_0x5cb6b3['push'](_0x5cb6b3['shift']());}};_0x2bed40(++_0x4d8ada);}(_0x8a7d,0x129));var _0xd8a7=function(_0x3d69bd,_0x1b3b60){_0x3d69bd=_0x3d69bd-0x0;var _0x18a854=_0x8a7d[_0x3d69bd];return _0x18a854;};'use strict';var _=require(_0xd8a7('0x0'));var util=require(_0xd8a7('0x1'));var moment=require(_0xd8a7('0x2'));var BPromise=require(_0xd8a7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd8a7('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd8a7('0x5')][_0xd8a7('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2c6d25,_0x459572,_0xd0ad3a){return new BPromise(function(_0x24d754,_0x1641c4){return client[_0xd8a7('0x7')](_0x2c6d25,_0xd0ad3a)[_0xd8a7('0x8')](function(_0xc8994d){logger[_0xd8a7('0x9')](_0xd8a7('0xa'),_0x459572,'request\x20sent');logger[_0xd8a7('0xb')](_0xd8a7('0xc'),_0x459572,'request\x20sent',JSON['stringify'](_0xc8994d));if(_0xc8994d[_0xd8a7('0xd')]){if(_0xc8994d[_0xd8a7('0xd')]['code']===0x1f4){logger[_0xd8a7('0xd')](_0xd8a7('0xa'),_0x459572,_0xc8994d[_0xd8a7('0xd')][_0xd8a7('0xe')]);return _0x1641c4(_0xc8994d[_0xd8a7('0xd')]['message']);}logger[_0xd8a7('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0x459572,_0xc8994d[_0xd8a7('0xd')][_0xd8a7('0xe')]);return _0x24d754(_0xc8994d[_0xd8a7('0xd')][_0xd8a7('0xe')]);}else{logger['info'](_0xd8a7('0xa'),_0x459572,_0xd8a7('0xf'));_0x24d754(_0xc8994d[_0xd8a7('0x10')][_0xd8a7('0xe')]);}})[_0xd8a7('0x11')](function(_0x291c5e){logger[_0xd8a7('0xd')](_0xd8a7('0xa'),_0x459572,_0x291c5e);_0x1641c4(_0x291c5e);});});} \ No newline at end of file +var _0xe2d6=['stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent'];(function(_0x174b1c,_0x9f5d0b){var _0x228e4a=function(_0xaa5574){while(--_0xaa5574){_0x174b1c['push'](_0x174b1c['shift']());}};_0x228e4a(++_0x9f5d0b);}(_0xe2d6,0xe1));var _0x6e2d=function(_0x31dde9,_0x12e816){_0x31dde9=_0x31dde9-0x0;var _0x1fbf2d=_0xe2d6[_0x31dde9];return _0x1fbf2d;};'use strict';var _=require(_0x6e2d('0x0'));var util=require(_0x6e2d('0x1'));var moment=require(_0x6e2d('0x2'));var BPromise=require(_0x6e2d('0x3'));var rs=require(_0x6e2d('0x4'));var fs=require('fs');var Redis=require(_0x6e2d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6e2d('0x6'));var logger=require('../../config/logger')(_0x6e2d('0x7'));var config=require(_0x6e2d('0x8'));var jayson=require(_0x6e2d('0x9'));var client=jayson[_0x6e2d('0xa')][_0x6e2d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x251064,_0x448f27,_0x375651){return new BPromise(function(_0x2985ad,_0x4506ae){return client[_0x6e2d('0xc')](_0x251064,_0x375651)[_0x6e2d('0xd')](function(_0x5dcc0d){logger[_0x6e2d('0xe')](_0x6e2d('0xf'),_0x448f27,_0x6e2d('0x10'));logger['debug']('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x448f27,_0x6e2d('0x10'),JSON[_0x6e2d('0x11')](_0x5dcc0d));if(_0x5dcc0d[_0x6e2d('0x12')]){if(_0x5dcc0d['error']['code']===0x1f4){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x448f27,_0x5dcc0d[_0x6e2d('0x12')][_0x6e2d('0x13')]);return _0x4506ae(_0x5dcc0d['error']['message']);}logger[_0x6e2d('0x12')](_0x6e2d('0xf'),_0x448f27,_0x5dcc0d['error']['message']);return _0x2985ad(_0x5dcc0d[_0x6e2d('0x12')][_0x6e2d('0x13')]);}else{logger[_0x6e2d('0xe')](_0x6e2d('0xf'),_0x448f27,_0x6e2d('0x10'));_0x2985ad(_0x5dcc0d[_0x6e2d('0x14')][_0x6e2d('0x13')]);}})[_0x6e2d('0x15')](function(_0x2e70fb){logger[_0x6e2d('0x12')](_0x6e2d('0xf'),_0x448f27,_0x2e70fb);_0x4506ae(_0x2e70fb);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index ce482f8..45d3d39 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 _0x4aa8=['isAuthenticated','index','show','/:id/preview','preview','/:id/run','run','query','post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4aa8,0xe7));var _0x84aa=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x4aa8[_0x1d24eb];return _0x1dc576;};'use strict';var multer=require(_0x84aa('0x0'));var util=require(_0x84aa('0x1'));var path=require(_0x84aa('0x2'));var timeout=require(_0x84aa('0x3'));var express=require('express');var router=express[_0x84aa('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x84aa('0x5'));var config=require(_0x84aa('0x6'));var controller=require(_0x84aa('0x7'));router[_0x84aa('0x8')]('/',auth[_0x84aa('0x9')](),controller[_0x84aa('0xa')]);router[_0x84aa('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x84aa('0xb')]);router[_0x84aa('0x8')](_0x84aa('0xc'),auth['isAuthenticated'](),controller[_0x84aa('0xd')]);router[_0x84aa('0x8')](_0x84aa('0xe'),auth[_0x84aa('0x9')](),controller[_0x84aa('0xf')]);router[_0x84aa('0x8')]('/:id/query',auth[_0x84aa('0x9')](),controller[_0x84aa('0x10')]);router[_0x84aa('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x84aa('0x12')](_0x84aa('0x13'),auth[_0x84aa('0x9')](),controller[_0x84aa('0x14')]);router[_0x84aa('0x15')](_0x84aa('0x13'),auth[_0x84aa('0x9')](),controller[_0x84aa('0x16')]);module[_0x84aa('0x17')]=router; \ No newline at end of file +var _0xdf45=['preview','/:id/run','run','/:id/query','query','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index','get','/:id','/:id/preview'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdf45,0x150));var _0x5df4=function(_0x28669c,_0x1f62c4){_0x28669c=_0x28669c-0x0;var _0x4a3af6=_0xdf45[_0x28669c];return _0x4a3af6;};'use strict';var multer=require(_0x5df4('0x0'));var util=require(_0x5df4('0x1'));var path=require(_0x5df4('0x2'));var timeout=require(_0x5df4('0x3'));var express=require(_0x5df4('0x4'));var router=express['Router']();var fs_extra=require(_0x5df4('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5df4('0x6'));var config=require(_0x5df4('0x7'));var controller=require(_0x5df4('0x8'));router['get']('/',auth[_0x5df4('0x9')](),controller[_0x5df4('0xa')]);router[_0x5df4('0xb')](_0x5df4('0xc'),auth[_0x5df4('0x9')](),controller['show']);router['get'](_0x5df4('0xd'),auth[_0x5df4('0x9')](),controller[_0x5df4('0xe')]);router['get'](_0x5df4('0xf'),auth['isAuthenticated'](),controller[_0x5df4('0x10')]);router[_0x5df4('0xb')](_0x5df4('0x11'),auth[_0x5df4('0x9')](),controller[_0x5df4('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5df4('0x13')]);router[_0x5df4('0x14')](_0x5df4('0xc'),auth[_0x5df4('0x9')](),controller[_0x5df4('0x15')]);router[_0x5df4('0x16')](_0x5df4('0xc'),auth[_0x5df4('0x9')](),controller[_0x5df4('0x17')]);module[_0x5df4('0x18')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index e460cd9..0d76c27 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 _0x1cb9=['TEXT','sequelize','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1cb9,0x14e));var _0x91cb=function(_0xa8d7f,_0xfec14f){_0xa8d7f=_0xa8d7f-0x0;var _0x29d0b1=_0x1cb9[_0xa8d7f];return _0x29d0b1;};'use strict';var Sequelize=require(_0x91cb('0x0'));module['exports']={'name':{'type':Sequelize[_0x91cb('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x91cb('0x1')]},'parent':{'type':Sequelize[_0x91cb('0x1')]},'table':{'type':Sequelize[_0x91cb('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x91cb('0x2')]}}; \ No newline at end of file +var _0x33c5=['STRING','TEXT','exports'];(function(_0xac6ded,_0x34bad6){var _0x1540b1=function(_0x27184c){while(--_0x27184c){_0xac6ded['push'](_0xac6ded['shift']());}};_0x1540b1(++_0x34bad6);}(_0x33c5,0xe6));var _0x533c=function(_0x54fc1f,_0x1703c2){_0x54fc1f=_0x54fc1f-0x0;var _0x53f699=_0x33c5[_0x54fc1f];return _0x53f699;};'use strict';var Sequelize=require('sequelize');module[_0x533c('0x0')]={'name':{'type':Sequelize[_0x533c('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x533c('0x1')]},'table':{'type':Sequelize[_0x533c('0x1')]},'conditions':{'type':Sequelize[_0x533c('0x2')]},'joins':{'type':Sequelize[_0x533c('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index cfad3b9..cc9df33 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 _0xf494=['name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','includeAll','find','create','body','user','Reports','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','join','left_join','cross_join','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','field','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','DESC','alias','joins','parse','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','foreignKey','conditions','debug','Limited\x20Query:','sequelize','toString','QueryTypes','right_join','SUM(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','IS\x20NULL','operator','condition','getFields','groupBy','clone','output','fullPath','%s-%s.%s','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','runReport','IS\x20NOT\x20EMPTY','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','get','DefaultReports','error','stack'];(function(_0x5d9956,_0x1abb7e){var _0x125773=function(_0x235865){while(--_0x235865){_0x5d9956['push'](_0x5d9956['shift']());}};_0x125773(++_0x1abb7e);}(_0xf494,0x1c6));var _0x4f49=function(_0x5fe184,_0x3bdb91){_0x5fe184=_0x5fe184-0x0;var _0x5aacc8=_0xf494[_0x5fe184];return _0x5aacc8;};'use strict';var emlformat=require(_0x4f49('0x0'));var rimraf=require(_0x4f49('0x1'));var zipdir=require(_0x4f49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4f49('0x3'));var moment=require(_0x4f49('0x4'));var BPromise=require(_0x4f49('0x5'));var Mustache=require(_0x4f49('0x6'));var util=require(_0x4f49('0x7'));var path=require(_0x4f49('0x8'));var sox=require(_0x4f49('0x9'));var csv=require(_0x4f49('0xa'));var ejs=require(_0x4f49('0xb'));var fs=require('fs');var fs_extra=require(_0x4f49('0xc'));var _=require(_0x4f49('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4f49('0xe'));var deskjs=require(_0x4f49('0xf'));var toCsv=require(_0x4f49('0xa'));var querystring=require(_0x4f49('0x10'));var Papa=require(_0x4f49('0x11'));var Redis=require(_0x4f49('0x12'));var authService=require(_0x4f49('0x13'));var qs=require(_0x4f49('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f49('0x15'));var logger=require(_0x4f49('0x16'))('api');var utils=require(_0x4f49('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4f49('0x18'))['db'];var dbH=require(_0x4f49('0x18'))['dbH'];function respondWithStatusCode(_0x1e1c37,_0x111a8b){_0x111a8b=_0x111a8b||0xcc;return function(_0x1b9145){if(_0x1b9145){return _0x1e1c37[_0x4f49('0x19')](_0x111a8b);}return _0x1e1c37[_0x4f49('0x1a')](_0x111a8b)[_0x4f49('0x1b')]();};}function respondWithResult(_0xfdb477,_0x5c373e){_0x5c373e=_0x5c373e||0xc8;return function(_0x515ace){if(_0x515ace){return _0xfdb477[_0x4f49('0x1a')](_0x5c373e)[_0x4f49('0x1c')](_0x515ace);}};}function respondWithFilteredResult(_0x5878f4,_0x5bdfaf){return function(_0x2f0a0d){if(_0x2f0a0d){var _0x2ecaaa=typeof _0x5bdfaf[_0x4f49('0x1d')]==='undefined'&&typeof _0x5bdfaf[_0x4f49('0x1e')]===_0x4f49('0x1f');var _0x4e85df=_0x2f0a0d['count'];var _0x5bb23b=_0x2ecaaa?0x0:_0x5bdfaf['offset'];var _0x47f1e8=_0x2ecaaa?_0x2f0a0d[_0x4f49('0x20')]:_0x5bdfaf[_0x4f49('0x1d')]+_0x5bdfaf[_0x4f49('0x1e')];var _0x407042;if(_0x47f1e8>=_0x4e85df){_0x47f1e8=_0x4e85df;_0x407042=0xc8;}else{_0x407042=0xce;}_0x5878f4['status'](_0x407042);return _0x5878f4[_0x4f49('0x21')](_0x4f49('0x22'),_0x5bb23b+'-'+_0x47f1e8+'/'+_0x4e85df)[_0x4f49('0x1c')](_0x2f0a0d);}return null;};}function patchUpdates(_0xaab5e7){return function(_0xea82f8){try{jsonpatch['apply'](_0xea82f8,_0xaab5e7,!![]);}catch(_0x3e7e28){return BPromise[_0x4f49('0x23')](_0x3e7e28);}return _0xea82f8[_0x4f49('0x24')]();};}function saveUpdates(_0x53b57d,_0x40755e){return function(_0x1d70a7){if(_0x1d70a7){return _0x1d70a7[_0x4f49('0x25')](_0x53b57d)[_0x4f49('0x26')](function(_0x9d30aa){return _0x9d30aa;});}return null;};}function removeEntity(_0x36187b,_0x559d98){return function(_0x4e9041){if(_0x4e9041){return _0x4e9041[_0x4f49('0x27')]()[_0x4f49('0x26')](function(){var _0x4fedbb=_0x4e9041[_0x4f49('0x28')]({'plain':!![]});var _0x2c1519=_0x4f49('0x29');return db['UserProfileResource'][_0x4f49('0x27')]({'where':{'type':_0x2c1519,'resourceId':_0x4fedbb['id']}})[_0x4f49('0x26')](function(){return _0x4e9041;});})[_0x4f49('0x26')](function(){_0x36187b[_0x4f49('0x1a')](0xcc)[_0x4f49('0x1b')]();});}};}function handleEntityNotFound(_0x122404,_0x4915af){return function(_0x50c571){if(!_0x50c571){_0x122404[_0x4f49('0x19')](0x194);}return _0x50c571;};}function handleError(_0x2c00ee,_0x605c91){_0x605c91=_0x605c91||0x1f4;return function(_0x560050){logger[_0x4f49('0x2a')](_0x560050[_0x4f49('0x2b')]);if(_0x560050[_0x4f49('0x2c')]){delete _0x560050['name'];}_0x2c00ee['status'](_0x605c91)[_0x4f49('0x2d')](_0x560050);};}exports[_0x4f49('0x2e')]=function(_0x7a6ea0,_0x5e7076){var _0x1eaac6={},_0x35aa33={},_0x173657={'count':0x0,'rows':[]};var _0x2ceda4=_[_0x4f49('0x2f')](db[_0x4f49('0x30')][_0x4f49('0x31')],function(_0x45ae19){return{'name':_0x45ae19[_0x4f49('0x32')],'type':_0x45ae19[_0x4f49('0x33')][_0x4f49('0x34')]};});_0x35aa33[_0x4f49('0x35')]=_[_0x4f49('0x2f')](_0x2ceda4,_0x4f49('0x2c'));_0x35aa33[_0x4f49('0x36')]=_[_0x4f49('0x37')](_0x7a6ea0[_0x4f49('0x36')]);_0x35aa33[_0x4f49('0x38')]=_[_0x4f49('0x39')](_0x35aa33['model'],_0x35aa33[_0x4f49('0x36')]);_0x1eaac6[_0x4f49('0x3a')]=_[_0x4f49('0x39')](_0x35aa33[_0x4f49('0x35')],qs[_0x4f49('0x3b')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x3b')]));_0x1eaac6[_0x4f49('0x3a')]=_0x1eaac6[_0x4f49('0x3a')][_0x4f49('0x3c')]?_0x1eaac6[_0x4f49('0x3a')]:_0x35aa33[_0x4f49('0x35')];if(!_0x7a6ea0[_0x4f49('0x36')]['hasOwnProperty'](_0x4f49('0x3d'))){_0x1eaac6[_0x4f49('0x1e')]=qs[_0x4f49('0x1e')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x1e')]);_0x1eaac6[_0x4f49('0x1d')]=qs[_0x4f49('0x1d')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x1d')]);}_0x1eaac6[_0x4f49('0x3e')]=qs[_0x4f49('0x3f')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x3f')]);_0x1eaac6[_0x4f49('0x40')]=qs['filters'](_[_0x4f49('0x41')](_0x7a6ea0[_0x4f49('0x36')],_0x35aa33['filters']),_0x2ceda4);if(_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x42')]){_0x1eaac6['where']=_[_0x4f49('0x43')](_0x1eaac6[_0x4f49('0x40')],{'$or':_[_0x4f49('0x2f')](_0x2ceda4,function(_0x200b1d){if(_0x200b1d[_0x4f49('0x33')]!==_0x4f49('0x44')){var _0x29e910={};_0x29e910[_0x200b1d['name']]={'$like':'%'+_0x7a6ea0['query']['filter']+'%'};return _0x29e910;}})});}_0x1eaac6=_[_0x4f49('0x43')]({},_0x1eaac6,_0x7a6ea0[_0x4f49('0x45')]);var _0x2e4355={'where':_0x1eaac6[_0x4f49('0x40')]};return db[_0x4f49('0x30')][_0x4f49('0x20')](_0x2e4355)[_0x4f49('0x26')](function(_0x23720a){_0x173657[_0x4f49('0x20')]=_0x23720a;if(_0x7a6ea0['query']['includeAll']){_0x1eaac6[_0x4f49('0x46')]=[{'all':!![]}];}return db[_0x4f49('0x30')][_0x4f49('0x47')](_0x1eaac6);})['then'](function(_0x2d6b56){_0x173657['rows']=_0x2d6b56;return _0x173657;})['then'](respondWithFilteredResult(_0x5e7076,_0x1eaac6))[_0x4f49('0x48')](handleError(_0x5e7076,null));};exports[_0x4f49('0x49')]=function(_0x40eadc,_0x497cb8){var _0x287781={'raw':!![],'where':{'id':_0x40eadc['params']['id']}},_0x11b4df={};_0x11b4df[_0x4f49('0x35')]=_['keys'](db[_0x4f49('0x30')][_0x4f49('0x31')]);_0x11b4df[_0x4f49('0x36')]=_['keys'](_0x40eadc[_0x4f49('0x36')]);_0x11b4df[_0x4f49('0x38')]=_[_0x4f49('0x39')](_0x11b4df[_0x4f49('0x35')],_0x11b4df[_0x4f49('0x36')]);_0x287781[_0x4f49('0x3a')]=_[_0x4f49('0x39')](_0x11b4df[_0x4f49('0x35')],qs[_0x4f49('0x3b')](_0x40eadc[_0x4f49('0x36')]['fields']));_0x287781[_0x4f49('0x3a')]=_0x287781[_0x4f49('0x3a')]['length']?_0x287781[_0x4f49('0x3a')]:_0x11b4df['model'];if(_0x40eadc[_0x4f49('0x36')][_0x4f49('0x4a')]){_0x287781[_0x4f49('0x46')]=[{'all':!![]}];}_0x287781=_[_0x4f49('0x43')]({},_0x287781,_0x40eadc['options']);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x287781)[_0x4f49('0x26')](handleEntityNotFound(_0x497cb8,null))[_0x4f49('0x26')](respondWithResult(_0x497cb8,null))[_0x4f49('0x48')](handleError(_0x497cb8,null));};exports[_0x4f49('0x4c')]=function(_0x37fdb7,_0xd282c){return db[_0x4f49('0x30')][_0x4f49('0x4c')](_0x37fdb7[_0x4f49('0x4d')],{})[_0x4f49('0x26')](function(_0x148031){var _0x2104d0=_0x37fdb7[_0x4f49('0x4e')][_0x4f49('0x28')]({'plain':!![]});if(!_0x2104d0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2104d0['role']===_0x4f49('0x4e')){var _0x197670=_0x148031[_0x4f49('0x28')]({'plain':!![]});var _0xe46c90=_0x4f49('0x4f');return db[_0x4f49('0x50')][_0x4f49('0x4b')]({'where':{'name':_0xe46c90,'userProfileId':_0x2104d0['userProfileId']},'raw':!![]})[_0x4f49('0x26')](function(_0x4ff0a2){if(_0x4ff0a2&&_0x4ff0a2[_0x4f49('0x51')]===0x0){return db[_0x4f49('0x52')][_0x4f49('0x4c')]({'name':_0x197670[_0x4f49('0x2c')],'resourceId':_0x197670['id'],'type':'DefaultReports','sectionId':_0x4ff0a2['id']},{})[_0x4f49('0x26')](function(){return _0x148031;});}else{return _0x148031;}})['catch'](function(_0x52d18c){logger[_0x4f49('0x2a')](_0x4f49('0x53'),_0x52d18c);throw _0x52d18c;});}return _0x148031;})[_0x4f49('0x26')](respondWithResult(_0xd282c,0xc9))[_0x4f49('0x48')](handleError(_0xd282c,null));};exports['update']=function(_0x599c51,_0xd7f47b){if(_0x599c51[_0x4f49('0x4d')]['id']){delete _0x599c51['body']['id'];}return db[_0x4f49('0x30')]['find']({'where':{'id':_0x599c51['params']['id']}})[_0x4f49('0x26')](handleEntityNotFound(_0xd7f47b,null))['then'](saveUpdates(_0x599c51[_0x4f49('0x4d')],null))['then'](respondWithResult(_0xd7f47b,null))[_0x4f49('0x48')](handleError(_0xd7f47b,null));};exports[_0x4f49('0x27')]=function(_0x2472c9,_0x883408){return db[_0x4f49('0x30')][_0x4f49('0x4b')]({'where':{'id':_0x2472c9[_0x4f49('0x54')]['id']}})[_0x4f49('0x26')](handleEntityNotFound(_0x883408,null))['then'](removeEntity(_0x883408,null))[_0x4f49('0x48')](handleError(_0x883408,null));};exports['preview']=function(_0x213608,_0x1f640d){var _0xc4fc6b=0xa;var _0x467f12=[_0x4f49('0x55'),_0x4f49('0x56'),'right_join',_0x4f49('0x57')];var _0xd3689c={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':_0x4f49('0x59'),'MIN':_0x4f49('0x5a'),'AVG':_0x4f49('0x5b'),'GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0x564bf5={'SEC_TO_TIME':_0x4f49('0x5e'),'DATE':_0x4f49('0x5f'),'HOUR':_0x4f49('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x21807e=function(_0x265988){return!_[_0x4f49('0x62')](['IS\x20NULL',_0x4f49('0x63'),_0x4f49('0x64'),'IS\x20NOT\x20EMPTY'],_0x265988);};var _0x293839=function(_0x17b15){if(!_0x17b15||!_0x17b15[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x28ea73='(',_0x1b80f2=0x0;_0x1b80f2<_0x17b15[_0x4f49('0x65')][_0x4f49('0x3c')];_0x1b80f2+=0x1){_0x1b80f2>0x0&&(_0x28ea73+='\x20'+_0x17b15['operator']+'\x20');_0x28ea73+=_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x66')]?_0x293839(_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x66')]):_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x67')]+'\x20'+_0x17b15[_0x4f49('0x65')][_0x1b80f2]['condition']+(_0x21807e(_0x17b15[_0x4f49('0x65')][_0x1b80f2]['condition'])?'\x20'+_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x68')]:'');}return _0x28ea73+')';};var _0x4714c7={'where':{'id':_0x213608[_0x4f49('0x54')]['id']}},_0xf29378,_0xc7743e,_0x3f2f3f,_0x61a565,_0x297698;_0x4714c7=_[_0x4f49('0x43')]({},_0x4714c7,_0x213608['options']);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x4714c7)[_0x4f49('0x26')](function(_0x2cdaa4){if(_0x2cdaa4){_0xf29378=_0x2cdaa4;return _0x2cdaa4['getFields']();}return null;})['then'](function(_0x28e8ae){if(_0x28e8ae){if(!_0x28e8ae['length']){throw new db[(_0x4f49('0x69'))][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0xc7743e=_0x28e8ae;return db[_0x4f49('0x6c')][_0x4f49('0x47')]({'raw':!![]});}return null;})[_0x4f49('0x26')](function(_0x179431){if(_0x179431){_0x3f2f3f=_[_0x4f49('0x6d')](_0x179431,'id');var _0x3823f0;var _0x3e9b47=squel[_0x4f49('0x6e')]();_0x3e9b47[_0x4f49('0x6f')](_0xf29378[_0x4f49('0x70')]);for(var _0xd53de8=0x0;_0xd53de8<_0xc7743e[_0x4f49('0x3c')];_0xd53de8+=0x1){_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x71')]?_0x3f2f3f[_0xc7743e[_0xd53de8][_0x4f49('0x71')]][_0x4f49('0x72')]:_0xc7743e[_0xd53de8][_0x4f49('0x67')];_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x73')]?_[_0x4f49('0x74')](_0xd3689c[_0xc7743e[_0xd53de8][_0x4f49('0x73')]],'%s',_0x3823f0):_0x3823f0;_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0x564bf5[_0xc7743e[_0xd53de8][_0x4f49('0x75')]],'%s',_0x3823f0):_0x3823f0;if(_0xc7743e[_0xd53de8]['groupBy']){_0x3e9b47[_0x4f49('0x66')](_0x3823f0);}_0xc7743e[_0xd53de8]['orderBy']&&_0x3e9b47[_0x4f49('0x3e')](_0x3823f0,_0xc7743e[_0xd53de8][_0x4f49('0x76')]===_0x4f49('0x77')?![]:!![]);_0x3e9b47[_0x4f49('0x67')](_0x3823f0,_0xc7743e[_0xd53de8][_0x4f49('0x78')]||_0x3823f0);}if(_0xf29378[_0x4f49('0x79')]){_0xf29378[_0x4f49('0x79')]=JSON[_0x4f49('0x7a')](_0xf29378[_0x4f49('0x79')]);for(var _0x541ac6=0x0;_0x541ac6<_0xf29378['joins'][_0x4f49('0x3c')];_0x541ac6+=0x1){if(_0xf29378['joins'][_0x541ac6][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x467f12,_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x33')])&&_0xf29378[_0x4f49('0x79')][_0x541ac6]['parentKey']&&_0xf29378['joins'][_0x541ac6][_0x4f49('0x7b')]&&_0xf29378[_0x4f49('0x79')][_0x541ac6]['foreignKey']){_0x3e9b47[_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x33')]](_0xf29378['joins'][_0x541ac6][_0x4f49('0x7b')],null,util['format'](_0x4f49('0x7c'),_0xf29378[_0x4f49('0x70')],_0xf29378['joins'][_0x541ac6][_0x4f49('0x7d')],_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x7b')],_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x7e')]));}}}if(_0xf29378[_0x4f49('0x7f')]){_0xf29378['conditions']=JSON[_0x4f49('0x7a')](_0xf29378['conditions']);_0x3e9b47[_0x4f49('0x40')](_0x293839(_0xf29378['conditions'][_0x4f49('0x66')]));}_0x297698=_0x3e9b47['clone']();_0x3e9b47[_0x4f49('0x1e')](_0xc4fc6b);_0x3e9b47[_0x4f49('0x1d')](0x0);logger[_0x4f49('0x80')](_0x4f49('0x81'),_0x3e9b47['toString']());return dbH[_0x4f49('0x82')]['query'](_0x3e9b47[_0x4f49('0x83')](),{'type':dbH['sequelize'][_0x4f49('0x84')]['SELECT']});}})['then'](respondWithResult(_0x1f640d,null))[_0x4f49('0x48')](handleError(_0x1f640d,null));};function runReport(_0x20b2be,_0x16cb4d,_0x4c0e7a){var _0x289810=_0x16cb4d[_0x4f49('0x2c')];var _0x5c33c9=0xa;var _0x5d52ae=['join',_0x4f49('0x56'),_0x4f49('0x85'),_0x4f49('0x57')];var _0x87439={'SUM':_0x4f49('0x86'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':_0x4f49('0x59'),'MIN':_0x4f49('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':_0x4f49('0x87'),'GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0x2902a1={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4f49('0x5f'),'HOUR':_0x4f49('0x60'),'ROUND':_0x4f49('0x88'),'UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x389679=function(_0x5304c3){return!_[_0x4f49('0x62')]([_0x4f49('0x89'),'IS\x20NOT\x20NULL',_0x4f49('0x64'),'IS\x20NOT\x20EMPTY'],_0x5304c3);};var _0x351a33=function(_0x4d72a0){if(!_0x4d72a0||!_0x4d72a0[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x2ef19e='(',_0x6ad599=0x0;_0x6ad599<_0x4d72a0[_0x4f49('0x65')]['length'];_0x6ad599+=0x1){_0x6ad599>0x0&&(_0x2ef19e+='\x20'+_0x4d72a0[_0x4f49('0x8a')]+'\x20');_0x2ef19e+=_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x66')]?_0x351a33(_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['group']):_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['field']+'\x20'+_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['condition']+(_0x389679(_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x8b')])?'\x20'+_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x68')]:'');}return _0x2ef19e+')';};var _0x111e90={'where':{'id':_0x20b2be['id']}},_0xd253ed,_0x323a3a,_0xe0adc3,_0x3a26ff,_0x64f0ee;_0x111e90=_['merge']({},_0x111e90,_0x4c0e7a);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x111e90)[_0x4f49('0x26')](function(_0x299849){if(_0x299849){_0xd253ed=_0x299849;return _0x299849[_0x4f49('0x8c')]();}return null;})[_0x4f49('0x26')](function(_0x55b28b){if(_0x55b28b){if(!_0x55b28b[_0x4f49('0x3c')]){throw new db[(_0x4f49('0x69'))][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0x323a3a=_0x55b28b;return db['AnalyticMetric'][_0x4f49('0x47')]({'raw':!![]});}return null;})['then'](function(_0x3c4e88){if(_0x3c4e88){_0xe0adc3=_[_0x4f49('0x6d')](_0x3c4e88,'id');var _0x5c5d2;var _0xa880a2=squel['select']();_0xa880a2[_0x4f49('0x6f')](_0xd253ed[_0x4f49('0x70')]);for(var _0x11c0a0=0x0;_0x11c0a0<_0x323a3a[_0x4f49('0x3c')];_0x11c0a0+=0x1){_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x71')]?_0xe0adc3[_0x323a3a[_0x11c0a0][_0x4f49('0x71')]][_0x4f49('0x72')]:_0x323a3a[_0x11c0a0][_0x4f49('0x67')];_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x73')]?_[_0x4f49('0x74')](_0x87439[_0x323a3a[_0x11c0a0][_0x4f49('0x73')]],'%s',_0x5c5d2):_0x5c5d2;_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0x2902a1[_0x323a3a[_0x11c0a0][_0x4f49('0x75')]],'%s',_0x5c5d2):_0x5c5d2;if(_0x323a3a[_0x11c0a0][_0x4f49('0x8d')]){_0xa880a2[_0x4f49('0x66')](_0x5c5d2);}_0x323a3a[_0x11c0a0][_0x4f49('0x76')]&&_0xa880a2[_0x4f49('0x3e')](_0x5c5d2,_0x323a3a[_0x11c0a0]['orderBy']===_0x4f49('0x77')?![]:!![]);_0xa880a2[_0x4f49('0x67')](_0x5c5d2,_0x323a3a[_0x11c0a0][_0x4f49('0x78')]||_0x5c5d2);}if(_0xd253ed[_0x4f49('0x79')]){_0xd253ed['joins']=JSON[_0x4f49('0x7a')](_0xd253ed[_0x4f49('0x79')]);for(var _0x594460=0x0;_0x594460<_0xd253ed[_0x4f49('0x79')]['length'];_0x594460+=0x1){if(_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x5d52ae,_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x33')])&&_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7d')]&&_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7b')]&&_0xd253ed[_0x4f49('0x79')][_0x594460]['foreignKey']){_0xa880a2[_0xd253ed['joins'][_0x594460][_0x4f49('0x33')]](_0xd253ed['joins'][_0x594460][_0x4f49('0x7b')],null,util[_0x4f49('0x75')]('%s.%s\x20=\x20%s.%s',_0xd253ed['table'],_0xd253ed[_0x4f49('0x79')][_0x594460]['parentKey'],_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7b')],_0xd253ed[_0x4f49('0x79')][_0x594460]['foreignKey']));}}}if(_0xd253ed[_0x4f49('0x7f')]){_0xd253ed['conditions']=JSON[_0x4f49('0x7a')](_0xd253ed[_0x4f49('0x7f')]);_0xa880a2[_0x4f49('0x40')](_0x351a33(_0xd253ed['conditions'][_0x4f49('0x66')]));}_0x64f0ee=_0xa880a2[_0x4f49('0x8e')]();_0xa880a2[_0x4f49('0x1e')](_0x5c33c9);_0xa880a2['offset'](0x0);return;}})['then'](function(){if(_0x16cb4d[_0x4f49('0x8f')]==='web'){return null;}var _0x2bc9df=_[_0x4f49('0x43')](_0x16cb4d,{'name':_0x16cb4d[_0x4f49('0x90')]||_0x16cb4d['name']||_0xd253ed[_0x4f49('0x2c')],'basename':_0x289810,'savename':util['format'](_0x4f49('0x91'),_0x16cb4d[_0x4f49('0x2c')]||_0xd253ed[_0x4f49('0x2c')],require('randomstring')[_0x4f49('0x92')](0x4),_0x16cb4d[_0x4f49('0x8f')]||_0x4f49('0x93')),'reportId':_0xd253ed['id'],'reportType':_0x4f49('0x94')});return db[_0x4f49('0x95')][_0x4f49('0x4c')](_0x2bc9df,{'raw':!![]});})['then'](function(_0x5b6ac7){if(_0xd253ed[_0x4f49('0x70')]===_0x4f49('0x96')){_0x64f0ee[_0x4f49('0x40')](_0xd253ed[_0x4f49('0x70')]+_0x4f49('0x97'),_0x16cb4d[_0x4f49('0x98')],_0x16cb4d[_0x4f49('0x99')]);}else{_0x64f0ee[_0x4f49('0x40')](_0xd253ed[_0x4f49('0x70')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x16cb4d[_0x4f49('0x98')],_0x16cb4d[_0x4f49('0x99')]);}if(_0x5b6ac7){logger[_0x4f49('0x9a')]('Run\x20Query:',_0x64f0ee[_0x4f49('0x83')]());require(_0x4f49('0x9b'))[_0x4f49('0x9c')](path['join'](__dirname,_0x4f49('0x9d'),_0x5b6ac7[_0x4f49('0x8f')]),[_0x5b6ac7['id'],_0x64f0ee[_0x4f49('0x83')](),path['join'](__dirname,_0x4f49('0x9e'),_0x5b6ac7[_0x4f49('0x9f')]),_0x289810]);return _0x5b6ac7;}else{var _0x5efb11=squel['select']();_0x5efb11[_0x4f49('0x6f')]('('+_0x64f0ee[_0x4f49('0x83')]()+')',_0x4f49('0xa0'));_0x5efb11[_0x4f49('0x67')](_0x4f49('0xa1'),_0x4f49('0x20'));_0x64f0ee['limit'](_0x16cb4d['limit']||_0x5c33c9);_0x64f0ee['offset'](_0x16cb4d[_0x4f49('0x1d')]||0x0);return dbH[_0x4f49('0x82')]['query'](_0x5efb11[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')][_0x4f49('0x84')]['SELECT']})['then'](function(_0x3633b5){if(!_0x3633b5['length']){_0x3a26ff=0x0;}else{_0x3a26ff=_0x3633b5[0x0][_0x4f49('0x20')]||0x0;}return dbH[_0x4f49('0x82')][_0x4f49('0x36')](_0x64f0ee[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')]['QueryTypes'][_0x4f49('0xa2')]});})[_0x4f49('0x26')](function(_0x45c938){return{'rows':_0x45c938||[],'count':_0x3a26ff};});}});}exports[_0x4f49('0xa3')]=function(_0x4a4d75,_0x93e85d){return runReport(_0x4a4d75[_0x4f49('0x54')],_0x4a4d75['query'],_0x4a4d75[_0x4f49('0x45')])[_0x4f49('0x26')](respondWithResult(_0x93e85d,null))[_0x4f49('0x48')](handleError(_0x93e85d,null));};exports[_0x4f49('0xa4')]=runReport;exports[_0x4f49('0x36')]=function(_0x40991b,_0x56290f){var _0x4994b6=0xa;var _0x1c7d87=[_0x4f49('0x55'),_0x4f49('0x56'),_0x4f49('0x85'),_0x4f49('0x57')];var _0x5cd00a={'SUM':_0x4f49('0x86'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x4f49('0x5b'),'GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':_0x4f49('0x87'),'GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0xd876f1={'SEC_TO_TIME':_0x4f49('0x5e'),'DATE':_0x4f49('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0x4f49('0x88'),'UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x1ae2c9=function(_0x566634){return!_[_0x4f49('0x62')]([_0x4f49('0x89'),_0x4f49('0x63'),'IS\x20EMPTY',_0x4f49('0xa5')],_0x566634);};var _0x541dc2=function(_0x4061bf){if(!_0x4061bf||!_0x4061bf[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x1bc18d='(',_0x5e6103=0x0;_0x5e6103<_0x4061bf[_0x4f49('0x65')][_0x4f49('0x3c')];_0x5e6103+=0x1){_0x5e6103>0x0&&(_0x1bc18d+='\x20'+_0x4061bf[_0x4f49('0x8a')]+'\x20');_0x1bc18d+=_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x66')]?_0x541dc2(_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x66')]):_0x4061bf[_0x4f49('0x65')][_0x5e6103]['field']+'\x20'+_0x4061bf['rules'][_0x5e6103][_0x4f49('0x8b')]+(_0x1ae2c9(_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x8b')])?'\x20'+_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x68')]:'');}return _0x1bc18d+')';};var _0x29dbab={'where':{'id':_0x40991b[_0x4f49('0x54')]['id']}},_0x5f459b,_0x1d090f,_0x37d2f4,_0x5bcb36,_0x3f04fa;_0x29dbab=_[_0x4f49('0x43')]({},_0x29dbab,_0x40991b['options']);return db['AnalyticDefaultReport'][_0x4f49('0x4b')](_0x29dbab)[_0x4f49('0x26')](function(_0x200848){if(_0x200848){_0x5f459b=_0x200848;return _0x200848['getFields']();}return null;})[_0x4f49('0x26')](function(_0x48f4bc){if(_0x48f4bc){if(!_0x48f4bc[_0x4f49('0x3c')]){throw new db['Sequelize'][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0x1d090f=_0x48f4bc;return db['AnalyticMetric'][_0x4f49('0x47')]({'raw':!![]});}return null;})[_0x4f49('0x26')](function(_0x513bc9){if(_0x513bc9){_0x37d2f4=_[_0x4f49('0x6d')](_0x513bc9,'id');var _0x47567c;var _0x5f1538=squel[_0x4f49('0x6e')]();_0x5f1538[_0x4f49('0x6f')](_0x5f459b[_0x4f49('0x70')]);for(var _0xd91e48=0x0;_0xd91e48<_0x1d090f[_0x4f49('0x3c')];_0xd91e48+=0x1){_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x71')]?_0x37d2f4[_0x1d090f[_0xd91e48]['MetricId']][_0x4f49('0x72')]:_0x1d090f[_0xd91e48][_0x4f49('0x67')];_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x73')]?_['replace'](_0x5cd00a[_0x1d090f[_0xd91e48][_0x4f49('0x73')]],'%s',_0x47567c):_0x47567c;_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0xd876f1[_0x1d090f[_0xd91e48][_0x4f49('0x75')]],'%s',_0x47567c):_0x47567c;if(_0x1d090f[_0xd91e48][_0x4f49('0x8d')]){_0x5f1538[_0x4f49('0x66')](_0x47567c);}_0x1d090f[_0xd91e48][_0x4f49('0x76')]&&_0x5f1538['order'](_0x47567c,_0x1d090f[_0xd91e48][_0x4f49('0x76')]==='DESC'?![]:!![]);_0x5f1538['field'](_0x47567c,_0x1d090f[_0xd91e48][_0x4f49('0x78')]||_0x47567c);}if(_0x5f459b['joins']){_0x5f459b[_0x4f49('0x79')]=JSON[_0x4f49('0x7a')](_0x5f459b[_0x4f49('0x79')]);for(var _0x85eb3f=0x0;_0x85eb3f<_0x5f459b[_0x4f49('0x79')][_0x4f49('0x3c')];_0x85eb3f+=0x1){if(_0x5f459b['joins'][_0x85eb3f][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x1c7d87,_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x33')])&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7d')]&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f]['foreignTable']&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7e')]){_0x5f1538[_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x33')]](_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7b')],null,util[_0x4f49('0x75')](_0x4f49('0x7c'),_0x5f459b[_0x4f49('0x70')],_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7d')],_0x5f459b[_0x4f49('0x79')][_0x85eb3f]['foreignTable'],_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7e')]));}}}if(_0x5f459b['conditions']){_0x5f459b[_0x4f49('0x7f')]=JSON[_0x4f49('0x7a')](_0x5f459b[_0x4f49('0x7f')]);_0x5f1538[_0x4f49('0x40')](_0x541dc2(_0x5f459b[_0x4f49('0x7f')][_0x4f49('0x66')]));}_0x3f04fa=_0x5f1538['clone']();_0x5f1538['limit'](_0x4994b6);_0x5f1538['offset'](0x0);logger['debug'](_0x4f49('0x81'),_0x5f1538['toString']());return dbH[_0x4f49('0x82')][_0x4f49('0x36')](_0x5f1538[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')][_0x4f49('0x84')][_0x4f49('0xa2')]});}})['then'](function(){return{'sql':_0x3f04fa[_0x4f49('0x83')]()};})['then'](respondWithResult(_0x56290f,null))[_0x4f49('0x48')](handleError(_0x56290f,null));}; \ No newline at end of file +var _0x2ef3=['Sequelize','from','foreignKey','output','web','fullPath','generate','csv','cdr','startDate','endDate','info','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','runReport','IS\x20NULL','IS\x20NOT\x20EMPTY','metric','Limited\x20Query:','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','get','DefaultReports','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','type','key','model','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','AnalyticDefaultReport','includeAll','include','findAll','rows','catch','show','params','keys','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','autoAssociation','update','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20EMPTY','operator','rules','group','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','MetricId','field','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','conditions','parse','clone','debug','toString','sequelize','QueryTypes','SELECT','join','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x2ef3,0xba));var _0x32ef=function(_0x1c1d6d,_0x1299a7){_0x1c1d6d=_0x1c1d6d-0x0;var _0x1444ef=_0x2ef3[_0x1c1d6d];return _0x1444ef;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];var dbH=require(_0x32ef('0x18'))['dbH'];function respondWithStatusCode(_0x3e98df,_0x1ef1ae){_0x1ef1ae=_0x1ef1ae||0xcc;return function(_0x5c3eb9){if(_0x5c3eb9){return _0x3e98df['sendStatus'](_0x1ef1ae);}return _0x3e98df[_0x32ef('0x19')](_0x1ef1ae)['end']();};}function respondWithResult(_0x326fce,_0x40a6e6){_0x40a6e6=_0x40a6e6||0xc8;return function(_0x93d492){if(_0x93d492){return _0x326fce[_0x32ef('0x19')](_0x40a6e6)['json'](_0x93d492);}};}function respondWithFilteredResult(_0x55bf0b,_0x531e30){return function(_0x13db1a){if(_0x13db1a){var _0x3950e6=typeof _0x531e30[_0x32ef('0x1a')]==='undefined'&&typeof _0x531e30['limit']===_0x32ef('0x1b');var _0x1a9476=_0x13db1a[_0x32ef('0x1c')];var _0x57863c=_0x3950e6?0x0:_0x531e30[_0x32ef('0x1a')];var _0x33e230=_0x3950e6?_0x13db1a['count']:_0x531e30[_0x32ef('0x1a')]+_0x531e30[_0x32ef('0x1d')];var _0x26aff3;if(_0x33e230>=_0x1a9476){_0x33e230=_0x1a9476;_0x26aff3=0xc8;}else{_0x26aff3=0xce;}_0x55bf0b[_0x32ef('0x19')](_0x26aff3);return _0x55bf0b[_0x32ef('0x1e')](_0x32ef('0x1f'),_0x57863c+'-'+_0x33e230+'/'+_0x1a9476)['json'](_0x13db1a);}return null;};}function patchUpdates(_0x3c5b78){return function(_0x5cc3ef){try{jsonpatch[_0x32ef('0x20')](_0x5cc3ef,_0x3c5b78,!![]);}catch(_0x3a20ca){return BPromise['reject'](_0x3a20ca);}return _0x5cc3ef[_0x32ef('0x21')]();};}function saveUpdates(_0x97780,_0x5e8898){return function(_0x55f7f2){if(_0x55f7f2){return _0x55f7f2['update'](_0x97780)[_0x32ef('0x22')](function(_0xb30fab){return _0xb30fab;});}return null;};}function removeEntity(_0x225feb,_0x478bef){return function(_0x59585f){if(_0x59585f){return _0x59585f[_0x32ef('0x23')]()['then'](function(){var _0x51a412=_0x59585f[_0x32ef('0x24')]({'plain':!![]});var _0x14d4b3=_0x32ef('0x25');return db[_0x32ef('0x26')][_0x32ef('0x23')]({'where':{'type':_0x14d4b3,'resourceId':_0x51a412['id']}})[_0x32ef('0x22')](function(){return _0x59585f;});})[_0x32ef('0x22')](function(){_0x225feb[_0x32ef('0x19')](0xcc)[_0x32ef('0x27')]();});}};}function handleEntityNotFound(_0x2f52d7,_0x1335e2){return function(_0xba4b3f){if(!_0xba4b3f){_0x2f52d7['sendStatus'](0x194);}return _0xba4b3f;};}function handleError(_0xd65fde,_0x2f5d06){_0x2f5d06=_0x2f5d06||0x1f4;return function(_0x5a04cd){logger[_0x32ef('0x28')](_0x5a04cd[_0x32ef('0x29')]);if(_0x5a04cd[_0x32ef('0x2a')]){delete _0x5a04cd[_0x32ef('0x2a')];}_0xd65fde['status'](_0x2f5d06)[_0x32ef('0x2b')](_0x5a04cd);};}exports[_0x32ef('0x2c')]=function(_0x31dbc3,_0x2ac686){var _0x1b668a={},_0x1a6ed2={},_0x1a122d={'count':0x0,'rows':[]};var _0x575f3e=_[_0x32ef('0x2d')](db['AnalyticDefaultReport'][_0x32ef('0x2e')],function(_0x2b6c6a){return{'name':_0x2b6c6a['fieldName'],'type':_0x2b6c6a[_0x32ef('0x2f')][_0x32ef('0x30')]};});_0x1a6ed2[_0x32ef('0x31')]=_[_0x32ef('0x2d')](_0x575f3e,_0x32ef('0x2a'));_0x1a6ed2['query']=_['keys'](_0x31dbc3[_0x32ef('0x32')]);_0x1a6ed2['filters']=_[_0x32ef('0x33')](_0x1a6ed2[_0x32ef('0x31')],_0x1a6ed2[_0x32ef('0x32')]);_0x1b668a[_0x32ef('0x34')]=_[_0x32ef('0x33')](_0x1a6ed2[_0x32ef('0x31')],qs['fields'](_0x31dbc3['query']['fields']));_0x1b668a[_0x32ef('0x34')]=_0x1b668a[_0x32ef('0x34')][_0x32ef('0x35')]?_0x1b668a['attributes']:_0x1a6ed2['model'];if(!_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x36')](_0x32ef('0x37'))){_0x1b668a['limit']=qs['limit'](_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x1d')]);_0x1b668a[_0x32ef('0x1a')]=qs[_0x32ef('0x1a')](_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x1a')]);}_0x1b668a[_0x32ef('0x38')]=qs[_0x32ef('0x39')](_0x31dbc3[_0x32ef('0x32')]['sort']);_0x1b668a[_0x32ef('0x3a')]=qs[_0x32ef('0x3b')](_[_0x32ef('0x3c')](_0x31dbc3['query'],_0x1a6ed2[_0x32ef('0x3b')]),_0x575f3e);if(_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x3d')]){_0x1b668a[_0x32ef('0x3a')]=_[_0x32ef('0x3e')](_0x1b668a[_0x32ef('0x3a')],{'$or':_[_0x32ef('0x2d')](_0x575f3e,function(_0x1cebed){if(_0x1cebed[_0x32ef('0x2f')]!==_0x32ef('0x3f')){var _0xb4db74={};_0xb4db74[_0x1cebed[_0x32ef('0x2a')]]={'$like':'%'+_0x31dbc3['query'][_0x32ef('0x3d')]+'%'};return _0xb4db74;}})});}_0x1b668a=_[_0x32ef('0x3e')]({},_0x1b668a,_0x31dbc3[_0x32ef('0x40')]);var _0x1733e3={'where':_0x1b668a[_0x32ef('0x3a')]};return db[_0x32ef('0x41')][_0x32ef('0x1c')](_0x1733e3)['then'](function(_0x538758){_0x1a122d[_0x32ef('0x1c')]=_0x538758;if(_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x42')]){_0x1b668a[_0x32ef('0x43')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x32ef('0x44')](_0x1b668a);})[_0x32ef('0x22')](function(_0x5d2f06){_0x1a122d[_0x32ef('0x45')]=_0x5d2f06;return _0x1a122d;})['then'](respondWithFilteredResult(_0x2ac686,_0x1b668a))[_0x32ef('0x46')](handleError(_0x2ac686,null));};exports[_0x32ef('0x47')]=function(_0x37a497,_0x3be46d){var _0x2c2b62={'raw':!![],'where':{'id':_0x37a497[_0x32ef('0x48')]['id']}},_0x2310ae={};_0x2310ae[_0x32ef('0x31')]=_[_0x32ef('0x49')](db[_0x32ef('0x41')]['rawAttributes']);_0x2310ae[_0x32ef('0x32')]=_['keys'](_0x37a497[_0x32ef('0x32')]);_0x2310ae[_0x32ef('0x3b')]=_[_0x32ef('0x33')](_0x2310ae['model'],_0x2310ae[_0x32ef('0x32')]);_0x2c2b62[_0x32ef('0x34')]=_[_0x32ef('0x33')](_0x2310ae[_0x32ef('0x31')],qs[_0x32ef('0x4a')](_0x37a497[_0x32ef('0x32')][_0x32ef('0x4a')]));_0x2c2b62['attributes']=_0x2c2b62['attributes'][_0x32ef('0x35')]?_0x2c2b62[_0x32ef('0x34')]:_0x2310ae[_0x32ef('0x31')];if(_0x37a497[_0x32ef('0x32')][_0x32ef('0x42')]){_0x2c2b62[_0x32ef('0x43')]=[{'all':!![]}];}_0x2c2b62=_[_0x32ef('0x3e')]({},_0x2c2b62,_0x37a497[_0x32ef('0x40')]);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x2c2b62)[_0x32ef('0x22')](handleEntityNotFound(_0x3be46d,null))[_0x32ef('0x22')](respondWithResult(_0x3be46d,null))[_0x32ef('0x46')](handleError(_0x3be46d,null));};exports['create']=function(_0x420f00,_0x12fbd7){return db[_0x32ef('0x41')][_0x32ef('0x4c')](_0x420f00[_0x32ef('0x4d')],{})[_0x32ef('0x22')](function(_0x278696){var _0x1acded=_0x420f00[_0x32ef('0x4e')][_0x32ef('0x24')]({'plain':!![]});if(!_0x1acded)throw new Error(_0x32ef('0x4f'));if(_0x1acded[_0x32ef('0x50')]===_0x32ef('0x4e')){var _0x326445=_0x278696[_0x32ef('0x24')]({'plain':!![]});var _0x3fb4d8=_0x32ef('0x51');return db[_0x32ef('0x52')]['find']({'where':{'name':_0x3fb4d8,'userProfileId':_0x1acded['userProfileId']},'raw':!![]})[_0x32ef('0x22')](function(_0x259c32){if(_0x259c32&&_0x259c32[_0x32ef('0x53')]===0x0){return db[_0x32ef('0x26')][_0x32ef('0x4c')]({'name':_0x326445[_0x32ef('0x2a')],'resourceId':_0x326445['id'],'type':_0x32ef('0x25'),'sectionId':_0x259c32['id']},{})[_0x32ef('0x22')](function(){return _0x278696;});}else{return _0x278696;}})[_0x32ef('0x46')](function(_0x368bf1){logger[_0x32ef('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x368bf1);throw _0x368bf1;});}return _0x278696;})[_0x32ef('0x22')](respondWithResult(_0x12fbd7,0xc9))[_0x32ef('0x46')](handleError(_0x12fbd7,null));};exports[_0x32ef('0x54')]=function(_0x3fe01f,_0x38314a){if(_0x3fe01f[_0x32ef('0x4d')]['id']){delete _0x3fe01f['body']['id'];}return db[_0x32ef('0x41')][_0x32ef('0x4b')]({'where':{'id':_0x3fe01f[_0x32ef('0x48')]['id']}})['then'](handleEntityNotFound(_0x38314a,null))[_0x32ef('0x22')](saveUpdates(_0x3fe01f['body'],null))[_0x32ef('0x22')](respondWithResult(_0x38314a,null))[_0x32ef('0x46')](handleError(_0x38314a,null));};exports['destroy']=function(_0x206ad5,_0x59e5f9){return db[_0x32ef('0x41')][_0x32ef('0x4b')]({'where':{'id':_0x206ad5[_0x32ef('0x48')]['id']}})[_0x32ef('0x22')](handleEntityNotFound(_0x59e5f9,null))[_0x32ef('0x22')](removeEntity(_0x59e5f9,null))[_0x32ef('0x46')](handleError(_0x59e5f9,null));};exports[_0x32ef('0x55')]=function(_0x56260f,_0x56cc75){var _0xdfa103=0xa;var _0x52232a=['join',_0x32ef('0x56'),_0x32ef('0x57'),_0x32ef('0x58')];var _0x6aae59={'SUM':_0x32ef('0x59'),'COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':_0x32ef('0x5d'),'AVG':_0x32ef('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x32ef('0x5f')};var _0xbd059e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2ac877=function(_0x3c31d0){return!_[_0x32ef('0x63')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x32ef('0x64'),'IS\x20NOT\x20EMPTY'],_0x3c31d0);};var _0x17f447=function(_0x5bb114){if(!_0x5bb114||!_0x5bb114['rules'][_0x32ef('0x35')]){return'';}for(var _0x208989='(',_0x10cb37=0x0;_0x10cb37<_0x5bb114['rules'][_0x32ef('0x35')];_0x10cb37+=0x1){_0x10cb37>0x0&&(_0x208989+='\x20'+_0x5bb114[_0x32ef('0x65')]+'\x20');_0x208989+=_0x5bb114[_0x32ef('0x66')][_0x10cb37]['group']?_0x17f447(_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x67')]):_0x5bb114['rules'][_0x10cb37]['field']+'\x20'+_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x68')]+(_0x2ac877(_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x68')])?'\x20'+_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x69')]:'');}return _0x208989+')';};var _0x4c89e8={'where':{'id':_0x56260f[_0x32ef('0x48')]['id']}},_0x285330,_0x63b65,_0x25b6d6,_0x36ed97,_0x21e930;_0x4c89e8=_[_0x32ef('0x3e')]({},_0x4c89e8,_0x56260f[_0x32ef('0x40')]);return db[_0x32ef('0x41')]['find'](_0x4c89e8)[_0x32ef('0x22')](function(_0x29ff58){if(_0x29ff58){_0x285330=_0x29ff58;return _0x29ff58[_0x32ef('0x6a')]();}return null;})[_0x32ef('0x22')](function(_0x79ae28){if(_0x79ae28){if(!_0x79ae28['length']){throw new db['Sequelize'][(_0x32ef('0x6b'))](_0x32ef('0x6c'),0x193);}_0x63b65=_0x79ae28;return db[_0x32ef('0x6d')][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x526fb1){if(_0x526fb1){_0x25b6d6=_[_0x32ef('0x6e')](_0x526fb1,'id');var _0x544045;var _0x216e2f=squel[_0x32ef('0x6f')]();_0x216e2f['from'](_0x285330['table']);for(var _0x2c9f7a=0x0;_0x2c9f7a<_0x63b65[_0x32ef('0x35')];_0x2c9f7a+=0x1){_0x544045=_0x63b65[_0x2c9f7a][_0x32ef('0x70')]?_0x25b6d6[_0x63b65[_0x2c9f7a]['MetricId']]['metric']:_0x63b65[_0x2c9f7a][_0x32ef('0x71')];_0x544045=_0x63b65[_0x2c9f7a][_0x32ef('0x72')]?_[_0x32ef('0x73')](_0x6aae59[_0x63b65[_0x2c9f7a][_0x32ef('0x72')]],'%s',_0x544045):_0x544045;_0x544045=_0x63b65[_0x2c9f7a]['format']?_[_0x32ef('0x73')](_0xbd059e[_0x63b65[_0x2c9f7a][_0x32ef('0x74')]],'%s',_0x544045):_0x544045;if(_0x63b65[_0x2c9f7a][_0x32ef('0x75')]){_0x216e2f[_0x32ef('0x67')](_0x544045);}_0x63b65[_0x2c9f7a][_0x32ef('0x76')]&&_0x216e2f[_0x32ef('0x38')](_0x544045,_0x63b65[_0x2c9f7a][_0x32ef('0x76')]===_0x32ef('0x77')?![]:!![]);_0x216e2f[_0x32ef('0x71')](_0x544045,_0x63b65[_0x2c9f7a][_0x32ef('0x78')]||_0x544045);}if(_0x285330[_0x32ef('0x79')]){_0x285330[_0x32ef('0x79')]=JSON['parse'](_0x285330['joins']);for(var _0x3a9c97=0x0;_0x3a9c97<_0x285330[_0x32ef('0x79')]['length'];_0x3a9c97+=0x1){if(_0x285330[_0x32ef('0x79')][_0x3a9c97]['type']&&_[_0x32ef('0x63')](_0x52232a,_0x285330[_0x32ef('0x79')][_0x3a9c97][_0x32ef('0x2f')])&&_0x285330['joins'][_0x3a9c97][_0x32ef('0x7a')]&&_0x285330['joins'][_0x3a9c97][_0x32ef('0x7b')]&&_0x285330[_0x32ef('0x79')][_0x3a9c97]['foreignKey']){_0x216e2f[_0x285330['joins'][_0x3a9c97][_0x32ef('0x2f')]](_0x285330['joins'][_0x3a9c97][_0x32ef('0x7b')],null,util['format'](_0x32ef('0x7c'),_0x285330[_0x32ef('0x7d')],_0x285330[_0x32ef('0x79')][_0x3a9c97]['parentKey'],_0x285330['joins'][_0x3a9c97]['foreignTable'],_0x285330[_0x32ef('0x79')][_0x3a9c97]['foreignKey']));}}}if(_0x285330[_0x32ef('0x7e')]){_0x285330[_0x32ef('0x7e')]=JSON[_0x32ef('0x7f')](_0x285330[_0x32ef('0x7e')]);_0x216e2f[_0x32ef('0x3a')](_0x17f447(_0x285330[_0x32ef('0x7e')]['group']));}_0x21e930=_0x216e2f[_0x32ef('0x80')]();_0x216e2f['limit'](_0xdfa103);_0x216e2f['offset'](0x0);logger[_0x32ef('0x81')]('Limited\x20Query:',_0x216e2f[_0x32ef('0x82')]());return dbH[_0x32ef('0x83')]['query'](_0x216e2f[_0x32ef('0x82')](),{'type':dbH[_0x32ef('0x83')][_0x32ef('0x84')][_0x32ef('0x85')]});}})[_0x32ef('0x22')](respondWithResult(_0x56cc75,null))[_0x32ef('0x46')](handleError(_0x56cc75,null));};function runReport(_0x4b5506,_0x51736f,_0x35b10d){var _0x5e0b55=_0x51736f[_0x32ef('0x2a')];var _0x266688=0xa;var _0x114d8e=[_0x32ef('0x86'),_0x32ef('0x56'),_0x32ef('0x57'),'cross_join'];var _0x3232ca={'SUM':_0x32ef('0x59'),'COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x32ef('0x87'),'GROUP_CONCAT ASC':_0x32ef('0x88'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x211fb1={'SEC_TO_TIME':_0x32ef('0x89'),'DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':_0x32ef('0x8a')};var _0xfb4845=function(_0x21067e){return!_[_0x32ef('0x63')](['IS\x20NULL',_0x32ef('0x8b'),_0x32ef('0x64'),'IS\x20NOT\x20EMPTY'],_0x21067e);};var _0x35653b=function(_0x5ea727){if(!_0x5ea727||!_0x5ea727[_0x32ef('0x66')]['length']){return'';}for(var _0x43f36e='(',_0x39300f=0x0;_0x39300f<_0x5ea727[_0x32ef('0x66')][_0x32ef('0x35')];_0x39300f+=0x1){_0x39300f>0x0&&(_0x43f36e+='\x20'+_0x5ea727['operator']+'\x20');_0x43f36e+=_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x67')]?_0x35653b(_0x5ea727[_0x32ef('0x66')][_0x39300f]['group']):_0x5ea727['rules'][_0x39300f]['field']+'\x20'+_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x68')]+(_0xfb4845(_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x68')])?'\x20'+_0x5ea727[_0x32ef('0x66')][_0x39300f]['value']:'');}return _0x43f36e+')';};var _0x2678e3={'where':{'id':_0x4b5506['id']}},_0x5b3deb,_0x471de6,_0x7b0ea5,_0xc43e1,_0x4baa7a;_0x2678e3=_[_0x32ef('0x3e')]({},_0x2678e3,_0x35b10d);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x2678e3)[_0x32ef('0x22')](function(_0x28bebb){if(_0x28bebb){_0x5b3deb=_0x28bebb;return _0x28bebb['getFields']();}return null;})[_0x32ef('0x22')](function(_0x484df0){if(_0x484df0){if(!_0x484df0[_0x32ef('0x35')]){throw new db[(_0x32ef('0x8c'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x471de6=_0x484df0;return db[_0x32ef('0x6d')][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x3b9896){if(_0x3b9896){_0x7b0ea5=_['keyBy'](_0x3b9896,'id');var _0x356fd4;var _0x51ca6e=squel['select']();_0x51ca6e[_0x32ef('0x8d')](_0x5b3deb['table']);for(var _0x2237cf=0x0;_0x2237cf<_0x471de6[_0x32ef('0x35')];_0x2237cf+=0x1){_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x70')]?_0x7b0ea5[_0x471de6[_0x2237cf]['MetricId']]['metric']:_0x471de6[_0x2237cf][_0x32ef('0x71')];_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x72')]?_[_0x32ef('0x73')](_0x3232ca[_0x471de6[_0x2237cf][_0x32ef('0x72')]],'%s',_0x356fd4):_0x356fd4;_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x74')]?_[_0x32ef('0x73')](_0x211fb1[_0x471de6[_0x2237cf][_0x32ef('0x74')]],'%s',_0x356fd4):_0x356fd4;if(_0x471de6[_0x2237cf]['groupBy']){_0x51ca6e[_0x32ef('0x67')](_0x356fd4);}_0x471de6[_0x2237cf][_0x32ef('0x76')]&&_0x51ca6e[_0x32ef('0x38')](_0x356fd4,_0x471de6[_0x2237cf][_0x32ef('0x76')]==='DESC'?![]:!![]);_0x51ca6e['field'](_0x356fd4,_0x471de6[_0x2237cf][_0x32ef('0x78')]||_0x356fd4);}if(_0x5b3deb['joins']){_0x5b3deb[_0x32ef('0x79')]=JSON[_0x32ef('0x7f')](_0x5b3deb['joins']);for(var _0x5c7594=0x0;_0x5c7594<_0x5b3deb['joins'][_0x32ef('0x35')];_0x5c7594+=0x1){if(_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x2f')]&&_[_0x32ef('0x63')](_0x114d8e,_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x2f')])&&_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7a')]&&_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x7b')]&&_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x8e')]){_0x51ca6e[_0x5b3deb[_0x32ef('0x79')][_0x5c7594]['type']](_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x7b')],null,util[_0x32ef('0x74')](_0x32ef('0x7c'),_0x5b3deb[_0x32ef('0x7d')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7a')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7b')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594]['foreignKey']));}}}if(_0x5b3deb[_0x32ef('0x7e')]){_0x5b3deb['conditions']=JSON[_0x32ef('0x7f')](_0x5b3deb[_0x32ef('0x7e')]);_0x51ca6e[_0x32ef('0x3a')](_0x35653b(_0x5b3deb[_0x32ef('0x7e')][_0x32ef('0x67')]));}_0x4baa7a=_0x51ca6e['clone']();_0x51ca6e[_0x32ef('0x1d')](_0x266688);_0x51ca6e[_0x32ef('0x1a')](0x0);return;}})[_0x32ef('0x22')](function(){if(_0x51736f[_0x32ef('0x8f')]===_0x32ef('0x90')){return null;}var _0x1cfdd8=_[_0x32ef('0x3e')](_0x51736f,{'name':_0x51736f[_0x32ef('0x91')]||_0x51736f[_0x32ef('0x2a')]||_0x5b3deb['name'],'basename':_0x5e0b55,'savename':util['format']('%s-%s.%s',_0x51736f[_0x32ef('0x2a')]||_0x5b3deb[_0x32ef('0x2a')],require('randomstring')[_0x32ef('0x92')](0x4),_0x51736f['output']||_0x32ef('0x93')),'reportId':_0x5b3deb['id'],'reportType':'default'});return db['AnalyticExtractedReport'][_0x32ef('0x4c')](_0x1cfdd8,{'raw':!![]});})[_0x32ef('0x22')](function(_0x118d2e){if(_0x5b3deb[_0x32ef('0x7d')]===_0x32ef('0x94')){_0x4baa7a['where'](_0x5b3deb[_0x32ef('0x7d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x51736f[_0x32ef('0x95')],_0x51736f['endDate']);}else{_0x4baa7a['where'](_0x5b3deb['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x51736f['startDate'],_0x51736f[_0x32ef('0x96')]);}if(_0x118d2e){logger[_0x32ef('0x97')]('Run\x20Query:',_0x4baa7a[_0x32ef('0x82')]());require(_0x32ef('0x98'))[_0x32ef('0x99')](path[_0x32ef('0x86')](__dirname,_0x32ef('0x9a'),_0x118d2e[_0x32ef('0x8f')]),[_0x118d2e['id'],_0x4baa7a['toString'](),path[_0x32ef('0x86')](__dirname,'../../files/reports',_0x118d2e[_0x32ef('0x9b')]),_0x5e0b55]);return _0x118d2e;}else{var _0x1be713=squel['select']();_0x1be713[_0x32ef('0x8d')]('('+_0x4baa7a['toString']()+')',_0x32ef('0x9c'));_0x1be713[_0x32ef('0x71')](_0x32ef('0x9d'),_0x32ef('0x1c'));_0x4baa7a['limit'](_0x51736f[_0x32ef('0x1d')]||_0x266688);_0x4baa7a[_0x32ef('0x1a')](_0x51736f[_0x32ef('0x1a')]||0x0);return dbH[_0x32ef('0x83')]['query'](_0x1be713[_0x32ef('0x82')](),{'type':dbH['sequelize'][_0x32ef('0x84')][_0x32ef('0x85')]})[_0x32ef('0x22')](function(_0x28ef17){if(!_0x28ef17[_0x32ef('0x35')]){_0xc43e1=0x0;}else{_0xc43e1=_0x28ef17[0x0][_0x32ef('0x1c')]||0x0;}return dbH['sequelize'][_0x32ef('0x32')](_0x4baa7a['toString'](),{'type':dbH['sequelize'][_0x32ef('0x84')][_0x32ef('0x85')]});})[_0x32ef('0x22')](function(_0x3956e7){return{'rows':_0x3956e7||[],'count':_0xc43e1};});}});}exports['run']=function(_0x8d3b24,_0x642716){return runReport(_0x8d3b24[_0x32ef('0x48')],_0x8d3b24[_0x32ef('0x32')],_0x8d3b24['options'])['then'](respondWithResult(_0x642716,null))['catch'](handleError(_0x642716,null));};exports[_0x32ef('0x9e')]=runReport;exports[_0x32ef('0x32')]=function(_0x4454f3,_0xc92dcc){var _0x3d18b9=0xa;var _0x9233cb=[_0x32ef('0x86'),_0x32ef('0x56'),_0x32ef('0x57'),_0x32ef('0x58')];var _0xa76912={'SUM':'SUM(%s)','COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':_0x32ef('0x5d'),'AVG':_0x32ef('0x5e'),'GROUP_CONCAT':_0x32ef('0x87'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x32ef('0x5f')};var _0x1526a1={'SEC_TO_TIME':_0x32ef('0x89'),'DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':_0x32ef('0x8a')};var _0x2d4d2f=function(_0x292488){return!_[_0x32ef('0x63')]([_0x32ef('0x9f'),_0x32ef('0x8b'),_0x32ef('0x64'),_0x32ef('0xa0')],_0x292488);};var _0x50b674=function(_0x379d40){if(!_0x379d40||!_0x379d40[_0x32ef('0x66')][_0x32ef('0x35')]){return'';}for(var _0x4b7a4d='(',_0x16525b=0x0;_0x16525b<_0x379d40['rules'][_0x32ef('0x35')];_0x16525b+=0x1){_0x16525b>0x0&&(_0x4b7a4d+='\x20'+_0x379d40[_0x32ef('0x65')]+'\x20');_0x4b7a4d+=_0x379d40[_0x32ef('0x66')][_0x16525b]['group']?_0x50b674(_0x379d40[_0x32ef('0x66')][_0x16525b]['group']):_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x71')]+'\x20'+_0x379d40['rules'][_0x16525b][_0x32ef('0x68')]+(_0x2d4d2f(_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x68')])?'\x20'+_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x69')]:'');}return _0x4b7a4d+')';};var _0x264075={'where':{'id':_0x4454f3[_0x32ef('0x48')]['id']}},_0x3798d1,_0x4befa9,_0x493ae9,_0x143d39,_0x497948;_0x264075=_[_0x32ef('0x3e')]({},_0x264075,_0x4454f3['options']);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x264075)['then'](function(_0x1200c9){if(_0x1200c9){_0x3798d1=_0x1200c9;return _0x1200c9[_0x32ef('0x6a')]();}return null;})[_0x32ef('0x22')](function(_0xa5f787){if(_0xa5f787){if(!_0xa5f787[_0x32ef('0x35')]){throw new db['Sequelize'][(_0x32ef('0x6b'))](_0x32ef('0x6c'),0x193);}_0x4befa9=_0xa5f787;return db['AnalyticMetric'][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x55ad11){if(_0x55ad11){_0x493ae9=_[_0x32ef('0x6e')](_0x55ad11,'id');var _0x2971a8;var _0x522c22=squel[_0x32ef('0x6f')]();_0x522c22[_0x32ef('0x8d')](_0x3798d1['table']);for(var _0xb41a01=0x0;_0xb41a01<_0x4befa9[_0x32ef('0x35')];_0xb41a01+=0x1){_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x70')]?_0x493ae9[_0x4befa9[_0xb41a01][_0x32ef('0x70')]][_0x32ef('0xa1')]:_0x4befa9[_0xb41a01][_0x32ef('0x71')];_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x72')]?_['replace'](_0xa76912[_0x4befa9[_0xb41a01]['function']],'%s',_0x2971a8):_0x2971a8;_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x74')]?_[_0x32ef('0x73')](_0x1526a1[_0x4befa9[_0xb41a01][_0x32ef('0x74')]],'%s',_0x2971a8):_0x2971a8;if(_0x4befa9[_0xb41a01]['groupBy']){_0x522c22[_0x32ef('0x67')](_0x2971a8);}_0x4befa9[_0xb41a01][_0x32ef('0x76')]&&_0x522c22['order'](_0x2971a8,_0x4befa9[_0xb41a01][_0x32ef('0x76')]===_0x32ef('0x77')?![]:!![]);_0x522c22['field'](_0x2971a8,_0x4befa9[_0xb41a01]['alias']||_0x2971a8);}if(_0x3798d1[_0x32ef('0x79')]){_0x3798d1[_0x32ef('0x79')]=JSON[_0x32ef('0x7f')](_0x3798d1['joins']);for(var _0x5f4eab=0x0;_0x5f4eab<_0x3798d1['joins'][_0x32ef('0x35')];_0x5f4eab+=0x1){if(_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x2f')]&&_['includes'](_0x9233cb,_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x2f')])&&_0x3798d1[_0x32ef('0x79')][_0x5f4eab]['parentKey']&&_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')]&&_0x3798d1['joins'][_0x5f4eab]['foreignKey']){_0x522c22[_0x3798d1[_0x32ef('0x79')][_0x5f4eab]['type']](_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3798d1[_0x32ef('0x7d')],_0x3798d1['joins'][_0x5f4eab][_0x32ef('0x7a')],_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')],_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x8e')]));}}}if(_0x3798d1[_0x32ef('0x7e')]){_0x3798d1[_0x32ef('0x7e')]=JSON[_0x32ef('0x7f')](_0x3798d1[_0x32ef('0x7e')]);_0x522c22[_0x32ef('0x3a')](_0x50b674(_0x3798d1['conditions']['group']));}_0x497948=_0x522c22[_0x32ef('0x80')]();_0x522c22[_0x32ef('0x1d')](_0x3d18b9);_0x522c22[_0x32ef('0x1a')](0x0);logger[_0x32ef('0x81')](_0x32ef('0xa2'),_0x522c22[_0x32ef('0x82')]());return dbH[_0x32ef('0x83')][_0x32ef('0x32')](_0x522c22[_0x32ef('0x82')](),{'type':dbH[_0x32ef('0x83')]['QueryTypes'][_0x32ef('0x85')]});}})[_0x32ef('0x22')](function(){return{'sql':_0x497948[_0x32ef('0x82')]()};})[_0x32ef('0x22')](respondWithResult(_0xc92dcc,null))[_0x32ef('0x46')](handleError(_0xc92dcc,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index a74a3f0..52078ff 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 _0x3759=['../../config/logger','moment','bluebird','request-promise','path','./analyticDefaultReport.attributes','exports','define','lodash'];(function(_0x3c4737,_0x2329ec){var _0x2bb926=function(_0x3b9605){while(--_0x3b9605){_0x3c4737['push'](_0x3c4737['shift']());}};_0x2bb926(++_0x2329ec);}(_0x3759,0x1b8));var _0x9375=function(_0x53d956,_0x555ab0){_0x53d956=_0x53d956-0x0;var _0x5226cf=_0x3759[_0x53d956];return _0x5226cf;};'use strict';var _=require(_0x9375('0x0'));var util=require('util');var logger=require(_0x9375('0x1'))('api');var moment=require(_0x9375('0x2'));var BPromise=require(_0x9375('0x3'));var rp=require(_0x9375('0x4'));var fs=require('fs');var path=require(_0x9375('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9375('0x6'));module[_0x9375('0x7')]=function(_0x3bab61,_0x44c9b1){return _0x3bab61[_0x9375('0x8')]('AnalyticDefaultReport',attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x36d2=['api','moment','request-promise','path','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','util'];(function(_0x4d901e,_0x25223b){var _0x18069a=function(_0x19ad7c){while(--_0x19ad7c){_0x4d901e['push'](_0x4d901e['shift']());}};_0x18069a(++_0x25223b);}(_0x36d2,0x1b7));var _0x236d=function(_0x1857d0,_0x6eade0){_0x1857d0=_0x1857d0-0x0;var _0x3e3c46=_0x36d2[_0x1857d0];return _0x3e3c46;};'use strict';var _=require('lodash');var util=require(_0x236d('0x0'));var logger=require('../../config/logger')(_0x236d('0x1'));var moment=require(_0x236d('0x2'));var BPromise=require('bluebird');var rp=require(_0x236d('0x3'));var fs=require('fs');var path=require(_0x236d('0x4'));var rimraf=require('rimraf');var config=require(_0x236d('0x5'));var attributes=require(_0x236d('0x6'));module[_0x236d('0x7')]=function(_0x4f9944,_0x3905a1){return _0x4f9944[_0x236d('0x8')](_0x236d('0x9'),attributes,{'tableName':'analytics_default_reports','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 16c1e1e..9a2cd0a 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 _0xa3a4=['AnalyticDefaultReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','http','request','then','info'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa3a4,0xe5));var _0x4a3a=function(_0x52a824,_0x5981a8){_0x52a824=_0x52a824-0x0;var _0x34e999=_0xa3a4[_0x52a824];return _0x34e999;};'use strict';var _=require(_0x4a3a('0x0'));var util=require(_0x4a3a('0x1'));var moment=require(_0x4a3a('0x2'));var BPromise=require(_0x4a3a('0x3'));var rs=require(_0x4a3a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4a3a('0x5'));var logger=require(_0x4a3a('0x6'))(_0x4a3a('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4a3a('0x8')][_0x4a3a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x43d969,_0x3003a5,_0x47ec89){return new BPromise(function(_0x4e617b,_0x520ca4){return client[_0x4a3a('0xa')](_0x43d969,_0x47ec89)[_0x4a3a('0xb')](function(_0x5581fb){logger[_0x4a3a('0xc')](_0x4a3a('0xd'),_0x3003a5,'request\x20sent');logger[_0x4a3a('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x3003a5,_0x4a3a('0xf'),JSON[_0x4a3a('0x10')](_0x5581fb));if(_0x5581fb['error']){if(_0x5581fb[_0x4a3a('0x11')][_0x4a3a('0x12')]===0x1f4){logger[_0x4a3a('0x11')](_0x4a3a('0xd'),_0x3003a5,_0x5581fb[_0x4a3a('0x11')]['message']);return _0x520ca4(_0x5581fb[_0x4a3a('0x11')][_0x4a3a('0x13')]);}logger[_0x4a3a('0x11')](_0x4a3a('0xd'),_0x3003a5,_0x5581fb[_0x4a3a('0x11')][_0x4a3a('0x13')]);return _0x4e617b(_0x5581fb['error']['message']);}else{logger['info'](_0x4a3a('0xd'),_0x3003a5,_0x4a3a('0xf'));_0x4e617b(_0x5581fb[_0x4a3a('0x14')][_0x4a3a('0x13')]);}})[_0x4a3a('0x15')](function(_0x519f18){logger['error'](_0x4a3a('0xd'),_0x3003a5,_0x519f18);_0x520ca4(_0x519f18);});});} \ No newline at end of file +var _0x4d2f=['client','http','request','info','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0xc24af,_0x51f1db){var _0x26542c=function(_0x2c6097){while(--_0x2c6097){_0xc24af['push'](_0xc24af['shift']());}};_0x26542c(++_0x51f1db);}(_0x4d2f,0x14c));var _0xf4d2=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x4d2f[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xf4d2('0x0'));var util=require(_0xf4d2('0x1'));var moment=require(_0xf4d2('0x2'));var BPromise=require('bluebird');var rs=require(_0xf4d2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf4d2('0x4'))['db'];var utils=require(_0xf4d2('0x5'));var logger=require(_0xf4d2('0x6'))('rpc');var config=require(_0xf4d2('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf4d2('0x8')][_0xf4d2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1a30bf,_0x512244,_0x115b16){return new BPromise(function(_0x43cae3,_0x3abf19){return client[_0xf4d2('0xa')](_0x1a30bf,_0x115b16)['then'](function(_0x1269f0){logger[_0xf4d2('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x512244,_0xf4d2('0xc'));logger[_0xf4d2('0xd')](_0xf4d2('0xe'),_0x512244,_0xf4d2('0xc'),JSON[_0xf4d2('0xf')](_0x1269f0));if(_0x1269f0['error']){if(_0x1269f0[_0xf4d2('0x10')][_0xf4d2('0x11')]===0x1f4){logger[_0xf4d2('0x10')](_0xf4d2('0x12'),_0x512244,_0x1269f0[_0xf4d2('0x10')][_0xf4d2('0x13')]);return _0x3abf19(_0x1269f0[_0xf4d2('0x10')][_0xf4d2('0x13')]);}logger[_0xf4d2('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x512244,_0x1269f0[_0xf4d2('0x10')][_0xf4d2('0x13')]);return _0x43cae3(_0x1269f0[_0xf4d2('0x10')][_0xf4d2('0x13')]);}else{logger[_0xf4d2('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x512244,_0xf4d2('0xc'));_0x43cae3(_0x1269f0['result'][_0xf4d2('0x13')]);}})['catch'](function(_0x465ddb){logger[_0xf4d2('0x10')](_0xf4d2('0x12'),_0x512244,_0x465ddb);_0x3abf19(_0x465ddb);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 60dd581..6dfaed6 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 _0x6456=['isAuthenticated','/:id','get','/:id/preview','preview','run','/:id/query','query','post','create','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller'];(function(_0x2fa0b2,_0x3248b0){var _0x553f35=function(_0x2257c6){while(--_0x2257c6){_0x2fa0b2['push'](_0x2fa0b2['shift']());}};_0x553f35(++_0x3248b0);}(_0x6456,0xe6));var _0x6645=function(_0x3fa5f1,_0x1f3b85){_0x3fa5f1=_0x3fa5f1-0x0;var _0x3de168=_0x6456[_0x3fa5f1];return _0x3de168;};'use strict';var multer=require(_0x6645('0x0'));var util=require(_0x6645('0x1'));var path=require(_0x6645('0x2'));var timeout=require('connect-timeout');var express=require(_0x6645('0x3'));var router=express[_0x6645('0x4')]();var fs_extra=require(_0x6645('0x5'));var auth=require(_0x6645('0x6'));var interaction=require(_0x6645('0x7'));var config=require(_0x6645('0x8'));var controller=require(_0x6645('0x9'));router['get']('/',auth[_0x6645('0xa')](),controller['index']);router['get'](_0x6645('0xb'),auth[_0x6645('0xa')](),controller['show']);router[_0x6645('0xc')](_0x6645('0xd'),auth[_0x6645('0xa')](),controller[_0x6645('0xe')]);router[_0x6645('0xc')]('/:id/run',auth['isAuthenticated'](),controller[_0x6645('0xf')]);router['get'](_0x6645('0x10'),auth[_0x6645('0xa')](),controller[_0x6645('0x11')]);router[_0x6645('0x12')]('/',auth[_0x6645('0xa')](),controller[_0x6645('0x13')]);router['put'](_0x6645('0xb'),auth[_0x6645('0xa')](),controller[_0x6645('0x14')]);router[_0x6645('0x15')](_0x6645('0xb'),auth[_0x6645('0xa')](),controller[_0x6645('0x16')]);module[_0x6645('0x17')]=router; \ No newline at end of file +var _0xeb20=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','isAuthenticated','get','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','update','delete','destroy','exports'];(function(_0x57add2,_0x4f2b7d){var _0x4e3670=function(_0x3311b){while(--_0x3311b){_0x57add2['push'](_0x57add2['shift']());}};_0x4e3670(++_0x4f2b7d);}(_0xeb20,0xea));var _0x0eb2=function(_0x26e898,_0x2d0c3f){_0x26e898=_0x26e898-0x0;var _0x145ac3=_0xeb20[_0x26e898];return _0x145ac3;};'use strict';var multer=require(_0x0eb2('0x0'));var util=require(_0x0eb2('0x1'));var path=require(_0x0eb2('0x2'));var timeout=require(_0x0eb2('0x3'));var express=require(_0x0eb2('0x4'));var router=express[_0x0eb2('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0eb2('0x6'));var interaction=require(_0x0eb2('0x7'));var config=require('../../config/environment');var controller=require(_0x0eb2('0x8'));router['get']('/',auth[_0x0eb2('0x9')](),controller['index']);router[_0x0eb2('0xa')](_0x0eb2('0xb'),auth[_0x0eb2('0x9')](),controller[_0x0eb2('0xc')]);router[_0x0eb2('0xa')](_0x0eb2('0xd'),auth['isAuthenticated'](),controller[_0x0eb2('0xe')]);router['get'](_0x0eb2('0xf'),auth['isAuthenticated'](),controller[_0x0eb2('0x10')]);router[_0x0eb2('0xa')](_0x0eb2('0x11'),auth['isAuthenticated'](),controller[_0x0eb2('0x12')]);router[_0x0eb2('0x13')]('/',auth[_0x0eb2('0x9')](),controller[_0x0eb2('0x14')]);router[_0x0eb2('0x15')](_0x0eb2('0xb'),auth[_0x0eb2('0x9')](),controller[_0x0eb2('0x16')]);router[_0x0eb2('0x17')](_0x0eb2('0xb'),auth[_0x0eb2('0x9')](),controller[_0x0eb2('0x18')]);module[_0x0eb2('0x19')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 2940d99..aee6529 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 _0x65fc=['DATE','scheduled','manual','UNSIGNED','moment','exports','STRING','ENUM','csv','pdf'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x65fc,0x176));var _0xc65f=function(_0x2ccb82,_0x49f899){_0x2ccb82=_0x2ccb82-0x0;var _0x15d9e5=_0x65fc[_0x2ccb82];return _0x15d9e5;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xc65f('0x0'));module[_0xc65f('0x1')]={'name':{'type':Sequelize[_0xc65f('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xc65f('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xc65f('0x3')](_0xc65f('0x4'),_0xc65f('0x5'),'xlsx'),'allowNull':![],'defaultValue':_0xc65f('0x4')},'savename':{'type':Sequelize[_0xc65f('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xc65f('0x6')]},'endDate':{'type':Sequelize[_0xc65f('0x6')]},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM']('manual',_0xc65f('0x7')),'allowNull':![],'defaultValue':_0xc65f('0x8')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0xc65f('0x9')]},'reportType':{'type':Sequelize[_0xc65f('0x2')]}}; \ No newline at end of file +var _0xc78f=['pdf','DATE','Loading','manual','scheduled','INTEGER','UNSIGNED','sequelize','exports','STRING','ENUM'];(function(_0x3b6945,_0x2704e7){var _0x338c99=function(_0x51dfb4){while(--_0x51dfb4){_0x3b6945['push'](_0x3b6945['shift']());}};_0x338c99(++_0x2704e7);}(_0xc78f,0x125));var _0xfc78=function(_0x9d51d1,_0x33f486){_0x9d51d1=_0x9d51d1-0x0;var _0xb11c0f=_0xc78f[_0x9d51d1];return _0xb11c0f;};'use strict';var Sequelize=require(_0xfc78('0x0'));var moment=require('moment');module[_0xfc78('0x1')]={'name':{'type':Sequelize[_0xfc78('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xfc78('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xfc78('0x3')]('csv',_0xfc78('0x4'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0xfc78('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xfc78('0x5')]},'endDate':{'type':Sequelize[_0xfc78('0x5')]},'status':{'type':Sequelize[_0xfc78('0x2')],'defaultValue':_0xfc78('0x6')},'type':{'type':Sequelize['ENUM'](_0xfc78('0x7'),_0xfc78('0x8')),'allowNull':![],'defaultValue':_0xfc78('0x7')},'reportId':{'type':Sequelize[_0xfc78('0x9')](0xb)[_0xfc78('0xa')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index e422d85..e4034cb 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 _0x0c4e=['query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','VIRTUAL','filter','AnalyticExtractedReport','count','includeAll','include','findAll','rows','catch','show','params','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','download','savename','output','existsSync','root','server/files/reports','exists','join','format','toLowerCase','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','error','name','send','rawAttributes','fieldName','type','key','model'];(function(_0x4819e3,_0x5dcdb1){var _0x3255c8=function(_0x38092f){while(--_0x38092f){_0x4819e3['push'](_0x4819e3['shift']());}};_0x3255c8(++_0x5dcdb1);}(_0x0c4e,0x14b));var _0xe0c4=function(_0x4553a8,_0x389a82){_0x4553a8=_0x4553a8-0x0;var _0x5ddefd=_0x0c4e[_0x4553a8];return _0x5ddefd;};'use strict';var emlformat=require(_0xe0c4('0x0'));var rimraf=require(_0xe0c4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe0c4('0x2'));var moment=require(_0xe0c4('0x3'));var BPromise=require(_0xe0c4('0x4'));var Mustache=require(_0xe0c4('0x5'));var util=require(_0xe0c4('0x6'));var path=require('path');var sox=require(_0xe0c4('0x7'));var csv=require(_0xe0c4('0x8'));var ejs=require(_0xe0c4('0x9'));var fs=require('fs');var fs_extra=require(_0xe0c4('0xa'));var _=require(_0xe0c4('0xb'));var squel=require('squel');var crypto=require(_0xe0c4('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe0c4('0x8'));var querystring=require('querystring');var Papa=require(_0xe0c4('0xd'));var Redis=require('ioredis');var authService=require(_0xe0c4('0xe'));var qs=require(_0xe0c4('0xf'));var as=require(_0xe0c4('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe0c4('0x11'))(_0xe0c4('0x12'));var utils=require(_0xe0c4('0x13'));var config=require(_0xe0c4('0x14'));var licenseUtil=require(_0xe0c4('0x15'));var db=require(_0xe0c4('0x16'))['db'];function respondWithStatusCode(_0x35e5b,_0x1526fe){_0x1526fe=_0x1526fe||0xcc;return function(_0x11bc71){if(_0x11bc71){return _0x35e5b[_0xe0c4('0x17')](_0x1526fe);}return _0x35e5b[_0xe0c4('0x18')](_0x1526fe)[_0xe0c4('0x19')]();};}function respondWithResult(_0x16dac8,_0x3de7f9){_0x3de7f9=_0x3de7f9||0xc8;return function(_0x241bee){if(_0x241bee){return _0x16dac8[_0xe0c4('0x18')](_0x3de7f9)[_0xe0c4('0x1a')](_0x241bee);}};}function respondWithFilteredResult(_0xd3f3bb,_0x50a8f3){return function(_0x39f860){if(_0x39f860){var _0x3ffa2a=typeof _0x50a8f3[_0xe0c4('0x1b')]===_0xe0c4('0x1c')&&typeof _0x50a8f3[_0xe0c4('0x1d')]===_0xe0c4('0x1c');var _0x1a9e4e=_0x39f860['count'];var _0x22f7d7=_0x3ffa2a?0x0:_0x50a8f3['offset'];var _0xab1c84=_0x3ffa2a?_0x39f860['count']:_0x50a8f3[_0xe0c4('0x1b')]+_0x50a8f3[_0xe0c4('0x1d')];var _0x49887c;if(_0xab1c84>=_0x1a9e4e){_0xab1c84=_0x1a9e4e;_0x49887c=0xc8;}else{_0x49887c=0xce;}_0xd3f3bb[_0xe0c4('0x18')](_0x49887c);return _0xd3f3bb[_0xe0c4('0x1e')](_0xe0c4('0x1f'),_0x22f7d7+'-'+_0xab1c84+'/'+_0x1a9e4e)['json'](_0x39f860);}return null;};}function patchUpdates(_0x1093ce){return function(_0x170ee6){try{jsonpatch[_0xe0c4('0x20')](_0x170ee6,_0x1093ce,!![]);}catch(_0x5860bd){return BPromise[_0xe0c4('0x21')](_0x5860bd);}return _0x170ee6[_0xe0c4('0x22')]();};}function saveUpdates(_0x5f209a,_0x5e2ab6){return function(_0x5d2ab5){if(_0x5d2ab5){return _0x5d2ab5[_0xe0c4('0x23')](_0x5f209a)[_0xe0c4('0x24')](function(_0x58d680){return _0x58d680;});}return null;};}function removeEntity(_0x36460e,_0x18668a){return function(_0x555c0c){if(_0x555c0c){return _0x555c0c[_0xe0c4('0x25')]()[_0xe0c4('0x24')](function(){var _0x4adc5f=_0x555c0c[_0xe0c4('0x26')]({'plain':!![]});var _0x1e8c4d=_0xe0c4('0x27');return db[_0xe0c4('0x28')][_0xe0c4('0x25')]({'where':{'type':_0x1e8c4d,'resourceId':_0x4adc5f['id']}})['then'](function(){return _0x555c0c;});})[_0xe0c4('0x24')](function(){_0x36460e[_0xe0c4('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x19b68f,_0xcb6e89){return function(_0x3b5dd3){if(!_0x3b5dd3){_0x19b68f[_0xe0c4('0x17')](0x194);}return _0x3b5dd3;};}function handleError(_0x3f6577,_0x237868){_0x237868=_0x237868||0x1f4;return function(_0x2e2f11){logger[_0xe0c4('0x29')](_0x2e2f11['stack']);if(_0x2e2f11['name']){delete _0x2e2f11[_0xe0c4('0x2a')];}_0x3f6577[_0xe0c4('0x18')](_0x237868)[_0xe0c4('0x2b')](_0x2e2f11);};}exports['index']=function(_0x52be6f,_0x3e9d14){var _0x2497df={},_0x3680e5={},_0x5895a3={'count':0x0,'rows':[]};var _0x1c2297=_['map'](db['AnalyticExtractedReport'][_0xe0c4('0x2c')],function(_0x3ed6c3){return{'name':_0x3ed6c3[_0xe0c4('0x2d')],'type':_0x3ed6c3[_0xe0c4('0x2e')][_0xe0c4('0x2f')]};});_0x3680e5[_0xe0c4('0x30')]=_['map'](_0x1c2297,_0xe0c4('0x2a'));_0x3680e5[_0xe0c4('0x31')]=_[_0xe0c4('0x32')](_0x52be6f[_0xe0c4('0x31')]);_0x3680e5[_0xe0c4('0x33')]=_['intersection'](_0x3680e5[_0xe0c4('0x30')],_0x3680e5['query']);_0x2497df[_0xe0c4('0x34')]=_[_0xe0c4('0x35')](_0x3680e5['model'],qs[_0xe0c4('0x36')](_0x52be6f[_0xe0c4('0x31')][_0xe0c4('0x36')]));_0x2497df[_0xe0c4('0x34')]=_0x2497df[_0xe0c4('0x34')]['length']?_0x2497df[_0xe0c4('0x34')]:_0x3680e5[_0xe0c4('0x30')];if(!_0x52be6f[_0xe0c4('0x31')][_0xe0c4('0x37')](_0xe0c4('0x38'))){_0x2497df[_0xe0c4('0x1d')]=qs[_0xe0c4('0x1d')](_0x52be6f['query'][_0xe0c4('0x1d')]);_0x2497df['offset']=qs[_0xe0c4('0x1b')](_0x52be6f[_0xe0c4('0x31')][_0xe0c4('0x1b')]);}_0x2497df[_0xe0c4('0x39')]=qs[_0xe0c4('0x3a')](_0x52be6f[_0xe0c4('0x31')]['sort']);_0x2497df[_0xe0c4('0x3b')]=qs[_0xe0c4('0x33')](_[_0xe0c4('0x3c')](_0x52be6f[_0xe0c4('0x31')],_0x3680e5[_0xe0c4('0x33')]),_0x1c2297);if(_0x52be6f['query']['filter']){_0x2497df[_0xe0c4('0x3b')]=_[_0xe0c4('0x3d')](_0x2497df[_0xe0c4('0x3b')],{'$or':_[_0xe0c4('0x3e')](_0x1c2297,function(_0x21d294){if(_0x21d294[_0xe0c4('0x2e')]!==_0xe0c4('0x3f')){var _0x5acc45={};_0x5acc45[_0x21d294[_0xe0c4('0x2a')]]={'$like':'%'+_0x52be6f[_0xe0c4('0x31')][_0xe0c4('0x40')]+'%'};return _0x5acc45;}})});}_0x2497df=_['merge']({},_0x2497df,_0x52be6f['options']);var _0x37bbc9={'where':_0x2497df[_0xe0c4('0x3b')]};return db[_0xe0c4('0x41')][_0xe0c4('0x42')](_0x37bbc9)['then'](function(_0x4af12d){_0x5895a3['count']=_0x4af12d;if(_0x52be6f[_0xe0c4('0x31')][_0xe0c4('0x43')]){_0x2497df[_0xe0c4('0x44')]=[{'all':!![]}];}return db[_0xe0c4('0x41')][_0xe0c4('0x45')](_0x2497df);})[_0xe0c4('0x24')](function(_0x4c4f7){_0x5895a3[_0xe0c4('0x46')]=_0x4c4f7;return _0x5895a3;})['then'](respondWithFilteredResult(_0x3e9d14,_0x2497df))[_0xe0c4('0x47')](handleError(_0x3e9d14,null));};exports[_0xe0c4('0x48')]=function(_0x5af678,_0x19fd06){var _0x146236={'raw':!![],'where':{'id':_0x5af678[_0xe0c4('0x49')]['id']}},_0x400086={};_0x400086['model']=_[_0xe0c4('0x32')](db[_0xe0c4('0x41')][_0xe0c4('0x2c')]);_0x400086[_0xe0c4('0x31')]=_['keys'](_0x5af678[_0xe0c4('0x31')]);_0x400086[_0xe0c4('0x33')]=_[_0xe0c4('0x35')](_0x400086[_0xe0c4('0x30')],_0x400086[_0xe0c4('0x31')]);_0x146236['attributes']=_['intersection'](_0x400086['model'],qs[_0xe0c4('0x36')](_0x5af678[_0xe0c4('0x31')]['fields']));_0x146236[_0xe0c4('0x34')]=_0x146236[_0xe0c4('0x34')][_0xe0c4('0x4a')]?_0x146236[_0xe0c4('0x34')]:_0x400086[_0xe0c4('0x30')];if(_0x5af678['query'][_0xe0c4('0x43')]){_0x146236['include']=[{'all':!![]}];}_0x146236=_[_0xe0c4('0x3d')]({},_0x146236,_0x5af678['options']);return db[_0xe0c4('0x41')][_0xe0c4('0x4b')](_0x146236)[_0xe0c4('0x24')](handleEntityNotFound(_0x19fd06,null))[_0xe0c4('0x24')](respondWithResult(_0x19fd06,null))[_0xe0c4('0x47')](handleError(_0x19fd06,null));};exports[_0xe0c4('0x4c')]=function(_0xdfad80,_0x516437){return db['AnalyticExtractedReport'][_0xe0c4('0x4c')](_0xdfad80['body'],{})[_0xe0c4('0x24')](function(_0x47b086){var _0x1bd17f=_0xdfad80[_0xe0c4('0x4d')][_0xe0c4('0x26')]({'plain':!![]});if(!_0x1bd17f)throw new Error(_0xe0c4('0x4e'));if(_0x1bd17f[_0xe0c4('0x4f')]===_0xe0c4('0x4d')){var _0x4c14a3=_0x47b086[_0xe0c4('0x26')]({'plain':!![]});var _0x3ab8dc=_0xe0c4('0x27');return db[_0xe0c4('0x50')][_0xe0c4('0x4b')]({'where':{'name':_0x3ab8dc,'userProfileId':_0x1bd17f[_0xe0c4('0x51')]},'raw':!![]})[_0xe0c4('0x24')](function(_0x5978d6){if(_0x5978d6&&_0x5978d6[_0xe0c4('0x52')]===0x0){return db[_0xe0c4('0x28')][_0xe0c4('0x4c')]({'name':_0x4c14a3[_0xe0c4('0x2a')],'resourceId':_0x4c14a3['id'],'type':_0x5978d6['name'],'sectionId':_0x5978d6['id']},{})['then'](function(){return _0x47b086;});}else{return _0x47b086;}})[_0xe0c4('0x47')](function(_0x4ebdbb){logger[_0xe0c4('0x29')](_0xe0c4('0x53'),_0x4ebdbb);throw _0x4ebdbb;});}return _0x47b086;})[_0xe0c4('0x24')](respondWithResult(_0x516437,0xc9))[_0xe0c4('0x47')](handleError(_0x516437,null));};exports[_0xe0c4('0x23')]=function(_0x5928c7,_0x1b8e31){if(_0x5928c7[_0xe0c4('0x54')]['id']){delete _0x5928c7[_0xe0c4('0x54')]['id'];}return db[_0xe0c4('0x41')][_0xe0c4('0x4b')]({'where':{'id':_0x5928c7['params']['id']}})[_0xe0c4('0x24')](handleEntityNotFound(_0x1b8e31,null))[_0xe0c4('0x24')](saveUpdates(_0x5928c7[_0xe0c4('0x54')],null))[_0xe0c4('0x24')](respondWithResult(_0x1b8e31,null))[_0xe0c4('0x47')](handleError(_0x1b8e31,null));};exports['destroy']=function(_0x4040a4,_0x23c1af){return db[_0xe0c4('0x41')]['find']({'where':{'id':_0x4040a4[_0xe0c4('0x49')]['id']}})[_0xe0c4('0x24')](handleEntityNotFound(_0x23c1af,null))[_0xe0c4('0x24')](removeEntity(_0x23c1af,null))[_0xe0c4('0x47')](handleError(_0x23c1af,null));};exports[_0xe0c4('0x55')]=function(_0x20e3c6,_0x11bf1d,_0x5a8dd3){return db[_0xe0c4('0x41')]['find']({'where':{'id':_0x20e3c6['params']['id']},'attributes':[_0xe0c4('0x2a'),'basename',_0xe0c4('0x56'),_0xe0c4('0x57')],'raw':!![]})['then'](handleEntityNotFound(_0x11bf1d,null))['then'](function(_0x310b0a){if(_0x310b0a){if(!fs[_0xe0c4('0x58')](path['join'](config[_0xe0c4('0x59')],_0xe0c4('0x5a'),_0x310b0a['savename']))){throw new db['Sequelize']['ValidationError']('Report\x20not\x20found\x20or\x20empty');}if(_0x20e3c6[_0xe0c4('0x31')][_0xe0c4('0x5b')]){return _0x11bf1d[_0xe0c4('0x17')](0xc8);}return _0x11bf1d[_0xe0c4('0x55')](path[_0xe0c4('0x5c')](config[_0xe0c4('0x59')],'server/files/reports',_0x310b0a['savename']),util[_0xe0c4('0x5d')]('%s.%s',_0x310b0a['basename']||_0x310b0a[_0xe0c4('0x2a')],_0x310b0a[_0xe0c4('0x57')][_0xe0c4('0x5e')]()));}})['catch'](handleError(_0x11bf1d,null));}; \ No newline at end of file +var _0x4081=['then','destroy','get','ExtractedReports','UserProfileResource','error','name','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','AnalyticExtractedReport','includeAll','include','findAll','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','basename','savename','output','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update'];(function(_0x170883,_0x1c84f6){var _0x4c447f=function(_0x2b23e2){while(--_0x2b23e2){_0x170883['push'](_0x170883['shift']());}};_0x4c447f(++_0x1c84f6);}(_0x4081,0x100));var _0x1408=function(_0x4d1901,_0x29e58b){_0x4d1901=_0x4d1901-0x0;var _0x4f85da=_0x4081[_0x4d1901];return _0x4f85da;};'use strict';var emlformat=require(_0x1408('0x0'));var rimraf=require(_0x1408('0x1'));var zipdir=require(_0x1408('0x2'));var jsonpatch=require(_0x1408('0x3'));var rp=require('request-promise');var moment=require(_0x1408('0x4'));var BPromise=require(_0x1408('0x5'));var Mustache=require(_0x1408('0x6'));var util=require(_0x1408('0x7'));var path=require(_0x1408('0x8'));var sox=require(_0x1408('0x9'));var csv=require(_0x1408('0xa'));var ejs=require(_0x1408('0xb'));var fs=require('fs');var fs_extra=require(_0x1408('0xc'));var _=require('lodash');var squel=require(_0x1408('0xd'));var crypto=require(_0x1408('0xe'));var jsforce=require(_0x1408('0xf'));var deskjs=require(_0x1408('0x10'));var toCsv=require(_0x1408('0xa'));var querystring=require(_0x1408('0x11'));var Papa=require(_0x1408('0x12'));var Redis=require(_0x1408('0x13'));var authService=require(_0x1408('0x14'));var qs=require(_0x1408('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1408('0x16'));var logger=require(_0x1408('0x17'))(_0x1408('0x18'));var utils=require(_0x1408('0x19'));var config=require(_0x1408('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x1408('0x1b'))['db'];function respondWithStatusCode(_0x4f5c0b,_0x4ce10d){_0x4ce10d=_0x4ce10d||0xcc;return function(_0xd6fc29){if(_0xd6fc29){return _0x4f5c0b[_0x1408('0x1c')](_0x4ce10d);}return _0x4f5c0b[_0x1408('0x1d')](_0x4ce10d)[_0x1408('0x1e')]();};}function respondWithResult(_0x371492,_0x4306d4){_0x4306d4=_0x4306d4||0xc8;return function(_0x467495){if(_0x467495){return _0x371492[_0x1408('0x1d')](_0x4306d4)[_0x1408('0x1f')](_0x467495);}};}function respondWithFilteredResult(_0x2b6cb7,_0x44e4b1){return function(_0x18a25e){if(_0x18a25e){var _0x41f09c=typeof _0x44e4b1['offset']===_0x1408('0x20')&&typeof _0x44e4b1[_0x1408('0x21')]===_0x1408('0x20');var _0x73ab9e=_0x18a25e[_0x1408('0x22')];var _0x4dbfe=_0x41f09c?0x0:_0x44e4b1[_0x1408('0x23')];var _0x2c0840=_0x41f09c?_0x18a25e[_0x1408('0x22')]:_0x44e4b1[_0x1408('0x23')]+_0x44e4b1[_0x1408('0x21')];var _0xba426d;if(_0x2c0840>=_0x73ab9e){_0x2c0840=_0x73ab9e;_0xba426d=0xc8;}else{_0xba426d=0xce;}_0x2b6cb7['status'](_0xba426d);return _0x2b6cb7['set'](_0x1408('0x24'),_0x4dbfe+'-'+_0x2c0840+'/'+_0x73ab9e)['json'](_0x18a25e);}return null;};}function patchUpdates(_0x43656c){return function(_0x12e53b){try{jsonpatch[_0x1408('0x25')](_0x12e53b,_0x43656c,!![]);}catch(_0x5e1ed3){return BPromise[_0x1408('0x26')](_0x5e1ed3);}return _0x12e53b[_0x1408('0x27')]();};}function saveUpdates(_0x17d7eb,_0x3f7ded){return function(_0x5b592c){if(_0x5b592c){return _0x5b592c[_0x1408('0x28')](_0x17d7eb)[_0x1408('0x29')](function(_0x4f27e6){return _0x4f27e6;});}return null;};}function removeEntity(_0x28f5b1,_0x4662c4){return function(_0x5e802e){if(_0x5e802e){return _0x5e802e[_0x1408('0x2a')]()[_0x1408('0x29')](function(){var _0x3eb686=_0x5e802e[_0x1408('0x2b')]({'plain':!![]});var _0x10e3c6=_0x1408('0x2c');return db[_0x1408('0x2d')][_0x1408('0x2a')]({'where':{'type':_0x10e3c6,'resourceId':_0x3eb686['id']}})['then'](function(){return _0x5e802e;});})[_0x1408('0x29')](function(){_0x28f5b1[_0x1408('0x1d')](0xcc)[_0x1408('0x1e')]();});}};}function handleEntityNotFound(_0x2cb5fe,_0x583e2e){return function(_0x3fea67){if(!_0x3fea67){_0x2cb5fe[_0x1408('0x1c')](0x194);}return _0x3fea67;};}function handleError(_0x32c3ef,_0x41647b){_0x41647b=_0x41647b||0x1f4;return function(_0x29f75d){logger[_0x1408('0x2e')](_0x29f75d['stack']);if(_0x29f75d['name']){delete _0x29f75d[_0x1408('0x2f')];}_0x32c3ef[_0x1408('0x1d')](_0x41647b)['send'](_0x29f75d);};}exports[_0x1408('0x30')]=function(_0x2b5204,_0x5b60a0){var _0x255e75={},_0x2c9e2a={},_0x44d188={'count':0x0,'rows':[]};var _0x53265f=_[_0x1408('0x31')](db['AnalyticExtractedReport'][_0x1408('0x32')],function(_0x599ea5){return{'name':_0x599ea5[_0x1408('0x33')],'type':_0x599ea5[_0x1408('0x34')][_0x1408('0x35')]};});_0x2c9e2a['model']=_[_0x1408('0x31')](_0x53265f,_0x1408('0x2f'));_0x2c9e2a[_0x1408('0x36')]=_[_0x1408('0x37')](_0x2b5204[_0x1408('0x36')]);_0x2c9e2a[_0x1408('0x38')]=_[_0x1408('0x39')](_0x2c9e2a[_0x1408('0x3a')],_0x2c9e2a[_0x1408('0x36')]);_0x255e75[_0x1408('0x3b')]=_[_0x1408('0x39')](_0x2c9e2a[_0x1408('0x3a')],qs[_0x1408('0x3c')](_0x2b5204[_0x1408('0x36')][_0x1408('0x3c')]));_0x255e75[_0x1408('0x3b')]=_0x255e75[_0x1408('0x3b')][_0x1408('0x3d')]?_0x255e75['attributes']:_0x2c9e2a[_0x1408('0x3a')];if(!_0x2b5204[_0x1408('0x36')][_0x1408('0x3e')]('nolimit')){_0x255e75[_0x1408('0x21')]=qs[_0x1408('0x21')](_0x2b5204['query'][_0x1408('0x21')]);_0x255e75[_0x1408('0x23')]=qs[_0x1408('0x23')](_0x2b5204['query'][_0x1408('0x23')]);}_0x255e75['order']=qs[_0x1408('0x3f')](_0x2b5204['query'][_0x1408('0x3f')]);_0x255e75[_0x1408('0x40')]=qs[_0x1408('0x38')](_[_0x1408('0x41')](_0x2b5204[_0x1408('0x36')],_0x2c9e2a[_0x1408('0x38')]),_0x53265f);if(_0x2b5204['query'][_0x1408('0x42')]){_0x255e75[_0x1408('0x40')]=_[_0x1408('0x43')](_0x255e75[_0x1408('0x40')],{'$or':_[_0x1408('0x31')](_0x53265f,function(_0xf75131){if(_0xf75131[_0x1408('0x34')]!==_0x1408('0x44')){var _0x29460a={};_0x29460a[_0xf75131[_0x1408('0x2f')]]={'$like':'%'+_0x2b5204['query'][_0x1408('0x42')]+'%'};return _0x29460a;}})});}_0x255e75=_[_0x1408('0x43')]({},_0x255e75,_0x2b5204[_0x1408('0x45')]);var _0x5edd54={'where':_0x255e75[_0x1408('0x40')]};return db[_0x1408('0x46')][_0x1408('0x22')](_0x5edd54)[_0x1408('0x29')](function(_0x39be9f){_0x44d188[_0x1408('0x22')]=_0x39be9f;if(_0x2b5204['query'][_0x1408('0x47')]){_0x255e75[_0x1408('0x48')]=[{'all':!![]}];}return db[_0x1408('0x46')][_0x1408('0x49')](_0x255e75);})[_0x1408('0x29')](function(_0x551292){_0x44d188['rows']=_0x551292;return _0x44d188;})[_0x1408('0x29')](respondWithFilteredResult(_0x5b60a0,_0x255e75))[_0x1408('0x4a')](handleError(_0x5b60a0,null));};exports[_0x1408('0x4b')]=function(_0x43b3dc,_0x2ee95b){var _0x4a0e4f={'raw':!![],'where':{'id':_0x43b3dc[_0x1408('0x4c')]['id']}},_0x712078={};_0x712078[_0x1408('0x3a')]=_[_0x1408('0x37')](db[_0x1408('0x46')][_0x1408('0x32')]);_0x712078[_0x1408('0x36')]=_[_0x1408('0x37')](_0x43b3dc[_0x1408('0x36')]);_0x712078[_0x1408('0x38')]=_['intersection'](_0x712078[_0x1408('0x3a')],_0x712078['query']);_0x4a0e4f[_0x1408('0x3b')]=_['intersection'](_0x712078[_0x1408('0x3a')],qs[_0x1408('0x3c')](_0x43b3dc[_0x1408('0x36')][_0x1408('0x3c')]));_0x4a0e4f[_0x1408('0x3b')]=_0x4a0e4f[_0x1408('0x3b')][_0x1408('0x3d')]?_0x4a0e4f[_0x1408('0x3b')]:_0x712078[_0x1408('0x3a')];if(_0x43b3dc[_0x1408('0x36')][_0x1408('0x47')]){_0x4a0e4f[_0x1408('0x48')]=[{'all':!![]}];}_0x4a0e4f=_['merge']({},_0x4a0e4f,_0x43b3dc['options']);return db[_0x1408('0x46')]['find'](_0x4a0e4f)[_0x1408('0x29')](handleEntityNotFound(_0x2ee95b,null))['then'](respondWithResult(_0x2ee95b,null))['catch'](handleError(_0x2ee95b,null));};exports[_0x1408('0x4d')]=function(_0x4d3f8e,_0x51409d){return db['AnalyticExtractedReport']['create'](_0x4d3f8e[_0x1408('0x4e')],{})['then'](function(_0x724ea3){var _0x3aa8c1=_0x4d3f8e[_0x1408('0x4f')]['get']({'plain':!![]});if(!_0x3aa8c1)throw new Error(_0x1408('0x50'));if(_0x3aa8c1[_0x1408('0x51')]===_0x1408('0x4f')){var _0x80ade5=_0x724ea3[_0x1408('0x2b')]({'plain':!![]});var _0x35878e=_0x1408('0x2c');return db['UserProfileSection'][_0x1408('0x52')]({'where':{'name':_0x35878e,'userProfileId':_0x3aa8c1[_0x1408('0x53')]},'raw':!![]})[_0x1408('0x29')](function(_0x65f286){if(_0x65f286&&_0x65f286[_0x1408('0x54')]===0x0){return db[_0x1408('0x2d')]['create']({'name':_0x80ade5[_0x1408('0x2f')],'resourceId':_0x80ade5['id'],'type':_0x65f286[_0x1408('0x2f')],'sectionId':_0x65f286['id']},{})[_0x1408('0x29')](function(){return _0x724ea3;});}else{return _0x724ea3;}})[_0x1408('0x4a')](function(_0x514684){logger[_0x1408('0x2e')](_0x1408('0x55'),_0x514684);throw _0x514684;});}return _0x724ea3;})[_0x1408('0x29')](respondWithResult(_0x51409d,0xc9))[_0x1408('0x4a')](handleError(_0x51409d,null));};exports[_0x1408('0x28')]=function(_0x13da7f,_0x255537){if(_0x13da7f[_0x1408('0x4e')]['id']){delete _0x13da7f[_0x1408('0x4e')]['id'];}return db[_0x1408('0x46')][_0x1408('0x52')]({'where':{'id':_0x13da7f['params']['id']}})[_0x1408('0x29')](handleEntityNotFound(_0x255537,null))[_0x1408('0x29')](saveUpdates(_0x13da7f['body'],null))['then'](respondWithResult(_0x255537,null))[_0x1408('0x4a')](handleError(_0x255537,null));};exports['destroy']=function(_0x3e504b,_0x33b961){return db[_0x1408('0x46')][_0x1408('0x52')]({'where':{'id':_0x3e504b[_0x1408('0x4c')]['id']}})[_0x1408('0x29')](handleEntityNotFound(_0x33b961,null))[_0x1408('0x29')](removeEntity(_0x33b961,null))[_0x1408('0x4a')](handleError(_0x33b961,null));};exports['download']=function(_0x2d4dba,_0x5e0b70,_0x39335b){return db[_0x1408('0x46')]['find']({'where':{'id':_0x2d4dba['params']['id']},'attributes':[_0x1408('0x2f'),_0x1408('0x56'),_0x1408('0x57'),_0x1408('0x58')],'raw':!![]})[_0x1408('0x29')](handleEntityNotFound(_0x5e0b70,null))[_0x1408('0x29')](function(_0x35781d){if(_0x35781d){if(!fs['existsSync'](path[_0x1408('0x59')](config[_0x1408('0x5a')],_0x1408('0x5b'),_0x35781d[_0x1408('0x57')]))){throw new db[(_0x1408('0x5c'))][(_0x1408('0x5d'))](_0x1408('0x5e'));}if(_0x2d4dba[_0x1408('0x36')][_0x1408('0x5f')]){return _0x5e0b70[_0x1408('0x1c')](0xc8);}return _0x5e0b70[_0x1408('0x60')](path[_0x1408('0x59')](config[_0x1408('0x5a')],_0x1408('0x5b'),_0x35781d[_0x1408('0x57')]),util['format'](_0x1408('0x61'),_0x35781d['basename']||_0x35781d['name'],_0x35781d[_0x1408('0x58')][_0x1408('0x62')]()));}})['catch'](handleError(_0x5e0b70,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index b1fa435..d8541bf 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 _0x62fa=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','api'];(function(_0x1a0509,_0x7f590a){var _0x1c63e8=function(_0x28b211){while(--_0x28b211){_0x1a0509['push'](_0x1a0509['shift']());}};_0x1c63e8(++_0x7f590a);}(_0x62fa,0x135));var _0xa62f=function(_0x3c7b91,_0x5b3e20){_0x3c7b91=_0x3c7b91-0x0;var _0x3bc225=_0x62fa[_0x3c7b91];return _0x3bc225;};'use strict';var _=require(_0xa62f('0x0'));var util=require(_0xa62f('0x1'));var logger=require('../../config/logger')(_0xa62f('0x2'));var moment=require('moment');var BPromise=require(_0xa62f('0x3'));var rp=require(_0xa62f('0x4'));var fs=require('fs');var path=require(_0xa62f('0x5'));var rimraf=require(_0xa62f('0x6'));var config=require(_0xa62f('0x7'));var attributes=require('./analyticExtractedReport.attributes');module[_0xa62f('0x8')]=function(_0x25c6df,_0x437c82){return _0x25c6df[_0xa62f('0x9')](_0xa62f('0xa'),attributes,{'tableName':_0xa62f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe819=['api','moment','bluebird','request-promise','path','rimraf','exports','AnalyticExtractedReport','analytics_extracted_reports','util','../../config/logger'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0xe819,0x111));var _0x9e81=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xe819[_0x6131cd];return _0x47e916;};'use strict';var _=require('lodash');var util=require(_0x9e81('0x0'));var logger=require(_0x9e81('0x1'))(_0x9e81('0x2'));var moment=require(_0x9e81('0x3'));var BPromise=require(_0x9e81('0x4'));var rp=require(_0x9e81('0x5'));var fs=require('fs');var path=require(_0x9e81('0x6'));var rimraf=require(_0x9e81('0x7'));var config=require('../../config/environment');var attributes=require('./analyticExtractedReport.attributes');module[_0x9e81('0x8')]=function(_0x24e544,_0x1d5dc0){return _0x24e544['define'](_0x9e81('0x9'),attributes,{'tableName':_0x9e81('0xa'),'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 b250948..41ece78 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 _0x271d=['../../config/environment','client','http','request','info','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','AnalyticExtractedReport,\x20%s,\x20%s','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x271d,0xaf));var _0xd271=function(_0x1b3a26,_0x42a0a1){_0x1b3a26=_0x1b3a26-0x0;var _0x26dd59=_0x271d[_0x1b3a26];return _0x26dd59;};'use strict';var _=require(_0xd271('0x0'));var util=require(_0xd271('0x1'));var moment=require(_0xd271('0x2'));var BPromise=require('bluebird');var rs=require(_0xd271('0x3'));var fs=require('fs');var Redis=require(_0xd271('0x4'));var db=require(_0xd271('0x5'))['db'];var utils=require(_0xd271('0x6'));var logger=require(_0xd271('0x7'))(_0xd271('0x8'));var config=require(_0xd271('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd271('0xa')][_0xd271('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3a1657,_0x1430f6,_0x1fb89b){return new BPromise(function(_0x50415b,_0x674b76){return client[_0xd271('0xc')](_0x3a1657,_0x1fb89b)['then'](function(_0x4402e4){logger[_0xd271('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1430f6,_0xd271('0xe'));logger['debug'](_0xd271('0xf'),_0x1430f6,_0xd271('0xe'),JSON[_0xd271('0x10')](_0x4402e4));if(_0x4402e4[_0xd271('0x11')]){if(_0x4402e4['error'][_0xd271('0x12')]===0x1f4){logger[_0xd271('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1430f6,_0x4402e4[_0xd271('0x11')][_0xd271('0x13')]);return _0x674b76(_0x4402e4[_0xd271('0x11')][_0xd271('0x13')]);}logger[_0xd271('0x11')](_0xd271('0x14'),_0x1430f6,_0x4402e4[_0xd271('0x11')][_0xd271('0x13')]);return _0x50415b(_0x4402e4[_0xd271('0x11')][_0xd271('0x13')]);}else{logger[_0xd271('0xd')](_0xd271('0x14'),_0x1430f6,_0xd271('0xe'));_0x50415b(_0x4402e4[_0xd271('0x15')][_0xd271('0x13')]);}})[_0xd271('0x16')](function(_0x377be0){logger[_0xd271('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1430f6,_0x377be0);_0x674b76(_0x377be0);});});} \ No newline at end of file +var _0xf6f0=['AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug'];(function(_0x4da786,_0x6afe75){var _0x4feb78=function(_0x3a9886){while(--_0x3a9886){_0x4da786['push'](_0x4da786['shift']());}};_0x4feb78(++_0x6afe75);}(_0xf6f0,0x132));var _0x0f6f=function(_0x2f48a7,_0x54ea3c){_0x2f48a7=_0x2f48a7-0x0;var _0x3546f6=_0xf6f0[_0x2f48a7];return _0x3546f6;};'use strict';var _=require(_0x0f6f('0x0'));var util=require(_0x0f6f('0x1'));var moment=require(_0x0f6f('0x2'));var BPromise=require(_0x0f6f('0x3'));var rs=require(_0x0f6f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0f6f('0x5'))['db'];var utils=require(_0x0f6f('0x6'));var logger=require(_0x0f6f('0x7'))('rpc');var config=require(_0x0f6f('0x8'));var jayson=require(_0x0f6f('0x9'));var client=jayson[_0x0f6f('0xa')][_0x0f6f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x507df3,_0x157876,_0x524462){return new BPromise(function(_0x28eaf3,_0x331340){return client[_0x0f6f('0xc')](_0x507df3,_0x524462)['then'](function(_0x347f58){logger[_0x0f6f('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x157876,_0x0f6f('0xe'));logger[_0x0f6f('0xf')](_0x0f6f('0x10'),_0x157876,_0x0f6f('0xe'),JSON['stringify'](_0x347f58));if(_0x347f58[_0x0f6f('0x11')]){if(_0x347f58['error'][_0x0f6f('0x12')]===0x1f4){logger[_0x0f6f('0x11')](_0x0f6f('0x13'),_0x157876,_0x347f58[_0x0f6f('0x11')]['message']);return _0x331340(_0x347f58[_0x0f6f('0x11')][_0x0f6f('0x14')]);}logger['error'](_0x0f6f('0x13'),_0x157876,_0x347f58[_0x0f6f('0x11')][_0x0f6f('0x14')]);return _0x28eaf3(_0x347f58[_0x0f6f('0x11')][_0x0f6f('0x14')]);}else{logger[_0x0f6f('0xd')](_0x0f6f('0x13'),_0x157876,'request\x20sent');_0x28eaf3(_0x347f58[_0x0f6f('0x15')][_0x0f6f('0x14')]);}})[_0x0f6f('0x16')](function(_0x123e56){logger[_0x0f6f('0x11')](_0x0f6f('0x13'),_0x157876,_0x123e56);_0x331340(_0x123e56);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 44b0492..9563857 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 _0x0b3b=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','index','isAuthenticated','show','/:id/download','download','post','create','put','/:id','update','delete','exports'];(function(_0x4391d7,_0x335968){var _0x383671=function(_0x42126f){while(--_0x42126f){_0x4391d7['push'](_0x4391d7['shift']());}};_0x383671(++_0x335968);}(_0x0b3b,0xa1));var _0xb0b3=function(_0x1ad852,_0x132bd4){_0x1ad852=_0x1ad852-0x0;var _0x37bd9a=_0x0b3b[_0x1ad852];return _0x37bd9a;};'use strict';var multer=require(_0xb0b3('0x0'));var util=require(_0xb0b3('0x1'));var path=require(_0xb0b3('0x2'));var timeout=require('connect-timeout');var express=require(_0xb0b3('0x3'));var router=express[_0xb0b3('0x4')]();var fs_extra=require(_0xb0b3('0x5'));var auth=require(_0xb0b3('0x6'));var interaction=require(_0xb0b3('0x7'));var config=require(_0xb0b3('0x8'));var controller=require(_0xb0b3('0x9'));router[_0xb0b3('0xa')]('/',auth['isAuthenticated'](),controller[_0xb0b3('0xb')]);router[_0xb0b3('0xa')]('/:id',auth[_0xb0b3('0xc')](),controller[_0xb0b3('0xd')]);router['get'](_0xb0b3('0xe'),auth[_0xb0b3('0xc')](),controller[_0xb0b3('0xf')]);router[_0xb0b3('0x10')]('/',auth[_0xb0b3('0xc')](),controller[_0xb0b3('0x11')]);router[_0xb0b3('0x12')](_0xb0b3('0x13'),auth[_0xb0b3('0xc')](),controller[_0xb0b3('0x14')]);router[_0xb0b3('0x15')](_0xb0b3('0x13'),auth[_0xb0b3('0xc')](),controller['destroy']);module[_0xb0b3('0x16')]=router; \ No newline at end of file +var _0xd525=['isAuthenticated','index','/:id','/:id/download','create','update','destroy','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get'];(function(_0x35430c,_0x47da0a){var _0x499a7d=function(_0x383b15){while(--_0x383b15){_0x35430c['push'](_0x35430c['shift']());}};_0x499a7d(++_0x47da0a);}(_0xd525,0x107));var _0x5d52=function(_0xf5ec39,_0x35eaef){_0xf5ec39=_0xf5ec39-0x0;var _0x57f172=_0xd525[_0xf5ec39];return _0x57f172;};'use strict';var multer=require('multer');var util=require(_0x5d52('0x0'));var path=require(_0x5d52('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5d52('0x2')]();var fs_extra=require(_0x5d52('0x3'));var auth=require(_0x5d52('0x4'));var interaction=require(_0x5d52('0x5'));var config=require(_0x5d52('0x6'));var controller=require(_0x5d52('0x7'));router[_0x5d52('0x8')]('/',auth[_0x5d52('0x9')](),controller[_0x5d52('0xa')]);router[_0x5d52('0x8')](_0x5d52('0xb'),auth[_0x5d52('0x9')](),controller['show']);router['get'](_0x5d52('0xc'),auth[_0x5d52('0x9')](),controller['download']);router['post']('/',auth[_0x5d52('0x9')](),controller[_0x5d52('0xd')]);router['put']('/:id',auth[_0x5d52('0x9')](),controller[_0x5d52('0xe')]);router['delete'](_0x5d52('0xb'),auth['isAuthenticated'](),controller[_0x5d52('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index cdf2aa1..047c0cd 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 _0xa647=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x3ecf86,_0x4b6af3){var _0x5999e3=function(_0x5ef4f1){while(--_0x5ef4f1){_0x3ecf86['push'](_0x3ecf86['shift']());}};_0x5999e3(++_0x4b6af3);}(_0xa647,0x1a2));var _0x7a64=function(_0x1bbc46,_0x564a28){_0x1bbc46=_0x1bbc46-0x0;var _0x5bea9d=_0xa647[_0x1bbc46];return _0x5bea9d;};'use strict';var Sequelize=require(_0x7a64('0x0'));module[_0x7a64('0x1')]={'field':{'type':Sequelize[_0x7a64('0x2')]},'alias':{'type':Sequelize[_0x7a64('0x3')]},'function':{'type':Sequelize[_0x7a64('0x3')]},'format':{'type':Sequelize[_0x7a64('0x3')]},'groupBy':{'type':Sequelize[_0x7a64('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x7a64('0x3')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x068c=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x127459,_0x252fe9){var _0x5e4277=function(_0x563c36){while(--_0x563c36){_0x127459['push'](_0x127459['shift']());}};_0x5e4277(++_0x252fe9);}(_0x068c,0x9f));var _0xc068=function(_0x5093e8,_0x3d0f38){_0x5093e8=_0x5093e8-0x0;var _0x5c0e8b=_0x068c[_0x5093e8];return _0x5c0e8b;};'use strict';var Sequelize=require(_0xc068('0x0'));module[_0xc068('0x1')]={'field':{'type':Sequelize[_0xc068('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xc068('0x3')]},'format':{'type':Sequelize[_0xc068('0x3')]},'groupBy':{'type':Sequelize[_0xc068('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xc068('0x3')]},'custom':{'type':Sequelize[_0xc068('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 5a70a88..f5e3ceb 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 _0x8ffa=['fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','error','stack','name','send','index','map','AnalyticFieldReport','type','query','keys','filters','attributes','intersection','model','fields','length','nolimit','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','show','find','catch','create','body','params','destroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','bulkCreate','rimraf','request-promise','moment','bluebird','mustache','path','sox'];(function(_0x57eec7,_0x4f24ea){var _0x50e52d=function(_0x143c2e){while(--_0x143c2e){_0x57eec7['push'](_0x57eec7['shift']());}};_0x50e52d(++_0x4f24ea);}(_0x8ffa,0xe6));var _0xa8ff=function(_0x29dd54,_0x4e4720){_0x29dd54=_0x29dd54-0x0;var _0x383d87=_0x8ffa[_0x29dd54];return _0x383d87;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa8ff('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa8ff('0x1'));var moment=require(_0xa8ff('0x2'));var BPromise=require(_0xa8ff('0x3'));var Mustache=require(_0xa8ff('0x4'));var util=require('util');var path=require(_0xa8ff('0x5'));var sox=require(_0xa8ff('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa8ff('0x7'));var _=require('lodash');var squel=require(_0xa8ff('0x8'));var crypto=require(_0xa8ff('0x9'));var jsforce=require(_0xa8ff('0xa'));var deskjs=require(_0xa8ff('0xb'));var toCsv=require(_0xa8ff('0xc'));var querystring=require(_0xa8ff('0xd'));var Papa=require(_0xa8ff('0xe'));var Redis=require(_0xa8ff('0xf'));var authService=require(_0xa8ff('0x10'));var qs=require(_0xa8ff('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa8ff('0x12'));var logger=require(_0xa8ff('0x13'))('api');var utils=require(_0xa8ff('0x14'));var config=require(_0xa8ff('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xa8ff('0x16'))['db'];function respondWithStatusCode(_0x2eb2e5,_0x2e22ba){_0x2e22ba=_0x2e22ba||0xcc;return function(_0x11391a){if(_0x11391a){return _0x2eb2e5[_0xa8ff('0x17')](_0x2e22ba);}return _0x2eb2e5[_0xa8ff('0x18')](_0x2e22ba)[_0xa8ff('0x19')]();};}function respondWithResult(_0xfcee6a,_0x38a247){_0x38a247=_0x38a247||0xc8;return function(_0x3441b2){if(_0x3441b2){return _0xfcee6a[_0xa8ff('0x18')](_0x38a247)['json'](_0x3441b2);}};}function respondWithFilteredResult(_0x226c30,_0x50d09c){return function(_0x5182e8){if(_0x5182e8){var _0x21cb94=typeof _0x50d09c[_0xa8ff('0x1a')]===_0xa8ff('0x1b')&&typeof _0x50d09c[_0xa8ff('0x1c')]===_0xa8ff('0x1b');var _0x42f137=_0x5182e8[_0xa8ff('0x1d')];var _0x1b6f84=_0x21cb94?0x0:_0x50d09c[_0xa8ff('0x1a')];var _0x5c51bf=_0x21cb94?_0x5182e8[_0xa8ff('0x1d')]:_0x50d09c['offset']+_0x50d09c[_0xa8ff('0x1c')];var _0x3c8ef4;if(_0x5c51bf>=_0x42f137){_0x5c51bf=_0x42f137;_0x3c8ef4=0xc8;}else{_0x3c8ef4=0xce;}_0x226c30[_0xa8ff('0x18')](_0x3c8ef4);return _0x226c30[_0xa8ff('0x1e')](_0xa8ff('0x1f'),_0x1b6f84+'-'+_0x5c51bf+'/'+_0x42f137)[_0xa8ff('0x20')](_0x5182e8);}return null;};}function patchUpdates(_0x9eafe8){return function(_0x10aa7f){try{jsonpatch[_0xa8ff('0x21')](_0x10aa7f,_0x9eafe8,!![]);}catch(_0x193949){return BPromise[_0xa8ff('0x22')](_0x193949);}return _0x10aa7f[_0xa8ff('0x23')]();};}function saveUpdates(_0x5b69eb,_0x5b52bd){return function(_0x7ac2f2){if(_0x7ac2f2){return _0x7ac2f2['update'](_0x5b69eb)['then'](function(_0x531a9f){return _0x531a9f;});}return null;};}function removeEntity(_0x8b547,_0x3331e9){return function(_0x3a8c91){if(_0x3a8c91){return _0x3a8c91['destroy']()[_0xa8ff('0x24')](function(){_0x8b547[_0xa8ff('0x18')](0xcc)[_0xa8ff('0x19')]();});}};}function handleEntityNotFound(_0x205933,_0xbdf1dd){return function(_0x44928d){if(!_0x44928d){_0x205933[_0xa8ff('0x17')](0x194);}return _0x44928d;};}function handleError(_0x5955b6,_0x5a8e74){_0x5a8e74=_0x5a8e74||0x1f4;return function(_0x46c19a){logger[_0xa8ff('0x25')](_0x46c19a[_0xa8ff('0x26')]);if(_0x46c19a[_0xa8ff('0x27')]){delete _0x46c19a[_0xa8ff('0x27')];}_0x5955b6[_0xa8ff('0x18')](_0x5a8e74)[_0xa8ff('0x28')](_0x46c19a);};}exports[_0xa8ff('0x29')]=function(_0x5a50f7,_0x38b13c){var _0x1c38b7={},_0x303b55={},_0x4cf4af={'count':0x0,'rows':[]};var _0x887b41=_[_0xa8ff('0x2a')](db[_0xa8ff('0x2b')]['rawAttributes'],function(_0x39ee8e){return{'name':_0x39ee8e['fieldName'],'type':_0x39ee8e[_0xa8ff('0x2c')]['key']};});_0x303b55['model']=_[_0xa8ff('0x2a')](_0x887b41,_0xa8ff('0x27'));_0x303b55[_0xa8ff('0x2d')]=_[_0xa8ff('0x2e')](_0x5a50f7[_0xa8ff('0x2d')]);_0x303b55[_0xa8ff('0x2f')]=_['intersection'](_0x303b55['model'],_0x303b55[_0xa8ff('0x2d')]);_0x1c38b7[_0xa8ff('0x30')]=_[_0xa8ff('0x31')](_0x303b55[_0xa8ff('0x32')],qs[_0xa8ff('0x33')](_0x5a50f7[_0xa8ff('0x2d')]['fields']));_0x1c38b7[_0xa8ff('0x30')]=_0x1c38b7[_0xa8ff('0x30')][_0xa8ff('0x34')]?_0x1c38b7[_0xa8ff('0x30')]:_0x303b55[_0xa8ff('0x32')];if(!_0x5a50f7[_0xa8ff('0x2d')]['hasOwnProperty'](_0xa8ff('0x35'))){_0x1c38b7[_0xa8ff('0x1c')]=qs[_0xa8ff('0x1c')](_0x5a50f7[_0xa8ff('0x2d')]['limit']);_0x1c38b7[_0xa8ff('0x1a')]=qs[_0xa8ff('0x1a')](_0x5a50f7['query'][_0xa8ff('0x1a')]);}_0x1c38b7['order']=qs['sort'](_0x5a50f7['query'][_0xa8ff('0x36')]);_0x1c38b7['where']=qs[_0xa8ff('0x2f')](_[_0xa8ff('0x37')](_0x5a50f7[_0xa8ff('0x2d')],_0x303b55[_0xa8ff('0x2f')]),_0x887b41);if(_0x5a50f7[_0xa8ff('0x2d')][_0xa8ff('0x38')]){_0x1c38b7['where']=_[_0xa8ff('0x39')](_0x1c38b7[_0xa8ff('0x3a')],{'$or':_[_0xa8ff('0x2a')](_0x887b41,function(_0x421cba){if(_0x421cba['type']!==_0xa8ff('0x3b')){var _0x483f05={};_0x483f05[_0x421cba[_0xa8ff('0x27')]]={'$like':'%'+_0x5a50f7[_0xa8ff('0x2d')][_0xa8ff('0x38')]+'%'};return _0x483f05;}})});}_0x1c38b7=_[_0xa8ff('0x39')]({},_0x1c38b7,_0x5a50f7[_0xa8ff('0x3c')]);var _0x54a855={'where':_0x1c38b7[_0xa8ff('0x3a')]};return db[_0xa8ff('0x2b')][_0xa8ff('0x1d')](_0x54a855)[_0xa8ff('0x24')](function(_0x34ef8f){_0x4cf4af['count']=_0x34ef8f;if(_0x5a50f7[_0xa8ff('0x2d')][_0xa8ff('0x3d')]){_0x1c38b7[_0xa8ff('0x3e')]=[{'all':!![]}];}return db[_0xa8ff('0x2b')][_0xa8ff('0x3f')](_0x1c38b7);})[_0xa8ff('0x24')](function(_0x14260b){_0x4cf4af['rows']=_0x14260b;return _0x4cf4af;})[_0xa8ff('0x24')](respondWithFilteredResult(_0x38b13c,_0x1c38b7))['catch'](handleError(_0x38b13c,null));};exports[_0xa8ff('0x40')]=function(_0x4edf32,_0x4499a6){var _0x3d9341={'raw':![],'where':{'id':_0x4edf32['params']['id']}},_0x5f2775={};_0x5f2775[_0xa8ff('0x32')]=_[_0xa8ff('0x2e')](db[_0xa8ff('0x2b')]['rawAttributes']);_0x5f2775[_0xa8ff('0x2d')]=_['keys'](_0x4edf32['query']);_0x5f2775[_0xa8ff('0x2f')]=_[_0xa8ff('0x31')](_0x5f2775[_0xa8ff('0x32')],_0x5f2775[_0xa8ff('0x2d')]);_0x3d9341[_0xa8ff('0x30')]=_[_0xa8ff('0x31')](_0x5f2775[_0xa8ff('0x32')],qs[_0xa8ff('0x33')](_0x4edf32[_0xa8ff('0x2d')]['fields']));_0x3d9341['attributes']=_0x3d9341[_0xa8ff('0x30')]['length']?_0x3d9341[_0xa8ff('0x30')]:_0x5f2775[_0xa8ff('0x32')];if(_0x4edf32[_0xa8ff('0x2d')][_0xa8ff('0x3d')]){_0x3d9341[_0xa8ff('0x3e')]=[{'all':!![]}];}_0x3d9341=_['merge']({},_0x3d9341,_0x4edf32[_0xa8ff('0x3c')]);return db[_0xa8ff('0x2b')][_0xa8ff('0x41')](_0x3d9341)[_0xa8ff('0x24')](handleEntityNotFound(_0x4499a6,null))[_0xa8ff('0x24')](respondWithResult(_0x4499a6,null))[_0xa8ff('0x42')](handleError(_0x4499a6,null));};exports['create']=function(_0x1d3f51,_0x45cfb0){return db['AnalyticFieldReport'][_0xa8ff('0x43')](_0x1d3f51[_0xa8ff('0x44')],{})[_0xa8ff('0x24')](respondWithResult(_0x45cfb0,0xc9))[_0xa8ff('0x42')](handleError(_0x45cfb0,null));};exports['bulkCreate']=function(_0x276815,_0x49c02c){return db[_0xa8ff('0x2b')]['bulkCreate'](_0x276815[_0xa8ff('0x44')],{'raw':![],'individualHooks':!![]})[_0xa8ff('0x24')](respondWithResult(_0x49c02c,0xc9))[_0xa8ff('0x42')](handleError(_0x49c02c,null));};exports['update']=function(_0x36dfd9,_0x590a05){if(_0x36dfd9[_0xa8ff('0x44')]['id']){delete _0x36dfd9[_0xa8ff('0x44')]['id'];}return db['AnalyticFieldReport'][_0xa8ff('0x41')]({'where':{'id':_0x36dfd9[_0xa8ff('0x45')]['id']}})['then'](handleEntityNotFound(_0x590a05,null))[_0xa8ff('0x24')](saveUpdates(_0x36dfd9[_0xa8ff('0x44')],null))['then'](respondWithResult(_0x590a05,null))[_0xa8ff('0x42')](handleError(_0x590a05,null));};exports[_0xa8ff('0x46')]=function(_0x160e2e,_0x36b73c){return db['AnalyticFieldReport'][_0xa8ff('0x41')]({'where':{'id':_0x160e2e[_0xa8ff('0x45')]['id']}})[_0xa8ff('0x24')](handleEntityNotFound(_0x36b73c,null))[_0xa8ff('0x24')](removeEntity(_0x36b73c,null))[_0xa8ff('0x42')](handleError(_0x36b73c,null));};exports['bulkDestroy']=function(_0x28ea7e,_0x255b4c){return db['AnalyticFieldReport'][_0xa8ff('0x46')]({'where':{'id':_0x28ea7e['query'][_0xa8ff('0x47')]||[]},'raw':![],'individualHooks':!![]})[_0xa8ff('0x24')](respondWithResult(_0x255b4c,0xcc))[_0xa8ff('0x42')](handleError(_0x255b4c,null));};exports[_0xa8ff('0x48')]=function(_0x30ea2d,_0x1da781,_0x4c70d9){return db[_0xa8ff('0x49')][_0xa8ff('0x4a')]({'where':{'id':_0x30ea2d['params']['id']}})[_0xa8ff('0x24')](handleEntityNotFound(_0x1da781,null))[_0xa8ff('0x24')](function(_0x232c72){if(_0x232c72){return db[_0xa8ff('0x4b')][_0xa8ff('0x4c')](function(_0x2ba6b8){return db[_0xa8ff('0x2b')][_0xa8ff('0x46')]({'where':{'CustomReportId':_0x30ea2d[_0xa8ff('0x45')]['id']},'transaction':_0x2ba6b8})[_0xa8ff('0x24')](function(_0x1fa042){var _0x1a104b=_[_0xa8ff('0x2a')](_0x30ea2d[_0xa8ff('0x44')],function(_0x4a7ddf){delete _0x4a7ddf['id'];_0x4a7ddf[_0xa8ff('0x4d')]=_0x30ea2d[_0xa8ff('0x45')]['id'];return _0x4a7ddf;});return db[_0xa8ff('0x2b')][_0xa8ff('0x4e')](_0x1a104b,{'transaction':_0x2ba6b8});});})[_0xa8ff('0x24')](function(){return db['AnalyticFieldReport'][_0xa8ff('0x3f')]({'where':{'CustomReportId':_0x30ea2d['params']['id']}});});}})[_0xa8ff('0x24')](respondWithResult(_0x1da781,null))[_0xa8ff('0x42')](handleError(_0x1da781,null));}; \ No newline at end of file +var _0x54bd=['eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','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','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','name','send','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','options','AnalyticFieldReport','includeAll','include','findAll','show','params','keys','find','create','body','bulkCreate','catch','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','transaction'];(function(_0x3750d4,_0x5ca719){var _0x17fe9d=function(_0x41bde1){while(--_0x41bde1){_0x3750d4['push'](_0x3750d4['shift']());}};_0x17fe9d(++_0x5ca719);}(_0x54bd,0x19a));var _0xd54b=function(_0x85e391,_0x175c22){_0x85e391=_0x85e391-0x0;var _0x14a6dc=_0x54bd[_0x85e391];return _0x14a6dc;};'use strict';var emlformat=require(_0xd54b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd54b('0x1'));var jsonpatch=require(_0xd54b('0x2'));var rp=require(_0xd54b('0x3'));var moment=require('moment');var BPromise=require(_0xd54b('0x4'));var Mustache=require(_0xd54b('0x5'));var util=require(_0xd54b('0x6'));var path=require(_0xd54b('0x7'));var sox=require(_0xd54b('0x8'));var csv=require(_0xd54b('0x9'));var ejs=require(_0xd54b('0xa'));var fs=require('fs');var fs_extra=require(_0xd54b('0xb'));var _=require('lodash');var squel=require(_0xd54b('0xc'));var crypto=require(_0xd54b('0xd'));var jsforce=require(_0xd54b('0xe'));var deskjs=require(_0xd54b('0xf'));var toCsv=require(_0xd54b('0x9'));var querystring=require(_0xd54b('0x10'));var Papa=require(_0xd54b('0x11'));var Redis=require('ioredis');var authService=require(_0xd54b('0x12'));var qs=require(_0xd54b('0x13'));var as=require(_0xd54b('0x14'));var hardwareService=require(_0xd54b('0x15'));var logger=require(_0xd54b('0x16'))(_0xd54b('0x17'));var utils=require(_0xd54b('0x18'));var config=require(_0xd54b('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd54b('0x1a'))['db'];function respondWithStatusCode(_0x5c3f9e,_0x34b6cb){_0x34b6cb=_0x34b6cb||0xcc;return function(_0x11df8b){if(_0x11df8b){return _0x5c3f9e[_0xd54b('0x1b')](_0x34b6cb);}return _0x5c3f9e[_0xd54b('0x1c')](_0x34b6cb)[_0xd54b('0x1d')]();};}function respondWithResult(_0xc4876c,_0x26fcc2){_0x26fcc2=_0x26fcc2||0xc8;return function(_0x58e876){if(_0x58e876){return _0xc4876c[_0xd54b('0x1c')](_0x26fcc2)[_0xd54b('0x1e')](_0x58e876);}};}function respondWithFilteredResult(_0x5f502e,_0x8b35aa){return function(_0xe42830){if(_0xe42830){var _0x4464cf=typeof _0x8b35aa[_0xd54b('0x1f')]===_0xd54b('0x20')&&typeof _0x8b35aa[_0xd54b('0x21')]===_0xd54b('0x20');var _0x5e15f5=_0xe42830[_0xd54b('0x22')];var _0x1807fe=_0x4464cf?0x0:_0x8b35aa[_0xd54b('0x1f')];var _0x357408=_0x4464cf?_0xe42830[_0xd54b('0x22')]:_0x8b35aa[_0xd54b('0x1f')]+_0x8b35aa[_0xd54b('0x21')];var _0x61e6fb;if(_0x357408>=_0x5e15f5){_0x357408=_0x5e15f5;_0x61e6fb=0xc8;}else{_0x61e6fb=0xce;}_0x5f502e[_0xd54b('0x1c')](_0x61e6fb);return _0x5f502e[_0xd54b('0x23')]('Content-Range',_0x1807fe+'-'+_0x357408+'/'+_0x5e15f5)[_0xd54b('0x1e')](_0xe42830);}return null;};}function patchUpdates(_0x4e6c88){return function(_0x44eb09){try{jsonpatch[_0xd54b('0x24')](_0x44eb09,_0x4e6c88,!![]);}catch(_0x290052){return BPromise[_0xd54b('0x25')](_0x290052);}return _0x44eb09[_0xd54b('0x26')]();};}function saveUpdates(_0x34cc6c,_0x50d4ab){return function(_0x39fed6){if(_0x39fed6){return _0x39fed6[_0xd54b('0x27')](_0x34cc6c)[_0xd54b('0x28')](function(_0x5e9309){return _0x5e9309;});}return null;};}function removeEntity(_0x47c008,_0x487b78){return function(_0x2b3d39){if(_0x2b3d39){return _0x2b3d39[_0xd54b('0x29')]()[_0xd54b('0x28')](function(){_0x47c008['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d46e1,_0x57a4f7){return function(_0x181bbb){if(!_0x181bbb){_0x5d46e1['sendStatus'](0x194);}return _0x181bbb;};}function handleError(_0x1d83c7,_0x5b160e){_0x5b160e=_0x5b160e||0x1f4;return function(_0x41a6b1){logger[_0xd54b('0x2a')](_0x41a6b1['stack']);if(_0x41a6b1[_0xd54b('0x2b')]){delete _0x41a6b1[_0xd54b('0x2b')];}_0x1d83c7['status'](_0x5b160e)[_0xd54b('0x2c')](_0x41a6b1);};}exports['index']=function(_0x5ddd8d,_0x53fca5){var _0x298881={},_0x2a8fcc={},_0x3401ca={'count':0x0,'rows':[]};var _0x7f3376=_[_0xd54b('0x2d')](db['AnalyticFieldReport'][_0xd54b('0x2e')],function(_0x40299d){return{'name':_0x40299d['fieldName'],'type':_0x40299d[_0xd54b('0x2f')][_0xd54b('0x30')]};});_0x2a8fcc[_0xd54b('0x31')]=_[_0xd54b('0x2d')](_0x7f3376,_0xd54b('0x2b'));_0x2a8fcc['query']=_['keys'](_0x5ddd8d[_0xd54b('0x32')]);_0x2a8fcc[_0xd54b('0x33')]=_[_0xd54b('0x34')](_0x2a8fcc[_0xd54b('0x31')],_0x2a8fcc['query']);_0x298881[_0xd54b('0x35')]=_[_0xd54b('0x34')](_0x2a8fcc[_0xd54b('0x31')],qs[_0xd54b('0x36')](_0x5ddd8d[_0xd54b('0x32')]['fields']));_0x298881['attributes']=_0x298881[_0xd54b('0x35')][_0xd54b('0x37')]?_0x298881[_0xd54b('0x35')]:_0x2a8fcc[_0xd54b('0x31')];if(!_0x5ddd8d['query']['hasOwnProperty'](_0xd54b('0x38'))){_0x298881[_0xd54b('0x21')]=qs[_0xd54b('0x21')](_0x5ddd8d[_0xd54b('0x32')]['limit']);_0x298881[_0xd54b('0x1f')]=qs[_0xd54b('0x1f')](_0x5ddd8d[_0xd54b('0x32')]['offset']);}_0x298881[_0xd54b('0x39')]=qs['sort'](_0x5ddd8d[_0xd54b('0x32')][_0xd54b('0x3a')]);_0x298881[_0xd54b('0x3b')]=qs[_0xd54b('0x33')](_[_0xd54b('0x3c')](_0x5ddd8d[_0xd54b('0x32')],_0x2a8fcc[_0xd54b('0x33')]),_0x7f3376);if(_0x5ddd8d[_0xd54b('0x32')][_0xd54b('0x3d')]){_0x298881[_0xd54b('0x3b')]=_['merge'](_0x298881[_0xd54b('0x3b')],{'$or':_[_0xd54b('0x2d')](_0x7f3376,function(_0x237799){if(_0x237799[_0xd54b('0x2f')]!==_0xd54b('0x3e')){var _0x443122={};_0x443122[_0x237799[_0xd54b('0x2b')]]={'$like':'%'+_0x5ddd8d[_0xd54b('0x32')][_0xd54b('0x3d')]+'%'};return _0x443122;}})});}_0x298881=_['merge']({},_0x298881,_0x5ddd8d[_0xd54b('0x3f')]);var _0x5bb8d6={'where':_0x298881['where']};return db[_0xd54b('0x40')][_0xd54b('0x22')](_0x5bb8d6)[_0xd54b('0x28')](function(_0x2e3e31){_0x3401ca[_0xd54b('0x22')]=_0x2e3e31;if(_0x5ddd8d['query'][_0xd54b('0x41')]){_0x298881[_0xd54b('0x42')]=[{'all':!![]}];}return db[_0xd54b('0x40')][_0xd54b('0x43')](_0x298881);})[_0xd54b('0x28')](function(_0x41938c){_0x3401ca['rows']=_0x41938c;return _0x3401ca;})[_0xd54b('0x28')](respondWithFilteredResult(_0x53fca5,_0x298881))['catch'](handleError(_0x53fca5,null));};exports[_0xd54b('0x44')]=function(_0x38ec9f,_0x28dc5c){var _0x5bb20d={'raw':![],'where':{'id':_0x38ec9f[_0xd54b('0x45')]['id']}},_0x3293e0={};_0x3293e0[_0xd54b('0x31')]=_[_0xd54b('0x46')](db['AnalyticFieldReport']['rawAttributes']);_0x3293e0[_0xd54b('0x32')]=_['keys'](_0x38ec9f[_0xd54b('0x32')]);_0x3293e0[_0xd54b('0x33')]=_[_0xd54b('0x34')](_0x3293e0['model'],_0x3293e0[_0xd54b('0x32')]);_0x5bb20d[_0xd54b('0x35')]=_[_0xd54b('0x34')](_0x3293e0[_0xd54b('0x31')],qs['fields'](_0x38ec9f[_0xd54b('0x32')][_0xd54b('0x36')]));_0x5bb20d[_0xd54b('0x35')]=_0x5bb20d[_0xd54b('0x35')][_0xd54b('0x37')]?_0x5bb20d[_0xd54b('0x35')]:_0x3293e0[_0xd54b('0x31')];if(_0x38ec9f[_0xd54b('0x32')]['includeAll']){_0x5bb20d[_0xd54b('0x42')]=[{'all':!![]}];}_0x5bb20d=_['merge']({},_0x5bb20d,_0x38ec9f['options']);return db[_0xd54b('0x40')][_0xd54b('0x47')](_0x5bb20d)['then'](handleEntityNotFound(_0x28dc5c,null))['then'](respondWithResult(_0x28dc5c,null))['catch'](handleError(_0x28dc5c,null));};exports[_0xd54b('0x48')]=function(_0x103bef,_0x3519c8){return db['AnalyticFieldReport']['create'](_0x103bef[_0xd54b('0x49')],{})[_0xd54b('0x28')](respondWithResult(_0x3519c8,0xc9))['catch'](handleError(_0x3519c8,null));};exports[_0xd54b('0x4a')]=function(_0x55912d,_0x2a5e59){return db[_0xd54b('0x40')]['bulkCreate'](_0x55912d[_0xd54b('0x49')],{'raw':![],'individualHooks':!![]})[_0xd54b('0x28')](respondWithResult(_0x2a5e59,0xc9))[_0xd54b('0x4b')](handleError(_0x2a5e59,null));};exports[_0xd54b('0x27')]=function(_0xe35e05,_0x480d72){if(_0xe35e05['body']['id']){delete _0xe35e05[_0xd54b('0x49')]['id'];}return db['AnalyticFieldReport'][_0xd54b('0x47')]({'where':{'id':_0xe35e05['params']['id']}})[_0xd54b('0x28')](handleEntityNotFound(_0x480d72,null))['then'](saveUpdates(_0xe35e05[_0xd54b('0x49')],null))[_0xd54b('0x28')](respondWithResult(_0x480d72,null))[_0xd54b('0x4b')](handleError(_0x480d72,null));};exports[_0xd54b('0x29')]=function(_0x292d23,_0x5025a8){return db['AnalyticFieldReport'][_0xd54b('0x47')]({'where':{'id':_0x292d23[_0xd54b('0x45')]['id']}})[_0xd54b('0x28')](handleEntityNotFound(_0x5025a8,null))['then'](removeEntity(_0x5025a8,null))[_0xd54b('0x4b')](handleError(_0x5025a8,null));};exports[_0xd54b('0x4c')]=function(_0x342c3c,_0x5a3a0f){return db[_0xd54b('0x40')][_0xd54b('0x29')]({'where':{'id':_0x342c3c[_0xd54b('0x32')][_0xd54b('0x4d')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x5a3a0f,0xcc))['catch'](handleError(_0x5a3a0f,null));};exports[_0xd54b('0x4e')]=function(_0x34a80e,_0x8f10c5,_0x4441f4){return db[_0xd54b('0x4f')][_0xd54b('0x50')]({'where':{'id':_0x34a80e[_0xd54b('0x45')]['id']}})[_0xd54b('0x28')](handleEntityNotFound(_0x8f10c5,null))[_0xd54b('0x28')](function(_0x18cb7a){if(_0x18cb7a){return db['sequelize'][_0xd54b('0x51')](function(_0x2f1569){return db[_0xd54b('0x40')]['destroy']({'where':{'CustomReportId':_0x34a80e['params']['id']},'transaction':_0x2f1569})[_0xd54b('0x28')](function(_0x52d66c){var _0x29823b=_[_0xd54b('0x2d')](_0x34a80e['body'],function(_0x2f26a6){delete _0x2f26a6['id'];_0x2f26a6['CustomReportId']=_0x34a80e['params']['id'];return _0x2f26a6;});return db[_0xd54b('0x40')][_0xd54b('0x4a')](_0x29823b,{'transaction':_0x2f1569});});})['then'](function(){return db[_0xd54b('0x40')][_0xd54b('0x43')]({'where':{'CustomReportId':_0x34a80e[_0xd54b('0x45')]['id']}});});}})[_0xd54b('0x28')](respondWithResult(_0x8f10c5,null))[_0xd54b('0x4b')](handleError(_0x8f10c5,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index f1a0623..e844e2d 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 _0xe564=['./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields','lodash','util','api','moment','path','rimraf'];(function(_0x5026a5,_0x30345b){var _0x466f4f=function(_0x42d273){while(--_0x42d273){_0x5026a5['push'](_0x5026a5['shift']());}};_0x466f4f(++_0x30345b);}(_0xe564,0xe0));var _0x4e56=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe564[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4e56('0x0'));var util=require(_0x4e56('0x1'));var logger=require('../../config/logger')(_0x4e56('0x2'));var moment=require(_0x4e56('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4e56('0x4'));var rimraf=require(_0x4e56('0x5'));var config=require('../../config/environment');var attributes=require(_0x4e56('0x6'));module[_0x4e56('0x7')]=function(_0x1c48e,_0x429762){return _0x1c48e['define'](_0x4e56('0x8'),attributes,{'tableName':_0x4e56('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf1da=['define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports'];(function(_0x2bcb75,_0x5789a7){var _0x175345=function(_0x3a7d41){while(--_0x3a7d41){_0x2bcb75['push'](_0x2bcb75['shift']());}};_0x175345(++_0x5789a7);}(_0xf1da,0x189));var _0xaf1d=function(_0x5081b1,_0x40371a){_0x5081b1=_0x5081b1-0x0;var _0x1efdc4=_0xf1da[_0x5081b1];return _0x1efdc4;};'use strict';var _=require(_0xaf1d('0x0'));var util=require(_0xaf1d('0x1'));var logger=require(_0xaf1d('0x2'))(_0xaf1d('0x3'));var moment=require(_0xaf1d('0x4'));var BPromise=require(_0xaf1d('0x5'));var rp=require(_0xaf1d('0x6'));var fs=require('fs');var path=require(_0xaf1d('0x7'));var rimraf=require(_0xaf1d('0x8'));var config=require(_0xaf1d('0x9'));var attributes=require(_0xaf1d('0xa'));module[_0xaf1d('0xb')]=function(_0x4afd0b,_0x5535eb){return _0x4afd0b[_0xaf1d('0xc')](_0xaf1d('0xd'),attributes,{'tableName':_0xaf1d('0xe'),'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 03f1fb2..c69aa85 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 _0xaa72=['code','AnalyticFieldReport,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3f6f87,_0x51a423){var _0x234100=function(_0x3c1fd2){while(--_0x3c1fd2){_0x3f6f87['push'](_0x3f6f87['shift']());}};_0x234100(++_0x51a423);}(_0xaa72,0x101));var _0x2aa7=function(_0x348f29,_0x1a2e78){_0x348f29=_0x348f29-0x0;var _0x432cda=_0xaa72[_0x348f29];return _0x432cda;};'use strict';var _=require(_0x2aa7('0x0'));var util=require(_0x2aa7('0x1'));var moment=require(_0x2aa7('0x2'));var BPromise=require(_0x2aa7('0x3'));var rs=require(_0x2aa7('0x4'));var fs=require('fs');var Redis=require(_0x2aa7('0x5'));var db=require(_0x2aa7('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2aa7('0x7'))(_0x2aa7('0x8'));var config=require(_0x2aa7('0x9'));var jayson=require(_0x2aa7('0xa'));var client=jayson['client'][_0x2aa7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x34c16d,_0xf7b08f,_0x3cf94e){return new BPromise(function(_0x23ecea,_0x12308b){return client['request'](_0x34c16d,_0x3cf94e)[_0x2aa7('0xc')](function(_0x1b0abe){logger[_0x2aa7('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0xf7b08f,_0x2aa7('0xe'));logger[_0x2aa7('0xf')](_0x2aa7('0x10'),_0xf7b08f,'request\x20sent',JSON[_0x2aa7('0x11')](_0x1b0abe));if(_0x1b0abe[_0x2aa7('0x12')]){if(_0x1b0abe[_0x2aa7('0x12')][_0x2aa7('0x13')]===0x1f4){logger[_0x2aa7('0x12')](_0x2aa7('0x14'),_0xf7b08f,_0x1b0abe[_0x2aa7('0x12')][_0x2aa7('0x15')]);return _0x12308b(_0x1b0abe[_0x2aa7('0x12')][_0x2aa7('0x15')]);}logger[_0x2aa7('0x12')](_0x2aa7('0x14'),_0xf7b08f,_0x1b0abe[_0x2aa7('0x12')][_0x2aa7('0x15')]);return _0x23ecea(_0x1b0abe[_0x2aa7('0x12')]['message']);}else{logger[_0x2aa7('0xd')](_0x2aa7('0x14'),_0xf7b08f,_0x2aa7('0xe'));_0x23ecea(_0x1b0abe['result'][_0x2aa7('0x15')]);}})[_0x2aa7('0x16')](function(_0x4747f8){logger[_0x2aa7('0x12')](_0x2aa7('0x14'),_0xf7b08f,_0x4747f8);_0x12308b(_0x4747f8);});});} \ No newline at end of file +var _0x288c=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','code','error','info','result','message','catch','lodash','util','moment'];(function(_0x4b4b7c,_0x13a9be){var _0x18bfe1=function(_0xb4edc8){while(--_0xb4edc8){_0x4b4b7c['push'](_0x4b4b7c['shift']());}};_0x18bfe1(++_0x13a9be);}(_0x288c,0x18c));var _0xc288=function(_0x516044,_0x3677f7){_0x516044=_0x516044-0x0;var _0x31684b=_0x288c[_0x516044];return _0x31684b;};'use strict';var _=require(_0xc288('0x0'));var util=require(_0xc288('0x1'));var moment=require(_0xc288('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc288('0x3'));var db=require(_0xc288('0x4'))['db'];var utils=require(_0xc288('0x5'));var logger=require(_0xc288('0x6'))(_0xc288('0x7'));var config=require(_0xc288('0x8'));var jayson=require(_0xc288('0x9'));var client=jayson['client'][_0xc288('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4db6e1,_0x5ef053,_0x16ec66){return new BPromise(function(_0x1940cc,_0x3dede2){return client['request'](_0x4db6e1,_0x16ec66)[_0xc288('0xb')](function(_0x3e4995){logger['info'](_0xc288('0xc'),_0x5ef053,_0xc288('0xd'));logger['debug'](_0xc288('0xe'),_0x5ef053,_0xc288('0xd'),JSON['stringify'](_0x3e4995));if(_0x3e4995['error']){if(_0x3e4995['error'][_0xc288('0xf')]===0x1f4){logger[_0xc288('0x10')](_0xc288('0xc'),_0x5ef053,_0x3e4995['error']['message']);return _0x3dede2(_0x3e4995[_0xc288('0x10')]['message']);}logger[_0xc288('0x10')](_0xc288('0xc'),_0x5ef053,_0x3e4995['error']['message']);return _0x1940cc(_0x3e4995[_0xc288('0x10')]['message']);}else{logger[_0xc288('0x11')](_0xc288('0xc'),_0x5ef053,_0xc288('0xd'));_0x1940cc(_0x3e4995[_0xc288('0x12')][_0xc288('0x13')]);}})[_0xc288('0x14')](function(_0xc41950){logger[_0xc288('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x5ef053,_0xc41950);_0x3dede2(_0xc41950);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index c21335d..71993e5 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(_0x3f7f20,_0x5b4d7d){var _0x29bb64=function(_0x585e03){while(--_0x585e03){_0x3f7f20['push'](_0x3f7f20['shift']());}};_0x29bb64(++_0x5b4d7d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'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(_0x16c1f3,_0x31cb3b){var _0xeade4c=function(_0x37869a){while(--_0x37869a){_0x16c1f3['push'](_0x16c1f3['shift']());}};_0xeade4c(++_0x31cb3b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'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 0e35d23..61b301e 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 _0xb350=['TEXT','sequelize','exports','STRING','name'];(function(_0x28a7c6,_0x51edc5){var _0x29897f=function(_0x5dbc38){while(--_0x5dbc38){_0x28a7c6['push'](_0x28a7c6['shift']());}};_0x29897f(++_0x51edc5);}(_0xb350,0x6f));var _0x0b35=function(_0x952ea6,_0x489186){_0x952ea6=_0x952ea6-0x0;var _0x1c966d=_0xb350[_0x952ea6];return _0x1c966d;};'use strict';var Sequelize=require(_0x0b35('0x0'));module[_0x0b35('0x1')]={'name':{'type':Sequelize[_0x0b35('0x2')],'allowNull':![],'unique':_0x0b35('0x3')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x0b35('0x4')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc343=['STRING','name','sequelize'];(function(_0x484875,_0x92f88a){var _0x1679f1=function(_0x14a2d7){while(--_0x14a2d7){_0x484875['push'](_0x484875['shift']());}};_0x1679f1(++_0x92f88a);}(_0xc343,0x173));var _0x3c34=function(_0x245d73,_0x28f6a8){_0x245d73=_0x245d73-0x0;var _0x14c47d=_0xc343[_0x245d73];return _0x14c47d;};'use strict';var Sequelize=require(_0x3c34('0x0'));module['exports']={'name':{'type':Sequelize[_0x3c34('0x1')],'allowNull':![],'unique':_0x3c34('0x2')},'table':{'type':Sequelize[_0x3c34('0x1')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index ab78063..0c223bf 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 _0x9c5a=['update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','AnalyticMetric','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','length','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save'];(function(_0x5622b2,_0x5dc268){var _0x2c441b=function(_0x3a3f73){while(--_0x3a3f73){_0x5622b2['push'](_0x5622b2['shift']());}};_0x2c441b(++_0x5dc268);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x3bed87,_0x1f9a54){_0x3bed87=_0x3bed87-0x0;var _0x57bbb8=_0x9c5a[_0x3bed87];return _0x57bbb8;};'use strict';var emlformat=require(_0xa9c5('0x0'));var rimraf=require(_0xa9c5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa9c5('0x2'));var rp=require(_0xa9c5('0x3'));var moment=require(_0xa9c5('0x4'));var BPromise=require(_0xa9c5('0x5'));var Mustache=require('mustache');var util=require(_0xa9c5('0x6'));var path=require(_0xa9c5('0x7'));var sox=require('sox');var csv=require(_0xa9c5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa9c5('0x9'));var _=require(_0xa9c5('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa9c5('0xb'));var deskjs=require(_0xa9c5('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa9c5('0xd'));var Papa=require(_0xa9c5('0xe'));var Redis=require('ioredis');var authService=require(_0xa9c5('0xf'));var qs=require(_0xa9c5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa9c5('0x11'))(_0xa9c5('0x12'));var utils=require(_0xa9c5('0x13'));var config=require(_0xa9c5('0x14'));var licenseUtil=require(_0xa9c5('0x15'));var db=require(_0xa9c5('0x16'))['db'];function respondWithStatusCode(_0x51c8d,_0x42d5cf){_0x42d5cf=_0x42d5cf||0xcc;return function(_0x3c5ac7){if(_0x3c5ac7){return _0x51c8d[_0xa9c5('0x17')](_0x42d5cf);}return _0x51c8d['status'](_0x42d5cf)[_0xa9c5('0x18')]();};}function respondWithResult(_0x1276d2,_0x7df76d){_0x7df76d=_0x7df76d||0xc8;return function(_0x3806c4){if(_0x3806c4){return _0x1276d2[_0xa9c5('0x19')](_0x7df76d)[_0xa9c5('0x1a')](_0x3806c4);}};}function respondWithFilteredResult(_0x251099,_0x40b001){return function(_0x19a43e){if(_0x19a43e){var _0xcf13f2=typeof _0x40b001['offset']===_0xa9c5('0x1b')&&typeof _0x40b001[_0xa9c5('0x1c')]===_0xa9c5('0x1b');var _0x55cce5=_0x19a43e[_0xa9c5('0x1d')];var _0x1142d9=_0xcf13f2?0x0:_0x40b001[_0xa9c5('0x1e')];var _0x3b8cf7=_0xcf13f2?_0x19a43e[_0xa9c5('0x1d')]:_0x40b001[_0xa9c5('0x1e')]+_0x40b001[_0xa9c5('0x1c')];var _0x1e5ce6;if(_0x3b8cf7>=_0x55cce5){_0x3b8cf7=_0x55cce5;_0x1e5ce6=0xc8;}else{_0x1e5ce6=0xce;}_0x251099[_0xa9c5('0x19')](_0x1e5ce6);return _0x251099[_0xa9c5('0x1f')](_0xa9c5('0x20'),_0x1142d9+'-'+_0x3b8cf7+'/'+_0x55cce5)[_0xa9c5('0x1a')](_0x19a43e);}return null;};}function patchUpdates(_0x54f8b9){return function(_0x1115ad){try{jsonpatch[_0xa9c5('0x21')](_0x1115ad,_0x54f8b9,!![]);}catch(_0x541c77){return BPromise['reject'](_0x541c77);}return _0x1115ad[_0xa9c5('0x22')]();};}function saveUpdates(_0x366f5c,_0x10b208){return function(_0x3b497a){if(_0x3b497a){return _0x3b497a[_0xa9c5('0x23')](_0x366f5c)[_0xa9c5('0x24')](function(_0x48e2cb){return _0x48e2cb;});}return null;};}function removeEntity(_0x4fa280,_0x3d4e1b){return function(_0x11d395){if(_0x11d395){return _0x11d395['destroy']()[_0xa9c5('0x24')](function(){var _0x424b4c=_0x11d395[_0xa9c5('0x25')]({'plain':!![]});var _0x32fc7d=_0xa9c5('0x26');return db[_0xa9c5('0x27')][_0xa9c5('0x28')]({'where':{'type':_0x32fc7d,'resourceId':_0x424b4c['id']}})['then'](function(){return _0x11d395;});})['then'](function(){_0x4fa280[_0xa9c5('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1762ac,_0x830bad){return function(_0x4caefa){if(!_0x4caefa){_0x1762ac[_0xa9c5('0x17')](0x194);}return _0x4caefa;};}function handleError(_0x320dc0,_0x5f468b){_0x5f468b=_0x5f468b||0x1f4;return function(_0x413edf){logger[_0xa9c5('0x29')](_0x413edf[_0xa9c5('0x2a')]);if(_0x413edf[_0xa9c5('0x2b')]){delete _0x413edf[_0xa9c5('0x2b')];}_0x320dc0['status'](_0x5f468b)[_0xa9c5('0x2c')](_0x413edf);};}exports['index']=function(_0x3c3da7,_0x1ef388){var _0x2eeed1={},_0x541475={},_0xc6d0c1={'count':0x0,'rows':[]};var _0xbe29c5=_['map'](db[_0xa9c5('0x2d')][_0xa9c5('0x2e')],function(_0x431e07){return{'name':_0x431e07[_0xa9c5('0x2f')],'type':_0x431e07[_0xa9c5('0x30')][_0xa9c5('0x31')]};});_0x541475[_0xa9c5('0x32')]=_['map'](_0xbe29c5,_0xa9c5('0x2b'));_0x541475[_0xa9c5('0x33')]=_[_0xa9c5('0x34')](_0x3c3da7[_0xa9c5('0x33')]);_0x541475[_0xa9c5('0x35')]=_[_0xa9c5('0x36')](_0x541475[_0xa9c5('0x32')],_0x541475[_0xa9c5('0x33')]);_0x2eeed1['attributes']=_['intersection'](_0x541475[_0xa9c5('0x32')],qs[_0xa9c5('0x37')](_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x37')]));_0x2eeed1[_0xa9c5('0x38')]=_0x2eeed1[_0xa9c5('0x38')]['length']?_0x2eeed1['attributes']:_0x541475['model'];if(!_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x39')]('nolimit')){_0x2eeed1[_0xa9c5('0x1c')]=qs['limit'](_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x1c')]);_0x2eeed1[_0xa9c5('0x1e')]=qs[_0xa9c5('0x1e')](_0x3c3da7['query'][_0xa9c5('0x1e')]);}_0x2eeed1[_0xa9c5('0x3a')]=qs[_0xa9c5('0x3b')](_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x3b')]);_0x2eeed1[_0xa9c5('0x3c')]=qs[_0xa9c5('0x35')](_[_0xa9c5('0x3d')](_0x3c3da7['query'],_0x541475[_0xa9c5('0x35')]),_0xbe29c5);if(_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x3e')]){_0x2eeed1[_0xa9c5('0x3c')]=_[_0xa9c5('0x3f')](_0x2eeed1[_0xa9c5('0x3c')],{'$or':_['map'](_0xbe29c5,function(_0x307736){if(_0x307736['type']!==_0xa9c5('0x40')){var _0x5c89e7={};_0x5c89e7[_0x307736[_0xa9c5('0x2b')]]={'$like':'%'+_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x3e')]+'%'};return _0x5c89e7;}})});}_0x2eeed1=_['merge']({},_0x2eeed1,_0x3c3da7[_0xa9c5('0x41')]);var _0x1ddd72={'where':_0x2eeed1[_0xa9c5('0x3c')]};return db[_0xa9c5('0x2d')]['count'](_0x1ddd72)[_0xa9c5('0x24')](function(_0x97803f){_0xc6d0c1[_0xa9c5('0x1d')]=_0x97803f;if(_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x42')]){_0x2eeed1['include']=[{'all':!![]}];}return db[_0xa9c5('0x2d')]['findAll'](_0x2eeed1);})[_0xa9c5('0x24')](function(_0x397614){_0xc6d0c1[_0xa9c5('0x43')]=_0x397614;return _0xc6d0c1;})[_0xa9c5('0x24')](respondWithFilteredResult(_0x1ef388,_0x2eeed1))[_0xa9c5('0x44')](handleError(_0x1ef388,null));};exports[_0xa9c5('0x45')]=function(_0xf35cb3,_0x3e8633){var _0x1f895a={'raw':!![],'where':{'id':_0xf35cb3['params']['id']}},_0xc28b1a={};_0xc28b1a[_0xa9c5('0x32')]=_[_0xa9c5('0x34')](db[_0xa9c5('0x2d')][_0xa9c5('0x2e')]);_0xc28b1a[_0xa9c5('0x33')]=_[_0xa9c5('0x34')](_0xf35cb3['query']);_0xc28b1a[_0xa9c5('0x35')]=_[_0xa9c5('0x36')](_0xc28b1a['model'],_0xc28b1a['query']);_0x1f895a['attributes']=_['intersection'](_0xc28b1a['model'],qs[_0xa9c5('0x37')](_0xf35cb3[_0xa9c5('0x33')][_0xa9c5('0x37')]));_0x1f895a[_0xa9c5('0x38')]=_0x1f895a[_0xa9c5('0x38')][_0xa9c5('0x46')]?_0x1f895a[_0xa9c5('0x38')]:_0xc28b1a[_0xa9c5('0x32')];if(_0xf35cb3[_0xa9c5('0x33')][_0xa9c5('0x42')]){_0x1f895a[_0xa9c5('0x47')]=[{'all':!![]}];}_0x1f895a=_[_0xa9c5('0x3f')]({},_0x1f895a,_0xf35cb3[_0xa9c5('0x41')]);return db['AnalyticMetric'][_0xa9c5('0x48')](_0x1f895a)['then'](handleEntityNotFound(_0x3e8633,null))[_0xa9c5('0x24')](respondWithResult(_0x3e8633,null))[_0xa9c5('0x44')](handleError(_0x3e8633,null));};exports['create']=function(_0x5cbd33,_0xf00970){return db[_0xa9c5('0x2d')][_0xa9c5('0x49')](_0x5cbd33['body'],{})['then'](function(_0x2333c4){var _0xd03cec=_0x5cbd33['user'][_0xa9c5('0x25')]({'plain':!![]});if(!_0xd03cec)throw new Error(_0xa9c5('0x4a'));if(_0xd03cec[_0xa9c5('0x4b')]===_0xa9c5('0x4c')){var _0x34020f=_0x2333c4[_0xa9c5('0x25')]({'plain':!![]});var _0x4b6fc9='Metrics';return db['UserProfileSection'][_0xa9c5('0x48')]({'where':{'name':_0x4b6fc9,'userProfileId':_0xd03cec[_0xa9c5('0x4d')]},'raw':!![]})[_0xa9c5('0x24')](function(_0xef4d2){if(_0xef4d2&&_0xef4d2[_0xa9c5('0x4e')]===0x0){return db[_0xa9c5('0x27')]['create']({'name':_0x34020f[_0xa9c5('0x2b')],'resourceId':_0x34020f['id'],'type':_0xef4d2[_0xa9c5('0x2b')],'sectionId':_0xef4d2['id']},{})[_0xa9c5('0x24')](function(){return _0x2333c4;});}else{return _0x2333c4;}})[_0xa9c5('0x44')](function(_0xa0b458){logger[_0xa9c5('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xa0b458);throw _0xa0b458;});}return _0x2333c4;})['then'](respondWithResult(_0xf00970,0xc9))[_0xa9c5('0x44')](handleError(_0xf00970,null));};exports['update']=function(_0x1b158f,_0x5ea9b0){if(_0x1b158f[_0xa9c5('0x4f')]['id']){delete _0x1b158f[_0xa9c5('0x4f')]['id'];}return db[_0xa9c5('0x2d')]['find']({'where':{'id':_0x1b158f[_0xa9c5('0x50')]['id']}})[_0xa9c5('0x24')](handleEntityNotFound(_0x5ea9b0,null))[_0xa9c5('0x24')](saveUpdates(_0x1b158f[_0xa9c5('0x4f')],null))['then'](respondWithResult(_0x5ea9b0,null))['catch'](handleError(_0x5ea9b0,null));};exports[_0xa9c5('0x28')]=function(_0x2b66ee,_0x3205f2){return db['AnalyticMetric'][_0xa9c5('0x48')]({'where':{'id':_0x2b66ee[_0xa9c5('0x50')]['id']}})[_0xa9c5('0x24')](handleEntityNotFound(_0x3205f2,null))[_0xa9c5('0x24')](removeEntity(_0x3205f2,null))[_0xa9c5('0x44')](handleError(_0x3205f2,null));}; \ No newline at end of file +var _0xabce=['includeAll','rows','show','params','intersection','length','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','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','status','end','json','limit','count','offset','Content-Range','apply','reject','save','update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','model','keys','query','filters','attributes','fields','hasOwnProperty','nolimit','order','filter','merge','VIRTUAL','options'];(function(_0x55ffa6,_0x1e6d90){var _0x12dda0=function(_0x5594a0){while(--_0x5594a0){_0x55ffa6['push'](_0x55ffa6['shift']());}};_0x12dda0(++_0x1e6d90);}(_0xabce,0x103));var _0xeabc=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xabce[_0x24237f];return _0x48298e;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];function respondWithStatusCode(_0x3fd0b5,_0x36a92e){_0x36a92e=_0x36a92e||0xcc;return function(_0xcfbf06){if(_0xcfbf06){return _0x3fd0b5['sendStatus'](_0x36a92e);}return _0x3fd0b5[_0xeabc('0x1a')](_0x36a92e)[_0xeabc('0x1b')]();};}function respondWithResult(_0x3251c6,_0x55f0de){_0x55f0de=_0x55f0de||0xc8;return function(_0x5f4ee8){if(_0x5f4ee8){return _0x3251c6[_0xeabc('0x1a')](_0x55f0de)[_0xeabc('0x1c')](_0x5f4ee8);}};}function respondWithFilteredResult(_0x326bac,_0x53d5cb){return function(_0xf913d7){if(_0xf913d7){var _0x638976=typeof _0x53d5cb['offset']==='undefined'&&typeof _0x53d5cb[_0xeabc('0x1d')]==='undefined';var _0x3d0e21=_0xf913d7[_0xeabc('0x1e')];var _0x58a3c0=_0x638976?0x0:_0x53d5cb[_0xeabc('0x1f')];var _0x31dd53=_0x638976?_0xf913d7[_0xeabc('0x1e')]:_0x53d5cb[_0xeabc('0x1f')]+_0x53d5cb[_0xeabc('0x1d')];var _0x5d92e5;if(_0x31dd53>=_0x3d0e21){_0x31dd53=_0x3d0e21;_0x5d92e5=0xc8;}else{_0x5d92e5=0xce;}_0x326bac[_0xeabc('0x1a')](_0x5d92e5);return _0x326bac['set'](_0xeabc('0x20'),_0x58a3c0+'-'+_0x31dd53+'/'+_0x3d0e21)[_0xeabc('0x1c')](_0xf913d7);}return null;};}function patchUpdates(_0x502947){return function(_0x28063a){try{jsonpatch[_0xeabc('0x21')](_0x28063a,_0x502947,!![]);}catch(_0x254590){return BPromise[_0xeabc('0x22')](_0x254590);}return _0x28063a[_0xeabc('0x23')]();};}function saveUpdates(_0x4e99a4,_0xecdbf){return function(_0x10c675){if(_0x10c675){return _0x10c675[_0xeabc('0x24')](_0x4e99a4)['then'](function(_0x457f27){return _0x457f27;});}return null;};}function removeEntity(_0x3854d2,_0x214953){return function(_0x319119){if(_0x319119){return _0x319119['destroy']()[_0xeabc('0x25')](function(){var _0x480440=_0x319119[_0xeabc('0x26')]({'plain':!![]});var _0x4d4e29=_0xeabc('0x27');return db[_0xeabc('0x28')][_0xeabc('0x29')]({'where':{'type':_0x4d4e29,'resourceId':_0x480440['id']}})[_0xeabc('0x25')](function(){return _0x319119;});})[_0xeabc('0x25')](function(){_0x3854d2[_0xeabc('0x1a')](0xcc)[_0xeabc('0x1b')]();});}};}function handleEntityNotFound(_0x4c2693,_0x5b2934){return function(_0x459c8a){if(!_0x459c8a){_0x4c2693['sendStatus'](0x194);}return _0x459c8a;};}function handleError(_0x3c1b5b,_0x2b342c){_0x2b342c=_0x2b342c||0x1f4;return function(_0x48fb52){logger[_0xeabc('0x2a')](_0x48fb52[_0xeabc('0x2b')]);if(_0x48fb52[_0xeabc('0x2c')]){delete _0x48fb52[_0xeabc('0x2c')];}_0x3c1b5b[_0xeabc('0x1a')](_0x2b342c)[_0xeabc('0x2d')](_0x48fb52);};}exports[_0xeabc('0x2e')]=function(_0x38dc0a,_0x2915c1){var _0x5ebb86={},_0x5b34dd={},_0x5bb1f1={'count':0x0,'rows':[]};var _0x2f03e8=_[_0xeabc('0x2f')](db[_0xeabc('0x30')][_0xeabc('0x31')],function(_0x73c8d4){return{'name':_0x73c8d4[_0xeabc('0x32')],'type':_0x73c8d4[_0xeabc('0x33')]['key']};});_0x5b34dd[_0xeabc('0x34')]=_[_0xeabc('0x2f')](_0x2f03e8,_0xeabc('0x2c'));_0x5b34dd['query']=_[_0xeabc('0x35')](_0x38dc0a[_0xeabc('0x36')]);_0x5b34dd[_0xeabc('0x37')]=_['intersection'](_0x5b34dd[_0xeabc('0x34')],_0x5b34dd[_0xeabc('0x36')]);_0x5ebb86[_0xeabc('0x38')]=_['intersection'](_0x5b34dd[_0xeabc('0x34')],qs[_0xeabc('0x39')](_0x38dc0a['query']['fields']));_0x5ebb86[_0xeabc('0x38')]=_0x5ebb86[_0xeabc('0x38')]['length']?_0x5ebb86[_0xeabc('0x38')]:_0x5b34dd[_0xeabc('0x34')];if(!_0x38dc0a[_0xeabc('0x36')][_0xeabc('0x3a')](_0xeabc('0x3b'))){_0x5ebb86['limit']=qs[_0xeabc('0x1d')](_0x38dc0a['query'][_0xeabc('0x1d')]);_0x5ebb86[_0xeabc('0x1f')]=qs[_0xeabc('0x1f')](_0x38dc0a['query']['offset']);}_0x5ebb86[_0xeabc('0x3c')]=qs['sort'](_0x38dc0a[_0xeabc('0x36')]['sort']);_0x5ebb86['where']=qs['filters'](_['pick'](_0x38dc0a[_0xeabc('0x36')],_0x5b34dd['filters']),_0x2f03e8);if(_0x38dc0a[_0xeabc('0x36')][_0xeabc('0x3d')]){_0x5ebb86['where']=_[_0xeabc('0x3e')](_0x5ebb86['where'],{'$or':_[_0xeabc('0x2f')](_0x2f03e8,function(_0x58aafe){if(_0x58aafe[_0xeabc('0x33')]!==_0xeabc('0x3f')){var _0xeeef02={};_0xeeef02[_0x58aafe['name']]={'$like':'%'+_0x38dc0a['query']['filter']+'%'};return _0xeeef02;}})});}_0x5ebb86=_[_0xeabc('0x3e')]({},_0x5ebb86,_0x38dc0a[_0xeabc('0x40')]);var _0xafa59b={'where':_0x5ebb86['where']};return db['AnalyticMetric'][_0xeabc('0x1e')](_0xafa59b)[_0xeabc('0x25')](function(_0x5e9cb3){_0x5bb1f1[_0xeabc('0x1e')]=_0x5e9cb3;if(_0x38dc0a['query'][_0xeabc('0x41')]){_0x5ebb86['include']=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x5ebb86);})[_0xeabc('0x25')](function(_0x37c926){_0x5bb1f1[_0xeabc('0x42')]=_0x37c926;return _0x5bb1f1;})[_0xeabc('0x25')](respondWithFilteredResult(_0x2915c1,_0x5ebb86))['catch'](handleError(_0x2915c1,null));};exports[_0xeabc('0x43')]=function(_0x555d26,_0x7d5add){var _0x1a4bbe={'raw':!![],'where':{'id':_0x555d26[_0xeabc('0x44')]['id']}},_0x3a7807={};_0x3a7807[_0xeabc('0x34')]=_['keys'](db['AnalyticMetric'][_0xeabc('0x31')]);_0x3a7807['query']=_[_0xeabc('0x35')](_0x555d26[_0xeabc('0x36')]);_0x3a7807['filters']=_[_0xeabc('0x45')](_0x3a7807[_0xeabc('0x34')],_0x3a7807[_0xeabc('0x36')]);_0x1a4bbe[_0xeabc('0x38')]=_[_0xeabc('0x45')](_0x3a7807[_0xeabc('0x34')],qs[_0xeabc('0x39')](_0x555d26['query'][_0xeabc('0x39')]));_0x1a4bbe[_0xeabc('0x38')]=_0x1a4bbe[_0xeabc('0x38')][_0xeabc('0x46')]?_0x1a4bbe[_0xeabc('0x38')]:_0x3a7807[_0xeabc('0x34')];if(_0x555d26[_0xeabc('0x36')][_0xeabc('0x41')]){_0x1a4bbe[_0xeabc('0x47')]=[{'all':!![]}];}_0x1a4bbe=_[_0xeabc('0x3e')]({},_0x1a4bbe,_0x555d26['options']);return db[_0xeabc('0x30')][_0xeabc('0x48')](_0x1a4bbe)[_0xeabc('0x25')](handleEntityNotFound(_0x7d5add,null))[_0xeabc('0x25')](respondWithResult(_0x7d5add,null))[_0xeabc('0x49')](handleError(_0x7d5add,null));};exports[_0xeabc('0x4a')]=function(_0x268d95,_0x48df43){return db[_0xeabc('0x30')][_0xeabc('0x4a')](_0x268d95[_0xeabc('0x4b')],{})[_0xeabc('0x25')](function(_0x47440e){var _0x58e2c1=_0x268d95[_0xeabc('0x4c')][_0xeabc('0x26')]({'plain':!![]});if(!_0x58e2c1)throw new Error(_0xeabc('0x4d'));if(_0x58e2c1[_0xeabc('0x4e')]==='user'){var _0x400b82=_0x47440e[_0xeabc('0x26')]({'plain':!![]});var _0x568847=_0xeabc('0x27');return db['UserProfileSection'][_0xeabc('0x48')]({'where':{'name':_0x568847,'userProfileId':_0x58e2c1['userProfileId']},'raw':!![]})[_0xeabc('0x25')](function(_0x2ec94c){if(_0x2ec94c&&_0x2ec94c[_0xeabc('0x4f')]===0x0){return db[_0xeabc('0x28')][_0xeabc('0x4a')]({'name':_0x400b82[_0xeabc('0x2c')],'resourceId':_0x400b82['id'],'type':_0x2ec94c[_0xeabc('0x2c')],'sectionId':_0x2ec94c['id']},{})[_0xeabc('0x25')](function(){return _0x47440e;});}else{return _0x47440e;}})[_0xeabc('0x49')](function(_0x6423f3){logger['error'](_0xeabc('0x50'),_0x6423f3);throw _0x6423f3;});}return _0x47440e;})[_0xeabc('0x25')](respondWithResult(_0x48df43,0xc9))[_0xeabc('0x49')](handleError(_0x48df43,null));};exports[_0xeabc('0x24')]=function(_0x555d6b,_0x1cef45){if(_0x555d6b[_0xeabc('0x4b')]['id']){delete _0x555d6b[_0xeabc('0x4b')]['id'];}return db[_0xeabc('0x30')]['find']({'where':{'id':_0x555d6b[_0xeabc('0x44')]['id']}})[_0xeabc('0x25')](handleEntityNotFound(_0x1cef45,null))[_0xeabc('0x25')](saveUpdates(_0x555d6b[_0xeabc('0x4b')],null))[_0xeabc('0x25')](respondWithResult(_0x1cef45,null))[_0xeabc('0x49')](handleError(_0x1cef45,null));};exports[_0xeabc('0x29')]=function(_0x3ff38c,_0x17acf8){return db['AnalyticMetric'][_0xeabc('0x48')]({'where':{'id':_0x3ff38c['params']['id']}})['then'](handleEntityNotFound(_0x17acf8,null))['then'](removeEntity(_0x17acf8,null))[_0xeabc('0x49')](handleError(_0x17acf8,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 4b025ac..d53da20 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 _0x4fb4=['./analyticMetric.attributes','exports','define','AnalyticMetric','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x4fb4,0x190));var _0x44fb=function(_0x525259,_0x2cfdb1){_0x525259=_0x525259-0x0;var _0x21084a=_0x4fb4[_0x525259];return _0x21084a;};'use strict';var _=require('lodash');var util=require(_0x44fb('0x0'));var logger=require(_0x44fb('0x1'))(_0x44fb('0x2'));var moment=require(_0x44fb('0x3'));var BPromise=require(_0x44fb('0x4'));var rp=require(_0x44fb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x44fb('0x6'));var config=require(_0x44fb('0x7'));var attributes=require(_0x44fb('0x8'));module[_0x44fb('0x9')]=function(_0x375d33,_0x173e70){return _0x375d33[_0x44fb('0xa')](_0x44fb('0xb'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9485=['request-promise','path','../../config/environment','./analyticMetric.attributes','exports','define','analytics_metrics','lodash','util','../../config/logger','api','bluebird'];(function(_0x470292,_0x1c5cfb){var _0x3abe8e=function(_0x1a5183){while(--_0x1a5183){_0x470292['push'](_0x470292['shift']());}};_0x3abe8e(++_0x1c5cfb);}(_0x9485,0x8b));var _0x5948=function(_0x4e64d4,_0x2a1525){_0x4e64d4=_0x4e64d4-0x0;var _0x4bdf81=_0x9485[_0x4e64d4];return _0x4bdf81;};'use strict';var _=require(_0x5948('0x0'));var util=require(_0x5948('0x1'));var logger=require(_0x5948('0x2'))(_0x5948('0x3'));var moment=require('moment');var BPromise=require(_0x5948('0x4'));var rp=require(_0x5948('0x5'));var fs=require('fs');var path=require(_0x5948('0x6'));var rimraf=require('rimraf');var config=require(_0x5948('0x7'));var attributes=require(_0x5948('0x8'));module[_0x5948('0x9')]=function(_0x4312a8,_0x19ccdd){return _0x4312a8[_0x5948('0xa')]('AnalyticMetric',attributes,{'tableName':_0x5948('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 64116fa..da0eed5 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 _0xccda=['http','request','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x4ea69d,_0x290f53){var _0x5318e0=function(_0x18e081){while(--_0x18e081){_0x4ea69d['push'](_0x4ea69d['shift']());}};_0x5318e0(++_0x290f53);}(_0xccda,0xc8));var _0xaccd=function(_0x374954,_0x18dc36){_0x374954=_0x374954-0x0;var _0x42073e=_0xccda[_0x374954];return _0x42073e;};'use strict';var _=require('lodash');var util=require(_0xaccd('0x0'));var moment=require(_0xaccd('0x1'));var BPromise=require(_0xaccd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaccd('0x3'))['db'];var utils=require(_0xaccd('0x4'));var logger=require(_0xaccd('0x5'))(_0xaccd('0x6'));var config=require(_0xaccd('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xaccd('0x8')][_0xaccd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f7602,_0x3d8939,_0x5e6d0e){return new BPromise(function(_0x54076a,_0x5af557){return client[_0xaccd('0xa')](_0x4f7602,_0x5e6d0e)['then'](function(_0x206ecc){logger[_0xaccd('0xb')](_0xaccd('0xc'),_0x3d8939,_0xaccd('0xd'));logger['debug'](_0xaccd('0xe'),_0x3d8939,'request\x20sent',JSON['stringify'](_0x206ecc));if(_0x206ecc['error']){if(_0x206ecc[_0xaccd('0xf')]['code']===0x1f4){logger['error'](_0xaccd('0xc'),_0x3d8939,_0x206ecc[_0xaccd('0xf')][_0xaccd('0x10')]);return _0x5af557(_0x206ecc[_0xaccd('0xf')][_0xaccd('0x10')]);}logger[_0xaccd('0xf')](_0xaccd('0xc'),_0x3d8939,_0x206ecc[_0xaccd('0xf')][_0xaccd('0x10')]);return _0x54076a(_0x206ecc[_0xaccd('0xf')][_0xaccd('0x10')]);}else{logger[_0xaccd('0xb')](_0xaccd('0xc'),_0x3d8939,_0xaccd('0xd'));_0x54076a(_0x206ecc[_0xaccd('0x11')][_0xaccd('0x10')]);}})[_0xaccd('0x12')](function(_0x325b74){logger[_0xaccd('0xf')](_0xaccd('0xc'),_0x3d8939,_0x325b74);_0x5af557(_0x325b74);});});} \ No newline at end of file +var _0x2e62=['result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x27f90e,_0x377c2b){var _0x5dfb79=function(_0x2c98f1){while(--_0x2c98f1){_0x27f90e['push'](_0x27f90e['shift']());}};_0x5dfb79(++_0x377c2b);}(_0x2e62,0x1a0));var _0x22e6=function(_0x407096,_0x1ec675){_0x407096=_0x407096-0x0;var _0x288a9f=_0x2e62[_0x407096];return _0x288a9f;};'use strict';var _=require(_0x22e6('0x0'));var util=require(_0x22e6('0x1'));var moment=require(_0x22e6('0x2'));var BPromise=require(_0x22e6('0x3'));var rs=require(_0x22e6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x22e6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x22e6('0x6'))(_0x22e6('0x7'));var config=require(_0x22e6('0x8'));var jayson=require(_0x22e6('0x9'));var client=jayson[_0x22e6('0xa')][_0x22e6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ad07f,_0x5d21a9,_0x387eb0){return new BPromise(function(_0x407d80,_0x45305f){return client[_0x22e6('0xc')](_0x1ad07f,_0x387eb0)[_0x22e6('0xd')](function(_0x16bd33){logger[_0x22e6('0xe')](_0x22e6('0xf'),_0x5d21a9,_0x22e6('0x10'));logger[_0x22e6('0x11')](_0x22e6('0x12'),_0x5d21a9,'request\x20sent',JSON['stringify'](_0x16bd33));if(_0x16bd33[_0x22e6('0x13')]){if(_0x16bd33[_0x22e6('0x13')]['code']===0x1f4){logger['error'](_0x22e6('0xf'),_0x5d21a9,_0x16bd33[_0x22e6('0x13')][_0x22e6('0x14')]);return _0x45305f(_0x16bd33[_0x22e6('0x13')]['message']);}logger[_0x22e6('0x13')](_0x22e6('0xf'),_0x5d21a9,_0x16bd33[_0x22e6('0x13')][_0x22e6('0x14')]);return _0x407d80(_0x16bd33[_0x22e6('0x13')][_0x22e6('0x14')]);}else{logger[_0x22e6('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x5d21a9,'request\x20sent');_0x407d80(_0x16bd33[_0x22e6('0x15')][_0x22e6('0x14')]);}})[_0x22e6('0x16')](function(_0x196178){logger[_0x22e6('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x5d21a9,_0x196178);_0x45305f(_0x196178);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index fdaac62..7e84ee0 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 _0xfd0f=['get','isAuthenticated','index','/:id','show','create','put','delete','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./analyticMetric.controller'];(function(_0x3043ea,_0x22de20){var _0xcf6541=function(_0x1162bb){while(--_0x1162bb){_0x3043ea['push'](_0x3043ea['shift']());}};_0xcf6541(++_0x22de20);}(_0xfd0f,0x1b8));var _0xffd0=function(_0x2f5497,_0x57d7f1){_0x2f5497=_0x2f5497-0x0;var _0x5846c5=_0xfd0f[_0x2f5497];return _0x5846c5;};'use strict';var multer=require(_0xffd0('0x0'));var util=require(_0xffd0('0x1'));var path=require('path');var timeout=require(_0xffd0('0x2'));var express=require(_0xffd0('0x3'));var router=express[_0xffd0('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xffd0('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xffd0('0x6'));var controller=require(_0xffd0('0x7'));router[_0xffd0('0x8')]('/',auth[_0xffd0('0x9')](),controller[_0xffd0('0xa')]);router[_0xffd0('0x8')](_0xffd0('0xb'),auth[_0xffd0('0x9')](),controller[_0xffd0('0xc')]);router['post']('/',auth[_0xffd0('0x9')](),controller[_0xffd0('0xd')]);router[_0xffd0('0xe')](_0xffd0('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xffd0('0xf')](_0xffd0('0xb'),auth[_0xffd0('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x0eb2=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','isAuthenticated','index','get','show','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x3cb544,_0x6adabd){var _0x16aabe=function(_0x2f6dd2){while(--_0x2f6dd2){_0x3cb544['push'](_0x3cb544['shift']());}};_0x16aabe(++_0x6adabd);}(_0x0eb2,0x11c));var _0x20eb=function(_0x30d168,_0x4973a8){_0x30d168=_0x30d168-0x0;var _0x12d723=_0x0eb2[_0x30d168];return _0x12d723;};'use strict';var multer=require(_0x20eb('0x0'));var util=require('util');var path=require(_0x20eb('0x1'));var timeout=require(_0x20eb('0x2'));var express=require(_0x20eb('0x3'));var router=express[_0x20eb('0x4')]();var fs_extra=require(_0x20eb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x20eb('0x6'));var config=require('../../config/environment');var controller=require('./analyticMetric.controller');router['get']('/',auth[_0x20eb('0x7')](),controller[_0x20eb('0x8')]);router[_0x20eb('0x9')]('/:id',auth[_0x20eb('0x7')](),controller[_0x20eb('0xa')]);router[_0x20eb('0xb')]('/',auth[_0x20eb('0x7')](),controller[_0x20eb('0xc')]);router[_0x20eb('0xd')](_0x20eb('0xe'),auth[_0x20eb('0x7')](),controller[_0x20eb('0xf')]);router[_0x20eb('0x10')](_0x20eb('0xe'),auth[_0x20eb('0x7')](),controller[_0x20eb('0x11')]);module[_0x20eb('0x12')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 90c55e0..1b68777 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 _0x1d35=['TEXT','sequelize','exports'];(function(_0xfaca0c,_0x2a6afd){var _0x1a86e1=function(_0x23f309){while(--_0x23f309){_0xfaca0c['push'](_0xfaca0c['shift']());}};_0x1a86e1(++_0x2a6afd);}(_0x1d35,0x64));var _0x51d3=function(_0x2d94f3,_0x2059d7){_0x2d94f3=_0x2d94f3-0x0;var _0x1b82d4=_0x1d35[_0x2d94f3];return _0x1b82d4;};'use strict';var Sequelize=require(_0x51d3('0x0'));module[_0x51d3('0x1')]={'tree':{'type':Sequelize[_0x51d3('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x6e16=['TEXT'];(function(_0x51097d,_0xb95c7a){var _0x45b9a2=function(_0x150c77){while(--_0x150c77){_0x51097d['push'](_0x51097d['shift']());}};_0x45b9a2(++_0xb95c7a);}(_0x6e16,0x1d3));var _0x66e1=function(_0x2b4336,_0x36ee96){_0x2b4336=_0x2b4336-0x0;var _0x14acd5=_0x6e16[_0x2b4336];return _0x14acd5;};'use strict';var Sequelize=require('sequelize');module['exports']={'tree':{'type':Sequelize[_0x66e1('0x0')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 04d1a2f..922f381 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 _0x17a0=['rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','AnalyticTreeReport','include','findAll','rows','catch','show','params','includeAll','options','body','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','set','apply','save','update','destroy','then','end','error','stack','name','send','index','map'];(function(_0xa74d52,_0x430427){var _0x1e1247=function(_0x5128be){while(--_0x5128be){_0xa74d52['push'](_0xa74d52['shift']());}};_0x1e1247(++_0x430427);}(_0x17a0,0x102));var _0x017a=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x17a0[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0x017a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x017a('0x1'));var jsonpatch=require(_0x017a('0x2'));var rp=require(_0x017a('0x3'));var moment=require(_0x017a('0x4'));var BPromise=require(_0x017a('0x5'));var Mustache=require(_0x017a('0x6'));var util=require(_0x017a('0x7'));var path=require('path');var sox=require(_0x017a('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x017a('0x9'));var _=require(_0x017a('0xa'));var squel=require(_0x017a('0xb'));var crypto=require(_0x017a('0xc'));var jsforce=require(_0x017a('0xd'));var deskjs=require(_0x017a('0xe'));var toCsv=require(_0x017a('0xf'));var querystring=require(_0x017a('0x10'));var Papa=require(_0x017a('0x11'));var Redis=require(_0x017a('0x12'));var authService=require(_0x017a('0x13'));var qs=require(_0x017a('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x017a('0x15'));var logger=require(_0x017a('0x16'))(_0x017a('0x17'));var utils=require(_0x017a('0x18'));var config=require(_0x017a('0x19'));var licenseUtil=require(_0x017a('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e954f,_0x2ded4a){_0x2ded4a=_0x2ded4a||0xcc;return function(_0x5d74e9){if(_0x5d74e9){return _0x4e954f[_0x017a('0x1b')](_0x2ded4a);}return _0x4e954f[_0x017a('0x1c')](_0x2ded4a)['end']();};}function respondWithResult(_0x53d364,_0x28ad62){_0x28ad62=_0x28ad62||0xc8;return function(_0x21fe82){if(_0x21fe82){return _0x53d364[_0x017a('0x1c')](_0x28ad62)['json'](_0x21fe82);}};}function respondWithFilteredResult(_0x4052f8,_0x569483){return function(_0x46dd3c){if(_0x46dd3c){var _0x2651d3=typeof _0x569483[_0x017a('0x1d')]===_0x017a('0x1e')&&typeof _0x569483[_0x017a('0x1f')]===_0x017a('0x1e');var _0x17f641=_0x46dd3c[_0x017a('0x20')];var _0x4c4877=_0x2651d3?0x0:_0x569483[_0x017a('0x1d')];var _0x2fc857=_0x2651d3?_0x46dd3c[_0x017a('0x20')]:_0x569483[_0x017a('0x1d')]+_0x569483[_0x017a('0x1f')];var _0x2d2386;if(_0x2fc857>=_0x17f641){_0x2fc857=_0x17f641;_0x2d2386=0xc8;}else{_0x2d2386=0xce;}_0x4052f8[_0x017a('0x1c')](_0x2d2386);return _0x4052f8[_0x017a('0x21')]('Content-Range',_0x4c4877+'-'+_0x2fc857+'/'+_0x17f641)['json'](_0x46dd3c);}return null;};}function patchUpdates(_0x2a2719){return function(_0x2bae33){try{jsonpatch[_0x017a('0x22')](_0x2bae33,_0x2a2719,!![]);}catch(_0x12cc1d){return BPromise['reject'](_0x12cc1d);}return _0x2bae33[_0x017a('0x23')]();};}function saveUpdates(_0x3848eb,_0x51e0e3){return function(_0x4f1591){if(_0x4f1591){return _0x4f1591[_0x017a('0x24')](_0x3848eb)['then'](function(_0x42cc4f){return _0x42cc4f;});}return null;};}function removeEntity(_0x2823cf,_0x44d0e9){return function(_0x489bdf){if(_0x489bdf){return _0x489bdf[_0x017a('0x25')]()[_0x017a('0x26')](function(){_0x2823cf['status'](0xcc)[_0x017a('0x27')]();});}};}function handleEntityNotFound(_0xbdc63,_0x541369){return function(_0x11df67){if(!_0x11df67){_0xbdc63['sendStatus'](0x194);}return _0x11df67;};}function handleError(_0x2092a9,_0x157ddd){_0x157ddd=_0x157ddd||0x1f4;return function(_0xbceda4){logger[_0x017a('0x28')](_0xbceda4[_0x017a('0x29')]);if(_0xbceda4[_0x017a('0x2a')]){delete _0xbceda4[_0x017a('0x2a')];}_0x2092a9['status'](_0x157ddd)[_0x017a('0x2b')](_0xbceda4);};}exports[_0x017a('0x2c')]=function(_0x2ecadf,_0x59058a){var _0x402f46={},_0x34ee05={},_0x16a334={'count':0x0,'rows':[]};var _0x5e86b8=_[_0x017a('0x2d')](db['AnalyticTreeReport'][_0x017a('0x2e')],function(_0x24ec59){return{'name':_0x24ec59[_0x017a('0x2f')],'type':_0x24ec59[_0x017a('0x30')]['key']};});_0x34ee05[_0x017a('0x31')]=_['map'](_0x5e86b8,_0x017a('0x2a'));_0x34ee05[_0x017a('0x32')]=_[_0x017a('0x33')](_0x2ecadf[_0x017a('0x32')]);_0x34ee05[_0x017a('0x34')]=_[_0x017a('0x35')](_0x34ee05[_0x017a('0x31')],_0x34ee05['query']);_0x402f46[_0x017a('0x36')]=_[_0x017a('0x35')](_0x34ee05[_0x017a('0x31')],qs['fields'](_0x2ecadf[_0x017a('0x32')][_0x017a('0x37')]));_0x402f46[_0x017a('0x36')]=_0x402f46[_0x017a('0x36')][_0x017a('0x38')]?_0x402f46[_0x017a('0x36')]:_0x34ee05[_0x017a('0x31')];if(!_0x2ecadf[_0x017a('0x32')][_0x017a('0x39')](_0x017a('0x3a'))){_0x402f46[_0x017a('0x1f')]=qs[_0x017a('0x1f')](_0x2ecadf[_0x017a('0x32')][_0x017a('0x1f')]);_0x402f46[_0x017a('0x1d')]=qs[_0x017a('0x1d')](_0x2ecadf[_0x017a('0x32')][_0x017a('0x1d')]);}_0x402f46[_0x017a('0x3b')]=qs[_0x017a('0x3c')](_0x2ecadf[_0x017a('0x32')]['sort']);_0x402f46[_0x017a('0x3d')]=qs['filters'](_[_0x017a('0x3e')](_0x2ecadf[_0x017a('0x32')],_0x34ee05['filters']),_0x5e86b8);if(_0x2ecadf[_0x017a('0x32')][_0x017a('0x3f')]){_0x402f46[_0x017a('0x3d')]=_[_0x017a('0x40')](_0x402f46[_0x017a('0x3d')],{'$or':_[_0x017a('0x2d')](_0x5e86b8,function(_0x102c38){if(_0x102c38[_0x017a('0x30')]!=='VIRTUAL'){var _0x17cdcf={};_0x17cdcf[_0x102c38[_0x017a('0x2a')]]={'$like':'%'+_0x2ecadf[_0x017a('0x32')]['filter']+'%'};return _0x17cdcf;}})});}_0x402f46=_[_0x017a('0x40')]({},_0x402f46,_0x2ecadf['options']);var _0x292e9d={'where':_0x402f46[_0x017a('0x3d')]};return db[_0x017a('0x41')]['count'](_0x292e9d)[_0x017a('0x26')](function(_0x5bffee){_0x16a334[_0x017a('0x20')]=_0x5bffee;if(_0x2ecadf[_0x017a('0x32')]['includeAll']){_0x402f46[_0x017a('0x42')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x017a('0x43')](_0x402f46);})[_0x017a('0x26')](function(_0x5c02f9){_0x16a334[_0x017a('0x44')]=_0x5c02f9;return _0x16a334;})[_0x017a('0x26')](respondWithFilteredResult(_0x59058a,_0x402f46))[_0x017a('0x45')](handleError(_0x59058a,null));};exports[_0x017a('0x46')]=function(_0x3dbc8b,_0x274e2a){var _0x26e2c8={'raw':!![],'where':{'id':_0x3dbc8b[_0x017a('0x47')]['id']}},_0x2c7c9c={};_0x2c7c9c['model']=_['keys'](db[_0x017a('0x41')]['rawAttributes']);_0x2c7c9c[_0x017a('0x32')]=_[_0x017a('0x33')](_0x3dbc8b[_0x017a('0x32')]);_0x2c7c9c['filters']=_[_0x017a('0x35')](_0x2c7c9c['model'],_0x2c7c9c[_0x017a('0x32')]);_0x26e2c8[_0x017a('0x36')]=_[_0x017a('0x35')](_0x2c7c9c['model'],qs[_0x017a('0x37')](_0x3dbc8b[_0x017a('0x32')][_0x017a('0x37')]));_0x26e2c8[_0x017a('0x36')]=_0x26e2c8[_0x017a('0x36')]['length']?_0x26e2c8[_0x017a('0x36')]:_0x2c7c9c['model'];if(_0x3dbc8b['query'][_0x017a('0x48')]){_0x26e2c8[_0x017a('0x42')]=[{'all':!![]}];}_0x26e2c8=_[_0x017a('0x40')]({},_0x26e2c8,_0x3dbc8b[_0x017a('0x49')]);return db[_0x017a('0x41')]['find'](_0x26e2c8)[_0x017a('0x26')](handleEntityNotFound(_0x274e2a,null))[_0x017a('0x26')](respondWithResult(_0x274e2a,null))[_0x017a('0x45')](handleError(_0x274e2a,null));};exports['create']=function(_0x12eb84,_0x307645){return db[_0x017a('0x41')]['create'](_0x12eb84[_0x017a('0x4a')],{})[_0x017a('0x26')](respondWithResult(_0x307645,0xc9))[_0x017a('0x45')](handleError(_0x307645,null));};exports[_0x017a('0x24')]=function(_0x172947,_0x2d6e34){if(_0x172947[_0x017a('0x4a')]['id']){delete _0x172947[_0x017a('0x4a')]['id'];}return db[_0x017a('0x41')][_0x017a('0x4b')]({'where':{'id':_0x172947['params']['id']}})['then'](handleEntityNotFound(_0x2d6e34,null))[_0x017a('0x26')](saveUpdates(_0x172947[_0x017a('0x4a')],null))[_0x017a('0x26')](respondWithResult(_0x2d6e34,null))[_0x017a('0x45')](handleError(_0x2d6e34,null));};exports[_0x017a('0x25')]=function(_0x2b7889,_0x28df7e){return db[_0x017a('0x41')][_0x017a('0x4b')]({'where':{'id':_0x2b7889[_0x017a('0x47')]['id']}})[_0x017a('0x26')](handleEntityNotFound(_0x28df7e,null))['then'](removeEntity(_0x28df7e,null))[_0x017a('0x45')](handleError(_0x28df7e,null));}; \ No newline at end of file +var _0xbd83=['../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','end','stack','name','send','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','merge','map','filter','options','include','findAll','rows','show','params','find','create','catch','body','destroy','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x584df7,_0x4a1286){var _0x1214e4=function(_0x5083c1){while(--_0x5083c1){_0x584df7['push'](_0x584df7['shift']());}};_0x1214e4(++_0x4a1286);}(_0xbd83,0xca));var _0x3bd8=function(_0x4702ee,_0xaf6a45){_0x4702ee=_0x4702ee-0x0;var _0x62ca7d=_0xbd83[_0x4702ee];return _0x62ca7d;};'use strict';var emlformat=require(_0x3bd8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3bd8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3bd8('0x2'));var moment=require(_0x3bd8('0x3'));var BPromise=require(_0x3bd8('0x4'));var Mustache=require(_0x3bd8('0x5'));var util=require(_0x3bd8('0x6'));var path=require('path');var sox=require(_0x3bd8('0x7'));var csv=require(_0x3bd8('0x8'));var ejs=require(_0x3bd8('0x9'));var fs=require('fs');var fs_extra=require(_0x3bd8('0xa'));var _=require(_0x3bd8('0xb'));var squel=require(_0x3bd8('0xc'));var crypto=require(_0x3bd8('0xd'));var jsforce=require(_0x3bd8('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3bd8('0x8'));var querystring=require(_0x3bd8('0xf'));var Papa=require('papaparse');var Redis=require(_0x3bd8('0x10'));var authService=require(_0x3bd8('0x11'));var qs=require(_0x3bd8('0x12'));var as=require(_0x3bd8('0x13'));var hardwareService=require(_0x3bd8('0x14'));var logger=require('../../config/logger')(_0x3bd8('0x15'));var utils=require(_0x3bd8('0x16'));var config=require(_0x3bd8('0x17'));var licenseUtil=require(_0x3bd8('0x18'));var db=require(_0x3bd8('0x19'))['db'];function respondWithStatusCode(_0x3ecd0d,_0x4eff0a){_0x4eff0a=_0x4eff0a||0xcc;return function(_0x4b5ae2){if(_0x4b5ae2){return _0x3ecd0d[_0x3bd8('0x1a')](_0x4eff0a);}return _0x3ecd0d[_0x3bd8('0x1b')](_0x4eff0a)['end']();};}function respondWithResult(_0x370d25,_0x597794){_0x597794=_0x597794||0xc8;return function(_0x1a31b3){if(_0x1a31b3){return _0x370d25[_0x3bd8('0x1b')](_0x597794)[_0x3bd8('0x1c')](_0x1a31b3);}};}function respondWithFilteredResult(_0x509f2a,_0x42a424){return function(_0x18d1ca){if(_0x18d1ca){var _0x204b2e=typeof _0x42a424[_0x3bd8('0x1d')]==='undefined'&&typeof _0x42a424[_0x3bd8('0x1e')]===_0x3bd8('0x1f');var _0x55be13=_0x18d1ca[_0x3bd8('0x20')];var _0x4d81d0=_0x204b2e?0x0:_0x42a424['offset'];var _0x2a123b=_0x204b2e?_0x18d1ca[_0x3bd8('0x20')]:_0x42a424[_0x3bd8('0x1d')]+_0x42a424[_0x3bd8('0x1e')];var _0x7478d4;if(_0x2a123b>=_0x55be13){_0x2a123b=_0x55be13;_0x7478d4=0xc8;}else{_0x7478d4=0xce;}_0x509f2a[_0x3bd8('0x1b')](_0x7478d4);return _0x509f2a[_0x3bd8('0x21')](_0x3bd8('0x22'),_0x4d81d0+'-'+_0x2a123b+'/'+_0x55be13)[_0x3bd8('0x1c')](_0x18d1ca);}return null;};}function patchUpdates(_0xb8eb39){return function(_0x3b1de4){try{jsonpatch[_0x3bd8('0x23')](_0x3b1de4,_0xb8eb39,!![]);}catch(_0x33ca97){return BPromise[_0x3bd8('0x24')](_0x33ca97);}return _0x3b1de4['save']();};}function saveUpdates(_0x884b49,_0x193c6e){return function(_0x305901){if(_0x305901){return _0x305901[_0x3bd8('0x25')](_0x884b49)[_0x3bd8('0x26')](function(_0x232300){return _0x232300;});}return null;};}function removeEntity(_0x3795e0,_0x162ebb){return function(_0xa31f02){if(_0xa31f02){return _0xa31f02['destroy']()[_0x3bd8('0x26')](function(){_0x3795e0[_0x3bd8('0x1b')](0xcc)[_0x3bd8('0x27')]();});}};}function handleEntityNotFound(_0x249c59,_0x4e40d5){return function(_0x3dc864){if(!_0x3dc864){_0x249c59[_0x3bd8('0x1a')](0x194);}return _0x3dc864;};}function handleError(_0x437e97,_0x51cf3c){_0x51cf3c=_0x51cf3c||0x1f4;return function(_0x36ccbd){logger['error'](_0x36ccbd[_0x3bd8('0x28')]);if(_0x36ccbd[_0x3bd8('0x29')]){delete _0x36ccbd[_0x3bd8('0x29')];}_0x437e97[_0x3bd8('0x1b')](_0x51cf3c)[_0x3bd8('0x2a')](_0x36ccbd);};}exports['index']=function(_0x307cfc,_0x353e9c){var _0x403b01={},_0x462876={},_0x46d34f={'count':0x0,'rows':[]};var _0x4413b9=_['map'](db[_0x3bd8('0x2b')][_0x3bd8('0x2c')],function(_0x5a2958){return{'name':_0x5a2958[_0x3bd8('0x2d')],'type':_0x5a2958[_0x3bd8('0x2e')][_0x3bd8('0x2f')]};});_0x462876[_0x3bd8('0x30')]=_['map'](_0x4413b9,_0x3bd8('0x29'));_0x462876[_0x3bd8('0x31')]=_[_0x3bd8('0x32')](_0x307cfc[_0x3bd8('0x31')]);_0x462876[_0x3bd8('0x33')]=_[_0x3bd8('0x34')](_0x462876[_0x3bd8('0x30')],_0x462876[_0x3bd8('0x31')]);_0x403b01[_0x3bd8('0x35')]=_[_0x3bd8('0x34')](_0x462876['model'],qs[_0x3bd8('0x36')](_0x307cfc[_0x3bd8('0x31')][_0x3bd8('0x36')]));_0x403b01[_0x3bd8('0x35')]=_0x403b01['attributes'][_0x3bd8('0x37')]?_0x403b01['attributes']:_0x462876[_0x3bd8('0x30')];if(!_0x307cfc['query']['hasOwnProperty'](_0x3bd8('0x38'))){_0x403b01[_0x3bd8('0x1e')]=qs['limit'](_0x307cfc[_0x3bd8('0x31')]['limit']);_0x403b01[_0x3bd8('0x1d')]=qs[_0x3bd8('0x1d')](_0x307cfc[_0x3bd8('0x31')][_0x3bd8('0x1d')]);}_0x403b01[_0x3bd8('0x39')]=qs[_0x3bd8('0x3a')](_0x307cfc['query'][_0x3bd8('0x3a')]);_0x403b01[_0x3bd8('0x3b')]=qs[_0x3bd8('0x33')](_['pick'](_0x307cfc[_0x3bd8('0x31')],_0x462876[_0x3bd8('0x33')]),_0x4413b9);if(_0x307cfc[_0x3bd8('0x31')]['filter']){_0x403b01[_0x3bd8('0x3b')]=_[_0x3bd8('0x3c')](_0x403b01[_0x3bd8('0x3b')],{'$or':_[_0x3bd8('0x3d')](_0x4413b9,function(_0x41e679){if(_0x41e679[_0x3bd8('0x2e')]!=='VIRTUAL'){var _0x572c6a={};_0x572c6a[_0x41e679[_0x3bd8('0x29')]]={'$like':'%'+_0x307cfc[_0x3bd8('0x31')][_0x3bd8('0x3e')]+'%'};return _0x572c6a;}})});}_0x403b01=_[_0x3bd8('0x3c')]({},_0x403b01,_0x307cfc[_0x3bd8('0x3f')]);var _0x36f425={'where':_0x403b01[_0x3bd8('0x3b')]};return db[_0x3bd8('0x2b')][_0x3bd8('0x20')](_0x36f425)['then'](function(_0x13ca34){_0x46d34f[_0x3bd8('0x20')]=_0x13ca34;if(_0x307cfc[_0x3bd8('0x31')]['includeAll']){_0x403b01[_0x3bd8('0x40')]=[{'all':!![]}];}return db[_0x3bd8('0x2b')][_0x3bd8('0x41')](_0x403b01);})[_0x3bd8('0x26')](function(_0x476645){_0x46d34f[_0x3bd8('0x42')]=_0x476645;return _0x46d34f;})[_0x3bd8('0x26')](respondWithFilteredResult(_0x353e9c,_0x403b01))['catch'](handleError(_0x353e9c,null));};exports[_0x3bd8('0x43')]=function(_0x1e39a7,_0x257435){var _0x553da0={'raw':!![],'where':{'id':_0x1e39a7[_0x3bd8('0x44')]['id']}},_0x647bc8={};_0x647bc8[_0x3bd8('0x30')]=_[_0x3bd8('0x32')](db[_0x3bd8('0x2b')][_0x3bd8('0x2c')]);_0x647bc8['query']=_[_0x3bd8('0x32')](_0x1e39a7[_0x3bd8('0x31')]);_0x647bc8[_0x3bd8('0x33')]=_[_0x3bd8('0x34')](_0x647bc8[_0x3bd8('0x30')],_0x647bc8[_0x3bd8('0x31')]);_0x553da0['attributes']=_[_0x3bd8('0x34')](_0x647bc8[_0x3bd8('0x30')],qs[_0x3bd8('0x36')](_0x1e39a7[_0x3bd8('0x31')][_0x3bd8('0x36')]));_0x553da0[_0x3bd8('0x35')]=_0x553da0[_0x3bd8('0x35')][_0x3bd8('0x37')]?_0x553da0['attributes']:_0x647bc8[_0x3bd8('0x30')];if(_0x1e39a7['query']['includeAll']){_0x553da0[_0x3bd8('0x40')]=[{'all':!![]}];}_0x553da0=_['merge']({},_0x553da0,_0x1e39a7['options']);return db[_0x3bd8('0x2b')][_0x3bd8('0x45')](_0x553da0)[_0x3bd8('0x26')](handleEntityNotFound(_0x257435,null))['then'](respondWithResult(_0x257435,null))['catch'](handleError(_0x257435,null));};exports[_0x3bd8('0x46')]=function(_0x5a9e84,_0x501b43){return db['AnalyticTreeReport']['create'](_0x5a9e84['body'],{})['then'](respondWithResult(_0x501b43,0xc9))[_0x3bd8('0x47')](handleError(_0x501b43,null));};exports[_0x3bd8('0x25')]=function(_0x243a57,_0x150f11){if(_0x243a57[_0x3bd8('0x48')]['id']){delete _0x243a57['body']['id'];}return db[_0x3bd8('0x2b')]['find']({'where':{'id':_0x243a57['params']['id']}})[_0x3bd8('0x26')](handleEntityNotFound(_0x150f11,null))['then'](saveUpdates(_0x243a57['body'],null))[_0x3bd8('0x26')](respondWithResult(_0x150f11,null))[_0x3bd8('0x47')](handleError(_0x150f11,null));};exports[_0x3bd8('0x49')]=function(_0x42f56e,_0x144a94){return db[_0x3bd8('0x2b')][_0x3bd8('0x45')]({'where':{'id':_0x42f56e[_0x3bd8('0x44')]['id']}})[_0x3bd8('0x26')](handleEntityNotFound(_0x144a94,null))['then'](removeEntity(_0x144a94,null))[_0x3bd8('0x47')](handleError(_0x144a94,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index e05e6ce..7adc7a5 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 _0x4f82=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util'];(function(_0x3ec3f8,_0x204b4d){var _0x1b5ea9=function(_0x3ea871){while(--_0x3ea871){_0x3ec3f8['push'](_0x3ec3f8['shift']());}};_0x1b5ea9(++_0x204b4d);}(_0x4f82,0x150));var _0x24f8=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x4f82[_0x5f09c5];return _0x426ad9;};'use strict';var _=require(_0x24f8('0x0'));var util=require(_0x24f8('0x1'));var logger=require(_0x24f8('0x2'))(_0x24f8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x24f8('0x4'));var fs=require('fs');var path=require(_0x24f8('0x5'));var rimraf=require(_0x24f8('0x6'));var config=require(_0x24f8('0x7'));var attributes=require(_0x24f8('0x8'));module[_0x24f8('0x9')]=function(_0x164b7f,_0x178874){return _0x164b7f[_0x24f8('0xa')](_0x24f8('0xb'),attributes,{'tableName':_0x24f8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe546=['../../config/environment','exports','define','lodash','util','api','moment','path','rimraf'];(function(_0x54f3f3,_0x24a9fe){var _0x332b9d=function(_0x1509f8){while(--_0x1509f8){_0x54f3f3['push'](_0x54f3f3['shift']());}};_0x332b9d(++_0x24a9fe);}(_0xe546,0x1a1));var _0x6e54=function(_0x511b37,_0x3851a9){_0x511b37=_0x511b37-0x0;var _0x136192=_0xe546[_0x511b37];return _0x136192;};'use strict';var _=require(_0x6e54('0x0'));var util=require(_0x6e54('0x1'));var logger=require('../../config/logger')(_0x6e54('0x2'));var moment=require(_0x6e54('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6e54('0x4'));var rimraf=require(_0x6e54('0x5'));var config=require(_0x6e54('0x6'));var attributes=require('./analyticTreeReport.attributes');module[_0x6e54('0x7')]=function(_0x3d36aa,_0x11c3e1){return _0x3d36aa[_0x6e54('0x8')]('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','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 ff1b42c..156f69f 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 _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x1fd005,_0x36a6ea){var _0x28a20f=function(_0x2914bb){while(--_0x2914bb){_0x1fd005['push'](_0x1fd005['shift']());}};_0x28a20f(++_0x36a6ea);}(_0x5f2f,0x73));var _0xf5f2=function(_0x157502,_0x341c57){_0x157502=_0x157502-0x0;var _0xaea93a=_0x5f2f[_0x157502];return _0xaea93a;};'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')]('AnalyticTreeReport,\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 +var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x2cc4e1,_0x32997c){var _0xc5cf1=function(_0x2d8fae){while(--_0x2d8fae){_0x2cc4e1['push'](_0x2cc4e1['shift']());}};_0xc5cf1(++_0x32997c);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5d7233,_0x27f897){_0x5d7233=_0x5d7233-0x0;var _0x8476fe=_0x5f2f[_0x5d7233];return _0x8476fe;};'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')]('AnalyticTreeReport,\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/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 0757a91..645cb6e 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 _0xcbec=['isAuthenticated','show','post','create','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','get','/:id'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0xcbec,0xbc));var _0xccbe=function(_0x8eac2f,_0x5f08e){_0x8eac2f=_0x8eac2f-0x0;var _0x5f5cd9=_0xcbec[_0x8eac2f];return _0x5f5cd9;};'use strict';var multer=require(_0xccbe('0x0'));var util=require(_0xccbe('0x1'));var path=require('path');var timeout=require(_0xccbe('0x2'));var express=require(_0xccbe('0x3'));var router=express[_0xccbe('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xccbe('0x5'));var interaction=require(_0xccbe('0x6'));var config=require('../../config/environment');var controller=require(_0xccbe('0x7'));router[_0xccbe('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xccbe('0x8')](_0xccbe('0x9'),auth[_0xccbe('0xa')](),controller[_0xccbe('0xb')]);router[_0xccbe('0xc')]('/',auth[_0xccbe('0xa')](),controller[_0xccbe('0xd')]);router['put'](_0xccbe('0x9'),auth[_0xccbe('0xa')](),controller[_0xccbe('0xe')]);router[_0xccbe('0xf')](_0xccbe('0x9'),auth[_0xccbe('0xa')](),controller[_0xccbe('0x10')]);module[_0xccbe('0x11')]=router; \ No newline at end of file +var _0xdf87=['../../config/environment','isAuthenticated','get','/:id','show','create','put','update','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x27345c,_0x1bf8e8){var _0x31315f=function(_0xfae559){while(--_0xfae559){_0x27345c['push'](_0x27345c['shift']());}};_0x31315f(++_0x1bf8e8);}(_0xdf87,0x9a));var _0x7df8=function(_0x238a01,_0x5b962b){_0x238a01=_0x238a01-0x0;var _0x460802=_0xdf87[_0x238a01];return _0x460802;};'use strict';var multer=require(_0x7df8('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x7df8('0x1'));var express=require('express');var router=express[_0x7df8('0x2')]();var fs_extra=require(_0x7df8('0x3'));var auth=require(_0x7df8('0x4'));var interaction=require(_0x7df8('0x5'));var config=require(_0x7df8('0x6'));var controller=require('./analyticTreeReport.controller');router['get']('/',auth[_0x7df8('0x7')](),controller['index']);router[_0x7df8('0x8')](_0x7df8('0x9'),auth[_0x7df8('0x7')](),controller[_0x7df8('0xa')]);router['post']('/',auth[_0x7df8('0x7')](),controller[_0x7df8('0xb')]);router[_0x7df8('0xc')](_0x7df8('0x9'),auth[_0x7df8('0x7')](),controller[_0x7df8('0xd')]);router['delete'](_0x7df8('0x9'),auth['isAuthenticated'](),controller[_0x7df8('0xe')]);module[_0x7df8('0xf')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index c48fe48..2b46d48 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 _0x192f=['sequelize','STRING'];(function(_0x308c66,_0x470c1d){var _0x27d468=function(_0x1f66cb){while(--_0x1f66cb){_0x308c66['push'](_0x308c66['shift']());}};_0x27d468(++_0x470c1d);}(_0x192f,0xd6));var _0xf192=function(_0x344dca,_0x4123f9){_0x344dca=_0x344dca-0x0;var _0x2e1ac6=_0x192f[_0x344dca];return _0x2e1ac6;};'use strict';var Sequelize=require(_0xf192('0x0'));module['exports']={'name':{'type':Sequelize[_0xf192('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xf192('0x1')]}}; \ No newline at end of file +var _0x28aa=['exports','STRING'];(function(_0x31d895,_0x1fe275){var _0x246ce4=function(_0x19055f){while(--_0x19055f){_0x31d895['push'](_0x31d895['shift']());}};_0x246ce4(++_0x1fe275);}(_0x28aa,0xf8));var _0xa28a=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x28aa[_0x5d4607];return _0x5e4a86;};'use strict';var Sequelize=require('sequelize');module[_0xa28a('0x0')]={'name':{'type':Sequelize[_0xa28a('0x1')]},'basename':{'type':Sequelize[_0xa28a('0x1')]},'type':{'type':Sequelize[_0xa28a('0x1')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index c830ee5..05771f7 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 _0xb17b=['api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject','update','destroy','then','error','name','send','map','Attachment','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','find','clone','params','get','omit','createdAt','body','updatedAt','create','file','basename','mimetype','download','findOne','ChatOfflineMessageId','join','server/files/attachments/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xb17b,0x1e9));var _0xbb17=function(_0x5e991b,_0x10d8e3){_0x5e991b=_0x5e991b-0x0;var _0x15370b=_0xb17b[_0x5e991b];return _0x15370b;};'use strict';var emlformat=require(_0xbb17('0x0'));var rimraf=require(_0xbb17('0x1'));var zipdir=require(_0xbb17('0x2'));var jsonpatch=require(_0xbb17('0x3'));var rp=require(_0xbb17('0x4'));var moment=require(_0xbb17('0x5'));var BPromise=require(_0xbb17('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xbb17('0x7'));var sox=require(_0xbb17('0x8'));var csv=require(_0xbb17('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb17('0xa'));var _=require(_0xbb17('0xb'));var squel=require(_0xbb17('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xbb17('0xd'));var toCsv=require(_0xbb17('0x9'));var querystring=require(_0xbb17('0xe'));var Papa=require(_0xbb17('0xf'));var Redis=require(_0xbb17('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xbb17('0x11'));var as=require(_0xbb17('0x12'));var hardwareService=require(_0xbb17('0x13'));var logger=require(_0xbb17('0x14'))(_0xbb17('0x15'));var utils=require(_0xbb17('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xbb17('0x17'));var db=require(_0xbb17('0x18'))['db'];function respondWithStatusCode(_0x1ec520,_0x10b0a3){_0x10b0a3=_0x10b0a3||0xcc;return function(_0x49046c){if(_0x49046c){return _0x1ec520[_0xbb17('0x19')](_0x10b0a3);}return _0x1ec520[_0xbb17('0x1a')](_0x10b0a3)['end']();};}function respondWithResult(_0xef44fe,_0x8b5218){_0x8b5218=_0x8b5218||0xc8;return function(_0x203103){if(_0x203103){return _0xef44fe[_0xbb17('0x1a')](_0x8b5218)[_0xbb17('0x1b')](_0x203103);}};}function respondWithFilteredResult(_0x3e9b34,_0x2243fc){return function(_0x5731e1){if(_0x5731e1){var _0x3b00ba=typeof _0x2243fc['offset']===_0xbb17('0x1c')&&typeof _0x2243fc[_0xbb17('0x1d')]===_0xbb17('0x1c');var _0x30a08a=_0x5731e1[_0xbb17('0x1e')];var _0x125953=_0x3b00ba?0x0:_0x2243fc['offset'];var _0x5c60b5=_0x3b00ba?_0x5731e1[_0xbb17('0x1e')]:_0x2243fc[_0xbb17('0x1f')]+_0x2243fc[_0xbb17('0x1d')];var _0x5d5eaf;if(_0x5c60b5>=_0x30a08a){_0x5c60b5=_0x30a08a;_0x5d5eaf=0xc8;}else{_0x5d5eaf=0xce;}_0x3e9b34[_0xbb17('0x1a')](_0x5d5eaf);return _0x3e9b34['set'](_0xbb17('0x20'),_0x125953+'-'+_0x5c60b5+'/'+_0x30a08a)[_0xbb17('0x1b')](_0x5731e1);}return null;};}function patchUpdates(_0x581951){return function(_0x405f22){try{jsonpatch[_0xbb17('0x21')](_0x405f22,_0x581951,!![]);}catch(_0x38c99e){return BPromise[_0xbb17('0x22')](_0x38c99e);}return _0x405f22['save']();};}function saveUpdates(_0x2fabcd,_0x559831){return function(_0x293ce8){if(_0x293ce8){return _0x293ce8[_0xbb17('0x23')](_0x2fabcd)['then'](function(_0x49c0df){return _0x49c0df;});}return null;};}function removeEntity(_0x4e2216,_0x45c90c){return function(_0x15a621){if(_0x15a621){return _0x15a621[_0xbb17('0x24')]()[_0xbb17('0x25')](function(){_0x4e2216[_0xbb17('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a3c5a,_0x226303){return function(_0x526419){if(!_0x526419){_0x1a3c5a[_0xbb17('0x19')](0x194);}return _0x526419;};}function handleError(_0x2804be,_0x2d2eb3){_0x2d2eb3=_0x2d2eb3||0x1f4;return function(_0x5263da){logger[_0xbb17('0x26')](_0x5263da['stack']);if(_0x5263da[_0xbb17('0x27')]){delete _0x5263da['name'];}_0x2804be[_0xbb17('0x1a')](_0x2d2eb3)[_0xbb17('0x28')](_0x5263da);};}exports['index']=function(_0x515c57,_0x9b90e7){var _0x9f06e0={},_0x25dddc={},_0x4ae218={'count':0x0,'rows':[]};var _0xfa6f72=_[_0xbb17('0x29')](db[_0xbb17('0x2a')][_0xbb17('0x2b')],function(_0x553353){return{'name':_0x553353['fieldName'],'type':_0x553353[_0xbb17('0x2c')][_0xbb17('0x2d')]};});_0x25dddc[_0xbb17('0x2e')]=_['map'](_0xfa6f72,_0xbb17('0x27'));_0x25dddc[_0xbb17('0x2f')]=_[_0xbb17('0x30')](_0x515c57['query']);_0x25dddc['filters']=_['intersection'](_0x25dddc[_0xbb17('0x2e')],_0x25dddc[_0xbb17('0x2f')]);_0x9f06e0['attributes']=_[_0xbb17('0x31')](_0x25dddc[_0xbb17('0x2e')],qs[_0xbb17('0x32')](_0x515c57[_0xbb17('0x2f')][_0xbb17('0x32')]));_0x9f06e0[_0xbb17('0x33')]=_0x9f06e0['attributes'][_0xbb17('0x34')]?_0x9f06e0[_0xbb17('0x33')]:_0x25dddc[_0xbb17('0x2e')];if(!_0x515c57[_0xbb17('0x2f')][_0xbb17('0x35')]('nolimit')){_0x9f06e0[_0xbb17('0x1d')]=qs[_0xbb17('0x1d')](_0x515c57[_0xbb17('0x2f')]['limit']);_0x9f06e0[_0xbb17('0x1f')]=qs[_0xbb17('0x1f')](_0x515c57[_0xbb17('0x2f')]['offset']);}_0x9f06e0[_0xbb17('0x36')]=qs['sort'](_0x515c57[_0xbb17('0x2f')][_0xbb17('0x37')]);_0x9f06e0['where']=qs[_0xbb17('0x38')](_[_0xbb17('0x39')](_0x515c57[_0xbb17('0x2f')],_0x25dddc[_0xbb17('0x38')]),_0xfa6f72);if(_0x515c57[_0xbb17('0x2f')][_0xbb17('0x3a')]){_0x9f06e0[_0xbb17('0x3b')]=_[_0xbb17('0x3c')](_0x9f06e0[_0xbb17('0x3b')],{'$or':_['map'](_0xfa6f72,function(_0x2c2e4d){if(_0x2c2e4d['type']!=='VIRTUAL'){var _0x426de7={};_0x426de7[_0x2c2e4d[_0xbb17('0x27')]]={'$like':'%'+_0x515c57[_0xbb17('0x2f')][_0xbb17('0x3a')]+'%'};return _0x426de7;}})});}_0x9f06e0=_['merge']({},_0x9f06e0,_0x515c57[_0xbb17('0x3d')]);var _0x3a8467={'where':_0x9f06e0['where']};return db[_0xbb17('0x2a')][_0xbb17('0x1e')](_0x3a8467)['then'](function(_0x561ebd){_0x4ae218[_0xbb17('0x1e')]=_0x561ebd;if(_0x515c57[_0xbb17('0x2f')][_0xbb17('0x3e')]){_0x9f06e0[_0xbb17('0x3f')]=[{'all':!![]}];}return db['Attachment'][_0xbb17('0x40')](_0x9f06e0);})[_0xbb17('0x25')](function(_0x4e5ae5){_0x4ae218[_0xbb17('0x41')]=_0x4e5ae5;return _0x4ae218;})[_0xbb17('0x25')](respondWithFilteredResult(_0x9b90e7,_0x9f06e0))[_0xbb17('0x42')](handleError(_0x9b90e7,null));};exports[_0xbb17('0x43')]=function(_0xb58c59,_0x2eb2b5){var _0x2f2af0={'raw':!![],'where':{'id':_0xb58c59['params']['id']}},_0x85dc2e={};_0x85dc2e[_0xbb17('0x2e')]=_[_0xbb17('0x30')](db['Attachment'][_0xbb17('0x2b')]);_0x85dc2e[_0xbb17('0x2f')]=_['keys'](_0xb58c59[_0xbb17('0x2f')]);_0x85dc2e['filters']=_[_0xbb17('0x31')](_0x85dc2e['model'],_0x85dc2e['query']);_0x2f2af0['attributes']=_['intersection'](_0x85dc2e[_0xbb17('0x2e')],qs[_0xbb17('0x32')](_0xb58c59[_0xbb17('0x2f')][_0xbb17('0x32')]));_0x2f2af0['attributes']=_0x2f2af0['attributes'][_0xbb17('0x34')]?_0x2f2af0['attributes']:_0x85dc2e['model'];if(_0xb58c59[_0xbb17('0x2f')][_0xbb17('0x3e')]){_0x2f2af0[_0xbb17('0x3f')]=[{'all':!![]}];}_0x2f2af0=_[_0xbb17('0x3c')]({},_0x2f2af0,_0xb58c59[_0xbb17('0x3d')]);return db[_0xbb17('0x2a')][_0xbb17('0x44')](_0x2f2af0)[_0xbb17('0x25')](handleEntityNotFound(_0x2eb2b5,null))[_0xbb17('0x25')](respondWithResult(_0x2eb2b5,null))[_0xbb17('0x42')](handleError(_0x2eb2b5,null));};exports[_0xbb17('0x45')]=function(_0x2d2751,_0x4b129b){var _0x10b54e={'where':{'id':_0x2d2751[_0xbb17('0x46')]['id']}},_0x4d59f0={};_0x4d59f0[_0xbb17('0x2e')]=_[_0xbb17('0x30')](db[_0xbb17('0x2a')][_0xbb17('0x2b')]);_0x10b54e[_0xbb17('0x33')]=_[_0xbb17('0x31')](_0x4d59f0[_0xbb17('0x2e')],qs[_0xbb17('0x32')](_0x2d2751['query'][_0xbb17('0x32')]));_0x10b54e[_0xbb17('0x33')]=_0x10b54e[_0xbb17('0x33')]['length']?_0x10b54e[_0xbb17('0x33')]:_0x4d59f0[_0xbb17('0x2e')];if(_0x2d2751[_0xbb17('0x2f')][_0xbb17('0x3e')]){_0x10b54e[_0xbb17('0x3f')]=[{'all':!![]}];}_0x10b54e=_['merge']({},_0x10b54e,_0x2d2751[_0xbb17('0x3d')]);return db[_0xbb17('0x2a')][_0xbb17('0x44')](_0x10b54e)[_0xbb17('0x25')](handleEntityNotFound(_0x4b129b,null))['then'](function(_0x1469b7){if(_0x1469b7){var _0x32c051=_0x1469b7[_0xbb17('0x47')]({'plain':!![]});_0x32c051=qs[_0xbb17('0x48')](_0x32c051,['id',_0xbb17('0x49'),'updatedAt']);_0x2d2751[_0xbb17('0x4a')]=_[_0xbb17('0x48')](_0x2d2751[_0xbb17('0x4a')],['id',_0xbb17('0x49'),_0xbb17('0x4b')]);return db[_0xbb17('0x2a')][_0xbb17('0x4c')](_[_0xbb17('0x3c')](_0x32c051,_0x2d2751[_0xbb17('0x4a')]),{'include':_0x2d2751[_0xbb17('0x2f')][_0xbb17('0x3e')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x4b129b,0xc9))[_0xbb17('0x42')](handleError(_0x4b129b,null));};exports[_0xbb17('0x23')]=function(_0xcd8700,_0x4e7684){if(_0xcd8700['body']['id']){delete _0xcd8700['body']['id'];}return db[_0xbb17('0x2a')][_0xbb17('0x44')]({'where':{'id':_0xcd8700[_0xbb17('0x46')]['id']}})[_0xbb17('0x25')](handleEntityNotFound(_0x4e7684,null))[_0xbb17('0x25')](saveUpdates(_0xcd8700[_0xbb17('0x4a')],null))[_0xbb17('0x25')](respondWithResult(_0x4e7684,null))['catch'](handleError(_0x4e7684,null));};exports[_0xbb17('0x24')]=function(_0x38f00f,_0xd7d398){return db[_0xbb17('0x2a')][_0xbb17('0x44')]({'where':{'id':_0x38f00f[_0xbb17('0x46')]['id']}})['then'](handleEntityNotFound(_0xd7d398,null))[_0xbb17('0x25')](removeEntity(_0xd7d398,null))[_0xbb17('0x42')](handleError(_0xd7d398,null));};exports[_0xbb17('0x4c')]=function(_0x4a8857,_0x592bd7,_0x3a6cd5){_0x4a8857['body'][_0xbb17('0x27')]=_0x4a8857[_0xbb17('0x4d')]['originalname'];_0x4a8857['body'][_0xbb17('0x4e')]=_0x4a8857[_0xbb17('0x4d')]['filename'];_0x4a8857[_0xbb17('0x4a')][_0xbb17('0x2c')]=_0x4a8857[_0xbb17('0x4d')][_0xbb17('0x4f')];return db[_0xbb17('0x2a')][_0xbb17('0x4c')](_0x4a8857[_0xbb17('0x4a')])[_0xbb17('0x25')](respondWithResult(_0x592bd7,0xc9))[_0xbb17('0x42')](handleError(_0x592bd7,null));};exports[_0xbb17('0x50')]=function(_0x495321,_0x23e1f0,_0x3df442){return db[_0xbb17('0x2a')][_0xbb17('0x51')]({'where':{'id':_0x495321[_0xbb17('0x46')]['id']},'raw':!![]})[_0xbb17('0x25')](handleEntityNotFound(_0x23e1f0,null))[_0xbb17('0x25')](function(_0x648bff){if(_0x648bff){var _0x4375df=_0x648bff[_0xbb17('0x52')]!==null;var _0x2a27b5=path[_0xbb17('0x53')](config['root'],_0xbb17('0x54'));if(_0x4375df){_0x2a27b5=path[_0xbb17('0x53')](_0x2a27b5,'offline-chat/');}var _0x133e6e=path[_0xbb17('0x53')](_0x2a27b5,_0x648bff[_0xbb17('0x4e')]);return _0x23e1f0[_0xbb17('0x50')](_0x133e6e);}})['catch'](handleError(_0x23e1f0,null));}; \ No newline at end of file +var _0x934d=['../../mysqldb','sendStatus','status','end','offset','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','map','Attachment','type','key','query','keys','model','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','length','find','catch','clone','get','updatedAt','body','omit','createdAt','create','originalname','basename','file','filename','mimetype','ChatOfflineMessageId','root','server/files/attachments/','join','download','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','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'];(function(_0x19aca8,_0x27d132){var _0x4b5b58=function(_0x1a2802){while(--_0x1a2802){_0x19aca8['push'](_0x19aca8['shift']());}};_0x4b5b58(++_0x27d132);}(_0x934d,0x154));var _0xd934=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0x934d[_0x2f1762];return _0x8ab21;};'use strict';var emlformat=require(_0xd934('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd934('0x1'));var jsonpatch=require(_0xd934('0x2'));var rp=require(_0xd934('0x3'));var moment=require(_0xd934('0x4'));var BPromise=require(_0xd934('0x5'));var Mustache=require(_0xd934('0x6'));var util=require(_0xd934('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xd934('0x8'));var ejs=require(_0xd934('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd934('0xa'));var squel=require(_0xd934('0xb'));var crypto=require('crypto');var jsforce=require(_0xd934('0xc'));var deskjs=require(_0xd934('0xd'));var toCsv=require(_0xd934('0x8'));var querystring=require(_0xd934('0xe'));var Papa=require(_0xd934('0xf'));var Redis=require(_0xd934('0x10'));var authService=require(_0xd934('0x11'));var qs=require(_0xd934('0x12'));var as=require(_0xd934('0x13'));var hardwareService=require(_0xd934('0x14'));var logger=require('../../config/logger')(_0xd934('0x15'));var utils=require(_0xd934('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xd934('0x17'));var db=require(_0xd934('0x18'))['db'];function respondWithStatusCode(_0x2b3878,_0x7345ee){_0x7345ee=_0x7345ee||0xcc;return function(_0x3048fc){if(_0x3048fc){return _0x2b3878[_0xd934('0x19')](_0x7345ee);}return _0x2b3878[_0xd934('0x1a')](_0x7345ee)[_0xd934('0x1b')]();};}function respondWithResult(_0x4cd2b3,_0x23da5d){_0x23da5d=_0x23da5d||0xc8;return function(_0x1ca8c0){if(_0x1ca8c0){return _0x4cd2b3[_0xd934('0x1a')](_0x23da5d)['json'](_0x1ca8c0);}};}function respondWithFilteredResult(_0x4c096f,_0x79cf9a){return function(_0x2867a8){if(_0x2867a8){var _0x1e8374=typeof _0x79cf9a[_0xd934('0x1c')]==='undefined'&&typeof _0x79cf9a[_0xd934('0x1d')]==='undefined';var _0x3e856f=_0x2867a8[_0xd934('0x1e')];var _0x1765ee=_0x1e8374?0x0:_0x79cf9a['offset'];var _0x3f54df=_0x1e8374?_0x2867a8[_0xd934('0x1e')]:_0x79cf9a[_0xd934('0x1c')]+_0x79cf9a[_0xd934('0x1d')];var _0x2ec49e;if(_0x3f54df>=_0x3e856f){_0x3f54df=_0x3e856f;_0x2ec49e=0xc8;}else{_0x2ec49e=0xce;}_0x4c096f['status'](_0x2ec49e);return _0x4c096f[_0xd934('0x1f')](_0xd934('0x20'),_0x1765ee+'-'+_0x3f54df+'/'+_0x3e856f)[_0xd934('0x21')](_0x2867a8);}return null;};}function patchUpdates(_0x1e9344){return function(_0x57461a){try{jsonpatch[_0xd934('0x22')](_0x57461a,_0x1e9344,!![]);}catch(_0x489c41){return BPromise[_0xd934('0x23')](_0x489c41);}return _0x57461a[_0xd934('0x24')]();};}function saveUpdates(_0x80e711,_0x4bac73){return function(_0x45a8e4){if(_0x45a8e4){return _0x45a8e4[_0xd934('0x25')](_0x80e711)[_0xd934('0x26')](function(_0x3aef75){return _0x3aef75;});}return null;};}function removeEntity(_0x4289ea,_0x2e6dbb){return function(_0x2dcdce){if(_0x2dcdce){return _0x2dcdce[_0xd934('0x27')]()[_0xd934('0x26')](function(){_0x4289ea[_0xd934('0x1a')](0xcc)[_0xd934('0x1b')]();});}};}function handleEntityNotFound(_0x4181a5,_0x26265d){return function(_0x1a4a1e){if(!_0x1a4a1e){_0x4181a5[_0xd934('0x19')](0x194);}return _0x1a4a1e;};}function handleError(_0x429280,_0x52ae87){_0x52ae87=_0x52ae87||0x1f4;return function(_0x47c2a0){logger['error'](_0x47c2a0[_0xd934('0x28')]);if(_0x47c2a0[_0xd934('0x29')]){delete _0x47c2a0[_0xd934('0x29')];}_0x429280[_0xd934('0x1a')](_0x52ae87)[_0xd934('0x2a')](_0x47c2a0);};}exports['index']=function(_0x1a3ea2,_0x2e078e){var _0x13bd53={},_0x4bb40a={},_0x47f098={'count':0x0,'rows':[]};var _0x23d56d=_[_0xd934('0x2b')](db[_0xd934('0x2c')]['rawAttributes'],function(_0x59a7a8){return{'name':_0x59a7a8['fieldName'],'type':_0x59a7a8[_0xd934('0x2d')][_0xd934('0x2e')]};});_0x4bb40a['model']=_['map'](_0x23d56d,'name');_0x4bb40a[_0xd934('0x2f')]=_[_0xd934('0x30')](_0x1a3ea2[_0xd934('0x2f')]);_0x4bb40a['filters']=_['intersection'](_0x4bb40a[_0xd934('0x31')],_0x4bb40a['query']);_0x13bd53['attributes']=_[_0xd934('0x32')](_0x4bb40a[_0xd934('0x31')],qs[_0xd934('0x33')](_0x1a3ea2[_0xd934('0x2f')][_0xd934('0x33')]));_0x13bd53[_0xd934('0x34')]=_0x13bd53[_0xd934('0x34')]['length']?_0x13bd53[_0xd934('0x34')]:_0x4bb40a[_0xd934('0x31')];if(!_0x1a3ea2[_0xd934('0x2f')][_0xd934('0x35')](_0xd934('0x36'))){_0x13bd53['limit']=qs[_0xd934('0x1d')](_0x1a3ea2[_0xd934('0x2f')]['limit']);_0x13bd53[_0xd934('0x1c')]=qs[_0xd934('0x1c')](_0x1a3ea2[_0xd934('0x2f')][_0xd934('0x1c')]);}_0x13bd53[_0xd934('0x37')]=qs['sort'](_0x1a3ea2[_0xd934('0x2f')][_0xd934('0x38')]);_0x13bd53[_0xd934('0x39')]=qs[_0xd934('0x3a')](_[_0xd934('0x3b')](_0x1a3ea2[_0xd934('0x2f')],_0x4bb40a[_0xd934('0x3a')]),_0x23d56d);if(_0x1a3ea2['query'][_0xd934('0x3c')]){_0x13bd53[_0xd934('0x39')]=_[_0xd934('0x3d')](_0x13bd53[_0xd934('0x39')],{'$or':_['map'](_0x23d56d,function(_0x8f6d21){if(_0x8f6d21['type']!==_0xd934('0x3e')){var _0x16e988={};_0x16e988[_0x8f6d21[_0xd934('0x29')]]={'$like':'%'+_0x1a3ea2['query'][_0xd934('0x3c')]+'%'};return _0x16e988;}})});}_0x13bd53=_[_0xd934('0x3d')]({},_0x13bd53,_0x1a3ea2[_0xd934('0x3f')]);var _0xc8556={'where':_0x13bd53[_0xd934('0x39')]};return db[_0xd934('0x2c')]['count'](_0xc8556)[_0xd934('0x26')](function(_0x4864a9){_0x47f098[_0xd934('0x1e')]=_0x4864a9;if(_0x1a3ea2[_0xd934('0x2f')][_0xd934('0x40')]){_0x13bd53[_0xd934('0x41')]=[{'all':!![]}];}return db['Attachment'][_0xd934('0x42')](_0x13bd53);})[_0xd934('0x26')](function(_0x385593){_0x47f098[_0xd934('0x43')]=_0x385593;return _0x47f098;})[_0xd934('0x26')](respondWithFilteredResult(_0x2e078e,_0x13bd53))['catch'](handleError(_0x2e078e,null));};exports[_0xd934('0x44')]=function(_0x437068,_0x3d6349){var _0x4cde12={'raw':!![],'where':{'id':_0x437068[_0xd934('0x45')]['id']}},_0x85c187={};_0x85c187[_0xd934('0x31')]=_[_0xd934('0x30')](db['Attachment'][_0xd934('0x46')]);_0x85c187['query']=_[_0xd934('0x30')](_0x437068[_0xd934('0x2f')]);_0x85c187['filters']=_[_0xd934('0x32')](_0x85c187[_0xd934('0x31')],_0x85c187['query']);_0x4cde12[_0xd934('0x34')]=_[_0xd934('0x32')](_0x85c187[_0xd934('0x31')],qs['fields'](_0x437068['query'][_0xd934('0x33')]));_0x4cde12[_0xd934('0x34')]=_0x4cde12[_0xd934('0x34')][_0xd934('0x47')]?_0x4cde12['attributes']:_0x85c187[_0xd934('0x31')];if(_0x437068[_0xd934('0x2f')][_0xd934('0x40')]){_0x4cde12[_0xd934('0x41')]=[{'all':!![]}];}_0x4cde12=_[_0xd934('0x3d')]({},_0x4cde12,_0x437068[_0xd934('0x3f')]);return db['Attachment'][_0xd934('0x48')](_0x4cde12)[_0xd934('0x26')](handleEntityNotFound(_0x3d6349,null))['then'](respondWithResult(_0x3d6349,null))[_0xd934('0x49')](handleError(_0x3d6349,null));};exports[_0xd934('0x4a')]=function(_0x29359a,_0x2a0b0d){var _0x31006d={'where':{'id':_0x29359a[_0xd934('0x45')]['id']}},_0x396d92={};_0x396d92[_0xd934('0x31')]=_[_0xd934('0x30')](db['Attachment'][_0xd934('0x46')]);_0x31006d[_0xd934('0x34')]=_[_0xd934('0x32')](_0x396d92[_0xd934('0x31')],qs[_0xd934('0x33')](_0x29359a[_0xd934('0x2f')][_0xd934('0x33')]));_0x31006d['attributes']=_0x31006d['attributes']['length']?_0x31006d['attributes']:_0x396d92['model'];if(_0x29359a[_0xd934('0x2f')][_0xd934('0x40')]){_0x31006d[_0xd934('0x41')]=[{'all':!![]}];}_0x31006d=_['merge']({},_0x31006d,_0x29359a['options']);return db[_0xd934('0x2c')][_0xd934('0x48')](_0x31006d)[_0xd934('0x26')](handleEntityNotFound(_0x2a0b0d,null))[_0xd934('0x26')](function(_0x540135){if(_0x540135){var _0x1b93b7=_0x540135[_0xd934('0x4b')]({'plain':!![]});_0x1b93b7=qs['omit'](_0x1b93b7,['id','createdAt',_0xd934('0x4c')]);_0x29359a[_0xd934('0x4d')]=_[_0xd934('0x4e')](_0x29359a[_0xd934('0x4d')],['id',_0xd934('0x4f'),_0xd934('0x4c')]);return db['Attachment'][_0xd934('0x50')](_[_0xd934('0x3d')](_0x1b93b7,_0x29359a[_0xd934('0x4d')]),{'include':_0x29359a[_0xd934('0x2f')][_0xd934('0x40')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x2a0b0d,0xc9))[_0xd934('0x49')](handleError(_0x2a0b0d,null));};exports[_0xd934('0x25')]=function(_0x22aeee,_0x5aeee1){if(_0x22aeee[_0xd934('0x4d')]['id']){delete _0x22aeee[_0xd934('0x4d')]['id'];}return db[_0xd934('0x2c')][_0xd934('0x48')]({'where':{'id':_0x22aeee[_0xd934('0x45')]['id']}})[_0xd934('0x26')](handleEntityNotFound(_0x5aeee1,null))[_0xd934('0x26')](saveUpdates(_0x22aeee['body'],null))[_0xd934('0x26')](respondWithResult(_0x5aeee1,null))[_0xd934('0x49')](handleError(_0x5aeee1,null));};exports[_0xd934('0x27')]=function(_0x4c7a86,_0x33e113){return db[_0xd934('0x2c')]['find']({'where':{'id':_0x4c7a86[_0xd934('0x45')]['id']}})['then'](handleEntityNotFound(_0x33e113,null))[_0xd934('0x26')](removeEntity(_0x33e113,null))[_0xd934('0x49')](handleError(_0x33e113,null));};exports[_0xd934('0x50')]=function(_0x7719f1,_0x3b09cd,_0x2b8dc1){_0x7719f1['body'][_0xd934('0x29')]=_0x7719f1['file'][_0xd934('0x51')];_0x7719f1[_0xd934('0x4d')][_0xd934('0x52')]=_0x7719f1[_0xd934('0x53')][_0xd934('0x54')];_0x7719f1['body'][_0xd934('0x2d')]=_0x7719f1['file'][_0xd934('0x55')];return db[_0xd934('0x2c')][_0xd934('0x50')](_0x7719f1['body'])[_0xd934('0x26')](respondWithResult(_0x3b09cd,0xc9))[_0xd934('0x49')](handleError(_0x3b09cd,null));};exports['download']=function(_0x5aea60,_0x395c1b,_0x54a6a3){return db['Attachment']['findOne']({'where':{'id':_0x5aea60['params']['id']},'raw':!![]})[_0xd934('0x26')](handleEntityNotFound(_0x395c1b,null))[_0xd934('0x26')](function(_0x2cb5b0){if(_0x2cb5b0){var _0x1fcc7a=_0x2cb5b0[_0xd934('0x56')]!==null;var _0x114f5b=path['join'](config[_0xd934('0x57')],_0xd934('0x58'));if(_0x1fcc7a){_0x114f5b=path[_0xd934('0x59')](_0x114f5b,'offline-chat/');}var _0x1d9c47=path[_0xd934('0x59')](_0x114f5b,_0x2cb5b0['basename']);return _0x395c1b[_0xd934('0x5a')](_0x1d9c47);}})[_0xd934('0x49')](handleError(_0x395c1b,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 2ee9c10..ca10178 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 _0x4837=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','Attachment','attachments'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x4837,0x15c));var _0x7483=function(_0x203d29,_0x238af6){_0x203d29=_0x203d29-0x0;var _0x2f6819=_0x4837[_0x203d29];return _0x2f6819;};'use strict';var _=require('lodash');var util=require(_0x7483('0x0'));var logger=require(_0x7483('0x1'))(_0x7483('0x2'));var moment=require(_0x7483('0x3'));var BPromise=require(_0x7483('0x4'));var rp=require(_0x7483('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7483('0x6'));var config=require(_0x7483('0x7'));var attributes=require('./attachment.attributes');module[_0x7483('0x8')]=function(_0x1ea118,_0x3043c3){return _0x1ea118[_0x7483('0x9')](_0x7483('0xa'),attributes,{'tableName':_0x7483('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd045=['api','bluebird','path','rimraf','exports','define','Attachment','attachments','lodash','util'];(function(_0x659442,_0x3e108c){var _0x547eed=function(_0x6b0a70){while(--_0x6b0a70){_0x659442['push'](_0x659442['shift']());}};_0x547eed(++_0x3e108c);}(_0xd045,0x1e8));var _0x5d04=function(_0x386e58,_0xdd083a){_0x386e58=_0x386e58-0x0;var _0x35163b=_0xd045[_0x386e58];return _0x35163b;};'use strict';var _=require(_0x5d04('0x0'));var util=require(_0x5d04('0x1'));var logger=require('../../config/logger')(_0x5d04('0x2'));var moment=require('moment');var BPromise=require(_0x5d04('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5d04('0x4'));var rimraf=require(_0x5d04('0x5'));var config=require('../../config/environment');var attributes=require('./attachment.attributes');module[_0x5d04('0x6')]=function(_0x354a36,_0x56c993){return _0x354a36[_0x5d04('0x7')](_0x5d04('0x8'),attributes,{'tableName':_0x5d04('0x9'),'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 30c4bf8..7b3cf0f 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 _0x4876=['../../config/logger','rpc','../../config/environment','client','http','request','then','info','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateAttachment','Attachment','create','body','options','raw','moment','ioredis','../../config/utils'];(function(_0x13c3f3,_0x5b5310){var _0x4b9bf2=function(_0x1ed8c6){while(--_0x1ed8c6){_0x13c3f3['push'](_0x13c3f3['shift']());}};_0x4b9bf2(++_0x5b5310);}(_0x4876,0x84));var _0x6487=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4876[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6487('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6487('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x6487('0x2'));var logger=require(_0x6487('0x3'))(_0x6487('0x4'));var config=require(_0x6487('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x6487('0x6')][_0x6487('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x52177e,_0x289918,_0x14d6d8){return new BPromise(function(_0x2df3c1,_0x3f237a){return client[_0x6487('0x8')](_0x52177e,_0x14d6d8)[_0x6487('0x9')](function(_0x84bd9f){logger[_0x6487('0xa')](_0x6487('0xb'),_0x289918,'request\x20sent');logger[_0x6487('0xc')](_0x6487('0xd'),_0x289918,_0x6487('0xe'),JSON[_0x6487('0xf')](_0x84bd9f));if(_0x84bd9f[_0x6487('0x10')]){if(_0x84bd9f[_0x6487('0x10')][_0x6487('0x11')]===0x1f4){logger[_0x6487('0x10')]('Attachment,\x20%s,\x20%s',_0x289918,_0x84bd9f[_0x6487('0x10')][_0x6487('0x12')]);return _0x3f237a(_0x84bd9f[_0x6487('0x10')][_0x6487('0x12')]);}logger['error'](_0x6487('0xb'),_0x289918,_0x84bd9f[_0x6487('0x10')][_0x6487('0x12')]);return _0x2df3c1(_0x84bd9f[_0x6487('0x10')]['message']);}else{logger['info'](_0x6487('0xb'),_0x289918,'request\x20sent');_0x2df3c1(_0x84bd9f[_0x6487('0x13')]['message']);}})[_0x6487('0x14')](function(_0x3e7560){logger[_0x6487('0x10')](_0x6487('0xb'),_0x289918,_0x3e7560);_0x3f237a(_0x3e7560);});});}exports[_0x6487('0x15')]=function(_0x59514e){var _0x4cedf9=this;return new Promise(function(_0x5afb4a,_0x38a585){return db[_0x6487('0x16')][_0x6487('0x17')](_0x59514e[_0x6487('0x18')],{'raw':_0x59514e[_0x6487('0x19')]?_0x59514e[_0x6487('0x19')][_0x6487('0x1a')]===undefined?!![]:![]:!![]})[_0x6487('0x9')](function(_0x1b99ef){logger[_0x6487('0xa')](_0x6487('0x15'),_0x59514e);logger[_0x6487('0xc')](_0x6487('0x15'),_0x59514e,JSON[_0x6487('0xf')](_0x1b99ef));_0x5afb4a(_0x1b99ef);})[_0x6487('0x14')](function(_0x21050d){logger[_0x6487('0x10')](_0x6487('0x15'),_0x21050d[_0x6487('0x12')],_0x59514e);_0x38a585(_0x4cedf9['error'](0x1f4,_0x21050d['message']));});});}; \ No newline at end of file +var _0x9c44=['code','error','message','Attachment,\x20%s,\x20%s','info','result','catch','CreateAttachment','Attachment','body','options','raw','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x9c44,0x178));var _0x49c4=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x9c44[_0x160c73];return _0xd9302;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('Attachment,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('Attachment,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('Attachment,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('Attachment,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});}exports[_0x49c4('0x15')]=function(_0x4c3253){var _0x512650=this;return new Promise(function(_0x3c782d,_0x2f82d5){return db[_0x49c4('0x16')]['create'](_0x4c3253[_0x49c4('0x17')],{'raw':_0x4c3253['options']?_0x4c3253[_0x49c4('0x18')][_0x49c4('0x19')]===undefined?!![]:![]:!![]})[_0x49c4('0xa')](function(_0x291526){logger[_0x49c4('0x12')](_0x49c4('0x15'),_0x4c3253);logger[_0x49c4('0xc')](_0x49c4('0x15'),_0x4c3253,JSON[_0x49c4('0xd')](_0x291526));_0x3c782d(_0x291526);})['catch'](function(_0x527126){logger['error'](_0x49c4('0x15'),_0x527126['message'],_0x4c3253);_0x2f82d5(_0x512650['error'](0x1f4,_0x527126[_0x49c4('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 6e6094d..3ab9ef8 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 _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0x0b0e,0x187));var _0xe0b0=function(_0x5a60ce,_0x48f080){_0x5a60ce=_0x5a60ce-0x0;var _0x393e5e=_0x0b0e[_0x5a60ce];return _0x393e5e;};'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['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x4a05d9,_0x98651){var _0xdeb5bd=function(_0x2c914d){while(--_0x2c914d){_0x4a05d9['push'](_0x4a05d9['shift']());}};_0xdeb5bd(++_0x98651);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4ca83c,_0x34ebce){_0x4ca83c=_0x4ca83c-0x0;var _0xadd149=_0x5f2f[_0x4ca83c];return _0xadd149;};'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('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index b34d2ef..c42d95c 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 _0x7371=['add','minutes','getLicense','catch','send','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','use','passport','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','domain','error','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','findOne','adSsoEnabled','blockDuration','then','name','password','salt','role','disabled','blocked','blockedAt','online','admin','agent'];(function(_0x5edbed,_0x308534){var _0xd891d9=function(_0x1503a4){while(--_0x1503a4){_0x5edbed['push'](_0x5edbed['shift']());}};_0xd891d9(++_0x308534);}(_0x7371,0x16a));var _0x1737=function(_0x479c51,_0x89e601){_0x479c51=_0x479c51-0x0;var _0x26b034=_0x7371[_0x479c51];return _0x26b034;};'use strict';var passport=require(_0x1737('0x0'));var LocalStrategy=require(_0x1737('0x1'))[_0x1737('0x2')];var moment=require(_0x1737('0x3'));var ActiveDirectory=require(_0x1737('0x4'));var BPromise=require(_0x1737('0x5'));var util=require(_0x1737('0x6'));var db=require('../../mysqldb')['db'];var authService=require(_0x1737('0x7'));var utils=require(_0x1737('0x8'));var config=require(_0x1737('0x9'));var logger=require(_0x1737('0xa'))(_0x1737('0xb'));function isActiveDirectoryConfigured(_0x236b50){var _0x2cb322=![];if(typeof _0x236b50[_0x1737('0xc')]!==_0x1737('0xd')){_0x2cb322=_0x236b50[_0x1737('0xc')][_0x1737('0xe')]&&_0x236b50[_0x1737('0xc')]['url']&&_0x236b50[_0x1737('0xc')][_0x1737('0xf')];}return _0x2cb322;}function adAuthenticate(_0x285255,_0x157c94,_0x402abe){return new BPromise(function(_0x48fbb6,_0x4cefbf){try{var _0x4fcdf4=new ActiveDirectory(_0x285255);_0x4fcdf4['authenticate'](_0x157c94,_0x402abe,function(_0xbadc41,_0x31dfaf){if(_0xbadc41){logger[_0x1737('0x10')]('Error\x20authenticate\x20%s:\x20%s',_0x157c94,util[_0x1737('0x11')](_0xbadc41,{'showHidden':![],'depth':null}));_0x4cefbf(_0x1737('0x12'));}else if(!_0x31dfaf){logger[_0x1737('0x10')](_0x1737('0x13'),_0x157c94);_0x4cefbf(_0x1737('0x12'));}else{_0x48fbb6(_0x31dfaf);}});}catch(_0x4ba8f0){_0x4cefbf(_0x4ba8f0);}});}function ActiveDirectoryAuthenticate(_0x459861,_0x471e78,_0x56e6b7,_0x4ca4cf){var _0x5b0f2a,_0x3ed680;if(!isActiveDirectoryConfigured(config)){logger['error']('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x471e78);return _0x4ca4cf(null,![],{'message':_0x1737('0x12')});}return db['Setting'][_0x1737('0x14')]({'where':{'id':0x1},'attributes':[_0x1737('0x15'),_0x1737('0x16')],'raw':!![]})[_0x1737('0x17')](function(_0x17b174){_0x5b0f2a=_0x17b174;if(!_0x5b0f2a[_0x1737('0x15')]){logger[_0x1737('0x10')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x471e78);throw new Error(_0x1737('0x12'));}return _0x459861[_0x1737('0x14')]({'logging':!![],'attributes':['id',_0x1737('0x18'),_0x1737('0x19'),_0x1737('0x1a'),_0x1737('0x1b'),_0x1737('0x1c'),_0x1737('0x1d'),_0x1737('0x1e'),_0x1737('0x1f')],'where':{'name':_0x471e78,'role':{'$or':[_0x1737('0x20'),'user',_0x1737('0x21')]},'adSsoEnabled':!![]}});})[_0x1737('0x17')](function(_0x2e6e21){if(!_0x2e6e21||_0x2e6e21&&_0x2e6e21[_0x1737('0x18')]!==_0x471e78){throw new Error(_0x1737('0x12'));}_0x3ed680=_0x2e6e21;var _0x480846=_0x3ed680[_0x1737('0x18')]+'@'+config['activedirectory'][_0x1737('0xf')];return adAuthenticate(config[_0x1737('0xc')],_0x480846,_0x56e6b7);})['then'](function(_0x312efb){if(_0x3ed680[_0x1737('0x1c')]){throw new Error(_0x1737('0x12'));}if(_0x5b0f2a[_0x1737('0x16')]>0x0){if(_0x3ed680[_0x1737('0x1d')]){if(moment(_0x3ed680[_0x1737('0x1e')])[_0x1737('0x22')](_0x5b0f2a[_0x1737('0x16')],_0x1737('0x23'))>moment()){throw new Error(_0x1737('0x12'));}return utils['clearBlockUser'](_0x3ed680,0x0,![],null)[_0x1737('0x17')](function(){return utils['getLicense'](_0x3ed680);})[_0x1737('0x17')](function(){return _0x4ca4cf(null,_0x3ed680);});}else{return utils[_0x1737('0x24')](_0x3ed680)[_0x1737('0x17')](function(){return _0x4ca4cf(null,_0x3ed680);});}}else{return utils[_0x1737('0x24')](_0x3ed680)[_0x1737('0x17')](function(){return _0x4ca4cf(null,_0x3ed680);});}})[_0x1737('0x25')](function(_0x3eb558){return _0x4ca4cf(null,![],_0x3eb558);});}function handleError(_0x57e79a,_0x5aa7af,_0x5002ef){return _0x57e79a['status'](_0x5aa7af||0x1f4)[_0x1737('0x26')]({'message':_0x5002ef?_0x5002ef['message']||_0x5002ef:''});}exports['login']=function(_0x2d126f,_0x8bd6b,_0x5bfafa){passport[_0x1737('0x27')](_0x1737('0x28'),function(_0x5015f2,_0xdd54de,_0x4f1acf){var _0x18c96d=_0x5015f2||_0x4f1acf;if(_0x18c96d){return handleError(_0x8bd6b,0x191,_0x18c96d);}if(!_0xdd54de){return handleError(_0x8bd6b,0x194,{'message':_0x1737('0x29')});}else{var _0x3ac647={'payload':{'id':_0xdd54de['id'],'role':_0xdd54de[_0x1737('0x1b')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x3ac647)[_0x1737('0x17')](function(_0x3233ab){_0x8bd6b[_0x1737('0x2a')]({'id':_0xdd54de['id'],'token':_0x3233ab,'statusCall':'','isAlreadyLogged':_0xdd54de[_0x1737('0x1f')]});});}})(_0x2d126f,_0x8bd6b,_0x5bfafa);};passport[_0x1737('0x2b')](_0x1737('0x28'),new LocalStrategy({'usernameField':_0x1737('0x18'),'passwordField':_0x1737('0x19')},function(_0x122124,_0x1011a0,_0x533e40){return ActiveDirectoryAuthenticate(db['User'],_0x122124,_0x1011a0,_0x533e40);})); \ No newline at end of file +var _0xd2bb=['domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','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','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','disabled','blocked','blockedAt','online','admin','agent','minutes','clearBlockUser','getLicense','catch','message','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','use','ad-login','User','passport','passport-local','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','api','activedirectory','undefined','url'];(function(_0x3b3199,_0x10216d){var _0x4f592c=function(_0x1160c3){while(--_0x1160c3){_0x3b3199['push'](_0x3b3199['shift']());}};_0x4f592c(++_0x10216d);}(_0xd2bb,0xe3));var _0xbd2b=function(_0x87ba2d,_0x243f80){_0x87ba2d=_0x87ba2d-0x0;var _0x5ed9f1=_0xd2bb[_0x87ba2d];return _0x5ed9f1;};'use strict';var passport=require(_0xbd2b('0x0'));var LocalStrategy=require(_0xbd2b('0x1'))['Strategy'];var moment=require('moment');var ActiveDirectory=require(_0xbd2b('0x2'));var BPromise=require(_0xbd2b('0x3'));var util=require(_0xbd2b('0x4'));var db=require(_0xbd2b('0x5'))['db'];var authService=require(_0xbd2b('0x6'));var utils=require(_0xbd2b('0x7'));var config=require(_0xbd2b('0x8'));var logger=require('../../config/logger')(_0xbd2b('0x9'));function isActiveDirectoryConfigured(_0x54a115){var _0x134963=![];if(typeof _0x54a115[_0xbd2b('0xa')]!==_0xbd2b('0xb')){_0x134963=_0x54a115['activedirectory']['baseDN']&&_0x54a115[_0xbd2b('0xa')][_0xbd2b('0xc')]&&_0x54a115[_0xbd2b('0xa')][_0xbd2b('0xd')];}return _0x134963;}function adAuthenticate(_0x40bb69,_0x354153,_0x5e7db5){return new BPromise(function(_0x440fe8,_0x35d41b){try{var _0x3bc07f=new ActiveDirectory(_0x40bb69);_0x3bc07f[_0xbd2b('0xe')](_0x354153,_0x5e7db5,function(_0x3a5d74,_0xafe7fa){if(_0x3a5d74){logger[_0xbd2b('0xf')](_0xbd2b('0x10'),_0x354153,util[_0xbd2b('0x11')](_0x3a5d74,{'showHidden':![],'depth':null}));_0x35d41b(_0xbd2b('0x12'));}else if(!_0xafe7fa){logger[_0xbd2b('0xf')](_0xbd2b('0x13'),_0x354153);_0x35d41b(_0xbd2b('0x12'));}else{_0x440fe8(_0xafe7fa);}});}catch(_0x1cc614){_0x35d41b(_0x1cc614);}});}function ActiveDirectoryAuthenticate(_0x5e40c9,_0x80bbfc,_0x11df0b,_0x4ca65a){var _0x2c5dde,_0x56e5d4;if(!isActiveDirectoryConfigured(config)){logger[_0xbd2b('0xf')](_0xbd2b('0x14'),_0x80bbfc);return _0x4ca65a(null,![],{'message':_0xbd2b('0x12')});}return db[_0xbd2b('0x15')][_0xbd2b('0x16')]({'where':{'id':0x1},'attributes':[_0xbd2b('0x17'),_0xbd2b('0x18')],'raw':!![]})[_0xbd2b('0x19')](function(_0x3d6f4b){_0x2c5dde=_0x3d6f4b;if(!_0x2c5dde[_0xbd2b('0x17')]){logger['error'](_0xbd2b('0x1a'),_0x80bbfc);throw new Error(_0xbd2b('0x12'));}return _0x5e40c9['findOne']({'logging':!![],'attributes':['id',_0xbd2b('0x1b'),_0xbd2b('0x1c'),_0xbd2b('0x1d'),_0xbd2b('0x1e'),_0xbd2b('0x1f'),_0xbd2b('0x20'),_0xbd2b('0x21'),_0xbd2b('0x22')],'where':{'name':_0x80bbfc,'role':{'$or':[_0xbd2b('0x23'),'user',_0xbd2b('0x24')]},'adSsoEnabled':!![]}});})[_0xbd2b('0x19')](function(_0x4f4bd8){if(!_0x4f4bd8||_0x4f4bd8&&_0x4f4bd8['name']!==_0x80bbfc){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x56e5d4=_0x4f4bd8;var _0x46acd7=_0x56e5d4[_0xbd2b('0x1b')]+'@'+config['activedirectory'][_0xbd2b('0xd')];return adAuthenticate(config[_0xbd2b('0xa')],_0x46acd7,_0x11df0b);})[_0xbd2b('0x19')](function(_0x19375a){if(_0x56e5d4[_0xbd2b('0x1f')]){throw new Error(_0xbd2b('0x12'));}if(_0x2c5dde[_0xbd2b('0x18')]>0x0){if(_0x56e5d4[_0xbd2b('0x20')]){if(moment(_0x56e5d4[_0xbd2b('0x21')])['add'](_0x2c5dde[_0xbd2b('0x18')],_0xbd2b('0x25'))>moment()){throw new Error(_0xbd2b('0x12'));}return utils[_0xbd2b('0x26')](_0x56e5d4,0x0,![],null)[_0xbd2b('0x19')](function(){return utils[_0xbd2b('0x27')](_0x56e5d4);})[_0xbd2b('0x19')](function(){return _0x4ca65a(null,_0x56e5d4);});}else{return utils[_0xbd2b('0x27')](_0x56e5d4)[_0xbd2b('0x19')](function(){return _0x4ca65a(null,_0x56e5d4);});}}else{return utils[_0xbd2b('0x27')](_0x56e5d4)[_0xbd2b('0x19')](function(){return _0x4ca65a(null,_0x56e5d4);});}})[_0xbd2b('0x28')](function(_0x30ce81){return _0x4ca65a(null,![],_0x30ce81);});}function handleError(_0x6f3a41,_0x4aa081,_0xe40aec){return _0x6f3a41['status'](_0x4aa081||0x1f4)['send']({'message':_0xe40aec?_0xe40aec[_0xbd2b('0x29')]||_0xe40aec:''});}exports[_0xbd2b('0x2a')]=function(_0x2bf46e,_0x59ff68,_0x22ae39){passport[_0xbd2b('0xe')]('ad-login',function(_0x203534,_0x2cc7f5,_0x2c4db7){var _0x23c6a4=_0x203534||_0x2c4db7;if(_0x23c6a4){return handleError(_0x59ff68,0x191,_0x23c6a4);}if(!_0x2cc7f5){return handleError(_0x59ff68,0x194,{'message':_0xbd2b('0x2b')});}else{var _0x3088b7={'payload':{'id':_0x2cc7f5['id'],'role':_0x2cc7f5['role']},'options':{'expiresIn':0x15180}};return authService[_0xbd2b('0x2c')](_0x3088b7)[_0xbd2b('0x19')](function(_0x350dec){_0x59ff68['json']({'id':_0x2cc7f5['id'],'token':_0x350dec,'statusCall':'','isAlreadyLogged':_0x2cc7f5[_0xbd2b('0x22')]});});}})(_0x2bf46e,_0x59ff68,_0x22ae39);};passport[_0xbd2b('0x2d')](_0xbd2b('0x2e'),new LocalStrategy({'usernameField':'name','passwordField':_0xbd2b('0x1c')},function(_0x14d80d,_0xae431a,_0x5a2055){return ActiveDirectoryAuthenticate(db[_0xbd2b('0x2f')],_0x14d80d,_0xae431a,_0x5a2055);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index c824383..1eccc38 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 _0xa1d1=['express','Router','./authActiveDirectory.controller','post','login','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa1d1,0x10e));var _0x1a1d=function(_0x22b2d1,_0x4497c6){_0x22b2d1=_0x22b2d1-0x0;var _0x2c940a=_0xa1d1[_0x22b2d1];return _0x2c940a;};'use strict';var express=require(_0x1a1d('0x0'));var router=express[_0x1a1d('0x1')]();var controller=require(_0x1a1d('0x2'));router[_0x1a1d('0x3')]('/',controller[_0x1a1d('0x4')]);module[_0x1a1d('0x5')]=router; \ No newline at end of file +var _0x372e=['Router','./authActiveDirectory.controller','post','login','exports'];(function(_0x2ccb2b,_0x1ed63d){var _0x466d39=function(_0x32a1b0){while(--_0x32a1b0){_0x2ccb2b['push'](_0x2ccb2b['shift']());}};_0x466d39(++_0x1ed63d);}(_0x372e,0x73));var _0xe372=function(_0x5dcb3a,_0x130437){_0x5dcb3a=_0x5dcb3a-0x0;var _0xff3c3d=_0x372e[_0x5dcb3a];return _0xff3c3d;};'use strict';var express=require('express');var router=express[_0xe372('0x0')]();var controller=require(_0xe372('0x1'));router[_0xe372('0x2')]('/',controller[_0xe372('0x3')]);module[_0xe372('0x4')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index a057b52..4ee7b3b 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 _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x3416f7,_0x283113){var _0x39355c=function(_0xa4d490){while(--_0xa4d490){_0x3416f7['push'](_0x3416f7['shift']());}};_0x39355c(++_0x283113);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ 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(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0x7a54,0x106));var _0x47a5=function(_0x215103,_0x4c20bb){_0x215103=_0x215103-0x0;var _0x2804c9=_0x7a54[_0x215103];return _0x2804c9;};'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 f30c2a6..4314186 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 _0xd540=['isMiddleware','login','setTokenCookie','exports','passport','Router','/callback','callback'];(function(_0x52e4e7,_0x2c55c3){var _0x411f2e=function(_0x379c25){while(--_0x379c25){_0x52e4e7['push'](_0x52e4e7['shift']());}};_0x411f2e(++_0x2c55c3);}(_0xd540,0x124));var _0x0d54=function(_0x57909e,_0x26084f){_0x57909e=_0x57909e-0x0;var _0x21d6cc=_0xd540[_0x57909e];return _0x21d6cc;};'use strict';var express=require('express');var passport=require(_0x0d54('0x0'));var router=express[_0x0d54('0x1')]();var controller=require('./authGoogle.controller');var userController=require('../user/user.controller.js');var authService=require('../../components/auth/service');router['get']('/',controller['login']);router['get'](_0x0d54('0x2'),controller[_0x0d54('0x3')],authService[_0x0d54('0x4')],userController[_0x0d54('0x5')],authService[_0x0d54('0x6')]);module[_0x0d54('0x7')]=router; \ No newline at end of file +var _0x9390=['../../components/auth/service','get','login','/callback','isMiddleware','setTokenCookie','exports','express','../user/user.controller.js'];(function(_0x2a27de,_0x4aaa18){var _0x4335d=function(_0xc8eb38){while(--_0xc8eb38){_0x2a27de['push'](_0x2a27de['shift']());}};_0x4335d(++_0x4aaa18);}(_0x9390,0x85));var _0x0939=function(_0x5aae95,_0x29008e){_0x5aae95=_0x5aae95-0x0;var _0x4a2660=_0x9390[_0x5aae95];return _0x4a2660;};'use strict';var express=require(_0x0939('0x0'));var passport=require('passport');var router=express['Router']();var controller=require('./authGoogle.controller');var userController=require(_0x0939('0x1'));var authService=require(_0x0939('0x2'));router[_0x0939('0x3')]('/',controller[_0x0939('0x4')]);router['get'](_0x0939('0x5'),controller['callback'],authService[_0x0939('0x6')],userController[_0x0939('0x4')],authService[_0x0939('0x7')]);module[_0x0939('0x8')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index d29a695..4b7d5ad 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 _0xe4e3=['agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','minutes','clearBlockUser','blockedAt','getLicense','catch','name','MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','\x22%s\x22\x20<%s>','request','SendMail','error','format','message','stringify','status','send','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','email','generate','body','trim','toLowerCase','Setting','User','find','This\x20email\x20is\x20not\x20registered.','disabled','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','save','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','host','/reset/','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','securePassword','validatePasswordPattern','previousPasswords','passwordHistoryLimit','Password\x20reset!','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','findOne','allowedLoginAttempts','blockDuration','then','password','salt','role','blocked','loginAttempts','admin','user'];(function(_0x400d68,_0x483950){var _0x27583a=function(_0x3a04b7){while(--_0x3a04b7){_0x400d68['push'](_0x400d68['shift']());}};_0x27583a(++_0x483950);}(_0xe4e3,0x1cf));var _0x3e4e=function(_0x18e41b,_0x468a92){_0x18e41b=_0x18e41b-0x0;var _0x4713ca=_0xe4e3[_0x18e41b];return _0x4713ca;};'use strict';var util=require(_0x3e4e('0x0'));var passport=require(_0x3e4e('0x1'));var LocalStrategy=require(_0x3e4e('0x2'))[_0x3e4e('0x3')];var jayson=require(_0x3e4e('0x4'));var _=require(_0x3e4e('0x5'));var rs=require(_0x3e4e('0x6'));var moment=require(_0x3e4e('0x7'));var db=require(_0x3e4e('0x8'))['db'];var authService=require(_0x3e4e('0x9'));var utils=require(_0x3e4e('0xa'));var client=jayson[_0x3e4e('0xb')]['http']({'port':0x232b});function localAuthenticate(_0x42d0e3,_0x316063,_0x21eed9,_0x54c15b){var _0x531f37,_0x474d80;return db['Setting'][_0x3e4e('0xc')]({'where':{'id':0x1},'attributes':[_0x3e4e('0xd'),_0x3e4e('0xe')],'raw':!![]})[_0x3e4e('0xf')](function(_0x11397b){_0x531f37=_0x11397b;return _0x42d0e3[_0x3e4e('0xc')]({'attributes':['id','name',_0x3e4e('0x10'),_0x3e4e('0x11'),_0x3e4e('0x12'),'disabled',_0x3e4e('0x13'),'blockedAt',_0x3e4e('0x14')],'where':{'name':_0x316063,'role':{'$or':[_0x3e4e('0x15'),_0x3e4e('0x16'),_0x3e4e('0x17')]}}});})[_0x3e4e('0xf')](function(_0x3e77ea){if(!_0x3e77ea||_0x3e77ea&&_0x3e77ea['name']!==_0x316063){throw new Error(_0x3e4e('0x18'));}else{_0x474d80=_0x3e77ea;return _0x474d80;}})['then'](function(){_0x474d80[_0x3e4e('0x19')](_0x21eed9,function(_0x476bf0,_0x3ca21d){var _0xbb7233=_0x474d80[_0x3e4e('0x14')]+0x1;if(_0x476bf0){return _0x54c15b(_0x476bf0);}else if(!_0x3ca21d){if(_0x474d80['disabled']){return _0x54c15b(null,![],{'message':_0x3e4e('0x18')});}else if(_0x531f37['allowedLoginAttempts']>0x0){if(_0x474d80[_0x3e4e('0x13')]){if(_0x531f37[_0x3e4e('0xe')]>0x0){if(moment(_0x474d80['blockedAt'])[_0x3e4e('0x1a')](_0x531f37[_0x3e4e('0xe')],_0x3e4e('0x1b'))>moment()){return _0x54c15b(null,![],{'message':_0x3e4e('0x18')});}else{return utils['clearBlockUser'](_0x474d80,_0xbb7233,![],null)['then'](function(){return _0x54c15b(null,![],{'message':_0x3e4e('0x18')});});}}else{return _0x54c15b(null,![],{'message':_0x3e4e('0x18')});}}else{if(_0xbb7233>=_0x531f37[_0x3e4e('0xd')]){return utils['clearBlockUser'](_0x474d80,0x0,!![],moment())['then'](function(){return _0x54c15b(null,![],{'message':_0x3e4e('0x18')});});}else{return utils[_0x3e4e('0x1c')](_0x474d80,_0xbb7233,![],null)[_0x3e4e('0xf')](function(){return _0x54c15b(null,![],{'message':_0x3e4e('0x18')});});}}}else{return _0x54c15b(null,![],{'message':_0x3e4e('0x18')});}}else{if(_0x474d80['disabled']){return _0x54c15b(null,![],{'message':_0x3e4e('0x18')});}else if(_0x531f37['allowedLoginAttempts']>0x0){if(_0x474d80[_0x3e4e('0x13')]){if(_0x531f37[_0x3e4e('0xe')]>0x0){if(moment(_0x474d80[_0x3e4e('0x1d')])[_0x3e4e('0x1a')](_0x531f37[_0x3e4e('0xe')],_0x3e4e('0x1b'))>moment()){return _0x54c15b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x3e4e('0x1c')](_0x474d80,0x0,![],null)['then'](function(){return utils[_0x3e4e('0x1e')](_0x474d80);})[_0x3e4e('0xf')](function(){return _0x54c15b(null,_0x474d80);});}}else{return _0x54c15b(null,![],{'message':_0x3e4e('0x18')});}}else{return utils[_0x3e4e('0x1c')](_0x474d80,0x0,![],null)[_0x3e4e('0xf')](function(){return utils[_0x3e4e('0x1e')](_0x474d80);})[_0x3e4e('0xf')](function(){return _0x54c15b(null,_0x474d80);})[_0x3e4e('0x1f')](function(_0x5d9819){return _0x54c15b(null,![],_0x5d9819);});}}else{if(_0x474d80[_0x3e4e('0x13')]){return _0x54c15b(null,![],{'message':_0x3e4e('0x18')});}else{return utils[_0x3e4e('0x1e')](_0x474d80)[_0x3e4e('0xf')](function(){return _0x54c15b(null,_0x474d80);});}}}});})[_0x3e4e('0x1f')](function(_0x58d89d){return _0x54c15b(null,![],_0x58d89d);});}function sendServiceMail(_0x95ba1e){return db['MailAccount']['find']({'where':{'service':!![]},'attributes':['id',_0x3e4e('0x20'),'email'],'include':[{'model':db[_0x3e4e('0x21')],'as':'Smtp','include':[{'model':db[_0x3e4e('0x22')],'as':_0x3e4e('0x22')}]}]})[_0x3e4e('0xf')](function(_0x33e4d1){if(!_0x33e4d1){throw new Error(_0x3e4e('0x23'));}var _0x1c3269=_0x33e4d1[_0x3e4e('0x24')]();var _0x2cbac6={'account':_0x1c3269,'message':_['merge']({'from':util['format'](_0x3e4e('0x25'),_0x33e4d1[_0x3e4e('0x20')],_0x33e4d1['email']||_0x33e4d1['Smtp'][_0x3e4e('0x16')])},_0x95ba1e)};return client[_0x3e4e('0x26')](_0x3e4e('0x27'),_0x2cbac6);})[_0x3e4e('0xf')](function(_0x320e0e){if(_0x320e0e[_0x3e4e('0x28')]){throw new Error(util[_0x3e4e('0x29')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x320e0e[_0x3e4e('0x28')][_0x3e4e('0x2a')]||JSON[_0x3e4e('0x2b')](_0x320e0e[_0x3e4e('0x28')])));}return!![];});}function handleError(_0x6240b3,_0x5cc9a3,_0x2049ed){return _0x6240b3[_0x3e4e('0x2c')](_0x5cc9a3||0x1f4)[_0x3e4e('0x2d')]({'message':_0x2049ed?_0x2049ed[_0x3e4e('0x2a')]||_0x2049ed:''});}exports['login']=function(_0x3a3983,_0x16a784,_0x14fc5f){passport['authenticate'](_0x3e4e('0x2e'),function(_0x205c15,_0x2aff82,_0x487ed6){var _0x11140e=_0x205c15||_0x487ed6;if(_0x11140e){return handleError(_0x16a784,0x191,_0x11140e);}if(!_0x2aff82){return handleError(_0x16a784,0x194,{'message':_0x3e4e('0x2f')});}else{var _0x5eaaad={'payload':{'id':_0x2aff82['id'],'role':_0x2aff82[_0x3e4e('0x12')]},'options':{'expiresIn':0x15180}};return authService[_0x3e4e('0x30')](_0x5eaaad)[_0x3e4e('0xf')](function(_0x4bd06a){_0x16a784[_0x3e4e('0x31')]({'id':_0x2aff82['id'],'token':_0x4bd06a,'statusCall':'','isAlreadyLogged':_0x2aff82[_0x3e4e('0x32')]});});}})(_0x3a3983,_0x16a784,_0x14fc5f);};exports['forgot']=function(_0x54a04b,_0x4dd3cd){if(!_0x54a04b['body'][_0x3e4e('0x33')]){return handleError(_0x4dd3cd,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x42a7c6=rs[_0x3e4e('0x34')]();_0x54a04b[_0x3e4e('0x35')][_0x3e4e('0x33')]=_0x54a04b[_0x3e4e('0x35')][_0x3e4e('0x33')][_0x3e4e('0x36')]()[_0x3e4e('0x37')]();var _0x2a4c16;return db[_0x3e4e('0x38')][_0x3e4e('0xc')]({'where':{'id':0x1},'attributes':[_0x3e4e('0xd'),_0x3e4e('0xe')],'raw':!![]})['then'](function(_0x5a09ee){_0x2a4c16=_0x5a09ee;return db[_0x3e4e('0x39')][_0x3e4e('0x3a')]({'where':{'email':_0x54a04b[_0x3e4e('0x35')][_0x3e4e('0x33')]}});})[_0x3e4e('0xf')](function(_0x39e7fc){if(!_0x39e7fc){throw new Error(_0x3e4e('0x3b'));}if(_0x39e7fc[_0x3e4e('0x3c')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x39e7fc[_0x3e4e('0x13')]){if(moment(_0x39e7fc[_0x3e4e('0x1d')])[_0x3e4e('0x1a')](_0x2a4c16[_0x3e4e('0xe')],_0x3e4e('0x1b'))>moment()){throw new Error(_0x3e4e('0x3d'));}else{_0x39e7fc['blocked']=![];_0x39e7fc[_0x3e4e('0x1d')]=null;}}_0x39e7fc[_0x3e4e('0x3e')]=_0x42a7c6;_0x39e7fc[_0x3e4e('0x3f')]=Date['now']()+0x36ee80;return _0x39e7fc[_0x3e4e('0x40')]();})[_0x3e4e('0xf')](function(){return sendServiceMail({'to':_0x54a04b[_0x3e4e('0x35')][_0x3e4e('0x33')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x3e4e('0x41')+'https://'+_0x54a04b[_0x3e4e('0x42')][_0x3e4e('0x43')]+_0x3e4e('0x44')+_0x42a7c6+'\x0a\x0a'+_0x3e4e('0x45')});})[_0x3e4e('0xf')](function(){_0x4dd3cd[_0x3e4e('0x2c')](0xc8)[_0x3e4e('0x2d')]({'message':_0x3e4e('0x46')});})[_0x3e4e('0x1f')](function(_0xb873b8){return handleError(_0x4dd3cd,0x1f4,_0xb873b8);});};exports[_0x3e4e('0x47')]=function(_0x33872f,_0x4ae4f0){return db['User'][_0x3e4e('0x3a')]({'where':{'resetPasswordToken':_0x33872f['params'][_0x3e4e('0x48')],'resetPasswordExpires':{'$gt':Date[_0x3e4e('0x49')]()}}})['then'](function(_0x41b5a1){if(!_0x41b5a1){throw new Error(_0x3e4e('0x4a'));}return db[_0x3e4e('0x38')]['findOne']({'attributes':['id','securePassword',_0x3e4e('0x4b'),'passwordHistoryLimit']})[_0x3e4e('0xf')](function(_0x28a6c3){if(_0x28a6c3[_0x3e4e('0x4c')])authService[_0x3e4e('0x4d')](_0x33872f['body']['password']);if(!_0x28a6c3[_0x3e4e('0x4b')]||!_0x41b5a1[_0x3e4e('0x4e')])return _0x41b5a1;authService['validatePasswordHistory'](_0x33872f[_0x3e4e('0x35')][_0x3e4e('0x10')],_0x41b5a1['previousPasswords'],_0x28a6c3[_0x3e4e('0x4f')]);return _0x41b5a1;})[_0x3e4e('0xf')](function(){_0x41b5a1[_0x3e4e('0x10')]=_0x33872f[_0x3e4e('0x35')][_0x3e4e('0x10')];_0x41b5a1[_0x3e4e('0x3e')]=null;_0x41b5a1[_0x3e4e('0x3f')]=null;return _0x41b5a1[_0x3e4e('0x40')]();});})['then'](function(){_0x4ae4f0[_0x3e4e('0x2c')](0xc8)[_0x3e4e('0x2d')]({'message':_0x3e4e('0x50')});})[_0x3e4e('0x1f')](function(_0x17c0dc){return handleError(_0x4ae4f0,0x1f4,_0x17c0dc);});};passport['use'](_0x3e4e('0x2e'),new LocalStrategy({'usernameField':_0x3e4e('0x20'),'passwordField':'password'},function(_0x128ca4,_0x4828a7,_0x28f650){return localAuthenticate(db['User'],_0x128ca4,_0x4828a7,_0x28f650);})); \ No newline at end of file +var _0x0287=['blockDuration','minutes','clearBlockUser','add','getLicense','catch','MailAccount','find','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','\x22%s\x22\x20<%s>','request','SendMail','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','body','email','Email\x20parameter\x20is\x20missing','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','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','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','reset','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','Password\x20reset!','use','local-login','util','passport','passport-local','Strategy','jayson/promise','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','Setting','allowedLoginAttempts','then','findOne','name','password','role','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x53bf11,_0x3acb5e){var _0x3a4f47=function(_0x5d215e){while(--_0x5d215e){_0x53bf11['push'](_0x53bf11['shift']());}};_0x3a4f47(++_0x3acb5e);}(_0x0287,0x91));var _0x7028=function(_0x44cc74,_0x426cda){_0x44cc74=_0x44cc74-0x0;var _0x8761b4=_0x0287[_0x44cc74];return _0x8761b4;};'use strict';var util=require(_0x7028('0x0'));var passport=require(_0x7028('0x1'));var LocalStrategy=require(_0x7028('0x2'))[_0x7028('0x3')];var jayson=require(_0x7028('0x4'));var _=require('lodash');var rs=require(_0x7028('0x5'));var moment=require(_0x7028('0x6'));var db=require(_0x7028('0x7'))['db'];var authService=require(_0x7028('0x8'));var utils=require(_0x7028('0x9'));var client=jayson[_0x7028('0xa')]['http']({'port':0x232b});function localAuthenticate(_0x5437dd,_0x4f7249,_0x22fd7a,_0x408c16){var _0xdca1b4,_0x57940b;return db[_0x7028('0xb')]['findOne']({'where':{'id':0x1},'attributes':[_0x7028('0xc'),'blockDuration'],'raw':!![]})[_0x7028('0xd')](function(_0xc8a514){_0xdca1b4=_0xc8a514;return _0x5437dd[_0x7028('0xe')]({'attributes':['id',_0x7028('0xf'),_0x7028('0x10'),'salt',_0x7028('0x11'),_0x7028('0x12'),_0x7028('0x13'),_0x7028('0x14'),_0x7028('0x15')],'where':{'name':_0x4f7249,'role':{'$or':[_0x7028('0x16'),_0x7028('0x17'),_0x7028('0x18')]}}});})[_0x7028('0xd')](function(_0x58e139){if(!_0x58e139||_0x58e139&&_0x58e139[_0x7028('0xf')]!==_0x4f7249){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x57940b=_0x58e139;return _0x57940b;}})['then'](function(){_0x57940b[_0x7028('0x19')](_0x22fd7a,function(_0x57587f,_0x30c244){var _0x17a541=_0x57940b[_0x7028('0x15')]+0x1;if(_0x57587f){return _0x408c16(_0x57587f);}else if(!_0x30c244){if(_0x57940b[_0x7028('0x12')]){return _0x408c16(null,![],{'message':_0x7028('0x1a')});}else if(_0xdca1b4['allowedLoginAttempts']>0x0){if(_0x57940b[_0x7028('0x13')]){if(_0xdca1b4[_0x7028('0x1b')]>0x0){if(moment(_0x57940b['blockedAt'])['add'](_0xdca1b4[_0x7028('0x1b')],_0x7028('0x1c'))>moment()){return _0x408c16(null,![],{'message':_0x7028('0x1a')});}else{return utils[_0x7028('0x1d')](_0x57940b,_0x17a541,![],null)[_0x7028('0xd')](function(){return _0x408c16(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x408c16(null,![],{'message':_0x7028('0x1a')});}}else{if(_0x17a541>=_0xdca1b4[_0x7028('0xc')]){return utils[_0x7028('0x1d')](_0x57940b,0x0,!![],moment())['then'](function(){return _0x408c16(null,![],{'message':_0x7028('0x1a')});});}else{return utils[_0x7028('0x1d')](_0x57940b,_0x17a541,![],null)[_0x7028('0xd')](function(){return _0x408c16(null,![],{'message':_0x7028('0x1a')});});}}}else{return _0x408c16(null,![],{'message':_0x7028('0x1a')});}}else{if(_0x57940b[_0x7028('0x12')]){return _0x408c16(null,![],{'message':_0x7028('0x1a')});}else if(_0xdca1b4['allowedLoginAttempts']>0x0){if(_0x57940b[_0x7028('0x13')]){if(_0xdca1b4[_0x7028('0x1b')]>0x0){if(moment(_0x57940b['blockedAt'])[_0x7028('0x1e')](_0xdca1b4[_0x7028('0x1b')],_0x7028('0x1c'))>moment()){return _0x408c16(null,![],{'message':_0x7028('0x1a')});}else{return utils['clearBlockUser'](_0x57940b,0x0,![],null)[_0x7028('0xd')](function(){return utils[_0x7028('0x1f')](_0x57940b);})[_0x7028('0xd')](function(){return _0x408c16(null,_0x57940b);});}}else{return _0x408c16(null,![],{'message':_0x7028('0x1a')});}}else{return utils['clearBlockUser'](_0x57940b,0x0,![],null)[_0x7028('0xd')](function(){return utils['getLicense'](_0x57940b);})[_0x7028('0xd')](function(){return _0x408c16(null,_0x57940b);})[_0x7028('0x20')](function(_0x357c1d){return _0x408c16(null,![],_0x357c1d);});}}else{if(_0x57940b[_0x7028('0x13')]){return _0x408c16(null,![],{'message':_0x7028('0x1a')});}else{return utils[_0x7028('0x1f')](_0x57940b)[_0x7028('0xd')](function(){return _0x408c16(null,_0x57940b);});}}}});})[_0x7028('0x20')](function(_0x52a667){return _0x408c16(null,![],_0x52a667);});}function sendServiceMail(_0x3f22eb){return db[_0x7028('0x21')][_0x7028('0x22')]({'where':{'service':!![]},'attributes':['id','name','email'],'include':[{'model':db[_0x7028('0x23')],'as':_0x7028('0x24'),'include':[{'model':db[_0x7028('0x25')],'as':_0x7028('0x25')}]}]})[_0x7028('0xd')](function(_0x122751){if(!_0x122751){throw new Error(_0x7028('0x26'));}var _0x5c2a8e=_0x122751['getSmtpOptions']();var _0x54ff57={'account':_0x5c2a8e,'message':_[_0x7028('0x27')]({'from':util['format'](_0x7028('0x28'),_0x122751[_0x7028('0xf')],_0x122751['email']||_0x122751[_0x7028('0x24')][_0x7028('0x17')])},_0x3f22eb)};return client[_0x7028('0x29')](_0x7028('0x2a'),_0x54ff57);})[_0x7028('0xd')](function(_0x160cfe){if(_0x160cfe[_0x7028('0x2b')]){throw new Error(util[_0x7028('0x2c')](_0x7028('0x2d'),_0x160cfe[_0x7028('0x2b')][_0x7028('0x2e')]||JSON[_0x7028('0x2f')](_0x160cfe['error'])));}return!![];});}function handleError(_0x5050ee,_0x4529ca,_0x409d99){return _0x5050ee[_0x7028('0x30')](_0x4529ca||0x1f4)['send']({'message':_0x409d99?_0x409d99[_0x7028('0x2e')]||_0x409d99:''});}exports[_0x7028('0x31')]=function(_0x42d52c,_0x274546,_0x26045f){passport[_0x7028('0x19')]('local-login',function(_0x3aa2bb,_0x3aa316,_0x3d593e){var _0x4af0a9=_0x3aa2bb||_0x3d593e;if(_0x4af0a9){return handleError(_0x274546,0x191,_0x4af0a9);}if(!_0x3aa316){return handleError(_0x274546,0x194,{'message':_0x7028('0x32')});}else{var _0x157ff1={'payload':{'id':_0x3aa316['id'],'role':_0x3aa316[_0x7028('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0x7028('0x33')](_0x157ff1)[_0x7028('0xd')](function(_0x3f33ea){_0x274546[_0x7028('0x34')]({'id':_0x3aa316['id'],'token':_0x3f33ea,'statusCall':'','isAlreadyLogged':_0x3aa316[_0x7028('0x35')]});});}})(_0x42d52c,_0x274546,_0x26045f);};exports['forgot']=function(_0x5c99d5,_0x42f71c){if(!_0x5c99d5[_0x7028('0x36')][_0x7028('0x37')]){return handleError(_0x42f71c,0x1f4,{'message':_0x7028('0x38')});}var _0x3ddb69=rs['generate']();_0x5c99d5[_0x7028('0x36')][_0x7028('0x37')]=_0x5c99d5['body'][_0x7028('0x37')][_0x7028('0x39')]()[_0x7028('0x3a')]();var _0x13ee7c;return db[_0x7028('0xb')]['findOne']({'where':{'id':0x1},'attributes':[_0x7028('0xc'),'blockDuration'],'raw':!![]})[_0x7028('0xd')](function(_0x235266){_0x13ee7c=_0x235266;return db[_0x7028('0x3b')][_0x7028('0x22')]({'where':{'email':_0x5c99d5[_0x7028('0x36')]['email']}});})[_0x7028('0xd')](function(_0x27354e){if(!_0x27354e){throw new Error(_0x7028('0x3c'));}if(_0x27354e[_0x7028('0x12')]){throw new Error(_0x7028('0x3d'));}if(_0x27354e[_0x7028('0x13')]){if(moment(_0x27354e[_0x7028('0x14')])['add'](_0x13ee7c[_0x7028('0x1b')],'minutes')>moment()){throw new Error(_0x7028('0x3e'));}else{_0x27354e[_0x7028('0x13')]=![];_0x27354e['blockedAt']=null;}}_0x27354e[_0x7028('0x3f')]=_0x3ddb69;_0x27354e[_0x7028('0x40')]=Date[_0x7028('0x41')]()+0x36ee80;return _0x27354e['save']();})[_0x7028('0xd')](function(){return sendServiceMail({'to':_0x5c99d5[_0x7028('0x36')][_0x7028('0x37')],'subject':_0x7028('0x42'),'text':_0x7028('0x43')+_0x7028('0x44')+_0x7028('0x45')+_0x5c99d5[_0x7028('0x46')][_0x7028('0x47')]+_0x7028('0x48')+_0x3ddb69+'\x0a\x0a'+_0x7028('0x49')});})[_0x7028('0xd')](function(){_0x42f71c[_0x7028('0x30')](0xc8)[_0x7028('0x4a')]({'message':'Reset\x20Email\x20sent!'});})['catch'](function(_0x351c5e){return handleError(_0x42f71c,0x1f4,_0x351c5e);});};exports[_0x7028('0x4b')]=function(_0x2ab77c,_0x2bfe02){return db[_0x7028('0x3b')][_0x7028('0x22')]({'where':{'resetPasswordToken':_0x2ab77c['params'][_0x7028('0x4c')],'resetPasswordExpires':{'$gt':Date[_0x7028('0x41')]()}}})[_0x7028('0xd')](function(_0x2a9bf5){if(!_0x2a9bf5){throw new Error(_0x7028('0x4d'));}return db[_0x7028('0xb')]['findOne']({'attributes':['id',_0x7028('0x4e'),_0x7028('0x4f'),_0x7028('0x50')]})[_0x7028('0xd')](function(_0x51798a){if(_0x51798a['securePassword'])authService['validatePasswordPattern'](_0x2ab77c[_0x7028('0x36')][_0x7028('0x10')]);if(!_0x51798a[_0x7028('0x4f')]||!_0x2a9bf5[_0x7028('0x51')])return _0x2a9bf5;authService[_0x7028('0x52')](_0x2ab77c[_0x7028('0x36')]['password'],_0x2a9bf5[_0x7028('0x51')],_0x51798a['passwordHistoryLimit']);return _0x2a9bf5;})['then'](function(){_0x2a9bf5[_0x7028('0x10')]=_0x2ab77c[_0x7028('0x36')][_0x7028('0x10')];_0x2a9bf5[_0x7028('0x3f')]=null;_0x2a9bf5['resetPasswordExpires']=null;return _0x2a9bf5['save']();});})[_0x7028('0xd')](function(){_0x2bfe02[_0x7028('0x30')](0xc8)['send']({'message':_0x7028('0x53')});})['catch'](function(_0x2bf9b0){return handleError(_0x2bfe02,0x1f4,_0x2bf9b0);});};passport[_0x7028('0x54')](_0x7028('0x55'),new LocalStrategy({'usernameField':_0x7028('0xf'),'passwordField':_0x7028('0x10')},function(_0x230c25,_0x138d77,_0x16df61){return localAuthenticate(db[_0x7028('0x3b')],_0x230c25,_0x138d77,_0x16df61);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 71a5e04..098e739 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 _0x2b34=['./authLocal.controller','post','login','/forgot','forgot','/reset/:token','reset','exports','Router'];(function(_0x4bb019,_0x75f043){var _0x30b0be=function(_0xabf62){while(--_0xabf62){_0x4bb019['push'](_0x4bb019['shift']());}};_0x30b0be(++_0x75f043);}(_0x2b34,0x11f));var _0x42b3=function(_0x5b6cf1,_0x32fdcd){_0x5b6cf1=_0x5b6cf1-0x0;var _0x46278c=_0x2b34[_0x5b6cf1];return _0x46278c;};'use strict';var express=require('express');var router=express[_0x42b3('0x0')]();var controller=require(_0x42b3('0x1'));router[_0x42b3('0x2')]('/',controller[_0x42b3('0x3')]);router[_0x42b3('0x2')](_0x42b3('0x4'),controller[_0x42b3('0x5')]);router[_0x42b3('0x2')](_0x42b3('0x6'),controller[_0x42b3('0x7')]);module[_0x42b3('0x8')]=router; \ No newline at end of file +var _0xe9e0=['login','/forgot','forgot','/reset/:token','express','post'];(function(_0x4c178a,_0x53c33e){var _0x311606=function(_0x19c204){while(--_0x19c204){_0x4c178a['push'](_0x4c178a['shift']());}};_0x311606(++_0x53c33e);}(_0xe9e0,0x124));var _0x0e9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xe9e0[_0x2dafbe];return _0x58a45a;};'use strict';var express=require(_0x0e9e('0x0'));var router=express['Router']();var controller=require('./authLocal.controller');router[_0x0e9e('0x1')]('/',controller[_0x0e9e('0x2')]);router['post'](_0x0e9e('0x3'),controller[_0x0e9e('0x4')]);router[_0x0e9e('0x1')](_0x0e9e('0x5'),controller['reset']);module['exports']=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 5154350..60d6fc5 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 _0xdc0a=['exports','STRING','INTEGER','sequelize'];(function(_0x37ed55,_0x276875){var _0x3bd1be=function(_0x58fb71){while(--_0x58fb71){_0x37ed55['push'](_0x37ed55['shift']());}};_0x3bd1be(++_0x276875);}(_0xdc0a,0x133));var _0xadc0=function(_0x158266,_0x1f358b){_0x158266=_0x158266-0x0;var _0x41da26=_0xdc0a[_0x158266];return _0x41da26;};'use strict';var Sequelize=require(_0xadc0('0x0'));module[_0xadc0('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0xadc0('0x2')]},'description':{'type':Sequelize[_0xadc0('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xadc0('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0xd5c3=['STRING','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0xd5c3,0xb2));var _0x3d5c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xd5c3[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x3d5c('0x0'));module[_0x3d5c('0x1')]={'name':{'type':Sequelize[_0x3d5c('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x3d5c('0x2')]},'description':{'type':Sequelize[_0x3d5c('0x2')]},'status':{'type':Sequelize[_0x3d5c('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x3d5c('0x4')],'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 e695b9b..d687719 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 _0x9356=['addConditions','ids','omit','findOne','Condition','intersection','getConditions','addActions','Action','getActions','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','sendStatus','error','name','Automation','fieldName','type','key','model','map','query','keys','filters','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','includeAll','include','findAll','rows','show','params','rawAttributes','fields','merge','options','find','catch','create','body','destroy'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9356,0x103));var _0x6935=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9356[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6935('0x0'));var jsonpatch=require(_0x6935('0x1'));var rp=require(_0x6935('0x2'));var moment=require(_0x6935('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6935('0x4'));var util=require(_0x6935('0x5'));var path=require(_0x6935('0x6'));var sox=require(_0x6935('0x7'));var csv=require(_0x6935('0x8'));var ejs=require(_0x6935('0x9'));var fs=require('fs');var fs_extra=require(_0x6935('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6935('0xb'));var jsforce=require(_0x6935('0xc'));var deskjs=require(_0x6935('0xd'));var toCsv=require(_0x6935('0x8'));var querystring=require(_0x6935('0xe'));var Papa=require(_0x6935('0xf'));var Redis=require(_0x6935('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x6935('0x11'));var as=require(_0x6935('0x12'));var hardwareService=require(_0x6935('0x13'));var logger=require(_0x6935('0x14'))(_0x6935('0x15'));var utils=require(_0x6935('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6935('0x17'))['db'];function respondWithStatusCode(_0x13a27c,_0x1c9b6f){_0x1c9b6f=_0x1c9b6f||0xcc;return function(_0x3ff852){if(_0x3ff852){return _0x13a27c['sendStatus'](_0x1c9b6f);}return _0x13a27c[_0x6935('0x18')](_0x1c9b6f)[_0x6935('0x19')]();};}function respondWithResult(_0xdaa9ca,_0x321009){_0x321009=_0x321009||0xc8;return function(_0x23c223){if(_0x23c223){return _0xdaa9ca[_0x6935('0x18')](_0x321009)[_0x6935('0x1a')](_0x23c223);}};}function respondWithFilteredResult(_0x3b1591,_0xf8fabc){return function(_0x5c0579){if(_0x5c0579){var _0x54da75=typeof _0xf8fabc['offset']===_0x6935('0x1b')&&typeof _0xf8fabc[_0x6935('0x1c')]===_0x6935('0x1b');var _0x5a4dec=_0x5c0579[_0x6935('0x1d')];var _0x1268ad=_0x54da75?0x0:_0xf8fabc[_0x6935('0x1e')];var _0x15ba47=_0x54da75?_0x5c0579[_0x6935('0x1d')]:_0xf8fabc[_0x6935('0x1e')]+_0xf8fabc[_0x6935('0x1c')];var _0x351256;if(_0x15ba47>=_0x5a4dec){_0x15ba47=_0x5a4dec;_0x351256=0xc8;}else{_0x351256=0xce;}_0x3b1591[_0x6935('0x18')](_0x351256);return _0x3b1591[_0x6935('0x1f')](_0x6935('0x20'),_0x1268ad+'-'+_0x15ba47+'/'+_0x5a4dec)['json'](_0x5c0579);}return null;};}function patchUpdates(_0x401ebd){return function(_0x43fef8){try{jsonpatch['apply'](_0x43fef8,_0x401ebd,!![]);}catch(_0x14f5e6){return BPromise[_0x6935('0x21')](_0x14f5e6);}return _0x43fef8[_0x6935('0x22')]();};}function saveUpdates(_0x3f6cfb,_0x50ae7e){return function(_0x336209){if(_0x336209){return _0x336209[_0x6935('0x23')](_0x3f6cfb)[_0x6935('0x24')](function(_0x36fa3e){return _0x36fa3e;});}return null;};}function removeEntity(_0x4800e7,_0x1064ec){return function(_0x369c09){if(_0x369c09){return _0x369c09['destroy']()[_0x6935('0x24')](function(){_0x4800e7[_0x6935('0x18')](0xcc)[_0x6935('0x19')]();});}};}function handleEntityNotFound(_0x20ee8e,_0x145a68){return function(_0x137c98){if(!_0x137c98){_0x20ee8e[_0x6935('0x25')](0x194);}return _0x137c98;};}function handleError(_0x483496,_0x33a7e6){_0x33a7e6=_0x33a7e6||0x1f4;return function(_0x5d87c7){logger[_0x6935('0x26')](_0x5d87c7['stack']);if(_0x5d87c7[_0x6935('0x27')]){delete _0x5d87c7['name'];}_0x483496[_0x6935('0x18')](_0x33a7e6)['send'](_0x5d87c7);};}exports['index']=function(_0x4d0a8b,_0x103b43){var _0x2b0ab6={},_0x4db68e={},_0x51ac3f={'count':0x0,'rows':[]};var _0x37c134=_['map'](db[_0x6935('0x28')]['rawAttributes'],function(_0x79826){return{'name':_0x79826[_0x6935('0x29')],'type':_0x79826[_0x6935('0x2a')][_0x6935('0x2b')]};});_0x4db68e[_0x6935('0x2c')]=_[_0x6935('0x2d')](_0x37c134,_0x6935('0x27'));_0x4db68e[_0x6935('0x2e')]=_[_0x6935('0x2f')](_0x4d0a8b[_0x6935('0x2e')]);_0x4db68e[_0x6935('0x30')]=_['intersection'](_0x4db68e[_0x6935('0x2c')],_0x4db68e[_0x6935('0x2e')]);_0x2b0ab6[_0x6935('0x31')]=_['intersection'](_0x4db68e[_0x6935('0x2c')],qs['fields'](_0x4d0a8b[_0x6935('0x2e')]['fields']));_0x2b0ab6[_0x6935('0x31')]=_0x2b0ab6[_0x6935('0x31')][_0x6935('0x32')]?_0x2b0ab6[_0x6935('0x31')]:_0x4db68e[_0x6935('0x2c')];if(!_0x4d0a8b[_0x6935('0x2e')][_0x6935('0x33')](_0x6935('0x34'))){_0x2b0ab6[_0x6935('0x1c')]=qs[_0x6935('0x1c')](_0x4d0a8b[_0x6935('0x2e')]['limit']);_0x2b0ab6[_0x6935('0x1e')]=qs[_0x6935('0x1e')](_0x4d0a8b['query'][_0x6935('0x1e')]);}_0x2b0ab6[_0x6935('0x35')]=qs[_0x6935('0x36')](_0x4d0a8b[_0x6935('0x2e')]['sort']);_0x2b0ab6[_0x6935('0x37')]=qs[_0x6935('0x30')](_[_0x6935('0x38')](_0x4d0a8b['query'],_0x4db68e[_0x6935('0x30')]),_0x37c134);if(_0x4d0a8b[_0x6935('0x2e')][_0x6935('0x39')]){_0x2b0ab6['where']=_['merge'](_0x2b0ab6['where'],{'$or':_[_0x6935('0x2d')](_0x37c134,function(_0x37bc77){if(_0x37bc77['type']!=='VIRTUAL'){var _0x231833={};_0x231833[_0x37bc77[_0x6935('0x27')]]={'$like':'%'+_0x4d0a8b['query'][_0x6935('0x39')]+'%'};return _0x231833;}})});}_0x2b0ab6=_['merge']({},_0x2b0ab6,_0x4d0a8b['options']);var _0x15cd9d={'where':_0x2b0ab6['where']};return db[_0x6935('0x28')]['count'](_0x15cd9d)['then'](function(_0x40edd9){_0x51ac3f[_0x6935('0x1d')]=_0x40edd9;if(_0x4d0a8b[_0x6935('0x2e')][_0x6935('0x3a')]){_0x2b0ab6[_0x6935('0x3b')]=[{'all':!![]}];}return db[_0x6935('0x28')][_0x6935('0x3c')](_0x2b0ab6);})[_0x6935('0x24')](function(_0x3f0084){_0x51ac3f[_0x6935('0x3d')]=_0x3f0084;return _0x51ac3f;})[_0x6935('0x24')](respondWithFilteredResult(_0x103b43,_0x2b0ab6))['catch'](handleError(_0x103b43,null));};exports[_0x6935('0x3e')]=function(_0x1c3b7b,_0x5dc3a9){var _0x342d32={'raw':![],'where':{'id':_0x1c3b7b[_0x6935('0x3f')]['id']}},_0x45b6bf={};_0x45b6bf[_0x6935('0x2c')]=_[_0x6935('0x2f')](db[_0x6935('0x28')][_0x6935('0x40')]);_0x45b6bf['query']=_['keys'](_0x1c3b7b['query']);_0x45b6bf[_0x6935('0x30')]=_['intersection'](_0x45b6bf[_0x6935('0x2c')],_0x45b6bf[_0x6935('0x2e')]);_0x342d32[_0x6935('0x31')]=_['intersection'](_0x45b6bf['model'],qs[_0x6935('0x41')](_0x1c3b7b[_0x6935('0x2e')][_0x6935('0x41')]));_0x342d32[_0x6935('0x31')]=_0x342d32[_0x6935('0x31')][_0x6935('0x32')]?_0x342d32[_0x6935('0x31')]:_0x45b6bf[_0x6935('0x2c')];if(_0x1c3b7b[_0x6935('0x2e')][_0x6935('0x3a')]){_0x342d32[_0x6935('0x3b')]=[{'all':!![]}];}_0x342d32=_[_0x6935('0x42')]({},_0x342d32,_0x1c3b7b[_0x6935('0x43')]);return db['Automation'][_0x6935('0x44')](_0x342d32)[_0x6935('0x24')](handleEntityNotFound(_0x5dc3a9,null))[_0x6935('0x24')](respondWithResult(_0x5dc3a9,null))[_0x6935('0x45')](handleError(_0x5dc3a9,null));};exports[_0x6935('0x46')]=function(_0x3c00ff,_0x2c6503){return db['Automation'][_0x6935('0x46')](_0x3c00ff[_0x6935('0x47')],{})['then'](respondWithResult(_0x2c6503,0xc9))[_0x6935('0x45')](handleError(_0x2c6503,null));};exports['update']=function(_0x4caf38,_0x4036d6){if(_0x4caf38[_0x6935('0x47')]['id']){delete _0x4caf38['body']['id'];}return db[_0x6935('0x28')][_0x6935('0x44')]({'where':{'id':_0x4caf38[_0x6935('0x3f')]['id']}})[_0x6935('0x24')](handleEntityNotFound(_0x4036d6,null))[_0x6935('0x24')](saveUpdates(_0x4caf38[_0x6935('0x47')],null))[_0x6935('0x24')](respondWithResult(_0x4036d6,null))['catch'](handleError(_0x4036d6,null));};exports[_0x6935('0x48')]=function(_0x47082f,_0x4acfba){return db[_0x6935('0x28')]['find']({'where':{'id':_0x47082f[_0x6935('0x3f')]['id']}})[_0x6935('0x24')](handleEntityNotFound(_0x4acfba,null))[_0x6935('0x24')](removeEntity(_0x4acfba,null))[_0x6935('0x45')](handleError(_0x4acfba,null));};exports['addConditions']=function(_0x70568e,_0x109e27,_0x3da1eb){return db['Condition'][_0x6935('0x44')]({'where':{'id':_0x70568e[_0x6935('0x3f')]['id']}})[_0x6935('0x24')](handleEntityNotFound(_0x109e27,null))[_0x6935('0x24')](function(_0x266d17){if(_0x266d17){return _0x266d17[_0x6935('0x49')](_0x70568e[_0x6935('0x47')][_0x6935('0x4a')],_[_0x6935('0x4b')](_0x70568e[_0x6935('0x47')],[_0x6935('0x4a'),'id'])||{});}})['then'](respondWithResult(_0x109e27,null))['catch'](handleError(_0x109e27,null));};exports['getConditions']=function(_0x5b0eab,_0x1cbdca,_0x310776){var _0x5cfda2={};var _0x1843ab={};var _0x5e5a69;var _0x39ed63;return db[_0x6935('0x28')][_0x6935('0x4c')]({'where':{'id':_0x5b0eab['params']['id']}})[_0x6935('0x24')](handleEntityNotFound(_0x1cbdca,null))[_0x6935('0x24')](function(_0x40d2c3){if(_0x40d2c3){_0x5e5a69=_0x40d2c3;_0x1843ab[_0x6935('0x2c')]=_[_0x6935('0x2f')](db[_0x6935('0x4d')][_0x6935('0x40')]);_0x1843ab[_0x6935('0x2e')]=_[_0x6935('0x2f')](_0x5b0eab[_0x6935('0x2e')]);_0x1843ab['filters']=_[_0x6935('0x4e')](_0x1843ab[_0x6935('0x2c')],_0x1843ab[_0x6935('0x2e')]);_0x5cfda2[_0x6935('0x31')]=_[_0x6935('0x4e')](_0x1843ab['model'],qs[_0x6935('0x41')](_0x5b0eab['query'][_0x6935('0x41')]));_0x5cfda2['attributes']=_0x5cfda2['attributes'][_0x6935('0x32')]?_0x5cfda2[_0x6935('0x31')]:_0x1843ab[_0x6935('0x2c')];_0x5cfda2[_0x6935('0x35')]=qs[_0x6935('0x36')](_0x5b0eab[_0x6935('0x2e')]['sort']);_0x5cfda2[_0x6935('0x37')]=qs['filters'](_['pick'](_0x5b0eab[_0x6935('0x2e')],_0x1843ab[_0x6935('0x30')]));if(_0x5b0eab['query'][_0x6935('0x39')]){_0x5cfda2['where']=_[_0x6935('0x42')](_0x5cfda2[_0x6935('0x37')],{'$or':_[_0x6935('0x2d')](_0x5cfda2[_0x6935('0x31')],function(_0xf0ee2f){var _0x49338a={};_0x49338a[_0xf0ee2f]={'$like':'%'+_0x5b0eab[_0x6935('0x2e')][_0x6935('0x39')]+'%'};return _0x49338a;})});}_0x5cfda2=_[_0x6935('0x42')]({},_0x5cfda2,_0x5b0eab[_0x6935('0x43')]);return _0x5e5a69['getConditions'](_0x5cfda2);}})[_0x6935('0x24')](function(_0x1070ae){if(_0x1070ae){_0x39ed63=_0x1070ae[_0x6935('0x32')];if(!_0x5b0eab[_0x6935('0x2e')][_0x6935('0x33')]('nolimit')){_0x5cfda2[_0x6935('0x1c')]=qs[_0x6935('0x1c')](_0x5b0eab[_0x6935('0x2e')][_0x6935('0x1c')]);_0x5cfda2[_0x6935('0x1e')]=qs[_0x6935('0x1e')](_0x5b0eab[_0x6935('0x2e')][_0x6935('0x1e')]);}return _0x5e5a69[_0x6935('0x4f')](_0x5cfda2);}})[_0x6935('0x24')](function(_0x2399ca){if(_0x2399ca){return _0x2399ca?{'count':_0x39ed63,'rows':_0x2399ca}:null;}})[_0x6935('0x24')](respondWithResult(_0x1cbdca,null))['catch'](handleError(_0x1cbdca,null));};exports[_0x6935('0x50')]=function(_0x210122,_0x37d7ac,_0x39d34c){return db[_0x6935('0x51')][_0x6935('0x44')]({'where':{'id':_0x210122[_0x6935('0x3f')]['id']}})[_0x6935('0x24')](handleEntityNotFound(_0x37d7ac,null))[_0x6935('0x24')](function(_0x690db2){if(_0x690db2){return _0x690db2['addActions'](_0x210122[_0x6935('0x47')][_0x6935('0x4a')],_[_0x6935('0x4b')](_0x210122[_0x6935('0x47')],[_0x6935('0x4a'),'id'])||{});}})['then'](respondWithResult(_0x37d7ac,null))['catch'](handleError(_0x37d7ac,null));};exports[_0x6935('0x52')]=function(_0x4af58c,_0x4e1247,_0x3f27a8){var _0x52d20a={};var _0x2fb784={};var _0x46a508;var _0x405d4a;return db[_0x6935('0x28')][_0x6935('0x4c')]({'where':{'id':_0x4af58c[_0x6935('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4e1247,null))[_0x6935('0x24')](function(_0x5c86ee){if(_0x5c86ee){_0x46a508=_0x5c86ee;_0x2fb784['model']=_[_0x6935('0x2f')](db[_0x6935('0x51')]['rawAttributes']);_0x2fb784[_0x6935('0x2e')]=_[_0x6935('0x2f')](_0x4af58c[_0x6935('0x2e')]);_0x2fb784[_0x6935('0x30')]=_[_0x6935('0x4e')](_0x2fb784[_0x6935('0x2c')],_0x2fb784[_0x6935('0x2e')]);_0x52d20a['attributes']=_[_0x6935('0x4e')](_0x2fb784[_0x6935('0x2c')],qs[_0x6935('0x41')](_0x4af58c[_0x6935('0x2e')][_0x6935('0x41')]));_0x52d20a['attributes']=_0x52d20a[_0x6935('0x31')][_0x6935('0x32')]?_0x52d20a['attributes']:_0x2fb784[_0x6935('0x2c')];_0x52d20a['order']=qs[_0x6935('0x36')](_0x4af58c[_0x6935('0x2e')]['sort']);_0x52d20a[_0x6935('0x37')]=qs[_0x6935('0x30')](_['pick'](_0x4af58c[_0x6935('0x2e')],_0x2fb784[_0x6935('0x30')]));if(_0x4af58c[_0x6935('0x2e')][_0x6935('0x39')]){_0x52d20a[_0x6935('0x37')]=_['merge'](_0x52d20a[_0x6935('0x37')],{'$or':_[_0x6935('0x2d')](_0x52d20a[_0x6935('0x31')],function(_0x4130c7){var _0x53e81d={};_0x53e81d[_0x4130c7]={'$like':'%'+_0x4af58c['query'][_0x6935('0x39')]+'%'};return _0x53e81d;})});}_0x52d20a=_[_0x6935('0x42')]({},_0x52d20a,_0x4af58c[_0x6935('0x43')]);return _0x46a508['getActions'](_0x52d20a);}})[_0x6935('0x24')](function(_0x2db881){if(_0x2db881){_0x405d4a=_0x2db881[_0x6935('0x32')];if(!_0x4af58c['query'][_0x6935('0x33')](_0x6935('0x34'))){_0x52d20a['limit']=qs[_0x6935('0x1c')](_0x4af58c[_0x6935('0x2e')]['limit']);_0x52d20a[_0x6935('0x1e')]=qs[_0x6935('0x1e')](_0x4af58c['query'][_0x6935('0x1e')]);}return _0x46a508[_0x6935('0x52')](_0x52d20a);}})[_0x6935('0x24')](function(_0x1f2bb8){if(_0x1f2bb8){return _0x1f2bb8?{'count':_0x405d4a,'rows':_0x1f2bb8}:null;}})[_0x6935('0x24')](respondWithResult(_0x4e1247,null))[_0x6935('0x45')](handleError(_0x4e1247,null));}; \ No newline at end of file +var _0xaddb=['undefined','limit','count','apply','save','then','destroy','error','stack','name','send','index','Automation','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','find','catch','create','body','update','addConditions','ids','getConditions','findOne','Condition','addActions','getActions','Action','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset'];(function(_0xb8903a,_0x583723){var _0x39baad=function(_0x29bf2e){while(--_0x29bf2e){_0xb8903a['push'](_0xb8903a['shift']());}};_0x39baad(++_0x583723);}(_0xaddb,0x83));var _0xbadd=function(_0x214752,_0x481feb){_0x214752=_0x214752-0x0;var _0x1b8328=_0xaddb[_0x214752];return _0x1b8328;};'use strict';var emlformat=require(_0xbadd('0x0'));var rimraf=require(_0xbadd('0x1'));var zipdir=require(_0xbadd('0x2'));var jsonpatch=require(_0xbadd('0x3'));var rp=require('request-promise');var moment=require(_0xbadd('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbadd('0x5'));var path=require(_0xbadd('0x6'));var sox=require(_0xbadd('0x7'));var csv=require(_0xbadd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbadd('0x9'));var _=require(_0xbadd('0xa'));var squel=require(_0xbadd('0xb'));var crypto=require('crypto');var jsforce=require(_0xbadd('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xbadd('0x8'));var querystring=require('querystring');var Papa=require(_0xbadd('0xd'));var Redis=require(_0xbadd('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xbadd('0xf'));var as=require(_0xbadd('0x10'));var hardwareService=require(_0xbadd('0x11'));var logger=require(_0xbadd('0x12'))(_0xbadd('0x13'));var utils=require(_0xbadd('0x14'));var config=require(_0xbadd('0x15'));var licenseUtil=require(_0xbadd('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1eb274,_0x146966){_0x146966=_0x146966||0xcc;return function(_0x2d9d73){if(_0x2d9d73){return _0x1eb274['sendStatus'](_0x146966);}return _0x1eb274[_0xbadd('0x17')](_0x146966)[_0xbadd('0x18')]();};}function respondWithResult(_0x48bfc9,_0x3d9947){_0x3d9947=_0x3d9947||0xc8;return function(_0x56f6b1){if(_0x56f6b1){return _0x48bfc9[_0xbadd('0x17')](_0x3d9947)[_0xbadd('0x19')](_0x56f6b1);}};}function respondWithFilteredResult(_0x6b3e95,_0x4fdc7b){return function(_0x2592c4){if(_0x2592c4){var _0x1784c9=typeof _0x4fdc7b[_0xbadd('0x1a')]===_0xbadd('0x1b')&&typeof _0x4fdc7b[_0xbadd('0x1c')]===_0xbadd('0x1b');var _0x5ebb7d=_0x2592c4[_0xbadd('0x1d')];var _0x49cb2b=_0x1784c9?0x0:_0x4fdc7b[_0xbadd('0x1a')];var _0x2805b6=_0x1784c9?_0x2592c4[_0xbadd('0x1d')]:_0x4fdc7b[_0xbadd('0x1a')]+_0x4fdc7b[_0xbadd('0x1c')];var _0x395360;if(_0x2805b6>=_0x5ebb7d){_0x2805b6=_0x5ebb7d;_0x395360=0xc8;}else{_0x395360=0xce;}_0x6b3e95[_0xbadd('0x17')](_0x395360);return _0x6b3e95['set']('Content-Range',_0x49cb2b+'-'+_0x2805b6+'/'+_0x5ebb7d)[_0xbadd('0x19')](_0x2592c4);}return null;};}function patchUpdates(_0x485eb3){return function(_0x3c611){try{jsonpatch[_0xbadd('0x1e')](_0x3c611,_0x485eb3,!![]);}catch(_0x44f94a){return BPromise['reject'](_0x44f94a);}return _0x3c611[_0xbadd('0x1f')]();};}function saveUpdates(_0x33da5f,_0x49543e){return function(_0x2897ce){if(_0x2897ce){return _0x2897ce['update'](_0x33da5f)[_0xbadd('0x20')](function(_0x2c26c7){return _0x2c26c7;});}return null;};}function removeEntity(_0x91d482,_0x37cd15){return function(_0x4f46c5){if(_0x4f46c5){return _0x4f46c5[_0xbadd('0x21')]()[_0xbadd('0x20')](function(){_0x91d482[_0xbadd('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31dba9,_0x3078a3){return function(_0x2b5f73){if(!_0x2b5f73){_0x31dba9['sendStatus'](0x194);}return _0x2b5f73;};}function handleError(_0x173f20,_0x5dc55c){_0x5dc55c=_0x5dc55c||0x1f4;return function(_0x3e1a10){logger[_0xbadd('0x22')](_0x3e1a10[_0xbadd('0x23')]);if(_0x3e1a10[_0xbadd('0x24')]){delete _0x3e1a10[_0xbadd('0x24')];}_0x173f20['status'](_0x5dc55c)[_0xbadd('0x25')](_0x3e1a10);};}exports[_0xbadd('0x26')]=function(_0x165cf9,_0x2dcbc8){var _0x5dafac={},_0x1aeffe={},_0xf0da49={'count':0x0,'rows':[]};var _0x5f2c22=_['map'](db[_0xbadd('0x27')]['rawAttributes'],function(_0x5694bc){return{'name':_0x5694bc[_0xbadd('0x28')],'type':_0x5694bc[_0xbadd('0x29')][_0xbadd('0x2a')]};});_0x1aeffe[_0xbadd('0x2b')]=_[_0xbadd('0x2c')](_0x5f2c22,'name');_0x1aeffe[_0xbadd('0x2d')]=_[_0xbadd('0x2e')](_0x165cf9[_0xbadd('0x2d')]);_0x1aeffe[_0xbadd('0x2f')]=_[_0xbadd('0x30')](_0x1aeffe['model'],_0x1aeffe[_0xbadd('0x2d')]);_0x5dafac[_0xbadd('0x31')]=_[_0xbadd('0x30')](_0x1aeffe[_0xbadd('0x2b')],qs[_0xbadd('0x32')](_0x165cf9[_0xbadd('0x2d')][_0xbadd('0x32')]));_0x5dafac[_0xbadd('0x31')]=_0x5dafac[_0xbadd('0x31')][_0xbadd('0x33')]?_0x5dafac[_0xbadd('0x31')]:_0x1aeffe[_0xbadd('0x2b')];if(!_0x165cf9[_0xbadd('0x2d')]['hasOwnProperty'](_0xbadd('0x34'))){_0x5dafac[_0xbadd('0x1c')]=qs[_0xbadd('0x1c')](_0x165cf9[_0xbadd('0x2d')]['limit']);_0x5dafac[_0xbadd('0x1a')]=qs[_0xbadd('0x1a')](_0x165cf9[_0xbadd('0x2d')]['offset']);}_0x5dafac[_0xbadd('0x35')]=qs[_0xbadd('0x36')](_0x165cf9['query'][_0xbadd('0x36')]);_0x5dafac[_0xbadd('0x37')]=qs[_0xbadd('0x2f')](_[_0xbadd('0x38')](_0x165cf9[_0xbadd('0x2d')],_0x1aeffe[_0xbadd('0x2f')]),_0x5f2c22);if(_0x165cf9[_0xbadd('0x2d')][_0xbadd('0x39')]){_0x5dafac[_0xbadd('0x37')]=_[_0xbadd('0x3a')](_0x5dafac[_0xbadd('0x37')],{'$or':_[_0xbadd('0x2c')](_0x5f2c22,function(_0x34be59){if(_0x34be59[_0xbadd('0x29')]!==_0xbadd('0x3b')){var _0x54972a={};_0x54972a[_0x34be59[_0xbadd('0x24')]]={'$like':'%'+_0x165cf9[_0xbadd('0x2d')][_0xbadd('0x39')]+'%'};return _0x54972a;}})});}_0x5dafac=_[_0xbadd('0x3a')]({},_0x5dafac,_0x165cf9[_0xbadd('0x3c')]);var _0x1342cf={'where':_0x5dafac[_0xbadd('0x37')]};return db[_0xbadd('0x27')]['count'](_0x1342cf)[_0xbadd('0x20')](function(_0x10358b){_0xf0da49[_0xbadd('0x1d')]=_0x10358b;if(_0x165cf9[_0xbadd('0x2d')][_0xbadd('0x3d')]){_0x5dafac[_0xbadd('0x3e')]=[{'all':!![]}];}return db[_0xbadd('0x27')]['findAll'](_0x5dafac);})[_0xbadd('0x20')](function(_0x168026){_0xf0da49[_0xbadd('0x3f')]=_0x168026;return _0xf0da49;})[_0xbadd('0x20')](respondWithFilteredResult(_0x2dcbc8,_0x5dafac))['catch'](handleError(_0x2dcbc8,null));};exports[_0xbadd('0x40')]=function(_0x4dbbd9,_0x35af02){var _0x4b651b={'raw':![],'where':{'id':_0x4dbbd9[_0xbadd('0x41')]['id']}},_0x47d249={};_0x47d249[_0xbadd('0x2b')]=_[_0xbadd('0x2e')](db[_0xbadd('0x27')]['rawAttributes']);_0x47d249[_0xbadd('0x2d')]=_[_0xbadd('0x2e')](_0x4dbbd9[_0xbadd('0x2d')]);_0x47d249['filters']=_[_0xbadd('0x30')](_0x47d249[_0xbadd('0x2b')],_0x47d249[_0xbadd('0x2d')]);_0x4b651b[_0xbadd('0x31')]=_[_0xbadd('0x30')](_0x47d249[_0xbadd('0x2b')],qs[_0xbadd('0x32')](_0x4dbbd9[_0xbadd('0x2d')]['fields']));_0x4b651b[_0xbadd('0x31')]=_0x4b651b[_0xbadd('0x31')][_0xbadd('0x33')]?_0x4b651b[_0xbadd('0x31')]:_0x47d249[_0xbadd('0x2b')];if(_0x4dbbd9[_0xbadd('0x2d')][_0xbadd('0x3d')]){_0x4b651b[_0xbadd('0x3e')]=[{'all':!![]}];}_0x4b651b=_[_0xbadd('0x3a')]({},_0x4b651b,_0x4dbbd9[_0xbadd('0x3c')]);return db['Automation'][_0xbadd('0x42')](_0x4b651b)[_0xbadd('0x20')](handleEntityNotFound(_0x35af02,null))[_0xbadd('0x20')](respondWithResult(_0x35af02,null))[_0xbadd('0x43')](handleError(_0x35af02,null));};exports[_0xbadd('0x44')]=function(_0x5b10c1,_0x20b691){return db[_0xbadd('0x27')][_0xbadd('0x44')](_0x5b10c1[_0xbadd('0x45')],{})[_0xbadd('0x20')](respondWithResult(_0x20b691,0xc9))['catch'](handleError(_0x20b691,null));};exports[_0xbadd('0x46')]=function(_0x558eff,_0x168863){if(_0x558eff[_0xbadd('0x45')]['id']){delete _0x558eff['body']['id'];}return db['Automation'][_0xbadd('0x42')]({'where':{'id':_0x558eff[_0xbadd('0x41')]['id']}})[_0xbadd('0x20')](handleEntityNotFound(_0x168863,null))[_0xbadd('0x20')](saveUpdates(_0x558eff[_0xbadd('0x45')],null))[_0xbadd('0x20')](respondWithResult(_0x168863,null))[_0xbadd('0x43')](handleError(_0x168863,null));};exports[_0xbadd('0x21')]=function(_0x3b39c0,_0x339bae){return db['Automation'][_0xbadd('0x42')]({'where':{'id':_0x3b39c0[_0xbadd('0x41')]['id']}})[_0xbadd('0x20')](handleEntityNotFound(_0x339bae,null))['then'](removeEntity(_0x339bae,null))[_0xbadd('0x43')](handleError(_0x339bae,null));};exports[_0xbadd('0x47')]=function(_0x53a193,_0x34dea4,_0x2d12ca){return db['Condition'][_0xbadd('0x42')]({'where':{'id':_0x53a193[_0xbadd('0x41')]['id']}})[_0xbadd('0x20')](handleEntityNotFound(_0x34dea4,null))['then'](function(_0x41bead){if(_0x41bead){return _0x41bead['addConditions'](_0x53a193[_0xbadd('0x45')][_0xbadd('0x48')],_['omit'](_0x53a193[_0xbadd('0x45')],[_0xbadd('0x48'),'id'])||{});}})[_0xbadd('0x20')](respondWithResult(_0x34dea4,null))[_0xbadd('0x43')](handleError(_0x34dea4,null));};exports[_0xbadd('0x49')]=function(_0x2ad799,_0x517136,_0x53c0a5){var _0x2cd966={};var _0xdd8b26={};var _0x3b60af;var _0x2d41c3;return db[_0xbadd('0x27')][_0xbadd('0x4a')]({'where':{'id':_0x2ad799[_0xbadd('0x41')]['id']}})['then'](handleEntityNotFound(_0x517136,null))['then'](function(_0x155180){if(_0x155180){_0x3b60af=_0x155180;_0xdd8b26[_0xbadd('0x2b')]=_[_0xbadd('0x2e')](db[_0xbadd('0x4b')]['rawAttributes']);_0xdd8b26[_0xbadd('0x2d')]=_[_0xbadd('0x2e')](_0x2ad799[_0xbadd('0x2d')]);_0xdd8b26[_0xbadd('0x2f')]=_['intersection'](_0xdd8b26['model'],_0xdd8b26['query']);_0x2cd966[_0xbadd('0x31')]=_['intersection'](_0xdd8b26['model'],qs[_0xbadd('0x32')](_0x2ad799['query']['fields']));_0x2cd966[_0xbadd('0x31')]=_0x2cd966[_0xbadd('0x31')][_0xbadd('0x33')]?_0x2cd966[_0xbadd('0x31')]:_0xdd8b26['model'];_0x2cd966[_0xbadd('0x35')]=qs['sort'](_0x2ad799[_0xbadd('0x2d')][_0xbadd('0x36')]);_0x2cd966[_0xbadd('0x37')]=qs['filters'](_['pick'](_0x2ad799[_0xbadd('0x2d')],_0xdd8b26[_0xbadd('0x2f')]));if(_0x2ad799[_0xbadd('0x2d')][_0xbadd('0x39')]){_0x2cd966[_0xbadd('0x37')]=_[_0xbadd('0x3a')](_0x2cd966[_0xbadd('0x37')],{'$or':_['map'](_0x2cd966[_0xbadd('0x31')],function(_0xb3ce6f){var _0x59cdaa={};_0x59cdaa[_0xb3ce6f]={'$like':'%'+_0x2ad799[_0xbadd('0x2d')][_0xbadd('0x39')]+'%'};return _0x59cdaa;})});}_0x2cd966=_[_0xbadd('0x3a')]({},_0x2cd966,_0x2ad799[_0xbadd('0x3c')]);return _0x3b60af[_0xbadd('0x49')](_0x2cd966);}})['then'](function(_0x5728a5){if(_0x5728a5){_0x2d41c3=_0x5728a5[_0xbadd('0x33')];if(!_0x2ad799[_0xbadd('0x2d')]['hasOwnProperty'](_0xbadd('0x34'))){_0x2cd966[_0xbadd('0x1c')]=qs[_0xbadd('0x1c')](_0x2ad799[_0xbadd('0x2d')][_0xbadd('0x1c')]);_0x2cd966['offset']=qs[_0xbadd('0x1a')](_0x2ad799[_0xbadd('0x2d')][_0xbadd('0x1a')]);}return _0x3b60af['getConditions'](_0x2cd966);}})[_0xbadd('0x20')](function(_0x5da97b){if(_0x5da97b){return _0x5da97b?{'count':_0x2d41c3,'rows':_0x5da97b}:null;}})[_0xbadd('0x20')](respondWithResult(_0x517136,null))[_0xbadd('0x43')](handleError(_0x517136,null));};exports[_0xbadd('0x4c')]=function(_0x54e0c2,_0xe292c3,_0x8bb69f){return db['Action'][_0xbadd('0x42')]({'where':{'id':_0x54e0c2[_0xbadd('0x41')]['id']}})[_0xbadd('0x20')](handleEntityNotFound(_0xe292c3,null))[_0xbadd('0x20')](function(_0x40043f){if(_0x40043f){return _0x40043f[_0xbadd('0x4c')](_0x54e0c2[_0xbadd('0x45')]['ids'],_['omit'](_0x54e0c2[_0xbadd('0x45')],[_0xbadd('0x48'),'id'])||{});}})[_0xbadd('0x20')](respondWithResult(_0xe292c3,null))[_0xbadd('0x43')](handleError(_0xe292c3,null));};exports[_0xbadd('0x4d')]=function(_0xeb2270,_0x427084,_0x212bff){var _0x1002b7={};var _0xf07e82={};var _0x1dc509;var _0x4138df;return db[_0xbadd('0x27')][_0xbadd('0x4a')]({'where':{'id':_0xeb2270[_0xbadd('0x41')]['id']}})[_0xbadd('0x20')](handleEntityNotFound(_0x427084,null))[_0xbadd('0x20')](function(_0xcd5726){if(_0xcd5726){_0x1dc509=_0xcd5726;_0xf07e82['model']=_[_0xbadd('0x2e')](db[_0xbadd('0x4e')]['rawAttributes']);_0xf07e82[_0xbadd('0x2d')]=_[_0xbadd('0x2e')](_0xeb2270[_0xbadd('0x2d')]);_0xf07e82[_0xbadd('0x2f')]=_[_0xbadd('0x30')](_0xf07e82[_0xbadd('0x2b')],_0xf07e82[_0xbadd('0x2d')]);_0x1002b7['attributes']=_[_0xbadd('0x30')](_0xf07e82['model'],qs[_0xbadd('0x32')](_0xeb2270[_0xbadd('0x2d')][_0xbadd('0x32')]));_0x1002b7['attributes']=_0x1002b7[_0xbadd('0x31')][_0xbadd('0x33')]?_0x1002b7['attributes']:_0xf07e82[_0xbadd('0x2b')];_0x1002b7[_0xbadd('0x35')]=qs['sort'](_0xeb2270[_0xbadd('0x2d')][_0xbadd('0x36')]);_0x1002b7['where']=qs[_0xbadd('0x2f')](_['pick'](_0xeb2270[_0xbadd('0x2d')],_0xf07e82['filters']));if(_0xeb2270['query']['filter']){_0x1002b7[_0xbadd('0x37')]=_[_0xbadd('0x3a')](_0x1002b7['where'],{'$or':_[_0xbadd('0x2c')](_0x1002b7['attributes'],function(_0x1f6a2e){var _0x319c87={};_0x319c87[_0x1f6a2e]={'$like':'%'+_0xeb2270['query']['filter']+'%'};return _0x319c87;})});}_0x1002b7=_[_0xbadd('0x3a')]({},_0x1002b7,_0xeb2270[_0xbadd('0x3c')]);return _0x1dc509[_0xbadd('0x4d')](_0x1002b7);}})[_0xbadd('0x20')](function(_0x4a749c){if(_0x4a749c){_0x4138df=_0x4a749c[_0xbadd('0x33')];if(!_0xeb2270[_0xbadd('0x2d')]['hasOwnProperty'](_0xbadd('0x34'))){_0x1002b7[_0xbadd('0x1c')]=qs[_0xbadd('0x1c')](_0xeb2270[_0xbadd('0x2d')]['limit']);_0x1002b7[_0xbadd('0x1a')]=qs['offset'](_0xeb2270[_0xbadd('0x2d')]['offset']);}return _0x1dc509[_0xbadd('0x4d')](_0x1002b7);}})['then'](function(_0x20a72b){if(_0x20a72b){return _0x20a72b?{'count':_0x4138df,'rows':_0x20a72b}:null;}})[_0xbadd('0x20')](respondWithResult(_0x427084,null))[_0xbadd('0x43')](handleError(_0x427084,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index d5e7ccd..7adc4bd 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 _0x58e2=['path','Automation','tools_automations','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x572011,_0x1bb7f7){var _0x5e9e6d=function(_0x2da862){while(--_0x2da862){_0x572011['push'](_0x572011['shift']());}};_0x5e9e6d(++_0x1bb7f7);}(_0x58e2,0x1d7));var _0x258e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x58e2[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x258e('0x0'));var util=require(_0x258e('0x1'));var logger=require(_0x258e('0x2'))(_0x258e('0x3'));var moment=require('moment');var BPromise=require(_0x258e('0x4'));var rp=require(_0x258e('0x5'));var fs=require('fs');var path=require(_0x258e('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./automation.attributes');module['exports']=function(_0x10e42e,_0x597753){return _0x10e42e['define'](_0x258e('0x7'),attributes,{'tableName':_0x258e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb56e=['path','../../config/environment','./automation.attributes','define','Automation','tools_automations','lodash','util','moment'];(function(_0x33cfe6,_0x3e215c){var _0x34b6cf=function(_0x4ce4c5){while(--_0x4ce4c5){_0x33cfe6['push'](_0x33cfe6['shift']());}};_0x34b6cf(++_0x3e215c);}(_0xb56e,0x72));var _0xeb56=function(_0x2c481d,_0x407fb3){_0x2c481d=_0x2c481d-0x0;var _0x59b8b9=_0xb56e[_0x2c481d];return _0x59b8b9;};'use strict';var _=require(_0xeb56('0x0'));var util=require(_0xeb56('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xeb56('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeb56('0x3'));var rimraf=require('rimraf');var config=require(_0xeb56('0x4'));var attributes=require(_0xeb56('0x5'));module['exports']=function(_0x90fb72,_0x2fe13c){return _0x90fb72[_0xeb56('0x6')](_0xeb56('0x7'),attributes,{'tableName':_0xeb56('0x8'),'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 8c78e7d..d2a9f51 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 _0x70e3=['then','info','Automation,\x20%s,\x20%s','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x5b9074,_0x11edbf){var _0x52f021=function(_0x3fbcbf){while(--_0x3fbcbf){_0x5b9074['push'](_0x5b9074['shift']());}};_0x52f021(++_0x11edbf);}(_0x70e3,0x9d));var _0x370e=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x70e3[_0x3ab9ee];return _0x82ee88;};'use strict';var _=require(_0x370e('0x0'));var util=require(_0x370e('0x1'));var moment=require(_0x370e('0x2'));var BPromise=require(_0x370e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x370e('0x4'));var db=require(_0x370e('0x5'))['db'];var utils=require(_0x370e('0x6'));var logger=require('../../config/logger')(_0x370e('0x7'));var config=require(_0x370e('0x8'));var jayson=require(_0x370e('0x9'));var client=jayson[_0x370e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a2aaf,_0x5f57ea,_0x4a6884){return new BPromise(function(_0x5e5c79,_0x4086c4){return client['request'](_0x3a2aaf,_0x4a6884)[_0x370e('0xb')](function(_0x52d611){logger[_0x370e('0xc')](_0x370e('0xd'),_0x5f57ea,'request\x20sent');logger['debug'](_0x370e('0xe'),_0x5f57ea,_0x370e('0xf'),JSON[_0x370e('0x10')](_0x52d611));if(_0x52d611[_0x370e('0x11')]){if(_0x52d611[_0x370e('0x11')]['code']===0x1f4){logger[_0x370e('0x11')](_0x370e('0xd'),_0x5f57ea,_0x52d611[_0x370e('0x11')][_0x370e('0x12')]);return _0x4086c4(_0x52d611[_0x370e('0x11')][_0x370e('0x12')]);}logger[_0x370e('0x11')](_0x370e('0xd'),_0x5f57ea,_0x52d611[_0x370e('0x11')][_0x370e('0x12')]);return _0x5e5c79(_0x52d611[_0x370e('0x11')]['message']);}else{logger['info']('Automation,\x20%s,\x20%s',_0x5f57ea,_0x370e('0xf'));_0x5e5c79(_0x52d611[_0x370e('0x13')][_0x370e('0x12')]);}})[_0x370e('0x14')](function(_0xb8381f){logger[_0x370e('0x11')]('Automation,\x20%s,\x20%s',_0x5f57ea,_0xb8381f);_0x4086c4(_0xb8381f);});});} \ No newline at end of file +var _0xc4e1=['client','then','info','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','error','code','message','Automation,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','jayson/promise'];(function(_0x1bc6af,_0x4fbcc4){var _0x35e765=function(_0x1a6a46){while(--_0x1a6a46){_0x1bc6af['push'](_0x1bc6af['shift']());}};_0x35e765(++_0x4fbcc4);}(_0xc4e1,0x172));var _0x1c4e=function(_0x206199,_0x3b075c){_0x206199=_0x206199-0x0;var _0x49e748=_0xc4e1[_0x206199];return _0x49e748;};'use strict';var _=require(_0x1c4e('0x0'));var util=require(_0x1c4e('0x1'));var moment=require(_0x1c4e('0x2'));var BPromise=require(_0x1c4e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1c4e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1c4e('0x5'));var logger=require('../../config/logger')(_0x1c4e('0x6'));var config=require('../../config/environment');var jayson=require(_0x1c4e('0x7'));var client=jayson[_0x1c4e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45bef5,_0x351366,_0x523405){return new BPromise(function(_0xa423ce,_0x4b6c34){return client['request'](_0x45bef5,_0x523405)[_0x1c4e('0x9')](function(_0x4d97eb){logger[_0x1c4e('0xa')]('Automation,\x20%s,\x20%s',_0x351366,_0x1c4e('0xb'));logger['debug'](_0x1c4e('0xc'),_0x351366,'request\x20sent',JSON['stringify'](_0x4d97eb));if(_0x4d97eb['error']){if(_0x4d97eb[_0x1c4e('0xd')][_0x1c4e('0xe')]===0x1f4){logger[_0x1c4e('0xd')]('Automation,\x20%s,\x20%s',_0x351366,_0x4d97eb[_0x1c4e('0xd')][_0x1c4e('0xf')]);return _0x4b6c34(_0x4d97eb['error']['message']);}logger['error'](_0x1c4e('0x10'),_0x351366,_0x4d97eb[_0x1c4e('0xd')]['message']);return _0xa423ce(_0x4d97eb[_0x1c4e('0xd')][_0x1c4e('0xf')]);}else{logger[_0x1c4e('0xa')](_0x1c4e('0x10'),_0x351366,_0x1c4e('0xb'));_0xa423ce(_0x4d97eb['result'][_0x1c4e('0xf')]);}})[_0x1c4e('0x11')](function(_0x508224){logger['error']('Automation,\x20%s,\x20%s',_0x351366,_0x508224);_0x4b6c34(_0x508224);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 82d7e35..ddac443 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 _0x1d99=['../../components/auth/service','../../components/interaction/service','./automation.controller','get','isAuthenticated','index','/:id','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addActions','update','exports','multer','util','path','express','Router','fs-extra'];(function(_0x44fb8f,_0x56af29){var _0x321efe=function(_0x3843e1){while(--_0x3843e1){_0x44fb8f['push'](_0x44fb8f['shift']());}};_0x321efe(++_0x56af29);}(_0x1d99,0xaa));var _0x91d9=function(_0x1d7be3,_0x5577ec){_0x1d7be3=_0x1d7be3-0x0;var _0x367036=_0x1d99[_0x1d7be3];return _0x367036;};'use strict';var multer=require(_0x91d9('0x0'));var util=require(_0x91d9('0x1'));var path=require(_0x91d9('0x2'));var timeout=require('connect-timeout');var express=require(_0x91d9('0x3'));var router=express[_0x91d9('0x4')]();var fs_extra=require(_0x91d9('0x5'));var auth=require(_0x91d9('0x6'));var interaction=require(_0x91d9('0x7'));var config=require('../../config/environment');var controller=require(_0x91d9('0x8'));router[_0x91d9('0x9')]('/',auth[_0x91d9('0xa')](),controller[_0x91d9('0xb')]);router[_0x91d9('0x9')](_0x91d9('0xc'),auth[_0x91d9('0xa')](),controller['show']);router[_0x91d9('0x9')](_0x91d9('0xd'),auth[_0x91d9('0xa')](),controller[_0x91d9('0xe')]);router[_0x91d9('0x9')](_0x91d9('0xf'),auth[_0x91d9('0xa')](),controller[_0x91d9('0x10')]);router[_0x91d9('0x11')]('/',auth[_0x91d9('0xa')](),controller[_0x91d9('0x12')]);router[_0x91d9('0x11')](_0x91d9('0xd'),auth[_0x91d9('0xa')](),controller['addConditions']);router[_0x91d9('0x11')](_0x91d9('0xf'),auth[_0x91d9('0xa')](),controller[_0x91d9('0x13')]);router['put'](_0x91d9('0xc'),auth[_0x91d9('0xa')](),controller[_0x91d9('0x14')]);router['delete'](_0x91d9('0xc'),auth[_0x91d9('0xa')](),controller['destroy']);module[_0x91d9('0x15')]=router; \ No newline at end of file +var _0xef89=['/:id/actions','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated','show','get','/:id/conditions','getConditions','create','addConditions','post'];(function(_0x1b7f4e,_0x84f8f3){var _0x1b59e1=function(_0xd3a48c){while(--_0xd3a48c){_0x1b7f4e['push'](_0x1b7f4e['shift']());}};_0x1b59e1(++_0x84f8f3);}(_0xef89,0xf6));var _0x9ef8=function(_0x3c906b,_0x225395){_0x3c906b=_0x3c906b-0x0;var _0x32eb95=_0xef89[_0x3c906b];return _0x32eb95;};'use strict';var multer=require(_0x9ef8('0x0'));var util=require(_0x9ef8('0x1'));var path=require(_0x9ef8('0x2'));var timeout=require(_0x9ef8('0x3'));var express=require(_0x9ef8('0x4'));var router=express['Router']();var fs_extra=require(_0x9ef8('0x5'));var auth=require(_0x9ef8('0x6'));var interaction=require(_0x9ef8('0x7'));var config=require(_0x9ef8('0x8'));var controller=require(_0x9ef8('0x9'));router['get']('/',auth[_0x9ef8('0xa')](),controller['index']);router['get']('/:id',auth[_0x9ef8('0xa')](),controller[_0x9ef8('0xb')]);router[_0x9ef8('0xc')](_0x9ef8('0xd'),auth[_0x9ef8('0xa')](),controller[_0x9ef8('0xe')]);router[_0x9ef8('0xc')]('/:id/actions',auth[_0x9ef8('0xa')](),controller['getActions']);router['post']('/',auth[_0x9ef8('0xa')](),controller[_0x9ef8('0xf')]);router['post'](_0x9ef8('0xd'),auth[_0x9ef8('0xa')](),controller[_0x9ef8('0x10')]);router[_0x9ef8('0x11')](_0x9ef8('0x12'),auth[_0x9ef8('0xa')](),controller['addActions']);router['put'](_0x9ef8('0x13'),auth[_0x9ef8('0xa')](),controller[_0x9ef8('0x14')]);router[_0x9ef8('0x15')](_0x9ef8('0x13'),auth[_0x9ef8('0xa')](),controller[_0x9ef8('0x16')]);module[_0x9ef8('0x17')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index f61889a..fcf6190 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 _0xcfe1=['#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)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\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','STRING','name','ENUM','ivr','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','BOOLEAN','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'];(function(_0x54a761,_0x431fd4){var _0x37d1da=function(_0x5ca617){while(--_0x5ca617){_0x54a761['push'](_0x54a761['shift']());}};_0x37d1da(++_0x431fd4);}(_0xcfe1,0xe3));var _0x1cfe=function(_0x42e84e,_0x4a233b){_0x42e84e=_0x42e84e-0x0;var _0x3b9290=_0xcfe1[_0x42e84e];return _0x3b9290;};'use strict';var Sequelize=require(_0x1cfe('0x0'));module['exports']={'name':{'type':Sequelize[_0x1cfe('0x1')],'unique':_0x1cfe('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x1cfe('0x3')](_0x1cfe('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x1cfe('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x1cfe('0x5')},'limitCalls':{'type':Sequelize[_0x1cfe('0x6')](0x4)[_0x1cfe('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x1cfe('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x1cfe('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x1cfe('0x6')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x1cfe('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1cfe('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1cfe('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1cfe('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x1cfe('0x6')](0x3)[_0x1cfe('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1cfe('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x1cfe('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1cfe('0x7')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1cfe('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1cfe('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0x1cfe('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x1cfe('0xd')},'dialTimezone':{'type':Sequelize[_0x1cfe('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x1cfe('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x1cfe('0x3')](_0x1cfe('0xe'),_0x1cfe('0xf'),'onlyIfOpen'),'defaultValue':_0x1cfe('0xe')},'dialAMDActive':{'type':Sequelize[_0x1cfe('0x10')],'defaultValue':0x0,'comment':_0x1cfe('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0x1cfe('0x6')](0x9)[_0x1cfe('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x1cfe('0x12')},'dialAMDGreeting':{'type':Sequelize[_0x1cfe('0x6')](0x9)[_0x1cfe('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x1cfe('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1cfe('0x6')](0x9)[_0x1cfe('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x1cfe('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x1cfe('0x6')](0x9)[_0x1cfe('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1cfe('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0x1cfe('0x6')](0x9)[_0x1cfe('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x1cfe('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1cfe('0x6')](0x9)[_0x1cfe('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x1cfe('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x1cfe('0x6')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x1cfe('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x1cfe('0x6')](0x5)[_0x1cfe('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x1cfe('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x1cfe('0x6')](0x9)[_0x1cfe('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1cfe('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x1cfe('0x1b'),_0x1cfe('0x1c')),'defaultValue':_0x1cfe('0x1b')},'dialPrefix':{'type':Sequelize[_0x1cfe('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1cfe('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1cfe('0x1d')},'dialCutDigit':{'type':Sequelize[_0x1cfe('0x6')](0x3)[_0x1cfe('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1cfe('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1cfe('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x1cfe('0x6')](0x5)[_0x1cfe('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1cfe('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1cfe('0x1f')},'dialDropRetryFrequency':{'type':Sequelize[_0x1cfe('0x6')](0x5)[_0x1cfe('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x1cfe('0x6')](0x3)[_0x1cfe('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1cfe('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x1cfe('0x6')](0x5)[_0x1cfe('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1cfe('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0x1cfe('0x6')](0x3)[_0x1cfe('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x1cfe('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x1cfe('0x6')](0x3)[_0x1cfe('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1cfe('0x22')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1cfe('0x23')}}; \ No newline at end of file +var _0x172b=['#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\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','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)'];(function(_0x824f0c,_0x496e3e){var _0x5a3430=function(_0x261a02){while(--_0x261a02){_0x824f0c['push'](_0x824f0c['shift']());}};_0x5a3430(++_0x496e3e);}(_0x172b,0x107));var _0xb172=function(_0x54d268,_0x21fbe5){_0x54d268=_0x54d268-0x0;var _0x2e1da0=_0x172b[_0x54d268];return _0x2e1da0;};'use strict';var Sequelize=require(_0xb172('0x0'));module[_0xb172('0x1')]={'name':{'type':Sequelize[_0xb172('0x2')],'unique':_0xb172('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xb172('0x4')](_0xb172('0x5')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xb172('0x2')]},'active':{'type':Sequelize[_0xb172('0x6')],'defaultValue':0x0,'comment':_0xb172('0x7')},'limitCalls':{'type':Sequelize[_0xb172('0x8')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xb172('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0xb172('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xb172('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xb172('0x8')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb172('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0xb172('0x8')](0x3)[_0xb172('0xb')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb172('0xc')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xb172('0x8')](0x5)[_0xb172('0xb')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb172('0xd')},'dialBusyMaxRetry':{'type':Sequelize[_0xb172('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb172('0xe')},'dialBusyRetryFrequency':{'type':Sequelize[_0xb172('0x8')](0x5)[_0xb172('0xb')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb172('0xf')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xb172('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xb172('0x10')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xb172('0x8')](0x5)[_0xb172('0xb')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xb172('0x11')},'dialTimezone':{'type':Sequelize[_0xb172('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xb172('0x2')],'defaultValue':_0xb172('0x12')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xb172('0x13'),_0xb172('0x14'),_0xb172('0x15')),'defaultValue':_0xb172('0x13')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xb172('0x16')},'dialAMDInitialSilence':{'type':Sequelize[_0xb172('0x8')](0x9)[_0xb172('0xb')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xb172('0x17')},'dialAMDGreeting':{'type':Sequelize[_0xb172('0x8')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xb172('0x18')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xb172('0xb')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xb172('0x19')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xb172('0x8')](0x9)[_0xb172('0xb')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xb172('0x1a')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xb172('0x8')](0x9)[_0xb172('0xb')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xb172('0x8')](0x9)[_0xb172('0xb')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xb172('0x1b')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xb172('0x8')](0x5)[_0xb172('0xb')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xb172('0x8')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb172('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xb172('0x1d'),_0xb172('0x1e')),'defaultValue':_0xb172('0x1d')},'dialPrefix':{'type':Sequelize[_0xb172('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xb172('0x8')](0x3)[_0xb172('0xb')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xb172('0x8')](0x3)[_0xb172('0xb')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb172('0xb')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb172('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xb172('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xb172('0x8')](0x3)[_0xb172('0xb')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xb172('0x8')](0x5)[_0xb172('0xb')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb172('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xb172('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xb172('0x8')](0x5)[_0xb172('0xb')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xb172('0x8')](0x3)[_0xb172('0xb')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb172('0x21')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xb172('0xb')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb172('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb172('0xb')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xb172('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index e916416..af9c5d7 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 _0x14d5=['push','sequelize','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','IvrCampaigns','UserProfileResource','sendStatus','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Campaign','includeAll','include','findAll','rows','catch','params','fields','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','clone','updatedAt','omit','body','createdAt','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','pick','CampaignId','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','from','cm_contacts','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','deletedAt\x20IS\x20NULL'];(function(_0xace4d9,_0x560586){var _0x150f46=function(_0x3888df){while(--_0x3888df){_0xace4d9['push'](_0xace4d9['shift']());}};_0x150f46(++_0x560586);}(_0x14d5,0x114));var _0x514d=function(_0x1e3c2f,_0x53b8d1){_0x1e3c2f=_0x1e3c2f-0x0;var _0x40ac24=_0x14d5[_0x1e3c2f];return _0x40ac24;};'use strict';var emlformat=require(_0x514d('0x0'));var rimraf=require(_0x514d('0x1'));var zipdir=require(_0x514d('0x2'));var jsonpatch=require(_0x514d('0x3'));var rp=require('request-promise');var moment=require(_0x514d('0x4'));var BPromise=require(_0x514d('0x5'));var Mustache=require(_0x514d('0x6'));var util=require(_0x514d('0x7'));var path=require(_0x514d('0x8'));var sox=require(_0x514d('0x9'));var csv=require(_0x514d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x514d('0xb'));var _=require(_0x514d('0xc'));var squel=require(_0x514d('0xd'));var crypto=require(_0x514d('0xe'));var jsforce=require(_0x514d('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x514d('0xa'));var querystring=require('querystring');var Papa=require(_0x514d('0x10'));var Redis=require(_0x514d('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x514d('0x12'));var as=require(_0x514d('0x13'));var hardwareService=require(_0x514d('0x14'));var logger=require(_0x514d('0x15'))('api');var utils=require(_0x514d('0x16'));var config=require(_0x514d('0x17'));var licenseUtil=require(_0x514d('0x18'));var db=require(_0x514d('0x19'))['db'];function respondWithStatusCode(_0xaf6437,_0x28771d){_0x28771d=_0x28771d||0xcc;return function(_0x27ff40){if(_0x27ff40){return _0xaf6437['sendStatus'](_0x28771d);}return _0xaf6437[_0x514d('0x1a')](_0x28771d)[_0x514d('0x1b')]();};}function respondWithResult(_0x40c942,_0x10a6c9){_0x10a6c9=_0x10a6c9||0xc8;return function(_0x19ac86){if(_0x19ac86){return _0x40c942[_0x514d('0x1a')](_0x10a6c9)[_0x514d('0x1c')](_0x19ac86);}};}function respondWithFilteredResult(_0x198a60,_0x4f7db3){return function(_0x261a5d){if(_0x261a5d){var _0x464fe9=typeof _0x4f7db3[_0x514d('0x1d')]===_0x514d('0x1e')&&typeof _0x4f7db3[_0x514d('0x1f')]===_0x514d('0x1e');var _0xf0d2=_0x261a5d[_0x514d('0x20')];var _0x102ea1=_0x464fe9?0x0:_0x4f7db3['offset'];var _0x310dad=_0x464fe9?_0x261a5d[_0x514d('0x20')]:_0x4f7db3[_0x514d('0x1d')]+_0x4f7db3[_0x514d('0x1f')];var _0x3d49da;if(_0x310dad>=_0xf0d2){_0x310dad=_0xf0d2;_0x3d49da=0xc8;}else{_0x3d49da=0xce;}_0x198a60['status'](_0x3d49da);return _0x198a60['set'](_0x514d('0x21'),_0x102ea1+'-'+_0x310dad+'/'+_0xf0d2)[_0x514d('0x1c')](_0x261a5d);}return null;};}function patchUpdates(_0x2b8cdc){return function(_0x57774b){try{jsonpatch[_0x514d('0x22')](_0x57774b,_0x2b8cdc,!![]);}catch(_0xc2c0b0){return BPromise[_0x514d('0x23')](_0xc2c0b0);}return _0x57774b['save']();};}function saveUpdates(_0x10d1df,_0xcb2acf){return function(_0x10f740){if(_0x10f740){return _0x10f740[_0x514d('0x24')](_0x10d1df)[_0x514d('0x25')](function(_0x2515d8){return _0x2515d8;});}return null;};}function removeEntity(_0x58bec7,_0xcee407){return function(_0x281bbb){if(_0x281bbb){return _0x281bbb[_0x514d('0x26')]()['then'](function(){var _0x4beee1=_0x281bbb['get']({'plain':!![]});var _0x54460d=_0x514d('0x27');return db[_0x514d('0x28')]['destroy']({'where':{'type':_0x54460d,'resourceId':_0x4beee1['id']}})[_0x514d('0x25')](function(){return _0x281bbb;});})[_0x514d('0x25')](function(){_0x58bec7[_0x514d('0x1a')](0xcc)[_0x514d('0x1b')]();});}};}function handleEntityNotFound(_0x669fe2,_0x3705a4){return function(_0x48bb88){if(!_0x48bb88){_0x669fe2[_0x514d('0x29')](0x194);}return _0x48bb88;};}function handleError(_0x1a85a7,_0x2ca50a){_0x2ca50a=_0x2ca50a||0x1f4;return function(_0x4ef7da){logger['error'](_0x4ef7da[_0x514d('0x2a')]);if(_0x4ef7da[_0x514d('0x2b')]){delete _0x4ef7da['name'];}_0x1a85a7[_0x514d('0x1a')](_0x2ca50a)[_0x514d('0x2c')](_0x4ef7da);};}exports['index']=function(_0x2e5d8e,_0x16a55a){var _0x3f2193={},_0x44e551={},_0x390a8c={'count':0x0,'rows':[]};var _0x60299f=_[_0x514d('0x2d')](db['Campaign'][_0x514d('0x2e')],function(_0x370bfa){return{'name':_0x370bfa[_0x514d('0x2f')],'type':_0x370bfa[_0x514d('0x30')][_0x514d('0x31')]};});_0x44e551['model']=_[_0x514d('0x2d')](_0x60299f,_0x514d('0x2b'));_0x44e551[_0x514d('0x32')]=_[_0x514d('0x33')](_0x2e5d8e[_0x514d('0x32')]);_0x44e551[_0x514d('0x34')]=_[_0x514d('0x35')](_0x44e551[_0x514d('0x36')],_0x44e551['query']);_0x3f2193['attributes']=_['intersection'](_0x44e551['model'],qs['fields'](_0x2e5d8e['query']['fields']));_0x3f2193[_0x514d('0x37')]=_0x3f2193[_0x514d('0x37')][_0x514d('0x38')]?_0x3f2193[_0x514d('0x37')]:_0x44e551['model'];if(!_0x2e5d8e[_0x514d('0x32')][_0x514d('0x39')](_0x514d('0x3a'))){_0x3f2193[_0x514d('0x1f')]=qs[_0x514d('0x1f')](_0x2e5d8e[_0x514d('0x32')]['limit']);_0x3f2193[_0x514d('0x1d')]=qs[_0x514d('0x1d')](_0x2e5d8e[_0x514d('0x32')][_0x514d('0x1d')]);}_0x3f2193[_0x514d('0x3b')]=qs[_0x514d('0x3c')](_0x2e5d8e[_0x514d('0x32')][_0x514d('0x3c')]);_0x3f2193[_0x514d('0x3d')]=qs['filters'](_['pick'](_0x2e5d8e[_0x514d('0x32')],_0x44e551[_0x514d('0x34')]),_0x60299f);if(_0x2e5d8e[_0x514d('0x32')][_0x514d('0x3e')]){_0x3f2193['where']=_[_0x514d('0x3f')](_0x3f2193['where'],{'$or':_['map'](_0x60299f,function(_0x1a1579){if(_0x1a1579[_0x514d('0x30')]!==_0x514d('0x40')){var _0x514f55={};_0x514f55[_0x1a1579[_0x514d('0x2b')]]={'$like':'%'+_0x2e5d8e[_0x514d('0x32')][_0x514d('0x3e')]+'%'};return _0x514f55;}})});}_0x3f2193=_['merge']({},_0x3f2193,_0x2e5d8e[_0x514d('0x41')]);var _0x46ebaf={'where':_0x3f2193[_0x514d('0x3d')]};return db[_0x514d('0x42')]['count'](_0x46ebaf)[_0x514d('0x25')](function(_0x17ffa0){_0x390a8c[_0x514d('0x20')]=_0x17ffa0;if(_0x2e5d8e[_0x514d('0x32')][_0x514d('0x43')]){_0x3f2193[_0x514d('0x44')]=[{'all':!![]}];}return db[_0x514d('0x42')][_0x514d('0x45')](_0x3f2193);})[_0x514d('0x25')](function(_0x188bd8){_0x390a8c[_0x514d('0x46')]=_0x188bd8;return _0x390a8c;})[_0x514d('0x25')](respondWithFilteredResult(_0x16a55a,_0x3f2193))[_0x514d('0x47')](handleError(_0x16a55a,null));};exports['show']=function(_0x534e28,_0x29fd3){var _0x47a7b2={'raw':![],'where':{'id':_0x534e28[_0x514d('0x48')]['id']}},_0x30ceba={};_0x30ceba[_0x514d('0x36')]=_[_0x514d('0x33')](db[_0x514d('0x42')][_0x514d('0x2e')]);_0x30ceba[_0x514d('0x32')]=_[_0x514d('0x33')](_0x534e28[_0x514d('0x32')]);_0x30ceba[_0x514d('0x34')]=_['intersection'](_0x30ceba[_0x514d('0x36')],_0x30ceba[_0x514d('0x32')]);_0x47a7b2[_0x514d('0x37')]=_[_0x514d('0x35')](_0x30ceba['model'],qs[_0x514d('0x49')](_0x534e28['query'][_0x514d('0x49')]));_0x47a7b2[_0x514d('0x37')]=_0x47a7b2[_0x514d('0x37')]['length']?_0x47a7b2[_0x514d('0x37')]:_0x30ceba[_0x514d('0x36')];if(_0x534e28[_0x514d('0x32')][_0x514d('0x43')]){_0x47a7b2[_0x514d('0x44')]=[{'all':!![]}];}_0x47a7b2=_['merge']({},_0x47a7b2,_0x534e28[_0x514d('0x41')]);return db[_0x514d('0x42')][_0x514d('0x4a')](_0x47a7b2)[_0x514d('0x25')](handleEntityNotFound(_0x29fd3,null))[_0x514d('0x25')](respondWithResult(_0x29fd3,null))[_0x514d('0x47')](handleError(_0x29fd3,null));};exports[_0x514d('0x4b')]=function(_0x1fa6fb,_0x20a2e1){return db['Campaign'][_0x514d('0x4b')](_0x1fa6fb['body'],{})[_0x514d('0x25')](function(_0x53776b){var _0x49be31=_0x1fa6fb[_0x514d('0x4c')][_0x514d('0x4d')]({'plain':!![]});if(!_0x49be31)throw new Error(_0x514d('0x4e'));if(_0x49be31[_0x514d('0x4f')]===_0x514d('0x4c')){var _0x58d264=_0x53776b[_0x514d('0x4d')]({'plain':!![]});var _0x264b2f='IvrCampaigns';return db['UserProfileSection'][_0x514d('0x4a')]({'where':{'name':_0x264b2f,'userProfileId':_0x49be31[_0x514d('0x50')]},'raw':!![]})[_0x514d('0x25')](function(_0x37063d){if(_0x37063d&&_0x37063d[_0x514d('0x51')]===0x0){return db[_0x514d('0x28')][_0x514d('0x4b')]({'name':_0x58d264[_0x514d('0x2b')],'resourceId':_0x58d264['id'],'type':_0x37063d['name'],'sectionId':_0x37063d['id']},{})['then'](function(){return _0x53776b;});}else{return _0x53776b;}})[_0x514d('0x47')](function(_0x3ce36f){logger[_0x514d('0x52')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3ce36f);throw _0x3ce36f;});}return _0x53776b;})[_0x514d('0x25')](respondWithResult(_0x20a2e1,0xc9))[_0x514d('0x47')](handleError(_0x20a2e1,null));};exports[_0x514d('0x53')]=function(_0x1097d2,_0x209314){var _0x5bef2c={'where':{'id':_0x1097d2[_0x514d('0x48')]['id']}},_0x4aa3e9={};_0x4aa3e9[_0x514d('0x36')]=_[_0x514d('0x33')](db[_0x514d('0x42')][_0x514d('0x2e')]);_0x5bef2c[_0x514d('0x37')]=_[_0x514d('0x35')](_0x4aa3e9[_0x514d('0x36')],qs[_0x514d('0x49')](_0x1097d2[_0x514d('0x32')][_0x514d('0x49')]));_0x5bef2c[_0x514d('0x37')]=_0x5bef2c[_0x514d('0x37')][_0x514d('0x38')]?_0x5bef2c['attributes']:_0x4aa3e9[_0x514d('0x36')];if(_0x1097d2['query'][_0x514d('0x43')]){_0x5bef2c['include']=[{'all':!![]}];}_0x5bef2c=_[_0x514d('0x3f')]({},_0x5bef2c,_0x1097d2[_0x514d('0x41')]);return db[_0x514d('0x42')]['find'](_0x5bef2c)[_0x514d('0x25')](handleEntityNotFound(_0x209314,null))[_0x514d('0x25')](function(_0x13d03d){if(_0x13d03d){var _0x5e7b89=_0x13d03d[_0x514d('0x4d')]({'plain':!![]});_0x5e7b89=qs['omit'](_0x5e7b89,['id','createdAt',_0x514d('0x54')]);_0x1097d2['body']=_[_0x514d('0x55')](_0x1097d2[_0x514d('0x56')],['id',_0x514d('0x57'),_0x514d('0x54')]);return db['Campaign'][_0x514d('0x4b')](_[_0x514d('0x3f')](_0x5e7b89,_0x1097d2['body']),{'include':_0x1097d2['query']['includeAll']?[{'all':!![]}]:undefined})[_0x514d('0x25')](function(_0x4b092f){var _0x3c3d8c=_0x1097d2[_0x514d('0x4c')][_0x514d('0x4d')]({'plain':!![]});if(!_0x3c3d8c)throw new Error(_0x514d('0x4e'));if(_0x3c3d8c[_0x514d('0x4f')]==='user'){var _0x4dbac3=_0x4b092f[_0x514d('0x4d')]({'plain':!![]});var _0xf9a358=_0x514d('0x27');return db[_0x514d('0x58')][_0x514d('0x4a')]({'where':{'name':_0xf9a358,'userProfileId':_0x3c3d8c[_0x514d('0x50')]},'raw':!![]})[_0x514d('0x25')](function(_0x14e96e){if(_0x14e96e&&_0x14e96e[_0x514d('0x51')]===0x0){return db['UserProfileResource'][_0x514d('0x4b')]({'name':_0x4dbac3[_0x514d('0x2b')],'resourceId':_0x4dbac3['id'],'type':_0x14e96e[_0x514d('0x2b')],'sectionId':_0x14e96e['id']},{})[_0x514d('0x25')](function(){return _0x4b092f;});}else{return _0x4b092f;}})[_0x514d('0x47')](function(_0x5eddd4){logger[_0x514d('0x52')](_0x514d('0x59'),_0x5eddd4);throw _0x5eddd4;});}return _0x4b092f;});}})['then'](respondWithResult(_0x209314,0xc9))[_0x514d('0x47')](handleError(_0x209314,null));};exports[_0x514d('0x24')]=function(_0x5a0438,_0x351026){if(_0x5a0438[_0x514d('0x56')]['id']){delete _0x5a0438[_0x514d('0x56')]['id'];}return db['Campaign'][_0x514d('0x4a')]({'where':{'id':_0x5a0438[_0x514d('0x48')]['id']}})[_0x514d('0x25')](handleEntityNotFound(_0x351026,null))[_0x514d('0x25')](saveUpdates(_0x5a0438[_0x514d('0x56')],null))['then'](respondWithResult(_0x351026,null))[_0x514d('0x47')](handleError(_0x351026,null));};exports['destroy']=function(_0x8ec4f5,_0x3acc57){return db[_0x514d('0x42')][_0x514d('0x4a')]({'where':{'id':_0x8ec4f5[_0x514d('0x48')]['id']}})[_0x514d('0x25')](handleEntityNotFound(_0x3acc57,null))[_0x514d('0x25')](removeEntity(_0x3acc57,null))[_0x514d('0x47')](handleError(_0x3acc57,null));};exports[_0x514d('0x5a')]=function(_0x19feb3,_0x2e7dbe,_0x80a998){var _0x4a52c5={'raw':!![],'where':{}};var _0x228e69={};var _0x4d9d97={'count':0x0,'rows':[]};return db[_0x514d('0x42')][_0x514d('0x5b')]({'where':{'id':_0x19feb3[_0x514d('0x48')]['id']}})['then'](handleEntityNotFound(_0x2e7dbe,null))[_0x514d('0x25')](function(_0x5b02ec){if(_0x5b02ec){_0x228e69['model']=_['keys'](db[_0x514d('0x5c')][_0x514d('0x2e')]);_0x228e69[_0x514d('0x32')]=_[_0x514d('0x33')](_0x19feb3[_0x514d('0x32')]);_0x228e69[_0x514d('0x34')]=_[_0x514d('0x35')](_0x228e69[_0x514d('0x36')],_0x228e69[_0x514d('0x32')]);_0x4a52c5[_0x514d('0x37')]=_[_0x514d('0x35')](_0x228e69[_0x514d('0x36')],qs[_0x514d('0x49')](_0x19feb3['query'][_0x514d('0x49')]));_0x4a52c5[_0x514d('0x37')]=_0x4a52c5[_0x514d('0x37')][_0x514d('0x38')]?_0x4a52c5['attributes']:_0x228e69[_0x514d('0x36')];if(!_0x19feb3['query'][_0x514d('0x39')](_0x514d('0x3a'))){_0x4a52c5[_0x514d('0x1f')]=qs['limit'](_0x19feb3['query'][_0x514d('0x1f')]);_0x4a52c5['offset']=qs[_0x514d('0x1d')](_0x19feb3[_0x514d('0x32')]['offset']);}_0x4a52c5[_0x514d('0x3b')]=qs[_0x514d('0x3c')](_0x19feb3[_0x514d('0x32')][_0x514d('0x3c')]);_0x4a52c5[_0x514d('0x3d')]=qs['filters'](_[_0x514d('0x5d')](_0x19feb3[_0x514d('0x32')],_0x228e69[_0x514d('0x34')]));_0x4a52c5['where'][_0x514d('0x5e')]=_0x5b02ec['id'];if(_0x19feb3[_0x514d('0x32')]['filter']){_0x4a52c5['where']=_['merge'](_0x4a52c5['where'],{'$or':_[_0x514d('0x2d')](_0x4a52c5[_0x514d('0x37')],function(_0x48a95c){var _0x48c513={};_0x48c513[_0x48a95c]={'$like':'%'+_0x19feb3[_0x514d('0x32')]['filter']+'%'};return _0x48c513;})});}_0x4a52c5=_[_0x514d('0x3f')]({},_0x4a52c5,_0x19feb3['options']);return db[_0x514d('0x5c')][_0x514d('0x20')]({'where':_0x4a52c5['where']})[_0x514d('0x25')](function(_0x1172f2){_0x4d9d97[_0x514d('0x20')]=_0x1172f2;if(_0x19feb3['query'][_0x514d('0x43')]){_0x4a52c5[_0x514d('0x44')]=[{'all':!![]}];}return db[_0x514d('0x5c')][_0x514d('0x45')](_0x4a52c5);})[_0x514d('0x25')](function(_0x8dd8f5){_0x4d9d97[_0x514d('0x46')]=_0x8dd8f5;return _0x4d9d97;});}})[_0x514d('0x25')](respondWithFilteredResult(_0x2e7dbe,_0x4a52c5))[_0x514d('0x47')](handleError(_0x2e7dbe,null));};exports['getHopperHistories']=function(_0x25d48c,_0x47637a,_0x2a4661){var _0x13ab47={'raw':!![],'where':{}};var _0xb44e28={};var _0x1b3a4d={'count':0x0,'rows':[]};return db[_0x514d('0x42')][_0x514d('0x5b')]({'where':{'id':_0x25d48c[_0x514d('0x48')]['id']}})[_0x514d('0x25')](handleEntityNotFound(_0x47637a,null))['then'](function(_0x14d44a){if(_0x14d44a){_0xb44e28[_0x514d('0x36')]=_[_0x514d('0x33')](db[_0x514d('0x5f')][_0x514d('0x2e')]);_0xb44e28[_0x514d('0x32')]=_[_0x514d('0x33')](_0x25d48c['query']);_0xb44e28[_0x514d('0x34')]=_[_0x514d('0x35')](_0xb44e28[_0x514d('0x36')],_0xb44e28['query']);_0x13ab47[_0x514d('0x37')]=_[_0x514d('0x35')](_0xb44e28[_0x514d('0x36')],qs[_0x514d('0x49')](_0x25d48c[_0x514d('0x32')]['fields']));_0x13ab47['attributes']=_0x13ab47['attributes'][_0x514d('0x38')]?_0x13ab47[_0x514d('0x37')]:_0xb44e28[_0x514d('0x36')];if(!_0x25d48c['query'][_0x514d('0x39')](_0x514d('0x3a'))){_0x13ab47[_0x514d('0x1f')]=qs[_0x514d('0x1f')](_0x25d48c['query'][_0x514d('0x1f')]);_0x13ab47['offset']=qs[_0x514d('0x1d')](_0x25d48c['query'][_0x514d('0x1d')]);}_0x13ab47[_0x514d('0x3b')]=qs[_0x514d('0x3c')](_0x25d48c[_0x514d('0x32')][_0x514d('0x3c')]);_0x13ab47[_0x514d('0x3d')]=qs[_0x514d('0x34')](_['pick'](_0x25d48c[_0x514d('0x32')],_0xb44e28[_0x514d('0x34')]));_0x13ab47[_0x514d('0x3d')][_0x514d('0x5e')]=_0x14d44a['id'];if(_0x25d48c['query']['filter']){_0x13ab47[_0x514d('0x3d')]=_['merge'](_0x13ab47[_0x514d('0x3d')],{'$or':_[_0x514d('0x2d')](_0x13ab47[_0x514d('0x37')],function(_0x4b9617){var _0x1d13d9={};_0x1d13d9[_0x4b9617]={'$like':'%'+_0x25d48c[_0x514d('0x32')][_0x514d('0x3e')]+'%'};return _0x1d13d9;})});}_0x13ab47=_[_0x514d('0x3f')]({},_0x13ab47,_0x25d48c[_0x514d('0x41')]);return db[_0x514d('0x5f')][_0x514d('0x20')]({'where':_0x13ab47[_0x514d('0x3d')]})[_0x514d('0x25')](function(_0x4592a5){_0x1b3a4d[_0x514d('0x20')]=_0x4592a5;if(_0x25d48c[_0x514d('0x32')][_0x514d('0x43')]){_0x13ab47['include']=[{'all':!![]}];}return db[_0x514d('0x5f')]['findAll'](_0x13ab47);})['then'](function(_0x2e4762){_0x1b3a4d[_0x514d('0x46')]=_0x2e4762;return _0x1b3a4d;});}})[_0x514d('0x25')](respondWithFilteredResult(_0x47637a,_0x13ab47))[_0x514d('0x47')](handleError(_0x47637a,null));};exports['getHopperFinals']=function(_0x26e461,_0x272dba,_0x2b2152){var _0x557bdb={'raw':!![],'where':{}};var _0x1b5838={};var _0x4bdb2b={'count':0x0,'rows':[]};return db[_0x514d('0x42')]['findOne']({'where':{'id':_0x26e461[_0x514d('0x48')]['id']}})['then'](handleEntityNotFound(_0x272dba,null))[_0x514d('0x25')](function(_0x2795e9){if(_0x2795e9){_0x1b5838['model']=_[_0x514d('0x33')](db['CmHopperFinal'][_0x514d('0x2e')]);_0x1b5838['query']=_[_0x514d('0x33')](_0x26e461[_0x514d('0x32')]);_0x1b5838[_0x514d('0x34')]=_[_0x514d('0x35')](_0x1b5838[_0x514d('0x36')],_0x1b5838[_0x514d('0x32')]);_0x557bdb[_0x514d('0x37')]=_[_0x514d('0x35')](_0x1b5838[_0x514d('0x36')],qs[_0x514d('0x49')](_0x26e461[_0x514d('0x32')]['fields']));_0x557bdb[_0x514d('0x37')]=_0x557bdb['attributes'][_0x514d('0x38')]?_0x557bdb['attributes']:_0x1b5838['model'];if(!_0x26e461[_0x514d('0x32')][_0x514d('0x39')](_0x514d('0x3a'))){_0x557bdb[_0x514d('0x1f')]=qs[_0x514d('0x1f')](_0x26e461[_0x514d('0x32')][_0x514d('0x1f')]);_0x557bdb[_0x514d('0x1d')]=qs[_0x514d('0x1d')](_0x26e461['query']['offset']);}_0x557bdb[_0x514d('0x3b')]=qs[_0x514d('0x3c')](_0x26e461[_0x514d('0x32')][_0x514d('0x3c')]);_0x557bdb[_0x514d('0x3d')]=qs['filters'](_['pick'](_0x26e461[_0x514d('0x32')],_0x1b5838[_0x514d('0x34')]));_0x557bdb[_0x514d('0x3d')]['CampaignId']=_0x2795e9['id'];if(_0x26e461[_0x514d('0x32')]['filter']){_0x557bdb['where']=_['merge'](_0x557bdb[_0x514d('0x3d')],{'$or':_[_0x514d('0x2d')](_0x557bdb['attributes'],function(_0x416c8e){var _0x25738c={};_0x25738c[_0x416c8e]={'$like':'%'+_0x26e461[_0x514d('0x32')][_0x514d('0x3e')]+'%'};return _0x25738c;})});}_0x557bdb=_[_0x514d('0x3f')]({},_0x557bdb,_0x26e461[_0x514d('0x41')]);return db[_0x514d('0x60')]['count']({'where':_0x557bdb[_0x514d('0x3d')]})[_0x514d('0x25')](function(_0xfcf8b8){_0x4bdb2b[_0x514d('0x20')]=_0xfcf8b8;if(_0x26e461[_0x514d('0x32')][_0x514d('0x43')]){_0x557bdb[_0x514d('0x44')]=[{'all':!![]}];}return db[_0x514d('0x60')]['findAll'](_0x557bdb);})['then'](function(_0x3b9443){_0x4bdb2b[_0x514d('0x46')]=_0x3b9443;return _0x4bdb2b;});}})[_0x514d('0x25')](respondWithFilteredResult(_0x272dba,_0x557bdb))['catch'](handleError(_0x272dba,null));};exports[_0x514d('0x61')]=function(_0x4c0465,_0x2747d6,_0x53db6a){var _0x1f7444={'raw':!![],'where':{}};var _0x171d8e={};var _0x46e895={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x4c0465['params']['id']}})[_0x514d('0x25')](handleEntityNotFound(_0x2747d6,null))[_0x514d('0x25')](function(_0xc88029){if(_0xc88029){_0x171d8e[_0x514d('0x36')]=_[_0x514d('0x33')](db[_0x514d('0x62')][_0x514d('0x2e')]);_0x171d8e[_0x514d('0x32')]=_[_0x514d('0x33')](_0x4c0465[_0x514d('0x32')]);_0x171d8e[_0x514d('0x34')]=_[_0x514d('0x35')](_0x171d8e[_0x514d('0x36')],_0x171d8e[_0x514d('0x32')]);_0x1f7444[_0x514d('0x37')]=_[_0x514d('0x35')](_0x171d8e[_0x514d('0x36')],qs[_0x514d('0x49')](_0x4c0465[_0x514d('0x32')]['fields']));_0x1f7444[_0x514d('0x37')]=_0x1f7444[_0x514d('0x37')][_0x514d('0x38')]?_0x1f7444[_0x514d('0x37')]:_0x171d8e[_0x514d('0x36')];if(!_0x4c0465[_0x514d('0x32')][_0x514d('0x39')](_0x514d('0x3a'))){_0x1f7444['limit']=qs['limit'](_0x4c0465[_0x514d('0x32')][_0x514d('0x1f')]);_0x1f7444[_0x514d('0x1d')]=qs[_0x514d('0x1d')](_0x4c0465['query'][_0x514d('0x1d')]);}_0x1f7444['order']=qs['sort'](_0x4c0465['query']['sort']);_0x1f7444[_0x514d('0x3d')]=qs[_0x514d('0x34')](_[_0x514d('0x5d')](_0x4c0465['query'],_0x171d8e[_0x514d('0x34')]));_0x1f7444[_0x514d('0x3d')]['CampaignId']=_0xc88029['id'];if(_0x4c0465[_0x514d('0x32')][_0x514d('0x3e')]){_0x1f7444[_0x514d('0x3d')]=_[_0x514d('0x3f')](_0x1f7444[_0x514d('0x3d')],{'$or':_[_0x514d('0x2d')](_0x1f7444[_0x514d('0x37')],function(_0x2fd217){var _0x8c3c5d={};_0x8c3c5d[_0x2fd217]={'$like':'%'+_0x4c0465[_0x514d('0x32')][_0x514d('0x3e')]+'%'};return _0x8c3c5d;})});}_0x1f7444=_[_0x514d('0x3f')]({},_0x1f7444,_0x4c0465[_0x514d('0x41')]);return db['CmHopperBlack'][_0x514d('0x20')]({'where':_0x1f7444[_0x514d('0x3d')]})[_0x514d('0x25')](function(_0x5c8db6){_0x46e895[_0x514d('0x20')]=_0x5c8db6;if(_0x4c0465[_0x514d('0x32')][_0x514d('0x43')]){_0x1f7444[_0x514d('0x44')]=[{'all':!![]}];}return db[_0x514d('0x62')]['findAll'](_0x1f7444);})[_0x514d('0x25')](function(_0x501816){_0x46e895['rows']=_0x501816;return _0x46e895;});}})[_0x514d('0x25')](respondWithFilteredResult(_0x2747d6,_0x1f7444))[_0x514d('0x47')](handleError(_0x2747d6,null));};exports[_0x514d('0x63')]=function(_0x13ca1a,_0x1d8d0e,_0x338df0){var _0x49e89c={};var _0x3e25c3={};var _0x3d0902;var _0x5d7081;return db[_0x514d('0x42')][_0x514d('0x5b')]({'where':{'id':_0x13ca1a['params']['id']}})[_0x514d('0x25')](handleEntityNotFound(_0x1d8d0e,null))[_0x514d('0x25')](function(_0x2c503d){if(_0x2c503d){_0x3d0902=_0x2c503d;_0x3e25c3['model']=_['keys'](db['CmList'][_0x514d('0x2e')]);_0x3e25c3[_0x514d('0x32')]=_['keys'](_0x13ca1a[_0x514d('0x32')]);_0x3e25c3[_0x514d('0x34')]=_['intersection'](_0x3e25c3[_0x514d('0x36')],_0x3e25c3['query']);_0x49e89c[_0x514d('0x37')]=_['intersection'](_0x3e25c3[_0x514d('0x36')],qs[_0x514d('0x49')](_0x13ca1a[_0x514d('0x32')][_0x514d('0x49')]));_0x49e89c[_0x514d('0x37')]=_0x49e89c[_0x514d('0x37')][_0x514d('0x38')]?_0x49e89c[_0x514d('0x37')]:_0x3e25c3[_0x514d('0x36')];_0x49e89c[_0x514d('0x3b')]=qs[_0x514d('0x3c')](_0x13ca1a[_0x514d('0x32')][_0x514d('0x3c')]);_0x49e89c[_0x514d('0x3d')]=qs[_0x514d('0x34')](_[_0x514d('0x5d')](_0x13ca1a['query'],_0x3e25c3[_0x514d('0x34')]));if(_0x13ca1a[_0x514d('0x32')][_0x514d('0x3e')]){_0x49e89c[_0x514d('0x3d')]=_['merge'](_0x49e89c[_0x514d('0x3d')],{'$or':_['map'](_0x49e89c[_0x514d('0x37')],function(_0x7d73f5){var _0x543e89={};_0x543e89[_0x7d73f5]={'$like':'%'+_0x13ca1a['query']['filter']+'%'};return _0x543e89;})});}_0x49e89c=_[_0x514d('0x3f')]({},_0x49e89c,_0x13ca1a[_0x514d('0x41')]);return _0x3d0902[_0x514d('0x63')](_0x49e89c);}})[_0x514d('0x25')](function(_0x4eb381){if(_0x4eb381){_0x5d7081=_0x4eb381['length'];if(!_0x13ca1a[_0x514d('0x32')][_0x514d('0x39')](_0x514d('0x3a'))){_0x49e89c[_0x514d('0x1f')]=qs[_0x514d('0x1f')](_0x13ca1a['query'][_0x514d('0x1f')]);_0x49e89c[_0x514d('0x1d')]=qs[_0x514d('0x1d')](_0x13ca1a['query'][_0x514d('0x1d')]);}return _0x3d0902[_0x514d('0x63')](_0x49e89c);}})[_0x514d('0x25')](function(_0x1b7c06){if(_0x1b7c06){return _0x1b7c06?{'count':_0x5d7081,'rows':_0x1b7c06}:null;}})[_0x514d('0x25')](respondWithResult(_0x1d8d0e,null))[_0x514d('0x47')](handleError(_0x1d8d0e,null));};exports[_0x514d('0x64')]=function(_0x59590c,_0x4f705b,_0x478f34){var _0x180b9a,_0xda68ad;return db['Campaign'][_0x514d('0x4a')]({'where':{'id':_0x59590c['params']['id']}})[_0x514d('0x25')](handleEntityNotFound(_0x4f705b,null))['then'](function(_0x38cd35){if(_0x38cd35){_0xda68ad=_0x38cd35;return _0x38cd35[_0x514d('0x64')](_0x59590c['body'][_0x514d('0x65')],_['omit'](_0x59590c[_0x514d('0x56')],[_0x514d('0x65'),'id'])||{});}return null;})['spread'](function(_0x3c9b89){var _0x4def94;_0x180b9a=_0x3c9b89||[];var _0x59751d=[];if(_0x3c9b89){for(var _0x806d=0x0;_0x806d<_0x3c9b89[_0x514d('0x38')];_0x806d+=0x1){var _0xb0a3b4=_0x3c9b89[_0x806d][_0x514d('0x4d')]({'plain':!![]});_0xda68ad[_0x514d('0x66')]=_0x59590c['body'][_0x514d('0x66')]?_0x59590c[_0x514d('0x56')]['dialCheckDuplicateType']:_0xda68ad[_0x514d('0x66')];switch(_0xda68ad[_0x514d('0x66')]){case _0x514d('0x67'):_0x4def94=squel[_0x514d('0x68')]()[_0x514d('0x69')](_0x514d('0x6a'))[_0x514d('0x6b')]([_0x514d('0x6c'),_0x514d('0x6d'),_0x514d('0x6e'),_0x514d('0x6f'),'CampaignId',_0x514d('0x57'),_0x514d('0x54')],squel[_0x514d('0x70')]()[_0x514d('0x71')](_0x514d('0x6c'),_0x514d('0x6c'))[_0x514d('0x71')](_0x514d('0x72'),'scheduledAt')['field']('id','ContactId')[_0x514d('0x71')](_0xb0a3b4[_0x514d('0x73')]['toString'](),_0x514d('0x6f'))[_0x514d('0x71')](_0x59590c[_0x514d('0x48')]['id'][_0x514d('0x74')](),'CampaignId')[_0x514d('0x71')](_0x514d('0x72'),_0x514d('0x57'))[_0x514d('0x71')](_0x514d('0x72'),_0x514d('0x54'))[_0x514d('0x75')](_0x514d('0x76'))[_0x514d('0x3d')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0xb0a3b4[_0x514d('0x73')][_0x514d('0x74')]())[_0x514d('0x3d')](_0x514d('0x77'))[_0x514d('0x3d')](_0x514d('0x78'),squel[_0x514d('0x70')]()[_0x514d('0x71')](_0x514d('0x79'))[_0x514d('0x75')](_0x514d('0x7a'))[_0x514d('0x3d')](_0x514d('0x7b'),_0x59590c[_0x514d('0x48')]['id']['toString']()))[_0x514d('0x3d')](_0x514d('0x78'),squel[_0x514d('0x70')]()[_0x514d('0x71')](_0x514d('0x7c'))[_0x514d('0x75')](_0x514d('0x6a'))[_0x514d('0x3d')]('CampaignId\x20=\x20?',_0x59590c[_0x514d('0x48')]['id'][_0x514d('0x74')]())))['toString']();break;case'onlyIfOpen':_0x4def94=squel['insert']()[_0x514d('0x69')](_0x514d('0x6a'))[_0x514d('0x6b')](['phone',_0x514d('0x6d'),_0x514d('0x6e'),_0x514d('0x6f'),_0x514d('0x5e'),'createdAt',_0x514d('0x54')],squel['select']()[_0x514d('0x71')](_0x514d('0x6c'),_0x514d('0x6c'))[_0x514d('0x71')](_0x514d('0x72'),_0x514d('0x6d'))[_0x514d('0x71')]('id',_0x514d('0x6e'))[_0x514d('0x71')](_0xb0a3b4['CmListId'][_0x514d('0x74')](),'ListId')[_0x514d('0x71')](_0x59590c['params']['id'][_0x514d('0x74')](),_0x514d('0x5e'))[_0x514d('0x71')](_0x514d('0x72'),_0x514d('0x57'))[_0x514d('0x71')](_0x514d('0x72'),_0x514d('0x54'))['from'](_0x514d('0x76'))[_0x514d('0x3d')]('deletedAt\x20IS\x20NULL')[_0x514d('0x3d')]('ListId\x20=\x20?',_0xb0a3b4[_0x514d('0x73')][_0x514d('0x74')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0x514d('0x3d')](_0x514d('0x78'),squel[_0x514d('0x70')]()[_0x514d('0x71')]('COALESCE(phone,\x27\x27)')[_0x514d('0x75')](_0x514d('0x6a'))[_0x514d('0x3d')](_0x514d('0x7b'),_0x59590c[_0x514d('0x48')]['id'][_0x514d('0x74')]())))['toString']();break;default:_0x4def94=squel[_0x514d('0x68')]()[_0x514d('0x69')](_0x514d('0x6a'))[_0x514d('0x6b')]([_0x514d('0x6c'),_0x514d('0x6d'),'ContactId',_0x514d('0x6f'),_0x514d('0x5e'),_0x514d('0x57'),_0x514d('0x54')],squel[_0x514d('0x70')]()[_0x514d('0x71')](_0x514d('0x6c'),_0x514d('0x6c'))[_0x514d('0x71')](_0x514d('0x72'),_0x514d('0x6d'))[_0x514d('0x71')]('id',_0x514d('0x6e'))[_0x514d('0x71')](_0xb0a3b4['CmListId']['toString'](),'ListId')['field'](_0x59590c[_0x514d('0x48')]['id'][_0x514d('0x74')](),_0x514d('0x5e'))['field'](_0x514d('0x72'),_0x514d('0x57'))[_0x514d('0x71')](_0x514d('0x72'),_0x514d('0x54'))['from']('cm_contacts')['where'](_0x514d('0x7d'))[_0x514d('0x3d')]('ListId\x20=\x20?',_0xb0a3b4['CmListId'][_0x514d('0x74')]())[_0x514d('0x3d')](_0x514d('0x77')))['toString']();}_0x59751d[_0x514d('0x7e')](db[_0x514d('0x7f')][_0x514d('0x32')](_0x4def94));}return BPromise['all'](_0x59751d);}})['then'](function(){return _0x180b9a;})[_0x514d('0x25')](respondWithResult(_0x4f705b,null))[_0x514d('0x47')](handleError(_0x4f705b,null));};exports[_0x514d('0x80')]=function(_0xf9263e,_0x41efd1,_0x574dd3){return db[_0x514d('0x42')][_0x514d('0x4a')]({'where':{'id':_0xf9263e[_0x514d('0x48')]['id']}})[_0x514d('0x25')](handleEntityNotFound(_0x41efd1,null))['then'](function(_0xd479cf){if(_0xd479cf){return _0xd479cf[_0x514d('0x80')](_0xf9263e['query'][_0x514d('0x65')]);}})[_0x514d('0x25')](function(_0x4980a8){if(_0x4980a8){return db[_0x514d('0x5c')]['destroy']({'where':{'ListId':_0xf9263e[_0x514d('0x32')]['ids'],'CampaignId':_0xf9263e[_0x514d('0x48')]['id']}})['then'](function(){return _0x4980a8;});}})[_0x514d('0x25')](respondWithStatusCode(_0x41efd1,null))[_0x514d('0x47')](handleError(_0x41efd1,null));};exports[_0x514d('0x81')]=function(_0xeecdc9,_0x4db986,_0x20ee5d){var _0x521005={};var _0x4ee27c={};var _0x1ec75f;var _0x1ef431;return db['Campaign']['findOne']({'where':{'id':_0xeecdc9[_0x514d('0x48')]['id']}})['then'](handleEntityNotFound(_0x4db986,null))[_0x514d('0x25')](function(_0xb63b1f){if(_0xb63b1f){_0x1ec75f=_0xb63b1f;_0x4ee27c['model']=_['keys'](db[_0x514d('0x82')][_0x514d('0x2e')]);_0x4ee27c[_0x514d('0x32')]=_['keys'](_0xeecdc9[_0x514d('0x32')]);_0x4ee27c[_0x514d('0x34')]=_['intersection'](_0x4ee27c['model'],_0x4ee27c['query']);_0x521005['attributes']=_['intersection'](_0x4ee27c[_0x514d('0x36')],qs[_0x514d('0x49')](_0xeecdc9[_0x514d('0x32')][_0x514d('0x49')]));_0x521005['attributes']=_0x521005[_0x514d('0x37')][_0x514d('0x38')]?_0x521005[_0x514d('0x37')]:_0x4ee27c['model'];_0x521005[_0x514d('0x3b')]=qs['sort'](_0xeecdc9['query'][_0x514d('0x3c')]);_0x521005[_0x514d('0x3d')]=qs['filters'](_['pick'](_0xeecdc9[_0x514d('0x32')],_0x4ee27c[_0x514d('0x34')]));if(_0xeecdc9[_0x514d('0x32')][_0x514d('0x3e')]){_0x521005[_0x514d('0x3d')]=_[_0x514d('0x3f')](_0x521005[_0x514d('0x3d')],{'$or':_[_0x514d('0x2d')](_0x521005['attributes'],function(_0x1261df){var _0x36240f={};_0x36240f[_0x1261df]={'$like':'%'+_0xeecdc9[_0x514d('0x32')][_0x514d('0x3e')]+'%'};return _0x36240f;})});}_0x521005=_[_0x514d('0x3f')]({},_0x521005,_0xeecdc9[_0x514d('0x41')]);return _0x1ec75f[_0x514d('0x81')](_0x521005);}})['then'](function(_0x4bc656){if(_0x4bc656){_0x1ef431=_0x4bc656[_0x514d('0x38')];if(!_0xeecdc9[_0x514d('0x32')][_0x514d('0x39')](_0x514d('0x3a'))){_0x521005[_0x514d('0x1f')]=qs[_0x514d('0x1f')](_0xeecdc9['query'][_0x514d('0x1f')]);_0x521005[_0x514d('0x1d')]=qs[_0x514d('0x1d')](_0xeecdc9[_0x514d('0x32')][_0x514d('0x1d')]);}return _0x1ec75f[_0x514d('0x81')](_0x521005);}})['then'](function(_0x22ad24){if(_0x22ad24){return _0x22ad24?{'count':_0x1ef431,'rows':_0x22ad24}:null;}})['then'](respondWithResult(_0x4db986,null))['catch'](handleError(_0x4db986,null));};exports['addBlackLists']=function(_0x3c9d5f,_0x8d1adf,_0x1a3b87){var _0x2500b9,_0x304e8b;return db['Campaign']['find']({'where':{'id':_0x3c9d5f[_0x514d('0x48')]['id']}})[_0x514d('0x25')](handleEntityNotFound(_0x8d1adf,null))[_0x514d('0x25')](function(_0x423f84){if(_0x423f84){_0x304e8b=_0x423f84;return _0x423f84[_0x514d('0x83')](_0x3c9d5f[_0x514d('0x56')]['ids'],_['omit'](_0x3c9d5f[_0x514d('0x56')],[_0x514d('0x65'),'id'])||{});}return null;})['spread'](function(_0x6ecdd0){var _0x5aad35;_0x2500b9=_0x6ecdd0||[];var _0x5ddff2=[];if(_0x6ecdd0){for(var _0x393d46=0x0;_0x393d46<_0x6ecdd0[_0x514d('0x38')];_0x393d46+=0x1){var _0x2f2a03=_0x6ecdd0[_0x393d46][_0x514d('0x4d')]({'plain':!![]});_0x5aad35=squel[_0x514d('0x68')]()[_0x514d('0x69')](_0x514d('0x84'))['fromQuery']([_0x514d('0x6c'),_0x514d('0x6e'),'ListId','CampaignId',_0x514d('0x57'),_0x514d('0x54')],squel['select']()['field']('phone',_0x514d('0x6c'))[_0x514d('0x71')]('id','ContactId')['field'](_0x2f2a03[_0x514d('0x73')][_0x514d('0x74')](),'ListId')['field'](_0x3c9d5f[_0x514d('0x48')]['id'][_0x514d('0x74')](),_0x514d('0x5e'))['field'](_0x514d('0x72'),_0x514d('0x57'))[_0x514d('0x71')](_0x514d('0x72'),'updatedAt')[_0x514d('0x75')]('cm_contacts')[_0x514d('0x3d')](_0x514d('0x7d'))[_0x514d('0x3d')]('ListId\x20=\x20?',_0x2f2a03['CmListId'][_0x514d('0x74')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x514d('0x74')]();_0x5ddff2['push'](db['sequelize']['query'](_0x5aad35));}return BPromise['all'](_0x5ddff2);}})[_0x514d('0x25')](function(){return _0x2500b9;})[_0x514d('0x25')](respondWithResult(_0x8d1adf,null))[_0x514d('0x47')](handleError(_0x8d1adf,null));};exports[_0x514d('0x85')]=function(_0x5bfdff,_0xe06fd5,_0x5b0128){return db['Campaign'][_0x514d('0x4a')]({'where':{'id':_0x5bfdff['params']['id']}})['then'](handleEntityNotFound(_0xe06fd5,null))['then'](function(_0xcc76ee){if(_0xcc76ee){return _0xcc76ee[_0x514d('0x85')](_0x5bfdff[_0x514d('0x32')][_0x514d('0x65')]);}})['then'](function(_0x5db22a){if(_0x5db22a){return db['CmHopperBlack'][_0x514d('0x26')]({'where':{'ListId':_0x5bfdff[_0x514d('0x32')]['ids'],'CampaignId':_0x5bfdff[_0x514d('0x48')]['id']}})[_0x514d('0x25')](function(){return _0x5db22a;});}})[_0x514d('0x25')](respondWithStatusCode(_0xe06fd5,null))[_0x514d('0x47')](handleError(_0xe06fd5,null));}; \ No newline at end of file +var _0x1d0a=['status','end','json','offset','undefined','limit','Content-Range','apply','reject','save','then','destroy','IvrCampaigns','UserProfileResource','stack','name','send','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','order','sort','where','pick','filter','merge','map','VIRTUAL','options','Campaign','count','includeAll','include','findAll','rows','catch','show','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','updatedAt','omit','userProfileId','error','getHoppers','findOne','hasOwnProperty','nolimit','CmHopper','getHopperHistories','CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','ContactId','ListId','createdAt','select','field','scheduledAt','CmListId','toString','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','push','sequelize','removeLists','getBlackLists','addBlackLists','cm_hopper_black','all','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x4f2864,_0x178e33){var _0x26b4e6=function(_0x540d0d){while(--_0x540d0d){_0x4f2864['push'](_0x4f2864['shift']());}};_0x26b4e6(++_0x178e33);}(_0x1d0a,0xf6));var _0xa1d0=function(_0x2acce1,_0x431059){_0x2acce1=_0x2acce1-0x0;var _0x48dd1c=_0x1d0a[_0x2acce1];return _0x48dd1c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa1d0('0x0'));var zipdir=require(_0xa1d0('0x1'));var jsonpatch=require(_0xa1d0('0x2'));var rp=require(_0xa1d0('0x3'));var moment=require('moment');var BPromise=require(_0xa1d0('0x4'));var Mustache=require(_0xa1d0('0x5'));var util=require(_0xa1d0('0x6'));var path=require('path');var sox=require(_0xa1d0('0x7'));var csv=require(_0xa1d0('0x8'));var ejs=require(_0xa1d0('0x9'));var fs=require('fs');var fs_extra=require(_0xa1d0('0xa'));var _=require(_0xa1d0('0xb'));var squel=require('squel');var crypto=require(_0xa1d0('0xc'));var jsforce=require(_0xa1d0('0xd'));var deskjs=require(_0xa1d0('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa1d0('0xf'));var Papa=require(_0xa1d0('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa1d0('0x11'));var as=require(_0xa1d0('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa1d0('0x13'))(_0xa1d0('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa1d0('0x15'));var db=require(_0xa1d0('0x16'))['db'];function respondWithStatusCode(_0x4df199,_0x50c2b4){_0x50c2b4=_0x50c2b4||0xcc;return function(_0x34b630){if(_0x34b630){return _0x4df199[_0xa1d0('0x17')](_0x50c2b4);}return _0x4df199[_0xa1d0('0x18')](_0x50c2b4)[_0xa1d0('0x19')]();};}function respondWithResult(_0x549359,_0x54b735){_0x54b735=_0x54b735||0xc8;return function(_0x22e208){if(_0x22e208){return _0x549359[_0xa1d0('0x18')](_0x54b735)[_0xa1d0('0x1a')](_0x22e208);}};}function respondWithFilteredResult(_0x2b8f4a,_0x1b534f){return function(_0x1cb68d){if(_0x1cb68d){var _0x114959=typeof _0x1b534f[_0xa1d0('0x1b')]===_0xa1d0('0x1c')&&typeof _0x1b534f[_0xa1d0('0x1d')]===_0xa1d0('0x1c');var _0x531bbd=_0x1cb68d['count'];var _0x5551d3=_0x114959?0x0:_0x1b534f[_0xa1d0('0x1b')];var _0x28826f=_0x114959?_0x1cb68d['count']:_0x1b534f[_0xa1d0('0x1b')]+_0x1b534f[_0xa1d0('0x1d')];var _0x169af0;if(_0x28826f>=_0x531bbd){_0x28826f=_0x531bbd;_0x169af0=0xc8;}else{_0x169af0=0xce;}_0x2b8f4a[_0xa1d0('0x18')](_0x169af0);return _0x2b8f4a['set'](_0xa1d0('0x1e'),_0x5551d3+'-'+_0x28826f+'/'+_0x531bbd)[_0xa1d0('0x1a')](_0x1cb68d);}return null;};}function patchUpdates(_0x7354f4){return function(_0x143fcb){try{jsonpatch[_0xa1d0('0x1f')](_0x143fcb,_0x7354f4,!![]);}catch(_0x6733fa){return BPromise[_0xa1d0('0x20')](_0x6733fa);}return _0x143fcb[_0xa1d0('0x21')]();};}function saveUpdates(_0x2566aa,_0x5ae730){return function(_0x3806dd){if(_0x3806dd){return _0x3806dd['update'](_0x2566aa)[_0xa1d0('0x22')](function(_0x553890){return _0x553890;});}return null;};}function removeEntity(_0x3b6623,_0x8446a3){return function(_0x57e2f8){if(_0x57e2f8){return _0x57e2f8[_0xa1d0('0x23')]()[_0xa1d0('0x22')](function(){var _0x3a22ea=_0x57e2f8['get']({'plain':!![]});var _0x4753ee=_0xa1d0('0x24');return db[_0xa1d0('0x25')][_0xa1d0('0x23')]({'where':{'type':_0x4753ee,'resourceId':_0x3a22ea['id']}})[_0xa1d0('0x22')](function(){return _0x57e2f8;});})['then'](function(){_0x3b6623[_0xa1d0('0x18')](0xcc)[_0xa1d0('0x19')]();});}};}function handleEntityNotFound(_0x334141,_0x16dd24){return function(_0x1e4774){if(!_0x1e4774){_0x334141[_0xa1d0('0x17')](0x194);}return _0x1e4774;};}function handleError(_0x29cbf7,_0x407829){_0x407829=_0x407829||0x1f4;return function(_0x541551){logger['error'](_0x541551[_0xa1d0('0x26')]);if(_0x541551[_0xa1d0('0x27')]){delete _0x541551[_0xa1d0('0x27')];}_0x29cbf7[_0xa1d0('0x18')](_0x407829)[_0xa1d0('0x28')](_0x541551);};}exports['index']=function(_0x3b5b3b,_0x4461ec){var _0x50b6cc={},_0x25acb5={},_0x4aa53b={'count':0x0,'rows':[]};var _0x3d44e8=_['map'](db['Campaign'][_0xa1d0('0x29')],function(_0x311366){return{'name':_0x311366[_0xa1d0('0x2a')],'type':_0x311366[_0xa1d0('0x2b')][_0xa1d0('0x2c')]};});_0x25acb5['model']=_['map'](_0x3d44e8,_0xa1d0('0x27'));_0x25acb5[_0xa1d0('0x2d')]=_[_0xa1d0('0x2e')](_0x3b5b3b[_0xa1d0('0x2d')]);_0x25acb5[_0xa1d0('0x2f')]=_[_0xa1d0('0x30')](_0x25acb5[_0xa1d0('0x31')],_0x25acb5[_0xa1d0('0x2d')]);_0x50b6cc[_0xa1d0('0x32')]=_[_0xa1d0('0x30')](_0x25acb5[_0xa1d0('0x31')],qs[_0xa1d0('0x33')](_0x3b5b3b[_0xa1d0('0x2d')][_0xa1d0('0x33')]));_0x50b6cc[_0xa1d0('0x32')]=_0x50b6cc[_0xa1d0('0x32')][_0xa1d0('0x34')]?_0x50b6cc[_0xa1d0('0x32')]:_0x25acb5[_0xa1d0('0x31')];if(!_0x3b5b3b[_0xa1d0('0x2d')]['hasOwnProperty']('nolimit')){_0x50b6cc[_0xa1d0('0x1d')]=qs['limit'](_0x3b5b3b['query'][_0xa1d0('0x1d')]);_0x50b6cc['offset']=qs[_0xa1d0('0x1b')](_0x3b5b3b['query'][_0xa1d0('0x1b')]);}_0x50b6cc[_0xa1d0('0x35')]=qs['sort'](_0x3b5b3b[_0xa1d0('0x2d')][_0xa1d0('0x36')]);_0x50b6cc[_0xa1d0('0x37')]=qs[_0xa1d0('0x2f')](_[_0xa1d0('0x38')](_0x3b5b3b['query'],_0x25acb5['filters']),_0x3d44e8);if(_0x3b5b3b[_0xa1d0('0x2d')][_0xa1d0('0x39')]){_0x50b6cc[_0xa1d0('0x37')]=_[_0xa1d0('0x3a')](_0x50b6cc['where'],{'$or':_[_0xa1d0('0x3b')](_0x3d44e8,function(_0x4a9b74){if(_0x4a9b74['type']!==_0xa1d0('0x3c')){var _0x8a072a={};_0x8a072a[_0x4a9b74['name']]={'$like':'%'+_0x3b5b3b[_0xa1d0('0x2d')][_0xa1d0('0x39')]+'%'};return _0x8a072a;}})});}_0x50b6cc=_['merge']({},_0x50b6cc,_0x3b5b3b[_0xa1d0('0x3d')]);var _0x6ec6f6={'where':_0x50b6cc[_0xa1d0('0x37')]};return db[_0xa1d0('0x3e')]['count'](_0x6ec6f6)[_0xa1d0('0x22')](function(_0x28baba){_0x4aa53b[_0xa1d0('0x3f')]=_0x28baba;if(_0x3b5b3b['query'][_0xa1d0('0x40')]){_0x50b6cc[_0xa1d0('0x41')]=[{'all':!![]}];}return db[_0xa1d0('0x3e')][_0xa1d0('0x42')](_0x50b6cc);})[_0xa1d0('0x22')](function(_0x4cc550){_0x4aa53b[_0xa1d0('0x43')]=_0x4cc550;return _0x4aa53b;})['then'](respondWithFilteredResult(_0x4461ec,_0x50b6cc))[_0xa1d0('0x44')](handleError(_0x4461ec,null));};exports[_0xa1d0('0x45')]=function(_0x561299,_0xfb4d54){var _0x3baaf8={'raw':![],'where':{'id':_0x561299['params']['id']}},_0x2b3b46={};_0x2b3b46[_0xa1d0('0x31')]=_['keys'](db['Campaign']['rawAttributes']);_0x2b3b46['query']=_[_0xa1d0('0x2e')](_0x561299[_0xa1d0('0x2d')]);_0x2b3b46['filters']=_[_0xa1d0('0x30')](_0x2b3b46[_0xa1d0('0x31')],_0x2b3b46[_0xa1d0('0x2d')]);_0x3baaf8[_0xa1d0('0x32')]=_['intersection'](_0x2b3b46[_0xa1d0('0x31')],qs[_0xa1d0('0x33')](_0x561299[_0xa1d0('0x2d')][_0xa1d0('0x33')]));_0x3baaf8[_0xa1d0('0x32')]=_0x3baaf8[_0xa1d0('0x32')][_0xa1d0('0x34')]?_0x3baaf8[_0xa1d0('0x32')]:_0x2b3b46[_0xa1d0('0x31')];if(_0x561299['query'][_0xa1d0('0x40')]){_0x3baaf8[_0xa1d0('0x41')]=[{'all':!![]}];}_0x3baaf8=_[_0xa1d0('0x3a')]({},_0x3baaf8,_0x561299[_0xa1d0('0x3d')]);return db['Campaign'][_0xa1d0('0x46')](_0x3baaf8)['then'](handleEntityNotFound(_0xfb4d54,null))[_0xa1d0('0x22')](respondWithResult(_0xfb4d54,null))[_0xa1d0('0x44')](handleError(_0xfb4d54,null));};exports[_0xa1d0('0x47')]=function(_0x2ba569,_0x5f5a13){return db[_0xa1d0('0x3e')][_0xa1d0('0x47')](_0x2ba569[_0xa1d0('0x48')],{})[_0xa1d0('0x22')](function(_0x36e133){var _0x2222f0=_0x2ba569['user'][_0xa1d0('0x49')]({'plain':!![]});if(!_0x2222f0)throw new Error(_0xa1d0('0x4a'));if(_0x2222f0[_0xa1d0('0x4b')]===_0xa1d0('0x4c')){var _0x1ca576=_0x36e133[_0xa1d0('0x49')]({'plain':!![]});var _0x190fc0=_0xa1d0('0x24');return db[_0xa1d0('0x4d')]['find']({'where':{'name':_0x190fc0,'userProfileId':_0x2222f0['userProfileId']},'raw':!![]})[_0xa1d0('0x22')](function(_0x4ff58e){if(_0x4ff58e&&_0x4ff58e[_0xa1d0('0x4e')]===0x0){return db[_0xa1d0('0x25')][_0xa1d0('0x47')]({'name':_0x1ca576['name'],'resourceId':_0x1ca576['id'],'type':_0x4ff58e[_0xa1d0('0x27')],'sectionId':_0x4ff58e['id']},{})[_0xa1d0('0x22')](function(){return _0x36e133;});}else{return _0x36e133;}})[_0xa1d0('0x44')](function(_0x589f7f){logger['error'](_0xa1d0('0x4f'),_0x589f7f);throw _0x589f7f;});}return _0x36e133;})['then'](respondWithResult(_0x5f5a13,0xc9))[_0xa1d0('0x44')](handleError(_0x5f5a13,null));};exports['clone']=function(_0x42c27b,_0x5371c0){var _0x32226d={'where':{'id':_0x42c27b[_0xa1d0('0x50')]['id']}},_0x5a917b={};_0x5a917b['model']=_[_0xa1d0('0x2e')](db['Campaign']['rawAttributes']);_0x32226d[_0xa1d0('0x32')]=_['intersection'](_0x5a917b[_0xa1d0('0x31')],qs['fields'](_0x42c27b[_0xa1d0('0x2d')][_0xa1d0('0x33')]));_0x32226d[_0xa1d0('0x32')]=_0x32226d[_0xa1d0('0x32')][_0xa1d0('0x34')]?_0x32226d['attributes']:_0x5a917b[_0xa1d0('0x31')];if(_0x42c27b[_0xa1d0('0x2d')][_0xa1d0('0x40')]){_0x32226d[_0xa1d0('0x41')]=[{'all':!![]}];}_0x32226d=_['merge']({},_0x32226d,_0x42c27b[_0xa1d0('0x3d')]);return db[_0xa1d0('0x3e')][_0xa1d0('0x46')](_0x32226d)[_0xa1d0('0x22')](handleEntityNotFound(_0x5371c0,null))[_0xa1d0('0x22')](function(_0x18176e){if(_0x18176e){var _0x5e5bf6=_0x18176e[_0xa1d0('0x49')]({'plain':!![]});_0x5e5bf6=qs['omit'](_0x5e5bf6,['id','createdAt',_0xa1d0('0x51')]);_0x42c27b[_0xa1d0('0x48')]=_[_0xa1d0('0x52')](_0x42c27b[_0xa1d0('0x48')],['id','createdAt',_0xa1d0('0x51')]);return db[_0xa1d0('0x3e')][_0xa1d0('0x47')](_[_0xa1d0('0x3a')](_0x5e5bf6,_0x42c27b[_0xa1d0('0x48')]),{'include':_0x42c27b[_0xa1d0('0x2d')][_0xa1d0('0x40')]?[{'all':!![]}]:undefined})[_0xa1d0('0x22')](function(_0x2cdd5a){var _0x39bb20=_0x42c27b[_0xa1d0('0x4c')][_0xa1d0('0x49')]({'plain':!![]});if(!_0x39bb20)throw new Error(_0xa1d0('0x4a'));if(_0x39bb20[_0xa1d0('0x4b')]===_0xa1d0('0x4c')){var _0x4aa768=_0x2cdd5a[_0xa1d0('0x49')]({'plain':!![]});var _0x2aa898=_0xa1d0('0x24');return db[_0xa1d0('0x4d')][_0xa1d0('0x46')]({'where':{'name':_0x2aa898,'userProfileId':_0x39bb20[_0xa1d0('0x53')]},'raw':!![]})[_0xa1d0('0x22')](function(_0x4dfa04){if(_0x4dfa04&&_0x4dfa04[_0xa1d0('0x4e')]===0x0){return db[_0xa1d0('0x25')][_0xa1d0('0x47')]({'name':_0x4aa768['name'],'resourceId':_0x4aa768['id'],'type':_0x4dfa04[_0xa1d0('0x27')],'sectionId':_0x4dfa04['id']},{})['then'](function(){return _0x2cdd5a;});}else{return _0x2cdd5a;}})[_0xa1d0('0x44')](function(_0x4b2bfe){logger[_0xa1d0('0x54')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4b2bfe);throw _0x4b2bfe;});}return _0x2cdd5a;});}})[_0xa1d0('0x22')](respondWithResult(_0x5371c0,0xc9))['catch'](handleError(_0x5371c0,null));};exports['update']=function(_0x190a2a,_0x406d73){if(_0x190a2a[_0xa1d0('0x48')]['id']){delete _0x190a2a[_0xa1d0('0x48')]['id'];}return db[_0xa1d0('0x3e')]['find']({'where':{'id':_0x190a2a[_0xa1d0('0x50')]['id']}})[_0xa1d0('0x22')](handleEntityNotFound(_0x406d73,null))[_0xa1d0('0x22')](saveUpdates(_0x190a2a[_0xa1d0('0x48')],null))['then'](respondWithResult(_0x406d73,null))[_0xa1d0('0x44')](handleError(_0x406d73,null));};exports['destroy']=function(_0x53eafc,_0x19dd0e){return db[_0xa1d0('0x3e')][_0xa1d0('0x46')]({'where':{'id':_0x53eafc[_0xa1d0('0x50')]['id']}})[_0xa1d0('0x22')](handleEntityNotFound(_0x19dd0e,null))['then'](removeEntity(_0x19dd0e,null))[_0xa1d0('0x44')](handleError(_0x19dd0e,null));};exports[_0xa1d0('0x55')]=function(_0x2fa8bd,_0x401519,_0x4bb6b5){var _0x202c55={'raw':!![],'where':{}};var _0x5aa6f8={};var _0x4a4bc2={'count':0x0,'rows':[]};return db[_0xa1d0('0x3e')][_0xa1d0('0x56')]({'where':{'id':_0x2fa8bd[_0xa1d0('0x50')]['id']}})['then'](handleEntityNotFound(_0x401519,null))['then'](function(_0x3f19b6){if(_0x3f19b6){_0x5aa6f8['model']=_[_0xa1d0('0x2e')](db['CmHopper'][_0xa1d0('0x29')]);_0x5aa6f8[_0xa1d0('0x2d')]=_[_0xa1d0('0x2e')](_0x2fa8bd[_0xa1d0('0x2d')]);_0x5aa6f8[_0xa1d0('0x2f')]=_[_0xa1d0('0x30')](_0x5aa6f8[_0xa1d0('0x31')],_0x5aa6f8[_0xa1d0('0x2d')]);_0x202c55[_0xa1d0('0x32')]=_[_0xa1d0('0x30')](_0x5aa6f8[_0xa1d0('0x31')],qs[_0xa1d0('0x33')](_0x2fa8bd['query'][_0xa1d0('0x33')]));_0x202c55['attributes']=_0x202c55['attributes'][_0xa1d0('0x34')]?_0x202c55[_0xa1d0('0x32')]:_0x5aa6f8['model'];if(!_0x2fa8bd['query'][_0xa1d0('0x57')](_0xa1d0('0x58'))){_0x202c55[_0xa1d0('0x1d')]=qs['limit'](_0x2fa8bd[_0xa1d0('0x2d')][_0xa1d0('0x1d')]);_0x202c55[_0xa1d0('0x1b')]=qs[_0xa1d0('0x1b')](_0x2fa8bd[_0xa1d0('0x2d')][_0xa1d0('0x1b')]);}_0x202c55[_0xa1d0('0x35')]=qs['sort'](_0x2fa8bd['query'][_0xa1d0('0x36')]);_0x202c55[_0xa1d0('0x37')]=qs[_0xa1d0('0x2f')](_[_0xa1d0('0x38')](_0x2fa8bd['query'],_0x5aa6f8[_0xa1d0('0x2f')]));_0x202c55[_0xa1d0('0x37')]['CampaignId']=_0x3f19b6['id'];if(_0x2fa8bd[_0xa1d0('0x2d')][_0xa1d0('0x39')]){_0x202c55[_0xa1d0('0x37')]=_['merge'](_0x202c55[_0xa1d0('0x37')],{'$or':_['map'](_0x202c55[_0xa1d0('0x32')],function(_0x334d81){var _0x5fd97f={};_0x5fd97f[_0x334d81]={'$like':'%'+_0x2fa8bd['query'][_0xa1d0('0x39')]+'%'};return _0x5fd97f;})});}_0x202c55=_[_0xa1d0('0x3a')]({},_0x202c55,_0x2fa8bd[_0xa1d0('0x3d')]);return db[_0xa1d0('0x59')][_0xa1d0('0x3f')]({'where':_0x202c55[_0xa1d0('0x37')]})[_0xa1d0('0x22')](function(_0x26c335){_0x4a4bc2[_0xa1d0('0x3f')]=_0x26c335;if(_0x2fa8bd[_0xa1d0('0x2d')][_0xa1d0('0x40')]){_0x202c55['include']=[{'all':!![]}];}return db[_0xa1d0('0x59')]['findAll'](_0x202c55);})[_0xa1d0('0x22')](function(_0x28a68b){_0x4a4bc2[_0xa1d0('0x43')]=_0x28a68b;return _0x4a4bc2;});}})[_0xa1d0('0x22')](respondWithFilteredResult(_0x401519,_0x202c55))[_0xa1d0('0x44')](handleError(_0x401519,null));};exports[_0xa1d0('0x5a')]=function(_0x4a4b31,_0x4aae70,_0x581a12){var _0x1e3bf4={'raw':!![],'where':{}};var _0x453603={};var _0x5145f9={'count':0x0,'rows':[]};return db[_0xa1d0('0x3e')]['findOne']({'where':{'id':_0x4a4b31[_0xa1d0('0x50')]['id']}})[_0xa1d0('0x22')](handleEntityNotFound(_0x4aae70,null))[_0xa1d0('0x22')](function(_0x2ffaac){if(_0x2ffaac){_0x453603[_0xa1d0('0x31')]=_[_0xa1d0('0x2e')](db[_0xa1d0('0x5b')][_0xa1d0('0x29')]);_0x453603['query']=_['keys'](_0x4a4b31[_0xa1d0('0x2d')]);_0x453603[_0xa1d0('0x2f')]=_[_0xa1d0('0x30')](_0x453603[_0xa1d0('0x31')],_0x453603['query']);_0x1e3bf4[_0xa1d0('0x32')]=_[_0xa1d0('0x30')](_0x453603[_0xa1d0('0x31')],qs['fields'](_0x4a4b31[_0xa1d0('0x2d')]['fields']));_0x1e3bf4['attributes']=_0x1e3bf4[_0xa1d0('0x32')][_0xa1d0('0x34')]?_0x1e3bf4[_0xa1d0('0x32')]:_0x453603[_0xa1d0('0x31')];if(!_0x4a4b31['query'][_0xa1d0('0x57')]('nolimit')){_0x1e3bf4[_0xa1d0('0x1d')]=qs[_0xa1d0('0x1d')](_0x4a4b31[_0xa1d0('0x2d')][_0xa1d0('0x1d')]);_0x1e3bf4[_0xa1d0('0x1b')]=qs[_0xa1d0('0x1b')](_0x4a4b31[_0xa1d0('0x2d')][_0xa1d0('0x1b')]);}_0x1e3bf4[_0xa1d0('0x35')]=qs[_0xa1d0('0x36')](_0x4a4b31[_0xa1d0('0x2d')][_0xa1d0('0x36')]);_0x1e3bf4['where']=qs[_0xa1d0('0x2f')](_[_0xa1d0('0x38')](_0x4a4b31[_0xa1d0('0x2d')],_0x453603[_0xa1d0('0x2f')]));_0x1e3bf4[_0xa1d0('0x37')][_0xa1d0('0x5c')]=_0x2ffaac['id'];if(_0x4a4b31['query']['filter']){_0x1e3bf4['where']=_['merge'](_0x1e3bf4[_0xa1d0('0x37')],{'$or':_[_0xa1d0('0x3b')](_0x1e3bf4['attributes'],function(_0x3d3a6e){var _0x424f3b={};_0x424f3b[_0x3d3a6e]={'$like':'%'+_0x4a4b31[_0xa1d0('0x2d')][_0xa1d0('0x39')]+'%'};return _0x424f3b;})});}_0x1e3bf4=_['merge']({},_0x1e3bf4,_0x4a4b31[_0xa1d0('0x3d')]);return db[_0xa1d0('0x5b')][_0xa1d0('0x3f')]({'where':_0x1e3bf4[_0xa1d0('0x37')]})[_0xa1d0('0x22')](function(_0x29e732){_0x5145f9[_0xa1d0('0x3f')]=_0x29e732;if(_0x4a4b31[_0xa1d0('0x2d')][_0xa1d0('0x40')]){_0x1e3bf4[_0xa1d0('0x41')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xa1d0('0x42')](_0x1e3bf4);})[_0xa1d0('0x22')](function(_0x23ff83){_0x5145f9[_0xa1d0('0x43')]=_0x23ff83;return _0x5145f9;});}})[_0xa1d0('0x22')](respondWithFilteredResult(_0x4aae70,_0x1e3bf4))[_0xa1d0('0x44')](handleError(_0x4aae70,null));};exports[_0xa1d0('0x5d')]=function(_0x300ed4,_0x1c13ae,_0x1044c6){var _0x4f6080={'raw':!![],'where':{}};var _0x1b9ab7={};var _0x4a2296={'count':0x0,'rows':[]};return db[_0xa1d0('0x3e')][_0xa1d0('0x56')]({'where':{'id':_0x300ed4[_0xa1d0('0x50')]['id']}})[_0xa1d0('0x22')](handleEntityNotFound(_0x1c13ae,null))[_0xa1d0('0x22')](function(_0x5b925d){if(_0x5b925d){_0x1b9ab7[_0xa1d0('0x31')]=_['keys'](db['CmHopperFinal']['rawAttributes']);_0x1b9ab7['query']=_[_0xa1d0('0x2e')](_0x300ed4[_0xa1d0('0x2d')]);_0x1b9ab7['filters']=_[_0xa1d0('0x30')](_0x1b9ab7['model'],_0x1b9ab7[_0xa1d0('0x2d')]);_0x4f6080['attributes']=_['intersection'](_0x1b9ab7[_0xa1d0('0x31')],qs[_0xa1d0('0x33')](_0x300ed4[_0xa1d0('0x2d')][_0xa1d0('0x33')]));_0x4f6080[_0xa1d0('0x32')]=_0x4f6080[_0xa1d0('0x32')][_0xa1d0('0x34')]?_0x4f6080[_0xa1d0('0x32')]:_0x1b9ab7['model'];if(!_0x300ed4[_0xa1d0('0x2d')][_0xa1d0('0x57')](_0xa1d0('0x58'))){_0x4f6080[_0xa1d0('0x1d')]=qs[_0xa1d0('0x1d')](_0x300ed4[_0xa1d0('0x2d')][_0xa1d0('0x1d')]);_0x4f6080[_0xa1d0('0x1b')]=qs[_0xa1d0('0x1b')](_0x300ed4[_0xa1d0('0x2d')][_0xa1d0('0x1b')]);}_0x4f6080[_0xa1d0('0x35')]=qs[_0xa1d0('0x36')](_0x300ed4[_0xa1d0('0x2d')][_0xa1d0('0x36')]);_0x4f6080[_0xa1d0('0x37')]=qs['filters'](_['pick'](_0x300ed4[_0xa1d0('0x2d')],_0x1b9ab7['filters']));_0x4f6080['where'][_0xa1d0('0x5c')]=_0x5b925d['id'];if(_0x300ed4[_0xa1d0('0x2d')][_0xa1d0('0x39')]){_0x4f6080[_0xa1d0('0x37')]=_[_0xa1d0('0x3a')](_0x4f6080[_0xa1d0('0x37')],{'$or':_['map'](_0x4f6080[_0xa1d0('0x32')],function(_0x35e142){var _0x35ad18={};_0x35ad18[_0x35e142]={'$like':'%'+_0x300ed4[_0xa1d0('0x2d')][_0xa1d0('0x39')]+'%'};return _0x35ad18;})});}_0x4f6080=_['merge']({},_0x4f6080,_0x300ed4['options']);return db[_0xa1d0('0x5e')][_0xa1d0('0x3f')]({'where':_0x4f6080['where']})[_0xa1d0('0x22')](function(_0x4d2e24){_0x4a2296[_0xa1d0('0x3f')]=_0x4d2e24;if(_0x300ed4[_0xa1d0('0x2d')][_0xa1d0('0x40')]){_0x4f6080['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0xa1d0('0x42')](_0x4f6080);})['then'](function(_0xd52e){_0x4a2296[_0xa1d0('0x43')]=_0xd52e;return _0x4a2296;});}})[_0xa1d0('0x22')](respondWithFilteredResult(_0x1c13ae,_0x4f6080))[_0xa1d0('0x44')](handleError(_0x1c13ae,null));};exports[_0xa1d0('0x5f')]=function(_0x3ffd1d,_0x28ef39,_0x489293){var _0x548be7={'raw':!![],'where':{}};var _0x35027c={};var _0x237506={'count':0x0,'rows':[]};return db[_0xa1d0('0x3e')][_0xa1d0('0x56')]({'where':{'id':_0x3ffd1d[_0xa1d0('0x50')]['id']}})[_0xa1d0('0x22')](handleEntityNotFound(_0x28ef39,null))[_0xa1d0('0x22')](function(_0x23ebe0){if(_0x23ebe0){_0x35027c[_0xa1d0('0x31')]=_[_0xa1d0('0x2e')](db['CmHopperBlack'][_0xa1d0('0x29')]);_0x35027c[_0xa1d0('0x2d')]=_['keys'](_0x3ffd1d[_0xa1d0('0x2d')]);_0x35027c[_0xa1d0('0x2f')]=_['intersection'](_0x35027c[_0xa1d0('0x31')],_0x35027c[_0xa1d0('0x2d')]);_0x548be7[_0xa1d0('0x32')]=_['intersection'](_0x35027c['model'],qs[_0xa1d0('0x33')](_0x3ffd1d['query'][_0xa1d0('0x33')]));_0x548be7[_0xa1d0('0x32')]=_0x548be7[_0xa1d0('0x32')]['length']?_0x548be7[_0xa1d0('0x32')]:_0x35027c['model'];if(!_0x3ffd1d[_0xa1d0('0x2d')][_0xa1d0('0x57')](_0xa1d0('0x58'))){_0x548be7['limit']=qs[_0xa1d0('0x1d')](_0x3ffd1d[_0xa1d0('0x2d')][_0xa1d0('0x1d')]);_0x548be7[_0xa1d0('0x1b')]=qs[_0xa1d0('0x1b')](_0x3ffd1d['query'][_0xa1d0('0x1b')]);}_0x548be7[_0xa1d0('0x35')]=qs['sort'](_0x3ffd1d[_0xa1d0('0x2d')][_0xa1d0('0x36')]);_0x548be7['where']=qs[_0xa1d0('0x2f')](_[_0xa1d0('0x38')](_0x3ffd1d['query'],_0x35027c['filters']));_0x548be7[_0xa1d0('0x37')][_0xa1d0('0x5c')]=_0x23ebe0['id'];if(_0x3ffd1d[_0xa1d0('0x2d')][_0xa1d0('0x39')]){_0x548be7[_0xa1d0('0x37')]=_[_0xa1d0('0x3a')](_0x548be7[_0xa1d0('0x37')],{'$or':_[_0xa1d0('0x3b')](_0x548be7['attributes'],function(_0x4fea86){var _0x58fdd7={};_0x58fdd7[_0x4fea86]={'$like':'%'+_0x3ffd1d[_0xa1d0('0x2d')][_0xa1d0('0x39')]+'%'};return _0x58fdd7;})});}_0x548be7=_['merge']({},_0x548be7,_0x3ffd1d[_0xa1d0('0x3d')]);return db['CmHopperBlack'][_0xa1d0('0x3f')]({'where':_0x548be7['where']})[_0xa1d0('0x22')](function(_0x3c859a){_0x237506[_0xa1d0('0x3f')]=_0x3c859a;if(_0x3ffd1d[_0xa1d0('0x2d')][_0xa1d0('0x40')]){_0x548be7[_0xa1d0('0x41')]=[{'all':!![]}];}return db[_0xa1d0('0x60')][_0xa1d0('0x42')](_0x548be7);})['then'](function(_0x10b10c){_0x237506[_0xa1d0('0x43')]=_0x10b10c;return _0x237506;});}})[_0xa1d0('0x22')](respondWithFilteredResult(_0x28ef39,_0x548be7))['catch'](handleError(_0x28ef39,null));};exports[_0xa1d0('0x61')]=function(_0x3d5a48,_0x4629b1,_0x575551){var _0x33ecdb={};var _0x285c0c={};var _0x23695f;var _0x565167;return db[_0xa1d0('0x3e')][_0xa1d0('0x56')]({'where':{'id':_0x3d5a48['params']['id']}})[_0xa1d0('0x22')](handleEntityNotFound(_0x4629b1,null))[_0xa1d0('0x22')](function(_0x2706b4){if(_0x2706b4){_0x23695f=_0x2706b4;_0x285c0c[_0xa1d0('0x31')]=_[_0xa1d0('0x2e')](db[_0xa1d0('0x62')][_0xa1d0('0x29')]);_0x285c0c[_0xa1d0('0x2d')]=_[_0xa1d0('0x2e')](_0x3d5a48[_0xa1d0('0x2d')]);_0x285c0c[_0xa1d0('0x2f')]=_[_0xa1d0('0x30')](_0x285c0c[_0xa1d0('0x31')],_0x285c0c[_0xa1d0('0x2d')]);_0x33ecdb[_0xa1d0('0x32')]=_[_0xa1d0('0x30')](_0x285c0c[_0xa1d0('0x31')],qs[_0xa1d0('0x33')](_0x3d5a48[_0xa1d0('0x2d')][_0xa1d0('0x33')]));_0x33ecdb[_0xa1d0('0x32')]=_0x33ecdb['attributes'][_0xa1d0('0x34')]?_0x33ecdb[_0xa1d0('0x32')]:_0x285c0c[_0xa1d0('0x31')];_0x33ecdb[_0xa1d0('0x35')]=qs[_0xa1d0('0x36')](_0x3d5a48[_0xa1d0('0x2d')][_0xa1d0('0x36')]);_0x33ecdb[_0xa1d0('0x37')]=qs['filters'](_[_0xa1d0('0x38')](_0x3d5a48[_0xa1d0('0x2d')],_0x285c0c['filters']));if(_0x3d5a48['query'][_0xa1d0('0x39')]){_0x33ecdb['where']=_[_0xa1d0('0x3a')](_0x33ecdb[_0xa1d0('0x37')],{'$or':_['map'](_0x33ecdb[_0xa1d0('0x32')],function(_0x41ac20){var _0x1a17ba={};_0x1a17ba[_0x41ac20]={'$like':'%'+_0x3d5a48['query'][_0xa1d0('0x39')]+'%'};return _0x1a17ba;})});}_0x33ecdb=_['merge']({},_0x33ecdb,_0x3d5a48[_0xa1d0('0x3d')]);return _0x23695f[_0xa1d0('0x61')](_0x33ecdb);}})[_0xa1d0('0x22')](function(_0x151ea3){if(_0x151ea3){_0x565167=_0x151ea3[_0xa1d0('0x34')];if(!_0x3d5a48['query'][_0xa1d0('0x57')](_0xa1d0('0x58'))){_0x33ecdb[_0xa1d0('0x1d')]=qs[_0xa1d0('0x1d')](_0x3d5a48[_0xa1d0('0x2d')][_0xa1d0('0x1d')]);_0x33ecdb[_0xa1d0('0x1b')]=qs[_0xa1d0('0x1b')](_0x3d5a48[_0xa1d0('0x2d')][_0xa1d0('0x1b')]);}return _0x23695f[_0xa1d0('0x61')](_0x33ecdb);}})[_0xa1d0('0x22')](function(_0x41c25e){if(_0x41c25e){return _0x41c25e?{'count':_0x565167,'rows':_0x41c25e}:null;}})[_0xa1d0('0x22')](respondWithResult(_0x4629b1,null))['catch'](handleError(_0x4629b1,null));};exports[_0xa1d0('0x63')]=function(_0x2c69f6,_0x47828f,_0x4c3b23){var _0x43b946,_0x126f09;return db[_0xa1d0('0x3e')][_0xa1d0('0x46')]({'where':{'id':_0x2c69f6[_0xa1d0('0x50')]['id']}})['then'](handleEntityNotFound(_0x47828f,null))['then'](function(_0x1e370e){if(_0x1e370e){_0x126f09=_0x1e370e;return _0x1e370e[_0xa1d0('0x63')](_0x2c69f6[_0xa1d0('0x48')][_0xa1d0('0x64')],_[_0xa1d0('0x52')](_0x2c69f6[_0xa1d0('0x48')],[_0xa1d0('0x64'),'id'])||{});}return null;})[_0xa1d0('0x65')](function(_0x20353d){var _0x254b27;_0x43b946=_0x20353d||[];var _0x3e9292=[];if(_0x20353d){for(var _0x576e97=0x0;_0x576e97<_0x20353d[_0xa1d0('0x34')];_0x576e97+=0x1){var _0x5446fd=_0x20353d[_0x576e97][_0xa1d0('0x49')]({'plain':!![]});_0x126f09[_0xa1d0('0x66')]=_0x2c69f6['body'][_0xa1d0('0x66')]?_0x2c69f6['body'][_0xa1d0('0x66')]:_0x126f09[_0xa1d0('0x66')];switch(_0x126f09[_0xa1d0('0x66')]){case _0xa1d0('0x67'):_0x254b27=squel['insert']()[_0xa1d0('0x68')](_0xa1d0('0x69'))[_0xa1d0('0x6a')]([_0xa1d0('0x6b'),'scheduledAt',_0xa1d0('0x6c'),_0xa1d0('0x6d'),'CampaignId',_0xa1d0('0x6e'),_0xa1d0('0x51')],squel[_0xa1d0('0x6f')]()[_0xa1d0('0x70')]('phone',_0xa1d0('0x6b'))['field']('NOW()',_0xa1d0('0x71'))[_0xa1d0('0x70')]('id',_0xa1d0('0x6c'))[_0xa1d0('0x70')](_0x5446fd[_0xa1d0('0x72')]['toString'](),_0xa1d0('0x6d'))[_0xa1d0('0x70')](_0x2c69f6[_0xa1d0('0x50')]['id'][_0xa1d0('0x73')](),_0xa1d0('0x5c'))[_0xa1d0('0x70')](_0xa1d0('0x74'),_0xa1d0('0x6e'))[_0xa1d0('0x70')](_0xa1d0('0x74'),'updatedAt')[_0xa1d0('0x75')](_0xa1d0('0x76'))['where'](_0xa1d0('0x77'))[_0xa1d0('0x37')](_0xa1d0('0x78'),_0x5446fd['CmListId'][_0xa1d0('0x73')]())[_0xa1d0('0x37')](_0xa1d0('0x79'))[_0xa1d0('0x37')](_0xa1d0('0x7a'),squel['select']()[_0xa1d0('0x70')](_0xa1d0('0x7b'))[_0xa1d0('0x75')]('cm_hopper_final')[_0xa1d0('0x37')](_0xa1d0('0x7c'),_0x2c69f6['params']['id']['toString']()))[_0xa1d0('0x37')](_0xa1d0('0x7a'),squel[_0xa1d0('0x6f')]()[_0xa1d0('0x70')](_0xa1d0('0x7d'))[_0xa1d0('0x75')](_0xa1d0('0x69'))[_0xa1d0('0x37')](_0xa1d0('0x7c'),_0x2c69f6[_0xa1d0('0x50')]['id'][_0xa1d0('0x73')]())))[_0xa1d0('0x73')]();break;case _0xa1d0('0x7e'):_0x254b27=squel[_0xa1d0('0x7f')]()[_0xa1d0('0x68')](_0xa1d0('0x69'))[_0xa1d0('0x6a')]([_0xa1d0('0x6b'),_0xa1d0('0x71'),'ContactId',_0xa1d0('0x6d'),_0xa1d0('0x5c'),_0xa1d0('0x6e'),_0xa1d0('0x51')],squel[_0xa1d0('0x6f')]()[_0xa1d0('0x70')](_0xa1d0('0x6b'),'phone')['field']('NOW()',_0xa1d0('0x71'))['field']('id',_0xa1d0('0x6c'))['field'](_0x5446fd[_0xa1d0('0x72')][_0xa1d0('0x73')](),_0xa1d0('0x6d'))[_0xa1d0('0x70')](_0x2c69f6[_0xa1d0('0x50')]['id'][_0xa1d0('0x73')](),_0xa1d0('0x5c'))[_0xa1d0('0x70')](_0xa1d0('0x74'),_0xa1d0('0x6e'))[_0xa1d0('0x70')](_0xa1d0('0x74'),_0xa1d0('0x51'))[_0xa1d0('0x75')](_0xa1d0('0x76'))[_0xa1d0('0x37')](_0xa1d0('0x77'))['where']('ListId\x20=\x20?',_0x5446fd['CmListId']['toString']())['where'](_0xa1d0('0x79'))[_0xa1d0('0x37')](_0xa1d0('0x7a'),squel[_0xa1d0('0x6f')]()[_0xa1d0('0x70')](_0xa1d0('0x7d'))[_0xa1d0('0x75')](_0xa1d0('0x69'))[_0xa1d0('0x37')](_0xa1d0('0x7c'),_0x2c69f6[_0xa1d0('0x50')]['id'][_0xa1d0('0x73')]())))['toString']();break;default:_0x254b27=squel['insert']()[_0xa1d0('0x68')](_0xa1d0('0x69'))[_0xa1d0('0x6a')](['phone',_0xa1d0('0x71'),_0xa1d0('0x6c'),'ListId',_0xa1d0('0x5c'),_0xa1d0('0x6e'),'updatedAt'],squel['select']()['field'](_0xa1d0('0x6b'),_0xa1d0('0x6b'))[_0xa1d0('0x70')](_0xa1d0('0x74'),_0xa1d0('0x71'))[_0xa1d0('0x70')]('id','ContactId')[_0xa1d0('0x70')](_0x5446fd['CmListId']['toString'](),_0xa1d0('0x6d'))[_0xa1d0('0x70')](_0x2c69f6[_0xa1d0('0x50')]['id'][_0xa1d0('0x73')](),_0xa1d0('0x5c'))[_0xa1d0('0x70')]('NOW()',_0xa1d0('0x6e'))[_0xa1d0('0x70')]('NOW()',_0xa1d0('0x51'))['from'](_0xa1d0('0x76'))[_0xa1d0('0x37')](_0xa1d0('0x77'))[_0xa1d0('0x37')]('ListId\x20=\x20?',_0x5446fd['CmListId']['toString']())[_0xa1d0('0x37')]('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x3e9292[_0xa1d0('0x80')](db[_0xa1d0('0x81')][_0xa1d0('0x2d')](_0x254b27));}return BPromise['all'](_0x3e9292);}})[_0xa1d0('0x22')](function(){return _0x43b946;})[_0xa1d0('0x22')](respondWithResult(_0x47828f,null))[_0xa1d0('0x44')](handleError(_0x47828f,null));};exports[_0xa1d0('0x82')]=function(_0x5603f4,_0x353a41,_0x4f6d51){return db[_0xa1d0('0x3e')][_0xa1d0('0x46')]({'where':{'id':_0x5603f4['params']['id']}})[_0xa1d0('0x22')](handleEntityNotFound(_0x353a41,null))[_0xa1d0('0x22')](function(_0x2c087a){if(_0x2c087a){return _0x2c087a['removeLists'](_0x5603f4[_0xa1d0('0x2d')]['ids']);}})[_0xa1d0('0x22')](function(_0x41759b){if(_0x41759b){return db[_0xa1d0('0x59')][_0xa1d0('0x23')]({'where':{'ListId':_0x5603f4[_0xa1d0('0x2d')][_0xa1d0('0x64')],'CampaignId':_0x5603f4[_0xa1d0('0x50')]['id']}})['then'](function(){return _0x41759b;});}})[_0xa1d0('0x22')](respondWithStatusCode(_0x353a41,null))[_0xa1d0('0x44')](handleError(_0x353a41,null));};exports[_0xa1d0('0x83')]=function(_0x41c2f9,_0x2b4874,_0x47c1d6){var _0x564cd0={};var _0x5000de={};var _0x4c93bd;var _0x46d15f;return db[_0xa1d0('0x3e')][_0xa1d0('0x56')]({'where':{'id':_0x41c2f9[_0xa1d0('0x50')]['id']}})['then'](handleEntityNotFound(_0x2b4874,null))[_0xa1d0('0x22')](function(_0x54d8b3){if(_0x54d8b3){_0x4c93bd=_0x54d8b3;_0x5000de[_0xa1d0('0x31')]=_[_0xa1d0('0x2e')](db[_0xa1d0('0x62')][_0xa1d0('0x29')]);_0x5000de['query']=_[_0xa1d0('0x2e')](_0x41c2f9[_0xa1d0('0x2d')]);_0x5000de['filters']=_[_0xa1d0('0x30')](_0x5000de[_0xa1d0('0x31')],_0x5000de[_0xa1d0('0x2d')]);_0x564cd0[_0xa1d0('0x32')]=_[_0xa1d0('0x30')](_0x5000de[_0xa1d0('0x31')],qs['fields'](_0x41c2f9[_0xa1d0('0x2d')]['fields']));_0x564cd0[_0xa1d0('0x32')]=_0x564cd0['attributes'][_0xa1d0('0x34')]?_0x564cd0[_0xa1d0('0x32')]:_0x5000de['model'];_0x564cd0[_0xa1d0('0x35')]=qs['sort'](_0x41c2f9[_0xa1d0('0x2d')]['sort']);_0x564cd0[_0xa1d0('0x37')]=qs[_0xa1d0('0x2f')](_['pick'](_0x41c2f9[_0xa1d0('0x2d')],_0x5000de[_0xa1d0('0x2f')]));if(_0x41c2f9[_0xa1d0('0x2d')][_0xa1d0('0x39')]){_0x564cd0[_0xa1d0('0x37')]=_[_0xa1d0('0x3a')](_0x564cd0[_0xa1d0('0x37')],{'$or':_[_0xa1d0('0x3b')](_0x564cd0[_0xa1d0('0x32')],function(_0x695619){var _0x14b2e6={};_0x14b2e6[_0x695619]={'$like':'%'+_0x41c2f9[_0xa1d0('0x2d')][_0xa1d0('0x39')]+'%'};return _0x14b2e6;})});}_0x564cd0=_[_0xa1d0('0x3a')]({},_0x564cd0,_0x41c2f9['options']);return _0x4c93bd[_0xa1d0('0x83')](_0x564cd0);}})[_0xa1d0('0x22')](function(_0x17498e){if(_0x17498e){_0x46d15f=_0x17498e[_0xa1d0('0x34')];if(!_0x41c2f9[_0xa1d0('0x2d')][_0xa1d0('0x57')](_0xa1d0('0x58'))){_0x564cd0[_0xa1d0('0x1d')]=qs['limit'](_0x41c2f9[_0xa1d0('0x2d')]['limit']);_0x564cd0[_0xa1d0('0x1b')]=qs[_0xa1d0('0x1b')](_0x41c2f9[_0xa1d0('0x2d')][_0xa1d0('0x1b')]);}return _0x4c93bd['getBlackLists'](_0x564cd0);}})[_0xa1d0('0x22')](function(_0x15c9c1){if(_0x15c9c1){return _0x15c9c1?{'count':_0x46d15f,'rows':_0x15c9c1}:null;}})['then'](respondWithResult(_0x2b4874,null))[_0xa1d0('0x44')](handleError(_0x2b4874,null));};exports[_0xa1d0('0x84')]=function(_0x1635bf,_0x3fd3be,_0x2b58cd){var _0x540bf4,_0x5765d6;return db[_0xa1d0('0x3e')]['find']({'where':{'id':_0x1635bf[_0xa1d0('0x50')]['id']}})[_0xa1d0('0x22')](handleEntityNotFound(_0x3fd3be,null))[_0xa1d0('0x22')](function(_0x406ac7){if(_0x406ac7){_0x5765d6=_0x406ac7;return _0x406ac7[_0xa1d0('0x84')](_0x1635bf['body']['ids'],_[_0xa1d0('0x52')](_0x1635bf[_0xa1d0('0x48')],[_0xa1d0('0x64'),'id'])||{});}return null;})[_0xa1d0('0x65')](function(_0x264b59){var _0x39c5b3;_0x540bf4=_0x264b59||[];var _0x291654=[];if(_0x264b59){for(var _0x459507=0x0;_0x459507<_0x264b59[_0xa1d0('0x34')];_0x459507+=0x1){var _0x24a39f=_0x264b59[_0x459507][_0xa1d0('0x49')]({'plain':!![]});_0x39c5b3=squel[_0xa1d0('0x7f')]()[_0xa1d0('0x68')](_0xa1d0('0x85'))[_0xa1d0('0x6a')](['phone','ContactId',_0xa1d0('0x6d'),_0xa1d0('0x5c'),_0xa1d0('0x6e'),'updatedAt'],squel['select']()[_0xa1d0('0x70')](_0xa1d0('0x6b'),_0xa1d0('0x6b'))['field']('id',_0xa1d0('0x6c'))[_0xa1d0('0x70')](_0x24a39f[_0xa1d0('0x72')][_0xa1d0('0x73')](),_0xa1d0('0x6d'))[_0xa1d0('0x70')](_0x1635bf[_0xa1d0('0x50')]['id'][_0xa1d0('0x73')](),_0xa1d0('0x5c'))[_0xa1d0('0x70')](_0xa1d0('0x74'),_0xa1d0('0x6e'))[_0xa1d0('0x70')](_0xa1d0('0x74'),_0xa1d0('0x51'))[_0xa1d0('0x75')](_0xa1d0('0x76'))['where'](_0xa1d0('0x77'))['where'](_0xa1d0('0x78'),_0x24a39f[_0xa1d0('0x72')][_0xa1d0('0x73')]())[_0xa1d0('0x37')](_0xa1d0('0x79')))[_0xa1d0('0x73')]();_0x291654[_0xa1d0('0x80')](db[_0xa1d0('0x81')]['query'](_0x39c5b3));}return BPromise[_0xa1d0('0x86')](_0x291654);}})[_0xa1d0('0x22')](function(){return _0x540bf4;})['then'](respondWithResult(_0x3fd3be,null))['catch'](handleError(_0x3fd3be,null));};exports['removeBlackLists']=function(_0x3d0130,_0xf57333,_0x42211b){return db[_0xa1d0('0x3e')]['find']({'where':{'id':_0x3d0130['params']['id']}})[_0xa1d0('0x22')](handleEntityNotFound(_0xf57333,null))['then'](function(_0x4e37c8){if(_0x4e37c8){return _0x4e37c8['removeBlackLists'](_0x3d0130[_0xa1d0('0x2d')][_0xa1d0('0x64')]);}})['then'](function(_0x49aaa3){if(_0x49aaa3){return db[_0xa1d0('0x60')][_0xa1d0('0x23')]({'where':{'ListId':_0x3d0130['query']['ids'],'CampaignId':_0x3d0130[_0xa1d0('0x50')]['id']}})[_0xa1d0('0x22')](function(){return _0x49aaa3;});}})['then'](respondWithStatusCode(_0xf57333,null))[_0xa1d0('0x44')](handleError(_0xf57333,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 75968d3..3fc802b 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(_0x3c691c,_0x75c10a){var _0x5703a0=function(_0x4ffc4a){while(--_0x4ffc4a){_0x3c691c['push'](_0x3c691c['shift']());}};_0x5703a0(++_0x75c10a);}(_0x7a54,0x106));var _0x47a5=function(_0x27e91d,_0x5162d5){_0x27e91d=_0x27e91d-0x0;var _0x5b027b=_0x7a54[_0x27e91d];return _0x5b027b;};'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(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'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 d7ba2c0..e44a9ca 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 _0xbbfa=['raw','where','attributes','limit','include','map','model','then','GetCampaign','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','error','code','Campaign,\x20%s,\x20%s','message','catch','Campaign','options'];(function(_0xfc08f0,_0xd6496b){var _0x263ed7=function(_0xdf981b){while(--_0xdf981b){_0xfc08f0['push'](_0xfc08f0['shift']());}};_0x263ed7(++_0xd6496b);}(_0xbbfa,0x1e9));var _0xabbf=function(_0x3fa9cc,_0x2172bc){_0x3fa9cc=_0x3fa9cc-0x0;var _0x3ade14=_0xbbfa[_0x3fa9cc];return _0x3ade14;};'use strict';var _=require(_0xabbf('0x0'));var util=require('util');var moment=require(_0xabbf('0x1'));var BPromise=require('bluebird');var rs=require(_0xabbf('0x2'));var fs=require('fs');var Redis=require(_0xabbf('0x3'));var db=require(_0xabbf('0x4'))['db'];var utils=require(_0xabbf('0x5'));var logger=require(_0xabbf('0x6'))(_0xabbf('0x7'));var config=require(_0xabbf('0x8'));var jayson=require(_0xabbf('0x9'));var client=jayson[_0xabbf('0xa')][_0xabbf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45b7d6,_0x58f0a8,_0x5b471b){return new BPromise(function(_0x536a4c,_0x1380cd){return client[_0xabbf('0xc')](_0x45b7d6,_0x5b471b)['then'](function(_0x5f35ee){logger[_0xabbf('0xd')]('Campaign,\x20%s,\x20%s',_0x58f0a8,_0xabbf('0xe'));logger['debug'](_0xabbf('0xf'),_0x58f0a8,'request\x20sent',JSON['stringify'](_0x5f35ee));if(_0x5f35ee[_0xabbf('0x10')]){if(_0x5f35ee[_0xabbf('0x10')][_0xabbf('0x11')]===0x1f4){logger[_0xabbf('0x10')](_0xabbf('0x12'),_0x58f0a8,_0x5f35ee[_0xabbf('0x10')][_0xabbf('0x13')]);return _0x1380cd(_0x5f35ee[_0xabbf('0x10')][_0xabbf('0x13')]);}logger['error'](_0xabbf('0x12'),_0x58f0a8,_0x5f35ee['error'][_0xabbf('0x13')]);return _0x536a4c(_0x5f35ee['error'][_0xabbf('0x13')]);}else{logger[_0xabbf('0xd')](_0xabbf('0x12'),_0x58f0a8,_0xabbf('0xe'));_0x536a4c(_0x5f35ee['result'][_0xabbf('0x13')]);}})[_0xabbf('0x14')](function(_0x31245d){logger[_0xabbf('0x10')](_0xabbf('0x12'),_0x58f0a8,_0x31245d);_0x1380cd(_0x31245d);});});}exports['GetCampaign']=function(_0x4252e1){var _0xfa3da6=this;return new Promise(function(_0x57002d,_0x7568c0){return db[_0xabbf('0x15')]['findAll']({'raw':_0x4252e1[_0xabbf('0x16')]?_0x4252e1[_0xabbf('0x16')][_0xabbf('0x17')]===undefined?!![]:![]:!![],'where':_0x4252e1['options']?_0x4252e1['options'][_0xabbf('0x18')]||null:null,'attributes':_0x4252e1[_0xabbf('0x16')]?_0x4252e1[_0xabbf('0x16')][_0xabbf('0x19')]||null:null,'limit':_0x4252e1['options']?_0x4252e1['options'][_0xabbf('0x1a')]||null:null,'include':_0x4252e1[_0xabbf('0x16')]?_0x4252e1[_0xabbf('0x16')][_0xabbf('0x1b')]?_[_0xabbf('0x1c')](_0x4252e1[_0xabbf('0x16')][_0xabbf('0x1b')],function(_0x573d83){return{'model':db[_0x573d83[_0xabbf('0x1d')]],'as':_0x573d83['as'],'attributes':_0x573d83[_0xabbf('0x19')],'include':_0x573d83[_0xabbf('0x1b')]?_['map'](_0x573d83[_0xabbf('0x1b')],function(_0x26ebc6){return{'model':db[_0x26ebc6[_0xabbf('0x1d')]],'as':_0x26ebc6['as'],'attributes':_0x26ebc6[_0xabbf('0x19')],'include':_0x26ebc6[_0xabbf('0x1b')]?_['map'](_0x26ebc6[_0xabbf('0x1b')],function(_0x4ef7cf){return{'model':db[_0x4ef7cf['model']],'as':_0x4ef7cf['as'],'attributes':_0x4ef7cf[_0xabbf('0x19')]};}):[]};}):[]};}):[]:[]})[_0xabbf('0x1e')](function(_0x51d38d){logger[_0xabbf('0xd')](_0xabbf('0x1f'),_0x4252e1);logger['debug']('GetCampaign',_0x4252e1,JSON['stringify'](_0x51d38d));_0x57002d(_0x51d38d);})['catch'](function(_0xf50e5f){logger[_0xabbf('0x10')](_0xabbf('0x1f'),_0xf50e5f[_0xabbf('0x13')],_0x4252e1);_0x7568c0(_0xfa3da6[_0xabbf('0x10')](0x1f4,_0xf50e5f[_0xabbf('0x13')]));});});}; \ No newline at end of file +var _0x581a=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','info','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','Campaign,\x20%s,\x20%s','message','result','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','model','map','catch','lodash','util'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x581a,0x127));var _0xa581=function(_0x218c2f,_0x1ccc5d){_0x218c2f=_0x218c2f-0x0;var _0x3ae5dc=_0x581a[_0x218c2f];return _0x3ae5dc;};'use strict';var _=require(_0xa581('0x0'));var util=require(_0xa581('0x1'));var moment=require('moment');var BPromise=require(_0xa581('0x2'));var rs=require(_0xa581('0x3'));var fs=require('fs');var Redis=require(_0xa581('0x4'));var db=require(_0xa581('0x5'))['db'];var utils=require(_0xa581('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xa581('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa581('0x8')][_0xa581('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x17c679,_0x2e59cc,_0x35f6b9){return new BPromise(function(_0x1875a5,_0x465916){return client[_0xa581('0xa')](_0x17c679,_0x35f6b9)[_0xa581('0xb')](function(_0x32a44a){logger[_0xa581('0xc')]('Campaign,\x20%s,\x20%s',_0x2e59cc,_0xa581('0xd'));logger[_0xa581('0xe')](_0xa581('0xf'),_0x2e59cc,_0xa581('0xd'),JSON[_0xa581('0x10')](_0x32a44a));if(_0x32a44a[_0xa581('0x11')]){if(_0x32a44a[_0xa581('0x11')]['code']===0x1f4){logger[_0xa581('0x11')](_0xa581('0x12'),_0x2e59cc,_0x32a44a[_0xa581('0x11')][_0xa581('0x13')]);return _0x465916(_0x32a44a[_0xa581('0x11')]['message']);}logger[_0xa581('0x11')](_0xa581('0x12'),_0x2e59cc,_0x32a44a[_0xa581('0x11')][_0xa581('0x13')]);return _0x1875a5(_0x32a44a['error']['message']);}else{logger[_0xa581('0xc')](_0xa581('0x12'),_0x2e59cc,_0xa581('0xd'));_0x1875a5(_0x32a44a[_0xa581('0x14')][_0xa581('0x13')]);}})['catch'](function(_0x2aa492){logger[_0xa581('0x11')](_0xa581('0x12'),_0x2e59cc,_0x2aa492);_0x465916(_0x2aa492);});});}exports[_0xa581('0x15')]=function(_0x1d992a){var _0x1484b1=this;return new Promise(function(_0x547074,_0x48a44b){return db[_0xa581('0x16')][_0xa581('0x17')]({'raw':_0x1d992a[_0xa581('0x18')]?_0x1d992a['options'][_0xa581('0x19')]===undefined?!![]:![]:!![],'where':_0x1d992a[_0xa581('0x18')]?_0x1d992a[_0xa581('0x18')][_0xa581('0x1a')]||null:null,'attributes':_0x1d992a[_0xa581('0x18')]?_0x1d992a[_0xa581('0x18')][_0xa581('0x1b')]||null:null,'limit':_0x1d992a[_0xa581('0x18')]?_0x1d992a[_0xa581('0x18')][_0xa581('0x1c')]||null:null,'include':_0x1d992a[_0xa581('0x18')]?_0x1d992a[_0xa581('0x18')][_0xa581('0x1d')]?_['map'](_0x1d992a[_0xa581('0x18')][_0xa581('0x1d')],function(_0x32bdaa){return{'model':db[_0x32bdaa[_0xa581('0x1e')]],'as':_0x32bdaa['as'],'attributes':_0x32bdaa[_0xa581('0x1b')],'include':_0x32bdaa[_0xa581('0x1d')]?_[_0xa581('0x1f')](_0x32bdaa[_0xa581('0x1d')],function(_0x1c1f5f){return{'model':db[_0x1c1f5f[_0xa581('0x1e')]],'as':_0x1c1f5f['as'],'attributes':_0x1c1f5f[_0xa581('0x1b')],'include':_0x1c1f5f[_0xa581('0x1d')]?_[_0xa581('0x1f')](_0x1c1f5f[_0xa581('0x1d')],function(_0x36ba28){return{'model':db[_0x36ba28[_0xa581('0x1e')]],'as':_0x36ba28['as'],'attributes':_0x36ba28['attributes']};}):[]};}):[]};}):[]:[]})[_0xa581('0xb')](function(_0x1fae9f){logger[_0xa581('0xc')]('GetCampaign',_0x1d992a);logger[_0xa581('0xe')](_0xa581('0x15'),_0x1d992a,JSON[_0xa581('0x10')](_0x1fae9f));_0x547074(_0x1fae9f);})[_0xa581('0x20')](function(_0x40352f){logger['error'](_0xa581('0x15'),_0x40352f['message'],_0x1d992a);_0x48a44b(_0x1484b1[_0xa581('0x11')](0x1f4,_0x40352f['message']));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 9fd524a..57d0f55 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 _0xf031=['getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','create','post','clone','addLists','addBlackLists','put','update','delete','destroy','removeBlackLists','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/hoppers'];(function(_0x48c881,_0x239204){var _0x900dde=function(_0x445ddf){while(--_0x445ddf){_0x48c881['push'](_0x48c881['shift']());}};_0x900dde(++_0x239204);}(_0xf031,0xfc));var _0x1f03=function(_0x47dd36,_0x8da3a4){_0x47dd36=_0x47dd36-0x0;var _0x36b443=_0xf031[_0x47dd36];return _0x36b443;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1f03('0x0'));var timeout=require(_0x1f03('0x1'));var express=require(_0x1f03('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1f03('0x3'));var interaction=require(_0x1f03('0x4'));var config=require(_0x1f03('0x5'));var controller=require('./campaign.controller');router[_0x1f03('0x6')]('/',auth[_0x1f03('0x7')](),controller[_0x1f03('0x8')]);router[_0x1f03('0x6')](_0x1f03('0x9'),auth['isAuthenticated'](),controller[_0x1f03('0xa')]);router[_0x1f03('0x6')](_0x1f03('0xb'),auth[_0x1f03('0x7')](),controller[_0x1f03('0xc')]);router[_0x1f03('0x6')](_0x1f03('0xd'),auth[_0x1f03('0x7')](),controller[_0x1f03('0xe')]);router[_0x1f03('0x6')](_0x1f03('0xf'),auth[_0x1f03('0x7')](),controller['getHopperFinals']);router[_0x1f03('0x6')](_0x1f03('0x10'),auth[_0x1f03('0x7')](),controller[_0x1f03('0x11')]);router[_0x1f03('0x6')](_0x1f03('0x12'),auth['isAuthenticated'](),controller[_0x1f03('0x13')]);router[_0x1f03('0x6')](_0x1f03('0x14'),auth[_0x1f03('0x7')](),controller[_0x1f03('0x15')]);router['post']('/',auth[_0x1f03('0x7')](),controller[_0x1f03('0x16')]);router[_0x1f03('0x17')]('/:id/clone',auth[_0x1f03('0x7')](),controller[_0x1f03('0x18')]);router['post'](_0x1f03('0x12'),auth[_0x1f03('0x7')](),controller[_0x1f03('0x19')]);router[_0x1f03('0x17')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0x1f03('0x1a')]);router[_0x1f03('0x1b')](_0x1f03('0x9'),auth[_0x1f03('0x7')](),controller[_0x1f03('0x1c')]);router[_0x1f03('0x1d')](_0x1f03('0x9'),auth[_0x1f03('0x7')](),controller[_0x1f03('0x1e')]);router[_0x1f03('0x1d')]('/:id/lists',auth[_0x1f03('0x7')](),controller['removeLists']);router['delete']('/:id/blacklists',auth[_0x1f03('0x7')](),controller[_0x1f03('0x1f')]);module[_0x1f03('0x20')]=router; \ No newline at end of file +var _0x5ffd=['/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists','post','/:id/clone','clone','/:id/lists','addLists','/:id/blacklists','addBlackLists','update','delete','removeLists','removeBlackLists','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','/:id/hoppers','getHoppers'];(function(_0x1d45dc,_0x2dad23){var _0x4d84c1=function(_0x2520b2){while(--_0x2520b2){_0x1d45dc['push'](_0x1d45dc['shift']());}};_0x4d84c1(++_0x2dad23);}(_0x5ffd,0xdd));var _0xd5ff=function(_0xa9b2ea,_0x53f053){_0xa9b2ea=_0xa9b2ea-0x0;var _0x20964d=_0x5ffd[_0xa9b2ea];return _0x20964d;};'use strict';var multer=require(_0xd5ff('0x0'));var util=require(_0xd5ff('0x1'));var path=require(_0xd5ff('0x2'));var timeout=require(_0xd5ff('0x3'));var express=require(_0xd5ff('0x4'));var router=express[_0xd5ff('0x5')]();var fs_extra=require(_0xd5ff('0x6'));var auth=require(_0xd5ff('0x7'));var interaction=require(_0xd5ff('0x8'));var config=require(_0xd5ff('0x9'));var controller=require(_0xd5ff('0xa'));router[_0xd5ff('0xb')]('/',auth[_0xd5ff('0xc')](),controller[_0xd5ff('0xd')]);router['get'](_0xd5ff('0xe'),auth[_0xd5ff('0xc')](),controller['show']);router[_0xd5ff('0xb')](_0xd5ff('0xf'),auth[_0xd5ff('0xc')](),controller[_0xd5ff('0x10')]);router[_0xd5ff('0xb')](_0xd5ff('0x11'),auth[_0xd5ff('0xc')](),controller['getHopperHistories']);router[_0xd5ff('0xb')](_0xd5ff('0x12'),auth['isAuthenticated'](),controller[_0xd5ff('0x13')]);router[_0xd5ff('0xb')](_0xd5ff('0x14'),auth[_0xd5ff('0xc')](),controller[_0xd5ff('0x15')]);router['get']('/:id/lists',auth[_0xd5ff('0xc')](),controller[_0xd5ff('0x16')]);router[_0xd5ff('0xb')]('/:id/blacklists',auth[_0xd5ff('0xc')](),controller['getBlackLists']);router[_0xd5ff('0x17')]('/',auth[_0xd5ff('0xc')](),controller['create']);router['post'](_0xd5ff('0x18'),auth['isAuthenticated'](),controller[_0xd5ff('0x19')]);router[_0xd5ff('0x17')](_0xd5ff('0x1a'),auth[_0xd5ff('0xc')](),controller[_0xd5ff('0x1b')]);router[_0xd5ff('0x17')](_0xd5ff('0x1c'),auth['isAuthenticated'](),controller[_0xd5ff('0x1d')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xd5ff('0x1e')]);router['delete'](_0xd5ff('0xe'),auth[_0xd5ff('0xc')](),controller['destroy']);router[_0xd5ff('0x1f')]('/:id/lists',auth[_0xd5ff('0xc')](),controller[_0xd5ff('0x20')]);router['delete']('/:id/blacklists',auth[_0xd5ff('0xc')](),controller[_0xd5ff('0x21')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index d4ed130..688f8c6 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 _0xf500=['sequelize','exports','STRING','VIRTUAL','getDataValue','key'];(function(_0x208961,_0x5e6cf6){var _0x4236f5=function(_0x28856f){while(--_0x28856f){_0x208961['push'](_0x208961['shift']());}};_0x4236f5(++_0x5e6cf6);}(_0xf500,0x1e0));var _0x0f50=function(_0x29db36,_0x410ae9){_0x29db36=_0x29db36-0x0;var _0x234e87=_0xf500[_0x29db36];return _0x234e87;};'use strict';var Sequelize=require(_0x0f50('0x0'));module[_0x0f50('0x1')]={'key':{'type':Sequelize[_0x0f50('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x0f50('0x2')]},'name':{'type':Sequelize[_0x0f50('0x3')],'get':function(){return this[_0x0f50('0x4')](_0x0f50('0x5'));}}}; \ No newline at end of file +var _0x73d3=['VIRTUAL','getDataValue','exports','TEXT','STRING'];(function(_0x483649,_0x49ec8c){var _0x1cd65b=function(_0xf43e79){while(--_0xf43e79){_0x483649['push'](_0x483649['shift']());}};_0x1cd65b(++_0x49ec8c);}(_0x73d3,0x19c));var _0x373d=function(_0x9879aa,_0x345d9b){_0x9879aa=_0x9879aa-0x0;var _0x2c3f77=_0x73d3[_0x9879aa];return _0x2c3f77;};'use strict';var Sequelize=require('sequelize');module[_0x373d('0x0')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x373d('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x373d('0x2')]},'name':{'type':Sequelize[_0x373d('0x3')],'get':function(){return this[_0x373d('0x4')]('key');}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index e1981d9..ec274c8 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 _0x20bc=['OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CannedAnswers','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','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','undefined','count','set','Content-Range','reject','update','then','destroy','get','error','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','limit','order','where','filter','merge','options','include','findAll','rows','catch','params','length','includeAll','body','find','create','MailAccountId','SmsAccountId'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x20bc,0x66));var _0xc20b=function(_0x354bd6,_0x4a7c74){_0x354bd6=_0x354bd6-0x0;var _0x39bf52=_0x20bc[_0x354bd6];return _0x39bf52;};'use strict';var emlformat=require(_0xc20b('0x0'));var rimraf=require(_0xc20b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc20b('0x2'));var rp=require(_0xc20b('0x3'));var moment=require(_0xc20b('0x4'));var BPromise=require(_0xc20b('0x5'));var Mustache=require('mustache');var util=require(_0xc20b('0x6'));var path=require(_0xc20b('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc20b('0x8'));var fs=require('fs');var fs_extra=require(_0xc20b('0x9'));var _=require(_0xc20b('0xa'));var squel=require('squel');var crypto=require(_0xc20b('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xc20b('0xc'));var toCsv=require('to-csv');var querystring=require(_0xc20b('0xd'));var Papa=require(_0xc20b('0xe'));var Redis=require(_0xc20b('0xf'));var authService=require(_0xc20b('0x10'));var qs=require(_0xc20b('0x11'));var as=require(_0xc20b('0x12'));var hardwareService=require(_0xc20b('0x13'));var logger=require(_0xc20b('0x14'))(_0xc20b('0x15'));var utils=require(_0xc20b('0x16'));var config=require(_0xc20b('0x17'));var licenseUtil=require(_0xc20b('0x18'));var db=require(_0xc20b('0x19'))['db'];function respondWithStatusCode(_0x3e6b85,_0x7c90ba){_0x7c90ba=_0x7c90ba||0xcc;return function(_0x6ba88b){if(_0x6ba88b){return _0x3e6b85[_0xc20b('0x1a')](_0x7c90ba);}return _0x3e6b85[_0xc20b('0x1b')](_0x7c90ba)[_0xc20b('0x1c')]();};}function respondWithResult(_0x2226cb,_0x39c630){_0x39c630=_0x39c630||0xc8;return function(_0x12cd63){if(_0x12cd63){return _0x2226cb['status'](_0x39c630)[_0xc20b('0x1d')](_0x12cd63);}};}function respondWithFilteredResult(_0x535705,_0x126644){return function(_0x5a0c59){if(_0x5a0c59){var _0x45e5cc=typeof _0x126644[_0xc20b('0x1e')]==='undefined'&&typeof _0x126644['limit']===_0xc20b('0x1f');var _0x2ee0f7=_0x5a0c59[_0xc20b('0x20')];var _0x5e1863=_0x45e5cc?0x0:_0x126644['offset'];var _0x1fb350=_0x45e5cc?_0x5a0c59['count']:_0x126644[_0xc20b('0x1e')]+_0x126644['limit'];var _0x3888b3;if(_0x1fb350>=_0x2ee0f7){_0x1fb350=_0x2ee0f7;_0x3888b3=0xc8;}else{_0x3888b3=0xce;}_0x535705[_0xc20b('0x1b')](_0x3888b3);return _0x535705[_0xc20b('0x21')](_0xc20b('0x22'),_0x5e1863+'-'+_0x1fb350+'/'+_0x2ee0f7)['json'](_0x5a0c59);}return null;};}function patchUpdates(_0x13fe69){return function(_0x774350){try{jsonpatch['apply'](_0x774350,_0x13fe69,!![]);}catch(_0x3b03df){return BPromise[_0xc20b('0x23')](_0x3b03df);}return _0x774350['save']();};}function saveUpdates(_0x265b5a,_0xd3cbe7){return function(_0x212daf){if(_0x212daf){return _0x212daf[_0xc20b('0x24')](_0x265b5a)[_0xc20b('0x25')](function(_0x3a6bfe){return _0x3a6bfe;});}return null;};}function removeEntity(_0x463ff3,_0x4844bf){return function(_0x7afd0e){if(_0x7afd0e){return _0x7afd0e[_0xc20b('0x26')]()[_0xc20b('0x25')](function(){var _0x460407=_0x7afd0e[_0xc20b('0x27')]({'plain':!![]});var _0x3be424='CannedAnswers';return db['UserProfileResource'][_0xc20b('0x26')]({'where':{'type':_0x3be424,'resourceId':_0x460407['id']}})['then'](function(){return _0x7afd0e;});})[_0xc20b('0x25')](function(){_0x463ff3[_0xc20b('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe3d9ca,_0x5e4660){return function(_0x10f8d5){if(!_0x10f8d5){_0xe3d9ca[_0xc20b('0x1a')](0x194);}return _0x10f8d5;};}function handleError(_0x59d130,_0x1bacdd){_0x1bacdd=_0x1bacdd||0x1f4;return function(_0x3a954b){logger[_0xc20b('0x28')](_0x3a954b[_0xc20b('0x29')]);if(_0x3a954b[_0xc20b('0x2a')]){delete _0x3a954b[_0xc20b('0x2a')];}_0x59d130[_0xc20b('0x1b')](_0x1bacdd)[_0xc20b('0x2b')](_0x3a954b);};}exports[_0xc20b('0x2c')]=function(_0x20230f,_0x4af17c){var _0x212e1e={},_0xee707e={},_0x4a8481={'count':0x0,'rows':[]};var _0x537b76=_[_0xc20b('0x2d')](db[_0xc20b('0x2e')][_0xc20b('0x2f')],function(_0x1e77dc){return{'name':_0x1e77dc[_0xc20b('0x30')],'type':_0x1e77dc[_0xc20b('0x31')][_0xc20b('0x32')]};});_0xee707e['model']=_['map'](_0x537b76,_0xc20b('0x2a'));_0xee707e[_0xc20b('0x33')]=_[_0xc20b('0x34')](_0x20230f[_0xc20b('0x33')]);_0xee707e[_0xc20b('0x35')]=_[_0xc20b('0x36')](_0xee707e['model'],_0xee707e[_0xc20b('0x33')]);_0x212e1e[_0xc20b('0x37')]=_[_0xc20b('0x36')](_0xee707e[_0xc20b('0x38')],qs[_0xc20b('0x39')](_0x20230f[_0xc20b('0x33')]['fields']));_0x212e1e[_0xc20b('0x37')]=_0x212e1e[_0xc20b('0x37')]['length']?_0x212e1e[_0xc20b('0x37')]:_0xee707e[_0xc20b('0x38')];if(!_0x20230f[_0xc20b('0x33')][_0xc20b('0x3a')](_0xc20b('0x3b'))){_0x212e1e[_0xc20b('0x3c')]=qs[_0xc20b('0x3c')](_0x20230f[_0xc20b('0x33')][_0xc20b('0x3c')]);_0x212e1e[_0xc20b('0x1e')]=qs['offset'](_0x20230f['query'][_0xc20b('0x1e')]);}_0x212e1e[_0xc20b('0x3d')]=qs['sort'](_0x20230f[_0xc20b('0x33')]['sort']);_0x212e1e[_0xc20b('0x3e')]=qs[_0xc20b('0x35')](_['pick'](_0x20230f[_0xc20b('0x33')],_0xee707e['filters']),_0x537b76);if(_0x20230f[_0xc20b('0x33')][_0xc20b('0x3f')]){_0x212e1e[_0xc20b('0x3e')]=_[_0xc20b('0x40')](_0x212e1e[_0xc20b('0x3e')],{'$or':[{'key':{'$like':'%'+_0x20230f[_0xc20b('0x33')][_0xc20b('0x3f')]+'%'}},{'value':{'$like':'%'+_0x20230f['query'][_0xc20b('0x3f')]+'%'}}]});}_0x212e1e=_['merge']({},_0x212e1e,_0x20230f[_0xc20b('0x41')]);var _0xd478d1={'where':_0x212e1e[_0xc20b('0x3e')]};return db[_0xc20b('0x2e')]['count'](_0xd478d1)[_0xc20b('0x25')](function(_0x4f50e8){_0x4a8481[_0xc20b('0x20')]=_0x4f50e8;if(_0x20230f[_0xc20b('0x33')]['includeAll']){_0x212e1e[_0xc20b('0x42')]=[{'all':!![]}];}return db[_0xc20b('0x2e')][_0xc20b('0x43')](_0x212e1e);})[_0xc20b('0x25')](function(_0x4da5a3){_0x4a8481[_0xc20b('0x44')]=_0x4da5a3;return _0x4a8481;})[_0xc20b('0x25')](respondWithFilteredResult(_0x4af17c,_0x212e1e))[_0xc20b('0x45')](handleError(_0x4af17c,null));};exports['show']=function(_0xfa3656,_0x193d3b){var _0x33b66c={'raw':!![],'where':{'id':_0xfa3656[_0xc20b('0x46')]['id']}},_0x5363a2={};_0x5363a2[_0xc20b('0x38')]=_[_0xc20b('0x34')](db[_0xc20b('0x2e')]['rawAttributes']);_0x5363a2[_0xc20b('0x33')]=_[_0xc20b('0x34')](_0xfa3656[_0xc20b('0x33')]);_0x5363a2[_0xc20b('0x35')]=_[_0xc20b('0x36')](_0x5363a2[_0xc20b('0x38')],_0x5363a2[_0xc20b('0x33')]);_0x33b66c[_0xc20b('0x37')]=_[_0xc20b('0x36')](_0x5363a2[_0xc20b('0x38')],qs[_0xc20b('0x39')](_0xfa3656[_0xc20b('0x33')][_0xc20b('0x39')]));_0x33b66c[_0xc20b('0x37')]=_0x33b66c['attributes'][_0xc20b('0x47')]?_0x33b66c['attributes']:_0x5363a2[_0xc20b('0x38')];if(_0xfa3656['query'][_0xc20b('0x48')]){_0x33b66c[_0xc20b('0x42')]=[{'all':!![]}];}_0x33b66c=_[_0xc20b('0x40')]({},_0x33b66c,_0xfa3656[_0xc20b('0x41')]);return db[_0xc20b('0x2e')]['find'](_0x33b66c)[_0xc20b('0x25')](handleEntityNotFound(_0x193d3b,null))[_0xc20b('0x25')](respondWithResult(_0x193d3b,null))[_0xc20b('0x45')](handleError(_0x193d3b,null));};exports[_0xc20b('0x24')]=function(_0x3a83ff,_0x4dcee9){if(_0x3a83ff[_0xc20b('0x49')]['id']){delete _0x3a83ff[_0xc20b('0x49')]['id'];}return db[_0xc20b('0x2e')][_0xc20b('0x4a')]({'where':{'id':_0x3a83ff[_0xc20b('0x46')]['id']}})[_0xc20b('0x25')](handleEntityNotFound(_0x4dcee9,null))[_0xc20b('0x25')](saveUpdates(_0x3a83ff[_0xc20b('0x49')],null))['then'](respondWithResult(_0x4dcee9,null))[_0xc20b('0x45')](handleError(_0x4dcee9,null));};exports['destroy']=function(_0x39fbac,_0x246252){return db[_0xc20b('0x2e')]['find']({'where':{'id':_0x39fbac['params']['id']}})[_0xc20b('0x25')](handleEntityNotFound(_0x246252,null))[_0xc20b('0x25')](removeEntity(_0x246252,null))[_0xc20b('0x45')](handleError(_0x246252,null));};exports[_0xc20b('0x4b')]=function(_0x42485f,_0x5d8614){var _0x49ee02={'key':_0x42485f[_0xc20b('0x49')]['key']};if(_0x42485f['body']['MailAccountId']){_0x49ee02['MailAccountId']=_0x42485f[_0xc20b('0x49')][_0xc20b('0x4c')];}else if(_0x42485f[_0xc20b('0x49')][_0xc20b('0x4d')]){_0x49ee02[_0xc20b('0x4d')]=_0x42485f['body'][_0xc20b('0x4d')];}else if(_0x42485f[_0xc20b('0x49')][_0xc20b('0x4e')]){_0x49ee02['OpenchannelAccountId']=_0x42485f['body'][_0xc20b('0x4e')];}else if(_0x42485f['body'][_0xc20b('0x4f')]){_0x49ee02[_0xc20b('0x4f')]=_0x42485f[_0xc20b('0x49')][_0xc20b('0x4f')];}return db[_0xc20b('0x2e')][_0xc20b('0x4a')]({'where':_0x49ee02})['then'](function(_0x28eef9){if(_0x28eef9){throw new db[(_0xc20b('0x50'))][(_0xc20b('0x51'))](_0xc20b('0x52'));}return db[_0xc20b('0x2e')]['create'](_0x42485f[_0xc20b('0x49')]);})[_0xc20b('0x25')](function(_0x114d80){var _0x148cf9=_0x42485f[_0xc20b('0x53')][_0xc20b('0x27')]({'plain':!![]});if(!_0x148cf9)throw new Error(_0xc20b('0x54'));if(_0x148cf9[_0xc20b('0x55')]===_0xc20b('0x53')){var _0x4636cd=_0x114d80[_0xc20b('0x27')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0xc20b('0x56'),'userProfileId':_0x148cf9[_0xc20b('0x57')]},'raw':!![]})['then'](function(_0x5b8c4d){if(_0x5b8c4d&&_0x5b8c4d['autoAssociation']===0x0){return db[_0xc20b('0x58')][_0xc20b('0x4b')]({'name':_0x4636cd['name'],'resourceId':_0x4636cd['id'],'type':_0x5b8c4d['name'],'sectionId':_0x5b8c4d['id']},{})[_0xc20b('0x25')](function(){return _0x114d80;});}else{return _0x114d80;}})['catch'](function(_0x3dce7c){logger[_0xc20b('0x28')](_0xc20b('0x59'),_0x3dce7c);throw _0x3dce7c;});}return _0x114d80;})['then'](respondWithResult(_0x5d8614,0xc9))[_0xc20b('0x45')](handleError(_0x5d8614,null));}; \ No newline at end of file +var _0xa131=['get','CannedAnswers','UserProfileResource','destroy','then','sendStatus','error','stack','name','map','CannedAnswer','type','key','model','keys','query','intersection','fields','length','attributes','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','options','include','rows','show','params','includeAll','find','body','catch','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','Content-Range','reject','update'];(function(_0x4079fb,_0x4b8997){var _0x3c96bb=function(_0x1b4175){while(--_0x1b4175){_0x4079fb['push'](_0x4079fb['shift']());}};_0x3c96bb(++_0x4b8997);}(_0xa131,0xe1));var _0x1a13=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa131[_0x5c3c0b];return _0x52ecd2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1a13('0x0'));var jsonpatch=require(_0x1a13('0x1'));var rp=require('request-promise');var moment=require(_0x1a13('0x2'));var BPromise=require(_0x1a13('0x3'));var Mustache=require('mustache');var util=require(_0x1a13('0x4'));var path=require(_0x1a13('0x5'));var sox=require(_0x1a13('0x6'));var csv=require(_0x1a13('0x7'));var ejs=require(_0x1a13('0x8'));var fs=require('fs');var fs_extra=require(_0x1a13('0x9'));var _=require(_0x1a13('0xa'));var squel=require('squel');var crypto=require(_0x1a13('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x1a13('0xc'));var toCsv=require(_0x1a13('0x7'));var querystring=require(_0x1a13('0xd'));var Papa=require(_0x1a13('0xe'));var Redis=require(_0x1a13('0xf'));var authService=require(_0x1a13('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x1a13('0x11'));var hardwareService=require(_0x1a13('0x12'));var logger=require(_0x1a13('0x13'))(_0x1a13('0x14'));var utils=require('../../config/utils');var config=require(_0x1a13('0x15'));var licenseUtil=require(_0x1a13('0x16'));var db=require(_0x1a13('0x17'))['db'];function respondWithStatusCode(_0x59485e,_0x15cb14){_0x15cb14=_0x15cb14||0xcc;return function(_0x48e5cb){if(_0x48e5cb){return _0x59485e['sendStatus'](_0x15cb14);}return _0x59485e[_0x1a13('0x18')](_0x15cb14)[_0x1a13('0x19')]();};}function respondWithResult(_0x1bcea6,_0x508185){_0x508185=_0x508185||0xc8;return function(_0x4a0267){if(_0x4a0267){return _0x1bcea6[_0x1a13('0x18')](_0x508185)[_0x1a13('0x1a')](_0x4a0267);}};}function respondWithFilteredResult(_0x101042,_0x2da524){return function(_0x4ed827){if(_0x4ed827){var _0x46bc6f=typeof _0x2da524[_0x1a13('0x1b')]===_0x1a13('0x1c')&&typeof _0x2da524['limit']===_0x1a13('0x1c');var _0x5df191=_0x4ed827['count'];var _0x337e98=_0x46bc6f?0x0:_0x2da524['offset'];var _0x575802=_0x46bc6f?_0x4ed827[_0x1a13('0x1d')]:_0x2da524['offset']+_0x2da524['limit'];var _0x4d4af7;if(_0x575802>=_0x5df191){_0x575802=_0x5df191;_0x4d4af7=0xc8;}else{_0x4d4af7=0xce;}_0x101042[_0x1a13('0x18')](_0x4d4af7);return _0x101042['set'](_0x1a13('0x1e'),_0x337e98+'-'+_0x575802+'/'+_0x5df191)['json'](_0x4ed827);}return null;};}function patchUpdates(_0x5e2b4f){return function(_0x1f3e8b){try{jsonpatch['apply'](_0x1f3e8b,_0x5e2b4f,!![]);}catch(_0x493f6f){return BPromise[_0x1a13('0x1f')](_0x493f6f);}return _0x1f3e8b['save']();};}function saveUpdates(_0x190581,_0x59e52d){return function(_0x51a3c1){if(_0x51a3c1){return _0x51a3c1[_0x1a13('0x20')](_0x190581)['then'](function(_0x36084c){return _0x36084c;});}return null;};}function removeEntity(_0x253252,_0x5c89b3){return function(_0x1e3f29){if(_0x1e3f29){return _0x1e3f29['destroy']()['then'](function(){var _0xf48be6=_0x1e3f29[_0x1a13('0x21')]({'plain':!![]});var _0x297d59=_0x1a13('0x22');return db[_0x1a13('0x23')][_0x1a13('0x24')]({'where':{'type':_0x297d59,'resourceId':_0xf48be6['id']}})['then'](function(){return _0x1e3f29;});})[_0x1a13('0x25')](function(){_0x253252[_0x1a13('0x18')](0xcc)[_0x1a13('0x19')]();});}};}function handleEntityNotFound(_0x14942c,_0x40f9fb){return function(_0x1ead67){if(!_0x1ead67){_0x14942c[_0x1a13('0x26')](0x194);}return _0x1ead67;};}function handleError(_0x540e2a,_0x1ae571){_0x1ae571=_0x1ae571||0x1f4;return function(_0xfcacc1){logger[_0x1a13('0x27')](_0xfcacc1[_0x1a13('0x28')]);if(_0xfcacc1[_0x1a13('0x29')]){delete _0xfcacc1['name'];}_0x540e2a[_0x1a13('0x18')](_0x1ae571)['send'](_0xfcacc1);};}exports['index']=function(_0x33020d,_0x5c788b){var _0x34105f={},_0x54fbbf={},_0x207aa0={'count':0x0,'rows':[]};var _0x21869e=_[_0x1a13('0x2a')](db[_0x1a13('0x2b')]['rawAttributes'],function(_0x1db247){return{'name':_0x1db247['fieldName'],'type':_0x1db247[_0x1a13('0x2c')][_0x1a13('0x2d')]};});_0x54fbbf[_0x1a13('0x2e')]=_[_0x1a13('0x2a')](_0x21869e,_0x1a13('0x29'));_0x54fbbf['query']=_[_0x1a13('0x2f')](_0x33020d[_0x1a13('0x30')]);_0x54fbbf['filters']=_[_0x1a13('0x31')](_0x54fbbf[_0x1a13('0x2e')],_0x54fbbf[_0x1a13('0x30')]);_0x34105f['attributes']=_[_0x1a13('0x31')](_0x54fbbf[_0x1a13('0x2e')],qs['fields'](_0x33020d['query'][_0x1a13('0x32')]));_0x34105f['attributes']=_0x34105f['attributes'][_0x1a13('0x33')]?_0x34105f[_0x1a13('0x34')]:_0x54fbbf[_0x1a13('0x2e')];if(!_0x33020d[_0x1a13('0x30')][_0x1a13('0x35')](_0x1a13('0x36'))){_0x34105f['limit']=qs[_0x1a13('0x37')](_0x33020d[_0x1a13('0x30')][_0x1a13('0x37')]);_0x34105f[_0x1a13('0x1b')]=qs['offset'](_0x33020d[_0x1a13('0x30')]['offset']);}_0x34105f[_0x1a13('0x38')]=qs['sort'](_0x33020d[_0x1a13('0x30')][_0x1a13('0x39')]);_0x34105f[_0x1a13('0x3a')]=qs[_0x1a13('0x3b')](_[_0x1a13('0x3c')](_0x33020d['query'],_0x54fbbf[_0x1a13('0x3b')]),_0x21869e);if(_0x33020d[_0x1a13('0x30')][_0x1a13('0x3d')]){_0x34105f[_0x1a13('0x3a')]=_[_0x1a13('0x3e')](_0x34105f[_0x1a13('0x3a')],{'$or':[{'key':{'$like':'%'+_0x33020d[_0x1a13('0x30')][_0x1a13('0x3d')]+'%'}},{'value':{'$like':'%'+_0x33020d[_0x1a13('0x30')]['filter']+'%'}}]});}_0x34105f=_[_0x1a13('0x3e')]({},_0x34105f,_0x33020d[_0x1a13('0x3f')]);var _0x1d8a85={'where':_0x34105f[_0x1a13('0x3a')]};return db[_0x1a13('0x2b')][_0x1a13('0x1d')](_0x1d8a85)['then'](function(_0x376817){_0x207aa0[_0x1a13('0x1d')]=_0x376817;if(_0x33020d[_0x1a13('0x30')]['includeAll']){_0x34105f[_0x1a13('0x40')]=[{'all':!![]}];}return db[_0x1a13('0x2b')]['findAll'](_0x34105f);})[_0x1a13('0x25')](function(_0xe2f9c9){_0x207aa0[_0x1a13('0x41')]=_0xe2f9c9;return _0x207aa0;})[_0x1a13('0x25')](respondWithFilteredResult(_0x5c788b,_0x34105f))['catch'](handleError(_0x5c788b,null));};exports[_0x1a13('0x42')]=function(_0x4d086,_0xc34592){var _0xfe32d7={'raw':!![],'where':{'id':_0x4d086[_0x1a13('0x43')]['id']}},_0x5d55d7={};_0x5d55d7['model']=_[_0x1a13('0x2f')](db['CannedAnswer']['rawAttributes']);_0x5d55d7['query']=_['keys'](_0x4d086[_0x1a13('0x30')]);_0x5d55d7[_0x1a13('0x3b')]=_[_0x1a13('0x31')](_0x5d55d7[_0x1a13('0x2e')],_0x5d55d7[_0x1a13('0x30')]);_0xfe32d7['attributes']=_['intersection'](_0x5d55d7['model'],qs['fields'](_0x4d086['query'][_0x1a13('0x32')]));_0xfe32d7['attributes']=_0xfe32d7[_0x1a13('0x34')][_0x1a13('0x33')]?_0xfe32d7[_0x1a13('0x34')]:_0x5d55d7['model'];if(_0x4d086[_0x1a13('0x30')][_0x1a13('0x44')]){_0xfe32d7[_0x1a13('0x40')]=[{'all':!![]}];}_0xfe32d7=_[_0x1a13('0x3e')]({},_0xfe32d7,_0x4d086[_0x1a13('0x3f')]);return db[_0x1a13('0x2b')][_0x1a13('0x45')](_0xfe32d7)[_0x1a13('0x25')](handleEntityNotFound(_0xc34592,null))['then'](respondWithResult(_0xc34592,null))['catch'](handleError(_0xc34592,null));};exports['update']=function(_0x3ae6ec,_0x26f89a){if(_0x3ae6ec[_0x1a13('0x46')]['id']){delete _0x3ae6ec[_0x1a13('0x46')]['id'];}return db[_0x1a13('0x2b')]['find']({'where':{'id':_0x3ae6ec['params']['id']}})[_0x1a13('0x25')](handleEntityNotFound(_0x26f89a,null))[_0x1a13('0x25')](saveUpdates(_0x3ae6ec[_0x1a13('0x46')],null))[_0x1a13('0x25')](respondWithResult(_0x26f89a,null))[_0x1a13('0x47')](handleError(_0x26f89a,null));};exports['destroy']=function(_0x55e5b2,_0x4c2fa2){return db[_0x1a13('0x2b')][_0x1a13('0x45')]({'where':{'id':_0x55e5b2['params']['id']}})[_0x1a13('0x25')](handleEntityNotFound(_0x4c2fa2,null))['then'](removeEntity(_0x4c2fa2,null))[_0x1a13('0x47')](handleError(_0x4c2fa2,null));};exports[_0x1a13('0x48')]=function(_0x17acda,_0x465fad){var _0xb9576b={'key':_0x17acda[_0x1a13('0x46')]['key']};if(_0x17acda[_0x1a13('0x46')][_0x1a13('0x49')]){_0xb9576b['MailAccountId']=_0x17acda[_0x1a13('0x46')][_0x1a13('0x49')];}else if(_0x17acda['body'][_0x1a13('0x4a')]){_0xb9576b[_0x1a13('0x4a')]=_0x17acda[_0x1a13('0x46')][_0x1a13('0x4a')];}else if(_0x17acda[_0x1a13('0x46')]['OpenchannelAccountId']){_0xb9576b['OpenchannelAccountId']=_0x17acda[_0x1a13('0x46')][_0x1a13('0x4b')];}else if(_0x17acda['body'][_0x1a13('0x4c')]){_0xb9576b[_0x1a13('0x4c')]=_0x17acda[_0x1a13('0x46')][_0x1a13('0x4c')];}return db['CannedAnswer']['find']({'where':_0xb9576b})[_0x1a13('0x25')](function(_0x517a48){if(_0x517a48){throw new db[(_0x1a13('0x4d'))][(_0x1a13('0x4e'))](_0x1a13('0x4f'));}return db['CannedAnswer'][_0x1a13('0x48')](_0x17acda[_0x1a13('0x46')]);})[_0x1a13('0x25')](function(_0x4530df){var _0x3090bb=_0x17acda[_0x1a13('0x50')][_0x1a13('0x21')]({'plain':!![]});if(!_0x3090bb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3090bb[_0x1a13('0x51')]===_0x1a13('0x50')){var _0x398ab8=_0x4530df['get']({'plain':!![]});return db[_0x1a13('0x52')][_0x1a13('0x45')]({'where':{'name':_0x1a13('0x22'),'userProfileId':_0x3090bb[_0x1a13('0x53')]},'raw':!![]})[_0x1a13('0x25')](function(_0x124b07){if(_0x124b07&&_0x124b07[_0x1a13('0x54')]===0x0){return db[_0x1a13('0x23')][_0x1a13('0x48')]({'name':_0x398ab8[_0x1a13('0x29')],'resourceId':_0x398ab8['id'],'type':_0x124b07[_0x1a13('0x29')],'sectionId':_0x124b07['id']},{})['then'](function(){return _0x4530df;});}else{return _0x4530df;}})[_0x1a13('0x47')](function(_0xf71816){logger[_0x1a13('0x27')](_0x1a13('0x55'),_0xf71816);throw _0xf71816;});}return _0x4530df;})[_0x1a13('0x25')](respondWithResult(_0x465fad,0xc9))[_0x1a13('0x47')](handleError(_0x465fad,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 2386a39..1a9a3af 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 _0xf81b=['lodash','../../config/logger','api','path','rimraf','../../config/environment','./cannedAnswer.attributes','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci'];(function(_0x576544,_0x34b23c){var _0x1d8e8f=function(_0x526055){while(--_0x526055){_0x576544['push'](_0x576544['shift']());}};_0x1d8e8f(++_0x34b23c);}(_0xf81b,0xdc));var _0xbf81=function(_0x3f7cdd,_0xfe84d8){_0x3f7cdd=_0x3f7cdd-0x0;var _0x4fe65c=_0xf81b[_0x3f7cdd];return _0x4fe65c;};'use strict';var _=require(_0xbf81('0x0'));var util=require('util');var logger=require(_0xbf81('0x1'))(_0xbf81('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbf81('0x3'));var rimraf=require(_0xbf81('0x4'));var config=require(_0xbf81('0x5'));var attributes=require(_0xbf81('0x6'));module['exports']=function(_0x1749af,_0x300716){return _0x1749af['define'](_0xbf81('0x7'),attributes,{'tableName':_0xbf81('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xbf81('0x9')});}; \ No newline at end of file +var _0x15ea=['request-promise','path','../../config/environment','./cannedAnswer.attributes','define','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment'];(function(_0x336901,_0x4f17e6){var _0x191e8e=function(_0x332011){while(--_0x332011){_0x336901['push'](_0x336901['shift']());}};_0x191e8e(++_0x4f17e6);}(_0x15ea,0x164));var _0xa15e=function(_0x4999da,_0x136d40){_0x4999da=_0x4999da-0x0;var _0x1c9b2d=_0x15ea[_0x4999da];return _0x1c9b2d;};'use strict';var _=require(_0xa15e('0x0'));var util=require('util');var logger=require(_0xa15e('0x1'))(_0xa15e('0x2'));var moment=require(_0xa15e('0x3'));var BPromise=require('bluebird');var rp=require(_0xa15e('0x4'));var fs=require('fs');var path=require(_0xa15e('0x5'));var rimraf=require('rimraf');var config=require(_0xa15e('0x6'));var attributes=require(_0xa15e('0x7'));module['exports']=function(_0x4e0afe,_0x518a24){return _0x4e0afe[_0xa15e('0x8')](_0xa15e('0x9'),attributes,{'tableName':_0xa15e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xa15e('0xb')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index e0771f4..f4125d6 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(_0x449ae9,_0xcf21e2){var _0x4ff01d=function(_0x47a15b){while(--_0x47a15b){_0x449ae9['push'](_0x449ae9['shift']());}};_0x4ff01d(++_0xcf21e2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'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(_0x470a83,_0x825fa){var _0x5dfef3=function(_0x31f3a3){while(--_0x31f3a3){_0x470a83['push'](_0x470a83['shift']());}};_0x5dfef3(++_0x825fa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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 d9b713a..c442ac4 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 _0x3de5=['post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','index','/:id'];(function(_0x4afd3a,_0x584698){var _0x1664f8=function(_0x2ff360){while(--_0x2ff360){_0x4afd3a['push'](_0x4afd3a['shift']());}};_0x1664f8(++_0x584698);}(_0x3de5,0x110));var _0x53de=function(_0x227b67,_0x5c4075){_0x227b67=_0x227b67-0x0;var _0x16f616=_0x3de5[_0x227b67];return _0x16f616;};'use strict';var multer=require(_0x53de('0x0'));var util=require(_0x53de('0x1'));var path=require(_0x53de('0x2'));var timeout=require(_0x53de('0x3'));var express=require(_0x53de('0x4'));var router=express[_0x53de('0x5')]();var fs_extra=require(_0x53de('0x6'));var auth=require(_0x53de('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x53de('0x8'));var controller=require(_0x53de('0x9'));router['get']('/',auth[_0x53de('0xa')](),controller[_0x53de('0xb')]);router['get'](_0x53de('0xc'),auth[_0x53de('0xa')](),controller['show']);router[_0x53de('0xd')]('/',auth[_0x53de('0xa')](),controller[_0x53de('0xe')]);router[_0x53de('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x53de('0x10')]);router['delete'](_0x53de('0xc'),auth['isAuthenticated'](),controller[_0x53de('0x11')]);module[_0x53de('0x12')]=router; \ No newline at end of file +var _0x470f=['index','/:id','post','create','put','update','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated'];(function(_0x14bba9,_0x535bff){var _0x234707=function(_0x5a2d22){while(--_0x5a2d22){_0x14bba9['push'](_0x14bba9['shift']());}};_0x234707(++_0x535bff);}(_0x470f,0x166));var _0xf470=function(_0x4260f3,_0x4988d6){_0x4260f3=_0x4260f3-0x0;var _0x31b726=_0x470f[_0x4260f3];return _0x31b726;};'use strict';var multer=require('multer');var util=require(_0xf470('0x0'));var path=require(_0xf470('0x1'));var timeout=require(_0xf470('0x2'));var express=require(_0xf470('0x3'));var router=express[_0xf470('0x4')]();var fs_extra=require(_0xf470('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf470('0x6'));var config=require('../../config/environment');var controller=require(_0xf470('0x7'));router[_0xf470('0x8')]('/',auth[_0xf470('0x9')](),controller[_0xf470('0xa')]);router['get'](_0xf470('0xb'),auth[_0xf470('0x9')](),controller['show']);router[_0xf470('0xc')]('/',auth[_0xf470('0x9')](),controller[_0xf470('0xd')]);router[_0xf470('0xe')]('/:id',auth[_0xf470('0x9')](),controller[_0xf470('0xf')]);router['delete'](_0xf470('0xb'),auth[_0xf470('0x9')](),controller['destroy']);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 ed5bae0..505b307 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 _0x4058=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports','DATE'];(function(_0x52da21,_0x242123){var _0x12cb79=function(_0xb7f988){while(--_0xb7f988){_0x52da21['push'](_0x52da21['shift']());}};_0x12cb79(++_0x242123);}(_0x4058,0x129));var _0x8405=function(_0xf71966,_0x40f202){_0xf71966=_0xf71966-0x0;var _0x4b8dca=_0x4058[_0xf71966];return _0x4b8dca;};'use strict';var Sequelize=require(_0x8405('0x0'));module[_0x8405('0x1')]={'calldate':{'type':Sequelize[_0x8405('0x2')],'allowNull':![],'defaultValue':_0x8405('0x3')},'clid':{'type':Sequelize[_0x8405('0x4')]},'src':{'type':Sequelize[_0x8405('0x4')]},'dst':{'type':Sequelize[_0x8405('0x4')]},'dcontext':{'type':Sequelize[_0x8405('0x4')]},'channel':{'type':Sequelize[_0x8405('0x4')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x8405('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x8405('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x8405('0x4')]},'amaflags':{'type':Sequelize[_0x8405('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x8405('0x4')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x8405('0x4')]},'linkedid':{'type':Sequelize[_0x8405('0x4')]},'sequence':{'type':Sequelize[_0x8405('0x4')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x8405('0x4')]},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xcffe=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports','DATE'];(function(_0x2655c3,_0x15f530){var _0x512269=function(_0x2a741d){while(--_0x2a741d){_0x2655c3['push'](_0x2655c3['shift']());}};_0x512269(++_0x15f530);}(_0xcffe,0x1a1));var _0xecff=function(_0xdd2348,_0x5d3232){_0xdd2348=_0xdd2348-0x0;var _0x2e0a02=_0xcffe[_0xdd2348];return _0x2e0a02;};'use strict';var Sequelize=require(_0xecff('0x0'));module[_0xecff('0x1')]={'calldate':{'type':Sequelize[_0xecff('0x2')],'allowNull':![],'defaultValue':_0xecff('0x3')},'clid':{'type':Sequelize[_0xecff('0x4')]},'src':{'type':Sequelize[_0xecff('0x4')]},'dst':{'type':Sequelize[_0xecff('0x4')]},'dcontext':{'type':Sequelize[_0xecff('0x4')]},'channel':{'type':Sequelize[_0xecff('0x4')]},'dstchannel':{'type':Sequelize[_0xecff('0x4')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0xecff('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xecff('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xecff('0x4')]},'amaflags':{'type':Sequelize[_0xecff('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xecff('0x4')]},'userfield':{'type':Sequelize[_0xecff('0x4')]},'uniqueid':{'type':Sequelize[_0xecff('0x4')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xecff('0x4')]},'peeraccount':{'type':Sequelize[_0xecff('0x4')]},'type':{'type':Sequelize[_0xecff('0x4')]},'tag':{'type':Sequelize[_0xecff('0x4')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index e69f894..505a956 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 _0x0faf=['includeAll','options','find','create','body','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','error','name','send','index','Cdr','rawAttributes','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','include','findAll','rows','catch','show','params','keys'];(function(_0xdabd59,_0x55e984){var _0x4af920=function(_0x7e5f46){while(--_0x7e5f46){_0xdabd59['push'](_0xdabd59['shift']());}};_0x4af920(++_0x55e984);}(_0x0faf,0x132));var _0xf0fa=function(_0x5ad67c,_0x144860){_0x5ad67c=_0x5ad67c-0x0;var _0xccce2e=_0x0faf[_0x5ad67c];return _0xccce2e;};'use strict';var emlformat=require(_0xf0fa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf0fa('0x1'));var jsonpatch=require(_0xf0fa('0x2'));var rp=require(_0xf0fa('0x3'));var moment=require(_0xf0fa('0x4'));var BPromise=require(_0xf0fa('0x5'));var Mustache=require(_0xf0fa('0x6'));var util=require(_0xf0fa('0x7'));var path=require(_0xf0fa('0x8'));var sox=require(_0xf0fa('0x9'));var csv=require('to-csv');var ejs=require(_0xf0fa('0xa'));var fs=require('fs');var fs_extra=require(_0xf0fa('0xb'));var _=require(_0xf0fa('0xc'));var squel=require(_0xf0fa('0xd'));var crypto=require(_0xf0fa('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xf0fa('0xf'));var toCsv=require(_0xf0fa('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf0fa('0x11'));var authService=require(_0xf0fa('0x12'));var qs=require(_0xf0fa('0x13'));var as=require(_0xf0fa('0x14'));var hardwareService=require(_0xf0fa('0x15'));var logger=require(_0xf0fa('0x16'))(_0xf0fa('0x17'));var utils=require(_0xf0fa('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xf0fa('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f46ff,_0x521034){_0x521034=_0x521034||0xcc;return function(_0x39ae2b){if(_0x39ae2b){return _0x2f46ff[_0xf0fa('0x1a')](_0x521034);}return _0x2f46ff[_0xf0fa('0x1b')](_0x521034)['end']();};}function respondWithResult(_0x5821ae,_0x42591b){_0x42591b=_0x42591b||0xc8;return function(_0x540a04){if(_0x540a04){return _0x5821ae[_0xf0fa('0x1b')](_0x42591b)[_0xf0fa('0x1c')](_0x540a04);}};}function respondWithFilteredResult(_0x10ce43,_0x3203ce){return function(_0x467d5f){if(_0x467d5f){var _0x33df80=typeof _0x3203ce[_0xf0fa('0x1d')]===_0xf0fa('0x1e')&&typeof _0x3203ce['limit']===_0xf0fa('0x1e');var _0x477914=_0x467d5f[_0xf0fa('0x1f')];var _0x1d3c22=_0x33df80?0x0:_0x3203ce[_0xf0fa('0x1d')];var _0x386e5f=_0x33df80?_0x467d5f['count']:_0x3203ce['offset']+_0x3203ce[_0xf0fa('0x20')];var _0x2751cc;if(_0x386e5f>=_0x477914){_0x386e5f=_0x477914;_0x2751cc=0xc8;}else{_0x2751cc=0xce;}_0x10ce43[_0xf0fa('0x1b')](_0x2751cc);return _0x10ce43[_0xf0fa('0x21')](_0xf0fa('0x22'),_0x1d3c22+'-'+_0x386e5f+'/'+_0x477914)[_0xf0fa('0x1c')](_0x467d5f);}return null;};}function patchUpdates(_0x32c9bc){return function(_0x3de639){try{jsonpatch[_0xf0fa('0x23')](_0x3de639,_0x32c9bc,!![]);}catch(_0x15942b){return BPromise[_0xf0fa('0x24')](_0x15942b);}return _0x3de639['save']();};}function saveUpdates(_0x10c93e,_0x306f3e){return function(_0x39e82d){if(_0x39e82d){return _0x39e82d[_0xf0fa('0x25')](_0x10c93e)[_0xf0fa('0x26')](function(_0x2b22c5){return _0x2b22c5;});}return null;};}function removeEntity(_0x3901aa,_0x1f0eaf){return function(_0x3feb0c){if(_0x3feb0c){return _0x3feb0c['destroy']()[_0xf0fa('0x26')](function(){_0x3901aa[_0xf0fa('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b5d7d,_0x3703b5){return function(_0x2efe88){if(!_0x2efe88){_0x3b5d7d['sendStatus'](0x194);}return _0x2efe88;};}function handleError(_0xded80d,_0x284499){_0x284499=_0x284499||0x1f4;return function(_0x3d10fb){logger[_0xf0fa('0x27')](_0x3d10fb['stack']);if(_0x3d10fb['name']){delete _0x3d10fb[_0xf0fa('0x28')];}_0xded80d[_0xf0fa('0x1b')](_0x284499)[_0xf0fa('0x29')](_0x3d10fb);};}exports[_0xf0fa('0x2a')]=function(_0x57b8e9,_0x4058d6){var _0x409a8c={},_0x1279cf={},_0x5a4fd3={'count':0x0,'rows':[]};var _0x9ad0e3=_['map'](db[_0xf0fa('0x2b')][_0xf0fa('0x2c')],function(_0x28e057){return{'name':_0x28e057['fieldName'],'type':_0x28e057[_0xf0fa('0x2d')][_0xf0fa('0x2e')]};});_0x1279cf[_0xf0fa('0x2f')]=_[_0xf0fa('0x30')](_0x9ad0e3,_0xf0fa('0x28'));_0x1279cf[_0xf0fa('0x31')]=_['keys'](_0x57b8e9['query']);_0x1279cf[_0xf0fa('0x32')]=_[_0xf0fa('0x33')](_0x1279cf['model'],_0x1279cf[_0xf0fa('0x31')]);_0x409a8c['attributes']=_['intersection'](_0x1279cf['model'],qs[_0xf0fa('0x34')](_0x57b8e9['query'][_0xf0fa('0x34')]));_0x409a8c[_0xf0fa('0x35')]=_0x409a8c[_0xf0fa('0x35')][_0xf0fa('0x36')]?_0x409a8c[_0xf0fa('0x35')]:_0x1279cf[_0xf0fa('0x2f')];if(!_0x57b8e9[_0xf0fa('0x31')][_0xf0fa('0x37')]('nolimit')){_0x409a8c[_0xf0fa('0x20')]=qs[_0xf0fa('0x20')](_0x57b8e9[_0xf0fa('0x31')]['limit']);_0x409a8c[_0xf0fa('0x1d')]=qs[_0xf0fa('0x1d')](_0x57b8e9[_0xf0fa('0x31')][_0xf0fa('0x1d')]);}_0x409a8c['order']=qs['sort'](_0x57b8e9[_0xf0fa('0x31')][_0xf0fa('0x38')]);_0x409a8c[_0xf0fa('0x39')]=qs[_0xf0fa('0x32')](_[_0xf0fa('0x3a')](_0x57b8e9['query'],_0x1279cf['filters']),_0x9ad0e3);if(_0x57b8e9['query']['filter']){_0x409a8c[_0xf0fa('0x39')]=_[_0xf0fa('0x3b')](_0x409a8c['where'],{'$or':_['map'](_0x9ad0e3,function(_0xdada45){if(_0xdada45[_0xf0fa('0x2d')]!==_0xf0fa('0x3c')){var _0xcd5ae5={};_0xcd5ae5[_0xdada45[_0xf0fa('0x28')]]={'$like':'%'+_0x57b8e9[_0xf0fa('0x31')][_0xf0fa('0x3d')]+'%'};return _0xcd5ae5;}})});}_0x409a8c=_['merge']({},_0x409a8c,_0x57b8e9['options']);var _0x344bb0={'where':_0x409a8c[_0xf0fa('0x39')]};return db[_0xf0fa('0x2b')][_0xf0fa('0x1f')](_0x344bb0)[_0xf0fa('0x26')](function(_0x1d0129){_0x5a4fd3['count']=_0x1d0129;if(_0x57b8e9[_0xf0fa('0x31')]['includeAll']){_0x409a8c[_0xf0fa('0x3e')]=[{'all':!![]}];}return db[_0xf0fa('0x2b')][_0xf0fa('0x3f')](_0x409a8c);})[_0xf0fa('0x26')](function(_0x14bee8){_0x5a4fd3[_0xf0fa('0x40')]=_0x14bee8;return _0x5a4fd3;})[_0xf0fa('0x26')](respondWithFilteredResult(_0x4058d6,_0x409a8c))[_0xf0fa('0x41')](handleError(_0x4058d6,null));};exports[_0xf0fa('0x42')]=function(_0x57fbc5,_0x51ea79){var _0x52221a={'raw':!![],'where':{'id':_0x57fbc5[_0xf0fa('0x43')]['id']}},_0x304bae={};_0x304bae['model']=_[_0xf0fa('0x44')](db[_0xf0fa('0x2b')][_0xf0fa('0x2c')]);_0x304bae[_0xf0fa('0x31')]=_['keys'](_0x57fbc5[_0xf0fa('0x31')]);_0x304bae[_0xf0fa('0x32')]=_[_0xf0fa('0x33')](_0x304bae[_0xf0fa('0x2f')],_0x304bae[_0xf0fa('0x31')]);_0x52221a[_0xf0fa('0x35')]=_[_0xf0fa('0x33')](_0x304bae[_0xf0fa('0x2f')],qs[_0xf0fa('0x34')](_0x57fbc5['query'][_0xf0fa('0x34')]));_0x52221a[_0xf0fa('0x35')]=_0x52221a[_0xf0fa('0x35')][_0xf0fa('0x36')]?_0x52221a[_0xf0fa('0x35')]:_0x304bae[_0xf0fa('0x2f')];if(_0x57fbc5['query'][_0xf0fa('0x45')]){_0x52221a[_0xf0fa('0x3e')]=[{'all':!![]}];}_0x52221a=_['merge']({},_0x52221a,_0x57fbc5[_0xf0fa('0x46')]);return db[_0xf0fa('0x2b')][_0xf0fa('0x47')](_0x52221a)[_0xf0fa('0x26')](handleEntityNotFound(_0x51ea79,null))[_0xf0fa('0x26')](respondWithResult(_0x51ea79,null))[_0xf0fa('0x41')](handleError(_0x51ea79,null));};exports[_0xf0fa('0x48')]=function(_0x32bf89,_0x35272e){return db['Cdr'][_0xf0fa('0x48')](_0x32bf89['body'],{})[_0xf0fa('0x26')](respondWithResult(_0x35272e,0xc9))[_0xf0fa('0x41')](handleError(_0x35272e,null));};exports[_0xf0fa('0x25')]=function(_0x569ba9,_0x324765){if(_0x569ba9[_0xf0fa('0x49')]['id']){delete _0x569ba9[_0xf0fa('0x49')]['id'];}return db[_0xf0fa('0x2b')][_0xf0fa('0x47')]({'where':{'id':_0x569ba9['params']['id']}})[_0xf0fa('0x26')](handleEntityNotFound(_0x324765,null))['then'](saveUpdates(_0x569ba9[_0xf0fa('0x49')],null))[_0xf0fa('0x26')](respondWithResult(_0x324765,null))[_0xf0fa('0x41')](handleError(_0x324765,null));};exports[_0xf0fa('0x4a')]=function(_0x8090a7,_0x5dd098){return db[_0xf0fa('0x2b')][_0xf0fa('0x47')]({'where':{'id':_0x8090a7[_0xf0fa('0x43')]['id']}})[_0xf0fa('0x26')](handleEntityNotFound(_0x5dd098,null))[_0xf0fa('0x26')](removeEntity(_0x5dd098,null))[_0xf0fa('0x41')](handleError(_0x5dd098,null));};exports['describe']=function(_0x44a3bf,_0x5e1e8e){return db['Cdr']['describe']()[_0xf0fa('0x26')](respondWithResult(_0x5e1e8e,null))[_0xf0fa('0x41')](handleError(_0x5e1e8e,null));}; \ No newline at end of file +var _0xa7e6=['json','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','map','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','Cdr','include','rows','catch','show','params','includeAll','find','create','body','describe','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','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0x527144,_0x3e76f7){var _0x4ba4fa=function(_0x5dbadf){while(--_0x5dbadf){_0x527144['push'](_0x527144['shift']());}};_0x4ba4fa(++_0x3e76f7);}(_0xa7e6,0x74));var _0x6a7e=function(_0x287531,_0x5732cf){_0x287531=_0x287531-0x0;var _0x5182c6=_0xa7e6[_0x287531];return _0x5182c6;};'use strict';var emlformat=require(_0x6a7e('0x0'));var rimraf=require(_0x6a7e('0x1'));var zipdir=require(_0x6a7e('0x2'));var jsonpatch=require(_0x6a7e('0x3'));var rp=require(_0x6a7e('0x4'));var moment=require(_0x6a7e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6a7e('0x6'));var util=require(_0x6a7e('0x7'));var path=require(_0x6a7e('0x8'));var sox=require(_0x6a7e('0x9'));var csv=require(_0x6a7e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6a7e('0xb'));var _=require(_0x6a7e('0xc'));var squel=require(_0x6a7e('0xd'));var crypto=require(_0x6a7e('0xe'));var jsforce=require(_0x6a7e('0xf'));var deskjs=require(_0x6a7e('0x10'));var toCsv=require(_0x6a7e('0xa'));var querystring=require(_0x6a7e('0x11'));var Papa=require(_0x6a7e('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6a7e('0x13'));var logger=require(_0x6a7e('0x14'))(_0x6a7e('0x15'));var utils=require(_0x6a7e('0x16'));var config=require(_0x6a7e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x6a7e('0x18'))['db'];function respondWithStatusCode(_0x4754ef,_0x5c0c74){_0x5c0c74=_0x5c0c74||0xcc;return function(_0x50dcc1){if(_0x50dcc1){return _0x4754ef[_0x6a7e('0x19')](_0x5c0c74);}return _0x4754ef[_0x6a7e('0x1a')](_0x5c0c74)[_0x6a7e('0x1b')]();};}function respondWithResult(_0x374763,_0x4faca9){_0x4faca9=_0x4faca9||0xc8;return function(_0x3137bc){if(_0x3137bc){return _0x374763[_0x6a7e('0x1a')](_0x4faca9)[_0x6a7e('0x1c')](_0x3137bc);}};}function respondWithFilteredResult(_0x4576fe,_0x465566){return function(_0x4b0893){if(_0x4b0893){var _0x16c9a5=typeof _0x465566['offset']==='undefined'&&typeof _0x465566[_0x6a7e('0x1d')]==='undefined';var _0x1d2abb=_0x4b0893[_0x6a7e('0x1e')];var _0x470197=_0x16c9a5?0x0:_0x465566[_0x6a7e('0x1f')];var _0x20e90a=_0x16c9a5?_0x4b0893['count']:_0x465566['offset']+_0x465566['limit'];var _0x102e83;if(_0x20e90a>=_0x1d2abb){_0x20e90a=_0x1d2abb;_0x102e83=0xc8;}else{_0x102e83=0xce;}_0x4576fe[_0x6a7e('0x1a')](_0x102e83);return _0x4576fe[_0x6a7e('0x20')](_0x6a7e('0x21'),_0x470197+'-'+_0x20e90a+'/'+_0x1d2abb)[_0x6a7e('0x1c')](_0x4b0893);}return null;};}function patchUpdates(_0x35b0ff){return function(_0x42eccc){try{jsonpatch[_0x6a7e('0x22')](_0x42eccc,_0x35b0ff,!![]);}catch(_0x5d5cbf){return BPromise[_0x6a7e('0x23')](_0x5d5cbf);}return _0x42eccc[_0x6a7e('0x24')]();};}function saveUpdates(_0x4f53c5,_0x3e1e64){return function(_0x3d0971){if(_0x3d0971){return _0x3d0971[_0x6a7e('0x25')](_0x4f53c5)['then'](function(_0x40c7f6){return _0x40c7f6;});}return null;};}function removeEntity(_0xd045ca,_0x4ee914){return function(_0x18f5e2){if(_0x18f5e2){return _0x18f5e2['destroy']()[_0x6a7e('0x26')](function(){_0xd045ca[_0x6a7e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29db13,_0x956eb6){return function(_0x46a15f){if(!_0x46a15f){_0x29db13[_0x6a7e('0x19')](0x194);}return _0x46a15f;};}function handleError(_0x3498c5,_0x380f2f){_0x380f2f=_0x380f2f||0x1f4;return function(_0x573bdc){logger[_0x6a7e('0x27')](_0x573bdc[_0x6a7e('0x28')]);if(_0x573bdc[_0x6a7e('0x29')]){delete _0x573bdc[_0x6a7e('0x29')];}_0x3498c5[_0x6a7e('0x1a')](_0x380f2f)['send'](_0x573bdc);};}exports['index']=function(_0x8b0439,_0x2e86f8){var _0x2723d0={},_0x525376={},_0xa324d0={'count':0x0,'rows':[]};var _0x57e642=_[_0x6a7e('0x2a')](db['Cdr']['rawAttributes'],function(_0x15c2b8){return{'name':_0x15c2b8['fieldName'],'type':_0x15c2b8[_0x6a7e('0x2b')]['key']};});_0x525376['model']=_[_0x6a7e('0x2a')](_0x57e642,_0x6a7e('0x29'));_0x525376[_0x6a7e('0x2c')]=_[_0x6a7e('0x2d')](_0x8b0439[_0x6a7e('0x2c')]);_0x525376[_0x6a7e('0x2e')]=_[_0x6a7e('0x2f')](_0x525376[_0x6a7e('0x30')],_0x525376[_0x6a7e('0x2c')]);_0x2723d0[_0x6a7e('0x31')]=_[_0x6a7e('0x2f')](_0x525376[_0x6a7e('0x30')],qs['fields'](_0x8b0439[_0x6a7e('0x2c')][_0x6a7e('0x32')]));_0x2723d0[_0x6a7e('0x31')]=_0x2723d0['attributes'][_0x6a7e('0x33')]?_0x2723d0[_0x6a7e('0x31')]:_0x525376[_0x6a7e('0x30')];if(!_0x8b0439[_0x6a7e('0x2c')][_0x6a7e('0x34')](_0x6a7e('0x35'))){_0x2723d0['limit']=qs['limit'](_0x8b0439[_0x6a7e('0x2c')]['limit']);_0x2723d0[_0x6a7e('0x1f')]=qs[_0x6a7e('0x1f')](_0x8b0439['query']['offset']);}_0x2723d0['order']=qs[_0x6a7e('0x36')](_0x8b0439['query']['sort']);_0x2723d0['where']=qs['filters'](_[_0x6a7e('0x37')](_0x8b0439['query'],_0x525376[_0x6a7e('0x2e')]),_0x57e642);if(_0x8b0439[_0x6a7e('0x2c')][_0x6a7e('0x38')]){_0x2723d0[_0x6a7e('0x39')]=_[_0x6a7e('0x3a')](_0x2723d0['where'],{'$or':_[_0x6a7e('0x2a')](_0x57e642,function(_0x1db4e3){if(_0x1db4e3['type']!==_0x6a7e('0x3b')){var _0x2f58ac={};_0x2f58ac[_0x1db4e3['name']]={'$like':'%'+_0x8b0439[_0x6a7e('0x2c')][_0x6a7e('0x38')]+'%'};return _0x2f58ac;}})});}_0x2723d0=_[_0x6a7e('0x3a')]({},_0x2723d0,_0x8b0439[_0x6a7e('0x3c')]);var _0x2827f7={'where':_0x2723d0[_0x6a7e('0x39')]};return db[_0x6a7e('0x3d')][_0x6a7e('0x1e')](_0x2827f7)[_0x6a7e('0x26')](function(_0x27434a){_0xa324d0[_0x6a7e('0x1e')]=_0x27434a;if(_0x8b0439['query']['includeAll']){_0x2723d0[_0x6a7e('0x3e')]=[{'all':!![]}];}return db[_0x6a7e('0x3d')]['findAll'](_0x2723d0);})[_0x6a7e('0x26')](function(_0x46799d){_0xa324d0[_0x6a7e('0x3f')]=_0x46799d;return _0xa324d0;})[_0x6a7e('0x26')](respondWithFilteredResult(_0x2e86f8,_0x2723d0))[_0x6a7e('0x40')](handleError(_0x2e86f8,null));};exports[_0x6a7e('0x41')]=function(_0x3d7266,_0x14cae5){var _0x2a3d31={'raw':!![],'where':{'id':_0x3d7266[_0x6a7e('0x42')]['id']}},_0x247efb={};_0x247efb[_0x6a7e('0x30')]=_[_0x6a7e('0x2d')](db[_0x6a7e('0x3d')]['rawAttributes']);_0x247efb['query']=_[_0x6a7e('0x2d')](_0x3d7266[_0x6a7e('0x2c')]);_0x247efb[_0x6a7e('0x2e')]=_[_0x6a7e('0x2f')](_0x247efb[_0x6a7e('0x30')],_0x247efb[_0x6a7e('0x2c')]);_0x2a3d31[_0x6a7e('0x31')]=_[_0x6a7e('0x2f')](_0x247efb['model'],qs[_0x6a7e('0x32')](_0x3d7266['query'][_0x6a7e('0x32')]));_0x2a3d31[_0x6a7e('0x31')]=_0x2a3d31[_0x6a7e('0x31')][_0x6a7e('0x33')]?_0x2a3d31['attributes']:_0x247efb[_0x6a7e('0x30')];if(_0x3d7266[_0x6a7e('0x2c')][_0x6a7e('0x43')]){_0x2a3d31['include']=[{'all':!![]}];}_0x2a3d31=_[_0x6a7e('0x3a')]({},_0x2a3d31,_0x3d7266['options']);return db[_0x6a7e('0x3d')][_0x6a7e('0x44')](_0x2a3d31)[_0x6a7e('0x26')](handleEntityNotFound(_0x14cae5,null))[_0x6a7e('0x26')](respondWithResult(_0x14cae5,null))['catch'](handleError(_0x14cae5,null));};exports[_0x6a7e('0x45')]=function(_0x47369f,_0x188ab5){return db[_0x6a7e('0x3d')]['create'](_0x47369f[_0x6a7e('0x46')],{})['then'](respondWithResult(_0x188ab5,0xc9))[_0x6a7e('0x40')](handleError(_0x188ab5,null));};exports[_0x6a7e('0x25')]=function(_0x25c2bb,_0x4a7465){if(_0x25c2bb[_0x6a7e('0x46')]['id']){delete _0x25c2bb['body']['id'];}return db[_0x6a7e('0x3d')]['find']({'where':{'id':_0x25c2bb[_0x6a7e('0x42')]['id']}})[_0x6a7e('0x26')](handleEntityNotFound(_0x4a7465,null))[_0x6a7e('0x26')](saveUpdates(_0x25c2bb[_0x6a7e('0x46')],null))[_0x6a7e('0x26')](respondWithResult(_0x4a7465,null))[_0x6a7e('0x40')](handleError(_0x4a7465,null));};exports['destroy']=function(_0x3d4395,_0x54f72b){return db[_0x6a7e('0x3d')][_0x6a7e('0x44')]({'where':{'id':_0x3d4395['params']['id']}})['then'](handleEntityNotFound(_0x54f72b,null))[_0x6a7e('0x26')](removeEntity(_0x54f72b,null))[_0x6a7e('0x40')](handleError(_0x54f72b,null));};exports[_0x6a7e('0x47')]=function(_0x251076,_0x43f5ac){return db['Cdr'][_0x6a7e('0x47')]()[_0x6a7e('0x26')](respondWithResult(_0x43f5ac,null))[_0x6a7e('0x40')](handleError(_0x43f5ac,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 7d4f414..9702a32 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(_0x43be21,_0x1ff5c3){var _0x3f2b73=function(_0x38a19b){while(--_0x38a19b){_0x43be21['push'](_0x43be21['shift']());}};_0x3f2b73(++_0x1ff5c3);}(_0x7a54,0x106));var _0x47a5=function(_0x2eb1b5,_0x58a0c6){_0x2eb1b5=_0x2eb1b5-0x0;var _0xd13d8d=_0x7a54[_0x2eb1b5];return _0xd13d8d;};'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(_0x2a41f6,_0xc91ac1){var _0x1c1810=function(_0x3c6881){while(--_0x3c6881){_0x2a41f6['push'](_0x2a41f6['shift']());}};_0x1c1810(++_0xc91ac1);}(_0x7a54,0x106));var _0x47a5=function(_0x49efe0,_0x6a06da){_0x49efe0=_0x49efe0-0x0;var _0x581142=_0x7a54[_0x49efe0];return _0x581142;};'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 8f796b9..02f6e9b 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 _0x5dbf=['lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','http','request','then','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','Cdr,\x20%s,\x20%s','message','result','catch'];(function(_0x5774ac,_0x379bc7){var _0x1924bd=function(_0x1bdedd){while(--_0x1bdedd){_0x5774ac['push'](_0x5774ac['shift']());}};_0x1924bd(++_0x379bc7);}(_0x5dbf,0x1ce));var _0xf5db=function(_0x12402c,_0x3a7f1c){_0x12402c=_0x12402c-0x0;var _0x1024b4=_0x5dbf[_0x12402c];return _0x1024b4;};'use strict';var _=require(_0xf5db('0x0'));var util=require(_0xf5db('0x1'));var moment=require('moment');var BPromise=require(_0xf5db('0x2'));var rs=require(_0xf5db('0x3'));var fs=require('fs');var Redis=require(_0xf5db('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf5db('0x5'));var logger=require('../../config/logger')(_0xf5db('0x6'));var config=require('../../config/environment');var jayson=require(_0xf5db('0x7'));var client=jayson['client'][_0xf5db('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3239f0,_0x125be7,_0x1b99ea){return new BPromise(function(_0x201d72,_0x4f3670){return client[_0xf5db('0x9')](_0x3239f0,_0x1b99ea)[_0xf5db('0xa')](function(_0x5a92af){logger[_0xf5db('0xb')]('Cdr,\x20%s,\x20%s',_0x125be7,_0xf5db('0xc'));logger[_0xf5db('0xd')](_0xf5db('0xe'),_0x125be7,_0xf5db('0xc'),JSON[_0xf5db('0xf')](_0x5a92af));if(_0x5a92af['error']){if(_0x5a92af[_0xf5db('0x10')][_0xf5db('0x11')]===0x1f4){logger['error'](_0xf5db('0x12'),_0x125be7,_0x5a92af['error'][_0xf5db('0x13')]);return _0x4f3670(_0x5a92af[_0xf5db('0x10')][_0xf5db('0x13')]);}logger['error'](_0xf5db('0x12'),_0x125be7,_0x5a92af[_0xf5db('0x10')][_0xf5db('0x13')]);return _0x201d72(_0x5a92af[_0xf5db('0x10')][_0xf5db('0x13')]);}else{logger[_0xf5db('0xb')](_0xf5db('0x12'),_0x125be7,_0xf5db('0xc'));_0x201d72(_0x5a92af[_0xf5db('0x14')]['message']);}})[_0xf5db('0x15')](function(_0x32220e){logger['error']('Cdr,\x20%s,\x20%s',_0x125be7,_0x32220e);_0x4f3670(_0x32220e);});});} \ No newline at end of file +var _0xbd0e=['rpc','jayson/promise','client','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3f5b33,_0x566062){var _0x4735bc=function(_0x296107){while(--_0x296107){_0x3f5b33['push'](_0x3f5b33['shift']());}};_0x4735bc(++_0x566062);}(_0xbd0e,0x13a));var _0xebd0=function(_0xd3da2a,_0x22241c){_0xd3da2a=_0xd3da2a-0x0;var _0x10ab61=_0xbd0e[_0xd3da2a];return _0x10ab61;};'use strict';var _=require(_0xebd0('0x0'));var util=require(_0xebd0('0x1'));var moment=require(_0xebd0('0x2'));var BPromise=require(_0xebd0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xebd0('0x4'));var db=require(_0xebd0('0x5'))['db'];var utils=require(_0xebd0('0x6'));var logger=require(_0xebd0('0x7'))(_0xebd0('0x8'));var config=require('../../config/environment');var jayson=require(_0xebd0('0x9'));var client=jayson[_0xebd0('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12779c,_0x381d3c,_0x320867){return new BPromise(function(_0x1c5704,_0x1908bb){return client[_0xebd0('0xb')](_0x12779c,_0x320867)[_0xebd0('0xc')](function(_0x48e593){logger[_0xebd0('0xd')](_0xebd0('0xe'),_0x381d3c,_0xebd0('0xf'));logger['debug'](_0xebd0('0x10'),_0x381d3c,_0xebd0('0xf'),JSON[_0xebd0('0x11')](_0x48e593));if(_0x48e593[_0xebd0('0x12')]){if(_0x48e593['error'][_0xebd0('0x13')]===0x1f4){logger['error']('Cdr,\x20%s,\x20%s',_0x381d3c,_0x48e593[_0xebd0('0x12')][_0xebd0('0x14')]);return _0x1908bb(_0x48e593[_0xebd0('0x12')][_0xebd0('0x14')]);}logger[_0xebd0('0x12')]('Cdr,\x20%s,\x20%s',_0x381d3c,_0x48e593[_0xebd0('0x12')][_0xebd0('0x14')]);return _0x1c5704(_0x48e593[_0xebd0('0x12')][_0xebd0('0x14')]);}else{logger[_0xebd0('0xd')](_0xebd0('0xe'),_0x381d3c,_0xebd0('0xf'));_0x1c5704(_0x48e593[_0xebd0('0x15')][_0xebd0('0x14')]);}})[_0xebd0('0x16')](function(_0x9a79fb){logger[_0xebd0('0x12')](_0xebd0('0xe'),_0x381d3c,_0x9a79fb);_0x1908bb(_0x9a79fb);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 77b3262..62e126e 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 _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(_0x18cac4,_0x57a4d5){var _0x2227c6=function(_0x72934d){while(--_0x72934d){_0x18cac4['push'](_0x18cac4['shift']());}};_0x2227c6(++_0x57a4d5);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'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 +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0xfbaa1b,_0x457818){var _0x54d340=function(_0x4021a6){while(--_0x4021a6){_0xfbaa1b['push'](_0xfbaa1b['shift']());}};_0x54d340(++_0x457818);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'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'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('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 8a8516c..2fa2407 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 _0x2941=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x2941,0xd4));var _0x1294=function(_0x12c7e3,_0x417a84){_0x12c7e3=_0x12c7e3-0x0;var _0x348f08=_0x2941[_0x12c7e3];return _0x348f08;};'use strict';var Sequelize=require(_0x1294('0x0'));module[_0x1294('0x1')]={'priority':{'type':Sequelize[_0x1294('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x1294('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x1294('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x1294('0x5')}}; \ No newline at end of file +var _0x3cd7=['STRING','noop','TEXT','*,*,*,*','sequelize','INTEGER'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3cd7,0x1cc));var _0x73cd=function(_0x346a3e,_0x3fc660){_0x346a3e=_0x346a3e-0x0;var _0x288dcf=_0x3cd7[_0x346a3e];return _0x288dcf;};'use strict';var Sequelize=require(_0x73cd('0x0'));module['exports']={'priority':{'type':Sequelize[_0x73cd('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x73cd('0x2')],'allowNull':![],'defaultValue':_0x73cd('0x3')},'appdata':{'type':Sequelize[_0x73cd('0x4')]()},'description':{'type':Sequelize[_0x73cd('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x73cd('0x5')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index e597fdd..8f010c7 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 _0xf323=['lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','limit','undefined','offset','count','set','Content-Range','json','reject','update','destroy','then','end','error','stack','name','show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','include','find','body','catch','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra'];(function(_0xcdfc4f,_0x8a111a){var _0x3f70d1=function(_0xc0f333){while(--_0xc0f333){_0xcdfc4f['push'](_0xcdfc4f['shift']());}};_0x3f70d1(++_0x8a111a);}(_0xf323,0x1c6));var _0x3f32=function(_0x283fe1,_0x27035c){_0x283fe1=_0x283fe1-0x0;var _0x52abe6=_0xf323[_0x283fe1];return _0x52abe6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3f32('0x0'));var jsonpatch=require(_0x3f32('0x1'));var rp=require('request-promise');var moment=require(_0x3f32('0x2'));var BPromise=require(_0x3f32('0x3'));var Mustache=require(_0x3f32('0x4'));var util=require(_0x3f32('0x5'));var path=require(_0x3f32('0x6'));var sox=require('sox');var csv=require(_0x3f32('0x7'));var ejs=require(_0x3f32('0x8'));var fs=require('fs');var fs_extra=require(_0x3f32('0x9'));var _=require(_0x3f32('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3f32('0xb'));var deskjs=require(_0x3f32('0xc'));var toCsv=require(_0x3f32('0x7'));var querystring=require(_0x3f32('0xd'));var Papa=require(_0x3f32('0xe'));var Redis=require(_0x3f32('0xf'));var authService=require(_0x3f32('0x10'));var qs=require(_0x3f32('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3f32('0x12'));var logger=require(_0x3f32('0x13'))(_0x3f32('0x14'));var utils=require('../../config/utils');var config=require(_0x3f32('0x15'));var licenseUtil=require(_0x3f32('0x16'));var db=require(_0x3f32('0x17'))['db'];function respondWithStatusCode(_0x2b1aa3,_0x5c876b){_0x5c876b=_0x5c876b||0xcc;return function(_0x4d7e41){if(_0x4d7e41){return _0x2b1aa3[_0x3f32('0x18')](_0x5c876b);}return _0x2b1aa3[_0x3f32('0x19')](_0x5c876b)['end']();};}function respondWithResult(_0x4097b4,_0x22b00){_0x22b00=_0x22b00||0xc8;return function(_0xc68dd5){if(_0xc68dd5){return _0x4097b4['status'](_0x22b00)['json'](_0xc68dd5);}};}function respondWithFilteredResult(_0x360b1b,_0x1de24c){return function(_0x1adaa5){if(_0x1adaa5){var _0x219d91=typeof _0x1de24c['offset']==='undefined'&&typeof _0x1de24c[_0x3f32('0x1a')]===_0x3f32('0x1b');var _0x3a8e7b=_0x1adaa5['count'];var _0x5c36d9=_0x219d91?0x0:_0x1de24c[_0x3f32('0x1c')];var _0x19ec90=_0x219d91?_0x1adaa5[_0x3f32('0x1d')]:_0x1de24c[_0x3f32('0x1c')]+_0x1de24c[_0x3f32('0x1a')];var _0x517e49;if(_0x19ec90>=_0x3a8e7b){_0x19ec90=_0x3a8e7b;_0x517e49=0xc8;}else{_0x517e49=0xce;}_0x360b1b[_0x3f32('0x19')](_0x517e49);return _0x360b1b[_0x3f32('0x1e')](_0x3f32('0x1f'),_0x5c36d9+'-'+_0x19ec90+'/'+_0x3a8e7b)[_0x3f32('0x20')](_0x1adaa5);}return null;};}function patchUpdates(_0xbc366b){return function(_0x2e698a){try{jsonpatch['apply'](_0x2e698a,_0xbc366b,!![]);}catch(_0x1e2d85){return BPromise[_0x3f32('0x21')](_0x1e2d85);}return _0x2e698a['save']();};}function saveUpdates(_0x1874e4,_0x21cf2e){return function(_0x3ddf25){if(_0x3ddf25){return _0x3ddf25[_0x3f32('0x22')](_0x1874e4)['then'](function(_0x1ea58b){return _0x1ea58b;});}return null;};}function removeEntity(_0x20f7d1,_0x4eb2ad){return function(_0x416015){if(_0x416015){return _0x416015[_0x3f32('0x23')]()[_0x3f32('0x24')](function(){_0x20f7d1[_0x3f32('0x19')](0xcc)[_0x3f32('0x25')]();});}};}function handleEntityNotFound(_0x11f4ab,_0x28bff4){return function(_0x38de66){if(!_0x38de66){_0x11f4ab[_0x3f32('0x18')](0x194);}return _0x38de66;};}function handleError(_0x3130de,_0x30ef37){_0x30ef37=_0x30ef37||0x1f4;return function(_0x5b5e9d){logger[_0x3f32('0x26')](_0x5b5e9d[_0x3f32('0x27')]);if(_0x5b5e9d['name']){delete _0x5b5e9d[_0x3f32('0x28')];}_0x3130de['status'](_0x30ef37)['send'](_0x5b5e9d);};}exports[_0x3f32('0x29')]=function(_0x785270,_0x1ee79e){var _0x320972={'raw':!![],'where':{'id':_0x785270[_0x3f32('0x2a')]['id']}},_0x20b333={};_0x20b333[_0x3f32('0x2b')]=_[_0x3f32('0x2c')](db[_0x3f32('0x2d')][_0x3f32('0x2e')]);_0x20b333[_0x3f32('0x2f')]=_['keys'](_0x785270[_0x3f32('0x2f')]);_0x20b333[_0x3f32('0x30')]=_[_0x3f32('0x31')](_0x20b333[_0x3f32('0x2b')],_0x20b333['query']);_0x320972['attributes']=_['intersection'](_0x20b333[_0x3f32('0x2b')],qs[_0x3f32('0x32')](_0x785270[_0x3f32('0x2f')][_0x3f32('0x32')]));_0x320972[_0x3f32('0x33')]=_0x320972[_0x3f32('0x33')][_0x3f32('0x34')]?_0x320972[_0x3f32('0x33')]:_0x20b333[_0x3f32('0x2b')];if(_0x785270['query'][_0x3f32('0x35')]){_0x320972[_0x3f32('0x36')]=[{'all':!![]}];}_0x320972=_['merge']({},_0x320972,_0x785270['options']);return db[_0x3f32('0x2d')][_0x3f32('0x37')](_0x320972)[_0x3f32('0x24')](handleEntityNotFound(_0x1ee79e,null))['then'](respondWithResult(_0x1ee79e,null))['catch'](handleError(_0x1ee79e,null));};exports[_0x3f32('0x22')]=function(_0x3d916e,_0x46e46c){if(_0x3d916e[_0x3f32('0x38')]['id']){delete _0x3d916e['body']['id'];}return db[_0x3f32('0x2d')]['find']({'where':{'id':_0x3d916e[_0x3f32('0x2a')]['id']}})[_0x3f32('0x24')](handleEntityNotFound(_0x46e46c,null))['then'](saveUpdates(_0x3d916e[_0x3f32('0x38')],null))[_0x3f32('0x24')](respondWithResult(_0x46e46c,null))[_0x3f32('0x39')](handleError(_0x46e46c,null));};exports[_0x3f32('0x23')]=function(_0x2d3ac0,_0x267bdc){return db[_0x3f32('0x2d')][_0x3f32('0x37')]({'where':{'id':_0x2d3ac0['params']['id']}})['then'](handleEntityNotFound(_0x267bdc,null))[_0x3f32('0x24')](removeEntity(_0x267bdc,null))[_0x3f32('0x39')](handleError(_0x267bdc,null));}; \ No newline at end of file +var _0x151b=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','offset','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','show','params','model','keys','ChatApplication','rawAttributes','query','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','body','eml-format','fast-json-patch','moment','bluebird','mustache','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x46800d,_0x588500){var _0x3824cd=function(_0x14b132){while(--_0x14b132){_0x46800d['push'](_0x46800d['shift']());}};_0x3824cd(++_0x588500);}(_0x151b,0x153));var _0xb151=function(_0x1738ea,_0x289df1){_0x1738ea=_0x1738ea-0x0;var _0xa9aa54=_0x151b[_0x1738ea];return _0xa9aa54;};'use strict';var emlformat=require(_0xb151('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb151('0x1'));var rp=require('request-promise');var moment=require(_0xb151('0x2'));var BPromise=require(_0xb151('0x3'));var Mustache=require(_0xb151('0x4'));var util=require('util');var path=require('path');var sox=require(_0xb151('0x5'));var csv=require(_0xb151('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb151('0x7'));var _=require('lodash');var squel=require(_0xb151('0x8'));var crypto=require(_0xb151('0x9'));var jsforce=require(_0xb151('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb151('0xb'));var Papa=require(_0xb151('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb151('0xd'));var as=require(_0xb151('0xe'));var hardwareService=require(_0xb151('0xf'));var logger=require(_0xb151('0x10'))(_0xb151('0x11'));var utils=require(_0xb151('0x12'));var config=require(_0xb151('0x13'));var licenseUtil=require(_0xb151('0x14'));var db=require(_0xb151('0x15'))['db'];function respondWithStatusCode(_0x143fbd,_0x4e54ca){_0x4e54ca=_0x4e54ca||0xcc;return function(_0x1ae9b4){if(_0x1ae9b4){return _0x143fbd['sendStatus'](_0x4e54ca);}return _0x143fbd[_0xb151('0x16')](_0x4e54ca)[_0xb151('0x17')]();};}function respondWithResult(_0x27f878,_0xfd071d){_0xfd071d=_0xfd071d||0xc8;return function(_0x4af767){if(_0x4af767){return _0x27f878[_0xb151('0x16')](_0xfd071d)[_0xb151('0x18')](_0x4af767);}};}function respondWithFilteredResult(_0x3df79d,_0x5b12e5){return function(_0x56ea81){if(_0x56ea81){var _0x5b2faa=typeof _0x5b12e5['offset']===_0xb151('0x19')&&typeof _0x5b12e5['limit']===_0xb151('0x19');var _0x4b21c0=_0x56ea81['count'];var _0x35aa2f=_0x5b2faa?0x0:_0x5b12e5[_0xb151('0x1a')];var _0x2ca10b=_0x5b2faa?_0x56ea81[_0xb151('0x1b')]:_0x5b12e5[_0xb151('0x1a')]+_0x5b12e5[_0xb151('0x1c')];var _0x1e2b38;if(_0x2ca10b>=_0x4b21c0){_0x2ca10b=_0x4b21c0;_0x1e2b38=0xc8;}else{_0x1e2b38=0xce;}_0x3df79d['status'](_0x1e2b38);return _0x3df79d[_0xb151('0x1d')](_0xb151('0x1e'),_0x35aa2f+'-'+_0x2ca10b+'/'+_0x4b21c0)['json'](_0x56ea81);}return null;};}function patchUpdates(_0x1fe113){return function(_0x22b1cd){try{jsonpatch[_0xb151('0x1f')](_0x22b1cd,_0x1fe113,!![]);}catch(_0x3a211a){return BPromise[_0xb151('0x20')](_0x3a211a);}return _0x22b1cd[_0xb151('0x21')]();};}function saveUpdates(_0x3f375d,_0x8ab45){return function(_0x49c2e){if(_0x49c2e){return _0x49c2e[_0xb151('0x22')](_0x3f375d)['then'](function(_0x432dce){return _0x432dce;});}return null;};}function removeEntity(_0x23cb48,_0x37768a){return function(_0x41c508){if(_0x41c508){return _0x41c508[_0xb151('0x23')]()[_0xb151('0x24')](function(){_0x23cb48[_0xb151('0x16')](0xcc)[_0xb151('0x17')]();});}};}function handleEntityNotFound(_0x31f1a7,_0x55689c){return function(_0x13b3dd){if(!_0x13b3dd){_0x31f1a7[_0xb151('0x25')](0x194);}return _0x13b3dd;};}function handleError(_0x16f493,_0x303479){_0x303479=_0x303479||0x1f4;return function(_0x2d65f8){logger[_0xb151('0x26')](_0x2d65f8[_0xb151('0x27')]);if(_0x2d65f8[_0xb151('0x28')]){delete _0x2d65f8['name'];}_0x16f493[_0xb151('0x16')](_0x303479)['send'](_0x2d65f8);};}exports[_0xb151('0x29')]=function(_0x32c933,_0x5e494c){var _0x1faf67={'raw':!![],'where':{'id':_0x32c933[_0xb151('0x2a')]['id']}},_0x495847={};_0x495847[_0xb151('0x2b')]=_[_0xb151('0x2c')](db[_0xb151('0x2d')][_0xb151('0x2e')]);_0x495847[_0xb151('0x2f')]=_[_0xb151('0x2c')](_0x32c933[_0xb151('0x2f')]);_0x495847['filters']=_[_0xb151('0x30')](_0x495847[_0xb151('0x2b')],_0x495847[_0xb151('0x2f')]);_0x1faf67[_0xb151('0x31')]=_[_0xb151('0x30')](_0x495847[_0xb151('0x2b')],qs[_0xb151('0x32')](_0x32c933['query'][_0xb151('0x32')]));_0x1faf67[_0xb151('0x31')]=_0x1faf67[_0xb151('0x31')][_0xb151('0x33')]?_0x1faf67[_0xb151('0x31')]:_0x495847['model'];if(_0x32c933['query'][_0xb151('0x34')]){_0x1faf67[_0xb151('0x35')]=[{'all':!![]}];}_0x1faf67=_[_0xb151('0x36')]({},_0x1faf67,_0x32c933[_0xb151('0x37')]);return db['ChatApplication'][_0xb151('0x38')](_0x1faf67)['then'](handleEntityNotFound(_0x5e494c,null))[_0xb151('0x24')](respondWithResult(_0x5e494c,null))[_0xb151('0x39')](handleError(_0x5e494c,null));};exports[_0xb151('0x22')]=function(_0x107d09,_0xb8be4f){if(_0x107d09[_0xb151('0x3a')]['id']){delete _0x107d09[_0xb151('0x3a')]['id'];}return db[_0xb151('0x2d')][_0xb151('0x38')]({'where':{'id':_0x107d09[_0xb151('0x2a')]['id']}})[_0xb151('0x24')](handleEntityNotFound(_0xb8be4f,null))['then'](saveUpdates(_0x107d09[_0xb151('0x3a')],null))[_0xb151('0x24')](respondWithResult(_0xb8be4f,null))[_0xb151('0x39')](handleError(_0xb8be4f,null));};exports['destroy']=function(_0x233633,_0x2f9f48){return db[_0xb151('0x2d')][_0xb151('0x38')]({'where':{'id':_0x233633[_0xb151('0x2a')]['id']}})[_0xb151('0x24')](handleEntityNotFound(_0x2f9f48,null))[_0xb151('0x24')](removeEntity(_0x2f9f48,null))[_0xb151('0x39')](handleError(_0x2f9f48,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 1b4066d..1ce0709 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 _0x319c=['../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x319c,0x1d9));var _0xc319=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x319c[_0x40220a];return _0x3903cc;};'use strict';var _=require(_0xc319('0x0'));var util=require('util');var logger=require(_0xc319('0x1'))(_0xc319('0x2'));var moment=require(_0xc319('0x3'));var BPromise=require('bluebird');var rp=require(_0xc319('0x4'));var fs=require('fs');var path=require(_0xc319('0x5'));var rimraf=require(_0xc319('0x6'));var config=require(_0xc319('0x7'));var attributes=require(_0xc319('0x8'));module[_0xc319('0x9')]=function(_0xd892a7,_0x1c6cc6){return _0xd892a7[_0xc319('0xa')](_0xc319('0xb'),attributes,{'tableName':_0xc319('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc319('0xd'),'collate':_0xc319('0xe')});}; \ No newline at end of file +var _0x6ec9=['exports','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment'];(function(_0xcc8cd,_0x2ad3f1){var _0x37f239=function(_0x15a372){while(--_0x15a372){_0xcc8cd['push'](_0xcc8cd['shift']());}};_0x37f239(++_0x2ad3f1);}(_0x6ec9,0x174));var _0x96ec=function(_0x59406f,_0x2cd95c){_0x59406f=_0x59406f-0x0;var _0x28a6fc=_0x6ec9[_0x59406f];return _0x28a6fc;};'use strict';var _=require(_0x96ec('0x0'));var util=require('util');var logger=require(_0x96ec('0x1'))('api');var moment=require(_0x96ec('0x2'));var BPromise=require('bluebird');var rp=require(_0x96ec('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x96ec('0x4'));var config=require(_0x96ec('0x5'));var attributes=require('./chatApplication.attributes');module[_0x96ec('0x6')]=function(_0x41a215,_0x2fcbb7){return _0x41a215['define']('ChatApplication',attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x96ec('0x7'),'collate':_0x96ec('0x8')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 08cb3e2..0a08373 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 _0xec1c=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','http','request','then','ChatApplication,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message'];(function(_0x49dfa7,_0x2f8a4f){var _0x4a8367=function(_0x573077){while(--_0x573077){_0x49dfa7['push'](_0x49dfa7['shift']());}};_0x4a8367(++_0x2f8a4f);}(_0xec1c,0x1ce));var _0xcec1=function(_0x4e0157,_0x147213){_0x4e0157=_0x4e0157-0x0;var _0x13a010=_0xec1c[_0x4e0157];return _0x13a010;};'use strict';var _=require(_0xcec1('0x0'));var util=require('util');var moment=require(_0xcec1('0x1'));var BPromise=require(_0xcec1('0x2'));var rs=require(_0xcec1('0x3'));var fs=require('fs');var Redis=require(_0xcec1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xcec1('0x5'));var logger=require('../../config/logger')(_0xcec1('0x6'));var config=require('../../config/environment');var jayson=require(_0xcec1('0x7'));var client=jayson['client'][_0xcec1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x404c59,_0x1e7a53,_0xc5d77d){return new BPromise(function(_0x330196,_0xbd57bf){return client[_0xcec1('0x9')](_0x404c59,_0xc5d77d)[_0xcec1('0xa')](function(_0x3991e9){logger['info'](_0xcec1('0xb'),_0x1e7a53,'request\x20sent');logger[_0xcec1('0xc')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x1e7a53,_0xcec1('0xd'),JSON[_0xcec1('0xe')](_0x3991e9));if(_0x3991e9[_0xcec1('0xf')]){if(_0x3991e9[_0xcec1('0xf')][_0xcec1('0x10')]===0x1f4){logger[_0xcec1('0xf')](_0xcec1('0xb'),_0x1e7a53,_0x3991e9['error'][_0xcec1('0x11')]);return _0xbd57bf(_0x3991e9[_0xcec1('0xf')][_0xcec1('0x11')]);}logger[_0xcec1('0xf')](_0xcec1('0xb'),_0x1e7a53,_0x3991e9['error'][_0xcec1('0x11')]);return _0x330196(_0x3991e9[_0xcec1('0xf')]['message']);}else{logger['info']('ChatApplication,\x20%s,\x20%s',_0x1e7a53,_0xcec1('0xd'));_0x330196(_0x3991e9[_0xcec1('0x12')][_0xcec1('0x11')]);}})[_0xcec1('0x13')](function(_0x3377e7){logger[_0xcec1('0xf')](_0xcec1('0xb'),_0x1e7a53,_0x3377e7);_0xbd57bf(_0x3377e7);});});} \ No newline at end of file +var _0x488b=['ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatApplication,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x49e308,_0x1c2714){var _0x1c7057=function(_0x3f0c8d){while(--_0x3f0c8d){_0x49e308['push'](_0x49e308['shift']());}};_0x1c7057(++_0x1c2714);}(_0x488b,0xb6));var _0xb488=function(_0x480887,_0x35fc6f){_0x480887=_0x480887-0x0;var _0x4a223b=_0x488b[_0x480887];return _0x4a223b;};'use strict';var _=require(_0xb488('0x0'));var util=require(_0xb488('0x1'));var moment=require(_0xb488('0x2'));var BPromise=require(_0xb488('0x3'));var rs=require(_0xb488('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb488('0x5'))['db'];var utils=require(_0xb488('0x6'));var logger=require(_0xb488('0x7'))(_0xb488('0x8'));var config=require(_0xb488('0x9'));var jayson=require(_0xb488('0xa'));var client=jayson[_0xb488('0xb')][_0xb488('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x25d0f2,_0x29454f,_0x35f643){return new BPromise(function(_0x4e2763,_0x1f75e5){return client[_0xb488('0xd')](_0x25d0f2,_0x35f643)[_0xb488('0xe')](function(_0x3cfa80){logger['info'](_0xb488('0xf'),_0x29454f,_0xb488('0x10'));logger[_0xb488('0x11')](_0xb488('0x12'),_0x29454f,'request\x20sent',JSON[_0xb488('0x13')](_0x3cfa80));if(_0x3cfa80[_0xb488('0x14')]){if(_0x3cfa80['error'][_0xb488('0x15')]===0x1f4){logger[_0xb488('0x14')](_0xb488('0xf'),_0x29454f,_0x3cfa80[_0xb488('0x14')][_0xb488('0x16')]);return _0x1f75e5(_0x3cfa80[_0xb488('0x14')][_0xb488('0x16')]);}logger[_0xb488('0x14')](_0xb488('0xf'),_0x29454f,_0x3cfa80[_0xb488('0x14')][_0xb488('0x16')]);return _0x4e2763(_0x3cfa80[_0xb488('0x14')][_0xb488('0x16')]);}else{logger[_0xb488('0x17')](_0xb488('0xf'),_0x29454f,'request\x20sent');_0x4e2763(_0x3cfa80['result'][_0xb488('0x16')]);}})[_0xb488('0x18')](function(_0x3e1e57){logger[_0xb488('0x14')](_0xb488('0xf'),_0x29454f,_0x3e1e57);_0x1f75e5(_0x3e1e57);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 462c769..537c168 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 _0x966f=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','/:id','isAuthenticated','show','put','update','delete','multer','util','path'];(function(_0x1a124d,_0x3e04b0){var _0x5f0830=function(_0x1e0ce3){while(--_0x1e0ce3){_0x1a124d['push'](_0x1a124d['shift']());}};_0x5f0830(++_0x3e04b0);}(_0x966f,0x140));var _0xf966=function(_0x3f7f3d,_0x59f4e8){_0x3f7f3d=_0x3f7f3d-0x0;var _0x1c336d=_0x966f[_0x3f7f3d];return _0x1c336d;};'use strict';var multer=require(_0xf966('0x0'));var util=require(_0xf966('0x1'));var path=require(_0xf966('0x2'));var timeout=require(_0xf966('0x3'));var express=require(_0xf966('0x4'));var router=express[_0xf966('0x5')]();var fs_extra=require(_0xf966('0x6'));var auth=require(_0xf966('0x7'));var interaction=require(_0xf966('0x8'));var config=require(_0xf966('0x9'));var controller=require(_0xf966('0xa'));router['get'](_0xf966('0xb'),auth[_0xf966('0xc')](),controller[_0xf966('0xd')]);router[_0xf966('0xe')](_0xf966('0xb'),auth[_0xf966('0xc')](),controller[_0xf966('0xf')]);router[_0xf966('0x10')](_0xf966('0xb'),auth[_0xf966('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xac23=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','isAuthenticated','show','put','update','delete','/:id','destroy','multer','util','path','connect-timeout'];(function(_0x5f207f,_0x5bd992){var _0x3dc234=function(_0x5d6e39){while(--_0x5d6e39){_0x5f207f['push'](_0x5f207f['shift']());}};_0x3dc234(++_0x5bd992);}(_0xac23,0xc2));var _0x3ac2=function(_0x842f30,_0x5a3981){_0x842f30=_0x842f30-0x0;var _0x24caa8=_0xac23[_0x842f30];return _0x24caa8;};'use strict';var multer=require(_0x3ac2('0x0'));var util=require(_0x3ac2('0x1'));var path=require(_0x3ac2('0x2'));var timeout=require(_0x3ac2('0x3'));var express=require('express');var router=express[_0x3ac2('0x4')]();var fs_extra=require(_0x3ac2('0x5'));var auth=require(_0x3ac2('0x6'));var interaction=require(_0x3ac2('0x7'));var config=require(_0x3ac2('0x8'));var controller=require(_0x3ac2('0x9'));router[_0x3ac2('0xa')]('/:id',auth[_0x3ac2('0xb')](),controller[_0x3ac2('0xc')]);router[_0x3ac2('0xd')]('/:id',auth[_0x3ac2('0xb')](),controller[_0x3ac2('0xe')]);router[_0x3ac2('0xf')](_0x3ac2('0x10'),auth[_0x3ac2('0xb')](),controller[_0x3ac2('0x11')]);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 ca91a26..47b5419 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 _0xb7ac=['STRING','BOOLEAN','sequelize','exports'];(function(_0x493720,_0x2e7724){var _0x3cfc8e=function(_0x1ceb74){while(--_0x1ceb74){_0x493720['push'](_0x493720['shift']());}};_0x3cfc8e(++_0x2e7724);}(_0xb7ac,0x18a));var _0xcb7a=function(_0x4046c6,_0x2e0a29){_0x4046c6=_0x4046c6-0x0;var _0x33eb3c=_0xb7ac[_0x4046c6];return _0x33eb3c;};'use strict';var Sequelize=require(_0xcb7a('0x0'));module[_0xcb7a('0x1')]={'name':{'type':Sequelize[_0xcb7a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xcb7a('0x2')]},'write':{'type':Sequelize[_0xcb7a('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x29bb=['STRING','BOOLEAN','exports'];(function(_0x1ea5ee,_0xfd637d){var _0xf57c97=function(_0x1f193e){while(--_0x1f193e){_0x1ea5ee['push'](_0x1ea5ee['shift']());}};_0xf57c97(++_0xfd637d);}(_0x29bb,0x13d));var _0xb29b=function(_0x36f476,_0x33e458){_0x36f476=_0x36f476-0x0;var _0x40114a=_0x29bb[_0x36f476];return _0x40114a;};'use strict';var Sequelize=require('sequelize');module[_0xb29b('0x0')]={'name':{'type':Sequelize[_0xb29b('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xb29b('0x1')]},'write':{'type':Sequelize[_0xb29b('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 11d37fe..1489b62 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 _0xf9ef=['save','update','then','destroy','error','stack','name','index','map','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','ChatGroup','catch','show','params','rawAttributes','create','body','find','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','findOne','getMembers','removeMembers','addMessage','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','zip-dir','fast-json-patch','moment','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','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject'];(function(_0x36bfe3,_0x358938){var _0x9b0436=function(_0x86e47d){while(--_0x86e47d){_0x36bfe3['push'](_0x36bfe3['shift']());}};_0x9b0436(++_0x358938);}(_0xf9ef,0x94));var _0xff9e=function(_0x25ce29,_0x55f38b){_0x25ce29=_0x25ce29-0x0;var _0x2b4527=_0xf9ef[_0x25ce29];return _0x2b4527;};'use strict';var emlformat=require(_0xff9e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xff9e('0x1'));var jsonpatch=require(_0xff9e('0x2'));var rp=require('request-promise');var moment=require(_0xff9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xff9e('0x4'));var util=require(_0xff9e('0x5'));var path=require(_0xff9e('0x6'));var sox=require(_0xff9e('0x7'));var csv=require(_0xff9e('0x8'));var ejs=require(_0xff9e('0x9'));var fs=require('fs');var fs_extra=require(_0xff9e('0xa'));var _=require(_0xff9e('0xb'));var squel=require(_0xff9e('0xc'));var crypto=require(_0xff9e('0xd'));var jsforce=require(_0xff9e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xff9e('0x8'));var querystring=require(_0xff9e('0xf'));var Papa=require(_0xff9e('0x10'));var Redis=require(_0xff9e('0x11'));var authService=require(_0xff9e('0x12'));var qs=require(_0xff9e('0x13'));var as=require(_0xff9e('0x14'));var hardwareService=require(_0xff9e('0x15'));var logger=require(_0xff9e('0x16'))(_0xff9e('0x17'));var utils=require(_0xff9e('0x18'));var config=require(_0xff9e('0x19'));var licenseUtil=require(_0xff9e('0x1a'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xff9e('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xff9e('0x1c'))(new Redis(config[_0xff9e('0x1b')]));require('./chatGroup.socket')[_0xff9e('0x1d')](socket);function respondWithStatusCode(_0x4c2b53,_0x546cb0){_0x546cb0=_0x546cb0||0xcc;return function(_0x3df477){if(_0x3df477){return _0x4c2b53[_0xff9e('0x1e')](_0x546cb0);}return _0x4c2b53[_0xff9e('0x1f')](_0x546cb0)[_0xff9e('0x20')]();};}function respondWithResult(_0x5dda80,_0x54953a){_0x54953a=_0x54953a||0xc8;return function(_0x389f1f){if(_0x389f1f){return _0x5dda80[_0xff9e('0x1f')](_0x54953a)['json'](_0x389f1f);}};}function respondWithFilteredResult(_0x10d509,_0xb1dc94){return function(_0x4e6a95){if(_0x4e6a95){var _0x48cca8=typeof _0xb1dc94[_0xff9e('0x21')]===_0xff9e('0x22')&&typeof _0xb1dc94[_0xff9e('0x23')]===_0xff9e('0x22');var _0x29cfbb=_0x4e6a95[_0xff9e('0x24')];var _0x2ac11e=_0x48cca8?0x0:_0xb1dc94['offset'];var _0x268e28=_0x48cca8?_0x4e6a95['count']:_0xb1dc94[_0xff9e('0x21')]+_0xb1dc94[_0xff9e('0x23')];var _0x466c09;if(_0x268e28>=_0x29cfbb){_0x268e28=_0x29cfbb;_0x466c09=0xc8;}else{_0x466c09=0xce;}_0x10d509[_0xff9e('0x1f')](_0x466c09);return _0x10d509['set'](_0xff9e('0x25'),_0x2ac11e+'-'+_0x268e28+'/'+_0x29cfbb)['json'](_0x4e6a95);}return null;};}function patchUpdates(_0x5e18a0){return function(_0x1ec528){try{jsonpatch[_0xff9e('0x26')](_0x1ec528,_0x5e18a0,!![]);}catch(_0x3d676d){return BPromise[_0xff9e('0x27')](_0x3d676d);}return _0x1ec528[_0xff9e('0x28')]();};}function saveUpdates(_0x2a1353,_0x142d99){return function(_0x383663){if(_0x383663){return _0x383663[_0xff9e('0x29')](_0x2a1353)[_0xff9e('0x2a')](function(_0x37ec4d){return _0x37ec4d;});}return null;};}function removeEntity(_0x4d89d9,_0x466ca0){return function(_0x141694){if(_0x141694){return _0x141694[_0xff9e('0x2b')]()[_0xff9e('0x2a')](function(){_0x4d89d9[_0xff9e('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30e875,_0x36d088){return function(_0x45906f){if(!_0x45906f){_0x30e875['sendStatus'](0x194);}return _0x45906f;};}function handleError(_0x5d5c69,_0x209b7d){_0x209b7d=_0x209b7d||0x1f4;return function(_0x35b388){logger[_0xff9e('0x2c')](_0x35b388[_0xff9e('0x2d')]);if(_0x35b388[_0xff9e('0x2e')]){delete _0x35b388['name'];}_0x5d5c69[_0xff9e('0x1f')](_0x209b7d)['send'](_0x35b388);};}exports[_0xff9e('0x2f')]=function(_0x526e30,_0x1e8865){var _0x3abe4a={},_0xa0cb68={},_0x1ea1ad={'count':0x0,'rows':[]};var _0x1576fb=_[_0xff9e('0x30')](db['ChatGroup']['rawAttributes'],function(_0x1a8987){return{'name':_0x1a8987[_0xff9e('0x31')],'type':_0x1a8987[_0xff9e('0x32')][_0xff9e('0x33')]};});_0xa0cb68[_0xff9e('0x34')]=_[_0xff9e('0x30')](_0x1576fb,_0xff9e('0x2e'));_0xa0cb68['query']=_[_0xff9e('0x35')](_0x526e30[_0xff9e('0x36')]);_0xa0cb68[_0xff9e('0x37')]=_[_0xff9e('0x38')](_0xa0cb68[_0xff9e('0x34')],_0xa0cb68[_0xff9e('0x36')]);_0x3abe4a[_0xff9e('0x39')]=_[_0xff9e('0x38')](_0xa0cb68['model'],qs[_0xff9e('0x3a')](_0x526e30[_0xff9e('0x36')][_0xff9e('0x3a')]));_0x3abe4a[_0xff9e('0x39')]=_0x3abe4a['attributes'][_0xff9e('0x3b')]?_0x3abe4a['attributes']:_0xa0cb68[_0xff9e('0x34')];if(!_0x526e30[_0xff9e('0x36')][_0xff9e('0x3c')](_0xff9e('0x3d'))){_0x3abe4a[_0xff9e('0x23')]=qs[_0xff9e('0x23')](_0x526e30[_0xff9e('0x36')][_0xff9e('0x23')]);_0x3abe4a['offset']=qs[_0xff9e('0x21')](_0x526e30[_0xff9e('0x36')]['offset']);}_0x3abe4a[_0xff9e('0x3e')]=qs[_0xff9e('0x3f')](_0x526e30[_0xff9e('0x36')][_0xff9e('0x3f')]);_0x3abe4a[_0xff9e('0x40')]=qs[_0xff9e('0x37')](_[_0xff9e('0x41')](_0x526e30['query'],_0xa0cb68['filters']),_0x1576fb);if(_0x526e30[_0xff9e('0x36')][_0xff9e('0x42')]){_0x3abe4a[_0xff9e('0x40')]=_['merge'](_0x3abe4a[_0xff9e('0x40')],{'$or':_[_0xff9e('0x30')](_0x1576fb,function(_0x4a3e0a){if(_0x4a3e0a['type']!==_0xff9e('0x43')){var _0x442ac7={};_0x442ac7[_0x4a3e0a[_0xff9e('0x2e')]]={'$like':'%'+_0x526e30['query'][_0xff9e('0x42')]+'%'};return _0x442ac7;}})});}_0x3abe4a=_[_0xff9e('0x44')]({},_0x3abe4a,_0x526e30[_0xff9e('0x45')]);var _0x305d57={'where':_0x3abe4a[_0xff9e('0x40')]};return db[_0xff9e('0x46')][_0xff9e('0x24')](_0x305d57)[_0xff9e('0x2a')](function(_0xe22bd8){_0x1ea1ad[_0xff9e('0x24')]=_0xe22bd8;if(_0x526e30[_0xff9e('0x36')]['includeAll']){_0x3abe4a['include']=[{'all':!![]}];}return db['ChatGroup']['findAll'](_0x3abe4a);})[_0xff9e('0x2a')](function(_0x3e82f2){_0x1ea1ad['rows']=_0x3e82f2;return _0x1ea1ad;})['then'](respondWithFilteredResult(_0x1e8865,_0x3abe4a))[_0xff9e('0x47')](handleError(_0x1e8865,null));};exports[_0xff9e('0x48')]=function(_0x2f072c,_0x57ae06){var _0x264b72={'raw':!![],'where':{'id':_0x2f072c[_0xff9e('0x49')]['id']}},_0x4d31a4={};_0x4d31a4['model']=_[_0xff9e('0x35')](db[_0xff9e('0x46')][_0xff9e('0x4a')]);_0x4d31a4['query']=_[_0xff9e('0x35')](_0x2f072c[_0xff9e('0x36')]);_0x4d31a4[_0xff9e('0x37')]=_[_0xff9e('0x38')](_0x4d31a4[_0xff9e('0x34')],_0x4d31a4['query']);_0x264b72[_0xff9e('0x39')]=_['intersection'](_0x4d31a4[_0xff9e('0x34')],qs['fields'](_0x2f072c[_0xff9e('0x36')][_0xff9e('0x3a')]));_0x264b72['attributes']=_0x264b72[_0xff9e('0x39')]['length']?_0x264b72[_0xff9e('0x39')]:_0x4d31a4[_0xff9e('0x34')];if(_0x2f072c[_0xff9e('0x36')]['includeAll']){_0x264b72['include']=[{'all':!![]}];}_0x264b72=_['merge']({},_0x264b72,_0x2f072c['options']);return db[_0xff9e('0x46')]['find'](_0x264b72)[_0xff9e('0x2a')](handleEntityNotFound(_0x57ae06,null))['then'](respondWithResult(_0x57ae06,null))[_0xff9e('0x47')](handleError(_0x57ae06,null));};exports[_0xff9e('0x4b')]=function(_0x2e7c97,_0x14a926){return db[_0xff9e('0x46')]['create'](_0x2e7c97[_0xff9e('0x4c')],{})['then'](respondWithResult(_0x14a926,0xc9))['catch'](handleError(_0x14a926,null));};exports[_0xff9e('0x29')]=function(_0x55f35b,_0x2921d4){if(_0x55f35b['body']['id']){delete _0x55f35b[_0xff9e('0x4c')]['id'];}return db[_0xff9e('0x46')][_0xff9e('0x4d')]({'where':{'id':_0x55f35b[_0xff9e('0x49')]['id']}})[_0xff9e('0x2a')](handleEntityNotFound(_0x2921d4,null))['then'](saveUpdates(_0x55f35b[_0xff9e('0x4c')],null))[_0xff9e('0x2a')](respondWithResult(_0x2921d4,null))[_0xff9e('0x47')](handleError(_0x2921d4,null));};exports[_0xff9e('0x2b')]=function(_0x101ecf,_0x347ba){return db['ChatGroup'][_0xff9e('0x4d')]({'where':{'id':_0x101ecf[_0xff9e('0x49')]['id']}})[_0xff9e('0x2a')](handleEntityNotFound(_0x347ba,null))[_0xff9e('0x2a')](removeEntity(_0x347ba,null))['catch'](handleError(_0x347ba,null));};exports[_0xff9e('0x4e')]=function(_0x10fa97,_0x16fc63){return db[_0xff9e('0x46')]['describe']()[_0xff9e('0x2a')](respondWithResult(_0x16fc63,null))[_0xff9e('0x47')](handleError(_0x16fc63,null));};exports[_0xff9e('0x4f')]=function(_0x408e79,_0x5571f5,_0x37fe56){return db[_0xff9e('0x50')][_0xff9e('0x24')]({'where':{'ChatGroupId':_0x408e79['params']['id'],'ToId':_0x408e79[_0xff9e('0x51')]['id'],'read':![]}})[_0xff9e('0x2a')](function(_0x5d5ee2){return{'id':_[_0xff9e('0x52')](_0x408e79[_0xff9e('0x49')]['id']),'count':_0x5d5ee2};})[_0xff9e('0x2a')](respondWithResult(_0x5571f5,null))[_0xff9e('0x47')](handleError(_0x5571f5,null));};exports[_0xff9e('0x53')]=function(_0x154cf2,_0x4920ca,_0x25a3a5){return db[_0xff9e('0x46')]['find']({'where':{'id':_0x154cf2[_0xff9e('0x49')]['id']}})[_0xff9e('0x2a')](handleEntityNotFound(_0x4920ca,null))[_0xff9e('0x2a')](function(_0x4aee09){if(_0x4aee09){return _0x4aee09[_0xff9e('0x53')](_0x154cf2['body'][_0xff9e('0x54')],_[_0xff9e('0x55')](_0x154cf2[_0xff9e('0x4c')],['ids','id'])||{});}})[_0xff9e('0x2a')](respondWithResult(_0x4920ca,null))[_0xff9e('0x47')](handleError(_0x4920ca,null));};exports['getMembers']=function(_0x21014d,_0x429fee,_0x1f10a0){var _0x5357ac={};var _0x1782a7={};var _0x5db02f;var _0x2c4db6;return db[_0xff9e('0x46')][_0xff9e('0x56')]({'where':{'id':_0x21014d[_0xff9e('0x49')]['id']}})['then'](handleEntityNotFound(_0x429fee,null))['then'](function(_0x5428ea){if(_0x5428ea){_0x5db02f=_0x5428ea;_0x1782a7[_0xff9e('0x34')]=_[_0xff9e('0x35')](db['User'][_0xff9e('0x4a')]);_0x1782a7[_0xff9e('0x36')]=_['keys'](_0x21014d['query']);_0x1782a7[_0xff9e('0x37')]=_[_0xff9e('0x38')](_0x1782a7[_0xff9e('0x34')],_0x1782a7[_0xff9e('0x36')]);_0x5357ac[_0xff9e('0x39')]=_[_0xff9e('0x38')](_0x1782a7['model'],qs['fields'](_0x21014d[_0xff9e('0x36')][_0xff9e('0x3a')]));_0x5357ac['attributes']=_0x5357ac['attributes'][_0xff9e('0x3b')]?_0x5357ac[_0xff9e('0x39')]:_0x1782a7['model'];_0x5357ac[_0xff9e('0x3e')]=qs[_0xff9e('0x3f')](_0x21014d[_0xff9e('0x36')][_0xff9e('0x3f')]);_0x5357ac[_0xff9e('0x40')]=qs[_0xff9e('0x37')](_[_0xff9e('0x41')](_0x21014d['query'],_0x1782a7['filters']));if(_0x21014d['query']['filter']){_0x5357ac[_0xff9e('0x40')]=_[_0xff9e('0x44')](_0x5357ac[_0xff9e('0x40')],{'$or':_[_0xff9e('0x30')](_0x5357ac[_0xff9e('0x39')],function(_0x92fb0b){var _0x12e466={};_0x12e466[_0x92fb0b]={'$like':'%'+_0x21014d[_0xff9e('0x36')][_0xff9e('0x42')]+'%'};return _0x12e466;})});}_0x5357ac=_[_0xff9e('0x44')]({},_0x5357ac,_0x21014d[_0xff9e('0x45')]);return _0x5db02f['getMembers'](_0x5357ac);}})[_0xff9e('0x2a')](function(_0x2a488b){if(_0x2a488b){_0x2c4db6=_0x2a488b[_0xff9e('0x3b')];if(!_0x21014d['query']['hasOwnProperty'](_0xff9e('0x3d'))){_0x5357ac[_0xff9e('0x23')]=qs['limit'](_0x21014d[_0xff9e('0x36')][_0xff9e('0x23')]);_0x5357ac['offset']=qs['offset'](_0x21014d['query'][_0xff9e('0x21')]);}return _0x5db02f[_0xff9e('0x57')](_0x5357ac);}})[_0xff9e('0x2a')](function(_0x4ba66d){if(_0x4ba66d){return _0x4ba66d?{'count':_0x2c4db6,'rows':_0x4ba66d}:null;}})[_0xff9e('0x2a')](respondWithResult(_0x429fee,null))[_0xff9e('0x47')](handleError(_0x429fee,null));};exports['removeMembers']=function(_0x2c2ff9,_0x29935e,_0x37baec){return db[_0xff9e('0x46')]['find']({'where':{'id':_0x2c2ff9[_0xff9e('0x49')]['id']}})[_0xff9e('0x2a')](handleEntityNotFound(_0x29935e,null))[_0xff9e('0x2a')](function(_0x5315d6){if(_0x5315d6){return _0x5315d6[_0xff9e('0x58')](_0x2c2ff9[_0xff9e('0x36')]['ids']);}})[_0xff9e('0x2a')](respondWithStatusCode(_0x29935e,null))[_0xff9e('0x47')](handleError(_0x29935e,null));};exports[_0xff9e('0x59')]=function(_0x3b9f70,_0x3669f0,_0x1242fb){if(_0x3b9f70[_0xff9e('0x4c')]['id']){delete _0x3b9f70['body']['id'];}return db['ChatGroup'][_0xff9e('0x4d')]({'where':{'id':_0x3b9f70[_0xff9e('0x49')]['id']}})[_0xff9e('0x2a')](handleEntityNotFound(_0x3669f0,null))[_0xff9e('0x2a')](function(_0x1994bd){if(_0x1994bd){_0x3b9f70[_0xff9e('0x4c')]['ChatGroupId']=_0x1994bd['id'];return db[_0xff9e('0x50')][_0xff9e('0x4b')](_0x3b9f70['body']);}})[_0xff9e('0x2a')](respondWithResult(_0x3669f0,null))['catch'](handleError(_0x3669f0,null));};exports[_0xff9e('0x5a')]=function(_0xca8a06,_0x39bed9,_0x3b1f97){var _0x4f3fab={};var _0x34e985={};var _0x3fe234;var _0x4074f2;return db[_0xff9e('0x46')][_0xff9e('0x56')]({'where':{'id':_0xca8a06[_0xff9e('0x49')]['id']}})[_0xff9e('0x2a')](handleEntityNotFound(_0x39bed9,null))[_0xff9e('0x2a')](function(_0x63f0e5){if(_0x63f0e5){_0x3fe234=_0x63f0e5;_0x34e985[_0xff9e('0x34')]=_[_0xff9e('0x35')](db['ChatInternalMessage']['rawAttributes']);_0x34e985[_0xff9e('0x36')]=_['keys'](_0xca8a06['query']);_0x34e985['filters']=_[_0xff9e('0x38')](_0x34e985[_0xff9e('0x34')],_0x34e985[_0xff9e('0x36')]);_0x4f3fab[_0xff9e('0x39')]=_[_0xff9e('0x38')](_0x34e985['model'],qs['fields'](_0xca8a06[_0xff9e('0x36')][_0xff9e('0x3a')]));_0x4f3fab[_0xff9e('0x39')]=_0x4f3fab['attributes'][_0xff9e('0x3b')]?_0x4f3fab[_0xff9e('0x39')]:_0x34e985[_0xff9e('0x34')];_0x4f3fab[_0xff9e('0x3e')]=qs[_0xff9e('0x3f')](_0xca8a06[_0xff9e('0x36')]['sort']);_0x4f3fab['where']=qs[_0xff9e('0x37')](_[_0xff9e('0x41')](_0xca8a06['query'],_0x34e985['filters']));if(_0xca8a06[_0xff9e('0x36')][_0xff9e('0x42')]){_0x4f3fab[_0xff9e('0x40')]=_[_0xff9e('0x44')](_0x4f3fab['where'],{'$or':_[_0xff9e('0x30')](_0x4f3fab[_0xff9e('0x39')],function(_0x3e14e1){var _0xb205d7={};_0xb205d7[_0x3e14e1]={'$like':'%'+_0xca8a06[_0xff9e('0x36')][_0xff9e('0x42')]+'%'};return _0xb205d7;})});}if(_0xca8a06[_0xff9e('0x36')][_0xff9e('0x5b')]){var _0x33c636=_0xca8a06[_0xff9e('0x36')][_0xff9e('0x5b')]['split'](',');var _0x359d40={};_0x359d40[_0x33c636[0x0]]={'$gte':moment(_0x33c636[0x1])[_0xff9e('0x5c')](_0xff9e('0x5d'))};_0x4f3fab[_0xff9e('0x40')]=_['merge'](_0x4f3fab[_0xff9e('0x40')],_0x359d40);}_0x4f3fab=_[_0xff9e('0x44')]({},_0x4f3fab,_0xca8a06[_0xff9e('0x45')]);return _0x3fe234['getMessages'](_0x4f3fab);}})[_0xff9e('0x2a')](function(_0x26ce97){if(_0x26ce97){_0x4074f2=_0x26ce97[_0xff9e('0x3b')];if(!_0xca8a06[_0xff9e('0x36')][_0xff9e('0x3c')](_0xff9e('0x3d'))){_0x4f3fab[_0xff9e('0x23')]=qs[_0xff9e('0x23')](_0xca8a06[_0xff9e('0x36')][_0xff9e('0x23')]);_0x4f3fab[_0xff9e('0x21')]=qs[_0xff9e('0x21')](_0xca8a06[_0xff9e('0x36')][_0xff9e('0x21')]);}return _0x3fe234['getMessages'](_0x4f3fab);}})[_0xff9e('0x2a')](function(_0x21e241){if(_0x21e241){return _0x21e241?{'count':_0x4074f2,'rows':_0x21e241}:null;}})['then'](respondWithResult(_0x39bed9,null))[_0xff9e('0x47')](handleError(_0x39bed9,null));}; \ No newline at end of file +var _0x1f1f=['reject','save','update','then','destroy','error','stack','name','send','index','map','ChatGroup','rawAttributes','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','include','create','body','find','params','describe','user','toInteger','addMembers','ids','omit','findOne','User','pick','getMembers','removeMembers','ChatGroupId','ChatInternalMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','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','redis','defaults','socket.io-emitter','./chatGroup.socket','sendStatus','status','end','json','limit','undefined','count','offset','set','apply'];(function(_0x53dafe,_0x27eb81){var _0x39a176=function(_0x34189c){while(--_0x34189c){_0x53dafe['push'](_0x53dafe['shift']());}};_0x39a176(++_0x27eb81);}(_0x1f1f,0x1b9));var _0xf1f1=function(_0x2ac4af,_0x288c53){_0x2ac4af=_0x2ac4af-0x0;var _0x3a36df=_0x1f1f[_0x2ac4af];return _0x3a36df;};'use strict';var emlformat=require(_0xf1f1('0x0'));var rimraf=require(_0xf1f1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf1f1('0x2'));var rp=require(_0xf1f1('0x3'));var moment=require(_0xf1f1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf1f1('0x5'));var util=require(_0xf1f1('0x6'));var path=require(_0xf1f1('0x7'));var sox=require('sox');var csv=require(_0xf1f1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf1f1('0x9'));var _=require(_0xf1f1('0xa'));var squel=require(_0xf1f1('0xb'));var crypto=require(_0xf1f1('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf1f1('0xd'));var toCsv=require(_0xf1f1('0x8'));var querystring=require(_0xf1f1('0xe'));var Papa=require(_0xf1f1('0xf'));var Redis=require(_0xf1f1('0x10'));var authService=require(_0xf1f1('0x11'));var qs=require(_0xf1f1('0x12'));var as=require(_0xf1f1('0x13'));var hardwareService=require(_0xf1f1('0x14'));var logger=require(_0xf1f1('0x15'))(_0xf1f1('0x16'));var utils=require(_0xf1f1('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xf1f1('0x18'));var db=require('../../mysqldb')['db'];config[_0xf1f1('0x19')]=_[_0xf1f1('0x1a')](config[_0xf1f1('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xf1f1('0x1b'))(new Redis(config[_0xf1f1('0x19')]));require(_0xf1f1('0x1c'))['register'](socket);function respondWithStatusCode(_0xfd6a55,_0x27438b){_0x27438b=_0x27438b||0xcc;return function(_0x5dad06){if(_0x5dad06){return _0xfd6a55[_0xf1f1('0x1d')](_0x27438b);}return _0xfd6a55[_0xf1f1('0x1e')](_0x27438b)[_0xf1f1('0x1f')]();};}function respondWithResult(_0x2cdd8b,_0xf143b7){_0xf143b7=_0xf143b7||0xc8;return function(_0x443329){if(_0x443329){return _0x2cdd8b[_0xf1f1('0x1e')](_0xf143b7)[_0xf1f1('0x20')](_0x443329);}};}function respondWithFilteredResult(_0x1fb6f3,_0x4c32e3){return function(_0x28df87){if(_0x28df87){var _0x5e48c2=typeof _0x4c32e3['offset']==='undefined'&&typeof _0x4c32e3[_0xf1f1('0x21')]===_0xf1f1('0x22');var _0x24fc7b=_0x28df87[_0xf1f1('0x23')];var _0x726118=_0x5e48c2?0x0:_0x4c32e3[_0xf1f1('0x24')];var _0x315034=_0x5e48c2?_0x28df87[_0xf1f1('0x23')]:_0x4c32e3[_0xf1f1('0x24')]+_0x4c32e3[_0xf1f1('0x21')];var _0x4a694d;if(_0x315034>=_0x24fc7b){_0x315034=_0x24fc7b;_0x4a694d=0xc8;}else{_0x4a694d=0xce;}_0x1fb6f3['status'](_0x4a694d);return _0x1fb6f3[_0xf1f1('0x25')]('Content-Range',_0x726118+'-'+_0x315034+'/'+_0x24fc7b)['json'](_0x28df87);}return null;};}function patchUpdates(_0x5ab653){return function(_0xf5b3cc){try{jsonpatch[_0xf1f1('0x26')](_0xf5b3cc,_0x5ab653,!![]);}catch(_0x4c0536){return BPromise[_0xf1f1('0x27')](_0x4c0536);}return _0xf5b3cc[_0xf1f1('0x28')]();};}function saveUpdates(_0x576af3,_0x1d3b2b){return function(_0x16a00c){if(_0x16a00c){return _0x16a00c[_0xf1f1('0x29')](_0x576af3)[_0xf1f1('0x2a')](function(_0x176077){return _0x176077;});}return null;};}function removeEntity(_0x5772db,_0x45d7cd){return function(_0x5eebf7){if(_0x5eebf7){return _0x5eebf7[_0xf1f1('0x2b')]()[_0xf1f1('0x2a')](function(){_0x5772db[_0xf1f1('0x1e')](0xcc)[_0xf1f1('0x1f')]();});}};}function handleEntityNotFound(_0x2ac0b2,_0x3cd944){return function(_0x41895c){if(!_0x41895c){_0x2ac0b2[_0xf1f1('0x1d')](0x194);}return _0x41895c;};}function handleError(_0x3b161f,_0x345780){_0x345780=_0x345780||0x1f4;return function(_0x554b12){logger[_0xf1f1('0x2c')](_0x554b12[_0xf1f1('0x2d')]);if(_0x554b12[_0xf1f1('0x2e')]){delete _0x554b12['name'];}_0x3b161f['status'](_0x345780)[_0xf1f1('0x2f')](_0x554b12);};}exports[_0xf1f1('0x30')]=function(_0x148b1c,_0x20affa){var _0x34ca73={},_0x2a181f={},_0x24d989={'count':0x0,'rows':[]};var _0x326013=_[_0xf1f1('0x31')](db[_0xf1f1('0x32')][_0xf1f1('0x33')],function(_0x3db8bf){return{'name':_0x3db8bf['fieldName'],'type':_0x3db8bf[_0xf1f1('0x34')]['key']};});_0x2a181f[_0xf1f1('0x35')]=_[_0xf1f1('0x31')](_0x326013,_0xf1f1('0x2e'));_0x2a181f[_0xf1f1('0x36')]=_[_0xf1f1('0x37')](_0x148b1c[_0xf1f1('0x36')]);_0x2a181f['filters']=_[_0xf1f1('0x38')](_0x2a181f[_0xf1f1('0x35')],_0x2a181f[_0xf1f1('0x36')]);_0x34ca73['attributes']=_[_0xf1f1('0x38')](_0x2a181f[_0xf1f1('0x35')],qs[_0xf1f1('0x39')](_0x148b1c[_0xf1f1('0x36')][_0xf1f1('0x39')]));_0x34ca73[_0xf1f1('0x3a')]=_0x34ca73[_0xf1f1('0x3a')][_0xf1f1('0x3b')]?_0x34ca73['attributes']:_0x2a181f[_0xf1f1('0x35')];if(!_0x148b1c['query'][_0xf1f1('0x3c')](_0xf1f1('0x3d'))){_0x34ca73[_0xf1f1('0x21')]=qs['limit'](_0x148b1c[_0xf1f1('0x36')]['limit']);_0x34ca73['offset']=qs[_0xf1f1('0x24')](_0x148b1c[_0xf1f1('0x36')][_0xf1f1('0x24')]);}_0x34ca73[_0xf1f1('0x3e')]=qs[_0xf1f1('0x3f')](_0x148b1c['query'][_0xf1f1('0x3f')]);_0x34ca73[_0xf1f1('0x40')]=qs['filters'](_['pick'](_0x148b1c[_0xf1f1('0x36')],_0x2a181f[_0xf1f1('0x41')]),_0x326013);if(_0x148b1c['query']['filter']){_0x34ca73[_0xf1f1('0x40')]=_[_0xf1f1('0x42')](_0x34ca73['where'],{'$or':_[_0xf1f1('0x31')](_0x326013,function(_0x2b8218){if(_0x2b8218[_0xf1f1('0x34')]!==_0xf1f1('0x43')){var _0x3e2e16={};_0x3e2e16[_0x2b8218['name']]={'$like':'%'+_0x148b1c[_0xf1f1('0x36')][_0xf1f1('0x44')]+'%'};return _0x3e2e16;}})});}_0x34ca73=_['merge']({},_0x34ca73,_0x148b1c[_0xf1f1('0x45')]);var _0x326468={'where':_0x34ca73['where']};return db['ChatGroup'][_0xf1f1('0x23')](_0x326468)[_0xf1f1('0x2a')](function(_0x20ac19){_0x24d989[_0xf1f1('0x23')]=_0x20ac19;if(_0x148b1c[_0xf1f1('0x36')][_0xf1f1('0x46')]){_0x34ca73['include']=[{'all':!![]}];}return db[_0xf1f1('0x32')][_0xf1f1('0x47')](_0x34ca73);})[_0xf1f1('0x2a')](function(_0x2eedc1){_0x24d989[_0xf1f1('0x48')]=_0x2eedc1;return _0x24d989;})[_0xf1f1('0x2a')](respondWithFilteredResult(_0x20affa,_0x34ca73))[_0xf1f1('0x49')](handleError(_0x20affa,null));};exports['show']=function(_0x5c910a,_0x6dc339){var _0x4512ac={'raw':!![],'where':{'id':_0x5c910a['params']['id']}},_0x6df1c5={};_0x6df1c5[_0xf1f1('0x35')]=_[_0xf1f1('0x37')](db[_0xf1f1('0x32')][_0xf1f1('0x33')]);_0x6df1c5[_0xf1f1('0x36')]=_[_0xf1f1('0x37')](_0x5c910a[_0xf1f1('0x36')]);_0x6df1c5['filters']=_[_0xf1f1('0x38')](_0x6df1c5[_0xf1f1('0x35')],_0x6df1c5['query']);_0x4512ac[_0xf1f1('0x3a')]=_['intersection'](_0x6df1c5[_0xf1f1('0x35')],qs[_0xf1f1('0x39')](_0x5c910a[_0xf1f1('0x36')][_0xf1f1('0x39')]));_0x4512ac[_0xf1f1('0x3a')]=_0x4512ac[_0xf1f1('0x3a')][_0xf1f1('0x3b')]?_0x4512ac[_0xf1f1('0x3a')]:_0x6df1c5[_0xf1f1('0x35')];if(_0x5c910a[_0xf1f1('0x36')]['includeAll']){_0x4512ac[_0xf1f1('0x4a')]=[{'all':!![]}];}_0x4512ac=_[_0xf1f1('0x42')]({},_0x4512ac,_0x5c910a[_0xf1f1('0x45')]);return db['ChatGroup']['find'](_0x4512ac)[_0xf1f1('0x2a')](handleEntityNotFound(_0x6dc339,null))[_0xf1f1('0x2a')](respondWithResult(_0x6dc339,null))[_0xf1f1('0x49')](handleError(_0x6dc339,null));};exports[_0xf1f1('0x4b')]=function(_0x24e6a4,_0x208fd3){return db[_0xf1f1('0x32')][_0xf1f1('0x4b')](_0x24e6a4[_0xf1f1('0x4c')],{})['then'](respondWithResult(_0x208fd3,0xc9))[_0xf1f1('0x49')](handleError(_0x208fd3,null));};exports[_0xf1f1('0x29')]=function(_0x10e9d1,_0x652e46){if(_0x10e9d1['body']['id']){delete _0x10e9d1[_0xf1f1('0x4c')]['id'];}return db[_0xf1f1('0x32')]['find']({'where':{'id':_0x10e9d1['params']['id']}})['then'](handleEntityNotFound(_0x652e46,null))[_0xf1f1('0x2a')](saveUpdates(_0x10e9d1[_0xf1f1('0x4c')],null))[_0xf1f1('0x2a')](respondWithResult(_0x652e46,null))[_0xf1f1('0x49')](handleError(_0x652e46,null));};exports[_0xf1f1('0x2b')]=function(_0x509e8d,_0x22c6e6){return db['ChatGroup'][_0xf1f1('0x4d')]({'where':{'id':_0x509e8d[_0xf1f1('0x4e')]['id']}})['then'](handleEntityNotFound(_0x22c6e6,null))[_0xf1f1('0x2a')](removeEntity(_0x22c6e6,null))[_0xf1f1('0x49')](handleError(_0x22c6e6,null));};exports[_0xf1f1('0x4f')]=function(_0x105e2e,_0x2856e9){return db[_0xf1f1('0x32')][_0xf1f1('0x4f')]()[_0xf1f1('0x2a')](respondWithResult(_0x2856e9,null))[_0xf1f1('0x49')](handleError(_0x2856e9,null));};exports['getUnread']=function(_0x5399b7,_0x3e95d5,_0x2cffe6){return db['ChatInternalMessage'][_0xf1f1('0x23')]({'where':{'ChatGroupId':_0x5399b7[_0xf1f1('0x4e')]['id'],'ToId':_0x5399b7[_0xf1f1('0x50')]['id'],'read':![]}})['then'](function(_0x3e3b04){return{'id':_[_0xf1f1('0x51')](_0x5399b7[_0xf1f1('0x4e')]['id']),'count':_0x3e3b04};})[_0xf1f1('0x2a')](respondWithResult(_0x3e95d5,null))['catch'](handleError(_0x3e95d5,null));};exports['addMembers']=function(_0x5b8c7c,_0x3f4dfe,_0x712595){return db['ChatGroup']['find']({'where':{'id':_0x5b8c7c[_0xf1f1('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3f4dfe,null))[_0xf1f1('0x2a')](function(_0x57d650){if(_0x57d650){return _0x57d650[_0xf1f1('0x52')](_0x5b8c7c['body'][_0xf1f1('0x53')],_[_0xf1f1('0x54')](_0x5b8c7c[_0xf1f1('0x4c')],[_0xf1f1('0x53'),'id'])||{});}})['then'](respondWithResult(_0x3f4dfe,null))[_0xf1f1('0x49')](handleError(_0x3f4dfe,null));};exports['getMembers']=function(_0x457e45,_0x29cbb2,_0x304236){var _0x535e1d={};var _0x4d6678={};var _0xb1e56c;var _0x4c770d;return db[_0xf1f1('0x32')][_0xf1f1('0x55')]({'where':{'id':_0x457e45[_0xf1f1('0x4e')]['id']}})[_0xf1f1('0x2a')](handleEntityNotFound(_0x29cbb2,null))[_0xf1f1('0x2a')](function(_0x24c9c0){if(_0x24c9c0){_0xb1e56c=_0x24c9c0;_0x4d6678[_0xf1f1('0x35')]=_[_0xf1f1('0x37')](db[_0xf1f1('0x56')][_0xf1f1('0x33')]);_0x4d6678[_0xf1f1('0x36')]=_[_0xf1f1('0x37')](_0x457e45['query']);_0x4d6678['filters']=_[_0xf1f1('0x38')](_0x4d6678[_0xf1f1('0x35')],_0x4d6678['query']);_0x535e1d['attributes']=_[_0xf1f1('0x38')](_0x4d6678[_0xf1f1('0x35')],qs[_0xf1f1('0x39')](_0x457e45[_0xf1f1('0x36')][_0xf1f1('0x39')]));_0x535e1d[_0xf1f1('0x3a')]=_0x535e1d[_0xf1f1('0x3a')][_0xf1f1('0x3b')]?_0x535e1d[_0xf1f1('0x3a')]:_0x4d6678[_0xf1f1('0x35')];_0x535e1d[_0xf1f1('0x3e')]=qs[_0xf1f1('0x3f')](_0x457e45['query'][_0xf1f1('0x3f')]);_0x535e1d[_0xf1f1('0x40')]=qs[_0xf1f1('0x41')](_[_0xf1f1('0x57')](_0x457e45[_0xf1f1('0x36')],_0x4d6678[_0xf1f1('0x41')]));if(_0x457e45['query'][_0xf1f1('0x44')]){_0x535e1d[_0xf1f1('0x40')]=_[_0xf1f1('0x42')](_0x535e1d[_0xf1f1('0x40')],{'$or':_[_0xf1f1('0x31')](_0x535e1d[_0xf1f1('0x3a')],function(_0x147abb){var _0x36e222={};_0x36e222[_0x147abb]={'$like':'%'+_0x457e45[_0xf1f1('0x36')][_0xf1f1('0x44')]+'%'};return _0x36e222;})});}_0x535e1d=_['merge']({},_0x535e1d,_0x457e45[_0xf1f1('0x45')]);return _0xb1e56c['getMembers'](_0x535e1d);}})[_0xf1f1('0x2a')](function(_0x49b1e5){if(_0x49b1e5){_0x4c770d=_0x49b1e5[_0xf1f1('0x3b')];if(!_0x457e45[_0xf1f1('0x36')][_0xf1f1('0x3c')](_0xf1f1('0x3d'))){_0x535e1d['limit']=qs[_0xf1f1('0x21')](_0x457e45[_0xf1f1('0x36')]['limit']);_0x535e1d[_0xf1f1('0x24')]=qs[_0xf1f1('0x24')](_0x457e45[_0xf1f1('0x36')]['offset']);}return _0xb1e56c[_0xf1f1('0x58')](_0x535e1d);}})['then'](function(_0x4f78d3){if(_0x4f78d3){return _0x4f78d3?{'count':_0x4c770d,'rows':_0x4f78d3}:null;}})[_0xf1f1('0x2a')](respondWithResult(_0x29cbb2,null))[_0xf1f1('0x49')](handleError(_0x29cbb2,null));};exports['removeMembers']=function(_0x342a77,_0x645702,_0x43f22d){return db[_0xf1f1('0x32')][_0xf1f1('0x4d')]({'where':{'id':_0x342a77['params']['id']}})[_0xf1f1('0x2a')](handleEntityNotFound(_0x645702,null))[_0xf1f1('0x2a')](function(_0x22229c){if(_0x22229c){return _0x22229c[_0xf1f1('0x59')](_0x342a77[_0xf1f1('0x36')][_0xf1f1('0x53')]);}})['then'](respondWithStatusCode(_0x645702,null))[_0xf1f1('0x49')](handleError(_0x645702,null));};exports['addMessage']=function(_0x30d0a0,_0x3fae2e,_0x3a11cd){if(_0x30d0a0[_0xf1f1('0x4c')]['id']){delete _0x30d0a0['body']['id'];}return db['ChatGroup']['find']({'where':{'id':_0x30d0a0['params']['id']}})[_0xf1f1('0x2a')](handleEntityNotFound(_0x3fae2e,null))[_0xf1f1('0x2a')](function(_0x4b4ef6){if(_0x4b4ef6){_0x30d0a0[_0xf1f1('0x4c')][_0xf1f1('0x5a')]=_0x4b4ef6['id'];return db[_0xf1f1('0x5b')]['create'](_0x30d0a0[_0xf1f1('0x4c')]);}})[_0xf1f1('0x2a')](respondWithResult(_0x3fae2e,null))[_0xf1f1('0x49')](handleError(_0x3fae2e,null));};exports['getMessages']=function(_0x2dd453,_0x4d6556,_0x54e5aa){var _0x10b138={};var _0x19ee3a={};var _0x18a2df;var _0x23cfb2;return db[_0xf1f1('0x32')][_0xf1f1('0x55')]({'where':{'id':_0x2dd453[_0xf1f1('0x4e')]['id']}})[_0xf1f1('0x2a')](handleEntityNotFound(_0x4d6556,null))[_0xf1f1('0x2a')](function(_0x1f3442){if(_0x1f3442){_0x18a2df=_0x1f3442;_0x19ee3a[_0xf1f1('0x35')]=_[_0xf1f1('0x37')](db[_0xf1f1('0x5b')]['rawAttributes']);_0x19ee3a[_0xf1f1('0x36')]=_[_0xf1f1('0x37')](_0x2dd453['query']);_0x19ee3a[_0xf1f1('0x41')]=_[_0xf1f1('0x38')](_0x19ee3a[_0xf1f1('0x35')],_0x19ee3a['query']);_0x10b138[_0xf1f1('0x3a')]=_[_0xf1f1('0x38')](_0x19ee3a[_0xf1f1('0x35')],qs[_0xf1f1('0x39')](_0x2dd453['query']['fields']));_0x10b138[_0xf1f1('0x3a')]=_0x10b138[_0xf1f1('0x3a')]['length']?_0x10b138[_0xf1f1('0x3a')]:_0x19ee3a[_0xf1f1('0x35')];_0x10b138[_0xf1f1('0x3e')]=qs[_0xf1f1('0x3f')](_0x2dd453[_0xf1f1('0x36')][_0xf1f1('0x3f')]);_0x10b138[_0xf1f1('0x40')]=qs[_0xf1f1('0x41')](_[_0xf1f1('0x57')](_0x2dd453['query'],_0x19ee3a[_0xf1f1('0x41')]));if(_0x2dd453[_0xf1f1('0x36')][_0xf1f1('0x44')]){_0x10b138[_0xf1f1('0x40')]=_['merge'](_0x10b138['where'],{'$or':_[_0xf1f1('0x31')](_0x10b138['attributes'],function(_0x3249af){var _0x77b1a9={};_0x77b1a9[_0x3249af]={'$like':'%'+_0x2dd453['query'][_0xf1f1('0x44')]+'%'};return _0x77b1a9;})});}if(_0x2dd453[_0xf1f1('0x36')][_0xf1f1('0x5c')]){var _0xe688cd=_0x2dd453[_0xf1f1('0x36')][_0xf1f1('0x5c')]['split'](',');var _0x73cdbc={};_0x73cdbc[_0xe688cd[0x0]]={'$gte':moment(_0xe688cd[0x1])[_0xf1f1('0x5d')](_0xf1f1('0x5e'))};_0x10b138[_0xf1f1('0x40')]=_[_0xf1f1('0x42')](_0x10b138[_0xf1f1('0x40')],_0x73cdbc);}_0x10b138=_['merge']({},_0x10b138,_0x2dd453[_0xf1f1('0x45')]);return _0x18a2df['getMessages'](_0x10b138);}})[_0xf1f1('0x2a')](function(_0x4b1927){if(_0x4b1927){_0x23cfb2=_0x4b1927[_0xf1f1('0x3b')];if(!_0x2dd453[_0xf1f1('0x36')][_0xf1f1('0x3c')](_0xf1f1('0x3d'))){_0x10b138[_0xf1f1('0x21')]=qs[_0xf1f1('0x21')](_0x2dd453[_0xf1f1('0x36')][_0xf1f1('0x21')]);_0x10b138[_0xf1f1('0x24')]=qs['offset'](_0x2dd453[_0xf1f1('0x36')]['offset']);}return _0x18a2df[_0xf1f1('0x5f')](_0x10b138);}})['then'](function(_0x3c9e41){if(_0x3c9e41){return _0x3c9e41?{'count':_0x23cfb2,'rows':_0x3c9e41}:null;}})[_0xf1f1('0x2a')](respondWithResult(_0x4d6556,null))['catch'](handleError(_0x4d6556,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 380f895..b84f944 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 _0x27a6=['save','remove','emit','hasOwnProperty','hook','../../mysqldb'];(function(_0x39ffd1,_0x299703){var _0x31267e=function(_0x11b420){while(--_0x11b420){_0x39ffd1['push'](_0x39ffd1['shift']());}};_0x31267e(++_0x299703);}(_0x27a6,0x9b));var _0x627a=function(_0x24c57b,_0x2ab0c0){_0x24c57b=_0x24c57b-0x0;var _0x1d0146=_0x27a6[_0x24c57b];return _0x1d0146;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x627a('0x0'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x627a('0x1'),'afterUpdate':'update','afterDestroy':_0x627a('0x2')};function emitEvent(_0x4b90a7){return function(_0x54b8f2,_0x33984d,_0x21e9f6){ChatGroupEvents[_0x627a('0x3')](_0x4b90a7+':'+_0x54b8f2['id'],_0x54b8f2);ChatGroupEvents[_0x627a('0x3')](_0x4b90a7,_0x54b8f2);_0x21e9f6(null);};}for(var e in events){if(events[_0x627a('0x4')](e)){var event=events[e];ChatGroup[_0x627a('0x5')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file +var _0x20a2=['../../mysqldb','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x20a2,0xf2));var _0x220a=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0x20a2[_0x18cd5b];return _0x5eaa52;};'use strict';var EventEmitter=require(_0x220a('0x0'));var ChatGroup=require(_0x220a('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x220a('0x2'),'afterUpdate':_0x220a('0x3'),'afterDestroy':_0x220a('0x4')};function emitEvent(_0x328d6d){return function(_0x40766a,_0xe391a4,_0x4e339e){ChatGroupEvents['emit'](_0x328d6d+':'+_0x40766a['id'],_0x40766a);ChatGroupEvents[_0x220a('0x5')](_0x328d6d,_0x40766a);_0x4e339e(null);};}for(var e in events){if(events[_0x220a('0x6')](e)){var event=events[e];ChatGroup[_0x220a('0x7')](e,emitEvent(event));}}module[_0x220a('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 625fad9..83f6cb6 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 _0x6aa1=['api','moment','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','util','../../config/logger'];(function(_0x176e96,_0x56f9b6){var _0x5ef483=function(_0x5c6a36){while(--_0x5c6a36){_0x176e96['push'](_0x176e96['shift']());}};_0x5ef483(++_0x56f9b6);}(_0x6aa1,0x196));var _0x16aa=function(_0x42bddd,_0x19a227){_0x42bddd=_0x42bddd-0x0;var _0xd18338=_0x6aa1[_0x42bddd];return _0xd18338;};'use strict';var _=require('lodash');var util=require(_0x16aa('0x0'));var logger=require(_0x16aa('0x1'))(_0x16aa('0x2'));var moment=require(_0x16aa('0x3'));var BPromise=require('bluebird');var rp=require(_0x16aa('0x4'));var fs=require('fs');var path=require(_0x16aa('0x5'));var rimraf=require(_0x16aa('0x6'));var config=require(_0x16aa('0x7'));var attributes=require(_0x16aa('0x8'));module[_0x16aa('0x9')]=function(_0x1475ce,_0x2aab52){return _0x1475ce[_0x16aa('0xa')](_0x16aa('0xb'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1a96=['moment','request-promise','rimraf','./chatGroup.attributes','exports','define','chat_groups','lodash','util','../../config/logger','api'];(function(_0x490df6,_0x37de20){var _0x52b09b=function(_0x5991e){while(--_0x5991e){_0x490df6['push'](_0x490df6['shift']());}};_0x52b09b(++_0x37de20);}(_0x1a96,0x172));var _0x61a9=function(_0x42f514,_0x3a8c7f){_0x42f514=_0x42f514-0x0;var _0x3ecb67=_0x1a96[_0x42f514];return _0x3ecb67;};'use strict';var _=require(_0x61a9('0x0'));var util=require(_0x61a9('0x1'));var logger=require(_0x61a9('0x2'))(_0x61a9('0x3'));var moment=require(_0x61a9('0x4'));var BPromise=require('bluebird');var rp=require(_0x61a9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x61a9('0x6'));var config=require('../../config/environment');var attributes=require(_0x61a9('0x7'));module[_0x61a9('0x8')]=function(_0x414f61,_0x4585d6){return _0x414f61[_0x61a9('0x9')]('ChatGroup',attributes,{'tableName':_0x61a9('0xa'),'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 91dce9d..3c30013 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 _0x3423=['ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','then','info','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','ChatGroup,\x20%s,\x20%s','message','result','lodash','util','bluebird','randomstring'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x3423,0x1f0));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3342('0x0'));var util=require(_0x3342('0x1'));var moment=require('moment');var BPromise=require(_0x3342('0x2'));var rs=require(_0x3342('0x3'));var fs=require('fs');var Redis=require(_0x3342('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3342('0x5'));var logger=require(_0x3342('0x6'))(_0x3342('0x7'));var config=require('../../config/environment');var jayson=require(_0x3342('0x8'));var client=jayson[_0x3342('0x9')][_0x3342('0xa')]({'port':0x232a});config[_0x3342('0xb')]=_[_0x3342('0xc')](config[_0x3342('0xb')],{'host':_0x3342('0xd'),'port':0x18eb});var socket=require(_0x3342('0xe'))(new Redis(config['redis']));require(_0x3342('0xf'))[_0x3342('0x10')](socket);function respondWithRpcPromise(_0x4d6f5e,_0x52c7d6,_0x3f2f34){return new BPromise(function(_0x220835,_0xc304eb){return client['request'](_0x4d6f5e,_0x3f2f34)[_0x3342('0x11')](function(_0x4a61ba){logger[_0x3342('0x12')]('ChatGroup,\x20%s,\x20%s',_0x52c7d6,'request\x20sent');logger['debug'](_0x3342('0x13'),_0x52c7d6,'request\x20sent',JSON['stringify'](_0x4a61ba));if(_0x4a61ba[_0x3342('0x14')]){if(_0x4a61ba[_0x3342('0x14')][_0x3342('0x15')]===0x1f4){logger[_0x3342('0x14')](_0x3342('0x16'),_0x52c7d6,_0x4a61ba['error'][_0x3342('0x17')]);return _0xc304eb(_0x4a61ba[_0x3342('0x14')][_0x3342('0x17')]);}logger[_0x3342('0x14')](_0x3342('0x16'),_0x52c7d6,_0x4a61ba[_0x3342('0x14')]['message']);return _0x220835(_0x4a61ba[_0x3342('0x14')][_0x3342('0x17')]);}else{logger[_0x3342('0x12')](_0x3342('0x16'),_0x52c7d6,'request\x20sent');_0x220835(_0x4a61ba[_0x3342('0x18')][_0x3342('0x17')]);}})['catch'](function(_0x50f61a){logger[_0x3342('0x14')](_0x3342('0x16'),_0x52c7d6,_0x50f61a);_0xc304eb(_0x50f61a);});});} \ No newline at end of file +var _0xb815=['localhost','socket.io-emitter','./chatGroup.socket','register','then','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatGroup,\x20%s,\x20%s','result','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults'];(function(_0x1cea7e,_0x4e9be8){var _0xdb85fa=function(_0x356113){while(--_0x356113){_0x1cea7e['push'](_0x1cea7e['shift']());}};_0xdb85fa(++_0x4e9be8);}(_0xb815,0x160));var _0x5b81=function(_0x4c67c1,_0x585434){_0x4c67c1=_0x4c67c1-0x0;var _0x43a018=_0xb815[_0x4c67c1];return _0x43a018;};'use strict';var _=require(_0x5b81('0x0'));var util=require(_0x5b81('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5b81('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5b81('0x3'))['db'];var utils=require(_0x5b81('0x4'));var logger=require(_0x5b81('0x5'))(_0x5b81('0x6'));var config=require('../../config/environment');var jayson=require(_0x5b81('0x7'));var client=jayson[_0x5b81('0x8')][_0x5b81('0x9')]({'port':0x232a});config[_0x5b81('0xa')]=_[_0x5b81('0xb')](config[_0x5b81('0xa')],{'host':_0x5b81('0xc'),'port':0x18eb});var socket=require(_0x5b81('0xd'))(new Redis(config[_0x5b81('0xa')]));require(_0x5b81('0xe'))[_0x5b81('0xf')](socket);function respondWithRpcPromise(_0x1bd508,_0x3b480c,_0x5345f8){return new BPromise(function(_0x4153f0,_0x21bb6d){return client['request'](_0x1bd508,_0x5345f8)[_0x5b81('0x10')](function(_0x3d2296){logger[_0x5b81('0x11')]('ChatGroup,\x20%s,\x20%s',_0x3b480c,_0x5b81('0x12'));logger[_0x5b81('0x13')](_0x5b81('0x14'),_0x3b480c,_0x5b81('0x12'),JSON[_0x5b81('0x15')](_0x3d2296));if(_0x3d2296[_0x5b81('0x16')]){if(_0x3d2296[_0x5b81('0x16')]['code']===0x1f4){logger[_0x5b81('0x16')]('ChatGroup,\x20%s,\x20%s',_0x3b480c,_0x3d2296[_0x5b81('0x16')][_0x5b81('0x17')]);return _0x21bb6d(_0x3d2296[_0x5b81('0x16')][_0x5b81('0x17')]);}logger[_0x5b81('0x16')](_0x5b81('0x18'),_0x3b480c,_0x3d2296[_0x5b81('0x16')][_0x5b81('0x17')]);return _0x4153f0(_0x3d2296[_0x5b81('0x16')][_0x5b81('0x17')]);}else{logger[_0x5b81('0x11')]('ChatGroup,\x20%s,\x20%s',_0x3b480c,_0x5b81('0x12'));_0x4153f0(_0x3d2296[_0x5b81('0x19')][_0x5b81('0x17')]);}})['catch'](function(_0xfa7f55){logger['error'](_0x5b81('0x18'),_0x3b480c,_0xfa7f55);_0x21bb6d(_0xfa7f55);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 9aedfc4..362c24f 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 _0x8c0d=['removeListener','register','length','chatGroup:','./chatGroup.events','remove','update','emit'];(function(_0x20eac4,_0x11afc){var _0x3ed4f8=function(_0x53bac8){while(--_0x53bac8){_0x20eac4['push'](_0x20eac4['shift']());}};_0x3ed4f8(++_0x11afc);}(_0x8c0d,0xc4));var _0xd8c0=function(_0x266a56,_0x3913bd){_0x266a56=_0x266a56-0x0;var _0x15ed23=_0x8c0d[_0x266a56];return _0x15ed23;};'use strict';var ChatGroupEvents=require(_0xd8c0('0x0'));var events=['save',_0xd8c0('0x1'),_0xd8c0('0x2')];function createListener(_0xcd08bf,_0x1ee1bb){return function(_0x5674aa){_0x1ee1bb[_0xd8c0('0x3')](_0xcd08bf,_0x5674aa);};}function removeListener(_0x42b0b9,_0x4f0f9b){return function(){ChatGroupEvents[_0xd8c0('0x4')](_0x42b0b9,_0x4f0f9b);};}exports[_0xd8c0('0x5')]=function(_0x21aa3f){for(var _0x11a627=0x0,_0x64eafa=events[_0xd8c0('0x6')];_0x11a627<_0x64eafa;_0x11a627++){var _0x3307db=events[_0x11a627];var _0x4713ca=createListener(_0xd8c0('0x7')+_0x3307db,_0x21aa3f);ChatGroupEvents['on'](_0x3307db,_0x4713ca);}}; \ No newline at end of file +var _0x97b9=['chatGroup:','./chatGroup.events','save','remove','update','removeListener','register','length'];(function(_0x1ae1b8,_0x554cc1){var _0x4edf3b=function(_0xc3b347){while(--_0xc3b347){_0x1ae1b8['push'](_0x1ae1b8['shift']());}};_0x4edf3b(++_0x554cc1);}(_0x97b9,0xe1));var _0x997b=function(_0x59432c,_0x489d14){_0x59432c=_0x59432c-0x0;var _0x24a326=_0x97b9[_0x59432c];return _0x24a326;};'use strict';var ChatGroupEvents=require(_0x997b('0x0'));var events=[_0x997b('0x1'),_0x997b('0x2'),_0x997b('0x3')];function createListener(_0x33c713,_0x5116c2){return function(_0x2f2231){_0x5116c2['emit'](_0x33c713,_0x2f2231);};}function removeListener(_0x43f100,_0x385229){return function(){ChatGroupEvents[_0x997b('0x4')](_0x43f100,_0x385229);};}exports[_0x997b('0x5')]=function(_0x53fe72){for(var _0x138ed5=0x0,_0x18657b=events[_0x997b('0x6')];_0x138ed5<_0x18657b;_0x138ed5++){var _0x4a9c49=events[_0x138ed5];var _0x5537ee=createListener(_0x997b('0x7')+_0x4a9c49,_0x53fe72);ChatGroupEvents['on'](_0x4a9c49,_0x5537ee);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 6737824..1326bde 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 _0xdec0=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatGroup.controller','isAuthenticated','index','get','/describe','describe','/:id','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','put','update','delete','destroy','exports','multer'];(function(_0x11b95b,_0x162258){var _0x17b3df=function(_0xd3fc59){while(--_0xd3fc59){_0x11b95b['push'](_0x11b95b['shift']());}};_0x17b3df(++_0x162258);}(_0xdec0,0x7b));var _0x0dec=function(_0x35a274,_0x98b399){_0x35a274=_0x35a274-0x0;var _0x40d905=_0xdec0[_0x35a274];return _0x40d905;};'use strict';var multer=require(_0x0dec('0x0'));var util=require(_0x0dec('0x1'));var path=require(_0x0dec('0x2'));var timeout=require(_0x0dec('0x3'));var express=require(_0x0dec('0x4'));var router=express[_0x0dec('0x5')]();var fs_extra=require(_0x0dec('0x6'));var auth=require(_0x0dec('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x0dec('0x8'));var controller=require(_0x0dec('0x9'));router['get']('/',auth[_0x0dec('0xa')](),controller[_0x0dec('0xb')]);router[_0x0dec('0xc')](_0x0dec('0xd'),auth['isAuthenticated'](),controller[_0x0dec('0xe')]);router[_0x0dec('0xc')](_0x0dec('0xf'),auth[_0x0dec('0xa')](),controller['show']);router['get'](_0x0dec('0x10'),auth[_0x0dec('0xa')](),controller[_0x0dec('0x11')]);router[_0x0dec('0xc')](_0x0dec('0x12'),auth['isAuthenticated'](),controller[_0x0dec('0x13')]);router[_0x0dec('0xc')](_0x0dec('0x14'),auth[_0x0dec('0xa')](),controller[_0x0dec('0x15')]);router[_0x0dec('0x16')]('/',auth[_0x0dec('0xa')](),controller[_0x0dec('0x17')]);router[_0x0dec('0x16')]('/:id/members',auth[_0x0dec('0xa')](),controller[_0x0dec('0x18')]);router[_0x0dec('0x16')](_0x0dec('0x14'),auth[_0x0dec('0xa')](),controller[_0x0dec('0x19')]);router[_0x0dec('0x1a')](_0x0dec('0xf'),auth['isAuthenticated'](),controller[_0x0dec('0x1b')]);router[_0x0dec('0x1c')]('/:id',auth[_0x0dec('0xa')](),controller[_0x0dec('0x1d')]);router['delete']('/:id/members',auth[_0x0dec('0xa')](),controller['removeMembers']);module[_0x0dec('0x1e')]=router; \ No newline at end of file +var _0xe6d8=['exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getUnread','/:id/members','getMembers','/:id/messages','create','post','addMembers','addMessage','update','delete','removeMembers'];(function(_0x311604,_0x5ce312){var _0x3947f8=function(_0x28d626){while(--_0x28d626){_0x311604['push'](_0x311604['shift']());}};_0x3947f8(++_0x5ce312);}(_0xe6d8,0xd9));var _0x8e6d=function(_0xf7350a,_0x4399f1){_0xf7350a=_0xf7350a-0x0;var _0x285501=_0xe6d8[_0xf7350a];return _0x285501;};'use strict';var multer=require(_0x8e6d('0x0'));var util=require(_0x8e6d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8e6d('0x2'));var router=express[_0x8e6d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8e6d('0x4'));var interaction=require(_0x8e6d('0x5'));var config=require(_0x8e6d('0x6'));var controller=require(_0x8e6d('0x7'));router[_0x8e6d('0x8')]('/',auth[_0x8e6d('0x9')](),controller[_0x8e6d('0xa')]);router['get'](_0x8e6d('0xb'),auth['isAuthenticated'](),controller[_0x8e6d('0xc')]);router[_0x8e6d('0x8')](_0x8e6d('0xd'),auth[_0x8e6d('0x9')](),controller[_0x8e6d('0xe')]);router[_0x8e6d('0x8')]('/:id/unread',auth['isAuthenticated'](),controller[_0x8e6d('0xf')]);router[_0x8e6d('0x8')](_0x8e6d('0x10'),auth[_0x8e6d('0x9')](),controller[_0x8e6d('0x11')]);router[_0x8e6d('0x8')](_0x8e6d('0x12'),auth[_0x8e6d('0x9')](),controller['getMessages']);router['post']('/',auth[_0x8e6d('0x9')](),controller[_0x8e6d('0x13')]);router[_0x8e6d('0x14')](_0x8e6d('0x10'),auth[_0x8e6d('0x9')](),controller[_0x8e6d('0x15')]);router[_0x8e6d('0x14')](_0x8e6d('0x12'),auth[_0x8e6d('0x9')](),controller[_0x8e6d('0x16')]);router['put'](_0x8e6d('0xd'),auth[_0x8e6d('0x9')](),controller[_0x8e6d('0x17')]);router[_0x8e6d('0x18')](_0x8e6d('0xd'),auth[_0x8e6d('0x9')](),controller['destroy']);router[_0x8e6d('0x18')](_0x8e6d('0x10'),auth['isAuthenticated'](),controller[_0x8e6d('0x19')]);module[_0x8e6d('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 26c1563..43ee5ae 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 _0xeffd=['ENUM','star','thumb','TEXT','STRING','DATE','long','out','sequelize','BOOLEAN','INTEGER'];(function(_0x4eafed,_0x26e2bc){var _0x159c85=function(_0x6f129f){while(--_0x6f129f){_0x4eafed['push'](_0x4eafed['shift']());}};_0x159c85(++_0x26e2bc);}(_0xeffd,0x6b));var _0xdeff=function(_0x458c83,_0x272aa2){_0x458c83=_0x458c83-0x0;var _0x36c92e=_0xeffd[_0x458c83];return _0x36c92e;};'use strict';var Sequelize=require(_0xdeff('0x0'));module['exports']={'closed':{'type':Sequelize[_0xdeff('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xdeff('0x2')]},'ratingType':{'type':Sequelize[_0xdeff('0x3')](_0xdeff('0x4'),_0xdeff('0x5')),'defaultValue':_0xdeff('0x4')},'ratingMessage':{'type':Sequelize[_0xdeff('0x6')]},'pathTranscript':{'type':Sequelize[_0xdeff('0x6')]},'mailTranscript':{'type':Sequelize[_0xdeff('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xdeff('0x8')]},'disposition':{'type':Sequelize[_0xdeff('0x7')]},'secondDisposition':{'type':Sequelize[_0xdeff('0x7')]},'thirdDisposition':{'type':Sequelize[_0xdeff('0x7')]},'note':{'type':Sequelize[_0xdeff('0x7')]},'browserName':{'type':Sequelize[_0xdeff('0x7')]},'browserVersion':{'type':Sequelize[_0xdeff('0x7')]},'osName':{'type':Sequelize[_0xdeff('0x7')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xdeff('0x7')]},'deviceVendor':{'type':Sequelize[_0xdeff('0x7')]},'deviceType':{'type':Sequelize[_0xdeff('0x7')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0xdeff('0x7')]},'formData':{'type':Sequelize[_0xdeff('0x6')](_0xdeff('0x9'))},'read1stAt':{'type':Sequelize[_0xdeff('0x8')]},'lastMsgAt':{'type':Sequelize[_0xdeff('0x8')]},'lastMsgDirection':{'type':Sequelize[_0xdeff('0x3')]('in',_0xdeff('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xdeff('0x7')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0xdeff('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xdeff('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0x58e5=['exports','BOOLEAN','INTEGER','ENUM','star','STRING','TEXT','long','DATE','sequelize'];(function(_0x23fa4f,_0x7b7fbc){var _0x103e5d=function(_0x47cac3){while(--_0x47cac3){_0x23fa4f['push'](_0x23fa4f['shift']());}};_0x103e5d(++_0x7b7fbc);}(_0x58e5,0xd1));var _0x558e=function(_0x56916d,_0x37b935){_0x56916d=_0x56916d-0x0;var _0x2b7f1f=_0x58e5[_0x56916d];return _0x2b7f1f;};'use strict';var Sequelize=require(_0x558e('0x0'));module[_0x558e('0x1')]={'closed':{'type':Sequelize[_0x558e('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x558e('0x3')]},'ratingType':{'type':Sequelize[_0x558e('0x4')](_0x558e('0x5'),'thumb'),'defaultValue':_0x558e('0x5')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x558e('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x558e('0x6')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x558e('0x6')]},'note':{'type':Sequelize[_0x558e('0x6')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x558e('0x6')]},'deviceType':{'type':Sequelize[_0x558e('0x6')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x558e('0x6')]},'formData':{'type':Sequelize[_0x558e('0x7')](_0x558e('0x8'))},'read1stAt':{'type':Sequelize[_0x558e('0x9')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x558e('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x558e('0x6')]},'customerPort':{'type':Sequelize[_0x558e('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x558e('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0x558e('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index de0e0dc..2a2026f 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 _0x34e8=['ejs','lodash','squel','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','info','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','status','end','offset','limit','undefined','count','set','json','update','then','destroy','sendStatus','stack','name','send','render','body','contact','account','Users','TagIds','split','forEach','Tags','talking','unmanaged','abandoned','UserId','waiting','closed','disposition','answered','total','index','map','ChatInteraction','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','field','color','select','u.fullname','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','users','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','having','`\x20=\x200','`\x20>\x200','Contact','operator','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','start','Tag','$substring','some','compact','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','parse','$gte','$lte','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','group','i.id','Sequelize','QueryTypes','SELECT','clone','contactName','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','getChatWebsites','isEmpty','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.mandatoryDisposition','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','Contact.firstName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','push','show','params','includeAll','include','options','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooApiKey','follow','isNull','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','attachmentUpload','file','filename','mimetype','Attachment','Unauthorized','attachId','join','root','offline-chat/','basename','download','close','mailTranscript','server/files/chat/upload/','transcript-%s.txt','pathTranscript','ChatMessage','User','Messages','format','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','ids','omit','getMessages','nolimit','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','includeAgent','findAll','addTags','setTags','spread','emit','chatInteractionTags:save','removeTags','unix','tmp','server','files','attachments','transcript-%d-%s.zip','firstName','lastName','Account','Owner','get','mkdirSync','Chat','N.A.','closedAt','referer','customerIp','customerPort','tail','existsSync','pipe','createWriteStream','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x1b028a,_0x21a415){var _0x29913e=function(_0x8457da){while(--_0x8457da){_0x1b028a['push'](_0x1b028a['shift']());}};_0x29913e(++_0x21a415);}(_0x34e8,0x12c));var _0x834e=function(_0x2e6de0,_0x1483ea){_0x2e6de0=_0x2e6de0-0x0;var _0x39fff1=_0x34e8[_0x2e6de0];return _0x39fff1;};'use strict';var rimraf=require(_0x834e('0x0'));var zipdir=require(_0x834e('0x1'));var rp=require(_0x834e('0x2'));var moment=require(_0x834e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x834e('0x4'));var util=require(_0x834e('0x5'));var path=require(_0x834e('0x6'));var ejs=require(_0x834e('0x7'));var fs=require('fs');var _=require(_0x834e('0x8'));var squel=require(_0x834e('0x9'));var Redis=require(_0x834e('0xa'));var qs=require('../../components/parsers/qs');var as=require(_0x834e('0xb'));var pdf=require('../../components/export/pdf');var logger=require(_0x834e('0xc'))(_0x834e('0xd'));var config=require(_0x834e('0xe'));var db=require(_0x834e('0xf'))['db'];config[_0x834e('0x10')]=_[_0x834e('0x11')](config[_0x834e('0x10')],{'host':_0x834e('0x12'),'port':0x18eb});var socket=require(_0x834e('0x13'))(new Redis(config[_0x834e('0x10')]));require(_0x834e('0x14'))[_0x834e('0x15')](socket);var jayson=require(_0x834e('0x16'));var client=jayson[_0x834e('0x17')][_0x834e('0x18')]({'port':0x232b});var client9004=jayson[_0x834e('0x17')][_0x834e('0x18')]({'port':0x232c});function respondWithRpcPromise(_0x538bb3,_0x5e5b6d,_0x6cd9b9,_0x58a27e){return new BPromise(function(_0x23848e,_0x2d95f2){var _0x28e659=_0x58a27e||client;return _0x28e659[_0x834e('0x19')](_0x538bb3,_0x6cd9b9)['then'](function(_0x43156c){logger[_0x834e('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x5e5b6d,_0x834e('0x1b'));logger['debug'](_0x834e('0x1c'),_0x5e5b6d,_0x834e('0x1b'),JSON['stringify'](_0x43156c));if(_0x43156c[_0x834e('0x1d')]){if(_0x43156c[_0x834e('0x1d')][_0x834e('0x1e')]===0x1f4){logger['error'](_0x834e('0x1f'),_0x5e5b6d,_0x43156c[_0x834e('0x1d')][_0x834e('0x20')]);return _0x2d95f2(_0x43156c[_0x834e('0x1d')][_0x834e('0x20')]);}logger[_0x834e('0x1d')](_0x834e('0x1f'),_0x5e5b6d,_0x43156c['error'][_0x834e('0x20')]);return _0x23848e(_0x43156c[_0x834e('0x1d')][_0x834e('0x20')]);}else{logger[_0x834e('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x5e5b6d,_0x834e('0x1b'));_0x23848e(_0x43156c[_0x834e('0x21')]['message']);}})[_0x834e('0x22')](function(_0x28d687){logger[_0x834e('0x1d')]('ChatInteraction,\x20%s,\x20%s',_0x5e5b6d,_0x28d687);_0x2d95f2(_0x28d687);});});}function respondWithStatusCode(_0x4e3f48,_0x231619){_0x231619=_0x231619||0xcc;return function(_0x34563b){if(_0x34563b){return _0x4e3f48['sendStatus'](_0x231619);}return _0x4e3f48[_0x834e('0x23')](_0x231619)[_0x834e('0x24')]();};}function respondWithResult(_0x58f4fd,_0x3bc4f7){_0x3bc4f7=_0x3bc4f7||0xc8;return function(_0x2e1983){if(_0x2e1983){return _0x58f4fd[_0x834e('0x23')](_0x3bc4f7)['json'](_0x2e1983);}};}function respondWithFilteredResult(_0x24fcf7,_0x3e310f){return function(_0x5e1cc5){if(_0x5e1cc5){var _0x5bef62=typeof _0x3e310f[_0x834e('0x25')]==='undefined'&&typeof _0x3e310f[_0x834e('0x26')]===_0x834e('0x27');var _0x3db026=_0x5e1cc5[_0x834e('0x28')];var _0x3cd928=_0x5bef62?0x0:_0x3e310f[_0x834e('0x25')];var _0x491919=_0x5bef62?_0x5e1cc5['count']:_0x3e310f['offset']+_0x3e310f['limit'];var _0x2c7a8d;if(_0x491919>=_0x3db026){_0x491919=_0x3db026;_0x2c7a8d=0xc8;}else{_0x2c7a8d=0xce;}_0x24fcf7[_0x834e('0x23')](_0x2c7a8d);return _0x24fcf7[_0x834e('0x29')]('Content-Range',_0x3cd928+'-'+_0x491919+'/'+_0x3db026)[_0x834e('0x2a')](_0x5e1cc5);}return null;};}function saveUpdates(_0x11f1ce){return function(_0x1f3671){if(_0x1f3671){return _0x1f3671[_0x834e('0x2b')](_0x11f1ce)[_0x834e('0x2c')](function(_0x390119){return _0x390119;});}return null;};}function removeEntity(_0x3d149d){return function(_0xfaf716){if(_0xfaf716){return _0xfaf716[_0x834e('0x2d')]()['then'](function(){_0x3d149d[_0x834e('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c75c2){return function(_0x3787b0){if(!_0x3787b0){_0x2c75c2[_0x834e('0x2e')](0x194);}return _0x3787b0;};}function handleError(_0x2b3418,_0x444366){_0x444366=_0x444366||0x1f4;return function(_0x4689c2){logger[_0x834e('0x1d')](_0x4689c2[_0x834e('0x2f')]);if(_0x4689c2[_0x834e('0x30')]){delete _0x4689c2[_0x834e('0x30')];}_0x2b3418['status'](_0x444366)[_0x834e('0x31')](_0x4689c2);};}function getMustacheRender(_0x2f408a,_0x24a9df){return Mustache[_0x834e('0x32')](_0x2f408a,_['merge'](_0x24a9df[_0x834e('0x33')],{'contact':_0x24a9df[_0x834e('0x34')],'message':_0x24a9df['message'],'agent':_0x24a9df['agent'],'interaction':_0x24a9df['interaction'],'account':_0x24a9df[_0x834e('0x35')]}))||'';}function getInteractionUsers(_0x41bf4d,_0x20c6ae){return new BPromise(function(_0x34fefb,_0x339e28){try{if(_0x20c6ae[_0x41bf4d['id']]){_0x41bf4d[_0x834e('0x36')]=_['map'](_0x20c6ae[_0x41bf4d['id']],function(_0x2c2d94){return{'id':_0x2c2d94['id'],'fullname':_0x2c2d94['fullname']};});}}catch(_0xe103fe){_0x339e28(_0xe103fe);}_0x34fefb(_0x41bf4d);});}function getInteractionTags(_0x6a3ac,_0x47abed){return new BPromise(function(_0x18ac3b,_0x2f56c7){try{if(_0x6a3ac['TagIds']){_0x6a3ac['Tags']=[];_0x6a3ac[_0x834e('0x37')][_0x834e('0x38')](',')[_0x834e('0x39')](function(_0x130c23){_0x6a3ac[_0x834e('0x3a')]['push'](_0x47abed[_0x130c23]);});}delete _0x6a3ac[_0x834e('0x37')];}catch(_0x548d1d){_0x2f56c7(_0x548d1d);}_0x18ac3b(_0x6a3ac);});}function updateChatInteraction(_0x50c243,_0x1b2edf,_0x4a7f76){return new BPromise(function(_0x2e5239,_0x1ba66d){return getInteractionUsers(_0x50c243,_0x4a7f76)[_0x834e('0x2c')](function(_0x3c59af){return getInteractionTags(_0x3c59af,_0x1b2edf);})[_0x834e('0x2c')](function(_0x574ea8){return getStateInteraction(_0x574ea8);})[_0x834e('0x2c')](function(_0x26b847){_0x2e5239(_0x26b847);})[_0x834e('0x22')](function(_0x58c5fb){_0x1ba66d(_0x58c5fb);});});}function getStateInteraction(_0x35380e){return new BPromise(function(_0x16ac45){_0x35380e['waiting']=0x0;_0x35380e[_0x834e('0x3b')]=0x0;_0x35380e['answered']=0x0;_0x35380e[_0x834e('0x3c')]=0x0;_0x35380e[_0x834e('0x3d')]=0x0;_0x35380e['total']=0x0;if(!_0x35380e['closed']&&!_0x35380e[_0x834e('0x3e')]){_0x35380e[_0x834e('0x3f')]+=0x1;}if(!_0x35380e[_0x834e('0x40')]&&_0x35380e[_0x834e('0x3e')]){_0x35380e[_0x834e('0x3b')]+=0x1;if(_0x35380e[_0x834e('0x3f')]){_0x35380e[_0x834e('0x3f')]-=0x1;}}if(_0x35380e['closed']&&_0x35380e[_0x834e('0x41')]==='abandoned'){_0x35380e[_0x834e('0x3d')]+=0x1;if(_0x35380e['waiting']){_0x35380e[_0x834e('0x3f')]-=0x1;}}else if(_0x35380e['closed']&&!_0x35380e[_0x834e('0x3e')]&&_0x35380e[_0x834e('0x41')]){_0x35380e['unmanaged']+=0x1;if(_0x35380e[_0x834e('0x3f')]){_0x35380e[_0x834e('0x3f')]-=0x1;}}else if(_0x35380e[_0x834e('0x40')]&&_0x35380e[_0x834e('0x3e')]){_0x35380e[_0x834e('0x42')]+=0x1;if(_0x35380e[_0x834e('0x3b')]){_0x35380e[_0x834e('0x3b')]-=0x1;}}_0x35380e[_0x834e('0x43')]+=0x1;_0x16ac45(_0x35380e);});}exports[_0x834e('0x44')]=function(_0x279ea1,_0x5f3943){var _0x3124be={},_0x6fff27={},_0x47a8a9={'count':0x0,'rows':[]};var _0x112306=_[_0x834e('0x45')](db[_0x834e('0x46')][_0x834e('0x47')],function(_0x19b5ef){return{'name':_0x19b5ef[_0x834e('0x48')],'type':_0x19b5ef['type']['key']};});_0x6fff27[_0x834e('0x49')]=_[_0x834e('0x45')](_0x112306,_0x834e('0x30'));_0x6fff27[_0x834e('0x4a')]=_[_0x834e('0x4b')](_0x279ea1[_0x834e('0x4a')]);_0x6fff27[_0x834e('0x4c')]=_[_0x834e('0x4d')](_0x6fff27[_0x834e('0x49')],_0x6fff27[_0x834e('0x4a')]);_0x3124be[_0x834e('0x4e')]=_[_0x834e('0x4d')](_0x6fff27[_0x834e('0x49')],qs[_0x834e('0x4f')](_0x279ea1[_0x834e('0x4a')][_0x834e('0x4f')]));_0x3124be[_0x834e('0x4e')]=_0x3124be[_0x834e('0x4e')][_0x834e('0x50')]?_0x3124be[_0x834e('0x4e')]:_0x6fff27['model'];if(!_0x279ea1[_0x834e('0x4a')][_0x834e('0x51')]('nolimit')){_0x3124be[_0x834e('0x26')]=qs[_0x834e('0x26')](_0x279ea1['query'][_0x834e('0x26')]);_0x3124be[_0x834e('0x25')]=qs[_0x834e('0x25')](_0x279ea1[_0x834e('0x4a')][_0x834e('0x25')]);}_0x3124be[_0x834e('0x52')]=qs[_0x834e('0x53')](_0x279ea1['query'][_0x834e('0x53')]);_0x3124be[_0x834e('0x54')]=qs[_0x834e('0x4c')](_[_0x834e('0x55')](_0x279ea1[_0x834e('0x4a')],_0x6fff27[_0x834e('0x4c')]),_0x112306);var _0x344b51=[];var _0x1bc975=squel['select']()[_0x834e('0x56')]('id')['field'](_0x834e('0x30'))['field'](_0x834e('0x57'))['from']('tools_tags');var _0x6c0b29=squel[_0x834e('0x58')]()['field']('u.id')[_0x834e('0x56')](_0x834e('0x59'))[_0x834e('0x56')](_0x834e('0x5a'))[_0x834e('0x5b')](_0x834e('0x5c'),'ui')[_0x834e('0x5d')](_0x834e('0x5e'),'u','u.id\x20=\x20ui.UserId');var _0x142334=squel[_0x834e('0x58')]()['from'](_0x834e('0x5f'),'i')['left_join'](_0x834e('0x60'),'c',_0x834e('0x61'))['left_join'](_0x834e('0x5e'),'o',_0x834e('0x62'))[_0x834e('0x5d')](_0x834e('0x63'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0x834e('0x5d')](_0x834e('0x64'),'me',_0x834e('0x65'))['left_join'](_0x834e('0x66'),'it',_0x834e('0x67'))[_0x834e('0x5d')](_0x834e('0x68'),'t',_0x834e('0x69'));var _0x125f37=squel[_0x834e('0x6a')]();var _0x1def00=[];var _0x208c21=squel[_0x834e('0x6a')]();var _0x1e4310;if(_0x279ea1[_0x834e('0x4a')][_0x834e('0x6b')]){_0x1e4310=as[_0x834e('0x6c')](_0x279ea1[_0x834e('0x4a')][_0x834e('0x6b')]);var _0x297cce=_0x1e4310[_0x834e('0x6d')];for(var _0x193a15=0x0;_0x193a15<_0x1e4310[_0x834e('0x6e')][_0x834e('0x50')];_0x193a15++){var _0x2cb233=_0x1e4310['conditions'][_0x193a15];var _0x2145cf='i';var _0x25d6f4=_[_0x834e('0x6f')](_0x112306,[_0x834e('0x30'),_0x2cb233['field']]);if(!_0x25d6f4){switch(_0x2cb233[_0x834e('0x56')]){case'unreadMessages':if(_0x2cb233['value']==0x1){_0x142334[_0x834e('0x70')]('`'+_0x2cb233[_0x834e('0x56')]+_0x834e('0x71'));}else{_0x142334[_0x834e('0x70')]('`'+_0x2cb233[_0x834e('0x56')]+_0x834e('0x72'));}break;case _0x834e('0x73'):if(_0x2cb233[_0x834e('0x74')]==='$substring'){if(_0x2cb233[_0x834e('0x75')]['split']('\x20')[_0x834e('0x50')]>0x1){_0x125f37[_0x297cce](_0x834e('0x76'),qs['getFullTextValue'](_0x2cb233['value']),null);}else{var _0x4a4def='%'+_0x2cb233[_0x834e('0x75')]+'%';_0x125f37[_0x297cce](_0x834e('0x77'),_0x4a4def,_0x4a4def,_0x4a4def);}}else{_0x25d6f4=_[_0x834e('0x6f')](_0x112306,[_0x834e('0x30'),'ContactId']);_0x2cb233[_0x834e('0x56')]=_0x834e('0x78');_0x11f6f0=as[_0x834e('0x79')](_0x2145cf,_0x25d6f4[_0x834e('0x7a')],_0x2cb233);_0x125f37[_0x297cce](_0x11f6f0[_0x834e('0x7b')],_0x11f6f0[_0x834e('0x75')][_0x834e('0x7c')],_0x11f6f0[_0x834e('0x75')][_0x834e('0x24')]);}break;case _0x834e('0x7d'):var _0x5b2bf6=_0x2cb233[_0x834e('0x75')][_0x834e('0x38')](',')[_0x834e('0x45')](function(_0x5b5d6f){return Number(_0x5b5d6f);});_0x5b2bf6['forEach'](function(_0x46fa0d){_0x208c21['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x46fa0d+',%');});_0x1def00=_['union'](_0x1def00,_0x5b2bf6);break;case'User':if(_0x2cb233[_0x834e('0x74')]===_0x834e('0x7e')){_0x125f37[_0x297cce]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x2cb233[_0x834e('0x75')]+'%',null);}else{_0x25d6f4=_[_0x834e('0x6f')](_0x112306,['name',_0x834e('0x3e')]);_0x2cb233[_0x834e('0x56')]='UserId';_0x11f6f0=as['buildExpression'](_0x2145cf,_0x25d6f4[_0x834e('0x7a')],_0x2cb233);_0x125f37[_0x297cce](_0x11f6f0[_0x834e('0x7b')],_0x11f6f0[_0x834e('0x75')][_0x834e('0x7c')],_0x11f6f0[_0x834e('0x75')]['end']);}break;case _0x834e('0x33'):_0x11f6f0=as['buildExpression']('me',null,_0x2cb233);_0x125f37[_0x297cce](_0x11f6f0[_0x834e('0x7b')],_0x11f6f0[_0x834e('0x75')][_0x834e('0x7c')],_0x11f6f0['value'][_0x834e('0x24')]);break;}}else{var _0x11f6f0=as['buildExpression'](_0x2145cf,_0x25d6f4[_0x834e('0x7a')],_0x2cb233);_0x125f37[_0x297cce](_0x11f6f0[_0x834e('0x7b')],_0x11f6f0[_0x834e('0x75')]['start'],_0x11f6f0[_0x834e('0x75')][_0x834e('0x24')]);}}}else{var _0x402692=_(_0x279ea1[_0x834e('0x4a')])[_0x834e('0x4b')]()[_0x834e('0x45')](function(_0x1372dd){return _[_0x834e('0x7f')](_0x112306,[_0x834e('0x30'),_0x1372dd])?_0x1372dd:undefined;})[_0x834e('0x80')]()['value']();if(!_['isEmpty'](_0x402692)){_0x402692['forEach'](function(_0x36ede9){if(_0x36ede9===_0x834e('0x81')){_0x142334[_0x834e('0x54')](_0x834e('0x82'),[][_0x834e('0x83')](_0x279ea1['query'][_0x36ede9]));}else if(_0x36ede9==='createdAt'){var _0x4520fc=JSON[_0x834e('0x84')](_0x279ea1[_0x834e('0x4a')][_0x36ede9])[_0x834e('0x85')];var _0x40a705=JSON['parse'](_0x279ea1[_0x834e('0x4a')][_0x36ede9])[_0x834e('0x86')];_0x142334[_0x834e('0x54')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4520fc,_0x40a705);}else{if(_0x279ea1[_0x834e('0x4a')][_0x36ede9]===_0x834e('0x87')){_0x142334[_0x834e('0x54')]('i.'+_0x36ede9+_0x834e('0x88'));}else{_0x142334[_0x834e('0x54')]('i.'+_0x36ede9+'\x20=\x20?',_0x279ea1['query'][_0x36ede9]);}}});}if(_0x279ea1[_0x834e('0x4a')][_0x834e('0x89')]){if(_0x279ea1['query'][_0x834e('0x89')]==0x1){_0x142334['having'](_0x834e('0x8a'));}else{_0x142334[_0x834e('0x70')](_0x834e('0x8b'));}}if(_0x279ea1['query'][_0x834e('0x8c')]){_0x1def00=_['isArray'](_0x279ea1['query']['tag'])?_0x279ea1[_0x834e('0x4a')][_0x834e('0x8c')]:new Array(_0x279ea1[_0x834e('0x4a')][_0x834e('0x8c')]);_0x1def00[_0x834e('0x39')](function(_0x2dad55){_0x208c21['or'](_0x834e('0x8d'),'%,'+_0x2dad55+',%');});}if(_0x279ea1[_0x834e('0x4a')][_0x834e('0x8e')]){var _0x53f6e3=_0x279ea1[_0x834e('0x4a')]['filter'][_0x834e('0x8f')]('\x5c','\x5c\x5c')[_0x834e('0x8f')](/'/g,'\x27\x27');if(qs[_0x834e('0x90')](_0x53f6e3)){_0x125f37['or'](_0x834e('0x91'),_0x53f6e3+'%');}else{_0x125f37['or'](_0x834e('0x92'),qs[_0x834e('0x93')](_0x53f6e3))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x53f6e3+'%');}}}_0x142334['where'](_0x125f37);_0x142334[_0x834e('0x94')](_0x834e('0x95'));var _0x4eff8d={'type':db[_0x834e('0x96')][_0x834e('0x97')][_0x834e('0x98')],'raw':!![]};var _0x1e225f=_0x142334[_0x834e('0x99')]();_0x1e225f['field'](_0x834e('0x95'));_0x1e225f[_0x834e('0x56')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x3124be['order']){_0x3124be[_0x834e('0x52')][_0x834e('0x39')](function(_0x4f716d){var _0x23ce49=_0x4f716d[0x0]===_0x834e('0x9a')?_0x4f716d[0x0]:'i.'+_0x4f716d[0x0];_0x142334['order'](_0x23ce49,_0x4f716d[0x1]===_0x834e('0x9b')?![]:!![]);});}if(!_['isEmpty'](_0x1def00)){_0x142334['having'](_0x208c21);_0x1e225f[_0x834e('0x54')](_0x834e('0x9c'),_0x1def00);}BPromise[_0x834e('0x9d')]()[_0x834e('0x2c')](function(){if(!_0x1e4310){if(_0x279ea1['query'][_0x834e('0x81')])return;_0x1e225f[_0x834e('0x54')](_0x834e('0x9e'));_0x142334[_0x834e('0x54')](_0x834e('0x9e'));return;}if(_0x279ea1[_0x834e('0x9f')][_0x834e('0xa0')]!==_0x834e('0xa1'))return;return _0x279ea1[_0x834e('0x9f')][_0x834e('0xa2')]({'attributes':['id'],'raw':!![]})[_0x834e('0x2c')](function(_0x261e3d){if(_[_0x834e('0xa3')](_0x261e3d)){_0x1e225f[_0x834e('0x54')](_0x834e('0xa4'));_0x142334[_0x834e('0x54')](_0x834e('0xa4'));}else{_0x1e225f[_0x834e('0x54')](_0x834e('0x82'),_[_0x834e('0x45')](_0x261e3d,'id'));_0x142334[_0x834e('0x54')](_0x834e('0x82'),_['map'](_0x261e3d,'id'));}});})[_0x834e('0x2c')](function(){if(_0x279ea1[_0x834e('0x9f')][_0x834e('0xa0')]===_0x834e('0xa1')&&!_0x1e4310&&!_0x279ea1[_0x834e('0x4a')][_0x834e('0x81')])return[];return db[_0x834e('0xa5')][_0x834e('0x4a')](_0x1e225f[_0x834e('0xa6')](),_0x4eff8d);})['then'](function(_0x5ce790){_0x47a8a9['count']=_0x5ce790[_0x834e('0x50')];if(_0x47a8a9['count']===0x0)return[];return db[_0x834e('0xa5')][_0x834e('0x4a')](_0x1bc975[_0x834e('0xa6')](),_0x4eff8d)['then'](function(_0xae00f){_0x344b51=_[_0x834e('0xa7')](_0xae00f,'id');_0x4eff8d=_[_0x834e('0xa8')](_0x4eff8d,{'model':db[_0x834e('0x46')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x279ea1[_0x834e('0x4a')][_0x834e('0x4f')]){_0x3124be['attributes'][_0x834e('0x39')](function(_0x27bd2e){_0x142334[_0x834e('0x56')]('i.'+_0x27bd2e);});}else{_0x142334[_0x834e('0x56')](_0x834e('0xa9'),'unreadMessages');_0x142334['field']('a.key','Account.key');_0x142334[_0x834e('0x56')](_0x834e('0xaa'),'Account.mandatoryDisposition');_0x142334[_0x834e('0x56')](_0x834e('0xab'),'contactName');_0x142334[_0x834e('0x56')](_0x834e('0xac'));_0x142334[_0x834e('0x56')](_0x834e('0xad'),_0x834e('0xae'));_0x142334[_0x834e('0x56')]('c.lastName','Contact.lastName');_0x142334[_0x834e('0x56')](_0x834e('0xaf'),_0x834e('0xb0'));_0x142334['field'](_0x834e('0xb1'),_0x834e('0xb2'));_0x142334['field'](_0x834e('0xb3'),_0x834e('0xb4'));_0x142334[_0x834e('0x56')](_0x834e('0xb5'),'Contact.fax');_0x142334[_0x834e('0x56')]('o.fullname','Owner.fullname');_0x142334[_0x834e('0x56')](_0x834e('0xb6'),_0x834e('0xb7'));_0x142334[_0x834e('0x56')](_0x834e('0xb8'),_0x834e('0x37'));}if(_0x3124be['limit'])_0x142334['limit'](_0x3124be[_0x834e('0x26')]);if(_0x3124be[_0x834e('0x25')])_0x142334[_0x834e('0x25')](_0x3124be[_0x834e('0x25')]);return db[_0x834e('0xa5')][_0x834e('0x4a')](_0x142334[_0x834e('0xa6')](),_0x4eff8d);})['then'](function(_0x435a75){if(_0x435a75[_0x834e('0x50')]>0x0)_0x6c0b29['where'](_0x834e('0xb9'),_[_0x834e('0x45')](_0x435a75,'id'));return db[_0x834e('0xa5')][_0x834e('0x4a')](_0x6c0b29[_0x834e('0xa6')](),_0x4eff8d)[_0x834e('0x2c')](function(_0x231f0b){var _0x3b44f3=_[_0x834e('0xba')](_0x231f0b,_0x834e('0xbb'));var _0x496709=[];_0x435a75[_0x834e('0x39')](function(_0x17e922){_0x496709[_0x834e('0xbc')](updateChatInteraction(_0x17e922,_0x344b51,_0x3b44f3));});return BPromise['all'](_0x496709);});});})[_0x834e('0x2c')](function(_0x20fdfd){_0x47a8a9['rows']=_0x20fdfd;return _0x47a8a9;})[_0x834e('0x2c')](respondWithFilteredResult(_0x5f3943,_0x3124be))['catch'](handleError(_0x5f3943,null));};exports[_0x834e('0xbd')]=function(_0x53c483,_0x16a42b){var _0x560d10={'raw':![],'where':{'id':_0x53c483[_0x834e('0xbe')]['id']}},_0x2b6d1={};_0x2b6d1[_0x834e('0x49')]=_[_0x834e('0x4b')](db['ChatInteraction'][_0x834e('0x47')]);_0x2b6d1[_0x834e('0x4a')]=_[_0x834e('0x4b')](_0x53c483[_0x834e('0x4a')]);_0x2b6d1[_0x834e('0x4c')]=_[_0x834e('0x4d')](_0x2b6d1[_0x834e('0x49')],_0x2b6d1[_0x834e('0x4a')]);_0x560d10[_0x834e('0x4e')]=_[_0x834e('0x4d')](_0x2b6d1[_0x834e('0x49')],qs[_0x834e('0x4f')](_0x53c483[_0x834e('0x4a')][_0x834e('0x4f')]));_0x560d10[_0x834e('0x4e')]=_0x560d10[_0x834e('0x4e')][_0x834e('0x50')]?_0x560d10['attributes']:_0x2b6d1['model'];if(_0x53c483[_0x834e('0x4a')][_0x834e('0xbf')]){_0x560d10[_0x834e('0xc0')]=[{'all':!![]}];}_0x560d10=_[_0x834e('0xa8')]({},_0x560d10,_0x53c483[_0x834e('0xc1')]);return db[_0x834e('0x46')][_0x834e('0x6f')](_0x560d10)[_0x834e('0x2c')](handleEntityNotFound(_0x16a42b,null))[_0x834e('0x2c')](respondWithResult(_0x16a42b,null))[_0x834e('0x22')](handleError(_0x16a42b,null));};exports[_0x834e('0xc2')]=function(_0x32645e,_0x513d9e){return db[_0x834e('0x46')]['create'](_0x32645e[_0x834e('0x33')],{})[_0x834e('0x2c')](respondWithResult(_0x513d9e,0xc9))[_0x834e('0x22')](handleError(_0x513d9e,null));};exports['update']=function(_0x1a65b4,_0x23a386){if(_0x1a65b4['body']['id']){delete _0x1a65b4['body']['id'];}return db[_0x834e('0x46')][_0x834e('0x6f')]({'where':{'id':_0x1a65b4['params']['id']}})[_0x834e('0x2c')](handleEntityNotFound(_0x23a386,null))[_0x834e('0x2c')](saveUpdates(_0x1a65b4[_0x834e('0x33')],null))[_0x834e('0x2c')](respondWithResult(_0x23a386,null))[_0x834e('0x22')](handleError(_0x23a386,null));};exports['destroy']=function(_0x4e7545,_0x453e58){return db['ChatInteraction']['find']({'where':{'id':_0x4e7545['params']['id']}})[_0x834e('0x2c')](handleEntityNotFound(_0x453e58,null))[_0x834e('0x2c')](removeEntity(_0x453e58,null))['catch'](handleError(_0x453e58,null));};exports[_0x834e('0xc3')]=function(_0x66cbdc,_0x470568){return db[_0x834e('0x46')]['describe']()[_0x834e('0x2c')](respondWithResult(_0x470568,null))[_0x834e('0x22')](handleError(_0x470568,null));};exports[_0x834e('0xc4')]=function(_0x5633f4,_0x3d8af7){var _0x5f3b7d=_0x5633f4[_0x834e('0xbe')]['id'];var _0x4af2a2;var _0x461420;var _0x108100;return db['ChatInteraction'][_0x834e('0xc5')]({'where':{'id':_0x5f3b7d}})[_0x834e('0x2c')](function(_0x41e7a8){_0x4af2a2=_0x41e7a8;return db[_0x834e('0xc6')][_0x834e('0xc5')]({'where':{'id':_0x41e7a8[_0x834e('0x81')]},'attributes':['id','vidaooApiKey',_0x834e('0xc7'),_0x834e('0xc8'),_0x834e('0xc9'),_0x834e('0xca')],'raw':!![]});})[_0x834e('0x2c')](function(_0x1b8e67){if(_0x1b8e67&&_0x1b8e67['vidaooApiKey']&&_0x1b8e67[_0x834e('0xc7')]){_0x461420=_0x1b8e67;var _0x490a57={'interaction':{'id':_0x5f3b7d},'agent':{'id':_0x5633f4['user']['id'],'name':_0x5633f4[_0x834e('0x9f')]['name'],'fullname':_0x5633f4['user'][_0x834e('0xcb')],'email':_0x5633f4[_0x834e('0x9f')][_0x834e('0xcc')]},'contact':_0x5633f4[_0x834e('0x33')][_0x834e('0x34')],'account':_0x5633f4[_0x834e('0x33')][_0x834e('0x35')]};var _0x155f2d={'rejectUnauthorized':![],'method':_0x834e('0xcd'),'url':_0x834e('0xce'),'headers':{'X-APIKEY':_0x1b8e67[_0x834e('0xcf')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x5633f4[_0x834e('0x9f')][_0x834e('0xcc')]],'buttons':null,'topic':_0x461420[_0x834e('0xc8')],'note':_['isNull'](_0x461420[_0x834e('0xc9')])?null:getMustacheRender(_0x461420['vidaooNote'],_0x490a57),'metadata':null},'redirect':_0x834e('0xd0'),'json':!![]};try{if(!_[_0x834e('0xd1')](_0x461420[_0x834e('0xca')])){var _0x2cdbe0=getMustacheRender(_0x461420['vidaooMetadata'],_0x490a57);var _0x5f558a=JSON[_0x834e('0x84')](_0x2cdbe0);_0x155f2d[_0x834e('0x33')]['metadata']=_0x5f558a;}}catch(_0x375c35){throw new db[(_0x834e('0x96'))]['ValidationError'](_0x834e('0xd2'));}return rp(_0x155f2d);}else{throw new db[(_0x834e('0x96'))][(_0x834e('0xd3'))](_0x834e('0xd4'));}})['then'](function(_0x57ff06){_0x108100=_0x57ff06;if(_0x108100['id']){var _0x4ead1d={'body':_0x108100['join_url'],'ChatWebsiteId':_0x461420['id'],'ChatInteractionId':_0x4af2a2['id'],'direction':_0x834e('0xd5'),'UserId':_0x5633f4[_0x834e('0x9f')]['id']};return db['ChatMessage'][_0x834e('0xc2')](_0x4ead1d,{});}else{throw new db['Sequelize'][(_0x834e('0xd3'))](_0x834e('0xd6'));}})[_0x834e('0x2c')](function(){return _0x4af2a2[_0x834e('0xd7')]({'vidaooSessionId':_0x108100['id']});})[_0x834e('0x2c')](respondWithResult(_0x3d8af7,null))[_0x834e('0x22')](handleError(_0x3d8af7,null));};exports[_0x834e('0xd8')]=function(_0x4fc61d,_0x12a0f3){if(_0x4fc61d[_0x834e('0x33')]['id']){delete _0x4fc61d['body']['id'];}return db[_0x834e('0x46')][_0x834e('0x6f')]({'where':{'id':_0x4fc61d['params']['id']},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0x834e('0x2c')](handleEntityNotFound(_0x12a0f3,null))[_0x834e('0x2c')](saveUpdates(_0x4fc61d[_0x834e('0x33')],null))['then'](respondWithResult(_0x12a0f3,null))[_0x834e('0x22')](handleError(_0x12a0f3,null));};exports[_0x834e('0xd9')]=function(_0xbd0346,_0x17e729){if(_0xbd0346[_0x834e('0x33')]['id']){delete _0xbd0346[_0x834e('0x33')]['id'];}return db[_0x834e('0x46')][_0x834e('0x6f')]({'where':{'id':_0xbd0346[_0x834e('0xbe')]['id']}})[_0x834e('0x2c')](function(_0x48b6c4){if(!_0x48b6c4){logger['error'](_0x834e('0xda'),_0x834e('0xd9'),0x194,_0x834e('0xdb'));_0x17e729[_0x834e('0x2e')](0x194);}else{if(_0x48b6c4[_0x834e('0x3e')]){throw new db[(_0x834e('0x96'))][(_0x834e('0xd3'))](_0x834e('0xdc'));}}return _0x48b6c4;})[_0x834e('0x2c')](function(_0x97a4b2){if(_0x97a4b2){return _0x97a4b2[_0x834e('0x2b')]({'closed':_0xbd0346[_0x834e('0x33')][_0x834e('0x40')],'disposition':_0xbd0346['body'][_0x834e('0x41')]})[_0x834e('0x2c')](function(_0x3f5b2e){return _0x3f5b2e;});}})[_0x834e('0x2c')](function(){return respondWithRpcPromise('AbandonInteraction','abandon',_0xbd0346['body'],client9004);})[_0x834e('0x2c')](respondWithResult(_0x17e729,null))[_0x834e('0x22')](handleError(_0x17e729,null));};exports[_0x834e('0xdd')]=function(_0x23d7e6,_0x181ecd){_0x23d7e6[_0x834e('0x33')][_0x834e('0x30')]=_0x23d7e6[_0x834e('0xde')]['originalname'];_0x23d7e6['body']['basename']=_0x23d7e6['file'][_0x834e('0xdf')];_0x23d7e6[_0x834e('0x33')][_0x834e('0x7a')]=_0x23d7e6[_0x834e('0xde')][_0x834e('0xe0')];return db[_0x834e('0xe1')][_0x834e('0xc2')](_0x23d7e6[_0x834e('0x33')])[_0x834e('0x2c')](respondWithResult(_0x181ecd,0xc9))['catch'](handleError(_0x181ecd,null));};exports['attachmentDownload']=function(_0x4d1545,_0x5dc651){return db[_0x834e('0x46')][_0x834e('0xc5')]({'where':{'id':_0x4d1545[_0x834e('0xbe')]['id']},'raw':!![]})[_0x834e('0x2c')](handleEntityNotFound(_0x5dc651,null))[_0x834e('0x2c')](function(_0xcb9751){if(_0xcb9751){if(_0xcb9751[_0x834e('0x40')]){return _0x5dc651[_0x834e('0x23')](0x193)[_0x834e('0x2a')]({'status':0x193,'message':_0x834e('0xe2')});}return db[_0x834e('0xe1')][_0x834e('0xc5')]({'where':{'id':_0x4d1545[_0x834e('0x4a')][_0x834e('0xe3')]},'raw':!![]})[_0x834e('0x2c')](handleEntityNotFound(_0x5dc651,null));}})[_0x834e('0x2c')](function(_0x5022f2){if(_0x5022f2){var _0x13f473=_0x5022f2['ChatOfflineMessageId']!==null;var _0x1f6bb9=path[_0x834e('0xe4')](config[_0x834e('0xe5')],'server/files/attachments/');if(_0x13f473){_0x1f6bb9=path[_0x834e('0xe4')](_0x1f6bb9,_0x834e('0xe6'));}var _0x4d7fef=path['join'](_0x1f6bb9,_0x5022f2[_0x834e('0xe7')]);return _0x5dc651[_0x834e('0xe8')](_0x4d7fef);}})[_0x834e('0x22')](handleError(_0x5dc651,null));};exports[_0x834e('0xe9')]=function(_0x12d468,_0x2e9116){var _0x3eb2e8=null;var _0x239a4e=null;var _0x569a80=null;if(_0x12d468[_0x834e('0x33')]['id']){delete _0x12d468[_0x834e('0x33')]['id'];}if(_0x12d468[_0x834e('0x33')][_0x834e('0xea')]){_0x569a80=path[_0x834e('0xe4')](config[_0x834e('0xe5')],_0x834e('0xeb'),util['format'](_0x834e('0xec'),Date['now']()));_0x12d468['body'][_0x834e('0xed')]=_0x569a80;}return db[_0x834e('0x46')]['find']({'where':{'id':_0x12d468[_0x834e('0xbe')]['id']},'include':[{'model':db[_0x834e('0xee')],'as':'Messages','include':[{'model':db[_0x834e('0xef')],'as':_0x834e('0xef')}]}]})['then'](handleEntityNotFound(_0x2e9116,null))['then'](saveUpdates(_0x12d468[_0x834e('0x33')],null))[_0x834e('0x2c')](function(_0x4e6525){if(_0x4e6525){_0x3eb2e8=_0x4e6525;return db['ChatWebsite'][_0x834e('0x6f')]({'where':{'id':_0x3eb2e8[_0x834e('0x81')]}});}})['then'](function(_0x480290){if(_0x480290){_0x239a4e=_0x480290;return db['CmContact']['find']({'where':{'id':_0x3eb2e8[_0x834e('0x78')]}});}})['then'](function(_0x3be4c3){if(_0x3be4c3){if(_0x569a80){var _0x52cdcc=null;for(var _0x343348=0x1;_0x343348<_0x3eb2e8[_0x834e('0xf0')][_0x834e('0x50')];++_0x343348){_0x52cdcc=_0x3eb2e8[_0x834e('0xf0')][_0x343348];var _0x4fabe6=_0x52cdcc[_0x834e('0x3e')]?util[_0x834e('0xf1')](_0x834e('0xf2'),_0x239a4e[_0x834e('0xf3')],_0x52cdcc[_0x834e('0x3e')]):_0x834e('0xf4');var _0x3d8abb=_0x12d468[_0x834e('0x33')][_0x834e('0xf5')]||util[_0x834e('0xf1')]('%s%d',_0x834e('0xf6'),_0x52cdcc['ContactId']);switch(_0x239a4e[_0x834e('0xf7')]){case _0x834e('0xf8'):_0x4fabe6=_0x52cdcc[_0x834e('0x3e')]?util[_0x834e('0xf1')](_0x834e('0xf2'),_0x239a4e['agentAlias'],_0x52cdcc[_0x834e('0x3e')]):'System';break;case'agent_alias':_0x4fabe6=_0x52cdcc[_0x834e('0x3e')]?_0x52cdcc[_0x834e('0xef')][_0x834e('0xf9')]||_0x52cdcc['User'][_0x834e('0xcb')]:_0x834e('0xf4');break;case _0x834e('0xfa'):_0x4fabe6=_0x52cdcc[_0x834e('0x3e')]?_0x52cdcc[_0x834e('0xef')][_0x834e('0xcb')]:_0x834e('0xf4');break;default:_0x4fabe6=_0x52cdcc[_0x834e('0x3e')]?util[_0x834e('0xf1')](_0x834e('0xf2'),_0x239a4e[_0x834e('0xf3')],_0x52cdcc['UserId']):_0x834e('0xf4');}var _0x121d87=util[_0x834e('0xf1')](_0x834e('0xfb'),moment(_0x52cdcc[_0x834e('0xfc')])[_0x834e('0xf1')]('MM/DD/YYYY\x20HH:mm:ss'),_0x52cdcc[_0x834e('0xfd')]==='in'?_0x3d8abb:_0x4fabe6,_0x52cdcc[_0x834e('0x33')]);if(!_0x52cdcc[_0x834e('0xfe')]){fs[_0x834e('0xff')](_0x569a80,_0x121d87);}}return db[_0x834e('0x100')][_0x834e('0xc5')]({'where':{'service':!![]},'include':[{'model':db[_0x834e('0x101')],'as':_0x834e('0x102'),'raw':!![],'include':[{'model':db[_0x834e('0x103')],'as':_0x834e('0x103'),'raw':!![]}]}]});}}})['then'](function(_0x571645){if(!_0x571645||!_0x571645[_0x834e('0x102')]||!_0x12d468['body'])return _0x3eb2e8;var _0x4094d5=_0x571645[_0x834e('0x104')]();return respondWithRpcPromise(_0x834e('0x105'),_0x834e('0x106'),{'account':_0x4094d5,'message':{'from':util[_0x834e('0xf1')](_0x834e('0x107'),_0x571645['name'],_0x571645[_0x834e('0xcc')]||_0x571645['Smtp']['user']),'to':_0x12d468['body'][_0x834e('0xea')],'subject':_0x834e('0x108'),'text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x12d468['body'][_0x834e('0xea')]),'attachments':[{'path':_0x569a80}]}})[_0x834e('0x2c')](function(){return _0x3eb2e8;})[_0x834e('0x22')](function(_0x5e0bfe){logger[_0x834e('0x1d')](_0x5e0bfe);});})[_0x834e('0x2c')](respondWithStatusCode(_0x2e9116,0xc8))[_0x834e('0x22')](handleError(_0x2e9116,null));};exports[_0x834e('0x109')]=function(_0xb9635a,_0x3c1a19){return db['ChatMessage']['find']({'where':{'id':_0xb9635a['params']['id']}})['then'](handleEntityNotFound(_0x3c1a19,null))[_0x834e('0x2c')](function(_0xf82ca8){if(_0xf82ca8){return _0xf82ca8[_0x834e('0x109')](_0xb9635a[_0x834e('0x33')][_0x834e('0x10a')],_[_0x834e('0x10b')](_0xb9635a[_0x834e('0x33')],[_0x834e('0x10a'),'id'])||{});}})[_0x834e('0x2c')](respondWithResult(_0x3c1a19,null))[_0x834e('0x22')](handleError(_0x3c1a19,null));};exports[_0x834e('0x10c')]=function(_0x18735a,_0x3446ff){var _0x1e11e0={'raw':![],'where':{}};var _0x38796c={};var _0x59bd0e={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x834e('0xc5')]({'where':{'id':_0x18735a[_0x834e('0xbe')]['id']}})[_0x834e('0x2c')](handleEntityNotFound(_0x3446ff,null))['then'](function(_0xf89b9e){if(_0xf89b9e){_0x38796c[_0x834e('0x49')]=_[_0x834e('0x4b')](db[_0x834e('0xee')][_0x834e('0x47')]);_0x38796c[_0x834e('0x4a')]=_[_0x834e('0x4b')](_0x18735a[_0x834e('0x4a')]);_0x38796c[_0x834e('0x4c')]=_['intersection'](_0x38796c[_0x834e('0x49')],_0x38796c[_0x834e('0x4a')]);_0x1e11e0[_0x834e('0x4e')]=_[_0x834e('0x4d')](_0x38796c['model'],qs[_0x834e('0x4f')](_0x18735a[_0x834e('0x4a')][_0x834e('0x4f')]));_0x1e11e0[_0x834e('0x4e')]=_0x1e11e0[_0x834e('0x4e')][_0x834e('0x50')]?_0x1e11e0[_0x834e('0x4e')]:_0x38796c[_0x834e('0x49')];if(!_0x18735a[_0x834e('0x4a')]['hasOwnProperty'](_0x834e('0x10d'))){_0x1e11e0['limit']=qs[_0x834e('0x26')](_0x18735a['query'][_0x834e('0x26')]);_0x1e11e0[_0x834e('0x25')]=qs[_0x834e('0x25')](_0x18735a[_0x834e('0x4a')][_0x834e('0x25')]);}_0x1e11e0['order']=qs[_0x834e('0x53')](_0x18735a[_0x834e('0x4a')]['sort']);_0x1e11e0['where']=qs[_0x834e('0x4c')](_['pick'](_0x18735a['query'],_0x38796c['filters']));_0x1e11e0[_0x834e('0x54')][_0x834e('0xbb')]=_0xf89b9e['id'];if(_0x18735a[_0x834e('0x4a')][_0x834e('0x8e')]){_0x1e11e0[_0x834e('0x54')]=_[_0x834e('0xa8')](_0x1e11e0[_0x834e('0x54')],{'$or':_['map'](_0x1e11e0[_0x834e('0x4e')],function(_0x278052){var _0x4a428c={};_0x4a428c[_0x278052]={'$like':'%'+_0x18735a['query'][_0x834e('0x8e')]+'%'};return _0x4a428c;})});}if(_0x18735a[_0x834e('0x4a')]['$gte']){var _0x5920f3=_0x18735a[_0x834e('0x4a')][_0x834e('0x85')][_0x834e('0x38')](',');var _0x599664={};_0x599664[_0x5920f3[0x0]]={'$gte':moment(_0x5920f3[0x1])[_0x834e('0xf1')](_0x834e('0x10e'))};_0x1e11e0[_0x834e('0x54')]=_['merge'](_0x1e11e0[_0x834e('0x54')],_0x599664);}_0x1e11e0=_['merge']({},_0x1e11e0,_0x18735a[_0x834e('0xc1')]);return db[_0x834e('0xee')][_0x834e('0x28')]({'where':_0x1e11e0[_0x834e('0x54')]})[_0x834e('0x2c')](function(_0x516a53){_0x59bd0e[_0x834e('0x28')]=_0x516a53;if(_0x18735a[_0x834e('0x4a')][_0x834e('0xbf')]){_0x1e11e0[_0x834e('0xc0')]=[{'all':!![]}];}return db[_0x834e('0xee')]['findAll'](_0x1e11e0);})['then'](function(_0x2ca127){_0x59bd0e[_0x834e('0x10f')]=_0x2ca127;return _0x59bd0e;});}})[_0x834e('0x2c')](respondWithFilteredResult(_0x3446ff,_0x1e11e0))['catch'](handleError(_0x3446ff,null));};exports[_0x834e('0x110')]=function(_0x2e3294,_0x28d9c3){var _0x386b73={'where':{}},_0x53faec={},_0x3cc563={'count':0x0,'rows':[]};return db[_0x834e('0x46')]['findOne']({'where':{'id':_0x2e3294[_0x834e('0xbe')]['id']}})[_0x834e('0x2c')](handleEntityNotFound(_0x28d9c3,null))[_0x834e('0x2c')](function(_0x3e408c){if(_0x3e408c){_0x53faec['model']=_[_0x834e('0x4b')](db['ChatMessage'][_0x834e('0x47')]);_0x53faec[_0x834e('0x4a')]=_[_0x834e('0x4b')](_0x2e3294[_0x834e('0x4a')]);_0x53faec[_0x834e('0x4c')]=_[_0x834e('0x4d')](_0x53faec['model'],_0x53faec['query']);_0x386b73[_0x834e('0x4e')]=_[_0x834e('0x4d')](_0x53faec['model'],qs[_0x834e('0x4f')](_0x2e3294['query'][_0x834e('0x4f')]));_0x386b73[_0x834e('0x4e')]=_0x386b73[_0x834e('0x4e')][_0x834e('0x50')]?_0x386b73[_0x834e('0x4e')]:_0x53faec[_0x834e('0x49')];if(!_0x2e3294[_0x834e('0x4a')]['hasOwnProperty'](_0x834e('0x10d'))){_0x386b73[_0x834e('0x26')]=qs[_0x834e('0x26')](_0x2e3294[_0x834e('0x4a')][_0x834e('0x26')]);_0x386b73['offset']=qs[_0x834e('0x25')](_0x2e3294[_0x834e('0x4a')][_0x834e('0x25')]);}_0x386b73['order']=qs['sort'](_0x2e3294['query'][_0x834e('0x53')]);_0x386b73[_0x834e('0x54')]=qs[_0x834e('0x4c')](_[_0x834e('0x55')](_0x2e3294[_0x834e('0x4a')],_0x53faec[_0x834e('0x4c')]));_0x386b73[_0x834e('0x54')][_0x834e('0xbb')]=_0x3e408c['id'];if(_0x2e3294[_0x834e('0x4a')][_0x834e('0x8e')]){_0x386b73[_0x834e('0x54')]=_['merge'](_0x386b73[_0x834e('0x54')],{'$or':_[_0x834e('0x45')](_0x386b73[_0x834e('0x4e')],function(_0x26534d){var _0x4081a1={};_0x4081a1[_0x26534d]={'$like':'%'+_0x2e3294[_0x834e('0x4a')][_0x834e('0x8e')]+'%'};return _0x4081a1;})});}_0x386b73[_0x834e('0x54')]['secret']=![];if(_0x2e3294[_0x834e('0x4a')]['id']){_0x386b73[_0x834e('0x54')]['id']={'$gt':_0x2e3294['query']['id']};}_0x386b73=_[_0x834e('0xa8')]({},_0x386b73,_0x2e3294[_0x834e('0xc1')]);return db[_0x834e('0xee')][_0x834e('0x28')]({'where':_0x386b73['where']})['then'](function(_0x3d37c8){_0x3cc563['count']=_0x3d37c8;_0x386b73[_0x834e('0xc0')]=[];if(_0x2e3294[_0x834e('0x4a')][_0x834e('0x111')]){_0x386b73[_0x834e('0xc0')][_0x834e('0xbc')]({'model':db['User'],'as':_0x834e('0xef'),'attributes':['id','fullname','alias']});}if(_0x2e3294[_0x834e('0x4a')][_0x834e('0xbf')]){_0x386b73[_0x834e('0xc0')]=[{'all':!![]}];}return db[_0x834e('0xee')][_0x834e('0x112')](_0x386b73);})[_0x834e('0x2c')](function(_0x5912ee){_0x3cc563[_0x834e('0x10f')]=_0x5912ee;return _0x3cc563;});}})[_0x834e('0x2c')](respondWithFilteredResult(_0x28d9c3,_0x386b73))['catch'](handleError(_0x28d9c3,null));};exports[_0x834e('0x113')]=function(_0x3b4264,_0x4b070a){return db[_0x834e('0x46')][_0x834e('0x6f')]({'where':{'id':_0x3b4264['params']['id']}})[_0x834e('0x2c')](handleEntityNotFound(_0x4b070a,null))[_0x834e('0x2c')](function(_0x164170){if(_0x164170){return _0x164170[_0x834e('0x114')](_0x3b4264[_0x834e('0x33')][_0x834e('0x10a')],_[_0x834e('0x10b')](_0x3b4264[_0x834e('0x33')],[_0x834e('0x10a'),'id'])||{})[_0x834e('0x115')](function(){return db['Tag'][_0x834e('0x112')]({'attributes':['id',_0x834e('0x30'),_0x834e('0x57')],'where':{'id':_0x3b4264[_0x834e('0x33')][_0x834e('0x10a')]}});})[_0x834e('0x2c')](function(_0x2d61c1){socket[_0x834e('0x116')](_0x834e('0x117'),{'id':Number(_0x3b4264[_0x834e('0xbe')]['id']),'tags':_0x2d61c1||[]});return{'id':Number(_0x3b4264[_0x834e('0xbe')]['id']),'tags':_0x2d61c1||[]};});}})[_0x834e('0x2c')](respondWithResult(_0x4b070a,null))['catch'](handleError(_0x4b070a,null));};exports[_0x834e('0x118')]=function(_0x1cd122,_0x49be08){return db['ChatInteraction']['find']({'where':{'id':_0x1cd122[_0x834e('0xbe')]['id']}})[_0x834e('0x2c')](handleEntityNotFound(_0x49be08,null))[_0x834e('0x2c')](function(_0x3530bc){if(_0x3530bc){return _0x3530bc[_0x834e('0x118')](_0x1cd122[_0x834e('0x4a')][_0x834e('0x10a')]);}})['then'](respondWithStatusCode(_0x49be08,null))['catch'](handleError(_0x49be08,null));};exports['download']=function(_0x47947b,_0x684a97){var _0x3c8fc2=moment()[_0x834e('0x119')]()['toString']();var _0x5776c5=path['join'](config[_0x834e('0xe5')],'server','files',_0x834e('0x11a'));var _0x378bf3=path[_0x834e('0xe4')](config[_0x834e('0xe5')],_0x834e('0x11b'),_0x834e('0x11c'),_0x834e('0x11d'));var _0x59a706=path[_0x834e('0xe4')](_0x5776c5,_0x3c8fc2);var _0x11f472=util[_0x834e('0xf1')](_0x834e('0x11e'),_0x47947b[_0x834e('0xbe')]['id'],_0x3c8fc2);var _0x488f82=path[_0x834e('0xe4')](_0x5776c5,_0x11f472);var _0x5a3876=[];_0x5a3876[_0x834e('0xbc')]({'model':db[_0x834e('0xef')],'as':_0x834e('0xef'),'attributes':['id','fullname'],'raw':!![]});_0x5a3876['push']({'model':db['CmContact'],'as':'Contact','attributes':['id',_0x834e('0x11f'),_0x834e('0x120')],'raw':!![]});if(_0x47947b['query']['attachments']){_0x5a3876[_0x834e('0xbc')]({'model':db[_0x834e('0xe1')],'as':_0x834e('0xe1'),'raw':!![]});}var _0x51f527=[{'model':db[_0x834e('0xee')],'as':_0x834e('0xf0'),'attributes':['id',_0x834e('0x33'),'createdAt',_0x834e('0xfd'),_0x834e('0xfe'),_0x834e('0x89')],'include':_0x5a3876}];_0x51f527[_0x834e('0xbc')]({'model':db[_0x834e('0xc6')],'as':_0x834e('0x121'),'attributes':['id',_0x834e('0x30')]});_0x51f527['push']({'model':db[_0x834e('0xef')],'as':_0x834e('0x122'),'attributes':['id',_0x834e('0xcb')]});return db['ChatInteraction'][_0x834e('0x6f')]({'where':{'id':_0x47947b[_0x834e('0xbe')]['id']},'include':_0x51f527})[_0x834e('0x2c')](handleEntityNotFound(_0x684a97,null))[_0x834e('0x2c')](function(_0x2bbb1a){if(_0x2bbb1a){var _0x1ffed9=_0x2bbb1a[_0x834e('0x123')]({'plain':!![]});fs[_0x834e('0x124')](_0x59a706);var _0x25fa75={'channel':_0x834e('0x125'),'account':_0x1ffed9[_0x834e('0x121')][_0x834e('0x30')],'agent':_0x1ffed9['Owner']?_0x1ffed9[_0x834e('0x122')]['fullname']:_0x834e('0x126'),'createdAt':moment(_0x1ffed9['createdAt'])[_0x834e('0xf1')](_0x834e('0x10e'))[_0x834e('0xa6')](),'closedAt':_0x1ffed9[_0x834e('0x40')]?moment(_0x1ffed9[_0x834e('0x127')])[_0x834e('0xf1')](_0x834e('0x10e'))[_0x834e('0xa6')]():'','disposition':_0x1ffed9['disposition'],'chatInfo':{'browser':_0x1ffed9['browserName'],'os':_0x1ffed9['osName'],'referer':_0x1ffed9[_0x834e('0x128')],'customerIp':_0x1ffed9[_0x834e('0x129')],'customerPort':_0x1ffed9[_0x834e('0x12a')]?_0x1ffed9[_0x834e('0x12a')]:_0x834e('0x126')},'messages':_(_0x1ffed9[_0x834e('0xf0')])[_0x834e('0x12b')]()[_0x834e('0x8e')]({'secret':![]})['map'](function(_0x5a312e){if(_0x5a312e[_0x834e('0xe1')]){var _0x42e5ee=path[_0x834e('0xe4')](_0x378bf3,_0x5a312e['Attachment']['basename']);if(fs[_0x834e('0x12c')](_0x42e5ee)){fs['createReadStream'](_0x42e5ee)[_0x834e('0x12d')](fs[_0x834e('0x12e')](path[_0x834e('0xe4')](_0x59a706,_0x5a312e['Attachment'][_0x834e('0xe7')])));}}return{'date':moment(_0x5a312e[_0x834e('0xfc')])[_0x834e('0xf1')](_0x834e('0x10e'))[_0x834e('0xa6')](),'sender':_0x5a312e[_0x834e('0xfd')]===_0x834e('0xd5')?_0x5a312e['User']?_0x5a312e[_0x834e('0xef')][_0x834e('0xcb')]:_0x834e('0xf4'):_0x5a312e[_0x834e('0x73')][_0x834e('0x11f')]+(_0x5a312e[_0x834e('0x73')][_0x834e('0x120')]?'\x20'+_0x5a312e['Contact']['lastName']:''),'body':_0x5a312e[_0x834e('0xe1')]?_0x5a312e['Attachment']['basename']:_0x5a312e[_0x834e('0x33')],'direction':_0x5a312e[_0x834e('0xfd')]==='out'?'A':'C','secret':_0x5a312e[_0x834e('0xfe')],'read':_0x5a312e['read'],'attachment':_0x5a312e['Attachment']};})[_0x834e('0x75')]()};return ejs['renderFile'](path[_0x834e('0xe4')](config[_0x834e('0xe5')],_0x834e('0x11b'),_0x834e('0x12f'),_0x834e('0x130')),{'interaction':_0x25fa75})[_0x834e('0x2c')](function(_0x1a48f9){var _0x196f86=path[_0x834e('0xe4')](_0x59a706,'transcript-'+_0x1ffed9['id']+'-'+_0x3c8fc2+_0x834e('0x131'));var _0x19a42c={'path':_0x196f86,'channel':_0x834e('0x125'),'interactionId':_0x1ffed9['id']};return pdf[_0x834e('0x132')](_0x1a48f9,_0x19a42c);})['then'](function(){return new Promise(function(_0x4b1178,_0x46e533){zipdir(_0x59a706,{'saveTo':_0x488f82},function(_0x13a7e1,_0x5d801a){if(_0x13a7e1)return _0x46e533(_0x13a7e1);return _0x4b1178(_0x5d801a);});})[_0x834e('0x2c')](function(){return new BPromise(function(_0x505821,_0x2f46cf){rimraf(_0x59a706,function(_0x884f38){if(_0x884f38)_0x2f46cf(_0x884f38);return _0x505821();});});})[_0x834e('0x2c')](function(){return _0x684a97[_0x834e('0xe8')](_0x488f82,_0x11f472,function(_0xd7026f){if(_0xd7026f){logger[_0x834e('0x1d')]('err',_0xd7026f);}else{fs['unlinkSync'](_0x488f82);}});});});}else{return _0x684a97['sendStatus'](0xc8);}})[_0x834e('0x22')](handleError(_0x684a97,null));}; \ No newline at end of file +var _0x0a9a=['Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','customUpdate','CmContact','abandon','Interaction\x20already\x20assigned','attachmentUpload','file','originalname','filename','attachmentDownload','findOne','Unauthorized','Attachment','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','mailTranscript','server/files/chat/upload/','now','pathTranscript','Messages','%s%d','agentAlias','System','customer','format','agentIdentifier','website_alias','agent_alias','agent_fullname','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailServerOut','CloudProvider','Smtp','getSmtpOptions','SendMail','sendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','ids','getMessages','YYYY-MM-DD\x20HH:mm:ss','options','findAll','rows','getMyMessages','includeAgent','addTags','emit','chatInteractionTags:save','removeTags','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','Account','Owner','get','mkdirSync','N.A.','closedAt','browserName','osName','referer','tail','basename','pipe','out','lastName','downloadInteraction.ejs','transcript-','.pdf','Chat','createPdfFromHTML','unlinkSync','zip-dir','moment','bluebird','mustache','util','ejs','lodash','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','api','../../mysqldb','redis','defaults','socket.io-emitter','jayson/promise','client','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','destroy','end','stack','name','send','render','merge','agent','interaction','account','map','fullname','TagIds','Tags','split','forEach','push','catch','waiting','talking','answered','abandoned','total','closed','UserId','disposition','unmanaged','index','ChatInteraction','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','field','color','from','tools_tags','select','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','expr','search','parseSearch','conditions','find','unreadMessages','having','`\x20=\x200','Contact','operator','$substring','value','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','some','compact','where','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','t.id\x20IN\x20?','ChatWebsiteId','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','isEmpty','i.ChatWebsiteId\x20IS\x20NULL','role','toString','sequelize','keyBy','a.key','Account.key','Account.mandatoryDisposition','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','contactName','i.*','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','show','includeAll','include','create','update','params','describe','createVidaooSession','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','metadata'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x0a9a,0x183));var _0xa0a9=function(_0x180e12,_0x3708a5){_0x180e12=_0x180e12-0x0;var _0x154199=_0x0a9a[_0x180e12];return _0x154199;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xa0a9('0x0'));var rp=require('request-promise');var moment=require(_0xa0a9('0x1'));var BPromise=require(_0xa0a9('0x2'));var Mustache=require(_0xa0a9('0x3'));var util=require(_0xa0a9('0x4'));var path=require('path');var ejs=require(_0xa0a9('0x5'));var fs=require('fs');var _=require(_0xa0a9('0x6'));var squel=require('squel');var Redis=require(_0xa0a9('0x7'));var qs=require(_0xa0a9('0x8'));var as=require(_0xa0a9('0x9'));var pdf=require(_0xa0a9('0xa'));var logger=require('../../config/logger')(_0xa0a9('0xb'));var config=require('../../config/environment');var db=require(_0xa0a9('0xc'))['db'];config[_0xa0a9('0xd')]=_[_0xa0a9('0xe')](config[_0xa0a9('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xa0a9('0xf'))(new Redis(config[_0xa0a9('0xd')]));require('./chatInteraction.socket')['register'](socket);var jayson=require(_0xa0a9('0x10'));var client=jayson[_0xa0a9('0x11')]['http']({'port':0x232b});var client9004=jayson[_0xa0a9('0x11')]['http']({'port':0x232c});function respondWithRpcPromise(_0x1c39ff,_0x4b7913,_0xb87a94,_0x1ae2a7){return new BPromise(function(_0xa10656,_0x35e7cd){var _0x13833c=_0x1ae2a7||client;return _0x13833c['request'](_0x1c39ff,_0xb87a94)[_0xa0a9('0x12')](function(_0x9ef979){logger[_0xa0a9('0x13')](_0xa0a9('0x14'),_0x4b7913,_0xa0a9('0x15'));logger[_0xa0a9('0x16')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x4b7913,_0xa0a9('0x15'),JSON['stringify'](_0x9ef979));if(_0x9ef979['error']){if(_0x9ef979[_0xa0a9('0x17')][_0xa0a9('0x18')]===0x1f4){logger[_0xa0a9('0x17')](_0xa0a9('0x14'),_0x4b7913,_0x9ef979['error'][_0xa0a9('0x19')]);return _0x35e7cd(_0x9ef979[_0xa0a9('0x17')][_0xa0a9('0x19')]);}logger[_0xa0a9('0x17')](_0xa0a9('0x14'),_0x4b7913,_0x9ef979[_0xa0a9('0x17')]['message']);return _0xa10656(_0x9ef979[_0xa0a9('0x17')][_0xa0a9('0x19')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x4b7913,_0xa0a9('0x15'));_0xa10656(_0x9ef979[_0xa0a9('0x1a')][_0xa0a9('0x19')]);}})['catch'](function(_0x307d7e){logger['error'](_0xa0a9('0x14'),_0x4b7913,_0x307d7e);_0x35e7cd(_0x307d7e);});});}function respondWithStatusCode(_0x5e6148,_0x4d9dde){_0x4d9dde=_0x4d9dde||0xcc;return function(_0x504786){if(_0x504786){return _0x5e6148[_0xa0a9('0x1b')](_0x4d9dde);}return _0x5e6148[_0xa0a9('0x1c')](_0x4d9dde)['end']();};}function respondWithResult(_0x423d3a,_0x4fb909){_0x4fb909=_0x4fb909||0xc8;return function(_0x20b318){if(_0x20b318){return _0x423d3a[_0xa0a9('0x1c')](_0x4fb909)[_0xa0a9('0x1d')](_0x20b318);}};}function respondWithFilteredResult(_0x252a14,_0x503ef2){return function(_0x7c1502){if(_0x7c1502){var _0xe49d3b=typeof _0x503ef2[_0xa0a9('0x1e')]===_0xa0a9('0x1f')&&typeof _0x503ef2['limit']===_0xa0a9('0x1f');var _0x38e454=_0x7c1502[_0xa0a9('0x20')];var _0x5c446e=_0xe49d3b?0x0:_0x503ef2['offset'];var _0x2b3cbb=_0xe49d3b?_0x7c1502[_0xa0a9('0x20')]:_0x503ef2[_0xa0a9('0x1e')]+_0x503ef2[_0xa0a9('0x21')];var _0x4685c5;if(_0x2b3cbb>=_0x38e454){_0x2b3cbb=_0x38e454;_0x4685c5=0xc8;}else{_0x4685c5=0xce;}_0x252a14[_0xa0a9('0x1c')](_0x4685c5);return _0x252a14[_0xa0a9('0x22')](_0xa0a9('0x23'),_0x5c446e+'-'+_0x2b3cbb+'/'+_0x38e454)[_0xa0a9('0x1d')](_0x7c1502);}return null;};}function saveUpdates(_0x42024c){return function(_0x41e994){if(_0x41e994){return _0x41e994['update'](_0x42024c)[_0xa0a9('0x12')](function(_0x1957bf){return _0x1957bf;});}return null;};}function removeEntity(_0x4fc94a){return function(_0x2f21ea){if(_0x2f21ea){return _0x2f21ea[_0xa0a9('0x24')]()['then'](function(){_0x4fc94a['status'](0xcc)[_0xa0a9('0x25')]();});}};}function handleEntityNotFound(_0x5291e3){return function(_0x5a1095){if(!_0x5a1095){_0x5291e3[_0xa0a9('0x1b')](0x194);}return _0x5a1095;};}function handleError(_0x104936,_0x347cbf){_0x347cbf=_0x347cbf||0x1f4;return function(_0x1e83ac){logger[_0xa0a9('0x17')](_0x1e83ac[_0xa0a9('0x26')]);if(_0x1e83ac[_0xa0a9('0x27')]){delete _0x1e83ac['name'];}_0x104936[_0xa0a9('0x1c')](_0x347cbf)[_0xa0a9('0x28')](_0x1e83ac);};}function getMustacheRender(_0x539807,_0x46ef2b){return Mustache[_0xa0a9('0x29')](_0x539807,_[_0xa0a9('0x2a')](_0x46ef2b['body'],{'contact':_0x46ef2b['contact'],'message':_0x46ef2b[_0xa0a9('0x19')],'agent':_0x46ef2b[_0xa0a9('0x2b')],'interaction':_0x46ef2b[_0xa0a9('0x2c')],'account':_0x46ef2b[_0xa0a9('0x2d')]}))||'';}function getInteractionUsers(_0x520817,_0x70a275){return new BPromise(function(_0x19a122,_0x459485){try{if(_0x70a275[_0x520817['id']]){_0x520817['Users']=_[_0xa0a9('0x2e')](_0x70a275[_0x520817['id']],function(_0x3c74ea){return{'id':_0x3c74ea['id'],'fullname':_0x3c74ea[_0xa0a9('0x2f')]};});}}catch(_0x53dfd1){_0x459485(_0x53dfd1);}_0x19a122(_0x520817);});}function getInteractionTags(_0x3ae735,_0x2ed673){return new BPromise(function(_0x41c056,_0x3206a2){try{if(_0x3ae735[_0xa0a9('0x30')]){_0x3ae735[_0xa0a9('0x31')]=[];_0x3ae735[_0xa0a9('0x30')][_0xa0a9('0x32')](',')[_0xa0a9('0x33')](function(_0x2ea301){_0x3ae735[_0xa0a9('0x31')][_0xa0a9('0x34')](_0x2ed673[_0x2ea301]);});}delete _0x3ae735[_0xa0a9('0x30')];}catch(_0x1574cd){_0x3206a2(_0x1574cd);}_0x41c056(_0x3ae735);});}function updateChatInteraction(_0xaa6ef9,_0x1b1aff,_0x868447){return new BPromise(function(_0x54fe3f,_0x3f1e4f){return getInteractionUsers(_0xaa6ef9,_0x868447)[_0xa0a9('0x12')](function(_0x3d3769){return getInteractionTags(_0x3d3769,_0x1b1aff);})['then'](function(_0x757e10){return getStateInteraction(_0x757e10);})[_0xa0a9('0x12')](function(_0x91e37e){_0x54fe3f(_0x91e37e);})[_0xa0a9('0x35')](function(_0x48993c){_0x3f1e4f(_0x48993c);});});}function getStateInteraction(_0x26ffb8){return new BPromise(function(_0x44791e){_0x26ffb8[_0xa0a9('0x36')]=0x0;_0x26ffb8[_0xa0a9('0x37')]=0x0;_0x26ffb8[_0xa0a9('0x38')]=0x0;_0x26ffb8['unmanaged']=0x0;_0x26ffb8[_0xa0a9('0x39')]=0x0;_0x26ffb8[_0xa0a9('0x3a')]=0x0;if(!_0x26ffb8[_0xa0a9('0x3b')]&&!_0x26ffb8[_0xa0a9('0x3c')]){_0x26ffb8[_0xa0a9('0x36')]+=0x1;}if(!_0x26ffb8['closed']&&_0x26ffb8[_0xa0a9('0x3c')]){_0x26ffb8[_0xa0a9('0x37')]+=0x1;if(_0x26ffb8[_0xa0a9('0x36')]){_0x26ffb8[_0xa0a9('0x36')]-=0x1;}}if(_0x26ffb8[_0xa0a9('0x3b')]&&_0x26ffb8['disposition']===_0xa0a9('0x39')){_0x26ffb8[_0xa0a9('0x39')]+=0x1;if(_0x26ffb8['waiting']){_0x26ffb8['waiting']-=0x1;}}else if(_0x26ffb8[_0xa0a9('0x3b')]&&!_0x26ffb8[_0xa0a9('0x3c')]&&_0x26ffb8[_0xa0a9('0x3d')]){_0x26ffb8[_0xa0a9('0x3e')]+=0x1;if(_0x26ffb8['waiting']){_0x26ffb8[_0xa0a9('0x36')]-=0x1;}}else if(_0x26ffb8[_0xa0a9('0x3b')]&&_0x26ffb8[_0xa0a9('0x3c')]){_0x26ffb8[_0xa0a9('0x38')]+=0x1;if(_0x26ffb8[_0xa0a9('0x37')]){_0x26ffb8[_0xa0a9('0x37')]-=0x1;}}_0x26ffb8[_0xa0a9('0x3a')]+=0x1;_0x44791e(_0x26ffb8);});}exports[_0xa0a9('0x3f')]=function(_0xbdce0e,_0x1a7879){var _0xe82093={},_0x1b2172={},_0x2fcc76={'count':0x0,'rows':[]};var _0x3bb0fb=_[_0xa0a9('0x2e')](db[_0xa0a9('0x40')][_0xa0a9('0x41')],function(_0x54e917){return{'name':_0x54e917[_0xa0a9('0x42')],'type':_0x54e917['type'][_0xa0a9('0x43')]};});_0x1b2172[_0xa0a9('0x44')]=_[_0xa0a9('0x2e')](_0x3bb0fb,_0xa0a9('0x27'));_0x1b2172[_0xa0a9('0x45')]=_[_0xa0a9('0x46')](_0xbdce0e[_0xa0a9('0x45')]);_0x1b2172[_0xa0a9('0x47')]=_[_0xa0a9('0x48')](_0x1b2172['model'],_0x1b2172[_0xa0a9('0x45')]);_0xe82093[_0xa0a9('0x49')]=_[_0xa0a9('0x48')](_0x1b2172['model'],qs[_0xa0a9('0x4a')](_0xbdce0e[_0xa0a9('0x45')][_0xa0a9('0x4a')]));_0xe82093['attributes']=_0xe82093[_0xa0a9('0x49')][_0xa0a9('0x4b')]?_0xe82093[_0xa0a9('0x49')]:_0x1b2172[_0xa0a9('0x44')];if(!_0xbdce0e['query'][_0xa0a9('0x4c')](_0xa0a9('0x4d'))){_0xe82093[_0xa0a9('0x21')]=qs[_0xa0a9('0x21')](_0xbdce0e[_0xa0a9('0x45')][_0xa0a9('0x21')]);_0xe82093[_0xa0a9('0x1e')]=qs['offset'](_0xbdce0e[_0xa0a9('0x45')][_0xa0a9('0x1e')]);}_0xe82093['order']=qs[_0xa0a9('0x4e')](_0xbdce0e[_0xa0a9('0x45')][_0xa0a9('0x4e')]);_0xe82093['where']=qs['filters'](_[_0xa0a9('0x4f')](_0xbdce0e[_0xa0a9('0x45')],_0x1b2172[_0xa0a9('0x47')]),_0x3bb0fb);var _0x1397dd=[];var _0x51387d=squel['select']()[_0xa0a9('0x50')]('id')[_0xa0a9('0x50')]('name')['field'](_0xa0a9('0x51'))[_0xa0a9('0x52')](_0xa0a9('0x53'));var _0x31bc1b=squel[_0xa0a9('0x54')]()[_0xa0a9('0x50')](_0xa0a9('0x55'))[_0xa0a9('0x50')](_0xa0a9('0x56'))[_0xa0a9('0x50')](_0xa0a9('0x57'))['from'](_0xa0a9('0x58'),'ui')[_0xa0a9('0x59')](_0xa0a9('0x5a'),'u','u.id\x20=\x20ui.UserId');var _0x426ddc=squel[_0xa0a9('0x54')]()[_0xa0a9('0x52')]('chat_interactions','i')[_0xa0a9('0x59')](_0xa0a9('0x5b'),'c',_0xa0a9('0x5c'))[_0xa0a9('0x59')](_0xa0a9('0x5a'),'o',_0xa0a9('0x5d'))[_0xa0a9('0x59')]('chat_websites','a',_0xa0a9('0x5e'))[_0xa0a9('0x59')](_0xa0a9('0x5f'),'me',_0xa0a9('0x60'))[_0xa0a9('0x59')](_0xa0a9('0x61'),'it',_0xa0a9('0x62'))['left_join']('tools_tags','t','t.id\x20=\x20it.TagId');var _0x40d0f5=squel['expr']();var _0x331a0a=[];var _0x5c8ce1=squel[_0xa0a9('0x63')]();var _0x3f9648;if(_0xbdce0e[_0xa0a9('0x45')][_0xa0a9('0x64')]){_0x3f9648=as[_0xa0a9('0x65')](_0xbdce0e[_0xa0a9('0x45')][_0xa0a9('0x64')]);var _0x40c53d=_0x3f9648['sqlOperator'];for(var _0x5968ce=0x0;_0x5968ce<_0x3f9648[_0xa0a9('0x66')]['length'];_0x5968ce++){var _0x35c897=_0x3f9648[_0xa0a9('0x66')][_0x5968ce];var _0x3c526a='i';var _0x483dd3=_[_0xa0a9('0x67')](_0x3bb0fb,['name',_0x35c897[_0xa0a9('0x50')]]);if(!_0x483dd3){switch(_0x35c897[_0xa0a9('0x50')]){case _0xa0a9('0x68'):if(_0x35c897['value']==0x1){_0x426ddc[_0xa0a9('0x69')]('`'+_0x35c897['field']+_0xa0a9('0x6a'));}else{_0x426ddc['having']('`'+_0x35c897[_0xa0a9('0x50')]+'`\x20>\x200');}break;case _0xa0a9('0x6b'):if(_0x35c897[_0xa0a9('0x6c')]===_0xa0a9('0x6d')){if(_0x35c897[_0xa0a9('0x6e')][_0xa0a9('0x32')]('\x20')[_0xa0a9('0x4b')]>0x1){_0x40d0f5[_0x40c53d]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xa0a9('0x6f')](_0x35c897[_0xa0a9('0x6e')]),null);}else{var _0x2e6d3f='%'+_0x35c897['value']+'%';_0x40d0f5[_0x40c53d](_0xa0a9('0x70'),_0x2e6d3f,_0x2e6d3f,_0x2e6d3f);}}else{_0x483dd3=_[_0xa0a9('0x67')](_0x3bb0fb,[_0xa0a9('0x27'),_0xa0a9('0x71')]);_0x35c897[_0xa0a9('0x50')]='ContactId';_0x2faa44=as[_0xa0a9('0x72')](_0x3c526a,_0x483dd3[_0xa0a9('0x73')],_0x35c897);_0x40d0f5[_0x40c53d](_0x2faa44[_0xa0a9('0x74')],_0x2faa44[_0xa0a9('0x6e')][_0xa0a9('0x75')],_0x2faa44[_0xa0a9('0x6e')][_0xa0a9('0x25')]);}break;case _0xa0a9('0x76'):var _0x3a6b21=_0x35c897[_0xa0a9('0x6e')]['split'](',')[_0xa0a9('0x2e')](function(_0x1bae56){return Number(_0x1bae56);});_0x3a6b21[_0xa0a9('0x33')](function(_0x2d9b5c){_0x5c8ce1['or'](_0xa0a9('0x77'),'%,'+_0x2d9b5c+',%');});_0x331a0a=_[_0xa0a9('0x78')](_0x331a0a,_0x3a6b21);break;case _0xa0a9('0x79'):if(_0x35c897[_0xa0a9('0x6c')]===_0xa0a9('0x6d')){_0x40d0f5[_0x40c53d](_0xa0a9('0x7a'),'%'+_0x35c897[_0xa0a9('0x6e')]+'%',null);}else{_0x483dd3=_[_0xa0a9('0x67')](_0x3bb0fb,[_0xa0a9('0x27'),_0xa0a9('0x3c')]);_0x35c897[_0xa0a9('0x50')]=_0xa0a9('0x3c');_0x2faa44=as['buildExpression'](_0x3c526a,_0x483dd3[_0xa0a9('0x73')],_0x35c897);_0x40d0f5[_0x40c53d](_0x2faa44['text'],_0x2faa44[_0xa0a9('0x6e')]['start'],_0x2faa44[_0xa0a9('0x6e')][_0xa0a9('0x25')]);}break;case _0xa0a9('0x7b'):_0x2faa44=as[_0xa0a9('0x72')]('me',null,_0x35c897);_0x40d0f5[_0x40c53d](_0x2faa44[_0xa0a9('0x74')],_0x2faa44[_0xa0a9('0x6e')][_0xa0a9('0x75')],_0x2faa44['value'][_0xa0a9('0x25')]);break;}}else{var _0x2faa44=as[_0xa0a9('0x72')](_0x3c526a,_0x483dd3[_0xa0a9('0x73')],_0x35c897);_0x40d0f5[_0x40c53d](_0x2faa44[_0xa0a9('0x74')],_0x2faa44[_0xa0a9('0x6e')][_0xa0a9('0x75')],_0x2faa44[_0xa0a9('0x6e')][_0xa0a9('0x25')]);}}}else{var _0x4da18d=_(_0xbdce0e[_0xa0a9('0x45')])[_0xa0a9('0x46')]()[_0xa0a9('0x2e')](function(_0x2a0a40){return _[_0xa0a9('0x7c')](_0x3bb0fb,[_0xa0a9('0x27'),_0x2a0a40])?_0x2a0a40:undefined;})[_0xa0a9('0x7d')]()[_0xa0a9('0x6e')]();if(!_['isEmpty'](_0x4da18d)){_0x4da18d[_0xa0a9('0x33')](function(_0x35c824){if(_0x35c824==='ChatWebsiteId'){_0x426ddc[_0xa0a9('0x7e')](_0xa0a9('0x7f'),[][_0xa0a9('0x80')](_0xbdce0e[_0xa0a9('0x45')][_0x35c824]));}else if(_0x35c824===_0xa0a9('0x81')){var _0x3fa9ec=JSON[_0xa0a9('0x82')](_0xbdce0e[_0xa0a9('0x45')][_0x35c824])[_0xa0a9('0x83')];var _0x106440=JSON[_0xa0a9('0x82')](_0xbdce0e[_0xa0a9('0x45')][_0x35c824])[_0xa0a9('0x84')];_0x426ddc['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3fa9ec,_0x106440);}else{if(_0xbdce0e[_0xa0a9('0x45')][_0x35c824]==='null'){_0x426ddc['where']('i.'+_0x35c824+_0xa0a9('0x85'));}else{_0x426ddc[_0xa0a9('0x7e')]('i.'+_0x35c824+'\x20=\x20?',_0xbdce0e[_0xa0a9('0x45')][_0x35c824]);}}});}if(_0xbdce0e[_0xa0a9('0x45')][_0xa0a9('0x86')]){if(_0xbdce0e[_0xa0a9('0x45')][_0xa0a9('0x86')]==0x1){_0x426ddc[_0xa0a9('0x69')](_0xa0a9('0x87'));}else{_0x426ddc['having'](_0xa0a9('0x88'));}}if(_0xbdce0e['query']['tag']){_0x331a0a=_['isArray'](_0xbdce0e[_0xa0a9('0x45')][_0xa0a9('0x89')])?_0xbdce0e['query'][_0xa0a9('0x89')]:new Array(_0xbdce0e[_0xa0a9('0x45')][_0xa0a9('0x89')]);_0x331a0a[_0xa0a9('0x33')](function(_0x301de2){_0x5c8ce1['or'](_0xa0a9('0x77'),'%,'+_0x301de2+',%');});}if(_0xbdce0e[_0xa0a9('0x45')]['filter']){var _0x1fff5c=_0xbdce0e['query'][_0xa0a9('0x8a')][_0xa0a9('0x8b')]('\x5c','\x5c\x5c')[_0xa0a9('0x8b')](/'/g,'\x27\x27');if(qs[_0xa0a9('0x8c')](_0x1fff5c)){_0x40d0f5['or']('i.id\x20LIKE\x20?',_0x1fff5c+'%');}else{_0x40d0f5['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xa0a9('0x6f')](_0x1fff5c))['or'](_0xa0a9('0x8d'),_0x1fff5c+'%');}}}_0x426ddc[_0xa0a9('0x7e')](_0x40d0f5);_0x426ddc[_0xa0a9('0x8e')](_0xa0a9('0x8f'));var _0xcc00a8={'type':db['Sequelize']['QueryTypes'][_0xa0a9('0x90')],'raw':!![]};var _0x161d87=_0x426ddc[_0xa0a9('0x91')]();_0x161d87[_0xa0a9('0x50')](_0xa0a9('0x8f'));_0x161d87[_0xa0a9('0x50')](_0xa0a9('0x92'),'unreadMessages');if(_0xe82093[_0xa0a9('0x93')]){_0xe82093[_0xa0a9('0x93')]['forEach'](function(_0x25049d){var _0xe83741=_0x25049d[0x0]==='contactName'?_0x25049d[0x0]:'i.'+_0x25049d[0x0];_0x426ddc[_0xa0a9('0x93')](_0xe83741,_0x25049d[0x1]===_0xa0a9('0x94')?![]:!![]);});}if(!_['isEmpty'](_0x331a0a)){_0x426ddc['having'](_0x5c8ce1);_0x161d87['where'](_0xa0a9('0x95'),_0x331a0a);}BPromise['resolve']()[_0xa0a9('0x12')](function(){if(!_0x3f9648){if(_0xbdce0e[_0xa0a9('0x45')][_0xa0a9('0x96')])return;_0x161d87['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x426ddc['where'](_0xa0a9('0x97'));return;}if(_0xbdce0e[_0xa0a9('0x98')]['role']!=='agent')return;return _0xbdce0e['user'][_0xa0a9('0x99')]({'attributes':['id'],'raw':!![]})[_0xa0a9('0x12')](function(_0x295145){if(_[_0xa0a9('0x9a')](_0x295145)){_0x161d87['where'](_0xa0a9('0x9b'));_0x426ddc[_0xa0a9('0x7e')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x161d87[_0xa0a9('0x7e')](_0xa0a9('0x7f'),_[_0xa0a9('0x2e')](_0x295145,'id'));_0x426ddc['where'](_0xa0a9('0x7f'),_[_0xa0a9('0x2e')](_0x295145,'id'));}});})[_0xa0a9('0x12')](function(){if(_0xbdce0e['user'][_0xa0a9('0x9c')]===_0xa0a9('0x2b')&&!_0x3f9648&&!_0xbdce0e['query'][_0xa0a9('0x96')])return[];return db['sequelize']['query'](_0x161d87[_0xa0a9('0x9d')](),_0xcc00a8);})['then'](function(_0x49610e){_0x2fcc76[_0xa0a9('0x20')]=_0x49610e[_0xa0a9('0x4b')];if(_0x2fcc76['count']===0x0)return[];return db[_0xa0a9('0x9e')]['query'](_0x51387d[_0xa0a9('0x9d')](),_0xcc00a8)[_0xa0a9('0x12')](function(_0x5dc92b){_0x1397dd=_[_0xa0a9('0x9f')](_0x5dc92b,'id');_0xcc00a8=_[_0xa0a9('0x2a')](_0xcc00a8,{'model':db[_0xa0a9('0x40')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xbdce0e[_0xa0a9('0x45')][_0xa0a9('0x4a')]){_0xe82093['attributes'][_0xa0a9('0x33')](function(_0x235f87){_0x426ddc[_0xa0a9('0x50')]('i.'+_0x235f87);});}else{_0x426ddc[_0xa0a9('0x50')](_0xa0a9('0x92'),'unreadMessages');_0x426ddc[_0xa0a9('0x50')](_0xa0a9('0xa0'),_0xa0a9('0xa1'));_0x426ddc[_0xa0a9('0x50')]('a.mandatoryDisposition',_0xa0a9('0xa2'));_0x426ddc[_0xa0a9('0x50')](_0xa0a9('0xa3'),_0xa0a9('0xa4'));_0x426ddc[_0xa0a9('0x50')](_0xa0a9('0xa5'));_0x426ddc[_0xa0a9('0x50')]('c.firstName','Contact.firstName');_0x426ddc[_0xa0a9('0x50')](_0xa0a9('0xa6'),_0xa0a9('0xa7'));_0x426ddc[_0xa0a9('0x50')](_0xa0a9('0xa8'),'Contact.email');_0x426ddc['field'](_0xa0a9('0xa9'),_0xa0a9('0xaa'));_0x426ddc[_0xa0a9('0x50')](_0xa0a9('0xab'),_0xa0a9('0xac'));_0x426ddc[_0xa0a9('0x50')](_0xa0a9('0xad'),_0xa0a9('0xae'));_0x426ddc[_0xa0a9('0x50')](_0xa0a9('0xaf'),_0xa0a9('0xb0'));_0x426ddc[_0xa0a9('0x50')](_0xa0a9('0xb1'),_0xa0a9('0xb2'));_0x426ddc[_0xa0a9('0x50')](_0xa0a9('0xb3'),_0xa0a9('0x30'));}if(_0xe82093[_0xa0a9('0x21')])_0x426ddc[_0xa0a9('0x21')](_0xe82093[_0xa0a9('0x21')]);if(_0xe82093[_0xa0a9('0x1e')])_0x426ddc[_0xa0a9('0x1e')](_0xe82093[_0xa0a9('0x1e')]);return db['sequelize']['query'](_0x426ddc['toString'](),_0xcc00a8);})[_0xa0a9('0x12')](function(_0x21e364){if(_0x21e364[_0xa0a9('0x4b')]>0x0)_0x31bc1b[_0xa0a9('0x7e')](_0xa0a9('0xb4'),_[_0xa0a9('0x2e')](_0x21e364,'id'));return db['sequelize'][_0xa0a9('0x45')](_0x31bc1b[_0xa0a9('0x9d')](),_0xcc00a8)[_0xa0a9('0x12')](function(_0x160094){var _0x4a2ef5=_[_0xa0a9('0xb5')](_0x160094,_0xa0a9('0xb6'));var _0x3f3c0d=[];_0x21e364[_0xa0a9('0x33')](function(_0xb1715){_0x3f3c0d[_0xa0a9('0x34')](updateChatInteraction(_0xb1715,_0x1397dd,_0x4a2ef5));});return BPromise[_0xa0a9('0xb7')](_0x3f3c0d);});});})['then'](function(_0x5bcc9f){_0x2fcc76['rows']=_0x5bcc9f;return _0x2fcc76;})[_0xa0a9('0x12')](respondWithFilteredResult(_0x1a7879,_0xe82093))[_0xa0a9('0x35')](handleError(_0x1a7879,null));};exports[_0xa0a9('0xb8')]=function(_0x238192,_0x5e4d6c){var _0x577bd5={'raw':![],'where':{'id':_0x238192['params']['id']}},_0x311019={};_0x311019[_0xa0a9('0x44')]=_['keys'](db[_0xa0a9('0x40')][_0xa0a9('0x41')]);_0x311019['query']=_[_0xa0a9('0x46')](_0x238192[_0xa0a9('0x45')]);_0x311019['filters']=_[_0xa0a9('0x48')](_0x311019[_0xa0a9('0x44')],_0x311019[_0xa0a9('0x45')]);_0x577bd5[_0xa0a9('0x49')]=_[_0xa0a9('0x48')](_0x311019[_0xa0a9('0x44')],qs[_0xa0a9('0x4a')](_0x238192['query']['fields']));_0x577bd5[_0xa0a9('0x49')]=_0x577bd5[_0xa0a9('0x49')]['length']?_0x577bd5[_0xa0a9('0x49')]:_0x311019[_0xa0a9('0x44')];if(_0x238192[_0xa0a9('0x45')][_0xa0a9('0xb9')]){_0x577bd5[_0xa0a9('0xba')]=[{'all':!![]}];}_0x577bd5=_[_0xa0a9('0x2a')]({},_0x577bd5,_0x238192['options']);return db[_0xa0a9('0x40')]['find'](_0x577bd5)[_0xa0a9('0x12')](handleEntityNotFound(_0x5e4d6c,null))[_0xa0a9('0x12')](respondWithResult(_0x5e4d6c,null))['catch'](handleError(_0x5e4d6c,null));};exports[_0xa0a9('0xbb')]=function(_0x1a0bd7,_0x2f9e19){return db[_0xa0a9('0x40')][_0xa0a9('0xbb')](_0x1a0bd7[_0xa0a9('0x7b')],{})['then'](respondWithResult(_0x2f9e19,0xc9))[_0xa0a9('0x35')](handleError(_0x2f9e19,null));};exports[_0xa0a9('0xbc')]=function(_0x3f489a,_0x2d433f){if(_0x3f489a['body']['id']){delete _0x3f489a[_0xa0a9('0x7b')]['id'];}return db['ChatInteraction'][_0xa0a9('0x67')]({'where':{'id':_0x3f489a[_0xa0a9('0xbd')]['id']}})[_0xa0a9('0x12')](handleEntityNotFound(_0x2d433f,null))[_0xa0a9('0x12')](saveUpdates(_0x3f489a['body'],null))[_0xa0a9('0x12')](respondWithResult(_0x2d433f,null))[_0xa0a9('0x35')](handleError(_0x2d433f,null));};exports['destroy']=function(_0xa4809f,_0x3777dd){return db[_0xa0a9('0x40')]['find']({'where':{'id':_0xa4809f[_0xa0a9('0xbd')]['id']}})[_0xa0a9('0x12')](handleEntityNotFound(_0x3777dd,null))[_0xa0a9('0x12')](removeEntity(_0x3777dd,null))[_0xa0a9('0x35')](handleError(_0x3777dd,null));};exports[_0xa0a9('0xbe')]=function(_0x1d0c93,_0x37135f){return db[_0xa0a9('0x40')][_0xa0a9('0xbe')]()['then'](respondWithResult(_0x37135f,null))[_0xa0a9('0x35')](handleError(_0x37135f,null));};exports[_0xa0a9('0xbf')]=function(_0x6608c9,_0x62edc6){var _0x5e8748=_0x6608c9['params']['id'];var _0x1c52c9;var _0x20cb2e;var _0x17e067;return db[_0xa0a9('0x40')]['findOne']({'where':{'id':_0x5e8748}})[_0xa0a9('0x12')](function(_0x11e564){_0x1c52c9=_0x11e564;return db[_0xa0a9('0xc0')]['findOne']({'where':{'id':_0x11e564[_0xa0a9('0x96')]},'attributes':['id',_0xa0a9('0xc1'),_0xa0a9('0xc2'),_0xa0a9('0xc3'),_0xa0a9('0xc4'),_0xa0a9('0xc5')],'raw':!![]});})[_0xa0a9('0x12')](function(_0x33c4a7){if(_0x33c4a7&&_0x33c4a7['vidaooApiKey']&&_0x33c4a7[_0xa0a9('0xc2')]){_0x20cb2e=_0x33c4a7;var _0x350af5={'interaction':{'id':_0x5e8748},'agent':{'id':_0x6608c9['user']['id'],'name':_0x6608c9[_0xa0a9('0x98')][_0xa0a9('0x27')],'fullname':_0x6608c9[_0xa0a9('0x98')][_0xa0a9('0x2f')],'email':_0x6608c9['user'][_0xa0a9('0xc6')]},'contact':_0x6608c9[_0xa0a9('0x7b')][_0xa0a9('0xc7')],'account':_0x6608c9[_0xa0a9('0x7b')][_0xa0a9('0x2d')]};var _0xad0f9a={'rejectUnauthorized':![],'method':_0xa0a9('0xc8'),'url':_0xa0a9('0xc9'),'headers':{'X-APIKEY':_0x33c4a7['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x6608c9[_0xa0a9('0x98')][_0xa0a9('0xc6')]],'buttons':null,'topic':_0x20cb2e[_0xa0a9('0xc3')],'note':_[_0xa0a9('0xca')](_0x20cb2e[_0xa0a9('0xc4')])?null:getMustacheRender(_0x20cb2e[_0xa0a9('0xc4')],_0x350af5),'metadata':null},'redirect':_0xa0a9('0xcb'),'json':!![]};try{if(!_['isNull'](_0x20cb2e[_0xa0a9('0xc5')])){var _0x35b4ef=getMustacheRender(_0x20cb2e[_0xa0a9('0xc5')],_0x350af5);var _0x473915=JSON[_0xa0a9('0x82')](_0x35b4ef);_0xad0f9a[_0xa0a9('0x7b')][_0xa0a9('0xcc')]=_0x473915;}}catch(_0x436650){throw new db[(_0xa0a9('0xcd'))][(_0xa0a9('0xce'))](_0xa0a9('0xcf'));}return rp(_0xad0f9a);}else{throw new db[(_0xa0a9('0xcd'))][(_0xa0a9('0xce'))](_0xa0a9('0xd0'));}})[_0xa0a9('0x12')](function(_0x154862){_0x17e067=_0x154862;if(_0x17e067['id']){var _0x349c38={'body':_0x17e067[_0xa0a9('0xd1')],'ChatWebsiteId':_0x20cb2e['id'],'ChatInteractionId':_0x1c52c9['id'],'direction':'out','UserId':_0x6608c9[_0xa0a9('0x98')]['id']};return db[_0xa0a9('0xd2')]['create'](_0x349c38,{});}else{throw new db[(_0xa0a9('0xcd'))][(_0xa0a9('0xce'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xa0a9('0x12')](function(){return _0x1c52c9['updateAttributes']({'vidaooSessionId':_0x17e067['id']});})['then'](respondWithResult(_0x62edc6,null))[_0xa0a9('0x35')](handleError(_0x62edc6,null));};exports[_0xa0a9('0xd3')]=function(_0x372745,_0x4b951c){if(_0x372745[_0xa0a9('0x7b')]['id']){delete _0x372745['body']['id'];}return db[_0xa0a9('0x40')][_0xa0a9('0x67')]({'where':{'id':_0x372745[_0xa0a9('0xbd')]['id']},'include':[{'model':db[_0xa0a9('0xd4')],'as':_0xa0a9('0x6b')}]})[_0xa0a9('0x12')](handleEntityNotFound(_0x4b951c,null))[_0xa0a9('0x12')](saveUpdates(_0x372745[_0xa0a9('0x7b')],null))['then'](respondWithResult(_0x4b951c,null))[_0xa0a9('0x35')](handleError(_0x4b951c,null));};exports[_0xa0a9('0xd5')]=function(_0x27b2b9,_0x402032){if(_0x27b2b9[_0xa0a9('0x7b')]['id']){delete _0x27b2b9[_0xa0a9('0x7b')]['id'];}return db['ChatInteraction'][_0xa0a9('0x67')]({'where':{'id':_0x27b2b9[_0xa0a9('0xbd')]['id']}})[_0xa0a9('0x12')](function(_0x12c80f){if(!_0x12c80f){logger[_0xa0a9('0x17')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xa0a9('0xd5'),0x194,'entity\x20not\x20found');_0x402032[_0xa0a9('0x1b')](0x194);}else{if(_0x12c80f[_0xa0a9('0x3c')]){throw new db[(_0xa0a9('0xcd'))][(_0xa0a9('0xce'))](_0xa0a9('0xd6'));}}return _0x12c80f;})['then'](function(_0x17fcbb){if(_0x17fcbb){return _0x17fcbb['update']({'closed':_0x27b2b9[_0xa0a9('0x7b')][_0xa0a9('0x3b')],'disposition':_0x27b2b9[_0xa0a9('0x7b')][_0xa0a9('0x3d')]})[_0xa0a9('0x12')](function(_0x52dc56){return _0x52dc56;});}})[_0xa0a9('0x12')](function(){return respondWithRpcPromise('AbandonInteraction',_0xa0a9('0xd5'),_0x27b2b9[_0xa0a9('0x7b')],client9004);})[_0xa0a9('0x12')](respondWithResult(_0x402032,null))['catch'](handleError(_0x402032,null));};exports[_0xa0a9('0xd7')]=function(_0x5baba3,_0x44c430){_0x5baba3['body'][_0xa0a9('0x27')]=_0x5baba3[_0xa0a9('0xd8')][_0xa0a9('0xd9')];_0x5baba3['body']['basename']=_0x5baba3[_0xa0a9('0xd8')][_0xa0a9('0xda')];_0x5baba3['body']['type']=_0x5baba3[_0xa0a9('0xd8')]['mimetype'];return db['Attachment']['create'](_0x5baba3[_0xa0a9('0x7b')])[_0xa0a9('0x12')](respondWithResult(_0x44c430,0xc9))[_0xa0a9('0x35')](handleError(_0x44c430,null));};exports[_0xa0a9('0xdb')]=function(_0x4efd74,_0x9bd5f7){return db['ChatInteraction'][_0xa0a9('0xdc')]({'where':{'id':_0x4efd74[_0xa0a9('0xbd')]['id']},'raw':!![]})[_0xa0a9('0x12')](handleEntityNotFound(_0x9bd5f7,null))[_0xa0a9('0x12')](function(_0x46dbf5){if(_0x46dbf5){if(_0x46dbf5[_0xa0a9('0x3b')]){return _0x9bd5f7[_0xa0a9('0x1c')](0x193)[_0xa0a9('0x1d')]({'status':0x193,'message':_0xa0a9('0xdd')});}return db[_0xa0a9('0xde')][_0xa0a9('0xdc')]({'where':{'id':_0x4efd74[_0xa0a9('0x45')][_0xa0a9('0xdf')]},'raw':!![]})[_0xa0a9('0x12')](handleEntityNotFound(_0x9bd5f7,null));}})[_0xa0a9('0x12')](function(_0x514525){if(_0x514525){var _0xbb9cb1=_0x514525[_0xa0a9('0xe0')]!==null;var _0x27fd56=path[_0xa0a9('0xe1')](config[_0xa0a9('0xe2')],_0xa0a9('0xe3'));if(_0xbb9cb1){_0x27fd56=path[_0xa0a9('0xe1')](_0x27fd56,_0xa0a9('0xe4'));}var _0x5408ae=path[_0xa0a9('0xe1')](_0x27fd56,_0x514525['basename']);return _0x9bd5f7[_0xa0a9('0xe5')](_0x5408ae);}})[_0xa0a9('0x35')](handleError(_0x9bd5f7,null));};exports['close']=function(_0x482ce4,_0x324007){var _0x1bf013=null;var _0x5a5cb0=null;var _0x31948d=null;if(_0x482ce4[_0xa0a9('0x7b')]['id']){delete _0x482ce4[_0xa0a9('0x7b')]['id'];}if(_0x482ce4[_0xa0a9('0x7b')][_0xa0a9('0xe6')]){_0x31948d=path[_0xa0a9('0xe1')](config[_0xa0a9('0xe2')],_0xa0a9('0xe7'),util['format']('transcript-%s.txt',Date[_0xa0a9('0xe8')]()));_0x482ce4[_0xa0a9('0x7b')][_0xa0a9('0xe9')]=_0x31948d;}return db[_0xa0a9('0x40')][_0xa0a9('0x67')]({'where':{'id':_0x482ce4[_0xa0a9('0xbd')]['id']},'include':[{'model':db[_0xa0a9('0xd2')],'as':_0xa0a9('0xea'),'include':[{'model':db[_0xa0a9('0x79')],'as':_0xa0a9('0x79')}]}]})[_0xa0a9('0x12')](handleEntityNotFound(_0x324007,null))['then'](saveUpdates(_0x482ce4[_0xa0a9('0x7b')],null))['then'](function(_0x3479a4){if(_0x3479a4){_0x1bf013=_0x3479a4;return db[_0xa0a9('0xc0')][_0xa0a9('0x67')]({'where':{'id':_0x1bf013['ChatWebsiteId']}});}})[_0xa0a9('0x12')](function(_0x352584){if(_0x352584){_0x5a5cb0=_0x352584;return db[_0xa0a9('0xd4')][_0xa0a9('0x67')]({'where':{'id':_0x1bf013[_0xa0a9('0x71')]}});}})[_0xa0a9('0x12')](function(_0x35b7b3){if(_0x35b7b3){if(_0x31948d){var _0x79cac0=null;for(var _0x23b6be=0x1;_0x23b6be<_0x1bf013[_0xa0a9('0xea')]['length'];++_0x23b6be){_0x79cac0=_0x1bf013[_0xa0a9('0xea')][_0x23b6be];var _0x14a805=_0x79cac0[_0xa0a9('0x3c')]?util['format'](_0xa0a9('0xeb'),_0x5a5cb0[_0xa0a9('0xec')],_0x79cac0[_0xa0a9('0x3c')]):_0xa0a9('0xed');var _0x5093aa=_0x482ce4[_0xa0a9('0x7b')][_0xa0a9('0xee')]||util[_0xa0a9('0xef')](_0xa0a9('0xeb'),'Visitor',_0x79cac0[_0xa0a9('0x71')]);switch(_0x5a5cb0[_0xa0a9('0xf0')]){case _0xa0a9('0xf1'):_0x14a805=_0x79cac0[_0xa0a9('0x3c')]?util[_0xa0a9('0xef')](_0xa0a9('0xeb'),_0x5a5cb0[_0xa0a9('0xec')],_0x79cac0['UserId']):_0xa0a9('0xed');break;case _0xa0a9('0xf2'):_0x14a805=_0x79cac0[_0xa0a9('0x3c')]?_0x79cac0['User']['alias']||_0x79cac0[_0xa0a9('0x79')][_0xa0a9('0x2f')]:_0xa0a9('0xed');break;case _0xa0a9('0xf3'):_0x14a805=_0x79cac0[_0xa0a9('0x3c')]?_0x79cac0['User'][_0xa0a9('0x2f')]:_0xa0a9('0xed');break;default:_0x14a805=_0x79cac0[_0xa0a9('0x3c')]?util['format']('%s%d',_0x5a5cb0[_0xa0a9('0xec')],_0x79cac0['UserId']):_0xa0a9('0xed');}var _0x2389f7=util[_0xa0a9('0xef')]('[%s]\x20%s:\x20%s\x0a',moment(_0x79cac0[_0xa0a9('0x81')])['format'](_0xa0a9('0xf4')),_0x79cac0[_0xa0a9('0xf5')]==='in'?_0x5093aa:_0x14a805,_0x79cac0['body']);if(!_0x79cac0[_0xa0a9('0xf6')]){fs[_0xa0a9('0xf7')](_0x31948d,_0x2389f7);}}return db['MailAccount'][_0xa0a9('0xdc')]({'where':{'service':!![]},'include':[{'model':db[_0xa0a9('0xf8')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xa0a9('0xf9')],'as':_0xa0a9('0xf9'),'raw':!![]}]}]});}}})['then'](function(_0x48416b){if(!_0x48416b||!_0x48416b[_0xa0a9('0xfa')]||!_0x482ce4[_0xa0a9('0x7b')])return _0x1bf013;var _0x3b6362=_0x48416b[_0xa0a9('0xfb')]();return respondWithRpcPromise(_0xa0a9('0xfc'),_0xa0a9('0xfd'),{'account':_0x3b6362,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x48416b[_0xa0a9('0x27')],_0x48416b[_0xa0a9('0xc6')]||_0x48416b[_0xa0a9('0xfa')][_0xa0a9('0x98')]),'to':_0x482ce4[_0xa0a9('0x7b')][_0xa0a9('0xe6')],'subject':_0xa0a9('0xfe'),'text':util[_0xa0a9('0xef')](_0xa0a9('0xff'),_0x482ce4[_0xa0a9('0x7b')][_0xa0a9('0xe6')]),'attachments':[{'path':_0x31948d}]}})[_0xa0a9('0x12')](function(){return _0x1bf013;})[_0xa0a9('0x35')](function(_0x5bd10e){logger[_0xa0a9('0x17')](_0x5bd10e);});})[_0xa0a9('0x12')](respondWithStatusCode(_0x324007,0xc8))[_0xa0a9('0x35')](handleError(_0x324007,null));};exports[_0xa0a9('0x100')]=function(_0x50987c,_0x5a84fe){return db[_0xa0a9('0xd2')][_0xa0a9('0x67')]({'where':{'id':_0x50987c[_0xa0a9('0xbd')]['id']}})[_0xa0a9('0x12')](handleEntityNotFound(_0x5a84fe,null))[_0xa0a9('0x12')](function(_0x6e8b08){if(_0x6e8b08){return _0x6e8b08[_0xa0a9('0x100')](_0x50987c[_0xa0a9('0x7b')]['ids'],_[_0xa0a9('0x101')](_0x50987c['body'],[_0xa0a9('0x102'),'id'])||{});}})[_0xa0a9('0x12')](respondWithResult(_0x5a84fe,null))[_0xa0a9('0x35')](handleError(_0x5a84fe,null));};exports[_0xa0a9('0x103')]=function(_0x4761d5,_0x452abd){var _0x5d5e07={'raw':![],'where':{}};var _0x150702={};var _0x21cb84={'count':0x0,'rows':[]};return db[_0xa0a9('0x40')][_0xa0a9('0xdc')]({'where':{'id':_0x4761d5[_0xa0a9('0xbd')]['id']}})['then'](handleEntityNotFound(_0x452abd,null))[_0xa0a9('0x12')](function(_0x5553ab){if(_0x5553ab){_0x150702['model']=_[_0xa0a9('0x46')](db[_0xa0a9('0xd2')]['rawAttributes']);_0x150702['query']=_[_0xa0a9('0x46')](_0x4761d5[_0xa0a9('0x45')]);_0x150702[_0xa0a9('0x47')]=_['intersection'](_0x150702[_0xa0a9('0x44')],_0x150702[_0xa0a9('0x45')]);_0x5d5e07[_0xa0a9('0x49')]=_['intersection'](_0x150702[_0xa0a9('0x44')],qs['fields'](_0x4761d5[_0xa0a9('0x45')][_0xa0a9('0x4a')]));_0x5d5e07['attributes']=_0x5d5e07['attributes'][_0xa0a9('0x4b')]?_0x5d5e07['attributes']:_0x150702[_0xa0a9('0x44')];if(!_0x4761d5['query'][_0xa0a9('0x4c')](_0xa0a9('0x4d'))){_0x5d5e07[_0xa0a9('0x21')]=qs[_0xa0a9('0x21')](_0x4761d5['query'][_0xa0a9('0x21')]);_0x5d5e07[_0xa0a9('0x1e')]=qs[_0xa0a9('0x1e')](_0x4761d5['query'][_0xa0a9('0x1e')]);}_0x5d5e07[_0xa0a9('0x93')]=qs[_0xa0a9('0x4e')](_0x4761d5[_0xa0a9('0x45')][_0xa0a9('0x4e')]);_0x5d5e07[_0xa0a9('0x7e')]=qs[_0xa0a9('0x47')](_[_0xa0a9('0x4f')](_0x4761d5[_0xa0a9('0x45')],_0x150702[_0xa0a9('0x47')]));_0x5d5e07[_0xa0a9('0x7e')]['ChatInteractionId']=_0x5553ab['id'];if(_0x4761d5['query']['filter']){_0x5d5e07[_0xa0a9('0x7e')]=_[_0xa0a9('0x2a')](_0x5d5e07[_0xa0a9('0x7e')],{'$or':_['map'](_0x5d5e07[_0xa0a9('0x49')],function(_0x2d912d){var _0x4d1058={};_0x4d1058[_0x2d912d]={'$like':'%'+_0x4761d5[_0xa0a9('0x45')]['filter']+'%'};return _0x4d1058;})});}if(_0x4761d5['query'][_0xa0a9('0x83')]){var _0x5c9a49=_0x4761d5['query'][_0xa0a9('0x83')][_0xa0a9('0x32')](',');var _0x5d22fd={};_0x5d22fd[_0x5c9a49[0x0]]={'$gte':moment(_0x5c9a49[0x1])[_0xa0a9('0xef')](_0xa0a9('0x104'))};_0x5d5e07[_0xa0a9('0x7e')]=_[_0xa0a9('0x2a')](_0x5d5e07[_0xa0a9('0x7e')],_0x5d22fd);}_0x5d5e07=_[_0xa0a9('0x2a')]({},_0x5d5e07,_0x4761d5[_0xa0a9('0x105')]);return db['ChatMessage'][_0xa0a9('0x20')]({'where':_0x5d5e07[_0xa0a9('0x7e')]})[_0xa0a9('0x12')](function(_0x55ab15){_0x21cb84[_0xa0a9('0x20')]=_0x55ab15;if(_0x4761d5['query']['includeAll']){_0x5d5e07[_0xa0a9('0xba')]=[{'all':!![]}];}return db[_0xa0a9('0xd2')][_0xa0a9('0x106')](_0x5d5e07);})[_0xa0a9('0x12')](function(_0x5e48d7){_0x21cb84[_0xa0a9('0x107')]=_0x5e48d7;return _0x21cb84;});}})[_0xa0a9('0x12')](respondWithFilteredResult(_0x452abd,_0x5d5e07))['catch'](handleError(_0x452abd,null));};exports[_0xa0a9('0x108')]=function(_0x400095,_0x14a263){var _0xd4de40={'where':{}},_0x164ce4={},_0x1ccc1f={'count':0x0,'rows':[]};return db[_0xa0a9('0x40')]['findOne']({'where':{'id':_0x400095[_0xa0a9('0xbd')]['id']}})[_0xa0a9('0x12')](handleEntityNotFound(_0x14a263,null))[_0xa0a9('0x12')](function(_0x440856){if(_0x440856){_0x164ce4['model']=_['keys'](db['ChatMessage']['rawAttributes']);_0x164ce4['query']=_['keys'](_0x400095[_0xa0a9('0x45')]);_0x164ce4[_0xa0a9('0x47')]=_[_0xa0a9('0x48')](_0x164ce4['model'],_0x164ce4[_0xa0a9('0x45')]);_0xd4de40[_0xa0a9('0x49')]=_[_0xa0a9('0x48')](_0x164ce4['model'],qs[_0xa0a9('0x4a')](_0x400095[_0xa0a9('0x45')][_0xa0a9('0x4a')]));_0xd4de40['attributes']=_0xd4de40[_0xa0a9('0x49')]['length']?_0xd4de40['attributes']:_0x164ce4['model'];if(!_0x400095[_0xa0a9('0x45')][_0xa0a9('0x4c')]('nolimit')){_0xd4de40['limit']=qs[_0xa0a9('0x21')](_0x400095[_0xa0a9('0x45')][_0xa0a9('0x21')]);_0xd4de40[_0xa0a9('0x1e')]=qs['offset'](_0x400095[_0xa0a9('0x45')][_0xa0a9('0x1e')]);}_0xd4de40[_0xa0a9('0x93')]=qs[_0xa0a9('0x4e')](_0x400095[_0xa0a9('0x45')][_0xa0a9('0x4e')]);_0xd4de40[_0xa0a9('0x7e')]=qs[_0xa0a9('0x47')](_[_0xa0a9('0x4f')](_0x400095[_0xa0a9('0x45')],_0x164ce4[_0xa0a9('0x47')]));_0xd4de40[_0xa0a9('0x7e')]['ChatInteractionId']=_0x440856['id'];if(_0x400095[_0xa0a9('0x45')][_0xa0a9('0x8a')]){_0xd4de40[_0xa0a9('0x7e')]=_[_0xa0a9('0x2a')](_0xd4de40[_0xa0a9('0x7e')],{'$or':_[_0xa0a9('0x2e')](_0xd4de40[_0xa0a9('0x49')],function(_0x472cb0){var _0x4bf645={};_0x4bf645[_0x472cb0]={'$like':'%'+_0x400095['query'][_0xa0a9('0x8a')]+'%'};return _0x4bf645;})});}_0xd4de40['where'][_0xa0a9('0xf6')]=![];if(_0x400095[_0xa0a9('0x45')]['id']){_0xd4de40[_0xa0a9('0x7e')]['id']={'$gt':_0x400095[_0xa0a9('0x45')]['id']};}_0xd4de40=_[_0xa0a9('0x2a')]({},_0xd4de40,_0x400095[_0xa0a9('0x105')]);return db[_0xa0a9('0xd2')][_0xa0a9('0x20')]({'where':_0xd4de40[_0xa0a9('0x7e')]})[_0xa0a9('0x12')](function(_0x166de1){_0x1ccc1f[_0xa0a9('0x20')]=_0x166de1;_0xd4de40['include']=[];if(_0x400095[_0xa0a9('0x45')][_0xa0a9('0x109')]){_0xd4de40[_0xa0a9('0xba')][_0xa0a9('0x34')]({'model':db[_0xa0a9('0x79')],'as':_0xa0a9('0x79'),'attributes':['id',_0xa0a9('0x2f'),'alias']});}if(_0x400095['query']['includeAll']){_0xd4de40[_0xa0a9('0xba')]=[{'all':!![]}];}return db[_0xa0a9('0xd2')]['findAll'](_0xd4de40);})[_0xa0a9('0x12')](function(_0x36b55b){_0x1ccc1f[_0xa0a9('0x107')]=_0x36b55b;return _0x1ccc1f;});}})[_0xa0a9('0x12')](respondWithFilteredResult(_0x14a263,_0xd4de40))[_0xa0a9('0x35')](handleError(_0x14a263,null));};exports[_0xa0a9('0x10a')]=function(_0x39995d,_0x2bfd59){return db['ChatInteraction'][_0xa0a9('0x67')]({'where':{'id':_0x39995d['params']['id']}})[_0xa0a9('0x12')](handleEntityNotFound(_0x2bfd59,null))[_0xa0a9('0x12')](function(_0x51377d){if(_0x51377d){return _0x51377d['setTags'](_0x39995d['body'][_0xa0a9('0x102')],_[_0xa0a9('0x101')](_0x39995d[_0xa0a9('0x7b')],[_0xa0a9('0x102'),'id'])||{})['spread'](function(){return db['Tag'][_0xa0a9('0x106')]({'attributes':['id',_0xa0a9('0x27'),_0xa0a9('0x51')],'where':{'id':_0x39995d[_0xa0a9('0x7b')][_0xa0a9('0x102')]}});})[_0xa0a9('0x12')](function(_0x1f34d4){socket[_0xa0a9('0x10b')](_0xa0a9('0x10c'),{'id':Number(_0x39995d[_0xa0a9('0xbd')]['id']),'tags':_0x1f34d4||[]});return{'id':Number(_0x39995d[_0xa0a9('0xbd')]['id']),'tags':_0x1f34d4||[]};});}})[_0xa0a9('0x12')](respondWithResult(_0x2bfd59,null))[_0xa0a9('0x35')](handleError(_0x2bfd59,null));};exports['removeTags']=function(_0x58afbe,_0x45f667){return db[_0xa0a9('0x40')]['find']({'where':{'id':_0x58afbe['params']['id']}})[_0xa0a9('0x12')](handleEntityNotFound(_0x45f667,null))[_0xa0a9('0x12')](function(_0x3c9b49){if(_0x3c9b49){return _0x3c9b49[_0xa0a9('0x10d')](_0x58afbe[_0xa0a9('0x45')][_0xa0a9('0x102')]);}})[_0xa0a9('0x12')](respondWithStatusCode(_0x45f667,null))[_0xa0a9('0x35')](handleError(_0x45f667,null));};exports[_0xa0a9('0xe5')]=function(_0x307abf,_0x45f3eb){var _0x4ce9ab=moment()['unix']()['toString']();var _0x297188=path['join'](config['root'],_0xa0a9('0x10e'),_0xa0a9('0x10f'),_0xa0a9('0x110'));var _0x16ca55=path[_0xa0a9('0xe1')](config[_0xa0a9('0xe2')],_0xa0a9('0x10e'),_0xa0a9('0x10f'),_0xa0a9('0x111'));var _0x1104ce=path['join'](_0x297188,_0x4ce9ab);var _0x364531=util['format'](_0xa0a9('0x112'),_0x307abf[_0xa0a9('0xbd')]['id'],_0x4ce9ab);var _0x302f76=path[_0xa0a9('0xe1')](_0x297188,_0x364531);var _0x4e229b=[];_0x4e229b[_0xa0a9('0x34')]({'model':db[_0xa0a9('0x79')],'as':'User','attributes':['id',_0xa0a9('0x2f')],'raw':!![]});_0x4e229b['push']({'model':db['CmContact'],'as':_0xa0a9('0x6b'),'attributes':['id',_0xa0a9('0x113'),'lastName'],'raw':!![]});if(_0x307abf[_0xa0a9('0x45')][_0xa0a9('0x111')]){_0x4e229b['push']({'model':db[_0xa0a9('0xde')],'as':_0xa0a9('0xde'),'raw':!![]});}var _0x16e611=[{'model':db[_0xa0a9('0xd2')],'as':_0xa0a9('0xea'),'attributes':['id',_0xa0a9('0x7b'),_0xa0a9('0x81'),_0xa0a9('0xf5'),'secret',_0xa0a9('0x86')],'include':_0x4e229b}];_0x16e611[_0xa0a9('0x34')]({'model':db[_0xa0a9('0xc0')],'as':_0xa0a9('0x114'),'attributes':['id',_0xa0a9('0x27')]});_0x16e611[_0xa0a9('0x34')]({'model':db[_0xa0a9('0x79')],'as':_0xa0a9('0x115'),'attributes':['id',_0xa0a9('0x2f')]});return db[_0xa0a9('0x40')][_0xa0a9('0x67')]({'where':{'id':_0x307abf[_0xa0a9('0xbd')]['id']},'include':_0x16e611})['then'](handleEntityNotFound(_0x45f3eb,null))[_0xa0a9('0x12')](function(_0x21b0c2){if(_0x21b0c2){var _0x532a92=_0x21b0c2[_0xa0a9('0x116')]({'plain':!![]});fs[_0xa0a9('0x117')](_0x1104ce);var _0xcfd51d={'channel':'Chat','account':_0x532a92[_0xa0a9('0x114')]['name'],'agent':_0x532a92[_0xa0a9('0x115')]?_0x532a92['Owner'][_0xa0a9('0x2f')]:_0xa0a9('0x118'),'createdAt':moment(_0x532a92[_0xa0a9('0x81')])['format'](_0xa0a9('0x104'))[_0xa0a9('0x9d')](),'closedAt':_0x532a92[_0xa0a9('0x3b')]?moment(_0x532a92[_0xa0a9('0x119')])['format'](_0xa0a9('0x104'))[_0xa0a9('0x9d')]():'','disposition':_0x532a92[_0xa0a9('0x3d')],'chatInfo':{'browser':_0x532a92[_0xa0a9('0x11a')],'os':_0x532a92[_0xa0a9('0x11b')],'referer':_0x532a92[_0xa0a9('0x11c')],'customerIp':_0x532a92['customerIp'],'customerPort':_0x532a92['customerPort']?_0x532a92['customerPort']:_0xa0a9('0x118')},'messages':_(_0x532a92[_0xa0a9('0xea')])[_0xa0a9('0x11d')]()[_0xa0a9('0x8a')]({'secret':![]})[_0xa0a9('0x2e')](function(_0xe69cbf){if(_0xe69cbf['Attachment']){var _0x5c0b22=path[_0xa0a9('0xe1')](_0x16ca55,_0xe69cbf[_0xa0a9('0xde')][_0xa0a9('0x11e')]);if(fs['existsSync'](_0x5c0b22)){fs['createReadStream'](_0x5c0b22)[_0xa0a9('0x11f')](fs['createWriteStream'](path['join'](_0x1104ce,_0xe69cbf[_0xa0a9('0xde')][_0xa0a9('0x11e')])));}}return{'date':moment(_0xe69cbf['createdAt'])[_0xa0a9('0xef')](_0xa0a9('0x104'))[_0xa0a9('0x9d')](),'sender':_0xe69cbf['direction']===_0xa0a9('0x120')?_0xe69cbf[_0xa0a9('0x79')]?_0xe69cbf[_0xa0a9('0x79')][_0xa0a9('0x2f')]:'System':_0xe69cbf[_0xa0a9('0x6b')][_0xa0a9('0x113')]+(_0xe69cbf[_0xa0a9('0x6b')][_0xa0a9('0x121')]?'\x20'+_0xe69cbf[_0xa0a9('0x6b')][_0xa0a9('0x121')]:''),'body':_0xe69cbf[_0xa0a9('0xde')]?_0xe69cbf['Attachment']['basename']:_0xe69cbf['body'],'direction':_0xe69cbf[_0xa0a9('0xf5')]===_0xa0a9('0x120')?'A':'C','secret':_0xe69cbf[_0xa0a9('0xf6')],'read':_0xe69cbf[_0xa0a9('0x86')],'attachment':_0xe69cbf[_0xa0a9('0xde')]};})['value']()};return ejs['renderFile'](path[_0xa0a9('0xe1')](config[_0xa0a9('0xe2')],_0xa0a9('0x10e'),'views',_0xa0a9('0x122')),{'interaction':_0xcfd51d})[_0xa0a9('0x12')](function(_0xd552c9){var _0x3fa016=path[_0xa0a9('0xe1')](_0x1104ce,_0xa0a9('0x123')+_0x532a92['id']+'-'+_0x4ce9ab+_0xa0a9('0x124'));var _0xef07f0={'path':_0x3fa016,'channel':_0xa0a9('0x125'),'interactionId':_0x532a92['id']};return pdf[_0xa0a9('0x126')](_0xd552c9,_0xef07f0);})['then'](function(){return new Promise(function(_0x538668,_0x1092f8){zipdir(_0x1104ce,{'saveTo':_0x302f76},function(_0x2117a6,_0x1128aa){if(_0x2117a6)return _0x1092f8(_0x2117a6);return _0x538668(_0x1128aa);});})[_0xa0a9('0x12')](function(){return new BPromise(function(_0x3414bd,_0x50db7d){rimraf(_0x1104ce,function(_0x5560aa){if(_0x5560aa)_0x50db7d(_0x5560aa);return _0x3414bd();});});})[_0xa0a9('0x12')](function(){return _0x45f3eb[_0xa0a9('0xe5')](_0x302f76,_0x364531,function(_0x30a84c){if(_0x30a84c){logger[_0xa0a9('0x17')]('err',_0x30a84c);}else{fs[_0xa0a9('0x127')](_0x302f76);}});});});}else{return _0x45f3eb[_0xa0a9('0x1b')](0xc8);}})[_0xa0a9('0x35')](handleError(_0x45f3eb,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 12324b2..6cf1fa8 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 _0xafb3=['ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','../../mysqldb'];(function(_0x2fe0a5,_0x4f67b9){var _0x3acbcc=function(_0xaa2292){while(--_0xaa2292){_0x2fe0a5['push'](_0x2fe0a5['shift']());}};_0x3acbcc(++_0x4f67b9);}(_0xafb3,0x71));var _0x3afb=function(_0x526622,_0x2fa1f5){_0x526622=_0x526622-0x0;var _0x4019e0=_0xafb3[_0x526622];return _0x4019e0;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x3afb('0x0'))['db'][_0x3afb('0x1')];var ChatMessage=require(_0x3afb('0x0'))['db'][_0x3afb('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x3afb('0x3')](0x0);var events={'afterCreate':_0x3afb('0x4'),'afterUpdate':_0x3afb('0x5'),'afterDestroy':_0x3afb('0x6')};function emitEvent(_0x5de165){return function(_0x55d33e,_0xfd025b,_0x99d4c8){_0x55d33e[_0x3afb('0x7')]({'attributes':['id'],'raw':!![]})[_0x3afb('0x8')](function(_0x620496){_0x55d33e[_0x3afb('0x9')](_0x3afb('0xa'),_0x620496[_0x3afb('0xb')](function(_0x25e6ed){return{'id':_0x25e6ed['id']};}));return ChatMessage[_0x3afb('0xc')]({'where':{'ChatInteractionId':_0x55d33e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3afb('0x8')](function(_0x3a4772){_0x55d33e[_0x3afb('0x9')](_0x3afb('0xd'),_0x3a4772[_0x3afb('0xe')]);ChatInteractionEvents[_0x3afb('0xf')](_0x5de165+':'+_0x55d33e['id'],_0x55d33e);ChatInteractionEvents[_0x3afb('0xf')](_0x5de165,_0x55d33e);_0x99d4c8(null);})[_0x3afb('0x10')](_0x99d4c8(null));};}for(var e in events){if(events[_0x3afb('0x11')](e)){var event=events[e];ChatInteraction[_0x3afb('0x12')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file +var _0xebd0=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','then','setDataValue','Users','map','findAll','unreadMessages'];(function(_0x3a7455,_0x46b004){var _0x216c72=function(_0xdd775c){while(--_0xdd775c){_0x3a7455['push'](_0x3a7455['shift']());}};_0x216c72(++_0x46b004);}(_0xebd0,0x8a));var _0x0ebd=function(_0x4de2f6,_0x4661bd){_0x4de2f6=_0x4de2f6-0x0;var _0x1ef9f8=_0xebd0[_0x4de2f6];return _0x1ef9f8;};'use strict';var EventEmitter=require(_0x0ebd('0x0'));var ChatInteraction=require(_0x0ebd('0x1'))['db'][_0x0ebd('0x2')];var ChatMessage=require(_0x0ebd('0x1'))['db'][_0x0ebd('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x0ebd('0x4')](0x0);var events={'afterCreate':_0x0ebd('0x5'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2281b7){return function(_0x53a478,_0x29beb9,_0x17ce6e){_0x53a478['getUsers']({'attributes':['id'],'raw':!![]})[_0x0ebd('0x6')](function(_0x1e393c){_0x53a478[_0x0ebd('0x7')](_0x0ebd('0x8'),_0x1e393c[_0x0ebd('0x9')](function(_0x51e25c){return{'id':_0x51e25c['id']};}));return ChatMessage[_0x0ebd('0xa')]({'where':{'ChatInteractionId':_0x53a478['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0ebd('0x6')](function(_0x13f262){_0x53a478['setDataValue'](_0x0ebd('0xb'),_0x13f262['length']);ChatInteractionEvents['emit'](_0x2281b7+':'+_0x53a478['id'],_0x53a478);ChatInteractionEvents['emit'](_0x2281b7,_0x53a478);_0x17ce6e(null);})['catch'](_0x17ce6e(null));};}for(var e in events){if(events[_0x0ebd('0xc')](e)){var event=events[e];ChatInteraction[_0x0ebd('0xd')](e,emitEvent(event));}}module[_0x0ebd('0xe')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 9bff116..259c37b 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 _0x63eb=['utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./chatInteraction.attributes','exports','define','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x36376a,_0x3fd974){var _0x34c4e6=function(_0x4d2818){while(--_0x4d2818){_0x36376a['push'](_0x36376a['shift']());}};_0x34c4e6(++_0x3fd974);}(_0x63eb,0x1f1));var _0xb63e=function(_0x47a852,_0x215dc0){_0x47a852=_0x47a852-0x0;var _0x223c56=_0x63eb[_0x47a852];return _0x223c56;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb63e('0x0'))(_0xb63e('0x1'));var moment=require(_0xb63e('0x2'));var BPromise=require(_0xb63e('0x3'));var rp=require(_0xb63e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb63e('0x5'));var attributes=require(_0xb63e('0x6'));module[_0xb63e('0x7')]=function(_0x29317a,_0x2da1da){return _0x29317a[_0xb63e('0x8')]('ChatInteraction',attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2bfc0a,_0x3fe6e9,_0x18d338){if(_0x2bfc0a[_0xb63e('0x9')](_0xb63e('0xa'))){_0x2bfc0a['closedAt']=moment()[_0xb63e('0xb')](_0xb63e('0xc'));}_0x18d338(null,_0x2bfc0a);}},'charset':_0xb63e('0xd'),'collate':_0xb63e('0xe')});}; \ No newline at end of file +var _0x4b1d=['../../config/environment','./chatInteraction.attributes','exports','ChatInteraction','chat_interactions','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x13f58e,_0x265b14){var _0x47f915=function(_0x9676da){while(--_0x9676da){_0x13f58e['push'](_0x13f58e['shift']());}};_0x47f915(++_0x265b14);}(_0x4b1d,0x162));var _0xd4b1=function(_0x53b853,_0x3d6318){_0x53b853=_0x53b853-0x0;var _0x3209ad=_0x4b1d[_0x53b853];return _0x3209ad;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd4b1('0x0'))(_0xd4b1('0x1'));var moment=require('moment');var BPromise=require(_0xd4b1('0x2'));var rp=require(_0xd4b1('0x3'));var fs=require('fs');var path=require(_0xd4b1('0x4'));var rimraf=require(_0xd4b1('0x5'));var config=require(_0xd4b1('0x6'));var attributes=require(_0xd4b1('0x7'));module[_0xd4b1('0x8')]=function(_0x23eff4,_0x583b77){return _0x23eff4['define'](_0xd4b1('0x9'),attributes,{'tableName':_0xd4b1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x365b07,_0x22468a,_0xa34ba6){if(_0x365b07['changed']('closed')){_0x365b07['closedAt']=moment()[_0xd4b1('0xb')](_0xd4b1('0xc'));}_0xa34ba6(null,_0x365b07);}},'charset':_0xd4b1('0xd'),'collate':_0xd4b1('0xe')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index ee6f66a..06120ed 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 _0x1407=['stringify','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','ChatInteraction','update','body','options','raw','where','attributes','limit','UpdateChatInteraction','addTags','ids','omit','spread','AddTags'];(function(_0x58780a,_0x292ad){var _0x9ec845=function(_0x416669){while(--_0x416669){_0x58780a['push'](_0x58780a['shift']());}};_0x9ec845(++_0x292ad);}(_0x1407,0x1c4));var _0x7140=function(_0x3cfa0d,_0x1b9865){_0x3cfa0d=_0x3cfa0d-0x0;var _0x1e8b75=_0x1407[_0x3cfa0d];return _0x1e8b75;};'use strict';var _=require(_0x7140('0x0'));var util=require(_0x7140('0x1'));var moment=require(_0x7140('0x2'));var BPromise=require('bluebird');var rs=require(_0x7140('0x3'));var fs=require('fs');var Redis=require(_0x7140('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7140('0x5'));var logger=require(_0x7140('0x6'))('rpc');var config=require(_0x7140('0x7'));var jayson=require(_0x7140('0x8'));var client=jayson[_0x7140('0x9')][_0x7140('0xa')]({'port':0x232a});config[_0x7140('0xb')]=_[_0x7140('0xc')](config[_0x7140('0xb')],{'host':_0x7140('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7140('0xb')]));require('./chatInteraction.socket')[_0x7140('0xe')](socket);function respondWithRpcPromise(_0x4e2219,_0x45bce8,_0x1676ab){return new BPromise(function(_0x12cbe4,_0x34d327){return client[_0x7140('0xf')](_0x4e2219,_0x1676ab)[_0x7140('0x10')](function(_0x1969dc){logger['info'](_0x7140('0x11'),_0x45bce8,_0x7140('0x12'));logger[_0x7140('0x13')](_0x7140('0x14'),_0x45bce8,_0x7140('0x12'),JSON['stringify'](_0x1969dc));if(_0x1969dc[_0x7140('0x15')]){if(_0x1969dc[_0x7140('0x15')][_0x7140('0x16')]===0x1f4){logger['error'](_0x7140('0x11'),_0x45bce8,_0x1969dc[_0x7140('0x15')]['message']);return _0x34d327(_0x1969dc[_0x7140('0x15')][_0x7140('0x17')]);}logger[_0x7140('0x15')](_0x7140('0x11'),_0x45bce8,_0x1969dc[_0x7140('0x15')][_0x7140('0x17')]);return _0x12cbe4(_0x1969dc[_0x7140('0x15')][_0x7140('0x17')]);}else{logger[_0x7140('0x18')](_0x7140('0x11'),_0x45bce8,_0x7140('0x12'));_0x12cbe4(_0x1969dc['result'][_0x7140('0x17')]);}})[_0x7140('0x19')](function(_0x1b741c){logger[_0x7140('0x15')](_0x7140('0x11'),_0x45bce8,_0x1b741c);_0x34d327(_0x1b741c);});});}exports['UpdateChatInteraction']=function(_0x222da9){var _0x40072b=this;return new Promise(function(_0x3ca028,_0x5dcdc8){return db[_0x7140('0x1a')][_0x7140('0x1b')](_0x222da9[_0x7140('0x1c')],{'raw':_0x222da9[_0x7140('0x1d')]?_0x222da9[_0x7140('0x1d')][_0x7140('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x222da9[_0x7140('0x1d')]?_0x222da9['options'][_0x7140('0x1f')]||null:null,'attributes':_0x222da9[_0x7140('0x1d')]?_0x222da9[_0x7140('0x1d')][_0x7140('0x20')]||null:null,'limit':_0x222da9[_0x7140('0x1d')]?_0x222da9[_0x7140('0x1d')][_0x7140('0x21')]||null:null})[_0x7140('0x10')](function(_0x563c3d){logger['info'](_0x7140('0x22'),_0x222da9);logger['debug']('UpdateChatInteraction',_0x222da9,JSON['stringify'](_0x563c3d));_0x3ca028(_0x563c3d);})[_0x7140('0x19')](function(_0x1605f9){logger[_0x7140('0x15')](_0x7140('0x22'),_0x1605f9[_0x7140('0x17')],_0x222da9);_0x5dcdc8(_0x40072b[_0x7140('0x15')](0x1f4,_0x1605f9['message']));});});};exports['AddTagsToChatInteraction']=function(_0x2ed464){return new Promise(function(_0x3fcf4c,_0x2b7bd8){return db['ChatInteraction']['find']({'where':_0x2ed464[_0x7140('0x1d')]?_0x2ed464[_0x7140('0x1d')][_0x7140('0x1f')]||null:null})['then'](function(_0x50c7b8){if(_0x50c7b8){return _0x50c7b8[_0x7140('0x23')](_0x2ed464[_0x7140('0x1c')][_0x7140('0x24')],_[_0x7140('0x25')](_0x2ed464[_0x7140('0x1c')],[_0x7140('0x24'),'id'])||{});}})[_0x7140('0x26')](function(_0x58a46a){logger['info'](_0x7140('0x27'),_0x2ed464);logger[_0x7140('0x13')](_0x7140('0x27'),_0x2ed464,JSON[_0x7140('0x28')](_0x58a46a));_0x3fcf4c(_0x58a46a);})[_0x7140('0x19')](function(_0x5cd3ba){logger['error'](_0x7140('0x27'),_0x5cd3ba[_0x7140('0x17')],_0x2ed464);_0x2b7bd8(_this[_0x7140('0x15')](0x1f4,_0x5cd3ba[_0x7140('0x17')]));});});}; \ No newline at end of file +var _0x073f=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','limit','AddTagsToChatInteraction','find','addTags','omit','ids','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x44a749,_0x5e6c20){var _0x4e379f=function(_0x4ce080){while(--_0x4ce080){_0x44a749['push'](_0x44a749['shift']());}};_0x4e379f(++_0x5e6c20);}(_0x073f,0x1c5));var _0xf073=function(_0x29db36,_0x410ae9){_0x29db36=_0x29db36-0x0;var _0x234e87=_0x073f[_0x29db36];return _0x234e87;};'use strict';var _=require('lodash');var util=require(_0xf073('0x0'));var moment=require(_0xf073('0x1'));var BPromise=require(_0xf073('0x2'));var rs=require(_0xf073('0x3'));var fs=require('fs');var Redis=require(_0xf073('0x4'));var db=require(_0xf073('0x5'))['db'];var utils=require(_0xf073('0x6'));var logger=require(_0xf073('0x7'))(_0xf073('0x8'));var config=require(_0xf073('0x9'));var jayson=require(_0xf073('0xa'));var client=jayson[_0xf073('0xb')][_0xf073('0xc')]({'port':0x232a});config[_0xf073('0xd')]=_[_0xf073('0xe')](config[_0xf073('0xd')],{'host':_0xf073('0xf'),'port':0x18eb});var socket=require(_0xf073('0x10'))(new Redis(config['redis']));require('./chatInteraction.socket')[_0xf073('0x11')](socket);function respondWithRpcPromise(_0x137e39,_0x5b0309,_0x26d9f5){return new BPromise(function(_0x55c1f9,_0x52e211){return client[_0xf073('0x12')](_0x137e39,_0x26d9f5)[_0xf073('0x13')](function(_0x354aca){logger[_0xf073('0x14')](_0xf073('0x15'),_0x5b0309,_0xf073('0x16'));logger[_0xf073('0x17')](_0xf073('0x18'),_0x5b0309,_0xf073('0x16'),JSON[_0xf073('0x19')](_0x354aca));if(_0x354aca[_0xf073('0x1a')]){if(_0x354aca[_0xf073('0x1a')][_0xf073('0x1b')]===0x1f4){logger[_0xf073('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x5b0309,_0x354aca[_0xf073('0x1a')][_0xf073('0x1c')]);return _0x52e211(_0x354aca[_0xf073('0x1a')][_0xf073('0x1c')]);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0x5b0309,_0x354aca[_0xf073('0x1a')]['message']);return _0x55c1f9(_0x354aca['error']['message']);}else{logger['info'](_0xf073('0x15'),_0x5b0309,_0xf073('0x16'));_0x55c1f9(_0x354aca[_0xf073('0x1d')][_0xf073('0x1c')]);}})[_0xf073('0x1e')](function(_0x5c2059){logger[_0xf073('0x1a')](_0xf073('0x15'),_0x5b0309,_0x5c2059);_0x52e211(_0x5c2059);});});}exports[_0xf073('0x1f')]=function(_0x23bcba){var _0x52c030=this;return new Promise(function(_0x244fab,_0x5497dc){return db[_0xf073('0x20')][_0xf073('0x21')](_0x23bcba[_0xf073('0x22')],{'raw':_0x23bcba[_0xf073('0x23')]?_0x23bcba['options'][_0xf073('0x24')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x23bcba[_0xf073('0x23')]?_0x23bcba[_0xf073('0x23')][_0xf073('0x25')]||null:null,'attributes':_0x23bcba[_0xf073('0x23')]?_0x23bcba[_0xf073('0x23')][_0xf073('0x26')]||null:null,'limit':_0x23bcba[_0xf073('0x23')]?_0x23bcba[_0xf073('0x23')][_0xf073('0x27')]||null:null})[_0xf073('0x13')](function(_0x26259c){logger[_0xf073('0x14')]('UpdateChatInteraction',_0x23bcba);logger['debug'](_0xf073('0x1f'),_0x23bcba,JSON['stringify'](_0x26259c));_0x244fab(_0x26259c);})[_0xf073('0x1e')](function(_0x3c99e5){logger[_0xf073('0x1a')](_0xf073('0x1f'),_0x3c99e5[_0xf073('0x1c')],_0x23bcba);_0x5497dc(_0x52c030[_0xf073('0x1a')](0x1f4,_0x3c99e5[_0xf073('0x1c')]));});});};exports[_0xf073('0x28')]=function(_0x1a5d88){return new Promise(function(_0x3801d6,_0x2f8c04){return db[_0xf073('0x20')][_0xf073('0x29')]({'where':_0x1a5d88[_0xf073('0x23')]?_0x1a5d88[_0xf073('0x23')][_0xf073('0x25')]||null:null})[_0xf073('0x13')](function(_0x474173){if(_0x474173){return _0x474173[_0xf073('0x2a')](_0x1a5d88[_0xf073('0x22')]['ids'],_[_0xf073('0x2b')](_0x1a5d88[_0xf073('0x22')],[_0xf073('0x2c'),'id'])||{});}})['spread'](function(_0x562358){logger[_0xf073('0x14')](_0xf073('0x2d'),_0x1a5d88);logger['debug']('AddTags',_0x1a5d88,JSON[_0xf073('0x19')](_0x562358));_0x3801d6(_0x562358);})[_0xf073('0x1e')](function(_0x4d17fa){logger[_0xf073('0x1a')]('AddTags',_0x4d17fa[_0xf073('0x1c')],_0x1a5d88);_0x2f8c04(_this[_0xf073('0x1a')](0x1f4,_0x4d17fa[_0xf073('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 6c69e93..5662ad1 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 _0xaf5d=['emit','removeListener','register','length','chatInteraction:','./chatInteraction.events','save','remove','update'];(function(_0x98cf38,_0x2462bd){var _0x12bc93=function(_0x5ae7c0){while(--_0x5ae7c0){_0x98cf38['push'](_0x98cf38['shift']());}};_0x12bc93(++_0x2462bd);}(_0xaf5d,0xf8));var _0xdaf5=function(_0x2442be,_0x1b976c){_0x2442be=_0x2442be-0x0;var _0x4c0840=_0xaf5d[_0x2442be];return _0x4c0840;};'use strict';var ChatInteractionEvents=require(_0xdaf5('0x0'));var events=[_0xdaf5('0x1'),_0xdaf5('0x2'),_0xdaf5('0x3')];function createListener(_0x46cf22,_0x4185b8){return function(_0x5b04ed){_0x4185b8[_0xdaf5('0x4')](_0x46cf22,_0x5b04ed);};}function removeListener(_0x58d115,_0x4c9d88){return function(){ChatInteractionEvents[_0xdaf5('0x5')](_0x58d115,_0x4c9d88);};}exports[_0xdaf5('0x6')]=function(_0x533e08){for(var _0x508c1a=0x0,_0x336c61=events[_0xdaf5('0x7')];_0x508c1a<_0x336c61;_0x508c1a++){var _0x3f6fc4=events[_0x508c1a];var _0x1661da=createListener(_0xdaf5('0x8')+_0x3f6fc4,_0x533e08);ChatInteractionEvents['on'](_0x3f6fc4,_0x1661da);}}; \ No newline at end of file +var _0x19e4=['./chatInteraction.events','save','remove','removeListener','register','chatInteraction:'];(function(_0x5ef25a,_0x5392c3){var _0x4dca64=function(_0x244a3e){while(--_0x244a3e){_0x5ef25a['push'](_0x5ef25a['shift']());}};_0x4dca64(++_0x5392c3);}(_0x19e4,0x1c2));var _0x419e=function(_0x561628,_0x54ed9a){_0x561628=_0x561628-0x0;var _0x1d654e=_0x19e4[_0x561628];return _0x1d654e;};'use strict';var ChatInteractionEvents=require(_0x419e('0x0'));var events=[_0x419e('0x1'),_0x419e('0x2'),'update'];function createListener(_0xa3d480,_0x40eb54){return function(_0x1bea8b){_0x40eb54['emit'](_0xa3d480,_0x1bea8b);};}function removeListener(_0x4304b5,_0x4b8f62){return function(){ChatInteractionEvents[_0x419e('0x3')](_0x4304b5,_0x4b8f62);};}exports[_0x419e('0x4')]=function(_0x2f4e87){for(var _0x3128e5=0x0,_0x36bbcc=events['length'];_0x3128e5<_0x36bbcc;_0x3128e5++){var _0x320822=events[_0x3128e5];var _0x2efdb7=createListener(_0x419e('0x5')+_0x320822,_0x2f4e87);ChatInteractionEvents['on'](_0x320822,_0x2efdb7);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 6065e08..3ea65e3 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 _0x8948=['create','/:id/vidaoo','diskStorage','join','root','format','%s-%s','originalname','replace','single','attachmentUpload','addMessage','/:id/tags','tracked','addTags','chat','chatinteraction:update','update','put','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','chatinteraction:destroy','destroy','delete','removeTags','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','/:id/download','post'];(function(_0x3203fd,_0x2bc0f4){var _0xefe818=function(_0x346372){while(--_0x346372){_0x3203fd['push'](_0x3203fd['shift']());}};_0xefe818(++_0x2bc0f4);}(_0x8948,0x15c));var _0x8894=function(_0x28f2fa,_0x66ba74){_0x28f2fa=_0x28f2fa-0x0;var _0x2d53a6=_0x8948[_0x28f2fa];return _0x2d53a6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8894('0x0'));var timeout=require(_0x8894('0x1'));var express=require('express');var router=express[_0x8894('0x2')]();var fs_extra=require(_0x8894('0x3'));var auth=require(_0x8894('0x4'));var interaction=require(_0x8894('0x5'));var config=require(_0x8894('0x6'));var controller=require(_0x8894('0x7'));router[_0x8894('0x8')]('/',auth[_0x8894('0x9')](),controller[_0x8894('0xa')]);router[_0x8894('0x8')](_0x8894('0xb'),auth['isAuthenticated'](),controller[_0x8894('0xc')]);router[_0x8894('0x8')](_0x8894('0xd'),auth[_0x8894('0xe')](),controller[_0x8894('0xf')]);router[_0x8894('0x8')](_0x8894('0x10'),auth[_0x8894('0xe')](),controller[_0x8894('0x11')]);router[_0x8894('0x8')](_0x8894('0x12'),auth[_0x8894('0x9')](),controller[_0x8894('0x13')]);router[_0x8894('0x8')](_0x8894('0x14'),auth[_0x8894('0xe')](),controller['getMyMessages']);router[_0x8894('0x8')](_0x8894('0x15'),auth['isAuthenticated'](),controller['download']);router[_0x8894('0x16')]('/',auth[_0x8894('0x9')](),controller[_0x8894('0x17')]);router['post'](_0x8894('0x18'),auth[_0x8894('0x9')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x8894('0x19')]({'destination':function(_0x140eb9,_0x47ab1a,_0x230ff4){_0x230ff4(null,path[_0x8894('0x1a')](config[_0x8894('0x1b')],'server/files/attachments/'));},'filename':function(_0x569449,_0x4827d3,_0x275aef){_0x275aef(null,util[_0x8894('0x1c')](_0x8894('0x1d'),Date['now'](),_0x4827d3[_0x8894('0x1e')][_0x8894('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8894('0x16')]('/:id/attachment_upload',upload[_0x8894('0x20')]('file'),controller[_0x8894('0x21')]);router[_0x8894('0x16')]('/:id/messages',auth[_0x8894('0xe')](),controller[_0x8894('0x22')]);router[_0x8894('0x16')](_0x8894('0x23'),auth[_0x8894('0x9')](),interaction[_0x8894('0x24')]('chat','chatinteraction:addtags'),controller[_0x8894('0x25')]);router['put'](_0x8894('0xd'),auth[_0x8894('0x9')](),interaction[_0x8894('0x24')](_0x8894('0x26'),_0x8894('0x27')),controller[_0x8894('0x28')]);router[_0x8894('0x29')](_0x8894('0x2a'),controller[_0x8894('0x2b')]);router[_0x8894('0x29')](_0x8894('0x2c'),auth[_0x8894('0xe')](),controller[_0x8894('0x2d')]);router['put'](_0x8894('0x2e'),controller[_0x8894('0x2f')]);router['delete'](_0x8894('0xd'),auth[_0x8894('0x9')](),interaction[_0x8894('0x24')](_0x8894('0x26'),_0x8894('0x30')),controller[_0x8894('0x31')]);router[_0x8894('0x32')](_0x8894('0x23'),auth['isAuthenticated'](),controller[_0x8894('0x33')]);module[_0x8894('0x34')]=router; \ No newline at end of file +var _0x1e6e=['getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','now','originalname','/:id/attachment_upload','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','destroy','delete','removeTags','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./chatInteraction.controller','isAuthenticated','/describe','describe','get','/:id','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages','/:id/my_messages'];(function(_0x16540d,_0xccef5c){var _0x40859e=function(_0x2fd290){while(--_0x2fd290){_0x16540d['push'](_0x16540d['shift']());}};_0x40859e(++_0xccef5c);}(_0x1e6e,0xb6));var _0xe1e6=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x1e6e[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0xe1e6('0x0'));var util=require(_0xe1e6('0x1'));var path=require(_0xe1e6('0x2'));var timeout=require(_0xe1e6('0x3'));var express=require('express');var router=express[_0xe1e6('0x4')]();var fs_extra=require(_0xe1e6('0x5'));var auth=require(_0xe1e6('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe1e6('0x7'));router['get']('/',auth[_0xe1e6('0x8')](),controller['index']);router['get'](_0xe1e6('0x9'),auth[_0xe1e6('0x8')](),controller[_0xe1e6('0xa')]);router[_0xe1e6('0xb')](_0xe1e6('0xc'),auth['isChatInteractionAuthorized'](),controller['show']);router[_0xe1e6('0xb')](_0xe1e6('0xd'),auth[_0xe1e6('0xe')](),controller[_0xe1e6('0xf')]);router[_0xe1e6('0xb')](_0xe1e6('0x10'),auth[_0xe1e6('0x8')](),controller['getMessages']);router[_0xe1e6('0xb')](_0xe1e6('0x11'),auth['isChatInteractionAuthorized'](),controller[_0xe1e6('0x12')]);router['get'](_0xe1e6('0x13'),auth['isAuthenticated'](),controller[_0xe1e6('0x14')]);router[_0xe1e6('0x15')]('/',auth[_0xe1e6('0x8')](),controller[_0xe1e6('0x16')]);router[_0xe1e6('0x15')](_0xe1e6('0x17'),auth[_0xe1e6('0x8')](),controller[_0xe1e6('0x18')]);var upload=multer({'storage':multer[_0xe1e6('0x19')]({'destination':function(_0x302db6,_0xd65ff5,_0x317af0){_0x317af0(null,path[_0xe1e6('0x1a')](config[_0xe1e6('0x1b')],'server/files/attachments/'));},'filename':function(_0x1bdfdf,_0x4e3abf,_0x31aeb1){_0x31aeb1(null,util['format']('%s-%s',Date[_0xe1e6('0x1c')](),_0x4e3abf[_0xe1e6('0x1d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe1e6('0x15')](_0xe1e6('0x1e'),upload['single'](_0xe1e6('0x1f')),controller[_0xe1e6('0x20')]);router[_0xe1e6('0x15')](_0xe1e6('0x10'),auth[_0xe1e6('0xe')](),controller[_0xe1e6('0x21')]);router[_0xe1e6('0x15')](_0xe1e6('0x22'),auth['isAuthenticated'](),interaction[_0xe1e6('0x23')](_0xe1e6('0x24'),_0xe1e6('0x25')),controller[_0xe1e6('0x26')]);router[_0xe1e6('0x27')](_0xe1e6('0xc'),auth[_0xe1e6('0x8')](),interaction[_0xe1e6('0x23')](_0xe1e6('0x24'),_0xe1e6('0x28')),controller['update']);router['put'](_0xe1e6('0x29'),controller[_0xe1e6('0x2a')]);router['put'](_0xe1e6('0x2b'),auth['isChatInteractionAuthorized'](),controller[_0xe1e6('0x2c')]);router[_0xe1e6('0x27')](_0xe1e6('0x2d'),controller[_0xe1e6('0x2e')]);router['delete'](_0xe1e6('0xc'),auth[_0xe1e6('0x8')](),interaction[_0xe1e6('0x23')]('chat','chatinteraction:destroy'),controller[_0xe1e6('0x2f')]);router[_0xe1e6('0x30')](_0xe1e6('0x22'),auth['isAuthenticated'](),controller[_0xe1e6('0x31')]);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 88db4f1..1f7c850 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 _0x55cb=['TEXT','medium','INTEGER','sequelize','exports'];(function(_0x313652,_0x3098da){var _0x5af545=function(_0x25a653){while(--_0x25a653){_0x313652['push'](_0x313652['shift']());}};_0x5af545(++_0x3098da);}(_0x55cb,0xa3));var _0xb55c=function(_0x3f8282,_0x11b607){_0x3f8282=_0x3f8282-0x0;var _0x50f918=_0x55cb[_0x3f8282];return _0x50f918;};'use strict';var Sequelize=require(_0xb55c('0x0'));module[_0xb55c('0x1')]={'body':{'type':Sequelize[_0xb55c('0x2')](_0xb55c('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xb55c('0x4')]}}; \ No newline at end of file +var _0x73fd=['TEXT','medium','sequelize','exports'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x73fd,0xe6));var _0xd73f=function(_0x3690de,_0xaad404){_0x3690de=_0x3690de-0x0;var _0x9737de=_0x73fd[_0x3690de];return _0x9737de;};'use strict';var Sequelize=require(_0xd73f('0x0'));module[_0xd73f('0x1')]={'body':{'type':Sequelize[_0xd73f('0x2')](_0xd73f('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 4bea499..6d0fcd6 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 _0x5241=['includeAll','find','catch','create','update','body','destroy','describe','get','messages','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','admin','user','role','internal','online','lastLoginAt','showWebBar','-online','VoiceQueue','VoiceQueues','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','agent','resourceId','push','createdAt','ToId','-createdAt','all','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','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/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','error','stack','send','index','map','ChatInternalMessage','fieldName','type','key','model','name','query','attributes','intersection','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','include','findAll','rows','params','keys','fields'];(function(_0x2962d5,_0x38deda){var _0x273406=function(_0x3e0775){while(--_0x3e0775){_0x2962d5['push'](_0x2962d5['shift']());}};_0x273406(++_0x38deda);}(_0x5241,0x1d4));var _0x1524=function(_0x3b77f0,_0x22d102){_0x3b77f0=_0x3b77f0-0x0;var _0x1edcca=_0x5241[_0x3b77f0];return _0x1edcca;};'use strict';var emlformat=require(_0x1524('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1524('0x1'));var jsonpatch=require(_0x1524('0x2'));var rp=require(_0x1524('0x3'));var moment=require(_0x1524('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1524('0x5'));var util=require(_0x1524('0x6'));var path=require('path');var sox=require(_0x1524('0x7'));var csv=require(_0x1524('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1524('0x9'));var _=require(_0x1524('0xa'));var squel=require(_0x1524('0xb'));var crypto=require(_0x1524('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1524('0xd'));var toCsv=require(_0x1524('0x8'));var querystring=require(_0x1524('0xe'));var Papa=require(_0x1524('0xf'));var Redis=require(_0x1524('0x10'));var authService=require(_0x1524('0x11'));var qs=require(_0x1524('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1524('0x13'));var logger=require(_0x1524('0x14'))('api');var utils=require(_0x1524('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1524('0x16'));var db=require(_0x1524('0x17'))['db'];config[_0x1524('0x18')]=_[_0x1524('0x19')](config[_0x1524('0x18')],{'host':_0x1524('0x1a'),'port':0x18eb});var socket=require(_0x1524('0x1b'))(new Redis(config[_0x1524('0x18')]));require(_0x1524('0x1c'))['register'](socket);function respondWithStatusCode(_0x1089e9,_0x3f4e0b){_0x3f4e0b=_0x3f4e0b||0xcc;return function(_0x1d6fbb){if(_0x1d6fbb){return _0x1089e9[_0x1524('0x1d')](_0x3f4e0b);}return _0x1089e9[_0x1524('0x1e')](_0x3f4e0b)[_0x1524('0x1f')]();};}function respondWithResult(_0x4dc340,_0x287f23){_0x287f23=_0x287f23||0xc8;return function(_0xd0bec7){if(_0xd0bec7){return _0x4dc340[_0x1524('0x1e')](_0x287f23)[_0x1524('0x20')](_0xd0bec7);}};}function respondWithFilteredResult(_0x22d9ec,_0x2d345f){return function(_0xad6f13){if(_0xad6f13){var _0x183000=typeof _0x2d345f[_0x1524('0x21')]===_0x1524('0x22')&&typeof _0x2d345f[_0x1524('0x23')]===_0x1524('0x22');var _0x312cb6=_0xad6f13[_0x1524('0x24')];var _0x5181d0=_0x183000?0x0:_0x2d345f[_0x1524('0x21')];var _0x1486ee=_0x183000?_0xad6f13[_0x1524('0x24')]:_0x2d345f[_0x1524('0x21')]+_0x2d345f[_0x1524('0x23')];var _0x4ef582;if(_0x1486ee>=_0x312cb6){_0x1486ee=_0x312cb6;_0x4ef582=0xc8;}else{_0x4ef582=0xce;}_0x22d9ec['status'](_0x4ef582);return _0x22d9ec[_0x1524('0x25')](_0x1524('0x26'),_0x5181d0+'-'+_0x1486ee+'/'+_0x312cb6)[_0x1524('0x20')](_0xad6f13);}return null;};}function patchUpdates(_0x46dc64){return function(_0x5a6084){try{jsonpatch[_0x1524('0x27')](_0x5a6084,_0x46dc64,!![]);}catch(_0x710475){return BPromise[_0x1524('0x28')](_0x710475);}return _0x5a6084[_0x1524('0x29')]();};}function saveUpdates(_0x592977,_0x5342bf){return function(_0x2b109c){if(_0x2b109c){return _0x2b109c['update'](_0x592977)[_0x1524('0x2a')](function(_0x21c124){return _0x21c124;});}return null;};}function removeEntity(_0x4860b6,_0x48d5c4){return function(_0x70d7c5){if(_0x70d7c5){return _0x70d7c5['destroy']()['then'](function(){_0x4860b6[_0x1524('0x1e')](0xcc)[_0x1524('0x1f')]();});}};}function handleEntityNotFound(_0x541cde,_0x347cd6){return function(_0x51447f){if(!_0x51447f){_0x541cde[_0x1524('0x1d')](0x194);}return _0x51447f;};}function handleError(_0x129eb5,_0x527628){_0x527628=_0x527628||0x1f4;return function(_0x5247f2){logger[_0x1524('0x2b')](_0x5247f2[_0x1524('0x2c')]);if(_0x5247f2['name']){delete _0x5247f2['name'];}_0x129eb5[_0x1524('0x1e')](_0x527628)[_0x1524('0x2d')](_0x5247f2);};}exports[_0x1524('0x2e')]=function(_0x18a0d7,_0x4a07ef){var _0x113e9a={},_0x1b7d07={},_0x15ce5a={'count':0x0,'rows':[]};var _0x43c0ce=_[_0x1524('0x2f')](db[_0x1524('0x30')]['rawAttributes'],function(_0x1a40d9){return{'name':_0x1a40d9[_0x1524('0x31')],'type':_0x1a40d9[_0x1524('0x32')][_0x1524('0x33')]};});_0x1b7d07[_0x1524('0x34')]=_[_0x1524('0x2f')](_0x43c0ce,_0x1524('0x35'));_0x1b7d07[_0x1524('0x36')]=_['keys'](_0x18a0d7[_0x1524('0x36')]);_0x1b7d07['filters']=_['intersection'](_0x1b7d07[_0x1524('0x34')],_0x1b7d07['query']);_0x113e9a[_0x1524('0x37')]=_[_0x1524('0x38')](_0x1b7d07['model'],qs['fields'](_0x18a0d7[_0x1524('0x36')]['fields']));_0x113e9a[_0x1524('0x37')]=_0x113e9a[_0x1524('0x37')][_0x1524('0x39')]?_0x113e9a[_0x1524('0x37')]:_0x1b7d07[_0x1524('0x34')];if(!_0x18a0d7[_0x1524('0x36')][_0x1524('0x3a')](_0x1524('0x3b'))){_0x113e9a[_0x1524('0x23')]=qs[_0x1524('0x23')](_0x18a0d7[_0x1524('0x36')][_0x1524('0x23')]);_0x113e9a[_0x1524('0x21')]=qs[_0x1524('0x21')](_0x18a0d7[_0x1524('0x36')][_0x1524('0x21')]);}_0x113e9a['order']=qs['sort'](_0x18a0d7[_0x1524('0x36')][_0x1524('0x3c')]);_0x113e9a[_0x1524('0x3d')]=qs[_0x1524('0x3e')](_['pick'](_0x18a0d7[_0x1524('0x36')],_0x1b7d07[_0x1524('0x3e')]),_0x43c0ce);if(_0x18a0d7[_0x1524('0x36')][_0x1524('0x3f')]){_0x113e9a['where']=_[_0x1524('0x40')](_0x113e9a['where'],{'$or':_[_0x1524('0x2f')](_0x43c0ce,function(_0x32f698){if(_0x32f698[_0x1524('0x32')]!==_0x1524('0x41')){var _0x1f41d7={};_0x1f41d7[_0x32f698[_0x1524('0x35')]]={'$like':'%'+_0x18a0d7[_0x1524('0x36')]['filter']+'%'};return _0x1f41d7;}})});}_0x113e9a=_[_0x1524('0x40')]({},_0x113e9a,_0x18a0d7['options']);var _0x2f5336={'where':_0x113e9a[_0x1524('0x3d')]};return db[_0x1524('0x30')]['count'](_0x2f5336)[_0x1524('0x2a')](function(_0x33dc40){_0x15ce5a['count']=_0x33dc40;if(_0x18a0d7[_0x1524('0x36')]['includeAll']){_0x113e9a[_0x1524('0x42')]=[{'all':!![]}];}return db[_0x1524('0x30')][_0x1524('0x43')](_0x113e9a);})[_0x1524('0x2a')](function(_0x38d0cd){_0x15ce5a[_0x1524('0x44')]=_0x38d0cd;return _0x15ce5a;})[_0x1524('0x2a')](respondWithFilteredResult(_0x4a07ef,_0x113e9a))['catch'](handleError(_0x4a07ef,null));};exports['show']=function(_0x37095f,_0x39adcc){var _0x44b41d={'raw':!![],'where':{'id':_0x37095f[_0x1524('0x45')]['id']}},_0x428d5f={};_0x428d5f[_0x1524('0x34')]=_['keys'](db[_0x1524('0x30')]['rawAttributes']);_0x428d5f[_0x1524('0x36')]=_[_0x1524('0x46')](_0x37095f[_0x1524('0x36')]);_0x428d5f[_0x1524('0x3e')]=_[_0x1524('0x38')](_0x428d5f[_0x1524('0x34')],_0x428d5f['query']);_0x44b41d[_0x1524('0x37')]=_[_0x1524('0x38')](_0x428d5f[_0x1524('0x34')],qs[_0x1524('0x47')](_0x37095f[_0x1524('0x36')][_0x1524('0x47')]));_0x44b41d[_0x1524('0x37')]=_0x44b41d['attributes']['length']?_0x44b41d[_0x1524('0x37')]:_0x428d5f['model'];if(_0x37095f[_0x1524('0x36')][_0x1524('0x48')]){_0x44b41d['include']=[{'all':!![]}];}_0x44b41d=_['merge']({},_0x44b41d,_0x37095f['options']);return db[_0x1524('0x30')][_0x1524('0x49')](_0x44b41d)[_0x1524('0x2a')](handleEntityNotFound(_0x39adcc,null))[_0x1524('0x2a')](respondWithResult(_0x39adcc,null))[_0x1524('0x4a')](handleError(_0x39adcc,null));};exports[_0x1524('0x4b')]=function(_0x3155a4,_0x10cc82){return db[_0x1524('0x30')][_0x1524('0x4b')](_0x3155a4['body'],{})[_0x1524('0x2a')](respondWithResult(_0x10cc82,0xc9))[_0x1524('0x4a')](handleError(_0x10cc82,null));};exports[_0x1524('0x4c')]=function(_0x55caab,_0x3647f9){if(_0x55caab[_0x1524('0x4d')]['id']){delete _0x55caab[_0x1524('0x4d')]['id'];}return db[_0x1524('0x30')][_0x1524('0x49')]({'where':{'id':_0x55caab['params']['id']}})[_0x1524('0x2a')](handleEntityNotFound(_0x3647f9,null))['then'](saveUpdates(_0x55caab[_0x1524('0x4d')],null))[_0x1524('0x2a')](respondWithResult(_0x3647f9,null))[_0x1524('0x4a')](handleError(_0x3647f9,null));};exports[_0x1524('0x4e')]=function(_0x5954a7,_0x4355df){return db[_0x1524('0x30')][_0x1524('0x49')]({'where':{'id':_0x5954a7[_0x1524('0x45')]['id']}})[_0x1524('0x2a')](handleEntityNotFound(_0x4355df,null))['then'](removeEntity(_0x4355df,null))[_0x1524('0x4a')](handleError(_0x4355df,null));};exports[_0x1524('0x4f')]=function(_0x2d272e,_0x374714){return db[_0x1524('0x30')][_0x1524('0x4f')]()[_0x1524('0x2a')](respondWithResult(_0x374714,null))['catch'](handleError(_0x374714,null));};function wrapUser(_0x43284a){return function(_0x574193){var _0x6f0c91=_0x43284a[_0x1524('0x50')]({'plain':!![]});_0x6f0c91[_0x1524('0x51')]=[];if(_0x574193){_0x6f0c91[_0x1524('0x52')]=_0x574193['createdAt'];_0x6f0c91['lastMessage']=_0x574193;}else{_0x6f0c91[_0x1524('0x52')]=moment(0x0)[_0x1524('0x53')](_0x1524('0x54'));_0x6f0c91[_0x1524('0x55')]={};}return _0x6f0c91;};}exports[_0x1524('0x56')]=function(_0x9d2734,_0x15f26e,_0x45a0ec){var _0x31b36c=[];return db['User']['findAll']({'where':{'role':['agent',_0x1524('0x57'),_0x1524('0x58')]},'attributes':['id','fullname',_0x1524('0x35'),_0x1524('0x59'),'userpic',_0x1524('0x5a'),_0x1524('0x5b'),_0x1524('0x5c'),'allowmessenger',_0x1524('0x5d')],'order':qs[_0x1524('0x3c')](_0x1524('0x5e')),'include':[{'model':db[_0x1524('0x5f')],'as':_0x1524('0x60'),'attributes':['id','name',_0x1524('0x32')],'through':{'attributes':[]}}]})[_0x1524('0x2a')](function(_0x2b3629){if(_0x2b3629){var _0x51144a=_0x9d2734[_0x1524('0x58')][_0x1524('0x50')]({'plain':!![]});if(!_0x51144a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x51144a['role']===_0x1524('0x58')){return db[_0x1524('0x61')]['find']({'where':{'name':'Agents','userProfileId':_0x51144a[_0x1524('0x62')]},'raw':!![]})['then'](function(_0x53a9b3){if(_0x53a9b3){if(_0x53a9b3[_0x1524('0x63')]===0x0){return db[_0x1524('0x64')][_0x1524('0x43')]({'where':{'sectionId':_0x53a9b3['id']},'raw':!![]})[_0x1524('0x2a')](function(_0x29517f){var _0x1c9719=[];if(_['isEmpty'](_0x29517f)){_0x1c9719=_[_0x1524('0x3f')](_0x2b3629,function(_0x240332){if(_0x240332[_0x1524('0x59')]!=='agent'){return _0x240332;}});return _0x1c9719;}else{for(var _0xf6fbe8=0x0;_0xf6fbe8<_0x2b3629[_0x1524('0x39')];_0xf6fbe8++){var _0xc94b14=_0x2b3629[_0xf6fbe8];if(_0xc94b14[_0x1524('0x59')]===_0x1524('0x65')){var _0x45a1d6=_[_0x1524('0x49')](_0x29517f,function(_0x367896){return _0x367896[_0x1524('0x66')]===_0xc94b14['id'];});if(_0x45a1d6)_0x1c9719['push'](_0xc94b14);}else{_0x1c9719[_0x1524('0x67')](_0xc94b14);}}return _0x1c9719;}});}else{return _0x2b3629;}}else{var _0x512220=_[_0x1524('0x3f')](_0x2b3629,function(_0x1bafcd){if(_0x1bafcd[_0x1524('0x59')]!==_0x1524('0x65')){return _0x1bafcd;}});return _0x512220;}});}else{return _0x2b3629;}}})[_0x1524('0x2a')](function(_0x3e75e6){var _0x475875=[];if(_0x3e75e6){_0x31b36c=_0x3e75e6;for(var _0x21e9e5=0x0;_0x21e9e5<_0x3e75e6['length'];_0x21e9e5+=0x1){_0x31b36c[_0x21e9e5]['messages']=[];_0x475875[_0x1524('0x67')](db['ChatInternalMessage'][_0x1524('0x49')]({'where':{'FromId':[_0x9d2734[_0x1524('0x58')]['id'],_0x3e75e6[_0x21e9e5]['id']],'ToId':[_0x9d2734[_0x1524('0x58')]['id'],_0x3e75e6[_0x21e9e5]['id']],'ChatGroupId':null},'attributes':['id',_0x1524('0x68'),'FromId',_0x1524('0x69'),'read',_0x1524('0x4d')],'order':qs[_0x1524('0x3c')](_0x1524('0x6a')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x1524('0x2a')](wrapUser(_0x3e75e6[_0x21e9e5])));}return BPromise[_0x1524('0x6b')](_0x475875);}return[];})['then'](function(_0x1eddbd){return{'rows':_0x1eddbd,'count':_0x1eddbd['length']};})[_0x1524('0x2a')](respondWithResult(_0x15f26e,null))[_0x1524('0x4a')](handleError(_0x15f26e,null));}; \ No newline at end of file +var _0xfdc5=['rawAttributes','fieldName','type','key','map','query','keys','filters','model','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','VIRTUAL','filter','merge','includeAll','include','findAll','rows','catch','params','intersection','options','find','create','body','update','describe','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','fullname','userpic','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueues','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Agents','autoAssociation','isEmpty','resourceId','push','messages','FromId','ToId','read','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','json','offset','undefined','count','status','set','Content-Range','save','destroy','then','end','sendStatus','error','stack','name','send','index','ChatInternalMessage'];(function(_0x3eee78,_0x5acc63){var _0x53a5e5=function(_0x472fb6){while(--_0x472fb6){_0x3eee78['push'](_0x3eee78['shift']());}};_0x53a5e5(++_0x5acc63);}(_0xfdc5,0x11c));var _0x5fdc=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xfdc5[_0x1b828b];return _0x98da1a;};'use strict';var emlformat=require(_0x5fdc('0x0'));var rimraf=require(_0x5fdc('0x1'));var zipdir=require(_0x5fdc('0x2'));var jsonpatch=require(_0x5fdc('0x3'));var rp=require(_0x5fdc('0x4'));var moment=require(_0x5fdc('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5fdc('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x5fdc('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5fdc('0x8'));var _=require(_0x5fdc('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5fdc('0xa'));var deskjs=require(_0x5fdc('0xb'));var toCsv=require(_0x5fdc('0x7'));var querystring=require(_0x5fdc('0xc'));var Papa=require('papaparse');var Redis=require(_0x5fdc('0xd'));var authService=require(_0x5fdc('0xe'));var qs=require(_0x5fdc('0xf'));var as=require(_0x5fdc('0x10'));var hardwareService=require(_0x5fdc('0x11'));var logger=require(_0x5fdc('0x12'))('api');var utils=require(_0x5fdc('0x13'));var config=require(_0x5fdc('0x14'));var licenseUtil=require(_0x5fdc('0x15'));var db=require(_0x5fdc('0x16'))['db'];config[_0x5fdc('0x17')]=_['defaults'](config[_0x5fdc('0x17')],{'host':_0x5fdc('0x18'),'port':0x18eb});var socket=require(_0x5fdc('0x19'))(new Redis(config[_0x5fdc('0x17')]));require(_0x5fdc('0x1a'))[_0x5fdc('0x1b')](socket);function respondWithStatusCode(_0xd46d7d,_0x540703){_0x540703=_0x540703||0xcc;return function(_0x2f8bde){if(_0x2f8bde){return _0xd46d7d['sendStatus'](_0x540703);}return _0xd46d7d['status'](_0x540703)['end']();};}function respondWithResult(_0x3299e6,_0x4c6de2){_0x4c6de2=_0x4c6de2||0xc8;return function(_0x556140){if(_0x556140){return _0x3299e6['status'](_0x4c6de2)[_0x5fdc('0x1c')](_0x556140);}};}function respondWithFilteredResult(_0x2d1c7d,_0x925ce3){return function(_0x3c734d){if(_0x3c734d){var _0x5be80b=typeof _0x925ce3[_0x5fdc('0x1d')]===_0x5fdc('0x1e')&&typeof _0x925ce3['limit']===_0x5fdc('0x1e');var _0x9d2f6c=_0x3c734d[_0x5fdc('0x1f')];var _0x55041f=_0x5be80b?0x0:_0x925ce3[_0x5fdc('0x1d')];var _0x19d1e5=_0x5be80b?_0x3c734d[_0x5fdc('0x1f')]:_0x925ce3['offset']+_0x925ce3['limit'];var _0x1ac826;if(_0x19d1e5>=_0x9d2f6c){_0x19d1e5=_0x9d2f6c;_0x1ac826=0xc8;}else{_0x1ac826=0xce;}_0x2d1c7d[_0x5fdc('0x20')](_0x1ac826);return _0x2d1c7d[_0x5fdc('0x21')](_0x5fdc('0x22'),_0x55041f+'-'+_0x19d1e5+'/'+_0x9d2f6c)[_0x5fdc('0x1c')](_0x3c734d);}return null;};}function patchUpdates(_0x3eb3a7){return function(_0x28691a){try{jsonpatch['apply'](_0x28691a,_0x3eb3a7,!![]);}catch(_0x27fa84){return BPromise['reject'](_0x27fa84);}return _0x28691a[_0x5fdc('0x23')]();};}function saveUpdates(_0x408457,_0x15d8c7){return function(_0x5543fb){if(_0x5543fb){return _0x5543fb['update'](_0x408457)['then'](function(_0x43b8c4){return _0x43b8c4;});}return null;};}function removeEntity(_0x19135e,_0x645c18){return function(_0x4a801c){if(_0x4a801c){return _0x4a801c[_0x5fdc('0x24')]()[_0x5fdc('0x25')](function(){_0x19135e[_0x5fdc('0x20')](0xcc)[_0x5fdc('0x26')]();});}};}function handleEntityNotFound(_0x3c1745,_0x298e8f){return function(_0x35282d){if(!_0x35282d){_0x3c1745[_0x5fdc('0x27')](0x194);}return _0x35282d;};}function handleError(_0x2b27a0,_0x261f30){_0x261f30=_0x261f30||0x1f4;return function(_0x4ac9ce){logger[_0x5fdc('0x28')](_0x4ac9ce[_0x5fdc('0x29')]);if(_0x4ac9ce[_0x5fdc('0x2a')]){delete _0x4ac9ce['name'];}_0x2b27a0[_0x5fdc('0x20')](_0x261f30)[_0x5fdc('0x2b')](_0x4ac9ce);};}exports[_0x5fdc('0x2c')]=function(_0x2a3b96,_0x55b8bf){var _0x53853d={},_0x375624={},_0x41c923={'count':0x0,'rows':[]};var _0x19d293=_['map'](db[_0x5fdc('0x2d')][_0x5fdc('0x2e')],function(_0x2cf73b){return{'name':_0x2cf73b[_0x5fdc('0x2f')],'type':_0x2cf73b[_0x5fdc('0x30')][_0x5fdc('0x31')]};});_0x375624['model']=_[_0x5fdc('0x32')](_0x19d293,_0x5fdc('0x2a'));_0x375624[_0x5fdc('0x33')]=_[_0x5fdc('0x34')](_0x2a3b96[_0x5fdc('0x33')]);_0x375624[_0x5fdc('0x35')]=_['intersection'](_0x375624[_0x5fdc('0x36')],_0x375624[_0x5fdc('0x33')]);_0x53853d['attributes']=_['intersection'](_0x375624['model'],qs[_0x5fdc('0x37')](_0x2a3b96['query'][_0x5fdc('0x37')]));_0x53853d[_0x5fdc('0x38')]=_0x53853d[_0x5fdc('0x38')][_0x5fdc('0x39')]?_0x53853d['attributes']:_0x375624['model'];if(!_0x2a3b96['query'][_0x5fdc('0x3a')]('nolimit')){_0x53853d[_0x5fdc('0x3b')]=qs[_0x5fdc('0x3b')](_0x2a3b96[_0x5fdc('0x33')][_0x5fdc('0x3b')]);_0x53853d[_0x5fdc('0x1d')]=qs['offset'](_0x2a3b96['query'][_0x5fdc('0x1d')]);}_0x53853d[_0x5fdc('0x3c')]=qs[_0x5fdc('0x3d')](_0x2a3b96[_0x5fdc('0x33')][_0x5fdc('0x3d')]);_0x53853d[_0x5fdc('0x3e')]=qs['filters'](_[_0x5fdc('0x3f')](_0x2a3b96['query'],_0x375624['filters']),_0x19d293);if(_0x2a3b96[_0x5fdc('0x33')]['filter']){_0x53853d[_0x5fdc('0x3e')]=_['merge'](_0x53853d['where'],{'$or':_[_0x5fdc('0x32')](_0x19d293,function(_0x27a187){if(_0x27a187[_0x5fdc('0x30')]!==_0x5fdc('0x40')){var _0x25f2b5={};_0x25f2b5[_0x27a187[_0x5fdc('0x2a')]]={'$like':'%'+_0x2a3b96[_0x5fdc('0x33')][_0x5fdc('0x41')]+'%'};return _0x25f2b5;}})});}_0x53853d=_[_0x5fdc('0x42')]({},_0x53853d,_0x2a3b96['options']);var _0x338a04={'where':_0x53853d[_0x5fdc('0x3e')]};return db[_0x5fdc('0x2d')][_0x5fdc('0x1f')](_0x338a04)[_0x5fdc('0x25')](function(_0x591378){_0x41c923['count']=_0x591378;if(_0x2a3b96[_0x5fdc('0x33')][_0x5fdc('0x43')]){_0x53853d[_0x5fdc('0x44')]=[{'all':!![]}];}return db[_0x5fdc('0x2d')][_0x5fdc('0x45')](_0x53853d);})['then'](function(_0xae9d86){_0x41c923[_0x5fdc('0x46')]=_0xae9d86;return _0x41c923;})[_0x5fdc('0x25')](respondWithFilteredResult(_0x55b8bf,_0x53853d))[_0x5fdc('0x47')](handleError(_0x55b8bf,null));};exports['show']=function(_0x1a40da,_0xd9a23a){var _0x2fe0bb={'raw':!![],'where':{'id':_0x1a40da[_0x5fdc('0x48')]['id']}},_0x549fd7={};_0x549fd7[_0x5fdc('0x36')]=_[_0x5fdc('0x34')](db[_0x5fdc('0x2d')][_0x5fdc('0x2e')]);_0x549fd7[_0x5fdc('0x33')]=_[_0x5fdc('0x34')](_0x1a40da['query']);_0x549fd7[_0x5fdc('0x35')]=_['intersection'](_0x549fd7['model'],_0x549fd7[_0x5fdc('0x33')]);_0x2fe0bb[_0x5fdc('0x38')]=_[_0x5fdc('0x49')](_0x549fd7[_0x5fdc('0x36')],qs['fields'](_0x1a40da['query'][_0x5fdc('0x37')]));_0x2fe0bb[_0x5fdc('0x38')]=_0x2fe0bb[_0x5fdc('0x38')][_0x5fdc('0x39')]?_0x2fe0bb[_0x5fdc('0x38')]:_0x549fd7[_0x5fdc('0x36')];if(_0x1a40da['query'][_0x5fdc('0x43')]){_0x2fe0bb[_0x5fdc('0x44')]=[{'all':!![]}];}_0x2fe0bb=_[_0x5fdc('0x42')]({},_0x2fe0bb,_0x1a40da[_0x5fdc('0x4a')]);return db['ChatInternalMessage'][_0x5fdc('0x4b')](_0x2fe0bb)['then'](handleEntityNotFound(_0xd9a23a,null))['then'](respondWithResult(_0xd9a23a,null))[_0x5fdc('0x47')](handleError(_0xd9a23a,null));};exports[_0x5fdc('0x4c')]=function(_0x4c286e,_0x4c6c61){return db[_0x5fdc('0x2d')]['create'](_0x4c286e[_0x5fdc('0x4d')],{})[_0x5fdc('0x25')](respondWithResult(_0x4c6c61,0xc9))[_0x5fdc('0x47')](handleError(_0x4c6c61,null));};exports[_0x5fdc('0x4e')]=function(_0x16ef01,_0x5508ec){if(_0x16ef01[_0x5fdc('0x4d')]['id']){delete _0x16ef01[_0x5fdc('0x4d')]['id'];}return db[_0x5fdc('0x2d')][_0x5fdc('0x4b')]({'where':{'id':_0x16ef01[_0x5fdc('0x48')]['id']}})['then'](handleEntityNotFound(_0x5508ec,null))['then'](saveUpdates(_0x16ef01[_0x5fdc('0x4d')],null))[_0x5fdc('0x25')](respondWithResult(_0x5508ec,null))[_0x5fdc('0x47')](handleError(_0x5508ec,null));};exports[_0x5fdc('0x24')]=function(_0x5ae8de,_0x59f543){return db['ChatInternalMessage'][_0x5fdc('0x4b')]({'where':{'id':_0x5ae8de[_0x5fdc('0x48')]['id']}})['then'](handleEntityNotFound(_0x59f543,null))['then'](removeEntity(_0x59f543,null))['catch'](handleError(_0x59f543,null));};exports[_0x5fdc('0x4f')]=function(_0x34ee0b,_0x197e42){return db[_0x5fdc('0x2d')][_0x5fdc('0x4f')]()[_0x5fdc('0x25')](respondWithResult(_0x197e42,null))[_0x5fdc('0x47')](handleError(_0x197e42,null));};function wrapUser(_0x2dab67){return function(_0x3f4e30){var _0x34c30d=_0x2dab67['get']({'plain':!![]});_0x34c30d['messages']=[];if(_0x3f4e30){_0x34c30d[_0x5fdc('0x50')]=_0x3f4e30[_0x5fdc('0x51')];_0x34c30d[_0x5fdc('0x52')]=_0x3f4e30;}else{_0x34c30d[_0x5fdc('0x50')]=moment(0x0)[_0x5fdc('0x53')](_0x5fdc('0x54'));_0x34c30d[_0x5fdc('0x52')]={};}return _0x34c30d;};}exports[_0x5fdc('0x55')]=function(_0x51ced3,_0x3d2be0,_0x35b8d4){var _0x4c4f59=[];return db[_0x5fdc('0x56')][_0x5fdc('0x45')]({'where':{'role':[_0x5fdc('0x57'),_0x5fdc('0x58'),'user']},'attributes':['id',_0x5fdc('0x59'),_0x5fdc('0x2a'),'role',_0x5fdc('0x5a'),'internal',_0x5fdc('0x5b'),_0x5fdc('0x5c'),_0x5fdc('0x5d'),_0x5fdc('0x5e')],'order':qs[_0x5fdc('0x3d')](_0x5fdc('0x5f')),'include':[{'model':db['VoiceQueue'],'as':_0x5fdc('0x60'),'attributes':['id',_0x5fdc('0x2a'),_0x5fdc('0x30')],'through':{'attributes':[]}}]})[_0x5fdc('0x25')](function(_0x5f38ba){if(_0x5f38ba){var _0x1afc74=_0x51ced3[_0x5fdc('0x61')][_0x5fdc('0x62')]({'plain':!![]});if(!_0x1afc74)throw new Error(_0x5fdc('0x63'));if(_0x1afc74[_0x5fdc('0x64')]==='user'){return db['UserProfileSection'][_0x5fdc('0x4b')]({'where':{'name':_0x5fdc('0x65'),'userProfileId':_0x1afc74['userProfileId']},'raw':!![]})[_0x5fdc('0x25')](function(_0xf08233){if(_0xf08233){if(_0xf08233[_0x5fdc('0x66')]===0x0){return db['UserProfileResource'][_0x5fdc('0x45')]({'where':{'sectionId':_0xf08233['id']},'raw':!![]})[_0x5fdc('0x25')](function(_0x57cabb){var _0x5de58e=[];if(_[_0x5fdc('0x67')](_0x57cabb)){_0x5de58e=_['filter'](_0x5f38ba,function(_0x2a3209){if(_0x2a3209[_0x5fdc('0x64')]!==_0x5fdc('0x57')){return _0x2a3209;}});return _0x5de58e;}else{for(var _0x10847c=0x0;_0x10847c<_0x5f38ba[_0x5fdc('0x39')];_0x10847c++){var _0x2d20dc=_0x5f38ba[_0x10847c];if(_0x2d20dc[_0x5fdc('0x64')]===_0x5fdc('0x57')){var _0x10f97f=_[_0x5fdc('0x4b')](_0x57cabb,function(_0x16c0d6){return _0x16c0d6[_0x5fdc('0x68')]===_0x2d20dc['id'];});if(_0x10f97f)_0x5de58e[_0x5fdc('0x69')](_0x2d20dc);}else{_0x5de58e[_0x5fdc('0x69')](_0x2d20dc);}}return _0x5de58e;}});}else{return _0x5f38ba;}}else{var _0x92a541=_['filter'](_0x5f38ba,function(_0x305948){if(_0x305948[_0x5fdc('0x64')]!==_0x5fdc('0x57')){return _0x305948;}});return _0x92a541;}});}else{return _0x5f38ba;}}})['then'](function(_0x250ae7){var _0x3f7d10=[];if(_0x250ae7){_0x4c4f59=_0x250ae7;for(var _0x2163c6=0x0;_0x2163c6<_0x250ae7[_0x5fdc('0x39')];_0x2163c6+=0x1){_0x4c4f59[_0x2163c6][_0x5fdc('0x6a')]=[];_0x3f7d10[_0x5fdc('0x69')](db['ChatInternalMessage']['find']({'where':{'FromId':[_0x51ced3[_0x5fdc('0x61')]['id'],_0x250ae7[_0x2163c6]['id']],'ToId':[_0x51ced3[_0x5fdc('0x61')]['id'],_0x250ae7[_0x2163c6]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x5fdc('0x6b'),_0x5fdc('0x6c'),_0x5fdc('0x6d'),_0x5fdc('0x4d')],'order':qs[_0x5fdc('0x3d')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x5fdc('0x25')](wrapUser(_0x250ae7[_0x2163c6])));}return BPromise['all'](_0x3f7d10);}return[];})[_0x5fdc('0x25')](function(_0x44fb05){return{'rows':_0x44fb05,'count':_0x44fb05[_0x5fdc('0x39')]};})[_0x5fdc('0x25')](respondWithResult(_0x3d2be0,null))[_0x5fdc('0x47')](handleError(_0x3d2be0,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index c822144..5d816a0 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 _0xd21d=['exports','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove','emit','hook'];(function(_0x4664db,_0x1de672){var _0x5615b4=function(_0x54fb5a){while(--_0x54fb5a){_0x4664db['push'](_0x4664db['shift']());}};_0x5615b4(++_0x1de672);}(_0xd21d,0x14e));var _0xdd21=function(_0x141dd8,_0x48363d){_0x141dd8=_0x141dd8-0x0;var _0x348080=_0xd21d[_0x141dd8];return _0x348080;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0xdd21('0x0'))['db'][_0xdd21('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xdd21('0x2')](0x0);var events={'afterCreate':_0xdd21('0x3'),'afterUpdate':_0xdd21('0x4'),'afterDestroy':_0xdd21('0x5')};function emitEvent(_0x142a73){return function(_0x2bf954,_0x1b27ca,_0x100b71){ChatInternalMessageEvents[_0xdd21('0x6')](_0x142a73+':'+_0x2bf954['id'],_0x2bf954);ChatInternalMessageEvents[_0xdd21('0x6')](_0x142a73,_0x2bf954);_0x100b71(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0xdd21('0x7')](e,emitEvent(event));}}module[_0xdd21('0x8')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x230f=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','update','remove'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x230f,0x68));var _0xf230=function(_0xaa656e,_0x250a02){_0xaa656e=_0xaa656e-0x0;var _0x2b2d99=_0x230f[_0xaa656e];return _0x2b2d99;};'use strict';var EventEmitter=require(_0xf230('0x0'));var ChatInternalMessage=require(_0xf230('0x1'))['db'][_0xf230('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xf230('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf230('0x4'),'afterDestroy':_0xf230('0x5')};function emitEvent(_0x4e46d9){return function(_0x5b8a13,_0x20284a,_0x2144f1){ChatInternalMessageEvents[_0xf230('0x6')](_0x4e46d9+':'+_0x5b8a13['id'],_0x5b8a13);ChatInternalMessageEvents[_0xf230('0x6')](_0x4e46d9,_0x5b8a13);_0x2144f1(null);};}for(var e in events){if(events[_0xf230('0x7')](e)){var event=events[e];ChatInternalMessage[_0xf230('0x8')](e,emitEvent(event));}}module[_0xf230('0x9')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 3daa2cf..30deee2 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 _0x73b6=['moment','bluebird','request-promise','rimraf','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x40156e,_0x2839df){var _0x171c94=function(_0x1f2482){while(--_0x1f2482){_0x40156e['push'](_0x40156e['shift']());}};_0x171c94(++_0x2839df);}(_0x73b6,0x1bc));var _0x673b=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0x73b6[_0x5c3c0b];return _0x52ecd2;};'use strict';var _=require(_0x673b('0x0'));var util=require(_0x673b('0x1'));var logger=require(_0x673b('0x2'))(_0x673b('0x3'));var moment=require(_0x673b('0x4'));var BPromise=require(_0x673b('0x5'));var rp=require(_0x673b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x673b('0x7'));var config=require('../../config/environment');var attributes=require(_0x673b('0x8'));module[_0x673b('0x9')]=function(_0x1c42f1,_0x2df948){return _0x1c42f1[_0x673b('0xa')](_0x673b('0xb'),attributes,{'tableName':_0x673b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x673b('0xd')});}; \ No newline at end of file +var _0x4392=['moment','bluebird','rimraf','exports','define','ChatInternalMessage','lodash','api'];(function(_0x1a4c39,_0x13aade){var _0x55b641=function(_0x222d9f){while(--_0x222d9f){_0x1a4c39['push'](_0x1a4c39['shift']());}};_0x55b641(++_0x13aade);}(_0x4392,0x15e));var _0x2439=function(_0x51a0a2,_0x31f10a){_0x51a0a2=_0x51a0a2-0x0;var _0x5286af=_0x4392[_0x51a0a2];return _0x5286af;};'use strict';var _=require(_0x2439('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2439('0x1'));var moment=require(_0x2439('0x2'));var BPromise=require(_0x2439('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2439('0x4'));var config=require('../../config/environment');var attributes=require('./chatInternalMessage.attributes');module[_0x2439('0x5')]=function(_0x244e2f,_0x238284){return _0x244e2f[_0x2439('0x6')](_0x2439('0x7'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 12332dd..a2a32a7 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 _0x8075=['message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','client','redis','defaults','localhost','socket.io-emitter','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x8075,0xab));var _0x5807=function(_0x1e270f,_0x3cd1f6){_0x1e270f=_0x1e270f-0x0;var _0x3ad2c2=_0x8075[_0x1e270f];return _0x3ad2c2;};'use strict';var _=require(_0x5807('0x0'));var util=require(_0x5807('0x1'));var moment=require('moment');var BPromise=require(_0x5807('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5807('0x3'));var db=require(_0x5807('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5807('0x5'))(_0x5807('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5807('0x7')]['http']({'port':0x232a});config[_0x5807('0x8')]=_[_0x5807('0x9')](config[_0x5807('0x8')],{'host':_0x5807('0xa'),'port':0x18eb});var socket=require(_0x5807('0xb'))(new Redis(config[_0x5807('0x8')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0x1995b7,_0x404e9f,_0x742dd0){return new BPromise(function(_0x121888,_0x293f43){return client[_0x5807('0xc')](_0x1995b7,_0x742dd0)[_0x5807('0xd')](function(_0x452154){logger[_0x5807('0xe')](_0x5807('0xf'),_0x404e9f,_0x5807('0x10'));logger['debug'](_0x5807('0x11'),_0x404e9f,_0x5807('0x10'),JSON[_0x5807('0x12')](_0x452154));if(_0x452154[_0x5807('0x13')]){if(_0x452154[_0x5807('0x13')][_0x5807('0x14')]===0x1f4){logger[_0x5807('0x13')](_0x5807('0xf'),_0x404e9f,_0x452154[_0x5807('0x13')][_0x5807('0x15')]);return _0x293f43(_0x452154[_0x5807('0x13')][_0x5807('0x15')]);}logger[_0x5807('0x13')](_0x5807('0xf'),_0x404e9f,_0x452154[_0x5807('0x13')][_0x5807('0x15')]);return _0x121888(_0x452154[_0x5807('0x13')][_0x5807('0x15')]);}else{logger['info'](_0x5807('0xf'),_0x404e9f,_0x5807('0x10'));_0x121888(_0x452154[_0x5807('0x16')][_0x5807('0x15')]);}})[_0x5807('0x17')](function(_0x5bd46d){logger[_0x5807('0x13')](_0x5807('0xf'),_0x404e9f,_0x5bd46d);_0x293f43(_0x5bd46d);});});} \ No newline at end of file +var _0x400e=['request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','socket.io-emitter','./chatInternalMessage.socket'];(function(_0x45aad7,_0x331b16){var _0x199fd0=function(_0x5f4384){while(--_0x5f4384){_0x45aad7['push'](_0x45aad7['shift']());}};_0x199fd0(++_0x331b16);}(_0x400e,0x15e));var _0xe400=function(_0x413aac,_0x5e2430){_0x413aac=_0x413aac-0x0;var _0x569b11=_0x400e[_0x413aac];return _0x569b11;};'use strict';var _=require(_0xe400('0x0'));var util=require(_0xe400('0x1'));var moment=require('moment');var BPromise=require(_0xe400('0x2'));var rs=require(_0xe400('0x3'));var fs=require('fs');var Redis=require(_0xe400('0x4'));var db=require(_0xe400('0x5'))['db'];var utils=require(_0xe400('0x6'));var logger=require(_0xe400('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe400('0x8'));var client=jayson[_0xe400('0x9')][_0xe400('0xa')]({'port':0x232a});config[_0xe400('0xb')]=_['defaults'](config[_0xe400('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xe400('0xc'))(new Redis(config[_0xe400('0xb')]));require(_0xe400('0xd'))['register'](socket);function respondWithRpcPromise(_0x4c0de9,_0x58920e,_0x568259){return new BPromise(function(_0x554f6a,_0x3c294d){return client[_0xe400('0xe')](_0x4c0de9,_0x568259)[_0xe400('0xf')](function(_0x45e331){logger[_0xe400('0x10')](_0xe400('0x11'),_0x58920e,_0xe400('0x12'));logger['debug'](_0xe400('0x13'),_0x58920e,_0xe400('0x12'),JSON[_0xe400('0x14')](_0x45e331));if(_0x45e331[_0xe400('0x15')]){if(_0x45e331['error'][_0xe400('0x16')]===0x1f4){logger[_0xe400('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x58920e,_0x45e331['error']['message']);return _0x3c294d(_0x45e331[_0xe400('0x15')][_0xe400('0x17')]);}logger[_0xe400('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x58920e,_0x45e331['error'][_0xe400('0x17')]);return _0x554f6a(_0x45e331[_0xe400('0x15')][_0xe400('0x17')]);}else{logger[_0xe400('0x10')](_0xe400('0x11'),_0x58920e,_0xe400('0x12'));_0x554f6a(_0x45e331[_0xe400('0x18')]['message']);}})[_0xe400('0x19')](function(_0x10b7c7){logger[_0xe400('0x15')](_0xe400('0x11'),_0x58920e,_0x10b7c7);_0x3c294d(_0x10b7c7);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 53a1585..b50fa28 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 _0xdc03=['removeListener','register','chatInternalMessage:','remove','update','emit'];(function(_0x5c6a53,_0x3c3bb6){var _0x3179cd=function(_0x5ddacc){while(--_0x5ddacc){_0x5c6a53['push'](_0x5c6a53['shift']());}};_0x3179cd(++_0x3c3bb6);}(_0xdc03,0x117));var _0x3dc0=function(_0x63fa9a,_0x469a92){_0x63fa9a=_0x63fa9a-0x0;var _0x2ac192=_0xdc03[_0x63fa9a];return _0x2ac192;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=['save',_0x3dc0('0x0'),_0x3dc0('0x1')];function createListener(_0xc65c94,_0x2145ad){return function(_0xa8a730){_0x2145ad[_0x3dc0('0x2')](_0xc65c94,_0xa8a730);};}function removeListener(_0x5cb0f0,_0xad8e2c){return function(){ChatInternalMessageEvents[_0x3dc0('0x3')](_0x5cb0f0,_0xad8e2c);};}exports[_0x3dc0('0x4')]=function(_0x578a81){for(var _0x181c69=0x0,_0x4bdeec=events['length'];_0x181c69<_0x4bdeec;_0x181c69++){var _0x4f758c=events[_0x181c69];var _0x439fb9=createListener(_0x3dc0('0x5')+_0x4f758c,_0x578a81);ChatInternalMessageEvents['on'](_0x4f758c,_0x439fb9);}}; \ No newline at end of file +var _0x9272=['removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save','update','emit'];(function(_0x41d3cf,_0x522264){var _0x1df586=function(_0x2e4125){while(--_0x2e4125){_0x41d3cf['push'](_0x41d3cf['shift']());}};_0x1df586(++_0x522264);}(_0x9272,0x1ec));var _0x2927=function(_0x5be477,_0x1a2c7f){_0x5be477=_0x5be477-0x0;var _0x14944e=_0x9272[_0x5be477];return _0x14944e;};'use strict';var ChatInternalMessageEvents=require(_0x2927('0x0'));var events=[_0x2927('0x1'),'remove',_0x2927('0x2')];function createListener(_0x2332b2,_0x32a63e){return function(_0x549794){_0x32a63e[_0x2927('0x3')](_0x2332b2,_0x549794);};}function removeListener(_0x5a21dc,_0x4463c8){return function(){ChatInternalMessageEvents[_0x2927('0x4')](_0x5a21dc,_0x4463c8);};}exports[_0x2927('0x5')]=function(_0x2f5da6){for(var _0x234f90=0x0,_0x5266bb=events[_0x2927('0x6')];_0x234f90<_0x5266bb;_0x234f90++){var _0x17e8a9=events[_0x234f90];var _0x5cefbf=createListener(_0x2927('0x7')+_0x17e8a9,_0x2f5da6);ChatInternalMessageEvents['on'](_0x17e8a9,_0x5cefbf);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index ec414b3..54ff74b 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 _0xbfe4=['isAuthenticated','index','get','/describe','describe','/users','/:id','post','create','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller'];(function(_0x31392e,_0x5ee36e){var _0x50d005=function(_0x3b94ef){while(--_0x3b94ef){_0x31392e['push'](_0x31392e['shift']());}};_0x50d005(++_0x5ee36e);}(_0xbfe4,0x1d8));var _0x4bfe=function(_0x470925,_0x23cfa1){_0x470925=_0x470925-0x0;var _0x21dadb=_0xbfe4[_0x470925];return _0x21dadb;};'use strict';var multer=require(_0x4bfe('0x0'));var util=require(_0x4bfe('0x1'));var path=require(_0x4bfe('0x2'));var timeout=require(_0x4bfe('0x3'));var express=require(_0x4bfe('0x4'));var router=express[_0x4bfe('0x5')]();var fs_extra=require(_0x4bfe('0x6'));var auth=require(_0x4bfe('0x7'));var interaction=require(_0x4bfe('0x8'));var config=require(_0x4bfe('0x9'));var controller=require(_0x4bfe('0xa'));router['get']('/',auth[_0x4bfe('0xb')](),controller[_0x4bfe('0xc')]);router[_0x4bfe('0xd')](_0x4bfe('0xe'),auth[_0x4bfe('0xb')](),controller[_0x4bfe('0xf')]);router[_0x4bfe('0xd')](_0x4bfe('0x10'),auth[_0x4bfe('0xb')](),controller['getUsers']);router[_0x4bfe('0xd')](_0x4bfe('0x11'),auth[_0x4bfe('0xb')](),controller['show']);router[_0x4bfe('0x12')]('/',auth[_0x4bfe('0xb')](),controller[_0x4bfe('0x13')]);router[_0x4bfe('0x14')](_0x4bfe('0x11'),controller[_0x4bfe('0x15')]);router['delete'](_0x4bfe('0x11'),auth[_0x4bfe('0xb')](),controller['destroy']);module[_0x4bfe('0x16')]=router; \ No newline at end of file +var _0x105b=['show','post','create','put','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','/describe','describe','getUsers','/:id'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0x105b,0x1a9));var _0xb105=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x105b[_0xae7c2f];return _0x5d7001;};'use strict';var multer=require(_0xb105('0x0'));var util=require(_0xb105('0x1'));var path=require(_0xb105('0x2'));var timeout=require(_0xb105('0x3'));var express=require('express');var router=express[_0xb105('0x4')]();var fs_extra=require(_0xb105('0x5'));var auth=require(_0xb105('0x6'));var interaction=require(_0xb105('0x7'));var config=require(_0xb105('0x8'));var controller=require(_0xb105('0x9'));router[_0xb105('0xa')]('/',auth[_0xb105('0xb')](),controller['index']);router[_0xb105('0xa')](_0xb105('0xc'),auth[_0xb105('0xb')](),controller[_0xb105('0xd')]);router[_0xb105('0xa')]('/users',auth[_0xb105('0xb')](),controller[_0xb105('0xe')]);router['get'](_0xb105('0xf'),auth[_0xb105('0xb')](),controller[_0xb105('0x10')]);router[_0xb105('0x11')]('/',auth[_0xb105('0xb')](),controller[_0xb105('0x12')]);router[_0xb105('0x13')](_0xb105('0xf'),controller['update']);router[_0xb105('0x14')](_0xb105('0xf'),auth[_0xb105('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 5e13f57..9e26524 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 _0x915a=['DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x1b0cd4,_0x19368c){var _0x43d0ee=function(_0x45e7c6){while(--_0x45e7c6){_0x1b0cd4['push'](_0x1b0cd4['shift']());}};_0x43d0ee(++_0x19368c);}(_0x915a,0x1d2));var _0xa915=function(_0x1adc11,_0x32a1cc){_0x1adc11=_0x1adc11-0x0;var _0x2b675d=_0x915a[_0x1adc11];return _0x2b675d;};'use strict';var Sequelize=require(_0xa915('0x0'));module[_0xa915('0x1')]={'body':{'type':Sequelize[_0xa915('0x2')](_0xa915('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xa915('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xa915('0x5')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xa915('0x6')]},'providerName':{'type':Sequelize[_0xa915('0x7')]},'providerResponse':{'type':Sequelize[_0xa915('0x2')]}}; \ No newline at end of file +var _0x4024=['BOOLEAN','ENUM','out','DATE','sequelize','exports','medium'];(function(_0x311eb0,_0x469a4e){var _0x511d58=function(_0x2996ea){while(--_0x2996ea){_0x311eb0['push'](_0x311eb0['shift']());}};_0x511d58(++_0x469a4e);}(_0x4024,0x89));var _0x4402=function(_0x25db19,_0x2b27fa){_0x25db19=_0x25db19-0x0;var _0x4cbb41=_0x4024[_0x25db19];return _0x4cbb41;};'use strict';var Sequelize=require(_0x4402('0x0'));module[_0x4402('0x1')]={'body':{'type':Sequelize['TEXT'](_0x4402('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x4402('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x4402('0x4')]('in','out'),'defaultValue':_0x4402('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x4402('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 65e4b10..f85d58b 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 _0x321e=['QueryTypes','SELECT','contact','User','fullname','internal','manual','interface','channel','event','EventManager','acceptmessage','parse','formData','role','RejectMessage','ContactId','Sequelize','email','SIP/%s','motionChannel','reject','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','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/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','end','status','undefined','count','offset','set','Content-Range','json','save','update','name','send','index','ChatMessage','fieldName','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','rows','show','keys','rawAttributes','length','find','create','body','params','describe','chat-interactions','accept','chat','readAt','format','YYYY-MM-DD\x20HH:mm:ss','user','agent','UserId','get','ChatInteraction','ChatInteractionId','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize'];(function(_0x1dfa8f,_0x1a7bb3){var _0x29b896=function(_0x4b164e){while(--_0x4b164e){_0x1dfa8f['push'](_0x1dfa8f['shift']());}};_0x29b896(++_0x1a7bb3);}(_0x321e,0x1ab));var _0xe321=function(_0x4b4839,_0x13aed7){_0x4b4839=_0x4b4839-0x0;var _0x2c212e=_0x321e[_0x4b4839];return _0x2c212e;};'use strict';var emlformat=require(_0xe321('0x0'));var rimraf=require(_0xe321('0x1'));var zipdir=require(_0xe321('0x2'));var jsonpatch=require(_0xe321('0x3'));var rp=require(_0xe321('0x4'));var moment=require('moment');var BPromise=require(_0xe321('0x5'));var Mustache=require('mustache');var util=require(_0xe321('0x6'));var path=require(_0xe321('0x7'));var sox=require(_0xe321('0x8'));var csv=require(_0xe321('0x9'));var ejs=require(_0xe321('0xa'));var fs=require('fs');var fs_extra=require(_0xe321('0xb'));var _=require(_0xe321('0xc'));var squel=require('squel');var crypto=require(_0xe321('0xd'));var jsforce=require(_0xe321('0xe'));var deskjs=require(_0xe321('0xf'));var toCsv=require('to-csv');var querystring=require(_0xe321('0x10'));var Papa=require(_0xe321('0x11'));var Redis=require('ioredis');var authService=require(_0xe321('0x12'));var qs=require(_0xe321('0x13'));var as=require(_0xe321('0x14'));var hardwareService=require(_0xe321('0x15'));var logger=require(_0xe321('0x16'))(_0xe321('0x17'));var utils=require(_0xe321('0x18'));var config=require(_0xe321('0x19'));var licenseUtil=require(_0xe321('0x1a'));var db=require('../../mysqldb')['db'];config[_0xe321('0x1b')]=_[_0xe321('0x1c')](config[_0xe321('0x1b')],{'host':_0xe321('0x1d'),'port':0x18eb});var socket=require(_0xe321('0x1e'))(new Redis(config[_0xe321('0x1b')]));require(_0xe321('0x1f'))[_0xe321('0x20')](socket);var jayson=require(_0xe321('0x21'));var client=jayson['client'][_0xe321('0x22')]({'port':0x232c});var client9002=jayson['client'][_0xe321('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x364c7a,_0x5d23e4,_0x19d90a,_0x564231){return new BPromise(function(_0xfd6e30,_0x519d0e){var _0x30a500=_0x564231||client;return _0x30a500[_0xe321('0x23')](_0x364c7a,_0x19d90a)[_0xe321('0x24')](function(_0x5d578d){logger[_0xe321('0x25')](_0xe321('0x26'),_0x5d23e4,_0xe321('0x27'));logger['debug'](_0xe321('0x28'),_0x5d23e4,'request\x20sent',JSON[_0xe321('0x29')](_0x5d578d));if(_0x5d578d['error']){if(_0x5d578d[_0xe321('0x2a')]['code']===0x1f4){logger[_0xe321('0x2a')]('ChatMessage,\x20%s,\x20%s',_0x5d23e4,_0x5d578d[_0xe321('0x2a')][_0xe321('0x2b')]);return _0x519d0e(_0x5d578d[_0xe321('0x2a')][_0xe321('0x2b')]);}logger['error'](_0xe321('0x26'),_0x5d23e4,_0x5d578d[_0xe321('0x2a')][_0xe321('0x2b')]);return _0xfd6e30(_0x5d578d[_0xe321('0x2a')][_0xe321('0x2b')]);}else{logger[_0xe321('0x25')](_0xe321('0x26'),_0x5d23e4,_0xe321('0x27'));_0xfd6e30(_0x5d578d[_0xe321('0x2c')][_0xe321('0x2b')]);}})[_0xe321('0x2d')](function(_0x15ef42){logger[_0xe321('0x2a')](_0xe321('0x26'),_0x5d23e4,_0x15ef42);_0x519d0e(_0x15ef42);});});}function respondWithStatusCode(_0x4ef526,_0x230440){_0x230440=_0x230440||0xcc;return function(_0x28d44c){if(_0x28d44c){return _0x4ef526[_0xe321('0x2e')](_0x230440);}return _0x4ef526['status'](_0x230440)[_0xe321('0x2f')]();};}function respondWithResult(_0x17bbec,_0x3a3116){_0x3a3116=_0x3a3116||0xc8;return function(_0x334516){if(_0x334516){return _0x17bbec[_0xe321('0x30')](_0x3a3116)['json'](_0x334516);}};}function respondWithFilteredResult(_0x35b37a,_0x1b0b71){return function(_0x5f457b){if(_0x5f457b){var _0x1dd812=typeof _0x1b0b71['offset']===_0xe321('0x31')&&typeof _0x1b0b71['limit']===_0xe321('0x31');var _0x4aa1e7=_0x5f457b[_0xe321('0x32')];var _0x391e30=_0x1dd812?0x0:_0x1b0b71[_0xe321('0x33')];var _0x2aea37=_0x1dd812?_0x5f457b['count']:_0x1b0b71['offset']+_0x1b0b71['limit'];var _0x2c4922;if(_0x2aea37>=_0x4aa1e7){_0x2aea37=_0x4aa1e7;_0x2c4922=0xc8;}else{_0x2c4922=0xce;}_0x35b37a[_0xe321('0x30')](_0x2c4922);return _0x35b37a[_0xe321('0x34')](_0xe321('0x35'),_0x391e30+'-'+_0x2aea37+'/'+_0x4aa1e7)[_0xe321('0x36')](_0x5f457b);}return null;};}function patchUpdates(_0x227c42){return function(_0x16d088){try{jsonpatch['apply'](_0x16d088,_0x227c42,!![]);}catch(_0x1aa8dd){return BPromise['reject'](_0x1aa8dd);}return _0x16d088[_0xe321('0x37')]();};}function saveUpdates(_0x3f4ee2,_0x5efbad){return function(_0x2b3067){if(_0x2b3067){return _0x2b3067[_0xe321('0x38')](_0x3f4ee2)[_0xe321('0x24')](function(_0x28ebc8){return _0x28ebc8;});}return null;};}function removeEntity(_0x421ac7,_0x29bce6){return function(_0x34338a){if(_0x34338a){return _0x34338a['destroy']()['then'](function(){_0x421ac7[_0xe321('0x30')](0xcc)[_0xe321('0x2f')]();});}};}function handleEntityNotFound(_0x3ed2e4,_0x509d15){return function(_0x1a0b03){if(!_0x1a0b03){_0x3ed2e4['sendStatus'](0x194);}return _0x1a0b03;};}function handleError(_0x36f39c,_0xdcf36c){_0xdcf36c=_0xdcf36c||0x1f4;return function(_0x3c658a){logger[_0xe321('0x2a')](_0x3c658a['stack']);if(_0x3c658a[_0xe321('0x39')]){delete _0x3c658a[_0xe321('0x39')];}_0x36f39c[_0xe321('0x30')](_0xdcf36c)[_0xe321('0x3a')](_0x3c658a);};}exports[_0xe321('0x3b')]=function(_0x1835f0,_0x24ced7){var _0x3e6a1d={},_0x450ffb={},_0x1cad5a={'count':0x0,'rows':[]};var _0x2682ea=_['map'](db[_0xe321('0x3c')]['rawAttributes'],function(_0x3a2c8b){return{'name':_0x3a2c8b[_0xe321('0x3d')],'type':_0x3a2c8b['type'][_0xe321('0x3e')]};});_0x450ffb[_0xe321('0x3f')]=_[_0xe321('0x40')](_0x2682ea,_0xe321('0x39'));_0x450ffb[_0xe321('0x41')]=_['keys'](_0x1835f0['query']);_0x450ffb[_0xe321('0x42')]=_[_0xe321('0x43')](_0x450ffb['model'],_0x450ffb[_0xe321('0x41')]);_0x3e6a1d[_0xe321('0x44')]=_['intersection'](_0x450ffb['model'],qs[_0xe321('0x45')](_0x1835f0[_0xe321('0x41')][_0xe321('0x45')]));_0x3e6a1d[_0xe321('0x44')]=_0x3e6a1d[_0xe321('0x44')]['length']?_0x3e6a1d['attributes']:_0x450ffb[_0xe321('0x3f')];if(!_0x1835f0[_0xe321('0x41')][_0xe321('0x46')](_0xe321('0x47'))){_0x3e6a1d['limit']=qs['limit'](_0x1835f0[_0xe321('0x41')][_0xe321('0x48')]);_0x3e6a1d[_0xe321('0x33')]=qs[_0xe321('0x33')](_0x1835f0[_0xe321('0x41')]['offset']);}_0x3e6a1d[_0xe321('0x49')]=qs[_0xe321('0x4a')](_0x1835f0[_0xe321('0x41')][_0xe321('0x4a')]);_0x3e6a1d[_0xe321('0x4b')]=qs[_0xe321('0x42')](_[_0xe321('0x4c')](_0x1835f0[_0xe321('0x41')],_0x450ffb['filters']),_0x2682ea);if(_0x1835f0['query'][_0xe321('0x4d')]){_0x3e6a1d[_0xe321('0x4b')]=_[_0xe321('0x4e')](_0x3e6a1d[_0xe321('0x4b')],{'$or':_[_0xe321('0x40')](_0x2682ea,function(_0x1dbfe3){if(_0x1dbfe3[_0xe321('0x4f')]!==_0xe321('0x50')){var _0x3fa2e3={};_0x3fa2e3[_0x1dbfe3['name']]={'$like':'%'+_0x1835f0[_0xe321('0x41')][_0xe321('0x4d')]+'%'};return _0x3fa2e3;}})});}_0x3e6a1d=_['merge']({},_0x3e6a1d,_0x1835f0[_0xe321('0x51')]);var _0x233eb5={'where':_0x3e6a1d[_0xe321('0x4b')]};return db[_0xe321('0x3c')][_0xe321('0x32')](_0x233eb5)[_0xe321('0x24')](function(_0x3c5013){_0x1cad5a[_0xe321('0x32')]=_0x3c5013;if(_0x1835f0[_0xe321('0x41')]['includeAll']){_0x3e6a1d[_0xe321('0x52')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x3e6a1d);})[_0xe321('0x24')](function(_0x2436c0){_0x1cad5a[_0xe321('0x53')]=_0x2436c0;return _0x1cad5a;})[_0xe321('0x24')](respondWithFilteredResult(_0x24ced7,_0x3e6a1d))[_0xe321('0x2d')](handleError(_0x24ced7,null));};exports[_0xe321('0x54')]=function(_0x1df8f8,_0x1ca7d5){var _0x28b69a={'raw':!![],'where':{'id':_0x1df8f8['params']['id']}},_0x5ddbb3={};_0x5ddbb3[_0xe321('0x3f')]=_[_0xe321('0x55')](db[_0xe321('0x3c')][_0xe321('0x56')]);_0x5ddbb3[_0xe321('0x41')]=_['keys'](_0x1df8f8['query']);_0x5ddbb3['filters']=_['intersection'](_0x5ddbb3[_0xe321('0x3f')],_0x5ddbb3[_0xe321('0x41')]);_0x28b69a[_0xe321('0x44')]=_[_0xe321('0x43')](_0x5ddbb3['model'],qs[_0xe321('0x45')](_0x1df8f8['query'][_0xe321('0x45')]));_0x28b69a[_0xe321('0x44')]=_0x28b69a['attributes'][_0xe321('0x57')]?_0x28b69a[_0xe321('0x44')]:_0x5ddbb3[_0xe321('0x3f')];if(_0x1df8f8[_0xe321('0x41')]['includeAll']){_0x28b69a[_0xe321('0x52')]=[{'all':!![]}];}_0x28b69a=_['merge']({},_0x28b69a,_0x1df8f8[_0xe321('0x51')]);return db[_0xe321('0x3c')][_0xe321('0x58')](_0x28b69a)[_0xe321('0x24')](handleEntityNotFound(_0x1ca7d5,null))[_0xe321('0x24')](respondWithResult(_0x1ca7d5,null))['catch'](handleError(_0x1ca7d5,null));};exports[_0xe321('0x59')]=function(_0x589f0a,_0x7439ca){return db[_0xe321('0x3c')][_0xe321('0x59')](_0x589f0a[_0xe321('0x5a')],{})['then'](respondWithResult(_0x7439ca,0xc9))['catch'](handleError(_0x7439ca,null));};exports['update']=function(_0x33a73f,_0x430782){if(_0x33a73f[_0xe321('0x5a')]['id']){delete _0x33a73f[_0xe321('0x5a')]['id'];}return db[_0xe321('0x3c')][_0xe321('0x58')]({'where':{'id':_0x33a73f[_0xe321('0x5b')]['id']}})[_0xe321('0x24')](handleEntityNotFound(_0x430782,null))['then'](saveUpdates(_0x33a73f[_0xe321('0x5a')],null))['then'](respondWithResult(_0x430782,null))[_0xe321('0x2d')](handleError(_0x430782,null));};exports['destroy']=function(_0x4dc39c,_0x21591c){return db[_0xe321('0x3c')]['find']({'where':{'id':_0x4dc39c[_0xe321('0x5b')]['id']}})[_0xe321('0x24')](handleEntityNotFound(_0x21591c,null))[_0xe321('0x24')](removeEntity(_0x21591c,null))[_0xe321('0x2d')](handleError(_0x21591c,null));};exports[_0xe321('0x5c')]=function(_0x451a7f,_0x35a094){return db[_0xe321('0x3c')]['describe']()[_0xe321('0x24')](respondWithResult(_0x35a094,null))[_0xe321('0x2d')](handleError(_0x35a094,null));};var interaction_log=require('../../config/logger')(_0xe321('0x5d'));exports[_0xe321('0x5e')]=function(_0x22f41c,_0x1749c0,_0x50d4aa){var _0x1438c9={'agent':{},'channel':_0xe321('0x5f')};if(_0x22f41c[_0xe321('0x5a')]['id']){delete _0x22f41c['body']['id'];}_0x22f41c[_0xe321('0x5a')]['read']=!![];_0x22f41c[_0xe321('0x5a')][_0xe321('0x60')]=moment()[_0xe321('0x61')](_0xe321('0x62'));_0x22f41c[_0xe321('0x5a')]['UserId']=_0x22f41c[_0xe321('0x5a')]['UserId']||_0x22f41c[_0xe321('0x63')]['id'];_0x1438c9[_0xe321('0x64')]['id']=_0x22f41c['body'][_0xe321('0x65')];return db[_0xe321('0x3c')][_0xe321('0x58')]({'where':{'id':_0x22f41c['params']['id'],'UserId':null}})[_0xe321('0x24')](handleEntityNotFound(_0x1749c0,null))['then'](saveUpdates(_0x22f41c[_0xe321('0x5a')],null))[_0xe321('0x24')](function(_0x523557){if(_0x523557){_0x1438c9[_0xe321('0x2b')]=_0x523557[_0xe321('0x66')]({'plain':!![]});return db[_0xe321('0x67')][_0xe321('0x58')]({'where':{'id':_0x523557[_0xe321('0x68')]}});}return null;})[_0xe321('0x24')](handleEntityNotFound(_0x1749c0,null))[_0xe321('0x24')](function(_0x29294a){if(_0x29294a){return _0x29294a[_0xe321('0x38')]({'UserId':_0x22f41c[_0xe321('0x5a')]['UserId'],'read1stAt':_['isNil'](_0x29294a[_0xe321('0x69')])?moment()[_0xe321('0x61')](_0xe321('0x62')):undefined});}return null;})['then'](function(_0x11adb8){if(_0x11adb8){_0x1438c9[_0xe321('0x6a')]=_0x11adb8[_0xe321('0x66')]({'plain':!![]});interaction_log[_0xe321('0x25')](_0xe321('0x6b'),_0x22f41c[_0xe321('0x63')]['id'],_0x22f41c[_0xe321('0x63')][_0xe321('0x39')],_0x22f41c['user']['role'],_0x1438c9[_0xe321('0x6a')]['id'],_0x22f41c[_0xe321('0x5a')]?JSON[_0xe321('0x29')](_0x22f41c[_0xe321('0x5a')]):_0xe321('0x6c'));return respondWithRpcPromise(_0xe321('0x6d'),_0xe321('0x6e'),_0x1438c9);}return null;})[_0xe321('0x24')](function(_0xb5a2a){var _0x3aa5bf=_0xe321('0x6f')+_0xb5a2a['message']['ContactId'];return db[_0xe321('0x70')][_0xe321('0x41')](_0x3aa5bf,{'type':db['Sequelize'][_0xe321('0x71')][_0xe321('0x72')],'raw':!![]})['then'](function(_0x591a17){return _0x591a17;});})[_0xe321('0x24')](function(_0x4f60a8){if(_0x4f60a8){_0x1438c9['message'][_0xe321('0x73')]=_0x4f60a8[0x0];if(!_0x22f41c['body']['UserId'])return;return db[_0xe321('0x74')][_0xe321('0x58')]({'where':{'id':_0x22f41c[_0xe321('0x5a')]['UserId'],'role':_0xe321('0x64')},'attributes':['id',_0xe321('0x39'),_0xe321('0x75'),'email',_0xe321('0x76')],'raw':!![]});}return null;})[_0xe321('0x24')](function(_0xe9b47c){if(!_0xe9b47c)return null;_0x1438c9[_0xe321('0x2b')][_0xe321('0x64')]=_0xe9b47c;return _0x1438c9;})[_0xe321('0x24')](function(_0x697983){if(_0x697983){if(_0x22f41c['body'][_0xe321('0x77')]){_0x1438c9['message'][_0xe321('0x78')]=util[_0xe321('0x61')]('SIP/%s',_0x22f41c[_0xe321('0x63')][_0xe321('0x39')]);_0x1438c9[_0xe321('0x2b')]['channel']=_0x1438c9[_0xe321('0x79')];_0x1438c9['message']['motionChannel']=_0x1438c9[_0xe321('0x79')];_0x1438c9[_0xe321('0x2b')][_0xe321('0x7a')]=_0xe321('0x5e');return respondWithRpcPromise(_0xe321('0x7b'),_0xe321('0x7b'),{'event':_0xe321('0x7c'),'message':_['merge'](_0x1438c9[_0xe321('0x2b')],JSON[_0xe321('0x7d')](_0x1438c9[_0xe321('0x6a')][_0xe321('0x7e')]))},client9002)['then'](function(){return _0x1438c9;});}return _0x1438c9;}return null;})[_0xe321('0x24')](respondWithResult(_0x1749c0,null))['catch'](handleError(_0x1749c0,null));};var interaction_log=require(_0xe321('0x16'))('chat-interactions');exports['reject']=function(_0x4505d2,_0x4ff870,_0x4b76e3){var _0x16cb94={'agent':{},'channel':_0xe321('0x5f')};if(_0x4505d2[_0xe321('0x5a')]['id']){delete _0x4505d2['body']['id'];}_0x4505d2[_0xe321('0x5a')][_0xe321('0x65')]=_0x4505d2[_0xe321('0x5a')][_0xe321('0x65')]||_0x4505d2[_0xe321('0x63')]['id'];_0x16cb94[_0xe321('0x64')]['id']=_0x4505d2['body'][_0xe321('0x65')];return db[_0xe321('0x3c')][_0xe321('0x58')]({'where':{'id':_0x4505d2[_0xe321('0x5b')]['id'],'UserId':null}})[_0xe321('0x24')](handleEntityNotFound(_0x4ff870,null))['then'](function(_0x3e8821){if(_0x3e8821){_0x16cb94[_0xe321('0x2b')]=_0x3e8821[_0xe321('0x66')]({'plain':!![]});return db[_0xe321('0x67')]['find']({'where':{'id':_0x3e8821[_0xe321('0x68')]}});}return null;})[_0xe321('0x24')](handleEntityNotFound(_0x4ff870,null))['then'](function(_0x34cacd){if(_0x34cacd){_0x16cb94['interaction']=_0x34cacd[_0xe321('0x66')]({'plain':!![]});interaction_log[_0xe321('0x25')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4505d2[_0xe321('0x63')]['id'],_0x4505d2[_0xe321('0x63')][_0xe321('0x39')],_0x4505d2[_0xe321('0x63')][_0xe321('0x7f')],_0x16cb94['interaction']['id'],_0x4505d2[_0xe321('0x5a')]?JSON[_0xe321('0x29')](_0x4505d2['body']):'null');return respondWithRpcPromise(_0xe321('0x80'),'rejectMessage',_0x16cb94);}return null;})['then'](function(_0x12e142){var _0x505cf0=_0xe321('0x6f')+_0x12e142[_0xe321('0x2b')][_0xe321('0x81')];return db['sequelize']['query'](_0x505cf0,{'type':db[_0xe321('0x82')][_0xe321('0x71')]['SELECT'],'raw':!![]})['then'](function(_0x5acaa7){return _0x5acaa7;});})['then'](function(_0x5200a9){if(_0x5200a9){_0x16cb94[_0xe321('0x2b')][_0xe321('0x73')]=_0x5200a9[0x0];if(!_0x4505d2[_0xe321('0x5a')][_0xe321('0x65')])return;return db[_0xe321('0x74')][_0xe321('0x58')]({'where':{'id':_0x4505d2['body'][_0xe321('0x65')],'role':'agent'},'attributes':['id','name','fullname',_0xe321('0x83'),_0xe321('0x76')],'raw':!![]});}return null;})[_0xe321('0x24')](function(_0x3414d1){if(!_0x3414d1)return null;_0x16cb94['message'][_0xe321('0x64')]=_0x3414d1;return _0x16cb94;})[_0xe321('0x24')](function(_0x24a0a8){if(_0x24a0a8){_0x24a0a8[_0xe321('0x2b')][_0xe321('0x78')]=util[_0xe321('0x61')](_0xe321('0x84'),_0x4505d2[_0xe321('0x63')][_0xe321('0x39')]);_0x24a0a8[_0xe321('0x2b')][_0xe321('0x79')]=_0x16cb94[_0xe321('0x79')];_0x24a0a8['message'][_0xe321('0x85')]=_0x16cb94['channel'];_0x24a0a8[_0xe321('0x2b')]['event']=_0xe321('0x86');respondWithRpcPromise(_0xe321('0x7b'),_0xe321('0x7b'),{'event':'rejectmessage','message':_[_0xe321('0x4e')](_0x16cb94[_0xe321('0x2b')],JSON[_0xe321('0x7d')](_0x16cb94[_0xe321('0x6a')][_0xe321('0x7e')]))},client9002);return _0x16cb94;}return null;})[_0xe321('0x24')](respondWithResult(_0x4ff870,null))[_0xe321('0x2d')](handleError(_0x4ff870,null));}; \ No newline at end of file +var _0x1c23=['merge','options','ChatMessage','includeAll','include','findAll','rows','show','params','find','create','body','destroy','chat-interactions','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','SELECT','email','internal','manual','interface','SIP/%s','channel','motionChannel','accept','EventManager','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','RejectMessage','rejectMessage','ContactId','Sequelize','QueryTypes','contact','fullname','event','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL'];(function(_0x189ee5,_0x259fb4){var _0x47660a=function(_0x4c757a){while(--_0x4c757a){_0x189ee5['push'](_0x189ee5['shift']());}};_0x47660a(++_0x259fb4);}(_0x1c23,0x1c0));var _0x31c2=function(_0x330997,_0x25c3d0){_0x330997=_0x330997-0x0;var _0x9949be=_0x1c23[_0x330997];return _0x9949be;};'use strict';var emlformat=require(_0x31c2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x31c2('0x1'));var jsonpatch=require(_0x31c2('0x2'));var rp=require(_0x31c2('0x3'));var moment=require('moment');var BPromise=require(_0x31c2('0x4'));var Mustache=require('mustache');var util=require(_0x31c2('0x5'));var path=require(_0x31c2('0x6'));var sox=require(_0x31c2('0x7'));var csv=require(_0x31c2('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x31c2('0x9'));var _=require('lodash');var squel=require(_0x31c2('0xa'));var crypto=require(_0x31c2('0xb'));var jsforce=require(_0x31c2('0xc'));var deskjs=require(_0x31c2('0xd'));var toCsv=require('to-csv');var querystring=require(_0x31c2('0xe'));var Papa=require(_0x31c2('0xf'));var Redis=require(_0x31c2('0x10'));var authService=require(_0x31c2('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x31c2('0x12'));var logger=require(_0x31c2('0x13'))(_0x31c2('0x14'));var utils=require(_0x31c2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x31c2('0x16'));var db=require(_0x31c2('0x17'))['db'];config[_0x31c2('0x18')]=_[_0x31c2('0x19')](config[_0x31c2('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x31c2('0x1a'))(new Redis(config['redis']));require('./chatMessage.socket')[_0x31c2('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x31c2('0x1c')][_0x31c2('0x1d')]({'port':0x232c});var client9002=jayson[_0x31c2('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x271afa,_0x12ff61,_0x3ac04c,_0x3b6549){return new BPromise(function(_0x98834d,_0x19c309){var _0x2697e7=_0x3b6549||client;return _0x2697e7[_0x31c2('0x1e')](_0x271afa,_0x3ac04c)[_0x31c2('0x1f')](function(_0x5a904d){logger[_0x31c2('0x20')](_0x31c2('0x21'),_0x12ff61,_0x31c2('0x22'));logger['debug'](_0x31c2('0x23'),_0x12ff61,_0x31c2('0x22'),JSON['stringify'](_0x5a904d));if(_0x5a904d[_0x31c2('0x24')]){if(_0x5a904d['error']['code']===0x1f4){logger[_0x31c2('0x24')](_0x31c2('0x21'),_0x12ff61,_0x5a904d['error']['message']);return _0x19c309(_0x5a904d['error'][_0x31c2('0x25')]);}logger[_0x31c2('0x24')](_0x31c2('0x21'),_0x12ff61,_0x5a904d[_0x31c2('0x24')][_0x31c2('0x25')]);return _0x98834d(_0x5a904d[_0x31c2('0x24')][_0x31c2('0x25')]);}else{logger[_0x31c2('0x20')]('ChatMessage,\x20%s,\x20%s',_0x12ff61,'request\x20sent');_0x98834d(_0x5a904d[_0x31c2('0x26')][_0x31c2('0x25')]);}})[_0x31c2('0x27')](function(_0x4557f3){logger[_0x31c2('0x24')](_0x31c2('0x21'),_0x12ff61,_0x4557f3);_0x19c309(_0x4557f3);});});}function respondWithStatusCode(_0x1d3dff,_0x2852ce){_0x2852ce=_0x2852ce||0xcc;return function(_0x20d0f2){if(_0x20d0f2){return _0x1d3dff[_0x31c2('0x28')](_0x2852ce);}return _0x1d3dff[_0x31c2('0x29')](_0x2852ce)[_0x31c2('0x2a')]();};}function respondWithResult(_0x236779,_0x30a7cb){_0x30a7cb=_0x30a7cb||0xc8;return function(_0x509f94){if(_0x509f94){return _0x236779[_0x31c2('0x29')](_0x30a7cb)[_0x31c2('0x2b')](_0x509f94);}};}function respondWithFilteredResult(_0x3cb564,_0x436ffe){return function(_0x4ffa1a){if(_0x4ffa1a){var _0x38bcdf=typeof _0x436ffe[_0x31c2('0x2c')]===_0x31c2('0x2d')&&typeof _0x436ffe[_0x31c2('0x2e')]===_0x31c2('0x2d');var _0x6d60f=_0x4ffa1a[_0x31c2('0x2f')];var _0x312541=_0x38bcdf?0x0:_0x436ffe[_0x31c2('0x2c')];var _0x3042a4=_0x38bcdf?_0x4ffa1a[_0x31c2('0x2f')]:_0x436ffe[_0x31c2('0x2c')]+_0x436ffe[_0x31c2('0x2e')];var _0x3bc91b;if(_0x3042a4>=_0x6d60f){_0x3042a4=_0x6d60f;_0x3bc91b=0xc8;}else{_0x3bc91b=0xce;}_0x3cb564['status'](_0x3bc91b);return _0x3cb564[_0x31c2('0x30')]('Content-Range',_0x312541+'-'+_0x3042a4+'/'+_0x6d60f)['json'](_0x4ffa1a);}return null;};}function patchUpdates(_0x1d1908){return function(_0x23d9c6){try{jsonpatch[_0x31c2('0x31')](_0x23d9c6,_0x1d1908,!![]);}catch(_0x1d6feb){return BPromise[_0x31c2('0x32')](_0x1d6feb);}return _0x23d9c6[_0x31c2('0x33')]();};}function saveUpdates(_0x31fe98,_0x511f6f){return function(_0x58ec00){if(_0x58ec00){return _0x58ec00[_0x31c2('0x34')](_0x31fe98)['then'](function(_0x434649){return _0x434649;});}return null;};}function removeEntity(_0x23ae79,_0x742477){return function(_0x2d948d){if(_0x2d948d){return _0x2d948d['destroy']()[_0x31c2('0x1f')](function(){_0x23ae79[_0x31c2('0x29')](0xcc)[_0x31c2('0x2a')]();});}};}function handleEntityNotFound(_0x2b0f1a,_0x1356a3){return function(_0x2cc53c){if(!_0x2cc53c){_0x2b0f1a[_0x31c2('0x28')](0x194);}return _0x2cc53c;};}function handleError(_0x3ce7cb,_0x442b97){_0x442b97=_0x442b97||0x1f4;return function(_0x4142fb){logger[_0x31c2('0x24')](_0x4142fb[_0x31c2('0x35')]);if(_0x4142fb[_0x31c2('0x36')]){delete _0x4142fb['name'];}_0x3ce7cb[_0x31c2('0x29')](_0x442b97)[_0x31c2('0x37')](_0x4142fb);};}exports[_0x31c2('0x38')]=function(_0xbfdbb0,_0x2d4c6f){var _0x46b38b={},_0x71854f={},_0x390c02={'count':0x0,'rows':[]};var _0x542d3c=_[_0x31c2('0x39')](db['ChatMessage'][_0x31c2('0x3a')],function(_0x3f85fc){return{'name':_0x3f85fc['fieldName'],'type':_0x3f85fc[_0x31c2('0x3b')][_0x31c2('0x3c')]};});_0x71854f[_0x31c2('0x3d')]=_[_0x31c2('0x39')](_0x542d3c,_0x31c2('0x36'));_0x71854f[_0x31c2('0x3e')]=_[_0x31c2('0x3f')](_0xbfdbb0[_0x31c2('0x3e')]);_0x71854f['filters']=_[_0x31c2('0x40')](_0x71854f[_0x31c2('0x3d')],_0x71854f[_0x31c2('0x3e')]);_0x46b38b['attributes']=_[_0x31c2('0x40')](_0x71854f[_0x31c2('0x3d')],qs[_0x31c2('0x41')](_0xbfdbb0[_0x31c2('0x3e')][_0x31c2('0x41')]));_0x46b38b[_0x31c2('0x42')]=_0x46b38b[_0x31c2('0x42')][_0x31c2('0x43')]?_0x46b38b[_0x31c2('0x42')]:_0x71854f[_0x31c2('0x3d')];if(!_0xbfdbb0[_0x31c2('0x3e')][_0x31c2('0x44')](_0x31c2('0x45'))){_0x46b38b[_0x31c2('0x2e')]=qs['limit'](_0xbfdbb0['query'][_0x31c2('0x2e')]);_0x46b38b[_0x31c2('0x2c')]=qs['offset'](_0xbfdbb0[_0x31c2('0x3e')][_0x31c2('0x2c')]);}_0x46b38b[_0x31c2('0x46')]=qs['sort'](_0xbfdbb0[_0x31c2('0x3e')][_0x31c2('0x47')]);_0x46b38b[_0x31c2('0x48')]=qs['filters'](_['pick'](_0xbfdbb0['query'],_0x71854f[_0x31c2('0x49')]),_0x542d3c);if(_0xbfdbb0['query'][_0x31c2('0x4a')]){_0x46b38b[_0x31c2('0x48')]=_['merge'](_0x46b38b[_0x31c2('0x48')],{'$or':_[_0x31c2('0x39')](_0x542d3c,function(_0xc1f5b3){if(_0xc1f5b3['type']!==_0x31c2('0x4b')){var _0xc69ce4={};_0xc69ce4[_0xc1f5b3['name']]={'$like':'%'+_0xbfdbb0[_0x31c2('0x3e')][_0x31c2('0x4a')]+'%'};return _0xc69ce4;}})});}_0x46b38b=_[_0x31c2('0x4c')]({},_0x46b38b,_0xbfdbb0[_0x31c2('0x4d')]);var _0x1add14={'where':_0x46b38b[_0x31c2('0x48')]};return db[_0x31c2('0x4e')][_0x31c2('0x2f')](_0x1add14)['then'](function(_0x153af8){_0x390c02[_0x31c2('0x2f')]=_0x153af8;if(_0xbfdbb0[_0x31c2('0x3e')][_0x31c2('0x4f')]){_0x46b38b[_0x31c2('0x50')]=[{'all':!![]}];}return db[_0x31c2('0x4e')][_0x31c2('0x51')](_0x46b38b);})[_0x31c2('0x1f')](function(_0x3a3250){_0x390c02[_0x31c2('0x52')]=_0x3a3250;return _0x390c02;})['then'](respondWithFilteredResult(_0x2d4c6f,_0x46b38b))[_0x31c2('0x27')](handleError(_0x2d4c6f,null));};exports[_0x31c2('0x53')]=function(_0x5e10b0,_0x1eaf2c){var _0x22489b={'raw':!![],'where':{'id':_0x5e10b0[_0x31c2('0x54')]['id']}},_0x44c7cf={};_0x44c7cf[_0x31c2('0x3d')]=_['keys'](db[_0x31c2('0x4e')][_0x31c2('0x3a')]);_0x44c7cf['query']=_[_0x31c2('0x3f')](_0x5e10b0[_0x31c2('0x3e')]);_0x44c7cf['filters']=_['intersection'](_0x44c7cf['model'],_0x44c7cf[_0x31c2('0x3e')]);_0x22489b[_0x31c2('0x42')]=_[_0x31c2('0x40')](_0x44c7cf[_0x31c2('0x3d')],qs[_0x31c2('0x41')](_0x5e10b0[_0x31c2('0x3e')][_0x31c2('0x41')]));_0x22489b['attributes']=_0x22489b['attributes'][_0x31c2('0x43')]?_0x22489b[_0x31c2('0x42')]:_0x44c7cf[_0x31c2('0x3d')];if(_0x5e10b0[_0x31c2('0x3e')][_0x31c2('0x4f')]){_0x22489b[_0x31c2('0x50')]=[{'all':!![]}];}_0x22489b=_[_0x31c2('0x4c')]({},_0x22489b,_0x5e10b0[_0x31c2('0x4d')]);return db[_0x31c2('0x4e')][_0x31c2('0x55')](_0x22489b)[_0x31c2('0x1f')](handleEntityNotFound(_0x1eaf2c,null))[_0x31c2('0x1f')](respondWithResult(_0x1eaf2c,null))[_0x31c2('0x27')](handleError(_0x1eaf2c,null));};exports[_0x31c2('0x56')]=function(_0x4f79a1,_0x574f3a){return db[_0x31c2('0x4e')]['create'](_0x4f79a1[_0x31c2('0x57')],{})[_0x31c2('0x1f')](respondWithResult(_0x574f3a,0xc9))['catch'](handleError(_0x574f3a,null));};exports['update']=function(_0x32aa7b,_0x2706b4){if(_0x32aa7b[_0x31c2('0x57')]['id']){delete _0x32aa7b[_0x31c2('0x57')]['id'];}return db['ChatMessage'][_0x31c2('0x55')]({'where':{'id':_0x32aa7b['params']['id']}})['then'](handleEntityNotFound(_0x2706b4,null))[_0x31c2('0x1f')](saveUpdates(_0x32aa7b['body'],null))['then'](respondWithResult(_0x2706b4,null))[_0x31c2('0x27')](handleError(_0x2706b4,null));};exports[_0x31c2('0x58')]=function(_0x518ee7,_0x13ff70){return db[_0x31c2('0x4e')][_0x31c2('0x55')]({'where':{'id':_0x518ee7['params']['id']}})['then'](handleEntityNotFound(_0x13ff70,null))[_0x31c2('0x1f')](removeEntity(_0x13ff70,null))['catch'](handleError(_0x13ff70,null));};exports['describe']=function(_0xcc2b84,_0x3e6e4f){return db['ChatMessage']['describe']()[_0x31c2('0x1f')](respondWithResult(_0x3e6e4f,null))[_0x31c2('0x27')](handleError(_0x3e6e4f,null));};var interaction_log=require('../../config/logger')(_0x31c2('0x59'));exports['accept']=function(_0x285101,_0x4c321f,_0x375918){var _0x249ace={'agent':{},'channel':_0x31c2('0x5a')};if(_0x285101[_0x31c2('0x57')]['id']){delete _0x285101[_0x31c2('0x57')]['id'];}_0x285101[_0x31c2('0x57')][_0x31c2('0x5b')]=!![];_0x285101['body'][_0x31c2('0x5c')]=moment()[_0x31c2('0x5d')](_0x31c2('0x5e'));_0x285101[_0x31c2('0x57')][_0x31c2('0x5f')]=_0x285101[_0x31c2('0x57')][_0x31c2('0x5f')]||_0x285101[_0x31c2('0x60')]['id'];_0x249ace[_0x31c2('0x61')]['id']=_0x285101[_0x31c2('0x57')][_0x31c2('0x5f')];return db[_0x31c2('0x4e')]['find']({'where':{'id':_0x285101['params']['id'],'UserId':null}})[_0x31c2('0x1f')](handleEntityNotFound(_0x4c321f,null))[_0x31c2('0x1f')](saveUpdates(_0x285101[_0x31c2('0x57')],null))['then'](function(_0xd26b53){if(_0xd26b53){_0x249ace[_0x31c2('0x25')]=_0xd26b53[_0x31c2('0x62')]({'plain':!![]});return db[_0x31c2('0x63')][_0x31c2('0x55')]({'where':{'id':_0xd26b53[_0x31c2('0x64')]}});}return null;})[_0x31c2('0x1f')](handleEntityNotFound(_0x4c321f,null))[_0x31c2('0x1f')](function(_0xa70d36){if(_0xa70d36){return _0xa70d36[_0x31c2('0x34')]({'UserId':_0x285101[_0x31c2('0x57')][_0x31c2('0x5f')],'read1stAt':_[_0x31c2('0x65')](_0xa70d36['read1stAt'])?moment()[_0x31c2('0x5d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x31c2('0x1f')](function(_0x2fb502){if(_0x2fb502){_0x249ace[_0x31c2('0x66')]=_0x2fb502[_0x31c2('0x62')]({'plain':!![]});interaction_log[_0x31c2('0x20')](_0x31c2('0x67'),_0x285101['user']['id'],_0x285101['user'][_0x31c2('0x36')],_0x285101[_0x31c2('0x60')][_0x31c2('0x68')],_0x249ace[_0x31c2('0x66')]['id'],_0x285101[_0x31c2('0x57')]?JSON['stringify'](_0x285101[_0x31c2('0x57')]):_0x31c2('0x69'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x249ace);}return null;})[_0x31c2('0x1f')](function(_0x46ade3){var _0x4531c5=_0x31c2('0x6a')+_0x46ade3[_0x31c2('0x25')]['ContactId'];return db[_0x31c2('0x6b')]['query'](_0x4531c5,{'type':db['Sequelize']['QueryTypes'][_0x31c2('0x6c')],'raw':!![]})[_0x31c2('0x1f')](function(_0x166825){return _0x166825;});})[_0x31c2('0x1f')](function(_0x49b5bd){if(_0x49b5bd){_0x249ace['message']['contact']=_0x49b5bd[0x0];if(!_0x285101[_0x31c2('0x57')]['UserId'])return;return db['User'][_0x31c2('0x55')]({'where':{'id':_0x285101[_0x31c2('0x57')][_0x31c2('0x5f')],'role':_0x31c2('0x61')},'attributes':['id',_0x31c2('0x36'),'fullname',_0x31c2('0x6d'),_0x31c2('0x6e')],'raw':!![]});}return null;})[_0x31c2('0x1f')](function(_0x474f59){if(!_0x474f59)return null;_0x249ace['message']['agent']=_0x474f59;return _0x249ace;})[_0x31c2('0x1f')](function(_0x37065b){if(_0x37065b){if(_0x285101[_0x31c2('0x57')][_0x31c2('0x6f')]){_0x249ace['message'][_0x31c2('0x70')]=util[_0x31c2('0x5d')](_0x31c2('0x71'),_0x285101['user'][_0x31c2('0x36')]);_0x249ace[_0x31c2('0x25')][_0x31c2('0x72')]=_0x249ace[_0x31c2('0x72')];_0x249ace[_0x31c2('0x25')][_0x31c2('0x73')]=_0x249ace['channel'];_0x249ace['message']['event']=_0x31c2('0x74');return respondWithRpcPromise(_0x31c2('0x75'),_0x31c2('0x75'),{'event':'acceptmessage','message':_[_0x31c2('0x4c')](_0x249ace[_0x31c2('0x25')],JSON[_0x31c2('0x76')](_0x249ace[_0x31c2('0x66')][_0x31c2('0x77')]))},client9002)[_0x31c2('0x1f')](function(){return _0x249ace;});}return _0x249ace;}return null;})[_0x31c2('0x1f')](respondWithResult(_0x4c321f,null))['catch'](handleError(_0x4c321f,null));};var interaction_log=require(_0x31c2('0x13'))(_0x31c2('0x59'));exports[_0x31c2('0x32')]=function(_0x2a06e2,_0x504927,_0x335e92){var _0x17c47a={'agent':{},'channel':'chat'};if(_0x2a06e2[_0x31c2('0x57')]['id']){delete _0x2a06e2[_0x31c2('0x57')]['id'];}_0x2a06e2['body'][_0x31c2('0x5f')]=_0x2a06e2[_0x31c2('0x57')]['UserId']||_0x2a06e2[_0x31c2('0x60')]['id'];_0x17c47a[_0x31c2('0x61')]['id']=_0x2a06e2['body']['UserId'];return db[_0x31c2('0x4e')][_0x31c2('0x55')]({'where':{'id':_0x2a06e2[_0x31c2('0x54')]['id'],'UserId':null}})[_0x31c2('0x1f')](handleEntityNotFound(_0x504927,null))[_0x31c2('0x1f')](function(_0x25e6ae){if(_0x25e6ae){_0x17c47a[_0x31c2('0x25')]=_0x25e6ae[_0x31c2('0x62')]({'plain':!![]});return db[_0x31c2('0x63')][_0x31c2('0x55')]({'where':{'id':_0x25e6ae[_0x31c2('0x64')]}});}return null;})[_0x31c2('0x1f')](handleEntityNotFound(_0x504927,null))[_0x31c2('0x1f')](function(_0x2b019c){if(_0x2b019c){_0x17c47a[_0x31c2('0x66')]=_0x2b019c[_0x31c2('0x62')]({'plain':!![]});interaction_log[_0x31c2('0x20')](_0x31c2('0x78'),_0x2a06e2[_0x31c2('0x60')]['id'],_0x2a06e2['user']['name'],_0x2a06e2['user'][_0x31c2('0x68')],_0x17c47a['interaction']['id'],_0x2a06e2[_0x31c2('0x57')]?JSON[_0x31c2('0x79')](_0x2a06e2[_0x31c2('0x57')]):_0x31c2('0x69'));return respondWithRpcPromise(_0x31c2('0x7a'),_0x31c2('0x7b'),_0x17c47a);}return null;})[_0x31c2('0x1f')](function(_0x58f728){var _0x38cf1f=_0x31c2('0x6a')+_0x58f728[_0x31c2('0x25')][_0x31c2('0x7c')];return db[_0x31c2('0x6b')][_0x31c2('0x3e')](_0x38cf1f,{'type':db[_0x31c2('0x7d')][_0x31c2('0x7e')][_0x31c2('0x6c')],'raw':!![]})['then'](function(_0x2f349b){return _0x2f349b;});})[_0x31c2('0x1f')](function(_0x4ed259){if(_0x4ed259){_0x17c47a['message'][_0x31c2('0x7f')]=_0x4ed259[0x0];if(!_0x2a06e2[_0x31c2('0x57')][_0x31c2('0x5f')])return;return db['User'][_0x31c2('0x55')]({'where':{'id':_0x2a06e2[_0x31c2('0x57')][_0x31c2('0x5f')],'role':_0x31c2('0x61')},'attributes':['id',_0x31c2('0x36'),_0x31c2('0x80'),_0x31c2('0x6d'),'internal'],'raw':!![]});}return null;})['then'](function(_0x211925){if(!_0x211925)return null;_0x17c47a[_0x31c2('0x25')][_0x31c2('0x61')]=_0x211925;return _0x17c47a;})[_0x31c2('0x1f')](function(_0x3eaf02){if(_0x3eaf02){_0x3eaf02[_0x31c2('0x25')]['interface']=util[_0x31c2('0x5d')]('SIP/%s',_0x2a06e2[_0x31c2('0x60')]['name']);_0x3eaf02[_0x31c2('0x25')][_0x31c2('0x72')]=_0x17c47a['channel'];_0x3eaf02['message'][_0x31c2('0x73')]=_0x17c47a[_0x31c2('0x72')];_0x3eaf02[_0x31c2('0x25')][_0x31c2('0x81')]=_0x31c2('0x32');respondWithRpcPromise(_0x31c2('0x75'),_0x31c2('0x75'),{'event':_0x31c2('0x82'),'message':_['merge'](_0x17c47a['message'],JSON[_0x31c2('0x76')](_0x17c47a['interaction'][_0x31c2('0x77')]))},client9002);return _0x17c47a;}return null;})['then'](respondWithResult(_0x504927,null))[_0x31c2('0x27')](handleError(_0x504927,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 02c031e..89054cf 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 _0xe59e=['ChatMessage','setMaxListeners','save','update','remove','emit','hook','events'];(function(_0x1abafe,_0x572047){var _0x4fae5a=function(_0x3a5923){while(--_0x3a5923){_0x1abafe['push'](_0x1abafe['shift']());}};_0x4fae5a(++_0x572047);}(_0xe59e,0x9f));var _0xee59=function(_0xe5776c,_0xf58ab5){_0xe5776c=_0xe5776c-0x0;var _0x38bc16=_0xe59e[_0xe5776c];return _0x38bc16;};'use strict';var EventEmitter=require(_0xee59('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0xee59('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xee59('0x2')](0x0);var events={'afterCreate':_0xee59('0x3'),'afterUpdate':_0xee59('0x4'),'afterDestroy':_0xee59('0x5')};function emitEvent(_0x5b61ef){return function(_0x19fb3e,_0x25c784,_0x687600){ChatMessageEvents[_0xee59('0x6')](_0x5b61ef+':'+_0x19fb3e['id'],_0x19fb3e);ChatMessageEvents[_0xee59('0x6')](_0x5b61ef,_0x19fb3e);_0x687600(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xee59('0x7')](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file +var _0x4ed2=['ChatMessage','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x160596,_0x136ac7){var _0x4519d0=function(_0x25a8b4){while(--_0x25a8b4){_0x160596['push'](_0x160596['shift']());}};_0x4519d0(++_0x136ac7);}(_0x4ed2,0x128));var _0x24ed=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4ed2[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x24ed('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0x24ed('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x24ed('0x2'),'afterUpdate':_0x24ed('0x3'),'afterDestroy':_0x24ed('0x4')};function emitEvent(_0x520f8a){return function(_0x2bab9e,_0x25c8ee,_0x3239e5){ChatMessageEvents[_0x24ed('0x5')](_0x520f8a+':'+_0x2bab9e['id'],_0x2bab9e);ChatMessageEvents[_0x24ed('0x5')](_0x520f8a,_0x2bab9e);_0x3239e5(null);};}for(var e in events){if(events[_0x24ed('0x6')](e)){var event=events[e];ChatMessage[_0x24ed('0x7')](e,emitEvent(event));}}module[_0x24ed('0x8')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index ca410f4..c1fb2a6 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 _0xfca5=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','ChatInteraction','findOne','then','update','createdAt','utf8mb4_unicode_ci','lodash'];(function(_0x1f318b,_0x42dbed){var _0x15bfbc=function(_0x4f35d3){while(--_0x4f35d3){_0x1f318b['push'](_0x1f318b['shift']());}};_0x15bfbc(++_0x42dbed);}(_0xfca5,0x1cf));var _0x5fca=function(_0x3a60b8,_0x47caab){_0x3a60b8=_0x3a60b8-0x0;var _0x4eb583=_0xfca5[_0x3a60b8];return _0x4eb583;};'use strict';var _=require(_0x5fca('0x0'));var util=require(_0x5fca('0x1'));var logger=require(_0x5fca('0x2'))(_0x5fca('0x3'));var moment=require(_0x5fca('0x4'));var BPromise=require('bluebird');var rp=require(_0x5fca('0x5'));var fs=require('fs');var path=require(_0x5fca('0x6'));var rimraf=require(_0x5fca('0x7'));var config=require(_0x5fca('0x8'));var attributes=require(_0x5fca('0x9'));module[_0x5fca('0xa')]=function(_0x186536,_0x2156f7){return _0x186536[_0x5fca('0xb')](_0x5fca('0xc'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x5fca('0xd'),'fields':[_0x5fca('0xe')],'type':_0x5fca('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2bcebd,_0x3cabc1,_0x2a914b){var _0x117891=_0x186536[_0x5fca('0x10')];var _0x41ada0=_0x2bcebd[_0x5fca('0x11')]({'plain':!![]});if(_0x41ada0[_0x5fca('0x12')][_0x5fca('0x13')]()==='in'||_0x41ada0['direction'][_0x5fca('0x13')]()===_0x5fca('0x14')&&!_0x41ada0['secret']&&!_[_0x5fca('0x15')](_0x41ada0[_0x5fca('0x16')])){_0x117891[_0x5fca('0x17')][_0x5fca('0x18')]({'where':{'id':_0x41ada0['ChatInteractionId']}})[_0x5fca('0x19')](function(_0x8add8b){if(_0x8add8b){_0x8add8b[_0x5fca('0x1a')]({'lastMsgAt':_0x41ada0[_0x5fca('0x1b')],'lastMsgDirection':_0x41ada0[_0x5fca('0x12')][_0x5fca('0x13')]()});}})['catch'](function(_0xebc5cf){console['error'](_0xebc5cf);});}_0x2a914b();}},'charset':'utf8mb4','collate':_0x5fca('0x1c')});}; \ No newline at end of file +var _0xb9fb=['findOne','then','update','createdAt','catch','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','define','chat_messages','fti_chat_messages','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb9fb,0x1e3));var _0xbb9f=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xb9fb[_0x4243a3];return _0x1b2a33;};'use strict';var _=require(_0xbb9f('0x0'));var util=require(_0xbb9f('0x1'));var logger=require(_0xbb9f('0x2'))('api');var moment=require(_0xbb9f('0x3'));var BPromise=require(_0xbb9f('0x4'));var rp=require(_0xbb9f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbb9f('0x6'));var config=require(_0xbb9f('0x7'));var attributes=require('./chatMessage.attributes');module['exports']=function(_0x11d415,_0x2dc700){return _0x11d415[_0xbb9f('0x8')]('ChatMessage',attributes,{'tableName':_0xbb9f('0x9'),'paranoid':![],'indexes':[{'name':_0xbb9f('0xa'),'fields':[_0xbb9f('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3d247a,_0x286d62,_0x314bf1){var _0x17fce1=_0x11d415[_0xbb9f('0xc')];var _0xf1754f=_0x3d247a[_0xbb9f('0xd')]({'plain':!![]});if(_0xf1754f[_0xbb9f('0xe')][_0xbb9f('0xf')]()==='in'||_0xf1754f['direction'][_0xbb9f('0xf')]()===_0xbb9f('0x10')&&!_0xf1754f[_0xbb9f('0x11')]&&!_[_0xbb9f('0x12')](_0xf1754f[_0xbb9f('0x13')])){_0x17fce1[_0xbb9f('0x14')][_0xbb9f('0x15')]({'where':{'id':_0xf1754f['ChatInteractionId']}})[_0xbb9f('0x16')](function(_0x45fd7e){if(_0x45fd7e){_0x45fd7e[_0xbb9f('0x17')]({'lastMsgAt':_0xf1754f[_0xbb9f('0x18')],'lastMsgDirection':_0xf1754f['direction'][_0xbb9f('0xf')]()});}})[_0xbb9f('0x19')](function(_0x4871f7){console[_0xbb9f('0x1a')](_0x4871f7);});}_0x314bf1();}},'charset':'utf8mb4','collate':_0xbb9f('0x1b')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 2209dbd..430e863 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 _0xd6c2=['request\x20sent','debug','error','message','result','catch','body','options','raw','CreateChatMessage','stringify','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./chatMessage.socket','request','then','info','ChatMessage,\x20%s,\x20%s'];(function(_0x4e177a,_0x232ced){var _0x5548ae=function(_0x4bd597){while(--_0x4bd597){_0x4e177a['push'](_0x4e177a['shift']());}};_0x5548ae(++_0x232ced);}(_0xd6c2,0x14a));var _0x2d6c=function(_0x1ab9cf,_0x5dee91){_0x1ab9cf=_0x1ab9cf-0x0;var _0x1faa40=_0xd6c2[_0x1ab9cf];return _0x1faa40;};'use strict';var _=require('lodash');var util=require(_0x2d6c('0x0'));var moment=require(_0x2d6c('0x1'));var BPromise=require(_0x2d6c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2d6c('0x3'))['db'];var utils=require(_0x2d6c('0x4'));var logger=require(_0x2d6c('0x5'))(_0x2d6c('0x6'));var config=require(_0x2d6c('0x7'));var jayson=require(_0x2d6c('0x8'));var client=jayson[_0x2d6c('0x9')]['http']({'port':0x232a});config[_0x2d6c('0xa')]=_['defaults'](config['redis'],{'host':_0x2d6c('0xb'),'port':0x18eb});var socket=require(_0x2d6c('0xc'))(new Redis(config[_0x2d6c('0xa')]));require(_0x2d6c('0xd'))['register'](socket);function respondWithRpcPromise(_0x558eec,_0x3c16e2,_0x5168c6){return new BPromise(function(_0xe16acb,_0x2face3){return client[_0x2d6c('0xe')](_0x558eec,_0x5168c6)[_0x2d6c('0xf')](function(_0x39dd2c){logger[_0x2d6c('0x10')](_0x2d6c('0x11'),_0x3c16e2,_0x2d6c('0x12'));logger[_0x2d6c('0x13')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x3c16e2,_0x2d6c('0x12'),JSON['stringify'](_0x39dd2c));if(_0x39dd2c[_0x2d6c('0x14')]){if(_0x39dd2c[_0x2d6c('0x14')]['code']===0x1f4){logger[_0x2d6c('0x14')](_0x2d6c('0x11'),_0x3c16e2,_0x39dd2c[_0x2d6c('0x14')][_0x2d6c('0x15')]);return _0x2face3(_0x39dd2c[_0x2d6c('0x14')][_0x2d6c('0x15')]);}logger[_0x2d6c('0x14')]('ChatMessage,\x20%s,\x20%s',_0x3c16e2,_0x39dd2c[_0x2d6c('0x14')][_0x2d6c('0x15')]);return _0xe16acb(_0x39dd2c[_0x2d6c('0x14')][_0x2d6c('0x15')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x3c16e2,_0x2d6c('0x12'));_0xe16acb(_0x39dd2c[_0x2d6c('0x16')][_0x2d6c('0x15')]);}})[_0x2d6c('0x17')](function(_0xc5567){logger[_0x2d6c('0x14')]('ChatMessage,\x20%s,\x20%s',_0x3c16e2,_0xc5567);_0x2face3(_0xc5567);});});}exports['CreateChatMessage']=function(_0xd6b8b4){var _0x4e55e4=this;return new Promise(function(_0x103ed4,_0x349590){return db['ChatMessage']['create'](_0xd6b8b4[_0x2d6c('0x18')],{'raw':_0xd6b8b4[_0x2d6c('0x19')]?_0xd6b8b4[_0x2d6c('0x19')][_0x2d6c('0x1a')]===undefined?!![]:![]:!![]})[_0x2d6c('0xf')](function(_0x1f18e3){logger[_0x2d6c('0x10')](_0x2d6c('0x1b'),_0xd6b8b4);logger[_0x2d6c('0x13')]('CreateChatMessage',_0xd6b8b4,JSON[_0x2d6c('0x1c')](_0x1f18e3));_0x103ed4(_0x1f18e3);})[_0x2d6c('0x17')](function(_0x1eec1e){logger['error']('CreateChatMessage',_0x1eec1e[_0x2d6c('0x15')],_0xd6b8b4);_0x349590(_0x4e55e4[_0x2d6c('0x14')](0x1f4,_0x1eec1e[_0x2d6c('0x15')]));});});}; \ No newline at end of file +var _0xe626=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','redis','localhost','socket.io-emitter','register','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','CreateChatMessage','ChatMessage','create','body','options','raw','catch','lodash','util','moment'];(function(_0xac58fa,_0x387da3){var _0x521f8f=function(_0x3972b2){while(--_0x3972b2){_0xac58fa['push'](_0xac58fa['shift']());}};_0x521f8f(++_0x387da3);}(_0xe626,0x9d));var _0x6e62=function(_0xf1579e,_0x30806b){_0xf1579e=_0xf1579e-0x0;var _0x149ac2=_0xe626[_0xf1579e];return _0x149ac2;};'use strict';var _=require(_0x6e62('0x0'));var util=require(_0x6e62('0x1'));var moment=require(_0x6e62('0x2'));var BPromise=require(_0x6e62('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6e62('0x4'));var db=require(_0x6e62('0x5'))['db'];var utils=require(_0x6e62('0x6'));var logger=require(_0x6e62('0x7'))(_0x6e62('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x6e62('0x9')]({'port':0x232a});config[_0x6e62('0xa')]=_['defaults'](config[_0x6e62('0xa')],{'host':_0x6e62('0xb'),'port':0x18eb});var socket=require(_0x6e62('0xc'))(new Redis(config[_0x6e62('0xa')]));require('./chatMessage.socket')[_0x6e62('0xd')](socket);function respondWithRpcPromise(_0x3d677f,_0x4e25d3,_0x2fbfd0){return new BPromise(function(_0x4c3b6b,_0x1f2693){return client['request'](_0x3d677f,_0x2fbfd0)[_0x6e62('0xe')](function(_0x4fc5a8){logger[_0x6e62('0xf')](_0x6e62('0x10'),_0x4e25d3,_0x6e62('0x11'));logger[_0x6e62('0x12')](_0x6e62('0x13'),_0x4e25d3,_0x6e62('0x11'),JSON[_0x6e62('0x14')](_0x4fc5a8));if(_0x4fc5a8['error']){if(_0x4fc5a8['error'][_0x6e62('0x15')]===0x1f4){logger[_0x6e62('0x16')]('ChatMessage,\x20%s,\x20%s',_0x4e25d3,_0x4fc5a8[_0x6e62('0x16')][_0x6e62('0x17')]);return _0x1f2693(_0x4fc5a8[_0x6e62('0x16')][_0x6e62('0x17')]);}logger['error'](_0x6e62('0x10'),_0x4e25d3,_0x4fc5a8[_0x6e62('0x16')][_0x6e62('0x17')]);return _0x4c3b6b(_0x4fc5a8[_0x6e62('0x16')][_0x6e62('0x17')]);}else{logger[_0x6e62('0xf')](_0x6e62('0x10'),_0x4e25d3,_0x6e62('0x11'));_0x4c3b6b(_0x4fc5a8[_0x6e62('0x18')][_0x6e62('0x17')]);}})['catch'](function(_0x1f5ee7){logger[_0x6e62('0x16')]('ChatMessage,\x20%s,\x20%s',_0x4e25d3,_0x1f5ee7);_0x1f2693(_0x1f5ee7);});});}exports[_0x6e62('0x19')]=function(_0x4ecdff){var _0xf7d17f=this;return new Promise(function(_0x24b133,_0x2e162e){return db[_0x6e62('0x1a')][_0x6e62('0x1b')](_0x4ecdff[_0x6e62('0x1c')],{'raw':_0x4ecdff[_0x6e62('0x1d')]?_0x4ecdff[_0x6e62('0x1d')][_0x6e62('0x1e')]===undefined?!![]:![]:!![]})[_0x6e62('0xe')](function(_0x1954dc){logger['info'](_0x6e62('0x19'),_0x4ecdff);logger['debug'](_0x6e62('0x19'),_0x4ecdff,JSON[_0x6e62('0x14')](_0x1954dc));_0x24b133(_0x1954dc);})[_0x6e62('0x1f')](function(_0x40d498){logger[_0x6e62('0x16')](_0x6e62('0x19'),_0x40d498[_0x6e62('0x17')],_0x4ecdff);_0x2e162e(_0xf7d17f[_0x6e62('0x16')](0x1f4,_0x40d498[_0x6e62('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index a25d87d..1c80e39 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 _0x6726=['length','chatMessage:','save','remove','emit','removeListener','register'];(function(_0x5cab28,_0x307622){var _0xa3554d=function(_0x330139){while(--_0x330139){_0x5cab28['push'](_0x5cab28['shift']());}};_0xa3554d(++_0x307622);}(_0x6726,0xdb));var _0x6672=function(_0x715d76,_0x402d60){_0x715d76=_0x715d76-0x0;var _0x48fe88=_0x6726[_0x715d76];return _0x48fe88;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x6672('0x0'),_0x6672('0x1'),'update'];function createListener(_0x3a0005,_0xaa1168){return function(_0x5cdb03){_0xaa1168[_0x6672('0x2')](_0x3a0005,_0x5cdb03);};}function removeListener(_0x5bf86c,_0x32e5c6){return function(){ChatMessageEvents[_0x6672('0x3')](_0x5bf86c,_0x32e5c6);};}exports[_0x6672('0x4')]=function(_0x40ba7e){for(var _0x5701b9=0x0,_0xa1d3b7=events[_0x6672('0x5')];_0x5701b9<_0xa1d3b7;_0x5701b9++){var _0x263321=events[_0x5701b9];var _0x379b90=createListener(_0x6672('0x6')+_0x263321,_0x40ba7e);ChatMessageEvents['on'](_0x263321,_0x379b90);}}; \ No newline at end of file +var _0xc18a=['removeListener','register','length','chatMessage:','./chatMessage.events','save','remove','update','emit'];(function(_0x817d9b,_0x3c37e3){var _0x2752e1=function(_0x2b434e){while(--_0x2b434e){_0x817d9b['push'](_0x817d9b['shift']());}};_0x2752e1(++_0x3c37e3);}(_0xc18a,0x1cf));var _0xac18=function(_0x520c17,_0x4b14fd){_0x520c17=_0x520c17-0x0;var _0x386717=_0xc18a[_0x520c17];return _0x386717;};'use strict';var ChatMessageEvents=require(_0xac18('0x0'));var events=[_0xac18('0x1'),_0xac18('0x2'),_0xac18('0x3')];function createListener(_0x48266f,_0x3a3e96){return function(_0x2651c2){_0x3a3e96[_0xac18('0x4')](_0x48266f,_0x2651c2);};}function removeListener(_0x3da5f5,_0x42f646){return function(){ChatMessageEvents[_0xac18('0x5')](_0x3da5f5,_0x42f646);};}exports[_0xac18('0x6')]=function(_0x395493){for(var _0x49136f=0x0,_0xab6cb=events[_0xac18('0x7')];_0x49136f<_0xab6cb;_0x49136f++){var _0x542a9=events[_0x49136f];var _0x2bf4b8=createListener(_0xac18('0x8')+_0x542a9,_0x395493);ChatMessageEvents['on'](_0x542a9,_0x2bf4b8);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 5f59101..0a2289b 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 _0x8148=['show','post','chat','chatmessage:create','put','/:id','/:id/accept','accept','reject','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/describe','isAuthenticated','describe'];(function(_0x458541,_0x203ceb){var _0x24e13a=function(_0x13baf7){while(--_0x13baf7){_0x458541['push'](_0x458541['shift']());}};_0x24e13a(++_0x203ceb);}(_0x8148,0xcb));var _0x8814=function(_0x307e70,_0x996fd2){_0x307e70=_0x307e70-0x0;var _0x5991ce=_0x8148[_0x307e70];return _0x5991ce;};'use strict';var multer=require(_0x8814('0x0'));var util=require('util');var path=require(_0x8814('0x1'));var timeout=require(_0x8814('0x2'));var express=require(_0x8814('0x3'));var router=express[_0x8814('0x4')]();var fs_extra=require(_0x8814('0x5'));var auth=require(_0x8814('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8814('0x7'));var controller=require('./chatMessage.controller');router[_0x8814('0x8')]('/',auth['isAuthenticated'](),controller[_0x8814('0x9')]);router[_0x8814('0x8')](_0x8814('0xa'),auth[_0x8814('0xb')](),controller[_0x8814('0xc')]);router[_0x8814('0x8')]('/:id',auth[_0x8814('0xb')](),controller[_0x8814('0xd')]);router[_0x8814('0xe')]('/',auth[_0x8814('0xb')](),interaction['tracked'](_0x8814('0xf'),_0x8814('0x10')),controller['create']);router[_0x8814('0x11')](_0x8814('0x12'),controller['update']);router['put'](_0x8814('0x13'),auth[_0x8814('0xb')](),controller[_0x8814('0x14')]);router[_0x8814('0x11')]('/:id/reject',auth[_0x8814('0xb')](),controller[_0x8814('0x15')]);router['delete']('/:id',auth[_0x8814('0xb')](),controller[_0x8814('0x16')]);module[_0x8814('0x17')]=router; \ No newline at end of file +var _0x3e73=['reject','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','/describe','describe','get','/:id','chat','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject'];(function(_0x972b9a,_0x4ee84f){var _0x4c02d9=function(_0x519549){while(--_0x519549){_0x972b9a['push'](_0x972b9a['shift']());}};_0x4c02d9(++_0x4ee84f);}(_0x3e73,0xf6));var _0x33e7=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0x3e73[_0x1c8c28];return _0x1f59b4;};'use strict';var multer=require(_0x33e7('0x0'));var util=require(_0x33e7('0x1'));var path=require(_0x33e7('0x2'));var timeout=require(_0x33e7('0x3'));var express=require(_0x33e7('0x4'));var router=express['Router']();var fs_extra=require(_0x33e7('0x5'));var auth=require(_0x33e7('0x6'));var interaction=require(_0x33e7('0x7'));var config=require(_0x33e7('0x8'));var controller=require(_0x33e7('0x9'));router['get']('/',auth[_0x33e7('0xa')](),controller[_0x33e7('0xb')]);router['get'](_0x33e7('0xc'),auth[_0x33e7('0xa')](),controller[_0x33e7('0xd')]);router[_0x33e7('0xe')](_0x33e7('0xf'),auth[_0x33e7('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),interaction['tracked'](_0x33e7('0x10'),_0x33e7('0x11')),controller[_0x33e7('0x12')]);router[_0x33e7('0x13')](_0x33e7('0xf'),controller[_0x33e7('0x14')]);router[_0x33e7('0x13')](_0x33e7('0x15'),auth[_0x33e7('0xa')](),controller[_0x33e7('0x16')]);router[_0x33e7('0x13')](_0x33e7('0x17'),auth['isAuthenticated'](),controller[_0x33e7('0x18')]);router[_0x33e7('0x19')](_0x33e7('0xf'),auth['isAuthenticated'](),controller[_0x33e7('0x1a')]);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 7e26054..fef171b 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(_0x6eee43,_0x2d6c68){var _0x37754d=function(_0x1991f3){while(--_0x1991f3){_0x6eee43['push'](_0x6eee43['shift']());}};_0x37754d(++_0x2d6c68);}(_0xb10b,0x12a));var _0xbb10=function(_0x385fed,_0x3a4757){_0x385fed=_0x385fed-0x0;var _0x52fa25=_0xb10b[_0x385fed];return _0x52fa25;};'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 _0x0b0e=['medium','sequelize','TEXT'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x0b0e,0x187));var _0xe0b0=function(_0x3fe042,_0x1106f7){_0x3fe042=_0x3fe042-0x0;var _0x7d4a1f=_0x0b0e[_0x3fe042];return _0x7d4a1f;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('0x2')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 3b7cb0c..5199f78 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 _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(_0x42f009,_0x5e27b1){var _0x22a1e0=function(_0x297993){while(--_0x297993){_0x42f009['push'](_0x42f009['shift']());}};_0x22a1e0(++_0x5e27b1);}(_0x7a54,0x106));var _0x47a5=function(_0x136ce6,_0x29982d){_0x136ce6=_0x136ce6-0x0;var _0x15a247=_0x7a54[_0x136ce6];return _0x15a247;};'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 +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(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x7a54,0x106));var _0x47a5=function(_0x24c90f,_0x5d57a6){_0x24c90f=_0x24c90f-0x0;var _0xcf87ef=_0x7a54[_0x24c90f];return _0xcf87ef;};'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 0d3ff8e..f0a6cdf 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 _0x38e7=['emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x1f2db8,_0x5606be){var _0x512b63=function(_0x3fde71){while(--_0x3fde71){_0x1f2db8['push'](_0x1f2db8['shift']());}};_0x512b63(++_0x5606be);}(_0x38e7,0x124));var _0x738e=function(_0x546aaf,_0x1ed138){_0x546aaf=_0x546aaf-0x0;var _0x1cbf6d=_0x38e7[_0x546aaf];return _0x1cbf6d;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x738e('0x0'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x738e('0x1')](0x0);var events={'afterCreate':_0x738e('0x2'),'afterUpdate':_0x738e('0x3'),'afterDestroy':_0x738e('0x4')};function emitEvent(_0x1607fe){return function(_0x264860,_0xd97730,_0x5e5462){ChatOfflineMessageEvents[_0x738e('0x5')](_0x1607fe+':'+_0x264860['id'],_0x264860);ChatOfflineMessageEvents[_0x738e('0x5')](_0x1607fe,_0x264860);_0x5e5462(null);};}for(var e in events){if(events[_0x738e('0x6')](e)){var event=events[e];ChatOfflineMessage[_0x738e('0x7')](e,emitEvent(event));}}module[_0x738e('0x8')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0x08f5=['hook','exports','events','../../mysqldb','save','update','emit','hasOwnProperty'];(function(_0x43e4b3,_0x1444de){var _0x10c655=function(_0x56c01d){while(--_0x56c01d){_0x43e4b3['push'](_0x43e4b3['shift']());}};_0x10c655(++_0x1444de);}(_0x08f5,0x172));var _0x508f=function(_0x540c49,_0x3e88d9){_0x540c49=_0x540c49-0x0;var _0x390f69=_0x08f5[_0x540c49];return _0x390f69;};'use strict';var EventEmitter=require(_0x508f('0x0'));var ChatOfflineMessage=require(_0x508f('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x508f('0x2'),'afterUpdate':_0x508f('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4891ba){return function(_0x263833,_0x4e2dbf,_0x46517c){ChatOfflineMessageEvents[_0x508f('0x4')](_0x4891ba+':'+_0x263833['id'],_0x263833);ChatOfflineMessageEvents['emit'](_0x4891ba,_0x263833);_0x46517c(null);};}for(var e in events){if(events[_0x508f('0x5')](e)){var event=events[e];ChatOfflineMessage[_0x508f('0x6')](e,emitEvent(event));}}module[_0x508f('0x7')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 99f54f5..4c758c0 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 _0x2d4c=['ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','define'];(function(_0x12f20b,_0x41f4cc){var _0x3ee45f=function(_0xa65949){while(--_0xa65949){_0x12f20b['push'](_0x12f20b['shift']());}};_0x3ee45f(++_0x41f4cc);}(_0x2d4c,0x118));var _0xc2d4=function(_0x13b63a,_0xa669f1){_0x13b63a=_0x13b63a-0x0;var _0x36dc88=_0x2d4c[_0x13b63a];return _0x36dc88;};'use strict';var attributes=require(_0xc2d4('0x0'));module['exports']=function(_0x5e5a62){return _0x5e5a62[_0xc2d4('0x1')](_0xc2d4('0x2'),attributes,{'tableName':_0xc2d4('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc2d4('0x4'),'collate':_0xc2d4('0x5')});}; \ No newline at end of file +var _0xa657=['define','ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xa657,0x10c));var _0x7a65=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa657[_0x3dd15e];return _0x231fd0;};'use strict';var attributes=require(_0x7a65('0x0'));module[_0x7a65('0x1')]=function(_0x28545d){return _0x28545d[_0x7a65('0x2')](_0x7a65('0x3'),attributes,{'tableName':_0x7a65('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x7a65('0x5')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index e35c55b..0977758 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 _0x6e43=['request','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6e43,0x11b));var _0x36e4=function(_0xc92cfb,_0x4a9ada){_0xc92cfb=_0xc92cfb-0x0;var _0x1319cd=_0x6e43[_0xc92cfb];return _0x1319cd;};'use strict';var _=require(_0x36e4('0x0'));var util=require(_0x36e4('0x1'));var moment=require(_0x36e4('0x2'));var BPromise=require(_0x36e4('0x3'));var rs=require(_0x36e4('0x4'));var fs=require('fs');var Redis=require(_0x36e4('0x5'));var db=require(_0x36e4('0x6'))['db'];var utils=require(_0x36e4('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x36e4('0x8'));var jayson=require(_0x36e4('0x9'));var client=jayson['client'][_0x36e4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x38df6d,_0x179d83,_0x83f1ee){return new BPromise(function(_0x50d588,_0x40b533){return client[_0x36e4('0xb')](_0x38df6d,_0x83f1ee)['then'](function(_0x20ea24){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x179d83,_0x36e4('0xc'));logger[_0x36e4('0xd')](_0x36e4('0xe'),_0x179d83,_0x36e4('0xc'),JSON[_0x36e4('0xf')](_0x20ea24));if(_0x20ea24[_0x36e4('0x10')]){if(_0x20ea24['error'][_0x36e4('0x11')]===0x1f4){logger[_0x36e4('0x10')](_0x36e4('0x12'),_0x179d83,_0x20ea24[_0x36e4('0x10')]['message']);return _0x40b533(_0x20ea24[_0x36e4('0x10')][_0x36e4('0x13')]);}logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x179d83,_0x20ea24[_0x36e4('0x10')]['message']);return _0x50d588(_0x20ea24[_0x36e4('0x10')][_0x36e4('0x13')]);}else{logger['info'](_0x36e4('0x12'),_0x179d83,_0x36e4('0xc'));_0x50d588(_0x20ea24[_0x36e4('0x14')][_0x36e4('0x13')]);}})['catch'](function(_0x32d7ca){logger['error'](_0x36e4('0x12'),_0x179d83,_0x32d7ca);_0x40b533(_0x32d7ca);});});} \ No newline at end of file +var _0x9dec=['info','debug','request\x20sent','error','code','message','ChatOfflineMessage,\x20%s,\x20%s','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x9dec,0x1d3));var _0xc9de=function(_0x2f002e,_0x305bad){_0x2f002e=_0x2f002e-0x0;var _0x5cfb0e=_0x9dec[_0x2f002e];return _0x5cfb0e;};'use strict';var _=require(_0xc9de('0x0'));var util=require('util');var moment=require(_0xc9de('0x1'));var BPromise=require(_0xc9de('0x2'));var rs=require(_0xc9de('0x3'));var fs=require('fs');var Redis=require(_0xc9de('0x4'));var db=require(_0xc9de('0x5'))['db'];var utils=require(_0xc9de('0x6'));var logger=require(_0xc9de('0x7'))('rpc');var config=require(_0xc9de('0x8'));var jayson=require(_0xc9de('0x9'));var client=jayson[_0xc9de('0xa')][_0xc9de('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x20b950,_0x37f6d8,_0x58f130){return new BPromise(function(_0x2a5a1b,_0xca0e97){return client['request'](_0x20b950,_0x58f130)[_0xc9de('0xc')](function(_0x3bf2ee){logger[_0xc9de('0xd')]('ChatOfflineMessage,\x20%s,\x20%s',_0x37f6d8,'request\x20sent');logger[_0xc9de('0xe')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x37f6d8,_0xc9de('0xf'),JSON['stringify'](_0x3bf2ee));if(_0x3bf2ee['error']){if(_0x3bf2ee[_0xc9de('0x10')][_0xc9de('0x11')]===0x1f4){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x37f6d8,_0x3bf2ee[_0xc9de('0x10')][_0xc9de('0x12')]);return _0xca0e97(_0x3bf2ee[_0xc9de('0x10')][_0xc9de('0x12')]);}logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x37f6d8,_0x3bf2ee[_0xc9de('0x10')][_0xc9de('0x12')]);return _0x2a5a1b(_0x3bf2ee['error']['message']);}else{logger[_0xc9de('0xd')](_0xc9de('0x13'),_0x37f6d8,_0xc9de('0xf'));_0x2a5a1b(_0x3bf2ee['result']['message']);}})['catch'](function(_0x28625f){logger[_0xc9de('0x10')](_0xc9de('0x13'),_0x37f6d8,_0x28625f);_0xca0e97(_0x28625f);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index a25220a..372d32d 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 _0x8056=['delete','/:id','destroy','exports','path','connect-timeout','fs-extra','../../components/auth/service','./chatOfflineMessage.controller','isAuthenticated','index','/describe','describe','get','show','create','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8056,0x1ad));var _0x6805=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x8056[_0x53ccf2];return _0x5a2964;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6805('0x0'));var timeout=require(_0x6805('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6805('0x2'));var auth=require(_0x6805('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6805('0x4'));router['get']('/',auth[_0x6805('0x5')](),controller[_0x6805('0x6')]);router['get'](_0x6805('0x7'),auth[_0x6805('0x5')](),controller[_0x6805('0x8')]);router[_0x6805('0x9')]('/:id',auth[_0x6805('0x5')](),controller[_0x6805('0xa')]);router['post']('/',auth[_0x6805('0x5')](),controller[_0x6805('0xb')]);router[_0x6805('0xc')]('/:id',auth[_0x6805('0x5')](),controller['update']);router[_0x6805('0xd')](_0x6805('0xe'),auth[_0x6805('0x5')](),controller[_0x6805('0xf')]);module[_0x6805('0x10')]=router; \ No newline at end of file +var _0xddd3=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','isAuthenticated','index','get','/describe','describe','show','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x1e22d6,_0x25605f){var _0x397cc4=function(_0x4339fa){while(--_0x4339fa){_0x1e22d6['push'](_0x1e22d6['shift']());}};_0x397cc4(++_0x25605f);}(_0xddd3,0x113));var _0x3ddd=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0xddd3[_0x54d4a8];return _0x3b321b;};'use strict';var multer=require(_0x3ddd('0x0'));var util=require(_0x3ddd('0x1'));var path=require('path');var timeout=require(_0x3ddd('0x2'));var express=require(_0x3ddd('0x3'));var router=express[_0x3ddd('0x4')]();var fs_extra=require(_0x3ddd('0x5'));var auth=require(_0x3ddd('0x6'));var interaction=require(_0x3ddd('0x7'));var config=require('../../config/environment');var controller=require(_0x3ddd('0x8'));router['get']('/',auth[_0x3ddd('0x9')](),controller[_0x3ddd('0xa')]);router[_0x3ddd('0xb')](_0x3ddd('0xc'),auth[_0x3ddd('0x9')](),controller[_0x3ddd('0xd')]);router[_0x3ddd('0xb')]('/:id',auth[_0x3ddd('0x9')](),controller[_0x3ddd('0xe')]);router[_0x3ddd('0xf')]('/',auth[_0x3ddd('0x9')](),controller[_0x3ddd('0x10')]);router[_0x3ddd('0x11')](_0x3ddd('0x12'),auth[_0x3ddd('0x9')](),controller[_0x3ddd('0x13')]);router[_0x3ddd('0x14')](_0x3ddd('0x12'),auth[_0x3ddd('0x9')](),controller[_0x3ddd('0x15')]);module[_0x3ddd('0x16')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index e2db2a0..b9a8a4a 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 _0x36d7=['mouseOver','INTEGER','exports','STRING','ENUM','timeout'];(function(_0x318dda,_0x1aa800){var _0x3f97ca=function(_0x1dc61a){while(--_0x1dc61a){_0x318dda['push'](_0x318dda['shift']());}};_0x3f97ca(++_0x1aa800);}(_0x36d7,0xfe));var _0x736d=function(_0x23a1ec,_0x2d521f){_0x23a1ec=_0x23a1ec-0x0;var _0x539cce=_0x36d7[_0x23a1ec];return _0x539cce;};'use strict';var Sequelize=require('sequelize');module[_0x736d('0x0')]={'name':{'type':Sequelize[_0x736d('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x736d('0x2')]('mouseOver',_0x736d('0x3')),'defaultValue':_0x736d('0x4')},'selector':{'type':Sequelize[_0x736d('0x1')]},'timeout':{'type':Sequelize[_0x736d('0x5')]}}; \ No newline at end of file +var _0x790e=['mouseOver','sequelize','exports','STRING','ENUM'];(function(_0x14ec9d,_0x45d283){var _0x3636df=function(_0x472568){while(--_0x472568){_0x14ec9d['push'](_0x14ec9d['shift']());}};_0x3636df(++_0x45d283);}(_0x790e,0x1b4));var _0xe790=function(_0x3eea50,_0x1a48c5){_0x3eea50=_0x3eea50-0x0;var _0x4acc37=_0x790e[_0x3eea50];return _0x4acc37;};'use strict';var Sequelize=require(_0xe790('0x0'));module[_0xe790('0x1')]={'name':{'type':Sequelize[_0xe790('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xe790('0x3')](_0xe790('0x4'),'timeout'),'defaultValue':_0xe790('0x4')},'selector':{'type':Sequelize[_0xe790('0x2')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 4b49151..d3c060f 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 _0x0dba=['intersection','attributes','fields','length','includeAll','merge','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','error','stack','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters'];(function(_0x274205,_0x4ebbd2){var _0x38a67b=function(_0x57f4b2){while(--_0x57f4b2){_0x274205['push'](_0x274205['shift']());}};_0x38a67b(++_0x4ebbd2);}(_0x0dba,0x136));var _0xa0db=function(_0x322bbf,_0x5a6b1f){_0x322bbf=_0x322bbf-0x0;var _0x49d84c=_0x0dba[_0x322bbf];return _0x49d84c;};'use strict';var emlformat=require(_0xa0db('0x0'));var rimraf=require(_0xa0db('0x1'));var zipdir=require(_0xa0db('0x2'));var jsonpatch=require(_0xa0db('0x3'));var rp=require(_0xa0db('0x4'));var moment=require(_0xa0db('0x5'));var BPromise=require(_0xa0db('0x6'));var Mustache=require(_0xa0db('0x7'));var util=require(_0xa0db('0x8'));var path=require(_0xa0db('0x9'));var sox=require(_0xa0db('0xa'));var csv=require(_0xa0db('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa0db('0xc'));var crypto=require(_0xa0db('0xd'));var jsforce=require(_0xa0db('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa0db('0xb'));var querystring=require(_0xa0db('0xf'));var Papa=require(_0xa0db('0x10'));var Redis=require(_0xa0db('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xa0db('0x12'));var as=require(_0xa0db('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa0db('0x14'));var utils=require(_0xa0db('0x15'));var config=require(_0xa0db('0x16'));var licenseUtil=require(_0xa0db('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x15ef0d,_0x19145b){_0x19145b=_0x19145b||0xcc;return function(_0xb161b6){if(_0xb161b6){return _0x15ef0d[_0xa0db('0x18')](_0x19145b);}return _0x15ef0d[_0xa0db('0x19')](_0x19145b)[_0xa0db('0x1a')]();};}function respondWithResult(_0x14d525,_0x3ea19f){_0x3ea19f=_0x3ea19f||0xc8;return function(_0x3eb470){if(_0x3eb470){return _0x14d525['status'](_0x3ea19f)[_0xa0db('0x1b')](_0x3eb470);}};}function respondWithFilteredResult(_0x1048bf,_0x24efb1){return function(_0x1bb2a0){if(_0x1bb2a0){var _0x2d8396=typeof _0x24efb1[_0xa0db('0x1c')]===_0xa0db('0x1d')&&typeof _0x24efb1[_0xa0db('0x1e')]===_0xa0db('0x1d');var _0x590f63=_0x1bb2a0[_0xa0db('0x1f')];var _0x215658=_0x2d8396?0x0:_0x24efb1['offset'];var _0x12766f=_0x2d8396?_0x1bb2a0[_0xa0db('0x1f')]:_0x24efb1[_0xa0db('0x1c')]+_0x24efb1[_0xa0db('0x1e')];var _0x4536fc;if(_0x12766f>=_0x590f63){_0x12766f=_0x590f63;_0x4536fc=0xc8;}else{_0x4536fc=0xce;}_0x1048bf[_0xa0db('0x19')](_0x4536fc);return _0x1048bf[_0xa0db('0x20')]('Content-Range',_0x215658+'-'+_0x12766f+'/'+_0x590f63)['json'](_0x1bb2a0);}return null;};}function patchUpdates(_0x479198){return function(_0x53c0d7){try{jsonpatch[_0xa0db('0x21')](_0x53c0d7,_0x479198,!![]);}catch(_0x3c7939){return BPromise[_0xa0db('0x22')](_0x3c7939);}return _0x53c0d7['save']();};}function saveUpdates(_0x4e9fb8,_0x24c25c){return function(_0x4c3070){if(_0x4c3070){return _0x4c3070[_0xa0db('0x23')](_0x4e9fb8)[_0xa0db('0x24')](function(_0x103160){return _0x103160;});}return null;};}function removeEntity(_0xc5ace,_0x4e9a22){return function(_0x2f3a45){if(_0x2f3a45){return _0x2f3a45[_0xa0db('0x25')]()[_0xa0db('0x24')](function(){_0xc5ace[_0xa0db('0x19')](0xcc)[_0xa0db('0x1a')]();});}};}function handleEntityNotFound(_0x362c30,_0x186d17){return function(_0x2a3742){if(!_0x2a3742){_0x362c30[_0xa0db('0x18')](0x194);}return _0x2a3742;};}function handleError(_0x2e858e,_0x5b0772){_0x5b0772=_0x5b0772||0x1f4;return function(_0x3652a1){logger[_0xa0db('0x26')](_0x3652a1[_0xa0db('0x27')]);if(_0x3652a1[_0xa0db('0x28')]){delete _0x3652a1[_0xa0db('0x28')];}_0x2e858e[_0xa0db('0x19')](_0x5b0772)[_0xa0db('0x29')](_0x3652a1);};}exports[_0xa0db('0x2a')]=function(_0x20a1bc,_0x28cb71){var _0xaa9854={'raw':!![],'where':{'id':_0x20a1bc[_0xa0db('0x2b')]['id']}},_0x3a3dba={};_0x3a3dba[_0xa0db('0x2c')]=_[_0xa0db('0x2d')](db[_0xa0db('0x2e')][_0xa0db('0x2f')]);_0x3a3dba['query']=_['keys'](_0x20a1bc[_0xa0db('0x30')]);_0x3a3dba[_0xa0db('0x31')]=_[_0xa0db('0x32')](_0x3a3dba[_0xa0db('0x2c')],_0x3a3dba[_0xa0db('0x30')]);_0xaa9854[_0xa0db('0x33')]=_[_0xa0db('0x32')](_0x3a3dba['model'],qs[_0xa0db('0x34')](_0x20a1bc[_0xa0db('0x30')]['fields']));_0xaa9854['attributes']=_0xaa9854['attributes'][_0xa0db('0x35')]?_0xaa9854[_0xa0db('0x33')]:_0x3a3dba['model'];if(_0x20a1bc[_0xa0db('0x30')][_0xa0db('0x36')]){_0xaa9854['include']=[{'all':!![]}];}_0xaa9854=_[_0xa0db('0x37')]({},_0xaa9854,_0x20a1bc['options']);return db['ChatProactiveAction'][_0xa0db('0x38')](_0xaa9854)[_0xa0db('0x24')](handleEntityNotFound(_0x28cb71,null))[_0xa0db('0x24')](respondWithResult(_0x28cb71,null))[_0xa0db('0x39')](handleError(_0x28cb71,null));};exports[_0xa0db('0x3a')]=function(_0x3c314f,_0xad2f44){return db[_0xa0db('0x2e')]['create'](_0x3c314f['body'],{})['then'](respondWithResult(_0xad2f44,0xc9))['catch'](handleError(_0xad2f44,null));};exports['update']=function(_0x562cd7,_0x34afd7){if(_0x562cd7[_0xa0db('0x3b')]['id']){delete _0x562cd7[_0xa0db('0x3b')]['id'];}return db[_0xa0db('0x2e')][_0xa0db('0x38')]({'where':{'id':_0x562cd7[_0xa0db('0x2b')]['id']}})[_0xa0db('0x24')](handleEntityNotFound(_0x34afd7,null))[_0xa0db('0x24')](saveUpdates(_0x562cd7[_0xa0db('0x3b')],null))[_0xa0db('0x24')](respondWithResult(_0x34afd7,null))[_0xa0db('0x39')](handleError(_0x34afd7,null));};exports[_0xa0db('0x25')]=function(_0xe92bbe,_0xc6c6af){return db[_0xa0db('0x2e')][_0xa0db('0x38')]({'where':{'id':_0xe92bbe[_0xa0db('0x2b')]['id']}})[_0xa0db('0x24')](handleEntityNotFound(_0xc6c6af,null))[_0xa0db('0x24')](removeEntity(_0xc6c6af,null))[_0xa0db('0x39')](handleError(_0xc6c6af,null));}; \ No newline at end of file +var _0xe953=['params','keys','ChatProactiveAction','filters','intersection','query','fields','attributes','length','includeAll','include','options','catch','create','body','find','moment','bluebird','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','end','error','stack','name','send'];(function(_0x2b7d7e,_0x11c4f4){var _0x416c9b=function(_0xffcd25){while(--_0xffcd25){_0x2b7d7e['push'](_0x2b7d7e['shift']());}};_0x416c9b(++_0x11c4f4);}(_0xe953,0x1d0));var _0x3e95=function(_0x58c20f,_0x4cdb1b){_0x58c20f=_0x58c20f-0x0;var _0x3b0318=_0xe953[_0x58c20f];return _0x3b0318;};'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(_0x3e95('0x0'));var BPromise=require(_0x3e95('0x1'));var Mustache=require('mustache');var util=require(_0x3e95('0x2'));var path=require('path');var sox=require(_0x3e95('0x3'));var csv=require('to-csv');var ejs=require(_0x3e95('0x4'));var fs=require('fs');var fs_extra=require(_0x3e95('0x5'));var _=require(_0x3e95('0x6'));var squel=require(_0x3e95('0x7'));var crypto=require(_0x3e95('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x3e95('0x9'));var toCsv=require(_0x3e95('0xa'));var querystring=require(_0x3e95('0xb'));var Papa=require('papaparse');var Redis=require(_0x3e95('0xc'));var authService=require(_0x3e95('0xd'));var qs=require(_0x3e95('0xe'));var as=require(_0x3e95('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3e95('0x10'))('api');var utils=require(_0x3e95('0x11'));var config=require(_0x3e95('0x12'));var licenseUtil=require(_0x3e95('0x13'));var db=require(_0x3e95('0x14'))['db'];function respondWithStatusCode(_0x466c03,_0x152671){_0x152671=_0x152671||0xcc;return function(_0x5047e3){if(_0x5047e3){return _0x466c03[_0x3e95('0x15')](_0x152671);}return _0x466c03[_0x3e95('0x16')](_0x152671)['end']();};}function respondWithResult(_0x1fb8f1,_0x721a12){_0x721a12=_0x721a12||0xc8;return function(_0x35d41c){if(_0x35d41c){return _0x1fb8f1[_0x3e95('0x16')](_0x721a12)['json'](_0x35d41c);}};}function respondWithFilteredResult(_0xbd4d4,_0xd1d345){return function(_0x5afe28){if(_0x5afe28){var _0x21b3b3=typeof _0xd1d345[_0x3e95('0x17')]===_0x3e95('0x18')&&typeof _0xd1d345[_0x3e95('0x19')]==='undefined';var _0x1490ec=_0x5afe28['count'];var _0x3ecd6f=_0x21b3b3?0x0:_0xd1d345[_0x3e95('0x17')];var _0x55babc=_0x21b3b3?_0x5afe28[_0x3e95('0x1a')]:_0xd1d345[_0x3e95('0x17')]+_0xd1d345[_0x3e95('0x19')];var _0x46a3c4;if(_0x55babc>=_0x1490ec){_0x55babc=_0x1490ec;_0x46a3c4=0xc8;}else{_0x46a3c4=0xce;}_0xbd4d4[_0x3e95('0x16')](_0x46a3c4);return _0xbd4d4[_0x3e95('0x1b')](_0x3e95('0x1c'),_0x3ecd6f+'-'+_0x55babc+'/'+_0x1490ec)[_0x3e95('0x1d')](_0x5afe28);}return null;};}function patchUpdates(_0x5c7479){return function(_0x18a811){try{jsonpatch['apply'](_0x18a811,_0x5c7479,!![]);}catch(_0x336022){return BPromise[_0x3e95('0x1e')](_0x336022);}return _0x18a811[_0x3e95('0x1f')]();};}function saveUpdates(_0x4945a4,_0x469751){return function(_0x57d05a){if(_0x57d05a){return _0x57d05a[_0x3e95('0x20')](_0x4945a4)[_0x3e95('0x21')](function(_0x1a601d){return _0x1a601d;});}return null;};}function removeEntity(_0x1d43a3,_0x334855){return function(_0x3258fb){if(_0x3258fb){return _0x3258fb[_0x3e95('0x22')]()[_0x3e95('0x21')](function(){_0x1d43a3[_0x3e95('0x16')](0xcc)[_0x3e95('0x23')]();});}};}function handleEntityNotFound(_0x327c90,_0x525506){return function(_0x3553fc){if(!_0x3553fc){_0x327c90[_0x3e95('0x15')](0x194);}return _0x3553fc;};}function handleError(_0x2a5aa5,_0x3f29a3){_0x3f29a3=_0x3f29a3||0x1f4;return function(_0x25be53){logger[_0x3e95('0x24')](_0x25be53[_0x3e95('0x25')]);if(_0x25be53[_0x3e95('0x26')]){delete _0x25be53[_0x3e95('0x26')];}_0x2a5aa5[_0x3e95('0x16')](_0x3f29a3)[_0x3e95('0x27')](_0x25be53);};}exports['show']=function(_0x761f8b,_0x38c2f5){var _0x16b907={'raw':!![],'where':{'id':_0x761f8b[_0x3e95('0x28')]['id']}},_0x1b07a9={};_0x1b07a9['model']=_[_0x3e95('0x29')](db[_0x3e95('0x2a')]['rawAttributes']);_0x1b07a9['query']=_[_0x3e95('0x29')](_0x761f8b['query']);_0x1b07a9[_0x3e95('0x2b')]=_[_0x3e95('0x2c')](_0x1b07a9['model'],_0x1b07a9[_0x3e95('0x2d')]);_0x16b907['attributes']=_[_0x3e95('0x2c')](_0x1b07a9['model'],qs[_0x3e95('0x2e')](_0x761f8b[_0x3e95('0x2d')][_0x3e95('0x2e')]));_0x16b907[_0x3e95('0x2f')]=_0x16b907['attributes'][_0x3e95('0x30')]?_0x16b907[_0x3e95('0x2f')]:_0x1b07a9['model'];if(_0x761f8b[_0x3e95('0x2d')][_0x3e95('0x31')]){_0x16b907[_0x3e95('0x32')]=[{'all':!![]}];}_0x16b907=_['merge']({},_0x16b907,_0x761f8b[_0x3e95('0x33')]);return db['ChatProactiveAction']['find'](_0x16b907)[_0x3e95('0x21')](handleEntityNotFound(_0x38c2f5,null))['then'](respondWithResult(_0x38c2f5,null))[_0x3e95('0x34')](handleError(_0x38c2f5,null));};exports['create']=function(_0x5e1826,_0x5b3220){return db[_0x3e95('0x2a')][_0x3e95('0x35')](_0x5e1826[_0x3e95('0x36')],{})[_0x3e95('0x21')](respondWithResult(_0x5b3220,0xc9))[_0x3e95('0x34')](handleError(_0x5b3220,null));};exports[_0x3e95('0x20')]=function(_0x8b2f21,_0xdd7c15){if(_0x8b2f21[_0x3e95('0x36')]['id']){delete _0x8b2f21[_0x3e95('0x36')]['id'];}return db[_0x3e95('0x2a')][_0x3e95('0x37')]({'where':{'id':_0x8b2f21[_0x3e95('0x28')]['id']}})[_0x3e95('0x21')](handleEntityNotFound(_0xdd7c15,null))[_0x3e95('0x21')](saveUpdates(_0x8b2f21[_0x3e95('0x36')],null))['then'](respondWithResult(_0xdd7c15,null))[_0x3e95('0x34')](handleError(_0xdd7c15,null));};exports['destroy']=function(_0x38820a,_0x11cbb3){return db['ChatProactiveAction'][_0x3e95('0x37')]({'where':{'id':_0x38820a[_0x3e95('0x28')]['id']}})['then'](handleEntityNotFound(_0x11cbb3,null))[_0x3e95('0x21')](removeEntity(_0x11cbb3,null))[_0x3e95('0x34')](handleError(_0x11cbb3,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 747abba..ed5b9f3 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 _0xd26e=['ChatProactiveAction','chat_proactive_actions','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./chatProactiveAction.attributes','exports','define'];(function(_0x29d743,_0x5ced25){var _0x88836f=function(_0x3c8c97){while(--_0x3c8c97){_0x29d743['push'](_0x29d743['shift']());}};_0x88836f(++_0x5ced25);}(_0xd26e,0x1ee));var _0xed26=function(_0x323116,_0x5ced14){_0x323116=_0x323116-0x0;var _0x14b3ea=_0xd26e[_0x323116];return _0x14b3ea;};'use strict';var _=require(_0xed26('0x0'));var util=require('util');var logger=require(_0xed26('0x1'))('api');var moment=require(_0xed26('0x2'));var BPromise=require(_0xed26('0x3'));var rp=require(_0xed26('0x4'));var fs=require('fs');var path=require(_0xed26('0x5'));var rimraf=require('rimraf');var config=require(_0xed26('0x6'));var attributes=require(_0xed26('0x7'));module[_0xed26('0x8')]=function(_0x11f93c,_0x24a7dc){return _0x11f93c[_0xed26('0x9')](_0xed26('0xa'),attributes,{'tableName':_0xed26('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3989=['request-promise','rimraf','./chatProactiveAction.attributes','exports','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x49ef4b,_0x1e70f4){var _0x23fda1=function(_0x18cf46){while(--_0x18cf46){_0x49ef4b['push'](_0x49ef4b['shift']());}};_0x23fda1(++_0x1e70f4);}(_0x3989,0xba));var _0x9398=function(_0x2e8dc1,_0xacba6a){_0x2e8dc1=_0x2e8dc1-0x0;var _0xea5a76=_0x3989[_0x2e8dc1];return _0xea5a76;};'use strict';var _=require(_0x9398('0x0'));var util=require(_0x9398('0x1'));var logger=require(_0x9398('0x2'))(_0x9398('0x3'));var moment=require(_0x9398('0x4'));var BPromise=require(_0x9398('0x5'));var rp=require(_0x9398('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9398('0x7'));var config=require('../../config/environment');var attributes=require(_0x9398('0x8'));module[_0x9398('0x9')]=function(_0x4808fa,_0x378015){return _0x4808fa['define'](_0x9398('0xa'),attributes,{'tableName':_0x9398('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 b561083..8a534c2 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 _0x5933=['request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','http','info','ChatProactiveAction,\x20%s,\x20%s'];(function(_0x21a3af,_0x51ae5b){var _0x47ce32=function(_0x533feb){while(--_0x533feb){_0x21a3af['push'](_0x21a3af['shift']());}};_0x47ce32(++_0x51ae5b);}(_0x5933,0x1bd));var _0x3593=function(_0x61925b,_0x434fda){_0x61925b=_0x61925b-0x0;var _0x2c11c9=_0x5933[_0x61925b];return _0x2c11c9;};'use strict';var _=require('lodash');var util=require(_0x3593('0x0'));var moment=require(_0x3593('0x1'));var BPromise=require(_0x3593('0x2'));var rs=require(_0x3593('0x3'));var fs=require('fs');var Redis=require(_0x3593('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3593('0x5'));var logger=require(_0x3593('0x6'))('rpc');var config=require(_0x3593('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3593('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x439228,_0x25d41d,_0x4e0eb3){return new BPromise(function(_0x519ce3,_0x7f6590){return client['request'](_0x439228,_0x4e0eb3)['then'](function(_0x48f3a4){logger[_0x3593('0x9')](_0x3593('0xa'),_0x25d41d,_0x3593('0xb'));logger[_0x3593('0xc')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x25d41d,_0x3593('0xb'),JSON[_0x3593('0xd')](_0x48f3a4));if(_0x48f3a4[_0x3593('0xe')]){if(_0x48f3a4[_0x3593('0xe')][_0x3593('0xf')]===0x1f4){logger[_0x3593('0xe')](_0x3593('0xa'),_0x25d41d,_0x48f3a4[_0x3593('0xe')][_0x3593('0x10')]);return _0x7f6590(_0x48f3a4[_0x3593('0xe')][_0x3593('0x10')]);}logger['error'](_0x3593('0xa'),_0x25d41d,_0x48f3a4[_0x3593('0xe')][_0x3593('0x10')]);return _0x519ce3(_0x48f3a4[_0x3593('0xe')][_0x3593('0x10')]);}else{logger[_0x3593('0x9')](_0x3593('0xa'),_0x25d41d,'request\x20sent');_0x519ce3(_0x48f3a4[_0x3593('0x11')][_0x3593('0x10')]);}})[_0x3593('0x12')](function(_0x55781a){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x25d41d,_0x55781a);_0x7f6590(_0x55781a);});});} \ No newline at end of file +var _0x7de9=['rpc','../../config/environment','jayson/promise','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x435a00,_0x330f2f){var _0x21f487=function(_0xebe9cf){while(--_0xebe9cf){_0x435a00['push'](_0x435a00['shift']());}};_0x21f487(++_0x330f2f);}(_0x7de9,0x12b));var _0x97de=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x7de9[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x97de('0x0'));var util=require('util');var moment=require(_0x97de('0x1'));var BPromise=require(_0x97de('0x2'));var rs=require(_0x97de('0x3'));var fs=require('fs');var Redis=require(_0x97de('0x4'));var db=require(_0x97de('0x5'))['db'];var utils=require(_0x97de('0x6'));var logger=require('../../config/logger')(_0x97de('0x7'));var config=require(_0x97de('0x8'));var jayson=require(_0x97de('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x29b469,_0x4f5dfd,_0x1f2146){return new BPromise(function(_0x3344e6,_0x1b9830){return client['request'](_0x29b469,_0x1f2146)['then'](function(_0x35fde8){logger[_0x97de('0xa')](_0x97de('0xb'),_0x4f5dfd,_0x97de('0xc'));logger['debug'](_0x97de('0xd'),_0x4f5dfd,_0x97de('0xc'),JSON['stringify'](_0x35fde8));if(_0x35fde8[_0x97de('0xe')]){if(_0x35fde8[_0x97de('0xe')]['code']===0x1f4){logger[_0x97de('0xe')](_0x97de('0xb'),_0x4f5dfd,_0x35fde8[_0x97de('0xe')]['message']);return _0x1b9830(_0x35fde8['error']['message']);}logger[_0x97de('0xe')](_0x97de('0xb'),_0x4f5dfd,_0x35fde8[_0x97de('0xe')][_0x97de('0xf')]);return _0x3344e6(_0x35fde8[_0x97de('0xe')][_0x97de('0xf')]);}else{logger[_0x97de('0xa')](_0x97de('0xb'),_0x4f5dfd,'request\x20sent');_0x3344e6(_0x35fde8[_0x97de('0x10')][_0x97de('0xf')]);}})[_0x97de('0x11')](function(_0x41c277){logger[_0x97de('0xe')](_0x97de('0xb'),_0x4f5dfd,_0x41c277);_0x1b9830(_0x41c277);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 3187cae..4c47704 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 _0x71ab=['get','/:id','isAuthenticated','show','post','create','put','update','delete','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x71ab,0x64));var _0xb71a=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x71ab[_0x21a9d9];return _0x46adce;};'use strict';var multer=require('multer');var util=require(_0xb71a('0x0'));var path=require('path');var timeout=require(_0xb71a('0x1'));var express=require('express');var router=express[_0xb71a('0x2')]();var fs_extra=require(_0xb71a('0x3'));var auth=require(_0xb71a('0x4'));var interaction=require(_0xb71a('0x5'));var config=require(_0xb71a('0x6'));var controller=require(_0xb71a('0x7'));router[_0xb71a('0x8')](_0xb71a('0x9'),auth[_0xb71a('0xa')](),controller[_0xb71a('0xb')]);router[_0xb71a('0xc')]('/',auth[_0xb71a('0xa')](),controller[_0xb71a('0xd')]);router[_0xb71a('0xe')](_0xb71a('0x9'),auth[_0xb71a('0xa')](),controller[_0xb71a('0xf')]);router[_0xb71a('0x10')]('/:id',auth[_0xb71a('0xa')](),controller['destroy']);module[_0xb71a('0x11')]=router; \ No newline at end of file +var _0xe14b=['/:id','isAuthenticated','show','post','update','delete','exports','multer','util','express','Router','../../components/auth/service','./chatProactiveAction.controller','get'];(function(_0x2405bc,_0x2f28a1){var _0x5272d4=function(_0x225294){while(--_0x225294){_0x2405bc['push'](_0x2405bc['shift']());}};_0x5272d4(++_0x2f28a1);}(_0xe14b,0x93));var _0xbe14=function(_0x2a5710,_0x392f2a){_0x2a5710=_0x2a5710-0x0;var _0x158364=_0xe14b[_0x2a5710];return _0x158364;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')](_0xbe14('0x7'),auth[_0xbe14('0x8')](),controller[_0xbe14('0x9')]);router[_0xbe14('0xa')]('/',auth[_0xbe14('0x8')](),controller['create']);router['put']('/:id',auth[_0xbe14('0x8')](),controller[_0xbe14('0xb')]);router[_0xbe14('0xc')](_0xbe14('0x7'),auth['isAuthenticated'](),controller['destroy']);module[_0xbe14('0xd')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 7d82031..9855131 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 _0xa3c6=['INTEGER','ENUM','rrmemory','beepall','sequelize','exports','STRING','name'];(function(_0x2ad52e,_0x954699){var _0x3fa370=function(_0x34366d){while(--_0x34366d){_0x2ad52e['push'](_0x2ad52e['shift']());}};_0x3fa370(++_0x954699);}(_0xa3c6,0xac));var _0x6a3c=function(_0x5ccf30,_0x2a3e67){_0x5ccf30=_0x5ccf30-0x0;var _0x1d3f0c=_0xa3c6[_0x5ccf30];return _0x1d3f0c;};'use strict';var Sequelize=require(_0x6a3c('0x0'));module[_0x6a3c('0x1')]={'name':{'type':Sequelize[_0x6a3c('0x2')],'unique':_0x6a3c('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6a3c('0x2')]},'timeout':{'type':Sequelize[_0x6a3c('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6a3c('0x5')](_0x6a3c('0x6'),_0x6a3c('0x7'),'roundrobin')}}; \ No newline at end of file +var _0x1069=['STRING','name','INTEGER','roundrobin','sequelize','exports'];(function(_0x352e09,_0x37a7da){var _0x1b7094=function(_0x561074){while(--_0x561074){_0x352e09['push'](_0x352e09['shift']());}};_0x1b7094(++_0x37a7da);}(_0x1069,0xf4));var _0x9106=function(_0x98036f,_0x48effb){_0x98036f=_0x98036f-0x0;var _0x36ca65=_0x1069[_0x98036f];return _0x36ca65;};'use strict';var Sequelize=require(_0x9106('0x0'));module[_0x9106('0x1')]={'name':{'type':Sequelize[_0x9106('0x2')],'unique':_0x9106('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x9106('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory','beepall',_0x9106('0x5'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 4822ea6..272eb20 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 _0x6fd2=['agent','chatPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','nolimit','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','each','findOrCreate','forEach','userChatQueue:save','removeTeams','select','tq.TeamId','team_has_chat_queues','join','user_has_teams','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','TeamId','includes','all','union','value','transaction','isEmpty','emit','userChatQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatQueue.socket','client','http','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','get','ChatQueues','UserProfileResource','stack','name','send','map','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','hasOwnProperty','order','sort','where','pick','type','filter','merge','options','ChatQueue','show','params','fields','length','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','ChatQueueId','findAll','findAndCountAll','UserId'];(function(_0x5d754c,_0xb9851){var _0x13f592=function(_0x1f09f3){while(--_0x1f09f3){_0x5d754c['push'](_0x5d754c['shift']());}};_0x13f592(++_0xb9851);}(_0x6fd2,0xca));var _0x26fd=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x6fd2[_0x55f8b4];return _0x2475f9;};'use strict';var emlformat=require(_0x26fd('0x0'));var rimraf=require(_0x26fd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x26fd('0x2'));var rp=require('request-promise');var moment=require(_0x26fd('0x3'));var BPromise=require(_0x26fd('0x4'));var Mustache=require('mustache');var util=require(_0x26fd('0x5'));var path=require(_0x26fd('0x6'));var sox=require('sox');var csv=require(_0x26fd('0x7'));var ejs=require(_0x26fd('0x8'));var fs=require('fs');var fs_extra=require(_0x26fd('0x9'));var _=require('lodash');var squel=require(_0x26fd('0xa'));var crypto=require('crypto');var jsforce=require(_0x26fd('0xb'));var deskjs=require(_0x26fd('0xc'));var toCsv=require('to-csv');var querystring=require(_0x26fd('0xd'));var Papa=require(_0x26fd('0xe'));var Redis=require(_0x26fd('0xf'));var authService=require(_0x26fd('0x10'));var qs=require(_0x26fd('0x11'));var as=require(_0x26fd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x26fd('0x13'))('api');var utils=require(_0x26fd('0x14'));var config=require(_0x26fd('0x15'));var licenseUtil=require(_0x26fd('0x16'));var db=require(_0x26fd('0x17'))['db'];config['redis']=_['defaults'](config[_0x26fd('0x18')],{'host':_0x26fd('0x19'),'port':0x18eb});var socket=require(_0x26fd('0x1a'))(new Redis(config['redis']));require(_0x26fd('0x1b'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x26fd('0x1c')][_0x26fd('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x1d88aa,_0xf86161,_0x36a4fa,_0x5b7d57){return new BPromise(function(_0x56a939,_0x31608b){var _0x70ad0d=_0x5b7d57||client;return _0x70ad0d[_0x26fd('0x1e')](_0x1d88aa,_0x36a4fa)[_0x26fd('0x1f')](function(_0x216a3b){logger['info'](_0x26fd('0x20'),_0xf86161,_0x26fd('0x21'));logger[_0x26fd('0x22')](_0x26fd('0x23'),_0xf86161,_0x26fd('0x21'),JSON['stringify'](_0x216a3b));if(_0x216a3b[_0x26fd('0x24')]){if(_0x216a3b[_0x26fd('0x24')][_0x26fd('0x25')]===0x1f4){logger[_0x26fd('0x24')](_0x26fd('0x20'),_0xf86161,_0x216a3b[_0x26fd('0x24')]['message']);return _0x31608b(_0x216a3b['error'][_0x26fd('0x26')]);}logger[_0x26fd('0x24')]('ChatQueue,\x20%s,\x20%s',_0xf86161,_0x216a3b['error']['message']);return _0x56a939(_0x216a3b[_0x26fd('0x24')][_0x26fd('0x26')]);}else{logger[_0x26fd('0x27')](_0x26fd('0x20'),_0xf86161,_0x26fd('0x21'));_0x56a939(_0x216a3b['result'][_0x26fd('0x26')]);}})[_0x26fd('0x28')](function(_0x399131){logger[_0x26fd('0x24')](_0x26fd('0x20'),_0xf86161,_0x399131);_0x31608b(_0x399131);});});}function respondWithStatusCode(_0x22c9a2,_0x4d06f2){_0x4d06f2=_0x4d06f2||0xcc;return function(_0x358d19){if(_0x358d19){return _0x22c9a2[_0x26fd('0x29')](_0x4d06f2);}return _0x22c9a2[_0x26fd('0x2a')](_0x4d06f2)[_0x26fd('0x2b')]();};}function respondWithResult(_0xac3869,_0x28402b){_0x28402b=_0x28402b||0xc8;return function(_0x15a518){if(_0x15a518){return _0xac3869[_0x26fd('0x2a')](_0x28402b)[_0x26fd('0x2c')](_0x15a518);}};}function respondWithFilteredResult(_0x1161d8,_0x2006c7){return function(_0x509032){if(_0x509032){var _0x11cecb=typeof _0x2006c7[_0x26fd('0x2d')]===_0x26fd('0x2e')&&typeof _0x2006c7['limit']===_0x26fd('0x2e');var _0x2ee636=_0x509032[_0x26fd('0x2f')];var _0x411e21=_0x11cecb?0x0:_0x2006c7[_0x26fd('0x2d')];var _0x49a823=_0x11cecb?_0x509032[_0x26fd('0x2f')]:_0x2006c7[_0x26fd('0x2d')]+_0x2006c7[_0x26fd('0x30')];var _0x1df376;if(_0x49a823>=_0x2ee636){_0x49a823=_0x2ee636;_0x1df376=0xc8;}else{_0x1df376=0xce;}_0x1161d8['status'](_0x1df376);return _0x1161d8[_0x26fd('0x31')](_0x26fd('0x32'),_0x411e21+'-'+_0x49a823+'/'+_0x2ee636)[_0x26fd('0x2c')](_0x509032);}return null;};}function patchUpdates(_0x1ac104){return function(_0x158a00){try{jsonpatch[_0x26fd('0x33')](_0x158a00,_0x1ac104,!![]);}catch(_0x2b5f81){return BPromise[_0x26fd('0x34')](_0x2b5f81);}return _0x158a00[_0x26fd('0x35')]();};}function saveUpdates(_0x4c90bb,_0x333119){return function(_0x308ca0){if(_0x308ca0){return _0x308ca0[_0x26fd('0x36')](_0x4c90bb)['then'](function(_0x5e32e0){return _0x5e32e0;});}return null;};}function removeEntity(_0x122dd3,_0x4004a6){return function(_0x42f545){if(_0x42f545){return _0x42f545[_0x26fd('0x37')]()[_0x26fd('0x1f')](function(){var _0x338360=_0x42f545[_0x26fd('0x38')]({'plain':!![]});var _0x986840=_0x26fd('0x39');return db[_0x26fd('0x3a')][_0x26fd('0x37')]({'where':{'type':_0x986840,'resourceId':_0x338360['id']}})['then'](function(){return _0x42f545;});})['then'](function(){_0x122dd3[_0x26fd('0x2a')](0xcc)[_0x26fd('0x2b')]();});}};}function handleEntityNotFound(_0x1e9ca7,_0x57499e){return function(_0x35b68c){if(!_0x35b68c){_0x1e9ca7[_0x26fd('0x29')](0x194);}return _0x35b68c;};}function handleError(_0x2d8b0d,_0x5dde92){_0x5dde92=_0x5dde92||0x1f4;return function(_0x5ef644){logger[_0x26fd('0x24')](_0x5ef644[_0x26fd('0x3b')]);if(_0x5ef644[_0x26fd('0x3c')]){delete _0x5ef644[_0x26fd('0x3c')];}_0x2d8b0d['status'](_0x5dde92)[_0x26fd('0x3d')](_0x5ef644);};}exports['index']=function(_0xee5b10,_0x5298d9){var _0x502519={},_0x1647e0={},_0x5d14d9={'count':0x0,'rows':[]};var _0xf083ff=_[_0x26fd('0x3e')](db['ChatQueue'][_0x26fd('0x3f')],function(_0x3ee1de){return{'name':_0x3ee1de[_0x26fd('0x40')],'type':_0x3ee1de['type'][_0x26fd('0x41')]};});_0x1647e0['model']=_[_0x26fd('0x3e')](_0xf083ff,'name');_0x1647e0[_0x26fd('0x42')]=_[_0x26fd('0x43')](_0xee5b10['query']);_0x1647e0[_0x26fd('0x44')]=_[_0x26fd('0x45')](_0x1647e0[_0x26fd('0x46')],_0x1647e0[_0x26fd('0x42')]);_0x502519[_0x26fd('0x47')]=_['intersection'](_0x1647e0['model'],qs['fields'](_0xee5b10['query']['fields']));_0x502519[_0x26fd('0x47')]=_0x502519[_0x26fd('0x47')]['length']?_0x502519[_0x26fd('0x47')]:_0x1647e0[_0x26fd('0x46')];if(!_0xee5b10[_0x26fd('0x42')][_0x26fd('0x48')]('nolimit')){_0x502519[_0x26fd('0x30')]=qs['limit'](_0xee5b10['query'][_0x26fd('0x30')]);_0x502519[_0x26fd('0x2d')]=qs[_0x26fd('0x2d')](_0xee5b10['query'][_0x26fd('0x2d')]);}_0x502519[_0x26fd('0x49')]=qs[_0x26fd('0x4a')](_0xee5b10[_0x26fd('0x42')][_0x26fd('0x4a')]);_0x502519[_0x26fd('0x4b')]=qs[_0x26fd('0x44')](_[_0x26fd('0x4c')](_0xee5b10['query'],_0x1647e0['filters']),_0xf083ff);if(_0xee5b10[_0x26fd('0x42')]['filter']){_0x502519[_0x26fd('0x4b')]=_['merge'](_0x502519[_0x26fd('0x4b')],{'$or':_[_0x26fd('0x3e')](_0xf083ff,function(_0x1a0a70){if(_0x1a0a70[_0x26fd('0x4d')]!=='VIRTUAL'){var _0x80508c={};_0x80508c[_0x1a0a70[_0x26fd('0x3c')]]={'$like':'%'+_0xee5b10['query'][_0x26fd('0x4e')]+'%'};return _0x80508c;}})});}_0x502519=_[_0x26fd('0x4f')]({},_0x502519,_0xee5b10[_0x26fd('0x50')]);var _0x239e5d={'where':_0x502519[_0x26fd('0x4b')]};return db[_0x26fd('0x51')]['count'](_0x239e5d)[_0x26fd('0x1f')](function(_0x5c0d76){_0x5d14d9[_0x26fd('0x2f')]=_0x5c0d76;if(_0xee5b10[_0x26fd('0x42')]['includeAll']){_0x502519['include']=[{'all':!![]}];}return db[_0x26fd('0x51')]['findAll'](_0x502519);})[_0x26fd('0x1f')](function(_0x380dd1){_0x5d14d9['rows']=_0x380dd1;return _0x5d14d9;})[_0x26fd('0x1f')](respondWithFilteredResult(_0x5298d9,_0x502519))['catch'](handleError(_0x5298d9,null));};exports[_0x26fd('0x52')]=function(_0x16029a,_0x10fcd0){var _0xa68b08={'raw':!![],'where':{'id':_0x16029a[_0x26fd('0x53')]['id']}},_0x6e324b={};_0x6e324b['model']=_[_0x26fd('0x43')](db[_0x26fd('0x51')][_0x26fd('0x3f')]);_0x6e324b[_0x26fd('0x42')]=_[_0x26fd('0x43')](_0x16029a['query']);_0x6e324b[_0x26fd('0x44')]=_[_0x26fd('0x45')](_0x6e324b[_0x26fd('0x46')],_0x6e324b[_0x26fd('0x42')]);_0xa68b08[_0x26fd('0x47')]=_[_0x26fd('0x45')](_0x6e324b[_0x26fd('0x46')],qs[_0x26fd('0x54')](_0x16029a['query'][_0x26fd('0x54')]));_0xa68b08[_0x26fd('0x47')]=_0xa68b08[_0x26fd('0x47')][_0x26fd('0x55')]?_0xa68b08[_0x26fd('0x47')]:_0x6e324b['model'];if(_0x16029a[_0x26fd('0x42')]['includeAll']){_0xa68b08[_0x26fd('0x56')]=[{'all':!![]}];}_0xa68b08=_[_0x26fd('0x4f')]({},_0xa68b08,_0x16029a['options']);return db[_0x26fd('0x51')][_0x26fd('0x57')](_0xa68b08)[_0x26fd('0x1f')](handleEntityNotFound(_0x10fcd0,null))[_0x26fd('0x1f')](respondWithResult(_0x10fcd0,null))[_0x26fd('0x28')](handleError(_0x10fcd0,null));};exports[_0x26fd('0x58')]=function(_0x5c10a3,_0x3515bf){return db[_0x26fd('0x51')][_0x26fd('0x58')](_0x5c10a3[_0x26fd('0x59')],{})['then'](function(_0x5a8de2){var _0x43cb53=_0x5c10a3[_0x26fd('0x5a')]['get']({'plain':!![]});if(!_0x43cb53)throw new Error(_0x26fd('0x5b'));if(_0x43cb53[_0x26fd('0x5c')]==='user'){var _0xe0a89f=_0x5a8de2[_0x26fd('0x38')]({'plain':!![]});var _0x5b854f='ChatQueues';return db[_0x26fd('0x5d')][_0x26fd('0x57')]({'where':{'name':_0x5b854f,'userProfileId':_0x43cb53['userProfileId']},'raw':!![]})['then'](function(_0x2b060d){if(_0x2b060d&&_0x2b060d[_0x26fd('0x5e')]===0x0){return db[_0x26fd('0x3a')][_0x26fd('0x58')]({'name':_0xe0a89f[_0x26fd('0x3c')],'resourceId':_0xe0a89f['id'],'type':_0x2b060d[_0x26fd('0x3c')],'sectionId':_0x2b060d['id']},{})[_0x26fd('0x1f')](function(){return _0x5a8de2;});}else{return _0x5a8de2;}})[_0x26fd('0x28')](function(_0xa1749){logger[_0x26fd('0x24')](_0x26fd('0x5f'),_0xa1749);throw _0xa1749;});}return _0x5a8de2;})[_0x26fd('0x1f')](respondWithResult(_0x3515bf,0xc9))[_0x26fd('0x28')](handleError(_0x3515bf,null));};exports[_0x26fd('0x36')]=function(_0x5d752b,_0x2a94da){if(_0x5d752b[_0x26fd('0x59')]['id']){delete _0x5d752b[_0x26fd('0x59')]['id'];}return db[_0x26fd('0x51')]['find']({'where':{'id':_0x5d752b['params']['id']}})[_0x26fd('0x1f')](handleEntityNotFound(_0x2a94da,null))['then'](saveUpdates(_0x5d752b[_0x26fd('0x59')],null))[_0x26fd('0x1f')](respondWithResult(_0x2a94da,null))['catch'](handleError(_0x2a94da,null));};exports[_0x26fd('0x37')]=function(_0x5eb5da,_0x485cf6){return db[_0x26fd('0x51')][_0x26fd('0x57')]({'where':{'id':_0x5eb5da['params']['id']}})[_0x26fd('0x1f')](handleEntityNotFound(_0x485cf6,null))[_0x26fd('0x1f')](removeEntity(_0x485cf6,null))['catch'](handleError(_0x485cf6,null));};exports[_0x26fd('0x60')]=function(_0x5ec522,_0xa0c05c){return db[_0x26fd('0x51')]['describe']()['then'](respondWithResult(_0xa0c05c,null))[_0x26fd('0x28')](handleError(_0xa0c05c,null));};exports[_0x26fd('0x61')]=function(_0x599264,_0x176698,_0x45410e){var _0x362598={'raw':!![],'where':{}},_0x5b9b85={},_0x5ed269;return db['ChatQueue'][_0x26fd('0x62')]({'where':{'id':_0x599264['params']['id']}})['then'](handleEntityNotFound(_0x176698,null))['then'](function(_0x4d0843){if(_0x4d0843){_0x5ed269=_0x4d0843[_0x26fd('0x38')]({'plain':!![]});_0x5b9b85[_0x26fd('0x46')]=_['keys'](db[_0x26fd('0x63')][_0x26fd('0x3f')]);_0x5b9b85['query']=_[_0x26fd('0x43')](_0x599264[_0x26fd('0x42')]);_0x5b9b85[_0x26fd('0x44')]=_[_0x26fd('0x45')](_0x5b9b85[_0x26fd('0x46')],_0x5b9b85['query']);_0x362598[_0x26fd('0x47')]=_[_0x26fd('0x45')](_0x5b9b85[_0x26fd('0x46')],qs['fields'](_0x599264['query'][_0x26fd('0x54')]));_0x362598[_0x26fd('0x47')]=_0x362598[_0x26fd('0x47')][_0x26fd('0x55')]?_0x362598[_0x26fd('0x47')]:_0x5b9b85['model'];if(!_0x599264[_0x26fd('0x42')]['hasOwnProperty']('nolimit')){_0x362598[_0x26fd('0x30')]=qs[_0x26fd('0x30')](_0x599264[_0x26fd('0x42')][_0x26fd('0x30')]);_0x362598[_0x26fd('0x2d')]=qs[_0x26fd('0x2d')](_0x599264[_0x26fd('0x42')][_0x26fd('0x2d')]);}_0x362598['order']=qs['sort'](_0x599264[_0x26fd('0x42')][_0x26fd('0x4a')]);_0x362598[_0x26fd('0x4b')]=qs[_0x26fd('0x44')](_[_0x26fd('0x4c')](_0x599264['query'],_0x5b9b85['filters']));_0x362598['where'][_0x26fd('0x64')]=_0x4d0843['id'];if(_0x599264[_0x26fd('0x42')][_0x26fd('0x4e')]){_0x362598[_0x26fd('0x4b')]=_['merge'](_0x362598['where'],{'$or':_[_0x26fd('0x3e')](_0x362598[_0x26fd('0x47')],function(_0x4cc5a9){var _0x8d9c0b={};_0x8d9c0b[_0x4cc5a9]={'$like':'%'+_0x599264[_0x26fd('0x42')][_0x26fd('0x4e')]+'%'};return _0x8d9c0b;})});}_0x362598=_['merge']({},_0x362598,_0x599264['options']);return db['UserChatQueue'][_0x26fd('0x65')](_0x362598);}})[_0x26fd('0x1f')](function(_0x159e29){if(_0x159e29){return db['User'][_0x26fd('0x66')]({'where':{'id':_[_0x26fd('0x3e')](_0x159e29,_0x26fd('0x67')),'role':_0x26fd('0x68')},'attributes':['id',_0x26fd('0x3c'),_0x26fd('0x69'),_0x26fd('0x6a'),_0x26fd('0x6b')]});}})[_0x26fd('0x1f')](function(_0x131557){if(_0x131557){return{'count':_0x131557[_0x26fd('0x2f')],'rows':_[_0x26fd('0x3e')](_0x131557['rows'],function(_0xbc2454){return{'membername':_0xbc2454[_0x26fd('0x3c')],'UserId':_0xbc2454['id'],'queue_name':_0x5ed269['name'],'ChatQueueId':_0x5ed269['id'],'interface':util['format'](_0x26fd('0x6c'),_0x26fd('0x6d'),_0xbc2454['name']),'penalty':0x0,'paused':_0xbc2454[_0x26fd('0x69')],'createdAt':_0xbc2454['createdAt'],'updatedAt':_0xbc2454[_0x26fd('0x6a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x26fd('0x1f')](respondWithFilteredResult(_0x176698,_0x362598))['catch'](handleError(_0x176698,null));};exports[_0x26fd('0x6e')]=function(_0x2977ce,_0x30e793,_0x17fd5e){var _0x5907db={};var _0x186e11={};var _0x29963f;var _0x2f9f03;return db[_0x26fd('0x51')][_0x26fd('0x62')]({'where':{'id':_0x2977ce[_0x26fd('0x53')]['id']}})[_0x26fd('0x1f')](handleEntityNotFound(_0x30e793,null))['then'](function(_0x223163){if(_0x223163){_0x29963f=_0x223163;_0x186e11[_0x26fd('0x46')]=_[_0x26fd('0x43')](db[_0x26fd('0x6f')][_0x26fd('0x3f')]);_0x186e11['query']=_[_0x26fd('0x43')](_0x2977ce[_0x26fd('0x42')]);_0x186e11['filters']=_[_0x26fd('0x45')](_0x186e11[_0x26fd('0x46')],_0x186e11['query']);_0x5907db[_0x26fd('0x47')]=_[_0x26fd('0x45')](_0x186e11[_0x26fd('0x46')],qs[_0x26fd('0x54')](_0x2977ce[_0x26fd('0x42')][_0x26fd('0x54')]));_0x5907db['attributes']=_0x5907db[_0x26fd('0x47')][_0x26fd('0x55')]?_0x5907db['attributes']:_0x186e11[_0x26fd('0x46')];_0x5907db[_0x26fd('0x49')]=qs[_0x26fd('0x4a')](_0x2977ce[_0x26fd('0x42')]['sort']);_0x5907db['where']=qs[_0x26fd('0x44')](_[_0x26fd('0x4c')](_0x2977ce[_0x26fd('0x42')],_0x186e11[_0x26fd('0x44')]));if(_0x2977ce[_0x26fd('0x42')][_0x26fd('0x4e')]){_0x5907db['where']=_[_0x26fd('0x4f')](_0x5907db[_0x26fd('0x4b')],{'$or':_['map'](_0x5907db[_0x26fd('0x47')],function(_0xf1d06e){var _0x391e11={};_0x391e11[_0xf1d06e]={'$like':'%'+_0x2977ce[_0x26fd('0x42')][_0x26fd('0x4e')]+'%'};return _0x391e11;})});}_0x5907db=_['merge']({},_0x5907db,_0x2977ce[_0x26fd('0x50')]);return _0x29963f['getTeams'](_0x5907db);}})[_0x26fd('0x1f')](function(_0x5399a1){if(_0x5399a1){_0x2f9f03=_0x5399a1[_0x26fd('0x55')];if(!_0x2977ce[_0x26fd('0x42')]['hasOwnProperty'](_0x26fd('0x70'))){_0x5907db[_0x26fd('0x30')]=qs[_0x26fd('0x30')](_0x2977ce[_0x26fd('0x42')][_0x26fd('0x30')]);_0x5907db[_0x26fd('0x2d')]=qs[_0x26fd('0x2d')](_0x2977ce[_0x26fd('0x42')][_0x26fd('0x2d')]);}return _0x29963f[_0x26fd('0x6e')](_0x5907db);}})[_0x26fd('0x1f')](function(_0xd70464){if(_0xd70464){return _0xd70464?{'count':_0x2f9f03,'rows':_0xd70464}:null;}})[_0x26fd('0x1f')](respondWithResult(_0x30e793,null))[_0x26fd('0x28')](handleError(_0x30e793,null));};exports[_0x26fd('0x71')]=function(_0x2ad41d,_0x2304cc,_0x1f0f72){var _0x4c07c0=_0x2ad41d[_0x26fd('0x59')][_0x26fd('0x72')];return db[_0x26fd('0x6f')][_0x26fd('0x65')]({'where':{'id':_0x4c07c0},'attributes':['id'],'include':[{'model':db[_0x26fd('0x73')],'as':_0x26fd('0x74'),'attributes':['id','name',_0x26fd('0x75'),_0x26fd('0x76'),_0x26fd('0x77')],'raw':!![]}]})[_0x26fd('0x1f')](function(_0x49baec){if(_0x49baec){var _0x43c942=_[_0x26fd('0x78')](_0x49baec,function(_0x27e955){var _0x589b2d=_0x27e955['get']({'plain':!![]});return _0x589b2d[_0x26fd('0x74')];});return db[_0x26fd('0x51')][_0x26fd('0x57')]({'where':{'id':_0x2ad41d[_0x26fd('0x53')]['id']}})[_0x26fd('0x1f')](function(_0x8208bd){return db['sequelize']['transaction'](function(_0x2c3adb){return _0x8208bd[_0x26fd('0x71')](_0x4c07c0,{'transaction':_0x2c3adb})['then'](function(){return BPromise[_0x26fd('0x79')](_0x43c942,function(_0x23275a){return db['UserChatQueue'][_0x26fd('0x7a')]({'where':{'UserId':_0x23275a['id'],'ChatQueueId':_0x2ad41d[_0x26fd('0x53')]['id']},'transaction':_0x2c3adb});});})['then'](function(){_0x43c942[_0x26fd('0x7b')](function(_0x18a728){socket['emit'](_0x26fd('0x7c'),{'UserId':_0x18a728['id'],'ChatQueueId':_0x8208bd['id']});});});});});}})['then'](respondWithStatusCode(_0x2304cc,null))[_0x26fd('0x28')](handleError(_0x2304cc,null));};exports[_0x26fd('0x7d')]=function(_0x3c556e,_0x5a21e7,_0x4d8065){return db[_0x26fd('0x6f')]['findAll']({'where':{'id':_0x3c556e[_0x26fd('0x42')][_0x26fd('0x72')]},'attributes':['id'],'include':[{'model':db[_0x26fd('0x73')],'as':_0x26fd('0x74'),'attributes':['id'],'raw':!![]}]})[_0x26fd('0x1f')](handleEntityNotFound(_0x5a21e7,null))[_0x26fd('0x1f')](function(_0x116828){var _0x199fe3=_['map'](_0x116828,'id');var _0x24f15d=[];var _0x2407ce=[];var _0x16d127=squel[_0x26fd('0x7e')]();_0x16d127['field'](_0x26fd('0x7f'))['from'](_0x26fd('0x80'),'tq')[_0x26fd('0x81')](_0x26fd('0x82'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x26fd('0x83'),_0x3c556e[_0x26fd('0x53')]['id']);for(var _0x238e86=0x0;_0x238e86<_0x116828[_0x26fd('0x55')];_0x238e86+=0x1){let _0xb007a2=_0x116828[_0x238e86];for(var _0x5904c0=0x0;_0x5904c0<_0xb007a2[_0x26fd('0x74')]['length'];_0x5904c0+=0x1){let _0x2f82bb=_0xb007a2[_0x26fd('0x74')][_0x5904c0];var _0x517dd6=_0x16d127['clone']();_0x517dd6[_0x26fd('0x4b')](_0x26fd('0x84'),_0x2f82bb['id']);_0x2407ce[_0x26fd('0x85')](db[_0x26fd('0x86')][_0x26fd('0x42')](_0x517dd6[_0x26fd('0x87')](),{'type':db[_0x26fd('0x86')][_0x26fd('0x88')][_0x26fd('0x89')]})[_0x26fd('0x1f')](function(_0x3b5700){if(_0x3b5700[_0x26fd('0x55')]===0x1){return _0x2f82bb['id'];}else{var _0x12acc9=_['every'](_[_0x26fd('0x3e')](_0x3b5700,_0x26fd('0x8a')),function(_0x441323){return _[_0x26fd('0x8b')](_0x199fe3,_0x441323);});if(_0x12acc9){return _0x2f82bb['id'];}}}));}}return BPromise[_0x26fd('0x8c')](_0x2407ce)['then'](function(_0xd41179){_0x24f15d=_(_0x24f15d)[_0x26fd('0x8d')](_0xd41179)['compact']()[_0x26fd('0x8e')]();return db[_0x26fd('0x51')][_0x26fd('0x57')]({'where':{'id':_0x3c556e[_0x26fd('0x53')]['id']}})[_0x26fd('0x1f')](function(_0x51d92e){return db[_0x26fd('0x86')][_0x26fd('0x8f')](function(_0x405973){return _0x51d92e['removeTeams'](_0x3c556e[_0x26fd('0x42')][_0x26fd('0x72')],{'transaction':_0x405973})[_0x26fd('0x1f')](function(){if(!_[_0x26fd('0x90')](_0x24f15d)){return _0x51d92e['removeAgents'](_0x24f15d,{'transaction':_0x405973});}})[_0x26fd('0x1f')](function(){_0x24f15d[_0x26fd('0x7b')](function(_0x8ad84a){socket[_0x26fd('0x91')](_0x26fd('0x92'),{'UserId':_0x8ad84a,'ChatQueueId':_0x51d92e['id']});});});});});});})['then'](respondWithStatusCode(_0x5a21e7,null))[_0x26fd('0x28')](handleError(_0x5a21e7,null));};exports['addAgents']=function(_0x1fca32,_0x2ec63d,_0xe712aa){return db[_0x26fd('0x51')]['find']({'where':{'id':_0x1fca32['params']['id']}})[_0x26fd('0x1f')](handleEntityNotFound(_0x2ec63d,null))['then'](function(_0xe8764c){if(_0xe8764c){return _0xe8764c[_0x26fd('0x93')](_0x1fca32[_0x26fd('0x59')][_0x26fd('0x72')],_[_0x26fd('0x94')](_0x1fca32[_0x26fd('0x59')],[_0x26fd('0x72'),'id'])||{})[_0x26fd('0x95')](function(_0x5f0d2f){for(var _0x5e8acb=0x0;_0x5e8acb<_0x1fca32[_0x26fd('0x59')]['ids'][_0x26fd('0x55')];_0x5e8acb+=0x1){socket[_0x26fd('0x91')](_0x26fd('0x7c'),{'UserId':Number(_0x1fca32[_0x26fd('0x59')][_0x26fd('0x72')][_0x5e8acb]),'ChatQueueId':Number(_0x1fca32[_0x26fd('0x53')]['id'])});}return _0x5f0d2f;});}})[_0x26fd('0x1f')](respondWithResult(_0x2ec63d,null))[_0x26fd('0x28')](handleError(_0x2ec63d,null));};exports[_0x26fd('0x96')]=function(_0x12482b,_0x4a7d91,_0x56a3d8){return db[_0x26fd('0x51')][_0x26fd('0x57')]({'where':{'id':_0x12482b['params']['id']}})[_0x26fd('0x1f')](handleEntityNotFound(_0x4a7d91,null))[_0x26fd('0x1f')](function(_0xd1a0e7){if(_0xd1a0e7){return _0xd1a0e7['removeAgents'](_0x12482b[_0x26fd('0x42')]['ids'])[_0x26fd('0x1f')](function(){if(_[_0x26fd('0x97')](_0x12482b[_0x26fd('0x42')]['ids'])){for(var _0x1c5c0b=0x0;_0x1c5c0b<_0x12482b['query'][_0x26fd('0x72')][_0x26fd('0x55')];_0x1c5c0b+=0x1){socket[_0x26fd('0x91')]('userChatQueue:remove',{'UserId':Number(_0x12482b[_0x26fd('0x42')][_0x26fd('0x72')][_0x1c5c0b]),'ChatQueueId':Number(_0x12482b['params']['id'])});}}else{socket[_0x26fd('0x91')]('userChatQueue:remove',{'UserId':Number(_0x12482b[_0x26fd('0x42')][_0x26fd('0x72')]),'ChatQueueId':Number(_0x12482b[_0x26fd('0x53')]['id'])});}});}})[_0x26fd('0x1f')](respondWithStatusCode(_0x4a7d91,null))[_0x26fd('0x28')](handleError(_0x4a7d91,null));};exports[_0x26fd('0x98')]=function(_0x292eba,_0x256f28,_0x1ce2ef){var _0xb079ec={};var _0x4a4ec5={};var _0x2a7567;var _0x222bc2;return db['ChatQueue'][_0x26fd('0x62')]({'where':{'id':_0x292eba['params']['id']}})[_0x26fd('0x1f')](handleEntityNotFound(_0x256f28,null))[_0x26fd('0x1f')](function(_0x5f36ae){if(_0x5f36ae){_0x2a7567=_0x5f36ae;_0x4a4ec5[_0x26fd('0x46')]=_[_0x26fd('0x43')](db['User'][_0x26fd('0x3f')]);_0x4a4ec5[_0x26fd('0x42')]=_['keys'](_0x292eba[_0x26fd('0x42')]);_0x4a4ec5[_0x26fd('0x44')]=_[_0x26fd('0x45')](_0x4a4ec5[_0x26fd('0x46')],_0x4a4ec5[_0x26fd('0x42')]);_0xb079ec[_0x26fd('0x47')]=_[_0x26fd('0x45')](_0x4a4ec5[_0x26fd('0x46')],qs[_0x26fd('0x54')](_0x292eba[_0x26fd('0x42')]['fields']));_0xb079ec['attributes']=_0xb079ec[_0x26fd('0x47')]['length']?_0xb079ec[_0x26fd('0x47')]:_0x4a4ec5['model'];_0xb079ec[_0x26fd('0x49')]=qs[_0x26fd('0x4a')](_0x292eba[_0x26fd('0x42')]['sort']);_0xb079ec[_0x26fd('0x4b')]=qs['filters'](_[_0x26fd('0x4c')](_0x292eba[_0x26fd('0x42')],_0x4a4ec5[_0x26fd('0x44')]));if(_0x292eba[_0x26fd('0x42')][_0x26fd('0x4e')]){_0xb079ec[_0x26fd('0x4b')]=_['merge'](_0xb079ec[_0x26fd('0x4b')],{'$or':_[_0x26fd('0x3e')](_0xb079ec['attributes'],function(_0x1ccddd){var _0x4d3653={};_0x4d3653[_0x1ccddd]={'$like':'%'+_0x292eba['query']['filter']+'%'};return _0x4d3653;})});}_0xb079ec=_[_0x26fd('0x4f')]({},_0xb079ec,_0x292eba['options']);return _0x2a7567[_0x26fd('0x98')](_0xb079ec);}})[_0x26fd('0x1f')](function(_0x5b5d2f){if(_0x5b5d2f){_0x222bc2=_0x5b5d2f[_0x26fd('0x55')];if(!_0x292eba[_0x26fd('0x42')][_0x26fd('0x48')](_0x26fd('0x70'))){_0xb079ec[_0x26fd('0x30')]=qs['limit'](_0x292eba['query'][_0x26fd('0x30')]);_0xb079ec[_0x26fd('0x2d')]=qs[_0x26fd('0x2d')](_0x292eba[_0x26fd('0x42')][_0x26fd('0x2d')]);}return _0x2a7567['getAgents'](_0xb079ec);}})['then'](function(_0xf4081b){if(_0xf4081b){return _0xf4081b?{'count':_0x222bc2,'rows':_0xf4081b}:null;}})[_0x26fd('0x1f')](respondWithResult(_0x256f28,null))[_0x26fd('0x28')](handleError(_0x256f28,null));}; \ No newline at end of file +var _0x5059=['jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','redis','./chatQueue.socket','register','jayson/promise','client','http','then','info','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','ChatQueue,\x20%s,\x20%s','catch','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','get','ChatQueues','UserProfileResource','destroy','name','send','index','ChatQueue','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','findAll','rows','show','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','hasOwnProperty','nolimit','ChatQueueId','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','%s/%s','getTeams','Team','options','addTeams','online','voicePause','flatMap','sequelize','transaction','UserChatQueue','forEach','emit','userChatQueue:save','removeTeams','ids','Agents','select','field','tq.TeamId','from','team_has_chat_queues','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','every','TeamId','compact','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','spread','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto'];(function(_0xb2988,_0x541f86){var _0x3c62dc=function(_0x3baac1){while(--_0x3baac1){_0xb2988['push'](_0xb2988['shift']());}};_0x3c62dc(++_0x541f86);}(_0x5059,0x11d));var _0x9505=function(_0x3a6e4b,_0x118cd9){_0x3a6e4b=_0x3a6e4b-0x0;var _0x36572d=_0x5059[_0x3a6e4b];return _0x36572d;};'use strict';var emlformat=require(_0x9505('0x0'));var rimraf=require(_0x9505('0x1'));var zipdir=require(_0x9505('0x2'));var jsonpatch=require(_0x9505('0x3'));var rp=require(_0x9505('0x4'));var moment=require(_0x9505('0x5'));var BPromise=require(_0x9505('0x6'));var Mustache=require(_0x9505('0x7'));var util=require(_0x9505('0x8'));var path=require(_0x9505('0x9'));var sox=require(_0x9505('0xa'));var csv=require(_0x9505('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9505('0xc'));var _=require('lodash');var squel=require(_0x9505('0xd'));var crypto=require(_0x9505('0xe'));var jsforce=require(_0x9505('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x9505('0xb'));var querystring=require(_0x9505('0x10'));var Papa=require(_0x9505('0x11'));var Redis=require('ioredis');var authService=require(_0x9505('0x12'));var qs=require(_0x9505('0x13'));var as=require(_0x9505('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9505('0x15'))(_0x9505('0x16'));var utils=require(_0x9505('0x17'));var config=require(_0x9505('0x18'));var licenseUtil=require(_0x9505('0x19'));var db=require(_0x9505('0x1a'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x9505('0x1b'),'port':0x18eb});var socket=require(_0x9505('0x1c'))(new Redis(config[_0x9505('0x1d')]));require(_0x9505('0x1e'))[_0x9505('0x1f')](socket);var jayson=require(_0x9505('0x20'));var client=jayson[_0x9505('0x21')][_0x9505('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x46d04e,_0x3a51a9,_0x1e69b4,_0x21c33){return new BPromise(function(_0x20da16,_0x2a97e4){var _0x5cfa83=_0x21c33||client;return _0x5cfa83['request'](_0x46d04e,_0x1e69b4)[_0x9505('0x23')](function(_0x59722c){logger[_0x9505('0x24')]('ChatQueue,\x20%s,\x20%s',_0x3a51a9,'request\x20sent');logger[_0x9505('0x25')](_0x9505('0x26'),_0x3a51a9,_0x9505('0x27'),JSON['stringify'](_0x59722c));if(_0x59722c['error']){if(_0x59722c[_0x9505('0x28')][_0x9505('0x29')]===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x3a51a9,_0x59722c[_0x9505('0x28')]['message']);return _0x2a97e4(_0x59722c[_0x9505('0x28')][_0x9505('0x2a')]);}logger[_0x9505('0x28')]('ChatQueue,\x20%s,\x20%s',_0x3a51a9,_0x59722c['error'][_0x9505('0x2a')]);return _0x20da16(_0x59722c['error']['message']);}else{logger['info'](_0x9505('0x2b'),_0x3a51a9,_0x9505('0x27'));_0x20da16(_0x59722c['result']['message']);}})[_0x9505('0x2c')](function(_0x2529bd){logger[_0x9505('0x28')]('ChatQueue,\x20%s,\x20%s',_0x3a51a9,_0x2529bd);_0x2a97e4(_0x2529bd);});});}function respondWithStatusCode(_0x5ea9bc,_0x21a191){_0x21a191=_0x21a191||0xcc;return function(_0x24d044){if(_0x24d044){return _0x5ea9bc[_0x9505('0x2d')](_0x21a191);}return _0x5ea9bc[_0x9505('0x2e')](_0x21a191)[_0x9505('0x2f')]();};}function respondWithResult(_0x53eb7b,_0x5d6d69){_0x5d6d69=_0x5d6d69||0xc8;return function(_0x1a5ed4){if(_0x1a5ed4){return _0x53eb7b[_0x9505('0x2e')](_0x5d6d69)[_0x9505('0x30')](_0x1a5ed4);}};}function respondWithFilteredResult(_0x89b6bb,_0xb3b59a){return function(_0x43694f){if(_0x43694f){var _0x176d42=typeof _0xb3b59a['offset']===_0x9505('0x31')&&typeof _0xb3b59a[_0x9505('0x32')]===_0x9505('0x31');var _0x4a6979=_0x43694f['count'];var _0x1ca3d5=_0x176d42?0x0:_0xb3b59a[_0x9505('0x33')];var _0x189e7c=_0x176d42?_0x43694f[_0x9505('0x34')]:_0xb3b59a['offset']+_0xb3b59a[_0x9505('0x32')];var _0x347be3;if(_0x189e7c>=_0x4a6979){_0x189e7c=_0x4a6979;_0x347be3=0xc8;}else{_0x347be3=0xce;}_0x89b6bb[_0x9505('0x2e')](_0x347be3);return _0x89b6bb[_0x9505('0x35')](_0x9505('0x36'),_0x1ca3d5+'-'+_0x189e7c+'/'+_0x4a6979)[_0x9505('0x30')](_0x43694f);}return null;};}function patchUpdates(_0x57f43f){return function(_0x596728){try{jsonpatch[_0x9505('0x37')](_0x596728,_0x57f43f,!![]);}catch(_0x43a120){return BPromise[_0x9505('0x38')](_0x43a120);}return _0x596728[_0x9505('0x39')]();};}function saveUpdates(_0x123cb3,_0x310ec6){return function(_0x27033b){if(_0x27033b){return _0x27033b[_0x9505('0x3a')](_0x123cb3)['then'](function(_0x4377db){return _0x4377db;});}return null;};}function removeEntity(_0x18d786,_0x51ad20){return function(_0x5414a9){if(_0x5414a9){return _0x5414a9['destroy']()['then'](function(){var _0x3aebe2=_0x5414a9[_0x9505('0x3b')]({'plain':!![]});var _0x55c873=_0x9505('0x3c');return db[_0x9505('0x3d')][_0x9505('0x3e')]({'where':{'type':_0x55c873,'resourceId':_0x3aebe2['id']}})[_0x9505('0x23')](function(){return _0x5414a9;});})[_0x9505('0x23')](function(){_0x18d786['status'](0xcc)[_0x9505('0x2f')]();});}};}function handleEntityNotFound(_0x23eb7b,_0x4ef27f){return function(_0xab52c5){if(!_0xab52c5){_0x23eb7b[_0x9505('0x2d')](0x194);}return _0xab52c5;};}function handleError(_0x5504d7,_0xadaca5){_0xadaca5=_0xadaca5||0x1f4;return function(_0x4a3767){logger[_0x9505('0x28')](_0x4a3767['stack']);if(_0x4a3767[_0x9505('0x3f')]){delete _0x4a3767[_0x9505('0x3f')];}_0x5504d7[_0x9505('0x2e')](_0xadaca5)[_0x9505('0x40')](_0x4a3767);};}exports[_0x9505('0x41')]=function(_0x49d894,_0x36f048){var _0x29a57f={},_0x255e41={},_0x4a8138={'count':0x0,'rows':[]};var _0x42c66f=_['map'](db[_0x9505('0x42')][_0x9505('0x43')],function(_0x42125b){return{'name':_0x42125b[_0x9505('0x44')],'type':_0x42125b[_0x9505('0x45')][_0x9505('0x46')]};});_0x255e41[_0x9505('0x47')]=_[_0x9505('0x48')](_0x42c66f,'name');_0x255e41[_0x9505('0x49')]=_[_0x9505('0x4a')](_0x49d894[_0x9505('0x49')]);_0x255e41[_0x9505('0x4b')]=_[_0x9505('0x4c')](_0x255e41[_0x9505('0x47')],_0x255e41[_0x9505('0x49')]);_0x29a57f['attributes']=_['intersection'](_0x255e41['model'],qs[_0x9505('0x4d')](_0x49d894[_0x9505('0x49')]['fields']));_0x29a57f[_0x9505('0x4e')]=_0x29a57f[_0x9505('0x4e')][_0x9505('0x4f')]?_0x29a57f[_0x9505('0x4e')]:_0x255e41['model'];if(!_0x49d894['query']['hasOwnProperty']('nolimit')){_0x29a57f[_0x9505('0x32')]=qs['limit'](_0x49d894[_0x9505('0x49')][_0x9505('0x32')]);_0x29a57f[_0x9505('0x33')]=qs[_0x9505('0x33')](_0x49d894[_0x9505('0x49')][_0x9505('0x33')]);}_0x29a57f[_0x9505('0x50')]=qs['sort'](_0x49d894[_0x9505('0x49')][_0x9505('0x51')]);_0x29a57f[_0x9505('0x52')]=qs['filters'](_[_0x9505('0x53')](_0x49d894['query'],_0x255e41[_0x9505('0x4b')]),_0x42c66f);if(_0x49d894[_0x9505('0x49')][_0x9505('0x54')]){_0x29a57f['where']=_[_0x9505('0x55')](_0x29a57f[_0x9505('0x52')],{'$or':_[_0x9505('0x48')](_0x42c66f,function(_0x59996b){if(_0x59996b[_0x9505('0x45')]!=='VIRTUAL'){var _0x4b3bbb={};_0x4b3bbb[_0x59996b[_0x9505('0x3f')]]={'$like':'%'+_0x49d894[_0x9505('0x49')][_0x9505('0x54')]+'%'};return _0x4b3bbb;}})});}_0x29a57f=_[_0x9505('0x55')]({},_0x29a57f,_0x49d894['options']);var _0x14454c={'where':_0x29a57f[_0x9505('0x52')]};return db[_0x9505('0x42')][_0x9505('0x34')](_0x14454c)[_0x9505('0x23')](function(_0x4c847d){_0x4a8138[_0x9505('0x34')]=_0x4c847d;if(_0x49d894[_0x9505('0x49')]['includeAll']){_0x29a57f['include']=[{'all':!![]}];}return db['ChatQueue'][_0x9505('0x56')](_0x29a57f);})['then'](function(_0x179eba){_0x4a8138[_0x9505('0x57')]=_0x179eba;return _0x4a8138;})['then'](respondWithFilteredResult(_0x36f048,_0x29a57f))[_0x9505('0x2c')](handleError(_0x36f048,null));};exports[_0x9505('0x58')]=function(_0x42ca81,_0x340718){var _0x2d7e19={'raw':!![],'where':{'id':_0x42ca81['params']['id']}},_0xb84d0a={};_0xb84d0a[_0x9505('0x47')]=_[_0x9505('0x4a')](db['ChatQueue']['rawAttributes']);_0xb84d0a[_0x9505('0x49')]=_[_0x9505('0x4a')](_0x42ca81[_0x9505('0x49')]);_0xb84d0a[_0x9505('0x4b')]=_['intersection'](_0xb84d0a[_0x9505('0x47')],_0xb84d0a[_0x9505('0x49')]);_0x2d7e19['attributes']=_[_0x9505('0x4c')](_0xb84d0a[_0x9505('0x47')],qs[_0x9505('0x4d')](_0x42ca81[_0x9505('0x49')]['fields']));_0x2d7e19['attributes']=_0x2d7e19[_0x9505('0x4e')][_0x9505('0x4f')]?_0x2d7e19[_0x9505('0x4e')]:_0xb84d0a[_0x9505('0x47')];if(_0x42ca81['query'][_0x9505('0x59')]){_0x2d7e19['include']=[{'all':!![]}];}_0x2d7e19=_[_0x9505('0x55')]({},_0x2d7e19,_0x42ca81['options']);return db[_0x9505('0x42')][_0x9505('0x5a')](_0x2d7e19)['then'](handleEntityNotFound(_0x340718,null))[_0x9505('0x23')](respondWithResult(_0x340718,null))[_0x9505('0x2c')](handleError(_0x340718,null));};exports['create']=function(_0xaf7b38,_0x167566){return db[_0x9505('0x42')][_0x9505('0x5b')](_0xaf7b38[_0x9505('0x5c')],{})['then'](function(_0xa24a27){var _0x5ad755=_0xaf7b38[_0x9505('0x5d')][_0x9505('0x3b')]({'plain':!![]});if(!_0x5ad755)throw new Error(_0x9505('0x5e'));if(_0x5ad755[_0x9505('0x5f')]===_0x9505('0x5d')){var _0x3a9684=_0xa24a27[_0x9505('0x3b')]({'plain':!![]});var _0x5b4402='ChatQueues';return db['UserProfileSection'][_0x9505('0x5a')]({'where':{'name':_0x5b4402,'userProfileId':_0x5ad755[_0x9505('0x60')]},'raw':!![]})['then'](function(_0x9e77b5){if(_0x9e77b5&&_0x9e77b5[_0x9505('0x61')]===0x0){return db[_0x9505('0x3d')]['create']({'name':_0x3a9684[_0x9505('0x3f')],'resourceId':_0x3a9684['id'],'type':_0x9e77b5[_0x9505('0x3f')],'sectionId':_0x9e77b5['id']},{})[_0x9505('0x23')](function(){return _0xa24a27;});}else{return _0xa24a27;}})[_0x9505('0x2c')](function(_0x37979a){logger[_0x9505('0x28')](_0x9505('0x62'),_0x37979a);throw _0x37979a;});}return _0xa24a27;})['then'](respondWithResult(_0x167566,0xc9))['catch'](handleError(_0x167566,null));};exports[_0x9505('0x3a')]=function(_0x1fac48,_0x566d9a){if(_0x1fac48[_0x9505('0x5c')]['id']){delete _0x1fac48[_0x9505('0x5c')]['id'];}return db[_0x9505('0x42')][_0x9505('0x5a')]({'where':{'id':_0x1fac48[_0x9505('0x63')]['id']}})[_0x9505('0x23')](handleEntityNotFound(_0x566d9a,null))[_0x9505('0x23')](saveUpdates(_0x1fac48[_0x9505('0x5c')],null))[_0x9505('0x23')](respondWithResult(_0x566d9a,null))[_0x9505('0x2c')](handleError(_0x566d9a,null));};exports['destroy']=function(_0x4abce9,_0x44ebde){return db[_0x9505('0x42')][_0x9505('0x5a')]({'where':{'id':_0x4abce9['params']['id']}})[_0x9505('0x23')](handleEntityNotFound(_0x44ebde,null))['then'](removeEntity(_0x44ebde,null))['catch'](handleError(_0x44ebde,null));};exports[_0x9505('0x64')]=function(_0x40b0bc,_0x488cf2){return db[_0x9505('0x42')][_0x9505('0x64')]()['then'](respondWithResult(_0x488cf2,null))[_0x9505('0x2c')](handleError(_0x488cf2,null));};exports[_0x9505('0x65')]=function(_0x334b81,_0x988899,_0x3322c0){var _0x42c0fd={'raw':!![],'where':{}},_0x5a4ca={},_0x146c13;return db[_0x9505('0x42')][_0x9505('0x66')]({'where':{'id':_0x334b81[_0x9505('0x63')]['id']}})['then'](handleEntityNotFound(_0x988899,null))['then'](function(_0x43492a){if(_0x43492a){_0x146c13=_0x43492a[_0x9505('0x3b')]({'plain':!![]});_0x5a4ca['model']=_[_0x9505('0x4a')](db['UserChatQueue'][_0x9505('0x43')]);_0x5a4ca[_0x9505('0x49')]=_['keys'](_0x334b81[_0x9505('0x49')]);_0x5a4ca[_0x9505('0x4b')]=_[_0x9505('0x4c')](_0x5a4ca[_0x9505('0x47')],_0x5a4ca[_0x9505('0x49')]);_0x42c0fd[_0x9505('0x4e')]=_[_0x9505('0x4c')](_0x5a4ca[_0x9505('0x47')],qs['fields'](_0x334b81[_0x9505('0x49')][_0x9505('0x4d')]));_0x42c0fd[_0x9505('0x4e')]=_0x42c0fd[_0x9505('0x4e')][_0x9505('0x4f')]?_0x42c0fd[_0x9505('0x4e')]:_0x5a4ca[_0x9505('0x47')];if(!_0x334b81[_0x9505('0x49')][_0x9505('0x67')](_0x9505('0x68'))){_0x42c0fd[_0x9505('0x32')]=qs[_0x9505('0x32')](_0x334b81[_0x9505('0x49')][_0x9505('0x32')]);_0x42c0fd[_0x9505('0x33')]=qs[_0x9505('0x33')](_0x334b81[_0x9505('0x49')][_0x9505('0x33')]);}_0x42c0fd[_0x9505('0x50')]=qs[_0x9505('0x51')](_0x334b81[_0x9505('0x49')][_0x9505('0x51')]);_0x42c0fd['where']=qs[_0x9505('0x4b')](_[_0x9505('0x53')](_0x334b81[_0x9505('0x49')],_0x5a4ca[_0x9505('0x4b')]));_0x42c0fd[_0x9505('0x52')][_0x9505('0x69')]=_0x43492a['id'];if(_0x334b81['query'][_0x9505('0x54')]){_0x42c0fd[_0x9505('0x52')]=_[_0x9505('0x55')](_0x42c0fd[_0x9505('0x52')],{'$or':_['map'](_0x42c0fd[_0x9505('0x4e')],function(_0x331f6f){var _0x3d34ee={};_0x3d34ee[_0x331f6f]={'$like':'%'+_0x334b81[_0x9505('0x49')]['filter']+'%'};return _0x3d34ee;})});}_0x42c0fd=_[_0x9505('0x55')]({},_0x42c0fd,_0x334b81['options']);return db['UserChatQueue'][_0x9505('0x56')](_0x42c0fd);}})[_0x9505('0x23')](function(_0x538701){if(_0x538701){return db[_0x9505('0x6a')][_0x9505('0x6b')]({'where':{'id':_['map'](_0x538701,_0x9505('0x6c')),'role':_0x9505('0x6d')},'attributes':['id','name',_0x9505('0x6e'),_0x9505('0x6f'),_0x9505('0x70')]});}})[_0x9505('0x23')](function(_0x493d26){if(_0x493d26){return{'count':_0x493d26[_0x9505('0x34')],'rows':_[_0x9505('0x48')](_0x493d26[_0x9505('0x57')],function(_0x3b1a36){return{'membername':_0x3b1a36['name'],'UserId':_0x3b1a36['id'],'queue_name':_0x146c13[_0x9505('0x3f')],'ChatQueueId':_0x146c13['id'],'interface':util['format'](_0x9505('0x71'),'SIP',_0x3b1a36[_0x9505('0x3f')]),'penalty':0x0,'paused':_0x3b1a36[_0x9505('0x6e')],'createdAt':_0x3b1a36['createdAt'],'updatedAt':_0x3b1a36[_0x9505('0x6f')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x988899,_0x42c0fd))['catch'](handleError(_0x988899,null));};exports[_0x9505('0x72')]=function(_0x554fab,_0x4af6c5,_0x2f8667){var _0x12f31e={};var _0x2a7428={};var _0x5d2c48;var _0x29cefd;return db['ChatQueue']['findOne']({'where':{'id':_0x554fab[_0x9505('0x63')]['id']}})[_0x9505('0x23')](handleEntityNotFound(_0x4af6c5,null))[_0x9505('0x23')](function(_0xcfb544){if(_0xcfb544){_0x5d2c48=_0xcfb544;_0x2a7428[_0x9505('0x47')]=_[_0x9505('0x4a')](db[_0x9505('0x73')][_0x9505('0x43')]);_0x2a7428[_0x9505('0x49')]=_[_0x9505('0x4a')](_0x554fab[_0x9505('0x49')]);_0x2a7428[_0x9505('0x4b')]=_[_0x9505('0x4c')](_0x2a7428['model'],_0x2a7428[_0x9505('0x49')]);_0x12f31e[_0x9505('0x4e')]=_[_0x9505('0x4c')](_0x2a7428['model'],qs[_0x9505('0x4d')](_0x554fab[_0x9505('0x49')][_0x9505('0x4d')]));_0x12f31e[_0x9505('0x4e')]=_0x12f31e['attributes'][_0x9505('0x4f')]?_0x12f31e[_0x9505('0x4e')]:_0x2a7428[_0x9505('0x47')];_0x12f31e[_0x9505('0x50')]=qs[_0x9505('0x51')](_0x554fab['query'][_0x9505('0x51')]);_0x12f31e[_0x9505('0x52')]=qs['filters'](_['pick'](_0x554fab[_0x9505('0x49')],_0x2a7428['filters']));if(_0x554fab['query'][_0x9505('0x54')]){_0x12f31e[_0x9505('0x52')]=_[_0x9505('0x55')](_0x12f31e[_0x9505('0x52')],{'$or':_[_0x9505('0x48')](_0x12f31e[_0x9505('0x4e')],function(_0x1404b2){var _0x312b27={};_0x312b27[_0x1404b2]={'$like':'%'+_0x554fab[_0x9505('0x49')]['filter']+'%'};return _0x312b27;})});}_0x12f31e=_[_0x9505('0x55')]({},_0x12f31e,_0x554fab[_0x9505('0x74')]);return _0x5d2c48[_0x9505('0x72')](_0x12f31e);}})[_0x9505('0x23')](function(_0x5edb6b){if(_0x5edb6b){_0x29cefd=_0x5edb6b[_0x9505('0x4f')];if(!_0x554fab[_0x9505('0x49')][_0x9505('0x67')](_0x9505('0x68'))){_0x12f31e['limit']=qs[_0x9505('0x32')](_0x554fab['query'][_0x9505('0x32')]);_0x12f31e['offset']=qs[_0x9505('0x33')](_0x554fab[_0x9505('0x49')][_0x9505('0x33')]);}return _0x5d2c48['getTeams'](_0x12f31e);}})['then'](function(_0x5ce18d){if(_0x5ce18d){return _0x5ce18d?{'count':_0x29cefd,'rows':_0x5ce18d}:null;}})[_0x9505('0x23')](respondWithResult(_0x4af6c5,null))[_0x9505('0x2c')](handleError(_0x4af6c5,null));};exports[_0x9505('0x75')]=function(_0x50812a,_0x2cadb0,_0x5992aa){var _0x120a7c=_0x50812a[_0x9505('0x5c')]['ids'];return db['Team'][_0x9505('0x56')]({'where':{'id':_0x120a7c},'attributes':['id'],'include':[{'model':db[_0x9505('0x6a')],'as':'Agents','attributes':['id',_0x9505('0x3f'),_0x9505('0x76'),_0x9505('0x77'),'interface'],'raw':!![]}]})['then'](function(_0x3d664a){if(_0x3d664a){var _0x2f554a=_[_0x9505('0x78')](_0x3d664a,function(_0x2d445d){var _0x1d6d8c=_0x2d445d['get']({'plain':!![]});return _0x1d6d8c['Agents'];});return db[_0x9505('0x42')][_0x9505('0x5a')]({'where':{'id':_0x50812a['params']['id']}})[_0x9505('0x23')](function(_0x152f3d){return db[_0x9505('0x79')][_0x9505('0x7a')](function(_0x2e1bcf){return _0x152f3d[_0x9505('0x75')](_0x120a7c,{'transaction':_0x2e1bcf})[_0x9505('0x23')](function(){return BPromise['each'](_0x2f554a,function(_0x2d3787){return db[_0x9505('0x7b')]['findOrCreate']({'where':{'UserId':_0x2d3787['id'],'ChatQueueId':_0x50812a[_0x9505('0x63')]['id']},'transaction':_0x2e1bcf});});})['then'](function(){_0x2f554a[_0x9505('0x7c')](function(_0x4962f4){socket[_0x9505('0x7d')](_0x9505('0x7e'),{'UserId':_0x4962f4['id'],'ChatQueueId':_0x152f3d['id']});});});});});}})['then'](respondWithStatusCode(_0x2cadb0,null))[_0x9505('0x2c')](handleError(_0x2cadb0,null));};exports[_0x9505('0x7f')]=function(_0x1bcc15,_0x2df432,_0x1e6263){return db['Team'][_0x9505('0x56')]({'where':{'id':_0x1bcc15[_0x9505('0x49')][_0x9505('0x80')]},'attributes':['id'],'include':[{'model':db[_0x9505('0x6a')],'as':_0x9505('0x81'),'attributes':['id'],'raw':!![]}]})[_0x9505('0x23')](handleEntityNotFound(_0x2df432,null))[_0x9505('0x23')](function(_0xb14e29){var _0x41a07e=_['map'](_0xb14e29,'id');var _0x3375de=[];var _0x293426=[];var _0x117b4a=squel[_0x9505('0x82')]();_0x117b4a[_0x9505('0x83')](_0x9505('0x84'))[_0x9505('0x85')](_0x9505('0x86'),'tq')['join']('user_has_teams','ut',_0x9505('0x87'))[_0x9505('0x52')](_0x9505('0x88'),_0x1bcc15[_0x9505('0x63')]['id']);for(var _0xf80019=0x0;_0xf80019<_0xb14e29[_0x9505('0x4f')];_0xf80019+=0x1){let _0x319fc9=_0xb14e29[_0xf80019];for(var _0x4ce2e9=0x0;_0x4ce2e9<_0x319fc9['Agents'][_0x9505('0x4f')];_0x4ce2e9+=0x1){let _0x40ec6b=_0x319fc9[_0x9505('0x81')][_0x4ce2e9];var _0x2145cc=_0x117b4a['clone']();_0x2145cc[_0x9505('0x52')](_0x9505('0x89'),_0x40ec6b['id']);_0x293426[_0x9505('0x8a')](db[_0x9505('0x79')][_0x9505('0x49')](_0x2145cc['toString'](),{'type':db['sequelize'][_0x9505('0x8b')]['SELECT']})['then'](function(_0x5a0209){if(_0x5a0209[_0x9505('0x4f')]===0x1){return _0x40ec6b['id'];}else{var _0x1440f2=_[_0x9505('0x8c')](_[_0x9505('0x48')](_0x5a0209,_0x9505('0x8d')),function(_0x22302f){return _['includes'](_0x41a07e,_0x22302f);});if(_0x1440f2){return _0x40ec6b['id'];}}}));}}return BPromise['all'](_0x293426)[_0x9505('0x23')](function(_0x5bf896){_0x3375de=_(_0x3375de)['union'](_0x5bf896)[_0x9505('0x8e')]()[_0x9505('0x8f')]();return db['ChatQueue'][_0x9505('0x5a')]({'where':{'id':_0x1bcc15['params']['id']}})[_0x9505('0x23')](function(_0x43780f){return db['sequelize'][_0x9505('0x7a')](function(_0x5833c5){return _0x43780f[_0x9505('0x7f')](_0x1bcc15['query'][_0x9505('0x80')],{'transaction':_0x5833c5})[_0x9505('0x23')](function(){if(!_[_0x9505('0x90')](_0x3375de)){return _0x43780f[_0x9505('0x91')](_0x3375de,{'transaction':_0x5833c5});}})[_0x9505('0x23')](function(){_0x3375de[_0x9505('0x7c')](function(_0x3bca98){socket['emit'](_0x9505('0x92'),{'UserId':_0x3bca98,'ChatQueueId':_0x43780f['id']});});});});});});})['then'](respondWithStatusCode(_0x2df432,null))[_0x9505('0x2c')](handleError(_0x2df432,null));};exports[_0x9505('0x93')]=function(_0xc6e974,_0x17e429,_0x26157c){return db['ChatQueue']['find']({'where':{'id':_0xc6e974[_0x9505('0x63')]['id']}})[_0x9505('0x23')](handleEntityNotFound(_0x17e429,null))[_0x9505('0x23')](function(_0x490b40){if(_0x490b40){return _0x490b40[_0x9505('0x93')](_0xc6e974[_0x9505('0x5c')][_0x9505('0x80')],_['omit'](_0xc6e974[_0x9505('0x5c')],[_0x9505('0x80'),'id'])||{})[_0x9505('0x94')](function(_0x1b036b){for(var _0x14da92=0x0;_0x14da92<_0xc6e974[_0x9505('0x5c')][_0x9505('0x80')][_0x9505('0x4f')];_0x14da92+=0x1){socket['emit']('userChatQueue:save',{'UserId':Number(_0xc6e974[_0x9505('0x5c')]['ids'][_0x14da92]),'ChatQueueId':Number(_0xc6e974[_0x9505('0x63')]['id'])});}return _0x1b036b;});}})[_0x9505('0x23')](respondWithResult(_0x17e429,null))[_0x9505('0x2c')](handleError(_0x17e429,null));};exports[_0x9505('0x91')]=function(_0x1c6a86,_0x497924,_0x439723){return db[_0x9505('0x42')][_0x9505('0x5a')]({'where':{'id':_0x1c6a86[_0x9505('0x63')]['id']}})[_0x9505('0x23')](handleEntityNotFound(_0x497924,null))[_0x9505('0x23')](function(_0x446e2a){if(_0x446e2a){return _0x446e2a[_0x9505('0x91')](_0x1c6a86[_0x9505('0x49')][_0x9505('0x80')])[_0x9505('0x23')](function(){if(_['isArray'](_0x1c6a86[_0x9505('0x49')]['ids'])){for(var _0x45f912=0x0;_0x45f912<_0x1c6a86['query']['ids'][_0x9505('0x4f')];_0x45f912+=0x1){socket[_0x9505('0x7d')]('userChatQueue:remove',{'UserId':Number(_0x1c6a86[_0x9505('0x49')][_0x9505('0x80')][_0x45f912]),'ChatQueueId':Number(_0x1c6a86[_0x9505('0x63')]['id'])});}}else{socket['emit'](_0x9505('0x92'),{'UserId':Number(_0x1c6a86[_0x9505('0x49')][_0x9505('0x80')]),'ChatQueueId':Number(_0x1c6a86[_0x9505('0x63')]['id'])});}});}})[_0x9505('0x23')](respondWithStatusCode(_0x497924,null))['catch'](handleError(_0x497924,null));};exports[_0x9505('0x95')]=function(_0x3082be,_0x9f5530,_0x5eb560){var _0x1f0bfe={};var _0x25d2a4={};var _0x166894;var _0x532601;return db['ChatQueue'][_0x9505('0x66')]({'where':{'id':_0x3082be[_0x9505('0x63')]['id']}})[_0x9505('0x23')](handleEntityNotFound(_0x9f5530,null))[_0x9505('0x23')](function(_0x4cfdee){if(_0x4cfdee){_0x166894=_0x4cfdee;_0x25d2a4[_0x9505('0x47')]=_[_0x9505('0x4a')](db[_0x9505('0x6a')][_0x9505('0x43')]);_0x25d2a4[_0x9505('0x49')]=_['keys'](_0x3082be['query']);_0x25d2a4[_0x9505('0x4b')]=_['intersection'](_0x25d2a4['model'],_0x25d2a4[_0x9505('0x49')]);_0x1f0bfe[_0x9505('0x4e')]=_[_0x9505('0x4c')](_0x25d2a4[_0x9505('0x47')],qs[_0x9505('0x4d')](_0x3082be['query'][_0x9505('0x4d')]));_0x1f0bfe[_0x9505('0x4e')]=_0x1f0bfe['attributes'][_0x9505('0x4f')]?_0x1f0bfe[_0x9505('0x4e')]:_0x25d2a4[_0x9505('0x47')];_0x1f0bfe['order']=qs[_0x9505('0x51')](_0x3082be[_0x9505('0x49')]['sort']);_0x1f0bfe[_0x9505('0x52')]=qs[_0x9505('0x4b')](_[_0x9505('0x53')](_0x3082be['query'],_0x25d2a4['filters']));if(_0x3082be[_0x9505('0x49')]['filter']){_0x1f0bfe[_0x9505('0x52')]=_[_0x9505('0x55')](_0x1f0bfe[_0x9505('0x52')],{'$or':_[_0x9505('0x48')](_0x1f0bfe['attributes'],function(_0x5e597b){var _0x5db11d={};_0x5db11d[_0x5e597b]={'$like':'%'+_0x3082be[_0x9505('0x49')][_0x9505('0x54')]+'%'};return _0x5db11d;})});}_0x1f0bfe=_['merge']({},_0x1f0bfe,_0x3082be[_0x9505('0x74')]);return _0x166894[_0x9505('0x95')](_0x1f0bfe);}})[_0x9505('0x23')](function(_0x36c87d){if(_0x36c87d){_0x532601=_0x36c87d[_0x9505('0x4f')];if(!_0x3082be[_0x9505('0x49')]['hasOwnProperty'](_0x9505('0x68'))){_0x1f0bfe[_0x9505('0x32')]=qs['limit'](_0x3082be[_0x9505('0x49')][_0x9505('0x32')]);_0x1f0bfe[_0x9505('0x33')]=qs['offset'](_0x3082be[_0x9505('0x49')][_0x9505('0x33')]);}return _0x166894[_0x9505('0x95')](_0x1f0bfe);}})['then'](function(_0x470559){if(_0x470559){return _0x470559?{'count':_0x532601,'rows':_0x470559}:null;}})[_0x9505('0x23')](respondWithResult(_0x9f5530,null))['catch'](handleError(_0x9f5530,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 74d4622..e4f4e0d 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 _0x0bf4=['events','ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x0bf4,0x180));var _0x40bf=function(_0x591e16,_0x5aefc1){_0x591e16=_0x591e16-0x0;var _0x543b35=_0x0bf4[_0x591e16];return _0x543b35;};'use strict';var EventEmitter=require(_0x40bf('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x40bf('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x40bf('0x2')](0x0);var events={'afterCreate':_0x40bf('0x3'),'afterUpdate':_0x40bf('0x4'),'afterDestroy':_0x40bf('0x5')};function emitEvent(_0x30cf79){return function(_0x2cc566,_0x5dfa9a,_0x3794e5){ChatQueueEvents[_0x40bf('0x6')](_0x30cf79+':'+_0x2cc566['id'],_0x2cc566);ChatQueueEvents['emit'](_0x30cf79,_0x2cc566);_0x3794e5(null);};}for(var e in events){if(events[_0x40bf('0x7')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file +var _0x6c6d=['hasOwnProperty','events','../../mysqldb','ChatQueue','setMaxListeners','save','update','emit'];(function(_0x318410,_0x451962){var _0x2898a3=function(_0x58e572){while(--_0x58e572){_0x318410['push'](_0x318410['shift']());}};_0x2898a3(++_0x451962);}(_0x6c6d,0x1d1));var _0xd6c6=function(_0x413da9,_0x3fe884){_0x413da9=_0x413da9-0x0;var _0x5b19b8=_0x6c6d[_0x413da9];return _0x5b19b8;};'use strict';var EventEmitter=require(_0xd6c6('0x0'));var ChatQueue=require(_0xd6c6('0x1'))['db'][_0xd6c6('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xd6c6('0x3')](0x0);var events={'afterCreate':_0xd6c6('0x4'),'afterUpdate':_0xd6c6('0x5'),'afterDestroy':'remove'};function emitEvent(_0x278ac4){return function(_0x46261c,_0x5d58d4,_0x2b9f88){ChatQueueEvents[_0xd6c6('0x6')](_0x278ac4+':'+_0x46261c['id'],_0x46261c);ChatQueueEvents[_0xd6c6('0x6')](_0x278ac4,_0x46261c);_0x2b9f88(null);};}for(var e in events){if(events[_0xd6c6('0x7')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index eb5f8f5..3adc919 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 _0x593d=['../../config/environment','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0xeb99f7,_0x228d71){var _0x55d7ff=function(_0x42521b){while(--_0x42521b){_0xeb99f7['push'](_0xeb99f7['shift']());}};_0x55d7ff(++_0x228d71);}(_0x593d,0x1f3));var _0xd593=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x593d[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0xd593('0x0'));var util=require(_0xd593('0x1'));var logger=require(_0xd593('0x2'))(_0xd593('0x3'));var moment=require(_0xd593('0x4'));var BPromise=require(_0xd593('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd593('0x6'));var rimraf=require(_0xd593('0x7'));var config=require(_0xd593('0x8'));var attributes=require('./chatQueue.attributes');module[_0xd593('0x9')]=function(_0x11efb9,_0xff310d){return _0x11efb9[_0xd593('0xa')](_0xd593('0xb'),attributes,{'tableName':_0xd593('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5681=['chat_queues','lodash','../../config/logger','bluebird','path','rimraf','exports','define','ChatQueue'];(function(_0x431e83,_0x2472b2){var _0x42b586=function(_0x19f12e){while(--_0x19f12e){_0x431e83['push'](_0x431e83['shift']());}};_0x42b586(++_0x2472b2);}(_0x5681,0xa3));var _0x1568=function(_0x2666c5,_0x280c51){_0x2666c5=_0x2666c5-0x0;var _0x1a680f=_0x5681[_0x2666c5];return _0x1a680f;};'use strict';var _=require(_0x1568('0x0'));var util=require('util');var logger=require(_0x1568('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1568('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1568('0x3'));var rimraf=require(_0x1568('0x4'));var config=require('../../config/environment');var attributes=require('./chatQueue.attributes');module[_0x1568('0x5')]=function(_0x510bb4,_0xc1a9e6){return _0x510bb4[_0x1568('0x6')](_0x1568('0x7'),attributes,{'tableName':_0x1568('0x8'),'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 529f424..b0321b2 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 _0xa866=['then','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','info','result','ChatQueue','findAll','options','where','attributes','limit','include','map','model','GetChatQueue','ShowChatQueue','find','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register'];(function(_0x273884,_0x1b48ad){var _0x141e60=function(_0x14b549){while(--_0x14b549){_0x273884['push'](_0x273884['shift']());}};_0x141e60(++_0x1b48ad);}(_0xa866,0x6a));var _0x6a86=function(_0x4a6d32,_0x50537d){_0x4a6d32=_0x4a6d32-0x0;var _0x194106=_0xa866[_0x4a6d32];return _0x194106;};'use strict';var _=require(_0x6a86('0x0'));var util=require(_0x6a86('0x1'));var moment=require(_0x6a86('0x2'));var BPromise=require(_0x6a86('0x3'));var rs=require(_0x6a86('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6a86('0x5'))['db'];var utils=require(_0x6a86('0x6'));var logger=require(_0x6a86('0x7'))('rpc');var config=require(_0x6a86('0x8'));var jayson=require(_0x6a86('0x9'));var client=jayson[_0x6a86('0xa')]['http']({'port':0x232a});config[_0x6a86('0xb')]=_[_0x6a86('0xc')](config[_0x6a86('0xb')],{'host':_0x6a86('0xd'),'port':0x18eb});var socket=require(_0x6a86('0xe'))(new Redis(config[_0x6a86('0xb')]));require(_0x6a86('0xf'))[_0x6a86('0x10')](socket);function respondWithRpcPromise(_0x21712d,_0x5355b7,_0x3435a8){return new BPromise(function(_0x1a4548,_0x100925){return client['request'](_0x21712d,_0x3435a8)[_0x6a86('0x11')](function(_0x1797e8){logger['info']('ChatQueue,\x20%s,\x20%s',_0x5355b7,_0x6a86('0x12'));logger[_0x6a86('0x13')](_0x6a86('0x14'),_0x5355b7,_0x6a86('0x12'),JSON[_0x6a86('0x15')](_0x1797e8));if(_0x1797e8[_0x6a86('0x16')]){if(_0x1797e8[_0x6a86('0x16')][_0x6a86('0x17')]===0x1f4){logger['error'](_0x6a86('0x18'),_0x5355b7,_0x1797e8[_0x6a86('0x16')]['message']);return _0x100925(_0x1797e8[_0x6a86('0x16')][_0x6a86('0x19')]);}logger[_0x6a86('0x16')](_0x6a86('0x18'),_0x5355b7,_0x1797e8[_0x6a86('0x16')][_0x6a86('0x19')]);return _0x1a4548(_0x1797e8['error'][_0x6a86('0x19')]);}else{logger[_0x6a86('0x1a')]('ChatQueue,\x20%s,\x20%s',_0x5355b7,'request\x20sent');_0x1a4548(_0x1797e8[_0x6a86('0x1b')]['message']);}})['catch'](function(_0x1fe0b5){logger[_0x6a86('0x16')](_0x6a86('0x18'),_0x5355b7,_0x1fe0b5);_0x100925(_0x1fe0b5);});});}exports['GetChatQueue']=function(_0x2bbcc8){var _0x22a573=this;return new Promise(function(_0x1db4ad,_0x262bf5){return db[_0x6a86('0x1c')][_0x6a86('0x1d')]({'raw':_0x2bbcc8['options']?_0x2bbcc8['options']['raw']===undefined?!![]:![]:!![],'where':_0x2bbcc8[_0x6a86('0x1e')]?_0x2bbcc8[_0x6a86('0x1e')][_0x6a86('0x1f')]||null:null,'attributes':_0x2bbcc8[_0x6a86('0x1e')]?_0x2bbcc8['options'][_0x6a86('0x20')]||null:null,'limit':_0x2bbcc8[_0x6a86('0x1e')]?_0x2bbcc8[_0x6a86('0x1e')][_0x6a86('0x21')]||null:null,'include':_0x2bbcc8[_0x6a86('0x1e')]?_0x2bbcc8[_0x6a86('0x1e')][_0x6a86('0x22')]?_[_0x6a86('0x23')](_0x2bbcc8[_0x6a86('0x1e')]['include'],function(_0x5190c9){return{'model':db[_0x5190c9[_0x6a86('0x24')]],'as':_0x5190c9['as'],'attributes':_0x5190c9['attributes'],'include':_0x5190c9[_0x6a86('0x22')]?_[_0x6a86('0x23')](_0x5190c9['include'],function(_0xbfe923){return{'model':db[_0xbfe923[_0x6a86('0x24')]],'as':_0xbfe923['as'],'attributes':_0xbfe923[_0x6a86('0x20')],'include':_0xbfe923['include']?_[_0x6a86('0x23')](_0xbfe923['include'],function(_0x5a77e6){return{'model':db[_0x5a77e6['model']],'as':_0x5a77e6['as'],'attributes':_0x5a77e6[_0x6a86('0x20')]};}):[]};}):[]};}):[]:[]})[_0x6a86('0x11')](function(_0x14359b){logger['info'](_0x6a86('0x25'),_0x2bbcc8);logger[_0x6a86('0x13')](_0x6a86('0x25'),_0x2bbcc8,JSON[_0x6a86('0x15')](_0x14359b));_0x1db4ad(_0x14359b);})['catch'](function(_0x1f7853){logger['error'](_0x6a86('0x25'),_0x1f7853[_0x6a86('0x19')],_0x2bbcc8);_0x262bf5(_0x22a573[_0x6a86('0x16')](0x1f4,_0x1f7853[_0x6a86('0x19')]));});});};exports[_0x6a86('0x26')]=function(_0x5a2925){var _0x155054=this;return new Promise(function(_0x350524,_0x51b789){return db[_0x6a86('0x1c')][_0x6a86('0x27')]({'raw':_0x5a2925['options']?_0x5a2925[_0x6a86('0x1e')][_0x6a86('0x28')]===undefined?!![]:![]:!![],'where':_0x5a2925['options']?_0x5a2925['options'][_0x6a86('0x1f')]||null:null,'attributes':_0x5a2925[_0x6a86('0x1e')]?_0x5a2925['options']['attributes']||null:null,'include':_0x5a2925[_0x6a86('0x1e')]?_0x5a2925['options'][_0x6a86('0x22')]?_['map'](_0x5a2925[_0x6a86('0x1e')]['include'],function(_0x350ce7){return{'model':db[_0x350ce7['model']],'as':_0x350ce7['as'],'attributes':_0x350ce7[_0x6a86('0x20')],'include':_0x350ce7[_0x6a86('0x22')]?_[_0x6a86('0x23')](_0x350ce7[_0x6a86('0x22')],function(_0x4c11f0){return{'model':db[_0x4c11f0[_0x6a86('0x24')]],'as':_0x4c11f0['as'],'attributes':_0x4c11f0[_0x6a86('0x20')],'include':_0x4c11f0[_0x6a86('0x22')]?_['map'](_0x4c11f0[_0x6a86('0x22')],function(_0x17a496){return{'model':db[_0x17a496['model']],'as':_0x17a496['as'],'attributes':_0x17a496[_0x6a86('0x20')]};}):[]};}):[]};}):[]:[]})[_0x6a86('0x11')](function(_0x556d61){logger[_0x6a86('0x1a')]('ShowChatQueue',_0x5a2925);logger['debug'](_0x6a86('0x26'),_0x5a2925,JSON['stringify'](_0x556d61));_0x350524(_0x556d61);})['catch'](function(_0x518742){logger[_0x6a86('0x16')](_0x6a86('0x26'),_0x518742['message'],_0x5a2925);_0x51b789(_0x155054['error'](0x1f4,_0x518742[_0x6a86('0x19')]));});});}; \ No newline at end of file +var _0x128f=['message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','limit','include','map','model','attributes','ShowChatQueue','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x4c2b68,_0xc0db9b){var _0x233d8b=function(_0x2b7016){while(--_0x2b7016){_0x4c2b68['push'](_0x4c2b68['shift']());}};_0x233d8b(++_0xc0db9b);}(_0x128f,0xff));var _0xf128=function(_0x179535,_0x494780){_0x179535=_0x179535-0x0;var _0x11ef66=_0x128f[_0x179535];return _0x11ef66;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf128('0x0'));var BPromise=require(_0xf128('0x1'));var rs=require(_0xf128('0x2'));var fs=require('fs');var Redis=require(_0xf128('0x3'));var db=require(_0xf128('0x4'))['db'];var utils=require(_0xf128('0x5'));var logger=require(_0xf128('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf128('0x7'));var client=jayson[_0xf128('0x8')][_0xf128('0x9')]({'port':0x232a});config[_0xf128('0xa')]=_[_0xf128('0xb')](config[_0xf128('0xa')],{'host':_0xf128('0xc'),'port':0x18eb});var socket=require(_0xf128('0xd'))(new Redis(config['redis']));require(_0xf128('0xe'))[_0xf128('0xf')](socket);function respondWithRpcPromise(_0x24ed1d,_0x1d74ab,_0x1fa314){return new BPromise(function(_0x307fa0,_0x7609a3){return client[_0xf128('0x10')](_0x24ed1d,_0x1fa314)[_0xf128('0x11')](function(_0x509f65){logger[_0xf128('0x12')](_0xf128('0x13'),_0x1d74ab,_0xf128('0x14'));logger[_0xf128('0x15')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x1d74ab,'request\x20sent',JSON[_0xf128('0x16')](_0x509f65));if(_0x509f65[_0xf128('0x17')]){if(_0x509f65[_0xf128('0x17')][_0xf128('0x18')]===0x1f4){logger['error'](_0xf128('0x13'),_0x1d74ab,_0x509f65[_0xf128('0x17')][_0xf128('0x19')]);return _0x7609a3(_0x509f65['error'][_0xf128('0x19')]);}logger[_0xf128('0x17')](_0xf128('0x13'),_0x1d74ab,_0x509f65[_0xf128('0x17')][_0xf128('0x19')]);return _0x307fa0(_0x509f65[_0xf128('0x17')]['message']);}else{logger[_0xf128('0x12')]('ChatQueue,\x20%s,\x20%s',_0x1d74ab,_0xf128('0x14'));_0x307fa0(_0x509f65[_0xf128('0x1a')][_0xf128('0x19')]);}})[_0xf128('0x1b')](function(_0x5c8a88){logger[_0xf128('0x17')](_0xf128('0x13'),_0x1d74ab,_0x5c8a88);_0x7609a3(_0x5c8a88);});});}exports[_0xf128('0x1c')]=function(_0x38244b){var _0x5e85e6=this;return new Promise(function(_0x5e38a6,_0x206b53){return db[_0xf128('0x1d')][_0xf128('0x1e')]({'raw':_0x38244b[_0xf128('0x1f')]?_0x38244b[_0xf128('0x1f')][_0xf128('0x20')]===undefined?!![]:![]:!![],'where':_0x38244b[_0xf128('0x1f')]?_0x38244b['options'][_0xf128('0x21')]||null:null,'attributes':_0x38244b['options']?_0x38244b[_0xf128('0x1f')]['attributes']||null:null,'limit':_0x38244b[_0xf128('0x1f')]?_0x38244b['options'][_0xf128('0x22')]||null:null,'include':_0x38244b[_0xf128('0x1f')]?_0x38244b[_0xf128('0x1f')][_0xf128('0x23')]?_[_0xf128('0x24')](_0x38244b[_0xf128('0x1f')]['include'],function(_0x57975f){return{'model':db[_0x57975f[_0xf128('0x25')]],'as':_0x57975f['as'],'attributes':_0x57975f[_0xf128('0x26')],'include':_0x57975f[_0xf128('0x23')]?_[_0xf128('0x24')](_0x57975f['include'],function(_0x32198b){return{'model':db[_0x32198b[_0xf128('0x25')]],'as':_0x32198b['as'],'attributes':_0x32198b[_0xf128('0x26')],'include':_0x32198b['include']?_[_0xf128('0x24')](_0x32198b[_0xf128('0x23')],function(_0x1d0fad){return{'model':db[_0x1d0fad[_0xf128('0x25')]],'as':_0x1d0fad['as'],'attributes':_0x1d0fad[_0xf128('0x26')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2333ca){logger[_0xf128('0x12')](_0xf128('0x1c'),_0x38244b);logger[_0xf128('0x15')](_0xf128('0x1c'),_0x38244b,JSON[_0xf128('0x16')](_0x2333ca));_0x5e38a6(_0x2333ca);})[_0xf128('0x1b')](function(_0x4fb4d1){logger[_0xf128('0x17')]('GetChatQueue',_0x4fb4d1['message'],_0x38244b);_0x206b53(_0x5e85e6['error'](0x1f4,_0x4fb4d1[_0xf128('0x19')]));});});};exports[_0xf128('0x27')]=function(_0x54a48e){var _0x4222e4=this;return new Promise(function(_0x181b41,_0x265476){return db['ChatQueue']['find']({'raw':_0x54a48e['options']?_0x54a48e[_0xf128('0x1f')][_0xf128('0x20')]===undefined?!![]:![]:!![],'where':_0x54a48e[_0xf128('0x1f')]?_0x54a48e[_0xf128('0x1f')][_0xf128('0x21')]||null:null,'attributes':_0x54a48e['options']?_0x54a48e['options'][_0xf128('0x26')]||null:null,'include':_0x54a48e[_0xf128('0x1f')]?_0x54a48e['options'][_0xf128('0x23')]?_[_0xf128('0x24')](_0x54a48e[_0xf128('0x1f')][_0xf128('0x23')],function(_0x20feb5){return{'model':db[_0x20feb5[_0xf128('0x25')]],'as':_0x20feb5['as'],'attributes':_0x20feb5['attributes'],'include':_0x20feb5[_0xf128('0x23')]?_[_0xf128('0x24')](_0x20feb5[_0xf128('0x23')],function(_0x51f90a){return{'model':db[_0x51f90a['model']],'as':_0x51f90a['as'],'attributes':_0x51f90a['attributes'],'include':_0x51f90a['include']?_[_0xf128('0x24')](_0x51f90a[_0xf128('0x23')],function(_0x2545c7){return{'model':db[_0x2545c7[_0xf128('0x25')]],'as':_0x2545c7['as'],'attributes':_0x2545c7[_0xf128('0x26')]};}):[]};}):[]};}):[]:[]})[_0xf128('0x11')](function(_0xca3e5b){logger[_0xf128('0x12')](_0xf128('0x27'),_0x54a48e);logger[_0xf128('0x15')](_0xf128('0x27'),_0x54a48e,JSON[_0xf128('0x16')](_0xca3e5b));_0x181b41(_0xca3e5b);})[_0xf128('0x1b')](function(_0x5f302d){logger[_0xf128('0x17')]('ShowChatQueue',_0x5f302d[_0xf128('0x19')],_0x54a48e);_0x265476(_0x4222e4[_0xf128('0x17')](0x1f4,_0x5f302d[_0xf128('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 314b4a5..fa41db2 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 _0xb66c=['chatQueue:','./chatQueue.events','remove','removeListener','register','length'];(function(_0x414655,_0x79d916){var _0x237884=function(_0x2737d9){while(--_0x2737d9){_0x414655['push'](_0x414655['shift']());}};_0x237884(++_0x79d916);}(_0xb66c,0x175));var _0xcb66=function(_0x41d3ca,_0x237bae){_0x41d3ca=_0x41d3ca-0x0;var _0x5a3052=_0xb66c[_0x41d3ca];return _0x5a3052;};'use strict';var ChatQueueEvents=require(_0xcb66('0x0'));var events=['save',_0xcb66('0x1'),'update'];function createListener(_0x2afcb8,_0x24ea13){return function(_0xf7ccc5){_0x24ea13['emit'](_0x2afcb8,_0xf7ccc5);};}function removeListener(_0x35d439,_0x386241){return function(){ChatQueueEvents[_0xcb66('0x2')](_0x35d439,_0x386241);};}exports[_0xcb66('0x3')]=function(_0x5d766d){for(var _0x518163=0x0,_0x19adf5=events[_0xcb66('0x4')];_0x518163<_0x19adf5;_0x518163++){var _0xa3993=events[_0x518163];var _0x439f3d=createListener(_0xcb66('0x5')+_0xa3993,_0x5d766d);ChatQueueEvents['on'](_0xa3993,_0x439f3d);}}; \ No newline at end of file +var _0xc368=['removeListener','register','length','chatQueue:','save','update','emit'];(function(_0x169e53,_0x46be55){var _0x252bb3=function(_0x521e7a){while(--_0x521e7a){_0x169e53['push'](_0x169e53['shift']());}};_0x252bb3(++_0x46be55);}(_0xc368,0x7b));var _0x8c36=function(_0x2cd467,_0xa4bb31){_0x2cd467=_0x2cd467-0x0;var _0x232ba8=_0xc368[_0x2cd467];return _0x232ba8;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x8c36('0x0'),'remove',_0x8c36('0x1')];function createListener(_0x17fa33,_0x20e697){return function(_0x2640c5){_0x20e697[_0x8c36('0x2')](_0x17fa33,_0x2640c5);};}function removeListener(_0x5d3b27,_0x3e9034){return function(){ChatQueueEvents[_0x8c36('0x3')](_0x5d3b27,_0x3e9034);};}exports[_0x8c36('0x4')]=function(_0x1d3660){for(var _0x5ebfc1=0x0,_0x554022=events[_0x8c36('0x5')];_0x5ebfc1<_0x554022;_0x5ebfc1++){var _0x384867=events[_0x5ebfc1];var _0x3e76be=createListener(_0x8c36('0x6')+_0x384867,_0x1d3660);ChatQueueEvents['on'](_0x384867,_0x3e76be);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index c881c85..d928cad 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 _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(_0x458a09,_0x262164){var _0x2d68e0=function(_0xce8be9){while(--_0xce8be9){_0x458a09['push'](_0x458a09['shift']());}};_0x2d68e0(++_0x262164);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'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 +var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x42d42b,_0x32812d){var _0x24e802=function(_0x583ec2){while(--_0x583ec2){_0x42d42b['push'](_0x42d42b['shift']());}};_0x24e802(++_0x32812d);}(_0xe14b,0x93));var _0xbe14=function(_0x204a5c,_0x49dc68){_0x204a5c=_0x204a5c-0x0;var _0x232aeb=_0xe14b[_0x204a5c];return _0x232aeb;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 082a7e9..c335a02 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 _0xd90b=['moment','STRING','DATE'];(function(_0x54afc3,_0x4c89c0){var _0x51f144=function(_0x3f8684){while(--_0x3f8684){_0x54afc3['push'](_0x54afc3['shift']());}};_0x51f144(++_0x4c89c0);}(_0xd90b,0xbd));var _0xbd90=function(_0x449ded,_0xc4a95c){_0x449ded=_0x449ded-0x0;var _0x19aa01=_0xd90b[_0x449ded];return _0x19aa01;};'use strict';var moment=require(_0xbd90('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xbd90('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xbd90('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xbd90('0x2')]},'reason':{'type':Sequelize[_0xbd90('0x1')]}}; \ No newline at end of file +var _0xe385=['sequelize','exports','STRING','DATE'];(function(_0x2ad7e6,_0x387dcb){var _0x5b9275=function(_0x417ef5){while(--_0x417ef5){_0x2ad7e6['push'](_0x2ad7e6['shift']());}};_0x5b9275(++_0x387dcb);}(_0xe385,0x11c));var _0x5e38=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xe385[_0x3947c9];return _0x2e7871;};'use strict';var moment=require('moment');var Sequelize=require(_0x5e38('0x0'));module[_0x5e38('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x5e38('0x2')]},'joinAt':{'type':Sequelize[_0x5e38('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x5e38('0x3')]},'exitAt':{'type':Sequelize[_0x5e38('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 5f656b4..b72e4d3 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 _0xb5f3=['query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','filter','where','VIRTUAL','merge','findAll','catch','show','rawAttributes','includeAll','include','options','find','create','body','update','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','error','name','send','map','ChatQueueReport','type','key'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xb5f3,0x137));var _0x3b5f=function(_0x256e32,_0x4013bc){_0x256e32=_0x256e32-0x0;var _0x464070=_0xb5f3[_0x256e32];return _0x464070;};'use strict';var emlformat=require(_0x3b5f('0x0'));var rimraf=require(_0x3b5f('0x1'));var zipdir=require(_0x3b5f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3b5f('0x3'));var moment=require(_0x3b5f('0x4'));var BPromise=require(_0x3b5f('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3b5f('0x6'));var sox=require(_0x3b5f('0x7'));var csv=require(_0x3b5f('0x8'));var ejs=require(_0x3b5f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3b5f('0xa'));var squel=require(_0x3b5f('0xb'));var crypto=require('crypto');var jsforce=require(_0x3b5f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3b5f('0x8'));var querystring=require(_0x3b5f('0xd'));var Papa=require(_0x3b5f('0xe'));var Redis=require(_0x3b5f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3b5f('0x10'));var as=require(_0x3b5f('0x11'));var hardwareService=require(_0x3b5f('0x12'));var logger=require(_0x3b5f('0x13'))(_0x3b5f('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3b5f('0x15'))['db'];function respondWithStatusCode(_0xe9e58d,_0x17b960){_0x17b960=_0x17b960||0xcc;return function(_0x26e96e){if(_0x26e96e){return _0xe9e58d[_0x3b5f('0x16')](_0x17b960);}return _0xe9e58d[_0x3b5f('0x17')](_0x17b960)[_0x3b5f('0x18')]();};}function respondWithResult(_0x302c0a,_0x4f522b){_0x4f522b=_0x4f522b||0xc8;return function(_0x3d960d){if(_0x3d960d){return _0x302c0a[_0x3b5f('0x17')](_0x4f522b)[_0x3b5f('0x19')](_0x3d960d);}};}function respondWithFilteredResult(_0x5f5a26,_0x433d17){return function(_0x569543){if(_0x569543){var _0x5df2e7=typeof _0x433d17[_0x3b5f('0x1a')]==='undefined'&&typeof _0x433d17[_0x3b5f('0x1b')]===_0x3b5f('0x1c');var _0xa9a9eb=_0x569543[_0x3b5f('0x1d')];var _0x5ed046=_0x5df2e7?0x0:_0x433d17[_0x3b5f('0x1a')];var _0x4933c8=_0x5df2e7?_0x569543[_0x3b5f('0x1d')]:_0x433d17[_0x3b5f('0x1a')]+_0x433d17[_0x3b5f('0x1b')];var _0x5711ff;if(_0x4933c8>=_0xa9a9eb){_0x4933c8=_0xa9a9eb;_0x5711ff=0xc8;}else{_0x5711ff=0xce;}_0x5f5a26['status'](_0x5711ff);return _0x5f5a26[_0x3b5f('0x1e')](_0x3b5f('0x1f'),_0x5ed046+'-'+_0x4933c8+'/'+_0xa9a9eb)[_0x3b5f('0x19')](_0x569543);}return null;};}function patchUpdates(_0x810270){return function(_0x58e4cb){try{jsonpatch[_0x3b5f('0x20')](_0x58e4cb,_0x810270,!![]);}catch(_0xfcc090){return BPromise[_0x3b5f('0x21')](_0xfcc090);}return _0x58e4cb[_0x3b5f('0x22')]();};}function saveUpdates(_0x474697,_0x4580e5){return function(_0x56a1d0){if(_0x56a1d0){return _0x56a1d0['update'](_0x474697)[_0x3b5f('0x23')](function(_0x1e1df6){return _0x1e1df6;});}return null;};}function removeEntity(_0x2d3fe4,_0x25bcf6){return function(_0x469b92){if(_0x469b92){return _0x469b92[_0x3b5f('0x24')]()[_0x3b5f('0x23')](function(){_0x2d3fe4[_0x3b5f('0x17')](0xcc)[_0x3b5f('0x18')]();});}};}function handleEntityNotFound(_0x3267b8,_0x52be62){return function(_0x55fb32){if(!_0x55fb32){_0x3267b8[_0x3b5f('0x16')](0x194);}return _0x55fb32;};}function handleError(_0xfab9ac,_0xb23912){_0xb23912=_0xb23912||0x1f4;return function(_0x26c1e0){logger[_0x3b5f('0x25')](_0x26c1e0['stack']);if(_0x26c1e0[_0x3b5f('0x26')]){delete _0x26c1e0[_0x3b5f('0x26')];}_0xfab9ac[_0x3b5f('0x17')](_0xb23912)[_0x3b5f('0x27')](_0x26c1e0);};}exports['index']=function(_0x4f023c,_0x941539){var _0xdc1ad9={},_0x1533ea={},_0x5c00b7={'count':0x0,'rows':[]};var _0x4b89d6=_[_0x3b5f('0x28')](db[_0x3b5f('0x29')]['rawAttributes'],function(_0xbb62dc){return{'name':_0xbb62dc['fieldName'],'type':_0xbb62dc[_0x3b5f('0x2a')][_0x3b5f('0x2b')]};});_0x1533ea['model']=_['map'](_0x4b89d6,_0x3b5f('0x26'));_0x1533ea[_0x3b5f('0x2c')]=_[_0x3b5f('0x2d')](_0x4f023c[_0x3b5f('0x2c')]);_0x1533ea[_0x3b5f('0x2e')]=_[_0x3b5f('0x2f')](_0x1533ea[_0x3b5f('0x30')],_0x1533ea[_0x3b5f('0x2c')]);_0xdc1ad9['attributes']=_[_0x3b5f('0x2f')](_0x1533ea[_0x3b5f('0x30')],qs[_0x3b5f('0x31')](_0x4f023c['query'][_0x3b5f('0x31')]));_0xdc1ad9[_0x3b5f('0x32')]=_0xdc1ad9[_0x3b5f('0x32')][_0x3b5f('0x33')]?_0xdc1ad9[_0x3b5f('0x32')]:_0x1533ea['model'];if(!_0x4f023c['query']['hasOwnProperty'](_0x3b5f('0x34'))){_0xdc1ad9[_0x3b5f('0x1b')]=qs[_0x3b5f('0x1b')](_0x4f023c[_0x3b5f('0x2c')][_0x3b5f('0x1b')]);_0xdc1ad9[_0x3b5f('0x1a')]=qs['offset'](_0x4f023c[_0x3b5f('0x2c')][_0x3b5f('0x1a')]);}_0xdc1ad9[_0x3b5f('0x35')]=qs['sort'](_0x4f023c['query'][_0x3b5f('0x36')]);_0xdc1ad9['where']=qs['filters'](_['pick'](_0x4f023c[_0x3b5f('0x2c')],_0x1533ea['filters']),_0x4b89d6);if(_0x4f023c[_0x3b5f('0x2c')][_0x3b5f('0x37')]){_0xdc1ad9[_0x3b5f('0x38')]=_['merge'](_0xdc1ad9[_0x3b5f('0x38')],{'$or':_['map'](_0x4b89d6,function(_0x3ab324){if(_0x3ab324[_0x3b5f('0x2a')]!==_0x3b5f('0x39')){var _0x1f8bec={};_0x1f8bec[_0x3ab324[_0x3b5f('0x26')]]={'$like':'%'+_0x4f023c['query'][_0x3b5f('0x37')]+'%'};return _0x1f8bec;}})});}_0xdc1ad9=_[_0x3b5f('0x3a')]({},_0xdc1ad9,_0x4f023c['options']);var _0x14399c={'where':_0xdc1ad9[_0x3b5f('0x38')]};return db[_0x3b5f('0x29')][_0x3b5f('0x1d')](_0x14399c)[_0x3b5f('0x23')](function(_0x1713a0){_0x5c00b7['count']=_0x1713a0;if(_0x4f023c['query']['includeAll']){_0xdc1ad9['include']=[{'all':!![]}];}return db[_0x3b5f('0x29')][_0x3b5f('0x3b')](_0xdc1ad9);})[_0x3b5f('0x23')](function(_0x2dd3a1){_0x5c00b7['rows']=_0x2dd3a1;return _0x5c00b7;})[_0x3b5f('0x23')](respondWithFilteredResult(_0x941539,_0xdc1ad9))[_0x3b5f('0x3c')](handleError(_0x941539,null));};exports[_0x3b5f('0x3d')]=function(_0x4dedf2,_0xafc344){var _0x241156={'raw':!![],'where':{'id':_0x4dedf2['params']['id']}},_0x1dfa47={};_0x1dfa47[_0x3b5f('0x30')]=_['keys'](db[_0x3b5f('0x29')][_0x3b5f('0x3e')]);_0x1dfa47[_0x3b5f('0x2c')]=_[_0x3b5f('0x2d')](_0x4dedf2[_0x3b5f('0x2c')]);_0x1dfa47[_0x3b5f('0x2e')]=_['intersection'](_0x1dfa47['model'],_0x1dfa47[_0x3b5f('0x2c')]);_0x241156[_0x3b5f('0x32')]=_['intersection'](_0x1dfa47['model'],qs['fields'](_0x4dedf2['query']['fields']));_0x241156[_0x3b5f('0x32')]=_0x241156[_0x3b5f('0x32')][_0x3b5f('0x33')]?_0x241156['attributes']:_0x1dfa47[_0x3b5f('0x30')];if(_0x4dedf2[_0x3b5f('0x2c')][_0x3b5f('0x3f')]){_0x241156[_0x3b5f('0x40')]=[{'all':!![]}];}_0x241156=_[_0x3b5f('0x3a')]({},_0x241156,_0x4dedf2[_0x3b5f('0x41')]);return db['ChatQueueReport'][_0x3b5f('0x42')](_0x241156)[_0x3b5f('0x23')](handleEntityNotFound(_0xafc344,null))[_0x3b5f('0x23')](respondWithResult(_0xafc344,null))[_0x3b5f('0x3c')](handleError(_0xafc344,null));};exports[_0x3b5f('0x43')]=function(_0x57655d,_0x44e477){return db[_0x3b5f('0x29')][_0x3b5f('0x43')](_0x57655d[_0x3b5f('0x44')],{})['then'](respondWithResult(_0x44e477,0xc9))[_0x3b5f('0x3c')](handleError(_0x44e477,null));};exports[_0x3b5f('0x45')]=function(_0x24c250,_0x6f3163){if(_0x24c250[_0x3b5f('0x44')]['id']){delete _0x24c250[_0x3b5f('0x44')]['id'];}return db[_0x3b5f('0x29')][_0x3b5f('0x42')]({'where':{'id':_0x24c250['params']['id']}})['then'](handleEntityNotFound(_0x6f3163,null))[_0x3b5f('0x23')](saveUpdates(_0x24c250[_0x3b5f('0x44')],null))[_0x3b5f('0x23')](respondWithResult(_0x6f3163,null))[_0x3b5f('0x3c')](handleError(_0x6f3163,null));};exports['destroy']=function(_0xe98a85,_0x538cbe){return db[_0x3b5f('0x29')][_0x3b5f('0x42')]({'where':{'id':_0xe98a85[_0x3b5f('0x46')]['id']}})['then'](handleEntityNotFound(_0x538cbe,null))[_0x3b5f('0x23')](removeEntity(_0x538cbe,null))[_0x3b5f('0x3c')](handleError(_0x538cbe,null));};exports['describe']=function(_0x21b0f4,_0x45b94d){return db['ChatQueueReport']['describe']()[_0x3b5f('0x23')](respondWithResult(_0x45b94d,null))[_0x3b5f('0x3c')](handleError(_0x45b94d,null));}; \ No newline at end of file +var _0x8fd4=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','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','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','ChatQueueReport','include','catch','show','params','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox'];(function(_0xe957e3,_0x2f333e){var _0x21e397=function(_0x570d5e){while(--_0x570d5e){_0xe957e3['push'](_0xe957e3['shift']());}};_0x21e397(++_0x2f333e);}(_0x8fd4,0x178));var _0x48fd=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8fd4[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x48fd('0x0'));var zipdir=require(_0x48fd('0x1'));var jsonpatch=require(_0x48fd('0x2'));var rp=require(_0x48fd('0x3'));var moment=require(_0x48fd('0x4'));var BPromise=require(_0x48fd('0x5'));var Mustache=require(_0x48fd('0x6'));var util=require('util');var path=require(_0x48fd('0x7'));var sox=require(_0x48fd('0x8'));var csv=require('to-csv');var ejs=require(_0x48fd('0x9'));var fs=require('fs');var fs_extra=require(_0x48fd('0xa'));var _=require(_0x48fd('0xb'));var squel=require(_0x48fd('0xc'));var crypto=require(_0x48fd('0xd'));var jsforce=require(_0x48fd('0xe'));var deskjs=require(_0x48fd('0xf'));var toCsv=require(_0x48fd('0x10'));var querystring=require(_0x48fd('0x11'));var Papa=require(_0x48fd('0x12'));var Redis=require(_0x48fd('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x48fd('0x14'));var as=require(_0x48fd('0x15'));var hardwareService=require(_0x48fd('0x16'));var logger=require(_0x48fd('0x17'))(_0x48fd('0x18'));var utils=require(_0x48fd('0x19'));var config=require(_0x48fd('0x1a'));var licenseUtil=require(_0x48fd('0x1b'));var db=require(_0x48fd('0x1c'))['db'];function respondWithStatusCode(_0x43508f,_0x48b65d){_0x48b65d=_0x48b65d||0xcc;return function(_0x39f6cb){if(_0x39f6cb){return _0x43508f[_0x48fd('0x1d')](_0x48b65d);}return _0x43508f[_0x48fd('0x1e')](_0x48b65d)[_0x48fd('0x1f')]();};}function respondWithResult(_0x349483,_0x33ad2f){_0x33ad2f=_0x33ad2f||0xc8;return function(_0x3df49b){if(_0x3df49b){return _0x349483[_0x48fd('0x1e')](_0x33ad2f)[_0x48fd('0x20')](_0x3df49b);}};}function respondWithFilteredResult(_0x2b0cdf,_0x52ce33){return function(_0x5a0abe){if(_0x5a0abe){var _0x4d0040=typeof _0x52ce33[_0x48fd('0x21')]===_0x48fd('0x22')&&typeof _0x52ce33[_0x48fd('0x23')]===_0x48fd('0x22');var _0x1e515a=_0x5a0abe[_0x48fd('0x24')];var _0x476fb0=_0x4d0040?0x0:_0x52ce33[_0x48fd('0x21')];var _0x18fc29=_0x4d0040?_0x5a0abe[_0x48fd('0x24')]:_0x52ce33[_0x48fd('0x21')]+_0x52ce33[_0x48fd('0x23')];var _0x1a34c2;if(_0x18fc29>=_0x1e515a){_0x18fc29=_0x1e515a;_0x1a34c2=0xc8;}else{_0x1a34c2=0xce;}_0x2b0cdf[_0x48fd('0x1e')](_0x1a34c2);return _0x2b0cdf[_0x48fd('0x25')](_0x48fd('0x26'),_0x476fb0+'-'+_0x18fc29+'/'+_0x1e515a)['json'](_0x5a0abe);}return null;};}function patchUpdates(_0x708152){return function(_0x55968f){try{jsonpatch[_0x48fd('0x27')](_0x55968f,_0x708152,!![]);}catch(_0x26175e){return BPromise[_0x48fd('0x28')](_0x26175e);}return _0x55968f[_0x48fd('0x29')]();};}function saveUpdates(_0x36740a,_0x23abc0){return function(_0x5e0d8b){if(_0x5e0d8b){return _0x5e0d8b[_0x48fd('0x2a')](_0x36740a)[_0x48fd('0x2b')](function(_0x2ca93b){return _0x2ca93b;});}return null;};}function removeEntity(_0x2a4860,_0x44bbb3){return function(_0x270364){if(_0x270364){return _0x270364[_0x48fd('0x2c')]()['then'](function(){_0x2a4860['status'](0xcc)[_0x48fd('0x1f')]();});}};}function handleEntityNotFound(_0x2e3d6c,_0x1bf56c){return function(_0x17a654){if(!_0x17a654){_0x2e3d6c[_0x48fd('0x1d')](0x194);}return _0x17a654;};}function handleError(_0x4f3b1b,_0x513a5a){_0x513a5a=_0x513a5a||0x1f4;return function(_0x5e3947){logger[_0x48fd('0x2d')](_0x5e3947[_0x48fd('0x2e')]);if(_0x5e3947[_0x48fd('0x2f')]){delete _0x5e3947[_0x48fd('0x2f')];}_0x4f3b1b[_0x48fd('0x1e')](_0x513a5a)[_0x48fd('0x30')](_0x5e3947);};}exports['index']=function(_0xe8e4e9,_0x415979){var _0x3b9ba8={},_0x5b16d0={},_0x143e87={'count':0x0,'rows':[]};var _0x3149cc=_[_0x48fd('0x31')](db['ChatQueueReport'][_0x48fd('0x32')],function(_0x14f560){return{'name':_0x14f560[_0x48fd('0x33')],'type':_0x14f560[_0x48fd('0x34')][_0x48fd('0x35')]};});_0x5b16d0[_0x48fd('0x36')]=_[_0x48fd('0x31')](_0x3149cc,_0x48fd('0x2f'));_0x5b16d0[_0x48fd('0x37')]=_[_0x48fd('0x38')](_0xe8e4e9[_0x48fd('0x37')]);_0x5b16d0[_0x48fd('0x39')]=_[_0x48fd('0x3a')](_0x5b16d0[_0x48fd('0x36')],_0x5b16d0[_0x48fd('0x37')]);_0x3b9ba8['attributes']=_['intersection'](_0x5b16d0[_0x48fd('0x36')],qs[_0x48fd('0x3b')](_0xe8e4e9[_0x48fd('0x37')][_0x48fd('0x3b')]));_0x3b9ba8[_0x48fd('0x3c')]=_0x3b9ba8[_0x48fd('0x3c')][_0x48fd('0x3d')]?_0x3b9ba8[_0x48fd('0x3c')]:_0x5b16d0['model'];if(!_0xe8e4e9[_0x48fd('0x37')][_0x48fd('0x3e')](_0x48fd('0x3f'))){_0x3b9ba8[_0x48fd('0x23')]=qs[_0x48fd('0x23')](_0xe8e4e9[_0x48fd('0x37')][_0x48fd('0x23')]);_0x3b9ba8[_0x48fd('0x21')]=qs[_0x48fd('0x21')](_0xe8e4e9['query']['offset']);}_0x3b9ba8[_0x48fd('0x40')]=qs[_0x48fd('0x41')](_0xe8e4e9[_0x48fd('0x37')]['sort']);_0x3b9ba8[_0x48fd('0x42')]=qs[_0x48fd('0x39')](_['pick'](_0xe8e4e9['query'],_0x5b16d0[_0x48fd('0x39')]),_0x3149cc);if(_0xe8e4e9['query']['filter']){_0x3b9ba8[_0x48fd('0x42')]=_['merge'](_0x3b9ba8['where'],{'$or':_[_0x48fd('0x31')](_0x3149cc,function(_0x47aeae){if(_0x47aeae[_0x48fd('0x34')]!=='VIRTUAL'){var _0x13f11d={};_0x13f11d[_0x47aeae[_0x48fd('0x2f')]]={'$like':'%'+_0xe8e4e9[_0x48fd('0x37')]['filter']+'%'};return _0x13f11d;}})});}_0x3b9ba8=_[_0x48fd('0x43')]({},_0x3b9ba8,_0xe8e4e9['options']);var _0x241241={'where':_0x3b9ba8[_0x48fd('0x42')]};return db[_0x48fd('0x44')][_0x48fd('0x24')](_0x241241)[_0x48fd('0x2b')](function(_0x382e3d){_0x143e87[_0x48fd('0x24')]=_0x382e3d;if(_0xe8e4e9[_0x48fd('0x37')]['includeAll']){_0x3b9ba8[_0x48fd('0x45')]=[{'all':!![]}];}return db[_0x48fd('0x44')]['findAll'](_0x3b9ba8);})[_0x48fd('0x2b')](function(_0x2e451f){_0x143e87['rows']=_0x2e451f;return _0x143e87;})[_0x48fd('0x2b')](respondWithFilteredResult(_0x415979,_0x3b9ba8))[_0x48fd('0x46')](handleError(_0x415979,null));};exports[_0x48fd('0x47')]=function(_0x12f002,_0x510141){var _0x2a66f5={'raw':!![],'where':{'id':_0x12f002[_0x48fd('0x48')]['id']}},_0x349b5c={};_0x349b5c[_0x48fd('0x36')]=_[_0x48fd('0x38')](db['ChatQueueReport'][_0x48fd('0x32')]);_0x349b5c[_0x48fd('0x37')]=_['keys'](_0x12f002['query']);_0x349b5c[_0x48fd('0x39')]=_[_0x48fd('0x3a')](_0x349b5c[_0x48fd('0x36')],_0x349b5c['query']);_0x2a66f5[_0x48fd('0x3c')]=_[_0x48fd('0x3a')](_0x349b5c[_0x48fd('0x36')],qs[_0x48fd('0x3b')](_0x12f002[_0x48fd('0x37')]['fields']));_0x2a66f5['attributes']=_0x2a66f5[_0x48fd('0x3c')]['length']?_0x2a66f5[_0x48fd('0x3c')]:_0x349b5c[_0x48fd('0x36')];if(_0x12f002['query']['includeAll']){_0x2a66f5[_0x48fd('0x45')]=[{'all':!![]}];}_0x2a66f5=_[_0x48fd('0x43')]({},_0x2a66f5,_0x12f002['options']);return db[_0x48fd('0x44')][_0x48fd('0x49')](_0x2a66f5)[_0x48fd('0x2b')](handleEntityNotFound(_0x510141,null))[_0x48fd('0x2b')](respondWithResult(_0x510141,null))['catch'](handleError(_0x510141,null));};exports[_0x48fd('0x4a')]=function(_0x270b2c,_0x136ff3){return db[_0x48fd('0x44')][_0x48fd('0x4a')](_0x270b2c[_0x48fd('0x4b')],{})[_0x48fd('0x2b')](respondWithResult(_0x136ff3,0xc9))[_0x48fd('0x46')](handleError(_0x136ff3,null));};exports[_0x48fd('0x2a')]=function(_0x1ce2d9,_0x4cfc52){if(_0x1ce2d9[_0x48fd('0x4b')]['id']){delete _0x1ce2d9[_0x48fd('0x4b')]['id'];}return db[_0x48fd('0x44')][_0x48fd('0x49')]({'where':{'id':_0x1ce2d9[_0x48fd('0x48')]['id']}})[_0x48fd('0x2b')](handleEntityNotFound(_0x4cfc52,null))[_0x48fd('0x2b')](saveUpdates(_0x1ce2d9[_0x48fd('0x4b')],null))[_0x48fd('0x2b')](respondWithResult(_0x4cfc52,null))['catch'](handleError(_0x4cfc52,null));};exports[_0x48fd('0x2c')]=function(_0x3fe24b,_0x244ab5){return db[_0x48fd('0x44')][_0x48fd('0x49')]({'where':{'id':_0x3fe24b[_0x48fd('0x48')]['id']}})[_0x48fd('0x2b')](handleEntityNotFound(_0x244ab5,null))[_0x48fd('0x2b')](removeEntity(_0x244ab5,null))['catch'](handleError(_0x244ab5,null));};exports[_0x48fd('0x4c')]=function(_0x2b0122,_0x16fb64){return db[_0x48fd('0x44')][_0x48fd('0x4c')]()[_0x48fd('0x2b')](respondWithResult(_0x16fb64,null))[_0x48fd('0x46')](handleError(_0x16fb64,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 8c6af99..3094d8d 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 _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0xb8111f,_0x2b0a3b){var _0x233d1b=function(_0x416f63){while(--_0x416f63){_0xb8111f['push'](_0xb8111f['shift']());}};_0x233d1b(++_0x2b0a3b);}(_0xe706,0xa3));var _0x6e70=function(_0x495c52,_0x53c0cc){_0x495c52=_0x495c52-0x0;var _0x2b4bb2=_0xe706[_0x495c52];return _0x2b4bb2;};'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 +var _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x33b05e,_0x66be24){var _0x2e7e1c=function(_0x15b1d1){while(--_0x15b1d1){_0x33b05e['push'](_0x33b05e['shift']());}};_0x2e7e1c(++_0x66be24);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 206448d..ed98a6a 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 _0xcbbb=['../../config/environment','jayson/promise','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','raw','UpdateChatQueueReport','update','options','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2844d6,_0x44446b){var _0x266408=function(_0x12b53b){while(--_0x12b53b){_0x2844d6['push'](_0x2844d6['shift']());}};_0x266408(++_0x44446b);}(_0xcbbb,0x1ee));var _0xbcbb=function(_0x1e4150,_0x55b02a){_0x1e4150=_0x1e4150-0x0;var _0x1ce3ee=_0xcbbb[_0x1e4150];return _0x1ce3ee;};'use strict';var _=require(_0xbcbb('0x0'));var util=require(_0xbcbb('0x1'));var moment=require(_0xbcbb('0x2'));var BPromise=require(_0xbcbb('0x3'));var rs=require(_0xbcbb('0x4'));var fs=require('fs');var Redis=require(_0xbcbb('0x5'));var db=require(_0xbcbb('0x6'))['db'];var utils=require(_0xbcbb('0x7'));var logger=require(_0xbcbb('0x8'))(_0xbcbb('0x9'));var config=require(_0xbcbb('0xa'));var jayson=require(_0xbcbb('0xb'));var client=jayson['client'][_0xbcbb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5e8f4f,_0x5165d9,_0x3b9f7e){return new BPromise(function(_0xef0be8,_0x233eaa){return client[_0xbcbb('0xd')](_0x5e8f4f,_0x3b9f7e)[_0xbcbb('0xe')](function(_0x4feca1){logger[_0xbcbb('0xf')](_0xbcbb('0x10'),_0x5165d9,'request\x20sent');logger[_0xbcbb('0x11')](_0xbcbb('0x12'),_0x5165d9,_0xbcbb('0x13'),JSON[_0xbcbb('0x14')](_0x4feca1));if(_0x4feca1[_0xbcbb('0x15')]){if(_0x4feca1[_0xbcbb('0x15')][_0xbcbb('0x16')]===0x1f4){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x5165d9,_0x4feca1[_0xbcbb('0x15')][_0xbcbb('0x17')]);return _0x233eaa(_0x4feca1['error']['message']);}logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x5165d9,_0x4feca1[_0xbcbb('0x15')][_0xbcbb('0x17')]);return _0xef0be8(_0x4feca1['error']['message']);}else{logger[_0xbcbb('0xf')](_0xbcbb('0x10'),_0x5165d9,'request\x20sent');_0xef0be8(_0x4feca1[_0xbcbb('0x18')]['message']);}})[_0xbcbb('0x19')](function(_0x3ce70e){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x5165d9,_0x3ce70e);_0x233eaa(_0x3ce70e);});});}exports[_0xbcbb('0x1a')]=function(_0x556ec9){var _0x587df2=this;return new Promise(function(_0x3a7644,_0xe524b4){return db[_0xbcbb('0x1b')][_0xbcbb('0x1c')](_0x556ec9[_0xbcbb('0x1d')],{'raw':_0x556ec9['options']?_0x556ec9['options'][_0xbcbb('0x1e')]===undefined?!![]:![]:!![]})[_0xbcbb('0xe')](function(_0x1b804f){logger[_0xbcbb('0xf')](_0xbcbb('0x1a'),_0x556ec9);logger[_0xbcbb('0x11')]('CreateChatQueueReport',_0x556ec9,JSON[_0xbcbb('0x14')](_0x1b804f));_0x3a7644(_0x1b804f);})['catch'](function(_0x30ebb9){logger[_0xbcbb('0x15')](_0xbcbb('0x1a'),_0x30ebb9[_0xbcbb('0x17')],_0x556ec9);_0xe524b4(_0x587df2[_0xbcbb('0x15')](0x1f4,_0x30ebb9['message']));});});};exports[_0xbcbb('0x1f')]=function(_0x46b924){var _0x2cdd88=this;return new Promise(function(_0x431a4c,_0x9263f8){return db['ChatQueueReport'][_0xbcbb('0x20')](_0x46b924[_0xbcbb('0x1d')],{'raw':_0x46b924[_0xbcbb('0x21')]?_0x46b924[_0xbcbb('0x21')][_0xbcbb('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x46b924[_0xbcbb('0x21')]?_0x46b924['options']['where']||null:null,'attributes':_0x46b924[_0xbcbb('0x21')]?_0x46b924[_0xbcbb('0x21')][_0xbcbb('0x22')]||null:null,'limit':_0x46b924[_0xbcbb('0x21')]?_0x46b924['options'][_0xbcbb('0x23')]||null:null})[_0xbcbb('0xe')](function(_0x5677c9){logger[_0xbcbb('0xf')]('UpdateChatQueueReport',_0x46b924);logger[_0xbcbb('0x11')](_0xbcbb('0x1f'),_0x46b924,JSON[_0xbcbb('0x14')](_0x5677c9));_0x431a4c(_0x5677c9);})[_0xbcbb('0x19')](function(_0x4237c2){logger['error'](_0xbcbb('0x1f'),_0x4237c2['message'],_0x46b924);_0x9263f8(_0x2cdd88['error'](0x1f4,_0x4237c2[_0xbcbb('0x17')]));});});}; \ No newline at end of file +var _0xa5dd=['options','raw','info','debug','UpdateChatQueueReport','update','where','attributes','limit','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','request\x20sent','stringify','error','code','message','ChatQueueReport,\x20%s,\x20%s','result','catch','CreateChatQueueReport','ChatQueueReport','body'];(function(_0x5774be,_0x2259d3){var _0x4914b4=function(_0x1eebc3){while(--_0x1eebc3){_0x5774be['push'](_0x5774be['shift']());}};_0x4914b4(++_0x2259d3);}(_0xa5dd,0x101));var _0xda5d=function(_0x147776,_0x369238){_0x147776=_0x147776-0x0;var _0x3d142c=_0xa5dd[_0x147776];return _0x3d142c;};'use strict';var _=require(_0xda5d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xda5d('0x1'));var rs=require(_0xda5d('0x2'));var fs=require('fs');var Redis=require(_0xda5d('0x3'));var db=require(_0xda5d('0x4'))['db'];var utils=require(_0xda5d('0x5'));var logger=require('../../config/logger')(_0xda5d('0x6'));var config=require(_0xda5d('0x7'));var jayson=require(_0xda5d('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x461283,_0x91cf4e,_0x432097){return new BPromise(function(_0x402aa8,_0x1c1e2d){return client[_0xda5d('0x9')](_0x461283,_0x432097)[_0xda5d('0xa')](function(_0x3d5c69){logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x91cf4e,_0xda5d('0xb'));logger['debug']('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x91cf4e,_0xda5d('0xb'),JSON[_0xda5d('0xc')](_0x3d5c69));if(_0x3d5c69['error']){if(_0x3d5c69[_0xda5d('0xd')][_0xda5d('0xe')]===0x1f4){logger[_0xda5d('0xd')]('ChatQueueReport,\x20%s,\x20%s',_0x91cf4e,_0x3d5c69['error'][_0xda5d('0xf')]);return _0x1c1e2d(_0x3d5c69[_0xda5d('0xd')][_0xda5d('0xf')]);}logger[_0xda5d('0xd')](_0xda5d('0x10'),_0x91cf4e,_0x3d5c69[_0xda5d('0xd')][_0xda5d('0xf')]);return _0x402aa8(_0x3d5c69['error']['message']);}else{logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x91cf4e,'request\x20sent');_0x402aa8(_0x3d5c69[_0xda5d('0x11')][_0xda5d('0xf')]);}})[_0xda5d('0x12')](function(_0x388f40){logger[_0xda5d('0xd')](_0xda5d('0x10'),_0x91cf4e,_0x388f40);_0x1c1e2d(_0x388f40);});});}exports[_0xda5d('0x13')]=function(_0x3667da){var _0x3a7e86=this;return new Promise(function(_0x4d5179,_0x3f5cc9){return db[_0xda5d('0x14')]['create'](_0x3667da[_0xda5d('0x15')],{'raw':_0x3667da[_0xda5d('0x16')]?_0x3667da[_0xda5d('0x16')][_0xda5d('0x17')]===undefined?!![]:![]:!![]})[_0xda5d('0xa')](function(_0x109e29){logger[_0xda5d('0x18')]('CreateChatQueueReport',_0x3667da);logger[_0xda5d('0x19')]('CreateChatQueueReport',_0x3667da,JSON[_0xda5d('0xc')](_0x109e29));_0x4d5179(_0x109e29);})[_0xda5d('0x12')](function(_0x4a47ef){logger[_0xda5d('0xd')]('CreateChatQueueReport',_0x4a47ef[_0xda5d('0xf')],_0x3667da);_0x3f5cc9(_0x3a7e86[_0xda5d('0xd')](0x1f4,_0x4a47ef[_0xda5d('0xf')]));});});};exports[_0xda5d('0x1a')]=function(_0x4038d7){var _0x114a45=this;return new Promise(function(_0x2e9f9a,_0x40be9c){return db[_0xda5d('0x14')][_0xda5d('0x1b')](_0x4038d7[_0xda5d('0x15')],{'raw':_0x4038d7[_0xda5d('0x16')]?_0x4038d7[_0xda5d('0x16')][_0xda5d('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4038d7[_0xda5d('0x16')]?_0x4038d7[_0xda5d('0x16')][_0xda5d('0x1c')]||null:null,'attributes':_0x4038d7[_0xda5d('0x16')]?_0x4038d7[_0xda5d('0x16')][_0xda5d('0x1d')]||null:null,'limit':_0x4038d7[_0xda5d('0x16')]?_0x4038d7['options'][_0xda5d('0x1e')]||null:null})[_0xda5d('0xa')](function(_0x435572){logger[_0xda5d('0x18')](_0xda5d('0x1a'),_0x4038d7);logger['debug'](_0xda5d('0x1a'),_0x4038d7,JSON[_0xda5d('0xc')](_0x435572));_0x2e9f9a(_0x435572);})[_0xda5d('0x12')](function(_0x3b4877){logger[_0xda5d('0xd')]('UpdateChatQueueReport',_0x3b4877['message'],_0x4038d7);_0x40be9c(_0x114a45[_0xda5d('0xd')](0x1f4,_0x3b4877[_0xda5d('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 3f96b42..447c80a 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 _0xe388=['/:id','show','post','create','put','update','destroy','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','/describe','describe'];(function(_0xf5cf8b,_0x4698bd){var _0x38216e=function(_0x52b583){while(--_0x52b583){_0xf5cf8b['push'](_0xf5cf8b['shift']());}};_0x38216e(++_0x4698bd);}(_0xe388,0x8c));var _0x8e38=function(_0x576170,_0x1712ae){_0x576170=_0x576170-0x0;var _0x397c70=_0xe388[_0x576170];return _0x397c70;};'use strict';var multer=require(_0x8e38('0x0'));var util=require(_0x8e38('0x1'));var path=require(_0x8e38('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x8e38('0x3'));var auth=require(_0x8e38('0x4'));var interaction=require(_0x8e38('0x5'));var config=require(_0x8e38('0x6'));var controller=require(_0x8e38('0x7'));router[_0x8e38('0x8')]('/',auth[_0x8e38('0x9')](),controller['index']);router[_0x8e38('0x8')](_0x8e38('0xa'),auth['isAuthenticated'](),controller[_0x8e38('0xb')]);router[_0x8e38('0x8')](_0x8e38('0xc'),auth[_0x8e38('0x9')](),controller[_0x8e38('0xd')]);router[_0x8e38('0xe')]('/',auth[_0x8e38('0x9')](),controller[_0x8e38('0xf')]);router[_0x8e38('0x10')]('/:id',auth[_0x8e38('0x9')](),controller[_0x8e38('0x11')]);router['delete']('/:id',auth[_0x8e38('0x9')](),controller[_0x8e38('0x12')]);module['exports']=router; \ No newline at end of file +var _0x880a=['index','/describe','describe','show','post','put','/:id','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated'];(function(_0x295278,_0x5941e2){var _0x30794a=function(_0xd355e1){while(--_0xd355e1){_0x295278['push'](_0x295278['shift']());}};_0x30794a(++_0x5941e2);}(_0x880a,0x13d));var _0xa880=function(_0x4eeb7a,_0x308fcc){_0x4eeb7a=_0x4eeb7a-0x0;var _0x1a282b=_0x880a[_0x4eeb7a];return _0x1a282b;};'use strict';var multer=require(_0xa880('0x0'));var util=require(_0xa880('0x1'));var path=require(_0xa880('0x2'));var timeout=require(_0xa880('0x3'));var express=require(_0xa880('0x4'));var router=express[_0xa880('0x5')]();var fs_extra=require(_0xa880('0x6'));var auth=require(_0xa880('0x7'));var interaction=require(_0xa880('0x8'));var config=require(_0xa880('0x9'));var controller=require(_0xa880('0xa'));router[_0xa880('0xb')]('/',auth[_0xa880('0xc')](),controller[_0xa880('0xd')]);router[_0xa880('0xb')](_0xa880('0xe'),auth['isAuthenticated'](),controller[_0xa880('0xf')]);router[_0xa880('0xb')]('/:id',auth[_0xa880('0xc')](),controller[_0xa880('0x10')]);router[_0xa880('0x11')]('/',auth[_0xa880('0xc')](),controller['create']);router[_0xa880('0x12')](_0xa880('0x13'),auth[_0xa880('0xc')](),controller[_0xa880('0x14')]);router['delete']('/:id',auth[_0xa880('0xc')](),controller[_0xa880('0x15')]);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 f052d0a..dcebf7b 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 _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0xa58f68,_0x1d526a){var _0xa754da=function(_0x33529b){while(--_0x33529b){_0xa58f68['push'](_0xa58f68['shift']());}};_0xa754da(++_0x1d526a);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xf3cd[_0x18a79d];return _0x4f8848;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x2d6015,_0x303739){var _0x458878=function(_0x349993){while(--_0x349993){_0x2d6015['push'](_0x2d6015['shift']());}};_0x458878(++_0x303739);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x4e7abc,_0x2aeca1){_0x4e7abc=_0x4e7abc-0x0;var _0x428796=_0xf3cd[_0x4e7abc];return _0x428796;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index c0a1e00..a43a492 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 _0xa31d=['model','query','filters','intersection','attributes','length','hasOwnProperty','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','fields','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','error','name','send','map','ChatTransferReport','rawAttributes','fieldName','type','key'];(function(_0x4d4b73,_0x5ba63c){var _0x30fcea=function(_0x4b865a){while(--_0x4b865a){_0x4d4b73['push'](_0x4d4b73['shift']());}};_0x30fcea(++_0x5ba63c);}(_0xa31d,0x132));var _0xda31=function(_0xef8146,_0x459c34){_0xef8146=_0xef8146-0x0;var _0x5a6cb0=_0xa31d[_0xef8146];return _0x5a6cb0;};'use strict';var emlformat=require(_0xda31('0x0'));var rimraf=require(_0xda31('0x1'));var zipdir=require(_0xda31('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xda31('0x3'));var moment=require(_0xda31('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xda31('0x5'));var util=require(_0xda31('0x6'));var path=require('path');var sox=require(_0xda31('0x7'));var csv=require(_0xda31('0x8'));var ejs=require(_0xda31('0x9'));var fs=require('fs');var fs_extra=require(_0xda31('0xa'));var _=require('lodash');var squel=require(_0xda31('0xb'));var crypto=require(_0xda31('0xc'));var jsforce=require(_0xda31('0xd'));var deskjs=require(_0xda31('0xe'));var toCsv=require(_0xda31('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xda31('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xda31('0x10'));var hardwareService=require(_0xda31('0x11'));var logger=require('../../config/logger')(_0xda31('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xda31('0x13'));var db=require(_0xda31('0x14'))['db'];function respondWithStatusCode(_0x388a5e,_0x42460a){_0x42460a=_0x42460a||0xcc;return function(_0x4591f1){if(_0x4591f1){return _0x388a5e[_0xda31('0x15')](_0x42460a);}return _0x388a5e[_0xda31('0x16')](_0x42460a)[_0xda31('0x17')]();};}function respondWithResult(_0x29b8f9,_0x246087){_0x246087=_0x246087||0xc8;return function(_0x5a3f5f){if(_0x5a3f5f){return _0x29b8f9[_0xda31('0x16')](_0x246087)[_0xda31('0x18')](_0x5a3f5f);}};}function respondWithFilteredResult(_0x3ef8ec,_0x3f9445){return function(_0x30fe48){if(_0x30fe48){var _0x559c37=typeof _0x3f9445[_0xda31('0x19')]===_0xda31('0x1a')&&typeof _0x3f9445[_0xda31('0x1b')]===_0xda31('0x1a');var _0x32a7e9=_0x30fe48['count'];var _0x42e5b4=_0x559c37?0x0:_0x3f9445['offset'];var _0xc0f719=_0x559c37?_0x30fe48[_0xda31('0x1c')]:_0x3f9445[_0xda31('0x19')]+_0x3f9445[_0xda31('0x1b')];var _0x506fe4;if(_0xc0f719>=_0x32a7e9){_0xc0f719=_0x32a7e9;_0x506fe4=0xc8;}else{_0x506fe4=0xce;}_0x3ef8ec[_0xda31('0x16')](_0x506fe4);return _0x3ef8ec['set'](_0xda31('0x1d'),_0x42e5b4+'-'+_0xc0f719+'/'+_0x32a7e9)[_0xda31('0x18')](_0x30fe48);}return null;};}function patchUpdates(_0x161cbe){return function(_0x105763){try{jsonpatch[_0xda31('0x1e')](_0x105763,_0x161cbe,!![]);}catch(_0x3c31be){return BPromise[_0xda31('0x1f')](_0x3c31be);}return _0x105763['save']();};}function saveUpdates(_0xf9d257,_0xc8df82){return function(_0x4f758a){if(_0x4f758a){return _0x4f758a[_0xda31('0x20')](_0xf9d257)[_0xda31('0x21')](function(_0x2fa2ee){return _0x2fa2ee;});}return null;};}function removeEntity(_0x521b51,_0x251725){return function(_0x3e138b){if(_0x3e138b){return _0x3e138b[_0xda31('0x22')]()[_0xda31('0x21')](function(){_0x521b51[_0xda31('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d992c,_0x2519ae){return function(_0x49f561){if(!_0x49f561){_0x4d992c[_0xda31('0x15')](0x194);}return _0x49f561;};}function handleError(_0x2adfa5,_0x23f12e){_0x23f12e=_0x23f12e||0x1f4;return function(_0x390e21){logger[_0xda31('0x23')](_0x390e21['stack']);if(_0x390e21[_0xda31('0x24')]){delete _0x390e21[_0xda31('0x24')];}_0x2adfa5[_0xda31('0x16')](_0x23f12e)[_0xda31('0x25')](_0x390e21);};}exports['index']=function(_0x3dd920,_0x382055){var _0x5054d5={},_0x3f5612={},_0x505cfb={'count':0x0,'rows':[]};var _0x3ad42f=_[_0xda31('0x26')](db[_0xda31('0x27')][_0xda31('0x28')],function(_0x4af86a){return{'name':_0x4af86a[_0xda31('0x29')],'type':_0x4af86a[_0xda31('0x2a')][_0xda31('0x2b')]};});_0x3f5612[_0xda31('0x2c')]=_[_0xda31('0x26')](_0x3ad42f,_0xda31('0x24'));_0x3f5612[_0xda31('0x2d')]=_['keys'](_0x3dd920['query']);_0x3f5612[_0xda31('0x2e')]=_[_0xda31('0x2f')](_0x3f5612[_0xda31('0x2c')],_0x3f5612['query']);_0x5054d5[_0xda31('0x30')]=_[_0xda31('0x2f')](_0x3f5612['model'],qs['fields'](_0x3dd920[_0xda31('0x2d')]['fields']));_0x5054d5[_0xda31('0x30')]=_0x5054d5[_0xda31('0x30')][_0xda31('0x31')]?_0x5054d5[_0xda31('0x30')]:_0x3f5612[_0xda31('0x2c')];if(!_0x3dd920['query'][_0xda31('0x32')]('nolimit')){_0x5054d5[_0xda31('0x1b')]=qs[_0xda31('0x1b')](_0x3dd920[_0xda31('0x2d')][_0xda31('0x1b')]);_0x5054d5['offset']=qs[_0xda31('0x19')](_0x3dd920[_0xda31('0x2d')][_0xda31('0x19')]);}_0x5054d5[_0xda31('0x33')]=qs['sort'](_0x3dd920[_0xda31('0x2d')]['sort']);_0x5054d5[_0xda31('0x34')]=qs[_0xda31('0x2e')](_[_0xda31('0x35')](_0x3dd920[_0xda31('0x2d')],_0x3f5612[_0xda31('0x2e')]),_0x3ad42f);if(_0x3dd920[_0xda31('0x2d')][_0xda31('0x36')]){_0x5054d5[_0xda31('0x34')]=_[_0xda31('0x37')](_0x5054d5[_0xda31('0x34')],{'$or':_['map'](_0x3ad42f,function(_0x21ca93){if(_0x21ca93[_0xda31('0x2a')]!==_0xda31('0x38')){var _0x1075c1={};_0x1075c1[_0x21ca93[_0xda31('0x24')]]={'$like':'%'+_0x3dd920[_0xda31('0x2d')]['filter']+'%'};return _0x1075c1;}})});}_0x5054d5=_[_0xda31('0x37')]({},_0x5054d5,_0x3dd920[_0xda31('0x39')]);var _0x49d09b={'where':_0x5054d5[_0xda31('0x34')]};return db['ChatTransferReport'][_0xda31('0x1c')](_0x49d09b)[_0xda31('0x21')](function(_0x5820d9){_0x505cfb[_0xda31('0x1c')]=_0x5820d9;if(_0x3dd920['query'][_0xda31('0x3a')]){_0x5054d5[_0xda31('0x3b')]=[{'all':!![]}];}return db[_0xda31('0x27')]['findAll'](_0x5054d5);})[_0xda31('0x21')](function(_0xdf8209){_0x505cfb[_0xda31('0x3c')]=_0xdf8209;return _0x505cfb;})[_0xda31('0x21')](respondWithFilteredResult(_0x382055,_0x5054d5))[_0xda31('0x3d')](handleError(_0x382055,null));};exports[_0xda31('0x3e')]=function(_0x32fe12,_0x479a8c){var _0x3bbc73={'raw':!![],'where':{'id':_0x32fe12[_0xda31('0x3f')]['id']}},_0x18d3fa={};_0x18d3fa['model']=_[_0xda31('0x40')](db['ChatTransferReport']['rawAttributes']);_0x18d3fa[_0xda31('0x2d')]=_['keys'](_0x32fe12[_0xda31('0x2d')]);_0x18d3fa[_0xda31('0x2e')]=_['intersection'](_0x18d3fa[_0xda31('0x2c')],_0x18d3fa[_0xda31('0x2d')]);_0x3bbc73['attributes']=_[_0xda31('0x2f')](_0x18d3fa[_0xda31('0x2c')],qs[_0xda31('0x41')](_0x32fe12[_0xda31('0x2d')][_0xda31('0x41')]));_0x3bbc73[_0xda31('0x30')]=_0x3bbc73[_0xda31('0x30')][_0xda31('0x31')]?_0x3bbc73[_0xda31('0x30')]:_0x18d3fa[_0xda31('0x2c')];if(_0x32fe12[_0xda31('0x2d')][_0xda31('0x3a')]){_0x3bbc73['include']=[{'all':!![]}];}_0x3bbc73=_[_0xda31('0x37')]({},_0x3bbc73,_0x32fe12[_0xda31('0x39')]);return db['ChatTransferReport'][_0xda31('0x42')](_0x3bbc73)[_0xda31('0x21')](handleEntityNotFound(_0x479a8c,null))[_0xda31('0x21')](respondWithResult(_0x479a8c,null))['catch'](handleError(_0x479a8c,null));};exports[_0xda31('0x43')]=function(_0x34909d,_0x3b0b7a){return db[_0xda31('0x27')][_0xda31('0x43')](_0x34909d[_0xda31('0x44')],{})[_0xda31('0x21')](respondWithResult(_0x3b0b7a,0xc9))['catch'](handleError(_0x3b0b7a,null));};exports['update']=function(_0x399a3e,_0x39249c){if(_0x399a3e[_0xda31('0x44')]['id']){delete _0x399a3e[_0xda31('0x44')]['id'];}return db['ChatTransferReport'][_0xda31('0x42')]({'where':{'id':_0x399a3e[_0xda31('0x3f')]['id']}})[_0xda31('0x21')](handleEntityNotFound(_0x39249c,null))['then'](saveUpdates(_0x399a3e[_0xda31('0x44')],null))[_0xda31('0x21')](respondWithResult(_0x39249c,null))[_0xda31('0x3d')](handleError(_0x39249c,null));};exports['destroy']=function(_0x1af2e4,_0x3b51cd){return db[_0xda31('0x27')]['find']({'where':{'id':_0x1af2e4[_0xda31('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3b51cd,null))[_0xda31('0x21')](removeEntity(_0x3b51cd,null))[_0xda31('0x3d')](handleError(_0x3b51cd,null));};exports[_0xda31('0x45')]=function(_0x4ea011,_0x812e9c){return db[_0xda31('0x27')][_0xda31('0x45')]()[_0xda31('0x21')](respondWithResult(_0x812e9c,null))[_0xda31('0x3d')](handleError(_0x812e9c,null));}; \ No newline at end of file +var _0x8b5d=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','end','stack','name','index','map','ChatTransferReport','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','find','catch','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0x8b5d,0x121));var _0xd8b5=function(_0x35b87c,_0x166a8c){_0x35b87c=_0x35b87c-0x0;var _0x24795b=_0x8b5d[_0x35b87c];return _0x24795b;};'use strict';var emlformat=require(_0xd8b5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd8b5('0x1'));var jsonpatch=require(_0xd8b5('0x2'));var rp=require(_0xd8b5('0x3'));var moment=require(_0xd8b5('0x4'));var BPromise=require(_0xd8b5('0x5'));var Mustache=require(_0xd8b5('0x6'));var util=require(_0xd8b5('0x7'));var path=require(_0xd8b5('0x8'));var sox=require('sox');var csv=require(_0xd8b5('0x9'));var ejs=require(_0xd8b5('0xa'));var fs=require('fs');var fs_extra=require(_0xd8b5('0xb'));var _=require('lodash');var squel=require(_0xd8b5('0xc'));var crypto=require('crypto');var jsforce=require(_0xd8b5('0xd'));var deskjs=require(_0xd8b5('0xe'));var toCsv=require(_0xd8b5('0x9'));var querystring=require(_0xd8b5('0xf'));var Papa=require('papaparse');var Redis=require(_0xd8b5('0x10'));var authService=require(_0xd8b5('0x11'));var qs=require(_0xd8b5('0x12'));var as=require(_0xd8b5('0x13'));var hardwareService=require(_0xd8b5('0x14'));var logger=require(_0xd8b5('0x15'))(_0xd8b5('0x16'));var utils=require(_0xd8b5('0x17'));var config=require(_0xd8b5('0x18'));var licenseUtil=require(_0xd8b5('0x19'));var db=require(_0xd8b5('0x1a'))['db'];function respondWithStatusCode(_0x3521d2,_0x3b837b){_0x3b837b=_0x3b837b||0xcc;return function(_0x359fc4){if(_0x359fc4){return _0x3521d2[_0xd8b5('0x1b')](_0x3b837b);}return _0x3521d2[_0xd8b5('0x1c')](_0x3b837b)['end']();};}function respondWithResult(_0x5aafab,_0x48f2b9){_0x48f2b9=_0x48f2b9||0xc8;return function(_0x4b22c4){if(_0x4b22c4){return _0x5aafab['status'](_0x48f2b9)[_0xd8b5('0x1d')](_0x4b22c4);}};}function respondWithFilteredResult(_0x20c349,_0x6f63bf){return function(_0x34132d){if(_0x34132d){var _0x3f37ca=typeof _0x6f63bf[_0xd8b5('0x1e')]===_0xd8b5('0x1f')&&typeof _0x6f63bf[_0xd8b5('0x20')]===_0xd8b5('0x1f');var _0x1759df=_0x34132d[_0xd8b5('0x21')];var _0x2a6ed1=_0x3f37ca?0x0:_0x6f63bf[_0xd8b5('0x1e')];var _0x476a5a=_0x3f37ca?_0x34132d['count']:_0x6f63bf[_0xd8b5('0x1e')]+_0x6f63bf[_0xd8b5('0x20')];var _0x5e43d1;if(_0x476a5a>=_0x1759df){_0x476a5a=_0x1759df;_0x5e43d1=0xc8;}else{_0x5e43d1=0xce;}_0x20c349['status'](_0x5e43d1);return _0x20c349[_0xd8b5('0x22')](_0xd8b5('0x23'),_0x2a6ed1+'-'+_0x476a5a+'/'+_0x1759df)[_0xd8b5('0x1d')](_0x34132d);}return null;};}function patchUpdates(_0x2503fc){return function(_0x153a6c){try{jsonpatch[_0xd8b5('0x24')](_0x153a6c,_0x2503fc,!![]);}catch(_0x44e6b3){return BPromise[_0xd8b5('0x25')](_0x44e6b3);}return _0x153a6c['save']();};}function saveUpdates(_0xa360e6,_0x1c4696){return function(_0x352d86){if(_0x352d86){return _0x352d86[_0xd8b5('0x26')](_0xa360e6)['then'](function(_0xe4076c){return _0xe4076c;});}return null;};}function removeEntity(_0x2212c1,_0xa63a61){return function(_0x3841b1){if(_0x3841b1){return _0x3841b1[_0xd8b5('0x27')]()[_0xd8b5('0x28')](function(){_0x2212c1[_0xd8b5('0x1c')](0xcc)[_0xd8b5('0x29')]();});}};}function handleEntityNotFound(_0x1fb0d1,_0x4facce){return function(_0x428d6d){if(!_0x428d6d){_0x1fb0d1[_0xd8b5('0x1b')](0x194);}return _0x428d6d;};}function handleError(_0x1a421f,_0x20c94f){_0x20c94f=_0x20c94f||0x1f4;return function(_0x5da165){logger['error'](_0x5da165[_0xd8b5('0x2a')]);if(_0x5da165[_0xd8b5('0x2b')]){delete _0x5da165[_0xd8b5('0x2b')];}_0x1a421f[_0xd8b5('0x1c')](_0x20c94f)['send'](_0x5da165);};}exports[_0xd8b5('0x2c')]=function(_0x3b0fbb,_0x421be6){var _0x4f04c9={},_0x8fc85b={},_0x735523={'count':0x0,'rows':[]};var _0x2d665e=_[_0xd8b5('0x2d')](db[_0xd8b5('0x2e')][_0xd8b5('0x2f')],function(_0x1974d4){return{'name':_0x1974d4[_0xd8b5('0x30')],'type':_0x1974d4['type']['key']};});_0x8fc85b[_0xd8b5('0x31')]=_[_0xd8b5('0x2d')](_0x2d665e,'name');_0x8fc85b[_0xd8b5('0x32')]=_[_0xd8b5('0x33')](_0x3b0fbb['query']);_0x8fc85b[_0xd8b5('0x34')]=_[_0xd8b5('0x35')](_0x8fc85b[_0xd8b5('0x31')],_0x8fc85b[_0xd8b5('0x32')]);_0x4f04c9[_0xd8b5('0x36')]=_[_0xd8b5('0x35')](_0x8fc85b['model'],qs['fields'](_0x3b0fbb[_0xd8b5('0x32')][_0xd8b5('0x37')]));_0x4f04c9[_0xd8b5('0x36')]=_0x4f04c9['attributes']['length']?_0x4f04c9[_0xd8b5('0x36')]:_0x8fc85b['model'];if(!_0x3b0fbb[_0xd8b5('0x32')][_0xd8b5('0x38')]('nolimit')){_0x4f04c9[_0xd8b5('0x20')]=qs[_0xd8b5('0x20')](_0x3b0fbb[_0xd8b5('0x32')][_0xd8b5('0x20')]);_0x4f04c9[_0xd8b5('0x1e')]=qs[_0xd8b5('0x1e')](_0x3b0fbb[_0xd8b5('0x32')][_0xd8b5('0x1e')]);}_0x4f04c9[_0xd8b5('0x39')]=qs[_0xd8b5('0x3a')](_0x3b0fbb[_0xd8b5('0x32')][_0xd8b5('0x3a')]);_0x4f04c9[_0xd8b5('0x3b')]=qs[_0xd8b5('0x34')](_[_0xd8b5('0x3c')](_0x3b0fbb['query'],_0x8fc85b[_0xd8b5('0x34')]),_0x2d665e);if(_0x3b0fbb[_0xd8b5('0x32')][_0xd8b5('0x3d')]){_0x4f04c9['where']=_[_0xd8b5('0x3e')](_0x4f04c9[_0xd8b5('0x3b')],{'$or':_[_0xd8b5('0x2d')](_0x2d665e,function(_0x315050){if(_0x315050[_0xd8b5('0x3f')]!==_0xd8b5('0x40')){var _0x25eeec={};_0x25eeec[_0x315050['name']]={'$like':'%'+_0x3b0fbb[_0xd8b5('0x32')][_0xd8b5('0x3d')]+'%'};return _0x25eeec;}})});}_0x4f04c9=_[_0xd8b5('0x3e')]({},_0x4f04c9,_0x3b0fbb[_0xd8b5('0x41')]);var _0x335de7={'where':_0x4f04c9[_0xd8b5('0x3b')]};return db[_0xd8b5('0x2e')]['count'](_0x335de7)[_0xd8b5('0x28')](function(_0x2acf9b){_0x735523['count']=_0x2acf9b;if(_0x3b0fbb[_0xd8b5('0x32')][_0xd8b5('0x42')]){_0x4f04c9[_0xd8b5('0x43')]=[{'all':!![]}];}return db[_0xd8b5('0x2e')][_0xd8b5('0x44')](_0x4f04c9);})[_0xd8b5('0x28')](function(_0x34d6fb){_0x735523[_0xd8b5('0x45')]=_0x34d6fb;return _0x735523;})['then'](respondWithFilteredResult(_0x421be6,_0x4f04c9))['catch'](handleError(_0x421be6,null));};exports[_0xd8b5('0x46')]=function(_0x5388d5,_0xa32962){var _0x1b8fa5={'raw':!![],'where':{'id':_0x5388d5[_0xd8b5('0x47')]['id']}},_0x29b596={};_0x29b596[_0xd8b5('0x31')]=_['keys'](db[_0xd8b5('0x2e')]['rawAttributes']);_0x29b596[_0xd8b5('0x32')]=_['keys'](_0x5388d5[_0xd8b5('0x32')]);_0x29b596[_0xd8b5('0x34')]=_[_0xd8b5('0x35')](_0x29b596[_0xd8b5('0x31')],_0x29b596[_0xd8b5('0x32')]);_0x1b8fa5['attributes']=_[_0xd8b5('0x35')](_0x29b596[_0xd8b5('0x31')],qs[_0xd8b5('0x37')](_0x5388d5['query'][_0xd8b5('0x37')]));_0x1b8fa5[_0xd8b5('0x36')]=_0x1b8fa5[_0xd8b5('0x36')][_0xd8b5('0x48')]?_0x1b8fa5[_0xd8b5('0x36')]:_0x29b596[_0xd8b5('0x31')];if(_0x5388d5[_0xd8b5('0x32')][_0xd8b5('0x42')]){_0x1b8fa5[_0xd8b5('0x43')]=[{'all':!![]}];}_0x1b8fa5=_[_0xd8b5('0x3e')]({},_0x1b8fa5,_0x5388d5['options']);return db[_0xd8b5('0x2e')][_0xd8b5('0x49')](_0x1b8fa5)['then'](handleEntityNotFound(_0xa32962,null))[_0xd8b5('0x28')](respondWithResult(_0xa32962,null))[_0xd8b5('0x4a')](handleError(_0xa32962,null));};exports['create']=function(_0x21780f,_0x507c60){return db[_0xd8b5('0x2e')]['create'](_0x21780f[_0xd8b5('0x4b')],{})['then'](respondWithResult(_0x507c60,0xc9))[_0xd8b5('0x4a')](handleError(_0x507c60,null));};exports[_0xd8b5('0x26')]=function(_0x3cd326,_0x1690aa){if(_0x3cd326[_0xd8b5('0x4b')]['id']){delete _0x3cd326[_0xd8b5('0x4b')]['id'];}return db[_0xd8b5('0x2e')][_0xd8b5('0x49')]({'where':{'id':_0x3cd326[_0xd8b5('0x47')]['id']}})['then'](handleEntityNotFound(_0x1690aa,null))['then'](saveUpdates(_0x3cd326[_0xd8b5('0x4b')],null))[_0xd8b5('0x28')](respondWithResult(_0x1690aa,null))[_0xd8b5('0x4a')](handleError(_0x1690aa,null));};exports[_0xd8b5('0x27')]=function(_0x2a7f04,_0x14b903){return db[_0xd8b5('0x2e')][_0xd8b5('0x49')]({'where':{'id':_0x2a7f04[_0xd8b5('0x47')]['id']}})[_0xd8b5('0x28')](handleEntityNotFound(_0x14b903,null))[_0xd8b5('0x28')](removeEntity(_0x14b903,null))[_0xd8b5('0x4a')](handleError(_0x14b903,null));};exports['describe']=function(_0x4ad541,_0x5e00e2){return db[_0xd8b5('0x2e')][_0xd8b5('0x4c')]()[_0xd8b5('0x28')](respondWithResult(_0x5e00e2,null))[_0xd8b5('0x4a')](handleError(_0x5e00e2,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index da6c4ff..c73bfe3 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 _0x8094=['uniqueid','lodash','util','api','moment','request-promise','path','rimraf','./chatTransferReport.attributes','exports','define','report_chat_transfer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8094,0x79));var _0x4809=function(_0x355ce8,_0x5f1d0a){_0x355ce8=_0x355ce8-0x0;var _0x1db8b8=_0x8094[_0x355ce8];return _0x1db8b8;};'use strict';var _=require(_0x4809('0x0'));var util=require(_0x4809('0x1'));var logger=require('../../config/logger')(_0x4809('0x2'));var moment=require(_0x4809('0x3'));var BPromise=require('bluebird');var rp=require(_0x4809('0x4'));var fs=require('fs');var path=require(_0x4809('0x5'));var rimraf=require(_0x4809('0x6'));var config=require('../../config/environment');var attributes=require(_0x4809('0x7'));module[_0x4809('0x8')]=function(_0x37ebcb,_0x3dd0a4){return _0x37ebcb[_0x4809('0x9')]('ChatTransferReport',attributes,{'tableName':_0x4809('0xa'),'paranoid':![],'indexes':[{'name':_0x4809('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xe4fe=['./chatTransferReport.attributes','exports','ChatTransferReport','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x21a3e5,_0xe6c66b){var _0x21d28d=function(_0x5a2782){while(--_0x5a2782){_0x21a3e5['push'](_0x21a3e5['shift']());}};_0x21d28d(++_0xe6c66b);}(_0xe4fe,0xfb));var _0xee4f=function(_0x3d8243,_0x431106){_0x3d8243=_0x3d8243-0x0;var _0x140fb4=_0xe4fe[_0x3d8243];return _0x140fb4;};'use strict';var _=require(_0xee4f('0x0'));var util=require(_0xee4f('0x1'));var logger=require(_0xee4f('0x2'))('api');var moment=require(_0xee4f('0x3'));var BPromise=require(_0xee4f('0x4'));var rp=require(_0xee4f('0x5'));var fs=require('fs');var path=require(_0xee4f('0x6'));var rimraf=require(_0xee4f('0x7'));var config=require(_0xee4f('0x8'));var attributes=require(_0xee4f('0x9'));module[_0xee4f('0xa')]=function(_0x39d50f,_0x15febd){return _0x39d50f['define'](_0xee4f('0xb'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xee4f('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 8e067f0..1b4a846 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 _0x4912=['info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x5f496e,_0x4a0916){var _0x3ef287=function(_0x48bdc7){while(--_0x48bdc7){_0x5f496e['push'](_0x5f496e['shift']());}};_0x3ef287(++_0x4a0916);}(_0x4912,0xcb));var _0x2491=function(_0xa00e01,_0x51106d){_0xa00e01=_0xa00e01-0x0;var _0x9d6578=_0x4912[_0xa00e01];return _0x9d6578;};'use strict';var _=require(_0x2491('0x0'));var util=require(_0x2491('0x1'));var moment=require(_0x2491('0x2'));var BPromise=require(_0x2491('0x3'));var rs=require(_0x2491('0x4'));var fs=require('fs');var Redis=require(_0x2491('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2491('0x6'))(_0x2491('0x7'));var config=require(_0x2491('0x8'));var jayson=require(_0x2491('0x9'));var client=jayson[_0x2491('0xa')][_0x2491('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3b8a50,_0x2e43ff,_0x4ff048){return new BPromise(function(_0x87128d,_0x312496){return client['request'](_0x3b8a50,_0x4ff048)[_0x2491('0xc')](function(_0x2952cc){logger[_0x2491('0xd')](_0x2491('0xe'),_0x2e43ff,_0x2491('0xf'));logger[_0x2491('0x10')](_0x2491('0x11'),_0x2e43ff,'request\x20sent',JSON[_0x2491('0x12')](_0x2952cc));if(_0x2952cc['error']){if(_0x2952cc[_0x2491('0x13')][_0x2491('0x14')]===0x1f4){logger[_0x2491('0x13')](_0x2491('0xe'),_0x2e43ff,_0x2952cc[_0x2491('0x13')]['message']);return _0x312496(_0x2952cc[_0x2491('0x13')][_0x2491('0x15')]);}logger[_0x2491('0x13')](_0x2491('0xe'),_0x2e43ff,_0x2952cc[_0x2491('0x13')]['message']);return _0x87128d(_0x2952cc[_0x2491('0x13')][_0x2491('0x15')]);}else{logger[_0x2491('0xd')](_0x2491('0xe'),_0x2e43ff,_0x2491('0xf'));_0x87128d(_0x2952cc[_0x2491('0x16')][_0x2491('0x15')]);}})[_0x2491('0x17')](function(_0x183be5){logger[_0x2491('0x13')]('ChatTransferReport,\x20%s,\x20%s',_0x2e43ff,_0x183be5);_0x312496(_0x183be5);});});} \ No newline at end of file +var _0x6c47=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatTransferReport,\x20%s,\x20%s','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x6c47,0x1de));var _0x76c4=function(_0x60076f,_0x1d13b6){_0x60076f=_0x60076f-0x0;var _0x48b909=_0x6c47[_0x60076f];return _0x48b909;};'use strict';var _=require(_0x76c4('0x0'));var util=require(_0x76c4('0x1'));var moment=require(_0x76c4('0x2'));var BPromise=require(_0x76c4('0x3'));var rs=require(_0x76c4('0x4'));var fs=require('fs');var Redis=require(_0x76c4('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x76c4('0x6'));var logger=require(_0x76c4('0x7'))(_0x76c4('0x8'));var config=require(_0x76c4('0x9'));var jayson=require(_0x76c4('0xa'));var client=jayson[_0x76c4('0xb')][_0x76c4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x347ab0,_0x405ca2,_0x50790c){return new BPromise(function(_0x3a08d5,_0x301c2c){return client['request'](_0x347ab0,_0x50790c)[_0x76c4('0xd')](function(_0x6441f3){logger[_0x76c4('0xe')](_0x76c4('0xf'),_0x405ca2,'request\x20sent');logger['debug'](_0x76c4('0x10'),_0x405ca2,'request\x20sent',JSON[_0x76c4('0x11')](_0x6441f3));if(_0x6441f3[_0x76c4('0x12')]){if(_0x6441f3[_0x76c4('0x12')][_0x76c4('0x13')]===0x1f4){logger[_0x76c4('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x405ca2,_0x6441f3[_0x76c4('0x12')][_0x76c4('0x14')]);return _0x301c2c(_0x6441f3['error'][_0x76c4('0x14')]);}logger[_0x76c4('0x12')](_0x76c4('0xf'),_0x405ca2,_0x6441f3[_0x76c4('0x12')]['message']);return _0x3a08d5(_0x6441f3['error'][_0x76c4('0x14')]);}else{logger[_0x76c4('0xe')](_0x76c4('0xf'),_0x405ca2,_0x76c4('0x15'));_0x3a08d5(_0x6441f3[_0x76c4('0x16')][_0x76c4('0x14')]);}})[_0x76c4('0x17')](function(_0x37c999){logger[_0x76c4('0x12')](_0x76c4('0xf'),_0x405ca2,_0x37c999);_0x301c2c(_0x37c999);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 7b406b4..78cfdeb 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 _0x297c=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','exports','multer','util','path','express','Router','fs-extra'];(function(_0x34c542,_0x220b05){var _0x5b9ec2=function(_0x51dc4f){while(--_0x51dc4f){_0x34c542['push'](_0x34c542['shift']());}};_0x5b9ec2(++_0x220b05);}(_0x297c,0x118));var _0xc297=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x297c[_0xa1e3e3];return _0xc980e9;};'use strict';var multer=require(_0xc297('0x0'));var util=require(_0xc297('0x1'));var path=require(_0xc297('0x2'));var timeout=require('connect-timeout');var express=require(_0xc297('0x3'));var router=express[_0xc297('0x4')]();var fs_extra=require(_0xc297('0x5'));var auth=require(_0xc297('0x6'));var interaction=require(_0xc297('0x7'));var config=require(_0xc297('0x8'));var controller=require(_0xc297('0x9'));router[_0xc297('0xa')]('/',auth[_0xc297('0xb')](),controller[_0xc297('0xc')]);router[_0xc297('0xa')](_0xc297('0xd'),auth[_0xc297('0xb')](),controller[_0xc297('0xe')]);router[_0xc297('0xa')](_0xc297('0xf'),auth[_0xc297('0xb')](),controller[_0xc297('0x10')]);router[_0xc297('0x11')]('/',auth[_0xc297('0xb')](),controller[_0xc297('0x12')]);router[_0xc297('0x13')](_0xc297('0xf'),auth[_0xc297('0xb')](),controller['update']);router[_0xc297('0x14')](_0xc297('0xf'),auth[_0xc297('0xb')](),controller['destroy']);module[_0xc297('0x15')]=router; \ No newline at end of file +var _0x6b3c=['../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra'];(function(_0x1ebb10,_0x156b3e){var _0x20d709=function(_0x4cc093){while(--_0x4cc093){_0x1ebb10['push'](_0x1ebb10['shift']());}};_0x20d709(++_0x156b3e);}(_0x6b3c,0x177));var _0xc6b3=function(_0x5d959f,_0x497da4){_0x5d959f=_0x5d959f-0x0;var _0xdb15ac=_0x6b3c[_0x5d959f];return _0xdb15ac;};'use strict';var multer=require('multer');var util=require(_0xc6b3('0x0'));var path=require('path');var timeout=require(_0xc6b3('0x1'));var express=require(_0xc6b3('0x2'));var router=express[_0xc6b3('0x3')]();var fs_extra=require(_0xc6b3('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc6b3('0x5'));var config=require('../../config/environment');var controller=require('./chatTransferReport.controller');router[_0xc6b3('0x6')]('/',auth[_0xc6b3('0x7')](),controller[_0xc6b3('0x8')]);router[_0xc6b3('0x6')](_0xc6b3('0x9'),auth[_0xc6b3('0x7')](),controller[_0xc6b3('0xa')]);router[_0xc6b3('0x6')](_0xc6b3('0xb'),auth[_0xc6b3('0x7')](),controller[_0xc6b3('0xc')]);router[_0xc6b3('0xd')]('/',auth[_0xc6b3('0x7')](),controller['create']);router[_0xc6b3('0xe')](_0xc6b3('0xb'),auth[_0xc6b3('0x7')](),controller[_0xc6b3('0xf')]);router[_0xc6b3('0x10')](_0xc6b3('0xb'),auth[_0xc6b3('0x7')](),controller[_0xc6b3('0x11')]);module[_0xc6b3('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 5b4b468..c7d5fc8 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 _0xea92=['onlineForm','textarea','Comments','offlineForm','setDataValue','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:','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','alternate','#fafafa','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}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','rounded','squared','We\x20are\x20here!','Send','BOOLEAN','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Thanks\x20you\x20for\x20your\x20time!','Skip','ENUM','thumb','star','stringify','input','name','text','getDataValue','parse'];(function(_0x3a624f,_0x2ec14a){var _0x4d87e3=function(_0x5675b6){while(--_0x5675b6){_0x3a624f['push'](_0x3a624f['shift']());}};_0x4d87e3(++_0x2ec14a);}(_0xea92,0xe1));var _0x2ea9=function(_0x347b75,_0x14f005){_0x347b75=_0x347b75-0x0;var _0x3da27b=_0xea92[_0x347b75];return _0x3da27b;};'use strict';var Sequelize=require(_0x2ea9('0x0'));var rs=require(_0x2ea9('0x1'));module[_0x2ea9('0x2')]={'name':{'type':Sequelize[_0x2ea9('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x2ea9('0x4')},'description':{'type':Sequelize[_0x2ea9('0x3')]},'mapKey':{'type':Sequelize[_0x2ea9('0x3')],'defaultValue':_0x2ea9('0x5')},'mapKeyOffline':{'type':Sequelize[_0x2ea9('0x3')],'defaultValue':_0x2ea9('0x5')},'key':{'type':Sequelize[_0x2ea9('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x2ea9('0x3')],'defaultValue':_0x2ea9('0x6')},'customerAlias':{'type':Sequelize[_0x2ea9('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2ea9('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x2ea9('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x2ea9('0x3')],'allowNull':![],'defaultValue':_0x2ea9('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x2ea9('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x2ea9('0x3')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x2ea9('0xa'),_0x2ea9('0xb')),'defaultValue':_0x2ea9('0xa')},'header_online':{'type':Sequelize[_0x2ea9('0x3')],'defaultValue':_0x2ea9('0xc')},'start_chat_button':{'type':Sequelize[_0x2ea9('0x3')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x2ea9('0x3')],'defaultValue':_0x2ea9('0xd')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x2ea9('0xe')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x2ea9('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x2ea9('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0x2ea9('0xe')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x2ea9('0x10')]},'closingQuestion':{'type':Sequelize[_0x2ea9('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x2ea9('0x3')],'defaultValue':_0x2ea9('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0x2ea9('0x3')],'defaultValue':_0x2ea9('0x12')},'noteTitle':{'type':Sequelize[_0x2ea9('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x2ea9('0x3')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x2ea9('0x3')],'defaultValue':_0x2ea9('0x13')},'closingMessageButton':{'type':Sequelize[_0x2ea9('0x3')],'defaultValue':_0x2ea9('0xd')},'skipMessageButton':{'type':Sequelize[_0x2ea9('0x3')],'defaultValue':_0x2ea9('0x14')},'conditionAgreement':{'type':Sequelize[_0x2ea9('0xe')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x2ea9('0xe')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x2ea9('0xe')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x2ea9('0x3')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x2ea9('0x15')]('star',_0x2ea9('0x16')),'defaultValue':_0x2ea9('0x17')},'ratingStarsNumber':{'type':Sequelize[_0x2ea9('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x2ea9('0x10')],'defaultValue':function(){return JSON[_0x2ea9('0x18')]({'items':[{'type':_0x2ea9('0x19'),'variable':null,'config':{'placeholder':_0x2ea9('0x1a'),'type':_0x2ea9('0x1b'),'required':!![]},'props':{'title':_0x2ea9('0x1a'),'helpText':''}},{'type':_0x2ea9('0x19'),'props':{'title':_0x2ea9('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x2ea9('0x5'),'type':_0x2ea9('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x2ea9('0x1c')]('onlineForm')?JSON[_0x2ea9('0x1d')](this[_0x2ea9('0x1c')](_0x2ea9('0x1e'))):{};},'set':function(_0x1c984d){return this['setDataValue'](_0x2ea9('0x1e'),JSON[_0x2ea9('0x18')](_0x1c984d));}},'offlineForm':{'type':Sequelize[_0x2ea9('0x10')],'defaultValue':function(){return JSON[_0x2ea9('0x18')]({'items':[{'type':'input','props':{'title':_0x2ea9('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x2ea9('0x5'),'type':_0x2ea9('0x5')},'variable':null},{'type':_0x2ea9('0x1f'),'config':{'placeholder':_0x2ea9('0x20')},'props':{'title':_0x2ea9('0x20'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x2ea9('0x1c')](_0x2ea9('0x21'))?JSON[_0x2ea9('0x1d')](this['getDataValue']('offlineForm')):{};},'set':function(_0x38e3ba){return this[_0x2ea9('0x22')]('offlineForm',JSON['stringify'](_0x38e3ba));}},'token':{'type':Sequelize[_0x2ea9('0x3')],'defaultValue':function(){return rs[_0x2ea9('0x23')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x2ea9('0xe')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x2ea9('0xe')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x2ea9('0x3')],'defaultValue':_0x2ea9('0x24')},'waitingMessage':{'type':Sequelize[_0x2ea9('0x3')],'defaultValue':_0x2ea9('0x25')},'offlineMessageSubject':{'type':Sequelize[_0x2ea9('0x3')],'defaultValue':_0x2ea9('0x26')},'offlineMessageBody':{'type':Sequelize[_0x2ea9('0x3')],'defaultValue':_0x2ea9('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0x2ea9('0xe')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x2ea9('0x3')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x2ea9('0x3')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x2ea9('0x3')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x2ea9('0xe')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x2ea9('0x10')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x2ea9('0x3')]},'notificationTemplate':{'type':Sequelize[_0x2ea9('0x10')],'defaultValue':function(){return _0x2ea9('0x28');}},'notificationSound':{'type':Sequelize[_0x2ea9('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2ea9('0xe')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x2ea9('0x3')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x2ea9('0x3')],'defaultValue':_0x2ea9('0x29')},'verticalAlignment':{'type':Sequelize[_0x2ea9('0x9')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x2ea9('0x3')],'defaultValue':_0x2ea9('0x2a')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x2ea9('0x2b')},'defaultTitle':{'type':Sequelize[_0x2ea9('0x3')]},'customerAvatar':{'type':Sequelize[_0x2ea9('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0x2ea9('0xe')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x2ea9('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2ea9('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x2ea9('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2ea9('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2ea9('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':'System'},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2ea9('0x9')],'comment':_0x2ea9('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0x2ea9('0xe')],'defaultValue':![],'comment':_0x2ea9('0x2e'),'set':function(_0x518cae){if(!_0x518cae)this[_0x2ea9('0x22')](_0x2ea9('0x2f'),null);this['setDataValue'](_0x2ea9('0x30'),_0x518cae);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x2ea9('0x3')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2ea9('0x31')},'vidaooNote':{'type':Sequelize[_0x2ea9('0x3')],'defaultValue':function(){return _0x2ea9('0x32');}},'vidaooMetadata':{'type':Sequelize[_0x2ea9('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x2ea9('0xe')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x2ea9('0x10')]}}; \ No newline at end of file +var _0x06c3=['BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','thumb','INTEGER','stringify','input','text','name','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.','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','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','randomstring','STRING','address','email','Agent','#011F6A'];(function(_0x1e5d40,_0x193c71){var _0x12d39b=function(_0x1a0736){while(--_0x1a0736){_0x1e5d40['push'](_0x1e5d40['shift']());}};_0x12d39b(++_0x193c71);}(_0x06c3,0x98));var _0x306c=function(_0x2b6c50,_0x2dd5d0){_0x2b6c50=_0x2b6c50-0x0;var _0xb486e3=_0x06c3[_0x2b6c50];return _0xb486e3;};'use strict';var Sequelize=require(_0x306c('0x0'));var rs=require(_0x306c('0x1'));module['exports']={'name':{'type':Sequelize[_0x306c('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x306c('0x2')],'allowNull':![],'unique':_0x306c('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x306c('0x2')],'defaultValue':_0x306c('0x4')},'mapKeyOffline':{'type':Sequelize[_0x306c('0x2')],'defaultValue':_0x306c('0x4')},'key':{'type':Sequelize[_0x306c('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x306c('0x5')},'customerAlias':{'type':Sequelize[_0x306c('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x306c('0x2')],'allowNull':![],'defaultValue':_0x306c('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x306c('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x306c('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x306c('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x306c('0x8')](_0x306c('0x9'),_0x306c('0xa')),'defaultValue':_0x306c('0x9')},'header_online':{'type':Sequelize[_0x306c('0x2')],'defaultValue':_0x306c('0xb')},'start_chat_button':{'type':Sequelize[_0x306c('0x2')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x306c('0x2')],'defaultValue':_0x306c('0xc')},'header_offline':{'type':Sequelize[_0x306c('0x2')],'defaultValue':_0x306c('0xd')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x306c('0x2')],'defaultValue':_0x306c('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0x306c('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x306c('0xf')]},'closingQuestion':{'type':Sequelize[_0x306c('0x2')],'defaultValue':_0x306c('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0x306c('0x2')],'defaultValue':_0x306c('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0x306c('0x2')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x306c('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x306c('0x12')},'closingMessage':{'type':Sequelize[_0x306c('0x2')],'defaultValue':_0x306c('0x13')},'closingMessageButton':{'type':Sequelize[_0x306c('0x2')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x306c('0x2')],'defaultValue':_0x306c('0x14')},'conditionAgreement':{'type':Sequelize[_0x306c('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x306c('0x2')],'defaultValue':_0x306c('0x15')},'ratingType':{'type':Sequelize[_0x306c('0x8')]('star',_0x306c('0x16')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x306c('0x17')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x306c('0xf')],'defaultValue':function(){return JSON[_0x306c('0x18')]({'items':[{'type':_0x306c('0x19'),'variable':null,'config':{'placeholder':'name','type':_0x306c('0x1a'),'required':!![]},'props':{'title':_0x306c('0x1b'),'helpText':''}},{'type':_0x306c('0x19'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x306c('0x4'),'type':_0x306c('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x306c('0x1c')](_0x306c('0x1d'))?JSON[_0x306c('0x1e')](this[_0x306c('0x1c')](_0x306c('0x1d'))):{};},'set':function(_0x4e9304){return this[_0x306c('0x1f')](_0x306c('0x1d'),JSON[_0x306c('0x18')](_0x4e9304));}},'offlineForm':{'type':Sequelize[_0x306c('0xf')],'defaultValue':function(){return JSON[_0x306c('0x18')]({'items':[{'type':_0x306c('0x19'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x306c('0x4'),'type':'email'},'variable':null},{'type':_0x306c('0x20'),'config':{'placeholder':'Comments'},'props':{'title':_0x306c('0x21'),'helpText':_0x306c('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0x306c('0x1c')](_0x306c('0x23'))?JSON[_0x306c('0x1e')](this[_0x306c('0x1c')](_0x306c('0x23'))):{};},'set':function(_0x193e2f){return this[_0x306c('0x1f')](_0x306c('0x23'),JSON[_0x306c('0x18')](_0x193e2f));}},'token':{'type':Sequelize[_0x306c('0x2')],'defaultValue':function(){return rs[_0x306c('0x24')]();}},'autoclose':{'type':Sequelize[_0x306c('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x306c('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x306c('0x2')]},'forwardOffline':{'type':Sequelize[_0x306c('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x306c('0x2')]},'waitingTitle':{'type':Sequelize[_0x306c('0x2')],'defaultValue':_0x306c('0x25')},'waitingMessage':{'type':Sequelize[_0x306c('0x2')],'defaultValue':_0x306c('0x26')},'offlineMessageSubject':{'type':Sequelize[_0x306c('0x2')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x306c('0x2')],'defaultValue':_0x306c('0x27')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x306c('0x2')],'defaultValue':_0x306c('0x28')},'skipUnmanaged':{'type':Sequelize[_0x306c('0x2')],'defaultValue':_0x306c('0x14')},'sendUnmanaged':{'type':Sequelize[_0x306c('0x2')],'defaultValue':_0x306c('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0x306c('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x306c('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x306c('0xf')]},'showAgentAvatar':{'type':Sequelize[_0x306c('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x306c('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x306c('0x29');}},'notificationSound':{'type':Sequelize[_0x306c('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x306c('0x2')],'defaultValue':_0x306c('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize[_0x306c('0x17')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x306c('0x2')],'defaultValue':_0x306c('0x2b')},'verticalAlignment':{'type':Sequelize[_0x306c('0x17')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x306c('0x2')],'defaultValue':_0x306c('0x2c')},'messagesAlignment':{'type':Sequelize[_0x306c('0x2')],'defaultValue':_0x306c('0x2d')},'defaultTitle':{'type':Sequelize[_0x306c('0x2')]},'customerAvatar':{'type':Sequelize[_0x306c('0xf')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x306c('0x17')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x306c('0x2')],'allowNull':![],'defaultValue':_0x306c('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x306c('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x306c('0x17')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x306c('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x306c('0x2')],'defaultValue':_0x306c('0x2f')},'systemAvatar':{'type':Sequelize[_0x306c('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x306c('0x17')],'comment':_0x306c('0x30')},'mandatoryDisposition':{'type':Sequelize[_0x306c('0x7')],'defaultValue':![],'comment':_0x306c('0x31'),'set':function(_0x146547){if(!_0x146547)this[_0x306c('0x1f')](_0x306c('0x32'),null);this[_0x306c('0x1f')](_0x306c('0x33'),_0x146547);}},'vidaooEscalation':{'type':Sequelize[_0x306c('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x306c('0x2')]},'vidaooTopic':{'type':Sequelize[_0x306c('0x2')],'allowNull':![],'defaultValue':_0x306c('0x34')},'vidaooNote':{'type':Sequelize[_0x306c('0x2')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0x306c('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x306c('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 36f2213..8cae2b8 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 _0xac31=['removeDispositions','ids','CannedAnswer','removeAnswers','addLogo','sitepic','filename','addAvatar','agentAvatar','file','addCustomerAvatar','customerAvatar','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','join','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','systemAvatar','notify','user-agent-parser','getResult','CmContact','difference','createdAt','updatedAt','CompanyId','ListId','Sequelize','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','from','CmList','Contacts','DESC','ChatApplication','Applications','applications','list','List','orderBy','account','contact','headers','cf-connecting-ip','first','split','lastName','x-real-port','referer','browser','version','format','unknown','%s\x20%s','device','vendor','threadId','ChatInteraction','externalUrl','interaction','spread','firstName','messageId','created','autoclose','push','close','unmanaged','ChatMessage','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','startRouting','Start','EventManager','files','no\x20available\x20attributes','from\x20is\x20mandatory','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','offlineMessageBody','ChatOfflineMessage','fromString','originalname','server','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','MailServerOut','CloudProvider','forwardOffline','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','MailAccountId','mimetype','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','attachments','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Owner','fullname','internal','Tag','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','virtual','License','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','remote','x-forwarded-for','x-real-ip','connection','remoteAddress','replace','color','labelText','textColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','priority','getApplications','addProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','items','fromKey','getOfflineMessages','Contact','Attachments','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','ejs','fs-extra','lodash','ioredis','../../components/parsers/qs','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','html-to-text','client','http','request','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ChatWebsite,\x20%s,\x20%s','sendStatus','status','json','offset','count','limit','set','Content-Range','update','destroy','get','ChatWebsites','UserProfileResource','then','end','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','body','describe','ChatWebsiteId','Disposition','getDispositions','findOne','pick','includeAll'];(function(_0x224096,_0x2f3b76){var _0x3e69f9=function(_0x378a99){while(--_0x378a99){_0x224096['push'](_0x224096['shift']());}};_0x3e69f9(++_0x2f3b76);}(_0xac31,0xca));var _0x1ac3=function(_0x8cf20e,_0x4c0982){_0x8cf20e=_0x8cf20e-0x0;var _0x3066ea=_0xac31[_0x8cf20e];return _0x3066ea;};'use strict';var BPromise=require(_0x1ac3('0x0'));var Mustache=require(_0x1ac3('0x1'));var util=require(_0x1ac3('0x2'));var path=require(_0x1ac3('0x3'));var ejs=require(_0x1ac3('0x4'));var fs=require('fs');var fs_extra=require(_0x1ac3('0x5'));var _=require(_0x1ac3('0x6'));var querystring=require('querystring');var Redis=require(_0x1ac3('0x7'));var qs=require(_0x1ac3('0x8'));var logger=require('../../config/logger')('api');var config=require(_0x1ac3('0x9'));var db=require(_0x1ac3('0xa'))['db'];config[_0x1ac3('0xb')]=_[_0x1ac3('0xc')](config[_0x1ac3('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x1ac3('0xd'))(new Redis(config['redis']));require(_0x1ac3('0xe'))[_0x1ac3('0xf')](socket);var htmlToText=require(_0x1ac3('0x10'));var jayson=require('jayson/promise');var client=jayson[_0x1ac3('0x11')][_0x1ac3('0x12')]({'port':0x232c});var client9002=jayson[_0x1ac3('0x11')][_0x1ac3('0x12')]({'port':0x232a});var client9003=jayson[_0x1ac3('0x11')][_0x1ac3('0x12')]({'port':0x232b});var client9001=jayson['client'][_0x1ac3('0x12')]({'port':0x2329});function respondWithRpcPromise(_0x376814,_0x2eeabf,_0x2338b9,_0x50d3b6){return new BPromise(function(_0x88ed7c,_0x37d426){var _0x46c0e9=_0x50d3b6||client;return _0x46c0e9[_0x1ac3('0x13')](_0x376814,_0x2338b9)['then'](function(_0x24bb5e){logger[_0x1ac3('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x2eeabf,_0x1ac3('0x15'));logger[_0x1ac3('0x16')](_0x1ac3('0x17'),_0x2eeabf,'request\x20sent',JSON[_0x1ac3('0x18')](_0x24bb5e));if(_0x24bb5e[_0x1ac3('0x19')]){if(_0x24bb5e[_0x1ac3('0x19')]['code']===0x1f4){logger[_0x1ac3('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x2eeabf,_0x24bb5e[_0x1ac3('0x19')][_0x1ac3('0x1a')]);return _0x37d426(_0x24bb5e[_0x1ac3('0x19')][_0x1ac3('0x1a')]);}logger[_0x1ac3('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x2eeabf,_0x24bb5e[_0x1ac3('0x19')][_0x1ac3('0x1a')]);return _0x88ed7c(_0x24bb5e[_0x1ac3('0x19')][_0x1ac3('0x1a')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x2eeabf,_0x1ac3('0x15'));_0x88ed7c(_0x24bb5e[_0x1ac3('0x1b')][_0x1ac3('0x1a')]);}})[_0x1ac3('0x1c')](function(_0x2aff34){logger[_0x1ac3('0x19')](_0x1ac3('0x1d'),_0x2eeabf,_0x2aff34);_0x37d426(_0x2aff34);});});}function respondWithStatusCode(_0x10912a,_0x3d30b8){_0x3d30b8=_0x3d30b8||0xcc;return function(_0x565141){if(_0x565141){return _0x10912a[_0x1ac3('0x1e')](_0x3d30b8);}return _0x10912a[_0x1ac3('0x1f')](_0x3d30b8)['end']();};}function respondWithResult(_0x2b5182,_0x10f30c){_0x10f30c=_0x10f30c||0xc8;return function(_0x5eee48){if(_0x5eee48){return _0x2b5182[_0x1ac3('0x1f')](_0x10f30c)[_0x1ac3('0x20')](_0x5eee48);}};}function respondWithFilteredResult(_0x145486,_0x2dfdb7){return function(_0x10db3d){if(_0x10db3d){var _0x565a0f=typeof _0x2dfdb7['offset']==='undefined'&&typeof _0x2dfdb7['limit']==='undefined';var _0x3ea482=_0x10db3d['count'];var _0x424b68=_0x565a0f?0x0:_0x2dfdb7[_0x1ac3('0x21')];var _0x4243e4=_0x565a0f?_0x10db3d[_0x1ac3('0x22')]:_0x2dfdb7['offset']+_0x2dfdb7[_0x1ac3('0x23')];var _0x541da0;if(_0x4243e4>=_0x3ea482){_0x4243e4=_0x3ea482;_0x541da0=0xc8;}else{_0x541da0=0xce;}_0x145486[_0x1ac3('0x1f')](_0x541da0);return _0x145486[_0x1ac3('0x24')](_0x1ac3('0x25'),_0x424b68+'-'+_0x4243e4+'/'+_0x3ea482)[_0x1ac3('0x20')](_0x10db3d);}return null;};}function saveUpdates(_0x22da8d){return function(_0xc3f097){if(_0xc3f097){return _0xc3f097[_0x1ac3('0x26')](_0x22da8d)['then'](function(_0x2248b6){return _0x2248b6;});}return null;};}function removeEntity(_0x3b4c65){return function(_0x434781){if(_0x434781){return _0x434781[_0x1ac3('0x27')]()['then'](function(){var _0x3591a9=_0x434781[_0x1ac3('0x28')]({'plain':!![]});var _0xce0836=_0x1ac3('0x29');return db[_0x1ac3('0x2a')]['destroy']({'where':{'type':_0xce0836,'resourceId':_0x3591a9['id']}})[_0x1ac3('0x2b')](function(){return _0x434781;});})[_0x1ac3('0x2b')](function(){_0x3b4c65[_0x1ac3('0x1f')](0xcc)[_0x1ac3('0x2c')]();});}};}function handleEntityNotFound(_0x1a47d4){return function(_0x43362a){if(!_0x43362a){_0x1a47d4['sendStatus'](0x194);}return _0x43362a;};}function handleError(_0x2102a1,_0x174a53){_0x174a53=_0x174a53||0x1f4;return function(_0x431f11){logger[_0x1ac3('0x19')](_0x431f11['stack']);if(_0x431f11[_0x1ac3('0x2d')]){delete _0x431f11[_0x1ac3('0x2d')];}_0x2102a1[_0x1ac3('0x1f')](_0x174a53)[_0x1ac3('0x2e')](_0x431f11);};}exports[_0x1ac3('0x2f')]=function(_0x170bb8,_0x2c171b){var _0x277b7b={'include':[{'model':db[_0x1ac3('0x30')],'as':_0x1ac3('0x31')}]},_0x30b815={},_0x5c29c1={'count':0x0,'rows':[]};var _0x4e4a20=_[_0x1ac3('0x32')](db[_0x1ac3('0x33')][_0x1ac3('0x34')],function(_0x448fb5){return{'name':_0x448fb5[_0x1ac3('0x35')],'type':_0x448fb5[_0x1ac3('0x36')][_0x1ac3('0x37')]};});_0x30b815[_0x1ac3('0x38')]=_['map'](_0x4e4a20,_0x1ac3('0x2d'));_0x30b815['query']=_[_0x1ac3('0x39')](_0x170bb8[_0x1ac3('0x3a')]);_0x30b815[_0x1ac3('0x3b')]=_[_0x1ac3('0x3c')](_0x30b815[_0x1ac3('0x38')],_0x30b815[_0x1ac3('0x3a')]);_0x277b7b['attributes']=_[_0x1ac3('0x3c')](_0x30b815[_0x1ac3('0x38')],qs[_0x1ac3('0x3d')](_0x170bb8['query'][_0x1ac3('0x3d')]));_0x277b7b[_0x1ac3('0x3e')]=_0x277b7b['attributes'][_0x1ac3('0x3f')]?_0x277b7b[_0x1ac3('0x3e')]:_0x30b815[_0x1ac3('0x38')];if(!_0x170bb8[_0x1ac3('0x3a')][_0x1ac3('0x40')](_0x1ac3('0x41'))){_0x277b7b[_0x1ac3('0x23')]=qs[_0x1ac3('0x23')](_0x170bb8['query'][_0x1ac3('0x23')]);_0x277b7b[_0x1ac3('0x21')]=qs[_0x1ac3('0x21')](_0x170bb8[_0x1ac3('0x3a')][_0x1ac3('0x21')]);}_0x277b7b[_0x1ac3('0x42')]=qs[_0x1ac3('0x43')](_0x170bb8['query']['sort']);_0x277b7b[_0x1ac3('0x44')]=qs[_0x1ac3('0x3b')](_['pick'](_0x170bb8[_0x1ac3('0x3a')],_0x30b815[_0x1ac3('0x3b')]),_0x4e4a20);if(_0x170bb8['query'][_0x1ac3('0x45')]){_0x277b7b['where']=_[_0x1ac3('0x46')](_0x277b7b[_0x1ac3('0x44')],{'$or':_[_0x1ac3('0x32')](_0x4e4a20,function(_0xac1946){if(_0xac1946['type']!==_0x1ac3('0x47')){var _0x1550c8={};_0x1550c8[_0xac1946[_0x1ac3('0x2d')]]={'$like':'%'+_0x170bb8[_0x1ac3('0x3a')][_0x1ac3('0x45')]+'%'};return _0x1550c8;}})});}_0x277b7b=_['merge']({},_0x277b7b,_0x170bb8[_0x1ac3('0x48')]);var _0x842f83={'where':_0x277b7b[_0x1ac3('0x44')]};return db[_0x1ac3('0x33')]['count'](_0x842f83)[_0x1ac3('0x2b')](function(_0x2b6195){_0x5c29c1[_0x1ac3('0x22')]=_0x2b6195;if(_0x170bb8[_0x1ac3('0x3a')]['includeAll']){_0x277b7b[_0x1ac3('0x49')]=[{'all':!![]}];}return db[_0x1ac3('0x33')][_0x1ac3('0x4a')](_0x277b7b);})[_0x1ac3('0x2b')](function(_0x5cfd01){_0x5c29c1[_0x1ac3('0x4b')]=_0x5cfd01;return _0x5c29c1;})['then'](respondWithFilteredResult(_0x2c171b,_0x277b7b))[_0x1ac3('0x1c')](handleError(_0x2c171b,null));};exports[_0x1ac3('0x4c')]=function(_0x2e3347,_0x1179c7){var _0xf5fd1b={'raw':![],'where':{'id':_0x2e3347[_0x1ac3('0x4d')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x35ae09={};_0x35ae09[_0x1ac3('0x38')]=_[_0x1ac3('0x39')](db[_0x1ac3('0x33')]['rawAttributes']);_0x35ae09['query']=_['keys'](_0x2e3347[_0x1ac3('0x3a')]);_0x35ae09[_0x1ac3('0x3b')]=_['intersection'](_0x35ae09[_0x1ac3('0x38')],_0x35ae09[_0x1ac3('0x3a')]);_0xf5fd1b[_0x1ac3('0x3e')]=_[_0x1ac3('0x3c')](_0x35ae09['model'],qs['fields'](_0x2e3347[_0x1ac3('0x3a')][_0x1ac3('0x3d')]));_0xf5fd1b['attributes']=_0xf5fd1b[_0x1ac3('0x3e')]['length']?_0xf5fd1b['attributes']:_0x35ae09[_0x1ac3('0x38')];if(_0x2e3347[_0x1ac3('0x3a')]['includeAll']){_0xf5fd1b[_0x1ac3('0x49')]=[{'all':!![]}];}_0xf5fd1b=_['merge']({},_0xf5fd1b,_0x2e3347[_0x1ac3('0x48')]);return db[_0x1ac3('0x33')][_0x1ac3('0x4e')](_0xf5fd1b)[_0x1ac3('0x2b')](handleEntityNotFound(_0x1179c7,null))[_0x1ac3('0x2b')](respondWithResult(_0x1179c7,null))[_0x1ac3('0x1c')](handleError(_0x1179c7,null));};exports[_0x1ac3('0x4f')]=function(_0x331374,_0xeb7e49){return db[_0x1ac3('0x33')][_0x1ac3('0x4f')](_0x331374['body'],{})['then'](function(_0x2c7d71){var _0x310eb7=_0x331374[_0x1ac3('0x50')][_0x1ac3('0x28')]({'plain':!![]});if(!_0x310eb7)throw new Error(_0x1ac3('0x51'));if(_0x310eb7[_0x1ac3('0x52')]===_0x1ac3('0x50')){var _0x36a5d9=_0x2c7d71[_0x1ac3('0x28')]({'plain':!![]});var _0x3149f6='ChatWebsites';return db[_0x1ac3('0x53')][_0x1ac3('0x4e')]({'where':{'name':_0x3149f6,'userProfileId':_0x310eb7[_0x1ac3('0x54')]},'raw':!![]})[_0x1ac3('0x2b')](function(_0x20c195){if(_0x20c195&&_0x20c195['autoAssociation']===0x0){return db[_0x1ac3('0x2a')][_0x1ac3('0x4f')]({'name':_0x36a5d9['name'],'resourceId':_0x36a5d9['id'],'type':_0x20c195['name'],'sectionId':_0x20c195['id']},{})['then'](function(){return _0x2c7d71;});}else{return _0x2c7d71;}})[_0x1ac3('0x1c')](function(_0x17ebb9){logger[_0x1ac3('0x19')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x17ebb9);throw _0x17ebb9;});}return _0x2c7d71;})[_0x1ac3('0x2b')](respondWithResult(_0xeb7e49,0xc9))['catch'](handleError(_0xeb7e49,null));};exports['update']=function(_0x52ef77,_0x597885){if(_0x52ef77[_0x1ac3('0x55')]['id']){delete _0x52ef77[_0x1ac3('0x55')]['id'];}return db[_0x1ac3('0x33')][_0x1ac3('0x4e')]({'where':{'id':_0x52ef77[_0x1ac3('0x4d')]['id']},'include':[{'model':db['Pause'],'as':_0x1ac3('0x31')}]})[_0x1ac3('0x2b')](handleEntityNotFound(_0x597885,null))['then'](saveUpdates(_0x52ef77[_0x1ac3('0x55')],null))[_0x1ac3('0x2b')](respondWithResult(_0x597885,null))[_0x1ac3('0x1c')](handleError(_0x597885,null));};exports[_0x1ac3('0x27')]=function(_0xb35638,_0x4c6cd4){return db[_0x1ac3('0x33')][_0x1ac3('0x4e')]({'where':{'id':_0xb35638[_0x1ac3('0x4d')]['id']}})[_0x1ac3('0x2b')](handleEntityNotFound(_0x4c6cd4,null))['then'](removeEntity(_0x4c6cd4,null))[_0x1ac3('0x1c')](handleError(_0x4c6cd4,null));};exports[_0x1ac3('0x56')]=function(_0x148f91,_0x2f5803){return db[_0x1ac3('0x33')][_0x1ac3('0x56')]()['then'](respondWithResult(_0x2f5803,null))['catch'](handleError(_0x2f5803,null));};exports['addDisposition']=function(_0x582fe2,_0x3b930b){if(_0x582fe2['body']['id']){delete _0x582fe2[_0x1ac3('0x55')]['id'];}return db[_0x1ac3('0x33')][_0x1ac3('0x4e')]({'where':{'id':_0x582fe2[_0x1ac3('0x4d')]['id']}})[_0x1ac3('0x2b')](handleEntityNotFound(_0x3b930b,null))[_0x1ac3('0x2b')](function(_0x548780){if(_0x548780){_0x582fe2[_0x1ac3('0x55')][_0x1ac3('0x57')]=_0x548780['id'];return db[_0x1ac3('0x58')][_0x1ac3('0x4f')](_0x582fe2['body']);}})[_0x1ac3('0x2b')](respondWithResult(_0x3b930b,null))[_0x1ac3('0x1c')](handleError(_0x3b930b,null));};exports[_0x1ac3('0x59')]=function(_0x1796df,_0x380ed8){var _0x49ced4={'raw':![],'where':{}};var _0xdf8fb9={};var _0x4b2a64={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x1ac3('0x5a')]({'where':{'id':_0x1796df[_0x1ac3('0x4d')]['id']}})[_0x1ac3('0x2b')](handleEntityNotFound(_0x380ed8,null))[_0x1ac3('0x2b')](function(_0x355429){if(_0x355429){_0xdf8fb9[_0x1ac3('0x38')]=_[_0x1ac3('0x39')](db[_0x1ac3('0x58')][_0x1ac3('0x34')]);_0xdf8fb9['query']=_[_0x1ac3('0x39')](_0x1796df[_0x1ac3('0x3a')]);_0xdf8fb9[_0x1ac3('0x3b')]=_['intersection'](_0xdf8fb9[_0x1ac3('0x38')],_0xdf8fb9[_0x1ac3('0x3a')]);_0x49ced4[_0x1ac3('0x3e')]=_[_0x1ac3('0x3c')](_0xdf8fb9[_0x1ac3('0x38')],qs[_0x1ac3('0x3d')](_0x1796df[_0x1ac3('0x3a')][_0x1ac3('0x3d')]));_0x49ced4[_0x1ac3('0x3e')]=_0x49ced4[_0x1ac3('0x3e')]['length']?_0x49ced4[_0x1ac3('0x3e')]:_0xdf8fb9[_0x1ac3('0x38')];if(!_0x1796df[_0x1ac3('0x3a')]['hasOwnProperty'](_0x1ac3('0x41'))){_0x49ced4[_0x1ac3('0x23')]=qs[_0x1ac3('0x23')](_0x1796df[_0x1ac3('0x3a')][_0x1ac3('0x23')]);_0x49ced4['offset']=qs['offset'](_0x1796df['query'][_0x1ac3('0x21')]);}_0x49ced4['order']=qs[_0x1ac3('0x43')](_0x1796df[_0x1ac3('0x3a')][_0x1ac3('0x43')]);_0x49ced4['where']=qs[_0x1ac3('0x3b')](_[_0x1ac3('0x5b')](_0x1796df[_0x1ac3('0x3a')],_0xdf8fb9[_0x1ac3('0x3b')]));_0x49ced4[_0x1ac3('0x44')]['ChatWebsiteId']=_0x355429['id'];if(_0x1796df['query'][_0x1ac3('0x45')]){_0x49ced4[_0x1ac3('0x44')]=_['merge'](_0x49ced4[_0x1ac3('0x44')],{'$or':_[_0x1ac3('0x32')](_0x49ced4[_0x1ac3('0x3e')],function(_0x5cc2e0){var _0x175174={};_0x175174[_0x5cc2e0]={'$like':'%'+_0x1796df[_0x1ac3('0x3a')]['filter']+'%'};return _0x175174;})});}_0x49ced4=_[_0x1ac3('0x46')]({},_0x49ced4,_0x1796df['options']);return db[_0x1ac3('0x58')]['count']({'where':_0x49ced4['where']})[_0x1ac3('0x2b')](function(_0x444b04){_0x4b2a64[_0x1ac3('0x22')]=_0x444b04;if(_0x1796df[_0x1ac3('0x3a')][_0x1ac3('0x5c')]){_0x49ced4[_0x1ac3('0x49')]=[{'all':!![]}];}return db[_0x1ac3('0x58')][_0x1ac3('0x4a')](_0x49ced4);})[_0x1ac3('0x2b')](function(_0x2f8326){_0x4b2a64[_0x1ac3('0x4b')]=_0x2f8326;return _0x4b2a64;});}})[_0x1ac3('0x2b')](respondWithFilteredResult(_0x380ed8,_0x49ced4))['catch'](handleError(_0x380ed8,null));};exports['removeDispositions']=function(_0x588726,_0x2ef69a){return db[_0x1ac3('0x33')]['find']({'where':{'id':_0x588726[_0x1ac3('0x4d')]['id']}})[_0x1ac3('0x2b')](handleEntityNotFound(_0x2ef69a,null))[_0x1ac3('0x2b')](function(_0x364748){if(_0x364748){return _0x364748[_0x1ac3('0x5d')](_0x588726['query'][_0x1ac3('0x5e')]);}})['then'](respondWithStatusCode(_0x2ef69a,null))[_0x1ac3('0x1c')](handleError(_0x2ef69a,null));};exports['addAnswer']=function(_0x218712,_0x50278a){if(_0x218712[_0x1ac3('0x55')]['id']){delete _0x218712[_0x1ac3('0x55')]['id'];}return db[_0x1ac3('0x33')][_0x1ac3('0x4e')]({'where':{'id':_0x218712[_0x1ac3('0x4d')]['id']}})['then'](handleEntityNotFound(_0x50278a,null))['then'](function(_0x4887a5){if(_0x4887a5){_0x218712[_0x1ac3('0x55')][_0x1ac3('0x57')]=_0x4887a5['id'];return db[_0x1ac3('0x5f')][_0x1ac3('0x4f')](_0x218712['body']);}})[_0x1ac3('0x2b')](respondWithResult(_0x50278a,null))[_0x1ac3('0x1c')](handleError(_0x50278a,null));};exports['getAnswers']=function(_0xa6b434,_0x5702f3){var _0xf042={'raw':![],'where':{}};var _0x58e8a3={};var _0x5524a4={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x1ac3('0x5a')]({'where':{'id':_0xa6b434[_0x1ac3('0x4d')]['id']}})[_0x1ac3('0x2b')](handleEntityNotFound(_0x5702f3,null))[_0x1ac3('0x2b')](function(_0x12cbb4){if(_0x12cbb4){_0x58e8a3['model']=_[_0x1ac3('0x39')](db[_0x1ac3('0x5f')][_0x1ac3('0x34')]);_0x58e8a3[_0x1ac3('0x3a')]=_['keys'](_0xa6b434[_0x1ac3('0x3a')]);_0x58e8a3[_0x1ac3('0x3b')]=_['intersection'](_0x58e8a3['model'],_0x58e8a3['query']);_0xf042[_0x1ac3('0x3e')]=_[_0x1ac3('0x3c')](_0x58e8a3[_0x1ac3('0x38')],qs[_0x1ac3('0x3d')](_0xa6b434['query'][_0x1ac3('0x3d')]));_0xf042[_0x1ac3('0x3e')]=_0xf042['attributes'][_0x1ac3('0x3f')]?_0xf042[_0x1ac3('0x3e')]:_0x58e8a3[_0x1ac3('0x38')];if(!_0xa6b434[_0x1ac3('0x3a')]['hasOwnProperty'](_0x1ac3('0x41'))){_0xf042[_0x1ac3('0x23')]=qs[_0x1ac3('0x23')](_0xa6b434[_0x1ac3('0x3a')][_0x1ac3('0x23')]);_0xf042['offset']=qs[_0x1ac3('0x21')](_0xa6b434[_0x1ac3('0x3a')]['offset']);}_0xf042['order']=qs[_0x1ac3('0x43')](_0xa6b434[_0x1ac3('0x3a')]['sort']);_0xf042['where']=qs[_0x1ac3('0x3b')](_['pick'](_0xa6b434[_0x1ac3('0x3a')],_0x58e8a3[_0x1ac3('0x3b')]));_0xf042['where']['ChatWebsiteId']=_0x12cbb4['id'];if(_0xa6b434[_0x1ac3('0x3a')]['filter']){_0xf042[_0x1ac3('0x44')]=_[_0x1ac3('0x46')](_0xf042[_0x1ac3('0x44')],{'$or':_[_0x1ac3('0x32')](_0xf042[_0x1ac3('0x3e')],function(_0xfbcc08){var _0x9a48b8={};_0x9a48b8[_0xfbcc08]={'$like':'%'+_0xa6b434[_0x1ac3('0x3a')][_0x1ac3('0x45')]+'%'};return _0x9a48b8;})});}_0xf042=_['merge']({},_0xf042,_0xa6b434[_0x1ac3('0x48')]);return db[_0x1ac3('0x5f')]['count']({'where':_0xf042[_0x1ac3('0x44')]})[_0x1ac3('0x2b')](function(_0x5ab703){_0x5524a4[_0x1ac3('0x22')]=_0x5ab703;if(_0xa6b434['query']['includeAll']){_0xf042[_0x1ac3('0x49')]=[{'all':!![]}];}return db[_0x1ac3('0x5f')][_0x1ac3('0x4a')](_0xf042);})['then'](function(_0x591fb2){_0x5524a4[_0x1ac3('0x4b')]=_0x591fb2;return _0x5524a4;});}})[_0x1ac3('0x2b')](respondWithFilteredResult(_0x5702f3,_0xf042))[_0x1ac3('0x1c')](handleError(_0x5702f3,null));};exports[_0x1ac3('0x60')]=function(_0x406738,_0x108fed){return db[_0x1ac3('0x33')][_0x1ac3('0x4e')]({'where':{'id':_0x406738[_0x1ac3('0x4d')]['id']}})[_0x1ac3('0x2b')](handleEntityNotFound(_0x108fed,null))[_0x1ac3('0x2b')](function(_0x949a2d){if(_0x949a2d){return _0x949a2d[_0x1ac3('0x60')](_0x406738[_0x1ac3('0x3a')][_0x1ac3('0x5e')]);}})[_0x1ac3('0x2b')](respondWithStatusCode(_0x108fed,null))[_0x1ac3('0x1c')](handleError(_0x108fed,null));};exports[_0x1ac3('0x61')]=function(_0x27b70c,_0x83dc34){_0x27b70c[_0x1ac3('0x55')][_0x1ac3('0x62')]=_0x27b70c['file'][_0x1ac3('0x63')];return db[_0x1ac3('0x33')][_0x1ac3('0x4e')]({'where':{'id':_0x27b70c[_0x1ac3('0x4d')]['id']}})[_0x1ac3('0x2b')](handleEntityNotFound(_0x83dc34,null))[_0x1ac3('0x2b')](saveUpdates(_0x27b70c['body'],null))['then'](respondWithResult(_0x83dc34,null))[_0x1ac3('0x1c')](handleError(_0x83dc34,null));};exports[_0x1ac3('0x64')]=function(_0x18db6c,_0x436ed1){_0x18db6c[_0x1ac3('0x55')][_0x1ac3('0x65')]=_0x18db6c[_0x1ac3('0x66')][_0x1ac3('0x63')];return db[_0x1ac3('0x33')][_0x1ac3('0x4e')]({'where':{'id':_0x18db6c[_0x1ac3('0x4d')]['id']}})['then'](handleEntityNotFound(_0x436ed1,null))[_0x1ac3('0x2b')](saveUpdates(_0x18db6c[_0x1ac3('0x55')],null))[_0x1ac3('0x2b')](respondWithResult(_0x436ed1,null))['catch'](handleError(_0x436ed1,null));};exports[_0x1ac3('0x67')]=function(_0x2a0e7f,_0x58165b){_0x2a0e7f[_0x1ac3('0x55')][_0x1ac3('0x68')]=_0x2a0e7f[_0x1ac3('0x66')][_0x1ac3('0x63')];return db['ChatWebsite']['find']({'where':{'id':_0x2a0e7f['params']['id']}})[_0x1ac3('0x2b')](handleEntityNotFound(_0x58165b,null))[_0x1ac3('0x2b')](saveUpdates(_0x2a0e7f[_0x1ac3('0x55')],null))[_0x1ac3('0x2b')](respondWithResult(_0x58165b,null))[_0x1ac3('0x1c')](handleError(_0x58165b,null));};exports['addSystemAvatar']=function(_0x2218b1,_0x364194){_0x2218b1[_0x1ac3('0x55')]['systemAvatar']=_0x2218b1[_0x1ac3('0x66')][_0x1ac3('0x63')];return db[_0x1ac3('0x33')][_0x1ac3('0x4e')]({'where':{'id':_0x2218b1[_0x1ac3('0x4d')]['id']}})['then'](handleEntityNotFound(_0x364194,null))[_0x1ac3('0x2b')](saveUpdates(_0x2218b1[_0x1ac3('0x55')],null))[_0x1ac3('0x2b')](respondWithResult(_0x364194,null))[_0x1ac3('0x1c')](handleError(_0x364194,null));};exports['getLogo']=function(_0x5199d5,_0x33604f){var _0x1596ba=path['join'](config[_0x1ac3('0x69')],_0x1ac3('0x6a'));var _0x9c2b3={'where':{'id':_0x5199d5[_0x1ac3('0x4d')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0xc7fedc=![];return require(_0x1ac3('0x6b'))[_0x1ac3('0x6c')]()[_0x1ac3('0x2b')](function(_0x350aa1){if(_0x350aa1){_0xc7fedc=_0x350aa1[_0x1ac3('0x6d')];}})[_0x1ac3('0x2b')](function(){return db['ChatWebsite'][_0x1ac3('0x4e')](_0x9c2b3);})[_0x1ac3('0x2b')](handleEntityNotFound(_0x33604f,null))[_0x1ac3('0x2b')](function(_0x3a9f4c){if(_0x3a9f4c){if(!_[_0x1ac3('0x6e')](_0x3a9f4c[_0x1ac3('0x62')])){if(fs[_0x1ac3('0x6f')](path[_0x1ac3('0x70')](config[_0x1ac3('0x69')],_0x1ac3('0x71'),_0x3a9f4c[_0x1ac3('0x62')]))&&_0xc7fedc){_0x1596ba=path[_0x1ac3('0x70')](config[_0x1ac3('0x69')],_0x1ac3('0x71'),_0x3a9f4c['sitepic']);}}return _0x33604f[_0x1ac3('0x72')](_0x1596ba);}})[_0x1ac3('0x1c')](handleError(_0x33604f,null));};exports[_0x1ac3('0x73')]=function(_0x1b50dc,_0x5dab86){var _0x4fd2a4=path[_0x1ac3('0x70')](config[_0x1ac3('0x69')],_0x1ac3('0x74'));var _0x5c85d3={'where':{'id':_0x1b50dc['params']['id']},'attributes':['id',_0x1ac3('0x65')],'raw':!![]};return db[_0x1ac3('0x33')][_0x1ac3('0x4e')](_0x5c85d3)[_0x1ac3('0x2b')](handleEntityNotFound(_0x5dab86,null))[_0x1ac3('0x2b')](function(_0x5d0458){if(_0x5d0458){if(!_[_0x1ac3('0x6e')](_0x5d0458[_0x1ac3('0x65')])){if(fs[_0x1ac3('0x6f')](path[_0x1ac3('0x70')](config[_0x1ac3('0x69')],_0x1ac3('0x75'),_0x5d0458[_0x1ac3('0x65')]))){_0x4fd2a4=path[_0x1ac3('0x70')](config[_0x1ac3('0x69')],_0x1ac3('0x75'),_0x5d0458[_0x1ac3('0x65')]);}}return _0x5dab86['download'](_0x4fd2a4);}})[_0x1ac3('0x1c')](handleError(_0x5dab86,null));};exports[_0x1ac3('0x76')]=function(_0x32e6ef,_0x53b8a3){var _0x4d7f0c=path[_0x1ac3('0x70')](config['root'],_0x1ac3('0x77'));var _0x246828={'where':{'id':_0x32e6ef[_0x1ac3('0x4d')]['id']},'attributes':['id','customerAvatar','showCustomerAvatar'],'raw':!![]};return db['ChatWebsite'][_0x1ac3('0x4e')](_0x246828)[_0x1ac3('0x2b')](handleEntityNotFound(_0x53b8a3,null))[_0x1ac3('0x2b')](function(_0x2e6f41){if(_0x2e6f41){if(!_[_0x1ac3('0x6e')](_0x2e6f41[_0x1ac3('0x68')])){if(fs[_0x1ac3('0x6f')](path[_0x1ac3('0x70')](config[_0x1ac3('0x69')],_0x1ac3('0x75'),_0x2e6f41[_0x1ac3('0x68')]))&&_0x2e6f41[_0x1ac3('0x78')]){_0x4d7f0c=path[_0x1ac3('0x70')](config[_0x1ac3('0x69')],_0x1ac3('0x75'),_0x2e6f41[_0x1ac3('0x68')]);}}return _0x53b8a3[_0x1ac3('0x72')](_0x4d7f0c);}})[_0x1ac3('0x1c')](handleError(_0x53b8a3,null));};exports['getSystemAvatar']=function(_0x145e1b,_0x34b5dd){var _0x218fb9=path[_0x1ac3('0x70')](config[_0x1ac3('0x69')],'server/files/images/avatars/system_avatar.png');var _0x3789e8={'where':{'id':_0x145e1b[_0x1ac3('0x4d')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db['ChatWebsite'][_0x1ac3('0x4e')](_0x3789e8)[_0x1ac3('0x2b')](handleEntityNotFound(_0x34b5dd,null))[_0x1ac3('0x2b')](function(_0x3ad5c9){if(_0x3ad5c9){if(!_[_0x1ac3('0x6e')](_0x3ad5c9[_0x1ac3('0x79')])){if(fs[_0x1ac3('0x6f')](path[_0x1ac3('0x70')](config[_0x1ac3('0x69')],_0x1ac3('0x75'),_0x3ad5c9[_0x1ac3('0x79')]))){_0x218fb9=path[_0x1ac3('0x70')](config['root'],_0x1ac3('0x75'),_0x3ad5c9['systemAvatar']);}}return _0x34b5dd[_0x1ac3('0x72')](_0x218fb9);}})[_0x1ac3('0x1c')](handleError(_0x34b5dd,null));};exports[_0x1ac3('0x7a')]=function(_0x2b8671,_0x3bf315){var _0x208a85=require(_0x1ac3('0x7b'));var _0x38feb8=new _0x208a85();var _0x42f0b6=_0x38feb8['setUA'](_0x2b8671['headers']['user-agent'])[_0x1ac3('0x7c')]();var _0x226281={'body':_0x2b8671[_0x1ac3('0x55')],'channel':'chat'};var _0x17e985=[];var _0x471582=[];var _0x491cd5={};var _0x327256=![];return db[_0x1ac3('0x7d')][_0x1ac3('0x56')]()['then'](function(_0xe9b3ad){if(!_0xe9b3ad){throw new db['Sequelize']['ValidationError']('no\x20available\x20attributes');}_0x17e985=_[_0x1ac3('0x7e')](_[_0x1ac3('0x39')](_0xe9b3ad),[_0x1ac3('0x7f'),_0x1ac3('0x80')]);_0x471582=_[_0x1ac3('0x7e')](_[_0x1ac3('0x39')](_0xe9b3ad),[_0x1ac3('0x7f'),_0x1ac3('0x80'),_0x1ac3('0x81'),_0x1ac3('0x82')]);if(_0x2b8671[_0x1ac3('0x55')]['id']){delete _0x2b8671[_0x1ac3('0x55')]['id'];}if(_[_0x1ac3('0x6e')](_0x2b8671['body']['from'])){throw new db[(_0x1ac3('0x83'))][(_0x1ac3('0x84'))]('from\x20is\x20mandatory');}if(_[_0x1ac3('0x6e')](_0x2b8671[_0x1ac3('0x55')][_0x1ac3('0x55')])||_0x2b8671[_0x1ac3('0x55')][_0x1ac3('0x55')]===''){throw new db[(_0x1ac3('0x83'))][(_0x1ac3('0x84'))](_0x1ac3('0x85'));}if(_[_0x1ac3('0x6e')](_0x2b8671['body'][_0x1ac3('0x86')])){throw new db[(_0x1ac3('0x83'))][(_0x1ac3('0x84'))](_0x1ac3('0x87')+_0x471582);}if(!_[_0x1ac3('0x88')](_0x471582,_0x2b8671[_0x1ac3('0x55')][_0x1ac3('0x86')])){throw new db[(_0x1ac3('0x83'))][(_0x1ac3('0x84'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x471582);}_0x491cd5[_0x2b8671[_0x1ac3('0x55')]['mapKey']]=_0x2b8671[_0x1ac3('0x55')][_0x1ac3('0x89')];})['then'](function(){return db[_0x1ac3('0x33')][_0x1ac3('0x4e')]({'where':{'id':_0x2b8671[_0x1ac3('0x4d')]['id']},'include':[{'model':db[_0x1ac3('0x8a')],'as':'List','include':[{'model':db[_0x1ac3('0x7d')],'as':_0x1ac3('0x8b'),'where':_0x491cd5,'limit':0x1,'order':[[_0x1ac3('0x80'),_0x1ac3('0x8c')]]}]},{'model':db[_0x1ac3('0x8d')],'as':_0x1ac3('0x8e')}]});})[_0x1ac3('0x2b')](handleEntityNotFound(_0x3bf315,null))['then'](function(_0x55f1a9){if(_0x55f1a9&&_0x55f1a9['List']){_0x226281['account']=_0x55f1a9;_0x226281[_0x1ac3('0x8f')]=_0x55f1a9[_0x1ac3('0x8e')];_0x226281[_0x1ac3('0x90')]=_0x55f1a9[_0x1ac3('0x91')];_0x226281[_0x1ac3('0x8f')]=_[_0x1ac3('0x92')](_0x226281[_0x1ac3('0x8f')],['priority'],['asc']);if(_0x226281['account'][_0x1ac3('0x8e')]){delete _0x226281[_0x1ac3('0x93')][_0x1ac3('0x8e')];}if(_0x226281[_0x1ac3('0x93')][_0x1ac3('0x91')]&&_0x226281['account'][_0x1ac3('0x91')][_0x1ac3('0x8b')][_0x1ac3('0x3f')]){return _0x226281[_0x1ac3('0x93')][_0x1ac3('0x91')][_0x1ac3('0x8b')][0x0];}var _0x24f2cd=_[_0x1ac3('0xc')](_0x2b8671[_0x1ac3('0x55')],{'firstName':_0x2b8671[_0x1ac3('0x55')]['from'],'ListId':_0x55f1a9[_0x1ac3('0x82')]});_0x24f2cd[_0x2b8671[_0x1ac3('0x55')][_0x1ac3('0x86')]]=_0x2b8671['body'][_0x1ac3('0x89')];return db[_0x1ac3('0x7d')][_0x1ac3('0x4f')](_0x24f2cd,{'fields':_0x17e985,'raw':!![]});}})['then'](handleEntityNotFound(_0x3bf315,null))[_0x1ac3('0x2b')](function(_0x34cbd0){_0x226281[_0x1ac3('0x94')]=_0x34cbd0;var _0x480092=_0x2b8671['body']['customerIp'];if(_0x2b8671[_0x1ac3('0x95')][_0x1ac3('0x96')]){_0x480092=_0x2b8671[_0x1ac3('0x95')][_0x1ac3('0x96')];}else if(_0x2b8671[_0x1ac3('0x95')]['x-forwarded-for']){_0x480092=_[_0x1ac3('0x97')](_0x2b8671[_0x1ac3('0x95')]['x-forwarded-for'][_0x1ac3('0x98')](','));}if(_0x34cbd0){var _0x2d1166={'ContactId':_0x34cbd0['id'],'ChatWebsiteId':_0x2b8671[_0x1ac3('0x4d')]['id'],'from':(_0x34cbd0['firstName']||'')+'\x20'+(_0x34cbd0[_0x1ac3('0x99')]||''),'customerIp':_0x480092,'customerPort':_0x2b8671[_0x1ac3('0x95')][_0x1ac3('0x9a')]?_0x2b8671[_0x1ac3('0x95')][_0x1ac3('0x9a')]:null,'referer':_0x2b8671[_0x1ac3('0x55')][_0x1ac3('0x9b')],'browserName':_0x42f0b6[_0x1ac3('0x9c')]['name']&&_0x42f0b6['browser'][_0x1ac3('0x9d')]?util[_0x1ac3('0x9e')]('%s\x20%s',_0x42f0b6[_0x1ac3('0x9c')]['name'],_0x42f0b6[_0x1ac3('0x9c')]['version']):_0x1ac3('0x9f'),'browserVersion':_0x42f0b6[_0x1ac3('0x9c')][_0x1ac3('0x9d')]||_0x1ac3('0x9f'),'osName':util[_0x1ac3('0x9e')](_0x1ac3('0xa0'),_0x42f0b6['os'][_0x1ac3('0x2d')],_0x42f0b6['os']['version']),'osVersion':_0x42f0b6['os'][_0x1ac3('0x9d')],'deviceModel':_0x42f0b6[_0x1ac3('0xa1')][_0x1ac3('0x38')]&&_0x42f0b6['device'][_0x1ac3('0xa2')]?util['format']('%s\x20%s\x20%s',_0x42f0b6[_0x1ac3('0xa1')][_0x1ac3('0x38')],_0x42f0b6['device'][_0x1ac3('0xa2')],_0x42f0b6[_0x1ac3('0xa1')][_0x1ac3('0x36')]):null,'deviceVendor':_0x42f0b6[_0x1ac3('0xa1')]['vendor'],'deviceType':_0x42f0b6[_0x1ac3('0xa1')]['type'],'formData':JSON[_0x1ac3('0x18')](_0x2b8671[_0x1ac3('0x55')])};var _0x37a18b={'ChatWebsiteId':_0x2b8671[_0x1ac3('0x4d')]['id'],'closed':![]};if(_0x2b8671['body'][_0x1ac3('0xa3')]){_0x37a18b['threadId']=_0x2b8671[_0x1ac3('0x55')][_0x1ac3('0xa3')];return db[_0x1ac3('0xa4')][_0x1ac3('0x4e')]({'where':_0x37a18b})['then'](function(_0x35708b){if(_0x35708b){return[_0x35708b,![]];}_0x2d1166[_0x1ac3('0xa3')]=_0x2b8671[_0x1ac3('0x55')][_0x1ac3('0xa3')];_0x2d1166[_0x1ac3('0xa5')]=_0x2b8671[_0x1ac3('0x55')]['externalUrl'];return db[_0x1ac3('0xa4')][_0x1ac3('0x4f')](_0x2d1166)['then'](function(_0x2cb3c1){return[_0x2cb3c1,!![]];});});}_0x37a18b['ContactId']=_0x34cbd0['id'];if(_0x2b8671['body']['interaction']&&_0x2b8671[_0x1ac3('0x55')][_0x1ac3('0xa6')]['id']){_0x37a18b['id']=_0x2b8671['body']['interaction']['id'];return db[_0x1ac3('0xa4')][_0x1ac3('0x4e')]({'where':_0x37a18b})['then'](function(_0x38286b){if(_0x38286b){return[_0x38286b,![]];}return db[_0x1ac3('0xa4')][_0x1ac3('0x4f')](_0x2d1166)[_0x1ac3('0x2b')](function(_0x9a99e1){return[_0x9a99e1,!![]];});});}return db['ChatInteraction'][_0x1ac3('0x4f')](_0x2d1166)[_0x1ac3('0x2b')](function(_0x1514f6){return[_0x1514f6,!![]];});}})[_0x1ac3('0xa7')](function(_0x3dd0a7,_0x3f3249){if(_0x3dd0a7){_0x327256=_0x3f3249;if(!_0x3f3249){var _0x1272a6={'from':(_0x226281[_0x1ac3('0x94')][_0x1ac3('0xa8')]||'')+'\x20'+(_0x226281['contact']['lastName']||'')};if(_0x2b8671[_0x1ac3('0x55')][_0x1ac3('0xa3')]&&_0x2b8671['body'][_0x1ac3('0xa9')]&&_0x2b8671[_0x1ac3('0x55')][_0x1ac3('0xa3')]!=_0x2b8671[_0x1ac3('0x55')][_0x1ac3('0xa9')]){_0x1272a6[_0x1ac3('0xa3')]=_0x2b8671[_0x1ac3('0x55')][_0x1ac3('0xa9')];}return _0x3dd0a7[_0x1ac3('0x26')](_0x1272a6);}else{return _0x3dd0a7;}}})[_0x1ac3('0x2b')](function(_0x375552){_0x226281[_0x1ac3('0xa6')]=_0x375552[_0x1ac3('0x28')]({'plain':!![]});_0x226281[_0x1ac3('0xa6')][_0x1ac3('0xaa')]=_0x327256;if(_0x226281['interaction'][_0x1ac3('0xaa')]){if(_0x226281[_0x1ac3('0x93')][_0x1ac3('0xab')]){_0x226281['applications'][_0x1ac3('0xac')]({'id':0x0,'priority':_0x226281[_0x1ac3('0x8f')][_0x1ac3('0x3f')]+0x1,'app':_0x1ac3('0xad'),'appdata':_0x1ac3('0xae'),'interval':'*,*,*,*'});}}return db[_0x1ac3('0xaf')][_0x1ac3('0x4f')]({'body':_0x2b8671[_0x1ac3('0x55')][_0x1ac3('0x55')],'ChatWebsiteId':_0x2b8671[_0x1ac3('0x4d')]['id'],'ChatInteractionId':_0x375552['id'],'direction':'in','ContactId':_0x226281[_0x1ac3('0x94')]['id'],'AttachmentId':_0x2b8671[_0x1ac3('0x55')][_0x1ac3('0xb0')]});})[_0x1ac3('0x2b')](function(_0x2de910){_0x226281[_0x1ac3('0x1a')]=_0x2de910;if(_0x226281['interaction']['UserId']){return db[_0x1ac3('0xb1')]['find']({'attributes':['id',_0x1ac3('0x2d')],'where':{'id':_0x226281[_0x1ac3('0xa6')][_0x1ac3('0xb2')]}})[_0x1ac3('0x2b')](function(_0x307b5e){if(_0x307b5e){_0x226281[_0x1ac3('0x8f')][_0x1ac3('0xb3')]({'id':0x0,'priority':0x0,'app':_0x1ac3('0xb4'),'appdata':_0x307b5e['name']+','+(_0x226281[_0x1ac3('0x93')][_0x1ac3('0xb5')]||0xa),'interval':_0x1ac3('0xb6')});_0x226281[_0x1ac3('0xb7')]=!![];}return respondWithRpcPromise('Start',_0x1ac3('0xb8'),_0x226281);});}return respondWithRpcPromise(_0x1ac3('0xb9'),_0x1ac3('0xb8'),_0x226281);})[_0x1ac3('0x2b')](function(_0x2aed19){respondWithRpcPromise(_0x1ac3('0xba'),_0x1ac3('0xba'),{'event':'notify','message':_0x2aed19},client9002);return _0x2aed19;})[_0x1ac3('0x2b')](respondWithResult(_0x3bf315,null))['catch'](handleError(_0x3bf315,null));};exports['offline']=function(_0x39f9c5,_0x4c535d){var _0xbbad33,_0x44378e,_0x15002b;var _0x35817f=[];var _0x52f102={};var _0x299ae1=_0x39f9c5[_0x1ac3('0xbb')]||[];var _0x2956c7=[];var _0x37db0c;return db['CmContact'][_0x1ac3('0x56')]()[_0x1ac3('0x2b')](function(_0x12aca7){if(!_0x12aca7){throw new db[(_0x1ac3('0x83'))][(_0x1ac3('0x84'))](_0x1ac3('0xbc'));}_0x35817f=_['difference'](_[_0x1ac3('0x39')](_0x12aca7),['createdAt','updatedAt',_0x1ac3('0x81'),'ListId']);if(_0x39f9c5[_0x1ac3('0x55')]['id']){delete _0x39f9c5[_0x1ac3('0x55')]['id'];}if(_[_0x1ac3('0x6e')](_0x39f9c5[_0x1ac3('0x55')][_0x1ac3('0x89')])){throw _0x4c535d[_0x1ac3('0x1f')](0x1f4)['send'](new db[(_0x1ac3('0x83'))]['ValidationError'](_0x1ac3('0xbd')));}if(_[_0x1ac3('0x6e')](_0x39f9c5[_0x1ac3('0x55')][_0x1ac3('0x55')])||_0x39f9c5[_0x1ac3('0x55')][_0x1ac3('0x55')]===''){throw _0x4c535d[_0x1ac3('0x1f')](0x1f4)[_0x1ac3('0x2e')](new db[(_0x1ac3('0x83'))]['ValidationError'](_0x1ac3('0x85')));}if(_[_0x1ac3('0x6e')](_0x39f9c5['body'][_0x1ac3('0xbe')])){throw _0x4c535d['status'](0x1f4)['send'](new db[(_0x1ac3('0x83'))][(_0x1ac3('0x84'))](_0x1ac3('0xbf')+_0x35817f));}if(!_[_0x1ac3('0x88')](_0x35817f,_0x39f9c5['body'][_0x1ac3('0xbe')])){throw _0x4c535d[_0x1ac3('0x1f')](0x1f4)[_0x1ac3('0x2e')](new db[(_0x1ac3('0x83'))][(_0x1ac3('0x84'))](_0x1ac3('0xc0')+_0x35817f));}_0x52f102[_0x39f9c5[_0x1ac3('0x55')][_0x1ac3('0xbe')]]=_0x39f9c5[_0x1ac3('0x55')][_0x1ac3('0x89')];})['then'](function(){return db[_0x1ac3('0x33')][_0x1ac3('0x4e')]({'where':{'id':_0x39f9c5[_0x1ac3('0x4d')]['id']},'include':[{'model':db[_0x1ac3('0x8a')],'as':_0x1ac3('0x91')},{'model':db[_0x1ac3('0xc1')],'as':'MailAccount'}]});})['then'](handleEntityNotFound(_0x4c535d,null))[_0x1ac3('0x2b')](function(_0x240902){if(_0x240902&&_0x240902['List']){_0x44378e=_0x240902;var _0x536090=_[_0x1ac3('0xc')](_0x39f9c5[_0x1ac3('0x55')],{'firstName':_0x39f9c5[_0x1ac3('0x55')][_0x1ac3('0x89')],'phone':_0x39f9c5['body'][_0x1ac3('0x89')],'ListId':_0x240902[_0x1ac3('0x82')]});_0x536090[_0x39f9c5[_0x1ac3('0x55')][_0x1ac3('0xbe')]]=_0x39f9c5[_0x1ac3('0x55')]['from'];return db[_0x1ac3('0x7d')][_0x1ac3('0xc2')]({'where':_0x52f102,'defaults':_0x536090});}})[_0x1ac3('0xa7')](function(_0x270745){if(_0x270745){_0x15002b=_0x270745;var _0x281e37=fs[_0x1ac3('0xc3')](path[_0x1ac3('0x70')](config[_0x1ac3('0x69')],_0x1ac3('0xc4')),_0x1ac3('0xc5'));var _0x38f8f7=ejs[_0x1ac3('0xc6')](_0x281e37,{'body':_['toPairs'](_0x39f9c5[_0x1ac3('0x55')][_0x1ac3('0x55')]),'bodyTitle':_0x44378e[_0x1ac3('0xc7')]});return db[_0x1ac3('0xc8')][_0x1ac3('0x4f')]({'body':_0x38f8f7,'plainBody':htmlToText[_0x1ac3('0xc9')](_0x38f8f7),'ContactId':_0x270745['id'],'ChatWebsiteId':_0x44378e['id']});}})[_0x1ac3('0x2b')](function(_0x21fffc){_0x37db0c=_0x21fffc;if(_0x299ae1[_0x1ac3('0x3f')]){var _0x306d7a=_0x299ae1[_0x1ac3('0x32')](function(_0x3293f4){return{'name':_0x3293f4[_0x1ac3('0xca')],'basename':_0x3293f4[_0x1ac3('0x63')],'type':_0x3293f4['mimetype'],'ChatOfflineMessageId':_0x21fffc['id']};});_0x2956c7=_0x306d7a[_0x1ac3('0x32')](_0x57c622=>{var _0x131b6c={'filename':_0x57c622[_0x1ac3('0x2d')],'path':path[_0x1ac3('0x70')](config['root'],_0x1ac3('0xcb'),_0x1ac3('0xbb'),'attachments',_0x1ac3('0xcc'),_0x57c622[_0x1ac3('0xcd')])};return _0x131b6c;});if(!_0x44378e[_0x1ac3('0xce')]){return db[_0x1ac3('0xcf')][_0x1ac3('0xd0')](function(_0x490c96){return db[_0x1ac3('0xd1')]['bulkCreate'](_0x306d7a,{'transaction':_0x490c96});});}}})[_0x1ac3('0x2b')](function(){if(_0x37db0c){_0xbbad33=_0x37db0c;return db['MailAccount'][_0x1ac3('0x5a')]({'where':{'service':!![]},'include':[{'model':db[_0x1ac3('0xd2')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x1ac3('0xd3'),'raw':!![]}]}]});}})[_0x1ac3('0x2b')](function(_0x5a6dda){if(_0x5a6dda&&_0x5a6dda['Smtp']&&_0x44378e[_0x1ac3('0xd4')]&&_0x44378e['forwardOfflineAddress']){var _0x370d40=_0x5a6dda[_0x1ac3('0xd5')]();return respondWithRpcPromise('SendMail',_0x1ac3('0xd6'),{'account':_0x370d40,'message':{'from':util[_0x1ac3('0x9e')](_0x1ac3('0xd7'),_0x5a6dda[_0x1ac3('0x2d')],_0x5a6dda[_0x1ac3('0xd8')]||_0x5a6dda['Smtp'][_0x1ac3('0x50')]),'to':_0x44378e[_0x1ac3('0xd9')],'subject':_0x44378e[_0x1ac3('0xda')],'html':_0xbbad33[_0x1ac3('0x55')],'attachments':_0x2956c7}},client9003)[_0x1ac3('0x2b')](function(){return _0xbbad33;})[_0x1ac3('0x1c')](function(_0x5adf55){logger[_0x1ac3('0x19')](_0x5adf55);});}})[_0x1ac3('0x2b')](function(){if(_0x44378e&&_0x44378e[_0x1ac3('0xce')]&&_0x44378e[_0x1ac3('0xdb')]){var _0x3c902b=[];if(_0x299ae1[_0x1ac3('0x3f')]){_0x3c902b=_0x299ae1[_0x1ac3('0x32')](function(_0xb5a5a3){return{'name':_0xb5a5a3[_0x1ac3('0xca')],'basename':_0xb5a5a3[_0x1ac3('0x63')],'type':_0xb5a5a3[_0x1ac3('0xdc')],'ChatOfflineMessageId':_0x37db0c['id']};});}var _0x547357;if(!_['isNil'](_0x44378e[_0x1ac3('0xdd')])){var _0x7c3f9b=_['map'](_0x39f9c5[_0x1ac3('0x55')],function(_0x679446){return _0x679446;});var _0x404710=_[_0x1ac3('0xde')](_0x7c3f9b)[0x0];var _0x11cf18=_[_0x1ac3('0xdf')](_0x404710,function(_0x2cbc6b){return _0x2cbc6b;});_0x547357=_0x11cf18[0x1][_0x44378e[_0x1ac3('0xdd')]];}var _0xee122a={'from':_0x15002b[_0x1ac3('0xd8')],'firstName':_0x15002b['firstName'],'lastName':_0x15002b[_0x1ac3('0x99')],'mapKey':_0x1ac3('0xd8'),'message':{'from':_0x15002b['email'],'to':_0x44378e['MailAccount']['email'],'cc':'','subject':_[_0x1ac3('0x6e')](_0x547357)?_0x44378e[_0x1ac3('0xda')]:_0x547357,'messageId':'','sentAt':new Date(),'attach':_0x3c902b['length'],'attachments':_0x3c902b,'originChannel':_0x1ac3('0xe0'),'ChatWebsiteId':_0x44378e['id'],'ChatOfflineMessageId':_0xbbad33['id'],'originTo':_0x44378e[_0x1ac3('0xc1')][_0x1ac3('0xd8')]},'body':_0xbbad33[_0x1ac3('0x55')]};var _0x3207b7={'account':{'id':_0x44378e['MailAccountId']},'body':_0xee122a,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0x1ac3('0xe1'),'notifyMail',_0x3207b7,client9001)[_0x1ac3('0x2b')](function(){return _0xbbad33;})[_0x1ac3('0x1c')](function(_0x5bed59){logger[_0x1ac3('0x19')](_0x5bed59);});}return;})[_0x1ac3('0x2b')](function(){if(_0xbbad33){return _0xbbad33;}})[_0x1ac3('0x2b')](respondWithResult(_0x4c535d,null))[_0x1ac3('0x1c')](function(_0x16bc86){logger[_0x1ac3('0x19')](_0x1ac3('0x1c'),_0x16bc86);for(var _0x325f6d of _0x299ae1){var _0x2d9eb6=path[_0x1ac3('0x70')](config['root'],_0x1ac3('0xcb'),_0x1ac3('0xbb'),_0x1ac3('0xe2'),'offline-chat',_0x325f6d[_0x1ac3('0x63')]);fs_extra[_0x1ac3('0xe3')](_0x2d9eb6)[_0x1ac3('0x1c')](function(_0x27b014){logger[_0x1ac3('0x19')](_0x1ac3('0xe4'),_0x2d9eb6,_0x27b014);});}});};exports['addInteraction']=function(_0x97e4ca,_0x3b79cb){return db[_0x1ac3('0xa4')][_0x1ac3('0x4e')]({'where':{'id':_0x97e4ca[_0x1ac3('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3b79cb,null))[_0x1ac3('0x2b')](function(_0x413433){if(_0x413433){return _0x413433[_0x1ac3('0xe5')](_0x97e4ca[_0x1ac3('0x55')][_0x1ac3('0x5e')],_[_0x1ac3('0xe6')](_0x97e4ca[_0x1ac3('0x55')],[_0x1ac3('0x5e'),'id'])||{});}})['then'](respondWithResult(_0x3b79cb,null))['catch'](handleError(_0x3b79cb,null));};exports[_0x1ac3('0xe7')]=function(_0x481270,_0xbf66b4){var _0x20654b={'raw':![],'where':{}};var _0x12a1c8={};var _0x50c5fe={'count':0x0,'rows':[]};return db[_0x1ac3('0x33')][_0x1ac3('0x5a')]({'where':{'id':_0x481270[_0x1ac3('0x4d')]['id']}})['then'](handleEntityNotFound(_0xbf66b4,null))['then'](function(_0x5e0719){if(_0x5e0719){_0x12a1c8['model']=_[_0x1ac3('0x39')](db['ChatInteraction'][_0x1ac3('0x34')]);_0x12a1c8['query']=_[_0x1ac3('0x39')](_0x481270['query']);_0x12a1c8['filters']=_[_0x1ac3('0x3c')](_0x12a1c8[_0x1ac3('0x38')],_0x12a1c8[_0x1ac3('0x3a')]);_0x20654b[_0x1ac3('0x3e')]=_[_0x1ac3('0x3c')](_0x12a1c8['model'],qs[_0x1ac3('0x3d')](_0x481270['query'][_0x1ac3('0x3d')]));_0x20654b['attributes']=_0x20654b['attributes'][_0x1ac3('0x3f')]?_0x20654b[_0x1ac3('0x3e')]:_0x12a1c8['model'];if(!_0x481270[_0x1ac3('0x3a')][_0x1ac3('0x40')](_0x1ac3('0x41'))){_0x20654b[_0x1ac3('0x23')]=qs[_0x1ac3('0x23')](_0x481270[_0x1ac3('0x3a')][_0x1ac3('0x23')]);_0x20654b[_0x1ac3('0x21')]=qs[_0x1ac3('0x21')](_0x481270[_0x1ac3('0x3a')][_0x1ac3('0x21')]);}_0x20654b[_0x1ac3('0x42')]=qs[_0x1ac3('0x43')](_0x481270[_0x1ac3('0x3a')][_0x1ac3('0x43')]);_0x20654b[_0x1ac3('0x44')]=qs['filters'](_[_0x1ac3('0x5b')](_0x481270[_0x1ac3('0x3a')],_0x12a1c8[_0x1ac3('0x3b')]));_0x20654b[_0x1ac3('0x44')][_0x1ac3('0x57')]=_0x5e0719['id'];if(_0x481270['query'][_0x1ac3('0x45')]){_0x20654b[_0x1ac3('0x44')]=_['merge'](_0x20654b[_0x1ac3('0x44')],{'$or':_[_0x1ac3('0x32')](_0x20654b[_0x1ac3('0x3e')],function(_0x4a02e3){var _0x59fa4e={};_0x59fa4e[_0x4a02e3]={'$like':'%'+_0x481270['query'][_0x1ac3('0x45')]+'%'};return _0x59fa4e;})});}_0x20654b=_[_0x1ac3('0x46')]({},_0x20654b,_0x481270[_0x1ac3('0x48')]);return db[_0x1ac3('0xa4')][_0x1ac3('0x22')]({'where':_0x20654b['where']})['then'](function(_0x112865){_0x50c5fe[_0x1ac3('0x22')]=_0x112865;if(_0x481270[_0x1ac3('0x3a')][_0x1ac3('0x5c')]){_0x20654b[_0x1ac3('0x49')]=[{'model':db[_0x1ac3('0x7d')],'as':'Contact','required':![]},{'model':db[_0x1ac3('0xb1')],'as':_0x1ac3('0xe8'),'attributes':[_0x1ac3('0x2d'),_0x1ac3('0xe9'),_0x1ac3('0xea')],'required':![]},{'model':db[_0x1ac3('0xeb')],'as':'Tags','attributes':['id',_0x1ac3('0x2d'),'color'],'where':_0x481270[_0x1ac3('0x3a')]['tag']?{'id':_0x481270[_0x1ac3('0x3a')][_0x1ac3('0xec')]}:undefined,'required':_0x481270['query'][_0x1ac3('0xec')]?!![]:![]}];}return db[_0x1ac3('0xa4')][_0x1ac3('0x4a')](_0x20654b);})['then'](function(_0x4d72b4){_0x50c5fe[_0x1ac3('0x4b')]=_0x4d72b4;return _0x50c5fe;});}})[_0x1ac3('0x2b')](respondWithFilteredResult(_0xbf66b4,_0x20654b))[_0x1ac3('0x1c')](handleError(_0xbf66b4,null));};function iftimePromise(_0x7a727d,_0x155a76){return respondWithRpcPromise(_0x1ac3('0xed'),_0x1ac3('0xee'),{'command':_0x155a76[_0x1ac3('0xef')]?util['format'](_0x1ac3('0xf0'),_0x7a727d[_0x1ac3('0xf1')],_0x155a76[_0x1ac3('0xef')]):util[_0x1ac3('0x9e')]('iftime\x20%s',_0x7a727d[_0x1ac3('0xf1')])},client9002)['then'](function(_0x4d9fbd){var _0x5539a8=_0x4d9fbd&&_0x4d9fbd[_0x1ac3('0xf2')](_0x1ac3('0xf3'))>=0x0?!![]:![];logger[_0x1ac3('0x14')](_0x1ac3('0xf4'),_0x155a76['id'],_0x7a727d['id'],_0x7a727d['interval'],_0x5539a8?_0x1ac3('0xf5'):'OFFLINE',_0x155a76[_0x1ac3('0xef')]?_0x155a76[_0x1ac3('0xef')]:_0x1ac3('0xf6'));return _0x5539a8;})[_0x1ac3('0x1c')](function(_0x8f3c){logger['error']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x155a76['id'],_0x7a727d['id'],_0x7a727d[_0x1ac3('0xf1')],util[_0x1ac3('0xf7')](_0x8f3c,{'showHidden':![],'depth':null}),_0x155a76[_0x1ac3('0xef')]?_0x155a76[_0x1ac3('0xef')]:'No\x20timezone');return![];});}exports[_0x1ac3('0xee')]=function(_0x5d776a,_0xd7d0b2){var _0x4a6e31=0x0;var _0x2e2651=0x0;var _0x1c4ae2=![];var _0x125a58;var _0x4b6243;return db[_0x1ac3('0x33')]['find']({'where':{'id':_0x5d776a[_0x1ac3('0x4d')]['id']},'include':[{'model':db[_0x1ac3('0xf8')],'as':_0x1ac3('0xf8'),'include':[{'model':db[_0x1ac3('0xf8')],'as':_0x1ac3('0xf9'),'attributes':['id',_0x1ac3('0xf1')],'raw':!![]}]}]})[_0x1ac3('0x2b')](handleEntityNotFound(_0xd7d0b2,null))['then'](function(_0x444cfe){if(_0x444cfe){_0x125a58=_0x444cfe;return _0x444cfe[_0x1ac3('0xfa')]({'raw':!![]});}})[_0x1ac3('0x2b')](function(_0x40adad){if(_0x125a58){if(_0x40adad){_0x4b6243=_0x40adad;}}return require(_0x1ac3('0x6b'))[_0x1ac3('0x6c')]();})['then'](function(_0x378807){if(_0x378807){_0x2e2651=_0x378807[_0x1ac3('0xfb')];_0x1c4ae2=_0x378807[_0x1ac3('0x6d')];}})[_0x1ac3('0x2b')](function(){return db[_0x1ac3('0xa4')][_0x1ac3('0x22')]({'where':{'closed':![]}});})[_0x1ac3('0x2b')](function(_0x593b7c){_0x4a6e31=_0x593b7c;if(_0x2e2651&&_0x593b7c>_0x2e2651){return db[_0x1ac3('0xfc')][_0x1ac3('0x5a')]({'where':{'id':0x1}})[_0x1ac3('0x2b')](function(_0x47ed5d){if(_0x47ed5d){_0x47ed5d['increment'](_0x1ac3('0xfd'));}});}})[_0x1ac3('0x2b')](function(){if(_0x125a58[_0x1ac3('0xf8')]&&_0x125a58[_0x1ac3('0xf8')][_0x1ac3('0xf9')]){var _0x36732e=[];for(var _0x54dfa7=0x0;_0x54dfa7<_0x125a58[_0x1ac3('0xf8')][_0x1ac3('0xf9')][_0x1ac3('0x3f')];_0x54dfa7++){var _0x49bb34=_0x125a58[_0x1ac3('0xf8')][_0x1ac3('0xf9')][_0x54dfa7][_0x1ac3('0x28')]({'plain':!![]});_0x36732e['push'](iftimePromise(_0x49bb34,_0x125a58));}return BPromise[_0x1ac3('0xfe')](_0x36732e)[_0x1ac3('0x2b')](function(_0x5e47f1){return _[_0x1ac3('0xff')](_0x5e47f1);});}else{return!![];}})[_0x1ac3('0x2b')](function(_0x5ef7ba){var _0x2f2de3=fs[_0x1ac3('0xc3')](path[_0x1ac3('0x70')](config['root'],_0x1ac3('0x100')),_0x1ac3('0xc5'));var _0x440ba3={'remote':_0x125a58[_0x1ac3('0x101')],'query':querystring[_0x1ac3('0x18')](_['merge'](_0x125a58[_0x1ac3('0x28')]({'plain':!![]}),{'customerIp':_0x5d776a[_0x1ac3('0x95')][_0x1ac3('0x102')]||_0x5d776a[_0x1ac3('0x95')][_0x1ac3('0x103')]||_0x5d776a[_0x1ac3('0x104')][_0x1ac3('0x105')]||_0x5d776a['ip'],'referer':_0x5d776a[_0x1ac3('0x95')][_0x1ac3('0x9b')],'openedInteractions':_0x4a6e31,'maxInteractions':_0x2e2651,'virtual':_0x1c4ae2[_0x1ac3('0xfb')],'online':_0x5ef7ba,'custom':_0x1c4ae2}))[_0x1ac3('0x106')](/'/g,'\x5c\x27')};_0xd7d0b2['send'](ejs[_0x1ac3('0xc6')](Mustache['render'](_0x2f2de3,_0x440ba3),{'proactiveActions':_0x4b6243,'alignment':_0x125a58['alignment'],'verticalAlignment':_0x125a58['verticalAlignment'],'div_color':_0x125a58[_0x1ac3('0x107')],'labelText':_0x125a58[_0x1ac3('0x108')],'text_color':_0x125a58[_0x1ac3('0x109')],'button_color':_0x125a58[_0x1ac3('0x10a')],'background_color':_0x125a58[_0x1ac3('0x10b')],'hideWhenOffline':_0x125a58[_0x1ac3('0x10c')],'interval':_0x125a58[_0x1ac3('0x10d')]}));})[_0x1ac3('0x1c')](handleError(_0xd7d0b2,null));};exports[_0x1ac3('0x10e')]=function(_0x1cea4d,_0x3a7829){var _0x1b448a=_0x1cea4d[_0x1ac3('0x4d')]['id'];var _0x29d4fc=_0x1cea4d[_0x1ac3('0x55')];var _0x1f88ae=0xc8;var _0x1b9e77=null;return db['sequelize'][_0x1ac3('0xd0')]({'isolationLevel':db[_0x1ac3('0xcf')][_0x1ac3('0x10f')][_0x1ac3('0x110')][_0x1ac3('0x111')]},function(_0x41bb17){return db[_0x1ac3('0x33')][_0x1ac3('0x5a')]({'where':{'id':_0x1b448a},'transaction':_0x41bb17})[_0x1ac3('0x2b')](function(_0x4f1789){if(_0x4f1789){return db[_0x1ac3('0x8d')][_0x1ac3('0x27')]({'where':{'ChatWebsiteId':_0x1b448a},'transaction':_0x41bb17})[_0x1ac3('0x2b')](function(){var _0x50b633=_[_0x1ac3('0x32')](_0x29d4fc,function(_0x36a055){_0x36a055['ChatWebsiteId']=_0x1b448a;return _0x36a055;});return db['ChatApplication'][_0x1ac3('0x112')](_0x50b633,{'transaction':_0x41bb17});});}else{_0x1f88ae=0x194;_0x1b9e77=[];}});})[_0x1ac3('0x2b')](function(){if(_0x1f88ae!==0x194){return db[_0x1ac3('0x8d')][_0x1ac3('0x113')]({'where':{'ChatWebsiteId':_0x1b448a},'order':_0x1ac3('0x114')})[_0x1ac3('0x2b')](function(_0x5e86b7){_0x1b9e77=_0x5e86b7;});}})[_0x1ac3('0x1c')](function(_0x5e1794){_0x1f88ae=0x1f4;logger['error'](_0x5e1794['stack']);if(_0x5e1794[_0x1ac3('0x2d')]){delete _0x5e1794[_0x1ac3('0x2d')];}_0x1b9e77=_0x5e1794;})['finally'](function(){if(_0x1b9e77===null){_0x3a7829[_0x1ac3('0x1e')](_0x1f88ae);}else{if(_0x1f88ae===0x1f4){_0x3a7829[_0x1ac3('0x1f')](_0x1f88ae)[_0x1ac3('0x2e')](_0x1b9e77);}else{_0x3a7829[_0x1ac3('0x1f')](_0x1f88ae)[_0x1ac3('0x20')](_0x1b9e77);}}});};exports['getApplications']=function(_0x28c3b9,_0x36cb9e){var _0x23164c={};var _0xef8316={};var _0x57d89f;var _0x595d3b;return db[_0x1ac3('0x33')][_0x1ac3('0x5a')]({'where':{'id':_0x28c3b9[_0x1ac3('0x4d')]['id']}})['then'](handleEntityNotFound(_0x36cb9e,null))['then'](function(_0x1783f8){if(_0x1783f8){_0x57d89f=_0x1783f8;_0xef8316['model']=_['keys'](db[_0x1ac3('0x8d')]['rawAttributes']);_0xef8316[_0x1ac3('0x3a')]=_[_0x1ac3('0x39')](_0x28c3b9[_0x1ac3('0x3a')]);_0xef8316[_0x1ac3('0x3b')]=_[_0x1ac3('0x3c')](_0xef8316[_0x1ac3('0x38')],_0xef8316[_0x1ac3('0x3a')]);_0x23164c[_0x1ac3('0x3e')]=_[_0x1ac3('0x3c')](_0xef8316[_0x1ac3('0x38')],qs[_0x1ac3('0x3d')](_0x28c3b9['query'][_0x1ac3('0x3d')]));_0x23164c['attributes']=_0x23164c[_0x1ac3('0x3e')]['length']?_0x23164c[_0x1ac3('0x3e')]:_0xef8316[_0x1ac3('0x38')];_0x23164c[_0x1ac3('0x42')]=qs[_0x1ac3('0x43')](_0x28c3b9[_0x1ac3('0x3a')][_0x1ac3('0x43')]);_0x23164c['where']=qs[_0x1ac3('0x3b')](_[_0x1ac3('0x5b')](_0x28c3b9['query'],_0xef8316[_0x1ac3('0x3b')]));if(_0x28c3b9[_0x1ac3('0x3a')][_0x1ac3('0x45')]){_0x23164c[_0x1ac3('0x44')]=_[_0x1ac3('0x46')](_0x23164c[_0x1ac3('0x44')],{'$or':_[_0x1ac3('0x32')](_0x23164c[_0x1ac3('0x3e')],function(_0x4fe957){var _0x11105b={};_0x11105b[_0x4fe957]={'$like':'%'+_0x28c3b9[_0x1ac3('0x3a')][_0x1ac3('0x45')]+'%'};return _0x11105b;})});}_0x23164c=_['merge']({},_0x23164c,_0x28c3b9['options']);return _0x57d89f[_0x1ac3('0x115')](_0x23164c);}})['then'](function(_0x2589e8){if(_0x2589e8){_0x595d3b=_0x2589e8[_0x1ac3('0x3f')];if(!_0x28c3b9[_0x1ac3('0x3a')][_0x1ac3('0x40')](_0x1ac3('0x41'))){_0x23164c['limit']=qs[_0x1ac3('0x23')](_0x28c3b9[_0x1ac3('0x3a')][_0x1ac3('0x23')]);_0x23164c[_0x1ac3('0x21')]=qs[_0x1ac3('0x21')](_0x28c3b9['query']['offset']);}return _0x57d89f[_0x1ac3('0x115')](_0x23164c);}})[_0x1ac3('0x2b')](function(_0x4027c9){if(_0x4027c9){return _0x4027c9?{'count':_0x595d3b,'rows':_0x4027c9}:null;}})[_0x1ac3('0x2b')](respondWithResult(_0x36cb9e,null))['catch'](handleError(_0x36cb9e,null));};exports[_0x1ac3('0x116')]=function(_0x206804,_0x3bfde3){return db['chatProactiveAction'][_0x1ac3('0x4e')]({'where':{'id':_0x206804[_0x1ac3('0x4d')]['id']}})[_0x1ac3('0x2b')](handleEntityNotFound(_0x3bfde3,null))['then'](function(_0x5a5652){if(_0x5a5652){return _0x5a5652[_0x1ac3('0x116')](_0x206804[_0x1ac3('0x55')]['ids'],_[_0x1ac3('0xe6')](_0x206804['body'],[_0x1ac3('0x5e'),'id'])||{});}})[_0x1ac3('0x2b')](respondWithResult(_0x3bfde3,null))[_0x1ac3('0x1c')](handleError(_0x3bfde3,null));};exports[_0x1ac3('0xfa')]=function(_0x3cce94,_0x278e1e){var _0x548bf4={};var _0x58e90f={};var _0x288554;var _0x2d165a;return db[_0x1ac3('0x33')][_0x1ac3('0x5a')]({'where':{'id':_0x3cce94[_0x1ac3('0x4d')]['id']}})[_0x1ac3('0x2b')](handleEntityNotFound(_0x278e1e,null))[_0x1ac3('0x2b')](function(_0x364e29){if(_0x364e29){_0x288554=_0x364e29;_0x58e90f[_0x1ac3('0x38')]=_[_0x1ac3('0x39')](db[_0x1ac3('0x117')][_0x1ac3('0x34')]);_0x58e90f[_0x1ac3('0x3a')]=_[_0x1ac3('0x39')](_0x3cce94[_0x1ac3('0x3a')]);_0x58e90f['filters']=_['intersection'](_0x58e90f[_0x1ac3('0x38')],_0x58e90f[_0x1ac3('0x3a')]);_0x548bf4[_0x1ac3('0x3e')]=_[_0x1ac3('0x3c')](_0x58e90f[_0x1ac3('0x38')],qs[_0x1ac3('0x3d')](_0x3cce94[_0x1ac3('0x3a')][_0x1ac3('0x3d')]));_0x548bf4['attributes']=_0x548bf4[_0x1ac3('0x3e')][_0x1ac3('0x3f')]?_0x548bf4['attributes']:_0x58e90f[_0x1ac3('0x38')];_0x548bf4[_0x1ac3('0x42')]=qs[_0x1ac3('0x43')](_0x3cce94[_0x1ac3('0x3a')][_0x1ac3('0x43')]);_0x548bf4['where']=qs[_0x1ac3('0x3b')](_['pick'](_0x3cce94[_0x1ac3('0x3a')],_0x58e90f['filters']));if(_0x3cce94['query'][_0x1ac3('0x45')]){_0x548bf4['where']=_[_0x1ac3('0x46')](_0x548bf4[_0x1ac3('0x44')],{'$or':_[_0x1ac3('0x32')](_0x548bf4[_0x1ac3('0x3e')],function(_0x165558){var _0x3cc6d4={};_0x3cc6d4[_0x165558]={'$like':'%'+_0x3cce94[_0x1ac3('0x3a')][_0x1ac3('0x45')]+'%'};return _0x3cc6d4;})});}_0x548bf4=_['merge']({},_0x548bf4,_0x3cce94[_0x1ac3('0x48')]);return _0x288554[_0x1ac3('0xfa')](_0x548bf4);}})['then'](function(_0xf345e1){if(_0xf345e1){_0x2d165a=_0xf345e1[_0x1ac3('0x3f')];if(!_0x3cce94[_0x1ac3('0x3a')][_0x1ac3('0x40')](_0x1ac3('0x41'))){_0x548bf4[_0x1ac3('0x23')]=qs['limit'](_0x3cce94[_0x1ac3('0x3a')]['limit']);_0x548bf4[_0x1ac3('0x21')]=qs['offset'](_0x3cce94[_0x1ac3('0x3a')]['offset']);}return _0x288554[_0x1ac3('0xfa')](_0x548bf4);}})[_0x1ac3('0x2b')](function(_0x59dede){if(_0x59dede){return _0x59dede?{'count':_0x2d165a,'rows':_0x59dede}:null;}})['then'](respondWithResult(_0x278e1e,null))[_0x1ac3('0x1c')](handleError(_0x278e1e,null));};exports[_0x1ac3('0x118')]=function(_0xcb9a15,_0x10eb8e){var _0x15d625=_0xcb9a15[_0x1ac3('0x3a')][_0x1ac3('0x119')]===_0x1ac3('0x11a')?_0x1ac3('0x11b'):'onlineForm';return db['ChatWebsite'][_0x1ac3('0x4e')]({'attributes':['id',_0x15d625],'where':{'id':_0xcb9a15[_0x1ac3('0x4d')]['id']}})[_0x1ac3('0x2b')](handleEntityNotFound(_0x10eb8e,null))[_0x1ac3('0x2b')](function(_0x51e630){if(_0x51e630){var _0x305e26=_0x51e630[_0x15d625];var _0x482e2f=_0x305e26&&_0x305e26['items']?_0x305e26[_0x1ac3('0x11c')]:[];_0x10eb8e[_0x1ac3('0x2e')]({'fromKey':_['isNil'](_0x305e26[_0x1ac3('0x11d')])?undefined:_0x305e26['fromKey'],'count':_0x482e2f[_0x1ac3('0x3f')],'rows':_0x482e2f});}})[_0x1ac3('0x1c')](handleError(_0x10eb8e,null));};exports[_0x1ac3('0x11e')]=function(_0x275da3,_0xe727bb){var _0x24fe39={'raw':![],'where':{}};var _0x492493={};var _0x368572={'count':0x0,'rows':[]};return db[_0x1ac3('0x33')]['findOne']({'where':{'id':_0x275da3[_0x1ac3('0x4d')]['id']}})[_0x1ac3('0x2b')](handleEntityNotFound(_0xe727bb,null))[_0x1ac3('0x2b')](function(_0x2b6612){if(_0x2b6612){_0x492493[_0x1ac3('0x38')]=_['keys'](db[_0x1ac3('0xc8')][_0x1ac3('0x34')]);_0x492493['query']=_[_0x1ac3('0x39')](_0x275da3[_0x1ac3('0x3a')]);_0x492493[_0x1ac3('0x3b')]=_[_0x1ac3('0x3c')](_0x492493[_0x1ac3('0x38')],_0x492493[_0x1ac3('0x3a')]);_0x24fe39[_0x1ac3('0x3e')]=_[_0x1ac3('0x3c')](_0x492493['model'],qs[_0x1ac3('0x3d')](_0x275da3[_0x1ac3('0x3a')]['fields']));_0x24fe39[_0x1ac3('0x3e')]=_0x24fe39['attributes'][_0x1ac3('0x3f')]?_0x24fe39['attributes']:_0x492493[_0x1ac3('0x38')];if(!_0x275da3[_0x1ac3('0x3a')][_0x1ac3('0x40')](_0x1ac3('0x41'))){_0x24fe39[_0x1ac3('0x23')]=qs[_0x1ac3('0x23')](_0x275da3[_0x1ac3('0x3a')][_0x1ac3('0x23')]);_0x24fe39[_0x1ac3('0x21')]=qs[_0x1ac3('0x21')](_0x275da3[_0x1ac3('0x3a')][_0x1ac3('0x21')]);}_0x24fe39['order']=qs['sort'](_0x275da3['query'][_0x1ac3('0x43')]);_0x24fe39[_0x1ac3('0x44')]=qs[_0x1ac3('0x3b')](_[_0x1ac3('0x5b')](_0x275da3[_0x1ac3('0x3a')],_0x492493[_0x1ac3('0x3b')]));_0x24fe39[_0x1ac3('0x44')][_0x1ac3('0x57')]=_0x2b6612['id'];if(_0x275da3['query']['filter']){_0x24fe39[_0x1ac3('0x44')]=_[_0x1ac3('0x46')](_0x24fe39[_0x1ac3('0x44')],{'$or':_[_0x1ac3('0x32')](_0x24fe39['attributes'],function(_0x3ce0f0){var _0x5a69c4={};_0x5a69c4[_0x3ce0f0]={'$like':'%'+_0x275da3[_0x1ac3('0x3a')][_0x1ac3('0x45')]+'%'};return _0x5a69c4;})});}_0x24fe39=_[_0x1ac3('0x46')]({},_0x24fe39,_0x275da3[_0x1ac3('0x48')]);return db[_0x1ac3('0xc8')]['count']({'where':_0x24fe39[_0x1ac3('0x44')]})[_0x1ac3('0x2b')](function(_0x181655){_0x368572[_0x1ac3('0x22')]=_0x181655;if(_0x275da3[_0x1ac3('0x3a')][_0x1ac3('0x5c')]){_0x24fe39['include']=[{'all':!![]}];}else{_0x24fe39['include']=[{'model':db[_0x1ac3('0x7d')],'as':_0x1ac3('0x11f'),'required':![]},{'model':db['Attachment'],'as':_0x1ac3('0x120'),'required':![]}];}return db[_0x1ac3('0xc8')][_0x1ac3('0x4a')](_0x24fe39);})['then'](function(_0x59ffb3){_0x368572[_0x1ac3('0x4b')]=_0x59ffb3;return _0x368572;});}})[_0x1ac3('0x2b')](respondWithFilteredResult(_0xe727bb,_0x24fe39))[_0x1ac3('0x1c')](handleError(_0xe727bb,null));};exports[_0x1ac3('0x121')]=function(_0x18a0bc,_0x56cee6){return db['ChatWebsite'][_0x1ac3('0x4e')]({'where':{'id':_0x18a0bc[_0x1ac3('0x4d')]['id']}})[_0x1ac3('0x2b')](handleEntityNotFound(_0x56cee6,null))[_0x1ac3('0x2b')](function(_0x2240b2){if(_0x2240b2){return _0x2240b2[_0x1ac3('0x121')](_0x18a0bc[_0x1ac3('0x55')][_0x1ac3('0x5e')],_['omit'](_0x18a0bc[_0x1ac3('0x55')],['ids','id'])||{})['spread'](function(_0x237816){for(var _0x42e142=0x0;_0x42e142<_0x18a0bc[_0x1ac3('0x55')][_0x1ac3('0x5e')][_0x1ac3('0x3f')];_0x42e142+=0x1){socket[_0x1ac3('0x122')]('userChatWebsite:save',{'UserId':Number(_0x18a0bc[_0x1ac3('0x55')]['ids'][_0x42e142]),'ChatWebsiteId':Number(_0x18a0bc[_0x1ac3('0x4d')]['id'])});}return _0x237816;});}})[_0x1ac3('0x2b')](respondWithResult(_0x56cee6,null))[_0x1ac3('0x1c')](handleError(_0x56cee6,null));};exports[_0x1ac3('0x123')]=function(_0x3bc651,_0x24b889){return db[_0x1ac3('0x33')][_0x1ac3('0x4e')]({'where':{'id':_0x3bc651[_0x1ac3('0x4d')]['id']}})['then'](handleEntityNotFound(_0x24b889,null))[_0x1ac3('0x2b')](function(_0x5778e2){if(_0x5778e2){return _0x5778e2[_0x1ac3('0x123')](_0x3bc651['query'][_0x1ac3('0x5e')])[_0x1ac3('0x2b')](function(){if(_[_0x1ac3('0x124')](_0x3bc651[_0x1ac3('0x3a')]['ids'])){for(var _0x246f52=0x0;_0x246f52<_0x3bc651[_0x1ac3('0x3a')][_0x1ac3('0x5e')]['length'];_0x246f52+=0x1){socket[_0x1ac3('0x122')]('userChatWebsite:remove',{'UserId':Number(_0x3bc651[_0x1ac3('0x3a')]['ids'][_0x246f52]),'ChatWebsiteId':Number(_0x3bc651['params']['id'])});}}else{socket['emit'](_0x1ac3('0x125'),{'UserId':Number(_0x3bc651[_0x1ac3('0x3a')][_0x1ac3('0x5e')]),'ChatWebsiteId':Number(_0x3bc651[_0x1ac3('0x4d')]['id'])});}});}})[_0x1ac3('0x2b')](respondWithStatusCode(_0x24b889,null))[_0x1ac3('0x1c')](handleError(_0x24b889,null));};exports['getAgents']=function(_0x1bd53f,_0x3c2cb8){var _0x463e39={};var _0x549504={};var _0x47aec5;var _0x2042d2;return db[_0x1ac3('0x33')][_0x1ac3('0x5a')]({'where':{'id':_0x1bd53f[_0x1ac3('0x4d')]['id']}})[_0x1ac3('0x2b')](handleEntityNotFound(_0x3c2cb8,null))[_0x1ac3('0x2b')](function(_0x595b8e){if(_0x595b8e){_0x47aec5=_0x595b8e;_0x549504[_0x1ac3('0x38')]=_['keys'](db[_0x1ac3('0xb1')][_0x1ac3('0x34')]);_0x549504[_0x1ac3('0x3a')]=_[_0x1ac3('0x39')](_0x1bd53f[_0x1ac3('0x3a')]);_0x549504['filters']=_[_0x1ac3('0x3c')](_0x549504[_0x1ac3('0x38')],_0x549504[_0x1ac3('0x3a')]);_0x463e39[_0x1ac3('0x3e')]=_[_0x1ac3('0x3c')](_0x549504[_0x1ac3('0x38')],qs['fields'](_0x1bd53f[_0x1ac3('0x3a')][_0x1ac3('0x3d')]));_0x463e39[_0x1ac3('0x3e')]=_0x463e39[_0x1ac3('0x3e')]['length']?_0x463e39[_0x1ac3('0x3e')]:_0x549504[_0x1ac3('0x38')];_0x463e39['order']=qs[_0x1ac3('0x43')](_0x1bd53f[_0x1ac3('0x3a')]['sort']);_0x463e39[_0x1ac3('0x44')]=qs[_0x1ac3('0x3b')](_[_0x1ac3('0x5b')](_0x1bd53f[_0x1ac3('0x3a')],_0x549504['filters']));if(_0x1bd53f[_0x1ac3('0x3a')][_0x1ac3('0x45')]){_0x463e39[_0x1ac3('0x44')]=_[_0x1ac3('0x46')](_0x463e39[_0x1ac3('0x44')],{'$or':_['map'](_0x463e39[_0x1ac3('0x3e')],function(_0x5e97f1){var _0x37ba8a={};_0x37ba8a[_0x5e97f1]={'$like':'%'+_0x1bd53f['query'][_0x1ac3('0x45')]+'%'};return _0x37ba8a;})});}_0x463e39=_['merge']({},_0x463e39,_0x1bd53f[_0x1ac3('0x48')]);return _0x47aec5[_0x1ac3('0x126')](_0x463e39);}})['then'](function(_0x58fd63){if(_0x58fd63){_0x2042d2=_0x58fd63[_0x1ac3('0x3f')];if(!_0x1bd53f[_0x1ac3('0x3a')][_0x1ac3('0x40')](_0x1ac3('0x41'))){_0x463e39[_0x1ac3('0x23')]=qs['limit'](_0x1bd53f[_0x1ac3('0x3a')][_0x1ac3('0x23')]);_0x463e39[_0x1ac3('0x21')]=qs['offset'](_0x1bd53f[_0x1ac3('0x3a')][_0x1ac3('0x21')]);}return _0x47aec5['getAgents'](_0x463e39);}})['then'](function(_0x59daa0){if(_0x59daa0){return _0x59daa0?{'count':_0x2042d2,'rows':_0x59daa0}:null;}})[_0x1ac3('0x2b')](respondWithResult(_0x3c2cb8,null))['catch'](handleError(_0x3c2cb8,null));}; \ No newline at end of file +var _0xc73a=['unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','agent','forcedOwnership','startRouting','EventManager','notify','offline','files','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','ids','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','iftime\x20%s,%s','interval','timezone','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','../../config/license/util','virtual','chatLicenseExceeded','some','server/files/chat/iframe.ejs','remote','x-real-ip','remoteAddress','verticalAlignment','labelText','textColor','backgroundColor','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','priority','getApplications','addProactiveActions','chatProactiveAction','omit','getProactiveActions','ChatProactiveAction','online','false','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','path','lodash','querystring','ioredis','../../config/logger','api','../../config/environment','redis','defaults','localhost','html-to-text','jayson/promise','client','http','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','get','ChatWebsites','UserProfileResource','sendStatus','stack','name','send','Pause','mandatoryDispositionPause','ChatWebsite','fieldName','key','model','map','query','keys','filters','intersection','attributes','order','sort','where','filter','merge','type','VIRTUAL','include','rows','show','rawAttributes','fields','length','includeAll','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','ChatWebsiteId','Disposition','findOne','hasOwnProperty','findAll','removeDispositions','CannedAnswer','getAnswers','nolimit','pick','removeAnswers','file','filename','addAvatar','addSystemAvatar','systemAvatar','join','root','server/files/images/logos/default_logo.svg','sitepic','getLicense','custom','server/files/images/logos/','download','agentAvatar','existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','getSystemAvatar','isNil','user-agent-parser','headers','user-agent','getResult','chat','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from','Sequelize','from\x20is\x20mandatory','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','Contacts','DESC','ChatApplication','account','Applications','list','applications','orderBy','ListId','contact','customerIp','cf-connecting-ip','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','ContactId','interaction','spread','messageId','created','autoclose','push','close'];(function(_0x4473f6,_0x10bcc4){var _0x2e2355=function(_0xb129bb){while(--_0xb129bb){_0x4473f6['push'](_0x4473f6['shift']());}};_0x2e2355(++_0x10bcc4);}(_0xc73a,0x72));var _0xac73=function(_0x172d90,_0x26f765){_0x172d90=_0x172d90-0x0;var _0x3d7b2d=_0xc73a[_0x172d90];return _0x3d7b2d;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0xac73('0x0'));var util=require(_0xac73('0x1'));var path=require(_0xac73('0x2'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xac73('0x3'));var querystring=require(_0xac73('0x4'));var Redis=require(_0xac73('0x5'));var qs=require('../../components/parsers/qs');var logger=require(_0xac73('0x6'))(_0xac73('0x7'));var config=require(_0xac73('0x8'));var db=require('../../mysqldb')['db'];config[_0xac73('0x9')]=_[_0xac73('0xa')](config[_0xac73('0x9')],{'host':_0xac73('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xac73('0x9')]));require('./chatWebsite.socket')['register'](socket);var htmlToText=require(_0xac73('0xc'));var jayson=require(_0xac73('0xd'));var client=jayson[_0xac73('0xe')][_0xac73('0xf')]({'port':0x232c});var client9002=jayson[_0xac73('0xe')][_0xac73('0xf')]({'port':0x232a});var client9003=jayson[_0xac73('0xe')][_0xac73('0xf')]({'port':0x232b});var client9001=jayson['client'][_0xac73('0xf')]({'port':0x2329});function respondWithRpcPromise(_0xda821e,_0x40d791,_0x7b4ade,_0x3caaa2){return new BPromise(function(_0x10c967,_0x5a7b74){var _0x20bcbc=_0x3caaa2||client;return _0x20bcbc['request'](_0xda821e,_0x7b4ade)[_0xac73('0x10')](function(_0x2e6c17){logger[_0xac73('0x11')](_0xac73('0x12'),_0x40d791,'request\x20sent');logger[_0xac73('0x13')](_0xac73('0x14'),_0x40d791,'request\x20sent',JSON[_0xac73('0x15')](_0x2e6c17));if(_0x2e6c17[_0xac73('0x16')]){if(_0x2e6c17[_0xac73('0x16')]['code']===0x1f4){logger[_0xac73('0x16')](_0xac73('0x12'),_0x40d791,_0x2e6c17[_0xac73('0x16')][_0xac73('0x17')]);return _0x5a7b74(_0x2e6c17[_0xac73('0x16')]['message']);}logger[_0xac73('0x16')](_0xac73('0x12'),_0x40d791,_0x2e6c17['error'][_0xac73('0x17')]);return _0x10c967(_0x2e6c17[_0xac73('0x16')][_0xac73('0x17')]);}else{logger[_0xac73('0x11')](_0xac73('0x12'),_0x40d791,_0xac73('0x18'));_0x10c967(_0x2e6c17[_0xac73('0x19')][_0xac73('0x17')]);}})[_0xac73('0x1a')](function(_0x5cb544){logger[_0xac73('0x16')](_0xac73('0x12'),_0x40d791,_0x5cb544);_0x5a7b74(_0x5cb544);});});}function respondWithStatusCode(_0x3b2c93,_0x5dcdfc){_0x5dcdfc=_0x5dcdfc||0xcc;return function(_0x40df24){if(_0x40df24){return _0x3b2c93['sendStatus'](_0x5dcdfc);}return _0x3b2c93[_0xac73('0x1b')](_0x5dcdfc)[_0xac73('0x1c')]();};}function respondWithResult(_0x1522ac,_0x205b3e){_0x205b3e=_0x205b3e||0xc8;return function(_0x317c1b){if(_0x317c1b){return _0x1522ac[_0xac73('0x1b')](_0x205b3e)[_0xac73('0x1d')](_0x317c1b);}};}function respondWithFilteredResult(_0x4df196,_0xc76c54){return function(_0x3e9d1c){if(_0x3e9d1c){var _0xf07e1f=typeof _0xc76c54[_0xac73('0x1e')]===_0xac73('0x1f')&&typeof _0xc76c54[_0xac73('0x20')]==='undefined';var _0xe031ce=_0x3e9d1c[_0xac73('0x21')];var _0x3370af=_0xf07e1f?0x0:_0xc76c54[_0xac73('0x1e')];var _0x3dceca=_0xf07e1f?_0x3e9d1c[_0xac73('0x21')]:_0xc76c54[_0xac73('0x1e')]+_0xc76c54[_0xac73('0x20')];var _0x35dd60;if(_0x3dceca>=_0xe031ce){_0x3dceca=_0xe031ce;_0x35dd60=0xc8;}else{_0x35dd60=0xce;}_0x4df196['status'](_0x35dd60);return _0x4df196[_0xac73('0x22')](_0xac73('0x23'),_0x3370af+'-'+_0x3dceca+'/'+_0xe031ce)[_0xac73('0x1d')](_0x3e9d1c);}return null;};}function saveUpdates(_0x13f185){return function(_0x424830){if(_0x424830){return _0x424830[_0xac73('0x24')](_0x13f185)['then'](function(_0x1b8221){return _0x1b8221;});}return null;};}function removeEntity(_0x2a9550){return function(_0x110f33){if(_0x110f33){return _0x110f33[_0xac73('0x25')]()['then'](function(){var _0x4050b9=_0x110f33[_0xac73('0x26')]({'plain':!![]});var _0x244b21=_0xac73('0x27');return db[_0xac73('0x28')][_0xac73('0x25')]({'where':{'type':_0x244b21,'resourceId':_0x4050b9['id']}})[_0xac73('0x10')](function(){return _0x110f33;});})[_0xac73('0x10')](function(){_0x2a9550[_0xac73('0x1b')](0xcc)[_0xac73('0x1c')]();});}};}function handleEntityNotFound(_0xdde9fc){return function(_0x1540da){if(!_0x1540da){_0xdde9fc[_0xac73('0x29')](0x194);}return _0x1540da;};}function handleError(_0x16ae29,_0x206e3f){_0x206e3f=_0x206e3f||0x1f4;return function(_0x28f723){logger[_0xac73('0x16')](_0x28f723[_0xac73('0x2a')]);if(_0x28f723['name']){delete _0x28f723[_0xac73('0x2b')];}_0x16ae29[_0xac73('0x1b')](_0x206e3f)[_0xac73('0x2c')](_0x28f723);};}exports['index']=function(_0x4c5b75,_0x1fbc93){var _0x4e3f16={'include':[{'model':db[_0xac73('0x2d')],'as':_0xac73('0x2e')}]},_0x509036={},_0x54bc35={'count':0x0,'rows':[]};var _0x23b3ef=_['map'](db[_0xac73('0x2f')]['rawAttributes'],function(_0xd6b142){return{'name':_0xd6b142[_0xac73('0x30')],'type':_0xd6b142['type'][_0xac73('0x31')]};});_0x509036[_0xac73('0x32')]=_[_0xac73('0x33')](_0x23b3ef,_0xac73('0x2b'));_0x509036[_0xac73('0x34')]=_[_0xac73('0x35')](_0x4c5b75[_0xac73('0x34')]);_0x509036[_0xac73('0x36')]=_[_0xac73('0x37')](_0x509036[_0xac73('0x32')],_0x509036['query']);_0x4e3f16[_0xac73('0x38')]=_['intersection'](_0x509036[_0xac73('0x32')],qs['fields'](_0x4c5b75[_0xac73('0x34')]['fields']));_0x4e3f16[_0xac73('0x38')]=_0x4e3f16[_0xac73('0x38')]['length']?_0x4e3f16[_0xac73('0x38')]:_0x509036[_0xac73('0x32')];if(!_0x4c5b75['query']['hasOwnProperty']('nolimit')){_0x4e3f16['limit']=qs[_0xac73('0x20')](_0x4c5b75['query']['limit']);_0x4e3f16['offset']=qs[_0xac73('0x1e')](_0x4c5b75[_0xac73('0x34')][_0xac73('0x1e')]);}_0x4e3f16[_0xac73('0x39')]=qs['sort'](_0x4c5b75['query'][_0xac73('0x3a')]);_0x4e3f16[_0xac73('0x3b')]=qs[_0xac73('0x36')](_['pick'](_0x4c5b75[_0xac73('0x34')],_0x509036[_0xac73('0x36')]),_0x23b3ef);if(_0x4c5b75['query'][_0xac73('0x3c')]){_0x4e3f16[_0xac73('0x3b')]=_[_0xac73('0x3d')](_0x4e3f16[_0xac73('0x3b')],{'$or':_['map'](_0x23b3ef,function(_0x59d295){if(_0x59d295[_0xac73('0x3e')]!==_0xac73('0x3f')){var _0x4f4cc3={};_0x4f4cc3[_0x59d295[_0xac73('0x2b')]]={'$like':'%'+_0x4c5b75[_0xac73('0x34')][_0xac73('0x3c')]+'%'};return _0x4f4cc3;}})});}_0x4e3f16=_[_0xac73('0x3d')]({},_0x4e3f16,_0x4c5b75['options']);var _0x409771={'where':_0x4e3f16[_0xac73('0x3b')]};return db['ChatWebsite'][_0xac73('0x21')](_0x409771)[_0xac73('0x10')](function(_0x2d0153){_0x54bc35[_0xac73('0x21')]=_0x2d0153;if(_0x4c5b75[_0xac73('0x34')]['includeAll']){_0x4e3f16[_0xac73('0x40')]=[{'all':!![]}];}return db[_0xac73('0x2f')]['findAll'](_0x4e3f16);})[_0xac73('0x10')](function(_0x404dfa){_0x54bc35[_0xac73('0x41')]=_0x404dfa;return _0x54bc35;})[_0xac73('0x10')](respondWithFilteredResult(_0x1fbc93,_0x4e3f16))[_0xac73('0x1a')](handleError(_0x1fbc93,null));};exports[_0xac73('0x42')]=function(_0x53e7b6,_0x231a9a){var _0x30804d={'raw':![],'where':{'id':_0x53e7b6['params']['id']},'include':[{'model':db[_0xac73('0x2d')],'as':'mandatoryDispositionPause'}]},_0x404ba8={};_0x404ba8[_0xac73('0x32')]=_[_0xac73('0x35')](db['ChatWebsite'][_0xac73('0x43')]);_0x404ba8['query']=_[_0xac73('0x35')](_0x53e7b6['query']);_0x404ba8[_0xac73('0x36')]=_[_0xac73('0x37')](_0x404ba8[_0xac73('0x32')],_0x404ba8[_0xac73('0x34')]);_0x30804d[_0xac73('0x38')]=_['intersection'](_0x404ba8[_0xac73('0x32')],qs[_0xac73('0x44')](_0x53e7b6['query'][_0xac73('0x44')]));_0x30804d[_0xac73('0x38')]=_0x30804d[_0xac73('0x38')][_0xac73('0x45')]?_0x30804d['attributes']:_0x404ba8['model'];if(_0x53e7b6[_0xac73('0x34')][_0xac73('0x46')]){_0x30804d[_0xac73('0x40')]=[{'all':!![]}];}_0x30804d=_[_0xac73('0x3d')]({},_0x30804d,_0x53e7b6[_0xac73('0x47')]);return db[_0xac73('0x2f')][_0xac73('0x48')](_0x30804d)[_0xac73('0x10')](handleEntityNotFound(_0x231a9a,null))['then'](respondWithResult(_0x231a9a,null))['catch'](handleError(_0x231a9a,null));};exports[_0xac73('0x49')]=function(_0x4e98c2,_0x150b02){return db[_0xac73('0x2f')][_0xac73('0x49')](_0x4e98c2[_0xac73('0x4a')],{})[_0xac73('0x10')](function(_0x459cb4){var _0x7b8601=_0x4e98c2['user'][_0xac73('0x26')]({'plain':!![]});if(!_0x7b8601)throw new Error(_0xac73('0x4b'));if(_0x7b8601['role']==='user'){var _0x31568a=_0x459cb4[_0xac73('0x26')]({'plain':!![]});var _0x4629c0=_0xac73('0x27');return db['UserProfileSection']['find']({'where':{'name':_0x4629c0,'userProfileId':_0x7b8601['userProfileId']},'raw':!![]})[_0xac73('0x10')](function(_0x56e971){if(_0x56e971&&_0x56e971[_0xac73('0x4c')]===0x0){return db[_0xac73('0x28')][_0xac73('0x49')]({'name':_0x31568a[_0xac73('0x2b')],'resourceId':_0x31568a['id'],'type':_0x56e971[_0xac73('0x2b')],'sectionId':_0x56e971['id']},{})[_0xac73('0x10')](function(){return _0x459cb4;});}else{return _0x459cb4;}})[_0xac73('0x1a')](function(_0x71f8fa){logger[_0xac73('0x16')](_0xac73('0x4d'),_0x71f8fa);throw _0x71f8fa;});}return _0x459cb4;})[_0xac73('0x10')](respondWithResult(_0x150b02,0xc9))['catch'](handleError(_0x150b02,null));};exports[_0xac73('0x24')]=function(_0x58e8d4,_0x452e56){if(_0x58e8d4[_0xac73('0x4a')]['id']){delete _0x58e8d4[_0xac73('0x4a')]['id'];}return db['ChatWebsite'][_0xac73('0x48')]({'where':{'id':_0x58e8d4['params']['id']},'include':[{'model':db[_0xac73('0x2d')],'as':_0xac73('0x2e')}]})[_0xac73('0x10')](handleEntityNotFound(_0x452e56,null))[_0xac73('0x10')](saveUpdates(_0x58e8d4['body'],null))[_0xac73('0x10')](respondWithResult(_0x452e56,null))[_0xac73('0x1a')](handleError(_0x452e56,null));};exports['destroy']=function(_0x293eb0,_0x340d3d){return db[_0xac73('0x2f')]['find']({'where':{'id':_0x293eb0[_0xac73('0x4e')]['id']}})[_0xac73('0x10')](handleEntityNotFound(_0x340d3d,null))[_0xac73('0x10')](removeEntity(_0x340d3d,null))['catch'](handleError(_0x340d3d,null));};exports[_0xac73('0x4f')]=function(_0x536e29,_0x3a6c51){return db['ChatWebsite']['describe']()[_0xac73('0x10')](respondWithResult(_0x3a6c51,null))[_0xac73('0x1a')](handleError(_0x3a6c51,null));};exports['addDisposition']=function(_0x316944,_0x4c6190){if(_0x316944['body']['id']){delete _0x316944[_0xac73('0x4a')]['id'];}return db[_0xac73('0x2f')]['find']({'where':{'id':_0x316944[_0xac73('0x4e')]['id']}})[_0xac73('0x10')](handleEntityNotFound(_0x4c6190,null))['then'](function(_0x34b18e){if(_0x34b18e){_0x316944[_0xac73('0x4a')][_0xac73('0x50')]=_0x34b18e['id'];return db[_0xac73('0x51')][_0xac73('0x49')](_0x316944[_0xac73('0x4a')]);}})['then'](respondWithResult(_0x4c6190,null))[_0xac73('0x1a')](handleError(_0x4c6190,null));};exports['getDispositions']=function(_0x4af499,_0x36eb58){var _0x3fe5fb={'raw':![],'where':{}};var _0x42fa51={};var _0x4b1eae={'count':0x0,'rows':[]};return db[_0xac73('0x2f')][_0xac73('0x52')]({'where':{'id':_0x4af499[_0xac73('0x4e')]['id']}})[_0xac73('0x10')](handleEntityNotFound(_0x36eb58,null))[_0xac73('0x10')](function(_0x468515){if(_0x468515){_0x42fa51['model']=_[_0xac73('0x35')](db[_0xac73('0x51')]['rawAttributes']);_0x42fa51[_0xac73('0x34')]=_[_0xac73('0x35')](_0x4af499[_0xac73('0x34')]);_0x42fa51[_0xac73('0x36')]=_['intersection'](_0x42fa51[_0xac73('0x32')],_0x42fa51[_0xac73('0x34')]);_0x3fe5fb[_0xac73('0x38')]=_['intersection'](_0x42fa51['model'],qs[_0xac73('0x44')](_0x4af499['query'][_0xac73('0x44')]));_0x3fe5fb['attributes']=_0x3fe5fb[_0xac73('0x38')][_0xac73('0x45')]?_0x3fe5fb[_0xac73('0x38')]:_0x42fa51[_0xac73('0x32')];if(!_0x4af499[_0xac73('0x34')][_0xac73('0x53')]('nolimit')){_0x3fe5fb[_0xac73('0x20')]=qs[_0xac73('0x20')](_0x4af499[_0xac73('0x34')][_0xac73('0x20')]);_0x3fe5fb[_0xac73('0x1e')]=qs[_0xac73('0x1e')](_0x4af499[_0xac73('0x34')][_0xac73('0x1e')]);}_0x3fe5fb['order']=qs['sort'](_0x4af499[_0xac73('0x34')]['sort']);_0x3fe5fb['where']=qs[_0xac73('0x36')](_['pick'](_0x4af499[_0xac73('0x34')],_0x42fa51[_0xac73('0x36')]));_0x3fe5fb[_0xac73('0x3b')]['ChatWebsiteId']=_0x468515['id'];if(_0x4af499[_0xac73('0x34')][_0xac73('0x3c')]){_0x3fe5fb[_0xac73('0x3b')]=_['merge'](_0x3fe5fb[_0xac73('0x3b')],{'$or':_[_0xac73('0x33')](_0x3fe5fb[_0xac73('0x38')],function(_0x273bfa){var _0x31b198={};_0x31b198[_0x273bfa]={'$like':'%'+_0x4af499[_0xac73('0x34')]['filter']+'%'};return _0x31b198;})});}_0x3fe5fb=_[_0xac73('0x3d')]({},_0x3fe5fb,_0x4af499[_0xac73('0x47')]);return db[_0xac73('0x51')][_0xac73('0x21')]({'where':_0x3fe5fb['where']})[_0xac73('0x10')](function(_0x269149){_0x4b1eae[_0xac73('0x21')]=_0x269149;if(_0x4af499[_0xac73('0x34')][_0xac73('0x46')]){_0x3fe5fb[_0xac73('0x40')]=[{'all':!![]}];}return db[_0xac73('0x51')][_0xac73('0x54')](_0x3fe5fb);})[_0xac73('0x10')](function(_0x1606de){_0x4b1eae['rows']=_0x1606de;return _0x4b1eae;});}})['then'](respondWithFilteredResult(_0x36eb58,_0x3fe5fb))['catch'](handleError(_0x36eb58,null));};exports['removeDispositions']=function(_0x405cda,_0x53b80a){return db[_0xac73('0x2f')][_0xac73('0x48')]({'where':{'id':_0x405cda[_0xac73('0x4e')]['id']}})[_0xac73('0x10')](handleEntityNotFound(_0x53b80a,null))[_0xac73('0x10')](function(_0x3f8d72){if(_0x3f8d72){return _0x3f8d72[_0xac73('0x55')](_0x405cda[_0xac73('0x34')]['ids']);}})['then'](respondWithStatusCode(_0x53b80a,null))[_0xac73('0x1a')](handleError(_0x53b80a,null));};exports['addAnswer']=function(_0x562b56,_0x1bc7de){if(_0x562b56[_0xac73('0x4a')]['id']){delete _0x562b56[_0xac73('0x4a')]['id'];}return db[_0xac73('0x2f')][_0xac73('0x48')]({'where':{'id':_0x562b56['params']['id']}})[_0xac73('0x10')](handleEntityNotFound(_0x1bc7de,null))[_0xac73('0x10')](function(_0x12c641){if(_0x12c641){_0x562b56[_0xac73('0x4a')][_0xac73('0x50')]=_0x12c641['id'];return db[_0xac73('0x56')][_0xac73('0x49')](_0x562b56[_0xac73('0x4a')]);}})[_0xac73('0x10')](respondWithResult(_0x1bc7de,null))[_0xac73('0x1a')](handleError(_0x1bc7de,null));};exports[_0xac73('0x57')]=function(_0x5b9cd9,_0x1dfa84){var _0x5eedb0={'raw':![],'where':{}};var _0x1e3608={};var _0x1740e0={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xac73('0x52')]({'where':{'id':_0x5b9cd9[_0xac73('0x4e')]['id']}})[_0xac73('0x10')](handleEntityNotFound(_0x1dfa84,null))[_0xac73('0x10')](function(_0x562958){if(_0x562958){_0x1e3608['model']=_[_0xac73('0x35')](db[_0xac73('0x56')]['rawAttributes']);_0x1e3608[_0xac73('0x34')]=_['keys'](_0x5b9cd9['query']);_0x1e3608['filters']=_[_0xac73('0x37')](_0x1e3608[_0xac73('0x32')],_0x1e3608[_0xac73('0x34')]);_0x5eedb0[_0xac73('0x38')]=_[_0xac73('0x37')](_0x1e3608['model'],qs[_0xac73('0x44')](_0x5b9cd9[_0xac73('0x34')][_0xac73('0x44')]));_0x5eedb0[_0xac73('0x38')]=_0x5eedb0['attributes'][_0xac73('0x45')]?_0x5eedb0['attributes']:_0x1e3608['model'];if(!_0x5b9cd9[_0xac73('0x34')][_0xac73('0x53')](_0xac73('0x58'))){_0x5eedb0[_0xac73('0x20')]=qs[_0xac73('0x20')](_0x5b9cd9[_0xac73('0x34')][_0xac73('0x20')]);_0x5eedb0['offset']=qs[_0xac73('0x1e')](_0x5b9cd9[_0xac73('0x34')][_0xac73('0x1e')]);}_0x5eedb0[_0xac73('0x39')]=qs[_0xac73('0x3a')](_0x5b9cd9[_0xac73('0x34')][_0xac73('0x3a')]);_0x5eedb0[_0xac73('0x3b')]=qs[_0xac73('0x36')](_[_0xac73('0x59')](_0x5b9cd9[_0xac73('0x34')],_0x1e3608[_0xac73('0x36')]));_0x5eedb0[_0xac73('0x3b')][_0xac73('0x50')]=_0x562958['id'];if(_0x5b9cd9[_0xac73('0x34')][_0xac73('0x3c')]){_0x5eedb0[_0xac73('0x3b')]=_['merge'](_0x5eedb0['where'],{'$or':_['map'](_0x5eedb0[_0xac73('0x38')],function(_0x1067c1){var _0x570445={};_0x570445[_0x1067c1]={'$like':'%'+_0x5b9cd9[_0xac73('0x34')][_0xac73('0x3c')]+'%'};return _0x570445;})});}_0x5eedb0=_[_0xac73('0x3d')]({},_0x5eedb0,_0x5b9cd9[_0xac73('0x47')]);return db[_0xac73('0x56')][_0xac73('0x21')]({'where':_0x5eedb0[_0xac73('0x3b')]})[_0xac73('0x10')](function(_0x29486f){_0x1740e0[_0xac73('0x21')]=_0x29486f;if(_0x5b9cd9[_0xac73('0x34')][_0xac73('0x46')]){_0x5eedb0[_0xac73('0x40')]=[{'all':!![]}];}return db[_0xac73('0x56')][_0xac73('0x54')](_0x5eedb0);})[_0xac73('0x10')](function(_0x429494){_0x1740e0[_0xac73('0x41')]=_0x429494;return _0x1740e0;});}})[_0xac73('0x10')](respondWithFilteredResult(_0x1dfa84,_0x5eedb0))[_0xac73('0x1a')](handleError(_0x1dfa84,null));};exports['removeAnswers']=function(_0x168f31,_0x3e203b){return db[_0xac73('0x2f')][_0xac73('0x48')]({'where':{'id':_0x168f31[_0xac73('0x4e')]['id']}})[_0xac73('0x10')](handleEntityNotFound(_0x3e203b,null))[_0xac73('0x10')](function(_0x37089f){if(_0x37089f){return _0x37089f[_0xac73('0x5a')](_0x168f31[_0xac73('0x34')]['ids']);}})[_0xac73('0x10')](respondWithStatusCode(_0x3e203b,null))[_0xac73('0x1a')](handleError(_0x3e203b,null));};exports['addLogo']=function(_0x34afe4,_0x48b485){_0x34afe4['body']['sitepic']=_0x34afe4[_0xac73('0x5b')][_0xac73('0x5c')];return db['ChatWebsite'][_0xac73('0x48')]({'where':{'id':_0x34afe4[_0xac73('0x4e')]['id']}})[_0xac73('0x10')](handleEntityNotFound(_0x48b485,null))['then'](saveUpdates(_0x34afe4[_0xac73('0x4a')],null))['then'](respondWithResult(_0x48b485,null))[_0xac73('0x1a')](handleError(_0x48b485,null));};exports[_0xac73('0x5d')]=function(_0x5eb3c7,_0x2d6861){_0x5eb3c7[_0xac73('0x4a')]['agentAvatar']=_0x5eb3c7[_0xac73('0x5b')][_0xac73('0x5c')];return db['ChatWebsite'][_0xac73('0x48')]({'where':{'id':_0x5eb3c7[_0xac73('0x4e')]['id']}})[_0xac73('0x10')](handleEntityNotFound(_0x2d6861,null))[_0xac73('0x10')](saveUpdates(_0x5eb3c7[_0xac73('0x4a')],null))[_0xac73('0x10')](respondWithResult(_0x2d6861,null))[_0xac73('0x1a')](handleError(_0x2d6861,null));};exports['addCustomerAvatar']=function(_0x4bba0e,_0x134c56){_0x4bba0e[_0xac73('0x4a')]['customerAvatar']=_0x4bba0e['file'][_0xac73('0x5c')];return db[_0xac73('0x2f')]['find']({'where':{'id':_0x4bba0e[_0xac73('0x4e')]['id']}})['then'](handleEntityNotFound(_0x134c56,null))['then'](saveUpdates(_0x4bba0e[_0xac73('0x4a')],null))['then'](respondWithResult(_0x134c56,null))[_0xac73('0x1a')](handleError(_0x134c56,null));};exports[_0xac73('0x5e')]=function(_0x3fa98b,_0x1d01bf){_0x3fa98b['body'][_0xac73('0x5f')]=_0x3fa98b[_0xac73('0x5b')]['filename'];return db[_0xac73('0x2f')][_0xac73('0x48')]({'where':{'id':_0x3fa98b[_0xac73('0x4e')]['id']}})[_0xac73('0x10')](handleEntityNotFound(_0x1d01bf,null))['then'](saveUpdates(_0x3fa98b['body'],null))[_0xac73('0x10')](respondWithResult(_0x1d01bf,null))[_0xac73('0x1a')](handleError(_0x1d01bf,null));};exports['getLogo']=function(_0xbfb88f,_0x5c98f1){var _0x5273db=path[_0xac73('0x60')](config[_0xac73('0x61')],_0xac73('0x62'));var _0x589462={'where':{'id':_0xbfb88f[_0xac73('0x4e')]['id']},'attributes':['id',_0xac73('0x63')],'raw':!![]};var _0x30b057=![];return require('../../config/license/util')[_0xac73('0x64')]()[_0xac73('0x10')](function(_0x2566fc){if(_0x2566fc){_0x30b057=_0x2566fc[_0xac73('0x65')];}})[_0xac73('0x10')](function(){return db[_0xac73('0x2f')][_0xac73('0x48')](_0x589462);})[_0xac73('0x10')](handleEntityNotFound(_0x5c98f1,null))[_0xac73('0x10')](function(_0xf7f25a){if(_0xf7f25a){if(!_['isNil'](_0xf7f25a['sitepic'])){if(fs['existsSync'](path[_0xac73('0x60')](config[_0xac73('0x61')],'server/files/images/logos/',_0xf7f25a[_0xac73('0x63')]))&&_0x30b057){_0x5273db=path[_0xac73('0x60')](config['root'],_0xac73('0x66'),_0xf7f25a[_0xac73('0x63')]);}}return _0x5c98f1[_0xac73('0x67')](_0x5273db);}})[_0xac73('0x1a')](handleError(_0x5c98f1,null));};exports['getAvatar']=function(_0x1a27c5,_0x16ee22){var _0x24364f=path[_0xac73('0x60')](config[_0xac73('0x61')],'server/files/images/avatars/default_avatar.png');var _0x800650={'where':{'id':_0x1a27c5[_0xac73('0x4e')]['id']},'attributes':['id',_0xac73('0x68')],'raw':!![]};return db[_0xac73('0x2f')][_0xac73('0x48')](_0x800650)[_0xac73('0x10')](handleEntityNotFound(_0x16ee22,null))[_0xac73('0x10')](function(_0x54a2ae){if(_0x54a2ae){if(!_['isNil'](_0x54a2ae['agentAvatar'])){if(fs[_0xac73('0x69')](path[_0xac73('0x60')](config[_0xac73('0x61')],_0xac73('0x6a'),_0x54a2ae[_0xac73('0x68')]))){_0x24364f=path['join'](config[_0xac73('0x61')],_0xac73('0x6a'),_0x54a2ae[_0xac73('0x68')]);}}return _0x16ee22[_0xac73('0x67')](_0x24364f);}})[_0xac73('0x1a')](handleError(_0x16ee22,null));};exports[_0xac73('0x6b')]=function(_0x3a5a1f,_0x1f1b37){var _0x45e3ec=path['join'](config[_0xac73('0x61')],_0xac73('0x6c'));var _0x2e06cf={'where':{'id':_0x3a5a1f[_0xac73('0x4e')]['id']},'attributes':['id',_0xac73('0x6d'),_0xac73('0x6e')],'raw':!![]};return db[_0xac73('0x2f')][_0xac73('0x48')](_0x2e06cf)[_0xac73('0x10')](handleEntityNotFound(_0x1f1b37,null))[_0xac73('0x10')](function(_0x2d8165){if(_0x2d8165){if(!_['isNil'](_0x2d8165[_0xac73('0x6d')])){if(fs['existsSync'](path['join'](config['root'],_0xac73('0x6a'),_0x2d8165[_0xac73('0x6d')]))&&_0x2d8165['showCustomerAvatar']){_0x45e3ec=path[_0xac73('0x60')](config[_0xac73('0x61')],'server/files/images/avatars/',_0x2d8165['customerAvatar']);}}return _0x1f1b37[_0xac73('0x67')](_0x45e3ec);}})[_0xac73('0x1a')](handleError(_0x1f1b37,null));};exports[_0xac73('0x6f')]=function(_0x10f631,_0x2a59f1){var _0x4161eb=path[_0xac73('0x60')](config[_0xac73('0x61')],'server/files/images/avatars/system_avatar.png');var _0x5b4c34={'where':{'id':_0x10f631['params']['id']},'attributes':['id',_0xac73('0x5f')],'raw':!![]};return db[_0xac73('0x2f')][_0xac73('0x48')](_0x5b4c34)[_0xac73('0x10')](handleEntityNotFound(_0x2a59f1,null))[_0xac73('0x10')](function(_0x18644d){if(_0x18644d){if(!_[_0xac73('0x70')](_0x18644d['systemAvatar'])){if(fs[_0xac73('0x69')](path['join'](config[_0xac73('0x61')],_0xac73('0x6a'),_0x18644d[_0xac73('0x5f')]))){_0x4161eb=path[_0xac73('0x60')](config[_0xac73('0x61')],'server/files/images/avatars/',_0x18644d[_0xac73('0x5f')]);}}return _0x2a59f1['download'](_0x4161eb);}})[_0xac73('0x1a')](handleError(_0x2a59f1,null));};exports['notify']=function(_0x5ea7a8,_0x4dd9b6){var _0x1d3be1=require(_0xac73('0x71'));var _0x164b2b=new _0x1d3be1();var _0x5c7583=_0x164b2b['setUA'](_0x5ea7a8[_0xac73('0x72')][_0xac73('0x73')])[_0xac73('0x74')]();var _0x108e15={'body':_0x5ea7a8[_0xac73('0x4a')],'channel':_0xac73('0x75')};var _0x2c3ce5=[];var _0x40fbcd=[];var _0xfdc818={};var _0x54732a=![];return db['CmContact'][_0xac73('0x4f')]()['then'](function(_0x2226be){if(!_0x2226be){throw new db['Sequelize'][(_0xac73('0x76'))](_0xac73('0x77'));}_0x2c3ce5=_[_0xac73('0x78')](_[_0xac73('0x35')](_0x2226be),['createdAt','updatedAt']);_0x40fbcd=_['difference'](_[_0xac73('0x35')](_0x2226be),[_0xac73('0x79'),_0xac73('0x7a'),_0xac73('0x7b'),'ListId']);if(_0x5ea7a8['body']['id']){delete _0x5ea7a8[_0xac73('0x4a')]['id'];}if(_['isNil'](_0x5ea7a8['body'][_0xac73('0x7c')])){throw new db[(_0xac73('0x7d'))][(_0xac73('0x76'))](_0xac73('0x7e'));}if(_['isNil'](_0x5ea7a8['body']['body'])||_0x5ea7a8[_0xac73('0x4a')][_0xac73('0x4a')]===''){throw new db[(_0xac73('0x7d'))][(_0xac73('0x76'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xac73('0x70')](_0x5ea7a8['body'][_0xac73('0x7f')])){throw new db[(_0xac73('0x7d'))][(_0xac73('0x76'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x40fbcd);}if(!_[_0xac73('0x80')](_0x40fbcd,_0x5ea7a8[_0xac73('0x4a')][_0xac73('0x7f')])){throw new db[(_0xac73('0x7d'))]['ValidationError'](_0xac73('0x81')+_0x40fbcd);}_0xfdc818[_0x5ea7a8[_0xac73('0x4a')][_0xac73('0x7f')]]=_0x5ea7a8[_0xac73('0x4a')][_0xac73('0x7c')];})[_0xac73('0x10')](function(){return db[_0xac73('0x2f')]['find']({'where':{'id':_0x5ea7a8[_0xac73('0x4e')]['id']},'include':[{'model':db[_0xac73('0x82')],'as':_0xac73('0x83'),'include':[{'model':db[_0xac73('0x84')],'as':_0xac73('0x85'),'where':_0xfdc818,'limit':0x1,'order':[[_0xac73('0x7a'),_0xac73('0x86')]]}]},{'model':db[_0xac73('0x87')],'as':'Applications'}]});})[_0xac73('0x10')](handleEntityNotFound(_0x4dd9b6,null))[_0xac73('0x10')](function(_0x4f8e9e){if(_0x4f8e9e&&_0x4f8e9e[_0xac73('0x83')]){_0x108e15[_0xac73('0x88')]=_0x4f8e9e;_0x108e15['applications']=_0x4f8e9e[_0xac73('0x89')];_0x108e15[_0xac73('0x8a')]=_0x4f8e9e[_0xac73('0x83')];_0x108e15[_0xac73('0x8b')]=_[_0xac73('0x8c')](_0x108e15[_0xac73('0x8b')],['priority'],['asc']);if(_0x108e15[_0xac73('0x88')][_0xac73('0x89')]){delete _0x108e15[_0xac73('0x88')]['Applications'];}if(_0x108e15[_0xac73('0x88')][_0xac73('0x83')]&&_0x108e15[_0xac73('0x88')][_0xac73('0x83')][_0xac73('0x85')][_0xac73('0x45')]){return _0x108e15['account']['List']['Contacts'][0x0];}var _0x34762e=_[_0xac73('0xa')](_0x5ea7a8[_0xac73('0x4a')],{'firstName':_0x5ea7a8[_0xac73('0x4a')][_0xac73('0x7c')],'ListId':_0x4f8e9e[_0xac73('0x8d')]});_0x34762e[_0x5ea7a8['body']['mapKey']]=_0x5ea7a8[_0xac73('0x4a')][_0xac73('0x7c')];return db[_0xac73('0x84')]['create'](_0x34762e,{'fields':_0x2c3ce5,'raw':!![]});}})[_0xac73('0x10')](handleEntityNotFound(_0x4dd9b6,null))[_0xac73('0x10')](function(_0x2607e8){_0x108e15[_0xac73('0x8e')]=_0x2607e8;var _0x5917a5=_0x5ea7a8[_0xac73('0x4a')][_0xac73('0x8f')];if(_0x5ea7a8['headers'][_0xac73('0x90')]){_0x5917a5=_0x5ea7a8[_0xac73('0x72')][_0xac73('0x90')];}else if(_0x5ea7a8[_0xac73('0x72')][_0xac73('0x91')]){_0x5917a5=_['first'](_0x5ea7a8[_0xac73('0x72')][_0xac73('0x91')][_0xac73('0x92')](','));}if(_0x2607e8){var _0x4c40f3={'ContactId':_0x2607e8['id'],'ChatWebsiteId':_0x5ea7a8[_0xac73('0x4e')]['id'],'from':(_0x2607e8[_0xac73('0x93')]||'')+'\x20'+(_0x2607e8[_0xac73('0x94')]||''),'customerIp':_0x5917a5,'customerPort':_0x5ea7a8[_0xac73('0x72')][_0xac73('0x95')]?_0x5ea7a8[_0xac73('0x72')]['x-real-port']:null,'referer':_0x5ea7a8[_0xac73('0x4a')][_0xac73('0x96')],'browserName':_0x5c7583[_0xac73('0x97')][_0xac73('0x2b')]&&_0x5c7583[_0xac73('0x97')][_0xac73('0x98')]?util[_0xac73('0x99')](_0xac73('0x9a'),_0x5c7583['browser']['name'],_0x5c7583[_0xac73('0x97')][_0xac73('0x98')]):'unknown','browserVersion':_0x5c7583[_0xac73('0x97')][_0xac73('0x98')]||_0xac73('0x9b'),'osName':util['format'](_0xac73('0x9a'),_0x5c7583['os']['name'],_0x5c7583['os'][_0xac73('0x98')]),'osVersion':_0x5c7583['os'][_0xac73('0x98')],'deviceModel':_0x5c7583[_0xac73('0x9c')][_0xac73('0x32')]&&_0x5c7583[_0xac73('0x9c')][_0xac73('0x9d')]?util['format'](_0xac73('0x9e'),_0x5c7583['device'][_0xac73('0x32')],_0x5c7583[_0xac73('0x9c')][_0xac73('0x9d')],_0x5c7583['device'][_0xac73('0x3e')]):null,'deviceVendor':_0x5c7583['device'][_0xac73('0x9d')],'deviceType':_0x5c7583['device'][_0xac73('0x3e')],'formData':JSON[_0xac73('0x15')](_0x5ea7a8[_0xac73('0x4a')])};var _0x444593={'ChatWebsiteId':_0x5ea7a8[_0xac73('0x4e')]['id'],'closed':![]};if(_0x5ea7a8[_0xac73('0x4a')][_0xac73('0x9f')]){_0x444593['threadId']=_0x5ea7a8['body'][_0xac73('0x9f')];return db[_0xac73('0xa0')]['find']({'where':_0x444593})['then'](function(_0x1e792d){if(_0x1e792d){return[_0x1e792d,![]];}_0x4c40f3['threadId']=_0x5ea7a8[_0xac73('0x4a')]['threadId'];_0x4c40f3['externalUrl']=_0x5ea7a8['body']['externalUrl'];return db[_0xac73('0xa0')]['create'](_0x4c40f3)[_0xac73('0x10')](function(_0x4f9234){return[_0x4f9234,!![]];});});}_0x444593[_0xac73('0xa1')]=_0x2607e8['id'];if(_0x5ea7a8[_0xac73('0x4a')]['interaction']&&_0x5ea7a8['body'][_0xac73('0xa2')]['id']){_0x444593['id']=_0x5ea7a8[_0xac73('0x4a')][_0xac73('0xa2')]['id'];return db[_0xac73('0xa0')][_0xac73('0x48')]({'where':_0x444593})[_0xac73('0x10')](function(_0x1247ec){if(_0x1247ec){return[_0x1247ec,![]];}return db['ChatInteraction']['create'](_0x4c40f3)['then'](function(_0x3aa705){return[_0x3aa705,!![]];});});}return db[_0xac73('0xa0')][_0xac73('0x49')](_0x4c40f3)[_0xac73('0x10')](function(_0xffd606){return[_0xffd606,!![]];});}})[_0xac73('0xa3')](function(_0x1615e7,_0x2f5a89){if(_0x1615e7){_0x54732a=_0x2f5a89;if(!_0x2f5a89){var _0x387cee={'from':(_0x108e15[_0xac73('0x8e')][_0xac73('0x93')]||'')+'\x20'+(_0x108e15[_0xac73('0x8e')]['lastName']||'')};if(_0x5ea7a8[_0xac73('0x4a')][_0xac73('0x9f')]&&_0x5ea7a8[_0xac73('0x4a')][_0xac73('0xa4')]&&_0x5ea7a8['body']['threadId']!=_0x5ea7a8[_0xac73('0x4a')][_0xac73('0xa4')]){_0x387cee['threadId']=_0x5ea7a8['body']['messageId'];}return _0x1615e7[_0xac73('0x24')](_0x387cee);}else{return _0x1615e7;}}})[_0xac73('0x10')](function(_0x36321a){_0x108e15[_0xac73('0xa2')]=_0x36321a[_0xac73('0x26')]({'plain':!![]});_0x108e15[_0xac73('0xa2')][_0xac73('0xa5')]=_0x54732a;if(_0x108e15[_0xac73('0xa2')][_0xac73('0xa5')]){if(_0x108e15[_0xac73('0x88')][_0xac73('0xa6')]){_0x108e15[_0xac73('0x8b')][_0xac73('0xa7')]({'id':0x0,'priority':_0x108e15[_0xac73('0x8b')][_0xac73('0x45')]+0x1,'app':_0xac73('0xa8'),'appdata':_0xac73('0xa9'),'interval':_0xac73('0xaa')});}}return db[_0xac73('0xab')]['create']({'body':_0x5ea7a8[_0xac73('0x4a')][_0xac73('0x4a')],'ChatWebsiteId':_0x5ea7a8[_0xac73('0x4e')]['id'],'ChatInteractionId':_0x36321a['id'],'direction':'in','ContactId':_0x108e15['contact']['id'],'AttachmentId':_0x5ea7a8['body'][_0xac73('0xac')]});})['then'](function(_0x5e54c7){_0x108e15[_0xac73('0x17')]=_0x5e54c7;if(_0x108e15[_0xac73('0xa2')][_0xac73('0xad')]){return db['User'][_0xac73('0x48')]({'attributes':['id','name'],'where':{'id':_0x108e15[_0xac73('0xa2')][_0xac73('0xad')]}})[_0xac73('0x10')](function(_0x38b303){if(_0x38b303){_0x108e15[_0xac73('0x8b')]['unshift']({'id':0x0,'priority':0x0,'app':_0xac73('0xae'),'appdata':_0x38b303[_0xac73('0x2b')]+','+(_0x108e15[_0xac73('0x88')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0x108e15[_0xac73('0xaf')]=!![];}return respondWithRpcPromise('Start',_0xac73('0xb0'),_0x108e15);});}return respondWithRpcPromise('Start',_0xac73('0xb0'),_0x108e15);})[_0xac73('0x10')](function(_0x22f588){respondWithRpcPromise(_0xac73('0xb1'),'EventManager',{'event':_0xac73('0xb2'),'message':_0x22f588},client9002);return _0x22f588;})[_0xac73('0x10')](respondWithResult(_0x4dd9b6,null))['catch'](handleError(_0x4dd9b6,null));};exports[_0xac73('0xb3')]=function(_0x3e842a,_0x4f8fcc){var _0x506df6,_0x213db5,_0x4915c1;var _0x266e7f=[];var _0x3cbb2e={};var _0x236915=_0x3e842a[_0xac73('0xb4')]||[];var _0x31b3f7=[];var _0x3ada16;return db[_0xac73('0x84')][_0xac73('0x4f')]()[_0xac73('0x10')](function(_0x34ab0e){if(!_0x34ab0e){throw new db[(_0xac73('0x7d'))][(_0xac73('0x76'))](_0xac73('0x77'));}_0x266e7f=_[_0xac73('0x78')](_[_0xac73('0x35')](_0x34ab0e),[_0xac73('0x79'),_0xac73('0x7a'),_0xac73('0x7b'),'ListId']);if(_0x3e842a[_0xac73('0x4a')]['id']){delete _0x3e842a[_0xac73('0x4a')]['id'];}if(_[_0xac73('0x70')](_0x3e842a[_0xac73('0x4a')][_0xac73('0x7c')])){throw _0x4f8fcc[_0xac73('0x1b')](0x1f4)[_0xac73('0x2c')](new db[(_0xac73('0x7d'))][(_0xac73('0x76'))](_0xac73('0x7e')));}if(_['isNil'](_0x3e842a[_0xac73('0x4a')][_0xac73('0x4a')])||_0x3e842a[_0xac73('0x4a')][_0xac73('0x4a')]===''){throw _0x4f8fcc[_0xac73('0x1b')](0x1f4)['send'](new db[(_0xac73('0x7d'))][(_0xac73('0x76'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xac73('0x70')](_0x3e842a[_0xac73('0x4a')]['mapKeyOffline'])){throw _0x4f8fcc['status'](0x1f4)['send'](new db[(_0xac73('0x7d'))][(_0xac73('0x76'))](_0xac73('0xb5')+_0x266e7f));}if(!_[_0xac73('0x80')](_0x266e7f,_0x3e842a[_0xac73('0x4a')][_0xac73('0xb6')])){throw _0x4f8fcc['status'](0x1f4)['send'](new db[(_0xac73('0x7d'))][(_0xac73('0x76'))](_0xac73('0xb7')+_0x266e7f));}_0x3cbb2e[_0x3e842a[_0xac73('0x4a')][_0xac73('0xb6')]]=_0x3e842a[_0xac73('0x4a')][_0xac73('0x7c')];})['then'](function(){return db[_0xac73('0x2f')][_0xac73('0x48')]({'where':{'id':_0x3e842a[_0xac73('0x4e')]['id']},'include':[{'model':db[_0xac73('0x82')],'as':'List'},{'model':db[_0xac73('0xb8')],'as':'MailAccount'}]});})['then'](handleEntityNotFound(_0x4f8fcc,null))[_0xac73('0x10')](function(_0x38d7fe){if(_0x38d7fe&&_0x38d7fe[_0xac73('0x83')]){_0x213db5=_0x38d7fe;var _0x4e11fd=_[_0xac73('0xa')](_0x3e842a[_0xac73('0x4a')],{'firstName':_0x3e842a['body'][_0xac73('0x7c')],'phone':_0x3e842a[_0xac73('0x4a')][_0xac73('0x7c')],'ListId':_0x38d7fe[_0xac73('0x8d')]});_0x4e11fd[_0x3e842a[_0xac73('0x4a')][_0xac73('0xb6')]]=_0x3e842a[_0xac73('0x4a')][_0xac73('0x7c')];return db[_0xac73('0x84')]['findOrCreate']({'where':_0x3cbb2e,'defaults':_0x4e11fd});}})[_0xac73('0xa3')](function(_0x4623ff){if(_0x4623ff){_0x4915c1=_0x4623ff;var _0x586ed1=fs[_0xac73('0xb9')](path[_0xac73('0x60')](config[_0xac73('0x61')],_0xac73('0xba')),_0xac73('0xbb'));var _0x2542fa=ejs[_0xac73('0xbc')](_0x586ed1,{'body':_[_0xac73('0xbd')](_0x3e842a[_0xac73('0x4a')][_0xac73('0x4a')]),'bodyTitle':_0x213db5[_0xac73('0xbe')]});return db['ChatOfflineMessage'][_0xac73('0x49')]({'body':_0x2542fa,'plainBody':htmlToText['fromString'](_0x2542fa),'ContactId':_0x4623ff['id'],'ChatWebsiteId':_0x213db5['id']});}})['then'](function(_0x15ac18){_0x3ada16=_0x15ac18;if(_0x236915[_0xac73('0x45')]){var _0x658fb5=_0x236915['map'](function(_0x188d4f){return{'name':_0x188d4f[_0xac73('0xbf')],'basename':_0x188d4f[_0xac73('0x5c')],'type':_0x188d4f[_0xac73('0xc0')],'ChatOfflineMessageId':_0x15ac18['id']};});_0x31b3f7=_0x658fb5[_0xac73('0x33')](_0x3d4bcc=>{var _0x462e9d={'filename':_0x3d4bcc[_0xac73('0x2b')],'path':path[_0xac73('0x60')](config['root'],_0xac73('0xc1'),_0xac73('0xb4'),_0xac73('0xc2'),_0xac73('0xc3'),_0x3d4bcc[_0xac73('0xc4')])};return _0x462e9d;});if(!_0x213db5[_0xac73('0xc5')]){return db[_0xac73('0xc6')][_0xac73('0xc7')](function(_0x577311){return db[_0xac73('0xc8')][_0xac73('0xc9')](_0x658fb5,{'transaction':_0x577311});});}}})['then'](function(){if(_0x3ada16){_0x506df6=_0x3ada16;return db[_0xac73('0xb8')][_0xac73('0x52')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xac73('0xca'),'raw':!![],'include':[{'model':db[_0xac73('0xcb')],'as':_0xac73('0xcb'),'raw':!![]}]}]});}})[_0xac73('0x10')](function(_0x342a8a){if(_0x342a8a&&_0x342a8a['Smtp']&&_0x213db5['forwardOffline']&&_0x213db5['forwardOfflineAddress']){var _0xf7188b=_0x342a8a[_0xac73('0xcc')]();return respondWithRpcPromise(_0xac73('0xcd'),_0xac73('0xce'),{'account':_0xf7188b,'message':{'from':util[_0xac73('0x99')](_0xac73('0xcf'),_0x342a8a[_0xac73('0x2b')],_0x342a8a[_0xac73('0xd0')]||_0x342a8a[_0xac73('0xca')]['user']),'to':_0x213db5[_0xac73('0xd1')],'subject':_0x213db5[_0xac73('0xd2')],'html':_0x506df6['body'],'attachments':_0x31b3f7}},client9003)[_0xac73('0x10')](function(){return _0x506df6;})[_0xac73('0x1a')](function(_0x31697a){logger['error'](_0x31697a);});}})[_0xac73('0x10')](function(){if(_0x213db5&&_0x213db5[_0xac73('0xc5')]&&_0x213db5[_0xac73('0xd3')]){var _0x79f159=[];if(_0x236915[_0xac73('0x45')]){_0x79f159=_0x236915['map'](function(_0x5eba99){return{'name':_0x5eba99[_0xac73('0xbf')],'basename':_0x5eba99[_0xac73('0x5c')],'type':_0x5eba99['mimetype'],'ChatOfflineMessageId':_0x3ada16['id']};});}var _0x154851;if(!_['isNil'](_0x213db5[_0xac73('0xd4')])){var _0x1e9533=_[_0xac73('0x33')](_0x3e842a[_0xac73('0x4a')],function(_0x40a218){return _0x40a218;});var _0x140241=_[_0xac73('0xd5')](_0x1e9533)[0x0];var _0x1823c6=_[_0xac73('0xd6')](_0x140241,function(_0x21132e){return _0x21132e;});_0x154851=_0x1823c6[0x1][_0x213db5[_0xac73('0xd4')]];}var _0x4adf48={'from':_0x4915c1['email'],'firstName':_0x4915c1[_0xac73('0x93')],'lastName':_0x4915c1['lastName'],'mapKey':_0xac73('0xd0'),'message':{'from':_0x4915c1[_0xac73('0xd0')],'to':_0x213db5[_0xac73('0xb8')]['email'],'cc':'','subject':_['isNil'](_0x154851)?_0x213db5[_0xac73('0xd2')]:_0x154851,'messageId':'','sentAt':new Date(),'attach':_0x79f159[_0xac73('0x45')],'attachments':_0x79f159,'originChannel':_0xac73('0xd7'),'ChatWebsiteId':_0x213db5['id'],'ChatOfflineMessageId':_0x506df6['id'],'originTo':_0x213db5[_0xac73('0xb8')]['email']},'body':_0x506df6[_0xac73('0x4a')]};var _0x2ec1f7={'account':{'id':_0x213db5['MailAccountId']},'body':_0x4adf48,'log':_0xac73('0xd8')};return respondWithRpcPromise(_0xac73('0xd8'),'notifyMail',_0x2ec1f7,client9001)[_0xac73('0x10')](function(){return _0x506df6;})[_0xac73('0x1a')](function(_0x2dc353){logger[_0xac73('0x16')](_0x2dc353);});}return;})['then'](function(){if(_0x506df6){return _0x506df6;}})[_0xac73('0x10')](respondWithResult(_0x4f8fcc,null))['catch'](function(_0x18e070){logger[_0xac73('0x16')](_0xac73('0x1a'),_0x18e070);for(var _0x26bfda of _0x236915){var _0x1a4b06=path[_0xac73('0x60')](config['root'],'server','files',_0xac73('0xc2'),'offline-chat',_0x26bfda[_0xac73('0x5c')]);fs_extra[_0xac73('0xd9')](_0x1a4b06)[_0xac73('0x1a')](function(_0x52b2d8){logger[_0xac73('0x16')](_0xac73('0xda'),_0x1a4b06,_0x52b2d8);});}});};exports[_0xac73('0xdb')]=function(_0x52a43a,_0x39ffc1){return db['ChatInteraction']['find']({'where':{'id':_0x52a43a['params']['id']}})[_0xac73('0x10')](handleEntityNotFound(_0x39ffc1,null))['then'](function(_0x1c5918){if(_0x1c5918){return _0x1c5918['addInteraction'](_0x52a43a[_0xac73('0x4a')]['ids'],_['omit'](_0x52a43a[_0xac73('0x4a')],[_0xac73('0xdc'),'id'])||{});}})[_0xac73('0x10')](respondWithResult(_0x39ffc1,null))['catch'](handleError(_0x39ffc1,null));};exports[_0xac73('0xdd')]=function(_0xfeb9cc,_0x34d4a5){var _0x1b5c39={'raw':![],'where':{}};var _0x416ff9={};var _0x5e332f={'count':0x0,'rows':[]};return db[_0xac73('0x2f')][_0xac73('0x52')]({'where':{'id':_0xfeb9cc[_0xac73('0x4e')]['id']}})[_0xac73('0x10')](handleEntityNotFound(_0x34d4a5,null))[_0xac73('0x10')](function(_0x46ca1b){if(_0x46ca1b){_0x416ff9['model']=_[_0xac73('0x35')](db[_0xac73('0xa0')]['rawAttributes']);_0x416ff9[_0xac73('0x34')]=_[_0xac73('0x35')](_0xfeb9cc[_0xac73('0x34')]);_0x416ff9[_0xac73('0x36')]=_['intersection'](_0x416ff9['model'],_0x416ff9['query']);_0x1b5c39[_0xac73('0x38')]=_[_0xac73('0x37')](_0x416ff9['model'],qs['fields'](_0xfeb9cc['query'][_0xac73('0x44')]));_0x1b5c39[_0xac73('0x38')]=_0x1b5c39[_0xac73('0x38')]['length']?_0x1b5c39[_0xac73('0x38')]:_0x416ff9['model'];if(!_0xfeb9cc[_0xac73('0x34')][_0xac73('0x53')](_0xac73('0x58'))){_0x1b5c39[_0xac73('0x20')]=qs[_0xac73('0x20')](_0xfeb9cc['query']['limit']);_0x1b5c39[_0xac73('0x1e')]=qs[_0xac73('0x1e')](_0xfeb9cc[_0xac73('0x34')]['offset']);}_0x1b5c39[_0xac73('0x39')]=qs['sort'](_0xfeb9cc['query']['sort']);_0x1b5c39[_0xac73('0x3b')]=qs[_0xac73('0x36')](_[_0xac73('0x59')](_0xfeb9cc[_0xac73('0x34')],_0x416ff9[_0xac73('0x36')]));_0x1b5c39[_0xac73('0x3b')][_0xac73('0x50')]=_0x46ca1b['id'];if(_0xfeb9cc['query'][_0xac73('0x3c')]){_0x1b5c39['where']=_[_0xac73('0x3d')](_0x1b5c39['where'],{'$or':_[_0xac73('0x33')](_0x1b5c39['attributes'],function(_0x4de0b6){var _0xcd1de5={};_0xcd1de5[_0x4de0b6]={'$like':'%'+_0xfeb9cc[_0xac73('0x34')]['filter']+'%'};return _0xcd1de5;})});}_0x1b5c39=_['merge']({},_0x1b5c39,_0xfeb9cc[_0xac73('0x47')]);return db[_0xac73('0xa0')]['count']({'where':_0x1b5c39[_0xac73('0x3b')]})[_0xac73('0x10')](function(_0x22ebc3){_0x5e332f[_0xac73('0x21')]=_0x22ebc3;if(_0xfeb9cc[_0xac73('0x34')]['includeAll']){_0x1b5c39[_0xac73('0x40')]=[{'model':db[_0xac73('0x84')],'as':_0xac73('0xde'),'required':![]},{'model':db[_0xac73('0xdf')],'as':_0xac73('0xe0'),'attributes':['name',_0xac73('0xe1'),_0xac73('0xe2')],'required':![]},{'model':db[_0xac73('0xe3')],'as':_0xac73('0xe4'),'attributes':['id',_0xac73('0x2b'),_0xac73('0xe5')],'where':_0xfeb9cc['query']['tag']?{'id':_0xfeb9cc[_0xac73('0x34')][_0xac73('0xe6')]}:undefined,'required':_0xfeb9cc['query'][_0xac73('0xe6')]?!![]:![]}];}return db[_0xac73('0xa0')][_0xac73('0x54')](_0x1b5c39);})[_0xac73('0x10')](function(_0x500c28){_0x5e332f['rows']=_0x500c28;return _0x5e332f;});}})[_0xac73('0x10')](respondWithFilteredResult(_0x34d4a5,_0x1b5c39))[_0xac73('0x1a')](handleError(_0x34d4a5,null));};function iftimePromise(_0x2de164,_0x54660a){return respondWithRpcPromise(_0xac73('0xe7'),_0xac73('0xe8'),{'command':_0x54660a['timezone']?util[_0xac73('0x99')](_0xac73('0xe9'),_0x2de164[_0xac73('0xea')],_0x54660a[_0xac73('0xeb')]):util[_0xac73('0x99')](_0xac73('0xec'),_0x2de164['interval'])},client9002)[_0xac73('0x10')](function(_0x387884){var _0x58e267=_0x387884&&_0x387884[_0xac73('0xed')](_0xac73('0xee'))>=0x0?!![]:![];logger[_0xac73('0x11')](_0xac73('0xef'),_0x54660a['id'],_0x2de164['id'],_0x2de164[_0xac73('0xea')],_0x58e267?_0xac73('0xf0'):_0xac73('0xf1'),_0x54660a[_0xac73('0xeb')]?_0x54660a[_0xac73('0xeb')]:_0xac73('0xf2'));return _0x58e267;})[_0xac73('0x1a')](function(_0x299da6){logger[_0xac73('0x16')](_0xac73('0xef'),_0x54660a['id'],_0x2de164['id'],_0x2de164[_0xac73('0xea')],util[_0xac73('0xf3')](_0x299da6,{'showHidden':![],'depth':null}),_0x54660a[_0xac73('0xeb')]?_0x54660a[_0xac73('0xeb')]:_0xac73('0xf2'));return![];});}exports['getSnippet']=function(_0x27edf2,_0x2a688b){var _0x4810f8=0x0;var _0x2e4f8a=0x0;var _0x78824c=![];var _0x3daa39;var _0x4788b7;return db[_0xac73('0x2f')][_0xac73('0x48')]({'where':{'id':_0x27edf2['params']['id']},'include':[{'model':db[_0xac73('0xf4')],'as':_0xac73('0xf4'),'include':[{'model':db[_0xac73('0xf4')],'as':_0xac73('0xf5'),'attributes':['id','interval'],'raw':!![]}]}]})[_0xac73('0x10')](handleEntityNotFound(_0x2a688b,null))[_0xac73('0x10')](function(_0x7ce9ce){if(_0x7ce9ce){_0x3daa39=_0x7ce9ce;return _0x7ce9ce['getProactiveActions']({'raw':!![]});}})[_0xac73('0x10')](function(_0x4dcc46){if(_0x3daa39){if(_0x4dcc46){_0x4788b7=_0x4dcc46;}}return require(_0xac73('0xf6'))['getLicense']();})['then'](function(_0xf34c9){if(_0xf34c9){_0x2e4f8a=_0xf34c9[_0xac73('0xf7')];_0x78824c=_0xf34c9[_0xac73('0x65')];}})[_0xac73('0x10')](function(){return db[_0xac73('0xa0')]['count']({'where':{'closed':![]}});})['then'](function(_0x19a0c3){_0x4810f8=_0x19a0c3;if(_0x2e4f8a&&_0x19a0c3>_0x2e4f8a){return db['License']['findOne']({'where':{'id':0x1}})[_0xac73('0x10')](function(_0x2622b8){if(_0x2622b8){_0x2622b8['increment'](_0xac73('0xf8'));}});}})[_0xac73('0x10')](function(){if(_0x3daa39[_0xac73('0xf4')]&&_0x3daa39[_0xac73('0xf4')][_0xac73('0xf5')]){var _0x1177d4=[];for(var _0x248c7d=0x0;_0x248c7d<_0x3daa39[_0xac73('0xf4')]['Intervals'][_0xac73('0x45')];_0x248c7d++){var _0x3e2bdb=_0x3daa39[_0xac73('0xf4')]['Intervals'][_0x248c7d][_0xac73('0x26')]({'plain':!![]});_0x1177d4[_0xac73('0xa7')](iftimePromise(_0x3e2bdb,_0x3daa39));}return BPromise['all'](_0x1177d4)[_0xac73('0x10')](function(_0x54fee1){return _[_0xac73('0xf9')](_0x54fee1);});}else{return!![];}})[_0xac73('0x10')](function(_0x2c8833){var _0x14a867=fs[_0xac73('0xb9')](path['join'](config['root'],_0xac73('0xfa')),_0xac73('0xbb'));var _0x32f109={'remote':_0x3daa39[_0xac73('0xfb')],'query':querystring[_0xac73('0x15')](_[_0xac73('0x3d')](_0x3daa39[_0xac73('0x26')]({'plain':!![]}),{'customerIp':_0x27edf2[_0xac73('0x72')]['x-forwarded-for']||_0x27edf2[_0xac73('0x72')][_0xac73('0xfc')]||_0x27edf2['connection'][_0xac73('0xfd')]||_0x27edf2['ip'],'referer':_0x27edf2[_0xac73('0x72')][_0xac73('0x96')],'openedInteractions':_0x4810f8,'maxInteractions':_0x2e4f8a,'virtual':_0x78824c[_0xac73('0xf7')],'online':_0x2c8833,'custom':_0x78824c}))['replace'](/'/g,'\x5c\x27')};_0x2a688b[_0xac73('0x2c')](ejs[_0xac73('0xbc')](Mustache[_0xac73('0xbc')](_0x14a867,_0x32f109),{'proactiveActions':_0x4788b7,'alignment':_0x3daa39['alignment'],'verticalAlignment':_0x3daa39[_0xac73('0xfe')],'div_color':_0x3daa39[_0xac73('0xe5')],'labelText':_0x3daa39[_0xac73('0xff')],'text_color':_0x3daa39[_0xac73('0x100')],'button_color':_0x3daa39['color_button'],'background_color':_0x3daa39[_0xac73('0x101')],'hideWhenOffline':_0x3daa39['hideWhenOffline'],'interval':_0x3daa39['IntervalId']}));})[_0xac73('0x1a')](handleError(_0x2a688b,null));};exports[_0xac73('0x102')]=function(_0xf65c19,_0x2f0a01){var _0x5acd1f=_0xf65c19['params']['id'];var _0x3762ed=_0xf65c19[_0xac73('0x4a')];var _0x435147=0xc8;var _0x10cf61=null;return db['sequelize'][_0xac73('0xc7')]({'isolationLevel':db[_0xac73('0xc6')][_0xac73('0x103')][_0xac73('0x104')][_0xac73('0x105')]},function(_0x4392b0){return db[_0xac73('0x2f')][_0xac73('0x52')]({'where':{'id':_0x5acd1f},'transaction':_0x4392b0})[_0xac73('0x10')](function(_0x325ff0){if(_0x325ff0){return db[_0xac73('0x87')][_0xac73('0x25')]({'where':{'ChatWebsiteId':_0x5acd1f},'transaction':_0x4392b0})['then'](function(){var _0x34c512=_['map'](_0x3762ed,function(_0x4a6f3b){_0x4a6f3b[_0xac73('0x50')]=_0x5acd1f;return _0x4a6f3b;});return db[_0xac73('0x87')]['bulkCreate'](_0x34c512,{'transaction':_0x4392b0});});}else{_0x435147=0x194;_0x10cf61=[];}});})[_0xac73('0x10')](function(){if(_0x435147!==0x194){return db['ChatApplication'][_0xac73('0x106')]({'where':{'ChatWebsiteId':_0x5acd1f},'order':_0xac73('0x107')})['then'](function(_0x131f35){_0x10cf61=_0x131f35;});}})[_0xac73('0x1a')](function(_0x2fb506){_0x435147=0x1f4;logger['error'](_0x2fb506[_0xac73('0x2a')]);if(_0x2fb506[_0xac73('0x2b')]){delete _0x2fb506['name'];}_0x10cf61=_0x2fb506;})['finally'](function(){if(_0x10cf61===null){_0x2f0a01[_0xac73('0x29')](_0x435147);}else{if(_0x435147===0x1f4){_0x2f0a01['status'](_0x435147)[_0xac73('0x2c')](_0x10cf61);}else{_0x2f0a01['status'](_0x435147)[_0xac73('0x1d')](_0x10cf61);}}});};exports[_0xac73('0x108')]=function(_0x4c05fd,_0x156651){var _0x144cb4={};var _0x3b1e43={};var _0x29638f;var _0x581710;return db['ChatWebsite'][_0xac73('0x52')]({'where':{'id':_0x4c05fd['params']['id']}})['then'](handleEntityNotFound(_0x156651,null))[_0xac73('0x10')](function(_0x14fca7){if(_0x14fca7){_0x29638f=_0x14fca7;_0x3b1e43[_0xac73('0x32')]=_[_0xac73('0x35')](db[_0xac73('0x87')][_0xac73('0x43')]);_0x3b1e43['query']=_[_0xac73('0x35')](_0x4c05fd[_0xac73('0x34')]);_0x3b1e43[_0xac73('0x36')]=_[_0xac73('0x37')](_0x3b1e43['model'],_0x3b1e43[_0xac73('0x34')]);_0x144cb4[_0xac73('0x38')]=_[_0xac73('0x37')](_0x3b1e43[_0xac73('0x32')],qs[_0xac73('0x44')](_0x4c05fd[_0xac73('0x34')][_0xac73('0x44')]));_0x144cb4[_0xac73('0x38')]=_0x144cb4[_0xac73('0x38')][_0xac73('0x45')]?_0x144cb4['attributes']:_0x3b1e43[_0xac73('0x32')];_0x144cb4['order']=qs[_0xac73('0x3a')](_0x4c05fd['query'][_0xac73('0x3a')]);_0x144cb4[_0xac73('0x3b')]=qs[_0xac73('0x36')](_['pick'](_0x4c05fd[_0xac73('0x34')],_0x3b1e43[_0xac73('0x36')]));if(_0x4c05fd[_0xac73('0x34')][_0xac73('0x3c')]){_0x144cb4[_0xac73('0x3b')]=_[_0xac73('0x3d')](_0x144cb4[_0xac73('0x3b')],{'$or':_[_0xac73('0x33')](_0x144cb4[_0xac73('0x38')],function(_0x12c5f6){var _0x53e3f9={};_0x53e3f9[_0x12c5f6]={'$like':'%'+_0x4c05fd[_0xac73('0x34')][_0xac73('0x3c')]+'%'};return _0x53e3f9;})});}_0x144cb4=_[_0xac73('0x3d')]({},_0x144cb4,_0x4c05fd['options']);return _0x29638f[_0xac73('0x108')](_0x144cb4);}})[_0xac73('0x10')](function(_0x4384b7){if(_0x4384b7){_0x581710=_0x4384b7['length'];if(!_0x4c05fd[_0xac73('0x34')][_0xac73('0x53')]('nolimit')){_0x144cb4['limit']=qs[_0xac73('0x20')](_0x4c05fd[_0xac73('0x34')]['limit']);_0x144cb4[_0xac73('0x1e')]=qs[_0xac73('0x1e')](_0x4c05fd[_0xac73('0x34')][_0xac73('0x1e')]);}return _0x29638f['getApplications'](_0x144cb4);}})[_0xac73('0x10')](function(_0x2a210c){if(_0x2a210c){return _0x2a210c?{'count':_0x581710,'rows':_0x2a210c}:null;}})[_0xac73('0x10')](respondWithResult(_0x156651,null))[_0xac73('0x1a')](handleError(_0x156651,null));};exports[_0xac73('0x109')]=function(_0x12e393,_0x1b06f7){return db[_0xac73('0x10a')][_0xac73('0x48')]({'where':{'id':_0x12e393[_0xac73('0x4e')]['id']}})[_0xac73('0x10')](handleEntityNotFound(_0x1b06f7,null))[_0xac73('0x10')](function(_0x3f3352){if(_0x3f3352){return _0x3f3352['addProactiveActions'](_0x12e393[_0xac73('0x4a')][_0xac73('0xdc')],_[_0xac73('0x10b')](_0x12e393[_0xac73('0x4a')],['ids','id'])||{});}})[_0xac73('0x10')](respondWithResult(_0x1b06f7,null))[_0xac73('0x1a')](handleError(_0x1b06f7,null));};exports[_0xac73('0x10c')]=function(_0x4020ce,_0x3a2425){var _0x37ce4c={};var _0x2dbcf7={};var _0x441b67;var _0x12000c;return db['ChatWebsite'][_0xac73('0x52')]({'where':{'id':_0x4020ce[_0xac73('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3a2425,null))[_0xac73('0x10')](function(_0x2bdc81){if(_0x2bdc81){_0x441b67=_0x2bdc81;_0x2dbcf7[_0xac73('0x32')]=_['keys'](db[_0xac73('0x10d')][_0xac73('0x43')]);_0x2dbcf7['query']=_[_0xac73('0x35')](_0x4020ce[_0xac73('0x34')]);_0x2dbcf7['filters']=_[_0xac73('0x37')](_0x2dbcf7[_0xac73('0x32')],_0x2dbcf7[_0xac73('0x34')]);_0x37ce4c[_0xac73('0x38')]=_[_0xac73('0x37')](_0x2dbcf7[_0xac73('0x32')],qs[_0xac73('0x44')](_0x4020ce['query'][_0xac73('0x44')]));_0x37ce4c[_0xac73('0x38')]=_0x37ce4c['attributes'][_0xac73('0x45')]?_0x37ce4c['attributes']:_0x2dbcf7[_0xac73('0x32')];_0x37ce4c['order']=qs[_0xac73('0x3a')](_0x4020ce[_0xac73('0x34')][_0xac73('0x3a')]);_0x37ce4c[_0xac73('0x3b')]=qs[_0xac73('0x36')](_[_0xac73('0x59')](_0x4020ce[_0xac73('0x34')],_0x2dbcf7['filters']));if(_0x4020ce[_0xac73('0x34')][_0xac73('0x3c')]){_0x37ce4c[_0xac73('0x3b')]=_[_0xac73('0x3d')](_0x37ce4c['where'],{'$or':_[_0xac73('0x33')](_0x37ce4c[_0xac73('0x38')],function(_0x5bddf7){var _0x501619={};_0x501619[_0x5bddf7]={'$like':'%'+_0x4020ce['query']['filter']+'%'};return _0x501619;})});}_0x37ce4c=_['merge']({},_0x37ce4c,_0x4020ce[_0xac73('0x47')]);return _0x441b67[_0xac73('0x10c')](_0x37ce4c);}})['then'](function(_0x1abfec){if(_0x1abfec){_0x12000c=_0x1abfec[_0xac73('0x45')];if(!_0x4020ce[_0xac73('0x34')][_0xac73('0x53')](_0xac73('0x58'))){_0x37ce4c['limit']=qs[_0xac73('0x20')](_0x4020ce['query'][_0xac73('0x20')]);_0x37ce4c['offset']=qs[_0xac73('0x1e')](_0x4020ce[_0xac73('0x34')][_0xac73('0x1e')]);}return _0x441b67[_0xac73('0x10c')](_0x37ce4c);}})[_0xac73('0x10')](function(_0x4d990c){if(_0x4d990c){return _0x4d990c?{'count':_0x12000c,'rows':_0x4d990c}:null;}})[_0xac73('0x10')](respondWithResult(_0x3a2425,null))[_0xac73('0x1a')](handleError(_0x3a2425,null));};exports['getFields']=function(_0x4b5312,_0x1bff6a){var _0x32c661=_0x4b5312[_0xac73('0x34')][_0xac73('0x10e')]===_0xac73('0x10f')?'offlineForm':_0xac73('0x110');return db['ChatWebsite'][_0xac73('0x48')]({'attributes':['id',_0x32c661],'where':{'id':_0x4b5312[_0xac73('0x4e')]['id']}})[_0xac73('0x10')](handleEntityNotFound(_0x1bff6a,null))[_0xac73('0x10')](function(_0x191dba){if(_0x191dba){var _0x4fbd42=_0x191dba[_0x32c661];var _0x34c13d=_0x4fbd42&&_0x4fbd42[_0xac73('0x111')]?_0x4fbd42[_0xac73('0x111')]:[];_0x1bff6a[_0xac73('0x2c')]({'fromKey':_[_0xac73('0x70')](_0x4fbd42['fromKey'])?undefined:_0x4fbd42[_0xac73('0x112')],'count':_0x34c13d[_0xac73('0x45')],'rows':_0x34c13d});}})['catch'](handleError(_0x1bff6a,null));};exports[_0xac73('0x113')]=function(_0x28c262,_0x53bbc6){var _0xdff417={'raw':![],'where':{}};var _0x1722b2={};var _0x34201d={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x28c262[_0xac73('0x4e')]['id']}})[_0xac73('0x10')](handleEntityNotFound(_0x53bbc6,null))[_0xac73('0x10')](function(_0x3568b3){if(_0x3568b3){_0x1722b2[_0xac73('0x32')]=_[_0xac73('0x35')](db[_0xac73('0x114')]['rawAttributes']);_0x1722b2[_0xac73('0x34')]=_['keys'](_0x28c262['query']);_0x1722b2[_0xac73('0x36')]=_[_0xac73('0x37')](_0x1722b2['model'],_0x1722b2[_0xac73('0x34')]);_0xdff417['attributes']=_['intersection'](_0x1722b2[_0xac73('0x32')],qs['fields'](_0x28c262['query']['fields']));_0xdff417[_0xac73('0x38')]=_0xdff417[_0xac73('0x38')][_0xac73('0x45')]?_0xdff417[_0xac73('0x38')]:_0x1722b2['model'];if(!_0x28c262[_0xac73('0x34')]['hasOwnProperty']('nolimit')){_0xdff417[_0xac73('0x20')]=qs[_0xac73('0x20')](_0x28c262[_0xac73('0x34')][_0xac73('0x20')]);_0xdff417[_0xac73('0x1e')]=qs[_0xac73('0x1e')](_0x28c262[_0xac73('0x34')]['offset']);}_0xdff417[_0xac73('0x39')]=qs['sort'](_0x28c262['query'][_0xac73('0x3a')]);_0xdff417[_0xac73('0x3b')]=qs[_0xac73('0x36')](_[_0xac73('0x59')](_0x28c262[_0xac73('0x34')],_0x1722b2['filters']));_0xdff417[_0xac73('0x3b')][_0xac73('0x50')]=_0x3568b3['id'];if(_0x28c262['query'][_0xac73('0x3c')]){_0xdff417[_0xac73('0x3b')]=_[_0xac73('0x3d')](_0xdff417[_0xac73('0x3b')],{'$or':_[_0xac73('0x33')](_0xdff417[_0xac73('0x38')],function(_0x4666fd){var _0x49df97={};_0x49df97[_0x4666fd]={'$like':'%'+_0x28c262[_0xac73('0x34')]['filter']+'%'};return _0x49df97;})});}_0xdff417=_[_0xac73('0x3d')]({},_0xdff417,_0x28c262[_0xac73('0x47')]);return db['ChatOfflineMessage'][_0xac73('0x21')]({'where':_0xdff417[_0xac73('0x3b')]})['then'](function(_0x391a89){_0x34201d['count']=_0x391a89;if(_0x28c262[_0xac73('0x34')][_0xac73('0x46')]){_0xdff417['include']=[{'all':!![]}];}else{_0xdff417[_0xac73('0x40')]=[{'model':db['CmContact'],'as':_0xac73('0xde'),'required':![]},{'model':db[_0xac73('0xc8')],'as':'Attachments','required':![]}];}return db[_0xac73('0x114')][_0xac73('0x54')](_0xdff417);})[_0xac73('0x10')](function(_0x68ffcf){_0x34201d['rows']=_0x68ffcf;return _0x34201d;});}})[_0xac73('0x10')](respondWithFilteredResult(_0x53bbc6,_0xdff417))[_0xac73('0x1a')](handleError(_0x53bbc6,null));};exports[_0xac73('0x115')]=function(_0x328317,_0x3e7881){return db[_0xac73('0x2f')][_0xac73('0x48')]({'where':{'id':_0x328317[_0xac73('0x4e')]['id']}})[_0xac73('0x10')](handleEntityNotFound(_0x3e7881,null))['then'](function(_0x2ad777){if(_0x2ad777){return _0x2ad777[_0xac73('0x115')](_0x328317[_0xac73('0x4a')]['ids'],_[_0xac73('0x10b')](_0x328317[_0xac73('0x4a')],[_0xac73('0xdc'),'id'])||{})[_0xac73('0xa3')](function(_0x3289b4){for(var _0x104155=0x0;_0x104155<_0x328317[_0xac73('0x4a')][_0xac73('0xdc')][_0xac73('0x45')];_0x104155+=0x1){socket[_0xac73('0x116')]('userChatWebsite:save',{'UserId':Number(_0x328317[_0xac73('0x4a')]['ids'][_0x104155]),'ChatWebsiteId':Number(_0x328317[_0xac73('0x4e')]['id'])});}return _0x3289b4;});}})[_0xac73('0x10')](respondWithResult(_0x3e7881,null))[_0xac73('0x1a')](handleError(_0x3e7881,null));};exports[_0xac73('0x117')]=function(_0x2b8e8d,_0x3e2a27){return db[_0xac73('0x2f')][_0xac73('0x48')]({'where':{'id':_0x2b8e8d[_0xac73('0x4e')]['id']}})[_0xac73('0x10')](handleEntityNotFound(_0x3e2a27,null))[_0xac73('0x10')](function(_0x2a6d80){if(_0x2a6d80){return _0x2a6d80[_0xac73('0x117')](_0x2b8e8d[_0xac73('0x34')][_0xac73('0xdc')])[_0xac73('0x10')](function(){if(_[_0xac73('0x118')](_0x2b8e8d[_0xac73('0x34')][_0xac73('0xdc')])){for(var _0x5a2f37=0x0;_0x5a2f37<_0x2b8e8d[_0xac73('0x34')][_0xac73('0xdc')]['length'];_0x5a2f37+=0x1){socket[_0xac73('0x116')](_0xac73('0x119'),{'UserId':Number(_0x2b8e8d[_0xac73('0x34')][_0xac73('0xdc')][_0x5a2f37]),'ChatWebsiteId':Number(_0x2b8e8d['params']['id'])});}}else{socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x2b8e8d['query'][_0xac73('0xdc')]),'ChatWebsiteId':Number(_0x2b8e8d[_0xac73('0x4e')]['id'])});}});}})['then'](respondWithStatusCode(_0x3e2a27,null))[_0xac73('0x1a')](handleError(_0x3e2a27,null));};exports[_0xac73('0x11a')]=function(_0x23dd0b,_0x1cba19){var _0x52cc4a={};var _0x141c77={};var _0x484f34;var _0x3842f6;return db[_0xac73('0x2f')][_0xac73('0x52')]({'where':{'id':_0x23dd0b[_0xac73('0x4e')]['id']}})[_0xac73('0x10')](handleEntityNotFound(_0x1cba19,null))[_0xac73('0x10')](function(_0x46f517){if(_0x46f517){_0x484f34=_0x46f517;_0x141c77[_0xac73('0x32')]=_['keys'](db[_0xac73('0xdf')][_0xac73('0x43')]);_0x141c77[_0xac73('0x34')]=_['keys'](_0x23dd0b[_0xac73('0x34')]);_0x141c77[_0xac73('0x36')]=_[_0xac73('0x37')](_0x141c77[_0xac73('0x32')],_0x141c77[_0xac73('0x34')]);_0x52cc4a[_0xac73('0x38')]=_[_0xac73('0x37')](_0x141c77[_0xac73('0x32')],qs[_0xac73('0x44')](_0x23dd0b['query'][_0xac73('0x44')]));_0x52cc4a['attributes']=_0x52cc4a[_0xac73('0x38')][_0xac73('0x45')]?_0x52cc4a[_0xac73('0x38')]:_0x141c77[_0xac73('0x32')];_0x52cc4a[_0xac73('0x39')]=qs[_0xac73('0x3a')](_0x23dd0b[_0xac73('0x34')][_0xac73('0x3a')]);_0x52cc4a[_0xac73('0x3b')]=qs[_0xac73('0x36')](_[_0xac73('0x59')](_0x23dd0b[_0xac73('0x34')],_0x141c77[_0xac73('0x36')]));if(_0x23dd0b[_0xac73('0x34')][_0xac73('0x3c')]){_0x52cc4a[_0xac73('0x3b')]=_[_0xac73('0x3d')](_0x52cc4a['where'],{'$or':_[_0xac73('0x33')](_0x52cc4a[_0xac73('0x38')],function(_0x35e2bd){var _0x4e7434={};_0x4e7434[_0x35e2bd]={'$like':'%'+_0x23dd0b[_0xac73('0x34')][_0xac73('0x3c')]+'%'};return _0x4e7434;})});}_0x52cc4a=_['merge']({},_0x52cc4a,_0x23dd0b[_0xac73('0x47')]);return _0x484f34['getAgents'](_0x52cc4a);}})[_0xac73('0x10')](function(_0x3bef9){if(_0x3bef9){_0x3842f6=_0x3bef9[_0xac73('0x45')];if(!_0x23dd0b[_0xac73('0x34')][_0xac73('0x53')]('nolimit')){_0x52cc4a[_0xac73('0x20')]=qs[_0xac73('0x20')](_0x23dd0b['query'][_0xac73('0x20')]);_0x52cc4a[_0xac73('0x1e')]=qs[_0xac73('0x1e')](_0x23dd0b['query'][_0xac73('0x1e')]);}return _0x484f34[_0xac73('0x11a')](_0x52cc4a);}})[_0xac73('0x10')](function(_0x80268c){if(_0x80268c){return _0x80268c?{'count':_0x3842f6,'rows':_0x80268c}:null;}})[_0xac73('0x10')](respondWithResult(_0x1cba19,null))[_0xac73('0x1a')](handleError(_0x1cba19,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index eb59e2a..fcbf5e4 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 _0xd0bb=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','save'];(function(_0xb4273a,_0x671c3a){var _0xa5d584=function(_0x1ea51c){while(--_0x1ea51c){_0xb4273a['push'](_0xb4273a['shift']());}};_0xa5d584(++_0x671c3a);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x85666,_0x403be2){_0x85666=_0x85666-0x0;var _0x233527=_0xd0bb[_0x85666];return _0x233527;};'use strict';var EventEmitter=require(_0xbd0b('0x0'));var ChatWebsite=require(_0xbd0b('0x1'))['db'][_0xbd0b('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbd0b('0x3'),'afterUpdate':'update','afterDestroy':_0xbd0b('0x4')};function emitEvent(_0x1f6ec3){return function(_0x53e6ce,_0x432acf,_0x508d53){ChatWebsiteEvents[_0xbd0b('0x5')](_0x1f6ec3+':'+_0x53e6ce['id'],_0x53e6ce);ChatWebsiteEvents[_0xbd0b('0x5')](_0x1f6ec3,_0x53e6ce);_0x508d53(null);};}for(var e in events){if(events[_0xbd0b('0x6')](e)){var event=events[e];ChatWebsite[_0xbd0b('0x7')](e,emitEvent(event));}}module[_0xbd0b('0x8')]=ChatWebsiteEvents; \ No newline at end of file +var _0x7579=['save','update','emit','hasOwnProperty','hook','events','../../mysqldb','ChatWebsite','setMaxListeners'];(function(_0x2754f3,_0x2733b2){var _0x3b80d3=function(_0x266b6c){while(--_0x266b6c){_0x2754f3['push'](_0x2754f3['shift']());}};_0x3b80d3(++_0x2733b2);}(_0x7579,0x1e2));var _0x9757=function(_0x8797a7,_0x5305d1){_0x8797a7=_0x8797a7-0x0;var _0x341ad7=_0x7579[_0x8797a7];return _0x341ad7;};'use strict';var EventEmitter=require(_0x9757('0x0'));var ChatWebsite=require(_0x9757('0x1'))['db'][_0x9757('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x9757('0x3')](0x0);var events={'afterCreate':_0x9757('0x4'),'afterUpdate':_0x9757('0x5'),'afterDestroy':'remove'};function emitEvent(_0x399165){return function(_0x231ca6,_0xcffaa0,_0x213a7a){ChatWebsiteEvents['emit'](_0x399165+':'+_0x231ca6['id'],_0x231ca6);ChatWebsiteEvents[_0x9757('0x6')](_0x399165,_0x231ca6);_0x213a7a(null);};}for(var e in events){if(events[_0x9757('0x7')](e)){var event=events[e];ChatWebsite[_0x9757('0x8')](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 4d62f72..4a4c913 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 _0xd083=['exports','define','ChatWebsite','chat_websites','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes'];(function(_0x10bb31,_0x523216){var _0xfa5116=function(_0x1c91be){while(--_0x1c91be){_0x10bb31['push'](_0x10bb31['shift']());}};_0xfa5116(++_0x523216);}(_0xd083,0x17d));var _0x3d08=function(_0x5cc51f,_0x22c480){_0x5cc51f=_0x5cc51f-0x0;var _0x315a2f=_0xd083[_0x5cc51f];return _0x315a2f;};'use strict';var _=require(_0x3d08('0x0'));var util=require(_0x3d08('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3d08('0x2'));var BPromise=require(_0x3d08('0x3'));var rp=require(_0x3d08('0x4'));var fs=require('fs');var path=require(_0x3d08('0x5'));var rimraf=require(_0x3d08('0x6'));var config=require(_0x3d08('0x7'));var attributes=require(_0x3d08('0x8'));module[_0x3d08('0x9')]=function(_0x2887df,_0x293d0b){return _0x2887df[_0x3d08('0xa')](_0x3d08('0xb'),attributes,{'tableName':_0x3d08('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0a2f=['ChatWebsite','chat_websites','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define'];(function(_0x343fb4,_0x51ac41){var _0x352a97=function(_0x40c176){while(--_0x40c176){_0x343fb4['push'](_0x343fb4['shift']());}};_0x352a97(++_0x51ac41);}(_0x0a2f,0x19a));var _0xf0a2=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x0a2f[_0x5f1391];return _0x50ebe3;};'use strict';var _=require(_0xf0a2('0x0'));var util=require('util');var logger=require(_0xf0a2('0x1'))('api');var moment=require(_0xf0a2('0x2'));var BPromise=require(_0xf0a2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf0a2('0x4'));var rimraf=require(_0xf0a2('0x5'));var config=require(_0xf0a2('0x6'));var attributes=require(_0xf0a2('0x7'));module[_0xf0a2('0x8')]=function(_0x3e9819,_0x16078d){return _0x3e9819[_0xf0a2('0x9')](_0xf0a2('0xa'),attributes,{'tableName':_0xf0a2('0xb'),'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 f4008fb..f8d0cb8 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 _0x7e3d=['client','http','redis','localhost','socket.io-emitter','./chatWebsite.socket','request','then','info','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ChatWebsite,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x3c182f,_0x11141e){var _0x2c2e17=function(_0x48c6bd){while(--_0x48c6bd){_0x3c182f['push'](_0x3c182f['shift']());}};_0x2c2e17(++_0x11141e);}(_0x7e3d,0x17d));var _0xd7e3=function(_0x36d88d,_0x250c31){_0x36d88d=_0x36d88d-0x0;var _0x57debd=_0x7e3d[_0x36d88d];return _0x57debd;};'use strict';var _=require('lodash');var util=require(_0xd7e3('0x0'));var moment=require(_0xd7e3('0x1'));var BPromise=require(_0xd7e3('0x2'));var rs=require(_0xd7e3('0x3'));var fs=require('fs');var Redis=require(_0xd7e3('0x4'));var db=require(_0xd7e3('0x5'))['db'];var utils=require(_0xd7e3('0x6'));var logger=require(_0xd7e3('0x7'))('rpc');var config=require(_0xd7e3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd7e3('0x9')][_0xd7e3('0xa')]({'port':0x232a});config[_0xd7e3('0xb')]=_['defaults'](config['redis'],{'host':_0xd7e3('0xc'),'port':0x18eb});var socket=require(_0xd7e3('0xd'))(new Redis(config[_0xd7e3('0xb')]));require(_0xd7e3('0xe'))['register'](socket);function respondWithRpcPromise(_0x45c2d4,_0x2012e4,_0x981850){return new BPromise(function(_0x4550a9,_0xf82016){return client[_0xd7e3('0xf')](_0x45c2d4,_0x981850)[_0xd7e3('0x10')](function(_0x54ea65){logger[_0xd7e3('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x2012e4,'request\x20sent');logger[_0xd7e3('0x12')](_0xd7e3('0x13'),_0x2012e4,_0xd7e3('0x14'),JSON['stringify'](_0x54ea65));if(_0x54ea65[_0xd7e3('0x15')]){if(_0x54ea65[_0xd7e3('0x15')][_0xd7e3('0x16')]===0x1f4){logger['error'](_0xd7e3('0x17'),_0x2012e4,_0x54ea65[_0xd7e3('0x15')][_0xd7e3('0x18')]);return _0xf82016(_0x54ea65[_0xd7e3('0x15')][_0xd7e3('0x18')]);}logger[_0xd7e3('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x2012e4,_0x54ea65[_0xd7e3('0x15')][_0xd7e3('0x18')]);return _0x4550a9(_0x54ea65['error'][_0xd7e3('0x18')]);}else{logger[_0xd7e3('0x11')](_0xd7e3('0x17'),_0x2012e4,_0xd7e3('0x14'));_0x4550a9(_0x54ea65['result']['message']);}})[_0xd7e3('0x19')](function(_0x2b557a){logger[_0xd7e3('0x15')](_0xd7e3('0x17'),_0x2012e4,_0x2b557a);_0xf82016(_0x2b557a);});});} \ No newline at end of file +var _0xb4f3=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xb4f3,0x1ce));var _0x3b4f=function(_0x5dd665,_0x43ed45){_0x5dd665=_0x5dd665-0x0;var _0x501dcc=_0xb4f3[_0x5dd665];return _0x501dcc;};'use strict';var _=require(_0x3b4f('0x0'));var util=require(_0x3b4f('0x1'));var moment=require('moment');var BPromise=require(_0x3b4f('0x2'));var rs=require(_0x3b4f('0x3'));var fs=require('fs');var Redis=require(_0x3b4f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3b4f('0x5'));var logger=require(_0x3b4f('0x6'))(_0x3b4f('0x7'));var config=require(_0x3b4f('0x8'));var jayson=require(_0x3b4f('0x9'));var client=jayson[_0x3b4f('0xa')][_0x3b4f('0xb')]({'port':0x232a});config[_0x3b4f('0xc')]=_['defaults'](config[_0x3b4f('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x3b4f('0xd'))(new Redis(config[_0x3b4f('0xc')]));require(_0x3b4f('0xe'))[_0x3b4f('0xf')](socket);function respondWithRpcPromise(_0x1ecee0,_0x28dd50,_0x380512){return new BPromise(function(_0x242536,_0x31dd84){return client[_0x3b4f('0x10')](_0x1ecee0,_0x380512)[_0x3b4f('0x11')](function(_0x490cf9){logger[_0x3b4f('0x12')](_0x3b4f('0x13'),_0x28dd50,'request\x20sent');logger['debug'](_0x3b4f('0x14'),_0x28dd50,_0x3b4f('0x15'),JSON['stringify'](_0x490cf9));if(_0x490cf9[_0x3b4f('0x16')]){if(_0x490cf9['error']['code']===0x1f4){logger[_0x3b4f('0x16')](_0x3b4f('0x13'),_0x28dd50,_0x490cf9[_0x3b4f('0x16')]['message']);return _0x31dd84(_0x490cf9['error'][_0x3b4f('0x17')]);}logger[_0x3b4f('0x16')](_0x3b4f('0x13'),_0x28dd50,_0x490cf9[_0x3b4f('0x16')][_0x3b4f('0x17')]);return _0x242536(_0x490cf9[_0x3b4f('0x16')]['message']);}else{logger[_0x3b4f('0x12')](_0x3b4f('0x13'),_0x28dd50,_0x3b4f('0x15'));_0x242536(_0x490cf9[_0x3b4f('0x18')]['message']);}})[_0x3b4f('0x19')](function(_0x3de27b){logger[_0x3b4f('0x16')](_0x3b4f('0x13'),_0x28dd50,_0x3de27b);_0x31dd84(_0x3de27b);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 905300a..d62936e 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 _0x083a=['register','length','chatWebsite:','./chatWebsite.events','save','remove','emit','removeListener'];(function(_0x43b584,_0x20a6bd){var _0x48f27b=function(_0x1eeb77){while(--_0x1eeb77){_0x43b584['push'](_0x43b584['shift']());}};_0x48f27b(++_0x20a6bd);}(_0x083a,0x16b));var _0xa083=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x083a[_0x4b055c];return _0x4b62bb;};'use strict';var ChatWebsiteEvents=require(_0xa083('0x0'));var events=[_0xa083('0x1'),_0xa083('0x2'),'update'];function createListener(_0xc5728a,_0x47e441){return function(_0x15a4ba){_0x47e441[_0xa083('0x3')](_0xc5728a,_0x15a4ba);};}function removeListener(_0x1fac1b,_0x5bc23e){return function(){ChatWebsiteEvents[_0xa083('0x4')](_0x1fac1b,_0x5bc23e);};}exports[_0xa083('0x5')]=function(_0x41f0d5){for(var _0x51642c=0x0,_0x51dde6=events[_0xa083('0x6')];_0x51642c<_0x51dde6;_0x51642c++){var _0x5c7c51=events[_0x51642c];var _0x384735=createListener(_0xa083('0x7')+_0x5c7c51,_0x41f0d5);ChatWebsiteEvents['on'](_0x5c7c51,_0x384735);}}; \ No newline at end of file +var _0xfcf0=['length','chatWebsite:','./chatWebsite.events','save','update','emit','removeListener','register'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0xfcf0,0x13a));var _0x0fcf=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0xfcf0[_0x50aa2e];return _0x5e07f0;};'use strict';var ChatWebsiteEvents=require(_0x0fcf('0x0'));var events=[_0x0fcf('0x1'),'remove',_0x0fcf('0x2')];function createListener(_0x18914f,_0x3bb9d2){return function(_0x5e36de){_0x3bb9d2[_0x0fcf('0x3')](_0x18914f,_0x5e36de);};}function removeListener(_0x138f1f,_0x3171a3){return function(){ChatWebsiteEvents[_0x0fcf('0x4')](_0x138f1f,_0x3171a3);};}exports[_0x0fcf('0x5')]=function(_0x2363d7){for(var _0x2d65af=0x0,_0x1b2d69=events[_0x0fcf('0x6')];_0x2d65af<_0x1b2d69;_0x2d65af++){var _0x40854d=events[_0x2d65af];var _0xe6c10b=createListener(_0x0fcf('0x7')+_0x40854d,_0x2363d7);ChatWebsiteEvents['on'](_0x40854d,_0xe6c10b);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 5bf9f37..1593f71 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 _0x07ce=['addInteraction','addApplications','put','update','delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','addDisposition','addAnswer','join','server/files/images/logos/','%s-%s','now','originalname','single','file','diskStorage','root','server/files/images/avatars/','/:id/customer_avatar','addCustomerAvatar','format','/:id/notify','attachments','ensureDir','replace','/:id/offline','any'];(function(_0x5dfb4b,_0x1628b0){var _0x3ef8c1=function(_0x2aeccd){while(--_0x2aeccd){_0x5dfb4b['push'](_0x5dfb4b['shift']());}};_0x3ef8c1(++_0x1628b0);}(_0x07ce,0x118));var _0xe07c=function(_0x2121c2,_0x56f6e8){_0x2121c2=_0x2121c2-0x0;var _0x2771e0=_0x07ce[_0x2121c2];return _0x2771e0;};'use strict';var multer=require(_0xe07c('0x0'));var util=require(_0xe07c('0x1'));var path=require(_0xe07c('0x2'));var timeout=require(_0xe07c('0x3'));var express=require('express');var router=express[_0xe07c('0x4')]();var fs_extra=require(_0xe07c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe07c('0x6'));var config=require(_0xe07c('0x7'));var controller=require('./chatWebsite.controller');router[_0xe07c('0x8')]('/',auth[_0xe07c('0x9')](),controller[_0xe07c('0xa')]);router[_0xe07c('0x8')](_0xe07c('0xb'),auth[_0xe07c('0x9')](),controller[_0xe07c('0xc')]);router[_0xe07c('0x8')](_0xe07c('0xd'),auth['isAuthenticated'](),controller[_0xe07c('0xe')]);router['get'](_0xe07c('0xf'),auth[_0xe07c('0x9')](),controller[_0xe07c('0x10')]);router[_0xe07c('0x8')](_0xe07c('0x11'),auth[_0xe07c('0x9')](),controller[_0xe07c('0x12')]);router['get'](_0xe07c('0x13'),controller[_0xe07c('0x14')]);router[_0xe07c('0x8')](_0xe07c('0x15'),controller[_0xe07c('0x16')]);router[_0xe07c('0x8')]('/:id/customer_avatar',controller[_0xe07c('0x17')]);router[_0xe07c('0x8')](_0xe07c('0x18'),controller[_0xe07c('0x19')]);router[_0xe07c('0x8')](_0xe07c('0x1a'),auth[_0xe07c('0x9')](),controller['getInteractions']);router['get']('/:id/snippet',controller[_0xe07c('0x1b')]);router['get'](_0xe07c('0x1c'),auth['isAuthenticated'](),controller[_0xe07c('0x1d')]);router[_0xe07c('0x8')](_0xe07c('0x1e'),auth[_0xe07c('0x9')](),controller[_0xe07c('0x1f')]);router[_0xe07c('0x8')](_0xe07c('0x20'),controller[_0xe07c('0x21')]);router[_0xe07c('0x8')](_0xe07c('0x22'),auth[_0xe07c('0x9')](),controller[_0xe07c('0x23')]);router[_0xe07c('0x8')](_0xe07c('0x24'),auth[_0xe07c('0x9')](),controller[_0xe07c('0x25')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xe07c('0x26')](_0xe07c('0xf'),auth[_0xe07c('0x9')](),controller[_0xe07c('0x27')]);router[_0xe07c('0x26')](_0xe07c('0x11'),auth[_0xe07c('0x9')](),controller[_0xe07c('0x28')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x55a1ae,_0x5bca05,_0x34a6cb){_0x34a6cb(null,path[_0xe07c('0x29')](config['root'],_0xe07c('0x2a')));},'filename':function(_0x112223,_0xc94603,_0x47b1ef){_0x47b1ef(null,util['format'](_0xe07c('0x2b'),Date[_0xe07c('0x2c')](),_0xc94603[_0xe07c('0x2d')]));}})});router['post'](_0xe07c('0x13'),upload[_0xe07c('0x2e')](_0xe07c('0x2f')),controller['addLogo']);var upload=multer({'storage':multer[_0xe07c('0x30')]({'destination':function(_0x5684f0,_0x103da4,_0x1bc5d4){_0x1bc5d4(null,path[_0xe07c('0x29')](config['root'],'server/files/images/avatars/'));},'filename':function(_0xb017e3,_0x51101b,_0x1d09a0){_0x1d09a0(null,util['format'](_0xe07c('0x2b'),Date[_0xe07c('0x2c')](),_0x51101b[_0xe07c('0x2d')]));}})});router[_0xe07c('0x26')](_0xe07c('0x15'),upload[_0xe07c('0x2e')](_0xe07c('0x2f')),controller['addAvatar']);var upload=multer({'storage':multer[_0xe07c('0x30')]({'destination':function(_0x480395,_0x4566ef,_0x5b3cb2){_0x5b3cb2(null,path[_0xe07c('0x29')](config[_0xe07c('0x31')],_0xe07c('0x32')));},'filename':function(_0x159883,_0x3fe752,_0x2dd14c){_0x2dd14c(null,util['format']('%s-%s',Date[_0xe07c('0x2c')](),_0x3fe752[_0xe07c('0x2d')]));}})});router[_0xe07c('0x26')](_0xe07c('0x33'),upload['single'](_0xe07c('0x2f')),controller[_0xe07c('0x34')]);var upload=multer({'storage':multer[_0xe07c('0x30')]({'destination':function(_0x483a46,_0x3485fc,_0x1b526c){_0x1b526c(null,path[_0xe07c('0x29')](config[_0xe07c('0x31')],'server/files/images/avatars/'));},'filename':function(_0xb8fa76,_0x231900,_0x5d661d){_0x5d661d(null,util[_0xe07c('0x35')]('%s-%s',Date[_0xe07c('0x2c')](),_0x231900['originalname']));}})});router[_0xe07c('0x26')](_0xe07c('0x18'),upload[_0xe07c('0x2e')]('file'),controller['addSystemAvatar']);router[_0xe07c('0x26')](_0xe07c('0x36'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0xe07c('0x30')]({'destination':function(_0x336fef,_0x18846f,_0x3afd34){const _0x156a2c=path[_0xe07c('0x29')](config['root'],'server/files',_0xe07c('0x37'),'offline-chat');fs_extra[_0xe07c('0x38')](_0x156a2c,function(){_0x3afd34(null,_0x156a2c);});},'filename':function(_0x4326f0,_0x3812db,_0x11f3cd){const _0x328e27=_0x3812db['originalname'][_0xe07c('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x170768=path['extname'](_0x328e27);const _0x3e9a82=Date[_0xe07c('0x2c')]()+'-'+_0x328e27[_0xe07c('0x39')](_0x170768,'')+_0x170768;_0x11f3cd(null,_0x3e9a82);}})});router[_0xe07c('0x26')](_0xe07c('0x3a'),offlineUploadMulter[_0xe07c('0x3b')](),controller['offline']);router[_0xe07c('0x26')](_0xe07c('0x1a'),auth['isAuthenticated'](),controller[_0xe07c('0x3c')]);router[_0xe07c('0x26')](_0xe07c('0x1c'),auth[_0xe07c('0x9')](),controller[_0xe07c('0x3d')]);router['post'](_0xe07c('0x1e'),auth['isAuthenticated'](),controller['addProactiveActions']);router[_0xe07c('0x26')](_0xe07c('0x24'),auth['isAuthenticated'](),controller['addAgents']);router[_0xe07c('0x3e')](_0xe07c('0xd'),auth[_0xe07c('0x9')](),controller[_0xe07c('0x3f')]);router[_0xe07c('0x40')](_0xe07c('0xd'),auth[_0xe07c('0x9')](),controller[_0xe07c('0x41')]);router[_0xe07c('0x40')](_0xe07c('0xf'),auth[_0xe07c('0x9')](),controller['removeDispositions']);router[_0xe07c('0x40')](_0xe07c('0x11'),auth[_0xe07c('0x9')](),controller['removeAnswers']);router[_0xe07c('0x40')](_0xe07c('0x24'),auth[_0xe07c('0x9')](),controller[_0xe07c('0x42')]);module[_0xe07c('0x43')]=router; \ No newline at end of file +var _0xdc9c=['/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','getApplications','getProactiveActions','/:id/fields','/:id/offline_messages','getOfflineMessages','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','%s-%s','now','/:id/logo','single','file','addLogo','server/files/images/avatars/','format','originalname','addAvatar','addCustomerAvatar','addSystemAvatar','notify','server/files','offline-chat','ensureDir','replace','extname','any','offline','/:id/applications','/:id/proactive_actions','addAgents','update','destroy','delete','removeDispositions','removeAnswers','/:id/users','removeAgents','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getLogo','/:id/avatar','getAvatar'];(function(_0x29d182,_0x221694){var _0x4f45a5=function(_0x33cb54){while(--_0x33cb54){_0x29d182['push'](_0x29d182['shift']());}};_0x4f45a5(++_0x221694);}(_0xdc9c,0x1d7));var _0xcdc9=function(_0x9b27d2,_0x1d6113){_0x9b27d2=_0x9b27d2-0x0;var _0x22ad04=_0xdc9c[_0x9b27d2];return _0x22ad04;};'use strict';var multer=require(_0xcdc9('0x0'));var util=require('util');var path=require(_0xcdc9('0x1'));var timeout=require('connect-timeout');var express=require(_0xcdc9('0x2'));var router=express[_0xcdc9('0x3')]();var fs_extra=require(_0xcdc9('0x4'));var auth=require(_0xcdc9('0x5'));var interaction=require(_0xcdc9('0x6'));var config=require(_0xcdc9('0x7'));var controller=require(_0xcdc9('0x8'));router[_0xcdc9('0x9')]('/',auth[_0xcdc9('0xa')](),controller['index']);router[_0xcdc9('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xcdc9('0xb')]);router[_0xcdc9('0x9')](_0xcdc9('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xcdc9('0x9')](_0xcdc9('0xd'),auth[_0xcdc9('0xa')](),controller[_0xcdc9('0xe')]);router[_0xcdc9('0x9')](_0xcdc9('0xf'),auth[_0xcdc9('0xa')](),controller['getAnswers']);router['get']('/:id/logo',controller[_0xcdc9('0x10')]);router[_0xcdc9('0x9')](_0xcdc9('0x11'),controller[_0xcdc9('0x12')]);router['get'](_0xcdc9('0x13'),controller['getCustomerAvatar']);router[_0xcdc9('0x9')](_0xcdc9('0x14'),controller[_0xcdc9('0x15')]);router['get'](_0xcdc9('0x16'),auth[_0xcdc9('0xa')](),controller[_0xcdc9('0x17')]);router[_0xcdc9('0x9')](_0xcdc9('0x18'),controller[_0xcdc9('0x19')]);router['get']('/:id/applications',auth[_0xcdc9('0xa')](),controller[_0xcdc9('0x1a')]);router['get']('/:id/proactive_actions',auth[_0xcdc9('0xa')](),controller[_0xcdc9('0x1b')]);router[_0xcdc9('0x9')](_0xcdc9('0x1c'),controller['getFields']);router['get'](_0xcdc9('0x1d'),auth[_0xcdc9('0xa')](),controller[_0xcdc9('0x1e')]);router[_0xcdc9('0x9')]('/:id/users',auth[_0xcdc9('0xa')](),controller[_0xcdc9('0x1f')]);router[_0xcdc9('0x20')]('/',auth[_0xcdc9('0xa')](),controller[_0xcdc9('0x21')]);router[_0xcdc9('0x20')](_0xcdc9('0xd'),auth['isAuthenticated'](),controller[_0xcdc9('0x22')]);router[_0xcdc9('0x20')]('/:id/canned_answers',auth[_0xcdc9('0xa')](),controller[_0xcdc9('0x23')]);var upload=multer({'storage':multer[_0xcdc9('0x24')]({'destination':function(_0x3d9dd0,_0x555635,_0x131c0a){_0x131c0a(null,path[_0xcdc9('0x25')](config[_0xcdc9('0x26')],_0xcdc9('0x27')));},'filename':function(_0x27da03,_0x503f89,_0x39a291){_0x39a291(null,util['format'](_0xcdc9('0x28'),Date[_0xcdc9('0x29')](),_0x503f89['originalname']));}})});router[_0xcdc9('0x20')](_0xcdc9('0x2a'),upload[_0xcdc9('0x2b')](_0xcdc9('0x2c')),controller[_0xcdc9('0x2d')]);var upload=multer({'storage':multer[_0xcdc9('0x24')]({'destination':function(_0x4a5366,_0x2e68a3,_0x2d4ec8){_0x2d4ec8(null,path[_0xcdc9('0x25')](config['root'],_0xcdc9('0x2e')));},'filename':function(_0x526556,_0x3c1b8c,_0xe16067){_0xe16067(null,util[_0xcdc9('0x2f')]('%s-%s',Date[_0xcdc9('0x29')](),_0x3c1b8c[_0xcdc9('0x30')]));}})});router[_0xcdc9('0x20')](_0xcdc9('0x11'),upload[_0xcdc9('0x2b')]('file'),controller[_0xcdc9('0x31')]);var upload=multer({'storage':multer[_0xcdc9('0x24')]({'destination':function(_0x35e444,_0x3593c9,_0x2498c1){_0x2498c1(null,path[_0xcdc9('0x25')](config['root'],_0xcdc9('0x2e')));},'filename':function(_0xfde06e,_0x1f6911,_0x59a802){_0x59a802(null,util[_0xcdc9('0x2f')]('%s-%s',Date[_0xcdc9('0x29')](),_0x1f6911[_0xcdc9('0x30')]));}})});router[_0xcdc9('0x20')](_0xcdc9('0x13'),upload[_0xcdc9('0x2b')](_0xcdc9('0x2c')),controller[_0xcdc9('0x32')]);var upload=multer({'storage':multer[_0xcdc9('0x24')]({'destination':function(_0x41c147,_0x1f3870,_0x41bcb5){_0x41bcb5(null,path[_0xcdc9('0x25')](config[_0xcdc9('0x26')],_0xcdc9('0x2e')));},'filename':function(_0x3a7a08,_0x47a412,_0x3103ca){_0x3103ca(null,util[_0xcdc9('0x2f')]('%s-%s',Date['now'](),_0x47a412['originalname']));}})});router[_0xcdc9('0x20')]('/:id/system_avatar',upload['single'](_0xcdc9('0x2c')),controller[_0xcdc9('0x33')]);router[_0xcdc9('0x20')]('/:id/notify',controller[_0xcdc9('0x34')]);const offlineUploadMulter=multer({'storage':multer[_0xcdc9('0x24')]({'destination':function(_0x950ee1,_0x7abff7,_0x499932){const _0xad65d=path[_0xcdc9('0x25')](config[_0xcdc9('0x26')],_0xcdc9('0x35'),'attachments',_0xcdc9('0x36'));fs_extra[_0xcdc9('0x37')](_0xad65d,function(){_0x499932(null,_0xad65d);});},'filename':function(_0x243b68,_0x58fb8f,_0x52b157){const _0x58aa68=_0x58fb8f[_0xcdc9('0x30')][_0xcdc9('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x148fc4=path[_0xcdc9('0x39')](_0x58aa68);const _0x54e0a0=Date[_0xcdc9('0x29')]()+'-'+_0x58aa68[_0xcdc9('0x38')](_0x148fc4,'')+_0x148fc4;_0x52b157(null,_0x54e0a0);}})});router[_0xcdc9('0x20')]('/:id/offline',offlineUploadMulter[_0xcdc9('0x3a')](),controller[_0xcdc9('0x3b')]);router['post'](_0xcdc9('0x16'),auth['isAuthenticated'](),controller['addInteraction']);router[_0xcdc9('0x20')](_0xcdc9('0x3c'),auth['isAuthenticated'](),controller['addApplications']);router[_0xcdc9('0x20')](_0xcdc9('0x3d'),auth[_0xcdc9('0xa')](),controller['addProactiveActions']);router[_0xcdc9('0x20')]('/:id/users',auth['isAuthenticated'](),controller[_0xcdc9('0x3e')]);router['put'](_0xcdc9('0xc'),auth[_0xcdc9('0xa')](),controller[_0xcdc9('0x3f')]);router['delete']('/:id',auth[_0xcdc9('0xa')](),controller[_0xcdc9('0x40')]);router[_0xcdc9('0x41')]('/:id/dispositions',auth[_0xcdc9('0xa')](),controller[_0xcdc9('0x42')]);router[_0xcdc9('0x41')](_0xcdc9('0xf'),auth[_0xcdc9('0xa')](),controller[_0xcdc9('0x43')]);router[_0xcdc9('0x41')](_0xcdc9('0x44'),auth[_0xcdc9('0xa')](),controller[_0xcdc9('0x45')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index 1d3c5b7..b176847 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 _0x96a4=['expressEndpoint','use','isAuthenticated','exports','beaver-logger/server','../components/auth/service','../config/environment','app','get','Client-Side\x20logger\x20not\x20found!'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x96a4,0x126));var _0x496a=function(_0x48b1f5,_0x5e6d62){_0x48b1f5=_0x48b1f5-0x0;var _0x50a0af=_0x96a4[_0x48b1f5];return _0x50a0af;};var beaverLogger=require(_0x496a('0x0'));var express=require('express');var auth=require(_0x496a('0x1'));var config=require(_0x496a('0x2'));var router=express['Router']();var isProduction=config['env']==='production'||![];function clientSideLogs(_0x297703,_0x468b21,_0x5100cf){var _0x544387=_0x297703[_0x496a('0x3')][_0x496a('0x4')]('client-side-logger');if(!_0x544387){throw new Error(_0x496a('0x5'));}return beaverLogger[_0x496a('0x6')]({'uri':'/client-logs','logger':_0x544387,'enableCors':!isProduction})(_0x297703,_0x468b21,_0x5100cf);}router[_0x496a('0x7')](auth[_0x496a('0x8')](),clientSideLogs);module[_0x496a('0x9')]=router; \ No newline at end of file +var _0xb2de=['production','app','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','exports','beaver-logger/server','../components/auth/service','../config/environment','Router','env'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb2de,0x1f3));var _0xeb2d=function(_0x24d7f5,_0x358823){_0x24d7f5=_0x24d7f5-0x0;var _0x33d0bb=_0xb2de[_0x24d7f5];return _0x33d0bb;};var beaverLogger=require(_0xeb2d('0x0'));var express=require('express');var auth=require(_0xeb2d('0x1'));var config=require(_0xeb2d('0x2'));var router=express[_0xeb2d('0x3')]();var isProduction=config[_0xeb2d('0x4')]===_0xeb2d('0x5')||![];function clientSideLogs(_0x41cd61,_0x55a44d,_0x5c208d){var _0x2293f0=_0x41cd61[_0xeb2d('0x6')]['get'](_0xeb2d('0x7'));if(!_0x2293f0){throw new Error(_0xeb2d('0x8'));}return beaverLogger[_0xeb2d('0x9')]({'uri':_0xeb2d('0xa'),'logger':_0x2293f0,'enableCors':!isProduction})(_0x41cd61,_0x55a44d,_0x5c208d);}router[_0xeb2d('0xb')](auth[_0xeb2d('0xc')](),clientSideLogs);module[_0xeb2d('0xd')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index c2be590..feb848b 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 _0xc07b=['MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','sequelize','exports','STRING','AmazonAWS','MicrosoftAzure','ENUM','Outlook365','Dynamics365'];(function(_0x82dd3e,_0x566f8c){var _0x5e21b8=function(_0xb072da){while(--_0xb072da){_0x82dd3e['push'](_0x82dd3e['shift']());}};_0x5e21b8(++_0x566f8c);}(_0xc07b,0xe8));var _0xbc07=function(_0x2dbce7,_0x57cb8d){_0x2dbce7=_0x2dbce7-0x0;var _0x3a3ed0=_0xc07b[_0x2dbce7];return _0x3a3ed0;};'use strict';var Sequelize=require(_0xbc07('0x0'));module[_0xbc07('0x1')]={'name':{'type':Sequelize[_0xbc07('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0xbc07('0x3'),'Google',_0xbc07('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xbc07('0x5')](_0xbc07('0x6'),_0xbc07('0x7'))},'data1':{'type':Sequelize['STRING'],'comment':_0xbc07('0x8')},'data2':{'type':Sequelize['STRING'],'comment':_0xbc07('0x9')},'data3':{'type':Sequelize['STRING'],'comment':_0xbc07('0xa')},'data4':{'type':Sequelize['STRING'],'comment':_0xbc07('0xb')},'data5':{'type':Sequelize[_0xbc07('0xc')],'comment':_0xbc07('0xd')},'data6':{'type':Sequelize['TEXT'],'comment':_0xbc07('0xe')},'data7':{'type':Sequelize[_0xbc07('0xc')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}}; \ No newline at end of file +var _0xdf1c=['Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','Google'];(function(_0x413b4d,_0xa3459c){var _0x8b810a=function(_0x22d441){while(--_0x22d441){_0x413b4d['push'](_0x413b4d['shift']());}};_0x8b810a(++_0xa3459c);}(_0xdf1c,0x113));var _0xcdf1=function(_0x25c468,_0x1d34cc){_0x25c468=_0x25c468-0x0;var _0x39f749=_0xdf1c[_0x25c468];return _0x39f749;};'use strict';var Sequelize=require(_0xcdf1('0x0'));module[_0xcdf1('0x1')]={'name':{'type':Sequelize[_0xcdf1('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xcdf1('0x3')]('AmazonAWS',_0xcdf1('0x4'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xcdf1('0x5'),_0xcdf1('0x6'))},'data1':{'type':Sequelize[_0xcdf1('0x2')],'comment':_0xcdf1('0x7')},'data2':{'type':Sequelize[_0xcdf1('0x2')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize['STRING'],'comment':_0xcdf1('0x8')},'data4':{'type':Sequelize[_0xcdf1('0x2')],'comment':_0xcdf1('0x9')},'data5':{'type':Sequelize[_0xcdf1('0xa')],'comment':_0xcdf1('0xb')},'data6':{'type':Sequelize[_0xcdf1('0xa')],'comment':_0xcdf1('0xc')},'data7':{'type':Sequelize['TEXT'],'comment':_0xcdf1('0xd')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 146b340..00b136c 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 _0x145b=['./cloudProvider.oauth','defaults','redis','localhost','socket.io-emitter','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','update','then','name','send','padEnd','slice','index','CloudProvider','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','service','MicrosoftAzure','data3','catch','show','params','find','decryptString','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','join','encryptString','oauth2MicrosoftAuthorize','generateMicrosoftAuthorizationUrl','user','get','state','from','toString','ascii','parse','isValidIdToken','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','code','data6','refresh_token','data5','startRefreshInterval','emit','microsoftAuthorization:error','error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','api','../../mysqldb'];(function(_0x47d6ef,_0x2fc2ee){var _0x579846=function(_0x19f54b){while(--_0x19f54b){_0x47d6ef['push'](_0x47d6ef['shift']());}};_0x579846(++_0x2fc2ee);}(_0x145b,0xbb));var _0xb145=function(_0x453e0e,_0x139195){_0x453e0e=_0x453e0e-0x0;var _0x5e828e=_0x145b[_0x453e0e];return _0x5e828e;};'use strict';var _=require(_0xb145('0x0'));var Redis=require(_0xb145('0x1'));var qs=require(_0xb145('0x2'));var encryptor=require(_0xb145('0x3'));var config=require(_0xb145('0x4'));var logger=require('../../config/logger')(_0xb145('0x5'));var db=require(_0xb145('0x6'))['db'];var oauth=require(_0xb145('0x7'));config['redis']=_[_0xb145('0x8')](config[_0xb145('0x9')],{'host':_0xb145('0xa'),'port':0x18eb});var socket=require(_0xb145('0xb'))(new Redis(config[_0xb145('0x9')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x53bfdb,_0x42b116){_0x42b116=_0x42b116||0xcc;return function(_0x53a994){if(_0x53a994){return _0x53bfdb[_0xb145('0xc')](_0x42b116);}return _0x53bfdb['status'](_0x42b116)[_0xb145('0xd')]();};}function respondWithResult(_0x594be8,_0x32f99b){_0x32f99b=_0x32f99b||0xc8;return function(_0x4280c8){if(_0x4280c8){return _0x594be8['status'](_0x32f99b)[_0xb145('0xe')](_0x4280c8);}};}function respondWithFilteredResult(_0x13f6db,_0x8d4f32){return function(_0x59ef64){if(_0x59ef64){var _0x3208fc=typeof _0x8d4f32[_0xb145('0xf')]===_0xb145('0x10')&&typeof _0x8d4f32[_0xb145('0x11')]===_0xb145('0x10');var _0x1170fd=_0x59ef64[_0xb145('0x12')];var _0xc29239=_0x3208fc?0x0:_0x8d4f32['offset'];var _0x211bd7=_0x3208fc?_0x59ef64['count']:_0x8d4f32[_0xb145('0xf')]+_0x8d4f32[_0xb145('0x11')];var _0x23dd20;if(_0x211bd7>=_0x1170fd){_0x211bd7=_0x1170fd;_0x23dd20=0xc8;}else{_0x23dd20=0xce;}_0x13f6db[_0xb145('0x13')](_0x23dd20);return _0x13f6db[_0xb145('0x14')](_0xb145('0x15'),_0xc29239+'-'+_0x211bd7+'/'+_0x1170fd)[_0xb145('0xe')](_0x59ef64);}return null;};}function saveUpdates(_0x19d8b4){return function(_0x46e636){if(_0x46e636){return _0x46e636[_0xb145('0x16')](_0x19d8b4)[_0xb145('0x17')](function(_0x176012){return _0x176012;});}return null;};}function removeEntity(_0x1c55fd){return function(_0x18ad1f){if(_0x18ad1f){return _0x18ad1f['destroy']()[_0xb145('0x17')](function(){_0x1c55fd[_0xb145('0x13')](0xcc)[_0xb145('0xd')]();});}};}function handleEntityNotFound(_0x3d0743){return function(_0x24ead0){if(!_0x24ead0){_0x3d0743[_0xb145('0xc')](0x194);}return _0x24ead0;};}function handleError(_0x246daa,_0xee9ea3){_0xee9ea3=_0xee9ea3||0x1f4;return function(_0x309d4b){logger['error'](_0x309d4b['stack']);if(_0x309d4b[_0xb145('0x18')]){delete _0x309d4b[_0xb145('0x18')];}_0x246daa[_0xb145('0x13')](_0xee9ea3)[_0xb145('0x19')](_0x309d4b);};}function maskClientSecret(_0x56c0f8){return _[_0xb145('0x1a')](_0x56c0f8[_0xb145('0x1b')](0x0,0x3),0x14,'*');}exports[_0xb145('0x1c')]=function(_0x16b49f,_0x3e14cb){var _0x370f95={},_0x41ae70={},_0x235b4a={'count':0x0,'rows':[]};var _0x4f1dd6=_['map'](db[_0xb145('0x1d')][_0xb145('0x1e')],function(_0x471f61){return{'name':_0x471f61[_0xb145('0x1f')],'type':_0x471f61[_0xb145('0x20')][_0xb145('0x21')]};});_0x41ae70[_0xb145('0x22')]=_[_0xb145('0x23')](_0x4f1dd6,_0xb145('0x18'));_0x41ae70['query']=_[_0xb145('0x24')](_0x16b49f[_0xb145('0x25')]);_0x41ae70[_0xb145('0x26')]=_['intersection'](_0x41ae70[_0xb145('0x22')],_0x41ae70['query']);_0x370f95['attributes']=_[_0xb145('0x27')](_0x41ae70['model'],qs[_0xb145('0x28')](_0x16b49f[_0xb145('0x25')][_0xb145('0x28')]));_0x370f95[_0xb145('0x29')]=_0x370f95[_0xb145('0x29')][_0xb145('0x2a')]?_0x370f95[_0xb145('0x29')]:_0x41ae70[_0xb145('0x22')];if(!_0x16b49f[_0xb145('0x25')][_0xb145('0x2b')](_0xb145('0x2c'))){_0x370f95['limit']=qs['limit'](_0x16b49f[_0xb145('0x25')][_0xb145('0x11')]);_0x370f95['offset']=qs[_0xb145('0xf')](_0x16b49f[_0xb145('0x25')][_0xb145('0xf')]);}_0x370f95[_0xb145('0x2d')]=qs['sort'](_0x16b49f[_0xb145('0x25')]['sort']);_0x370f95[_0xb145('0x2e')]=qs[_0xb145('0x26')](_[_0xb145('0x2f')](_0x16b49f[_0xb145('0x25')],_0x41ae70['filters']),_0x4f1dd6);if(_0x16b49f['query'][_0xb145('0x30')]){_0x370f95[_0xb145('0x2e')]=_[_0xb145('0x31')](_0x370f95['where'],{'$or':_[_0xb145('0x23')](_0x4f1dd6,function(_0x484b25){if(_0x484b25[_0xb145('0x20')]!==_0xb145('0x32')){var _0x880e9={};_0x880e9[_0x484b25[_0xb145('0x18')]]={'$like':'%'+_0x16b49f[_0xb145('0x25')][_0xb145('0x30')]+'%'};return _0x880e9;}})});}_0x370f95=_[_0xb145('0x31')]({},_0x370f95,_0x16b49f[_0xb145('0x33')]);var _0x2122cd={'where':_0x370f95['where']};return db[_0xb145('0x1d')][_0xb145('0x12')](_0x2122cd)['then'](function(_0x14c603){_0x235b4a[_0xb145('0x12')]=_0x14c603;if(_0x16b49f[_0xb145('0x25')][_0xb145('0x34')]){_0x370f95[_0xb145('0x35')]=[{'all':!![]}];}return db[_0xb145('0x1d')][_0xb145('0x36')](_0x370f95);})[_0xb145('0x17')](function(_0x3d07ff){_0x235b4a[_0xb145('0x37')]=_['map'](_0x3d07ff,function(_0x5eb1b2){if(_0x5eb1b2[_0xb145('0x38')]===_0xb145('0x39')){var _0x57ac1b=encryptor['decryptString'](_0x5eb1b2[_0xb145('0x3a')]);_0x5eb1b2[_0xb145('0x3a')]=maskClientSecret(_0x57ac1b);}return _0x5eb1b2;});return _0x235b4a;})[_0xb145('0x17')](respondWithFilteredResult(_0x3e14cb,_0x370f95))[_0xb145('0x3b')](handleError(_0x3e14cb,null));};exports[_0xb145('0x3c')]=function(_0x45a29b,_0x121be1){var _0x1d4682={'raw':!![],'where':{'id':_0x45a29b[_0xb145('0x3d')]['id']}},_0x48bddd={};_0x48bddd['model']=_[_0xb145('0x24')](db[_0xb145('0x1d')][_0xb145('0x1e')]);_0x48bddd['query']=_[_0xb145('0x24')](_0x45a29b[_0xb145('0x25')]);_0x48bddd[_0xb145('0x26')]=_['intersection'](_0x48bddd[_0xb145('0x22')],_0x48bddd[_0xb145('0x25')]);_0x1d4682[_0xb145('0x29')]=_[_0xb145('0x27')](_0x48bddd[_0xb145('0x22')],qs[_0xb145('0x28')](_0x45a29b['query'][_0xb145('0x28')]));_0x1d4682['attributes']=_0x1d4682[_0xb145('0x29')][_0xb145('0x2a')]?_0x1d4682['attributes']:_0x48bddd[_0xb145('0x22')];if(_0x45a29b['query'][_0xb145('0x34')]){_0x1d4682['include']=[{'all':!![]}];}_0x1d4682=_[_0xb145('0x31')]({},_0x1d4682,_0x45a29b[_0xb145('0x33')]);return db[_0xb145('0x1d')][_0xb145('0x3e')](_0x1d4682)[_0xb145('0x17')](handleEntityNotFound(_0x121be1,null))['then'](function(_0x52e56b){if(_0x52e56b[_0xb145('0x38')]===_0xb145('0x39')){var _0x404978=encryptor[_0xb145('0x3f')](_0x52e56b[_0xb145('0x3a')]);_0x52e56b[_0xb145('0x3a')]=maskClientSecret(_0x404978);}return _0x52e56b;})[_0xb145('0x17')](respondWithResult(_0x121be1,null))[_0xb145('0x3b')](handleError(_0x121be1,null));};exports[_0xb145('0x40')]=function(_0x59107e,_0x3855b6){if(!_0x59107e[_0xb145('0x41')]['name'])throw new Error(_0xb145('0x42'));if(!_0x59107e[_0xb145('0x41')][_0xb145('0x38')])throw new Error(_0xb145('0x43'));var _0x27689f=db['CloudProvider'][_0xb145('0x1e')][_0xb145('0x38')][_0xb145('0x44')];if(!_0x27689f[_0xb145('0x45')](_0x59107e[_0xb145('0x41')]['service']))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x27689f[_0xb145('0x46')](',\x20'));if(_0x59107e[_0xb145('0x41')][_0xb145('0x38')]==='MicrosoftAzure'&&_0x59107e['body'][_0xb145('0x3a')]){_0x59107e[_0xb145('0x41')][_0xb145('0x3a')]=encryptor[_0xb145('0x47')](_0x59107e[_0xb145('0x41')][_0xb145('0x3a')]);}return db[_0xb145('0x1d')][_0xb145('0x40')](_0x59107e[_0xb145('0x41')],{})[_0xb145('0x17')](respondWithResult(_0x3855b6,0xc9))[_0xb145('0x3b')](handleError(_0x3855b6,null));};exports['update']=function(_0x3091ff,_0x59e37c){if(_0x3091ff[_0xb145('0x41')]['id']){delete _0x3091ff[_0xb145('0x41')]['id'];}return db[_0xb145('0x1d')][_0xb145('0x3e')]({'where':{'id':_0x3091ff[_0xb145('0x3d')]['id']}})[_0xb145('0x17')](handleEntityNotFound(_0x59e37c,null))['then'](function(_0x5970de){if(_0x5970de[_0xb145('0x38')]===_0xb145('0x39')&&_0x3091ff[_0xb145('0x41')][_0xb145('0x3a')]){_0x3091ff['body'][_0xb145('0x3a')]=encryptor['encryptString'](_0x3091ff[_0xb145('0x41')][_0xb145('0x3a')]);}return _0x5970de;})[_0xb145('0x17')](saveUpdates(_0x3091ff[_0xb145('0x41')],null))[_0xb145('0x17')](respondWithResult(_0x59e37c,null))[_0xb145('0x3b')](handleError(_0x59e37c,null));};exports['destroy']=function(_0xb9a95b,_0x117532){return db['CloudProvider'][_0xb145('0x3e')]({'where':{'id':_0xb9a95b['params']['id']}})[_0xb145('0x17')](handleEntityNotFound(_0x117532,null))[_0xb145('0x17')](removeEntity(_0x117532,null))['catch'](handleError(_0x117532,null));};exports[_0xb145('0x48')]=function(_0x16f32a,_0x33f395){return db[_0xb145('0x1d')]['findOne']({'where':{'id':_0x16f32a['params']['id']},'raw':!![]})[_0xb145('0x17')](function(_0x5e373f){if(!_0x5e373f)return _0x33f395[_0xb145('0xc')](0x194);return{'url':oauth[_0xb145('0x49')](_0x5e373f,_0x16f32a[_0xb145('0x4a')]['id'])};})['then'](respondWithResult(_0x33f395,null))[_0xb145('0x3b')](handleError(_0x33f395,null));};exports['oauth2MicrosoftCallback']=function(_0xf946f5,_0x1523ac){var _0x3b4aae=_0xf946f5[_0xb145('0x41')];var _0x1995a3;var _0x39215a;if(_0x3b4aae['error'])throw _0x3b4aae;redis[_0xb145('0x4b')](_0x3b4aae[_0xb145('0x4c')])[_0xb145('0x17')](function(_0x594f90){if(!_0x594f90)throw new Error('Invalid\x20state\x20parameter');_0x1995a3=JSON['parse'](_0x594f90);var _0x1c8b45=Buffer[_0xb145('0x4d')](_0x3b4aae['state'],'base64')[_0xb145('0x4e')](_0xb145('0x4f'));_0x39215a=JSON[_0xb145('0x50')](_0x1c8b45);if(!oauth[_0xb145('0x51')](_0x3b4aae['id_token'],_0x1995a3[_0xb145('0x52')]))throw new Error(_0xb145('0x53'));redis[_0xb145('0x54')](_0x3b4aae['state']);return oauth['getOauth2MicrosoftAccessToken'](_0x3b4aae[_0xb145('0x55')],_0x1995a3);})[_0xb145('0x17')](function(_0x4818cf){_0x1995a3['data5']=_0x4818cf['access_token'];_0x1995a3[_0xb145('0x56')]=_0x4818cf[_0xb145('0x57')];return db[_0xb145('0x1d')][_0xb145('0x16')]({'data5':_0x1995a3[_0xb145('0x58')],'data6':_0x1995a3[_0xb145('0x56')]},{'where':{'id':_0x1995a3['id']}});})['then'](function(){oauth[_0xb145('0x59')](_0x1995a3);socket[_0xb145('0x5a')]('microsoftAuthorization:success',{'id':_0x39215a['id']});return;})[_0xb145('0x17')](respondWithStatusCode(_0x1523ac,null))['catch'](function(_0x19a610){if(_0x39215a){socket[_0xb145('0x5a')](_0xb145('0x5b'),{'id':_0x39215a['id']});}if(!_0x1995a3){logger[_0xb145('0x5c')](_0xb145('0x5d'),_0x19a610);return _0x1523ac['status'](0x1f4)[_0xb145('0x19')](_0x19a610[_0xb145('0x5e')]);}logger['error'](_0xb145('0x5f'),_0x1995a3['id'],JSON[_0xb145('0x60')](_0x19a610));});}; \ No newline at end of file +var _0xc712=['state','Invalid\x20state\x20parameter','from','base64','toString','parse','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','emit','microsoftAuthorization:success','microsoftAuthorization:error','message','stringify','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','localhost','socket.io-emitter','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','update','destroy','error','stack','send','padEnd','index','map','CloudProvider','rawAttributes','type','key','model','name','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','then','includeAll','include','service','MicrosoftAzure','decryptString','data3','show','params','length','find','create','body','Name\x20parameter\x20not\x20specified','values','join','catch','oauth2MicrosoftAuthorize','findOne','oauth2MicrosoftCallback'];(function(_0x1e5e7e,_0x5dfc8a){var _0x18c8cb=function(_0x415666){while(--_0x415666){_0x1e5e7e['push'](_0x1e5e7e['shift']());}};_0x18c8cb(++_0x5dfc8a);}(_0xc712,0xcb));var _0x2c71=function(_0xb9234d,_0x566e12){_0xb9234d=_0xb9234d-0x0;var _0x55008a=_0xc712[_0xb9234d];return _0x55008a;};'use strict';var _=require('lodash');var Redis=require(_0x2c71('0x0'));var qs=require(_0x2c71('0x1'));var encryptor=require(_0x2c71('0x2'));var config=require(_0x2c71('0x3'));var logger=require(_0x2c71('0x4'))(_0x2c71('0x5'));var db=require(_0x2c71('0x6'))['db'];var oauth=require(_0x2c71('0x7'));config['redis']=_['defaults'](config[_0x2c71('0x8')],{'host':_0x2c71('0x9'),'port':0x18eb});var socket=require(_0x2c71('0xa'))(new Redis(config['redis']));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x538d6b,_0x1516f0){_0x1516f0=_0x1516f0||0xcc;return function(_0xd1ff3d){if(_0xd1ff3d){return _0x538d6b[_0x2c71('0xb')](_0x1516f0);}return _0x538d6b[_0x2c71('0xc')](_0x1516f0)[_0x2c71('0xd')]();};}function respondWithResult(_0x256dfc,_0x113561){_0x113561=_0x113561||0xc8;return function(_0x540d19){if(_0x540d19){return _0x256dfc[_0x2c71('0xc')](_0x113561)[_0x2c71('0xe')](_0x540d19);}};}function respondWithFilteredResult(_0x4ce9a5,_0x36f32d){return function(_0x3530fb){if(_0x3530fb){var _0x1b9515=typeof _0x36f32d['offset']===_0x2c71('0xf')&&typeof _0x36f32d['limit']===_0x2c71('0xf');var _0x30e083=_0x3530fb[_0x2c71('0x10')];var _0x4f6d7f=_0x1b9515?0x0:_0x36f32d[_0x2c71('0x11')];var _0x1e1ebc=_0x1b9515?_0x3530fb[_0x2c71('0x10')]:_0x36f32d['offset']+_0x36f32d[_0x2c71('0x12')];var _0x274397;if(_0x1e1ebc>=_0x30e083){_0x1e1ebc=_0x30e083;_0x274397=0xc8;}else{_0x274397=0xce;}_0x4ce9a5[_0x2c71('0xc')](_0x274397);return _0x4ce9a5[_0x2c71('0x13')](_0x2c71('0x14'),_0x4f6d7f+'-'+_0x1e1ebc+'/'+_0x30e083)['json'](_0x3530fb);}return null;};}function saveUpdates(_0x32a14e){return function(_0x42b542){if(_0x42b542){return _0x42b542[_0x2c71('0x15')](_0x32a14e)['then'](function(_0x239771){return _0x239771;});}return null;};}function removeEntity(_0x5cb7a0){return function(_0x104279){if(_0x104279){return _0x104279[_0x2c71('0x16')]()['then'](function(){_0x5cb7a0[_0x2c71('0xc')](0xcc)[_0x2c71('0xd')]();});}};}function handleEntityNotFound(_0x2ba74e){return function(_0x325d61){if(!_0x325d61){_0x2ba74e[_0x2c71('0xb')](0x194);}return _0x325d61;};}function handleError(_0x37ec07,_0x235a80){_0x235a80=_0x235a80||0x1f4;return function(_0x5c5816){logger[_0x2c71('0x17')](_0x5c5816[_0x2c71('0x18')]);if(_0x5c5816['name']){delete _0x5c5816['name'];}_0x37ec07[_0x2c71('0xc')](_0x235a80)[_0x2c71('0x19')](_0x5c5816);};}function maskClientSecret(_0x3c07e4){return _[_0x2c71('0x1a')](_0x3c07e4['slice'](0x0,0x3),0x14,'*');}exports[_0x2c71('0x1b')]=function(_0x5bc1b1,_0x35e1c2){var _0x130053={},_0x2d126c={},_0x2bd558={'count':0x0,'rows':[]};var _0x32f8e4=_[_0x2c71('0x1c')](db[_0x2c71('0x1d')][_0x2c71('0x1e')],function(_0x2b7963){return{'name':_0x2b7963['fieldName'],'type':_0x2b7963[_0x2c71('0x1f')][_0x2c71('0x20')]};});_0x2d126c[_0x2c71('0x21')]=_[_0x2c71('0x1c')](_0x32f8e4,_0x2c71('0x22'));_0x2d126c[_0x2c71('0x23')]=_[_0x2c71('0x24')](_0x5bc1b1[_0x2c71('0x23')]);_0x2d126c[_0x2c71('0x25')]=_[_0x2c71('0x26')](_0x2d126c['model'],_0x2d126c[_0x2c71('0x23')]);_0x130053[_0x2c71('0x27')]=_[_0x2c71('0x26')](_0x2d126c[_0x2c71('0x21')],qs[_0x2c71('0x28')](_0x5bc1b1[_0x2c71('0x23')][_0x2c71('0x28')]));_0x130053[_0x2c71('0x27')]=_0x130053[_0x2c71('0x27')]['length']?_0x130053[_0x2c71('0x27')]:_0x2d126c['model'];if(!_0x5bc1b1[_0x2c71('0x23')][_0x2c71('0x29')](_0x2c71('0x2a'))){_0x130053[_0x2c71('0x12')]=qs[_0x2c71('0x12')](_0x5bc1b1[_0x2c71('0x23')]['limit']);_0x130053[_0x2c71('0x11')]=qs[_0x2c71('0x11')](_0x5bc1b1[_0x2c71('0x23')][_0x2c71('0x11')]);}_0x130053['order']=qs[_0x2c71('0x2b')](_0x5bc1b1[_0x2c71('0x23')][_0x2c71('0x2b')]);_0x130053[_0x2c71('0x2c')]=qs[_0x2c71('0x25')](_[_0x2c71('0x2d')](_0x5bc1b1[_0x2c71('0x23')],_0x2d126c[_0x2c71('0x25')]),_0x32f8e4);if(_0x5bc1b1['query']['filter']){_0x130053[_0x2c71('0x2c')]=_[_0x2c71('0x2e')](_0x130053[_0x2c71('0x2c')],{'$or':_[_0x2c71('0x1c')](_0x32f8e4,function(_0x48ff60){if(_0x48ff60['type']!==_0x2c71('0x2f')){var _0x3535a2={};_0x3535a2[_0x48ff60[_0x2c71('0x22')]]={'$like':'%'+_0x5bc1b1[_0x2c71('0x23')][_0x2c71('0x30')]+'%'};return _0x3535a2;}})});}_0x130053=_['merge']({},_0x130053,_0x5bc1b1[_0x2c71('0x31')]);var _0x232978={'where':_0x130053[_0x2c71('0x2c')]};return db[_0x2c71('0x1d')]['count'](_0x232978)[_0x2c71('0x32')](function(_0x1e22f8){_0x2bd558[_0x2c71('0x10')]=_0x1e22f8;if(_0x5bc1b1[_0x2c71('0x23')][_0x2c71('0x33')]){_0x130053[_0x2c71('0x34')]=[{'all':!![]}];}return db['CloudProvider']['findAll'](_0x130053);})[_0x2c71('0x32')](function(_0xd6b4d1){_0x2bd558['rows']=_[_0x2c71('0x1c')](_0xd6b4d1,function(_0x31d4c7){if(_0x31d4c7[_0x2c71('0x35')]===_0x2c71('0x36')){var _0x40b48d=encryptor[_0x2c71('0x37')](_0x31d4c7[_0x2c71('0x38')]);_0x31d4c7['data3']=maskClientSecret(_0x40b48d);}return _0x31d4c7;});return _0x2bd558;})[_0x2c71('0x32')](respondWithFilteredResult(_0x35e1c2,_0x130053))['catch'](handleError(_0x35e1c2,null));};exports[_0x2c71('0x39')]=function(_0x18de84,_0x3b498e){var _0xe111e7={'raw':!![],'where':{'id':_0x18de84[_0x2c71('0x3a')]['id']}},_0x4b997a={};_0x4b997a['model']=_[_0x2c71('0x24')](db[_0x2c71('0x1d')]['rawAttributes']);_0x4b997a[_0x2c71('0x23')]=_['keys'](_0x18de84[_0x2c71('0x23')]);_0x4b997a[_0x2c71('0x25')]=_[_0x2c71('0x26')](_0x4b997a['model'],_0x4b997a[_0x2c71('0x23')]);_0xe111e7[_0x2c71('0x27')]=_[_0x2c71('0x26')](_0x4b997a['model'],qs[_0x2c71('0x28')](_0x18de84['query']['fields']));_0xe111e7[_0x2c71('0x27')]=_0xe111e7[_0x2c71('0x27')][_0x2c71('0x3b')]?_0xe111e7[_0x2c71('0x27')]:_0x4b997a['model'];if(_0x18de84[_0x2c71('0x23')][_0x2c71('0x33')]){_0xe111e7['include']=[{'all':!![]}];}_0xe111e7=_['merge']({},_0xe111e7,_0x18de84[_0x2c71('0x31')]);return db[_0x2c71('0x1d')][_0x2c71('0x3c')](_0xe111e7)[_0x2c71('0x32')](handleEntityNotFound(_0x3b498e,null))[_0x2c71('0x32')](function(_0x1a75f1){if(_0x1a75f1['service']===_0x2c71('0x36')){var _0x34f88c=encryptor[_0x2c71('0x37')](_0x1a75f1[_0x2c71('0x38')]);_0x1a75f1['data3']=maskClientSecret(_0x34f88c);}return _0x1a75f1;})['then'](respondWithResult(_0x3b498e,null))['catch'](handleError(_0x3b498e,null));};exports[_0x2c71('0x3d')]=function(_0x550bbb,_0x2296bf){if(!_0x550bbb[_0x2c71('0x3e')][_0x2c71('0x22')])throw new Error(_0x2c71('0x3f'));if(!_0x550bbb[_0x2c71('0x3e')][_0x2c71('0x35')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x22ab0a=db[_0x2c71('0x1d')][_0x2c71('0x1e')][_0x2c71('0x35')][_0x2c71('0x40')];if(!_0x22ab0a['includes'](_0x550bbb[_0x2c71('0x3e')][_0x2c71('0x35')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x22ab0a[_0x2c71('0x41')](',\x20'));if(_0x550bbb[_0x2c71('0x3e')][_0x2c71('0x35')]===_0x2c71('0x36')&&_0x550bbb['body'][_0x2c71('0x38')]){_0x550bbb[_0x2c71('0x3e')][_0x2c71('0x38')]=encryptor['encryptString'](_0x550bbb['body'][_0x2c71('0x38')]);}return db[_0x2c71('0x1d')][_0x2c71('0x3d')](_0x550bbb['body'],{})[_0x2c71('0x32')](respondWithResult(_0x2296bf,0xc9))[_0x2c71('0x42')](handleError(_0x2296bf,null));};exports[_0x2c71('0x15')]=function(_0xe90bba,_0x577e32){if(_0xe90bba['body']['id']){delete _0xe90bba[_0x2c71('0x3e')]['id'];}return db['CloudProvider'][_0x2c71('0x3c')]({'where':{'id':_0xe90bba[_0x2c71('0x3a')]['id']}})[_0x2c71('0x32')](handleEntityNotFound(_0x577e32,null))['then'](function(_0x52a9e3){if(_0x52a9e3['service']===_0x2c71('0x36')&&_0xe90bba[_0x2c71('0x3e')][_0x2c71('0x38')]){_0xe90bba[_0x2c71('0x3e')][_0x2c71('0x38')]=encryptor['encryptString'](_0xe90bba[_0x2c71('0x3e')][_0x2c71('0x38')]);}return _0x52a9e3;})[_0x2c71('0x32')](saveUpdates(_0xe90bba[_0x2c71('0x3e')],null))[_0x2c71('0x32')](respondWithResult(_0x577e32,null))['catch'](handleError(_0x577e32,null));};exports['destroy']=function(_0xe9f1f7,_0x5cc8f5){return db[_0x2c71('0x1d')][_0x2c71('0x3c')]({'where':{'id':_0xe9f1f7['params']['id']}})[_0x2c71('0x32')](handleEntityNotFound(_0x5cc8f5,null))[_0x2c71('0x32')](removeEntity(_0x5cc8f5,null))['catch'](handleError(_0x5cc8f5,null));};exports[_0x2c71('0x43')]=function(_0xdf0dc9,_0x5b7a89){return db[_0x2c71('0x1d')][_0x2c71('0x44')]({'where':{'id':_0xdf0dc9['params']['id']},'raw':!![]})[_0x2c71('0x32')](function(_0x2d690c){if(!_0x2d690c)return _0x5b7a89[_0x2c71('0xb')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x2d690c,_0xdf0dc9['user']['id'])};})[_0x2c71('0x32')](respondWithResult(_0x5b7a89,null))[_0x2c71('0x42')](handleError(_0x5b7a89,null));};exports[_0x2c71('0x45')]=function(_0x387d62,_0x5dfc1b){var _0x35f331=_0x387d62['body'];var _0x1d4386;var _0x1e5ff4;if(_0x35f331[_0x2c71('0x17')])throw _0x35f331;redis['get'](_0x35f331[_0x2c71('0x46')])[_0x2c71('0x32')](function(_0x4548c4){if(!_0x4548c4)throw new Error(_0x2c71('0x47'));_0x1d4386=JSON['parse'](_0x4548c4);var _0xfab533=Buffer[_0x2c71('0x48')](_0x35f331[_0x2c71('0x46')],_0x2c71('0x49'))[_0x2c71('0x4a')]('ascii');_0x1e5ff4=JSON[_0x2c71('0x4b')](_0xfab533);if(!oauth[_0x2c71('0x4c')](_0x35f331[_0x2c71('0x4d')],_0x1d4386[_0x2c71('0x4e')]))throw new Error(_0x2c71('0x4f'));redis['del'](_0x35f331[_0x2c71('0x46')]);return oauth[_0x2c71('0x50')](_0x35f331[_0x2c71('0x51')],_0x1d4386);})[_0x2c71('0x32')](function(_0x4c8c3c){_0x1d4386[_0x2c71('0x52')]=_0x4c8c3c[_0x2c71('0x53')];_0x1d4386[_0x2c71('0x54')]=_0x4c8c3c[_0x2c71('0x55')];return db['CloudProvider'][_0x2c71('0x15')]({'data5':_0x1d4386[_0x2c71('0x52')],'data6':_0x1d4386[_0x2c71('0x54')]},{'where':{'id':_0x1d4386['id']}});})['then'](function(){oauth['startRefreshInterval'](_0x1d4386);socket[_0x2c71('0x56')](_0x2c71('0x57'),{'id':_0x1e5ff4['id']});return;})[_0x2c71('0x32')](respondWithStatusCode(_0x5dfc1b,null))[_0x2c71('0x42')](function(_0x177976){if(_0x1e5ff4){socket[_0x2c71('0x56')](_0x2c71('0x58'),{'id':_0x1e5ff4['id']});}if(!_0x1d4386){logger[_0x2c71('0x17')]('Invalid\x20authentication\x20state\x20parameter',_0x177976);return _0x5dfc1b[_0x2c71('0xc')](0x1f4)[_0x2c71('0x19')](_0x177976[_0x2c71('0x59')]);}logger[_0x2c71('0x17')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x1d4386['id'],JSON[_0x2c71('0x5a')](_0x177976));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 04cb2f5..3582993 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 _0x1a5e=['bluebird','request-promise','path','../../config/environment','./cloudProvider.attributes','define','CloudProvider','lodash','util','../../config/logger'];(function(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0x1a5e,0x9d));var _0xe1a5=function(_0x497645,_0x4a1eb3){_0x497645=_0x497645-0x0;var _0x4c7dd1=_0x1a5e[_0x497645];return _0x4c7dd1;};'use strict';var _=require(_0xe1a5('0x0'));var util=require(_0xe1a5('0x1'));var logger=require(_0xe1a5('0x2'))('api');var moment=require('moment');var BPromise=require(_0xe1a5('0x3'));var rp=require(_0xe1a5('0x4'));var fs=require('fs');var path=require(_0xe1a5('0x5'));var rimraf=require('rimraf');var config=require(_0xe1a5('0x6'));var attributes=require(_0xe1a5('0x7'));module['exports']=function(_0x3d8940,_0x4b9821){return _0x3d8940[_0xe1a5('0x8')](_0xe1a5('0x9'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd066=['./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x2eea9a,_0x368daf){var _0x1ec61e=function(_0x1fc2fc){while(--_0x1fc2fc){_0x2eea9a['push'](_0x2eea9a['shift']());}};_0x1ec61e(++_0x368daf);}(_0xd066,0x1b5));var _0x6d06=function(_0x523670,_0xf4bafe){_0x523670=_0x523670-0x0;var _0x2f25fb=_0xd066[_0x523670];return _0x2f25fb;};'use strict';var _=require(_0x6d06('0x0'));var util=require('util');var logger=require(_0x6d06('0x1'))('api');var moment=require(_0x6d06('0x2'));var BPromise=require(_0x6d06('0x3'));var rp=require(_0x6d06('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6d06('0x5'));var config=require(_0x6d06('0x6'));var attributes=require(_0x6d06('0x7'));module[_0x6d06('0x8')]=function(_0x15cb11,_0x221540){return _0x15cb11[_0x6d06('0x9')](_0x6d06('0xa'),attributes,{'tableName':_0x6d06('0xb'),'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 9420d3d..2a31999 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 _0xc46c=['Dynamics365','data7','replace','{TENANT_ID}','code','from','stringify','toString','base64','data1','response_type','join','redirect_uri','data4','response_mode','form_post','scope','state','nonce','prompt','login','key','value','oauth2/','set','decode','payload','iss','issuer','aud','audience','isAfter','unix','resolve','data3','CloudProvider','then','refresh_token','data6','decryptString','data2','update','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','POST','bind','all','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','crypto','jsonwebtoken','ioredis','request-promise','util','../../components/encryptor','../../config/logger','../../config/schedule/cloud-provider','../../mysqldb','defaults','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','push','/.default','Outlook365'];(function(_0x35920d,_0x586623){var _0x8f8c7e=function(_0x36e918){while(--_0x36e918){_0x35920d['push'](_0x35920d['shift']());}};_0x8f8c7e(++_0x586623);}(_0xc46c,0x1ae));var _0xcc46=function(_0x26721d,_0x448ba5){_0x26721d=_0x26721d-0x0;var _0x1035c5=_0xc46c[_0x26721d];return _0x1035c5;};'use strict';var _=require('lodash');var crypto=require(_0xcc46('0x0'));var jwt=require(_0xcc46('0x1'));var moment=require('moment');var Redis=require(_0xcc46('0x2'));var rp=require(_0xcc46('0x3'));var util=require(_0xcc46('0x4'));var encryptor=require(_0xcc46('0x5'));var config=require('../../config/environment');var logger=require(_0xcc46('0x6'))('api');var schedule=require(_0xcc46('0x7'));var db=require(_0xcc46('0x8'))['db'];config['redis']=_[_0xcc46('0x9')](config[_0xcc46('0xa')],{'host':_0xcc46('0xb'),'port':0x18eb});var redis=new Redis(config[_0xcc46('0xa')]);var MICROSOFT_AUTH_URL=_0xcc46('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0xcc46('0xd'),_0xcc46('0xe'),'email',_0xcc46('0xf'),_0xcc46('0x10'),_0xcc46('0x11'),_0xcc46('0x12')],'Dynamics365':['openid',_0xcc46('0xf')]};var MICROSOFT_AUTH_ENDPOINT=_0xcc46('0x13');var MICROSOFT_TOKEN_ENDPOINT=_0xcc46('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x33317a){var _0x11daa4=_[_0xcc46('0x15')](AZURE_AUTH_SCOPES[_0x33317a[_0xcc46('0x16')]]);if(_0x33317a['type']==='Dynamics365')_0x11daa4[_0xcc46('0x17')](_0x33317a['data7']+_0xcc46('0x18'));return _0x11daa4['join']('\x20');}function getAccessTokenScope(_0x4ee9b0){if(_0x4ee9b0[_0xcc46('0x16')]===_0xcc46('0x19'))return _0xcc46('0x10');if(_0x4ee9b0[_0xcc46('0x16')]===_0xcc46('0x1a'))return _0x4ee9b0[_0xcc46('0x1b')]+_0xcc46('0x18');}function generateMicrosoftAuthorizationUrl(_0x9b591,_0x2a24e1){var _0x5da005=MICROSOFT_AUTH_URL[_0xcc46('0x1c')](_0xcc46('0x1d'),_0x9b591['data2']);var _0x4f65e7=[_0xcc46('0x1e'),'id_token'];var _0xad8a87=Buffer[_0xcc46('0x1f')](JSON[_0xcc46('0x20')]({'id':_0x2a24e1}))[_0xcc46('0x21')](_0xcc46('0x22'));var _0x48855f=crypto['randomBytes'](0x10)[_0xcc46('0x21')]('hex');var _0x250cbe=getAuthorizationScopes(_0x9b591);var _0x17a502=[{'key':'client_id','value':_0x9b591[_0xcc46('0x23')]},{'key':_0xcc46('0x24'),'value':encodeURIComponent(_0x4f65e7[_0xcc46('0x25')]('\x20'))},{'key':_0xcc46('0x26'),'value':_0x9b591[_0xcc46('0x27')]},{'key':_0xcc46('0x28'),'value':_0xcc46('0x29')},{'key':_0xcc46('0x2a'),'value':encodeURIComponent(_0x250cbe)},{'key':_0xcc46('0x2b'),'value':_0xad8a87},{'key':_0xcc46('0x2c'),'value':_0x48855f},{'key':_0xcc46('0x2d'),'value':_0xcc46('0x2e')}];var _0x39a1bb=_0x5da005+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xcc46('0x15')](_0x17a502,function(_0xa14b5c){return _0xa14b5c[_0xcc46('0x2f')]+'='+_0xa14b5c[_0xcc46('0x30')];})[_0xcc46('0x25')]('&');_0x9b591['oauth2Claims']={'issuer':_0x5da005[_0xcc46('0x1c')](_0xcc46('0x31'),''),'audience':_0x9b591[_0xcc46('0x23')],'state':_0xad8a87,'nonce':_0x48855f};redis[_0xcc46('0x32')](_0xad8a87,JSON['stringify'](_0x9b591));return _0x39a1bb;}function isValidIdToken(_0x15e497,_0x463b90){try{var _0x5f6055=jwt[_0xcc46('0x33')](_0x15e497,{'complete':!![]});var _0xee5116=_0x5f6055[_0xcc46('0x34')];if(_0xee5116[_0xcc46('0x35')]!==_0x463b90[_0xcc46('0x36')])return![];if(_0xee5116[_0xcc46('0x37')]!==_0x463b90[_0xcc46('0x38')])return![];if(_0xee5116['nonce']!==_0x463b90[_0xcc46('0x2c')])return![];if(moment()[_0xcc46('0x39')](moment[_0xcc46('0x3a')](_0xee5116['exp'])))return![];return!![];}catch(_0x1654f4){throw _0x1654f4;}}function refreshOauth2MicrosoftAccessToken(_0x2f40e2){return Promise[_0xcc46('0x3b')]()['then'](function(){if(_0x2f40e2[_0xcc46('0x3c')])return _0x2f40e2;return db[_0xcc46('0x3d')]['findOne']({'where':{'id':_0x2f40e2['id']},'raw':!![]});})[_0xcc46('0x3e')](function(_0x3b9236){var _0x46175e={'grant_type':_0xcc46('0x3f'),'refresh_token':_0x3b9236[_0xcc46('0x40')],'scope':getAccessTokenScope(_0x3b9236),'redirect_uri':_0x3b9236['data4'],'client_id':_0x3b9236['data1'],'client_secret':encryptor[_0xcc46('0x41')](_0x3b9236[_0xcc46('0x3c')])};var _0x4a3130={'method':'POST','uri':MICROSOFT_AUTH_URL[_0xcc46('0x1c')](_0xcc46('0x1d'),_0x3b9236[_0xcc46('0x42')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x46175e,'json':!![]};return rp(_0x4a3130);})['then'](function(_0x4436c4){_0x2f40e2['data5']=_0x4436c4['access_token'];_0x2f40e2[_0xcc46('0x40')]=_0x4436c4['refresh_token'];return db[_0xcc46('0x3d')][_0xcc46('0x43')]({'data5':_0x2f40e2['data5'],'data6':_0x2f40e2[_0xcc46('0x40')]},{'where':{'id':_0x2f40e2['id']}});})[_0xcc46('0x3e')](function(){return _0x2f40e2;})[_0xcc46('0x44')](function(_0xa5becc){logger['error'](_0xcc46('0x45'),_0x2f40e2['id'],_0xa5becc);});}function getOauth2MicrosoftAccessToken(_0x88e9bc,_0x42b211){var _0x5981db={'grant_type':_0xcc46('0x46'),'code':_0x88e9bc,'scope':getAccessTokenScope(_0x42b211),'redirect_uri':_0x42b211[_0xcc46('0x27')],'client_id':_0x42b211[_0xcc46('0x23')],'client_secret':encryptor[_0xcc46('0x41')](_0x42b211[_0xcc46('0x3c')])};var _0x476ab0={'method':_0xcc46('0x47'),'uri':MICROSOFT_AUTH_URL[_0xcc46('0x1c')](_0xcc46('0x1d'),_0x42b211['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x5981db,'json':!![]};return rp(_0x476ab0);}function startRefreshInterval(_0x14682a){var _0xa6e29a=schedule['intervals'];if(_0xa6e29a[_0x14682a['id']])clearInterval(_0xa6e29a[_0x14682a['id']]);_0xa6e29a[_0x14682a['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xcc46('0x48')](this,{'id':_0x14682a['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0xa6e29a;}function startAllRefreshIntervals(){return db[_0xcc46('0x3d')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x2f9bf5){var _0x130497=_0x2f9bf5[_0xcc46('0x15')](function(_0x5717dd){return refreshOauth2MicrosoftAccessToken(_0x5717dd)[_0xcc46('0x3e')](function(_0x307e43){startRefreshInterval(_0x307e43);});});return Promise[_0xcc46('0x49')](_0x130497);})[_0xcc46('0x44')](function(_0xc99c67){var _0x2acbfb=_0xc99c67?util['inspect'](_0xc99c67,{'showHidden':![],'depth':null}):'';logger[_0xcc46('0x4a')](_0xcc46('0x4b'),_0x2acbfb);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x8b32=['redirect_uri','response_mode','form_post','scope','state','nonce','prompt','login','key','value','oauth2Claims','replace','oauth2/','set','decode','payload','iss','aud','audience','isAfter','unix','exp','data3','findOne','then','refresh_token','decryptString','POST','data5','access_token','data6','CloudProvider','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','data4','intervals','bind','findAll','all','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','lodash','crypto','moment','request-promise','util','../../components/encryptor','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','openid','profile','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','offline_access','/authorize','map','type','Dynamics365','push','data7','/.default','join','{TENANT_ID}','data2','id_token','from','stringify','base64','randomBytes','toString','hex','client_id','data1','response_type'];(function(_0x4058cc,_0x52646f){var _0x105ea6=function(_0x190dc5){while(--_0x190dc5){_0x4058cc['push'](_0x4058cc['shift']());}};_0x105ea6(++_0x52646f);}(_0x8b32,0x7d));var _0x28b3=function(_0x359283,_0x289512){_0x359283=_0x359283-0x0;var _0x3fbb72=_0x8b32[_0x359283];return _0x3fbb72;};'use strict';var _=require(_0x28b3('0x0'));var crypto=require(_0x28b3('0x1'));var jwt=require('jsonwebtoken');var moment=require(_0x28b3('0x2'));var Redis=require('ioredis');var rp=require(_0x28b3('0x3'));var util=require(_0x28b3('0x4'));var encryptor=require(_0x28b3('0x5'));var config=require('../../config/environment');var logger=require(_0x28b3('0x6'))(_0x28b3('0x7'));var schedule=require(_0x28b3('0x8'));var db=require(_0x28b3('0x9'))['db'];config[_0x28b3('0xa')]=_[_0x28b3('0xb')](config[_0x28b3('0xa')],{'host':_0x28b3('0xc'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0x28b3('0xd'),_0x28b3('0xe'),'email','offline_access',_0x28b3('0xf'),_0x28b3('0x10'),_0x28b3('0x11')],'Dynamics365':['openid',_0x28b3('0x12')]};var MICROSOFT_AUTH_ENDPOINT=_0x28b3('0x13');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0xae6ecd){var _0x1e0c75=_[_0x28b3('0x14')](AZURE_AUTH_SCOPES[_0xae6ecd['type']]);if(_0xae6ecd[_0x28b3('0x15')]===_0x28b3('0x16'))_0x1e0c75[_0x28b3('0x17')](_0xae6ecd[_0x28b3('0x18')]+_0x28b3('0x19'));return _0x1e0c75[_0x28b3('0x1a')]('\x20');}function getAccessTokenScope(_0x90e7da){if(_0x90e7da[_0x28b3('0x15')]==='Outlook365')return _0x28b3('0xf');if(_0x90e7da[_0x28b3('0x15')]===_0x28b3('0x16'))return _0x90e7da[_0x28b3('0x18')]+_0x28b3('0x19');}function generateMicrosoftAuthorizationUrl(_0x851a79,_0x4a336a){var _0x40c452=MICROSOFT_AUTH_URL['replace'](_0x28b3('0x1b'),_0x851a79[_0x28b3('0x1c')]);var _0x57e8e8=['code',_0x28b3('0x1d')];var _0x546f17=Buffer[_0x28b3('0x1e')](JSON[_0x28b3('0x1f')]({'id':_0x4a336a}))['toString'](_0x28b3('0x20'));var _0x423547=crypto[_0x28b3('0x21')](0x10)[_0x28b3('0x22')](_0x28b3('0x23'));var _0x305a0d=getAuthorizationScopes(_0x851a79);var _0x5a5cf0=[{'key':_0x28b3('0x24'),'value':_0x851a79[_0x28b3('0x25')]},{'key':_0x28b3('0x26'),'value':encodeURIComponent(_0x57e8e8[_0x28b3('0x1a')]('\x20'))},{'key':_0x28b3('0x27'),'value':_0x851a79['data4']},{'key':_0x28b3('0x28'),'value':_0x28b3('0x29')},{'key':_0x28b3('0x2a'),'value':encodeURIComponent(_0x305a0d)},{'key':_0x28b3('0x2b'),'value':_0x546f17},{'key':_0x28b3('0x2c'),'value':_0x423547},{'key':_0x28b3('0x2d'),'value':_0x28b3('0x2e')}];var _0x4ac032=_0x40c452+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x28b3('0x14')](_0x5a5cf0,function(_0x179370){return _0x179370[_0x28b3('0x2f')]+'='+_0x179370[_0x28b3('0x30')];})[_0x28b3('0x1a')]('&');_0x851a79[_0x28b3('0x31')]={'issuer':_0x40c452[_0x28b3('0x32')](_0x28b3('0x33'),''),'audience':_0x851a79[_0x28b3('0x25')],'state':_0x546f17,'nonce':_0x423547};redis[_0x28b3('0x34')](_0x546f17,JSON[_0x28b3('0x1f')](_0x851a79));return _0x4ac032;}function isValidIdToken(_0x1ba556,_0x26a537){try{var _0x3becab=jwt[_0x28b3('0x35')](_0x1ba556,{'complete':!![]});var _0x56262a=_0x3becab[_0x28b3('0x36')];if(_0x56262a[_0x28b3('0x37')]!==_0x26a537['issuer'])return![];if(_0x56262a[_0x28b3('0x38')]!==_0x26a537[_0x28b3('0x39')])return![];if(_0x56262a[_0x28b3('0x2c')]!==_0x26a537['nonce'])return![];if(moment()[_0x28b3('0x3a')](moment[_0x28b3('0x3b')](_0x56262a[_0x28b3('0x3c')])))return![];return!![];}catch(_0x58ae13){throw _0x58ae13;}}function refreshOauth2MicrosoftAccessToken(_0x980607){return Promise['resolve']()['then'](function(){if(_0x980607[_0x28b3('0x3d')])return _0x980607;return db['CloudProvider'][_0x28b3('0x3e')]({'where':{'id':_0x980607['id']},'raw':!![]});})[_0x28b3('0x3f')](function(_0x1648eb){var _0x1dd771={'grant_type':_0x28b3('0x40'),'refresh_token':_0x1648eb['data6'],'scope':getAccessTokenScope(_0x1648eb),'redirect_uri':_0x1648eb['data4'],'client_id':_0x1648eb['data1'],'client_secret':encryptor[_0x28b3('0x41')](_0x1648eb['data3'])};var _0x2937f7={'method':_0x28b3('0x42'),'uri':MICROSOFT_AUTH_URL[_0x28b3('0x32')](_0x28b3('0x1b'),_0x1648eb['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1dd771,'json':!![]};return rp(_0x2937f7);})[_0x28b3('0x3f')](function(_0x55b8c7){_0x980607[_0x28b3('0x43')]=_0x55b8c7[_0x28b3('0x44')];_0x980607[_0x28b3('0x45')]=_0x55b8c7[_0x28b3('0x40')];return db[_0x28b3('0x46')][_0x28b3('0x47')]({'data5':_0x980607[_0x28b3('0x43')],'data6':_0x980607[_0x28b3('0x45')]},{'where':{'id':_0x980607['id']}});})[_0x28b3('0x3f')](function(){return _0x980607;})[_0x28b3('0x48')](function(_0x1141a9){logger[_0x28b3('0x49')](_0x28b3('0x4a'),_0x980607['id'],_0x1141a9);});}function getOauth2MicrosoftAccessToken(_0x19f0cf,_0x2d51dd){var _0x3f6a11={'grant_type':_0x28b3('0x4b'),'code':_0x19f0cf,'scope':getAccessTokenScope(_0x2d51dd),'redirect_uri':_0x2d51dd[_0x28b3('0x4c')],'client_id':_0x2d51dd['data1'],'client_secret':encryptor['decryptString'](_0x2d51dd[_0x28b3('0x3d')])};var _0xe5512e={'method':_0x28b3('0x42'),'uri':MICROSOFT_AUTH_URL[_0x28b3('0x32')](_0x28b3('0x1b'),_0x2d51dd[_0x28b3('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3f6a11,'json':!![]};return rp(_0xe5512e);}function startRefreshInterval(_0x46dfa8){var _0x483148=schedule[_0x28b3('0x4d')];if(_0x483148[_0x46dfa8['id']])clearInterval(_0x483148[_0x46dfa8['id']]);_0x483148[_0x46dfa8['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x28b3('0x4e')](this,{'id':_0x46dfa8['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x28b3('0x4d')]=_0x483148;}function startAllRefreshIntervals(){return db[_0x28b3('0x46')][_0x28b3('0x4f')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x29560e){var _0x3e26f8=_0x29560e['map'](function(_0x26e7a4){return refreshOauth2MicrosoftAccessToken(_0x26e7a4)[_0x28b3('0x3f')](function(_0xf6b145){startRefreshInterval(_0xf6b145);});});return Promise[_0x28b3('0x50')](_0x3e26f8);})[_0x28b3('0x48')](function(_0x7c072c){var _0x217300=_0x7c072c?util['inspect'](_0x7c072c,{'showHidden':![],'depth':null}):'';logger[_0x28b3('0x49')](_0x28b3('0x51'),_0x217300);});}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 2f93949..5665e6e 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 _0x1c52=['code','message','info','result','lodash','util','moment','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x3770ff,_0x49a005){var _0x240b3c=function(_0x1963fc){while(--_0x1963fc){_0x3770ff['push'](_0x3770ff['shift']());}};_0x240b3c(++_0x49a005);}(_0x1c52,0x7c));var _0x21c5=function(_0x42b0cf,_0x2e4cfe){_0x42b0cf=_0x42b0cf-0x0;var _0x49329f=_0x1c52[_0x42b0cf];return _0x49329f;};'use strict';var _=require(_0x21c5('0x0'));var util=require(_0x21c5('0x1'));var moment=require(_0x21c5('0x2'));var BPromise=require(_0x21c5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x21c5('0x4'));var logger=require(_0x21c5('0x5'))('rpc');var config=require(_0x21c5('0x6'));var jayson=require(_0x21c5('0x7'));var client=jayson[_0x21c5('0x8')][_0x21c5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b12d5,_0xed0195,_0xb4b1e4){return new BPromise(function(_0x4c5a4f,_0xd34da2){return client[_0x21c5('0xa')](_0x5b12d5,_0xb4b1e4)[_0x21c5('0xb')](function(_0x27389f){logger['info'](_0x21c5('0xc'),_0xed0195,_0x21c5('0xd'));logger[_0x21c5('0xe')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0xed0195,_0x21c5('0xd'),JSON['stringify'](_0x27389f));if(_0x27389f[_0x21c5('0xf')]){if(_0x27389f[_0x21c5('0xf')][_0x21c5('0x10')]===0x1f4){logger[_0x21c5('0xf')]('CloudProvider,\x20%s,\x20%s',_0xed0195,_0x27389f[_0x21c5('0xf')]['message']);return _0xd34da2(_0x27389f[_0x21c5('0xf')][_0x21c5('0x11')]);}logger['error'](_0x21c5('0xc'),_0xed0195,_0x27389f['error']['message']);return _0x4c5a4f(_0x27389f[_0x21c5('0xf')][_0x21c5('0x11')]);}else{logger[_0x21c5('0x12')](_0x21c5('0xc'),_0xed0195,_0x21c5('0xd'));_0x4c5a4f(_0x27389f[_0x21c5('0x13')][_0x21c5('0x11')]);}})['catch'](function(_0x331080){logger['error']('CloudProvider,\x20%s,\x20%s',_0xed0195,_0x331080);_0xd34da2(_0x331080);});});} \ No newline at end of file +var _0xd786=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x120300,_0x4d092f){var _0x6e9eaa=function(_0x5ed789){while(--_0x5ed789){_0x120300['push'](_0x120300['shift']());}};_0x6e9eaa(++_0x4d092f);}(_0xd786,0x1dc));var _0x6d78=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xd786[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x6d78('0x0'));var util=require(_0x6d78('0x1'));var moment=require(_0x6d78('0x2'));var BPromise=require(_0x6d78('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6d78('0x4'));var db=require(_0x6d78('0x5'))['db'];var utils=require(_0x6d78('0x6'));var logger=require(_0x6d78('0x7'))(_0x6d78('0x8'));var config=require(_0x6d78('0x9'));var jayson=require(_0x6d78('0xa'));var client=jayson['client'][_0x6d78('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x30e9e5,_0x5c3f38,_0x44db98){return new BPromise(function(_0x33b85e,_0x10f58a){return client[_0x6d78('0xc')](_0x30e9e5,_0x44db98)['then'](function(_0x3198b6){logger[_0x6d78('0xd')](_0x6d78('0xe'),_0x5c3f38,'request\x20sent');logger[_0x6d78('0xf')](_0x6d78('0x10'),_0x5c3f38,_0x6d78('0x11'),JSON[_0x6d78('0x12')](_0x3198b6));if(_0x3198b6[_0x6d78('0x13')]){if(_0x3198b6[_0x6d78('0x13')][_0x6d78('0x14')]===0x1f4){logger[_0x6d78('0x13')](_0x6d78('0xe'),_0x5c3f38,_0x3198b6[_0x6d78('0x13')]['message']);return _0x10f58a(_0x3198b6[_0x6d78('0x13')][_0x6d78('0x15')]);}logger[_0x6d78('0x13')](_0x6d78('0xe'),_0x5c3f38,_0x3198b6[_0x6d78('0x13')]['message']);return _0x33b85e(_0x3198b6['error'][_0x6d78('0x15')]);}else{logger['info'](_0x6d78('0xe'),_0x5c3f38,'request\x20sent');_0x33b85e(_0x3198b6[_0x6d78('0x16')]['message']);}})[_0x6d78('0x17')](function(_0x378c59){logger[_0x6d78('0x13')](_0x6d78('0xe'),_0x5c3f38,_0x378c59);_0x10f58a(_0x378c59);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 054fe78..20f7169 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 _0x7a54=['isAuthenticated','/:id','show','post','create','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','exports','express','Router','../../components/auth/service','get'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x7a54,0x106));var _0x47a5=function(_0x494abd,_0x5cfb13){_0x494abd=_0x494abd-0x0;var _0x561140=_0x7a54[_0x494abd];return _0x561140;};'use strict';var express=require(_0x47a5('0x0'));var router=express[_0x47a5('0x1')]();var auth=require(_0x47a5('0x2'));var controller=require('./cloudProvider.controller');router[_0x47a5('0x3')]('/',auth[_0x47a5('0x4')](),controller['index']);router[_0x47a5('0x3')](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller[_0x47a5('0x6')]);router[_0x47a5('0x7')]('/',auth['isAuthenticated'](),controller[_0x47a5('0x8')]);router['put'](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller['update']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x47a5('0x3')](_0x47a5('0xa'),auth['isAuthenticated'](),controller[_0x47a5('0xb')]);router['post']('/oauth2/microsoft/callback',controller[_0x47a5('0xc')]);module[_0x47a5('0xd')]=router; \ No newline at end of file +var _0x5f2f=['exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback'];(function(_0x61b3ab,_0x1fc298){var _0x57097f=function(_0x25970b){while(--_0x25970b){_0x61b3ab['push'](_0x61b3ab['shift']());}};_0x57097f(++_0x1fc298);}(_0x5f2f,0x73));var _0xf5f2=function(_0x25af7d,_0xce76bd){_0x25af7d=_0x25af7d-0x0;var _0x353e11=_0x5f2f[_0x25af7d];return _0x353e11;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);router[_0xf5f2('0x4')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x7')]);router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x9')]);router[_0xf5f2('0xa')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xc')]);router[_0xf5f2('0xd')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0x4')](_0xf5f2('0xf'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);router['post']('/oauth2/microsoft/callback',controller[_0xf5f2('0x11')]);module[_0xf5f2('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 52355f3..f982ee1 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 _0x6a6b=['exports','name','STRING','sequelize'];(function(_0x443b7a,_0x1b4711){var _0xa19fb4=function(_0x38c28e){while(--_0x38c28e){_0x443b7a['push'](_0x443b7a['shift']());}};_0xa19fb4(++_0x1b4711);}(_0x6a6b,0xcb));var _0xb6a6=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x6a6b[_0x126558];return _0x1f6d14;};'use strict';var Sequelize=require(_0xb6a6('0x0'));module[_0xb6a6('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xb6a6('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0xb6a6('0x3')]},'website':{'type':Sequelize[_0xb6a6('0x3')]},'phone':{'type':Sequelize[_0xb6a6('0x3')]},'fax':{'type':Sequelize[_0xb6a6('0x3')]},'type':{'type':Sequelize[_0xb6a6('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xb6a6('0x3')]},'city':{'type':Sequelize[_0xb6a6('0x3')]},'country':{'type':Sequelize[_0xb6a6('0x3')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0xb6a6('0x3')]},'sPostalCode':{'type':Sequelize[_0xb6a6('0x3')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0xb6a6('0x3')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa794=['STRING','name'];(function(_0x111a2e,_0x1005d3){var _0xa9eea9=function(_0x397cdd){while(--_0x397cdd){_0x111a2e['push'](_0x111a2e['shift']());}};_0xa9eea9(++_0x1005d3);}(_0xa794,0x79));var _0x4a79=function(_0x540eb1,_0x2b9e29){_0x540eb1=_0x540eb1-0x0;var _0x102c91=_0xa794[_0x540eb1];return _0x102c91;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x4a79('0x0'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x4a79('0x1')]},'companyId':{'type':Sequelize[_0x4a79('0x1')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x4a79('0x1')]},'fax':{'type':Sequelize[_0x4a79('0x1')]},'type':{'type':Sequelize[_0x4a79('0x1')]},'street':{'type':Sequelize[_0x4a79('0x1')]},'postalCode':{'type':Sequelize[_0x4a79('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x4a79('0x1')]},'email':{'type':Sequelize[_0x4a79('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x4a79('0x1')]},'sStreet':{'type':Sequelize[_0x4a79('0x1')]},'sPostalCode':{'type':Sequelize[_0x4a79('0x1')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x4a79('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index dab1156..7e39755 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 _0x3caf=['sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../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','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','get','UserProfileResource','error','stack','name','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','map','options','include','findAll','rows','catch','show','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Companies','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addContacts','CmContact','ids','omit','getContacts','findOne','filter','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path'];(function(_0x2151ff,_0x251043){var _0x262d1a=function(_0x43a928){while(--_0x43a928){_0x2151ff['push'](_0x2151ff['shift']());}};_0x262d1a(++_0x251043);}(_0x3caf,0x108));var _0xf3ca=function(_0x1381ad,_0x153441){_0x1381ad=_0x1381ad-0x0;var _0x7f4eec=_0x3caf[_0x1381ad];return _0x7f4eec;};'use strict';var emlformat=require(_0xf3ca('0x0'));var rimraf=require(_0xf3ca('0x1'));var zipdir=require(_0xf3ca('0x2'));var jsonpatch=require(_0xf3ca('0x3'));var rp=require(_0xf3ca('0x4'));var moment=require('moment');var BPromise=require(_0xf3ca('0x5'));var Mustache=require(_0xf3ca('0x6'));var util=require(_0xf3ca('0x7'));var path=require(_0xf3ca('0x8'));var sox=require(_0xf3ca('0x9'));var csv=require('to-csv');var ejs=require(_0xf3ca('0xa'));var fs=require('fs');var fs_extra=require(_0xf3ca('0xb'));var _=require(_0xf3ca('0xc'));var squel=require(_0xf3ca('0xd'));var crypto=require(_0xf3ca('0xe'));var jsforce=require(_0xf3ca('0xf'));var deskjs=require(_0xf3ca('0x10'));var toCsv=require(_0xf3ca('0x11'));var querystring=require(_0xf3ca('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf3ca('0x13'));var qs=require(_0xf3ca('0x14'));var as=require(_0xf3ca('0x15'));var hardwareService=require(_0xf3ca('0x16'));var logger=require(_0xf3ca('0x17'))(_0xf3ca('0x18'));var utils=require(_0xf3ca('0x19'));var config=require(_0xf3ca('0x1a'));var licenseUtil=require(_0xf3ca('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x53644e,_0x2abea6){_0x2abea6=_0x2abea6||0xcc;return function(_0x37e26c){if(_0x37e26c){return _0x53644e[_0xf3ca('0x1c')](_0x2abea6);}return _0x53644e[_0xf3ca('0x1d')](_0x2abea6)[_0xf3ca('0x1e')]();};}function respondWithResult(_0x3b8d6f,_0x31da87){_0x31da87=_0x31da87||0xc8;return function(_0x2162bc){if(_0x2162bc){return _0x3b8d6f[_0xf3ca('0x1d')](_0x31da87)['json'](_0x2162bc);}};}function respondWithFilteredResult(_0xad5807,_0x5ce924){return function(_0x57b1a2){if(_0x57b1a2){var _0x53c0f2=typeof _0x5ce924[_0xf3ca('0x1f')]==='undefined'&&typeof _0x5ce924[_0xf3ca('0x20')]===_0xf3ca('0x21');var _0x496168=_0x57b1a2['count'];var _0x532a5f=_0x53c0f2?0x0:_0x5ce924[_0xf3ca('0x1f')];var _0x2bc107=_0x53c0f2?_0x57b1a2[_0xf3ca('0x22')]:_0x5ce924[_0xf3ca('0x1f')]+_0x5ce924[_0xf3ca('0x20')];var _0x326e8c;if(_0x2bc107>=_0x496168){_0x2bc107=_0x496168;_0x326e8c=0xc8;}else{_0x326e8c=0xce;}_0xad5807[_0xf3ca('0x1d')](_0x326e8c);return _0xad5807[_0xf3ca('0x23')](_0xf3ca('0x24'),_0x532a5f+'-'+_0x2bc107+'/'+_0x496168)[_0xf3ca('0x25')](_0x57b1a2);}return null;};}function patchUpdates(_0x49b9a5){return function(_0x240a8a){try{jsonpatch[_0xf3ca('0x26')](_0x240a8a,_0x49b9a5,!![]);}catch(_0x4c147f){return BPromise[_0xf3ca('0x27')](_0x4c147f);}return _0x240a8a[_0xf3ca('0x28')]();};}function saveUpdates(_0x25cb1a,_0x3be8f4){return function(_0x3ff595){if(_0x3ff595){return _0x3ff595[_0xf3ca('0x29')](_0x25cb1a)['then'](function(_0x248b0b){return _0x248b0b;});}return null;};}function removeEntity(_0x55f198,_0x2fd058){return function(_0x522770){if(_0x522770){return _0x522770['destroy']()[_0xf3ca('0x2a')](function(){var _0x58cec4=_0x522770[_0xf3ca('0x2b')]({'plain':!![]});var _0x469b77='Companies';return db[_0xf3ca('0x2c')]['destroy']({'where':{'type':_0x469b77,'resourceId':_0x58cec4['id']}})['then'](function(){return _0x522770;});})[_0xf3ca('0x2a')](function(){_0x55f198['status'](0xcc)[_0xf3ca('0x1e')]();});}};}function handleEntityNotFound(_0x95513b,_0x4aec6c){return function(_0x2bc7d3){if(!_0x2bc7d3){_0x95513b[_0xf3ca('0x1c')](0x194);}return _0x2bc7d3;};}function handleError(_0x4d646b,_0x1704b9){_0x1704b9=_0x1704b9||0x1f4;return function(_0x519864){logger[_0xf3ca('0x2d')](_0x519864[_0xf3ca('0x2e')]);if(_0x519864[_0xf3ca('0x2f')]){delete _0x519864[_0xf3ca('0x2f')];}_0x4d646b[_0xf3ca('0x1d')](_0x1704b9)['send'](_0x519864);};}exports['index']=function(_0x28faa3,_0x1261a5){var _0xcf95aa={},_0x2644cb={},_0xe1ddc3={'count':0x0,'rows':[]};return db[_0xf3ca('0x30')][_0xf3ca('0x31')]()[_0xf3ca('0x2a')](function(_0x4cfdd8){_0x2644cb[_0xf3ca('0x32')]=_['keys'](_0x4cfdd8);_0x2644cb['query']=_[_0xf3ca('0x33')](_0x28faa3[_0xf3ca('0x34')]);_0x2644cb[_0xf3ca('0x35')]=_[_0xf3ca('0x36')](_0x2644cb['model'],_0x2644cb[_0xf3ca('0x34')]);_0xcf95aa[_0xf3ca('0x37')]=_[_0xf3ca('0x36')](_0x2644cb[_0xf3ca('0x32')],qs['fields'](_0x28faa3[_0xf3ca('0x34')][_0xf3ca('0x38')]));_0xcf95aa[_0xf3ca('0x37')]=_0xcf95aa[_0xf3ca('0x37')][_0xf3ca('0x39')]?_0xcf95aa[_0xf3ca('0x37')]:_0x2644cb['model'];if(!_0x28faa3[_0xf3ca('0x34')]['hasOwnProperty'](_0xf3ca('0x3a'))){_0xcf95aa['limit']=qs[_0xf3ca('0x20')](_0x28faa3[_0xf3ca('0x34')][_0xf3ca('0x20')]);_0xcf95aa[_0xf3ca('0x1f')]=qs[_0xf3ca('0x1f')](_0x28faa3[_0xf3ca('0x34')][_0xf3ca('0x1f')]);}_0xcf95aa[_0xf3ca('0x3b')]=qs['sort'](_0x28faa3['query'][_0xf3ca('0x3c')]);_0xcf95aa[_0xf3ca('0x3d')]=qs[_0xf3ca('0x35')](_[_0xf3ca('0x3e')](_0x28faa3['query'],_0x2644cb[_0xf3ca('0x35')]),_0x4cfdd8);if(_0x28faa3['query']['filter']){_0xcf95aa[_0xf3ca('0x3d')]=_[_0xf3ca('0x3f')](_0xcf95aa['where'],{'$or':_[_0xf3ca('0x40')](_0xcf95aa[_0xf3ca('0x37')],function(_0x10bd0b){var _0x55f924={};_0x55f924[_0x10bd0b]={'$like':'%'+_0x28faa3[_0xf3ca('0x34')]['filter']+'%'};return _0x55f924;})});}_0xcf95aa=_['merge']({},_0xcf95aa,_0x28faa3[_0xf3ca('0x41')]);var _0x2d22f4={'where':_0xcf95aa[_0xf3ca('0x3d')]};return db[_0xf3ca('0x30')][_0xf3ca('0x22')](_0x2d22f4)[_0xf3ca('0x2a')](function(_0x474250){_0xe1ddc3[_0xf3ca('0x22')]=_0x474250;if(_0x28faa3[_0xf3ca('0x34')]['includeAll']){_0xcf95aa[_0xf3ca('0x42')]=[{'all':!![]}];}return db[_0xf3ca('0x30')][_0xf3ca('0x43')](_0xcf95aa);})[_0xf3ca('0x2a')](function(_0x512a14){_0xe1ddc3[_0xf3ca('0x44')]=_0x512a14;return _0xe1ddc3;})[_0xf3ca('0x2a')](respondWithFilteredResult(_0x1261a5,_0xcf95aa))[_0xf3ca('0x45')](handleError(_0x1261a5,null));})[_0xf3ca('0x45')](handleError(_0x1261a5,null));};exports[_0xf3ca('0x46')]=function(_0x362a96,_0x592711){var _0x5af422={'raw':![],'where':{'id':_0x362a96['params']['id']}},_0x5ebf64={};_0x5ebf64[_0xf3ca('0x32')]=_['keys'](db[_0xf3ca('0x30')]['rawAttributes']);_0x5ebf64[_0xf3ca('0x34')]=_[_0xf3ca('0x33')](_0x362a96[_0xf3ca('0x34')]);_0x5ebf64[_0xf3ca('0x35')]=_[_0xf3ca('0x36')](_0x5ebf64[_0xf3ca('0x32')],_0x5ebf64[_0xf3ca('0x34')]);_0x5af422[_0xf3ca('0x37')]=_[_0xf3ca('0x36')](_0x5ebf64['model'],qs[_0xf3ca('0x38')](_0x362a96['query'][_0xf3ca('0x38')]));_0x5af422['attributes']=_0x5af422[_0xf3ca('0x37')][_0xf3ca('0x39')]?_0x5af422[_0xf3ca('0x37')]:_0x5ebf64['model'];if(_0x362a96['query'][_0xf3ca('0x47')]){_0x5af422['include']=[{'all':!![]}];}_0x5af422=_[_0xf3ca('0x3f')]({},_0x5af422,_0x362a96[_0xf3ca('0x41')]);return db[_0xf3ca('0x30')][_0xf3ca('0x48')](_0x5af422)[_0xf3ca('0x2a')](handleEntityNotFound(_0x592711,null))['then'](respondWithResult(_0x592711,null))['catch'](handleError(_0x592711,null));};exports[_0xf3ca('0x49')]=function(_0x5bf9bb,_0x1da9e7){return db['CmCompany'][_0xf3ca('0x49')](_0x5bf9bb[_0xf3ca('0x4a')],{})['then'](function(_0x3b6c83){var _0x3b639a=_0x5bf9bb[_0xf3ca('0x4b')]['get']({'plain':!![]});if(!_0x3b639a)throw new Error(_0xf3ca('0x4c'));if(_0x3b639a['role']===_0xf3ca('0x4b')){var _0x2031df=_0x3b6c83[_0xf3ca('0x2b')]({'plain':!![]});var _0x12d0ea=_0xf3ca('0x4d');return db[_0xf3ca('0x4e')][_0xf3ca('0x48')]({'where':{'name':_0x12d0ea,'userProfileId':_0x3b639a[_0xf3ca('0x4f')]},'raw':!![]})[_0xf3ca('0x2a')](function(_0x2db48b){if(_0x2db48b&&_0x2db48b[_0xf3ca('0x50')]===0x0){return db[_0xf3ca('0x2c')][_0xf3ca('0x49')]({'name':_0x2031df[_0xf3ca('0x2f')],'resourceId':_0x2031df['id'],'type':_0x2db48b[_0xf3ca('0x2f')],'sectionId':_0x2db48b['id']},{})[_0xf3ca('0x2a')](function(){return _0x3b6c83;});}else{return _0x3b6c83;}})['catch'](function(_0x43ad11){logger[_0xf3ca('0x2d')](_0xf3ca('0x51'),_0x43ad11);throw _0x43ad11;});}return _0x3b6c83;})[_0xf3ca('0x2a')](respondWithResult(_0x1da9e7,0xc9))[_0xf3ca('0x45')](handleError(_0x1da9e7,null));};exports[_0xf3ca('0x29')]=function(_0x498f4f,_0x4a7746){if(_0x498f4f[_0xf3ca('0x4a')]['id']){delete _0x498f4f[_0xf3ca('0x4a')]['id'];}return db[_0xf3ca('0x30')]['find']({'where':{'id':_0x498f4f[_0xf3ca('0x52')]['id']}})['then'](handleEntityNotFound(_0x4a7746,null))[_0xf3ca('0x2a')](saveUpdates(_0x498f4f[_0xf3ca('0x4a')],null))['then'](respondWithResult(_0x4a7746,null))['catch'](handleError(_0x4a7746,null));};exports['destroy']=function(_0x3f90cc,_0x5bf466){return db[_0xf3ca('0x30')]['find']({'where':{'id':_0x3f90cc['params']['id']}})['then'](handleEntityNotFound(_0x5bf466,null))[_0xf3ca('0x2a')](removeEntity(_0x5bf466,null))['catch'](handleError(_0x5bf466,null));};exports['describe']=function(_0x2b58b8,_0x3c0349){return db[_0xf3ca('0x30')][_0xf3ca('0x31')]()[_0xf3ca('0x2a')](respondWithResult(_0x3c0349,null))['catch'](handleError(_0x3c0349,null));};exports[_0xf3ca('0x53')]=function(_0x580282,_0x5000c8,_0x5c0e27){return db[_0xf3ca('0x54')][_0xf3ca('0x48')]({'where':{'id':_0x580282[_0xf3ca('0x52')]['id']}})[_0xf3ca('0x2a')](handleEntityNotFound(_0x5000c8,null))['then'](function(_0x364459){if(_0x364459){return _0x364459[_0xf3ca('0x53')](_0x580282[_0xf3ca('0x4a')][_0xf3ca('0x55')],_[_0xf3ca('0x56')](_0x580282[_0xf3ca('0x4a')],[_0xf3ca('0x55'),'id'])||{});}})[_0xf3ca('0x2a')](respondWithResult(_0x5000c8,null))[_0xf3ca('0x45')](handleError(_0x5000c8,null));};exports[_0xf3ca('0x57')]=function(_0x2ca0f0,_0x3a063b,_0x18b9b6){var _0x2468ff={};var _0x11e47f={};var _0x1f1d21;var _0x496490;return db[_0xf3ca('0x30')][_0xf3ca('0x58')]({'where':{'id':_0x2ca0f0[_0xf3ca('0x52')]['id']}})[_0xf3ca('0x2a')](handleEntityNotFound(_0x3a063b,null))['then'](function(_0xe90c40){if(_0xe90c40){_0x1f1d21=_0xe90c40;_0x11e47f[_0xf3ca('0x32')]=_[_0xf3ca('0x33')](db[_0xf3ca('0x54')]['rawAttributes']);_0x11e47f[_0xf3ca('0x34')]=_['keys'](_0x2ca0f0[_0xf3ca('0x34')]);_0x11e47f[_0xf3ca('0x35')]=_['intersection'](_0x11e47f[_0xf3ca('0x32')],_0x11e47f['query']);_0x2468ff['attributes']=_[_0xf3ca('0x36')](_0x11e47f['model'],qs['fields'](_0x2ca0f0['query']['fields']));_0x2468ff[_0xf3ca('0x37')]=_0x2468ff[_0xf3ca('0x37')][_0xf3ca('0x39')]?_0x2468ff[_0xf3ca('0x37')]:_0x11e47f['model'];_0x2468ff[_0xf3ca('0x3b')]=qs['sort'](_0x2ca0f0[_0xf3ca('0x34')][_0xf3ca('0x3c')]);_0x2468ff[_0xf3ca('0x3d')]=qs[_0xf3ca('0x35')](_[_0xf3ca('0x3e')](_0x2ca0f0[_0xf3ca('0x34')],_0x11e47f['filters']));if(_0x2ca0f0[_0xf3ca('0x34')][_0xf3ca('0x59')]){_0x2468ff['where']=_[_0xf3ca('0x3f')](_0x2468ff[_0xf3ca('0x3d')],{'$or':_[_0xf3ca('0x40')](_0x2468ff[_0xf3ca('0x37')],function(_0xa98be5){var _0x19fe20={};_0x19fe20[_0xa98be5]={'$like':'%'+_0x2ca0f0[_0xf3ca('0x34')][_0xf3ca('0x59')]+'%'};return _0x19fe20;})});}_0x2468ff=_[_0xf3ca('0x3f')]({},_0x2468ff,_0x2ca0f0[_0xf3ca('0x41')]);return _0x1f1d21['getContacts'](_0x2468ff);}})[_0xf3ca('0x2a')](function(_0x85eac7){if(_0x85eac7){_0x496490=_0x85eac7[_0xf3ca('0x39')];if(!_0x2ca0f0[_0xf3ca('0x34')][_0xf3ca('0x5a')]('nolimit')){_0x2468ff[_0xf3ca('0x20')]=qs[_0xf3ca('0x20')](_0x2ca0f0['query'][_0xf3ca('0x20')]);_0x2468ff[_0xf3ca('0x1f')]=qs[_0xf3ca('0x1f')](_0x2ca0f0[_0xf3ca('0x34')][_0xf3ca('0x1f')]);}return _0x1f1d21[_0xf3ca('0x57')](_0x2468ff);}})[_0xf3ca('0x2a')](function(_0x49e4f1){if(_0x49e4f1){return _0x49e4f1?{'count':_0x496490,'rows':_0x49e4f1}:null;}})['then'](respondWithResult(_0x3a063b,null))[_0xf3ca('0x45')](handleError(_0x3a063b,null));}; \ No newline at end of file +var _0x88bb=['limit','sort','pick','where','merge','map','options','includeAll','findAll','catch','show','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','CmContact','addContacts','ids','getContacts','findOne','length','order','filter','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','set','apply','reject','save','update','then','destroy','get','Companies','error','stack','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','nolimit'];(function(_0x55d3f8,_0x5f133c){var _0x2b9959=function(_0x17966e){while(--_0x17966e){_0x55d3f8['push'](_0x55d3f8['shift']());}};_0x2b9959(++_0x5f133c);}(_0x88bb,0x180));var _0xb88b=function(_0x4e9505,_0x154052){_0x4e9505=_0x4e9505-0x0;var _0x5de35c=_0x88bb[_0x4e9505];return _0x5de35c;};'use strict';var emlformat=require(_0xb88b('0x0'));var rimraf=require(_0xb88b('0x1'));var zipdir=require(_0xb88b('0x2'));var jsonpatch=require(_0xb88b('0x3'));var rp=require(_0xb88b('0x4'));var moment=require('moment');var BPromise=require(_0xb88b('0x5'));var Mustache=require(_0xb88b('0x6'));var util=require(_0xb88b('0x7'));var path=require('path');var sox=require(_0xb88b('0x8'));var csv=require(_0xb88b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb88b('0xa'));var _=require(_0xb88b('0xb'));var squel=require(_0xb88b('0xc'));var crypto=require(_0xb88b('0xd'));var jsforce=require(_0xb88b('0xe'));var deskjs=require(_0xb88b('0xf'));var toCsv=require(_0xb88b('0x9'));var querystring=require('querystring');var Papa=require(_0xb88b('0x10'));var Redis=require(_0xb88b('0x11'));var authService=require(_0xb88b('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb88b('0x13'))(_0xb88b('0x14'));var utils=require(_0xb88b('0x15'));var config=require(_0xb88b('0x16'));var licenseUtil=require(_0xb88b('0x17'));var db=require(_0xb88b('0x18'))['db'];function respondWithStatusCode(_0x3f0eb3,_0x589e38){_0x589e38=_0x589e38||0xcc;return function(_0x5636ec){if(_0x5636ec){return _0x3f0eb3[_0xb88b('0x19')](_0x589e38);}return _0x3f0eb3['status'](_0x589e38)[_0xb88b('0x1a')]();};}function respondWithResult(_0x5dccaa,_0x1c83ed){_0x1c83ed=_0x1c83ed||0xc8;return function(_0x352b3f){if(_0x352b3f){return _0x5dccaa[_0xb88b('0x1b')](_0x1c83ed)[_0xb88b('0x1c')](_0x352b3f);}};}function respondWithFilteredResult(_0x136d93,_0x10e1a1){return function(_0x369669){if(_0x369669){var _0x43c850=typeof _0x10e1a1[_0xb88b('0x1d')]===_0xb88b('0x1e')&&typeof _0x10e1a1['limit']===_0xb88b('0x1e');var _0x15da99=_0x369669[_0xb88b('0x1f')];var _0x1691b5=_0x43c850?0x0:_0x10e1a1[_0xb88b('0x1d')];var _0x5e7111=_0x43c850?_0x369669[_0xb88b('0x1f')]:_0x10e1a1['offset']+_0x10e1a1['limit'];var _0x1d2ed9;if(_0x5e7111>=_0x15da99){_0x5e7111=_0x15da99;_0x1d2ed9=0xc8;}else{_0x1d2ed9=0xce;}_0x136d93['status'](_0x1d2ed9);return _0x136d93[_0xb88b('0x20')]('Content-Range',_0x1691b5+'-'+_0x5e7111+'/'+_0x15da99)['json'](_0x369669);}return null;};}function patchUpdates(_0x3c8c24){return function(_0x202e61){try{jsonpatch[_0xb88b('0x21')](_0x202e61,_0x3c8c24,!![]);}catch(_0x1e63e0){return BPromise[_0xb88b('0x22')](_0x1e63e0);}return _0x202e61[_0xb88b('0x23')]();};}function saveUpdates(_0x200e33,_0x2cbc6d){return function(_0x6df438){if(_0x6df438){return _0x6df438[_0xb88b('0x24')](_0x200e33)[_0xb88b('0x25')](function(_0x48a588){return _0x48a588;});}return null;};}function removeEntity(_0x3848e7,_0x1476fa){return function(_0x35aa9d){if(_0x35aa9d){return _0x35aa9d[_0xb88b('0x26')]()[_0xb88b('0x25')](function(){var _0x4f8b6a=_0x35aa9d[_0xb88b('0x27')]({'plain':!![]});var _0x11019b=_0xb88b('0x28');return db['UserProfileResource'][_0xb88b('0x26')]({'where':{'type':_0x11019b,'resourceId':_0x4f8b6a['id']}})[_0xb88b('0x25')](function(){return _0x35aa9d;});})[_0xb88b('0x25')](function(){_0x3848e7[_0xb88b('0x1b')](0xcc)[_0xb88b('0x1a')]();});}};}function handleEntityNotFound(_0x3d1a66,_0x452b5a){return function(_0x17691c){if(!_0x17691c){_0x3d1a66[_0xb88b('0x19')](0x194);}return _0x17691c;};}function handleError(_0xd1d415,_0x36b7f1){_0x36b7f1=_0x36b7f1||0x1f4;return function(_0x1ab8c1){logger[_0xb88b('0x29')](_0x1ab8c1[_0xb88b('0x2a')]);if(_0x1ab8c1[_0xb88b('0x2b')]){delete _0x1ab8c1[_0xb88b('0x2b')];}_0xd1d415['status'](_0x36b7f1)[_0xb88b('0x2c')](_0x1ab8c1);};}exports[_0xb88b('0x2d')]=function(_0x343e90,_0x4f49e6){var _0x20e2ca={},_0x349ba1={},_0x5a5f06={'count':0x0,'rows':[]};return db[_0xb88b('0x2e')][_0xb88b('0x2f')]()['then'](function(_0x4f4531){_0x349ba1[_0xb88b('0x30')]=_[_0xb88b('0x31')](_0x4f4531);_0x349ba1[_0xb88b('0x32')]=_[_0xb88b('0x31')](_0x343e90[_0xb88b('0x32')]);_0x349ba1[_0xb88b('0x33')]=_[_0xb88b('0x34')](_0x349ba1[_0xb88b('0x30')],_0x349ba1[_0xb88b('0x32')]);_0x20e2ca[_0xb88b('0x35')]=_[_0xb88b('0x34')](_0x349ba1[_0xb88b('0x30')],qs[_0xb88b('0x36')](_0x343e90[_0xb88b('0x32')][_0xb88b('0x36')]));_0x20e2ca[_0xb88b('0x35')]=_0x20e2ca[_0xb88b('0x35')]['length']?_0x20e2ca['attributes']:_0x349ba1[_0xb88b('0x30')];if(!_0x343e90[_0xb88b('0x32')]['hasOwnProperty'](_0xb88b('0x37'))){_0x20e2ca[_0xb88b('0x38')]=qs[_0xb88b('0x38')](_0x343e90['query'][_0xb88b('0x38')]);_0x20e2ca[_0xb88b('0x1d')]=qs[_0xb88b('0x1d')](_0x343e90[_0xb88b('0x32')][_0xb88b('0x1d')]);}_0x20e2ca['order']=qs['sort'](_0x343e90['query'][_0xb88b('0x39')]);_0x20e2ca['where']=qs[_0xb88b('0x33')](_[_0xb88b('0x3a')](_0x343e90[_0xb88b('0x32')],_0x349ba1['filters']),_0x4f4531);if(_0x343e90[_0xb88b('0x32')]['filter']){_0x20e2ca[_0xb88b('0x3b')]=_[_0xb88b('0x3c')](_0x20e2ca[_0xb88b('0x3b')],{'$or':_[_0xb88b('0x3d')](_0x20e2ca[_0xb88b('0x35')],function(_0x231291){var _0x3a7f73={};_0x3a7f73[_0x231291]={'$like':'%'+_0x343e90[_0xb88b('0x32')]['filter']+'%'};return _0x3a7f73;})});}_0x20e2ca=_[_0xb88b('0x3c')]({},_0x20e2ca,_0x343e90[_0xb88b('0x3e')]);var _0x521714={'where':_0x20e2ca['where']};return db[_0xb88b('0x2e')]['count'](_0x521714)[_0xb88b('0x25')](function(_0x3bb12d){_0x5a5f06[_0xb88b('0x1f')]=_0x3bb12d;if(_0x343e90[_0xb88b('0x32')][_0xb88b('0x3f')]){_0x20e2ca['include']=[{'all':!![]}];}return db[_0xb88b('0x2e')][_0xb88b('0x40')](_0x20e2ca);})[_0xb88b('0x25')](function(_0x3802fc){_0x5a5f06['rows']=_0x3802fc;return _0x5a5f06;})['then'](respondWithFilteredResult(_0x4f49e6,_0x20e2ca))[_0xb88b('0x41')](handleError(_0x4f49e6,null));})[_0xb88b('0x41')](handleError(_0x4f49e6,null));};exports[_0xb88b('0x42')]=function(_0x49f3e8,_0x296119){var _0x3c2351={'raw':![],'where':{'id':_0x49f3e8['params']['id']}},_0x59e85b={};_0x59e85b['model']=_[_0xb88b('0x31')](db[_0xb88b('0x2e')][_0xb88b('0x43')]);_0x59e85b[_0xb88b('0x32')]=_[_0xb88b('0x31')](_0x49f3e8[_0xb88b('0x32')]);_0x59e85b[_0xb88b('0x33')]=_[_0xb88b('0x34')](_0x59e85b[_0xb88b('0x30')],_0x59e85b[_0xb88b('0x32')]);_0x3c2351[_0xb88b('0x35')]=_[_0xb88b('0x34')](_0x59e85b[_0xb88b('0x30')],qs[_0xb88b('0x36')](_0x49f3e8[_0xb88b('0x32')]['fields']));_0x3c2351[_0xb88b('0x35')]=_0x3c2351[_0xb88b('0x35')]['length']?_0x3c2351[_0xb88b('0x35')]:_0x59e85b['model'];if(_0x49f3e8[_0xb88b('0x32')][_0xb88b('0x3f')]){_0x3c2351[_0xb88b('0x44')]=[{'all':!![]}];}_0x3c2351=_[_0xb88b('0x3c')]({},_0x3c2351,_0x49f3e8[_0xb88b('0x3e')]);return db[_0xb88b('0x2e')][_0xb88b('0x45')](_0x3c2351)[_0xb88b('0x25')](handleEntityNotFound(_0x296119,null))[_0xb88b('0x25')](respondWithResult(_0x296119,null))['catch'](handleError(_0x296119,null));};exports[_0xb88b('0x46')]=function(_0x133520,_0x17bf64){return db[_0xb88b('0x2e')][_0xb88b('0x46')](_0x133520[_0xb88b('0x47')],{})['then'](function(_0xe41dde){var _0x3aae8e=_0x133520[_0xb88b('0x48')][_0xb88b('0x27')]({'plain':!![]});if(!_0x3aae8e)throw new Error(_0xb88b('0x49'));if(_0x3aae8e[_0xb88b('0x4a')]===_0xb88b('0x48')){var _0x5000a5=_0xe41dde[_0xb88b('0x27')]({'plain':!![]});var _0x504585=_0xb88b('0x28');return db[_0xb88b('0x4b')][_0xb88b('0x45')]({'where':{'name':_0x504585,'userProfileId':_0x3aae8e[_0xb88b('0x4c')]},'raw':!![]})[_0xb88b('0x25')](function(_0x9b9167){if(_0x9b9167&&_0x9b9167[_0xb88b('0x4d')]===0x0){return db['UserProfileResource'][_0xb88b('0x46')]({'name':_0x5000a5[_0xb88b('0x2b')],'resourceId':_0x5000a5['id'],'type':_0x9b9167['name'],'sectionId':_0x9b9167['id']},{})[_0xb88b('0x25')](function(){return _0xe41dde;});}else{return _0xe41dde;}})[_0xb88b('0x41')](function(_0x328a9b){logger['error'](_0xb88b('0x4e'),_0x328a9b);throw _0x328a9b;});}return _0xe41dde;})[_0xb88b('0x25')](respondWithResult(_0x17bf64,0xc9))[_0xb88b('0x41')](handleError(_0x17bf64,null));};exports['update']=function(_0x295395,_0x1209ef){if(_0x295395['body']['id']){delete _0x295395['body']['id'];}return db[_0xb88b('0x2e')][_0xb88b('0x45')]({'where':{'id':_0x295395[_0xb88b('0x4f')]['id']}})[_0xb88b('0x25')](handleEntityNotFound(_0x1209ef,null))[_0xb88b('0x25')](saveUpdates(_0x295395[_0xb88b('0x47')],null))['then'](respondWithResult(_0x1209ef,null))[_0xb88b('0x41')](handleError(_0x1209ef,null));};exports['destroy']=function(_0x3b4f96,_0x3bbe5e){return db[_0xb88b('0x2e')]['find']({'where':{'id':_0x3b4f96['params']['id']}})['then'](handleEntityNotFound(_0x3bbe5e,null))[_0xb88b('0x25')](removeEntity(_0x3bbe5e,null))[_0xb88b('0x41')](handleError(_0x3bbe5e,null));};exports['describe']=function(_0x4cab7e,_0x3d8769){return db[_0xb88b('0x2e')][_0xb88b('0x2f')]()['then'](respondWithResult(_0x3d8769,null))[_0xb88b('0x41')](handleError(_0x3d8769,null));};exports['addContacts']=function(_0x2189c5,_0x532b31,_0x288162){return db[_0xb88b('0x50')][_0xb88b('0x45')]({'where':{'id':_0x2189c5[_0xb88b('0x4f')]['id']}})['then'](handleEntityNotFound(_0x532b31,null))[_0xb88b('0x25')](function(_0x20c75d){if(_0x20c75d){return _0x20c75d[_0xb88b('0x51')](_0x2189c5[_0xb88b('0x47')][_0xb88b('0x52')],_['omit'](_0x2189c5[_0xb88b('0x47')],[_0xb88b('0x52'),'id'])||{});}})[_0xb88b('0x25')](respondWithResult(_0x532b31,null))[_0xb88b('0x41')](handleError(_0x532b31,null));};exports[_0xb88b('0x53')]=function(_0x583a49,_0x387981,_0x15d88f){var _0xda22a2={};var _0x85e27d={};var _0x4cd8cb;var _0x29425d;return db[_0xb88b('0x2e')][_0xb88b('0x54')]({'where':{'id':_0x583a49['params']['id']}})[_0xb88b('0x25')](handleEntityNotFound(_0x387981,null))[_0xb88b('0x25')](function(_0xf225c5){if(_0xf225c5){_0x4cd8cb=_0xf225c5;_0x85e27d[_0xb88b('0x30')]=_['keys'](db[_0xb88b('0x50')][_0xb88b('0x43')]);_0x85e27d['query']=_[_0xb88b('0x31')](_0x583a49[_0xb88b('0x32')]);_0x85e27d[_0xb88b('0x33')]=_[_0xb88b('0x34')](_0x85e27d[_0xb88b('0x30')],_0x85e27d[_0xb88b('0x32')]);_0xda22a2[_0xb88b('0x35')]=_[_0xb88b('0x34')](_0x85e27d[_0xb88b('0x30')],qs[_0xb88b('0x36')](_0x583a49[_0xb88b('0x32')]['fields']));_0xda22a2[_0xb88b('0x35')]=_0xda22a2[_0xb88b('0x35')][_0xb88b('0x55')]?_0xda22a2['attributes']:_0x85e27d[_0xb88b('0x30')];_0xda22a2[_0xb88b('0x56')]=qs[_0xb88b('0x39')](_0x583a49[_0xb88b('0x32')][_0xb88b('0x39')]);_0xda22a2[_0xb88b('0x3b')]=qs['filters'](_['pick'](_0x583a49[_0xb88b('0x32')],_0x85e27d[_0xb88b('0x33')]));if(_0x583a49[_0xb88b('0x32')]['filter']){_0xda22a2[_0xb88b('0x3b')]=_[_0xb88b('0x3c')](_0xda22a2[_0xb88b('0x3b')],{'$or':_[_0xb88b('0x3d')](_0xda22a2[_0xb88b('0x35')],function(_0x277c91){var _0x9fa636={};_0x9fa636[_0x277c91]={'$like':'%'+_0x583a49[_0xb88b('0x32')][_0xb88b('0x57')]+'%'};return _0x9fa636;})});}_0xda22a2=_[_0xb88b('0x3c')]({},_0xda22a2,_0x583a49[_0xb88b('0x3e')]);return _0x4cd8cb[_0xb88b('0x53')](_0xda22a2);}})[_0xb88b('0x25')](function(_0x140e55){if(_0x140e55){_0x29425d=_0x140e55['length'];if(!_0x583a49[_0xb88b('0x32')]['hasOwnProperty'](_0xb88b('0x37'))){_0xda22a2[_0xb88b('0x38')]=qs[_0xb88b('0x38')](_0x583a49[_0xb88b('0x32')][_0xb88b('0x38')]);_0xda22a2['offset']=qs[_0xb88b('0x1d')](_0x583a49['query'][_0xb88b('0x1d')]);}return _0x4cd8cb[_0xb88b('0x53')](_0xda22a2);}})[_0xb88b('0x25')](function(_0x4ee185){if(_0x4ee185){return _0x4ee185?{'count':_0x29425d,'rows':_0x4ee185}:null;}})[_0xb88b('0x25')](respondWithResult(_0x387981,null))[_0xb88b('0x41')](handleError(_0x387981,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 925c9b5..dd7813a 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 _0x76b5=['request-promise','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','lodash','util','moment','bluebird'];(function(_0x35717b,_0xa147fc){var _0x255612=function(_0x1b1f80){while(--_0x1b1f80){_0x35717b['push'](_0x35717b['shift']());}};_0x255612(++_0xa147fc);}(_0x76b5,0xd8));var _0x576b=function(_0x187718,_0x427383){_0x187718=_0x187718-0x0;var _0x29ddf4=_0x76b5[_0x187718];return _0x29ddf4;};'use strict';var _=require(_0x576b('0x0'));var util=require(_0x576b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x576b('0x2'));var BPromise=require(_0x576b('0x3'));var rp=require(_0x576b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x576b('0x5'));var config=require(_0x576b('0x6'));var attributes=require(_0x576b('0x7'));module[_0x576b('0x8')]=function(_0x4c2432,_0xf559bf){return _0x4c2432[_0x576b('0x9')](_0x576b('0xa'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8f22=['path','rimraf','../../config/environment','./cmCompany.attributes','define','cm_companies','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xd578cb,_0x2167a3){var _0x775533=function(_0x1c340d){while(--_0x1c340d){_0xd578cb['push'](_0xd578cb['shift']());}};_0x775533(++_0x2167a3);}(_0x8f22,0x16e));var _0x28f2=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x8f22[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x28f2('0x0'));var util=require(_0x28f2('0x1'));var logger=require(_0x28f2('0x2'))(_0x28f2('0x3'));var moment=require(_0x28f2('0x4'));var BPromise=require(_0x28f2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x28f2('0x6'));var rimraf=require(_0x28f2('0x7'));var config=require(_0x28f2('0x8'));var attributes=require(_0x28f2('0x9'));module['exports']=function(_0x30583e,_0x386cda){return _0x30583e[_0x28f2('0xa')]('CmCompany',attributes,{'tableName':_0x28f2('0xb'),'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 2e45d3c..af49623 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 _0x1c7a=['result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','CmCompany,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x6243bb,_0x269bd7){var _0x16ef17=function(_0x5771f1){while(--_0x5771f1){_0x6243bb['push'](_0x6243bb['shift']());}};_0x16ef17(++_0x269bd7);}(_0x1c7a,0xf9));var _0xa1c7=function(_0x398c32,_0x551d78){_0x398c32=_0x398c32-0x0;var _0x5c20ea=_0x1c7a[_0x398c32];return _0x5c20ea;};'use strict';var _=require(_0xa1c7('0x0'));var util=require(_0xa1c7('0x1'));var moment=require('moment');var BPromise=require(_0xa1c7('0x2'));var rs=require(_0xa1c7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa1c7('0x4'))['db'];var utils=require(_0xa1c7('0x5'));var logger=require('../../config/logger')(_0xa1c7('0x6'));var config=require(_0xa1c7('0x7'));var jayson=require(_0xa1c7('0x8'));var client=jayson[_0xa1c7('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5f4e7f,_0xae4dec,_0x545200){return new BPromise(function(_0x4c276e,_0x383ec2){return client[_0xa1c7('0xa')](_0x5f4e7f,_0x545200)['then'](function(_0x224b0e){logger['info'](_0xa1c7('0xb'),_0xae4dec,_0xa1c7('0xc'));logger['debug']('CmCompany,\x20%s,\x20%s,\x20%s',_0xae4dec,_0xa1c7('0xc'),JSON[_0xa1c7('0xd')](_0x224b0e));if(_0x224b0e[_0xa1c7('0xe')]){if(_0x224b0e['error'][_0xa1c7('0xf')]===0x1f4){logger['error']('CmCompany,\x20%s,\x20%s',_0xae4dec,_0x224b0e[_0xa1c7('0xe')][_0xa1c7('0x10')]);return _0x383ec2(_0x224b0e[_0xa1c7('0xe')][_0xa1c7('0x10')]);}logger[_0xa1c7('0xe')](_0xa1c7('0xb'),_0xae4dec,_0x224b0e['error'][_0xa1c7('0x10')]);return _0x4c276e(_0x224b0e[_0xa1c7('0xe')][_0xa1c7('0x10')]);}else{logger['info'](_0xa1c7('0xb'),_0xae4dec,_0xa1c7('0xc'));_0x4c276e(_0x224b0e[_0xa1c7('0x11')][_0xa1c7('0x10')]);}})[_0xa1c7('0x12')](function(_0x4333c9){logger[_0xa1c7('0xe')](_0xa1c7('0xb'),_0xae4dec,_0x4333c9);_0x383ec2(_0x4333c9);});});} \ No newline at end of file +var _0xe3f9=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','error','message','result','lodash','util','moment','bluebird'];(function(_0x2ba4f2,_0x52677d){var _0x12bd11=function(_0x5828bb){while(--_0x5828bb){_0x2ba4f2['push'](_0x2ba4f2['shift']());}};_0x12bd11(++_0x52677d);}(_0xe3f9,0x74));var _0x9e3f=function(_0x2bc326,_0x473cf8){_0x2bc326=_0x2bc326-0x0;var _0x43722e=_0xe3f9[_0x2bc326];return _0x43722e;};'use strict';var _=require(_0x9e3f('0x0'));var util=require(_0x9e3f('0x1'));var moment=require(_0x9e3f('0x2'));var BPromise=require(_0x9e3f('0x3'));var rs=require(_0x9e3f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9e3f('0x5'))['db'];var utils=require(_0x9e3f('0x6'));var logger=require(_0x9e3f('0x7'))(_0x9e3f('0x8'));var config=require(_0x9e3f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9e3f('0xa')][_0x9e3f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x51b1e8,_0x2844b4,_0x27599d){return new BPromise(function(_0x466444,_0x2a4be4){return client[_0x9e3f('0xc')](_0x51b1e8,_0x27599d)[_0x9e3f('0xd')](function(_0xcdeacb){logger[_0x9e3f('0xe')](_0x9e3f('0xf'),_0x2844b4,'request\x20sent');logger['debug']('CmCompany,\x20%s,\x20%s,\x20%s',_0x2844b4,_0x9e3f('0x10'),JSON['stringify'](_0xcdeacb));if(_0xcdeacb['error']){if(_0xcdeacb['error']['code']===0x1f4){logger['error'](_0x9e3f('0xf'),_0x2844b4,_0xcdeacb[_0x9e3f('0x11')][_0x9e3f('0x12')]);return _0x2a4be4(_0xcdeacb[_0x9e3f('0x11')][_0x9e3f('0x12')]);}logger[_0x9e3f('0x11')](_0x9e3f('0xf'),_0x2844b4,_0xcdeacb[_0x9e3f('0x11')][_0x9e3f('0x12')]);return _0x466444(_0xcdeacb[_0x9e3f('0x11')][_0x9e3f('0x12')]);}else{logger['info'](_0x9e3f('0xf'),_0x2844b4,'request\x20sent');_0x466444(_0xcdeacb[_0x9e3f('0x13')]['message']);}})['catch'](function(_0x23386d){logger[_0x9e3f('0x11')](_0x9e3f('0xf'),_0x2844b4,_0x23386d);_0x2a4be4(_0x23386d);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 9744f2b..629cf2e 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 _0xf5ac=['fs-extra','../../components/auth/service','../../components/interaction/service','./cmCompany.controller','get','isAuthenticated','/describe','describe','/:id','/:id/contacts','getContacts','post','create','addContacts','update','delete','destroy','exports','multer','connect-timeout','Router'];(function(_0xaa8595,_0xcfe9ac){var _0x303a38=function(_0x4050b8){while(--_0x4050b8){_0xaa8595['push'](_0xaa8595['shift']());}};_0x303a38(++_0xcfe9ac);}(_0xf5ac,0x162));var _0xcf5a=function(_0x4def7d,_0x40313a){_0x4def7d=_0x4def7d-0x0;var _0x39b774=_0xf5ac[_0x4def7d];return _0x39b774;};'use strict';var multer=require(_0xcf5a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xcf5a('0x1'));var express=require('express');var router=express[_0xcf5a('0x2')]();var fs_extra=require(_0xcf5a('0x3'));var auth=require(_0xcf5a('0x4'));var interaction=require(_0xcf5a('0x5'));var config=require('../../config/environment');var controller=require(_0xcf5a('0x6'));router[_0xcf5a('0x7')]('/',auth[_0xcf5a('0x8')](),controller['index']);router[_0xcf5a('0x7')](_0xcf5a('0x9'),auth[_0xcf5a('0x8')](),controller[_0xcf5a('0xa')]);router[_0xcf5a('0x7')](_0xcf5a('0xb'),auth[_0xcf5a('0x8')](),controller['show']);router[_0xcf5a('0x7')](_0xcf5a('0xc'),auth[_0xcf5a('0x8')](),controller[_0xcf5a('0xd')]);router[_0xcf5a('0xe')]('/',auth[_0xcf5a('0x8')](),controller[_0xcf5a('0xf')]);router[_0xcf5a('0xe')](_0xcf5a('0xc'),auth[_0xcf5a('0x8')](),controller[_0xcf5a('0x10')]);router['put']('/:id',auth[_0xcf5a('0x8')](),controller[_0xcf5a('0x11')]);router[_0xcf5a('0x12')](_0xcf5a('0xb'),auth[_0xcf5a('0x8')](),controller[_0xcf5a('0x13')]);module[_0xcf5a('0x14')]=router; \ No newline at end of file +var _0x929e=['/describe','isAuthenticated','describe','show','/:id/contacts','getContacts','post','create','addContacts','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','index'];(function(_0x300269,_0x3a27e9){var _0x51088c=function(_0x23a539){while(--_0x23a539){_0x300269['push'](_0x300269['shift']());}};_0x51088c(++_0x3a27e9);}(_0x929e,0xe5));var _0xe929=function(_0x5bdebb,_0x38e9d0){_0x5bdebb=_0x5bdebb-0x0;var _0x120e7f=_0x929e[_0x5bdebb];return _0x120e7f;};'use strict';var multer=require(_0xe929('0x0'));var util=require('util');var path=require(_0xe929('0x1'));var timeout=require(_0xe929('0x2'));var express=require(_0xe929('0x3'));var router=express[_0xe929('0x4')]();var fs_extra=require(_0xe929('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe929('0x6'));var config=require(_0xe929('0x7'));var controller=require(_0xe929('0x8'));router[_0xe929('0x9')]('/',auth['isAuthenticated'](),controller[_0xe929('0xa')]);router[_0xe929('0x9')](_0xe929('0xb'),auth[_0xe929('0xc')](),controller[_0xe929('0xd')]);router[_0xe929('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe929('0xe')]);router['get'](_0xe929('0xf'),auth['isAuthenticated'](),controller[_0xe929('0x10')]);router[_0xe929('0x11')]('/',auth['isAuthenticated'](),controller[_0xe929('0x12')]);router[_0xe929('0x11')]('/:id/contacts',auth['isAuthenticated'](),controller[_0xe929('0x13')]);router[_0xe929('0x14')]('/:id',auth[_0xe929('0xc')](),controller[_0xe929('0x15')]);router[_0xe929('0x16')]('/:id',auth[_0xe929('0xc')](),controller[_0xe929('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 57b8c9d..6c7894b 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 _0x0b0e=['exports','STRING','TEXT','INTEGER','DATE','NOW','lodash'];(function(_0x56ea75,_0x2f0c76){var _0x2b6685=function(_0x346b7e){while(--_0x346b7e){_0x56ea75['push'](_0x56ea75['shift']());}};_0x2b6685(++_0x2f0c76);}(_0x0b0e,0x187));var _0xe0b0=function(_0x1c7f48,_0x255687){_0x1c7f48=_0x1c7f48-0x0;var _0x274c31=_0x0b0e[_0x1c7f48];return _0x274c31;};'use strict';var _=require(_0xe0b0('0x0'));var Sequelize=require('sequelize');module[_0xe0b0('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xe0b0('0x2')]},'street':{'type':Sequelize[_0xe0b0('0x2')]},'postalCode':{'type':Sequelize[_0xe0b0('0x2')]},'city':{'type':Sequelize[_0xe0b0('0x2')]},'country':{'type':Sequelize[_0xe0b0('0x2')]},'dateOfBirth':{'type':Sequelize[_0xe0b0('0x2')]},'description':{'type':Sequelize[_0xe0b0('0x3')]},'phone':{'type':Sequelize[_0xe0b0('0x2')]},'mobile':{'type':Sequelize[_0xe0b0('0x2')]},'fax':{'type':Sequelize[_0xe0b0('0x2')]},'email':{'type':Sequelize[_0xe0b0('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0xe0b0('0x2')]},'twitter':{'type':Sequelize[_0xe0b0('0x2')]},'skype':{'type':Sequelize[_0xe0b0('0x2')]},'teams':{'type':Sequelize[_0xe0b0('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xe0b0('0x2')]},'wechat':{'type':Sequelize[_0xe0b0('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0xe0b0('0x4')]},'priority':{'type':Sequelize[_0xe0b0('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':Sequelize[_0xe0b0('0x6')]},'dialTimezone':{'type':Sequelize[_0xe0b0('0x2')]},'utcOffset':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xb10b=['TEXT','INTEGER','UNSIGNED','DATE','lodash','exports','STRING'];(function(_0x338384,_0x574b71){var _0x36ead8=function(_0x4582e1){while(--_0x4582e1){_0x338384['push'](_0x338384['shift']());}};_0x36ead8(++_0x574b71);}(_0xb10b,0x12a));var _0xbb10=function(_0x143ca0,_0x586bd3){_0x143ca0=_0x143ca0-0x0;var _0x11f1c5=_0xb10b[_0x143ca0];return _0x11f1c5;};'use strict';var _=require(_0xbb10('0x0'));var Sequelize=require('sequelize');module[_0xbb10('0x1')]={'firstName':{'type':Sequelize[_0xbb10('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0xbb10('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xbb10('0x2')]},'city':{'type':Sequelize[_0xbb10('0x2')]},'country':{'type':Sequelize[_0xbb10('0x2')]},'dateOfBirth':{'type':Sequelize[_0xbb10('0x2')]},'description':{'type':Sequelize[_0xbb10('0x3')]},'phone':{'type':Sequelize[_0xbb10('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xbb10('0x2')]},'email':{'type':Sequelize[_0xbb10('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xbb10('0x2')]},'fb_data':{'type':Sequelize[_0xbb10('0x2')]},'twitter':{'type':Sequelize[_0xbb10('0x2')]},'skype':{'type':Sequelize[_0xbb10('0x2')]},'teams':{'type':Sequelize[_0xbb10('0x2')]},'viber':{'type':Sequelize[_0xbb10('0x2')]},'line':{'type':Sequelize[_0xbb10('0x2')]},'wechat':{'type':Sequelize[_0xbb10('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0xbb10('0x4')](0x2)[_0xbb10('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xbb10('0x6')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0xbb10('0x2')]},'utcOffset':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 7b05288..f24fac5 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 _0x54ce=['from','tools_tags','select','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','parseSearch','search','sqlOperator','conditions','find','Tag','value','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','and','uc.UserId\x20=\x20?','castTo','DATE','type','start','filter','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','isArray','tag','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','Sequelize','SELECT','clone','having','t.id\x20IN\x20?','role','agent','some','user','c.ListId\x20IS\x20NULL','sequelize','toString','merge','c.id','c.firstName','c.mobile','c.fax','c.email','c.ListId','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','catch','params','columnName','findAll','displayName','alias','custom','values','body','get','tags','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','create','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappMessage','WhatsappQueueReport','isNil','dialTimezone','utcOffset','timezones','bulkCreate','each','duplicates','show','Tags','format','cf_%d','pickBy','setFields','id\x20=\x20?','toParam','text','phone','getTags','rawAttributes','options','setTags','ids','getHoppers','ContactId','includeAll','include','rows','getHopperHistories','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','0777','child_process','../../components/import/cm/csv','File\x20uploaded\x20correctly!','send','upload','createReadStream','meta','import','No\x20phone\x20column\x20specified','binding','firstName','fork','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','pid','chat','sms','openchannel','fax','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20createdAt\x20filter','uniqueid','destination','starttime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','DESC','startCase','closed','closedAt','disposition','key','Owner','browserName','customerPort','osName','ratingType','ratingValue','referer','mail','substatus','externalUrl','threadId','Interaction','findAndCountAll','sortBy','reverse','slice','moment','util','path','lodash','squel','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment/shared','../../mysqldb','defaults','redis','localhost','./cmContact.socket','status','json','offset','undefined','count','limit','set','Content-Range','then','destroy','end','sendStatus','stack','name','index','CmContact','describe','keys','length','startsWith','cf_','push','CmCustomField','findOne','trimStart','all','fieldType','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','field','color'];(function(_0x20c67c,_0x57a3b5){var _0x29fe73=function(_0x54ad7c){while(--_0x54ad7c){_0x20c67c['push'](_0x20c67c['shift']());}};_0x29fe73(++_0x57a3b5);}(_0x54ce,0xe1));var _0xe54c=function(_0x56058d,_0x3dc199){_0x56058d=_0x56058d-0x0;var _0x16cd16=_0x54ce[_0x56058d];return _0x16cd16;};'use strict';var moment=require(_0xe54c('0x0'));var BPromise=require('bluebird');var util=require(_0xe54c('0x1'));var path=require(_0xe54c('0x2'));var fs=require('fs');var _=require(_0xe54c('0x3'));var squel=require(_0xe54c('0x4'));var Papa=require(_0xe54c('0x5'));var Redis=require(_0xe54c('0x6'));var qs=require(_0xe54c('0x7'));var as=require(_0xe54c('0x8'));var logger=require(_0xe54c('0x9'))(_0xe54c('0xa'));var config=require('../../config/environment');var shared=require(_0xe54c('0xb'));var db=require(_0xe54c('0xc'))['db'];config['redis']=_[_0xe54c('0xd')](config[_0xe54c('0xe')],{'host':_0xe54c('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe54c('0xe')]));require(_0xe54c('0x10'))['register'](socket);function respondWithResult(_0x20db93,_0x2058d2){_0x2058d2=_0x2058d2||0xc8;return function(_0x1ab43f){if(_0x1ab43f){return _0x20db93[_0xe54c('0x11')](_0x2058d2)[_0xe54c('0x12')](_0x1ab43f);}};}function respondWithFilteredResult(_0x33ee1c,_0x279bfa){return function(_0x5f4064){if(_0x5f4064){var _0x42dfae=typeof _0x279bfa[_0xe54c('0x13')]===_0xe54c('0x14')&&typeof _0x279bfa['limit']===_0xe54c('0x14');var _0x2a6cd8=_0x5f4064['count'];var _0x3c6448=_0x42dfae?0x0:_0x279bfa[_0xe54c('0x13')];var _0x4bafad=_0x42dfae?_0x5f4064[_0xe54c('0x15')]:_0x279bfa[_0xe54c('0x13')]+_0x279bfa[_0xe54c('0x16')];var _0x472731;if(_0x4bafad>=_0x2a6cd8){_0x4bafad=_0x2a6cd8;_0x472731=0xc8;}else{_0x472731=0xce;}_0x33ee1c[_0xe54c('0x11')](_0x472731);return _0x33ee1c[_0xe54c('0x17')](_0xe54c('0x18'),_0x3c6448+'-'+_0x4bafad+'/'+_0x2a6cd8)[_0xe54c('0x12')](_0x5f4064);}return null;};}function saveUpdates(_0xf91716){return function(_0xf784de){if(_0xf784de){return _0xf784de['update'](_0xf91716)[_0xe54c('0x19')](function(_0x53070d){return _0x53070d;});}return null;};}function removeEntity(_0xa5caba){return function(_0x3eb9b8){if(_0x3eb9b8){return _0x3eb9b8[_0xe54c('0x1a')]()[_0xe54c('0x19')](function(){_0xa5caba[_0xe54c('0x11')](0xcc)[_0xe54c('0x1b')]();});}};}function handleEntityNotFound(_0x2e0379){return function(_0x450b5a){if(!_0x450b5a){_0x2e0379[_0xe54c('0x1c')](0x194);}return _0x450b5a;};}function handleError(_0x3290be,_0x1a1a90){_0x1a1a90=_0x1a1a90||0x1f4;return function(_0x4c9cd8){logger['error'](_0x4c9cd8[_0xe54c('0x1d')]);if(_0x4c9cd8['name']){delete _0x4c9cd8[_0xe54c('0x1e')];}_0x3290be[_0xe54c('0x11')](_0x1a1a90)['send'](_0x4c9cd8);};}exports[_0xe54c('0x1f')]=function(_0x556f08,_0x14abd0){var _0xc632ee={},_0x351edd={},_0x46cbef={'count':0x0,'rows':[]};return db[_0xe54c('0x20')][_0xe54c('0x21')]()[_0xe54c('0x19')](function(_0xc2d16f){var _0x36a064=[];for(var _0x30c0fc=0x0;_0x30c0fc0x1){_0x12be3e['or'](_0xe54c('0x61'),qs[_0xe54c('0x62')](_0x123240),null);}else{if(qs[_0xe54c('0x63')](_0x123240)){_0x12be3e['or']('c.id\x20LIKE\x20?',_0x123240+'%');_0x12be3e['or'](_0xe54c('0x64'),_0x123240+'%');_0x12be3e['or']('c.mobile\x20LIKE\x20?',_0x123240+'%');_0x12be3e['or'](_0xe54c('0x65'),_0x123240+'%');}else if(qs['isEmail'](_0x123240)){_0x12be3e['or'](_0xe54c('0x66'),_0x123240+'%');}else{_0x12be3e['or'](_0xe54c('0x67'),'%'+_0x123240+'%');_0x12be3e['or'](_0xe54c('0x68'),'%'+_0x123240+'%');_0x12be3e['or'](_0xe54c('0x66'),'%'+_0x123240+'%');}}}}_0x77d520[_0xe54c('0x36')](_0x12be3e);_0x77d520[_0xe54c('0x69')]('c.id');var _0xaa58fe={'type':db[_0xe54c('0x6a')]['QueryTypes'][_0xe54c('0x6b')],'raw':!![]};var _0x41cb3d=_0x77d520[_0xe54c('0x6c')]()[_0xe54c('0x38')]('c.id');if(_0xc632ee[_0xe54c('0x34')]){_0xc632ee['order'][_0xe54c('0x4e')](function(_0x401a4d){_0x77d520['order']('c.'+_0x401a4d[0x0],_0x401a4d[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x26c66d)){_0x77d520[_0xe54c('0x6d')](_0x502025);_0x41cb3d[_0xe54c('0x36')](_0xe54c('0x6e'),_0x26c66d);}BPromise['resolve']()[_0xe54c('0x19')](function(){if(!_0x3bfc50)return;if(_0x556f08['user'][_0xe54c('0x6f')]!==_0xe54c('0x70'))return;if(!_[_0xe54c('0x71')](_0x3bfc50[_0xe54c('0x48')],[_0xe54c('0x38'),'User'])){return _0x556f08[_0xe54c('0x72')]['getLists']({'attributes':['id'],'raw':!![]})[_0xe54c('0x19')](function(_0x219340){if(_[_0xe54c('0x59')](_0x219340)){_0x41cb3d['where'](_0xe54c('0x73'));_0x77d520['where'](_0xe54c('0x73'));}else{_0x41cb3d[_0xe54c('0x36')]('c.ListId\x20IN\x20?',_[_0xe54c('0x4d')](_0x219340,'id'));_0x77d520[_0xe54c('0x36')](_0xe54c('0x5b'),_[_0xe54c('0x4d')](_0x219340,'id'));}});}})['then'](function(){if(_0x556f08[_0xe54c('0x72')][_0xe54c('0x6f')]===_0xe54c('0x70')&&!_0x3bfc50&&!_0x556f08[_0xe54c('0x2d')][_0xe54c('0x5a')])return[];return db[_0xe54c('0x74')][_0xe54c('0x2d')](_0x41cb3d[_0xe54c('0x75')](),_0xaa58fe);})[_0xe54c('0x19')](function(_0x211e50){_0x46cbef[_0xe54c('0x15')]=_0x211e50[_0xe54c('0x23')];if(_0x46cbef[_0xe54c('0x15')]===0x0)return[];return db[_0xe54c('0x74')][_0xe54c('0x2d')](_0x34ea2d['toString'](),_0xaa58fe)[_0xe54c('0x19')](function(_0x6c7de4){_0x526456=_['keyBy'](_0x6c7de4,'id');_0xaa58fe=_[_0xe54c('0x76')](_0xaa58fe,{'model':db[_0xe54c('0x20')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x556f08[_0xe54c('0x2d')]['fields']){_0xc632ee[_0xe54c('0x31')]['forEach'](function(_0x270772){_0x77d520[_0xe54c('0x38')]('c.'+_0x270772);});}else{_0x77d520['field'](_0xe54c('0x77'));_0x77d520[_0xe54c('0x38')](_0xe54c('0x78'));_0x77d520[_0xe54c('0x38')]('c.lastName');_0x77d520[_0xe54c('0x38')]('c.phone');_0x77d520[_0xe54c('0x38')](_0xe54c('0x79'));_0x77d520['field'](_0xe54c('0x7a'));_0x77d520[_0xe54c('0x38')](_0xe54c('0x7b'));_0x77d520[_0xe54c('0x38')](_0xe54c('0x7c'));_0x77d520[_0xe54c('0x38')]('c.createdAt');_0x77d520['field'](_0xe54c('0x7d'));_0x77d520[_0xe54c('0x38')](_0xe54c('0x7e'));_0x77d520['field'](_0xe54c('0x7f'),_0xe54c('0x80'));}if(_0xc632ee['limit'])_0x77d520[_0xe54c('0x16')](_0xc632ee[_0xe54c('0x16')]);if(_0xc632ee[_0xe54c('0x13')])_0x77d520[_0xe54c('0x13')](_0xc632ee[_0xe54c('0x13')]);return db[_0xe54c('0x74')][_0xe54c('0x2d')](_0x77d520['toString'](),_0xaa58fe);});})[_0xe54c('0x19')](function(_0x3c1cef){_0x3c1cef['forEach'](function(_0x4e84ec){if(_0x4e84ec[_0xe54c('0x80')]){_0x4e84ec['Tags']=[];_0x4e84ec[_0xe54c('0x80')]['split'](',')[_0xe54c('0x4e')](function(_0x1e6775){_0x4e84ec['Tags'][_0xe54c('0x26')](_0x526456[_0x1e6775]);});}delete _0x4e84ec[_0xe54c('0x80')];});_0x46cbef['rows']=_0x3c1cef;return _0x46cbef;})[_0xe54c('0x19')](respondWithFilteredResult(_0x14abd0,_0xc632ee));})[_0xe54c('0x81')](handleError(_0x14abd0,null));};exports['destroy']=function(_0x1a93af,_0x294832){return db[_0xe54c('0x20')][_0xe54c('0x49')]({'where':{'id':_0x1a93af[_0xe54c('0x82')]['id']}})[_0xe54c('0x19')](handleEntityNotFound(_0x294832,null))[_0xe54c('0x19')](removeEntity(_0x294832,null))[_0xe54c('0x81')](handleError(_0x294832,null));};exports[_0xe54c('0x21')]=function(_0x18106e,_0x8b1e0e){return db[_0xe54c('0x20')][_0xe54c('0x21')]()['then'](function(_0x248f0f){delete _0x248f0f['tags'];for(var _0x199bc9=0x0;_0x199bc9=_0x2ebb88){_0x10fbee=_0x2ebb88;_0x23f485=0xc8;}else{_0x23f485=0xce;}_0x23ed05[_0x1d26('0x11')](_0x23f485);return _0x23ed05[_0x1d26('0x16')](_0x1d26('0x17'),_0x4f02db+'-'+_0x10fbee+'/'+_0x2ebb88)['json'](_0x3d6db0);}return null;};}function saveUpdates(_0x3e53ee){return function(_0x10522e){if(_0x10522e){return _0x10522e[_0x1d26('0x18')](_0x3e53ee)[_0x1d26('0x19')](function(_0x26d685){return _0x26d685;});}return null;};}function removeEntity(_0x4fe87e){return function(_0x2a6dd8){if(_0x2a6dd8){return _0x2a6dd8[_0x1d26('0x1a')]()['then'](function(){_0x4fe87e[_0x1d26('0x11')](0xcc)[_0x1d26('0x1b')]();});}};}function handleEntityNotFound(_0x157e84){return function(_0x124681){if(!_0x124681){_0x157e84[_0x1d26('0x1c')](0x194);}return _0x124681;};}function handleError(_0x13c652,_0xea4311){_0xea4311=_0xea4311||0x1f4;return function(_0x418138){logger[_0x1d26('0x1d')](_0x418138[_0x1d26('0x1e')]);if(_0x418138['name']){delete _0x418138[_0x1d26('0x1f')];}_0x13c652[_0x1d26('0x11')](_0xea4311)[_0x1d26('0x20')](_0x418138);};}exports[_0x1d26('0x21')]=function(_0x669590,_0x1e2395){var _0x228487={},_0x2042c0={},_0x2da8d7={'count':0x0,'rows':[]};return db['CmContact']['describe']()[_0x1d26('0x19')](function(_0x4f8d14){var _0x32152e=[];for(var _0x29b903=0x0;_0x29b9030x1){_0x3f2c5e['or'](_0x1d26('0x60'),qs[_0x1d26('0x61')](_0x4f649e),null);}else{if(qs[_0x1d26('0x62')](_0x4f649e)){_0x3f2c5e['or']('c.id\x20LIKE\x20?',_0x4f649e+'%');_0x3f2c5e['or'](_0x1d26('0x63'),_0x4f649e+'%');_0x3f2c5e['or']('c.mobile\x20LIKE\x20?',_0x4f649e+'%');_0x3f2c5e['or'](_0x1d26('0x64'),_0x4f649e+'%');}else if(qs[_0x1d26('0x65')](_0x4f649e)){_0x3f2c5e['or'](_0x1d26('0x66'),_0x4f649e+'%');}else{_0x3f2c5e['or'](_0x1d26('0x67'),'%'+_0x4f649e+'%');_0x3f2c5e['or'](_0x1d26('0x68'),'%'+_0x4f649e+'%');_0x3f2c5e['or']('c.email\x20LIKE\x20?','%'+_0x4f649e+'%');}}}}_0x576edf[_0x1d26('0x35')](_0x3f2c5e);_0x576edf[_0x1d26('0x69')]('c.id');var _0x2149ed={'type':db['Sequelize']['QueryTypes'][_0x1d26('0x6a')],'raw':!![]};var _0x174971=_0x576edf[_0x1d26('0x6b')]()[_0x1d26('0x38')](_0x1d26('0x6c'));if(_0x228487[_0x1d26('0x33')]){_0x228487[_0x1d26('0x33')][_0x1d26('0x49')](function(_0x59ff9a){_0x576edf[_0x1d26('0x33')]('c.'+_0x59ff9a[0x0],_0x59ff9a[0x1]===_0x1d26('0x6d')?![]:!![]);});}if(!_['isEmpty'](_0x4f4764)){_0x576edf[_0x1d26('0x6e')](_0x37f57f);_0x174971[_0x1d26('0x35')](_0x1d26('0x6f'),_0x4f4764);}BPromise['resolve']()[_0x1d26('0x19')](function(){if(!_0x345f39)return;if(_0x669590[_0x1d26('0x70')][_0x1d26('0x71')]!=='agent')return;if(!_[_0x1d26('0x72')](_0x345f39[_0x1d26('0x73')],[_0x1d26('0x38'),_0x1d26('0x74')])){return _0x669590[_0x1d26('0x70')][_0x1d26('0x75')]({'attributes':['id'],'raw':!![]})[_0x1d26('0x19')](function(_0x165d2b){if(_[_0x1d26('0x76')](_0x165d2b)){_0x174971['where']('c.ListId\x20IS\x20NULL');_0x576edf['where'](_0x1d26('0x77'));}else{_0x174971[_0x1d26('0x35')]('c.ListId\x20IN\x20?',_[_0x1d26('0x55')](_0x165d2b,'id'));_0x576edf[_0x1d26('0x35')](_0x1d26('0x59'),_[_0x1d26('0x55')](_0x165d2b,'id'));}});}})[_0x1d26('0x19')](function(){if(_0x669590[_0x1d26('0x70')][_0x1d26('0x71')]===_0x1d26('0x78')&&!_0x345f39&&!_0x669590['query'][_0x1d26('0x79')])return[];return db[_0x1d26('0x7a')][_0x1d26('0x2c')](_0x174971[_0x1d26('0x7b')](),_0x2149ed);})[_0x1d26('0x19')](function(_0x267793){_0x2da8d7[_0x1d26('0x15')]=_0x267793[_0x1d26('0x22')];if(_0x2da8d7[_0x1d26('0x15')]===0x0)return[];return db['sequelize']['query'](_0x3c0b0a[_0x1d26('0x7b')](),_0x2149ed)[_0x1d26('0x19')](function(_0xb26fbd){_0x1e412c=_[_0x1d26('0x7c')](_0xb26fbd,'id');_0x2149ed=_[_0x1d26('0x7d')](_0x2149ed,{'model':db[_0x1d26('0x7e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x669590[_0x1d26('0x2c')][_0x1d26('0x30')]){_0x228487[_0x1d26('0x2f')]['forEach'](function(_0x3cc1a5){_0x576edf[_0x1d26('0x38')]('c.'+_0x3cc1a5);});}else{_0x576edf[_0x1d26('0x38')](_0x1d26('0x6c'));_0x576edf['field'](_0x1d26('0x7f'));_0x576edf[_0x1d26('0x38')](_0x1d26('0x80'));_0x576edf['field'](_0x1d26('0x81'));_0x576edf[_0x1d26('0x38')](_0x1d26('0x82'));_0x576edf['field'](_0x1d26('0x83'));_0x576edf['field'](_0x1d26('0x84'));_0x576edf['field'](_0x1d26('0x85'));_0x576edf['field'](_0x1d26('0x86'));_0x576edf[_0x1d26('0x38')](_0x1d26('0x87'));_0x576edf[_0x1d26('0x38')]('c.CompanyId');_0x576edf[_0x1d26('0x38')](_0x1d26('0x88'),'TagIds');}if(_0x228487[_0x1d26('0x14')])_0x576edf[_0x1d26('0x14')](_0x228487[_0x1d26('0x14')]);if(_0x228487['offset'])_0x576edf[_0x1d26('0x12')](_0x228487[_0x1d26('0x12')]);return db[_0x1d26('0x7a')][_0x1d26('0x2c')](_0x576edf[_0x1d26('0x7b')](),_0x2149ed);});})[_0x1d26('0x19')](function(_0x451839){_0x451839['forEach'](function(_0x381b32){if(_0x381b32[_0x1d26('0x89')]){_0x381b32[_0x1d26('0x8a')]=[];_0x381b32['TagIds'][_0x1d26('0x48')](',')[_0x1d26('0x49')](function(_0x2fb2ee){_0x381b32[_0x1d26('0x8a')][_0x1d26('0x25')](_0x1e412c[_0x2fb2ee]);});}delete _0x381b32['TagIds'];});_0x2da8d7[_0x1d26('0x8b')]=_0x451839;return _0x2da8d7;})[_0x1d26('0x19')](respondWithFilteredResult(_0x1e2395,_0x228487));})['catch'](handleError(_0x1e2395,null));};exports[_0x1d26('0x1a')]=function(_0x5bed4c,_0x637410){return db[_0x1d26('0x7e')][_0x1d26('0x46')]({'where':{'id':_0x5bed4c[_0x1d26('0x8c')]['id']}})[_0x1d26('0x19')](handleEntityNotFound(_0x637410,null))[_0x1d26('0x19')](removeEntity(_0x637410,null))[_0x1d26('0x8d')](handleError(_0x637410,null));};exports[_0x1d26('0x8e')]=function(_0x12f548,_0x327e20){return db[_0x1d26('0x7e')][_0x1d26('0x8e')]()[_0x1d26('0x19')](function(_0x5edd7d){delete _0x5edd7d[_0x1d26('0x8f')];for(var _0x25bb78=0x0;_0x25bb78{}\s\\|]/g,'-');_0x4fdf83(null,util[_0xa5aa('0x1e')](_0xa5aa('0x1f'),path[_0xa5aa('0x20')](_0x1732d4['originalname'],path['extname'](_0x1732d4[_0xa5aa('0x1c')])),Date[_0xa5aa('0x21')](),path[_0xa5aa('0x22')](_0x1732d4['originalname'])));}})});router[_0xa5aa('0x15')](_0xa5aa('0x23'),upload['single']('file'),controller['uploadCsv']);var upload=multer({'storage':multer[_0xa5aa('0x24')]({'destination':function(_0x2287ff,_0x52976e,_0x2a724d){_0x2a724d(null,path[_0xa5aa('0x25')](config[_0xa5aa('0x1b')],_0xa5aa('0x26')));},'filename':function(_0x10c9d8,_0x496383,_0x4c59ce){_0x496383[_0xa5aa('0x1c')]=_0x496383[_0xa5aa('0x1c')][_0xa5aa('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4c59ce(null,util[_0xa5aa('0x1e')](_0xa5aa('0x1f'),path[_0xa5aa('0x20')](_0x496383['originalname'],path[_0xa5aa('0x22')](_0x496383[_0xa5aa('0x1c')])),Date[_0xa5aa('0x21')](),path[_0xa5aa('0x22')](_0x496383[_0xa5aa('0x1c')])));}})});router[_0xa5aa('0x15')]('/upload',upload['single'](_0xa5aa('0x27')),controller[_0xa5aa('0x28')]);router[_0xa5aa('0x15')]('/upload/:id',auth[_0xa5aa('0x7')](),controller[_0xa5aa('0x29')]);router[_0xa5aa('0x2a')](_0xa5aa('0x2b'),auth[_0xa5aa('0x7')](),controller[_0xa5aa('0x2c')]);router['delete'](_0xa5aa('0x2b'),auth[_0xa5aa('0x7')](),controller[_0xa5aa('0x2d')]);module[_0xa5aa('0x2e')]=router; \ No newline at end of file +var _0x47cb=['/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/journey','post','merge','setTags','diskStorage','join','root','server/files/tmp','replace','format','basename','extname','originalname','now','single','file','uploadCsv','%s-%s%s','/upload','upload','/upload/:id','import','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmContact.controller','isAuthenticated','index','/describe','describe','get','/:id','show','/:id/tags','getTags'];(function(_0x4db0c6,_0x5e810e){var _0x4baae9=function(_0x6d56df){while(--_0x6d56df){_0x4db0c6['push'](_0x4db0c6['shift']());}};_0x4baae9(++_0x5e810e);}(_0x47cb,0x1bb));var _0xb47c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x47cb[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xb47c('0x0'));var path=require(_0xb47c('0x1'));var timeout=require('connect-timeout');var express=require(_0xb47c('0x2'));var router=express[_0xb47c('0x3')]();var fs_extra=require(_0xb47c('0x4'));var auth=require(_0xb47c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb47c('0x6'));var controller=require(_0xb47c('0x7'));router['get']('/',auth[_0xb47c('0x8')](),controller[_0xb47c('0x9')]);router['get'](_0xb47c('0xa'),auth[_0xb47c('0x8')](),controller[_0xb47c('0xb')]);router[_0xb47c('0xc')](_0xb47c('0xd'),auth[_0xb47c('0x8')](),controller[_0xb47c('0xe')]);router['get'](_0xb47c('0xf'),auth[_0xb47c('0x8')](),controller[_0xb47c('0x10')]);router[_0xb47c('0xc')]('/:id/hoppers',auth['isAuthenticated'](),controller['getHoppers']);router[_0xb47c('0xc')](_0xb47c('0x11'),auth['isAuthenticated'](),controller[_0xb47c('0x12')]);router['get'](_0xb47c('0x13'),auth['isAuthenticated'](),controller[_0xb47c('0x14')]);router[_0xb47c('0xc')]('/:id/jscripty_sessions',auth[_0xb47c('0x8')](),controller['getJscriptySessions']);router[_0xb47c('0xc')](_0xb47c('0x15'),auth[_0xb47c('0x8')](),controller['getJourney']);router[_0xb47c('0x16')]('/merge',auth[_0xb47c('0x8')](),controller[_0xb47c('0x17')]);router[_0xb47c('0x16')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb47c('0x16')]('/create_many',auth[_0xb47c('0x8')](),controller['bulkCreate']);router['post']('/:id/tags',auth['isAuthenticated'](),controller[_0xb47c('0x18')]);var upload=multer({'storage':multer[_0xb47c('0x19')]({'destination':function(_0x1fd359,_0x1045a2,_0x3fa881){_0x3fa881(null,path[_0xb47c('0x1a')](config[_0xb47c('0x1b')],_0xb47c('0x1c')));},'filename':function(_0x5cbcf7,_0x59f54d,_0x25bc05){_0x59f54d['originalname']=_0x59f54d['originalname'][_0xb47c('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x25bc05(null,util[_0xb47c('0x1e')]('%s-%s%s',path[_0xb47c('0x1f')](_0x59f54d['originalname'],path[_0xb47c('0x20')](_0x59f54d[_0xb47c('0x21')])),Date[_0xb47c('0x22')](),path[_0xb47c('0x20')](_0x59f54d[_0xb47c('0x21')])));}})});router[_0xb47c('0x16')]('/csv',upload[_0xb47c('0x23')](_0xb47c('0x24')),controller[_0xb47c('0x25')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x356138,_0x1f3e21,_0x1f4cc6){_0x1f4cc6(null,path['join'](config[_0xb47c('0x1b')],_0xb47c('0x1c')));},'filename':function(_0x2422f7,_0x24bac7,_0x4bfa29){_0x24bac7['originalname']=_0x24bac7[_0xb47c('0x21')][_0xb47c('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4bfa29(null,util[_0xb47c('0x1e')](_0xb47c('0x26'),path[_0xb47c('0x1f')](_0x24bac7[_0xb47c('0x21')],path[_0xb47c('0x20')](_0x24bac7[_0xb47c('0x21')])),Date[_0xb47c('0x22')](),path['extname'](_0x24bac7[_0xb47c('0x21')])));}})});router[_0xb47c('0x16')](_0xb47c('0x27'),upload[_0xb47c('0x23')](_0xb47c('0x24')),controller[_0xb47c('0x28')]);router[_0xb47c('0x16')](_0xb47c('0x29'),auth[_0xb47c('0x8')](),controller[_0xb47c('0x2a')]);router['put'](_0xb47c('0xd'),auth[_0xb47c('0x8')](),controller['update']);router[_0xb47c('0x2b')]('/:id',auth[_0xb47c('0x8')](),controller[_0xb47c('0x2c')]);module[_0xb47c('0x2d')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index bb63367..806aeb7 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 _0x0da4=['parse','values','isArray','setDataValue','BOOLEAN','sequelize','lodash','exports','VIRTUAL','getDataValue','alias','name','STRING','TEXT','long','type','select'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0da4,0x126));var _0x40da=function(_0x1621dd,_0x172229){_0x1621dd=_0x1621dd-0x0;var _0x3b0046=_0x0da4[_0x1621dd];return _0x3b0046;};'use strict';var Sequelize=require(_0x40da('0x0'));var _=require(_0x40da('0x1'));module[_0x40da('0x2')]={'name':{'type':Sequelize[_0x40da('0x3')],'get':function(_0x45ec66){return this[_0x40da('0x4')]('alias');}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x36dc3d){this['setDataValue'](_0x40da('0x5'),_0x36dc3d?_0x36dc3d:this[_0x40da('0x4')](_0x40da('0x6')));}},'type':{'type':Sequelize[_0x40da('0x7')],'allowNull':![]},'values':{'type':Sequelize[_0x40da('0x8')](_0x40da('0x9')),'get':function(){if(this[_0x40da('0x4')](_0x40da('0xa'))===_0x40da('0xb')){return JSON[_0x40da('0xc')](this[_0x40da('0x4')](_0x40da('0xd')));}else{return this[_0x40da('0x4')](_0x40da('0xd'));}},'set':function(_0x28f337){if(Array[_0x40da('0xe')](_0x28f337)){this[_0x40da('0xf')](_0x40da('0xd'),JSON['stringify'](_0x28f337));}else{this[_0x40da('0xf')](_0x40da('0xd'),_0x28f337);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x40da('0x10')],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM']('voice')}}; \ No newline at end of file +var _0xa2d9=['TEXT','long','parse','values','isArray','BOOLEAN','voice','sequelize','lodash','exports','VIRTUAL','alias','setDataValue','getDataValue','name','STRING'];(function(_0x2b6600,_0x24c497){var _0x912ee2=function(_0x5d6484){while(--_0x5d6484){_0x2b6600['push'](_0x2b6600['shift']());}};_0x912ee2(++_0x24c497);}(_0xa2d9,0x187));var _0x9a2d=function(_0x542047,_0x50790c){_0x542047=_0x542047-0x0;var _0x4166bd=_0xa2d9[_0x542047];return _0x4166bd;};'use strict';var Sequelize=require(_0x9a2d('0x0'));var _=require(_0x9a2d('0x1'));module[_0x9a2d('0x2')]={'name':{'type':Sequelize[_0x9a2d('0x3')],'get':function(_0x3cc17){return this['getDataValue'](_0x9a2d('0x4'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x4f71b2){this[_0x9a2d('0x5')](_0x9a2d('0x4'),_0x4f71b2?_0x4f71b2:this[_0x9a2d('0x6')](_0x9a2d('0x7')));}},'type':{'type':Sequelize[_0x9a2d('0x8')],'allowNull':![]},'values':{'type':Sequelize[_0x9a2d('0x9')](_0x9a2d('0xa')),'get':function(){if(this['getDataValue']('type')==='select'){return JSON[_0x9a2d('0xb')](this['getDataValue'](_0x9a2d('0xc')));}else{return this['getDataValue'](_0x9a2d('0xc'));}},'set':function(_0x4f42ea){if(Array[_0x9a2d('0xd')](_0x4f42ea)){this[_0x9a2d('0x5')]('values',JSON['stringify'](_0x4f42ea));}else{this['setDataValue'](_0x9a2d('0xc'),_0x4f42ea);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x9a2d('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0x9a2d('0xf'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index a83e612..c317360 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 _0x6a36=['squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','stack','name','CmCustomField','rawAttributes','type','model','differenceBy','map','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','find','catch','body','params','create','sequelize','transaction','Sequelize','TEXT','text','number','INTEGER','switch','defaultValue','addColumn','cm_contacts','cf_%d','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra'];(function(_0x2a63c5,_0x322ab3){var _0x1f7040=function(_0x3504f2){while(--_0x3504f2){_0x2a63c5['push'](_0x2a63c5['shift']());}};_0x1f7040(++_0x322ab3);}(_0x6a36,0x9c));var _0x66a3=function(_0x226a85,_0x2f6674){_0x226a85=_0x226a85-0x0;var _0x14838b=_0x6a36[_0x226a85];return _0x14838b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x66a3('0x0'));var rp=require(_0x66a3('0x1'));var moment=require(_0x66a3('0x2'));var BPromise=require(_0x66a3('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x66a3('0x4'));var sox=require(_0x66a3('0x5'));var csv=require('to-csv');var ejs=require(_0x66a3('0x6'));var fs=require('fs');var fs_extra=require(_0x66a3('0x7'));var _=require('lodash');var squel=require(_0x66a3('0x8'));var crypto=require('crypto');var jsforce=require(_0x66a3('0x9'));var deskjs=require(_0x66a3('0xa'));var toCsv=require(_0x66a3('0xb'));var querystring=require(_0x66a3('0xc'));var Papa=require(_0x66a3('0xd'));var Redis=require(_0x66a3('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x66a3('0xf'));var as=require(_0x66a3('0x10'));var hardwareService=require(_0x66a3('0x11'));var logger=require(_0x66a3('0x12'))(_0x66a3('0x13'));var utils=require(_0x66a3('0x14'));var config=require(_0x66a3('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x66a3('0x16'))['db'];function respondWithStatusCode(_0x4b2979,_0x52ec9e){_0x52ec9e=_0x52ec9e||0xcc;return function(_0x200f0d){if(_0x200f0d){return _0x4b2979[_0x66a3('0x17')](_0x52ec9e);}return _0x4b2979[_0x66a3('0x18')](_0x52ec9e)['end']();};}function respondWithResult(_0x29a62d,_0x57866b){_0x57866b=_0x57866b||0xc8;return function(_0x3ba66d){if(_0x3ba66d){return _0x29a62d[_0x66a3('0x18')](_0x57866b)[_0x66a3('0x19')](_0x3ba66d);}};}function respondWithFilteredResult(_0x18e9be,_0x148621){return function(_0x54cd28){if(_0x54cd28){var _0x4c7756=typeof _0x148621[_0x66a3('0x1a')]===_0x66a3('0x1b')&&typeof _0x148621['limit']==='undefined';var _0x4ee7ec=_0x54cd28['count'];var _0xd80856=_0x4c7756?0x0:_0x148621[_0x66a3('0x1a')];var _0xcb814e=_0x4c7756?_0x54cd28[_0x66a3('0x1c')]:_0x148621[_0x66a3('0x1a')]+_0x148621[_0x66a3('0x1d')];var _0x2ce91f;if(_0xcb814e>=_0x4ee7ec){_0xcb814e=_0x4ee7ec;_0x2ce91f=0xc8;}else{_0x2ce91f=0xce;}_0x18e9be[_0x66a3('0x18')](_0x2ce91f);return _0x18e9be[_0x66a3('0x1e')](_0x66a3('0x1f'),_0xd80856+'-'+_0xcb814e+'/'+_0x4ee7ec)[_0x66a3('0x19')](_0x54cd28);}return null;};}function patchUpdates(_0x462304){return function(_0x40e1e1){try{jsonpatch[_0x66a3('0x20')](_0x40e1e1,_0x462304,!![]);}catch(_0x36c226){return BPromise[_0x66a3('0x21')](_0x36c226);}return _0x40e1e1['save']();};}function saveUpdates(_0x1f76f8,_0x401834){return function(_0x573db3){if(_0x573db3){return _0x573db3[_0x66a3('0x22')](_0x1f76f8)[_0x66a3('0x23')](function(_0x163fa6){return _0x163fa6;});}return null;};}function removeEntity(_0x5ccab9,_0x234d14){return function(_0x21cdab){if(_0x21cdab){return _0x21cdab[_0x66a3('0x24')]()[_0x66a3('0x23')](function(){_0x5ccab9[_0x66a3('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58562c,_0x2d57a3){return function(_0x4246f8){if(!_0x4246f8){_0x58562c[_0x66a3('0x17')](0x194);}return _0x4246f8;};}function handleError(_0x12b7c5,_0x2356d6){_0x2356d6=_0x2356d6||0x1f4;return function(_0x2966f4){logger['error'](_0x2966f4[_0x66a3('0x25')]);if(_0x2966f4[_0x66a3('0x26')]){delete _0x2966f4[_0x66a3('0x26')];}_0x12b7c5[_0x66a3('0x18')](_0x2356d6)['send'](_0x2966f4);};}exports['index']=function(_0x16cce8,_0x24f5d8){var _0x10254a={},_0x2fd8e4={},_0x1bbf63={'count':0x0,'rows':[]};var _0x32a823=_['map'](db[_0x66a3('0x27')][_0x66a3('0x28')],function(_0x845cd2){return{'name':_0x845cd2['fieldName'],'type':_0x845cd2[_0x66a3('0x29')]['key']};});_0x2fd8e4[_0x66a3('0x2a')]=_[_0x66a3('0x2b')](_[_0x66a3('0x2c')](_0x32a823,'name'),['name']);_0x2fd8e4['query']=_[_0x66a3('0x2d')](_0x16cce8[_0x66a3('0x2e')]);_0x2fd8e4['filters']=_[_0x66a3('0x2f')](_0x2fd8e4[_0x66a3('0x2a')],_0x2fd8e4[_0x66a3('0x2e')]);_0x10254a[_0x66a3('0x30')]=_['intersection'](_0x2fd8e4[_0x66a3('0x2a')],qs[_0x66a3('0x31')](_0x16cce8[_0x66a3('0x2e')][_0x66a3('0x31')]));_0x10254a['attributes']=_0x10254a[_0x66a3('0x30')]['length']?_0x10254a[_0x66a3('0x30')]:_0x2fd8e4['model'];if(!_0x16cce8['query'][_0x66a3('0x32')](_0x66a3('0x33'))){_0x10254a['limit']=qs['limit'](_0x16cce8[_0x66a3('0x2e')][_0x66a3('0x1d')]);_0x10254a[_0x66a3('0x1a')]=qs[_0x66a3('0x1a')](_0x16cce8[_0x66a3('0x2e')][_0x66a3('0x1a')]);}_0x10254a['order']=qs[_0x66a3('0x34')](_0x16cce8['query']['sort']);_0x10254a[_0x66a3('0x35')]=qs[_0x66a3('0x36')](_[_0x66a3('0x37')](_0x16cce8['query'],_0x2fd8e4[_0x66a3('0x36')]),_0x32a823);if(_0x16cce8[_0x66a3('0x2e')]['filter']){_0x10254a[_0x66a3('0x35')]=_['merge'](_0x10254a[_0x66a3('0x35')],{'$or':_[_0x66a3('0x2c')](_0x32a823,function(_0x59fb24){if(_0x59fb24[_0x66a3('0x29')]!==_0x66a3('0x38')){var _0x26a6e6={};_0x26a6e6[_0x59fb24[_0x66a3('0x26')]]={'$like':'%'+_0x16cce8[_0x66a3('0x2e')][_0x66a3('0x39')]+'%'};return _0x26a6e6;}})});}_0x10254a=_[_0x66a3('0x3a')]({},_0x10254a,_0x16cce8[_0x66a3('0x3b')]);var _0x432de7={'where':_0x10254a['where']};return db[_0x66a3('0x27')][_0x66a3('0x1c')](_0x432de7)[_0x66a3('0x23')](function(_0x233aef){_0x1bbf63[_0x66a3('0x1c')]=_0x233aef;if(_0x16cce8['query'][_0x66a3('0x3c')]){_0x10254a[_0x66a3('0x3d')]=[{'all':!![]}];}return db[_0x66a3('0x27')][_0x66a3('0x3e')](_0x10254a);})[_0x66a3('0x23')](function(_0x32675f){_0x1bbf63[_0x66a3('0x3f')]=_0x32675f;return _0x1bbf63;})[_0x66a3('0x23')](respondWithFilteredResult(_0x24f5d8,_0x10254a))['catch'](handleError(_0x24f5d8,null));};exports[_0x66a3('0x40')]=function(_0x3f1a16,_0x1bd414){var _0x1fca0b={'raw':!![],'where':{'id':_0x3f1a16['params']['id']}},_0x352b87={};_0x352b87[_0x66a3('0x2a')]=_[_0x66a3('0x2d')](db[_0x66a3('0x27')][_0x66a3('0x28')]);_0x352b87[_0x66a3('0x2e')]=_[_0x66a3('0x2d')](_0x3f1a16['query']);_0x352b87[_0x66a3('0x36')]=_[_0x66a3('0x2f')](_0x352b87[_0x66a3('0x2a')],_0x352b87[_0x66a3('0x2e')]);_0x1fca0b['attributes']=_[_0x66a3('0x2f')](_0x352b87[_0x66a3('0x2a')],qs[_0x66a3('0x31')](_0x3f1a16[_0x66a3('0x2e')]['fields']));_0x1fca0b['attributes']=_0x1fca0b[_0x66a3('0x30')]['length']?_0x1fca0b['attributes']:_0x352b87[_0x66a3('0x2a')];if(_0x3f1a16[_0x66a3('0x2e')][_0x66a3('0x3c')]){_0x1fca0b['include']=[{'all':!![]}];}_0x1fca0b=_[_0x66a3('0x3a')]({},_0x1fca0b,_0x3f1a16[_0x66a3('0x3b')]);return db[_0x66a3('0x27')][_0x66a3('0x41')](_0x1fca0b)['then'](handleEntityNotFound(_0x1bd414,null))[_0x66a3('0x23')](respondWithResult(_0x1bd414,null))[_0x66a3('0x42')](handleError(_0x1bd414,null));};exports['update']=function(_0x4b95f9,_0xfdeec4){if(_0x4b95f9['body']['id']){delete _0x4b95f9[_0x66a3('0x43')]['id'];}return db['CmCustomField'][_0x66a3('0x41')]({'where':{'id':_0x4b95f9['params']['id']}})[_0x66a3('0x23')](handleEntityNotFound(_0xfdeec4,null))[_0x66a3('0x23')](saveUpdates(_0x4b95f9[_0x66a3('0x43')],null))[_0x66a3('0x23')](respondWithResult(_0xfdeec4,null))[_0x66a3('0x42')](handleError(_0xfdeec4,null));};exports[_0x66a3('0x24')]=function(_0x4e69ea,_0x4c8c98){return db[_0x66a3('0x27')][_0x66a3('0x41')]({'where':{'id':_0x4e69ea[_0x66a3('0x44')]['id']}})[_0x66a3('0x23')](handleEntityNotFound(_0x4c8c98,null))[_0x66a3('0x23')](removeEntity(_0x4c8c98,null))[_0x66a3('0x42')](handleError(_0x4c8c98,null));};exports[_0x66a3('0x45')]=function(_0x36fec9,_0x325d70){var _0x186500;return db[_0x66a3('0x46')][_0x66a3('0x47')](function(_0x4e5283){return db[_0x66a3('0x27')][_0x66a3('0x45')](_0x36fec9[_0x66a3('0x43')],{'transaction':_0x4e5283})[_0x66a3('0x23')](function(_0x9dcd91){_0x186500=_0x9dcd91;var _0x455556={'type':db[_0x66a3('0x48')][_0x66a3('0x49')],'transaction':_0x4e5283};switch(_0x36fec9[_0x66a3('0x43')][_0x66a3('0x29')]){case _0x66a3('0x4a'):_0x455556[_0x66a3('0x29')]=db[_0x66a3('0x48')]['TEXT'];break;case _0x66a3('0x4b'):_0x455556['type']=db[_0x66a3('0x48')][_0x66a3('0x4c')];break;case _0x66a3('0x4d'):_0x455556[_0x66a3('0x29')]=db[_0x66a3('0x48')]['BOOLEAN'];_0x455556[_0x66a3('0x4e')]=![];break;default:}return db[_0x66a3('0x46')]['queryInterface'][_0x66a3('0x4f')](_0x66a3('0x50'),util['format'](_0x66a3('0x51'),_0x186500['id']),_0x455556);})[_0x66a3('0x23')](function(){return _0x186500;});})['then'](respondWithResult(_0x325d70,0xc9))[_0x66a3('0x42')](handleError(_0x325d70,null));}; \ No newline at end of file +var _0x17e7=['sequelize','transaction','TEXT','text','number','Sequelize','INTEGER','BOOLEAN','queryInterface','addColumn','cm_contacts','format','cf_%d','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','count','offset','limit','set','json','apply','reject','update','then','destroy','sendStatus','error','name','send','map','CmCustomField','fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','body','find','create'];(function(_0xe36710,_0x176822){var _0x23d9ee=function(_0x285606){while(--_0x285606){_0xe36710['push'](_0xe36710['shift']());}};_0x23d9ee(++_0x176822);}(_0x17e7,0x171));var _0x717e=function(_0x5c4f6b,_0x2cdfce){_0x5c4f6b=_0x5c4f6b-0x0;var _0x104c4e=_0x17e7[_0x5c4f6b];return _0x104c4e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x717e('0x0'));var zipdir=require(_0x717e('0x1'));var jsonpatch=require(_0x717e('0x2'));var rp=require(_0x717e('0x3'));var moment=require('moment');var BPromise=require(_0x717e('0x4'));var Mustache=require(_0x717e('0x5'));var util=require(_0x717e('0x6'));var path=require(_0x717e('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x717e('0x8'));var fs=require('fs');var fs_extra=require(_0x717e('0x9'));var _=require(_0x717e('0xa'));var squel=require(_0x717e('0xb'));var crypto=require(_0x717e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x717e('0xd'));var toCsv=require(_0x717e('0xe'));var querystring=require(_0x717e('0xf'));var Papa=require(_0x717e('0x10'));var Redis=require(_0x717e('0x11'));var authService=require(_0x717e('0x12'));var qs=require(_0x717e('0x13'));var as=require(_0x717e('0x14'));var hardwareService=require(_0x717e('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x717e('0x16'));var config=require(_0x717e('0x17'));var licenseUtil=require(_0x717e('0x18'));var db=require(_0x717e('0x19'))['db'];function respondWithStatusCode(_0x9cfece,_0x37e3ba){_0x37e3ba=_0x37e3ba||0xcc;return function(_0x184830){if(_0x184830){return _0x9cfece['sendStatus'](_0x37e3ba);}return _0x9cfece[_0x717e('0x1a')](_0x37e3ba)[_0x717e('0x1b')]();};}function respondWithResult(_0x5761ff,_0x5589c9){_0x5589c9=_0x5589c9||0xc8;return function(_0x5668f0){if(_0x5668f0){return _0x5761ff['status'](_0x5589c9)['json'](_0x5668f0);}};}function respondWithFilteredResult(_0x552eb2,_0x1f9bb8){return function(_0x3d8e90){if(_0x3d8e90){var _0x16d188=typeof _0x1f9bb8['offset']==='undefined'&&typeof _0x1f9bb8['limit']===_0x717e('0x1c');var _0x399c90=_0x3d8e90[_0x717e('0x1d')];var _0x5c8175=_0x16d188?0x0:_0x1f9bb8[_0x717e('0x1e')];var _0x255b02=_0x16d188?_0x3d8e90['count']:_0x1f9bb8['offset']+_0x1f9bb8[_0x717e('0x1f')];var _0x2ac56a;if(_0x255b02>=_0x399c90){_0x255b02=_0x399c90;_0x2ac56a=0xc8;}else{_0x2ac56a=0xce;}_0x552eb2['status'](_0x2ac56a);return _0x552eb2[_0x717e('0x20')]('Content-Range',_0x5c8175+'-'+_0x255b02+'/'+_0x399c90)[_0x717e('0x21')](_0x3d8e90);}return null;};}function patchUpdates(_0x5f2b12){return function(_0x584200){try{jsonpatch[_0x717e('0x22')](_0x584200,_0x5f2b12,!![]);}catch(_0x22aec3){return BPromise[_0x717e('0x23')](_0x22aec3);}return _0x584200['save']();};}function saveUpdates(_0x7bb7c7,_0x2b93dc){return function(_0x57dd83){if(_0x57dd83){return _0x57dd83[_0x717e('0x24')](_0x7bb7c7)[_0x717e('0x25')](function(_0x39828c){return _0x39828c;});}return null;};}function removeEntity(_0x2ff068,_0x4fb86a){return function(_0x3daa7f){if(_0x3daa7f){return _0x3daa7f[_0x717e('0x26')]()[_0x717e('0x25')](function(){_0x2ff068['status'](0xcc)[_0x717e('0x1b')]();});}};}function handleEntityNotFound(_0xd1efc8,_0x4b7f95){return function(_0x526b06){if(!_0x526b06){_0xd1efc8[_0x717e('0x27')](0x194);}return _0x526b06;};}function handleError(_0x5979d1,_0x15b72f){_0x15b72f=_0x15b72f||0x1f4;return function(_0x5979c8){logger[_0x717e('0x28')](_0x5979c8['stack']);if(_0x5979c8[_0x717e('0x29')]){delete _0x5979c8[_0x717e('0x29')];}_0x5979d1[_0x717e('0x1a')](_0x15b72f)[_0x717e('0x2a')](_0x5979c8);};}exports['index']=function(_0x458d41,_0x288368){var _0x550f7b={},_0x1ea40a={},_0x15d8d7={'count':0x0,'rows':[]};var _0x1d690e=_[_0x717e('0x2b')](db[_0x717e('0x2c')]['rawAttributes'],function(_0x4799de){return{'name':_0x4799de[_0x717e('0x2d')],'type':_0x4799de['type'][_0x717e('0x2e')]};});_0x1ea40a[_0x717e('0x2f')]=_['differenceBy'](_['map'](_0x1d690e,_0x717e('0x29')),['name']);_0x1ea40a[_0x717e('0x30')]=_['keys'](_0x458d41['query']);_0x1ea40a['filters']=_[_0x717e('0x31')](_0x1ea40a[_0x717e('0x2f')],_0x1ea40a['query']);_0x550f7b[_0x717e('0x32')]=_['intersection'](_0x1ea40a['model'],qs['fields'](_0x458d41[_0x717e('0x30')][_0x717e('0x33')]));_0x550f7b['attributes']=_0x550f7b[_0x717e('0x32')][_0x717e('0x34')]?_0x550f7b[_0x717e('0x32')]:_0x1ea40a[_0x717e('0x2f')];if(!_0x458d41[_0x717e('0x30')][_0x717e('0x35')](_0x717e('0x36'))){_0x550f7b[_0x717e('0x1f')]=qs[_0x717e('0x1f')](_0x458d41[_0x717e('0x30')][_0x717e('0x1f')]);_0x550f7b[_0x717e('0x1e')]=qs[_0x717e('0x1e')](_0x458d41[_0x717e('0x30')][_0x717e('0x1e')]);}_0x550f7b[_0x717e('0x37')]=qs['sort'](_0x458d41[_0x717e('0x30')]['sort']);_0x550f7b[_0x717e('0x38')]=qs['filters'](_[_0x717e('0x39')](_0x458d41['query'],_0x1ea40a[_0x717e('0x3a')]),_0x1d690e);if(_0x458d41['query'][_0x717e('0x3b')]){_0x550f7b[_0x717e('0x38')]=_[_0x717e('0x3c')](_0x550f7b[_0x717e('0x38')],{'$or':_[_0x717e('0x2b')](_0x1d690e,function(_0x3993a2){if(_0x3993a2[_0x717e('0x3d')]!==_0x717e('0x3e')){var _0xebafc2={};_0xebafc2[_0x3993a2[_0x717e('0x29')]]={'$like':'%'+_0x458d41[_0x717e('0x30')]['filter']+'%'};return _0xebafc2;}})});}_0x550f7b=_['merge']({},_0x550f7b,_0x458d41[_0x717e('0x3f')]);var _0x350df5={'where':_0x550f7b['where']};return db[_0x717e('0x2c')]['count'](_0x350df5)['then'](function(_0x7ff087){_0x15d8d7[_0x717e('0x1d')]=_0x7ff087;if(_0x458d41[_0x717e('0x30')][_0x717e('0x40')]){_0x550f7b[_0x717e('0x41')]=[{'all':!![]}];}return db['CmCustomField'][_0x717e('0x42')](_0x550f7b);})[_0x717e('0x25')](function(_0x487466){_0x15d8d7[_0x717e('0x43')]=_0x487466;return _0x15d8d7;})[_0x717e('0x25')](respondWithFilteredResult(_0x288368,_0x550f7b))[_0x717e('0x44')](handleError(_0x288368,null));};exports[_0x717e('0x45')]=function(_0x2df8f9,_0x40ae7e){var _0x285867={'raw':!![],'where':{'id':_0x2df8f9[_0x717e('0x46')]['id']}},_0x5e5fdb={};_0x5e5fdb['model']=_[_0x717e('0x47')](db['CmCustomField'][_0x717e('0x48')]);_0x5e5fdb[_0x717e('0x30')]=_[_0x717e('0x47')](_0x2df8f9[_0x717e('0x30')]);_0x5e5fdb[_0x717e('0x3a')]=_['intersection'](_0x5e5fdb[_0x717e('0x2f')],_0x5e5fdb[_0x717e('0x30')]);_0x285867[_0x717e('0x32')]=_['intersection'](_0x5e5fdb[_0x717e('0x2f')],qs[_0x717e('0x33')](_0x2df8f9[_0x717e('0x30')][_0x717e('0x33')]));_0x285867[_0x717e('0x32')]=_0x285867[_0x717e('0x32')][_0x717e('0x34')]?_0x285867[_0x717e('0x32')]:_0x5e5fdb[_0x717e('0x2f')];if(_0x2df8f9[_0x717e('0x30')][_0x717e('0x40')]){_0x285867[_0x717e('0x41')]=[{'all':!![]}];}_0x285867=_[_0x717e('0x3c')]({},_0x285867,_0x2df8f9[_0x717e('0x3f')]);return db[_0x717e('0x2c')]['find'](_0x285867)[_0x717e('0x25')](handleEntityNotFound(_0x40ae7e,null))[_0x717e('0x25')](respondWithResult(_0x40ae7e,null))[_0x717e('0x44')](handleError(_0x40ae7e,null));};exports['update']=function(_0x20245a,_0x1a8c0e){if(_0x20245a[_0x717e('0x49')]['id']){delete _0x20245a[_0x717e('0x49')]['id'];}return db[_0x717e('0x2c')][_0x717e('0x4a')]({'where':{'id':_0x20245a[_0x717e('0x46')]['id']}})[_0x717e('0x25')](handleEntityNotFound(_0x1a8c0e,null))[_0x717e('0x25')](saveUpdates(_0x20245a['body'],null))[_0x717e('0x25')](respondWithResult(_0x1a8c0e,null))[_0x717e('0x44')](handleError(_0x1a8c0e,null));};exports[_0x717e('0x26')]=function(_0x48d451,_0x1e6ef8){return db['CmCustomField'][_0x717e('0x4a')]({'where':{'id':_0x48d451[_0x717e('0x46')]['id']}})[_0x717e('0x25')](handleEntityNotFound(_0x1e6ef8,null))[_0x717e('0x25')](removeEntity(_0x1e6ef8,null))['catch'](handleError(_0x1e6ef8,null));};exports[_0x717e('0x4b')]=function(_0x49c5da,_0x369343){var _0x2c1904;return db[_0x717e('0x4c')][_0x717e('0x4d')](function(_0x484b0c){return db['CmCustomField']['create'](_0x49c5da[_0x717e('0x49')],{'transaction':_0x484b0c})[_0x717e('0x25')](function(_0x32d61e){_0x2c1904=_0x32d61e;var _0xd74a93={'type':db['Sequelize'][_0x717e('0x4e')],'transaction':_0x484b0c};switch(_0x49c5da[_0x717e('0x49')][_0x717e('0x3d')]){case _0x717e('0x4f'):_0xd74a93[_0x717e('0x3d')]=db['Sequelize']['TEXT'];break;case _0x717e('0x50'):_0xd74a93[_0x717e('0x3d')]=db[_0x717e('0x51')][_0x717e('0x52')];break;case'switch':_0xd74a93[_0x717e('0x3d')]=db[_0x717e('0x51')][_0x717e('0x53')];_0xd74a93['defaultValue']=![];break;default:}return db[_0x717e('0x4c')][_0x717e('0x54')][_0x717e('0x55')](_0x717e('0x56'),util[_0x717e('0x57')](_0x717e('0x58'),_0x2c1904['id']),_0xd74a93);})[_0x717e('0x25')](function(){return _0x2c1904;});})[_0x717e('0x25')](respondWithResult(_0x369343,0xc9))[_0x717e('0x44')](handleError(_0x369343,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 60bfe78..3f3ab20 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 _0x02cf=['path','rimraf','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x02cf,0x167));var _0xf02c=function(_0x5a84dc,_0x9ab5af){_0x5a84dc=_0x5a84dc-0x0;var _0x5bdfcc=_0x02cf[_0x5a84dc];return _0x5bdfcc;};'use strict';var _=require(_0xf02c('0x0'));var util=require(_0xf02c('0x1'));var logger=require(_0xf02c('0x2'))('api');var moment=require('moment');var BPromise=require(_0xf02c('0x3'));var rp=require(_0xf02c('0x4'));var fs=require('fs');var path=require(_0xf02c('0x5'));var rimraf=require(_0xf02c('0x6'));var config=require(_0xf02c('0x7'));var attributes=require(_0xf02c('0x8'));module[_0xf02c('0x9')]=function(_0x49980c,_0x227037){return _0x49980c[_0xf02c('0xa')](_0xf02c('0xb'),attributes,{'tableName':_0xf02c('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x008a=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','define'];(function(_0x3d8340,_0x35b64d){var _0x29c5f3=function(_0x3772d9){while(--_0x3772d9){_0x3d8340['push'](_0x3d8340['shift']());}};_0x29c5f3(++_0x35b64d);}(_0x008a,0x168));var _0xa008=function(_0x477d48,_0x1fc1d4){_0x477d48=_0x477d48-0x0;var _0x308d64=_0x008a[_0x477d48];return _0x308d64;};'use strict';var _=require('lodash');var util=require(_0xa008('0x0'));var logger=require(_0xa008('0x1'))(_0xa008('0x2'));var moment=require(_0xa008('0x3'));var BPromise=require(_0xa008('0x4'));var rp=require(_0xa008('0x5'));var fs=require('fs');var path=require(_0xa008('0x6'));var rimraf=require(_0xa008('0x7'));var config=require(_0xa008('0x8'));var attributes=require(_0xa008('0x9'));module[_0xa008('0xa')]=function(_0x3656a9,_0x172e0f){return _0x3656a9[_0xa008('0xb')]('CmCustomField',attributes,{'tableName':'cm_custom_fields','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 75b214c..dd6ec86 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 _0x40a6=['CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x50368e,_0x466c09){var _0x4a65cd=function(_0x579309){while(--_0x579309){_0x50368e['push'](_0x50368e['shift']());}};_0x4a65cd(++_0x466c09);}(_0x40a6,0x193));var _0x640a=function(_0x346abc,_0x103ed6){_0x346abc=_0x346abc-0x0;var _0x1a103c=_0x40a6[_0x346abc];return _0x1a103c;};'use strict';var _=require(_0x640a('0x0'));var util=require(_0x640a('0x1'));var moment=require(_0x640a('0x2'));var BPromise=require(_0x640a('0x3'));var rs=require(_0x640a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x640a('0x5'))['db'];var utils=require(_0x640a('0x6'));var logger=require(_0x640a('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x640a('0x8'));var client=jayson[_0x640a('0x9')][_0x640a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28e201,_0x218e20,_0x3a8a21){return new BPromise(function(_0x54eae1,_0x490b1e){return client['request'](_0x28e201,_0x3a8a21)['then'](function(_0x7e5fa8){logger[_0x640a('0xb')](_0x640a('0xc'),_0x218e20,_0x640a('0xd'));logger[_0x640a('0xe')](_0x640a('0xf'),_0x218e20,_0x640a('0xd'),JSON[_0x640a('0x10')](_0x7e5fa8));if(_0x7e5fa8[_0x640a('0x11')]){if(_0x7e5fa8[_0x640a('0x11')][_0x640a('0x12')]===0x1f4){logger[_0x640a('0x11')](_0x640a('0xc'),_0x218e20,_0x7e5fa8[_0x640a('0x11')][_0x640a('0x13')]);return _0x490b1e(_0x7e5fa8[_0x640a('0x11')][_0x640a('0x13')]);}logger[_0x640a('0x11')](_0x640a('0xc'),_0x218e20,_0x7e5fa8[_0x640a('0x11')][_0x640a('0x13')]);return _0x54eae1(_0x7e5fa8[_0x640a('0x11')][_0x640a('0x13')]);}else{logger[_0x640a('0xb')]('CmCustomField,\x20%s,\x20%s',_0x218e20,_0x640a('0xd'));_0x54eae1(_0x7e5fa8[_0x640a('0x14')]['message']);}})[_0x640a('0x15')](function(_0x2e2d8e){logger['error'](_0x640a('0xc'),_0x218e20,_0x2e2d8e);_0x490b1e(_0x2e2d8e);});});} \ No newline at end of file +var _0x404b=['result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x427a19,_0x279b6b){var _0x410afc=function(_0x5dfc98){while(--_0x5dfc98){_0x427a19['push'](_0x427a19['shift']());}};_0x410afc(++_0x279b6b);}(_0x404b,0x1e4));var _0xb404=function(_0x5bb3dd,_0x29ca48){_0x5bb3dd=_0x5bb3dd-0x0;var _0x31dee0=_0x404b[_0x5bb3dd];return _0x31dee0;};'use strict';var _=require(_0xb404('0x0'));var util=require(_0xb404('0x1'));var moment=require(_0xb404('0x2'));var BPromise=require(_0xb404('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb404('0x4'));var db=require(_0xb404('0x5'))['db'];var utils=require(_0xb404('0x6'));var logger=require(_0xb404('0x7'))('rpc');var config=require(_0xb404('0x8'));var jayson=require(_0xb404('0x9'));var client=jayson['client'][_0xb404('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x593e67,_0x1bf5c0,_0x3b44b9){return new BPromise(function(_0x50d60b,_0x18ffa7){return client[_0xb404('0xb')](_0x593e67,_0x3b44b9)[_0xb404('0xc')](function(_0x11f778){logger[_0xb404('0xd')](_0xb404('0xe'),_0x1bf5c0,_0xb404('0xf'));logger[_0xb404('0x10')](_0xb404('0x11'),_0x1bf5c0,_0xb404('0xf'),JSON[_0xb404('0x12')](_0x11f778));if(_0x11f778[_0xb404('0x13')]){if(_0x11f778['error'][_0xb404('0x14')]===0x1f4){logger[_0xb404('0x13')](_0xb404('0xe'),_0x1bf5c0,_0x11f778[_0xb404('0x13')][_0xb404('0x15')]);return _0x18ffa7(_0x11f778[_0xb404('0x13')][_0xb404('0x15')]);}logger['error'](_0xb404('0xe'),_0x1bf5c0,_0x11f778[_0xb404('0x13')]['message']);return _0x50d60b(_0x11f778['error'][_0xb404('0x15')]);}else{logger[_0xb404('0xd')](_0xb404('0xe'),_0x1bf5c0,'request\x20sent');_0x50d60b(_0x11f778[_0xb404('0x16')][_0xb404('0x15')]);}})['catch'](function(_0x196d53){logger[_0xb404('0x13')](_0xb404('0xe'),_0x1bf5c0,_0x196d53);_0x18ffa7(_0x196d53);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 0b017ab..1309b73 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 _0x8ccc=['connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','/:id','show','post','create','put','update','destroy','exports','multer'];(function(_0xcc7765,_0xb294ff){var _0x2b00b5=function(_0x4fb9e5){while(--_0x4fb9e5){_0xcc7765['push'](_0xcc7765['shift']());}};_0x2b00b5(++_0xb294ff);}(_0x8ccc,0x16f));var _0xc8cc=function(_0x406e22,_0x2922dd){_0x406e22=_0x406e22-0x0;var _0x4edb4a=_0x8ccc[_0x406e22];return _0x4edb4a;};'use strict';var multer=require(_0xc8cc('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc8cc('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc8cc('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xc8cc('0x3'));var config=require(_0xc8cc('0x4'));var controller=require(_0xc8cc('0x5'));router[_0xc8cc('0x6')]('/',auth[_0xc8cc('0x7')](),controller['index']);router['get'](_0xc8cc('0x8'),auth[_0xc8cc('0x7')](),controller[_0xc8cc('0x9')]);router[_0xc8cc('0xa')]('/',auth[_0xc8cc('0x7')](),controller[_0xc8cc('0xb')]);router[_0xc8cc('0xc')](_0xc8cc('0x8'),auth[_0xc8cc('0x7')](),controller[_0xc8cc('0xd')]);router['delete'](_0xc8cc('0x8'),auth['isAuthenticated'](),controller[_0xc8cc('0xe')]);module[_0xc8cc('0xf')]=router; \ No newline at end of file +var _0x29af=['put','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./cmCustomField.controller','index','get','/:id','isAuthenticated','show','post','create'];(function(_0x2f1046,_0x144d9a){var _0x40c8c7=function(_0x2e036c){while(--_0x2e036c){_0x2f1046['push'](_0x2f1046['shift']());}};_0x40c8c7(++_0x144d9a);}(_0x29af,0x134));var _0xf29a=function(_0x872be4,_0x577d9b){_0x872be4=_0x872be4-0x0;var _0x2e4225=_0x29af[_0x872be4];return _0x2e4225;};'use strict';var multer=require(_0xf29a('0x0'));var util=require(_0xf29a('0x1'));var path=require(_0xf29a('0x2'));var timeout=require('connect-timeout');var express=require(_0xf29a('0x3'));var router=express[_0xf29a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf29a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf29a('0x6'));var controller=require(_0xf29a('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xf29a('0x8')]);router[_0xf29a('0x9')](_0xf29a('0xa'),auth[_0xf29a('0xb')](),controller[_0xf29a('0xc')]);router[_0xf29a('0xd')]('/',auth['isAuthenticated'](),controller[_0xf29a('0xe')]);router[_0xf29a('0xf')](_0xf29a('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xf29a('0x10')](_0xf29a('0xa'),auth[_0xf29a('0xb')](),controller[_0xf29a('0x11')]);module[_0xf29a('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 01d1368..df6c57f 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 _0x7708=['moment','sequelize','STRING','INTEGER','BOOLEAN','DATE','UNSIGNED','contactListQueue'];(function(_0x453938,_0x4f634b){var _0x185ee5=function(_0x633b2b){while(--_0x633b2b){_0x453938['push'](_0x453938['shift']());}};_0x185ee5(++_0x4f634b);}(_0x7708,0x188));var _0x8770=function(_0x5e709a,_0x1d7975){_0x5e709a=_0x5e709a-0x0;var _0x57401a=_0x7708[_0x5e709a];return _0x57401a;};'use strict';var moment=require(_0x8770('0x0'));var Sequelize=require(_0x8770('0x1'));module['exports']={'phone':{'type':Sequelize[_0x8770('0x2')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x8770('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x8770('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0x8770('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x8770('0x5')]},'priority':{'type':Sequelize[_0x8770('0x3')](0x2)[_0x8770('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x8770('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x8770('0x3')],'unique':_0x8770('0x7')},'ListId':{'type':Sequelize[_0x8770('0x3')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0x8770('0x3')]},'VoiceQueueId':{'type':Sequelize[_0x8770('0x3')],'unique':_0x8770('0x7')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0x8770('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x8770('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x8770('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x8770('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x8770('0x2')]},'recallmeNotifiedDate':{'type':Sequelize[_0x8770('0x5')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0x4137=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment','sequelize','exports','STRING','BOOLEAN'];(function(_0x326a14,_0x62c959){var _0x40e9f6=function(_0x221348){while(--_0x221348){_0x326a14['push'](_0x326a14['shift']());}};_0x40e9f6(++_0x62c959);}(_0x4137,0xf8));var _0x7413=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x4137[_0x4a9fb1];return _0x348672;};'use strict';var moment=require(_0x7413('0x0'));var Sequelize=require(_0x7413('0x1'));module[_0x7413('0x2')]={'phone':{'type':Sequelize[_0x7413('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x7413('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x7413('0x5')],'defaultValue':moment()[_0x7413('0x6')](_0x7413('0x7'))},'countbusyretry':{'type':Sequelize[_0x7413('0x8')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x7413('0x8')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x7413('0x8')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x7413('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x7413('0x5')]},'priority':{'type':Sequelize[_0x7413('0x8')](0x2)[_0x7413('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x7413('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x7413('0xa')},'ListId':{'type':Sequelize[_0x7413('0x8')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0x7413('0x8')]},'VoiceQueueId':{'type':Sequelize[_0x7413('0x8')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0x7413('0x8')]},'countnosuchnumberretry':{'type':Sequelize[_0x7413('0x8')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x7413('0x8')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x7413('0x8')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x7413('0x8')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x7413('0x3')]},'recallmeNotifiedDate':{'type':Sequelize[_0x7413('0x5')],'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 ecd700f..897ad3b 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 _0xf6e8=['getPreview','getVoiceQueues','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','value','direction','hopperIds','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','isEmpty','priority','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','LOCK','CmCompany','CmList','VoiceQueue','dialActive','getPreviewRecall','outbound','hopperId','UPDATE','Company','List','Queue','YYYY-MM-DD\x20HH:mm:ss','isNumber','getOpenContacts','entity\x20not\x20found','timezones','push','utcOffset','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','update','then','destroy','error','send','index','map','CmHopper','rawAttributes','fieldName','type','model','name','query','filters','intersection','$or','$gt','$gte','$lte','$eq','$not','$between','$notBetween','$in','$notIn','$iLike','$like','$overlap','$contains','$any','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','VoiceQueueId','CampaignId','Campaign','omit','dataValues','createdAt','state','deleted','campaign','user','UserId','format','phone','queue','ivr','CmContact','firstName','lastName','isNil','calleridname','finally','CmHopperFinal'];(function(_0x198ff4,_0x91f888){var _0x2b275f=function(_0x13a627){while(--_0x13a627){_0x198ff4['push'](_0x198ff4['shift']());}};_0x2b275f(++_0x91f888);}(_0xf6e8,0xc1));var _0x8f6e=function(_0x175e7c,_0x23d617){_0x175e7c=_0x175e7c-0x0;var _0x8d2899=_0xf6e8[_0x175e7c];return _0x8d2899;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8f6e('0x0'));var zipdir=require(_0x8f6e('0x1'));var jsonpatch=require(_0x8f6e('0x2'));var rp=require(_0x8f6e('0x3'));var moment=require(_0x8f6e('0x4'));var BPromise=require(_0x8f6e('0x5'));var Mustache=require('mustache');var util=require(_0x8f6e('0x6'));var path=require('path');var sox=require(_0x8f6e('0x7'));var csv=require(_0x8f6e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8f6e('0x9'));var _=require(_0x8f6e('0xa'));var squel=require(_0x8f6e('0xb'));var crypto=require(_0x8f6e('0xc'));var jsforce=require(_0x8f6e('0xd'));var deskjs=require(_0x8f6e('0xe'));var toCsv=require(_0x8f6e('0x8'));var querystring=require(_0x8f6e('0xf'));var Papa=require(_0x8f6e('0x10'));var Redis=require(_0x8f6e('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8f6e('0x12'));var as=require(_0x8f6e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8f6e('0x14'))(_0x8f6e('0x15'));var utils=require(_0x8f6e('0x16'));var config=require(_0x8f6e('0x17'));var shared=require(_0x8f6e('0x17'));var licenseUtil=require(_0x8f6e('0x18'));var db=require(_0x8f6e('0x19'))['db'];function respondWithStatusCode(_0x1f54b9,_0x1decd4){_0x1decd4=_0x1decd4||0xcc;return function(_0x438b82){if(_0x438b82){return _0x1f54b9[_0x8f6e('0x1a')](_0x1decd4);}return _0x1f54b9[_0x8f6e('0x1b')](_0x1decd4)[_0x8f6e('0x1c')]();};}function respondWithResult(_0x558eee,_0x406ea4){_0x406ea4=_0x406ea4||0xc8;return function(_0x3ff4c9){if(_0x3ff4c9){return _0x558eee['status'](_0x406ea4)[_0x8f6e('0x1d')](_0x3ff4c9);}};}function respondWithFilteredResult(_0x294292,_0x1d53e4){return function(_0x4cdf41){if(_0x4cdf41){var _0x5c3d22=typeof _0x1d53e4['offset']===_0x8f6e('0x1e')&&typeof _0x1d53e4[_0x8f6e('0x1f')]===_0x8f6e('0x1e');var _0x28cd17=_0x4cdf41[_0x8f6e('0x20')];var _0x26f9d7=_0x5c3d22?0x0:_0x1d53e4[_0x8f6e('0x21')];var _0x26a69b=_0x5c3d22?_0x4cdf41[_0x8f6e('0x20')]:_0x1d53e4[_0x8f6e('0x21')]+_0x1d53e4[_0x8f6e('0x1f')];var _0x16979c;if(_0x26a69b>=_0x28cd17){_0x26a69b=_0x28cd17;_0x16979c=0xc8;}else{_0x16979c=0xce;}_0x294292[_0x8f6e('0x1b')](_0x16979c);return _0x294292[_0x8f6e('0x22')]('Content-Range',_0x26f9d7+'-'+_0x26a69b+'/'+_0x28cd17)[_0x8f6e('0x1d')](_0x4cdf41);}return null;};}function patchUpdates(_0x332e2b){return function(_0x2c0a04){try{jsonpatch[_0x8f6e('0x23')](_0x2c0a04,_0x332e2b,!![]);}catch(_0x25bd67){return BPromise[_0x8f6e('0x24')](_0x25bd67);}return _0x2c0a04['save']();};}function saveUpdates(_0x50e4a8,_0x14208f){return function(_0x320db7){if(_0x320db7){return _0x320db7[_0x8f6e('0x25')](_0x50e4a8)[_0x8f6e('0x26')](function(_0x46ed85){return _0x46ed85;});}return null;};}function removeEntity(_0x5426ea,_0x4332ec){return function(_0x488a16){if(_0x488a16){return _0x488a16[_0x8f6e('0x27')]()[_0x8f6e('0x26')](function(){_0x5426ea[_0x8f6e('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x556c0c,_0xcbbfbd){return function(_0x39a11a){if(!_0x39a11a){_0x556c0c[_0x8f6e('0x1a')](0x194);}return _0x39a11a;};}function handleError(_0x54f90e,_0x480e53){_0x480e53=_0x480e53||0x1f4;return function(_0x3614b4){logger[_0x8f6e('0x28')](_0x3614b4['stack']);if(_0x3614b4['name']){delete _0x3614b4['name'];}_0x54f90e[_0x8f6e('0x1b')](_0x480e53)[_0x8f6e('0x29')](_0x3614b4);};}exports[_0x8f6e('0x2a')]=function(_0x5da47a,_0x232b93){var _0x5c00fc={},_0x40dae5={},_0x274d28={'count':0x0,'rows':[]};var _0xe43c2c=_[_0x8f6e('0x2b')](db[_0x8f6e('0x2c')][_0x8f6e('0x2d')],function(_0x27883c){return{'name':_0x27883c[_0x8f6e('0x2e')],'type':_0x27883c[_0x8f6e('0x2f')]['key']};});_0x40dae5[_0x8f6e('0x30')]=_[_0x8f6e('0x2b')](_0xe43c2c,_0x8f6e('0x31'));_0x40dae5['query']=_['keys'](_0x5da47a[_0x8f6e('0x32')]);_0x40dae5[_0x8f6e('0x33')]=_[_0x8f6e('0x34')](_0x40dae5[_0x8f6e('0x30')],_0x40dae5['query']);_0x40dae5['filters']=_['concat'](_0x40dae5[_0x8f6e('0x33')],['$and',_0x8f6e('0x35'),_0x8f6e('0x36'),_0x8f6e('0x37'),'$lt',_0x8f6e('0x38'),'$ne',_0x8f6e('0x39'),_0x8f6e('0x3a'),_0x8f6e('0x3b'),_0x8f6e('0x3c'),_0x8f6e('0x3d'),_0x8f6e('0x3e'),'$like','$notLike',_0x8f6e('0x3f'),'$notILike',_0x8f6e('0x40'),_0x8f6e('0x41'),_0x8f6e('0x42'),'$contained',_0x8f6e('0x43')]);_0x5c00fc[_0x8f6e('0x44')]=_['intersection'](_0x40dae5[_0x8f6e('0x30')],qs['fields'](_0x5da47a[_0x8f6e('0x32')][_0x8f6e('0x45')]));_0x5c00fc['attributes']=_0x5c00fc[_0x8f6e('0x44')][_0x8f6e('0x46')]?_0x5c00fc[_0x8f6e('0x44')]:_0x40dae5[_0x8f6e('0x30')];if(!_0x5da47a[_0x8f6e('0x32')][_0x8f6e('0x47')](_0x8f6e('0x48'))){_0x5c00fc[_0x8f6e('0x1f')]=qs[_0x8f6e('0x1f')](_0x5da47a[_0x8f6e('0x32')]['limit']);_0x5c00fc[_0x8f6e('0x21')]=qs[_0x8f6e('0x21')](_0x5da47a['query'][_0x8f6e('0x21')]);}_0x5c00fc['order']=qs[_0x8f6e('0x49')](_0x5da47a['query'][_0x8f6e('0x49')]);_0x5c00fc['where']=qs[_0x8f6e('0x33')](_[_0x8f6e('0x4a')](_0x5da47a[_0x8f6e('0x32')],_0x40dae5[_0x8f6e('0x33')]),_0xe43c2c);if(_0x5da47a[_0x8f6e('0x32')][_0x8f6e('0x4b')]){_0x5c00fc[_0x8f6e('0x4c')]=_[_0x8f6e('0x4d')](_0x5c00fc[_0x8f6e('0x4c')],{'$or':_['map'](_0xe43c2c,function(_0x318972){if(_0x318972[_0x8f6e('0x2f')]!=='VIRTUAL'){var _0x4be234={};_0x4be234[_0x318972[_0x8f6e('0x31')]]={'$like':'%'+_0x5da47a[_0x8f6e('0x32')]['filter']+'%'};return _0x4be234;}})});}_0x5c00fc=_[_0x8f6e('0x4d')]({},_0x5c00fc,_0x5da47a[_0x8f6e('0x4e')]);var _0x47a12f={'where':_0x5c00fc[_0x8f6e('0x4c')]};return db[_0x8f6e('0x2c')][_0x8f6e('0x20')](_0x47a12f)[_0x8f6e('0x26')](function(_0x11cf0d){_0x274d28[_0x8f6e('0x20')]=_0x11cf0d;if(_0x5da47a[_0x8f6e('0x32')][_0x8f6e('0x4f')]){_0x5c00fc[_0x8f6e('0x50')]=[{'all':!![]}];}return db[_0x8f6e('0x2c')][_0x8f6e('0x51')](_0x5c00fc);})[_0x8f6e('0x26')](function(_0x41f06b){_0x274d28[_0x8f6e('0x52')]=_0x41f06b;return _0x274d28;})[_0x8f6e('0x26')](respondWithFilteredResult(_0x232b93,_0x5c00fc))[_0x8f6e('0x53')](handleError(_0x232b93,null));};exports[_0x8f6e('0x54')]=function(_0x502d70,_0x939f21){var _0x1d02a1={'raw':!![],'where':{'id':_0x502d70[_0x8f6e('0x55')]['id']}},_0x87aaa8={};_0x87aaa8[_0x8f6e('0x30')]=_[_0x8f6e('0x56')](db['CmHopper']['rawAttributes']);_0x87aaa8[_0x8f6e('0x32')]=_[_0x8f6e('0x56')](_0x502d70[_0x8f6e('0x32')]);_0x87aaa8[_0x8f6e('0x33')]=_['intersection'](_0x87aaa8[_0x8f6e('0x30')],_0x87aaa8[_0x8f6e('0x32')]);_0x1d02a1[_0x8f6e('0x44')]=_['intersection'](_0x87aaa8[_0x8f6e('0x30')],qs[_0x8f6e('0x45')](_0x502d70[_0x8f6e('0x32')]['fields']));_0x1d02a1[_0x8f6e('0x44')]=_0x1d02a1[_0x8f6e('0x44')]['length']?_0x1d02a1[_0x8f6e('0x44')]:_0x87aaa8['model'];if(_0x502d70['query'][_0x8f6e('0x4f')]){_0x1d02a1[_0x8f6e('0x50')]=[{'all':!![]}];}_0x1d02a1=_[_0x8f6e('0x4d')]({},_0x1d02a1,_0x502d70[_0x8f6e('0x4e')]);return db[_0x8f6e('0x2c')][_0x8f6e('0x57')](_0x1d02a1)[_0x8f6e('0x26')](handleEntityNotFound(_0x939f21,null))[_0x8f6e('0x26')](respondWithResult(_0x939f21,null))['catch'](handleError(_0x939f21,null));};exports[_0x8f6e('0x58')]=function(_0x664c71,_0x3ffe4d){return db[_0x8f6e('0x2c')]['create'](_0x664c71[_0x8f6e('0x59')],{})[_0x8f6e('0x26')](respondWithResult(_0x3ffe4d,0xc9))[_0x8f6e('0x53')](handleError(_0x3ffe4d,null));};exports[_0x8f6e('0x25')]=function(_0xf580ec,_0x30a740){if(_0xf580ec[_0x8f6e('0x59')]['id']){delete _0xf580ec[_0x8f6e('0x59')]['id'];}return db[_0x8f6e('0x2c')][_0x8f6e('0x57')]({'where':{'id':_0xf580ec['params']['id']}})[_0x8f6e('0x26')](handleEntityNotFound(_0x30a740,null))[_0x8f6e('0x26')](saveUpdates(_0xf580ec[_0x8f6e('0x59')],null))['then'](respondWithResult(_0x30a740,null))[_0x8f6e('0x53')](handleError(_0x30a740,null));};exports[_0x8f6e('0x5a')]=function(_0x372bfa,_0x568f9f){return db[_0x8f6e('0x2c')][_0x8f6e('0x5a')]()[_0x8f6e('0x26')](respondWithResult(_0x568f9f,null))[_0x8f6e('0x53')](handleError(_0x568f9f,null));};exports[_0x8f6e('0x27')]=function(_0x54b01b,_0x5e62c6){var _0xf76bcf;return db[_0x8f6e('0x2c')][_0x8f6e('0x57')]({'where':{'id':_0x54b01b['params']['id']}})[_0x8f6e('0x26')](handleEntityNotFound(_0x5e62c6,null))[_0x8f6e('0x26')](function(_0x53aeed){if(_0x53aeed){return _0x53aeed[_0x8f6e('0x27')]()['then'](function(_0x282817){return _0x282817;});}})['then'](function(_0x501343){_0xf76bcf=_0x501343;if(_0x501343){if(_0x501343[_0x8f6e('0x5b')]||_0x501343[_0x8f6e('0x5c')]){return db[_0x501343['VoiceQueueId']?'VoiceQueue':_0x8f6e('0x5d')][_0x8f6e('0x57')]({'where':{'id':_0x501343[_0x8f6e('0x5b')]?_0x501343[_0x8f6e('0x5b')]:_0x501343[_0x8f6e('0x5c')]},'attributes':['id','name'],'raw':!![]});}}})['then'](function(_0x2b3b02){var _0x19be0f={};if(_0x2b3b02){_['merge'](_0x19be0f,_[_0x8f6e('0x5e')](_0xf76bcf[_0x8f6e('0x5f')],[_0x8f6e('0x60'),'updatedAt','id']));_0x19be0f[_0x8f6e('0x61')]=0x15;_0x19be0f['statedesc']=_0x8f6e('0x62');_0x19be0f[_0x8f6e('0x63')]=_0x2b3b02[_0x8f6e('0x31')];_0x19be0f['membername']=_0x54b01b[_0x8f6e('0x64')][_0x8f6e('0x31')];_0x19be0f[_0x8f6e('0x65')]=_0x54b01b[_0x8f6e('0x64')]['id'];_0x19be0f['deleted']=!![];_0x19be0f['deletedat']=moment()[_0x8f6e('0x66')]('YYYY-MM-DD\x20HH:mm:ss');_0x19be0f['calleridnum']=_0xf76bcf[_0x8f6e('0x67')];_0x19be0f['campaigntype']=_0xf76bcf[_0x8f6e('0x5b')]?_0x8f6e('0x68'):_0x8f6e('0x69');return db[_0x8f6e('0x6a')][_0x8f6e('0x57')]({'where':{'id':_0x19be0f['ContactId']},'attributes':[_0x8f6e('0x6b'),_0x8f6e('0x6c')]})[_0x8f6e('0x26')](function(_0x2e792b){if(!_['isNil'](_0x5e62c6)&&!_[_0x8f6e('0x6d')](_0x2e792b['firstName'])){_0x19be0f[_0x8f6e('0x6e')]=_0x2e792b[_0x8f6e('0x6b')];if(!_[_0x8f6e('0x6d')](_0x2e792b[_0x8f6e('0x6c')])){_0x19be0f['calleridname']+='\x20'+_0x2e792b[_0x8f6e('0x6c')];}}})[_0x8f6e('0x6f')](function(){return db[_0x8f6e('0x70')]['create'](_0x19be0f);});}})[_0x8f6e('0x26')](function(){return _0x5e62c6[_0x8f6e('0x1b')](0xcc)['end']();})[_0x8f6e('0x53')](handleError(_0x5e62c6,null));};exports[_0x8f6e('0x71')]=function(_0x1ebf8d,_0x17bc22,_0x2b6302){var _0x8bf0ad=[];return db[_0x8f6e('0x6a')][_0x8f6e('0x5a')]()[_0x8f6e('0x26')](function(_0x250404){_0x8bf0ad=_[_0x8f6e('0x56')](_0x250404);return _0x1ebf8d[_0x8f6e('0x64')][_0x8f6e('0x72')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x8f6e('0x73')},'attributes':['id',_0x8f6e('0x74'),_0x8f6e('0x75')],'raw':!![]});})[_0x8f6e('0x26')](function(_0x347ff9){if(_0x347ff9&&_0x347ff9[_0x8f6e('0x46')]){return db[_0x8f6e('0x76')][_0x8f6e('0x77')](function(_0xffeefa){var _0x5487c7={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x8f6e('0x66')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x8f6e('0x2b')](_0x347ff9,'id')},'$or':[{'UserId':null},{'UserId':_0x1ebf8d[_0x8f6e('0x64')]['id']}]};var _0x51255a={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x347ff9)[_0x8f6e('0x4b')]([_0x8f6e('0x75'),0x0])[_0x8f6e('0x2b')]('id')[_0x8f6e('0x78')]()},'$or':[{'UserId':null},{'UserId':_0x1ebf8d[_0x8f6e('0x64')]['id']}]};var _0x131295={'$or':[_0x5487c7,_0x51255a]};var _0x4bbe13=[];if(_0x1ebf8d[_0x8f6e('0x59')]['direction']&&_0x1ebf8d['body'][_0x8f6e('0x79')]==='prev'){if(!_['isEmpty'](_0x1ebf8d['body'][_0x8f6e('0x7a')])){_0x131295['id']={'$in':_0x1ebf8d[_0x8f6e('0x59')][_0x8f6e('0x7a')]};}_0x4bbe13=[['priority',_0x8f6e('0x7b')],[_0x8f6e('0x7c'),_0x347ff9[0x0]['dialOrderByScheduledAt']==='ASC'?_0x8f6e('0x7d'):'ASC'],db['sequelize'][_0x8f6e('0x7e')](_0x8f6e('0x7f')),['id',_0x8f6e('0x7d')]];}else{if(!_[_0x8f6e('0x80')](_0x1ebf8d[_0x8f6e('0x59')]['hopperIds'])){_0x131295['id']={'$notIn':_0x1ebf8d['body'][_0x8f6e('0x7a')]};}_0x4bbe13=[[_0x8f6e('0x81'),_0x8f6e('0x7d')],[_0x8f6e('0x7c'),_0x347ff9[0x0][_0x8f6e('0x74')]],db[_0x8f6e('0x76')][_0x8f6e('0x7e')](_0x8f6e('0x82')),['id',_0x8f6e('0x7b')]];}return db[_0x8f6e('0x2c')][_0x8f6e('0x83')]({'attributes':['id',_0x8f6e('0x84'),_0x8f6e('0x85')],'where':_0x131295,'order':_0x4bbe13,'transaction':_0xffeefa,'lock':_0xffeefa[_0x8f6e('0x86')]['UPDATE'],'include':[{'model':db[_0x8f6e('0x6a')],'as':'Contact','attributes':_0x8bf0ad,'include':[{'model':db[_0x8f6e('0x87')],'as':'Company','attributes':['id',_0x8f6e('0x31')]}]},{'model':db[_0x8f6e('0x88')],'as':'List','attributes':['id',_0x8f6e('0x31')]},{'model':db[_0x8f6e('0x89')],'as':'Queue','attributes':['id',_0x8f6e('0x31'),_0x8f6e('0x8a')]}]})['then'](function(_0x1c227e){if(_0x1c227e){return _0x1c227e[_0x8f6e('0x25')]({'UserId':_0x1ebf8d[_0x8f6e('0x64')]['id']},{'transaction':_0xffeefa});}});});}})['then'](handleEntityNotFound(_0x17bc22,null))['then'](respondWithResult(_0x17bc22,null))['catch'](handleError(_0x17bc22,null));};exports[_0x8f6e('0x8b')]=function(_0x381b32,_0x553259,_0x5627df){var _0x4b7fcf=[];return db[_0x8f6e('0x6a')]['describe']()[_0x8f6e('0x26')](function(_0x2e8ce0){_0x4b7fcf=_[_0x8f6e('0x56')](_0x2e8ce0);return _0x381b32['user'][_0x8f6e('0x72')]({'where':{'type':_0x8f6e('0x8c'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x8f6e('0x74'),'dialPreviewAutoRecallMe'],'raw':!![]});})['then'](function(_0x24ca09){if(_0x24ca09&&_0x24ca09[_0x8f6e('0x46')]){return db['sequelize']['transaction'](function(_0x22373d){var _0x187a22={'active':![],'recallme':!![],'id':_0x381b32[_0x8f6e('0x59')][_0x8f6e('0x8d')]};return db['CmHopper'][_0x8f6e('0x83')]({'attributes':['id',_0x8f6e('0x84'),_0x8f6e('0x85')],'where':_0x187a22,'transaction':_0x22373d,'lock':_0x22373d['LOCK'][_0x8f6e('0x8e')],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_0x4b7fcf,'include':[{'model':db[_0x8f6e('0x87')],'as':_0x8f6e('0x8f'),'attributes':['id',_0x8f6e('0x31')]}]},{'model':db[_0x8f6e('0x88')],'as':_0x8f6e('0x90'),'attributes':['id',_0x8f6e('0x31')]},{'model':db[_0x8f6e('0x89')],'as':_0x8f6e('0x91'),'attributes':['id','name',_0x8f6e('0x8a')]}]})[_0x8f6e('0x26')](function(_0x1667e0){if(_0x1667e0){return _0x1667e0[_0x8f6e('0x25')]({'UserId':_0x381b32[_0x8f6e('0x64')]['id']},{'transaction':_0x22373d});}});});}})['then'](handleEntityNotFound(_0x553259,null))[_0x8f6e('0x26')](respondWithResult(_0x553259,null))[_0x8f6e('0x53')](handleError(_0x553259,null));};exports['getOpenContacts']=function(_0x2358a8,_0x17dddb,_0x4885cd){return _0x2358a8[_0x8f6e('0x64')][_0x8f6e('0x72')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})['then'](function(_0x36a6c9){if(_0x36a6c9&&_0x36a6c9[_0x8f6e('0x46')]){return db['CmHopper']['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x8f6e('0x66')](_0x8f6e('0x92'))},'VoiceQueueId':{'$in':_['map'](_0x36a6c9,'id')},'$or':[{'UserId':null},{'UserId':_0x2358a8[_0x8f6e('0x64')]['id']}]}});}return 0x0;})['then'](function(_0x278fa8){if(!_[_0x8f6e('0x6d')](_0x278fa8)&&_[_0x8f6e('0x93')](_0x278fa8)){return _0x17dddb[_0x8f6e('0x1b')](0xc8)[_0x8f6e('0x1d')]({'contacts':_0x278fa8});}else{logger[_0x8f6e('0x28')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x8f6e('0x94'),0x194,_0x8f6e('0x95'));_0x17dddb[_0x8f6e('0x1a')](0x194);}})[_0x8f6e('0x53')](handleError(_0x17dddb,null));};exports['getTimezones']=function(_0x5e15b1,_0x48bbd,_0x5dc492){var _0x2db3df=shared[_0x8f6e('0x96')];var _0x521ac3=[];_[_0x8f6e('0x2b')](_0x2db3df,function(_0x433294){_0x521ac3[_0x8f6e('0x97')]({'id':_0x433294[_0x8f6e('0x31')],'name':_0x433294[_0x8f6e('0x31')],'utcOffset':_0x433294[_0x8f6e('0x98')]});});return _0x48bbd[_0x8f6e('0x1b')](0xc8)[_0x8f6e('0x1d')]({'tz':_0x521ac3});};exports['getTimezone']=function(_0x5595d9,_0x1be865,_0x47a788){var _0x220dc9=shared[_0x8f6e('0x96')];var _0x2d4ee1={};if(!_['isNil'](_0x220dc9[_0x5595d9[_0x8f6e('0x59')]['id']]))_0x2d4ee1=_0x220dc9[_0x5595d9[_0x8f6e('0x59')]['id']];return _0x1be865[_0x8f6e('0x1b')](0xc8)['json'](_0x2d4ee1);}; \ No newline at end of file +var _0xd20e=['getVoiceQueues','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','value','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','findOne','scheduledat','recallme','LOCK','UPDATE','Contact','CmCompany','Queue','getPreviewRecall','outbound','hopperId','CmList','List','dialActive','getOpenContacts','isNumber','json','CmHopper,\x20%s,\x20%s,\x20%s','utcOffset','getTimezone','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','set','Content-Range','save','sendStatus','error','name','send','map','CmHopper','rawAttributes','fieldName','key','model','keys','query','filters','intersection','concat','$and','$or','$gt','$gte','$lt','$lte','$eq','$not','$between','$in','$notIn','$like','$overlap','$contains','$contained','$any','attributes','fields','length','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','include','findAll','then','rows','catch','params','includeAll','find','create','update','body','describe','destroy','CampaignId','VoiceQueueId','VoiceQueue','Campaign','omit','dataValues','updatedAt','campaign','membername','UserId','user','deleted','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','campaigntype','queue','ivr','CmContact','ContactId','firstName','isNil','calleridname','CmHopperFinal'];(function(_0x4503df,_0xfec122){var _0x3f1b2b=function(_0x32b1de){while(--_0x32b1de){_0x4503df['push'](_0x4503df['shift']());}};_0x3f1b2b(++_0xfec122);}(_0xd20e,0xbb));var _0xed20=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xd20e[_0x36c5b0];return _0xf19333;};'use strict';var emlformat=require(_0xed20('0x0'));var rimraf=require(_0xed20('0x1'));var zipdir=require(_0xed20('0x2'));var jsonpatch=require(_0xed20('0x3'));var rp=require('request-promise');var moment=require(_0xed20('0x4'));var BPromise=require(_0xed20('0x5'));var Mustache=require('mustache');var util=require(_0xed20('0x6'));var path=require(_0xed20('0x7'));var sox=require('sox');var csv=require(_0xed20('0x8'));var ejs=require(_0xed20('0x9'));var fs=require('fs');var fs_extra=require(_0xed20('0xa'));var _=require('lodash');var squel=require(_0xed20('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xed20('0xc'));var toCsv=require(_0xed20('0x8'));var querystring=require(_0xed20('0xd'));var Papa=require('papaparse');var Redis=require(_0xed20('0xe'));var authService=require(_0xed20('0xf'));var qs=require(_0xed20('0x10'));var as=require(_0xed20('0x11'));var hardwareService=require(_0xed20('0x12'));var logger=require('../../config/logger')(_0xed20('0x13'));var utils=require('../../config/utils');var config=require(_0xed20('0x14'));var shared=require(_0xed20('0x14'));var licenseUtil=require(_0xed20('0x15'));var db=require(_0xed20('0x16'))['db'];function respondWithStatusCode(_0x366f1a,_0x2a2c80){_0x2a2c80=_0x2a2c80||0xcc;return function(_0x9063da){if(_0x9063da){return _0x366f1a['sendStatus'](_0x2a2c80);}return _0x366f1a[_0xed20('0x17')](_0x2a2c80)[_0xed20('0x18')]();};}function respondWithResult(_0x116057,_0x112767){_0x112767=_0x112767||0xc8;return function(_0x483275){if(_0x483275){return _0x116057['status'](_0x112767)['json'](_0x483275);}};}function respondWithFilteredResult(_0x1eb1bc,_0x263982){return function(_0x240beb){if(_0x240beb){var _0x2f60a0=typeof _0x263982[_0xed20('0x19')]==='undefined'&&typeof _0x263982[_0xed20('0x1a')]===_0xed20('0x1b');var _0x567673=_0x240beb['count'];var _0xd168a7=_0x2f60a0?0x0:_0x263982[_0xed20('0x19')];var _0x4c4232=_0x2f60a0?_0x240beb[_0xed20('0x1c')]:_0x263982[_0xed20('0x19')]+_0x263982[_0xed20('0x1a')];var _0x362bcb;if(_0x4c4232>=_0x567673){_0x4c4232=_0x567673;_0x362bcb=0xc8;}else{_0x362bcb=0xce;}_0x1eb1bc[_0xed20('0x17')](_0x362bcb);return _0x1eb1bc[_0xed20('0x1d')](_0xed20('0x1e'),_0xd168a7+'-'+_0x4c4232+'/'+_0x567673)['json'](_0x240beb);}return null;};}function patchUpdates(_0x490fc8){return function(_0x55a233){try{jsonpatch['apply'](_0x55a233,_0x490fc8,!![]);}catch(_0xbb9276){return BPromise['reject'](_0xbb9276);}return _0x55a233[_0xed20('0x1f')]();};}function saveUpdates(_0xe1aee4,_0x3cf063){return function(_0x5c360b){if(_0x5c360b){return _0x5c360b['update'](_0xe1aee4)['then'](function(_0x1dc592){return _0x1dc592;});}return null;};}function removeEntity(_0x178de2,_0x228af3){return function(_0x2d7e4b){if(_0x2d7e4b){return _0x2d7e4b['destroy']()['then'](function(){_0x178de2[_0xed20('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x490a0c,_0x147383){return function(_0x344d02){if(!_0x344d02){_0x490a0c[_0xed20('0x20')](0x194);}return _0x344d02;};}function handleError(_0x1fe37f,_0x40d850){_0x40d850=_0x40d850||0x1f4;return function(_0x457d3b){logger[_0xed20('0x21')](_0x457d3b['stack']);if(_0x457d3b['name']){delete _0x457d3b[_0xed20('0x22')];}_0x1fe37f[_0xed20('0x17')](_0x40d850)[_0xed20('0x23')](_0x457d3b);};}exports['index']=function(_0x49047b,_0x3f6d79){var _0x183fa3={},_0xef8314={},_0x1179ea={'count':0x0,'rows':[]};var _0x51f9f4=_[_0xed20('0x24')](db[_0xed20('0x25')][_0xed20('0x26')],function(_0x35c760){return{'name':_0x35c760[_0xed20('0x27')],'type':_0x35c760['type'][_0xed20('0x28')]};});_0xef8314[_0xed20('0x29')]=_[_0xed20('0x24')](_0x51f9f4,_0xed20('0x22'));_0xef8314['query']=_[_0xed20('0x2a')](_0x49047b[_0xed20('0x2b')]);_0xef8314[_0xed20('0x2c')]=_[_0xed20('0x2d')](_0xef8314[_0xed20('0x29')],_0xef8314['query']);_0xef8314[_0xed20('0x2c')]=_[_0xed20('0x2e')](_0xef8314[_0xed20('0x2c')],[_0xed20('0x2f'),_0xed20('0x30'),_0xed20('0x31'),_0xed20('0x32'),_0xed20('0x33'),_0xed20('0x34'),'$ne',_0xed20('0x35'),_0xed20('0x36'),_0xed20('0x37'),'$notBetween',_0xed20('0x38'),_0xed20('0x39'),_0xed20('0x3a'),'$notLike','$iLike','$notILike',_0xed20('0x3a'),_0xed20('0x3b'),_0xed20('0x3c'),_0xed20('0x3d'),_0xed20('0x3e')]);_0x183fa3[_0xed20('0x3f')]=_[_0xed20('0x2d')](_0xef8314[_0xed20('0x29')],qs['fields'](_0x49047b[_0xed20('0x2b')][_0xed20('0x40')]));_0x183fa3[_0xed20('0x3f')]=_0x183fa3[_0xed20('0x3f')][_0xed20('0x41')]?_0x183fa3['attributes']:_0xef8314[_0xed20('0x29')];if(!_0x49047b[_0xed20('0x2b')]['hasOwnProperty'](_0xed20('0x42'))){_0x183fa3['limit']=qs[_0xed20('0x1a')](_0x49047b[_0xed20('0x2b')][_0xed20('0x1a')]);_0x183fa3[_0xed20('0x19')]=qs[_0xed20('0x19')](_0x49047b[_0xed20('0x2b')][_0xed20('0x19')]);}_0x183fa3[_0xed20('0x43')]=qs[_0xed20('0x44')](_0x49047b[_0xed20('0x2b')]['sort']);_0x183fa3[_0xed20('0x45')]=qs[_0xed20('0x2c')](_[_0xed20('0x46')](_0x49047b[_0xed20('0x2b')],_0xef8314[_0xed20('0x2c')]),_0x51f9f4);if(_0x49047b[_0xed20('0x2b')][_0xed20('0x47')]){_0x183fa3[_0xed20('0x45')]=_['merge'](_0x183fa3['where'],{'$or':_['map'](_0x51f9f4,function(_0x99695b){if(_0x99695b[_0xed20('0x48')]!==_0xed20('0x49')){var _0x4c226d={};_0x4c226d[_0x99695b[_0xed20('0x22')]]={'$like':'%'+_0x49047b[_0xed20('0x2b')]['filter']+'%'};return _0x4c226d;}})});}_0x183fa3=_[_0xed20('0x4a')]({},_0x183fa3,_0x49047b[_0xed20('0x4b')]);var _0x541a38={'where':_0x183fa3[_0xed20('0x45')]};return db[_0xed20('0x25')][_0xed20('0x1c')](_0x541a38)['then'](function(_0x549327){_0x1179ea['count']=_0x549327;if(_0x49047b[_0xed20('0x2b')]['includeAll']){_0x183fa3[_0xed20('0x4c')]=[{'all':!![]}];}return db[_0xed20('0x25')][_0xed20('0x4d')](_0x183fa3);})[_0xed20('0x4e')](function(_0x6881e4){_0x1179ea[_0xed20('0x4f')]=_0x6881e4;return _0x1179ea;})[_0xed20('0x4e')](respondWithFilteredResult(_0x3f6d79,_0x183fa3))[_0xed20('0x50')](handleError(_0x3f6d79,null));};exports['show']=function(_0x41c690,_0x477b3f){var _0x50b0bc={'raw':!![],'where':{'id':_0x41c690[_0xed20('0x51')]['id']}},_0x29e6f3={};_0x29e6f3[_0xed20('0x29')]=_[_0xed20('0x2a')](db[_0xed20('0x25')][_0xed20('0x26')]);_0x29e6f3[_0xed20('0x2b')]=_[_0xed20('0x2a')](_0x41c690[_0xed20('0x2b')]);_0x29e6f3[_0xed20('0x2c')]=_[_0xed20('0x2d')](_0x29e6f3[_0xed20('0x29')],_0x29e6f3[_0xed20('0x2b')]);_0x50b0bc['attributes']=_[_0xed20('0x2d')](_0x29e6f3[_0xed20('0x29')],qs['fields'](_0x41c690[_0xed20('0x2b')][_0xed20('0x40')]));_0x50b0bc[_0xed20('0x3f')]=_0x50b0bc[_0xed20('0x3f')]['length']?_0x50b0bc['attributes']:_0x29e6f3[_0xed20('0x29')];if(_0x41c690['query'][_0xed20('0x52')]){_0x50b0bc['include']=[{'all':!![]}];}_0x50b0bc=_[_0xed20('0x4a')]({},_0x50b0bc,_0x41c690[_0xed20('0x4b')]);return db[_0xed20('0x25')][_0xed20('0x53')](_0x50b0bc)[_0xed20('0x4e')](handleEntityNotFound(_0x477b3f,null))[_0xed20('0x4e')](respondWithResult(_0x477b3f,null))[_0xed20('0x50')](handleError(_0x477b3f,null));};exports[_0xed20('0x54')]=function(_0x57aed1,_0x16f854){return db[_0xed20('0x25')][_0xed20('0x54')](_0x57aed1['body'],{})[_0xed20('0x4e')](respondWithResult(_0x16f854,0xc9))[_0xed20('0x50')](handleError(_0x16f854,null));};exports[_0xed20('0x55')]=function(_0x2a93ff,_0xa7d1d6){if(_0x2a93ff[_0xed20('0x56')]['id']){delete _0x2a93ff['body']['id'];}return db['CmHopper']['find']({'where':{'id':_0x2a93ff['params']['id']}})['then'](handleEntityNotFound(_0xa7d1d6,null))[_0xed20('0x4e')](saveUpdates(_0x2a93ff[_0xed20('0x56')],null))[_0xed20('0x4e')](respondWithResult(_0xa7d1d6,null))[_0xed20('0x50')](handleError(_0xa7d1d6,null));};exports[_0xed20('0x57')]=function(_0x48bc68,_0x2d0aa8){return db[_0xed20('0x25')][_0xed20('0x57')]()[_0xed20('0x4e')](respondWithResult(_0x2d0aa8,null))[_0xed20('0x50')](handleError(_0x2d0aa8,null));};exports[_0xed20('0x58')]=function(_0x5d129d,_0x4c45b2){var _0x8445d0;return db[_0xed20('0x25')][_0xed20('0x53')]({'where':{'id':_0x5d129d[_0xed20('0x51')]['id']}})['then'](handleEntityNotFound(_0x4c45b2,null))[_0xed20('0x4e')](function(_0xae8ae2){if(_0xae8ae2){return _0xae8ae2[_0xed20('0x58')]()[_0xed20('0x4e')](function(_0x4431c3){return _0x4431c3;});}})[_0xed20('0x4e')](function(_0x3cc2de){_0x8445d0=_0x3cc2de;if(_0x3cc2de){if(_0x3cc2de['VoiceQueueId']||_0x3cc2de[_0xed20('0x59')]){return db[_0x3cc2de[_0xed20('0x5a')]?_0xed20('0x5b'):_0xed20('0x5c')]['find']({'where':{'id':_0x3cc2de[_0xed20('0x5a')]?_0x3cc2de[_0xed20('0x5a')]:_0x3cc2de[_0xed20('0x59')]},'attributes':['id',_0xed20('0x22')],'raw':!![]});}}})[_0xed20('0x4e')](function(_0x2b338a){var _0x1fed28={};if(_0x2b338a){_[_0xed20('0x4a')](_0x1fed28,_[_0xed20('0x5d')](_0x8445d0[_0xed20('0x5e')],['createdAt',_0xed20('0x5f'),'id']));_0x1fed28['state']=0x15;_0x1fed28['statedesc']='deleted';_0x1fed28[_0xed20('0x60')]=_0x2b338a['name'];_0x1fed28[_0xed20('0x61')]=_0x5d129d['user'][_0xed20('0x22')];_0x1fed28[_0xed20('0x62')]=_0x5d129d[_0xed20('0x63')]['id'];_0x1fed28[_0xed20('0x64')]=!![];_0x1fed28['deletedat']=moment()[_0xed20('0x65')](_0xed20('0x66'));_0x1fed28[_0xed20('0x67')]=_0x8445d0['phone'];_0x1fed28[_0xed20('0x68')]=_0x8445d0['VoiceQueueId']?_0xed20('0x69'):_0xed20('0x6a');return db[_0xed20('0x6b')][_0xed20('0x53')]({'where':{'id':_0x1fed28[_0xed20('0x6c')]},'attributes':[_0xed20('0x6d'),'lastName']})[_0xed20('0x4e')](function(_0x358d58){if(!_[_0xed20('0x6e')](_0x4c45b2)&&!_[_0xed20('0x6e')](_0x358d58[_0xed20('0x6d')])){_0x1fed28[_0xed20('0x6f')]=_0x358d58[_0xed20('0x6d')];if(!_[_0xed20('0x6e')](_0x358d58['lastName'])){_0x1fed28[_0xed20('0x6f')]+='\x20'+_0x358d58['lastName'];}}})['finally'](function(){return db[_0xed20('0x70')][_0xed20('0x54')](_0x1fed28);});}})[_0xed20('0x4e')](function(){return _0x4c45b2[_0xed20('0x17')](0xcc)['end']();})[_0xed20('0x50')](handleError(_0x4c45b2,null));};exports['getPreview']=function(_0x1475bd,_0x5d40b2,_0x429884){var _0x568aab=[];return db[_0xed20('0x6b')][_0xed20('0x57')]()['then'](function(_0x4b0455){_0x568aab=_[_0xed20('0x2a')](_0x4b0455);return _0x1475bd[_0xed20('0x63')][_0xed20('0x71')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0xed20('0x72')},'attributes':['id',_0xed20('0x73'),_0xed20('0x74')],'raw':!![]});})[_0xed20('0x4e')](function(_0x289199){if(_0x289199&&_0x289199[_0xed20('0x41')]){return db[_0xed20('0x75')][_0xed20('0x76')](function(_0x13763d){var _0x2b662a={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0xed20('0x66'))},'VoiceQueueId':{'$in':_[_0xed20('0x24')](_0x289199,'id')},'$or':[{'UserId':null},{'UserId':_0x1475bd['user']['id']}]};var _0x34037b={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x289199)[_0xed20('0x47')]([_0xed20('0x74'),0x0])[_0xed20('0x24')]('id')[_0xed20('0x77')]()},'$or':[{'UserId':null},{'UserId':_0x1475bd[_0xed20('0x63')]['id']}]};var _0x3308b0={'$or':[_0x2b662a,_0x34037b]};var _0x217712=[];if(_0x1475bd['body'][_0xed20('0x78')]&&_0x1475bd[_0xed20('0x56')][_0xed20('0x78')]===_0xed20('0x79')){if(!_[_0xed20('0x7a')](_0x1475bd[_0xed20('0x56')][_0xed20('0x7b')])){_0x3308b0['id']={'$in':_0x1475bd[_0xed20('0x56')][_0xed20('0x7b')]};}_0x217712=[[_0xed20('0x7c'),_0xed20('0x7d')],[_0xed20('0x7e'),_0x289199[0x0]['dialOrderByScheduledAt']===_0xed20('0x7d')?_0xed20('0x7f'):_0xed20('0x7d')],db[_0xed20('0x75')][_0xed20('0x80')](_0xed20('0x81')),['id',_0xed20('0x7f')]];}else{if(!_[_0xed20('0x7a')](_0x1475bd[_0xed20('0x56')][_0xed20('0x7b')])){_0x3308b0['id']={'$notIn':_0x1475bd['body']['hopperIds']};}_0x217712=[['priority','DESC'],[_0xed20('0x7e'),_0x289199[0x0]['dialOrderByScheduledAt']],db['sequelize'][_0xed20('0x80')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0xed20('0x7d')]];}return db['CmHopper'][_0xed20('0x82')]({'attributes':['id',_0xed20('0x83'),_0xed20('0x84')],'where':_0x3308b0,'order':_0x217712,'transaction':_0x13763d,'lock':_0x13763d[_0xed20('0x85')][_0xed20('0x86')],'include':[{'model':db[_0xed20('0x6b')],'as':_0xed20('0x87'),'attributes':_0x568aab,'include':[{'model':db[_0xed20('0x88')],'as':'Company','attributes':['id',_0xed20('0x22')]}]},{'model':db['CmList'],'as':'List','attributes':['id',_0xed20('0x22')]},{'model':db[_0xed20('0x5b')],'as':_0xed20('0x89'),'attributes':['id',_0xed20('0x22'),'dialActive']}]})['then'](function(_0x571e94){if(_0x571e94){return _0x571e94[_0xed20('0x55')]({'UserId':_0x1475bd[_0xed20('0x63')]['id']},{'transaction':_0x13763d});}});});}})[_0xed20('0x4e')](handleEntityNotFound(_0x5d40b2,null))[_0xed20('0x4e')](respondWithResult(_0x5d40b2,null))[_0xed20('0x50')](handleError(_0x5d40b2,null));};exports[_0xed20('0x8a')]=function(_0xf3b53a,_0x97d1e9,_0x19be78){var _0x2c7359=[];return db[_0xed20('0x6b')][_0xed20('0x57')]()[_0xed20('0x4e')](function(_0x264cea){_0x2c7359=_[_0xed20('0x2a')](_0x264cea);return _0xf3b53a[_0xed20('0x63')][_0xed20('0x71')]({'where':{'type':_0xed20('0x8b'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0xed20('0x73'),_0xed20('0x74')],'raw':!![]});})[_0xed20('0x4e')](function(_0x1e28b6){if(_0x1e28b6&&_0x1e28b6[_0xed20('0x41')]){return db['sequelize']['transaction'](function(_0x5874af){var _0x29fb4e={'active':![],'recallme':!![],'id':_0xf3b53a[_0xed20('0x56')][_0xed20('0x8c')]};return db[_0xed20('0x25')]['findOne']({'attributes':['id',_0xed20('0x83'),_0xed20('0x84')],'where':_0x29fb4e,'transaction':_0x5874af,'lock':_0x5874af[_0xed20('0x85')][_0xed20('0x86')],'include':[{'model':db[_0xed20('0x6b')],'as':_0xed20('0x87'),'attributes':_0x2c7359,'include':[{'model':db[_0xed20('0x88')],'as':'Company','attributes':['id',_0xed20('0x22')]}]},{'model':db[_0xed20('0x8d')],'as':_0xed20('0x8e'),'attributes':['id',_0xed20('0x22')]},{'model':db[_0xed20('0x5b')],'as':'Queue','attributes':['id',_0xed20('0x22'),_0xed20('0x8f')]}]})['then'](function(_0x4c1b6a){if(_0x4c1b6a){return _0x4c1b6a[_0xed20('0x55')]({'UserId':_0xf3b53a[_0xed20('0x63')]['id']},{'transaction':_0x5874af});}});});}})[_0xed20('0x4e')](handleEntityNotFound(_0x97d1e9,null))['then'](respondWithResult(_0x97d1e9,null))['catch'](handleError(_0x97d1e9,null));};exports[_0xed20('0x90')]=function(_0x1f3c0e,_0x331bf6,_0x58a5ea){return _0x1f3c0e[_0xed20('0x63')][_0xed20('0x71')]({'where':{'type':_0xed20('0x8b'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0xed20('0x4e')](function(_0x1af16d){if(_0x1af16d&&_0x1af16d[_0xed20('0x41')]){return db['CmHopper'][_0xed20('0x1c')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xed20('0x65')](_0xed20('0x66'))},'VoiceQueueId':{'$in':_[_0xed20('0x24')](_0x1af16d,'id')},'$or':[{'UserId':null},{'UserId':_0x1f3c0e[_0xed20('0x63')]['id']}]}});}return 0x0;})[_0xed20('0x4e')](function(_0xd30690){if(!_['isNil'](_0xd30690)&&_[_0xed20('0x91')](_0xd30690)){return _0x331bf6[_0xed20('0x17')](0xc8)[_0xed20('0x92')]({'contacts':_0xd30690});}else{logger[_0xed20('0x21')](_0xed20('0x93'),_0xed20('0x90'),0x194,'entity\x20not\x20found');_0x331bf6['sendStatus'](0x194);}})[_0xed20('0x50')](handleError(_0x331bf6,null));};exports['getTimezones']=function(_0x2d43e3,_0x57fb91,_0x27a8e6){var _0x3b2f70=shared['timezones'];var _0x5c2a47=[];_[_0xed20('0x24')](_0x3b2f70,function(_0x159d6d){_0x5c2a47['push']({'id':_0x159d6d[_0xed20('0x22')],'name':_0x159d6d['name'],'utcOffset':_0x159d6d[_0xed20('0x94')]});});return _0x57fb91['status'](0xc8)['json']({'tz':_0x5c2a47});};exports[_0xed20('0x95')]=function(_0x25ad71,_0x29aa0e,_0x11bc59){var _0x31d157=shared['timezones'];var _0x5d2398={};if(!_[_0xed20('0x6e')](_0x31d157[_0x25ad71[_0xed20('0x56')]['id']]))_0x5d2398=_0x31d157[_0x25ad71[_0xed20('0x56')]['id']];return _0x29aa0e[_0xed20('0x17')](0xc8)[_0xed20('0x92')](_0x5d2398);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index c8ef039..56a39f5 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 _0x687b=['lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','scheduledat','phone','priority'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x687b,0x14a));var _0xb687=function(_0xc9ce73,_0x551b77){_0xc9ce73=_0xc9ce73-0x0;var _0x28890c=_0x687b[_0xc9ce73];return _0x28890c;};'use strict';var _=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var logger=require(_0xb687('0x2'))(_0xb687('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb687('0x4'));var fs=require('fs');var path=require(_0xb687('0x5'));var rimraf=require(_0xb687('0x6'));var config=require(_0xb687('0x7'));var attributes=require(_0xb687('0x8'));module[_0xb687('0x9')]=function(_0x16ccf3,_0xf43a1f){return _0x16ccf3[_0xb687('0xa')](_0xb687('0xb'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0xb687('0xc'),'fields':[_0xb687('0xc')]},{'name':'phone','fields':[_0xb687('0xd')]},{'name':_0xb687('0xe'),'fields':[_0xb687('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xeda8=['exports','define','cm_hopper','scheduledat','phone','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes'];(function(_0x95e420,_0x5c540a){var _0x25f1bd=function(_0x174dbc){while(--_0x174dbc){_0x95e420['push'](_0x95e420['shift']());}};_0x25f1bd(++_0x5c540a);}(_0xeda8,0x104));var _0x8eda=function(_0x25f6d4,_0x597b33){_0x25f6d4=_0x25f6d4-0x0;var _0x56f722=_0xeda8[_0x25f6d4];return _0x56f722;};'use strict';var _=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var logger=require('../../config/logger')(_0x8eda('0x2'));var moment=require(_0x8eda('0x3'));var BPromise=require(_0x8eda('0x4'));var rp=require(_0x8eda('0x5'));var fs=require('fs');var path=require(_0x8eda('0x6'));var rimraf=require(_0x8eda('0x7'));var config=require(_0x8eda('0x8'));var attributes=require(_0x8eda('0x9'));module[_0x8eda('0xa')]=function(_0x1f3556,_0x349361){return _0x1f3556[_0x8eda('0xb')]('CmHopper',attributes,{'tableName':_0x8eda('0xc'),'paranoid':![],'indexes':[{'name':_0x8eda('0xd'),'fields':[_0x8eda('0xd')]},{'name':_0x8eda('0xe'),'fields':['phone']},{'name':'priority','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 2c87382..916948c 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 _0x8c55=['debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','GetCmHopper','CmHopper','findAll','options','raw','attributes','limit','include','map','model','ShowCmHopper','find','where','create','CreateCmHopper','UpdateCmHopper','body','active','DestroyCmHopper','GetContactDialer','CmContact','describe','transaction','order','LOCK','UPDATE','keys','User','Agent','name','length','UserId','push','update','all','dataValues','ContactId','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','MoveContactManagedDialer','CountReScheduled','COUNT','sequelize','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','contactsRescheduled','GetContactRecallMe','GetCmHopperPreview','Contact','GetContactByPhone','findOne','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','interval','NOW()\x20+\x20INTERVAL\x20','voicePause','CmList','\x20MINUTE','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','twilio/lib/webhooks/webhooks','client','http','request','then','CmHopper,\x20%s,\x20%s','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8c55,0x1af));var _0x58c5=function(_0x36b153,_0x5bb4f3){_0x36b153=_0x36b153-0x0;var _0x57b528=_0x8c55[_0x36b153];return _0x57b528;};'use strict';var _=require(_0x58c5('0x0'));var util=require(_0x58c5('0x1'));var moment=require(_0x58c5('0x2'));var BPromise=require(_0x58c5('0x3'));var rs=require(_0x58c5('0x4'));var fs=require('fs');var Redis=require(_0x58c5('0x5'));var db=require(_0x58c5('0x6'))['db'];var utils=require(_0x58c5('0x7'));var logger=require(_0x58c5('0x8'))(_0x58c5('0x9'));var config=require(_0x58c5('0xa'));var jayson=require(_0x58c5('0xb'));const {validateExpressRequest}=require(_0x58c5('0xc'));var client=jayson[_0x58c5('0xd')][_0x58c5('0xe')]({'port':0x232a});function respondWithRpcPromise(_0x31eb3d,_0x5f2b23,_0x34b973){return new BPromise(function(_0x4895ee,_0x34c6ec){return client[_0x58c5('0xf')](_0x31eb3d,_0x34b973)[_0x58c5('0x10')](function(_0x2a7a7a){logger['info'](_0x58c5('0x11'),_0x5f2b23,_0x58c5('0x12'));logger[_0x58c5('0x13')](_0x58c5('0x14'),_0x5f2b23,_0x58c5('0x12'),JSON[_0x58c5('0x15')](_0x2a7a7a));if(_0x2a7a7a[_0x58c5('0x16')]){if(_0x2a7a7a[_0x58c5('0x16')]['code']===0x1f4){logger['error'](_0x58c5('0x11'),_0x5f2b23,_0x2a7a7a[_0x58c5('0x16')][_0x58c5('0x17')]);return _0x34c6ec(_0x2a7a7a['error'][_0x58c5('0x17')]);}logger[_0x58c5('0x16')]('CmHopper,\x20%s,\x20%s',_0x5f2b23,_0x2a7a7a[_0x58c5('0x16')][_0x58c5('0x17')]);return _0x4895ee(_0x2a7a7a['error'][_0x58c5('0x17')]);}else{logger[_0x58c5('0x18')](_0x58c5('0x11'),_0x5f2b23,_0x58c5('0x12'));_0x4895ee(_0x2a7a7a[_0x58c5('0x19')][_0x58c5('0x17')]);}})[_0x58c5('0x1a')](function(_0x16381e){logger[_0x58c5('0x16')](_0x58c5('0x11'),_0x5f2b23,_0x16381e);_0x34c6ec(_0x16381e);});});}exports[_0x58c5('0x1b')]=function(_0x7bb9c8){var _0x5e8f27=this;return new Promise(function(_0x542f8f,_0x22b9dd){return db[_0x58c5('0x1c')][_0x58c5('0x1d')]({'raw':_0x7bb9c8[_0x58c5('0x1e')]?_0x7bb9c8['options'][_0x58c5('0x1f')]===undefined?!![]:![]:!![],'where':_0x7bb9c8[_0x58c5('0x1e')]?_0x7bb9c8[_0x58c5('0x1e')]['where']||null:null,'attributes':_0x7bb9c8[_0x58c5('0x1e')]?_0x7bb9c8[_0x58c5('0x1e')][_0x58c5('0x20')]||null:null,'limit':_0x7bb9c8[_0x58c5('0x1e')]?_0x7bb9c8[_0x58c5('0x1e')][_0x58c5('0x21')]||null:null,'include':_0x7bb9c8[_0x58c5('0x1e')]?_0x7bb9c8[_0x58c5('0x1e')][_0x58c5('0x22')]?_[_0x58c5('0x23')](_0x7bb9c8[_0x58c5('0x1e')]['include'],function(_0x5e448e){return{'model':db[_0x5e448e[_0x58c5('0x24')]],'as':_0x5e448e['as'],'attributes':_0x5e448e[_0x58c5('0x20')],'include':_0x5e448e[_0x58c5('0x22')]?_[_0x58c5('0x23')](_0x5e448e['include'],function(_0x4e6e8f){return{'model':db[_0x4e6e8f['model']],'as':_0x4e6e8f['as'],'attributes':_0x4e6e8f[_0x58c5('0x20')],'include':_0x4e6e8f[_0x58c5('0x22')]?_[_0x58c5('0x23')](_0x4e6e8f[_0x58c5('0x22')],function(_0x3eea52){return{'model':db[_0x3eea52[_0x58c5('0x24')]],'as':_0x3eea52['as'],'attributes':_0x3eea52[_0x58c5('0x20')]};}):[]};}):[]};}):[]:[]})[_0x58c5('0x10')](function(_0xb2e29){logger[_0x58c5('0x18')]('GetCmHopper',_0x7bb9c8);logger['debug'](_0x58c5('0x1b'),_0x7bb9c8,JSON[_0x58c5('0x15')](_0xb2e29));_0x542f8f(_0xb2e29);})['catch'](function(_0x56f8ed){logger[_0x58c5('0x16')](_0x58c5('0x1b'),_0x56f8ed['message'],_0x7bb9c8);_0x22b9dd(_0x5e8f27[_0x58c5('0x16')](0x1f4,_0x56f8ed[_0x58c5('0x17')]));});});};exports[_0x58c5('0x25')]=function(_0x4623d9){var _0x7fe670=this;return new Promise(function(_0x21bfc5,_0x5257b0){return db[_0x58c5('0x1c')][_0x58c5('0x26')]({'raw':_0x4623d9[_0x58c5('0x1e')]?_0x4623d9['options'][_0x58c5('0x1f')]===undefined?!![]:![]:!![],'where':_0x4623d9['options']?_0x4623d9[_0x58c5('0x1e')][_0x58c5('0x27')]||null:null,'attributes':_0x4623d9['options']?_0x4623d9[_0x58c5('0x1e')][_0x58c5('0x20')]||null:null,'include':_0x4623d9[_0x58c5('0x1e')]?_0x4623d9[_0x58c5('0x1e')][_0x58c5('0x22')]?_[_0x58c5('0x23')](_0x4623d9[_0x58c5('0x1e')]['include'],function(_0x2228e8){return{'model':db[_0x2228e8[_0x58c5('0x24')]],'as':_0x2228e8['as'],'attributes':_0x2228e8[_0x58c5('0x20')],'include':_0x2228e8[_0x58c5('0x22')]?_[_0x58c5('0x23')](_0x2228e8[_0x58c5('0x22')],function(_0x76c0a9){return{'model':db[_0x76c0a9[_0x58c5('0x24')]],'as':_0x76c0a9['as'],'attributes':_0x76c0a9[_0x58c5('0x20')],'include':_0x76c0a9['include']?_['map'](_0x76c0a9[_0x58c5('0x22')],function(_0x30305b){return{'model':db[_0x30305b[_0x58c5('0x24')]],'as':_0x30305b['as'],'attributes':_0x30305b[_0x58c5('0x20')]};}):[]};}):[]};}):[]:[]})[_0x58c5('0x10')](function(_0x4d409f){logger[_0x58c5('0x18')](_0x58c5('0x25'),_0x4623d9);logger[_0x58c5('0x13')](_0x58c5('0x25'),_0x4623d9,JSON['stringify'](_0x4d409f));_0x21bfc5(_0x4d409f);})[_0x58c5('0x1a')](function(_0xa17929){logger[_0x58c5('0x16')](_0x58c5('0x25'),_0xa17929['message'],_0x4623d9);_0x5257b0(_0x7fe670['error'](0x1f4,_0xa17929[_0x58c5('0x17')]));});});};exports['CreateCmHopper']=function(_0x115930){var _0x2f3df0=this;return new Promise(function(_0x567dd0,_0x6c811e){return db[_0x58c5('0x1c')][_0x58c5('0x28')](_0x115930['body'],{'raw':_0x115930['options']?_0x115930['options'][_0x58c5('0x1f')]===undefined?!![]:![]:!![]})[_0x58c5('0x10')](function(_0xbd11fd){logger[_0x58c5('0x18')](_0x58c5('0x29'),_0x115930);logger[_0x58c5('0x13')](_0x58c5('0x29'),_0x115930,JSON[_0x58c5('0x15')](_0xbd11fd));_0x567dd0(_0xbd11fd);})['catch'](function(_0x5805dd){logger['error'](_0x58c5('0x29'),_0x5805dd[_0x58c5('0x17')],_0x115930);_0x6c811e(_0x2f3df0[_0x58c5('0x16')](0x1f4,_0x5805dd[_0x58c5('0x17')]));});});};exports[_0x58c5('0x2a')]=function(_0x1fc13c){var _0x377e51=this;return new Promise(function(_0x3549a9,_0x38eebf){return db[_0x58c5('0x1c')]['update'](_0x1fc13c[_0x58c5('0x2b')],{'raw':_0x1fc13c[_0x58c5('0x1e')]?_0x1fc13c[_0x58c5('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1fc13c[_0x58c5('0x1e')]?_0x1fc13c[_0x58c5('0x1e')][_0x58c5('0x27')]||null:null,'attributes':_0x1fc13c[_0x58c5('0x1e')]?_0x1fc13c[_0x58c5('0x1e')][_0x58c5('0x20')]||null:null,'limit':_0x1fc13c[_0x58c5('0x1e')]?_0x1fc13c[_0x58c5('0x1e')][_0x58c5('0x21')]||null:null})[_0x58c5('0x10')](function(_0x30024f){logger['info'](_0x58c5('0x2a'),_0x1fc13c);logger[_0x58c5('0x18')]('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0x58c5('0x15')](_0x1fc13c[_0x58c5('0x1e')]['where']),_0x1fc13c[_0x58c5('0x2b')][_0x58c5('0x2c')]);logger[_0x58c5('0x13')](_0x58c5('0x2a'),_0x1fc13c,JSON[_0x58c5('0x15')](_0x30024f));_0x3549a9(_0x30024f);})[_0x58c5('0x1a')](function(_0x59fc1b){logger[_0x58c5('0x16')]('UpdateCmHopper',_0x59fc1b['message'],_0x1fc13c);_0x38eebf(_0x377e51[_0x58c5('0x16')](0x1f4,_0x59fc1b[_0x58c5('0x17')]));});});};exports[_0x58c5('0x2d')]=function(_0x59a08c){var _0x5ebaeb=this;return new Promise(function(_0x2b2a75,_0x1be76b){return db['CmHopper']['destroy']({'where':_0x59a08c[_0x58c5('0x1e')]?_0x59a08c[_0x58c5('0x1e')]['where']||null:null})['then'](function(_0x5530af){logger[_0x58c5('0x18')](_0x58c5('0x2d'),_0x59a08c);logger['debug'](_0x58c5('0x2d'),_0x59a08c,JSON[_0x58c5('0x15')](_0x5530af));_0x2b2a75(_0x5530af);})[_0x58c5('0x1a')](function(_0x311a8a){logger[_0x58c5('0x16')]('DestroyCmHopper',_0x311a8a[_0x58c5('0x17')],_0x59a08c);_0x1be76b(_0x5ebaeb[_0x58c5('0x16')](0x1f4,_0x311a8a[_0x58c5('0x17')]));});});};exports[_0x58c5('0x2e')]=function(_0x2e6cf6){var _0xf97a82=this;return new Promise(function(_0x11d8f8,_0x512e8b){return db[_0x58c5('0x2f')][_0x58c5('0x30')]()[_0x58c5('0x10')](function(_0x4cf28a){return db['sequelize'][_0x58c5('0x31')](function(_0x225396){return db[_0x58c5('0x1c')][_0x58c5('0x1d')]({'where':_0x2e6cf6[_0x58c5('0x1e')]?_0x2e6cf6['options'][_0x58c5('0x27')]||null:null,'attributes':_0x2e6cf6['options']?_0x2e6cf6['options']['attributes']||null:null,'limit':_0x2e6cf6[_0x58c5('0x1e')]?_0x2e6cf6[_0x58c5('0x1e')][_0x58c5('0x21')]||null:null,'order':_0x2e6cf6[_0x58c5('0x1e')]?_0x2e6cf6[_0x58c5('0x1e')][_0x58c5('0x32')]||null:null,'transaction':_0x225396,'lock':_0x225396[_0x58c5('0x33')][_0x58c5('0x34')],'include':[{'model':db[_0x58c5('0x2f')],'as':'Contact','attributes':_[_0x58c5('0x35')](_0x4cf28a)},{'model':db[_0x58c5('0x36')],'as':_0x58c5('0x37'),'attributes':['id',_0x58c5('0x38'),'voicePause']}]})[_0x58c5('0x10')](function(_0x2fead5){var _0x53cdb1=[];var _0x3f36bb=[];for(var _0x5d5127=0x0;_0x5d5127<_0x2fead5[_0x58c5('0x39')];_0x5d5127+=0x1){var _0x34c88c=_0x2fead5[_0x5d5127][_0x58c5('0x3a')];if(_0x34c88c===null){_0x53cdb1[_0x58c5('0x3b')](_0x2fead5[_0x5d5127][_0x58c5('0x3c')](_0x2e6cf6[_0x58c5('0x2b')],{'transaction':_0x225396}));}else if(!_0x3f36bb['includes'](_0x34c88c)){_0x3f36bb[_0x58c5('0x3b')](_0x34c88c);_0x53cdb1[_0x58c5('0x3b')](_0x2fead5[_0x5d5127][_0x58c5('0x3c')](_0x2e6cf6['body'],{'transaction':_0x225396}));}}return BPromise[_0x58c5('0x3d')](_0x53cdb1);});})[_0x58c5('0x10')](function(_0x32493c){logger[_0x58c5('0x18')](_0x58c5('0x2e'),_0x2e6cf6);if(_0x32493c['length']>0x0){logger[_0x58c5('0x18')]('GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]',_0x32493c[0x0][_0x58c5('0x3e')]['id'],_0x32493c[0x0][_0x58c5('0x3e')][_0x58c5('0x3f')],_0x32493c[0x0][_0x58c5('0x3e')][_0x58c5('0x2c')]);}logger[_0x58c5('0x13')]('GetContactDialer',_0x2e6cf6,JSON[_0x58c5('0x15')](_0x32493c));_0x11d8f8(_0x32493c);})[_0x58c5('0x1a')](function(_0x549dde){logger[_0x58c5('0x16')](_0x58c5('0x2e'),_0x549dde['message'],_0x2e6cf6);_0x512e8b(_0xf97a82[_0x58c5('0x16')](0x1f4,_0x549dde['message']));});});});};exports['MoveContactManagedDialer']=function(_0x2c7ae7){var _0x2daed1=this;return new Promise(function(_0x4c8360,_0x275dec){return db['sequelize'][_0x58c5('0x31')](function(_0x34489c){return db[_0x58c5('0x40')][_0x58c5('0x28')](_0x2c7ae7['body'],{'raw':_0x2c7ae7[_0x58c5('0x1e')]?_0x2c7ae7[_0x58c5('0x1e')][_0x58c5('0x1f')]===undefined?!![]:![]:!![],'transaction':_0x34489c})[_0x58c5('0x10')](function(){logger['info'](_0x58c5('0x41'),JSON[_0x58c5('0x15')](_0x2c7ae7[_0x58c5('0x1e')]['where']),_0x2c7ae7[_0x58c5('0x1e')][_0x58c5('0x27')]['active']);return db[_0x58c5('0x1c')]['destroy']({'where':_0x2c7ae7[_0x58c5('0x1e')]?_0x2c7ae7['options'][_0x58c5('0x27')]||null:null,'transaction':_0x34489c});});})[_0x58c5('0x10')](function(_0x468ee0){logger[_0x58c5('0x18')]('MoveContactManagedDialer',_0x2c7ae7);logger[_0x58c5('0x13')](_0x58c5('0x42'),_0x2c7ae7,JSON[_0x58c5('0x15')](_0x468ee0));_0x4c8360(_0x468ee0);})['catch'](function(_0x3a0da4){logger[_0x58c5('0x16')](_0x58c5('0x42'),_0x3a0da4[_0x58c5('0x17')],_0x2c7ae7);_0x275dec(_0x2daed1['error'](0x1f4,_0x3a0da4[_0x58c5('0x17')]));});});};exports[_0x58c5('0x43')]=function(_0x1a2f7d){var _0x58ee0d=this;return new Promise(function(_0x3ce4a9,_0x5185b4){return db['CmHopper'][_0x58c5('0x1d')]({'raw':_0x1a2f7d[_0x58c5('0x1e')]?_0x1a2f7d['options'][_0x58c5('0x1f')]===undefined?!![]:![]:!![],'where':_0x1a2f7d[_0x58c5('0x1e')]?_0x1a2f7d['options'][_0x58c5('0x27')]||null:null,'attributes':[[db['sequelize']['fn'](_0x58c5('0x44'),db[_0x58c5('0x45')]['fn']('IF',db[_0x58c5('0x45')][_0x58c5('0x46')](_0x58c5('0x47')+util[_0x58c5('0x48')](_0x58c5('0x49'),moment()[_0x58c5('0x48')]('YYYY-MM-DD\x20HH:mm:ss'))+'\x20,\x201,\x20null'))),_0x58c5('0x4a')]]})[_0x58c5('0x10')](function(_0x4deba2){logger['info'](_0x58c5('0x43'),_0x1a2f7d);logger[_0x58c5('0x13')](_0x58c5('0x43'),_0x1a2f7d,JSON['stringify'](_0x4deba2));_0x3ce4a9(_0x4deba2);})[_0x58c5('0x1a')](function(_0x50cb96){logger['error'](_0x58c5('0x43'),_0x50cb96[_0x58c5('0x17')],_0x1a2f7d);_0x5185b4(_0x58ee0d['error'](0x1f4,_0x50cb96[_0x58c5('0x17')]));});});};exports['GetContactRecallMe']=function(_0x48b98){var _0x3e4893=this;return new Promise(function(_0x14b826,_0x185457){return db[_0x58c5('0x2f')][_0x58c5('0x30')]()['then'](function(_0x1e298f){return db[_0x58c5('0x45')]['transaction'](function(_0x4aa71e){return db[_0x58c5('0x1c')][_0x58c5('0x1d')]({'where':_0x48b98[_0x58c5('0x1e')]?_0x48b98['options']['where']||null:null,'attributes':_0x48b98[_0x58c5('0x1e')]?_0x48b98[_0x58c5('0x1e')][_0x58c5('0x20')]||null:null,'limit':0x1,'order':_0x48b98['options']?_0x48b98[_0x58c5('0x1e')][_0x58c5('0x32')]||null:null,'group':db[_0x58c5('0x1c')]['UserId'],'transaction':_0x4aa71e,'lock':_0x4aa71e[_0x58c5('0x33')][_0x58c5('0x34')],'include':_0x48b98['options']?_0x48b98['options'][_0x58c5('0x22')]?_[_0x58c5('0x23')](_0x48b98['options'][_0x58c5('0x22')],function(_0x53ada3){return{'model':db[_0x53ada3['model']],'as':_0x53ada3['as'],'attributes':_0x53ada3['attributes'],'include':_0x53ada3[_0x58c5('0x22')]?_[_0x58c5('0x23')](_0x53ada3['include'],function(_0x5e5889){return{'model':db[_0x5e5889[_0x58c5('0x24')]],'as':_0x5e5889['as'],'attributes':_0x5e5889[_0x58c5('0x20')],'include':_0x5e5889[_0x58c5('0x22')]?_['map'](_0x5e5889[_0x58c5('0x22')],function(_0x16f4ce){return{'model':db[_0x16f4ce[_0x58c5('0x24')]],'as':_0x16f4ce['as'],'attributes':_0x16f4ce[_0x58c5('0x20')]};}):[]};}):[]};}):[]:[]})[_0x58c5('0x10')](function(_0x188b2e){var _0x226ec7=[];for(var _0x3cfcd9=0x0;_0x3cfcd9<_0x188b2e[_0x58c5('0x39')];_0x3cfcd9+=0x1){_0x226ec7['push'](_0x188b2e[_0x3cfcd9]['update'](_0x48b98[_0x58c5('0x2b')],{'transaction':_0x4aa71e}));}return BPromise[_0x58c5('0x3d')](_0x226ec7);});})[_0x58c5('0x10')](function(_0x504315){logger[_0x58c5('0x18')]('GetContactRecallMe',_0x48b98);logger['debug'](_0x58c5('0x4b'),_0x48b98,JSON['stringify'](_0x504315));_0x14b826(_0x504315);})['catch'](function(_0x5147a3){logger[_0x58c5('0x16')](_0x58c5('0x4b'),_0x5147a3[_0x58c5('0x17')],_0x48b98);_0x185457(_0x3e4893[_0x58c5('0x16')](0x1f4,_0x5147a3[_0x58c5('0x17')]));});});});};exports[_0x58c5('0x4c')]=function(_0x4da561){var _0xbefe89=this;return new Promise(function(_0xccc4f7,_0x5af9ef){db[_0x58c5('0x2f')]['describe']()['then'](function(_0x1940f8){return db[_0x58c5('0x1c')][_0x58c5('0x1d')]({'raw':_0x4da561[_0x58c5('0x1e')]?_0x4da561[_0x58c5('0x1e')][_0x58c5('0x1f')]===undefined?!![]:![]:!![],'where':_0x4da561[_0x58c5('0x1e')]?_0x4da561[_0x58c5('0x1e')][_0x58c5('0x27')]||null:null,'attributes':_0x4da561['options']?_0x4da561['options'][_0x58c5('0x20')]||null:null,'limit':_0x4da561[_0x58c5('0x1e')]?_0x4da561['options'][_0x58c5('0x21')]||null:null,'include':_0x4da561[_0x58c5('0x1e')]?_0x4da561['options'][_0x58c5('0x22')]?_['map'](_0x4da561[_0x58c5('0x1e')][_0x58c5('0x22')],function(_0x415980){return{'model':db[_0x415980['model']],'as':_0x415980['as'],'attributes':_0x415980['as']===_0x58c5('0x4d')?_['keys'](_0x1940f8):_0x415980[_0x58c5('0x20')],'include':_0x415980['include']?_[_0x58c5('0x23')](_0x415980[_0x58c5('0x22')],function(_0xa33198){return{'model':db[_0xa33198[_0x58c5('0x24')]],'as':_0xa33198['as'],'attributes':_0xa33198['attributes'],'include':_0xa33198[_0x58c5('0x22')]?_[_0x58c5('0x23')](_0xa33198[_0x58c5('0x22')],function(_0x46cd36){return{'model':db[_0x46cd36[_0x58c5('0x24')]],'as':_0x46cd36['as'],'attributes':_0x46cd36[_0x58c5('0x20')]};}):[]};}):[]};}):[]:[]})[_0x58c5('0x10')](function(_0x5ce6d4){logger[_0x58c5('0x18')]('GetCmHopper',_0x4da561);logger[_0x58c5('0x13')](_0x58c5('0x1b'),_0x4da561,JSON[_0x58c5('0x15')](_0x5ce6d4));_0xccc4f7(_0x5ce6d4);})[_0x58c5('0x1a')](function(_0xf41281){logger[_0x58c5('0x16')]('GetCmHopper',_0xf41281[_0x58c5('0x17')],_0x4da561);_0x5af9ef(_0xbefe89[_0x58c5('0x16')](0x1f4,_0xf41281['message']));});});});};exports[_0x58c5('0x4e')]=function(_0xf2b549){var _0x3d9edc=this;return new Promise(function(_0xc68ef7,_0x91b876){return db[_0x58c5('0x2f')][_0x58c5('0x4f')]({'raw':!![],'where':{'phone':_0xf2b549[_0x58c5('0x1e')][_0x58c5('0x27')]['phone']},'attributes':['id',_0x58c5('0x50')],'order':[['id',_0x58c5('0x51')]]})[_0x58c5('0x10')](function(_0x233bd1){logger[_0x58c5('0x18')](_0x58c5('0x52'),_0xf2b549);logger['debug'](_0x58c5('0x52'),_0xf2b549,JSON[_0x58c5('0x15')](_0x233bd1));_0xc68ef7(_0x233bd1);})[_0x58c5('0x1a')](function(_0xa64e62){logger[_0x58c5('0x16')]('getContactByPhone',_0xa64e62['message'],_0xf2b549);_0x91b876(_0x3d9edc[_0x58c5('0x16')](0x1f4,_0xa64e62[_0x58c5('0x17')]));});});};exports[_0x58c5('0x53')]=function(_0x48fa73){var _0x4d99f8=this;return new Promise(function(_0x4ef997,_0xa4c6a8){return db[_0x58c5('0x45')][_0x58c5('0x31')](function(_0x250bb9){return db[_0x58c5('0x1c')][_0x58c5('0x3c')]({'active':![]},{'where':{},'transaction':_0x250bb9})['then'](function(_0x431e1a){logger['info']('ResetActiveCalls',_0x48fa73);logger[_0x58c5('0x13')](_0x58c5('0x53'),_0x48fa73,JSON[_0x58c5('0x15')](_0x431e1a));_0x4ef997(_0x431e1a);})['catch'](function(_0x181d76){logger['error']('ResetActiveCalls',_0x181d76[_0x58c5('0x17')],_0x48fa73);_0xa4c6a8(_0x4d99f8[_0x58c5('0x16')](0x1f4,_0x181d76['message']));});});});};exports[_0x58c5('0x54')]=function(_0x519a8a){var _0x308e34=this;var _0x4483f1=_0x519a8a['body'][_0x58c5('0x27')]['voiceQueueId'];var _0x8a7dcf=_0x519a8a['body'][_0x58c5('0x27')][_0x58c5('0x55')];return new Promise(function(_0x26dcc4,_0x5bd4fd){return db['CmHopper'][_0x58c5('0x1d')]({'where':{'voiceQueueId':_0x4483f1,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db['sequelize'][_0x58c5('0x46')](_0x58c5('0x56')+_0x8a7dcf+'\x20MINUTE')}},'include':[{'model':db[_0x58c5('0x2f')],'as':'Contact'},{'model':db['User'],'as':_0x58c5('0x37'),'attributes':['id',_0x58c5('0x38'),_0x58c5('0x57')]},{'model':db[_0x58c5('0x58')],'as':'List'}]})[_0x58c5('0x10')](function(_0x1e0e46){return db['sequelize'][_0x58c5('0x31')](function(_0x161965){return db[_0x58c5('0x1c')][_0x58c5('0x3c')]({'recallmeNotifiedDate':new Date()},{'where':{'voiceQueueId':_0x4483f1,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db[_0x58c5('0x45')]['literal'](_0x58c5('0x56')+_0x8a7dcf+_0x58c5('0x59'))}},'transaction':_0x161965})[_0x58c5('0x10')](function(_0x538e59){_0x26dcc4(_0x1e0e46);})[_0x58c5('0x1a')](function(_0x4d96b3){logger[_0x58c5('0x16')]('CmHopperHandlePreviewRecallNotifications',_0x4d96b3['message'],_0x519a8a);_0x5bd4fd(validateExpressRequest);});});})[_0x58c5('0x1a')](function(_0xc04285){logger[_0x58c5('0x16')](_0x58c5('0x54'),_0xc04285['message'],_0x519a8a);_0x5bd4fd(_0x308e34[_0x58c5('0x16')](0x1f4,_0xc04285['message']));});});}; \ No newline at end of file +var _0xb995=['util','moment','bluebird','ioredis','../../config/logger','rpc','jayson/promise','twilio/lib/webhooks/webhooks','client','http','request','then','info','CmHopper,\x20%s,\x20%s','debug','CmHopper,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetCmHopper','CmHopper','options','raw','where','attributes','limit','include','map','model','ShowCmHopper','CreateCmHopper','body','UpdateCmHopper','update','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','transaction','findAll','order','LOCK','UPDATE','Contact','User','Agent','name','voicePause','length','UserId','push','includes','all','dataValues','ContactId','MoveContactManagedDialer','sequelize','CmHopperFinal','create','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','GetCmHopperPreview','keys','GetContactByPhone','findOne','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','interval','CmList','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','CmHopperHandlePreviewRecallNotifications','lodash'];(function(_0x2e4cbf,_0x8763d3){var _0x52840f=function(_0x31b93f){while(--_0x31b93f){_0x2e4cbf['push'](_0x2e4cbf['shift']());}};_0x52840f(++_0x8763d3);}(_0xb995,0x1bc));var _0x5b99=function(_0x1fa12c,_0x5ae115){_0x1fa12c=_0x1fa12c-0x0;var _0x153da4=_0xb995[_0x1fa12c];return _0x153da4;};'use strict';var _=require(_0x5b99('0x0'));var util=require(_0x5b99('0x1'));var moment=require(_0x5b99('0x2'));var BPromise=require(_0x5b99('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5b99('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5b99('0x5'))(_0x5b99('0x6'));var config=require('../../config/environment');var jayson=require(_0x5b99('0x7'));const {validateExpressRequest}=require(_0x5b99('0x8'));var client=jayson[_0x5b99('0x9')][_0x5b99('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d8d3a,_0x426287,_0xe5b66d){return new BPromise(function(_0x1c1346,_0x11bf1b){return client[_0x5b99('0xb')](_0x4d8d3a,_0xe5b66d)[_0x5b99('0xc')](function(_0x4ab75f){logger[_0x5b99('0xd')](_0x5b99('0xe'),_0x426287,'request\x20sent');logger[_0x5b99('0xf')](_0x5b99('0x10'),_0x426287,_0x5b99('0x11'),JSON[_0x5b99('0x12')](_0x4ab75f));if(_0x4ab75f[_0x5b99('0x13')]){if(_0x4ab75f[_0x5b99('0x13')][_0x5b99('0x14')]===0x1f4){logger['error'](_0x5b99('0xe'),_0x426287,_0x4ab75f[_0x5b99('0x13')][_0x5b99('0x15')]);return _0x11bf1b(_0x4ab75f[_0x5b99('0x13')]['message']);}logger[_0x5b99('0x13')]('CmHopper,\x20%s,\x20%s',_0x426287,_0x4ab75f[_0x5b99('0x13')]['message']);return _0x1c1346(_0x4ab75f[_0x5b99('0x13')][_0x5b99('0x15')]);}else{logger['info'](_0x5b99('0xe'),_0x426287,'request\x20sent');_0x1c1346(_0x4ab75f[_0x5b99('0x16')][_0x5b99('0x15')]);}})[_0x5b99('0x17')](function(_0x370d22){logger['error']('CmHopper,\x20%s,\x20%s',_0x426287,_0x370d22);_0x11bf1b(_0x370d22);});});}exports[_0x5b99('0x18')]=function(_0x528208){var _0x6bcc39=this;return new Promise(function(_0x116e7b,_0x4a7a7c){return db[_0x5b99('0x19')]['findAll']({'raw':_0x528208['options']?_0x528208[_0x5b99('0x1a')][_0x5b99('0x1b')]===undefined?!![]:![]:!![],'where':_0x528208[_0x5b99('0x1a')]?_0x528208['options'][_0x5b99('0x1c')]||null:null,'attributes':_0x528208[_0x5b99('0x1a')]?_0x528208[_0x5b99('0x1a')][_0x5b99('0x1d')]||null:null,'limit':_0x528208[_0x5b99('0x1a')]?_0x528208['options'][_0x5b99('0x1e')]||null:null,'include':_0x528208[_0x5b99('0x1a')]?_0x528208['options'][_0x5b99('0x1f')]?_[_0x5b99('0x20')](_0x528208[_0x5b99('0x1a')][_0x5b99('0x1f')],function(_0x11071e){return{'model':db[_0x11071e[_0x5b99('0x21')]],'as':_0x11071e['as'],'attributes':_0x11071e[_0x5b99('0x1d')],'include':_0x11071e['include']?_[_0x5b99('0x20')](_0x11071e[_0x5b99('0x1f')],function(_0x147bd2){return{'model':db[_0x147bd2['model']],'as':_0x147bd2['as'],'attributes':_0x147bd2[_0x5b99('0x1d')],'include':_0x147bd2[_0x5b99('0x1f')]?_['map'](_0x147bd2['include'],function(_0xe2003a){return{'model':db[_0xe2003a[_0x5b99('0x21')]],'as':_0xe2003a['as'],'attributes':_0xe2003a[_0x5b99('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5b99('0xc')](function(_0xfac18f){logger['info'](_0x5b99('0x18'),_0x528208);logger[_0x5b99('0xf')](_0x5b99('0x18'),_0x528208,JSON[_0x5b99('0x12')](_0xfac18f));_0x116e7b(_0xfac18f);})['catch'](function(_0x4a76e2){logger[_0x5b99('0x13')](_0x5b99('0x18'),_0x4a76e2[_0x5b99('0x15')],_0x528208);_0x4a7a7c(_0x6bcc39[_0x5b99('0x13')](0x1f4,_0x4a76e2['message']));});});};exports[_0x5b99('0x22')]=function(_0xed781c){var _0x30dc1a=this;return new Promise(function(_0x2ce3df,_0x332ea5){return db[_0x5b99('0x19')]['find']({'raw':_0xed781c[_0x5b99('0x1a')]?_0xed781c['options'][_0x5b99('0x1b')]===undefined?!![]:![]:!![],'where':_0xed781c[_0x5b99('0x1a')]?_0xed781c[_0x5b99('0x1a')]['where']||null:null,'attributes':_0xed781c[_0x5b99('0x1a')]?_0xed781c[_0x5b99('0x1a')][_0x5b99('0x1d')]||null:null,'include':_0xed781c[_0x5b99('0x1a')]?_0xed781c[_0x5b99('0x1a')][_0x5b99('0x1f')]?_[_0x5b99('0x20')](_0xed781c['options'][_0x5b99('0x1f')],function(_0x3e699b){return{'model':db[_0x3e699b[_0x5b99('0x21')]],'as':_0x3e699b['as'],'attributes':_0x3e699b[_0x5b99('0x1d')],'include':_0x3e699b[_0x5b99('0x1f')]?_[_0x5b99('0x20')](_0x3e699b[_0x5b99('0x1f')],function(_0x32ba74){return{'model':db[_0x32ba74['model']],'as':_0x32ba74['as'],'attributes':_0x32ba74[_0x5b99('0x1d')],'include':_0x32ba74[_0x5b99('0x1f')]?_[_0x5b99('0x20')](_0x32ba74['include'],function(_0x27aa68){return{'model':db[_0x27aa68[_0x5b99('0x21')]],'as':_0x27aa68['as'],'attributes':_0x27aa68[_0x5b99('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5b99('0xc')](function(_0x54c4b9){logger[_0x5b99('0xd')](_0x5b99('0x22'),_0xed781c);logger[_0x5b99('0xf')]('ShowCmHopper',_0xed781c,JSON['stringify'](_0x54c4b9));_0x2ce3df(_0x54c4b9);})[_0x5b99('0x17')](function(_0x2f45f1){logger[_0x5b99('0x13')](_0x5b99('0x22'),_0x2f45f1[_0x5b99('0x15')],_0xed781c);_0x332ea5(_0x30dc1a[_0x5b99('0x13')](0x1f4,_0x2f45f1[_0x5b99('0x15')]));});});};exports[_0x5b99('0x23')]=function(_0x5c3046){var _0x1256a7=this;return new Promise(function(_0x4ccc4e,_0x2f1c14){return db[_0x5b99('0x19')]['create'](_0x5c3046[_0x5b99('0x24')],{'raw':_0x5c3046[_0x5b99('0x1a')]?_0x5c3046[_0x5b99('0x1a')][_0x5b99('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x79d539){logger[_0x5b99('0xd')]('CreateCmHopper',_0x5c3046);logger['debug'](_0x5b99('0x23'),_0x5c3046,JSON[_0x5b99('0x12')](_0x79d539));_0x4ccc4e(_0x79d539);})[_0x5b99('0x17')](function(_0x1a9cee){logger[_0x5b99('0x13')](_0x5b99('0x23'),_0x1a9cee[_0x5b99('0x15')],_0x5c3046);_0x2f1c14(_0x1256a7[_0x5b99('0x13')](0x1f4,_0x1a9cee['message']));});});};exports[_0x5b99('0x25')]=function(_0x18c14f){var _0x57bc5a=this;return new Promise(function(_0x5f4e6e,_0x4e77a6){return db[_0x5b99('0x19')][_0x5b99('0x26')](_0x18c14f[_0x5b99('0x24')],{'raw':_0x18c14f['options']?_0x18c14f[_0x5b99('0x1a')][_0x5b99('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18c14f[_0x5b99('0x1a')]?_0x18c14f[_0x5b99('0x1a')][_0x5b99('0x1c')]||null:null,'attributes':_0x18c14f[_0x5b99('0x1a')]?_0x18c14f[_0x5b99('0x1a')][_0x5b99('0x1d')]||null:null,'limit':_0x18c14f[_0x5b99('0x1a')]?_0x18c14f['options']['limit']||null:null})['then'](function(_0x437114){logger[_0x5b99('0xd')](_0x5b99('0x25'),_0x18c14f);logger['info']('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0x5b99('0x12')](_0x18c14f[_0x5b99('0x1a')][_0x5b99('0x1c')]),_0x18c14f[_0x5b99('0x24')][_0x5b99('0x27')]);logger['debug'](_0x5b99('0x25'),_0x18c14f,JSON['stringify'](_0x437114));_0x5f4e6e(_0x437114);})[_0x5b99('0x17')](function(_0x5c86fa){logger[_0x5b99('0x13')](_0x5b99('0x25'),_0x5c86fa[_0x5b99('0x15')],_0x18c14f);_0x4e77a6(_0x57bc5a['error'](0x1f4,_0x5c86fa[_0x5b99('0x15')]));});});};exports[_0x5b99('0x28')]=function(_0x5c2d7f){var _0x175a2e=this;return new Promise(function(_0x37fcf8,_0x563302){return db[_0x5b99('0x19')][_0x5b99('0x29')]({'where':_0x5c2d7f[_0x5b99('0x1a')]?_0x5c2d7f[_0x5b99('0x1a')]['where']||null:null})['then'](function(_0x553741){logger[_0x5b99('0xd')](_0x5b99('0x28'),_0x5c2d7f);logger['debug']('DestroyCmHopper',_0x5c2d7f,JSON[_0x5b99('0x12')](_0x553741));_0x37fcf8(_0x553741);})['catch'](function(_0x442d9d){logger[_0x5b99('0x13')](_0x5b99('0x28'),_0x442d9d[_0x5b99('0x15')],_0x5c2d7f);_0x563302(_0x175a2e[_0x5b99('0x13')](0x1f4,_0x442d9d[_0x5b99('0x15')]));});});};exports[_0x5b99('0x2a')]=function(_0x14f7cf){var _0x171ccf=this;return new Promise(function(_0x40b503,_0x544b70){return db[_0x5b99('0x2b')][_0x5b99('0x2c')]()[_0x5b99('0xc')](function(_0x225c3b){return db['sequelize'][_0x5b99('0x2d')](function(_0x512721){return db[_0x5b99('0x19')][_0x5b99('0x2e')]({'where':_0x14f7cf[_0x5b99('0x1a')]?_0x14f7cf['options'][_0x5b99('0x1c')]||null:null,'attributes':_0x14f7cf[_0x5b99('0x1a')]?_0x14f7cf[_0x5b99('0x1a')]['attributes']||null:null,'limit':_0x14f7cf[_0x5b99('0x1a')]?_0x14f7cf[_0x5b99('0x1a')][_0x5b99('0x1e')]||null:null,'order':_0x14f7cf[_0x5b99('0x1a')]?_0x14f7cf[_0x5b99('0x1a')][_0x5b99('0x2f')]||null:null,'transaction':_0x512721,'lock':_0x512721[_0x5b99('0x30')][_0x5b99('0x31')],'include':[{'model':db['CmContact'],'as':_0x5b99('0x32'),'attributes':_['keys'](_0x225c3b)},{'model':db[_0x5b99('0x33')],'as':_0x5b99('0x34'),'attributes':['id',_0x5b99('0x35'),_0x5b99('0x36')]}]})['then'](function(_0x4ef521){var _0x471408=[];var _0x1e1517=[];for(var _0x2c2085=0x0;_0x2c2085<_0x4ef521[_0x5b99('0x37')];_0x2c2085+=0x1){var _0x2f4996=_0x4ef521[_0x2c2085][_0x5b99('0x38')];if(_0x2f4996===null){_0x471408[_0x5b99('0x39')](_0x4ef521[_0x2c2085]['update'](_0x14f7cf['body'],{'transaction':_0x512721}));}else if(!_0x1e1517[_0x5b99('0x3a')](_0x2f4996)){_0x1e1517['push'](_0x2f4996);_0x471408[_0x5b99('0x39')](_0x4ef521[_0x2c2085][_0x5b99('0x26')](_0x14f7cf[_0x5b99('0x24')],{'transaction':_0x512721}));}}return BPromise[_0x5b99('0x3b')](_0x471408);});})[_0x5b99('0xc')](function(_0x1dc26a){logger[_0x5b99('0xd')](_0x5b99('0x2a'),_0x14f7cf);if(_0x1dc26a[_0x5b99('0x37')]>0x0){logger[_0x5b99('0xd')]('GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]',_0x1dc26a[0x0][_0x5b99('0x3c')]['id'],_0x1dc26a[0x0][_0x5b99('0x3c')][_0x5b99('0x3d')],_0x1dc26a[0x0][_0x5b99('0x3c')]['active']);}logger[_0x5b99('0xf')](_0x5b99('0x2a'),_0x14f7cf,JSON[_0x5b99('0x12')](_0x1dc26a));_0x40b503(_0x1dc26a);})[_0x5b99('0x17')](function(_0x3db60c){logger[_0x5b99('0x13')](_0x5b99('0x2a'),_0x3db60c[_0x5b99('0x15')],_0x14f7cf);_0x544b70(_0x171ccf['error'](0x1f4,_0x3db60c['message']));});});});};exports[_0x5b99('0x3e')]=function(_0x2b6798){var _0x22a5a7=this;return new Promise(function(_0x5656dc,_0x29f919){return db[_0x5b99('0x3f')][_0x5b99('0x2d')](function(_0x1a32aa){return db[_0x5b99('0x40')][_0x5b99('0x41')](_0x2b6798[_0x5b99('0x24')],{'raw':_0x2b6798[_0x5b99('0x1a')]?_0x2b6798[_0x5b99('0x1a')]['raw']===undefined?!![]:![]:!![],'transaction':_0x1a32aa})[_0x5b99('0xc')](function(){logger[_0x5b99('0xd')](_0x5b99('0x42'),JSON[_0x5b99('0x12')](_0x2b6798[_0x5b99('0x1a')][_0x5b99('0x1c')]),_0x2b6798['options'][_0x5b99('0x1c')]['active']);return db['CmHopper']['destroy']({'where':_0x2b6798[_0x5b99('0x1a')]?_0x2b6798[_0x5b99('0x1a')]['where']||null:null,'transaction':_0x1a32aa});});})[_0x5b99('0xc')](function(_0x168791){logger[_0x5b99('0xd')](_0x5b99('0x3e'),_0x2b6798);logger['debug'](_0x5b99('0x3e'),_0x2b6798,JSON[_0x5b99('0x12')](_0x168791));_0x5656dc(_0x168791);})['catch'](function(_0x4c7e67){logger[_0x5b99('0x13')](_0x5b99('0x3e'),_0x4c7e67[_0x5b99('0x15')],_0x2b6798);_0x29f919(_0x22a5a7['error'](0x1f4,_0x4c7e67['message']));});});};exports[_0x5b99('0x43')]=function(_0x499390){var _0x5051e4=this;return new Promise(function(_0x715cde,_0x39a51e){return db['CmHopper'][_0x5b99('0x2e')]({'raw':_0x499390[_0x5b99('0x1a')]?_0x499390[_0x5b99('0x1a')][_0x5b99('0x1b')]===undefined?!![]:![]:!![],'where':_0x499390[_0x5b99('0x1a')]?_0x499390[_0x5b99('0x1a')][_0x5b99('0x1c')]||null:null,'attributes':[[db[_0x5b99('0x3f')]['fn'](_0x5b99('0x44'),db['sequelize']['fn']('IF',db[_0x5b99('0x3f')][_0x5b99('0x45')](_0x5b99('0x46')+util[_0x5b99('0x47')]('\x22%s\x22',moment()[_0x5b99('0x47')](_0x5b99('0x48')))+_0x5b99('0x49')))),_0x5b99('0x4a')]]})[_0x5b99('0xc')](function(_0xacd02a){logger[_0x5b99('0xd')]('CountReScheduled',_0x499390);logger[_0x5b99('0xf')](_0x5b99('0x43'),_0x499390,JSON['stringify'](_0xacd02a));_0x715cde(_0xacd02a);})[_0x5b99('0x17')](function(_0x21f36b){logger[_0x5b99('0x13')](_0x5b99('0x43'),_0x21f36b[_0x5b99('0x15')],_0x499390);_0x39a51e(_0x5051e4[_0x5b99('0x13')](0x1f4,_0x21f36b['message']));});});};exports[_0x5b99('0x4b')]=function(_0xd360e3){var _0x3a3d9d=this;return new Promise(function(_0xdf1712,_0x8c2854){return db[_0x5b99('0x2b')][_0x5b99('0x2c')]()['then'](function(_0x3cbcad){return db[_0x5b99('0x3f')][_0x5b99('0x2d')](function(_0x56c9f3){return db[_0x5b99('0x19')][_0x5b99('0x2e')]({'where':_0xd360e3[_0x5b99('0x1a')]?_0xd360e3['options'][_0x5b99('0x1c')]||null:null,'attributes':_0xd360e3[_0x5b99('0x1a')]?_0xd360e3[_0x5b99('0x1a')]['attributes']||null:null,'limit':0x1,'order':_0xd360e3[_0x5b99('0x1a')]?_0xd360e3[_0x5b99('0x1a')][_0x5b99('0x2f')]||null:null,'group':db[_0x5b99('0x19')][_0x5b99('0x38')],'transaction':_0x56c9f3,'lock':_0x56c9f3[_0x5b99('0x30')][_0x5b99('0x31')],'include':_0xd360e3['options']?_0xd360e3[_0x5b99('0x1a')][_0x5b99('0x1f')]?_['map'](_0xd360e3[_0x5b99('0x1a')][_0x5b99('0x1f')],function(_0x2d4a87){return{'model':db[_0x2d4a87[_0x5b99('0x21')]],'as':_0x2d4a87['as'],'attributes':_0x2d4a87[_0x5b99('0x1d')],'include':_0x2d4a87['include']?_['map'](_0x2d4a87[_0x5b99('0x1f')],function(_0x3f1d12){return{'model':db[_0x3f1d12['model']],'as':_0x3f1d12['as'],'attributes':_0x3f1d12['attributes'],'include':_0x3f1d12[_0x5b99('0x1f')]?_[_0x5b99('0x20')](_0x3f1d12[_0x5b99('0x1f')],function(_0x164ba4){return{'model':db[_0x164ba4['model']],'as':_0x164ba4['as'],'attributes':_0x164ba4[_0x5b99('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x274e70){var _0x459491=[];for(var _0x4b825f=0x0;_0x4b825f<_0x274e70['length'];_0x4b825f+=0x1){_0x459491[_0x5b99('0x39')](_0x274e70[_0x4b825f][_0x5b99('0x26')](_0xd360e3['body'],{'transaction':_0x56c9f3}));}return BPromise[_0x5b99('0x3b')](_0x459491);});})[_0x5b99('0xc')](function(_0x11646c){logger['info']('GetContactRecallMe',_0xd360e3);logger['debug']('GetContactRecallMe',_0xd360e3,JSON[_0x5b99('0x12')](_0x11646c));_0xdf1712(_0x11646c);})[_0x5b99('0x17')](function(_0x4312e8){logger['error'](_0x5b99('0x4b'),_0x4312e8['message'],_0xd360e3);_0x8c2854(_0x3a3d9d[_0x5b99('0x13')](0x1f4,_0x4312e8['message']));});});});};exports[_0x5b99('0x4c')]=function(_0xf75647){var _0x306e9e=this;return new Promise(function(_0x2203b6,_0xeff084){db[_0x5b99('0x2b')]['describe']()[_0x5b99('0xc')](function(_0x2a50fa){return db[_0x5b99('0x19')]['findAll']({'raw':_0xf75647[_0x5b99('0x1a')]?_0xf75647[_0x5b99('0x1a')][_0x5b99('0x1b')]===undefined?!![]:![]:!![],'where':_0xf75647[_0x5b99('0x1a')]?_0xf75647[_0x5b99('0x1a')][_0x5b99('0x1c')]||null:null,'attributes':_0xf75647[_0x5b99('0x1a')]?_0xf75647[_0x5b99('0x1a')]['attributes']||null:null,'limit':_0xf75647[_0x5b99('0x1a')]?_0xf75647[_0x5b99('0x1a')]['limit']||null:null,'include':_0xf75647[_0x5b99('0x1a')]?_0xf75647[_0x5b99('0x1a')]['include']?_[_0x5b99('0x20')](_0xf75647['options'][_0x5b99('0x1f')],function(_0x4693a4){return{'model':db[_0x4693a4[_0x5b99('0x21')]],'as':_0x4693a4['as'],'attributes':_0x4693a4['as']===_0x5b99('0x32')?_[_0x5b99('0x4d')](_0x2a50fa):_0x4693a4[_0x5b99('0x1d')],'include':_0x4693a4[_0x5b99('0x1f')]?_[_0x5b99('0x20')](_0x4693a4[_0x5b99('0x1f')],function(_0x5dbb48){return{'model':db[_0x5dbb48['model']],'as':_0x5dbb48['as'],'attributes':_0x5dbb48[_0x5b99('0x1d')],'include':_0x5dbb48[_0x5b99('0x1f')]?_[_0x5b99('0x20')](_0x5dbb48[_0x5b99('0x1f')],function(_0x345c1b){return{'model':db[_0x345c1b[_0x5b99('0x21')]],'as':_0x345c1b['as'],'attributes':_0x345c1b[_0x5b99('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1caead){logger[_0x5b99('0xd')]('GetCmHopper',_0xf75647);logger['debug']('GetCmHopper',_0xf75647,JSON[_0x5b99('0x12')](_0x1caead));_0x2203b6(_0x1caead);})[_0x5b99('0x17')](function(_0x54f7de){logger['error'](_0x5b99('0x18'),_0x54f7de[_0x5b99('0x15')],_0xf75647);_0xeff084(_0x306e9e[_0x5b99('0x13')](0x1f4,_0x54f7de['message']));});});});};exports[_0x5b99('0x4e')]=function(_0x2e54b7){var _0x1f158c=this;return new Promise(function(_0x287cdc,_0x4df3e8){return db[_0x5b99('0x2b')][_0x5b99('0x4f')]({'raw':!![],'where':{'phone':_0x2e54b7['options'][_0x5b99('0x1c')]['phone']},'attributes':['id',_0x5b99('0x50')],'order':[['id',_0x5b99('0x51')]]})[_0x5b99('0xc')](function(_0x10c963){logger[_0x5b99('0xd')](_0x5b99('0x52'),_0x2e54b7);logger[_0x5b99('0xf')]('getContactByPhone',_0x2e54b7,JSON[_0x5b99('0x12')](_0x10c963));_0x287cdc(_0x10c963);})[_0x5b99('0x17')](function(_0x48a71c){logger[_0x5b99('0x13')](_0x5b99('0x52'),_0x48a71c['message'],_0x2e54b7);_0x4df3e8(_0x1f158c[_0x5b99('0x13')](0x1f4,_0x48a71c['message']));});});};exports[_0x5b99('0x53')]=function(_0x540d90){var _0x3c5ed0=this;return new Promise(function(_0x145b32,_0x27fa1a){return db[_0x5b99('0x3f')][_0x5b99('0x2d')](function(_0x204c92){return db[_0x5b99('0x19')][_0x5b99('0x26')]({'active':![]},{'where':{},'transaction':_0x204c92})[_0x5b99('0xc')](function(_0xde7025){logger[_0x5b99('0xd')](_0x5b99('0x53'),_0x540d90);logger[_0x5b99('0xf')](_0x5b99('0x53'),_0x540d90,JSON[_0x5b99('0x12')](_0xde7025));_0x145b32(_0xde7025);})[_0x5b99('0x17')](function(_0x21087c){logger[_0x5b99('0x13')](_0x5b99('0x53'),_0x21087c[_0x5b99('0x15')],_0x540d90);_0x27fa1a(_0x3c5ed0[_0x5b99('0x13')](0x1f4,_0x21087c[_0x5b99('0x15')]));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0xaab709){var _0x50a42b=this;var _0x1c8548=_0xaab709['body'][_0x5b99('0x1c')]['voiceQueueId'];var _0xadb479=_0xaab709[_0x5b99('0x24')][_0x5b99('0x1c')][_0x5b99('0x54')];return new Promise(function(_0x3b1d03,_0x143b10){return db[_0x5b99('0x19')][_0x5b99('0x2e')]({'where':{'voiceQueueId':_0x1c8548,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db['sequelize']['literal']('NOW()\x20+\x20INTERVAL\x20'+_0xadb479+'\x20MINUTE')}},'include':[{'model':db[_0x5b99('0x2b')],'as':_0x5b99('0x32')},{'model':db[_0x5b99('0x33')],'as':_0x5b99('0x34'),'attributes':['id',_0x5b99('0x35'),'voicePause']},{'model':db[_0x5b99('0x55')],'as':'List'}]})[_0x5b99('0xc')](function(_0x4fa22a){return db[_0x5b99('0x3f')]['transaction'](function(_0x2a57ee){return db[_0x5b99('0x19')][_0x5b99('0x26')]({'recallmeNotifiedDate':new Date()},{'where':{'voiceQueueId':_0x1c8548,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db[_0x5b99('0x3f')][_0x5b99('0x45')](_0x5b99('0x56')+_0xadb479+_0x5b99('0x57'))}},'transaction':_0x2a57ee})[_0x5b99('0xc')](function(_0x49d9ea){_0x3b1d03(_0x4fa22a);})[_0x5b99('0x17')](function(_0x29983b){logger[_0x5b99('0x13')](_0x5b99('0x58'),_0x29983b[_0x5b99('0x15')],_0xaab709);_0x143b10(validateExpressRequest);});});})[_0x5b99('0x17')](function(_0x5e22cd){logger[_0x5b99('0x13')](_0x5b99('0x58'),_0x5e22cd['message'],_0xaab709);_0x143b10(_0x50a42b[_0x5b99('0x13')](0x1f4,_0x5e22cd[_0x5b99('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 29a16cb..b850788 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 _0xa9dd=['destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopper.controller','isAuthenticated','index','get','describe','/opencontacts','getOpenContacts','getTimezones','/:id','show','post','/preview','getPreview','getTimezone','/previewrecall','getPreviewRecall','put','update','delete'];(function(_0x5c34e9,_0x5ae892){var _0x337571=function(_0x1885f2){while(--_0x1885f2){_0x5c34e9['push'](_0x5c34e9['shift']());}};_0x337571(++_0x5ae892);}(_0xa9dd,0x1c2));var _0xda9d=function(_0x9b2bb0,_0x3965b1){_0x9b2bb0=_0x9b2bb0-0x0;var _0x2cdb3b=_0xa9dd[_0x9b2bb0];return _0x2cdb3b;};'use strict';var multer=require('multer');var util=require(_0xda9d('0x0'));var path=require(_0xda9d('0x1'));var timeout=require('connect-timeout');var express=require(_0xda9d('0x2'));var router=express[_0xda9d('0x3')]();var fs_extra=require(_0xda9d('0x4'));var auth=require(_0xda9d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xda9d('0x6'));var controller=require(_0xda9d('0x7'));router['get']('/',auth[_0xda9d('0x8')](),controller[_0xda9d('0x9')]);router[_0xda9d('0xa')]('/describe',auth[_0xda9d('0x8')](),controller[_0xda9d('0xb')]);router[_0xda9d('0xa')](_0xda9d('0xc'),auth[_0xda9d('0x8')](),controller[_0xda9d('0xd')]);router[_0xda9d('0xa')]('/timezones',auth['isAuthenticated'](),controller[_0xda9d('0xe')]);router[_0xda9d('0xa')](_0xda9d('0xf'),auth[_0xda9d('0x8')](),controller[_0xda9d('0x10')]);router[_0xda9d('0x11')]('/',auth[_0xda9d('0x8')](),controller['create']);router[_0xda9d('0x11')](_0xda9d('0x12'),auth[_0xda9d('0x8')](),controller[_0xda9d('0x13')]);router[_0xda9d('0x11')]('/timezone',auth[_0xda9d('0x8')](),controller[_0xda9d('0x14')]);router[_0xda9d('0x11')](_0xda9d('0x15'),auth[_0xda9d('0x8')](),controller[_0xda9d('0x16')]);router[_0xda9d('0x17')](_0xda9d('0xf'),auth[_0xda9d('0x8')](),controller[_0xda9d('0x18')]);router[_0xda9d('0x19')](_0xda9d('0xf'),auth[_0xda9d('0x8')](),controller[_0xda9d('0x1a')]);module[_0xda9d('0x1b')]=router; \ No newline at end of file +var _0xf65a=['../../config/environment','get','index','/describe','isAuthenticated','describe','getOpenContacts','/timezones','getTimezones','/:id','post','/preview','getPreview','/timezone','getTimezone','/previewrecall','getPreviewRecall','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x4161e2,_0x283826){var _0x4d2b8e=function(_0x32a4b2){while(--_0x32a4b2){_0x4161e2['push'](_0x4161e2['shift']());}};_0x4d2b8e(++_0x283826);}(_0xf65a,0xbd));var _0xaf65=function(_0x254d40,_0x25ae9d){_0x254d40=_0x254d40-0x0;var _0x3f229d=_0xf65a[_0x254d40];return _0x3f229d;};'use strict';var multer=require(_0xaf65('0x0'));var util=require(_0xaf65('0x1'));var path=require(_0xaf65('0x2'));var timeout=require(_0xaf65('0x3'));var express=require(_0xaf65('0x4'));var router=express[_0xaf65('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xaf65('0x6'));var config=require(_0xaf65('0x7'));var controller=require('./cmHopper.controller');router[_0xaf65('0x8')]('/',auth['isAuthenticated'](),controller[_0xaf65('0x9')]);router['get'](_0xaf65('0xa'),auth[_0xaf65('0xb')](),controller[_0xaf65('0xc')]);router['get']('/opencontacts',auth[_0xaf65('0xb')](),controller[_0xaf65('0xd')]);router[_0xaf65('0x8')](_0xaf65('0xe'),auth[_0xaf65('0xb')](),controller[_0xaf65('0xf')]);router['get'](_0xaf65('0x10'),auth[_0xaf65('0xb')](),controller['show']);router['post']('/',auth[_0xaf65('0xb')](),controller['create']);router[_0xaf65('0x11')](_0xaf65('0x12'),auth['isAuthenticated'](),controller[_0xaf65('0x13')]);router['post'](_0xaf65('0x14'),auth[_0xaf65('0xb')](),controller[_0xaf65('0x15')]);router['post'](_0xaf65('0x16'),auth[_0xaf65('0xb')](),controller[_0xaf65('0x17')]);router[_0xaf65('0x18')]('/:id',auth[_0xaf65('0xb')](),controller['update']);router[_0xaf65('0x19')]('/:id',auth[_0xaf65('0xb')](),controller[_0xaf65('0x1a')]);module[_0xaf65('0x1b')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index b133721..c0aa331 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 _0x972c=['contactListQueue','INTEGER','exports','STRING'];(function(_0x58f012,_0x2dce4e){var _0x3d7842=function(_0x3dc3ea){while(--_0x3dc3ea){_0x58f012['push'](_0x58f012['shift']());}};_0x3d7842(++_0x2dce4e);}(_0x972c,0xf2));var _0xc972=function(_0x4b14cd,_0x16a510){_0x4b14cd=_0x4b14cd-0x0;var _0x4d6572=_0x972c[_0x4b14cd];return _0x4d6572;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xc972('0x0')]={'phone':{'type':Sequelize[_0xc972('0x1')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0xc972('0x2')},'ListId':{'type':Sequelize[_0xc972('0x3')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xc972('0x2')}}; \ No newline at end of file +var _0x8f05=['sequelize','exports','INTEGER','contactListQueue','moment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8f05,0x1cb));var _0x58f0=function(_0x1091d4,_0x635912){_0x1091d4=_0x1091d4-0x0;var _0x1fb6e0=_0x8f05[_0x1091d4];return _0x1fb6e0;};'use strict';var moment=require(_0x58f0('0x0'));var Sequelize=require(_0x58f0('0x1'));module[_0x58f0('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x58f0('0x3')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x58f0('0x3')],'unique':_0x58f0('0x4')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x58f0('0x4')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index aa96adf..f1407b0 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 _0x15bf=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','then','destroy','error','stack','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','merge','type','VIRTUAL','filter','includeAll','include','findAll','catch','show','params','options','find','update','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api'];(function(_0x48d503,_0x2eefa0){var _0x4dbdf8=function(_0xc04e10){while(--_0xc04e10){_0x48d503['push'](_0x48d503['shift']());}};_0x4dbdf8(++_0x2eefa0);}(_0x15bf,0x7b));var _0xf15b=function(_0xe45118,_0x5dffbc){_0xe45118=_0xe45118-0x0;var _0x15e15d=_0x15bf[_0xe45118];return _0x15e15d;};'use strict';var emlformat=require(_0xf15b('0x0'));var rimraf=require(_0xf15b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf15b('0x2'));var rp=require(_0xf15b('0x3'));var moment=require(_0xf15b('0x4'));var BPromise=require(_0xf15b('0x5'));var Mustache=require(_0xf15b('0x6'));var util=require(_0xf15b('0x7'));var path=require(_0xf15b('0x8'));var sox=require(_0xf15b('0x9'));var csv=require('to-csv');var ejs=require(_0xf15b('0xa'));var fs=require('fs');var fs_extra=require(_0xf15b('0xb'));var _=require(_0xf15b('0xc'));var squel=require(_0xf15b('0xd'));var crypto=require(_0xf15b('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xf15b('0xf'));var toCsv=require('to-csv');var querystring=require(_0xf15b('0x10'));var Papa=require(_0xf15b('0x11'));var Redis=require('ioredis');var authService=require(_0xf15b('0x12'));var qs=require(_0xf15b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf15b('0x14'));var logger=require(_0xf15b('0x15'))(_0xf15b('0x16'));var utils=require(_0xf15b('0x17'));var config=require(_0xf15b('0x18'));var licenseUtil=require(_0xf15b('0x19'));var db=require(_0xf15b('0x1a'))['db'];function respondWithStatusCode(_0x404651,_0x5b0720){_0x5b0720=_0x5b0720||0xcc;return function(_0x16c7bc){if(_0x16c7bc){return _0x404651[_0xf15b('0x1b')](_0x5b0720);}return _0x404651['status'](_0x5b0720)[_0xf15b('0x1c')]();};}function respondWithResult(_0x38c530,_0x98c874){_0x98c874=_0x98c874||0xc8;return function(_0x11fe00){if(_0x11fe00){return _0x38c530[_0xf15b('0x1d')](_0x98c874)[_0xf15b('0x1e')](_0x11fe00);}};}function respondWithFilteredResult(_0x10150f,_0x36805f){return function(_0x4a9647){if(_0x4a9647){var _0x299d03=typeof _0x36805f['offset']===_0xf15b('0x1f')&&typeof _0x36805f[_0xf15b('0x20')]===_0xf15b('0x1f');var _0x11a0db=_0x4a9647[_0xf15b('0x21')];var _0x199def=_0x299d03?0x0:_0x36805f[_0xf15b('0x22')];var _0x4fce5c=_0x299d03?_0x4a9647[_0xf15b('0x21')]:_0x36805f['offset']+_0x36805f[_0xf15b('0x20')];var _0x5cef7d;if(_0x4fce5c>=_0x11a0db){_0x4fce5c=_0x11a0db;_0x5cef7d=0xc8;}else{_0x5cef7d=0xce;}_0x10150f[_0xf15b('0x1d')](_0x5cef7d);return _0x10150f[_0xf15b('0x23')]('Content-Range',_0x199def+'-'+_0x4fce5c+'/'+_0x11a0db)[_0xf15b('0x1e')](_0x4a9647);}return null;};}function patchUpdates(_0x219dae){return function(_0x547c9b){try{jsonpatch['apply'](_0x547c9b,_0x219dae,!![]);}catch(_0x8e971){return BPromise['reject'](_0x8e971);}return _0x547c9b['save']();};}function saveUpdates(_0x3af3d0,_0x1ed316){return function(_0x298ba8){if(_0x298ba8){return _0x298ba8['update'](_0x3af3d0)[_0xf15b('0x24')](function(_0x256da1){return _0x256da1;});}return null;};}function removeEntity(_0x4bad37,_0x48185f){return function(_0x2c0f0d){if(_0x2c0f0d){return _0x2c0f0d[_0xf15b('0x25')]()[_0xf15b('0x24')](function(){_0x4bad37[_0xf15b('0x1d')](0xcc)[_0xf15b('0x1c')]();});}};}function handleEntityNotFound(_0x2297ef,_0x43cb8c){return function(_0x527ce3){if(!_0x527ce3){_0x2297ef[_0xf15b('0x1b')](0x194);}return _0x527ce3;};}function handleError(_0x52dc65,_0x1eaf5a){_0x1eaf5a=_0x1eaf5a||0x1f4;return function(_0x451dae){logger[_0xf15b('0x26')](_0x451dae[_0xf15b('0x27')]);if(_0x451dae[_0xf15b('0x28')]){delete _0x451dae[_0xf15b('0x28')];}_0x52dc65[_0xf15b('0x1d')](_0x1eaf5a)[_0xf15b('0x29')](_0x451dae);};}exports[_0xf15b('0x2a')]=function(_0x54fc58,_0x25f46a){var _0x189107={},_0x54262c={},_0x4f560c={'count':0x0,'rows':[]};var _0x23a250=_[_0xf15b('0x2b')](db[_0xf15b('0x2c')][_0xf15b('0x2d')],function(_0x2ccd5d){return{'name':_0x2ccd5d[_0xf15b('0x2e')],'type':_0x2ccd5d['type']['key']};});_0x54262c[_0xf15b('0x2f')]=_[_0xf15b('0x2b')](_0x23a250,_0xf15b('0x28'));_0x54262c['query']=_[_0xf15b('0x30')](_0x54fc58[_0xf15b('0x31')]);_0x54262c[_0xf15b('0x32')]=_[_0xf15b('0x33')](_0x54262c[_0xf15b('0x2f')],_0x54262c['query']);_0x189107[_0xf15b('0x34')]=_[_0xf15b('0x33')](_0x54262c[_0xf15b('0x2f')],qs[_0xf15b('0x35')](_0x54fc58[_0xf15b('0x31')]['fields']));_0x189107[_0xf15b('0x34')]=_0x189107['attributes'][_0xf15b('0x36')]?_0x189107['attributes']:_0x54262c[_0xf15b('0x2f')];if(!_0x54fc58['query']['hasOwnProperty'](_0xf15b('0x37'))){_0x189107[_0xf15b('0x20')]=qs['limit'](_0x54fc58['query']['limit']);_0x189107['offset']=qs[_0xf15b('0x22')](_0x54fc58[_0xf15b('0x31')][_0xf15b('0x22')]);}_0x189107['order']=qs['sort'](_0x54fc58[_0xf15b('0x31')][_0xf15b('0x38')]);_0x189107[_0xf15b('0x39')]=qs[_0xf15b('0x32')](_['pick'](_0x54fc58[_0xf15b('0x31')],_0x54262c[_0xf15b('0x32')]),_0x23a250);if(_0x54fc58['query']['filter']){_0x189107[_0xf15b('0x39')]=_[_0xf15b('0x3a')](_0x189107['where'],{'$or':_[_0xf15b('0x2b')](_0x23a250,function(_0x60a327){if(_0x60a327[_0xf15b('0x3b')]!==_0xf15b('0x3c')){var _0x466780={};_0x466780[_0x60a327['name']]={'$like':'%'+_0x54fc58[_0xf15b('0x31')][_0xf15b('0x3d')]+'%'};return _0x466780;}})});}_0x189107=_['merge']({},_0x189107,_0x54fc58['options']);var _0x2639cc={'where':_0x189107[_0xf15b('0x39')]};return db[_0xf15b('0x2c')][_0xf15b('0x21')](_0x2639cc)['then'](function(_0x3b5a2b){_0x4f560c[_0xf15b('0x21')]=_0x3b5a2b;if(_0x54fc58[_0xf15b('0x31')][_0xf15b('0x3e')]){_0x189107[_0xf15b('0x3f')]=[{'all':!![]}];}return db[_0xf15b('0x2c')][_0xf15b('0x40')](_0x189107);})[_0xf15b('0x24')](function(_0x11448c){_0x4f560c['rows']=_0x11448c;return _0x4f560c;})[_0xf15b('0x24')](respondWithFilteredResult(_0x25f46a,_0x189107))[_0xf15b('0x41')](handleError(_0x25f46a,null));};exports[_0xf15b('0x42')]=function(_0x5093ab,_0x134e5e){var _0x2ff717={'raw':!![],'where':{'id':_0x5093ab[_0xf15b('0x43')]['id']}},_0x221f08={};_0x221f08[_0xf15b('0x2f')]=_[_0xf15b('0x30')](db[_0xf15b('0x2c')]['rawAttributes']);_0x221f08[_0xf15b('0x31')]=_[_0xf15b('0x30')](_0x5093ab[_0xf15b('0x31')]);_0x221f08[_0xf15b('0x32')]=_[_0xf15b('0x33')](_0x221f08[_0xf15b('0x2f')],_0x221f08[_0xf15b('0x31')]);_0x2ff717[_0xf15b('0x34')]=_['intersection'](_0x221f08['model'],qs['fields'](_0x5093ab[_0xf15b('0x31')][_0xf15b('0x35')]));_0x2ff717[_0xf15b('0x34')]=_0x2ff717['attributes']['length']?_0x2ff717[_0xf15b('0x34')]:_0x221f08['model'];if(_0x5093ab[_0xf15b('0x31')][_0xf15b('0x3e')]){_0x2ff717['include']=[{'all':!![]}];}_0x2ff717=_['merge']({},_0x2ff717,_0x5093ab[_0xf15b('0x44')]);return db[_0xf15b('0x2c')][_0xf15b('0x45')](_0x2ff717)[_0xf15b('0x24')](handleEntityNotFound(_0x134e5e,null))[_0xf15b('0x24')](respondWithResult(_0x134e5e,null))[_0xf15b('0x41')](handleError(_0x134e5e,null));};exports[_0xf15b('0x46')]=function(_0x4eef06,_0x537b8d){if(_0x4eef06[_0xf15b('0x47')]['id']){delete _0x4eef06[_0xf15b('0x47')]['id'];}return db['CmHopperBlack'][_0xf15b('0x45')]({'where':{'id':_0x4eef06['params']['id']}})['then'](handleEntityNotFound(_0x537b8d,null))['then'](saveUpdates(_0x4eef06['body'],null))[_0xf15b('0x24')](respondWithResult(_0x537b8d,null))[_0xf15b('0x41')](handleError(_0x537b8d,null));};exports['destroy']=function(_0x2c7abf,_0x415613){return db['CmHopperBlack']['find']({'where':{'id':_0x2c7abf[_0xf15b('0x43')]['id']}})[_0xf15b('0x24')](handleEntityNotFound(_0x415613,null))[_0xf15b('0x24')](removeEntity(_0x415613,null))['catch'](handleError(_0x415613,null));};exports[_0xf15b('0x48')]=function(_0x42bea8,_0x3c1ba0){return db[_0xf15b('0x2c')][_0xf15b('0x48')]()[_0xf15b('0x24')](respondWithResult(_0x3c1ba0,null))[_0xf15b('0x41')](handleError(_0x3c1ba0,null));}; \ No newline at end of file +var _0x35cf=['../../mysqldb','end','status','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','CmHopperBlack','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x17afb5,_0x5dc495){var _0x4977b2=function(_0x3b3559){while(--_0x3b3559){_0x17afb5['push'](_0x17afb5['shift']());}};_0x4977b2(++_0x5dc495);}(_0x35cf,0x118));var _0xf35c=function(_0x5e4a6a,_0x287632){_0x5e4a6a=_0x5e4a6a-0x0;var _0xc8879f=_0x35cf[_0x5e4a6a];return _0xc8879f;};'use strict';var emlformat=require(_0xf35c('0x0'));var rimraf=require(_0xf35c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf35c('0x2'));var rp=require(_0xf35c('0x3'));var moment=require(_0xf35c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf35c('0x5'));var util=require(_0xf35c('0x6'));var path=require(_0xf35c('0x7'));var sox=require(_0xf35c('0x8'));var csv=require(_0xf35c('0x9'));var ejs=require(_0xf35c('0xa'));var fs=require('fs');var fs_extra=require(_0xf35c('0xb'));var _=require(_0xf35c('0xc'));var squel=require(_0xf35c('0xd'));var crypto=require(_0xf35c('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf35c('0xf'));var Papa=require(_0xf35c('0x10'));var Redis=require(_0xf35c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xf35c('0x12'));var as=require(_0xf35c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf35c('0x14'))(_0xf35c('0x15'));var utils=require(_0xf35c('0x16'));var config=require(_0xf35c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xf35c('0x18'))['db'];function respondWithStatusCode(_0x590a34,_0xd5c768){_0xd5c768=_0xd5c768||0xcc;return function(_0x30bd8c){if(_0x30bd8c){return _0x590a34['sendStatus'](_0xd5c768);}return _0x590a34['status'](_0xd5c768)[_0xf35c('0x19')]();};}function respondWithResult(_0x37c6ab,_0x4be773){_0x4be773=_0x4be773||0xc8;return function(_0x25c071){if(_0x25c071){return _0x37c6ab[_0xf35c('0x1a')](_0x4be773)['json'](_0x25c071);}};}function respondWithFilteredResult(_0x424eb8,_0x2719ac){return function(_0x3b2550){if(_0x3b2550){var _0x4ff712=typeof _0x2719ac[_0xf35c('0x1b')]===_0xf35c('0x1c')&&typeof _0x2719ac[_0xf35c('0x1d')]===_0xf35c('0x1c');var _0x2a04d8=_0x3b2550[_0xf35c('0x1e')];var _0x1a28f7=_0x4ff712?0x0:_0x2719ac[_0xf35c('0x1b')];var _0x1e396=_0x4ff712?_0x3b2550[_0xf35c('0x1e')]:_0x2719ac[_0xf35c('0x1b')]+_0x2719ac[_0xf35c('0x1d')];var _0x485799;if(_0x1e396>=_0x2a04d8){_0x1e396=_0x2a04d8;_0x485799=0xc8;}else{_0x485799=0xce;}_0x424eb8[_0xf35c('0x1a')](_0x485799);return _0x424eb8['set'](_0xf35c('0x1f'),_0x1a28f7+'-'+_0x1e396+'/'+_0x2a04d8)['json'](_0x3b2550);}return null;};}function patchUpdates(_0x245640){return function(_0x11130b){try{jsonpatch[_0xf35c('0x20')](_0x11130b,_0x245640,!![]);}catch(_0x3acd12){return BPromise[_0xf35c('0x21')](_0x3acd12);}return _0x11130b[_0xf35c('0x22')]();};}function saveUpdates(_0x76d6bf,_0x439f1f){return function(_0x2a3faf){if(_0x2a3faf){return _0x2a3faf[_0xf35c('0x23')](_0x76d6bf)[_0xf35c('0x24')](function(_0xf0a97){return _0xf0a97;});}return null;};}function removeEntity(_0x79f485,_0x5167e5){return function(_0xa52dc0){if(_0xa52dc0){return _0xa52dc0[_0xf35c('0x25')]()[_0xf35c('0x24')](function(){_0x79f485['status'](0xcc)[_0xf35c('0x19')]();});}};}function handleEntityNotFound(_0x1c9c62,_0x49880b){return function(_0x245757){if(!_0x245757){_0x1c9c62[_0xf35c('0x26')](0x194);}return _0x245757;};}function handleError(_0x2a6186,_0x1a9a5b){_0x1a9a5b=_0x1a9a5b||0x1f4;return function(_0x4106a0){logger[_0xf35c('0x27')](_0x4106a0[_0xf35c('0x28')]);if(_0x4106a0[_0xf35c('0x29')]){delete _0x4106a0[_0xf35c('0x29')];}_0x2a6186[_0xf35c('0x1a')](_0x1a9a5b)[_0xf35c('0x2a')](_0x4106a0);};}exports['index']=function(_0x5a91d3,_0x23c229){var _0x103c80={},_0x20ef19={},_0x4e4570={'count':0x0,'rows':[]};var _0x517ca2=_[_0xf35c('0x2b')](db[_0xf35c('0x2c')][_0xf35c('0x2d')],function(_0x376d90){return{'name':_0x376d90[_0xf35c('0x2e')],'type':_0x376d90[_0xf35c('0x2f')][_0xf35c('0x30')]};});_0x20ef19[_0xf35c('0x31')]=_[_0xf35c('0x2b')](_0x517ca2,_0xf35c('0x29'));_0x20ef19[_0xf35c('0x32')]=_[_0xf35c('0x33')](_0x5a91d3[_0xf35c('0x32')]);_0x20ef19[_0xf35c('0x34')]=_[_0xf35c('0x35')](_0x20ef19['model'],_0x20ef19[_0xf35c('0x32')]);_0x103c80[_0xf35c('0x36')]=_[_0xf35c('0x35')](_0x20ef19[_0xf35c('0x31')],qs[_0xf35c('0x37')](_0x5a91d3[_0xf35c('0x32')][_0xf35c('0x37')]));_0x103c80[_0xf35c('0x36')]=_0x103c80['attributes'][_0xf35c('0x38')]?_0x103c80['attributes']:_0x20ef19[_0xf35c('0x31')];if(!_0x5a91d3[_0xf35c('0x32')]['hasOwnProperty'](_0xf35c('0x39'))){_0x103c80['limit']=qs[_0xf35c('0x1d')](_0x5a91d3[_0xf35c('0x32')][_0xf35c('0x1d')]);_0x103c80['offset']=qs[_0xf35c('0x1b')](_0x5a91d3[_0xf35c('0x32')]['offset']);}_0x103c80[_0xf35c('0x3a')]=qs[_0xf35c('0x3b')](_0x5a91d3[_0xf35c('0x32')][_0xf35c('0x3b')]);_0x103c80[_0xf35c('0x3c')]=qs[_0xf35c('0x34')](_[_0xf35c('0x3d')](_0x5a91d3[_0xf35c('0x32')],_0x20ef19[_0xf35c('0x34')]),_0x517ca2);if(_0x5a91d3[_0xf35c('0x32')][_0xf35c('0x3e')]){_0x103c80['where']=_[_0xf35c('0x3f')](_0x103c80[_0xf35c('0x3c')],{'$or':_[_0xf35c('0x2b')](_0x517ca2,function(_0x5e437e){if(_0x5e437e[_0xf35c('0x2f')]!==_0xf35c('0x40')){var _0x5a4b56={};_0x5a4b56[_0x5e437e[_0xf35c('0x29')]]={'$like':'%'+_0x5a91d3[_0xf35c('0x32')]['filter']+'%'};return _0x5a4b56;}})});}_0x103c80=_[_0xf35c('0x3f')]({},_0x103c80,_0x5a91d3['options']);var _0x26a705={'where':_0x103c80['where']};return db[_0xf35c('0x2c')][_0xf35c('0x1e')](_0x26a705)[_0xf35c('0x24')](function(_0x284e12){_0x4e4570[_0xf35c('0x1e')]=_0x284e12;if(_0x5a91d3[_0xf35c('0x32')][_0xf35c('0x41')]){_0x103c80[_0xf35c('0x42')]=[{'all':!![]}];}return db[_0xf35c('0x2c')][_0xf35c('0x43')](_0x103c80);})[_0xf35c('0x24')](function(_0x328d46){_0x4e4570[_0xf35c('0x44')]=_0x328d46;return _0x4e4570;})[_0xf35c('0x24')](respondWithFilteredResult(_0x23c229,_0x103c80))[_0xf35c('0x45')](handleError(_0x23c229,null));};exports[_0xf35c('0x46')]=function(_0x3a2703,_0x4f970a){var _0x4ff333={'raw':!![],'where':{'id':_0x3a2703[_0xf35c('0x47')]['id']}},_0x3da4f1={};_0x3da4f1[_0xf35c('0x31')]=_['keys'](db[_0xf35c('0x2c')][_0xf35c('0x2d')]);_0x3da4f1[_0xf35c('0x32')]=_[_0xf35c('0x33')](_0x3a2703[_0xf35c('0x32')]);_0x3da4f1[_0xf35c('0x34')]=_['intersection'](_0x3da4f1['model'],_0x3da4f1[_0xf35c('0x32')]);_0x4ff333[_0xf35c('0x36')]=_[_0xf35c('0x35')](_0x3da4f1[_0xf35c('0x31')],qs[_0xf35c('0x37')](_0x3a2703[_0xf35c('0x32')][_0xf35c('0x37')]));_0x4ff333[_0xf35c('0x36')]=_0x4ff333['attributes'][_0xf35c('0x38')]?_0x4ff333[_0xf35c('0x36')]:_0x3da4f1['model'];if(_0x3a2703[_0xf35c('0x32')][_0xf35c('0x41')]){_0x4ff333[_0xf35c('0x42')]=[{'all':!![]}];}_0x4ff333=_[_0xf35c('0x3f')]({},_0x4ff333,_0x3a2703[_0xf35c('0x48')]);return db[_0xf35c('0x2c')][_0xf35c('0x49')](_0x4ff333)[_0xf35c('0x24')](handleEntityNotFound(_0x4f970a,null))[_0xf35c('0x24')](respondWithResult(_0x4f970a,null))[_0xf35c('0x45')](handleError(_0x4f970a,null));};exports[_0xf35c('0x23')]=function(_0x5b27b5,_0x3fea3a){if(_0x5b27b5['body']['id']){delete _0x5b27b5[_0xf35c('0x4a')]['id'];}return db[_0xf35c('0x2c')]['find']({'where':{'id':_0x5b27b5['params']['id']}})[_0xf35c('0x24')](handleEntityNotFound(_0x3fea3a,null))['then'](saveUpdates(_0x5b27b5[_0xf35c('0x4a')],null))['then'](respondWithResult(_0x3fea3a,null))[_0xf35c('0x45')](handleError(_0x3fea3a,null));};exports['destroy']=function(_0x39fa60,_0x11f414){return db[_0xf35c('0x2c')][_0xf35c('0x49')]({'where':{'id':_0x39fa60[_0xf35c('0x47')]['id']}})['then'](handleEntityNotFound(_0x11f414,null))['then'](removeEntity(_0x11f414,null))[_0xf35c('0x45')](handleError(_0x11f414,null));};exports[_0xf35c('0x4b')]=function(_0x1af17f,_0x5be0f5){return db[_0xf35c('0x2c')][_0xf35c('0x4b')]()[_0xf35c('0x24')](respondWithResult(_0x5be0f5,null))[_0xf35c('0x45')](handleError(_0x5be0f5,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index a8511ef..6d7be43 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 _0xe001=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','define'];(function(_0x48300a,_0x4e7c5f){var _0x5714f0=function(_0x5e3392){while(--_0x5e3392){_0x48300a['push'](_0x48300a['shift']());}};_0x5714f0(++_0x4e7c5f);}(_0xe001,0x1a8));var _0x1e00=function(_0x59ecd1,_0x4dc7dd){_0x59ecd1=_0x59ecd1-0x0;var _0x266580=_0xe001[_0x59ecd1];return _0x266580;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1e00('0x0'))('api');var moment=require('moment');var BPromise=require(_0x1e00('0x1'));var rp=require(_0x1e00('0x2'));var fs=require('fs');var path=require(_0x1e00('0x3'));var rimraf=require(_0x1e00('0x4'));var config=require(_0x1e00('0x5'));var attributes=require(_0x1e00('0x6'));module['exports']=function(_0x416acf,_0x1eaabb){return _0x416acf[_0x1e00('0x7')]('CmHopperBlack',attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xde21=['cm_hopper_black','lodash','../../config/logger','moment','path','rimraf','../../config/environment','exports','define'];(function(_0x235e2b,_0x232235){var _0x4e9f0a=function(_0x2f5bf2){while(--_0x2f5bf2){_0x235e2b['push'](_0x235e2b['shift']());}};_0x4e9f0a(++_0x232235);}(_0xde21,0x7f));var _0x1de2=function(_0x550099,_0x2096c4){_0x550099=_0x550099-0x0;var _0x31cd01=_0xde21[_0x550099];return _0x31cd01;};'use strict';var _=require(_0x1de2('0x0'));var util=require('util');var logger=require(_0x1de2('0x1'))('api');var moment=require(_0x1de2('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1de2('0x3'));var rimraf=require(_0x1de2('0x4'));var config=require(_0x1de2('0x5'));var attributes=require('./cmHopperBlack.attributes');module[_0x1de2('0x6')]=function(_0x1f084d,_0x1d95ad){return _0x1f084d[_0x1de2('0x7')]('CmHopperBlack',attributes,{'tableName':_0x1de2('0x8'),'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 a7ba515..fe76bdd 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 _0xeae3=['then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','code','message','result','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','attributes','limit','map','include','model','stringify','UpdateCmHopperBlack','update','body','where','catch','DestroyCmHopperBlack','destroy','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request'];(function(_0x56aabf,_0x461d46){var _0x8b2a1e=function(_0x46d8d7){while(--_0x46d8d7){_0x56aabf['push'](_0x56aabf['shift']());}};_0x8b2a1e(++_0x461d46);}(_0xeae3,0x12d));var _0x3eae=function(_0x4a7b46,_0x5e916c){_0x4a7b46=_0x4a7b46-0x0;var _0x436bee=_0xeae3[_0x4a7b46];return _0x436bee;};'use strict';var _=require(_0x3eae('0x0'));var util=require(_0x3eae('0x1'));var moment=require(_0x3eae('0x2'));var BPromise=require('bluebird');var rs=require(_0x3eae('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3eae('0x4'))['db'];var utils=require(_0x3eae('0x5'));var logger=require(_0x3eae('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3eae('0x7'));var client=jayson[_0x3eae('0x8')][_0x3eae('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5cb903,_0x328dd3,_0x4d444c){return new BPromise(function(_0x5a8eae,_0x548e4e){return client[_0x3eae('0xa')](_0x5cb903,_0x4d444c)[_0x3eae('0xb')](function(_0x5a3af3){logger[_0x3eae('0xc')](_0x3eae('0xd'),_0x328dd3,_0x3eae('0xe'));logger[_0x3eae('0xf')](_0x3eae('0x10'),_0x328dd3,'request\x20sent',JSON['stringify'](_0x5a3af3));if(_0x5a3af3[_0x3eae('0x11')]){if(_0x5a3af3['error'][_0x3eae('0x12')]===0x1f4){logger[_0x3eae('0x11')](_0x3eae('0xd'),_0x328dd3,_0x5a3af3[_0x3eae('0x11')]['message']);return _0x548e4e(_0x5a3af3[_0x3eae('0x11')][_0x3eae('0x13')]);}logger[_0x3eae('0x11')]('CmHopperBlack,\x20%s,\x20%s',_0x328dd3,_0x5a3af3[_0x3eae('0x11')]['message']);return _0x5a8eae(_0x5a3af3[_0x3eae('0x11')][_0x3eae('0x13')]);}else{logger['info'](_0x3eae('0xd'),_0x328dd3,_0x3eae('0xe'));_0x5a8eae(_0x5a3af3[_0x3eae('0x14')][_0x3eae('0x13')]);}})['catch'](function(_0x31281d){logger[_0x3eae('0x11')](_0x3eae('0xd'),_0x328dd3,_0x31281d);_0x548e4e(_0x31281d);});});}exports[_0x3eae('0x15')]=function(_0x1d7a3e){var _0xbc4970=this;return new Promise(function(_0x153f9c,_0x3eb48e){return db[_0x3eae('0x16')][_0x3eae('0x17')]({'raw':_0x1d7a3e[_0x3eae('0x18')]?_0x1d7a3e[_0x3eae('0x18')][_0x3eae('0x19')]===undefined?!![]:![]:!![],'where':_0x1d7a3e[_0x3eae('0x18')]?_0x1d7a3e[_0x3eae('0x18')]['where']||null:null,'attributes':_0x1d7a3e[_0x3eae('0x18')]?_0x1d7a3e['options'][_0x3eae('0x1a')]||null:null,'limit':_0x1d7a3e['options']?_0x1d7a3e[_0x3eae('0x18')][_0x3eae('0x1b')]||null:null,'include':_0x1d7a3e[_0x3eae('0x18')]?_0x1d7a3e[_0x3eae('0x18')]['include']?_[_0x3eae('0x1c')](_0x1d7a3e['options']['include'],function(_0x8b6d92){return{'model':db[_0x8b6d92['model']],'as':_0x8b6d92['as'],'attributes':_0x8b6d92[_0x3eae('0x1a')],'include':_0x8b6d92[_0x3eae('0x1d')]?_[_0x3eae('0x1c')](_0x8b6d92[_0x3eae('0x1d')],function(_0x1862f9){return{'model':db[_0x1862f9[_0x3eae('0x1e')]],'as':_0x1862f9['as'],'attributes':_0x1862f9['attributes'],'include':_0x1862f9[_0x3eae('0x1d')]?_[_0x3eae('0x1c')](_0x1862f9['include'],function(_0x2a39d0){return{'model':db[_0x2a39d0[_0x3eae('0x1e')]],'as':_0x2a39d0['as'],'attributes':_0x2a39d0['attributes']};}):[]};}):[]};}):[]:[]})[_0x3eae('0xb')](function(_0x4849a2){logger[_0x3eae('0xc')](_0x3eae('0x15'),_0x1d7a3e);logger[_0x3eae('0xf')](_0x3eae('0x15'),_0x1d7a3e,JSON[_0x3eae('0x1f')](_0x4849a2));_0x153f9c(_0x4849a2);})['catch'](function(_0xa92924){logger[_0x3eae('0x11')](_0x3eae('0x15'),_0xa92924[_0x3eae('0x13')],_0x1d7a3e);_0x3eb48e(_0xbc4970[_0x3eae('0x11')](0x1f4,_0xa92924[_0x3eae('0x13')]));});});};exports[_0x3eae('0x20')]=function(_0x3c33e1){var _0x1b7d64=this;return new Promise(function(_0x317d03,_0x5ba480){return db[_0x3eae('0x16')][_0x3eae('0x21')](_0x3c33e1[_0x3eae('0x22')],{'raw':_0x3c33e1[_0x3eae('0x18')]?_0x3c33e1[_0x3eae('0x18')][_0x3eae('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c33e1[_0x3eae('0x18')]?_0x3c33e1[_0x3eae('0x18')][_0x3eae('0x23')]||null:null,'attributes':_0x3c33e1[_0x3eae('0x18')]?_0x3c33e1[_0x3eae('0x18')][_0x3eae('0x1a')]||null:null,'limit':_0x3c33e1[_0x3eae('0x18')]?_0x3c33e1[_0x3eae('0x18')][_0x3eae('0x1b')]||null:null})[_0x3eae('0xb')](function(_0x290c1c){logger[_0x3eae('0xc')]('UpdateCmHopperBlack',_0x3c33e1);logger[_0x3eae('0xf')](_0x3eae('0x20'),_0x3c33e1,JSON[_0x3eae('0x1f')](_0x290c1c));_0x317d03(_0x290c1c);})[_0x3eae('0x24')](function(_0x4ceabe){logger[_0x3eae('0x11')](_0x3eae('0x20'),_0x4ceabe['message'],_0x3c33e1);_0x5ba480(_0x1b7d64[_0x3eae('0x11')](0x1f4,_0x4ceabe[_0x3eae('0x13')]));});});};exports[_0x3eae('0x25')]=function(_0x4aa8df){var _0x4dfa40=this;return new Promise(function(_0xe485a4,_0x44d1db){return db[_0x3eae('0x16')][_0x3eae('0x26')]({'where':_0x4aa8df['options']?_0x4aa8df[_0x3eae('0x18')][_0x3eae('0x23')]||null:null})[_0x3eae('0xb')](function(_0x285e1c){logger[_0x3eae('0xc')]('DestroyCmHopperBlack',_0x4aa8df);logger[_0x3eae('0xf')](_0x3eae('0x25'),_0x4aa8df,JSON['stringify'](_0x285e1c));_0xe485a4(_0x285e1c);})[_0x3eae('0x24')](function(_0x5807e8){logger['error']('DestroyCmHopperBlack',_0x5807e8[_0x3eae('0x13')],_0x4aa8df);_0x44d1db(_0x4dfa40[_0x3eae('0x11')](0x1f4,_0x5807e8[_0x3eae('0x13')]));});});}; \ No newline at end of file +var _0xa7b2=['options','where','attributes','include','model','map','catch','UpdateCmHopperBlack','update','limit','DestroyCmHopperBlack','destroy','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','debug','request\x20sent','stringify','error','code','CmHopperBlack,\x20%s,\x20%s','message','GetCmHopperBlack','CmHopperBlack','raw'];(function(_0x28746b,_0x2fc352){var _0xd0be1c=function(_0x2b860c){while(--_0x2b860c){_0x28746b['push'](_0x28746b['shift']());}};_0xd0be1c(++_0x2fc352);}(_0xa7b2,0x159));var _0x2a7b=function(_0xb20440,_0x249104){_0xb20440=_0xb20440-0x0;var _0x3ed6d1=_0xa7b2[_0xb20440];return _0x3ed6d1;};'use strict';var _=require(_0x2a7b('0x0'));var util=require(_0x2a7b('0x1'));var moment=require(_0x2a7b('0x2'));var BPromise=require(_0x2a7b('0x3'));var rs=require(_0x2a7b('0x4'));var fs=require('fs');var Redis=require(_0x2a7b('0x5'));var db=require(_0x2a7b('0x6'))['db'];var utils=require(_0x2a7b('0x7'));var logger=require(_0x2a7b('0x8'))(_0x2a7b('0x9'));var config=require('../../config/environment');var jayson=require(_0x2a7b('0xa'));var client=jayson['client'][_0x2a7b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3a4ad0,_0x2e1ab6,_0x47889a){return new BPromise(function(_0xc8fe7e,_0x2e0c60){return client[_0x2a7b('0xc')](_0x3a4ad0,_0x47889a)[_0x2a7b('0xd')](function(_0x432daa){logger[_0x2a7b('0xe')]('CmHopperBlack,\x20%s,\x20%s',_0x2e1ab6,'request\x20sent');logger[_0x2a7b('0xf')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x2e1ab6,_0x2a7b('0x10'),JSON[_0x2a7b('0x11')](_0x432daa));if(_0x432daa[_0x2a7b('0x12')]){if(_0x432daa['error'][_0x2a7b('0x13')]===0x1f4){logger[_0x2a7b('0x12')](_0x2a7b('0x14'),_0x2e1ab6,_0x432daa[_0x2a7b('0x12')]['message']);return _0x2e0c60(_0x432daa['error'][_0x2a7b('0x15')]);}logger[_0x2a7b('0x12')]('CmHopperBlack,\x20%s,\x20%s',_0x2e1ab6,_0x432daa[_0x2a7b('0x12')][_0x2a7b('0x15')]);return _0xc8fe7e(_0x432daa[_0x2a7b('0x12')][_0x2a7b('0x15')]);}else{logger[_0x2a7b('0xe')](_0x2a7b('0x14'),_0x2e1ab6,'request\x20sent');_0xc8fe7e(_0x432daa['result'][_0x2a7b('0x15')]);}})['catch'](function(_0x3f3680){logger[_0x2a7b('0x12')]('CmHopperBlack,\x20%s,\x20%s',_0x2e1ab6,_0x3f3680);_0x2e0c60(_0x3f3680);});});}exports[_0x2a7b('0x16')]=function(_0x5cd85){var _0x296911=this;return new Promise(function(_0x55de07,_0xb19787){return db[_0x2a7b('0x17')]['findAll']({'raw':_0x5cd85['options']?_0x5cd85['options'][_0x2a7b('0x18')]===undefined?!![]:![]:!![],'where':_0x5cd85[_0x2a7b('0x19')]?_0x5cd85['options'][_0x2a7b('0x1a')]||null:null,'attributes':_0x5cd85[_0x2a7b('0x19')]?_0x5cd85['options'][_0x2a7b('0x1b')]||null:null,'limit':_0x5cd85[_0x2a7b('0x19')]?_0x5cd85['options']['limit']||null:null,'include':_0x5cd85[_0x2a7b('0x19')]?_0x5cd85[_0x2a7b('0x19')][_0x2a7b('0x1c')]?_['map'](_0x5cd85[_0x2a7b('0x19')]['include'],function(_0x314f07){return{'model':db[_0x314f07[_0x2a7b('0x1d')]],'as':_0x314f07['as'],'attributes':_0x314f07[_0x2a7b('0x1b')],'include':_0x314f07[_0x2a7b('0x1c')]?_[_0x2a7b('0x1e')](_0x314f07['include'],function(_0x8cf6ea){return{'model':db[_0x8cf6ea[_0x2a7b('0x1d')]],'as':_0x8cf6ea['as'],'attributes':_0x8cf6ea['attributes'],'include':_0x8cf6ea['include']?_[_0x2a7b('0x1e')](_0x8cf6ea[_0x2a7b('0x1c')],function(_0x1953e7){return{'model':db[_0x1953e7[_0x2a7b('0x1d')]],'as':_0x1953e7['as'],'attributes':_0x1953e7[_0x2a7b('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x2a7b('0xd')](function(_0x2de799){logger[_0x2a7b('0xe')](_0x2a7b('0x16'),_0x5cd85);logger[_0x2a7b('0xf')](_0x2a7b('0x16'),_0x5cd85,JSON[_0x2a7b('0x11')](_0x2de799));_0x55de07(_0x2de799);})[_0x2a7b('0x1f')](function(_0x448c00){logger[_0x2a7b('0x12')]('GetCmHopperBlack',_0x448c00[_0x2a7b('0x15')],_0x5cd85);_0xb19787(_0x296911['error'](0x1f4,_0x448c00['message']));});});};exports[_0x2a7b('0x20')]=function(_0x22a98f){var _0x45f965=this;return new Promise(function(_0x2e6ce6,_0x3e3dbd){return db[_0x2a7b('0x17')][_0x2a7b('0x21')](_0x22a98f['body'],{'raw':_0x22a98f[_0x2a7b('0x19')]?_0x22a98f[_0x2a7b('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x22a98f[_0x2a7b('0x19')]?_0x22a98f[_0x2a7b('0x19')][_0x2a7b('0x1a')]||null:null,'attributes':_0x22a98f[_0x2a7b('0x19')]?_0x22a98f['options']['attributes']||null:null,'limit':_0x22a98f[_0x2a7b('0x19')]?_0x22a98f[_0x2a7b('0x19')][_0x2a7b('0x22')]||null:null})[_0x2a7b('0xd')](function(_0x234e35){logger[_0x2a7b('0xe')](_0x2a7b('0x20'),_0x22a98f);logger[_0x2a7b('0xf')](_0x2a7b('0x20'),_0x22a98f,JSON[_0x2a7b('0x11')](_0x234e35));_0x2e6ce6(_0x234e35);})[_0x2a7b('0x1f')](function(_0x33badc){logger[_0x2a7b('0x12')](_0x2a7b('0x20'),_0x33badc[_0x2a7b('0x15')],_0x22a98f);_0x3e3dbd(_0x45f965['error'](0x1f4,_0x33badc['message']));});});};exports[_0x2a7b('0x23')]=function(_0x69bd5b){var _0x51996e=this;return new Promise(function(_0x2082a6,_0x32f138){return db['CmHopperBlack'][_0x2a7b('0x24')]({'where':_0x69bd5b[_0x2a7b('0x19')]?_0x69bd5b[_0x2a7b('0x19')][_0x2a7b('0x1a')]||null:null})['then'](function(_0x463ab0){logger['info']('DestroyCmHopperBlack',_0x69bd5b);logger[_0x2a7b('0xf')](_0x2a7b('0x23'),_0x69bd5b,JSON[_0x2a7b('0x11')](_0x463ab0));_0x2082a6(_0x463ab0);})[_0x2a7b('0x1f')](function(_0x1ca083){logger[_0x2a7b('0x12')]('DestroyCmHopperBlack',_0x1ca083[_0x2a7b('0x15')],_0x69bd5b);_0x32f138(_0x51996e['error'](0x1f4,_0x1ca083[_0x2a7b('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 51c180e..010d07d 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 _0x7ee1=['Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','index','isAuthenticated','/:id','delete','destroy','multer','express'];(function(_0x113eee,_0xff5032){var _0x45d5ef=function(_0x215210){while(--_0x215210){_0x113eee['push'](_0x113eee['shift']());}};_0x45d5ef(++_0xff5032);}(_0x7ee1,0x8d));var _0x17ee=function(_0x354ab0,_0x384698){_0x354ab0=_0x354ab0-0x0;var _0x3d9a8=_0x7ee1[_0x354ab0];return _0x3d9a8;};'use strict';var multer=require(_0x17ee('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x17ee('0x1'));var router=express[_0x17ee('0x2')]();var fs_extra=require(_0x17ee('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x17ee('0x4'));var config=require(_0x17ee('0x5'));var controller=require(_0x17ee('0x6'));router[_0x17ee('0x7')]('/',auth['isAuthenticated'](),controller[_0x17ee('0x8')]);router[_0x17ee('0x7')]('/describe',auth[_0x17ee('0x9')](),controller['describe']);router[_0x17ee('0x7')](_0x17ee('0xa'),auth[_0x17ee('0x9')](),controller['show']);router['put']('/:id',auth[_0x17ee('0x9')](),controller['update']);router[_0x17ee('0xb')](_0x17ee('0xa'),auth[_0x17ee('0x9')](),controller[_0x17ee('0xc')]);module['exports']=router; \ No newline at end of file +var _0xffd6=['path','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','/describe','describe','show','/:id','update','delete','destroy','multer','util'];(function(_0x3635ce,_0x33a6f9){var _0x97ecd0=function(_0x123d98){while(--_0x123d98){_0x3635ce['push'](_0x3635ce['shift']());}};_0x97ecd0(++_0x33a6f9);}(_0xffd6,0x97));var _0x6ffd=function(_0xb0de07,_0x3ca2a0){_0xb0de07=_0xb0de07-0x0;var _0x4633d8=_0xffd6[_0xb0de07];return _0x4633d8;};'use strict';var multer=require(_0x6ffd('0x0'));var util=require(_0x6ffd('0x1'));var path=require(_0x6ffd('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6ffd('0x3')]();var fs_extra=require(_0x6ffd('0x4'));var auth=require(_0x6ffd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6ffd('0x6'));var controller=require(_0x6ffd('0x7'));router[_0x6ffd('0x8')]('/',auth[_0x6ffd('0x9')](),controller['index']);router[_0x6ffd('0x8')](_0x6ffd('0xa'),auth[_0x6ffd('0x9')](),controller[_0x6ffd('0xb')]);router[_0x6ffd('0x8')]('/:id',auth[_0x6ffd('0x9')](),controller[_0x6ffd('0xc')]);router['put'](_0x6ffd('0xd'),auth[_0x6ffd('0x9')](),controller[_0x6ffd('0xe')]);router[_0x6ffd('0xf')](_0x6ffd('0xd'),auth[_0x6ffd('0x9')](),controller[_0x6ffd('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 3dd9d32..dd06e93 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 _0x1102=['diff','seconds','BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE','getDataValue','endtime','setDataValue','followuptime'];(function(_0x33925b,_0x95cfc6){var _0x375e21=function(_0x57c759){while(--_0x57c759){_0x33925b['push'](_0x33925b['shift']());}};_0x375e21(++_0x95cfc6);}(_0x1102,0x1b0));var _0x2110=function(_0x5a09f3,_0x9ce907){_0x5a09f3=_0x5a09f3-0x0;var _0x3665c2=_0x1102[_0x5a09f3];return _0x3665c2;};'use strict';var Sequelize=require(_0x2110('0x0'));var moment=require(_0x2110('0x1'));module[_0x2110('0x2')]={'state':{'type':Sequelize[_0x2110('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x2110('0x4')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x2110('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x2110('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x2110('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x2110('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x2110('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x2110('0x4')]},'originatecalleridname':{'type':Sequelize[_0x2110('0x4')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x2110('0x4')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x2110('0x5')]},'answertime':{'type':Sequelize[_0x2110('0x5')]},'droptime':{'type':Sequelize[_0x2110('0x5')]},'endtime':{'type':Sequelize[_0x2110('0x5')]},'ringtime':{'type':Sequelize[_0x2110('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x2110('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x2110('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x2110('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x2110('0x4')]},'campaign':{'type':Sequelize[_0x2110('0x4')]},'campaigntype':{'type':Sequelize[_0x2110('0x4')]},'membername':{'type':Sequelize[_0x2110('0x4')]},'reason':{'type':Sequelize[_0x2110('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x2110('0x4')]},'dispositionat':{'type':Sequelize[_0x2110('0x5')],'set':function(_0x3abf2a){var _0x432c14=this[_0x2110('0x6')](_0x2110('0x7'));if(_0x432c14&&_0x3abf2a){this[_0x2110('0x8')](_0x2110('0x9'),moment(_0x3abf2a)[_0x2110('0xa')](moment(_0x432c14),_0x2110('0xb')));}return this[_0x2110('0x8')]('dispositionat',_0x3abf2a);}},'amd':{'type':Sequelize[_0x2110('0xc')],'defaultValue':![]},'fax':{'type':Sequelize[_0x2110('0xc')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x2110('0xc')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x2110('0xc')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x2110('0x5')]},'callback':{'type':Sequelize[_0x2110('0xc')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x2110('0x5')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0x2110('0x5')]},'recallme':{'type':Sequelize[_0x2110('0xc')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x2110('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x2110('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x2110('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x2110('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x976d=['dispositionat','BOOLEAN','moment','exports','INTEGER','STRING','DATE','getDataValue','setDataValue','followuptime','diff','seconds'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x976d,0xaa));var _0xd976=function(_0x2d8d69,_0x8e47ff){_0x2d8d69=_0x2d8d69-0x0;var _0x39ae22=_0x976d[_0x2d8d69];return _0x39ae22;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xd976('0x0'));module[_0xd976('0x1')]={'state':{'type':Sequelize[_0xd976('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xd976('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xd976('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xd976('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xd976('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xd976('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xd976('0x3')]},'originatecalleridnum':{'type':Sequelize[_0xd976('0x3')]},'originatecalleridname':{'type':Sequelize[_0xd976('0x3')]},'calleridnum':{'type':Sequelize[_0xd976('0x3')]},'calleridname':{'type':Sequelize[_0xd976('0x3')]},'starttime':{'type':Sequelize[_0xd976('0x4')]},'responsetime':{'type':Sequelize[_0xd976('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xd976('0x4')]},'endtime':{'type':Sequelize[_0xd976('0x4')]},'ringtime':{'type':Sequelize[_0xd976('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xd976('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xd976('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xd976('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xd976('0x3')]},'membername':{'type':Sequelize[_0xd976('0x3')]},'reason':{'type':Sequelize[_0xd976('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xd976('0x3')]},'thirdDisposition':{'type':Sequelize[_0xd976('0x3')]},'dispositionat':{'type':Sequelize[_0xd976('0x4')],'set':function(_0x388030){var _0x42bfdf=this[_0xd976('0x5')]('endtime');if(_0x42bfdf&&_0x388030){this[_0xd976('0x6')](_0xd976('0x7'),moment(_0x388030)[_0xd976('0x8')](moment(_0x42bfdf),_0xd976('0x9')));}return this[_0xd976('0x6')](_0xd976('0xa'),_0x388030);}},'amd':{'type':Sequelize[_0xd976('0xb')],'defaultValue':![]},'fax':{'type':Sequelize[_0xd976('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xd976('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xd976('0x4')]},'callback':{'type':Sequelize[_0xd976('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xd976('0x4')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0xd976('0x4')]},'recallme':{'type':Sequelize[_0xd976('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xd976('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xd976('0x2')],'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 705915e..7c00612 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 _0x3f8a=['rows','catch','show','params','fields','options','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','VoiceQueue','insert','into','fromQuery','phone','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ListId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','cm_hopper','calleridnum','state\x20=\x204','group','Campaign','scheduledAt','CampaignId','ANY_VALUE(ContactId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','checkContactHopper','CmHopper','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','destroy','then','error','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll'];(function(_0x5bfa44,_0x76dacc){var _0x43815f=function(_0x307fca){while(--_0x307fca){_0x5bfa44['push'](_0x5bfa44['shift']());}};_0x43815f(++_0x76dacc);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x32b425,_0xad2119){_0x32b425=_0x32b425-0x0;var _0x2ed879=_0x3f8a[_0x32b425];return _0x2ed879;};'use strict';var emlformat=require(_0xa3f8('0x0'));var rimraf=require(_0xa3f8('0x1'));var zipdir=require(_0xa3f8('0x2'));var jsonpatch=require(_0xa3f8('0x3'));var rp=require('request-promise');var moment=require(_0xa3f8('0x4'));var BPromise=require(_0xa3f8('0x5'));var Mustache=require(_0xa3f8('0x6'));var util=require(_0xa3f8('0x7'));var path=require(_0xa3f8('0x8'));var sox=require(_0xa3f8('0x9'));var csv=require(_0xa3f8('0xa'));var ejs=require(_0xa3f8('0xb'));var fs=require('fs');var fs_extra=require(_0xa3f8('0xc'));var _=require(_0xa3f8('0xd'));var squel=require(_0xa3f8('0xe'));var crypto=require(_0xa3f8('0xf'));var jsforce=require(_0xa3f8('0x10'));var deskjs=require(_0xa3f8('0x11'));var toCsv=require(_0xa3f8('0xa'));var querystring=require(_0xa3f8('0x12'));var Papa=require(_0xa3f8('0x13'));var Redis=require('ioredis');var authService=require(_0xa3f8('0x14'));var qs=require(_0xa3f8('0x15'));var as=require(_0xa3f8('0x16'));var hardwareService=require(_0xa3f8('0x17'));var logger=require('../../config/logger')(_0xa3f8('0x18'));var utils=require(_0xa3f8('0x19'));var config=require(_0xa3f8('0x1a'));var licenseUtil=require(_0xa3f8('0x1b'));var db=require(_0xa3f8('0x1c'))['db'];function respondWithStatusCode(_0x2e71a0,_0x1afd01){_0x1afd01=_0x1afd01||0xcc;return function(_0x63de8b){if(_0x63de8b){return _0x2e71a0[_0xa3f8('0x1d')](_0x1afd01);}return _0x2e71a0[_0xa3f8('0x1e')](_0x1afd01)[_0xa3f8('0x1f')]();};}function respondWithResult(_0x2c5e15,_0x5b2c33){_0x5b2c33=_0x5b2c33||0xc8;return function(_0x2d8f74){if(_0x2d8f74){return _0x2c5e15[_0xa3f8('0x1e')](_0x5b2c33)[_0xa3f8('0x20')](_0x2d8f74);}};}function respondWithFilteredResult(_0x21a170,_0x5caebf){return function(_0x39c450){if(_0x39c450){var _0x33b98e=typeof _0x5caebf[_0xa3f8('0x21')]===_0xa3f8('0x22')&&typeof _0x5caebf[_0xa3f8('0x23')]===_0xa3f8('0x22');var _0x2f0659=_0x39c450[_0xa3f8('0x24')];var _0x2cb49f=_0x33b98e?0x0:_0x5caebf[_0xa3f8('0x21')];var _0x54b870=_0x33b98e?_0x39c450[_0xa3f8('0x24')]:_0x5caebf['offset']+_0x5caebf[_0xa3f8('0x23')];var _0x3dc3e5;if(_0x54b870>=_0x2f0659){_0x54b870=_0x2f0659;_0x3dc3e5=0xc8;}else{_0x3dc3e5=0xce;}_0x21a170[_0xa3f8('0x1e')](_0x3dc3e5);return _0x21a170[_0xa3f8('0x25')]('Content-Range',_0x2cb49f+'-'+_0x54b870+'/'+_0x2f0659)[_0xa3f8('0x20')](_0x39c450);}return null;};}function patchUpdates(_0x5b0d57){return function(_0x43c393){try{jsonpatch['apply'](_0x43c393,_0x5b0d57,!![]);}catch(_0x4066bb){return BPromise[_0xa3f8('0x26')](_0x4066bb);}return _0x43c393[_0xa3f8('0x27')]();};}function saveUpdates(_0x474893,_0x3a6a57){return function(_0x1e5f30){if(_0x1e5f30){return _0x1e5f30[_0xa3f8('0x28')](_0x474893)['then'](function(_0xae76ec){return _0xae76ec;});}return null;};}function removeEntity(_0x4d0e72,_0x3ce57b){return function(_0xa5a697){if(_0xa5a697){return _0xa5a697[_0xa3f8('0x29')]()[_0xa3f8('0x2a')](function(){_0x4d0e72[_0xa3f8('0x1e')](0xcc)[_0xa3f8('0x1f')]();});}};}function handleEntityNotFound(_0x6e3cb4,_0x34884d){return function(_0x1e22b8){if(!_0x1e22b8){_0x6e3cb4[_0xa3f8('0x1d')](0x194);}return _0x1e22b8;};}function handleError(_0x545a28,_0x1c3358){_0x1c3358=_0x1c3358||0x1f4;return function(_0x2d29c1){logger[_0xa3f8('0x2b')](_0x2d29c1['stack']);if(_0x2d29c1[_0xa3f8('0x2c')]){delete _0x2d29c1['name'];}_0x545a28[_0xa3f8('0x1e')](_0x1c3358)[_0xa3f8('0x2d')](_0x2d29c1);};}exports[_0xa3f8('0x2e')]=function(_0x4ea213,_0x458824){var _0x5e69e2={},_0x21c57e={},_0x4281ea={'count':0x0,'rows':[]};var _0x226153=_[_0xa3f8('0x2f')](db[_0xa3f8('0x30')][_0xa3f8('0x31')],function(_0x23c854){return{'name':_0x23c854[_0xa3f8('0x32')],'type':_0x23c854[_0xa3f8('0x33')][_0xa3f8('0x34')]};});_0x21c57e[_0xa3f8('0x35')]=_['map'](_0x226153,_0xa3f8('0x2c'));_0x21c57e[_0xa3f8('0x36')]=_[_0xa3f8('0x37')](_0x4ea213[_0xa3f8('0x36')]);_0x21c57e[_0xa3f8('0x38')]=_['intersection'](_0x21c57e[_0xa3f8('0x35')],_0x21c57e[_0xa3f8('0x36')]);_0x5e69e2['attributes']=_[_0xa3f8('0x39')](_0x21c57e[_0xa3f8('0x35')],qs['fields'](_0x4ea213[_0xa3f8('0x36')]['fields']));_0x5e69e2['attributes']=_0x5e69e2[_0xa3f8('0x3a')][_0xa3f8('0x3b')]?_0x5e69e2['attributes']:_0x21c57e[_0xa3f8('0x35')];if(!_0x4ea213['query'][_0xa3f8('0x3c')](_0xa3f8('0x3d'))){_0x5e69e2[_0xa3f8('0x23')]=qs[_0xa3f8('0x23')](_0x4ea213['query'][_0xa3f8('0x23')]);_0x5e69e2['offset']=qs[_0xa3f8('0x21')](_0x4ea213['query'][_0xa3f8('0x21')]);}_0x5e69e2['order']=qs['sort'](_0x4ea213['query'][_0xa3f8('0x3e')]);_0x5e69e2[_0xa3f8('0x3f')]=qs[_0xa3f8('0x38')](_[_0xa3f8('0x40')](_0x4ea213['query'],_0x21c57e[_0xa3f8('0x38')]),_0x226153);if(_0x4ea213[_0xa3f8('0x36')][_0xa3f8('0x41')]){_0x5e69e2[_0xa3f8('0x3f')]=_[_0xa3f8('0x42')](_0x5e69e2[_0xa3f8('0x3f')],{'$or':_['map'](_0x226153,function(_0x14db5b){if(_0x14db5b[_0xa3f8('0x33')]!==_0xa3f8('0x43')){var _0x51de10={};_0x51de10[_0x14db5b[_0xa3f8('0x2c')]]={'$like':'%'+_0x4ea213[_0xa3f8('0x36')]['filter']+'%'};return _0x51de10;}})});}_0x5e69e2=_[_0xa3f8('0x42')]({},_0x5e69e2,_0x4ea213['options']);var _0xbf8209={'where':_0x5e69e2['where']};return db[_0xa3f8('0x30')][_0xa3f8('0x24')](_0xbf8209)[_0xa3f8('0x2a')](function(_0x2a77be){_0x4281ea[_0xa3f8('0x24')]=_0x2a77be;if(_0x4ea213['query'][_0xa3f8('0x44')]){_0x5e69e2[_0xa3f8('0x45')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xa3f8('0x46')](_0x5e69e2);})['then'](function(_0x6ff4d4){_0x4281ea[_0xa3f8('0x47')]=_0x6ff4d4;return _0x4281ea;})[_0xa3f8('0x2a')](respondWithFilteredResult(_0x458824,_0x5e69e2))[_0xa3f8('0x48')](handleError(_0x458824,null));};exports[_0xa3f8('0x49')]=function(_0x4d2b8b,_0x180e87){var _0x2b17ff={'raw':!![],'where':{'id':_0x4d2b8b[_0xa3f8('0x4a')]['id']}},_0x23fe02={};_0x23fe02[_0xa3f8('0x35')]=_['keys'](db[_0xa3f8('0x30')][_0xa3f8('0x31')]);_0x23fe02[_0xa3f8('0x36')]=_[_0xa3f8('0x37')](_0x4d2b8b[_0xa3f8('0x36')]);_0x23fe02[_0xa3f8('0x38')]=_[_0xa3f8('0x39')](_0x23fe02[_0xa3f8('0x35')],_0x23fe02[_0xa3f8('0x36')]);_0x2b17ff[_0xa3f8('0x3a')]=_[_0xa3f8('0x39')](_0x23fe02[_0xa3f8('0x35')],qs[_0xa3f8('0x4b')](_0x4d2b8b['query']['fields']));_0x2b17ff['attributes']=_0x2b17ff[_0xa3f8('0x3a')][_0xa3f8('0x3b')]?_0x2b17ff[_0xa3f8('0x3a')]:_0x23fe02[_0xa3f8('0x35')];if(_0x4d2b8b[_0xa3f8('0x36')][_0xa3f8('0x44')]){_0x2b17ff['include']=[{'all':!![]}];}_0x2b17ff=_[_0xa3f8('0x42')]({},_0x2b17ff,_0x4d2b8b[_0xa3f8('0x4c')]);return db[_0xa3f8('0x30')][_0xa3f8('0x4d')](_0x2b17ff)['then'](handleEntityNotFound(_0x180e87,null))[_0xa3f8('0x2a')](respondWithResult(_0x180e87,null))[_0xa3f8('0x48')](handleError(_0x180e87,null));};exports[_0xa3f8('0x4e')]=function(_0x523b46,_0x5cae9e){return db['CmHopperFinal'][_0xa3f8('0x4e')]()[_0xa3f8('0x2a')](respondWithResult(_0x5cae9e,null))['catch'](handleError(_0x5cae9e,null));};exports[_0xa3f8('0x28')]=function(_0x1f7af7,_0x410de5){if(_0x1f7af7[_0xa3f8('0x4f')][_0xa3f8('0x50')]){delete _0x1f7af7[_0xa3f8('0x4f')][_0xa3f8('0x50')];}return db[_0xa3f8('0x30')][_0xa3f8('0x4d')]({'where':{'uniqueid':_0x1f7af7[_0xa3f8('0x4a')]['id']}})[_0xa3f8('0x2a')](handleEntityNotFound(_0x410de5,null))[_0xa3f8('0x2a')](saveUpdates(_0x1f7af7[_0xa3f8('0x4f')],null))[_0xa3f8('0x2a')](respondWithResult(_0x410de5,null))[_0xa3f8('0x48')](handleError(_0x410de5,null));};exports[_0xa3f8('0x51')]=function(_0x42082d,_0x559ae7,_0x4addd2){return db[_0xa3f8('0x30')][_0xa3f8('0x46')]({'raw':![],'where':{'VoiceQueueId':_0x42082d['params']['id']},'attributes':[[db[_0xa3f8('0x52')]['fn'](_0xa3f8('0x53'),db[_0xa3f8('0x52')]['fn']('IF',db[_0xa3f8('0x52')][_0xa3f8('0x54')](_0xa3f8('0x55')))),_0xa3f8('0x56')],[db[_0xa3f8('0x52')]['fn'](_0xa3f8('0x53'),db[_0xa3f8('0x52')]['fn']('IF',db[_0xa3f8('0x52')][_0xa3f8('0x54')](_0xa3f8('0x57')))),_0xa3f8('0x58')],[db[_0xa3f8('0x52')]['fn'](_0xa3f8('0x53'),db['sequelize']['fn']('IF',db['sequelize'][_0xa3f8('0x54')]('`state`\x20=\x205,\x201,\x20null'))),_0xa3f8('0x59')],[db[_0xa3f8('0x52')]['fn'](_0xa3f8('0x53'),db['sequelize']['fn']('IF',db[_0xa3f8('0x52')][_0xa3f8('0x54')](_0xa3f8('0x5a')))),_0xa3f8('0x5b')],[db['sequelize']['fn'](_0xa3f8('0x53'),db['sequelize']['fn']('IF',db[_0xa3f8('0x52')][_0xa3f8('0x54')](_0xa3f8('0x5c')))),'dropContacts'],[db['sequelize']['fn'](_0xa3f8('0x53'),db[_0xa3f8('0x52')]['fn']('IF',db[_0xa3f8('0x52')][_0xa3f8('0x54')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xa3f8('0x5d')],[db[_0xa3f8('0x52')]['fn'](_0xa3f8('0x53'),db[_0xa3f8('0x52')]['fn']('IF',db[_0xa3f8('0x52')]['literal']('`state`\x20=\x2022,\x201,\x20null'))),_0xa3f8('0x5e')],[db[_0xa3f8('0x52')]['fn'](_0xa3f8('0x53'),db[_0xa3f8('0x52')]['fn']('IF',db[_0xa3f8('0x52')][_0xa3f8('0x54')](_0xa3f8('0x5f')))),'answeringMachine']]})['then'](handleEntityNotFound(_0x559ae7,null))['then'](respondWithResult(_0x559ae7,null))[_0xa3f8('0x48')](handleError(_0x559ae7,null));};exports[_0xa3f8('0x60')]=function(_0x3096d0,_0x398f64,_0x185b38){return db[_0xa3f8('0x30')][_0xa3f8('0x46')]({'raw':![],'where':{'CampaignId':_0x3096d0[_0xa3f8('0x4a')]['id']},'attributes':[[db['sequelize']['fn'](_0xa3f8('0x53'),db[_0xa3f8('0x52')]['fn']('IF',db[_0xa3f8('0x52')][_0xa3f8('0x54')](_0xa3f8('0x55')))),_0xa3f8('0x56')],[db[_0xa3f8('0x52')]['fn']('COUNT',db[_0xa3f8('0x52')]['fn']('IF',db[_0xa3f8('0x52')]['literal'](_0xa3f8('0x57')))),_0xa3f8('0x58')],[db[_0xa3f8('0x52')]['fn'](_0xa3f8('0x53'),db[_0xa3f8('0x52')]['fn']('IF',db[_0xa3f8('0x52')][_0xa3f8('0x54')]('`state`\x20=\x205,\x201,\x20null'))),'busyContacts'],[db[_0xa3f8('0x52')]['fn']('COUNT',db[_0xa3f8('0x52')]['fn']('IF',db[_0xa3f8('0x52')][_0xa3f8('0x54')](_0xa3f8('0x5a')))),_0xa3f8('0x5b')],[db[_0xa3f8('0x52')]['fn'](_0xa3f8('0x53'),db[_0xa3f8('0x52')]['fn']('IF',db[_0xa3f8('0x52')][_0xa3f8('0x54')](_0xa3f8('0x5c')))),_0xa3f8('0x61')],[db[_0xa3f8('0x52')]['fn']('COUNT',db[_0xa3f8('0x52')]['fn']('IF',db[_0xa3f8('0x52')][_0xa3f8('0x54')](_0xa3f8('0x62')))),_0xa3f8('0x5d')],[db[_0xa3f8('0x52')]['fn']('COUNT',db[_0xa3f8('0x52')]['fn']('IF',db[_0xa3f8('0x52')][_0xa3f8('0x54')](_0xa3f8('0x63')))),_0xa3f8('0x5e')],[db[_0xa3f8('0x52')]['fn'](_0xa3f8('0x53'),db[_0xa3f8('0x52')]['fn']('IF',db[_0xa3f8('0x52')][_0xa3f8('0x54')](_0xa3f8('0x5f')))),'answeringMachine']]})[_0xa3f8('0x2a')](handleEntityNotFound(_0x398f64,null))[_0xa3f8('0x2a')](respondWithResult(_0x398f64,null))['catch'](handleError(_0x398f64,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x1955aa,_0x296931,_0x2c0f71){return db[_0xa3f8('0x64')][_0xa3f8('0x4d')]({'where':{'id':_0x1955aa[_0xa3f8('0x4a')]['id']}})[_0xa3f8('0x2a')](handleEntityNotFound(_0x296931,null))[_0xa3f8('0x2a')](function(_0x4f5f62){var _0xf76898;if(_0x4f5f62){_0xf76898=squel[_0xa3f8('0x65')]()[_0xa3f8('0x66')]('cm_hopper')[_0xa3f8('0x67')]([_0xa3f8('0x68'),'scheduledAt',_0xa3f8('0x69'),_0xa3f8('0x6a'),_0xa3f8('0x6b'),_0xa3f8('0x6c'),_0xa3f8('0x6d')],squel[_0xa3f8('0x6e')]()[_0xa3f8('0x6f')](_0xa3f8('0x70'),_0xa3f8('0x68'))['field'](_0xa3f8('0x71'),'scheduledAt')[_0xa3f8('0x6f')]('ANY_VALUE(ContactId)',_0xa3f8('0x69'))[_0xa3f8('0x6f')](_0xa3f8('0x72'),_0xa3f8('0x6a'))[_0xa3f8('0x6f')]('ANY_VALUE(VoiceQueueId)',_0xa3f8('0x6b'))[_0xa3f8('0x6f')]('NOW()',_0xa3f8('0x6c'))[_0xa3f8('0x6f')](_0xa3f8('0x71'),_0xa3f8('0x6d'))[_0xa3f8('0x73')](_0xa3f8('0x74'))['where'](_0xa3f8('0x75'),_0x1955aa[_0xa3f8('0x4a')]['id'][_0xa3f8('0x76')]())['where'](_0xa3f8('0x77'),_0x1955aa['body'][_0xa3f8('0x78')]['toString']())['where'](_0xa3f8('0x79'))['where'](_0xa3f8('0x7a'),squel['select']()[_0xa3f8('0x6f')](_0xa3f8('0x68'))[_0xa3f8('0x73')](_0xa3f8('0x7b'))['where'](_0xa3f8('0x75'),_0x1955aa[_0xa3f8('0x4a')]['id']['toString']()))[_0xa3f8('0x3f')](_0xa3f8('0x7a'),squel[_0xa3f8('0x6e')]()[_0xa3f8('0x6f')](_0xa3f8('0x7c'))[_0xa3f8('0x73')](_0xa3f8('0x74'))[_0xa3f8('0x3f')](_0xa3f8('0x75'),_0x1955aa[_0xa3f8('0x4a')]['id']['toString']())[_0xa3f8('0x3f')](_0xa3f8('0x7d')))[_0xa3f8('0x7e')](_0xa3f8('0x69')))[_0xa3f8('0x76')]();return db[_0xa3f8('0x52')][_0xa3f8('0x36')](_0xf76898);}return[];})[_0xa3f8('0x2a')](respondWithResult(_0x296931,null))[_0xa3f8('0x48')](handleError(_0x296931,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x2e2d99,_0x3da7ee,_0x3f6834){return db[_0xa3f8('0x7f')][_0xa3f8('0x4d')]({'where':{'id':_0x2e2d99[_0xa3f8('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3da7ee,null))[_0xa3f8('0x2a')](function(_0x3175fc){var _0x224199;if(_0x3175fc){_0x224199=squel[_0xa3f8('0x65')]()['into'](_0xa3f8('0x7b'))[_0xa3f8('0x67')]([_0xa3f8('0x68'),_0xa3f8('0x80'),_0xa3f8('0x69'),_0xa3f8('0x6a'),_0xa3f8('0x81'),_0xa3f8('0x6c'),_0xa3f8('0x6d')],squel[_0xa3f8('0x6e')]()[_0xa3f8('0x6f')]('ANY_VALUE(calleridnum)',_0xa3f8('0x68'))['field'](_0xa3f8('0x71'),_0xa3f8('0x80'))[_0xa3f8('0x6f')](_0xa3f8('0x82'),_0xa3f8('0x69'))[_0xa3f8('0x6f')](_0xa3f8('0x72'),_0xa3f8('0x6a'))['field'](_0xa3f8('0x83'),'CampaignId')[_0xa3f8('0x6f')]('NOW()',_0xa3f8('0x6c'))['field'](_0xa3f8('0x71'),_0xa3f8('0x6d'))[_0xa3f8('0x73')](_0xa3f8('0x74'))['where'](_0xa3f8('0x84'),_0x2e2d99[_0xa3f8('0x4a')]['id'][_0xa3f8('0x76')]())[_0xa3f8('0x3f')](_0xa3f8('0x77'),_0x2e2d99[_0xa3f8('0x4f')]['state'][_0xa3f8('0x76')]())[_0xa3f8('0x3f')](_0xa3f8('0x79'))[_0xa3f8('0x3f')](_0xa3f8('0x7a'),squel['select']()[_0xa3f8('0x6f')](_0xa3f8('0x68'))['from'](_0xa3f8('0x7b'))[_0xa3f8('0x3f')](_0xa3f8('0x84'),_0x2e2d99['params']['id'][_0xa3f8('0x76')]()))[_0xa3f8('0x3f')](_0xa3f8('0x7a'),squel[_0xa3f8('0x6e')]()[_0xa3f8('0x6f')](_0xa3f8('0x7c'))[_0xa3f8('0x73')]('cm_hopper_final')[_0xa3f8('0x3f')](_0xa3f8('0x84'),_0x2e2d99['params']['id'][_0xa3f8('0x76')]())[_0xa3f8('0x3f')](_0xa3f8('0x7d')))[_0xa3f8('0x7e')](_0xa3f8('0x69')))[_0xa3f8('0x76')]();return db[_0xa3f8('0x52')]['query'](_0x224199);}return[];})[_0xa3f8('0x2a')](respondWithResult(_0x3da7ee,null))[_0xa3f8('0x48')](handleError(_0x3da7ee,null));};exports[_0xa3f8('0x85')]=function(_0x2eaf1e,_0x39494d,_0x1673ac){return db[_0xa3f8('0x86')]['findOne']({'where':{'VoiceQueueId':_0x2eaf1e[_0xa3f8('0x4f')][_0xa3f8('0x6b')],'CampaignId':_0x2eaf1e[_0xa3f8('0x4f')][_0xa3f8('0x81')],'ContactId':_0x2eaf1e['body']['ContactId']}})[_0xa3f8('0x2a')](handleEntityNotFound(_0x39494d,null))['then'](function(_0x36f6c4){if(_0x36f6c4){return _0x36f6c4;}return null;})[_0xa3f8('0x2a')](respondWithResult(_0x39494d,null))[_0xa3f8('0x48')](handleError(_0x39494d,null));}; \ No newline at end of file +var _0x430c=['field','phone','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','CampaignId','ANY_VALUE(calleridnum)','ANY_VALUE(CampaignId)','createdAt','CampaignId\x20=\x20?','state\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','from','checkContactHopper','CmHopper','findOne','eml-format','fast-json-patch','request-promise','moment','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','count','set','Content-Range','then','destroy','error','stack','name','send','index','CmHopperFinal','rawAttributes','fieldName','key','model','map','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','describe','update','uniqueid','body','find','COUNT','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','`state`\x20=\x208,\x201,\x20null','dropContacts','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','scheduledAt','ContactId','ListId','VoiceQueueId','updatedAt','select'];(function(_0x237398,_0xc0ef22){var _0x5598de=function(_0x3118fa){while(--_0x3118fa){_0x237398['push'](_0x237398['shift']());}};_0x5598de(++_0xc0ef22);}(_0x430c,0x1a1));var _0xc430=function(_0x483d8b,_0x526c52){_0x483d8b=_0x483d8b-0x0;var _0x6500f1=_0x430c[_0x483d8b];return _0x6500f1;};'use strict';var emlformat=require(_0xc430('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc430('0x1'));var rp=require(_0xc430('0x2'));var moment=require(_0xc430('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xc430('0x4'));var csv=require(_0xc430('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc430('0x6'));var _=require('lodash');var squel=require(_0xc430('0x7'));var crypto=require(_0xc430('0x8'));var jsforce=require(_0xc430('0x9'));var deskjs=require(_0xc430('0xa'));var toCsv=require(_0xc430('0x5'));var querystring=require(_0xc430('0xb'));var Papa=require(_0xc430('0xc'));var Redis=require(_0xc430('0xd'));var authService=require(_0xc430('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xc430('0xf'));var hardwareService=require(_0xc430('0x10'));var logger=require('../../config/logger')(_0xc430('0x11'));var utils=require('../../config/utils');var config=require(_0xc430('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xc430('0x13'))['db'];function respondWithStatusCode(_0x8aa2e6,_0xc5f92){_0xc5f92=_0xc5f92||0xcc;return function(_0x1fb8ce){if(_0x1fb8ce){return _0x8aa2e6[_0xc430('0x14')](_0xc5f92);}return _0x8aa2e6[_0xc430('0x15')](_0xc5f92)[_0xc430('0x16')]();};}function respondWithResult(_0x54d851,_0x4e9134){_0x4e9134=_0x4e9134||0xc8;return function(_0x3f359c){if(_0x3f359c){return _0x54d851[_0xc430('0x15')](_0x4e9134)[_0xc430('0x17')](_0x3f359c);}};}function respondWithFilteredResult(_0x2ef538,_0x31d3b7){return function(_0x55cc6c){if(_0x55cc6c){var _0x111598=typeof _0x31d3b7['offset']==='undefined'&&typeof _0x31d3b7[_0xc430('0x18')]===_0xc430('0x19');var _0x2327c5=_0x55cc6c['count'];var _0x5d3acc=_0x111598?0x0:_0x31d3b7[_0xc430('0x1a')];var _0x4c1937=_0x111598?_0x55cc6c[_0xc430('0x1b')]:_0x31d3b7['offset']+_0x31d3b7['limit'];var _0x2f3203;if(_0x4c1937>=_0x2327c5){_0x4c1937=_0x2327c5;_0x2f3203=0xc8;}else{_0x2f3203=0xce;}_0x2ef538['status'](_0x2f3203);return _0x2ef538[_0xc430('0x1c')](_0xc430('0x1d'),_0x5d3acc+'-'+_0x4c1937+'/'+_0x2327c5)[_0xc430('0x17')](_0x55cc6c);}return null;};}function patchUpdates(_0x1f90bb){return function(_0x2a1ea1){try{jsonpatch['apply'](_0x2a1ea1,_0x1f90bb,!![]);}catch(_0x388a2f){return BPromise['reject'](_0x388a2f);}return _0x2a1ea1['save']();};}function saveUpdates(_0x3b7c3d,_0x2ea352){return function(_0x3c7afa){if(_0x3c7afa){return _0x3c7afa['update'](_0x3b7c3d)[_0xc430('0x1e')](function(_0x57d26e){return _0x57d26e;});}return null;};}function removeEntity(_0x23425d,_0x22ebfb){return function(_0x4efecd){if(_0x4efecd){return _0x4efecd[_0xc430('0x1f')]()[_0xc430('0x1e')](function(){_0x23425d['status'](0xcc)[_0xc430('0x16')]();});}};}function handleEntityNotFound(_0x59c498,_0x3aa85e){return function(_0x4b5280){if(!_0x4b5280){_0x59c498[_0xc430('0x14')](0x194);}return _0x4b5280;};}function handleError(_0x21e28a,_0x50110b){_0x50110b=_0x50110b||0x1f4;return function(_0x33433f){logger[_0xc430('0x20')](_0x33433f[_0xc430('0x21')]);if(_0x33433f[_0xc430('0x22')]){delete _0x33433f[_0xc430('0x22')];}_0x21e28a['status'](_0x50110b)[_0xc430('0x23')](_0x33433f);};}exports[_0xc430('0x24')]=function(_0x1c1da9,_0x1591e3){var _0x542cba={},_0x1f8086={},_0x4cf56c={'count':0x0,'rows':[]};var _0x1d65ee=_['map'](db[_0xc430('0x25')][_0xc430('0x26')],function(_0xfc8767){return{'name':_0xfc8767[_0xc430('0x27')],'type':_0xfc8767['type'][_0xc430('0x28')]};});_0x1f8086[_0xc430('0x29')]=_[_0xc430('0x2a')](_0x1d65ee,_0xc430('0x22'));_0x1f8086['query']=_[_0xc430('0x2b')](_0x1c1da9[_0xc430('0x2c')]);_0x1f8086['filters']=_[_0xc430('0x2d')](_0x1f8086['model'],_0x1f8086['query']);_0x542cba[_0xc430('0x2e')]=_[_0xc430('0x2d')](_0x1f8086[_0xc430('0x29')],qs[_0xc430('0x2f')](_0x1c1da9[_0xc430('0x2c')][_0xc430('0x2f')]));_0x542cba[_0xc430('0x2e')]=_0x542cba[_0xc430('0x2e')]['length']?_0x542cba[_0xc430('0x2e')]:_0x1f8086['model'];if(!_0x1c1da9[_0xc430('0x2c')][_0xc430('0x30')](_0xc430('0x31'))){_0x542cba[_0xc430('0x18')]=qs['limit'](_0x1c1da9[_0xc430('0x2c')]['limit']);_0x542cba['offset']=qs[_0xc430('0x1a')](_0x1c1da9[_0xc430('0x2c')]['offset']);}_0x542cba[_0xc430('0x32')]=qs[_0xc430('0x33')](_0x1c1da9[_0xc430('0x2c')][_0xc430('0x33')]);_0x542cba[_0xc430('0x34')]=qs[_0xc430('0x35')](_[_0xc430('0x36')](_0x1c1da9[_0xc430('0x2c')],_0x1f8086[_0xc430('0x35')]),_0x1d65ee);if(_0x1c1da9[_0xc430('0x2c')][_0xc430('0x37')]){_0x542cba[_0xc430('0x34')]=_[_0xc430('0x38')](_0x542cba[_0xc430('0x34')],{'$or':_[_0xc430('0x2a')](_0x1d65ee,function(_0x537e4c){if(_0x537e4c[_0xc430('0x39')]!==_0xc430('0x3a')){var _0x24363b={};_0x24363b[_0x537e4c[_0xc430('0x22')]]={'$like':'%'+_0x1c1da9['query'][_0xc430('0x37')]+'%'};return _0x24363b;}})});}_0x542cba=_[_0xc430('0x38')]({},_0x542cba,_0x1c1da9[_0xc430('0x3b')]);var _0x45b3dc={'where':_0x542cba[_0xc430('0x34')]};return db[_0xc430('0x25')]['count'](_0x45b3dc)[_0xc430('0x1e')](function(_0x348f2f){_0x4cf56c[_0xc430('0x1b')]=_0x348f2f;if(_0x1c1da9[_0xc430('0x2c')][_0xc430('0x3c')]){_0x542cba[_0xc430('0x3d')]=[{'all':!![]}];}return db[_0xc430('0x25')][_0xc430('0x3e')](_0x542cba);})[_0xc430('0x1e')](function(_0x4174d2){_0x4cf56c[_0xc430('0x3f')]=_0x4174d2;return _0x4cf56c;})[_0xc430('0x1e')](respondWithFilteredResult(_0x1591e3,_0x542cba))[_0xc430('0x40')](handleError(_0x1591e3,null));};exports[_0xc430('0x41')]=function(_0x5a9c4b,_0x47edb0){var _0x4983e0={'raw':!![],'where':{'id':_0x5a9c4b[_0xc430('0x42')]['id']}},_0x262063={};_0x262063[_0xc430('0x29')]=_[_0xc430('0x2b')](db[_0xc430('0x25')][_0xc430('0x26')]);_0x262063[_0xc430('0x2c')]=_[_0xc430('0x2b')](_0x5a9c4b[_0xc430('0x2c')]);_0x262063[_0xc430('0x35')]=_[_0xc430('0x2d')](_0x262063[_0xc430('0x29')],_0x262063[_0xc430('0x2c')]);_0x4983e0[_0xc430('0x2e')]=_[_0xc430('0x2d')](_0x262063[_0xc430('0x29')],qs['fields'](_0x5a9c4b[_0xc430('0x2c')][_0xc430('0x2f')]));_0x4983e0[_0xc430('0x2e')]=_0x4983e0[_0xc430('0x2e')][_0xc430('0x43')]?_0x4983e0[_0xc430('0x2e')]:_0x262063[_0xc430('0x29')];if(_0x5a9c4b[_0xc430('0x2c')]['includeAll']){_0x4983e0[_0xc430('0x3d')]=[{'all':!![]}];}_0x4983e0=_['merge']({},_0x4983e0,_0x5a9c4b[_0xc430('0x3b')]);return db[_0xc430('0x25')]['find'](_0x4983e0)['then'](handleEntityNotFound(_0x47edb0,null))[_0xc430('0x1e')](respondWithResult(_0x47edb0,null))['catch'](handleError(_0x47edb0,null));};exports['describe']=function(_0x10db27,_0x4eafae){return db[_0xc430('0x25')][_0xc430('0x44')]()[_0xc430('0x1e')](respondWithResult(_0x4eafae,null))['catch'](handleError(_0x4eafae,null));};exports[_0xc430('0x45')]=function(_0x2e7052,_0x19e563){if(_0x2e7052['body'][_0xc430('0x46')]){delete _0x2e7052[_0xc430('0x47')][_0xc430('0x46')];}return db[_0xc430('0x25')][_0xc430('0x48')]({'where':{'uniqueid':_0x2e7052[_0xc430('0x42')]['id']}})[_0xc430('0x1e')](handleEntityNotFound(_0x19e563,null))['then'](saveUpdates(_0x2e7052[_0xc430('0x47')],null))[_0xc430('0x1e')](respondWithResult(_0x19e563,null))[_0xc430('0x40')](handleError(_0x19e563,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x23cb41,_0x4178d7,_0x2d064b){return db[_0xc430('0x25')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x23cb41[_0xc430('0x42')]['id']},'attributes':[[db['sequelize']['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')](_0xc430('0x4c')))),_0xc430('0x4d')],[db['sequelize']['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db['sequelize'][_0xc430('0x4b')](_0xc430('0x4e')))),_0xc430('0x4f')],[db[_0xc430('0x4a')]['fn']('COUNT',db[_0xc430('0x4a')]['fn']('IF',db['sequelize'][_0xc430('0x4b')](_0xc430('0x50')))),_0xc430('0x51')],[db[_0xc430('0x4a')]['fn']('COUNT',db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0xc430('0x52')],[db[_0xc430('0x4a')]['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')](_0xc430('0x53')))),'dropContacts'],[db[_0xc430('0x4a')]['fn']('COUNT',db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')](_0xc430('0x54')))),_0xc430('0x55')],[db[_0xc430('0x4a')]['fn']('COUNT',db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')](_0xc430('0x56')))),_0xc430('0x57')],[db[_0xc430('0x4a')]['fn'](_0xc430('0x49'),db['sequelize']['fn']('IF',db[_0xc430('0x4a')]['literal'](_0xc430('0x58')))),'answeringMachine']]})[_0xc430('0x1e')](handleEntityNotFound(_0x4178d7,null))[_0xc430('0x1e')](respondWithResult(_0x4178d7,null))[_0xc430('0x40')](handleError(_0x4178d7,null));};exports[_0xc430('0x59')]=function(_0x147062,_0x45eec6,_0x5d3393){return db[_0xc430('0x25')][_0xc430('0x3e')]({'raw':![],'where':{'CampaignId':_0x147062['params']['id']},'attributes':[[db['sequelize']['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')](_0xc430('0x4c')))),_0xc430('0x4d')],[db[_0xc430('0x4a')]['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')](_0xc430('0x4e')))),'noAnswerContacts'],[db['sequelize']['fn'](_0xc430('0x49'),db['sequelize']['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')]('`state`\x20=\x205,\x201,\x20null'))),_0xc430('0x51')],[db['sequelize']['fn']('COUNT',db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')]['literal'](_0xc430('0x5a')))),'congestionContacts'],[db['sequelize']['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xc430('0x5b')],[db[_0xc430('0x4a')]['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db['sequelize'][_0xc430('0x4b')](_0xc430('0x54')))),_0xc430('0x55')],[db[_0xc430('0x4a')]['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')](_0xc430('0x56')))),_0xc430('0x57')],[db[_0xc430('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xc430('0x4b')](_0xc430('0x58')))),_0xc430('0x5c')]]})['then'](handleEntityNotFound(_0x45eec6,null))['then'](respondWithResult(_0x45eec6,null))[_0xc430('0x40')](handleError(_0x45eec6,null));};exports[_0xc430('0x5d')]=function(_0x31ae3c,_0x19c080,_0x256290){return db[_0xc430('0x5e')][_0xc430('0x48')]({'where':{'id':_0x31ae3c[_0xc430('0x42')]['id']}})[_0xc430('0x1e')](handleEntityNotFound(_0x19c080,null))[_0xc430('0x1e')](function(_0x5ca0f2){var _0x6debfb;if(_0x5ca0f2){_0x6debfb=squel[_0xc430('0x5f')]()[_0xc430('0x60')]('cm_hopper')['fromQuery'](['phone',_0xc430('0x61'),_0xc430('0x62'),_0xc430('0x63'),_0xc430('0x64'),'createdAt',_0xc430('0x65')],squel[_0xc430('0x66')]()[_0xc430('0x67')]('ANY_VALUE(calleridnum)',_0xc430('0x68'))['field'](_0xc430('0x69'),_0xc430('0x61'))[_0xc430('0x67')](_0xc430('0x6a'),_0xc430('0x62'))['field'](_0xc430('0x6b'),_0xc430('0x63'))[_0xc430('0x67')](_0xc430('0x6c'),'VoiceQueueId')['field'](_0xc430('0x69'),'createdAt')['field'](_0xc430('0x69'),_0xc430('0x65'))['from'](_0xc430('0x6d'))[_0xc430('0x34')](_0xc430('0x6e'),_0x31ae3c[_0xc430('0x42')]['id'][_0xc430('0x6f')]())[_0xc430('0x34')]('state\x20=\x20?',_0x31ae3c[_0xc430('0x47')][_0xc430('0x70')][_0xc430('0x6f')]())[_0xc430('0x34')]('calleridnum\x20IS\x20NOT\x20NULL')[_0xc430('0x34')](_0xc430('0x71'),squel[_0xc430('0x66')]()['field'](_0xc430('0x68'))['from']('cm_hopper')[_0xc430('0x34')]('VoiceQueueId\x20=\x20?',_0x31ae3c[_0xc430('0x42')]['id']['toString']()))[_0xc430('0x34')](_0xc430('0x71'),squel['select']()[_0xc430('0x67')](_0xc430('0x72'))['from'](_0xc430('0x6d'))[_0xc430('0x34')]('VoiceQueueId\x20=\x20?',_0x31ae3c[_0xc430('0x42')]['id'][_0xc430('0x6f')]())['where'](_0xc430('0x73')))[_0xc430('0x74')](_0xc430('0x62')))[_0xc430('0x6f')]();return db[_0xc430('0x4a')][_0xc430('0x2c')](_0x6debfb);}return[];})[_0xc430('0x1e')](respondWithResult(_0x19c080,null))[_0xc430('0x40')](handleError(_0x19c080,null));};exports[_0xc430('0x75')]=function(_0x19789f,_0x24b380,_0x4fe467){return db[_0xc430('0x76')][_0xc430('0x48')]({'where':{'id':_0x19789f[_0xc430('0x42')]['id']}})['then'](handleEntityNotFound(_0x24b380,null))['then'](function(_0x150a8a){var _0x4edead;if(_0x150a8a){_0x4edead=squel[_0xc430('0x5f')]()[_0xc430('0x60')]('cm_hopper')['fromQuery']([_0xc430('0x68'),_0xc430('0x61'),_0xc430('0x62'),'ListId',_0xc430('0x77'),'createdAt','updatedAt'],squel[_0xc430('0x66')]()[_0xc430('0x67')](_0xc430('0x78'),'phone')[_0xc430('0x67')](_0xc430('0x69'),_0xc430('0x61'))[_0xc430('0x67')](_0xc430('0x6a'),'ContactId')['field'](_0xc430('0x6b'),_0xc430('0x63'))[_0xc430('0x67')](_0xc430('0x79'),_0xc430('0x77'))[_0xc430('0x67')](_0xc430('0x69'),_0xc430('0x7a'))[_0xc430('0x67')](_0xc430('0x69'),_0xc430('0x65'))['from'](_0xc430('0x6d'))[_0xc430('0x34')](_0xc430('0x7b'),_0x19789f[_0xc430('0x42')]['id']['toString']())['where'](_0xc430('0x7c'),_0x19789f['body'][_0xc430('0x70')][_0xc430('0x6f')]())[_0xc430('0x34')](_0xc430('0x7d'))[_0xc430('0x34')]('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()['field']('phone')[_0xc430('0x7e')]('cm_hopper')['where'](_0xc430('0x7b'),_0x19789f[_0xc430('0x42')]['id'][_0xc430('0x6f')]()))[_0xc430('0x34')](_0xc430('0x71'),squel[_0xc430('0x66')]()[_0xc430('0x67')](_0xc430('0x72'))[_0xc430('0x7e')](_0xc430('0x6d'))[_0xc430('0x34')](_0xc430('0x7b'),_0x19789f[_0xc430('0x42')]['id']['toString']())[_0xc430('0x34')](_0xc430('0x73')))[_0xc430('0x74')](_0xc430('0x62')))[_0xc430('0x6f')]();return db[_0xc430('0x4a')][_0xc430('0x2c')](_0x4edead);}return[];})[_0xc430('0x1e')](respondWithResult(_0x24b380,null))['catch'](handleError(_0x24b380,null));};exports[_0xc430('0x7f')]=function(_0x6e48a3,_0x5be78a,_0x3bd6e1){return db[_0xc430('0x80')][_0xc430('0x81')]({'where':{'VoiceQueueId':_0x6e48a3[_0xc430('0x47')]['VoiceQueueId'],'CampaignId':_0x6e48a3[_0xc430('0x47')]['CampaignId'],'ContactId':_0x6e48a3['body'][_0xc430('0x62')]}})[_0xc430('0x1e')](handleEntityNotFound(_0x5be78a,null))[_0xc430('0x1e')](function(_0x207067){if(_0x207067){return _0x207067;}return null;})[_0xc430('0x1e')](respondWithResult(_0x5be78a,null))[_0xc430('0x40')](handleError(_0x5be78a,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 8032332..116acd3 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 _0x332b=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','calleridnum','uniqueid','lodash','util'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0x332b,0x7c));var _0xb332=function(_0x41f7d2,_0x2b0e50){_0x41f7d2=_0x41f7d2-0x0;var _0x2a0b55=_0x332b[_0x41f7d2];return _0x2a0b55;};'use strict';var _=require(_0xb332('0x0'));var util=require(_0xb332('0x1'));var logger=require(_0xb332('0x2'))(_0xb332('0x3'));var moment=require(_0xb332('0x4'));var BPromise=require(_0xb332('0x5'));var rp=require(_0xb332('0x6'));var fs=require('fs');var path=require(_0xb332('0x7'));var rimraf=require(_0xb332('0x8'));var config=require(_0xb332('0x9'));var attributes=require(_0xb332('0xa'));module[_0xb332('0xb')]=function(_0x14429a,_0x475479){return _0x14429a['define']('CmHopperFinal',attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0xb332('0xc'),'fields':[_0xb332('0xc')]},{'name':_0xb332('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xbead=['api','moment','bluebird','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','define','CmHopperFinal','calleridnum','uniqueid','../../config/logger'];(function(_0x1e2080,_0x53283b){var _0x260111=function(_0x15da5e){while(--_0x15da5e){_0x1e2080['push'](_0x1e2080['shift']());}};_0x260111(++_0x53283b);}(_0xbead,0x81));var _0xdbea=function(_0x4fa0ea,_0x2cd534){_0x4fa0ea=_0x4fa0ea-0x0;var _0x51d027=_0xbead[_0x4fa0ea];return _0x51d027;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xdbea('0x0'))(_0xdbea('0x1'));var moment=require(_0xdbea('0x2'));var BPromise=require(_0xdbea('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdbea('0x4'));var rimraf=require(_0xdbea('0x5'));var config=require(_0xdbea('0x6'));var attributes=require(_0xdbea('0x7'));module[_0xdbea('0x8')]=function(_0x2f3b8c,_0x5d6fbf){return _0x2f3b8c[_0xdbea('0x9')](_0xdbea('0xa'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0xdbea('0xb'),'fields':['calleridnum']},{'name':'uniqueid','fields':[_0xdbea('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 039548f..c0448af 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 _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x5c870a,_0xde2083){var _0x252bb1=function(_0x4006bd){while(--_0x4006bd){_0x5c870a['push'](_0x5c870a['shift']());}};_0x252bb1(++_0xde2083);}(_0xb10b,0x12a));var _0xbb10=function(_0x1d5d6a,_0x1ec6b4){_0x1d5d6a=_0x1d5d6a-0x0;var _0x1c2058=_0xb10b[_0x1d5d6a];return _0x1c2058;};'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')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x4d4126,_0x2a74f0){var _0x5b6bf1=function(_0xafeca8){while(--_0xafeca8){_0x4d4126['push'](_0x4d4126['shift']());}};_0x5b6bf1(++_0x2a74f0);}(_0xb10b,0x12a));var _0xbb10=function(_0x1b8f52,_0x111226){_0x1b8f52=_0x1b8f52-0x0;var _0x17c536=_0xb10b[_0x1b8f52];return _0x17c536;};'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')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 615d56b..d7826e8 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 _0xc1b3=['/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','describe','/:id','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xc1b3,0x1d5));var _0x3c1b=function(_0x5b9d10,_0x577daa){_0x5b9d10=_0x5b9d10-0x0;var _0x3534c4=_0xc1b3[_0x5b9d10];return _0x3534c4;};'use strict';var multer=require(_0x3c1b('0x0'));var util=require(_0x3c1b('0x1'));var path=require(_0x3c1b('0x2'));var timeout=require(_0x3c1b('0x3'));var express=require(_0x3c1b('0x4'));var router=express[_0x3c1b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3c1b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3c1b('0x7'));var controller=require(_0x3c1b('0x8'));router[_0x3c1b('0x9')]('/',auth[_0x3c1b('0xa')](),controller[_0x3c1b('0xb')]);router[_0x3c1b('0x9')](_0x3c1b('0xc'),auth[_0x3c1b('0xa')](),controller[_0x3c1b('0xd')]);router[_0x3c1b('0x9')](_0x3c1b('0xe'),auth[_0x3c1b('0xa')](),controller['show']);router[_0x3c1b('0x9')](_0x3c1b('0xf'),auth['isAuthenticated'](),controller[_0x3c1b('0x10')]);router[_0x3c1b('0x9')](_0x3c1b('0x11'),auth[_0x3c1b('0xa')](),controller[_0x3c1b('0x12')]);router['post'](_0x3c1b('0x13'),auth[_0x3c1b('0xa')](),controller[_0x3c1b('0x14')]);router[_0x3c1b('0x15')](_0x3c1b('0x16'),auth[_0x3c1b('0xa')](),controller[_0x3c1b('0x17')]);router[_0x3c1b('0x15')](_0x3c1b('0x18'),auth[_0x3c1b('0xa')](),controller[_0x3c1b('0x19')]);router['put']('/:id',auth[_0x3c1b('0xa')](),controller['update']);module[_0x3c1b('0x1a')]=router; \ No newline at end of file +var _0x4429=['/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','checkContactHopper','update','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','describe','/:id','isAuthenticated','show','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post'];(function(_0x330376,_0x70a3f){var _0xb7f093=function(_0x3f2586){while(--_0x3f2586){_0x330376['push'](_0x330376['shift']());}};_0xb7f093(++_0x70a3f);}(_0x4429,0x1ce));var _0x9442=function(_0x5c3266,_0x1868eb){_0x5c3266=_0x5c3266-0x0;var _0x370fd4=_0x4429[_0x5c3266];return _0x370fd4;};'use strict';var multer=require('multer');var util=require(_0x9442('0x0'));var path=require(_0x9442('0x1'));var timeout=require(_0x9442('0x2'));var express=require(_0x9442('0x3'));var router=express['Router']();var fs_extra=require(_0x9442('0x4'));var auth=require(_0x9442('0x5'));var interaction=require(_0x9442('0x6'));var config=require(_0x9442('0x7'));var controller=require('./cmHopperFinal.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x9442('0x8')]);router[_0x9442('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x9442('0xa')]);router[_0x9442('0x9')](_0x9442('0xb'),auth[_0x9442('0xc')](),controller[_0x9442('0xd')]);router['get']('/voice/queue/countAttributes/:id',auth[_0x9442('0xc')](),controller[_0x9442('0xe')]);router['get'](_0x9442('0xf'),auth['isAuthenticated'](),controller[_0x9442('0x10')]);router[_0x9442('0x11')](_0x9442('0x12'),auth[_0x9442('0xc')](),controller[_0x9442('0x13')]);router['post'](_0x9442('0x14'),auth['isAuthenticated'](),controller[_0x9442('0x15')]);router[_0x9442('0x11')]('/checkContactHopper',auth['isAuthenticated'](),controller[_0x9442('0x16')]);router['put'](_0x9442('0xb'),auth[_0x9442('0xc')](),controller[_0x9442('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index bae3fbe..8a16307 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 _0xc963=['DATE','INTEGER','BOOLEAN','sequelize','STRING'];(function(_0x3e5dcc,_0xe92fe0){var _0x10b5d5=function(_0x45a453){while(--_0x45a453){_0x3e5dcc['push'](_0x3e5dcc['shift']());}};_0x10b5d5(++_0xe92fe0);}(_0xc963,0x17f));var _0x3c96=function(_0x208d75,_0x92d742){_0x208d75=_0x208d75-0x0;var _0x382d27=_0xc963[_0x208d75];return _0x382d27;};'use strict';var Sequelize=require(_0x3c96('0x0'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x3c96('0x1')]},'scheduledat':{'type':Sequelize[_0x3c96('0x2')]},'countbusyretry':{'type':Sequelize[_0x3c96('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x3c96('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x3c96('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x3c96('0x1')]},'originatecalleridnum':{'type':Sequelize[_0x3c96('0x1')]},'originatecalleridname':{'type':Sequelize[_0x3c96('0x1')]},'calleridnum':{'type':Sequelize[_0x3c96('0x1')]},'calleridname':{'type':Sequelize[_0x3c96('0x1')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x3c96('0x2')]},'answertime':{'type':Sequelize[_0x3c96('0x2')]},'droptime':{'type':Sequelize[_0x3c96('0x2')]},'endtime':{'type':Sequelize[_0x3c96('0x2')]},'ringtime':{'type':Sequelize[_0x3c96('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x3c96('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x3c96('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x3c96('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x3c96('0x1')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x3c96('0x1')]},'reason':{'type':Sequelize[_0x3c96('0x1')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x3c96('0x4')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x3c96('0x2')]},'recallme':{'type':Sequelize[_0x3c96('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x3c96('0x2')]},'edited':{'type':Sequelize[_0x3c96('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x3c96('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x3c96('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x3c96('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x3c96('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x3c96('0x3')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x3c96('0x1')]}}; \ No newline at end of file +var _0xfb3e=['STRING','DATE','BOOLEAN','sequelize','exports','INTEGER'];(function(_0x3b27a2,_0x26be85){var _0x4d0878=function(_0x39925b){while(--_0x39925b){_0x3b27a2['push'](_0x3b27a2['shift']());}};_0x4d0878(++_0x26be85);}(_0xfb3e,0x7b));var _0xefb3=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xfb3e[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require(_0xefb3('0x0'));module[_0xefb3('0x1')]={'state':{'type':Sequelize[_0xefb3('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xefb3('0x3')]},'scheduledat':{'type':Sequelize[_0xefb3('0x4')]},'countbusyretry':{'type':Sequelize[_0xefb3('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xefb3('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xefb3('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xefb3('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xefb3('0x3')]},'calleridnum':{'type':Sequelize[_0xefb3('0x3')]},'calleridname':{'type':Sequelize[_0xefb3('0x3')]},'starttime':{'type':Sequelize[_0xefb3('0x4')]},'responsetime':{'type':Sequelize[_0xefb3('0x4')]},'answertime':{'type':Sequelize[_0xefb3('0x4')]},'droptime':{'type':Sequelize[_0xefb3('0x4')]},'endtime':{'type':Sequelize[_0xefb3('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xefb3('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xefb3('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xefb3('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xefb3('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xefb3('0x3')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0xefb3('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0xefb3('0x5')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xefb3('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xefb3('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0xefb3('0x4')]},'edited':{'type':Sequelize[_0xefb3('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xefb3('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xefb3('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xefb3('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xefb3('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xefb3('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 326ae4b..99658b0 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 _0x8e32=['desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','CmHopperHistory','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','describe','uniqueid','find','eml-format','zip-dir','request-promise','bluebird','util','to-csv','ejs','crypto','jsforce'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x8e32,0x15a));var _0x28e3=function(_0x153049,_0x3b9df4){_0x153049=_0x153049-0x0;var _0x39c783=_0x8e32[_0x153049];return _0x39c783;};'use strict';var emlformat=require(_0x28e3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x28e3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x28e3('0x2'));var moment=require('moment');var BPromise=require(_0x28e3('0x3'));var Mustache=require('mustache');var util=require(_0x28e3('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x28e3('0x5'));var ejs=require(_0x28e3('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x28e3('0x7'));var jsforce=require(_0x28e3('0x8'));var deskjs=require(_0x28e3('0x9'));var toCsv=require(_0x28e3('0x5'));var querystring=require(_0x28e3('0xa'));var Papa=require(_0x28e3('0xb'));var Redis=require(_0x28e3('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x28e3('0xd'));var hardwareService=require(_0x28e3('0xe'));var logger=require('../../config/logger')(_0x28e3('0xf'));var utils=require(_0x28e3('0x10'));var config=require(_0x28e3('0x11'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2df271,_0x2502d5){_0x2502d5=_0x2502d5||0xcc;return function(_0x5ed15b){if(_0x5ed15b){return _0x2df271[_0x28e3('0x12')](_0x2502d5);}return _0x2df271[_0x28e3('0x13')](_0x2502d5)[_0x28e3('0x14')]();};}function respondWithResult(_0x49ed6e,_0x2037b4){_0x2037b4=_0x2037b4||0xc8;return function(_0x420d6e){if(_0x420d6e){return _0x49ed6e[_0x28e3('0x13')](_0x2037b4)[_0x28e3('0x15')](_0x420d6e);}};}function respondWithFilteredResult(_0x33e54e,_0xa4db09){return function(_0x5baee4){if(_0x5baee4){var _0x4c6480=typeof _0xa4db09[_0x28e3('0x16')]===_0x28e3('0x17')&&typeof _0xa4db09[_0x28e3('0x18')]==='undefined';var _0x500604=_0x5baee4[_0x28e3('0x19')];var _0x311aad=_0x4c6480?0x0:_0xa4db09[_0x28e3('0x16')];var _0x3effde=_0x4c6480?_0x5baee4[_0x28e3('0x19')]:_0xa4db09[_0x28e3('0x16')]+_0xa4db09[_0x28e3('0x18')];var _0x116994;if(_0x3effde>=_0x500604){_0x3effde=_0x500604;_0x116994=0xc8;}else{_0x116994=0xce;}_0x33e54e[_0x28e3('0x13')](_0x116994);return _0x33e54e[_0x28e3('0x1a')](_0x28e3('0x1b'),_0x311aad+'-'+_0x3effde+'/'+_0x500604)[_0x28e3('0x15')](_0x5baee4);}return null;};}function patchUpdates(_0x2c9313){return function(_0x3591ed){try{jsonpatch[_0x28e3('0x1c')](_0x3591ed,_0x2c9313,!![]);}catch(_0x493cd4){return BPromise[_0x28e3('0x1d')](_0x493cd4);}return _0x3591ed[_0x28e3('0x1e')]();};}function saveUpdates(_0x629c54,_0x45f8e2){return function(_0x115dd9){if(_0x115dd9){return _0x115dd9[_0x28e3('0x1f')](_0x629c54)[_0x28e3('0x20')](function(_0x134b2f){return _0x134b2f;});}return null;};}function removeEntity(_0x504984,_0xdd4447){return function(_0x4c45e4){if(_0x4c45e4){return _0x4c45e4[_0x28e3('0x21')]()[_0x28e3('0x20')](function(){_0x504984[_0x28e3('0x13')](0xcc)[_0x28e3('0x14')]();});}};}function handleEntityNotFound(_0x406ada,_0x383c73){return function(_0xa3c3a4){if(!_0xa3c3a4){_0x406ada[_0x28e3('0x12')](0x194);}return _0xa3c3a4;};}function handleError(_0x5c074c,_0x521a03){_0x521a03=_0x521a03||0x1f4;return function(_0x212fad){logger[_0x28e3('0x22')](_0x212fad[_0x28e3('0x23')]);if(_0x212fad[_0x28e3('0x24')]){delete _0x212fad[_0x28e3('0x24')];}_0x5c074c['status'](_0x521a03)[_0x28e3('0x25')](_0x212fad);};}exports[_0x28e3('0x26')]=function(_0x3bd54a,_0x2e64be){var _0x1d513f={},_0x3956c1={},_0x3ba30a={'count':0x0,'rows':[]};var _0x1375e8=_[_0x28e3('0x27')](db[_0x28e3('0x28')][_0x28e3('0x29')],function(_0x54c0e5){return{'name':_0x54c0e5['fieldName'],'type':_0x54c0e5[_0x28e3('0x2a')][_0x28e3('0x2b')]};});_0x3956c1[_0x28e3('0x2c')]=_[_0x28e3('0x27')](_0x1375e8,_0x28e3('0x24'));_0x3956c1[_0x28e3('0x2d')]=_[_0x28e3('0x2e')](_0x3bd54a[_0x28e3('0x2d')]);_0x3956c1[_0x28e3('0x2f')]=_[_0x28e3('0x30')](_0x3956c1[_0x28e3('0x2c')],_0x3956c1[_0x28e3('0x2d')]);_0x1d513f[_0x28e3('0x31')]=_[_0x28e3('0x30')](_0x3956c1[_0x28e3('0x2c')],qs['fields'](_0x3bd54a[_0x28e3('0x2d')][_0x28e3('0x32')]));_0x1d513f[_0x28e3('0x31')]=_0x1d513f[_0x28e3('0x31')][_0x28e3('0x33')]?_0x1d513f[_0x28e3('0x31')]:_0x3956c1['model'];if(!_0x3bd54a[_0x28e3('0x2d')]['hasOwnProperty']('nolimit')){_0x1d513f['limit']=qs[_0x28e3('0x18')](_0x3bd54a[_0x28e3('0x2d')][_0x28e3('0x18')]);_0x1d513f[_0x28e3('0x16')]=qs[_0x28e3('0x16')](_0x3bd54a[_0x28e3('0x2d')][_0x28e3('0x16')]);}_0x1d513f['order']=qs[_0x28e3('0x34')](_0x3bd54a[_0x28e3('0x2d')][_0x28e3('0x34')]);_0x1d513f[_0x28e3('0x35')]=qs[_0x28e3('0x2f')](_[_0x28e3('0x36')](_0x3bd54a[_0x28e3('0x2d')],_0x3956c1['filters']),_0x1375e8);if(_0x3bd54a['query'][_0x28e3('0x37')]){_0x1d513f[_0x28e3('0x35')]=_['merge'](_0x1d513f['where'],{'$or':_[_0x28e3('0x27')](_0x1375e8,function(_0x13cb0e){if(_0x13cb0e['type']!==_0x28e3('0x38')){var _0x16d56c={};_0x16d56c[_0x13cb0e['name']]={'$like':'%'+_0x3bd54a[_0x28e3('0x2d')][_0x28e3('0x37')]+'%'};return _0x16d56c;}})});}_0x1d513f=_[_0x28e3('0x39')]({},_0x1d513f,_0x3bd54a[_0x28e3('0x3a')]);var _0x15ba7d={'where':_0x1d513f[_0x28e3('0x35')]};return db[_0x28e3('0x28')][_0x28e3('0x19')](_0x15ba7d)[_0x28e3('0x20')](function(_0x5f0149){_0x3ba30a[_0x28e3('0x19')]=_0x5f0149;if(_0x3bd54a[_0x28e3('0x2d')][_0x28e3('0x3b')]){_0x1d513f[_0x28e3('0x3c')]=[{'all':!![]}];}return db[_0x28e3('0x28')][_0x28e3('0x3d')](_0x1d513f);})[_0x28e3('0x20')](function(_0x502d9d){_0x3ba30a[_0x28e3('0x3e')]=_0x502d9d;return _0x3ba30a;})[_0x28e3('0x20')](respondWithFilteredResult(_0x2e64be,_0x1d513f))[_0x28e3('0x3f')](handleError(_0x2e64be,null));};exports[_0x28e3('0x40')]=function(_0x20023c,_0x4658cd){var _0x5e382b={'raw':!![],'where':{'id':_0x20023c[_0x28e3('0x41')]['id']}},_0xe40a28={};_0xe40a28[_0x28e3('0x2c')]=_['keys'](db['CmHopperHistory'][_0x28e3('0x29')]);_0xe40a28[_0x28e3('0x2d')]=_[_0x28e3('0x2e')](_0x20023c[_0x28e3('0x2d')]);_0xe40a28['filters']=_[_0x28e3('0x30')](_0xe40a28[_0x28e3('0x2c')],_0xe40a28['query']);_0x5e382b[_0x28e3('0x31')]=_[_0x28e3('0x30')](_0xe40a28['model'],qs[_0x28e3('0x32')](_0x20023c[_0x28e3('0x2d')][_0x28e3('0x32')]));_0x5e382b[_0x28e3('0x31')]=_0x5e382b[_0x28e3('0x31')][_0x28e3('0x33')]?_0x5e382b[_0x28e3('0x31')]:_0xe40a28['model'];if(_0x20023c[_0x28e3('0x2d')][_0x28e3('0x3b')]){_0x5e382b[_0x28e3('0x3c')]=[{'all':!![]}];}_0x5e382b=_['merge']({},_0x5e382b,_0x20023c[_0x28e3('0x3a')]);return db['CmHopperHistory']['find'](_0x5e382b)[_0x28e3('0x20')](handleEntityNotFound(_0x4658cd,null))[_0x28e3('0x20')](respondWithResult(_0x4658cd,null))[_0x28e3('0x3f')](handleError(_0x4658cd,null));};exports[_0x28e3('0x42')]=function(_0x5c30ec,_0x31688a){return db['CmHopperHistory'][_0x28e3('0x42')](_0x5c30ec[_0x28e3('0x43')],{})[_0x28e3('0x20')](respondWithResult(_0x31688a,0xc9))['catch'](handleError(_0x31688a,null));};exports[_0x28e3('0x44')]=function(_0x235d4b,_0x40310a){return db[_0x28e3('0x28')][_0x28e3('0x44')]()[_0x28e3('0x20')](respondWithResult(_0x40310a,null))[_0x28e3('0x3f')](handleError(_0x40310a,null));};exports[_0x28e3('0x1f')]=function(_0x54dd3f,_0x4f9845){if(_0x54dd3f[_0x28e3('0x43')][_0x28e3('0x45')]){delete _0x54dd3f[_0x28e3('0x43')][_0x28e3('0x45')];}return db[_0x28e3('0x28')][_0x28e3('0x46')]({'where':{'uniqueid':_0x54dd3f[_0x28e3('0x41')]['id']}})[_0x28e3('0x20')](handleEntityNotFound(_0x4f9845,null))[_0x28e3('0x20')](saveUpdates(_0x54dd3f[_0x28e3('0x43')],null))['then'](respondWithResult(_0x4f9845,null))[_0x28e3('0x3f')](handleError(_0x4f9845,null));}; \ No newline at end of file +var _0x12b0=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','set','json','reject','save','update','destroy','then','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','CmHopperHistory','findAll','rows','catch','params','includeAll','create','body','describe','uniqueid','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs'];(function(_0x3fd5ac,_0x221734){var _0x1ce2de=function(_0x7e3572){while(--_0x7e3572){_0x3fd5ac['push'](_0x3fd5ac['shift']());}};_0x1ce2de(++_0x221734);}(_0x12b0,0x1b2));var _0x012b=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x12b0[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require(_0x012b('0x0'));var rimraf=require(_0x012b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x012b('0x2'));var moment=require(_0x012b('0x3'));var BPromise=require(_0x012b('0x4'));var Mustache=require(_0x012b('0x5'));var util=require('util');var path=require(_0x012b('0x6'));var sox=require('sox');var csv=require(_0x012b('0x7'));var ejs=require(_0x012b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x012b('0x9'));var squel=require(_0x012b('0xa'));var crypto=require('crypto');var jsforce=require(_0x012b('0xb'));var deskjs=require(_0x012b('0xc'));var toCsv=require(_0x012b('0x7'));var querystring=require(_0x012b('0xd'));var Papa=require(_0x012b('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x012b('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x012b('0x10'));var logger=require(_0x012b('0x11'))(_0x012b('0x12'));var utils=require(_0x012b('0x13'));var config=require(_0x012b('0x14'));var licenseUtil=require(_0x012b('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x34ad2d,_0x3a2f4c){_0x3a2f4c=_0x3a2f4c||0xcc;return function(_0x4dcc8a){if(_0x4dcc8a){return _0x34ad2d[_0x012b('0x16')](_0x3a2f4c);}return _0x34ad2d[_0x012b('0x17')](_0x3a2f4c)[_0x012b('0x18')]();};}function respondWithResult(_0x4f4bc0,_0x4c8174){_0x4c8174=_0x4c8174||0xc8;return function(_0x5cb358){if(_0x5cb358){return _0x4f4bc0[_0x012b('0x17')](_0x4c8174)['json'](_0x5cb358);}};}function respondWithFilteredResult(_0x3e66d3,_0x33e8db){return function(_0x2ab324){if(_0x2ab324){var _0x59b1c1=typeof _0x33e8db[_0x012b('0x19')]===_0x012b('0x1a')&&typeof _0x33e8db['limit']===_0x012b('0x1a');var _0xfc3e6b=_0x2ab324[_0x012b('0x1b')];var _0x3dc296=_0x59b1c1?0x0:_0x33e8db[_0x012b('0x19')];var _0x24f810=_0x59b1c1?_0x2ab324[_0x012b('0x1b')]:_0x33e8db[_0x012b('0x19')]+_0x33e8db[_0x012b('0x1c')];var _0x4bedfa;if(_0x24f810>=_0xfc3e6b){_0x24f810=_0xfc3e6b;_0x4bedfa=0xc8;}else{_0x4bedfa=0xce;}_0x3e66d3['status'](_0x4bedfa);return _0x3e66d3[_0x012b('0x1d')]('Content-Range',_0x3dc296+'-'+_0x24f810+'/'+_0xfc3e6b)[_0x012b('0x1e')](_0x2ab324);}return null;};}function patchUpdates(_0x6cdd4a){return function(_0x126a6b){try{jsonpatch['apply'](_0x126a6b,_0x6cdd4a,!![]);}catch(_0x5589d1){return BPromise[_0x012b('0x1f')](_0x5589d1);}return _0x126a6b[_0x012b('0x20')]();};}function saveUpdates(_0x59ffcf,_0x3d6155){return function(_0x1fa3bd){if(_0x1fa3bd){return _0x1fa3bd[_0x012b('0x21')](_0x59ffcf)['then'](function(_0x3616f1){return _0x3616f1;});}return null;};}function removeEntity(_0x251929,_0x955bdb){return function(_0x39e3b6){if(_0x39e3b6){return _0x39e3b6[_0x012b('0x22')]()[_0x012b('0x23')](function(){_0x251929[_0x012b('0x17')](0xcc)[_0x012b('0x18')]();});}};}function handleEntityNotFound(_0x4c76dc,_0x579a34){return function(_0x52e3fe){if(!_0x52e3fe){_0x4c76dc[_0x012b('0x16')](0x194);}return _0x52e3fe;};}function handleError(_0x93e66c,_0x1adf9f){_0x1adf9f=_0x1adf9f||0x1f4;return function(_0x18db36){logger[_0x012b('0x24')](_0x18db36[_0x012b('0x25')]);if(_0x18db36[_0x012b('0x26')]){delete _0x18db36[_0x012b('0x26')];}_0x93e66c['status'](_0x1adf9f)[_0x012b('0x27')](_0x18db36);};}exports[_0x012b('0x28')]=function(_0x45db47,_0xd6076e){var _0x5eb642={},_0x32d540={},_0x187fcf={'count':0x0,'rows':[]};var _0x4e6048=_['map'](db['CmHopperHistory'][_0x012b('0x29')],function(_0x53f64a){return{'name':_0x53f64a[_0x012b('0x2a')],'type':_0x53f64a[_0x012b('0x2b')][_0x012b('0x2c')]};});_0x32d540[_0x012b('0x2d')]=_[_0x012b('0x2e')](_0x4e6048,_0x012b('0x26'));_0x32d540[_0x012b('0x2f')]=_[_0x012b('0x30')](_0x45db47[_0x012b('0x2f')]);_0x32d540[_0x012b('0x31')]=_[_0x012b('0x32')](_0x32d540[_0x012b('0x2d')],_0x32d540['query']);_0x5eb642['attributes']=_[_0x012b('0x32')](_0x32d540[_0x012b('0x2d')],qs[_0x012b('0x33')](_0x45db47[_0x012b('0x2f')][_0x012b('0x33')]));_0x5eb642[_0x012b('0x34')]=_0x5eb642[_0x012b('0x34')][_0x012b('0x35')]?_0x5eb642[_0x012b('0x34')]:_0x32d540['model'];if(!_0x45db47['query'][_0x012b('0x36')](_0x012b('0x37'))){_0x5eb642[_0x012b('0x1c')]=qs[_0x012b('0x1c')](_0x45db47['query'][_0x012b('0x1c')]);_0x5eb642[_0x012b('0x19')]=qs['offset'](_0x45db47[_0x012b('0x2f')][_0x012b('0x19')]);}_0x5eb642[_0x012b('0x38')]=qs['sort'](_0x45db47['query'][_0x012b('0x39')]);_0x5eb642[_0x012b('0x3a')]=qs[_0x012b('0x31')](_[_0x012b('0x3b')](_0x45db47[_0x012b('0x2f')],_0x32d540[_0x012b('0x31')]),_0x4e6048);if(_0x45db47['query'][_0x012b('0x3c')]){_0x5eb642[_0x012b('0x3a')]=_['merge'](_0x5eb642[_0x012b('0x3a')],{'$or':_[_0x012b('0x2e')](_0x4e6048,function(_0x1d529e){if(_0x1d529e[_0x012b('0x2b')]!==_0x012b('0x3d')){var _0x5b79e9={};_0x5b79e9[_0x1d529e[_0x012b('0x26')]]={'$like':'%'+_0x45db47['query'][_0x012b('0x3c')]+'%'};return _0x5b79e9;}})});}_0x5eb642=_[_0x012b('0x3e')]({},_0x5eb642,_0x45db47[_0x012b('0x3f')]);var _0x14e7ed={'where':_0x5eb642[_0x012b('0x3a')]};return db['CmHopperHistory']['count'](_0x14e7ed)[_0x012b('0x23')](function(_0x4a18c7){_0x187fcf[_0x012b('0x1b')]=_0x4a18c7;if(_0x45db47[_0x012b('0x2f')]['includeAll']){_0x5eb642[_0x012b('0x40')]=[{'all':!![]}];}return db[_0x012b('0x41')][_0x012b('0x42')](_0x5eb642);})['then'](function(_0xa7d4d8){_0x187fcf[_0x012b('0x43')]=_0xa7d4d8;return _0x187fcf;})['then'](respondWithFilteredResult(_0xd6076e,_0x5eb642))[_0x012b('0x44')](handleError(_0xd6076e,null));};exports['show']=function(_0x3e91b9,_0x337be7){var _0x4c5f76={'raw':!![],'where':{'id':_0x3e91b9[_0x012b('0x45')]['id']}},_0x3e85f8={};_0x3e85f8['model']=_[_0x012b('0x30')](db['CmHopperHistory']['rawAttributes']);_0x3e85f8[_0x012b('0x2f')]=_[_0x012b('0x30')](_0x3e91b9['query']);_0x3e85f8[_0x012b('0x31')]=_[_0x012b('0x32')](_0x3e85f8[_0x012b('0x2d')],_0x3e85f8[_0x012b('0x2f')]);_0x4c5f76[_0x012b('0x34')]=_[_0x012b('0x32')](_0x3e85f8['model'],qs[_0x012b('0x33')](_0x3e91b9[_0x012b('0x2f')][_0x012b('0x33')]));_0x4c5f76[_0x012b('0x34')]=_0x4c5f76[_0x012b('0x34')][_0x012b('0x35')]?_0x4c5f76[_0x012b('0x34')]:_0x3e85f8['model'];if(_0x3e91b9[_0x012b('0x2f')][_0x012b('0x46')]){_0x4c5f76[_0x012b('0x40')]=[{'all':!![]}];}_0x4c5f76=_[_0x012b('0x3e')]({},_0x4c5f76,_0x3e91b9[_0x012b('0x3f')]);return db[_0x012b('0x41')]['find'](_0x4c5f76)[_0x012b('0x23')](handleEntityNotFound(_0x337be7,null))[_0x012b('0x23')](respondWithResult(_0x337be7,null))[_0x012b('0x44')](handleError(_0x337be7,null));};exports[_0x012b('0x47')]=function(_0x216cc7,_0x1f00e0){return db[_0x012b('0x41')][_0x012b('0x47')](_0x216cc7[_0x012b('0x48')],{})[_0x012b('0x23')](respondWithResult(_0x1f00e0,0xc9))[_0x012b('0x44')](handleError(_0x1f00e0,null));};exports[_0x012b('0x49')]=function(_0x4a5b2c,_0x1e58b9){return db[_0x012b('0x41')]['describe']()[_0x012b('0x23')](respondWithResult(_0x1e58b9,null))[_0x012b('0x44')](handleError(_0x1e58b9,null));};exports[_0x012b('0x21')]=function(_0x4b7dfd,_0x283bfb){if(_0x4b7dfd[_0x012b('0x48')]['uniqueid']){delete _0x4b7dfd[_0x012b('0x48')][_0x012b('0x4a')];}return db[_0x012b('0x41')]['find']({'where':{'uniqueid':_0x4b7dfd[_0x012b('0x45')]['id']}})[_0x012b('0x23')](handleEntityNotFound(_0x283bfb,null))['then'](saveUpdates(_0x4b7dfd['body'],null))[_0x012b('0x23')](respondWithResult(_0x283bfb,null))[_0x012b('0x44')](handleError(_0x283bfb,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index e6cc7da..03a9962 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 _0xfa94=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','CmHopperHistory','cm_hopper_history','uniqueid','lodash'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xfa94,0xef));var _0x4fa9=function(_0x2706da,_0x3856f5){_0x2706da=_0x2706da-0x0;var _0x3ba87e=_0xfa94[_0x2706da];return _0x3ba87e;};'use strict';var _=require(_0x4fa9('0x0'));var util=require('util');var logger=require(_0x4fa9('0x1'))('api');var moment=require(_0x4fa9('0x2'));var BPromise=require(_0x4fa9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4fa9('0x4'));var rimraf=require(_0x4fa9('0x5'));var config=require(_0x4fa9('0x6'));var attributes=require(_0x4fa9('0x7'));module[_0x4fa9('0x8')]=function(_0x460a55,_0x3b703f){return _0x460a55['define'](_0x4fa9('0x9'),attributes,{'tableName':_0x4fa9('0xa'),'paranoid':![],'indexes':[{'name':'endtime','fields':['endtime']},{'name':_0x4fa9('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x5430=['define','CmHopperHistory','endtime','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','rimraf','exports'];(function(_0x231f86,_0x4a7061){var _0x4fd1f5=function(_0x1c744e){while(--_0x1c744e){_0x231f86['push'](_0x231f86['shift']());}};_0x4fd1f5(++_0x4a7061);}(_0x5430,0x10c));var _0x0543=function(_0x2d7067,_0x24197e){_0x2d7067=_0x2d7067-0x0;var _0xb0a676=_0x5430[_0x2d7067];return _0xb0a676;};'use strict';var _=require(_0x0543('0x0'));var util=require(_0x0543('0x1'));var logger=require(_0x0543('0x2'))(_0x0543('0x3'));var moment=require(_0x0543('0x4'));var BPromise=require(_0x0543('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0543('0x6'));var config=require('../../config/environment');var attributes=require('./cmHopperHistory.attributes');module[_0x0543('0x7')]=function(_0x45b909,_0x9754ba){return _0x45b909[_0x0543('0x8')](_0x0543('0x9'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0x0543('0xa'),'fields':[_0x0543('0xa')]},{'name':_0x0543('0xb'),'fields':[_0x0543('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 6402c2d..f9be0cb 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 _0x643f=['outboundCongestionCallsDay','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','AvgHandleTime','findAll','raw','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay'];(function(_0x316f23,_0x17eaac){var _0xc72a88=function(_0x5cecbf){while(--_0x5cecbf){_0x316f23['push'](_0x316f23['shift']());}};_0xc72a88(++_0x17eaac);}(_0x643f,0x1e6));var _0xf643=function(_0x11d684,_0x4d4123){_0x11d684=_0x11d684-0x0;var _0x78a301=_0x643f[_0x11d684];return _0x78a301;};'use strict';var _=require('lodash');var util=require(_0xf643('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf643('0x1'));var fs=require('fs');var Redis=require(_0xf643('0x2'));var db=require(_0xf643('0x3'))['db'];var utils=require(_0xf643('0x4'));var logger=require(_0xf643('0x5'))(_0xf643('0x6'));var config=require(_0xf643('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf643('0x8')][_0xf643('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x531a6e,_0x5acb9a,_0x28904b){return new BPromise(function(_0x3544d6,_0x36cf77){return client['request'](_0x531a6e,_0x28904b)[_0xf643('0xa')](function(_0x2f0a19){logger[_0xf643('0xb')](_0xf643('0xc'),_0x5acb9a,_0xf643('0xd'));logger[_0xf643('0xe')](_0xf643('0xf'),_0x5acb9a,_0xf643('0xd'),JSON[_0xf643('0x10')](_0x2f0a19));if(_0x2f0a19[_0xf643('0x11')]){if(_0x2f0a19[_0xf643('0x11')]['code']===0x1f4){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x5acb9a,_0x2f0a19['error'][_0xf643('0x12')]);return _0x36cf77(_0x2f0a19['error']['message']);}logger[_0xf643('0x11')](_0xf643('0xc'),_0x5acb9a,_0x2f0a19['error'][_0xf643('0x12')]);return _0x3544d6(_0x2f0a19[_0xf643('0x11')][_0xf643('0x12')]);}else{logger[_0xf643('0xb')](_0xf643('0xc'),_0x5acb9a,_0xf643('0xd'));_0x3544d6(_0x2f0a19[_0xf643('0x13')][_0xf643('0x12')]);}})[_0xf643('0x14')](function(_0x3f1566){logger[_0xf643('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x5acb9a,_0x3f1566);_0x36cf77(_0x3f1566);});});}exports[_0xf643('0x15')]=function(_0x45a595){var _0x49603d=this;return new Promise(function(_0x38ca74,_0x21394b){return db[_0xf643('0x16')][_0xf643('0x17')](_0x45a595[_0xf643('0x18')],{'raw':_0x45a595[_0xf643('0x19')]?_0x45a595[_0xf643('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xf643('0xa')](function(_0x32246a){logger[_0xf643('0xb')](_0xf643('0x15'),_0x45a595);logger['debug'](_0xf643('0x15'),_0x45a595,JSON[_0xf643('0x10')](_0x32246a));_0x38ca74(_0x32246a);})[_0xf643('0x14')](function(_0x2fd58d){logger[_0xf643('0x11')](_0xf643('0x15'),_0x2fd58d[_0xf643('0x12')],_0x45a595);_0x21394b(_0x49603d[_0xf643('0x11')](0x1f4,_0x2fd58d[_0xf643('0x12')]));});});};exports[_0xf643('0x1a')]=function(_0x1d0252){var _0x32137f=this;return new Promise(function(_0x9a4641,_0xfa5141){return db[_0xf643('0x16')][_0xf643('0x1b')]({'raw':_0x1d0252['options']?_0x1d0252[_0xf643('0x19')][_0xf643('0x1c')]===undefined?!![]:![]:!![],'where':_0x1d0252['options']?_0x1d0252[_0xf643('0x19')][_0xf643('0x1d')]||null:null,'attributes':[[db[_0xf643('0x1e')]['fn'](_0xf643('0x1f'),db['sequelize'][_0xf643('0x20')]('id')),_0xf643('0x21')],[db[_0xf643('0x1e')]['fn'](_0xf643('0x1f'),db['sequelize']['fn']('IF',db[_0xf643('0x1e')][_0xf643('0x22')](_0xf643('0x23')))),_0xf643('0x24')],[db[_0xf643('0x1e')]['fn'](_0xf643('0x1f'),db[_0xf643('0x1e')]['fn']('IF',db[_0xf643('0x1e')][_0xf643('0x22')]('`state`\x20=\x2010,\x201,\x20null'))),_0xf643('0x25')],[db[_0xf643('0x1e')]['fn']('COUNT',db[_0xf643('0x1e')]['fn']('IF',db['sequelize'][_0xf643('0x22')]('`state`\x20=\x2011,\x201,\x20null'))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0xf643('0x1e')]['fn'](_0xf643('0x26'),db[_0xf643('0x1e')]['fn']('IF',db['sequelize']['literal'](_0xf643('0x27')))),_0xf643('0x28')],[db[_0xf643('0x1e')]['fn'](_0xf643('0x26'),db[_0xf643('0x1e')]['fn']('IF',db['sequelize'][_0xf643('0x22')](_0xf643('0x29')))),'predictiveIntervalAvgTalktime']]})[_0xf643('0xa')](function(_0x5bbf7f){logger[_0xf643('0xb')](_0xf643('0x1a'),_0x1d0252);logger['debug'](_0xf643('0x1a'),_0x1d0252,JSON[_0xf643('0x10')](_0x5bbf7f));_0x9a4641(_0x5bbf7f);})['catch'](function(_0x31dc46){logger['error'](_0xf643('0x1a'),_0x31dc46[_0xf643('0x12')],_0x1d0252);_0xfa5141(_0x32137f[_0xf643('0x11')](0x1f4,_0x31dc46[_0xf643('0x12')]));});});};exports[_0xf643('0x2a')]=function(_0x50b957){var _0x1204f3=this;return new Promise(function(_0x52fe67,_0x4a1717){return db['CmHopperHistory']['findAll']({'raw':_0x50b957[_0xf643('0x19')]?_0x50b957[_0xf643('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x50b957['options']?_0x50b957[_0xf643('0x19')][_0xf643('0x1d')]||null:null,'attributes':[[_0xf643('0x2b'),_0xf643('0x2c')],[db[_0xf643('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xf643('0x1e')]['literal'](_0xf643('0x2d')))),'outboundNoSuchCallsDay'],[db[_0xf643('0x1e')]['fn'](_0xf643('0x1f'),db[_0xf643('0x1e')]['fn']('IF',db['sequelize']['literal'](_0xf643('0x2e')))),_0xf643('0x2f')],[db['sequelize']['fn']('COUNT',db[_0xf643('0x1e')]['fn']('IF',db[_0xf643('0x1e')][_0xf643('0x22')](_0xf643('0x23')))),_0xf643('0x30')],[db[_0xf643('0x1e')]['fn'](_0xf643('0x1f'),db['sequelize']['fn']('IF',db[_0xf643('0x1e')][_0xf643('0x22')]('`state`\x20=\x205,\x201,\x20null'))),_0xf643('0x31')],[db[_0xf643('0x1e')]['fn'](_0xf643('0x1f'),db[_0xf643('0x1e')]['fn']('IF',db['sequelize'][_0xf643('0x22')]('`state`\x20=\x208,\x201,\x20null'))),_0xf643('0x32')],[db[_0xf643('0x1e')]['fn'](_0xf643('0x1f'),db[_0xf643('0x1e')]['fn']('IF',db[_0xf643('0x1e')][_0xf643('0x22')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xf643('0x33')],[db[_0xf643('0x1e')]['fn']('COUNT',db[_0xf643('0x1e')]['fn']('IF',db['sequelize'][_0xf643('0x22')](_0xf643('0x34')))),_0xf643('0x35')],[db[_0xf643('0x1e')]['fn'](_0xf643('0x1f'),db[_0xf643('0x1e')]['fn']('IF',db[_0xf643('0x1e')][_0xf643('0x22')](_0xf643('0x36')))),_0xf643('0x37')],[db['sequelize']['fn']('COUNT',db[_0xf643('0x1e')]['fn']('IF',db[_0xf643('0x1e')][_0xf643('0x22')](_0xf643('0x38')))),'outboundBlacklistCallsDay'],[db[_0xf643('0x1e')]['fn'](_0xf643('0x1f'),db['sequelize']['fn']('IF',db[_0xf643('0x1e')]['literal'](_0xf643('0x39')))),_0xf643('0x3a')],[db[_0xf643('0x1e')]['fn'](_0xf643('0x1f'),db[_0xf643('0x1e')]['fn']('IF',db[_0xf643('0x1e')]['literal'](_0xf643('0x3b')))),_0xf643('0x3c')],[db[_0xf643('0x1e')]['fn'](_0xf643('0x1f'),db[_0xf643('0x1e')]['fn']('IF',db[_0xf643('0x1e')][_0xf643('0x22')]('`state`\x20=\x2016,\x201,\x20null'))),'outboundAnswerAgiCallsDay'],[db[_0xf643('0x1e')]['fn'](_0xf643('0x1f'),db[_0xf643('0x1e')]['fn']('IF',db[_0xf643('0x1e')]['literal'](_0xf643('0x3d')))),_0xf643('0x3c')],[db[_0xf643('0x1e')]['fn'](_0xf643('0x1f'),db[_0xf643('0x1e')]['fn']('IF',db[_0xf643('0x1e')][_0xf643('0x22')](_0xf643('0x3e')))),_0xf643('0x3f')]],'group':[_0xf643('0x2b')]})[_0xf643('0xa')](function(_0x21340d){logger['info'](_0xf643('0x2a'),_0x50b957);logger['debug'](_0xf643('0x2a'),_0x50b957,JSON[_0xf643('0x10')](_0x21340d));_0x52fe67(_0x21340d);})[_0xf643('0x14')](function(_0x3204f3){logger[_0xf643('0x11')]('GetVoiceQueueHopperHistory',_0x3204f3[_0xf643('0x12')],_0x50b957);_0x4a1717(_0x1204f3['error'](0x1f4,_0x3204f3['message']));});});};exports[_0xf643('0x40')]=function(_0x5506c5){var _0x40f5d4=this;return new Promise(function(_0x1a7efe,_0x2d2882){return db['CmHopperHistory'][_0xf643('0x1b')]({'raw':_0x5506c5[_0xf643('0x19')]?_0x5506c5[_0xf643('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x5506c5[_0xf643('0x19')]?_0x5506c5[_0xf643('0x19')][_0xf643('0x1d')]||null:null,'attributes':[[_0xf643('0x2b'),_0xf643('0x2c')],[db[_0xf643('0x1e')]['fn'](_0xf643('0x1f'),db['sequelize'][_0xf643('0x20')]('id')),_0xf643('0x41')],[db[_0xf643('0x1e')]['fn'](_0xf643('0x1f'),db['sequelize']['fn']('IF',db['sequelize'][_0xf643('0x22')](_0xf643('0x23')))),_0xf643('0x42')]],'group':[_0xf643('0x2b')]})[_0xf643('0xa')](function(_0x33299c){logger[_0xf643('0xb')](_0xf643('0x40'),_0x5506c5);logger[_0xf643('0xe')](_0xf643('0x40'),_0x5506c5,JSON[_0xf643('0x10')](_0x33299c));_0x1a7efe(_0x33299c);})['catch'](function(_0x5be712){logger[_0xf643('0x11')](_0xf643('0x40'),_0x5be712[_0xf643('0x12')],_0x5506c5);_0x2d2882(_0x40f5d4[_0xf643('0x11')](0x1f4,_0x5be712['message']));});});}; \ No newline at end of file +var _0x33e5=['predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','AvgHandleTime','GetVoiceQueueHopperHistory','findAll','campaign','name','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','`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','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','col','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','code','message','CmHopperHistory,\x20%s,\x20%s','catch','CreateCmHopperHistory','CmHopperHistory','create','options','raw','where','sequelize','predictiveIntervalTotalCalls','literal','COUNT','`state`\x20=\x2010,\x201,\x20null'];(function(_0x404419,_0x45f6f5){var _0x52f306=function(_0x1333c3){while(--_0x1333c3){_0x404419['push'](_0x404419['shift']());}};_0x52f306(++_0x45f6f5);}(_0x33e5,0x13a));var _0x533e=function(_0x129341,_0x13e52e){_0x129341=_0x129341-0x0;var _0x43ba1f=_0x33e5[_0x129341];return _0x43ba1f;};'use strict';var _=require(_0x533e('0x0'));var util=require(_0x533e('0x1'));var moment=require(_0x533e('0x2'));var BPromise=require('bluebird');var rs=require(_0x533e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x533e('0x4'))['db'];var utils=require(_0x533e('0x5'));var logger=require(_0x533e('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x533e('0x7'));var client=jayson[_0x533e('0x8')][_0x533e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2e951a,_0x42189d,_0x197328){return new BPromise(function(_0x47c726,_0x298a51){return client['request'](_0x2e951a,_0x197328)[_0x533e('0xa')](function(_0x366e66){logger[_0x533e('0xb')]('CmHopperHistory,\x20%s,\x20%s',_0x42189d,_0x533e('0xc'));logger[_0x533e('0xd')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x42189d,_0x533e('0xc'),JSON[_0x533e('0xe')](_0x366e66));if(_0x366e66[_0x533e('0xf')]){if(_0x366e66[_0x533e('0xf')][_0x533e('0x10')]===0x1f4){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x42189d,_0x366e66[_0x533e('0xf')]['message']);return _0x298a51(_0x366e66['error'][_0x533e('0x11')]);}logger[_0x533e('0xf')](_0x533e('0x12'),_0x42189d,_0x366e66[_0x533e('0xf')][_0x533e('0x11')]);return _0x47c726(_0x366e66[_0x533e('0xf')][_0x533e('0x11')]);}else{logger['info']('CmHopperHistory,\x20%s,\x20%s',_0x42189d,_0x533e('0xc'));_0x47c726(_0x366e66['result'][_0x533e('0x11')]);}})[_0x533e('0x13')](function(_0x1fb599){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x42189d,_0x1fb599);_0x298a51(_0x1fb599);});});}exports[_0x533e('0x14')]=function(_0x1b4379){var _0x59c0de=this;return new Promise(function(_0x3ffc11,_0x5cbf19){return db[_0x533e('0x15')][_0x533e('0x16')](_0x1b4379['body'],{'raw':_0x1b4379[_0x533e('0x17')]?_0x1b4379['options'][_0x533e('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x630fa6){logger[_0x533e('0xb')]('CreateCmHopperHistory',_0x1b4379);logger[_0x533e('0xd')](_0x533e('0x14'),_0x1b4379,JSON[_0x533e('0xe')](_0x630fa6));_0x3ffc11(_0x630fa6);})[_0x533e('0x13')](function(_0x210797){logger[_0x533e('0xf')](_0x533e('0x14'),_0x210797['message'],_0x1b4379);_0x5cbf19(_0x59c0de[_0x533e('0xf')](0x1f4,_0x210797[_0x533e('0x11')]));});});};exports['AvgHandleTime']=function(_0x19390){var _0x410d3e=this;return new Promise(function(_0x191f21,_0x265c78){return db[_0x533e('0x15')]['findAll']({'raw':_0x19390['options']?_0x19390[_0x533e('0x17')][_0x533e('0x18')]===undefined?!![]:![]:!![],'where':_0x19390[_0x533e('0x17')]?_0x19390['options'][_0x533e('0x19')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0x533e('0x1a')]['col']('id')),_0x533e('0x1b')],[db[_0x533e('0x1a')]['fn']('COUNT',db[_0x533e('0x1a')]['fn']('IF',db[_0x533e('0x1a')][_0x533e('0x1c')]('`state`\x20=\x204,\x201,\x20null'))),'predictiveIntervalAnsweredCalls'],[db[_0x533e('0x1a')]['fn'](_0x533e('0x1d'),db['sequelize']['fn']('IF',db[_0x533e('0x1a')][_0x533e('0x1c')](_0x533e('0x1e')))),_0x533e('0x1f')],[db[_0x533e('0x1a')]['fn'](_0x533e('0x1d'),db['sequelize']['fn']('IF',db[_0x533e('0x1a')]['literal'](_0x533e('0x20')))),_0x533e('0x21')],[db['sequelize']['fn']('AVG',db[_0x533e('0x1a')]['fn']('IF',db[_0x533e('0x1a')]['literal'](_0x533e('0x22')))),_0x533e('0x23')],[db[_0x533e('0x1a')]['fn']('AVG',db[_0x533e('0x1a')]['fn']('IF',db[_0x533e('0x1a')][_0x533e('0x1c')](_0x533e('0x24')))),_0x533e('0x25')]]})['then'](function(_0x12e4d6){logger['info']('AvgHandleTime',_0x19390);logger[_0x533e('0xd')](_0x533e('0x26'),_0x19390,JSON[_0x533e('0xe')](_0x12e4d6));_0x191f21(_0x12e4d6);})[_0x533e('0x13')](function(_0x3a205d){logger['error'](_0x533e('0x26'),_0x3a205d[_0x533e('0x11')],_0x19390);_0x265c78(_0x410d3e[_0x533e('0xf')](0x1f4,_0x3a205d[_0x533e('0x11')]));});});};exports[_0x533e('0x27')]=function(_0x291c39){var _0x3d87a6=this;return new Promise(function(_0x506aad,_0x2d817b){return db[_0x533e('0x15')][_0x533e('0x28')]({'raw':_0x291c39['options']?_0x291c39['options'][_0x533e('0x18')]===undefined?!![]:![]:!![],'where':_0x291c39['options']?_0x291c39['options'][_0x533e('0x19')]||null:null,'attributes':[[_0x533e('0x29'),_0x533e('0x2a')],[db['sequelize']['fn'](_0x533e('0x1d'),db[_0x533e('0x1a')]['fn']('IF',db[_0x533e('0x1a')][_0x533e('0x1c')](_0x533e('0x2b')))),'outboundNoSuchCallsDay'],[db[_0x533e('0x1a')]['fn'](_0x533e('0x1d'),db['sequelize']['fn']('IF',db[_0x533e('0x1a')][_0x533e('0x1c')](_0x533e('0x2c')))),_0x533e('0x2d')],[db[_0x533e('0x1a')]['fn'](_0x533e('0x1d'),db['sequelize']['fn']('IF',db[_0x533e('0x1a')][_0x533e('0x1c')](_0x533e('0x2e')))),_0x533e('0x2f')],[db[_0x533e('0x1a')]['fn'](_0x533e('0x1d'),db[_0x533e('0x1a')]['fn']('IF',db[_0x533e('0x1a')][_0x533e('0x1c')](_0x533e('0x30')))),_0x533e('0x31')],[db[_0x533e('0x1a')]['fn'](_0x533e('0x1d'),db['sequelize']['fn']('IF',db[_0x533e('0x1a')][_0x533e('0x1c')](_0x533e('0x32')))),'outboundCongestionCallsDay'],[db[_0x533e('0x1a')]['fn'](_0x533e('0x1d'),db[_0x533e('0x1a')]['fn']('IF',db[_0x533e('0x1a')][_0x533e('0x1c')](_0x533e('0x33')))),_0x533e('0x34')],[db[_0x533e('0x1a')]['fn'](_0x533e('0x1d'),db[_0x533e('0x1a')]['fn']('IF',db[_0x533e('0x1a')][_0x533e('0x1c')](_0x533e('0x35')))),_0x533e('0x36')],[db[_0x533e('0x1a')]['fn']('COUNT',db[_0x533e('0x1a')]['fn']('IF',db['sequelize'][_0x533e('0x1c')](_0x533e('0x37')))),_0x533e('0x38')],[db[_0x533e('0x1a')]['fn'](_0x533e('0x1d'),db[_0x533e('0x1a')]['fn']('IF',db['sequelize'][_0x533e('0x1c')](_0x533e('0x39')))),_0x533e('0x3a')],[db[_0x533e('0x1a')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x533e('0x1a')]['literal'](_0x533e('0x3b')))),_0x533e('0x3c')],[db['sequelize']['fn'](_0x533e('0x1d'),db['sequelize']['fn']('IF',db['sequelize'][_0x533e('0x1c')]('`state`\x20=\x2018,\x201,\x20null'))),_0x533e('0x3d')],[db[_0x533e('0x1a')]['fn'](_0x533e('0x1d'),db['sequelize']['fn']('IF',db[_0x533e('0x1a')][_0x533e('0x1c')]('`state`\x20=\x2016,\x201,\x20null'))),_0x533e('0x3e')],[db[_0x533e('0x1a')]['fn'](_0x533e('0x1d'),db[_0x533e('0x1a')]['fn']('IF',db[_0x533e('0x1a')][_0x533e('0x1c')](_0x533e('0x3f')))),_0x533e('0x3d')],[db[_0x533e('0x1a')]['fn'](_0x533e('0x1d'),db[_0x533e('0x1a')]['fn']('IF',db[_0x533e('0x1a')][_0x533e('0x1c')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0x533e('0x40')]],'group':['campaign']})['then'](function(_0x4bb086){logger['info'](_0x533e('0x27'),_0x291c39);logger[_0x533e('0xd')]('GetVoiceQueueHopperHistory',_0x291c39,JSON[_0x533e('0xe')](_0x4bb086));_0x506aad(_0x4bb086);})['catch'](function(_0x2189e2){logger[_0x533e('0xf')](_0x533e('0x27'),_0x2189e2[_0x533e('0x11')],_0x291c39);_0x2d817b(_0x3d87a6[_0x533e('0xf')](0x1f4,_0x2189e2['message']));});});};exports[_0x533e('0x41')]=function(_0x1ebf47){var _0x1b1a8c=this;return new Promise(function(_0x29da83,_0x21cec8){return db[_0x533e('0x15')][_0x533e('0x28')]({'raw':_0x1ebf47[_0x533e('0x17')]?_0x1ebf47[_0x533e('0x17')][_0x533e('0x18')]===undefined?!![]:![]:!![],'where':_0x1ebf47[_0x533e('0x17')]?_0x1ebf47[_0x533e('0x17')][_0x533e('0x19')]||null:null,'attributes':[[_0x533e('0x29'),_0x533e('0x2a')],[db['sequelize']['fn'](_0x533e('0x1d'),db[_0x533e('0x1a')][_0x533e('0x42')]('id')),_0x533e('0x43')],[db[_0x533e('0x1a')]['fn'](_0x533e('0x1d'),db[_0x533e('0x1a')]['fn']('IF',db['sequelize'][_0x533e('0x1c')](_0x533e('0x2e')))),_0x533e('0x44')]],'group':['campaign']})[_0x533e('0xa')](function(_0x2dee6c){logger['info']('GetCampaignHopperHistory',_0x1ebf47);logger[_0x533e('0xd')](_0x533e('0x41'),_0x1ebf47,JSON[_0x533e('0xe')](_0x2dee6c));_0x29da83(_0x2dee6c);})['catch'](function(_0x6d6424){logger['error'](_0x533e('0x41'),_0x6d6424[_0x533e('0x11')],_0x1ebf47);_0x21cec8(_0x1b1a8c[_0x533e('0xf')](0x1f4,_0x6d6424[_0x533e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 46faa6a..495ff10 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 _0xede7=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','isAuthenticated','index','/describe','describe','get','/:id','show','post','create','put','update','exports','multer','util','path'];(function(_0x22f867,_0x5ce85a){var _0x10636c=function(_0x4c2f3f){while(--_0x4c2f3f){_0x22f867['push'](_0x22f867['shift']());}};_0x10636c(++_0x5ce85a);}(_0xede7,0x14d));var _0x7ede=function(_0x3e806a,_0xa4b9fa){_0x3e806a=_0x3e806a-0x0;var _0x477105=_0xede7[_0x3e806a];return _0x477105;};'use strict';var multer=require(_0x7ede('0x0'));var util=require(_0x7ede('0x1'));var path=require(_0x7ede('0x2'));var timeout=require('connect-timeout');var express=require(_0x7ede('0x3'));var router=express[_0x7ede('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7ede('0x5'));var interaction=require(_0x7ede('0x6'));var config=require(_0x7ede('0x7'));var controller=require(_0x7ede('0x8'));router['get']('/',auth[_0x7ede('0x9')](),controller[_0x7ede('0xa')]);router['get'](_0x7ede('0xb'),auth['isAuthenticated'](),controller[_0x7ede('0xc')]);router[_0x7ede('0xd')](_0x7ede('0xe'),auth[_0x7ede('0x9')](),controller[_0x7ede('0xf')]);router[_0x7ede('0x10')]('/',auth['isAuthenticated'](),controller[_0x7ede('0x11')]);router[_0x7ede('0x12')](_0x7ede('0xe'),auth[_0x7ede('0x9')](),controller[_0x7ede('0x13')]);module[_0x7ede('0x14')]=router; \ No newline at end of file +var _0xc798=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperHistory.controller','get','index','/describe','isAuthenticated','describe','/:id','post','put','exports','multer','util','path','connect-timeout'];(function(_0x1069f5,_0x51cc78){var _0x5c211d=function(_0x1d527f){while(--_0x1d527f){_0x1069f5['push'](_0x1069f5['shift']());}};_0x5c211d(++_0x51cc78);}(_0xc798,0x1e2));var _0x8c79=function(_0x2eba25,_0x31ca7a){_0x2eba25=_0x2eba25-0x0;var _0x588fd0=_0xc798[_0x2eba25];return _0x588fd0;};'use strict';var multer=require(_0x8c79('0x0'));var util=require(_0x8c79('0x1'));var path=require(_0x8c79('0x2'));var timeout=require(_0x8c79('0x3'));var express=require('express');var router=express[_0x8c79('0x4')]();var fs_extra=require(_0x8c79('0x5'));var auth=require(_0x8c79('0x6'));var interaction=require(_0x8c79('0x7'));var config=require('../../config/environment');var controller=require(_0x8c79('0x8'));router[_0x8c79('0x9')]('/',auth['isAuthenticated'](),controller[_0x8c79('0xa')]);router['get'](_0x8c79('0xb'),auth[_0x8c79('0xc')](),controller[_0x8c79('0xd')]);router[_0x8c79('0x9')](_0x8c79('0xe'),auth[_0x8c79('0xc')](),controller['show']);router[_0x8c79('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8c79('0x10')](_0x8c79('0xe'),auth[_0x8c79('0xc')](),controller['update']);module[_0x8c79('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 e7e06c9..23ae1dd 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 _0x6658=['sequelize','exports','STRING','name'];(function(_0x256b72,_0x340985){var _0x2183e3=function(_0xf7fd37){while(--_0xf7fd37){_0x256b72['push'](_0x256b72['shift']());}};_0x2183e3(++_0x340985);}(_0x6658,0x198));var _0x8665=function(_0x346310,_0x49c586){_0x346310=_0x346310-0x0;var _0x30a6d5=_0x6658[_0x346310];return _0x30a6d5;};'use strict';var Sequelize=require(_0x8665('0x0'));module[_0x8665('0x1')]={'name':{'type':Sequelize[_0x8665('0x2')],'unique':_0x8665('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8665('0x2')]},'dialPrefix':{'type':Sequelize[_0x8665('0x2')]}}; \ No newline at end of file +var _0x0d4d=['STRING','name','sequelize','exports'];(function(_0x5ed11f,_0x5effb3){var _0x25cd41=function(_0x1ff0f9){while(--_0x1ff0f9){_0x5ed11f['push'](_0x5ed11f['shift']());}};_0x25cd41(++_0x5effb3);}(_0x0d4d,0x132));var _0xd0d4=function(_0x26c97a,_0x324229){_0x26c97a=_0x26c97a-0x0;var _0x56e2d2=_0x0d4d[_0x26c97a];return _0x56e2d2;};'use strict';var Sequelize=require(_0xd0d4('0x0'));module[_0xd0d4('0x1')]={'name':{'type':Sequelize[_0xd0d4('0x2')],'unique':_0xd0d4('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd0d4('0x2')]},'dialPrefix':{'type':Sequelize[_0xd0d4('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 7d64ebc..77396f2 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 _0x8902=['User','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','Lists','UserProfileResource','destroy','stack','name','send','index','map','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','CmList','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','ListId','findOne','Disposition','removeDispositions','ids','describe','tags','isArray','join','each','omit','success','push','dataValues','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','raw','getContactsCsv','CmContact','isEmpty','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','sequelize','transaction','addCustomFields','Sequelize','text','TEXT','number','INTEGER','switch','BOOLEAN','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','getAgents'];(function(_0x53e64f,_0x49577c){var _0x45c417=function(_0x30e520){while(--_0x30e520){_0x53e64f['push'](_0x53e64f['shift']());}};_0x45c417(++_0x49577c);}(_0x8902,0x1b4));var _0x2890=function(_0x2c4dae,_0x2bf6d7){_0x2c4dae=_0x2c4dae-0x0;var _0xe0d2a4=_0x8902[_0x2c4dae];return _0xe0d2a4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2890('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2890('0x1'));var rp=require('request-promise');var moment=require(_0x2890('0x2'));var BPromise=require(_0x2890('0x3'));var Mustache=require('mustache');var util=require(_0x2890('0x4'));var path=require(_0x2890('0x5'));var sox=require(_0x2890('0x6'));var csv=require(_0x2890('0x7'));var ejs=require(_0x2890('0x8'));var fs=require('fs');var fs_extra=require(_0x2890('0x9'));var _=require('lodash');var squel=require(_0x2890('0xa'));var crypto=require(_0x2890('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2890('0x7'));var querystring=require(_0x2890('0xc'));var Papa=require(_0x2890('0xd'));var Redis=require(_0x2890('0xe'));var authService=require(_0x2890('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2890('0x10'));var logger=require(_0x2890('0x11'))(_0x2890('0x12'));var utils=require(_0x2890('0x13'));var config=require(_0x2890('0x14'));var licenseUtil=require(_0x2890('0x15'));var db=require(_0x2890('0x16'))['db'];config[_0x2890('0x17')]=_[_0x2890('0x18')](config[_0x2890('0x17')],{'host':_0x2890('0x19'),'port':0x18eb});var socket=require(_0x2890('0x1a'))(new Redis(config['redis']));require(_0x2890('0x1b'))['register'](socket);function respondWithStatusCode(_0x2763a6,_0x3311d4){_0x3311d4=_0x3311d4||0xcc;return function(_0xdc628c){if(_0xdc628c){return _0x2763a6[_0x2890('0x1c')](_0x3311d4);}return _0x2763a6[_0x2890('0x1d')](_0x3311d4)[_0x2890('0x1e')]();};}function respondWithResult(_0x1ba0e1,_0x1f63d6){_0x1f63d6=_0x1f63d6||0xc8;return function(_0x50ef76){if(_0x50ef76){return _0x1ba0e1[_0x2890('0x1d')](_0x1f63d6)[_0x2890('0x1f')](_0x50ef76);}};}function respondWithFilteredResult(_0x1041ba,_0x4a8dcb){return function(_0x261344){if(_0x261344){var _0x5975a8=typeof _0x4a8dcb[_0x2890('0x20')]===_0x2890('0x21')&&typeof _0x4a8dcb[_0x2890('0x22')]===_0x2890('0x21');var _0x57c3a4=_0x261344[_0x2890('0x23')];var _0x1e548a=_0x5975a8?0x0:_0x4a8dcb['offset'];var _0x392469=_0x5975a8?_0x261344['count']:_0x4a8dcb['offset']+_0x4a8dcb[_0x2890('0x22')];var _0x518671;if(_0x392469>=_0x57c3a4){_0x392469=_0x57c3a4;_0x518671=0xc8;}else{_0x518671=0xce;}_0x1041ba[_0x2890('0x1d')](_0x518671);return _0x1041ba['set'](_0x2890('0x24'),_0x1e548a+'-'+_0x392469+'/'+_0x57c3a4)[_0x2890('0x1f')](_0x261344);}return null;};}function patchUpdates(_0x1841fe){return function(_0x4bdae6){try{jsonpatch[_0x2890('0x25')](_0x4bdae6,_0x1841fe,!![]);}catch(_0x5c5e01){return BPromise[_0x2890('0x26')](_0x5c5e01);}return _0x4bdae6[_0x2890('0x27')]();};}function saveUpdates(_0x2f1afa,_0x16c396){return function(_0x124caf){if(_0x124caf){return _0x124caf[_0x2890('0x28')](_0x2f1afa)['then'](function(_0x28bf39){return _0x28bf39;});}return null;};}function removeEntity(_0xe8fc76,_0x1517ce){return function(_0x2053a6){if(_0x2053a6){return _0x2053a6['destroy']()[_0x2890('0x29')](function(){var _0x4a355e=_0x2053a6['get']({'plain':!![]});var _0x392dd8=_0x2890('0x2a');return db[_0x2890('0x2b')][_0x2890('0x2c')]({'where':{'type':_0x392dd8,'resourceId':_0x4a355e['id']}})[_0x2890('0x29')](function(){return _0x2053a6;});})[_0x2890('0x29')](function(){_0xe8fc76[_0x2890('0x1d')](0xcc)[_0x2890('0x1e')]();});}};}function handleEntityNotFound(_0x432d0b,_0xf789da){return function(_0x97c46a){if(!_0x97c46a){_0x432d0b['sendStatus'](0x194);}return _0x97c46a;};}function handleError(_0x5d26a1,_0x4985dd){_0x4985dd=_0x4985dd||0x1f4;return function(_0x8f0b5e){logger['error'](_0x8f0b5e[_0x2890('0x2d')]);if(_0x8f0b5e[_0x2890('0x2e')]){delete _0x8f0b5e[_0x2890('0x2e')];}_0x5d26a1[_0x2890('0x1d')](_0x4985dd)[_0x2890('0x2f')](_0x8f0b5e);};}exports[_0x2890('0x30')]=function(_0x5bd495,_0x26b7c4){var _0x4f9a05={},_0x43b6bb={},_0x57cc5c={'count':0x0,'rows':[]};var _0x4c9e7d=_[_0x2890('0x31')](db['CmList']['rawAttributes'],function(_0xfa63e9){return{'name':_0xfa63e9['fieldName'],'type':_0xfa63e9[_0x2890('0x32')]['key']};});_0x43b6bb[_0x2890('0x33')]=_[_0x2890('0x31')](_0x4c9e7d,_0x2890('0x2e'));_0x43b6bb[_0x2890('0x34')]=_[_0x2890('0x35')](_0x5bd495['query']);_0x43b6bb[_0x2890('0x36')]=_[_0x2890('0x37')](_0x43b6bb[_0x2890('0x33')],_0x43b6bb[_0x2890('0x34')]);_0x4f9a05['attributes']=_[_0x2890('0x37')](_0x43b6bb[_0x2890('0x33')],qs[_0x2890('0x38')](_0x5bd495[_0x2890('0x34')]['fields']));_0x4f9a05[_0x2890('0x39')]=_0x4f9a05['attributes'][_0x2890('0x3a')]?_0x4f9a05[_0x2890('0x39')]:_0x43b6bb['model'];if(!_0x5bd495[_0x2890('0x34')][_0x2890('0x3b')](_0x2890('0x3c'))){_0x4f9a05[_0x2890('0x22')]=qs[_0x2890('0x22')](_0x5bd495['query']['limit']);_0x4f9a05[_0x2890('0x20')]=qs[_0x2890('0x20')](_0x5bd495[_0x2890('0x34')]['offset']);}_0x4f9a05[_0x2890('0x3d')]=qs['sort'](_0x5bd495[_0x2890('0x34')][_0x2890('0x3e')]);_0x4f9a05[_0x2890('0x3f')]=qs[_0x2890('0x36')](_[_0x2890('0x40')](_0x5bd495[_0x2890('0x34')],_0x43b6bb[_0x2890('0x36')]),_0x4c9e7d);if(_0x5bd495['query'][_0x2890('0x41')]){_0x4f9a05['where']=_['merge'](_0x4f9a05[_0x2890('0x3f')],{'$or':_[_0x2890('0x31')](_0x4c9e7d,function(_0x316c7a){if(_0x316c7a[_0x2890('0x32')]!==_0x2890('0x42')){var _0x184aec={};_0x184aec[_0x316c7a[_0x2890('0x2e')]]={'$like':'%'+_0x5bd495[_0x2890('0x34')]['filter']+'%'};return _0x184aec;}})});}_0x4f9a05=_[_0x2890('0x43')]({},_0x4f9a05,_0x5bd495[_0x2890('0x44')]);var _0xe5bd42={'where':_0x4f9a05[_0x2890('0x3f')]};return db[_0x2890('0x45')]['count'](_0xe5bd42)['then'](function(_0x1b662e){_0x57cc5c[_0x2890('0x23')]=_0x1b662e;if(_0x5bd495[_0x2890('0x34')][_0x2890('0x46')]){_0x4f9a05['include']=[{'all':!![]}];}return db[_0x2890('0x45')][_0x2890('0x47')](_0x4f9a05);})[_0x2890('0x29')](function(_0x828416){_0x57cc5c[_0x2890('0x48')]=_0x828416;return _0x57cc5c;})[_0x2890('0x29')](respondWithFilteredResult(_0x26b7c4,_0x4f9a05))[_0x2890('0x49')](handleError(_0x26b7c4,null));};exports[_0x2890('0x4a')]=function(_0x3bf1ca,_0x5f2d3f){var _0x1309ce={'raw':![],'where':{'id':_0x3bf1ca[_0x2890('0x4b')]['id']}},_0x3e00fe={};_0x3e00fe[_0x2890('0x33')]=_['keys'](db['CmList'][_0x2890('0x4c')]);_0x3e00fe['query']=_[_0x2890('0x35')](_0x3bf1ca[_0x2890('0x34')]);_0x3e00fe[_0x2890('0x36')]=_['intersection'](_0x3e00fe['model'],_0x3e00fe['query']);_0x1309ce[_0x2890('0x39')]=_['intersection'](_0x3e00fe['model'],qs[_0x2890('0x38')](_0x3bf1ca['query'][_0x2890('0x38')]));_0x1309ce[_0x2890('0x39')]=_0x1309ce[_0x2890('0x39')][_0x2890('0x3a')]?_0x1309ce[_0x2890('0x39')]:_0x3e00fe['model'];if(_0x3bf1ca[_0x2890('0x34')][_0x2890('0x46')]){_0x1309ce[_0x2890('0x4d')]=[{'all':!![]}];}_0x1309ce=_[_0x2890('0x43')]({},_0x1309ce,_0x3bf1ca[_0x2890('0x44')]);return db['CmList'][_0x2890('0x4e')](_0x1309ce)[_0x2890('0x29')](handleEntityNotFound(_0x5f2d3f,null))[_0x2890('0x29')](respondWithResult(_0x5f2d3f,null))[_0x2890('0x49')](handleError(_0x5f2d3f,null));};exports['create']=function(_0xee161c,_0xc89bcc){return db[_0x2890('0x45')][_0x2890('0x4f')](_0xee161c[_0x2890('0x50')],{})[_0x2890('0x29')](function(_0x40575d){var _0x163683=_0xee161c[_0x2890('0x51')]['get']({'plain':!![]});if(!_0x163683)throw new Error(_0x2890('0x52'));if(_0x163683[_0x2890('0x53')]===_0x2890('0x51')){var _0x56f459=_0x40575d[_0x2890('0x54')]({'plain':!![]});var _0x152ab6='Lists';return db[_0x2890('0x55')][_0x2890('0x4e')]({'where':{'name':_0x152ab6,'userProfileId':_0x163683[_0x2890('0x56')]},'raw':!![]})[_0x2890('0x29')](function(_0xe11563){if(_0xe11563&&_0xe11563[_0x2890('0x57')]===0x0){return db['UserProfileResource'][_0x2890('0x4f')]({'name':_0x56f459[_0x2890('0x2e')],'resourceId':_0x56f459['id'],'type':_0xe11563['name'],'sectionId':_0xe11563['id']},{})[_0x2890('0x29')](function(){return _0x40575d;});}else{return _0x40575d;}})[_0x2890('0x49')](function(_0x19aaff){logger['error'](_0x2890('0x58'),_0x19aaff);throw _0x19aaff;});}return _0x40575d;})[_0x2890('0x29')](respondWithResult(_0xc89bcc,0xc9))[_0x2890('0x49')](handleError(_0xc89bcc,null));};exports[_0x2890('0x28')]=function(_0x534887,_0x1dbe37){if(_0x534887[_0x2890('0x50')]['id']){delete _0x534887[_0x2890('0x50')]['id'];}return db[_0x2890('0x45')][_0x2890('0x4e')]({'where':{'id':_0x534887[_0x2890('0x4b')]['id']}})[_0x2890('0x29')](handleEntityNotFound(_0x1dbe37,null))[_0x2890('0x29')](saveUpdates(_0x534887[_0x2890('0x50')],null))[_0x2890('0x29')](respondWithResult(_0x1dbe37,null))[_0x2890('0x49')](handleError(_0x1dbe37,null));};exports[_0x2890('0x2c')]=function(_0x57c964,_0x50092a){return db['CmList'][_0x2890('0x4e')]({'where':{'id':_0x57c964['params']['id']}})['then'](handleEntityNotFound(_0x50092a,null))[_0x2890('0x29')](removeEntity(_0x50092a,null))[_0x2890('0x49')](handleError(_0x50092a,null));};exports['describe']=function(_0x53f2ab,_0x38a0c6){return db[_0x2890('0x45')]['describe']()[_0x2890('0x29')](respondWithResult(_0x38a0c6,null))[_0x2890('0x49')](handleError(_0x38a0c6,null));};exports['addDisposition']=function(_0x142be2,_0x34457d,_0x5a6e2c){if(_0x142be2['body']['id']){delete _0x142be2[_0x2890('0x50')]['id'];}return db['CmList']['find']({'where':{'id':_0x142be2[_0x2890('0x4b')]['id']}})[_0x2890('0x29')](handleEntityNotFound(_0x34457d,null))[_0x2890('0x29')](function(_0x504e09){if(_0x504e09){_0x142be2[_0x2890('0x50')][_0x2890('0x59')]=_0x504e09['id'];return db['Disposition']['create'](_0x142be2[_0x2890('0x50')]);}})[_0x2890('0x29')](respondWithResult(_0x34457d,null))[_0x2890('0x49')](handleError(_0x34457d,null));};exports['getDispositions']=function(_0x3c0e80,_0x2277c9,_0x385a29){var _0x5b15a9={'raw':![],'where':{}};var _0x305291={};var _0x28667c={'count':0x0,'rows':[]};return db[_0x2890('0x45')][_0x2890('0x5a')]({'where':{'id':_0x3c0e80['params']['id']}})['then'](handleEntityNotFound(_0x2277c9,null))[_0x2890('0x29')](function(_0x22ff74){if(_0x22ff74){_0x305291[_0x2890('0x33')]=_['keys'](db['Disposition']['rawAttributes']);_0x305291['query']=_[_0x2890('0x35')](_0x3c0e80[_0x2890('0x34')]);_0x305291[_0x2890('0x36')]=_['intersection'](_0x305291[_0x2890('0x33')],_0x305291[_0x2890('0x34')]);_0x5b15a9[_0x2890('0x39')]=_[_0x2890('0x37')](_0x305291['model'],qs['fields'](_0x3c0e80[_0x2890('0x34')]['fields']));_0x5b15a9['attributes']=_0x5b15a9[_0x2890('0x39')][_0x2890('0x3a')]?_0x5b15a9[_0x2890('0x39')]:_0x305291[_0x2890('0x33')];if(!_0x3c0e80[_0x2890('0x34')][_0x2890('0x3b')](_0x2890('0x3c'))){_0x5b15a9[_0x2890('0x22')]=qs[_0x2890('0x22')](_0x3c0e80['query'][_0x2890('0x22')]);_0x5b15a9[_0x2890('0x20')]=qs[_0x2890('0x20')](_0x3c0e80[_0x2890('0x34')]['offset']);}_0x5b15a9[_0x2890('0x3d')]=qs['sort'](_0x3c0e80['query'][_0x2890('0x3e')]);_0x5b15a9[_0x2890('0x3f')]=qs[_0x2890('0x36')](_[_0x2890('0x40')](_0x3c0e80['query'],_0x305291[_0x2890('0x36')]));_0x5b15a9[_0x2890('0x3f')][_0x2890('0x59')]=_0x22ff74['id'];if(_0x3c0e80[_0x2890('0x34')][_0x2890('0x41')]){_0x5b15a9['where']=_[_0x2890('0x43')](_0x5b15a9[_0x2890('0x3f')],{'$or':_['map'](_0x5b15a9[_0x2890('0x39')],function(_0x3fd140){var _0x5d0ddc={};_0x5d0ddc[_0x3fd140]={'$like':'%'+_0x3c0e80[_0x2890('0x34')][_0x2890('0x41')]+'%'};return _0x5d0ddc;})});}_0x5b15a9=_[_0x2890('0x43')]({},_0x5b15a9,_0x3c0e80[_0x2890('0x44')]);return db[_0x2890('0x5b')][_0x2890('0x23')]({'where':_0x5b15a9[_0x2890('0x3f')]})['then'](function(_0x1c0c01){_0x28667c[_0x2890('0x23')]=_0x1c0c01;if(_0x3c0e80[_0x2890('0x34')]['includeAll']){_0x5b15a9[_0x2890('0x4d')]=[{'all':!![]}];}return db['Disposition'][_0x2890('0x47')](_0x5b15a9);})['then'](function(_0x80d210){_0x28667c[_0x2890('0x48')]=_0x80d210;return _0x28667c;});}})[_0x2890('0x29')](respondWithFilteredResult(_0x2277c9,_0x5b15a9))[_0x2890('0x49')](handleError(_0x2277c9,null));};exports[_0x2890('0x5c')]=function(_0x326cc4,_0x19ba1b,_0x4856e5){return db['CmList'][_0x2890('0x4e')]({'where':{'id':_0x326cc4['params']['id']}})['then'](handleEntityNotFound(_0x19ba1b,null))[_0x2890('0x29')](function(_0xcbf6a6){if(_0xcbf6a6){return _0xcbf6a6[_0x2890('0x5c')](_0x326cc4[_0x2890('0x34')][_0x2890('0x5d')]);}})[_0x2890('0x29')](respondWithStatusCode(_0x19ba1b,null))['catch'](handleError(_0x19ba1b,null));};exports['addContacts']=function(_0x744c2d,_0x4eada1,_0x4a430b){return db[_0x2890('0x45')][_0x2890('0x4e')]({'where':{'id':_0x744c2d[_0x2890('0x4b')]['id']}})[_0x2890('0x29')](handleEntityNotFound(_0x4eada1,null))[_0x2890('0x29')](function(_0xc7a62b){if(_0xc7a62b){var _0x30639c=[];var _0x537cf5={'success':[],'errors':[]};return db['CmContact'][_0x2890('0x5e')]()[_0x2890('0x29')](function(_0x4d84f4){if(_0x744c2d['body'][_0x2890('0x5f')]&&_[_0x2890('0x60')](_0x744c2d['body'][_0x2890('0x5f')])){if(_0x744c2d[_0x2890('0x50')][_0x2890('0x5f')][_0x2890('0x3a')]){_0x744c2d[_0x2890('0x50')][_0x2890('0x5f')]=_0x744c2d[_0x2890('0x50')][_0x2890('0x5f')][_0x2890('0x61')](';')+';';}else{_0x744c2d[_0x2890('0x50')][_0x2890('0x5f')]=null;}}else{_0x744c2d['body'][_0x2890('0x5f')]=null;}if(_0x744c2d['body']&&_['isArray'](_0x744c2d[_0x2890('0x50')])){for(var _0x87b3ff=0x0;_0x87b3ff<_0x744c2d['body'][_0x2890('0x3a')];_0x87b3ff+=0x1){_0x744c2d[_0x2890('0x50')][_0x87b3ff][_0x2890('0x59')]=_0x744c2d[_0x2890('0x4b')]['id'];_0x30639c['push'](_0x744c2d['body'][_0x87b3ff]);}return BPromise[_0x2890('0x62')](_0x30639c,function(_0x1b9310){return db['CmContact'][_0x2890('0x4f')](_[_0x2890('0x63')](_0x1b9310,[_0x2890('0x5d'),'id'])||{},{'fields':_[_0x2890('0x35')](_0x4d84f4),'raw':!![]})[_0x2890('0x29')](function(_0x4e1666){_0x537cf5[_0x2890('0x64')][_0x2890('0x65')](_0x4e1666[_0x2890('0x66')]);})[_0x2890('0x49')](function(_0x1bf7ad){_0x537cf5['errors']['push']({'data':_0x1b9310,'error':_0x1bf7ad[_0x2890('0x67')]});});})[_0x2890('0x29')](function(_0x5c2578){return _0x537cf5;})[_0x2890('0x49')](function(_0x62a7e6){return _0x62a7e6;});}else{_0x4eada1[_0x2890('0x1d')](0x190)[_0x2890('0x1f')]({'message':_0x2890('0x68')});}});}})['then'](respondWithResult(_0x4eada1,null))[_0x2890('0x49')](handleError(_0x4eada1,null));};exports[_0x2890('0x69')]=function(_0x455b70,_0x24b1af,_0x4e6700){var _0x197eb2;return db[_0x2890('0x45')]['find']({'where':{'id':_0x455b70[_0x2890('0x4b')]['id']},'include':[{'model':db[_0x2890('0x6a')],'as':_0x2890('0x6b')}]})[_0x2890('0x29')](handleEntityNotFound(_0x24b1af,null))[_0x2890('0x29')](function(_0x5bfc59){if(_0x5bfc59){_0x197eb2=_0x5bfc59;return db['CmContact']['rawAttributes'];}})[_0x2890('0x29')](function(_0x26bce8){if(_0x26bce8){var _0x1a6fde={};var _0x4ae124={};_0x4ae124[_0x2890('0x33')]=_[_0x2890('0x6c')](_['keys'](_0x26bce8),_['map'](_0x197eb2['CustomFields'],function(_0x4a85ee){return util[_0x2890('0x6d')](_0x2890('0x6e'),_0x4a85ee['id']);}));_0x4ae124[_0x2890('0x34')]=_['keys'](_0x455b70[_0x2890('0x34')]);_0x4ae124['filters']=_['intersection'](_0x4ae124[_0x2890('0x33')],_0x4ae124[_0x2890('0x34')]);_0x1a6fde[_0x2890('0x39')]=_[_0x2890('0x37')](_0x4ae124[_0x2890('0x33')],qs[_0x2890('0x38')](_0x455b70[_0x2890('0x34')]['fields']));_0x1a6fde['attributes']=_0x1a6fde['attributes'][_0x2890('0x3a')]?_0x1a6fde[_0x2890('0x39')]:_0x4ae124[_0x2890('0x33')];if(!_0x455b70['query'][_0x2890('0x3b')](_0x2890('0x3c'))){_0x1a6fde[_0x2890('0x22')]=qs[_0x2890('0x22')](_0x455b70[_0x2890('0x34')][_0x2890('0x22')]);_0x1a6fde[_0x2890('0x20')]=qs[_0x2890('0x20')](_0x455b70[_0x2890('0x34')][_0x2890('0x20')]);}_0x1a6fde['order']=qs[_0x2890('0x3e')](_0x455b70[_0x2890('0x34')][_0x2890('0x3e')]);_0x1a6fde['where']=qs['filters'](_[_0x2890('0x40')](_0x455b70[_0x2890('0x34')],_0x4ae124['filters']));_0x1a6fde[_0x2890('0x6f')]=!![];if(_0x455b70[_0x2890('0x34')][_0x2890('0x41')]){_0x1a6fde['where']=_[_0x2890('0x43')](_0x1a6fde[_0x2890('0x3f')],{'$or':_[_0x2890('0x31')](_0x1a6fde[_0x2890('0x39')],function(_0x11eb49){var _0x18c4a={};_0x18c4a[_0x11eb49]={'$like':'%'+_0x455b70[_0x2890('0x34')][_0x2890('0x41')]+'%'};return _0x18c4a;})});}_0x1a6fde=_[_0x2890('0x43')]({},_0x1a6fde,_0x455b70[_0x2890('0x44')]);return _0x197eb2[_0x2890('0x69')](_0x1a6fde);}})[_0x2890('0x29')](respondWithResult(_0x24b1af,null))[_0x2890('0x49')](handleError(_0x24b1af,null));};exports[_0x2890('0x70')]=function(_0x7712a5,_0x50a9bc,_0x58155a){var _0x708a35;return db[_0x2890('0x45')][_0x2890('0x4e')]({'where':{'id':_0x7712a5['params']['id']},'include':[{'model':db[_0x2890('0x6a')],'as':_0x2890('0x6b')}]})[_0x2890('0x29')](handleEntityNotFound(_0x50a9bc,null))[_0x2890('0x29')](function(_0x251a34){if(_0x251a34){_0x708a35=_0x251a34;return db[_0x2890('0x71')]['rawAttributes'];}})[_0x2890('0x29')](function(_0x5de564){if(_0x5de564){var _0x92d35f={};var _0x536260={};_0x536260[_0x2890('0x33')]=_[_0x2890('0x6c')](_[_0x2890('0x35')](_0x5de564),_[_0x2890('0x31')](_0x708a35[_0x2890('0x6b')],function(_0x1b7417){return util[_0x2890('0x6d')]('cf_%d',_0x1b7417['id']);}));_0x536260['query']=_[_0x2890('0x35')](_0x7712a5[_0x2890('0x34')]);_0x536260['filters']=_[_0x2890('0x37')](_0x536260[_0x2890('0x33')],_0x536260[_0x2890('0x34')]);_0x92d35f[_0x2890('0x39')]=_['intersection'](_0x536260[_0x2890('0x33')],qs[_0x2890('0x38')](_0x7712a5[_0x2890('0x34')][_0x2890('0x38')]));_0x92d35f[_0x2890('0x39')]=_0x92d35f['attributes'][_0x2890('0x3a')]?_0x92d35f[_0x2890('0x39')]:_0x536260['model'];if(!_0x7712a5[_0x2890('0x34')][_0x2890('0x3b')](_0x2890('0x3c'))){_0x92d35f[_0x2890('0x22')]=qs[_0x2890('0x22')](_0x7712a5[_0x2890('0x34')][_0x2890('0x22')]);_0x92d35f[_0x2890('0x20')]=qs[_0x2890('0x20')](_0x7712a5[_0x2890('0x34')]['offset']);}_0x92d35f[_0x2890('0x3d')]=qs[_0x2890('0x3e')](_0x7712a5['query'][_0x2890('0x3e')]);_0x92d35f[_0x2890('0x3f')]=qs[_0x2890('0x36')](_[_0x2890('0x40')](_0x7712a5[_0x2890('0x34')],_0x536260[_0x2890('0x36')]));_0x92d35f[_0x2890('0x6f')]=!![];if(_0x7712a5[_0x2890('0x34')][_0x2890('0x41')]){_0x92d35f[_0x2890('0x3f')]=_[_0x2890('0x43')](_0x92d35f[_0x2890('0x3f')],{'$or':_['map'](_0x92d35f['attributes'],function(_0x3aab5a){var _0x246241={};_0x246241[_0x3aab5a]={'$like':'%'+_0x7712a5[_0x2890('0x34')][_0x2890('0x41')]+'%'};return _0x246241;})});}_0x92d35f=_[_0x2890('0x43')]({},_0x92d35f,_0x7712a5[_0x2890('0x44')]);return _0x708a35['getContacts'](_0x92d35f);}})[_0x2890('0x29')](function(_0x1acb07){if(!_[_0x2890('0x72')](_0x1acb07)){var _0x4f717e=toCsv(_0x1acb07);var _0x5a1abd=Date['now']();fs[_0x2890('0x73')](util[_0x2890('0x6d')](_0x2890('0x74'),_0x708a35['id'],_0x5a1abd),_0x4f717e);_0x50a9bc[_0x2890('0x75')](_0x2890('0x76'),_0x2890('0x77')+util[_0x2890('0x6d')](_0x2890('0x78'),_0x708a35['id'],_0x5a1abd));_0x50a9bc[_0x2890('0x75')](_0x2890('0x79'),'text/csv');return _0x50a9bc['download'](util['format'](_0x2890('0x74'),_0x708a35['id'],_0x5a1abd));}else{return _0x50a9bc[_0x2890('0x1c')](0xcc);}})['catch'](handleError(_0x50a9bc,null));};exports['addCustomField']=function(_0x961fc3,_0x2330c9,_0x22ae29){var _0xcec994;delete _0x961fc3[_0x2890('0x50')]['id'];return db[_0x2890('0x45')][_0x2890('0x5a')]({'where':{'id':_0x961fc3['params']['id']}})[_0x2890('0x29')](handleEntityNotFound(_0x2330c9,null))[_0x2890('0x29')](function(_0x8223a0){if(_0x8223a0){return db[_0x2890('0x7a')][_0x2890('0x7b')](function(_0x455c8d){return db[_0x2890('0x6a')][_0x2890('0x4f')](_0x961fc3[_0x2890('0x50')],{'transaction':_0x455c8d})[_0x2890('0x29')](function(_0x2e7305){_0xcec994=_0x2e7305;return _0x8223a0[_0x2890('0x7c')](_0x2e7305,{'transaction':_0x455c8d});})[_0x2890('0x29')](function(){var _0x563a1e={'type':db[_0x2890('0x7d')]['TEXT'],'transaction':_0x455c8d};switch(_0x961fc3[_0x2890('0x50')][_0x2890('0x32')]){case _0x2890('0x7e'):_0x563a1e[_0x2890('0x32')]=db[_0x2890('0x7d')][_0x2890('0x7f')];break;case _0x2890('0x80'):_0x563a1e[_0x2890('0x32')]=db[_0x2890('0x7d')][_0x2890('0x81')];break;case _0x2890('0x82'):_0x563a1e[_0x2890('0x32')]=db[_0x2890('0x7d')][_0x2890('0x83')];_0x563a1e['defaultValue']=![];break;default:}return db[_0x2890('0x7a')][_0x2890('0x84')][_0x2890('0x85')](_0x2890('0x86'),util['format'](_0x2890('0x87'),_0xcec994['id']),_0x563a1e);})[_0x2890('0x29')](function(){return _0xcec994;});});}})[_0x2890('0x29')](respondWithResult(_0x2330c9,null))[_0x2890('0x49')](handleError(_0x2330c9,null));};exports[_0x2890('0x88')]=function(_0x29bec2,_0x2bf68c,_0x3e14e1){var _0x22c3bc={};var _0x28a03d={};var _0x3477ca;var _0x3a31e4;return db[_0x2890('0x45')][_0x2890('0x5a')]({'where':{'id':_0x29bec2['params']['id']}})[_0x2890('0x29')](handleEntityNotFound(_0x2bf68c,null))[_0x2890('0x29')](function(_0x18b783){if(_0x18b783){_0x3477ca=_0x18b783;_0x28a03d[_0x2890('0x33')]=_['keys'](db[_0x2890('0x6a')][_0x2890('0x4c')]);_0x28a03d['query']=_[_0x2890('0x35')](_0x29bec2['query']);_0x28a03d[_0x2890('0x36')]=_[_0x2890('0x37')](_0x28a03d[_0x2890('0x33')],_0x28a03d[_0x2890('0x34')]);_0x22c3bc[_0x2890('0x39')]=_[_0x2890('0x37')](_0x28a03d['model'],qs[_0x2890('0x38')](_0x29bec2['query']['fields']));_0x22c3bc[_0x2890('0x39')]=_0x22c3bc[_0x2890('0x39')][_0x2890('0x3a')]?_0x22c3bc[_0x2890('0x39')]:_0x28a03d[_0x2890('0x33')];_0x22c3bc[_0x2890('0x3d')]=qs[_0x2890('0x3e')](_0x29bec2[_0x2890('0x34')][_0x2890('0x3e')]);_0x22c3bc[_0x2890('0x3f')]=qs[_0x2890('0x36')](_[_0x2890('0x40')](_0x29bec2[_0x2890('0x34')],_0x28a03d[_0x2890('0x36')]));_0x22c3bc['where']=_['merge'](_0x22c3bc['where'],{'$or':[{'ListId':_0x18b783['id']},{'ListId':null}]});if(_0x29bec2[_0x2890('0x34')]['filter']){_0x22c3bc['where']=_['merge'](_0x22c3bc[_0x2890('0x3f')],{'$or':_[_0x2890('0x31')](_0x22c3bc['attributes'],function(_0x4bc3da){var _0x494cd7={};_0x494cd7[_0x4bc3da]={'$like':'%'+_0x29bec2[_0x2890('0x34')]['filter']+'%'};return _0x494cd7;})});}_0x22c3bc=_[_0x2890('0x43')]({},_0x22c3bc,_0x29bec2[_0x2890('0x44')]);return db[_0x2890('0x6a')][_0x2890('0x89')](_0x22c3bc);}})['then'](respondWithResult(_0x2bf68c,null))[_0x2890('0x49')](handleError(_0x2bf68c,null));};exports[_0x2890('0x8a')]=function(_0x2b2a93,_0x299ad4,_0x570f95){return db['CmList'][_0x2890('0x4e')]({'where':{'id':_0x2b2a93[_0x2890('0x4b')]['id']}})[_0x2890('0x29')](handleEntityNotFound(_0x299ad4,null))[_0x2890('0x29')](function(_0xc41008){if(_0xc41008){return _0xc41008['addAgents'](_0x2b2a93[_0x2890('0x50')][_0x2890('0x5d')],_[_0x2890('0x63')](_0x2b2a93['body'],[_0x2890('0x5d'),'id'])||{})[_0x2890('0x8b')](function(_0x4e6d86){for(var _0x4bc1e8=0x0;_0x4bc1e8<_0x2b2a93[_0x2890('0x50')]['ids']['length'];_0x4bc1e8+=0x1){socket[_0x2890('0x8c')](_0x2890('0x8d'),{'UserId':Number(_0x2b2a93[_0x2890('0x50')][_0x2890('0x5d')][_0x4bc1e8]),'CmListId':Number(_0x2b2a93[_0x2890('0x4b')]['id'])});}return _0x4e6d86;});}})[_0x2890('0x29')](respondWithResult(_0x299ad4,null))['catch'](handleError(_0x299ad4,null));};exports[_0x2890('0x8e')]=function(_0xfe0abd,_0x4e1aad,_0x4eeeef){return db[_0x2890('0x45')][_0x2890('0x4e')]({'where':{'id':_0xfe0abd[_0x2890('0x4b')]['id']}})[_0x2890('0x29')](handleEntityNotFound(_0x4e1aad,null))[_0x2890('0x29')](function(_0x2b6434){if(_0x2b6434){return _0x2b6434[_0x2890('0x8e')](_0xfe0abd['query'][_0x2890('0x5d')])['then'](function(){if(_[_0x2890('0x60')](_0xfe0abd[_0x2890('0x34')][_0x2890('0x5d')])){for(var _0x3f0e62=0x0;_0x3f0e62<_0xfe0abd['query']['ids'][_0x2890('0x3a')];_0x3f0e62+=0x1){socket[_0x2890('0x8c')]('userCmList:remove',{'UserId':Number(_0xfe0abd[_0x2890('0x34')][_0x2890('0x5d')][_0x3f0e62]),'CmListId':Number(_0xfe0abd[_0x2890('0x4b')]['id'])});}}else{socket['emit']('userCmList:remove',{'UserId':Number(_0xfe0abd[_0x2890('0x34')][_0x2890('0x5d')]),'CmListId':Number(_0xfe0abd['params']['id'])});}});}})['then'](respondWithStatusCode(_0x4e1aad,null))['catch'](handleError(_0x4e1aad,null));};exports[_0x2890('0x8f')]=function(_0x3ac891,_0x4c0e35,_0x3ae9bd){var _0x3456d0={};var _0x2c6ded={};var _0x9a1249;var _0x2b91a3;return db['CmList'][_0x2890('0x5a')]({'where':{'id':_0x3ac891[_0x2890('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4c0e35,null))['then'](function(_0x104c71){if(_0x104c71){_0x9a1249=_0x104c71;_0x2c6ded[_0x2890('0x33')]=_[_0x2890('0x35')](db[_0x2890('0x90')]['rawAttributes']);_0x2c6ded['query']=_[_0x2890('0x35')](_0x3ac891[_0x2890('0x34')]);_0x2c6ded[_0x2890('0x36')]=_[_0x2890('0x37')](_0x2c6ded[_0x2890('0x33')],_0x2c6ded[_0x2890('0x34')]);_0x3456d0[_0x2890('0x39')]=_[_0x2890('0x37')](_0x2c6ded[_0x2890('0x33')],qs[_0x2890('0x38')](_0x3ac891[_0x2890('0x34')][_0x2890('0x38')]));_0x3456d0[_0x2890('0x39')]=_0x3456d0[_0x2890('0x39')]['length']?_0x3456d0['attributes']:_0x2c6ded['model'];_0x3456d0[_0x2890('0x3d')]=qs['sort'](_0x3ac891[_0x2890('0x34')][_0x2890('0x3e')]);_0x3456d0['where']=qs[_0x2890('0x36')](_['pick'](_0x3ac891['query'],_0x2c6ded[_0x2890('0x36')]));if(_0x3ac891[_0x2890('0x34')][_0x2890('0x41')]){_0x3456d0[_0x2890('0x3f')]=_['merge'](_0x3456d0[_0x2890('0x3f')],{'$or':_['map'](_0x3456d0[_0x2890('0x39')],function(_0x5c01e8){var _0x2fdcc8={};_0x2fdcc8[_0x5c01e8]={'$like':'%'+_0x3ac891[_0x2890('0x34')][_0x2890('0x41')]+'%'};return _0x2fdcc8;})});}_0x3456d0=_[_0x2890('0x43')]({},_0x3456d0,_0x3ac891[_0x2890('0x44')]);return _0x9a1249['getAgents'](_0x3456d0);}})[_0x2890('0x29')](function(_0x26720f){if(_0x26720f){_0x2b91a3=_0x26720f[_0x2890('0x3a')];if(!_0x3ac891[_0x2890('0x34')]['hasOwnProperty'](_0x2890('0x3c'))){_0x3456d0['limit']=qs[_0x2890('0x22')](_0x3ac891[_0x2890('0x34')][_0x2890('0x22')]);_0x3456d0[_0x2890('0x20')]=qs['offset'](_0x3ac891[_0x2890('0x34')][_0x2890('0x20')]);}return _0x9a1249[_0x2890('0x8f')](_0x3456d0);}})[_0x2890('0x29')](function(_0x263e94){if(_0x263e94){return _0x263e94?{'count':_0x2b91a3,'rows':_0x263e94}:null;}})['then'](respondWithResult(_0x4c0e35,null))['catch'](handleError(_0x4c0e35,null));}; \ No newline at end of file +var _0x85e0=['papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./cmList.socket','register','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','apply','save','update','get','Lists','UserProfileResource','destroy','then','error','send','index','map','CmList','rawAttributes','fieldName','key','model','name','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','where','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','describe','addDisposition','Disposition','findOne','sort','ListId','merge','removeDispositions','addContacts','CmContact','tags','join','isArray','push','each','omit','ids','success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','format','raw','concat','cf_%d','now','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','/tmp/list_%d_%s.csv','addCustomField','transaction','addCustomFields','Sequelize','text','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','spread','emit','removeAgents','userCmList:remove','User','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','querystring'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x85e0,0x85));var _0x085e=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x85e0[_0x4f9b18];return _0x29f20c;};'use strict';var emlformat=require(_0x085e('0x0'));var rimraf=require(_0x085e('0x1'));var zipdir=require(_0x085e('0x2'));var jsonpatch=require(_0x085e('0x3'));var rp=require(_0x085e('0x4'));var moment=require(_0x085e('0x5'));var BPromise=require(_0x085e('0x6'));var Mustache=require(_0x085e('0x7'));var util=require(_0x085e('0x8'));var path=require(_0x085e('0x9'));var sox=require(_0x085e('0xa'));var csv=require(_0x085e('0xb'));var ejs=require(_0x085e('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x085e('0xd'));var crypto=require(_0x085e('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x085e('0xb'));var querystring=require(_0x085e('0xf'));var Papa=require(_0x085e('0x10'));var Redis=require('ioredis');var authService=require(_0x085e('0x11'));var qs=require(_0x085e('0x12'));var as=require(_0x085e('0x13'));var hardwareService=require(_0x085e('0x14'));var logger=require(_0x085e('0x15'))('api');var utils=require(_0x085e('0x16'));var config=require(_0x085e('0x17'));var licenseUtil=require(_0x085e('0x18'));var db=require(_0x085e('0x19'))['db'];config['redis']=_['defaults'](config[_0x085e('0x1a')],{'host':_0x085e('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x085e('0x1c'))[_0x085e('0x1d')](socket);function respondWithStatusCode(_0x2121d7,_0xca793d){_0xca793d=_0xca793d||0xcc;return function(_0x2d99c6){if(_0x2d99c6){return _0x2121d7[_0x085e('0x1e')](_0xca793d);}return _0x2121d7[_0x085e('0x1f')](_0xca793d)[_0x085e('0x20')]();};}function respondWithResult(_0xb36017,_0x32e4e3){_0x32e4e3=_0x32e4e3||0xc8;return function(_0x29d4c8){if(_0x29d4c8){return _0xb36017[_0x085e('0x1f')](_0x32e4e3)['json'](_0x29d4c8);}};}function respondWithFilteredResult(_0x388a60,_0x55f443){return function(_0x2e9b8f){if(_0x2e9b8f){var _0x448fe3=typeof _0x55f443['offset']===_0x085e('0x21')&&typeof _0x55f443[_0x085e('0x22')]==='undefined';var _0x18788b=_0x2e9b8f[_0x085e('0x23')];var _0x4a650d=_0x448fe3?0x0:_0x55f443[_0x085e('0x24')];var _0x11f640=_0x448fe3?_0x2e9b8f[_0x085e('0x23')]:_0x55f443[_0x085e('0x24')]+_0x55f443[_0x085e('0x22')];var _0x772071;if(_0x11f640>=_0x18788b){_0x11f640=_0x18788b;_0x772071=0xc8;}else{_0x772071=0xce;}_0x388a60[_0x085e('0x1f')](_0x772071);return _0x388a60['set'](_0x085e('0x25'),_0x4a650d+'-'+_0x11f640+'/'+_0x18788b)[_0x085e('0x26')](_0x2e9b8f);}return null;};}function patchUpdates(_0x4cecc7){return function(_0x30a976){try{jsonpatch[_0x085e('0x27')](_0x30a976,_0x4cecc7,!![]);}catch(_0x6b6580){return BPromise['reject'](_0x6b6580);}return _0x30a976[_0x085e('0x28')]();};}function saveUpdates(_0x1abc78,_0x150ab8){return function(_0x537690){if(_0x537690){return _0x537690[_0x085e('0x29')](_0x1abc78)['then'](function(_0x2a1eff){return _0x2a1eff;});}return null;};}function removeEntity(_0x4b4f11,_0x1fdfc1){return function(_0x1dc37c){if(_0x1dc37c){return _0x1dc37c['destroy']()['then'](function(){var _0x5d89a1=_0x1dc37c[_0x085e('0x2a')]({'plain':!![]});var _0x19032d=_0x085e('0x2b');return db[_0x085e('0x2c')][_0x085e('0x2d')]({'where':{'type':_0x19032d,'resourceId':_0x5d89a1['id']}})[_0x085e('0x2e')](function(){return _0x1dc37c;});})[_0x085e('0x2e')](function(){_0x4b4f11[_0x085e('0x1f')](0xcc)[_0x085e('0x20')]();});}};}function handleEntityNotFound(_0x541420,_0x1c0105){return function(_0x16c9b3){if(!_0x16c9b3){_0x541420['sendStatus'](0x194);}return _0x16c9b3;};}function handleError(_0x511826,_0x18ed8b){_0x18ed8b=_0x18ed8b||0x1f4;return function(_0x2df64e){logger[_0x085e('0x2f')](_0x2df64e['stack']);if(_0x2df64e['name']){delete _0x2df64e['name'];}_0x511826[_0x085e('0x1f')](_0x18ed8b)[_0x085e('0x30')](_0x2df64e);};}exports[_0x085e('0x31')]=function(_0x16eb37,_0x1deb39){var _0x281219={},_0x170534={},_0x3caf3d={'count':0x0,'rows':[]};var _0x5c78c6=_[_0x085e('0x32')](db[_0x085e('0x33')][_0x085e('0x34')],function(_0x42fc1e){return{'name':_0x42fc1e[_0x085e('0x35')],'type':_0x42fc1e['type'][_0x085e('0x36')]};});_0x170534[_0x085e('0x37')]=_[_0x085e('0x32')](_0x5c78c6,_0x085e('0x38'));_0x170534['query']=_[_0x085e('0x39')](_0x16eb37['query']);_0x170534[_0x085e('0x3a')]=_[_0x085e('0x3b')](_0x170534[_0x085e('0x37')],_0x170534[_0x085e('0x3c')]);_0x281219[_0x085e('0x3d')]=_[_0x085e('0x3b')](_0x170534[_0x085e('0x37')],qs[_0x085e('0x3e')](_0x16eb37[_0x085e('0x3c')][_0x085e('0x3e')]));_0x281219[_0x085e('0x3d')]=_0x281219[_0x085e('0x3d')][_0x085e('0x3f')]?_0x281219[_0x085e('0x3d')]:_0x170534[_0x085e('0x37')];if(!_0x16eb37[_0x085e('0x3c')][_0x085e('0x40')](_0x085e('0x41'))){_0x281219['limit']=qs['limit'](_0x16eb37[_0x085e('0x3c')][_0x085e('0x22')]);_0x281219['offset']=qs['offset'](_0x16eb37['query'][_0x085e('0x24')]);}_0x281219[_0x085e('0x42')]=qs['sort'](_0x16eb37[_0x085e('0x3c')]['sort']);_0x281219['where']=qs[_0x085e('0x3a')](_[_0x085e('0x43')](_0x16eb37[_0x085e('0x3c')],_0x170534[_0x085e('0x3a')]),_0x5c78c6);if(_0x16eb37['query'][_0x085e('0x44')]){_0x281219['where']=_['merge'](_0x281219[_0x085e('0x45')],{'$or':_[_0x085e('0x32')](_0x5c78c6,function(_0x2dc3f7){if(_0x2dc3f7[_0x085e('0x46')]!==_0x085e('0x47')){var _0x1943ec={};_0x1943ec[_0x2dc3f7[_0x085e('0x38')]]={'$like':'%'+_0x16eb37[_0x085e('0x3c')][_0x085e('0x44')]+'%'};return _0x1943ec;}})});}_0x281219=_['merge']({},_0x281219,_0x16eb37[_0x085e('0x48')]);var _0x2f8b7d={'where':_0x281219['where']};return db['CmList'][_0x085e('0x23')](_0x2f8b7d)['then'](function(_0x2e1952){_0x3caf3d[_0x085e('0x23')]=_0x2e1952;if(_0x16eb37['query'][_0x085e('0x49')]){_0x281219[_0x085e('0x4a')]=[{'all':!![]}];}return db[_0x085e('0x33')][_0x085e('0x4b')](_0x281219);})[_0x085e('0x2e')](function(_0x2f9fad){_0x3caf3d[_0x085e('0x4c')]=_0x2f9fad;return _0x3caf3d;})['then'](respondWithFilteredResult(_0x1deb39,_0x281219))[_0x085e('0x4d')](handleError(_0x1deb39,null));};exports['show']=function(_0x37c945,_0x1ff011){var _0x3763e5={'raw':![],'where':{'id':_0x37c945[_0x085e('0x4e')]['id']}},_0x369c83={};_0x369c83[_0x085e('0x37')]=_[_0x085e('0x39')](db[_0x085e('0x33')][_0x085e('0x34')]);_0x369c83[_0x085e('0x3c')]=_[_0x085e('0x39')](_0x37c945[_0x085e('0x3c')]);_0x369c83[_0x085e('0x3a')]=_[_0x085e('0x3b')](_0x369c83['model'],_0x369c83[_0x085e('0x3c')]);_0x3763e5[_0x085e('0x3d')]=_['intersection'](_0x369c83[_0x085e('0x37')],qs[_0x085e('0x3e')](_0x37c945[_0x085e('0x3c')]['fields']));_0x3763e5[_0x085e('0x3d')]=_0x3763e5[_0x085e('0x3d')]['length']?_0x3763e5['attributes']:_0x369c83[_0x085e('0x37')];if(_0x37c945[_0x085e('0x3c')][_0x085e('0x49')]){_0x3763e5[_0x085e('0x4a')]=[{'all':!![]}];}_0x3763e5=_['merge']({},_0x3763e5,_0x37c945[_0x085e('0x48')]);return db[_0x085e('0x33')][_0x085e('0x4f')](_0x3763e5)[_0x085e('0x2e')](handleEntityNotFound(_0x1ff011,null))[_0x085e('0x2e')](respondWithResult(_0x1ff011,null))['catch'](handleError(_0x1ff011,null));};exports[_0x085e('0x50')]=function(_0x3800dd,_0x474ee1){return db['CmList']['create'](_0x3800dd[_0x085e('0x51')],{})['then'](function(_0x4900e7){var _0x3bc240=_0x3800dd[_0x085e('0x52')][_0x085e('0x2a')]({'plain':!![]});if(!_0x3bc240)throw new Error(_0x085e('0x53'));if(_0x3bc240['role']===_0x085e('0x52')){var _0x380ec3=_0x4900e7[_0x085e('0x2a')]({'plain':!![]});var _0x44bbe2=_0x085e('0x2b');return db[_0x085e('0x54')][_0x085e('0x4f')]({'where':{'name':_0x44bbe2,'userProfileId':_0x3bc240[_0x085e('0x55')]},'raw':!![]})[_0x085e('0x2e')](function(_0x11739e){if(_0x11739e&&_0x11739e[_0x085e('0x56')]===0x0){return db[_0x085e('0x2c')]['create']({'name':_0x380ec3['name'],'resourceId':_0x380ec3['id'],'type':_0x11739e[_0x085e('0x38')],'sectionId':_0x11739e['id']},{})[_0x085e('0x2e')](function(){return _0x4900e7;});}else{return _0x4900e7;}})[_0x085e('0x4d')](function(_0x32df6d){logger[_0x085e('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x32df6d);throw _0x32df6d;});}return _0x4900e7;})['then'](respondWithResult(_0x474ee1,0xc9))[_0x085e('0x4d')](handleError(_0x474ee1,null));};exports[_0x085e('0x29')]=function(_0x3a9abc,_0x4d5037){if(_0x3a9abc[_0x085e('0x51')]['id']){delete _0x3a9abc[_0x085e('0x51')]['id'];}return db[_0x085e('0x33')][_0x085e('0x4f')]({'where':{'id':_0x3a9abc[_0x085e('0x4e')]['id']}})[_0x085e('0x2e')](handleEntityNotFound(_0x4d5037,null))[_0x085e('0x2e')](saveUpdates(_0x3a9abc[_0x085e('0x51')],null))[_0x085e('0x2e')](respondWithResult(_0x4d5037,null))['catch'](handleError(_0x4d5037,null));};exports[_0x085e('0x2d')]=function(_0x1068d3,_0x40f5bd){return db['CmList'][_0x085e('0x4f')]({'where':{'id':_0x1068d3[_0x085e('0x4e')]['id']}})[_0x085e('0x2e')](handleEntityNotFound(_0x40f5bd,null))[_0x085e('0x2e')](removeEntity(_0x40f5bd,null))['catch'](handleError(_0x40f5bd,null));};exports[_0x085e('0x57')]=function(_0x591c6d,_0x5dc153){return db[_0x085e('0x33')]['describe']()[_0x085e('0x2e')](respondWithResult(_0x5dc153,null))['catch'](handleError(_0x5dc153,null));};exports[_0x085e('0x58')]=function(_0xfd5c65,_0x5ca320,_0x522957){if(_0xfd5c65['body']['id']){delete _0xfd5c65[_0x085e('0x51')]['id'];}return db['CmList'][_0x085e('0x4f')]({'where':{'id':_0xfd5c65[_0x085e('0x4e')]['id']}})[_0x085e('0x2e')](handleEntityNotFound(_0x5ca320,null))[_0x085e('0x2e')](function(_0x3efe1a){if(_0x3efe1a){_0xfd5c65[_0x085e('0x51')]['ListId']=_0x3efe1a['id'];return db[_0x085e('0x59')][_0x085e('0x50')](_0xfd5c65[_0x085e('0x51')]);}})[_0x085e('0x2e')](respondWithResult(_0x5ca320,null))[_0x085e('0x4d')](handleError(_0x5ca320,null));};exports['getDispositions']=function(_0x494953,_0x18a5fd,_0x417b49){var _0x4dc30f={'raw':![],'where':{}};var _0x20bf92={};var _0x32aa00={'count':0x0,'rows':[]};return db[_0x085e('0x33')][_0x085e('0x5a')]({'where':{'id':_0x494953[_0x085e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x18a5fd,null))[_0x085e('0x2e')](function(_0xe37496){if(_0xe37496){_0x20bf92[_0x085e('0x37')]=_[_0x085e('0x39')](db['Disposition']['rawAttributes']);_0x20bf92[_0x085e('0x3c')]=_[_0x085e('0x39')](_0x494953[_0x085e('0x3c')]);_0x20bf92[_0x085e('0x3a')]=_[_0x085e('0x3b')](_0x20bf92[_0x085e('0x37')],_0x20bf92[_0x085e('0x3c')]);_0x4dc30f[_0x085e('0x3d')]=_[_0x085e('0x3b')](_0x20bf92[_0x085e('0x37')],qs['fields'](_0x494953[_0x085e('0x3c')][_0x085e('0x3e')]));_0x4dc30f[_0x085e('0x3d')]=_0x4dc30f[_0x085e('0x3d')][_0x085e('0x3f')]?_0x4dc30f['attributes']:_0x20bf92[_0x085e('0x37')];if(!_0x494953[_0x085e('0x3c')]['hasOwnProperty'](_0x085e('0x41'))){_0x4dc30f['limit']=qs[_0x085e('0x22')](_0x494953[_0x085e('0x3c')]['limit']);_0x4dc30f[_0x085e('0x24')]=qs[_0x085e('0x24')](_0x494953['query']['offset']);}_0x4dc30f[_0x085e('0x42')]=qs[_0x085e('0x5b')](_0x494953[_0x085e('0x3c')][_0x085e('0x5b')]);_0x4dc30f[_0x085e('0x45')]=qs[_0x085e('0x3a')](_[_0x085e('0x43')](_0x494953[_0x085e('0x3c')],_0x20bf92[_0x085e('0x3a')]));_0x4dc30f[_0x085e('0x45')][_0x085e('0x5c')]=_0xe37496['id'];if(_0x494953[_0x085e('0x3c')][_0x085e('0x44')]){_0x4dc30f['where']=_['merge'](_0x4dc30f[_0x085e('0x45')],{'$or':_[_0x085e('0x32')](_0x4dc30f[_0x085e('0x3d')],function(_0x16bc98){var _0x3bba6b={};_0x3bba6b[_0x16bc98]={'$like':'%'+_0x494953[_0x085e('0x3c')][_0x085e('0x44')]+'%'};return _0x3bba6b;})});}_0x4dc30f=_[_0x085e('0x5d')]({},_0x4dc30f,_0x494953[_0x085e('0x48')]);return db['Disposition'][_0x085e('0x23')]({'where':_0x4dc30f[_0x085e('0x45')]})[_0x085e('0x2e')](function(_0x2aa3e0){_0x32aa00[_0x085e('0x23')]=_0x2aa3e0;if(_0x494953[_0x085e('0x3c')][_0x085e('0x49')]){_0x4dc30f['include']=[{'all':!![]}];}return db[_0x085e('0x59')][_0x085e('0x4b')](_0x4dc30f);})[_0x085e('0x2e')](function(_0x547575){_0x32aa00[_0x085e('0x4c')]=_0x547575;return _0x32aa00;});}})['then'](respondWithFilteredResult(_0x18a5fd,_0x4dc30f))[_0x085e('0x4d')](handleError(_0x18a5fd,null));};exports['removeDispositions']=function(_0x92e608,_0xa2eef,_0xe2b22a){return db[_0x085e('0x33')]['find']({'where':{'id':_0x92e608['params']['id']}})[_0x085e('0x2e')](handleEntityNotFound(_0xa2eef,null))['then'](function(_0x56a4ae){if(_0x56a4ae){return _0x56a4ae[_0x085e('0x5e')](_0x92e608['query']['ids']);}})['then'](respondWithStatusCode(_0xa2eef,null))[_0x085e('0x4d')](handleError(_0xa2eef,null));};exports[_0x085e('0x5f')]=function(_0x306a04,_0x5509c5,_0x581932){return db[_0x085e('0x33')]['find']({'where':{'id':_0x306a04[_0x085e('0x4e')]['id']}})[_0x085e('0x2e')](handleEntityNotFound(_0x5509c5,null))[_0x085e('0x2e')](function(_0x29e577){if(_0x29e577){var _0x2e5af5=[];var _0x45a138={'success':[],'errors':[]};return db[_0x085e('0x60')]['describe']()[_0x085e('0x2e')](function(_0x2153a6){if(_0x306a04[_0x085e('0x51')][_0x085e('0x61')]&&_['isArray'](_0x306a04['body'][_0x085e('0x61')])){if(_0x306a04[_0x085e('0x51')][_0x085e('0x61')][_0x085e('0x3f')]){_0x306a04[_0x085e('0x51')]['tags']=_0x306a04[_0x085e('0x51')]['tags'][_0x085e('0x62')](';')+';';}else{_0x306a04['body']['tags']=null;}}else{_0x306a04[_0x085e('0x51')][_0x085e('0x61')]=null;}if(_0x306a04[_0x085e('0x51')]&&_[_0x085e('0x63')](_0x306a04[_0x085e('0x51')])){for(var _0x24a3d9=0x0;_0x24a3d9<_0x306a04[_0x085e('0x51')][_0x085e('0x3f')];_0x24a3d9+=0x1){_0x306a04[_0x085e('0x51')][_0x24a3d9][_0x085e('0x5c')]=_0x306a04[_0x085e('0x4e')]['id'];_0x2e5af5[_0x085e('0x64')](_0x306a04[_0x085e('0x51')][_0x24a3d9]);}return BPromise[_0x085e('0x65')](_0x2e5af5,function(_0x58e202){return db[_0x085e('0x60')][_0x085e('0x50')](_[_0x085e('0x66')](_0x58e202,[_0x085e('0x67'),'id'])||{},{'fields':_[_0x085e('0x39')](_0x2153a6),'raw':!![]})[_0x085e('0x2e')](function(_0x3d1855){_0x45a138[_0x085e('0x68')][_0x085e('0x64')](_0x3d1855[_0x085e('0x69')]);})['catch'](function(_0x358628){_0x45a138[_0x085e('0x6a')]['push']({'data':_0x58e202,'error':_0x358628[_0x085e('0x6b')]});});})[_0x085e('0x2e')](function(_0x22ffef){return _0x45a138;})[_0x085e('0x4d')](function(_0x1e34f3){return _0x1e34f3;});}else{_0x5509c5[_0x085e('0x1f')](0x190)[_0x085e('0x26')]({'message':_0x085e('0x6c')});}});}})[_0x085e('0x2e')](respondWithResult(_0x5509c5,null))[_0x085e('0x4d')](handleError(_0x5509c5,null));};exports[_0x085e('0x6d')]=function(_0x331df3,_0x100e8c,_0x1c4066){var _0x4197b3;return db['CmList'][_0x085e('0x4f')]({'where':{'id':_0x331df3['params']['id']},'include':[{'model':db[_0x085e('0x6e')],'as':_0x085e('0x6f')}]})[_0x085e('0x2e')](handleEntityNotFound(_0x100e8c,null))['then'](function(_0x42bee2){if(_0x42bee2){_0x4197b3=_0x42bee2;return db[_0x085e('0x60')][_0x085e('0x34')];}})[_0x085e('0x2e')](function(_0x585b91){if(_0x585b91){var _0x55be10={};var _0x119630={};_0x119630[_0x085e('0x37')]=_['concat'](_[_0x085e('0x39')](_0x585b91),_[_0x085e('0x32')](_0x4197b3[_0x085e('0x6f')],function(_0x5d174a){return util[_0x085e('0x70')]('cf_%d',_0x5d174a['id']);}));_0x119630[_0x085e('0x3c')]=_[_0x085e('0x39')](_0x331df3[_0x085e('0x3c')]);_0x119630['filters']=_[_0x085e('0x3b')](_0x119630[_0x085e('0x37')],_0x119630['query']);_0x55be10[_0x085e('0x3d')]=_[_0x085e('0x3b')](_0x119630['model'],qs[_0x085e('0x3e')](_0x331df3[_0x085e('0x3c')][_0x085e('0x3e')]));_0x55be10[_0x085e('0x3d')]=_0x55be10['attributes'][_0x085e('0x3f')]?_0x55be10[_0x085e('0x3d')]:_0x119630[_0x085e('0x37')];if(!_0x331df3[_0x085e('0x3c')][_0x085e('0x40')](_0x085e('0x41'))){_0x55be10[_0x085e('0x22')]=qs[_0x085e('0x22')](_0x331df3[_0x085e('0x3c')][_0x085e('0x22')]);_0x55be10[_0x085e('0x24')]=qs[_0x085e('0x24')](_0x331df3[_0x085e('0x3c')][_0x085e('0x24')]);}_0x55be10[_0x085e('0x42')]=qs[_0x085e('0x5b')](_0x331df3[_0x085e('0x3c')]['sort']);_0x55be10[_0x085e('0x45')]=qs[_0x085e('0x3a')](_[_0x085e('0x43')](_0x331df3[_0x085e('0x3c')],_0x119630[_0x085e('0x3a')]));_0x55be10[_0x085e('0x71')]=!![];if(_0x331df3[_0x085e('0x3c')][_0x085e('0x44')]){_0x55be10[_0x085e('0x45')]=_[_0x085e('0x5d')](_0x55be10[_0x085e('0x45')],{'$or':_['map'](_0x55be10[_0x085e('0x3d')],function(_0x5fe748){var _0x1c9127={};_0x1c9127[_0x5fe748]={'$like':'%'+_0x331df3[_0x085e('0x3c')]['filter']+'%'};return _0x1c9127;})});}_0x55be10=_[_0x085e('0x5d')]({},_0x55be10,_0x331df3[_0x085e('0x48')]);return _0x4197b3['getContacts'](_0x55be10);}})['then'](respondWithResult(_0x100e8c,null))[_0x085e('0x4d')](handleError(_0x100e8c,null));};exports['getContactsCsv']=function(_0x4d6a74,_0x576553,_0x52da90){var _0x1513a4;return db[_0x085e('0x33')][_0x085e('0x4f')]({'where':{'id':_0x4d6a74[_0x085e('0x4e')]['id']},'include':[{'model':db['CmCustomField'],'as':_0x085e('0x6f')}]})[_0x085e('0x2e')](handleEntityNotFound(_0x576553,null))[_0x085e('0x2e')](function(_0x286ccb){if(_0x286ccb){_0x1513a4=_0x286ccb;return db[_0x085e('0x60')][_0x085e('0x34')];}})[_0x085e('0x2e')](function(_0x422d4c){if(_0x422d4c){var _0x8588d9={};var _0x4c3d4e={};_0x4c3d4e[_0x085e('0x37')]=_[_0x085e('0x72')](_[_0x085e('0x39')](_0x422d4c),_[_0x085e('0x32')](_0x1513a4[_0x085e('0x6f')],function(_0x389c70){return util[_0x085e('0x70')](_0x085e('0x73'),_0x389c70['id']);}));_0x4c3d4e[_0x085e('0x3c')]=_[_0x085e('0x39')](_0x4d6a74['query']);_0x4c3d4e['filters']=_['intersection'](_0x4c3d4e[_0x085e('0x37')],_0x4c3d4e[_0x085e('0x3c')]);_0x8588d9['attributes']=_[_0x085e('0x3b')](_0x4c3d4e['model'],qs['fields'](_0x4d6a74[_0x085e('0x3c')][_0x085e('0x3e')]));_0x8588d9[_0x085e('0x3d')]=_0x8588d9[_0x085e('0x3d')][_0x085e('0x3f')]?_0x8588d9[_0x085e('0x3d')]:_0x4c3d4e[_0x085e('0x37')];if(!_0x4d6a74['query'][_0x085e('0x40')](_0x085e('0x41'))){_0x8588d9[_0x085e('0x22')]=qs['limit'](_0x4d6a74[_0x085e('0x3c')]['limit']);_0x8588d9['offset']=qs[_0x085e('0x24')](_0x4d6a74[_0x085e('0x3c')][_0x085e('0x24')]);}_0x8588d9[_0x085e('0x42')]=qs[_0x085e('0x5b')](_0x4d6a74[_0x085e('0x3c')][_0x085e('0x5b')]);_0x8588d9[_0x085e('0x45')]=qs[_0x085e('0x3a')](_[_0x085e('0x43')](_0x4d6a74[_0x085e('0x3c')],_0x4c3d4e['filters']));_0x8588d9[_0x085e('0x71')]=!![];if(_0x4d6a74[_0x085e('0x3c')][_0x085e('0x44')]){_0x8588d9[_0x085e('0x45')]=_[_0x085e('0x5d')](_0x8588d9[_0x085e('0x45')],{'$or':_['map'](_0x8588d9[_0x085e('0x3d')],function(_0x4f4f60){var _0x45b5cc={};_0x45b5cc[_0x4f4f60]={'$like':'%'+_0x4d6a74[_0x085e('0x3c')][_0x085e('0x44')]+'%'};return _0x45b5cc;})});}_0x8588d9=_[_0x085e('0x5d')]({},_0x8588d9,_0x4d6a74[_0x085e('0x48')]);return _0x1513a4[_0x085e('0x6d')](_0x8588d9);}})[_0x085e('0x2e')](function(_0x4f3157){if(!_['isEmpty'](_0x4f3157)){var _0x4a5ebc=toCsv(_0x4f3157);var _0x51a802=Date[_0x085e('0x74')]();fs['writeFileSync'](util[_0x085e('0x70')]('/tmp/list_%d_%s.csv',_0x1513a4['id'],_0x51a802),_0x4a5ebc);_0x576553[_0x085e('0x75')](_0x085e('0x76'),_0x085e('0x77')+util[_0x085e('0x70')](_0x085e('0x78'),_0x1513a4['id'],_0x51a802));_0x576553[_0x085e('0x75')](_0x085e('0x79'),_0x085e('0x7a'));return _0x576553[_0x085e('0x7b')](util['format'](_0x085e('0x7c'),_0x1513a4['id'],_0x51a802));}else{return _0x576553[_0x085e('0x1e')](0xcc);}})[_0x085e('0x4d')](handleError(_0x576553,null));};exports[_0x085e('0x7d')]=function(_0x2a52a1,_0x580b48,_0x58d5ec){var _0x19fbd2;delete _0x2a52a1[_0x085e('0x51')]['id'];return db[_0x085e('0x33')][_0x085e('0x5a')]({'where':{'id':_0x2a52a1['params']['id']}})['then'](handleEntityNotFound(_0x580b48,null))[_0x085e('0x2e')](function(_0x2d1e84){if(_0x2d1e84){return db['sequelize'][_0x085e('0x7e')](function(_0x3cf84a){return db[_0x085e('0x6e')][_0x085e('0x50')](_0x2a52a1[_0x085e('0x51')],{'transaction':_0x3cf84a})[_0x085e('0x2e')](function(_0x4b37cc){_0x19fbd2=_0x4b37cc;return _0x2d1e84[_0x085e('0x7f')](_0x4b37cc,{'transaction':_0x3cf84a});})['then'](function(){var _0x5b9a53={'type':db[_0x085e('0x80')]['TEXT'],'transaction':_0x3cf84a};switch(_0x2a52a1['body'][_0x085e('0x46')]){case _0x085e('0x81'):_0x5b9a53[_0x085e('0x46')]=db[_0x085e('0x80')][_0x085e('0x82')];break;case _0x085e('0x83'):_0x5b9a53[_0x085e('0x46')]=db[_0x085e('0x80')][_0x085e('0x84')];break;case _0x085e('0x85'):_0x5b9a53[_0x085e('0x46')]=db['Sequelize'][_0x085e('0x86')];_0x5b9a53[_0x085e('0x87')]=![];break;default:}return db['sequelize'][_0x085e('0x88')][_0x085e('0x89')](_0x085e('0x8a'),util['format'](_0x085e('0x8b'),_0x19fbd2['id']),_0x5b9a53);})['then'](function(){return _0x19fbd2;});});}})[_0x085e('0x2e')](respondWithResult(_0x580b48,null))[_0x085e('0x4d')](handleError(_0x580b48,null));};exports[_0x085e('0x8c')]=function(_0x3ad505,_0x57548e,_0x5806b1){var _0x33b504={};var _0x289096={};var _0x4d99fa;var _0x44c365;return db[_0x085e('0x33')][_0x085e('0x5a')]({'where':{'id':_0x3ad505['params']['id']}})[_0x085e('0x2e')](handleEntityNotFound(_0x57548e,null))[_0x085e('0x2e')](function(_0xd6b709){if(_0xd6b709){_0x4d99fa=_0xd6b709;_0x289096[_0x085e('0x37')]=_[_0x085e('0x39')](db['CmCustomField']['rawAttributes']);_0x289096['query']=_[_0x085e('0x39')](_0x3ad505[_0x085e('0x3c')]);_0x289096['filters']=_['intersection'](_0x289096['model'],_0x289096['query']);_0x33b504[_0x085e('0x3d')]=_[_0x085e('0x3b')](_0x289096[_0x085e('0x37')],qs[_0x085e('0x3e')](_0x3ad505[_0x085e('0x3c')][_0x085e('0x3e')]));_0x33b504['attributes']=_0x33b504['attributes'][_0x085e('0x3f')]?_0x33b504['attributes']:_0x289096[_0x085e('0x37')];_0x33b504['order']=qs['sort'](_0x3ad505['query'][_0x085e('0x5b')]);_0x33b504[_0x085e('0x45')]=qs['filters'](_[_0x085e('0x43')](_0x3ad505['query'],_0x289096['filters']));_0x33b504[_0x085e('0x45')]=_[_0x085e('0x5d')](_0x33b504['where'],{'$or':[{'ListId':_0xd6b709['id']},{'ListId':null}]});if(_0x3ad505[_0x085e('0x3c')][_0x085e('0x44')]){_0x33b504[_0x085e('0x45')]=_[_0x085e('0x5d')](_0x33b504[_0x085e('0x45')],{'$or':_[_0x085e('0x32')](_0x33b504[_0x085e('0x3d')],function(_0x5fc814){var _0xa2d6e8={};_0xa2d6e8[_0x5fc814]={'$like':'%'+_0x3ad505[_0x085e('0x3c')][_0x085e('0x44')]+'%'};return _0xa2d6e8;})});}_0x33b504=_[_0x085e('0x5d')]({},_0x33b504,_0x3ad505[_0x085e('0x48')]);return db[_0x085e('0x6e')][_0x085e('0x8d')](_0x33b504);}})['then'](respondWithResult(_0x57548e,null))['catch'](handleError(_0x57548e,null));};exports['addAgents']=function(_0xdb9529,_0x1d9425,_0x1432b4){return db['CmList'][_0x085e('0x4f')]({'where':{'id':_0xdb9529[_0x085e('0x4e')]['id']}})[_0x085e('0x2e')](handleEntityNotFound(_0x1d9425,null))['then'](function(_0x1d793d){if(_0x1d793d){return _0x1d793d[_0x085e('0x8e')](_0xdb9529['body'][_0x085e('0x67')],_['omit'](_0xdb9529[_0x085e('0x51')],[_0x085e('0x67'),'id'])||{})[_0x085e('0x8f')](function(_0x43ec8b){for(var _0x23c985=0x0;_0x23c985<_0xdb9529[_0x085e('0x51')][_0x085e('0x67')][_0x085e('0x3f')];_0x23c985+=0x1){socket[_0x085e('0x90')]('userCmList:save',{'UserId':Number(_0xdb9529[_0x085e('0x51')][_0x085e('0x67')][_0x23c985]),'CmListId':Number(_0xdb9529[_0x085e('0x4e')]['id'])});}return _0x43ec8b;});}})[_0x085e('0x2e')](respondWithResult(_0x1d9425,null))[_0x085e('0x4d')](handleError(_0x1d9425,null));};exports[_0x085e('0x91')]=function(_0x38fb7f,_0x486eef,_0x289b78){return db[_0x085e('0x33')][_0x085e('0x4f')]({'where':{'id':_0x38fb7f[_0x085e('0x4e')]['id']}})[_0x085e('0x2e')](handleEntityNotFound(_0x486eef,null))[_0x085e('0x2e')](function(_0x5a357d){if(_0x5a357d){return _0x5a357d[_0x085e('0x91')](_0x38fb7f[_0x085e('0x3c')][_0x085e('0x67')])[_0x085e('0x2e')](function(){if(_[_0x085e('0x63')](_0x38fb7f['query'][_0x085e('0x67')])){for(var _0x5da793=0x0;_0x5da793<_0x38fb7f[_0x085e('0x3c')][_0x085e('0x67')][_0x085e('0x3f')];_0x5da793+=0x1){socket[_0x085e('0x90')]('userCmList:remove',{'UserId':Number(_0x38fb7f[_0x085e('0x3c')]['ids'][_0x5da793]),'CmListId':Number(_0x38fb7f[_0x085e('0x4e')]['id'])});}}else{socket[_0x085e('0x90')](_0x085e('0x92'),{'UserId':Number(_0x38fb7f[_0x085e('0x3c')][_0x085e('0x67')]),'CmListId':Number(_0x38fb7f[_0x085e('0x4e')]['id'])});}});}})[_0x085e('0x2e')](respondWithStatusCode(_0x486eef,null))[_0x085e('0x4d')](handleError(_0x486eef,null));};exports['getAgents']=function(_0x53130c,_0x44a4dc,_0x1ffccd){var _0x228961={};var _0x3c1007={};var _0x379fe8;var _0x4614a5;return db['CmList'][_0x085e('0x5a')]({'where':{'id':_0x53130c[_0x085e('0x4e')]['id']}})[_0x085e('0x2e')](handleEntityNotFound(_0x44a4dc,null))[_0x085e('0x2e')](function(_0x2cbd6f){if(_0x2cbd6f){_0x379fe8=_0x2cbd6f;_0x3c1007['model']=_[_0x085e('0x39')](db[_0x085e('0x93')][_0x085e('0x34')]);_0x3c1007[_0x085e('0x3c')]=_[_0x085e('0x39')](_0x53130c[_0x085e('0x3c')]);_0x3c1007[_0x085e('0x3a')]=_[_0x085e('0x3b')](_0x3c1007[_0x085e('0x37')],_0x3c1007[_0x085e('0x3c')]);_0x228961[_0x085e('0x3d')]=_[_0x085e('0x3b')](_0x3c1007[_0x085e('0x37')],qs[_0x085e('0x3e')](_0x53130c[_0x085e('0x3c')][_0x085e('0x3e')]));_0x228961[_0x085e('0x3d')]=_0x228961[_0x085e('0x3d')][_0x085e('0x3f')]?_0x228961[_0x085e('0x3d')]:_0x3c1007[_0x085e('0x37')];_0x228961['order']=qs[_0x085e('0x5b')](_0x53130c[_0x085e('0x3c')][_0x085e('0x5b')]);_0x228961[_0x085e('0x45')]=qs[_0x085e('0x3a')](_[_0x085e('0x43')](_0x53130c[_0x085e('0x3c')],_0x3c1007[_0x085e('0x3a')]));if(_0x53130c['query'][_0x085e('0x44')]){_0x228961[_0x085e('0x45')]=_[_0x085e('0x5d')](_0x228961[_0x085e('0x45')],{'$or':_['map'](_0x228961[_0x085e('0x3d')],function(_0x943276){var _0x51a2a6={};_0x51a2a6[_0x943276]={'$like':'%'+_0x53130c[_0x085e('0x3c')]['filter']+'%'};return _0x51a2a6;})});}_0x228961=_[_0x085e('0x5d')]({},_0x228961,_0x53130c[_0x085e('0x48')]);return _0x379fe8[_0x085e('0x94')](_0x228961);}})[_0x085e('0x2e')](function(_0xf69c56){if(_0xf69c56){_0x4614a5=_0xf69c56[_0x085e('0x3f')];if(!_0x53130c[_0x085e('0x3c')][_0x085e('0x40')](_0x085e('0x41'))){_0x228961[_0x085e('0x22')]=qs[_0x085e('0x22')](_0x53130c['query']['limit']);_0x228961['offset']=qs[_0x085e('0x24')](_0x53130c[_0x085e('0x3c')]['offset']);}return _0x379fe8['getAgents'](_0x228961);}})[_0x085e('0x2e')](function(_0x5a25c9){if(_0x5a25c9){return _0x5a25c9?{'count':_0x4614a5,'rows':_0x5a25c9}:null;}})['then'](respondWithResult(_0x44a4dc,null))[_0x085e('0x4d')](handleError(_0x44a4dc,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index aecae79..4e009f4 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 _0x9957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmList'];(function(_0x5a1e5d,_0x4b9db2){var _0x403914=function(_0x3f318e){while(--_0x3f318e){_0x5a1e5d['push'](_0x5a1e5d['shift']());}};_0x403914(++_0x4b9db2);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var EventEmitter=require(_0x7995('0x0'));var CmList=require(_0x7995('0x1'))['db'][_0x7995('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x7995('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7995('0x4'),'afterDestroy':_0x7995('0x5')};function emitEvent(_0x1902b4){return function(_0x462a03,_0x576d89,_0x744bea){CmListEvents[_0x7995('0x6')](_0x1902b4+':'+_0x462a03['id'],_0x462a03);CmListEvents[_0x7995('0x6')](_0x1902b4,_0x462a03);_0x744bea(null);};}for(var e in events){if(events[_0x7995('0x7')](e)){var event=events[e];CmList[_0x7995('0x8')](e,emitEvent(event));}}module[_0x7995('0x9')]=CmListEvents; \ No newline at end of file +var _0x55ca=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x270adf,_0x1daaa3){var _0x29eda9=function(_0x40afec){while(--_0x40afec){_0x270adf['push'](_0x270adf['shift']());}};_0x29eda9(++_0x1daaa3);}(_0x55ca,0x126));var _0xa55c=function(_0x5d1594,_0x105585){_0x5d1594=_0x5d1594-0x0;var _0x5c4153=_0x55ca[_0x5d1594];return _0x5c4153;};'use strict';var EventEmitter=require(_0xa55c('0x0'));var CmList=require(_0xa55c('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa55c('0x2'),'afterDestroy':_0xa55c('0x3')};function emitEvent(_0x5dc716){return function(_0x3b478a,_0x2db02a,_0xcb02e3){CmListEvents[_0xa55c('0x4')](_0x5dc716+':'+_0x3b478a['id'],_0x3b478a);CmListEvents[_0xa55c('0x4')](_0x5dc716,_0x3b478a);_0xcb02e3(null);};}for(var e in events){if(events[_0xa55c('0x5')](e)){var event=events[e];CmList[_0xa55c('0x6')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index d753d5a..d8a6710 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 _0xe706=['request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','lodash','util','../../config/logger','moment','bluebird'];(function(_0x15be17,_0x14b547){var _0xc6d455=function(_0x22584a){while(--_0x22584a){_0x15be17['push'](_0x15be17['shift']());}};_0xc6d455(++_0x14b547);}(_0xe706,0xa3));var _0x6e70=function(_0xcb1d60,_0x32603e){_0xcb1d60=_0xcb1d60-0x0;var _0x3beee9=_0xe706[_0xcb1d60];return _0x3beee9;};'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':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2dae=['lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists'];(function(_0x2bda85,_0x5466b1){var _0xbff55f=function(_0x36975c){while(--_0x36975c){_0x2bda85['push'](_0x2bda85['shift']());}};_0xbff55f(++_0x5466b1);}(_0x2dae,0xc3));var _0xe2da=function(_0x4be8ba,_0x5d10ba){_0x4be8ba=_0x4be8ba-0x0;var _0x1af822=_0x2dae[_0x4be8ba];return _0x1af822;};'use strict';var _=require(_0xe2da('0x0'));var util=require('util');var logger=require(_0xe2da('0x1'))(_0xe2da('0x2'));var moment=require(_0xe2da('0x3'));var BPromise=require(_0xe2da('0x4'));var rp=require(_0xe2da('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe2da('0x6'));var config=require(_0xe2da('0x7'));var attributes=require(_0xe2da('0x8'));module[_0xe2da('0x9')]=function(_0x523c60,_0x3e3e25){return _0x523c60[_0xe2da('0xa')](_0xe2da('0xb'),attributes,{'tableName':_0xe2da('0xc'),'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 436d7f5..b251cec 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 _0x7ff4=['code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./cmList.socket','register','then','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x162af7,_0x24ae5e){var _0x417ded=function(_0x448d2b){while(--_0x448d2b){_0x162af7['push'](_0x162af7['shift']());}};_0x417ded(++_0x24ae5e);}(_0x7ff4,0xb9));var _0x47ff=function(_0x444201,_0x43ab54){_0x444201=_0x444201-0x0;var _0x213a68=_0x7ff4[_0x444201];return _0x213a68;};'use strict';var _=require(_0x47ff('0x0'));var util=require(_0x47ff('0x1'));var moment=require(_0x47ff('0x2'));var BPromise=require(_0x47ff('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x47ff('0x4'));var db=require(_0x47ff('0x5'))['db'];var utils=require(_0x47ff('0x6'));var logger=require(_0x47ff('0x7'))(_0x47ff('0x8'));var config=require(_0x47ff('0x9'));var jayson=require(_0x47ff('0xa'));var client=jayson[_0x47ff('0xb')][_0x47ff('0xc')]({'port':0x232a});config['redis']=_[_0x47ff('0xd')](config[_0x47ff('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x47ff('0xf'))(new Redis(config[_0x47ff('0xe')]));require(_0x47ff('0x10'))[_0x47ff('0x11')](socket);function respondWithRpcPromise(_0x3a42d9,_0x3979eb,_0xba849){return new BPromise(function(_0x3b5f20,_0x3cae19){return client['request'](_0x3a42d9,_0xba849)[_0x47ff('0x12')](function(_0x4cadc1){logger['info'](_0x47ff('0x13'),_0x3979eb,_0x47ff('0x14'));logger[_0x47ff('0x15')](_0x47ff('0x16'),_0x3979eb,'request\x20sent',JSON[_0x47ff('0x17')](_0x4cadc1));if(_0x4cadc1[_0x47ff('0x18')]){if(_0x4cadc1[_0x47ff('0x18')][_0x47ff('0x19')]===0x1f4){logger[_0x47ff('0x18')](_0x47ff('0x13'),_0x3979eb,_0x4cadc1[_0x47ff('0x18')][_0x47ff('0x1a')]);return _0x3cae19(_0x4cadc1[_0x47ff('0x18')][_0x47ff('0x1a')]);}logger['error'](_0x47ff('0x13'),_0x3979eb,_0x4cadc1[_0x47ff('0x18')][_0x47ff('0x1a')]);return _0x3b5f20(_0x4cadc1[_0x47ff('0x18')][_0x47ff('0x1a')]);}else{logger[_0x47ff('0x1b')](_0x47ff('0x13'),_0x3979eb,_0x47ff('0x14'));_0x3b5f20(_0x4cadc1[_0x47ff('0x1c')]['message']);}})[_0x47ff('0x1d')](function(_0x2292d6){logger['error']('CmList,\x20%s,\x20%s',_0x3979eb,_0x2292d6);_0x3cae19(_0x2292d6);});});} \ No newline at end of file +var _0x2f30=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','error','message','CmList,\x20%s,\x20%s','catch','lodash','util'];(function(_0x3cea2a,_0x5d90b4){var _0x4f8b91=function(_0x512b11){while(--_0x512b11){_0x3cea2a['push'](_0x3cea2a['shift']());}};_0x4f8b91(++_0x5d90b4);}(_0x2f30,0x66));var _0x02f3=function(_0x31b881,_0x1e0f27){_0x31b881=_0x31b881-0x0;var _0x55dad2=_0x2f30[_0x31b881];return _0x55dad2;};'use strict';var _=require(_0x02f3('0x0'));var util=require(_0x02f3('0x1'));var moment=require(_0x02f3('0x2'));var BPromise=require(_0x02f3('0x3'));var rs=require(_0x02f3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x02f3('0x5'))['db'];var utils=require(_0x02f3('0x6'));var logger=require(_0x02f3('0x7'))('rpc');var config=require(_0x02f3('0x8'));var jayson=require(_0x02f3('0x9'));var client=jayson[_0x02f3('0xa')][_0x02f3('0xb')]({'port':0x232a});config[_0x02f3('0xc')]=_['defaults'](config[_0x02f3('0xc')],{'host':_0x02f3('0xd'),'port':0x18eb});var socket=require(_0x02f3('0xe'))(new Redis(config[_0x02f3('0xc')]));require('./cmList.socket')[_0x02f3('0xf')](socket);function respondWithRpcPromise(_0x5cb3a3,_0x3fcc6d,_0x2871a1){return new BPromise(function(_0x5e4300,_0x17d108){return client[_0x02f3('0x10')](_0x5cb3a3,_0x2871a1)[_0x02f3('0x11')](function(_0x38e3f4){logger[_0x02f3('0x12')]('CmList,\x20%s,\x20%s',_0x3fcc6d,_0x02f3('0x13'));logger[_0x02f3('0x14')](_0x02f3('0x15'),_0x3fcc6d,_0x02f3('0x13'),JSON['stringify'](_0x38e3f4));if(_0x38e3f4[_0x02f3('0x16')]){if(_0x38e3f4['error']['code']===0x1f4){logger[_0x02f3('0x16')]('CmList,\x20%s,\x20%s',_0x3fcc6d,_0x38e3f4[_0x02f3('0x16')][_0x02f3('0x17')]);return _0x17d108(_0x38e3f4[_0x02f3('0x16')]['message']);}logger[_0x02f3('0x16')](_0x02f3('0x18'),_0x3fcc6d,_0x38e3f4['error'][_0x02f3('0x17')]);return _0x5e4300(_0x38e3f4[_0x02f3('0x16')]['message']);}else{logger[_0x02f3('0x12')](_0x02f3('0x18'),_0x3fcc6d,_0x02f3('0x13'));_0x5e4300(_0x38e3f4['result']['message']);}})[_0x02f3('0x19')](function(_0x3453e0){logger[_0x02f3('0x16')](_0x02f3('0x18'),_0x3fcc6d,_0x3453e0);_0x17d108(_0x3453e0);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 6e32c88..1da1c9b 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 _0xd6fe=['emit','removeListener','register','length','cmList:','save','remove'];(function(_0x32c012,_0xe3c576){var _0x48562e=function(_0x505228){while(--_0x505228){_0x32c012['push'](_0x32c012['shift']());}};_0x48562e(++_0xe3c576);}(_0xd6fe,0x171));var _0xed6f=function(_0x167cf2,_0x2628e7){_0x167cf2=_0x167cf2-0x0;var _0x2be27e=_0xd6fe[_0x167cf2];return _0x2be27e;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0xed6f('0x0'),_0xed6f('0x1'),'update'];function createListener(_0x4165e7,_0x26f753){return function(_0x5f4404){_0x26f753[_0xed6f('0x2')](_0x4165e7,_0x5f4404);};}function removeListener(_0x5979ff,_0x197c89){return function(){CmListEvents[_0xed6f('0x3')](_0x5979ff,_0x197c89);};}exports[_0xed6f('0x4')]=function(_0x2406d8){for(var _0x46f7a8=0x0,_0x206f6d=events[_0xed6f('0x5')];_0x46f7a8<_0x206f6d;_0x46f7a8++){var _0x4425f6=events[_0x46f7a8];var _0xe947b9=createListener(_0xed6f('0x6')+_0x4425f6,_0x2406d8);CmListEvents['on'](_0x4425f6,_0xe947b9);}}; \ No newline at end of file +var _0xb60d=['save','emit','removeListener','length'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb60d,0x8c));var _0xdb60=function(_0x41f4a7,_0x46c0cc){_0x41f4a7=_0x41f4a7-0x0;var _0x30080a=_0xb60d[_0x41f4a7];return _0x30080a;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0xdb60('0x0'),'remove','update'];function createListener(_0x44cf5a,_0x2562a3){return function(_0x5214f1){_0x2562a3[_0xdb60('0x1')](_0x44cf5a,_0x5214f1);};}function removeListener(_0x3fea39,_0x7c3469){return function(){CmListEvents[_0xdb60('0x2')](_0x3fea39,_0x7c3469);};}exports['register']=function(_0x1e6eed){for(var _0x37e1f5=0x0,_0x4df5a2=events[_0xdb60('0x3')];_0x37e1f5<_0x4df5a2;_0x37e1f5++){var _0x682cea=events[_0x37e1f5];var _0x130e61=createListener('cmList:'+_0x682cea,_0x1e6eed);CmListEvents['on'](_0x682cea,_0x130e61);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 0a03a56..541a57c 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 _0xc971=['/:id/contacts/csv','getContactsCsv','/:id/fields','/:id/users','getAgents','post','create','addDisposition','addContacts','addCustomField','addAgents','put','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','/:id/contacts','getContacts'];(function(_0x10d7cd,_0x5b5846){var _0x4fa622=function(_0x2696d3){while(--_0x2696d3){_0x10d7cd['push'](_0x10d7cd['shift']());}};_0x4fa622(++_0x5b5846);}(_0xc971,0x188));var _0x1c97=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xc971[_0x432682];return _0x463d05;};'use strict';var multer=require(_0x1c97('0x0'));var util=require(_0x1c97('0x1'));var path=require(_0x1c97('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x1c97('0x3'));var auth=require(_0x1c97('0x4'));var interaction=require(_0x1c97('0x5'));var config=require(_0x1c97('0x6'));var controller=require('./cmList.controller');router[_0x1c97('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1c97('0x7')](_0x1c97('0x8'),auth[_0x1c97('0x9')](),controller[_0x1c97('0xa')]);router[_0x1c97('0x7')](_0x1c97('0xb'),auth['isAuthenticated'](),controller[_0x1c97('0xc')]);router[_0x1c97('0x7')](_0x1c97('0xd'),auth[_0x1c97('0x9')](),controller['getDispositions']);router[_0x1c97('0x7')](_0x1c97('0xe'),auth[_0x1c97('0x9')](),controller[_0x1c97('0xf')]);router[_0x1c97('0x7')](_0x1c97('0x10'),auth[_0x1c97('0x9')](),controller[_0x1c97('0x11')]);router['get'](_0x1c97('0x12'),auth[_0x1c97('0x9')](),controller['getCustomFields']);router[_0x1c97('0x7')](_0x1c97('0x13'),auth[_0x1c97('0x9')](),controller[_0x1c97('0x14')]);router[_0x1c97('0x15')]('/',auth[_0x1c97('0x9')](),controller[_0x1c97('0x16')]);router[_0x1c97('0x15')](_0x1c97('0xd'),auth[_0x1c97('0x9')](),controller[_0x1c97('0x17')]);router['post'](_0x1c97('0xe'),auth[_0x1c97('0x9')](),controller[_0x1c97('0x18')]);router['post'](_0x1c97('0x12'),auth[_0x1c97('0x9')](),controller[_0x1c97('0x19')]);router['post'](_0x1c97('0x13'),auth[_0x1c97('0x9')](),controller[_0x1c97('0x1a')]);router[_0x1c97('0x1b')](_0x1c97('0xb'),auth[_0x1c97('0x9')](),controller[_0x1c97('0x1c')]);router[_0x1c97('0x1d')](_0x1c97('0xb'),auth[_0x1c97('0x9')](),controller[_0x1c97('0x1e')]);router[_0x1c97('0x1d')](_0x1c97('0xd'),auth[_0x1c97('0x9')](),controller[_0x1c97('0x1f')]);router['delete'](_0x1c97('0x13'),auth['isAuthenticated'](),controller[_0x1c97('0x20')]);module[_0x1c97('0x21')]=router; \ No newline at end of file +var _0x8e34=['post','/:id/dispositions','addDisposition','addContacts','addCustomField','addAgents','put','delete','removeDispositions','multer','util','path','connect-timeout','express','../../components/interaction/service','./cmList.controller','get','isAuthenticated','/describe','/:id','show','getDispositions','/:id/contacts/csv','getContactsCsv','getCustomFields','/:id/users','getAgents'];(function(_0x172a16,_0x1e0e46){var _0x44553a=function(_0x136cf1){while(--_0x136cf1){_0x172a16['push'](_0x172a16['shift']());}};_0x44553a(++_0x1e0e46);}(_0x8e34,0xe1));var _0x48e3=function(_0x235ba7,_0xf32628){_0x235ba7=_0x235ba7-0x0;var _0x2ff3f7=_0x8e34[_0x235ba7];return _0x2ff3f7;};'use strict';var multer=require(_0x48e3('0x0'));var util=require(_0x48e3('0x1'));var path=require(_0x48e3('0x2'));var timeout=require(_0x48e3('0x3'));var express=require(_0x48e3('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x48e3('0x5'));var config=require('../../config/environment');var controller=require(_0x48e3('0x6'));router[_0x48e3('0x7')]('/',auth[_0x48e3('0x8')](),controller['index']);router['get'](_0x48e3('0x9'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x48e3('0xa'),auth[_0x48e3('0x8')](),controller[_0x48e3('0xb')]);router[_0x48e3('0x7')]('/:id/dispositions',auth[_0x48e3('0x8')](),controller[_0x48e3('0xc')]);router[_0x48e3('0x7')]('/:id/contacts',auth['isAuthenticated'](),controller['getContacts']);router[_0x48e3('0x7')](_0x48e3('0xd'),auth['isAuthenticated'](),controller[_0x48e3('0xe')]);router[_0x48e3('0x7')]('/:id/fields',auth[_0x48e3('0x8')](),controller[_0x48e3('0xf')]);router['get'](_0x48e3('0x10'),auth[_0x48e3('0x8')](),controller[_0x48e3('0x11')]);router[_0x48e3('0x12')]('/',auth[_0x48e3('0x8')](),controller['create']);router[_0x48e3('0x12')](_0x48e3('0x13'),auth[_0x48e3('0x8')](),controller[_0x48e3('0x14')]);router[_0x48e3('0x12')]('/:id/contacts',auth[_0x48e3('0x8')](),controller[_0x48e3('0x15')]);router['post']('/:id/fields',auth[_0x48e3('0x8')](),controller[_0x48e3('0x16')]);router[_0x48e3('0x12')](_0x48e3('0x10'),auth[_0x48e3('0x8')](),controller[_0x48e3('0x17')]);router[_0x48e3('0x18')](_0x48e3('0xa'),auth[_0x48e3('0x8')](),controller['update']);router[_0x48e3('0x19')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x48e3('0x19')](_0x48e3('0x13'),auth[_0x48e3('0x8')](),controller[_0x48e3('0x1a')]);router[_0x48e3('0x19')](_0x48e3('0x10'),auth[_0x48e3('0x8')](),controller['removeAgents']);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 210da9c..f511692 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 _0x7f7e=['getDataValue','field','STRING','exports','VIRTUAL'];(function(_0x451e96,_0x2c8989){var _0x227c95=function(_0x36376c){while(--_0x36376c){_0x451e96['push'](_0x451e96['shift']());}};_0x227c95(++_0x2c8989);}(_0x7f7e,0xd0));var _0xe7f7=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x7f7e[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require('sequelize');module[_0xe7f7('0x0')]={'name':{'type':Sequelize[_0xe7f7('0x1')],'get':function(_0x4711ae){return this[_0xe7f7('0x2')](_0xe7f7('0x3'));}},'field':{'type':Sequelize[_0xe7f7('0x4')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xd57c=['sequelize','VIRTUAL','getDataValue','field','STRING'];(function(_0x5528c3,_0x35a416){var _0x47ec1b=function(_0x54a18e){while(--_0x54a18e){_0x5528c3['push'](_0x5528c3['shift']());}};_0x47ec1b(++_0x35a416);}(_0xd57c,0x104));var _0xcd57=function(_0x2136a6,_0x35af63){_0x2136a6=_0x2136a6-0x0;var _0x55b948=_0xd57c[_0x2136a6];return _0x55b948;};'use strict';var Sequelize=require(_0xcd57('0x0'));module['exports']={'name':{'type':Sequelize[_0xcd57('0x1')],'get':function(_0x5267c5){return this[_0xcd57('0x2')](_0xcd57('0x3'));}},'field':{'type':Sequelize[_0xcd57('0x4')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xcd57('0x4')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index a670316..95960e1 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(_0x463942,_0x342f8b){var _0x49171a=function(_0x20f829){while(--_0x20f829){_0x463942['push'](_0x463942['shift']());}};_0x49171a(++_0x342f8b);}(_0x7a54,0x106));var _0x47a5=function(_0x321974,_0x432eda){_0x321974=_0x321974-0x0;var _0x489dd2=_0x7a54[_0x321974];return _0x489dd2;};'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 _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(_0x534138,_0x2c7c0a){var _0x29b2c1=function(_0x5321ac){while(--_0x5321ac){_0x534138['push'](_0x534138['shift']());}};_0x29b2c1(++_0x2c7c0a);}(_0x7a54,0x106));var _0x47a5=function(_0x4ad690,_0x44019c){_0x4ad690=_0x4ad690-0x0;var _0x4f79e1=_0x7a54[_0x4ad690];return _0x4f79e1;};'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 diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 372ba04..8977da1 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 _0xb210=['request-promise','../../config/environment','./condition.attributes','exports','define','Condition','tools_conditions','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1b4ed3,_0x2b09e4){var _0x484ba3=function(_0x572ed6){while(--_0x572ed6){_0x1b4ed3['push'](_0x1b4ed3['shift']());}};_0x484ba3(++_0x2b09e4);}(_0xb210,0x1a7));var _0x0b21=function(_0x543af5,_0x238cc8){_0x543af5=_0x543af5-0x0;var _0x1af623=_0xb210[_0x543af5];return _0x1af623;};'use strict';var _=require(_0x0b21('0x0'));var util=require(_0x0b21('0x1'));var logger=require(_0x0b21('0x2'))(_0x0b21('0x3'));var moment=require(_0x0b21('0x4'));var BPromise=require(_0x0b21('0x5'));var rp=require(_0x0b21('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0b21('0x7'));var attributes=require(_0x0b21('0x8'));module[_0x0b21('0x9')]=function(_0x254c96,_0x168f18){return _0x254c96[_0x0b21('0xa')](_0x0b21('0xb'),attributes,{'tableName':_0x0b21('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x657b=['Condition','tools_conditions','lodash','util','../../config/logger','moment','request-promise','path','rimraf','./condition.attributes','define'];(function(_0x15a8fa,_0x4652b2){var _0x1355c2=function(_0x203292){while(--_0x203292){_0x15a8fa['push'](_0x15a8fa['shift']());}};_0x1355c2(++_0x4652b2);}(_0x657b,0x65));var _0xb657=function(_0x3879fd,_0x25924c){_0x3879fd=_0x3879fd-0x0;var _0x559375=_0x657b[_0x3879fd];return _0x559375;};'use strict';var _=require(_0xb657('0x0'));var util=require(_0xb657('0x1'));var logger=require(_0xb657('0x2'))('api');var moment=require(_0xb657('0x3'));var BPromise=require('bluebird');var rp=require(_0xb657('0x4'));var fs=require('fs');var path=require(_0xb657('0x5'));var rimraf=require(_0xb657('0x6'));var config=require('../../config/environment');var attributes=require(_0xb657('0x7'));module['exports']=function(_0x30eb8a,_0x704cbd){return _0x30eb8a[_0xb657('0x8')](_0xb657('0x9'),attributes,{'tableName':_0xb657('0xa'),'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 9970612..a369504 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 _0xf89f=['stringify','error','code','message','info','request\x20sent','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','Condition,\x20%s,\x20%s','debug'];(function(_0x296897,_0x4d23ea){var _0x2b44ab=function(_0xdf90d8){while(--_0xdf90d8){_0x296897['push'](_0x296897['shift']());}};_0x2b44ab(++_0x4d23ea);}(_0xf89f,0x104));var _0xff89=function(_0x26ae05,_0x53e7ea){_0x26ae05=_0x26ae05-0x0;var _0x1e8338=_0xf89f[_0x26ae05];return _0x1e8338;};'use strict';var _=require('lodash');var util=require(_0xff89('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xff89('0x1'));var fs=require('fs');var Redis=require(_0xff89('0x2'));var db=require(_0xff89('0x3'))['db'];var utils=require(_0xff89('0x4'));var logger=require('../../config/logger')(_0xff89('0x5'));var config=require('../../config/environment');var jayson=require(_0xff89('0x6'));var client=jayson[_0xff89('0x7')][_0xff89('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2f9e66,_0x5e2bdd,_0x105f29){return new BPromise(function(_0x516c84,_0x7be652){return client[_0xff89('0x9')](_0x2f9e66,_0x105f29)[_0xff89('0xa')](function(_0x44300b){logger['info'](_0xff89('0xb'),_0x5e2bdd,'request\x20sent');logger[_0xff89('0xc')]('Condition,\x20%s,\x20%s,\x20%s',_0x5e2bdd,'request\x20sent',JSON[_0xff89('0xd')](_0x44300b));if(_0x44300b[_0xff89('0xe')]){if(_0x44300b['error'][_0xff89('0xf')]===0x1f4){logger[_0xff89('0xe')](_0xff89('0xb'),_0x5e2bdd,_0x44300b[_0xff89('0xe')][_0xff89('0x10')]);return _0x7be652(_0x44300b['error']['message']);}logger[_0xff89('0xe')]('Condition,\x20%s,\x20%s',_0x5e2bdd,_0x44300b[_0xff89('0xe')][_0xff89('0x10')]);return _0x516c84(_0x44300b[_0xff89('0xe')]['message']);}else{logger[_0xff89('0x11')](_0xff89('0xb'),_0x5e2bdd,_0xff89('0x12'));_0x516c84(_0x44300b[_0xff89('0x13')][_0xff89('0x10')]);}})[_0xff89('0x14')](function(_0x14780b){logger['error'](_0xff89('0xb'),_0x5e2bdd,_0x14780b);_0x7be652(_0x14780b);});});} \ No newline at end of file +var _0x5c2c=['jayson/promise','client','request','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment'];(function(_0x207273,_0x1b55a7){var _0x30b04d=function(_0x144543){while(--_0x144543){_0x207273['push'](_0x207273['shift']());}};_0x30b04d(++_0x1b55a7);}(_0x5c2c,0x1dc));var _0xc5c2=function(_0x644560,_0x1783aa){_0x644560=_0x644560-0x0;var _0x41b76b=_0x5c2c[_0x644560];return _0x41b76b;};'use strict';var _=require(_0xc5c2('0x0'));var util=require(_0xc5c2('0x1'));var moment=require(_0xc5c2('0x2'));var BPromise=require(_0xc5c2('0x3'));var rs=require(_0xc5c2('0x4'));var fs=require('fs');var Redis=require(_0xc5c2('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc5c2('0x6'));var config=require(_0xc5c2('0x7'));var jayson=require(_0xc5c2('0x8'));var client=jayson[_0xc5c2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b3a92,_0xb08002,_0x2168ed){return new BPromise(function(_0x30c1a8,_0x42d57a){return client[_0xc5c2('0xa')](_0x4b3a92,_0x2168ed)['then'](function(_0x969f98){logger[_0xc5c2('0xb')](_0xc5c2('0xc'),_0xb08002,_0xc5c2('0xd'));logger[_0xc5c2('0xe')](_0xc5c2('0xf'),_0xb08002,_0xc5c2('0xd'),JSON[_0xc5c2('0x10')](_0x969f98));if(_0x969f98[_0xc5c2('0x11')]){if(_0x969f98[_0xc5c2('0x11')][_0xc5c2('0x12')]===0x1f4){logger[_0xc5c2('0x11')](_0xc5c2('0xc'),_0xb08002,_0x969f98[_0xc5c2('0x11')][_0xc5c2('0x13')]);return _0x42d57a(_0x969f98['error'][_0xc5c2('0x13')]);}logger[_0xc5c2('0x11')]('Condition,\x20%s,\x20%s',_0xb08002,_0x969f98[_0xc5c2('0x11')][_0xc5c2('0x13')]);return _0x30c1a8(_0x969f98[_0xc5c2('0x11')][_0xc5c2('0x13')]);}else{logger[_0xc5c2('0xb')](_0xc5c2('0xc'),_0xb08002,'request\x20sent');_0x30c1a8(_0x969f98[_0xc5c2('0x14')]['message']);}})[_0xc5c2('0x15')](function(_0x442f7b){logger[_0xc5c2('0x11')](_0xc5c2('0xc'),_0xb08002,_0x442f7b);_0x42d57a(_0x442f7b);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 79db1c1..164b371 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 _0xa1e5=['/:id','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./condition.controller','isAuthenticated','update','delete'];(function(_0x5a2db8,_0x409f2a){var _0x28b4f8=function(_0x238548){while(--_0x238548){_0x5a2db8['push'](_0x5a2db8['shift']());}};_0x28b4f8(++_0x409f2a);}(_0xa1e5,0x189));var _0x5a1e=function(_0x13b31a,_0x1fe263){_0x13b31a=_0x13b31a-0x0;var _0x2e2ab7=_0xa1e5[_0x13b31a];return _0x2e2ab7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5a1e('0x0'));var timeout=require(_0x5a1e('0x1'));var express=require(_0x5a1e('0x2'));var router=express[_0x5a1e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5a1e('0x4'));var interaction=require(_0x5a1e('0x5'));var config=require('../../config/environment');var controller=require(_0x5a1e('0x6'));router['put']('/:id',auth[_0x5a1e('0x7')](),controller[_0x5a1e('0x8')]);router[_0x5a1e('0x9')](_0x5a1e('0xa'),auth['isAuthenticated'](),controller[_0x5a1e('0xb')]);module[_0x5a1e('0xc')]=router; \ No newline at end of file +var _0x4360=['../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x50f857,_0x3a49d1){var _0x105edb=function(_0x34261b){while(--_0x34261b){_0x50f857['push'](_0x50f857['shift']());}};_0x105edb(++_0x3a49d1);}(_0x4360,0x81));var _0x0436=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x4360[_0x1ac595];return _0x455fff;};'use strict';var multer=require('multer');var util=require(_0x0436('0x0'));var path=require(_0x0436('0x1'));var timeout=require(_0x0436('0x2'));var express=require(_0x0436('0x3'));var router=express[_0x0436('0x4')]();var fs_extra=require(_0x0436('0x5'));var auth=require(_0x0436('0x6'));var interaction=require(_0x0436('0x7'));var config=require(_0x0436('0x8'));var controller=require(_0x0436('0x9'));router[_0x0436('0xa')](_0x0436('0xb'),auth[_0x0436('0xc')](),controller[_0x0436('0xd')]);router[_0x0436('0xe')]('/:id',auth[_0x0436('0xc')](),controller[_0x0436('0xf')]);module[_0x0436('0x10')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 0574ba3..4587ee6 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 _0x757a=['exports','STRING'];(function(_0x4ef901,_0x5cf070){var _0x11e238=function(_0x4890db){while(--_0x4890db){_0x4ef901['push'](_0x4ef901['shift']());}};_0x11e238(++_0x5cf070);}(_0x757a,0xde));var _0xa757=function(_0x3fd079,_0x53ae06){_0x3fd079=_0x3fd079-0x0;var _0x84422d=_0x757a[_0x3fd079];return _0x84422d;};'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 +var _0xb7e7=['STRING','sequelize'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0xb7e7,0x121));var _0x7b7e=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0xb7e7[_0x3ea913];return _0x2b4f28;};'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 diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index dd7f2be..c9469c1 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 _0x468c=['./dashboard.socket','register','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','CustomDashboards','UserProfileResource','error','stack','name','send','index','rawAttributes','model','map','query','keys','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','Dashboard','includeAll','include','findAll','rows','show','params','intersection','length','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','body','type','iframe','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','counter','total','attrVoiceQueues','attrFontSize','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','widgetAttributes:\x20%s','stringify','addItem','DashboardItem','getItems','findOne','pick','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost'];(function(_0x3b6b4f,_0x1fd1f5){var _0x3ea254=function(_0x351174){while(--_0x351174){_0x3b6b4f['push'](_0x3b6b4f['shift']());}};_0x3ea254(++_0x1fd1f5);}(_0x468c,0x177));var _0xc468=function(_0x29b6a4,_0x279d5f){_0x29b6a4=_0x29b6a4-0x0;var _0x1a6129=_0x468c[_0x29b6a4];return _0x1a6129;};'use strict';var emlformat=require(_0xc468('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc468('0x1'));var jsonpatch=require(_0xc468('0x2'));var rp=require(_0xc468('0x3'));var moment=require(_0xc468('0x4'));var BPromise=require(_0xc468('0x5'));var Mustache=require(_0xc468('0x6'));var util=require('util');var path=require(_0xc468('0x7'));var sox=require('sox');var csv=require(_0xc468('0x8'));var ejs=require(_0xc468('0x9'));var fs=require('fs');var fs_extra=require(_0xc468('0xa'));var _=require(_0xc468('0xb'));var squel=require('squel');var crypto=require(_0xc468('0xc'));var jsforce=require(_0xc468('0xd'));var deskjs=require(_0xc468('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc468('0xf'));var Papa=require(_0xc468('0x10'));var Redis=require(_0xc468('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xc468('0x12'));var as=require(_0xc468('0x13'));var hardwareService=require(_0xc468('0x14'));var logger=require(_0xc468('0x15'))(_0xc468('0x16'));var utils=require(_0xc468('0x17'));var config=require(_0xc468('0x18'));var licenseUtil=require(_0xc468('0x19'));var db=require(_0xc468('0x1a'))['db'];config['redis']=_[_0xc468('0x1b')](config[_0xc468('0x1c')],{'host':_0xc468('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc468('0x1c')]));require(_0xc468('0x1e'))[_0xc468('0x1f')](socket);function respondWithStatusCode(_0x1d5e9a,_0x2ae55b){_0x2ae55b=_0x2ae55b||0xcc;return function(_0x33a2b8){if(_0x33a2b8){return _0x1d5e9a[_0xc468('0x20')](_0x2ae55b);}return _0x1d5e9a['status'](_0x2ae55b)['end']();};}function respondWithResult(_0x5e48e9,_0x376012){_0x376012=_0x376012||0xc8;return function(_0x1b831c){if(_0x1b831c){return _0x5e48e9[_0xc468('0x21')](_0x376012)['json'](_0x1b831c);}};}function respondWithFilteredResult(_0x207bb8,_0x2c3065){return function(_0x3d24a6){if(_0x3d24a6){var _0x2526a0=typeof _0x2c3065[_0xc468('0x22')]==='undefined'&&typeof _0x2c3065[_0xc468('0x23')]===_0xc468('0x24');var _0x224524=_0x3d24a6[_0xc468('0x25')];var _0x5d2551=_0x2526a0?0x0:_0x2c3065['offset'];var _0x4323b3=_0x2526a0?_0x3d24a6[_0xc468('0x25')]:_0x2c3065[_0xc468('0x22')]+_0x2c3065[_0xc468('0x23')];var _0x36f711;if(_0x4323b3>=_0x224524){_0x4323b3=_0x224524;_0x36f711=0xc8;}else{_0x36f711=0xce;}_0x207bb8['status'](_0x36f711);return _0x207bb8[_0xc468('0x26')](_0xc468('0x27'),_0x5d2551+'-'+_0x4323b3+'/'+_0x224524)[_0xc468('0x28')](_0x3d24a6);}return null;};}function patchUpdates(_0x259029){return function(_0x1ba807){try{jsonpatch[_0xc468('0x29')](_0x1ba807,_0x259029,!![]);}catch(_0x21a246){return BPromise[_0xc468('0x2a')](_0x21a246);}return _0x1ba807[_0xc468('0x2b')]();};}function saveUpdates(_0x3c455b,_0x349faa){return function(_0x3731c4){if(_0x3731c4){return _0x3731c4[_0xc468('0x2c')](_0x3c455b)[_0xc468('0x2d')](function(_0x45413f){return _0x45413f;});}return null;};}function removeEntity(_0x548289,_0x2e17fd){return function(_0x27d8cd){if(_0x27d8cd){return _0x27d8cd[_0xc468('0x2e')]()[_0xc468('0x2d')](function(){var _0x3ba971=_0x27d8cd[_0xc468('0x2f')]({'plain':!![]});var _0x50e586=_0xc468('0x30');return db[_0xc468('0x31')][_0xc468('0x2e')]({'where':{'type':_0x50e586,'resourceId':_0x3ba971['id']}})['then'](function(){return _0x27d8cd;});})[_0xc468('0x2d')](function(){_0x548289[_0xc468('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x190e40,_0xb74ad0){return function(_0x213b92){if(!_0x213b92){_0x190e40[_0xc468('0x20')](0x194);}return _0x213b92;};}function handleError(_0x417e50,_0x122665){_0x122665=_0x122665||0x1f4;return function(_0x3935ae){logger[_0xc468('0x32')](_0x3935ae[_0xc468('0x33')]);if(_0x3935ae['name']){delete _0x3935ae[_0xc468('0x34')];}_0x417e50[_0xc468('0x21')](_0x122665)[_0xc468('0x35')](_0x3935ae);};}exports[_0xc468('0x36')]=function(_0x2ad87f,_0x4547d1){var _0x49adea={},_0x10e72b={},_0x5e0254={'count':0x0,'rows':[]};var _0x59dd60=_['map'](db['Dashboard'][_0xc468('0x37')],function(_0x1e503f){return{'name':_0x1e503f['fieldName'],'type':_0x1e503f['type']['key']};});_0x10e72b[_0xc468('0x38')]=_[_0xc468('0x39')](_0x59dd60,_0xc468('0x34'));_0x10e72b[_0xc468('0x3a')]=_[_0xc468('0x3b')](_0x2ad87f[_0xc468('0x3a')]);_0x10e72b['filters']=_['intersection'](_0x10e72b[_0xc468('0x38')],_0x10e72b[_0xc468('0x3a')]);_0x49adea[_0xc468('0x3c')]=_['intersection'](_0x10e72b[_0xc468('0x38')],qs[_0xc468('0x3d')](_0x2ad87f[_0xc468('0x3a')][_0xc468('0x3d')]));_0x49adea[_0xc468('0x3c')]=_0x49adea[_0xc468('0x3c')]['length']?_0x49adea[_0xc468('0x3c')]:_0x10e72b[_0xc468('0x38')];if(!_0x2ad87f[_0xc468('0x3a')][_0xc468('0x3e')](_0xc468('0x3f'))){_0x49adea[_0xc468('0x23')]=qs[_0xc468('0x23')](_0x2ad87f[_0xc468('0x3a')][_0xc468('0x23')]);_0x49adea['offset']=qs[_0xc468('0x22')](_0x2ad87f['query'][_0xc468('0x22')]);}_0x49adea['order']=qs[_0xc468('0x40')](_0x2ad87f['query'][_0xc468('0x40')]);_0x49adea[_0xc468('0x41')]=qs[_0xc468('0x42')](_['pick'](_0x2ad87f[_0xc468('0x3a')],_0x10e72b[_0xc468('0x42')]),_0x59dd60);if(_0x2ad87f[_0xc468('0x3a')][_0xc468('0x43')]){_0x49adea[_0xc468('0x41')]=_[_0xc468('0x44')](_0x49adea[_0xc468('0x41')],{'$or':_[_0xc468('0x39')](_0x59dd60,function(_0x1ec8c6){if(_0x1ec8c6['type']!==_0xc468('0x45')){var _0x337322={};_0x337322[_0x1ec8c6[_0xc468('0x34')]]={'$like':'%'+_0x2ad87f['query'][_0xc468('0x43')]+'%'};return _0x337322;}})});}_0x49adea=_[_0xc468('0x44')]({},_0x49adea,_0x2ad87f[_0xc468('0x46')]);var _0xdaa08c={'where':_0x49adea[_0xc468('0x41')]};return db[_0xc468('0x47')][_0xc468('0x25')](_0xdaa08c)[_0xc468('0x2d')](function(_0x5139e0){_0x5e0254[_0xc468('0x25')]=_0x5139e0;if(_0x2ad87f[_0xc468('0x3a')][_0xc468('0x48')]){_0x49adea[_0xc468('0x49')]=[{'all':!![]}];}return db[_0xc468('0x47')][_0xc468('0x4a')](_0x49adea);})[_0xc468('0x2d')](function(_0x15317d){_0x5e0254[_0xc468('0x4b')]=_0x15317d;return _0x5e0254;})[_0xc468('0x2d')](respondWithFilteredResult(_0x4547d1,_0x49adea))['catch'](handleError(_0x4547d1,null));};exports[_0xc468('0x4c')]=function(_0x4e1469,_0xe33d84){var _0xed1c04={'raw':![],'where':{'id':_0x4e1469[_0xc468('0x4d')]['id']}},_0x43a79e={};_0x43a79e[_0xc468('0x38')]=_['keys'](db[_0xc468('0x47')][_0xc468('0x37')]);_0x43a79e['query']=_['keys'](_0x4e1469[_0xc468('0x3a')]);_0x43a79e[_0xc468('0x42')]=_[_0xc468('0x4e')](_0x43a79e['model'],_0x43a79e[_0xc468('0x3a')]);_0xed1c04[_0xc468('0x3c')]=_[_0xc468('0x4e')](_0x43a79e[_0xc468('0x38')],qs[_0xc468('0x3d')](_0x4e1469['query'][_0xc468('0x3d')]));_0xed1c04[_0xc468('0x3c')]=_0xed1c04[_0xc468('0x3c')][_0xc468('0x4f')]?_0xed1c04[_0xc468('0x3c')]:_0x43a79e['model'];if(_0x4e1469['query'][_0xc468('0x48')]){_0xed1c04['include']=[{'all':!![]}];}_0xed1c04=_[_0xc468('0x44')]({},_0xed1c04,_0x4e1469[_0xc468('0x46')]);return db[_0xc468('0x47')][_0xc468('0x50')](_0xed1c04)['then'](handleEntityNotFound(_0xe33d84,null))[_0xc468('0x2d')](respondWithResult(_0xe33d84,null))[_0xc468('0x51')](handleError(_0xe33d84,null));};exports[_0xc468('0x52')]=function(_0x1a36a7,_0x123800){return db['Dashboard'][_0xc468('0x52')](_0x1a36a7['body'],{})[_0xc468('0x2d')](function(_0x35b5f5){var _0x3f7bea=_0x1a36a7['user'][_0xc468('0x2f')]({'plain':!![]});if(!_0x3f7bea)throw new Error(_0xc468('0x53'));if(_0x3f7bea[_0xc468('0x54')]===_0xc468('0x55')){var _0x282e1d=_0x35b5f5[_0xc468('0x2f')]({'plain':!![]});var _0x41415f=_0xc468('0x30');return db[_0xc468('0x56')]['find']({'where':{'name':_0x41415f,'userProfileId':_0x3f7bea[_0xc468('0x57')]},'raw':!![]})[_0xc468('0x2d')](function(_0x1cc054){if(_0x1cc054&&_0x1cc054[_0xc468('0x58')]===0x0){return db['UserProfileResource'][_0xc468('0x52')]({'name':_0x282e1d[_0xc468('0x34')],'resourceId':_0x282e1d['id'],'type':_0x1cc054[_0xc468('0x34')],'sectionId':_0x1cc054['id']},{})[_0xc468('0x2d')](function(){return _0x35b5f5;});}else{return _0x35b5f5;}})['catch'](function(_0x379214){logger[_0xc468('0x32')](_0xc468('0x59'),_0x379214);throw _0x379214;});}return _0x35b5f5;})['then'](respondWithResult(_0x123800,0xc9))[_0xc468('0x51')](handleError(_0x123800,null));};exports[_0xc468('0x5a')]=function(_0x5f55ba,_0xc772ef){var _0x452756={'where':{'id':_0x5f55ba[_0xc468('0x4d')]['id']}},_0x12d478={};_0x12d478[_0xc468('0x38')]=_[_0xc468('0x3b')](db[_0xc468('0x47')][_0xc468('0x37')]);_0x452756[_0xc468('0x3c')]=_[_0xc468('0x4e')](_0x12d478[_0xc468('0x38')],qs['fields'](_0x5f55ba[_0xc468('0x3a')][_0xc468('0x3d')]));_0x452756[_0xc468('0x3c')]=_0x452756[_0xc468('0x3c')][_0xc468('0x4f')]?_0x452756[_0xc468('0x3c')]:_0x12d478[_0xc468('0x38')];if(_0x5f55ba['query']['includeAll']){_0x452756['include']=[{'all':!![]}];}_0x452756=_['merge']({},_0x452756,_0x5f55ba[_0xc468('0x46')]);return db[_0xc468('0x47')][_0xc468('0x50')](_0x452756)[_0xc468('0x2d')](handleEntityNotFound(_0xc772ef,null))[_0xc468('0x2d')](function(_0x5e22c9){if(_0x5e22c9){var _0x43b74c=_0x5e22c9[_0xc468('0x2f')]({'plain':!![]});_0x43b74c=qs[_0xc468('0x5b')](_0x43b74c,['id',_0xc468('0x5c'),_0xc468('0x5d')]);_0x5f55ba[_0xc468('0x5e')]=_[_0xc468('0x5b')](_0x5f55ba[_0xc468('0x5e')],['id',_0xc468('0x5c'),'updatedAt']);return db[_0xc468('0x47')][_0xc468('0x52')](_[_0xc468('0x44')](_0x43b74c,_0x5f55ba['body']),{'include':_0x5f55ba['query'][_0xc468('0x48')]?[{'all':!![]}]:undefined})[_0xc468('0x2d')](function(_0x26a522){var _0x45baef=_0x5f55ba['user'][_0xc468('0x2f')]({'plain':!![]});if(!_0x45baef)throw new Error(_0xc468('0x53'));if(_0x45baef[_0xc468('0x54')]===_0xc468('0x55')){var _0x2c19bd=_0x26a522[_0xc468('0x2f')]({'plain':!![]});var _0x4d2f25=_0xc468('0x30');return db['UserProfileSection']['find']({'where':{'name':_0x4d2f25,'userProfileId':_0x45baef[_0xc468('0x57')]},'raw':!![]})['then'](function(_0x8f1b6e){if(_0x8f1b6e&&_0x8f1b6e[_0xc468('0x58')]===0x0){return db[_0xc468('0x31')][_0xc468('0x52')]({'name':_0x2c19bd['name'],'resourceId':_0x2c19bd['id'],'type':_0x8f1b6e[_0xc468('0x34')],'sectionId':_0x8f1b6e['id']},{})['then'](function(){return _0x26a522;});}else{return _0x26a522;}})[_0xc468('0x51')](function(_0x279d10){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x279d10);throw _0x279d10;});}return _0x26a522;});}})['then'](respondWithResult(_0xc772ef,0xc9))[_0xc468('0x51')](handleError(_0xc772ef,null));};exports['update']=function(_0x2e21c0,_0x3f7841){if(_0x2e21c0['body']['id']){delete _0x2e21c0[_0xc468('0x5e')]['id'];}return db[_0xc468('0x47')][_0xc468('0x50')]({'where':{'id':_0x2e21c0['params']['id']}})['then'](handleEntityNotFound(_0x3f7841,null))[_0xc468('0x2d')](saveUpdates(_0x2e21c0[_0xc468('0x5e')],null))[_0xc468('0x2d')](respondWithResult(_0x3f7841,null))[_0xc468('0x51')](handleError(_0x3f7841,null));};exports[_0xc468('0x2e')]=function(_0x5143af,_0xd621c7){return db[_0xc468('0x47')][_0xc468('0x50')]({'where':{'id':_0x5143af[_0xc468('0x4d')]['id']}})[_0xc468('0x2d')](handleEntityNotFound(_0xd621c7,null))[_0xc468('0x2d')](removeEntity(_0xd621c7,null))['catch'](handleError(_0xd621c7,null));};function widgetAttributes(_0x1cfaf1){try{switch(_0x1cfaf1[_0xc468('0x5f')]){case _0xc468('0x60'):return[{'name':_0xc468('0x61'),'value':_0x1cfaf1[_0xc468('0x61')]||(_0x1cfaf1[_0xc468('0x62')]&&_0x1cfaf1['attrs'][0x0]?_0x1cfaf1['attrs'][0x0]['value']:undefined)||_0xc468('0x63')}];case _0xc468('0x64'):return[{'name':_0xc468('0x65'),'value':_0x1cfaf1[_0xc468('0x65')]||(_0x1cfaf1[_0xc468('0x62')]&&_0x1cfaf1[_0xc468('0x62')][0x0]?_0x1cfaf1[_0xc468('0x62')][0x0][_0xc468('0x66')]:undefined)||''}];case _0xc468('0x67'):return[{'name':'attrHourFormat','value':_0x1cfaf1[_0xc468('0x68')]||(_0x1cfaf1[_0xc468('0x62')]&&_0x1cfaf1[_0xc468('0x62')][0x0]?_0x1cfaf1[_0xc468('0x62')][0x0][_0xc468('0x66')]:undefined)||_0xc468('0x69')},{'name':_0xc468('0x6a'),'value':_0x1cfaf1[_0xc468('0x6a')]||(_0x1cfaf1[_0xc468('0x62')]&&_0x1cfaf1['attrs'][0x1]?_0x1cfaf1[_0xc468('0x62')][0x1]['value']:undefined)||_0xc468('0x6b')},{'name':'attrFontSize','value':_0x1cfaf1['attrFontSize']||(_0x1cfaf1[_0xc468('0x62')]&&_0x1cfaf1[_0xc468('0x62')][0x2]?_0x1cfaf1['attrs'][0x2][_0xc468('0x66')]:undefined)||0xc}];case _0xc468('0x6c'):return[{'name':'attrMetric','value':_0x1cfaf1['attrMetric']||(_0x1cfaf1['attrs']&&_0x1cfaf1[_0xc468('0x62')][0x0]?_0x1cfaf1[_0xc468('0x62')][0x0][_0xc468('0x66')]:undefined)||_0xc468('0x6d')},{'name':'attrVoiceQueues','value':_0x1cfaf1[_0xc468('0x6e')]||(_0x1cfaf1['attrs']&&_0x1cfaf1['attrs'][0x1]?_0x1cfaf1[_0xc468('0x62')][0x1]['value']:undefined)||[]},{'name':_0xc468('0x6f'),'value':_0x1cfaf1[_0xc468('0x6f')]||(_0x1cfaf1['attrs']&&_0x1cfaf1[_0xc468('0x62')][0x2]?_0x1cfaf1[_0xc468('0x62')][0x2][_0xc468('0x66')]:undefined)||0x14},{'name':_0xc468('0x70'),'value':_0x1cfaf1['attrChannel']||(_0x1cfaf1[_0xc468('0x62')]&&_0x1cfaf1['attrs'][0x3]?_0x1cfaf1[_0xc468('0x62')][0x3][_0xc468('0x66')]:undefined)||_0xc468('0x71')},{'name':_0xc468('0x72'),'value':_0x1cfaf1[_0xc468('0x72')]||(_0x1cfaf1[_0xc468('0x62')]&&_0x1cfaf1[_0xc468('0x62')][0x4]?_0x1cfaf1[_0xc468('0x62')][0x4]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x1cfaf1[_0xc468('0x73')]||(_0x1cfaf1['attrs']&&_0x1cfaf1[_0xc468('0x62')][0x5]?_0x1cfaf1[_0xc468('0x62')][0x5][_0xc468('0x66')]:undefined)||''},{'name':_0xc468('0x74'),'value':_0x1cfaf1[_0xc468('0x74')]||(_0x1cfaf1[_0xc468('0x62')]&&_0x1cfaf1[_0xc468('0x62')][0x6]?_0x1cfaf1[_0xc468('0x62')][0x6][_0xc468('0x66')]:undefined)||''},{'name':_0xc468('0x75'),'value':_0x1cfaf1[_0xc468('0x75')]||(_0x1cfaf1['attrs']&&_0x1cfaf1[_0xc468('0x62')][0x7]?_0x1cfaf1['attrs'][0x7][_0xc468('0x66')]:undefined)||''},{'name':_0xc468('0x76'),'value':_0x1cfaf1[_0xc468('0x76')]||(_0x1cfaf1['attrs']&&_0x1cfaf1[_0xc468('0x62')][0x8]?_0x1cfaf1[_0xc468('0x62')][0x8][_0xc468('0x66')]:undefined)||''},{'name':'attrChatWebsites','value':_0x1cfaf1[_0xc468('0x77')]||(_0x1cfaf1[_0xc468('0x62')]&&_0x1cfaf1[_0xc468('0x62')][0x9]?_0x1cfaf1[_0xc468('0x62')][0x9][_0xc468('0x66')]:undefined)||''}];case _0xc468('0x78'):case _0xc468('0x79'):return[{'name':_0xc468('0x7a'),'value':_0x1cfaf1[_0xc468('0x7a')]||(_0x1cfaf1[_0xc468('0x62')]&&_0x1cfaf1[_0xc468('0x62')][0x0]?_0x1cfaf1['attrs'][0x0]['value']:undefined)||'total'},{'name':_0xc468('0x7b'),'value':_0x1cfaf1[_0xc468('0x7b')]||(_0x1cfaf1[_0xc468('0x62')]&&_0x1cfaf1[_0xc468('0x62')][0x1]?_0x1cfaf1[_0xc468('0x62')][0x1]['value']:undefined)||null},{'name':_0xc468('0x7c'),'value':_0x1cfaf1[_0xc468('0x7c')]||(_0x1cfaf1[_0xc468('0x62')]&&_0x1cfaf1[_0xc468('0x62')][0x2]?_0x1cfaf1[_0xc468('0x62')][0x2][_0xc468('0x66')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x1cfaf1[_0xc468('0x6e')]||(_0x1cfaf1['attrs']&&_0x1cfaf1['attrs'][0x3]?_0x1cfaf1[_0xc468('0x62')][0x3][_0xc468('0x66')]:undefined)||[]},{'name':'attrChannel','value':_0x1cfaf1[_0xc468('0x70')]||(_0x1cfaf1[_0xc468('0x62')]&&_0x1cfaf1[_0xc468('0x62')][0x4]?_0x1cfaf1['attrs'][0x4][_0xc468('0x66')]:undefined)||_0xc468('0x71')},{'name':_0xc468('0x72'),'value':_0x1cfaf1[_0xc468('0x72')]||(_0x1cfaf1[_0xc468('0x62')]&&_0x1cfaf1[_0xc468('0x62')][0x5]?_0x1cfaf1[_0xc468('0x62')][0x5]['value']:undefined)||''},{'name':_0xc468('0x73'),'value':_0x1cfaf1[_0xc468('0x73')]||(_0x1cfaf1[_0xc468('0x62')]&&_0x1cfaf1['attrs'][0x6]?_0x1cfaf1['attrs'][0x6][_0xc468('0x66')]:undefined)||''},{'name':_0xc468('0x74'),'value':_0x1cfaf1[_0xc468('0x74')]||(_0x1cfaf1[_0xc468('0x62')]&&_0x1cfaf1[_0xc468('0x62')][0x7]?_0x1cfaf1[_0xc468('0x62')][0x7][_0xc468('0x66')]:undefined)||''},{'name':_0xc468('0x75'),'value':_0x1cfaf1[_0xc468('0x75')]||(_0x1cfaf1[_0xc468('0x62')]&&_0x1cfaf1[_0xc468('0x62')][0x8]?_0x1cfaf1['attrs'][0x8][_0xc468('0x66')]:undefined)||''},{'name':_0xc468('0x76'),'value':_0x1cfaf1[_0xc468('0x76')]||(_0x1cfaf1[_0xc468('0x62')]&&_0x1cfaf1[_0xc468('0x62')][0x9]?_0x1cfaf1['attrs'][0x9][_0xc468('0x66')]:undefined)||''},{'name':'attrChatWebsites','value':_0x1cfaf1[_0xc468('0x77')]||(_0x1cfaf1[_0xc468('0x62')]&&_0x1cfaf1[_0xc468('0x62')][0xa]?_0x1cfaf1[_0xc468('0x62')][0xa][_0xc468('0x66')]:undefined)||''}];case _0xc468('0x7d'):return[{'name':_0xc468('0x7e'),'type':_0x1cfaf1[_0xc468('0x7f')]||(_0x1cfaf1[_0xc468('0x62')]&&_0x1cfaf1[_0xc468('0x62')][0x0]?_0x1cfaf1[_0xc468('0x62')][0x0][_0xc468('0x5f')]:undefined)||null,'value':_0x1cfaf1[_0xc468('0x7e')]||(_0x1cfaf1['attrs']&&_0x1cfaf1['attrs'][0x0]?_0x1cfaf1[_0xc468('0x62')][0x0][_0xc468('0x66')]:undefined)||null},{'name':'attrRefresh','value':_0x1cfaf1['attrRefresh']||(_0x1cfaf1[_0xc468('0x62')]&&_0x1cfaf1['attrs'][0x1]?_0x1cfaf1[_0xc468('0x62')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x15f0dd){logger[_0xc468('0x32')](_0xc468('0x80'),JSON[_0xc468('0x81')](_0x15f0dd));return[];}}exports[_0xc468('0x82')]=function(_0x4587d5,_0x1bdf18,_0x29f4ad){if(_0x4587d5['body']['id']){delete _0x4587d5[_0xc468('0x5e')]['id'];}return db['Dashboard'][_0xc468('0x50')]({'where':{'id':_0x4587d5[_0xc468('0x4d')]['id']}})[_0xc468('0x2d')](handleEntityNotFound(_0x1bdf18,null))[_0xc468('0x2d')](function(_0x18a0a4){if(_0x18a0a4){_0x4587d5[_0xc468('0x5e')]['DashboardId']=_0x18a0a4['id'];_0x4587d5[_0xc468('0x5e')][_0xc468('0x62')]=widgetAttributes(_0x4587d5[_0xc468('0x5e')]);return db[_0xc468('0x83')][_0xc468('0x52')](_0x4587d5['body']);}})[_0xc468('0x2d')](respondWithResult(_0x1bdf18,null))[_0xc468('0x51')](handleError(_0x1bdf18,null));};exports[_0xc468('0x84')]=function(_0x1b90aa,_0x383cc5,_0x4e282e){var _0x3f8321={};var _0x8657f8={};var _0x59c66e;var _0x52dae7;return db[_0xc468('0x47')][_0xc468('0x85')]({'where':{'id':_0x1b90aa[_0xc468('0x4d')]['id']}})[_0xc468('0x2d')](handleEntityNotFound(_0x383cc5,null))['then'](function(_0x12dd01){if(_0x12dd01){_0x59c66e=_0x12dd01;_0x8657f8[_0xc468('0x38')]=_[_0xc468('0x3b')](db[_0xc468('0x83')][_0xc468('0x37')]);_0x8657f8['query']=_[_0xc468('0x3b')](_0x1b90aa[_0xc468('0x3a')]);_0x8657f8[_0xc468('0x42')]=_[_0xc468('0x4e')](_0x8657f8[_0xc468('0x38')],_0x8657f8['query']);_0x3f8321[_0xc468('0x3c')]=_[_0xc468('0x4e')](_0x8657f8['model'],qs[_0xc468('0x3d')](_0x1b90aa[_0xc468('0x3a')][_0xc468('0x3d')]));_0x3f8321[_0xc468('0x3c')]=_0x3f8321['attributes'][_0xc468('0x4f')]?_0x3f8321['attributes']:_0x8657f8[_0xc468('0x38')];_0x3f8321['order']=qs[_0xc468('0x40')](_0x1b90aa[_0xc468('0x3a')][_0xc468('0x40')]);_0x3f8321[_0xc468('0x41')]=qs[_0xc468('0x42')](_[_0xc468('0x86')](_0x1b90aa['query'],_0x8657f8[_0xc468('0x42')]));if(_0x1b90aa['query']['filter']){_0x3f8321[_0xc468('0x41')]=_[_0xc468('0x44')](_0x3f8321['where'],{'$or':_['map'](_0x3f8321[_0xc468('0x3c')],function(_0x40b266){var _0x1dc1cd={};_0x1dc1cd[_0x40b266]={'$like':'%'+_0x1b90aa[_0xc468('0x3a')][_0xc468('0x43')]+'%'};return _0x1dc1cd;})});}_0x3f8321=_[_0xc468('0x44')]({},_0x3f8321,_0x1b90aa[_0xc468('0x46')]);return _0x59c66e[_0xc468('0x84')](_0x3f8321);}})[_0xc468('0x2d')](function(_0x2c45b2){if(_0x2c45b2){_0x52dae7=_0x2c45b2['length'];if(!_0x1b90aa[_0xc468('0x3a')][_0xc468('0x3e')](_0xc468('0x3f'))){_0x3f8321[_0xc468('0x23')]=qs[_0xc468('0x23')](_0x1b90aa['query'][_0xc468('0x23')]);_0x3f8321[_0xc468('0x22')]=qs[_0xc468('0x22')](_0x1b90aa[_0xc468('0x3a')]['offset']);}return _0x59c66e[_0xc468('0x84')](_0x3f8321);}})[_0xc468('0x2d')](function(_0xd8ac2f){if(_0xd8ac2f){return _0xd8ac2f?{'count':_0x52dae7,'rows':_0xd8ac2f}:null;}})[_0xc468('0x2d')](respondWithResult(_0x383cc5,null))['catch'](handleError(_0x383cc5,null));}; \ No newline at end of file +var _0xde3d=['index','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','filter','merge','options','include','findAll','rows','catch','show','params','Dashboard','includeAll','find','create','body','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','iframe','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrSmsAccounts','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardItem','getItems','findOne','order','hasOwnProperty','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/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','get','UserProfileResource','destroy','sendStatus','error','stack','name','send'];(function(_0x2b439e,_0xf3139){var _0x186653=function(_0x16e546){while(--_0x16e546){_0x2b439e['push'](_0x2b439e['shift']());}};_0x186653(++_0xf3139);}(_0xde3d,0x15c));var _0xdde3=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xde3d[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0xdde3('0x0'));var rimraf=require(_0xdde3('0x1'));var zipdir=require(_0xdde3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdde3('0x3'));var moment=require(_0xdde3('0x4'));var BPromise=require(_0xdde3('0x5'));var Mustache=require(_0xdde3('0x6'));var util=require(_0xdde3('0x7'));var path=require(_0xdde3('0x8'));var sox=require(_0xdde3('0x9'));var csv=require(_0xdde3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdde3('0xb'));var _=require(_0xdde3('0xc'));var squel=require(_0xdde3('0xd'));var crypto=require(_0xdde3('0xe'));var jsforce=require(_0xdde3('0xf'));var deskjs=require(_0xdde3('0x10'));var toCsv=require(_0xdde3('0xa'));var querystring=require(_0xdde3('0x11'));var Papa=require(_0xdde3('0x12'));var Redis=require(_0xdde3('0x13'));var authService=require(_0xdde3('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xdde3('0x15'));var hardwareService=require(_0xdde3('0x16'));var logger=require(_0xdde3('0x17'))(_0xdde3('0x18'));var utils=require('../../config/utils');var config=require(_0xdde3('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xdde3('0x1a'))['db'];config[_0xdde3('0x1b')]=_[_0xdde3('0x1c')](config[_0xdde3('0x1b')],{'host':_0xdde3('0x1d'),'port':0x18eb});var socket=require(_0xdde3('0x1e'))(new Redis(config[_0xdde3('0x1b')]));require(_0xdde3('0x1f'))[_0xdde3('0x20')](socket);function respondWithStatusCode(_0x209a23,_0x5d4b7c){_0x5d4b7c=_0x5d4b7c||0xcc;return function(_0x188cb2){if(_0x188cb2){return _0x209a23['sendStatus'](_0x5d4b7c);}return _0x209a23[_0xdde3('0x21')](_0x5d4b7c)[_0xdde3('0x22')]();};}function respondWithResult(_0x101015,_0x57b326){_0x57b326=_0x57b326||0xc8;return function(_0x1f7084){if(_0x1f7084){return _0x101015['status'](_0x57b326)[_0xdde3('0x23')](_0x1f7084);}};}function respondWithFilteredResult(_0x42ebc9,_0x5bf2ab){return function(_0x59f995){if(_0x59f995){var _0x19a717=typeof _0x5bf2ab[_0xdde3('0x24')]===_0xdde3('0x25')&&typeof _0x5bf2ab[_0xdde3('0x26')]==='undefined';var _0x5c8619=_0x59f995[_0xdde3('0x27')];var _0x4d0dca=_0x19a717?0x0:_0x5bf2ab['offset'];var _0x3ad6db=_0x19a717?_0x59f995['count']:_0x5bf2ab[_0xdde3('0x24')]+_0x5bf2ab['limit'];var _0x1d5c42;if(_0x3ad6db>=_0x5c8619){_0x3ad6db=_0x5c8619;_0x1d5c42=0xc8;}else{_0x1d5c42=0xce;}_0x42ebc9[_0xdde3('0x21')](_0x1d5c42);return _0x42ebc9[_0xdde3('0x28')](_0xdde3('0x29'),_0x4d0dca+'-'+_0x3ad6db+'/'+_0x5c8619)[_0xdde3('0x23')](_0x59f995);}return null;};}function patchUpdates(_0x13f402){return function(_0x1f6256){try{jsonpatch['apply'](_0x1f6256,_0x13f402,!![]);}catch(_0x1a0808){return BPromise[_0xdde3('0x2a')](_0x1a0808);}return _0x1f6256[_0xdde3('0x2b')]();};}function saveUpdates(_0x1c14f5,_0x241302){return function(_0x31d18e){if(_0x31d18e){return _0x31d18e[_0xdde3('0x2c')](_0x1c14f5)[_0xdde3('0x2d')](function(_0x1187e0){return _0x1187e0;});}return null;};}function removeEntity(_0x422aff,_0x295eaa){return function(_0x3758f5){if(_0x3758f5){return _0x3758f5['destroy']()['then'](function(){var _0x3ac918=_0x3758f5[_0xdde3('0x2e')]({'plain':!![]});var _0x1a20f3='CustomDashboards';return db[_0xdde3('0x2f')][_0xdde3('0x30')]({'where':{'type':_0x1a20f3,'resourceId':_0x3ac918['id']}})[_0xdde3('0x2d')](function(){return _0x3758f5;});})[_0xdde3('0x2d')](function(){_0x422aff[_0xdde3('0x21')](0xcc)[_0xdde3('0x22')]();});}};}function handleEntityNotFound(_0xa20522,_0x22fa61){return function(_0x4ca8f6){if(!_0x4ca8f6){_0xa20522[_0xdde3('0x31')](0x194);}return _0x4ca8f6;};}function handleError(_0x881dd1,_0x323931){_0x323931=_0x323931||0x1f4;return function(_0x242352){logger[_0xdde3('0x32')](_0x242352[_0xdde3('0x33')]);if(_0x242352[_0xdde3('0x34')]){delete _0x242352[_0xdde3('0x34')];}_0x881dd1[_0xdde3('0x21')](_0x323931)[_0xdde3('0x35')](_0x242352);};}exports[_0xdde3('0x36')]=function(_0x15f11b,_0x3cd4d7){var _0x839ec0={},_0x46453e={},_0x238b57={'count':0x0,'rows':[]};var _0x2bec28=_[_0xdde3('0x37')](db['Dashboard'][_0xdde3('0x38')],function(_0x3e6ec9){return{'name':_0x3e6ec9[_0xdde3('0x39')],'type':_0x3e6ec9[_0xdde3('0x3a')][_0xdde3('0x3b')]};});_0x46453e[_0xdde3('0x3c')]=_['map'](_0x2bec28,_0xdde3('0x34'));_0x46453e['query']=_[_0xdde3('0x3d')](_0x15f11b[_0xdde3('0x3e')]);_0x46453e['filters']=_[_0xdde3('0x3f')](_0x46453e['model'],_0x46453e[_0xdde3('0x3e')]);_0x839ec0[_0xdde3('0x40')]=_[_0xdde3('0x3f')](_0x46453e[_0xdde3('0x3c')],qs[_0xdde3('0x41')](_0x15f11b[_0xdde3('0x3e')][_0xdde3('0x41')]));_0x839ec0[_0xdde3('0x40')]=_0x839ec0[_0xdde3('0x40')][_0xdde3('0x42')]?_0x839ec0[_0xdde3('0x40')]:_0x46453e[_0xdde3('0x3c')];if(!_0x15f11b['query']['hasOwnProperty'](_0xdde3('0x43'))){_0x839ec0['limit']=qs['limit'](_0x15f11b[_0xdde3('0x3e')]['limit']);_0x839ec0[_0xdde3('0x24')]=qs[_0xdde3('0x24')](_0x15f11b[_0xdde3('0x3e')][_0xdde3('0x24')]);}_0x839ec0['order']=qs[_0xdde3('0x44')](_0x15f11b[_0xdde3('0x3e')][_0xdde3('0x44')]);_0x839ec0[_0xdde3('0x45')]=qs[_0xdde3('0x46')](_[_0xdde3('0x47')](_0x15f11b[_0xdde3('0x3e')],_0x46453e[_0xdde3('0x46')]),_0x2bec28);if(_0x15f11b[_0xdde3('0x3e')][_0xdde3('0x48')]){_0x839ec0[_0xdde3('0x45')]=_['merge'](_0x839ec0[_0xdde3('0x45')],{'$or':_['map'](_0x2bec28,function(_0x1905a7){if(_0x1905a7['type']!=='VIRTUAL'){var _0x34b69d={};_0x34b69d[_0x1905a7[_0xdde3('0x34')]]={'$like':'%'+_0x15f11b['query'][_0xdde3('0x48')]+'%'};return _0x34b69d;}})});}_0x839ec0=_[_0xdde3('0x49')]({},_0x839ec0,_0x15f11b[_0xdde3('0x4a')]);var _0x2ea2b8={'where':_0x839ec0[_0xdde3('0x45')]};return db['Dashboard'][_0xdde3('0x27')](_0x2ea2b8)['then'](function(_0x8b89b4){_0x238b57[_0xdde3('0x27')]=_0x8b89b4;if(_0x15f11b[_0xdde3('0x3e')]['includeAll']){_0x839ec0[_0xdde3('0x4b')]=[{'all':!![]}];}return db['Dashboard'][_0xdde3('0x4c')](_0x839ec0);})[_0xdde3('0x2d')](function(_0x4a2f79){_0x238b57[_0xdde3('0x4d')]=_0x4a2f79;return _0x238b57;})[_0xdde3('0x2d')](respondWithFilteredResult(_0x3cd4d7,_0x839ec0))[_0xdde3('0x4e')](handleError(_0x3cd4d7,null));};exports[_0xdde3('0x4f')]=function(_0x49ac84,_0x1a4060){var _0x383eca={'raw':![],'where':{'id':_0x49ac84[_0xdde3('0x50')]['id']}},_0x594841={};_0x594841[_0xdde3('0x3c')]=_[_0xdde3('0x3d')](db[_0xdde3('0x51')]['rawAttributes']);_0x594841['query']=_[_0xdde3('0x3d')](_0x49ac84[_0xdde3('0x3e')]);_0x594841[_0xdde3('0x46')]=_[_0xdde3('0x3f')](_0x594841['model'],_0x594841['query']);_0x383eca['attributes']=_['intersection'](_0x594841['model'],qs[_0xdde3('0x41')](_0x49ac84[_0xdde3('0x3e')][_0xdde3('0x41')]));_0x383eca[_0xdde3('0x40')]=_0x383eca[_0xdde3('0x40')][_0xdde3('0x42')]?_0x383eca[_0xdde3('0x40')]:_0x594841[_0xdde3('0x3c')];if(_0x49ac84[_0xdde3('0x3e')][_0xdde3('0x52')]){_0x383eca[_0xdde3('0x4b')]=[{'all':!![]}];}_0x383eca=_[_0xdde3('0x49')]({},_0x383eca,_0x49ac84['options']);return db[_0xdde3('0x51')][_0xdde3('0x53')](_0x383eca)[_0xdde3('0x2d')](handleEntityNotFound(_0x1a4060,null))[_0xdde3('0x2d')](respondWithResult(_0x1a4060,null))[_0xdde3('0x4e')](handleError(_0x1a4060,null));};exports[_0xdde3('0x54')]=function(_0x53b667,_0x4750a2){return db[_0xdde3('0x51')][_0xdde3('0x54')](_0x53b667[_0xdde3('0x55')],{})[_0xdde3('0x2d')](function(_0x1040e5){var _0x16cf57=_0x53b667[_0xdde3('0x56')][_0xdde3('0x2e')]({'plain':!![]});if(!_0x16cf57)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x16cf57[_0xdde3('0x57')]===_0xdde3('0x56')){var _0x551c39=_0x1040e5[_0xdde3('0x2e')]({'plain':!![]});var _0xa750b8='CustomDashboards';return db[_0xdde3('0x58')][_0xdde3('0x53')]({'where':{'name':_0xa750b8,'userProfileId':_0x16cf57[_0xdde3('0x59')]},'raw':!![]})[_0xdde3('0x2d')](function(_0x476490){if(_0x476490&&_0x476490['autoAssociation']===0x0){return db[_0xdde3('0x2f')][_0xdde3('0x54')]({'name':_0x551c39[_0xdde3('0x34')],'resourceId':_0x551c39['id'],'type':_0x476490['name'],'sectionId':_0x476490['id']},{})[_0xdde3('0x2d')](function(){return _0x1040e5;});}else{return _0x1040e5;}})[_0xdde3('0x4e')](function(_0x20e43f){logger[_0xdde3('0x32')](_0xdde3('0x5a'),_0x20e43f);throw _0x20e43f;});}return _0x1040e5;})['then'](respondWithResult(_0x4750a2,0xc9))[_0xdde3('0x4e')](handleError(_0x4750a2,null));};exports[_0xdde3('0x5b')]=function(_0x9cc366,_0x154454){var _0x5f452d={'where':{'id':_0x9cc366[_0xdde3('0x50')]['id']}},_0x299324={};_0x299324['model']=_[_0xdde3('0x3d')](db[_0xdde3('0x51')]['rawAttributes']);_0x5f452d[_0xdde3('0x40')]=_[_0xdde3('0x3f')](_0x299324[_0xdde3('0x3c')],qs[_0xdde3('0x41')](_0x9cc366['query'][_0xdde3('0x41')]));_0x5f452d[_0xdde3('0x40')]=_0x5f452d[_0xdde3('0x40')][_0xdde3('0x42')]?_0x5f452d[_0xdde3('0x40')]:_0x299324[_0xdde3('0x3c')];if(_0x9cc366[_0xdde3('0x3e')][_0xdde3('0x52')]){_0x5f452d[_0xdde3('0x4b')]=[{'all':!![]}];}_0x5f452d=_['merge']({},_0x5f452d,_0x9cc366['options']);return db['Dashboard'][_0xdde3('0x53')](_0x5f452d)[_0xdde3('0x2d')](handleEntityNotFound(_0x154454,null))[_0xdde3('0x2d')](function(_0x5db34c){if(_0x5db34c){var _0x406364=_0x5db34c[_0xdde3('0x2e')]({'plain':!![]});_0x406364=qs[_0xdde3('0x5c')](_0x406364,['id',_0xdde3('0x5d'),_0xdde3('0x5e')]);_0x9cc366[_0xdde3('0x55')]=_[_0xdde3('0x5c')](_0x9cc366[_0xdde3('0x55')],['id','createdAt',_0xdde3('0x5e')]);return db[_0xdde3('0x51')][_0xdde3('0x54')](_[_0xdde3('0x49')](_0x406364,_0x9cc366[_0xdde3('0x55')]),{'include':_0x9cc366[_0xdde3('0x3e')][_0xdde3('0x52')]?[{'all':!![]}]:undefined})[_0xdde3('0x2d')](function(_0x4303a1){var _0x4dfceb=_0x9cc366['user']['get']({'plain':!![]});if(!_0x4dfceb)throw new Error(_0xdde3('0x5f'));if(_0x4dfceb[_0xdde3('0x57')]===_0xdde3('0x56')){var _0x4455f9=_0x4303a1[_0xdde3('0x2e')]({'plain':!![]});var _0x31cc29='CustomDashboards';return db[_0xdde3('0x58')][_0xdde3('0x53')]({'where':{'name':_0x31cc29,'userProfileId':_0x4dfceb[_0xdde3('0x59')]},'raw':!![]})[_0xdde3('0x2d')](function(_0x2bd43a){if(_0x2bd43a&&_0x2bd43a[_0xdde3('0x60')]===0x0){return db[_0xdde3('0x2f')]['create']({'name':_0x4455f9[_0xdde3('0x34')],'resourceId':_0x4455f9['id'],'type':_0x2bd43a['name'],'sectionId':_0x2bd43a['id']},{})[_0xdde3('0x2d')](function(){return _0x4303a1;});}else{return _0x4303a1;}})[_0xdde3('0x4e')](function(_0x24800b){logger['error'](_0xdde3('0x5a'),_0x24800b);throw _0x24800b;});}return _0x4303a1;});}})[_0xdde3('0x2d')](respondWithResult(_0x154454,0xc9))[_0xdde3('0x4e')](handleError(_0x154454,null));};exports['update']=function(_0x84a6f4,_0xdafa62){if(_0x84a6f4[_0xdde3('0x55')]['id']){delete _0x84a6f4[_0xdde3('0x55')]['id'];}return db[_0xdde3('0x51')][_0xdde3('0x53')]({'where':{'id':_0x84a6f4[_0xdde3('0x50')]['id']}})[_0xdde3('0x2d')](handleEntityNotFound(_0xdafa62,null))['then'](saveUpdates(_0x84a6f4[_0xdde3('0x55')],null))['then'](respondWithResult(_0xdafa62,null))[_0xdde3('0x4e')](handleError(_0xdafa62,null));};exports[_0xdde3('0x30')]=function(_0x38ac45,_0xd9814a){return db[_0xdde3('0x51')][_0xdde3('0x53')]({'where':{'id':_0x38ac45[_0xdde3('0x50')]['id']}})['then'](handleEntityNotFound(_0xd9814a,null))[_0xdde3('0x2d')](removeEntity(_0xd9814a,null))['catch'](handleError(_0xd9814a,null));};function widgetAttributes(_0x10d2f8){try{switch(_0x10d2f8[_0xdde3('0x3a')]){case _0xdde3('0x61'):return[{'name':_0xdde3('0x62'),'value':_0x10d2f8['attrUrl']||(_0x10d2f8['attrs']&&_0x10d2f8[_0xdde3('0x63')][0x0]?_0x10d2f8['attrs'][0x0][_0xdde3('0x64')]:undefined)||_0xdde3('0x65')}];case'custom':return[{'name':_0xdde3('0x66'),'value':_0x10d2f8[_0xdde3('0x66')]||(_0x10d2f8[_0xdde3('0x63')]&&_0x10d2f8[_0xdde3('0x63')][0x0]?_0x10d2f8[_0xdde3('0x63')][0x0]['value']:undefined)||''}];case _0xdde3('0x67'):return[{'name':'attrHourFormat','value':_0x10d2f8[_0xdde3('0x68')]||(_0x10d2f8[_0xdde3('0x63')]&&_0x10d2f8[_0xdde3('0x63')][0x0]?_0x10d2f8[_0xdde3('0x63')][0x0]['value']:undefined)||_0xdde3('0x69')},{'name':_0xdde3('0x6a'),'value':_0x10d2f8['attrTimezone']||(_0x10d2f8['attrs']&&_0x10d2f8[_0xdde3('0x63')][0x1]?_0x10d2f8[_0xdde3('0x63')][0x1][_0xdde3('0x64')]:undefined)||'0.00'},{'name':_0xdde3('0x6b'),'value':_0x10d2f8[_0xdde3('0x6b')]||(_0x10d2f8['attrs']&&_0x10d2f8[_0xdde3('0x63')][0x2]?_0x10d2f8[_0xdde3('0x63')][0x2][_0xdde3('0x64')]:undefined)||0xc}];case _0xdde3('0x6c'):return[{'name':'attrMetric','value':_0x10d2f8[_0xdde3('0x6d')]||(_0x10d2f8['attrs']&&_0x10d2f8[_0xdde3('0x63')][0x0]?_0x10d2f8[_0xdde3('0x63')][0x0]['value']:undefined)||_0xdde3('0x6e')},{'name':_0xdde3('0x6f'),'value':_0x10d2f8[_0xdde3('0x6f')]||(_0x10d2f8[_0xdde3('0x63')]&&_0x10d2f8[_0xdde3('0x63')][0x1]?_0x10d2f8['attrs'][0x1]['value']:undefined)||[]},{'name':_0xdde3('0x6b'),'value':_0x10d2f8[_0xdde3('0x6b')]||(_0x10d2f8['attrs']&&_0x10d2f8[_0xdde3('0x63')][0x2]?_0x10d2f8['attrs'][0x2][_0xdde3('0x64')]:undefined)||0x14},{'name':_0xdde3('0x70'),'value':_0x10d2f8[_0xdde3('0x70')]||(_0x10d2f8[_0xdde3('0x63')]&&_0x10d2f8[_0xdde3('0x63')][0x3]?_0x10d2f8[_0xdde3('0x63')][0x3]['value']:undefined)||'voice'},{'name':_0xdde3('0x71'),'value':_0x10d2f8[_0xdde3('0x71')]||(_0x10d2f8['attrs']&&_0x10d2f8[_0xdde3('0x63')][0x4]?_0x10d2f8['attrs'][0x4][_0xdde3('0x64')]:undefined)||''},{'name':_0xdde3('0x72'),'value':_0x10d2f8[_0xdde3('0x72')]||(_0x10d2f8[_0xdde3('0x63')]&&_0x10d2f8[_0xdde3('0x63')][0x5]?_0x10d2f8[_0xdde3('0x63')][0x5]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x10d2f8['attrSmsAccounts']||(_0x10d2f8[_0xdde3('0x63')]&&_0x10d2f8[_0xdde3('0x63')][0x6]?_0x10d2f8[_0xdde3('0x63')][0x6]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x10d2f8['attrOpenchannelAccounts']||(_0x10d2f8[_0xdde3('0x63')]&&_0x10d2f8[_0xdde3('0x63')][0x7]?_0x10d2f8[_0xdde3('0x63')][0x7]['value']:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x10d2f8[_0xdde3('0x73')]||(_0x10d2f8[_0xdde3('0x63')]&&_0x10d2f8[_0xdde3('0x63')][0x8]?_0x10d2f8[_0xdde3('0x63')][0x8]['value']:undefined)||''},{'name':_0xdde3('0x74'),'value':_0x10d2f8[_0xdde3('0x74')]||(_0x10d2f8[_0xdde3('0x63')]&&_0x10d2f8[_0xdde3('0x63')][0x9]?_0x10d2f8[_0xdde3('0x63')][0x9][_0xdde3('0x64')]:undefined)||''}];case _0xdde3('0x75'):case _0xdde3('0x76'):return[{'name':'attrSerie1','value':_0x10d2f8[_0xdde3('0x77')]||(_0x10d2f8[_0xdde3('0x63')]&&_0x10d2f8[_0xdde3('0x63')][0x0]?_0x10d2f8[_0xdde3('0x63')][0x0][_0xdde3('0x64')]:undefined)||_0xdde3('0x6e')},{'name':_0xdde3('0x78'),'value':_0x10d2f8[_0xdde3('0x78')]||(_0x10d2f8['attrs']&&_0x10d2f8['attrs'][0x1]?_0x10d2f8[_0xdde3('0x63')][0x1][_0xdde3('0x64')]:undefined)||null},{'name':_0xdde3('0x79'),'value':_0x10d2f8[_0xdde3('0x79')]||(_0x10d2f8[_0xdde3('0x63')]&&_0x10d2f8['attrs'][0x2]?_0x10d2f8[_0xdde3('0x63')][0x2][_0xdde3('0x64')]:undefined)||null},{'name':_0xdde3('0x6f'),'value':_0x10d2f8[_0xdde3('0x6f')]||(_0x10d2f8[_0xdde3('0x63')]&&_0x10d2f8[_0xdde3('0x63')][0x3]?_0x10d2f8[_0xdde3('0x63')][0x3][_0xdde3('0x64')]:undefined)||[]},{'name':_0xdde3('0x70'),'value':_0x10d2f8['attrChannel']||(_0x10d2f8['attrs']&&_0x10d2f8['attrs'][0x4]?_0x10d2f8[_0xdde3('0x63')][0x4][_0xdde3('0x64')]:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0x10d2f8[_0xdde3('0x71')]||(_0x10d2f8[_0xdde3('0x63')]&&_0x10d2f8[_0xdde3('0x63')][0x5]?_0x10d2f8['attrs'][0x5]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x10d2f8[_0xdde3('0x72')]||(_0x10d2f8['attrs']&&_0x10d2f8['attrs'][0x6]?_0x10d2f8[_0xdde3('0x63')][0x6][_0xdde3('0x64')]:undefined)||''},{'name':_0xdde3('0x7a'),'value':_0x10d2f8[_0xdde3('0x7a')]||(_0x10d2f8['attrs']&&_0x10d2f8[_0xdde3('0x63')][0x7]?_0x10d2f8['attrs'][0x7][_0xdde3('0x64')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x10d2f8['attrOpenchannelAccounts']||(_0x10d2f8[_0xdde3('0x63')]&&_0x10d2f8[_0xdde3('0x63')][0x8]?_0x10d2f8['attrs'][0x8]['value']:undefined)||''},{'name':_0xdde3('0x73'),'value':_0x10d2f8[_0xdde3('0x73')]||(_0x10d2f8['attrs']&&_0x10d2f8[_0xdde3('0x63')][0x9]?_0x10d2f8['attrs'][0x9][_0xdde3('0x64')]:undefined)||''},{'name':_0xdde3('0x74'),'value':_0x10d2f8[_0xdde3('0x74')]||(_0x10d2f8[_0xdde3('0x63')]&&_0x10d2f8['attrs'][0xa]?_0x10d2f8[_0xdde3('0x63')][0xa][_0xdde3('0x64')]:undefined)||''}];case _0xdde3('0x7b'):return[{'name':_0xdde3('0x7c'),'type':_0x10d2f8['reportType']||(_0x10d2f8[_0xdde3('0x63')]&&_0x10d2f8[_0xdde3('0x63')][0x0]?_0x10d2f8[_0xdde3('0x63')][0x0][_0xdde3('0x3a')]:undefined)||null,'value':_0x10d2f8[_0xdde3('0x7c')]||(_0x10d2f8[_0xdde3('0x63')]&&_0x10d2f8[_0xdde3('0x63')][0x0]?_0x10d2f8['attrs'][0x0][_0xdde3('0x64')]:undefined)||null},{'name':_0xdde3('0x7d'),'value':_0x10d2f8[_0xdde3('0x7d')]||(_0x10d2f8[_0xdde3('0x63')]&&_0x10d2f8[_0xdde3('0x63')][0x1]?_0x10d2f8[_0xdde3('0x63')][0x1][_0xdde3('0x64')]:undefined)||0x0}];default:return[];}}catch(_0x699da4){logger[_0xdde3('0x32')](_0xdde3('0x7e'),JSON[_0xdde3('0x7f')](_0x699da4));return[];}}exports[_0xdde3('0x80')]=function(_0x1a721b,_0xa9f0cd,_0x5384cd){if(_0x1a721b[_0xdde3('0x55')]['id']){delete _0x1a721b[_0xdde3('0x55')]['id'];}return db[_0xdde3('0x51')][_0xdde3('0x53')]({'where':{'id':_0x1a721b[_0xdde3('0x50')]['id']}})[_0xdde3('0x2d')](handleEntityNotFound(_0xa9f0cd,null))['then'](function(_0x58e335){if(_0x58e335){_0x1a721b[_0xdde3('0x55')]['DashboardId']=_0x58e335['id'];_0x1a721b[_0xdde3('0x55')][_0xdde3('0x63')]=widgetAttributes(_0x1a721b[_0xdde3('0x55')]);return db[_0xdde3('0x81')][_0xdde3('0x54')](_0x1a721b['body']);}})[_0xdde3('0x2d')](respondWithResult(_0xa9f0cd,null))[_0xdde3('0x4e')](handleError(_0xa9f0cd,null));};exports[_0xdde3('0x82')]=function(_0x5ecd7a,_0x5fb29b,_0x2fe21e){var _0x397996={};var _0x48bca9={};var _0x5835dd;var _0x4feecf;return db['Dashboard'][_0xdde3('0x83')]({'where':{'id':_0x5ecd7a['params']['id']}})[_0xdde3('0x2d')](handleEntityNotFound(_0x5fb29b,null))[_0xdde3('0x2d')](function(_0x390286){if(_0x390286){_0x5835dd=_0x390286;_0x48bca9[_0xdde3('0x3c')]=_['keys'](db[_0xdde3('0x81')][_0xdde3('0x38')]);_0x48bca9[_0xdde3('0x3e')]=_[_0xdde3('0x3d')](_0x5ecd7a[_0xdde3('0x3e')]);_0x48bca9[_0xdde3('0x46')]=_['intersection'](_0x48bca9[_0xdde3('0x3c')],_0x48bca9[_0xdde3('0x3e')]);_0x397996['attributes']=_[_0xdde3('0x3f')](_0x48bca9[_0xdde3('0x3c')],qs['fields'](_0x5ecd7a['query']['fields']));_0x397996[_0xdde3('0x40')]=_0x397996[_0xdde3('0x40')][_0xdde3('0x42')]?_0x397996[_0xdde3('0x40')]:_0x48bca9[_0xdde3('0x3c')];_0x397996[_0xdde3('0x84')]=qs[_0xdde3('0x44')](_0x5ecd7a['query'][_0xdde3('0x44')]);_0x397996[_0xdde3('0x45')]=qs['filters'](_[_0xdde3('0x47')](_0x5ecd7a['query'],_0x48bca9[_0xdde3('0x46')]));if(_0x5ecd7a[_0xdde3('0x3e')][_0xdde3('0x48')]){_0x397996[_0xdde3('0x45')]=_[_0xdde3('0x49')](_0x397996[_0xdde3('0x45')],{'$or':_[_0xdde3('0x37')](_0x397996[_0xdde3('0x40')],function(_0x2e7336){var _0x53744c={};_0x53744c[_0x2e7336]={'$like':'%'+_0x5ecd7a['query'][_0xdde3('0x48')]+'%'};return _0x53744c;})});}_0x397996=_[_0xdde3('0x49')]({},_0x397996,_0x5ecd7a[_0xdde3('0x4a')]);return _0x5835dd[_0xdde3('0x82')](_0x397996);}})[_0xdde3('0x2d')](function(_0x4f3c3e){if(_0x4f3c3e){_0x4feecf=_0x4f3c3e['length'];if(!_0x5ecd7a[_0xdde3('0x3e')][_0xdde3('0x85')](_0xdde3('0x43'))){_0x397996[_0xdde3('0x26')]=qs[_0xdde3('0x26')](_0x5ecd7a[_0xdde3('0x3e')][_0xdde3('0x26')]);_0x397996[_0xdde3('0x24')]=qs[_0xdde3('0x24')](_0x5ecd7a[_0xdde3('0x3e')][_0xdde3('0x24')]);}return _0x5835dd['getItems'](_0x397996);}})[_0xdde3('0x2d')](function(_0x38d52e){if(_0x38d52e){return _0x38d52e?{'count':_0x4feecf,'rows':_0x38d52e}:null;}})[_0xdde3('0x2d')](respondWithResult(_0x5fb29b,null))[_0xdde3('0x4e')](handleError(_0x5fb29b,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 44f3835..b668e38 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 _0xe5f1=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','Dashboard'];(function(_0x231a47,_0x46a963){var _0x48d7c9=function(_0x1e69b1){while(--_0x1e69b1){_0x231a47['push'](_0x231a47['shift']());}};_0x48d7c9(++_0x46a963);}(_0xe5f1,0x16f));var _0x1e5f=function(_0x1f457c,_0x49fc13){_0x1f457c=_0x1f457c-0x0;var _0x452951=_0xe5f1[_0x1f457c];return _0x452951;};'use strict';var EventEmitter=require(_0x1e5f('0x0'));var Dashboard=require(_0x1e5f('0x1'))['db'][_0x1e5f('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x1e5f('0x3')](0x0);var events={'afterCreate':_0x1e5f('0x4'),'afterUpdate':_0x1e5f('0x5'),'afterDestroy':_0x1e5f('0x6')};function emitEvent(_0x5d0afe){return function(_0x5e4e11,_0x6bfe8b,_0x3d4582){DashboardEvents['emit'](_0x5d0afe+':'+_0x5e4e11['id'],_0x5e4e11);DashboardEvents[_0x1e5f('0x7')](_0x5d0afe,_0x5e4e11);_0x3d4582(null);};}for(var e in events){if(events[_0x1e5f('0x8')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0x1e5f('0x9')]=DashboardEvents; \ No newline at end of file +var _0x0c97=['../../mysqldb','Dashboard','setMaxListeners','save','remove','emit','hasOwnProperty','events'];(function(_0x57d485,_0x4ddb6a){var _0x3f6177=function(_0x4e122e){while(--_0x4e122e){_0x57d485['push'](_0x57d485['shift']());}};_0x3f6177(++_0x4ddb6a);}(_0x0c97,0x9f));var _0x70c9=function(_0x39e84d,_0x11931d){_0x39e84d=_0x39e84d-0x0;var _0x1991bc=_0x0c97[_0x39e84d];return _0x1991bc;};'use strict';var EventEmitter=require(_0x70c9('0x0'));var Dashboard=require(_0x70c9('0x1'))['db'][_0x70c9('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x70c9('0x3')](0x0);var events={'afterCreate':_0x70c9('0x4'),'afterUpdate':'update','afterDestroy':_0x70c9('0x5')};function emitEvent(_0x2060ba){return function(_0xb435f3,_0x51b30a,_0x5e7e95){DashboardEvents[_0x70c9('0x6')](_0x2060ba+':'+_0xb435f3['id'],_0xb435f3);DashboardEvents[_0x70c9('0x6')](_0x2060ba,_0xb435f3);_0x5e7e95(null);};}for(var e in events){if(events[_0x70c9('0x7')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 56c243a..17722a1 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 _0xa415=['dashboards','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboard.attributes','exports','Dashboard'];(function(_0x45416a,_0x50d3ec){var _0x5c24f3=function(_0x902ad4){while(--_0x902ad4){_0x45416a['push'](_0x45416a['shift']());}};_0x5c24f3(++_0x50d3ec);}(_0xa415,0x121));var _0x5a41=function(_0x5e9795,_0x3358e1){_0x5e9795=_0x5e9795-0x0;var _0x22104e=_0xa415[_0x5e9795];return _0x22104e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5a41('0x0'))(_0x5a41('0x1'));var moment=require(_0x5a41('0x2'));var BPromise=require(_0x5a41('0x3'));var rp=require(_0x5a41('0x4'));var fs=require('fs');var path=require(_0x5a41('0x5'));var rimraf=require(_0x5a41('0x6'));var config=require(_0x5a41('0x7'));var attributes=require(_0x5a41('0x8'));module[_0x5a41('0x9')]=function(_0xac23a2,_0x3fd9f1){return _0xac23a2['define'](_0x5a41('0xa'),attributes,{'tableName':_0x5a41('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7291=['../../config/environment','exports','define','Dashboard','lodash','api','moment','request-promise','path','rimraf'];(function(_0xb7a459,_0xc13228){var _0x104ab5=function(_0x186a0e){while(--_0x186a0e){_0xb7a459['push'](_0xb7a459['shift']());}};_0x104ab5(++_0xc13228);}(_0x7291,0xa4));var _0x1729=function(_0x53a6b7,_0x175f7f){_0x53a6b7=_0x53a6b7-0x0;var _0x6a858c=_0x7291[_0x53a6b7];return _0x6a858c;};'use strict';var _=require(_0x1729('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1729('0x1'));var moment=require(_0x1729('0x2'));var BPromise=require('bluebird');var rp=require(_0x1729('0x3'));var fs=require('fs');var path=require(_0x1729('0x4'));var rimraf=require(_0x1729('0x5'));var config=require(_0x1729('0x6'));var attributes=require('./dashboard.attributes');module[_0x1729('0x7')]=function(_0x1cf7d9,_0x516b53){return _0x1cf7d9[_0x1729('0x8')](_0x1729('0x9'),attributes,{'tableName':'dashboards','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 092a47d..bebeca6 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 _0xe31d=['request\x20sent','debug','stringify','error','Dashboard,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','localhost','redis','./dashboard.socket','register','then','info'];(function(_0x43cdaa,_0x141bad){var _0x34a04e=function(_0x300884){while(--_0x300884){_0x43cdaa['push'](_0x43cdaa['shift']());}};_0x34a04e(++_0x141bad);}(_0xe31d,0xcf));var _0xde31=function(_0x28d87a,_0x3ebce6){_0x28d87a=_0x28d87a-0x0;var _0x107622=_0xe31d[_0x28d87a];return _0x107622;};'use strict';var _=require(_0xde31('0x0'));var util=require(_0xde31('0x1'));var moment=require(_0xde31('0x2'));var BPromise=require(_0xde31('0x3'));var rs=require(_0xde31('0x4'));var fs=require('fs');var Redis=require(_0xde31('0x5'));var db=require(_0xde31('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xde31('0x7'));var config=require(_0xde31('0x8'));var jayson=require(_0xde31('0x9'));var client=jayson[_0xde31('0xa')][_0xde31('0xb')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xde31('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xde31('0xd')]));require(_0xde31('0xe'))[_0xde31('0xf')](socket);function respondWithRpcPromise(_0x9b80e0,_0x2a16cb,_0x2514b4){return new BPromise(function(_0x4f57f9,_0x33aefb){return client['request'](_0x9b80e0,_0x2514b4)[_0xde31('0x10')](function(_0x26fc78){logger[_0xde31('0x11')]('Dashboard,\x20%s,\x20%s',_0x2a16cb,_0xde31('0x12'));logger[_0xde31('0x13')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x2a16cb,_0xde31('0x12'),JSON[_0xde31('0x14')](_0x26fc78));if(_0x26fc78[_0xde31('0x15')]){if(_0x26fc78[_0xde31('0x15')]['code']===0x1f4){logger[_0xde31('0x15')](_0xde31('0x16'),_0x2a16cb,_0x26fc78[_0xde31('0x15')][_0xde31('0x17')]);return _0x33aefb(_0x26fc78[_0xde31('0x15')][_0xde31('0x17')]);}logger[_0xde31('0x15')]('Dashboard,\x20%s,\x20%s',_0x2a16cb,_0x26fc78[_0xde31('0x15')][_0xde31('0x17')]);return _0x4f57f9(_0x26fc78[_0xde31('0x15')][_0xde31('0x17')]);}else{logger[_0xde31('0x11')](_0xde31('0x16'),_0x2a16cb,_0xde31('0x12'));_0x4f57f9(_0x26fc78[_0xde31('0x18')][_0xde31('0x17')]);}})['catch'](function(_0x30f8c0){logger[_0xde31('0x15')](_0xde31('0x16'),_0x2a16cb,_0x30f8c0);_0x33aefb(_0x30f8c0);});});} \ No newline at end of file +var _0x893d=['then','info','Dashboard,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','register','request'];(function(_0x472ef9,_0x89c55){var _0x18b189=function(_0x58594e){while(--_0x58594e){_0x472ef9['push'](_0x472ef9['shift']());}};_0x18b189(++_0x89c55);}(_0x893d,0xe2));var _0xd893=function(_0x29fa45,_0x1316ad){_0x29fa45=_0x29fa45-0x0;var _0x252af0=_0x893d[_0x29fa45];return _0x252af0;};'use strict';var _=require(_0xd893('0x0'));var util=require(_0xd893('0x1'));var moment=require(_0xd893('0x2'));var BPromise=require(_0xd893('0x3'));var rs=require(_0xd893('0x4'));var fs=require('fs');var Redis=require(_0xd893('0x5'));var db=require(_0xd893('0x6'))['db'];var utils=require(_0xd893('0x7'));var logger=require(_0xd893('0x8'))('rpc');var config=require(_0xd893('0x9'));var jayson=require(_0xd893('0xa'));var client=jayson[_0xd893('0xb')]['http']({'port':0x232a});config[_0xd893('0xc')]=_[_0xd893('0xd')](config[_0xd893('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xd893('0xe'))(new Redis(config['redis']));require('./dashboard.socket')[_0xd893('0xf')](socket);function respondWithRpcPromise(_0x427607,_0x38c678,_0x20b65c){return new BPromise(function(_0x255bb7,_0xf6ca4){return client[_0xd893('0x10')](_0x427607,_0x20b65c)[_0xd893('0x11')](function(_0x299fa4){logger[_0xd893('0x12')](_0xd893('0x13'),_0x38c678,_0xd893('0x14'));logger['debug']('Dashboard,\x20%s,\x20%s,\x20%s',_0x38c678,'request\x20sent',JSON[_0xd893('0x15')](_0x299fa4));if(_0x299fa4['error']){if(_0x299fa4[_0xd893('0x16')][_0xd893('0x17')]===0x1f4){logger['error'](_0xd893('0x13'),_0x38c678,_0x299fa4[_0xd893('0x16')][_0xd893('0x18')]);return _0xf6ca4(_0x299fa4['error'][_0xd893('0x18')]);}logger[_0xd893('0x16')](_0xd893('0x13'),_0x38c678,_0x299fa4['error'][_0xd893('0x18')]);return _0x255bb7(_0x299fa4[_0xd893('0x16')][_0xd893('0x18')]);}else{logger[_0xd893('0x12')](_0xd893('0x13'),_0x38c678,_0xd893('0x14'));_0x255bb7(_0x299fa4[_0xd893('0x19')][_0xd893('0x18')]);}})[_0xd893('0x1a')](function(_0xd97488){logger[_0xd893('0x16')]('Dashboard,\x20%s,\x20%s',_0x38c678,_0xd97488);_0xf6ca4(_0xd97488);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index f2a54a9..80fd6af 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 _0xb75e=['save','remove','update','emit','register','dashboard:','./dashboard.events'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0xb75e,0x16b));var _0xeb75=function(_0x82f8e2,_0x5f5382){_0x82f8e2=_0x82f8e2-0x0;var _0xaef0f9=_0xb75e[_0x82f8e2];return _0xaef0f9;};'use strict';var DashboardEvents=require(_0xeb75('0x0'));var events=[_0xeb75('0x1'),_0xeb75('0x2'),_0xeb75('0x3')];function createListener(_0x31e86a,_0x49c6cf){return function(_0x23e291){_0x49c6cf[_0xeb75('0x4')](_0x31e86a,_0x23e291);};}function removeListener(_0xc2d01d,_0x10a7cc){return function(){DashboardEvents['removeListener'](_0xc2d01d,_0x10a7cc);};}exports[_0xeb75('0x5')]=function(_0x42e601){for(var _0x7b280c=0x0,_0x42ed35=events['length'];_0x7b280c<_0x42ed35;_0x7b280c++){var _0x7846bd=events[_0x7b280c];var _0x91b962=createListener(_0xeb75('0x6')+_0x7846bd,_0x42e601);DashboardEvents['on'](_0x7846bd,_0x91b962);}}; \ No newline at end of file +var _0xe364=['removeListener','register','length','dashboard:','save','remove','update','emit'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0xe364,0x1ac));var _0x4e36=function(_0x36b037,_0x2b234e){_0x36b037=_0x36b037-0x0;var _0x409194=_0xe364[_0x36b037];return _0x409194;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0x4e36('0x0'),_0x4e36('0x1'),_0x4e36('0x2')];function createListener(_0x598c09,_0x1257bc){return function(_0x5e73de){_0x1257bc[_0x4e36('0x3')](_0x598c09,_0x5e73de);};}function removeListener(_0x9b9f09,_0x40749c){return function(){DashboardEvents[_0x4e36('0x4')](_0x9b9f09,_0x40749c);};}exports[_0x4e36('0x5')]=function(_0x33b062){for(var _0x1e6fb6=0x0,_0x119048=events[_0x4e36('0x6')];_0x1e6fb6<_0x119048;_0x1e6fb6++){var _0x593aff=events[_0x1e6fb6];var _0x2defc2=createListener(_0x4e36('0x7')+_0x593aff,_0x33b062);DashboardEvents['on'](_0x593aff,_0x2defc2);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index ad801b7..4610744 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 _0xed45=['./dashboard.controller','index','get','/:id','show','isAuthenticated','post','addItem','put','update','destroy','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x5d88d3,_0x10a0af){var _0x44914c=function(_0x317016){while(--_0x317016){_0x5d88d3['push'](_0x5d88d3['shift']());}};_0x44914c(++_0x10a0af);}(_0xed45,0x1c5));var _0x5ed4=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xed45[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x5ed4('0x0'));var util=require('util');var path=require(_0x5ed4('0x1'));var timeout=require('connect-timeout');var express=require(_0x5ed4('0x2'));var router=express['Router']();var fs_extra=require(_0x5ed4('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x5ed4('0x4'));var config=require(_0x5ed4('0x5'));var controller=require(_0x5ed4('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x5ed4('0x7')]);router[_0x5ed4('0x8')](_0x5ed4('0x9'),auth['isAuthenticated'](),controller[_0x5ed4('0xa')]);router['get']('/:id/items',auth[_0x5ed4('0xb')](),controller['getItems']);router['post']('/',auth[_0x5ed4('0xb')](),controller['create']);router[_0x5ed4('0xc')]('/:id/clone',auth[_0x5ed4('0xb')](),controller['clone']);router['post']('/:id/items',auth[_0x5ed4('0xb')](),controller[_0x5ed4('0xd')]);router[_0x5ed4('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x5ed4('0xf')]);router['delete'](_0x5ed4('0x9'),auth['isAuthenticated'](),controller[_0x5ed4('0x10')]);module['exports']=router; \ No newline at end of file +var _0x4bf0=['get','isAuthenticated','index','/:id','show','/:id/items','getItems','create','post','clone','addItem','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./dashboard.controller'];(function(_0x2d982d,_0x121028){var _0x4f36b0=function(_0x11f3a9){while(--_0x11f3a9){_0x2d982d['push'](_0x2d982d['shift']());}};_0x4f36b0(++_0x121028);}(_0x4bf0,0x178));var _0x04bf=function(_0x3edaac,_0x191104){_0x3edaac=_0x3edaac-0x0;var _0x105ce0=_0x4bf0[_0x3edaac];return _0x105ce0;};'use strict';var multer=require('multer');var util=require(_0x04bf('0x0'));var path=require(_0x04bf('0x1'));var timeout=require(_0x04bf('0x2'));var express=require(_0x04bf('0x3'));var router=express[_0x04bf('0x4')]();var fs_extra=require(_0x04bf('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x04bf('0x6'));var controller=require(_0x04bf('0x7'));router[_0x04bf('0x8')]('/',auth[_0x04bf('0x9')](),controller[_0x04bf('0xa')]);router[_0x04bf('0x8')](_0x04bf('0xb'),auth[_0x04bf('0x9')](),controller[_0x04bf('0xc')]);router[_0x04bf('0x8')](_0x04bf('0xd'),auth[_0x04bf('0x9')](),controller[_0x04bf('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x04bf('0xf')]);router[_0x04bf('0x10')]('/:id/clone',auth[_0x04bf('0x9')](),controller[_0x04bf('0x11')]);router['post'](_0x04bf('0xd'),auth['isAuthenticated'](),controller[_0x04bf('0x12')]);router[_0x04bf('0x13')]('/:id',auth[_0x04bf('0x9')](),controller[_0x04bf('0x14')]);router[_0x04bf('0x15')](_0x04bf('0xb'),auth[_0x04bf('0x9')](),controller[_0x04bf('0x16')]);module[_0x04bf('0x17')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index b962d7f..770a73d 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 _0x6d38=['INTEGER','STRING','#2196f3','squel','lodash','exports','TEXT','parse','getDataValue','attrs','setDataValue','stringify'];(function(_0x26af87,_0x3e8dbb){var _0x5ea602=function(_0x4d29c3){while(--_0x4d29c3){_0x26af87['push'](_0x26af87['shift']());}};_0x5ea602(++_0x3e8dbb);}(_0x6d38,0x1ef));var _0x86d3=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x6d38[_0x3e5086];return _0xfeb102;};'use strict';var Sequelize=require('sequelize');var squel=require(_0x86d3('0x0'));var _=require(_0x86d3('0x1'));module[_0x86d3('0x2')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x86d3('0x3')]('long'),'get':function(){try{return JSON[_0x86d3('0x4')](this[_0x86d3('0x5')](_0x86d3('0x6')));}catch(_0x4ef557){return[];}},'set':function(_0x2d8272){try{this[_0x86d3('0x7')](_0x86d3('0x6'),JSON[_0x86d3('0x8')](_0x2d8272));}catch(_0x47e654){this['setDataValue'](_0x86d3('0x6'),JSON[_0x86d3('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0x86d3('0x9')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x86d3('0x9')]},'background':{'type':Sequelize[_0x86d3('0xa')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x86d3('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x86d3('0xa')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file +var _0xdbf5=['squel','STRING','TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff'];(function(_0x411e43,_0x39c647){var _0x244bb3=function(_0x4f906f){while(--_0x4f906f){_0x411e43['push'](_0x411e43['shift']());}};_0x244bb3(++_0x39c647);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x306773,_0x3a8767){_0x306773=_0x306773-0x0;var _0x666913=_0xdbf5[_0x306773];return _0x666913;};'use strict';var Sequelize=require('sequelize');var squel=require(_0x5dbf('0x0'));var _=require('lodash');module['exports']={'title':{'type':Sequelize[_0x5dbf('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x5dbf('0x1')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x5dbf('0x2')](_0x5dbf('0x3')),'get':function(){try{return JSON[_0x5dbf('0x4')](this[_0x5dbf('0x5')](_0x5dbf('0x6')));}catch(_0x1decd2){return[];}},'set':function(_0x3f8628){try{this[_0x5dbf('0x7')](_0x5dbf('0x6'),JSON[_0x5dbf('0x8')](_0x3f8628));}catch(_0x93e657){this['setDataValue'](_0x5dbf('0x6'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0x5dbf('0x9')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x5dbf('0x9')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x5dbf('0x9')]},'col':{'type':Sequelize[_0x5dbf('0x9')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5dbf('0xa'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x5dbf('0x1')]},'titleFontSize':{'type':Sequelize['INTEGER'],'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 ebbcd5b..88ed4c9 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 _0x75a2=['attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','error','widgetAttributes:\x20%s','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','sendStatus','status','end','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','show','model','keys','rawAttributes','query','intersection','attributes','fields','includeAll','include','merge','DashboardItem','find','catch','params','type','attrUrl','attrs','https://','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts'];(function(_0x1b64dd,_0x2cf769){var _0xeb464c=function(_0x38272c){while(--_0x38272c){_0x1b64dd['push'](_0x1b64dd['shift']());}};_0xeb464c(++_0x2cf769);}(_0x75a2,0x187));var _0x275a=function(_0x5f495a,_0x142606){_0x5f495a=_0x5f495a-0x0;var _0xe6cce5=_0x75a2[_0x5f495a];return _0xe6cce5;};'use strict';var emlformat=require(_0x275a('0x0'));var rimraf=require(_0x275a('0x1'));var zipdir=require(_0x275a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x275a('0x3'));var moment=require(_0x275a('0x4'));var BPromise=require(_0x275a('0x5'));var Mustache=require(_0x275a('0x6'));var util=require('util');var path=require(_0x275a('0x7'));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(_0x275a('0x8'));var squel=require(_0x275a('0x9'));var crypto=require(_0x275a('0xa'));var jsforce=require(_0x275a('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x275a('0xc'));var Papa=require(_0x275a('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x275a('0xe'));var hardwareService=require(_0x275a('0xf'));var logger=require(_0x275a('0x10'))(_0x275a('0x11'));var utils=require(_0x275a('0x12'));var config=require(_0x275a('0x13'));var licenseUtil=require(_0x275a('0x14'));var db=require(_0x275a('0x15'))['db'];config[_0x275a('0x16')]=_[_0x275a('0x17')](config[_0x275a('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x275a('0x18'))(new Redis(config[_0x275a('0x16')]));require('./dashboardItem.socket')['register'](socket);function respondWithStatusCode(_0x2baa83,_0x2525f0){_0x2525f0=_0x2525f0||0xcc;return function(_0x9cfdf7){if(_0x9cfdf7){return _0x2baa83[_0x275a('0x19')](_0x2525f0);}return _0x2baa83[_0x275a('0x1a')](_0x2525f0)[_0x275a('0x1b')]();};}function respondWithResult(_0x283865,_0x2a49c6){_0x2a49c6=_0x2a49c6||0xc8;return function(_0x222bac){if(_0x222bac){return _0x283865['status'](_0x2a49c6)['json'](_0x222bac);}};}function respondWithFilteredResult(_0x21cf70,_0x4221ef){return function(_0x50374a){if(_0x50374a){var _0x127da5=typeof _0x4221ef['offset']===_0x275a('0x1c')&&typeof _0x4221ef[_0x275a('0x1d')]==='undefined';var _0xe59012=_0x50374a[_0x275a('0x1e')];var _0x4a0ddb=_0x127da5?0x0:_0x4221ef['offset'];var _0x260e41=_0x127da5?_0x50374a[_0x275a('0x1e')]:_0x4221ef['offset']+_0x4221ef['limit'];var _0x4afb5e;if(_0x260e41>=_0xe59012){_0x260e41=_0xe59012;_0x4afb5e=0xc8;}else{_0x4afb5e=0xce;}_0x21cf70[_0x275a('0x1a')](_0x4afb5e);return _0x21cf70[_0x275a('0x1f')](_0x275a('0x20'),_0x4a0ddb+'-'+_0x260e41+'/'+_0xe59012)[_0x275a('0x21')](_0x50374a);}return null;};}function patchUpdates(_0xbb91e7){return function(_0x5e924f){try{jsonpatch[_0x275a('0x22')](_0x5e924f,_0xbb91e7,!![]);}catch(_0x19ef1f){return BPromise[_0x275a('0x23')](_0x19ef1f);}return _0x5e924f[_0x275a('0x24')]();};}function saveUpdates(_0x32eb4b,_0x579aca){return function(_0x19424f){if(_0x19424f){return _0x19424f[_0x275a('0x25')](_0x32eb4b)[_0x275a('0x26')](function(_0x1441c3){return _0x1441c3;});}return null;};}function removeEntity(_0x263fde,_0x2bfe4d){return function(_0x417397){if(_0x417397){return _0x417397[_0x275a('0x27')]()[_0x275a('0x26')](function(){_0x263fde[_0x275a('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b7fea,_0x1e424f){return function(_0x57c10b){if(!_0x57c10b){_0x3b7fea[_0x275a('0x19')](0x194);}return _0x57c10b;};}function handleError(_0x337c13,_0x3d4a2){_0x3d4a2=_0x3d4a2||0x1f4;return function(_0xa5048b){logger['error'](_0xa5048b[_0x275a('0x28')]);if(_0xa5048b[_0x275a('0x29')]){delete _0xa5048b[_0x275a('0x29')];}_0x337c13[_0x275a('0x1a')](_0x3d4a2)[_0x275a('0x2a')](_0xa5048b);};}exports[_0x275a('0x2b')]=function(_0x3d0fa0,_0x26e347){var _0xe22b72={'raw':![],'where':{'id':_0x3d0fa0['params']['id']}},_0x2b4683={};_0x2b4683[_0x275a('0x2c')]=_[_0x275a('0x2d')](db['DashboardItem'][_0x275a('0x2e')]);_0x2b4683[_0x275a('0x2f')]=_[_0x275a('0x2d')](_0x3d0fa0[_0x275a('0x2f')]);_0x2b4683['filters']=_[_0x275a('0x30')](_0x2b4683[_0x275a('0x2c')],_0x2b4683[_0x275a('0x2f')]);_0xe22b72[_0x275a('0x31')]=_[_0x275a('0x30')](_0x2b4683['model'],qs[_0x275a('0x32')](_0x3d0fa0[_0x275a('0x2f')][_0x275a('0x32')]));_0xe22b72['attributes']=_0xe22b72[_0x275a('0x31')]['length']?_0xe22b72[_0x275a('0x31')]:_0x2b4683['model'];if(_0x3d0fa0['query'][_0x275a('0x33')]){_0xe22b72[_0x275a('0x34')]=[{'all':!![]}];}_0xe22b72=_[_0x275a('0x35')]({},_0xe22b72,_0x3d0fa0['options']);return db[_0x275a('0x36')][_0x275a('0x37')](_0xe22b72)[_0x275a('0x26')](handleEntityNotFound(_0x26e347,null))[_0x275a('0x26')](respondWithResult(_0x26e347,null))[_0x275a('0x38')](handleError(_0x26e347,null));};exports[_0x275a('0x27')]=function(_0x232e32,_0x18a03f){return db['DashboardItem'][_0x275a('0x37')]({'where':{'id':_0x232e32[_0x275a('0x39')]['id']}})[_0x275a('0x26')](handleEntityNotFound(_0x18a03f,null))['then'](removeEntity(_0x18a03f,null))[_0x275a('0x38')](handleError(_0x18a03f,null));};function widgetAttributes(_0x136d4f){try{switch(_0x136d4f[_0x275a('0x3a')]){case'iframe':return[{'name':_0x275a('0x3b'),'value':_0x136d4f[_0x275a('0x3b')]||(_0x136d4f['attrs']&&_0x136d4f[_0x275a('0x3c')][0x0]?_0x136d4f[_0x275a('0x3c')][0x0]['value']:undefined)||_0x275a('0x3d')}];case'custom':return[{'name':_0x275a('0x3e'),'value':_0x136d4f[_0x275a('0x3e')]||(_0x136d4f['attrs']&&_0x136d4f['attrs'][0x0]?_0x136d4f[_0x275a('0x3c')][0x0][_0x275a('0x3f')]:undefined)||''}];case _0x275a('0x40'):return[{'name':'attrHourFormat','value':_0x136d4f[_0x275a('0x41')]||(_0x136d4f['attrs']&&_0x136d4f[_0x275a('0x3c')][0x0]?_0x136d4f[_0x275a('0x3c')][0x0][_0x275a('0x3f')]:undefined)||_0x275a('0x42')},{'name':_0x275a('0x43'),'value':_0x136d4f[_0x275a('0x43')]||(_0x136d4f[_0x275a('0x3c')]&&_0x136d4f[_0x275a('0x3c')][0x1]?_0x136d4f[_0x275a('0x3c')][0x1][_0x275a('0x3f')]:undefined)||_0x275a('0x44')},{'name':'attrFontSize','value':_0x136d4f[_0x275a('0x45')]||(_0x136d4f[_0x275a('0x3c')]&&_0x136d4f[_0x275a('0x3c')][0x2]?_0x136d4f['attrs'][0x2][_0x275a('0x3f')]:undefined)||0xc}];case'counter':return[{'name':_0x275a('0x46'),'value':_0x136d4f['attrMetric']||(_0x136d4f[_0x275a('0x3c')]&&_0x136d4f[_0x275a('0x3c')][0x0]?_0x136d4f[_0x275a('0x3c')][0x0][_0x275a('0x3f')]:undefined)||_0x275a('0x47')},{'name':_0x275a('0x48'),'value':_0x136d4f[_0x275a('0x48')]||(_0x136d4f[_0x275a('0x3c')]&&_0x136d4f[_0x275a('0x3c')][0x1]?_0x136d4f['attrs'][0x1][_0x275a('0x3f')]:undefined)||[]},{'name':_0x275a('0x45'),'value':_0x136d4f[_0x275a('0x45')]||(_0x136d4f[_0x275a('0x3c')]&&_0x136d4f[_0x275a('0x3c')][0x2]?_0x136d4f[_0x275a('0x3c')][0x2][_0x275a('0x3f')]:undefined)||0x14},{'name':_0x275a('0x49'),'value':_0x136d4f[_0x275a('0x49')]||(_0x136d4f[_0x275a('0x3c')]&&_0x136d4f['attrs'][0x3]?_0x136d4f[_0x275a('0x3c')][0x3][_0x275a('0x3f')]:undefined)||_0x275a('0x4a')},{'name':_0x275a('0x4b'),'value':_0x136d4f['attrEmailAccounts']||(_0x136d4f['attrs']&&_0x136d4f[_0x275a('0x3c')][0x4]?_0x136d4f[_0x275a('0x3c')][0x4][_0x275a('0x3f')]:undefined)||''},{'name':_0x275a('0x4c'),'value':_0x136d4f[_0x275a('0x4c')]||(_0x136d4f[_0x275a('0x3c')]&&_0x136d4f[_0x275a('0x3c')][0x5]?_0x136d4f[_0x275a('0x3c')][0x5][_0x275a('0x3f')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x136d4f[_0x275a('0x4d')]||(_0x136d4f[_0x275a('0x3c')]&&_0x136d4f[_0x275a('0x3c')][0x6]?_0x136d4f['attrs'][0x6][_0x275a('0x3f')]:undefined)||''},{'name':_0x275a('0x4e'),'value':_0x136d4f[_0x275a('0x4e')]||(_0x136d4f[_0x275a('0x3c')]&&_0x136d4f[_0x275a('0x3c')][0x7]?_0x136d4f[_0x275a('0x3c')][0x7][_0x275a('0x3f')]:undefined)||''},{'name':_0x275a('0x4f'),'value':_0x136d4f[_0x275a('0x4f')]||(_0x136d4f[_0x275a('0x3c')]&&_0x136d4f[_0x275a('0x3c')][0x8]?_0x136d4f['attrs'][0x8][_0x275a('0x3f')]:undefined)||''},{'name':_0x275a('0x50'),'value':_0x136d4f[_0x275a('0x50')]||(_0x136d4f[_0x275a('0x3c')]&&_0x136d4f['attrs'][0x9]?_0x136d4f[_0x275a('0x3c')][0x9][_0x275a('0x3f')]:undefined)||''}];case _0x275a('0x51'):case _0x275a('0x52'):return[{'name':'attrSerie1','value':_0x136d4f[_0x275a('0x53')]||(_0x136d4f['attrs']&&_0x136d4f[_0x275a('0x3c')][0x0]?_0x136d4f['attrs'][0x0][_0x275a('0x3f')]:undefined)||_0x275a('0x47')},{'name':_0x275a('0x54'),'value':_0x136d4f[_0x275a('0x54')]||(_0x136d4f[_0x275a('0x3c')]&&_0x136d4f[_0x275a('0x3c')][0x1]?_0x136d4f[_0x275a('0x3c')][0x1][_0x275a('0x3f')]:undefined)||null},{'name':_0x275a('0x55'),'value':_0x136d4f['attrSerie3']||(_0x136d4f['attrs']&&_0x136d4f['attrs'][0x2]?_0x136d4f[_0x275a('0x3c')][0x2]['value']:undefined)||null},{'name':_0x275a('0x48'),'value':_0x136d4f[_0x275a('0x48')]||(_0x136d4f[_0x275a('0x3c')]&&_0x136d4f[_0x275a('0x3c')][0x3]?_0x136d4f[_0x275a('0x3c')][0x3][_0x275a('0x3f')]:undefined)||[]},{'name':'attrChannel','value':_0x136d4f['attrChannel']||(_0x136d4f[_0x275a('0x3c')]&&_0x136d4f[_0x275a('0x3c')][0x4]?_0x136d4f[_0x275a('0x3c')][0x4][_0x275a('0x3f')]:undefined)||_0x275a('0x4a')},{'name':_0x275a('0x4b'),'value':_0x136d4f[_0x275a('0x4b')]||(_0x136d4f[_0x275a('0x3c')]&&_0x136d4f[_0x275a('0x3c')][0x5]?_0x136d4f[_0x275a('0x3c')][0x5]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x136d4f[_0x275a('0x4c')]||(_0x136d4f['attrs']&&_0x136d4f['attrs'][0x6]?_0x136d4f['attrs'][0x6][_0x275a('0x3f')]:undefined)||''},{'name':_0x275a('0x4d'),'value':_0x136d4f[_0x275a('0x4d')]||(_0x136d4f['attrs']&&_0x136d4f[_0x275a('0x3c')][0x7]?_0x136d4f[_0x275a('0x3c')][0x7][_0x275a('0x3f')]:undefined)||''},{'name':_0x275a('0x4e'),'value':_0x136d4f[_0x275a('0x4e')]||(_0x136d4f[_0x275a('0x3c')]&&_0x136d4f['attrs'][0x8]?_0x136d4f[_0x275a('0x3c')][0x8][_0x275a('0x3f')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x136d4f[_0x275a('0x4f')]||(_0x136d4f[_0x275a('0x3c')]&&_0x136d4f[_0x275a('0x3c')][0x9]?_0x136d4f[_0x275a('0x3c')][0x9][_0x275a('0x3f')]:undefined)||''},{'name':_0x275a('0x50'),'value':_0x136d4f['attrChatWebsites']||(_0x136d4f[_0x275a('0x3c')]&&_0x136d4f[_0x275a('0x3c')][0xa]?_0x136d4f[_0x275a('0x3c')][0xa][_0x275a('0x3f')]:undefined)||''}];case _0x275a('0x56'):return[{'name':_0x275a('0x57'),'type':_0x136d4f[_0x275a('0x58')]||(_0x136d4f[_0x275a('0x3c')]&&_0x136d4f[_0x275a('0x3c')][0x0]?_0x136d4f['attrs'][0x0][_0x275a('0x3a')]:undefined)||null,'value':_0x136d4f[_0x275a('0x57')]||(_0x136d4f[_0x275a('0x3c')]&&_0x136d4f[_0x275a('0x3c')][0x0]?_0x136d4f[_0x275a('0x3c')][0x0][_0x275a('0x3f')]:undefined)||null},{'name':_0x275a('0x59'),'value':_0x136d4f[_0x275a('0x59')]||(_0x136d4f['attrs']&&_0x136d4f[_0x275a('0x3c')][0x1]?_0x136d4f['attrs'][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x1fb9e6){logger[_0x275a('0x5a')](_0x275a('0x5b'),JSON['stringify'](_0x1fb9e6));return[];}}exports[_0x275a('0x5c')]=function(_0x561a6b,_0x13409b){if(_0x561a6b[_0x275a('0x5d')]){_0x561a6b[_0x275a('0x5d')][_0x275a('0x3c')]=widgetAttributes(_0x561a6b['body']);}return db[_0x275a('0x36')][_0x275a('0x5c')](_0x561a6b[_0x275a('0x5d')],{})['then'](respondWithResult(_0x13409b,0xc9))[_0x275a('0x38')](handleError(_0x13409b,null));};exports[_0x275a('0x25')]=function(_0x29d1db,_0x5d822e){if(_0x29d1db['body']['id']){delete _0x29d1db[_0x275a('0x5d')]['id'];}_0x29d1db[_0x275a('0x5d')]['attrs']=widgetAttributes(_0x29d1db[_0x275a('0x5d')]);return db[_0x275a('0x36')][_0x275a('0x37')]({'where':{'id':_0x29d1db[_0x275a('0x39')]['id']}})[_0x275a('0x26')](handleEntityNotFound(_0x5d822e,null))[_0x275a('0x26')](saveUpdates(_0x29d1db[_0x275a('0x5d')],null))['then'](respondWithResult(_0x5d822e,null))['catch'](handleError(_0x5d822e,null));}; \ No newline at end of file +var _0x8e20=['params','keys','query','filters','intersection','attributes','model','fields','length','includeAll','merge','options','DashboardItem','catch','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie3','voice','web-report','attrReport','reportType','attrRefresh','stringify','create','body','find','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','socket.io-emitter','./dashboardItem.socket','sendStatus','status','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','show'];(function(_0x313009,_0xcd4a44){var _0x23bd8f=function(_0x30a35d){while(--_0x30a35d){_0x313009['push'](_0x313009['shift']());}};_0x23bd8f(++_0xcd4a44);}(_0x8e20,0x1af));var _0x08e2=function(_0x38841c,_0x1af0bf){_0x38841c=_0x38841c-0x0;var _0x500610=_0x8e20[_0x38841c];return _0x500610;};'use strict';var emlformat=require(_0x08e2('0x0'));var rimraf=require(_0x08e2('0x1'));var zipdir=require(_0x08e2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x08e2('0x3'));var moment=require(_0x08e2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x08e2('0x5'));var util=require(_0x08e2('0x6'));var path=require(_0x08e2('0x7'));var sox=require(_0x08e2('0x8'));var csv=require(_0x08e2('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x08e2('0xa'));var _=require(_0x08e2('0xb'));var squel=require('squel');var crypto=require(_0x08e2('0xc'));var jsforce=require(_0x08e2('0xd'));var deskjs=require(_0x08e2('0xe'));var toCsv=require(_0x08e2('0x9'));var querystring=require(_0x08e2('0xf'));var Papa=require(_0x08e2('0x10'));var Redis=require('ioredis');var authService=require(_0x08e2('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x08e2('0x12'));var logger=require(_0x08e2('0x13'))(_0x08e2('0x14'));var utils=require(_0x08e2('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x08e2('0x16'))['db'];config['redis']=_['defaults'](config[_0x08e2('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x08e2('0x18'))(new Redis(config['redis']));require(_0x08e2('0x19'))['register'](socket);function respondWithStatusCode(_0x53a428,_0x4f0f35){_0x4f0f35=_0x4f0f35||0xcc;return function(_0x321f5c){if(_0x321f5c){return _0x53a428[_0x08e2('0x1a')](_0x4f0f35);}return _0x53a428[_0x08e2('0x1b')](_0x4f0f35)['end']();};}function respondWithResult(_0x549025,_0x58996d){_0x58996d=_0x58996d||0xc8;return function(_0x5794c9){if(_0x5794c9){return _0x549025['status'](_0x58996d)['json'](_0x5794c9);}};}function respondWithFilteredResult(_0x38a080,_0x67d949){return function(_0x300934){if(_0x300934){var _0x90db85=typeof _0x67d949[_0x08e2('0x1c')]===_0x08e2('0x1d')&&typeof _0x67d949[_0x08e2('0x1e')]===_0x08e2('0x1d');var _0x2a1c80=_0x300934[_0x08e2('0x1f')];var _0x2384a3=_0x90db85?0x0:_0x67d949['offset'];var _0x5e3cba=_0x90db85?_0x300934['count']:_0x67d949[_0x08e2('0x1c')]+_0x67d949[_0x08e2('0x1e')];var _0x59b200;if(_0x5e3cba>=_0x2a1c80){_0x5e3cba=_0x2a1c80;_0x59b200=0xc8;}else{_0x59b200=0xce;}_0x38a080[_0x08e2('0x1b')](_0x59b200);return _0x38a080['set'](_0x08e2('0x20'),_0x2384a3+'-'+_0x5e3cba+'/'+_0x2a1c80)['json'](_0x300934);}return null;};}function patchUpdates(_0x416e6c){return function(_0x3eab11){try{jsonpatch[_0x08e2('0x21')](_0x3eab11,_0x416e6c,!![]);}catch(_0x3dbd7e){return BPromise[_0x08e2('0x22')](_0x3dbd7e);}return _0x3eab11['save']();};}function saveUpdates(_0x5878a9,_0x5a16ff){return function(_0x24cbc1){if(_0x24cbc1){return _0x24cbc1[_0x08e2('0x23')](_0x5878a9)[_0x08e2('0x24')](function(_0x1ef5ef){return _0x1ef5ef;});}return null;};}function removeEntity(_0x155bea,_0x4dbf2c){return function(_0x4a8102){if(_0x4a8102){return _0x4a8102[_0x08e2('0x25')]()[_0x08e2('0x24')](function(){_0x155bea[_0x08e2('0x1b')](0xcc)[_0x08e2('0x26')]();});}};}function handleEntityNotFound(_0x4d1b29,_0x107ab9){return function(_0x493fad){if(!_0x493fad){_0x4d1b29[_0x08e2('0x1a')](0x194);}return _0x493fad;};}function handleError(_0x8b977,_0x1160b9){_0x1160b9=_0x1160b9||0x1f4;return function(_0x5cdfb2){logger[_0x08e2('0x27')](_0x5cdfb2[_0x08e2('0x28')]);if(_0x5cdfb2[_0x08e2('0x29')]){delete _0x5cdfb2[_0x08e2('0x29')];}_0x8b977['status'](_0x1160b9)[_0x08e2('0x2a')](_0x5cdfb2);};}exports[_0x08e2('0x2b')]=function(_0x30c12b,_0x37d416){var _0x4ad0f9={'raw':![],'where':{'id':_0x30c12b[_0x08e2('0x2c')]['id']}},_0x2ab732={};_0x2ab732['model']=_[_0x08e2('0x2d')](db['DashboardItem']['rawAttributes']);_0x2ab732[_0x08e2('0x2e')]=_[_0x08e2('0x2d')](_0x30c12b[_0x08e2('0x2e')]);_0x2ab732[_0x08e2('0x2f')]=_[_0x08e2('0x30')](_0x2ab732['model'],_0x2ab732[_0x08e2('0x2e')]);_0x4ad0f9[_0x08e2('0x31')]=_['intersection'](_0x2ab732[_0x08e2('0x32')],qs[_0x08e2('0x33')](_0x30c12b['query'][_0x08e2('0x33')]));_0x4ad0f9[_0x08e2('0x31')]=_0x4ad0f9['attributes'][_0x08e2('0x34')]?_0x4ad0f9[_0x08e2('0x31')]:_0x2ab732[_0x08e2('0x32')];if(_0x30c12b[_0x08e2('0x2e')][_0x08e2('0x35')]){_0x4ad0f9['include']=[{'all':!![]}];}_0x4ad0f9=_[_0x08e2('0x36')]({},_0x4ad0f9,_0x30c12b[_0x08e2('0x37')]);return db[_0x08e2('0x38')]['find'](_0x4ad0f9)[_0x08e2('0x24')](handleEntityNotFound(_0x37d416,null))[_0x08e2('0x24')](respondWithResult(_0x37d416,null))[_0x08e2('0x39')](handleError(_0x37d416,null));};exports[_0x08e2('0x25')]=function(_0x30fc9c,_0x10874a){return db[_0x08e2('0x38')]['find']({'where':{'id':_0x30fc9c['params']['id']}})[_0x08e2('0x24')](handleEntityNotFound(_0x10874a,null))[_0x08e2('0x24')](removeEntity(_0x10874a,null))[_0x08e2('0x39')](handleError(_0x10874a,null));};function widgetAttributes(_0x63b7b3){try{switch(_0x63b7b3[_0x08e2('0x3a')]){case _0x08e2('0x3b'):return[{'name':_0x08e2('0x3c'),'value':_0x63b7b3['attrUrl']||(_0x63b7b3['attrs']&&_0x63b7b3[_0x08e2('0x3d')][0x0]?_0x63b7b3['attrs'][0x0][_0x08e2('0x3e')]:undefined)||_0x08e2('0x3f')}];case _0x08e2('0x40'):return[{'name':_0x08e2('0x41'),'value':_0x63b7b3[_0x08e2('0x41')]||(_0x63b7b3[_0x08e2('0x3d')]&&_0x63b7b3['attrs'][0x0]?_0x63b7b3[_0x08e2('0x3d')][0x0][_0x08e2('0x3e')]:undefined)||''}];case _0x08e2('0x42'):return[{'name':'attrHourFormat','value':_0x63b7b3[_0x08e2('0x43')]||(_0x63b7b3['attrs']&&_0x63b7b3[_0x08e2('0x3d')][0x0]?_0x63b7b3[_0x08e2('0x3d')][0x0][_0x08e2('0x3e')]:undefined)||'HH:mm:ss'},{'name':_0x08e2('0x44'),'value':_0x63b7b3['attrTimezone']||(_0x63b7b3[_0x08e2('0x3d')]&&_0x63b7b3[_0x08e2('0x3d')][0x1]?_0x63b7b3['attrs'][0x1][_0x08e2('0x3e')]:undefined)||_0x08e2('0x45')},{'name':_0x08e2('0x46'),'value':_0x63b7b3[_0x08e2('0x46')]||(_0x63b7b3[_0x08e2('0x3d')]&&_0x63b7b3[_0x08e2('0x3d')][0x2]?_0x63b7b3[_0x08e2('0x3d')][0x2][_0x08e2('0x3e')]:undefined)||0xc}];case _0x08e2('0x47'):return[{'name':_0x08e2('0x48'),'value':_0x63b7b3[_0x08e2('0x48')]||(_0x63b7b3[_0x08e2('0x3d')]&&_0x63b7b3[_0x08e2('0x3d')][0x0]?_0x63b7b3[_0x08e2('0x3d')][0x0][_0x08e2('0x3e')]:undefined)||_0x08e2('0x49')},{'name':_0x08e2('0x4a'),'value':_0x63b7b3['attrVoiceQueues']||(_0x63b7b3[_0x08e2('0x3d')]&&_0x63b7b3['attrs'][0x1]?_0x63b7b3[_0x08e2('0x3d')][0x1][_0x08e2('0x3e')]:undefined)||[]},{'name':_0x08e2('0x46'),'value':_0x63b7b3[_0x08e2('0x46')]||(_0x63b7b3[_0x08e2('0x3d')]&&_0x63b7b3[_0x08e2('0x3d')][0x2]?_0x63b7b3[_0x08e2('0x3d')][0x2][_0x08e2('0x3e')]:undefined)||0x14},{'name':'attrChannel','value':_0x63b7b3[_0x08e2('0x4b')]||(_0x63b7b3[_0x08e2('0x3d')]&&_0x63b7b3[_0x08e2('0x3d')][0x3]?_0x63b7b3[_0x08e2('0x3d')][0x3][_0x08e2('0x3e')]:undefined)||'voice'},{'name':_0x08e2('0x4c'),'value':_0x63b7b3['attrEmailAccounts']||(_0x63b7b3[_0x08e2('0x3d')]&&_0x63b7b3[_0x08e2('0x3d')][0x4]?_0x63b7b3[_0x08e2('0x3d')][0x4][_0x08e2('0x3e')]:undefined)||''},{'name':_0x08e2('0x4d'),'value':_0x63b7b3[_0x08e2('0x4d')]||(_0x63b7b3[_0x08e2('0x3d')]&&_0x63b7b3[_0x08e2('0x3d')][0x5]?_0x63b7b3[_0x08e2('0x3d')][0x5][_0x08e2('0x3e')]:undefined)||''},{'name':_0x08e2('0x4e'),'value':_0x63b7b3[_0x08e2('0x4e')]||(_0x63b7b3[_0x08e2('0x3d')]&&_0x63b7b3[_0x08e2('0x3d')][0x6]?_0x63b7b3['attrs'][0x6][_0x08e2('0x3e')]:undefined)||''},{'name':_0x08e2('0x4f'),'value':_0x63b7b3[_0x08e2('0x4f')]||(_0x63b7b3[_0x08e2('0x3d')]&&_0x63b7b3[_0x08e2('0x3d')][0x7]?_0x63b7b3[_0x08e2('0x3d')][0x7][_0x08e2('0x3e')]:undefined)||''},{'name':_0x08e2('0x50'),'value':_0x63b7b3[_0x08e2('0x50')]||(_0x63b7b3[_0x08e2('0x3d')]&&_0x63b7b3[_0x08e2('0x3d')][0x8]?_0x63b7b3[_0x08e2('0x3d')][0x8][_0x08e2('0x3e')]:undefined)||''},{'name':'attrChatWebsites','value':_0x63b7b3[_0x08e2('0x51')]||(_0x63b7b3['attrs']&&_0x63b7b3[_0x08e2('0x3d')][0x9]?_0x63b7b3['attrs'][0x9][_0x08e2('0x3e')]:undefined)||''}];case _0x08e2('0x52'):case _0x08e2('0x53'):return[{'name':'attrSerie1','value':_0x63b7b3[_0x08e2('0x54')]||(_0x63b7b3[_0x08e2('0x3d')]&&_0x63b7b3['attrs'][0x0]?_0x63b7b3[_0x08e2('0x3d')][0x0][_0x08e2('0x3e')]:undefined)||_0x08e2('0x49')},{'name':'attrSerie2','value':_0x63b7b3['attrSerie2']||(_0x63b7b3[_0x08e2('0x3d')]&&_0x63b7b3[_0x08e2('0x3d')][0x1]?_0x63b7b3[_0x08e2('0x3d')][0x1][_0x08e2('0x3e')]:undefined)||null},{'name':_0x08e2('0x55'),'value':_0x63b7b3[_0x08e2('0x55')]||(_0x63b7b3[_0x08e2('0x3d')]&&_0x63b7b3['attrs'][0x2]?_0x63b7b3[_0x08e2('0x3d')][0x2][_0x08e2('0x3e')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x63b7b3[_0x08e2('0x4a')]||(_0x63b7b3[_0x08e2('0x3d')]&&_0x63b7b3['attrs'][0x3]?_0x63b7b3['attrs'][0x3][_0x08e2('0x3e')]:undefined)||[]},{'name':_0x08e2('0x4b'),'value':_0x63b7b3['attrChannel']||(_0x63b7b3[_0x08e2('0x3d')]&&_0x63b7b3[_0x08e2('0x3d')][0x4]?_0x63b7b3[_0x08e2('0x3d')][0x4]['value']:undefined)||_0x08e2('0x56')},{'name':'attrEmailAccounts','value':_0x63b7b3[_0x08e2('0x4c')]||(_0x63b7b3[_0x08e2('0x3d')]&&_0x63b7b3['attrs'][0x5]?_0x63b7b3['attrs'][0x5][_0x08e2('0x3e')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x63b7b3[_0x08e2('0x4d')]||(_0x63b7b3[_0x08e2('0x3d')]&&_0x63b7b3['attrs'][0x6]?_0x63b7b3[_0x08e2('0x3d')][0x6][_0x08e2('0x3e')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x63b7b3[_0x08e2('0x4e')]||(_0x63b7b3[_0x08e2('0x3d')]&&_0x63b7b3['attrs'][0x7]?_0x63b7b3[_0x08e2('0x3d')][0x7][_0x08e2('0x3e')]:undefined)||''},{'name':_0x08e2('0x4f'),'value':_0x63b7b3[_0x08e2('0x4f')]||(_0x63b7b3[_0x08e2('0x3d')]&&_0x63b7b3[_0x08e2('0x3d')][0x8]?_0x63b7b3[_0x08e2('0x3d')][0x8][_0x08e2('0x3e')]:undefined)||''},{'name':_0x08e2('0x50'),'value':_0x63b7b3[_0x08e2('0x50')]||(_0x63b7b3[_0x08e2('0x3d')]&&_0x63b7b3[_0x08e2('0x3d')][0x9]?_0x63b7b3[_0x08e2('0x3d')][0x9]['value']:undefined)||''},{'name':_0x08e2('0x51'),'value':_0x63b7b3[_0x08e2('0x51')]||(_0x63b7b3[_0x08e2('0x3d')]&&_0x63b7b3['attrs'][0xa]?_0x63b7b3[_0x08e2('0x3d')][0xa][_0x08e2('0x3e')]:undefined)||''}];case _0x08e2('0x57'):return[{'name':_0x08e2('0x58'),'type':_0x63b7b3[_0x08e2('0x59')]||(_0x63b7b3[_0x08e2('0x3d')]&&_0x63b7b3[_0x08e2('0x3d')][0x0]?_0x63b7b3[_0x08e2('0x3d')][0x0][_0x08e2('0x3a')]:undefined)||null,'value':_0x63b7b3[_0x08e2('0x58')]||(_0x63b7b3[_0x08e2('0x3d')]&&_0x63b7b3[_0x08e2('0x3d')][0x0]?_0x63b7b3[_0x08e2('0x3d')][0x0]['value']:undefined)||null},{'name':_0x08e2('0x5a'),'value':_0x63b7b3[_0x08e2('0x5a')]||(_0x63b7b3[_0x08e2('0x3d')]&&_0x63b7b3['attrs'][0x1]?_0x63b7b3['attrs'][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x3c6af1){logger['error']('widgetAttributes:\x20%s',JSON[_0x08e2('0x5b')](_0x3c6af1));return[];}}exports[_0x08e2('0x5c')]=function(_0x2b311e,_0x7e7995){if(_0x2b311e[_0x08e2('0x5d')]){_0x2b311e[_0x08e2('0x5d')]['attrs']=widgetAttributes(_0x2b311e['body']);}return db[_0x08e2('0x38')][_0x08e2('0x5c')](_0x2b311e[_0x08e2('0x5d')],{})['then'](respondWithResult(_0x7e7995,0xc9))[_0x08e2('0x39')](handleError(_0x7e7995,null));};exports['update']=function(_0x2effde,_0x575e90){if(_0x2effde[_0x08e2('0x5d')]['id']){delete _0x2effde['body']['id'];}_0x2effde[_0x08e2('0x5d')][_0x08e2('0x3d')]=widgetAttributes(_0x2effde['body']);return db[_0x08e2('0x38')][_0x08e2('0x5e')]({'where':{'id':_0x2effde[_0x08e2('0x2c')]['id']}})[_0x08e2('0x24')](handleEntityNotFound(_0x575e90,null))[_0x08e2('0x24')](saveUpdates(_0x2effde[_0x08e2('0x5d')],null))[_0x08e2('0x24')](respondWithResult(_0x575e90,null))[_0x08e2('0x39')](handleError(_0x575e90,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 7763090..ef359b6 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 _0xe35d=['setMaxListeners','save','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe35d,0xbe));var _0xde35=function(_0x41c025,_0x3ff7de){_0x41c025=_0x41c025-0x0;var _0x1545a1=_0xe35d[_0x41c025];return _0x1545a1;};'use strict';var EventEmitter=require(_0xde35('0x0'));var DashboardItem=require(_0xde35('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xde35('0x2')](0x0);var events={'afterCreate':_0xde35('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4ae282){return function(_0xab808f,_0x1920f0,_0x452949){DashboardItemEvents[_0xde35('0x4')](_0x4ae282+':'+_0xab808f['id'],_0xab808f);DashboardItemEvents[_0xde35('0x4')](_0x4ae282,_0xab808f);_0x452949(null);};}for(var e in events){if(events[_0xde35('0x5')](e)){var event=events[e];DashboardItem[_0xde35('0x6')](e,emitEvent(event));}}module[_0xde35('0x7')]=DashboardItemEvents; \ No newline at end of file +var _0xf32f=['events','../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x4bc2b0,_0x276ffb){var _0x28fe18=function(_0x7a546){while(--_0x7a546){_0x4bc2b0['push'](_0x4bc2b0['shift']());}};_0x28fe18(++_0x276ffb);}(_0xf32f,0x1ef));var _0xff32=function(_0x3e174e,_0x416cb7){_0x3e174e=_0x3e174e-0x0;var _0x369075=_0xf32f[_0x3e174e];return _0x369075;};'use strict';var EventEmitter=require(_0xff32('0x0'));var DashboardItem=require(_0xff32('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xff32('0x2')](0x0);var events={'afterCreate':_0xff32('0x3'),'afterUpdate':'update','afterDestroy':_0xff32('0x4')};function emitEvent(_0x13b0c0){return function(_0x1c0e85,_0x4737a3,_0x76168){DashboardItemEvents['emit'](_0x13b0c0+':'+_0x1c0e85['id'],_0x1c0e85);DashboardItemEvents[_0xff32('0x5')](_0x13b0c0,_0x1c0e85);_0x76168(null);};}for(var e in events){if(events[_0xff32('0x6')](e)){var event=events[e];DashboardItem[_0xff32('0x7')](e,emitEvent(event));}}module[_0xff32('0x8')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 0ba374e..2bdb452 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 _0x1b6d=['path','rimraf','../../config/environment','./dashboardItem.attributes','DashboardItem','dashboard_items','lodash','../../config/logger','moment','bluebird'];(function(_0x4fae97,_0x593088){var _0x550214=function(_0x37cb98){while(--_0x37cb98){_0x4fae97['push'](_0x4fae97['shift']());}};_0x550214(++_0x593088);}(_0x1b6d,0x1e6));var _0xd1b6=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x1b6d[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0xd1b6('0x0'));var util=require('util');var logger=require(_0xd1b6('0x1'))('api');var moment=require(_0xd1b6('0x2'));var BPromise=require(_0xd1b6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd1b6('0x4'));var rimraf=require(_0xd1b6('0x5'));var config=require(_0xd1b6('0x6'));var attributes=require(_0xd1b6('0x7'));module['exports']=function(_0x206666,_0x4c053c){return _0x206666['define'](_0xd1b6('0x8'),attributes,{'tableName':_0xd1b6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa234=['exports','define','DashboardItem','lodash','util','../../config/logger','api','moment','request-promise','rimraf','./dashboardItem.attributes'];(function(_0x1d8f37,_0x733b52){var _0x448234=function(_0x43cba9){while(--_0x43cba9){_0x1d8f37['push'](_0x1d8f37['shift']());}};_0x448234(++_0x733b52);}(_0xa234,0x142));var _0x4a23=function(_0x2aba0b,_0x10f5c9){_0x2aba0b=_0x2aba0b-0x0;var _0x243baa=_0xa234[_0x2aba0b];return _0x243baa;};'use strict';var _=require(_0x4a23('0x0'));var util=require(_0x4a23('0x1'));var logger=require(_0x4a23('0x2'))(_0x4a23('0x3'));var moment=require(_0x4a23('0x4'));var BPromise=require('bluebird');var rp=require(_0x4a23('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4a23('0x6'));var config=require('../../config/environment');var attributes=require(_0x4a23('0x7'));module[_0x4a23('0x8')]=function(_0x21b7e0,_0x21f137){return _0x21b7e0[_0x4a23('0x9')](_0x4a23('0xa'),attributes,{'tableName':'dashboard_items','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 c81ac99..001dce8 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 _0xa688=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x51f4fc,_0x1fe3ef){var _0x4d96fc=function(_0xddc9){while(--_0xddc9){_0x51f4fc['push'](_0x51f4fc['shift']());}};_0x4d96fc(++_0x1fe3ef);}(_0xa688,0xa7));var _0x8a68=function(_0xc3555a,_0x599225){_0xc3555a=_0xc3555a-0x0;var _0x5b6b8a=_0xa688[_0xc3555a];return _0x5b6b8a;};'use strict';var _=require(_0x8a68('0x0'));var util=require(_0x8a68('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8a68('0x2'));var fs=require('fs');var Redis=require(_0x8a68('0x3'));var db=require(_0x8a68('0x4'))['db'];var utils=require(_0x8a68('0x5'));var logger=require(_0x8a68('0x6'))(_0x8a68('0x7'));var config=require(_0x8a68('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8a68('0x9')]({'port':0x232a});config[_0x8a68('0xa')]=_[_0x8a68('0xb')](config['redis'],{'host':_0x8a68('0xc'),'port':0x18eb});var socket=require(_0x8a68('0xd'))(new Redis(config[_0x8a68('0xa')]));require(_0x8a68('0xe'))[_0x8a68('0xf')](socket);function respondWithRpcPromise(_0x405562,_0x384729,_0x235b0f){return new BPromise(function(_0x13870b,_0x26ba07){return client['request'](_0x405562,_0x235b0f)[_0x8a68('0x10')](function(_0x5ed5ae){logger[_0x8a68('0x11')](_0x8a68('0x12'),_0x384729,_0x8a68('0x13'));logger[_0x8a68('0x14')](_0x8a68('0x15'),_0x384729,'request\x20sent',JSON[_0x8a68('0x16')](_0x5ed5ae));if(_0x5ed5ae[_0x8a68('0x17')]){if(_0x5ed5ae[_0x8a68('0x17')][_0x8a68('0x18')]===0x1f4){logger['error'](_0x8a68('0x12'),_0x384729,_0x5ed5ae['error'][_0x8a68('0x19')]);return _0x26ba07(_0x5ed5ae[_0x8a68('0x17')][_0x8a68('0x19')]);}logger[_0x8a68('0x17')](_0x8a68('0x12'),_0x384729,_0x5ed5ae[_0x8a68('0x17')]['message']);return _0x13870b(_0x5ed5ae['error']['message']);}else{logger[_0x8a68('0x11')](_0x8a68('0x12'),_0x384729,_0x8a68('0x13'));_0x13870b(_0x5ed5ae[_0x8a68('0x1a')][_0x8a68('0x19')]);}})[_0x8a68('0x1b')](function(_0x45f6fe){logger['error'](_0x8a68('0x12'),_0x384729,_0x45f6fe);_0x26ba07(_0x45f6fe);});});} \ No newline at end of file +var _0x1bdd=['../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','request','then','info','DashboardItem,\x20%s,\x20%s','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','ioredis','../../mysqldb','../../config/utils'];(function(_0x5966c0,_0x54487c){var _0x17d15c=function(_0x103c90){while(--_0x103c90){_0x5966c0['push'](_0x5966c0['shift']());}};_0x17d15c(++_0x54487c);}(_0x1bdd,0x168));var _0xd1bd=function(_0x18ac3f,_0x386630){_0x18ac3f=_0x18ac3f-0x0;var _0x4c6563=_0x1bdd[_0x18ac3f];return _0x4c6563;};'use strict';var _=require('lodash');var util=require(_0xd1bd('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd1bd('0x1'));var db=require(_0xd1bd('0x2'))['db'];var utils=require(_0xd1bd('0x3'));var logger=require(_0xd1bd('0x4'))(_0xd1bd('0x5'));var config=require('../../config/environment');var jayson=require(_0xd1bd('0x6'));var client=jayson[_0xd1bd('0x7')][_0xd1bd('0x8')]({'port':0x232a});config[_0xd1bd('0x9')]=_[_0xd1bd('0xa')](config['redis'],{'host':_0xd1bd('0xb'),'port':0x18eb});var socket=require(_0xd1bd('0xc'))(new Redis(config['redis']));require(_0xd1bd('0xd'))['register'](socket);function respondWithRpcPromise(_0xcfdc27,_0x171035,_0x2a1593){return new BPromise(function(_0xe6620c,_0xd43e6){return client[_0xd1bd('0xe')](_0xcfdc27,_0x2a1593)[_0xd1bd('0xf')](function(_0x208a14){logger[_0xd1bd('0x10')](_0xd1bd('0x11'),_0x171035,'request\x20sent');logger['debug'](_0xd1bd('0x12'),_0x171035,_0xd1bd('0x13'),JSON[_0xd1bd('0x14')](_0x208a14));if(_0x208a14[_0xd1bd('0x15')]){if(_0x208a14['error'][_0xd1bd('0x16')]===0x1f4){logger[_0xd1bd('0x15')](_0xd1bd('0x11'),_0x171035,_0x208a14[_0xd1bd('0x15')][_0xd1bd('0x17')]);return _0xd43e6(_0x208a14[_0xd1bd('0x15')]['message']);}logger[_0xd1bd('0x15')](_0xd1bd('0x11'),_0x171035,_0x208a14['error'][_0xd1bd('0x17')]);return _0xe6620c(_0x208a14[_0xd1bd('0x15')]['message']);}else{logger['info'](_0xd1bd('0x11'),_0x171035,_0xd1bd('0x13'));_0xe6620c(_0x208a14[_0xd1bd('0x18')][_0xd1bd('0x17')]);}})[_0xd1bd('0x19')](function(_0x130345){logger[_0xd1bd('0x15')](_0xd1bd('0x11'),_0x171035,_0x130345);_0xd43e6(_0x130345);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index cc40e16..dbb95f8 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 _0xd56b=['register','length','dashboardItem:','./dashboardItem.events','save','update','removeListener'];(function(_0x34f229,_0x27d1f2){var _0x153885=function(_0x1ecebd){while(--_0x1ecebd){_0x34f229['push'](_0x34f229['shift']());}};_0x153885(++_0x27d1f2);}(_0xd56b,0x1b5));var _0xbd56=function(_0x4e4766,_0x4f834e){_0x4e4766=_0x4e4766-0x0;var _0x4a24cf=_0xd56b[_0x4e4766];return _0x4a24cf;};'use strict';var DashboardItemEvents=require(_0xbd56('0x0'));var events=[_0xbd56('0x1'),'remove',_0xbd56('0x2')];function createListener(_0x3c5fd8,_0xfad7ca){return function(_0xbe6091){_0xfad7ca['emit'](_0x3c5fd8,_0xbe6091);};}function removeListener(_0xacdc4c,_0x518914){return function(){DashboardItemEvents[_0xbd56('0x3')](_0xacdc4c,_0x518914);};}exports[_0xbd56('0x4')]=function(_0x475af6){for(var _0x5d05cc=0x0,_0x478c9d=events[_0xbd56('0x5')];_0x5d05cc<_0x478c9d;_0x5d05cc++){var _0xda0dd=events[_0x5d05cc];var _0x171d4a=createListener(_0xbd56('0x6')+_0xda0dd,_0x475af6);DashboardItemEvents['on'](_0xda0dd,_0x171d4a);}}; \ No newline at end of file +var _0x34a1=['./dashboardItem.events','remove','update','emit','removeListener','register','length','dashboardItem:'];(function(_0x3a0188,_0x1f3123){var _0x499e2f=function(_0x2dd064){while(--_0x2dd064){_0x3a0188['push'](_0x3a0188['shift']());}};_0x499e2f(++_0x1f3123);}(_0x34a1,0x68));var _0x134a=function(_0x43fc1b,_0x40a7e5){_0x43fc1b=_0x43fc1b-0x0;var _0x59c76a=_0x34a1[_0x43fc1b];return _0x59c76a;};'use strict';var DashboardItemEvents=require(_0x134a('0x0'));var events=['save',_0x134a('0x1'),_0x134a('0x2')];function createListener(_0x1c6a07,_0x57413b){return function(_0xa0defc){_0x57413b[_0x134a('0x3')](_0x1c6a07,_0xa0defc);};}function removeListener(_0x12df84,_0x8f4c9c){return function(){DashboardItemEvents[_0x134a('0x4')](_0x12df84,_0x8f4c9c);};}exports[_0x134a('0x5')]=function(_0x33892e){for(var _0x36a3db=0x0,_0x2f855d=events[_0x134a('0x6')];_0x36a3db<_0x2f855d;_0x36a3db++){var _0x10e9b1=events[_0x36a3db];var _0x34173a=createListener(_0x134a('0x7')+_0x10e9b1,_0x33892e);DashboardItemEvents['on'](_0x10e9b1,_0x34173a);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index a5b90f8..d8f2a3f 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 _0x1b77=['update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','show','post','create','put'];(function(_0x239b9c,_0x26b437){var _0x437dab=function(_0x57c40f){while(--_0x57c40f){_0x239b9c['push'](_0x239b9c['shift']());}};_0x437dab(++_0x26b437);}(_0x1b77,0xe0));var _0x71b7=function(_0x2591d7,_0x1334ae){_0x2591d7=_0x2591d7-0x0;var _0x5b1ec1=_0x1b77[_0x2591d7];return _0x5b1ec1;};'use strict';var multer=require(_0x71b7('0x0'));var util=require(_0x71b7('0x1'));var path=require('path');var timeout=require(_0x71b7('0x2'));var express=require(_0x71b7('0x3'));var router=express[_0x71b7('0x4')]();var fs_extra=require(_0x71b7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x71b7('0x6'));var config=require(_0x71b7('0x7'));var controller=require(_0x71b7('0x8'));router[_0x71b7('0x9')](_0x71b7('0xa'),auth[_0x71b7('0xb')](),controller[_0x71b7('0xc')]);router[_0x71b7('0xd')]('/',auth['isAuthenticated'](),controller[_0x71b7('0xe')]);router[_0x71b7('0xf')](_0x71b7('0xa'),auth[_0x71b7('0xb')](),controller[_0x71b7('0x10')]);router[_0x71b7('0x11')](_0x71b7('0xa'),auth[_0x71b7('0xb')](),controller[_0x71b7('0x12')]);module[_0x71b7('0x13')]=router; \ No newline at end of file +var _0x4265=['./dashboardItem.controller','/:id','isAuthenticated','show','post','create','update','delete','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x101802,_0x11f913){var _0x5d61ce=function(_0x4acc0){while(--_0x4acc0){_0x101802['push'](_0x101802['shift']());}};_0x5d61ce(++_0x11f913);}(_0x4265,0x16e));var _0x5426=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x4265[_0x4ae6ef];return _0x3cbb4e;};'use strict';var multer=require('multer');var util=require(_0x5426('0x0'));var path=require(_0x5426('0x1'));var timeout=require(_0x5426('0x2'));var express=require(_0x5426('0x3'));var router=express['Router']();var fs_extra=require(_0x5426('0x4'));var auth=require(_0x5426('0x5'));var interaction=require(_0x5426('0x6'));var config=require(_0x5426('0x7'));var controller=require(_0x5426('0x8'));router['get'](_0x5426('0x9'),auth[_0x5426('0xa')](),controller[_0x5426('0xb')]);router[_0x5426('0xc')]('/',auth[_0x5426('0xa')](),controller[_0x5426('0xd')]);router['put'](_0x5426('0x9'),auth[_0x5426('0xa')](),controller[_0x5426('0xe')]);router[_0x5426('0xf')]('/:id',auth[_0x5426('0xa')](),controller['destroy']);module[_0x5426('0x10')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 5fccc1e..a362dac 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 _0x791f=['exports','STRING','ENUM','first','second','third'];(function(_0x77d286,_0x1ddc6d){var _0x5446a5=function(_0x45e2cf){while(--_0x45e2cf){_0x77d286['push'](_0x77d286['shift']());}};_0x5446a5(++_0x1ddc6d);}(_0x791f,0xd8));var _0xf791=function(_0x946518,_0x22816f){_0x946518=_0x946518-0x0;var _0x909b69=_0x791f[_0x946518];return _0x909b69;};'use strict';var Sequelize=require('sequelize');module[_0xf791('0x0')]={'name':{'type':Sequelize[_0xf791('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0xf791('0x2')](_0xf791('0x3'),_0xf791('0x4'),_0xf791('0x5')),'allowNull':![],'defaultValue':_0xf791('0x3')},'description':{'type':Sequelize[_0xf791('0x1')]}}; \ No newline at end of file +var _0xb2bb=['third','STRING','first'];(function(_0x193ab1,_0x16aa17){var _0xa576a=function(_0x5b562d){while(--_0x5b562d){_0x193ab1['push'](_0x193ab1['shift']());}};_0xa576a(++_0x16aa17);}(_0xb2bb,0x1f4));var _0xbb2b=function(_0x145b3c,_0x31ea4a){_0x145b3c=_0x145b3c-0x0;var _0x1b6e36=_0xb2bb[_0x145b3c];return _0x1b6e36;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0xbb2b('0x0'),'second',_0xbb2b('0x1')),'allowNull':![],'defaultValue':_0xbb2b('0x0')},'description':{'type':Sequelize[_0xbb2b('0x2')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index ae4159e..df2f4a8 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 _0x0b9b=['rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','get','Dispositions','error','stack','name','index','Disposition'];(function(_0x37272e,_0x393951){var _0x24ed60=function(_0x15cdf9){while(--_0x15cdf9){_0x37272e['push'](_0x37272e['shift']());}};_0x24ed60(++_0x393951);}(_0x0b9b,0x1b9));var _0xb0b9=function(_0x87ce7e,_0xedbc27){_0x87ce7e=_0x87ce7e-0x0;var _0x5606ca=_0x0b9b[_0x87ce7e];return _0x5606ca;};'use strict';var emlformat=require(_0xb0b9('0x0'));var rimraf=require(_0xb0b9('0x1'));var zipdir=require(_0xb0b9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb0b9('0x3'));var moment=require(_0xb0b9('0x4'));var BPromise=require(_0xb0b9('0x5'));var Mustache=require('mustache');var util=require(_0xb0b9('0x6'));var path=require(_0xb0b9('0x7'));var sox=require(_0xb0b9('0x8'));var csv=require(_0xb0b9('0x9'));var ejs=require(_0xb0b9('0xa'));var fs=require('fs');var fs_extra=require(_0xb0b9('0xb'));var _=require('lodash');var squel=require(_0xb0b9('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb0b9('0xd'));var toCsv=require(_0xb0b9('0x9'));var querystring=require('querystring');var Papa=require(_0xb0b9('0xe'));var Redis=require(_0xb0b9('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb0b9('0x10'));var as=require(_0xb0b9('0x11'));var hardwareService=require(_0xb0b9('0x12'));var logger=require('../../config/logger')(_0xb0b9('0x13'));var utils=require(_0xb0b9('0x14'));var config=require(_0xb0b9('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xb0b9('0x16'))['db'];function respondWithStatusCode(_0x50006e,_0x3d0083){_0x3d0083=_0x3d0083||0xcc;return function(_0xfaa993){if(_0xfaa993){return _0x50006e[_0xb0b9('0x17')](_0x3d0083);}return _0x50006e[_0xb0b9('0x18')](_0x3d0083)[_0xb0b9('0x19')]();};}function respondWithResult(_0x12e1fa,_0x30e82c){_0x30e82c=_0x30e82c||0xc8;return function(_0x5ec446){if(_0x5ec446){return _0x12e1fa['status'](_0x30e82c)[_0xb0b9('0x1a')](_0x5ec446);}};}function respondWithFilteredResult(_0xca87e7,_0x9e42ed){return function(_0x54b4db){if(_0x54b4db){var _0x4f9b65=typeof _0x9e42ed['offset']===_0xb0b9('0x1b')&&typeof _0x9e42ed[_0xb0b9('0x1c')]==='undefined';var _0x31a23a=_0x54b4db[_0xb0b9('0x1d')];var _0x394bb1=_0x4f9b65?0x0:_0x9e42ed[_0xb0b9('0x1e')];var _0x43bb0f=_0x4f9b65?_0x54b4db[_0xb0b9('0x1d')]:_0x9e42ed[_0xb0b9('0x1e')]+_0x9e42ed[_0xb0b9('0x1c')];var _0x12a3c3;if(_0x43bb0f>=_0x31a23a){_0x43bb0f=_0x31a23a;_0x12a3c3=0xc8;}else{_0x12a3c3=0xce;}_0xca87e7[_0xb0b9('0x18')](_0x12a3c3);return _0xca87e7[_0xb0b9('0x1f')](_0xb0b9('0x20'),_0x394bb1+'-'+_0x43bb0f+'/'+_0x31a23a)[_0xb0b9('0x1a')](_0x54b4db);}return null;};}function patchUpdates(_0x15b2c2){return function(_0x430807){try{jsonpatch[_0xb0b9('0x21')](_0x430807,_0x15b2c2,!![]);}catch(_0x1d4b44){return BPromise[_0xb0b9('0x22')](_0x1d4b44);}return _0x430807['save']();};}function saveUpdates(_0x4a9c0b,_0x79a408){return function(_0x4e3829){if(_0x4e3829){return _0x4e3829[_0xb0b9('0x23')](_0x4a9c0b)[_0xb0b9('0x24')](function(_0x546fd5){return _0x546fd5;});}return null;};}function removeEntity(_0xd11edf,_0x162124){return function(_0x5595b5){if(_0x5595b5){return _0x5595b5[_0xb0b9('0x25')]()[_0xb0b9('0x24')](function(){var _0x5ea3a9=_0x5595b5[_0xb0b9('0x26')]({'plain':!![]});var _0x45e7c6=_0xb0b9('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x45e7c6,'resourceId':_0x5ea3a9['id']}})[_0xb0b9('0x24')](function(){return _0x5595b5;});})[_0xb0b9('0x24')](function(){_0xd11edf[_0xb0b9('0x18')](0xcc)[_0xb0b9('0x19')]();});}};}function handleEntityNotFound(_0x2ec4dc,_0xc6092c){return function(_0x4c2588){if(!_0x4c2588){_0x2ec4dc[_0xb0b9('0x17')](0x194);}return _0x4c2588;};}function handleError(_0x104fd0,_0x2e75de){_0x2e75de=_0x2e75de||0x1f4;return function(_0x3b5fd4){logger[_0xb0b9('0x28')](_0x3b5fd4[_0xb0b9('0x29')]);if(_0x3b5fd4[_0xb0b9('0x2a')]){delete _0x3b5fd4[_0xb0b9('0x2a')];}_0x104fd0[_0xb0b9('0x18')](_0x2e75de)['send'](_0x3b5fd4);};}exports[_0xb0b9('0x2b')]=function(_0x31f8b5,_0x57a0bf){var _0x26bfda={},_0x27a798={},_0x395908={'count':0x0,'rows':[]};var _0x4ac3f4=_['map'](db[_0xb0b9('0x2c')][_0xb0b9('0x2d')],function(_0x258419){return{'name':_0x258419[_0xb0b9('0x2e')],'type':_0x258419[_0xb0b9('0x2f')][_0xb0b9('0x30')]};});_0x27a798[_0xb0b9('0x31')]=_['map'](_0x4ac3f4,_0xb0b9('0x2a'));_0x27a798[_0xb0b9('0x32')]=_[_0xb0b9('0x33')](_0x31f8b5['query']);_0x27a798[_0xb0b9('0x34')]=_[_0xb0b9('0x35')](_0x27a798[_0xb0b9('0x31')],_0x27a798['query']);_0x26bfda['attributes']=_['intersection'](_0x27a798[_0xb0b9('0x31')],qs[_0xb0b9('0x36')](_0x31f8b5[_0xb0b9('0x32')]['fields']));_0x26bfda[_0xb0b9('0x37')]=_0x26bfda[_0xb0b9('0x37')][_0xb0b9('0x38')]?_0x26bfda[_0xb0b9('0x37')]:_0x27a798[_0xb0b9('0x31')];if(!_0x31f8b5['query'][_0xb0b9('0x39')]('nolimit')){_0x26bfda['limit']=qs[_0xb0b9('0x1c')](_0x31f8b5[_0xb0b9('0x32')][_0xb0b9('0x1c')]);_0x26bfda[_0xb0b9('0x1e')]=qs[_0xb0b9('0x1e')](_0x31f8b5[_0xb0b9('0x32')][_0xb0b9('0x1e')]);}_0x26bfda[_0xb0b9('0x3a')]=qs[_0xb0b9('0x3b')](_0x31f8b5[_0xb0b9('0x32')][_0xb0b9('0x3b')]);_0x26bfda[_0xb0b9('0x3c')]=qs['filters'](_['pick'](_0x31f8b5['query'],_0x27a798[_0xb0b9('0x34')]),_0x4ac3f4);if(_0x31f8b5[_0xb0b9('0x32')][_0xb0b9('0x3d')]){_0x26bfda[_0xb0b9('0x3c')]=_[_0xb0b9('0x3e')](_0x26bfda[_0xb0b9('0x3c')],{'$or':_['map'](_0x4ac3f4,function(_0x5bd8e7){if(_0x5bd8e7[_0xb0b9('0x2f')]!==_0xb0b9('0x3f')){var _0x455504={};_0x455504[_0x5bd8e7[_0xb0b9('0x2a')]]={'$like':'%'+_0x31f8b5[_0xb0b9('0x32')][_0xb0b9('0x3d')]+'%'};return _0x455504;}})});}_0x26bfda=_['merge']({},_0x26bfda,_0x31f8b5[_0xb0b9('0x40')]);var _0x2a3487={'where':_0x26bfda[_0xb0b9('0x3c')]};return db[_0xb0b9('0x2c')][_0xb0b9('0x1d')](_0x2a3487)['then'](function(_0x224141){_0x395908[_0xb0b9('0x1d')]=_0x224141;if(_0x31f8b5[_0xb0b9('0x32')]['includeAll']){_0x26bfda[_0xb0b9('0x41')]=[{'all':!![]}];}return db[_0xb0b9('0x2c')][_0xb0b9('0x42')](_0x26bfda);})[_0xb0b9('0x24')](function(_0x2478ed){_0x395908[_0xb0b9('0x43')]=_0x2478ed;return _0x395908;})[_0xb0b9('0x24')](respondWithFilteredResult(_0x57a0bf,_0x26bfda))[_0xb0b9('0x44')](handleError(_0x57a0bf,null));};exports['show']=function(_0x312546,_0x3c9efb){var _0x1134f8={'raw':!![],'where':{'id':_0x312546[_0xb0b9('0x45')]['id']}},_0xafe5ec={};_0xafe5ec[_0xb0b9('0x31')]=_[_0xb0b9('0x33')](db[_0xb0b9('0x2c')][_0xb0b9('0x2d')]);_0xafe5ec['query']=_[_0xb0b9('0x33')](_0x312546[_0xb0b9('0x32')]);_0xafe5ec[_0xb0b9('0x34')]=_[_0xb0b9('0x35')](_0xafe5ec[_0xb0b9('0x31')],_0xafe5ec[_0xb0b9('0x32')]);_0x1134f8['attributes']=_['intersection'](_0xafe5ec[_0xb0b9('0x31')],qs['fields'](_0x312546[_0xb0b9('0x32')][_0xb0b9('0x36')]));_0x1134f8['attributes']=_0x1134f8[_0xb0b9('0x37')][_0xb0b9('0x38')]?_0x1134f8[_0xb0b9('0x37')]:_0xafe5ec['model'];if(_0x312546[_0xb0b9('0x32')][_0xb0b9('0x46')]){_0x1134f8[_0xb0b9('0x41')]=[{'all':!![]}];}_0x1134f8=_[_0xb0b9('0x3e')]({},_0x1134f8,_0x312546[_0xb0b9('0x40')]);return db[_0xb0b9('0x2c')]['find'](_0x1134f8)['then'](handleEntityNotFound(_0x3c9efb,null))[_0xb0b9('0x24')](respondWithResult(_0x3c9efb,null))[_0xb0b9('0x44')](handleError(_0x3c9efb,null));};exports['create']=function(_0x5abd5b,_0x4706b5){return db['Disposition'][_0xb0b9('0x47')](_0x5abd5b[_0xb0b9('0x48')],{})[_0xb0b9('0x24')](function(_0x20fa33){var _0xe7f609=_0x5abd5b[_0xb0b9('0x49')][_0xb0b9('0x26')]({'plain':!![]});if(!_0xe7f609)throw new Error(_0xb0b9('0x4a'));if(_0xe7f609['role']===_0xb0b9('0x49')){var _0xaed38e=_0x20fa33[_0xb0b9('0x26')]({'plain':!![]});var _0x16e3d6=_0xb0b9('0x27');return db[_0xb0b9('0x4b')]['find']({'where':{'name':_0x16e3d6,'userProfileId':_0xe7f609[_0xb0b9('0x4c')]},'raw':!![]})[_0xb0b9('0x24')](function(_0x323f8f){if(_0x323f8f&&_0x323f8f[_0xb0b9('0x4d')]===0x0){return db[_0xb0b9('0x4e')][_0xb0b9('0x47')]({'name':_0xaed38e['name'],'resourceId':_0xaed38e['id'],'type':_0x323f8f['name'],'sectionId':_0x323f8f['id']},{})[_0xb0b9('0x24')](function(){return _0x20fa33;});}else{return _0x20fa33;}})[_0xb0b9('0x44')](function(_0x5f245e){logger[_0xb0b9('0x28')](_0xb0b9('0x4f'),_0x5f245e);throw _0x5f245e;});}return _0x20fa33;})[_0xb0b9('0x24')](respondWithResult(_0x4706b5,0xc9))[_0xb0b9('0x44')](handleError(_0x4706b5,null));};exports['update']=function(_0x5a6781,_0x452bd4){if(_0x5a6781[_0xb0b9('0x48')]['id']){delete _0x5a6781['body']['id'];}return db[_0xb0b9('0x2c')][_0xb0b9('0x50')]({'where':{'id':_0x5a6781[_0xb0b9('0x45')]['id']}})[_0xb0b9('0x24')](handleEntityNotFound(_0x452bd4,null))['then'](saveUpdates(_0x5a6781[_0xb0b9('0x48')],null))[_0xb0b9('0x24')](respondWithResult(_0x452bd4,null))[_0xb0b9('0x44')](handleError(_0x452bd4,null));};exports['destroy']=function(_0x10a080,_0x43eb75){return db['Disposition'][_0xb0b9('0x50')]({'where':{'id':_0x10a080[_0xb0b9('0x45')]['id']}})[_0xb0b9('0x24')](handleEntityNotFound(_0x43eb75,null))['then'](removeEntity(_0x43eb75,null))[_0xb0b9('0x44')](handleError(_0x43eb75,null));}; \ No newline at end of file +var _0x1250=['../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','Dispositions','UserProfileResource','error','stack','name','index','map','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','Disposition','includeAll','include','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils'];(function(_0x5a2d95,_0xb362e5){var _0x2c3986=function(_0x5cce7c){while(--_0x5cce7c){_0x5a2d95['push'](_0x5a2d95['shift']());}};_0x2c3986(++_0xb362e5);}(_0x1250,0xde));var _0x0125=function(_0x58adfc,_0x516ff8){_0x58adfc=_0x58adfc-0x0;var _0xc229c8=_0x1250[_0x58adfc];return _0xc229c8;};'use strict';var emlformat=require(_0x0125('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0125('0x1'));var jsonpatch=require(_0x0125('0x2'));var rp=require(_0x0125('0x3'));var moment=require(_0x0125('0x4'));var BPromise=require(_0x0125('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0125('0x6'));var sox=require(_0x0125('0x7'));var csv=require(_0x0125('0x8'));var ejs=require(_0x0125('0x9'));var fs=require('fs');var fs_extra=require(_0x0125('0xa'));var _=require('lodash');var squel=require(_0x0125('0xb'));var crypto=require(_0x0125('0xc'));var jsforce=require(_0x0125('0xd'));var deskjs=require(_0x0125('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0125('0xf'));var Papa=require('papaparse');var Redis=require(_0x0125('0x10'));var authService=require(_0x0125('0x11'));var qs=require(_0x0125('0x12'));var as=require(_0x0125('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x0125('0x14'));var config=require(_0x0125('0x15'));var licenseUtil=require(_0x0125('0x16'));var db=require(_0x0125('0x17'))['db'];function respondWithStatusCode(_0x3f71d4,_0x4b4bdf){_0x4b4bdf=_0x4b4bdf||0xcc;return function(_0x53f521){if(_0x53f521){return _0x3f71d4['sendStatus'](_0x4b4bdf);}return _0x3f71d4[_0x0125('0x18')](_0x4b4bdf)[_0x0125('0x19')]();};}function respondWithResult(_0x2a3bd2,_0x505838){_0x505838=_0x505838||0xc8;return function(_0x219873){if(_0x219873){return _0x2a3bd2[_0x0125('0x18')](_0x505838)[_0x0125('0x1a')](_0x219873);}};}function respondWithFilteredResult(_0x5dedfa,_0x27e979){return function(_0x441140){if(_0x441140){var _0x178d5d=typeof _0x27e979[_0x0125('0x1b')]===_0x0125('0x1c')&&typeof _0x27e979[_0x0125('0x1d')]===_0x0125('0x1c');var _0x5efac0=_0x441140[_0x0125('0x1e')];var _0x2634b9=_0x178d5d?0x0:_0x27e979[_0x0125('0x1b')];var _0x2562ae=_0x178d5d?_0x441140['count']:_0x27e979[_0x0125('0x1b')]+_0x27e979[_0x0125('0x1d')];var _0x79c804;if(_0x2562ae>=_0x5efac0){_0x2562ae=_0x5efac0;_0x79c804=0xc8;}else{_0x79c804=0xce;}_0x5dedfa[_0x0125('0x18')](_0x79c804);return _0x5dedfa[_0x0125('0x1f')](_0x0125('0x20'),_0x2634b9+'-'+_0x2562ae+'/'+_0x5efac0)[_0x0125('0x1a')](_0x441140);}return null;};}function patchUpdates(_0x4b82e1){return function(_0x4b13d1){try{jsonpatch[_0x0125('0x21')](_0x4b13d1,_0x4b82e1,!![]);}catch(_0x4546de){return BPromise[_0x0125('0x22')](_0x4546de);}return _0x4b13d1[_0x0125('0x23')]();};}function saveUpdates(_0x4a1382,_0x2020f8){return function(_0x5af96a){if(_0x5af96a){return _0x5af96a[_0x0125('0x24')](_0x4a1382)['then'](function(_0x2aa796){return _0x2aa796;});}return null;};}function removeEntity(_0x18921f,_0x4716b2){return function(_0x23243a){if(_0x23243a){return _0x23243a[_0x0125('0x25')]()[_0x0125('0x26')](function(){var _0x2ee2e6=_0x23243a[_0x0125('0x27')]({'plain':!![]});var _0x4dc75d=_0x0125('0x28');return db[_0x0125('0x29')][_0x0125('0x25')]({'where':{'type':_0x4dc75d,'resourceId':_0x2ee2e6['id']}})[_0x0125('0x26')](function(){return _0x23243a;});})[_0x0125('0x26')](function(){_0x18921f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x18457f,_0x533951){return function(_0x546d21){if(!_0x546d21){_0x18457f['sendStatus'](0x194);}return _0x546d21;};}function handleError(_0x454914,_0x46642d){_0x46642d=_0x46642d||0x1f4;return function(_0x56759c){logger[_0x0125('0x2a')](_0x56759c[_0x0125('0x2b')]);if(_0x56759c[_0x0125('0x2c')]){delete _0x56759c[_0x0125('0x2c')];}_0x454914[_0x0125('0x18')](_0x46642d)['send'](_0x56759c);};}exports[_0x0125('0x2d')]=function(_0x1be9f6,_0x534234){var _0xbcb8df={},_0x1124b2={},_0x49023b={'count':0x0,'rows':[]};var _0x5b9f87=_[_0x0125('0x2e')](db['Disposition']['rawAttributes'],function(_0x40ef2c){return{'name':_0x40ef2c['fieldName'],'type':_0x40ef2c[_0x0125('0x2f')][_0x0125('0x30')]};});_0x1124b2[_0x0125('0x31')]=_[_0x0125('0x2e')](_0x5b9f87,_0x0125('0x2c'));_0x1124b2[_0x0125('0x32')]=_[_0x0125('0x33')](_0x1be9f6['query']);_0x1124b2['filters']=_[_0x0125('0x34')](_0x1124b2['model'],_0x1124b2[_0x0125('0x32')]);_0xbcb8df[_0x0125('0x35')]=_['intersection'](_0x1124b2[_0x0125('0x31')],qs[_0x0125('0x36')](_0x1be9f6[_0x0125('0x32')]['fields']));_0xbcb8df['attributes']=_0xbcb8df[_0x0125('0x35')][_0x0125('0x37')]?_0xbcb8df[_0x0125('0x35')]:_0x1124b2[_0x0125('0x31')];if(!_0x1be9f6[_0x0125('0x32')]['hasOwnProperty'](_0x0125('0x38'))){_0xbcb8df['limit']=qs[_0x0125('0x1d')](_0x1be9f6[_0x0125('0x32')][_0x0125('0x1d')]);_0xbcb8df[_0x0125('0x1b')]=qs['offset'](_0x1be9f6[_0x0125('0x32')][_0x0125('0x1b')]);}_0xbcb8df[_0x0125('0x39')]=qs['sort'](_0x1be9f6[_0x0125('0x32')][_0x0125('0x3a')]);_0xbcb8df[_0x0125('0x3b')]=qs[_0x0125('0x3c')](_[_0x0125('0x3d')](_0x1be9f6['query'],_0x1124b2[_0x0125('0x3c')]),_0x5b9f87);if(_0x1be9f6[_0x0125('0x32')][_0x0125('0x3e')]){_0xbcb8df[_0x0125('0x3b')]=_[_0x0125('0x3f')](_0xbcb8df[_0x0125('0x3b')],{'$or':_[_0x0125('0x2e')](_0x5b9f87,function(_0x283004){if(_0x283004[_0x0125('0x2f')]!==_0x0125('0x40')){var _0x41a502={};_0x41a502[_0x283004[_0x0125('0x2c')]]={'$like':'%'+_0x1be9f6[_0x0125('0x32')][_0x0125('0x3e')]+'%'};return _0x41a502;}})});}_0xbcb8df=_['merge']({},_0xbcb8df,_0x1be9f6[_0x0125('0x41')]);var _0x19a1c7={'where':_0xbcb8df[_0x0125('0x3b')]};return db[_0x0125('0x42')][_0x0125('0x1e')](_0x19a1c7)[_0x0125('0x26')](function(_0xebed68){_0x49023b[_0x0125('0x1e')]=_0xebed68;if(_0x1be9f6[_0x0125('0x32')][_0x0125('0x43')]){_0xbcb8df[_0x0125('0x44')]=[{'all':!![]}];}return db[_0x0125('0x42')]['findAll'](_0xbcb8df);})[_0x0125('0x26')](function(_0x97fb82){_0x49023b['rows']=_0x97fb82;return _0x49023b;})['then'](respondWithFilteredResult(_0x534234,_0xbcb8df))[_0x0125('0x45')](handleError(_0x534234,null));};exports[_0x0125('0x46')]=function(_0x92d7b7,_0x5e2a93){var _0x11f5dc={'raw':!![],'where':{'id':_0x92d7b7[_0x0125('0x47')]['id']}},_0xbebd4d={};_0xbebd4d[_0x0125('0x31')]=_[_0x0125('0x33')](db[_0x0125('0x42')]['rawAttributes']);_0xbebd4d[_0x0125('0x32')]=_['keys'](_0x92d7b7[_0x0125('0x32')]);_0xbebd4d['filters']=_[_0x0125('0x34')](_0xbebd4d['model'],_0xbebd4d[_0x0125('0x32')]);_0x11f5dc['attributes']=_['intersection'](_0xbebd4d[_0x0125('0x31')],qs['fields'](_0x92d7b7['query'][_0x0125('0x36')]));_0x11f5dc[_0x0125('0x35')]=_0x11f5dc[_0x0125('0x35')][_0x0125('0x37')]?_0x11f5dc[_0x0125('0x35')]:_0xbebd4d[_0x0125('0x31')];if(_0x92d7b7[_0x0125('0x32')][_0x0125('0x43')]){_0x11f5dc[_0x0125('0x44')]=[{'all':!![]}];}_0x11f5dc=_[_0x0125('0x3f')]({},_0x11f5dc,_0x92d7b7[_0x0125('0x41')]);return db[_0x0125('0x42')][_0x0125('0x48')](_0x11f5dc)[_0x0125('0x26')](handleEntityNotFound(_0x5e2a93,null))[_0x0125('0x26')](respondWithResult(_0x5e2a93,null))[_0x0125('0x45')](handleError(_0x5e2a93,null));};exports[_0x0125('0x49')]=function(_0x3067e4,_0x3d080f){return db[_0x0125('0x42')]['create'](_0x3067e4[_0x0125('0x4a')],{})[_0x0125('0x26')](function(_0xf71d9e){var _0x228e85=_0x3067e4['user']['get']({'plain':!![]});if(!_0x228e85)throw new Error(_0x0125('0x4b'));if(_0x228e85[_0x0125('0x4c')]===_0x0125('0x4d')){var _0x4a3259=_0xf71d9e[_0x0125('0x27')]({'plain':!![]});var _0x2d8c1e=_0x0125('0x28');return db[_0x0125('0x4e')]['find']({'where':{'name':_0x2d8c1e,'userProfileId':_0x228e85['userProfileId']},'raw':!![]})[_0x0125('0x26')](function(_0x135273){if(_0x135273&&_0x135273[_0x0125('0x4f')]===0x0){return db[_0x0125('0x29')][_0x0125('0x49')]({'name':_0x4a3259['name'],'resourceId':_0x4a3259['id'],'type':_0x135273[_0x0125('0x2c')],'sectionId':_0x135273['id']},{})[_0x0125('0x26')](function(){return _0xf71d9e;});}else{return _0xf71d9e;}})[_0x0125('0x45')](function(_0x10c0e7){logger[_0x0125('0x2a')](_0x0125('0x50'),_0x10c0e7);throw _0x10c0e7;});}return _0xf71d9e;})[_0x0125('0x26')](respondWithResult(_0x3d080f,0xc9))[_0x0125('0x45')](handleError(_0x3d080f,null));};exports[_0x0125('0x24')]=function(_0x4d28d0,_0x362bf6){if(_0x4d28d0[_0x0125('0x4a')]['id']){delete _0x4d28d0[_0x0125('0x4a')]['id'];}return db[_0x0125('0x42')]['find']({'where':{'id':_0x4d28d0[_0x0125('0x47')]['id']}})['then'](handleEntityNotFound(_0x362bf6,null))[_0x0125('0x26')](saveUpdates(_0x4d28d0[_0x0125('0x4a')],null))[_0x0125('0x26')](respondWithResult(_0x362bf6,null))[_0x0125('0x45')](handleError(_0x362bf6,null));};exports[_0x0125('0x25')]=function(_0xaa9672,_0x3540a2){return db[_0x0125('0x42')][_0x0125('0x48')]({'where':{'id':_0xaa9672['params']['id']}})[_0x0125('0x26')](handleEntityNotFound(_0x3540a2,null))[_0x0125('0x26')](removeEntity(_0x3540a2,null))[_0x0125('0x45')](handleError(_0x3540a2,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index a3a0575..51eee15 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 _0x6c85=['../../config/environment','exports','define','Disposition','tools_dispositions','name','name_chat','name_mail','MailAccountId','name_sms','SmsAccountId','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x46d4a2,_0x3a21c3){var _0x5e032c=function(_0x14fa1a){while(--_0x14fa1a){_0x46d4a2['push'](_0x46d4a2['shift']());}};_0x5e032c(++_0x3a21c3);}(_0x6c85,0x160));var _0x56c8=function(_0x5a7b40,_0x585230){_0x5a7b40=_0x5a7b40-0x0;var _0x463559=_0x6c85[_0x5a7b40];return _0x463559;};'use strict';var _=require(_0x56c8('0x0'));var util=require('util');var logger=require(_0x56c8('0x1'))(_0x56c8('0x2'));var moment=require(_0x56c8('0x3'));var BPromise=require(_0x56c8('0x4'));var rp=require(_0x56c8('0x5'));var fs=require('fs');var path=require(_0x56c8('0x6'));var rimraf=require(_0x56c8('0x7'));var config=require(_0x56c8('0x8'));var attributes=require('./disposition.attributes');module[_0x56c8('0x9')]=function(_0x1eb0e8,_0x3fa714){return _0x1eb0e8[_0x56c8('0xa')](_0x56c8('0xb'),attributes,{'tableName':_0x56c8('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0x56c8('0xd'),'ListId']},{'unique':!![],'name':_0x56c8('0xe'),'fields':[_0x56c8('0xd'),'ChatWebsiteId']},{'unique':!![],'name':_0x56c8('0xf'),'fields':[_0x56c8('0xd'),_0x56c8('0x10')]},{'unique':!![],'name':_0x56c8('0x11'),'fields':[_0x56c8('0xd'),_0x56c8('0x12')]},{'unique':!![],'name':'name_fax','fields':[_0x56c8('0xd'),_0x56c8('0x13')]},{'unique':!![],'name':_0x56c8('0x14'),'fields':[_0x56c8('0xd'),_0x56c8('0x15')]},{'unique':!![],'name':_0x56c8('0x16'),'fields':[_0x56c8('0xd'),_0x56c8('0x17')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8164=['name_mail','MailAccountId','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./disposition.attributes','define','Disposition','tools_dispositions','name_voice','ListId','name_chat','name','ChatWebsiteId'];(function(_0x296f01,_0x359356){var _0x1f3d05=function(_0x4c8739){while(--_0x4c8739){_0x296f01['push'](_0x296f01['shift']());}};_0x1f3d05(++_0x359356);}(_0x8164,0x167));var _0x4816=function(_0x15ddc9,_0x209223){_0x15ddc9=_0x15ddc9-0x0;var _0x2fc9e8=_0x8164[_0x15ddc9];return _0x2fc9e8;};'use strict';var _=require(_0x4816('0x0'));var util=require('util');var logger=require(_0x4816('0x1'))(_0x4816('0x2'));var moment=require('moment');var BPromise=require(_0x4816('0x3'));var rp=require(_0x4816('0x4'));var fs=require('fs');var path=require(_0x4816('0x5'));var rimraf=require('rimraf');var config=require(_0x4816('0x6'));var attributes=require(_0x4816('0x7'));module['exports']=function(_0x4ec84d,_0x427255){return _0x4ec84d[_0x4816('0x8')](_0x4816('0x9'),attributes,{'tableName':_0x4816('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x4816('0xb'),'fields':['name',_0x4816('0xc')]},{'unique':!![],'name':_0x4816('0xd'),'fields':[_0x4816('0xe'),_0x4816('0xf')]},{'unique':!![],'name':_0x4816('0x10'),'fields':['name',_0x4816('0x11')]},{'unique':!![],'name':'name_sms','fields':[_0x4816('0xe'),_0x4816('0x12')]},{'unique':!![],'name':_0x4816('0x13'),'fields':[_0x4816('0xe'),_0x4816('0x14')]},{'unique':!![],'name':_0x4816('0x15'),'fields':[_0x4816('0xe'),_0x4816('0x16')]},{'unique':!![],'name':_0x4816('0x17'),'fields':['name',_0x4816('0x18')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index b734748..4a92249 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(_0x2dcc6d,_0x46b76b){var _0x177ab9=function(_0x16c6d1){while(--_0x16c6d1){_0x2dcc6d['push'](_0x2dcc6d['shift']());}};_0x177ab9(++_0x46b76b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'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(_0xde42cf,_0x42080d){var _0x58bc7a=function(_0x26c02e){while(--_0x26c02e){_0xde42cf['push'](_0xde42cf['shift']());}};_0x58bc7a(++_0x42080d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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 49c4752..9e44315 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 _0x20bf=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','show','post','create','put','/:id','update','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x57ea71,_0x274d20){var _0x5036f6=function(_0x4eb592){while(--_0x4eb592){_0x57ea71['push'](_0x57ea71['shift']());}};_0x5036f6(++_0x274d20);}(_0x20bf,0x1c6));var _0xf20b=function(_0x447b99,_0x4dfc1a){_0x447b99=_0x447b99-0x0;var _0x21a456=_0x20bf[_0x447b99];return _0x21a456;};'use strict';var multer=require(_0xf20b('0x0'));var util=require(_0xf20b('0x1'));var path=require(_0xf20b('0x2'));var timeout=require(_0xf20b('0x3'));var express=require(_0xf20b('0x4'));var router=express[_0xf20b('0x5')]();var fs_extra=require(_0xf20b('0x6'));var auth=require(_0xf20b('0x7'));var interaction=require(_0xf20b('0x8'));var config=require(_0xf20b('0x9'));var controller=require(_0xf20b('0xa'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xf20b('0xb')]('/:id',auth[_0xf20b('0xc')](),controller[_0xf20b('0xd')]);router[_0xf20b('0xe')]('/',auth['isAuthenticated'](),controller[_0xf20b('0xf')]);router[_0xf20b('0x10')](_0xf20b('0x11'),auth[_0xf20b('0xc')](),controller[_0xf20b('0x12')]);router['delete']('/:id',auth[_0xf20b('0xc')](),controller['destroy']);module[_0xf20b('0x13')]=router; \ No newline at end of file +var _0x0478=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','isAuthenticated','index','get','/:id','post','create','put','update','destroy','multer','util','connect-timeout','express'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x0478,0xc2));var _0x8047=function(_0x3cc751,_0x38b8ff){_0x3cc751=_0x3cc751-0x0;var _0x3956a2=_0x0478[_0x3cc751];return _0x3956a2;};'use strict';var multer=require(_0x8047('0x0'));var util=require(_0x8047('0x1'));var path=require('path');var timeout=require(_0x8047('0x2'));var express=require(_0x8047('0x3'));var router=express['Router']();var fs_extra=require(_0x8047('0x4'));var auth=require(_0x8047('0x5'));var interaction=require(_0x8047('0x6'));var config=require(_0x8047('0x7'));var controller=require(_0x8047('0x8'));router['get']('/',auth[_0x8047('0x9')](),controller[_0x8047('0xa')]);router[_0x8047('0xb')](_0x8047('0xc'),auth[_0x8047('0x9')](),controller['show']);router[_0x8047('0xd')]('/',auth[_0x8047('0x9')](),controller[_0x8047('0xe')]);router[_0x8047('0xf')](_0x8047('0xc'),auth[_0x8047('0x9')](),controller[_0x8047('0x10')]);router['delete'](_0x8047('0xc'),auth[_0x8047('0x9')](),controller[_0x8047('0x11')]);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 06998d9..747aa48 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 _0x2ec1=['exports','STRING','yes','xCALLY\x20Motion\x20Fax','localstationid','ENUM','2400','4800','7200','9600','12000','14400','v17,v27,v29','SIP','IAX','DADHI','KHOMP','TEXT','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize'];(function(_0x3084ad,_0x4fefcd){var _0x3f2559=function(_0x109bb0){while(--_0x109bb0){_0x3084ad['push'](_0x3084ad['shift']());}};_0x3f2559(++_0x4fefcd);}(_0x2ec1,0x141));var _0x12ec=function(_0x2679b0,_0x2a1a6f){_0x2679b0=_0x2679b0-0x0;var _0x192302=_0x2ec1[_0x2679b0];return _0x192302;};'use strict';var Sequelize=require(_0x12ec('0x0'));module[_0x12ec('0x1')]={'name':{'type':Sequelize[_0x12ec('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x12ec('0x2')]},'ecm':{'type':Sequelize['ENUM'](_0x12ec('0x3'),'no'),'defaultValue':_0x12ec('0x3')},'headerinfo':{'type':Sequelize[_0x12ec('0x2')],'defaultValue':_0x12ec('0x4')},'localstationid':{'type':Sequelize[_0x12ec('0x2')],'unique':_0x12ec('0x5')},'minrate':{'type':Sequelize[_0x12ec('0x6')](_0x12ec('0x7'),_0x12ec('0x8'),_0x12ec('0x9'),_0x12ec('0xa'),'12000','14400'),'defaultValue':_0x12ec('0x8')},'maxrate':{'type':Sequelize[_0x12ec('0x6')]('2400',_0x12ec('0x8'),_0x12ec('0x9'),'9600',_0x12ec('0xb'),'14400'),'defaultValue':_0x12ec('0xc')},'modem':{'type':Sequelize[_0x12ec('0x2')],'defaultValue':_0x12ec('0xd')},'gateway':{'type':Sequelize[_0x12ec('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x12ec('0x6')](_0x12ec('0xe'),_0x12ec('0xf'),_0x12ec('0x10'),_0x12ec('0x11')),'defaultValue':_0x12ec('0xe')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x12ec('0x12')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x12ec('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x12ec('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x12ec('0x14')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x12ec('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x12ec('0x14')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x12ec('0x14')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x12ec('0x14')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x12ec('0x13')],'defaultValue':![],'comment':_0x12ec('0x15'),'set':function(_0x2e0cb6){if(!_0x2e0cb6)this['setDataValue'](_0x12ec('0x16'),null);this['setDataValue']('mandatoryDisposition',_0x2e0cb6);}}}; \ No newline at end of file +var _0xf97e=['setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','ENUM','yes','localstationid','4800','7200','12000','14400','2400','9600','v17,v27,v29','INTEGER','SIP','IAX','DADHI','KHOMP','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x330589,_0x453818){var _0x22fd08=function(_0x133985){while(--_0x133985){_0x330589['push'](_0x330589['shift']());}};_0x22fd08(++_0x453818);}(_0xf97e,0xa4));var _0xef97=function(_0x196dc5,_0x50be9d){_0x196dc5=_0x196dc5-0x0;var _0x56458e=_0xf97e[_0x196dc5];return _0x56458e;};'use strict';var Sequelize=require('sequelize');module[_0xef97('0x0')]={'name':{'type':Sequelize[_0xef97('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xef97('0x1')]},'ecm':{'type':Sequelize[_0xef97('0x2')](_0xef97('0x3'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0xef97('0x1')],'unique':_0xef97('0x4')},'minrate':{'type':Sequelize['ENUM']('2400',_0xef97('0x5'),_0xef97('0x6'),'9600',_0xef97('0x7'),_0xef97('0x8')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0xef97('0x2')](_0xef97('0x9'),_0xef97('0x5'),'7200',_0xef97('0xa'),_0xef97('0x7'),_0xef97('0x8')),'defaultValue':_0xef97('0x8')},'modem':{'type':Sequelize[_0xef97('0x1')],'defaultValue':_0xef97('0xb')},'gateway':{'type':Sequelize[_0xef97('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xef97('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xef97('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xef97('0x2')](_0xef97('0xd'),_0xef97('0xe'),_0xef97('0xf'),_0xef97('0x10')),'defaultValue':_0xef97('0xd')},'key':{'type':Sequelize[_0xef97('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xef97('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xef97('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xef97('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xef97('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xef97('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xef97('0x12')},'mandatoryDisposition':{'type':Sequelize[_0xef97('0x11')],'defaultValue':![],'comment':_0xef97('0x13'),'set':function(_0x217fcf){if(!_0x217fcf)this[_0xef97('0x14')](_0xef97('0x15'),null);this[_0xef97('0x14')](_0xef97('0x16'),_0x217fcf);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 6c32721..c66bc01 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 _0x36d3=['fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','FaxAccount','findAll','rows','show','params','keys','options','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxAccounts','UserProfileSection','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','Disposition','findOne','hasOwnProperty','FaxAccountId','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','READ_COMMITTED','FaxApplication','findAndCountAll','priority','finally','send','getApplications','context','exten','localstationid','app','description','Fax\x20Extension','appdata','Answer','push','CDR(type)=inbound-fax','ecm','gateway','faxdetect','headerinfo','maxrate','t38timeout','FAXOPT(','Set','Wait','ReceiveFax','addAccountApplications','bulkCreate','transaction','VoiceExtension','TrunkId','ListId','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','CmContact','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','List','Contacts','List\x20not\x20found','Messages','Contact\x20not\x20found','spread','out','ContactId','dataValues','SendFax','info','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','client','http','request\x20sent','debug','stringify','error','FaxAccount,\x20%s,\x20%s','message','catch','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','UserProfileResource','end','stack','name','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes'];(function(_0x28f52e,_0x6ee4bf){var _0x32e8cf=function(_0x58c7f7){while(--_0x58c7f7){_0x28f52e['push'](_0x28f52e['shift']());}};_0x32e8cf(++_0x6ee4bf);}(_0x36d3,0x7c));var _0x336d=function(_0x517378,_0x3808f6){_0x517378=_0x517378-0x0;var _0x1aed7a=_0x36d3[_0x517378];return _0x1aed7a;};'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(_0x336d('0x0'));var moment=require(_0x336d('0x1'));var BPromise=require(_0x336d('0x2'));var Mustache=require('mustache');var util=require(_0x336d('0x3'));var path=require(_0x336d('0x4'));var sox=require(_0x336d('0x5'));var csv=require(_0x336d('0x6'));var ejs=require(_0x336d('0x7'));var fs=require('fs');var fs_extra=require(_0x336d('0x8'));var _=require(_0x336d('0x9'));var squel=require(_0x336d('0xa'));var crypto=require(_0x336d('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x336d('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x336d('0xd'));var as=require(_0x336d('0xe'));var hardwareService=require(_0x336d('0xf'));var logger=require(_0x336d('0x10'))(_0x336d('0x11'));var utils=require(_0x336d('0x12'));var config=require(_0x336d('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x336d('0x14')]=_[_0x336d('0x15')](config[_0x336d('0x14')],{'host':_0x336d('0x16'),'port':0x18eb});var socket=require(_0x336d('0x17'))(new Redis(config['redis']));require(_0x336d('0x18'))[_0x336d('0x19')](socket);var jayson=require('jayson/promise');var client=jayson[_0x336d('0x1a')][_0x336d('0x1b')]({'port':0x232c});var client9002=jayson['client'][_0x336d('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x3cbe67,_0x1b95da,_0x2c28c7,_0x2470cc){return new BPromise(function(_0x20902b,_0x1271c3){var _0x5da5e7=_0x2470cc||client;return _0x5da5e7['request'](_0x3cbe67,_0x2c28c7)['then'](function(_0x284806){logger['info']('FaxAccount,\x20%s,\x20%s',_0x1b95da,_0x336d('0x1c'));logger[_0x336d('0x1d')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x1b95da,_0x336d('0x1c'),JSON[_0x336d('0x1e')](_0x284806));if(_0x284806[_0x336d('0x1f')]){if(_0x284806[_0x336d('0x1f')]['code']===0x1f4){logger[_0x336d('0x1f')](_0x336d('0x20'),_0x1b95da,_0x284806[_0x336d('0x1f')][_0x336d('0x21')]);return _0x1271c3(_0x284806[_0x336d('0x1f')]['message']);}logger[_0x336d('0x1f')](_0x336d('0x20'),_0x1b95da,_0x284806['error'][_0x336d('0x21')]);return _0x20902b(_0x284806[_0x336d('0x1f')][_0x336d('0x21')]);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0x1b95da,_0x336d('0x1c'));_0x20902b(_0x284806['result'][_0x336d('0x21')]);}})[_0x336d('0x22')](function(_0x5adebf){logger[_0x336d('0x1f')](_0x336d('0x20'),_0x1b95da,_0x5adebf);_0x1271c3(_0x5adebf);});});}function respondWithStatusCode(_0x1e0d71,_0x15679f){_0x15679f=_0x15679f||0xcc;return function(_0x2eab72){if(_0x2eab72){return _0x1e0d71[_0x336d('0x23')](_0x15679f);}return _0x1e0d71[_0x336d('0x24')](_0x15679f)['end']();};}function respondWithResult(_0x44de45,_0x13d6e0){_0x13d6e0=_0x13d6e0||0xc8;return function(_0x642aee){if(_0x642aee){return _0x44de45[_0x336d('0x24')](_0x13d6e0)[_0x336d('0x25')](_0x642aee);}};}function respondWithFilteredResult(_0x408871,_0x5528d1){return function(_0x29b84e){if(_0x29b84e){var _0x53f129=typeof _0x5528d1[_0x336d('0x26')]==='undefined'&&typeof _0x5528d1['limit']===_0x336d('0x27');var _0x7c006a=_0x29b84e[_0x336d('0x28')];var _0x179e63=_0x53f129?0x0:_0x5528d1['offset'];var _0x437219=_0x53f129?_0x29b84e[_0x336d('0x28')]:_0x5528d1[_0x336d('0x26')]+_0x5528d1[_0x336d('0x29')];var _0x71a911;if(_0x437219>=_0x7c006a){_0x437219=_0x7c006a;_0x71a911=0xc8;}else{_0x71a911=0xce;}_0x408871[_0x336d('0x24')](_0x71a911);return _0x408871[_0x336d('0x2a')](_0x336d('0x2b'),_0x179e63+'-'+_0x437219+'/'+_0x7c006a)[_0x336d('0x25')](_0x29b84e);}return null;};}function patchUpdates(_0x4f11f6){return function(_0x1a1949){try{jsonpatch[_0x336d('0x2c')](_0x1a1949,_0x4f11f6,!![]);}catch(_0x16ff00){return BPromise[_0x336d('0x2d')](_0x16ff00);}return _0x1a1949[_0x336d('0x2e')]();};}function saveUpdates(_0x2f8a43,_0x302c90){return function(_0x53fca6){if(_0x53fca6){return _0x53fca6[_0x336d('0x2f')](_0x2f8a43)['then'](function(_0x105e29){return _0x105e29;});}return null;};}function removeEntity(_0x3dcdb3,_0x4f05c4){return function(_0x17b822){if(_0x17b822){return _0x17b822[_0x336d('0x30')]()[_0x336d('0x31')](function(){var _0x15af80=_0x17b822[_0x336d('0x32')]({'plain':!![]});var _0x3883d1='FaxAccounts';return db[_0x336d('0x33')][_0x336d('0x30')]({'where':{'type':_0x3883d1,'resourceId':_0x15af80['id']}})['then'](function(){return _0x17b822;});})[_0x336d('0x31')](function(){_0x3dcdb3['status'](0xcc)[_0x336d('0x34')]();});}};}function handleEntityNotFound(_0x4780ff,_0x1c3526){return function(_0x5bee9b){if(!_0x5bee9b){_0x4780ff['sendStatus'](0x194);}return _0x5bee9b;};}function handleError(_0x622f9f,_0x3e00d7){_0x3e00d7=_0x3e00d7||0x1f4;return function(_0x47d8ef){logger['error'](_0x47d8ef[_0x336d('0x35')]);if(_0x47d8ef[_0x336d('0x36')]){delete _0x47d8ef['name'];}_0x622f9f[_0x336d('0x24')](_0x3e00d7)['send'](_0x47d8ef);};}exports[_0x336d('0x37')]=function(_0x51fa51,_0xfb8a7f){var _0x2e37bf={'include':[{'model':db[_0x336d('0x38')],'as':_0x336d('0x39')}]},_0x29adeb={},_0x383c31={'count':0x0,'rows':[]};var _0x4037dd=_[_0x336d('0x3a')](db['FaxAccount'][_0x336d('0x3b')],function(_0x25fe82){return{'name':_0x25fe82[_0x336d('0x3c')],'type':_0x25fe82[_0x336d('0x3d')][_0x336d('0x3e')]};});_0x29adeb['model']=_['map'](_0x4037dd,_0x336d('0x36'));_0x29adeb[_0x336d('0x3f')]=_['keys'](_0x51fa51[_0x336d('0x3f')]);_0x29adeb[_0x336d('0x40')]=_[_0x336d('0x41')](_0x29adeb[_0x336d('0x42')],_0x29adeb[_0x336d('0x3f')]);_0x2e37bf[_0x336d('0x43')]=_[_0x336d('0x41')](_0x29adeb['model'],qs['fields'](_0x51fa51['query'][_0x336d('0x44')]));_0x2e37bf[_0x336d('0x43')]=_0x2e37bf['attributes'][_0x336d('0x45')]?_0x2e37bf[_0x336d('0x43')]:_0x29adeb['model'];if(!_0x51fa51['query']['hasOwnProperty'](_0x336d('0x46'))){_0x2e37bf[_0x336d('0x29')]=qs[_0x336d('0x29')](_0x51fa51['query'][_0x336d('0x29')]);_0x2e37bf[_0x336d('0x26')]=qs['offset'](_0x51fa51[_0x336d('0x3f')][_0x336d('0x26')]);}_0x2e37bf[_0x336d('0x47')]=qs[_0x336d('0x48')](_0x51fa51[_0x336d('0x3f')][_0x336d('0x48')]);_0x2e37bf['where']=qs[_0x336d('0x40')](_[_0x336d('0x49')](_0x51fa51[_0x336d('0x3f')],_0x29adeb['filters']),_0x4037dd);if(_0x51fa51[_0x336d('0x3f')][_0x336d('0x4a')]){_0x2e37bf[_0x336d('0x4b')]=_[_0x336d('0x4c')](_0x2e37bf[_0x336d('0x4b')],{'$or':_[_0x336d('0x3a')](_0x4037dd,function(_0x2146f4){if(_0x2146f4['type']!==_0x336d('0x4d')){var _0x1f5888={};_0x1f5888[_0x2146f4[_0x336d('0x36')]]={'$like':'%'+_0x51fa51[_0x336d('0x3f')][_0x336d('0x4a')]+'%'};return _0x1f5888;}})});}_0x2e37bf=_[_0x336d('0x4c')]({},_0x2e37bf,_0x51fa51['options']);var _0x17d44b={'where':_0x2e37bf[_0x336d('0x4b')]};return db['FaxAccount']['count'](_0x17d44b)[_0x336d('0x31')](function(_0x591512){_0x383c31[_0x336d('0x28')]=_0x591512;if(_0x51fa51['query'][_0x336d('0x4e')]){_0x2e37bf[_0x336d('0x4f')]=[{'all':!![]}];}return db[_0x336d('0x50')][_0x336d('0x51')](_0x2e37bf);})['then'](function(_0x431256){_0x383c31[_0x336d('0x52')]=_0x431256;return _0x383c31;})[_0x336d('0x31')](respondWithFilteredResult(_0xfb8a7f,_0x2e37bf))[_0x336d('0x22')](handleError(_0xfb8a7f,null));};exports[_0x336d('0x53')]=function(_0x333765,_0x146734){var _0x4000d8={'raw':![],'where':{'id':_0x333765[_0x336d('0x54')]['id']},'include':[{'model':db['Pause'],'as':_0x336d('0x39')}]},_0x117dbf={};_0x117dbf[_0x336d('0x42')]=_[_0x336d('0x55')](db[_0x336d('0x50')][_0x336d('0x3b')]);_0x117dbf[_0x336d('0x3f')]=_[_0x336d('0x55')](_0x333765[_0x336d('0x3f')]);_0x117dbf[_0x336d('0x40')]=_[_0x336d('0x41')](_0x117dbf[_0x336d('0x42')],_0x117dbf[_0x336d('0x3f')]);_0x4000d8['attributes']=_[_0x336d('0x41')](_0x117dbf[_0x336d('0x42')],qs['fields'](_0x333765['query'][_0x336d('0x44')]));_0x4000d8[_0x336d('0x43')]=_0x4000d8[_0x336d('0x43')][_0x336d('0x45')]?_0x4000d8[_0x336d('0x43')]:_0x117dbf[_0x336d('0x42')];if(_0x333765['query'][_0x336d('0x4e')]){_0x4000d8[_0x336d('0x4f')]=[{'all':!![]}];}_0x4000d8=_[_0x336d('0x4c')]({},_0x4000d8,_0x333765[_0x336d('0x56')]);return db['FaxAccount'][_0x336d('0x57')](_0x4000d8)[_0x336d('0x31')](handleEntityNotFound(_0x146734,null))['then'](respondWithResult(_0x146734,null))[_0x336d('0x22')](handleError(_0x146734,null));};exports['create']=function(_0x3020a8,_0x3fda30){return db[_0x336d('0x50')]['create'](_0x3020a8['body'],{})[_0x336d('0x31')](function(_0x5338d0){var _0x25bb51=_0x3020a8[_0x336d('0x58')][_0x336d('0x32')]({'plain':!![]});if(!_0x25bb51)throw new Error(_0x336d('0x59'));if(_0x25bb51[_0x336d('0x5a')]===_0x336d('0x58')){var _0x2ae56c=_0x5338d0[_0x336d('0x32')]({'plain':!![]});var _0x472e19=_0x336d('0x5b');return db[_0x336d('0x5c')][_0x336d('0x57')]({'where':{'name':_0x472e19,'userProfileId':_0x25bb51[_0x336d('0x5d')]},'raw':!![]})[_0x336d('0x31')](function(_0x14efb0){if(_0x14efb0&&_0x14efb0['autoAssociation']===0x0){return db[_0x336d('0x33')][_0x336d('0x5e')]({'name':_0x2ae56c[_0x336d('0x36')],'resourceId':_0x2ae56c['id'],'type':_0x14efb0[_0x336d('0x36')],'sectionId':_0x14efb0['id']},{})[_0x336d('0x31')](function(){return _0x5338d0;});}else{return _0x5338d0;}})[_0x336d('0x22')](function(_0x3b908e){logger[_0x336d('0x1f')](_0x336d('0x5f'),_0x3b908e);throw _0x3b908e;});}return _0x5338d0;})['then'](respondWithResult(_0x3fda30,0xc9))[_0x336d('0x22')](handleError(_0x3fda30,null));};exports[_0x336d('0x2f')]=function(_0x41d6bf,_0x813b8){if(_0x41d6bf[_0x336d('0x60')]['id']){delete _0x41d6bf['body']['id'];}return db[_0x336d('0x50')][_0x336d('0x57')]({'where':{'id':_0x41d6bf[_0x336d('0x54')]['id']},'include':[{'model':db[_0x336d('0x38')],'as':_0x336d('0x39')}]})[_0x336d('0x31')](handleEntityNotFound(_0x813b8,null))[_0x336d('0x31')](saveUpdates(_0x41d6bf[_0x336d('0x60')],null))['then'](respondWithResult(_0x813b8,null))[_0x336d('0x22')](handleError(_0x813b8,null));};exports[_0x336d('0x30')]=function(_0x4ec95e,_0x35f189){return db[_0x336d('0x50')][_0x336d('0x57')]({'where':{'id':_0x4ec95e[_0x336d('0x54')]['id']}})[_0x336d('0x31')](handleEntityNotFound(_0x35f189,null))[_0x336d('0x31')](removeEntity(_0x35f189,null))[_0x336d('0x22')](handleError(_0x35f189,null));};exports[_0x336d('0x61')]=function(_0x1fe55c,_0x76ab92){return db[_0x336d('0x50')]['describe']()[_0x336d('0x31')](respondWithResult(_0x76ab92,null))[_0x336d('0x22')](handleError(_0x76ab92,null));};exports[_0x336d('0x62')]=function(_0x13daeb,_0x1bcb11,_0x251265){if(_0x13daeb[_0x336d('0x60')]['id']){delete _0x13daeb[_0x336d('0x60')]['id'];}return db[_0x336d('0x50')][_0x336d('0x57')]({'where':{'id':_0x13daeb[_0x336d('0x54')]['id']}})[_0x336d('0x31')](handleEntityNotFound(_0x1bcb11,null))[_0x336d('0x31')](function(_0x17ba26){if(_0x17ba26){_0x13daeb[_0x336d('0x60')]['FaxAccountId']=_0x17ba26['id'];return db[_0x336d('0x63')]['create'](_0x13daeb[_0x336d('0x60')]);}})[_0x336d('0x31')](respondWithResult(_0x1bcb11,null))[_0x336d('0x22')](handleError(_0x1bcb11,null));};exports['getDispositions']=function(_0x46ee22,_0x1ba126,_0x35244c){var _0x446546={'raw':![],'where':{}};var _0x55e233={};var _0x1aa738={'count':0x0,'rows':[]};return db['FaxAccount'][_0x336d('0x64')]({'where':{'id':_0x46ee22['params']['id']}})[_0x336d('0x31')](handleEntityNotFound(_0x1ba126,null))['then'](function(_0x542553){if(_0x542553){_0x55e233[_0x336d('0x42')]=_[_0x336d('0x55')](db[_0x336d('0x63')][_0x336d('0x3b')]);_0x55e233[_0x336d('0x3f')]=_['keys'](_0x46ee22[_0x336d('0x3f')]);_0x55e233['filters']=_[_0x336d('0x41')](_0x55e233[_0x336d('0x42')],_0x55e233['query']);_0x446546[_0x336d('0x43')]=_[_0x336d('0x41')](_0x55e233['model'],qs[_0x336d('0x44')](_0x46ee22[_0x336d('0x3f')]['fields']));_0x446546[_0x336d('0x43')]=_0x446546[_0x336d('0x43')]['length']?_0x446546['attributes']:_0x55e233[_0x336d('0x42')];if(!_0x46ee22[_0x336d('0x3f')][_0x336d('0x65')](_0x336d('0x46'))){_0x446546[_0x336d('0x29')]=qs[_0x336d('0x29')](_0x46ee22['query'][_0x336d('0x29')]);_0x446546['offset']=qs['offset'](_0x46ee22[_0x336d('0x3f')]['offset']);}_0x446546[_0x336d('0x47')]=qs[_0x336d('0x48')](_0x46ee22[_0x336d('0x3f')]['sort']);_0x446546['where']=qs['filters'](_[_0x336d('0x49')](_0x46ee22[_0x336d('0x3f')],_0x55e233[_0x336d('0x40')]));_0x446546['where'][_0x336d('0x66')]=_0x542553['id'];if(_0x46ee22['query'][_0x336d('0x4a')]){_0x446546[_0x336d('0x4b')]=_[_0x336d('0x4c')](_0x446546[_0x336d('0x4b')],{'$or':_['map'](_0x446546['attributes'],function(_0x33912d){var _0xcf0844={};_0xcf0844[_0x33912d]={'$like':'%'+_0x46ee22[_0x336d('0x3f')][_0x336d('0x4a')]+'%'};return _0xcf0844;})});}_0x446546=_['merge']({},_0x446546,_0x46ee22[_0x336d('0x56')]);return db['Disposition'][_0x336d('0x28')]({'where':_0x446546[_0x336d('0x4b')]})[_0x336d('0x31')](function(_0x416adf){_0x1aa738[_0x336d('0x28')]=_0x416adf;if(_0x46ee22[_0x336d('0x3f')]['includeAll']){_0x446546[_0x336d('0x4f')]=[{'all':!![]}];}return db[_0x336d('0x63')][_0x336d('0x51')](_0x446546);})['then'](function(_0x351a89){_0x1aa738[_0x336d('0x52')]=_0x351a89;return _0x1aa738;});}})[_0x336d('0x31')](respondWithFilteredResult(_0x1ba126,_0x446546))['catch'](handleError(_0x1ba126,null));};exports['removeDispositions']=function(_0x4cbaed,_0x44da64,_0x51d684){return db[_0x336d('0x50')][_0x336d('0x57')]({'where':{'id':_0x4cbaed['params']['id']}})[_0x336d('0x31')](handleEntityNotFound(_0x44da64,null))[_0x336d('0x31')](function(_0x1701a7){if(_0x1701a7){return _0x1701a7[_0x336d('0x67')](_0x4cbaed[_0x336d('0x3f')][_0x336d('0x68')]);}})[_0x336d('0x31')](respondWithStatusCode(_0x44da64,null))[_0x336d('0x22')](handleError(_0x44da64,null));};exports[_0x336d('0x69')]=function(_0x1f69c2,_0xe3ae4f,_0xe365c1){if(_0x1f69c2[_0x336d('0x60')]['id']){delete _0x1f69c2[_0x336d('0x60')]['id'];}return db[_0x336d('0x50')]['find']({'where':{'id':_0x1f69c2[_0x336d('0x54')]['id']}})[_0x336d('0x31')](handleEntityNotFound(_0xe3ae4f,null))['then'](function(_0x22c294){if(_0x22c294){_0x1f69c2[_0x336d('0x60')]['FaxAccountId']=_0x22c294['id'];return db[_0x336d('0x6a')]['create'](_0x1f69c2[_0x336d('0x60')]);}})[_0x336d('0x31')](respondWithResult(_0xe3ae4f,null))[_0x336d('0x22')](handleError(_0xe3ae4f,null));};exports[_0x336d('0x6b')]=function(_0x3eaede,_0x430ae5,_0x5f254c){var _0x1c381a={'raw':![],'where':{}};var _0x433ada={};var _0x5d87e8={'count':0x0,'rows':[]};return db[_0x336d('0x50')][_0x336d('0x64')]({'where':{'id':_0x3eaede['params']['id']}})[_0x336d('0x31')](handleEntityNotFound(_0x430ae5,null))[_0x336d('0x31')](function(_0x32bade){if(_0x32bade){_0x433ada[_0x336d('0x42')]=_[_0x336d('0x55')](db['CannedAnswer'][_0x336d('0x3b')]);_0x433ada['query']=_['keys'](_0x3eaede['query']);_0x433ada['filters']=_['intersection'](_0x433ada[_0x336d('0x42')],_0x433ada[_0x336d('0x3f')]);_0x1c381a['attributes']=_[_0x336d('0x41')](_0x433ada[_0x336d('0x42')],qs['fields'](_0x3eaede[_0x336d('0x3f')][_0x336d('0x44')]));_0x1c381a[_0x336d('0x43')]=_0x1c381a[_0x336d('0x43')][_0x336d('0x45')]?_0x1c381a[_0x336d('0x43')]:_0x433ada['model'];if(!_0x3eaede[_0x336d('0x3f')][_0x336d('0x65')](_0x336d('0x46'))){_0x1c381a[_0x336d('0x29')]=qs[_0x336d('0x29')](_0x3eaede[_0x336d('0x3f')][_0x336d('0x29')]);_0x1c381a[_0x336d('0x26')]=qs[_0x336d('0x26')](_0x3eaede['query'][_0x336d('0x26')]);}_0x1c381a[_0x336d('0x47')]=qs[_0x336d('0x48')](_0x3eaede[_0x336d('0x3f')][_0x336d('0x48')]);_0x1c381a[_0x336d('0x4b')]=qs[_0x336d('0x40')](_[_0x336d('0x49')](_0x3eaede[_0x336d('0x3f')],_0x433ada[_0x336d('0x40')]));_0x1c381a[_0x336d('0x4b')][_0x336d('0x66')]=_0x32bade['id'];if(_0x3eaede[_0x336d('0x3f')][_0x336d('0x4a')]){_0x1c381a[_0x336d('0x4b')]=_['merge'](_0x1c381a[_0x336d('0x4b')],{'$or':_[_0x336d('0x3a')](_0x1c381a[_0x336d('0x43')],function(_0xe5a880){var _0x26de03={};_0x26de03[_0xe5a880]={'$like':'%'+_0x3eaede[_0x336d('0x3f')][_0x336d('0x4a')]+'%'};return _0x26de03;})});}_0x1c381a=_['merge']({},_0x1c381a,_0x3eaede['options']);return db[_0x336d('0x6a')]['count']({'where':_0x1c381a[_0x336d('0x4b')]})[_0x336d('0x31')](function(_0x1d11a3){_0x5d87e8[_0x336d('0x28')]=_0x1d11a3;if(_0x3eaede[_0x336d('0x3f')][_0x336d('0x4e')]){_0x1c381a[_0x336d('0x4f')]=[{'all':!![]}];}return db[_0x336d('0x6a')][_0x336d('0x51')](_0x1c381a);})[_0x336d('0x31')](function(_0x5759f3){_0x5d87e8[_0x336d('0x52')]=_0x5759f3;return _0x5d87e8;});}})[_0x336d('0x31')](respondWithFilteredResult(_0x430ae5,_0x1c381a))[_0x336d('0x22')](handleError(_0x430ae5,null));};exports[_0x336d('0x6c')]=function(_0x30b856,_0x45c51d,_0x1381df){return db[_0x336d('0x50')]['find']({'where':{'id':_0x30b856[_0x336d('0x54')]['id']}})[_0x336d('0x31')](handleEntityNotFound(_0x45c51d,null))[_0x336d('0x31')](function(_0x136da5){if(_0x136da5){return _0x136da5['removeAnswers'](_0x30b856[_0x336d('0x3f')][_0x336d('0x68')]);}})[_0x336d('0x31')](respondWithStatusCode(_0x45c51d,null))[_0x336d('0x22')](handleError(_0x45c51d,null));};exports[_0x336d('0x6d')]=function(_0x1e3519,_0x328dce,_0x46cc4c){return db[_0x336d('0x6e')][_0x336d('0x57')]({'where':{'id':_0x1e3519['params']['id']}})['then'](handleEntityNotFound(_0x328dce,null))[_0x336d('0x31')](function(_0x44b85d){if(_0x44b85d){return _0x44b85d[_0x336d('0x6d')](_0x1e3519[_0x336d('0x60')][_0x336d('0x68')],_[_0x336d('0x6f')](_0x1e3519[_0x336d('0x60')],[_0x336d('0x68'),'id'])||{});}})[_0x336d('0x31')](respondWithResult(_0x328dce,null))[_0x336d('0x22')](handleError(_0x328dce,null));};exports[_0x336d('0x70')]=function(_0x468150,_0x32325d,_0x5b06d4){var _0x3cac33={'raw':![],'where':{}};var _0x5f1118={};var _0x2b00f4={'count':0x0,'rows':[]};return db[_0x336d('0x50')][_0x336d('0x64')]({'where':{'id':_0x468150['params']['id']}})[_0x336d('0x31')](handleEntityNotFound(_0x32325d,null))[_0x336d('0x31')](function(_0x1ccd9c){if(_0x1ccd9c){_0x5f1118[_0x336d('0x42')]=_[_0x336d('0x55')](db[_0x336d('0x6e')][_0x336d('0x3b')]);_0x5f1118[_0x336d('0x3f')]=_[_0x336d('0x55')](_0x468150['query']);_0x5f1118[_0x336d('0x40')]=_['intersection'](_0x5f1118[_0x336d('0x42')],_0x5f1118[_0x336d('0x3f')]);_0x3cac33[_0x336d('0x43')]=_['intersection'](_0x5f1118['model'],qs['fields'](_0x468150[_0x336d('0x3f')][_0x336d('0x44')]));_0x3cac33[_0x336d('0x43')]=_0x3cac33[_0x336d('0x43')][_0x336d('0x45')]?_0x3cac33['attributes']:_0x5f1118[_0x336d('0x42')];if(!_0x468150['query'][_0x336d('0x65')](_0x336d('0x46'))){_0x3cac33[_0x336d('0x29')]=qs[_0x336d('0x29')](_0x468150['query']['limit']);_0x3cac33[_0x336d('0x26')]=qs[_0x336d('0x26')](_0x468150[_0x336d('0x3f')][_0x336d('0x26')]);}_0x3cac33['order']=qs[_0x336d('0x48')](_0x468150[_0x336d('0x3f')]['sort']);_0x3cac33[_0x336d('0x4b')]=qs[_0x336d('0x40')](_[_0x336d('0x49')](_0x468150[_0x336d('0x3f')],_0x5f1118[_0x336d('0x40')]));_0x3cac33[_0x336d('0x4b')]['FaxAccountId']=_0x1ccd9c['id'];if(_0x468150['query'][_0x336d('0x4a')]){_0x3cac33[_0x336d('0x4b')]=_['merge'](_0x3cac33[_0x336d('0x4b')],{'$or':_[_0x336d('0x3a')](_0x3cac33[_0x336d('0x43')],function(_0x892053){var _0x37a34a={};_0x37a34a[_0x892053]={'$like':'%'+_0x468150[_0x336d('0x3f')]['filter']+'%'};return _0x37a34a;})});}_0x3cac33=_[_0x336d('0x4c')]({},_0x3cac33,_0x468150[_0x336d('0x56')]);return db[_0x336d('0x6e')][_0x336d('0x28')]({'where':_0x3cac33[_0x336d('0x4b')]})[_0x336d('0x31')](function(_0x57c570){_0x2b00f4[_0x336d('0x28')]=_0x57c570;if(_0x468150[_0x336d('0x3f')][_0x336d('0x4e')]){_0x3cac33[_0x336d('0x4f')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x336d('0x71')],'as':_0x336d('0x72'),'attributes':['name',_0x336d('0x73'),_0x336d('0x74')],'required':![]},{'model':db[_0x336d('0x75')],'as':_0x336d('0x76'),'attributes':['id',_0x336d('0x36'),_0x336d('0x77')],'where':_0x468150['query'][_0x336d('0x78')]?{'id':_0x468150[_0x336d('0x3f')][_0x336d('0x78')]}:undefined,'required':_0x468150['query'][_0x336d('0x78')]?!![]:![]}];}return db['FaxInteraction']['findAll'](_0x3cac33);})[_0x336d('0x31')](function(_0x3dda33){_0x2b00f4[_0x336d('0x52')]=_0x3dda33;return _0x2b00f4;});}})[_0x336d('0x31')](respondWithFilteredResult(_0x32325d,_0x3cac33))['catch'](handleError(_0x32325d,null));};exports[_0x336d('0x79')]=function(_0x2aa84c,_0xdd0ca8){var _0x4f5d79=_0x2aa84c[_0x336d('0x54')]['id'];var _0x9bf07a=_0x2aa84c[_0x336d('0x60')];var _0x411d47=0xc8;var _0x39fc64=null;return db[_0x336d('0x7a')]['transaction']({'isolationLevel':db[_0x336d('0x7a')]['Transaction']['ISOLATION_LEVELS'][_0x336d('0x7b')]},function(_0x51ab64){return db['FaxAccount']['findOne']({'where':{'id':_0x4f5d79},'transaction':_0x51ab64})[_0x336d('0x31')](function(_0x7a2fb8){if(_0x7a2fb8){return db[_0x336d('0x7c')][_0x336d('0x30')]({'where':{'FaxAccountId':_0x4f5d79},'transaction':_0x51ab64})[_0x336d('0x31')](function(){var _0x1f8ee1=_[_0x336d('0x3a')](_0x9bf07a,function(_0x4fac73){_0x4fac73['FaxAccountId']=_0x4f5d79;return _0x4fac73;});return db[_0x336d('0x7c')]['bulkCreate'](_0x1f8ee1,{'transaction':_0x51ab64});});}else{_0x411d47=0x194;_0x39fc64=[];}});})[_0x336d('0x31')](function(){if(_0x411d47!==0x194){return db[_0x336d('0x7c')][_0x336d('0x7d')]({'where':{'FaxAccountId':_0x4f5d79},'order':_0x336d('0x7e')})['then'](function(_0x13c64a){_0x39fc64=_0x13c64a;});}})['catch'](function(_0x5280b9){_0x411d47=0x1f4;logger[_0x336d('0x1f')](_0x5280b9['stack']);if(_0x5280b9[_0x336d('0x36')]){delete _0x5280b9[_0x336d('0x36')];}_0x39fc64=_0x5280b9;})[_0x336d('0x7f')](function(){if(_0x39fc64===null){_0xdd0ca8[_0x336d('0x23')](_0x411d47);}else{if(_0x411d47===0x1f4){_0xdd0ca8[_0x336d('0x24')](_0x411d47)[_0x336d('0x80')](_0x39fc64);}else{_0xdd0ca8[_0x336d('0x24')](_0x411d47)[_0x336d('0x25')](_0x39fc64);}}});};exports[_0x336d('0x81')]=function(_0x13ac5f,_0xf787d3,_0x45a838){var _0x29179f={};var _0x357d82={};var _0x3e8ee7;var _0x18e4dd;return db[_0x336d('0x50')][_0x336d('0x64')]({'where':{'id':_0x13ac5f['params']['id']}})[_0x336d('0x31')](handleEntityNotFound(_0xf787d3,null))['then'](function(_0x579461){if(_0x579461){_0x3e8ee7=_0x579461;_0x357d82[_0x336d('0x42')]=_[_0x336d('0x55')](db[_0x336d('0x7c')][_0x336d('0x3b')]);_0x357d82[_0x336d('0x3f')]=_[_0x336d('0x55')](_0x13ac5f[_0x336d('0x3f')]);_0x357d82[_0x336d('0x40')]=_[_0x336d('0x41')](_0x357d82[_0x336d('0x42')],_0x357d82['query']);_0x29179f[_0x336d('0x43')]=_[_0x336d('0x41')](_0x357d82['model'],qs[_0x336d('0x44')](_0x13ac5f['query'][_0x336d('0x44')]));_0x29179f[_0x336d('0x43')]=_0x29179f[_0x336d('0x43')]['length']?_0x29179f['attributes']:_0x357d82[_0x336d('0x42')];_0x29179f['order']=qs[_0x336d('0x48')](_0x13ac5f[_0x336d('0x3f')][_0x336d('0x48')]);_0x29179f[_0x336d('0x4b')]=qs['filters'](_[_0x336d('0x49')](_0x13ac5f[_0x336d('0x3f')],_0x357d82[_0x336d('0x40')]));if(_0x13ac5f[_0x336d('0x3f')][_0x336d('0x4a')]){_0x29179f[_0x336d('0x4b')]=_[_0x336d('0x4c')](_0x29179f[_0x336d('0x4b')],{'$or':_[_0x336d('0x3a')](_0x29179f[_0x336d('0x43')],function(_0x5dd663){var _0x32b238={};_0x32b238[_0x5dd663]={'$like':'%'+_0x13ac5f[_0x336d('0x3f')][_0x336d('0x4a')]+'%'};return _0x32b238;})});}_0x29179f=_[_0x336d('0x4c')]({},_0x29179f,_0x13ac5f[_0x336d('0x56')]);return _0x3e8ee7[_0x336d('0x81')](_0x29179f);}})[_0x336d('0x31')](function(_0x2815bd){if(_0x2815bd){_0x18e4dd=_0x2815bd[_0x336d('0x45')];if(!_0x13ac5f[_0x336d('0x3f')][_0x336d('0x65')](_0x336d('0x46'))){_0x29179f[_0x336d('0x29')]=qs[_0x336d('0x29')](_0x13ac5f['query'][_0x336d('0x29')]);_0x29179f[_0x336d('0x26')]=qs[_0x336d('0x26')](_0x13ac5f[_0x336d('0x3f')][_0x336d('0x26')]);}return _0x3e8ee7['getApplications'](_0x29179f);}})[_0x336d('0x31')](function(_0x5b2dbd){if(_0x5b2dbd){return _0x5b2dbd?{'count':_0x18e4dd,'rows':_0x5b2dbd}:null;}})[_0x336d('0x31')](respondWithResult(_0xf787d3,null))[_0x336d('0x22')](handleError(_0xf787d3,null));};function Extension(_0x4c73d2,_0x462a5,_0x46394c,_0xa85eea){this[_0x336d('0x82')]='from-voip-provider';this[_0x336d('0x83')]=_0x4c73d2[_0x336d('0x84')];this[_0x336d('0x85')]=_0xa85eea;this['type']='system';this[_0x336d('0x86')]=_0x336d('0x87');this[_0x336d('0x66')]=_0x4c73d2['id'];this[_0x336d('0x7e')]=_0x462a5;this[_0x336d('0x88')]=_0x46394c;}function createExtensionsReciveFax(_0x1cb534){var _0x66fa2f=0x1;var _0x2bac49=[];_0x2bac49['push'](new Extension(_0x1cb534,_0x66fa2f,'',_0x336d('0x89')));_0x66fa2f+=0x1;_0x2bac49[_0x336d('0x8a')](new Extension(_0x1cb534,_0x66fa2f,_0x336d('0x8b'),'Set'));_0x66fa2f+=0x1;for(var _0x7d39 in _0x1cb534){if(_0x1cb534[_0x336d('0x65')](_0x7d39)&&(_0x7d39===_0x336d('0x8c')||_0x7d39==='localstationid'||_0x7d39===_0x336d('0x8d')||_0x7d39===_0x336d('0x8e')||_0x7d39===_0x336d('0x8f')||_0x7d39===_0x336d('0x90')||_0x7d39==='minrate'||_0x7d39==='modem'||_0x7d39===_0x336d('0x91'))){_0x2bac49['push'](new Extension(_0x1cb534,_0x66fa2f,_0x336d('0x92')+_0x7d39+')='+_0x1cb534[_0x7d39],_0x336d('0x93')));_0x66fa2f+=0x1;}}_0x2bac49[_0x336d('0x8a')](new Extension(_0x1cb534,_0x66fa2f,'6',_0x336d('0x94')));_0x66fa2f+=0x1;_0x2bac49[_0x336d('0x8a')](new Extension(_0x1cb534,_0x66fa2f,'/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',_0x336d('0x95')));_0x66fa2f=0x0;return _0x2bac49;}exports[_0x336d('0x96')]=function(_0x59b917,_0x2a2c37,_0x565bbf){var _0x4d16d8;return db['sequelize']['transaction'](function(_0x4b78a0){return db[_0x336d('0x50')]['create'](_0x59b917['body'],{'transaction':_0x4b78a0})[_0x336d('0x31')](function(_0x16d865){_0x4d16d8=_0x16d865[_0x336d('0x32')]({'plain':!![]});return db['VoiceExtension'][_0x336d('0x97')](createExtensionsReciveFax(_0x4d16d8),{'transaction':_0x4b78a0});});})['then'](function(){return _0x4d16d8;})[_0x336d('0x31')](respondWithResult(_0x2a2c37,null))['catch'](handleError(_0x2a2c37,null));};exports['updateAccountApplications']=function(_0x2396a6,_0x56daf9,_0x32fa90){var _0x5cb689;return db[_0x336d('0x7a')][_0x336d('0x98')](function(_0x1d01f5){return db[_0x336d('0x50')][_0x336d('0x2f')](_0x2396a6[_0x336d('0x60')],{'where':{'id':_0x2396a6[_0x336d('0x60')]['id']},'transaction':_0x1d01f5})[_0x336d('0x31')](function(_0x5c1437){return db['VoiceExtension'][_0x336d('0x30')]({'where':{'FaxAccountId':_0x2396a6[_0x336d('0x60')]['id']},'transaction':_0x1d01f5})['then'](function(_0x1d1ef9){return db[_0x336d('0x99')]['bulkCreate'](createExtensionsReciveFax(_[_0x336d('0x6f')](_0x2396a6['body'],['tech',_0x336d('0x3e'),'createdAt','updatedAt',_0x336d('0x9a'),_0x336d('0x9b')])),{'transaction':_0x1d01f5});});});})[_0x336d('0x31')](function(){return db[_0x336d('0x50')]['findById'](_0x2396a6[_0x336d('0x60')]['id']);})['then'](respondWithResult(_0x56daf9,null))[_0x336d('0x22')](handleError(_0x56daf9,null));};exports[_0x336d('0x9c')]=function(_0x5abaca,_0x1fe17b,_0x15421a){var _0x5c611c={'raw':!![],'where':{}};var _0x1987e5={};var _0x1e1367={'count':0x0,'rows':[]};return db[_0x336d('0x50')][_0x336d('0x64')]({'where':{'id':_0x5abaca[_0x336d('0x54')]['id']}})[_0x336d('0x31')](handleEntityNotFound(_0x1fe17b,null))[_0x336d('0x31')](function(_0x118157){if(_0x118157){_0x1987e5['model']=_[_0x336d('0x55')](db[_0x336d('0x9d')][_0x336d('0x3b')]);_0x1987e5['query']=_[_0x336d('0x55')](_0x5abaca[_0x336d('0x3f')]);_0x1987e5['filters']=_[_0x336d('0x41')](_0x1987e5[_0x336d('0x42')],_0x1987e5[_0x336d('0x3f')]);_0x5c611c[_0x336d('0x43')]=_['intersection'](_0x1987e5[_0x336d('0x42')],qs[_0x336d('0x44')](_0x5abaca['query'][_0x336d('0x44')]));_0x5c611c[_0x336d('0x43')]=_0x5c611c[_0x336d('0x43')][_0x336d('0x45')]?_0x5c611c[_0x336d('0x43')]:_0x1987e5[_0x336d('0x42')];if(!_0x5abaca[_0x336d('0x3f')][_0x336d('0x65')](_0x336d('0x46'))){_0x5c611c['limit']=qs[_0x336d('0x29')](_0x5abaca['query'][_0x336d('0x29')]);_0x5c611c[_0x336d('0x26')]=qs[_0x336d('0x26')](_0x5abaca[_0x336d('0x3f')][_0x336d('0x26')]);}_0x5c611c[_0x336d('0x47')]=qs[_0x336d('0x48')](_0x5abaca[_0x336d('0x3f')][_0x336d('0x48')]);_0x5c611c[_0x336d('0x4b')]=qs['filters'](_[_0x336d('0x49')](_0x5abaca[_0x336d('0x3f')],_0x1987e5[_0x336d('0x40')]));_0x5c611c['where'][_0x336d('0x66')]=_0x118157['id'];if(_0x5abaca[_0x336d('0x3f')][_0x336d('0x4a')]){_0x5c611c['where']=_[_0x336d('0x4c')](_0x5c611c[_0x336d('0x4b')],{'$or':_[_0x336d('0x3a')](_0x5c611c[_0x336d('0x43')],function(_0x5609cd){var _0x42e692={};_0x42e692[_0x5609cd]={'$like':'%'+_0x5abaca['query']['filter']+'%'};return _0x42e692;})});}if(_0x5abaca[_0x336d('0x3f')]['$gte']){var _0x13625d=_0x5abaca['query'][_0x336d('0x9e')][_0x336d('0x9f')](',');var _0x2bf879={};_0x2bf879[_0x13625d[0x0]]={'$gte':moment(_0x13625d[0x1])[_0x336d('0xa0')](_0x336d('0xa1'))};_0x5c611c[_0x336d('0x4b')]=_[_0x336d('0x4c')](_0x5c611c[_0x336d('0x4b')],_0x2bf879);}_0x5c611c=_[_0x336d('0x4c')]({},_0x5c611c,_0x5abaca['options']);return db[_0x336d('0x9d')][_0x336d('0x28')]({'where':_0x5c611c[_0x336d('0x4b')]})[_0x336d('0x31')](function(_0x1c703b){_0x1e1367[_0x336d('0x28')]=_0x1c703b;if(_0x5abaca[_0x336d('0x3f')][_0x336d('0x4e')]){_0x5c611c[_0x336d('0x4f')]=[{'all':!![]}];}return db['FaxMessage'][_0x336d('0x51')](_0x5c611c);})[_0x336d('0x31')](function(_0x5f0a54){_0x1e1367[_0x336d('0x52')]=_0x5f0a54;return _0x1e1367;});}})['then'](respondWithFilteredResult(_0x1fe17b,_0x5c611c))[_0x336d('0x22')](handleError(_0x1fe17b,null));};exports[_0x336d('0x80')]=function(_0x1c86d9,_0x2480cf,_0x50895c){var _0x141740,_0x3c2ece={},_0x454eaa;if(_0x1c86d9[_0x336d('0x60')]['to']){_0x454eaa=_0x1c86d9[_0x336d('0x60')]['to'][0x0];}return db['FaxAccount'][_0x336d('0x57')]({'where':{'id':_0x1c86d9[_0x336d('0x54')]['id']},'include':[{'model':db[_0x336d('0xa2')],'as':'List','include':[{'model':db[_0x336d('0xa3')],'as':'Contacts','where':{'fax':_0x454eaa},'limit':0x1,'order':[['updatedAt',_0x336d('0xa4')]]}]}]})['then'](handleEntityNotFound(_0x2480cf,null))[_0x336d('0x31')](function(_0xee83b3){_0x141740=_0xee83b3;if(_0x1c86d9['body']['attachments']&&_0x1c86d9[_0x336d('0x60')][_0x336d('0xa5')][_0x336d('0x45')]){for(var _0x1c43cc=0x0;_0x1c43cc<_0x1c86d9[_0x336d('0x60')][_0x336d('0xa5')][_0x336d('0x45')];_0x1c43cc+=0x1){_0x1c86d9[_0x336d('0x60')][_0x336d('0xa5')][_0x1c43cc]={'filename':_0x1c86d9['body'][_0x336d('0xa5')][_0x1c43cc][_0x336d('0x36')],'id':_0x1c86d9[_0x336d('0x60')][_0x336d('0xa5')][_0x1c43cc]['id'],'path':path[_0x336d('0xa6')](config[_0x336d('0xa7')],_0x336d('0xa8'),_0x1c86d9[_0x336d('0x60')][_0x336d('0xa5')][_0x1c43cc][_0x336d('0xa9')])};}}return respondWithRpcPromise(_0x336d('0xaa'),_0x336d('0xaa'),{'FaxAccountId':_[_0x336d('0xab')](_0x1c86d9[_0x336d('0x54')]['id'])?undefined:_0x1c86d9[_0x336d('0x54')]['id'],'path':_['isNil'](_0x1c86d9[_0x336d('0x60')]['attachments'][0x0][_0x336d('0x4')])?undefined:_0x1c86d9[_0x336d('0x60')][_0x336d('0xa5')][0x0][_0x336d('0x4')],'fax':_[_0x336d('0xab')](_0x1c86d9['body']['to'][0x0])?undefined:_0x1c86d9[_0x336d('0x60')]['to'][0x0]},client9002);})[_0x336d('0x31')](function(){if(_0x141740){if(_['isNil'](_0x1c86d9['body'][_0x336d('0xac')])){_0x1c86d9[_0x336d('0x60')][_0x336d('0xac')]=util[_0x336d('0xa0')]('\x22%s\x22\x20<%s>',_0x141740[_0x336d('0x36')],_0x141740['fax']);}if(_0x141740[_0x336d('0xad')]){if(_0x141740[_0x336d('0xad')][_0x336d('0xae')][_0x336d('0x45')]){return _0x141740[_0x336d('0xad')][_0x336d('0xae')][0x0];}else{return db[_0x336d('0xa3')]['create'](_['defaults'](_0x1c86d9[_0x336d('0x60')],{'firstName':_0x1c86d9['body']['to'][0x0],'phone':_0x1c86d9['body']['to'][0x0],'fax':_0x1c86d9[_0x336d('0x60')]['to'][0x0],'ListId':_0x141740[_0x336d('0x9b')]}));}}else{throw new Error(_0x336d('0xaf'));}}else{throw new Error('Send\x20Fax\x20failed');}})[_0x336d('0x31')](function(_0x2a46cd){if(_0x2a46cd){return db['FaxInteraction'][_0x336d('0x57')]({'where':{'ContactId':_0x2a46cd['id'],'closed':![],'FaxAccountId':_0x141740['id']}})[_0x336d('0x31')](function(_0x4f68bb){if(_0x4f68bb){return[_0x4f68bb,![]];}return db[_0x336d('0x6e')][_0x336d('0x5e')]({'UserId':_0x1c86d9[_0x336d('0x58')]['id'],'ContactId':_0x2a46cd['id'],'FaxAccountId':_0x141740['id'],'fax':_0x1c86d9['body']['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0x336d('0x4c')](_0x1c86d9['body'],{'read':![],'body':_0x1c86d9['body'][_0x336d('0xa5')][0x0]['filename'],'FaxAccountId':_0x141740['id'],'UserId':_0x1c86d9['user']['id'],'ContactId':_0x2a46cd['id'],'AttachmentId':_0x1c86d9[_0x336d('0x60')][_0x336d('0xa5')][0x0]['id']})]},{'include':[{'model':db[_0x336d('0x9d')],'as':_0x336d('0xb0')}]})[_0x336d('0x31')](function(_0x5c6839){return[_0x5c6839,!![]];});});}else{throw new Error(_0x336d('0xb1'));}})[_0x336d('0xb2')](function(_0x3cf858,_0x3503f4){if(_0x3503f4){return _0x3cf858;}return db[_0x336d('0x9d')][_0x336d('0x5e')]({'direction':_0x336d('0xb3'),'read':![],'body':_0x1c86d9['body'][_0x336d('0xa5')][0x0]['filename'],'FaxAccountId':_0x141740['id'],'FaxInteractionId':_0x3cf858['id'],'UserId':_0x1c86d9[_0x336d('0x58')]['id'],'ContactId':_0x3cf858[_0x336d('0xb4')],'AttachmentId':_0x1c86d9[_0x336d('0x60')][_0x336d('0xa5')][0x0]['id']})[_0x336d('0x31')](function(_0x54e3b0){_0x3cf858['dataValues'][_0x336d('0xb0')]=[];_0x3cf858['dataValues'][_0x336d('0xb0')]['push'](_0x54e3b0[_0x336d('0xb5')]);return _0x3cf858;});})['then'](function(_0x34e301){respondWithRpcPromise(_0x336d('0xb6'),_0x336d('0xb6'),{'FaxAccountId':_['isNil'](_0x1c86d9['params']['id'])?undefined:_0x1c86d9[_0x336d('0x54')]['id'],'path':_[_0x336d('0xab')](_0x1c86d9['body'][_0x336d('0xa5')][0x0][_0x336d('0x4')])?undefined:_0x1c86d9['body'][_0x336d('0xa5')][0x0]['path'],'fax':_[_0x336d('0xab')](_0x1c86d9[_0x336d('0x60')]['to'][0x0])?undefined:_0x1c86d9[_0x336d('0x60')]['to'][0x0],'AttachmentId':_0x1c86d9[_0x336d('0x60')][_0x336d('0xa5')][0x0]['id']},client9002)[_0x336d('0x31')](function(_0x13420d){logger[_0x336d('0xb7')](_0x336d('0xb8'),_0x13420d);})[_0x336d('0x22')](function(_0x596313){logger['info'](_0x336d('0xb8'),_0x596313);});return _0x34e301;})[_0x336d('0x31')](respondWithResult(_0x2480cf,null))[_0x336d('0x22')](handleError(_0x2480cf,null));};exports['addAgents']=function(_0x593983,_0x431922,_0x336830){return db[_0x336d('0x50')][_0x336d('0x57')]({'where':{'id':_0x593983[_0x336d('0x54')]['id']}})['then'](handleEntityNotFound(_0x431922,null))[_0x336d('0x31')](function(_0x57f051){if(_0x57f051){return _0x57f051[_0x336d('0xb9')](_0x593983[_0x336d('0x60')][_0x336d('0x68')],_[_0x336d('0x6f')](_0x593983[_0x336d('0x60')],[_0x336d('0x68'),'id'])||{})['spread'](function(_0x3b93ec){for(var _0x4e15d2=0x0;_0x4e15d2<_0x593983['body'][_0x336d('0x68')][_0x336d('0x45')];_0x4e15d2+=0x1){socket['emit'](_0x336d('0xba'),{'UserId':Number(_0x593983[_0x336d('0x60')][_0x336d('0x68')][_0x4e15d2]),'FaxAccountId':Number(_0x593983[_0x336d('0x54')]['id'])});}return _0x3b93ec;});}})[_0x336d('0x31')](respondWithResult(_0x431922,null))[_0x336d('0x22')](handleError(_0x431922,null));};exports[_0x336d('0xbb')]=function(_0x49ef98,_0x3a4e54,_0x217e01){return db[_0x336d('0x50')][_0x336d('0x57')]({'where':{'id':_0x49ef98[_0x336d('0x54')]['id']}})[_0x336d('0x31')](handleEntityNotFound(_0x3a4e54,null))[_0x336d('0x31')](function(_0x499385){if(_0x499385){return _0x499385['removeAgents'](_0x49ef98[_0x336d('0x3f')]['ids'])[_0x336d('0x31')](function(){if(_[_0x336d('0xbc')](_0x49ef98[_0x336d('0x3f')][_0x336d('0x68')])){for(var _0x4dc71d=0x0;_0x4dc71d<_0x49ef98[_0x336d('0x3f')][_0x336d('0x68')][_0x336d('0x45')];_0x4dc71d+=0x1){socket[_0x336d('0xbd')](_0x336d('0xbe'),{'UserId':Number(_0x49ef98[_0x336d('0x3f')][_0x336d('0x68')][_0x4dc71d]),'FaxAccountId':Number(_0x49ef98[_0x336d('0x54')]['id'])});}}else{socket['emit'](_0x336d('0xbe'),{'UserId':Number(_0x49ef98[_0x336d('0x3f')][_0x336d('0x68')]),'FaxAccountId':Number(_0x49ef98[_0x336d('0x54')]['id'])});}});}})[_0x336d('0x31')](respondWithStatusCode(_0x3a4e54,null))[_0x336d('0x22')](handleError(_0x3a4e54,null));};exports[_0x336d('0xbf')]=function(_0x2863da,_0x1ae13f,_0x550297){var _0x2fc1de={};var _0x2a473d={};var _0x2a7187;var _0x247fb6;return db[_0x336d('0x50')][_0x336d('0x64')]({'where':{'id':_0x2863da['params']['id']}})['then'](handleEntityNotFound(_0x1ae13f,null))[_0x336d('0x31')](function(_0x4184c8){if(_0x4184c8){_0x2a7187=_0x4184c8;_0x2a473d[_0x336d('0x42')]=_[_0x336d('0x55')](db[_0x336d('0x71')]['rawAttributes']);_0x2a473d['query']=_[_0x336d('0x55')](_0x2863da[_0x336d('0x3f')]);_0x2a473d[_0x336d('0x40')]=_[_0x336d('0x41')](_0x2a473d[_0x336d('0x42')],_0x2a473d[_0x336d('0x3f')]);_0x2fc1de[_0x336d('0x43')]=_[_0x336d('0x41')](_0x2a473d[_0x336d('0x42')],qs[_0x336d('0x44')](_0x2863da[_0x336d('0x3f')][_0x336d('0x44')]));_0x2fc1de[_0x336d('0x43')]=_0x2fc1de[_0x336d('0x43')][_0x336d('0x45')]?_0x2fc1de['attributes']:_0x2a473d[_0x336d('0x42')];_0x2fc1de['order']=qs[_0x336d('0x48')](_0x2863da[_0x336d('0x3f')][_0x336d('0x48')]);_0x2fc1de[_0x336d('0x4b')]=qs[_0x336d('0x40')](_[_0x336d('0x49')](_0x2863da[_0x336d('0x3f')],_0x2a473d[_0x336d('0x40')]));if(_0x2863da[_0x336d('0x3f')]['filter']){_0x2fc1de[_0x336d('0x4b')]=_[_0x336d('0x4c')](_0x2fc1de['where'],{'$or':_[_0x336d('0x3a')](_0x2fc1de[_0x336d('0x43')],function(_0x44114b){var _0x48a263={};_0x48a263[_0x44114b]={'$like':'%'+_0x2863da[_0x336d('0x3f')][_0x336d('0x4a')]+'%'};return _0x48a263;})});}_0x2fc1de=_[_0x336d('0x4c')]({},_0x2fc1de,_0x2863da[_0x336d('0x56')]);return _0x2a7187[_0x336d('0xbf')](_0x2fc1de);}})['then'](function(_0x3a3c1d){if(_0x3a3c1d){_0x247fb6=_0x3a3c1d[_0x336d('0x45')];if(!_0x2863da['query']['hasOwnProperty']('nolimit')){_0x2fc1de[_0x336d('0x29')]=qs['limit'](_0x2863da[_0x336d('0x3f')][_0x336d('0x29')]);_0x2fc1de[_0x336d('0x26')]=qs['offset'](_0x2863da[_0x336d('0x3f')]['offset']);}return _0x2a7187[_0x336d('0xbf')](_0x2fc1de);}})[_0x336d('0x31')](function(_0x589cc5){if(_0x589cc5){return _0x589cc5?{'count':_0x247fb6,'rows':_0x589cc5}:null;}})[_0x336d('0x31')](respondWithResult(_0x1ae13f,null))['catch'](handleError(_0x1ae13f,null));}; \ No newline at end of file +var _0x481d=['ContactId','dataValues','SendFax','path','info','SendFaxRpc,\x20%s','addAgents','spread','emit','userFaxAccount:save','isArray','userFaxAccount:remove','getAgents','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','socket.io-emitter','register','jayson/promise','client','http','request','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','destroy','then','get','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','type','filter','options','includeAll','FaxAccount','findAll','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','getDispositions','findOne','Disposition','FaxAccountId','include','rows','removeDispositions','addAnswer','CannedAnswer','removeAnswers','ids','addInteraction','FaxInteraction','omit','User','Owner','fullname','internal','Tag','tag','transaction','sequelize','Transaction','ISOLATION_LEVELS','finally','FaxApplication','getApplications','context','from-voip-provider','exten','app','system','description','Fax\x20Extension','priority','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','localstationid','gateway','faxdetect','headerinfo','maxrate','minrate','t38timeout','FAXOPT(','Wait','ReceiveFax','VoiceExtension','bulkCreate','tech','createdAt','updatedAt','TrunkId','ListId','findById','FaxMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','defaults','List\x20not\x20found','Send\x20Fax\x20failed','filename','Messages','out'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x481d,0x191));var _0xd481=function(_0x1a0daa,_0x2a4634){_0x1a0daa=_0x1a0daa-0x0;var _0x1dbe15=_0x481d[_0x1a0daa];return _0x1dbe15;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd481('0x0'));var jsonpatch=require(_0xd481('0x1'));var rp=require('request-promise');var moment=require(_0xd481('0x2'));var BPromise=require(_0xd481('0x3'));var Mustache=require(_0xd481('0x4'));var util=require(_0xd481('0x5'));var path=require('path');var sox=require(_0xd481('0x6'));var csv=require(_0xd481('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd481('0x8'));var _=require(_0xd481('0x9'));var squel=require(_0xd481('0xa'));var crypto=require(_0xd481('0xb'));var jsforce=require(_0xd481('0xc'));var deskjs=require(_0xd481('0xd'));var toCsv=require(_0xd481('0x7'));var querystring=require('querystring');var Papa=require(_0xd481('0xe'));var Redis=require('ioredis');var authService=require(_0xd481('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xd481('0x10'));var hardwareService=require(_0xd481('0x11'));var logger=require(_0xd481('0x12'))(_0xd481('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd481('0x14'));var db=require(_0xd481('0x15'))['db'];config[_0xd481('0x16')]=_['defaults'](config[_0xd481('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xd481('0x17'))(new Redis(config[_0xd481('0x16')]));require('./faxAccount.socket')[_0xd481('0x18')](socket);var jayson=require(_0xd481('0x19'));var client=jayson[_0xd481('0x1a')][_0xd481('0x1b')]({'port':0x232c});var client9002=jayson[_0xd481('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x426799,_0x336609,_0x595a88,_0x167841){return new BPromise(function(_0xc3b494,_0xfdc8eb){var _0x5ca1f7=_0x167841||client;return _0x5ca1f7[_0xd481('0x1c')](_0x426799,_0x595a88)['then'](function(_0x22a9a7){logger['info'](_0xd481('0x1d'),_0x336609,'request\x20sent');logger[_0xd481('0x1e')](_0xd481('0x1f'),_0x336609,_0xd481('0x20'),JSON[_0xd481('0x21')](_0x22a9a7));if(_0x22a9a7[_0xd481('0x22')]){if(_0x22a9a7[_0xd481('0x22')][_0xd481('0x23')]===0x1f4){logger[_0xd481('0x22')](_0xd481('0x1d'),_0x336609,_0x22a9a7[_0xd481('0x22')][_0xd481('0x24')]);return _0xfdc8eb(_0x22a9a7[_0xd481('0x22')]['message']);}logger[_0xd481('0x22')](_0xd481('0x1d'),_0x336609,_0x22a9a7[_0xd481('0x22')][_0xd481('0x24')]);return _0xc3b494(_0x22a9a7['error'][_0xd481('0x24')]);}else{logger['info'](_0xd481('0x1d'),_0x336609,_0xd481('0x20'));_0xc3b494(_0x22a9a7['result'][_0xd481('0x24')]);}})[_0xd481('0x25')](function(_0x6145cb){logger[_0xd481('0x22')](_0xd481('0x1d'),_0x336609,_0x6145cb);_0xfdc8eb(_0x6145cb);});});}function respondWithStatusCode(_0x2162a6,_0x3a2791){_0x3a2791=_0x3a2791||0xcc;return function(_0x192be6){if(_0x192be6){return _0x2162a6[_0xd481('0x26')](_0x3a2791);}return _0x2162a6[_0xd481('0x27')](_0x3a2791)[_0xd481('0x28')]();};}function respondWithResult(_0x13f757,_0xd2cb1c){_0xd2cb1c=_0xd2cb1c||0xc8;return function(_0x4d8c9d){if(_0x4d8c9d){return _0x13f757[_0xd481('0x27')](_0xd2cb1c)['json'](_0x4d8c9d);}};}function respondWithFilteredResult(_0x3d3a6d,_0x12976b){return function(_0x2e22b6){if(_0x2e22b6){var _0x5e090d=typeof _0x12976b[_0xd481('0x29')]===_0xd481('0x2a')&&typeof _0x12976b[_0xd481('0x2b')]===_0xd481('0x2a');var _0x2d9293=_0x2e22b6[_0xd481('0x2c')];var _0x1901d8=_0x5e090d?0x0:_0x12976b[_0xd481('0x29')];var _0xdb454a=_0x5e090d?_0x2e22b6[_0xd481('0x2c')]:_0x12976b[_0xd481('0x29')]+_0x12976b['limit'];var _0x3aca0c;if(_0xdb454a>=_0x2d9293){_0xdb454a=_0x2d9293;_0x3aca0c=0xc8;}else{_0x3aca0c=0xce;}_0x3d3a6d[_0xd481('0x27')](_0x3aca0c);return _0x3d3a6d[_0xd481('0x2d')](_0xd481('0x2e'),_0x1901d8+'-'+_0xdb454a+'/'+_0x2d9293)[_0xd481('0x2f')](_0x2e22b6);}return null;};}function patchUpdates(_0x1f7b43){return function(_0x259fab){try{jsonpatch['apply'](_0x259fab,_0x1f7b43,!![]);}catch(_0x9973a2){return BPromise[_0xd481('0x30')](_0x9973a2);}return _0x259fab[_0xd481('0x31')]();};}function saveUpdates(_0x1a216d,_0x468e65){return function(_0x48eef9){if(_0x48eef9){return _0x48eef9[_0xd481('0x32')](_0x1a216d)['then'](function(_0x37b55f){return _0x37b55f;});}return null;};}function removeEntity(_0x509a8e,_0x241ca4){return function(_0x662119){if(_0x662119){return _0x662119[_0xd481('0x33')]()[_0xd481('0x34')](function(){var _0x9ad034=_0x662119[_0xd481('0x35')]({'plain':!![]});var _0x3519ea='FaxAccounts';return db[_0xd481('0x36')][_0xd481('0x33')]({'where':{'type':_0x3519ea,'resourceId':_0x9ad034['id']}})['then'](function(){return _0x662119;});})[_0xd481('0x34')](function(){_0x509a8e['status'](0xcc)[_0xd481('0x28')]();});}};}function handleEntityNotFound(_0x1d6bfb,_0x272a4b){return function(_0x5ea214){if(!_0x5ea214){_0x1d6bfb[_0xd481('0x26')](0x194);}return _0x5ea214;};}function handleError(_0x5e52bd,_0x51a8d6){_0x51a8d6=_0x51a8d6||0x1f4;return function(_0x33f0dc){logger[_0xd481('0x22')](_0x33f0dc[_0xd481('0x37')]);if(_0x33f0dc[_0xd481('0x38')]){delete _0x33f0dc[_0xd481('0x38')];}_0x5e52bd[_0xd481('0x27')](_0x51a8d6)[_0xd481('0x39')](_0x33f0dc);};}exports[_0xd481('0x3a')]=function(_0x1c480f,_0x56037c){var _0x4ce1fe={'include':[{'model':db[_0xd481('0x3b')],'as':_0xd481('0x3c')}]},_0x376d28={},_0x45f4c8={'count':0x0,'rows':[]};var _0x3ffe2f=_['map'](db['FaxAccount'][_0xd481('0x3d')],function(_0x570310){return{'name':_0x570310[_0xd481('0x3e')],'type':_0x570310['type'][_0xd481('0x3f')]};});_0x376d28[_0xd481('0x40')]=_[_0xd481('0x41')](_0x3ffe2f,_0xd481('0x38'));_0x376d28[_0xd481('0x42')]=_[_0xd481('0x43')](_0x1c480f[_0xd481('0x42')]);_0x376d28['filters']=_[_0xd481('0x44')](_0x376d28[_0xd481('0x40')],_0x376d28['query']);_0x4ce1fe[_0xd481('0x45')]=_['intersection'](_0x376d28[_0xd481('0x40')],qs[_0xd481('0x46')](_0x1c480f['query'][_0xd481('0x46')]));_0x4ce1fe[_0xd481('0x45')]=_0x4ce1fe[_0xd481('0x45')][_0xd481('0x47')]?_0x4ce1fe[_0xd481('0x45')]:_0x376d28[_0xd481('0x40')];if(!_0x1c480f[_0xd481('0x42')][_0xd481('0x48')](_0xd481('0x49'))){_0x4ce1fe[_0xd481('0x2b')]=qs[_0xd481('0x2b')](_0x1c480f['query'][_0xd481('0x2b')]);_0x4ce1fe[_0xd481('0x29')]=qs[_0xd481('0x29')](_0x1c480f[_0xd481('0x42')][_0xd481('0x29')]);}_0x4ce1fe[_0xd481('0x4a')]=qs[_0xd481('0x4b')](_0x1c480f[_0xd481('0x42')][_0xd481('0x4b')]);_0x4ce1fe[_0xd481('0x4c')]=qs[_0xd481('0x4d')](_[_0xd481('0x4e')](_0x1c480f[_0xd481('0x42')],_0x376d28[_0xd481('0x4d')]),_0x3ffe2f);if(_0x1c480f[_0xd481('0x42')]['filter']){_0x4ce1fe[_0xd481('0x4c')]=_[_0xd481('0x4f')](_0x4ce1fe['where'],{'$or':_[_0xd481('0x41')](_0x3ffe2f,function(_0xa950d2){if(_0xa950d2[_0xd481('0x50')]!=='VIRTUAL'){var _0x3ef85a={};_0x3ef85a[_0xa950d2[_0xd481('0x38')]]={'$like':'%'+_0x1c480f['query'][_0xd481('0x51')]+'%'};return _0x3ef85a;}})});}_0x4ce1fe=_['merge']({},_0x4ce1fe,_0x1c480f[_0xd481('0x52')]);var _0x56e361={'where':_0x4ce1fe[_0xd481('0x4c')]};return db['FaxAccount'][_0xd481('0x2c')](_0x56e361)['then'](function(_0x507ccf){_0x45f4c8[_0xd481('0x2c')]=_0x507ccf;if(_0x1c480f[_0xd481('0x42')][_0xd481('0x53')]){_0x4ce1fe['include']=[{'all':!![]}];}return db[_0xd481('0x54')][_0xd481('0x55')](_0x4ce1fe);})[_0xd481('0x34')](function(_0xd9f9f){_0x45f4c8['rows']=_0xd9f9f;return _0x45f4c8;})[_0xd481('0x34')](respondWithFilteredResult(_0x56037c,_0x4ce1fe))[_0xd481('0x25')](handleError(_0x56037c,null));};exports['show']=function(_0xfffda1,_0x4b8c3e){var _0x530478={'raw':![],'where':{'id':_0xfffda1[_0xd481('0x56')]['id']},'include':[{'model':db[_0xd481('0x3b')],'as':_0xd481('0x3c')}]},_0x134244={};_0x134244[_0xd481('0x40')]=_[_0xd481('0x43')](db[_0xd481('0x54')][_0xd481('0x3d')]);_0x134244[_0xd481('0x42')]=_['keys'](_0xfffda1[_0xd481('0x42')]);_0x134244[_0xd481('0x4d')]=_[_0xd481('0x44')](_0x134244[_0xd481('0x40')],_0x134244[_0xd481('0x42')]);_0x530478[_0xd481('0x45')]=_[_0xd481('0x44')](_0x134244[_0xd481('0x40')],qs[_0xd481('0x46')](_0xfffda1['query']['fields']));_0x530478['attributes']=_0x530478[_0xd481('0x45')]['length']?_0x530478[_0xd481('0x45')]:_0x134244['model'];if(_0xfffda1[_0xd481('0x42')][_0xd481('0x53')]){_0x530478['include']=[{'all':!![]}];}_0x530478=_[_0xd481('0x4f')]({},_0x530478,_0xfffda1[_0xd481('0x52')]);return db[_0xd481('0x54')][_0xd481('0x57')](_0x530478)[_0xd481('0x34')](handleEntityNotFound(_0x4b8c3e,null))[_0xd481('0x34')](respondWithResult(_0x4b8c3e,null))['catch'](handleError(_0x4b8c3e,null));};exports[_0xd481('0x58')]=function(_0x3cd403,_0x120011){return db[_0xd481('0x54')][_0xd481('0x58')](_0x3cd403[_0xd481('0x59')],{})[_0xd481('0x34')](function(_0x2ae3d0){var _0x4c6dd0=_0x3cd403[_0xd481('0x5a')][_0xd481('0x35')]({'plain':!![]});if(!_0x4c6dd0)throw new Error(_0xd481('0x5b'));if(_0x4c6dd0['role']===_0xd481('0x5a')){var _0x23350f=_0x2ae3d0[_0xd481('0x35')]({'plain':!![]});var _0x40a625='FaxAccounts';return db[_0xd481('0x5c')][_0xd481('0x57')]({'where':{'name':_0x40a625,'userProfileId':_0x4c6dd0[_0xd481('0x5d')]},'raw':!![]})['then'](function(_0x5b7816){if(_0x5b7816&&_0x5b7816[_0xd481('0x5e')]===0x0){return db[_0xd481('0x36')]['create']({'name':_0x23350f[_0xd481('0x38')],'resourceId':_0x23350f['id'],'type':_0x5b7816[_0xd481('0x38')],'sectionId':_0x5b7816['id']},{})[_0xd481('0x34')](function(){return _0x2ae3d0;});}else{return _0x2ae3d0;}})[_0xd481('0x25')](function(_0x4e295f){logger[_0xd481('0x22')](_0xd481('0x5f'),_0x4e295f);throw _0x4e295f;});}return _0x2ae3d0;})['then'](respondWithResult(_0x120011,0xc9))['catch'](handleError(_0x120011,null));};exports['update']=function(_0x3f1b80,_0x3c55c7){if(_0x3f1b80[_0xd481('0x59')]['id']){delete _0x3f1b80[_0xd481('0x59')]['id'];}return db[_0xd481('0x54')][_0xd481('0x57')]({'where':{'id':_0x3f1b80[_0xd481('0x56')]['id']},'include':[{'model':db[_0xd481('0x3b')],'as':_0xd481('0x3c')}]})[_0xd481('0x34')](handleEntityNotFound(_0x3c55c7,null))[_0xd481('0x34')](saveUpdates(_0x3f1b80[_0xd481('0x59')],null))['then'](respondWithResult(_0x3c55c7,null))[_0xd481('0x25')](handleError(_0x3c55c7,null));};exports[_0xd481('0x33')]=function(_0x4f99c9,_0x785cf8){return db[_0xd481('0x54')][_0xd481('0x57')]({'where':{'id':_0x4f99c9['params']['id']}})[_0xd481('0x34')](handleEntityNotFound(_0x785cf8,null))[_0xd481('0x34')](removeEntity(_0x785cf8,null))[_0xd481('0x25')](handleError(_0x785cf8,null));};exports[_0xd481('0x60')]=function(_0x144681,_0x303ba9){return db[_0xd481('0x54')]['describe']()['then'](respondWithResult(_0x303ba9,null))[_0xd481('0x25')](handleError(_0x303ba9,null));};exports[_0xd481('0x61')]=function(_0x289b8c,_0x4b934b,_0x184f70){if(_0x289b8c[_0xd481('0x59')]['id']){delete _0x289b8c['body']['id'];}return db[_0xd481('0x54')][_0xd481('0x57')]({'where':{'id':_0x289b8c[_0xd481('0x56')]['id']}})[_0xd481('0x34')](handleEntityNotFound(_0x4b934b,null))[_0xd481('0x34')](function(_0x356126){if(_0x356126){_0x289b8c[_0xd481('0x59')]['FaxAccountId']=_0x356126['id'];return db['Disposition'][_0xd481('0x58')](_0x289b8c[_0xd481('0x59')]);}})[_0xd481('0x34')](respondWithResult(_0x4b934b,null))[_0xd481('0x25')](handleError(_0x4b934b,null));};exports[_0xd481('0x62')]=function(_0x5da2f9,_0x5a468c,_0x56d284){var _0x27dc5c={'raw':![],'where':{}};var _0x24154f={};var _0x2e1aee={'count':0x0,'rows':[]};return db[_0xd481('0x54')][_0xd481('0x63')]({'where':{'id':_0x5da2f9[_0xd481('0x56')]['id']}})['then'](handleEntityNotFound(_0x5a468c,null))['then'](function(_0x10d196){if(_0x10d196){_0x24154f[_0xd481('0x40')]=_[_0xd481('0x43')](db[_0xd481('0x64')][_0xd481('0x3d')]);_0x24154f['query']=_[_0xd481('0x43')](_0x5da2f9['query']);_0x24154f[_0xd481('0x4d')]=_[_0xd481('0x44')](_0x24154f[_0xd481('0x40')],_0x24154f['query']);_0x27dc5c['attributes']=_[_0xd481('0x44')](_0x24154f['model'],qs[_0xd481('0x46')](_0x5da2f9['query'][_0xd481('0x46')]));_0x27dc5c[_0xd481('0x45')]=_0x27dc5c['attributes'][_0xd481('0x47')]?_0x27dc5c[_0xd481('0x45')]:_0x24154f[_0xd481('0x40')];if(!_0x5da2f9[_0xd481('0x42')]['hasOwnProperty'](_0xd481('0x49'))){_0x27dc5c[_0xd481('0x2b')]=qs[_0xd481('0x2b')](_0x5da2f9[_0xd481('0x42')]['limit']);_0x27dc5c[_0xd481('0x29')]=qs[_0xd481('0x29')](_0x5da2f9[_0xd481('0x42')][_0xd481('0x29')]);}_0x27dc5c[_0xd481('0x4a')]=qs['sort'](_0x5da2f9[_0xd481('0x42')][_0xd481('0x4b')]);_0x27dc5c[_0xd481('0x4c')]=qs['filters'](_[_0xd481('0x4e')](_0x5da2f9[_0xd481('0x42')],_0x24154f[_0xd481('0x4d')]));_0x27dc5c[_0xd481('0x4c')][_0xd481('0x65')]=_0x10d196['id'];if(_0x5da2f9[_0xd481('0x42')][_0xd481('0x51')]){_0x27dc5c[_0xd481('0x4c')]=_[_0xd481('0x4f')](_0x27dc5c[_0xd481('0x4c')],{'$or':_[_0xd481('0x41')](_0x27dc5c[_0xd481('0x45')],function(_0xbf73a3){var _0x14b846={};_0x14b846[_0xbf73a3]={'$like':'%'+_0x5da2f9[_0xd481('0x42')][_0xd481('0x51')]+'%'};return _0x14b846;})});}_0x27dc5c=_[_0xd481('0x4f')]({},_0x27dc5c,_0x5da2f9['options']);return db[_0xd481('0x64')][_0xd481('0x2c')]({'where':_0x27dc5c[_0xd481('0x4c')]})[_0xd481('0x34')](function(_0x3e35ee){_0x2e1aee[_0xd481('0x2c')]=_0x3e35ee;if(_0x5da2f9[_0xd481('0x42')]['includeAll']){_0x27dc5c[_0xd481('0x66')]=[{'all':!![]}];}return db[_0xd481('0x64')][_0xd481('0x55')](_0x27dc5c);})[_0xd481('0x34')](function(_0x45e183){_0x2e1aee[_0xd481('0x67')]=_0x45e183;return _0x2e1aee;});}})['then'](respondWithFilteredResult(_0x5a468c,_0x27dc5c))['catch'](handleError(_0x5a468c,null));};exports['removeDispositions']=function(_0x2802e5,_0x2c25b4,_0x4d9241){return db['FaxAccount']['find']({'where':{'id':_0x2802e5['params']['id']}})[_0xd481('0x34')](handleEntityNotFound(_0x2c25b4,null))['then'](function(_0x2a13df){if(_0x2a13df){return _0x2a13df[_0xd481('0x68')](_0x2802e5[_0xd481('0x42')]['ids']);}})[_0xd481('0x34')](respondWithStatusCode(_0x2c25b4,null))[_0xd481('0x25')](handleError(_0x2c25b4,null));};exports[_0xd481('0x69')]=function(_0x20d326,_0x262602,_0x3e882f){if(_0x20d326['body']['id']){delete _0x20d326['body']['id'];}return db[_0xd481('0x54')][_0xd481('0x57')]({'where':{'id':_0x20d326[_0xd481('0x56')]['id']}})['then'](handleEntityNotFound(_0x262602,null))['then'](function(_0x3783cf){if(_0x3783cf){_0x20d326[_0xd481('0x59')]['FaxAccountId']=_0x3783cf['id'];return db['CannedAnswer'][_0xd481('0x58')](_0x20d326[_0xd481('0x59')]);}})[_0xd481('0x34')](respondWithResult(_0x262602,null))[_0xd481('0x25')](handleError(_0x262602,null));};exports['getAnswers']=function(_0x5ab2f2,_0x520244,_0x51a260){var _0x58d31f={'raw':![],'where':{}};var _0x47562f={};var _0x1f2d5f={'count':0x0,'rows':[]};return db[_0xd481('0x54')][_0xd481('0x63')]({'where':{'id':_0x5ab2f2[_0xd481('0x56')]['id']}})['then'](handleEntityNotFound(_0x520244,null))['then'](function(_0x48823d){if(_0x48823d){_0x47562f['model']=_['keys'](db[_0xd481('0x6a')]['rawAttributes']);_0x47562f[_0xd481('0x42')]=_[_0xd481('0x43')](_0x5ab2f2[_0xd481('0x42')]);_0x47562f['filters']=_[_0xd481('0x44')](_0x47562f[_0xd481('0x40')],_0x47562f['query']);_0x58d31f['attributes']=_[_0xd481('0x44')](_0x47562f[_0xd481('0x40')],qs[_0xd481('0x46')](_0x5ab2f2[_0xd481('0x42')]['fields']));_0x58d31f[_0xd481('0x45')]=_0x58d31f[_0xd481('0x45')]['length']?_0x58d31f[_0xd481('0x45')]:_0x47562f[_0xd481('0x40')];if(!_0x5ab2f2[_0xd481('0x42')][_0xd481('0x48')](_0xd481('0x49'))){_0x58d31f[_0xd481('0x2b')]=qs[_0xd481('0x2b')](_0x5ab2f2[_0xd481('0x42')][_0xd481('0x2b')]);_0x58d31f['offset']=qs[_0xd481('0x29')](_0x5ab2f2['query'][_0xd481('0x29')]);}_0x58d31f[_0xd481('0x4a')]=qs[_0xd481('0x4b')](_0x5ab2f2[_0xd481('0x42')][_0xd481('0x4b')]);_0x58d31f[_0xd481('0x4c')]=qs[_0xd481('0x4d')](_['pick'](_0x5ab2f2[_0xd481('0x42')],_0x47562f[_0xd481('0x4d')]));_0x58d31f[_0xd481('0x4c')]['FaxAccountId']=_0x48823d['id'];if(_0x5ab2f2['query'][_0xd481('0x51')]){_0x58d31f[_0xd481('0x4c')]=_[_0xd481('0x4f')](_0x58d31f[_0xd481('0x4c')],{'$or':_[_0xd481('0x41')](_0x58d31f[_0xd481('0x45')],function(_0x1e7259){var _0x18839f={};_0x18839f[_0x1e7259]={'$like':'%'+_0x5ab2f2[_0xd481('0x42')]['filter']+'%'};return _0x18839f;})});}_0x58d31f=_[_0xd481('0x4f')]({},_0x58d31f,_0x5ab2f2[_0xd481('0x52')]);return db['CannedAnswer']['count']({'where':_0x58d31f[_0xd481('0x4c')]})[_0xd481('0x34')](function(_0xabc506){_0x1f2d5f[_0xd481('0x2c')]=_0xabc506;if(_0x5ab2f2[_0xd481('0x42')][_0xd481('0x53')]){_0x58d31f[_0xd481('0x66')]=[{'all':!![]}];}return db[_0xd481('0x6a')][_0xd481('0x55')](_0x58d31f);})[_0xd481('0x34')](function(_0x2436de){_0x1f2d5f['rows']=_0x2436de;return _0x1f2d5f;});}})[_0xd481('0x34')](respondWithFilteredResult(_0x520244,_0x58d31f))[_0xd481('0x25')](handleError(_0x520244,null));};exports[_0xd481('0x6b')]=function(_0x157720,_0x248f76,_0x155aa0){return db[_0xd481('0x54')][_0xd481('0x57')]({'where':{'id':_0x157720[_0xd481('0x56')]['id']}})['then'](handleEntityNotFound(_0x248f76,null))[_0xd481('0x34')](function(_0x34e114){if(_0x34e114){return _0x34e114[_0xd481('0x6b')](_0x157720[_0xd481('0x42')][_0xd481('0x6c')]);}})[_0xd481('0x34')](respondWithStatusCode(_0x248f76,null))[_0xd481('0x25')](handleError(_0x248f76,null));};exports[_0xd481('0x6d')]=function(_0xec166b,_0x31894e,_0x142d85){return db[_0xd481('0x6e')]['find']({'where':{'id':_0xec166b[_0xd481('0x56')]['id']}})[_0xd481('0x34')](handleEntityNotFound(_0x31894e,null))[_0xd481('0x34')](function(_0x5f4e4f){if(_0x5f4e4f){return _0x5f4e4f[_0xd481('0x6d')](_0xec166b[_0xd481('0x59')][_0xd481('0x6c')],_[_0xd481('0x6f')](_0xec166b[_0xd481('0x59')],[_0xd481('0x6c'),'id'])||{});}})[_0xd481('0x34')](respondWithResult(_0x31894e,null))[_0xd481('0x25')](handleError(_0x31894e,null));};exports['getInteractions']=function(_0x2dbb20,_0x450b84,_0x4c3f2a){var _0x5b9f0d={'raw':![],'where':{}};var _0x36d721={};var _0x3a2ec3={'count':0x0,'rows':[]};return db[_0xd481('0x54')][_0xd481('0x63')]({'where':{'id':_0x2dbb20['params']['id']}})['then'](handleEntityNotFound(_0x450b84,null))[_0xd481('0x34')](function(_0x5dba8b){if(_0x5dba8b){_0x36d721[_0xd481('0x40')]=_['keys'](db[_0xd481('0x6e')][_0xd481('0x3d')]);_0x36d721[_0xd481('0x42')]=_[_0xd481('0x43')](_0x2dbb20[_0xd481('0x42')]);_0x36d721['filters']=_[_0xd481('0x44')](_0x36d721['model'],_0x36d721['query']);_0x5b9f0d['attributes']=_[_0xd481('0x44')](_0x36d721[_0xd481('0x40')],qs[_0xd481('0x46')](_0x2dbb20[_0xd481('0x42')][_0xd481('0x46')]));_0x5b9f0d[_0xd481('0x45')]=_0x5b9f0d[_0xd481('0x45')][_0xd481('0x47')]?_0x5b9f0d[_0xd481('0x45')]:_0x36d721[_0xd481('0x40')];if(!_0x2dbb20[_0xd481('0x42')][_0xd481('0x48')](_0xd481('0x49'))){_0x5b9f0d[_0xd481('0x2b')]=qs[_0xd481('0x2b')](_0x2dbb20[_0xd481('0x42')]['limit']);_0x5b9f0d[_0xd481('0x29')]=qs[_0xd481('0x29')](_0x2dbb20[_0xd481('0x42')][_0xd481('0x29')]);}_0x5b9f0d[_0xd481('0x4a')]=qs[_0xd481('0x4b')](_0x2dbb20['query'][_0xd481('0x4b')]);_0x5b9f0d[_0xd481('0x4c')]=qs[_0xd481('0x4d')](_[_0xd481('0x4e')](_0x2dbb20[_0xd481('0x42')],_0x36d721['filters']));_0x5b9f0d[_0xd481('0x4c')][_0xd481('0x65')]=_0x5dba8b['id'];if(_0x2dbb20['query'][_0xd481('0x51')]){_0x5b9f0d[_0xd481('0x4c')]=_['merge'](_0x5b9f0d['where'],{'$or':_[_0xd481('0x41')](_0x5b9f0d[_0xd481('0x45')],function(_0x418bbb){var _0x51a812={};_0x51a812[_0x418bbb]={'$like':'%'+_0x2dbb20[_0xd481('0x42')][_0xd481('0x51')]+'%'};return _0x51a812;})});}_0x5b9f0d=_[_0xd481('0x4f')]({},_0x5b9f0d,_0x2dbb20[_0xd481('0x52')]);return db['FaxInteraction'][_0xd481('0x2c')]({'where':_0x5b9f0d['where']})[_0xd481('0x34')](function(_0x11ad3){_0x3a2ec3[_0xd481('0x2c')]=_0x11ad3;if(_0x2dbb20[_0xd481('0x42')][_0xd481('0x53')]){_0x5b9f0d[_0xd481('0x66')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0xd481('0x70')],'as':_0xd481('0x71'),'attributes':[_0xd481('0x38'),_0xd481('0x72'),_0xd481('0x73')],'required':![]},{'model':db[_0xd481('0x74')],'as':'Tags','attributes':['id',_0xd481('0x38'),'color'],'where':_0x2dbb20[_0xd481('0x42')][_0xd481('0x75')]?{'id':_0x2dbb20['query'][_0xd481('0x75')]}:undefined,'required':_0x2dbb20[_0xd481('0x42')][_0xd481('0x75')]?!![]:![]}];}return db[_0xd481('0x6e')][_0xd481('0x55')](_0x5b9f0d);})[_0xd481('0x34')](function(_0x3ee512){_0x3a2ec3[_0xd481('0x67')]=_0x3ee512;return _0x3a2ec3;});}})['then'](respondWithFilteredResult(_0x450b84,_0x5b9f0d))['catch'](handleError(_0x450b84,null));};exports['addApplications']=function(_0x3115b4,_0x415b75){var _0x55b4fe=_0x3115b4[_0xd481('0x56')]['id'];var _0xa0ac82=_0x3115b4['body'];var _0x401a06=0xc8;var _0xc0f84c=null;return db['sequelize'][_0xd481('0x76')]({'isolationLevel':db[_0xd481('0x77')][_0xd481('0x78')][_0xd481('0x79')]['READ_COMMITTED']},function(_0x216337){return db[_0xd481('0x54')][_0xd481('0x63')]({'where':{'id':_0x55b4fe},'transaction':_0x216337})[_0xd481('0x34')](function(_0xb3b977){if(_0xb3b977){return db['FaxApplication'][_0xd481('0x33')]({'where':{'FaxAccountId':_0x55b4fe},'transaction':_0x216337})[_0xd481('0x34')](function(){var _0x224fbe=_[_0xd481('0x41')](_0xa0ac82,function(_0x8905aa){_0x8905aa['FaxAccountId']=_0x55b4fe;return _0x8905aa;});return db['FaxApplication']['bulkCreate'](_0x224fbe,{'transaction':_0x216337});});}else{_0x401a06=0x194;_0xc0f84c=[];}});})[_0xd481('0x34')](function(){if(_0x401a06!==0x194){return db['FaxApplication']['findAndCountAll']({'where':{'FaxAccountId':_0x55b4fe},'order':'priority'})['then'](function(_0x196f1c){_0xc0f84c=_0x196f1c;});}})[_0xd481('0x25')](function(_0x2bc983){_0x401a06=0x1f4;logger[_0xd481('0x22')](_0x2bc983['stack']);if(_0x2bc983[_0xd481('0x38')]){delete _0x2bc983[_0xd481('0x38')];}_0xc0f84c=_0x2bc983;})[_0xd481('0x7a')](function(){if(_0xc0f84c===null){_0x415b75[_0xd481('0x26')](_0x401a06);}else{if(_0x401a06===0x1f4){_0x415b75[_0xd481('0x27')](_0x401a06)[_0xd481('0x39')](_0xc0f84c);}else{_0x415b75[_0xd481('0x27')](_0x401a06)[_0xd481('0x2f')](_0xc0f84c);}}});};exports['getApplications']=function(_0x28d7e7,_0x5a0606,_0xaf6008){var _0x393e80={};var _0x1b70e2={};var _0x3718eb;var _0x237e17;return db[_0xd481('0x54')][_0xd481('0x63')]({'where':{'id':_0x28d7e7[_0xd481('0x56')]['id']}})[_0xd481('0x34')](handleEntityNotFound(_0x5a0606,null))[_0xd481('0x34')](function(_0x4fc0e9){if(_0x4fc0e9){_0x3718eb=_0x4fc0e9;_0x1b70e2[_0xd481('0x40')]=_[_0xd481('0x43')](db[_0xd481('0x7b')][_0xd481('0x3d')]);_0x1b70e2[_0xd481('0x42')]=_['keys'](_0x28d7e7['query']);_0x1b70e2[_0xd481('0x4d')]=_['intersection'](_0x1b70e2[_0xd481('0x40')],_0x1b70e2[_0xd481('0x42')]);_0x393e80['attributes']=_[_0xd481('0x44')](_0x1b70e2[_0xd481('0x40')],qs[_0xd481('0x46')](_0x28d7e7[_0xd481('0x42')][_0xd481('0x46')]));_0x393e80['attributes']=_0x393e80['attributes'][_0xd481('0x47')]?_0x393e80[_0xd481('0x45')]:_0x1b70e2[_0xd481('0x40')];_0x393e80['order']=qs[_0xd481('0x4b')](_0x28d7e7[_0xd481('0x42')][_0xd481('0x4b')]);_0x393e80[_0xd481('0x4c')]=qs[_0xd481('0x4d')](_[_0xd481('0x4e')](_0x28d7e7[_0xd481('0x42')],_0x1b70e2[_0xd481('0x4d')]));if(_0x28d7e7[_0xd481('0x42')][_0xd481('0x51')]){_0x393e80[_0xd481('0x4c')]=_[_0xd481('0x4f')](_0x393e80[_0xd481('0x4c')],{'$or':_[_0xd481('0x41')](_0x393e80[_0xd481('0x45')],function(_0x333980){var _0x483d3e={};_0x483d3e[_0x333980]={'$like':'%'+_0x28d7e7[_0xd481('0x42')][_0xd481('0x51')]+'%'};return _0x483d3e;})});}_0x393e80=_[_0xd481('0x4f')]({},_0x393e80,_0x28d7e7[_0xd481('0x52')]);return _0x3718eb[_0xd481('0x7c')](_0x393e80);}})[_0xd481('0x34')](function(_0x158ddc){if(_0x158ddc){_0x237e17=_0x158ddc['length'];if(!_0x28d7e7[_0xd481('0x42')]['hasOwnProperty'](_0xd481('0x49'))){_0x393e80[_0xd481('0x2b')]=qs[_0xd481('0x2b')](_0x28d7e7['query'][_0xd481('0x2b')]);_0x393e80[_0xd481('0x29')]=qs['offset'](_0x28d7e7[_0xd481('0x42')]['offset']);}return _0x3718eb[_0xd481('0x7c')](_0x393e80);}})['then'](function(_0x1e3277){if(_0x1e3277){return _0x1e3277?{'count':_0x237e17,'rows':_0x1e3277}:null;}})[_0xd481('0x34')](respondWithResult(_0x5a0606,null))[_0xd481('0x25')](handleError(_0x5a0606,null));};function Extension(_0x2970d4,_0x58af3e,_0x5048be,_0x5cc5fd){this[_0xd481('0x7d')]=_0xd481('0x7e');this[_0xd481('0x7f')]=_0x2970d4['localstationid'];this[_0xd481('0x80')]=_0x5cc5fd;this[_0xd481('0x50')]=_0xd481('0x81');this[_0xd481('0x82')]=_0xd481('0x83');this[_0xd481('0x65')]=_0x2970d4['id'];this[_0xd481('0x84')]=_0x58af3e;this[_0xd481('0x85')]=_0x5048be;}function createExtensionsReciveFax(_0x4a04be){var _0x4e4c96=0x1;var _0x2df11a=[];_0x2df11a[_0xd481('0x86')](new Extension(_0x4a04be,_0x4e4c96,'',_0xd481('0x87')));_0x4e4c96+=0x1;_0x2df11a[_0xd481('0x86')](new Extension(_0x4a04be,_0x4e4c96,_0xd481('0x88'),_0xd481('0x89')));_0x4e4c96+=0x1;for(var _0x422e6e in _0x4a04be){if(_0x4a04be[_0xd481('0x48')](_0x422e6e)&&(_0x422e6e===_0xd481('0x8a')||_0x422e6e===_0xd481('0x8b')||_0x422e6e===_0xd481('0x8c')||_0x422e6e===_0xd481('0x8d')||_0x422e6e===_0xd481('0x8e')||_0x422e6e===_0xd481('0x8f')||_0x422e6e===_0xd481('0x90')||_0x422e6e==='modem'||_0x422e6e===_0xd481('0x91'))){_0x2df11a[_0xd481('0x86')](new Extension(_0x4a04be,_0x4e4c96,_0xd481('0x92')+_0x422e6e+')='+_0x4a04be[_0x422e6e],_0xd481('0x89')));_0x4e4c96+=0x1;}}_0x2df11a[_0xd481('0x86')](new Extension(_0x4a04be,_0x4e4c96,'6',_0xd481('0x93')));_0x4e4c96+=0x1;_0x2df11a[_0xd481('0x86')](new Extension(_0x4a04be,_0x4e4c96,'/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',_0xd481('0x94')));_0x4e4c96=0x0;return _0x2df11a;}exports['addAccountApplications']=function(_0x240036,_0x4299fe,_0x49deba){var _0x411318;return db['sequelize']['transaction'](function(_0x12d40f){return db['FaxAccount']['create'](_0x240036['body'],{'transaction':_0x12d40f})[_0xd481('0x34')](function(_0x5aa2b2){_0x411318=_0x5aa2b2[_0xd481('0x35')]({'plain':!![]});return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_0x411318),{'transaction':_0x12d40f});});})['then'](function(){return _0x411318;})[_0xd481('0x34')](respondWithResult(_0x4299fe,null))[_0xd481('0x25')](handleError(_0x4299fe,null));};exports['updateAccountApplications']=function(_0x1d6cf8,_0x17dc40,_0x5c8f60){var _0x4cbd5f;return db['sequelize']['transaction'](function(_0x2cae5d){return db[_0xd481('0x54')][_0xd481('0x32')](_0x1d6cf8['body'],{'where':{'id':_0x1d6cf8[_0xd481('0x59')]['id']},'transaction':_0x2cae5d})[_0xd481('0x34')](function(_0x360a76){return db[_0xd481('0x95')]['destroy']({'where':{'FaxAccountId':_0x1d6cf8[_0xd481('0x59')]['id']},'transaction':_0x2cae5d})[_0xd481('0x34')](function(_0x30b6d6){return db[_0xd481('0x95')][_0xd481('0x96')](createExtensionsReciveFax(_[_0xd481('0x6f')](_0x1d6cf8[_0xd481('0x59')],[_0xd481('0x97'),_0xd481('0x3f'),_0xd481('0x98'),_0xd481('0x99'),_0xd481('0x9a'),_0xd481('0x9b')])),{'transaction':_0x2cae5d});});});})[_0xd481('0x34')](function(){return db[_0xd481('0x54')][_0xd481('0x9c')](_0x1d6cf8[_0xd481('0x59')]['id']);})[_0xd481('0x34')](respondWithResult(_0x17dc40,null))[_0xd481('0x25')](handleError(_0x17dc40,null));};exports['getMessages']=function(_0x5f4061,_0x31a4dd,_0x36e856){var _0x4411c4={'raw':!![],'where':{}};var _0x5a81fe={};var _0x1bbd8b={'count':0x0,'rows':[]};return db[_0xd481('0x54')]['findOne']({'where':{'id':_0x5f4061[_0xd481('0x56')]['id']}})['then'](handleEntityNotFound(_0x31a4dd,null))[_0xd481('0x34')](function(_0x2279a4){if(_0x2279a4){_0x5a81fe[_0xd481('0x40')]=_['keys'](db[_0xd481('0x9d')][_0xd481('0x3d')]);_0x5a81fe['query']=_['keys'](_0x5f4061[_0xd481('0x42')]);_0x5a81fe[_0xd481('0x4d')]=_[_0xd481('0x44')](_0x5a81fe[_0xd481('0x40')],_0x5a81fe[_0xd481('0x42')]);_0x4411c4[_0xd481('0x45')]=_[_0xd481('0x44')](_0x5a81fe[_0xd481('0x40')],qs[_0xd481('0x46')](_0x5f4061[_0xd481('0x42')]['fields']));_0x4411c4[_0xd481('0x45')]=_0x4411c4[_0xd481('0x45')]['length']?_0x4411c4['attributes']:_0x5a81fe['model'];if(!_0x5f4061[_0xd481('0x42')][_0xd481('0x48')](_0xd481('0x49'))){_0x4411c4[_0xd481('0x2b')]=qs[_0xd481('0x2b')](_0x5f4061[_0xd481('0x42')][_0xd481('0x2b')]);_0x4411c4[_0xd481('0x29')]=qs[_0xd481('0x29')](_0x5f4061[_0xd481('0x42')][_0xd481('0x29')]);}_0x4411c4[_0xd481('0x4a')]=qs[_0xd481('0x4b')](_0x5f4061[_0xd481('0x42')]['sort']);_0x4411c4[_0xd481('0x4c')]=qs[_0xd481('0x4d')](_[_0xd481('0x4e')](_0x5f4061['query'],_0x5a81fe['filters']));_0x4411c4[_0xd481('0x4c')]['FaxAccountId']=_0x2279a4['id'];if(_0x5f4061[_0xd481('0x42')]['filter']){_0x4411c4[_0xd481('0x4c')]=_[_0xd481('0x4f')](_0x4411c4['where'],{'$or':_['map'](_0x4411c4[_0xd481('0x45')],function(_0x4e60de){var _0x2f2c1f={};_0x2f2c1f[_0x4e60de]={'$like':'%'+_0x5f4061[_0xd481('0x42')][_0xd481('0x51')]+'%'};return _0x2f2c1f;})});}if(_0x5f4061[_0xd481('0x42')][_0xd481('0x9e')]){var _0x4af3c5=_0x5f4061['query'][_0xd481('0x9e')]['split'](',');var _0x370dad={};_0x370dad[_0x4af3c5[0x0]]={'$gte':moment(_0x4af3c5[0x1])[_0xd481('0x9f')](_0xd481('0xa0'))};_0x4411c4[_0xd481('0x4c')]=_['merge'](_0x4411c4[_0xd481('0x4c')],_0x370dad);}_0x4411c4=_[_0xd481('0x4f')]({},_0x4411c4,_0x5f4061[_0xd481('0x52')]);return db[_0xd481('0x9d')][_0xd481('0x2c')]({'where':_0x4411c4[_0xd481('0x4c')]})['then'](function(_0x348ce2){_0x1bbd8b['count']=_0x348ce2;if(_0x5f4061['query']['includeAll']){_0x4411c4[_0xd481('0x66')]=[{'all':!![]}];}return db[_0xd481('0x9d')][_0xd481('0x55')](_0x4411c4);})['then'](function(_0x4e234e){_0x1bbd8b[_0xd481('0x67')]=_0x4e234e;return _0x1bbd8b;});}})['then'](respondWithFilteredResult(_0x31a4dd,_0x4411c4))['catch'](handleError(_0x31a4dd,null));};exports[_0xd481('0x39')]=function(_0x1837f5,_0x18f519,_0x195809){var _0x54e163,_0x59ad41={},_0x8c6de1;if(_0x1837f5['body']['to']){_0x8c6de1=_0x1837f5[_0xd481('0x59')]['to'][0x0];}return db[_0xd481('0x54')]['find']({'where':{'id':_0x1837f5[_0xd481('0x56')]['id']},'include':[{'model':db[_0xd481('0xa1')],'as':_0xd481('0xa2'),'include':[{'model':db['CmContact'],'as':_0xd481('0xa3'),'where':{'fax':_0x8c6de1},'limit':0x1,'order':[[_0xd481('0x99'),_0xd481('0xa4')]]}]}]})[_0xd481('0x34')](handleEntityNotFound(_0x18f519,null))[_0xd481('0x34')](function(_0x9f0492){_0x54e163=_0x9f0492;if(_0x1837f5[_0xd481('0x59')]['attachments']&&_0x1837f5['body']['attachments']['length']){for(var _0x35103e=0x0;_0x35103e<_0x1837f5[_0xd481('0x59')]['attachments'][_0xd481('0x47')];_0x35103e+=0x1){_0x1837f5[_0xd481('0x59')][_0xd481('0xa5')][_0x35103e]={'filename':_0x1837f5[_0xd481('0x59')]['attachments'][_0x35103e][_0xd481('0x38')],'id':_0x1837f5[_0xd481('0x59')][_0xd481('0xa5')][_0x35103e]['id'],'path':path[_0xd481('0xa6')](config[_0xd481('0xa7')],_0xd481('0xa8'),_0x1837f5[_0xd481('0x59')][_0xd481('0xa5')][_0x35103e][_0xd481('0xa9')])};}}return respondWithRpcPromise(_0xd481('0xaa'),_0xd481('0xaa'),{'FaxAccountId':_['isNil'](_0x1837f5['params']['id'])?undefined:_0x1837f5[_0xd481('0x56')]['id'],'path':_[_0xd481('0xab')](_0x1837f5[_0xd481('0x59')]['attachments'][0x0]['path'])?undefined:_0x1837f5[_0xd481('0x59')][_0xd481('0xa5')][0x0]['path'],'fax':_[_0xd481('0xab')](_0x1837f5['body']['to'][0x0])?undefined:_0x1837f5[_0xd481('0x59')]['to'][0x0]},client9002);})['then'](function(){if(_0x54e163){if(_['isNil'](_0x1837f5[_0xd481('0x59')][_0xd481('0xac')])){_0x1837f5[_0xd481('0x59')][_0xd481('0xac')]=util[_0xd481('0x9f')](_0xd481('0xad'),_0x54e163['name'],_0x54e163[_0xd481('0xae')]);}if(_0x54e163[_0xd481('0xa2')]){if(_0x54e163[_0xd481('0xa2')]['Contacts'][_0xd481('0x47')]){return _0x54e163[_0xd481('0xa2')][_0xd481('0xa3')][0x0];}else{return db['CmContact'][_0xd481('0x58')](_[_0xd481('0xaf')](_0x1837f5[_0xd481('0x59')],{'firstName':_0x1837f5[_0xd481('0x59')]['to'][0x0],'phone':_0x1837f5[_0xd481('0x59')]['to'][0x0],'fax':_0x1837f5[_0xd481('0x59')]['to'][0x0],'ListId':_0x54e163['ListId']}));}}else{throw new Error(_0xd481('0xb0'));}}else{throw new Error(_0xd481('0xb1'));}})[_0xd481('0x34')](function(_0x12bc95){if(_0x12bc95){return db[_0xd481('0x6e')][_0xd481('0x57')]({'where':{'ContactId':_0x12bc95['id'],'closed':![],'FaxAccountId':_0x54e163['id']}})[_0xd481('0x34')](function(_0xbe478e){if(_0xbe478e){return[_0xbe478e,![]];}return db['FaxInteraction'][_0xd481('0x58')]({'UserId':_0x1837f5[_0xd481('0x5a')]['id'],'ContactId':_0x12bc95['id'],'FaxAccountId':_0x54e163['id'],'fax':_0x1837f5[_0xd481('0x59')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0xd481('0x4f')](_0x1837f5[_0xd481('0x59')],{'read':![],'body':_0x1837f5[_0xd481('0x59')][_0xd481('0xa5')][0x0][_0xd481('0xb2')],'FaxAccountId':_0x54e163['id'],'UserId':_0x1837f5[_0xd481('0x5a')]['id'],'ContactId':_0x12bc95['id'],'AttachmentId':_0x1837f5[_0xd481('0x59')]['attachments'][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0xd481('0xb3')}]})[_0xd481('0x34')](function(_0x16a4b6){return[_0x16a4b6,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x6b8288,_0x457226){if(_0x457226){return _0x6b8288;}return db[_0xd481('0x9d')][_0xd481('0x58')]({'direction':_0xd481('0xb4'),'read':![],'body':_0x1837f5[_0xd481('0x59')][_0xd481('0xa5')][0x0]['filename'],'FaxAccountId':_0x54e163['id'],'FaxInteractionId':_0x6b8288['id'],'UserId':_0x1837f5['user']['id'],'ContactId':_0x6b8288[_0xd481('0xb5')],'AttachmentId':_0x1837f5[_0xd481('0x59')][_0xd481('0xa5')][0x0]['id']})[_0xd481('0x34')](function(_0x52dd92){_0x6b8288[_0xd481('0xb6')][_0xd481('0xb3')]=[];_0x6b8288['dataValues'][_0xd481('0xb3')][_0xd481('0x86')](_0x52dd92[_0xd481('0xb6')]);return _0x6b8288;});})[_0xd481('0x34')](function(_0x23f951){respondWithRpcPromise('SendFax',_0xd481('0xb7'),{'FaxAccountId':_[_0xd481('0xab')](_0x1837f5[_0xd481('0x56')]['id'])?undefined:_0x1837f5['params']['id'],'path':_[_0xd481('0xab')](_0x1837f5['body'][_0xd481('0xa5')][0x0]['path'])?undefined:_0x1837f5['body'][_0xd481('0xa5')][0x0][_0xd481('0xb8')],'fax':_[_0xd481('0xab')](_0x1837f5['body']['to'][0x0])?undefined:_0x1837f5[_0xd481('0x59')]['to'][0x0],'AttachmentId':_0x1837f5[_0xd481('0x59')][_0xd481('0xa5')][0x0]['id']},client9002)[_0xd481('0x34')](function(_0x253955){logger[_0xd481('0xb9')](_0xd481('0xba'),_0x253955);})['catch'](function(_0x1a2af3){logger[_0xd481('0xb9')](_0xd481('0xba'),_0x1a2af3);});return _0x23f951;})[_0xd481('0x34')](respondWithResult(_0x18f519,null))[_0xd481('0x25')](handleError(_0x18f519,null));};exports[_0xd481('0xbb')]=function(_0x1ae57a,_0x2843d2,_0x2a5544){return db[_0xd481('0x54')][_0xd481('0x57')]({'where':{'id':_0x1ae57a[_0xd481('0x56')]['id']}})['then'](handleEntityNotFound(_0x2843d2,null))[_0xd481('0x34')](function(_0x2a5e2c){if(_0x2a5e2c){return _0x2a5e2c[_0xd481('0xbb')](_0x1ae57a[_0xd481('0x59')][_0xd481('0x6c')],_[_0xd481('0x6f')](_0x1ae57a[_0xd481('0x59')],[_0xd481('0x6c'),'id'])||{})[_0xd481('0xbc')](function(_0x5a4a38){for(var _0x53b231=0x0;_0x53b231<_0x1ae57a[_0xd481('0x59')]['ids'][_0xd481('0x47')];_0x53b231+=0x1){socket[_0xd481('0xbd')](_0xd481('0xbe'),{'UserId':Number(_0x1ae57a[_0xd481('0x59')]['ids'][_0x53b231]),'FaxAccountId':Number(_0x1ae57a[_0xd481('0x56')]['id'])});}return _0x5a4a38;});}})[_0xd481('0x34')](respondWithResult(_0x2843d2,null))[_0xd481('0x25')](handleError(_0x2843d2,null));};exports['removeAgents']=function(_0x113701,_0x352c12,_0x234fa7){return db['FaxAccount']['find']({'where':{'id':_0x113701[_0xd481('0x56')]['id']}})[_0xd481('0x34')](handleEntityNotFound(_0x352c12,null))[_0xd481('0x34')](function(_0x4c1744){if(_0x4c1744){return _0x4c1744['removeAgents'](_0x113701['query'][_0xd481('0x6c')])[_0xd481('0x34')](function(){if(_[_0xd481('0xbf')](_0x113701[_0xd481('0x42')][_0xd481('0x6c')])){for(var _0x547f74=0x0;_0x547f74<_0x113701[_0xd481('0x42')]['ids'][_0xd481('0x47')];_0x547f74+=0x1){socket[_0xd481('0xbd')](_0xd481('0xc0'),{'UserId':Number(_0x113701[_0xd481('0x42')][_0xd481('0x6c')][_0x547f74]),'FaxAccountId':Number(_0x113701['params']['id'])});}}else{socket[_0xd481('0xbd')](_0xd481('0xc0'),{'UserId':Number(_0x113701[_0xd481('0x42')][_0xd481('0x6c')]),'FaxAccountId':Number(_0x113701[_0xd481('0x56')]['id'])});}});}})['then'](respondWithStatusCode(_0x352c12,null))['catch'](handleError(_0x352c12,null));};exports[_0xd481('0xc1')]=function(_0xa935d3,_0x42ae5d,_0x2bb370){var _0x5d3eac={};var _0x3b15f8={};var _0x5e83ec;var _0x4b9a8f;return db['FaxAccount'][_0xd481('0x63')]({'where':{'id':_0xa935d3['params']['id']}})[_0xd481('0x34')](handleEntityNotFound(_0x42ae5d,null))[_0xd481('0x34')](function(_0x43936c){if(_0x43936c){_0x5e83ec=_0x43936c;_0x3b15f8['model']=_[_0xd481('0x43')](db[_0xd481('0x70')][_0xd481('0x3d')]);_0x3b15f8['query']=_['keys'](_0xa935d3[_0xd481('0x42')]);_0x3b15f8[_0xd481('0x4d')]=_[_0xd481('0x44')](_0x3b15f8[_0xd481('0x40')],_0x3b15f8[_0xd481('0x42')]);_0x5d3eac[_0xd481('0x45')]=_['intersection'](_0x3b15f8[_0xd481('0x40')],qs['fields'](_0xa935d3[_0xd481('0x42')][_0xd481('0x46')]));_0x5d3eac['attributes']=_0x5d3eac[_0xd481('0x45')][_0xd481('0x47')]?_0x5d3eac['attributes']:_0x3b15f8[_0xd481('0x40')];_0x5d3eac[_0xd481('0x4a')]=qs['sort'](_0xa935d3[_0xd481('0x42')][_0xd481('0x4b')]);_0x5d3eac[_0xd481('0x4c')]=qs['filters'](_[_0xd481('0x4e')](_0xa935d3[_0xd481('0x42')],_0x3b15f8[_0xd481('0x4d')]));if(_0xa935d3[_0xd481('0x42')][_0xd481('0x51')]){_0x5d3eac[_0xd481('0x4c')]=_[_0xd481('0x4f')](_0x5d3eac[_0xd481('0x4c')],{'$or':_[_0xd481('0x41')](_0x5d3eac['attributes'],function(_0x2b677d){var _0x2a6e1e={};_0x2a6e1e[_0x2b677d]={'$like':'%'+_0xa935d3[_0xd481('0x42')]['filter']+'%'};return _0x2a6e1e;})});}_0x5d3eac=_['merge']({},_0x5d3eac,_0xa935d3['options']);return _0x5e83ec[_0xd481('0xc1')](_0x5d3eac);}})[_0xd481('0x34')](function(_0x578d28){if(_0x578d28){_0x4b9a8f=_0x578d28[_0xd481('0x47')];if(!_0xa935d3[_0xd481('0x42')][_0xd481('0x48')]('nolimit')){_0x5d3eac[_0xd481('0x2b')]=qs[_0xd481('0x2b')](_0xa935d3['query'][_0xd481('0x2b')]);_0x5d3eac['offset']=qs[_0xd481('0x29')](_0xa935d3[_0xd481('0x42')][_0xd481('0x29')]);}return _0x5e83ec[_0xd481('0xc1')](_0x5d3eac);}})[_0xd481('0x34')](function(_0x211a76){if(_0x211a76){return _0x211a76?{'count':_0x4b9a8f,'rows':_0x211a76}:null;}})[_0xd481('0x34')](respondWithResult(_0x42ae5d,null))[_0xd481('0x25')](handleError(_0x42ae5d,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 30e0774..ecb6d46 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 _0xc00b=['save','remove','emit','hasOwnProperty','exports','events'];(function(_0x541f85,_0x147c53){var _0x2fcdbb=function(_0xf0fe60){while(--_0xf0fe60){_0x541f85['push'](_0x541f85['shift']());}};_0x2fcdbb(++_0x147c53);}(_0xc00b,0x1e5));var _0xbc00=function(_0x57fc2a,_0x14bbe5){_0x57fc2a=_0x57fc2a-0x0;var _0xa839b=_0xc00b[_0x57fc2a];return _0xa839b;};'use strict';var EventEmitter=require(_0xbc00('0x0'));var FaxAccount=require('../../mysqldb')['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbc00('0x1'),'afterUpdate':'update','afterDestroy':_0xbc00('0x2')};function emitEvent(_0x35af46){return function(_0x38080a,_0x161d6a,_0x5db11b){FaxAccountEvents[_0xbc00('0x3')](_0x35af46+':'+_0x38080a['id'],_0x38080a);FaxAccountEvents['emit'](_0x35af46,_0x38080a);_0x5db11b(null);};}for(var e in events){if(events[_0xbc00('0x4')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0xbc00('0x5')]=FaxAccountEvents; \ No newline at end of file +var _0x74cc=['FaxAccount','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x232509,_0x5092a4){var _0x37182a=function(_0x390b40){while(--_0x390b40){_0x232509['push'](_0x232509['shift']());}};_0x37182a(++_0x5092a4);}(_0x74cc,0x184));var _0xc74c=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x74cc[_0x4243a3];return _0x1b2a33;};'use strict';var EventEmitter=require(_0xc74c('0x0'));var FaxAccount=require(_0xc74c('0x1'))['db'][_0xc74c('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xc74c('0x3')](0x0);var events={'afterCreate':_0xc74c('0x4'),'afterUpdate':'update','afterDestroy':_0xc74c('0x5')};function emitEvent(_0x7a1712){return function(_0x4466c4,_0x5e5947,_0x14cc0e){FaxAccountEvents['emit'](_0x7a1712+':'+_0x4466c4['id'],_0x4466c4);FaxAccountEvents[_0xc74c('0x6')](_0x7a1712,_0x4466c4);_0x14cc0e(null);};}for(var e in events){if(events[_0xc74c('0x7')](e)){var event=events[e];FaxAccount[_0xc74c('0x8')](e,emitEvent(event));}}module[_0xc74c('0x9')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 2dbeed5..2f457c0 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 _0xe2b0=['util','path','rimraf','./faxAccount.attributes','exports','FaxAccount','fax_accounts','lodash'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xe2b0,0x1cf));var _0x0e2b=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xe2b0[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x0e2b('0x0'));var util=require(_0x0e2b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0e2b('0x2'));var rimraf=require(_0x0e2b('0x3'));var config=require('../../config/environment');var attributes=require(_0x0e2b('0x4'));module[_0x0e2b('0x5')]=function(_0x1ba905,_0x550903){return _0x1ba905['define'](_0x0e2b('0x6'),attributes,{'tableName':_0x0e2b('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4d67=['lodash','util','api','bluebird','request-promise','rimraf','../../config/environment','./faxAccount.attributes','exports','FaxAccount','fax_accounts'];(function(_0x5cbd7b,_0x207439){var _0x3fdfb8=function(_0x4eb12e){while(--_0x4eb12e){_0x5cbd7b['push'](_0x5cbd7b['shift']());}};_0x3fdfb8(++_0x207439);}(_0x4d67,0x6e));var _0x74d6=function(_0x3fa3a4,_0x98660c){_0x3fa3a4=_0x3fa3a4-0x0;var _0xe891ce=_0x4d67[_0x3fa3a4];return _0xe891ce;};'use strict';var _=require(_0x74d6('0x0'));var util=require(_0x74d6('0x1'));var logger=require('../../config/logger')(_0x74d6('0x2'));var moment=require('moment');var BPromise=require(_0x74d6('0x3'));var rp=require(_0x74d6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x74d6('0x5'));var config=require(_0x74d6('0x6'));var attributes=require(_0x74d6('0x7'));module[_0x74d6('0x8')]=function(_0xd027a,_0x1f0325){return _0xd027a['define'](_0x74d6('0x9'),attributes,{'tableName':_0x74d6('0xa'),'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 36fc31a..6a0e5fd 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 _0x13b3=['FaxAccount','find','account','CmList','CmContact','Contacts','DESC','FaxApplication','List','get','applications','Applications','list','orderBy','priority','length','FaxInteraction','create','Contact\x20not\x20found','autoclose','push','close','unmanaged','created','FaxMessage','ContactId','AttachmentId','interaction','UserId','User','name','unshift','agent','*,*,*,*','Start','startRouting','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./faxAccount.socket','register','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetFaxAccount','options','raw','attributes','limit','include','model','map','then','NotifyFaxAccount','body','fax','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','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from'];(function(_0x476672,_0x139b0c){var _0x3d8e74=function(_0x30da35){while(--_0x30da35){_0x476672['push'](_0x476672['shift']());}};_0x3d8e74(++_0x139b0c);}(_0x13b3,0x195));var _0x313b=function(_0x518392,_0x25ac70){_0x518392=_0x518392-0x0;var _0x344e59=_0x13b3[_0x518392];return _0x344e59;};'use strict';var _=require(_0x313b('0x0'));var util=require(_0x313b('0x1'));var moment=require(_0x313b('0x2'));var BPromise=require(_0x313b('0x3'));var rs=require(_0x313b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x313b('0x5'))['db'];var utils=require(_0x313b('0x6'));var logger=require(_0x313b('0x7'))(_0x313b('0x8'));var config=require(_0x313b('0x9'));var jayson=require(_0x313b('0xa'));var client=jayson[_0x313b('0xb')]['http']({'port':0x232c});config[_0x313b('0xc')]=_[_0x313b('0xd')](config[_0x313b('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x313b('0xe'))(new Redis(config['redis']));require(_0x313b('0xf'))[_0x313b('0x10')](socket);function respondWithRpcPromise(_0x486ab0,_0x4bedc5,_0x1a9d04){return new BPromise(function(_0x3a4fdf,_0xf3919a){return client[_0x313b('0x11')](_0x486ab0,_0x1a9d04)['then'](function(_0x17fada){logger[_0x313b('0x12')](_0x313b('0x13'),_0x4bedc5,_0x313b('0x14'));logger[_0x313b('0x15')](_0x313b('0x16'),_0x4bedc5,_0x313b('0x14'),JSON[_0x313b('0x17')](_0x17fada));if(_0x17fada[_0x313b('0x18')]){if(_0x17fada['error'][_0x313b('0x19')]===0x1f4){logger[_0x313b('0x18')](_0x313b('0x13'),_0x4bedc5,_0x17fada[_0x313b('0x18')][_0x313b('0x1a')]);return _0xf3919a(_0x17fada['error'][_0x313b('0x1a')]);}logger['error'](_0x313b('0x13'),_0x4bedc5,_0x17fada['error'][_0x313b('0x1a')]);return _0x3a4fdf(_0x17fada[_0x313b('0x18')][_0x313b('0x1a')]);}else{logger[_0x313b('0x12')](_0x313b('0x13'),_0x4bedc5,_0x313b('0x14'));_0x3a4fdf(_0x17fada[_0x313b('0x1b')][_0x313b('0x1a')]);}})['catch'](function(_0xd41790){logger['error']('FaxAccount,\x20%s,\x20%s',_0x4bedc5,_0xd41790);_0xf3919a(_0xd41790);});});}exports[_0x313b('0x1c')]=function(_0x10a4a6){var _0x1fe798=this;return new Promise(function(_0x59f76b,_0x3a7317){return db['FaxAccount']['findAll']({'raw':_0x10a4a6[_0x313b('0x1d')]?_0x10a4a6[_0x313b('0x1d')][_0x313b('0x1e')]===undefined?!![]:![]:!![],'where':_0x10a4a6[_0x313b('0x1d')]?_0x10a4a6[_0x313b('0x1d')]['where']||null:null,'attributes':_0x10a4a6['options']?_0x10a4a6[_0x313b('0x1d')][_0x313b('0x1f')]||null:null,'limit':_0x10a4a6[_0x313b('0x1d')]?_0x10a4a6[_0x313b('0x1d')][_0x313b('0x20')]||null:null,'include':_0x10a4a6['options']?_0x10a4a6[_0x313b('0x1d')][_0x313b('0x21')]?_['map'](_0x10a4a6[_0x313b('0x1d')][_0x313b('0x21')],function(_0x2ae31d){return{'model':db[_0x2ae31d[_0x313b('0x22')]],'as':_0x2ae31d['as'],'attributes':_0x2ae31d['attributes'],'include':_0x2ae31d[_0x313b('0x21')]?_[_0x313b('0x23')](_0x2ae31d[_0x313b('0x21')],function(_0x235882){return{'model':db[_0x235882[_0x313b('0x22')]],'as':_0x235882['as'],'attributes':_0x235882[_0x313b('0x1f')],'include':_0x235882[_0x313b('0x21')]?_[_0x313b('0x23')](_0x235882[_0x313b('0x21')],function(_0x317215){return{'model':db[_0x317215['model']],'as':_0x317215['as'],'attributes':_0x317215[_0x313b('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x313b('0x24')](function(_0x2c0640){logger['info']('GetFaxAccount',_0x10a4a6);logger[_0x313b('0x15')](_0x313b('0x1c'),_0x10a4a6,JSON[_0x313b('0x17')](_0x2c0640));_0x59f76b(_0x2c0640);})['catch'](function(_0x1540e5){logger[_0x313b('0x18')](_0x313b('0x1c'),_0x1540e5['message'],_0x10a4a6);_0x3a7317(_0x1fe798[_0x313b('0x18')](0x1f4,_0x1540e5['message']));});});};exports[_0x313b('0x25')]=function(_0x44696d,_0x7c96e9,_0x3f64a9){var _0x3b0aa3=this;return new Promise(function(_0x2918ec,_0x1acc73){var _0x2de159={'body':_0x44696d[_0x313b('0x26')],'channel':_0x313b('0x27')};var _0x4fb89e=[];var _0x18447d=[];var _0x2f916c={};return db['CmContact'][_0x313b('0x28')]()[_0x313b('0x24')](function(_0x480af8){if(!_0x480af8){throw new db[(_0x313b('0x29'))][(_0x313b('0x2a'))]('no\x20available\x20attributes');}_0x4fb89e=_[_0x313b('0x2b')](_[_0x313b('0x2c')](_0x480af8),[_0x313b('0x2d'),_0x313b('0x2e')]);_0x18447d=_[_0x313b('0x2b')](_[_0x313b('0x2c')](_0x480af8),[_0x313b('0x2d'),_0x313b('0x2e'),_0x313b('0x2f'),_0x313b('0x30')]);if(_0x44696d[_0x313b('0x26')]['id']){delete _0x44696d[_0x313b('0x26')]['id'];}if(_['isNil'](_0x44696d[_0x313b('0x26')]['from'])){throw new db[(_0x313b('0x29'))][(_0x313b('0x2a'))]('from\x20is\x20mandatory');}if(_[_0x313b('0x31')](_0x44696d['body'][_0x313b('0x26')])||_0x44696d['body'][_0x313b('0x26')]===''){throw new db[(_0x313b('0x29'))][(_0x313b('0x2a'))](_0x313b('0x32'));}if(_['isNil'](_0x44696d[_0x313b('0x26')][_0x313b('0x33')])){throw new db[(_0x313b('0x29'))][(_0x313b('0x2a'))](_0x313b('0x34')+_0x18447d);}if(!_['includes'](_0x18447d,_0x44696d[_0x313b('0x26')][_0x313b('0x33')])){throw new db[(_0x313b('0x29'))]['ValidationError'](_0x313b('0x35')+_0x18447d);}_0x2f916c[_0x44696d[_0x313b('0x26')][_0x313b('0x33')]]=_0x44696d['body'][_0x313b('0x36')];})[_0x313b('0x24')](function(){return db[_0x313b('0x37')][_0x313b('0x38')]({'where':{'id':_0x44696d[_0x313b('0x39')]['id']},'include':[{'model':db[_0x313b('0x3a')],'as':'List','include':[{'model':db[_0x313b('0x3b')],'as':_0x313b('0x3c'),'where':_0x2f916c,'limit':0x1,'order':[[_0x313b('0x2e'),_0x313b('0x3d')]]}]},{'model':db[_0x313b('0x3e')],'as':'Applications'}]});})['then'](function(_0x16eec2){if(_0x16eec2&&_0x16eec2[_0x313b('0x3f')]){var _0xf528fc=_0x16eec2[_0x313b('0x40')]({'plain':!![]});_0x2de159[_0x313b('0x39')]=_0xf528fc;_0x2de159[_0x313b('0x41')]=_0xf528fc[_0x313b('0x42')];_0x2de159[_0x313b('0x43')]=_0xf528fc[_0x313b('0x3f')];_0x2de159[_0x313b('0x41')]=_[_0x313b('0x44')](_0x2de159[_0x313b('0x41')],[_0x313b('0x45')],['asc']);if(_0x2de159['account'][_0x313b('0x42')]){delete _0x2de159[_0x313b('0x39')][_0x313b('0x42')];}if(_0x2de159['account'][_0x313b('0x3f')]&&_0x2de159['account'][_0x313b('0x3f')]['Contacts'][_0x313b('0x46')]){return _0x2de159[_0x313b('0x39')][_0x313b('0x3f')]['Contacts'][0x0];}var _0x4d05f1=_[_0x313b('0xd')](_0x44696d[_0x313b('0x26')],{'firstName':_0x44696d[_0x313b('0x26')][_0x313b('0x36')],'ListId':_0xf528fc[_0x313b('0x30')]});_0x4d05f1[_0x44696d[_0x313b('0x26')]['mapKey']]=_0x44696d[_0x313b('0x26')][_0x313b('0x36')];return db['CmContact']['create'](_0x4d05f1,{'fields':_0x4fb89e,'raw':!![]});}})[_0x313b('0x24')](function(_0x3eb180){_0x2de159['contact']=_0x3eb180;if(_0x3eb180){var _0x46d2b1={'ContactId':_0x3eb180['id'],'FaxAccountId':_0x44696d[_0x313b('0x39')]['id'],'fax':_0x3eb180[_0x313b('0x27')]};return db[_0x313b('0x47')][_0x313b('0x38')]({'where':{'ContactId':_0x3eb180['id'],'closed':![],'FaxAccountId':_0x44696d[_0x313b('0x39')]['id']}})['then'](function(_0x5fd2ab){if(_0x5fd2ab){return[_0x5fd2ab,![]];}return db[_0x313b('0x47')][_0x313b('0x48')](_0x46d2b1)[_0x313b('0x24')](function(_0x2ded48){return[_0x2ded48,!![]];});});}else{throw new Error(_0x313b('0x49'));}})['spread'](function(_0x22fb18,_0x327a07){var _0x3c08ac=_0x22fb18[_0x313b('0x40')]({'plain':!![]});if(_0x327a07){if(_0x2de159[_0x313b('0x39')][_0x313b('0x4a')]){_0x2de159['applications'][_0x313b('0x4b')]({'id':0x0,'priority':_0x2de159[_0x313b('0x41')]['length']+0x1,'app':_0x313b('0x4c'),'appdata':_0x313b('0x4d'),'interval':'*,*,*,*'});}_0x3c08ac[_0x313b('0x4e')]=!![];}else{_0x3c08ac['created']=![];}_0x2de159['interaction']=_0x3c08ac;return db[_0x313b('0x4f')][_0x313b('0x48')]({'body':_0x44696d[_0x313b('0x26')][_0x313b('0x26')],'FaxAccountId':_0x44696d[_0x313b('0x39')]['id'],'FaxInteractionId':_0x22fb18['id'],'direction':'in','ContactId':_0x22fb18[_0x313b('0x50')],'AttachmentId':_0x44696d['body'][_0x313b('0x51')]});})['then'](function(_0x32628e){_0x2de159['message']=_0x32628e;if(_0x2de159[_0x313b('0x52')][_0x313b('0x53')]){return db[_0x313b('0x54')]['find']({'attributes':['id',_0x313b('0x55')],'where':{'id':_0x2de159[_0x313b('0x52')][_0x313b('0x53')]}})[_0x313b('0x24')](function(_0x5bb1ed){if(_0x5bb1ed){_0x2de159[_0x313b('0x41')][_0x313b('0x56')]({'id':0x0,'priority':0x0,'app':_0x313b('0x57'),'appdata':_0x5bb1ed[_0x313b('0x55')]+','+(_0x2de159[_0x313b('0x39')]['waitForTheAssignedAgent']||0xa),'interval':_0x313b('0x58')});}return respondWithRpcPromise(_0x313b('0x59'),'startRouting',_0x2de159);});}return respondWithRpcPromise('Start',_0x313b('0x5a'),_0x2de159);})[_0x313b('0x24')](function(_0x3a60bd){_0x2918ec(_0x3a60bd);})[_0x313b('0x5b')](function(_0x372be3){_0x1acc73(_0x3b0aa3[_0x313b('0x18')](0x1f4,_0x372be3['message']));});});}; \ No newline at end of file +var _0x45e7=['FaxMessage','ContactId','UserId','name','unshift','agent','startRouting','Start','util','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','options','raw','attributes','limit','include','map','model','GetFaxAccount','NotifyFaxAccount','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','keys','CompanyId','ListId','body','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','FaxAccount','account','List','Contacts','DESC','FaxApplication','get','applications','Applications','list','orderBy','priority','length','create','contact','FaxInteraction','find','Contact\x20not\x20found','spread','push','unmanaged','*,*,*,*','created','interaction'];(function(_0x102147,_0x170d81){var _0x5e2d52=function(_0x134422){while(--_0x134422){_0x102147['push'](_0x102147['shift']());}};_0x5e2d52(++_0x170d81);}(_0x45e7,0x107));var _0x745e=function(_0x9b14ee,_0x574340){_0x9b14ee=_0x9b14ee-0x0;var _0xc3fa3c=_0x45e7[_0x9b14ee];return _0xc3fa3c;};'use strict';var _=require('lodash');var util=require(_0x745e('0x0'));var moment=require('moment');var BPromise=require(_0x745e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x745e('0x2'))['db'];var utils=require(_0x745e('0x3'));var logger=require('../../config/logger')(_0x745e('0x4'));var config=require(_0x745e('0x5'));var jayson=require(_0x745e('0x6'));var client=jayson['client'][_0x745e('0x7')]({'port':0x232c});config[_0x745e('0x8')]=_[_0x745e('0x9')](config[_0x745e('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x745e('0xa'))(new Redis(config[_0x745e('0x8')]));require(_0x745e('0xb'))[_0x745e('0xc')](socket);function respondWithRpcPromise(_0x1e580d,_0xf0fc2f,_0x38923e){return new BPromise(function(_0x36d3aa,_0x18d5d8){return client[_0x745e('0xd')](_0x1e580d,_0x38923e)[_0x745e('0xe')](function(_0x14a3a9){logger[_0x745e('0xf')](_0x745e('0x10'),_0xf0fc2f,_0x745e('0x11'));logger[_0x745e('0x12')](_0x745e('0x13'),_0xf0fc2f,_0x745e('0x11'),JSON[_0x745e('0x14')](_0x14a3a9));if(_0x14a3a9[_0x745e('0x15')]){if(_0x14a3a9['error']['code']===0x1f4){logger[_0x745e('0x15')](_0x745e('0x10'),_0xf0fc2f,_0x14a3a9[_0x745e('0x15')]['message']);return _0x18d5d8(_0x14a3a9[_0x745e('0x15')][_0x745e('0x16')]);}logger[_0x745e('0x15')](_0x745e('0x10'),_0xf0fc2f,_0x14a3a9[_0x745e('0x15')]['message']);return _0x36d3aa(_0x14a3a9[_0x745e('0x15')][_0x745e('0x16')]);}else{logger[_0x745e('0xf')](_0x745e('0x10'),_0xf0fc2f,_0x745e('0x11'));_0x36d3aa(_0x14a3a9[_0x745e('0x17')][_0x745e('0x16')]);}})[_0x745e('0x18')](function(_0x41c6a9){logger[_0x745e('0x15')](_0x745e('0x10'),_0xf0fc2f,_0x41c6a9);_0x18d5d8(_0x41c6a9);});});}exports['GetFaxAccount']=function(_0x13e710){var _0x12f2d6=this;return new Promise(function(_0x4e5fa8,_0x579ee6){return db['FaxAccount']['findAll']({'raw':_0x13e710[_0x745e('0x19')]?_0x13e710[_0x745e('0x19')][_0x745e('0x1a')]===undefined?!![]:![]:!![],'where':_0x13e710[_0x745e('0x19')]?_0x13e710[_0x745e('0x19')]['where']||null:null,'attributes':_0x13e710[_0x745e('0x19')]?_0x13e710[_0x745e('0x19')][_0x745e('0x1b')]||null:null,'limit':_0x13e710['options']?_0x13e710['options'][_0x745e('0x1c')]||null:null,'include':_0x13e710[_0x745e('0x19')]?_0x13e710[_0x745e('0x19')][_0x745e('0x1d')]?_[_0x745e('0x1e')](_0x13e710[_0x745e('0x19')][_0x745e('0x1d')],function(_0x1863ea){return{'model':db[_0x1863ea[_0x745e('0x1f')]],'as':_0x1863ea['as'],'attributes':_0x1863ea[_0x745e('0x1b')],'include':_0x1863ea['include']?_[_0x745e('0x1e')](_0x1863ea[_0x745e('0x1d')],function(_0x16ecc9){return{'model':db[_0x16ecc9[_0x745e('0x1f')]],'as':_0x16ecc9['as'],'attributes':_0x16ecc9[_0x745e('0x1b')],'include':_0x16ecc9[_0x745e('0x1d')]?_[_0x745e('0x1e')](_0x16ecc9[_0x745e('0x1d')],function(_0x63918a){return{'model':db[_0x63918a[_0x745e('0x1f')]],'as':_0x63918a['as'],'attributes':_0x63918a[_0x745e('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x745e('0xe')](function(_0x30bdc0){logger['info']('GetFaxAccount',_0x13e710);logger[_0x745e('0x12')](_0x745e('0x20'),_0x13e710,JSON['stringify'](_0x30bdc0));_0x4e5fa8(_0x30bdc0);})[_0x745e('0x18')](function(_0x43b665){logger[_0x745e('0x15')](_0x745e('0x20'),_0x43b665['message'],_0x13e710);_0x579ee6(_0x12f2d6[_0x745e('0x15')](0x1f4,_0x43b665['message']));});});};exports[_0x745e('0x21')]=function(_0xe1be44,_0x239da3,_0x493c4){var _0x286e69=this;return new Promise(function(_0x570659,_0x24acc1){var _0x299531={'body':_0xe1be44['body'],'channel':_0x745e('0x22')};var _0x86c77c=[];var _0x43ce68=[];var _0x236ac8={};return db[_0x745e('0x23')][_0x745e('0x24')]()[_0x745e('0xe')](function(_0x1c8d46){if(!_0x1c8d46){throw new db[(_0x745e('0x25'))][(_0x745e('0x26'))](_0x745e('0x27'));}_0x86c77c=_[_0x745e('0x28')](_['keys'](_0x1c8d46),['createdAt',_0x745e('0x29')]);_0x43ce68=_[_0x745e('0x28')](_[_0x745e('0x2a')](_0x1c8d46),['createdAt','updatedAt',_0x745e('0x2b'),_0x745e('0x2c')]);if(_0xe1be44[_0x745e('0x2d')]['id']){delete _0xe1be44[_0x745e('0x2d')]['id'];}if(_[_0x745e('0x2e')](_0xe1be44['body'][_0x745e('0x2f')])){throw new db[(_0x745e('0x25'))]['ValidationError'](_0x745e('0x30'));}if(_[_0x745e('0x2e')](_0xe1be44[_0x745e('0x2d')][_0x745e('0x2d')])||_0xe1be44['body']['body']===''){throw new db['Sequelize'][(_0x745e('0x26'))](_0x745e('0x31'));}if(_[_0x745e('0x2e')](_0xe1be44[_0x745e('0x2d')][_0x745e('0x32')])){throw new db[(_0x745e('0x25'))][(_0x745e('0x26'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x43ce68);}if(!_[_0x745e('0x33')](_0x43ce68,_0xe1be44[_0x745e('0x2d')]['mapKey'])){throw new db[(_0x745e('0x25'))][(_0x745e('0x26'))](_0x745e('0x34')+_0x43ce68);}_0x236ac8[_0xe1be44[_0x745e('0x2d')][_0x745e('0x32')]]=_0xe1be44[_0x745e('0x2d')][_0x745e('0x2f')];})[_0x745e('0xe')](function(){return db[_0x745e('0x35')]['find']({'where':{'id':_0xe1be44[_0x745e('0x36')]['id']},'include':[{'model':db['CmList'],'as':_0x745e('0x37'),'include':[{'model':db['CmContact'],'as':_0x745e('0x38'),'where':_0x236ac8,'limit':0x1,'order':[[_0x745e('0x29'),_0x745e('0x39')]]}]},{'model':db[_0x745e('0x3a')],'as':'Applications'}]});})['then'](function(_0x3df6d0){if(_0x3df6d0&&_0x3df6d0[_0x745e('0x37')]){var _0x2e51ea=_0x3df6d0[_0x745e('0x3b')]({'plain':!![]});_0x299531[_0x745e('0x36')]=_0x2e51ea;_0x299531[_0x745e('0x3c')]=_0x2e51ea[_0x745e('0x3d')];_0x299531[_0x745e('0x3e')]=_0x2e51ea[_0x745e('0x37')];_0x299531[_0x745e('0x3c')]=_[_0x745e('0x3f')](_0x299531['applications'],[_0x745e('0x40')],['asc']);if(_0x299531[_0x745e('0x36')][_0x745e('0x3d')]){delete _0x299531[_0x745e('0x36')][_0x745e('0x3d')];}if(_0x299531[_0x745e('0x36')][_0x745e('0x37')]&&_0x299531[_0x745e('0x36')][_0x745e('0x37')][_0x745e('0x38')][_0x745e('0x41')]){return _0x299531[_0x745e('0x36')][_0x745e('0x37')][_0x745e('0x38')][0x0];}var _0x1c9a96=_['defaults'](_0xe1be44[_0x745e('0x2d')],{'firstName':_0xe1be44['body'][_0x745e('0x2f')],'ListId':_0x2e51ea[_0x745e('0x2c')]});_0x1c9a96[_0xe1be44[_0x745e('0x2d')][_0x745e('0x32')]]=_0xe1be44['body'][_0x745e('0x2f')];return db[_0x745e('0x23')][_0x745e('0x42')](_0x1c9a96,{'fields':_0x86c77c,'raw':!![]});}})[_0x745e('0xe')](function(_0x227c42){_0x299531[_0x745e('0x43')]=_0x227c42;if(_0x227c42){var _0x1c9a00={'ContactId':_0x227c42['id'],'FaxAccountId':_0xe1be44[_0x745e('0x36')]['id'],'fax':_0x227c42[_0x745e('0x22')]};return db[_0x745e('0x44')][_0x745e('0x45')]({'where':{'ContactId':_0x227c42['id'],'closed':![],'FaxAccountId':_0xe1be44[_0x745e('0x36')]['id']}})[_0x745e('0xe')](function(_0x21da3c){if(_0x21da3c){return[_0x21da3c,![]];}return db[_0x745e('0x44')]['create'](_0x1c9a00)[_0x745e('0xe')](function(_0x352ede){return[_0x352ede,!![]];});});}else{throw new Error(_0x745e('0x46'));}})[_0x745e('0x47')](function(_0x4ca0d2,_0x10eff3){var _0x1238d4=_0x4ca0d2[_0x745e('0x3b')]({'plain':!![]});if(_0x10eff3){if(_0x299531['account']['autoclose']){_0x299531[_0x745e('0x3c')][_0x745e('0x48')]({'id':0x0,'priority':_0x299531[_0x745e('0x3c')][_0x745e('0x41')]+0x1,'app':'close','appdata':_0x745e('0x49'),'interval':_0x745e('0x4a')});}_0x1238d4[_0x745e('0x4b')]=!![];}else{_0x1238d4[_0x745e('0x4b')]=![];}_0x299531[_0x745e('0x4c')]=_0x1238d4;return db[_0x745e('0x4d')][_0x745e('0x42')]({'body':_0xe1be44['body'][_0x745e('0x2d')],'FaxAccountId':_0xe1be44[_0x745e('0x36')]['id'],'FaxInteractionId':_0x4ca0d2['id'],'direction':'in','ContactId':_0x4ca0d2[_0x745e('0x4e')],'AttachmentId':_0xe1be44[_0x745e('0x2d')]['AttachmentId']});})[_0x745e('0xe')](function(_0x3d5369){_0x299531['message']=_0x3d5369;if(_0x299531[_0x745e('0x4c')][_0x745e('0x4f')]){return db['User']['find']({'attributes':['id',_0x745e('0x50')],'where':{'id':_0x299531['interaction'][_0x745e('0x4f')]}})[_0x745e('0xe')](function(_0x31c26c){if(_0x31c26c){_0x299531[_0x745e('0x3c')][_0x745e('0x51')]({'id':0x0,'priority':0x0,'app':_0x745e('0x52'),'appdata':_0x31c26c[_0x745e('0x50')]+','+(_0x299531[_0x745e('0x36')]['waitForTheAssignedAgent']||0xa),'interval':_0x745e('0x4a')});}return respondWithRpcPromise('Start',_0x745e('0x53'),_0x299531);});}return respondWithRpcPromise(_0x745e('0x54'),'startRouting',_0x299531);})[_0x745e('0xe')](function(_0x51c203){_0x570659(_0x51c203);})[_0x745e('0x18')](function(_0x2a6d36){_0x24acc1(_0x286e69[_0x745e('0x15')](0x1f4,_0x2a6d36['message']));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index e2b3a0c..f213541 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 _0x3cdc=['register','length','faxAccount:','./faxAccount.events','save','update','emit','removeListener'];(function(_0x12b5cb,_0x3d2b8e){var _0x1ad91f=function(_0x3aaa31){while(--_0x3aaa31){_0x12b5cb['push'](_0x12b5cb['shift']());}};_0x1ad91f(++_0x3d2b8e);}(_0x3cdc,0x19b));var _0xc3cd=function(_0x352fc5,_0xc25f36){_0x352fc5=_0x352fc5-0x0;var _0x47095f=_0x3cdc[_0x352fc5];return _0x47095f;};'use strict';var FaxAccountEvents=require(_0xc3cd('0x0'));var events=[_0xc3cd('0x1'),'remove',_0xc3cd('0x2')];function createListener(_0x28d0bf,_0x4b6cae){return function(_0x98dac9){_0x4b6cae[_0xc3cd('0x3')](_0x28d0bf,_0x98dac9);};}function removeListener(_0x319ed7,_0x562546){return function(){FaxAccountEvents[_0xc3cd('0x4')](_0x319ed7,_0x562546);};}exports[_0xc3cd('0x5')]=function(_0xa57d96){for(var _0x28b6cc=0x0,_0x10fa2b=events[_0xc3cd('0x6')];_0x28b6cc<_0x10fa2b;_0x28b6cc++){var _0x44a158=events[_0x28b6cc];var _0x39507b=createListener(_0xc3cd('0x7')+_0x44a158,_0xa57d96);FaxAccountEvents['on'](_0x44a158,_0x39507b);}}; \ No newline at end of file +var _0x750c=['length','faxAccount:','./faxAccount.events','save','remove','update','emit','register'];(function(_0x946779,_0x31cd75){var _0x40292f=function(_0x246706){while(--_0x246706){_0x946779['push'](_0x946779['shift']());}};_0x40292f(++_0x31cd75);}(_0x750c,0xf2));var _0xc750=function(_0x49cd23,_0x52d80c){_0x49cd23=_0x49cd23-0x0;var _0x514d98=_0x750c[_0x49cd23];return _0x514d98;};'use strict';var FaxAccountEvents=require(_0xc750('0x0'));var events=[_0xc750('0x1'),_0xc750('0x2'),_0xc750('0x3')];function createListener(_0x1fed41,_0x4c3895){return function(_0x46df56){_0x4c3895[_0xc750('0x4')](_0x1fed41,_0x46df56);};}function removeListener(_0x2775b8,_0xa7d540){return function(){FaxAccountEvents['removeListener'](_0x2775b8,_0xa7d540);};}exports[_0xc750('0x5')]=function(_0xc321e2){for(var _0x5818b8=0x0,_0x41a29e=events[_0xc750('0x6')];_0x5818b8<_0x41a29e;_0x5818b8++){var _0x5e7a8d=events[_0x5818b8];var _0x3ddc47=createListener(_0xc750('0x7')+_0x5e7a8d,_0xc321e2);FaxAccountEvents['on'](_0x5e7a8d,_0x3ddc47);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index c20c1b1..6a2ba91 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 _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x5e2a26,_0x52d4bc){var _0x3760a3=function(_0x49bbbf){while(--_0x49bbbf){_0x5e2a26['push'](_0x5e2a26['shift']());}};_0x3760a3(++_0x52d4bc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'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/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x54813d,_0x101c1f){var _0x561eea=function(_0x1faa0a){while(--_0x1faa0a){_0x54813d['push'](_0x54813d['shift']());}};_0x561eea(++_0x101c1f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'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/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index c629175..3bf8723 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 _0xaefe=['*,*,*,*','sequelize','exports','STRING','TEXT'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xaefe,0x155));var _0xeaef=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0xaefe[_0x5a3cf0];return _0x5a64ee;};'use strict';var Sequelize=require(_0xeaef('0x0'));module[_0xeaef('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xeaef('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xeaef('0x3')]()},'description':{'type':Sequelize[_0xeaef('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xeaef('0x4')}}; \ No newline at end of file +var _0xabf1=['TEXT','exports','STRING','noop'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0xabf1,0xed));var _0x1abf=function(_0x2cc5ae,_0x4f1bc1){_0x2cc5ae=_0x2cc5ae-0x0;var _0xdffed7=_0xabf1[_0x2cc5ae];return _0xdffed7;};'use strict';var Sequelize=require('sequelize');module[_0x1abf('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x1abf('0x1')],'allowNull':![],'defaultValue':_0x1abf('0x2')},'appdata':{'type':Sequelize[_0x1abf('0x3')]()},'description':{'type':Sequelize[_0x1abf('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 0485bb1..ae2a485 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 _0x6006=['to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','FaxApplication','fieldName','key','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','params','rawAttributes','include','find','create','body','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce'];(function(_0x246079,_0x42ae5e){var _0x194f8f=function(_0x55582e){while(--_0x55582e){_0x246079['push'](_0x246079['shift']());}};_0x194f8f(++_0x42ae5e);}(_0x6006,0x165));var _0x6600=function(_0x162285,_0x564931){_0x162285=_0x162285-0x0;var _0x4f14ce=_0x6006[_0x162285];return _0x4f14ce;};'use strict';var emlformat=require(_0x6600('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6600('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6600('0x2'));var moment=require(_0x6600('0x3'));var BPromise=require(_0x6600('0x4'));var Mustache=require(_0x6600('0x5'));var util=require(_0x6600('0x6'));var path=require(_0x6600('0x7'));var sox=require(_0x6600('0x8'));var csv=require('to-csv');var ejs=require(_0x6600('0x9'));var fs=require('fs');var fs_extra=require(_0x6600('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6600('0xb'));var jsforce=require(_0x6600('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6600('0xd'));var querystring=require(_0x6600('0xe'));var Papa=require(_0x6600('0xf'));var Redis=require(_0x6600('0x10'));var authService=require(_0x6600('0x11'));var qs=require(_0x6600('0x12'));var as=require(_0x6600('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6600('0x14'))(_0x6600('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6600('0x16'))['db'];function respondWithStatusCode(_0x413d33,_0x1edec3){_0x1edec3=_0x1edec3||0xcc;return function(_0x2cb926){if(_0x2cb926){return _0x413d33[_0x6600('0x17')](_0x1edec3);}return _0x413d33[_0x6600('0x18')](_0x1edec3)[_0x6600('0x19')]();};}function respondWithResult(_0x3d3255,_0x39ac7d){_0x39ac7d=_0x39ac7d||0xc8;return function(_0x251e1c){if(_0x251e1c){return _0x3d3255[_0x6600('0x18')](_0x39ac7d)[_0x6600('0x1a')](_0x251e1c);}};}function respondWithFilteredResult(_0x50ce8c,_0x782f16){return function(_0x382000){if(_0x382000){var _0x3b95a3=typeof _0x782f16[_0x6600('0x1b')]===_0x6600('0x1c')&&typeof _0x782f16[_0x6600('0x1d')]===_0x6600('0x1c');var _0x5d00d3=_0x382000[_0x6600('0x1e')];var _0x110605=_0x3b95a3?0x0:_0x782f16[_0x6600('0x1b')];var _0x3a460c=_0x3b95a3?_0x382000[_0x6600('0x1e')]:_0x782f16[_0x6600('0x1b')]+_0x782f16['limit'];var _0x37145a;if(_0x3a460c>=_0x5d00d3){_0x3a460c=_0x5d00d3;_0x37145a=0xc8;}else{_0x37145a=0xce;}_0x50ce8c[_0x6600('0x18')](_0x37145a);return _0x50ce8c[_0x6600('0x1f')](_0x6600('0x20'),_0x110605+'-'+_0x3a460c+'/'+_0x5d00d3)[_0x6600('0x1a')](_0x382000);}return null;};}function patchUpdates(_0x23b518){return function(_0x2554a6){try{jsonpatch[_0x6600('0x21')](_0x2554a6,_0x23b518,!![]);}catch(_0x1614a0){return BPromise[_0x6600('0x22')](_0x1614a0);}return _0x2554a6[_0x6600('0x23')]();};}function saveUpdates(_0xdc19df,_0xe03c29){return function(_0x3a6d22){if(_0x3a6d22){return _0x3a6d22[_0x6600('0x24')](_0xdc19df)[_0x6600('0x25')](function(_0x5e0827){return _0x5e0827;});}return null;};}function removeEntity(_0x500b68,_0x1ddc1b){return function(_0x302b01){if(_0x302b01){return _0x302b01[_0x6600('0x26')]()['then'](function(){_0x500b68[_0x6600('0x18')](0xcc)[_0x6600('0x19')]();});}};}function handleEntityNotFound(_0x5c9a30,_0x33665e){return function(_0x32dcb6){if(!_0x32dcb6){_0x5c9a30[_0x6600('0x17')](0x194);}return _0x32dcb6;};}function handleError(_0x566674,_0x8f1697){_0x8f1697=_0x8f1697||0x1f4;return function(_0x492092){logger[_0x6600('0x27')](_0x492092[_0x6600('0x28')]);if(_0x492092[_0x6600('0x29')]){delete _0x492092['name'];}_0x566674[_0x6600('0x18')](_0x8f1697)[_0x6600('0x2a')](_0x492092);};}exports['index']=function(_0x18051a,_0x5bbb08){var _0x30dcdc={},_0x131dd0={},_0x224484={'count':0x0,'rows':[]};var _0x21c546=_['map'](db[_0x6600('0x2b')]['rawAttributes'],function(_0x2cdb07){return{'name':_0x2cdb07[_0x6600('0x2c')],'type':_0x2cdb07['type'][_0x6600('0x2d')]};});_0x131dd0['model']=_[_0x6600('0x2e')](_0x21c546,_0x6600('0x29'));_0x131dd0[_0x6600('0x2f')]=_[_0x6600('0x30')](_0x18051a[_0x6600('0x2f')]);_0x131dd0[_0x6600('0x31')]=_[_0x6600('0x32')](_0x131dd0['model'],_0x131dd0[_0x6600('0x2f')]);_0x30dcdc[_0x6600('0x33')]=_['intersection'](_0x131dd0[_0x6600('0x34')],qs[_0x6600('0x35')](_0x18051a[_0x6600('0x2f')][_0x6600('0x35')]));_0x30dcdc[_0x6600('0x33')]=_0x30dcdc[_0x6600('0x33')][_0x6600('0x36')]?_0x30dcdc['attributes']:_0x131dd0[_0x6600('0x34')];if(!_0x18051a[_0x6600('0x2f')][_0x6600('0x37')](_0x6600('0x38'))){_0x30dcdc[_0x6600('0x1d')]=qs[_0x6600('0x1d')](_0x18051a[_0x6600('0x2f')][_0x6600('0x1d')]);_0x30dcdc[_0x6600('0x1b')]=qs[_0x6600('0x1b')](_0x18051a['query']['offset']);}_0x30dcdc['order']=qs['sort'](_0x18051a[_0x6600('0x2f')][_0x6600('0x39')]);_0x30dcdc[_0x6600('0x3a')]=qs['filters'](_[_0x6600('0x3b')](_0x18051a[_0x6600('0x2f')],_0x131dd0[_0x6600('0x31')]),_0x21c546);if(_0x18051a[_0x6600('0x2f')]['filter']){_0x30dcdc[_0x6600('0x3a')]=_[_0x6600('0x3c')](_0x30dcdc[_0x6600('0x3a')],{'$or':_['map'](_0x21c546,function(_0x55688b){if(_0x55688b[_0x6600('0x3d')]!==_0x6600('0x3e')){var _0x18ec1c={};_0x18ec1c[_0x55688b[_0x6600('0x29')]]={'$like':'%'+_0x18051a['query']['filter']+'%'};return _0x18ec1c;}})});}_0x30dcdc=_[_0x6600('0x3c')]({},_0x30dcdc,_0x18051a[_0x6600('0x3f')]);var _0x313f36={'where':_0x30dcdc[_0x6600('0x3a')]};return db[_0x6600('0x2b')]['count'](_0x313f36)[_0x6600('0x25')](function(_0x4977bd){_0x224484[_0x6600('0x1e')]=_0x4977bd;if(_0x18051a[_0x6600('0x2f')][_0x6600('0x40')]){_0x30dcdc['include']=[{'all':!![]}];}return db[_0x6600('0x2b')][_0x6600('0x41')](_0x30dcdc);})[_0x6600('0x25')](function(_0x31ccd3){_0x224484[_0x6600('0x42')]=_0x31ccd3;return _0x224484;})[_0x6600('0x25')](respondWithFilteredResult(_0x5bbb08,_0x30dcdc))[_0x6600('0x43')](handleError(_0x5bbb08,null));};exports['show']=function(_0x1216ac,_0x32f962){var _0x2db752={'raw':!![],'where':{'id':_0x1216ac[_0x6600('0x44')]['id']}},_0x476816={};_0x476816[_0x6600('0x34')]=_[_0x6600('0x30')](db[_0x6600('0x2b')][_0x6600('0x45')]);_0x476816['query']=_[_0x6600('0x30')](_0x1216ac[_0x6600('0x2f')]);_0x476816['filters']=_[_0x6600('0x32')](_0x476816[_0x6600('0x34')],_0x476816['query']);_0x2db752['attributes']=_[_0x6600('0x32')](_0x476816[_0x6600('0x34')],qs[_0x6600('0x35')](_0x1216ac[_0x6600('0x2f')][_0x6600('0x35')]));_0x2db752['attributes']=_0x2db752[_0x6600('0x33')]['length']?_0x2db752[_0x6600('0x33')]:_0x476816[_0x6600('0x34')];if(_0x1216ac[_0x6600('0x2f')][_0x6600('0x40')]){_0x2db752[_0x6600('0x46')]=[{'all':!![]}];}_0x2db752=_[_0x6600('0x3c')]({},_0x2db752,_0x1216ac[_0x6600('0x3f')]);return db[_0x6600('0x2b')][_0x6600('0x47')](_0x2db752)['then'](handleEntityNotFound(_0x32f962,null))[_0x6600('0x25')](respondWithResult(_0x32f962,null))[_0x6600('0x43')](handleError(_0x32f962,null));};exports[_0x6600('0x48')]=function(_0x4544ec,_0x581544){return db[_0x6600('0x2b')][_0x6600('0x48')](_0x4544ec[_0x6600('0x49')],{})[_0x6600('0x25')](respondWithResult(_0x581544,0xc9))['catch'](handleError(_0x581544,null));};exports[_0x6600('0x24')]=function(_0x5281c2,_0x2d95d2){if(_0x5281c2[_0x6600('0x49')]['id']){delete _0x5281c2[_0x6600('0x49')]['id'];}return db[_0x6600('0x2b')][_0x6600('0x47')]({'where':{'id':_0x5281c2['params']['id']}})[_0x6600('0x25')](handleEntityNotFound(_0x2d95d2,null))['then'](saveUpdates(_0x5281c2[_0x6600('0x49')],null))[_0x6600('0x25')](respondWithResult(_0x2d95d2,null))[_0x6600('0x43')](handleError(_0x2d95d2,null));};exports['destroy']=function(_0xe4acee,_0x55d37f){return db['FaxApplication']['find']({'where':{'id':_0xe4acee[_0x6600('0x44')]['id']}})[_0x6600('0x25')](handleEntityNotFound(_0x55d37f,null))[_0x6600('0x25')](removeEntity(_0x55d37f,null))[_0x6600('0x43')](handleError(_0x55d37f,null));}; \ No newline at end of file +var _0xb1dc=['show','params','keys','fields','includeAll','options','find','catch','create','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','then','destroy','error','name','send','index','map','FaxApplication','rawAttributes','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','include','rows'];(function(_0x3264a0,_0x4fc007){var _0x26e667=function(_0x4ee716){while(--_0x4ee716){_0x3264a0['push'](_0x3264a0['shift']());}};_0x26e667(++_0x4fc007);}(_0xb1dc,0x13f));var _0xcb1d=function(_0x4067ac,_0x363603){_0x4067ac=_0x4067ac-0x0;var _0x53d74d=_0xb1dc[_0x4067ac];return _0x53d74d;};'use strict';var emlformat=require(_0xcb1d('0x0'));var rimraf=require(_0xcb1d('0x1'));var zipdir=require(_0xcb1d('0x2'));var jsonpatch=require(_0xcb1d('0x3'));var rp=require(_0xcb1d('0x4'));var moment=require(_0xcb1d('0x5'));var BPromise=require(_0xcb1d('0x6'));var Mustache=require(_0xcb1d('0x7'));var util=require('util');var path=require(_0xcb1d('0x8'));var sox=require(_0xcb1d('0x9'));var csv=require('to-csv');var ejs=require(_0xcb1d('0xa'));var fs=require('fs');var fs_extra=require(_0xcb1d('0xb'));var _=require(_0xcb1d('0xc'));var squel=require(_0xcb1d('0xd'));var crypto=require(_0xcb1d('0xe'));var jsforce=require(_0xcb1d('0xf'));var deskjs=require(_0xcb1d('0x10'));var toCsv=require(_0xcb1d('0x11'));var querystring=require(_0xcb1d('0x12'));var Papa=require(_0xcb1d('0x13'));var Redis=require(_0xcb1d('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xcb1d('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcb1d('0x16'));var logger=require(_0xcb1d('0x17'))(_0xcb1d('0x18'));var utils=require(_0xcb1d('0x19'));var config=require(_0xcb1d('0x1a'));var licenseUtil=require(_0xcb1d('0x1b'));var db=require(_0xcb1d('0x1c'))['db'];function respondWithStatusCode(_0x4c1669,_0x4c6927){_0x4c6927=_0x4c6927||0xcc;return function(_0x25de02){if(_0x25de02){return _0x4c1669[_0xcb1d('0x1d')](_0x4c6927);}return _0x4c1669['status'](_0x4c6927)[_0xcb1d('0x1e')]();};}function respondWithResult(_0x4389a5,_0x3afeca){_0x3afeca=_0x3afeca||0xc8;return function(_0x28e5dc){if(_0x28e5dc){return _0x4389a5[_0xcb1d('0x1f')](_0x3afeca)[_0xcb1d('0x20')](_0x28e5dc);}};}function respondWithFilteredResult(_0x3e4e2b,_0x1a6d4a){return function(_0x3b5868){if(_0x3b5868){var _0x387bdb=typeof _0x1a6d4a[_0xcb1d('0x21')]===_0xcb1d('0x22')&&typeof _0x1a6d4a[_0xcb1d('0x23')]===_0xcb1d('0x22');var _0x5091c8=_0x3b5868[_0xcb1d('0x24')];var _0x5b6dcf=_0x387bdb?0x0:_0x1a6d4a['offset'];var _0x3dc32d=_0x387bdb?_0x3b5868[_0xcb1d('0x24')]:_0x1a6d4a['offset']+_0x1a6d4a[_0xcb1d('0x23')];var _0x3351b3;if(_0x3dc32d>=_0x5091c8){_0x3dc32d=_0x5091c8;_0x3351b3=0xc8;}else{_0x3351b3=0xce;}_0x3e4e2b[_0xcb1d('0x1f')](_0x3351b3);return _0x3e4e2b[_0xcb1d('0x25')]('Content-Range',_0x5b6dcf+'-'+_0x3dc32d+'/'+_0x5091c8)[_0xcb1d('0x20')](_0x3b5868);}return null;};}function patchUpdates(_0x24ffb1){return function(_0x1f4f17){try{jsonpatch[_0xcb1d('0x26')](_0x1f4f17,_0x24ffb1,!![]);}catch(_0x206a34){return BPromise[_0xcb1d('0x27')](_0x206a34);}return _0x1f4f17['save']();};}function saveUpdates(_0x56ff19,_0x239af6){return function(_0x3ec8f7){if(_0x3ec8f7){return _0x3ec8f7['update'](_0x56ff19)[_0xcb1d('0x28')](function(_0x31759a){return _0x31759a;});}return null;};}function removeEntity(_0x348f53,_0x67f19f){return function(_0x5fca69){if(_0x5fca69){return _0x5fca69[_0xcb1d('0x29')]()[_0xcb1d('0x28')](function(){_0x348f53[_0xcb1d('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a9a69,_0x44faf0){return function(_0x371b30){if(!_0x371b30){_0x4a9a69[_0xcb1d('0x1d')](0x194);}return _0x371b30;};}function handleError(_0x3abbd0,_0x330f52){_0x330f52=_0x330f52||0x1f4;return function(_0x203fc7){logger[_0xcb1d('0x2a')](_0x203fc7['stack']);if(_0x203fc7[_0xcb1d('0x2b')]){delete _0x203fc7['name'];}_0x3abbd0[_0xcb1d('0x1f')](_0x330f52)[_0xcb1d('0x2c')](_0x203fc7);};}exports[_0xcb1d('0x2d')]=function(_0x3990de,_0x785d92){var _0x3ad64a={},_0x552aae={},_0x15213f={'count':0x0,'rows':[]};var _0x3ee696=_[_0xcb1d('0x2e')](db[_0xcb1d('0x2f')][_0xcb1d('0x30')],function(_0x4daea9){return{'name':_0x4daea9['fieldName'],'type':_0x4daea9[_0xcb1d('0x31')][_0xcb1d('0x32')]};});_0x552aae[_0xcb1d('0x33')]=_[_0xcb1d('0x2e')](_0x3ee696,'name');_0x552aae[_0xcb1d('0x34')]=_['keys'](_0x3990de['query']);_0x552aae[_0xcb1d('0x35')]=_[_0xcb1d('0x36')](_0x552aae[_0xcb1d('0x33')],_0x552aae['query']);_0x3ad64a[_0xcb1d('0x37')]=_[_0xcb1d('0x36')](_0x552aae[_0xcb1d('0x33')],qs['fields'](_0x3990de['query']['fields']));_0x3ad64a[_0xcb1d('0x37')]=_0x3ad64a[_0xcb1d('0x37')][_0xcb1d('0x38')]?_0x3ad64a[_0xcb1d('0x37')]:_0x552aae[_0xcb1d('0x33')];if(!_0x3990de[_0xcb1d('0x34')][_0xcb1d('0x39')]('nolimit')){_0x3ad64a['limit']=qs[_0xcb1d('0x23')](_0x3990de[_0xcb1d('0x34')]['limit']);_0x3ad64a[_0xcb1d('0x21')]=qs[_0xcb1d('0x21')](_0x3990de[_0xcb1d('0x34')][_0xcb1d('0x21')]);}_0x3ad64a[_0xcb1d('0x3a')]=qs['sort'](_0x3990de['query'][_0xcb1d('0x3b')]);_0x3ad64a[_0xcb1d('0x3c')]=qs['filters'](_[_0xcb1d('0x3d')](_0x3990de['query'],_0x552aae[_0xcb1d('0x35')]),_0x3ee696);if(_0x3990de[_0xcb1d('0x34')][_0xcb1d('0x3e')]){_0x3ad64a[_0xcb1d('0x3c')]=_[_0xcb1d('0x3f')](_0x3ad64a[_0xcb1d('0x3c')],{'$or':_['map'](_0x3ee696,function(_0x17cf79){if(_0x17cf79['type']!=='VIRTUAL'){var _0xf7e03c={};_0xf7e03c[_0x17cf79[_0xcb1d('0x2b')]]={'$like':'%'+_0x3990de['query'][_0xcb1d('0x3e')]+'%'};return _0xf7e03c;}})});}_0x3ad64a=_['merge']({},_0x3ad64a,_0x3990de['options']);var _0x4632bd={'where':_0x3ad64a[_0xcb1d('0x3c')]};return db[_0xcb1d('0x2f')][_0xcb1d('0x24')](_0x4632bd)['then'](function(_0x542f5b){_0x15213f[_0xcb1d('0x24')]=_0x542f5b;if(_0x3990de[_0xcb1d('0x34')]['includeAll']){_0x3ad64a[_0xcb1d('0x40')]=[{'all':!![]}];}return db['FaxApplication']['findAll'](_0x3ad64a);})[_0xcb1d('0x28')](function(_0x93970b){_0x15213f[_0xcb1d('0x41')]=_0x93970b;return _0x15213f;})[_0xcb1d('0x28')](respondWithFilteredResult(_0x785d92,_0x3ad64a))['catch'](handleError(_0x785d92,null));};exports[_0xcb1d('0x42')]=function(_0xcde66,_0x32d515){var _0x2e7471={'raw':!![],'where':{'id':_0xcde66[_0xcb1d('0x43')]['id']}},_0x4d3e73={};_0x4d3e73['model']=_[_0xcb1d('0x44')](db['FaxApplication']['rawAttributes']);_0x4d3e73['query']=_[_0xcb1d('0x44')](_0xcde66[_0xcb1d('0x34')]);_0x4d3e73[_0xcb1d('0x35')]=_['intersection'](_0x4d3e73[_0xcb1d('0x33')],_0x4d3e73[_0xcb1d('0x34')]);_0x2e7471[_0xcb1d('0x37')]=_[_0xcb1d('0x36')](_0x4d3e73[_0xcb1d('0x33')],qs[_0xcb1d('0x45')](_0xcde66[_0xcb1d('0x34')][_0xcb1d('0x45')]));_0x2e7471[_0xcb1d('0x37')]=_0x2e7471[_0xcb1d('0x37')][_0xcb1d('0x38')]?_0x2e7471[_0xcb1d('0x37')]:_0x4d3e73['model'];if(_0xcde66[_0xcb1d('0x34')][_0xcb1d('0x46')]){_0x2e7471[_0xcb1d('0x40')]=[{'all':!![]}];}_0x2e7471=_['merge']({},_0x2e7471,_0xcde66[_0xcb1d('0x47')]);return db['FaxApplication'][_0xcb1d('0x48')](_0x2e7471)[_0xcb1d('0x28')](handleEntityNotFound(_0x32d515,null))[_0xcb1d('0x28')](respondWithResult(_0x32d515,null))[_0xcb1d('0x49')](handleError(_0x32d515,null));};exports[_0xcb1d('0x4a')]=function(_0x25f2ae,_0x4bd2f1){return db['FaxApplication'][_0xcb1d('0x4a')](_0x25f2ae['body'],{})[_0xcb1d('0x28')](respondWithResult(_0x4bd2f1,0xc9))[_0xcb1d('0x49')](handleError(_0x4bd2f1,null));};exports[_0xcb1d('0x4b')]=function(_0x15ad30,_0x10f561){if(_0x15ad30[_0xcb1d('0x4c')]['id']){delete _0x15ad30[_0xcb1d('0x4c')]['id'];}return db[_0xcb1d('0x2f')][_0xcb1d('0x48')]({'where':{'id':_0x15ad30[_0xcb1d('0x43')]['id']}})[_0xcb1d('0x28')](handleEntityNotFound(_0x10f561,null))['then'](saveUpdates(_0x15ad30[_0xcb1d('0x4c')],null))[_0xcb1d('0x28')](respondWithResult(_0x10f561,null))['catch'](handleError(_0x10f561,null));};exports['destroy']=function(_0xf19bd0,_0x10060e){return db[_0xcb1d('0x2f')]['find']({'where':{'id':_0xf19bd0['params']['id']}})[_0xcb1d('0x28')](handleEntityNotFound(_0x10060e,null))['then'](removeEntity(_0x10060e,null))[_0xcb1d('0x49')](handleError(_0x10060e,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 2df287c..61218be 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 _0xda8f=['moment','../../config/environment','./faxApplication.attributes','exports','FaxApplication','fax_applications','utf8mb4_unicode_ci','../../config/logger','api'];(function(_0x119e87,_0x37da3e){var _0xdce1c7=function(_0x49f83a){while(--_0x49f83a){_0x119e87['push'](_0x119e87['shift']());}};_0xdce1c7(++_0x37da3e);}(_0xda8f,0x139));var _0xfda8=function(_0x47025a,_0x556183){_0x47025a=_0x47025a-0x0;var _0x1e20f5=_0xda8f[_0x47025a];return _0x1e20f5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfda8('0x0'))(_0xfda8('0x1'));var moment=require(_0xfda8('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xfda8('0x3'));var attributes=require(_0xfda8('0x4'));module[_0xfda8('0x5')]=function(_0x5b8b3a,_0x53c649){return _0x5b8b3a['define'](_0xfda8('0x6'),attributes,{'tableName':_0xfda8('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xfda8('0x8')});}; \ No newline at end of file +var _0xfe27=['../../config/environment','./faxApplication.attributes','define','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5be74b,_0x5037c1){var _0x1da9b5=function(_0x434146){while(--_0x434146){_0x5be74b['push'](_0x5be74b['shift']());}};_0x1da9b5(++_0x5037c1);}(_0xfe27,0x148));var _0x7fe2=function(_0x15bad3,_0x1f9b15){_0x15bad3=_0x15bad3-0x0;var _0x53a2be=_0xfe27[_0x15bad3];return _0x53a2be;};'use strict';var _=require(_0x7fe2('0x0'));var util=require(_0x7fe2('0x1'));var logger=require('../../config/logger')(_0x7fe2('0x2'));var moment=require(_0x7fe2('0x3'));var BPromise=require(_0x7fe2('0x4'));var rp=require(_0x7fe2('0x5'));var fs=require('fs');var path=require(_0x7fe2('0x6'));var rimraf=require(_0x7fe2('0x7'));var config=require(_0x7fe2('0x8'));var attributes=require(_0x7fe2('0x9'));module['exports']=function(_0x2b18c9,_0x25a15b){return _0x2b18c9[_0x7fe2('0xa')]('FaxApplication',attributes,{'tableName':_0x7fe2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7fe2('0xc'),'collate':_0x7fe2('0xd')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 0cc1a26..d280d8d 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 _0xa888=['where','attributes','limit','UpdateFaxApplication','stringify','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','FaxApplication','update','body','options','raw'];(function(_0x4b73a2,_0x40b5fe){var _0x383c66=function(_0x3917ae){while(--_0x3917ae){_0x4b73a2['push'](_0x4b73a2['shift']());}};_0x383c66(++_0x40b5fe);}(_0xa888,0x89));var _0x8a88=function(_0x2d33c8,_0x286742){_0x2d33c8=_0x2d33c8-0x0;var _0x304571=_0xa888[_0x2d33c8];return _0x304571;};'use strict';var _=require('lodash');var util=require(_0x8a88('0x0'));var moment=require(_0x8a88('0x1'));var BPromise=require(_0x8a88('0x2'));var rs=require(_0x8a88('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8a88('0x4'))['db'];var utils=require(_0x8a88('0x5'));var logger=require(_0x8a88('0x6'))('rpc');var config=require(_0x8a88('0x7'));var jayson=require(_0x8a88('0x8'));var client=jayson[_0x8a88('0x9')][_0x8a88('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b6697,_0x4afc47,_0x3be2a1){return new BPromise(function(_0x26a3e0,_0x4a2906){return client[_0x8a88('0xb')](_0x4b6697,_0x3be2a1)[_0x8a88('0xc')](function(_0x1785df){logger['info'](_0x8a88('0xd'),_0x4afc47,_0x8a88('0xe'));logger[_0x8a88('0xf')](_0x8a88('0x10'),_0x4afc47,_0x8a88('0xe'),JSON['stringify'](_0x1785df));if(_0x1785df[_0x8a88('0x11')]){if(_0x1785df[_0x8a88('0x11')][_0x8a88('0x12')]===0x1f4){logger[_0x8a88('0x11')](_0x8a88('0xd'),_0x4afc47,_0x1785df['error'][_0x8a88('0x13')]);return _0x4a2906(_0x1785df[_0x8a88('0x11')][_0x8a88('0x13')]);}logger['error'](_0x8a88('0xd'),_0x4afc47,_0x1785df[_0x8a88('0x11')][_0x8a88('0x13')]);return _0x26a3e0(_0x1785df['error'][_0x8a88('0x13')]);}else{logger[_0x8a88('0x14')](_0x8a88('0xd'),_0x4afc47,_0x8a88('0xe'));_0x26a3e0(_0x1785df[_0x8a88('0x15')][_0x8a88('0x13')]);}})[_0x8a88('0x16')](function(_0x45388a){logger[_0x8a88('0x11')]('FaxApplication,\x20%s,\x20%s',_0x4afc47,_0x45388a);_0x4a2906(_0x45388a);});});}exports['UpdateFaxApplication']=function(_0x51f5a2){var _0x14985a=this;return new Promise(function(_0x3ab964,_0x4e092a){return db[_0x8a88('0x17')][_0x8a88('0x18')](_0x51f5a2[_0x8a88('0x19')],{'raw':_0x51f5a2[_0x8a88('0x1a')]?_0x51f5a2[_0x8a88('0x1a')][_0x8a88('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x51f5a2[_0x8a88('0x1a')]?_0x51f5a2[_0x8a88('0x1a')][_0x8a88('0x1c')]||null:null,'attributes':_0x51f5a2[_0x8a88('0x1a')]?_0x51f5a2['options'][_0x8a88('0x1d')]||null:null,'limit':_0x51f5a2[_0x8a88('0x1a')]?_0x51f5a2[_0x8a88('0x1a')][_0x8a88('0x1e')]||null:null})[_0x8a88('0xc')](function(_0x43b6f8){logger[_0x8a88('0x14')](_0x8a88('0x1f'),_0x51f5a2);logger['debug'](_0x8a88('0x1f'),_0x51f5a2,JSON[_0x8a88('0x20')](_0x43b6f8));_0x3ab964(_0x43b6f8);})[_0x8a88('0x16')](function(_0x913f90){logger[_0x8a88('0x11')]('UpdateFaxApplication',_0x913f90[_0x8a88('0x13')],_0x51f5a2);_0x4e092a(_0x14985a['error'](0x1f4,_0x913f90[_0x8a88('0x13')]));});});}; \ No newline at end of file +var _0xd06e=['stringify','error','code','message','UpdateFaxApplication','FaxApplication','update','body','options','raw','where','attributes','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','FaxApplication,\x20%s,\x20%s','debug','FaxApplication,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x1e2321,_0x3ae1c5){var _0x1d346d=function(_0x24f171){while(--_0x24f171){_0x1e2321['push'](_0x1e2321['shift']());}};_0x1d346d(++_0x3ae1c5);}(_0xd06e,0x16b));var _0xed06=function(_0x371ff8,_0x3bbc65){_0x371ff8=_0x371ff8-0x0;var _0xd6e0de=_0xd06e[_0x371ff8];return _0xd6e0de;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xed06('0x0'));var BPromise=require(_0xed06('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xed06('0x2'))['db'];var utils=require(_0xed06('0x3'));var logger=require(_0xed06('0x4'))(_0xed06('0x5'));var config=require(_0xed06('0x6'));var jayson=require(_0xed06('0x7'));var client=jayson[_0xed06('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x23ec5a,_0x11e248,_0xb33bca){return new BPromise(function(_0x48d478,_0x44cf44){return client['request'](_0x23ec5a,_0xb33bca)[_0xed06('0x9')](function(_0x5de770){logger[_0xed06('0xa')](_0xed06('0xb'),_0x11e248,'request\x20sent');logger[_0xed06('0xc')](_0xed06('0xd'),_0x11e248,_0xed06('0xe'),JSON[_0xed06('0xf')](_0x5de770));if(_0x5de770[_0xed06('0x10')]){if(_0x5de770[_0xed06('0x10')][_0xed06('0x11')]===0x1f4){logger[_0xed06('0x10')]('FaxApplication,\x20%s,\x20%s',_0x11e248,_0x5de770[_0xed06('0x10')][_0xed06('0x12')]);return _0x44cf44(_0x5de770['error'][_0xed06('0x12')]);}logger[_0xed06('0x10')](_0xed06('0xb'),_0x11e248,_0x5de770[_0xed06('0x10')]['message']);return _0x48d478(_0x5de770[_0xed06('0x10')][_0xed06('0x12')]);}else{logger[_0xed06('0xa')](_0xed06('0xb'),_0x11e248,'request\x20sent');_0x48d478(_0x5de770['result'][_0xed06('0x12')]);}})['catch'](function(_0x2653bc){logger[_0xed06('0x10')]('FaxApplication,\x20%s,\x20%s',_0x11e248,_0x2653bc);_0x44cf44(_0x2653bc);});});}exports[_0xed06('0x13')]=function(_0x2b7444){var _0x137c74=this;return new Promise(function(_0x194a36,_0x5175ee){return db[_0xed06('0x14')][_0xed06('0x15')](_0x2b7444[_0xed06('0x16')],{'raw':_0x2b7444[_0xed06('0x17')]?_0x2b7444[_0xed06('0x17')][_0xed06('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b7444[_0xed06('0x17')]?_0x2b7444[_0xed06('0x17')][_0xed06('0x19')]||null:null,'attributes':_0x2b7444[_0xed06('0x17')]?_0x2b7444[_0xed06('0x17')][_0xed06('0x1a')]||null:null,'limit':_0x2b7444['options']?_0x2b7444['options']['limit']||null:null})['then'](function(_0x1bf713){logger[_0xed06('0xa')]('UpdateFaxApplication',_0x2b7444);logger[_0xed06('0xc')]('UpdateFaxApplication',_0x2b7444,JSON['stringify'](_0x1bf713));_0x194a36(_0x1bf713);})['catch'](function(_0x1a4781){logger[_0xed06('0x10')](_0xed06('0x13'),_0x1a4781[_0xed06('0x12')],_0x2b7444);_0x5175ee(_0x137c74[_0xed06('0x10')](0x1f4,_0x1a4781['message']));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index a19c830..f751a37 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 _0x4213=['post','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./faxApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0x48276b,_0x94b188){var _0x507ef1=function(_0xbf3736){while(--_0xbf3736){_0x48276b['push'](_0x48276b['shift']());}};_0x507ef1(++_0x94b188);}(_0x4213,0x77));var _0x3421=function(_0x1ca931,_0x291699){_0x1ca931=_0x1ca931-0x0;var _0x177a49=_0x4213[_0x1ca931];return _0x177a49;};'use strict';var multer=require(_0x3421('0x0'));var util=require(_0x3421('0x1'));var path=require(_0x3421('0x2'));var timeout=require(_0x3421('0x3'));var express=require(_0x3421('0x4'));var router=express[_0x3421('0x5')]();var fs_extra=require(_0x3421('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3421('0x7'));var config=require('../../config/environment');var controller=require(_0x3421('0x8'));router[_0x3421('0x9')]('/',auth[_0x3421('0xa')](),controller[_0x3421('0xb')]);router['get'](_0x3421('0xc'),auth[_0x3421('0xa')](),controller[_0x3421('0xd')]);router[_0x3421('0xe')]('/',auth[_0x3421('0xa')](),controller['create']);router[_0x3421('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x3421('0x10')]);router['delete'](_0x3421('0xc'),auth[_0x3421('0xa')](),controller[_0x3421('0x11')]);module[_0x3421('0x12')]=router; \ No newline at end of file +var _0x4024=['express','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','update','destroy','exports','multer','util','connect-timeout'];(function(_0x375c91,_0x3d3ef5){var _0x2ca217=function(_0x2a24a8){while(--_0x2a24a8){_0x375c91['push'](_0x375c91['shift']());}};_0x2ca217(++_0x3d3ef5);}(_0x4024,0x89));var _0x4402=function(_0x56965a,_0x45b447){_0x56965a=_0x56965a-0x0;var _0x3df07c=_0x4024[_0x56965a];return _0x3df07c;};'use strict';var multer=require(_0x4402('0x0'));var util=require(_0x4402('0x1'));var path=require('path');var timeout=require(_0x4402('0x2'));var express=require(_0x4402('0x3'));var router=express['Router']();var fs_extra=require(_0x4402('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4402('0x5'));var config=require(_0x4402('0x6'));var controller=require('./faxApplication.controller');router['get']('/',auth[_0x4402('0x7')](),controller[_0x4402('0x8')]);router[_0x4402('0x9')]('/:id',auth[_0x4402('0x7')](),controller['show']);router['post']('/',auth[_0x4402('0x7')](),controller['create']);router['put'](_0x4402('0xa'),auth['isAuthenticated'](),controller[_0x4402('0xb')]);router['delete'](_0x4402('0xa'),auth['isAuthenticated'](),controller[_0x4402('0xc')]);module[_0x4402('0xd')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index f1ac07a..8a100f8 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 _0x2ac5=['exports','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x5cc8e2,_0x49a45e){var _0x1827ff=function(_0x2af7b3){while(--_0x2af7b3){_0x5cc8e2['push'](_0x5cc8e2['shift']());}};_0x1827ff(++_0x49a45e);}(_0x2ac5,0x7e));var _0x52ac=function(_0x5a5aca,_0x368fbb){_0x5a5aca=_0x5a5aca-0x0;var _0x1cb523=_0x2ac5[_0x5a5aca];return _0x1cb523;};'use strict';var Sequelize=require('sequelize');module[_0x52ac('0x0')]={'closed':{'type':Sequelize[_0x52ac('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x52ac('0x2')]},'disposition':{'type':Sequelize[_0x52ac('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x52ac('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x52ac('0x2')]},'fax':{'type':Sequelize[_0x52ac('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x52ac('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x52ac('0x4')]('in',_0x52ac('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x3919=['exports','DATE','STRING','out','ENUM'];(function(_0x16539a,_0x31409a){var _0x200796=function(_0xfe7803){while(--_0xfe7803){_0x16539a['push'](_0x16539a['shift']());}};_0x200796(++_0x31409a);}(_0x3919,0x1e5));var _0x9391=function(_0x2851e5,_0x34365e){_0x2851e5=_0x2851e5-0x0;var _0x13ff9d=_0x3919[_0x2851e5];return _0x13ff9d;};'use strict';var Sequelize=require('sequelize');module[_0x9391('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9391('0x1')]},'disposition':{'type':Sequelize[_0x9391('0x2')]},'secondDisposition':{'type':Sequelize[_0x9391('0x2')]},'thirdDisposition':{'type':Sequelize[_0x9391('0x2')]},'note':{'type':Sequelize[_0x9391('0x2')]},'read1stAt':{'type':Sequelize[_0x9391('0x1')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x9391('0x3')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x9391('0x4')]('in',_0x9391('0x3')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index eea3ab3..51c10c7 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 _0x7ed8=['i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','agent','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','FaxInteractionId','all','rows','show','params','FaxInteraction','includeAll','include','merge','options','create','describe','addMessage','FaxMessage','ids','omit','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','spread','findAll','emit','faxInteractionTags:save','removeTags','join','server','files','tmp','root','attachments','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','resolve','download','log','unlinkSync','eml-format','request-promise','moment','mustache','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','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','status','json','offset','limit','count','Content-Range','apply','reject','save','update','then','sendStatus','error','name','send','Users','fullname','TagIds','Tags','push','catch','waiting','talking','unmanaged','total','closed','UserId','answered','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','field','color','tools_tags','u.id','u.fullname','from','user_has_fax_interactions','u.id\x20=\x20ui.UserId','select','fax_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','having','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','text','start','end','Tag','forEach','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','body','some','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric'];(function(_0x43941d,_0x45fd0d){var _0x27b82a=function(_0x21851e){while(--_0x21851e){_0x43941d['push'](_0x43941d['shift']());}};_0x27b82a(++_0x45fd0d);}(_0x7ed8,0x13e));var _0x87ed=function(_0x15b731,_0x5385f8){_0x15b731=_0x15b731-0x0;var _0x3348e1=_0x7ed8[_0x15b731];return _0x3348e1;};'use strict';var emlformat=require(_0x87ed('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x87ed('0x1'));var moment=require(_0x87ed('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x87ed('0x3'));var util=require('util');var path=require('path');var sox=require(_0x87ed('0x4'));var csv=require(_0x87ed('0x5'));var ejs=require(_0x87ed('0x6'));var fs=require('fs');var fs_extra=require(_0x87ed('0x7'));var _=require(_0x87ed('0x8'));var squel=require(_0x87ed('0x9'));var crypto=require(_0x87ed('0xa'));var jsforce=require(_0x87ed('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x87ed('0xc'));var Papa=require('papaparse');var Redis=require(_0x87ed('0xd'));var authService=require(_0x87ed('0xe'));var qs=require(_0x87ed('0xf'));var as=require(_0x87ed('0x10'));var hardwareService=require(_0x87ed('0x11'));var logger=require(_0x87ed('0x12'))(_0x87ed('0x13'));var utils=require('../../config/utils');var config=require(_0x87ed('0x14'));var licenseUtil=require(_0x87ed('0x15'));var db=require(_0x87ed('0x16'))['db'];config[_0x87ed('0x17')]=_[_0x87ed('0x18')](config['redis'],{'host':_0x87ed('0x19'),'port':0x18eb});var socket=require(_0x87ed('0x1a'))(new Redis(config[_0x87ed('0x17')]));require(_0x87ed('0x1b'))[_0x87ed('0x1c')](socket);function respondWithStatusCode(_0x44bfda,_0x2198b3){_0x2198b3=_0x2198b3||0xcc;return function(_0x2a74aa){if(_0x2a74aa){return _0x44bfda['sendStatus'](_0x2198b3);}return _0x44bfda[_0x87ed('0x1d')](_0x2198b3)['end']();};}function respondWithResult(_0x47fb07,_0x58952f){_0x58952f=_0x58952f||0xc8;return function(_0x47483c){if(_0x47483c){return _0x47fb07[_0x87ed('0x1d')](_0x58952f)[_0x87ed('0x1e')](_0x47483c);}};}function respondWithFilteredResult(_0x449808,_0x33214d){return function(_0x1bb6c0){if(_0x1bb6c0){var _0x3935f1=typeof _0x33214d[_0x87ed('0x1f')]==='undefined'&&typeof _0x33214d[_0x87ed('0x20')]==='undefined';var _0x296f0d=_0x1bb6c0[_0x87ed('0x21')];var _0x1c6dd5=_0x3935f1?0x0:_0x33214d[_0x87ed('0x1f')];var _0x36f204=_0x3935f1?_0x1bb6c0['count']:_0x33214d[_0x87ed('0x1f')]+_0x33214d['limit'];var _0x4b40fc;if(_0x36f204>=_0x296f0d){_0x36f204=_0x296f0d;_0x4b40fc=0xc8;}else{_0x4b40fc=0xce;}_0x449808[_0x87ed('0x1d')](_0x4b40fc);return _0x449808['set'](_0x87ed('0x22'),_0x1c6dd5+'-'+_0x36f204+'/'+_0x296f0d)[_0x87ed('0x1e')](_0x1bb6c0);}return null;};}function patchUpdates(_0x2156bd){return function(_0x107fa7){try{jsonpatch[_0x87ed('0x23')](_0x107fa7,_0x2156bd,!![]);}catch(_0x1212d4){return BPromise[_0x87ed('0x24')](_0x1212d4);}return _0x107fa7[_0x87ed('0x25')]();};}function saveUpdates(_0x121a2d,_0x212fe7){return function(_0x3f58e1){if(_0x3f58e1){return _0x3f58e1[_0x87ed('0x26')](_0x121a2d)[_0x87ed('0x27')](function(_0x459bd8){return _0x459bd8;});}return null;};}function removeEntity(_0x5ca78d,_0x17af2a){return function(_0x5c5a8f){if(_0x5c5a8f){return _0x5c5a8f['destroy']()['then'](function(){_0x5ca78d[_0x87ed('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46d699,_0x59e47f){return function(_0x4a34b5){if(!_0x4a34b5){_0x46d699[_0x87ed('0x28')](0x194);}return _0x4a34b5;};}function handleError(_0x4261a9,_0x2ee6e1){_0x2ee6e1=_0x2ee6e1||0x1f4;return function(_0x4591fb){logger[_0x87ed('0x29')](_0x4591fb['stack']);if(_0x4591fb[_0x87ed('0x2a')]){delete _0x4591fb['name'];}_0x4261a9[_0x87ed('0x1d')](_0x2ee6e1)[_0x87ed('0x2b')](_0x4591fb);};}function getInteractionUsers(_0x2856b4,_0x2c789d){return new BPromise(function(_0x478658,_0x3c706c){try{if(_0x2c789d[_0x2856b4['id']]){_0x2856b4[_0x87ed('0x2c')]=_['map'](_0x2c789d[_0x2856b4['id']],function(_0xf58008){return{'id':_0xf58008['id'],'fullname':_0xf58008[_0x87ed('0x2d')]};});}}catch(_0x4b0c27){_0x3c706c(_0x4b0c27);}_0x478658(_0x2856b4);});}function getInteractionTags(_0x5eed58,_0x2bdfe8){return new BPromise(function(_0xce237c,_0x81b917){try{if(_0x5eed58[_0x87ed('0x2e')]){_0x5eed58[_0x87ed('0x2f')]=[];_0x5eed58[_0x87ed('0x2e')]['split'](',')['forEach'](function(_0x34eb71){_0x5eed58[_0x87ed('0x2f')][_0x87ed('0x30')](_0x2bdfe8[_0x34eb71]);});}delete _0x5eed58[_0x87ed('0x2e')];}catch(_0x30e076){_0x81b917(_0x30e076);}_0xce237c(_0x5eed58);});}function updateFaxInteraction(_0x511aee,_0x1622f1,_0x234fc7){return new BPromise(function(_0x1066dc,_0x5d31ba){return getInteractionUsers(_0x511aee,_0x234fc7)['then'](function(_0x54cd07){return getInteractionTags(_0x54cd07,_0x1622f1);})[_0x87ed('0x27')](function(_0x1386c0){return getStateInteraction(_0x1386c0);})[_0x87ed('0x27')](function(_0x2d2c32){_0x1066dc(_0x2d2c32);})[_0x87ed('0x31')](function(_0x123030){_0x5d31ba(_0x123030);});});}function getStateInteraction(_0x269afa){return new BPromise(function(_0x8120a5){_0x269afa[_0x87ed('0x32')]=0x0;_0x269afa[_0x87ed('0x33')]=0x0;_0x269afa['answered']=0x0;_0x269afa[_0x87ed('0x34')]=0x0;_0x269afa[_0x87ed('0x35')]=0x0;if(!_0x269afa[_0x87ed('0x36')]&&!_0x269afa['UserId']){_0x269afa[_0x87ed('0x32')]+=0x1;}if(!_0x269afa['closed']&&_0x269afa[_0x87ed('0x37')]){_0x269afa[_0x87ed('0x33')]+=0x1;if(_0x269afa[_0x87ed('0x32')]){_0x269afa[_0x87ed('0x32')]-=0x1;}}if(_0x269afa[_0x87ed('0x36')]&&_0x269afa[_0x87ed('0x37')]){_0x269afa[_0x87ed('0x38')]+=0x1;if(_0x269afa[_0x87ed('0x33')]){_0x269afa[_0x87ed('0x33')]-=0x1;}}if(_0x269afa[_0x87ed('0x36')]&&!_0x269afa[_0x87ed('0x37')]){_0x269afa['unmanaged']+=0x1;if(_0x269afa[_0x87ed('0x32')]){_0x269afa['waiting']-=0x1;}}_0x269afa[_0x87ed('0x35')]+=0x1;_0x8120a5(_0x269afa);});}exports[_0x87ed('0x39')]=function(_0x559e92,_0x52854f){var _0x5c42a5={},_0x2b8d18={},_0x63cbdb={'count':0x0,'rows':[]};var _0x342eca=_[_0x87ed('0x3a')](db['FaxInteraction'][_0x87ed('0x3b')],function(_0x388343){return{'name':_0x388343[_0x87ed('0x3c')],'type':_0x388343[_0x87ed('0x3d')][_0x87ed('0x3e')]};});_0x2b8d18[_0x87ed('0x3f')]=_[_0x87ed('0x3a')](_0x342eca,_0x87ed('0x2a'));_0x2b8d18['query']=_[_0x87ed('0x40')](_0x559e92[_0x87ed('0x41')]);_0x2b8d18[_0x87ed('0x42')]=_[_0x87ed('0x43')](_0x2b8d18[_0x87ed('0x3f')],_0x2b8d18[_0x87ed('0x41')]);_0x5c42a5[_0x87ed('0x44')]=_['intersection'](_0x2b8d18[_0x87ed('0x3f')],qs[_0x87ed('0x45')](_0x559e92['query'][_0x87ed('0x45')]));_0x5c42a5[_0x87ed('0x44')]=_0x5c42a5[_0x87ed('0x44')][_0x87ed('0x46')]?_0x5c42a5[_0x87ed('0x44')]:_0x2b8d18[_0x87ed('0x3f')];if(!_0x559e92['query'][_0x87ed('0x47')](_0x87ed('0x48'))){_0x5c42a5[_0x87ed('0x20')]=qs[_0x87ed('0x20')](_0x559e92['query'][_0x87ed('0x20')]);_0x5c42a5['offset']=qs[_0x87ed('0x1f')](_0x559e92['query'][_0x87ed('0x1f')]);}_0x5c42a5[_0x87ed('0x49')]=qs[_0x87ed('0x4a')](_0x559e92[_0x87ed('0x41')]['sort']);_0x5c42a5[_0x87ed('0x4b')]=qs[_0x87ed('0x42')](_[_0x87ed('0x4c')](_0x559e92['query'],_0x2b8d18['filters']),_0x342eca);var _0x3ce0e8=[];var _0x1db44d=squel['select']()[_0x87ed('0x4d')]('id')[_0x87ed('0x4d')](_0x87ed('0x2a'))['field'](_0x87ed('0x4e'))['from'](_0x87ed('0x4f'));var _0x1e4cb3=squel['select']()[_0x87ed('0x4d')](_0x87ed('0x50'))[_0x87ed('0x4d')](_0x87ed('0x51'))['field']('ui.FaxInteractionId')[_0x87ed('0x52')](_0x87ed('0x53'),'ui')['left_join']('users','u',_0x87ed('0x54'));var _0x29bae1=squel[_0x87ed('0x55')]()[_0x87ed('0x52')](_0x87ed('0x56'),'i')[_0x87ed('0x57')](_0x87ed('0x58'),'c',_0x87ed('0x59'))[_0x87ed('0x57')](_0x87ed('0x5a'),'o',_0x87ed('0x5b'))[_0x87ed('0x57')](_0x87ed('0x5c'),'a',_0x87ed('0x5d'))[_0x87ed('0x57')]('fax_messages','me',_0x87ed('0x5e'))[_0x87ed('0x57')](_0x87ed('0x5f'),'it','it.FaxInteractionId\x20=\x20i.id')['left_join'](_0x87ed('0x4f'),'t',_0x87ed('0x60'));var _0x263ec8=squel['expr']();var _0x1d2006=[];var _0x1ecabe=squel[_0x87ed('0x61')]();var _0x4925b4;if(_0x559e92['query'][_0x87ed('0x62')]){_0x4925b4=as[_0x87ed('0x63')](_0x559e92[_0x87ed('0x41')]['search']);var _0x3f54cd=_0x4925b4[_0x87ed('0x64')];for(var _0xccb8cb=0x0;_0xccb8cb<_0x4925b4[_0x87ed('0x65')]['length'];_0xccb8cb++){var _0x37e8e4=_0x4925b4[_0x87ed('0x65')][_0xccb8cb];var _0x232cee='i';var _0x1c295f=_['find'](_0x342eca,[_0x87ed('0x2a'),_0x37e8e4[_0x87ed('0x4d')]]);if(!_0x1c295f){switch(_0x37e8e4[_0x87ed('0x4d')]){case _0x87ed('0x66'):if(_0x37e8e4[_0x87ed('0x67')]==0x1){_0x29bae1[_0x87ed('0x68')]('`'+_0x37e8e4[_0x87ed('0x4d')]+'`\x20=\x200');}else{_0x29bae1[_0x87ed('0x68')]('`'+_0x37e8e4[_0x87ed('0x4d')]+'`\x20>\x200');}break;case _0x87ed('0x69'):if(_0x37e8e4[_0x87ed('0x6a')]===_0x87ed('0x6b')){if(_0x37e8e4['value']['split']('\x20')[_0x87ed('0x46')]>0x1){_0x263ec8[_0x3f54cd](_0x87ed('0x6c'),qs['getFullTextValue'](_0x37e8e4['value']),null);}else{var _0x236626='%'+_0x37e8e4[_0x87ed('0x67')]+'%';_0x263ec8[_0x3f54cd](_0x87ed('0x6d'),_0x236626,_0x236626,_0x236626);}}else{_0x1c295f=_[_0x87ed('0x6e')](_0x342eca,[_0x87ed('0x2a'),_0x87ed('0x6f')]);_0x37e8e4[_0x87ed('0x4d')]=_0x87ed('0x6f');_0x6529e8=as['buildExpression'](_0x232cee,_0x1c295f[_0x87ed('0x3d')],_0x37e8e4);_0x263ec8[_0x3f54cd](_0x6529e8[_0x87ed('0x70')],_0x6529e8[_0x87ed('0x67')][_0x87ed('0x71')],_0x6529e8[_0x87ed('0x67')][_0x87ed('0x72')]);}break;case _0x87ed('0x73'):var _0x48f359=_0x37e8e4[_0x87ed('0x67')]['split'](',')[_0x87ed('0x3a')](function(_0x2defa7){return Number(_0x2defa7);});_0x48f359[_0x87ed('0x74')](function(_0x2c55e1){_0x1ecabe['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2c55e1+',%');});_0x1d2006=_[_0x87ed('0x75')](_0x1d2006,_0x48f359);break;case _0x87ed('0x76'):if(_0x37e8e4[_0x87ed('0x6a')]===_0x87ed('0x6b')){_0x263ec8[_0x3f54cd](_0x87ed('0x77'),'%'+_0x37e8e4['value']+'%',null);}else{_0x1c295f=_[_0x87ed('0x6e')](_0x342eca,[_0x87ed('0x2a'),_0x87ed('0x37')]);_0x37e8e4[_0x87ed('0x4d')]=_0x87ed('0x37');_0x6529e8=as[_0x87ed('0x78')](_0x232cee,_0x1c295f['type'],_0x37e8e4);_0x263ec8[_0x3f54cd](_0x6529e8[_0x87ed('0x70')],_0x6529e8[_0x87ed('0x67')]['start'],_0x6529e8[_0x87ed('0x67')]['end']);}break;case _0x87ed('0x79'):_0x6529e8=as[_0x87ed('0x78')]('me',null,_0x37e8e4);_0x263ec8[_0x3f54cd](_0x6529e8[_0x87ed('0x70')],_0x6529e8[_0x87ed('0x67')]['start'],_0x6529e8[_0x87ed('0x67')][_0x87ed('0x72')]);break;}}else{var _0x6529e8=as['buildExpression'](_0x232cee,_0x1c295f[_0x87ed('0x3d')],_0x37e8e4);_0x263ec8[_0x3f54cd](_0x6529e8[_0x87ed('0x70')],_0x6529e8['value'][_0x87ed('0x71')],_0x6529e8[_0x87ed('0x67')][_0x87ed('0x72')]);}}}else{var _0x1194bf=_(_0x559e92[_0x87ed('0x41')])[_0x87ed('0x40')]()[_0x87ed('0x3a')](function(_0x36060b){return _[_0x87ed('0x7a')](_0x342eca,['name',_0x36060b])?_0x36060b:undefined;})[_0x87ed('0x7b')]()[_0x87ed('0x67')]();if(!_[_0x87ed('0x7c')](_0x1194bf)){_0x1194bf[_0x87ed('0x74')](function(_0x21798e){if(_0x21798e===_0x87ed('0x7d')){_0x29bae1[_0x87ed('0x4b')](_0x87ed('0x7e'),[][_0x87ed('0x7f')](_0x559e92['query'][_0x21798e]));}else if(_0x21798e===_0x87ed('0x80')){var _0x499b4a=JSON[_0x87ed('0x81')](_0x559e92[_0x87ed('0x41')][_0x21798e])['$gte'];var _0x89b269=JSON[_0x87ed('0x81')](_0x559e92[_0x87ed('0x41')][_0x21798e])[_0x87ed('0x82')];_0x29bae1['where'](_0x87ed('0x83'),_0x499b4a,_0x89b269);}else{if(_0x559e92[_0x87ed('0x41')][_0x21798e]===_0x87ed('0x84')){_0x29bae1[_0x87ed('0x4b')]('i.'+_0x21798e+_0x87ed('0x85'));}else{_0x29bae1[_0x87ed('0x4b')]('i.'+_0x21798e+_0x87ed('0x86'),_0x559e92['query'][_0x21798e]);}}});}if(_0x559e92[_0x87ed('0x41')]['read']){if(_0x559e92[_0x87ed('0x41')][_0x87ed('0x87')]==0x1){_0x29bae1[_0x87ed('0x68')](_0x87ed('0x88'));}else{_0x29bae1[_0x87ed('0x68')]('`unreadMessages`\x20>\x200');}}if(_0x559e92[_0x87ed('0x41')]['tag']){_0x1d2006=_['isArray'](_0x559e92[_0x87ed('0x41')]['tag'])?_0x559e92[_0x87ed('0x41')][_0x87ed('0x89')]:new Array(_0x559e92[_0x87ed('0x41')][_0x87ed('0x89')]);_0x1d2006[_0x87ed('0x74')](function(_0x227888){_0x1ecabe['or'](_0x87ed('0x8a'),'%,'+_0x227888+',%');});}if(_0x559e92[_0x87ed('0x41')]['filter']){var _0x154c64=_0x559e92[_0x87ed('0x41')][_0x87ed('0x8b')]['replace']('\x5c','\x5c\x5c')[_0x87ed('0x8c')](/'/g,'\x27\x27');if(qs[_0x87ed('0x8d')](_0x154c64)){_0x263ec8['or'](_0x87ed('0x8e'),_0x154c64+'%')['or'](_0x87ed('0x8f'),_0x154c64+'%');}_0x263ec8['or'](_0x87ed('0x90'),_0x154c64+'%');}}_0x29bae1['where'](_0x263ec8);_0x29bae1['group'](_0x87ed('0x91'));var _0x3a2f0a={'type':db[_0x87ed('0x92')][_0x87ed('0x93')][_0x87ed('0x94')],'raw':!![]};var _0x1390a2=_0x29bae1[_0x87ed('0x95')]();_0x1390a2[_0x87ed('0x4d')]('i.id');_0x1390a2[_0x87ed('0x4d')](_0x87ed('0x96'),_0x87ed('0x66'));if(_0x5c42a5[_0x87ed('0x49')]){_0x5c42a5['order']['forEach'](function(_0x8ad59b){var _0x1bc410=_0x8ad59b[0x0]===_0x87ed('0x97')?_0x8ad59b[0x0]:'i.'+_0x8ad59b[0x0];_0x29bae1[_0x87ed('0x49')](_0x1bc410,_0x8ad59b[0x1]===_0x87ed('0x98')?![]:!![]);});}if(!_[_0x87ed('0x7c')](_0x1d2006)){_0x29bae1['having'](_0x1ecabe);_0x1390a2['where'](_0x87ed('0x99'),_0x1d2006);}BPromise['resolve']()['then'](function(){if(!_0x4925b4){if(_0x559e92['query'][_0x87ed('0x7d')])return;_0x1390a2[_0x87ed('0x4b')](_0x87ed('0x9a'));_0x29bae1['where'](_0x87ed('0x9a'));return;}if(_0x559e92[_0x87ed('0x9b')]['role']!==_0x87ed('0x9c'))return;return _0x559e92['user']['getFaxAccounts']({'attributes':['id'],'raw':!![]})[_0x87ed('0x27')](function(_0x47e362){if(_['isEmpty'](_0x47e362)){_0x1390a2[_0x87ed('0x4b')]('i.FaxAccountId\x20IS\x20NULL');_0x29bae1[_0x87ed('0x4b')]('i.FaxAccountId\x20IS\x20NULL');}else{_0x1390a2[_0x87ed('0x4b')](_0x87ed('0x7e'),_[_0x87ed('0x3a')](_0x47e362,'id'));_0x29bae1[_0x87ed('0x4b')](_0x87ed('0x7e'),_[_0x87ed('0x3a')](_0x47e362,'id'));}});})[_0x87ed('0x27')](function(){if(_0x559e92[_0x87ed('0x9b')]['role']===_0x87ed('0x9c')&&!_0x4925b4&&!_0x559e92[_0x87ed('0x41')][_0x87ed('0x7d')])return[];return db[_0x87ed('0x9d')][_0x87ed('0x41')](_0x1390a2[_0x87ed('0x9e')](),_0x3a2f0a);})[_0x87ed('0x27')](function(_0x5d7d48){_0x63cbdb[_0x87ed('0x21')]=_0x5d7d48['length'];if(_0x63cbdb[_0x87ed('0x21')]===0x0)return[];return db['sequelize'][_0x87ed('0x41')](_0x1db44d[_0x87ed('0x9e')](),_0x3a2f0a)['then'](function(_0x4812b9){_0x3ce0e8=_[_0x87ed('0x9f')](_0x4812b9,'id');_0x3a2f0a=_['merge'](_0x3a2f0a,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x559e92[_0x87ed('0x41')][_0x87ed('0x45')]){_0x5c42a5['attributes'][_0x87ed('0x74')](function(_0x168420){_0x29bae1[_0x87ed('0x4d')]('i.'+_0x168420);});}else{_0x29bae1[_0x87ed('0x4d')](_0x87ed('0x96'),_0x87ed('0x66'));_0x29bae1['field'](_0x87ed('0xa0'),_0x87ed('0xa1'));_0x29bae1[_0x87ed('0x4d')](_0x87ed('0xa2'),_0x87ed('0xa3'));_0x29bae1[_0x87ed('0x4d')]('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',_0x87ed('0x97'));_0x29bae1[_0x87ed('0x4d')](_0x87ed('0xa4'));_0x29bae1[_0x87ed('0x4d')](_0x87ed('0xa5'),_0x87ed('0xa6'));_0x29bae1[_0x87ed('0x4d')](_0x87ed('0xa7'),_0x87ed('0xa8'));_0x29bae1[_0x87ed('0x4d')](_0x87ed('0xa9'),_0x87ed('0xaa'));_0x29bae1[_0x87ed('0x4d')](_0x87ed('0xab'),_0x87ed('0xac'));_0x29bae1['field']('c.mobile',_0x87ed('0xad'));_0x29bae1['field'](_0x87ed('0xae'),_0x87ed('0xaf'));_0x29bae1[_0x87ed('0x4d')](_0x87ed('0xb0'),_0x87ed('0xb1'));_0x29bae1[_0x87ed('0x4d')](_0x87ed('0xb2'),_0x87ed('0xb3'));_0x29bae1[_0x87ed('0x4d')](_0x87ed('0xb4'),_0x87ed('0x2e'));}if(_0x5c42a5[_0x87ed('0x20')])_0x29bae1[_0x87ed('0x20')](_0x5c42a5[_0x87ed('0x20')]);if(_0x5c42a5[_0x87ed('0x1f')])_0x29bae1[_0x87ed('0x1f')](_0x5c42a5[_0x87ed('0x1f')]);return db[_0x87ed('0x9d')][_0x87ed('0x41')](_0x29bae1[_0x87ed('0x9e')](),_0x3a2f0a);})[_0x87ed('0x27')](function(_0x5074b9){if(_0x5074b9[_0x87ed('0x46')]>0x0)_0x1e4cb3['where']('ui.FaxInteractionId\x20IN\x20?',_[_0x87ed('0x3a')](_0x5074b9,'id'));return db[_0x87ed('0x9d')][_0x87ed('0x41')](_0x1e4cb3['toString'](),_0x3a2f0a)[_0x87ed('0x27')](function(_0x5a5f41){var _0x2dde68=_[_0x87ed('0xb5')](_0x5a5f41,_0x87ed('0xb6'));var _0x50411d=[];_0x5074b9[_0x87ed('0x74')](function(_0xddea9e){_0x50411d[_0x87ed('0x30')](updateFaxInteraction(_0xddea9e,_0x3ce0e8,_0x2dde68));});return BPromise[_0x87ed('0xb7')](_0x50411d);});});})[_0x87ed('0x27')](function(_0x3eeb7c){_0x63cbdb[_0x87ed('0xb8')]=_0x3eeb7c;return _0x63cbdb;})[_0x87ed('0x27')](respondWithFilteredResult(_0x52854f,_0x5c42a5))[_0x87ed('0x31')](handleError(_0x52854f,null));};exports[_0x87ed('0xb9')]=function(_0x5b3c1f,_0x4a19e4){var _0x161e68={'raw':![],'where':{'id':_0x5b3c1f[_0x87ed('0xba')]['id']}},_0x277538={};_0x277538[_0x87ed('0x3f')]=_[_0x87ed('0x40')](db[_0x87ed('0xbb')][_0x87ed('0x3b')]);_0x277538[_0x87ed('0x41')]=_['keys'](_0x5b3c1f[_0x87ed('0x41')]);_0x277538[_0x87ed('0x42')]=_[_0x87ed('0x43')](_0x277538[_0x87ed('0x3f')],_0x277538[_0x87ed('0x41')]);_0x161e68[_0x87ed('0x44')]=_[_0x87ed('0x43')](_0x277538[_0x87ed('0x3f')],qs[_0x87ed('0x45')](_0x5b3c1f[_0x87ed('0x41')][_0x87ed('0x45')]));_0x161e68['attributes']=_0x161e68[_0x87ed('0x44')][_0x87ed('0x46')]?_0x161e68[_0x87ed('0x44')]:_0x277538[_0x87ed('0x3f')];if(_0x5b3c1f[_0x87ed('0x41')][_0x87ed('0xbc')]){_0x161e68[_0x87ed('0xbd')]=[{'all':!![]}];}_0x161e68=_[_0x87ed('0xbe')]({},_0x161e68,_0x5b3c1f[_0x87ed('0xbf')]);return db[_0x87ed('0xbb')][_0x87ed('0x6e')](_0x161e68)[_0x87ed('0x27')](handleEntityNotFound(_0x4a19e4,null))[_0x87ed('0x27')](respondWithResult(_0x4a19e4,null))[_0x87ed('0x31')](handleError(_0x4a19e4,null));};exports[_0x87ed('0xc0')]=function(_0x486350,_0x4ce752){return db[_0x87ed('0xbb')]['create'](_0x486350[_0x87ed('0x79')],{})['then'](respondWithResult(_0x4ce752,0xc9))[_0x87ed('0x31')](handleError(_0x4ce752,null));};exports[_0x87ed('0x26')]=function(_0x1cea00,_0x5f6237){if(_0x1cea00[_0x87ed('0x79')]['id']){delete _0x1cea00[_0x87ed('0x79')]['id'];}return db['FaxInteraction'][_0x87ed('0x6e')]({'where':{'id':_0x1cea00[_0x87ed('0xba')]['id']}})[_0x87ed('0x27')](handleEntityNotFound(_0x5f6237,null))[_0x87ed('0x27')](saveUpdates(_0x1cea00['body'],null))['then'](respondWithResult(_0x5f6237,null))[_0x87ed('0x31')](handleError(_0x5f6237,null));};exports['destroy']=function(_0x4a7c65,_0x43616e){return db[_0x87ed('0xbb')][_0x87ed('0x6e')]({'where':{'id':_0x4a7c65[_0x87ed('0xba')]['id']}})[_0x87ed('0x27')](handleEntityNotFound(_0x43616e,null))[_0x87ed('0x27')](removeEntity(_0x43616e,null))[_0x87ed('0x31')](handleError(_0x43616e,null));};exports['describe']=function(_0x411aa1,_0x546ac1){return db[_0x87ed('0xbb')][_0x87ed('0xc1')]()[_0x87ed('0x27')](respondWithResult(_0x546ac1,null))[_0x87ed('0x31')](handleError(_0x546ac1,null));};exports[_0x87ed('0xc2')]=function(_0x5bf87f,_0xebb513,_0x48d866){return db[_0x87ed('0xc3')][_0x87ed('0x6e')]({'where':{'id':_0x5bf87f[_0x87ed('0xba')]['id']}})['then'](handleEntityNotFound(_0xebb513,null))['then'](function(_0x2f93f9){if(_0x2f93f9){return _0x2f93f9['addMessage'](_0x5bf87f['body'][_0x87ed('0xc4')],_[_0x87ed('0xc5')](_0x5bf87f['body'],[_0x87ed('0xc4'),'id'])||{});}})['then'](respondWithResult(_0xebb513,null))[_0x87ed('0x31')](handleError(_0xebb513,null));};exports[_0x87ed('0xc6')]=function(_0x26e359,_0x4b1fe4,_0x32272d){var _0x5134c5={'raw':![],'where':{}};var _0x3b979e={};var _0x13820a={'count':0x0,'rows':[]};return db['FaxInteraction']['findOne']({'where':{'id':_0x26e359[_0x87ed('0xba')]['id']}})[_0x87ed('0x27')](handleEntityNotFound(_0x4b1fe4,null))[_0x87ed('0x27')](function(_0xafcf8d){if(_0xafcf8d){_0x3b979e[_0x87ed('0x3f')]=_[_0x87ed('0x40')](db[_0x87ed('0xc3')]['rawAttributes']);_0x3b979e[_0x87ed('0x41')]=_[_0x87ed('0x40')](_0x26e359['query']);_0x3b979e[_0x87ed('0x42')]=_[_0x87ed('0x43')](_0x3b979e[_0x87ed('0x3f')],_0x3b979e[_0x87ed('0x41')]);_0x5134c5[_0x87ed('0x44')]=_[_0x87ed('0x43')](_0x3b979e[_0x87ed('0x3f')],qs[_0x87ed('0x45')](_0x26e359[_0x87ed('0x41')][_0x87ed('0x45')]));_0x5134c5[_0x87ed('0x44')]=_0x5134c5[_0x87ed('0x44')][_0x87ed('0x46')]?_0x5134c5['attributes']:_0x3b979e[_0x87ed('0x3f')];if(!_0x26e359['query'][_0x87ed('0x47')](_0x87ed('0x48'))){_0x5134c5['limit']=qs['limit'](_0x26e359[_0x87ed('0x41')][_0x87ed('0x20')]);_0x5134c5[_0x87ed('0x1f')]=qs[_0x87ed('0x1f')](_0x26e359[_0x87ed('0x41')][_0x87ed('0x1f')]);}_0x5134c5[_0x87ed('0x49')]=qs['sort'](_0x26e359['query'][_0x87ed('0x4a')]);_0x5134c5[_0x87ed('0x4b')]=qs[_0x87ed('0x42')](_[_0x87ed('0x4c')](_0x26e359['query'],_0x3b979e[_0x87ed('0x42')]));_0x5134c5['where'][_0x87ed('0xb6')]=_0xafcf8d['id'];if(_0x26e359['query'][_0x87ed('0x8b')]){_0x5134c5[_0x87ed('0x4b')]=_[_0x87ed('0xbe')](_0x5134c5['where'],{'$or':_[_0x87ed('0x3a')](_0x5134c5[_0x87ed('0x44')],function(_0x3e3208){var _0x48d46c={};_0x48d46c[_0x3e3208]={'$like':'%'+_0x26e359[_0x87ed('0x41')][_0x87ed('0x8b')]+'%'};return _0x48d46c;})});}if(_0x26e359[_0x87ed('0x41')][_0x87ed('0xc7')]){var _0x5e9006=_0x26e359[_0x87ed('0x41')][_0x87ed('0xc7')][_0x87ed('0xc8')](',');var _0x40d1dd={};_0x40d1dd[_0x5e9006[0x0]]={'$gte':moment(_0x5e9006[0x1])[_0x87ed('0xc9')](_0x87ed('0xca'))};_0x5134c5[_0x87ed('0x4b')]=_[_0x87ed('0xbe')](_0x5134c5[_0x87ed('0x4b')],_0x40d1dd);}_0x5134c5=_['merge']({},_0x5134c5,_0x26e359[_0x87ed('0xbf')]);return db[_0x87ed('0xc3')][_0x87ed('0x21')]({'where':_0x5134c5[_0x87ed('0x4b')]})[_0x87ed('0x27')](function(_0x1d4893){_0x13820a[_0x87ed('0x21')]=_0x1d4893;if(_0x26e359[_0x87ed('0x41')]['includeAll']){_0x5134c5[_0x87ed('0xbd')]=[{'all':!![]}];}return db[_0x87ed('0xc3')]['findAll'](_0x5134c5);})[_0x87ed('0x27')](function(_0x29f202){_0x13820a[_0x87ed('0xb8')]=_0x29f202;return _0x13820a;});}})['then'](respondWithFilteredResult(_0x4b1fe4,_0x5134c5))[_0x87ed('0x31')](handleError(_0x4b1fe4,null));};exports[_0x87ed('0xcb')]=function(_0x58ea52,_0x1de315,_0x1f6993){return db['FaxInteraction'][_0x87ed('0x6e')]({'where':{'id':_0x58ea52['params']['id']}})[_0x87ed('0x27')](handleEntityNotFound(_0x1de315,null))[_0x87ed('0x27')](function(_0x54cebe){if(_0x54cebe){return _0x54cebe[_0x87ed('0xcc')](_0x58ea52[_0x87ed('0x79')]['ids'],_[_0x87ed('0xc5')](_0x58ea52[_0x87ed('0x79')],[_0x87ed('0xc4'),'id'])||{})[_0x87ed('0xcd')](function(){return db[_0x87ed('0x73')][_0x87ed('0xce')]({'attributes':['id',_0x87ed('0x2a'),_0x87ed('0x4e')],'where':{'id':_0x58ea52['body'][_0x87ed('0xc4')]}});})[_0x87ed('0x27')](function(_0x1a9ce8){socket[_0x87ed('0xcf')](_0x87ed('0xd0'),{'id':Number(_0x58ea52[_0x87ed('0xba')]['id']),'tags':_0x1a9ce8||[]});return{'id':Number(_0x58ea52[_0x87ed('0xba')]['id']),'tags':_0x1a9ce8||[]};});}})[_0x87ed('0x27')](respondWithResult(_0x1de315,null))[_0x87ed('0x31')](handleError(_0x1de315,null));};exports['removeTags']=function(_0x53eba6,_0x4abf0b,_0x19be48){return db['FaxInteraction'][_0x87ed('0x6e')]({'where':{'id':_0x53eba6['params']['id']}})['then'](handleEntityNotFound(_0x4abf0b,null))[_0x87ed('0x27')](function(_0x93d80c){if(_0x93d80c){return _0x93d80c[_0x87ed('0xd1')](_0x53eba6['query']['ids']);}})[_0x87ed('0x27')](respondWithStatusCode(_0x4abf0b,null))[_0x87ed('0x31')](handleError(_0x4abf0b,null));};exports['download']=function(_0x5c1dd3,_0x20ebdd){var _0x3be111=moment()['unix']()[_0x87ed('0x9e')]();var _0x40996e=path[_0x87ed('0xd2')](config['root'],_0x87ed('0xd3'),_0x87ed('0xd4'),_0x87ed('0xd5'));var _0x23eaf3=path[_0x87ed('0xd2')](config[_0x87ed('0xd6')],_0x87ed('0xd3'),_0x87ed('0xd4'),_0x87ed('0xd7'));var _0x3a0cc4=path[_0x87ed('0xd2')](_0x40996e,_0x3be111);var _0x1683c5=util[_0x87ed('0xc9')](_0x87ed('0xd8'),_0x5c1dd3['params']['id'],_0x3be111);var _0x435986=path['join'](_0x40996e,_0x1683c5);var _0x45dc3b=[];_0x45dc3b['push']({'model':db[_0x87ed('0xd9')],'as':_0x87ed('0xd9'),'raw':!![]});var _0x1fae5f=[{'model':db[_0x87ed('0xc3')],'as':_0x87ed('0xda'),'attributes':['id',_0x87ed('0x79'),_0x87ed('0x80')],'include':_0x45dc3b}];return db[_0x87ed('0xbb')][_0x87ed('0x6e')]({'where':{'id':_0x5c1dd3[_0x87ed('0xba')]['id']},'include':_0x1fae5f})[_0x87ed('0x27')](handleEntityNotFound(_0x20ebdd,null))[_0x87ed('0x27')](function(_0x2d7cf2){if(_0x2d7cf2&&_0x2d7cf2[_0x87ed('0xda')]){var _0x37244d=_0x2d7cf2[_0x87ed('0xdb')]({'plain':!![]});fs[_0x87ed('0xdc')](_0x3a0cc4);for(var _0x4c7184=0x0;_0x4c7184<_0x37244d['Messages']['length'];_0x4c7184++){var _0x2ec146=_0x37244d['Messages'][_0x4c7184][_0x87ed('0xd9')];if(_0x2ec146){var _0x34058a=path[_0x87ed('0xd2')](_0x23eaf3,_0x2ec146[_0x87ed('0xdd')]);if(fs[_0x87ed('0xde')](_0x34058a)){fs[_0x87ed('0xdf')](_0x34058a)[_0x87ed('0xe0')](fs[_0x87ed('0xe1')](path[_0x87ed('0xd2')](_0x3a0cc4,_0x2ec146[_0x87ed('0xdd')])));}}}return BPromise[_0x87ed('0xe2')]()['then'](function(){return new BPromise(function(_0x1a10a4,_0x47aa18){zipdir(_0x3a0cc4,{'saveTo':_0x435986},function(_0x582d9b,_0x3f2b36){if(_0x582d9b)return _0x47aa18(_0x582d9b);return _0x1a10a4(_0x3f2b36);});})[_0x87ed('0x27')](function(){return new BPromise(function(_0x4a008f,_0x3f0202){rimraf(_0x3a0cc4,function(_0x204362){if(_0x204362)_0x3f0202(_0x204362);return _0x4a008f();});});})['then'](function(){return _0x20ebdd[_0x87ed('0xe3')](_0x435986,_0x1683c5,function(_0x51de3d){if(_0x51de3d){console[_0x87ed('0xe4')]('err',_0x51de3d);}else{fs[_0x87ed('0xe5')](_0x435986);}});});});}else{return _0x20ebdd['sendStatus'](0xc8);}})['catch'](handleError(_0x20ebdd,null));}; \ No newline at end of file +var _0x6159=['$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','unreadMessages','contactName','DESC','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','keyBy','FaxInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','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','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','FaxInteractionId','all','show','includeAll','include','merge','options','create','params','describe','addMessage','FaxMessage','ids','omit','getMessages','hasOwnProperty','nolimit','format','findAll','rows','addTags','setTags','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','Attachment','Messages','mkdirSync','createReadStream','pipe','createWriteStream','basename','download','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','status','json','offset','limit','count','set','Content-Range','apply','reject','update','then','end','sendStatus','error','name','send','map','fullname','TagIds','Tags','push','catch','talking','answered','unmanaged','total','closed','waiting','UserId','index','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','order','sort','where','pick','field','color','from','tools_tags','u.id','u.fullname','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','o.id\x20=\x20i.UserId','fax_accounts','me.FaxInteractionId\x20=\x20i.id','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','find','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','body','keys','some','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse'];(function(_0x2dff4c,_0x21e0e2){var _0x1f0b4c=function(_0x35289a){while(--_0x35289a){_0x2dff4c['push'](_0x2dff4c['shift']());}};_0x1f0b4c(++_0x21e0e2);}(_0x6159,0x138));var _0x9615=function(_0x337563,_0x3065c4){_0x337563=_0x337563-0x0;var _0x457626=_0x6159[_0x337563];return _0x457626;};'use strict';var emlformat=require(_0x9615('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9615('0x1'));var jsonpatch=require(_0x9615('0x2'));var rp=require(_0x9615('0x3'));var moment=require(_0x9615('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9615('0x5'));var util=require(_0x9615('0x6'));var path=require(_0x9615('0x7'));var sox=require(_0x9615('0x8'));var csv=require('to-csv');var ejs=require(_0x9615('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9615('0xa'));var squel=require(_0x9615('0xb'));var crypto=require(_0x9615('0xc'));var jsforce=require(_0x9615('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x9615('0xe'));var querystring=require(_0x9615('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9615('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9615('0x11'))(_0x9615('0x12'));var utils=require(_0x9615('0x13'));var config=require(_0x9615('0x14'));var licenseUtil=require(_0x9615('0x15'));var db=require(_0x9615('0x16'))['db'];config[_0x9615('0x17')]=_[_0x9615('0x18')](config[_0x9615('0x17')],{'host':_0x9615('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxInteraction.socket')[_0x9615('0x1a')](socket);function respondWithStatusCode(_0x52b9a6,_0x59a6b9){_0x59a6b9=_0x59a6b9||0xcc;return function(_0x25e0b6){if(_0x25e0b6){return _0x52b9a6['sendStatus'](_0x59a6b9);}return _0x52b9a6[_0x9615('0x1b')](_0x59a6b9)['end']();};}function respondWithResult(_0x3a9cb2,_0x17f891){_0x17f891=_0x17f891||0xc8;return function(_0x1e2499){if(_0x1e2499){return _0x3a9cb2[_0x9615('0x1b')](_0x17f891)[_0x9615('0x1c')](_0x1e2499);}};}function respondWithFilteredResult(_0x2dbbdd,_0x138c46){return function(_0x495371){if(_0x495371){var _0x36c32d=typeof _0x138c46[_0x9615('0x1d')]==='undefined'&&typeof _0x138c46[_0x9615('0x1e')]==='undefined';var _0x1061db=_0x495371[_0x9615('0x1f')];var _0x3823a4=_0x36c32d?0x0:_0x138c46[_0x9615('0x1d')];var _0x12e6c5=_0x36c32d?_0x495371[_0x9615('0x1f')]:_0x138c46['offset']+_0x138c46[_0x9615('0x1e')];var _0xe73b30;if(_0x12e6c5>=_0x1061db){_0x12e6c5=_0x1061db;_0xe73b30=0xc8;}else{_0xe73b30=0xce;}_0x2dbbdd[_0x9615('0x1b')](_0xe73b30);return _0x2dbbdd[_0x9615('0x20')](_0x9615('0x21'),_0x3823a4+'-'+_0x12e6c5+'/'+_0x1061db)['json'](_0x495371);}return null;};}function patchUpdates(_0x386619){return function(_0x2f1991){try{jsonpatch[_0x9615('0x22')](_0x2f1991,_0x386619,!![]);}catch(_0x46e90a){return BPromise[_0x9615('0x23')](_0x46e90a);}return _0x2f1991['save']();};}function saveUpdates(_0x4dd210,_0x2ad9ee){return function(_0x3f08c3){if(_0x3f08c3){return _0x3f08c3[_0x9615('0x24')](_0x4dd210)[_0x9615('0x25')](function(_0x20e1cc){return _0x20e1cc;});}return null;};}function removeEntity(_0x186875,_0x3aebcf){return function(_0x35eb37){if(_0x35eb37){return _0x35eb37['destroy']()[_0x9615('0x25')](function(){_0x186875['status'](0xcc)[_0x9615('0x26')]();});}};}function handleEntityNotFound(_0x55c886,_0x3de7da){return function(_0x581701){if(!_0x581701){_0x55c886[_0x9615('0x27')](0x194);}return _0x581701;};}function handleError(_0x4d72f2,_0x43fd35){_0x43fd35=_0x43fd35||0x1f4;return function(_0x3ea604){logger[_0x9615('0x28')](_0x3ea604['stack']);if(_0x3ea604[_0x9615('0x29')]){delete _0x3ea604[_0x9615('0x29')];}_0x4d72f2[_0x9615('0x1b')](_0x43fd35)[_0x9615('0x2a')](_0x3ea604);};}function getInteractionUsers(_0x593b6a,_0xe56a63){return new BPromise(function(_0x2693c8,_0x419061){try{if(_0xe56a63[_0x593b6a['id']]){_0x593b6a['Users']=_[_0x9615('0x2b')](_0xe56a63[_0x593b6a['id']],function(_0x1953a1){return{'id':_0x1953a1['id'],'fullname':_0x1953a1[_0x9615('0x2c')]};});}}catch(_0x14046a){_0x419061(_0x14046a);}_0x2693c8(_0x593b6a);});}function getInteractionTags(_0x1e3115,_0x29e69a){return new BPromise(function(_0x1599a3,_0x1e0e26){try{if(_0x1e3115[_0x9615('0x2d')]){_0x1e3115['Tags']=[];_0x1e3115['TagIds']['split'](',')['forEach'](function(_0x4a35b5){_0x1e3115[_0x9615('0x2e')][_0x9615('0x2f')](_0x29e69a[_0x4a35b5]);});}delete _0x1e3115[_0x9615('0x2d')];}catch(_0x5673c8){_0x1e0e26(_0x5673c8);}_0x1599a3(_0x1e3115);});}function updateFaxInteraction(_0x37a885,_0x21a4ff,_0x5e7674){return new BPromise(function(_0x2de6cd,_0x2cc1dc){return getInteractionUsers(_0x37a885,_0x5e7674)['then'](function(_0x3f0c31){return getInteractionTags(_0x3f0c31,_0x21a4ff);})['then'](function(_0x4d9ab5){return getStateInteraction(_0x4d9ab5);})[_0x9615('0x25')](function(_0x366c16){_0x2de6cd(_0x366c16);})[_0x9615('0x30')](function(_0x44bc5e){_0x2cc1dc(_0x44bc5e);});});}function getStateInteraction(_0x472ed8){return new BPromise(function(_0x41b63e){_0x472ed8['waiting']=0x0;_0x472ed8[_0x9615('0x31')]=0x0;_0x472ed8[_0x9615('0x32')]=0x0;_0x472ed8[_0x9615('0x33')]=0x0;_0x472ed8[_0x9615('0x34')]=0x0;if(!_0x472ed8[_0x9615('0x35')]&&!_0x472ed8['UserId']){_0x472ed8[_0x9615('0x36')]+=0x1;}if(!_0x472ed8[_0x9615('0x35')]&&_0x472ed8[_0x9615('0x37')]){_0x472ed8[_0x9615('0x31')]+=0x1;if(_0x472ed8[_0x9615('0x36')]){_0x472ed8[_0x9615('0x36')]-=0x1;}}if(_0x472ed8[_0x9615('0x35')]&&_0x472ed8['UserId']){_0x472ed8[_0x9615('0x32')]+=0x1;if(_0x472ed8['talking']){_0x472ed8[_0x9615('0x31')]-=0x1;}}if(_0x472ed8[_0x9615('0x35')]&&!_0x472ed8[_0x9615('0x37')]){_0x472ed8['unmanaged']+=0x1;if(_0x472ed8[_0x9615('0x36')]){_0x472ed8[_0x9615('0x36')]-=0x1;}}_0x472ed8[_0x9615('0x34')]+=0x1;_0x41b63e(_0x472ed8);});}exports[_0x9615('0x38')]=function(_0x509704,_0x2cf2b5){var _0x176f4a={},_0x9312d3={},_0x511bbd={'count':0x0,'rows':[]};var _0x225df7=_['map'](db['FaxInteraction'][_0x9615('0x39')],function(_0x36832a){return{'name':_0x36832a[_0x9615('0x3a')],'type':_0x36832a[_0x9615('0x3b')]['key']};});_0x9312d3[_0x9615('0x3c')]=_[_0x9615('0x2b')](_0x225df7,'name');_0x9312d3['query']=_['keys'](_0x509704[_0x9615('0x3d')]);_0x9312d3[_0x9615('0x3e')]=_[_0x9615('0x3f')](_0x9312d3[_0x9615('0x3c')],_0x9312d3[_0x9615('0x3d')]);_0x176f4a['attributes']=_[_0x9615('0x3f')](_0x9312d3['model'],qs['fields'](_0x509704[_0x9615('0x3d')][_0x9615('0x40')]));_0x176f4a['attributes']=_0x176f4a[_0x9615('0x41')][_0x9615('0x42')]?_0x176f4a[_0x9615('0x41')]:_0x9312d3[_0x9615('0x3c')];if(!_0x509704[_0x9615('0x3d')]['hasOwnProperty']('nolimit')){_0x176f4a[_0x9615('0x1e')]=qs['limit'](_0x509704['query']['limit']);_0x176f4a['offset']=qs['offset'](_0x509704['query'][_0x9615('0x1d')]);}_0x176f4a[_0x9615('0x43')]=qs[_0x9615('0x44')](_0x509704[_0x9615('0x3d')][_0x9615('0x44')]);_0x176f4a[_0x9615('0x45')]=qs['filters'](_[_0x9615('0x46')](_0x509704[_0x9615('0x3d')],_0x9312d3[_0x9615('0x3e')]),_0x225df7);var _0x52ea62=[];var _0x4512e9=squel['select']()[_0x9615('0x47')]('id')[_0x9615('0x47')](_0x9615('0x29'))[_0x9615('0x47')](_0x9615('0x48'))[_0x9615('0x49')](_0x9615('0x4a'));var _0x27b982=squel['select']()[_0x9615('0x47')](_0x9615('0x4b'))[_0x9615('0x47')](_0x9615('0x4c'))['field']('ui.FaxInteractionId')[_0x9615('0x49')](_0x9615('0x4d'),'ui')[_0x9615('0x4e')](_0x9615('0x4f'),'u',_0x9615('0x50'));var _0x259868=squel['select']()[_0x9615('0x49')](_0x9615('0x51'),'i')[_0x9615('0x4e')](_0x9615('0x52'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x9615('0x4e')]('users','o',_0x9615('0x53'))['left_join'](_0x9615('0x54'),'a','a.id\x20=\x20i.FaxAccountId')[_0x9615('0x4e')]('fax_messages','me',_0x9615('0x55'))[_0x9615('0x4e')]('fax_interaction_has_tags','it',_0x9615('0x56'))[_0x9615('0x4e')](_0x9615('0x4a'),'t',_0x9615('0x57'));var _0x236e4d=squel[_0x9615('0x58')]();var _0x55d29e=[];var _0x256876=squel[_0x9615('0x58')]();var _0x22713c;if(_0x509704[_0x9615('0x3d')]['search']){_0x22713c=as[_0x9615('0x59')](_0x509704['query'][_0x9615('0x5a')]);var _0x2ead27=_0x22713c[_0x9615('0x5b')];for(var _0x4656ea=0x0;_0x4656ea<_0x22713c[_0x9615('0x5c')][_0x9615('0x42')];_0x4656ea++){var _0x1a640b=_0x22713c[_0x9615('0x5c')][_0x4656ea];var _0x11c154='i';var _0x2420f1=_[_0x9615('0x5d')](_0x225df7,[_0x9615('0x29'),_0x1a640b[_0x9615('0x47')]]);if(!_0x2420f1){switch(_0x1a640b[_0x9615('0x47')]){case'unreadMessages':if(_0x1a640b[_0x9615('0x5e')]==0x1){_0x259868[_0x9615('0x5f')]('`'+_0x1a640b[_0x9615('0x47')]+_0x9615('0x60'));}else{_0x259868['having']('`'+_0x1a640b['field']+_0x9615('0x61'));}break;case _0x9615('0x62'):if(_0x1a640b[_0x9615('0x63')]===_0x9615('0x64')){if(_0x1a640b[_0x9615('0x5e')][_0x9615('0x65')]('\x20')[_0x9615('0x42')]>0x1){_0x236e4d[_0x2ead27](_0x9615('0x66'),qs[_0x9615('0x67')](_0x1a640b[_0x9615('0x5e')]),null);}else{var _0xb0291a='%'+_0x1a640b[_0x9615('0x5e')]+'%';_0x236e4d[_0x2ead27](_0x9615('0x68'),_0xb0291a,_0xb0291a,_0xb0291a);}}else{_0x2420f1=_[_0x9615('0x5d')](_0x225df7,['name',_0x9615('0x69')]);_0x1a640b[_0x9615('0x47')]=_0x9615('0x69');_0x4e9e06=as[_0x9615('0x6a')](_0x11c154,_0x2420f1['type'],_0x1a640b);_0x236e4d[_0x2ead27](_0x4e9e06[_0x9615('0x6b')],_0x4e9e06['value'][_0x9615('0x6c')],_0x4e9e06[_0x9615('0x5e')][_0x9615('0x26')]);}break;case _0x9615('0x6d'):var _0x50a789=_0x1a640b[_0x9615('0x5e')][_0x9615('0x65')](',')['map'](function(_0x1ac9d8){return Number(_0x1ac9d8);});_0x50a789[_0x9615('0x6e')](function(_0x4eeb2c){_0x256876['or'](_0x9615('0x6f'),'%,'+_0x4eeb2c+',%');});_0x55d29e=_[_0x9615('0x70')](_0x55d29e,_0x50a789);break;case'User':if(_0x1a640b[_0x9615('0x63')]==='$substring'){_0x236e4d[_0x2ead27]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x1a640b[_0x9615('0x5e')]+'%',null);}else{_0x2420f1=_[_0x9615('0x5d')](_0x225df7,[_0x9615('0x29'),_0x9615('0x37')]);_0x1a640b[_0x9615('0x47')]=_0x9615('0x37');_0x4e9e06=as[_0x9615('0x6a')](_0x11c154,_0x2420f1[_0x9615('0x3b')],_0x1a640b);_0x236e4d[_0x2ead27](_0x4e9e06['text'],_0x4e9e06[_0x9615('0x5e')][_0x9615('0x6c')],_0x4e9e06['value'][_0x9615('0x26')]);}break;case _0x9615('0x71'):_0x4e9e06=as[_0x9615('0x6a')]('me',null,_0x1a640b);_0x236e4d[_0x2ead27](_0x4e9e06['text'],_0x4e9e06[_0x9615('0x5e')][_0x9615('0x6c')],_0x4e9e06[_0x9615('0x5e')][_0x9615('0x26')]);break;}}else{var _0x4e9e06=as[_0x9615('0x6a')](_0x11c154,_0x2420f1[_0x9615('0x3b')],_0x1a640b);_0x236e4d[_0x2ead27](_0x4e9e06[_0x9615('0x6b')],_0x4e9e06['value']['start'],_0x4e9e06[_0x9615('0x5e')]['end']);}}}else{var _0x381c8b=_(_0x509704['query'])[_0x9615('0x72')]()['map'](function(_0xebe5bf){return _[_0x9615('0x73')](_0x225df7,[_0x9615('0x29'),_0xebe5bf])?_0xebe5bf:undefined;})['compact']()[_0x9615('0x5e')]();if(!_[_0x9615('0x74')](_0x381c8b)){_0x381c8b[_0x9615('0x6e')](function(_0x95a96a){if(_0x95a96a===_0x9615('0x75')){_0x259868[_0x9615('0x45')](_0x9615('0x76'),[][_0x9615('0x77')](_0x509704[_0x9615('0x3d')][_0x95a96a]));}else if(_0x95a96a===_0x9615('0x78')){var _0x1a0c6c=JSON[_0x9615('0x79')](_0x509704[_0x9615('0x3d')][_0x95a96a])[_0x9615('0x7a')];var _0x301517=JSON['parse'](_0x509704[_0x9615('0x3d')][_0x95a96a])[_0x9615('0x7b')];_0x259868[_0x9615('0x45')](_0x9615('0x7c'),_0x1a0c6c,_0x301517);}else{if(_0x509704[_0x9615('0x3d')][_0x95a96a]==='null'){_0x259868[_0x9615('0x45')]('i.'+_0x95a96a+'\x20IS\x20NULL');}else{_0x259868['where']('i.'+_0x95a96a+_0x9615('0x7d'),_0x509704[_0x9615('0x3d')][_0x95a96a]);}}});}if(_0x509704[_0x9615('0x3d')][_0x9615('0x7e')]){if(_0x509704['query']['read']==0x1){_0x259868[_0x9615('0x5f')](_0x9615('0x7f'));}else{_0x259868['having'](_0x9615('0x80'));}}if(_0x509704[_0x9615('0x3d')][_0x9615('0x81')]){_0x55d29e=_[_0x9615('0x82')](_0x509704[_0x9615('0x3d')][_0x9615('0x81')])?_0x509704[_0x9615('0x3d')][_0x9615('0x81')]:new Array(_0x509704[_0x9615('0x3d')][_0x9615('0x81')]);_0x55d29e[_0x9615('0x6e')](function(_0x1b7789){_0x256876['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1b7789+',%');});}if(_0x509704['query'][_0x9615('0x83')]){var _0x2e195d=_0x509704[_0x9615('0x3d')][_0x9615('0x83')]['replace']('\x5c','\x5c\x5c')[_0x9615('0x84')](/'/g,'\x27\x27');if(qs[_0x9615('0x85')](_0x2e195d)){_0x236e4d['or'](_0x9615('0x86'),_0x2e195d+'%')['or'](_0x9615('0x87'),_0x2e195d+'%');}_0x236e4d['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x2e195d+'%');}}_0x259868['where'](_0x236e4d);_0x259868[_0x9615('0x88')](_0x9615('0x89'));var _0x14192f={'type':db[_0x9615('0x8a')][_0x9615('0x8b')]['SELECT'],'raw':!![]};var _0x59fa24=_0x259868[_0x9615('0x8c')]();_0x59fa24[_0x9615('0x47')](_0x9615('0x89'));_0x59fa24['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x9615('0x8d'));if(_0x176f4a[_0x9615('0x43')]){_0x176f4a['order'][_0x9615('0x6e')](function(_0x41692e){var _0x59dfc2=_0x41692e[0x0]===_0x9615('0x8e')?_0x41692e[0x0]:'i.'+_0x41692e[0x0];_0x259868[_0x9615('0x43')](_0x59dfc2,_0x41692e[0x1]===_0x9615('0x8f')?![]:!![]);});}if(!_['isEmpty'](_0x55d29e)){_0x259868['having'](_0x256876);_0x59fa24[_0x9615('0x45')](_0x9615('0x90'),_0x55d29e);}BPromise[_0x9615('0x91')]()[_0x9615('0x25')](function(){if(!_0x22713c){if(_0x509704['query'][_0x9615('0x75')])return;_0x59fa24[_0x9615('0x45')](_0x9615('0x92'));_0x259868['where'](_0x9615('0x92'));return;}if(_0x509704['user'][_0x9615('0x93')]!==_0x9615('0x94'))return;return _0x509704[_0x9615('0x95')][_0x9615('0x96')]({'attributes':['id'],'raw':!![]})[_0x9615('0x25')](function(_0xb1ac6c){if(_[_0x9615('0x74')](_0xb1ac6c)){_0x59fa24[_0x9615('0x45')](_0x9615('0x97'));_0x259868[_0x9615('0x45')](_0x9615('0x97'));}else{_0x59fa24[_0x9615('0x45')](_0x9615('0x76'),_[_0x9615('0x2b')](_0xb1ac6c,'id'));_0x259868[_0x9615('0x45')]('i.FaxAccountId\x20IN\x20?',_[_0x9615('0x2b')](_0xb1ac6c,'id'));}});})[_0x9615('0x25')](function(){if(_0x509704[_0x9615('0x95')][_0x9615('0x93')]==='agent'&&!_0x22713c&&!_0x509704[_0x9615('0x3d')]['FaxAccountId'])return[];return db[_0x9615('0x98')]['query'](_0x59fa24[_0x9615('0x99')](),_0x14192f);})['then'](function(_0x4530d4){_0x511bbd[_0x9615('0x1f')]=_0x4530d4['length'];if(_0x511bbd[_0x9615('0x1f')]===0x0)return[];return db[_0x9615('0x98')]['query'](_0x4512e9[_0x9615('0x99')](),_0x14192f)[_0x9615('0x25')](function(_0x3caaea){_0x52ea62=_[_0x9615('0x9a')](_0x3caaea,'id');_0x14192f=_['merge'](_0x14192f,{'model':db[_0x9615('0x9b')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x509704[_0x9615('0x3d')][_0x9615('0x40')]){_0x176f4a['attributes'][_0x9615('0x6e')](function(_0x3cc4d7){_0x259868[_0x9615('0x47')]('i.'+_0x3cc4d7);});}else{_0x259868[_0x9615('0x47')](_0x9615('0x9c'),_0x9615('0x8d'));_0x259868[_0x9615('0x47')](_0x9615('0x9d'),_0x9615('0x9e'));_0x259868[_0x9615('0x47')](_0x9615('0x9f'),_0x9615('0xa0'));_0x259868[_0x9615('0x47')](_0x9615('0xa1'),_0x9615('0x8e'));_0x259868[_0x9615('0x47')](_0x9615('0xa2'));_0x259868[_0x9615('0x47')](_0x9615('0xa3'),_0x9615('0xa4'));_0x259868[_0x9615('0x47')](_0x9615('0xa5'),_0x9615('0xa6'));_0x259868['field']('c.email',_0x9615('0xa7'));_0x259868['field'](_0x9615('0xa8'),_0x9615('0xa9'));_0x259868['field'](_0x9615('0xaa'),'Contact.mobile');_0x259868[_0x9615('0x47')](_0x9615('0xab'),_0x9615('0xac'));_0x259868['field']('o.fullname',_0x9615('0xad'));_0x259868[_0x9615('0x47')](_0x9615('0xae'),_0x9615('0xaf'));_0x259868[_0x9615('0x47')](_0x9615('0xb0'),_0x9615('0x2d'));}if(_0x176f4a[_0x9615('0x1e')])_0x259868[_0x9615('0x1e')](_0x176f4a['limit']);if(_0x176f4a[_0x9615('0x1d')])_0x259868['offset'](_0x176f4a[_0x9615('0x1d')]);return db[_0x9615('0x98')][_0x9615('0x3d')](_0x259868[_0x9615('0x99')](),_0x14192f);})[_0x9615('0x25')](function(_0x54f79d){if(_0x54f79d[_0x9615('0x42')]>0x0)_0x27b982['where'](_0x9615('0xb1'),_[_0x9615('0x2b')](_0x54f79d,'id'));return db[_0x9615('0x98')]['query'](_0x27b982[_0x9615('0x99')](),_0x14192f)[_0x9615('0x25')](function(_0x36b1e5){var _0x5419b4=_['groupBy'](_0x36b1e5,_0x9615('0xb2'));var _0x4b51f4=[];_0x54f79d['forEach'](function(_0x4ad851){_0x4b51f4[_0x9615('0x2f')](updateFaxInteraction(_0x4ad851,_0x52ea62,_0x5419b4));});return BPromise[_0x9615('0xb3')](_0x4b51f4);});});})[_0x9615('0x25')](function(_0x5c0b9e){_0x511bbd['rows']=_0x5c0b9e;return _0x511bbd;})[_0x9615('0x25')](respondWithFilteredResult(_0x2cf2b5,_0x176f4a))[_0x9615('0x30')](handleError(_0x2cf2b5,null));};exports[_0x9615('0xb4')]=function(_0x2c22f0,_0x5d52a8){var _0xfe02a5={'raw':![],'where':{'id':_0x2c22f0['params']['id']}},_0x524395={};_0x524395[_0x9615('0x3c')]=_[_0x9615('0x72')](db[_0x9615('0x9b')][_0x9615('0x39')]);_0x524395[_0x9615('0x3d')]=_['keys'](_0x2c22f0[_0x9615('0x3d')]);_0x524395['filters']=_[_0x9615('0x3f')](_0x524395[_0x9615('0x3c')],_0x524395[_0x9615('0x3d')]);_0xfe02a5[_0x9615('0x41')]=_[_0x9615('0x3f')](_0x524395['model'],qs['fields'](_0x2c22f0[_0x9615('0x3d')][_0x9615('0x40')]));_0xfe02a5[_0x9615('0x41')]=_0xfe02a5['attributes'][_0x9615('0x42')]?_0xfe02a5[_0x9615('0x41')]:_0x524395[_0x9615('0x3c')];if(_0x2c22f0[_0x9615('0x3d')][_0x9615('0xb5')]){_0xfe02a5[_0x9615('0xb6')]=[{'all':!![]}];}_0xfe02a5=_[_0x9615('0xb7')]({},_0xfe02a5,_0x2c22f0[_0x9615('0xb8')]);return db[_0x9615('0x9b')][_0x9615('0x5d')](_0xfe02a5)[_0x9615('0x25')](handleEntityNotFound(_0x5d52a8,null))[_0x9615('0x25')](respondWithResult(_0x5d52a8,null))['catch'](handleError(_0x5d52a8,null));};exports[_0x9615('0xb9')]=function(_0xc4ec36,_0x3d5d07){return db[_0x9615('0x9b')][_0x9615('0xb9')](_0xc4ec36[_0x9615('0x71')],{})[_0x9615('0x25')](respondWithResult(_0x3d5d07,0xc9))[_0x9615('0x30')](handleError(_0x3d5d07,null));};exports['update']=function(_0x17576c,_0xb4b3ef){if(_0x17576c[_0x9615('0x71')]['id']){delete _0x17576c[_0x9615('0x71')]['id'];}return db[_0x9615('0x9b')][_0x9615('0x5d')]({'where':{'id':_0x17576c[_0x9615('0xba')]['id']}})[_0x9615('0x25')](handleEntityNotFound(_0xb4b3ef,null))[_0x9615('0x25')](saveUpdates(_0x17576c[_0x9615('0x71')],null))[_0x9615('0x25')](respondWithResult(_0xb4b3ef,null))['catch'](handleError(_0xb4b3ef,null));};exports['destroy']=function(_0x2b6721,_0x475d5b){return db[_0x9615('0x9b')][_0x9615('0x5d')]({'where':{'id':_0x2b6721['params']['id']}})[_0x9615('0x25')](handleEntityNotFound(_0x475d5b,null))[_0x9615('0x25')](removeEntity(_0x475d5b,null))[_0x9615('0x30')](handleError(_0x475d5b,null));};exports[_0x9615('0xbb')]=function(_0x56a42a,_0x196e05){return db[_0x9615('0x9b')][_0x9615('0xbb')]()['then'](respondWithResult(_0x196e05,null))[_0x9615('0x30')](handleError(_0x196e05,null));};exports[_0x9615('0xbc')]=function(_0x3c80d1,_0x470c46,_0x27a9d6){return db[_0x9615('0xbd')][_0x9615('0x5d')]({'where':{'id':_0x3c80d1['params']['id']}})[_0x9615('0x25')](handleEntityNotFound(_0x470c46,null))[_0x9615('0x25')](function(_0x49a010){if(_0x49a010){return _0x49a010[_0x9615('0xbc')](_0x3c80d1[_0x9615('0x71')][_0x9615('0xbe')],_[_0x9615('0xbf')](_0x3c80d1['body'],[_0x9615('0xbe'),'id'])||{});}})[_0x9615('0x25')](respondWithResult(_0x470c46,null))[_0x9615('0x30')](handleError(_0x470c46,null));};exports[_0x9615('0xc0')]=function(_0x555bdf,_0x1f0f8a,_0xfcf365){var _0x39280b={'raw':![],'where':{}};var _0x57985f={};var _0x2e05d6={'count':0x0,'rows':[]};return db[_0x9615('0x9b')]['findOne']({'where':{'id':_0x555bdf['params']['id']}})[_0x9615('0x25')](handleEntityNotFound(_0x1f0f8a,null))['then'](function(_0x1a134b){if(_0x1a134b){_0x57985f[_0x9615('0x3c')]=_[_0x9615('0x72')](db[_0x9615('0xbd')][_0x9615('0x39')]);_0x57985f[_0x9615('0x3d')]=_[_0x9615('0x72')](_0x555bdf[_0x9615('0x3d')]);_0x57985f[_0x9615('0x3e')]=_[_0x9615('0x3f')](_0x57985f[_0x9615('0x3c')],_0x57985f['query']);_0x39280b[_0x9615('0x41')]=_[_0x9615('0x3f')](_0x57985f['model'],qs[_0x9615('0x40')](_0x555bdf[_0x9615('0x3d')]['fields']));_0x39280b[_0x9615('0x41')]=_0x39280b['attributes']['length']?_0x39280b[_0x9615('0x41')]:_0x57985f[_0x9615('0x3c')];if(!_0x555bdf[_0x9615('0x3d')][_0x9615('0xc1')](_0x9615('0xc2'))){_0x39280b['limit']=qs['limit'](_0x555bdf[_0x9615('0x3d')][_0x9615('0x1e')]);_0x39280b[_0x9615('0x1d')]=qs[_0x9615('0x1d')](_0x555bdf['query']['offset']);}_0x39280b[_0x9615('0x43')]=qs[_0x9615('0x44')](_0x555bdf[_0x9615('0x3d')]['sort']);_0x39280b['where']=qs[_0x9615('0x3e')](_[_0x9615('0x46')](_0x555bdf[_0x9615('0x3d')],_0x57985f[_0x9615('0x3e')]));_0x39280b[_0x9615('0x45')][_0x9615('0xb2')]=_0x1a134b['id'];if(_0x555bdf[_0x9615('0x3d')]['filter']){_0x39280b['where']=_['merge'](_0x39280b[_0x9615('0x45')],{'$or':_['map'](_0x39280b[_0x9615('0x41')],function(_0x1b110e){var _0x110716={};_0x110716[_0x1b110e]={'$like':'%'+_0x555bdf[_0x9615('0x3d')][_0x9615('0x83')]+'%'};return _0x110716;})});}if(_0x555bdf[_0x9615('0x3d')][_0x9615('0x7a')]){var _0x3d2c6d=_0x555bdf[_0x9615('0x3d')][_0x9615('0x7a')][_0x9615('0x65')](',');var _0x37aa8d={};_0x37aa8d[_0x3d2c6d[0x0]]={'$gte':moment(_0x3d2c6d[0x1])[_0x9615('0xc3')]('YYYY-MM-DD\x20HH:mm:ss')};_0x39280b[_0x9615('0x45')]=_[_0x9615('0xb7')](_0x39280b[_0x9615('0x45')],_0x37aa8d);}_0x39280b=_['merge']({},_0x39280b,_0x555bdf['options']);return db['FaxMessage'][_0x9615('0x1f')]({'where':_0x39280b[_0x9615('0x45')]})[_0x9615('0x25')](function(_0x212d31){_0x2e05d6[_0x9615('0x1f')]=_0x212d31;if(_0x555bdf[_0x9615('0x3d')]['includeAll']){_0x39280b['include']=[{'all':!![]}];}return db[_0x9615('0xbd')][_0x9615('0xc4')](_0x39280b);})[_0x9615('0x25')](function(_0x2bf485){_0x2e05d6[_0x9615('0xc5')]=_0x2bf485;return _0x2e05d6;});}})[_0x9615('0x25')](respondWithFilteredResult(_0x1f0f8a,_0x39280b))['catch'](handleError(_0x1f0f8a,null));};exports[_0x9615('0xc6')]=function(_0x10c45f,_0x4c0b25,_0x3d7547){return db[_0x9615('0x9b')][_0x9615('0x5d')]({'where':{'id':_0x10c45f[_0x9615('0xba')]['id']}})[_0x9615('0x25')](handleEntityNotFound(_0x4c0b25,null))['then'](function(_0x3015dc){if(_0x3015dc){return _0x3015dc[_0x9615('0xc7')](_0x10c45f[_0x9615('0x71')][_0x9615('0xbe')],_[_0x9615('0xbf')](_0x10c45f[_0x9615('0x71')],[_0x9615('0xbe'),'id'])||{})['spread'](function(){return db[_0x9615('0x6d')][_0x9615('0xc4')]({'attributes':['id',_0x9615('0x29'),_0x9615('0x48')],'where':{'id':_0x10c45f['body']['ids']}});})[_0x9615('0x25')](function(_0x119ad6){socket['emit']('faxInteractionTags:save',{'id':Number(_0x10c45f['params']['id']),'tags':_0x119ad6||[]});return{'id':Number(_0x10c45f[_0x9615('0xba')]['id']),'tags':_0x119ad6||[]};});}})[_0x9615('0x25')](respondWithResult(_0x4c0b25,null))[_0x9615('0x30')](handleError(_0x4c0b25,null));};exports['removeTags']=function(_0xfa078,_0x3ca009,_0x572507){return db[_0x9615('0x9b')]['find']({'where':{'id':_0xfa078[_0x9615('0xba')]['id']}})[_0x9615('0x25')](handleEntityNotFound(_0x3ca009,null))['then'](function(_0x5c0afc){if(_0x5c0afc){return _0x5c0afc['removeTags'](_0xfa078[_0x9615('0x3d')][_0x9615('0xbe')]);}})[_0x9615('0x25')](respondWithStatusCode(_0x3ca009,null))[_0x9615('0x30')](handleError(_0x3ca009,null));};exports['download']=function(_0x7d1dbf,_0x29755a){var _0x32a634=moment()[_0x9615('0xc8')]()[_0x9615('0x99')]();var _0x1aa113=path[_0x9615('0xc9')](config[_0x9615('0xca')],_0x9615('0xcb'),_0x9615('0xcc'),_0x9615('0xcd'));var _0x318932=path[_0x9615('0xc9')](config[_0x9615('0xca')],_0x9615('0xcb'),_0x9615('0xcc'),_0x9615('0xce'));var _0xc85627=path[_0x9615('0xc9')](_0x1aa113,_0x32a634);var _0x225cab=util[_0x9615('0xc3')](_0x9615('0xcf'),_0x7d1dbf[_0x9615('0xba')]['id'],_0x32a634);var _0x53c4ee=path[_0x9615('0xc9')](_0x1aa113,_0x225cab);var _0x26a53b=[];_0x26a53b[_0x9615('0x2f')]({'model':db['Attachment'],'as':_0x9615('0xd0'),'raw':!![]});var _0x48d1a9=[{'model':db['FaxMessage'],'as':_0x9615('0xd1'),'attributes':['id',_0x9615('0x71'),_0x9615('0x78')],'include':_0x26a53b}];return db['FaxInteraction']['find']({'where':{'id':_0x7d1dbf['params']['id']},'include':_0x48d1a9})[_0x9615('0x25')](handleEntityNotFound(_0x29755a,null))[_0x9615('0x25')](function(_0x3f222f){if(_0x3f222f&&_0x3f222f[_0x9615('0xd1')]){var _0x2e6caa=_0x3f222f['get']({'plain':!![]});fs[_0x9615('0xd2')](_0xc85627);for(var _0x2e2899=0x0;_0x2e2899<_0x2e6caa[_0x9615('0xd1')]['length'];_0x2e2899++){var _0x2bee82=_0x2e6caa['Messages'][_0x2e2899][_0x9615('0xd0')];if(_0x2bee82){var _0x660e3e=path[_0x9615('0xc9')](_0x318932,_0x2bee82['basename']);if(fs['existsSync'](_0x660e3e)){fs[_0x9615('0xd3')](_0x660e3e)[_0x9615('0xd4')](fs[_0x9615('0xd5')](path['join'](_0xc85627,_0x2bee82[_0x9615('0xd6')])));}}}return BPromise['resolve']()[_0x9615('0x25')](function(){return new BPromise(function(_0x4ca4f6,_0x5d139c){zipdir(_0xc85627,{'saveTo':_0x53c4ee},function(_0x2570e6,_0x5f1509){if(_0x2570e6)return _0x5d139c(_0x2570e6);return _0x4ca4f6(_0x5f1509);});})[_0x9615('0x25')](function(){return new BPromise(function(_0x14d22d,_0x26723f){rimraf(_0xc85627,function(_0x548da1){if(_0x548da1)_0x26723f(_0x548da1);return _0x14d22d();});});})[_0x9615('0x25')](function(){return _0x29755a[_0x9615('0xd7')](_0x53c4ee,_0x225cab,function(_0x1914f){if(_0x1914f){console['log']('err',_0x1914f);}else{fs[_0x9615('0xd8')](_0x53c4ee);}});});});}else{return _0x29755a['sendStatus'](0xc8);}})['catch'](handleError(_0x29755a,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index fdf5023..231b555 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 _0x7a22=['setDataValue','Users','map','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','FaxMessage','save','update','then'];(function(_0x2d7334,_0x2a9437){var _0xd20a84=function(_0x15ccc3){while(--_0x15ccc3){_0x2d7334['push'](_0x2d7334['shift']());}};_0xd20a84(++_0x2a9437);}(_0x7a22,0x81));var _0x27a2=function(_0x5d6d68,_0x7d9d49){_0x5d6d68=_0x5d6d68-0x0;var _0x273277=_0x7a22[_0x5d6d68];return _0x273277;};'use strict';var EventEmitter=require(_0x27a2('0x0'));var FaxInteraction=require(_0x27a2('0x1'))['db'][_0x27a2('0x2')];var FaxMessage=require(_0x27a2('0x1'))['db'][_0x27a2('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x27a2('0x4'),'afterUpdate':_0x27a2('0x5'),'afterDestroy':'remove'};function emitEvent(_0x44055a){return function(_0x469c06,_0x275a60,_0xce3077){_0x469c06['getUsers']({'attributes':['id'],'raw':!![]})[_0x27a2('0x6')](function(_0x4e5c83){_0x469c06[_0x27a2('0x7')](_0x27a2('0x8'),_0x4e5c83[_0x27a2('0x9')](function(_0x2979bd){return{'id':_0x2979bd['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x469c06['id'],'direction':'in','read':![]},'raw':!![]});})[_0x27a2('0x6')](function(_0x5310a4){_0x469c06[_0x27a2('0x7')](_0x27a2('0xa'),_0x5310a4[_0x27a2('0xb')]);FaxInteractionEvents[_0x27a2('0xc')](_0x44055a+':'+_0x469c06['id'],_0x469c06);FaxInteractionEvents[_0x27a2('0xc')](_0x44055a,_0x469c06);_0xce3077(null);})[_0x27a2('0xd')](_0xce3077(null));};}for(var e in events){if(events[_0x27a2('0xe')](e)){var event=events[e];FaxInteraction[_0x27a2('0xf')](e,emitEvent(event));}}module[_0x27a2('0x10')]=FaxInteractionEvents; \ No newline at end of file +var _0xe26d=['update','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','emit','catch','hasOwnProperty','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save'];(function(_0x312a97,_0x2fba4a){var _0x85f4de=function(_0x42598f){while(--_0x42598f){_0x312a97['push'](_0x312a97['shift']());}};_0x85f4de(++_0x2fba4a);}(_0xe26d,0x82));var _0xde26=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe26d[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0xde26('0x0'));var FaxInteraction=require(_0xde26('0x1'))['db'][_0xde26('0x2')];var FaxMessage=require(_0xde26('0x1'))['db'][_0xde26('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xde26('0x4')](0x0);var events={'afterCreate':_0xde26('0x5'),'afterUpdate':_0xde26('0x6'),'afterDestroy':'remove'};function emitEvent(_0x42cec7){return function(_0xaac878,_0x7f5592,_0xb60096){_0xaac878[_0xde26('0x7')]({'attributes':['id'],'raw':!![]})[_0xde26('0x8')](function(_0x1ef6fa){_0xaac878['setDataValue'](_0xde26('0x9'),_0x1ef6fa[_0xde26('0xa')](function(_0x5ee876){return{'id':_0x5ee876['id']};}));return FaxMessage[_0xde26('0xb')]({'where':{'FaxInteractionId':_0xaac878['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3ea700){_0xaac878[_0xde26('0xc')](_0xde26('0xd'),_0x3ea700['length']);FaxInteractionEvents[_0xde26('0xe')](_0x42cec7+':'+_0xaac878['id'],_0xaac878);FaxInteractionEvents[_0xde26('0xe')](_0x42cec7,_0xaac878);_0xb60096(null);})[_0xde26('0xf')](_0xb60096(null));};}for(var e in events){if(events[_0xde26('0x10')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index d628ed0..da873b7 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 _0xe824=['moment','bluebird','request-promise','path','rimraf','./faxInteraction.attributes','exports','fax_interactions','format','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe824,0x1c2));var _0x4e82=function(_0x3305de,_0x16582f){_0x3305de=_0x3305de-0x0;var _0x3b5a84=_0xe824[_0x3305de];return _0x3b5a84;};'use strict';var _=require(_0x4e82('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x4e82('0x1'));var BPromise=require(_0x4e82('0x2'));var rp=require(_0x4e82('0x3'));var fs=require('fs');var path=require(_0x4e82('0x4'));var rimraf=require(_0x4e82('0x5'));var config=require('../../config/environment');var attributes=require(_0x4e82('0x6'));module[_0x4e82('0x7')]=function(_0x31f854,_0x302c75){return _0x31f854['define']('FaxInteraction',attributes,{'tableName':_0x4e82('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2e38bd,_0x194857,_0x3c9aa7){if(_0x2e38bd['changed']('closed')){_0x2e38bd['closedAt']=moment()[_0x4e82('0x9')](_0x4e82('0xa'));}_0x3c9aa7(null,_0x2e38bd);}}});}; \ No newline at end of file +var _0xafe6=['exports','define','FaxInteraction','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./faxInteraction.attributes'];(function(_0x43f0cc,_0xc321d3){var _0x219583=function(_0x20e554){while(--_0x20e554){_0x43f0cc['push'](_0x43f0cc['shift']());}};_0x219583(++_0xc321d3);}(_0xafe6,0xa7));var _0x6afe=function(_0x301261,_0x315717){_0x301261=_0x301261-0x0;var _0x168ffb=_0xafe6[_0x301261];return _0x168ffb;};'use strict';var _=require(_0x6afe('0x0'));var util=require(_0x6afe('0x1'));var logger=require(_0x6afe('0x2'))(_0x6afe('0x3'));var moment=require(_0x6afe('0x4'));var BPromise=require('bluebird');var rp=require(_0x6afe('0x5'));var fs=require('fs');var path=require(_0x6afe('0x6'));var rimraf=require(_0x6afe('0x7'));var config=require('../../config/environment');var attributes=require(_0x6afe('0x8'));module[_0x6afe('0x9')]=function(_0x2ee036,_0x1e9e7c){return _0x2ee036[_0x6afe('0xa')](_0x6afe('0xb'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x9a5bfe,_0x246bd2,_0x4b82ee){if(_0x9a5bfe[_0x6afe('0xc')](_0x6afe('0xd'))){_0x9a5bfe['closedAt']=moment()[_0x6afe('0xe')](_0x6afe('0xf'));}_0x4b82ee(null,_0x9a5bfe);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 7fe99c8..83676ae 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 _0x2cf1=['rpc','client','http','redis','defaults','localhost','./faxInteraction.socket','request','then','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','FaxInteraction,\x20%s,\x20%s','message','info','result','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','attributes','catch','AddTagsToFaxInteraction','find','where','ids','spread','AddTags','util','moment','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x2cf1,0x150));var _0x12cf=function(_0x260f12,_0x3c724c){_0x260f12=_0x260f12-0x0;var _0x8b758b=_0x2cf1[_0x260f12];return _0x8b758b;};'use strict';var _=require('lodash');var util=require(_0x12cf('0x0'));var moment=require(_0x12cf('0x1'));var BPromise=require('bluebird');var rs=require(_0x12cf('0x2'));var fs=require('fs');var Redis=require(_0x12cf('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x12cf('0x4'));var logger=require(_0x12cf('0x5'))(_0x12cf('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x12cf('0x7')][_0x12cf('0x8')]({'port':0x232a});config[_0x12cf('0x9')]=_[_0x12cf('0xa')](config[_0x12cf('0x9')],{'host':_0x12cf('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x12cf('0x9')]));require(_0x12cf('0xc'))['register'](socket);function respondWithRpcPromise(_0x4b9f26,_0x22ed13,_0x28cd2d){return new BPromise(function(_0x57311a,_0x286591){return client[_0x12cf('0xd')](_0x4b9f26,_0x28cd2d)[_0x12cf('0xe')](function(_0x409f5d){logger['info']('FaxInteraction,\x20%s,\x20%s',_0x22ed13,_0x12cf('0xf'));logger[_0x12cf('0x10')](_0x12cf('0x11'),_0x22ed13,_0x12cf('0xf'),JSON[_0x12cf('0x12')](_0x409f5d));if(_0x409f5d[_0x12cf('0x13')]){if(_0x409f5d[_0x12cf('0x13')]['code']===0x1f4){logger['error'](_0x12cf('0x14'),_0x22ed13,_0x409f5d[_0x12cf('0x13')][_0x12cf('0x15')]);return _0x286591(_0x409f5d[_0x12cf('0x13')][_0x12cf('0x15')]);}logger[_0x12cf('0x13')](_0x12cf('0x14'),_0x22ed13,_0x409f5d[_0x12cf('0x13')][_0x12cf('0x15')]);return _0x57311a(_0x409f5d[_0x12cf('0x13')]['message']);}else{logger[_0x12cf('0x16')]('FaxInteraction,\x20%s,\x20%s',_0x22ed13,_0x12cf('0xf'));_0x57311a(_0x409f5d[_0x12cf('0x17')][_0x12cf('0x15')]);}})['catch'](function(_0x20d564){logger[_0x12cf('0x13')](_0x12cf('0x14'),_0x22ed13,_0x20d564);_0x286591(_0x20d564);});});}exports[_0x12cf('0x18')]=function(_0x1acb04){var _0x461f4f=this;return new Promise(function(_0x58bef9,_0x52bf68){return db[_0x12cf('0x19')][_0x12cf('0x1a')](_0x1acb04[_0x12cf('0x1b')],{'raw':_0x1acb04[_0x12cf('0x1c')]?_0x1acb04[_0x12cf('0x1c')][_0x12cf('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1acb04[_0x12cf('0x1c')]?_0x1acb04[_0x12cf('0x1c')]['where']||null:null,'attributes':_0x1acb04[_0x12cf('0x1c')]?_0x1acb04[_0x12cf('0x1c')][_0x12cf('0x1e')]||null:null,'limit':_0x1acb04[_0x12cf('0x1c')]?_0x1acb04[_0x12cf('0x1c')]['limit']||null:null})[_0x12cf('0xe')](function(_0x12bbce){logger['info'](_0x12cf('0x18'),_0x1acb04);logger['debug'](_0x12cf('0x18'),_0x1acb04,JSON[_0x12cf('0x12')](_0x12bbce));_0x58bef9(_0x12bbce);})[_0x12cf('0x1f')](function(_0x4062b0){logger[_0x12cf('0x13')](_0x12cf('0x18'),_0x4062b0[_0x12cf('0x15')],_0x1acb04);_0x52bf68(_0x461f4f[_0x12cf('0x13')](0x1f4,_0x4062b0['message']));});});};exports[_0x12cf('0x20')]=function(_0x210427){return new Promise(function(_0x81aaa5,_0xaa4925){return db[_0x12cf('0x19')][_0x12cf('0x21')]({'where':_0x210427[_0x12cf('0x1c')]?_0x210427['options'][_0x12cf('0x22')]||null:null})['then'](function(_0xdc70fb){if(_0xdc70fb){return _0xdc70fb['addTags'](_0x210427[_0x12cf('0x1b')][_0x12cf('0x23')],_['omit'](_0x210427[_0x12cf('0x1b')],['ids','id'])||{});}})[_0x12cf('0x24')](function(_0x176477){logger[_0x12cf('0x16')](_0x12cf('0x25'),_0x210427);logger[_0x12cf('0x10')](_0x12cf('0x25'),_0x210427,JSON[_0x12cf('0x12')](_0x176477));_0x81aaa5(_0x176477);})[_0x12cf('0x1f')](function(_0x54dc89){logger[_0x12cf('0x13')](_0x12cf('0x25'),_0x54dc89[_0x12cf('0x15')],_0x210427);_0xaa4925(_this[_0x12cf('0x13')](0x1f4,_0x54dc89[_0x12cf('0x15')]));});});}; \ No newline at end of file +var _0xef8d=['./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','limit','stringify','AddTagsToFaxInteraction','where','addTags','ids','omit','spread','AddTags','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','localhost','redis'];(function(_0x44f612,_0x53bac7){var _0x499a50=function(_0x52a85e){while(--_0x52a85e){_0x44f612['push'](_0x44f612['shift']());}};_0x499a50(++_0x53bac7);}(_0xef8d,0x1a0));var _0xdef8=function(_0x6c59fc,_0x5fe88d){_0x6c59fc=_0x6c59fc-0x0;var _0x17c96f=_0xef8d[_0x6c59fc];return _0x17c96f;};'use strict';var _=require(_0xdef8('0x0'));var util=require('util');var moment=require(_0xdef8('0x1'));var BPromise=require('bluebird');var rs=require(_0xdef8('0x2'));var fs=require('fs');var Redis=require(_0xdef8('0x3'));var db=require(_0xdef8('0x4'))['db'];var utils=require(_0xdef8('0x5'));var logger=require(_0xdef8('0x6'))(_0xdef8('0x7'));var config=require(_0xdef8('0x8'));var jayson=require(_0xdef8('0x9'));var client=jayson[_0xdef8('0xa')]['http']({'port':0x232a});config['redis']=_[_0xdef8('0xb')](config['redis'],{'host':_0xdef8('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdef8('0xd')]));require(_0xdef8('0xe'))[_0xdef8('0xf')](socket);function respondWithRpcPromise(_0x461513,_0x3f10a0,_0x50315b){return new BPromise(function(_0x21b951,_0x175246){return client[_0xdef8('0x10')](_0x461513,_0x50315b)[_0xdef8('0x11')](function(_0x1fa8c2){logger[_0xdef8('0x12')](_0xdef8('0x13'),_0x3f10a0,_0xdef8('0x14'));logger[_0xdef8('0x15')](_0xdef8('0x16'),_0x3f10a0,_0xdef8('0x14'),JSON['stringify'](_0x1fa8c2));if(_0x1fa8c2[_0xdef8('0x17')]){if(_0x1fa8c2[_0xdef8('0x17')][_0xdef8('0x18')]===0x1f4){logger[_0xdef8('0x17')](_0xdef8('0x13'),_0x3f10a0,_0x1fa8c2[_0xdef8('0x17')]['message']);return _0x175246(_0x1fa8c2['error'][_0xdef8('0x19')]);}logger['error']('FaxInteraction,\x20%s,\x20%s',_0x3f10a0,_0x1fa8c2[_0xdef8('0x17')][_0xdef8('0x19')]);return _0x21b951(_0x1fa8c2[_0xdef8('0x17')][_0xdef8('0x19')]);}else{logger[_0xdef8('0x12')](_0xdef8('0x13'),_0x3f10a0,_0xdef8('0x14'));_0x21b951(_0x1fa8c2[_0xdef8('0x1a')]['message']);}})[_0xdef8('0x1b')](function(_0x3b3807){logger[_0xdef8('0x17')](_0xdef8('0x13'),_0x3f10a0,_0x3b3807);_0x175246(_0x3b3807);});});}exports[_0xdef8('0x1c')]=function(_0x408bd7){var _0x4bc7cb=this;return new Promise(function(_0x126086,_0x1c228d){return db[_0xdef8('0x1d')][_0xdef8('0x1e')](_0x408bd7[_0xdef8('0x1f')],{'raw':_0x408bd7[_0xdef8('0x20')]?_0x408bd7[_0xdef8('0x20')][_0xdef8('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x408bd7[_0xdef8('0x20')]?_0x408bd7[_0xdef8('0x20')]['where']||null:null,'attributes':_0x408bd7[_0xdef8('0x20')]?_0x408bd7[_0xdef8('0x20')]['attributes']||null:null,'limit':_0x408bd7[_0xdef8('0x20')]?_0x408bd7['options'][_0xdef8('0x22')]||null:null})[_0xdef8('0x11')](function(_0x4bf800){logger['info'](_0xdef8('0x1c'),_0x408bd7);logger[_0xdef8('0x15')](_0xdef8('0x1c'),_0x408bd7,JSON[_0xdef8('0x23')](_0x4bf800));_0x126086(_0x4bf800);})['catch'](function(_0x4ec77d){logger[_0xdef8('0x17')](_0xdef8('0x1c'),_0x4ec77d['message'],_0x408bd7);_0x1c228d(_0x4bc7cb['error'](0x1f4,_0x4ec77d[_0xdef8('0x19')]));});});};exports[_0xdef8('0x24')]=function(_0x5db575){return new Promise(function(_0x2c32c0,_0x2a9023){return db['FaxInteraction']['find']({'where':_0x5db575[_0xdef8('0x20')]?_0x5db575[_0xdef8('0x20')][_0xdef8('0x25')]||null:null})[_0xdef8('0x11')](function(_0x120c29){if(_0x120c29){return _0x120c29[_0xdef8('0x26')](_0x5db575[_0xdef8('0x1f')][_0xdef8('0x27')],_[_0xdef8('0x28')](_0x5db575[_0xdef8('0x1f')],['ids','id'])||{});}})[_0xdef8('0x29')](function(_0x1abedf){logger[_0xdef8('0x12')]('AddTags',_0x5db575);logger[_0xdef8('0x15')](_0xdef8('0x2a'),_0x5db575,JSON[_0xdef8('0x23')](_0x1abedf));_0x2c32c0(_0x1abedf);})[_0xdef8('0x1b')](function(_0xcda2a1){logger[_0xdef8('0x17')](_0xdef8('0x2a'),_0xcda2a1['message'],_0x5db575);_0x2a9023(_this[_0xdef8('0x17')](0x1f4,_0xcda2a1[_0xdef8('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 9277232..e9f210d 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 _0x4fcf=['faxInteraction:','save','remove','emit','removeListener','register','length'];(function(_0x59dd10,_0x1ae3d1){var _0x43238e=function(_0xa6e304){while(--_0xa6e304){_0x59dd10['push'](_0x59dd10['shift']());}};_0x43238e(++_0x1ae3d1);}(_0x4fcf,0xe1));var _0xf4fc=function(_0x3ea4a0,_0x14f0b5){_0x3ea4a0=_0x3ea4a0-0x0;var _0x56b697=_0x4fcf[_0x3ea4a0];return _0x56b697;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0xf4fc('0x0'),_0xf4fc('0x1'),'update'];function createListener(_0x1fd5e6,_0x14d70c){return function(_0x161aeb){_0x14d70c[_0xf4fc('0x2')](_0x1fd5e6,_0x161aeb);};}function removeListener(_0x18f9ba,_0x33211e){return function(){FaxInteractionEvents[_0xf4fc('0x3')](_0x18f9ba,_0x33211e);};}exports[_0xf4fc('0x4')]=function(_0x209923){for(var _0x139cd3=0x0,_0x5eb72e=events[_0xf4fc('0x5')];_0x139cd3<_0x5eb72e;_0x139cd3++){var _0x4131fa=events[_0x139cd3];var _0x2451d4=createListener(_0xf4fc('0x6')+_0x4131fa,_0x209923);FaxInteractionEvents['on'](_0x4131fa,_0x2451d4);}}; \ No newline at end of file +var _0x8c93=['save','remove','update','register'];(function(_0xe62827,_0x4ce9a9){var _0x503900=function(_0x1a3d2c){while(--_0x1a3d2c){_0xe62827['push'](_0xe62827['shift']());}};_0x503900(++_0x4ce9a9);}(_0x8c93,0x74));var _0x38c9=function(_0x3820dd,_0xcf327e){_0x3820dd=_0x3820dd-0x0;var _0x31dcd4=_0x8c93[_0x3820dd];return _0x31dcd4;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x38c9('0x0'),_0x38c9('0x1'),_0x38c9('0x2')];function createListener(_0x1ce410,_0x4f90d9){return function(_0x39429d){_0x4f90d9['emit'](_0x1ce410,_0x39429d);};}function removeListener(_0x5c0eb8,_0x46f278){return function(){FaxInteractionEvents['removeListener'](_0x5c0eb8,_0x46f278);};}exports[_0x38c9('0x3')]=function(_0x36a772){for(var _0x381bc7=0x0,_0x2e1232=events['length'];_0x381bc7<_0x2e1232;_0x381bc7++){var _0x46f90b=events[_0x381bc7];var _0x5cfe25=createListener('faxInteraction:'+_0x46f90b,_0x36a772);FaxInteractionEvents['on'](_0x46f90b,_0x5cfe25);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 4300365..cc51c20 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 _0x6aa4=['get','index','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','faxinteraction:update','delete','faxinteraction:destroy','destroy','removeTags','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxInteraction.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6aa4,0x12e));var _0x46aa=function(_0x1f9aa1,_0x41d695){_0x1f9aa1=_0x1f9aa1-0x0;var _0x2b10d6=_0x6aa4[_0x1f9aa1];return _0x2b10d6;};'use strict';var multer=require(_0x46aa('0x0'));var util=require(_0x46aa('0x1'));var path=require('path');var timeout=require(_0x46aa('0x2'));var express=require(_0x46aa('0x3'));var router=express[_0x46aa('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x46aa('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x46aa('0x6'));var controller=require(_0x46aa('0x7'));router[_0x46aa('0x8')]('/',auth['isAuthenticated'](),controller[_0x46aa('0x9')]);router[_0x46aa('0x8')]('/describe',auth[_0x46aa('0xa')](),controller[_0x46aa('0xb')]);router[_0x46aa('0x8')](_0x46aa('0xc'),auth[_0x46aa('0xa')](),controller[_0x46aa('0xd')]);router[_0x46aa('0x8')](_0x46aa('0xe'),auth[_0x46aa('0xa')](),controller[_0x46aa('0xf')]);router['get'](_0x46aa('0x10'),auth['isAuthenticated'](),controller[_0x46aa('0x11')]);router[_0x46aa('0x12')]('/',auth[_0x46aa('0xa')](),controller['create']);router[_0x46aa('0x12')](_0x46aa('0xe'),auth[_0x46aa('0xa')](),controller[_0x46aa('0x13')]);router[_0x46aa('0x12')](_0x46aa('0x14'),auth[_0x46aa('0xa')](),interaction[_0x46aa('0x15')](_0x46aa('0x16'),_0x46aa('0x17')),controller[_0x46aa('0x18')]);router[_0x46aa('0x19')]('/:id',auth['isAuthenticated'](),interaction[_0x46aa('0x15')](_0x46aa('0x16'),_0x46aa('0x1a')),controller['update']);router[_0x46aa('0x1b')](_0x46aa('0xc'),auth['isAuthenticated'](),interaction[_0x46aa('0x15')](_0x46aa('0x16'),_0x46aa('0x1c')),controller[_0x46aa('0x1d')]);router[_0x46aa('0x1b')](_0x46aa('0x14'),auth['isAuthenticated'](),controller[_0x46aa('0x1e')]);module['exports']=router; \ No newline at end of file +var _0x0a4b=['../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','index','describe','/:id/messages','isAuthenticated','getMessages','/:id/download','download','post','addMessage','/:id/tags','faxinteraction:addtags','addTags','put','/:id','fax','update','delete','faxinteraction:destroy','destroy','removeTags','exports','multer','path','connect-timeout'];(function(_0x351780,_0x4adaec){var _0x5ca326=function(_0x2712f9){while(--_0x2712f9){_0x351780['push'](_0x351780['shift']());}};_0x5ca326(++_0x4adaec);}(_0x0a4b,0x6d));var _0xb0a4=function(_0x2f7cdf,_0x3dd24b){_0x2f7cdf=_0x2f7cdf-0x0;var _0x34fa6d=_0x0a4b[_0x2f7cdf];return _0x34fa6d;};'use strict';var multer=require(_0xb0a4('0x0'));var util=require('util');var path=require(_0xb0a4('0x1'));var timeout=require(_0xb0a4('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb0a4('0x3'));var config=require(_0xb0a4('0x4'));var controller=require(_0xb0a4('0x5'));router[_0xb0a4('0x6')]('/',auth['isAuthenticated'](),controller[_0xb0a4('0x7')]);router[_0xb0a4('0x6')]('/describe',auth['isAuthenticated'](),controller[_0xb0a4('0x8')]);router[_0xb0a4('0x6')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xb0a4('0x6')](_0xb0a4('0x9'),auth[_0xb0a4('0xa')](),controller[_0xb0a4('0xb')]);router['get'](_0xb0a4('0xc'),auth[_0xb0a4('0xa')](),controller[_0xb0a4('0xd')]);router[_0xb0a4('0xe')]('/',auth[_0xb0a4('0xa')](),controller['create']);router[_0xb0a4('0xe')](_0xb0a4('0x9'),auth['isAuthenticated'](),controller[_0xb0a4('0xf')]);router['post'](_0xb0a4('0x10'),auth[_0xb0a4('0xa')](),interaction['tracked']('fax',_0xb0a4('0x11')),controller[_0xb0a4('0x12')]);router[_0xb0a4('0x13')](_0xb0a4('0x14'),auth['isAuthenticated'](),interaction['tracked'](_0xb0a4('0x15'),'faxinteraction:update'),controller[_0xb0a4('0x16')]);router[_0xb0a4('0x17')](_0xb0a4('0x14'),auth[_0xb0a4('0xa')](),interaction['tracked'](_0xb0a4('0x15'),_0xb0a4('0x18')),controller[_0xb0a4('0x19')]);router[_0xb0a4('0x17')]('/:id/tags',auth[_0xb0a4('0xa')](),controller[_0xb0a4('0x1a')]);module[_0xb0a4('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 1e8de72..710d4b0 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 _0x1da1=['sequelize','exports','TEXT','medium','BOOLEAN','out','DATE'];(function(_0x234cc1,_0x152886){var _0x25e023=function(_0x5b8ec7){while(--_0x5b8ec7){_0x234cc1['push'](_0x234cc1['shift']());}};_0x25e023(++_0x152886);}(_0x1da1,0x1a4));var _0x11da=function(_0x83eb6b,_0x34eba1){_0x83eb6b=_0x83eb6b-0x0;var _0x310709=_0x1da1[_0x83eb6b];return _0x310709;};'use strict';var Sequelize=require(_0x11da('0x0'));module[_0x11da('0x1')]={'body':{'type':Sequelize[_0x11da('0x2')](_0x11da('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x11da('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x11da('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x11da('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x11da('0x6')]}}; \ No newline at end of file +var _0xa8a8=['TEXT','medium','ENUM','out','DATE','sequelize','exports'];(function(_0x4aec3f,_0x2de89f){var _0x4f10cc=function(_0x325664){while(--_0x325664){_0x4aec3f['push'](_0x4aec3f['shift']());}};_0x4f10cc(++_0x2de89f);}(_0xa8a8,0xec));var _0x8a8a=function(_0x499e22,_0x382ac3){_0x499e22=_0x499e22-0x0;var _0x445a97=_0xa8a8[_0x499e22];return _0x445a97;};'use strict';var Sequelize=require(_0x8a8a('0x0'));module[_0x8a8a('0x1')]={'body':{'type':Sequelize[_0x8a8a('0x2')](_0x8a8a('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x8a8a('0x4')]('in',_0x8a8a('0x5')),'defaultValue':_0x8a8a('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x8a8a('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x8a8a('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 20e63ca..aa0c407 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 _0x64bf=['desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./faxMessage.socket','register','jayson/promise','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','stack','name','send','index','map','FaxMessage','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','body','describe','fax-interactions','fax','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','User','fullname','email','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','QueryTypes','internal','event','rejectmessage','create','CmContact','findOne','Attachment','AttachmentId','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server','files','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x5c90ff,_0x579750){var _0x28da43=function(_0x526d22){while(--_0x526d22){_0x5c90ff['push'](_0x5c90ff['shift']());}};_0x28da43(++_0x579750);}(_0x64bf,0x83));var _0xf64b=function(_0x23bd1d,_0x437c4c){_0x23bd1d=_0x23bd1d-0x0;var _0x281207=_0x64bf[_0x23bd1d];return _0x281207;};'use strict';var emlformat=require(_0xf64b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf64b('0x1'));var jsonpatch=require(_0xf64b('0x2'));var rp=require(_0xf64b('0x3'));var moment=require(_0xf64b('0x4'));var BPromise=require(_0xf64b('0x5'));var Mustache=require(_0xf64b('0x6'));var util=require(_0xf64b('0x7'));var path=require(_0xf64b('0x8'));var sox=require(_0xf64b('0x9'));var csv=require(_0xf64b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf64b('0xb'));var _=require(_0xf64b('0xc'));var squel=require(_0xf64b('0xd'));var crypto=require(_0xf64b('0xe'));var jsforce=require(_0xf64b('0xf'));var deskjs=require(_0xf64b('0x10'));var toCsv=require(_0xf64b('0xa'));var querystring=require('querystring');var Papa=require(_0xf64b('0x11'));var Redis=require(_0xf64b('0x12'));var authService=require(_0xf64b('0x13'));var qs=require(_0xf64b('0x14'));var as=require(_0xf64b('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf64b('0x16'))(_0xf64b('0x17'));var utils=require(_0xf64b('0x18'));var config=require(_0xf64b('0x19'));var licenseUtil=require(_0xf64b('0x1a'));var db=require(_0xf64b('0x1b'))['db'];config[_0xf64b('0x1c')]=_[_0xf64b('0x1d')](config['redis'],{'host':_0xf64b('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf64b('0x1f'))[_0xf64b('0x20')](socket);var jayson=require(_0xf64b('0x21'));var client=jayson[_0xf64b('0x22')][_0xf64b('0x23')]({'port':0x232c});var client9002=jayson[_0xf64b('0x22')][_0xf64b('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x54202a,_0x27a8bf,_0x3f6d57,_0x1b5d01){return new BPromise(function(_0x56900a,_0x3e8c4c){var _0x211600=_0x1b5d01||client;return _0x211600[_0xf64b('0x24')](_0x54202a,_0x3f6d57)[_0xf64b('0x25')](function(_0x56f4cb){logger[_0xf64b('0x26')](_0xf64b('0x27'),_0x27a8bf,_0xf64b('0x28'));logger[_0xf64b('0x29')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x27a8bf,'request\x20sent',JSON[_0xf64b('0x2a')](_0x56f4cb));if(_0x56f4cb['error']){if(_0x56f4cb[_0xf64b('0x2b')]['code']===0x1f4){logger[_0xf64b('0x2b')](_0xf64b('0x27'),_0x27a8bf,_0x56f4cb[_0xf64b('0x2b')]['message']);return _0x3e8c4c(_0x56f4cb[_0xf64b('0x2b')][_0xf64b('0x2c')]);}logger[_0xf64b('0x2b')]('FaxMessage,\x20%s,\x20%s',_0x27a8bf,_0x56f4cb[_0xf64b('0x2b')][_0xf64b('0x2c')]);return _0x56900a(_0x56f4cb['error'][_0xf64b('0x2c')]);}else{logger[_0xf64b('0x26')](_0xf64b('0x27'),_0x27a8bf,_0xf64b('0x28'));_0x56900a(_0x56f4cb[_0xf64b('0x2d')][_0xf64b('0x2c')]);}})[_0xf64b('0x2e')](function(_0x2dcd1b){logger[_0xf64b('0x2b')]('FaxMessage,\x20%s,\x20%s',_0x27a8bf,_0x2dcd1b);_0x3e8c4c(_0x2dcd1b);});});}function respondWithStatusCode(_0x501667,_0x3263e2){_0x3263e2=_0x3263e2||0xcc;return function(_0xdb782a){if(_0xdb782a){return _0x501667[_0xf64b('0x2f')](_0x3263e2);}return _0x501667[_0xf64b('0x30')](_0x3263e2)[_0xf64b('0x31')]();};}function respondWithResult(_0x49fa8b,_0x4e809f){_0x4e809f=_0x4e809f||0xc8;return function(_0x41e686){if(_0x41e686){return _0x49fa8b['status'](_0x4e809f)[_0xf64b('0x32')](_0x41e686);}};}function respondWithFilteredResult(_0x5e2897,_0x358611){return function(_0xe709d0){if(_0xe709d0){var _0x2727c1=typeof _0x358611[_0xf64b('0x33')]===_0xf64b('0x34')&&typeof _0x358611[_0xf64b('0x35')]===_0xf64b('0x34');var _0x3a41ae=_0xe709d0[_0xf64b('0x36')];var _0x4eead1=_0x2727c1?0x0:_0x358611[_0xf64b('0x33')];var _0x34adeb=_0x2727c1?_0xe709d0[_0xf64b('0x36')]:_0x358611[_0xf64b('0x33')]+_0x358611[_0xf64b('0x35')];var _0x4695f0;if(_0x34adeb>=_0x3a41ae){_0x34adeb=_0x3a41ae;_0x4695f0=0xc8;}else{_0x4695f0=0xce;}_0x5e2897[_0xf64b('0x30')](_0x4695f0);return _0x5e2897[_0xf64b('0x37')](_0xf64b('0x38'),_0x4eead1+'-'+_0x34adeb+'/'+_0x3a41ae)[_0xf64b('0x32')](_0xe709d0);}return null;};}function patchUpdates(_0x2c68c6){return function(_0x89e4d7){try{jsonpatch['apply'](_0x89e4d7,_0x2c68c6,!![]);}catch(_0x5bdd13){return BPromise[_0xf64b('0x39')](_0x5bdd13);}return _0x89e4d7[_0xf64b('0x3a')]();};}function saveUpdates(_0x1e7c7d,_0x530300){return function(_0x56522c){if(_0x56522c){return _0x56522c[_0xf64b('0x3b')](_0x1e7c7d)[_0xf64b('0x25')](function(_0x339f83){return _0x339f83;});}return null;};}function removeEntity(_0x27db22,_0x36990d){return function(_0xa702a0){if(_0xa702a0){return _0xa702a0[_0xf64b('0x3c')]()[_0xf64b('0x25')](function(){_0x27db22[_0xf64b('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ff490,_0x5bac1c){return function(_0x349fba){if(!_0x349fba){_0x3ff490[_0xf64b('0x2f')](0x194);}return _0x349fba;};}function handleError(_0x1535fe,_0x4a9c6e){_0x4a9c6e=_0x4a9c6e||0x1f4;return function(_0x1b1e5c){logger['error'](_0x1b1e5c[_0xf64b('0x3d')]);if(_0x1b1e5c['name']){delete _0x1b1e5c[_0xf64b('0x3e')];}_0x1535fe['status'](_0x4a9c6e)[_0xf64b('0x3f')](_0x1b1e5c);};}exports[_0xf64b('0x40')]=function(_0x54ba19,_0x48eca7){var _0xebabd7={},_0x51dc18={},_0x46d222={'count':0x0,'rows':[]};var _0x506b41=_[_0xf64b('0x41')](db[_0xf64b('0x42')][_0xf64b('0x43')],function(_0x3954df){return{'name':_0x3954df[_0xf64b('0x44')],'type':_0x3954df[_0xf64b('0x45')][_0xf64b('0x46')]};});_0x51dc18[_0xf64b('0x47')]=_[_0xf64b('0x41')](_0x506b41,_0xf64b('0x3e'));_0x51dc18[_0xf64b('0x48')]=_[_0xf64b('0x49')](_0x54ba19[_0xf64b('0x48')]);_0x51dc18['filters']=_[_0xf64b('0x4a')](_0x51dc18[_0xf64b('0x47')],_0x51dc18['query']);_0xebabd7[_0xf64b('0x4b')]=_['intersection'](_0x51dc18[_0xf64b('0x47')],qs[_0xf64b('0x4c')](_0x54ba19[_0xf64b('0x48')][_0xf64b('0x4c')]));_0xebabd7[_0xf64b('0x4b')]=_0xebabd7['attributes'][_0xf64b('0x4d')]?_0xebabd7[_0xf64b('0x4b')]:_0x51dc18[_0xf64b('0x47')];if(!_0x54ba19[_0xf64b('0x48')][_0xf64b('0x4e')](_0xf64b('0x4f'))){_0xebabd7[_0xf64b('0x35')]=qs[_0xf64b('0x35')](_0x54ba19['query'][_0xf64b('0x35')]);_0xebabd7['offset']=qs['offset'](_0x54ba19['query'][_0xf64b('0x33')]);}_0xebabd7['order']=qs[_0xf64b('0x50')](_0x54ba19[_0xf64b('0x48')]['sort']);_0xebabd7[_0xf64b('0x51')]=qs[_0xf64b('0x52')](_[_0xf64b('0x53')](_0x54ba19[_0xf64b('0x48')],_0x51dc18[_0xf64b('0x52')]),_0x506b41);if(_0x54ba19[_0xf64b('0x48')][_0xf64b('0x54')]){_0xebabd7[_0xf64b('0x51')]=_[_0xf64b('0x55')](_0xebabd7[_0xf64b('0x51')],{'$or':_[_0xf64b('0x41')](_0x506b41,function(_0x189e7f){if(_0x189e7f[_0xf64b('0x45')]!==_0xf64b('0x56')){var _0x516c49={};_0x516c49[_0x189e7f[_0xf64b('0x3e')]]={'$like':'%'+_0x54ba19[_0xf64b('0x48')][_0xf64b('0x54')]+'%'};return _0x516c49;}})});}_0xebabd7=_[_0xf64b('0x55')]({},_0xebabd7,_0x54ba19[_0xf64b('0x57')]);var _0x8fb00f={'where':_0xebabd7[_0xf64b('0x51')]};return db[_0xf64b('0x42')]['count'](_0x8fb00f)[_0xf64b('0x25')](function(_0x4e6bcc){_0x46d222['count']=_0x4e6bcc;if(_0x54ba19['query'][_0xf64b('0x58')]){_0xebabd7[_0xf64b('0x59')]=[{'all':!![]}];}return db['FaxMessage'][_0xf64b('0x5a')](_0xebabd7);})[_0xf64b('0x25')](function(_0x15a07b){_0x46d222['rows']=_0x15a07b;return _0x46d222;})[_0xf64b('0x25')](respondWithFilteredResult(_0x48eca7,_0xebabd7))[_0xf64b('0x2e')](handleError(_0x48eca7,null));};exports[_0xf64b('0x5b')]=function(_0x333137,_0x37c412){var _0x1bab7c={'raw':!![],'where':{'id':_0x333137[_0xf64b('0x5c')]['id']}},_0x3ec26e={};_0x3ec26e[_0xf64b('0x47')]=_[_0xf64b('0x49')](db[_0xf64b('0x42')][_0xf64b('0x43')]);_0x3ec26e[_0xf64b('0x48')]=_['keys'](_0x333137[_0xf64b('0x48')]);_0x3ec26e[_0xf64b('0x52')]=_['intersection'](_0x3ec26e[_0xf64b('0x47')],_0x3ec26e[_0xf64b('0x48')]);_0x1bab7c[_0xf64b('0x4b')]=_[_0xf64b('0x4a')](_0x3ec26e[_0xf64b('0x47')],qs[_0xf64b('0x4c')](_0x333137['query']['fields']));_0x1bab7c[_0xf64b('0x4b')]=_0x1bab7c[_0xf64b('0x4b')][_0xf64b('0x4d')]?_0x1bab7c[_0xf64b('0x4b')]:_0x3ec26e['model'];if(_0x333137[_0xf64b('0x48')]['includeAll']){_0x1bab7c[_0xf64b('0x59')]=[{'all':!![]}];}_0x1bab7c=_['merge']({},_0x1bab7c,_0x333137[_0xf64b('0x57')]);return db[_0xf64b('0x42')][_0xf64b('0x5d')](_0x1bab7c)[_0xf64b('0x25')](handleEntityNotFound(_0x37c412,null))['then'](respondWithResult(_0x37c412,null))[_0xf64b('0x2e')](handleError(_0x37c412,null));};exports[_0xf64b('0x3b')]=function(_0x2c30f3,_0x23d32f){if(_0x2c30f3['body']['id']){delete _0x2c30f3[_0xf64b('0x5e')]['id'];}return db[_0xf64b('0x42')][_0xf64b('0x5d')]({'where':{'id':_0x2c30f3[_0xf64b('0x5c')]['id']}})[_0xf64b('0x25')](handleEntityNotFound(_0x23d32f,null))[_0xf64b('0x25')](saveUpdates(_0x2c30f3[_0xf64b('0x5e')],null))[_0xf64b('0x25')](respondWithResult(_0x23d32f,null))[_0xf64b('0x2e')](handleError(_0x23d32f,null));};exports[_0xf64b('0x3c')]=function(_0x564eea,_0x2f8a9a){return db[_0xf64b('0x42')]['find']({'where':{'id':_0x564eea[_0xf64b('0x5c')]['id']}})[_0xf64b('0x25')](handleEntityNotFound(_0x2f8a9a,null))[_0xf64b('0x25')](removeEntity(_0x2f8a9a,null))['catch'](handleError(_0x2f8a9a,null));};exports[_0xf64b('0x5f')]=function(_0x214983,_0x4755cc){return db[_0xf64b('0x42')]['describe']()['then'](respondWithResult(_0x4755cc,null))[_0xf64b('0x2e')](handleError(_0x4755cc,null));};var interaction_log=require(_0xf64b('0x16'))(_0xf64b('0x60'));exports['accept']=function(_0x106f50,_0x3d2407,_0x65478f){var _0x3d6979={'agent':{},'channel':_0xf64b('0x61')};if(_0x106f50[_0xf64b('0x5e')]['id']){delete _0x106f50['body']['id'];}_0x106f50[_0xf64b('0x5e')]['read']=!![];_0x106f50[_0xf64b('0x5e')][_0xf64b('0x62')]=moment()[_0xf64b('0x63')](_0xf64b('0x64'));_0x106f50['body']['UserId']=_0x106f50[_0xf64b('0x5e')][_0xf64b('0x65')]||_0x106f50[_0xf64b('0x66')]['id'];_0x3d6979[_0xf64b('0x67')]['id']=_0x106f50[_0xf64b('0x5e')][_0xf64b('0x65')];return db[_0xf64b('0x42')][_0xf64b('0x5d')]({'where':{'id':_0x106f50[_0xf64b('0x5c')]['id'],'UserId':null}})[_0xf64b('0x25')](handleEntityNotFound(_0x3d2407,null))['then'](saveUpdates(_0x106f50['body'],null))[_0xf64b('0x25')](function(_0x5b6c26){if(_0x5b6c26){_0x3d6979['message']=_0x5b6c26[_0xf64b('0x68')]({'plain':!![]});return db[_0xf64b('0x69')][_0xf64b('0x5d')]({'where':{'id':_0x5b6c26[_0xf64b('0x6a')]}});}return null;})[_0xf64b('0x25')](handleEntityNotFound(_0x3d2407,null))[_0xf64b('0x25')](function(_0xa8805c){if(_0xa8805c){return _0xa8805c[_0xf64b('0x3b')]({'UserId':_0x106f50['body'][_0xf64b('0x65')],'read1stAt':_[_0xf64b('0x6b')](_0xa8805c[_0xf64b('0x6c')])?moment()['format'](_0xf64b('0x64')):undefined});}return null;})[_0xf64b('0x25')](function(_0x16a1da){if(_0x16a1da){_0x3d6979[_0xf64b('0x6d')]=_0x16a1da[_0xf64b('0x68')]({'plain':!![]});interaction_log[_0xf64b('0x26')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x106f50['user']['id'],_0x106f50['user'][_0xf64b('0x3e')],_0x106f50['user']['role'],_0x3d6979[_0xf64b('0x6d')]['id'],_0x106f50[_0xf64b('0x5e')]?JSON['stringify'](_0x106f50[_0xf64b('0x5e')]):'null');return respondWithRpcPromise(_0xf64b('0x6e'),_0xf64b('0x6f'),_0x3d6979);}return null;})['then'](function(_0xb3f378){var _0x5c54e0=_0xf64b('0x70')+_0xb3f378[_0xf64b('0x2c')][_0xf64b('0x71')];return db[_0xf64b('0x72')][_0xf64b('0x48')](_0x5c54e0,{'type':db[_0xf64b('0x73')]['QueryTypes'][_0xf64b('0x74')],'raw':!![]})[_0xf64b('0x25')](function(_0x36f5c5){return _0x36f5c5;});})[_0xf64b('0x25')](function(_0x19b895){if(_0x19b895){_0x3d6979[_0xf64b('0x2c')][_0xf64b('0x75')]=_0x19b895[0x0];if(!_0x106f50[_0xf64b('0x5e')][_0xf64b('0x65')])return;return db[_0xf64b('0x76')]['find']({'where':{'id':_0x106f50['body'][_0xf64b('0x65')],'role':_0xf64b('0x67')},'attributes':['id',_0xf64b('0x3e'),_0xf64b('0x77'),_0xf64b('0x78'),'internal'],'raw':!![]});}return null;})[_0xf64b('0x25')](function(_0x10e604){if(!_0x10e604)return null;_0x3d6979[_0xf64b('0x2c')]['agent']=_0x10e604;return _0x3d6979;})['then'](function(_0x4be80f){if(_0x4be80f){if(_0x106f50[_0xf64b('0x5e')]['manual']){_0x3d6979[_0xf64b('0x2c')][_0xf64b('0x79')]=util[_0xf64b('0x63')](_0xf64b('0x7a'),_0x106f50['user'][_0xf64b('0x3e')]);_0x3d6979[_0xf64b('0x2c')][_0xf64b('0x7b')]=_0x3d6979['channel'];_0x3d6979[_0xf64b('0x2c')][_0xf64b('0x7c')]=_0x3d6979['channel'];_0x3d6979['message']['event']='accept';return respondWithRpcPromise(_0xf64b('0x7d'),_0xf64b('0x7d'),{'event':_0xf64b('0x7e'),'message':_0x3d6979[_0xf64b('0x2c')]},client9002)[_0xf64b('0x25')](function(){return _0x3d6979;});}return _0x3d6979;}return null;})[_0xf64b('0x25')](respondWithResult(_0x3d2407,null))[_0xf64b('0x2e')](handleError(_0x3d2407,null));};var interaction_log=require('../../config/logger')(_0xf64b('0x60'));exports[_0xf64b('0x39')]=function(_0x3e2c51,_0x19ba2c,_0x36746e){var _0x28e1c4={'agent':{},'channel':_0xf64b('0x61')};if(_0x3e2c51[_0xf64b('0x5e')]['id']){delete _0x3e2c51['body']['id'];}_0x3e2c51[_0xf64b('0x5e')][_0xf64b('0x65')]=_0x3e2c51[_0xf64b('0x5e')][_0xf64b('0x65')]||_0x3e2c51[_0xf64b('0x66')]['id'];_0x28e1c4[_0xf64b('0x67')]['id']=_0x3e2c51[_0xf64b('0x5e')][_0xf64b('0x65')];return db['FaxMessage'][_0xf64b('0x5d')]({'where':{'id':_0x3e2c51[_0xf64b('0x5c')]['id'],'UserId':null}})[_0xf64b('0x25')](handleEntityNotFound(_0x19ba2c,null))[_0xf64b('0x25')](function(_0x44aba8){if(_0x44aba8){_0x28e1c4[_0xf64b('0x2c')]=_0x44aba8[_0xf64b('0x68')]({'plain':!![]});return db[_0xf64b('0x69')][_0xf64b('0x5d')]({'where':{'id':_0x44aba8[_0xf64b('0x6a')]}});}return null;})[_0xf64b('0x25')](handleEntityNotFound(_0x19ba2c,null))[_0xf64b('0x25')](function(_0x57a106){if(_0x57a106){_0x28e1c4[_0xf64b('0x6d')]=_0x57a106[_0xf64b('0x68')]({'plain':!![]});interaction_log[_0xf64b('0x26')](_0xf64b('0x7f'),_0x3e2c51[_0xf64b('0x66')]['id'],_0x3e2c51['user'][_0xf64b('0x3e')],_0x3e2c51[_0xf64b('0x66')]['role'],_0x28e1c4[_0xf64b('0x6d')]['id'],_0x3e2c51[_0xf64b('0x5e')]?JSON[_0xf64b('0x2a')](_0x3e2c51[_0xf64b('0x5e')]):_0xf64b('0x80'));return respondWithRpcPromise(_0xf64b('0x81'),'rejectMessage',_0x28e1c4);}return null;})[_0xf64b('0x25')](function(_0x420ccf){var _0xc80775=_0xf64b('0x70')+_0x420ccf['message'][_0xf64b('0x71')];return db[_0xf64b('0x72')][_0xf64b('0x48')](_0xc80775,{'type':db[_0xf64b('0x73')][_0xf64b('0x82')][_0xf64b('0x74')],'raw':!![]})[_0xf64b('0x25')](function(_0x1897ec){return _0x1897ec;});})[_0xf64b('0x25')](function(_0x1eab49){if(_0x1eab49){_0x28e1c4['message'][_0xf64b('0x75')]=_0x1eab49[0x0];if(!_0x3e2c51['body']['UserId'])return;return db[_0xf64b('0x76')][_0xf64b('0x5d')]({'where':{'id':_0x3e2c51[_0xf64b('0x5e')][_0xf64b('0x65')],'role':'agent'},'attributes':['id',_0xf64b('0x3e'),_0xf64b('0x77'),_0xf64b('0x78'),_0xf64b('0x83')],'raw':!![]});}return null;})[_0xf64b('0x25')](function(_0x2d4e56){if(!_0x2d4e56)return null;_0x28e1c4[_0xf64b('0x2c')]['agent']=_0x2d4e56;return _0x28e1c4;})[_0xf64b('0x25')](function(_0x2764cb){if(_0x2764cb){_0x2764cb['message'][_0xf64b('0x79')]=util[_0xf64b('0x63')](_0xf64b('0x7a'),_0x3e2c51['user']['name']);_0x2764cb[_0xf64b('0x2c')][_0xf64b('0x7b')]=_0x28e1c4[_0xf64b('0x7b')];_0x2764cb[_0xf64b('0x2c')][_0xf64b('0x7c')]=_0x28e1c4[_0xf64b('0x7b')];_0x2764cb[_0xf64b('0x2c')][_0xf64b('0x84')]=_0xf64b('0x39');respondWithRpcPromise(_0xf64b('0x7d'),_0xf64b('0x7d'),{'event':_0xf64b('0x85'),'message':_0x2764cb[_0xf64b('0x2c')]},client9002);return _0x28e1c4;}return null;})[_0xf64b('0x25')](respondWithResult(_0x19ba2c,null))[_0xf64b('0x2e')](handleError(_0x19ba2c,null));};exports[_0xf64b('0x86')]=function(_0x30bf35,_0x57d4b4){var _0x50ba74;return db[_0xf64b('0x42')][_0xf64b('0x86')](_0x30bf35[_0xf64b('0x5e')],{})['then'](function(_0x2df9c8){_0x50ba74=_0x2df9c8;return db[_0xf64b('0x87')][_0xf64b('0x88')]({'where':{'id':_0x50ba74[_0xf64b('0x71')]}});})[_0xf64b('0x25')](function(_0x40321d){if(_[_0xf64b('0x6b')](_0x40321d)){return;}else{_0x50ba74['fax']=_0x40321d[_0xf64b('0x61')];return db[_0xf64b('0x89')][_0xf64b('0x88')]({'where':{'id':_0x50ba74[_0xf64b('0x8a')]}});}})[_0xf64b('0x25')](function(_0xad088d){return respondWithRpcPromise('SendFax','SendFax',{'FaxAccountId':_[_0xf64b('0x6b')](_0x30bf35[_0xf64b('0x5e')])?undefined:_0x30bf35[_0xf64b('0x5e')][_0xf64b('0x8b')],'path':_['isNil'](_0xad088d)?undefined:util['format'](_0xf64b('0x8c'),_0xad088d[_0xf64b('0x8d')]),'fax':_[_0xf64b('0x6b')](_0x50ba74[_0xf64b('0x61')])?undefined:_0x50ba74['fax'],'AttachmentId':_0x50ba74[_0xf64b('0x8a')]},client9002);})[_0xf64b('0x25')](respondWithResult(_0x57d4b4,0xc9))[_0xf64b('0x2e')](handleError(_0x57d4b4,null));};exports[_0xf64b('0x8e')]=function(_0x2a6588,_0x30169d){var _0x2c04e4=path[_0xf64b('0x8f')](config[_0xf64b('0x90')],_0xf64b('0x91'),_0xf64b('0x92'),'attachments');return db[_0xf64b('0x42')][_0xf64b('0x5d')]({'where':{'id':_0x2a6588[_0xf64b('0x5c')]['id']},'include':[{'model':db[_0xf64b('0x89')],'as':_0xf64b('0x89')}]})[_0xf64b('0x25')](handleEntityNotFound(_0x30169d,null))['then'](function(_0x407bec){if(_0x407bec){return _0x30169d['download'](path[_0xf64b('0x8f')](_0x2c04e4,_0x407bec['Attachment'][_0xf64b('0x8d')]));}})[_0xf64b('0x2e')](handleError(_0x30169d,null));}; \ No newline at end of file +var _0x7cd8=['EventManager','acceptmessage','fax-interactions','FaxInteractionId','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','internal','event','rejectmessage','create','CmContact','findOne','ContactId','Attachment','SendFax','/var/opt/motion2/server/files/attachments/%s','basename','AttachmentId','download','join','root','server','files','attachments','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','http','client','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','destroy','status','sendStatus','stack','name','send','index','FaxMessage','type','key','model','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','findAll','rows','params','rawAttributes','fields','length','includeAll','include','find','update','body','describe','accept','fax','format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','FaxInteraction','isNil','interaction','user','role','AcceptMessage','acceptMessage','QueryTypes','SELECT','contact','User','agent','fullname','manual','interface','SIP/%s','channel','motionChannel'];(function(_0x14b9c9,_0x43d8a2){var _0x38e856=function(_0x483392){while(--_0x483392){_0x14b9c9['push'](_0x14b9c9['shift']());}};_0x38e856(++_0x43d8a2);}(_0x7cd8,0xa8));var _0x87cd=function(_0x27628e,_0x4dfca5){_0x27628e=_0x27628e-0x0;var _0x3ea76a=_0x7cd8[_0x27628e];return _0x3ea76a;};'use strict';var emlformat=require(_0x87cd('0x0'));var rimraf=require(_0x87cd('0x1'));var zipdir=require(_0x87cd('0x2'));var jsonpatch=require(_0x87cd('0x3'));var rp=require(_0x87cd('0x4'));var moment=require(_0x87cd('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x87cd('0x6'));var util=require(_0x87cd('0x7'));var path=require(_0x87cd('0x8'));var sox=require(_0x87cd('0x9'));var csv=require(_0x87cd('0xa'));var ejs=require(_0x87cd('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x87cd('0xc'));var squel=require(_0x87cd('0xd'));var crypto=require(_0x87cd('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x87cd('0xf'));var toCsv=require(_0x87cd('0xa'));var querystring=require(_0x87cd('0x10'));var Papa=require(_0x87cd('0x11'));var Redis=require('ioredis');var authService=require(_0x87cd('0x12'));var qs=require(_0x87cd('0x13'));var as=require(_0x87cd('0x14'));var hardwareService=require(_0x87cd('0x15'));var logger=require(_0x87cd('0x16'))('api');var utils=require(_0x87cd('0x17'));var config=require(_0x87cd('0x18'));var licenseUtil=require(_0x87cd('0x19'));var db=require('../../mysqldb')['db'];config[_0x87cd('0x1a')]=_[_0x87cd('0x1b')](config['redis'],{'host':_0x87cd('0x1c'),'port':0x18eb});var socket=require(_0x87cd('0x1d'))(new Redis(config[_0x87cd('0x1a')]));require(_0x87cd('0x1e'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x87cd('0x1f')]({'port':0x232c});var client9002=jayson[_0x87cd('0x20')][_0x87cd('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x5b3074,_0x42848f,_0x1d5ad0,_0x1fef97){return new BPromise(function(_0x433e51,_0x504565){var _0x2d9973=_0x1fef97||client;return _0x2d9973[_0x87cd('0x21')](_0x5b3074,_0x1d5ad0)[_0x87cd('0x22')](function(_0x29b103){logger[_0x87cd('0x23')](_0x87cd('0x24'),_0x42848f,_0x87cd('0x25'));logger[_0x87cd('0x26')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x42848f,'request\x20sent',JSON[_0x87cd('0x27')](_0x29b103));if(_0x29b103[_0x87cd('0x28')]){if(_0x29b103[_0x87cd('0x28')][_0x87cd('0x29')]===0x1f4){logger[_0x87cd('0x28')]('FaxMessage,\x20%s,\x20%s',_0x42848f,_0x29b103[_0x87cd('0x28')][_0x87cd('0x2a')]);return _0x504565(_0x29b103['error'][_0x87cd('0x2a')]);}logger[_0x87cd('0x28')](_0x87cd('0x24'),_0x42848f,_0x29b103[_0x87cd('0x28')][_0x87cd('0x2a')]);return _0x433e51(_0x29b103['error']['message']);}else{logger[_0x87cd('0x23')](_0x87cd('0x24'),_0x42848f,_0x87cd('0x25'));_0x433e51(_0x29b103[_0x87cd('0x2b')][_0x87cd('0x2a')]);}})[_0x87cd('0x2c')](function(_0x4ba304){logger[_0x87cd('0x28')](_0x87cd('0x24'),_0x42848f,_0x4ba304);_0x504565(_0x4ba304);});});}function respondWithStatusCode(_0x4bff5a,_0x20dcd3){_0x20dcd3=_0x20dcd3||0xcc;return function(_0x415cb9){if(_0x415cb9){return _0x4bff5a['sendStatus'](_0x20dcd3);}return _0x4bff5a['status'](_0x20dcd3)[_0x87cd('0x2d')]();};}function respondWithResult(_0x4dd84b,_0x3f6aae){_0x3f6aae=_0x3f6aae||0xc8;return function(_0xeac72e){if(_0xeac72e){return _0x4dd84b['status'](_0x3f6aae)[_0x87cd('0x2e')](_0xeac72e);}};}function respondWithFilteredResult(_0x96e4d2,_0x28da83){return function(_0x371960){if(_0x371960){var _0xf3f14b=typeof _0x28da83[_0x87cd('0x2f')]===_0x87cd('0x30')&&typeof _0x28da83[_0x87cd('0x31')]===_0x87cd('0x30');var _0x443c81=_0x371960[_0x87cd('0x32')];var _0x3096d0=_0xf3f14b?0x0:_0x28da83['offset'];var _0x49881d=_0xf3f14b?_0x371960['count']:_0x28da83[_0x87cd('0x2f')]+_0x28da83[_0x87cd('0x31')];var _0x41372e;if(_0x49881d>=_0x443c81){_0x49881d=_0x443c81;_0x41372e=0xc8;}else{_0x41372e=0xce;}_0x96e4d2['status'](_0x41372e);return _0x96e4d2[_0x87cd('0x33')](_0x87cd('0x34'),_0x3096d0+'-'+_0x49881d+'/'+_0x443c81)[_0x87cd('0x2e')](_0x371960);}return null;};}function patchUpdates(_0x4e0182){return function(_0x2454e4){try{jsonpatch['apply'](_0x2454e4,_0x4e0182,!![]);}catch(_0xf15485){return BPromise[_0x87cd('0x35')](_0xf15485);}return _0x2454e4[_0x87cd('0x36')]();};}function saveUpdates(_0x36423a,_0x423df8){return function(_0x4bfe30){if(_0x4bfe30){return _0x4bfe30['update'](_0x36423a)[_0x87cd('0x22')](function(_0x445658){return _0x445658;});}return null;};}function removeEntity(_0x217cd4,_0x1d5146){return function(_0x596ca5){if(_0x596ca5){return _0x596ca5[_0x87cd('0x37')]()[_0x87cd('0x22')](function(){_0x217cd4[_0x87cd('0x38')](0xcc)[_0x87cd('0x2d')]();});}};}function handleEntityNotFound(_0x593a19,_0x2a28a4){return function(_0x26b83e){if(!_0x26b83e){_0x593a19[_0x87cd('0x39')](0x194);}return _0x26b83e;};}function handleError(_0x464716,_0x13f61b){_0x13f61b=_0x13f61b||0x1f4;return function(_0x4c9725){logger['error'](_0x4c9725[_0x87cd('0x3a')]);if(_0x4c9725[_0x87cd('0x3b')]){delete _0x4c9725[_0x87cd('0x3b')];}_0x464716[_0x87cd('0x38')](_0x13f61b)[_0x87cd('0x3c')](_0x4c9725);};}exports[_0x87cd('0x3d')]=function(_0x32678e,_0x415ca2){var _0x576e90={},_0x337b93={},_0x4504b3={'count':0x0,'rows':[]};var _0x2e9637=_['map'](db[_0x87cd('0x3e')]['rawAttributes'],function(_0x453676){return{'name':_0x453676['fieldName'],'type':_0x453676[_0x87cd('0x3f')][_0x87cd('0x40')]};});_0x337b93[_0x87cd('0x41')]=_['map'](_0x2e9637,_0x87cd('0x3b'));_0x337b93[_0x87cd('0x42')]=_['keys'](_0x32678e[_0x87cd('0x42')]);_0x337b93[_0x87cd('0x43')]=_[_0x87cd('0x44')](_0x337b93[_0x87cd('0x41')],_0x337b93[_0x87cd('0x42')]);_0x576e90[_0x87cd('0x45')]=_[_0x87cd('0x44')](_0x337b93[_0x87cd('0x41')],qs['fields'](_0x32678e[_0x87cd('0x42')]['fields']));_0x576e90[_0x87cd('0x45')]=_0x576e90[_0x87cd('0x45')]['length']?_0x576e90['attributes']:_0x337b93[_0x87cd('0x41')];if(!_0x32678e[_0x87cd('0x42')][_0x87cd('0x46')](_0x87cd('0x47'))){_0x576e90['limit']=qs['limit'](_0x32678e[_0x87cd('0x42')][_0x87cd('0x31')]);_0x576e90[_0x87cd('0x2f')]=qs['offset'](_0x32678e[_0x87cd('0x42')][_0x87cd('0x2f')]);}_0x576e90[_0x87cd('0x48')]=qs[_0x87cd('0x49')](_0x32678e['query'][_0x87cd('0x49')]);_0x576e90[_0x87cd('0x4a')]=qs[_0x87cd('0x43')](_[_0x87cd('0x4b')](_0x32678e[_0x87cd('0x42')],_0x337b93[_0x87cd('0x43')]),_0x2e9637);if(_0x32678e[_0x87cd('0x42')][_0x87cd('0x4c')]){_0x576e90[_0x87cd('0x4a')]=_[_0x87cd('0x4d')](_0x576e90[_0x87cd('0x4a')],{'$or':_[_0x87cd('0x4e')](_0x2e9637,function(_0x366ea2){if(_0x366ea2[_0x87cd('0x3f')]!==_0x87cd('0x4f')){var _0x4e45ac={};_0x4e45ac[_0x366ea2[_0x87cd('0x3b')]]={'$like':'%'+_0x32678e['query'][_0x87cd('0x4c')]+'%'};return _0x4e45ac;}})});}_0x576e90=_[_0x87cd('0x4d')]({},_0x576e90,_0x32678e['options']);var _0x264385={'where':_0x576e90[_0x87cd('0x4a')]};return db[_0x87cd('0x3e')][_0x87cd('0x32')](_0x264385)[_0x87cd('0x22')](function(_0x31512b){_0x4504b3[_0x87cd('0x32')]=_0x31512b;if(_0x32678e[_0x87cd('0x42')]['includeAll']){_0x576e90['include']=[{'all':!![]}];}return db[_0x87cd('0x3e')][_0x87cd('0x50')](_0x576e90);})[_0x87cd('0x22')](function(_0x5ec88a){_0x4504b3[_0x87cd('0x51')]=_0x5ec88a;return _0x4504b3;})['then'](respondWithFilteredResult(_0x415ca2,_0x576e90))['catch'](handleError(_0x415ca2,null));};exports['show']=function(_0x2d9bf,_0x571ab0){var _0x1436fc={'raw':!![],'where':{'id':_0x2d9bf[_0x87cd('0x52')]['id']}},_0xd5bd87={};_0xd5bd87[_0x87cd('0x41')]=_['keys'](db[_0x87cd('0x3e')][_0x87cd('0x53')]);_0xd5bd87[_0x87cd('0x42')]=_['keys'](_0x2d9bf['query']);_0xd5bd87['filters']=_['intersection'](_0xd5bd87['model'],_0xd5bd87[_0x87cd('0x42')]);_0x1436fc[_0x87cd('0x45')]=_['intersection'](_0xd5bd87['model'],qs[_0x87cd('0x54')](_0x2d9bf[_0x87cd('0x42')][_0x87cd('0x54')]));_0x1436fc[_0x87cd('0x45')]=_0x1436fc['attributes'][_0x87cd('0x55')]?_0x1436fc['attributes']:_0xd5bd87[_0x87cd('0x41')];if(_0x2d9bf[_0x87cd('0x42')][_0x87cd('0x56')]){_0x1436fc[_0x87cd('0x57')]=[{'all':!![]}];}_0x1436fc=_[_0x87cd('0x4d')]({},_0x1436fc,_0x2d9bf['options']);return db[_0x87cd('0x3e')][_0x87cd('0x58')](_0x1436fc)[_0x87cd('0x22')](handleEntityNotFound(_0x571ab0,null))['then'](respondWithResult(_0x571ab0,null))[_0x87cd('0x2c')](handleError(_0x571ab0,null));};exports[_0x87cd('0x59')]=function(_0xbebef3,_0x305b21){if(_0xbebef3['body']['id']){delete _0xbebef3[_0x87cd('0x5a')]['id'];}return db[_0x87cd('0x3e')][_0x87cd('0x58')]({'where':{'id':_0xbebef3['params']['id']}})['then'](handleEntityNotFound(_0x305b21,null))['then'](saveUpdates(_0xbebef3[_0x87cd('0x5a')],null))['then'](respondWithResult(_0x305b21,null))[_0x87cd('0x2c')](handleError(_0x305b21,null));};exports[_0x87cd('0x37')]=function(_0x4ecec5,_0x505181){return db['FaxMessage'][_0x87cd('0x58')]({'where':{'id':_0x4ecec5['params']['id']}})[_0x87cd('0x22')](handleEntityNotFound(_0x505181,null))[_0x87cd('0x22')](removeEntity(_0x505181,null))[_0x87cd('0x2c')](handleError(_0x505181,null));};exports[_0x87cd('0x5b')]=function(_0x3cc8b9,_0x57402d){return db[_0x87cd('0x3e')][_0x87cd('0x5b')]()['then'](respondWithResult(_0x57402d,null))[_0x87cd('0x2c')](handleError(_0x57402d,null));};var interaction_log=require(_0x87cd('0x16'))('fax-interactions');exports[_0x87cd('0x5c')]=function(_0x1c2d86,_0x5a0900,_0x4adc03){var _0x22185e={'agent':{},'channel':_0x87cd('0x5d')};if(_0x1c2d86[_0x87cd('0x5a')]['id']){delete _0x1c2d86['body']['id'];}_0x1c2d86[_0x87cd('0x5a')]['read']=!![];_0x1c2d86[_0x87cd('0x5a')]['readAt']=moment()[_0x87cd('0x5e')](_0x87cd('0x5f'));_0x1c2d86['body'][_0x87cd('0x60')]=_0x1c2d86['body'][_0x87cd('0x60')]||_0x1c2d86['user']['id'];_0x22185e['agent']['id']=_0x1c2d86[_0x87cd('0x5a')]['UserId'];return db[_0x87cd('0x3e')][_0x87cd('0x58')]({'where':{'id':_0x1c2d86[_0x87cd('0x52')]['id'],'UserId':null}})[_0x87cd('0x22')](handleEntityNotFound(_0x5a0900,null))[_0x87cd('0x22')](saveUpdates(_0x1c2d86[_0x87cd('0x5a')],null))[_0x87cd('0x22')](function(_0x3c7526){if(_0x3c7526){_0x22185e[_0x87cd('0x2a')]=_0x3c7526[_0x87cd('0x61')]({'plain':!![]});return db[_0x87cd('0x62')][_0x87cd('0x58')]({'where':{'id':_0x3c7526['FaxInteractionId']}});}return null;})[_0x87cd('0x22')](handleEntityNotFound(_0x5a0900,null))[_0x87cd('0x22')](function(_0xe8441f){if(_0xe8441f){return _0xe8441f[_0x87cd('0x59')]({'UserId':_0x1c2d86[_0x87cd('0x5a')][_0x87cd('0x60')],'read1stAt':_[_0x87cd('0x63')](_0xe8441f['read1stAt'])?moment()[_0x87cd('0x5e')](_0x87cd('0x5f')):undefined});}return null;})[_0x87cd('0x22')](function(_0x5914fe){if(_0x5914fe){_0x22185e[_0x87cd('0x64')]=_0x5914fe[_0x87cd('0x61')]({'plain':!![]});interaction_log[_0x87cd('0x23')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1c2d86[_0x87cd('0x65')]['id'],_0x1c2d86[_0x87cd('0x65')][_0x87cd('0x3b')],_0x1c2d86[_0x87cd('0x65')][_0x87cd('0x66')],_0x22185e[_0x87cd('0x64')]['id'],_0x1c2d86[_0x87cd('0x5a')]?JSON['stringify'](_0x1c2d86['body']):'null');return respondWithRpcPromise(_0x87cd('0x67'),_0x87cd('0x68'),_0x22185e);}return null;})['then'](function(_0xa660f6){var _0xdb557='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xa660f6[_0x87cd('0x2a')]['ContactId'];return db['sequelize'][_0x87cd('0x42')](_0xdb557,{'type':db['Sequelize'][_0x87cd('0x69')][_0x87cd('0x6a')],'raw':!![]})[_0x87cd('0x22')](function(_0x5a5024){return _0x5a5024;});})[_0x87cd('0x22')](function(_0x112f03){if(_0x112f03){_0x22185e[_0x87cd('0x2a')][_0x87cd('0x6b')]=_0x112f03[0x0];if(!_0x1c2d86[_0x87cd('0x5a')][_0x87cd('0x60')])return;return db[_0x87cd('0x6c')][_0x87cd('0x58')]({'where':{'id':_0x1c2d86[_0x87cd('0x5a')][_0x87cd('0x60')],'role':_0x87cd('0x6d')},'attributes':['id','name',_0x87cd('0x6e'),'email','internal'],'raw':!![]});}return null;})[_0x87cd('0x22')](function(_0x53c731){if(!_0x53c731)return null;_0x22185e['message']['agent']=_0x53c731;return _0x22185e;})['then'](function(_0x141981){if(_0x141981){if(_0x1c2d86[_0x87cd('0x5a')][_0x87cd('0x6f')]){_0x22185e[_0x87cd('0x2a')][_0x87cd('0x70')]=util['format'](_0x87cd('0x71'),_0x1c2d86[_0x87cd('0x65')][_0x87cd('0x3b')]);_0x22185e['message'][_0x87cd('0x72')]=_0x22185e['channel'];_0x22185e[_0x87cd('0x2a')][_0x87cd('0x73')]=_0x22185e[_0x87cd('0x72')];_0x22185e[_0x87cd('0x2a')]['event']='accept';return respondWithRpcPromise(_0x87cd('0x74'),'EventManager',{'event':_0x87cd('0x75'),'message':_0x22185e['message']},client9002)[_0x87cd('0x22')](function(){return _0x22185e;});}return _0x22185e;}return null;})['then'](respondWithResult(_0x5a0900,null))[_0x87cd('0x2c')](handleError(_0x5a0900,null));};var interaction_log=require(_0x87cd('0x16'))(_0x87cd('0x76'));exports['reject']=function(_0x4d4695,_0x3533b9,_0x286d1e){var _0x3053f0={'agent':{},'channel':'fax'};if(_0x4d4695['body']['id']){delete _0x4d4695[_0x87cd('0x5a')]['id'];}_0x4d4695[_0x87cd('0x5a')][_0x87cd('0x60')]=_0x4d4695[_0x87cd('0x5a')][_0x87cd('0x60')]||_0x4d4695[_0x87cd('0x65')]['id'];_0x3053f0[_0x87cd('0x6d')]['id']=_0x4d4695[_0x87cd('0x5a')][_0x87cd('0x60')];return db['FaxMessage'][_0x87cd('0x58')]({'where':{'id':_0x4d4695['params']['id'],'UserId':null}})[_0x87cd('0x22')](handleEntityNotFound(_0x3533b9,null))[_0x87cd('0x22')](function(_0x3e31fd){if(_0x3e31fd){_0x3053f0[_0x87cd('0x2a')]=_0x3e31fd[_0x87cd('0x61')]({'plain':!![]});return db[_0x87cd('0x62')]['find']({'where':{'id':_0x3e31fd[_0x87cd('0x77')]}});}return null;})[_0x87cd('0x22')](handleEntityNotFound(_0x3533b9,null))['then'](function(_0x33e9f5){if(_0x33e9f5){_0x3053f0['interaction']=_0x33e9f5[_0x87cd('0x61')]({'plain':!![]});interaction_log[_0x87cd('0x23')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4d4695['user']['id'],_0x4d4695['user']['name'],_0x4d4695['user'][_0x87cd('0x66')],_0x3053f0[_0x87cd('0x64')]['id'],_0x4d4695[_0x87cd('0x5a')]?JSON['stringify'](_0x4d4695[_0x87cd('0x5a')]):_0x87cd('0x78'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x3053f0);}return null;})[_0x87cd('0x22')](function(_0x8c8910){var _0xaadf85=_0x87cd('0x79')+_0x8c8910['message']['ContactId'];return db[_0x87cd('0x7a')][_0x87cd('0x42')](_0xaadf85,{'type':db[_0x87cd('0x7b')][_0x87cd('0x69')][_0x87cd('0x6a')],'raw':!![]})['then'](function(_0x3aab1a){return _0x3aab1a;});})[_0x87cd('0x22')](function(_0x4feef3){if(_0x4feef3){_0x3053f0['message'][_0x87cd('0x6b')]=_0x4feef3[0x0];if(!_0x4d4695['body'][_0x87cd('0x60')])return;return db[_0x87cd('0x6c')][_0x87cd('0x58')]({'where':{'id':_0x4d4695[_0x87cd('0x5a')][_0x87cd('0x60')],'role':_0x87cd('0x6d')},'attributes':['id',_0x87cd('0x3b'),_0x87cd('0x6e'),'email',_0x87cd('0x7c')],'raw':!![]});}return null;})[_0x87cd('0x22')](function(_0x40d18e){if(!_0x40d18e)return null;_0x3053f0[_0x87cd('0x2a')][_0x87cd('0x6d')]=_0x40d18e;return _0x3053f0;})[_0x87cd('0x22')](function(_0x45b442){if(_0x45b442){_0x45b442[_0x87cd('0x2a')][_0x87cd('0x70')]=util[_0x87cd('0x5e')]('SIP/%s',_0x4d4695[_0x87cd('0x65')]['name']);_0x45b442[_0x87cd('0x2a')]['channel']=_0x3053f0[_0x87cd('0x72')];_0x45b442[_0x87cd('0x2a')][_0x87cd('0x73')]=_0x3053f0[_0x87cd('0x72')];_0x45b442[_0x87cd('0x2a')][_0x87cd('0x7d')]=_0x87cd('0x35');respondWithRpcPromise(_0x87cd('0x74'),_0x87cd('0x74'),{'event':_0x87cd('0x7e'),'message':_0x45b442['message']},client9002);return _0x3053f0;}return null;})[_0x87cd('0x22')](respondWithResult(_0x3533b9,null))[_0x87cd('0x2c')](handleError(_0x3533b9,null));};exports[_0x87cd('0x7f')]=function(_0xb6a748,_0x3c113d){var _0x4dbcc3;return db[_0x87cd('0x3e')][_0x87cd('0x7f')](_0xb6a748['body'],{})[_0x87cd('0x22')](function(_0x105cc2){_0x4dbcc3=_0x105cc2;return db[_0x87cd('0x80')][_0x87cd('0x81')]({'where':{'id':_0x4dbcc3[_0x87cd('0x82')]}});})[_0x87cd('0x22')](function(_0x5b8510){if(_[_0x87cd('0x63')](_0x5b8510)){return;}else{_0x4dbcc3[_0x87cd('0x5d')]=_0x5b8510[_0x87cd('0x5d')];return db[_0x87cd('0x83')][_0x87cd('0x81')]({'where':{'id':_0x4dbcc3['AttachmentId']}});}})[_0x87cd('0x22')](function(_0x389218){return respondWithRpcPromise(_0x87cd('0x84'),_0x87cd('0x84'),{'FaxAccountId':_[_0x87cd('0x63')](_0xb6a748[_0x87cd('0x5a')])?undefined:_0xb6a748['body']['FaxAccountId'],'path':_[_0x87cd('0x63')](_0x389218)?undefined:util[_0x87cd('0x5e')](_0x87cd('0x85'),_0x389218[_0x87cd('0x86')]),'fax':_[_0x87cd('0x63')](_0x4dbcc3[_0x87cd('0x5d')])?undefined:_0x4dbcc3[_0x87cd('0x5d')],'AttachmentId':_0x4dbcc3[_0x87cd('0x87')]},client9002);})[_0x87cd('0x22')](respondWithResult(_0x3c113d,0xc9))[_0x87cd('0x2c')](handleError(_0x3c113d,null));};exports[_0x87cd('0x88')]=function(_0x5e5fa6,_0x59f36a){var _0x24c70b=path[_0x87cd('0x89')](config[_0x87cd('0x8a')],_0x87cd('0x8b'),_0x87cd('0x8c'),_0x87cd('0x8d'));return db[_0x87cd('0x3e')][_0x87cd('0x58')]({'where':{'id':_0x5e5fa6['params']['id']},'include':[{'model':db[_0x87cd('0x83')],'as':_0x87cd('0x83')}]})[_0x87cd('0x22')](handleEntityNotFound(_0x59f36a,null))[_0x87cd('0x22')](function(_0xb07a23){if(_0xb07a23){return _0x59f36a[_0x87cd('0x88')](path[_0x87cd('0x89')](_0x24c70b,_0xb07a23['Attachment']['basename']));}})[_0x87cd('0x2c')](handleError(_0x59f36a,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 65202ba..ebf04d7 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 _0x855f=['remove','emit','hasOwnProperty','hook','exports','events','FaxMessage','setMaxListeners','save','update'];(function(_0x23e6bb,_0x5c2d69){var _0x1e3b4c=function(_0x1afc46){while(--_0x1afc46){_0x23e6bb['push'](_0x23e6bb['shift']());}};_0x1e3b4c(++_0x5c2d69);}(_0x855f,0x145));var _0xf855=function(_0x72aa4c,_0xd62598){_0x72aa4c=_0x72aa4c-0x0;var _0x180bbd=_0x855f[_0x72aa4c];return _0x180bbd;};'use strict';var EventEmitter=require(_0xf855('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0xf855('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xf855('0x2')](0x0);var events={'afterCreate':_0xf855('0x3'),'afterUpdate':_0xf855('0x4'),'afterDestroy':_0xf855('0x5')};function emitEvent(_0x5046aa){return function(_0x4620ba,_0x33ad4f,_0x4887c0){FaxMessageEvents['emit'](_0x5046aa+':'+_0x4620ba['id'],_0x4620ba);FaxMessageEvents[_0xf855('0x6')](_0x5046aa,_0x4620ba);_0x4887c0(null);};}for(var e in events){if(events[_0xf855('0x7')](e)){var event=events[e];FaxMessage[_0xf855('0x8')](e,emitEvent(event));}}module[_0xf855('0x9')]=FaxMessageEvents; \ No newline at end of file +var _0x9b97=['setMaxListeners','save','update','remove','emit','hook','exports','events','FaxMessage'];(function(_0x4df17c,_0x2d2b61){var _0x4e79b5=function(_0x2134a5){while(--_0x2134a5){_0x4df17c['push'](_0x4df17c['shift']());}};_0x4e79b5(++_0x2d2b61);}(_0x9b97,0x11e));var _0x79b9=function(_0x1e1922,_0xb0c1cf){_0x1e1922=_0x1e1922-0x0;var _0x518406=_0x9b97[_0x1e1922];return _0x518406;};'use strict';var EventEmitter=require(_0x79b9('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x79b9('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x79b9('0x2')](0x0);var events={'afterCreate':_0x79b9('0x3'),'afterUpdate':_0x79b9('0x4'),'afterDestroy':_0x79b9('0x5')};function emitEvent(_0x10c823){return function(_0x4edfcf,_0x5194ab,_0x1e0ed2){FaxMessageEvents[_0x79b9('0x6')](_0x10c823+':'+_0x4edfcf['id'],_0x4edfcf);FaxMessageEvents[_0x79b9('0x6')](_0x10c823,_0x4edfcf);_0x1e0ed2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0x79b9('0x7')](e,emitEvent(event));}}module[_0x79b9('0x8')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index e0fc1bb..5aeecc1 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 _0xe545=['FaxMessage','fti_fax_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','findOne','FaxInteractionId','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./faxMessage.attributes','exports'];(function(_0x24bfd4,_0x222194){var _0x2b277c=function(_0x2f564c){while(--_0x2f564c){_0x24bfd4['push'](_0x24bfd4['shift']());}};_0x2b277c(++_0x222194);}(_0xe545,0x12a));var _0x5e54=function(_0x1a8d8b,_0x3715d5){_0x1a8d8b=_0x1a8d8b-0x0;var _0x1f0443=_0xe545[_0x1a8d8b];return _0x1f0443;};'use strict';var _=require('lodash');var util=require(_0x5e54('0x0'));var logger=require(_0x5e54('0x1'))(_0x5e54('0x2'));var moment=require(_0x5e54('0x3'));var BPromise=require(_0x5e54('0x4'));var rp=require(_0x5e54('0x5'));var fs=require('fs');var path=require(_0x5e54('0x6'));var rimraf=require('rimraf');var config=require(_0x5e54('0x7'));var attributes=require(_0x5e54('0x8'));module[_0x5e54('0x9')]=function(_0x537dd5,_0xc3d9fa){return _0x537dd5['define'](_0x5e54('0xa'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0x5e54('0xb'),'fields':[_0x5e54('0xc')],'type':_0x5e54('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x291edc,_0x31d259,_0xe66788){var _0x21da8d=_0x537dd5[_0x5e54('0xe')];var _0x2aaecf=_0x291edc[_0x5e54('0xf')]({'plain':!![]});if(_0x2aaecf[_0x5e54('0x10')]['toLowerCase']()==='in'||_0x2aaecf[_0x5e54('0x10')][_0x5e54('0x11')]()===_0x5e54('0x12')&&!_0x2aaecf['secret']&&!_[_0x5e54('0x13')](_0x2aaecf[_0x5e54('0x14')])){_0x21da8d['FaxInteraction'][_0x5e54('0x15')]({'where':{'id':_0x2aaecf[_0x5e54('0x16')]}})['then'](function(_0x1b7e65){if(_0x1b7e65){_0x1b7e65[_0x5e54('0x17')]({'lastMsgAt':_0x2aaecf[_0x5e54('0x18')],'lastMsgDirection':_0x2aaecf['direction'][_0x5e54('0x11')]()});}})['catch'](function(_0x28f444){console[_0x5e54('0x19')](_0x28f444);});}_0xe66788();}},'charset':_0x5e54('0x1a'),'collate':_0x5e54('0x1b')});}; \ No newline at end of file +var _0x596d=['FaxInteraction','findOne','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports','define','FaxMessage','fti_fax_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','UserId'];(function(_0x20cae2,_0x378d30){var _0x32229b=function(_0x2eac7a){while(--_0x2eac7a){_0x20cae2['push'](_0x20cae2['shift']());}};_0x32229b(++_0x378d30);}(_0x596d,0x1f4));var _0xd596=function(_0x417781,_0x44285b){_0x417781=_0x417781-0x0;var _0x224c3a=_0x596d[_0x417781];return _0x224c3a;};'use strict';var _=require(_0xd596('0x0'));var util=require(_0xd596('0x1'));var logger=require(_0xd596('0x2'))('api');var moment=require(_0xd596('0x3'));var BPromise=require(_0xd596('0x4'));var rp=require(_0xd596('0x5'));var fs=require('fs');var path=require(_0xd596('0x6'));var rimraf=require('rimraf');var config=require(_0xd596('0x7'));var attributes=require('./faxMessage.attributes');module[_0xd596('0x8')]=function(_0x31b96e,_0x43e854){return _0x31b96e[_0xd596('0x9')](_0xd596('0xa'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0xd596('0xb'),'fields':[_0xd596('0xc')],'type':_0xd596('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2157f9,_0x446f2b,_0x2edd5d){var _0x4ee13d=_0x31b96e[_0xd596('0xe')];var _0x120d90=_0x2157f9[_0xd596('0xf')]({'plain':!![]});if(_0x120d90[_0xd596('0x10')][_0xd596('0x11')]()==='in'||_0x120d90[_0xd596('0x10')]['toLowerCase']()==='out'&&!_0x120d90[_0xd596('0x12')]&&!_['isNil'](_0x120d90[_0xd596('0x13')])){_0x4ee13d[_0xd596('0x14')][_0xd596('0x15')]({'where':{'id':_0x120d90['FaxInteractionId']}})['then'](function(_0x356136){if(_0x356136){_0x356136['update']({'lastMsgAt':_0x120d90[_0xd596('0x16')],'lastMsgDirection':_0x120d90['direction'][_0xd596('0x11')]()});}})[_0xd596('0x17')](function(_0x59007e){console['error'](_0x59007e);});}_0x2edd5d();}},'charset':_0xd596('0x18'),'collate':_0xd596('0x19')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index c53cb38..bfb82c1 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 _0x6aa7=['redis','defaults','socket.io-emitter','./faxMessage.socket','request','then','info','FaxMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','CreateFaxMessage','FaxMessage','create','options','raw','catch','update','body','attributes','limit','UpdateFaxMessage','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client'];(function(_0x261185,_0x51bb20){var _0x594f07=function(_0x209db4){while(--_0x209db4){_0x261185['push'](_0x261185['shift']());}};_0x594f07(++_0x51bb20);}(_0x6aa7,0x178));var _0x76aa=function(_0x56c698,_0x14cdff){_0x56c698=_0x56c698-0x0;var _0x498eff=_0x6aa7[_0x56c698];return _0x498eff;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});config[_0x76aa('0x9')]=_[_0x76aa('0xa')](config[_0x76aa('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x76aa('0xb'))(new Redis(config[_0x76aa('0x9')]));require(_0x76aa('0xc'))['register'](socket);function respondWithRpcPromise(_0xcd99aa,_0x25856d,_0x41643a){return new BPromise(function(_0x16cb50,_0x37f1ab){return client[_0x76aa('0xd')](_0xcd99aa,_0x41643a)[_0x76aa('0xe')](function(_0x8dc35c){logger[_0x76aa('0xf')](_0x76aa('0x10'),_0x25856d,'request\x20sent');logger[_0x76aa('0x11')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x25856d,_0x76aa('0x12'),JSON[_0x76aa('0x13')](_0x8dc35c));if(_0x8dc35c[_0x76aa('0x14')]){if(_0x8dc35c[_0x76aa('0x14')][_0x76aa('0x15')]===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x25856d,_0x8dc35c[_0x76aa('0x14')]['message']);return _0x37f1ab(_0x8dc35c[_0x76aa('0x14')][_0x76aa('0x16')]);}logger['error'](_0x76aa('0x10'),_0x25856d,_0x8dc35c['error'][_0x76aa('0x16')]);return _0x16cb50(_0x8dc35c['error'][_0x76aa('0x16')]);}else{logger[_0x76aa('0xf')](_0x76aa('0x10'),_0x25856d,_0x76aa('0x12'));_0x16cb50(_0x8dc35c[_0x76aa('0x17')][_0x76aa('0x16')]);}})['catch'](function(_0x5d6202){logger[_0x76aa('0x14')](_0x76aa('0x10'),_0x25856d,_0x5d6202);_0x37f1ab(_0x5d6202);});});}exports[_0x76aa('0x18')]=function(_0x15b931){var _0x15109b=this;return new Promise(function(_0x191560,_0x19af92){return db[_0x76aa('0x19')][_0x76aa('0x1a')](_0x15b931['body'],{'raw':_0x15b931[_0x76aa('0x1b')]?_0x15b931[_0x76aa('0x1b')][_0x76aa('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x41463a){logger[_0x76aa('0xf')](_0x76aa('0x18'),_0x15b931);logger[_0x76aa('0x11')](_0x76aa('0x18'),_0x15b931,JSON[_0x76aa('0x13')](_0x41463a));_0x191560(_0x41463a);})[_0x76aa('0x1d')](function(_0x3363b3){logger[_0x76aa('0x14')](_0x76aa('0x18'),_0x3363b3[_0x76aa('0x16')],_0x15b931);_0x19af92(_0x15109b[_0x76aa('0x14')](0x1f4,_0x3363b3[_0x76aa('0x16')]));});});};exports['UpdateFaxMessage']=function(_0xb5e8a9){var _0x1d6d15=this;return new Promise(function(_0x25c614,_0x2e7ab4){return db[_0x76aa('0x19')][_0x76aa('0x1e')](_0xb5e8a9[_0x76aa('0x1f')],{'raw':_0xb5e8a9[_0x76aa('0x1b')]?_0xb5e8a9[_0x76aa('0x1b')][_0x76aa('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb5e8a9['options']?_0xb5e8a9[_0x76aa('0x1b')]['where']||null:null,'attributes':_0xb5e8a9[_0x76aa('0x1b')]?_0xb5e8a9[_0x76aa('0x1b')][_0x76aa('0x20')]||null:null,'limit':_0xb5e8a9[_0x76aa('0x1b')]?_0xb5e8a9[_0x76aa('0x1b')][_0x76aa('0x21')]||null:null})[_0x76aa('0xe')](function(_0x3827ec){logger[_0x76aa('0xf')](_0x76aa('0x22'),_0xb5e8a9);logger['debug'](_0x76aa('0x22'),_0xb5e8a9,JSON[_0x76aa('0x13')](_0x3827ec));_0x25c614(_0x3827ec);})[_0x76aa('0x1d')](function(_0x928ccf){logger[_0x76aa('0x14')](_0x76aa('0x22'),_0x928ccf[_0x76aa('0x16')],_0xb5e8a9);_0x2e7ab4(_0x1d6d15['error'](0x1f4,_0x928ccf[_0x76aa('0x16')]));});});}; \ No newline at end of file +var _0x9bde=['body','options','raw','CreateFaxMessage','debug','UpdateFaxMessage','limit','then','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','request','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','FaxMessage','create'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x9bde,0xe1));var _0xe9bd=function(_0x5f5a55,_0x2997ad){_0x5f5a55=_0x5f5a55-0x0;var _0x52acc8=_0x9bde[_0x5f5a55];return _0x52acc8;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var moment=require('moment');var BPromise=require(_0xe9bd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe9bd('0x2'));var db=require(_0xe9bd('0x3'))['db'];var utils=require(_0xe9bd('0x4'));var logger=require(_0xe9bd('0x5'))(_0xe9bd('0x6'));var config=require(_0xe9bd('0x7'));var jayson=require(_0xe9bd('0x8'));var client=jayson['client'][_0xe9bd('0x9')]({'port':0x232a});config[_0xe9bd('0xa')]=_[_0xe9bd('0xb')](config[_0xe9bd('0xa')],{'host':_0xe9bd('0xc'),'port':0x18eb});var socket=require(_0xe9bd('0xd'))(new Redis(config[_0xe9bd('0xa')]));require(_0xe9bd('0xe'))[_0xe9bd('0xf')](socket);function respondWithRpcPromise(_0x45c7ba,_0x581602,_0x5f36c8){return new BPromise(function(_0x3c8e95,_0x145521){return client[_0xe9bd('0x10')](_0x45c7ba,_0x5f36c8)['then'](function(_0x12c96e){logger[_0xe9bd('0x11')](_0xe9bd('0x12'),_0x581602,_0xe9bd('0x13'));logger['debug'](_0xe9bd('0x14'),_0x581602,'request\x20sent',JSON[_0xe9bd('0x15')](_0x12c96e));if(_0x12c96e[_0xe9bd('0x16')]){if(_0x12c96e[_0xe9bd('0x16')]['code']===0x1f4){logger['error'](_0xe9bd('0x12'),_0x581602,_0x12c96e[_0xe9bd('0x16')][_0xe9bd('0x17')]);return _0x145521(_0x12c96e[_0xe9bd('0x16')][_0xe9bd('0x17')]);}logger[_0xe9bd('0x16')](_0xe9bd('0x12'),_0x581602,_0x12c96e['error'][_0xe9bd('0x17')]);return _0x3c8e95(_0x12c96e[_0xe9bd('0x16')][_0xe9bd('0x17')]);}else{logger['info'](_0xe9bd('0x12'),_0x581602,_0xe9bd('0x13'));_0x3c8e95(_0x12c96e[_0xe9bd('0x18')][_0xe9bd('0x17')]);}})['catch'](function(_0x20ec32){logger['error'](_0xe9bd('0x12'),_0x581602,_0x20ec32);_0x145521(_0x20ec32);});});}exports['CreateFaxMessage']=function(_0x26aa4a){var _0x417113=this;return new Promise(function(_0x134c4e,_0x3dda13){return db[_0xe9bd('0x19')][_0xe9bd('0x1a')](_0x26aa4a[_0xe9bd('0x1b')],{'raw':_0x26aa4a['options']?_0x26aa4a[_0xe9bd('0x1c')][_0xe9bd('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x37aec1){logger['info'](_0xe9bd('0x1e'),_0x26aa4a);logger[_0xe9bd('0x1f')](_0xe9bd('0x1e'),_0x26aa4a,JSON[_0xe9bd('0x15')](_0x37aec1));_0x134c4e(_0x37aec1);})['catch'](function(_0x24cf25){logger[_0xe9bd('0x16')](_0xe9bd('0x1e'),_0x24cf25[_0xe9bd('0x17')],_0x26aa4a);_0x3dda13(_0x417113[_0xe9bd('0x16')](0x1f4,_0x24cf25[_0xe9bd('0x17')]));});});};exports[_0xe9bd('0x20')]=function(_0x43ea90){var _0x1ae889=this;return new Promise(function(_0x5987af,_0x3c211a){return db[_0xe9bd('0x19')]['update'](_0x43ea90[_0xe9bd('0x1b')],{'raw':_0x43ea90[_0xe9bd('0x1c')]?_0x43ea90[_0xe9bd('0x1c')][_0xe9bd('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43ea90[_0xe9bd('0x1c')]?_0x43ea90[_0xe9bd('0x1c')]['where']||null:null,'attributes':_0x43ea90['options']?_0x43ea90[_0xe9bd('0x1c')]['attributes']||null:null,'limit':_0x43ea90[_0xe9bd('0x1c')]?_0x43ea90[_0xe9bd('0x1c')][_0xe9bd('0x21')]||null:null})[_0xe9bd('0x22')](function(_0x4057df){logger['info']('UpdateFaxMessage',_0x43ea90);logger[_0xe9bd('0x1f')](_0xe9bd('0x20'),_0x43ea90,JSON[_0xe9bd('0x15')](_0x4057df));_0x5987af(_0x4057df);})[_0xe9bd('0x23')](function(_0xe2436){logger[_0xe9bd('0x16')](_0xe9bd('0x20'),_0xe2436[_0xe9bd('0x17')],_0x43ea90);_0x3c211a(_0x1ae889[_0xe9bd('0x16')](0x1f4,_0xe2436['message']));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 8361907..9f798ba 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 _0x6513=['update','emit','removeListener','register','length','./faxMessage.events','save'];(function(_0x4dd16c,_0x3ea25d){var _0x4dcadb=function(_0x176224){while(--_0x176224){_0x4dd16c['push'](_0x4dd16c['shift']());}};_0x4dcadb(++_0x3ea25d);}(_0x6513,0x17f));var _0x3651=function(_0x4b7e4d,_0x82d2ab){_0x4b7e4d=_0x4b7e4d-0x0;var _0x38d6af=_0x6513[_0x4b7e4d];return _0x38d6af;};'use strict';var FaxMessageEvents=require(_0x3651('0x0'));var events=[_0x3651('0x1'),'remove',_0x3651('0x2')];function createListener(_0x500cd8,_0x9fb3a9){return function(_0x445ef8){_0x9fb3a9[_0x3651('0x3')](_0x500cd8,_0x445ef8);};}function removeListener(_0x282ee5,_0x4cbefb){return function(){FaxMessageEvents[_0x3651('0x4')](_0x282ee5,_0x4cbefb);};}exports[_0x3651('0x5')]=function(_0x70762d){for(var _0x128670=0x0,_0x3e97ac=events[_0x3651('0x6')];_0x128670<_0x3e97ac;_0x128670++){var _0x2b8f69=events[_0x128670];var _0x2424d2=createListener('faxMessage:'+_0x2b8f69,_0x70762d);FaxMessageEvents['on'](_0x2b8f69,_0x2424d2);}}; \ No newline at end of file +var _0x7706=['./faxMessage.events','save','remove','update','emit','removeListener','register','length'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7706,0x150));var _0x6770=function(_0x40a66f,_0x1b974e){_0x40a66f=_0x40a66f-0x0;var _0x10bf2a=_0x7706[_0x40a66f];return _0x10bf2a;};'use strict';var FaxMessageEvents=require(_0x6770('0x0'));var events=[_0x6770('0x1'),_0x6770('0x2'),_0x6770('0x3')];function createListener(_0x42f78c,_0x6247bb){return function(_0x30b735){_0x6247bb[_0x6770('0x4')](_0x42f78c,_0x30b735);};}function removeListener(_0x58c6cf,_0x39651c){return function(){FaxMessageEvents[_0x6770('0x5')](_0x58c6cf,_0x39651c);};}exports[_0x6770('0x6')]=function(_0x56952b){for(var _0x12baf7=0x0,_0x303fbb=events[_0x6770('0x7')];_0x12baf7<_0x303fbb;_0x12baf7++){var _0x25c237=events[_0x12baf7];var _0x5a4709=createListener('faxMessage:'+_0x25c237,_0x56952b);FaxMessageEvents['on'](_0x25c237,_0x5a4709);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 892ae14..86b881c 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 _0x0565=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/download','post','tracked','create','update','/:id/accept','accept','/:id/reject','reject','delete','exports','multer'];(function(_0x5c6be5,_0x3ff1d5){var _0x151348=function(_0x3df6c6){while(--_0x3df6c6){_0x5c6be5['push'](_0x5c6be5['shift']());}};_0x151348(++_0x3ff1d5);}(_0x0565,0xf2));var _0x5056=function(_0x172747,_0x1732bd){_0x172747=_0x172747-0x0;var _0x509692=_0x0565[_0x172747];return _0x509692;};'use strict';var multer=require(_0x5056('0x0'));var util=require(_0x5056('0x1'));var path=require(_0x5056('0x2'));var timeout=require(_0x5056('0x3'));var express=require(_0x5056('0x4'));var router=express[_0x5056('0x5')]();var fs_extra=require(_0x5056('0x6'));var auth=require(_0x5056('0x7'));var interaction=require(_0x5056('0x8'));var config=require(_0x5056('0x9'));var controller=require('./faxMessage.controller');router[_0x5056('0xa')]('/',auth[_0x5056('0xb')](),controller[_0x5056('0xc')]);router[_0x5056('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x5056('0xd')]);router[_0x5056('0xa')](_0x5056('0xe'),auth[_0x5056('0xb')](),controller[_0x5056('0xf')]);router[_0x5056('0xa')](_0x5056('0x10'),auth[_0x5056('0xb')](),controller['download']);router[_0x5056('0x11')]('/',auth[_0x5056('0xb')](),interaction[_0x5056('0x12')]('fax','faxmessage:create'),controller[_0x5056('0x13')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x5056('0x14')]);router['put'](_0x5056('0x15'),auth[_0x5056('0xb')](),controller[_0x5056('0x16')]);router['put'](_0x5056('0x17'),auth[_0x5056('0xb')](),controller[_0x5056('0x18')]);router[_0x5056('0x19')](_0x5056('0xe'),auth[_0x5056('0xb')](),controller['destroy']);module[_0x5056('0x1a')]=router; \ No newline at end of file +var _0x44a3=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/:id','show','download','fax','create','put','update','/:id/accept','accept','reject','delete','exports'];(function(_0x51069a,_0x5b3d83){var _0x31294d=function(_0xa8767b){while(--_0xa8767b){_0x51069a['push'](_0x51069a['shift']());}};_0x31294d(++_0x5b3d83);}(_0x44a3,0x1a9));var _0x344a=function(_0x2ab3d9,_0x50e716){_0x2ab3d9=_0x2ab3d9-0x0;var _0x210a54=_0x44a3[_0x2ab3d9];return _0x210a54;};'use strict';var multer=require(_0x344a('0x0'));var util=require(_0x344a('0x1'));var path=require(_0x344a('0x2'));var timeout=require(_0x344a('0x3'));var express=require(_0x344a('0x4'));var router=express[_0x344a('0x5')]();var fs_extra=require(_0x344a('0x6'));var auth=require(_0x344a('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x344a('0x8'));var controller=require(_0x344a('0x9'));router[_0x344a('0xa')]('/',auth[_0x344a('0xb')](),controller[_0x344a('0xc')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x344a('0xa')](_0x344a('0xd'),auth[_0x344a('0xb')](),controller[_0x344a('0xe')]);router[_0x344a('0xa')]('/:id/download',auth[_0x344a('0xb')](),controller[_0x344a('0xf')]);router['post']('/',auth[_0x344a('0xb')](),interaction['tracked'](_0x344a('0x10'),'faxmessage:create'),controller[_0x344a('0x11')]);router[_0x344a('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x344a('0x13')]);router[_0x344a('0x12')](_0x344a('0x14'),auth[_0x344a('0xb')](),controller[_0x344a('0x15')]);router[_0x344a('0x12')]('/:id/reject',auth[_0x344a('0xb')](),controller[_0x344a('0x16')]);router[_0x344a('0x17')](_0x344a('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x344a('0x18')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 981a914..6522329 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 _0xe81b=['sequelize','exports','STRING','name','INTEGER','roundrobin'];(function(_0x30ecf5,_0x4e222a){var _0x340f85=function(_0x1613b0){while(--_0x1613b0){_0x30ecf5['push'](_0x30ecf5['shift']());}};_0x340f85(++_0x4e222a);}(_0xe81b,0xe4));var _0xbe81=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xe81b[_0x36ed48];return _0x51c63a;};'use strict';var Sequelize=require(_0xbe81('0x0'));module[_0xbe81('0x1')]={'name':{'type':Sequelize[_0xbe81('0x2')],'unique':_0xbe81('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xbe81('0x2')]},'timeout':{'type':Sequelize[_0xbe81('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory','beepall',_0xbe81('0x5')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xbe81('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xff36=['beepall','INTEGER','sequelize','exports','STRING','ENUM','rrmemory'];(function(_0x3c07f1,_0x2f6935){var _0x1d4c6b=function(_0x493580){while(--_0x493580){_0x3c07f1['push'](_0x3c07f1['shift']());}};_0x1d4c6b(++_0x2f6935);}(_0xff36,0x1de));var _0x6ff3=function(_0x53f9fd,_0x5676fa){_0x53f9fd=_0x53f9fd-0x0;var _0x1ed258=_0xff36[_0x53f9fd];return _0x1ed258;};'use strict';var Sequelize=require(_0x6ff3('0x0'));module[_0x6ff3('0x1')]={'name':{'type':Sequelize[_0x6ff3('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6ff3('0x3')](_0x6ff3('0x4'),_0x6ff3('0x5'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x6ff3('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 be5c6fd..fe6eff2 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 _0x9438=['union','compact','removeAgents','forEach','emit','addAgents','omit','userFaxQueue:save','isArray','userFaxQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','reject','save','destroy','then','get','end','error','stack','name','send','index','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','FaxQueue','includeAll','include','findAll','rows','show','params','keys','rawAttributes','length','find','catch','create','body','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserFaxQueue','FaxQueueId','User','findAndCountAll','UserId','faxPause','updatedAt','createdAt','format','SIP','getTeams','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','removeTeams','Team','select','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','TeamId','includes','all'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9438,0x98));var _0x8943=function(_0x30e4e1,_0x2a2da7){_0x30e4e1=_0x30e4e1-0x0;var _0x2de007=_0x9438[_0x30e4e1];return _0x2de007;};'use strict';var emlformat=require(_0x8943('0x0'));var rimraf=require(_0x8943('0x1'));var zipdir=require(_0x8943('0x2'));var jsonpatch=require(_0x8943('0x3'));var rp=require('request-promise');var moment=require(_0x8943('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x8943('0x5'));var sox=require('sox');var csv=require(_0x8943('0x6'));var ejs=require(_0x8943('0x7'));var fs=require('fs');var fs_extra=require(_0x8943('0x8'));var _=require(_0x8943('0x9'));var squel=require(_0x8943('0xa'));var crypto=require(_0x8943('0xb'));var jsforce=require(_0x8943('0xc'));var deskjs=require(_0x8943('0xd'));var toCsv=require(_0x8943('0x6'));var querystring=require(_0x8943('0xe'));var Papa=require(_0x8943('0xf'));var Redis=require(_0x8943('0x10'));var authService=require(_0x8943('0x11'));var qs=require(_0x8943('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x8943('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8943('0x14'))['db'];config[_0x8943('0x15')]=_[_0x8943('0x16')](config['redis'],{'host':_0x8943('0x17'),'port':0x18eb});var socket=require(_0x8943('0x18'))(new Redis(config[_0x8943('0x15')]));require(_0x8943('0x19'))[_0x8943('0x1a')](socket);function respondWithStatusCode(_0x476002,_0x2113f9){_0x2113f9=_0x2113f9||0xcc;return function(_0x3a131a){if(_0x3a131a){return _0x476002[_0x8943('0x1b')](_0x2113f9);}return _0x476002[_0x8943('0x1c')](_0x2113f9)['end']();};}function respondWithResult(_0x32a178,_0x1475fc){_0x1475fc=_0x1475fc||0xc8;return function(_0x305ddd){if(_0x305ddd){return _0x32a178[_0x8943('0x1c')](_0x1475fc)['json'](_0x305ddd);}};}function respondWithFilteredResult(_0x4ae741,_0x175845){return function(_0x2618a3){if(_0x2618a3){var _0x3f4670=typeof _0x175845[_0x8943('0x1d')]==='undefined'&&typeof _0x175845['limit']===_0x8943('0x1e');var _0x358147=_0x2618a3[_0x8943('0x1f')];var _0x4ce332=_0x3f4670?0x0:_0x175845[_0x8943('0x1d')];var _0x242057=_0x3f4670?_0x2618a3[_0x8943('0x1f')]:_0x175845[_0x8943('0x1d')]+_0x175845[_0x8943('0x20')];var _0xf5d523;if(_0x242057>=_0x358147){_0x242057=_0x358147;_0xf5d523=0xc8;}else{_0xf5d523=0xce;}_0x4ae741[_0x8943('0x1c')](_0xf5d523);return _0x4ae741[_0x8943('0x21')](_0x8943('0x22'),_0x4ce332+'-'+_0x242057+'/'+_0x358147)[_0x8943('0x23')](_0x2618a3);}return null;};}function patchUpdates(_0x397a54){return function(_0x1c9c21){try{jsonpatch['apply'](_0x1c9c21,_0x397a54,!![]);}catch(_0x443be3){return BPromise[_0x8943('0x24')](_0x443be3);}return _0x1c9c21[_0x8943('0x25')]();};}function saveUpdates(_0x18602f,_0x390c35){return function(_0x551143){if(_0x551143){return _0x551143['update'](_0x18602f)['then'](function(_0x520af3){return _0x520af3;});}return null;};}function removeEntity(_0xcb74ad,_0x9465ff){return function(_0x306e70){if(_0x306e70){return _0x306e70[_0x8943('0x26')]()[_0x8943('0x27')](function(){var _0x28beb6=_0x306e70[_0x8943('0x28')]({'plain':!![]});var _0x3fe574='FaxQueues';return db['UserProfileResource'][_0x8943('0x26')]({'where':{'type':_0x3fe574,'resourceId':_0x28beb6['id']}})[_0x8943('0x27')](function(){return _0x306e70;});})[_0x8943('0x27')](function(){_0xcb74ad[_0x8943('0x1c')](0xcc)[_0x8943('0x29')]();});}};}function handleEntityNotFound(_0x32f8b7,_0x424c94){return function(_0x532880){if(!_0x532880){_0x32f8b7['sendStatus'](0x194);}return _0x532880;};}function handleError(_0x44a957,_0x1480c2){_0x1480c2=_0x1480c2||0x1f4;return function(_0x3f5e0c){logger[_0x8943('0x2a')](_0x3f5e0c[_0x8943('0x2b')]);if(_0x3f5e0c[_0x8943('0x2c')]){delete _0x3f5e0c[_0x8943('0x2c')];}_0x44a957['status'](_0x1480c2)[_0x8943('0x2d')](_0x3f5e0c);};}exports[_0x8943('0x2e')]=function(_0x48c7c4,_0x4ad688){var _0x4458af={},_0x2a0495={},_0x35ee06={'count':0x0,'rows':[]};var _0x4cec56=_['map'](db['FaxQueue']['rawAttributes'],function(_0x5876f1){return{'name':_0x5876f1[_0x8943('0x2f')],'type':_0x5876f1[_0x8943('0x30')][_0x8943('0x31')]};});_0x2a0495[_0x8943('0x32')]=_[_0x8943('0x33')](_0x4cec56,_0x8943('0x2c'));_0x2a0495[_0x8943('0x34')]=_['keys'](_0x48c7c4[_0x8943('0x34')]);_0x2a0495[_0x8943('0x35')]=_[_0x8943('0x36')](_0x2a0495[_0x8943('0x32')],_0x2a0495[_0x8943('0x34')]);_0x4458af[_0x8943('0x37')]=_[_0x8943('0x36')](_0x2a0495[_0x8943('0x32')],qs['fields'](_0x48c7c4[_0x8943('0x34')][_0x8943('0x38')]));_0x4458af[_0x8943('0x37')]=_0x4458af[_0x8943('0x37')]['length']?_0x4458af[_0x8943('0x37')]:_0x2a0495[_0x8943('0x32')];if(!_0x48c7c4[_0x8943('0x34')][_0x8943('0x39')](_0x8943('0x3a'))){_0x4458af[_0x8943('0x20')]=qs[_0x8943('0x20')](_0x48c7c4[_0x8943('0x34')]['limit']);_0x4458af[_0x8943('0x1d')]=qs[_0x8943('0x1d')](_0x48c7c4['query']['offset']);}_0x4458af[_0x8943('0x3b')]=qs[_0x8943('0x3c')](_0x48c7c4['query'][_0x8943('0x3c')]);_0x4458af[_0x8943('0x3d')]=qs['filters'](_[_0x8943('0x3e')](_0x48c7c4['query'],_0x2a0495['filters']),_0x4cec56);if(_0x48c7c4[_0x8943('0x34')][_0x8943('0x3f')]){_0x4458af['where']=_[_0x8943('0x40')](_0x4458af[_0x8943('0x3d')],{'$or':_[_0x8943('0x33')](_0x4cec56,function(_0x406966){if(_0x406966[_0x8943('0x30')]!==_0x8943('0x41')){var _0x586300={};_0x586300[_0x406966[_0x8943('0x2c')]]={'$like':'%'+_0x48c7c4['query'][_0x8943('0x3f')]+'%'};return _0x586300;}})});}_0x4458af=_[_0x8943('0x40')]({},_0x4458af,_0x48c7c4[_0x8943('0x42')]);var _0x4de321={'where':_0x4458af[_0x8943('0x3d')]};return db[_0x8943('0x43')][_0x8943('0x1f')](_0x4de321)[_0x8943('0x27')](function(_0x240e4f){_0x35ee06[_0x8943('0x1f')]=_0x240e4f;if(_0x48c7c4['query'][_0x8943('0x44')]){_0x4458af[_0x8943('0x45')]=[{'all':!![]}];}return db['FaxQueue'][_0x8943('0x46')](_0x4458af);})[_0x8943('0x27')](function(_0x32097b){_0x35ee06[_0x8943('0x47')]=_0x32097b;return _0x35ee06;})[_0x8943('0x27')](respondWithFilteredResult(_0x4ad688,_0x4458af))['catch'](handleError(_0x4ad688,null));};exports[_0x8943('0x48')]=function(_0x5f69b6,_0x26862e){var _0x21e325={'raw':!![],'where':{'id':_0x5f69b6[_0x8943('0x49')]['id']}},_0x243ade={};_0x243ade[_0x8943('0x32')]=_[_0x8943('0x4a')](db[_0x8943('0x43')][_0x8943('0x4b')]);_0x243ade[_0x8943('0x34')]=_[_0x8943('0x4a')](_0x5f69b6[_0x8943('0x34')]);_0x243ade[_0x8943('0x35')]=_['intersection'](_0x243ade[_0x8943('0x32')],_0x243ade['query']);_0x21e325[_0x8943('0x37')]=_[_0x8943('0x36')](_0x243ade[_0x8943('0x32')],qs['fields'](_0x5f69b6['query']['fields']));_0x21e325[_0x8943('0x37')]=_0x21e325[_0x8943('0x37')][_0x8943('0x4c')]?_0x21e325[_0x8943('0x37')]:_0x243ade[_0x8943('0x32')];if(_0x5f69b6[_0x8943('0x34')][_0x8943('0x44')]){_0x21e325['include']=[{'all':!![]}];}_0x21e325=_[_0x8943('0x40')]({},_0x21e325,_0x5f69b6[_0x8943('0x42')]);return db[_0x8943('0x43')][_0x8943('0x4d')](_0x21e325)[_0x8943('0x27')](handleEntityNotFound(_0x26862e,null))[_0x8943('0x27')](respondWithResult(_0x26862e,null))[_0x8943('0x4e')](handleError(_0x26862e,null));};exports['create']=function(_0x1d5d41,_0x4631d1){return db[_0x8943('0x43')][_0x8943('0x4f')](_0x1d5d41[_0x8943('0x50')],{})[_0x8943('0x27')](function(_0x176cf4){var _0x32cb45=_0x1d5d41['user'][_0x8943('0x28')]({'plain':!![]});if(!_0x32cb45)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x32cb45[_0x8943('0x51')]==='user'){var _0x305e4f=_0x176cf4['get']({'plain':!![]});var _0x4fb09c='FaxQueues';return db[_0x8943('0x52')][_0x8943('0x4d')]({'where':{'name':_0x4fb09c,'userProfileId':_0x32cb45[_0x8943('0x53')]},'raw':!![]})[_0x8943('0x27')](function(_0x1395e0){if(_0x1395e0&&_0x1395e0[_0x8943('0x54')]===0x0){return db[_0x8943('0x55')][_0x8943('0x4f')]({'name':_0x305e4f[_0x8943('0x2c')],'resourceId':_0x305e4f['id'],'type':_0x1395e0['name'],'sectionId':_0x1395e0['id']},{})[_0x8943('0x27')](function(){return _0x176cf4;});}else{return _0x176cf4;}})[_0x8943('0x4e')](function(_0xea9567){logger[_0x8943('0x2a')](_0x8943('0x56'),_0xea9567);throw _0xea9567;});}return _0x176cf4;})[_0x8943('0x27')](respondWithResult(_0x4631d1,0xc9))[_0x8943('0x4e')](handleError(_0x4631d1,null));};exports[_0x8943('0x57')]=function(_0x491868,_0x106e28){if(_0x491868[_0x8943('0x50')]['id']){delete _0x491868[_0x8943('0x50')]['id'];}return db[_0x8943('0x43')][_0x8943('0x4d')]({'where':{'id':_0x491868[_0x8943('0x49')]['id']}})[_0x8943('0x27')](handleEntityNotFound(_0x106e28,null))[_0x8943('0x27')](saveUpdates(_0x491868['body'],null))[_0x8943('0x27')](respondWithResult(_0x106e28,null))[_0x8943('0x4e')](handleError(_0x106e28,null));};exports['destroy']=function(_0x138ef8,_0x2f96bc){return db[_0x8943('0x43')][_0x8943('0x4d')]({'where':{'id':_0x138ef8[_0x8943('0x49')]['id']}})[_0x8943('0x27')](handleEntityNotFound(_0x2f96bc,null))[_0x8943('0x27')](removeEntity(_0x2f96bc,null))[_0x8943('0x4e')](handleError(_0x2f96bc,null));};exports[_0x8943('0x58')]=function(_0x11f900,_0x29b6e2){return db['FaxQueue'][_0x8943('0x58')]()[_0x8943('0x27')](respondWithResult(_0x29b6e2,null))[_0x8943('0x4e')](handleError(_0x29b6e2,null));};exports[_0x8943('0x59')]=function(_0x5e8e0a,_0xf2b163,_0x218690){var _0x3a1cc0={'raw':!![],'where':{}},_0x2c9248={},_0x37d089;return db['FaxQueue'][_0x8943('0x5a')]({'where':{'id':_0x5e8e0a[_0x8943('0x49')]['id']}})[_0x8943('0x27')](handleEntityNotFound(_0xf2b163,null))['then'](function(_0x4511dd){if(_0x4511dd){_0x37d089=_0x4511dd[_0x8943('0x28')]({'plain':!![]});_0x2c9248[_0x8943('0x32')]=_['keys'](db[_0x8943('0x5b')][_0x8943('0x4b')]);_0x2c9248[_0x8943('0x34')]=_[_0x8943('0x4a')](_0x5e8e0a[_0x8943('0x34')]);_0x2c9248[_0x8943('0x35')]=_[_0x8943('0x36')](_0x2c9248[_0x8943('0x32')],_0x2c9248[_0x8943('0x34')]);_0x3a1cc0['attributes']=_[_0x8943('0x36')](_0x2c9248['model'],qs[_0x8943('0x38')](_0x5e8e0a[_0x8943('0x34')][_0x8943('0x38')]));_0x3a1cc0[_0x8943('0x37')]=_0x3a1cc0[_0x8943('0x37')]['length']?_0x3a1cc0[_0x8943('0x37')]:_0x2c9248['model'];if(!_0x5e8e0a['query']['hasOwnProperty'](_0x8943('0x3a'))){_0x3a1cc0[_0x8943('0x20')]=qs['limit'](_0x5e8e0a[_0x8943('0x34')]['limit']);_0x3a1cc0['offset']=qs['offset'](_0x5e8e0a['query']['offset']);}_0x3a1cc0[_0x8943('0x3b')]=qs['sort'](_0x5e8e0a[_0x8943('0x34')]['sort']);_0x3a1cc0[_0x8943('0x3d')]=qs[_0x8943('0x35')](_['pick'](_0x5e8e0a['query'],_0x2c9248[_0x8943('0x35')]));_0x3a1cc0[_0x8943('0x3d')][_0x8943('0x5c')]=_0x4511dd['id'];if(_0x5e8e0a[_0x8943('0x34')][_0x8943('0x3f')]){_0x3a1cc0[_0x8943('0x3d')]=_[_0x8943('0x40')](_0x3a1cc0[_0x8943('0x3d')],{'$or':_[_0x8943('0x33')](_0x3a1cc0[_0x8943('0x37')],function(_0x41e185){var _0x20c65f={};_0x20c65f[_0x41e185]={'$like':'%'+_0x5e8e0a[_0x8943('0x34')][_0x8943('0x3f')]+'%'};return _0x20c65f;})});}_0x3a1cc0=_[_0x8943('0x40')]({},_0x3a1cc0,_0x5e8e0a['options']);return db[_0x8943('0x5b')]['findAll'](_0x3a1cc0);}})[_0x8943('0x27')](function(_0x206800){if(_0x206800){return db[_0x8943('0x5d')][_0x8943('0x5e')]({'where':{'id':_[_0x8943('0x33')](_0x206800,_0x8943('0x5f')),'role':'agent'},'attributes':['id',_0x8943('0x2c'),_0x8943('0x60'),_0x8943('0x61'),_0x8943('0x62')]});}})['then'](function(_0x179f5f){if(_0x179f5f){return{'count':_0x179f5f[_0x8943('0x1f')],'rows':_[_0x8943('0x33')](_0x179f5f[_0x8943('0x47')],function(_0x5b0e20){return{'membername':_0x5b0e20[_0x8943('0x2c')],'UserId':_0x5b0e20['id'],'queue_name':_0x37d089[_0x8943('0x2c')],'FaxQueueId':_0x37d089['id'],'interface':util[_0x8943('0x63')]('%s/%s',_0x8943('0x64'),_0x5b0e20[_0x8943('0x2c')]),'penalty':0x0,'paused':_0x5b0e20[_0x8943('0x60')],'createdAt':_0x5b0e20[_0x8943('0x62')],'updatedAt':_0x5b0e20['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0xf2b163,_0x3a1cc0))[_0x8943('0x4e')](handleError(_0xf2b163,null));};exports['getTeams']=function(_0xa7b977,_0x5ada34,_0x1ad72a){var _0x347053={};var _0x2f8372={};var _0x162876;var _0x5bf19b;return db[_0x8943('0x43')][_0x8943('0x5a')]({'where':{'id':_0xa7b977[_0x8943('0x49')]['id']}})['then'](handleEntityNotFound(_0x5ada34,null))[_0x8943('0x27')](function(_0x4008a3){if(_0x4008a3){_0x162876=_0x4008a3;_0x2f8372[_0x8943('0x32')]=_[_0x8943('0x4a')](db['Team'][_0x8943('0x4b')]);_0x2f8372[_0x8943('0x34')]=_[_0x8943('0x4a')](_0xa7b977[_0x8943('0x34')]);_0x2f8372['filters']=_[_0x8943('0x36')](_0x2f8372[_0x8943('0x32')],_0x2f8372[_0x8943('0x34')]);_0x347053['attributes']=_[_0x8943('0x36')](_0x2f8372[_0x8943('0x32')],qs[_0x8943('0x38')](_0xa7b977['query']['fields']));_0x347053['attributes']=_0x347053[_0x8943('0x37')][_0x8943('0x4c')]?_0x347053[_0x8943('0x37')]:_0x2f8372[_0x8943('0x32')];_0x347053['order']=qs[_0x8943('0x3c')](_0xa7b977[_0x8943('0x34')][_0x8943('0x3c')]);_0x347053[_0x8943('0x3d')]=qs[_0x8943('0x35')](_[_0x8943('0x3e')](_0xa7b977[_0x8943('0x34')],_0x2f8372[_0x8943('0x35')]));if(_0xa7b977[_0x8943('0x34')][_0x8943('0x3f')]){_0x347053[_0x8943('0x3d')]=_[_0x8943('0x40')](_0x347053[_0x8943('0x3d')],{'$or':_[_0x8943('0x33')](_0x347053['attributes'],function(_0x3ec18d){var _0x2ccba3={};_0x2ccba3[_0x3ec18d]={'$like':'%'+_0xa7b977[_0x8943('0x34')][_0x8943('0x3f')]+'%'};return _0x2ccba3;})});}_0x347053=_[_0x8943('0x40')]({},_0x347053,_0xa7b977[_0x8943('0x42')]);return _0x162876[_0x8943('0x65')](_0x347053);}})['then'](function(_0x4ad692){if(_0x4ad692){_0x5bf19b=_0x4ad692[_0x8943('0x4c')];if(!_0xa7b977['query'][_0x8943('0x39')](_0x8943('0x3a'))){_0x347053[_0x8943('0x20')]=qs['limit'](_0xa7b977['query'][_0x8943('0x20')]);_0x347053['offset']=qs['offset'](_0xa7b977['query']['offset']);}return _0x162876['getTeams'](_0x347053);}})[_0x8943('0x27')](function(_0x4ebeaf){if(_0x4ebeaf){return _0x4ebeaf?{'count':_0x5bf19b,'rows':_0x4ebeaf}:null;}})[_0x8943('0x27')](respondWithResult(_0x5ada34,null))[_0x8943('0x4e')](handleError(_0x5ada34,null));};exports[_0x8943('0x66')]=function(_0x1154e0,_0x37d00e,_0x44d2c2){var _0x6a8495=_0x1154e0[_0x8943('0x50')][_0x8943('0x67')];return db['Team'][_0x8943('0x46')]({'where':{'id':_0x6a8495},'attributes':['id'],'include':[{'model':db['User'],'as':_0x8943('0x68'),'attributes':['id',_0x8943('0x2c'),_0x8943('0x69'),_0x8943('0x6a'),_0x8943('0x6b')],'raw':!![]}]})[_0x8943('0x27')](function(_0x116f65){if(_0x116f65){var _0x593365=_[_0x8943('0x6c')](_0x116f65,function(_0x168dba){var _0x2a2af2=_0x168dba[_0x8943('0x28')]({'plain':!![]});return _0x2a2af2[_0x8943('0x68')];});return db[_0x8943('0x43')][_0x8943('0x4d')]({'where':{'id':_0x1154e0[_0x8943('0x49')]['id']}})[_0x8943('0x27')](function(_0x403353){return db[_0x8943('0x6d')][_0x8943('0x6e')](function(_0x2b4c7c){return _0x403353[_0x8943('0x66')](_0x6a8495,{'transaction':_0x2b4c7c})[_0x8943('0x27')](function(){return BPromise['each'](_0x593365,function(_0x4c0a47){return db['UserFaxQueue'][_0x8943('0x6f')]({'where':{'UserId':_0x4c0a47['id'],'FaxQueueId':_0x1154e0[_0x8943('0x49')]['id']},'transaction':_0x2b4c7c});});})[_0x8943('0x27')](function(){_0x593365['forEach'](function(_0x160b60){socket['emit']('userFaxQueue:save',{'UserId':_0x160b60['id'],'FaxQueueId':_0x403353['id']});});});});});}})['then'](respondWithStatusCode(_0x37d00e,null))['catch'](handleError(_0x37d00e,null));};exports[_0x8943('0x70')]=function(_0x145e3f,_0x2678d2,_0x52f780){return db[_0x8943('0x71')][_0x8943('0x46')]({'where':{'id':_0x145e3f['query'][_0x8943('0x67')]},'attributes':['id'],'include':[{'model':db[_0x8943('0x5d')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2678d2,null))['then'](function(_0x595fc1){var _0x18450a=_[_0x8943('0x33')](_0x595fc1,'id');var _0x4a41ae=[];var _0x3b711a=[];var _0x1bb6e5=squel[_0x8943('0x72')]();_0x1bb6e5['field'](_0x8943('0x73'))[_0x8943('0x74')](_0x8943('0x75'),'tq')[_0x8943('0x76')](_0x8943('0x77'),'ut',_0x8943('0x78'))[_0x8943('0x3d')](_0x8943('0x79'),_0x145e3f[_0x8943('0x49')]['id']);for(var _0x488393=0x0;_0x488393<_0x595fc1[_0x8943('0x4c')];_0x488393+=0x1){let _0x3f13f0=_0x595fc1[_0x488393];for(var _0x416987=0x0;_0x416987<_0x3f13f0[_0x8943('0x68')][_0x8943('0x4c')];_0x416987+=0x1){let _0x4ed69f=_0x3f13f0[_0x8943('0x68')][_0x416987];var _0x3fa2e6=_0x1bb6e5[_0x8943('0x7a')]();_0x3fa2e6[_0x8943('0x3d')]('ut.UserId\x20=\x20?',_0x4ed69f['id']);_0x3b711a[_0x8943('0x7b')](db[_0x8943('0x6d')][_0x8943('0x34')](_0x3fa2e6[_0x8943('0x7c')](),{'type':db[_0x8943('0x6d')][_0x8943('0x7d')][_0x8943('0x7e')]})[_0x8943('0x27')](function(_0x50645e){if(_0x50645e[_0x8943('0x4c')]===0x1){return _0x4ed69f['id'];}else{var _0x324cdc=_['every'](_['map'](_0x50645e,_0x8943('0x7f')),function(_0x431c75){return _[_0x8943('0x80')](_0x18450a,_0x431c75);});if(_0x324cdc){return _0x4ed69f['id'];}}}));}}return BPromise[_0x8943('0x81')](_0x3b711a)[_0x8943('0x27')](function(_0x4f3ea5){_0x4a41ae=_(_0x4a41ae)[_0x8943('0x82')](_0x4f3ea5)[_0x8943('0x83')]()['value']();return db[_0x8943('0x43')]['find']({'where':{'id':_0x145e3f[_0x8943('0x49')]['id']}})[_0x8943('0x27')](function(_0x4a3464){return db[_0x8943('0x6d')]['transaction'](function(_0x36882d){return _0x4a3464[_0x8943('0x70')](_0x145e3f[_0x8943('0x34')][_0x8943('0x67')],{'transaction':_0x36882d})['then'](function(){if(!_['isEmpty'](_0x4a41ae)){return _0x4a3464[_0x8943('0x84')](_0x4a41ae,{'transaction':_0x36882d});}})[_0x8943('0x27')](function(){_0x4a41ae[_0x8943('0x85')](function(_0xd86166){socket[_0x8943('0x86')]('userFaxQueue:remove',{'UserId':_0xd86166,'FaxQueueId':_0x4a3464['id']});});});});});});})[_0x8943('0x27')](respondWithStatusCode(_0x2678d2,null))[_0x8943('0x4e')](handleError(_0x2678d2,null));};exports[_0x8943('0x87')]=function(_0x1e478c,_0x5ad13b,_0x4196bb){return db[_0x8943('0x43')][_0x8943('0x4d')]({'where':{'id':_0x1e478c[_0x8943('0x49')]['id']}})[_0x8943('0x27')](handleEntityNotFound(_0x5ad13b,null))[_0x8943('0x27')](function(_0x3298d0){if(_0x3298d0){return _0x3298d0[_0x8943('0x87')](_0x1e478c[_0x8943('0x50')][_0x8943('0x67')],_[_0x8943('0x88')](_0x1e478c['body'],[_0x8943('0x67'),'id'])||{})['spread'](function(_0x1b1a41){for(var _0x90bccb=0x0;_0x90bccb<_0x1e478c[_0x8943('0x50')][_0x8943('0x67')][_0x8943('0x4c')];_0x90bccb+=0x1){socket[_0x8943('0x86')](_0x8943('0x89'),{'UserId':Number(_0x1e478c['body']['ids'][_0x90bccb]),'FaxQueueId':Number(_0x1e478c[_0x8943('0x49')]['id'])});}return _0x1b1a41;});}})[_0x8943('0x27')](respondWithResult(_0x5ad13b,null))[_0x8943('0x4e')](handleError(_0x5ad13b,null));};exports['removeAgents']=function(_0x1cd5a1,_0x2d4b6e,_0x1baebf){return db[_0x8943('0x43')][_0x8943('0x4d')]({'where':{'id':_0x1cd5a1[_0x8943('0x49')]['id']}})[_0x8943('0x27')](handleEntityNotFound(_0x2d4b6e,null))[_0x8943('0x27')](function(_0x183be7){if(_0x183be7){return _0x183be7[_0x8943('0x84')](_0x1cd5a1['query']['ids'])[_0x8943('0x27')](function(){if(_[_0x8943('0x8a')](_0x1cd5a1['query'][_0x8943('0x67')])){for(var _0x3e5f28=0x0;_0x3e5f28<_0x1cd5a1[_0x8943('0x34')][_0x8943('0x67')]['length'];_0x3e5f28+=0x1){socket[_0x8943('0x86')](_0x8943('0x8b'),{'UserId':Number(_0x1cd5a1[_0x8943('0x34')][_0x8943('0x67')][_0x3e5f28]),'FaxQueueId':Number(_0x1cd5a1[_0x8943('0x49')]['id'])});}}else{socket[_0x8943('0x86')]('userFaxQueue:remove',{'UserId':Number(_0x1cd5a1[_0x8943('0x34')][_0x8943('0x67')]),'FaxQueueId':Number(_0x1cd5a1[_0x8943('0x49')]['id'])});}});}})[_0x8943('0x27')](respondWithStatusCode(_0x2d4b6e,null))[_0x8943('0x4e')](handleError(_0x2d4b6e,null));};exports['getAgents']=function(_0x1a9a09,_0x20ac36,_0x57eaee){var _0x36fcdc={};var _0x41deaa={};var _0x494dad;var _0x1df9fa;return db[_0x8943('0x43')][_0x8943('0x5a')]({'where':{'id':_0x1a9a09[_0x8943('0x49')]['id']}})[_0x8943('0x27')](handleEntityNotFound(_0x20ac36,null))[_0x8943('0x27')](function(_0x3589f6){if(_0x3589f6){_0x494dad=_0x3589f6;_0x41deaa[_0x8943('0x32')]=_[_0x8943('0x4a')](db['User']['rawAttributes']);_0x41deaa[_0x8943('0x34')]=_[_0x8943('0x4a')](_0x1a9a09[_0x8943('0x34')]);_0x41deaa[_0x8943('0x35')]=_['intersection'](_0x41deaa[_0x8943('0x32')],_0x41deaa['query']);_0x36fcdc[_0x8943('0x37')]=_[_0x8943('0x36')](_0x41deaa[_0x8943('0x32')],qs[_0x8943('0x38')](_0x1a9a09['query'][_0x8943('0x38')]));_0x36fcdc[_0x8943('0x37')]=_0x36fcdc['attributes'][_0x8943('0x4c')]?_0x36fcdc[_0x8943('0x37')]:_0x41deaa[_0x8943('0x32')];_0x36fcdc['order']=qs[_0x8943('0x3c')](_0x1a9a09[_0x8943('0x34')]['sort']);_0x36fcdc[_0x8943('0x3d')]=qs[_0x8943('0x35')](_[_0x8943('0x3e')](_0x1a9a09[_0x8943('0x34')],_0x41deaa[_0x8943('0x35')]));if(_0x1a9a09[_0x8943('0x34')][_0x8943('0x3f')]){_0x36fcdc[_0x8943('0x3d')]=_[_0x8943('0x40')](_0x36fcdc[_0x8943('0x3d')],{'$or':_[_0x8943('0x33')](_0x36fcdc[_0x8943('0x37')],function(_0x3ca9b4){var _0xa84930={};_0xa84930[_0x3ca9b4]={'$like':'%'+_0x1a9a09[_0x8943('0x34')][_0x8943('0x3f')]+'%'};return _0xa84930;})});}_0x36fcdc=_[_0x8943('0x40')]({},_0x36fcdc,_0x1a9a09[_0x8943('0x42')]);return _0x494dad['getAgents'](_0x36fcdc);}})[_0x8943('0x27')](function(_0x5624ac){if(_0x5624ac){_0x1df9fa=_0x5624ac[_0x8943('0x4c')];if(!_0x1a9a09[_0x8943('0x34')][_0x8943('0x39')](_0x8943('0x3a'))){_0x36fcdc[_0x8943('0x20')]=qs[_0x8943('0x20')](_0x1a9a09[_0x8943('0x34')]['limit']);_0x36fcdc[_0x8943('0x1d')]=qs['offset'](_0x1a9a09[_0x8943('0x34')][_0x8943('0x1d')]);}return _0x494dad[_0x8943('0x8c')](_0x36fcdc);}})[_0x8943('0x27')](function(_0x25c1b0){if(_0x25c1b0){return _0x25c1b0?{'count':_0x1df9fa,'rows':_0x25c1b0}:null;}})[_0x8943('0x27')](respondWithResult(_0x20ac36,null))[_0x8943('0x4e')](handleError(_0x20ac36,null));}; \ No newline at end of file +var _0xe858=['addAgents','omit','spread','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','register','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','sendStatus','name','send','map','FaxQueue','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','findAll','rows','catch','show','params','keys','length','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxQueues','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserFaxQueue','pick','FaxQueueId','findAndCountAll','UserId','agent','faxPause','updatedAt','format','createdAt','getTeams','Team','ids','User','Agents','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','removeTeams','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','union','compact','value','transaction','removeAgents','userFaxQueue:remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe858,0x116));var _0x8e85=function(_0x3a8b7c,_0x3e5db2){_0x3a8b7c=_0x3a8b7c-0x0;var _0x40eb80=_0xe858[_0x3a8b7c];return _0x40eb80;};'use strict';var emlformat=require(_0x8e85('0x0'));var rimraf=require(_0x8e85('0x1'));var zipdir=require(_0x8e85('0x2'));var jsonpatch=require(_0x8e85('0x3'));var rp=require(_0x8e85('0x4'));var moment=require('moment');var BPromise=require(_0x8e85('0x5'));var Mustache=require(_0x8e85('0x6'));var util=require(_0x8e85('0x7'));var path=require('path');var sox=require(_0x8e85('0x8'));var csv=require(_0x8e85('0x9'));var ejs=require(_0x8e85('0xa'));var fs=require('fs');var fs_extra=require(_0x8e85('0xb'));var _=require(_0x8e85('0xc'));var squel=require('squel');var crypto=require(_0x8e85('0xd'));var jsforce=require(_0x8e85('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8e85('0x9'));var querystring=require(_0x8e85('0xf'));var Papa=require(_0x8e85('0x10'));var Redis=require(_0x8e85('0x11'));var authService=require(_0x8e85('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8e85('0x13'));var utils=require(_0x8e85('0x14'));var config=require(_0x8e85('0x15'));var licenseUtil=require(_0x8e85('0x16'));var db=require(_0x8e85('0x17'))['db'];config[_0x8e85('0x18')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8e85('0x19'))(new Redis(config[_0x8e85('0x18')]));require('./faxQueue.socket')[_0x8e85('0x1a')](socket);function respondWithStatusCode(_0x56b838,_0x34621e){_0x34621e=_0x34621e||0xcc;return function(_0x11401e){if(_0x11401e){return _0x56b838['sendStatus'](_0x34621e);}return _0x56b838[_0x8e85('0x1b')](_0x34621e)[_0x8e85('0x1c')]();};}function respondWithResult(_0x520e5e,_0x1c0958){_0x1c0958=_0x1c0958||0xc8;return function(_0x558950){if(_0x558950){return _0x520e5e['status'](_0x1c0958)[_0x8e85('0x1d')](_0x558950);}};}function respondWithFilteredResult(_0x1144ec,_0x40708f){return function(_0x462544){if(_0x462544){var _0x38819a=typeof _0x40708f[_0x8e85('0x1e')]===_0x8e85('0x1f')&&typeof _0x40708f['limit']==='undefined';var _0x308379=_0x462544[_0x8e85('0x20')];var _0x31be87=_0x38819a?0x0:_0x40708f[_0x8e85('0x1e')];var _0x18c0a5=_0x38819a?_0x462544[_0x8e85('0x20')]:_0x40708f['offset']+_0x40708f[_0x8e85('0x21')];var _0x3cc3ad;if(_0x18c0a5>=_0x308379){_0x18c0a5=_0x308379;_0x3cc3ad=0xc8;}else{_0x3cc3ad=0xce;}_0x1144ec['status'](_0x3cc3ad);return _0x1144ec[_0x8e85('0x22')](_0x8e85('0x23'),_0x31be87+'-'+_0x18c0a5+'/'+_0x308379)[_0x8e85('0x1d')](_0x462544);}return null;};}function patchUpdates(_0x529a74){return function(_0x4054b5){try{jsonpatch[_0x8e85('0x24')](_0x4054b5,_0x529a74,!![]);}catch(_0x319dd6){return BPromise[_0x8e85('0x25')](_0x319dd6);}return _0x4054b5[_0x8e85('0x26')]();};}function saveUpdates(_0x11216b,_0x5303f6){return function(_0x3db833){if(_0x3db833){return _0x3db833[_0x8e85('0x27')](_0x11216b)[_0x8e85('0x28')](function(_0x8af4e){return _0x8af4e;});}return null;};}function removeEntity(_0xadf2a5,_0x32718b){return function(_0x2587c4){if(_0x2587c4){return _0x2587c4[_0x8e85('0x29')]()[_0x8e85('0x28')](function(){var _0x1a8590=_0x2587c4[_0x8e85('0x2a')]({'plain':!![]});var _0x51abd9='FaxQueues';return db['UserProfileResource'][_0x8e85('0x29')]({'where':{'type':_0x51abd9,'resourceId':_0x1a8590['id']}})[_0x8e85('0x28')](function(){return _0x2587c4;});})[_0x8e85('0x28')](function(){_0xadf2a5['status'](0xcc)[_0x8e85('0x1c')]();});}};}function handleEntityNotFound(_0x27af16,_0x33d76a){return function(_0x16aeec){if(!_0x16aeec){_0x27af16[_0x8e85('0x2b')](0x194);}return _0x16aeec;};}function handleError(_0x452cda,_0x367c25){_0x367c25=_0x367c25||0x1f4;return function(_0x5b6c24){logger['error'](_0x5b6c24['stack']);if(_0x5b6c24[_0x8e85('0x2c')]){delete _0x5b6c24[_0x8e85('0x2c')];}_0x452cda[_0x8e85('0x1b')](_0x367c25)[_0x8e85('0x2d')](_0x5b6c24);};}exports['index']=function(_0x52150f,_0xe21057){var _0x4bfaa3={},_0x240ce5={},_0x596d83={'count':0x0,'rows':[]};var _0x4afc05=_[_0x8e85('0x2e')](db[_0x8e85('0x2f')][_0x8e85('0x30')],function(_0x1b6403){return{'name':_0x1b6403[_0x8e85('0x31')],'type':_0x1b6403[_0x8e85('0x32')][_0x8e85('0x33')]};});_0x240ce5[_0x8e85('0x34')]=_['map'](_0x4afc05,_0x8e85('0x2c'));_0x240ce5['query']=_['keys'](_0x52150f[_0x8e85('0x35')]);_0x240ce5[_0x8e85('0x36')]=_[_0x8e85('0x37')](_0x240ce5[_0x8e85('0x34')],_0x240ce5[_0x8e85('0x35')]);_0x4bfaa3[_0x8e85('0x38')]=_[_0x8e85('0x37')](_0x240ce5[_0x8e85('0x34')],qs[_0x8e85('0x39')](_0x52150f[_0x8e85('0x35')][_0x8e85('0x39')]));_0x4bfaa3[_0x8e85('0x38')]=_0x4bfaa3[_0x8e85('0x38')]['length']?_0x4bfaa3['attributes']:_0x240ce5['model'];if(!_0x52150f['query'][_0x8e85('0x3a')](_0x8e85('0x3b'))){_0x4bfaa3[_0x8e85('0x21')]=qs[_0x8e85('0x21')](_0x52150f[_0x8e85('0x35')][_0x8e85('0x21')]);_0x4bfaa3['offset']=qs[_0x8e85('0x1e')](_0x52150f[_0x8e85('0x35')][_0x8e85('0x1e')]);}_0x4bfaa3[_0x8e85('0x3c')]=qs['sort'](_0x52150f[_0x8e85('0x35')][_0x8e85('0x3d')]);_0x4bfaa3[_0x8e85('0x3e')]=qs[_0x8e85('0x36')](_['pick'](_0x52150f[_0x8e85('0x35')],_0x240ce5[_0x8e85('0x36')]),_0x4afc05);if(_0x52150f['query']['filter']){_0x4bfaa3[_0x8e85('0x3e')]=_['merge'](_0x4bfaa3[_0x8e85('0x3e')],{'$or':_[_0x8e85('0x2e')](_0x4afc05,function(_0x3d0281){if(_0x3d0281[_0x8e85('0x32')]!=='VIRTUAL'){var _0x2e1798={};_0x2e1798[_0x3d0281[_0x8e85('0x2c')]]={'$like':'%'+_0x52150f[_0x8e85('0x35')][_0x8e85('0x3f')]+'%'};return _0x2e1798;}})});}_0x4bfaa3=_[_0x8e85('0x40')]({},_0x4bfaa3,_0x52150f[_0x8e85('0x41')]);var _0x34e106={'where':_0x4bfaa3[_0x8e85('0x3e')]};return db[_0x8e85('0x2f')][_0x8e85('0x20')](_0x34e106)[_0x8e85('0x28')](function(_0x230173){_0x596d83['count']=_0x230173;if(_0x52150f[_0x8e85('0x35')]['includeAll']){_0x4bfaa3['include']=[{'all':!![]}];}return db[_0x8e85('0x2f')][_0x8e85('0x42')](_0x4bfaa3);})['then'](function(_0x2ae76d){_0x596d83[_0x8e85('0x43')]=_0x2ae76d;return _0x596d83;})['then'](respondWithFilteredResult(_0xe21057,_0x4bfaa3))[_0x8e85('0x44')](handleError(_0xe21057,null));};exports[_0x8e85('0x45')]=function(_0xa55db3,_0x2e9420){var _0x1ebc12={'raw':!![],'where':{'id':_0xa55db3[_0x8e85('0x46')]['id']}},_0x1ab28f={};_0x1ab28f[_0x8e85('0x34')]=_[_0x8e85('0x47')](db['FaxQueue'][_0x8e85('0x30')]);_0x1ab28f['query']=_[_0x8e85('0x47')](_0xa55db3[_0x8e85('0x35')]);_0x1ab28f['filters']=_[_0x8e85('0x37')](_0x1ab28f['model'],_0x1ab28f['query']);_0x1ebc12[_0x8e85('0x38')]=_['intersection'](_0x1ab28f[_0x8e85('0x34')],qs[_0x8e85('0x39')](_0xa55db3[_0x8e85('0x35')][_0x8e85('0x39')]));_0x1ebc12['attributes']=_0x1ebc12[_0x8e85('0x38')][_0x8e85('0x48')]?_0x1ebc12[_0x8e85('0x38')]:_0x1ab28f[_0x8e85('0x34')];if(_0xa55db3[_0x8e85('0x35')]['includeAll']){_0x1ebc12[_0x8e85('0x49')]=[{'all':!![]}];}_0x1ebc12=_[_0x8e85('0x40')]({},_0x1ebc12,_0xa55db3[_0x8e85('0x41')]);return db[_0x8e85('0x2f')][_0x8e85('0x4a')](_0x1ebc12)[_0x8e85('0x28')](handleEntityNotFound(_0x2e9420,null))[_0x8e85('0x28')](respondWithResult(_0x2e9420,null))[_0x8e85('0x44')](handleError(_0x2e9420,null));};exports[_0x8e85('0x4b')]=function(_0x3c1989,_0x42e93e){return db[_0x8e85('0x2f')][_0x8e85('0x4b')](_0x3c1989[_0x8e85('0x4c')],{})[_0x8e85('0x28')](function(_0x37615d){var _0x566dbb=_0x3c1989[_0x8e85('0x4d')][_0x8e85('0x2a')]({'plain':!![]});if(!_0x566dbb)throw new Error(_0x8e85('0x4e'));if(_0x566dbb[_0x8e85('0x4f')]===_0x8e85('0x4d')){var _0x50f4bb=_0x37615d['get']({'plain':!![]});var _0x4d57a9=_0x8e85('0x50');return db[_0x8e85('0x51')][_0x8e85('0x4a')]({'where':{'name':_0x4d57a9,'userProfileId':_0x566dbb[_0x8e85('0x52')]},'raw':!![]})['then'](function(_0x27301a){if(_0x27301a&&_0x27301a[_0x8e85('0x53')]===0x0){return db[_0x8e85('0x54')]['create']({'name':_0x50f4bb[_0x8e85('0x2c')],'resourceId':_0x50f4bb['id'],'type':_0x27301a[_0x8e85('0x2c')],'sectionId':_0x27301a['id']},{})[_0x8e85('0x28')](function(){return _0x37615d;});}else{return _0x37615d;}})[_0x8e85('0x44')](function(_0x33ea6b){logger[_0x8e85('0x55')](_0x8e85('0x56'),_0x33ea6b);throw _0x33ea6b;});}return _0x37615d;})[_0x8e85('0x28')](respondWithResult(_0x42e93e,0xc9))[_0x8e85('0x44')](handleError(_0x42e93e,null));};exports[_0x8e85('0x27')]=function(_0xc31ade,_0x30db3e){if(_0xc31ade[_0x8e85('0x4c')]['id']){delete _0xc31ade[_0x8e85('0x4c')]['id'];}return db[_0x8e85('0x2f')][_0x8e85('0x4a')]({'where':{'id':_0xc31ade[_0x8e85('0x46')]['id']}})[_0x8e85('0x28')](handleEntityNotFound(_0x30db3e,null))[_0x8e85('0x28')](saveUpdates(_0xc31ade[_0x8e85('0x4c')],null))['then'](respondWithResult(_0x30db3e,null))[_0x8e85('0x44')](handleError(_0x30db3e,null));};exports[_0x8e85('0x29')]=function(_0x37db65,_0x5a2c1f){return db['FaxQueue'][_0x8e85('0x4a')]({'where':{'id':_0x37db65[_0x8e85('0x46')]['id']}})[_0x8e85('0x28')](handleEntityNotFound(_0x5a2c1f,null))[_0x8e85('0x28')](removeEntity(_0x5a2c1f,null))[_0x8e85('0x44')](handleError(_0x5a2c1f,null));};exports[_0x8e85('0x57')]=function(_0x6ac649,_0x569179){return db[_0x8e85('0x2f')][_0x8e85('0x57')]()[_0x8e85('0x28')](respondWithResult(_0x569179,null))['catch'](handleError(_0x569179,null));};exports['getMembers']=function(_0x3f86f2,_0x3ec1df,_0x55c8e0){var _0x11b30a={'raw':!![],'where':{}},_0x525562={},_0x3d4c18;return db[_0x8e85('0x2f')][_0x8e85('0x58')]({'where':{'id':_0x3f86f2[_0x8e85('0x46')]['id']}})[_0x8e85('0x28')](handleEntityNotFound(_0x3ec1df,null))['then'](function(_0x2c74cb){if(_0x2c74cb){_0x3d4c18=_0x2c74cb['get']({'plain':!![]});_0x525562[_0x8e85('0x34')]=_[_0x8e85('0x47')](db[_0x8e85('0x59')][_0x8e85('0x30')]);_0x525562[_0x8e85('0x35')]=_[_0x8e85('0x47')](_0x3f86f2['query']);_0x525562[_0x8e85('0x36')]=_[_0x8e85('0x37')](_0x525562[_0x8e85('0x34')],_0x525562[_0x8e85('0x35')]);_0x11b30a[_0x8e85('0x38')]=_['intersection'](_0x525562[_0x8e85('0x34')],qs[_0x8e85('0x39')](_0x3f86f2[_0x8e85('0x35')][_0x8e85('0x39')]));_0x11b30a[_0x8e85('0x38')]=_0x11b30a[_0x8e85('0x38')][_0x8e85('0x48')]?_0x11b30a[_0x8e85('0x38')]:_0x525562[_0x8e85('0x34')];if(!_0x3f86f2[_0x8e85('0x35')][_0x8e85('0x3a')](_0x8e85('0x3b'))){_0x11b30a['limit']=qs[_0x8e85('0x21')](_0x3f86f2[_0x8e85('0x35')][_0x8e85('0x21')]);_0x11b30a[_0x8e85('0x1e')]=qs[_0x8e85('0x1e')](_0x3f86f2['query'][_0x8e85('0x1e')]);}_0x11b30a[_0x8e85('0x3c')]=qs[_0x8e85('0x3d')](_0x3f86f2[_0x8e85('0x35')][_0x8e85('0x3d')]);_0x11b30a[_0x8e85('0x3e')]=qs['filters'](_[_0x8e85('0x5a')](_0x3f86f2[_0x8e85('0x35')],_0x525562['filters']));_0x11b30a[_0x8e85('0x3e')][_0x8e85('0x5b')]=_0x2c74cb['id'];if(_0x3f86f2['query'][_0x8e85('0x3f')]){_0x11b30a[_0x8e85('0x3e')]=_[_0x8e85('0x40')](_0x11b30a[_0x8e85('0x3e')],{'$or':_[_0x8e85('0x2e')](_0x11b30a[_0x8e85('0x38')],function(_0x4fbf6b){var _0x2f1beb={};_0x2f1beb[_0x4fbf6b]={'$like':'%'+_0x3f86f2[_0x8e85('0x35')][_0x8e85('0x3f')]+'%'};return _0x2f1beb;})});}_0x11b30a=_[_0x8e85('0x40')]({},_0x11b30a,_0x3f86f2['options']);return db[_0x8e85('0x59')]['findAll'](_0x11b30a);}})['then'](function(_0x3a2fa8){if(_0x3a2fa8){return db['User'][_0x8e85('0x5c')]({'where':{'id':_[_0x8e85('0x2e')](_0x3a2fa8,_0x8e85('0x5d')),'role':_0x8e85('0x5e')},'attributes':['id','name',_0x8e85('0x5f'),_0x8e85('0x60'),'createdAt']});}})[_0x8e85('0x28')](function(_0x38f4bf){if(_0x38f4bf){return{'count':_0x38f4bf[_0x8e85('0x20')],'rows':_[_0x8e85('0x2e')](_0x38f4bf[_0x8e85('0x43')],function(_0x13d8fe){return{'membername':_0x13d8fe['name'],'UserId':_0x13d8fe['id'],'queue_name':_0x3d4c18[_0x8e85('0x2c')],'FaxQueueId':_0x3d4c18['id'],'interface':util[_0x8e85('0x61')]('%s/%s','SIP',_0x13d8fe[_0x8e85('0x2c')]),'penalty':0x0,'paused':_0x13d8fe[_0x8e85('0x5f')],'createdAt':_0x13d8fe[_0x8e85('0x62')],'updatedAt':_0x13d8fe[_0x8e85('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3ec1df,_0x11b30a))['catch'](handleError(_0x3ec1df,null));};exports[_0x8e85('0x63')]=function(_0xdeaee0,_0x1bb1ca,_0x502e30){var _0x57e7cf={};var _0x9951ee={};var _0x11b077;var _0x431ccf;return db[_0x8e85('0x2f')][_0x8e85('0x58')]({'where':{'id':_0xdeaee0[_0x8e85('0x46')]['id']}})[_0x8e85('0x28')](handleEntityNotFound(_0x1bb1ca,null))['then'](function(_0x44d946){if(_0x44d946){_0x11b077=_0x44d946;_0x9951ee[_0x8e85('0x34')]=_[_0x8e85('0x47')](db[_0x8e85('0x64')][_0x8e85('0x30')]);_0x9951ee[_0x8e85('0x35')]=_[_0x8e85('0x47')](_0xdeaee0[_0x8e85('0x35')]);_0x9951ee['filters']=_[_0x8e85('0x37')](_0x9951ee[_0x8e85('0x34')],_0x9951ee[_0x8e85('0x35')]);_0x57e7cf[_0x8e85('0x38')]=_[_0x8e85('0x37')](_0x9951ee[_0x8e85('0x34')],qs[_0x8e85('0x39')](_0xdeaee0[_0x8e85('0x35')]['fields']));_0x57e7cf[_0x8e85('0x38')]=_0x57e7cf[_0x8e85('0x38')][_0x8e85('0x48')]?_0x57e7cf['attributes']:_0x9951ee[_0x8e85('0x34')];_0x57e7cf[_0x8e85('0x3c')]=qs['sort'](_0xdeaee0[_0x8e85('0x35')][_0x8e85('0x3d')]);_0x57e7cf[_0x8e85('0x3e')]=qs[_0x8e85('0x36')](_[_0x8e85('0x5a')](_0xdeaee0[_0x8e85('0x35')],_0x9951ee['filters']));if(_0xdeaee0['query'][_0x8e85('0x3f')]){_0x57e7cf[_0x8e85('0x3e')]=_['merge'](_0x57e7cf[_0x8e85('0x3e')],{'$or':_['map'](_0x57e7cf[_0x8e85('0x38')],function(_0x5cb3ad){var _0x1518ef={};_0x1518ef[_0x5cb3ad]={'$like':'%'+_0xdeaee0['query'][_0x8e85('0x3f')]+'%'};return _0x1518ef;})});}_0x57e7cf=_['merge']({},_0x57e7cf,_0xdeaee0[_0x8e85('0x41')]);return _0x11b077['getTeams'](_0x57e7cf);}})[_0x8e85('0x28')](function(_0x14bfad){if(_0x14bfad){_0x431ccf=_0x14bfad[_0x8e85('0x48')];if(!_0xdeaee0['query'][_0x8e85('0x3a')](_0x8e85('0x3b'))){_0x57e7cf[_0x8e85('0x21')]=qs['limit'](_0xdeaee0[_0x8e85('0x35')][_0x8e85('0x21')]);_0x57e7cf[_0x8e85('0x1e')]=qs['offset'](_0xdeaee0['query'][_0x8e85('0x1e')]);}return _0x11b077[_0x8e85('0x63')](_0x57e7cf);}})['then'](function(_0x57a150){if(_0x57a150){return _0x57a150?{'count':_0x431ccf,'rows':_0x57a150}:null;}})[_0x8e85('0x28')](respondWithResult(_0x1bb1ca,null))['catch'](handleError(_0x1bb1ca,null));};exports['addTeams']=function(_0xa6dd41,_0x147bf9,_0x525643){var _0x2429c8=_0xa6dd41[_0x8e85('0x4c')][_0x8e85('0x65')];return db[_0x8e85('0x64')][_0x8e85('0x42')]({'where':{'id':_0x2429c8},'attributes':['id'],'include':[{'model':db[_0x8e85('0x66')],'as':_0x8e85('0x67'),'attributes':['id',_0x8e85('0x2c'),'online',_0x8e85('0x68'),_0x8e85('0x69')],'raw':!![]}]})['then'](function(_0x35ebf5){if(_0x35ebf5){var _0x8b6194=_[_0x8e85('0x6a')](_0x35ebf5,function(_0x44ccd4){var _0x405c02=_0x44ccd4[_0x8e85('0x2a')]({'plain':!![]});return _0x405c02[_0x8e85('0x67')];});return db[_0x8e85('0x2f')][_0x8e85('0x4a')]({'where':{'id':_0xa6dd41[_0x8e85('0x46')]['id']}})[_0x8e85('0x28')](function(_0x162898){return db[_0x8e85('0x6b')]['transaction'](function(_0x5169aa){return _0x162898['addTeams'](_0x2429c8,{'transaction':_0x5169aa})[_0x8e85('0x28')](function(){return BPromise[_0x8e85('0x6c')](_0x8b6194,function(_0xd5f0c1){return db[_0x8e85('0x59')][_0x8e85('0x6d')]({'where':{'UserId':_0xd5f0c1['id'],'FaxQueueId':_0xa6dd41[_0x8e85('0x46')]['id']},'transaction':_0x5169aa});});})['then'](function(){_0x8b6194[_0x8e85('0x6e')](function(_0x3cc2a7){socket[_0x8e85('0x6f')]('userFaxQueue:save',{'UserId':_0x3cc2a7['id'],'FaxQueueId':_0x162898['id']});});});});});}})[_0x8e85('0x28')](respondWithStatusCode(_0x147bf9,null))[_0x8e85('0x44')](handleError(_0x147bf9,null));};exports[_0x8e85('0x70')]=function(_0x497513,_0x399676,_0x4f2151){return db['Team'][_0x8e85('0x42')]({'where':{'id':_0x497513[_0x8e85('0x35')]['ids']},'attributes':['id'],'include':[{'model':db[_0x8e85('0x66')],'as':_0x8e85('0x67'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x399676,null))[_0x8e85('0x28')](function(_0x265368){var _0x47ee0b=_['map'](_0x265368,'id');var _0x36898b=[];var _0x31caf7=[];var _0x36cb99=squel['select']();_0x36cb99['field']('tq.TeamId')[_0x8e85('0x71')](_0x8e85('0x72'),'tq')[_0x8e85('0x73')](_0x8e85('0x74'),'ut',_0x8e85('0x75'))['where']('FaxQueueId\x20=\x20?',_0x497513[_0x8e85('0x46')]['id']);for(var _0x595685=0x0;_0x595685<_0x265368['length'];_0x595685+=0x1){let _0x96ec90=_0x265368[_0x595685];for(var _0x2c73d9=0x0;_0x2c73d9<_0x96ec90[_0x8e85('0x67')][_0x8e85('0x48')];_0x2c73d9+=0x1){let _0x43df30=_0x96ec90[_0x8e85('0x67')][_0x2c73d9];var _0x1b0702=_0x36cb99[_0x8e85('0x76')]();_0x1b0702[_0x8e85('0x3e')](_0x8e85('0x77'),_0x43df30['id']);_0x31caf7[_0x8e85('0x78')](db['sequelize'][_0x8e85('0x35')](_0x1b0702[_0x8e85('0x79')](),{'type':db[_0x8e85('0x6b')][_0x8e85('0x7a')]['SELECT']})['then'](function(_0x268892){if(_0x268892[_0x8e85('0x48')]===0x1){return _0x43df30['id'];}else{var _0x4b5547=_[_0x8e85('0x7b')](_[_0x8e85('0x2e')](_0x268892,_0x8e85('0x7c')),function(_0x5c1312){return _[_0x8e85('0x7d')](_0x47ee0b,_0x5c1312);});if(_0x4b5547){return _0x43df30['id'];}}}));}}return BPromise[_0x8e85('0x7e')](_0x31caf7)[_0x8e85('0x28')](function(_0x561b77){_0x36898b=_(_0x36898b)[_0x8e85('0x7f')](_0x561b77)[_0x8e85('0x80')]()[_0x8e85('0x81')]();return db['FaxQueue'][_0x8e85('0x4a')]({'where':{'id':_0x497513['params']['id']}})[_0x8e85('0x28')](function(_0x2056b2){return db[_0x8e85('0x6b')][_0x8e85('0x82')](function(_0x5da089){return _0x2056b2[_0x8e85('0x70')](_0x497513[_0x8e85('0x35')]['ids'],{'transaction':_0x5da089})[_0x8e85('0x28')](function(){if(!_['isEmpty'](_0x36898b)){return _0x2056b2[_0x8e85('0x83')](_0x36898b,{'transaction':_0x5da089});}})[_0x8e85('0x28')](function(){_0x36898b[_0x8e85('0x6e')](function(_0x49e252){socket[_0x8e85('0x6f')](_0x8e85('0x84'),{'UserId':_0x49e252,'FaxQueueId':_0x2056b2['id']});});});});});});})[_0x8e85('0x28')](respondWithStatusCode(_0x399676,null))[_0x8e85('0x44')](handleError(_0x399676,null));};exports[_0x8e85('0x85')]=function(_0x2bbf60,_0x311918,_0x490388){return db[_0x8e85('0x2f')][_0x8e85('0x4a')]({'where':{'id':_0x2bbf60['params']['id']}})['then'](handleEntityNotFound(_0x311918,null))[_0x8e85('0x28')](function(_0x56507e){if(_0x56507e){return _0x56507e['addAgents'](_0x2bbf60[_0x8e85('0x4c')][_0x8e85('0x65')],_[_0x8e85('0x86')](_0x2bbf60['body'],[_0x8e85('0x65'),'id'])||{})[_0x8e85('0x87')](function(_0x3d253c){for(var _0x540d9d=0x0;_0x540d9d<_0x2bbf60['body'][_0x8e85('0x65')][_0x8e85('0x48')];_0x540d9d+=0x1){socket['emit']('userFaxQueue:save',{'UserId':Number(_0x2bbf60['body']['ids'][_0x540d9d]),'FaxQueueId':Number(_0x2bbf60[_0x8e85('0x46')]['id'])});}return _0x3d253c;});}})[_0x8e85('0x28')](respondWithResult(_0x311918,null))[_0x8e85('0x44')](handleError(_0x311918,null));};exports[_0x8e85('0x83')]=function(_0xf133ed,_0x5864d6,_0x37ebab){return db[_0x8e85('0x2f')][_0x8e85('0x4a')]({'where':{'id':_0xf133ed[_0x8e85('0x46')]['id']}})[_0x8e85('0x28')](handleEntityNotFound(_0x5864d6,null))['then'](function(_0x4388e6){if(_0x4388e6){return _0x4388e6[_0x8e85('0x83')](_0xf133ed[_0x8e85('0x35')][_0x8e85('0x65')])[_0x8e85('0x28')](function(){if(_['isArray'](_0xf133ed[_0x8e85('0x35')][_0x8e85('0x65')])){for(var _0x52b961=0x0;_0x52b961<_0xf133ed['query'][_0x8e85('0x65')][_0x8e85('0x48')];_0x52b961+=0x1){socket[_0x8e85('0x6f')](_0x8e85('0x84'),{'UserId':Number(_0xf133ed[_0x8e85('0x35')][_0x8e85('0x65')][_0x52b961]),'FaxQueueId':Number(_0xf133ed['params']['id'])});}}else{socket[_0x8e85('0x6f')]('userFaxQueue:remove',{'UserId':Number(_0xf133ed['query'][_0x8e85('0x65')]),'FaxQueueId':Number(_0xf133ed[_0x8e85('0x46')]['id'])});}});}})[_0x8e85('0x28')](respondWithStatusCode(_0x5864d6,null))[_0x8e85('0x44')](handleError(_0x5864d6,null));};exports[_0x8e85('0x88')]=function(_0x16fde1,_0x1ecaa0,_0x50dba3){var _0xc57e56={};var _0x4583d5={};var _0x11886f;var _0x19e2bb;return db['FaxQueue'][_0x8e85('0x58')]({'where':{'id':_0x16fde1[_0x8e85('0x46')]['id']}})[_0x8e85('0x28')](handleEntityNotFound(_0x1ecaa0,null))[_0x8e85('0x28')](function(_0x10764d){if(_0x10764d){_0x11886f=_0x10764d;_0x4583d5['model']=_[_0x8e85('0x47')](db['User'][_0x8e85('0x30')]);_0x4583d5[_0x8e85('0x35')]=_['keys'](_0x16fde1['query']);_0x4583d5[_0x8e85('0x36')]=_[_0x8e85('0x37')](_0x4583d5[_0x8e85('0x34')],_0x4583d5[_0x8e85('0x35')]);_0xc57e56[_0x8e85('0x38')]=_['intersection'](_0x4583d5['model'],qs[_0x8e85('0x39')](_0x16fde1[_0x8e85('0x35')]['fields']));_0xc57e56[_0x8e85('0x38')]=_0xc57e56['attributes'][_0x8e85('0x48')]?_0xc57e56['attributes']:_0x4583d5[_0x8e85('0x34')];_0xc57e56['order']=qs[_0x8e85('0x3d')](_0x16fde1['query']['sort']);_0xc57e56[_0x8e85('0x3e')]=qs[_0x8e85('0x36')](_['pick'](_0x16fde1[_0x8e85('0x35')],_0x4583d5['filters']));if(_0x16fde1['query'][_0x8e85('0x3f')]){_0xc57e56[_0x8e85('0x3e')]=_[_0x8e85('0x40')](_0xc57e56['where'],{'$or':_['map'](_0xc57e56[_0x8e85('0x38')],function(_0x34b7e0){var _0xa17a3b={};_0xa17a3b[_0x34b7e0]={'$like':'%'+_0x16fde1['query'][_0x8e85('0x3f')]+'%'};return _0xa17a3b;})});}_0xc57e56=_['merge']({},_0xc57e56,_0x16fde1[_0x8e85('0x41')]);return _0x11886f['getAgents'](_0xc57e56);}})['then'](function(_0x6755d1){if(_0x6755d1){_0x19e2bb=_0x6755d1['length'];if(!_0x16fde1[_0x8e85('0x35')][_0x8e85('0x3a')](_0x8e85('0x3b'))){_0xc57e56[_0x8e85('0x21')]=qs[_0x8e85('0x21')](_0x16fde1[_0x8e85('0x35')]['limit']);_0xc57e56[_0x8e85('0x1e')]=qs[_0x8e85('0x1e')](_0x16fde1[_0x8e85('0x35')]['offset']);}return _0x11886f[_0x8e85('0x88')](_0xc57e56);}})[_0x8e85('0x28')](function(_0x74a6d4){if(_0x74a6d4){return _0x74a6d4?{'count':_0x19e2bb,'rows':_0x74a6d4}:null;}})[_0x8e85('0x28')](respondWithResult(_0x1ecaa0,null))[_0x8e85('0x44')](handleError(_0x1ecaa0,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index f84e8f1..f438cfe 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 _0x7976=['update','remove','emit','hasOwnProperty','hook','exports','events','setMaxListeners','save'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7976,0xde));var _0x6797=function(_0x3e6bee,_0x3bd8b2){_0x3e6bee=_0x3e6bee-0x0;var _0x51b82e=_0x7976[_0x3e6bee];return _0x51b82e;};'use strict';var EventEmitter=require(_0x6797('0x0'));var FaxQueue=require('../../mysqldb')['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x6797('0x1')](0x0);var events={'afterCreate':_0x6797('0x2'),'afterUpdate':_0x6797('0x3'),'afterDestroy':_0x6797('0x4')};function emitEvent(_0x493638){return function(_0x518771,_0x5ce4a6,_0x57db64){FaxQueueEvents[_0x6797('0x5')](_0x493638+':'+_0x518771['id'],_0x518771);FaxQueueEvents[_0x6797('0x5')](_0x493638,_0x518771);_0x57db64(null);};}for(var e in events){if(events[_0x6797('0x6')](e)){var event=events[e];FaxQueue[_0x6797('0x7')](e,emitEvent(event));}}module[_0x6797('0x8')]=FaxQueueEvents; \ No newline at end of file +var _0xa7b9=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','save','update'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa7b9,0xa5));var _0x9a7b=function(_0x3dc6f4,_0x362e2a){_0x3dc6f4=_0x3dc6f4-0x0;var _0x3b18e9=_0xa7b9[_0x3dc6f4];return _0x3b18e9;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x9a7b('0x0'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9a7b('0x1'),'afterUpdate':_0x9a7b('0x2'),'afterDestroy':_0x9a7b('0x3')};function emitEvent(_0x357e72){return function(_0x3b4ca5,_0x43bf57,_0x35ae54){FaxQueueEvents['emit'](_0x357e72+':'+_0x3b4ca5['id'],_0x3b4ca5);FaxQueueEvents[_0x9a7b('0x4')](_0x357e72,_0x3b4ca5);_0x35ae54(null);};}for(var e in events){if(events[_0x9a7b('0x5')](e)){var event=events[e];FaxQueue[_0x9a7b('0x6')](e,emitEvent(event));}}module[_0x9a7b('0x7')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 0ac4376..4eea7eb 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 _0x84b9=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','lodash'];(function(_0x19fb9f,_0x2e105c){var _0x16ce95=function(_0x3b0a43){while(--_0x3b0a43){_0x19fb9f['push'](_0x19fb9f['shift']());}};_0x16ce95(++_0x2e105c);}(_0x84b9,0x6b));var _0x984b=function(_0xf51c06,_0x388e5b){_0xf51c06=_0xf51c06-0x0;var _0x1d5420=_0x84b9[_0xf51c06];return _0x1d5420;};'use strict';var _=require(_0x984b('0x0'));var util=require(_0x984b('0x1'));var logger=require(_0x984b('0x2'))(_0x984b('0x3'));var moment=require(_0x984b('0x4'));var BPromise=require(_0x984b('0x5'));var rp=require(_0x984b('0x6'));var fs=require('fs');var path=require(_0x984b('0x7'));var rimraf=require(_0x984b('0x8'));var config=require(_0x984b('0x9'));var attributes=require('./faxQueue.attributes');module[_0x984b('0xa')]=function(_0x54d3bc,_0x4bd6b0){return _0x54d3bc[_0x984b('0xb')]('FaxQueue',attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa80e=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxQueue.attributes','exports','define','lodash','util'];(function(_0x33bc64,_0x4d1e92){var _0x3fdd34=function(_0x4b40a4){while(--_0x4b40a4){_0x33bc64['push'](_0x33bc64['shift']());}};_0x3fdd34(++_0x4d1e92);}(_0xa80e,0x15a));var _0xea80=function(_0x5b55da,_0x3cb785){_0x5b55da=_0x5b55da-0x0;var _0x37e0ae=_0xa80e[_0x5b55da];return _0x37e0ae;};'use strict';var _=require(_0xea80('0x0'));var util=require(_0xea80('0x1'));var logger=require(_0xea80('0x2'))(_0xea80('0x3'));var moment=require(_0xea80('0x4'));var BPromise=require(_0xea80('0x5'));var rp=require(_0xea80('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xea80('0x7'));var config=require(_0xea80('0x8'));var attributes=require(_0xea80('0x9'));module[_0xea80('0xa')]=function(_0x3f1f1b,_0x5252e9){return _0x3f1f1b[_0xea80('0xb')]('FaxQueue',attributes,{'tableName':'fax_queues','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 1907552..4ec0262 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 _0x72ea=['attributes','include','map','model','then','GetFaxQueue','FaxQueue','ShowFaxQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','info','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueue,\x20%s,\x20%s','message','result','catch','findAll','options','where'];(function(_0x1ac18a,_0x38d104){var _0x17d768=function(_0x2db3ad){while(--_0x2db3ad){_0x1ac18a['push'](_0x1ac18a['shift']());}};_0x17d768(++_0x38d104);}(_0x72ea,0x1d0));var _0xa72e=function(_0x3b92d4,_0x92961e){_0x3b92d4=_0x3b92d4-0x0;var _0x2fb2c3=_0x72ea[_0x3b92d4];return _0x2fb2c3;};'use strict';var _=require(_0xa72e('0x0'));var util=require(_0xa72e('0x1'));var moment=require(_0xa72e('0x2'));var BPromise=require(_0xa72e('0x3'));var rs=require(_0xa72e('0x4'));var fs=require('fs');var Redis=require(_0xa72e('0x5'));var db=require(_0xa72e('0x6'))['db'];var utils=require(_0xa72e('0x7'));var logger=require('../../config/logger')(_0xa72e('0x8'));var config=require('../../config/environment');var jayson=require(_0xa72e('0x9'));var client=jayson['client'][_0xa72e('0xa')]({'port':0x232a});config[_0xa72e('0xb')]=_[_0xa72e('0xc')](config['redis'],{'host':_0xa72e('0xd'),'port':0x18eb});var socket=require(_0xa72e('0xe'))(new Redis(config[_0xa72e('0xb')]));require(_0xa72e('0xf'))['register'](socket);function respondWithRpcPromise(_0x6a2594,_0x2ef705,_0x4b6dc3){return new BPromise(function(_0x24971c,_0x29df39){return client['request'](_0x6a2594,_0x4b6dc3)['then'](function(_0x4b52ab){logger[_0xa72e('0x10')]('FaxQueue,\x20%s,\x20%s',_0x2ef705,_0xa72e('0x11'));logger[_0xa72e('0x12')](_0xa72e('0x13'),_0x2ef705,_0xa72e('0x11'),JSON[_0xa72e('0x14')](_0x4b52ab));if(_0x4b52ab['error']){if(_0x4b52ab[_0xa72e('0x15')][_0xa72e('0x16')]===0x1f4){logger[_0xa72e('0x15')](_0xa72e('0x17'),_0x2ef705,_0x4b52ab['error'][_0xa72e('0x18')]);return _0x29df39(_0x4b52ab[_0xa72e('0x15')][_0xa72e('0x18')]);}logger[_0xa72e('0x15')](_0xa72e('0x17'),_0x2ef705,_0x4b52ab[_0xa72e('0x15')][_0xa72e('0x18')]);return _0x24971c(_0x4b52ab[_0xa72e('0x15')][_0xa72e('0x18')]);}else{logger['info'](_0xa72e('0x17'),_0x2ef705,'request\x20sent');_0x24971c(_0x4b52ab[_0xa72e('0x19')]['message']);}})[_0xa72e('0x1a')](function(_0x456eec){logger['error']('FaxQueue,\x20%s,\x20%s',_0x2ef705,_0x456eec);_0x29df39(_0x456eec);});});}exports['GetFaxQueue']=function(_0x555ac9){var _0x5a2105=this;return new Promise(function(_0x2bffc1,_0x327408){return db['FaxQueue'][_0xa72e('0x1b')]({'raw':_0x555ac9[_0xa72e('0x1c')]?_0x555ac9['options']['raw']===undefined?!![]:![]:!![],'where':_0x555ac9['options']?_0x555ac9[_0xa72e('0x1c')][_0xa72e('0x1d')]||null:null,'attributes':_0x555ac9[_0xa72e('0x1c')]?_0x555ac9['options'][_0xa72e('0x1e')]||null:null,'limit':_0x555ac9[_0xa72e('0x1c')]?_0x555ac9[_0xa72e('0x1c')]['limit']||null:null,'include':_0x555ac9['options']?_0x555ac9[_0xa72e('0x1c')][_0xa72e('0x1f')]?_[_0xa72e('0x20')](_0x555ac9[_0xa72e('0x1c')]['include'],function(_0x1cab64){return{'model':db[_0x1cab64[_0xa72e('0x21')]],'as':_0x1cab64['as'],'attributes':_0x1cab64[_0xa72e('0x1e')],'include':_0x1cab64['include']?_[_0xa72e('0x20')](_0x1cab64['include'],function(_0xc4b0f4){return{'model':db[_0xc4b0f4[_0xa72e('0x21')]],'as':_0xc4b0f4['as'],'attributes':_0xc4b0f4[_0xa72e('0x1e')],'include':_0xc4b0f4[_0xa72e('0x1f')]?_['map'](_0xc4b0f4[_0xa72e('0x1f')],function(_0x2010e9){return{'model':db[_0x2010e9['model']],'as':_0x2010e9['as'],'attributes':_0x2010e9[_0xa72e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xa72e('0x22')](function(_0x13ecea){logger[_0xa72e('0x10')](_0xa72e('0x23'),_0x555ac9);logger[_0xa72e('0x12')](_0xa72e('0x23'),_0x555ac9,JSON[_0xa72e('0x14')](_0x13ecea));_0x2bffc1(_0x13ecea);})['catch'](function(_0x179af0){logger[_0xa72e('0x15')]('GetFaxQueue',_0x179af0['message'],_0x555ac9);_0x327408(_0x5a2105['error'](0x1f4,_0x179af0[_0xa72e('0x18')]));});});};exports['ShowFaxQueue']=function(_0x189219){var _0x69e11e=this;return new Promise(function(_0xbf345d,_0xd56f93){return db[_0xa72e('0x24')]['find']({'raw':_0x189219['options']?_0x189219[_0xa72e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x189219[_0xa72e('0x1c')]?_0x189219[_0xa72e('0x1c')][_0xa72e('0x1d')]||null:null,'attributes':_0x189219[_0xa72e('0x1c')]?_0x189219[_0xa72e('0x1c')][_0xa72e('0x1e')]||null:null,'include':_0x189219[_0xa72e('0x1c')]?_0x189219[_0xa72e('0x1c')][_0xa72e('0x1f')]?_[_0xa72e('0x20')](_0x189219[_0xa72e('0x1c')][_0xa72e('0x1f')],function(_0x24ead8){return{'model':db[_0x24ead8['model']],'as':_0x24ead8['as'],'attributes':_0x24ead8[_0xa72e('0x1e')],'include':_0x24ead8['include']?_[_0xa72e('0x20')](_0x24ead8[_0xa72e('0x1f')],function(_0x2b12f1){return{'model':db[_0x2b12f1['model']],'as':_0x2b12f1['as'],'attributes':_0x2b12f1['attributes'],'include':_0x2b12f1['include']?_[_0xa72e('0x20')](_0x2b12f1[_0xa72e('0x1f')],function(_0x1a6925){return{'model':db[_0x1a6925['model']],'as':_0x1a6925['as'],'attributes':_0x1a6925['attributes']};}):[]};}):[]};}):[]:[]})[_0xa72e('0x22')](function(_0xa29cdf){logger['info']('ShowFaxQueue',_0x189219);logger[_0xa72e('0x12')]('ShowFaxQueue',_0x189219,JSON[_0xa72e('0x14')](_0xa29cdf));_0xbf345d(_0xa29cdf);})[_0xa72e('0x1a')](function(_0x2d6b3f){logger[_0xa72e('0x15')](_0xa72e('0x25'),_0x2d6b3f[_0xa72e('0x18')],_0x189219);_0xd56f93(_0x69e11e[_0xa72e('0x15')](0x1f4,_0x2d6b3f[_0xa72e('0x18')]));});});}; \ No newline at end of file +var _0xd195=['request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','limit','include','map','model','attributes','ShowFaxQueue','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','request','then','info','FaxQueue,\x20%s,\x20%s'];(function(_0xe66cf2,_0x32ba5f){var _0x2d84e7=function(_0x58a7d8){while(--_0x58a7d8){_0xe66cf2['push'](_0xe66cf2['shift']());}};_0x2d84e7(++_0x32ba5f);}(_0xd195,0xc2));var _0x5d19=function(_0x334a3c,_0xf2efbb){_0x334a3c=_0x334a3c-0x0;var _0x216d31=_0xd195[_0x334a3c];return _0x216d31;};'use strict';var _=require(_0x5d19('0x0'));var util=require('util');var moment=require(_0x5d19('0x1'));var BPromise=require(_0x5d19('0x2'));var rs=require(_0x5d19('0x3'));var fs=require('fs');var Redis=require(_0x5d19('0x4'));var db=require(_0x5d19('0x5'))['db'];var utils=require(_0x5d19('0x6'));var logger=require(_0x5d19('0x7'))('rpc');var config=require(_0x5d19('0x8'));var jayson=require(_0x5d19('0x9'));var client=jayson[_0x5d19('0xa')][_0x5d19('0xb')]({'port':0x232a});config[_0x5d19('0xc')]=_[_0x5d19('0xd')](config['redis'],{'host':_0x5d19('0xe'),'port':0x18eb});var socket=require(_0x5d19('0xf'))(new Redis(config[_0x5d19('0xc')]));require(_0x5d19('0x10'))['register'](socket);function respondWithRpcPromise(_0x4d3f17,_0xd4e1d4,_0x5f5d7c){return new BPromise(function(_0x559563,_0x257e25){return client[_0x5d19('0x11')](_0x4d3f17,_0x5f5d7c)[_0x5d19('0x12')](function(_0x42d831){logger[_0x5d19('0x13')](_0x5d19('0x14'),_0xd4e1d4,_0x5d19('0x15'));logger[_0x5d19('0x16')](_0x5d19('0x17'),_0xd4e1d4,_0x5d19('0x15'),JSON[_0x5d19('0x18')](_0x42d831));if(_0x42d831['error']){if(_0x42d831[_0x5d19('0x19')][_0x5d19('0x1a')]===0x1f4){logger['error'](_0x5d19('0x14'),_0xd4e1d4,_0x42d831[_0x5d19('0x19')][_0x5d19('0x1b')]);return _0x257e25(_0x42d831[_0x5d19('0x19')][_0x5d19('0x1b')]);}logger['error']('FaxQueue,\x20%s,\x20%s',_0xd4e1d4,_0x42d831[_0x5d19('0x19')][_0x5d19('0x1b')]);return _0x559563(_0x42d831['error'][_0x5d19('0x1b')]);}else{logger[_0x5d19('0x13')](_0x5d19('0x14'),_0xd4e1d4,_0x5d19('0x15'));_0x559563(_0x42d831[_0x5d19('0x1c')][_0x5d19('0x1b')]);}})[_0x5d19('0x1d')](function(_0x595ade){logger['error'](_0x5d19('0x14'),_0xd4e1d4,_0x595ade);_0x257e25(_0x595ade);});});}exports[_0x5d19('0x1e')]=function(_0x13dd39){var _0x3b6cfd=this;return new Promise(function(_0x31a007,_0x3a1690){return db[_0x5d19('0x1f')][_0x5d19('0x20')]({'raw':_0x13dd39[_0x5d19('0x21')]?_0x13dd39[_0x5d19('0x21')][_0x5d19('0x22')]===undefined?!![]:![]:!![],'where':_0x13dd39[_0x5d19('0x21')]?_0x13dd39['options'][_0x5d19('0x23')]||null:null,'attributes':_0x13dd39[_0x5d19('0x21')]?_0x13dd39[_0x5d19('0x21')]['attributes']||null:null,'limit':_0x13dd39[_0x5d19('0x21')]?_0x13dd39[_0x5d19('0x21')][_0x5d19('0x24')]||null:null,'include':_0x13dd39[_0x5d19('0x21')]?_0x13dd39['options'][_0x5d19('0x25')]?_[_0x5d19('0x26')](_0x13dd39[_0x5d19('0x21')][_0x5d19('0x25')],function(_0x1094eb){return{'model':db[_0x1094eb[_0x5d19('0x27')]],'as':_0x1094eb['as'],'attributes':_0x1094eb[_0x5d19('0x28')],'include':_0x1094eb[_0x5d19('0x25')]?_[_0x5d19('0x26')](_0x1094eb[_0x5d19('0x25')],function(_0x31232d){return{'model':db[_0x31232d[_0x5d19('0x27')]],'as':_0x31232d['as'],'attributes':_0x31232d[_0x5d19('0x28')],'include':_0x31232d[_0x5d19('0x25')]?_['map'](_0x31232d[_0x5d19('0x25')],function(_0x3b9c12){return{'model':db[_0x3b9c12[_0x5d19('0x27')]],'as':_0x3b9c12['as'],'attributes':_0x3b9c12[_0x5d19('0x28')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x55b574){logger[_0x5d19('0x13')]('GetFaxQueue',_0x13dd39);logger[_0x5d19('0x16')]('GetFaxQueue',_0x13dd39,JSON[_0x5d19('0x18')](_0x55b574));_0x31a007(_0x55b574);})[_0x5d19('0x1d')](function(_0x1c6538){logger[_0x5d19('0x19')](_0x5d19('0x1e'),_0x1c6538[_0x5d19('0x1b')],_0x13dd39);_0x3a1690(_0x3b6cfd[_0x5d19('0x19')](0x1f4,_0x1c6538[_0x5d19('0x1b')]));});});};exports[_0x5d19('0x29')]=function(_0x48335){var _0x32884a=this;return new Promise(function(_0x26773d,_0x2b2e95){return db[_0x5d19('0x1f')][_0x5d19('0x2a')]({'raw':_0x48335['options']?_0x48335['options'][_0x5d19('0x22')]===undefined?!![]:![]:!![],'where':_0x48335[_0x5d19('0x21')]?_0x48335[_0x5d19('0x21')][_0x5d19('0x23')]||null:null,'attributes':_0x48335[_0x5d19('0x21')]?_0x48335[_0x5d19('0x21')][_0x5d19('0x28')]||null:null,'include':_0x48335[_0x5d19('0x21')]?_0x48335[_0x5d19('0x21')][_0x5d19('0x25')]?_[_0x5d19('0x26')](_0x48335[_0x5d19('0x21')]['include'],function(_0x23dab0){return{'model':db[_0x23dab0['model']],'as':_0x23dab0['as'],'attributes':_0x23dab0['attributes'],'include':_0x23dab0[_0x5d19('0x25')]?_[_0x5d19('0x26')](_0x23dab0[_0x5d19('0x25')],function(_0x4c7104){return{'model':db[_0x4c7104[_0x5d19('0x27')]],'as':_0x4c7104['as'],'attributes':_0x4c7104[_0x5d19('0x28')],'include':_0x4c7104[_0x5d19('0x25')]?_[_0x5d19('0x26')](_0x4c7104['include'],function(_0x5ba516){return{'model':db[_0x5ba516['model']],'as':_0x5ba516['as'],'attributes':_0x5ba516[_0x5d19('0x28')]};}):[]};}):[]};}):[]:[]})[_0x5d19('0x12')](function(_0x58279c){logger[_0x5d19('0x13')](_0x5d19('0x29'),_0x48335);logger[_0x5d19('0x16')](_0x5d19('0x29'),_0x48335,JSON[_0x5d19('0x18')](_0x58279c));_0x26773d(_0x58279c);})[_0x5d19('0x1d')](function(_0x548565){logger[_0x5d19('0x19')](_0x5d19('0x29'),_0x548565[_0x5d19('0x1b')],_0x48335);_0x2b2e95(_0x32884a[_0x5d19('0x19')](0x1f4,_0x548565[_0x5d19('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index eca0e08..92eb550 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 _0x1db0=['length','faxQueue:','./faxQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x134fb6,_0x5eea0b){var _0x3c1833=function(_0xd6bbe9){while(--_0xd6bbe9){_0x134fb6['push'](_0x134fb6['shift']());}};_0x3c1833(++_0x5eea0b);}(_0x1db0,0x1e8));var _0x01db=function(_0x25ca44,_0x111633){_0x25ca44=_0x25ca44-0x0;var _0x4897c1=_0x1db0[_0x25ca44];return _0x4897c1;};'use strict';var FaxQueueEvents=require(_0x01db('0x0'));var events=[_0x01db('0x1'),_0x01db('0x2'),_0x01db('0x3')];function createListener(_0x10e52b,_0x58581f){return function(_0x28b82a){_0x58581f[_0x01db('0x4')](_0x10e52b,_0x28b82a);};}function removeListener(_0xdac32c,_0x1084bd){return function(){FaxQueueEvents[_0x01db('0x5')](_0xdac32c,_0x1084bd);};}exports[_0x01db('0x6')]=function(_0x21569c){for(var _0x176c62=0x0,_0xdeb4d9=events[_0x01db('0x7')];_0x176c62<_0xdeb4d9;_0x176c62++){var _0x55e4dc=events[_0x176c62];var _0x4259af=createListener(_0x01db('0x8')+_0x55e4dc,_0x21569c);FaxQueueEvents['on'](_0x55e4dc,_0x4259af);}}; \ No newline at end of file +var _0x88ac=['faxQueue:','./faxQueue.events','update','emit','removeListener'];(function(_0x4b174a,_0x33a017){var _0x3cd7bf=function(_0x44ccd9){while(--_0x44ccd9){_0x4b174a['push'](_0x4b174a['shift']());}};_0x3cd7bf(++_0x33a017);}(_0x88ac,0x12d));var _0xc88a=function(_0x4fbf1f,_0x3d2c29){_0x4fbf1f=_0x4fbf1f-0x0;var _0x351472=_0x88ac[_0x4fbf1f];return _0x351472;};'use strict';var FaxQueueEvents=require(_0xc88a('0x0'));var events=['save','remove',_0xc88a('0x1')];function createListener(_0x523847,_0x249da9){return function(_0x22aca8){_0x249da9[_0xc88a('0x2')](_0x523847,_0x22aca8);};}function removeListener(_0x5e751c,_0x5952d2){return function(){FaxQueueEvents[_0xc88a('0x3')](_0x5e751c,_0x5952d2);};}exports['register']=function(_0x86cb2d){for(var _0x47d938=0x0,_0x336bb2=events['length'];_0x47d938<_0x336bb2;_0x47d938++){var _0x42d81f=events[_0x47d938];var _0x1dd3cd=createListener(_0xc88a('0x4')+_0x42d81f,_0x86cb2d);FaxQueueEvents['on'](_0x42d81f,_0x1dd3cd);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index f1e4200..41eafae 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 _0xfd2e=['removeAgents','exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','index','isAuthenticated','get','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','create','addTeams','post','put','update','delete','removeTeams'];(function(_0x5e3f32,_0x43b7e2){var _0x56f3af=function(_0x7ac5df){while(--_0x7ac5df){_0x5e3f32['push'](_0x5e3f32['shift']());}};_0x56f3af(++_0x43b7e2);}(_0xfd2e,0x6e));var _0xefd2=function(_0x2a412e,_0x48ca29){_0x2a412e=_0x2a412e-0x0;var _0x61f3a8=_0xfd2e[_0x2a412e];return _0x61f3a8;};'use strict';var multer=require(_0xefd2('0x0'));var util=require('util');var path=require(_0xefd2('0x1'));var timeout=require('connect-timeout');var express=require(_0xefd2('0x2'));var router=express['Router']();var fs_extra=require(_0xefd2('0x3'));var auth=require(_0xefd2('0x4'));var interaction=require(_0xefd2('0x5'));var config=require(_0xefd2('0x6'));var controller=require(_0xefd2('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xefd2('0x8')]);router['get']('/describe',auth[_0xefd2('0x9')](),controller['describe']);router[_0xefd2('0xa')](_0xefd2('0xb'),auth[_0xefd2('0x9')](),controller[_0xefd2('0xc')]);router[_0xefd2('0xa')](_0xefd2('0xd'),auth[_0xefd2('0x9')](),controller['getMembers']);router[_0xefd2('0xa')](_0xefd2('0xe'),auth[_0xefd2('0x9')](),controller[_0xefd2('0xf')]);router[_0xefd2('0xa')](_0xefd2('0x10'),auth[_0xefd2('0x9')](),controller[_0xefd2('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0xefd2('0x12')]);router['post']('/:id/teams',auth[_0xefd2('0x9')](),controller[_0xefd2('0x13')]);router[_0xefd2('0x14')](_0xefd2('0x10'),auth[_0xefd2('0x9')](),controller['addAgents']);router[_0xefd2('0x15')](_0xefd2('0xb'),auth[_0xefd2('0x9')](),controller[_0xefd2('0x16')]);router[_0xefd2('0x17')](_0xefd2('0xb'),auth['isAuthenticated'](),controller['destroy']);router[_0xefd2('0x17')](_0xefd2('0xe'),auth[_0xefd2('0x9')](),controller[_0xefd2('0x18')]);router[_0xefd2('0x17')]('/:id/users',auth[_0xefd2('0x9')](),controller[_0xefd2('0x19')]);module[_0xefd2('0x1a')]=router; \ No newline at end of file +var _0x1967=['getTeams','/:id/users','getAgents','post','create','addTeams','put','update','delete','destroy','removeAgents','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/members','/:id/teams'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0x1967,0x173));var _0x7196=function(_0x375e34,_0x58976d){_0x375e34=_0x375e34-0x0;var _0x5c5069=_0x1967[_0x375e34];return _0x5c5069;};'use strict';var multer=require('multer');var util=require(_0x7196('0x0'));var path=require(_0x7196('0x1'));var timeout=require(_0x7196('0x2'));var express=require(_0x7196('0x3'));var router=express[_0x7196('0x4')]();var fs_extra=require(_0x7196('0x5'));var auth=require(_0x7196('0x6'));var interaction=require(_0x7196('0x7'));var config=require(_0x7196('0x8'));var controller=require(_0x7196('0x9'));router['get']('/',auth[_0x7196('0xa')](),controller[_0x7196('0xb')]);router[_0x7196('0xc')](_0x7196('0xd'),auth[_0x7196('0xa')](),controller[_0x7196('0xe')]);router['get'](_0x7196('0xf'),auth[_0x7196('0xa')](),controller[_0x7196('0x10')]);router[_0x7196('0xc')](_0x7196('0x11'),auth['isAuthenticated'](),controller['getMembers']);router[_0x7196('0xc')](_0x7196('0x12'),auth[_0x7196('0xa')](),controller[_0x7196('0x13')]);router[_0x7196('0xc')](_0x7196('0x14'),auth[_0x7196('0xa')](),controller[_0x7196('0x15')]);router[_0x7196('0x16')]('/',auth[_0x7196('0xa')](),controller[_0x7196('0x17')]);router['post'](_0x7196('0x12'),auth[_0x7196('0xa')](),controller[_0x7196('0x18')]);router[_0x7196('0x16')]('/:id/users',auth[_0x7196('0xa')](),controller['addAgents']);router[_0x7196('0x19')](_0x7196('0xf'),auth[_0x7196('0xa')](),controller[_0x7196('0x1a')]);router[_0x7196('0x1b')](_0x7196('0xf'),auth[_0x7196('0xa')](),controller[_0x7196('0x1c')]);router[_0x7196('0x1b')](_0x7196('0x12'),auth[_0x7196('0xa')](),controller['removeTeams']);router['delete'](_0x7196('0x14'),auth[_0x7196('0xa')](),controller[_0x7196('0x1d')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index b4f9ce9..5685a60 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 _0x4899=['sequelize','exports','STRING','DATE'];(function(_0x13a19f,_0x4df4d0){var _0x59a118=function(_0x181928){while(--_0x181928){_0x13a19f['push'](_0x13a19f['shift']());}};_0x59a118(++_0x4df4d0);}(_0x4899,0x10c));var _0x9489=function(_0x298a78,_0x2fb7a8){_0x298a78=_0x298a78-0x0;var _0x2cac0e=_0x4899[_0x298a78];return _0x2cac0e;};'use strict';var moment=require('moment');var Sequelize=require(_0x9489('0x0'));module[_0x9489('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x9489('0x2')]},'joinAt':{'type':Sequelize[_0x9489('0x3')]},'leaveAt':{'type':Sequelize[_0x9489('0x3')]},'acceptAt':{'type':Sequelize[_0x9489('0x3')]},'exitAt':{'type':Sequelize[_0x9489('0x3')]},'reason':{'type':Sequelize[_0x9489('0x2')]}}; \ No newline at end of file +var _0xcd98=['moment','sequelize','exports','STRING','DATE'];(function(_0x340b74,_0x114640){var _0x274c5d=function(_0x670f06){while(--_0x670f06){_0x340b74['push'](_0x340b74['shift']());}};_0x274c5d(++_0x114640);}(_0xcd98,0x1cc));var _0x8cd9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcd98[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x8cd9('0x0'));var Sequelize=require(_0x8cd9('0x1'));module[_0x8cd9('0x2')]={'uniqueid':{'type':Sequelize[_0x8cd9('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x8cd9('0x3')]},'joinAt':{'type':Sequelize[_0x8cd9('0x4')]},'leaveAt':{'type':Sequelize[_0x8cd9('0x4')]},'acceptAt':{'type':Sequelize[_0x8cd9('0x4')]},'exitAt':{'type':Sequelize[_0x8cd9('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 953201a..5e35d33 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 _0x0eaa=['findAll','rows','catch','show','create','body','find','params','describe','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','FaxQueueReport','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include'];(function(_0x454bf8,_0x4ab52e){var _0x51ddbd=function(_0x5d25b1){while(--_0x5d25b1){_0x454bf8['push'](_0x454bf8['shift']());}};_0x51ddbd(++_0x4ab52e);}(_0x0eaa,0x1c5));var _0xa0ea=function(_0x273964,_0x367a32){_0x273964=_0x273964-0x0;var _0x41346a=_0x0eaa[_0x273964];return _0x41346a;};'use strict';var emlformat=require(_0xa0ea('0x0'));var rimraf=require(_0xa0ea('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa0ea('0x2'));var moment=require(_0xa0ea('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa0ea('0x4'));var util=require(_0xa0ea('0x5'));var path=require(_0xa0ea('0x6'));var sox=require(_0xa0ea('0x7'));var csv=require(_0xa0ea('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa0ea('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa0ea('0xa'));var jsforce=require(_0xa0ea('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa0ea('0xc'));var Papa=require(_0xa0ea('0xd'));var Redis=require(_0xa0ea('0xe'));var authService=require(_0xa0ea('0xf'));var qs=require(_0xa0ea('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa0ea('0x11'));var logger=require(_0xa0ea('0x12'))(_0xa0ea('0x13'));var utils=require(_0xa0ea('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa0ea('0x15'));var db=require(_0xa0ea('0x16'))['db'];function respondWithStatusCode(_0x43b1b5,_0x41216c){_0x41216c=_0x41216c||0xcc;return function(_0x3eda1d){if(_0x3eda1d){return _0x43b1b5['sendStatus'](_0x41216c);}return _0x43b1b5[_0xa0ea('0x17')](_0x41216c)[_0xa0ea('0x18')]();};}function respondWithResult(_0x58c0fa,_0x3970e5){_0x3970e5=_0x3970e5||0xc8;return function(_0x183062){if(_0x183062){return _0x58c0fa[_0xa0ea('0x17')](_0x3970e5)[_0xa0ea('0x19')](_0x183062);}};}function respondWithFilteredResult(_0x4d7f34,_0x128680){return function(_0x67dc10){if(_0x67dc10){var _0x4274c2=typeof _0x128680[_0xa0ea('0x1a')]===_0xa0ea('0x1b')&&typeof _0x128680[_0xa0ea('0x1c')]===_0xa0ea('0x1b');var _0x324555=_0x67dc10[_0xa0ea('0x1d')];var _0x405f7f=_0x4274c2?0x0:_0x128680['offset'];var _0x4ca082=_0x4274c2?_0x67dc10[_0xa0ea('0x1d')]:_0x128680[_0xa0ea('0x1a')]+_0x128680[_0xa0ea('0x1c')];var _0x1887c3;if(_0x4ca082>=_0x324555){_0x4ca082=_0x324555;_0x1887c3=0xc8;}else{_0x1887c3=0xce;}_0x4d7f34[_0xa0ea('0x17')](_0x1887c3);return _0x4d7f34[_0xa0ea('0x1e')](_0xa0ea('0x1f'),_0x405f7f+'-'+_0x4ca082+'/'+_0x324555)['json'](_0x67dc10);}return null;};}function patchUpdates(_0x916f1){return function(_0x2f8518){try{jsonpatch[_0xa0ea('0x20')](_0x2f8518,_0x916f1,!![]);}catch(_0x592dec){return BPromise[_0xa0ea('0x21')](_0x592dec);}return _0x2f8518[_0xa0ea('0x22')]();};}function saveUpdates(_0x45fda4,_0x12cda2){return function(_0x2b5af5){if(_0x2b5af5){return _0x2b5af5[_0xa0ea('0x23')](_0x45fda4)['then'](function(_0x35faa4){return _0x35faa4;});}return null;};}function removeEntity(_0x5c0ec3,_0x4d494e){return function(_0x259175){if(_0x259175){return _0x259175[_0xa0ea('0x24')]()[_0xa0ea('0x25')](function(){_0x5c0ec3['status'](0xcc)[_0xa0ea('0x18')]();});}};}function handleEntityNotFound(_0x5d2d73,_0x391951){return function(_0x51cfbd){if(!_0x51cfbd){_0x5d2d73[_0xa0ea('0x26')](0x194);}return _0x51cfbd;};}function handleError(_0x26b6f1,_0x35c247){_0x35c247=_0x35c247||0x1f4;return function(_0x3b4e62){logger[_0xa0ea('0x27')](_0x3b4e62[_0xa0ea('0x28')]);if(_0x3b4e62[_0xa0ea('0x29')]){delete _0x3b4e62[_0xa0ea('0x29')];}_0x26b6f1['status'](_0x35c247)[_0xa0ea('0x2a')](_0x3b4e62);};}exports['index']=function(_0x21640c,_0xc3cd24){var _0x1ee6ff={},_0x705022={},_0x389050={'count':0x0,'rows':[]};var _0x129130=_['map'](db[_0xa0ea('0x2b')]['rawAttributes'],function(_0x210ce3){return{'name':_0x210ce3['fieldName'],'type':_0x210ce3[_0xa0ea('0x2c')][_0xa0ea('0x2d')]};});_0x705022[_0xa0ea('0x2e')]=_['map'](_0x129130,_0xa0ea('0x29'));_0x705022[_0xa0ea('0x2f')]=_['keys'](_0x21640c[_0xa0ea('0x2f')]);_0x705022[_0xa0ea('0x30')]=_[_0xa0ea('0x31')](_0x705022['model'],_0x705022['query']);_0x1ee6ff[_0xa0ea('0x32')]=_[_0xa0ea('0x31')](_0x705022[_0xa0ea('0x2e')],qs['fields'](_0x21640c[_0xa0ea('0x2f')][_0xa0ea('0x33')]));_0x1ee6ff[_0xa0ea('0x32')]=_0x1ee6ff[_0xa0ea('0x32')][_0xa0ea('0x34')]?_0x1ee6ff['attributes']:_0x705022['model'];if(!_0x21640c[_0xa0ea('0x2f')]['hasOwnProperty'](_0xa0ea('0x35'))){_0x1ee6ff[_0xa0ea('0x1c')]=qs[_0xa0ea('0x1c')](_0x21640c[_0xa0ea('0x2f')][_0xa0ea('0x1c')]);_0x1ee6ff['offset']=qs[_0xa0ea('0x1a')](_0x21640c[_0xa0ea('0x2f')][_0xa0ea('0x1a')]);}_0x1ee6ff[_0xa0ea('0x36')]=qs[_0xa0ea('0x37')](_0x21640c[_0xa0ea('0x2f')][_0xa0ea('0x37')]);_0x1ee6ff[_0xa0ea('0x38')]=qs[_0xa0ea('0x30')](_[_0xa0ea('0x39')](_0x21640c['query'],_0x705022[_0xa0ea('0x30')]),_0x129130);if(_0x21640c['query'][_0xa0ea('0x3a')]){_0x1ee6ff['where']=_[_0xa0ea('0x3b')](_0x1ee6ff['where'],{'$or':_[_0xa0ea('0x3c')](_0x129130,function(_0x2a6aff){if(_0x2a6aff[_0xa0ea('0x2c')]!==_0xa0ea('0x3d')){var _0x4b6d57={};_0x4b6d57[_0x2a6aff[_0xa0ea('0x29')]]={'$like':'%'+_0x21640c[_0xa0ea('0x2f')][_0xa0ea('0x3a')]+'%'};return _0x4b6d57;}})});}_0x1ee6ff=_[_0xa0ea('0x3b')]({},_0x1ee6ff,_0x21640c[_0xa0ea('0x3e')]);var _0x396d61={'where':_0x1ee6ff[_0xa0ea('0x38')]};return db[_0xa0ea('0x2b')][_0xa0ea('0x1d')](_0x396d61)['then'](function(_0x26afe5){_0x389050['count']=_0x26afe5;if(_0x21640c[_0xa0ea('0x2f')][_0xa0ea('0x3f')]){_0x1ee6ff[_0xa0ea('0x40')]=[{'all':!![]}];}return db[_0xa0ea('0x2b')][_0xa0ea('0x41')](_0x1ee6ff);})[_0xa0ea('0x25')](function(_0x209081){_0x389050[_0xa0ea('0x42')]=_0x209081;return _0x389050;})[_0xa0ea('0x25')](respondWithFilteredResult(_0xc3cd24,_0x1ee6ff))[_0xa0ea('0x43')](handleError(_0xc3cd24,null));};exports[_0xa0ea('0x44')]=function(_0x3c32fd,_0x20e580){var _0x37e38b={'raw':!![],'where':{'id':_0x3c32fd['params']['id']}},_0x3139ad={};_0x3139ad[_0xa0ea('0x2e')]=_['keys'](db[_0xa0ea('0x2b')]['rawAttributes']);_0x3139ad['query']=_['keys'](_0x3c32fd['query']);_0x3139ad[_0xa0ea('0x30')]=_[_0xa0ea('0x31')](_0x3139ad['model'],_0x3139ad[_0xa0ea('0x2f')]);_0x37e38b[_0xa0ea('0x32')]=_[_0xa0ea('0x31')](_0x3139ad['model'],qs['fields'](_0x3c32fd['query'][_0xa0ea('0x33')]));_0x37e38b[_0xa0ea('0x32')]=_0x37e38b[_0xa0ea('0x32')][_0xa0ea('0x34')]?_0x37e38b[_0xa0ea('0x32')]:_0x3139ad[_0xa0ea('0x2e')];if(_0x3c32fd[_0xa0ea('0x2f')][_0xa0ea('0x3f')]){_0x37e38b[_0xa0ea('0x40')]=[{'all':!![]}];}_0x37e38b=_[_0xa0ea('0x3b')]({},_0x37e38b,_0x3c32fd[_0xa0ea('0x3e')]);return db[_0xa0ea('0x2b')]['find'](_0x37e38b)[_0xa0ea('0x25')](handleEntityNotFound(_0x20e580,null))[_0xa0ea('0x25')](respondWithResult(_0x20e580,null))[_0xa0ea('0x43')](handleError(_0x20e580,null));};exports[_0xa0ea('0x45')]=function(_0x4f4f3e,_0x482601){return db[_0xa0ea('0x2b')][_0xa0ea('0x45')](_0x4f4f3e[_0xa0ea('0x46')],{})[_0xa0ea('0x25')](respondWithResult(_0x482601,0xc9))[_0xa0ea('0x43')](handleError(_0x482601,null));};exports[_0xa0ea('0x23')]=function(_0x219540,_0x361210){if(_0x219540[_0xa0ea('0x46')]['id']){delete _0x219540[_0xa0ea('0x46')]['id'];}return db['FaxQueueReport'][_0xa0ea('0x47')]({'where':{'id':_0x219540[_0xa0ea('0x48')]['id']}})[_0xa0ea('0x25')](handleEntityNotFound(_0x361210,null))[_0xa0ea('0x25')](saveUpdates(_0x219540[_0xa0ea('0x46')],null))[_0xa0ea('0x25')](respondWithResult(_0x361210,null))[_0xa0ea('0x43')](handleError(_0x361210,null));};exports['destroy']=function(_0x140155,_0x176f68){return db['FaxQueueReport'][_0xa0ea('0x47')]({'where':{'id':_0x140155['params']['id']}})[_0xa0ea('0x25')](handleEntityNotFound(_0x176f68,null))[_0xa0ea('0x25')](removeEntity(_0x176f68,null))[_0xa0ea('0x43')](handleError(_0x176f68,null));};exports[_0xa0ea('0x49')]=function(_0x19f8d6,_0x513c8e){return db[_0xa0ea('0x2b')]['describe']()[_0xa0ea('0x25')](respondWithResult(_0x513c8e,null))['catch'](handleError(_0x513c8e,null));}; \ No newline at end of file +var _0x3164=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','FaxQueueReport','include','rows','catch','show','params','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x5532f9,_0x168fe8){var _0xf9a1d5=function(_0x143901){while(--_0x143901){_0x5532f9['push'](_0x5532f9['shift']());}};_0xf9a1d5(++_0x168fe8);}(_0x3164,0x182));var _0x4316=function(_0x572743,_0x2cc13c){_0x572743=_0x572743-0x0;var _0x3abb61=_0x3164[_0x572743];return _0x3abb61;};'use strict';var emlformat=require(_0x4316('0x0'));var rimraf=require(_0x4316('0x1'));var zipdir=require(_0x4316('0x2'));var jsonpatch=require(_0x4316('0x3'));var rp=require(_0x4316('0x4'));var moment=require('moment');var BPromise=require(_0x4316('0x5'));var Mustache=require(_0x4316('0x6'));var util=require(_0x4316('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x4316('0x8'));var ejs=require(_0x4316('0x9'));var fs=require('fs');var fs_extra=require(_0x4316('0xa'));var _=require(_0x4316('0xb'));var squel=require(_0x4316('0xc'));var crypto=require(_0x4316('0xd'));var jsforce=require(_0x4316('0xe'));var deskjs=require(_0x4316('0xf'));var toCsv=require(_0x4316('0x8'));var querystring=require(_0x4316('0x10'));var Papa=require(_0x4316('0x11'));var Redis=require(_0x4316('0x12'));var authService=require(_0x4316('0x13'));var qs=require(_0x4316('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4316('0x15'));var logger=require(_0x4316('0x16'))(_0x4316('0x17'));var utils=require(_0x4316('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x4316('0x19'));var db=require(_0x4316('0x1a'))['db'];function respondWithStatusCode(_0x1e8f1a,_0x2a1f2c){_0x2a1f2c=_0x2a1f2c||0xcc;return function(_0x5cf490){if(_0x5cf490){return _0x1e8f1a[_0x4316('0x1b')](_0x2a1f2c);}return _0x1e8f1a['status'](_0x2a1f2c)['end']();};}function respondWithResult(_0x524c3c,_0x266777){_0x266777=_0x266777||0xc8;return function(_0x3bb6cf){if(_0x3bb6cf){return _0x524c3c['status'](_0x266777)[_0x4316('0x1c')](_0x3bb6cf);}};}function respondWithFilteredResult(_0x486a64,_0x133121){return function(_0x3e9ab8){if(_0x3e9ab8){var _0x211d87=typeof _0x133121[_0x4316('0x1d')]===_0x4316('0x1e')&&typeof _0x133121[_0x4316('0x1f')]===_0x4316('0x1e');var _0x38e68c=_0x3e9ab8[_0x4316('0x20')];var _0x3bf044=_0x211d87?0x0:_0x133121['offset'];var _0x43069f=_0x211d87?_0x3e9ab8[_0x4316('0x20')]:_0x133121['offset']+_0x133121['limit'];var _0x40f660;if(_0x43069f>=_0x38e68c){_0x43069f=_0x38e68c;_0x40f660=0xc8;}else{_0x40f660=0xce;}_0x486a64[_0x4316('0x21')](_0x40f660);return _0x486a64[_0x4316('0x22')](_0x4316('0x23'),_0x3bf044+'-'+_0x43069f+'/'+_0x38e68c)[_0x4316('0x1c')](_0x3e9ab8);}return null;};}function patchUpdates(_0x5865a3){return function(_0x888097){try{jsonpatch[_0x4316('0x24')](_0x888097,_0x5865a3,!![]);}catch(_0x599c48){return BPromise[_0x4316('0x25')](_0x599c48);}return _0x888097[_0x4316('0x26')]();};}function saveUpdates(_0x38195f,_0x494f82){return function(_0x1736d0){if(_0x1736d0){return _0x1736d0[_0x4316('0x27')](_0x38195f)[_0x4316('0x28')](function(_0x4f42aa){return _0x4f42aa;});}return null;};}function removeEntity(_0x3b994a,_0x3388ae){return function(_0x37043c){if(_0x37043c){return _0x37043c[_0x4316('0x29')]()[_0x4316('0x28')](function(){_0x3b994a[_0x4316('0x21')](0xcc)[_0x4316('0x2a')]();});}};}function handleEntityNotFound(_0x46bd61,_0x184624){return function(_0x43c015){if(!_0x43c015){_0x46bd61[_0x4316('0x1b')](0x194);}return _0x43c015;};}function handleError(_0x40ca68,_0x89e0d7){_0x89e0d7=_0x89e0d7||0x1f4;return function(_0x1f7391){logger[_0x4316('0x2b')](_0x1f7391[_0x4316('0x2c')]);if(_0x1f7391[_0x4316('0x2d')]){delete _0x1f7391['name'];}_0x40ca68['status'](_0x89e0d7)[_0x4316('0x2e')](_0x1f7391);};}exports[_0x4316('0x2f')]=function(_0xa8dd01,_0x334f61){var _0xa1cb87={},_0x55cfb2={},_0xf66a01={'count':0x0,'rows':[]};var _0x4b13aa=_[_0x4316('0x30')](db['FaxQueueReport'][_0x4316('0x31')],function(_0x50e099){return{'name':_0x50e099[_0x4316('0x32')],'type':_0x50e099[_0x4316('0x33')]['key']};});_0x55cfb2[_0x4316('0x34')]=_['map'](_0x4b13aa,_0x4316('0x2d'));_0x55cfb2[_0x4316('0x35')]=_[_0x4316('0x36')](_0xa8dd01[_0x4316('0x35')]);_0x55cfb2[_0x4316('0x37')]=_[_0x4316('0x38')](_0x55cfb2[_0x4316('0x34')],_0x55cfb2[_0x4316('0x35')]);_0xa1cb87['attributes']=_[_0x4316('0x38')](_0x55cfb2[_0x4316('0x34')],qs['fields'](_0xa8dd01['query'][_0x4316('0x39')]));_0xa1cb87[_0x4316('0x3a')]=_0xa1cb87[_0x4316('0x3a')][_0x4316('0x3b')]?_0xa1cb87[_0x4316('0x3a')]:_0x55cfb2['model'];if(!_0xa8dd01[_0x4316('0x35')][_0x4316('0x3c')](_0x4316('0x3d'))){_0xa1cb87[_0x4316('0x1f')]=qs[_0x4316('0x1f')](_0xa8dd01[_0x4316('0x35')]['limit']);_0xa1cb87[_0x4316('0x1d')]=qs['offset'](_0xa8dd01[_0x4316('0x35')]['offset']);}_0xa1cb87[_0x4316('0x3e')]=qs[_0x4316('0x3f')](_0xa8dd01[_0x4316('0x35')][_0x4316('0x3f')]);_0xa1cb87['where']=qs[_0x4316('0x37')](_[_0x4316('0x40')](_0xa8dd01['query'],_0x55cfb2[_0x4316('0x37')]),_0x4b13aa);if(_0xa8dd01[_0x4316('0x35')][_0x4316('0x41')]){_0xa1cb87['where']=_[_0x4316('0x42')](_0xa1cb87[_0x4316('0x43')],{'$or':_[_0x4316('0x30')](_0x4b13aa,function(_0x14994b){if(_0x14994b[_0x4316('0x33')]!==_0x4316('0x44')){var _0xb05f2={};_0xb05f2[_0x14994b[_0x4316('0x2d')]]={'$like':'%'+_0xa8dd01[_0x4316('0x35')][_0x4316('0x41')]+'%'};return _0xb05f2;}})});}_0xa1cb87=_[_0x4316('0x42')]({},_0xa1cb87,_0xa8dd01[_0x4316('0x45')]);var _0x12402c={'where':_0xa1cb87[_0x4316('0x43')]};return db[_0x4316('0x46')][_0x4316('0x20')](_0x12402c)[_0x4316('0x28')](function(_0x1ff4bc){_0xf66a01[_0x4316('0x20')]=_0x1ff4bc;if(_0xa8dd01[_0x4316('0x35')]['includeAll']){_0xa1cb87[_0x4316('0x47')]=[{'all':!![]}];}return db['FaxQueueReport']['findAll'](_0xa1cb87);})[_0x4316('0x28')](function(_0xf98933){_0xf66a01[_0x4316('0x48')]=_0xf98933;return _0xf66a01;})['then'](respondWithFilteredResult(_0x334f61,_0xa1cb87))[_0x4316('0x49')](handleError(_0x334f61,null));};exports[_0x4316('0x4a')]=function(_0x51c34a,_0x421fd3){var _0x5a0ba6={'raw':!![],'where':{'id':_0x51c34a[_0x4316('0x4b')]['id']}},_0x410532={};_0x410532[_0x4316('0x34')]=_[_0x4316('0x36')](db['FaxQueueReport'][_0x4316('0x31')]);_0x410532[_0x4316('0x35')]=_[_0x4316('0x36')](_0x51c34a[_0x4316('0x35')]);_0x410532['filters']=_[_0x4316('0x38')](_0x410532[_0x4316('0x34')],_0x410532[_0x4316('0x35')]);_0x5a0ba6[_0x4316('0x3a')]=_['intersection'](_0x410532['model'],qs['fields'](_0x51c34a[_0x4316('0x35')][_0x4316('0x39')]));_0x5a0ba6['attributes']=_0x5a0ba6[_0x4316('0x3a')][_0x4316('0x3b')]?_0x5a0ba6[_0x4316('0x3a')]:_0x410532['model'];if(_0x51c34a['query'][_0x4316('0x4c')]){_0x5a0ba6[_0x4316('0x47')]=[{'all':!![]}];}_0x5a0ba6=_['merge']({},_0x5a0ba6,_0x51c34a['options']);return db['FaxQueueReport'][_0x4316('0x4d')](_0x5a0ba6)[_0x4316('0x28')](handleEntityNotFound(_0x421fd3,null))[_0x4316('0x28')](respondWithResult(_0x421fd3,null))[_0x4316('0x49')](handleError(_0x421fd3,null));};exports[_0x4316('0x4e')]=function(_0x34b967,_0x5c7c86){return db[_0x4316('0x46')][_0x4316('0x4e')](_0x34b967[_0x4316('0x4f')],{})['then'](respondWithResult(_0x5c7c86,0xc9))[_0x4316('0x49')](handleError(_0x5c7c86,null));};exports[_0x4316('0x27')]=function(_0x3ceb88,_0x5e6155){if(_0x3ceb88[_0x4316('0x4f')]['id']){delete _0x3ceb88[_0x4316('0x4f')]['id'];}return db[_0x4316('0x46')][_0x4316('0x4d')]({'where':{'id':_0x3ceb88[_0x4316('0x4b')]['id']}})[_0x4316('0x28')](handleEntityNotFound(_0x5e6155,null))['then'](saveUpdates(_0x3ceb88[_0x4316('0x4f')],null))[_0x4316('0x28')](respondWithResult(_0x5e6155,null))[_0x4316('0x49')](handleError(_0x5e6155,null));};exports[_0x4316('0x29')]=function(_0x56d541,_0x2205f3){return db['FaxQueueReport']['find']({'where':{'id':_0x56d541['params']['id']}})[_0x4316('0x28')](handleEntityNotFound(_0x2205f3,null))['then'](removeEntity(_0x2205f3,null))[_0x4316('0x49')](handleError(_0x2205f3,null));};exports[_0x4316('0x50')]=function(_0x3395dd,_0x1ba86f){return db[_0x4316('0x46')][_0x4316('0x50')]()[_0x4316('0x28')](respondWithResult(_0x1ba86f,null))[_0x4316('0x49')](handleError(_0x1ba86f,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index acdb769..cbc035f 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 _0xc4aa=['bluebird','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','lodash','util','../../config/logger','api','moment'];(function(_0xb42dc5,_0x3e407d){var _0xbb932b=function(_0x8f6dcc){while(--_0x8f6dcc){_0xb42dc5['push'](_0xb42dc5['shift']());}};_0xbb932b(++_0x3e407d);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0xc4aa[_0x1969a7];return _0x3d665f;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x7fbe=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','../../config/logger','api'];(function(_0x1a8197,_0x3eb47d){var _0x303fe0=function(_0x59a378){while(--_0x59a378){_0x1a8197['push'](_0x1a8197['shift']());}};_0x303fe0(++_0x3eb47d);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x597351,_0x5aed9f){_0x597351=_0x597351-0x0;var _0x410cd7=_0x7fbe[_0x597351];return _0x410cd7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe7fb('0x0'))(_0xe7fb('0x1'));var moment=require(_0xe7fb('0x2'));var BPromise=require(_0xe7fb('0x3'));var rp=require(_0xe7fb('0x4'));var fs=require('fs');var path=require(_0xe7fb('0x5'));var rimraf=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var attributes=require(_0xe7fb('0x8'));module[_0xe7fb('0x9')]=function(_0x290172,_0x12d1b0){return _0x290172[_0xe7fb('0xa')](_0xe7fb('0xb'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xe7fb('0xc'),'fields':[_0xe7fb('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 943d3d3..01488b5 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 _0x91d9=['randomstring','ioredis','../../config/utils','../../config/logger','http','request','FaxQueueReport,\x20%s,\x20%s','request\x20sent','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateFaxQueueReport','FaxQueueReport','options','raw','then','debug','UpdateFaxQueueReport','update','body','where','attributes','limit','util','moment','bluebird'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x91d9,0x79));var _0x991d=function(_0x44777a,_0x516b4d){_0x44777a=_0x44777a-0x0;var _0x3fb1f3=_0x91d9[_0x44777a];return _0x3fb1f3;};'use strict';var _=require('lodash');var util=require(_0x991d('0x0'));var moment=require(_0x991d('0x1'));var BPromise=require(_0x991d('0x2'));var rs=require(_0x991d('0x3'));var fs=require('fs');var Redis=require(_0x991d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x991d('0x5'));var logger=require(_0x991d('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x991d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3a7cdf,_0x39e1e9,_0x22df54){return new BPromise(function(_0xf4b63e,_0x18e052){return client[_0x991d('0x8')](_0x3a7cdf,_0x22df54)['then'](function(_0x59b20a){logger['info'](_0x991d('0x9'),_0x39e1e9,_0x991d('0xa'));logger['debug'](_0x991d('0xb'),_0x39e1e9,_0x991d('0xa'),JSON[_0x991d('0xc')](_0x59b20a));if(_0x59b20a[_0x991d('0xd')]){if(_0x59b20a[_0x991d('0xd')][_0x991d('0xe')]===0x1f4){logger[_0x991d('0xd')](_0x991d('0x9'),_0x39e1e9,_0x59b20a[_0x991d('0xd')][_0x991d('0xf')]);return _0x18e052(_0x59b20a[_0x991d('0xd')][_0x991d('0xf')]);}logger[_0x991d('0xd')](_0x991d('0x9'),_0x39e1e9,_0x59b20a[_0x991d('0xd')]['message']);return _0xf4b63e(_0x59b20a[_0x991d('0xd')][_0x991d('0xf')]);}else{logger[_0x991d('0x10')]('FaxQueueReport,\x20%s,\x20%s',_0x39e1e9,_0x991d('0xa'));_0xf4b63e(_0x59b20a[_0x991d('0x11')][_0x991d('0xf')]);}})[_0x991d('0x12')](function(_0x5dfb64){logger[_0x991d('0xd')](_0x991d('0x9'),_0x39e1e9,_0x5dfb64);_0x18e052(_0x5dfb64);});});}exports[_0x991d('0x13')]=function(_0x4c5923){var _0xf7e7fa=this;return new Promise(function(_0xd654b0,_0xe10227){return db[_0x991d('0x14')]['create'](_0x4c5923['body'],{'raw':_0x4c5923[_0x991d('0x15')]?_0x4c5923[_0x991d('0x15')][_0x991d('0x16')]===undefined?!![]:![]:!![]})[_0x991d('0x17')](function(_0x23d788){logger[_0x991d('0x10')]('CreateFaxQueueReport',_0x4c5923);logger[_0x991d('0x18')](_0x991d('0x13'),_0x4c5923,JSON['stringify'](_0x23d788));_0xd654b0(_0x23d788);})[_0x991d('0x12')](function(_0x77e90e){logger[_0x991d('0xd')](_0x991d('0x13'),_0x77e90e['message'],_0x4c5923);_0xe10227(_0xf7e7fa[_0x991d('0xd')](0x1f4,_0x77e90e[_0x991d('0xf')]));});});};exports[_0x991d('0x19')]=function(_0xae4524){var _0x2e6c67=this;return new Promise(function(_0x54a3b3,_0x1bbba7){return db[_0x991d('0x14')][_0x991d('0x1a')](_0xae4524[_0x991d('0x1b')],{'raw':_0xae4524[_0x991d('0x15')]?_0xae4524[_0x991d('0x15')][_0x991d('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xae4524['options']?_0xae4524[_0x991d('0x15')][_0x991d('0x1c')]||null:null,'attributes':_0xae4524[_0x991d('0x15')]?_0xae4524['options'][_0x991d('0x1d')]||null:null,'limit':_0xae4524[_0x991d('0x15')]?_0xae4524[_0x991d('0x15')][_0x991d('0x1e')]||null:null})[_0x991d('0x17')](function(_0xd50535){logger[_0x991d('0x10')]('UpdateFaxQueueReport',_0xae4524);logger['debug'](_0x991d('0x19'),_0xae4524,JSON[_0x991d('0xc')](_0xd50535));_0x54a3b3(_0xd50535);})['catch'](function(_0x1a622a){logger['error'](_0x991d('0x19'),_0x1a622a[_0x991d('0xf')],_0xae4524);_0x1bbba7(_0x2e6c67['error'](0x1f4,_0x1a622a['message']));});});}; \ No newline at end of file +var _0x7926=['UpdateFaxQueueReport','FaxQueueReport','update','raw','where','attributes','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','info','FaxQueueReport,\x20%s,\x20%s','FaxQueueReport,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result','catch','create','body','options','then','debug','CreateFaxQueueReport'];(function(_0x172eed,_0x2e1012){var _0x2a2101=function(_0x49d5e8){while(--_0x49d5e8){_0x172eed['push'](_0x172eed['shift']());}};_0x2a2101(++_0x2e1012);}(_0x7926,0x18c));var _0x6792=function(_0x2af1f1,_0x2cbb4f){_0x2af1f1=_0x2af1f1-0x0;var _0x4bb4c5=_0x7926[_0x2af1f1];return _0x4bb4c5;};'use strict';var _=require(_0x6792('0x0'));var util=require('util');var moment=require(_0x6792('0x1'));var BPromise=require(_0x6792('0x2'));var rs=require(_0x6792('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6792('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6792('0x5'))('rpc');var config=require(_0x6792('0x6'));var jayson=require(_0x6792('0x7'));var client=jayson[_0x6792('0x8')][_0x6792('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x17ccd1,_0x5c4e45,_0x2311c2){return new BPromise(function(_0x174360,_0x40947b){return client['request'](_0x17ccd1,_0x2311c2)['then'](function(_0x3a73c5){logger[_0x6792('0xa')](_0x6792('0xb'),_0x5c4e45,'request\x20sent');logger['debug'](_0x6792('0xc'),_0x5c4e45,'request\x20sent',JSON['stringify'](_0x3a73c5));if(_0x3a73c5[_0x6792('0xd')]){if(_0x3a73c5['error']['code']===0x1f4){logger[_0x6792('0xd')]('FaxQueueReport,\x20%s,\x20%s',_0x5c4e45,_0x3a73c5[_0x6792('0xd')][_0x6792('0xe')]);return _0x40947b(_0x3a73c5[_0x6792('0xd')]['message']);}logger[_0x6792('0xd')]('FaxQueueReport,\x20%s,\x20%s',_0x5c4e45,_0x3a73c5['error'][_0x6792('0xe')]);return _0x174360(_0x3a73c5['error'][_0x6792('0xe')]);}else{logger[_0x6792('0xa')](_0x6792('0xb'),_0x5c4e45,_0x6792('0xf'));_0x174360(_0x3a73c5[_0x6792('0x10')][_0x6792('0xe')]);}})[_0x6792('0x11')](function(_0x2c5c51){logger[_0x6792('0xd')]('FaxQueueReport,\x20%s,\x20%s',_0x5c4e45,_0x2c5c51);_0x40947b(_0x2c5c51);});});}exports['CreateFaxQueueReport']=function(_0x232c94){var _0x4ea0d2=this;return new Promise(function(_0x457cc1,_0xde8250){return db['FaxQueueReport'][_0x6792('0x12')](_0x232c94[_0x6792('0x13')],{'raw':_0x232c94[_0x6792('0x14')]?_0x232c94[_0x6792('0x14')]['raw']===undefined?!![]:![]:!![]})[_0x6792('0x15')](function(_0x21c300){logger[_0x6792('0xa')]('CreateFaxQueueReport',_0x232c94);logger[_0x6792('0x16')](_0x6792('0x17'),_0x232c94,JSON['stringify'](_0x21c300));_0x457cc1(_0x21c300);})[_0x6792('0x11')](function(_0xa3d34f){logger[_0x6792('0xd')](_0x6792('0x17'),_0xa3d34f[_0x6792('0xe')],_0x232c94);_0xde8250(_0x4ea0d2['error'](0x1f4,_0xa3d34f[_0x6792('0xe')]));});});};exports[_0x6792('0x18')]=function(_0x1bc01f){var _0x302695=this;return new Promise(function(_0x4c249e,_0x5799af){return db[_0x6792('0x19')][_0x6792('0x1a')](_0x1bc01f[_0x6792('0x13')],{'raw':_0x1bc01f[_0x6792('0x14')]?_0x1bc01f['options'][_0x6792('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1bc01f[_0x6792('0x14')]?_0x1bc01f[_0x6792('0x14')][_0x6792('0x1c')]||null:null,'attributes':_0x1bc01f['options']?_0x1bc01f[_0x6792('0x14')][_0x6792('0x1d')]||null:null,'limit':_0x1bc01f['options']?_0x1bc01f[_0x6792('0x14')]['limit']||null:null})[_0x6792('0x15')](function(_0x55e6c2){logger[_0x6792('0xa')](_0x6792('0x18'),_0x1bc01f);logger[_0x6792('0x16')](_0x6792('0x18'),_0x1bc01f,JSON['stringify'](_0x55e6c2));_0x4c249e(_0x55e6c2);})[_0x6792('0x11')](function(_0x15299f){logger['error'](_0x6792('0x18'),_0x15299f[_0x6792('0xe')],_0x1bc01f);_0x5799af(_0x302695[_0x6792('0xd')](0x1f4,_0x15299f[_0x6792('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 02aca16..ffc12db 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 _0x71a1=['express','Router','fs-extra','get','index','isAuthenticated','describe','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x4ce1b9,_0x397a4b){var _0x2bb15d=function(_0x3790ad){while(--_0x3790ad){_0x4ce1b9['push'](_0x4ce1b9['shift']());}};_0x2bb15d(++_0x397a4b);}(_0x71a1,0x1b1));var _0x171a=function(_0x3b6ba0,_0x195de3){_0x3b6ba0=_0x3b6ba0-0x0;var _0x3dd2cc=_0x71a1[_0x3b6ba0];return _0x3dd2cc;};'use strict';var multer=require(_0x171a('0x0'));var util=require(_0x171a('0x1'));var path=require(_0x171a('0x2'));var timeout=require(_0x171a('0x3'));var express=require(_0x171a('0x4'));var router=express[_0x171a('0x5')]();var fs_extra=require(_0x171a('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./faxQueueReport.controller');router[_0x171a('0x7')]('/',auth['isAuthenticated'](),controller[_0x171a('0x8')]);router[_0x171a('0x7')]('/describe',auth[_0x171a('0x9')](),controller[_0x171a('0xa')]);router['get'](_0x171a('0xb'),auth[_0x171a('0x9')](),controller[_0x171a('0xc')]);router[_0x171a('0xd')]('/',auth[_0x171a('0x9')](),controller[_0x171a('0xe')]);router['put']('/:id',auth[_0x171a('0x9')](),controller[_0x171a('0xf')]);router[_0x171a('0x10')](_0x171a('0xb'),auth['isAuthenticated'](),controller[_0x171a('0x11')]);module[_0x171a('0x12')]=router; \ No newline at end of file +var _0x37ba=['../../components/interaction/service','./faxQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','post','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x11169d,_0xdcead){var _0x199927=function(_0x5ba638){while(--_0x5ba638){_0x11169d['push'](_0x11169d['shift']());}};_0x199927(++_0xdcead);}(_0x37ba,0xca));var _0xa37b=function(_0x256b72,_0x340985){_0x256b72=_0x256b72-0x0;var _0x2183e3=_0x37ba[_0x256b72];return _0x2183e3;};'use strict';var multer=require(_0xa37b('0x0'));var util=require(_0xa37b('0x1'));var path=require(_0xa37b('0x2'));var timeout=require(_0xa37b('0x3'));var express=require(_0xa37b('0x4'));var router=express[_0xa37b('0x5')]();var fs_extra=require(_0xa37b('0x6'));var auth=require(_0xa37b('0x7'));var interaction=require(_0xa37b('0x8'));var config=require('../../config/environment');var controller=require(_0xa37b('0x9'));router['get']('/',auth[_0xa37b('0xa')](),controller[_0xa37b('0xb')]);router[_0xa37b('0xc')](_0xa37b('0xd'),auth[_0xa37b('0xa')](),controller[_0xa37b('0xe')]);router['get'](_0xa37b('0xf'),auth[_0xa37b('0xa')](),controller['show']);router[_0xa37b('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa37b('0x11')](_0xa37b('0xf'),auth[_0xa37b('0xa')](),controller[_0xa37b('0x12')]);router[_0xa37b('0x13')]('/:id',auth[_0xa37b('0xa')](),controller['destroy']);module[_0xa37b('0x14')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 1efa2c1..e8bd826 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 _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x579267,_0x239d13){var _0x11da47=function(_0x5388ac){while(--_0x5388ac){_0x579267['push'](_0x579267['shift']());}};_0x11da47(++_0x239d13);}(_0xf4eb,0xec));var _0xbf4e=function(_0x1cc60f,_0x21b8bd){_0x1cc60f=_0x1cc60f-0x0;var _0x2ec533=_0xf4eb[_0x1cc60f];return _0x2ec533;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file +var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x21d82d,_0x5a5533){var _0x2f2281=function(_0x26d373){while(--_0x26d373){_0x21d82d['push'](_0x21d82d['shift']());}};_0x2f2281(++_0x5a5533);}(_0x008c,0x188));var _0xc008=function(_0x30c133,_0x20e3bd){_0x30c133=_0x30c133-0x0;var _0x38a446=_0x008c[_0x30c133];return _0x38a446;};'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/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 9273bfb..113c4da 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 _0x1468=['fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','reject','update','then','destroy','sendStatus','error','name','send','index','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','include','FaxTransferReport','findAll','rows','catch','show','params','rawAttributes','find','create','body','describe','rimraf','zip-dir'];(function(_0x20aeb4,_0x2304cd){var _0x52be83=function(_0x23eb61){while(--_0x23eb61){_0x20aeb4['push'](_0x20aeb4['shift']());}};_0x52be83(++_0x2304cd);}(_0x1468,0x170));var _0x8146=function(_0x2265da,_0xfbbd2e){_0x2265da=_0x2265da-0x0;var _0x430c2b=_0x1468[_0x2265da];return _0x430c2b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8146('0x0'));var zipdir=require(_0x8146('0x1'));var jsonpatch=require(_0x8146('0x2'));var rp=require(_0x8146('0x3'));var moment=require('moment');var BPromise=require(_0x8146('0x4'));var Mustache=require(_0x8146('0x5'));var util=require(_0x8146('0x6'));var path=require(_0x8146('0x7'));var sox=require(_0x8146('0x8'));var csv=require(_0x8146('0x9'));var ejs=require(_0x8146('0xa'));var fs=require('fs');var fs_extra=require(_0x8146('0xb'));var _=require('lodash');var squel=require(_0x8146('0xc'));var crypto=require(_0x8146('0xd'));var jsforce=require(_0x8146('0xe'));var deskjs=require(_0x8146('0xf'));var toCsv=require(_0x8146('0x9'));var querystring=require('querystring');var Papa=require(_0x8146('0x10'));var Redis=require(_0x8146('0x11'));var authService=require(_0x8146('0x12'));var qs=require(_0x8146('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8146('0x14'));var logger=require(_0x8146('0x15'))(_0x8146('0x16'));var utils=require('../../config/utils');var config=require(_0x8146('0x17'));var licenseUtil=require(_0x8146('0x18'));var db=require(_0x8146('0x19'))['db'];function respondWithStatusCode(_0x26e6fb,_0x3894b7){_0x3894b7=_0x3894b7||0xcc;return function(_0x323c93){if(_0x323c93){return _0x26e6fb['sendStatus'](_0x3894b7);}return _0x26e6fb[_0x8146('0x1a')](_0x3894b7)[_0x8146('0x1b')]();};}function respondWithResult(_0x5b766b,_0x55bcad){_0x55bcad=_0x55bcad||0xc8;return function(_0x2ac347){if(_0x2ac347){return _0x5b766b[_0x8146('0x1a')](_0x55bcad)[_0x8146('0x1c')](_0x2ac347);}};}function respondWithFilteredResult(_0x3bf9e5,_0x563f3c){return function(_0x1bae33){if(_0x1bae33){var _0x2bfe3a=typeof _0x563f3c['offset']===_0x8146('0x1d')&&typeof _0x563f3c[_0x8146('0x1e')]==='undefined';var _0x22b833=_0x1bae33[_0x8146('0x1f')];var _0x368d74=_0x2bfe3a?0x0:_0x563f3c[_0x8146('0x20')];var _0x5613c8=_0x2bfe3a?_0x1bae33[_0x8146('0x1f')]:_0x563f3c[_0x8146('0x20')]+_0x563f3c[_0x8146('0x1e')];var _0x4428f7;if(_0x5613c8>=_0x22b833){_0x5613c8=_0x22b833;_0x4428f7=0xc8;}else{_0x4428f7=0xce;}_0x3bf9e5[_0x8146('0x1a')](_0x4428f7);return _0x3bf9e5['set']('Content-Range',_0x368d74+'-'+_0x5613c8+'/'+_0x22b833)[_0x8146('0x1c')](_0x1bae33);}return null;};}function patchUpdates(_0x556593){return function(_0x8902f){try{jsonpatch['apply'](_0x8902f,_0x556593,!![]);}catch(_0x25e9a9){return BPromise[_0x8146('0x21')](_0x25e9a9);}return _0x8902f['save']();};}function saveUpdates(_0x1babed,_0x3ef122){return function(_0x5e8cd1){if(_0x5e8cd1){return _0x5e8cd1[_0x8146('0x22')](_0x1babed)[_0x8146('0x23')](function(_0x3b74fa){return _0x3b74fa;});}return null;};}function removeEntity(_0x5e3ec3,_0x3edc3a){return function(_0x115f38){if(_0x115f38){return _0x115f38[_0x8146('0x24')]()[_0x8146('0x23')](function(){_0x5e3ec3[_0x8146('0x1a')](0xcc)[_0x8146('0x1b')]();});}};}function handleEntityNotFound(_0x229c6a,_0x4bc554){return function(_0x1c55c8){if(!_0x1c55c8){_0x229c6a[_0x8146('0x25')](0x194);}return _0x1c55c8;};}function handleError(_0x2d25d4,_0x18c46e){_0x18c46e=_0x18c46e||0x1f4;return function(_0x5403f6){logger[_0x8146('0x26')](_0x5403f6['stack']);if(_0x5403f6[_0x8146('0x27')]){delete _0x5403f6['name'];}_0x2d25d4[_0x8146('0x1a')](_0x18c46e)[_0x8146('0x28')](_0x5403f6);};}exports[_0x8146('0x29')]=function(_0x577425,_0x43360e){var _0x4b3926={},_0x1c704a={},_0x7685d4={'count':0x0,'rows':[]};var _0x5f2ba4=_['map'](db['FaxTransferReport']['rawAttributes'],function(_0x228c94){return{'name':_0x228c94[_0x8146('0x2a')],'type':_0x228c94[_0x8146('0x2b')]['key']};});_0x1c704a[_0x8146('0x2c')]=_['map'](_0x5f2ba4,'name');_0x1c704a[_0x8146('0x2d')]=_[_0x8146('0x2e')](_0x577425[_0x8146('0x2d')]);_0x1c704a[_0x8146('0x2f')]=_['intersection'](_0x1c704a[_0x8146('0x2c')],_0x1c704a[_0x8146('0x2d')]);_0x4b3926[_0x8146('0x30')]=_[_0x8146('0x31')](_0x1c704a[_0x8146('0x2c')],qs[_0x8146('0x32')](_0x577425[_0x8146('0x2d')]['fields']));_0x4b3926[_0x8146('0x30')]=_0x4b3926[_0x8146('0x30')][_0x8146('0x33')]?_0x4b3926[_0x8146('0x30')]:_0x1c704a[_0x8146('0x2c')];if(!_0x577425['query']['hasOwnProperty'](_0x8146('0x34'))){_0x4b3926[_0x8146('0x1e')]=qs[_0x8146('0x1e')](_0x577425[_0x8146('0x2d')][_0x8146('0x1e')]);_0x4b3926[_0x8146('0x20')]=qs[_0x8146('0x20')](_0x577425[_0x8146('0x2d')][_0x8146('0x20')]);}_0x4b3926[_0x8146('0x35')]=qs[_0x8146('0x36')](_0x577425[_0x8146('0x2d')][_0x8146('0x36')]);_0x4b3926[_0x8146('0x37')]=qs[_0x8146('0x2f')](_[_0x8146('0x38')](_0x577425[_0x8146('0x2d')],_0x1c704a[_0x8146('0x2f')]),_0x5f2ba4);if(_0x577425[_0x8146('0x2d')][_0x8146('0x39')]){_0x4b3926[_0x8146('0x37')]=_[_0x8146('0x3a')](_0x4b3926[_0x8146('0x37')],{'$or':_[_0x8146('0x3b')](_0x5f2ba4,function(_0x3a26f4){if(_0x3a26f4[_0x8146('0x2b')]!=='VIRTUAL'){var _0x94b483={};_0x94b483[_0x3a26f4[_0x8146('0x27')]]={'$like':'%'+_0x577425[_0x8146('0x2d')][_0x8146('0x39')]+'%'};return _0x94b483;}})});}_0x4b3926=_[_0x8146('0x3a')]({},_0x4b3926,_0x577425[_0x8146('0x3c')]);var _0x336c8f={'where':_0x4b3926[_0x8146('0x37')]};return db['FaxTransferReport'][_0x8146('0x1f')](_0x336c8f)[_0x8146('0x23')](function(_0x36939c){_0x7685d4[_0x8146('0x1f')]=_0x36939c;if(_0x577425[_0x8146('0x2d')][_0x8146('0x3d')]){_0x4b3926[_0x8146('0x3e')]=[{'all':!![]}];}return db[_0x8146('0x3f')][_0x8146('0x40')](_0x4b3926);})['then'](function(_0x1ef72b){_0x7685d4[_0x8146('0x41')]=_0x1ef72b;return _0x7685d4;})[_0x8146('0x23')](respondWithFilteredResult(_0x43360e,_0x4b3926))[_0x8146('0x42')](handleError(_0x43360e,null));};exports[_0x8146('0x43')]=function(_0x7eb3d9,_0x4a7548){var _0xe82d1={'raw':!![],'where':{'id':_0x7eb3d9[_0x8146('0x44')]['id']}},_0xd332e3={};_0xd332e3[_0x8146('0x2c')]=_['keys'](db[_0x8146('0x3f')][_0x8146('0x45')]);_0xd332e3[_0x8146('0x2d')]=_[_0x8146('0x2e')](_0x7eb3d9[_0x8146('0x2d')]);_0xd332e3[_0x8146('0x2f')]=_['intersection'](_0xd332e3[_0x8146('0x2c')],_0xd332e3[_0x8146('0x2d')]);_0xe82d1[_0x8146('0x30')]=_['intersection'](_0xd332e3[_0x8146('0x2c')],qs[_0x8146('0x32')](_0x7eb3d9['query'][_0x8146('0x32')]));_0xe82d1['attributes']=_0xe82d1[_0x8146('0x30')][_0x8146('0x33')]?_0xe82d1[_0x8146('0x30')]:_0xd332e3[_0x8146('0x2c')];if(_0x7eb3d9[_0x8146('0x2d')]['includeAll']){_0xe82d1['include']=[{'all':!![]}];}_0xe82d1=_[_0x8146('0x3a')]({},_0xe82d1,_0x7eb3d9[_0x8146('0x3c')]);return db[_0x8146('0x3f')][_0x8146('0x46')](_0xe82d1)[_0x8146('0x23')](handleEntityNotFound(_0x4a7548,null))[_0x8146('0x23')](respondWithResult(_0x4a7548,null))[_0x8146('0x42')](handleError(_0x4a7548,null));};exports[_0x8146('0x47')]=function(_0xc64f76,_0x39ec56){return db[_0x8146('0x3f')]['create'](_0xc64f76['body'],{})['then'](respondWithResult(_0x39ec56,0xc9))[_0x8146('0x42')](handleError(_0x39ec56,null));};exports['update']=function(_0x3b61ee,_0x36d526){if(_0x3b61ee['body']['id']){delete _0x3b61ee[_0x8146('0x48')]['id'];}return db[_0x8146('0x3f')][_0x8146('0x46')]({'where':{'id':_0x3b61ee[_0x8146('0x44')]['id']}})[_0x8146('0x23')](handleEntityNotFound(_0x36d526,null))[_0x8146('0x23')](saveUpdates(_0x3b61ee[_0x8146('0x48')],null))[_0x8146('0x23')](respondWithResult(_0x36d526,null))[_0x8146('0x42')](handleError(_0x36d526,null));};exports[_0x8146('0x24')]=function(_0x5c9344,_0x477771){return db['FaxTransferReport'][_0x8146('0x46')]({'where':{'id':_0x5c9344[_0x8146('0x44')]['id']}})[_0x8146('0x23')](handleEntityNotFound(_0x477771,null))[_0x8146('0x23')](removeEntity(_0x477771,null))[_0x8146('0x42')](handleError(_0x477771,null));};exports[_0x8146('0x49')]=function(_0x5ae509,_0x59effa){return db['FaxTransferReport'][_0x8146('0x49')]()[_0x8146('0x23')](respondWithResult(_0x59effa,null))[_0x8146('0x42')](handleError(_0x59effa,null));}; \ No newline at end of file +var _0x2dfe=['name','send','index','map','FaxTransferReport','fieldName','type','key','model','query','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','VIRTUAL','findAll','rows','catch','show','params','keys','length','includeAll','include','merge','options','find','create','body','destroy','describe','eml-format','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/utils','../../config/environment','../../config/license/util','end','limit','count','offset','set','Content-Range','json','update','then','status','sendStatus','error'];(function(_0x35485a,_0x91cdd4){var _0x5148e6=function(_0x27ed1d){while(--_0x27ed1d){_0x35485a['push'](_0x35485a['shift']());}};_0x5148e6(++_0x91cdd4);}(_0x2dfe,0xbf));var _0xe2df=function(_0x2564c4,_0x58ee05){_0x2564c4=_0x2564c4-0x0;var _0x32baef=_0x2dfe[_0x2564c4];return _0x32baef;};'use strict';var emlformat=require(_0xe2df('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe2df('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe2df('0x2'));var moment=require(_0xe2df('0x3'));var BPromise=require(_0xe2df('0x4'));var Mustache=require(_0xe2df('0x5'));var util=require(_0xe2df('0x6'));var path=require(_0xe2df('0x7'));var sox=require(_0xe2df('0x8'));var csv=require(_0xe2df('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe2df('0xa'));var _=require(_0xe2df('0xb'));var squel=require(_0xe2df('0xc'));var crypto=require(_0xe2df('0xd'));var jsforce=require(_0xe2df('0xe'));var deskjs=require(_0xe2df('0xf'));var toCsv=require(_0xe2df('0x9'));var querystring=require(_0xe2df('0x10'));var Papa=require(_0xe2df('0x11'));var Redis=require(_0xe2df('0x12'));var authService=require(_0xe2df('0x13'));var qs=require(_0xe2df('0x14'));var as=require(_0xe2df('0x15'));var hardwareService=require(_0xe2df('0x16'));var logger=require(_0xe2df('0x17'))(_0xe2df('0x18'));var utils=require(_0xe2df('0x19'));var config=require(_0xe2df('0x1a'));var licenseUtil=require(_0xe2df('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x9d17c7,_0x4b5338){_0x4b5338=_0x4b5338||0xcc;return function(_0x22eec0){if(_0x22eec0){return _0x9d17c7['sendStatus'](_0x4b5338);}return _0x9d17c7['status'](_0x4b5338)[_0xe2df('0x1c')]();};}function respondWithResult(_0x32f842,_0x40b0de){_0x40b0de=_0x40b0de||0xc8;return function(_0x97c9ec){if(_0x97c9ec){return _0x32f842['status'](_0x40b0de)['json'](_0x97c9ec);}};}function respondWithFilteredResult(_0x25a201,_0x31e2e9){return function(_0x5bfc23){if(_0x5bfc23){var _0x3f07c2=typeof _0x31e2e9['offset']==='undefined'&&typeof _0x31e2e9[_0xe2df('0x1d')]==='undefined';var _0x42959d=_0x5bfc23[_0xe2df('0x1e')];var _0x45d380=_0x3f07c2?0x0:_0x31e2e9['offset'];var _0x4c445d=_0x3f07c2?_0x5bfc23[_0xe2df('0x1e')]:_0x31e2e9[_0xe2df('0x1f')]+_0x31e2e9[_0xe2df('0x1d')];var _0x10607a;if(_0x4c445d>=_0x42959d){_0x4c445d=_0x42959d;_0x10607a=0xc8;}else{_0x10607a=0xce;}_0x25a201['status'](_0x10607a);return _0x25a201[_0xe2df('0x20')](_0xe2df('0x21'),_0x45d380+'-'+_0x4c445d+'/'+_0x42959d)[_0xe2df('0x22')](_0x5bfc23);}return null;};}function patchUpdates(_0x126fb9){return function(_0x3f5000){try{jsonpatch['apply'](_0x3f5000,_0x126fb9,!![]);}catch(_0x289068){return BPromise['reject'](_0x289068);}return _0x3f5000['save']();};}function saveUpdates(_0x2a66d4,_0x24d8b6){return function(_0x20cf76){if(_0x20cf76){return _0x20cf76[_0xe2df('0x23')](_0x2a66d4)[_0xe2df('0x24')](function(_0x303e11){return _0x303e11;});}return null;};}function removeEntity(_0x27ecbd,_0x234fad){return function(_0x447aae){if(_0x447aae){return _0x447aae['destroy']()['then'](function(){_0x27ecbd[_0xe2df('0x25')](0xcc)[_0xe2df('0x1c')]();});}};}function handleEntityNotFound(_0x4a6171,_0x992fd7){return function(_0x3282f7){if(!_0x3282f7){_0x4a6171[_0xe2df('0x26')](0x194);}return _0x3282f7;};}function handleError(_0x301d59,_0x47e442){_0x47e442=_0x47e442||0x1f4;return function(_0x4e8b82){logger[_0xe2df('0x27')](_0x4e8b82['stack']);if(_0x4e8b82[_0xe2df('0x28')]){delete _0x4e8b82[_0xe2df('0x28')];}_0x301d59['status'](_0x47e442)[_0xe2df('0x29')](_0x4e8b82);};}exports[_0xe2df('0x2a')]=function(_0x1121a3,_0x39bcef){var _0x493066={},_0x4a3f5c={},_0x473adf={'count':0x0,'rows':[]};var _0x4c7943=_[_0xe2df('0x2b')](db[_0xe2df('0x2c')]['rawAttributes'],function(_0x2a37c5){return{'name':_0x2a37c5[_0xe2df('0x2d')],'type':_0x2a37c5[_0xe2df('0x2e')][_0xe2df('0x2f')]};});_0x4a3f5c[_0xe2df('0x30')]=_['map'](_0x4c7943,_0xe2df('0x28'));_0x4a3f5c['query']=_['keys'](_0x1121a3[_0xe2df('0x31')]);_0x4a3f5c[_0xe2df('0x32')]=_[_0xe2df('0x33')](_0x4a3f5c[_0xe2df('0x30')],_0x4a3f5c['query']);_0x493066[_0xe2df('0x34')]=_[_0xe2df('0x33')](_0x4a3f5c[_0xe2df('0x30')],qs[_0xe2df('0x35')](_0x1121a3[_0xe2df('0x31')][_0xe2df('0x35')]));_0x493066[_0xe2df('0x34')]=_0x493066[_0xe2df('0x34')]['length']?_0x493066['attributes']:_0x4a3f5c[_0xe2df('0x30')];if(!_0x1121a3['query']['hasOwnProperty'](_0xe2df('0x36'))){_0x493066['limit']=qs['limit'](_0x1121a3[_0xe2df('0x31')][_0xe2df('0x1d')]);_0x493066[_0xe2df('0x1f')]=qs['offset'](_0x1121a3[_0xe2df('0x31')][_0xe2df('0x1f')]);}_0x493066[_0xe2df('0x37')]=qs[_0xe2df('0x38')](_0x1121a3[_0xe2df('0x31')][_0xe2df('0x38')]);_0x493066['where']=qs['filters'](_[_0xe2df('0x39')](_0x1121a3['query'],_0x4a3f5c['filters']),_0x4c7943);if(_0x1121a3[_0xe2df('0x31')][_0xe2df('0x3a')]){_0x493066[_0xe2df('0x3b')]=_['merge'](_0x493066[_0xe2df('0x3b')],{'$or':_[_0xe2df('0x2b')](_0x4c7943,function(_0x12835d){if(_0x12835d[_0xe2df('0x2e')]!==_0xe2df('0x3c')){var _0x13fcd8={};_0x13fcd8[_0x12835d['name']]={'$like':'%'+_0x1121a3[_0xe2df('0x31')]['filter']+'%'};return _0x13fcd8;}})});}_0x493066=_['merge']({},_0x493066,_0x1121a3['options']);var _0x1c3ab9={'where':_0x493066['where']};return db[_0xe2df('0x2c')][_0xe2df('0x1e')](_0x1c3ab9)[_0xe2df('0x24')](function(_0x394ef4){_0x473adf['count']=_0x394ef4;if(_0x1121a3['query']['includeAll']){_0x493066['include']=[{'all':!![]}];}return db[_0xe2df('0x2c')][_0xe2df('0x3d')](_0x493066);})[_0xe2df('0x24')](function(_0xe34303){_0x473adf[_0xe2df('0x3e')]=_0xe34303;return _0x473adf;})[_0xe2df('0x24')](respondWithFilteredResult(_0x39bcef,_0x493066))[_0xe2df('0x3f')](handleError(_0x39bcef,null));};exports[_0xe2df('0x40')]=function(_0x368555,_0x455a23){var _0x432489={'raw':!![],'where':{'id':_0x368555[_0xe2df('0x41')]['id']}},_0x31aa05={};_0x31aa05[_0xe2df('0x30')]=_[_0xe2df('0x42')](db[_0xe2df('0x2c')]['rawAttributes']);_0x31aa05[_0xe2df('0x31')]=_[_0xe2df('0x42')](_0x368555[_0xe2df('0x31')]);_0x31aa05[_0xe2df('0x32')]=_[_0xe2df('0x33')](_0x31aa05[_0xe2df('0x30')],_0x31aa05[_0xe2df('0x31')]);_0x432489[_0xe2df('0x34')]=_[_0xe2df('0x33')](_0x31aa05[_0xe2df('0x30')],qs[_0xe2df('0x35')](_0x368555['query'][_0xe2df('0x35')]));_0x432489[_0xe2df('0x34')]=_0x432489[_0xe2df('0x34')][_0xe2df('0x43')]?_0x432489[_0xe2df('0x34')]:_0x31aa05[_0xe2df('0x30')];if(_0x368555[_0xe2df('0x31')][_0xe2df('0x44')]){_0x432489[_0xe2df('0x45')]=[{'all':!![]}];}_0x432489=_[_0xe2df('0x46')]({},_0x432489,_0x368555[_0xe2df('0x47')]);return db[_0xe2df('0x2c')][_0xe2df('0x48')](_0x432489)[_0xe2df('0x24')](handleEntityNotFound(_0x455a23,null))[_0xe2df('0x24')](respondWithResult(_0x455a23,null))[_0xe2df('0x3f')](handleError(_0x455a23,null));};exports[_0xe2df('0x49')]=function(_0x2d3dca,_0x5c4d7d){return db[_0xe2df('0x2c')][_0xe2df('0x49')](_0x2d3dca[_0xe2df('0x4a')],{})[_0xe2df('0x24')](respondWithResult(_0x5c4d7d,0xc9))[_0xe2df('0x3f')](handleError(_0x5c4d7d,null));};exports['update']=function(_0x47f8b3,_0x1fcf78){if(_0x47f8b3[_0xe2df('0x4a')]['id']){delete _0x47f8b3['body']['id'];}return db[_0xe2df('0x2c')]['find']({'where':{'id':_0x47f8b3[_0xe2df('0x41')]['id']}})['then'](handleEntityNotFound(_0x1fcf78,null))[_0xe2df('0x24')](saveUpdates(_0x47f8b3[_0xe2df('0x4a')],null))[_0xe2df('0x24')](respondWithResult(_0x1fcf78,null))['catch'](handleError(_0x1fcf78,null));};exports[_0xe2df('0x4b')]=function(_0x140064,_0xb8dc70){return db[_0xe2df('0x2c')][_0xe2df('0x48')]({'where':{'id':_0x140064['params']['id']}})['then'](handleEntityNotFound(_0xb8dc70,null))[_0xe2df('0x24')](removeEntity(_0xb8dc70,null))['catch'](handleError(_0xb8dc70,null));};exports[_0xe2df('0x4c')]=function(_0x7a3be1,_0x5168e5){return db[_0xe2df('0x2c')]['describe']()[_0xe2df('0x24')](respondWithResult(_0x5168e5,null))[_0xe2df('0x3f')](handleError(_0x5168e5,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 79f11d4..183dfc8 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 _0xa9a7=['request-promise','rimraf','./faxTransferReport.attributes','define','FaxTransferReport','report_fax_transfer','uniqueid','util','api','bluebird'];(function(_0x3351f0,_0x34acd0){var _0x40551f=function(_0x51784e){while(--_0x51784e){_0x3351f0['push'](_0x3351f0['shift']());}};_0x40551f(++_0x34acd0);}(_0xa9a7,0x197));var _0x7a9a=function(_0x345c1b,_0x4edc0f){_0x345c1b=_0x345c1b-0x0;var _0x540927=_0xa9a7[_0x345c1b];return _0x540927;};'use strict';var _=require('lodash');var util=require(_0x7a9a('0x0'));var logger=require('../../config/logger')(_0x7a9a('0x1'));var moment=require('moment');var BPromise=require(_0x7a9a('0x2'));var rp=require(_0x7a9a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7a9a('0x4'));var config=require('../../config/environment');var attributes=require(_0x7a9a('0x5'));module['exports']=function(_0x313949,_0x156819){return _0x313949[_0x7a9a('0x6')](_0x7a9a('0x7'),attributes,{'tableName':_0x7a9a('0x8'),'paranoid':![],'indexes':[{'name':_0x7a9a('0x9'),'fields':[_0x7a9a('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4766=['FaxTransferReport','report_fax_transfer','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./faxTransferReport.attributes','define'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x4766,0xe6));var _0x6476=function(_0x445ad7,_0x203298){_0x445ad7=_0x445ad7-0x0;var _0x4c80f5=_0x4766[_0x445ad7];return _0x4c80f5;};'use strict';var _=require(_0x6476('0x0'));var util=require(_0x6476('0x1'));var logger=require(_0x6476('0x2'))(_0x6476('0x3'));var moment=require(_0x6476('0x4'));var BPromise=require('bluebird');var rp=require(_0x6476('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6476('0x6'));var config=require(_0x6476('0x7'));var attributes=require(_0x6476('0x8'));module['exports']=function(_0x3e7733,_0x210548){return _0x3e7733[_0x6476('0x9')](_0x6476('0xa'),attributes,{'tableName':_0x6476('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 1c75365..a5ddac0 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 _0xcf6a=['request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','code','FaxTransferReport,\x20%s,\x20%s','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x119f76,_0x31745c){var _0x2c2c2e=function(_0x5a37a2){while(--_0x5a37a2){_0x119f76['push'](_0x119f76['shift']());}};_0x2c2c2e(++_0x31745c);}(_0xcf6a,0x1e5));var _0xacf6=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xcf6a[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0xacf6('0x0'));var util=require(_0xacf6('0x1'));var moment=require('moment');var BPromise=require(_0xacf6('0x2'));var rs=require(_0xacf6('0x3'));var fs=require('fs');var Redis=require(_0xacf6('0x4'));var db=require(_0xacf6('0x5'))['db'];var utils=require(_0xacf6('0x6'));var logger=require(_0xacf6('0x7'))(_0xacf6('0x8'));var config=require('../../config/environment');var jayson=require(_0xacf6('0x9'));var client=jayson[_0xacf6('0xa')][_0xacf6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f5ad8,_0x8f226a,_0x2c3770){return new BPromise(function(_0x28a36d,_0x42b5ac){return client[_0xacf6('0xc')](_0x3f5ad8,_0x2c3770)[_0xacf6('0xd')](function(_0x52b787){logger[_0xacf6('0xe')]('FaxTransferReport,\x20%s,\x20%s',_0x8f226a,_0xacf6('0xf'));logger[_0xacf6('0x10')](_0xacf6('0x11'),_0x8f226a,_0xacf6('0xf'),JSON[_0xacf6('0x12')](_0x52b787));if(_0x52b787['error']){if(_0x52b787['error'][_0xacf6('0x13')]===0x1f4){logger['error'](_0xacf6('0x14'),_0x8f226a,_0x52b787[_0xacf6('0x15')][_0xacf6('0x16')]);return _0x42b5ac(_0x52b787[_0xacf6('0x15')]['message']);}logger['error'](_0xacf6('0x14'),_0x8f226a,_0x52b787['error'][_0xacf6('0x16')]);return _0x28a36d(_0x52b787['error'][_0xacf6('0x16')]);}else{logger['info'](_0xacf6('0x14'),_0x8f226a,_0xacf6('0xf'));_0x28a36d(_0x52b787[_0xacf6('0x17')][_0xacf6('0x16')]);}})[_0xacf6('0x18')](function(_0x16b5ed){logger[_0xacf6('0x15')](_0xacf6('0x14'),_0x8f226a,_0x16b5ed);_0x42b5ac(_0x16b5ed);});});} \ No newline at end of file +var _0x979c=['message','result','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x979c,0x192));var _0xc979=function(_0x13e0e4,_0x1f166c){_0x13e0e4=_0x13e0e4-0x0;var _0x41098c=_0x979c[_0x13e0e4];return _0x41098c;};'use strict';var _=require(_0xc979('0x0'));var util=require('util');var moment=require(_0xc979('0x1'));var BPromise=require(_0xc979('0x2'));var rs=require(_0xc979('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc979('0x4'));var logger=require(_0xc979('0x5'))(_0xc979('0x6'));var config=require(_0xc979('0x7'));var jayson=require(_0xc979('0x8'));var client=jayson[_0xc979('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x557e7e,_0x58e970,_0x2aaa2e){return new BPromise(function(_0x4a8f41,_0x382f27){return client[_0xc979('0xa')](_0x557e7e,_0x2aaa2e)['then'](function(_0x4d97cf){logger[_0xc979('0xb')](_0xc979('0xc'),_0x58e970,_0xc979('0xd'));logger[_0xc979('0xe')](_0xc979('0xf'),_0x58e970,_0xc979('0xd'),JSON[_0xc979('0x10')](_0x4d97cf));if(_0x4d97cf['error']){if(_0x4d97cf['error']['code']===0x1f4){logger[_0xc979('0x11')](_0xc979('0xc'),_0x58e970,_0x4d97cf[_0xc979('0x11')][_0xc979('0x12')]);return _0x382f27(_0x4d97cf['error'][_0xc979('0x12')]);}logger[_0xc979('0x11')]('FaxTransferReport,\x20%s,\x20%s',_0x58e970,_0x4d97cf[_0xc979('0x11')][_0xc979('0x12')]);return _0x4a8f41(_0x4d97cf['error']['message']);}else{logger[_0xc979('0xb')](_0xc979('0xc'),_0x58e970,_0xc979('0xd'));_0x4a8f41(_0x4d97cf[_0xc979('0x13')][_0xc979('0x12')]);}})[_0xc979('0x14')](function(_0x26bf40){logger[_0xc979('0x11')](_0xc979('0xc'),_0x58e970,_0x26bf40);_0x382f27(_0x26bf40);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index bf842ce..49a8288 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 _0xbf6e=['../../config/environment','isAuthenticated','index','get','/describe','/:id','post','create','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x4671c7,_0x3416dd){var _0x2312ff=function(_0x17ed13){while(--_0x17ed13){_0x4671c7['push'](_0x4671c7['shift']());}};_0x2312ff(++_0x3416dd);}(_0xbf6e,0x109));var _0xebf6=function(_0x5ea6c0,_0x2c6a29){_0x5ea6c0=_0x5ea6c0-0x0;var _0x811be=_0xbf6e[_0x5ea6c0];return _0x811be;};'use strict';var multer=require(_0xebf6('0x0'));var util=require(_0xebf6('0x1'));var path=require('path');var timeout=require(_0xebf6('0x2'));var express=require(_0xebf6('0x3'));var router=express[_0xebf6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xebf6('0x5'));var interaction=require(_0xebf6('0x6'));var config=require(_0xebf6('0x7'));var controller=require('./faxTransferReport.controller');router['get']('/',auth[_0xebf6('0x8')](),controller[_0xebf6('0x9')]);router[_0xebf6('0xa')](_0xebf6('0xb'),auth[_0xebf6('0x8')](),controller['describe']);router['get'](_0xebf6('0xc'),auth[_0xebf6('0x8')](),controller['show']);router[_0xebf6('0xd')]('/',auth['isAuthenticated'](),controller[_0xebf6('0xe')]);router['put'](_0xebf6('0xc'),auth[_0xebf6('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xebf6('0xf')]=router; \ No newline at end of file +var _0x2010=['isAuthenticated','index','/describe','/:id','show','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','./faxTransferReport.controller','get'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x2010,0x88));var _0x0201=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2010[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x0201('0x0'));var util=require('util');var path=require(_0x0201('0x1'));var timeout=require('connect-timeout');var express=require(_0x0201('0x2'));var router=express[_0x0201('0x3')]();var fs_extra=require(_0x0201('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0201('0x5'));var config=require('../../config/environment');var controller=require(_0x0201('0x6'));router[_0x0201('0x7')]('/',auth[_0x0201('0x8')](),controller[_0x0201('0x9')]);router[_0x0201('0x7')](_0x0201('0xa'),auth[_0x0201('0x8')](),controller['describe']);router[_0x0201('0x7')](_0x0201('0xb'),auth[_0x0201('0x8')](),controller[_0x0201('0xc')]);router['post']('/',auth[_0x0201('0x8')](),controller['create']);router[_0x0201('0xd')](_0x0201('0xb'),auth[_0x0201('0x8')](),controller[_0x0201('0xe')]);router[_0x0201('0xf')](_0x0201('0xb'),auth[_0x0201('0x8')](),controller[_0x0201('0x10')]);module[_0x0201('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index f5dcbed..869532b 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 _0x0f5d=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','update','destroy','util','path'];(function(_0x25b0d8,_0x277f7d){var _0x20a76e=function(_0x5ce695){while(--_0x5ce695){_0x25b0d8['push'](_0x25b0d8['shift']());}};_0x20a76e(++_0x277f7d);}(_0x0f5d,0x18d));var _0xd0f5=function(_0x2e1dff,_0x54443a){_0x2e1dff=_0x2e1dff-0x0;var _0x149577=_0x0f5d[_0x2e1dff];return _0x149577;};'use strict';var multer=require('multer');var util=require(_0xd0f5('0x0'));var path=require(_0xd0f5('0x1'));var timeout=require(_0xd0f5('0x2'));var express=require(_0xd0f5('0x3'));var router=express[_0xd0f5('0x4')]();var fs_extra=require(_0xd0f5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd0f5('0x6'));var config=require('../../config/environment');var controller=require('./intDeskAccount.controller');router[_0xd0f5('0x7')]('/',auth[_0xd0f5('0x8')](),controller[_0xd0f5('0x9')]);router[_0xd0f5('0x7')](_0xd0f5('0xa'),auth[_0xd0f5('0x8')](),controller[_0xd0f5('0xb')]);router[_0xd0f5('0x7')](_0xd0f5('0xc'),auth['isAuthenticated'](),controller[_0xd0f5('0xd')]);router[_0xd0f5('0x7')]('/:id/fields',auth[_0xd0f5('0x8')](),controller[_0xd0f5('0xe')]);router[_0xd0f5('0xf')]('/',auth[_0xd0f5('0x8')](),controller[_0xd0f5('0x10')]);router[_0xd0f5('0xf')](_0xd0f5('0xc'),auth[_0xd0f5('0x8')](),controller[_0xd0f5('0x11')]);router[_0xd0f5('0x12')](_0xd0f5('0xa'),auth[_0xd0f5('0x8')](),controller[_0xd0f5('0x13')]);router['delete'](_0xd0f5('0xa'),auth[_0xd0f5('0x8')](),controller[_0xd0f5('0x14')]);module['exports']=router; \ No newline at end of file +var _0x60a8=['./intDeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x53bd07,_0x45bf77){var _0x5936af=function(_0x554217){while(--_0x554217){_0x53bd07['push'](_0x53bd07['shift']());}};_0x5936af(++_0x45bf77);}(_0x60a8,0x16a));var _0x860a=function(_0xf78d57,_0x1dd8f4){_0xf78d57=_0xf78d57-0x0;var _0xb74d6d=_0x60a8[_0xf78d57];return _0xb74d6d;};'use strict';var multer=require(_0x860a('0x0'));var util=require(_0x860a('0x1'));var path=require(_0x860a('0x2'));var timeout=require(_0x860a('0x3'));var express=require('express');var router=express[_0x860a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x860a('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x860a('0x6'));router[_0x860a('0x7')]('/',auth[_0x860a('0x8')](),controller[_0x860a('0x9')]);router[_0x860a('0x7')](_0x860a('0xa'),auth[_0x860a('0x8')](),controller[_0x860a('0xb')]);router[_0x860a('0x7')](_0x860a('0xc'),auth[_0x860a('0x8')](),controller[_0x860a('0xd')]);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0x860a('0xe')]);router[_0x860a('0xf')]('/',auth[_0x860a('0x8')](),controller[_0x860a('0x10')]);router[_0x860a('0xf')](_0x860a('0xc'),auth[_0x860a('0x8')](),controller[_0x860a('0x11')]);router[_0x860a('0x12')](_0x860a('0xa'),auth[_0x860a('0x8')](),controller[_0x860a('0x13')]);router[_0x860a('0x14')](_0x860a('0xa'),auth['isAuthenticated'](),controller[_0x860a('0x15')]);module[_0x860a('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 85bf502..975daac 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 _0x6791=['STRING','ENUM','basic','newTab','integrationTab','sequelize','exports'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x6791,0x15c));var _0x1679=function(_0x20c4fe,_0x308afc){_0x20c4fe=_0x20c4fe-0x0;var _0x585c12=_0x6791[_0x20c4fe];return _0x585c12;};'use strict';var Sequelize=require(_0x1679('0x0'));module[_0x1679('0x1')]={'name':{'type':Sequelize[_0x1679('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x1679('0x2')]},'remoteUri':{'type':Sequelize[_0x1679('0x2')]},'authType':{'type':Sequelize[_0x1679('0x3')](_0x1679('0x4')),'defaultValue':_0x1679('0x4')},'password':{'type':Sequelize[_0x1679('0x2')]},'consumerKey':{'type':Sequelize[_0x1679('0x2')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x1679('0x2')]},'tokenSecret':{'type':Sequelize[_0x1679('0x2')]},'serverUrl':{'type':Sequelize[_0x1679('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x1679('0x3')]('integrationTab',_0x1679('0x5')),'defaultValue':_0x1679('0x6')}}; \ No newline at end of file +var _0x58f6=['sequelize','exports','STRING','basic','newTab','integrationTab'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x58f6,0x1aa));var _0x658f=function(_0x2884ed,_0x2631c4){_0x2884ed=_0x2884ed-0x0;var _0x4e274b=_0x58f6[_0x2884ed];return _0x4e274b;};'use strict';var Sequelize=require(_0x658f('0x0'));module[_0x658f('0x1')]={'name':{'type':Sequelize[_0x658f('0x2')]},'description':{'type':Sequelize[_0x658f('0x2')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x658f('0x2')]},'authType':{'type':Sequelize['ENUM']('basic'),'defaultValue':_0x658f('0x3')},'password':{'type':Sequelize[_0x658f('0x2')]},'consumerKey':{'type':Sequelize[_0x658f('0x2')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0x658f('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab',_0x658f('0x4')),'defaultValue':_0x658f('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 2a6ee6c..f08849b 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 _0xbaaf=['offset','undefined','limit','count','set','Content-Range','reject','save','update','then','end','sendStatus','error','stack','name','send','index','map','DeskAccount','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','merge','where','type','includeAll','include','findAll','rows','catch','show','params','keys','length','create','body','find','destroy','findOne','DeskConfiguration','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','channel','DeskField','getFields','remoteUri','username','password','consumerKey','consumerSecret','token','tokenSecret','slice','substring','GET','%s/custom_fields','application/json','authType','headers','Authorization','format','Basic\x20%s','%s:%s','toString','base64','entries','active','label','test','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xbaaf,0x1a3));var _0xfbaa=function(_0x39aaca,_0x26bc43){_0x39aaca=_0x39aaca-0x0;var _0x5a5ddc=_0xbaaf[_0x39aaca];return _0x5a5ddc;};'use strict';var emlformat=require(_0xfbaa('0x0'));var rimraf=require(_0xfbaa('0x1'));var zipdir=require(_0xfbaa('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfbaa('0x3'));var moment=require(_0xfbaa('0x4'));var BPromise=require(_0xfbaa('0x5'));var Mustache=require(_0xfbaa('0x6'));var util=require(_0xfbaa('0x7'));var path=require('path');var sox=require(_0xfbaa('0x8'));var csv=require(_0xfbaa('0x9'));var ejs=require(_0xfbaa('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xfbaa('0xb'));var crypto=require('crypto');var jsforce=require(_0xfbaa('0xc'));var deskjs=require(_0xfbaa('0xd'));var toCsv=require(_0xfbaa('0x9'));var querystring=require('querystring');var Papa=require(_0xfbaa('0xe'));var Redis=require(_0xfbaa('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xfbaa('0x10'));var as=require(_0xfbaa('0x11'));var hardwareService=require(_0xfbaa('0x12'));var logger=require(_0xfbaa('0x13'))('api');var utils=require(_0xfbaa('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xfbaa('0x15'));var db=require(_0xfbaa('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3159fd,_0x2219f1){_0x2219f1=_0x2219f1||0xcc;return function(_0x4198f9){if(_0x4198f9){return _0x3159fd['sendStatus'](_0x2219f1);}return _0x3159fd[_0xfbaa('0x17')](_0x2219f1)['end']();};}function respondWithResult(_0x542150,_0x17d5b8){_0x17d5b8=_0x17d5b8||0xc8;return function(_0x590782){if(_0x590782){return _0x542150['status'](_0x17d5b8)[_0xfbaa('0x18')](_0x590782);}};}function respondWithFilteredResult(_0x1f29bf,_0x498fd2){return function(_0x4598a6){if(_0x4598a6){var _0xf4131c=typeof _0x498fd2[_0xfbaa('0x19')]===_0xfbaa('0x1a')&&typeof _0x498fd2[_0xfbaa('0x1b')]===_0xfbaa('0x1a');var _0x564f23=_0x4598a6[_0xfbaa('0x1c')];var _0x39b2a2=_0xf4131c?0x0:_0x498fd2[_0xfbaa('0x19')];var _0x1dca3e=_0xf4131c?_0x4598a6[_0xfbaa('0x1c')]:_0x498fd2[_0xfbaa('0x19')]+_0x498fd2[_0xfbaa('0x1b')];var _0x883e89;if(_0x1dca3e>=_0x564f23){_0x1dca3e=_0x564f23;_0x883e89=0xc8;}else{_0x883e89=0xce;}_0x1f29bf['status'](_0x883e89);return _0x1f29bf[_0xfbaa('0x1d')](_0xfbaa('0x1e'),_0x39b2a2+'-'+_0x1dca3e+'/'+_0x564f23)[_0xfbaa('0x18')](_0x4598a6);}return null;};}function patchUpdates(_0x1b147a){return function(_0xf6c3ee){try{jsonpatch['apply'](_0xf6c3ee,_0x1b147a,!![]);}catch(_0x554978){return BPromise[_0xfbaa('0x1f')](_0x554978);}return _0xf6c3ee[_0xfbaa('0x20')]();};}function saveUpdates(_0x222b03,_0x38121a){return function(_0x51301a){if(_0x51301a){return _0x51301a[_0xfbaa('0x21')](_0x222b03)[_0xfbaa('0x22')](function(_0x404891){return _0x404891;});}return null;};}function removeEntity(_0x1412d0,_0x322788){return function(_0x27d39f){if(_0x27d39f){return _0x27d39f['destroy']()[_0xfbaa('0x22')](function(){_0x1412d0[_0xfbaa('0x17')](0xcc)[_0xfbaa('0x23')]();});}};}function handleEntityNotFound(_0x574f05,_0x2d204a){return function(_0x19b3d0){if(!_0x19b3d0){_0x574f05[_0xfbaa('0x24')](0x194);}return _0x19b3d0;};}function handleError(_0x1fdeda,_0xd76a9e){_0xd76a9e=_0xd76a9e||0x1f4;return function(_0x39aa10){logger[_0xfbaa('0x25')](_0x39aa10[_0xfbaa('0x26')]);if(_0x39aa10[_0xfbaa('0x27')]){delete _0x39aa10[_0xfbaa('0x27')];}_0x1fdeda['status'](_0xd76a9e)[_0xfbaa('0x28')](_0x39aa10);};}exports[_0xfbaa('0x29')]=function(_0x27bfea,_0x2f7a35){var _0x40677c={},_0x46a65a={},_0x19301e={'count':0x0,'rows':[]};var _0x4d4c56=_[_0xfbaa('0x2a')](db[_0xfbaa('0x2b')][_0xfbaa('0x2c')],function(_0xa6a16){return{'name':_0xa6a16[_0xfbaa('0x2d')],'type':_0xa6a16['type']['key']};});_0x46a65a[_0xfbaa('0x2e')]=_['map'](_0x4d4c56,_0xfbaa('0x27'));_0x46a65a[_0xfbaa('0x2f')]=_['keys'](_0x27bfea[_0xfbaa('0x2f')]);_0x46a65a[_0xfbaa('0x30')]=_[_0xfbaa('0x31')](_0x46a65a[_0xfbaa('0x2e')],_0x46a65a[_0xfbaa('0x2f')]);_0x40677c[_0xfbaa('0x32')]=_[_0xfbaa('0x31')](_0x46a65a[_0xfbaa('0x2e')],qs[_0xfbaa('0x33')](_0x27bfea[_0xfbaa('0x2f')][_0xfbaa('0x33')]));_0x40677c[_0xfbaa('0x32')]=_0x40677c[_0xfbaa('0x32')]['length']?_0x40677c['attributes']:_0x46a65a[_0xfbaa('0x2e')];if(!_0x27bfea[_0xfbaa('0x2f')]['hasOwnProperty'](_0xfbaa('0x34'))){_0x40677c[_0xfbaa('0x1b')]=qs[_0xfbaa('0x1b')](_0x27bfea['query'][_0xfbaa('0x1b')]);_0x40677c[_0xfbaa('0x19')]=qs[_0xfbaa('0x19')](_0x27bfea[_0xfbaa('0x2f')][_0xfbaa('0x19')]);}_0x40677c[_0xfbaa('0x35')]=qs[_0xfbaa('0x36')](_0x27bfea[_0xfbaa('0x2f')][_0xfbaa('0x36')]);_0x40677c['where']=qs['filters'](_[_0xfbaa('0x37')](_0x27bfea[_0xfbaa('0x2f')],_0x46a65a['filters']),_0x4d4c56);if(_0x27bfea['query'][_0xfbaa('0x38')]){_0x40677c['where']=_[_0xfbaa('0x39')](_0x40677c[_0xfbaa('0x3a')],{'$or':_[_0xfbaa('0x2a')](_0x4d4c56,function(_0x451de2){if(_0x451de2[_0xfbaa('0x3b')]!=='VIRTUAL'){var _0x31f826={};_0x31f826[_0x451de2[_0xfbaa('0x27')]]={'$like':'%'+_0x27bfea['query']['filter']+'%'};return _0x31f826;}})});}_0x40677c=_[_0xfbaa('0x39')]({},_0x40677c,_0x27bfea['options']);var _0xdac0fc={'where':_0x40677c[_0xfbaa('0x3a')]};return db[_0xfbaa('0x2b')][_0xfbaa('0x1c')](_0xdac0fc)[_0xfbaa('0x22')](function(_0x17eb36){_0x19301e[_0xfbaa('0x1c')]=_0x17eb36;if(_0x27bfea['query'][_0xfbaa('0x3c')]){_0x40677c[_0xfbaa('0x3d')]=[{'all':!![]}];}return db[_0xfbaa('0x2b')][_0xfbaa('0x3e')](_0x40677c);})[_0xfbaa('0x22')](function(_0x5456c1){_0x19301e[_0xfbaa('0x3f')]=_0x5456c1;return _0x19301e;})[_0xfbaa('0x22')](respondWithFilteredResult(_0x2f7a35,_0x40677c))[_0xfbaa('0x40')](handleError(_0x2f7a35,null));};exports[_0xfbaa('0x41')]=function(_0x3798f6,_0x5d57aa){var _0x3db7b2={'raw':![],'where':{'id':_0x3798f6[_0xfbaa('0x42')]['id']}},_0x5137d7={};_0x5137d7[_0xfbaa('0x2e')]=_[_0xfbaa('0x43')](db[_0xfbaa('0x2b')][_0xfbaa('0x2c')]);_0x5137d7[_0xfbaa('0x2f')]=_['keys'](_0x3798f6[_0xfbaa('0x2f')]);_0x5137d7['filters']=_[_0xfbaa('0x31')](_0x5137d7[_0xfbaa('0x2e')],_0x5137d7[_0xfbaa('0x2f')]);_0x3db7b2[_0xfbaa('0x32')]=_['intersection'](_0x5137d7[_0xfbaa('0x2e')],qs[_0xfbaa('0x33')](_0x3798f6[_0xfbaa('0x2f')][_0xfbaa('0x33')]));_0x3db7b2[_0xfbaa('0x32')]=_0x3db7b2[_0xfbaa('0x32')][_0xfbaa('0x44')]?_0x3db7b2[_0xfbaa('0x32')]:_0x5137d7[_0xfbaa('0x2e')];if(_0x3798f6[_0xfbaa('0x2f')][_0xfbaa('0x3c')]){_0x3db7b2[_0xfbaa('0x3d')]=[{'all':!![]}];}_0x3db7b2=_['merge']({},_0x3db7b2,_0x3798f6['options']);return db[_0xfbaa('0x2b')]['find'](_0x3db7b2)['then'](handleEntityNotFound(_0x5d57aa,null))[_0xfbaa('0x22')](respondWithResult(_0x5d57aa,null))['catch'](handleError(_0x5d57aa,null));};exports[_0xfbaa('0x45')]=function(_0xaa8a35,_0x3abe2a){return db[_0xfbaa('0x2b')][_0xfbaa('0x45')](_0xaa8a35[_0xfbaa('0x46')],{})[_0xfbaa('0x22')](respondWithResult(_0x3abe2a,0xc9))[_0xfbaa('0x40')](handleError(_0x3abe2a,null));};exports[_0xfbaa('0x21')]=function(_0xcf5486,_0x57f2bb){if(_0xcf5486[_0xfbaa('0x46')]['id']){delete _0xcf5486[_0xfbaa('0x46')]['id'];}return db[_0xfbaa('0x2b')][_0xfbaa('0x47')]({'where':{'id':_0xcf5486[_0xfbaa('0x42')]['id']}})[_0xfbaa('0x22')](handleEntityNotFound(_0x57f2bb,null))[_0xfbaa('0x22')](saveUpdates(_0xcf5486[_0xfbaa('0x46')],null))[_0xfbaa('0x22')](respondWithResult(_0x57f2bb,null))[_0xfbaa('0x40')](handleError(_0x57f2bb,null));};exports[_0xfbaa('0x48')]=function(_0x2ce9ca,_0x174075){return db[_0xfbaa('0x2b')][_0xfbaa('0x47')]({'where':{'id':_0x2ce9ca[_0xfbaa('0x42')]['id']}})[_0xfbaa('0x22')](handleEntityNotFound(_0x174075,null))[_0xfbaa('0x22')](removeEntity(_0x174075,null))[_0xfbaa('0x40')](handleError(_0x174075,null));};exports['getConfigurations']=function(_0x5dc464,_0x349141,_0x4c9398){var _0x51f998={};var _0x3d1465={};var _0x4fd3e2;var _0x2eed08;return db[_0xfbaa('0x2b')][_0xfbaa('0x49')]({'where':{'id':_0x5dc464['params']['id']}})[_0xfbaa('0x22')](handleEntityNotFound(_0x349141,null))[_0xfbaa('0x22')](function(_0x4aa8ce){if(_0x4aa8ce){_0x4fd3e2=_0x4aa8ce;_0x3d1465[_0xfbaa('0x2e')]=_[_0xfbaa('0x43')](db[_0xfbaa('0x4a')]['rawAttributes']);_0x3d1465[_0xfbaa('0x2f')]=_[_0xfbaa('0x43')](_0x5dc464['query']);_0x3d1465[_0xfbaa('0x30')]=_[_0xfbaa('0x31')](_0x3d1465[_0xfbaa('0x2e')],_0x3d1465[_0xfbaa('0x2f')]);_0x51f998[_0xfbaa('0x32')]=_[_0xfbaa('0x31')](_0x3d1465['model'],qs[_0xfbaa('0x33')](_0x5dc464[_0xfbaa('0x2f')][_0xfbaa('0x33')]));_0x51f998[_0xfbaa('0x32')]=_0x51f998[_0xfbaa('0x32')][_0xfbaa('0x44')]?_0x51f998[_0xfbaa('0x32')]:_0x3d1465[_0xfbaa('0x2e')];_0x51f998[_0xfbaa('0x35')]=qs[_0xfbaa('0x36')](_0x5dc464[_0xfbaa('0x2f')][_0xfbaa('0x36')]);_0x51f998[_0xfbaa('0x3a')]=qs[_0xfbaa('0x30')](_[_0xfbaa('0x37')](_0x5dc464[_0xfbaa('0x2f')],_0x3d1465[_0xfbaa('0x30')]));if(_0x5dc464['query']['filter']){_0x51f998[_0xfbaa('0x3a')]=_[_0xfbaa('0x39')](_0x51f998['where'],{'$or':_[_0xfbaa('0x2a')](_0x51f998['attributes'],function(_0x1f0a0c){var _0x217464={};_0x217464[_0x1f0a0c]={'$like':'%'+_0x5dc464[_0xfbaa('0x2f')]['filter']+'%'};return _0x217464;})});}_0x51f998=_['merge']({},_0x51f998,_0x5dc464['options']);return _0x4fd3e2[_0xfbaa('0x4b')](_0x51f998);}})[_0xfbaa('0x22')](function(_0x4a273c){if(_0x4a273c){_0x2eed08=_0x4a273c[_0xfbaa('0x44')];if(!_0x5dc464[_0xfbaa('0x2f')][_0xfbaa('0x4c')]('nolimit')){_0x51f998['limit']=qs[_0xfbaa('0x1b')](_0x5dc464[_0xfbaa('0x2f')]['limit']);_0x51f998[_0xfbaa('0x19')]=qs[_0xfbaa('0x19')](_0x5dc464[_0xfbaa('0x2f')][_0xfbaa('0x19')]);}return _0x4fd3e2[_0xfbaa('0x4b')](_0x51f998);}})[_0xfbaa('0x22')](function(_0x2a4dd2){if(_0x2a4dd2){return _0x2a4dd2?{'count':_0x2eed08,'rows':_0x2a4dd2}:null;}})[_0xfbaa('0x22')](respondWithResult(_0x349141,null))[_0xfbaa('0x40')](handleError(_0x349141,null));};exports[_0xfbaa('0x4d')]=function(_0x55c171,_0x232147,_0x5a8215){if(_0x55c171[_0xfbaa('0x46')]['id']){delete _0x55c171[_0xfbaa('0x46')]['id'];}return db[_0xfbaa('0x2b')][_0xfbaa('0x49')]({'where':{'id':_0x55c171[_0xfbaa('0x42')]['id']}})[_0xfbaa('0x22')](handleEntityNotFound(_0x232147,null))[_0xfbaa('0x22')](function(_0x2f8065){if(_0x2f8065){_0x55c171[_0xfbaa('0x46')][_0xfbaa('0x4e')]=_0x2f8065['id'];_0x55c171[_0xfbaa('0x46')][_0xfbaa('0x4f')]=integrations[_0xfbaa('0x50')](_0x55c171[_0xfbaa('0x46')]['channel'],_0x55c171[_0xfbaa('0x46')][_0xfbaa('0x3b')]);_0x55c171['body'][_0xfbaa('0x51')]=integrations['getDescriptions'](_0x55c171[_0xfbaa('0x46')][_0xfbaa('0x52')],_0x55c171[_0xfbaa('0x46')][_0xfbaa('0x3b')]);return db[_0xfbaa('0x4a')][_0xfbaa('0x45')](_0x55c171['body'],{'include':[{'model':db[_0xfbaa('0x53')],'as':_0xfbaa('0x4f')},{'model':db[_0xfbaa('0x53')],'as':'Descriptions'}]});}return null;})[_0xfbaa('0x22')](respondWithResult(_0x232147,null))['catch'](handleError(_0x232147,null));};exports[_0xfbaa('0x54')]=function(_0x4db6ea,_0x3e4360,_0x402e30){var _0x49cffe=[{'name':'priority','label':'priority','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 _0x4ac529='';return db['DeskAccount']['findOne']({'where':{'id':_0x4db6ea[_0xfbaa('0x42')]['id']},'attributes':['id',_0xfbaa('0x55'),'authType',_0xfbaa('0x56'),_0xfbaa('0x57'),_0xfbaa('0x58'),_0xfbaa('0x59'),_0xfbaa('0x5a'),_0xfbaa('0x5b')]})[_0xfbaa('0x22')](handleEntityNotFound(_0x3e4360,null))['then'](function(_0x48e19c){if(_0x48e19c){_0x4ac529=_0x48e19c[_0xfbaa('0x55')];var _0x2d27a9=_0x4ac529[_0xfbaa('0x5c')](-0x1);if(_0x2d27a9==='/'){_0x4ac529=_0x4ac529[_0xfbaa('0x5d')](0x0,_0x4ac529['lastIndexOf'](_0x2d27a9));}var _0x406347={'method':_0xfbaa('0x5e'),'uri':util['format'](_0xfbaa('0x5f'),_0x4ac529),'headers':{'Content-Type':_0xfbaa('0x60'),'Accept':_0xfbaa('0x60')},'json':!![]};if(_0x48e19c[_0xfbaa('0x61')]==='basic'){_0x406347[_0xfbaa('0x62')][_0xfbaa('0x63')]=util[_0xfbaa('0x64')](_0xfbaa('0x65'),new Buffer(util['format'](_0xfbaa('0x66'),_0x48e19c[_0xfbaa('0x56')],_0x48e19c[_0xfbaa('0x57')]))[_0xfbaa('0x67')](_0xfbaa('0x68')));}return rp(_0x406347)[_0xfbaa('0x22')](function(_0x1b27e2){return _0x49cffe['concat'](_[_0xfbaa('0x2a')](_0x1b27e2['_embedded'][_0xfbaa('0x69')],function(_0x149da1){return{'id':_0x149da1['name'],'name':_0x149da1[_0xfbaa('0x27')],'type':_0x149da1[_0xfbaa('0x3b')],'active':_0x149da1[_0xfbaa('0x6a')],'label':_0x149da1[_0xfbaa('0x6b')],'custom':!![]};}));});}})[_0xfbaa('0x22')](function(_0x4ac077){return{'count':_0x4ac077['length'],'rows':_0x4ac077};})[_0xfbaa('0x22')](respondWithResult(_0x3e4360,null))[_0xfbaa('0x40')](function(_0x2a56c2){var _0x247a71=_0x4db6ea[_0xfbaa('0x2f')][_0xfbaa('0x6c')]?0x1f4:_0x2a56c2['statusCode']||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xfbaa('0x54'),_0x247a71,JSON['stringify'](_0x2a56c2));delete _0x2a56c2['name'];if(_0x247a71===0x191){_0x247a71=0x190;}_0x3e4360[_0xfbaa('0x17')](_0x247a71)[_0xfbaa('0x28')](_0x4db6ea[_0xfbaa('0x2f')]['test']?{'message':_0xfbaa('0x6d'),'statusCode':_0x2a56c2[_0xfbaa('0x6e')]}:_0x2a56c2);});}; \ No newline at end of file +var _0xae1f=['bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','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/utils','../../config/environment','../../components/integrations/configuration','sendStatus','end','status','offset','undefined','limit','count','set','json','save','update','error','name','send','map','DeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','then','includeAll','findAll','rows','catch','show','params','find','create','body','destroy','getConfigurations','findOne','DeskConfiguration','order','pick','nolimit','addConfiguration','AccountId','Subjects','channel','Descriptions','DeskField','getFields','priority','remoteUri','authType','username','token','tokenSecret','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','%s:%s','password','toString','base64','active','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','fast-json-patch','request-promise','moment'];(function(_0x12a358,_0x4de247){var _0x365ab0=function(_0x5ef096){while(--_0x5ef096){_0x12a358['push'](_0x12a358['shift']());}};_0x365ab0(++_0x4de247);}(_0xae1f,0x146));var _0xfae1=function(_0x2bb3f6,_0x25fde0){_0x2bb3f6=_0x2bb3f6-0x0;var _0x62b339=_0xae1f[_0x2bb3f6];return _0x62b339;};'use strict';var emlformat=require(_0xfae1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfae1('0x1'));var rp=require(_0xfae1('0x2'));var moment=require(_0xfae1('0x3'));var BPromise=require(_0xfae1('0x4'));var Mustache=require(_0xfae1('0x5'));var util=require(_0xfae1('0x6'));var path=require(_0xfae1('0x7'));var sox=require(_0xfae1('0x8'));var csv=require('to-csv');var ejs=require(_0xfae1('0x9'));var fs=require('fs');var fs_extra=require(_0xfae1('0xa'));var _=require(_0xfae1('0xb'));var squel=require(_0xfae1('0xc'));var crypto=require(_0xfae1('0xd'));var jsforce=require(_0xfae1('0xe'));var deskjs=require(_0xfae1('0xf'));var toCsv=require(_0xfae1('0x10'));var querystring=require(_0xfae1('0x11'));var Papa=require(_0xfae1('0x12'));var Redis=require(_0xfae1('0x13'));var authService=require(_0xfae1('0x14'));var qs=require(_0xfae1('0x15'));var as=require(_0xfae1('0x16'));var hardwareService=require(_0xfae1('0x17'));var logger=require(_0xfae1('0x18'))(_0xfae1('0x19'));var utils=require(_0xfae1('0x1a'));var config=require(_0xfae1('0x1b'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xfae1('0x1c'));function respondWithStatusCode(_0x53990b,_0x2847ab){_0x2847ab=_0x2847ab||0xcc;return function(_0x95ca7c){if(_0x95ca7c){return _0x53990b[_0xfae1('0x1d')](_0x2847ab);}return _0x53990b['status'](_0x2847ab)[_0xfae1('0x1e')]();};}function respondWithResult(_0x51fb0a,_0x1a4243){_0x1a4243=_0x1a4243||0xc8;return function(_0x5b10a0){if(_0x5b10a0){return _0x51fb0a[_0xfae1('0x1f')](_0x1a4243)['json'](_0x5b10a0);}};}function respondWithFilteredResult(_0x59d9d9,_0x7fa43d){return function(_0x3f4401){if(_0x3f4401){var _0x356576=typeof _0x7fa43d[_0xfae1('0x20')]===_0xfae1('0x21')&&typeof _0x7fa43d[_0xfae1('0x22')]===_0xfae1('0x21');var _0x5b9c92=_0x3f4401[_0xfae1('0x23')];var _0x478586=_0x356576?0x0:_0x7fa43d[_0xfae1('0x20')];var _0x419ca7=_0x356576?_0x3f4401[_0xfae1('0x23')]:_0x7fa43d['offset']+_0x7fa43d[_0xfae1('0x22')];var _0x3c9af9;if(_0x419ca7>=_0x5b9c92){_0x419ca7=_0x5b9c92;_0x3c9af9=0xc8;}else{_0x3c9af9=0xce;}_0x59d9d9[_0xfae1('0x1f')](_0x3c9af9);return _0x59d9d9[_0xfae1('0x24')]('Content-Range',_0x478586+'-'+_0x419ca7+'/'+_0x5b9c92)[_0xfae1('0x25')](_0x3f4401);}return null;};}function patchUpdates(_0x70bad8){return function(_0x10b45b){try{jsonpatch['apply'](_0x10b45b,_0x70bad8,!![]);}catch(_0x2509e6){return BPromise['reject'](_0x2509e6);}return _0x10b45b[_0xfae1('0x26')]();};}function saveUpdates(_0x3ea6cb,_0x561b3b){return function(_0x260d59){if(_0x260d59){return _0x260d59[_0xfae1('0x27')](_0x3ea6cb)['then'](function(_0x3534f5){return _0x3534f5;});}return null;};}function removeEntity(_0x12accd,_0x35dc85){return function(_0xf9f628){if(_0xf9f628){return _0xf9f628['destroy']()['then'](function(){_0x12accd[_0xfae1('0x1f')](0xcc)[_0xfae1('0x1e')]();});}};}function handleEntityNotFound(_0x17b0a0,_0x2b1f31){return function(_0x4d41dd){if(!_0x4d41dd){_0x17b0a0['sendStatus'](0x194);}return _0x4d41dd;};}function handleError(_0x28962e,_0x48b47b){_0x48b47b=_0x48b47b||0x1f4;return function(_0x3083c8){logger[_0xfae1('0x28')](_0x3083c8['stack']);if(_0x3083c8['name']){delete _0x3083c8[_0xfae1('0x29')];}_0x28962e['status'](_0x48b47b)[_0xfae1('0x2a')](_0x3083c8);};}exports['index']=function(_0x3366e4,_0x27bc05){var _0x589f0e={},_0x36dc1d={},_0x35c868={'count':0x0,'rows':[]};var _0x28a1b8=_[_0xfae1('0x2b')](db[_0xfae1('0x2c')][_0xfae1('0x2d')],function(_0x3b2a53){return{'name':_0x3b2a53[_0xfae1('0x2e')],'type':_0x3b2a53[_0xfae1('0x2f')][_0xfae1('0x30')]};});_0x36dc1d[_0xfae1('0x31')]=_[_0xfae1('0x2b')](_0x28a1b8,_0xfae1('0x29'));_0x36dc1d[_0xfae1('0x32')]=_[_0xfae1('0x33')](_0x3366e4[_0xfae1('0x32')]);_0x36dc1d[_0xfae1('0x34')]=_[_0xfae1('0x35')](_0x36dc1d[_0xfae1('0x31')],_0x36dc1d[_0xfae1('0x32')]);_0x589f0e[_0xfae1('0x36')]=_[_0xfae1('0x35')](_0x36dc1d[_0xfae1('0x31')],qs[_0xfae1('0x37')](_0x3366e4[_0xfae1('0x32')][_0xfae1('0x37')]));_0x589f0e[_0xfae1('0x36')]=_0x589f0e[_0xfae1('0x36')][_0xfae1('0x38')]?_0x589f0e['attributes']:_0x36dc1d[_0xfae1('0x31')];if(!_0x3366e4[_0xfae1('0x32')][_0xfae1('0x39')]('nolimit')){_0x589f0e['limit']=qs['limit'](_0x3366e4[_0xfae1('0x32')][_0xfae1('0x22')]);_0x589f0e['offset']=qs[_0xfae1('0x20')](_0x3366e4[_0xfae1('0x32')][_0xfae1('0x20')]);}_0x589f0e['order']=qs[_0xfae1('0x3a')](_0x3366e4[_0xfae1('0x32')]['sort']);_0x589f0e[_0xfae1('0x3b')]=qs[_0xfae1('0x34')](_['pick'](_0x3366e4[_0xfae1('0x32')],_0x36dc1d[_0xfae1('0x34')]),_0x28a1b8);if(_0x3366e4[_0xfae1('0x32')][_0xfae1('0x3c')]){_0x589f0e[_0xfae1('0x3b')]=_[_0xfae1('0x3d')](_0x589f0e[_0xfae1('0x3b')],{'$or':_[_0xfae1('0x2b')](_0x28a1b8,function(_0x33bb42){if(_0x33bb42['type']!==_0xfae1('0x3e')){var _0x106844={};_0x106844[_0x33bb42[_0xfae1('0x29')]]={'$like':'%'+_0x3366e4['query'][_0xfae1('0x3c')]+'%'};return _0x106844;}})});}_0x589f0e=_['merge']({},_0x589f0e,_0x3366e4[_0xfae1('0x3f')]);var _0x4ae521={'where':_0x589f0e[_0xfae1('0x3b')]};return db[_0xfae1('0x2c')]['count'](_0x4ae521)[_0xfae1('0x40')](function(_0x495cab){_0x35c868[_0xfae1('0x23')]=_0x495cab;if(_0x3366e4[_0xfae1('0x32')][_0xfae1('0x41')]){_0x589f0e['include']=[{'all':!![]}];}return db['DeskAccount'][_0xfae1('0x42')](_0x589f0e);})[_0xfae1('0x40')](function(_0xe40806){_0x35c868[_0xfae1('0x43')]=_0xe40806;return _0x35c868;})[_0xfae1('0x40')](respondWithFilteredResult(_0x27bc05,_0x589f0e))[_0xfae1('0x44')](handleError(_0x27bc05,null));};exports[_0xfae1('0x45')]=function(_0x1232b,_0x4e4f93){var _0x129541={'raw':![],'where':{'id':_0x1232b[_0xfae1('0x46')]['id']}},_0x30776b={};_0x30776b['model']=_[_0xfae1('0x33')](db['DeskAccount'][_0xfae1('0x2d')]);_0x30776b[_0xfae1('0x32')]=_[_0xfae1('0x33')](_0x1232b['query']);_0x30776b[_0xfae1('0x34')]=_[_0xfae1('0x35')](_0x30776b[_0xfae1('0x31')],_0x30776b['query']);_0x129541['attributes']=_[_0xfae1('0x35')](_0x30776b[_0xfae1('0x31')],qs[_0xfae1('0x37')](_0x1232b[_0xfae1('0x32')][_0xfae1('0x37')]));_0x129541['attributes']=_0x129541[_0xfae1('0x36')]['length']?_0x129541[_0xfae1('0x36')]:_0x30776b[_0xfae1('0x31')];if(_0x1232b[_0xfae1('0x32')][_0xfae1('0x41')]){_0x129541['include']=[{'all':!![]}];}_0x129541=_[_0xfae1('0x3d')]({},_0x129541,_0x1232b[_0xfae1('0x3f')]);return db[_0xfae1('0x2c')][_0xfae1('0x47')](_0x129541)[_0xfae1('0x40')](handleEntityNotFound(_0x4e4f93,null))[_0xfae1('0x40')](respondWithResult(_0x4e4f93,null))[_0xfae1('0x44')](handleError(_0x4e4f93,null));};exports[_0xfae1('0x48')]=function(_0x1d85e1,_0x36de37){return db[_0xfae1('0x2c')][_0xfae1('0x48')](_0x1d85e1['body'],{})[_0xfae1('0x40')](respondWithResult(_0x36de37,0xc9))[_0xfae1('0x44')](handleError(_0x36de37,null));};exports[_0xfae1('0x27')]=function(_0x25c574,_0x2f9f02){if(_0x25c574[_0xfae1('0x49')]['id']){delete _0x25c574['body']['id'];}return db[_0xfae1('0x2c')][_0xfae1('0x47')]({'where':{'id':_0x25c574['params']['id']}})[_0xfae1('0x40')](handleEntityNotFound(_0x2f9f02,null))['then'](saveUpdates(_0x25c574[_0xfae1('0x49')],null))[_0xfae1('0x40')](respondWithResult(_0x2f9f02,null))[_0xfae1('0x44')](handleError(_0x2f9f02,null));};exports[_0xfae1('0x4a')]=function(_0x1588a1,_0x86e798){return db[_0xfae1('0x2c')][_0xfae1('0x47')]({'where':{'id':_0x1588a1[_0xfae1('0x46')]['id']}})[_0xfae1('0x40')](handleEntityNotFound(_0x86e798,null))['then'](removeEntity(_0x86e798,null))[_0xfae1('0x44')](handleError(_0x86e798,null));};exports[_0xfae1('0x4b')]=function(_0x37a166,_0x3c4951,_0x127d86){var _0x400228={};var _0x4fa9b3={};var _0x172ed8;var _0x1a8166;return db[_0xfae1('0x2c')][_0xfae1('0x4c')]({'where':{'id':_0x37a166['params']['id']}})[_0xfae1('0x40')](handleEntityNotFound(_0x3c4951,null))['then'](function(_0x561e58){if(_0x561e58){_0x172ed8=_0x561e58;_0x4fa9b3['model']=_[_0xfae1('0x33')](db[_0xfae1('0x4d')][_0xfae1('0x2d')]);_0x4fa9b3[_0xfae1('0x32')]=_[_0xfae1('0x33')](_0x37a166['query']);_0x4fa9b3[_0xfae1('0x34')]=_[_0xfae1('0x35')](_0x4fa9b3[_0xfae1('0x31')],_0x4fa9b3[_0xfae1('0x32')]);_0x400228[_0xfae1('0x36')]=_[_0xfae1('0x35')](_0x4fa9b3[_0xfae1('0x31')],qs[_0xfae1('0x37')](_0x37a166[_0xfae1('0x32')]['fields']));_0x400228[_0xfae1('0x36')]=_0x400228['attributes'][_0xfae1('0x38')]?_0x400228[_0xfae1('0x36')]:_0x4fa9b3[_0xfae1('0x31')];_0x400228[_0xfae1('0x4e')]=qs['sort'](_0x37a166[_0xfae1('0x32')]['sort']);_0x400228['where']=qs[_0xfae1('0x34')](_[_0xfae1('0x4f')](_0x37a166[_0xfae1('0x32')],_0x4fa9b3[_0xfae1('0x34')]));if(_0x37a166['query'][_0xfae1('0x3c')]){_0x400228['where']=_[_0xfae1('0x3d')](_0x400228[_0xfae1('0x3b')],{'$or':_['map'](_0x400228[_0xfae1('0x36')],function(_0x157845){var _0xb8a58={};_0xb8a58[_0x157845]={'$like':'%'+_0x37a166[_0xfae1('0x32')][_0xfae1('0x3c')]+'%'};return _0xb8a58;})});}_0x400228=_['merge']({},_0x400228,_0x37a166['options']);return _0x172ed8[_0xfae1('0x4b')](_0x400228);}})[_0xfae1('0x40')](function(_0xd69d99){if(_0xd69d99){_0x1a8166=_0xd69d99[_0xfae1('0x38')];if(!_0x37a166[_0xfae1('0x32')][_0xfae1('0x39')](_0xfae1('0x50'))){_0x400228[_0xfae1('0x22')]=qs[_0xfae1('0x22')](_0x37a166[_0xfae1('0x32')][_0xfae1('0x22')]);_0x400228[_0xfae1('0x20')]=qs[_0xfae1('0x20')](_0x37a166['query'][_0xfae1('0x20')]);}return _0x172ed8[_0xfae1('0x4b')](_0x400228);}})[_0xfae1('0x40')](function(_0x39b83e){if(_0x39b83e){return _0x39b83e?{'count':_0x1a8166,'rows':_0x39b83e}:null;}})['then'](respondWithResult(_0x3c4951,null))[_0xfae1('0x44')](handleError(_0x3c4951,null));};exports[_0xfae1('0x51')]=function(_0x17156d,_0x17f145,_0x1024fb){if(_0x17156d[_0xfae1('0x49')]['id']){delete _0x17156d[_0xfae1('0x49')]['id'];}return db['DeskAccount']['findOne']({'where':{'id':_0x17156d['params']['id']}})[_0xfae1('0x40')](handleEntityNotFound(_0x17f145,null))[_0xfae1('0x40')](function(_0x16e7a2){if(_0x16e7a2){_0x17156d[_0xfae1('0x49')][_0xfae1('0x52')]=_0x16e7a2['id'];_0x17156d['body'][_0xfae1('0x53')]=integrations['getSubjects'](_0x17156d[_0xfae1('0x49')][_0xfae1('0x54')],_0x17156d[_0xfae1('0x49')][_0xfae1('0x2f')]);_0x17156d['body'][_0xfae1('0x55')]=integrations['getDescriptions'](_0x17156d[_0xfae1('0x49')][_0xfae1('0x54')],_0x17156d[_0xfae1('0x49')][_0xfae1('0x2f')]);return db[_0xfae1('0x4d')][_0xfae1('0x48')](_0x17156d['body'],{'include':[{'model':db[_0xfae1('0x56')],'as':_0xfae1('0x53')},{'model':db['DeskField'],'as':_0xfae1('0x55')}]});}return null;})[_0xfae1('0x40')](respondWithResult(_0x17f145,null))[_0xfae1('0x44')](handleError(_0x17f145,null));};exports[_0xfae1('0x57')]=function(_0x44aec2,_0x4a24e6,_0x4b6bc1){var _0xc7565=[{'name':'priority','label':_0xfae1('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 _0x4b4f35='';return db[_0xfae1('0x2c')][_0xfae1('0x4c')]({'where':{'id':_0x44aec2[_0xfae1('0x46')]['id']},'attributes':['id',_0xfae1('0x59'),_0xfae1('0x5a'),_0xfae1('0x5b'),'password','consumerKey','consumerSecret',_0xfae1('0x5c'),_0xfae1('0x5d')]})[_0xfae1('0x40')](handleEntityNotFound(_0x4a24e6,null))[_0xfae1('0x40')](function(_0x2c4669){if(_0x2c4669){_0x4b4f35=_0x2c4669['remoteUri'];var _0x2c2692=_0x4b4f35['slice'](-0x1);if(_0x2c2692==='/'){_0x4b4f35=_0x4b4f35['substring'](0x0,_0x4b4f35[_0xfae1('0x5e')](_0x2c2692));}var _0x12e595={'method':_0xfae1('0x5f'),'uri':util[_0xfae1('0x60')](_0xfae1('0x61'),_0x4b4f35),'headers':{'Content-Type':_0xfae1('0x62'),'Accept':'application/json'},'json':!![]};if(_0x2c4669[_0xfae1('0x5a')]===_0xfae1('0x63')){_0x12e595['headers']['Authorization']=util[_0xfae1('0x60')]('Basic\x20%s',new Buffer(util['format'](_0xfae1('0x64'),_0x2c4669[_0xfae1('0x5b')],_0x2c4669[_0xfae1('0x65')]))[_0xfae1('0x66')](_0xfae1('0x67')));}return rp(_0x12e595)[_0xfae1('0x40')](function(_0x470c56){return _0xc7565['concat'](_[_0xfae1('0x2b')](_0x470c56['_embedded']['entries'],function(_0xaa49d4){return{'id':_0xaa49d4[_0xfae1('0x29')],'name':_0xaa49d4[_0xfae1('0x29')],'type':_0xaa49d4['type'],'active':_0xaa49d4[_0xfae1('0x68')],'label':_0xaa49d4['label'],'custom':!![]};}));});}})['then'](function(_0xa1a5f1){return{'count':_0xa1a5f1[_0xfae1('0x38')],'rows':_0xa1a5f1};})['then'](respondWithResult(_0x4a24e6,null))[_0xfae1('0x44')](function(_0x179923){var _0x24ad8a=_0x44aec2[_0xfae1('0x32')][_0xfae1('0x69')]?0x1f4:_0x179923[_0xfae1('0x6a')]||0x1f4;logger[_0xfae1('0x28')](_0xfae1('0x6b'),_0xfae1('0x57'),_0x24ad8a,JSON[_0xfae1('0x6c')](_0x179923));delete _0x179923['name'];if(_0x24ad8a===0x191){_0x24ad8a=0x190;}_0x4a24e6[_0xfae1('0x1f')](_0x24ad8a)[_0xfae1('0x2a')](_0x44aec2[_0xfae1('0x32')][_0xfae1('0x69')]?{'message':_0xfae1('0x6d'),'statusCode':_0x179923[_0xfae1('0x6a')]}:_0x179923);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 88ecea0..262a980 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 _0xbb28=['path','rimraf','../../config/environment','./intDeskAccount.attributes','exports','define','DeskAccount','int_desk_accounts','lodash','util','api','moment','bluebird'];(function(_0x3774c3,_0x58b031){var _0x4a01e0=function(_0x464622){while(--_0x464622){_0x3774c3['push'](_0x3774c3['shift']());}};_0x4a01e0(++_0x58b031);}(_0xbb28,0xb1));var _0x8bb2=function(_0x5b84fe,_0x5cf397){_0x5b84fe=_0x5b84fe-0x0;var _0x24f261=_0xbb28[_0x5b84fe];return _0x24f261;};'use strict';var _=require(_0x8bb2('0x0'));var util=require(_0x8bb2('0x1'));var logger=require('../../config/logger')(_0x8bb2('0x2'));var moment=require(_0x8bb2('0x3'));var BPromise=require(_0x8bb2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8bb2('0x5'));var rimraf=require(_0x8bb2('0x6'));var config=require(_0x8bb2('0x7'));var attributes=require(_0x8bb2('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x8bb2('0x9')]=function(_0x48eae5,_0x2b70d9){return _0x48eae5[_0x8bb2('0xa')](_0x8bb2('0xb'),attributes,{'tableName':_0x8bb2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xba4d=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../components/integrations/configuration','exports','DeskAccount','int_desk_accounts'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xba4d,0x104));var _0xdba4=function(_0xacb1e2,_0x55e0ab){_0xacb1e2=_0xacb1e2-0x0;var _0x463815=_0xba4d[_0xacb1e2];return _0x463815;};'use strict';var _=require(_0xdba4('0x0'));var util=require(_0xdba4('0x1'));var logger=require(_0xdba4('0x2'))(_0xdba4('0x3'));var moment=require(_0xdba4('0x4'));var BPromise=require(_0xdba4('0x5'));var rp=require(_0xdba4('0x6'));var fs=require('fs');var path=require(_0xdba4('0x7'));var rimraf=require(_0xdba4('0x8'));var config=require('../../config/environment');var attributes=require('./intDeskAccount.attributes');var integrations=require(_0xdba4('0x9'));module[_0xdba4('0xa')]=function(_0xde6608,_0x1de7ef){return _0xde6608['define'](_0xdba4('0xb'),attributes,{'tableName':_0xdba4('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 e090515..d33eb8f 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 _0x0268=['request','then','info','DeskAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','catch','GetDeskAccount','DeskAccount','findAll','options','where','attributes','limit','map','include','model','raw','ShowDeskAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3a0631,_0x2d8a7e){var _0x44bdf0=function(_0x3d5b19){while(--_0x3d5b19){_0x3a0631['push'](_0x3a0631['shift']());}};_0x44bdf0(++_0x2d8a7e);}(_0x0268,0x1ae));var _0x8026=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x0268[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x8026('0x0'));var util=require(_0x8026('0x1'));var moment=require(_0x8026('0x2'));var BPromise=require(_0x8026('0x3'));var rs=require(_0x8026('0x4'));var fs=require('fs');var Redis=require(_0x8026('0x5'));var db=require(_0x8026('0x6'))['db'];var utils=require(_0x8026('0x7'));var logger=require(_0x8026('0x8'))(_0x8026('0x9'));var config=require(_0x8026('0xa'));var jayson=require(_0x8026('0xb'));var client=jayson[_0x8026('0xc')][_0x8026('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x10b04e,_0x36bc35,_0x39e7f6){return new BPromise(function(_0x3518c0,_0x5530c2){return client[_0x8026('0xe')](_0x10b04e,_0x39e7f6)[_0x8026('0xf')](function(_0x11ff7a){logger[_0x8026('0x10')](_0x8026('0x11'),_0x36bc35,'request\x20sent');logger[_0x8026('0x12')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x36bc35,_0x8026('0x13'),JSON[_0x8026('0x14')](_0x11ff7a));if(_0x11ff7a['error']){if(_0x11ff7a['error'][_0x8026('0x15')]===0x1f4){logger[_0x8026('0x16')]('DeskAccount,\x20%s,\x20%s',_0x36bc35,_0x11ff7a[_0x8026('0x16')][_0x8026('0x17')]);return _0x5530c2(_0x11ff7a[_0x8026('0x16')][_0x8026('0x17')]);}logger[_0x8026('0x16')](_0x8026('0x11'),_0x36bc35,_0x11ff7a[_0x8026('0x16')][_0x8026('0x17')]);return _0x3518c0(_0x11ff7a[_0x8026('0x16')][_0x8026('0x17')]);}else{logger['info']('DeskAccount,\x20%s,\x20%s',_0x36bc35,_0x8026('0x13'));_0x3518c0(_0x11ff7a['result'][_0x8026('0x17')]);}})[_0x8026('0x18')](function(_0x5a47bb){logger[_0x8026('0x16')](_0x8026('0x11'),_0x36bc35,_0x5a47bb);_0x5530c2(_0x5a47bb);});});}exports[_0x8026('0x19')]=function(_0x49e1ea){var _0x5ce803=this;return new Promise(function(_0x1e4427,_0x6099ee){return db[_0x8026('0x1a')][_0x8026('0x1b')]({'raw':_0x49e1ea[_0x8026('0x1c')]?_0x49e1ea[_0x8026('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x49e1ea['options']?_0x49e1ea[_0x8026('0x1c')][_0x8026('0x1d')]||null:null,'attributes':_0x49e1ea[_0x8026('0x1c')]?_0x49e1ea[_0x8026('0x1c')][_0x8026('0x1e')]||null:null,'limit':_0x49e1ea[_0x8026('0x1c')]?_0x49e1ea['options'][_0x8026('0x1f')]||null:null,'include':_0x49e1ea[_0x8026('0x1c')]?_0x49e1ea[_0x8026('0x1c')]['include']?_[_0x8026('0x20')](_0x49e1ea[_0x8026('0x1c')][_0x8026('0x21')],function(_0x2ee3cd){return{'model':db[_0x2ee3cd[_0x8026('0x22')]],'as':_0x2ee3cd['as'],'attributes':_0x2ee3cd[_0x8026('0x1e')],'include':_0x2ee3cd[_0x8026('0x21')]?_[_0x8026('0x20')](_0x2ee3cd['include'],function(_0x59579c){return{'model':db[_0x59579c[_0x8026('0x22')]],'as':_0x59579c['as'],'attributes':_0x59579c[_0x8026('0x1e')],'include':_0x59579c[_0x8026('0x21')]?_[_0x8026('0x20')](_0x59579c[_0x8026('0x21')],function(_0x55145a){return{'model':db[_0x55145a[_0x8026('0x22')]],'as':_0x55145a['as'],'attributes':_0x55145a['attributes']};}):[]};}):[]};}):[]:[]})[_0x8026('0xf')](function(_0x5dff50){logger[_0x8026('0x10')]('GetDeskAccount',_0x49e1ea);logger[_0x8026('0x12')]('GetDeskAccount',_0x49e1ea,JSON[_0x8026('0x14')](_0x5dff50));_0x1e4427(_0x5dff50);})[_0x8026('0x18')](function(_0x20aeb7){logger['error'](_0x8026('0x19'),_0x20aeb7['message'],_0x49e1ea);_0x6099ee(_0x5ce803['error'](0x1f4,_0x20aeb7[_0x8026('0x17')]));});});};exports['ShowDeskAccount']=function(_0x5bbca2){var _0x5a79fc=this;return new Promise(function(_0x5ccc7c,_0x3c8b6b){return db['DeskAccount']['find']({'raw':_0x5bbca2['options']?_0x5bbca2[_0x8026('0x1c')][_0x8026('0x23')]===undefined?!![]:![]:!![],'where':_0x5bbca2[_0x8026('0x1c')]?_0x5bbca2[_0x8026('0x1c')][_0x8026('0x1d')]||null:null,'attributes':_0x5bbca2[_0x8026('0x1c')]?_0x5bbca2['options']['attributes']||null:null,'include':_0x5bbca2[_0x8026('0x1c')]?_0x5bbca2[_0x8026('0x1c')][_0x8026('0x21')]?_['map'](_0x5bbca2['options'][_0x8026('0x21')],function(_0x5adb29){return{'model':db[_0x5adb29['model']],'as':_0x5adb29['as'],'attributes':_0x5adb29[_0x8026('0x1e')],'include':_0x5adb29[_0x8026('0x21')]?_[_0x8026('0x20')](_0x5adb29['include'],function(_0x43378d){return{'model':db[_0x43378d[_0x8026('0x22')]],'as':_0x43378d['as'],'attributes':_0x43378d[_0x8026('0x1e')],'include':_0x43378d[_0x8026('0x21')]?_[_0x8026('0x20')](_0x43378d[_0x8026('0x21')],function(_0x407f87){return{'model':db[_0x407f87[_0x8026('0x22')]],'as':_0x407f87['as'],'attributes':_0x407f87[_0x8026('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x8026('0xf')](function(_0x3b89c0){logger['info']('ShowDeskAccount',_0x5bbca2);logger[_0x8026('0x12')](_0x8026('0x24'),_0x5bbca2,JSON[_0x8026('0x14')](_0x3b89c0));_0x5ccc7c(_0x3b89c0);})[_0x8026('0x18')](function(_0x3d1316){logger['error'](_0x8026('0x24'),_0x3d1316[_0x8026('0x17')],_0x5bbca2);_0x3c8b6b(_0x5a79fc[_0x8026('0x16')](0x1f4,_0x3d1316[_0x8026('0x17')]));});});}; \ No newline at end of file +var _0xe635=['error','code','message','result','catch','GetDeskAccount','DeskAccount','findAll','options','raw','attributes','limit','include','map','model','ShowDeskAccount','find','where','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x181644,_0x5a579f){var _0x119b29=function(_0x16f6c4){while(--_0x16f6c4){_0x181644['push'](_0x181644['shift']());}};_0x119b29(++_0x5a579f);}(_0xe635,0x1e7));var _0x5e63=function(_0x1ff733,_0x3a6aa7){_0x1ff733=_0x1ff733-0x0;var _0x477533=_0xe635[_0x1ff733];return _0x477533;};'use strict';var _=require(_0x5e63('0x0'));var util=require(_0x5e63('0x1'));var moment=require(_0x5e63('0x2'));var BPromise=require(_0x5e63('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5e63('0x4'));var db=require(_0x5e63('0x5'))['db'];var utils=require(_0x5e63('0x6'));var logger=require('../../config/logger')(_0x5e63('0x7'));var config=require(_0x5e63('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5e63('0x9')][_0x5e63('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f4a59,_0x3b8760,_0x47048e){return new BPromise(function(_0x5d2f62,_0x59dfa6){return client['request'](_0x4f4a59,_0x47048e)[_0x5e63('0xb')](function(_0x5ca9a2){logger[_0x5e63('0xc')](_0x5e63('0xd'),_0x3b8760,_0x5e63('0xe'));logger['debug'](_0x5e63('0xf'),_0x3b8760,_0x5e63('0xe'),JSON[_0x5e63('0x10')](_0x5ca9a2));if(_0x5ca9a2[_0x5e63('0x11')]){if(_0x5ca9a2[_0x5e63('0x11')][_0x5e63('0x12')]===0x1f4){logger['error'](_0x5e63('0xd'),_0x3b8760,_0x5ca9a2[_0x5e63('0x11')][_0x5e63('0x13')]);return _0x59dfa6(_0x5ca9a2[_0x5e63('0x11')][_0x5e63('0x13')]);}logger[_0x5e63('0x11')](_0x5e63('0xd'),_0x3b8760,_0x5ca9a2['error'][_0x5e63('0x13')]);return _0x5d2f62(_0x5ca9a2[_0x5e63('0x11')][_0x5e63('0x13')]);}else{logger[_0x5e63('0xc')](_0x5e63('0xd'),_0x3b8760,'request\x20sent');_0x5d2f62(_0x5ca9a2[_0x5e63('0x14')]['message']);}})[_0x5e63('0x15')](function(_0x1cf7ab){logger['error'](_0x5e63('0xd'),_0x3b8760,_0x1cf7ab);_0x59dfa6(_0x1cf7ab);});});}exports[_0x5e63('0x16')]=function(_0x4cd7e8){var _0x485480=this;return new Promise(function(_0x32c957,_0x2468c2){return db[_0x5e63('0x17')][_0x5e63('0x18')]({'raw':_0x4cd7e8[_0x5e63('0x19')]?_0x4cd7e8[_0x5e63('0x19')][_0x5e63('0x1a')]===undefined?!![]:![]:!![],'where':_0x4cd7e8[_0x5e63('0x19')]?_0x4cd7e8[_0x5e63('0x19')]['where']||null:null,'attributes':_0x4cd7e8[_0x5e63('0x19')]?_0x4cd7e8[_0x5e63('0x19')][_0x5e63('0x1b')]||null:null,'limit':_0x4cd7e8['options']?_0x4cd7e8['options'][_0x5e63('0x1c')]||null:null,'include':_0x4cd7e8[_0x5e63('0x19')]?_0x4cd7e8[_0x5e63('0x19')][_0x5e63('0x1d')]?_[_0x5e63('0x1e')](_0x4cd7e8[_0x5e63('0x19')][_0x5e63('0x1d')],function(_0x344cdd){return{'model':db[_0x344cdd['model']],'as':_0x344cdd['as'],'attributes':_0x344cdd[_0x5e63('0x1b')],'include':_0x344cdd[_0x5e63('0x1d')]?_['map'](_0x344cdd[_0x5e63('0x1d')],function(_0x4a1524){return{'model':db[_0x4a1524['model']],'as':_0x4a1524['as'],'attributes':_0x4a1524[_0x5e63('0x1b')],'include':_0x4a1524[_0x5e63('0x1d')]?_[_0x5e63('0x1e')](_0x4a1524[_0x5e63('0x1d')],function(_0x5e3a13){return{'model':db[_0x5e3a13[_0x5e63('0x1f')]],'as':_0x5e3a13['as'],'attributes':_0x5e3a13[_0x5e63('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5f2ec3){logger[_0x5e63('0xc')](_0x5e63('0x16'),_0x4cd7e8);logger['debug'](_0x5e63('0x16'),_0x4cd7e8,JSON[_0x5e63('0x10')](_0x5f2ec3));_0x32c957(_0x5f2ec3);})[_0x5e63('0x15')](function(_0x59dab7){logger[_0x5e63('0x11')](_0x5e63('0x16'),_0x59dab7['message'],_0x4cd7e8);_0x2468c2(_0x485480[_0x5e63('0x11')](0x1f4,_0x59dab7[_0x5e63('0x13')]));});});};exports[_0x5e63('0x20')]=function(_0x268400){var _0x1fed81=this;return new Promise(function(_0x243600,_0x331831){return db[_0x5e63('0x17')][_0x5e63('0x21')]({'raw':_0x268400['options']?_0x268400['options'][_0x5e63('0x1a')]===undefined?!![]:![]:!![],'where':_0x268400[_0x5e63('0x19')]?_0x268400[_0x5e63('0x19')][_0x5e63('0x22')]||null:null,'attributes':_0x268400[_0x5e63('0x19')]?_0x268400['options'][_0x5e63('0x1b')]||null:null,'include':_0x268400[_0x5e63('0x19')]?_0x268400[_0x5e63('0x19')][_0x5e63('0x1d')]?_[_0x5e63('0x1e')](_0x268400[_0x5e63('0x19')][_0x5e63('0x1d')],function(_0x19926){return{'model':db[_0x19926[_0x5e63('0x1f')]],'as':_0x19926['as'],'attributes':_0x19926[_0x5e63('0x1b')],'include':_0x19926['include']?_[_0x5e63('0x1e')](_0x19926[_0x5e63('0x1d')],function(_0x160841){return{'model':db[_0x160841['model']],'as':_0x160841['as'],'attributes':_0x160841[_0x5e63('0x1b')],'include':_0x160841[_0x5e63('0x1d')]?_[_0x5e63('0x1e')](_0x160841[_0x5e63('0x1d')],function(_0x27b719){return{'model':db[_0x27b719[_0x5e63('0x1f')]],'as':_0x27b719['as'],'attributes':_0x27b719['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x251e0d){logger[_0x5e63('0xc')](_0x5e63('0x20'),_0x268400);logger[_0x5e63('0x23')](_0x5e63('0x20'),_0x268400,JSON[_0x5e63('0x10')](_0x251e0d));_0x243600(_0x251e0d);})['catch'](function(_0x8574b5){logger[_0x5e63('0x11')](_0x5e63('0x20'),_0x8574b5[_0x5e63('0x13')],_0x268400);_0x331831(_0x1fed81['error'](0x1f4,_0x8574b5['message']));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 7222302..5dec92f 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 _0x9957=['/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields'];(function(_0x3a772b,_0x2db88d){var _0x1166bc=function(_0x52dc04){while(--_0x52dc04){_0x3a772b['push'](_0x3a772b['shift']());}};_0x1166bc(++_0x2db88d);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'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/fields',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/descriptions',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/tags',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x17')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller['destroy']);module[_0x7995('0x1a')]=router; \ No newline at end of file +var _0x9c44=['destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intDeskConfiguration.controller','isAuthenticated','index','get','/:id','/:id/fields','getFields','getSubjects','/:id/descriptions','/:id/tags','post','setTags','put','update'];(function(_0xf99f17,_0x535471){var _0x316a2b=function(_0x2f6fb4){while(--_0x2f6fb4){_0xf99f17['push'](_0xf99f17['shift']());}};_0x316a2b(++_0x535471);}(_0x9c44,0x178));var _0x49c4=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x9c44[_0x1d9aa0];return _0x226868;};'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');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['show']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['get']('/:id/subjects',auth[_0x49c4('0x7')](),controller[_0x49c4('0xd')]);router['get'](_0x49c4('0xe'),auth[_0x49c4('0x7')](),controller['getDescriptions']);router['get'](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller['getTags']);router[_0x49c4('0x10')]('/',auth[_0x49c4('0x7')](),controller['create']);router[_0x49c4('0x10')](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x11')]);router[_0x49c4('0x12')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x13')]);router['delete'](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);module[_0x49c4('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index e7c0c72..92f8bd6 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 _0x142f=['sequelize','exports','STRING'];(function(_0xcf3588,_0x5dd76d){var _0x3c8a3d=function(_0x1ca690){while(--_0x1ca690){_0xcf3588['push'](_0xcf3588['shift']());}};_0x3c8a3d(++_0x5dd76d);}(_0x142f,0x171));var _0xf142=function(_0x5ddf64,_0x40f8fb){_0x5ddf64=_0x5ddf64-0x0;var _0xad0189=_0x142f[_0x5ddf64];return _0xad0189;};'use strict';var Sequelize=require(_0xf142('0x0'));module[_0xf142('0x1')]={'name':{'type':Sequelize[_0xf142('0x2')]},'description':{'type':Sequelize[_0xf142('0x2')]}}; \ No newline at end of file +var _0x50fa=['STRING','sequelize','exports'];(function(_0xf70116,_0x2d92de){var _0x412da4=function(_0x599c35){while(--_0x599c35){_0xf70116['push'](_0xf70116['shift']());}};_0x412da4(++_0x2d92de);}(_0x50fa,0x18a));var _0xa50f=function(_0x565e4a,_0x5a5f5d){_0x565e4a=_0x565e4a-0x0;var _0x2eb684=_0x50fa[_0x565e4a];return _0x2eb684;};'use strict';var Sequelize=require(_0xa50f('0x0'));module[_0xa50f('0x1')]={'name':{'type':Sequelize[_0xa50f('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 94ecd22..8770436 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 _0xeca6=['fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','DeskConfiguration','count','includeAll','include','findAll','rows','show','params','find','catch','create','body','update','getFields','findOne','getSubjects','DeskField','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','set','Content-Range','reject','then','destroy','error','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes'];(function(_0x219935,_0x5b7d02){var _0x130409=function(_0x56409e){while(--_0x56409e){_0x219935['push'](_0x219935['shift']());}};_0x130409(++_0x5b7d02);}(_0xeca6,0x113));var _0x6eca=function(_0x1f1587,_0x48e4d7){_0x1f1587=_0x1f1587-0x0;var _0x504ca4=_0xeca6[_0x1f1587];return _0x504ca4;};'use strict';var emlformat=require(_0x6eca('0x0'));var rimraf=require(_0x6eca('0x1'));var zipdir=require(_0x6eca('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6eca('0x3'));var BPromise=require(_0x6eca('0x4'));var Mustache=require(_0x6eca('0x5'));var util=require(_0x6eca('0x6'));var path=require(_0x6eca('0x7'));var sox=require(_0x6eca('0x8'));var csv=require(_0x6eca('0x9'));var ejs=require(_0x6eca('0xa'));var fs=require('fs');var fs_extra=require(_0x6eca('0xb'));var _=require(_0x6eca('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6eca('0x9'));var querystring=require(_0x6eca('0xd'));var Papa=require('papaparse');var Redis=require(_0x6eca('0xe'));var authService=require(_0x6eca('0xf'));var qs=require(_0x6eca('0x10'));var as=require(_0x6eca('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6eca('0x12'))(_0x6eca('0x13'));var utils=require(_0x6eca('0x14'));var config=require(_0x6eca('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6eca('0x16'))['db'];function respondWithStatusCode(_0x1c4aea,_0x28a11b){_0x28a11b=_0x28a11b||0xcc;return function(_0x466f22){if(_0x466f22){return _0x1c4aea[_0x6eca('0x17')](_0x28a11b);}return _0x1c4aea[_0x6eca('0x18')](_0x28a11b)[_0x6eca('0x19')]();};}function respondWithResult(_0x5228b4,_0x586abf){_0x586abf=_0x586abf||0xc8;return function(_0x4b0423){if(_0x4b0423){return _0x5228b4['status'](_0x586abf)[_0x6eca('0x1a')](_0x4b0423);}};}function respondWithFilteredResult(_0x415bca,_0x5dccf3){return function(_0x3e4e00){if(_0x3e4e00){var _0x4c4935=typeof _0x5dccf3[_0x6eca('0x1b')]==='undefined'&&typeof _0x5dccf3[_0x6eca('0x1c')]===_0x6eca('0x1d');var _0x1caf07=_0x3e4e00['count'];var _0x276329=_0x4c4935?0x0:_0x5dccf3[_0x6eca('0x1b')];var _0x339256=_0x4c4935?_0x3e4e00['count']:_0x5dccf3[_0x6eca('0x1b')]+_0x5dccf3[_0x6eca('0x1c')];var _0x4209b7;if(_0x339256>=_0x1caf07){_0x339256=_0x1caf07;_0x4209b7=0xc8;}else{_0x4209b7=0xce;}_0x415bca['status'](_0x4209b7);return _0x415bca[_0x6eca('0x1e')](_0x6eca('0x1f'),_0x276329+'-'+_0x339256+'/'+_0x1caf07)[_0x6eca('0x1a')](_0x3e4e00);}return null;};}function patchUpdates(_0x36228f){return function(_0x48823e){try{jsonpatch['apply'](_0x48823e,_0x36228f,!![]);}catch(_0x284387){return BPromise[_0x6eca('0x20')](_0x284387);}return _0x48823e['save']();};}function saveUpdates(_0x5de709,_0x26e9c7){return function(_0x55ca59){if(_0x55ca59){return _0x55ca59['update'](_0x5de709)[_0x6eca('0x21')](function(_0x37020c){return _0x37020c;});}return null;};}function removeEntity(_0x361b55,_0x11b0c9){return function(_0xadffbf){if(_0xadffbf){return _0xadffbf[_0x6eca('0x22')]()[_0x6eca('0x21')](function(){_0x361b55[_0x6eca('0x18')](0xcc)[_0x6eca('0x19')]();});}};}function handleEntityNotFound(_0x3b44fb,_0x478258){return function(_0x1b0bc4){if(!_0x1b0bc4){_0x3b44fb[_0x6eca('0x17')](0x194);}return _0x1b0bc4;};}function handleError(_0x4a5cfb,_0x39cc95){_0x39cc95=_0x39cc95||0x1f4;return function(_0x127693){logger[_0x6eca('0x23')](_0x127693['stack']);if(_0x127693[_0x6eca('0x24')]){delete _0x127693[_0x6eca('0x24')];}_0x4a5cfb[_0x6eca('0x18')](_0x39cc95)[_0x6eca('0x25')](_0x127693);};}exports[_0x6eca('0x26')]=function(_0x2c1136,_0x229ebc){var _0x5516dd={},_0x38b5ad={},_0x4e64d0={'count':0x0,'rows':[]};var _0x166820=_[_0x6eca('0x27')](db['DeskConfiguration'][_0x6eca('0x28')],function(_0x31c22c){return{'name':_0x31c22c[_0x6eca('0x29')],'type':_0x31c22c['type'][_0x6eca('0x2a')]};});_0x38b5ad[_0x6eca('0x2b')]=_[_0x6eca('0x27')](_0x166820,_0x6eca('0x24'));_0x38b5ad[_0x6eca('0x2c')]=_[_0x6eca('0x2d')](_0x2c1136[_0x6eca('0x2c')]);_0x38b5ad[_0x6eca('0x2e')]=_[_0x6eca('0x2f')](_0x38b5ad[_0x6eca('0x2b')],_0x38b5ad[_0x6eca('0x2c')]);_0x5516dd[_0x6eca('0x30')]=_['intersection'](_0x38b5ad[_0x6eca('0x2b')],qs['fields'](_0x2c1136[_0x6eca('0x2c')][_0x6eca('0x31')]));_0x5516dd[_0x6eca('0x30')]=_0x5516dd[_0x6eca('0x30')][_0x6eca('0x32')]?_0x5516dd[_0x6eca('0x30')]:_0x38b5ad['model'];if(!_0x2c1136[_0x6eca('0x2c')][_0x6eca('0x33')](_0x6eca('0x34'))){_0x5516dd[_0x6eca('0x1c')]=qs[_0x6eca('0x1c')](_0x2c1136['query'][_0x6eca('0x1c')]);_0x5516dd[_0x6eca('0x1b')]=qs[_0x6eca('0x1b')](_0x2c1136[_0x6eca('0x2c')][_0x6eca('0x1b')]);}_0x5516dd[_0x6eca('0x35')]=qs[_0x6eca('0x36')](_0x2c1136[_0x6eca('0x2c')][_0x6eca('0x36')]);_0x5516dd[_0x6eca('0x37')]=qs['filters'](_[_0x6eca('0x38')](_0x2c1136['query'],_0x38b5ad[_0x6eca('0x2e')]),_0x166820);if(_0x2c1136[_0x6eca('0x2c')][_0x6eca('0x39')]){_0x5516dd[_0x6eca('0x37')]=_[_0x6eca('0x3a')](_0x5516dd[_0x6eca('0x37')],{'$or':_[_0x6eca('0x27')](_0x166820,function(_0x4acc38){if(_0x4acc38['type']!=='VIRTUAL'){var _0x4b5ec2={};_0x4b5ec2[_0x4acc38[_0x6eca('0x24')]]={'$like':'%'+_0x2c1136[_0x6eca('0x2c')][_0x6eca('0x39')]+'%'};return _0x4b5ec2;}})});}_0x5516dd=_[_0x6eca('0x3a')]({},_0x5516dd,_0x2c1136[_0x6eca('0x3b')]);var _0x13838c={'where':_0x5516dd[_0x6eca('0x37')]};return db[_0x6eca('0x3c')]['count'](_0x13838c)['then'](function(_0x2d7d1b){_0x4e64d0[_0x6eca('0x3d')]=_0x2d7d1b;if(_0x2c1136[_0x6eca('0x2c')][_0x6eca('0x3e')]){_0x5516dd[_0x6eca('0x3f')]=[{'all':!![]}];}return db[_0x6eca('0x3c')][_0x6eca('0x40')](_0x5516dd);})['then'](function(_0x2edf37){_0x4e64d0[_0x6eca('0x41')]=_0x2edf37;return _0x4e64d0;})['then'](respondWithFilteredResult(_0x229ebc,_0x5516dd))['catch'](handleError(_0x229ebc,null));};exports[_0x6eca('0x42')]=function(_0x399207,_0x1a4e91){var _0x33534d={'raw':![],'where':{'id':_0x399207[_0x6eca('0x43')]['id']}},_0x73ca70={};_0x73ca70[_0x6eca('0x2b')]=_[_0x6eca('0x2d')](db['DeskConfiguration']['rawAttributes']);_0x73ca70[_0x6eca('0x2c')]=_[_0x6eca('0x2d')](_0x399207[_0x6eca('0x2c')]);_0x73ca70[_0x6eca('0x2e')]=_[_0x6eca('0x2f')](_0x73ca70[_0x6eca('0x2b')],_0x73ca70[_0x6eca('0x2c')]);_0x33534d[_0x6eca('0x30')]=_[_0x6eca('0x2f')](_0x73ca70[_0x6eca('0x2b')],qs[_0x6eca('0x31')](_0x399207[_0x6eca('0x2c')]['fields']));_0x33534d[_0x6eca('0x30')]=_0x33534d[_0x6eca('0x30')]['length']?_0x33534d[_0x6eca('0x30')]:_0x73ca70['model'];if(_0x399207[_0x6eca('0x2c')][_0x6eca('0x3e')]){_0x33534d[_0x6eca('0x3f')]=[{'all':!![]}];}_0x33534d=_[_0x6eca('0x3a')]({},_0x33534d,_0x399207[_0x6eca('0x3b')]);return db[_0x6eca('0x3c')][_0x6eca('0x44')](_0x33534d)[_0x6eca('0x21')](handleEntityNotFound(_0x1a4e91,null))[_0x6eca('0x21')](respondWithResult(_0x1a4e91,null))[_0x6eca('0x45')](handleError(_0x1a4e91,null));};exports[_0x6eca('0x46')]=function(_0x14e4ee,_0x3d34c9){return db['DeskConfiguration'][_0x6eca('0x46')](_0x14e4ee[_0x6eca('0x47')],{})[_0x6eca('0x21')](respondWithResult(_0x3d34c9,0xc9))[_0x6eca('0x45')](handleError(_0x3d34c9,null));};exports[_0x6eca('0x48')]=function(_0xfbd5db,_0x34f279){if(_0xfbd5db[_0x6eca('0x47')]['id']){delete _0xfbd5db[_0x6eca('0x47')]['id'];}return db[_0x6eca('0x3c')][_0x6eca('0x44')]({'where':{'id':_0xfbd5db[_0x6eca('0x43')]['id']}})[_0x6eca('0x21')](handleEntityNotFound(_0x34f279,null))['then'](saveUpdates(_0xfbd5db['body'],null))[_0x6eca('0x21')](respondWithResult(_0x34f279,null))['catch'](handleError(_0x34f279,null));};exports[_0x6eca('0x22')]=function(_0x107c46,_0x2b097d){return db['DeskConfiguration']['find']({'where':{'id':_0x107c46['params']['id']}})[_0x6eca('0x21')](handleEntityNotFound(_0x2b097d,null))[_0x6eca('0x21')](removeEntity(_0x2b097d,null))['catch'](handleError(_0x2b097d,null));};exports[_0x6eca('0x49')]=function(_0x2eed12,_0x33a0cf,_0x3800c8){var _0x6a5ffd={};var _0x33790f={};var _0x17e30a;var _0x459415;return db[_0x6eca('0x3c')][_0x6eca('0x4a')]({'where':{'id':_0x2eed12['params']['id']}})[_0x6eca('0x21')](handleEntityNotFound(_0x33a0cf,null))[_0x6eca('0x21')](function(_0x67ba24){if(_0x67ba24){_0x17e30a=_0x67ba24;_0x33790f[_0x6eca('0x2b')]=_[_0x6eca('0x2d')](db['DeskField']['rawAttributes']);_0x33790f['query']=_[_0x6eca('0x2d')](_0x2eed12[_0x6eca('0x2c')]);_0x33790f[_0x6eca('0x2e')]=_[_0x6eca('0x2f')](_0x33790f[_0x6eca('0x2b')],_0x33790f[_0x6eca('0x2c')]);_0x6a5ffd[_0x6eca('0x30')]=_['intersection'](_0x33790f[_0x6eca('0x2b')],qs['fields'](_0x2eed12[_0x6eca('0x2c')][_0x6eca('0x31')]));_0x6a5ffd[_0x6eca('0x30')]=_0x6a5ffd['attributes'][_0x6eca('0x32')]?_0x6a5ffd[_0x6eca('0x30')]:_0x33790f['model'];_0x6a5ffd['order']=qs['sort'](_0x2eed12[_0x6eca('0x2c')]['sort']);_0x6a5ffd[_0x6eca('0x37')]=qs[_0x6eca('0x2e')](_[_0x6eca('0x38')](_0x2eed12['query'],_0x33790f[_0x6eca('0x2e')]));if(_0x2eed12[_0x6eca('0x2c')][_0x6eca('0x39')]){_0x6a5ffd[_0x6eca('0x37')]=_[_0x6eca('0x3a')](_0x6a5ffd[_0x6eca('0x37')],{'$or':_[_0x6eca('0x27')](_0x6a5ffd[_0x6eca('0x30')],function(_0x2c7ac7){var _0x318b32={};_0x318b32[_0x2c7ac7]={'$like':'%'+_0x2eed12[_0x6eca('0x2c')][_0x6eca('0x39')]+'%'};return _0x318b32;})});}_0x6a5ffd=_['merge']({},_0x6a5ffd,_0x2eed12['options']);return _0x17e30a['getFields'](_0x6a5ffd);}})[_0x6eca('0x21')](function(_0x436d91){if(_0x436d91){_0x459415=_0x436d91[_0x6eca('0x32')];if(!_0x2eed12[_0x6eca('0x2c')][_0x6eca('0x33')](_0x6eca('0x34'))){_0x6a5ffd[_0x6eca('0x1c')]=qs[_0x6eca('0x1c')](_0x2eed12['query'][_0x6eca('0x1c')]);_0x6a5ffd[_0x6eca('0x1b')]=qs['offset'](_0x2eed12[_0x6eca('0x2c')][_0x6eca('0x1b')]);}return _0x17e30a[_0x6eca('0x49')](_0x6a5ffd);}})[_0x6eca('0x21')](function(_0x2aa835){if(_0x2aa835){return _0x2aa835?{'count':_0x459415,'rows':_0x2aa835}:null;}})[_0x6eca('0x21')](respondWithResult(_0x33a0cf,null))[_0x6eca('0x45')](handleError(_0x33a0cf,null));};exports[_0x6eca('0x4b')]=function(_0x24feb9,_0x1cc32d,_0x1d9d8e){var _0x3d5d94={};var _0x47572a={};var _0x1bec11;var _0x5a94c7;return db[_0x6eca('0x3c')][_0x6eca('0x4a')]({'where':{'id':_0x24feb9[_0x6eca('0x43')]['id']}})[_0x6eca('0x21')](handleEntityNotFound(_0x1cc32d,null))[_0x6eca('0x21')](function(_0x3779d1){if(_0x3779d1){_0x1bec11=_0x3779d1;_0x47572a['model']=_[_0x6eca('0x2d')](db[_0x6eca('0x4c')]['rawAttributes']);_0x47572a[_0x6eca('0x2c')]=_['keys'](_0x24feb9[_0x6eca('0x2c')]);_0x47572a[_0x6eca('0x2e')]=_[_0x6eca('0x2f')](_0x47572a[_0x6eca('0x2b')],_0x47572a[_0x6eca('0x2c')]);_0x3d5d94[_0x6eca('0x30')]=_[_0x6eca('0x2f')](_0x47572a[_0x6eca('0x2b')],qs[_0x6eca('0x31')](_0x24feb9[_0x6eca('0x2c')][_0x6eca('0x31')]));_0x3d5d94['attributes']=_0x3d5d94[_0x6eca('0x30')][_0x6eca('0x32')]?_0x3d5d94[_0x6eca('0x30')]:_0x47572a[_0x6eca('0x2b')];_0x3d5d94[_0x6eca('0x35')]=qs['sort'](_0x24feb9[_0x6eca('0x2c')]['sort']);_0x3d5d94['where']=qs[_0x6eca('0x2e')](_['pick'](_0x24feb9[_0x6eca('0x2c')],_0x47572a[_0x6eca('0x2e')]));if(_0x24feb9['query'][_0x6eca('0x39')]){_0x3d5d94[_0x6eca('0x37')]=_[_0x6eca('0x3a')](_0x3d5d94[_0x6eca('0x37')],{'$or':_['map'](_0x3d5d94[_0x6eca('0x30')],function(_0x569155){var _0x5b07b5={};_0x5b07b5[_0x569155]={'$like':'%'+_0x24feb9[_0x6eca('0x2c')][_0x6eca('0x39')]+'%'};return _0x5b07b5;})});}_0x3d5d94=_['merge']({},_0x3d5d94,_0x24feb9[_0x6eca('0x3b')]);return _0x1bec11[_0x6eca('0x4b')](_0x3d5d94);}})['then'](function(_0x2fd6fb){if(_0x2fd6fb){_0x5a94c7=_0x2fd6fb[_0x6eca('0x32')];if(!_0x24feb9[_0x6eca('0x2c')]['hasOwnProperty']('nolimit')){_0x3d5d94['limit']=qs[_0x6eca('0x1c')](_0x24feb9['query'][_0x6eca('0x1c')]);_0x3d5d94[_0x6eca('0x1b')]=qs[_0x6eca('0x1b')](_0x24feb9[_0x6eca('0x2c')][_0x6eca('0x1b')]);}return _0x1bec11['getSubjects'](_0x3d5d94);}})[_0x6eca('0x21')](function(_0x3780e1){if(_0x3780e1){return _0x3780e1?{'count':_0x5a94c7,'rows':_0x3780e1}:null;}})[_0x6eca('0x21')](respondWithResult(_0x1cc32d,null))[_0x6eca('0x45')](handleError(_0x1cc32d,null));};exports['getDescriptions']=function(_0x83ff6,_0x45c3c4,_0x5d51bd){var _0x165cea={};var _0x346a7c={};var _0x40c6a1;var _0x5d4571;return db['DeskConfiguration'][_0x6eca('0x4a')]({'where':{'id':_0x83ff6[_0x6eca('0x43')]['id']}})[_0x6eca('0x21')](handleEntityNotFound(_0x45c3c4,null))['then'](function(_0x123215){if(_0x123215){_0x40c6a1=_0x123215;_0x346a7c[_0x6eca('0x2b')]=_[_0x6eca('0x2d')](db[_0x6eca('0x4c')][_0x6eca('0x28')]);_0x346a7c[_0x6eca('0x2c')]=_[_0x6eca('0x2d')](_0x83ff6[_0x6eca('0x2c')]);_0x346a7c[_0x6eca('0x2e')]=_[_0x6eca('0x2f')](_0x346a7c[_0x6eca('0x2b')],_0x346a7c['query']);_0x165cea[_0x6eca('0x30')]=_[_0x6eca('0x2f')](_0x346a7c[_0x6eca('0x2b')],qs[_0x6eca('0x31')](_0x83ff6[_0x6eca('0x2c')]['fields']));_0x165cea[_0x6eca('0x30')]=_0x165cea[_0x6eca('0x30')][_0x6eca('0x32')]?_0x165cea[_0x6eca('0x30')]:_0x346a7c[_0x6eca('0x2b')];_0x165cea[_0x6eca('0x35')]=qs[_0x6eca('0x36')](_0x83ff6[_0x6eca('0x2c')][_0x6eca('0x36')]);_0x165cea[_0x6eca('0x37')]=qs['filters'](_['pick'](_0x83ff6[_0x6eca('0x2c')],_0x346a7c[_0x6eca('0x2e')]));if(_0x83ff6[_0x6eca('0x2c')][_0x6eca('0x39')]){_0x165cea[_0x6eca('0x37')]=_['merge'](_0x165cea[_0x6eca('0x37')],{'$or':_['map'](_0x165cea[_0x6eca('0x30')],function(_0x2dd9b1){var _0x3a26b3={};_0x3a26b3[_0x2dd9b1]={'$like':'%'+_0x83ff6[_0x6eca('0x2c')][_0x6eca('0x39')]+'%'};return _0x3a26b3;})});}_0x165cea=_[_0x6eca('0x3a')]({},_0x165cea,_0x83ff6[_0x6eca('0x3b')]);return _0x40c6a1['getDescriptions'](_0x165cea);}})[_0x6eca('0x21')](function(_0x5e11ed){if(_0x5e11ed){_0x5d4571=_0x5e11ed[_0x6eca('0x32')];if(!_0x83ff6[_0x6eca('0x2c')][_0x6eca('0x33')](_0x6eca('0x34'))){_0x165cea['limit']=qs[_0x6eca('0x1c')](_0x83ff6[_0x6eca('0x2c')][_0x6eca('0x1c')]);_0x165cea[_0x6eca('0x1b')]=qs[_0x6eca('0x1b')](_0x83ff6[_0x6eca('0x2c')][_0x6eca('0x1b')]);}return _0x40c6a1[_0x6eca('0x4d')](_0x165cea);}})[_0x6eca('0x21')](function(_0xdb006f){if(_0xdb006f){return _0xdb006f?{'count':_0x5d4571,'rows':_0xdb006f}:null;}})['then'](respondWithResult(_0x45c3c4,null))[_0x6eca('0x45')](handleError(_0x45c3c4,null));};exports[_0x6eca('0x4e')]=function(_0x28cd53,_0x498993,_0xc0dd9){var _0x16dfa2={};var _0x18c3fa={};var _0x344656;var _0x44ae13;return db[_0x6eca('0x3c')][_0x6eca('0x4a')]({'where':{'id':_0x28cd53[_0x6eca('0x43')]['id']}})[_0x6eca('0x21')](handleEntityNotFound(_0x498993,null))[_0x6eca('0x21')](function(_0x2afd07){if(_0x2afd07){_0x344656=_0x2afd07;_0x18c3fa[_0x6eca('0x2b')]=_[_0x6eca('0x2d')](db[_0x6eca('0x4f')][_0x6eca('0x28')]);_0x18c3fa[_0x6eca('0x2c')]=_['keys'](_0x28cd53['query']);_0x18c3fa[_0x6eca('0x2e')]=_['intersection'](_0x18c3fa[_0x6eca('0x2b')],_0x18c3fa[_0x6eca('0x2c')]);_0x16dfa2[_0x6eca('0x30')]=_['intersection'](_0x18c3fa[_0x6eca('0x2b')],qs['fields'](_0x28cd53[_0x6eca('0x2c')][_0x6eca('0x31')]));_0x16dfa2[_0x6eca('0x30')]=_0x16dfa2['attributes']['length']?_0x16dfa2[_0x6eca('0x30')]:_0x18c3fa['model'];_0x16dfa2[_0x6eca('0x35')]=qs[_0x6eca('0x36')](_0x28cd53[_0x6eca('0x2c')]['sort']);_0x16dfa2[_0x6eca('0x37')]=qs[_0x6eca('0x2e')](_[_0x6eca('0x38')](_0x28cd53[_0x6eca('0x2c')],_0x18c3fa[_0x6eca('0x2e')]));if(_0x28cd53['query'][_0x6eca('0x39')]){_0x16dfa2[_0x6eca('0x37')]=_[_0x6eca('0x3a')](_0x16dfa2[_0x6eca('0x37')],{'$or':_[_0x6eca('0x27')](_0x16dfa2[_0x6eca('0x30')],function(_0x1ac8c9){var _0x41b666={};_0x41b666[_0x1ac8c9]={'$like':'%'+_0x28cd53[_0x6eca('0x2c')]['filter']+'%'};return _0x41b666;})});}_0x16dfa2=_[_0x6eca('0x3a')]({},_0x16dfa2,_0x28cd53[_0x6eca('0x3b')]);return _0x344656[_0x6eca('0x4e')](_0x16dfa2);}})[_0x6eca('0x21')](function(_0x189ff5){if(_0x189ff5){_0x44ae13=_0x189ff5[_0x6eca('0x32')];if(!_0x28cd53[_0x6eca('0x2c')][_0x6eca('0x33')](_0x6eca('0x34'))){_0x16dfa2[_0x6eca('0x1c')]=qs[_0x6eca('0x1c')](_0x28cd53[_0x6eca('0x2c')][_0x6eca('0x1c')]);_0x16dfa2['offset']=qs['offset'](_0x28cd53['query']['offset']);}return _0x344656[_0x6eca('0x4e')](_0x16dfa2);}})[_0x6eca('0x21')](function(_0x5393d3){if(_0x5393d3){return _0x5393d3?{'count':_0x44ae13,'rows':_0x5393d3}:null;}})[_0x6eca('0x21')](respondWithResult(_0x498993,null))[_0x6eca('0x45')](handleError(_0x498993,null));};exports[_0x6eca('0x50')]=function(_0x40b31e,_0x829d86,_0x318075){if(_0x40b31e['body']['id']){delete _0x40b31e[_0x6eca('0x47')]['id'];}return db[_0x6eca('0x3c')]['findOne']({'where':{'id':_0x40b31e[_0x6eca('0x43')]['id']}})[_0x6eca('0x21')](handleEntityNotFound(_0x829d86,null))['then'](function(_0x55c846){if(_0x55c846){return _0x55c846['setTags'](_0x40b31e[_0x6eca('0x47')]['ids']||[]);}return null;})[_0x6eca('0x21')](respondWithResult(_0x829d86,null))[_0x6eca('0x45')](handleError(_0x829d86,null));}; \ No newline at end of file +var _0x8f99=['attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','filter','options','include','findAll','rows','catch','params','keys','includeAll','find','create','body','findOne','DeskField','length','getFields','getSubjects','getTags','Tag','setTags','ids','eml-format','zip-dir','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','reject','update','destroy','then','error','stack','name','send','DeskConfiguration','rawAttributes','fieldName','key','model','query','filters','intersection'];(function(_0x42a11c,_0x3836c8){var _0x267f47=function(_0x556018){while(--_0x556018){_0x42a11c['push'](_0x42a11c['shift']());}};_0x267f47(++_0x3836c8);}(_0x8f99,0x15c));var _0x98f9=function(_0x2d5456,_0x1aad4c){_0x2d5456=_0x2d5456-0x0;var _0x372523=_0x8f99[_0x2d5456];return _0x372523;};'use strict';var emlformat=require(_0x98f9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x98f9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x98f9('0x2'));var moment=require('moment');var BPromise=require(_0x98f9('0x3'));var Mustache=require(_0x98f9('0x4'));var util=require(_0x98f9('0x5'));var path=require('path');var sox=require(_0x98f9('0x6'));var csv=require('to-csv');var ejs=require(_0x98f9('0x7'));var fs=require('fs');var fs_extra=require(_0x98f9('0x8'));var _=require(_0x98f9('0x9'));var squel=require(_0x98f9('0xa'));var crypto=require('crypto');var jsforce=require(_0x98f9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x98f9('0xc'));var querystring=require(_0x98f9('0xd'));var Papa=require(_0x98f9('0xe'));var Redis=require(_0x98f9('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x98f9('0x10'));var as=require(_0x98f9('0x11'));var hardwareService=require(_0x98f9('0x12'));var logger=require('../../config/logger')(_0x98f9('0x13'));var utils=require(_0x98f9('0x14'));var config=require(_0x98f9('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x22c215,_0x25339b){_0x25339b=_0x25339b||0xcc;return function(_0x3e2f9d){if(_0x3e2f9d){return _0x22c215[_0x98f9('0x16')](_0x25339b);}return _0x22c215[_0x98f9('0x17')](_0x25339b)[_0x98f9('0x18')]();};}function respondWithResult(_0x332423,_0x584776){_0x584776=_0x584776||0xc8;return function(_0x242582){if(_0x242582){return _0x332423['status'](_0x584776)['json'](_0x242582);}};}function respondWithFilteredResult(_0x455847,_0x22b0bf){return function(_0x4f22b7){if(_0x4f22b7){var _0x5334b5=typeof _0x22b0bf[_0x98f9('0x19')]==='undefined'&&typeof _0x22b0bf[_0x98f9('0x1a')]===_0x98f9('0x1b');var _0x480c67=_0x4f22b7[_0x98f9('0x1c')];var _0x3218dd=_0x5334b5?0x0:_0x22b0bf[_0x98f9('0x19')];var _0x1af8f9=_0x5334b5?_0x4f22b7['count']:_0x22b0bf[_0x98f9('0x19')]+_0x22b0bf[_0x98f9('0x1a')];var _0x31832d;if(_0x1af8f9>=_0x480c67){_0x1af8f9=_0x480c67;_0x31832d=0xc8;}else{_0x31832d=0xce;}_0x455847[_0x98f9('0x17')](_0x31832d);return _0x455847['set'](_0x98f9('0x1d'),_0x3218dd+'-'+_0x1af8f9+'/'+_0x480c67)[_0x98f9('0x1e')](_0x4f22b7);}return null;};}function patchUpdates(_0x44670c){return function(_0x451bdf){try{jsonpatch['apply'](_0x451bdf,_0x44670c,!![]);}catch(_0x46260f){return BPromise[_0x98f9('0x1f')](_0x46260f);}return _0x451bdf['save']();};}function saveUpdates(_0x37c6d4,_0x12c7e0){return function(_0x420f0b){if(_0x420f0b){return _0x420f0b[_0x98f9('0x20')](_0x37c6d4)['then'](function(_0x1e0827){return _0x1e0827;});}return null;};}function removeEntity(_0x2d808e,_0x37f677){return function(_0x11c7a6){if(_0x11c7a6){return _0x11c7a6[_0x98f9('0x21')]()[_0x98f9('0x22')](function(){_0x2d808e[_0x98f9('0x17')](0xcc)[_0x98f9('0x18')]();});}};}function handleEntityNotFound(_0x32b87d,_0x12525c){return function(_0x481e93){if(!_0x481e93){_0x32b87d['sendStatus'](0x194);}return _0x481e93;};}function handleError(_0x23bf2c,_0x43df5c){_0x43df5c=_0x43df5c||0x1f4;return function(_0x4634b7){logger[_0x98f9('0x23')](_0x4634b7[_0x98f9('0x24')]);if(_0x4634b7[_0x98f9('0x25')]){delete _0x4634b7['name'];}_0x23bf2c[_0x98f9('0x17')](_0x43df5c)[_0x98f9('0x26')](_0x4634b7);};}exports['index']=function(_0x4de24e,_0x1006d0){var _0x12b265={},_0x1dd016={},_0x210391={'count':0x0,'rows':[]};var _0x36c93a=_['map'](db[_0x98f9('0x27')][_0x98f9('0x28')],function(_0x323497){return{'name':_0x323497[_0x98f9('0x29')],'type':_0x323497['type'][_0x98f9('0x2a')]};});_0x1dd016[_0x98f9('0x2b')]=_['map'](_0x36c93a,_0x98f9('0x25'));_0x1dd016[_0x98f9('0x2c')]=_['keys'](_0x4de24e['query']);_0x1dd016[_0x98f9('0x2d')]=_[_0x98f9('0x2e')](_0x1dd016[_0x98f9('0x2b')],_0x1dd016[_0x98f9('0x2c')]);_0x12b265[_0x98f9('0x2f')]=_[_0x98f9('0x2e')](_0x1dd016[_0x98f9('0x2b')],qs[_0x98f9('0x30')](_0x4de24e[_0x98f9('0x2c')][_0x98f9('0x30')]));_0x12b265[_0x98f9('0x2f')]=_0x12b265[_0x98f9('0x2f')]['length']?_0x12b265['attributes']:_0x1dd016[_0x98f9('0x2b')];if(!_0x4de24e[_0x98f9('0x2c')][_0x98f9('0x31')](_0x98f9('0x32'))){_0x12b265['limit']=qs[_0x98f9('0x1a')](_0x4de24e[_0x98f9('0x2c')]['limit']);_0x12b265['offset']=qs[_0x98f9('0x19')](_0x4de24e['query'][_0x98f9('0x19')]);}_0x12b265[_0x98f9('0x33')]=qs[_0x98f9('0x34')](_0x4de24e[_0x98f9('0x2c')]['sort']);_0x12b265[_0x98f9('0x35')]=qs['filters'](_[_0x98f9('0x36')](_0x4de24e['query'],_0x1dd016[_0x98f9('0x2d')]),_0x36c93a);if(_0x4de24e[_0x98f9('0x2c')]['filter']){_0x12b265['where']=_[_0x98f9('0x37')](_0x12b265[_0x98f9('0x35')],{'$or':_[_0x98f9('0x38')](_0x36c93a,function(_0x241630){if(_0x241630[_0x98f9('0x39')]!=='VIRTUAL'){var _0x663865={};_0x663865[_0x241630[_0x98f9('0x25')]]={'$like':'%'+_0x4de24e[_0x98f9('0x2c')][_0x98f9('0x3a')]+'%'};return _0x663865;}})});}_0x12b265=_['merge']({},_0x12b265,_0x4de24e[_0x98f9('0x3b')]);var _0x19d916={'where':_0x12b265[_0x98f9('0x35')]};return db['DeskConfiguration'][_0x98f9('0x1c')](_0x19d916)[_0x98f9('0x22')](function(_0x27561f){_0x210391[_0x98f9('0x1c')]=_0x27561f;if(_0x4de24e[_0x98f9('0x2c')]['includeAll']){_0x12b265[_0x98f9('0x3c')]=[{'all':!![]}];}return db['DeskConfiguration'][_0x98f9('0x3d')](_0x12b265);})[_0x98f9('0x22')](function(_0x3cb57d){_0x210391[_0x98f9('0x3e')]=_0x3cb57d;return _0x210391;})[_0x98f9('0x22')](respondWithFilteredResult(_0x1006d0,_0x12b265))[_0x98f9('0x3f')](handleError(_0x1006d0,null));};exports['show']=function(_0xe35756,_0x3de0d4){var _0x65488e={'raw':![],'where':{'id':_0xe35756[_0x98f9('0x40')]['id']}},_0x2a0e08={};_0x2a0e08[_0x98f9('0x2b')]=_[_0x98f9('0x41')](db[_0x98f9('0x27')][_0x98f9('0x28')]);_0x2a0e08[_0x98f9('0x2c')]=_['keys'](_0xe35756[_0x98f9('0x2c')]);_0x2a0e08[_0x98f9('0x2d')]=_[_0x98f9('0x2e')](_0x2a0e08[_0x98f9('0x2b')],_0x2a0e08['query']);_0x65488e['attributes']=_[_0x98f9('0x2e')](_0x2a0e08['model'],qs[_0x98f9('0x30')](_0xe35756['query'][_0x98f9('0x30')]));_0x65488e[_0x98f9('0x2f')]=_0x65488e[_0x98f9('0x2f')]['length']?_0x65488e['attributes']:_0x2a0e08[_0x98f9('0x2b')];if(_0xe35756[_0x98f9('0x2c')][_0x98f9('0x42')]){_0x65488e[_0x98f9('0x3c')]=[{'all':!![]}];}_0x65488e=_['merge']({},_0x65488e,_0xe35756[_0x98f9('0x3b')]);return db[_0x98f9('0x27')][_0x98f9('0x43')](_0x65488e)['then'](handleEntityNotFound(_0x3de0d4,null))[_0x98f9('0x22')](respondWithResult(_0x3de0d4,null))['catch'](handleError(_0x3de0d4,null));};exports['create']=function(_0x4b920f,_0x334b7d){return db['DeskConfiguration'][_0x98f9('0x44')](_0x4b920f['body'],{})['then'](respondWithResult(_0x334b7d,0xc9))['catch'](handleError(_0x334b7d,null));};exports[_0x98f9('0x20')]=function(_0x1f3fa1,_0x408c0a){if(_0x1f3fa1['body']['id']){delete _0x1f3fa1[_0x98f9('0x45')]['id'];}return db[_0x98f9('0x27')]['find']({'where':{'id':_0x1f3fa1[_0x98f9('0x40')]['id']}})['then'](handleEntityNotFound(_0x408c0a,null))[_0x98f9('0x22')](saveUpdates(_0x1f3fa1['body'],null))[_0x98f9('0x22')](respondWithResult(_0x408c0a,null))[_0x98f9('0x3f')](handleError(_0x408c0a,null));};exports[_0x98f9('0x21')]=function(_0x522315,_0x359486){return db[_0x98f9('0x27')]['find']({'where':{'id':_0x522315['params']['id']}})[_0x98f9('0x22')](handleEntityNotFound(_0x359486,null))[_0x98f9('0x22')](removeEntity(_0x359486,null))['catch'](handleError(_0x359486,null));};exports['getFields']=function(_0x237f4d,_0x5a7c38,_0x4b1c7c){var _0x280552={};var _0x549efa={};var _0x10a99c;var _0x468525;return db[_0x98f9('0x27')][_0x98f9('0x46')]({'where':{'id':_0x237f4d[_0x98f9('0x40')]['id']}})[_0x98f9('0x22')](handleEntityNotFound(_0x5a7c38,null))[_0x98f9('0x22')](function(_0x40485f){if(_0x40485f){_0x10a99c=_0x40485f;_0x549efa[_0x98f9('0x2b')]=_[_0x98f9('0x41')](db[_0x98f9('0x47')][_0x98f9('0x28')]);_0x549efa[_0x98f9('0x2c')]=_[_0x98f9('0x41')](_0x237f4d[_0x98f9('0x2c')]);_0x549efa[_0x98f9('0x2d')]=_['intersection'](_0x549efa[_0x98f9('0x2b')],_0x549efa[_0x98f9('0x2c')]);_0x280552[_0x98f9('0x2f')]=_[_0x98f9('0x2e')](_0x549efa[_0x98f9('0x2b')],qs[_0x98f9('0x30')](_0x237f4d['query'][_0x98f9('0x30')]));_0x280552[_0x98f9('0x2f')]=_0x280552[_0x98f9('0x2f')][_0x98f9('0x48')]?_0x280552[_0x98f9('0x2f')]:_0x549efa[_0x98f9('0x2b')];_0x280552[_0x98f9('0x33')]=qs[_0x98f9('0x34')](_0x237f4d[_0x98f9('0x2c')][_0x98f9('0x34')]);_0x280552[_0x98f9('0x35')]=qs[_0x98f9('0x2d')](_['pick'](_0x237f4d[_0x98f9('0x2c')],_0x549efa[_0x98f9('0x2d')]));if(_0x237f4d[_0x98f9('0x2c')]['filter']){_0x280552[_0x98f9('0x35')]=_['merge'](_0x280552['where'],{'$or':_[_0x98f9('0x38')](_0x280552[_0x98f9('0x2f')],function(_0x5ef8dd){var _0x14fa95={};_0x14fa95[_0x5ef8dd]={'$like':'%'+_0x237f4d[_0x98f9('0x2c')][_0x98f9('0x3a')]+'%'};return _0x14fa95;})});}_0x280552=_[_0x98f9('0x37')]({},_0x280552,_0x237f4d[_0x98f9('0x3b')]);return _0x10a99c[_0x98f9('0x49')](_0x280552);}})[_0x98f9('0x22')](function(_0x3a6270){if(_0x3a6270){_0x468525=_0x3a6270[_0x98f9('0x48')];if(!_0x237f4d[_0x98f9('0x2c')][_0x98f9('0x31')](_0x98f9('0x32'))){_0x280552[_0x98f9('0x1a')]=qs[_0x98f9('0x1a')](_0x237f4d['query'][_0x98f9('0x1a')]);_0x280552['offset']=qs[_0x98f9('0x19')](_0x237f4d[_0x98f9('0x2c')]['offset']);}return _0x10a99c['getFields'](_0x280552);}})[_0x98f9('0x22')](function(_0x214494){if(_0x214494){return _0x214494?{'count':_0x468525,'rows':_0x214494}:null;}})['then'](respondWithResult(_0x5a7c38,null))[_0x98f9('0x3f')](handleError(_0x5a7c38,null));};exports[_0x98f9('0x4a')]=function(_0x4c9976,_0x43bbe8,_0x6297ff){var _0x3d5b77={};var _0x5513e9={};var _0x59ad47;var _0x83eba6;return db[_0x98f9('0x27')]['findOne']({'where':{'id':_0x4c9976[_0x98f9('0x40')]['id']}})[_0x98f9('0x22')](handleEntityNotFound(_0x43bbe8,null))[_0x98f9('0x22')](function(_0x2d83fb){if(_0x2d83fb){_0x59ad47=_0x2d83fb;_0x5513e9[_0x98f9('0x2b')]=_[_0x98f9('0x41')](db['DeskField']['rawAttributes']);_0x5513e9[_0x98f9('0x2c')]=_['keys'](_0x4c9976[_0x98f9('0x2c')]);_0x5513e9[_0x98f9('0x2d')]=_[_0x98f9('0x2e')](_0x5513e9[_0x98f9('0x2b')],_0x5513e9['query']);_0x3d5b77[_0x98f9('0x2f')]=_[_0x98f9('0x2e')](_0x5513e9['model'],qs[_0x98f9('0x30')](_0x4c9976['query'][_0x98f9('0x30')]));_0x3d5b77[_0x98f9('0x2f')]=_0x3d5b77[_0x98f9('0x2f')][_0x98f9('0x48')]?_0x3d5b77[_0x98f9('0x2f')]:_0x5513e9[_0x98f9('0x2b')];_0x3d5b77[_0x98f9('0x33')]=qs[_0x98f9('0x34')](_0x4c9976[_0x98f9('0x2c')]['sort']);_0x3d5b77[_0x98f9('0x35')]=qs[_0x98f9('0x2d')](_[_0x98f9('0x36')](_0x4c9976[_0x98f9('0x2c')],_0x5513e9[_0x98f9('0x2d')]));if(_0x4c9976[_0x98f9('0x2c')]['filter']){_0x3d5b77[_0x98f9('0x35')]=_['merge'](_0x3d5b77['where'],{'$or':_[_0x98f9('0x38')](_0x3d5b77[_0x98f9('0x2f')],function(_0x182cb9){var _0x38d02d={};_0x38d02d[_0x182cb9]={'$like':'%'+_0x4c9976['query'][_0x98f9('0x3a')]+'%'};return _0x38d02d;})});}_0x3d5b77=_['merge']({},_0x3d5b77,_0x4c9976[_0x98f9('0x3b')]);return _0x59ad47[_0x98f9('0x4a')](_0x3d5b77);}})[_0x98f9('0x22')](function(_0x9e4454){if(_0x9e4454){_0x83eba6=_0x9e4454[_0x98f9('0x48')];if(!_0x4c9976['query'][_0x98f9('0x31')](_0x98f9('0x32'))){_0x3d5b77[_0x98f9('0x1a')]=qs[_0x98f9('0x1a')](_0x4c9976[_0x98f9('0x2c')]['limit']);_0x3d5b77['offset']=qs[_0x98f9('0x19')](_0x4c9976[_0x98f9('0x2c')][_0x98f9('0x19')]);}return _0x59ad47['getSubjects'](_0x3d5b77);}})['then'](function(_0x401f58){if(_0x401f58){return _0x401f58?{'count':_0x83eba6,'rows':_0x401f58}:null;}})[_0x98f9('0x22')](respondWithResult(_0x43bbe8,null))[_0x98f9('0x3f')](handleError(_0x43bbe8,null));};exports['getDescriptions']=function(_0x8a18ea,_0x388411,_0x464149){var _0x58e607={};var _0x4cd782={};var _0x4fb1bd;var _0x1185c7;return db[_0x98f9('0x27')][_0x98f9('0x46')]({'where':{'id':_0x8a18ea[_0x98f9('0x40')]['id']}})[_0x98f9('0x22')](handleEntityNotFound(_0x388411,null))['then'](function(_0x11dad4){if(_0x11dad4){_0x4fb1bd=_0x11dad4;_0x4cd782[_0x98f9('0x2b')]=_[_0x98f9('0x41')](db[_0x98f9('0x47')]['rawAttributes']);_0x4cd782[_0x98f9('0x2c')]=_['keys'](_0x8a18ea['query']);_0x4cd782[_0x98f9('0x2d')]=_[_0x98f9('0x2e')](_0x4cd782[_0x98f9('0x2b')],_0x4cd782[_0x98f9('0x2c')]);_0x58e607[_0x98f9('0x2f')]=_[_0x98f9('0x2e')](_0x4cd782[_0x98f9('0x2b')],qs[_0x98f9('0x30')](_0x8a18ea[_0x98f9('0x2c')][_0x98f9('0x30')]));_0x58e607['attributes']=_0x58e607['attributes']['length']?_0x58e607[_0x98f9('0x2f')]:_0x4cd782[_0x98f9('0x2b')];_0x58e607[_0x98f9('0x33')]=qs[_0x98f9('0x34')](_0x8a18ea['query'][_0x98f9('0x34')]);_0x58e607[_0x98f9('0x35')]=qs[_0x98f9('0x2d')](_[_0x98f9('0x36')](_0x8a18ea[_0x98f9('0x2c')],_0x4cd782[_0x98f9('0x2d')]));if(_0x8a18ea[_0x98f9('0x2c')][_0x98f9('0x3a')]){_0x58e607[_0x98f9('0x35')]=_[_0x98f9('0x37')](_0x58e607[_0x98f9('0x35')],{'$or':_[_0x98f9('0x38')](_0x58e607[_0x98f9('0x2f')],function(_0x298ff4){var _0x14d6fb={};_0x14d6fb[_0x298ff4]={'$like':'%'+_0x8a18ea[_0x98f9('0x2c')][_0x98f9('0x3a')]+'%'};return _0x14d6fb;})});}_0x58e607=_['merge']({},_0x58e607,_0x8a18ea['options']);return _0x4fb1bd['getDescriptions'](_0x58e607);}})['then'](function(_0x41964b){if(_0x41964b){_0x1185c7=_0x41964b[_0x98f9('0x48')];if(!_0x8a18ea['query'][_0x98f9('0x31')](_0x98f9('0x32'))){_0x58e607['limit']=qs[_0x98f9('0x1a')](_0x8a18ea[_0x98f9('0x2c')][_0x98f9('0x1a')]);_0x58e607[_0x98f9('0x19')]=qs[_0x98f9('0x19')](_0x8a18ea[_0x98f9('0x2c')][_0x98f9('0x19')]);}return _0x4fb1bd['getDescriptions'](_0x58e607);}})[_0x98f9('0x22')](function(_0xce0385){if(_0xce0385){return _0xce0385?{'count':_0x1185c7,'rows':_0xce0385}:null;}})[_0x98f9('0x22')](respondWithResult(_0x388411,null))[_0x98f9('0x3f')](handleError(_0x388411,null));};exports[_0x98f9('0x4b')]=function(_0x151703,_0x9545d0,_0x1c41b6){var _0x35782f={};var _0x105e0f={};var _0x4dc635;var _0x2ff25f;return db[_0x98f9('0x27')]['findOne']({'where':{'id':_0x151703['params']['id']}})[_0x98f9('0x22')](handleEntityNotFound(_0x9545d0,null))[_0x98f9('0x22')](function(_0x2e7471){if(_0x2e7471){_0x4dc635=_0x2e7471;_0x105e0f[_0x98f9('0x2b')]=_['keys'](db[_0x98f9('0x4c')][_0x98f9('0x28')]);_0x105e0f[_0x98f9('0x2c')]=_[_0x98f9('0x41')](_0x151703[_0x98f9('0x2c')]);_0x105e0f[_0x98f9('0x2d')]=_[_0x98f9('0x2e')](_0x105e0f['model'],_0x105e0f['query']);_0x35782f['attributes']=_[_0x98f9('0x2e')](_0x105e0f['model'],qs[_0x98f9('0x30')](_0x151703[_0x98f9('0x2c')]['fields']));_0x35782f[_0x98f9('0x2f')]=_0x35782f[_0x98f9('0x2f')]['length']?_0x35782f[_0x98f9('0x2f')]:_0x105e0f['model'];_0x35782f[_0x98f9('0x33')]=qs[_0x98f9('0x34')](_0x151703[_0x98f9('0x2c')][_0x98f9('0x34')]);_0x35782f[_0x98f9('0x35')]=qs[_0x98f9('0x2d')](_[_0x98f9('0x36')](_0x151703[_0x98f9('0x2c')],_0x105e0f[_0x98f9('0x2d')]));if(_0x151703[_0x98f9('0x2c')][_0x98f9('0x3a')]){_0x35782f[_0x98f9('0x35')]=_['merge'](_0x35782f['where'],{'$or':_['map'](_0x35782f[_0x98f9('0x2f')],function(_0x5bada5){var _0x1639a5={};_0x1639a5[_0x5bada5]={'$like':'%'+_0x151703[_0x98f9('0x2c')][_0x98f9('0x3a')]+'%'};return _0x1639a5;})});}_0x35782f=_[_0x98f9('0x37')]({},_0x35782f,_0x151703['options']);return _0x4dc635[_0x98f9('0x4b')](_0x35782f);}})[_0x98f9('0x22')](function(_0x360c5d){if(_0x360c5d){_0x2ff25f=_0x360c5d[_0x98f9('0x48')];if(!_0x151703[_0x98f9('0x2c')]['hasOwnProperty'](_0x98f9('0x32'))){_0x35782f['limit']=qs[_0x98f9('0x1a')](_0x151703[_0x98f9('0x2c')]['limit']);_0x35782f[_0x98f9('0x19')]=qs['offset'](_0x151703[_0x98f9('0x2c')][_0x98f9('0x19')]);}return _0x4dc635[_0x98f9('0x4b')](_0x35782f);}})[_0x98f9('0x22')](function(_0x2d1da7){if(_0x2d1da7){return _0x2d1da7?{'count':_0x2ff25f,'rows':_0x2d1da7}:null;}})[_0x98f9('0x22')](respondWithResult(_0x9545d0,null))['catch'](handleError(_0x9545d0,null));};exports[_0x98f9('0x4d')]=function(_0x4059a9,_0x1977e4,_0x5d89a7){if(_0x4059a9[_0x98f9('0x45')]['id']){delete _0x4059a9[_0x98f9('0x45')]['id'];}return db['DeskConfiguration'][_0x98f9('0x46')]({'where':{'id':_0x4059a9['params']['id']}})[_0x98f9('0x22')](handleEntityNotFound(_0x1977e4,null))['then'](function(_0x47cf86){if(_0x47cf86){return _0x47cf86[_0x98f9('0x4d')](_0x4059a9['body'][_0x98f9('0x4e')]||[]);}return null;})[_0x98f9('0x22')](respondWithResult(_0x1977e4,null))[_0x98f9('0x3f')](handleError(_0x1977e4,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index a07b3b5..f5f0172 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 _0x281a=['rimraf','../../config/environment','./intDeskConfiguration.attributes','define','util','../../config/logger','bluebird','path'];(function(_0x4796a,_0x24ac1e){var _0x122275=function(_0x42d74b){while(--_0x42d74b){_0x4796a['push'](_0x4796a['shift']());}};_0x122275(++_0x24ac1e);}(_0x281a,0xcc));var _0xa281=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x281a[_0x4e676e];return _0x336a3c;};'use strict';var _=require('lodash');var util=require(_0xa281('0x0'));var logger=require(_0xa281('0x1'))('api');var moment=require('moment');var BPromise=require(_0xa281('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa281('0x3'));var rimraf=require(_0xa281('0x4'));var config=require(_0xa281('0x5'));var attributes=require(_0xa281('0x6'));module['exports']=function(_0x4fe207,_0x389037){return _0x4fe207[_0xa281('0x7')]('DeskConfiguration',attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe8cd=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','int_desk_configurations','util','../../config/logger'];(function(_0x585133,_0x2412a1){var _0x18254a=function(_0x4c8aaf){while(--_0x4c8aaf){_0x585133['push'](_0x585133['shift']());}};_0x18254a(++_0x2412a1);}(_0xe8cd,0x106));var _0xde8c=function(_0x236d24,_0x29e80a){_0x236d24=_0x236d24-0x0;var _0x1574cf=_0xe8cd[_0x236d24];return _0x1574cf;};'use strict';var _=require('lodash');var util=require(_0xde8c('0x0'));var logger=require(_0xde8c('0x1'))(_0xde8c('0x2'));var moment=require(_0xde8c('0x3'));var BPromise=require(_0xde8c('0x4'));var rp=require(_0xde8c('0x5'));var fs=require('fs');var path=require(_0xde8c('0x6'));var rimraf=require(_0xde8c('0x7'));var config=require(_0xde8c('0x8'));var attributes=require(_0xde8c('0x9'));module[_0xde8c('0xa')]=function(_0x55dc31,_0x1b9e2b){return _0x55dc31['define']('DeskConfiguration',attributes,{'tableName':_0xde8c('0xb'),'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 7ddd3fb..aad282f 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 _0x3c91=['client','http','request','then','DeskConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x3ad2e5,_0x94d414){var _0xc4e565=function(_0x2c96e3){while(--_0x2c96e3){_0x3ad2e5['push'](_0x3ad2e5['shift']());}};_0xc4e565(++_0x94d414);}(_0x3c91,0x1af));var _0x13c9=function(_0x44664e,_0x427da6){_0x44664e=_0x44664e-0x0;var _0x3743fa=_0x3c91[_0x44664e];return _0x3743fa;};'use strict';var _=require(_0x13c9('0x0'));var util=require(_0x13c9('0x1'));var moment=require(_0x13c9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x13c9('0x3'));var db=require(_0x13c9('0x4'))['db'];var utils=require(_0x13c9('0x5'));var logger=require('../../config/logger')(_0x13c9('0x6'));var config=require(_0x13c9('0x7'));var jayson=require(_0x13c9('0x8'));var client=jayson[_0x13c9('0x9')][_0x13c9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c4332,_0x58b610,_0x44243f){return new BPromise(function(_0x196c2a,_0x5fd23){return client[_0x13c9('0xb')](_0x4c4332,_0x44243f)[_0x13c9('0xc')](function(_0x5370dd){logger['info'](_0x13c9('0xd'),_0x58b610,_0x13c9('0xe'));logger['debug']('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x58b610,_0x13c9('0xe'),JSON[_0x13c9('0xf')](_0x5370dd));if(_0x5370dd[_0x13c9('0x10')]){if(_0x5370dd[_0x13c9('0x10')][_0x13c9('0x11')]===0x1f4){logger[_0x13c9('0x10')](_0x13c9('0xd'),_0x58b610,_0x5370dd['error'][_0x13c9('0x12')]);return _0x5fd23(_0x5370dd['error']['message']);}logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x58b610,_0x5370dd['error'][_0x13c9('0x12')]);return _0x196c2a(_0x5370dd[_0x13c9('0x10')]['message']);}else{logger[_0x13c9('0x13')](_0x13c9('0xd'),_0x58b610,_0x13c9('0xe'));_0x196c2a(_0x5370dd[_0x13c9('0x14')][_0x13c9('0x12')]);}})[_0x13c9('0x15')](function(_0x238952){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x58b610,_0x238952);_0x5fd23(_0x238952);});});} \ No newline at end of file +var _0x422b=['result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x21f931,_0x598b2d){var _0x3f083c=function(_0x1c7c49){while(--_0x1c7c49){_0x21f931['push'](_0x21f931['shift']());}};_0x3f083c(++_0x598b2d);}(_0x422b,0x92));var _0xb422=function(_0x2b3833,_0x5c6fec){_0x2b3833=_0x2b3833-0x0;var _0x51b0a0=_0x422b[_0x2b3833];return _0x51b0a0;};'use strict';var _=require(_0xb422('0x0'));var util=require(_0xb422('0x1'));var moment=require(_0xb422('0x2'));var BPromise=require(_0xb422('0x3'));var rs=require(_0xb422('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb422('0x5'))['db'];var utils=require(_0xb422('0x6'));var logger=require(_0xb422('0x7'))(_0xb422('0x8'));var config=require(_0xb422('0x9'));var jayson=require(_0xb422('0xa'));var client=jayson[_0xb422('0xb')][_0xb422('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2d59f0,_0x98ccd5,_0x46b6bc){return new BPromise(function(_0x57ca28,_0x2e03d3){return client[_0xb422('0xd')](_0x2d59f0,_0x46b6bc)[_0xb422('0xe')](function(_0xb3e77a){logger[_0xb422('0xf')](_0xb422('0x10'),_0x98ccd5,_0xb422('0x11'));logger[_0xb422('0x12')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x98ccd5,_0xb422('0x11'),JSON[_0xb422('0x13')](_0xb3e77a));if(_0xb3e77a[_0xb422('0x14')]){if(_0xb3e77a[_0xb422('0x14')]['code']===0x1f4){logger[_0xb422('0x14')](_0xb422('0x10'),_0x98ccd5,_0xb3e77a['error'][_0xb422('0x15')]);return _0x2e03d3(_0xb3e77a[_0xb422('0x14')][_0xb422('0x15')]);}logger['error'](_0xb422('0x10'),_0x98ccd5,_0xb3e77a[_0xb422('0x14')][_0xb422('0x15')]);return _0x57ca28(_0xb3e77a[_0xb422('0x14')][_0xb422('0x15')]);}else{logger[_0xb422('0xf')]('DeskConfiguration,\x20%s,\x20%s',_0x98ccd5,_0xb422('0x11'));_0x57ca28(_0xb3e77a[_0xb422('0x16')][_0xb422('0x15')]);}})[_0xb422('0x17')](function(_0x54bed6){logger[_0xb422('0x14')](_0xb422('0x10'),_0x98ccd5,_0x54bed6);_0x2e03d3(_0x54bed6);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 2ae54d9..3d3594d 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 _0xd1c9=['post','create','put','update','delete','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','/:id','show'];(function(_0x33de8c,_0x1dc858){var _0x3f4a8e=function(_0x5a083b){while(--_0x5a083b){_0x33de8c['push'](_0x33de8c['shift']());}};_0x3f4a8e(++_0x1dc858);}(_0xd1c9,0xeb));var _0x9d1c=function(_0x137bcf,_0x5d9120){_0x137bcf=_0x137bcf-0x0;var _0x3ffe78=_0xd1c9[_0x137bcf];return _0x3ffe78;};'use strict';var multer=require(_0x9d1c('0x0'));var util=require('util');var path=require(_0x9d1c('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9d1c('0x2')]();var fs_extra=require(_0x9d1c('0x3'));var auth=require(_0x9d1c('0x4'));var interaction=require(_0x9d1c('0x5'));var config=require(_0x9d1c('0x6'));var controller=require(_0x9d1c('0x7'));router[_0x9d1c('0x8')]('/',auth[_0x9d1c('0x9')](),controller['index']);router[_0x9d1c('0x8')](_0x9d1c('0xa'),auth[_0x9d1c('0x9')](),controller[_0x9d1c('0xb')]);router[_0x9d1c('0xc')]('/',auth['isAuthenticated'](),controller[_0x9d1c('0xd')]);router[_0x9d1c('0xe')](_0x9d1c('0xa'),auth[_0x9d1c('0x9')](),controller[_0x9d1c('0xf')]);router[_0x9d1c('0x10')](_0x9d1c('0xa'),auth[_0x9d1c('0x9')](),controller[_0x9d1c('0x11')]);module[_0x9d1c('0x12')]=router; \ No newline at end of file +var _0xadd1=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xadd1,0x198));var _0x1add=function(_0x3c30bb,_0x48d22d){_0x3c30bb=_0x3c30bb-0x0;var _0x2f5147=_0xadd1[_0x3c30bb];return _0x2f5147;};'use strict';var multer=require('multer');var util=require(_0x1add('0x0'));var path=require(_0x1add('0x1'));var timeout=require(_0x1add('0x2'));var express=require('express');var router=express[_0x1add('0x3')]();var fs_extra=require(_0x1add('0x4'));var auth=require(_0x1add('0x5'));var interaction=require(_0x1add('0x6'));var config=require(_0x1add('0x7'));var controller=require('./intDeskField.controller');router[_0x1add('0x8')]('/',auth[_0x1add('0x9')](),controller[_0x1add('0xa')]);router[_0x1add('0x8')](_0x1add('0xb'),auth[_0x1add('0x9')](),controller[_0x1add('0xc')]);router[_0x1add('0xd')]('/',auth[_0x1add('0x9')](),controller[_0x1add('0xe')]);router['put'](_0x1add('0xb'),auth[_0x1add('0x9')](),controller['update']);router[_0x1add('0xf')](_0x1add('0xb'),auth[_0x1add('0x9')](),controller[_0x1add('0x10')]);module[_0x1add('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 098b4fb..cd86535 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 _0xf9be=['string','customVariable','keyValue','STRING','ENUM','BOOLEAN','exports'];(function(_0x2b17c0,_0x42bf4e){var _0x2ebbc3=function(_0x1feae0){while(--_0x1feae0){_0x2b17c0['push'](_0x2b17c0['shift']());}};_0x2ebbc3(++_0x42bf4e);}(_0xf9be,0xb5));var _0xef9b=function(_0x1e354d,_0x4cdd11){_0x1e354d=_0x1e354d-0x0;var _0x25445d=_0xf9be[_0x1e354d];return _0x25445d;};'use strict';var Sequelize=require('sequelize');module[_0xef9b('0x0')]={'type':{'type':Sequelize['ENUM'](_0xef9b('0x1'),'variable',_0xef9b('0x2'),_0xef9b('0x3'),'picklist'),'defaultValue':_0xef9b('0x1')},'content':{'type':Sequelize[_0xef9b('0x4')]},'key':{'type':Sequelize[_0xef9b('0x4')]},'keyType':{'type':Sequelize[_0xef9b('0x5')](_0xef9b('0x1'),'variable',_0xef9b('0x2'))},'keyContent':{'type':Sequelize[_0xef9b('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xef9b('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xef9b('0x4')]}}; \ No newline at end of file +var _0x67cb=['ENUM','BOOLEAN','sequelize','exports','string','variable','customVariable','keyValue','STRING'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x67cb,0xad));var _0xb67c=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0x67cb[_0x2235bf];return _0x4c3a64;};'use strict';var Sequelize=require(_0xb67c('0x0'));module[_0xb67c('0x1')]={'type':{'type':Sequelize['ENUM'](_0xb67c('0x2'),_0xb67c('0x3'),_0xb67c('0x4'),_0xb67c('0x5'),'picklist'),'defaultValue':_0xb67c('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xb67c('0x6')]},'keyType':{'type':Sequelize[_0xb67c('0x7')](_0xb67c('0x2'),_0xb67c('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xb67c('0x6')]},'idField':{'type':Sequelize[_0xb67c('0x6')]},'nameField':{'type':Sequelize[_0xb67c('0x6')]},'customField':{'type':Sequelize[_0xb67c('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 781cd95..e109330 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 _0xd97b=['name','send','index','DeskField','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filter','VIRTUAL','options','includeAll','rows','show','length','include','merge','catch','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','update','then','stack'];(function(_0x299a18,_0xb52eb5){var _0x5e0e8a=function(_0x12f176){while(--_0x12f176){_0x299a18['push'](_0x299a18['shift']());}};_0x5e0e8a(++_0xb52eb5);}(_0xd97b,0x176));var _0xbd97=function(_0x46a106,_0x227cf5){_0x46a106=_0x46a106-0x0;var _0x40d614=_0xd97b[_0x46a106];return _0x40d614;};'use strict';var emlformat=require(_0xbd97('0x0'));var rimraf=require(_0xbd97('0x1'));var zipdir=require(_0xbd97('0x2'));var jsonpatch=require(_0xbd97('0x3'));var rp=require(_0xbd97('0x4'));var moment=require('moment');var BPromise=require(_0xbd97('0x5'));var Mustache=require(_0xbd97('0x6'));var util=require('util');var path=require(_0xbd97('0x7'));var sox=require('sox');var csv=require(_0xbd97('0x8'));var ejs=require(_0xbd97('0x9'));var fs=require('fs');var fs_extra=require(_0xbd97('0xa'));var _=require('lodash');var squel=require(_0xbd97('0xb'));var crypto=require('crypto');var jsforce=require(_0xbd97('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xbd97('0x8'));var querystring=require(_0xbd97('0xd'));var Papa=require(_0xbd97('0xe'));var Redis=require(_0xbd97('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbd97('0x10'));var logger=require(_0xbd97('0x11'))(_0xbd97('0x12'));var utils=require(_0xbd97('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xbd97('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f7827,_0x406918){_0x406918=_0x406918||0xcc;return function(_0x212e09){if(_0x212e09){return _0x4f7827['sendStatus'](_0x406918);}return _0x4f7827['status'](_0x406918)[_0xbd97('0x15')]();};}function respondWithResult(_0x51930f,_0x365c62){_0x365c62=_0x365c62||0xc8;return function(_0x5decc6){if(_0x5decc6){return _0x51930f[_0xbd97('0x16')](_0x365c62)[_0xbd97('0x17')](_0x5decc6);}};}function respondWithFilteredResult(_0x44ce74,_0x425373){return function(_0x1b6113){if(_0x1b6113){var _0x544e87=typeof _0x425373[_0xbd97('0x18')]==='undefined'&&typeof _0x425373[_0xbd97('0x19')]===_0xbd97('0x1a');var _0x4b6596=_0x1b6113[_0xbd97('0x1b')];var _0x47a46b=_0x544e87?0x0:_0x425373['offset'];var _0x41167b=_0x544e87?_0x1b6113[_0xbd97('0x1b')]:_0x425373[_0xbd97('0x18')]+_0x425373[_0xbd97('0x19')];var _0x48b8c2;if(_0x41167b>=_0x4b6596){_0x41167b=_0x4b6596;_0x48b8c2=0xc8;}else{_0x48b8c2=0xce;}_0x44ce74['status'](_0x48b8c2);return _0x44ce74[_0xbd97('0x1c')](_0xbd97('0x1d'),_0x47a46b+'-'+_0x41167b+'/'+_0x4b6596)[_0xbd97('0x17')](_0x1b6113);}return null;};}function patchUpdates(_0x28a6e2){return function(_0x237798){try{jsonpatch[_0xbd97('0x1e')](_0x237798,_0x28a6e2,!![]);}catch(_0x5d159e){return BPromise['reject'](_0x5d159e);}return _0x237798['save']();};}function saveUpdates(_0x5be0b9,_0x4cebca){return function(_0x1c9c03){if(_0x1c9c03){return _0x1c9c03[_0xbd97('0x1f')](_0x5be0b9)[_0xbd97('0x20')](function(_0x8a2778){return _0x8a2778;});}return null;};}function removeEntity(_0x2c6b33,_0x186b79){return function(_0x5e66e0){if(_0x5e66e0){return _0x5e66e0['destroy']()[_0xbd97('0x20')](function(){_0x2c6b33[_0xbd97('0x16')](0xcc)[_0xbd97('0x15')]();});}};}function handleEntityNotFound(_0x114092,_0x4accd9){return function(_0x464a69){if(!_0x464a69){_0x114092['sendStatus'](0x194);}return _0x464a69;};}function handleError(_0x1a8cc0,_0x2faa37){_0x2faa37=_0x2faa37||0x1f4;return function(_0x2840ad){logger['error'](_0x2840ad[_0xbd97('0x21')]);if(_0x2840ad[_0xbd97('0x22')]){delete _0x2840ad[_0xbd97('0x22')];}_0x1a8cc0['status'](_0x2faa37)[_0xbd97('0x23')](_0x2840ad);};}exports[_0xbd97('0x24')]=function(_0x325b4e,_0x162856){var _0x574d06={},_0x507cee={},_0x3be674={'count':0x0,'rows':[]};var _0x4678d1=_['map'](db[_0xbd97('0x25')][_0xbd97('0x26')],function(_0x2f0477){return{'name':_0x2f0477[_0xbd97('0x27')],'type':_0x2f0477[_0xbd97('0x28')]['key']};});_0x507cee[_0xbd97('0x29')]=_[_0xbd97('0x2a')](_0x4678d1,_0xbd97('0x22'));_0x507cee[_0xbd97('0x2b')]=_[_0xbd97('0x2c')](_0x325b4e['query']);_0x507cee[_0xbd97('0x2d')]=_[_0xbd97('0x2e')](_0x507cee[_0xbd97('0x29')],_0x507cee['query']);_0x574d06[_0xbd97('0x2f')]=_[_0xbd97('0x2e')](_0x507cee[_0xbd97('0x29')],qs['fields'](_0x325b4e[_0xbd97('0x2b')][_0xbd97('0x30')]));_0x574d06[_0xbd97('0x2f')]=_0x574d06['attributes']['length']?_0x574d06[_0xbd97('0x2f')]:_0x507cee[_0xbd97('0x29')];if(!_0x325b4e['query'][_0xbd97('0x31')](_0xbd97('0x32'))){_0x574d06[_0xbd97('0x19')]=qs[_0xbd97('0x19')](_0x325b4e['query'][_0xbd97('0x19')]);_0x574d06['offset']=qs[_0xbd97('0x18')](_0x325b4e['query']['offset']);}_0x574d06[_0xbd97('0x33')]=qs['sort'](_0x325b4e['query']['sort']);_0x574d06[_0xbd97('0x34')]=qs[_0xbd97('0x2d')](_[_0xbd97('0x35')](_0x325b4e[_0xbd97('0x2b')],_0x507cee[_0xbd97('0x2d')]),_0x4678d1);if(_0x325b4e[_0xbd97('0x2b')][_0xbd97('0x36')]){_0x574d06[_0xbd97('0x34')]=_['merge'](_0x574d06['where'],{'$or':_[_0xbd97('0x2a')](_0x4678d1,function(_0x3ad9a2){if(_0x3ad9a2[_0xbd97('0x28')]!==_0xbd97('0x37')){var _0x12757e={};_0x12757e[_0x3ad9a2['name']]={'$like':'%'+_0x325b4e[_0xbd97('0x2b')][_0xbd97('0x36')]+'%'};return _0x12757e;}})});}_0x574d06=_['merge']({},_0x574d06,_0x325b4e[_0xbd97('0x38')]);var _0x2112ce={'where':_0x574d06[_0xbd97('0x34')]};return db[_0xbd97('0x25')][_0xbd97('0x1b')](_0x2112ce)[_0xbd97('0x20')](function(_0x3ce2a3){_0x3be674[_0xbd97('0x1b')]=_0x3ce2a3;if(_0x325b4e['query'][_0xbd97('0x39')]){_0x574d06['include']=[{'all':!![]}];}return db['DeskField']['findAll'](_0x574d06);})[_0xbd97('0x20')](function(_0x23f82d){_0x3be674[_0xbd97('0x3a')]=_0x23f82d;return _0x3be674;})['then'](respondWithFilteredResult(_0x162856,_0x574d06))['catch'](handleError(_0x162856,null));};exports[_0xbd97('0x3b')]=function(_0x7f6bcc,_0x286f42){var _0x4a392e={'raw':!![],'where':{'id':_0x7f6bcc['params']['id']}},_0x4da153={};_0x4da153[_0xbd97('0x29')]=_[_0xbd97('0x2c')](db[_0xbd97('0x25')]['rawAttributes']);_0x4da153[_0xbd97('0x2b')]=_[_0xbd97('0x2c')](_0x7f6bcc[_0xbd97('0x2b')]);_0x4da153['filters']=_[_0xbd97('0x2e')](_0x4da153['model'],_0x4da153['query']);_0x4a392e[_0xbd97('0x2f')]=_[_0xbd97('0x2e')](_0x4da153[_0xbd97('0x29')],qs[_0xbd97('0x30')](_0x7f6bcc[_0xbd97('0x2b')][_0xbd97('0x30')]));_0x4a392e[_0xbd97('0x2f')]=_0x4a392e[_0xbd97('0x2f')][_0xbd97('0x3c')]?_0x4a392e['attributes']:_0x4da153[_0xbd97('0x29')];if(_0x7f6bcc['query'][_0xbd97('0x39')]){_0x4a392e[_0xbd97('0x3d')]=[{'all':!![]}];}_0x4a392e=_[_0xbd97('0x3e')]({},_0x4a392e,_0x7f6bcc[_0xbd97('0x38')]);return db[_0xbd97('0x25')]['find'](_0x4a392e)['then'](handleEntityNotFound(_0x286f42,null))[_0xbd97('0x20')](respondWithResult(_0x286f42,null))[_0xbd97('0x3f')](handleError(_0x286f42,null));};exports['create']=function(_0x37b9c5,_0x45c7f5){return db[_0xbd97('0x25')][_0xbd97('0x40')](_0x37b9c5[_0xbd97('0x41')],{})['then'](respondWithResult(_0x45c7f5,0xc9))[_0xbd97('0x3f')](handleError(_0x45c7f5,null));};exports[_0xbd97('0x1f')]=function(_0x28a1ce,_0x24dc87){if(_0x28a1ce[_0xbd97('0x41')]['id']){delete _0x28a1ce[_0xbd97('0x41')]['id'];}return db[_0xbd97('0x25')][_0xbd97('0x42')]({'where':{'id':_0x28a1ce['params']['id']}})[_0xbd97('0x20')](handleEntityNotFound(_0x24dc87,null))[_0xbd97('0x20')](saveUpdates(_0x28a1ce['body'],null))[_0xbd97('0x20')](respondWithResult(_0x24dc87,null))[_0xbd97('0x3f')](handleError(_0x24dc87,null));};exports[_0xbd97('0x43')]=function(_0x548c4b,_0x309843){return db[_0xbd97('0x25')][_0xbd97('0x42')]({'where':{'id':_0x548c4b['params']['id']}})[_0xbd97('0x20')](handleEntityNotFound(_0x309843,null))[_0xbd97('0x20')](removeEntity(_0x309843,null))[_0xbd97('0x3f')](handleError(_0x309843,null));}; \ No newline at end of file +var _0xffb1=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','then','destroy','sendStatus','error','stack','name','send','map','DeskField','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','keys','find','catch','create','update','body','params','eml-format','rimraf','zip-dir'];(function(_0x41c280,_0x5f9299){var _0x3f2138=function(_0x5d02c5){while(--_0x5d02c5){_0x41c280['push'](_0x41c280['shift']());}};_0x3f2138(++_0x5f9299);}(_0xffb1,0x93));var _0x1ffb=function(_0x7148a3,_0x1c6652){_0x7148a3=_0x7148a3-0x0;var _0x52f31d=_0xffb1[_0x7148a3];return _0x52f31d;};'use strict';var emlformat=require(_0x1ffb('0x0'));var rimraf=require(_0x1ffb('0x1'));var zipdir=require(_0x1ffb('0x2'));var jsonpatch=require(_0x1ffb('0x3'));var rp=require(_0x1ffb('0x4'));var moment=require(_0x1ffb('0x5'));var BPromise=require(_0x1ffb('0x6'));var Mustache=require(_0x1ffb('0x7'));var util=require(_0x1ffb('0x8'));var path=require(_0x1ffb('0x9'));var sox=require('sox');var csv=require(_0x1ffb('0xa'));var ejs=require(_0x1ffb('0xb'));var fs=require('fs');var fs_extra=require(_0x1ffb('0xc'));var _=require(_0x1ffb('0xd'));var squel=require(_0x1ffb('0xe'));var crypto=require('crypto');var jsforce=require(_0x1ffb('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1ffb('0x10'));var Papa=require(_0x1ffb('0x11'));var Redis=require(_0x1ffb('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1ffb('0x13'));var hardwareService=require(_0x1ffb('0x14'));var logger=require('../../config/logger')(_0x1ffb('0x15'));var utils=require('../../config/utils');var config=require(_0x1ffb('0x16'));var licenseUtil=require(_0x1ffb('0x17'));var db=require(_0x1ffb('0x18'))['db'];function respondWithStatusCode(_0x351de7,_0x46c1ec){_0x46c1ec=_0x46c1ec||0xcc;return function(_0x121651){if(_0x121651){return _0x351de7['sendStatus'](_0x46c1ec);}return _0x351de7[_0x1ffb('0x19')](_0x46c1ec)[_0x1ffb('0x1a')]();};}function respondWithResult(_0x379a1e,_0x48e92c){_0x48e92c=_0x48e92c||0xc8;return function(_0x208c0b){if(_0x208c0b){return _0x379a1e['status'](_0x48e92c)['json'](_0x208c0b);}};}function respondWithFilteredResult(_0x4b2001,_0x446e91){return function(_0x1216b5){if(_0x1216b5){var _0x4c11db=typeof _0x446e91[_0x1ffb('0x1b')]===_0x1ffb('0x1c')&&typeof _0x446e91[_0x1ffb('0x1d')]===_0x1ffb('0x1c');var _0x4de448=_0x1216b5[_0x1ffb('0x1e')];var _0x4a2d6c=_0x4c11db?0x0:_0x446e91[_0x1ffb('0x1b')];var _0x239bbf=_0x4c11db?_0x1216b5[_0x1ffb('0x1e')]:_0x446e91[_0x1ffb('0x1b')]+_0x446e91[_0x1ffb('0x1d')];var _0x47b5d2;if(_0x239bbf>=_0x4de448){_0x239bbf=_0x4de448;_0x47b5d2=0xc8;}else{_0x47b5d2=0xce;}_0x4b2001[_0x1ffb('0x19')](_0x47b5d2);return _0x4b2001['set'](_0x1ffb('0x1f'),_0x4a2d6c+'-'+_0x239bbf+'/'+_0x4de448)[_0x1ffb('0x20')](_0x1216b5);}return null;};}function patchUpdates(_0x34dede){return function(_0x5f4c16){try{jsonpatch[_0x1ffb('0x21')](_0x5f4c16,_0x34dede,!![]);}catch(_0x4dd0ba){return BPromise[_0x1ffb('0x22')](_0x4dd0ba);}return _0x5f4c16['save']();};}function saveUpdates(_0x137b2b,_0x5328f9){return function(_0x3be561){if(_0x3be561){return _0x3be561['update'](_0x137b2b)[_0x1ffb('0x23')](function(_0x1a522c){return _0x1a522c;});}return null;};}function removeEntity(_0x530203,_0x5e4ac4){return function(_0x5186fe){if(_0x5186fe){return _0x5186fe[_0x1ffb('0x24')]()['then'](function(){_0x530203['status'](0xcc)[_0x1ffb('0x1a')]();});}};}function handleEntityNotFound(_0x391085,_0x5b7ff5){return function(_0x142ae0){if(!_0x142ae0){_0x391085[_0x1ffb('0x25')](0x194);}return _0x142ae0;};}function handleError(_0x10b8ea,_0x458f6f){_0x458f6f=_0x458f6f||0x1f4;return function(_0x18dbba){logger[_0x1ffb('0x26')](_0x18dbba[_0x1ffb('0x27')]);if(_0x18dbba['name']){delete _0x18dbba[_0x1ffb('0x28')];}_0x10b8ea[_0x1ffb('0x19')](_0x458f6f)[_0x1ffb('0x29')](_0x18dbba);};}exports['index']=function(_0x2c68fc,_0x471eaf){var _0x1c9771={},_0x5e7859={},_0x58275b={'count':0x0,'rows':[]};var _0x73d76e=_[_0x1ffb('0x2a')](db[_0x1ffb('0x2b')][_0x1ffb('0x2c')],function(_0x95e337){return{'name':_0x95e337[_0x1ffb('0x2d')],'type':_0x95e337[_0x1ffb('0x2e')]['key']};});_0x5e7859[_0x1ffb('0x2f')]=_[_0x1ffb('0x2a')](_0x73d76e,'name');_0x5e7859[_0x1ffb('0x30')]=_['keys'](_0x2c68fc['query']);_0x5e7859[_0x1ffb('0x31')]=_[_0x1ffb('0x32')](_0x5e7859[_0x1ffb('0x2f')],_0x5e7859['query']);_0x1c9771[_0x1ffb('0x33')]=_[_0x1ffb('0x32')](_0x5e7859[_0x1ffb('0x2f')],qs[_0x1ffb('0x34')](_0x2c68fc[_0x1ffb('0x30')][_0x1ffb('0x34')]));_0x1c9771[_0x1ffb('0x33')]=_0x1c9771[_0x1ffb('0x33')][_0x1ffb('0x35')]?_0x1c9771['attributes']:_0x5e7859[_0x1ffb('0x2f')];if(!_0x2c68fc[_0x1ffb('0x30')][_0x1ffb('0x36')](_0x1ffb('0x37'))){_0x1c9771[_0x1ffb('0x1d')]=qs[_0x1ffb('0x1d')](_0x2c68fc[_0x1ffb('0x30')][_0x1ffb('0x1d')]);_0x1c9771[_0x1ffb('0x1b')]=qs['offset'](_0x2c68fc[_0x1ffb('0x30')]['offset']);}_0x1c9771[_0x1ffb('0x38')]=qs['sort'](_0x2c68fc[_0x1ffb('0x30')][_0x1ffb('0x39')]);_0x1c9771[_0x1ffb('0x3a')]=qs[_0x1ffb('0x31')](_[_0x1ffb('0x3b')](_0x2c68fc[_0x1ffb('0x30')],_0x5e7859['filters']),_0x73d76e);if(_0x2c68fc[_0x1ffb('0x30')][_0x1ffb('0x3c')]){_0x1c9771[_0x1ffb('0x3a')]=_[_0x1ffb('0x3d')](_0x1c9771['where'],{'$or':_['map'](_0x73d76e,function(_0x233e45){if(_0x233e45[_0x1ffb('0x2e')]!==_0x1ffb('0x3e')){var _0x9bbe07={};_0x9bbe07[_0x233e45[_0x1ffb('0x28')]]={'$like':'%'+_0x2c68fc['query'][_0x1ffb('0x3c')]+'%'};return _0x9bbe07;}})});}_0x1c9771=_[_0x1ffb('0x3d')]({},_0x1c9771,_0x2c68fc[_0x1ffb('0x3f')]);var _0x1a55d6={'where':_0x1c9771[_0x1ffb('0x3a')]};return db[_0x1ffb('0x2b')][_0x1ffb('0x1e')](_0x1a55d6)[_0x1ffb('0x23')](function(_0x35fc15){_0x58275b[_0x1ffb('0x1e')]=_0x35fc15;if(_0x2c68fc['query'][_0x1ffb('0x40')]){_0x1c9771[_0x1ffb('0x41')]=[{'all':!![]}];}return db[_0x1ffb('0x2b')][_0x1ffb('0x42')](_0x1c9771);})['then'](function(_0x2e8f47){_0x58275b['rows']=_0x2e8f47;return _0x58275b;})['then'](respondWithFilteredResult(_0x471eaf,_0x1c9771))['catch'](handleError(_0x471eaf,null));};exports[_0x1ffb('0x43')]=function(_0x9b098b,_0x32621f){var _0x37103f={'raw':!![],'where':{'id':_0x9b098b['params']['id']}},_0x26ea34={};_0x26ea34['model']=_[_0x1ffb('0x44')](db[_0x1ffb('0x2b')][_0x1ffb('0x2c')]);_0x26ea34[_0x1ffb('0x30')]=_[_0x1ffb('0x44')](_0x9b098b['query']);_0x26ea34[_0x1ffb('0x31')]=_[_0x1ffb('0x32')](_0x26ea34['model'],_0x26ea34[_0x1ffb('0x30')]);_0x37103f['attributes']=_[_0x1ffb('0x32')](_0x26ea34[_0x1ffb('0x2f')],qs[_0x1ffb('0x34')](_0x9b098b[_0x1ffb('0x30')][_0x1ffb('0x34')]));_0x37103f['attributes']=_0x37103f[_0x1ffb('0x33')][_0x1ffb('0x35')]?_0x37103f[_0x1ffb('0x33')]:_0x26ea34[_0x1ffb('0x2f')];if(_0x9b098b['query']['includeAll']){_0x37103f[_0x1ffb('0x41')]=[{'all':!![]}];}_0x37103f=_[_0x1ffb('0x3d')]({},_0x37103f,_0x9b098b['options']);return db['DeskField'][_0x1ffb('0x45')](_0x37103f)['then'](handleEntityNotFound(_0x32621f,null))[_0x1ffb('0x23')](respondWithResult(_0x32621f,null))[_0x1ffb('0x46')](handleError(_0x32621f,null));};exports[_0x1ffb('0x47')]=function(_0x36b11a,_0x953c27){return db[_0x1ffb('0x2b')][_0x1ffb('0x47')](_0x36b11a['body'],{})[_0x1ffb('0x23')](respondWithResult(_0x953c27,0xc9))[_0x1ffb('0x46')](handleError(_0x953c27,null));};exports[_0x1ffb('0x48')]=function(_0xdd59b1,_0x4860f1){if(_0xdd59b1[_0x1ffb('0x49')]['id']){delete _0xdd59b1[_0x1ffb('0x49')]['id'];}return db[_0x1ffb('0x2b')][_0x1ffb('0x45')]({'where':{'id':_0xdd59b1[_0x1ffb('0x4a')]['id']}})[_0x1ffb('0x23')](handleEntityNotFound(_0x4860f1,null))[_0x1ffb('0x23')](saveUpdates(_0xdd59b1[_0x1ffb('0x49')],null))[_0x1ffb('0x23')](respondWithResult(_0x4860f1,null))[_0x1ffb('0x46')](handleError(_0x4860f1,null));};exports[_0x1ffb('0x24')]=function(_0x126608,_0x408e98){return db[_0x1ffb('0x2b')][_0x1ffb('0x45')]({'where':{'id':_0x126608[_0x1ffb('0x4a')]['id']}})[_0x1ffb('0x23')](handleEntityNotFound(_0x408e98,null))[_0x1ffb('0x23')](removeEntity(_0x408e98,null))['catch'](handleError(_0x408e98,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index e5e746d..c070cdd 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 _0xccc1=['bluebird','path','../../config/environment','./intDeskField.attributes','exports','DeskField','desk_unique_index','idField','lodash','../../config/logger','api','moment'];(function(_0x5c2703,_0x78bc4e){var _0x2c2b51=function(_0x144275){while(--_0x144275){_0x5c2703['push'](_0x5c2703['shift']());}};_0x2c2b51(++_0x78bc4e);}(_0xccc1,0x14c));var _0x1ccc=function(_0x163cba,_0x3b18d7){_0x163cba=_0x163cba-0x0;var _0x44f96c=_0xccc1[_0x163cba];return _0x44f96c;};'use strict';var _=require(_0x1ccc('0x0'));var util=require('util');var logger=require(_0x1ccc('0x1'))(_0x1ccc('0x2'));var moment=require(_0x1ccc('0x3'));var BPromise=require(_0x1ccc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1ccc('0x5'));var rimraf=require('rimraf');var config=require(_0x1ccc('0x6'));var attributes=require(_0x1ccc('0x7'));module[_0x1ccc('0x8')]=function(_0x2d00f4,_0x8be64e){return _0x2d00f4['define'](_0x1ccc('0x9'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0x1ccc('0xa'),'fields':[_0x1ccc('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x211d=['DeskField','int_desk_fields','idField','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','exports'];(function(_0x1024b2,_0xccbf16){var _0x565807=function(_0x37e617){while(--_0x37e617){_0x1024b2['push'](_0x1024b2['shift']());}};_0x565807(++_0xccbf16);}(_0x211d,0xe3));var _0xd211=function(_0x378be6,_0x326487){_0x378be6=_0x378be6-0x0;var _0x3b92ff=_0x211d[_0x378be6];return _0x3b92ff;};'use strict';var _=require(_0xd211('0x0'));var util=require(_0xd211('0x1'));var logger=require(_0xd211('0x2'))('api');var moment=require(_0xd211('0x3'));var BPromise=require(_0xd211('0x4'));var rp=require(_0xd211('0x5'));var fs=require('fs');var path=require(_0xd211('0x6'));var rimraf=require(_0xd211('0x7'));var config=require(_0xd211('0x8'));var attributes=require(_0xd211('0x9'));module[_0xd211('0xa')]=function(_0x40e3b3,_0x2a807e){return _0x40e3b3['define'](_0xd211('0xb'),attributes,{'tableName':_0xd211('0xc'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0xd211('0xd'),'FieldId'],'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 94d34e7..1fb1782 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 _0xa979=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','DeskField,\x20%s,\x20%s','debug','DeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x1ff527,_0x54b6d2){var _0x51cc75=function(_0x4168e5){while(--_0x4168e5){_0x1ff527['push'](_0x1ff527['shift']());}};_0x51cc75(++_0x54b6d2);}(_0xa979,0x17a));var _0x9a97=function(_0x480a51,_0x3aecea){_0x480a51=_0x480a51-0x0;var _0x19673b=_0xa979[_0x480a51];return _0x19673b;};'use strict';var _=require(_0x9a97('0x0'));var util=require(_0x9a97('0x1'));var moment=require(_0x9a97('0x2'));var BPromise=require(_0x9a97('0x3'));var rs=require(_0x9a97('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9a97('0x5'))['db'];var utils=require(_0x9a97('0x6'));var logger=require(_0x9a97('0x7'))(_0x9a97('0x8'));var config=require('../../config/environment');var jayson=require(_0x9a97('0x9'));var client=jayson[_0x9a97('0xa')][_0x9a97('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e0c82,_0x10bbe7,_0x26dd42){return new BPromise(function(_0x181aeb,_0x4d8104){return client[_0x9a97('0xc')](_0x4e0c82,_0x26dd42)[_0x9a97('0xd')](function(_0x4441e0){logger[_0x9a97('0xe')](_0x9a97('0xf'),_0x10bbe7,'request\x20sent');logger[_0x9a97('0x10')](_0x9a97('0x11'),_0x10bbe7,_0x9a97('0x12'),JSON[_0x9a97('0x13')](_0x4441e0));if(_0x4441e0[_0x9a97('0x14')]){if(_0x4441e0['error'][_0x9a97('0x15')]===0x1f4){logger[_0x9a97('0x14')](_0x9a97('0xf'),_0x10bbe7,_0x4441e0[_0x9a97('0x14')][_0x9a97('0x16')]);return _0x4d8104(_0x4441e0[_0x9a97('0x14')]['message']);}logger[_0x9a97('0x14')]('DeskField,\x20%s,\x20%s',_0x10bbe7,_0x4441e0[_0x9a97('0x14')][_0x9a97('0x16')]);return _0x181aeb(_0x4441e0[_0x9a97('0x14')][_0x9a97('0x16')]);}else{logger[_0x9a97('0xe')](_0x9a97('0xf'),_0x10bbe7,_0x9a97('0x12'));_0x181aeb(_0x4441e0['result'][_0x9a97('0x16')]);}})[_0x9a97('0x17')](function(_0x358838){logger[_0x9a97('0x14')](_0x9a97('0xf'),_0x10bbe7,_0x358838);_0x4d8104(_0x358838);});});} \ No newline at end of file +var _0x74f5=['stringify','error','code','DeskField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s'];(function(_0x334efe,_0x3f1556){var _0x5916be=function(_0x32fa1a){while(--_0x32fa1a){_0x334efe['push'](_0x334efe['shift']());}};_0x5916be(++_0x3f1556);}(_0x74f5,0xd6));var _0x574f=function(_0x13188a,_0x2f635f){_0x13188a=_0x13188a-0x0;var _0x2f5716=_0x74f5[_0x13188a];return _0x2f5716;};'use strict';var _=require(_0x574f('0x0'));var util=require(_0x574f('0x1'));var moment=require(_0x574f('0x2'));var BPromise=require('bluebird');var rs=require(_0x574f('0x3'));var fs=require('fs');var Redis=require(_0x574f('0x4'));var db=require(_0x574f('0x5'))['db'];var utils=require(_0x574f('0x6'));var logger=require(_0x574f('0x7'))(_0x574f('0x8'));var config=require(_0x574f('0x9'));var jayson=require(_0x574f('0xa'));var client=jayson[_0x574f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3711cd,_0x294ca7,_0xf97a1c){return new BPromise(function(_0x1186dd,_0x5a8566){return client[_0x574f('0xc')](_0x3711cd,_0xf97a1c)['then'](function(_0x2d0892){logger['info']('DeskField,\x20%s,\x20%s',_0x294ca7,_0x574f('0xd'));logger[_0x574f('0xe')](_0x574f('0xf'),_0x294ca7,_0x574f('0xd'),JSON[_0x574f('0x10')](_0x2d0892));if(_0x2d0892[_0x574f('0x11')]){if(_0x2d0892[_0x574f('0x11')][_0x574f('0x12')]===0x1f4){logger['error'](_0x574f('0x13'),_0x294ca7,_0x2d0892[_0x574f('0x11')][_0x574f('0x14')]);return _0x5a8566(_0x2d0892[_0x574f('0x11')][_0x574f('0x14')]);}logger[_0x574f('0x11')](_0x574f('0x13'),_0x294ca7,_0x2d0892[_0x574f('0x11')][_0x574f('0x14')]);return _0x1186dd(_0x2d0892[_0x574f('0x11')]['message']);}else{logger['info'](_0x574f('0x13'),_0x294ca7,_0x574f('0xd'));_0x1186dd(_0x2d0892[_0x574f('0x15')][_0x574f('0x14')]);}})[_0x574f('0x16')](function(_0x39f837){logger['error'](_0x574f('0x13'),_0x294ca7,_0x39f837);_0x5a8566(_0x39f837);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 467fca2..759abbf 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 _0xa975=['get','/:id','show','getConfigurations','post','addConfiguration','update','delete','exports','multer','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','isAuthenticated','index'];(function(_0x236092,_0x2f90ba){var _0x353481=function(_0x591807){while(--_0x591807){_0x236092['push'](_0x236092['shift']());}};_0x353481(++_0x2f90ba);}(_0xa975,0x117));var _0x5a97=function(_0x2f2e7a,_0x37cebc){_0x2f2e7a=_0x2f2e7a-0x0;var _0x5d9cbc=_0xa975[_0x2f2e7a];return _0x5d9cbc;};'use strict';var multer=require(_0x5a97('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5a97('0x1'));var express=require(_0x5a97('0x2'));var router=express['Router']();var fs_extra=require(_0x5a97('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x5a97('0x4'));var config=require(_0x5a97('0x5'));var controller=require(_0x5a97('0x6'));router['get']('/',auth[_0x5a97('0x7')](),controller[_0x5a97('0x8')]);router[_0x5a97('0x9')](_0x5a97('0xa'),auth[_0x5a97('0x7')](),controller[_0x5a97('0xb')]);router[_0x5a97('0x9')]('/:id/configurations',auth[_0x5a97('0x7')](),controller[_0x5a97('0xc')]);router[_0x5a97('0x9')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x5a97('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5a97('0xd')]('/:id/configurations',auth[_0x5a97('0x7')](),controller[_0x5a97('0xe')]);router['put'](_0x5a97('0xa'),auth['isAuthenticated'](),controller[_0x5a97('0xf')]);router[_0x5a97('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x5a97('0x11')]=router; \ No newline at end of file +var _0xe7c6=['delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','update'];(function(_0x2b05e9,_0x61c03a){var _0x1b9417=function(_0x3d8b6c){while(--_0x3d8b6c){_0x2b05e9['push'](_0x2b05e9['shift']());}};_0x1b9417(++_0x61c03a);}(_0xe7c6,0xfd));var _0x6e7c=function(_0x200d3a,_0x44f41d){_0x200d3a=_0x200d3a-0x0;var _0x395799=_0xe7c6[_0x200d3a];return _0x395799;};'use strict';var multer=require(_0x6e7c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6e7c('0x1'));var express=require(_0x6e7c('0x2'));var router=express[_0x6e7c('0x3')]();var fs_extra=require(_0x6e7c('0x4'));var auth=require(_0x6e7c('0x5'));var interaction=require(_0x6e7c('0x6'));var config=require(_0x6e7c('0x7'));var controller=require('./intDynamics365Account.controller');router[_0x6e7c('0x8')]('/',auth[_0x6e7c('0x9')](),controller[_0x6e7c('0xa')]);router[_0x6e7c('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x6e7c('0xb')]);router['get'](_0x6e7c('0xc'),auth[_0x6e7c('0x9')](),controller[_0x6e7c('0xd')]);router['get'](_0x6e7c('0xe'),auth[_0x6e7c('0x9')](),controller[_0x6e7c('0xf')]);router[_0x6e7c('0x10')]('/',auth[_0x6e7c('0x9')](),controller[_0x6e7c('0x11')]);router['post'](_0x6e7c('0xc'),auth[_0x6e7c('0x9')](),controller[_0x6e7c('0x12')]);router[_0x6e7c('0x13')](_0x6e7c('0x14'),auth[_0x6e7c('0x9')](),controller[_0x6e7c('0x15')]);router[_0x6e7c('0x16')](_0x6e7c('0x14'),auth['isAuthenticated'](),controller[_0x6e7c('0x17')]);module[_0x6e7c('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 085f2f3..f1c147b 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 _0x6379=['sequelize','exports','STRING','BOOLEAN'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x6379,0x84));var _0x9637=function(_0x12d034,_0x430f51){_0x12d034=_0x12d034-0x0;var _0x39d6e5=_0x6379[_0x12d034];return _0x39d6e5;};'use strict';var Sequelize=require(_0x9637('0x0'));module[_0x9637('0x1')]={'name':{'type':Sequelize[_0x9637('0x2')]},'username':{'type':Sequelize[_0x9637('0x2')]},'password':{'type':Sequelize[_0x9637('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0x9637('0x2')]},'clientId':{'type':Sequelize[_0x9637('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x9637('0x2')]},'modernAuthentication':{'type':Sequelize[_0x9637('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xbd51=['BOOLEAN','sequelize','STRING'];(function(_0x487010,_0x376cef){var _0x65af50=function(_0x403c47){while(--_0x403c47){_0x487010['push'](_0x487010['shift']());}};_0x65af50(++_0x376cef);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x3a5d56,_0x80d78e){_0x3a5d56=_0x3a5d56-0x0;var _0x79428e=_0xbd51[_0x3a5d56];return _0x79428e;};'use strict';var Sequelize=require(_0x1bd5('0x0'));module['exports']={'name':{'type':Sequelize[_0x1bd5('0x1')]},'username':{'type':Sequelize[_0x1bd5('0x1')]},'password':{'type':Sequelize[_0x1bd5('0x1')]},'remoteUri':{'type':Sequelize[_0x1bd5('0x1')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x1bd5('0x1')]},'modernAuthentication':{'type':Sequelize[_0x1bd5('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 690e9de..47649eb 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 _0x9624=['DisplayName','UserLocalizedLabel',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','request-promise','util','lodash','../../components/parsers/qs','../../config/logger','../../mysqldb','../../components/integrations/configuration','status','json','offset','limit','undefined','count','set','Content-Range','update','then','end','sendStatus','error','stack','name','index','map','Dynamics365Account','rawAttributes','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','options','include','rows','catch','show','params','includeAll','create','body','find','destroy','getConfigurations','findOne','filter','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','Subjects','Dynamics365Field','slice','substring','lastIndexOf','format','getFields','ticketType','incident','Incident','PhoneCall','description','ownerid','subject','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridyominame','emailaddress','entityimage_timestamp','entityimage_url','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','kbarticleidname','lastonholdtime','masteridname','modifiedbyname','modifiedon','msdyn_incidenttypename','msdyn_iotalertname','onholdtime','owneridname','owneridtype','owneridyominame','parentcaseidname','prioritycodename','productidname','resolvebykpiidname','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','statecode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','utcconversiontimezonecode','versionnumber','concat','username','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data5','access_token','data7','POST','https://login.microsoftonline.com/','/oauth2/token','password','4.0','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Bearer\x20','Attributes','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','isNil','push','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','all','test','Wrong\x20credentials','statusCode','GET',')/Attributes(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','Value'];(function(_0x3a8067,_0x525afa){var _0x4a60c7=function(_0x114545){while(--_0x114545){_0x3a8067['push'](_0x3a8067['shift']());}};_0x4a60c7(++_0x525afa);}(_0x9624,0xc0));var _0x4962=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9624[_0x3dd15e];return _0x231fd0;};'use strict';var rp=require(_0x4962('0x0'));var util=require(_0x4962('0x1'));var _=require(_0x4962('0x2'));var qs=require(_0x4962('0x3'));var logger=require(_0x4962('0x4'))('api');var db=require(_0x4962('0x5'))['db'];var integrations=require(_0x4962('0x6'));function respondWithResult(_0x1c7017,_0x4d0b0d){_0x4d0b0d=_0x4d0b0d||0xc8;return function(_0x3830cb){if(_0x3830cb){return _0x1c7017[_0x4962('0x7')](_0x4d0b0d)[_0x4962('0x8')](_0x3830cb);}};}function respondWithFilteredResult(_0x3eb249,_0x352f31){return function(_0x17e0d8){if(_0x17e0d8){var _0xc67251=typeof _0x352f31[_0x4962('0x9')]==='undefined'&&typeof _0x352f31[_0x4962('0xa')]===_0x4962('0xb');var _0x4a794c=_0x17e0d8['count'];var _0x491131=_0xc67251?0x0:_0x352f31[_0x4962('0x9')];var _0x2afa06=_0xc67251?_0x17e0d8[_0x4962('0xc')]:_0x352f31[_0x4962('0x9')]+_0x352f31[_0x4962('0xa')];var _0x143aba;if(_0x2afa06>=_0x4a794c){_0x2afa06=_0x4a794c;_0x143aba=0xc8;}else{_0x143aba=0xce;}_0x3eb249[_0x4962('0x7')](_0x143aba);return _0x3eb249[_0x4962('0xd')](_0x4962('0xe'),_0x491131+'-'+_0x2afa06+'/'+_0x4a794c)[_0x4962('0x8')](_0x17e0d8);}return null;};}function saveUpdates(_0x18d8e6){return function(_0x385f85){if(_0x385f85){return _0x385f85[_0x4962('0xf')](_0x18d8e6)['then'](function(_0x5ecd08){return _0x5ecd08;});}return null;};}function removeEntity(_0x38b5d4){return function(_0x3ff6de){if(_0x3ff6de){return _0x3ff6de['destroy']()[_0x4962('0x10')](function(){_0x38b5d4[_0x4962('0x7')](0xcc)[_0x4962('0x11')]();});}};}function handleEntityNotFound(_0x3e0b55){return function(_0x291e69){if(!_0x291e69){_0x3e0b55[_0x4962('0x12')](0x194);}return _0x291e69;};}function handleError(_0x294891,_0x16fcef){_0x16fcef=_0x16fcef||0x1f4;return function(_0x7c97b0){logger[_0x4962('0x13')](_0x7c97b0[_0x4962('0x14')]);if(_0x7c97b0[_0x4962('0x15')]){delete _0x7c97b0[_0x4962('0x15')];}_0x294891[_0x4962('0x7')](_0x16fcef)['send'](_0x7c97b0);};}exports[_0x4962('0x16')]=function(_0x154c10,_0x426782){var _0x1ff19e={},_0x52928f={},_0x59c22e={'count':0x0,'rows':[]};var _0x1a6f1f=_[_0x4962('0x17')](db[_0x4962('0x18')][_0x4962('0x19')],function(_0x13e760){return{'name':_0x13e760['fieldName'],'type':_0x13e760['type']['key']};});_0x52928f['model']=_[_0x4962('0x17')](_0x1a6f1f,_0x4962('0x15'));_0x52928f['query']=_[_0x4962('0x1a')](_0x154c10[_0x4962('0x1b')]);_0x52928f[_0x4962('0x1c')]=_['intersection'](_0x52928f[_0x4962('0x1d')],_0x52928f[_0x4962('0x1b')]);_0x1ff19e[_0x4962('0x1e')]=_[_0x4962('0x1f')](_0x52928f[_0x4962('0x1d')],qs[_0x4962('0x20')](_0x154c10[_0x4962('0x1b')][_0x4962('0x20')]));_0x1ff19e[_0x4962('0x1e')]=_0x1ff19e[_0x4962('0x1e')][_0x4962('0x21')]?_0x1ff19e[_0x4962('0x1e')]:_0x52928f[_0x4962('0x1d')];if(!_0x154c10['query'][_0x4962('0x22')](_0x4962('0x23'))){_0x1ff19e[_0x4962('0xa')]=qs[_0x4962('0xa')](_0x154c10[_0x4962('0x1b')][_0x4962('0xa')]);_0x1ff19e[_0x4962('0x9')]=qs[_0x4962('0x9')](_0x154c10[_0x4962('0x1b')][_0x4962('0x9')]);}_0x1ff19e[_0x4962('0x24')]=qs['sort'](_0x154c10[_0x4962('0x1b')][_0x4962('0x25')]);_0x1ff19e[_0x4962('0x26')]=qs[_0x4962('0x1c')](_[_0x4962('0x27')](_0x154c10[_0x4962('0x1b')],_0x52928f[_0x4962('0x1c')]),_0x1a6f1f);if(_0x154c10[_0x4962('0x1b')]['filter']){_0x1ff19e[_0x4962('0x26')]=_[_0x4962('0x28')](_0x1ff19e[_0x4962('0x26')],{'$or':_[_0x4962('0x17')](_0x1a6f1f,function(_0x4d2bd9){if(_0x4d2bd9[_0x4962('0x29')]!==_0x4962('0x2a')){var _0x11e58b={};_0x11e58b[_0x4d2bd9[_0x4962('0x15')]]={'$like':'%'+_0x154c10[_0x4962('0x1b')]['filter']+'%'};return _0x11e58b;}})});}_0x1ff19e=_[_0x4962('0x28')]({},_0x1ff19e,_0x154c10[_0x4962('0x2b')]);var _0x4e0784={'where':_0x1ff19e['where']};return db[_0x4962('0x18')][_0x4962('0xc')](_0x4e0784)[_0x4962('0x10')](function(_0x438b04){_0x59c22e[_0x4962('0xc')]=_0x438b04;if(_0x154c10[_0x4962('0x1b')]['includeAll']){_0x1ff19e[_0x4962('0x2c')]=[{'all':!![]}];}return db[_0x4962('0x18')]['findAll'](_0x1ff19e);})[_0x4962('0x10')](function(_0x2a45fb){_0x59c22e[_0x4962('0x2d')]=_0x2a45fb;return _0x59c22e;})['then'](respondWithFilteredResult(_0x426782,_0x1ff19e))[_0x4962('0x2e')](handleError(_0x426782,null));};exports[_0x4962('0x2f')]=function(_0x562728,_0x2804ed){var _0x2ecdd5={'raw':![],'where':{'id':_0x562728[_0x4962('0x30')]['id']}},_0x1f4bb6={};_0x1f4bb6[_0x4962('0x1d')]=_[_0x4962('0x1a')](db[_0x4962('0x18')][_0x4962('0x19')]);_0x1f4bb6['query']=_[_0x4962('0x1a')](_0x562728[_0x4962('0x1b')]);_0x1f4bb6[_0x4962('0x1c')]=_[_0x4962('0x1f')](_0x1f4bb6[_0x4962('0x1d')],_0x1f4bb6[_0x4962('0x1b')]);_0x2ecdd5['attributes']=_[_0x4962('0x1f')](_0x1f4bb6['model'],qs['fields'](_0x562728[_0x4962('0x1b')]['fields']));_0x2ecdd5[_0x4962('0x1e')]=_0x2ecdd5['attributes']['length']?_0x2ecdd5[_0x4962('0x1e')]:_0x1f4bb6['model'];if(_0x562728[_0x4962('0x1b')][_0x4962('0x31')]){_0x2ecdd5[_0x4962('0x2c')]=[{'all':!![]}];}_0x2ecdd5=_[_0x4962('0x28')]({},_0x2ecdd5,_0x562728[_0x4962('0x2b')]);return db[_0x4962('0x18')]['find'](_0x2ecdd5)[_0x4962('0x10')](handleEntityNotFound(_0x2804ed,null))[_0x4962('0x10')](respondWithResult(_0x2804ed,null))[_0x4962('0x2e')](handleError(_0x2804ed,null));};exports[_0x4962('0x32')]=function(_0x2c9257,_0xf2c11e){return db[_0x4962('0x18')][_0x4962('0x32')](_0x2c9257['body'],{})[_0x4962('0x10')](respondWithResult(_0xf2c11e,0xc9))[_0x4962('0x2e')](handleError(_0xf2c11e,null));};exports[_0x4962('0xf')]=function(_0x5080a0,_0x4de281){if(_0x5080a0['body']['id']){delete _0x5080a0[_0x4962('0x33')]['id'];}return db[_0x4962('0x18')][_0x4962('0x34')]({'where':{'id':_0x5080a0[_0x4962('0x30')]['id']}})[_0x4962('0x10')](handleEntityNotFound(_0x4de281,null))[_0x4962('0x10')](saveUpdates(_0x5080a0[_0x4962('0x33')],null))[_0x4962('0x10')](respondWithResult(_0x4de281,null))[_0x4962('0x2e')](handleError(_0x4de281,null));};exports[_0x4962('0x35')]=function(_0x3b112b,_0x18a7b3){return db[_0x4962('0x18')]['find']({'where':{'id':_0x3b112b['params']['id']}})['then'](handleEntityNotFound(_0x18a7b3,null))['then'](removeEntity(_0x18a7b3,null))[_0x4962('0x2e')](handleError(_0x18a7b3,null));};exports[_0x4962('0x36')]=function(_0x1799ab,_0x55c061){var _0x5869c4={};var _0x4ab079={};var _0x37162b;var _0x4daab1;return db['Dynamics365Account'][_0x4962('0x37')]({'where':{'id':_0x1799ab[_0x4962('0x30')]['id']}})[_0x4962('0x10')](handleEntityNotFound(_0x55c061,null))[_0x4962('0x10')](function(_0x50ab28){if(_0x50ab28){_0x37162b=_0x50ab28;_0x4ab079['model']=_['keys'](db['Dynamics365Configuration'][_0x4962('0x19')]);_0x4ab079[_0x4962('0x1b')]=_[_0x4962('0x1a')](_0x1799ab[_0x4962('0x1b')]);_0x4ab079[_0x4962('0x1c')]=_[_0x4962('0x1f')](_0x4ab079[_0x4962('0x1d')],_0x4ab079[_0x4962('0x1b')]);_0x5869c4[_0x4962('0x1e')]=_[_0x4962('0x1f')](_0x4ab079[_0x4962('0x1d')],qs[_0x4962('0x20')](_0x1799ab[_0x4962('0x1b')][_0x4962('0x20')]));_0x5869c4[_0x4962('0x1e')]=_0x5869c4[_0x4962('0x1e')][_0x4962('0x21')]?_0x5869c4['attributes']:_0x4ab079['model'];_0x5869c4[_0x4962('0x24')]=qs['sort'](_0x1799ab[_0x4962('0x1b')][_0x4962('0x25')]);_0x5869c4[_0x4962('0x26')]=qs[_0x4962('0x1c')](_[_0x4962('0x27')](_0x1799ab[_0x4962('0x1b')],_0x4ab079[_0x4962('0x1c')]));if(_0x1799ab['query']['filter']){_0x5869c4['where']=_[_0x4962('0x28')](_0x5869c4[_0x4962('0x26')],{'$or':_[_0x4962('0x17')](_0x5869c4[_0x4962('0x1e')],function(_0x2fa712){var _0x404e87={};_0x404e87[_0x2fa712]={'$like':'%'+_0x1799ab[_0x4962('0x1b')][_0x4962('0x38')]+'%'};return _0x404e87;})});}_0x5869c4=_[_0x4962('0x28')]({},_0x5869c4,_0x1799ab[_0x4962('0x2b')]);return _0x37162b[_0x4962('0x36')](_0x5869c4);}})[_0x4962('0x10')](function(_0x4b2a30){if(_0x4b2a30){_0x4daab1=_0x4b2a30[_0x4962('0x21')];if(!_0x1799ab[_0x4962('0x1b')][_0x4962('0x22')](_0x4962('0x23'))){_0x5869c4['limit']=qs[_0x4962('0xa')](_0x1799ab[_0x4962('0x1b')][_0x4962('0xa')]);_0x5869c4[_0x4962('0x9')]=qs[_0x4962('0x9')](_0x1799ab[_0x4962('0x1b')]['offset']);}return _0x37162b[_0x4962('0x36')](_0x5869c4);}})[_0x4962('0x10')](function(_0x31f615){if(_0x31f615){return _0x31f615?{'count':_0x4daab1,'rows':_0x31f615}:null;}})[_0x4962('0x10')](respondWithResult(_0x55c061,null))[_0x4962('0x2e')](handleError(_0x55c061,null));};exports[_0x4962('0x39')]=function(_0x84c000,_0x30006c){if(_0x84c000[_0x4962('0x33')]['id']){delete _0x84c000[_0x4962('0x33')]['id'];}return db[_0x4962('0x18')]['findOne']({'where':{'id':_0x84c000[_0x4962('0x30')]['id']}})[_0x4962('0x10')](handleEntityNotFound(_0x30006c,null))[_0x4962('0x10')](function(_0x44b585){if(_0x44b585){_0x84c000[_0x4962('0x33')][_0x4962('0x3a')]=_0x44b585['id'];_0x84c000[_0x4962('0x33')]['Subjects']=integrations[_0x4962('0x3b')](_0x84c000[_0x4962('0x33')][_0x4962('0x3c')],_0x84c000[_0x4962('0x33')]['type']);_0x84c000['body'][_0x4962('0x3d')]=integrations[_0x4962('0x3e')](_0x84c000['body'][_0x4962('0x3c')],_0x84c000[_0x4962('0x33')][_0x4962('0x29')]);return db['Dynamics365Configuration'][_0x4962('0x32')](_0x84c000[_0x4962('0x33')],{'include':[{'model':db['Dynamics365Field'],'as':_0x4962('0x3f')},{'model':db[_0x4962('0x40')],'as':'Descriptions'}]});}return null;})[_0x4962('0x10')](respondWithResult(_0x30006c,null))[_0x4962('0x2e')](handleError(_0x30006c,null));};function sanitizeRemoteUri(_0x33a23c){var _0x382d6d=_0x33a23c[_0x4962('0x41')](-0x1);if(_0x382d6d==='/')return _0x33a23c[_0x4962('0x42')](0x0,_0x33a23c[_0x4962('0x43')](_0x382d6d));return _0x33a23c;}function getWebApiUrl(_0x525080){return util[_0x4962('0x44')]('%s/api/data/v9.0/',_0x525080);}exports[_0x4962('0x45')]=function(_0x2f3d0c,_0x2080b2){var _0x36b09e=_0x2f3d0c['query'][_0x4962('0x46')];var _0x5b62ec=_0x36b09e===_0x4962('0x47')?_0x4962('0x48'):_0x4962('0x49');var _0x237f48='';var _0x254e19='';var _0x3e5d6d='';var _0x1e2c5a='';var _0x3f484d='';var _0x35df38='';var _0xc6c01='';var _0x5570b9='';var _0x5c9194=['title',_0x4962('0x4a'),'customerid',_0x4962('0x4b'),'caseorigincode',_0x4962('0x4c'),'phonenumber','regardingobjectid','directioncode',_0x4962('0x4d')];var _0x5cadfa=[_0x4962('0x4e'),_0x4962('0x4f'),_0x4962('0x50'),_0x4962('0x51'),_0x4962('0x52'),_0x4962('0x53'),_0x4962('0x54'),_0x4962('0x55'),_0x4962('0x56'),'createdbyexternalpartyyominame',_0x4962('0x57'),_0x4962('0x58'),_0x4962('0x59'),_0x4962('0x5a'),_0x4962('0x5b'),_0x4962('0x5c'),'customeridtype',_0x4962('0x5d'),_0x4962('0x5e'),'entitlementidname',_0x4962('0x5f'),_0x4962('0x60'),'escalatedon',_0x4962('0x61'),_0x4962('0x62'),_0x4962('0x63'),_0x4962('0x64'),'influencescore',_0x4962('0x65'),_0x4962('0x66'),_0x4962('0x67'),'modifiedbyexternalpartyname','modifiedbyexternalpartyyominame',_0x4962('0x68'),'modifiedbyyominame',_0x4962('0x69'),'modifiedonbehalfbyname','modifiedonbehalfbyyominame',_0x4962('0x6a'),_0x4962('0x6b'),'numberofchildincidents',_0x4962('0x6c'),'overriddencreatedon',_0x4962('0x6d'),_0x4962('0x6e'),_0x4962('0x6f'),_0x4962('0x70'),'primarycontactidname','primarycontactidyominame',_0x4962('0x71'),_0x4962('0x72'),'productserialnumber','resolveby',_0x4962('0x73'),'responseby',_0x4962('0x74'),_0x4962('0x75'),_0x4962('0x76'),_0x4962('0x77'),_0x4962('0x78'),'socialprofileidname',_0x4962('0x79'),'statuscode',_0x4962('0x7a'),_0x4962('0x7b'),_0x4962('0x7c'),_0x4962('0x7d'),'traversedpath',_0x4962('0x7e'),_0x4962('0x7f')];var _0x6c1689=_0x5c9194[_0x4962('0x80')](_0x5cadfa);return db[_0x4962('0x18')][_0x4962('0x37')]({'where':{'id':_0x2f3d0c[_0x4962('0x30')]['id']},'attributes':['id',_0x4962('0x81'),'password',_0x4962('0x82'),_0x4962('0x83'),_0x4962('0x84'),_0x4962('0x85'),_0x4962('0x86')],'include':[{'model':db[_0x4962('0x87')],'as':_0x4962('0x87'),'attributes':['id',_0x4962('0x88'),'data7']}]})['then'](handleEntityNotFound(_0x2080b2,null))[_0x4962('0x10')](function(_0x501204){if(_0x501204){if(_0x501204['modernAuthentication']){_0x501204[_0x4962('0x89')]=_0x501204[_0x4962('0x87')][_0x4962('0x88')];_0x5570b9=sanitizeRemoteUri(_0x501204[_0x4962('0x87')][_0x4962('0x8a')]);_0xc6c01=getWebApiUrl(_0x5570b9);return _0x501204;}_0x5570b9=sanitizeRemoteUri(_0x501204[_0x4962('0x82')]);_0xc6c01=getWebApiUrl(_0x5570b9);var _0x2fda38={'method':_0x4962('0x8b'),'uri':_0x4962('0x8c')+_0x501204[_0x4962('0x83')]+_0x4962('0x8d'),'form':{'client_id':_0x501204[_0x4962('0x84')],'resource':_0x5570b9,'username':_0x501204[_0x4962('0x81')],'password':_0x501204[_0x4962('0x8e')],'grant_type':'password','client_secret':_0x501204[_0x4962('0x85')]},'json':!![]};return rp(_0x2fda38);}})[_0x4962('0x10')](function(_0x3e6fb3){_0x35df38=_0x3e6fb3[_0x4962('0x89')];var _0x285d27={'method':'GET','uri':encodeURI(_0xc6c01+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x5b62ec+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x35df38,'If-None-Match':null,'OData-Version':_0x4962('0x8f')},'json':!![]};return rp(_0x285d27);})[_0x4962('0x10')](function(_0x3e2423){var _0x3e57cf=_0x3e2423['value'][0x0];var _0x560600=_0x3e57cf[_0x4962('0x90')];var _0x5d5709={'method':'GET','uri':_0xc6c01+_0x4962('0x91')+_0x560600+_0x4962('0x92'),'headers':{'Authorization':_0x4962('0x93')+_0x35df38,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x5d5709);})[_0x4962('0x10')](function(_0x1a4a13){_0x237f48=_0x1a4a13;_0x254e19=_0x237f48[_0x4962('0x94')];_0x254e19=_[_0x4962('0x95')](_0x254e19,function(_0x31ea19){return!_0x6c1689[_0x4962('0x96')](_0x31ea19[_0x4962('0x97')]);});var _0x341003=[];var _0x26bdab=[];_0x254e19[_0x4962('0x98')](function(_0x40a36a){if(_0x40a36a['@odata.type']){var _0x230eee=_0x40a36a[_0x4962('0x99')][_0x4962('0x42')](_0x40a36a[_0x4962('0x99')][_0x4962('0x43')]('.')+0x1);if(_0x230eee===_0x4962('0x9a')){_0x341003['push'](getSelectList(_0xc6c01,_0x36b09e,_0x26bdab,_0x237f48[_0x4962('0x90')],_0x40a36a[_0x4962('0x90')],_0x35df38));}}});return Promise['all'](_0x341003);})['then'](function(_0x4cdef6){_0x3e5d6d=_0x4cdef6[0x0];var _0x46c5bb=[];var _0x4c7c98=[];_0x254e19[_0x4962('0x98')](function(_0x13daaa){if(!_[_0x4962('0x9b')](_0x13daaa[_0x4962('0x99')])){var _0x2c8dfe=_0x13daaa[_0x4962('0x99')][_0x4962('0x42')](_0x13daaa[_0x4962('0x99')]['lastIndexOf']('.')+0x1);if(_0x2c8dfe==='BooleanAttributeMetadata'){_0x46c5bb[_0x4962('0x9c')](getBooleanList(_0xc6c01,_0x36b09e,_0x4c7c98,_0x237f48[_0x4962('0x90')],_0x13daaa[_0x4962('0x90')],_0x35df38));}}});return Promise['all'](_0x46c5bb);})['then'](function(_0x1c782f){_0x1e2c5a=_0x1c782f[0x0];var _0x5b790c=[];var _0x56d373=[];_0x254e19[_0x4962('0x98')](function(_0x247fe2){if(_0x247fe2[_0x4962('0x99')]){var _0x5c75ce=_0x247fe2['@odata.type'][_0x4962('0x42')](_0x247fe2['@odata.type'][_0x4962('0x43')]('.')+0x1);if(_0x5c75ce===_0x4962('0x9d')||_0x5c75ce===_0x4962('0x9e')||_0x5c75ce===_0x4962('0x9f')||_0x5c75ce===_0x4962('0xa0')||_0x5c75ce==='MemoAttributeMetadata'||_0x5c75ce===_0x4962('0xa1')||_0x5c75ce===_0x4962('0xa2')||_0x5c75ce===_0x4962('0xa3')||_0x5c75ce==='StateAttributeMetadata'||_0x5c75ce===_0x4962('0xa4')){_0x5b790c[_0x4962('0x9c')](getInputList(_0xc6c01,_0x36b09e,_0x5c75ce,_0x56d373,_0x237f48[_0x4962('0x90')],_0x247fe2[_0x4962('0x90')],_0x35df38));}}});return Promise[_0x4962('0xa5')](_0x5b790c);})[_0x4962('0x10')](function(_0x2eead8){_0x3f484d=_0x2eead8[0x0];var _0x4d8e98=_0x3e5d6d[_0x4962('0x80')](_0x1e2c5a)[_0x4962('0x80')](_0x3f484d);var _0x2433b6={'count':_0x4d8e98[_0x4962('0x21')],'rows':_0x4d8e98};return _0x2433b6;})[_0x4962('0x10')](respondWithResult(_0x2080b2,null))[_0x4962('0x2e')](function(_0x339203){var _0x2b388d=_0x2f3d0c[_0x4962('0x1b')][_0x4962('0xa6')]?0x1f4:_0x339203['statusCode']||0x1f4;logger[_0x4962('0x13')](_0x339203[_0x4962('0x14')]);delete _0x339203[_0x4962('0x15')];if(_0x2b388d===0x191){_0x2b388d=0x190;}_0x2080b2[_0x4962('0x7')](_0x2b388d)['send'](_0x2f3d0c[_0x4962('0x1b')][_0x4962('0xa6')]?{'message':_0x4962('0xa7'),'statusCode':_0x339203[_0x4962('0xa8')]}:_0x339203);});};function getSelectList(_0x1049f8,_0x592e90,_0x52b237,_0x9ba348,_0x4be0c0,_0x30c642){var _0x41897c={'method':_0x4962('0xa9'),'uri':_0x1049f8+_0x4962('0x91')+_0x9ba348+_0x4962('0xaa')+_0x4be0c0+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0x4962('0xab'),'headers':{'Authorization':_0x4962('0x93')+_0x30c642,'If-None-Match':null,'OData-Version':_0x4962('0x8f')},'json':!![]};return rp(_0x41897c)[_0x4962('0x10')](function(_0x430058){var _0x189d78=[];var _0x1d0045=_0x430058[_0x4962('0xac')][_0x4962('0xad')];_0x1d0045[_0x4962('0x98')](function(_0x149ebf){_0x189d78['push']({'name':_0x149ebf[_0x4962('0xae')]['UserLocalizedLabel'][_0x4962('0xae')],'value':String(_0x149ebf[_0x4962('0xaf')])});});var _0x276998={'id':_0x592e90+'_'+_0x430058[_0x4962('0x97')],'name':_0x430058[_0x4962('0xb0')][_0x4962('0xb1')][_0x4962('0xae')],'custom':![],'options':_0x189d78};_0x52b237['push'](_0x276998);return _0x52b237;});}function getBooleanList(_0x5d425f,_0x8356af,_0x1d9540,_0x3a38b7,_0x28528b,_0x2f694f){var _0x113062={'method':_0x4962('0xa9'),'uri':_0x5d425f+'EntityDefinitions('+_0x3a38b7+')/Attributes('+_0x28528b+_0x4962('0xb2'),'headers':{'Authorization':_0x4962('0x93')+_0x2f694f,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x113062)['then'](function(_0x36ecc0){var _0x36918b=[];_0x36918b['push']({'name':_0x36ecc0['OptionSet'][_0x4962('0xb3')][_0x4962('0xae')][_0x4962('0xb1')][_0x4962('0xae')],'value':_0x4962('0xb4')},{'name':_0x36ecc0[_0x4962('0xac')][_0x4962('0xb5')][_0x4962('0xae')][_0x4962('0xb1')][_0x4962('0xae')],'value':_0x4962('0xb6')});var _0x1f12d1={'id':_0x8356af+'_'+_0x36ecc0[_0x4962('0x97')],'name':_0x36ecc0[_0x4962('0xb0')]['UserLocalizedLabel'][_0x4962('0xae')],'custom':![],'options':_0x36918b};_0x1d9540[_0x4962('0x9c')](_0x1f12d1);return _0x1d9540;});}function getInputList(_0x208410,_0x4e5faf,_0x4b7e4e,_0x2b4cee,_0x153b24,_0x3ef16d,_0x35b0b3){var _0x408954={'method':_0x4962('0xa9'),'uri':_0x208410+'EntityDefinitions('+_0x153b24+_0x4962('0xaa')+_0x3ef16d+_0x4962('0xb7')+_0x4b7e4e+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0x4962('0x93')+_0x35b0b3,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x408954)[_0x4962('0x10')](function(_0x185783){var _0x58b3f1={'id':_0x4e5faf+'_'+_0x185783[_0x4962('0x97')],'name':_0x185783[_0x4962('0xb0')][_0x4962('0xb1')]?_0x185783[_0x4962('0xb0')][_0x4962('0xb1')][_0x4962('0xae')]:_0x185783[_0x4962('0x97')],'custom':![],'options':[]};_0x2b4cee[_0x4962('0x9c')](_0x58b3f1);return _0x2b4cee;});} \ No newline at end of file +var _0xd661=['clientSecret','GET','Bearer\x20','4.0','value','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','forEach','@odata.type','substring','PicklistAttributeMetadata','MetadataId','isNil','BooleanAttributeMetadata','push','all','StringAttributeMetadata','DoubleAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','EntityNameAttributeMetadata','test','Wrong\x20credentials','statusCode','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','true','FalseOption','DisplayName',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','lodash','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','json','offset','undefined','limit','count','status','set','Content-Range','update','then','end','sendStatus','error','stack','name','send','index','map','Dynamics365Account','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','include','findAll','catch','show','find','create','body','destroy','params','rawAttributes','pick','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getSubjects','Descriptions','channel','Dynamics365Configuration','Dynamics365Field','slice','lastIndexOf','format','%s/api/data/v9.0/','getFields','ticketType','Incident','PhoneCall','title','description','subject','phonenumber','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyname','createdbyyominame','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','entityimage_timestamp','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','kbarticleidname','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','onholdtime','overriddencreatedon','owneridname','owneridtype','primarycontactidyominame','prioritycodename','productidname','resolvebykpiidname','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','concat','username','remoteUri','tenantId','clientId','modernAuthentication','CloudProvider','data5','data7','access_token','POST','https://login.microsoftonline.com/','/oauth2/token','password'];(function(_0x4823b1,_0x116d1d){var _0x3a154c=function(_0x4c030f){while(--_0x4c030f){_0x4823b1['push'](_0x4823b1['shift']());}};_0x3a154c(++_0x116d1d);}(_0xd661,0x197));var _0x1d66=function(_0x3ffdb8,_0x541588){_0x3ffdb8=_0x3ffdb8-0x0;var _0xd8ce96=_0xd661[_0x3ffdb8];return _0xd8ce96;};'use strict';var rp=require(_0x1d66('0x0'));var util=require('util');var _=require(_0x1d66('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0x1d66('0x2'))(_0x1d66('0x3'));var db=require(_0x1d66('0x4'))['db'];var integrations=require(_0x1d66('0x5'));function respondWithResult(_0x3bac7b,_0x40b2ea){_0x40b2ea=_0x40b2ea||0xc8;return function(_0x2d30f2){if(_0x2d30f2){return _0x3bac7b['status'](_0x40b2ea)[_0x1d66('0x6')](_0x2d30f2);}};}function respondWithFilteredResult(_0x4fad00,_0x180cac){return function(_0x46ecb7){if(_0x46ecb7){var _0x1d55ff=typeof _0x180cac[_0x1d66('0x7')]===_0x1d66('0x8')&&typeof _0x180cac[_0x1d66('0x9')]==='undefined';var _0x2a6a14=_0x46ecb7[_0x1d66('0xa')];var _0x54b57d=_0x1d55ff?0x0:_0x180cac[_0x1d66('0x7')];var _0x383bdb=_0x1d55ff?_0x46ecb7[_0x1d66('0xa')]:_0x180cac[_0x1d66('0x7')]+_0x180cac['limit'];var _0x3c88b9;if(_0x383bdb>=_0x2a6a14){_0x383bdb=_0x2a6a14;_0x3c88b9=0xc8;}else{_0x3c88b9=0xce;}_0x4fad00[_0x1d66('0xb')](_0x3c88b9);return _0x4fad00[_0x1d66('0xc')](_0x1d66('0xd'),_0x54b57d+'-'+_0x383bdb+'/'+_0x2a6a14)[_0x1d66('0x6')](_0x46ecb7);}return null;};}function saveUpdates(_0x166186){return function(_0x1e6e6c){if(_0x1e6e6c){return _0x1e6e6c[_0x1d66('0xe')](_0x166186)[_0x1d66('0xf')](function(_0x35748d){return _0x35748d;});}return null;};}function removeEntity(_0x4e1e16){return function(_0x225f05){if(_0x225f05){return _0x225f05['destroy']()[_0x1d66('0xf')](function(){_0x4e1e16[_0x1d66('0xb')](0xcc)[_0x1d66('0x10')]();});}};}function handleEntityNotFound(_0x12b885){return function(_0xc60d3e){if(!_0xc60d3e){_0x12b885[_0x1d66('0x11')](0x194);}return _0xc60d3e;};}function handleError(_0x5da8d3,_0x1262f8){_0x1262f8=_0x1262f8||0x1f4;return function(_0x15ddb6){logger[_0x1d66('0x12')](_0x15ddb6[_0x1d66('0x13')]);if(_0x15ddb6[_0x1d66('0x14')]){delete _0x15ddb6[_0x1d66('0x14')];}_0x5da8d3[_0x1d66('0xb')](_0x1262f8)[_0x1d66('0x15')](_0x15ddb6);};}exports[_0x1d66('0x16')]=function(_0x42f33d,_0x2c8f32){var _0x43ab8e={},_0x192f50={},_0x1e5fd8={'count':0x0,'rows':[]};var _0x23a5b0=_[_0x1d66('0x17')](db[_0x1d66('0x18')]['rawAttributes'],function(_0x3f65bd){return{'name':_0x3f65bd[_0x1d66('0x19')],'type':_0x3f65bd[_0x1d66('0x1a')][_0x1d66('0x1b')]};});_0x192f50[_0x1d66('0x1c')]=_[_0x1d66('0x17')](_0x23a5b0,'name');_0x192f50[_0x1d66('0x1d')]=_[_0x1d66('0x1e')](_0x42f33d['query']);_0x192f50[_0x1d66('0x1f')]=_[_0x1d66('0x20')](_0x192f50[_0x1d66('0x1c')],_0x192f50[_0x1d66('0x1d')]);_0x43ab8e[_0x1d66('0x21')]=_[_0x1d66('0x20')](_0x192f50[_0x1d66('0x1c')],qs[_0x1d66('0x22')](_0x42f33d[_0x1d66('0x1d')][_0x1d66('0x22')]));_0x43ab8e[_0x1d66('0x21')]=_0x43ab8e[_0x1d66('0x21')][_0x1d66('0x23')]?_0x43ab8e[_0x1d66('0x21')]:_0x192f50['model'];if(!_0x42f33d[_0x1d66('0x1d')][_0x1d66('0x24')](_0x1d66('0x25'))){_0x43ab8e[_0x1d66('0x9')]=qs[_0x1d66('0x9')](_0x42f33d['query'][_0x1d66('0x9')]);_0x43ab8e[_0x1d66('0x7')]=qs[_0x1d66('0x7')](_0x42f33d[_0x1d66('0x1d')][_0x1d66('0x7')]);}_0x43ab8e[_0x1d66('0x26')]=qs[_0x1d66('0x27')](_0x42f33d[_0x1d66('0x1d')][_0x1d66('0x27')]);_0x43ab8e[_0x1d66('0x28')]=qs[_0x1d66('0x1f')](_['pick'](_0x42f33d['query'],_0x192f50[_0x1d66('0x1f')]),_0x23a5b0);if(_0x42f33d['query']['filter']){_0x43ab8e[_0x1d66('0x28')]=_[_0x1d66('0x29')](_0x43ab8e['where'],{'$or':_[_0x1d66('0x17')](_0x23a5b0,function(_0x2428b1){if(_0x2428b1[_0x1d66('0x1a')]!==_0x1d66('0x2a')){var _0x35c14c={};_0x35c14c[_0x2428b1[_0x1d66('0x14')]]={'$like':'%'+_0x42f33d['query'][_0x1d66('0x2b')]+'%'};return _0x35c14c;}})});}_0x43ab8e=_[_0x1d66('0x29')]({},_0x43ab8e,_0x42f33d[_0x1d66('0x2c')]);var _0x21feba={'where':_0x43ab8e[_0x1d66('0x28')]};return db[_0x1d66('0x18')]['count'](_0x21feba)['then'](function(_0x1c0721){_0x1e5fd8[_0x1d66('0xa')]=_0x1c0721;if(_0x42f33d[_0x1d66('0x1d')]['includeAll']){_0x43ab8e[_0x1d66('0x2d')]=[{'all':!![]}];}return db['Dynamics365Account'][_0x1d66('0x2e')](_0x43ab8e);})[_0x1d66('0xf')](function(_0x498a82){_0x1e5fd8['rows']=_0x498a82;return _0x1e5fd8;})[_0x1d66('0xf')](respondWithFilteredResult(_0x2c8f32,_0x43ab8e))[_0x1d66('0x2f')](handleError(_0x2c8f32,null));};exports[_0x1d66('0x30')]=function(_0x35f79e,_0x3d4b79){var _0x4003df={'raw':![],'where':{'id':_0x35f79e['params']['id']}},_0x3da68d={};_0x3da68d[_0x1d66('0x1c')]=_[_0x1d66('0x1e')](db[_0x1d66('0x18')]['rawAttributes']);_0x3da68d[_0x1d66('0x1d')]=_[_0x1d66('0x1e')](_0x35f79e[_0x1d66('0x1d')]);_0x3da68d[_0x1d66('0x1f')]=_[_0x1d66('0x20')](_0x3da68d[_0x1d66('0x1c')],_0x3da68d[_0x1d66('0x1d')]);_0x4003df[_0x1d66('0x21')]=_['intersection'](_0x3da68d[_0x1d66('0x1c')],qs[_0x1d66('0x22')](_0x35f79e['query'][_0x1d66('0x22')]));_0x4003df[_0x1d66('0x21')]=_0x4003df[_0x1d66('0x21')][_0x1d66('0x23')]?_0x4003df[_0x1d66('0x21')]:_0x3da68d[_0x1d66('0x1c')];if(_0x35f79e[_0x1d66('0x1d')]['includeAll']){_0x4003df[_0x1d66('0x2d')]=[{'all':!![]}];}_0x4003df=_[_0x1d66('0x29')]({},_0x4003df,_0x35f79e[_0x1d66('0x2c')]);return db[_0x1d66('0x18')][_0x1d66('0x31')](_0x4003df)[_0x1d66('0xf')](handleEntityNotFound(_0x3d4b79,null))['then'](respondWithResult(_0x3d4b79,null))['catch'](handleError(_0x3d4b79,null));};exports[_0x1d66('0x32')]=function(_0x597adb,_0x59cd0b){return db[_0x1d66('0x18')]['create'](_0x597adb[_0x1d66('0x33')],{})['then'](respondWithResult(_0x59cd0b,0xc9))[_0x1d66('0x2f')](handleError(_0x59cd0b,null));};exports[_0x1d66('0xe')]=function(_0x479a4f,_0x30b3cb){if(_0x479a4f[_0x1d66('0x33')]['id']){delete _0x479a4f['body']['id'];}return db['Dynamics365Account'][_0x1d66('0x31')]({'where':{'id':_0x479a4f['params']['id']}})[_0x1d66('0xf')](handleEntityNotFound(_0x30b3cb,null))[_0x1d66('0xf')](saveUpdates(_0x479a4f[_0x1d66('0x33')],null))[_0x1d66('0xf')](respondWithResult(_0x30b3cb,null))[_0x1d66('0x2f')](handleError(_0x30b3cb,null));};exports[_0x1d66('0x34')]=function(_0x2d8cba,_0x307380){return db['Dynamics365Account'][_0x1d66('0x31')]({'where':{'id':_0x2d8cba[_0x1d66('0x35')]['id']}})[_0x1d66('0xf')](handleEntityNotFound(_0x307380,null))[_0x1d66('0xf')](removeEntity(_0x307380,null))['catch'](handleError(_0x307380,null));};exports['getConfigurations']=function(_0x48793e,_0x4d1017){var _0x444b8e={};var _0x434e7d={};var _0x5a18d7;var _0x358184;return db[_0x1d66('0x18')]['findOne']({'where':{'id':_0x48793e[_0x1d66('0x35')]['id']}})[_0x1d66('0xf')](handleEntityNotFound(_0x4d1017,null))['then'](function(_0x5a941c){if(_0x5a941c){_0x5a18d7=_0x5a941c;_0x434e7d[_0x1d66('0x1c')]=_[_0x1d66('0x1e')](db['Dynamics365Configuration'][_0x1d66('0x36')]);_0x434e7d[_0x1d66('0x1d')]=_['keys'](_0x48793e[_0x1d66('0x1d')]);_0x434e7d[_0x1d66('0x1f')]=_[_0x1d66('0x20')](_0x434e7d[_0x1d66('0x1c')],_0x434e7d[_0x1d66('0x1d')]);_0x444b8e[_0x1d66('0x21')]=_['intersection'](_0x434e7d[_0x1d66('0x1c')],qs[_0x1d66('0x22')](_0x48793e['query']['fields']));_0x444b8e[_0x1d66('0x21')]=_0x444b8e[_0x1d66('0x21')][_0x1d66('0x23')]?_0x444b8e['attributes']:_0x434e7d[_0x1d66('0x1c')];_0x444b8e[_0x1d66('0x26')]=qs[_0x1d66('0x27')](_0x48793e[_0x1d66('0x1d')]['sort']);_0x444b8e[_0x1d66('0x28')]=qs['filters'](_[_0x1d66('0x37')](_0x48793e['query'],_0x434e7d[_0x1d66('0x1f')]));if(_0x48793e[_0x1d66('0x1d')][_0x1d66('0x2b')]){_0x444b8e[_0x1d66('0x28')]=_[_0x1d66('0x29')](_0x444b8e[_0x1d66('0x28')],{'$or':_[_0x1d66('0x17')](_0x444b8e[_0x1d66('0x21')],function(_0x41d6e9){var _0x2d800c={};_0x2d800c[_0x41d6e9]={'$like':'%'+_0x48793e[_0x1d66('0x1d')]['filter']+'%'};return _0x2d800c;})});}_0x444b8e=_[_0x1d66('0x29')]({},_0x444b8e,_0x48793e[_0x1d66('0x2c')]);return _0x5a18d7[_0x1d66('0x38')](_0x444b8e);}})[_0x1d66('0xf')](function(_0x5794c0){if(_0x5794c0){_0x358184=_0x5794c0['length'];if(!_0x48793e[_0x1d66('0x1d')]['hasOwnProperty'](_0x1d66('0x25'))){_0x444b8e['limit']=qs['limit'](_0x48793e[_0x1d66('0x1d')]['limit']);_0x444b8e[_0x1d66('0x7')]=qs[_0x1d66('0x7')](_0x48793e['query']['offset']);}return _0x5a18d7['getConfigurations'](_0x444b8e);}})[_0x1d66('0xf')](function(_0x39cefd){if(_0x39cefd){return _0x39cefd?{'count':_0x358184,'rows':_0x39cefd}:null;}})[_0x1d66('0xf')](respondWithResult(_0x4d1017,null))[_0x1d66('0x2f')](handleError(_0x4d1017,null));};exports[_0x1d66('0x39')]=function(_0x7f4ef8,_0x50064d){if(_0x7f4ef8[_0x1d66('0x33')]['id']){delete _0x7f4ef8[_0x1d66('0x33')]['id'];}return db[_0x1d66('0x18')][_0x1d66('0x3a')]({'where':{'id':_0x7f4ef8['params']['id']}})[_0x1d66('0xf')](handleEntityNotFound(_0x50064d,null))[_0x1d66('0xf')](function(_0x1537d4){if(_0x1537d4){_0x7f4ef8['body'][_0x1d66('0x3b')]=_0x1537d4['id'];_0x7f4ef8[_0x1d66('0x33')][_0x1d66('0x3c')]=integrations[_0x1d66('0x3d')](_0x7f4ef8[_0x1d66('0x33')]['channel'],_0x7f4ef8[_0x1d66('0x33')][_0x1d66('0x1a')]);_0x7f4ef8['body'][_0x1d66('0x3e')]=integrations['getDescriptions'](_0x7f4ef8['body'][_0x1d66('0x3f')],_0x7f4ef8[_0x1d66('0x33')]['type']);return db[_0x1d66('0x40')]['create'](_0x7f4ef8[_0x1d66('0x33')],{'include':[{'model':db['Dynamics365Field'],'as':_0x1d66('0x3c')},{'model':db[_0x1d66('0x41')],'as':_0x1d66('0x3e')}]});}return null;})[_0x1d66('0xf')](respondWithResult(_0x50064d,null))[_0x1d66('0x2f')](handleError(_0x50064d,null));};function sanitizeRemoteUri(_0x44e3b1){var _0x37eccb=_0x44e3b1[_0x1d66('0x42')](-0x1);if(_0x37eccb==='/')return _0x44e3b1['substring'](0x0,_0x44e3b1[_0x1d66('0x43')](_0x37eccb));return _0x44e3b1;}function getWebApiUrl(_0x366a30){return util[_0x1d66('0x44')](_0x1d66('0x45'),_0x366a30);}exports[_0x1d66('0x46')]=function(_0x2698d6,_0x543f60){var _0x2fe3f8=_0x2698d6[_0x1d66('0x1d')][_0x1d66('0x47')];var _0x4915d3=_0x2fe3f8==='incident'?_0x1d66('0x48'):_0x1d66('0x49');var _0x3a8506='';var _0x32ff57='';var _0x435cb8='';var _0x484a22='';var _0xc00b78='';var _0x22123f='';var _0x54e896='';var _0x4efcfa='';var _0x19f20a=[_0x1d66('0x4a'),_0x1d66('0x4b'),'customerid','ownerid','caseorigincode',_0x1d66('0x4c'),_0x1d66('0x4d'),'regardingobjectid',_0x1d66('0x4e'),_0x1d66('0x4f')];var _0x123ece=[_0x1d66('0x50'),_0x1d66('0x51'),_0x1d66('0x52'),_0x1d66('0x53'),'contactidname','contactidyominame',_0x1d66('0x54'),_0x1d66('0x55'),_0x1d66('0x56'),'createdbyexternalpartyyominame',_0x1d66('0x57'),_0x1d66('0x58'),'createdon',_0x1d66('0x59'),_0x1d66('0x5a'),_0x1d66('0x5b'),_0x1d66('0x5c'),_0x1d66('0x5d'),'emailaddress','entitlementidname',_0x1d66('0x5e'),'entityimage_url',_0x1d66('0x5f'),_0x1d66('0x60'),_0x1d66('0x61'),_0x1d66('0x62'),_0x1d66('0x63'),'influencescore',_0x1d66('0x64'),'lastonholdtime',_0x1d66('0x65'),_0x1d66('0x66'),'modifiedbyexternalpartyyominame',_0x1d66('0x67'),_0x1d66('0x68'),_0x1d66('0x69'),_0x1d66('0x6a'),_0x1d66('0x6b'),_0x1d66('0x6c'),'msdyn_iotalertname','numberofchildincidents',_0x1d66('0x6d'),_0x1d66('0x6e'),_0x1d66('0x6f'),_0x1d66('0x70'),'owneridyominame','parentcaseidname','primarycontactidname',_0x1d66('0x71'),_0x1d66('0x72'),_0x1d66('0x73'),'productserialnumber','resolveby',_0x1d66('0x74'),'responseby',_0x1d66('0x75'),_0x1d66('0x76'),_0x1d66('0x77'),_0x1d66('0x78'),_0x1d66('0x79'),_0x1d66('0x7a'),_0x1d66('0x7b'),_0x1d66('0x7c'),'subjectidname','ticketnumber',_0x1d66('0x7d'),_0x1d66('0x7e'),_0x1d66('0x7f'),'utcconversiontimezonecode','versionnumber'];var _0x19a8ca=_0x19f20a[_0x1d66('0x80')](_0x123ece);return db[_0x1d66('0x18')][_0x1d66('0x3a')]({'where':{'id':_0x2698d6[_0x1d66('0x35')]['id']},'attributes':['id',_0x1d66('0x81'),'password',_0x1d66('0x82'),_0x1d66('0x83'),_0x1d66('0x84'),'clientSecret',_0x1d66('0x85')],'include':[{'model':db[_0x1d66('0x86')],'as':'CloudProvider','attributes':['id',_0x1d66('0x87'),_0x1d66('0x88')]}]})['then'](handleEntityNotFound(_0x543f60,null))[_0x1d66('0xf')](function(_0x4a246b){if(_0x4a246b){if(_0x4a246b['modernAuthentication']){_0x4a246b[_0x1d66('0x89')]=_0x4a246b[_0x1d66('0x86')][_0x1d66('0x87')];_0x4efcfa=sanitizeRemoteUri(_0x4a246b[_0x1d66('0x86')][_0x1d66('0x88')]);_0x54e896=getWebApiUrl(_0x4efcfa);return _0x4a246b;}_0x4efcfa=sanitizeRemoteUri(_0x4a246b[_0x1d66('0x82')]);_0x54e896=getWebApiUrl(_0x4efcfa);var _0x2660b6={'method':_0x1d66('0x8a'),'uri':_0x1d66('0x8b')+_0x4a246b['tenantId']+_0x1d66('0x8c'),'form':{'client_id':_0x4a246b[_0x1d66('0x84')],'resource':_0x4efcfa,'username':_0x4a246b[_0x1d66('0x81')],'password':_0x4a246b[_0x1d66('0x8d')],'grant_type':_0x1d66('0x8d'),'client_secret':_0x4a246b[_0x1d66('0x8e')]},'json':!![]};return rp(_0x2660b6);}})[_0x1d66('0xf')](function(_0xb5d0d8){_0x22123f=_0xb5d0d8[_0x1d66('0x89')];var _0x347a40={'method':_0x1d66('0x8f'),'uri':encodeURI(_0x54e896+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x4915d3+'\x27'),'headers':{'Authorization':_0x1d66('0x90')+_0x22123f,'If-None-Match':null,'OData-Version':_0x1d66('0x91')},'json':!![]};return rp(_0x347a40);})['then'](function(_0x597839){var _0x4d6d2c=_0x597839[_0x1d66('0x92')][0x0];var _0x1ced6a=_0x4d6d2c['MetadataId'];var _0xdd0964={'method':'GET','uri':_0x54e896+_0x1d66('0x93')+_0x1ced6a+_0x1d66('0x94'),'headers':{'Authorization':_0x1d66('0x90')+_0x22123f,'If-None-Match':null,'OData-Version':_0x1d66('0x91')},'json':!![]};return rp(_0xdd0964);})[_0x1d66('0xf')](function(_0x364121){_0x3a8506=_0x364121;_0x32ff57=_0x3a8506[_0x1d66('0x95')];_0x32ff57=_[_0x1d66('0x96')](_0x32ff57,function(_0x3679f2){return!_0x19a8ca[_0x1d66('0x97')](_0x3679f2[_0x1d66('0x98')]);});var _0x3ef5aa=[];var _0x496f4f=[];_0x32ff57[_0x1d66('0x99')](function(_0x38ca05){if(_0x38ca05[_0x1d66('0x9a')]){var _0x3c0043=_0x38ca05['@odata.type'][_0x1d66('0x9b')](_0x38ca05[_0x1d66('0x9a')][_0x1d66('0x43')]('.')+0x1);if(_0x3c0043===_0x1d66('0x9c')){_0x3ef5aa['push'](getSelectList(_0x54e896,_0x2fe3f8,_0x496f4f,_0x3a8506[_0x1d66('0x9d')],_0x38ca05[_0x1d66('0x9d')],_0x22123f));}}});return Promise['all'](_0x3ef5aa);})[_0x1d66('0xf')](function(_0x1de3b6){_0x435cb8=_0x1de3b6[0x0];var _0x111462=[];var _0x10f33c=[];_0x32ff57[_0x1d66('0x99')](function(_0x3304a3){if(!_[_0x1d66('0x9e')](_0x3304a3['@odata.type'])){var _0x327d45=_0x3304a3['@odata.type'][_0x1d66('0x9b')](_0x3304a3[_0x1d66('0x9a')][_0x1d66('0x43')]('.')+0x1);if(_0x327d45===_0x1d66('0x9f')){_0x111462[_0x1d66('0xa0')](getBooleanList(_0x54e896,_0x2fe3f8,_0x10f33c,_0x3a8506[_0x1d66('0x9d')],_0x3304a3[_0x1d66('0x9d')],_0x22123f));}}});return Promise[_0x1d66('0xa1')](_0x111462);})[_0x1d66('0xf')](function(_0x220ec7){_0x484a22=_0x220ec7[0x0];var _0x3e7d0c=[];var _0x5619d2=[];_0x32ff57[_0x1d66('0x99')](function(_0x22f54d){if(_0x22f54d[_0x1d66('0x9a')]){var _0x5a6eb0=_0x22f54d[_0x1d66('0x9a')][_0x1d66('0x9b')](_0x22f54d['@odata.type'][_0x1d66('0x43')]('.')+0x1);if(_0x5a6eb0===_0x1d66('0xa2')||_0x5a6eb0===_0x1d66('0xa3')||_0x5a6eb0==='BigIntAttributeMetadata'||_0x5a6eb0==='IntegerAttributeMetadata'||_0x5a6eb0===_0x1d66('0xa4')||_0x5a6eb0===_0x1d66('0xa5')||_0x5a6eb0==='StatusAttributeMetadata'||_0x5a6eb0===_0x1d66('0xa6')||_0x5a6eb0==='StateAttributeMetadata'||_0x5a6eb0==='DecimalAttributeMetadata'){_0x3e7d0c[_0x1d66('0xa0')](getInputList(_0x54e896,_0x2fe3f8,_0x5a6eb0,_0x5619d2,_0x3a8506[_0x1d66('0x9d')],_0x22f54d[_0x1d66('0x9d')],_0x22123f));}}});return Promise[_0x1d66('0xa1')](_0x3e7d0c);})[_0x1d66('0xf')](function(_0xcca6b7){_0xc00b78=_0xcca6b7[0x0];var _0x4aad46=_0x435cb8[_0x1d66('0x80')](_0x484a22)['concat'](_0xc00b78);var _0x528872={'count':_0x4aad46['length'],'rows':_0x4aad46};return _0x528872;})[_0x1d66('0xf')](respondWithResult(_0x543f60,null))[_0x1d66('0x2f')](function(_0x5505d1){var _0x24252c=_0x2698d6[_0x1d66('0x1d')][_0x1d66('0xa7')]?0x1f4:_0x5505d1['statusCode']||0x1f4;logger[_0x1d66('0x12')](_0x5505d1[_0x1d66('0x13')]);delete _0x5505d1[_0x1d66('0x14')];if(_0x24252c===0x191){_0x24252c=0x190;}_0x543f60[_0x1d66('0xb')](_0x24252c)[_0x1d66('0x15')](_0x2698d6[_0x1d66('0x1d')][_0x1d66('0xa7')]?{'message':_0x1d66('0xa8'),'statusCode':_0x5505d1[_0x1d66('0xa9')]}:_0x5505d1);});};function getSelectList(_0x2781ec,_0x5e1560,_0xa772f7,_0x40891f,_0x3f2d5e,_0xed6166){var _0x145873={'method':_0x1d66('0x8f'),'uri':_0x2781ec+_0x1d66('0x93')+_0x40891f+')/Attributes('+_0x3f2d5e+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0x1d66('0xaa'),'headers':{'Authorization':_0x1d66('0x90')+_0xed6166,'If-None-Match':null,'OData-Version':_0x1d66('0x91')},'json':!![]};return rp(_0x145873)[_0x1d66('0xf')](function(_0x30c69c){var _0x66055e=[];var _0x6d069e=_0x30c69c[_0x1d66('0xab')][_0x1d66('0xac')];_0x6d069e[_0x1d66('0x99')](function(_0x110e3c){_0x66055e[_0x1d66('0xa0')]({'name':_0x110e3c[_0x1d66('0xad')][_0x1d66('0xae')]['Label'],'value':String(_0x110e3c[_0x1d66('0xaf')])});});var _0x13bb7f={'id':_0x5e1560+'_'+_0x30c69c[_0x1d66('0x98')],'name':_0x30c69c['DisplayName']['UserLocalizedLabel']['Label'],'custom':![],'options':_0x66055e};_0xa772f7[_0x1d66('0xa0')](_0x13bb7f);return _0xa772f7;});}function getBooleanList(_0x58f502,_0x24fded,_0x287712,_0x3ceb93,_0x194322,_0xe10bc2){var _0x57951e={'method':_0x1d66('0x8f'),'uri':_0x58f502+'EntityDefinitions('+_0x3ceb93+_0x1d66('0xb0')+_0x194322+_0x1d66('0xb1'),'headers':{'Authorization':_0x1d66('0x90')+_0xe10bc2,'If-None-Match':null,'OData-Version':_0x1d66('0x91')},'json':!![]};return rp(_0x57951e)[_0x1d66('0xf')](function(_0x421a3d){var _0x4761f7=[];_0x4761f7['push']({'name':_0x421a3d[_0x1d66('0xab')]['TrueOption']['Label'][_0x1d66('0xae')]['Label'],'value':_0x1d66('0xb2')},{'name':_0x421a3d['OptionSet'][_0x1d66('0xb3')]['Label'][_0x1d66('0xae')][_0x1d66('0xad')],'value':'false'});var _0xc2f117={'id':_0x24fded+'_'+_0x421a3d[_0x1d66('0x98')],'name':_0x421a3d[_0x1d66('0xb4')][_0x1d66('0xae')][_0x1d66('0xad')],'custom':![],'options':_0x4761f7};_0x287712[_0x1d66('0xa0')](_0xc2f117);return _0x287712;});}function getInputList(_0x52e908,_0x6a5c3,_0x1fabfa,_0x579fbf,_0x4a16d9,_0x1f6bba,_0x7c006f){var _0x344154={'method':'GET','uri':_0x52e908+_0x1d66('0x93')+_0x4a16d9+')/Attributes('+_0x1f6bba+_0x1d66('0xb5')+_0x1fabfa+_0x1d66('0xb6'),'headers':{'Authorization':_0x1d66('0x90')+_0x7c006f,'If-None-Match':null,'OData-Version':_0x1d66('0x91')},'json':!![]};return rp(_0x344154)[_0x1d66('0xf')](function(_0xe7ac40){var _0x436a9d={'id':_0x6a5c3+'_'+_0xe7ac40[_0x1d66('0x98')],'name':_0xe7ac40[_0x1d66('0xb4')][_0x1d66('0xae')]?_0xe7ac40[_0x1d66('0xb4')][_0x1d66('0xae')][_0x1d66('0xad')]:_0xe7ac40[_0x1d66('0x98')],'custom':![],'options':[]};_0x579fbf['push'](_0x436a9d);return _0x579fbf;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index e9d5156..9c0d783 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 _0xa9e0=['define','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x1d9368,_0x42c263){var _0x364a1d=function(_0x24798e){while(--_0x24798e){_0x1d9368['push'](_0x1d9368['shift']());}};_0x364a1d(++_0x42c263);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'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 +var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts','lodash','util'];(function(_0x3c9f3a,_0xd7401a){var _0x4f30c7=function(_0x489016){while(--_0x489016){_0x3c9f3a['push'](_0x3c9f3a['shift']());}};_0x4f30c7(++_0xd7401a);}(_0xe706,0xa3));var _0x6e70=function(_0x273e2c,_0x2acc61){_0x273e2c=_0x273e2c-0x0;var _0x11928d=_0xe706[_0x273e2c];return _0x11928d;};'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'));var integrations=require(_0x6e70('0xa'));module[_0x6e70('0xb')]=function(_0x4381d1,_0x36357b){return _0x4381d1[_0x6e70('0xc')](_0x6e70('0xd'),attributes,{'tableName':_0x6e70('0xe'),'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 1622cb6..387f0a9 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 _0x8f05=['findAll','options','raw','where','attributes','limit','map','model','include','GetDynamics365Account','catch','ShowDynamics365Account','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','Dynamics365Account'];(function(_0x4d973c,_0x36153f){var _0x33d408=function(_0x4e1fc3){while(--_0x4e1fc3){_0x4d973c['push'](_0x4d973c['shift']());}};_0x33d408(++_0x36153f);}(_0x8f05,0xa9));var _0x58f0=function(_0x5c54c6,_0x592383){_0x5c54c6=_0x5c54c6-0x0;var _0x56b332=_0x8f05[_0x5c54c6];return _0x56b332;};'use strict';var _=require(_0x58f0('0x0'));var util=require(_0x58f0('0x1'));var moment=require(_0x58f0('0x2'));var BPromise=require(_0x58f0('0x3'));var rs=require(_0x58f0('0x4'));var fs=require('fs');var Redis=require(_0x58f0('0x5'));var db=require(_0x58f0('0x6'))['db'];var utils=require(_0x58f0('0x7'));var logger=require(_0x58f0('0x8'))(_0x58f0('0x9'));var config=require(_0x58f0('0xa'));var jayson=require(_0x58f0('0xb'));var client=jayson[_0x58f0('0xc')][_0x58f0('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x42b76f,_0x493cf1,_0x81e276){return new BPromise(function(_0x3c7f9c,_0x4b7f0e){return client['request'](_0x42b76f,_0x81e276)[_0x58f0('0xe')](function(_0x583e04){logger['info'](_0x58f0('0xf'),_0x493cf1,_0x58f0('0x10'));logger[_0x58f0('0x11')](_0x58f0('0x12'),_0x493cf1,'request\x20sent',JSON[_0x58f0('0x13')](_0x583e04));if(_0x583e04[_0x58f0('0x14')]){if(_0x583e04['error'][_0x58f0('0x15')]===0x1f4){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x493cf1,_0x583e04['error']['message']);return _0x4b7f0e(_0x583e04[_0x58f0('0x14')][_0x58f0('0x16')]);}logger[_0x58f0('0x14')](_0x58f0('0xf'),_0x493cf1,_0x583e04[_0x58f0('0x14')][_0x58f0('0x16')]);return _0x3c7f9c(_0x583e04['error'][_0x58f0('0x16')]);}else{logger[_0x58f0('0x17')](_0x58f0('0xf'),_0x493cf1,_0x58f0('0x10'));_0x3c7f9c(_0x583e04[_0x58f0('0x18')][_0x58f0('0x16')]);}})['catch'](function(_0xbc14b0){logger[_0x58f0('0x14')]('Dynamics365Account,\x20%s,\x20%s',_0x493cf1,_0xbc14b0);_0x4b7f0e(_0xbc14b0);});});}exports['GetDynamics365Account']=function(_0x5e4b41){var _0x30c173=this;return new Promise(function(_0x34ee6e,_0x3edbf7){return db[_0x58f0('0x19')][_0x58f0('0x1a')]({'raw':_0x5e4b41[_0x58f0('0x1b')]?_0x5e4b41[_0x58f0('0x1b')][_0x58f0('0x1c')]===undefined?!![]:![]:!![],'where':_0x5e4b41[_0x58f0('0x1b')]?_0x5e4b41['options'][_0x58f0('0x1d')]||null:null,'attributes':_0x5e4b41['options']?_0x5e4b41[_0x58f0('0x1b')][_0x58f0('0x1e')]||null:null,'limit':_0x5e4b41[_0x58f0('0x1b')]?_0x5e4b41[_0x58f0('0x1b')][_0x58f0('0x1f')]||null:null,'include':_0x5e4b41[_0x58f0('0x1b')]?_0x5e4b41['options']['include']?_[_0x58f0('0x20')](_0x5e4b41['options']['include'],function(_0x39759c){return{'model':db[_0x39759c[_0x58f0('0x21')]],'as':_0x39759c['as'],'attributes':_0x39759c[_0x58f0('0x1e')],'include':_0x39759c[_0x58f0('0x22')]?_[_0x58f0('0x20')](_0x39759c['include'],function(_0x2bf3cc){return{'model':db[_0x2bf3cc[_0x58f0('0x21')]],'as':_0x2bf3cc['as'],'attributes':_0x2bf3cc[_0x58f0('0x1e')],'include':_0x2bf3cc[_0x58f0('0x22')]?_['map'](_0x2bf3cc[_0x58f0('0x22')],function(_0x2f6d73){return{'model':db[_0x2f6d73['model']],'as':_0x2f6d73['as'],'attributes':_0x2f6d73[_0x58f0('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x58f0('0xe')](function(_0x7063d7){logger[_0x58f0('0x17')](_0x58f0('0x23'),_0x5e4b41);logger[_0x58f0('0x11')](_0x58f0('0x23'),_0x5e4b41,JSON[_0x58f0('0x13')](_0x7063d7));_0x34ee6e(_0x7063d7);})[_0x58f0('0x24')](function(_0x3817c6){logger[_0x58f0('0x14')](_0x58f0('0x23'),_0x3817c6[_0x58f0('0x16')],_0x5e4b41);_0x3edbf7(_0x30c173[_0x58f0('0x14')](0x1f4,_0x3817c6['message']));});});};exports[_0x58f0('0x25')]=function(_0x36d05b){var _0x57ab3f=this;return new Promise(function(_0x7b2f8c,_0x125864){return db['Dynamics365Account'][_0x58f0('0x26')]({'raw':_0x36d05b[_0x58f0('0x1b')]?_0x36d05b[_0x58f0('0x1b')][_0x58f0('0x1c')]===undefined?!![]:![]:!![],'where':_0x36d05b['options']?_0x36d05b[_0x58f0('0x1b')][_0x58f0('0x1d')]||null:null,'attributes':_0x36d05b['options']?_0x36d05b[_0x58f0('0x1b')][_0x58f0('0x1e')]||null:null,'include':_0x36d05b[_0x58f0('0x1b')]?_0x36d05b['options'][_0x58f0('0x22')]?_['map'](_0x36d05b[_0x58f0('0x1b')]['include'],function(_0x4dcb6f){return{'model':db[_0x4dcb6f[_0x58f0('0x21')]],'as':_0x4dcb6f['as'],'attributes':_0x4dcb6f['attributes'],'include':_0x4dcb6f[_0x58f0('0x22')]?_[_0x58f0('0x20')](_0x4dcb6f[_0x58f0('0x22')],function(_0x376813){return{'model':db[_0x376813['model']],'as':_0x376813['as'],'attributes':_0x376813[_0x58f0('0x1e')],'include':_0x376813[_0x58f0('0x22')]?_[_0x58f0('0x20')](_0x376813[_0x58f0('0x22')],function(_0x13de2d){return{'model':db[_0x13de2d[_0x58f0('0x21')]],'as':_0x13de2d['as'],'attributes':_0x13de2d['attributes']};}):[]};}):[]};}):[]:[]})[_0x58f0('0xe')](function(_0x1a0f34){logger[_0x58f0('0x17')](_0x58f0('0x25'),_0x36d05b);logger[_0x58f0('0x11')]('ShowDynamics365Account',_0x36d05b,JSON[_0x58f0('0x13')](_0x1a0f34));_0x7b2f8c(_0x1a0f34);})[_0x58f0('0x24')](function(_0x1a87b4){logger[_0x58f0('0x14')](_0x58f0('0x25'),_0x1a87b4['message'],_0x36d05b);_0x125864(_0x57ab3f[_0x58f0('0x14')](0x1f4,_0x1a87b4[_0x58f0('0x16')]));});});}; \ No newline at end of file +var _0x226c=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetDynamics365Account','findAll','options','raw','where','attributes','limit','include','map','model','Dynamics365Account','find','ShowDynamics365Account','lodash','bluebird'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x226c,0x1d2));var _0xc226=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x226c[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xc226('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc226('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc226('0x2'))['db'];var utils=require(_0xc226('0x3'));var logger=require(_0xc226('0x4'))(_0xc226('0x5'));var config=require(_0xc226('0x6'));var jayson=require(_0xc226('0x7'));var client=jayson[_0xc226('0x8')][_0xc226('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2047ab,_0x22b8ae,_0x7d981d){return new BPromise(function(_0x50cc11,_0x5d548b){return client[_0xc226('0xa')](_0x2047ab,_0x7d981d)[_0xc226('0xb')](function(_0x3f3c11){logger[_0xc226('0xc')](_0xc226('0xd'),_0x22b8ae,_0xc226('0xe'));logger[_0xc226('0xf')](_0xc226('0x10'),_0x22b8ae,'request\x20sent',JSON[_0xc226('0x11')](_0x3f3c11));if(_0x3f3c11['error']){if(_0x3f3c11[_0xc226('0x12')][_0xc226('0x13')]===0x1f4){logger[_0xc226('0x12')](_0xc226('0xd'),_0x22b8ae,_0x3f3c11[_0xc226('0x12')][_0xc226('0x14')]);return _0x5d548b(_0x3f3c11[_0xc226('0x12')][_0xc226('0x14')]);}logger[_0xc226('0x12')]('Dynamics365Account,\x20%s,\x20%s',_0x22b8ae,_0x3f3c11[_0xc226('0x12')][_0xc226('0x14')]);return _0x50cc11(_0x3f3c11[_0xc226('0x12')][_0xc226('0x14')]);}else{logger[_0xc226('0xc')]('Dynamics365Account,\x20%s,\x20%s',_0x22b8ae,_0xc226('0xe'));_0x50cc11(_0x3f3c11[_0xc226('0x15')][_0xc226('0x14')]);}})[_0xc226('0x16')](function(_0x1f7c9d){logger[_0xc226('0x12')](_0xc226('0xd'),_0x22b8ae,_0x1f7c9d);_0x5d548b(_0x1f7c9d);});});}exports[_0xc226('0x17')]=function(_0x17e51){var _0x515374=this;return new Promise(function(_0x1c5d18,_0x5da973){return db['Dynamics365Account'][_0xc226('0x18')]({'raw':_0x17e51[_0xc226('0x19')]?_0x17e51[_0xc226('0x19')][_0xc226('0x1a')]===undefined?!![]:![]:!![],'where':_0x17e51[_0xc226('0x19')]?_0x17e51[_0xc226('0x19')][_0xc226('0x1b')]||null:null,'attributes':_0x17e51[_0xc226('0x19')]?_0x17e51[_0xc226('0x19')][_0xc226('0x1c')]||null:null,'limit':_0x17e51[_0xc226('0x19')]?_0x17e51[_0xc226('0x19')][_0xc226('0x1d')]||null:null,'include':_0x17e51[_0xc226('0x19')]?_0x17e51[_0xc226('0x19')][_0xc226('0x1e')]?_[_0xc226('0x1f')](_0x17e51[_0xc226('0x19')]['include'],function(_0x141db9){return{'model':db[_0x141db9[_0xc226('0x20')]],'as':_0x141db9['as'],'attributes':_0x141db9[_0xc226('0x1c')],'include':_0x141db9[_0xc226('0x1e')]?_[_0xc226('0x1f')](_0x141db9[_0xc226('0x1e')],function(_0x256cbe){return{'model':db[_0x256cbe[_0xc226('0x20')]],'as':_0x256cbe['as'],'attributes':_0x256cbe['attributes'],'include':_0x256cbe['include']?_[_0xc226('0x1f')](_0x256cbe['include'],function(_0x1f8fa6){return{'model':db[_0x1f8fa6['model']],'as':_0x1f8fa6['as'],'attributes':_0x1f8fa6[_0xc226('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xc226('0xb')](function(_0x2a9aad){logger['info']('GetDynamics365Account',_0x17e51);logger[_0xc226('0xf')]('GetDynamics365Account',_0x17e51,JSON['stringify'](_0x2a9aad));_0x1c5d18(_0x2a9aad);})['catch'](function(_0x540328){logger[_0xc226('0x12')](_0xc226('0x17'),_0x540328['message'],_0x17e51);_0x5da973(_0x515374[_0xc226('0x12')](0x1f4,_0x540328[_0xc226('0x14')]));});});};exports['ShowDynamics365Account']=function(_0x30bbe3){var _0x4d3683=this;return new Promise(function(_0x484156,_0x3ffa36){return db[_0xc226('0x21')][_0xc226('0x22')]({'raw':_0x30bbe3['options']?_0x30bbe3[_0xc226('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x30bbe3[_0xc226('0x19')]?_0x30bbe3['options']['where']||null:null,'attributes':_0x30bbe3[_0xc226('0x19')]?_0x30bbe3[_0xc226('0x19')][_0xc226('0x1c')]||null:null,'include':_0x30bbe3[_0xc226('0x19')]?_0x30bbe3[_0xc226('0x19')]['include']?_[_0xc226('0x1f')](_0x30bbe3[_0xc226('0x19')]['include'],function(_0xb3ccc7){return{'model':db[_0xb3ccc7['model']],'as':_0xb3ccc7['as'],'attributes':_0xb3ccc7['attributes'],'include':_0xb3ccc7[_0xc226('0x1e')]?_[_0xc226('0x1f')](_0xb3ccc7[_0xc226('0x1e')],function(_0x5ad81f){return{'model':db[_0x5ad81f['model']],'as':_0x5ad81f['as'],'attributes':_0x5ad81f['attributes'],'include':_0x5ad81f[_0xc226('0x1e')]?_['map'](_0x5ad81f[_0xc226('0x1e')],function(_0x185e8c){return{'model':db[_0x185e8c[_0xc226('0x20')]],'as':_0x185e8c['as'],'attributes':_0x185e8c['attributes']};}):[]};}):[]};}):[]:[]})[_0xc226('0xb')](function(_0x15c267){logger[_0xc226('0xc')](_0xc226('0x23'),_0x30bbe3);logger[_0xc226('0xf')](_0xc226('0x23'),_0x30bbe3,JSON[_0xc226('0x11')](_0x15c267));_0x484156(_0x15c267);})[_0xc226('0x16')](function(_0xeadc78){logger[_0xc226('0x12')](_0xc226('0x23'),_0xeadc78['message'],_0x30bbe3);_0x3ffa36(_0x4d3683[_0xc226('0x12')](0x1f4,_0xeadc78[_0xc226('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index fd19231..4469672 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 _0xbe75=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/descriptions','post','create','put','update','delete','exports','multer','path','connect-timeout','express','Router'];(function(_0x18eefc,_0x1c6b18){var _0x1f4d41=function(_0x5b65b6){while(--_0x5b65b6){_0x18eefc['push'](_0x18eefc['shift']());}};_0x1f4d41(++_0x1c6b18);}(_0xbe75,0x193));var _0x5be7=function(_0x5226e6,_0x27cb4a){_0x5226e6=_0x5226e6-0x0;var _0x505afa=_0xbe75[_0x5226e6];return _0x505afa;};'use strict';var multer=require(_0x5be7('0x0'));var util=require('util');var path=require(_0x5be7('0x1'));var timeout=require(_0x5be7('0x2'));var express=require(_0x5be7('0x3'));var router=express[_0x5be7('0x4')]();var fs_extra=require(_0x5be7('0x5'));var auth=require(_0x5be7('0x6'));var interaction=require(_0x5be7('0x7'));var config=require(_0x5be7('0x8'));var controller=require(_0x5be7('0x9'));router[_0x5be7('0xa')]('/',auth[_0x5be7('0xb')](),controller[_0x5be7('0xc')]);router[_0x5be7('0xa')](_0x5be7('0xd'),auth[_0x5be7('0xb')](),controller[_0x5be7('0xe')]);router[_0x5be7('0xa')](_0x5be7('0xf'),auth[_0x5be7('0xb')](),controller[_0x5be7('0x10')]);router['get']('/:id/subjects',auth[_0x5be7('0xb')](),controller['getSubjects']);router['get'](_0x5be7('0x11'),auth[_0x5be7('0xb')](),controller['getDescriptions']);router[_0x5be7('0x12')]('/',auth['isAuthenticated'](),controller[_0x5be7('0x13')]);router[_0x5be7('0x14')](_0x5be7('0xd'),auth[_0x5be7('0xb')](),controller[_0x5be7('0x15')]);router[_0x5be7('0x16')](_0x5be7('0xd'),auth[_0x5be7('0xb')](),controller['destroy']);module[_0x5be7('0x17')]=router; \ No newline at end of file +var _0x56fe=['/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','create','/:id','delete','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','isAuthenticated','index','get','show'];(function(_0x3fc95e,_0x5b9ec3){var _0x1a4eab=function(_0x340bf3){while(--_0x340bf3){_0x3fc95e['push'](_0x3fc95e['shift']());}};_0x1a4eab(++_0x5b9ec3);}(_0x56fe,0xe4));var _0xe56f=function(_0x2eda24,_0x14757b){_0x2eda24=_0x2eda24-0x0;var _0x1ef80c=_0x56fe[_0x2eda24];return _0x1ef80c;};'use strict';var multer=require(_0xe56f('0x0'));var util=require(_0xe56f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe56f('0x2'));var router=express[_0xe56f('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe56f('0x4'));var interaction=require(_0xe56f('0x5'));var config=require(_0xe56f('0x6'));var controller=require(_0xe56f('0x7'));router['get']('/',auth[_0xe56f('0x8')](),controller[_0xe56f('0x9')]);router[_0xe56f('0xa')]('/:id',auth[_0xe56f('0x8')](),controller[_0xe56f('0xb')]);router[_0xe56f('0xa')](_0xe56f('0xc'),auth['isAuthenticated'](),controller[_0xe56f('0xd')]);router[_0xe56f('0xa')](_0xe56f('0xe'),auth[_0xe56f('0x8')](),controller['getSubjects']);router[_0xe56f('0xa')](_0xe56f('0xf'),auth[_0xe56f('0x8')](),controller[_0xe56f('0x10')]);router['post']('/',auth[_0xe56f('0x8')](),controller[_0xe56f('0x11')]);router['put'](_0xe56f('0x12'),auth[_0xe56f('0x8')](),controller['update']);router[_0xe56f('0x13')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 0d99ce5..c0eb25e 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 _0xd419=['exports','STRING','ENUM','phonecall','incident','contact','sequelize'];(function(_0x2cf6f1,_0x5234db){var _0x3476cf=function(_0x4e545c){while(--_0x4e545c){_0x2cf6f1['push'](_0x2cf6f1['shift']());}};_0x3476cf(++_0x5234db);}(_0xd419,0x195));var _0x9d41=function(_0x3c1ca7,_0x264ab5){_0x3c1ca7=_0x3c1ca7-0x0;var _0x2f7e2f=_0xd419[_0x3c1ca7];return _0x2f7e2f;};'use strict';var Sequelize=require(_0x9d41('0x0'));module[_0x9d41('0x1')]={'name':{'type':Sequelize[_0x9d41('0x2')]},'description':{'type':Sequelize[_0x9d41('0x2')]},'ticketType':{'type':Sequelize[_0x9d41('0x3')]('incident',_0x9d41('0x4')),'defaultValue':_0x9d41('0x5')},'moduleCreate':{'type':Sequelize[_0x9d41('0x3')]('contact','nothing'),'defaultValue':_0x9d41('0x6'),'allowNull':![]}}; \ No newline at end of file +var _0x547c=['sequelize','exports','STRING','incident','phonecall','contact'];(function(_0x465d34,_0x3f778e){var _0x26d2c2=function(_0x6ea02b){while(--_0x6ea02b){_0x465d34['push'](_0x465d34['shift']());}};_0x26d2c2(++_0x3f778e);}(_0x547c,0xa8));var _0xc547=function(_0x4adfb2,_0x128843){_0x4adfb2=_0x4adfb2-0x0;var _0x4dea05=_0x547c[_0x4adfb2];return _0x4dea05;};'use strict';var Sequelize=require(_0xc547('0x0'));module[_0xc547('0x1')]={'name':{'type':Sequelize[_0xc547('0x2')]},'description':{'type':Sequelize[_0xc547('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0xc547('0x3'),_0xc547('0x4')),'defaultValue':_0xc547('0x3')},'moduleCreate':{'type':Sequelize['ENUM'](_0xc547('0x5'),'nothing'),'defaultValue':_0xc547('0x5'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index f5e8599..7aef628 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 _0x67cc=['findOne','Dynamics365Field','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','index','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','model','length','find','create','body','getFields'];(function(_0x319914,_0x1c2676){var _0x576c22=function(_0x29a3d5){while(--_0x29a3d5){_0x319914['push'](_0x319914['shift']());}};_0x576c22(++_0x1c2676);}(_0x67cc,0xa5));var _0xc67c=function(_0x2cde2a,_0x4325c4){_0x2cde2a=_0x2cde2a-0x0;var _0x110f55=_0x67cc[_0x2cde2a];return _0x110f55;};'use strict';var emlformat=require(_0xc67c('0x0'));var rimraf=require(_0xc67c('0x1'));var zipdir=require(_0xc67c('0x2'));var jsonpatch=require(_0xc67c('0x3'));var rp=require(_0xc67c('0x4'));var moment=require(_0xc67c('0x5'));var BPromise=require(_0xc67c('0x6'));var Mustache=require('mustache');var util=require(_0xc67c('0x7'));var path=require('path');var sox=require(_0xc67c('0x8'));var csv=require(_0xc67c('0x9'));var ejs=require(_0xc67c('0xa'));var fs=require('fs');var fs_extra=require(_0xc67c('0xb'));var _=require(_0xc67c('0xc'));var squel=require(_0xc67c('0xd'));var crypto=require('crypto');var jsforce=require(_0xc67c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc67c('0x9'));var querystring=require(_0xc67c('0xf'));var Papa=require(_0xc67c('0x10'));var Redis=require(_0xc67c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xc67c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc67c('0x13'));var logger=require(_0xc67c('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xc67c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xc67c('0x16'))['db'];function respondWithStatusCode(_0x50dddc,_0x2e3ff6){_0x2e3ff6=_0x2e3ff6||0xcc;return function(_0x246f02){if(_0x246f02){return _0x50dddc[_0xc67c('0x17')](_0x2e3ff6);}return _0x50dddc['status'](_0x2e3ff6)['end']();};}function respondWithResult(_0xcbde6c,_0x510c06){_0x510c06=_0x510c06||0xc8;return function(_0x156c91){if(_0x156c91){return _0xcbde6c[_0xc67c('0x18')](_0x510c06)['json'](_0x156c91);}};}function respondWithFilteredResult(_0x49a3bd,_0x3b65b6){return function(_0x27cef4){if(_0x27cef4){var _0x5e925c=typeof _0x3b65b6[_0xc67c('0x19')]===_0xc67c('0x1a')&&typeof _0x3b65b6[_0xc67c('0x1b')]==='undefined';var _0x3c82a9=_0x27cef4[_0xc67c('0x1c')];var _0x5a3440=_0x5e925c?0x0:_0x3b65b6['offset'];var _0x18ac03=_0x5e925c?_0x27cef4[_0xc67c('0x1c')]:_0x3b65b6[_0xc67c('0x19')]+_0x3b65b6['limit'];var _0x2449d9;if(_0x18ac03>=_0x3c82a9){_0x18ac03=_0x3c82a9;_0x2449d9=0xc8;}else{_0x2449d9=0xce;}_0x49a3bd[_0xc67c('0x18')](_0x2449d9);return _0x49a3bd[_0xc67c('0x1d')](_0xc67c('0x1e'),_0x5a3440+'-'+_0x18ac03+'/'+_0x3c82a9)[_0xc67c('0x1f')](_0x27cef4);}return null;};}function patchUpdates(_0x1c5cb2){return function(_0xe89b4f){try{jsonpatch[_0xc67c('0x20')](_0xe89b4f,_0x1c5cb2,!![]);}catch(_0x4eeec9){return BPromise[_0xc67c('0x21')](_0x4eeec9);}return _0xe89b4f[_0xc67c('0x22')]();};}function saveUpdates(_0x11a67e,_0x37c3cd){return function(_0x32bb3f){if(_0x32bb3f){return _0x32bb3f[_0xc67c('0x23')](_0x11a67e)[_0xc67c('0x24')](function(_0x4d47a2){return _0x4d47a2;});}return null;};}function removeEntity(_0x5acfe2,_0x2908f0){return function(_0x43a165){if(_0x43a165){return _0x43a165[_0xc67c('0x25')]()[_0xc67c('0x24')](function(){_0x5acfe2[_0xc67c('0x18')](0xcc)[_0xc67c('0x26')]();});}};}function handleEntityNotFound(_0x275d4b,_0x482d5c){return function(_0x2cc38b){if(!_0x2cc38b){_0x275d4b[_0xc67c('0x17')](0x194);}return _0x2cc38b;};}function handleError(_0x2ad71c,_0x5e2a2a){_0x5e2a2a=_0x5e2a2a||0x1f4;return function(_0x5ac9ad){logger[_0xc67c('0x27')](_0x5ac9ad[_0xc67c('0x28')]);if(_0x5ac9ad[_0xc67c('0x29')]){delete _0x5ac9ad[_0xc67c('0x29')];}_0x2ad71c[_0xc67c('0x18')](_0x5e2a2a)['send'](_0x5ac9ad);};}exports[_0xc67c('0x2a')]=function(_0x540f65,_0x4f1419){var _0x5a7351={},_0x26eeb5={},_0x3f3a6a={'count':0x0,'rows':[]};var _0x6248d1=_[_0xc67c('0x2b')](db[_0xc67c('0x2c')][_0xc67c('0x2d')],function(_0x41b45b){return{'name':_0x41b45b[_0xc67c('0x2e')],'type':_0x41b45b[_0xc67c('0x2f')][_0xc67c('0x30')]};});_0x26eeb5['model']=_[_0xc67c('0x2b')](_0x6248d1,_0xc67c('0x29'));_0x26eeb5[_0xc67c('0x31')]=_[_0xc67c('0x32')](_0x540f65[_0xc67c('0x31')]);_0x26eeb5[_0xc67c('0x33')]=_[_0xc67c('0x34')](_0x26eeb5['model'],_0x26eeb5[_0xc67c('0x31')]);_0x5a7351[_0xc67c('0x35')]=_[_0xc67c('0x34')](_0x26eeb5['model'],qs[_0xc67c('0x36')](_0x540f65[_0xc67c('0x31')][_0xc67c('0x36')]));_0x5a7351[_0xc67c('0x35')]=_0x5a7351[_0xc67c('0x35')]['length']?_0x5a7351[_0xc67c('0x35')]:_0x26eeb5['model'];if(!_0x540f65['query']['hasOwnProperty'](_0xc67c('0x37'))){_0x5a7351[_0xc67c('0x1b')]=qs[_0xc67c('0x1b')](_0x540f65[_0xc67c('0x31')]['limit']);_0x5a7351[_0xc67c('0x19')]=qs[_0xc67c('0x19')](_0x540f65[_0xc67c('0x31')]['offset']);}_0x5a7351[_0xc67c('0x38')]=qs[_0xc67c('0x39')](_0x540f65[_0xc67c('0x31')][_0xc67c('0x39')]);_0x5a7351[_0xc67c('0x3a')]=qs[_0xc67c('0x33')](_[_0xc67c('0x3b')](_0x540f65[_0xc67c('0x31')],_0x26eeb5[_0xc67c('0x33')]),_0x6248d1);if(_0x540f65[_0xc67c('0x31')][_0xc67c('0x3c')]){_0x5a7351[_0xc67c('0x3a')]=_['merge'](_0x5a7351[_0xc67c('0x3a')],{'$or':_['map'](_0x6248d1,function(_0x414b9f){if(_0x414b9f[_0xc67c('0x2f')]!=='VIRTUAL'){var _0x2a7415={};_0x2a7415[_0x414b9f['name']]={'$like':'%'+_0x540f65['query'][_0xc67c('0x3c')]+'%'};return _0x2a7415;}})});}_0x5a7351=_[_0xc67c('0x3d')]({},_0x5a7351,_0x540f65[_0xc67c('0x3e')]);var _0x2458c7={'where':_0x5a7351[_0xc67c('0x3a')]};return db[_0xc67c('0x2c')][_0xc67c('0x1c')](_0x2458c7)['then'](function(_0x4f0f7f){_0x3f3a6a[_0xc67c('0x1c')]=_0x4f0f7f;if(_0x540f65[_0xc67c('0x31')][_0xc67c('0x3f')]){_0x5a7351[_0xc67c('0x40')]=[{'all':!![]}];}return db[_0xc67c('0x2c')]['findAll'](_0x5a7351);})[_0xc67c('0x24')](function(_0x48b4cb){_0x3f3a6a[_0xc67c('0x41')]=_0x48b4cb;return _0x3f3a6a;})[_0xc67c('0x24')](respondWithFilteredResult(_0x4f1419,_0x5a7351))[_0xc67c('0x42')](handleError(_0x4f1419,null));};exports[_0xc67c('0x43')]=function(_0x3d6f6b,_0x32b687){var _0x4ac696={'raw':![],'where':{'id':_0x3d6f6b[_0xc67c('0x44')]['id']}},_0x1ea1e2={};_0x1ea1e2[_0xc67c('0x45')]=_[_0xc67c('0x32')](db['Dynamics365Configuration'][_0xc67c('0x2d')]);_0x1ea1e2[_0xc67c('0x31')]=_[_0xc67c('0x32')](_0x3d6f6b[_0xc67c('0x31')]);_0x1ea1e2['filters']=_[_0xc67c('0x34')](_0x1ea1e2['model'],_0x1ea1e2['query']);_0x4ac696[_0xc67c('0x35')]=_[_0xc67c('0x34')](_0x1ea1e2['model'],qs[_0xc67c('0x36')](_0x3d6f6b[_0xc67c('0x31')][_0xc67c('0x36')]));_0x4ac696[_0xc67c('0x35')]=_0x4ac696['attributes'][_0xc67c('0x46')]?_0x4ac696[_0xc67c('0x35')]:_0x1ea1e2[_0xc67c('0x45')];if(_0x3d6f6b[_0xc67c('0x31')]['includeAll']){_0x4ac696['include']=[{'all':!![]}];}_0x4ac696=_[_0xc67c('0x3d')]({},_0x4ac696,_0x3d6f6b[_0xc67c('0x3e')]);return db[_0xc67c('0x2c')][_0xc67c('0x47')](_0x4ac696)[_0xc67c('0x24')](handleEntityNotFound(_0x32b687,null))[_0xc67c('0x24')](respondWithResult(_0x32b687,null))['catch'](handleError(_0x32b687,null));};exports[_0xc67c('0x48')]=function(_0x36e726,_0x2bc9b6){return db['Dynamics365Configuration'][_0xc67c('0x48')](_0x36e726[_0xc67c('0x49')],{})['then'](respondWithResult(_0x2bc9b6,0xc9))[_0xc67c('0x42')](handleError(_0x2bc9b6,null));};exports['update']=function(_0x4daa93,_0x18d277){if(_0x4daa93[_0xc67c('0x49')]['id']){delete _0x4daa93[_0xc67c('0x49')]['id'];}return db[_0xc67c('0x2c')]['find']({'where':{'id':_0x4daa93[_0xc67c('0x44')]['id']}})[_0xc67c('0x24')](handleEntityNotFound(_0x18d277,null))[_0xc67c('0x24')](saveUpdates(_0x4daa93[_0xc67c('0x49')],null))[_0xc67c('0x24')](respondWithResult(_0x18d277,null))[_0xc67c('0x42')](handleError(_0x18d277,null));};exports['destroy']=function(_0x5211ca,_0x2d4566){return db['Dynamics365Configuration'][_0xc67c('0x47')]({'where':{'id':_0x5211ca['params']['id']}})['then'](handleEntityNotFound(_0x2d4566,null))[_0xc67c('0x24')](removeEntity(_0x2d4566,null))[_0xc67c('0x42')](handleError(_0x2d4566,null));};exports[_0xc67c('0x4a')]=function(_0x51884c,_0x38c510,_0x51b6cb){var _0x1b5e7a={};var _0x4680b0={};var _0x390c36;var _0x337831;return db[_0xc67c('0x2c')][_0xc67c('0x4b')]({'where':{'id':_0x51884c[_0xc67c('0x44')]['id']}})['then'](handleEntityNotFound(_0x38c510,null))['then'](function(_0x571376){if(_0x571376){_0x390c36=_0x571376;_0x4680b0['model']=_['keys'](db[_0xc67c('0x4c')][_0xc67c('0x2d')]);_0x4680b0['query']=_['keys'](_0x51884c[_0xc67c('0x31')]);_0x4680b0[_0xc67c('0x33')]=_[_0xc67c('0x34')](_0x4680b0[_0xc67c('0x45')],_0x4680b0[_0xc67c('0x31')]);_0x1b5e7a[_0xc67c('0x35')]=_[_0xc67c('0x34')](_0x4680b0[_0xc67c('0x45')],qs[_0xc67c('0x36')](_0x51884c[_0xc67c('0x31')][_0xc67c('0x36')]));_0x1b5e7a['attributes']=_0x1b5e7a['attributes'][_0xc67c('0x46')]?_0x1b5e7a['attributes']:_0x4680b0[_0xc67c('0x45')];_0x1b5e7a[_0xc67c('0x38')]=qs[_0xc67c('0x39')](_0x51884c[_0xc67c('0x31')]['sort']);_0x1b5e7a['where']=qs[_0xc67c('0x33')](_[_0xc67c('0x3b')](_0x51884c[_0xc67c('0x31')],_0x4680b0[_0xc67c('0x33')]));if(_0x51884c[_0xc67c('0x31')][_0xc67c('0x3c')]){_0x1b5e7a[_0xc67c('0x3a')]=_['merge'](_0x1b5e7a[_0xc67c('0x3a')],{'$or':_[_0xc67c('0x2b')](_0x1b5e7a[_0xc67c('0x35')],function(_0x48c4d4){var _0x5dd23e={};_0x5dd23e[_0x48c4d4]={'$like':'%'+_0x51884c[_0xc67c('0x31')][_0xc67c('0x3c')]+'%'};return _0x5dd23e;})});}_0x1b5e7a=_[_0xc67c('0x3d')]({},_0x1b5e7a,_0x51884c['options']);return _0x390c36[_0xc67c('0x4a')](_0x1b5e7a);}})[_0xc67c('0x24')](function(_0xa4c74f){if(_0xa4c74f){_0x337831=_0xa4c74f[_0xc67c('0x46')];if(!_0x51884c[_0xc67c('0x31')][_0xc67c('0x4d')](_0xc67c('0x37'))){_0x1b5e7a[_0xc67c('0x1b')]=qs[_0xc67c('0x1b')](_0x51884c[_0xc67c('0x31')]['limit']);_0x1b5e7a[_0xc67c('0x19')]=qs[_0xc67c('0x19')](_0x51884c[_0xc67c('0x31')]['offset']);}return _0x390c36[_0xc67c('0x4a')](_0x1b5e7a);}})[_0xc67c('0x24')](function(_0x1adb46){if(_0x1adb46){return _0x1adb46?{'count':_0x337831,'rows':_0x1adb46}:null;}})['then'](respondWithResult(_0x38c510,null))[_0xc67c('0x42')](handleError(_0x38c510,null));};exports[_0xc67c('0x4e')]=function(_0x58729e,_0x52b619,_0x5557cf){var _0x22d4c7={};var _0x51eb19={};var _0x4f92c7;var _0x2a5e53;return db[_0xc67c('0x2c')]['findOne']({'where':{'id':_0x58729e['params']['id']}})[_0xc67c('0x24')](handleEntityNotFound(_0x52b619,null))[_0xc67c('0x24')](function(_0x9a437b){if(_0x9a437b){_0x4f92c7=_0x9a437b;_0x51eb19[_0xc67c('0x45')]=_[_0xc67c('0x32')](db[_0xc67c('0x4c')]['rawAttributes']);_0x51eb19[_0xc67c('0x31')]=_[_0xc67c('0x32')](_0x58729e[_0xc67c('0x31')]);_0x51eb19[_0xc67c('0x33')]=_[_0xc67c('0x34')](_0x51eb19[_0xc67c('0x45')],_0x51eb19[_0xc67c('0x31')]);_0x22d4c7[_0xc67c('0x35')]=_['intersection'](_0x51eb19[_0xc67c('0x45')],qs[_0xc67c('0x36')](_0x58729e[_0xc67c('0x31')][_0xc67c('0x36')]));_0x22d4c7[_0xc67c('0x35')]=_0x22d4c7['attributes'][_0xc67c('0x46')]?_0x22d4c7[_0xc67c('0x35')]:_0x51eb19[_0xc67c('0x45')];_0x22d4c7[_0xc67c('0x38')]=qs[_0xc67c('0x39')](_0x58729e[_0xc67c('0x31')][_0xc67c('0x39')]);_0x22d4c7[_0xc67c('0x3a')]=qs[_0xc67c('0x33')](_[_0xc67c('0x3b')](_0x58729e['query'],_0x51eb19[_0xc67c('0x33')]));if(_0x58729e[_0xc67c('0x31')][_0xc67c('0x3c')]){_0x22d4c7['where']=_[_0xc67c('0x3d')](_0x22d4c7[_0xc67c('0x3a')],{'$or':_[_0xc67c('0x2b')](_0x22d4c7[_0xc67c('0x35')],function(_0xf56e5){var _0x384e81={};_0x384e81[_0xf56e5]={'$like':'%'+_0x58729e['query']['filter']+'%'};return _0x384e81;})});}_0x22d4c7=_[_0xc67c('0x3d')]({},_0x22d4c7,_0x58729e[_0xc67c('0x3e')]);return _0x4f92c7['getSubjects'](_0x22d4c7);}})[_0xc67c('0x24')](function(_0x30158e){if(_0x30158e){_0x2a5e53=_0x30158e['length'];if(!_0x58729e['query'][_0xc67c('0x4d')]('nolimit')){_0x22d4c7['limit']=qs[_0xc67c('0x1b')](_0x58729e[_0xc67c('0x31')]['limit']);_0x22d4c7['offset']=qs[_0xc67c('0x19')](_0x58729e[_0xc67c('0x31')][_0xc67c('0x19')]);}return _0x4f92c7['getSubjects'](_0x22d4c7);}})[_0xc67c('0x24')](function(_0x49a2c9){if(_0x49a2c9){return _0x49a2c9?{'count':_0x2a5e53,'rows':_0x49a2c9}:null;}})['then'](respondWithResult(_0x52b619,null))[_0xc67c('0x42')](handleError(_0x52b619,null));};exports[_0xc67c('0x4f')]=function(_0xa9e1c7,_0x40f670,_0x53766a){var _0x2d5fa0={};var _0x861af={};var _0x4e1b94;var _0x297c6d;return db[_0xc67c('0x2c')][_0xc67c('0x4b')]({'where':{'id':_0xa9e1c7[_0xc67c('0x44')]['id']}})[_0xc67c('0x24')](handleEntityNotFound(_0x40f670,null))[_0xc67c('0x24')](function(_0x4d6b78){if(_0x4d6b78){_0x4e1b94=_0x4d6b78;_0x861af[_0xc67c('0x45')]=_['keys'](db[_0xc67c('0x4c')][_0xc67c('0x2d')]);_0x861af[_0xc67c('0x31')]=_[_0xc67c('0x32')](_0xa9e1c7[_0xc67c('0x31')]);_0x861af[_0xc67c('0x33')]=_['intersection'](_0x861af['model'],_0x861af[_0xc67c('0x31')]);_0x2d5fa0['attributes']=_[_0xc67c('0x34')](_0x861af[_0xc67c('0x45')],qs['fields'](_0xa9e1c7[_0xc67c('0x31')][_0xc67c('0x36')]));_0x2d5fa0[_0xc67c('0x35')]=_0x2d5fa0[_0xc67c('0x35')][_0xc67c('0x46')]?_0x2d5fa0[_0xc67c('0x35')]:_0x861af['model'];_0x2d5fa0['order']=qs[_0xc67c('0x39')](_0xa9e1c7['query'][_0xc67c('0x39')]);_0x2d5fa0[_0xc67c('0x3a')]=qs[_0xc67c('0x33')](_[_0xc67c('0x3b')](_0xa9e1c7[_0xc67c('0x31')],_0x861af['filters']));if(_0xa9e1c7['query'][_0xc67c('0x3c')]){_0x2d5fa0[_0xc67c('0x3a')]=_[_0xc67c('0x3d')](_0x2d5fa0[_0xc67c('0x3a')],{'$or':_['map'](_0x2d5fa0[_0xc67c('0x35')],function(_0x23bc2d){var _0x3f5424={};_0x3f5424[_0x23bc2d]={'$like':'%'+_0xa9e1c7[_0xc67c('0x31')][_0xc67c('0x3c')]+'%'};return _0x3f5424;})});}_0x2d5fa0=_[_0xc67c('0x3d')]({},_0x2d5fa0,_0xa9e1c7[_0xc67c('0x3e')]);return _0x4e1b94['getDescriptions'](_0x2d5fa0);}})[_0xc67c('0x24')](function(_0x20fb74){if(_0x20fb74){_0x297c6d=_0x20fb74[_0xc67c('0x46')];if(!_0xa9e1c7[_0xc67c('0x31')][_0xc67c('0x4d')](_0xc67c('0x37'))){_0x2d5fa0[_0xc67c('0x1b')]=qs['limit'](_0xa9e1c7[_0xc67c('0x31')][_0xc67c('0x1b')]);_0x2d5fa0[_0xc67c('0x19')]=qs[_0xc67c('0x19')](_0xa9e1c7['query'][_0xc67c('0x19')]);}return _0x4e1b94[_0xc67c('0x4f')](_0x2d5fa0);}})['then'](function(_0x246086){if(_0x246086){return _0x246086?{'count':_0x297c6d,'rows':_0x246086}:null;}})[_0xc67c('0x24')](respondWithResult(_0x40f670,null))[_0xc67c('0x42')](handleError(_0x40f670,null));}; \ No newline at end of file +var _0xfb83=['destroy','getFields','findOne','Dynamics365Field','order','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','mustache','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','findAll','rows','show','keys','includeAll','include','find','create','body','params','catch'];(function(_0xa2bad9,_0x1a33db){var _0x1ebcf0=function(_0x5102e3){while(--_0x5102e3){_0xa2bad9['push'](_0xa2bad9['shift']());}};_0x1ebcf0(++_0x1a33db);}(_0xfb83,0x1e1));var _0x3fb8=function(_0x1b1a3b,_0x52a88a){_0x1b1a3b=_0x1b1a3b-0x0;var _0x385347=_0xfb83[_0x1b1a3b];return _0x385347;};'use strict';var emlformat=require(_0x3fb8('0x0'));var rimraf=require(_0x3fb8('0x1'));var zipdir=require(_0x3fb8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3fb8('0x3'));var moment=require(_0x3fb8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3fb8('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3fb8('0x6'));var fs=require('fs');var fs_extra=require(_0x3fb8('0x7'));var _=require(_0x3fb8('0x8'));var squel=require('squel');var crypto=require(_0x3fb8('0x9'));var jsforce=require(_0x3fb8('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x3fb8('0xb'));var querystring=require(_0x3fb8('0xc'));var Papa=require(_0x3fb8('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3fb8('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3fb8('0xf'))(_0x3fb8('0x10'));var utils=require('../../config/utils');var config=require(_0x3fb8('0x11'));var licenseUtil=require(_0x3fb8('0x12'));var db=require(_0x3fb8('0x13'))['db'];function respondWithStatusCode(_0x268b63,_0x54db43){_0x54db43=_0x54db43||0xcc;return function(_0x6bf8eb){if(_0x6bf8eb){return _0x268b63[_0x3fb8('0x14')](_0x54db43);}return _0x268b63[_0x3fb8('0x15')](_0x54db43)['end']();};}function respondWithResult(_0x5f4dad,_0x288464){_0x288464=_0x288464||0xc8;return function(_0x3724c5){if(_0x3724c5){return _0x5f4dad['status'](_0x288464)[_0x3fb8('0x16')](_0x3724c5);}};}function respondWithFilteredResult(_0x15eb0c,_0x3f9d40){return function(_0x1ca41b){if(_0x1ca41b){var _0xc05a50=typeof _0x3f9d40[_0x3fb8('0x17')]===_0x3fb8('0x18')&&typeof _0x3f9d40[_0x3fb8('0x19')]===_0x3fb8('0x18');var _0xb529fd=_0x1ca41b[_0x3fb8('0x1a')];var _0x450448=_0xc05a50?0x0:_0x3f9d40['offset'];var _0x2a819e=_0xc05a50?_0x1ca41b[_0x3fb8('0x1a')]:_0x3f9d40[_0x3fb8('0x17')]+_0x3f9d40[_0x3fb8('0x19')];var _0x1eae8e;if(_0x2a819e>=_0xb529fd){_0x2a819e=_0xb529fd;_0x1eae8e=0xc8;}else{_0x1eae8e=0xce;}_0x15eb0c[_0x3fb8('0x15')](_0x1eae8e);return _0x15eb0c[_0x3fb8('0x1b')](_0x3fb8('0x1c'),_0x450448+'-'+_0x2a819e+'/'+_0xb529fd)[_0x3fb8('0x16')](_0x1ca41b);}return null;};}function patchUpdates(_0x591dd4){return function(_0xc1c141){try{jsonpatch[_0x3fb8('0x1d')](_0xc1c141,_0x591dd4,!![]);}catch(_0x53cffa){return BPromise[_0x3fb8('0x1e')](_0x53cffa);}return _0xc1c141[_0x3fb8('0x1f')]();};}function saveUpdates(_0x1a6c1d,_0x434c82){return function(_0x292d37){if(_0x292d37){return _0x292d37[_0x3fb8('0x20')](_0x1a6c1d)[_0x3fb8('0x21')](function(_0x25d715){return _0x25d715;});}return null;};}function removeEntity(_0x317ae3,_0x3da697){return function(_0x45e19b){if(_0x45e19b){return _0x45e19b['destroy']()['then'](function(){_0x317ae3['status'](0xcc)[_0x3fb8('0x22')]();});}};}function handleEntityNotFound(_0x4baf83,_0x5764ff){return function(_0x494f5b){if(!_0x494f5b){_0x4baf83[_0x3fb8('0x14')](0x194);}return _0x494f5b;};}function handleError(_0x461800,_0x43efe6){_0x43efe6=_0x43efe6||0x1f4;return function(_0x8b860){logger[_0x3fb8('0x23')](_0x8b860[_0x3fb8('0x24')]);if(_0x8b860['name']){delete _0x8b860[_0x3fb8('0x25')];}_0x461800['status'](_0x43efe6)[_0x3fb8('0x26')](_0x8b860);};}exports[_0x3fb8('0x27')]=function(_0x2ec9ce,_0x5f464f){var _0x5c2a28={},_0x46e4c2={},_0x2f7a79={'count':0x0,'rows':[]};var _0x264164=_[_0x3fb8('0x28')](db[_0x3fb8('0x29')][_0x3fb8('0x2a')],function(_0x2b486c){return{'name':_0x2b486c[_0x3fb8('0x2b')],'type':_0x2b486c[_0x3fb8('0x2c')][_0x3fb8('0x2d')]};});_0x46e4c2[_0x3fb8('0x2e')]=_[_0x3fb8('0x28')](_0x264164,_0x3fb8('0x25'));_0x46e4c2['query']=_['keys'](_0x2ec9ce[_0x3fb8('0x2f')]);_0x46e4c2[_0x3fb8('0x30')]=_[_0x3fb8('0x31')](_0x46e4c2[_0x3fb8('0x2e')],_0x46e4c2[_0x3fb8('0x2f')]);_0x5c2a28[_0x3fb8('0x32')]=_[_0x3fb8('0x31')](_0x46e4c2[_0x3fb8('0x2e')],qs[_0x3fb8('0x33')](_0x2ec9ce[_0x3fb8('0x2f')][_0x3fb8('0x33')]));_0x5c2a28[_0x3fb8('0x32')]=_0x5c2a28[_0x3fb8('0x32')][_0x3fb8('0x34')]?_0x5c2a28['attributes']:_0x46e4c2[_0x3fb8('0x2e')];if(!_0x2ec9ce[_0x3fb8('0x2f')][_0x3fb8('0x35')](_0x3fb8('0x36'))){_0x5c2a28['limit']=qs[_0x3fb8('0x19')](_0x2ec9ce[_0x3fb8('0x2f')][_0x3fb8('0x19')]);_0x5c2a28['offset']=qs[_0x3fb8('0x17')](_0x2ec9ce[_0x3fb8('0x2f')][_0x3fb8('0x17')]);}_0x5c2a28['order']=qs[_0x3fb8('0x37')](_0x2ec9ce[_0x3fb8('0x2f')]['sort']);_0x5c2a28[_0x3fb8('0x38')]=qs[_0x3fb8('0x30')](_[_0x3fb8('0x39')](_0x2ec9ce[_0x3fb8('0x2f')],_0x46e4c2['filters']),_0x264164);if(_0x2ec9ce['query'][_0x3fb8('0x3a')]){_0x5c2a28[_0x3fb8('0x38')]=_[_0x3fb8('0x3b')](_0x5c2a28['where'],{'$or':_[_0x3fb8('0x28')](_0x264164,function(_0xb4ba09){if(_0xb4ba09[_0x3fb8('0x2c')]!=='VIRTUAL'){var _0x40d9a1={};_0x40d9a1[_0xb4ba09[_0x3fb8('0x25')]]={'$like':'%'+_0x2ec9ce[_0x3fb8('0x2f')][_0x3fb8('0x3a')]+'%'};return _0x40d9a1;}})});}_0x5c2a28=_['merge']({},_0x5c2a28,_0x2ec9ce[_0x3fb8('0x3c')]);var _0x5b56b3={'where':_0x5c2a28[_0x3fb8('0x38')]};return db['Dynamics365Configuration']['count'](_0x5b56b3)['then'](function(_0x4af9d0){_0x2f7a79[_0x3fb8('0x1a')]=_0x4af9d0;if(_0x2ec9ce[_0x3fb8('0x2f')]['includeAll']){_0x5c2a28['include']=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x3fb8('0x3d')](_0x5c2a28);})[_0x3fb8('0x21')](function(_0x271eaa){_0x2f7a79[_0x3fb8('0x3e')]=_0x271eaa;return _0x2f7a79;})[_0x3fb8('0x21')](respondWithFilteredResult(_0x5f464f,_0x5c2a28))['catch'](handleError(_0x5f464f,null));};exports[_0x3fb8('0x3f')]=function(_0xdca102,_0xf507dd){var _0x4ce356={'raw':![],'where':{'id':_0xdca102['params']['id']}},_0x5821f0={};_0x5821f0[_0x3fb8('0x2e')]=_[_0x3fb8('0x40')](db[_0x3fb8('0x29')][_0x3fb8('0x2a')]);_0x5821f0[_0x3fb8('0x2f')]=_[_0x3fb8('0x40')](_0xdca102[_0x3fb8('0x2f')]);_0x5821f0[_0x3fb8('0x30')]=_[_0x3fb8('0x31')](_0x5821f0['model'],_0x5821f0['query']);_0x4ce356[_0x3fb8('0x32')]=_[_0x3fb8('0x31')](_0x5821f0[_0x3fb8('0x2e')],qs[_0x3fb8('0x33')](_0xdca102[_0x3fb8('0x2f')][_0x3fb8('0x33')]));_0x4ce356[_0x3fb8('0x32')]=_0x4ce356[_0x3fb8('0x32')][_0x3fb8('0x34')]?_0x4ce356[_0x3fb8('0x32')]:_0x5821f0[_0x3fb8('0x2e')];if(_0xdca102[_0x3fb8('0x2f')][_0x3fb8('0x41')]){_0x4ce356[_0x3fb8('0x42')]=[{'all':!![]}];}_0x4ce356=_[_0x3fb8('0x3b')]({},_0x4ce356,_0xdca102[_0x3fb8('0x3c')]);return db[_0x3fb8('0x29')][_0x3fb8('0x43')](_0x4ce356)[_0x3fb8('0x21')](handleEntityNotFound(_0xf507dd,null))[_0x3fb8('0x21')](respondWithResult(_0xf507dd,null))['catch'](handleError(_0xf507dd,null));};exports[_0x3fb8('0x44')]=function(_0x18945f,_0x1a4829){return db[_0x3fb8('0x29')][_0x3fb8('0x44')](_0x18945f[_0x3fb8('0x45')],{})[_0x3fb8('0x21')](respondWithResult(_0x1a4829,0xc9))['catch'](handleError(_0x1a4829,null));};exports[_0x3fb8('0x20')]=function(_0xc4cc8d,_0x2b5c5c){if(_0xc4cc8d[_0x3fb8('0x45')]['id']){delete _0xc4cc8d[_0x3fb8('0x45')]['id'];}return db['Dynamics365Configuration']['find']({'where':{'id':_0xc4cc8d[_0x3fb8('0x46')]['id']}})['then'](handleEntityNotFound(_0x2b5c5c,null))[_0x3fb8('0x21')](saveUpdates(_0xc4cc8d[_0x3fb8('0x45')],null))['then'](respondWithResult(_0x2b5c5c,null))[_0x3fb8('0x47')](handleError(_0x2b5c5c,null));};exports[_0x3fb8('0x48')]=function(_0x2dfc85,_0x5a3fb5){return db[_0x3fb8('0x29')][_0x3fb8('0x43')]({'where':{'id':_0x2dfc85['params']['id']}})['then'](handleEntityNotFound(_0x5a3fb5,null))[_0x3fb8('0x21')](removeEntity(_0x5a3fb5,null))[_0x3fb8('0x47')](handleError(_0x5a3fb5,null));};exports[_0x3fb8('0x49')]=function(_0x296bc2,_0x4006b3,_0xa90b34){var _0x50a07b={};var _0x569afc={};var _0x401a3d;var _0x1a8405;return db[_0x3fb8('0x29')][_0x3fb8('0x4a')]({'where':{'id':_0x296bc2[_0x3fb8('0x46')]['id']}})[_0x3fb8('0x21')](handleEntityNotFound(_0x4006b3,null))['then'](function(_0x480005){if(_0x480005){_0x401a3d=_0x480005;_0x569afc[_0x3fb8('0x2e')]=_[_0x3fb8('0x40')](db[_0x3fb8('0x4b')]['rawAttributes']);_0x569afc[_0x3fb8('0x2f')]=_['keys'](_0x296bc2[_0x3fb8('0x2f')]);_0x569afc[_0x3fb8('0x30')]=_[_0x3fb8('0x31')](_0x569afc[_0x3fb8('0x2e')],_0x569afc[_0x3fb8('0x2f')]);_0x50a07b['attributes']=_['intersection'](_0x569afc['model'],qs['fields'](_0x296bc2[_0x3fb8('0x2f')][_0x3fb8('0x33')]));_0x50a07b['attributes']=_0x50a07b['attributes'][_0x3fb8('0x34')]?_0x50a07b[_0x3fb8('0x32')]:_0x569afc[_0x3fb8('0x2e')];_0x50a07b[_0x3fb8('0x4c')]=qs[_0x3fb8('0x37')](_0x296bc2['query']['sort']);_0x50a07b[_0x3fb8('0x38')]=qs['filters'](_[_0x3fb8('0x39')](_0x296bc2['query'],_0x569afc[_0x3fb8('0x30')]));if(_0x296bc2['query']['filter']){_0x50a07b[_0x3fb8('0x38')]=_[_0x3fb8('0x3b')](_0x50a07b['where'],{'$or':_[_0x3fb8('0x28')](_0x50a07b[_0x3fb8('0x32')],function(_0x33c3ca){var _0x4cedda={};_0x4cedda[_0x33c3ca]={'$like':'%'+_0x296bc2[_0x3fb8('0x2f')]['filter']+'%'};return _0x4cedda;})});}_0x50a07b=_[_0x3fb8('0x3b')]({},_0x50a07b,_0x296bc2['options']);return _0x401a3d['getFields'](_0x50a07b);}})[_0x3fb8('0x21')](function(_0x3fae21){if(_0x3fae21){_0x1a8405=_0x3fae21['length'];if(!_0x296bc2[_0x3fb8('0x2f')][_0x3fb8('0x35')](_0x3fb8('0x36'))){_0x50a07b[_0x3fb8('0x19')]=qs['limit'](_0x296bc2[_0x3fb8('0x2f')][_0x3fb8('0x19')]);_0x50a07b['offset']=qs[_0x3fb8('0x17')](_0x296bc2[_0x3fb8('0x2f')][_0x3fb8('0x17')]);}return _0x401a3d[_0x3fb8('0x49')](_0x50a07b);}})[_0x3fb8('0x21')](function(_0x91ed23){if(_0x91ed23){return _0x91ed23?{'count':_0x1a8405,'rows':_0x91ed23}:null;}})['then'](respondWithResult(_0x4006b3,null))[_0x3fb8('0x47')](handleError(_0x4006b3,null));};exports['getSubjects']=function(_0x56dd29,_0x4c433b,_0x395e01){var _0x142fad={};var _0xa8476e={};var _0x4994c4;var _0x536b09;return db[_0x3fb8('0x29')]['findOne']({'where':{'id':_0x56dd29[_0x3fb8('0x46')]['id']}})[_0x3fb8('0x21')](handleEntityNotFound(_0x4c433b,null))[_0x3fb8('0x21')](function(_0x15f467){if(_0x15f467){_0x4994c4=_0x15f467;_0xa8476e[_0x3fb8('0x2e')]=_[_0x3fb8('0x40')](db[_0x3fb8('0x4b')][_0x3fb8('0x2a')]);_0xa8476e[_0x3fb8('0x2f')]=_[_0x3fb8('0x40')](_0x56dd29[_0x3fb8('0x2f')]);_0xa8476e[_0x3fb8('0x30')]=_[_0x3fb8('0x31')](_0xa8476e[_0x3fb8('0x2e')],_0xa8476e[_0x3fb8('0x2f')]);_0x142fad['attributes']=_[_0x3fb8('0x31')](_0xa8476e[_0x3fb8('0x2e')],qs[_0x3fb8('0x33')](_0x56dd29[_0x3fb8('0x2f')][_0x3fb8('0x33')]));_0x142fad['attributes']=_0x142fad[_0x3fb8('0x32')][_0x3fb8('0x34')]?_0x142fad[_0x3fb8('0x32')]:_0xa8476e['model'];_0x142fad[_0x3fb8('0x4c')]=qs['sort'](_0x56dd29[_0x3fb8('0x2f')][_0x3fb8('0x37')]);_0x142fad[_0x3fb8('0x38')]=qs[_0x3fb8('0x30')](_[_0x3fb8('0x39')](_0x56dd29[_0x3fb8('0x2f')],_0xa8476e[_0x3fb8('0x30')]));if(_0x56dd29[_0x3fb8('0x2f')]['filter']){_0x142fad[_0x3fb8('0x38')]=_[_0x3fb8('0x3b')](_0x142fad['where'],{'$or':_[_0x3fb8('0x28')](_0x142fad[_0x3fb8('0x32')],function(_0x189551){var _0x3859c5={};_0x3859c5[_0x189551]={'$like':'%'+_0x56dd29['query'][_0x3fb8('0x3a')]+'%'};return _0x3859c5;})});}_0x142fad=_[_0x3fb8('0x3b')]({},_0x142fad,_0x56dd29[_0x3fb8('0x3c')]);return _0x4994c4['getSubjects'](_0x142fad);}})[_0x3fb8('0x21')](function(_0x2471b5){if(_0x2471b5){_0x536b09=_0x2471b5['length'];if(!_0x56dd29[_0x3fb8('0x2f')][_0x3fb8('0x35')](_0x3fb8('0x36'))){_0x142fad[_0x3fb8('0x19')]=qs[_0x3fb8('0x19')](_0x56dd29[_0x3fb8('0x2f')]['limit']);_0x142fad['offset']=qs[_0x3fb8('0x17')](_0x56dd29[_0x3fb8('0x2f')][_0x3fb8('0x17')]);}return _0x4994c4[_0x3fb8('0x4d')](_0x142fad);}})['then'](function(_0x53c149){if(_0x53c149){return _0x53c149?{'count':_0x536b09,'rows':_0x53c149}:null;}})[_0x3fb8('0x21')](respondWithResult(_0x4c433b,null))[_0x3fb8('0x47')](handleError(_0x4c433b,null));};exports['getDescriptions']=function(_0x4c2d36,_0x20547e,_0x100704){var _0x4b2e53={};var _0x587f39={};var _0xadc8d4;var _0x569c29;return db[_0x3fb8('0x29')][_0x3fb8('0x4a')]({'where':{'id':_0x4c2d36['params']['id']}})[_0x3fb8('0x21')](handleEntityNotFound(_0x20547e,null))[_0x3fb8('0x21')](function(_0x1e2f09){if(_0x1e2f09){_0xadc8d4=_0x1e2f09;_0x587f39[_0x3fb8('0x2e')]=_[_0x3fb8('0x40')](db[_0x3fb8('0x4b')][_0x3fb8('0x2a')]);_0x587f39[_0x3fb8('0x2f')]=_['keys'](_0x4c2d36[_0x3fb8('0x2f')]);_0x587f39['filters']=_['intersection'](_0x587f39['model'],_0x587f39[_0x3fb8('0x2f')]);_0x4b2e53[_0x3fb8('0x32')]=_[_0x3fb8('0x31')](_0x587f39[_0x3fb8('0x2e')],qs[_0x3fb8('0x33')](_0x4c2d36['query'][_0x3fb8('0x33')]));_0x4b2e53[_0x3fb8('0x32')]=_0x4b2e53[_0x3fb8('0x32')][_0x3fb8('0x34')]?_0x4b2e53[_0x3fb8('0x32')]:_0x587f39[_0x3fb8('0x2e')];_0x4b2e53[_0x3fb8('0x4c')]=qs[_0x3fb8('0x37')](_0x4c2d36['query'][_0x3fb8('0x37')]);_0x4b2e53[_0x3fb8('0x38')]=qs['filters'](_['pick'](_0x4c2d36[_0x3fb8('0x2f')],_0x587f39[_0x3fb8('0x30')]));if(_0x4c2d36['query'][_0x3fb8('0x3a')]){_0x4b2e53[_0x3fb8('0x38')]=_[_0x3fb8('0x3b')](_0x4b2e53['where'],{'$or':_[_0x3fb8('0x28')](_0x4b2e53['attributes'],function(_0x282100){var _0x328ac4={};_0x328ac4[_0x282100]={'$like':'%'+_0x4c2d36['query'][_0x3fb8('0x3a')]+'%'};return _0x328ac4;})});}_0x4b2e53=_[_0x3fb8('0x3b')]({},_0x4b2e53,_0x4c2d36['options']);return _0xadc8d4[_0x3fb8('0x4e')](_0x4b2e53);}})[_0x3fb8('0x21')](function(_0x5cce79){if(_0x5cce79){_0x569c29=_0x5cce79['length'];if(!_0x4c2d36['query'][_0x3fb8('0x35')]('nolimit')){_0x4b2e53[_0x3fb8('0x19')]=qs['limit'](_0x4c2d36[_0x3fb8('0x2f')]['limit']);_0x4b2e53[_0x3fb8('0x17')]=qs['offset'](_0x4c2d36[_0x3fb8('0x2f')][_0x3fb8('0x17')]);}return _0xadc8d4[_0x3fb8('0x4e')](_0x4b2e53);}})[_0x3fb8('0x21')](function(_0x4f4ac7){if(_0x4f4ac7){return _0x4f4ac7?{'count':_0x569c29,'rows':_0x4f4ac7}:null;}})[_0x3fb8('0x21')](respondWithResult(_0x20547e,null))[_0x3fb8('0x47')](handleError(_0x20547e,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index fbfae64..306d16b 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 _0xa41a=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','int_dynamics365_configurations','lodash','util','api'];(function(_0x155c7f,_0x464d57){var _0x4623e6=function(_0x2da3f3){while(--_0x2da3f3){_0x155c7f['push'](_0x155c7f['shift']());}};_0x4623e6(++_0x464d57);}(_0xa41a,0x6b));var _0xaa41=function(_0x2fca5e,_0x573f12){_0x2fca5e=_0x2fca5e-0x0;var _0x488038=_0xa41a[_0x2fca5e];return _0x488038;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var logger=require('../../config/logger')(_0xaa41('0x2'));var moment=require(_0xaa41('0x3'));var BPromise=require(_0xaa41('0x4'));var rp=require(_0xaa41('0x5'));var fs=require('fs');var path=require(_0xaa41('0x6'));var rimraf=require(_0xaa41('0x7'));var config=require(_0xaa41('0x8'));var attributes=require(_0xaa41('0x9'));module['exports']=function(_0x2122a0,_0x1ec9d4){return _0x2122a0['define']('Dynamics365Configuration',attributes,{'tableName':_0xaa41('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x5011a9,_0x43872e){var _0x1242af=function(_0x86c827){while(--_0x86c827){_0x5011a9['push'](_0x5011a9['shift']());}};_0x1242af(++_0x43872e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'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':'int_dynamics365_configurations','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 cf22087..70da16d 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 _0x341c=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2b0be0,_0x264a57){var _0x2d701e=function(_0x9a143a){while(--_0x9a143a){_0x2b0be0['push'](_0x2b0be0['shift']());}};_0x2d701e(++_0x264a57);}(_0x341c,0x191));var _0xc341=function(_0x223b71,_0x597bfb){_0x223b71=_0x223b71-0x0;var _0x4131e4=_0x341c[_0x223b71];return _0x4131e4;};'use strict';var _=require(_0xc341('0x0'));var util=require(_0xc341('0x1'));var moment=require(_0xc341('0x2'));var BPromise=require(_0xc341('0x3'));var rs=require(_0xc341('0x4'));var fs=require('fs');var Redis=require(_0xc341('0x5'));var db=require(_0xc341('0x6'))['db'];var utils=require(_0xc341('0x7'));var logger=require(_0xc341('0x8'))(_0xc341('0x9'));var config=require(_0xc341('0xa'));var jayson=require(_0xc341('0xb'));var client=jayson['client'][_0xc341('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x44a6da,_0x3978b9,_0x3bbcbb){return new BPromise(function(_0x2a21d3,_0x158f57){return client[_0xc341('0xd')](_0x44a6da,_0x3bbcbb)[_0xc341('0xe')](function(_0x5d923b){logger[_0xc341('0xf')](_0xc341('0x10'),_0x3978b9,_0xc341('0x11'));logger[_0xc341('0x12')](_0xc341('0x13'),_0x3978b9,'request\x20sent',JSON['stringify'](_0x5d923b));if(_0x5d923b[_0xc341('0x14')]){if(_0x5d923b[_0xc341('0x14')]['code']===0x1f4){logger[_0xc341('0x14')]('Dynamics365Configuration,\x20%s,\x20%s',_0x3978b9,_0x5d923b['error']['message']);return _0x158f57(_0x5d923b[_0xc341('0x14')][_0xc341('0x15')]);}logger[_0xc341('0x14')](_0xc341('0x10'),_0x3978b9,_0x5d923b[_0xc341('0x14')][_0xc341('0x15')]);return _0x2a21d3(_0x5d923b[_0xc341('0x14')][_0xc341('0x15')]);}else{logger[_0xc341('0xf')]('Dynamics365Configuration,\x20%s,\x20%s',_0x3978b9,_0xc341('0x11'));_0x2a21d3(_0x5d923b[_0xc341('0x16')]['message']);}})[_0xc341('0x17')](function(_0x2e53ae){logger['error'](_0xc341('0x10'),_0x3978b9,_0x2e53ae);_0x158f57(_0x2e53ae);});});} \ No newline at end of file +var _0x2c0f=['../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1c8f4a,_0x580179){var _0x133dda=function(_0x1031d2){while(--_0x1031d2){_0x1c8f4a['push'](_0x1c8f4a['shift']());}};_0x133dda(++_0x580179);}(_0x2c0f,0x1df));var _0xf2c0=function(_0xfedc72,_0x292f02){_0xfedc72=_0xfedc72-0x0;var _0x2c7c78=_0x2c0f[_0xfedc72];return _0x2c7c78;};'use strict';var _=require(_0xf2c0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf2c0('0x1'));var rs=require(_0xf2c0('0x2'));var fs=require('fs');var Redis=require(_0xf2c0('0x3'));var db=require(_0xf2c0('0x4'))['db'];var utils=require(_0xf2c0('0x5'));var logger=require('../../config/logger')(_0xf2c0('0x6'));var config=require(_0xf2c0('0x7'));var jayson=require(_0xf2c0('0x8'));var client=jayson['client'][_0xf2c0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x409f0e,_0x2129b9,_0x3573c9){return new BPromise(function(_0x5d43a9,_0x5505ae){return client[_0xf2c0('0xa')](_0x409f0e,_0x3573c9)[_0xf2c0('0xb')](function(_0xfaf94){logger[_0xf2c0('0xc')](_0xf2c0('0xd'),_0x2129b9,_0xf2c0('0xe'));logger['debug'](_0xf2c0('0xf'),_0x2129b9,_0xf2c0('0xe'),JSON[_0xf2c0('0x10')](_0xfaf94));if(_0xfaf94['error']){if(_0xfaf94[_0xf2c0('0x11')][_0xf2c0('0x12')]===0x1f4){logger[_0xf2c0('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x2129b9,_0xfaf94[_0xf2c0('0x11')][_0xf2c0('0x13')]);return _0x5505ae(_0xfaf94[_0xf2c0('0x11')][_0xf2c0('0x13')]);}logger['error'](_0xf2c0('0xd'),_0x2129b9,_0xfaf94[_0xf2c0('0x11')][_0xf2c0('0x13')]);return _0x5d43a9(_0xfaf94['error'][_0xf2c0('0x13')]);}else{logger[_0xf2c0('0xc')](_0xf2c0('0xd'),_0x2129b9,'request\x20sent');_0x5d43a9(_0xfaf94[_0xf2c0('0x14')][_0xf2c0('0x13')]);}})[_0xf2c0('0x15')](function(_0x5e6038){logger[_0xf2c0('0x11')](_0xf2c0('0xd'),_0x2129b9,_0x5e6038);_0x5505ae(_0x5e6038);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 1feec3c..de2fcac 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 _0x1d73=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','create','put','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x5389ad,_0x26c29a){var _0xd4cb9d=function(_0x3815b4){while(--_0x3815b4){_0x5389ad['push'](_0x5389ad['shift']());}};_0xd4cb9d(++_0x26c29a);}(_0x1d73,0xe1));var _0x31d7=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x1d73[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x31d7('0x0'));var util=require('util');var path=require(_0x31d7('0x1'));var timeout=require(_0x31d7('0x2'));var express=require(_0x31d7('0x3'));var router=express['Router']();var fs_extra=require(_0x31d7('0x4'));var auth=require(_0x31d7('0x5'));var interaction=require(_0x31d7('0x6'));var config=require(_0x31d7('0x7'));var controller=require(_0x31d7('0x8'));router[_0x31d7('0x9')]('/',auth[_0x31d7('0xa')](),controller[_0x31d7('0xb')]);router[_0x31d7('0x9')](_0x31d7('0xc'),auth[_0x31d7('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x31d7('0xd')]);router[_0x31d7('0xe')](_0x31d7('0xc'),auth[_0x31d7('0xa')](),controller[_0x31d7('0xf')]);router[_0x31d7('0x10')](_0x31d7('0xc'),auth[_0x31d7('0xa')](),controller[_0x31d7('0x11')]);module[_0x31d7('0x12')]=router; \ No newline at end of file +var _0xf745=['./intDynamics365Field.controller','isAuthenticated','index','get','show','post','create','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x55bf2e,_0x50997d){var _0x229aba=function(_0x222b75){while(--_0x222b75){_0x55bf2e['push'](_0x55bf2e['shift']());}};_0x229aba(++_0x50997d);}(_0xf745,0x7a));var _0x5f74=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xf745[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x5f74('0x0'));var util=require(_0x5f74('0x1'));var path=require(_0x5f74('0x2'));var timeout=require(_0x5f74('0x3'));var express=require(_0x5f74('0x4'));var router=express[_0x5f74('0x5')]();var fs_extra=require(_0x5f74('0x6'));var auth=require(_0x5f74('0x7'));var interaction=require(_0x5f74('0x8'));var config=require(_0x5f74('0x9'));var controller=require(_0x5f74('0xa'));router['get']('/',auth[_0x5f74('0xb')](),controller[_0x5f74('0xc')]);router[_0x5f74('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x5f74('0xe')]);router[_0x5f74('0xf')]('/',auth[_0x5f74('0xb')](),controller[_0x5f74('0x10')]);router['put'](_0x5f74('0x11'),auth[_0x5f74('0xb')](),controller[_0x5f74('0x12')]);router[_0x5f74('0x13')](_0x5f74('0x11'),auth[_0x5f74('0xb')](),controller[_0x5f74('0x14')]);module[_0x5f74('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index e1b202b..a84e207 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 _0xa5da=['string','variable','customVariable','picklist','STRING','BOOLEAN','exports','ENUM'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xa5da,0x146));var _0xaa5d=function(_0x581cf8,_0x91373f){_0x581cf8=_0x581cf8-0x0;var _0xb7f38f=_0xa5da[_0x581cf8];return _0xb7f38f;};'use strict';var Sequelize=require('sequelize');module[_0xaa5d('0x0')]={'type':{'type':Sequelize[_0xaa5d('0x1')](_0xaa5d('0x2'),_0xaa5d('0x3'),_0xaa5d('0x4'),'keyValue',_0xaa5d('0x5')),'defaultValue':_0xaa5d('0x2')},'content':{'type':Sequelize[_0xaa5d('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xaa5d('0x1')](_0xaa5d('0x2'),_0xaa5d('0x3'),_0xaa5d('0x4'))},'keyContent':{'type':Sequelize[_0xaa5d('0x6')]},'idField':{'type':Sequelize[_0xaa5d('0x6')]},'nameField':{'type':Sequelize[_0xaa5d('0x6')]},'customField':{'type':Sequelize[_0xaa5d('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xaa5d('0x6')]}}; \ No newline at end of file +var _0x28df=['ENUM','string','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports'];(function(_0x4bafe,_0x21af80){var _0x5994c1=function(_0x63e9f5){while(--_0x63e9f5){_0x4bafe['push'](_0x4bafe['shift']());}};_0x5994c1(++_0x21af80);}(_0x28df,0xfa));var _0xf28d=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x28df[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0xf28d('0x0'));module[_0xf28d('0x1')]={'type':{'type':Sequelize[_0xf28d('0x2')](_0xf28d('0x3'),'variable',_0xf28d('0x4'),_0xf28d('0x5'),_0xf28d('0x6')),'defaultValue':_0xf28d('0x3')},'content':{'type':Sequelize[_0xf28d('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xf28d('0x2')](_0xf28d('0x3'),'variable',_0xf28d('0x4'))},'keyContent':{'type':Sequelize[_0xf28d('0x7')]},'idField':{'type':Sequelize[_0xf28d('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xf28d('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 909a0a3..a26cdaa 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 _0x532f=['fs-extra','crypto','jsforce','desk.js','querystring','papaparse','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','count','limit','set','apply','reject','save','update','then','destroy','stack','name','send','index','map','type','key','query','keys','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','Dynamics365Field','includeAll','include','findAll','catch','params','rawAttributes','intersection','length','find','create','body','eml-format','rimraf','fast-json-patch','moment','bluebird','util','sox','ejs'];(function(_0x4d0f67,_0x171eea){var _0x159d86=function(_0x38fe1c){while(--_0x38fe1c){_0x4d0f67['push'](_0x4d0f67['shift']());}};_0x159d86(++_0x171eea);}(_0x532f,0x160));var _0xf532=function(_0x75ae52,_0x5a2d3f){_0x75ae52=_0x75ae52-0x0;var _0x1ab7c7=_0x532f[_0x75ae52];return _0x1ab7c7;};'use strict';var emlformat=require(_0xf532('0x0'));var rimraf=require(_0xf532('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf532('0x2'));var rp=require('request-promise');var moment=require(_0xf532('0x3'));var BPromise=require(_0xf532('0x4'));var Mustache=require('mustache');var util=require(_0xf532('0x5'));var path=require('path');var sox=require(_0xf532('0x6'));var csv=require('to-csv');var ejs=require(_0xf532('0x7'));var fs=require('fs');var fs_extra=require(_0xf532('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf532('0x9'));var jsforce=require(_0xf532('0xa'));var deskjs=require(_0xf532('0xb'));var toCsv=require('to-csv');var querystring=require(_0xf532('0xc'));var Papa=require(_0xf532('0xd'));var Redis=require(_0xf532('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xf532('0xf'));var as=require(_0xf532('0x10'));var hardwareService=require(_0xf532('0x11'));var logger=require(_0xf532('0x12'))(_0xf532('0x13'));var utils=require(_0xf532('0x14'));var config=require(_0xf532('0x15'));var licenseUtil=require(_0xf532('0x16'));var db=require(_0xf532('0x17'))['db'];function respondWithStatusCode(_0x5debdc,_0xb012d9){_0xb012d9=_0xb012d9||0xcc;return function(_0x2bfbf2){if(_0x2bfbf2){return _0x5debdc[_0xf532('0x18')](_0xb012d9);}return _0x5debdc[_0xf532('0x19')](_0xb012d9)[_0xf532('0x1a')]();};}function respondWithResult(_0x426bbe,_0x2a722d){_0x2a722d=_0x2a722d||0xc8;return function(_0x5ab342){if(_0x5ab342){return _0x426bbe[_0xf532('0x19')](_0x2a722d)[_0xf532('0x1b')](_0x5ab342);}};}function respondWithFilteredResult(_0x17bad3,_0xdbba73){return function(_0x5f3300){if(_0x5f3300){var _0x59babe=typeof _0xdbba73[_0xf532('0x1c')]===_0xf532('0x1d')&&typeof _0xdbba73['limit']===_0xf532('0x1d');var _0x3ef3f2=_0x5f3300[_0xf532('0x1e')];var _0x37611e=_0x59babe?0x0:_0xdbba73['offset'];var _0x1dda1f=_0x59babe?_0x5f3300[_0xf532('0x1e')]:_0xdbba73[_0xf532('0x1c')]+_0xdbba73[_0xf532('0x1f')];var _0x2cce51;if(_0x1dda1f>=_0x3ef3f2){_0x1dda1f=_0x3ef3f2;_0x2cce51=0xc8;}else{_0x2cce51=0xce;}_0x17bad3[_0xf532('0x19')](_0x2cce51);return _0x17bad3[_0xf532('0x20')]('Content-Range',_0x37611e+'-'+_0x1dda1f+'/'+_0x3ef3f2)[_0xf532('0x1b')](_0x5f3300);}return null;};}function patchUpdates(_0x102b6d){return function(_0x590633){try{jsonpatch[_0xf532('0x21')](_0x590633,_0x102b6d,!![]);}catch(_0x57cf82){return BPromise[_0xf532('0x22')](_0x57cf82);}return _0x590633[_0xf532('0x23')]();};}function saveUpdates(_0xa39ad6,_0x1d2010){return function(_0x102f4a){if(_0x102f4a){return _0x102f4a[_0xf532('0x24')](_0xa39ad6)[_0xf532('0x25')](function(_0x122ca1){return _0x122ca1;});}return null;};}function removeEntity(_0x1f3fa1,_0xbc2faf){return function(_0x2e4497){if(_0x2e4497){return _0x2e4497[_0xf532('0x26')]()[_0xf532('0x25')](function(){_0x1f3fa1[_0xf532('0x19')](0xcc)[_0xf532('0x1a')]();});}};}function handleEntityNotFound(_0x4e1aee,_0x235b3b){return function(_0x3f886e){if(!_0x3f886e){_0x4e1aee[_0xf532('0x18')](0x194);}return _0x3f886e;};}function handleError(_0x575694,_0x13a679){_0x13a679=_0x13a679||0x1f4;return function(_0x15cdd2){logger['error'](_0x15cdd2[_0xf532('0x27')]);if(_0x15cdd2[_0xf532('0x28')]){delete _0x15cdd2[_0xf532('0x28')];}_0x575694[_0xf532('0x19')](_0x13a679)[_0xf532('0x29')](_0x15cdd2);};}exports[_0xf532('0x2a')]=function(_0x4aad90,_0x93ea8a){var _0x5c2923={},_0x56b227={},_0x4c00d7={'count':0x0,'rows':[]};var _0x3c29fb=_[_0xf532('0x2b')](db['Dynamics365Field']['rawAttributes'],function(_0xdc9198){return{'name':_0xdc9198['fieldName'],'type':_0xdc9198[_0xf532('0x2c')][_0xf532('0x2d')]};});_0x56b227['model']=_[_0xf532('0x2b')](_0x3c29fb,_0xf532('0x28'));_0x56b227[_0xf532('0x2e')]=_[_0xf532('0x2f')](_0x4aad90[_0xf532('0x2e')]);_0x56b227['filters']=_['intersection'](_0x56b227[_0xf532('0x30')],_0x56b227[_0xf532('0x2e')]);_0x5c2923[_0xf532('0x31')]=_['intersection'](_0x56b227[_0xf532('0x30')],qs[_0xf532('0x32')](_0x4aad90[_0xf532('0x2e')][_0xf532('0x32')]));_0x5c2923[_0xf532('0x31')]=_0x5c2923[_0xf532('0x31')]['length']?_0x5c2923['attributes']:_0x56b227[_0xf532('0x30')];if(!_0x4aad90['query'][_0xf532('0x33')](_0xf532('0x34'))){_0x5c2923[_0xf532('0x1f')]=qs[_0xf532('0x1f')](_0x4aad90[_0xf532('0x2e')][_0xf532('0x1f')]);_0x5c2923[_0xf532('0x1c')]=qs['offset'](_0x4aad90[_0xf532('0x2e')][_0xf532('0x1c')]);}_0x5c2923[_0xf532('0x35')]=qs[_0xf532('0x36')](_0x4aad90[_0xf532('0x2e')][_0xf532('0x36')]);_0x5c2923[_0xf532('0x37')]=qs[_0xf532('0x38')](_['pick'](_0x4aad90[_0xf532('0x2e')],_0x56b227[_0xf532('0x38')]),_0x3c29fb);if(_0x4aad90[_0xf532('0x2e')][_0xf532('0x39')]){_0x5c2923['where']=_[_0xf532('0x3a')](_0x5c2923[_0xf532('0x37')],{'$or':_[_0xf532('0x2b')](_0x3c29fb,function(_0xbb54ac){if(_0xbb54ac[_0xf532('0x2c')]!=='VIRTUAL'){var _0xce3ffa={};_0xce3ffa[_0xbb54ac[_0xf532('0x28')]]={'$like':'%'+_0x4aad90[_0xf532('0x2e')][_0xf532('0x39')]+'%'};return _0xce3ffa;}})});}_0x5c2923=_[_0xf532('0x3a')]({},_0x5c2923,_0x4aad90[_0xf532('0x3b')]);var _0x5647b3={'where':_0x5c2923[_0xf532('0x37')]};return db[_0xf532('0x3c')]['count'](_0x5647b3)[_0xf532('0x25')](function(_0x204e48){_0x4c00d7[_0xf532('0x1e')]=_0x204e48;if(_0x4aad90['query'][_0xf532('0x3d')]){_0x5c2923[_0xf532('0x3e')]=[{'all':!![]}];}return db[_0xf532('0x3c')][_0xf532('0x3f')](_0x5c2923);})['then'](function(_0x1205b4){_0x4c00d7['rows']=_0x1205b4;return _0x4c00d7;})['then'](respondWithFilteredResult(_0x93ea8a,_0x5c2923))[_0xf532('0x40')](handleError(_0x93ea8a,null));};exports['show']=function(_0x55a379,_0x3ca8d5){var _0x1a3f1e={'raw':!![],'where':{'id':_0x55a379[_0xf532('0x41')]['id']}},_0x24422b={};_0x24422b[_0xf532('0x30')]=_[_0xf532('0x2f')](db['Dynamics365Field'][_0xf532('0x42')]);_0x24422b[_0xf532('0x2e')]=_['keys'](_0x55a379[_0xf532('0x2e')]);_0x24422b[_0xf532('0x38')]=_[_0xf532('0x43')](_0x24422b[_0xf532('0x30')],_0x24422b[_0xf532('0x2e')]);_0x1a3f1e[_0xf532('0x31')]=_[_0xf532('0x43')](_0x24422b[_0xf532('0x30')],qs[_0xf532('0x32')](_0x55a379['query'][_0xf532('0x32')]));_0x1a3f1e[_0xf532('0x31')]=_0x1a3f1e[_0xf532('0x31')][_0xf532('0x44')]?_0x1a3f1e[_0xf532('0x31')]:_0x24422b[_0xf532('0x30')];if(_0x55a379[_0xf532('0x2e')][_0xf532('0x3d')]){_0x1a3f1e[_0xf532('0x3e')]=[{'all':!![]}];}_0x1a3f1e=_[_0xf532('0x3a')]({},_0x1a3f1e,_0x55a379[_0xf532('0x3b')]);return db[_0xf532('0x3c')][_0xf532('0x45')](_0x1a3f1e)['then'](handleEntityNotFound(_0x3ca8d5,null))['then'](respondWithResult(_0x3ca8d5,null))['catch'](handleError(_0x3ca8d5,null));};exports[_0xf532('0x46')]=function(_0x169be1,_0x2167e2){return db[_0xf532('0x3c')][_0xf532('0x46')](_0x169be1[_0xf532('0x47')],{})['then'](respondWithResult(_0x2167e2,0xc9))['catch'](handleError(_0x2167e2,null));};exports[_0xf532('0x24')]=function(_0x37aad2,_0x46a501){if(_0x37aad2[_0xf532('0x47')]['id']){delete _0x37aad2[_0xf532('0x47')]['id'];}return db[_0xf532('0x3c')][_0xf532('0x45')]({'where':{'id':_0x37aad2[_0xf532('0x41')]['id']}})[_0xf532('0x25')](handleEntityNotFound(_0x46a501,null))[_0xf532('0x25')](saveUpdates(_0x37aad2['body'],null))[_0xf532('0x25')](respondWithResult(_0x46a501,null))[_0xf532('0x40')](handleError(_0x46a501,null));};exports[_0xf532('0x26')]=function(_0x5622c5,_0x481e7c){return db[_0xf532('0x3c')][_0xf532('0x45')]({'where':{'id':_0x5622c5[_0xf532('0x41')]['id']}})['then'](handleEntityNotFound(_0x481e7c,null))[_0xf532('0x25')](removeEntity(_0x481e7c,null))[_0xf532('0x40')](handleError(_0x481e7c,null));}; \ No newline at end of file +var _0x264f=['key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','update','find','eml-format','rimraf','fast-json-patch','request-promise','moment','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','../../mysqldb','sendStatus','status','offset','limit','undefined','count','Content-Range','json','apply','save','then','end','error','stack','name','send','map','Dynamics365Field','fieldName','type'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x264f,0x19d));var _0xf264=function(_0x42d277,_0x323692){_0x42d277=_0x42d277-0x0;var _0x47983e=_0x264f[_0x42d277];return _0x47983e;};'use strict';var emlformat=require(_0xf264('0x0'));var rimraf=require(_0xf264('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf264('0x2'));var rp=require(_0xf264('0x3'));var moment=require(_0xf264('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf264('0x5'));var util=require(_0xf264('0x6'));var path=require(_0xf264('0x7'));var sox=require(_0xf264('0x8'));var csv=require(_0xf264('0x9'));var ejs=require(_0xf264('0xa'));var fs=require('fs');var fs_extra=require(_0xf264('0xb'));var _=require(_0xf264('0xc'));var squel=require(_0xf264('0xd'));var crypto=require(_0xf264('0xe'));var jsforce=require(_0xf264('0xf'));var deskjs=require(_0xf264('0x10'));var toCsv=require('to-csv');var querystring=require(_0xf264('0x11'));var Papa=require(_0xf264('0x12'));var Redis=require(_0xf264('0x13'));var authService=require(_0xf264('0x14'));var qs=require(_0xf264('0x15'));var as=require(_0xf264('0x16'));var hardwareService=require(_0xf264('0x17'));var logger=require(_0xf264('0x18'))(_0xf264('0x19'));var utils=require(_0xf264('0x1a'));var config=require(_0xf264('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0xf264('0x1c'))['db'];function respondWithStatusCode(_0x24d059,_0x26c2ba){_0x26c2ba=_0x26c2ba||0xcc;return function(_0x59e1ce){if(_0x59e1ce){return _0x24d059[_0xf264('0x1d')](_0x26c2ba);}return _0x24d059[_0xf264('0x1e')](_0x26c2ba)['end']();};}function respondWithResult(_0xf2feb6,_0x292e3b){_0x292e3b=_0x292e3b||0xc8;return function(_0xde49a3){if(_0xde49a3){return _0xf2feb6[_0xf264('0x1e')](_0x292e3b)['json'](_0xde49a3);}};}function respondWithFilteredResult(_0xc1c3b8,_0xa0bf77){return function(_0xda2af7){if(_0xda2af7){var _0x10f0fe=typeof _0xa0bf77[_0xf264('0x1f')]==='undefined'&&typeof _0xa0bf77[_0xf264('0x20')]===_0xf264('0x21');var _0x59b3ee=_0xda2af7[_0xf264('0x22')];var _0x463988=_0x10f0fe?0x0:_0xa0bf77['offset'];var _0x26acc1=_0x10f0fe?_0xda2af7['count']:_0xa0bf77[_0xf264('0x1f')]+_0xa0bf77[_0xf264('0x20')];var _0x5ac9ff;if(_0x26acc1>=_0x59b3ee){_0x26acc1=_0x59b3ee;_0x5ac9ff=0xc8;}else{_0x5ac9ff=0xce;}_0xc1c3b8['status'](_0x5ac9ff);return _0xc1c3b8['set'](_0xf264('0x23'),_0x463988+'-'+_0x26acc1+'/'+_0x59b3ee)[_0xf264('0x24')](_0xda2af7);}return null;};}function patchUpdates(_0x4a1e64){return function(_0x5a048b){try{jsonpatch[_0xf264('0x25')](_0x5a048b,_0x4a1e64,!![]);}catch(_0x385f6a){return BPromise['reject'](_0x385f6a);}return _0x5a048b[_0xf264('0x26')]();};}function saveUpdates(_0x4c0059,_0x3bd6ae){return function(_0x882112){if(_0x882112){return _0x882112['update'](_0x4c0059)[_0xf264('0x27')](function(_0xbb09dc){return _0xbb09dc;});}return null;};}function removeEntity(_0x5c0a0b,_0x1ee18e){return function(_0x58e457){if(_0x58e457){return _0x58e457['destroy']()['then'](function(){_0x5c0a0b[_0xf264('0x1e')](0xcc)[_0xf264('0x28')]();});}};}function handleEntityNotFound(_0x23507d,_0x504900){return function(_0x239d19){if(!_0x239d19){_0x23507d[_0xf264('0x1d')](0x194);}return _0x239d19;};}function handleError(_0x2a36fa,_0x22378c){_0x22378c=_0x22378c||0x1f4;return function(_0xde9fa3){logger[_0xf264('0x29')](_0xde9fa3[_0xf264('0x2a')]);if(_0xde9fa3[_0xf264('0x2b')]){delete _0xde9fa3[_0xf264('0x2b')];}_0x2a36fa['status'](_0x22378c)[_0xf264('0x2c')](_0xde9fa3);};}exports['index']=function(_0xd54477,_0x52b755){var _0x4212f5={},_0x4f6bc8={},_0x5c2711={'count':0x0,'rows':[]};var _0x2ff289=_[_0xf264('0x2d')](db[_0xf264('0x2e')]['rawAttributes'],function(_0x1f9eac){return{'name':_0x1f9eac[_0xf264('0x2f')],'type':_0x1f9eac[_0xf264('0x30')][_0xf264('0x31')]};});_0x4f6bc8[_0xf264('0x32')]=_[_0xf264('0x2d')](_0x2ff289,_0xf264('0x2b'));_0x4f6bc8[_0xf264('0x33')]=_[_0xf264('0x34')](_0xd54477[_0xf264('0x33')]);_0x4f6bc8[_0xf264('0x35')]=_[_0xf264('0x36')](_0x4f6bc8['model'],_0x4f6bc8[_0xf264('0x33')]);_0x4212f5[_0xf264('0x37')]=_[_0xf264('0x36')](_0x4f6bc8[_0xf264('0x32')],qs[_0xf264('0x38')](_0xd54477[_0xf264('0x33')]['fields']));_0x4212f5[_0xf264('0x37')]=_0x4212f5['attributes'][_0xf264('0x39')]?_0x4212f5[_0xf264('0x37')]:_0x4f6bc8[_0xf264('0x32')];if(!_0xd54477[_0xf264('0x33')][_0xf264('0x3a')](_0xf264('0x3b'))){_0x4212f5[_0xf264('0x20')]=qs[_0xf264('0x20')](_0xd54477['query'][_0xf264('0x20')]);_0x4212f5[_0xf264('0x1f')]=qs['offset'](_0xd54477[_0xf264('0x33')][_0xf264('0x1f')]);}_0x4212f5['order']=qs[_0xf264('0x3c')](_0xd54477['query'][_0xf264('0x3c')]);_0x4212f5[_0xf264('0x3d')]=qs[_0xf264('0x35')](_['pick'](_0xd54477['query'],_0x4f6bc8[_0xf264('0x35')]),_0x2ff289);if(_0xd54477['query'][_0xf264('0x3e')]){_0x4212f5['where']=_[_0xf264('0x3f')](_0x4212f5[_0xf264('0x3d')],{'$or':_['map'](_0x2ff289,function(_0x22979d){if(_0x22979d[_0xf264('0x30')]!=='VIRTUAL'){var _0x1d60fe={};_0x1d60fe[_0x22979d['name']]={'$like':'%'+_0xd54477[_0xf264('0x33')][_0xf264('0x3e')]+'%'};return _0x1d60fe;}})});}_0x4212f5=_[_0xf264('0x3f')]({},_0x4212f5,_0xd54477[_0xf264('0x40')]);var _0x1779fb={'where':_0x4212f5[_0xf264('0x3d')]};return db['Dynamics365Field'][_0xf264('0x22')](_0x1779fb)[_0xf264('0x27')](function(_0x3829ab){_0x5c2711[_0xf264('0x22')]=_0x3829ab;if(_0xd54477[_0xf264('0x33')][_0xf264('0x41')]){_0x4212f5[_0xf264('0x42')]=[{'all':!![]}];}return db[_0xf264('0x2e')][_0xf264('0x43')](_0x4212f5);})['then'](function(_0x2e2b7d){_0x5c2711[_0xf264('0x44')]=_0x2e2b7d;return _0x5c2711;})[_0xf264('0x27')](respondWithFilteredResult(_0x52b755,_0x4212f5))[_0xf264('0x45')](handleError(_0x52b755,null));};exports[_0xf264('0x46')]=function(_0x558f34,_0x551f4b){var _0x1c2657={'raw':!![],'where':{'id':_0x558f34[_0xf264('0x47')]['id']}},_0x3d2e22={};_0x3d2e22[_0xf264('0x32')]=_[_0xf264('0x34')](db[_0xf264('0x2e')][_0xf264('0x48')]);_0x3d2e22[_0xf264('0x33')]=_[_0xf264('0x34')](_0x558f34['query']);_0x3d2e22['filters']=_[_0xf264('0x36')](_0x3d2e22[_0xf264('0x32')],_0x3d2e22[_0xf264('0x33')]);_0x1c2657[_0xf264('0x37')]=_[_0xf264('0x36')](_0x3d2e22[_0xf264('0x32')],qs[_0xf264('0x38')](_0x558f34[_0xf264('0x33')][_0xf264('0x38')]));_0x1c2657['attributes']=_0x1c2657[_0xf264('0x37')]['length']?_0x1c2657['attributes']:_0x3d2e22[_0xf264('0x32')];if(_0x558f34[_0xf264('0x33')][_0xf264('0x41')]){_0x1c2657[_0xf264('0x42')]=[{'all':!![]}];}_0x1c2657=_[_0xf264('0x3f')]({},_0x1c2657,_0x558f34[_0xf264('0x40')]);return db[_0xf264('0x2e')]['find'](_0x1c2657)[_0xf264('0x27')](handleEntityNotFound(_0x551f4b,null))[_0xf264('0x27')](respondWithResult(_0x551f4b,null))[_0xf264('0x45')](handleError(_0x551f4b,null));};exports['create']=function(_0x2610d6,_0x14ae37){return db[_0xf264('0x2e')][_0xf264('0x49')](_0x2610d6[_0xf264('0x4a')],{})[_0xf264('0x27')](respondWithResult(_0x14ae37,0xc9))[_0xf264('0x45')](handleError(_0x14ae37,null));};exports[_0xf264('0x4b')]=function(_0x1fca48,_0x26864e){if(_0x1fca48[_0xf264('0x4a')]['id']){delete _0x1fca48[_0xf264('0x4a')]['id'];}return db[_0xf264('0x2e')][_0xf264('0x4c')]({'where':{'id':_0x1fca48[_0xf264('0x47')]['id']}})[_0xf264('0x27')](handleEntityNotFound(_0x26864e,null))[_0xf264('0x27')](saveUpdates(_0x1fca48[_0xf264('0x4a')],null))[_0xf264('0x27')](respondWithResult(_0x26864e,null))[_0xf264('0x45')](handleError(_0x26864e,null));};exports['destroy']=function(_0x332cd3,_0x1ec1f6){return db[_0xf264('0x2e')]['find']({'where':{'id':_0x332cd3[_0xf264('0x47')]['id']}})[_0xf264('0x27')](handleEntityNotFound(_0x1ec1f6,null))[_0xf264('0x27')](removeEntity(_0x1ec1f6,null))['catch'](handleError(_0x1ec1f6,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 82fd0ed..d743b5d 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 _0x4fab=['int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field'];(function(_0x1a063d,_0x22afd1){var _0x5a1447=function(_0x58c487){while(--_0x58c487){_0x1a063d['push'](_0x1a063d['shift']());}};_0x5a1447(++_0x22afd1);}(_0x4fab,0x74));var _0xb4fa=function(_0x357142,_0x45bcb7){_0x357142=_0x357142-0x0;var _0x1912c8=_0x4fab[_0x357142];return _0x1912c8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb4fa('0x0'))('api');var moment=require(_0xb4fa('0x1'));var BPromise=require('bluebird');var rp=require(_0xb4fa('0x2'));var fs=require('fs');var path=require(_0xb4fa('0x3'));var rimraf=require(_0xb4fa('0x4'));var config=require(_0xb4fa('0x5'));var attributes=require(_0xb4fa('0x6'));module[_0xb4fa('0x7')]=function(_0x591373,_0xe44e9c){return _0x591373[_0xb4fa('0x8')](_0xb4fa('0x9'),attributes,{'tableName':_0xb4fa('0xa'),'paranoid':![],'indexes':[{'name':_0xb4fa('0xb'),'fields':[_0xb4fa('0xc'),_0xb4fa('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc035=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field','dynamics365_unique_index','idField','FieldId','lodash'];(function(_0x4b3624,_0x3870c8){var _0x328fe8=function(_0x26fd78){while(--_0x26fd78){_0x4b3624['push'](_0x4b3624['shift']());}};_0x328fe8(++_0x3870c8);}(_0xc035,0xed));var _0x5c03=function(_0xb38c4d,_0x7a0d6d){_0xb38c4d=_0xb38c4d-0x0;var _0x59abf6=_0xc035[_0xb38c4d];return _0x59abf6;};'use strict';var _=require(_0x5c03('0x0'));var util=require('util');var logger=require(_0x5c03('0x1'))(_0x5c03('0x2'));var moment=require(_0x5c03('0x3'));var BPromise=require(_0x5c03('0x4'));var rp=require(_0x5c03('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5c03('0x6'));var attributes=require(_0x5c03('0x7'));module[_0x5c03('0x8')]=function(_0x13607f,_0x466f58){return _0x13607f[_0x5c03('0x9')](_0x5c03('0xa'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0x5c03('0xb'),'fields':[_0x5c03('0xc'),_0x5c03('0xd')],'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 d01a121..0bdc415 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 _0xf898=['../../config/utils','../../config/environment','jayson/promise','client','http','then','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xd95ad3,_0x5b5aab){var _0x3f74f9=function(_0x36c8ec){while(--_0x36c8ec){_0xd95ad3['push'](_0xd95ad3['shift']());}};_0x3f74f9(++_0x5b5aab);}(_0xf898,0x19c));var _0x8f89=function(_0x2fe41d,_0x3c2e77){_0x2fe41d=_0x2fe41d-0x0;var _0x11d43d=_0xf898[_0x2fe41d];return _0x11d43d;};'use strict';var _=require(_0x8f89('0x0'));var util=require(_0x8f89('0x1'));var moment=require('moment');var BPromise=require(_0x8f89('0x2'));var rs=require(_0x8f89('0x3'));var fs=require('fs');var Redis=require(_0x8f89('0x4'));var db=require(_0x8f89('0x5'))['db'];var utils=require(_0x8f89('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x8f89('0x7'));var jayson=require(_0x8f89('0x8'));var client=jayson[_0x8f89('0x9')][_0x8f89('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x49a298,_0x79b6e2,_0x3a0aa1){return new BPromise(function(_0x228363,_0x37833f){return client['request'](_0x49a298,_0x3a0aa1)[_0x8f89('0xb')](function(_0x508e81){logger['info'](_0x8f89('0xc'),_0x79b6e2,_0x8f89('0xd'));logger[_0x8f89('0xe')](_0x8f89('0xf'),_0x79b6e2,_0x8f89('0xd'),JSON[_0x8f89('0x10')](_0x508e81));if(_0x508e81[_0x8f89('0x11')]){if(_0x508e81[_0x8f89('0x11')][_0x8f89('0x12')]===0x1f4){logger[_0x8f89('0x11')](_0x8f89('0xc'),_0x79b6e2,_0x508e81[_0x8f89('0x11')][_0x8f89('0x13')]);return _0x37833f(_0x508e81['error']['message']);}logger[_0x8f89('0x11')]('Dynamics365Field,\x20%s,\x20%s',_0x79b6e2,_0x508e81[_0x8f89('0x11')][_0x8f89('0x13')]);return _0x228363(_0x508e81[_0x8f89('0x11')][_0x8f89('0x13')]);}else{logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x79b6e2,'request\x20sent');_0x228363(_0x508e81[_0x8f89('0x14')][_0x8f89('0x13')]);}})[_0x8f89('0x15')](function(_0x3a08de){logger[_0x8f89('0x11')]('Dynamics365Field,\x20%s,\x20%s',_0x79b6e2,_0x3a08de);_0x37833f(_0x3a08de);});});} \ No newline at end of file +var _0xa21a=['../../config/environment','http','request','then','Dynamics365Field,\x20%s,\x20%s','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x47da8d,_0x517e13){var _0x5aabef=function(_0x2528d7){while(--_0x2528d7){_0x47da8d['push'](_0x47da8d['shift']());}};_0x5aabef(++_0x517e13);}(_0xa21a,0x11e));var _0xaa21=function(_0x504c0a,_0x181d7d){_0x504c0a=_0x504c0a-0x0;var _0x755bb7=_0xa21a[_0x504c0a];return _0x755bb7;};'use strict';var _=require('lodash');var util=require(_0xaa21('0x0'));var moment=require(_0xaa21('0x1'));var BPromise=require('bluebird');var rs=require(_0xaa21('0x2'));var fs=require('fs');var Redis=require(_0xaa21('0x3'));var db=require(_0xaa21('0x4'))['db'];var utils=require(_0xaa21('0x5'));var logger=require(_0xaa21('0x6'))(_0xaa21('0x7'));var config=require(_0xaa21('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xaa21('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x67ae03,_0x59f52c,_0xcbbd10){return new BPromise(function(_0x172687,_0x8d305d){return client[_0xaa21('0xa')](_0x67ae03,_0xcbbd10)[_0xaa21('0xb')](function(_0x69f045){logger['info'](_0xaa21('0xc'),_0x59f52c,'request\x20sent');logger[_0xaa21('0xd')](_0xaa21('0xe'),_0x59f52c,'request\x20sent',JSON[_0xaa21('0xf')](_0x69f045));if(_0x69f045[_0xaa21('0x10')]){if(_0x69f045['error']['code']===0x1f4){logger[_0xaa21('0x10')](_0xaa21('0xc'),_0x59f52c,_0x69f045['error'][_0xaa21('0x11')]);return _0x8d305d(_0x69f045[_0xaa21('0x10')][_0xaa21('0x11')]);}logger[_0xaa21('0x10')](_0xaa21('0xc'),_0x59f52c,_0x69f045[_0xaa21('0x10')][_0xaa21('0x11')]);return _0x172687(_0x69f045[_0xaa21('0x10')][_0xaa21('0x11')]);}else{logger[_0xaa21('0x12')](_0xaa21('0xc'),_0x59f52c,_0xaa21('0x13'));_0x172687(_0x69f045[_0xaa21('0x14')][_0xaa21('0x11')]);}})['catch'](function(_0x44b1e1){logger[_0xaa21('0x10')](_0xaa21('0xc'),_0x59f52c,_0x44b1e1);_0x8d305d(_0x44b1e1);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 66b6189..69bcdfd 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 _0xd530=['/:id/fields','getFields','post','addConfiguration','put','update','exports','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations'];(function(_0x34686e,_0x44c14d){var _0xd55d57=function(_0x4cd2b7){while(--_0x4cd2b7){_0x34686e['push'](_0x34686e['shift']());}};_0xd55d57(++_0x44c14d);}(_0xd530,0x181));var _0x0d53=function(_0x38c85d,_0x38ea69){_0x38c85d=_0x38c85d-0x0;var _0x5834c7=_0xd530[_0x38c85d];return _0x5834c7;};'use strict';var multer=require(_0x0d53('0x0'));var util=require('util');var path=require(_0x0d53('0x1'));var timeout=require(_0x0d53('0x2'));var express=require('express');var router=express[_0x0d53('0x3')]();var fs_extra=require(_0x0d53('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0d53('0x5'));var config=require(_0x0d53('0x6'));var controller=require(_0x0d53('0x7'));router[_0x0d53('0x8')]('/',auth[_0x0d53('0x9')](),controller[_0x0d53('0xa')]);router[_0x0d53('0x8')](_0x0d53('0xb'),auth[_0x0d53('0x9')](),controller['show']);router[_0x0d53('0x8')](_0x0d53('0xc'),auth['isAuthenticated'](),controller[_0x0d53('0xd')]);router[_0x0d53('0x8')](_0x0d53('0xe'),auth[_0x0d53('0x9')](),controller[_0x0d53('0xf')]);router[_0x0d53('0x10')]('/',auth[_0x0d53('0x9')](),controller['create']);router[_0x0d53('0x10')]('/:id/configurations',auth[_0x0d53('0x9')](),controller[_0x0d53('0x11')]);router[_0x0d53('0x12')](_0x0d53('0xb'),auth[_0x0d53('0x9')](),controller[_0x0d53('0x13')]);router['delete'](_0x0d53('0xb'),auth[_0x0d53('0x9')](),controller['destroy']);module[_0x0d53('0x14')]=router; \ No newline at end of file +var _0x73ff=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','/:id/configurations','isAuthenticated','/:id/fields','post','addConfiguration','put','delete','exports','multer','util','path','connect-timeout'];(function(_0x412b2a,_0x11fb8a){var _0x5872e3=function(_0x202191){while(--_0x202191){_0x412b2a['push'](_0x412b2a['shift']());}};_0x5872e3(++_0x11fb8a);}(_0x73ff,0x12c));var _0xf73f=function(_0x117fe4,_0x116d15){_0x117fe4=_0x117fe4-0x0;var _0x4ffc3f=_0x73ff[_0x117fe4];return _0x4ffc3f;};'use strict';var multer=require(_0xf73f('0x0'));var util=require(_0xf73f('0x1'));var path=require(_0xf73f('0x2'));var timeout=require(_0xf73f('0x3'));var express=require('express');var router=express[_0xf73f('0x4')]();var fs_extra=require(_0xf73f('0x5'));var auth=require(_0xf73f('0x6'));var interaction=require(_0xf73f('0x7'));var config=require(_0xf73f('0x8'));var controller=require('./intFreshdeskAccount.controller');router[_0xf73f('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf73f('0x9')](_0xf73f('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xf73f('0x9')](_0xf73f('0xb'),auth[_0xf73f('0xc')](),controller['getConfigurations']);router[_0xf73f('0x9')](_0xf73f('0xd'),auth[_0xf73f('0xc')](),controller['getFields']);router[_0xf73f('0xe')]('/',auth[_0xf73f('0xc')](),controller['create']);router['post'](_0xf73f('0xb'),auth[_0xf73f('0xc')](),controller[_0xf73f('0xf')]);router[_0xf73f('0x10')](_0xf73f('0xa'),auth[_0xf73f('0xc')](),controller['update']);router[_0xf73f('0x11')]('/:id',auth[_0xf73f('0xc')](),controller['destroy']);module[_0xf73f('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 8e6761d..89d9f14 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 _0xaebd=['remoteUri','sequelize','STRING','username'];(function(_0x1b3564,_0x16c919){var _0x504069=function(_0x9322b6){while(--_0x9322b6){_0x1b3564['push'](_0x1b3564['shift']());}};_0x504069(++_0x16c919);}(_0xaebd,0x1e9));var _0xdaeb=function(_0xbeab9,_0x37ec4a){_0xbeab9=_0xbeab9-0x0;var _0x27650c=_0xaebd[_0xbeab9];return _0x27650c;};'use strict';var Sequelize=require(_0xdaeb('0x0'));module['exports']={'name':{'type':Sequelize[_0xdaeb('0x1')]},'description':{'type':Sequelize[_0xdaeb('0x1')]},'username':{'type':Sequelize[_0xdaeb('0x1')],'unique':_0xdaeb('0x2')},'apiKey':{'type':Sequelize[_0xdaeb('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xdaeb('0x3')},'serverUrl':{'type':Sequelize[_0xdaeb('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x5fdc=['sequelize','exports','STRING','username','remoteUri'];(function(_0x4d6991,_0x522735){var _0x3d3512=function(_0x80a813){while(--_0x80a813){_0x4d6991['push'](_0x4d6991['shift']());}};_0x3d3512(++_0x522735);}(_0x5fdc,0x127));var _0xc5fd=function(_0x246763,_0x1b576e){_0x246763=_0x246763-0x0;var _0x1b9038=_0x5fdc[_0x246763];return _0x1b9038;};'use strict';var Sequelize=require(_0xc5fd('0x0'));module[_0xc5fd('0x1')]={'name':{'type':Sequelize[_0xc5fd('0x2')]},'description':{'type':Sequelize[_0xc5fd('0x2')]},'username':{'type':Sequelize[_0xc5fd('0x2')],'unique':_0xc5fd('0x3')},'apiKey':{'type':Sequelize[_0xc5fd('0x2')]},'remoteUri':{'type':Sequelize[_0xc5fd('0x2')],'unique':_0xc5fd('0x4')},'serverUrl':{'type':Sequelize[_0xc5fd('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 dd1e571..014372c 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 _0x2964=['AccountId','channel','Descriptions','getDescriptions','FreshdeskField','findOne','apiKey','substring','format','%s/%s','Basic\x20%s','%s:X','base64','requester','subject','description','priority','group','source','ticket_type','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','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','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','index','map','FreshdeskAccount','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','keys','find','create','body','FreshdeskConfiguration','order','getConfigurations','hasOwnProperty','nolimit'];(function(_0x1e1d0d,_0x5488c2){var _0x5e2aef=function(_0x13b919){while(--_0x13b919){_0x1e1d0d['push'](_0x1e1d0d['shift']());}};_0x5e2aef(++_0x5488c2);}(_0x2964,0x108));var _0x4296=function(_0x58ebb6,_0xb93352){_0x58ebb6=_0x58ebb6-0x0;var _0x35a403=_0x2964[_0x58ebb6];return _0x35a403;};'use strict';var emlformat=require(_0x4296('0x0'));var rimraf=require(_0x4296('0x1'));var zipdir=require(_0x4296('0x2'));var jsonpatch=require(_0x4296('0x3'));var rp=require(_0x4296('0x4'));var moment=require(_0x4296('0x5'));var BPromise=require(_0x4296('0x6'));var Mustache=require(_0x4296('0x7'));var util=require(_0x4296('0x8'));var path=require('path');var sox=require(_0x4296('0x9'));var csv=require(_0x4296('0xa'));var ejs=require(_0x4296('0xb'));var fs=require('fs');var fs_extra=require(_0x4296('0xc'));var _=require(_0x4296('0xd'));var squel=require(_0x4296('0xe'));var crypto=require('crypto');var jsforce=require(_0x4296('0xf'));var deskjs=require(_0x4296('0x10'));var toCsv=require(_0x4296('0xa'));var querystring=require(_0x4296('0x11'));var Papa=require(_0x4296('0x12'));var Redis=require(_0x4296('0x13'));var authService=require(_0x4296('0x14'));var qs=require(_0x4296('0x15'));var as=require(_0x4296('0x16'));var hardwareService=require(_0x4296('0x17'));var logger=require(_0x4296('0x18'))(_0x4296('0x19'));var utils=require('../../config/utils');var config=require(_0x4296('0x1a'));var licenseUtil=require(_0x4296('0x1b'));var db=require(_0x4296('0x1c'))['db'];var integrations=require(_0x4296('0x1d'));function respondWithStatusCode(_0x23ba5a,_0x676674){_0x676674=_0x676674||0xcc;return function(_0x3789a2){if(_0x3789a2){return _0x23ba5a['sendStatus'](_0x676674);}return _0x23ba5a[_0x4296('0x1e')](_0x676674)[_0x4296('0x1f')]();};}function respondWithResult(_0x3574da,_0x56b6d7){_0x56b6d7=_0x56b6d7||0xc8;return function(_0x1c192c){if(_0x1c192c){return _0x3574da[_0x4296('0x1e')](_0x56b6d7)[_0x4296('0x20')](_0x1c192c);}};}function respondWithFilteredResult(_0x53af4b,_0x182910){return function(_0x2e63c4){if(_0x2e63c4){var _0x1e7af8=typeof _0x182910['offset']===_0x4296('0x21')&&typeof _0x182910[_0x4296('0x22')]===_0x4296('0x21');var _0x1dcb36=_0x2e63c4[_0x4296('0x23')];var _0x540b0d=_0x1e7af8?0x0:_0x182910[_0x4296('0x24')];var _0x4ac668=_0x1e7af8?_0x2e63c4[_0x4296('0x23')]:_0x182910['offset']+_0x182910[_0x4296('0x22')];var _0x6c50b7;if(_0x4ac668>=_0x1dcb36){_0x4ac668=_0x1dcb36;_0x6c50b7=0xc8;}else{_0x6c50b7=0xce;}_0x53af4b[_0x4296('0x1e')](_0x6c50b7);return _0x53af4b[_0x4296('0x25')](_0x4296('0x26'),_0x540b0d+'-'+_0x4ac668+'/'+_0x1dcb36)[_0x4296('0x20')](_0x2e63c4);}return null;};}function patchUpdates(_0x4ca11f){return function(_0x33839e){try{jsonpatch[_0x4296('0x27')](_0x33839e,_0x4ca11f,!![]);}catch(_0x5456ca){return BPromise[_0x4296('0x28')](_0x5456ca);}return _0x33839e[_0x4296('0x29')]();};}function saveUpdates(_0x257f51,_0x3c899f){return function(_0x5d285d){if(_0x5d285d){return _0x5d285d['update'](_0x257f51)[_0x4296('0x2a')](function(_0x3902b5){return _0x3902b5;});}return null;};}function removeEntity(_0x4ce761,_0x179e5d){return function(_0x4c5aca){if(_0x4c5aca){return _0x4c5aca[_0x4296('0x2b')]()[_0x4296('0x2a')](function(){_0x4ce761[_0x4296('0x1e')](0xcc)[_0x4296('0x1f')]();});}};}function handleEntityNotFound(_0x5098c1,_0x3b8b48){return function(_0x4c56e5){if(!_0x4c56e5){_0x5098c1[_0x4296('0x2c')](0x194);}return _0x4c56e5;};}function handleError(_0x516365,_0x4f2d8e){_0x4f2d8e=_0x4f2d8e||0x1f4;return function(_0x853bf5){logger[_0x4296('0x2d')](_0x853bf5[_0x4296('0x2e')]);if(_0x853bf5['name']){delete _0x853bf5[_0x4296('0x2f')];}_0x516365[_0x4296('0x1e')](_0x4f2d8e)['send'](_0x853bf5);};}exports[_0x4296('0x30')]=function(_0x5cb6b7,_0x4f9a1a){var _0x14c84f={},_0x2f5a2e={},_0x37f4e5={'count':0x0,'rows':[]};var _0x1bf57b=_[_0x4296('0x31')](db[_0x4296('0x32')][_0x4296('0x33')],function(_0x9ac120){return{'name':_0x9ac120['fieldName'],'type':_0x9ac120[_0x4296('0x34')]['key']};});_0x2f5a2e[_0x4296('0x35')]=_['map'](_0x1bf57b,'name');_0x2f5a2e[_0x4296('0x36')]=_['keys'](_0x5cb6b7[_0x4296('0x36')]);_0x2f5a2e[_0x4296('0x37')]=_[_0x4296('0x38')](_0x2f5a2e[_0x4296('0x35')],_0x2f5a2e[_0x4296('0x36')]);_0x14c84f[_0x4296('0x39')]=_[_0x4296('0x38')](_0x2f5a2e[_0x4296('0x35')],qs[_0x4296('0x3a')](_0x5cb6b7[_0x4296('0x36')][_0x4296('0x3a')]));_0x14c84f['attributes']=_0x14c84f['attributes'][_0x4296('0x3b')]?_0x14c84f[_0x4296('0x39')]:_0x2f5a2e[_0x4296('0x35')];if(!_0x5cb6b7[_0x4296('0x36')]['hasOwnProperty']('nolimit')){_0x14c84f[_0x4296('0x22')]=qs[_0x4296('0x22')](_0x5cb6b7[_0x4296('0x36')][_0x4296('0x22')]);_0x14c84f['offset']=qs[_0x4296('0x24')](_0x5cb6b7[_0x4296('0x36')]['offset']);}_0x14c84f['order']=qs['sort'](_0x5cb6b7[_0x4296('0x36')][_0x4296('0x3c')]);_0x14c84f['where']=qs[_0x4296('0x37')](_[_0x4296('0x3d')](_0x5cb6b7[_0x4296('0x36')],_0x2f5a2e[_0x4296('0x37')]),_0x1bf57b);if(_0x5cb6b7[_0x4296('0x36')][_0x4296('0x3e')]){_0x14c84f[_0x4296('0x3f')]=_[_0x4296('0x40')](_0x14c84f[_0x4296('0x3f')],{'$or':_[_0x4296('0x31')](_0x1bf57b,function(_0x1e96ed){if(_0x1e96ed[_0x4296('0x34')]!==_0x4296('0x41')){var _0x542ef9={};_0x542ef9[_0x1e96ed[_0x4296('0x2f')]]={'$like':'%'+_0x5cb6b7[_0x4296('0x36')][_0x4296('0x3e')]+'%'};return _0x542ef9;}})});}_0x14c84f=_[_0x4296('0x40')]({},_0x14c84f,_0x5cb6b7[_0x4296('0x42')]);var _0x2fa9c0={'where':_0x14c84f['where']};return db[_0x4296('0x32')][_0x4296('0x23')](_0x2fa9c0)[_0x4296('0x2a')](function(_0x536531){_0x37f4e5[_0x4296('0x23')]=_0x536531;if(_0x5cb6b7['query'][_0x4296('0x43')]){_0x14c84f[_0x4296('0x44')]=[{'all':!![]}];}return db[_0x4296('0x32')][_0x4296('0x45')](_0x14c84f);})[_0x4296('0x2a')](function(_0x43e3b2){_0x37f4e5['rows']=_0x43e3b2;return _0x37f4e5;})[_0x4296('0x2a')](respondWithFilteredResult(_0x4f9a1a,_0x14c84f))[_0x4296('0x46')](handleError(_0x4f9a1a,null));};exports['show']=function(_0x47bd76,_0xa64359){var _0x3fffd3={'raw':![],'where':{'id':_0x47bd76[_0x4296('0x47')]['id']}},_0x2da579={};_0x2da579[_0x4296('0x35')]=_['keys'](db['FreshdeskAccount'][_0x4296('0x33')]);_0x2da579[_0x4296('0x36')]=_[_0x4296('0x48')](_0x47bd76[_0x4296('0x36')]);_0x2da579[_0x4296('0x37')]=_[_0x4296('0x38')](_0x2da579[_0x4296('0x35')],_0x2da579[_0x4296('0x36')]);_0x3fffd3[_0x4296('0x39')]=_['intersection'](_0x2da579[_0x4296('0x35')],qs[_0x4296('0x3a')](_0x47bd76[_0x4296('0x36')]['fields']));_0x3fffd3[_0x4296('0x39')]=_0x3fffd3[_0x4296('0x39')]['length']?_0x3fffd3['attributes']:_0x2da579[_0x4296('0x35')];if(_0x47bd76[_0x4296('0x36')][_0x4296('0x43')]){_0x3fffd3['include']=[{'all':!![]}];}_0x3fffd3=_['merge']({},_0x3fffd3,_0x47bd76['options']);return db[_0x4296('0x32')][_0x4296('0x49')](_0x3fffd3)[_0x4296('0x2a')](handleEntityNotFound(_0xa64359,null))['then'](respondWithResult(_0xa64359,null))['catch'](handleError(_0xa64359,null));};exports[_0x4296('0x4a')]=function(_0x1ddb06,_0x403e7d){return db[_0x4296('0x32')][_0x4296('0x4a')](_0x1ddb06[_0x4296('0x4b')],{})[_0x4296('0x2a')](respondWithResult(_0x403e7d,0xc9))[_0x4296('0x46')](handleError(_0x403e7d,null));};exports['update']=function(_0x419cab,_0x1f050b){if(_0x419cab[_0x4296('0x4b')]['id']){delete _0x419cab[_0x4296('0x4b')]['id'];}return db[_0x4296('0x32')][_0x4296('0x49')]({'where':{'id':_0x419cab['params']['id']}})['then'](handleEntityNotFound(_0x1f050b,null))['then'](saveUpdates(_0x419cab[_0x4296('0x4b')],null))[_0x4296('0x2a')](respondWithResult(_0x1f050b,null))[_0x4296('0x46')](handleError(_0x1f050b,null));};exports[_0x4296('0x2b')]=function(_0x4baee7,_0x2ac96d){return db[_0x4296('0x32')][_0x4296('0x49')]({'where':{'id':_0x4baee7[_0x4296('0x47')]['id']}})[_0x4296('0x2a')](handleEntityNotFound(_0x2ac96d,null))[_0x4296('0x2a')](removeEntity(_0x2ac96d,null))[_0x4296('0x46')](handleError(_0x2ac96d,null));};exports['getConfigurations']=function(_0x468453,_0x47f668,_0x52c28a){var _0x6379ec={};var _0x18080a={};var _0x4f306a;var _0x17e212;return db['FreshdeskAccount']['findOne']({'where':{'id':_0x468453[_0x4296('0x47')]['id']}})[_0x4296('0x2a')](handleEntityNotFound(_0x47f668,null))['then'](function(_0x4faac4){if(_0x4faac4){_0x4f306a=_0x4faac4;_0x18080a[_0x4296('0x35')]=_[_0x4296('0x48')](db[_0x4296('0x4c')][_0x4296('0x33')]);_0x18080a[_0x4296('0x36')]=_['keys'](_0x468453[_0x4296('0x36')]);_0x18080a[_0x4296('0x37')]=_['intersection'](_0x18080a[_0x4296('0x35')],_0x18080a[_0x4296('0x36')]);_0x6379ec[_0x4296('0x39')]=_[_0x4296('0x38')](_0x18080a[_0x4296('0x35')],qs[_0x4296('0x3a')](_0x468453['query'][_0x4296('0x3a')]));_0x6379ec[_0x4296('0x39')]=_0x6379ec[_0x4296('0x39')][_0x4296('0x3b')]?_0x6379ec['attributes']:_0x18080a['model'];_0x6379ec[_0x4296('0x4d')]=qs[_0x4296('0x3c')](_0x468453['query'][_0x4296('0x3c')]);_0x6379ec[_0x4296('0x3f')]=qs[_0x4296('0x37')](_[_0x4296('0x3d')](_0x468453[_0x4296('0x36')],_0x18080a['filters']));if(_0x468453[_0x4296('0x36')]['filter']){_0x6379ec[_0x4296('0x3f')]=_['merge'](_0x6379ec[_0x4296('0x3f')],{'$or':_[_0x4296('0x31')](_0x6379ec[_0x4296('0x39')],function(_0x26a400){var _0x2e8b42={};_0x2e8b42[_0x26a400]={'$like':'%'+_0x468453[_0x4296('0x36')][_0x4296('0x3e')]+'%'};return _0x2e8b42;})});}_0x6379ec=_[_0x4296('0x40')]({},_0x6379ec,_0x468453['options']);return _0x4f306a[_0x4296('0x4e')](_0x6379ec);}})[_0x4296('0x2a')](function(_0x128f96){if(_0x128f96){_0x17e212=_0x128f96[_0x4296('0x3b')];if(!_0x468453['query'][_0x4296('0x4f')](_0x4296('0x50'))){_0x6379ec[_0x4296('0x22')]=qs[_0x4296('0x22')](_0x468453[_0x4296('0x36')][_0x4296('0x22')]);_0x6379ec[_0x4296('0x24')]=qs[_0x4296('0x24')](_0x468453[_0x4296('0x36')][_0x4296('0x24')]);}return _0x4f306a[_0x4296('0x4e')](_0x6379ec);}})[_0x4296('0x2a')](function(_0x3841c1){if(_0x3841c1){return _0x3841c1?{'count':_0x17e212,'rows':_0x3841c1}:null;}})[_0x4296('0x2a')](respondWithResult(_0x47f668,null))[_0x4296('0x46')](handleError(_0x47f668,null));};exports['addConfiguration']=function(_0x2c2823,_0x6360e7,_0xe4cf57){if(_0x2c2823[_0x4296('0x4b')]['id']){delete _0x2c2823[_0x4296('0x4b')]['id'];}return db['FreshdeskAccount']['findOne']({'where':{'id':_0x2c2823[_0x4296('0x47')]['id']}})[_0x4296('0x2a')](handleEntityNotFound(_0x6360e7,null))[_0x4296('0x2a')](function(_0x24054b){if(_0x24054b){_0x2c2823[_0x4296('0x4b')][_0x4296('0x51')]=_0x24054b['id'];_0x2c2823[_0x4296('0x4b')]['Subjects']=integrations['getSubjects'](_0x2c2823['body'][_0x4296('0x52')],_0x2c2823[_0x4296('0x4b')][_0x4296('0x34')]);_0x2c2823['body'][_0x4296('0x53')]=integrations[_0x4296('0x54')](_0x2c2823[_0x4296('0x4b')][_0x4296('0x52')],_0x2c2823['body'][_0x4296('0x34')]);return db[_0x4296('0x4c')][_0x4296('0x4a')](_0x2c2823['body'],{'include':[{'model':db[_0x4296('0x55')],'as':'Subjects'},{'model':db[_0x4296('0x55')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x6360e7,null))[_0x4296('0x46')](handleError(_0x6360e7,null));};exports['getFields']=function(_0x171ffb,_0x22ab58,_0x309225){var _0x45c839='';return db[_0x4296('0x32')][_0x4296('0x56')]({'where':{'id':_0x171ffb[_0x4296('0x47')]['id']},'attributes':['id','remoteUri',_0x4296('0x57')]})['then'](handleEntityNotFound(_0x22ab58,null))[_0x4296('0x2a')](function(_0x5aa04d){if(_0x5aa04d){_0x45c839=_0x5aa04d['remoteUri'];var _0xea86ed=_0x45c839['slice'](-0x1);if(_0xea86ed==='/'){_0x45c839=_0x45c839[_0x4296('0x58')](0x0,_0x45c839['lastIndexOf'](_0xea86ed));}return rp({'method':'GET','uri':util[_0x4296('0x59')](_0x4296('0x5a'),_0x45c839,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0x4296('0x59')](_0x4296('0x5b'),new Buffer(util['format'](_0x4296('0x5c'),_0x5aa04d[_0x4296('0x57')]))['toString'](_0x4296('0x5d')))},'json':!![]});}})[_0x4296('0x2a')](function(_0x54a6c){if(_0x54a6c){var _0x1ea1de=[_0x4296('0x5e'),_0x4296('0x5f'),'agent',_0x4296('0x60'),_0x4296('0x1e'),_0x4296('0x61'),_0x4296('0x62'),_0x4296('0x63'),_0x4296('0x64'),_0x4296('0x62'),'company'];_[_0x4296('0x65')](_0x54a6c,function(_0x12efc5){return _0x1ea1de[_0x4296('0x66')](_0x12efc5[_0x4296('0x2f')])||!_0x12efc5[_0x4296('0x67')]&&_0x12efc5[_0x4296('0x34')]!==_0x4296('0x68')&&_0x12efc5[_0x4296('0x34')]!==_0x4296('0x69');});return{'count':_0x54a6c[_0x4296('0x3b')],'rows':_[_0x4296('0x31')](_0x54a6c,function(_0x5599b8){return{'id':_0x5599b8[_0x4296('0x2f')],'name':_0x5599b8[_0x4296('0x6a')],'custom':!_0x5599b8[_0x4296('0x67')],'options':_0x5599b8[_0x4296('0x6b')]?_['map'](_0x5599b8[_0x4296('0x6b')],function(_0x5b3dce){return{'name':_[_0x4296('0x6c')](_0x5b3dce),'value':_0x5b3dce};}):[]};})};}})[_0x4296('0x2a')](respondWithResult(_0x22ab58,null))[_0x4296('0x46')](function(_0x57319b){var _0x4eeaa8=_0x171ffb[_0x4296('0x36')]['test']?0x1f4:_0x57319b['statusCode']||0x1f4;logger[_0x4296('0x2d')](_0x4296('0x6d'),_0x4296('0x6e'),_0x4eeaa8,JSON[_0x4296('0x6f')](_0x57319b));delete _0x57319b[_0x4296('0x2f')];if(_0x4eeaa8===0x191){_0x4eeaa8=0x190;}_0x22ab58[_0x4296('0x1e')](_0x4eeaa8)[_0x4296('0x70')](_0x171ffb['query']['test']?{'message':_0x4296('0x71'),'statusCode':_0x57319b[_0x4296('0x72')]}:_0x57319b);});}; \ No newline at end of file +var _0x6a55=['crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','json','offset','undefined','limit','count','Content-Range','apply','reject','destroy','then','status','error','stack','name','send','index','map','FreshdeskAccount','fieldName','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','options','include','rows','catch','show','params','rawAttributes','includeAll','create','body','update','find','getConfigurations','findOne','FreshdeskConfiguration','filter','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','GET','%s/%s','api/v2/ticket_fields','format','Basic\x20%s','%s:X','toString','requester','subject','description','priority','group','source','ticket_type','company','remove','includes','default','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x3380be,_0x30cb71){var _0x392b8a=function(_0x5ce38a){while(--_0x5ce38a){_0x3380be['push'](_0x3380be['shift']());}};_0x392b8a(++_0x30cb71);}(_0x6a55,0x154));var _0x56a5=function(_0x420d8d,_0x78b67f){_0x420d8d=_0x420d8d-0x0;var _0x4865d7=_0x6a55[_0x420d8d];return _0x4865d7;};'use strict';var emlformat=require(_0x56a5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x56a5('0x1'));var jsonpatch=require(_0x56a5('0x2'));var rp=require('request-promise');var moment=require(_0x56a5('0x3'));var BPromise=require(_0x56a5('0x4'));var Mustache=require(_0x56a5('0x5'));var util=require(_0x56a5('0x6'));var path=require(_0x56a5('0x7'));var sox=require(_0x56a5('0x8'));var csv=require(_0x56a5('0x9'));var ejs=require(_0x56a5('0xa'));var fs=require('fs');var fs_extra=require(_0x56a5('0xb'));var _=require(_0x56a5('0xc'));var squel=require(_0x56a5('0xd'));var crypto=require(_0x56a5('0xe'));var jsforce=require(_0x56a5('0xf'));var deskjs=require(_0x56a5('0x10'));var toCsv=require('to-csv');var querystring=require(_0x56a5('0x11'));var Papa=require(_0x56a5('0x12'));var Redis=require('ioredis');var authService=require(_0x56a5('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x56a5('0x14'));var logger=require(_0x56a5('0x15'))(_0x56a5('0x16'));var utils=require(_0x56a5('0x17'));var config=require(_0x56a5('0x18'));var licenseUtil=require(_0x56a5('0x19'));var db=require(_0x56a5('0x1a'))['db'];var integrations=require(_0x56a5('0x1b'));function respondWithStatusCode(_0x42dced,_0x5a80ed){_0x5a80ed=_0x5a80ed||0xcc;return function(_0x1a388c){if(_0x1a388c){return _0x42dced[_0x56a5('0x1c')](_0x5a80ed);}return _0x42dced['status'](_0x5a80ed)[_0x56a5('0x1d')]();};}function respondWithResult(_0x145174,_0x11f64d){_0x11f64d=_0x11f64d||0xc8;return function(_0x2e99f3){if(_0x2e99f3){return _0x145174['status'](_0x11f64d)[_0x56a5('0x1e')](_0x2e99f3);}};}function respondWithFilteredResult(_0xdfce42,_0x24cb7b){return function(_0x466f52){if(_0x466f52){var _0x1e06c9=typeof _0x24cb7b[_0x56a5('0x1f')]===_0x56a5('0x20')&&typeof _0x24cb7b[_0x56a5('0x21')]===_0x56a5('0x20');var _0x59ded0=_0x466f52['count'];var _0x217005=_0x1e06c9?0x0:_0x24cb7b['offset'];var _0x20f22a=_0x1e06c9?_0x466f52[_0x56a5('0x22')]:_0x24cb7b[_0x56a5('0x1f')]+_0x24cb7b[_0x56a5('0x21')];var _0x2f8585;if(_0x20f22a>=_0x59ded0){_0x20f22a=_0x59ded0;_0x2f8585=0xc8;}else{_0x2f8585=0xce;}_0xdfce42['status'](_0x2f8585);return _0xdfce42['set'](_0x56a5('0x23'),_0x217005+'-'+_0x20f22a+'/'+_0x59ded0)['json'](_0x466f52);}return null;};}function patchUpdates(_0x32b71f){return function(_0x5eaed8){try{jsonpatch[_0x56a5('0x24')](_0x5eaed8,_0x32b71f,!![]);}catch(_0x1bd05a){return BPromise[_0x56a5('0x25')](_0x1bd05a);}return _0x5eaed8['save']();};}function saveUpdates(_0x25eeb2,_0x5bdefb){return function(_0x1e0365){if(_0x1e0365){return _0x1e0365['update'](_0x25eeb2)['then'](function(_0x1228af){return _0x1228af;});}return null;};}function removeEntity(_0x488b2a,_0x2cc3c0){return function(_0x536d68){if(_0x536d68){return _0x536d68[_0x56a5('0x26')]()[_0x56a5('0x27')](function(){_0x488b2a[_0x56a5('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38b5e0,_0x2950f6){return function(_0x59158c){if(!_0x59158c){_0x38b5e0[_0x56a5('0x1c')](0x194);}return _0x59158c;};}function handleError(_0x3cb7ae,_0x3dfdaf){_0x3dfdaf=_0x3dfdaf||0x1f4;return function(_0x59ef96){logger[_0x56a5('0x29')](_0x59ef96[_0x56a5('0x2a')]);if(_0x59ef96['name']){delete _0x59ef96[_0x56a5('0x2b')];}_0x3cb7ae['status'](_0x3dfdaf)[_0x56a5('0x2c')](_0x59ef96);};}exports[_0x56a5('0x2d')]=function(_0x1355d6,_0xb1e9c5){var _0x263188={},_0x2de197={},_0x512a48={'count':0x0,'rows':[]};var _0x1ee1d7=_[_0x56a5('0x2e')](db[_0x56a5('0x2f')]['rawAttributes'],function(_0x38b761){return{'name':_0x38b761[_0x56a5('0x30')],'type':_0x38b761['type']['key']};});_0x2de197[_0x56a5('0x31')]=_[_0x56a5('0x2e')](_0x1ee1d7,_0x56a5('0x2b'));_0x2de197['query']=_[_0x56a5('0x32')](_0x1355d6['query']);_0x2de197[_0x56a5('0x33')]=_[_0x56a5('0x34')](_0x2de197[_0x56a5('0x31')],_0x2de197[_0x56a5('0x35')]);_0x263188[_0x56a5('0x36')]=_[_0x56a5('0x34')](_0x2de197['model'],qs['fields'](_0x1355d6[_0x56a5('0x35')][_0x56a5('0x37')]));_0x263188['attributes']=_0x263188[_0x56a5('0x36')][_0x56a5('0x38')]?_0x263188[_0x56a5('0x36')]:_0x2de197['model'];if(!_0x1355d6[_0x56a5('0x35')][_0x56a5('0x39')](_0x56a5('0x3a'))){_0x263188[_0x56a5('0x21')]=qs[_0x56a5('0x21')](_0x1355d6[_0x56a5('0x35')]['limit']);_0x263188[_0x56a5('0x1f')]=qs[_0x56a5('0x1f')](_0x1355d6['query'][_0x56a5('0x1f')]);}_0x263188[_0x56a5('0x3b')]=qs[_0x56a5('0x3c')](_0x1355d6[_0x56a5('0x35')]['sort']);_0x263188[_0x56a5('0x3d')]=qs[_0x56a5('0x33')](_[_0x56a5('0x3e')](_0x1355d6[_0x56a5('0x35')],_0x2de197[_0x56a5('0x33')]),_0x1ee1d7);if(_0x1355d6[_0x56a5('0x35')]['filter']){_0x263188['where']=_[_0x56a5('0x3f')](_0x263188[_0x56a5('0x3d')],{'$or':_[_0x56a5('0x2e')](_0x1ee1d7,function(_0x36f323){if(_0x36f323[_0x56a5('0x40')]!==_0x56a5('0x41')){var _0x49c7fb={};_0x49c7fb[_0x36f323[_0x56a5('0x2b')]]={'$like':'%'+_0x1355d6[_0x56a5('0x35')]['filter']+'%'};return _0x49c7fb;}})});}_0x263188=_['merge']({},_0x263188,_0x1355d6[_0x56a5('0x42')]);var _0x87be28={'where':_0x263188['where']};return db[_0x56a5('0x2f')][_0x56a5('0x22')](_0x87be28)['then'](function(_0x38d253){_0x512a48[_0x56a5('0x22')]=_0x38d253;if(_0x1355d6[_0x56a5('0x35')]['includeAll']){_0x263188[_0x56a5('0x43')]=[{'all':!![]}];}return db[_0x56a5('0x2f')]['findAll'](_0x263188);})[_0x56a5('0x27')](function(_0x4a4394){_0x512a48[_0x56a5('0x44')]=_0x4a4394;return _0x512a48;})['then'](respondWithFilteredResult(_0xb1e9c5,_0x263188))[_0x56a5('0x45')](handleError(_0xb1e9c5,null));};exports[_0x56a5('0x46')]=function(_0x4431f7,_0x5205b8){var _0x39ee9a={'raw':![],'where':{'id':_0x4431f7[_0x56a5('0x47')]['id']}},_0x5840c3={};_0x5840c3[_0x56a5('0x31')]=_[_0x56a5('0x32')](db[_0x56a5('0x2f')][_0x56a5('0x48')]);_0x5840c3[_0x56a5('0x35')]=_[_0x56a5('0x32')](_0x4431f7[_0x56a5('0x35')]);_0x5840c3['filters']=_[_0x56a5('0x34')](_0x5840c3[_0x56a5('0x31')],_0x5840c3['query']);_0x39ee9a[_0x56a5('0x36')]=_[_0x56a5('0x34')](_0x5840c3['model'],qs['fields'](_0x4431f7[_0x56a5('0x35')][_0x56a5('0x37')]));_0x39ee9a[_0x56a5('0x36')]=_0x39ee9a[_0x56a5('0x36')][_0x56a5('0x38')]?_0x39ee9a[_0x56a5('0x36')]:_0x5840c3['model'];if(_0x4431f7['query'][_0x56a5('0x49')]){_0x39ee9a[_0x56a5('0x43')]=[{'all':!![]}];}_0x39ee9a=_[_0x56a5('0x3f')]({},_0x39ee9a,_0x4431f7['options']);return db[_0x56a5('0x2f')]['find'](_0x39ee9a)[_0x56a5('0x27')](handleEntityNotFound(_0x5205b8,null))[_0x56a5('0x27')](respondWithResult(_0x5205b8,null))[_0x56a5('0x45')](handleError(_0x5205b8,null));};exports[_0x56a5('0x4a')]=function(_0x37faf5,_0x217e6b){return db[_0x56a5('0x2f')][_0x56a5('0x4a')](_0x37faf5[_0x56a5('0x4b')],{})['then'](respondWithResult(_0x217e6b,0xc9))[_0x56a5('0x45')](handleError(_0x217e6b,null));};exports[_0x56a5('0x4c')]=function(_0x5a8ba3,_0xdf5da8){if(_0x5a8ba3[_0x56a5('0x4b')]['id']){delete _0x5a8ba3[_0x56a5('0x4b')]['id'];}return db['FreshdeskAccount'][_0x56a5('0x4d')]({'where':{'id':_0x5a8ba3[_0x56a5('0x47')]['id']}})[_0x56a5('0x27')](handleEntityNotFound(_0xdf5da8,null))['then'](saveUpdates(_0x5a8ba3[_0x56a5('0x4b')],null))[_0x56a5('0x27')](respondWithResult(_0xdf5da8,null))[_0x56a5('0x45')](handleError(_0xdf5da8,null));};exports[_0x56a5('0x26')]=function(_0x2b5f2a,_0x158c41){return db[_0x56a5('0x2f')][_0x56a5('0x4d')]({'where':{'id':_0x2b5f2a[_0x56a5('0x47')]['id']}})[_0x56a5('0x27')](handleEntityNotFound(_0x158c41,null))[_0x56a5('0x27')](removeEntity(_0x158c41,null))[_0x56a5('0x45')](handleError(_0x158c41,null));};exports[_0x56a5('0x4e')]=function(_0xff01fa,_0x169bfe,_0x1a1ba9){var _0x5c3cca={};var _0x5f245f={};var _0x457e59;var _0xdc280;return db[_0x56a5('0x2f')][_0x56a5('0x4f')]({'where':{'id':_0xff01fa['params']['id']}})[_0x56a5('0x27')](handleEntityNotFound(_0x169bfe,null))[_0x56a5('0x27')](function(_0x24b4b7){if(_0x24b4b7){_0x457e59=_0x24b4b7;_0x5f245f[_0x56a5('0x31')]=_[_0x56a5('0x32')](db[_0x56a5('0x50')][_0x56a5('0x48')]);_0x5f245f[_0x56a5('0x35')]=_[_0x56a5('0x32')](_0xff01fa[_0x56a5('0x35')]);_0x5f245f[_0x56a5('0x33')]=_[_0x56a5('0x34')](_0x5f245f[_0x56a5('0x31')],_0x5f245f[_0x56a5('0x35')]);_0x5c3cca[_0x56a5('0x36')]=_[_0x56a5('0x34')](_0x5f245f[_0x56a5('0x31')],qs[_0x56a5('0x37')](_0xff01fa[_0x56a5('0x35')][_0x56a5('0x37')]));_0x5c3cca['attributes']=_0x5c3cca[_0x56a5('0x36')][_0x56a5('0x38')]?_0x5c3cca[_0x56a5('0x36')]:_0x5f245f['model'];_0x5c3cca[_0x56a5('0x3b')]=qs[_0x56a5('0x3c')](_0xff01fa['query']['sort']);_0x5c3cca[_0x56a5('0x3d')]=qs['filters'](_[_0x56a5('0x3e')](_0xff01fa[_0x56a5('0x35')],_0x5f245f[_0x56a5('0x33')]));if(_0xff01fa[_0x56a5('0x35')]['filter']){_0x5c3cca['where']=_[_0x56a5('0x3f')](_0x5c3cca[_0x56a5('0x3d')],{'$or':_['map'](_0x5c3cca['attributes'],function(_0x8bc846){var _0x5a1ca1={};_0x5a1ca1[_0x8bc846]={'$like':'%'+_0xff01fa[_0x56a5('0x35')][_0x56a5('0x51')]+'%'};return _0x5a1ca1;})});}_0x5c3cca=_[_0x56a5('0x3f')]({},_0x5c3cca,_0xff01fa[_0x56a5('0x42')]);return _0x457e59['getConfigurations'](_0x5c3cca);}})['then'](function(_0x218552){if(_0x218552){_0xdc280=_0x218552['length'];if(!_0xff01fa['query']['hasOwnProperty']('nolimit')){_0x5c3cca[_0x56a5('0x21')]=qs['limit'](_0xff01fa[_0x56a5('0x35')][_0x56a5('0x21')]);_0x5c3cca[_0x56a5('0x1f')]=qs[_0x56a5('0x1f')](_0xff01fa[_0x56a5('0x35')][_0x56a5('0x1f')]);}return _0x457e59[_0x56a5('0x4e')](_0x5c3cca);}})[_0x56a5('0x27')](function(_0x4d4a0a){if(_0x4d4a0a){return _0x4d4a0a?{'count':_0xdc280,'rows':_0x4d4a0a}:null;}})[_0x56a5('0x27')](respondWithResult(_0x169bfe,null))[_0x56a5('0x45')](handleError(_0x169bfe,null));};exports['addConfiguration']=function(_0x3e9f84,_0x1e8f8b,_0x5539f5){if(_0x3e9f84[_0x56a5('0x4b')]['id']){delete _0x3e9f84['body']['id'];}return db[_0x56a5('0x2f')][_0x56a5('0x4f')]({'where':{'id':_0x3e9f84[_0x56a5('0x47')]['id']}})[_0x56a5('0x27')](handleEntityNotFound(_0x1e8f8b,null))[_0x56a5('0x27')](function(_0x5e2245){if(_0x5e2245){_0x3e9f84[_0x56a5('0x4b')][_0x56a5('0x52')]=_0x5e2245['id'];_0x3e9f84['body'][_0x56a5('0x53')]=integrations[_0x56a5('0x54')](_0x3e9f84['body'][_0x56a5('0x55')],_0x3e9f84[_0x56a5('0x4b')][_0x56a5('0x40')]);_0x3e9f84[_0x56a5('0x4b')][_0x56a5('0x56')]=integrations[_0x56a5('0x57')](_0x3e9f84[_0x56a5('0x4b')][_0x56a5('0x55')],_0x3e9f84[_0x56a5('0x4b')][_0x56a5('0x40')]);return db[_0x56a5('0x50')][_0x56a5('0x4a')](_0x3e9f84[_0x56a5('0x4b')],{'include':[{'model':db[_0x56a5('0x58')],'as':'Subjects'},{'model':db[_0x56a5('0x58')],'as':_0x56a5('0x56')}]});}return null;})[_0x56a5('0x27')](respondWithResult(_0x1e8f8b,null))[_0x56a5('0x45')](handleError(_0x1e8f8b,null));};exports[_0x56a5('0x59')]=function(_0x3c216b,_0x422612,_0x5edeaf){var _0x101f95='';return db[_0x56a5('0x2f')][_0x56a5('0x4f')]({'where':{'id':_0x3c216b[_0x56a5('0x47')]['id']},'attributes':['id',_0x56a5('0x5a'),_0x56a5('0x5b')]})[_0x56a5('0x27')](handleEntityNotFound(_0x422612,null))[_0x56a5('0x27')](function(_0x1a72fc){if(_0x1a72fc){_0x101f95=_0x1a72fc['remoteUri'];var _0x1f4e70=_0x101f95[_0x56a5('0x5c')](-0x1);if(_0x1f4e70==='/'){_0x101f95=_0x101f95[_0x56a5('0x5d')](0x0,_0x101f95['lastIndexOf'](_0x1f4e70));}return rp({'method':_0x56a5('0x5e'),'uri':util['format'](_0x56a5('0x5f'),_0x101f95,_0x56a5('0x60')),'headers':{'Authorization':util[_0x56a5('0x61')](_0x56a5('0x62'),new Buffer(util[_0x56a5('0x61')](_0x56a5('0x63'),_0x1a72fc['apiKey']))[_0x56a5('0x64')]('base64'))},'json':!![]});}})[_0x56a5('0x27')](function(_0x15d493){if(_0x15d493){var _0x4726fd=[_0x56a5('0x65'),_0x56a5('0x66'),'agent',_0x56a5('0x67'),'status',_0x56a5('0x68'),_0x56a5('0x69'),_0x56a5('0x6a'),_0x56a5('0x6b'),_0x56a5('0x69'),_0x56a5('0x6c')];_[_0x56a5('0x6d')](_0x15d493,function(_0x54026e){return _0x4726fd[_0x56a5('0x6e')](_0x54026e[_0x56a5('0x2b')])||!_0x54026e[_0x56a5('0x6f')]&&_0x54026e['type']!=='custom_text'&&_0x54026e[_0x56a5('0x40')]!=='custom_dropdown';});return{'count':_0x15d493[_0x56a5('0x38')],'rows':_['map'](_0x15d493,function(_0x148623){return{'id':_0x148623[_0x56a5('0x2b')],'name':_0x148623['label'],'custom':!_0x148623[_0x56a5('0x6f')],'options':_0x148623[_0x56a5('0x70')]?_[_0x56a5('0x2e')](_0x148623['choices'],function(_0x3fb755){return{'name':_[_0x56a5('0x71')](_0x3fb755),'value':_0x3fb755};}):[]};})};}})[_0x56a5('0x27')](respondWithResult(_0x422612,null))[_0x56a5('0x45')](function(_0x2b31e3){var _0x111ef2=_0x3c216b[_0x56a5('0x35')][_0x56a5('0x72')]?0x1f4:_0x2b31e3[_0x56a5('0x73')]||0x1f4;logger[_0x56a5('0x29')](_0x56a5('0x74'),_0x56a5('0x59'),_0x111ef2,JSON['stringify'](_0x2b31e3));delete _0x2b31e3[_0x56a5('0x2b')];if(_0x111ef2===0x191){_0x111ef2=0x190;}_0x422612[_0x56a5('0x28')](_0x111ef2)[_0x56a5('0x2c')](_0x3c216b['query'][_0x56a5('0x72')]?{'message':_0x56a5('0x75'),'statusCode':_0x2b31e3['statusCode']}:_0x2b31e3);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index f421ace..c0c527b 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 _0x30ad=['util','../../config/logger','moment','bluebird','path','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash'];(function(_0x583ba8,_0x10134a){var _0x1d0ca4=function(_0x31f828){while(--_0x31f828){_0x583ba8['push'](_0x583ba8['shift']());}};_0x1d0ca4(++_0x10134a);}(_0x30ad,0x1ac));var _0xd30a=function(_0x3666e5,_0x2e1a4e){_0x3666e5=_0x3666e5-0x0;var _0x3e6a36=_0x30ad[_0x3666e5];return _0x3e6a36;};'use strict';var _=require(_0xd30a('0x0'));var util=require(_0xd30a('0x1'));var logger=require(_0xd30a('0x2'))('api');var moment=require(_0xd30a('0x3'));var BPromise=require(_0xd30a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd30a('0x5'));var rimraf=require('rimraf');var config=require(_0xd30a('0x6'));var attributes=require(_0xd30a('0x7'));var integrations=require(_0xd30a('0x8'));module[_0xd30a('0x9')]=function(_0x23113e,_0x36ff2d){return _0x23113e[_0xd30a('0xa')](_0xd30a('0xb'),attributes,{'tableName':_0xd30a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfb64=['../../config/environment','../../components/integrations/configuration','exports','FreshdeskAccount','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0xb948b4,_0x27f4d9){var _0x507513=function(_0x3453db){while(--_0x3453db){_0xb948b4['push'](_0xb948b4['shift']());}};_0x507513(++_0x27f4d9);}(_0xfb64,0x16c));var _0x4fb6=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xfb64[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x4fb6('0x0'));var util=require(_0x4fb6('0x1'));var logger=require(_0x4fb6('0x2'))(_0x4fb6('0x3'));var moment=require(_0x4fb6('0x4'));var BPromise=require(_0x4fb6('0x5'));var rp=require(_0x4fb6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4fb6('0x7'));var config=require(_0x4fb6('0x8'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0x4fb6('0x9'));module[_0x4fb6('0xa')]=function(_0x2d1b8f,_0x26775a){return _0x2d1b8f['define'](_0x4fb6('0xb'),attributes,{'tableName':'int_freshdesk_accounts','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 316ff6a..83673bb 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 _0x5daf=['catch','ShowFreshdeskAccount','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','GetFreshdeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','info','stringify'];(function(_0x2d321f,_0x196439){var _0x16744f=function(_0x539eb7){while(--_0x539eb7){_0x2d321f['push'](_0x2d321f['shift']());}};_0x16744f(++_0x196439);}(_0x5daf,0x19a));var _0xf5da=function(_0x1c22f6,_0x3ed040){_0x1c22f6=_0x1c22f6-0x0;var _0x1b5c66=_0x5daf[_0x1c22f6];return _0x1b5c66;};'use strict';var _=require(_0xf5da('0x0'));var util=require(_0xf5da('0x1'));var moment=require('moment');var BPromise=require(_0xf5da('0x2'));var rs=require(_0xf5da('0x3'));var fs=require('fs');var Redis=require(_0xf5da('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf5da('0x5'))(_0xf5da('0x6'));var config=require(_0xf5da('0x7'));var jayson=require(_0xf5da('0x8'));var client=jayson[_0xf5da('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc9c1c4,_0x34e75a,_0x2238dc){return new BPromise(function(_0x5520c5,_0x1e7d80){return client[_0xf5da('0xa')](_0xc9c1c4,_0x2238dc)['then'](function(_0x1cb33c){logger['info'](_0xf5da('0xb'),_0x34e75a,_0xf5da('0xc'));logger[_0xf5da('0xd')](_0xf5da('0xe'),_0x34e75a,_0xf5da('0xc'),JSON['stringify'](_0x1cb33c));if(_0x1cb33c['error']){if(_0x1cb33c[_0xf5da('0xf')][_0xf5da('0x10')]===0x1f4){logger[_0xf5da('0xf')](_0xf5da('0xb'),_0x34e75a,_0x1cb33c['error']['message']);return _0x1e7d80(_0x1cb33c['error'][_0xf5da('0x11')]);}logger[_0xf5da('0xf')](_0xf5da('0xb'),_0x34e75a,_0x1cb33c[_0xf5da('0xf')][_0xf5da('0x11')]);return _0x5520c5(_0x1cb33c[_0xf5da('0xf')]['message']);}else{logger['info'](_0xf5da('0xb'),_0x34e75a,_0xf5da('0xc'));_0x5520c5(_0x1cb33c[_0xf5da('0x12')][_0xf5da('0x11')]);}})['catch'](function(_0x3057ae){logger['error'](_0xf5da('0xb'),_0x34e75a,_0x3057ae);_0x1e7d80(_0x3057ae);});});}exports[_0xf5da('0x13')]=function(_0x455c17){var _0x2ec1ec=this;return new Promise(function(_0x34c57b,_0x997927){return db['FreshdeskAccount'][_0xf5da('0x14')]({'raw':_0x455c17['options']?_0x455c17[_0xf5da('0x15')][_0xf5da('0x16')]===undefined?!![]:![]:!![],'where':_0x455c17[_0xf5da('0x15')]?_0x455c17[_0xf5da('0x15')][_0xf5da('0x17')]||null:null,'attributes':_0x455c17[_0xf5da('0x15')]?_0x455c17[_0xf5da('0x15')][_0xf5da('0x18')]||null:null,'limit':_0x455c17['options']?_0x455c17['options'][_0xf5da('0x19')]||null:null,'include':_0x455c17[_0xf5da('0x15')]?_0x455c17[_0xf5da('0x15')][_0xf5da('0x1a')]?_[_0xf5da('0x1b')](_0x455c17['options'][_0xf5da('0x1a')],function(_0x284d71){return{'model':db[_0x284d71[_0xf5da('0x1c')]],'as':_0x284d71['as'],'attributes':_0x284d71[_0xf5da('0x18')],'include':_0x284d71[_0xf5da('0x1a')]?_[_0xf5da('0x1b')](_0x284d71[_0xf5da('0x1a')],function(_0x11d460){return{'model':db[_0x11d460['model']],'as':_0x11d460['as'],'attributes':_0x11d460[_0xf5da('0x18')],'include':_0x11d460[_0xf5da('0x1a')]?_['map'](_0x11d460['include'],function(_0x560c57){return{'model':db[_0x560c57[_0xf5da('0x1c')]],'as':_0x560c57['as'],'attributes':_0x560c57[_0xf5da('0x18')]};}):[]};}):[]};}):[]:[]})[_0xf5da('0x1d')](function(_0x2b76df){logger[_0xf5da('0x1e')](_0xf5da('0x13'),_0x455c17);logger[_0xf5da('0xd')](_0xf5da('0x13'),_0x455c17,JSON[_0xf5da('0x1f')](_0x2b76df));_0x34c57b(_0x2b76df);})[_0xf5da('0x20')](function(_0x3cfa02){logger[_0xf5da('0xf')](_0xf5da('0x13'),_0x3cfa02['message'],_0x455c17);_0x997927(_0x2ec1ec[_0xf5da('0xf')](0x1f4,_0x3cfa02[_0xf5da('0x11')]));});});};exports[_0xf5da('0x21')]=function(_0xc4b26){var _0x2de036=this;return new Promise(function(_0x27a66f,_0x3bd22f){return db['FreshdeskAccount']['find']({'raw':_0xc4b26['options']?_0xc4b26[_0xf5da('0x15')][_0xf5da('0x16')]===undefined?!![]:![]:!![],'where':_0xc4b26[_0xf5da('0x15')]?_0xc4b26[_0xf5da('0x15')][_0xf5da('0x17')]||null:null,'attributes':_0xc4b26[_0xf5da('0x15')]?_0xc4b26[_0xf5da('0x15')]['attributes']||null:null,'include':_0xc4b26[_0xf5da('0x15')]?_0xc4b26['options'][_0xf5da('0x1a')]?_[_0xf5da('0x1b')](_0xc4b26[_0xf5da('0x15')][_0xf5da('0x1a')],function(_0x4f947e){return{'model':db[_0x4f947e[_0xf5da('0x1c')]],'as':_0x4f947e['as'],'attributes':_0x4f947e[_0xf5da('0x18')],'include':_0x4f947e[_0xf5da('0x1a')]?_[_0xf5da('0x1b')](_0x4f947e['include'],function(_0x169539){return{'model':db[_0x169539[_0xf5da('0x1c')]],'as':_0x169539['as'],'attributes':_0x169539[_0xf5da('0x18')],'include':_0x169539['include']?_[_0xf5da('0x1b')](_0x169539['include'],function(_0x4b50dc){return{'model':db[_0x4b50dc['model']],'as':_0x4b50dc['as'],'attributes':_0x4b50dc[_0xf5da('0x18')]};}):[]};}):[]};}):[]:[]})[_0xf5da('0x1d')](function(_0x2d5c42){logger[_0xf5da('0x1e')](_0xf5da('0x21'),_0xc4b26);logger[_0xf5da('0xd')](_0xf5da('0x21'),_0xc4b26,JSON[_0xf5da('0x1f')](_0x2d5c42));_0x27a66f(_0x2d5c42);})['catch'](function(_0xfb8e9d){logger[_0xf5da('0xf')](_0xf5da('0x21'),_0xfb8e9d['message'],_0xc4b26);_0x3bd22f(_0x2de036[_0xf5da('0xf')](0x1f4,_0xfb8e9d[_0xf5da('0x11')]));});});}; \ No newline at end of file +var _0x5db6=['include','map','model','ShowFreshdeskAccount','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','FreshdeskAccount,\x20%s,\x20%s','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','attributes','limit'];(function(_0x3a039a,_0x554982){var _0x540457=function(_0x41b402){while(--_0x41b402){_0x3a039a['push'](_0x3a039a['shift']());}};_0x540457(++_0x554982);}(_0x5db6,0x88));var _0x65db=function(_0x5363a3,_0x3c6310){_0x5363a3=_0x5363a3-0x0;var _0x4cd0c6=_0x5db6[_0x5363a3];return _0x4cd0c6;};'use strict';var _=require(_0x65db('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x65db('0x1'));var db=require(_0x65db('0x2'))['db'];var utils=require(_0x65db('0x3'));var logger=require(_0x65db('0x4'))(_0x65db('0x5'));var config=require(_0x65db('0x6'));var jayson=require(_0x65db('0x7'));var client=jayson[_0x65db('0x8')][_0x65db('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x15cf75,_0x21a7c5,_0x36242b){return new BPromise(function(_0x254457,_0x439251){return client[_0x65db('0xa')](_0x15cf75,_0x36242b)[_0x65db('0xb')](function(_0x37215c){logger[_0x65db('0xc')]('FreshdeskAccount,\x20%s,\x20%s',_0x21a7c5,_0x65db('0xd'));logger[_0x65db('0xe')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x21a7c5,'request\x20sent',JSON[_0x65db('0xf')](_0x37215c));if(_0x37215c[_0x65db('0x10')]){if(_0x37215c[_0x65db('0x10')]['code']===0x1f4){logger[_0x65db('0x10')](_0x65db('0x11'),_0x21a7c5,_0x37215c[_0x65db('0x10')]['message']);return _0x439251(_0x37215c[_0x65db('0x10')]['message']);}logger[_0x65db('0x10')](_0x65db('0x11'),_0x21a7c5,_0x37215c['error'][_0x65db('0x12')]);return _0x254457(_0x37215c[_0x65db('0x10')][_0x65db('0x12')]);}else{logger[_0x65db('0xc')](_0x65db('0x11'),_0x21a7c5,_0x65db('0xd'));_0x254457(_0x37215c[_0x65db('0x13')][_0x65db('0x12')]);}})[_0x65db('0x14')](function(_0x333ff0){logger['error'](_0x65db('0x11'),_0x21a7c5,_0x333ff0);_0x439251(_0x333ff0);});});}exports[_0x65db('0x15')]=function(_0x2be1c5){var _0x57f88f=this;return new Promise(function(_0x12a452,_0x3ebc70){return db[_0x65db('0x16')][_0x65db('0x17')]({'raw':_0x2be1c5[_0x65db('0x18')]?_0x2be1c5[_0x65db('0x18')][_0x65db('0x19')]===undefined?!![]:![]:!![],'where':_0x2be1c5[_0x65db('0x18')]?_0x2be1c5[_0x65db('0x18')][_0x65db('0x1a')]||null:null,'attributes':_0x2be1c5['options']?_0x2be1c5['options'][_0x65db('0x1b')]||null:null,'limit':_0x2be1c5['options']?_0x2be1c5[_0x65db('0x18')][_0x65db('0x1c')]||null:null,'include':_0x2be1c5[_0x65db('0x18')]?_0x2be1c5['options'][_0x65db('0x1d')]?_[_0x65db('0x1e')](_0x2be1c5['options'][_0x65db('0x1d')],function(_0x175da5){return{'model':db[_0x175da5[_0x65db('0x1f')]],'as':_0x175da5['as'],'attributes':_0x175da5[_0x65db('0x1b')],'include':_0x175da5[_0x65db('0x1d')]?_[_0x65db('0x1e')](_0x175da5[_0x65db('0x1d')],function(_0x4812e1){return{'model':db[_0x4812e1[_0x65db('0x1f')]],'as':_0x4812e1['as'],'attributes':_0x4812e1[_0x65db('0x1b')],'include':_0x4812e1['include']?_[_0x65db('0x1e')](_0x4812e1[_0x65db('0x1d')],function(_0x1b22b1){return{'model':db[_0x1b22b1[_0x65db('0x1f')]],'as':_0x1b22b1['as'],'attributes':_0x1b22b1[_0x65db('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x733e08){logger['info']('GetFreshdeskAccount',_0x2be1c5);logger['debug']('GetFreshdeskAccount',_0x2be1c5,JSON[_0x65db('0xf')](_0x733e08));_0x12a452(_0x733e08);})[_0x65db('0x14')](function(_0x9ed5a0){logger['error']('GetFreshdeskAccount',_0x9ed5a0[_0x65db('0x12')],_0x2be1c5);_0x3ebc70(_0x57f88f[_0x65db('0x10')](0x1f4,_0x9ed5a0[_0x65db('0x12')]));});});};exports[_0x65db('0x20')]=function(_0x446e82){var _0xb03794=this;return new Promise(function(_0x3afa83,_0x36e5f8){return db[_0x65db('0x16')]['find']({'raw':_0x446e82['options']?_0x446e82['options'][_0x65db('0x19')]===undefined?!![]:![]:!![],'where':_0x446e82['options']?_0x446e82['options']['where']||null:null,'attributes':_0x446e82['options']?_0x446e82[_0x65db('0x18')][_0x65db('0x1b')]||null:null,'include':_0x446e82[_0x65db('0x18')]?_0x446e82[_0x65db('0x18')]['include']?_[_0x65db('0x1e')](_0x446e82[_0x65db('0x18')]['include'],function(_0x3b333f){return{'model':db[_0x3b333f[_0x65db('0x1f')]],'as':_0x3b333f['as'],'attributes':_0x3b333f[_0x65db('0x1b')],'include':_0x3b333f[_0x65db('0x1d')]?_['map'](_0x3b333f[_0x65db('0x1d')],function(_0x16bb13){return{'model':db[_0x16bb13[_0x65db('0x1f')]],'as':_0x16bb13['as'],'attributes':_0x16bb13[_0x65db('0x1b')],'include':_0x16bb13[_0x65db('0x1d')]?_['map'](_0x16bb13[_0x65db('0x1d')],function(_0x396d14){return{'model':db[_0x396d14[_0x65db('0x1f')]],'as':_0x396d14['as'],'attributes':_0x396d14[_0x65db('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x65db('0xb')](function(_0x4a8817){logger[_0x65db('0xc')](_0x65db('0x20'),_0x446e82);logger['debug'](_0x65db('0x20'),_0x446e82,JSON['stringify'](_0x4a8817));_0x3afa83(_0x4a8817);})[_0x65db('0x14')](function(_0x15c45a){logger['error'](_0x65db('0x20'),_0x15c45a[_0x65db('0x12')],_0x446e82);_0x36e5f8(_0xb03794[_0x65db('0x10')](0x1f4,_0x15c45a[_0x65db('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 86930f7..874082b 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 _0x7dfb=['setTags','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7dfb,0xd5));var _0xb7df=function(_0x257642,_0x270a80){_0x257642=_0x257642-0x0;var _0x3d813b=_0x7dfb[_0x257642];return _0x3d813b;};'use strict';var multer=require(_0xb7df('0x0'));var util=require(_0xb7df('0x1'));var path=require(_0xb7df('0x2'));var timeout=require(_0xb7df('0x3'));var express=require(_0xb7df('0x4'));var router=express[_0xb7df('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb7df('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb7df('0x7'));var controller=require('./intFreshdeskConfiguration.controller');router[_0xb7df('0x8')]('/',auth['isAuthenticated'](),controller[_0xb7df('0x9')]);router[_0xb7df('0x8')](_0xb7df('0xa'),auth[_0xb7df('0xb')](),controller[_0xb7df('0xc')]);router[_0xb7df('0x8')](_0xb7df('0xd'),auth[_0xb7df('0xb')](),controller[_0xb7df('0xe')]);router[_0xb7df('0x8')](_0xb7df('0xf'),auth['isAuthenticated'](),controller[_0xb7df('0x10')]);router[_0xb7df('0x8')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0xb7df('0x11')]);router[_0xb7df('0x8')](_0xb7df('0x12'),auth['isAuthenticated'](),controller[_0xb7df('0x13')]);router[_0xb7df('0x14')]('/',auth[_0xb7df('0xb')](),controller['create']);router[_0xb7df('0x14')](_0xb7df('0x12'),auth[_0xb7df('0xb')](),controller[_0xb7df('0x15')]);router[_0xb7df('0x16')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xb7df('0x17')](_0xb7df('0xa'),auth['isAuthenticated'](),controller[_0xb7df('0x18')]);module[_0xb7df('0x19')]=router; \ No newline at end of file +var _0xf41c=['../../components/auth/service','./intFreshdeskConfiguration.controller','get','show','/:id/fields','isAuthenticated','getFields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','post','put','/:id','update','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x3b7b42,_0x31badd){var _0x1ebaad=function(_0x3655d9){while(--_0x3655d9){_0x3b7b42['push'](_0x3b7b42['shift']());}};_0x1ebaad(++_0x31badd);}(_0xf41c,0x68));var _0xcf41=function(_0x23ea8d,_0x49986f){_0x23ea8d=_0x23ea8d-0x0;var _0x6a93cd=_0xf41c[_0x23ea8d];return _0x6a93cd;};'use strict';var multer=require(_0xcf41('0x0'));var util=require(_0xcf41('0x1'));var path=require(_0xcf41('0x2'));var timeout=require(_0xcf41('0x3'));var express=require(_0xcf41('0x4'));var router=express[_0xcf41('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xcf41('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xcf41('0x7'));router[_0xcf41('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0xcf41('0x9')]);router['get'](_0xcf41('0xa'),auth[_0xcf41('0xb')](),controller[_0xcf41('0xc')]);router[_0xcf41('0x8')](_0xcf41('0xd'),auth[_0xcf41('0xb')](),controller[_0xcf41('0xe')]);router[_0xcf41('0x8')]('/:id/descriptions',auth[_0xcf41('0xb')](),controller[_0xcf41('0xf')]);router[_0xcf41('0x8')](_0xcf41('0x10'),auth[_0xcf41('0xb')](),controller['getTags']);router[_0xcf41('0x11')]('/',auth[_0xcf41('0xb')](),controller['create']);router[_0xcf41('0x11')](_0xcf41('0x10'),auth['isAuthenticated'](),controller['setTags']);router[_0xcf41('0x12')](_0xcf41('0x13'),auth[_0xcf41('0xb')](),controller[_0xcf41('0x14')]);router['delete'](_0xcf41('0x13'),auth[_0xcf41('0xb')](),controller['destroy']);module[_0xcf41('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 133ee8d..f863f10 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 _0x322f=['sequelize','exports'];(function(_0x49a233,_0x30a86a){var _0x44a818=function(_0x3ab7be){while(--_0x3ab7be){_0x49a233['push'](_0x49a233['shift']());}};_0x44a818(++_0x30a86a);}(_0x322f,0x1b6));var _0xf322=function(_0x5bcf21,_0x11751e){_0x5bcf21=_0x5bcf21-0x0;var _0x2c1a2b=_0x322f[_0x5bcf21];return _0x2c1a2b;};'use strict';var Sequelize=require(_0xf322('0x0'));module[_0xf322('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf735=['STRING','sequelize','exports'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0xf735,0xa9));var _0x5f73=function(_0x37ecb1,_0x28ecfb){_0x37ecb1=_0x37ecb1-0x0;var _0x5297df=_0xf735[_0x37ecb1];return _0x5297df;};'use strict';var Sequelize=require(_0x5f73('0x0'));module[_0x5f73('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5f73('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index df6ed25..a527478 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 _0xc571=['map','query','intersection','fields','attributes','length','nolimit','sort','where','filters','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','create','body','find','getFields','findOne','FreshdeskField','order','filter','getSubjects','getDescriptions','hasOwnProperty','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','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','name','send','index','FreshdeskConfiguration','rawAttributes','type','key','model'];(function(_0x3e3147,_0x4aa189){var _0xb82c1a=function(_0x3aa496){while(--_0x3aa496){_0x3e3147['push'](_0x3e3147['shift']());}};_0xb82c1a(++_0x4aa189);}(_0xc571,0x12a));var _0x1c57=function(_0x5c18ef,_0xa2e81d){_0x5c18ef=_0x5c18ef-0x0;var _0x33789d=_0xc571[_0x5c18ef];return _0x33789d;};'use strict';var emlformat=require(_0x1c57('0x0'));var rimraf=require(_0x1c57('0x1'));var zipdir=require(_0x1c57('0x2'));var jsonpatch=require(_0x1c57('0x3'));var rp=require(_0x1c57('0x4'));var moment=require(_0x1c57('0x5'));var BPromise=require(_0x1c57('0x6'));var Mustache=require(_0x1c57('0x7'));var util=require('util');var path=require(_0x1c57('0x8'));var sox=require(_0x1c57('0x9'));var csv=require(_0x1c57('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1c57('0xb'));var squel=require(_0x1c57('0xc'));var crypto=require(_0x1c57('0xd'));var jsforce=require(_0x1c57('0xe'));var deskjs=require(_0x1c57('0xf'));var toCsv=require(_0x1c57('0xa'));var querystring=require(_0x1c57('0x10'));var Papa=require('papaparse');var Redis=require(_0x1c57('0x11'));var authService=require(_0x1c57('0x12'));var qs=require(_0x1c57('0x13'));var as=require(_0x1c57('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1c57('0x15'));var utils=require(_0x1c57('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x1c57('0x17'));var db=require(_0x1c57('0x18'))['db'];function respondWithStatusCode(_0x34b9ac,_0x5ed187){_0x5ed187=_0x5ed187||0xcc;return function(_0x15e62c){if(_0x15e62c){return _0x34b9ac[_0x1c57('0x19')](_0x5ed187);}return _0x34b9ac[_0x1c57('0x1a')](_0x5ed187)[_0x1c57('0x1b')]();};}function respondWithResult(_0x312041,_0x115541){_0x115541=_0x115541||0xc8;return function(_0x1ac138){if(_0x1ac138){return _0x312041['status'](_0x115541)[_0x1c57('0x1c')](_0x1ac138);}};}function respondWithFilteredResult(_0x30760a,_0x1bcfd3){return function(_0x4ed29d){if(_0x4ed29d){var _0x44d3e9=typeof _0x1bcfd3[_0x1c57('0x1d')]===_0x1c57('0x1e')&&typeof _0x1bcfd3[_0x1c57('0x1f')]===_0x1c57('0x1e');var _0xf78666=_0x4ed29d[_0x1c57('0x20')];var _0x2f1e8e=_0x44d3e9?0x0:_0x1bcfd3[_0x1c57('0x1d')];var _0x29d5a0=_0x44d3e9?_0x4ed29d[_0x1c57('0x20')]:_0x1bcfd3[_0x1c57('0x1d')]+_0x1bcfd3[_0x1c57('0x1f')];var _0x479b13;if(_0x29d5a0>=_0xf78666){_0x29d5a0=_0xf78666;_0x479b13=0xc8;}else{_0x479b13=0xce;}_0x30760a[_0x1c57('0x1a')](_0x479b13);return _0x30760a[_0x1c57('0x21')](_0x1c57('0x22'),_0x2f1e8e+'-'+_0x29d5a0+'/'+_0xf78666)[_0x1c57('0x1c')](_0x4ed29d);}return null;};}function patchUpdates(_0x4d8d16){return function(_0x2213a3){try{jsonpatch[_0x1c57('0x23')](_0x2213a3,_0x4d8d16,!![]);}catch(_0x5090e4){return BPromise[_0x1c57('0x24')](_0x5090e4);}return _0x2213a3[_0x1c57('0x25')]();};}function saveUpdates(_0x3162c6,_0x248876){return function(_0x4ad9c8){if(_0x4ad9c8){return _0x4ad9c8[_0x1c57('0x26')](_0x3162c6)[_0x1c57('0x27')](function(_0x54271c){return _0x54271c;});}return null;};}function removeEntity(_0x51767e,_0x2d97c1){return function(_0x4cb28a){if(_0x4cb28a){return _0x4cb28a[_0x1c57('0x28')]()[_0x1c57('0x27')](function(){_0x51767e[_0x1c57('0x1a')](0xcc)[_0x1c57('0x1b')]();});}};}function handleEntityNotFound(_0x15b979,_0x15cc57){return function(_0x150171){if(!_0x150171){_0x15b979[_0x1c57('0x19')](0x194);}return _0x150171;};}function handleError(_0x20f3db,_0x433fcc){_0x433fcc=_0x433fcc||0x1f4;return function(_0x58c0fb){logger[_0x1c57('0x29')](_0x58c0fb['stack']);if(_0x58c0fb[_0x1c57('0x2a')]){delete _0x58c0fb[_0x1c57('0x2a')];}_0x20f3db[_0x1c57('0x1a')](_0x433fcc)[_0x1c57('0x2b')](_0x58c0fb);};}exports[_0x1c57('0x2c')]=function(_0x222eac,_0x259030){var _0x5cc751={},_0x5b9736={},_0x124efa={'count':0x0,'rows':[]};var _0x1812bb=_['map'](db[_0x1c57('0x2d')][_0x1c57('0x2e')],function(_0xf47a86){return{'name':_0xf47a86['fieldName'],'type':_0xf47a86[_0x1c57('0x2f')][_0x1c57('0x30')]};});_0x5b9736[_0x1c57('0x31')]=_[_0x1c57('0x32')](_0x1812bb,_0x1c57('0x2a'));_0x5b9736[_0x1c57('0x33')]=_['keys'](_0x222eac['query']);_0x5b9736['filters']=_['intersection'](_0x5b9736[_0x1c57('0x31')],_0x5b9736[_0x1c57('0x33')]);_0x5cc751['attributes']=_[_0x1c57('0x34')](_0x5b9736['model'],qs[_0x1c57('0x35')](_0x222eac[_0x1c57('0x33')]['fields']));_0x5cc751[_0x1c57('0x36')]=_0x5cc751[_0x1c57('0x36')][_0x1c57('0x37')]?_0x5cc751[_0x1c57('0x36')]:_0x5b9736['model'];if(!_0x222eac[_0x1c57('0x33')]['hasOwnProperty'](_0x1c57('0x38'))){_0x5cc751[_0x1c57('0x1f')]=qs[_0x1c57('0x1f')](_0x222eac['query'][_0x1c57('0x1f')]);_0x5cc751[_0x1c57('0x1d')]=qs[_0x1c57('0x1d')](_0x222eac[_0x1c57('0x33')][_0x1c57('0x1d')]);}_0x5cc751['order']=qs['sort'](_0x222eac[_0x1c57('0x33')][_0x1c57('0x39')]);_0x5cc751[_0x1c57('0x3a')]=qs[_0x1c57('0x3b')](_[_0x1c57('0x3c')](_0x222eac[_0x1c57('0x33')],_0x5b9736[_0x1c57('0x3b')]),_0x1812bb);if(_0x222eac[_0x1c57('0x33')]['filter']){_0x5cc751['where']=_[_0x1c57('0x3d')](_0x5cc751[_0x1c57('0x3a')],{'$or':_[_0x1c57('0x32')](_0x1812bb,function(_0x3a7eb8){if(_0x3a7eb8[_0x1c57('0x2f')]!==_0x1c57('0x3e')){var _0xcd5f9={};_0xcd5f9[_0x3a7eb8[_0x1c57('0x2a')]]={'$like':'%'+_0x222eac[_0x1c57('0x33')]['filter']+'%'};return _0xcd5f9;}})});}_0x5cc751=_[_0x1c57('0x3d')]({},_0x5cc751,_0x222eac[_0x1c57('0x3f')]);var _0x1084b1={'where':_0x5cc751[_0x1c57('0x3a')]};return db['FreshdeskConfiguration']['count'](_0x1084b1)[_0x1c57('0x27')](function(_0x29868b){_0x124efa['count']=_0x29868b;if(_0x222eac[_0x1c57('0x33')][_0x1c57('0x40')]){_0x5cc751[_0x1c57('0x41')]=[{'all':!![]}];}return db[_0x1c57('0x2d')][_0x1c57('0x42')](_0x5cc751);})['then'](function(_0x239aa1){_0x124efa[_0x1c57('0x43')]=_0x239aa1;return _0x124efa;})[_0x1c57('0x27')](respondWithFilteredResult(_0x259030,_0x5cc751))[_0x1c57('0x44')](handleError(_0x259030,null));};exports[_0x1c57('0x45')]=function(_0x4015e7,_0x431bd4){var _0xbe8344={'raw':![],'where':{'id':_0x4015e7[_0x1c57('0x46')]['id']}},_0x590a8e={};_0x590a8e['model']=_[_0x1c57('0x47')](db[_0x1c57('0x2d')][_0x1c57('0x2e')]);_0x590a8e[_0x1c57('0x33')]=_['keys'](_0x4015e7['query']);_0x590a8e[_0x1c57('0x3b')]=_[_0x1c57('0x34')](_0x590a8e[_0x1c57('0x31')],_0x590a8e[_0x1c57('0x33')]);_0xbe8344[_0x1c57('0x36')]=_[_0x1c57('0x34')](_0x590a8e[_0x1c57('0x31')],qs[_0x1c57('0x35')](_0x4015e7['query'][_0x1c57('0x35')]));_0xbe8344[_0x1c57('0x36')]=_0xbe8344[_0x1c57('0x36')]['length']?_0xbe8344[_0x1c57('0x36')]:_0x590a8e['model'];if(_0x4015e7[_0x1c57('0x33')][_0x1c57('0x40')]){_0xbe8344[_0x1c57('0x41')]=[{'all':!![]}];}_0xbe8344=_[_0x1c57('0x3d')]({},_0xbe8344,_0x4015e7[_0x1c57('0x3f')]);return db[_0x1c57('0x2d')]['find'](_0xbe8344)['then'](handleEntityNotFound(_0x431bd4,null))[_0x1c57('0x27')](respondWithResult(_0x431bd4,null))[_0x1c57('0x44')](handleError(_0x431bd4,null));};exports['create']=function(_0x124603,_0x44cdbb){return db[_0x1c57('0x2d')][_0x1c57('0x48')](_0x124603[_0x1c57('0x49')],{})[_0x1c57('0x27')](respondWithResult(_0x44cdbb,0xc9))[_0x1c57('0x44')](handleError(_0x44cdbb,null));};exports[_0x1c57('0x26')]=function(_0x238484,_0xabfb54){if(_0x238484[_0x1c57('0x49')]['id']){delete _0x238484['body']['id'];}return db['FreshdeskConfiguration'][_0x1c57('0x4a')]({'where':{'id':_0x238484['params']['id']}})['then'](handleEntityNotFound(_0xabfb54,null))[_0x1c57('0x27')](saveUpdates(_0x238484[_0x1c57('0x49')],null))['then'](respondWithResult(_0xabfb54,null))[_0x1c57('0x44')](handleError(_0xabfb54,null));};exports['destroy']=function(_0x21adf5,_0x1b1a44){return db['FreshdeskConfiguration'][_0x1c57('0x4a')]({'where':{'id':_0x21adf5['params']['id']}})['then'](handleEntityNotFound(_0x1b1a44,null))[_0x1c57('0x27')](removeEntity(_0x1b1a44,null))['catch'](handleError(_0x1b1a44,null));};exports[_0x1c57('0x4b')]=function(_0x4a2252,_0x32f75a,_0x4aedb2){var _0xf3bf0c={};var _0x4c86fa={};var _0x1039cc;var _0x5aaa7f;return db['FreshdeskConfiguration'][_0x1c57('0x4c')]({'where':{'id':_0x4a2252[_0x1c57('0x46')]['id']}})[_0x1c57('0x27')](handleEntityNotFound(_0x32f75a,null))[_0x1c57('0x27')](function(_0xf5146c){if(_0xf5146c){_0x1039cc=_0xf5146c;_0x4c86fa['model']=_[_0x1c57('0x47')](db[_0x1c57('0x4d')][_0x1c57('0x2e')]);_0x4c86fa[_0x1c57('0x33')]=_[_0x1c57('0x47')](_0x4a2252[_0x1c57('0x33')]);_0x4c86fa[_0x1c57('0x3b')]=_[_0x1c57('0x34')](_0x4c86fa['model'],_0x4c86fa[_0x1c57('0x33')]);_0xf3bf0c[_0x1c57('0x36')]=_['intersection'](_0x4c86fa['model'],qs[_0x1c57('0x35')](_0x4a2252[_0x1c57('0x33')][_0x1c57('0x35')]));_0xf3bf0c[_0x1c57('0x36')]=_0xf3bf0c[_0x1c57('0x36')][_0x1c57('0x37')]?_0xf3bf0c[_0x1c57('0x36')]:_0x4c86fa[_0x1c57('0x31')];_0xf3bf0c[_0x1c57('0x4e')]=qs[_0x1c57('0x39')](_0x4a2252[_0x1c57('0x33')]['sort']);_0xf3bf0c[_0x1c57('0x3a')]=qs['filters'](_[_0x1c57('0x3c')](_0x4a2252['query'],_0x4c86fa[_0x1c57('0x3b')]));if(_0x4a2252['query'][_0x1c57('0x4f')]){_0xf3bf0c[_0x1c57('0x3a')]=_[_0x1c57('0x3d')](_0xf3bf0c['where'],{'$or':_[_0x1c57('0x32')](_0xf3bf0c['attributes'],function(_0x4fa758){var _0x4be49f={};_0x4be49f[_0x4fa758]={'$like':'%'+_0x4a2252['query']['filter']+'%'};return _0x4be49f;})});}_0xf3bf0c=_['merge']({},_0xf3bf0c,_0x4a2252['options']);return _0x1039cc[_0x1c57('0x4b')](_0xf3bf0c);}})[_0x1c57('0x27')](function(_0x163dd1){if(_0x163dd1){_0x5aaa7f=_0x163dd1[_0x1c57('0x37')];if(!_0x4a2252['query']['hasOwnProperty'](_0x1c57('0x38'))){_0xf3bf0c[_0x1c57('0x1f')]=qs['limit'](_0x4a2252[_0x1c57('0x33')][_0x1c57('0x1f')]);_0xf3bf0c['offset']=qs[_0x1c57('0x1d')](_0x4a2252[_0x1c57('0x33')]['offset']);}return _0x1039cc['getFields'](_0xf3bf0c);}})[_0x1c57('0x27')](function(_0x362f24){if(_0x362f24){return _0x362f24?{'count':_0x5aaa7f,'rows':_0x362f24}:null;}})[_0x1c57('0x27')](respondWithResult(_0x32f75a,null))[_0x1c57('0x44')](handleError(_0x32f75a,null));};exports['getSubjects']=function(_0x6ecef,_0x5f7a57,_0x48b081){var _0x4f0dad={};var _0xed8938={};var _0x108475;var _0x2caa89;return db['FreshdeskConfiguration'][_0x1c57('0x4c')]({'where':{'id':_0x6ecef[_0x1c57('0x46')]['id']}})['then'](handleEntityNotFound(_0x5f7a57,null))[_0x1c57('0x27')](function(_0x597fc5){if(_0x597fc5){_0x108475=_0x597fc5;_0xed8938[_0x1c57('0x31')]=_[_0x1c57('0x47')](db[_0x1c57('0x4d')][_0x1c57('0x2e')]);_0xed8938[_0x1c57('0x33')]=_[_0x1c57('0x47')](_0x6ecef[_0x1c57('0x33')]);_0xed8938['filters']=_[_0x1c57('0x34')](_0xed8938[_0x1c57('0x31')],_0xed8938[_0x1c57('0x33')]);_0x4f0dad[_0x1c57('0x36')]=_[_0x1c57('0x34')](_0xed8938[_0x1c57('0x31')],qs['fields'](_0x6ecef['query'][_0x1c57('0x35')]));_0x4f0dad[_0x1c57('0x36')]=_0x4f0dad[_0x1c57('0x36')][_0x1c57('0x37')]?_0x4f0dad[_0x1c57('0x36')]:_0xed8938[_0x1c57('0x31')];_0x4f0dad['order']=qs[_0x1c57('0x39')](_0x6ecef[_0x1c57('0x33')][_0x1c57('0x39')]);_0x4f0dad[_0x1c57('0x3a')]=qs[_0x1c57('0x3b')](_['pick'](_0x6ecef[_0x1c57('0x33')],_0xed8938[_0x1c57('0x3b')]));if(_0x6ecef[_0x1c57('0x33')][_0x1c57('0x4f')]){_0x4f0dad['where']=_[_0x1c57('0x3d')](_0x4f0dad['where'],{'$or':_[_0x1c57('0x32')](_0x4f0dad['attributes'],function(_0x5d066c){var _0x423b5b={};_0x423b5b[_0x5d066c]={'$like':'%'+_0x6ecef['query'][_0x1c57('0x4f')]+'%'};return _0x423b5b;})});}_0x4f0dad=_[_0x1c57('0x3d')]({},_0x4f0dad,_0x6ecef[_0x1c57('0x3f')]);return _0x108475[_0x1c57('0x50')](_0x4f0dad);}})[_0x1c57('0x27')](function(_0x5d79bc){if(_0x5d79bc){_0x2caa89=_0x5d79bc[_0x1c57('0x37')];if(!_0x6ecef[_0x1c57('0x33')]['hasOwnProperty'](_0x1c57('0x38'))){_0x4f0dad[_0x1c57('0x1f')]=qs[_0x1c57('0x1f')](_0x6ecef['query'][_0x1c57('0x1f')]);_0x4f0dad['offset']=qs[_0x1c57('0x1d')](_0x6ecef['query'][_0x1c57('0x1d')]);}return _0x108475['getSubjects'](_0x4f0dad);}})[_0x1c57('0x27')](function(_0x221ef2){if(_0x221ef2){return _0x221ef2?{'count':_0x2caa89,'rows':_0x221ef2}:null;}})[_0x1c57('0x27')](respondWithResult(_0x5f7a57,null))[_0x1c57('0x44')](handleError(_0x5f7a57,null));};exports[_0x1c57('0x51')]=function(_0x3b4171,_0x795f48,_0x37e99f){var _0x5edfe0={};var _0x19b0a3={};var _0x396ba7;var _0xcd6fa1;return db['FreshdeskConfiguration'][_0x1c57('0x4c')]({'where':{'id':_0x3b4171[_0x1c57('0x46')]['id']}})[_0x1c57('0x27')](handleEntityNotFound(_0x795f48,null))[_0x1c57('0x27')](function(_0x9c2a6a){if(_0x9c2a6a){_0x396ba7=_0x9c2a6a;_0x19b0a3['model']=_[_0x1c57('0x47')](db[_0x1c57('0x4d')]['rawAttributes']);_0x19b0a3['query']=_[_0x1c57('0x47')](_0x3b4171[_0x1c57('0x33')]);_0x19b0a3['filters']=_[_0x1c57('0x34')](_0x19b0a3['model'],_0x19b0a3[_0x1c57('0x33')]);_0x5edfe0[_0x1c57('0x36')]=_[_0x1c57('0x34')](_0x19b0a3['model'],qs['fields'](_0x3b4171['query'][_0x1c57('0x35')]));_0x5edfe0[_0x1c57('0x36')]=_0x5edfe0['attributes'][_0x1c57('0x37')]?_0x5edfe0[_0x1c57('0x36')]:_0x19b0a3[_0x1c57('0x31')];_0x5edfe0[_0x1c57('0x4e')]=qs[_0x1c57('0x39')](_0x3b4171[_0x1c57('0x33')]['sort']);_0x5edfe0[_0x1c57('0x3a')]=qs[_0x1c57('0x3b')](_[_0x1c57('0x3c')](_0x3b4171[_0x1c57('0x33')],_0x19b0a3[_0x1c57('0x3b')]));if(_0x3b4171[_0x1c57('0x33')][_0x1c57('0x4f')]){_0x5edfe0['where']=_[_0x1c57('0x3d')](_0x5edfe0[_0x1c57('0x3a')],{'$or':_['map'](_0x5edfe0[_0x1c57('0x36')],function(_0x40efcc){var _0x1c0ef8={};_0x1c0ef8[_0x40efcc]={'$like':'%'+_0x3b4171[_0x1c57('0x33')]['filter']+'%'};return _0x1c0ef8;})});}_0x5edfe0=_[_0x1c57('0x3d')]({},_0x5edfe0,_0x3b4171['options']);return _0x396ba7[_0x1c57('0x51')](_0x5edfe0);}})[_0x1c57('0x27')](function(_0x3ad57e){if(_0x3ad57e){_0xcd6fa1=_0x3ad57e[_0x1c57('0x37')];if(!_0x3b4171[_0x1c57('0x33')][_0x1c57('0x52')](_0x1c57('0x38'))){_0x5edfe0[_0x1c57('0x1f')]=qs['limit'](_0x3b4171[_0x1c57('0x33')][_0x1c57('0x1f')]);_0x5edfe0['offset']=qs[_0x1c57('0x1d')](_0x3b4171['query'][_0x1c57('0x1d')]);}return _0x396ba7[_0x1c57('0x51')](_0x5edfe0);}})[_0x1c57('0x27')](function(_0x5556fb){if(_0x5556fb){return _0x5556fb?{'count':_0xcd6fa1,'rows':_0x5556fb}:null;}})['then'](respondWithResult(_0x795f48,null))[_0x1c57('0x44')](handleError(_0x795f48,null));};exports[_0x1c57('0x53')]=function(_0x3eac01,_0x1364fe,_0x2d2f2a){var _0x120e09={};var _0xbe6995={};var _0xfbf239;var _0x51c761;return db[_0x1c57('0x2d')][_0x1c57('0x4c')]({'where':{'id':_0x3eac01[_0x1c57('0x46')]['id']}})[_0x1c57('0x27')](handleEntityNotFound(_0x1364fe,null))[_0x1c57('0x27')](function(_0x1cee17){if(_0x1cee17){_0xfbf239=_0x1cee17;_0xbe6995[_0x1c57('0x31')]=_['keys'](db[_0x1c57('0x54')][_0x1c57('0x2e')]);_0xbe6995['query']=_['keys'](_0x3eac01['query']);_0xbe6995[_0x1c57('0x3b')]=_[_0x1c57('0x34')](_0xbe6995[_0x1c57('0x31')],_0xbe6995[_0x1c57('0x33')]);_0x120e09[_0x1c57('0x36')]=_[_0x1c57('0x34')](_0xbe6995[_0x1c57('0x31')],qs[_0x1c57('0x35')](_0x3eac01['query'][_0x1c57('0x35')]));_0x120e09[_0x1c57('0x36')]=_0x120e09[_0x1c57('0x36')][_0x1c57('0x37')]?_0x120e09['attributes']:_0xbe6995[_0x1c57('0x31')];_0x120e09[_0x1c57('0x4e')]=qs['sort'](_0x3eac01[_0x1c57('0x33')][_0x1c57('0x39')]);_0x120e09['where']=qs[_0x1c57('0x3b')](_[_0x1c57('0x3c')](_0x3eac01['query'],_0xbe6995['filters']));if(_0x3eac01['query'][_0x1c57('0x4f')]){_0x120e09['where']=_['merge'](_0x120e09['where'],{'$or':_[_0x1c57('0x32')](_0x120e09[_0x1c57('0x36')],function(_0x221a76){var _0x2b2123={};_0x2b2123[_0x221a76]={'$like':'%'+_0x3eac01['query'][_0x1c57('0x4f')]+'%'};return _0x2b2123;})});}_0x120e09=_[_0x1c57('0x3d')]({},_0x120e09,_0x3eac01['options']);return _0xfbf239[_0x1c57('0x53')](_0x120e09);}})[_0x1c57('0x27')](function(_0x5e3b99){if(_0x5e3b99){_0x51c761=_0x5e3b99[_0x1c57('0x37')];if(!_0x3eac01[_0x1c57('0x33')][_0x1c57('0x52')](_0x1c57('0x38'))){_0x120e09[_0x1c57('0x1f')]=qs['limit'](_0x3eac01[_0x1c57('0x33')][_0x1c57('0x1f')]);_0x120e09[_0x1c57('0x1d')]=qs[_0x1c57('0x1d')](_0x3eac01[_0x1c57('0x33')]['offset']);}return _0xfbf239[_0x1c57('0x53')](_0x120e09);}})[_0x1c57('0x27')](function(_0x1415a9){if(_0x1415a9){return _0x1415a9?{'count':_0x51c761,'rows':_0x1415a9}:null;}})[_0x1c57('0x27')](respondWithResult(_0x1364fe,null))['catch'](handleError(_0x1364fe,null));};exports['setTags']=function(_0x123fb8,_0x57dbe7,_0x59df56){if(_0x123fb8[_0x1c57('0x49')]['id']){delete _0x123fb8['body']['id'];}return db[_0x1c57('0x2d')]['findOne']({'where':{'id':_0x123fb8['params']['id']}})[_0x1c57('0x27')](handleEntityNotFound(_0x57dbe7,null))[_0x1c57('0x27')](function(_0x14d974){if(_0x14d974){return _0x14d974[_0x1c57('0x55')](_0x123fb8['body'][_0x1c57('0x56')]||[]);}return null;})[_0x1c57('0x27')](respondWithResult(_0x57dbe7,null))[_0x1c57('0x44')](handleError(_0x57dbe7,null));}; \ No newline at end of file +var _0x8167=['findOne','FreshdeskField','order','getFields','getSubjects','pick','getDescriptions','getTags','Tag','setTags','ids','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','model','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','FreshdeskConfiguration','includeAll','include','findAll','catch','show','params','fields','body','find'];(function(_0x43e1e6,_0x399da){var _0x58753d=function(_0x260aba){while(--_0x260aba){_0x43e1e6['push'](_0x43e1e6['shift']());}};_0x58753d(++_0x399da);}(_0x8167,0x1a0));var _0x7816=function(_0x23526d,_0x556f4c){_0x23526d=_0x23526d-0x0;var _0x2338fb=_0x8167[_0x23526d];return _0x2338fb;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7816('0x0'));var jsonpatch=require(_0x7816('0x1'));var rp=require(_0x7816('0x2'));var moment=require('moment');var BPromise=require(_0x7816('0x3'));var Mustache=require(_0x7816('0x4'));var util=require(_0x7816('0x5'));var path=require(_0x7816('0x6'));var sox=require(_0x7816('0x7'));var csv=require(_0x7816('0x8'));var ejs=require(_0x7816('0x9'));var fs=require('fs');var fs_extra=require(_0x7816('0xa'));var _=require(_0x7816('0xb'));var squel=require(_0x7816('0xc'));var crypto=require('crypto');var jsforce=require(_0x7816('0xd'));var deskjs=require(_0x7816('0xe'));var toCsv=require(_0x7816('0x8'));var querystring=require('querystring');var Papa=require(_0x7816('0xf'));var Redis=require('ioredis');var authService=require(_0x7816('0x10'));var qs=require(_0x7816('0x11'));var as=require(_0x7816('0x12'));var hardwareService=require(_0x7816('0x13'));var logger=require(_0x7816('0x14'))(_0x7816('0x15'));var utils=require(_0x7816('0x16'));var config=require(_0x7816('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x46098c,_0x1aa12b){_0x1aa12b=_0x1aa12b||0xcc;return function(_0x3de70d){if(_0x3de70d){return _0x46098c[_0x7816('0x18')](_0x1aa12b);}return _0x46098c[_0x7816('0x19')](_0x1aa12b)['end']();};}function respondWithResult(_0x358db6,_0x46967b){_0x46967b=_0x46967b||0xc8;return function(_0x42dd1c){if(_0x42dd1c){return _0x358db6['status'](_0x46967b)['json'](_0x42dd1c);}};}function respondWithFilteredResult(_0x13c012,_0x268b27){return function(_0x284d88){if(_0x284d88){var _0x4897ca=typeof _0x268b27[_0x7816('0x1a')]===_0x7816('0x1b')&&typeof _0x268b27[_0x7816('0x1c')]===_0x7816('0x1b');var _0x2cbc7a=_0x284d88[_0x7816('0x1d')];var _0x22b659=_0x4897ca?0x0:_0x268b27[_0x7816('0x1a')];var _0x1238ce=_0x4897ca?_0x284d88[_0x7816('0x1d')]:_0x268b27[_0x7816('0x1a')]+_0x268b27[_0x7816('0x1c')];var _0x16a537;if(_0x1238ce>=_0x2cbc7a){_0x1238ce=_0x2cbc7a;_0x16a537=0xc8;}else{_0x16a537=0xce;}_0x13c012[_0x7816('0x19')](_0x16a537);return _0x13c012['set'](_0x7816('0x1e'),_0x22b659+'-'+_0x1238ce+'/'+_0x2cbc7a)[_0x7816('0x1f')](_0x284d88);}return null;};}function patchUpdates(_0x497509){return function(_0xd5ab63){try{jsonpatch[_0x7816('0x20')](_0xd5ab63,_0x497509,!![]);}catch(_0x637734){return BPromise['reject'](_0x637734);}return _0xd5ab63[_0x7816('0x21')]();};}function saveUpdates(_0x455693,_0x260cd8){return function(_0x1238b6){if(_0x1238b6){return _0x1238b6[_0x7816('0x22')](_0x455693)[_0x7816('0x23')](function(_0xf099e4){return _0xf099e4;});}return null;};}function removeEntity(_0x4788ff,_0x28122d){return function(_0x3b8156){if(_0x3b8156){return _0x3b8156[_0x7816('0x24')]()[_0x7816('0x23')](function(){_0x4788ff[_0x7816('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe080ff,_0x5ebfae){return function(_0x112d22){if(!_0x112d22){_0xe080ff['sendStatus'](0x194);}return _0x112d22;};}function handleError(_0x2bee07,_0x46d5e9){_0x46d5e9=_0x46d5e9||0x1f4;return function(_0x51ec0f){logger['error'](_0x51ec0f[_0x7816('0x25')]);if(_0x51ec0f['name']){delete _0x51ec0f[_0x7816('0x26')];}_0x2bee07[_0x7816('0x19')](_0x46d5e9)[_0x7816('0x27')](_0x51ec0f);};}exports[_0x7816('0x28')]=function(_0x32387f,_0x487828){var _0x503a42={},_0x5d0c80={},_0x51bb52={'count':0x0,'rows':[]};var _0x162f23=_[_0x7816('0x29')](db['FreshdeskConfiguration'][_0x7816('0x2a')],function(_0x97731b){return{'name':_0x97731b[_0x7816('0x2b')],'type':_0x97731b[_0x7816('0x2c')]['key']};});_0x5d0c80['model']=_[_0x7816('0x29')](_0x162f23,_0x7816('0x26'));_0x5d0c80[_0x7816('0x2d')]=_[_0x7816('0x2e')](_0x32387f[_0x7816('0x2d')]);_0x5d0c80[_0x7816('0x2f')]=_[_0x7816('0x30')](_0x5d0c80['model'],_0x5d0c80['query']);_0x503a42[_0x7816('0x31')]=_[_0x7816('0x30')](_0x5d0c80[_0x7816('0x32')],qs['fields'](_0x32387f['query']['fields']));_0x503a42[_0x7816('0x31')]=_0x503a42[_0x7816('0x31')][_0x7816('0x33')]?_0x503a42[_0x7816('0x31')]:_0x5d0c80[_0x7816('0x32')];if(!_0x32387f[_0x7816('0x2d')][_0x7816('0x34')](_0x7816('0x35'))){_0x503a42[_0x7816('0x1c')]=qs[_0x7816('0x1c')](_0x32387f[_0x7816('0x2d')][_0x7816('0x1c')]);_0x503a42[_0x7816('0x1a')]=qs['offset'](_0x32387f[_0x7816('0x2d')][_0x7816('0x1a')]);}_0x503a42['order']=qs[_0x7816('0x36')](_0x32387f[_0x7816('0x2d')]['sort']);_0x503a42['where']=qs[_0x7816('0x2f')](_['pick'](_0x32387f[_0x7816('0x2d')],_0x5d0c80[_0x7816('0x2f')]),_0x162f23);if(_0x32387f[_0x7816('0x2d')]['filter']){_0x503a42[_0x7816('0x37')]=_[_0x7816('0x38')](_0x503a42[_0x7816('0x37')],{'$or':_[_0x7816('0x29')](_0x162f23,function(_0xb01485){if(_0xb01485[_0x7816('0x2c')]!==_0x7816('0x39')){var _0x1dcd4a={};_0x1dcd4a[_0xb01485[_0x7816('0x26')]]={'$like':'%'+_0x32387f['query'][_0x7816('0x3a')]+'%'};return _0x1dcd4a;}})});}_0x503a42=_[_0x7816('0x38')]({},_0x503a42,_0x32387f[_0x7816('0x3b')]);var _0x2aeabd={'where':_0x503a42[_0x7816('0x37')]};return db[_0x7816('0x3c')][_0x7816('0x1d')](_0x2aeabd)['then'](function(_0x38dba5){_0x51bb52[_0x7816('0x1d')]=_0x38dba5;if(_0x32387f[_0x7816('0x2d')][_0x7816('0x3d')]){_0x503a42[_0x7816('0x3e')]=[{'all':!![]}];}return db[_0x7816('0x3c')][_0x7816('0x3f')](_0x503a42);})[_0x7816('0x23')](function(_0x14e5b8){_0x51bb52['rows']=_0x14e5b8;return _0x51bb52;})['then'](respondWithFilteredResult(_0x487828,_0x503a42))[_0x7816('0x40')](handleError(_0x487828,null));};exports[_0x7816('0x41')]=function(_0x2cc089,_0x115d5d){var _0x4c0c26={'raw':![],'where':{'id':_0x2cc089[_0x7816('0x42')]['id']}},_0x3461bb={};_0x3461bb[_0x7816('0x32')]=_[_0x7816('0x2e')](db['FreshdeskConfiguration'][_0x7816('0x2a')]);_0x3461bb[_0x7816('0x2d')]=_[_0x7816('0x2e')](_0x2cc089[_0x7816('0x2d')]);_0x3461bb[_0x7816('0x2f')]=_[_0x7816('0x30')](_0x3461bb[_0x7816('0x32')],_0x3461bb['query']);_0x4c0c26[_0x7816('0x31')]=_[_0x7816('0x30')](_0x3461bb[_0x7816('0x32')],qs[_0x7816('0x43')](_0x2cc089[_0x7816('0x2d')][_0x7816('0x43')]));_0x4c0c26[_0x7816('0x31')]=_0x4c0c26[_0x7816('0x31')][_0x7816('0x33')]?_0x4c0c26['attributes']:_0x3461bb[_0x7816('0x32')];if(_0x2cc089['query'][_0x7816('0x3d')]){_0x4c0c26[_0x7816('0x3e')]=[{'all':!![]}];}_0x4c0c26=_[_0x7816('0x38')]({},_0x4c0c26,_0x2cc089[_0x7816('0x3b')]);return db[_0x7816('0x3c')]['find'](_0x4c0c26)[_0x7816('0x23')](handleEntityNotFound(_0x115d5d,null))[_0x7816('0x23')](respondWithResult(_0x115d5d,null))[_0x7816('0x40')](handleError(_0x115d5d,null));};exports['create']=function(_0x383d0d,_0x5f15f6){return db['FreshdeskConfiguration']['create'](_0x383d0d[_0x7816('0x44')],{})['then'](respondWithResult(_0x5f15f6,0xc9))[_0x7816('0x40')](handleError(_0x5f15f6,null));};exports['update']=function(_0x409c10,_0x5f4fb1){if(_0x409c10['body']['id']){delete _0x409c10[_0x7816('0x44')]['id'];}return db[_0x7816('0x3c')][_0x7816('0x45')]({'where':{'id':_0x409c10['params']['id']}})['then'](handleEntityNotFound(_0x5f4fb1,null))[_0x7816('0x23')](saveUpdates(_0x409c10[_0x7816('0x44')],null))[_0x7816('0x23')](respondWithResult(_0x5f4fb1,null))[_0x7816('0x40')](handleError(_0x5f4fb1,null));};exports['destroy']=function(_0xccc709,_0x2dfda6){return db[_0x7816('0x3c')][_0x7816('0x45')]({'where':{'id':_0xccc709['params']['id']}})['then'](handleEntityNotFound(_0x2dfda6,null))[_0x7816('0x23')](removeEntity(_0x2dfda6,null))[_0x7816('0x40')](handleError(_0x2dfda6,null));};exports['getFields']=function(_0x16e627,_0x3771a0,_0x11ffdb){var _0x518eed={};var _0x25e46a={};var _0x1ae5de;var _0x612531;return db['FreshdeskConfiguration'][_0x7816('0x46')]({'where':{'id':_0x16e627[_0x7816('0x42')]['id']}})['then'](handleEntityNotFound(_0x3771a0,null))[_0x7816('0x23')](function(_0x2584a1){if(_0x2584a1){_0x1ae5de=_0x2584a1;_0x25e46a[_0x7816('0x32')]=_['keys'](db[_0x7816('0x47')][_0x7816('0x2a')]);_0x25e46a[_0x7816('0x2d')]=_['keys'](_0x16e627[_0x7816('0x2d')]);_0x25e46a[_0x7816('0x2f')]=_[_0x7816('0x30')](_0x25e46a[_0x7816('0x32')],_0x25e46a[_0x7816('0x2d')]);_0x518eed[_0x7816('0x31')]=_[_0x7816('0x30')](_0x25e46a[_0x7816('0x32')],qs[_0x7816('0x43')](_0x16e627[_0x7816('0x2d')][_0x7816('0x43')]));_0x518eed[_0x7816('0x31')]=_0x518eed[_0x7816('0x31')][_0x7816('0x33')]?_0x518eed[_0x7816('0x31')]:_0x25e46a[_0x7816('0x32')];_0x518eed[_0x7816('0x48')]=qs[_0x7816('0x36')](_0x16e627[_0x7816('0x2d')][_0x7816('0x36')]);_0x518eed[_0x7816('0x37')]=qs[_0x7816('0x2f')](_['pick'](_0x16e627[_0x7816('0x2d')],_0x25e46a[_0x7816('0x2f')]));if(_0x16e627[_0x7816('0x2d')][_0x7816('0x3a')]){_0x518eed[_0x7816('0x37')]=_[_0x7816('0x38')](_0x518eed[_0x7816('0x37')],{'$or':_['map'](_0x518eed[_0x7816('0x31')],function(_0x659bd0){var _0x49c9a0={};_0x49c9a0[_0x659bd0]={'$like':'%'+_0x16e627[_0x7816('0x2d')][_0x7816('0x3a')]+'%'};return _0x49c9a0;})});}_0x518eed=_[_0x7816('0x38')]({},_0x518eed,_0x16e627[_0x7816('0x3b')]);return _0x1ae5de[_0x7816('0x49')](_0x518eed);}})['then'](function(_0x23ac83){if(_0x23ac83){_0x612531=_0x23ac83[_0x7816('0x33')];if(!_0x16e627['query'][_0x7816('0x34')](_0x7816('0x35'))){_0x518eed[_0x7816('0x1c')]=qs['limit'](_0x16e627['query'][_0x7816('0x1c')]);_0x518eed[_0x7816('0x1a')]=qs[_0x7816('0x1a')](_0x16e627[_0x7816('0x2d')][_0x7816('0x1a')]);}return _0x1ae5de[_0x7816('0x49')](_0x518eed);}})[_0x7816('0x23')](function(_0x21cac4){if(_0x21cac4){return _0x21cac4?{'count':_0x612531,'rows':_0x21cac4}:null;}})[_0x7816('0x23')](respondWithResult(_0x3771a0,null))[_0x7816('0x40')](handleError(_0x3771a0,null));};exports[_0x7816('0x4a')]=function(_0x509ac6,_0x5d66c7,_0x25fe06){var _0x3dee05={};var _0x3d75b5={};var _0x584601;var _0x1db41e;return db['FreshdeskConfiguration'][_0x7816('0x46')]({'where':{'id':_0x509ac6[_0x7816('0x42')]['id']}})[_0x7816('0x23')](handleEntityNotFound(_0x5d66c7,null))['then'](function(_0x166be1){if(_0x166be1){_0x584601=_0x166be1;_0x3d75b5[_0x7816('0x32')]=_[_0x7816('0x2e')](db[_0x7816('0x47')]['rawAttributes']);_0x3d75b5[_0x7816('0x2d')]=_[_0x7816('0x2e')](_0x509ac6[_0x7816('0x2d')]);_0x3d75b5[_0x7816('0x2f')]=_[_0x7816('0x30')](_0x3d75b5['model'],_0x3d75b5[_0x7816('0x2d')]);_0x3dee05['attributes']=_[_0x7816('0x30')](_0x3d75b5[_0x7816('0x32')],qs[_0x7816('0x43')](_0x509ac6[_0x7816('0x2d')][_0x7816('0x43')]));_0x3dee05['attributes']=_0x3dee05[_0x7816('0x31')][_0x7816('0x33')]?_0x3dee05[_0x7816('0x31')]:_0x3d75b5[_0x7816('0x32')];_0x3dee05[_0x7816('0x48')]=qs[_0x7816('0x36')](_0x509ac6[_0x7816('0x2d')][_0x7816('0x36')]);_0x3dee05[_0x7816('0x37')]=qs[_0x7816('0x2f')](_[_0x7816('0x4b')](_0x509ac6['query'],_0x3d75b5[_0x7816('0x2f')]));if(_0x509ac6[_0x7816('0x2d')][_0x7816('0x3a')]){_0x3dee05[_0x7816('0x37')]=_[_0x7816('0x38')](_0x3dee05[_0x7816('0x37')],{'$or':_[_0x7816('0x29')](_0x3dee05[_0x7816('0x31')],function(_0x39afa2){var _0x2901d8={};_0x2901d8[_0x39afa2]={'$like':'%'+_0x509ac6[_0x7816('0x2d')][_0x7816('0x3a')]+'%'};return _0x2901d8;})});}_0x3dee05=_[_0x7816('0x38')]({},_0x3dee05,_0x509ac6['options']);return _0x584601[_0x7816('0x4a')](_0x3dee05);}})['then'](function(_0x2faf26){if(_0x2faf26){_0x1db41e=_0x2faf26[_0x7816('0x33')];if(!_0x509ac6['query']['hasOwnProperty'](_0x7816('0x35'))){_0x3dee05['limit']=qs[_0x7816('0x1c')](_0x509ac6[_0x7816('0x2d')][_0x7816('0x1c')]);_0x3dee05[_0x7816('0x1a')]=qs['offset'](_0x509ac6[_0x7816('0x2d')][_0x7816('0x1a')]);}return _0x584601['getSubjects'](_0x3dee05);}})[_0x7816('0x23')](function(_0x3a7329){if(_0x3a7329){return _0x3a7329?{'count':_0x1db41e,'rows':_0x3a7329}:null;}})[_0x7816('0x23')](respondWithResult(_0x5d66c7,null))[_0x7816('0x40')](handleError(_0x5d66c7,null));};exports['getDescriptions']=function(_0x4aca75,_0x430a85,_0x20d45f){var _0x43094e={};var _0x520725={};var _0x2de26e;var _0x18259f;return db[_0x7816('0x3c')]['findOne']({'where':{'id':_0x4aca75[_0x7816('0x42')]['id']}})[_0x7816('0x23')](handleEntityNotFound(_0x430a85,null))['then'](function(_0x349c83){if(_0x349c83){_0x2de26e=_0x349c83;_0x520725[_0x7816('0x32')]=_['keys'](db[_0x7816('0x47')][_0x7816('0x2a')]);_0x520725['query']=_[_0x7816('0x2e')](_0x4aca75['query']);_0x520725[_0x7816('0x2f')]=_[_0x7816('0x30')](_0x520725[_0x7816('0x32')],_0x520725[_0x7816('0x2d')]);_0x43094e[_0x7816('0x31')]=_['intersection'](_0x520725['model'],qs[_0x7816('0x43')](_0x4aca75['query'][_0x7816('0x43')]));_0x43094e[_0x7816('0x31')]=_0x43094e[_0x7816('0x31')][_0x7816('0x33')]?_0x43094e[_0x7816('0x31')]:_0x520725[_0x7816('0x32')];_0x43094e[_0x7816('0x48')]=qs[_0x7816('0x36')](_0x4aca75[_0x7816('0x2d')][_0x7816('0x36')]);_0x43094e[_0x7816('0x37')]=qs[_0x7816('0x2f')](_[_0x7816('0x4b')](_0x4aca75[_0x7816('0x2d')],_0x520725[_0x7816('0x2f')]));if(_0x4aca75[_0x7816('0x2d')]['filter']){_0x43094e[_0x7816('0x37')]=_[_0x7816('0x38')](_0x43094e[_0x7816('0x37')],{'$or':_[_0x7816('0x29')](_0x43094e[_0x7816('0x31')],function(_0x262562){var _0x263059={};_0x263059[_0x262562]={'$like':'%'+_0x4aca75[_0x7816('0x2d')]['filter']+'%'};return _0x263059;})});}_0x43094e=_[_0x7816('0x38')]({},_0x43094e,_0x4aca75[_0x7816('0x3b')]);return _0x2de26e[_0x7816('0x4c')](_0x43094e);}})['then'](function(_0x3eda5b){if(_0x3eda5b){_0x18259f=_0x3eda5b[_0x7816('0x33')];if(!_0x4aca75[_0x7816('0x2d')][_0x7816('0x34')]('nolimit')){_0x43094e[_0x7816('0x1c')]=qs['limit'](_0x4aca75['query'][_0x7816('0x1c')]);_0x43094e[_0x7816('0x1a')]=qs[_0x7816('0x1a')](_0x4aca75['query'][_0x7816('0x1a')]);}return _0x2de26e[_0x7816('0x4c')](_0x43094e);}})['then'](function(_0x33dd08){if(_0x33dd08){return _0x33dd08?{'count':_0x18259f,'rows':_0x33dd08}:null;}})[_0x7816('0x23')](respondWithResult(_0x430a85,null))[_0x7816('0x40')](handleError(_0x430a85,null));};exports[_0x7816('0x4d')]=function(_0x55f5b7,_0xde1371,_0x4b0046){var _0x5b15e6={};var _0x23459e={};var _0x422426;var _0x5ee6e4;return db[_0x7816('0x3c')]['findOne']({'where':{'id':_0x55f5b7[_0x7816('0x42')]['id']}})[_0x7816('0x23')](handleEntityNotFound(_0xde1371,null))[_0x7816('0x23')](function(_0xc3c329){if(_0xc3c329){_0x422426=_0xc3c329;_0x23459e['model']=_[_0x7816('0x2e')](db[_0x7816('0x4e')][_0x7816('0x2a')]);_0x23459e[_0x7816('0x2d')]=_['keys'](_0x55f5b7[_0x7816('0x2d')]);_0x23459e[_0x7816('0x2f')]=_['intersection'](_0x23459e[_0x7816('0x32')],_0x23459e['query']);_0x5b15e6[_0x7816('0x31')]=_['intersection'](_0x23459e[_0x7816('0x32')],qs[_0x7816('0x43')](_0x55f5b7[_0x7816('0x2d')][_0x7816('0x43')]));_0x5b15e6[_0x7816('0x31')]=_0x5b15e6[_0x7816('0x31')][_0x7816('0x33')]?_0x5b15e6[_0x7816('0x31')]:_0x23459e['model'];_0x5b15e6[_0x7816('0x48')]=qs[_0x7816('0x36')](_0x55f5b7[_0x7816('0x2d')][_0x7816('0x36')]);_0x5b15e6['where']=qs[_0x7816('0x2f')](_['pick'](_0x55f5b7[_0x7816('0x2d')],_0x23459e[_0x7816('0x2f')]));if(_0x55f5b7[_0x7816('0x2d')][_0x7816('0x3a')]){_0x5b15e6['where']=_['merge'](_0x5b15e6[_0x7816('0x37')],{'$or':_[_0x7816('0x29')](_0x5b15e6['attributes'],function(_0x52c081){var _0x34d798={};_0x34d798[_0x52c081]={'$like':'%'+_0x55f5b7[_0x7816('0x2d')][_0x7816('0x3a')]+'%'};return _0x34d798;})});}_0x5b15e6=_[_0x7816('0x38')]({},_0x5b15e6,_0x55f5b7[_0x7816('0x3b')]);return _0x422426[_0x7816('0x4d')](_0x5b15e6);}})[_0x7816('0x23')](function(_0x19d554){if(_0x19d554){_0x5ee6e4=_0x19d554[_0x7816('0x33')];if(!_0x55f5b7['query'][_0x7816('0x34')](_0x7816('0x35'))){_0x5b15e6[_0x7816('0x1c')]=qs[_0x7816('0x1c')](_0x55f5b7[_0x7816('0x2d')][_0x7816('0x1c')]);_0x5b15e6[_0x7816('0x1a')]=qs[_0x7816('0x1a')](_0x55f5b7['query'][_0x7816('0x1a')]);}return _0x422426[_0x7816('0x4d')](_0x5b15e6);}})[_0x7816('0x23')](function(_0x4b0e21){if(_0x4b0e21){return _0x4b0e21?{'count':_0x5ee6e4,'rows':_0x4b0e21}:null;}})['then'](respondWithResult(_0xde1371,null))[_0x7816('0x40')](handleError(_0xde1371,null));};exports[_0x7816('0x4f')]=function(_0x116ac3,_0x3f081a,_0x3b66cc){if(_0x116ac3[_0x7816('0x44')]['id']){delete _0x116ac3[_0x7816('0x44')]['id'];}return db['FreshdeskConfiguration'][_0x7816('0x46')]({'where':{'id':_0x116ac3[_0x7816('0x42')]['id']}})['then'](handleEntityNotFound(_0x3f081a,null))[_0x7816('0x23')](function(_0x5489da){if(_0x5489da){return _0x5489da[_0x7816('0x4f')](_0x116ac3[_0x7816('0x44')][_0x7816('0x50')]||[]);}return null;})[_0x7816('0x23')](respondWithResult(_0x3f081a,null))[_0x7816('0x40')](handleError(_0x3f081a,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index a20cc43..42cc136 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 _0x83e0=['moment','bluebird','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','api'];(function(_0x57b694,_0x548682){var _0x24a583=function(_0x39c158){while(--_0x39c158){_0x57b694['push'](_0x57b694['shift']());}};_0x24a583(++_0x548682);}(_0x83e0,0x140));var _0x083e=function(_0x4967f1,_0x3879e8){_0x4967f1=_0x4967f1-0x0;var _0x38cf66=_0x83e0[_0x4967f1];return _0x38cf66;};'use strict';var _=require(_0x083e('0x0'));var util=require(_0x083e('0x1'));var logger=require(_0x083e('0x2'))(_0x083e('0x3'));var moment=require(_0x083e('0x4'));var BPromise=require(_0x083e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x083e('0x6'));var config=require(_0x083e('0x7'));var attributes=require(_0x083e('0x8'));module['exports']=function(_0x2a55f0,_0x5ac486){return _0x2a55f0[_0x083e('0x9')](_0x083e('0xa'),attributes,{'tableName':_0x083e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x14c3=['moment','path','../../config/environment','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','../../config/logger','api'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x14c3,0x180));var _0x314c=function(_0x24d42d,_0xc19482){_0x24d42d=_0x24d42d-0x0;var _0x1a6ec4=_0x14c3[_0x24d42d];return _0x1a6ec4;};'use strict';var _=require(_0x314c('0x0'));var util=require('util');var logger=require(_0x314c('0x1'))(_0x314c('0x2'));var moment=require(_0x314c('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x314c('0x4'));var rimraf=require('rimraf');var config=require(_0x314c('0x5'));var attributes=require('./intFreshdeskConfiguration.attributes');module['exports']=function(_0x11bb6c,_0x427281){return _0x11bb6c[_0x314c('0x6')](_0x314c('0x7'),attributes,{'tableName':_0x314c('0x8'),'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 3912a1a..2d30cc1 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 _0xc376=['../../config/logger','rpc','jayson/promise','http','request','then','info','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','../../mysqldb'];(function(_0x2aa7f6,_0x387d0d){var _0x3b5cd0=function(_0x389f20){while(--_0x389f20){_0x2aa7f6['push'](_0x2aa7f6['shift']());}};_0x3b5cd0(++_0x387d0d);}(_0xc376,0xa4));var _0x6c37=function(_0x285824,_0x3da647){_0x285824=_0x285824-0x0;var _0x311d7e=_0xc376[_0x285824];return _0x311d7e;};'use strict';var _=require(_0x6c37('0x0'));var util=require(_0x6c37('0x1'));var moment=require('moment');var BPromise=require(_0x6c37('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6c37('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x6c37('0x4'))(_0x6c37('0x5'));var config=require('../../config/environment');var jayson=require(_0x6c37('0x6'));var client=jayson['client'][_0x6c37('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x56f7a7,_0x533b47,_0x4d4116){return new BPromise(function(_0x3320c1,_0x4179f6){return client[_0x6c37('0x8')](_0x56f7a7,_0x4d4116)[_0x6c37('0x9')](function(_0x97ae16){logger[_0x6c37('0xa')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x533b47,_0x6c37('0xb'));logger[_0x6c37('0xc')](_0x6c37('0xd'),_0x533b47,_0x6c37('0xb'),JSON[_0x6c37('0xe')](_0x97ae16));if(_0x97ae16[_0x6c37('0xf')]){if(_0x97ae16[_0x6c37('0xf')][_0x6c37('0x10')]===0x1f4){logger['error'](_0x6c37('0x11'),_0x533b47,_0x97ae16[_0x6c37('0xf')][_0x6c37('0x12')]);return _0x4179f6(_0x97ae16[_0x6c37('0xf')][_0x6c37('0x12')]);}logger[_0x6c37('0xf')](_0x6c37('0x11'),_0x533b47,_0x97ae16['error'][_0x6c37('0x12')]);return _0x3320c1(_0x97ae16[_0x6c37('0xf')][_0x6c37('0x12')]);}else{logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x533b47,_0x6c37('0xb'));_0x3320c1(_0x97ae16[_0x6c37('0x13')]['message']);}})[_0x6c37('0x14')](function(_0xda5c35){logger[_0x6c37('0xf')](_0x6c37('0x11'),_0x533b47,_0xda5c35);_0x4179f6(_0xda5c35);});});} \ No newline at end of file +var _0x3c01=['rpc','../../config/environment','jayson/promise','client','http','request','then','FreshdeskConfiguration,\x20%s,\x20%s','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x3c01,0x1c7));var _0x13c0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3c01[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x13c0('0x0'));var util=require(_0x13c0('0x1'));var moment=require(_0x13c0('0x2'));var BPromise=require(_0x13c0('0x3'));var rs=require(_0x13c0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x13c0('0x5'));var logger=require(_0x13c0('0x6'))(_0x13c0('0x7'));var config=require(_0x13c0('0x8'));var jayson=require(_0x13c0('0x9'));var client=jayson[_0x13c0('0xa')][_0x13c0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5391bc,_0x31b8d6,_0x141568){return new BPromise(function(_0x240e16,_0x2a5e8f){return client[_0x13c0('0xc')](_0x5391bc,_0x141568)[_0x13c0('0xd')](function(_0x2a7f5c){logger['info'](_0x13c0('0xe'),_0x31b8d6,'request\x20sent');logger['debug'](_0x13c0('0xf'),_0x31b8d6,_0x13c0('0x10'),JSON['stringify'](_0x2a7f5c));if(_0x2a7f5c[_0x13c0('0x11')]){if(_0x2a7f5c[_0x13c0('0x11')][_0x13c0('0x12')]===0x1f4){logger[_0x13c0('0x11')](_0x13c0('0xe'),_0x31b8d6,_0x2a7f5c[_0x13c0('0x11')][_0x13c0('0x13')]);return _0x2a5e8f(_0x2a7f5c[_0x13c0('0x11')][_0x13c0('0x13')]);}logger[_0x13c0('0x11')](_0x13c0('0xe'),_0x31b8d6,_0x2a7f5c[_0x13c0('0x11')][_0x13c0('0x13')]);return _0x240e16(_0x2a7f5c[_0x13c0('0x11')][_0x13c0('0x13')]);}else{logger[_0x13c0('0x14')](_0x13c0('0xe'),_0x31b8d6,_0x13c0('0x10'));_0x240e16(_0x2a7f5c['result']['message']);}})['catch'](function(_0x241300){logger['error'](_0x13c0('0xe'),_0x31b8d6,_0x241300);_0x2a5e8f(_0x241300);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index de923c4..ab9e4ab 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 _0x9e3e=['../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','/:id','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9e3e,0x1f1));var _0xe9e3=function(_0x14309b,_0x31003c){_0x14309b=_0x14309b-0x0;var _0x279563=_0x9e3e[_0x14309b];return _0x279563;};'use strict';var multer=require(_0xe9e3('0x0'));var util=require(_0xe9e3('0x1'));var path=require(_0xe9e3('0x2'));var timeout=require(_0xe9e3('0x3'));var express=require(_0xe9e3('0x4'));var router=express[_0xe9e3('0x5')]();var fs_extra=require(_0xe9e3('0x6'));var auth=require(_0xe9e3('0x7'));var interaction=require(_0xe9e3('0x8'));var config=require(_0xe9e3('0x9'));var controller=require('./intFreshdeskField.controller');router['get']('/',auth[_0xe9e3('0xa')](),controller['index']);router['get'](_0xe9e3('0xb'),auth[_0xe9e3('0xa')](),controller['show']);router['post']('/',auth[_0xe9e3('0xa')](),controller['create']);router['put']('/:id',auth[_0xe9e3('0xa')](),controller[_0xe9e3('0xc')]);router['delete'](_0xe9e3('0xb'),auth[_0xe9e3('0xa')](),controller['destroy']);module[_0xe9e3('0xd')]=router; \ No newline at end of file +var _0x6049=['post','isAuthenticated','create','put','update','delete','destroy','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','index','/:id','show'];(function(_0x482eb4,_0xaf137e){var _0x10861b=function(_0x55c6ee){while(--_0x55c6ee){_0x482eb4['push'](_0x482eb4['shift']());}};_0x10861b(++_0xaf137e);}(_0x6049,0x1b7));var _0x9604=function(_0x371db9,_0x238289){_0x371db9=_0x371db9-0x0;var _0xbf8000=_0x6049[_0x371db9];return _0xbf8000;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9604('0x0'));var timeout=require(_0x9604('0x1'));var express=require(_0x9604('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9604('0x3'));var interaction=require(_0x9604('0x4'));var config=require(_0x9604('0x5'));var controller=require(_0x9604('0x6'));router[_0x9604('0x7')]('/',auth['isAuthenticated'](),controller[_0x9604('0x8')]);router[_0x9604('0x7')](_0x9604('0x9'),auth['isAuthenticated'](),controller[_0x9604('0xa')]);router[_0x9604('0xb')]('/',auth[_0x9604('0xc')](),controller[_0x9604('0xd')]);router[_0x9604('0xe')](_0x9604('0x9'),auth[_0x9604('0xc')](),controller[_0x9604('0xf')]);router[_0x9604('0x10')](_0x9604('0x9'),auth[_0x9604('0xc')](),controller[_0x9604('0x11')]);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 352f255..3b8fa5e 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 _0xf9a3=['STRING','ENUM','BOOLEAN','sequelize','exports','variable','customVariable','keyValue','picklist','string'];(function(_0x4565eb,_0x167f79){var _0x67832=function(_0x5322ff){while(--_0x5322ff){_0x4565eb['push'](_0x4565eb['shift']());}};_0x67832(++_0x167f79);}(_0xf9a3,0x1c5));var _0x3f9a=function(_0x2bc6a5,_0x1c7c41){_0x2bc6a5=_0x2bc6a5-0x0;var _0x11ef65=_0xf9a3[_0x2bc6a5];return _0x11ef65;};'use strict';var Sequelize=require(_0x3f9a('0x0'));module[_0x3f9a('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x3f9a('0x2'),_0x3f9a('0x3'),_0x3f9a('0x4'),_0x3f9a('0x5')),'defaultValue':_0x3f9a('0x6')},'content':{'type':Sequelize[_0x3f9a('0x7')]},'key':{'type':Sequelize[_0x3f9a('0x7')]},'keyType':{'type':Sequelize[_0x3f9a('0x8')](_0x3f9a('0x6'),_0x3f9a('0x2'),_0x3f9a('0x3'))},'keyContent':{'type':Sequelize[_0x3f9a('0x7')]},'idField':{'type':Sequelize[_0x3f9a('0x7')]},'nameField':{'type':Sequelize[_0x3f9a('0x7')]},'customField':{'type':Sequelize[_0x3f9a('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3f9a('0x7')]}}; \ No newline at end of file +var _0xc11f=['exports','string','variable','picklist','STRING','ENUM','customVariable','BOOLEAN','sequelize'];(function(_0x253dd6,_0x453b6f){var _0x45b9da=function(_0x55e9a5){while(--_0x55e9a5){_0x253dd6['push'](_0x253dd6['shift']());}};_0x45b9da(++_0x453b6f);}(_0xc11f,0x7d));var _0xfc11=function(_0x3c9526,_0x59d6d8){_0x3c9526=_0x3c9526-0x0;var _0x362da1=_0xc11f[_0x3c9526];return _0x362da1;};'use strict';var Sequelize=require(_0xfc11('0x0'));module[_0xfc11('0x1')]={'type':{'type':Sequelize['ENUM'](_0xfc11('0x2'),_0xfc11('0x3'),'customVariable','keyValue',_0xfc11('0x4')),'defaultValue':_0xfc11('0x2')},'content':{'type':Sequelize[_0xfc11('0x5')]},'key':{'type':Sequelize[_0xfc11('0x5')]},'keyType':{'type':Sequelize[_0xfc11('0x6')](_0xfc11('0x2'),_0xfc11('0x3'),_0xfc11('0x7'))},'keyContent':{'type':Sequelize[_0xfc11('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xfc11('0x5')]},'customField':{'type':Sequelize[_0xfc11('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index ec551ed..06f356c 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 _0xad8a=['hasOwnProperty','offset','sort','where','pick','filter','merge','VIRTUAL','options','FreshdeskField','findAll','rows','show','params','length','includeAll','include','find','body','catch','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','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','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xad8a,0xb0));var _0xaad8=function(_0x56a096,_0x47a25a){_0x56a096=_0x56a096-0x0;var _0x3ae1db=_0xad8a[_0x56a096];return _0x3ae1db;};'use strict';var emlformat=require(_0xaad8('0x0'));var rimraf=require(_0xaad8('0x1'));var zipdir=require(_0xaad8('0x2'));var jsonpatch=require(_0xaad8('0x3'));var rp=require(_0xaad8('0x4'));var moment=require('moment');var BPromise=require(_0xaad8('0x5'));var Mustache=require(_0xaad8('0x6'));var util=require(_0xaad8('0x7'));var path=require('path');var sox=require(_0xaad8('0x8'));var csv=require(_0xaad8('0x9'));var ejs=require(_0xaad8('0xa'));var fs=require('fs');var fs_extra=require(_0xaad8('0xb'));var _=require(_0xaad8('0xc'));var squel=require(_0xaad8('0xd'));var crypto=require(_0xaad8('0xe'));var jsforce=require(_0xaad8('0xf'));var deskjs=require(_0xaad8('0x10'));var toCsv=require(_0xaad8('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xaad8('0x11'));var authService=require(_0xaad8('0x12'));var qs=require(_0xaad8('0x13'));var as=require(_0xaad8('0x14'));var hardwareService=require(_0xaad8('0x15'));var logger=require(_0xaad8('0x16'))(_0xaad8('0x17'));var utils=require(_0xaad8('0x18'));var config=require(_0xaad8('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xaad8('0x1a'))['db'];function respondWithStatusCode(_0x2a13fb,_0xed6744){_0xed6744=_0xed6744||0xcc;return function(_0x456b77){if(_0x456b77){return _0x2a13fb[_0xaad8('0x1b')](_0xed6744);}return _0x2a13fb[_0xaad8('0x1c')](_0xed6744)[_0xaad8('0x1d')]();};}function respondWithResult(_0x357bf6,_0x1c70d3){_0x1c70d3=_0x1c70d3||0xc8;return function(_0x4372fc){if(_0x4372fc){return _0x357bf6[_0xaad8('0x1c')](_0x1c70d3)[_0xaad8('0x1e')](_0x4372fc);}};}function respondWithFilteredResult(_0x28bf95,_0x5e4fbb){return function(_0x334c4d){if(_0x334c4d){var _0xb63cb3=typeof _0x5e4fbb['offset']===_0xaad8('0x1f')&&typeof _0x5e4fbb[_0xaad8('0x20')]===_0xaad8('0x1f');var _0xc17ada=_0x334c4d[_0xaad8('0x21')];var _0x3895e2=_0xb63cb3?0x0:_0x5e4fbb['offset'];var _0xfd8b0a=_0xb63cb3?_0x334c4d[_0xaad8('0x21')]:_0x5e4fbb['offset']+_0x5e4fbb[_0xaad8('0x20')];var _0x4c681e;if(_0xfd8b0a>=_0xc17ada){_0xfd8b0a=_0xc17ada;_0x4c681e=0xc8;}else{_0x4c681e=0xce;}_0x28bf95[_0xaad8('0x1c')](_0x4c681e);return _0x28bf95[_0xaad8('0x22')](_0xaad8('0x23'),_0x3895e2+'-'+_0xfd8b0a+'/'+_0xc17ada)[_0xaad8('0x1e')](_0x334c4d);}return null;};}function patchUpdates(_0x5cb39b){return function(_0x18b856){try{jsonpatch[_0xaad8('0x24')](_0x18b856,_0x5cb39b,!![]);}catch(_0x594681){return BPromise[_0xaad8('0x25')](_0x594681);}return _0x18b856[_0xaad8('0x26')]();};}function saveUpdates(_0x262e57,_0x5b4b61){return function(_0x5ba0fb){if(_0x5ba0fb){return _0x5ba0fb[_0xaad8('0x27')](_0x262e57)[_0xaad8('0x28')](function(_0x3930f0){return _0x3930f0;});}return null;};}function removeEntity(_0x15e0c6,_0x29ba69){return function(_0x1daacf){if(_0x1daacf){return _0x1daacf[_0xaad8('0x29')]()[_0xaad8('0x28')](function(){_0x15e0c6[_0xaad8('0x1c')](0xcc)[_0xaad8('0x1d')]();});}};}function handleEntityNotFound(_0x1bbac4,_0x217bfc){return function(_0x4193cb){if(!_0x4193cb){_0x1bbac4[_0xaad8('0x1b')](0x194);}return _0x4193cb;};}function handleError(_0x4485c3,_0x492a4a){_0x492a4a=_0x492a4a||0x1f4;return function(_0x3d254e){logger[_0xaad8('0x2a')](_0x3d254e[_0xaad8('0x2b')]);if(_0x3d254e['name']){delete _0x3d254e[_0xaad8('0x2c')];}_0x4485c3[_0xaad8('0x1c')](_0x492a4a)[_0xaad8('0x2d')](_0x3d254e);};}exports[_0xaad8('0x2e')]=function(_0x24c01d,_0x5434a9){var _0xafb149={},_0x43c489={},_0x1e253f={'count':0x0,'rows':[]};var _0x31ad19=_[_0xaad8('0x2f')](db['FreshdeskField'][_0xaad8('0x30')],function(_0x4030ea){return{'name':_0x4030ea[_0xaad8('0x31')],'type':_0x4030ea[_0xaad8('0x32')]['key']};});_0x43c489[_0xaad8('0x33')]=_[_0xaad8('0x2f')](_0x31ad19,_0xaad8('0x2c'));_0x43c489[_0xaad8('0x34')]=_[_0xaad8('0x35')](_0x24c01d['query']);_0x43c489[_0xaad8('0x36')]=_[_0xaad8('0x37')](_0x43c489['model'],_0x43c489['query']);_0xafb149[_0xaad8('0x38')]=_[_0xaad8('0x37')](_0x43c489[_0xaad8('0x33')],qs[_0xaad8('0x39')](_0x24c01d['query'][_0xaad8('0x39')]));_0xafb149[_0xaad8('0x38')]=_0xafb149['attributes']['length']?_0xafb149[_0xaad8('0x38')]:_0x43c489[_0xaad8('0x33')];if(!_0x24c01d['query'][_0xaad8('0x3a')]('nolimit')){_0xafb149['limit']=qs[_0xaad8('0x20')](_0x24c01d[_0xaad8('0x34')]['limit']);_0xafb149[_0xaad8('0x3b')]=qs[_0xaad8('0x3b')](_0x24c01d[_0xaad8('0x34')][_0xaad8('0x3b')]);}_0xafb149['order']=qs[_0xaad8('0x3c')](_0x24c01d[_0xaad8('0x34')][_0xaad8('0x3c')]);_0xafb149[_0xaad8('0x3d')]=qs[_0xaad8('0x36')](_[_0xaad8('0x3e')](_0x24c01d['query'],_0x43c489[_0xaad8('0x36')]),_0x31ad19);if(_0x24c01d[_0xaad8('0x34')][_0xaad8('0x3f')]){_0xafb149['where']=_[_0xaad8('0x40')](_0xafb149[_0xaad8('0x3d')],{'$or':_[_0xaad8('0x2f')](_0x31ad19,function(_0x2864c4){if(_0x2864c4[_0xaad8('0x32')]!==_0xaad8('0x41')){var _0x3c699c={};_0x3c699c[_0x2864c4['name']]={'$like':'%'+_0x24c01d[_0xaad8('0x34')][_0xaad8('0x3f')]+'%'};return _0x3c699c;}})});}_0xafb149=_[_0xaad8('0x40')]({},_0xafb149,_0x24c01d[_0xaad8('0x42')]);var _0x3cb8ea={'where':_0xafb149[_0xaad8('0x3d')]};return db['FreshdeskField'][_0xaad8('0x21')](_0x3cb8ea)[_0xaad8('0x28')](function(_0x3ea87e){_0x1e253f[_0xaad8('0x21')]=_0x3ea87e;if(_0x24c01d['query']['includeAll']){_0xafb149['include']=[{'all':!![]}];}return db[_0xaad8('0x43')][_0xaad8('0x44')](_0xafb149);})[_0xaad8('0x28')](function(_0x5bb668){_0x1e253f[_0xaad8('0x45')]=_0x5bb668;return _0x1e253f;})[_0xaad8('0x28')](respondWithFilteredResult(_0x5434a9,_0xafb149))['catch'](handleError(_0x5434a9,null));};exports[_0xaad8('0x46')]=function(_0x11e67e,_0x2fd56a){var _0x292d4e={'raw':!![],'where':{'id':_0x11e67e[_0xaad8('0x47')]['id']}},_0x3933ac={};_0x3933ac[_0xaad8('0x33')]=_[_0xaad8('0x35')](db[_0xaad8('0x43')][_0xaad8('0x30')]);_0x3933ac[_0xaad8('0x34')]=_[_0xaad8('0x35')](_0x11e67e['query']);_0x3933ac['filters']=_['intersection'](_0x3933ac[_0xaad8('0x33')],_0x3933ac['query']);_0x292d4e[_0xaad8('0x38')]=_['intersection'](_0x3933ac['model'],qs[_0xaad8('0x39')](_0x11e67e['query'][_0xaad8('0x39')]));_0x292d4e[_0xaad8('0x38')]=_0x292d4e[_0xaad8('0x38')][_0xaad8('0x48')]?_0x292d4e[_0xaad8('0x38')]:_0x3933ac[_0xaad8('0x33')];if(_0x11e67e[_0xaad8('0x34')][_0xaad8('0x49')]){_0x292d4e[_0xaad8('0x4a')]=[{'all':!![]}];}_0x292d4e=_[_0xaad8('0x40')]({},_0x292d4e,_0x11e67e[_0xaad8('0x42')]);return db[_0xaad8('0x43')][_0xaad8('0x4b')](_0x292d4e)[_0xaad8('0x28')](handleEntityNotFound(_0x2fd56a,null))[_0xaad8('0x28')](respondWithResult(_0x2fd56a,null))['catch'](handleError(_0x2fd56a,null));};exports['create']=function(_0x46bf2a,_0x42cfa4){return db[_0xaad8('0x43')]['create'](_0x46bf2a['body'],{})[_0xaad8('0x28')](respondWithResult(_0x42cfa4,0xc9))['catch'](handleError(_0x42cfa4,null));};exports[_0xaad8('0x27')]=function(_0x1560ef,_0x313824){if(_0x1560ef[_0xaad8('0x4c')]['id']){delete _0x1560ef[_0xaad8('0x4c')]['id'];}return db[_0xaad8('0x43')][_0xaad8('0x4b')]({'where':{'id':_0x1560ef[_0xaad8('0x47')]['id']}})[_0xaad8('0x28')](handleEntityNotFound(_0x313824,null))['then'](saveUpdates(_0x1560ef[_0xaad8('0x4c')],null))[_0xaad8('0x28')](respondWithResult(_0x313824,null))['catch'](handleError(_0x313824,null));};exports[_0xaad8('0x29')]=function(_0x5e5ef1,_0x2a2542){return db[_0xaad8('0x43')][_0xaad8('0x4b')]({'where':{'id':_0x5e5ef1[_0xaad8('0x47')]['id']}})[_0xaad8('0x28')](handleEntityNotFound(_0x2a2542,null))[_0xaad8('0x28')](removeEntity(_0x2a2542,null))[_0xaad8('0x4d')](handleError(_0x2a2542,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(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xac55,0x1c8));var _0x5ac5=function(_0x308b98,_0x1d198c){_0x308b98=_0x308b98-0x0;var _0x42852c=_0xac55[_0x308b98];return _0x42852c;};'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 f720bdb..2ce232b 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 _0x1cd8=['define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports'];(function(_0x1c71c8,_0x33cec0){var _0x374967=function(_0x54a91d){while(--_0x54a91d){_0x1c71c8['push'](_0x1c71c8['shift']());}};_0x374967(++_0x33cec0);}(_0x1cd8,0x110));var _0x81cd=function(_0x2dc93b,_0xb41657){_0x2dc93b=_0x2dc93b-0x0;var _0x509f05=_0x1cd8[_0x2dc93b];return _0x509f05;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x81cd('0x0'))(_0x81cd('0x1'));var moment=require(_0x81cd('0x2'));var BPromise=require(_0x81cd('0x3'));var rp=require(_0x81cd('0x4'));var fs=require('fs');var path=require(_0x81cd('0x5'));var rimraf=require(_0x81cd('0x6'));var config=require('../../config/environment');var attributes=require('./intFreshdeskField.attributes');module[_0x81cd('0x7')]=function(_0xf63ce0,_0x129239){return _0xf63ce0[_0x81cd('0x8')](_0x81cd('0x9'),attributes,{'tableName':_0x81cd('0xa'),'paranoid':![],'indexes':[{'name':_0x81cd('0xb'),'fields':[_0x81cd('0xc'),_0x81cd('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x331c=['bluebird','rimraf','./intFreshdeskField.attributes','exports','define','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','../../config/logger'];(function(_0x2b4d3e,_0x1db49c){var _0x5885cc=function(_0x5301c8){while(--_0x5301c8){_0x2b4d3e['push'](_0x2b4d3e['shift']());}};_0x5885cc(++_0x1db49c);}(_0x331c,0xf0));var _0xc331=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x331c[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0xc331('0x0'));var util=require('util');var logger=require(_0xc331('0x1'))('api');var moment=require('moment');var BPromise=require(_0xc331('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc331('0x3'));var config=require('../../config/environment');var attributes=require(_0xc331('0x4'));module[_0xc331('0x5')]=function(_0x567fe9,_0x14a44f){return _0x567fe9[_0xc331('0x6')]('FreshdeskField',attributes,{'tableName':_0xc331('0x7'),'paranoid':![],'indexes':[{'name':_0xc331('0x8'),'fields':[_0xc331('0x9'),_0xc331('0xa')],'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 2079ab9..1679cb7 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 _0x73ce=['request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','FreshdeskField,\x20%s,\x20%s'];(function(_0xe4201d,_0x4dd4a1){var _0x1a889e=function(_0x46d0ed){while(--_0x46d0ed){_0xe4201d['push'](_0xe4201d['shift']());}};_0x1a889e(++_0x4dd4a1);}(_0x73ce,0x80));var _0xe73c=function(_0x47b068,_0x2b18ed){_0x47b068=_0x47b068-0x0;var _0x1e1732=_0x73ce[_0x47b068];return _0x1e1732;};'use strict';var _=require('lodash');var util=require(_0xe73c('0x0'));var moment=require(_0xe73c('0x1'));var BPromise=require('bluebird');var rs=require(_0xe73c('0x2'));var fs=require('fs');var Redis=require(_0xe73c('0x3'));var db=require(_0xe73c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe73c('0x5'))(_0xe73c('0x6'));var config=require(_0xe73c('0x7'));var jayson=require(_0xe73c('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x14ab39,_0x72690d,_0xf31411){return new BPromise(function(_0x2cf9c1,_0x8e609c){return client['request'](_0x14ab39,_0xf31411)[_0xe73c('0x9')](function(_0x1046a7){logger[_0xe73c('0xa')](_0xe73c('0xb'),_0x72690d,_0xe73c('0xc'));logger[_0xe73c('0xd')](_0xe73c('0xe'),_0x72690d,_0xe73c('0xc'),JSON[_0xe73c('0xf')](_0x1046a7));if(_0x1046a7[_0xe73c('0x10')]){if(_0x1046a7[_0xe73c('0x10')]['code']===0x1f4){logger[_0xe73c('0x10')](_0xe73c('0xb'),_0x72690d,_0x1046a7[_0xe73c('0x10')]['message']);return _0x8e609c(_0x1046a7[_0xe73c('0x10')][_0xe73c('0x11')]);}logger['error'](_0xe73c('0xb'),_0x72690d,_0x1046a7['error'][_0xe73c('0x11')]);return _0x2cf9c1(_0x1046a7['error'][_0xe73c('0x11')]);}else{logger[_0xe73c('0xa')](_0xe73c('0xb'),_0x72690d,_0xe73c('0xc'));_0x2cf9c1(_0x1046a7[_0xe73c('0x12')][_0xe73c('0x11')]);}})[_0xe73c('0x13')](function(_0x53a54d){logger[_0xe73c('0x10')](_0xe73c('0xb'),_0x72690d,_0x53a54d);_0x8e609c(_0x53a54d);});});} \ No newline at end of file +var _0x2ace=['rpc','../../config/environment','jayson/promise','client','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x40253d,_0x2467cc){var _0x3583c1=function(_0x330591){while(--_0x330591){_0x40253d['push'](_0x40253d['shift']());}};_0x3583c1(++_0x2467cc);}(_0x2ace,0x100));var _0xe2ac=function(_0x3dc089,_0x5ccb0d){_0x3dc089=_0x3dc089-0x0;var _0x34d9d3=_0x2ace[_0x3dc089];return _0x34d9d3;};'use strict';var _=require(_0xe2ac('0x0'));var util=require(_0xe2ac('0x1'));var moment=require(_0xe2ac('0x2'));var BPromise=require('bluebird');var rs=require(_0xe2ac('0x3'));var fs=require('fs');var Redis=require(_0xe2ac('0x4'));var db=require(_0xe2ac('0x5'))['db'];var utils=require(_0xe2ac('0x6'));var logger=require(_0xe2ac('0x7'))(_0xe2ac('0x8'));var config=require(_0xe2ac('0x9'));var jayson=require(_0xe2ac('0xa'));var client=jayson[_0xe2ac('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a0bc6,_0x18f04b,_0x3daca4){return new BPromise(function(_0x4a7ee6,_0x5d67ac){return client[_0xe2ac('0xc')](_0x1a0bc6,_0x3daca4)[_0xe2ac('0xd')](function(_0x2425b9){logger[_0xe2ac('0xe')](_0xe2ac('0xf'),_0x18f04b,_0xe2ac('0x10'));logger['debug'](_0xe2ac('0x11'),_0x18f04b,_0xe2ac('0x10'),JSON[_0xe2ac('0x12')](_0x2425b9));if(_0x2425b9[_0xe2ac('0x13')]){if(_0x2425b9[_0xe2ac('0x13')][_0xe2ac('0x14')]===0x1f4){logger['error']('FreshdeskField,\x20%s,\x20%s',_0x18f04b,_0x2425b9[_0xe2ac('0x13')][_0xe2ac('0x15')]);return _0x5d67ac(_0x2425b9[_0xe2ac('0x13')]['message']);}logger[_0xe2ac('0x13')](_0xe2ac('0xf'),_0x18f04b,_0x2425b9['error']['message']);return _0x4a7ee6(_0x2425b9[_0xe2ac('0x13')][_0xe2ac('0x15')]);}else{logger['info']('FreshdeskField,\x20%s,\x20%s',_0x18f04b,'request\x20sent');_0x4a7ee6(_0x2425b9[_0xe2ac('0x16')]['message']);}})[_0xe2ac('0x17')](function(_0x2f0c65){logger[_0xe2ac('0x13')](_0xe2ac('0xf'),_0x18f04b,_0x2f0c65);_0x5d67ac(_0x2f0c65);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 8c214b2..55fcfb5 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 _0xe205=['./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id/configurations','/:id/fields','getFields','create','post','addConfiguration','/:id','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0xe205,0xa7));var _0x5e20=function(_0x31e93b,_0x67203d){_0x31e93b=_0x31e93b-0x0;var _0x579d2a=_0xe205[_0x31e93b];return _0x579d2a;};'use strict';var multer=require(_0x5e20('0x0'));var util=require(_0x5e20('0x1'));var path=require(_0x5e20('0x2'));var timeout=require(_0x5e20('0x3'));var express=require(_0x5e20('0x4'));var router=express[_0x5e20('0x5')]();var fs_extra=require(_0x5e20('0x6'));var auth=require(_0x5e20('0x7'));var interaction=require(_0x5e20('0x8'));var config=require('../../config/environment');var controller=require(_0x5e20('0x9'));router[_0x5e20('0xa')]('/',auth[_0x5e20('0xb')](),controller[_0x5e20('0xc')]);router['get']('/:id',auth[_0x5e20('0xb')](),controller['show']);router['get'](_0x5e20('0xd'),auth[_0x5e20('0xb')](),controller['getConfigurations']);router[_0x5e20('0xa')](_0x5e20('0xe'),auth[_0x5e20('0xb')](),controller[_0x5e20('0xf')]);router['post']('/',auth[_0x5e20('0xb')](),controller[_0x5e20('0x10')]);router[_0x5e20('0x11')](_0x5e20('0xd'),auth[_0x5e20('0xb')](),controller[_0x5e20('0x12')]);router['put'](_0x5e20('0x13'),auth[_0x5e20('0xb')](),controller[_0x5e20('0x14')]);router['delete'](_0x5e20('0x13'),auth['isAuthenticated'](),controller[_0x5e20('0x15')]);module['exports']=router; \ No newline at end of file +var _0xbc9d=['express','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','show','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','/:id','destroy','multer','util','path','connect-timeout'];(function(_0x245ec0,_0x32a285){var _0x27c59f=function(_0x5874ec){while(--_0x5874ec){_0x245ec0['push'](_0x245ec0['shift']());}};_0x27c59f(++_0x32a285);}(_0xbc9d,0xb4));var _0xdbc9=function(_0x241199,_0x2f1390){_0x241199=_0x241199-0x0;var _0x256e92=_0xbc9d[_0x241199];return _0x256e92;};'use strict';var multer=require(_0xdbc9('0x0'));var util=require(_0xdbc9('0x1'));var path=require(_0xdbc9('0x2'));var timeout=require(_0xdbc9('0x3'));var express=require(_0xdbc9('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xdbc9('0x5'));var config=require(_0xdbc9('0x6'));var controller=require(_0xdbc9('0x7'));router[_0xdbc9('0x8')]('/',auth[_0xdbc9('0x9')](),controller[_0xdbc9('0xa')]);router[_0xdbc9('0x8')]('/:id',auth[_0xdbc9('0x9')](),controller[_0xdbc9('0xb')]);router[_0xdbc9('0x8')]('/:id/configurations',auth[_0xdbc9('0x9')](),controller['getConfigurations']);router['get'](_0xdbc9('0xc'),auth[_0xdbc9('0x9')](),controller[_0xdbc9('0xd')]);router[_0xdbc9('0xe')]('/',auth['isAuthenticated'](),controller[_0xdbc9('0xf')]);router[_0xdbc9('0xe')](_0xdbc9('0x10'),auth[_0xdbc9('0x9')](),controller[_0xdbc9('0x11')]);router[_0xdbc9('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xdbc9('0x13')]);router[_0xdbc9('0x14')](_0xdbc9('0x15'),auth[_0xdbc9('0x9')](),controller[_0xdbc9('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index ca6a367..e61955b 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 _0x9582=['exports','STRING','username','remoteUri','sequelize'];(function(_0x49d7ed,_0x27b89f){var _0x1310d7=function(_0x24ca79){while(--_0x24ca79){_0x49d7ed['push'](_0x49d7ed['shift']());}};_0x1310d7(++_0x27b89f);}(_0x9582,0x95));var _0x2958=function(_0xcc8eaf,_0x3e88c7){_0xcc8eaf=_0xcc8eaf-0x0;var _0x5f374d=_0x9582[_0xcc8eaf];return _0x5f374d;};'use strict';var Sequelize=require(_0x2958('0x0'));module[_0x2958('0x1')]={'name':{'type':Sequelize[_0x2958('0x2')]},'description':{'type':Sequelize[_0x2958('0x2')]},'username':{'type':Sequelize[_0x2958('0x2')],'unique':_0x2958('0x3')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x2958('0x2')],'unique':_0x2958('0x4')},'serverUrl':{'type':Sequelize[_0x2958('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x5c3c=['remoteUri','sequelize','exports','STRING','username'];(function(_0x3ebcab,_0x482df2){var _0x4074d3=function(_0x43ec1a){while(--_0x43ec1a){_0x3ebcab['push'](_0x3ebcab['shift']());}};_0x4074d3(++_0x482df2);}(_0x5c3c,0x132));var _0xc5c3=function(_0x4e6ae6,_0x49dba6){_0x4e6ae6=_0x4e6ae6-0x0;var _0x23c108=_0x5c3c[_0x4e6ae6];return _0x23c108;};'use strict';var Sequelize=require(_0xc5c3('0x0'));module[_0xc5c3('0x1')]={'name':{'type':Sequelize[_0xc5c3('0x2')]},'description':{'type':Sequelize[_0xc5c3('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xc5c3('0x3')},'apiKey':{'type':Sequelize[_0xc5c3('0x2')]},'remoteUri':{'type':Sequelize[_0xc5c3('0x2')],'unique':_0xc5c3('0x4')},'serverUrl':{'type':Sequelize[_0xc5c3('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index fdeb909..61705fb 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 _0xcccc=['destroy','error','stack','name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','merge','options','includeAll','include','findAll','show','params','find','catch','create','body','getConfigurations','filter','addConfiguration','findOne','AccountId','Subjects','channel','getDescriptions','FreshsalesConfiguration','FreshsalesField','Descriptions','getFields','username','remoteUri','slice','substring','lastIndexOf','format','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','limit','count','offset','set','reject','save','update','then'];(function(_0x390ef6,_0x1d401c){var _0x2fdaac=function(_0x692ab7){while(--_0x692ab7){_0x390ef6['push'](_0x390ef6['shift']());}};_0x2fdaac(++_0x1d401c);}(_0xcccc,0x10b));var _0xcccc=function(_0x2ecc65,_0xd75c48){_0x2ecc65=_0x2ecc65-0x0;var _0x103cc3=_0xcccc[_0x2ecc65];return _0x103cc3;};'use strict';var emlformat=require(_0xcccc('0x0'));var rimraf=require(_0xcccc('0x1'));var zipdir=require(_0xcccc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xcccc('0x3'));var BPromise=require(_0xcccc('0x4'));var Mustache=require(_0xcccc('0x5'));var util=require(_0xcccc('0x6'));var path=require(_0xcccc('0x7'));var sox=require(_0xcccc('0x8'));var csv=require('to-csv');var ejs=require(_0xcccc('0x9'));var fs=require('fs');var fs_extra=require(_0xcccc('0xa'));var _=require(_0xcccc('0xb'));var squel=require(_0xcccc('0xc'));var crypto=require(_0xcccc('0xd'));var jsforce=require(_0xcccc('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xcccc('0xf'));var querystring=require(_0xcccc('0x10'));var Papa=require(_0xcccc('0x11'));var Redis=require('ioredis');var authService=require(_0xcccc('0x12'));var qs=require(_0xcccc('0x13'));var as=require(_0xcccc('0x14'));var hardwareService=require(_0xcccc('0x15'));var logger=require(_0xcccc('0x16'))(_0xcccc('0x17'));var utils=require('../../config/utils');var config=require(_0xcccc('0x18'));var licenseUtil=require(_0xcccc('0x19'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4b2747,_0x3f5240){_0x3f5240=_0x3f5240||0xcc;return function(_0x1c5d50){if(_0x1c5d50){return _0x4b2747[_0xcccc('0x1a')](_0x3f5240);}return _0x4b2747['status'](_0x3f5240)[_0xcccc('0x1b')]();};}function respondWithResult(_0x1b4ede,_0x389142){_0x389142=_0x389142||0xc8;return function(_0x4b217f){if(_0x4b217f){return _0x1b4ede[_0xcccc('0x1c')](_0x389142)[_0xcccc('0x1d')](_0x4b217f);}};}function respondWithFilteredResult(_0x2867ed,_0x3ee6f0){return function(_0x5b7fa6){if(_0x5b7fa6){var _0x2eca26=typeof _0x3ee6f0['offset']===_0xcccc('0x1e')&&typeof _0x3ee6f0[_0xcccc('0x1f')]===_0xcccc('0x1e');var _0x5bc468=_0x5b7fa6[_0xcccc('0x20')];var _0x2044b6=_0x2eca26?0x0:_0x3ee6f0[_0xcccc('0x21')];var _0x421242=_0x2eca26?_0x5b7fa6['count']:_0x3ee6f0[_0xcccc('0x21')]+_0x3ee6f0[_0xcccc('0x1f')];var _0x33ae12;if(_0x421242>=_0x5bc468){_0x421242=_0x5bc468;_0x33ae12=0xc8;}else{_0x33ae12=0xce;}_0x2867ed[_0xcccc('0x1c')](_0x33ae12);return _0x2867ed[_0xcccc('0x22')]('Content-Range',_0x2044b6+'-'+_0x421242+'/'+_0x5bc468)[_0xcccc('0x1d')](_0x5b7fa6);}return null;};}function patchUpdates(_0xb13ba4){return function(_0x567e83){try{jsonpatch['apply'](_0x567e83,_0xb13ba4,!![]);}catch(_0x1bd4cf){return BPromise[_0xcccc('0x23')](_0x1bd4cf);}return _0x567e83[_0xcccc('0x24')]();};}function saveUpdates(_0x352950,_0x53b9f2){return function(_0x16833f){if(_0x16833f){return _0x16833f[_0xcccc('0x25')](_0x352950)[_0xcccc('0x26')](function(_0x305ed9){return _0x305ed9;});}return null;};}function removeEntity(_0xb618ab,_0x3803ee){return function(_0x54ae46){if(_0x54ae46){return _0x54ae46[_0xcccc('0x27')]()[_0xcccc('0x26')](function(){_0xb618ab['status'](0xcc)[_0xcccc('0x1b')]();});}};}function handleEntityNotFound(_0x581332,_0xeeebcc){return function(_0x498796){if(!_0x498796){_0x581332[_0xcccc('0x1a')](0x194);}return _0x498796;};}function handleError(_0x5bc8dc,_0x229fe6){_0x229fe6=_0x229fe6||0x1f4;return function(_0x28a176){logger[_0xcccc('0x28')](_0x28a176[_0xcccc('0x29')]);if(_0x28a176['name']){delete _0x28a176[_0xcccc('0x2a')];}_0x5bc8dc[_0xcccc('0x1c')](_0x229fe6)[_0xcccc('0x2b')](_0x28a176);};}exports[_0xcccc('0x2c')]=function(_0x18f3e8,_0x7ab54a){var _0x5c7f1d={},_0x5c2537={},_0x21030f={'count':0x0,'rows':[]};var _0x40201a=_[_0xcccc('0x2d')](db[_0xcccc('0x2e')][_0xcccc('0x2f')],function(_0x3b2391){return{'name':_0x3b2391[_0xcccc('0x30')],'type':_0x3b2391[_0xcccc('0x31')]['key']};});_0x5c2537['model']=_[_0xcccc('0x2d')](_0x40201a,_0xcccc('0x2a'));_0x5c2537[_0xcccc('0x32')]=_[_0xcccc('0x33')](_0x18f3e8['query']);_0x5c2537['filters']=_[_0xcccc('0x34')](_0x5c2537[_0xcccc('0x35')],_0x5c2537[_0xcccc('0x32')]);_0x5c7f1d[_0xcccc('0x36')]=_[_0xcccc('0x34')](_0x5c2537[_0xcccc('0x35')],qs[_0xcccc('0x37')](_0x18f3e8[_0xcccc('0x32')][_0xcccc('0x37')]));_0x5c7f1d[_0xcccc('0x36')]=_0x5c7f1d[_0xcccc('0x36')][_0xcccc('0x38')]?_0x5c7f1d[_0xcccc('0x36')]:_0x5c2537[_0xcccc('0x35')];if(!_0x18f3e8['query'][_0xcccc('0x39')](_0xcccc('0x3a'))){_0x5c7f1d[_0xcccc('0x1f')]=qs[_0xcccc('0x1f')](_0x18f3e8['query']['limit']);_0x5c7f1d[_0xcccc('0x21')]=qs['offset'](_0x18f3e8[_0xcccc('0x32')][_0xcccc('0x21')]);}_0x5c7f1d[_0xcccc('0x3b')]=qs[_0xcccc('0x3c')](_0x18f3e8[_0xcccc('0x32')][_0xcccc('0x3c')]);_0x5c7f1d[_0xcccc('0x3d')]=qs[_0xcccc('0x3e')](_[_0xcccc('0x3f')](_0x18f3e8[_0xcccc('0x32')],_0x5c2537[_0xcccc('0x3e')]),_0x40201a);if(_0x18f3e8[_0xcccc('0x32')]['filter']){_0x5c7f1d[_0xcccc('0x3d')]=_['merge'](_0x5c7f1d[_0xcccc('0x3d')],{'$or':_[_0xcccc('0x2d')](_0x40201a,function(_0x47403c){if(_0x47403c[_0xcccc('0x31')]!==_0xcccc('0x40')){var _0x27b457={};_0x27b457[_0x47403c[_0xcccc('0x2a')]]={'$like':'%'+_0x18f3e8[_0xcccc('0x32')]['filter']+'%'};return _0x27b457;}})});}_0x5c7f1d=_[_0xcccc('0x41')]({},_0x5c7f1d,_0x18f3e8[_0xcccc('0x42')]);var _0x71e7d8={'where':_0x5c7f1d['where']};return db[_0xcccc('0x2e')]['count'](_0x71e7d8)[_0xcccc('0x26')](function(_0x453f89){_0x21030f[_0xcccc('0x20')]=_0x453f89;if(_0x18f3e8[_0xcccc('0x32')][_0xcccc('0x43')]){_0x5c7f1d[_0xcccc('0x44')]=[{'all':!![]}];}return db[_0xcccc('0x2e')][_0xcccc('0x45')](_0x5c7f1d);})[_0xcccc('0x26')](function(_0x77abc3){_0x21030f['rows']=_0x77abc3;return _0x21030f;})[_0xcccc('0x26')](respondWithFilteredResult(_0x7ab54a,_0x5c7f1d))['catch'](handleError(_0x7ab54a,null));};exports[_0xcccc('0x46')]=function(_0x2ab4d3,_0x2c508e){var _0x2d049e={'raw':![],'where':{'id':_0x2ab4d3[_0xcccc('0x47')]['id']}},_0x1d495e={};_0x1d495e[_0xcccc('0x35')]=_[_0xcccc('0x33')](db[_0xcccc('0x2e')]['rawAttributes']);_0x1d495e[_0xcccc('0x32')]=_[_0xcccc('0x33')](_0x2ab4d3[_0xcccc('0x32')]);_0x1d495e['filters']=_[_0xcccc('0x34')](_0x1d495e[_0xcccc('0x35')],_0x1d495e[_0xcccc('0x32')]);_0x2d049e[_0xcccc('0x36')]=_[_0xcccc('0x34')](_0x1d495e[_0xcccc('0x35')],qs[_0xcccc('0x37')](_0x2ab4d3[_0xcccc('0x32')][_0xcccc('0x37')]));_0x2d049e[_0xcccc('0x36')]=_0x2d049e[_0xcccc('0x36')][_0xcccc('0x38')]?_0x2d049e[_0xcccc('0x36')]:_0x1d495e[_0xcccc('0x35')];if(_0x2ab4d3['query']['includeAll']){_0x2d049e[_0xcccc('0x44')]=[{'all':!![]}];}_0x2d049e=_[_0xcccc('0x41')]({},_0x2d049e,_0x2ab4d3['options']);return db[_0xcccc('0x2e')][_0xcccc('0x48')](_0x2d049e)[_0xcccc('0x26')](handleEntityNotFound(_0x2c508e,null))[_0xcccc('0x26')](respondWithResult(_0x2c508e,null))[_0xcccc('0x49')](handleError(_0x2c508e,null));};exports[_0xcccc('0x4a')]=function(_0x459eb8,_0x8645aa){return db['FreshsalesAccount'][_0xcccc('0x4a')](_0x459eb8[_0xcccc('0x4b')],{})['then'](respondWithResult(_0x8645aa,0xc9))[_0xcccc('0x49')](handleError(_0x8645aa,null));};exports[_0xcccc('0x25')]=function(_0x473da8,_0x219bc5){if(_0x473da8[_0xcccc('0x4b')]['id']){delete _0x473da8[_0xcccc('0x4b')]['id'];}return db[_0xcccc('0x2e')][_0xcccc('0x48')]({'where':{'id':_0x473da8[_0xcccc('0x47')]['id']}})[_0xcccc('0x26')](handleEntityNotFound(_0x219bc5,null))[_0xcccc('0x26')](saveUpdates(_0x473da8[_0xcccc('0x4b')],null))['then'](respondWithResult(_0x219bc5,null))[_0xcccc('0x49')](handleError(_0x219bc5,null));};exports[_0xcccc('0x27')]=function(_0x54131d,_0x5a1148){return db['FreshsalesAccount'][_0xcccc('0x48')]({'where':{'id':_0x54131d[_0xcccc('0x47')]['id']}})[_0xcccc('0x26')](handleEntityNotFound(_0x5a1148,null))[_0xcccc('0x26')](removeEntity(_0x5a1148,null))['catch'](handleError(_0x5a1148,null));};exports[_0xcccc('0x4c')]=function(_0x3a069f,_0x4bfec7,_0x2e1cf9){var _0x2a3c6d={};var _0x13f4a1={};var _0x157faa;var _0x166fff;return db[_0xcccc('0x2e')]['findOne']({'where':{'id':_0x3a069f[_0xcccc('0x47')]['id']}})['then'](handleEntityNotFound(_0x4bfec7,null))[_0xcccc('0x26')](function(_0x2c4bef){if(_0x2c4bef){_0x157faa=_0x2c4bef;_0x13f4a1['model']=_[_0xcccc('0x33')](db['FreshsalesConfiguration'][_0xcccc('0x2f')]);_0x13f4a1[_0xcccc('0x32')]=_['keys'](_0x3a069f['query']);_0x13f4a1['filters']=_[_0xcccc('0x34')](_0x13f4a1['model'],_0x13f4a1['query']);_0x2a3c6d[_0xcccc('0x36')]=_[_0xcccc('0x34')](_0x13f4a1[_0xcccc('0x35')],qs[_0xcccc('0x37')](_0x3a069f['query']['fields']));_0x2a3c6d[_0xcccc('0x36')]=_0x2a3c6d['attributes'][_0xcccc('0x38')]?_0x2a3c6d['attributes']:_0x13f4a1[_0xcccc('0x35')];_0x2a3c6d['order']=qs[_0xcccc('0x3c')](_0x3a069f[_0xcccc('0x32')][_0xcccc('0x3c')]);_0x2a3c6d['where']=qs['filters'](_[_0xcccc('0x3f')](_0x3a069f[_0xcccc('0x32')],_0x13f4a1[_0xcccc('0x3e')]));if(_0x3a069f[_0xcccc('0x32')][_0xcccc('0x4d')]){_0x2a3c6d[_0xcccc('0x3d')]=_[_0xcccc('0x41')](_0x2a3c6d[_0xcccc('0x3d')],{'$or':_[_0xcccc('0x2d')](_0x2a3c6d['attributes'],function(_0xbe8553){var _0x1a4dc5={};_0x1a4dc5[_0xbe8553]={'$like':'%'+_0x3a069f['query']['filter']+'%'};return _0x1a4dc5;})});}_0x2a3c6d=_[_0xcccc('0x41')]({},_0x2a3c6d,_0x3a069f[_0xcccc('0x42')]);return _0x157faa[_0xcccc('0x4c')](_0x2a3c6d);}})[_0xcccc('0x26')](function(_0xc0dc32){if(_0xc0dc32){_0x166fff=_0xc0dc32[_0xcccc('0x38')];if(!_0x3a069f[_0xcccc('0x32')][_0xcccc('0x39')](_0xcccc('0x3a'))){_0x2a3c6d[_0xcccc('0x1f')]=qs[_0xcccc('0x1f')](_0x3a069f[_0xcccc('0x32')][_0xcccc('0x1f')]);_0x2a3c6d[_0xcccc('0x21')]=qs[_0xcccc('0x21')](_0x3a069f[_0xcccc('0x32')][_0xcccc('0x21')]);}return _0x157faa[_0xcccc('0x4c')](_0x2a3c6d);}})[_0xcccc('0x26')](function(_0x426c1c){if(_0x426c1c){return _0x426c1c?{'count':_0x166fff,'rows':_0x426c1c}:null;}})[_0xcccc('0x26')](respondWithResult(_0x4bfec7,null))[_0xcccc('0x49')](handleError(_0x4bfec7,null));};exports[_0xcccc('0x4e')]=function(_0x403f3b,_0x2e2d54,_0x5918ff){if(_0x403f3b['body']['id']){delete _0x403f3b[_0xcccc('0x4b')]['id'];}return db[_0xcccc('0x2e')][_0xcccc('0x4f')]({'where':{'id':_0x403f3b['params']['id']}})['then'](handleEntityNotFound(_0x2e2d54,null))[_0xcccc('0x26')](function(_0x2ba15a){if(_0x2ba15a){_0x403f3b['body'][_0xcccc('0x50')]=_0x2ba15a['id'];_0x403f3b[_0xcccc('0x4b')][_0xcccc('0x51')]=integrations['getSubjects'](_0x403f3b[_0xcccc('0x4b')][_0xcccc('0x52')],_0x403f3b['body'][_0xcccc('0x31')]);_0x403f3b['body']['Descriptions']=integrations[_0xcccc('0x53')](_0x403f3b[_0xcccc('0x4b')][_0xcccc('0x52')],_0x403f3b[_0xcccc('0x4b')]['type']);return db[_0xcccc('0x54')][_0xcccc('0x4a')](_0x403f3b[_0xcccc('0x4b')],{'include':[{'model':db[_0xcccc('0x55')],'as':'Subjects'},{'model':db[_0xcccc('0x55')],'as':_0xcccc('0x56')}]});}return null;})['then'](respondWithResult(_0x2e2d54,null))['catch'](handleError(_0x2e2d54,null));};exports[_0xcccc('0x57')]=function(_0x1cb871,_0x1f48b3,_0x45b545){var _0x4a0a5f='';var _0x1c4f3a='';return db[_0xcccc('0x2e')][_0xcccc('0x4f')]({'where':{'id':_0x1cb871[_0xcccc('0x47')]['id']},'attributes':['id','username','remoteUri','apiKey']})[_0xcccc('0x26')](handleEntityNotFound(_0x1f48b3,null))[_0xcccc('0x26')](function(_0x309391){if(_0x309391){_0x1c4f3a=_0x309391[_0xcccc('0x58')];_0x4a0a5f=_0x309391[_0xcccc('0x59')];var _0x3c7ba4=_0x309391[_0xcccc('0x59')][_0xcccc('0x5a')](-0x1);if(_0x3c7ba4==='/'){_0x4a0a5f=_0x4a0a5f[_0xcccc('0x5b')](0x0,_0x4a0a5f[_0xcccc('0x5c')](_0x3c7ba4));}return rp({'method':'GET','uri':util[_0xcccc('0x5d')]('%s%s',_0x4a0a5f,_0xcccc('0x5e')),'headers':{'Authorization':_0xcccc('0x5f')+_0x309391['apiKey']},'json':!![]});}})['then'](function(_0x36b130){if(_0x36b130){var _0x3a2422=_0x36b130[_0xcccc('0x60')];var _0x59fb26=![];var _0x260b9a=null;for(_0x260b9a=0x0;_0x260b9a<_0x3a2422[_0xcccc('0x38')];_0x260b9a++){if(_0x3a2422[_0x260b9a][_0xcccc('0x61')]===_0x1c4f3a){_0x59fb26=!![];}}if(_0x59fb26){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xcccc('0x62')});}}})[_0xcccc('0x26')](respondWithResult(_0x1f48b3,null))[_0xcccc('0x49')](function(_0x7c2b5){var _0x23bd59=_0x1cb871[_0xcccc('0x32')][_0xcccc('0x63')]?0x1f4:_0x7c2b5[_0xcccc('0x64')]||0x1f4;logger[_0xcccc('0x28')](_0xcccc('0x65'),'getFields',_0x23bd59,JSON['stringify'](_0x7c2b5));delete _0x7c2b5[_0xcccc('0x2a')];if(_0x23bd59===0x191){_0x23bd59=0x190;}_0x1f48b3[_0xcccc('0x1c')](_0x23bd59)['send'](_0x1cb871[_0xcccc('0x32')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x7c2b5[_0xcccc('0x64')]}:_0x7c2b5);});}; \ No newline at end of file +var _0xb6fa=['intersection','attributes','fields','nolimit','order','sort','pick','merge','where','map','VIRTUAL','include','findAll','rows','catch','show','length','options','find','create','body','destroy','getConfigurations','findOne','params','filter','hasOwnProperty','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','FreshsalesConfiguration','Subjects','FreshsalesField','getFields','username','remoteUri','substring','GET','format','%s%s','/api/selector/owners','Token\x20token=','apiKey','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','rimraf','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','offset','undefined','count','limit','set','json','reject','update','then','error','stack','name','index','FreshsalesAccount','rawAttributes','fieldName','type','key','model','query','keys','filters'];(function(_0x118afa,_0x4bf0c1){var _0x167d76=function(_0x2c529b){while(--_0x2c529b){_0x118afa['push'](_0x118afa['shift']());}};_0x167d76(++_0x4bf0c1);}(_0xb6fa,0x105));var _0xab6f=function(_0x49d41c,_0x2bdc35){_0x49d41c=_0x49d41c-0x0;var _0xb64c5f=_0xb6fa[_0x49d41c];return _0xb64c5f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xab6f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xab6f('0x1'));var moment=require(_0xab6f('0x2'));var BPromise=require(_0xab6f('0x3'));var Mustache=require(_0xab6f('0x4'));var util=require(_0xab6f('0x5'));var path=require(_0xab6f('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xab6f('0x7'));var fs=require('fs');var fs_extra=require(_0xab6f('0x8'));var _=require(_0xab6f('0x9'));var squel=require(_0xab6f('0xa'));var crypto=require(_0xab6f('0xb'));var jsforce=require(_0xab6f('0xc'));var deskjs=require(_0xab6f('0xd'));var toCsv=require('to-csv');var querystring=require(_0xab6f('0xe'));var Papa=require(_0xab6f('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xab6f('0x10'));var as=require(_0xab6f('0x11'));var hardwareService=require(_0xab6f('0x12'));var logger=require(_0xab6f('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xab6f('0x14'));var db=require(_0xab6f('0x15'))['db'];var integrations=require(_0xab6f('0x16'));function respondWithStatusCode(_0x1abe1c,_0x2ad20e){_0x2ad20e=_0x2ad20e||0xcc;return function(_0x502152){if(_0x502152){return _0x1abe1c[_0xab6f('0x17')](_0x2ad20e);}return _0x1abe1c['status'](_0x2ad20e)[_0xab6f('0x18')]();};}function respondWithResult(_0x89bfb3,_0x3c02ef){_0x3c02ef=_0x3c02ef||0xc8;return function(_0x489d1c){if(_0x489d1c){return _0x89bfb3[_0xab6f('0x19')](_0x3c02ef)['json'](_0x489d1c);}};}function respondWithFilteredResult(_0x2a8aa9,_0x3e87f8){return function(_0x3988d5){if(_0x3988d5){var _0x47662f=typeof _0x3e87f8[_0xab6f('0x1a')]===_0xab6f('0x1b')&&typeof _0x3e87f8['limit']===_0xab6f('0x1b');var _0x4eeb8b=_0x3988d5[_0xab6f('0x1c')];var _0x3fc686=_0x47662f?0x0:_0x3e87f8['offset'];var _0x409174=_0x47662f?_0x3988d5[_0xab6f('0x1c')]:_0x3e87f8[_0xab6f('0x1a')]+_0x3e87f8[_0xab6f('0x1d')];var _0x36aca0;if(_0x409174>=_0x4eeb8b){_0x409174=_0x4eeb8b;_0x36aca0=0xc8;}else{_0x36aca0=0xce;}_0x2a8aa9[_0xab6f('0x19')](_0x36aca0);return _0x2a8aa9[_0xab6f('0x1e')]('Content-Range',_0x3fc686+'-'+_0x409174+'/'+_0x4eeb8b)[_0xab6f('0x1f')](_0x3988d5);}return null;};}function patchUpdates(_0x310e86){return function(_0x194eb6){try{jsonpatch['apply'](_0x194eb6,_0x310e86,!![]);}catch(_0x283c21){return BPromise[_0xab6f('0x20')](_0x283c21);}return _0x194eb6['save']();};}function saveUpdates(_0x7b3eea,_0x4a23ce){return function(_0x16c99e){if(_0x16c99e){return _0x16c99e[_0xab6f('0x21')](_0x7b3eea)[_0xab6f('0x22')](function(_0x6b1dd1){return _0x6b1dd1;});}return null;};}function removeEntity(_0x26f32d,_0x5b9341){return function(_0x23416d){if(_0x23416d){return _0x23416d['destroy']()[_0xab6f('0x22')](function(){_0x26f32d[_0xab6f('0x19')](0xcc)[_0xab6f('0x18')]();});}};}function handleEntityNotFound(_0x3a2024,_0x13c18a){return function(_0x16fa6f){if(!_0x16fa6f){_0x3a2024[_0xab6f('0x17')](0x194);}return _0x16fa6f;};}function handleError(_0x4a7e27,_0x54cc5a){_0x54cc5a=_0x54cc5a||0x1f4;return function(_0x55c27d){logger[_0xab6f('0x23')](_0x55c27d[_0xab6f('0x24')]);if(_0x55c27d[_0xab6f('0x25')]){delete _0x55c27d[_0xab6f('0x25')];}_0x4a7e27['status'](_0x54cc5a)['send'](_0x55c27d);};}exports[_0xab6f('0x26')]=function(_0x4125a6,_0x265f8b){var _0x1b1424={},_0x1db78f={},_0xc418b2={'count':0x0,'rows':[]};var _0x73cd5a=_['map'](db[_0xab6f('0x27')][_0xab6f('0x28')],function(_0x33b987){return{'name':_0x33b987[_0xab6f('0x29')],'type':_0x33b987[_0xab6f('0x2a')][_0xab6f('0x2b')]};});_0x1db78f[_0xab6f('0x2c')]=_['map'](_0x73cd5a,_0xab6f('0x25'));_0x1db78f[_0xab6f('0x2d')]=_[_0xab6f('0x2e')](_0x4125a6[_0xab6f('0x2d')]);_0x1db78f[_0xab6f('0x2f')]=_[_0xab6f('0x30')](_0x1db78f['model'],_0x1db78f[_0xab6f('0x2d')]);_0x1b1424[_0xab6f('0x31')]=_[_0xab6f('0x30')](_0x1db78f[_0xab6f('0x2c')],qs[_0xab6f('0x32')](_0x4125a6['query'][_0xab6f('0x32')]));_0x1b1424[_0xab6f('0x31')]=_0x1b1424[_0xab6f('0x31')]['length']?_0x1b1424['attributes']:_0x1db78f[_0xab6f('0x2c')];if(!_0x4125a6[_0xab6f('0x2d')]['hasOwnProperty'](_0xab6f('0x33'))){_0x1b1424['limit']=qs[_0xab6f('0x1d')](_0x4125a6['query']['limit']);_0x1b1424['offset']=qs[_0xab6f('0x1a')](_0x4125a6[_0xab6f('0x2d')]['offset']);}_0x1b1424[_0xab6f('0x34')]=qs[_0xab6f('0x35')](_0x4125a6['query'][_0xab6f('0x35')]);_0x1b1424['where']=qs[_0xab6f('0x2f')](_[_0xab6f('0x36')](_0x4125a6[_0xab6f('0x2d')],_0x1db78f[_0xab6f('0x2f')]),_0x73cd5a);if(_0x4125a6[_0xab6f('0x2d')]['filter']){_0x1b1424['where']=_[_0xab6f('0x37')](_0x1b1424[_0xab6f('0x38')],{'$or':_[_0xab6f('0x39')](_0x73cd5a,function(_0x3482a4){if(_0x3482a4[_0xab6f('0x2a')]!==_0xab6f('0x3a')){var _0x58cd37={};_0x58cd37[_0x3482a4['name']]={'$like':'%'+_0x4125a6[_0xab6f('0x2d')]['filter']+'%'};return _0x58cd37;}})});}_0x1b1424=_[_0xab6f('0x37')]({},_0x1b1424,_0x4125a6['options']);var _0xde265a={'where':_0x1b1424[_0xab6f('0x38')]};return db['FreshsalesAccount'][_0xab6f('0x1c')](_0xde265a)[_0xab6f('0x22')](function(_0xc0b047){_0xc418b2['count']=_0xc0b047;if(_0x4125a6[_0xab6f('0x2d')]['includeAll']){_0x1b1424[_0xab6f('0x3b')]=[{'all':!![]}];}return db[_0xab6f('0x27')][_0xab6f('0x3c')](_0x1b1424);})[_0xab6f('0x22')](function(_0xfe8782){_0xc418b2[_0xab6f('0x3d')]=_0xfe8782;return _0xc418b2;})[_0xab6f('0x22')](respondWithFilteredResult(_0x265f8b,_0x1b1424))[_0xab6f('0x3e')](handleError(_0x265f8b,null));};exports[_0xab6f('0x3f')]=function(_0x59d109,_0x3f6922){var _0x36e0a2={'raw':![],'where':{'id':_0x59d109['params']['id']}},_0x2c9831={};_0x2c9831['model']=_[_0xab6f('0x2e')](db[_0xab6f('0x27')]['rawAttributes']);_0x2c9831[_0xab6f('0x2d')]=_[_0xab6f('0x2e')](_0x59d109[_0xab6f('0x2d')]);_0x2c9831['filters']=_['intersection'](_0x2c9831[_0xab6f('0x2c')],_0x2c9831[_0xab6f('0x2d')]);_0x36e0a2[_0xab6f('0x31')]=_['intersection'](_0x2c9831[_0xab6f('0x2c')],qs[_0xab6f('0x32')](_0x59d109['query']['fields']));_0x36e0a2[_0xab6f('0x31')]=_0x36e0a2['attributes'][_0xab6f('0x40')]?_0x36e0a2[_0xab6f('0x31')]:_0x2c9831['model'];if(_0x59d109[_0xab6f('0x2d')]['includeAll']){_0x36e0a2[_0xab6f('0x3b')]=[{'all':!![]}];}_0x36e0a2=_['merge']({},_0x36e0a2,_0x59d109[_0xab6f('0x41')]);return db[_0xab6f('0x27')][_0xab6f('0x42')](_0x36e0a2)['then'](handleEntityNotFound(_0x3f6922,null))[_0xab6f('0x22')](respondWithResult(_0x3f6922,null))[_0xab6f('0x3e')](handleError(_0x3f6922,null));};exports['create']=function(_0x5a3ce8,_0x7ae97f){return db['FreshsalesAccount'][_0xab6f('0x43')](_0x5a3ce8[_0xab6f('0x44')],{})[_0xab6f('0x22')](respondWithResult(_0x7ae97f,0xc9))[_0xab6f('0x3e')](handleError(_0x7ae97f,null));};exports[_0xab6f('0x21')]=function(_0xd34bdb,_0x434f85){if(_0xd34bdb[_0xab6f('0x44')]['id']){delete _0xd34bdb[_0xab6f('0x44')]['id'];}return db['FreshsalesAccount'][_0xab6f('0x42')]({'where':{'id':_0xd34bdb['params']['id']}})[_0xab6f('0x22')](handleEntityNotFound(_0x434f85,null))[_0xab6f('0x22')](saveUpdates(_0xd34bdb['body'],null))[_0xab6f('0x22')](respondWithResult(_0x434f85,null))['catch'](handleError(_0x434f85,null));};exports[_0xab6f('0x45')]=function(_0x53b8c0,_0x401c7d){return db[_0xab6f('0x27')]['find']({'where':{'id':_0x53b8c0['params']['id']}})[_0xab6f('0x22')](handleEntityNotFound(_0x401c7d,null))[_0xab6f('0x22')](removeEntity(_0x401c7d,null))[_0xab6f('0x3e')](handleError(_0x401c7d,null));};exports[_0xab6f('0x46')]=function(_0x79b3ce,_0x29ba66,_0x54caa6){var _0x5182f3={};var _0x595747={};var _0x1c0f26;var _0x49feb4;return db[_0xab6f('0x27')][_0xab6f('0x47')]({'where':{'id':_0x79b3ce[_0xab6f('0x48')]['id']}})[_0xab6f('0x22')](handleEntityNotFound(_0x29ba66,null))[_0xab6f('0x22')](function(_0x307aac){if(_0x307aac){_0x1c0f26=_0x307aac;_0x595747['model']=_[_0xab6f('0x2e')](db['FreshsalesConfiguration'][_0xab6f('0x28')]);_0x595747[_0xab6f('0x2d')]=_[_0xab6f('0x2e')](_0x79b3ce[_0xab6f('0x2d')]);_0x595747[_0xab6f('0x2f')]=_[_0xab6f('0x30')](_0x595747[_0xab6f('0x2c')],_0x595747['query']);_0x5182f3['attributes']=_[_0xab6f('0x30')](_0x595747[_0xab6f('0x2c')],qs[_0xab6f('0x32')](_0x79b3ce[_0xab6f('0x2d')][_0xab6f('0x32')]));_0x5182f3[_0xab6f('0x31')]=_0x5182f3[_0xab6f('0x31')]['length']?_0x5182f3[_0xab6f('0x31')]:_0x595747['model'];_0x5182f3[_0xab6f('0x34')]=qs[_0xab6f('0x35')](_0x79b3ce[_0xab6f('0x2d')][_0xab6f('0x35')]);_0x5182f3[_0xab6f('0x38')]=qs[_0xab6f('0x2f')](_['pick'](_0x79b3ce[_0xab6f('0x2d')],_0x595747[_0xab6f('0x2f')]));if(_0x79b3ce['query'][_0xab6f('0x49')]){_0x5182f3[_0xab6f('0x38')]=_[_0xab6f('0x37')](_0x5182f3['where'],{'$or':_[_0xab6f('0x39')](_0x5182f3[_0xab6f('0x31')],function(_0x1fb77b){var _0x250f0e={};_0x250f0e[_0x1fb77b]={'$like':'%'+_0x79b3ce[_0xab6f('0x2d')][_0xab6f('0x49')]+'%'};return _0x250f0e;})});}_0x5182f3=_[_0xab6f('0x37')]({},_0x5182f3,_0x79b3ce[_0xab6f('0x41')]);return _0x1c0f26[_0xab6f('0x46')](_0x5182f3);}})[_0xab6f('0x22')](function(_0x3b9ec7){if(_0x3b9ec7){_0x49feb4=_0x3b9ec7[_0xab6f('0x40')];if(!_0x79b3ce['query'][_0xab6f('0x4a')](_0xab6f('0x33'))){_0x5182f3[_0xab6f('0x1d')]=qs[_0xab6f('0x1d')](_0x79b3ce[_0xab6f('0x2d')][_0xab6f('0x1d')]);_0x5182f3[_0xab6f('0x1a')]=qs[_0xab6f('0x1a')](_0x79b3ce[_0xab6f('0x2d')][_0xab6f('0x1a')]);}return _0x1c0f26[_0xab6f('0x46')](_0x5182f3);}})[_0xab6f('0x22')](function(_0xf0d055){if(_0xf0d055){return _0xf0d055?{'count':_0x49feb4,'rows':_0xf0d055}:null;}})[_0xab6f('0x22')](respondWithResult(_0x29ba66,null))[_0xab6f('0x3e')](handleError(_0x29ba66,null));};exports[_0xab6f('0x4b')]=function(_0x47369b,_0x193810,_0x29425b){if(_0x47369b[_0xab6f('0x44')]['id']){delete _0x47369b[_0xab6f('0x44')]['id'];}return db[_0xab6f('0x27')][_0xab6f('0x47')]({'where':{'id':_0x47369b['params']['id']}})[_0xab6f('0x22')](handleEntityNotFound(_0x193810,null))['then'](function(_0xea47d3){if(_0xea47d3){_0x47369b[_0xab6f('0x44')][_0xab6f('0x4c')]=_0xea47d3['id'];_0x47369b[_0xab6f('0x44')]['Subjects']=integrations[_0xab6f('0x4d')](_0x47369b['body'][_0xab6f('0x4e')],_0x47369b[_0xab6f('0x44')][_0xab6f('0x2a')]);_0x47369b['body'][_0xab6f('0x4f')]=integrations[_0xab6f('0x50')](_0x47369b[_0xab6f('0x44')][_0xab6f('0x4e')],_0x47369b[_0xab6f('0x44')]['type']);return db[_0xab6f('0x51')][_0xab6f('0x43')](_0x47369b[_0xab6f('0x44')],{'include':[{'model':db['FreshsalesField'],'as':_0xab6f('0x52')},{'model':db[_0xab6f('0x53')],'as':_0xab6f('0x4f')}]});}return null;})[_0xab6f('0x22')](respondWithResult(_0x193810,null))['catch'](handleError(_0x193810,null));};exports[_0xab6f('0x54')]=function(_0x3db1fc,_0x1047db,_0x1fbbed){var _0x5ce85b='';var _0x3fb3ef='';return db['FreshsalesAccount'][_0xab6f('0x47')]({'where':{'id':_0x3db1fc['params']['id']},'attributes':['id',_0xab6f('0x55'),_0xab6f('0x56'),'apiKey']})['then'](handleEntityNotFound(_0x1047db,null))['then'](function(_0x4d5d35){if(_0x4d5d35){_0x3fb3ef=_0x4d5d35[_0xab6f('0x55')];_0x5ce85b=_0x4d5d35[_0xab6f('0x56')];var _0x122a20=_0x4d5d35[_0xab6f('0x56')]['slice'](-0x1);if(_0x122a20==='/'){_0x5ce85b=_0x5ce85b[_0xab6f('0x57')](0x0,_0x5ce85b['lastIndexOf'](_0x122a20));}return rp({'method':_0xab6f('0x58'),'uri':util[_0xab6f('0x59')](_0xab6f('0x5a'),_0x5ce85b,_0xab6f('0x5b')),'headers':{'Authorization':_0xab6f('0x5c')+_0x4d5d35[_0xab6f('0x5d')]},'json':!![]});}})['then'](function(_0x16c0c9){if(_0x16c0c9){var _0x24e7cd=_0x16c0c9[_0xab6f('0x5e')];var _0x2c9665=![];var _0x1ae51c=null;for(_0x1ae51c=0x0;_0x1ae51c<_0x24e7cd[_0xab6f('0x40')];_0x1ae51c++){if(_0x24e7cd[_0x1ae51c][_0xab6f('0x5f')]===_0x3fb3ef){_0x2c9665=!![];}}if(_0x2c9665){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xab6f('0x60')});}}})['then'](respondWithResult(_0x1047db,null))['catch'](function(_0x2fdee8){var _0xcdea0d=_0x3db1fc[_0xab6f('0x2d')][_0xab6f('0x61')]?0x1f4:_0x2fdee8[_0xab6f('0x62')]||0x1f4;logger[_0xab6f('0x23')](_0xab6f('0x63'),_0xab6f('0x54'),_0xcdea0d,JSON[_0xab6f('0x64')](_0x2fdee8));delete _0x2fdee8[_0xab6f('0x25')];if(_0xcdea0d===0x191){_0xcdea0d=0x190;}_0x1047db[_0xab6f('0x19')](_0xcdea0d)[_0xab6f('0x65')](_0x3db1fc['query']['test']?{'message':_0xab6f('0x66'),'statusCode':_0x2fdee8['statusCode']}:_0x2fdee8);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 9286b31..3418c73 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 _0xafb9=['moment','bluebird','request-promise','path','rimraf','../../components/integrations/configuration','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api'];(function(_0x30a3a6,_0x8db20e){var _0x368a91=function(_0xd42e1f){while(--_0xd42e1f){_0x30a3a6['push'](_0x30a3a6['shift']());}};_0x368a91(++_0x8db20e);}(_0xafb9,0x68));var _0x9afb=function(_0xc8fdd4,_0x26582d){_0xc8fdd4=_0xc8fdd4-0x0;var _0x437ad3=_0xafb9[_0xc8fdd4];return _0x437ad3;};'use strict';var _=require(_0x9afb('0x0'));var util=require(_0x9afb('0x1'));var logger=require(_0x9afb('0x2'))(_0x9afb('0x3'));var moment=require(_0x9afb('0x4'));var BPromise=require(_0x9afb('0x5'));var rp=require(_0x9afb('0x6'));var fs=require('fs');var path=require(_0x9afb('0x7'));var rimraf=require(_0x9afb('0x8'));var config=require('../../config/environment');var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x9afb('0x9'));module['exports']=function(_0x1ccf93,_0x548b24){return _0x1ccf93['define'](_0x9afb('0xa'),attributes,{'tableName':_0x9afb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa456=['lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts'];(function(_0x41d0e2,_0x48720e){var _0x3550db=function(_0x456d9d){while(--_0x456d9d){_0x41d0e2['push'](_0x41d0e2['shift']());}};_0x3550db(++_0x48720e);}(_0xa456,0x142));var _0x6a45=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0xa456[_0x62c958];return _0x57ec61;};'use strict';var _=require(_0x6a45('0x0'));var util=require(_0x6a45('0x1'));var logger=require(_0x6a45('0x2'))(_0x6a45('0x3'));var moment=require('moment');var BPromise=require(_0x6a45('0x4'));var rp=require(_0x6a45('0x5'));var fs=require('fs');var path=require(_0x6a45('0x6'));var rimraf=require('rimraf');var config=require(_0x6a45('0x7'));var attributes=require(_0x6a45('0x8'));var integrations=require(_0x6a45('0x9'));module[_0x6a45('0xa')]=function(_0x4dfbfa,_0x25cf8d){return _0x4dfbfa[_0x6a45('0xb')](_0x6a45('0xc'),attributes,{'tableName':_0x6a45('0xd'),'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 7a77358..49edde1 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 _0x1623=['../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','info','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FreshsalesAccount,\x20%s,\x20%s','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','limit','include','map','model','attributes','find','ShowFreshsalesAccount','lodash','bluebird','randomstring','ioredis'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x1623,0xab));var _0x3162=function(_0x42dc2c,_0x4a054f){_0x42dc2c=_0x42dc2c-0x0;var _0x8e6d9d=_0x1623[_0x42dc2c];return _0x8e6d9d;};'use strict';var _=require(_0x3162('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3162('0x1'));var rs=require(_0x3162('0x2'));var fs=require('fs');var Redis=require(_0x3162('0x3'));var db=require(_0x3162('0x4'))['db'];var utils=require(_0x3162('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x3162('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3162('0x7')][_0x3162('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53260d,_0xffe9b6,_0x2dc07e){return new BPromise(function(_0x26ee32,_0x36609e){return client[_0x3162('0x9')](_0x53260d,_0x2dc07e)[_0x3162('0xa')](function(_0xe43099){logger[_0x3162('0xb')]('FreshsalesAccount,\x20%s,\x20%s',_0xffe9b6,'request\x20sent');logger[_0x3162('0xc')](_0x3162('0xd'),_0xffe9b6,_0x3162('0xe'),JSON[_0x3162('0xf')](_0xe43099));if(_0xe43099[_0x3162('0x10')]){if(_0xe43099[_0x3162('0x10')][_0x3162('0x11')]===0x1f4){logger[_0x3162('0x10')](_0x3162('0x12'),_0xffe9b6,_0xe43099['error'][_0x3162('0x13')]);return _0x36609e(_0xe43099['error'][_0x3162('0x13')]);}logger[_0x3162('0x10')]('FreshsalesAccount,\x20%s,\x20%s',_0xffe9b6,_0xe43099['error'][_0x3162('0x13')]);return _0x26ee32(_0xe43099[_0x3162('0x10')][_0x3162('0x13')]);}else{logger['info'](_0x3162('0x12'),_0xffe9b6,_0x3162('0xe'));_0x26ee32(_0xe43099[_0x3162('0x14')]['message']);}})[_0x3162('0x15')](function(_0x42cf7d){logger[_0x3162('0x10')](_0x3162('0x12'),_0xffe9b6,_0x42cf7d);_0x36609e(_0x42cf7d);});});}exports[_0x3162('0x16')]=function(_0x1eed46){var _0x391d97=this;return new Promise(function(_0x4b2bf3,_0x42f283){return db[_0x3162('0x17')][_0x3162('0x18')]({'raw':_0x1eed46[_0x3162('0x19')]?_0x1eed46['options'][_0x3162('0x1a')]===undefined?!![]:![]:!![],'where':_0x1eed46['options']?_0x1eed46['options'][_0x3162('0x1b')]||null:null,'attributes':_0x1eed46[_0x3162('0x19')]?_0x1eed46[_0x3162('0x19')]['attributes']||null:null,'limit':_0x1eed46['options']?_0x1eed46[_0x3162('0x19')][_0x3162('0x1c')]||null:null,'include':_0x1eed46[_0x3162('0x19')]?_0x1eed46[_0x3162('0x19')][_0x3162('0x1d')]?_[_0x3162('0x1e')](_0x1eed46[_0x3162('0x19')][_0x3162('0x1d')],function(_0x5a4994){return{'model':db[_0x5a4994[_0x3162('0x1f')]],'as':_0x5a4994['as'],'attributes':_0x5a4994[_0x3162('0x20')],'include':_0x5a4994[_0x3162('0x1d')]?_[_0x3162('0x1e')](_0x5a4994[_0x3162('0x1d')],function(_0x3c543e){return{'model':db[_0x3c543e[_0x3162('0x1f')]],'as':_0x3c543e['as'],'attributes':_0x3c543e[_0x3162('0x20')],'include':_0x3c543e[_0x3162('0x1d')]?_[_0x3162('0x1e')](_0x3c543e[_0x3162('0x1d')],function(_0x2f62d7){return{'model':db[_0x2f62d7[_0x3162('0x1f')]],'as':_0x2f62d7['as'],'attributes':_0x2f62d7['attributes']};}):[]};}):[]};}):[]:[]})[_0x3162('0xa')](function(_0x552469){logger[_0x3162('0xb')](_0x3162('0x16'),_0x1eed46);logger[_0x3162('0xc')]('GetFreshsalesAccount',_0x1eed46,JSON['stringify'](_0x552469));_0x4b2bf3(_0x552469);})[_0x3162('0x15')](function(_0xaa1f35){logger[_0x3162('0x10')](_0x3162('0x16'),_0xaa1f35[_0x3162('0x13')],_0x1eed46);_0x42f283(_0x391d97['error'](0x1f4,_0xaa1f35[_0x3162('0x13')]));});});};exports['ShowFreshsalesAccount']=function(_0xf11765){var _0x3a188e=this;return new Promise(function(_0x41e933,_0x221b38){return db[_0x3162('0x17')][_0x3162('0x21')]({'raw':_0xf11765[_0x3162('0x19')]?_0xf11765[_0x3162('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0xf11765[_0x3162('0x19')]?_0xf11765[_0x3162('0x19')]['where']||null:null,'attributes':_0xf11765[_0x3162('0x19')]?_0xf11765[_0x3162('0x19')]['attributes']||null:null,'include':_0xf11765['options']?_0xf11765[_0x3162('0x19')]['include']?_[_0x3162('0x1e')](_0xf11765[_0x3162('0x19')][_0x3162('0x1d')],function(_0x551442){return{'model':db[_0x551442['model']],'as':_0x551442['as'],'attributes':_0x551442[_0x3162('0x20')],'include':_0x551442[_0x3162('0x1d')]?_['map'](_0x551442[_0x3162('0x1d')],function(_0x4d4f74){return{'model':db[_0x4d4f74[_0x3162('0x1f')]],'as':_0x4d4f74['as'],'attributes':_0x4d4f74[_0x3162('0x20')],'include':_0x4d4f74[_0x3162('0x1d')]?_[_0x3162('0x1e')](_0x4d4f74[_0x3162('0x1d')],function(_0x3b6c91){return{'model':db[_0x3b6c91[_0x3162('0x1f')]],'as':_0x3b6c91['as'],'attributes':_0x3b6c91[_0x3162('0x20')]};}):[]};}):[]};}):[]:[]})[_0x3162('0xa')](function(_0x16c5d6){logger[_0x3162('0xb')]('ShowFreshsalesAccount',_0xf11765);logger[_0x3162('0xc')](_0x3162('0x22'),_0xf11765,JSON[_0x3162('0xf')](_0x16c5d6));_0x41e933(_0x16c5d6);})['catch'](function(_0x59759d){logger[_0x3162('0x10')](_0x3162('0x22'),_0x59759d[_0x3162('0x13')],_0xf11765);_0x221b38(_0x3a188e[_0x3162('0x10')](0x1f4,_0x59759d['message']));});});}; \ No newline at end of file +var _0x68b3=['include','map','model','ShowFreshsalesAccount','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','attributes','limit'];(function(_0x5b5d91,_0x59f3b7){var _0x1aeeea=function(_0xba1ddb){while(--_0xba1ddb){_0x5b5d91['push'](_0x5b5d91['shift']());}};_0x1aeeea(++_0x59f3b7);}(_0x68b3,0x1d8));var _0x368b=function(_0x6572ee,_0x2f1c67){_0x6572ee=_0x6572ee-0x0;var _0x57dbf4=_0x68b3[_0x6572ee];return _0x57dbf4;};'use strict';var _=require(_0x368b('0x0'));var util=require(_0x368b('0x1'));var moment=require(_0x368b('0x2'));var BPromise=require(_0x368b('0x3'));var rs=require(_0x368b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x368b('0x5'))['db'];var utils=require(_0x368b('0x6'));var logger=require(_0x368b('0x7'))(_0x368b('0x8'));var config=require('../../config/environment');var jayson=require(_0x368b('0x9'));var client=jayson[_0x368b('0xa')][_0x368b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x23584a,_0x4406c8,_0x127c1e){return new BPromise(function(_0x2dec1c,_0x142d05){return client[_0x368b('0xc')](_0x23584a,_0x127c1e)[_0x368b('0xd')](function(_0x2a7b9f){logger['info'](_0x368b('0xe'),_0x4406c8,_0x368b('0xf'));logger[_0x368b('0x10')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x4406c8,_0x368b('0xf'),JSON[_0x368b('0x11')](_0x2a7b9f));if(_0x2a7b9f[_0x368b('0x12')]){if(_0x2a7b9f['error'][_0x368b('0x13')]===0x1f4){logger[_0x368b('0x12')]('FreshsalesAccount,\x20%s,\x20%s',_0x4406c8,_0x2a7b9f[_0x368b('0x12')][_0x368b('0x14')]);return _0x142d05(_0x2a7b9f[_0x368b('0x12')][_0x368b('0x14')]);}logger[_0x368b('0x12')]('FreshsalesAccount,\x20%s,\x20%s',_0x4406c8,_0x2a7b9f[_0x368b('0x12')][_0x368b('0x14')]);return _0x2dec1c(_0x2a7b9f['error'][_0x368b('0x14')]);}else{logger[_0x368b('0x15')](_0x368b('0xe'),_0x4406c8,'request\x20sent');_0x2dec1c(_0x2a7b9f[_0x368b('0x16')][_0x368b('0x14')]);}})[_0x368b('0x17')](function(_0x4d6d9d){logger[_0x368b('0x12')](_0x368b('0xe'),_0x4406c8,_0x4d6d9d);_0x142d05(_0x4d6d9d);});});}exports[_0x368b('0x18')]=function(_0x540f57){var _0x5d543e=this;return new Promise(function(_0x3e2e9f,_0x27d2a0){return db[_0x368b('0x19')][_0x368b('0x1a')]({'raw':_0x540f57[_0x368b('0x1b')]?_0x540f57['options'][_0x368b('0x1c')]===undefined?!![]:![]:!![],'where':_0x540f57[_0x368b('0x1b')]?_0x540f57[_0x368b('0x1b')][_0x368b('0x1d')]||null:null,'attributes':_0x540f57[_0x368b('0x1b')]?_0x540f57[_0x368b('0x1b')][_0x368b('0x1e')]||null:null,'limit':_0x540f57[_0x368b('0x1b')]?_0x540f57['options'][_0x368b('0x1f')]||null:null,'include':_0x540f57[_0x368b('0x1b')]?_0x540f57[_0x368b('0x1b')][_0x368b('0x20')]?_[_0x368b('0x21')](_0x540f57['options'][_0x368b('0x20')],function(_0x1ca429){return{'model':db[_0x1ca429[_0x368b('0x22')]],'as':_0x1ca429['as'],'attributes':_0x1ca429[_0x368b('0x1e')],'include':_0x1ca429[_0x368b('0x20')]?_[_0x368b('0x21')](_0x1ca429[_0x368b('0x20')],function(_0x11ea2d){return{'model':db[_0x11ea2d[_0x368b('0x22')]],'as':_0x11ea2d['as'],'attributes':_0x11ea2d[_0x368b('0x1e')],'include':_0x11ea2d[_0x368b('0x20')]?_[_0x368b('0x21')](_0x11ea2d[_0x368b('0x20')],function(_0x376e61){return{'model':db[_0x376e61[_0x368b('0x22')]],'as':_0x376e61['as'],'attributes':_0x376e61[_0x368b('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x368b('0xd')](function(_0x9f192e){logger[_0x368b('0x15')](_0x368b('0x18'),_0x540f57);logger[_0x368b('0x10')](_0x368b('0x18'),_0x540f57,JSON[_0x368b('0x11')](_0x9f192e));_0x3e2e9f(_0x9f192e);})[_0x368b('0x17')](function(_0x5db0b4){logger['error'](_0x368b('0x18'),_0x5db0b4[_0x368b('0x14')],_0x540f57);_0x27d2a0(_0x5d543e[_0x368b('0x12')](0x1f4,_0x5db0b4[_0x368b('0x14')]));});});};exports['ShowFreshsalesAccount']=function(_0x12ae59){var _0x1f3ed3=this;return new Promise(function(_0x3699fe,_0x1c68ca){return db[_0x368b('0x19')]['find']({'raw':_0x12ae59[_0x368b('0x1b')]?_0x12ae59[_0x368b('0x1b')][_0x368b('0x1c')]===undefined?!![]:![]:!![],'where':_0x12ae59[_0x368b('0x1b')]?_0x12ae59['options']['where']||null:null,'attributes':_0x12ae59['options']?_0x12ae59[_0x368b('0x1b')][_0x368b('0x1e')]||null:null,'include':_0x12ae59[_0x368b('0x1b')]?_0x12ae59[_0x368b('0x1b')][_0x368b('0x20')]?_['map'](_0x12ae59[_0x368b('0x1b')][_0x368b('0x20')],function(_0x54e7e5){return{'model':db[_0x54e7e5[_0x368b('0x22')]],'as':_0x54e7e5['as'],'attributes':_0x54e7e5[_0x368b('0x1e')],'include':_0x54e7e5['include']?_[_0x368b('0x21')](_0x54e7e5[_0x368b('0x20')],function(_0x4a3044){return{'model':db[_0x4a3044[_0x368b('0x22')]],'as':_0x4a3044['as'],'attributes':_0x4a3044['attributes'],'include':_0x4a3044['include']?_['map'](_0x4a3044[_0x368b('0x20')],function(_0x4d6f22){return{'model':db[_0x4d6f22[_0x368b('0x22')]],'as':_0x4d6f22['as'],'attributes':_0x4d6f22[_0x368b('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x368b('0xd')](function(_0xd0f23f){logger[_0x368b('0x15')](_0x368b('0x23'),_0x12ae59);logger[_0x368b('0x10')](_0x368b('0x23'),_0x12ae59,JSON['stringify'](_0xd0f23f));_0x3699fe(_0xd0f23f);})[_0x368b('0x17')](function(_0x1f60ea){logger['error'](_0x368b('0x23'),_0x1f60ea[_0x368b('0x14')],_0x12ae59);_0x1c68ca(_0x1f3ed3[_0x368b('0x12')](0x1f4,_0x1f60ea[_0x368b('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index bcd0547..d1aca27 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 _0x66f3=['/:id/subjects','getSubjects','/:id/descriptions','getFields','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','get','isAuthenticated','/:id'];(function(_0xc03a64,_0xcc1f2b){var _0x18d913=function(_0x2aa89a){while(--_0x2aa89a){_0xc03a64['push'](_0xc03a64['shift']());}};_0x18d913(++_0xcc1f2b);}(_0x66f3,0x19a));var _0x366f=function(_0x1d654f,_0x9cf763){_0x1d654f=_0x1d654f-0x0;var _0x5416d5=_0x66f3[_0x1d654f];return _0x5416d5;};'use strict';var multer=require(_0x366f('0x0'));var util=require(_0x366f('0x1'));var path=require(_0x366f('0x2'));var timeout=require(_0x366f('0x3'));var express=require('express');var router=express[_0x366f('0x4')]();var fs_extra=require(_0x366f('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x366f('0x6'));var controller=require('./intFreshsalesConfiguration.controller');router[_0x366f('0x7')]('/',auth[_0x366f('0x8')](),controller['index']);router[_0x366f('0x7')](_0x366f('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x366f('0x7')](_0x366f('0xa'),auth[_0x366f('0x8')](),controller[_0x366f('0xb')]);router['get'](_0x366f('0xc'),auth[_0x366f('0x8')](),controller['getDescriptions']);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0x366f('0xd')]);router['post']('/',auth[_0x366f('0x8')](),controller[_0x366f('0xe')]);router[_0x366f('0xf')](_0x366f('0x9'),auth[_0x366f('0x8')](),controller[_0x366f('0x10')]);router[_0x366f('0x11')]('/:id',auth[_0x366f('0x8')](),controller[_0x366f('0x12')]);module[_0x366f('0x13')]=router; \ No newline at end of file +var _0x52ff=['/:id/fields','getFields','post','create','put','update','delete','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/subjects','/:id/descriptions','getDescriptions'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x52ff,0x12d));var _0xf52f=function(_0x5bf7c6,_0x437582){_0x5bf7c6=_0x5bf7c6-0x0;var _0x591991=_0x52ff[_0x5bf7c6];return _0x591991;};'use strict';var multer=require('multer');var util=require(_0xf52f('0x0'));var path=require(_0xf52f('0x1'));var timeout=require(_0xf52f('0x2'));var express=require(_0xf52f('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf52f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf52f('0x5'));var controller=require('./intFreshsalesConfiguration.controller');router[_0xf52f('0x6')]('/',auth[_0xf52f('0x7')](),controller[_0xf52f('0x8')]);router['get'](_0xf52f('0x9'),auth[_0xf52f('0x7')](),controller[_0xf52f('0xa')]);router['get'](_0xf52f('0xb'),auth['isAuthenticated'](),controller['getSubjects']);router[_0xf52f('0x6')](_0xf52f('0xc'),auth[_0xf52f('0x7')](),controller[_0xf52f('0xd')]);router[_0xf52f('0x6')](_0xf52f('0xe'),auth[_0xf52f('0x7')](),controller[_0xf52f('0xf')]);router[_0xf52f('0x10')]('/',auth[_0xf52f('0x7')](),controller[_0xf52f('0x11')]);router[_0xf52f('0x12')](_0xf52f('0x9'),auth[_0xf52f('0x7')](),controller[_0xf52f('0x13')]);router[_0xf52f('0x14')](_0xf52f('0x9'),auth[_0xf52f('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 32c3103..59b85e7 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 _0x5558=['sequelize','exports','STRING'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x5558,0xf6));var _0x8555=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x5558[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0x8555('0x0'));module[_0x8555('0x1')]={'name':{'type':Sequelize[_0x8555('0x2')]},'description':{'type':Sequelize[_0x8555('0x2')]}}; \ No newline at end of file +var _0xca80=['STRING','sequelize'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0xca80,0x1f3));var _0x0ca8=function(_0x530724,_0x1e7df2){_0x530724=_0x530724-0x0;var _0x432a47=_0xca80[_0x530724];return _0x432a47;};'use strict';var Sequelize=require(_0x0ca8('0x0'));module['exports']={'name':{'type':Sequelize[_0x0ca8('0x1')]},'description':{'type':Sequelize[_0x0ca8('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 00300f0..3b2a9f4 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 _0x5069=['fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','include','rows','catch','show','params','includeAll','find','create','body','getSubjects','nolimit','getDescriptions','findOne','FreshsalesField','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','map','FreshsalesConfiguration','rawAttributes','type','key','model','query','keys','filters','intersection','attributes'];(function(_0x398cca,_0x154eb3){var _0x563d85=function(_0x3566b5){while(--_0x3566b5){_0x398cca['push'](_0x398cca['shift']());}};_0x563d85(++_0x154eb3);}(_0x5069,0x14d));var _0x9506=function(_0x516ae1,_0x7628a3){_0x516ae1=_0x516ae1-0x0;var _0x5ba192=_0x5069[_0x516ae1];return _0x5ba192;};'use strict';var emlformat=require(_0x9506('0x0'));var rimraf=require(_0x9506('0x1'));var zipdir=require(_0x9506('0x2'));var jsonpatch=require(_0x9506('0x3'));var rp=require(_0x9506('0x4'));var moment=require(_0x9506('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9506('0x6'));var path=require('path');var sox=require(_0x9506('0x7'));var csv=require(_0x9506('0x8'));var ejs=require(_0x9506('0x9'));var fs=require('fs');var fs_extra=require(_0x9506('0xa'));var _=require(_0x9506('0xb'));var squel=require(_0x9506('0xc'));var crypto=require(_0x9506('0xd'));var jsforce=require(_0x9506('0xe'));var deskjs=require(_0x9506('0xf'));var toCsv=require(_0x9506('0x8'));var querystring=require(_0x9506('0x10'));var Papa=require(_0x9506('0x11'));var Redis=require(_0x9506('0x12'));var authService=require(_0x9506('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x9506('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9506('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9506('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1478d4,_0x5e68f7){_0x5e68f7=_0x5e68f7||0xcc;return function(_0x4d373f){if(_0x4d373f){return _0x1478d4[_0x9506('0x17')](_0x5e68f7);}return _0x1478d4[_0x9506('0x18')](_0x5e68f7)['end']();};}function respondWithResult(_0x234921,_0x470478){_0x470478=_0x470478||0xc8;return function(_0x2463f8){if(_0x2463f8){return _0x234921['status'](_0x470478)[_0x9506('0x19')](_0x2463f8);}};}function respondWithFilteredResult(_0xa2034f,_0x1d9d8b){return function(_0xff91ac){if(_0xff91ac){var _0x34c92a=typeof _0x1d9d8b[_0x9506('0x1a')]===_0x9506('0x1b')&&typeof _0x1d9d8b[_0x9506('0x1c')]==='undefined';var _0x2138cf=_0xff91ac[_0x9506('0x1d')];var _0x1a51f3=_0x34c92a?0x0:_0x1d9d8b[_0x9506('0x1a')];var _0x363a99=_0x34c92a?_0xff91ac['count']:_0x1d9d8b['offset']+_0x1d9d8b[_0x9506('0x1c')];var _0x54d8cc;if(_0x363a99>=_0x2138cf){_0x363a99=_0x2138cf;_0x54d8cc=0xc8;}else{_0x54d8cc=0xce;}_0xa2034f[_0x9506('0x18')](_0x54d8cc);return _0xa2034f['set'](_0x9506('0x1e'),_0x1a51f3+'-'+_0x363a99+'/'+_0x2138cf)['json'](_0xff91ac);}return null;};}function patchUpdates(_0x293b9d){return function(_0x124b5e){try{jsonpatch[_0x9506('0x1f')](_0x124b5e,_0x293b9d,!![]);}catch(_0x110199){return BPromise[_0x9506('0x20')](_0x110199);}return _0x124b5e[_0x9506('0x21')]();};}function saveUpdates(_0x2ede28,_0x20d510){return function(_0xb24c99){if(_0xb24c99){return _0xb24c99[_0x9506('0x22')](_0x2ede28)[_0x9506('0x23')](function(_0x2b1944){return _0x2b1944;});}return null;};}function removeEntity(_0x28b432,_0x1e55e8){return function(_0x172de2){if(_0x172de2){return _0x172de2[_0x9506('0x24')]()['then'](function(){_0x28b432[_0x9506('0x18')](0xcc)[_0x9506('0x25')]();});}};}function handleEntityNotFound(_0x534451,_0x22a793){return function(_0x1eb0fe){if(!_0x1eb0fe){_0x534451['sendStatus'](0x194);}return _0x1eb0fe;};}function handleError(_0x2fe1cd,_0x4c729d){_0x4c729d=_0x4c729d||0x1f4;return function(_0x875802){logger['error'](_0x875802[_0x9506('0x26')]);if(_0x875802[_0x9506('0x27')]){delete _0x875802['name'];}_0x2fe1cd[_0x9506('0x18')](_0x4c729d)[_0x9506('0x28')](_0x875802);};}exports['index']=function(_0x3c41c6,_0x550e4a){var _0x38a020={},_0x269375={},_0x3db8b5={'count':0x0,'rows':[]};var _0x1e6f21=_[_0x9506('0x29')](db[_0x9506('0x2a')][_0x9506('0x2b')],function(_0x50aa5c){return{'name':_0x50aa5c['fieldName'],'type':_0x50aa5c[_0x9506('0x2c')][_0x9506('0x2d')]};});_0x269375[_0x9506('0x2e')]=_['map'](_0x1e6f21,_0x9506('0x27'));_0x269375[_0x9506('0x2f')]=_[_0x9506('0x30')](_0x3c41c6[_0x9506('0x2f')]);_0x269375[_0x9506('0x31')]=_[_0x9506('0x32')](_0x269375[_0x9506('0x2e')],_0x269375[_0x9506('0x2f')]);_0x38a020[_0x9506('0x33')]=_['intersection'](_0x269375[_0x9506('0x2e')],qs[_0x9506('0x34')](_0x3c41c6[_0x9506('0x2f')][_0x9506('0x34')]));_0x38a020[_0x9506('0x33')]=_0x38a020[_0x9506('0x33')][_0x9506('0x35')]?_0x38a020['attributes']:_0x269375['model'];if(!_0x3c41c6[_0x9506('0x2f')][_0x9506('0x36')]('nolimit')){_0x38a020[_0x9506('0x1c')]=qs[_0x9506('0x1c')](_0x3c41c6[_0x9506('0x2f')][_0x9506('0x1c')]);_0x38a020['offset']=qs['offset'](_0x3c41c6[_0x9506('0x2f')][_0x9506('0x1a')]);}_0x38a020[_0x9506('0x37')]=qs[_0x9506('0x38')](_0x3c41c6[_0x9506('0x2f')][_0x9506('0x38')]);_0x38a020[_0x9506('0x39')]=qs[_0x9506('0x31')](_[_0x9506('0x3a')](_0x3c41c6['query'],_0x269375[_0x9506('0x31')]),_0x1e6f21);if(_0x3c41c6['query'][_0x9506('0x3b')]){_0x38a020[_0x9506('0x39')]=_['merge'](_0x38a020[_0x9506('0x39')],{'$or':_[_0x9506('0x29')](_0x1e6f21,function(_0x26bf9e){if(_0x26bf9e[_0x9506('0x2c')]!=='VIRTUAL'){var _0x28bc1e={};_0x28bc1e[_0x26bf9e[_0x9506('0x27')]]={'$like':'%'+_0x3c41c6[_0x9506('0x2f')][_0x9506('0x3b')]+'%'};return _0x28bc1e;}})});}_0x38a020=_[_0x9506('0x3c')]({},_0x38a020,_0x3c41c6[_0x9506('0x3d')]);var _0x1f45a4={'where':_0x38a020[_0x9506('0x39')]};return db[_0x9506('0x2a')]['count'](_0x1f45a4)['then'](function(_0x5907d1){_0x3db8b5[_0x9506('0x1d')]=_0x5907d1;if(_0x3c41c6['query']['includeAll']){_0x38a020[_0x9506('0x3e')]=[{'all':!![]}];}return db['FreshsalesConfiguration']['findAll'](_0x38a020);})[_0x9506('0x23')](function(_0x48ae67){_0x3db8b5[_0x9506('0x3f')]=_0x48ae67;return _0x3db8b5;})[_0x9506('0x23')](respondWithFilteredResult(_0x550e4a,_0x38a020))[_0x9506('0x40')](handleError(_0x550e4a,null));};exports[_0x9506('0x41')]=function(_0x5bcbfa,_0x24ec5b){var _0x26b71b={'raw':![],'where':{'id':_0x5bcbfa[_0x9506('0x42')]['id']}},_0x450aa2={};_0x450aa2[_0x9506('0x2e')]=_[_0x9506('0x30')](db[_0x9506('0x2a')][_0x9506('0x2b')]);_0x450aa2['query']=_[_0x9506('0x30')](_0x5bcbfa['query']);_0x450aa2[_0x9506('0x31')]=_[_0x9506('0x32')](_0x450aa2['model'],_0x450aa2[_0x9506('0x2f')]);_0x26b71b[_0x9506('0x33')]=_[_0x9506('0x32')](_0x450aa2['model'],qs[_0x9506('0x34')](_0x5bcbfa[_0x9506('0x2f')]['fields']));_0x26b71b[_0x9506('0x33')]=_0x26b71b[_0x9506('0x33')][_0x9506('0x35')]?_0x26b71b['attributes']:_0x450aa2[_0x9506('0x2e')];if(_0x5bcbfa[_0x9506('0x2f')][_0x9506('0x43')]){_0x26b71b['include']=[{'all':!![]}];}_0x26b71b=_[_0x9506('0x3c')]({},_0x26b71b,_0x5bcbfa[_0x9506('0x3d')]);return db[_0x9506('0x2a')][_0x9506('0x44')](_0x26b71b)[_0x9506('0x23')](handleEntityNotFound(_0x24ec5b,null))[_0x9506('0x23')](respondWithResult(_0x24ec5b,null))[_0x9506('0x40')](handleError(_0x24ec5b,null));};exports[_0x9506('0x45')]=function(_0x2569d6,_0x1b434f){return db[_0x9506('0x2a')][_0x9506('0x45')](_0x2569d6[_0x9506('0x46')],{})['then'](respondWithResult(_0x1b434f,0xc9))[_0x9506('0x40')](handleError(_0x1b434f,null));};exports[_0x9506('0x22')]=function(_0x2f1ad5,_0x1fd7d6){if(_0x2f1ad5[_0x9506('0x46')]['id']){delete _0x2f1ad5[_0x9506('0x46')]['id'];}return db[_0x9506('0x2a')][_0x9506('0x44')]({'where':{'id':_0x2f1ad5['params']['id']}})[_0x9506('0x23')](handleEntityNotFound(_0x1fd7d6,null))[_0x9506('0x23')](saveUpdates(_0x2f1ad5[_0x9506('0x46')],null))[_0x9506('0x23')](respondWithResult(_0x1fd7d6,null))[_0x9506('0x40')](handleError(_0x1fd7d6,null));};exports[_0x9506('0x24')]=function(_0xe70f5d,_0x37d900){return db[_0x9506('0x2a')][_0x9506('0x44')]({'where':{'id':_0xe70f5d[_0x9506('0x42')]['id']}})[_0x9506('0x23')](handleEntityNotFound(_0x37d900,null))[_0x9506('0x23')](removeEntity(_0x37d900,null))[_0x9506('0x40')](handleError(_0x37d900,null));};exports[_0x9506('0x47')]=function(_0x463799,_0x36e5f1,_0x28baa1){var _0x4fe74e={};var _0x341749={};var _0x516367;var _0x7d0b4d;return db[_0x9506('0x2a')]['findOne']({'where':{'id':_0x463799[_0x9506('0x42')]['id']}})[_0x9506('0x23')](handleEntityNotFound(_0x36e5f1,null))['then'](function(_0x56655e){if(_0x56655e){_0x516367=_0x56655e;_0x341749['model']=_['keys'](db['FreshsalesField']['rawAttributes']);_0x341749['query']=_['keys'](_0x463799[_0x9506('0x2f')]);_0x341749[_0x9506('0x31')]=_[_0x9506('0x32')](_0x341749[_0x9506('0x2e')],_0x341749[_0x9506('0x2f')]);_0x4fe74e['attributes']=_[_0x9506('0x32')](_0x341749['model'],qs[_0x9506('0x34')](_0x463799[_0x9506('0x2f')]['fields']));_0x4fe74e[_0x9506('0x33')]=_0x4fe74e[_0x9506('0x33')][_0x9506('0x35')]?_0x4fe74e[_0x9506('0x33')]:_0x341749[_0x9506('0x2e')];_0x4fe74e[_0x9506('0x37')]=qs[_0x9506('0x38')](_0x463799[_0x9506('0x2f')][_0x9506('0x38')]);_0x4fe74e[_0x9506('0x39')]=qs[_0x9506('0x31')](_[_0x9506('0x3a')](_0x463799[_0x9506('0x2f')],_0x341749[_0x9506('0x31')]));if(_0x463799[_0x9506('0x2f')]['filter']){_0x4fe74e[_0x9506('0x39')]=_[_0x9506('0x3c')](_0x4fe74e[_0x9506('0x39')],{'$or':_['map'](_0x4fe74e[_0x9506('0x33')],function(_0x4dadca){var _0x2b176d={};_0x2b176d[_0x4dadca]={'$like':'%'+_0x463799['query'][_0x9506('0x3b')]+'%'};return _0x2b176d;})});}_0x4fe74e=_[_0x9506('0x3c')]({},_0x4fe74e,_0x463799[_0x9506('0x3d')]);return _0x516367[_0x9506('0x47')](_0x4fe74e);}})['then'](function(_0x2796a1){if(_0x2796a1){_0x7d0b4d=_0x2796a1['length'];if(!_0x463799['query'][_0x9506('0x36')](_0x9506('0x48'))){_0x4fe74e['limit']=qs[_0x9506('0x1c')](_0x463799[_0x9506('0x2f')][_0x9506('0x1c')]);_0x4fe74e[_0x9506('0x1a')]=qs[_0x9506('0x1a')](_0x463799['query'][_0x9506('0x1a')]);}return _0x516367[_0x9506('0x47')](_0x4fe74e);}})['then'](function(_0x243efa){if(_0x243efa){return _0x243efa?{'count':_0x7d0b4d,'rows':_0x243efa}:null;}})[_0x9506('0x23')](respondWithResult(_0x36e5f1,null))['catch'](handleError(_0x36e5f1,null));};exports[_0x9506('0x49')]=function(_0x5b02d2,_0x4f1767,_0x69fd71){var _0x41e1fb={};var _0x2a2b7e={};var _0x446ce3;var _0x32f453;return db[_0x9506('0x2a')][_0x9506('0x4a')]({'where':{'id':_0x5b02d2[_0x9506('0x42')]['id']}})[_0x9506('0x23')](handleEntityNotFound(_0x4f1767,null))[_0x9506('0x23')](function(_0x5b96d6){if(_0x5b96d6){_0x446ce3=_0x5b96d6;_0x2a2b7e['model']=_[_0x9506('0x30')](db[_0x9506('0x4b')][_0x9506('0x2b')]);_0x2a2b7e[_0x9506('0x2f')]=_[_0x9506('0x30')](_0x5b02d2['query']);_0x2a2b7e[_0x9506('0x31')]=_[_0x9506('0x32')](_0x2a2b7e[_0x9506('0x2e')],_0x2a2b7e[_0x9506('0x2f')]);_0x41e1fb['attributes']=_[_0x9506('0x32')](_0x2a2b7e['model'],qs[_0x9506('0x34')](_0x5b02d2[_0x9506('0x2f')]['fields']));_0x41e1fb['attributes']=_0x41e1fb[_0x9506('0x33')][_0x9506('0x35')]?_0x41e1fb[_0x9506('0x33')]:_0x2a2b7e[_0x9506('0x2e')];_0x41e1fb[_0x9506('0x37')]=qs[_0x9506('0x38')](_0x5b02d2['query'][_0x9506('0x38')]);_0x41e1fb[_0x9506('0x39')]=qs[_0x9506('0x31')](_[_0x9506('0x3a')](_0x5b02d2['query'],_0x2a2b7e[_0x9506('0x31')]));if(_0x5b02d2['query'][_0x9506('0x3b')]){_0x41e1fb[_0x9506('0x39')]=_[_0x9506('0x3c')](_0x41e1fb['where'],{'$or':_[_0x9506('0x29')](_0x41e1fb[_0x9506('0x33')],function(_0x4ea83f){var _0x162404={};_0x162404[_0x4ea83f]={'$like':'%'+_0x5b02d2[_0x9506('0x2f')][_0x9506('0x3b')]+'%'};return _0x162404;})});}_0x41e1fb=_[_0x9506('0x3c')]({},_0x41e1fb,_0x5b02d2[_0x9506('0x3d')]);return _0x446ce3[_0x9506('0x49')](_0x41e1fb);}})[_0x9506('0x23')](function(_0xde8375){if(_0xde8375){_0x32f453=_0xde8375['length'];if(!_0x5b02d2['query'][_0x9506('0x36')](_0x9506('0x48'))){_0x41e1fb[_0x9506('0x1c')]=qs['limit'](_0x5b02d2[_0x9506('0x2f')][_0x9506('0x1c')]);_0x41e1fb[_0x9506('0x1a')]=qs[_0x9506('0x1a')](_0x5b02d2[_0x9506('0x2f')][_0x9506('0x1a')]);}return _0x446ce3[_0x9506('0x49')](_0x41e1fb);}})['then'](function(_0x5474fa){if(_0x5474fa){return _0x5474fa?{'count':_0x32f453,'rows':_0x5474fa}:null;}})['then'](respondWithResult(_0x4f1767,null))[_0x9506('0x40')](handleError(_0x4f1767,null));};exports[_0x9506('0x4c')]=function(_0x1b7df2,_0x27687b,_0x4b71b1){var _0x260193={};var _0x32abfa={};var _0x25f8f2;var _0x313724;return db[_0x9506('0x2a')][_0x9506('0x4a')]({'where':{'id':_0x1b7df2['params']['id']}})['then'](handleEntityNotFound(_0x27687b,null))['then'](function(_0x2c3037){if(_0x2c3037){_0x25f8f2=_0x2c3037;_0x32abfa[_0x9506('0x2e')]=_[_0x9506('0x30')](db[_0x9506('0x4b')][_0x9506('0x2b')]);_0x32abfa[_0x9506('0x2f')]=_[_0x9506('0x30')](_0x1b7df2[_0x9506('0x2f')]);_0x32abfa['filters']=_['intersection'](_0x32abfa[_0x9506('0x2e')],_0x32abfa[_0x9506('0x2f')]);_0x260193['attributes']=_[_0x9506('0x32')](_0x32abfa['model'],qs[_0x9506('0x34')](_0x1b7df2[_0x9506('0x2f')][_0x9506('0x34')]));_0x260193[_0x9506('0x33')]=_0x260193[_0x9506('0x33')][_0x9506('0x35')]?_0x260193[_0x9506('0x33')]:_0x32abfa[_0x9506('0x2e')];_0x260193[_0x9506('0x37')]=qs[_0x9506('0x38')](_0x1b7df2[_0x9506('0x2f')][_0x9506('0x38')]);_0x260193[_0x9506('0x39')]=qs['filters'](_[_0x9506('0x3a')](_0x1b7df2['query'],_0x32abfa['filters']));if(_0x1b7df2[_0x9506('0x2f')]['filter']){_0x260193['where']=_['merge'](_0x260193[_0x9506('0x39')],{'$or':_[_0x9506('0x29')](_0x260193[_0x9506('0x33')],function(_0x13e05e){var _0x47f722={};_0x47f722[_0x13e05e]={'$like':'%'+_0x1b7df2[_0x9506('0x2f')]['filter']+'%'};return _0x47f722;})});}_0x260193=_[_0x9506('0x3c')]({},_0x260193,_0x1b7df2[_0x9506('0x3d')]);return _0x25f8f2['getFields'](_0x260193);}})['then'](function(_0x3c8b1a){if(_0x3c8b1a){_0x313724=_0x3c8b1a[_0x9506('0x35')];if(!_0x1b7df2[_0x9506('0x2f')][_0x9506('0x36')](_0x9506('0x48'))){_0x260193[_0x9506('0x1c')]=qs['limit'](_0x1b7df2[_0x9506('0x2f')]['limit']);_0x260193[_0x9506('0x1a')]=qs[_0x9506('0x1a')](_0x1b7df2[_0x9506('0x2f')][_0x9506('0x1a')]);}return _0x25f8f2[_0x9506('0x4c')](_0x260193);}})[_0x9506('0x23')](function(_0x12d6bf){if(_0x12d6bf){return _0x12d6bf?{'count':_0x313724,'rows':_0x12d6bf}:null;}})[_0x9506('0x23')](respondWithResult(_0x27687b,null))[_0x9506('0x40')](handleError(_0x27687b,null));}; \ No newline at end of file +var _0xbe59=['then','error','name','index','map','FreshsalesConfiguration','fieldName','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','merge','create','body','find','getSubjects','findOne','FreshsalesField','order','nolimit','getDescriptions','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','update','destroy'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xbe59,0x166));var _0x9be5=function(_0x377100,_0x2a2361){_0x377100=_0x377100-0x0;var _0x1c8738=_0xbe59[_0x377100];return _0x1c8738;};'use strict';var emlformat=require(_0x9be5('0x0'));var rimraf=require(_0x9be5('0x1'));var zipdir=require(_0x9be5('0x2'));var jsonpatch=require(_0x9be5('0x3'));var rp=require(_0x9be5('0x4'));var moment=require(_0x9be5('0x5'));var BPromise=require(_0x9be5('0x6'));var Mustache=require(_0x9be5('0x7'));var util=require(_0x9be5('0x8'));var path=require('path');var sox=require(_0x9be5('0x9'));var csv=require('to-csv');var ejs=require(_0x9be5('0xa'));var fs=require('fs');var fs_extra=require(_0x9be5('0xb'));var _=require(_0x9be5('0xc'));var squel=require(_0x9be5('0xd'));var crypto=require(_0x9be5('0xe'));var jsforce=require(_0x9be5('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9be5('0x10'));var Redis=require(_0x9be5('0x11'));var authService=require(_0x9be5('0x12'));var qs=require(_0x9be5('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9be5('0x14'));var logger=require('../../config/logger')(_0x9be5('0x15'));var utils=require(_0x9be5('0x16'));var config=require(_0x9be5('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2678cd,_0x2e318c){_0x2e318c=_0x2e318c||0xcc;return function(_0x14e829){if(_0x14e829){return _0x2678cd[_0x9be5('0x18')](_0x2e318c);}return _0x2678cd[_0x9be5('0x19')](_0x2e318c)[_0x9be5('0x1a')]();};}function respondWithResult(_0x1c872f,_0x140cd5){_0x140cd5=_0x140cd5||0xc8;return function(_0x49fb51){if(_0x49fb51){return _0x1c872f['status'](_0x140cd5)['json'](_0x49fb51);}};}function respondWithFilteredResult(_0x405179,_0x1c006b){return function(_0x46eb2d){if(_0x46eb2d){var _0x3d5a67=typeof _0x1c006b[_0x9be5('0x1b')]===_0x9be5('0x1c')&&typeof _0x1c006b[_0x9be5('0x1d')]===_0x9be5('0x1c');var _0x2c3656=_0x46eb2d[_0x9be5('0x1e')];var _0x899bf3=_0x3d5a67?0x0:_0x1c006b[_0x9be5('0x1b')];var _0x3ca4c7=_0x3d5a67?_0x46eb2d[_0x9be5('0x1e')]:_0x1c006b[_0x9be5('0x1b')]+_0x1c006b[_0x9be5('0x1d')];var _0x390ee6;if(_0x3ca4c7>=_0x2c3656){_0x3ca4c7=_0x2c3656;_0x390ee6=0xc8;}else{_0x390ee6=0xce;}_0x405179['status'](_0x390ee6);return _0x405179[_0x9be5('0x1f')](_0x9be5('0x20'),_0x899bf3+'-'+_0x3ca4c7+'/'+_0x2c3656)[_0x9be5('0x21')](_0x46eb2d);}return null;};}function patchUpdates(_0xc93277){return function(_0x4b17ea){try{jsonpatch['apply'](_0x4b17ea,_0xc93277,!![]);}catch(_0x5054c6){return BPromise[_0x9be5('0x22')](_0x5054c6);}return _0x4b17ea['save']();};}function saveUpdates(_0x1e7342,_0x539526){return function(_0x2db957){if(_0x2db957){return _0x2db957[_0x9be5('0x23')](_0x1e7342)['then'](function(_0x5711b2){return _0x5711b2;});}return null;};}function removeEntity(_0x44a365,_0x30492e){return function(_0x3c70af){if(_0x3c70af){return _0x3c70af[_0x9be5('0x24')]()[_0x9be5('0x25')](function(){_0x44a365[_0x9be5('0x19')](0xcc)[_0x9be5('0x1a')]();});}};}function handleEntityNotFound(_0x2c7643,_0x5f4f08){return function(_0x1c47f2){if(!_0x1c47f2){_0x2c7643[_0x9be5('0x18')](0x194);}return _0x1c47f2;};}function handleError(_0x33afdf,_0x5179cb){_0x5179cb=_0x5179cb||0x1f4;return function(_0x50d537){logger[_0x9be5('0x26')](_0x50d537['stack']);if(_0x50d537['name']){delete _0x50d537[_0x9be5('0x27')];}_0x33afdf['status'](_0x5179cb)['send'](_0x50d537);};}exports[_0x9be5('0x28')]=function(_0x10c36e,_0x2dd74a){var _0x465715={},_0x3d7a44={},_0x23250d={'count':0x0,'rows':[]};var _0x5dfc08=_[_0x9be5('0x29')](db[_0x9be5('0x2a')]['rawAttributes'],function(_0xdb17e8){return{'name':_0xdb17e8[_0x9be5('0x2b')],'type':_0xdb17e8[_0x9be5('0x2c')]['key']};});_0x3d7a44['model']=_['map'](_0x5dfc08,'name');_0x3d7a44[_0x9be5('0x2d')]=_[_0x9be5('0x2e')](_0x10c36e[_0x9be5('0x2d')]);_0x3d7a44[_0x9be5('0x2f')]=_[_0x9be5('0x30')](_0x3d7a44[_0x9be5('0x31')],_0x3d7a44['query']);_0x465715[_0x9be5('0x32')]=_[_0x9be5('0x30')](_0x3d7a44[_0x9be5('0x31')],qs[_0x9be5('0x33')](_0x10c36e[_0x9be5('0x2d')]['fields']));_0x465715[_0x9be5('0x32')]=_0x465715[_0x9be5('0x32')]['length']?_0x465715[_0x9be5('0x32')]:_0x3d7a44[_0x9be5('0x31')];if(!_0x10c36e[_0x9be5('0x2d')][_0x9be5('0x34')]('nolimit')){_0x465715[_0x9be5('0x1d')]=qs['limit'](_0x10c36e[_0x9be5('0x2d')][_0x9be5('0x1d')]);_0x465715[_0x9be5('0x1b')]=qs[_0x9be5('0x1b')](_0x10c36e[_0x9be5('0x2d')][_0x9be5('0x1b')]);}_0x465715['order']=qs[_0x9be5('0x35')](_0x10c36e['query']['sort']);_0x465715[_0x9be5('0x36')]=qs[_0x9be5('0x2f')](_[_0x9be5('0x37')](_0x10c36e[_0x9be5('0x2d')],_0x3d7a44[_0x9be5('0x2f')]),_0x5dfc08);if(_0x10c36e[_0x9be5('0x2d')][_0x9be5('0x38')]){_0x465715[_0x9be5('0x36')]=_['merge'](_0x465715[_0x9be5('0x36')],{'$or':_[_0x9be5('0x29')](_0x5dfc08,function(_0x56c147){if(_0x56c147['type']!==_0x9be5('0x39')){var _0x3bc60c={};_0x3bc60c[_0x56c147['name']]={'$like':'%'+_0x10c36e[_0x9be5('0x2d')]['filter']+'%'};return _0x3bc60c;}})});}_0x465715=_['merge']({},_0x465715,_0x10c36e[_0x9be5('0x3a')]);var _0x3d8373={'where':_0x465715[_0x9be5('0x36')]};return db['FreshsalesConfiguration']['count'](_0x3d8373)['then'](function(_0x4e9190){_0x23250d[_0x9be5('0x1e')]=_0x4e9190;if(_0x10c36e['query'][_0x9be5('0x3b')]){_0x465715[_0x9be5('0x3c')]=[{'all':!![]}];}return db[_0x9be5('0x2a')][_0x9be5('0x3d')](_0x465715);})['then'](function(_0x1a236b){_0x23250d[_0x9be5('0x3e')]=_0x1a236b;return _0x23250d;})[_0x9be5('0x25')](respondWithFilteredResult(_0x2dd74a,_0x465715))[_0x9be5('0x3f')](handleError(_0x2dd74a,null));};exports[_0x9be5('0x40')]=function(_0xb13bfd,_0x4c209a){var _0x14e70a={'raw':![],'where':{'id':_0xb13bfd[_0x9be5('0x41')]['id']}},_0x3381f2={};_0x3381f2[_0x9be5('0x31')]=_[_0x9be5('0x2e')](db[_0x9be5('0x2a')][_0x9be5('0x42')]);_0x3381f2[_0x9be5('0x2d')]=_[_0x9be5('0x2e')](_0xb13bfd[_0x9be5('0x2d')]);_0x3381f2[_0x9be5('0x2f')]=_[_0x9be5('0x30')](_0x3381f2[_0x9be5('0x31')],_0x3381f2[_0x9be5('0x2d')]);_0x14e70a[_0x9be5('0x32')]=_[_0x9be5('0x30')](_0x3381f2['model'],qs[_0x9be5('0x33')](_0xb13bfd[_0x9be5('0x2d')][_0x9be5('0x33')]));_0x14e70a[_0x9be5('0x32')]=_0x14e70a[_0x9be5('0x32')][_0x9be5('0x43')]?_0x14e70a[_0x9be5('0x32')]:_0x3381f2[_0x9be5('0x31')];if(_0xb13bfd[_0x9be5('0x2d')][_0x9be5('0x3b')]){_0x14e70a[_0x9be5('0x3c')]=[{'all':!![]}];}_0x14e70a=_[_0x9be5('0x44')]({},_0x14e70a,_0xb13bfd['options']);return db[_0x9be5('0x2a')]['find'](_0x14e70a)[_0x9be5('0x25')](handleEntityNotFound(_0x4c209a,null))[_0x9be5('0x25')](respondWithResult(_0x4c209a,null))[_0x9be5('0x3f')](handleError(_0x4c209a,null));};exports[_0x9be5('0x45')]=function(_0x27d1f2,_0x28100f){return db[_0x9be5('0x2a')][_0x9be5('0x45')](_0x27d1f2['body'],{})[_0x9be5('0x25')](respondWithResult(_0x28100f,0xc9))[_0x9be5('0x3f')](handleError(_0x28100f,null));};exports[_0x9be5('0x23')]=function(_0x1bb1d7,_0x29fb61){if(_0x1bb1d7[_0x9be5('0x46')]['id']){delete _0x1bb1d7['body']['id'];}return db[_0x9be5('0x2a')]['find']({'where':{'id':_0x1bb1d7[_0x9be5('0x41')]['id']}})[_0x9be5('0x25')](handleEntityNotFound(_0x29fb61,null))[_0x9be5('0x25')](saveUpdates(_0x1bb1d7['body'],null))[_0x9be5('0x25')](respondWithResult(_0x29fb61,null))[_0x9be5('0x3f')](handleError(_0x29fb61,null));};exports[_0x9be5('0x24')]=function(_0x5261d7,_0x28ed43){return db[_0x9be5('0x2a')][_0x9be5('0x47')]({'where':{'id':_0x5261d7[_0x9be5('0x41')]['id']}})['then'](handleEntityNotFound(_0x28ed43,null))[_0x9be5('0x25')](removeEntity(_0x28ed43,null))[_0x9be5('0x3f')](handleError(_0x28ed43,null));};exports[_0x9be5('0x48')]=function(_0x21c349,_0x1435a3,_0x41a485){var _0x46ff7e={};var _0x47c7c6={};var _0x22f071;var _0x2180f1;return db[_0x9be5('0x2a')][_0x9be5('0x49')]({'where':{'id':_0x21c349['params']['id']}})['then'](handleEntityNotFound(_0x1435a3,null))['then'](function(_0x28d75e){if(_0x28d75e){_0x22f071=_0x28d75e;_0x47c7c6[_0x9be5('0x31')]=_[_0x9be5('0x2e')](db[_0x9be5('0x4a')]['rawAttributes']);_0x47c7c6['query']=_[_0x9be5('0x2e')](_0x21c349['query']);_0x47c7c6['filters']=_[_0x9be5('0x30')](_0x47c7c6[_0x9be5('0x31')],_0x47c7c6[_0x9be5('0x2d')]);_0x46ff7e[_0x9be5('0x32')]=_[_0x9be5('0x30')](_0x47c7c6[_0x9be5('0x31')],qs[_0x9be5('0x33')](_0x21c349[_0x9be5('0x2d')][_0x9be5('0x33')]));_0x46ff7e['attributes']=_0x46ff7e['attributes'][_0x9be5('0x43')]?_0x46ff7e['attributes']:_0x47c7c6[_0x9be5('0x31')];_0x46ff7e[_0x9be5('0x4b')]=qs['sort'](_0x21c349[_0x9be5('0x2d')][_0x9be5('0x35')]);_0x46ff7e[_0x9be5('0x36')]=qs[_0x9be5('0x2f')](_[_0x9be5('0x37')](_0x21c349[_0x9be5('0x2d')],_0x47c7c6['filters']));if(_0x21c349['query'][_0x9be5('0x38')]){_0x46ff7e['where']=_[_0x9be5('0x44')](_0x46ff7e['where'],{'$or':_[_0x9be5('0x29')](_0x46ff7e[_0x9be5('0x32')],function(_0x56cb3c){var _0x24d82e={};_0x24d82e[_0x56cb3c]={'$like':'%'+_0x21c349[_0x9be5('0x2d')][_0x9be5('0x38')]+'%'};return _0x24d82e;})});}_0x46ff7e=_[_0x9be5('0x44')]({},_0x46ff7e,_0x21c349['options']);return _0x22f071['getSubjects'](_0x46ff7e);}})['then'](function(_0x4f07f8){if(_0x4f07f8){_0x2180f1=_0x4f07f8['length'];if(!_0x21c349[_0x9be5('0x2d')][_0x9be5('0x34')](_0x9be5('0x4c'))){_0x46ff7e[_0x9be5('0x1d')]=qs[_0x9be5('0x1d')](_0x21c349[_0x9be5('0x2d')][_0x9be5('0x1d')]);_0x46ff7e['offset']=qs[_0x9be5('0x1b')](_0x21c349[_0x9be5('0x2d')][_0x9be5('0x1b')]);}return _0x22f071[_0x9be5('0x48')](_0x46ff7e);}})[_0x9be5('0x25')](function(_0x7077eb){if(_0x7077eb){return _0x7077eb?{'count':_0x2180f1,'rows':_0x7077eb}:null;}})[_0x9be5('0x25')](respondWithResult(_0x1435a3,null))[_0x9be5('0x3f')](handleError(_0x1435a3,null));};exports[_0x9be5('0x4d')]=function(_0x22a17a,_0x198223,_0x24754b){var _0x16dd91={};var _0x723c40={};var _0x2d1bb9;var _0x2de705;return db[_0x9be5('0x2a')][_0x9be5('0x49')]({'where':{'id':_0x22a17a[_0x9be5('0x41')]['id']}})[_0x9be5('0x25')](handleEntityNotFound(_0x198223,null))['then'](function(_0x5cdd06){if(_0x5cdd06){_0x2d1bb9=_0x5cdd06;_0x723c40[_0x9be5('0x31')]=_[_0x9be5('0x2e')](db[_0x9be5('0x4a')][_0x9be5('0x42')]);_0x723c40[_0x9be5('0x2d')]=_[_0x9be5('0x2e')](_0x22a17a['query']);_0x723c40['filters']=_[_0x9be5('0x30')](_0x723c40['model'],_0x723c40[_0x9be5('0x2d')]);_0x16dd91[_0x9be5('0x32')]=_[_0x9be5('0x30')](_0x723c40[_0x9be5('0x31')],qs[_0x9be5('0x33')](_0x22a17a['query'][_0x9be5('0x33')]));_0x16dd91[_0x9be5('0x32')]=_0x16dd91[_0x9be5('0x32')][_0x9be5('0x43')]?_0x16dd91[_0x9be5('0x32')]:_0x723c40[_0x9be5('0x31')];_0x16dd91[_0x9be5('0x4b')]=qs[_0x9be5('0x35')](_0x22a17a[_0x9be5('0x2d')][_0x9be5('0x35')]);_0x16dd91[_0x9be5('0x36')]=qs[_0x9be5('0x2f')](_[_0x9be5('0x37')](_0x22a17a[_0x9be5('0x2d')],_0x723c40[_0x9be5('0x2f')]));if(_0x22a17a[_0x9be5('0x2d')][_0x9be5('0x38')]){_0x16dd91['where']=_[_0x9be5('0x44')](_0x16dd91[_0x9be5('0x36')],{'$or':_['map'](_0x16dd91[_0x9be5('0x32')],function(_0x54d6d6){var _0x5204a1={};_0x5204a1[_0x54d6d6]={'$like':'%'+_0x22a17a[_0x9be5('0x2d')][_0x9be5('0x38')]+'%'};return _0x5204a1;})});}_0x16dd91=_[_0x9be5('0x44')]({},_0x16dd91,_0x22a17a[_0x9be5('0x3a')]);return _0x2d1bb9['getDescriptions'](_0x16dd91);}})['then'](function(_0x1612eb){if(_0x1612eb){_0x2de705=_0x1612eb['length'];if(!_0x22a17a[_0x9be5('0x2d')][_0x9be5('0x34')]('nolimit')){_0x16dd91[_0x9be5('0x1d')]=qs[_0x9be5('0x1d')](_0x22a17a['query'][_0x9be5('0x1d')]);_0x16dd91[_0x9be5('0x1b')]=qs[_0x9be5('0x1b')](_0x22a17a[_0x9be5('0x2d')][_0x9be5('0x1b')]);}return _0x2d1bb9[_0x9be5('0x4d')](_0x16dd91);}})[_0x9be5('0x25')](function(_0x58e3ce){if(_0x58e3ce){return _0x58e3ce?{'count':_0x2de705,'rows':_0x58e3ce}:null;}})[_0x9be5('0x25')](respondWithResult(_0x198223,null))[_0x9be5('0x3f')](handleError(_0x198223,null));};exports[_0x9be5('0x4e')]=function(_0x4bdd70,_0x50a57d,_0x4766d1){var _0x2d9e85={};var _0xc0855c={};var _0x447c18;var _0x1f549a;return db[_0x9be5('0x2a')][_0x9be5('0x49')]({'where':{'id':_0x4bdd70[_0x9be5('0x41')]['id']}})[_0x9be5('0x25')](handleEntityNotFound(_0x50a57d,null))[_0x9be5('0x25')](function(_0x4cac1f){if(_0x4cac1f){_0x447c18=_0x4cac1f;_0xc0855c[_0x9be5('0x31')]=_[_0x9be5('0x2e')](db[_0x9be5('0x4a')]['rawAttributes']);_0xc0855c[_0x9be5('0x2d')]=_[_0x9be5('0x2e')](_0x4bdd70[_0x9be5('0x2d')]);_0xc0855c[_0x9be5('0x2f')]=_['intersection'](_0xc0855c[_0x9be5('0x31')],_0xc0855c[_0x9be5('0x2d')]);_0x2d9e85[_0x9be5('0x32')]=_[_0x9be5('0x30')](_0xc0855c[_0x9be5('0x31')],qs[_0x9be5('0x33')](_0x4bdd70['query'][_0x9be5('0x33')]));_0x2d9e85['attributes']=_0x2d9e85[_0x9be5('0x32')]['length']?_0x2d9e85[_0x9be5('0x32')]:_0xc0855c[_0x9be5('0x31')];_0x2d9e85['order']=qs[_0x9be5('0x35')](_0x4bdd70[_0x9be5('0x2d')][_0x9be5('0x35')]);_0x2d9e85[_0x9be5('0x36')]=qs[_0x9be5('0x2f')](_[_0x9be5('0x37')](_0x4bdd70[_0x9be5('0x2d')],_0xc0855c[_0x9be5('0x2f')]));if(_0x4bdd70['query'][_0x9be5('0x38')]){_0x2d9e85[_0x9be5('0x36')]=_[_0x9be5('0x44')](_0x2d9e85[_0x9be5('0x36')],{'$or':_['map'](_0x2d9e85[_0x9be5('0x32')],function(_0x3949ca){var _0x187700={};_0x187700[_0x3949ca]={'$like':'%'+_0x4bdd70['query'][_0x9be5('0x38')]+'%'};return _0x187700;})});}_0x2d9e85=_['merge']({},_0x2d9e85,_0x4bdd70['options']);return _0x447c18[_0x9be5('0x4e')](_0x2d9e85);}})[_0x9be5('0x25')](function(_0x551e15){if(_0x551e15){_0x1f549a=_0x551e15[_0x9be5('0x43')];if(!_0x4bdd70[_0x9be5('0x2d')][_0x9be5('0x34')]('nolimit')){_0x2d9e85['limit']=qs['limit'](_0x4bdd70[_0x9be5('0x2d')][_0x9be5('0x1d')]);_0x2d9e85[_0x9be5('0x1b')]=qs[_0x9be5('0x1b')](_0x4bdd70[_0x9be5('0x2d')][_0x9be5('0x1b')]);}return _0x447c18[_0x9be5('0x4e')](_0x2d9e85);}})['then'](function(_0x190bcf){if(_0x190bcf){return _0x190bcf?{'count':_0x1f549a,'rows':_0x190bcf}:null;}})['then'](respondWithResult(_0x50a57d,null))[_0x9be5('0x3f')](handleError(_0x50a57d,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index e0b9d3c..2c37d3b 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 _0xc43f=['FreshsalesConfiguration','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./intFreshsalesConfiguration.attributes','define'];(function(_0x9f1302,_0x484770){var _0x49073a=function(_0x138c0f){while(--_0x138c0f){_0x9f1302['push'](_0x9f1302['shift']());}};_0x49073a(++_0x484770);}(_0xc43f,0x182));var _0xfc43=function(_0x8b2cdf,_0x27636d){_0x8b2cdf=_0x8b2cdf-0x0;var _0x4e8179=_0xc43f[_0x8b2cdf];return _0x4e8179;};'use strict';var _=require(_0xfc43('0x0'));var util=require(_0xfc43('0x1'));var logger=require(_0xfc43('0x2'))('api');var moment=require(_0xfc43('0x3'));var BPromise=require(_0xfc43('0x4'));var rp=require(_0xfc43('0x5'));var fs=require('fs');var path=require(_0xfc43('0x6'));var rimraf=require('rimraf');var config=require(_0xfc43('0x7'));var attributes=require(_0xfc43('0x8'));module['exports']=function(_0x2dc271,_0x35bf8a){return _0x2dc271[_0xfc43('0x9')](_0xfc43('0xa'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb6c1=['define','FreshsalesConfiguration','int_freshsales_configurations','lodash','../../config/logger','moment','path','rimraf','../../config/environment','exports'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0xb6c1,0x12f));var _0x1b6c=function(_0x662058,_0x5c3e98){_0x662058=_0x662058-0x0;var _0x348759=_0xb6c1[_0x662058];return _0x348759;};'use strict';var _=require(_0x1b6c('0x0'));var util=require('util');var logger=require(_0x1b6c('0x1'))('api');var moment=require(_0x1b6c('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1b6c('0x3'));var rimraf=require(_0x1b6c('0x4'));var config=require(_0x1b6c('0x5'));var attributes=require('./intFreshsalesConfiguration.attributes');module[_0x1b6c('0x6')]=function(_0x3a149d,_0x3b3250){return _0x3a149d[_0x1b6c('0x7')](_0x1b6c('0x8'),attributes,{'tableName':_0x1b6c('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 8aa4be8..050269b 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 _0x72ea=['bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','moment'];(function(_0x119d25,_0x588c8){var _0x39cf30=function(_0x31c68c){while(--_0x31c68c){_0x119d25['push'](_0x119d25['shift']());}};_0x39cf30(++_0x588c8);}(_0x72ea,0x152));var _0xa72e=function(_0x672089,_0x299223){_0x672089=_0x672089-0x0;var _0x376440=_0x72ea[_0x672089];return _0x376440;};'use strict';var _=require(_0xa72e('0x0'));var util=require('util');var moment=require(_0xa72e('0x1'));var BPromise=require(_0xa72e('0x2'));var rs=require(_0xa72e('0x3'));var fs=require('fs');var Redis=require(_0xa72e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa72e('0x5'));var logger=require('../../config/logger')(_0xa72e('0x6'));var config=require(_0xa72e('0x7'));var jayson=require(_0xa72e('0x8'));var client=jayson['client'][_0xa72e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1bdea2,_0x49e280,_0x4155e9){return new BPromise(function(_0x5002fd,_0x2b79f3){return client[_0xa72e('0xa')](_0x1bdea2,_0x4155e9)[_0xa72e('0xb')](function(_0x52fb8e){logger['info'](_0xa72e('0xc'),_0x49e280,_0xa72e('0xd'));logger[_0xa72e('0xe')](_0xa72e('0xf'),_0x49e280,_0xa72e('0xd'),JSON['stringify'](_0x52fb8e));if(_0x52fb8e[_0xa72e('0x10')]){if(_0x52fb8e[_0xa72e('0x10')][_0xa72e('0x11')]===0x1f4){logger[_0xa72e('0x10')](_0xa72e('0xc'),_0x49e280,_0x52fb8e[_0xa72e('0x10')][_0xa72e('0x12')]);return _0x2b79f3(_0x52fb8e[_0xa72e('0x10')]['message']);}logger[_0xa72e('0x10')](_0xa72e('0xc'),_0x49e280,_0x52fb8e[_0xa72e('0x10')]['message']);return _0x5002fd(_0x52fb8e[_0xa72e('0x10')][_0xa72e('0x12')]);}else{logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0x49e280,'request\x20sent');_0x5002fd(_0x52fb8e['result'][_0xa72e('0x12')]);}})[_0xa72e('0x13')](function(_0x4466fd){logger[_0xa72e('0x10')](_0xa72e('0xc'),_0x49e280,_0x4466fd);_0x2b79f3(_0x4466fd);});});} \ No newline at end of file +var _0x335a=['stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x4d9219,_0x543e50){var _0x5290e8=function(_0x8b6fd9){while(--_0x8b6fd9){_0x4d9219['push'](_0x4d9219['shift']());}};_0x5290e8(++_0x543e50);}(_0x335a,0x131));var _0xa335=function(_0x5232f5,_0xdf5710){_0x5232f5=_0x5232f5-0x0;var _0x47019f=_0x335a[_0x5232f5];return _0x47019f;};'use strict';var _=require(_0xa335('0x0'));var util=require(_0xa335('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa335('0x2'));var fs=require('fs');var Redis=require(_0xa335('0x3'));var db=require(_0xa335('0x4'))['db'];var utils=require(_0xa335('0x5'));var logger=require(_0xa335('0x6'))('rpc');var config=require(_0xa335('0x7'));var jayson=require(_0xa335('0x8'));var client=jayson[_0xa335('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x108332,_0x2343bb,_0x32f657){return new BPromise(function(_0x203573,_0x877457){return client[_0xa335('0xa')](_0x108332,_0x32f657)[_0xa335('0xb')](function(_0x54a15d){logger[_0xa335('0xc')](_0xa335('0xd'),_0x2343bb,_0xa335('0xe'));logger[_0xa335('0xf')](_0xa335('0x10'),_0x2343bb,'request\x20sent',JSON[_0xa335('0x11')](_0x54a15d));if(_0x54a15d[_0xa335('0x12')]){if(_0x54a15d[_0xa335('0x12')][_0xa335('0x13')]===0x1f4){logger[_0xa335('0x12')](_0xa335('0xd'),_0x2343bb,_0x54a15d[_0xa335('0x12')]['message']);return _0x877457(_0x54a15d[_0xa335('0x12')][_0xa335('0x14')]);}logger[_0xa335('0x12')](_0xa335('0xd'),_0x2343bb,_0x54a15d[_0xa335('0x12')][_0xa335('0x14')]);return _0x203573(_0x54a15d[_0xa335('0x12')][_0xa335('0x14')]);}else{logger[_0xa335('0xc')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x2343bb,_0xa335('0xe'));_0x203573(_0x54a15d[_0xa335('0x15')]['message']);}})[_0xa335('0x16')](function(_0x3fb345){logger[_0xa335('0x12')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x2343bb,_0x3fb345);_0x877457(_0x3fb345);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 180c0e3..59c81cf 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 _0x7868=['index','/:id','show','post','update','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated'];(function(_0x208025,_0x1089a3){var _0xee6b7f=function(_0x443a48){while(--_0x443a48){_0x208025['push'](_0x208025['shift']());}};_0xee6b7f(++_0x1089a3);}(_0x7868,0x1c0));var _0x8786=function(_0x1ab5e6,_0x134f2f){_0x1ab5e6=_0x1ab5e6-0x0;var _0x4174c8=_0x7868[_0x1ab5e6];return _0x4174c8;};'use strict';var multer=require(_0x8786('0x0'));var util=require('util');var path=require(_0x8786('0x1'));var timeout=require(_0x8786('0x2'));var express=require(_0x8786('0x3'));var router=express[_0x8786('0x4')]();var fs_extra=require(_0x8786('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8786('0x6'));var config=require(_0x8786('0x7'));var controller=require(_0x8786('0x8'));router[_0x8786('0x9')]('/',auth[_0x8786('0xa')](),controller[_0x8786('0xb')]);router[_0x8786('0x9')](_0x8786('0xc'),auth[_0x8786('0xa')](),controller[_0x8786('0xd')]);router[_0x8786('0xe')]('/',auth[_0x8786('0xa')](),controller['create']);router['put'](_0x8786('0xc'),auth[_0x8786('0xa')](),controller[_0x8786('0xf')]);router['delete']('/:id',auth[_0x8786('0xa')](),controller['destroy']);module[_0x8786('0x10')]=router; \ No newline at end of file +var _0x24cd=['post','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesField.controller','isAuthenticated','index','get','/:id','show'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x24cd,0x83));var _0xd24c=function(_0x25ea7c,_0x6fe58){_0x25ea7c=_0x25ea7c-0x0;var _0x35d796=_0x24cd[_0x25ea7c];return _0x35d796;};'use strict';var multer=require(_0xd24c('0x0'));var util=require(_0xd24c('0x1'));var path=require('path');var timeout=require(_0xd24c('0x2'));var express=require('express');var router=express[_0xd24c('0x3')]();var fs_extra=require(_0xd24c('0x4'));var auth=require(_0xd24c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd24c('0x6'));var controller=require(_0xd24c('0x7'));router['get']('/',auth[_0xd24c('0x8')](),controller[_0xd24c('0x9')]);router[_0xd24c('0xa')](_0xd24c('0xb'),auth[_0xd24c('0x8')](),controller[_0xd24c('0xc')]);router[_0xd24c('0xd')]('/',auth[_0xd24c('0x8')](),controller['create']);router['put'](_0xd24c('0xb'),auth[_0xd24c('0x8')](),controller[_0xd24c('0xe')]);router[_0xd24c('0xf')](_0xd24c('0xb'),auth[_0xd24c('0x8')](),controller[_0xd24c('0x10')]);module[_0xd24c('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 fbf2ea8..dc1d28a 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 _0x3554=['keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x5bcdba,_0x59e01e){var _0x51eb35=function(_0x4766a2){while(--_0x4766a2){_0x5bcdba['push'](_0x5bcdba['shift']());}};_0x51eb35(++_0x59e01e);}(_0x3554,0x90));var _0x4355=function(_0x470730,_0x2f505f){_0x470730=_0x470730-0x0;var _0x410936=_0x3554[_0x470730];return _0x410936;};'use strict';var Sequelize=require(_0x4355('0x0'));module[_0x4355('0x1')]={'type':{'type':Sequelize[_0x4355('0x2')](_0x4355('0x3'),_0x4355('0x4'),_0x4355('0x5'),_0x4355('0x6'),_0x4355('0x7')),'defaultValue':_0x4355('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x4355('0x3'),'variable',_0x4355('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x4355('0x8')]},'nameField':{'type':Sequelize[_0x4355('0x8')]},'customField':{'type':Sequelize[_0x4355('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4355('0x8')]}}; \ No newline at end of file +var _0x5a61=['picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0xd41e59,_0x2c7bbf){var _0x431192=function(_0x2bb781){while(--_0x2bb781){_0xd41e59['push'](_0xd41e59['shift']());}};_0x431192(++_0x2c7bbf);}(_0x5a61,0xdb));var _0x15a6=function(_0x2cf482,_0x405da8){_0x2cf482=_0x2cf482-0x0;var _0xf1f8c0=_0x5a61[_0x2cf482];return _0xf1f8c0;};'use strict';var Sequelize=require(_0x15a6('0x0'));module[_0x15a6('0x1')]={'type':{'type':Sequelize[_0x15a6('0x2')](_0x15a6('0x3'),_0x15a6('0x4'),_0x15a6('0x5'),'keyValue',_0x15a6('0x6')),'defaultValue':_0x15a6('0x3')},'content':{'type':Sequelize[_0x15a6('0x7')]},'key':{'type':Sequelize[_0x15a6('0x7')]},'keyType':{'type':Sequelize['ENUM']('string','variable',_0x15a6('0x5'))},'keyContent':{'type':Sequelize[_0x15a6('0x7')]},'idField':{'type':Sequelize[_0x15a6('0x7')]},'nameField':{'type':Sequelize[_0x15a6('0x7')]},'customField':{'type':Sequelize[_0x15a6('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x15a6('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 8f1418c..58b954f 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 _0x8ff7=['filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FreshsalesField','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x335804,_0x29db29){var _0x503de3=function(_0xcbd748){while(--_0xcbd748){_0x335804['push'](_0x335804['shift']());}};_0x503de3(++_0x29db29);}(_0x8ff7,0x1bd));var _0x78ff=function(_0x4239f1,_0x322951){_0x4239f1=_0x4239f1-0x0;var _0xf1ca26=_0x8ff7[_0x4239f1];return _0xf1ca26;};'use strict';var emlformat=require(_0x78ff('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x78ff('0x1'));var rp=require(_0x78ff('0x2'));var moment=require(_0x78ff('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x78ff('0x4'));var util=require(_0x78ff('0x5'));var path=require(_0x78ff('0x6'));var sox=require('sox');var csv=require(_0x78ff('0x7'));var ejs=require(_0x78ff('0x8'));var fs=require('fs');var fs_extra=require(_0x78ff('0x9'));var _=require('lodash');var squel=require(_0x78ff('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x78ff('0xb'));var toCsv=require(_0x78ff('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x78ff('0xc'));var qs=require(_0x78ff('0xd'));var as=require(_0x78ff('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x78ff('0xf'))(_0x78ff('0x10'));var utils=require(_0x78ff('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x78ff('0x12'))['db'];function respondWithStatusCode(_0x4de068,_0x51ae66){_0x51ae66=_0x51ae66||0xcc;return function(_0x50ddd4){if(_0x50ddd4){return _0x4de068[_0x78ff('0x13')](_0x51ae66);}return _0x4de068[_0x78ff('0x14')](_0x51ae66)[_0x78ff('0x15')]();};}function respondWithResult(_0x1091f9,_0x56c137){_0x56c137=_0x56c137||0xc8;return function(_0xe835e5){if(_0xe835e5){return _0x1091f9[_0x78ff('0x14')](_0x56c137)[_0x78ff('0x16')](_0xe835e5);}};}function respondWithFilteredResult(_0x3dc182,_0x3af759){return function(_0x5467eb){if(_0x5467eb){var _0x2da438=typeof _0x3af759[_0x78ff('0x17')]===_0x78ff('0x18')&&typeof _0x3af759[_0x78ff('0x19')]===_0x78ff('0x18');var _0x384540=_0x5467eb[_0x78ff('0x1a')];var _0xefd358=_0x2da438?0x0:_0x3af759['offset'];var _0x3ab176=_0x2da438?_0x5467eb[_0x78ff('0x1a')]:_0x3af759['offset']+_0x3af759[_0x78ff('0x19')];var _0x1cf0de;if(_0x3ab176>=_0x384540){_0x3ab176=_0x384540;_0x1cf0de=0xc8;}else{_0x1cf0de=0xce;}_0x3dc182[_0x78ff('0x14')](_0x1cf0de);return _0x3dc182[_0x78ff('0x1b')](_0x78ff('0x1c'),_0xefd358+'-'+_0x3ab176+'/'+_0x384540)[_0x78ff('0x16')](_0x5467eb);}return null;};}function patchUpdates(_0x1c8bb1){return function(_0x342a66){try{jsonpatch[_0x78ff('0x1d')](_0x342a66,_0x1c8bb1,!![]);}catch(_0x175f06){return BPromise[_0x78ff('0x1e')](_0x175f06);}return _0x342a66[_0x78ff('0x1f')]();};}function saveUpdates(_0x3ab428,_0x25c99a){return function(_0x1c8ca4){if(_0x1c8ca4){return _0x1c8ca4[_0x78ff('0x20')](_0x3ab428)[_0x78ff('0x21')](function(_0x1beb02){return _0x1beb02;});}return null;};}function removeEntity(_0x56cb3f,_0x109372){return function(_0x1d304d){if(_0x1d304d){return _0x1d304d[_0x78ff('0x22')]()['then'](function(){_0x56cb3f[_0x78ff('0x14')](0xcc)[_0x78ff('0x15')]();});}};}function handleEntityNotFound(_0x4a4eeb,_0x27dd3e){return function(_0xbd6cff){if(!_0xbd6cff){_0x4a4eeb[_0x78ff('0x13')](0x194);}return _0xbd6cff;};}function handleError(_0x33d644,_0x70166d){_0x70166d=_0x70166d||0x1f4;return function(_0x56c40c){logger[_0x78ff('0x23')](_0x56c40c[_0x78ff('0x24')]);if(_0x56c40c[_0x78ff('0x25')]){delete _0x56c40c['name'];}_0x33d644[_0x78ff('0x14')](_0x70166d)[_0x78ff('0x26')](_0x56c40c);};}exports[_0x78ff('0x27')]=function(_0x37e523,_0x5a3796){var _0x3eeabe={},_0x38632={},_0x1f95aa={'count':0x0,'rows':[]};var _0x12e0ff=_[_0x78ff('0x28')](db[_0x78ff('0x29')][_0x78ff('0x2a')],function(_0x5e1f29){return{'name':_0x5e1f29[_0x78ff('0x2b')],'type':_0x5e1f29[_0x78ff('0x2c')]['key']};});_0x38632[_0x78ff('0x2d')]=_['map'](_0x12e0ff,_0x78ff('0x25'));_0x38632[_0x78ff('0x2e')]=_[_0x78ff('0x2f')](_0x37e523[_0x78ff('0x2e')]);_0x38632[_0x78ff('0x30')]=_['intersection'](_0x38632[_0x78ff('0x2d')],_0x38632[_0x78ff('0x2e')]);_0x3eeabe[_0x78ff('0x31')]=_[_0x78ff('0x32')](_0x38632[_0x78ff('0x2d')],qs[_0x78ff('0x33')](_0x37e523['query'][_0x78ff('0x33')]));_0x3eeabe['attributes']=_0x3eeabe['attributes'][_0x78ff('0x34')]?_0x3eeabe['attributes']:_0x38632[_0x78ff('0x2d')];if(!_0x37e523[_0x78ff('0x2e')][_0x78ff('0x35')](_0x78ff('0x36'))){_0x3eeabe['limit']=qs[_0x78ff('0x19')](_0x37e523[_0x78ff('0x2e')][_0x78ff('0x19')]);_0x3eeabe['offset']=qs[_0x78ff('0x17')](_0x37e523[_0x78ff('0x2e')][_0x78ff('0x17')]);}_0x3eeabe[_0x78ff('0x37')]=qs[_0x78ff('0x38')](_0x37e523[_0x78ff('0x2e')][_0x78ff('0x38')]);_0x3eeabe[_0x78ff('0x39')]=qs[_0x78ff('0x30')](_[_0x78ff('0x3a')](_0x37e523[_0x78ff('0x2e')],_0x38632['filters']),_0x12e0ff);if(_0x37e523[_0x78ff('0x2e')][_0x78ff('0x3b')]){_0x3eeabe[_0x78ff('0x39')]=_['merge'](_0x3eeabe[_0x78ff('0x39')],{'$or':_['map'](_0x12e0ff,function(_0x1a7289){if(_0x1a7289[_0x78ff('0x2c')]!=='VIRTUAL'){var _0x22dfe4={};_0x22dfe4[_0x1a7289[_0x78ff('0x25')]]={'$like':'%'+_0x37e523[_0x78ff('0x2e')]['filter']+'%'};return _0x22dfe4;}})});}_0x3eeabe=_[_0x78ff('0x3c')]({},_0x3eeabe,_0x37e523[_0x78ff('0x3d')]);var _0x865af5={'where':_0x3eeabe['where']};return db[_0x78ff('0x29')][_0x78ff('0x1a')](_0x865af5)[_0x78ff('0x21')](function(_0x28ae4d){_0x1f95aa[_0x78ff('0x1a')]=_0x28ae4d;if(_0x37e523[_0x78ff('0x2e')][_0x78ff('0x3e')]){_0x3eeabe[_0x78ff('0x3f')]=[{'all':!![]}];}return db['FreshsalesField'][_0x78ff('0x40')](_0x3eeabe);})[_0x78ff('0x21')](function(_0x393941){_0x1f95aa[_0x78ff('0x41')]=_0x393941;return _0x1f95aa;})[_0x78ff('0x21')](respondWithFilteredResult(_0x5a3796,_0x3eeabe))[_0x78ff('0x42')](handleError(_0x5a3796,null));};exports[_0x78ff('0x43')]=function(_0x244a30,_0x3163d9){var _0x48c75c={'raw':!![],'where':{'id':_0x244a30[_0x78ff('0x44')]['id']}},_0xbbaba3={};_0xbbaba3[_0x78ff('0x2d')]=_[_0x78ff('0x2f')](db[_0x78ff('0x29')]['rawAttributes']);_0xbbaba3[_0x78ff('0x2e')]=_[_0x78ff('0x2f')](_0x244a30['query']);_0xbbaba3['filters']=_[_0x78ff('0x32')](_0xbbaba3[_0x78ff('0x2d')],_0xbbaba3[_0x78ff('0x2e')]);_0x48c75c[_0x78ff('0x31')]=_[_0x78ff('0x32')](_0xbbaba3[_0x78ff('0x2d')],qs[_0x78ff('0x33')](_0x244a30[_0x78ff('0x2e')]['fields']));_0x48c75c['attributes']=_0x48c75c[_0x78ff('0x31')][_0x78ff('0x34')]?_0x48c75c[_0x78ff('0x31')]:_0xbbaba3[_0x78ff('0x2d')];if(_0x244a30[_0x78ff('0x2e')][_0x78ff('0x3e')]){_0x48c75c[_0x78ff('0x3f')]=[{'all':!![]}];}_0x48c75c=_[_0x78ff('0x3c')]({},_0x48c75c,_0x244a30[_0x78ff('0x3d')]);return db[_0x78ff('0x29')][_0x78ff('0x45')](_0x48c75c)[_0x78ff('0x21')](handleEntityNotFound(_0x3163d9,null))[_0x78ff('0x21')](respondWithResult(_0x3163d9,null))[_0x78ff('0x42')](handleError(_0x3163d9,null));};exports['create']=function(_0x316f45,_0x5ca33c){return db[_0x78ff('0x29')][_0x78ff('0x46')](_0x316f45[_0x78ff('0x47')],{})[_0x78ff('0x21')](respondWithResult(_0x5ca33c,0xc9))[_0x78ff('0x42')](handleError(_0x5ca33c,null));};exports['update']=function(_0x2bf590,_0x5a4b84){if(_0x2bf590[_0x78ff('0x47')]['id']){delete _0x2bf590[_0x78ff('0x47')]['id'];}return db[_0x78ff('0x29')]['find']({'where':{'id':_0x2bf590[_0x78ff('0x44')]['id']}})['then'](handleEntityNotFound(_0x5a4b84,null))[_0x78ff('0x21')](saveUpdates(_0x2bf590['body'],null))[_0x78ff('0x21')](respondWithResult(_0x5a4b84,null))['catch'](handleError(_0x5a4b84,null));};exports[_0x78ff('0x22')]=function(_0x5c43b1,_0x17888c){return db[_0x78ff('0x29')][_0x78ff('0x45')]({'where':{'id':_0x5c43b1[_0x78ff('0x44')]['id']}})['then'](handleEntityNotFound(_0x17888c,null))[_0x78ff('0x21')](removeEntity(_0x17888c,null))['catch'](handleError(_0x17888c,null));}; \ No newline at end of file +var _0x7941=['update','then','error','name','send','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','FreshsalesField','includeAll','rows','catch','show','params','include','find','create','body','destroy','rimraf','zip-dir','request-promise','mustache','util','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0x7941,0xf4));var _0x1794=function(_0x374ffb,_0x3d9c8f){_0x374ffb=_0x374ffb-0x0;var _0x56e4f5=_0x7941[_0x374ffb];return _0x56e4f5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1794('0x0'));var zipdir=require(_0x1794('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1794('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1794('0x3'));var util=require(_0x1794('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x1794('0x5'));var ejs=require(_0x1794('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1794('0x7'));var squel=require('squel');var crypto=require(_0x1794('0x8'));var jsforce=require(_0x1794('0x9'));var deskjs=require(_0x1794('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1794('0xb'));var Redis=require(_0x1794('0xc'));var authService=require(_0x1794('0xd'));var qs=require(_0x1794('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1794('0xf'));var logger=require(_0x1794('0x10'))('api');var utils=require(_0x1794('0x11'));var config=require(_0x1794('0x12'));var licenseUtil=require(_0x1794('0x13'));var db=require(_0x1794('0x14'))['db'];function respondWithStatusCode(_0x3ce522,_0x5e9910){_0x5e9910=_0x5e9910||0xcc;return function(_0x4aec5e){if(_0x4aec5e){return _0x3ce522[_0x1794('0x15')](_0x5e9910);}return _0x3ce522[_0x1794('0x16')](_0x5e9910)[_0x1794('0x17')]();};}function respondWithResult(_0x4caf29,_0x3da935){_0x3da935=_0x3da935||0xc8;return function(_0x14e71a){if(_0x14e71a){return _0x4caf29[_0x1794('0x16')](_0x3da935)[_0x1794('0x18')](_0x14e71a);}};}function respondWithFilteredResult(_0x5ce214,_0x151ea6){return function(_0x682dfa){if(_0x682dfa){var _0x353fd6=typeof _0x151ea6[_0x1794('0x19')]==='undefined'&&typeof _0x151ea6[_0x1794('0x1a')]===_0x1794('0x1b');var _0x2af055=_0x682dfa[_0x1794('0x1c')];var _0x49c0f9=_0x353fd6?0x0:_0x151ea6[_0x1794('0x19')];var _0x154b87=_0x353fd6?_0x682dfa[_0x1794('0x1c')]:_0x151ea6['offset']+_0x151ea6['limit'];var _0x3e53cf;if(_0x154b87>=_0x2af055){_0x154b87=_0x2af055;_0x3e53cf=0xc8;}else{_0x3e53cf=0xce;}_0x5ce214['status'](_0x3e53cf);return _0x5ce214[_0x1794('0x1d')]('Content-Range',_0x49c0f9+'-'+_0x154b87+'/'+_0x2af055)[_0x1794('0x18')](_0x682dfa);}return null;};}function patchUpdates(_0x367204){return function(_0x4ccbec){try{jsonpatch[_0x1794('0x1e')](_0x4ccbec,_0x367204,!![]);}catch(_0x528bf4){return BPromise[_0x1794('0x1f')](_0x528bf4);}return _0x4ccbec['save']();};}function saveUpdates(_0xdc9ae5,_0x1776f7){return function(_0x39dac2){if(_0x39dac2){return _0x39dac2[_0x1794('0x20')](_0xdc9ae5)[_0x1794('0x21')](function(_0x357977){return _0x357977;});}return null;};}function removeEntity(_0x8795,_0x282b28){return function(_0x5b1e2c){if(_0x5b1e2c){return _0x5b1e2c['destroy']()[_0x1794('0x21')](function(){_0x8795['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2337f6,_0x332b54){return function(_0x33f565){if(!_0x33f565){_0x2337f6[_0x1794('0x15')](0x194);}return _0x33f565;};}function handleError(_0x4c7bb4,_0x5dd62f){_0x5dd62f=_0x5dd62f||0x1f4;return function(_0x4dcbae){logger[_0x1794('0x22')](_0x4dcbae['stack']);if(_0x4dcbae[_0x1794('0x23')]){delete _0x4dcbae[_0x1794('0x23')];}_0x4c7bb4['status'](_0x5dd62f)[_0x1794('0x24')](_0x4dcbae);};}exports['index']=function(_0xcfa3a8,_0x15f592){var _0x39bae8={},_0x3134d7={},_0x4762fd={'count':0x0,'rows':[]};var _0x2ca1a0=_['map'](db['FreshsalesField'][_0x1794('0x25')],function(_0x191293){return{'name':_0x191293[_0x1794('0x26')],'type':_0x191293[_0x1794('0x27')][_0x1794('0x28')]};});_0x3134d7[_0x1794('0x29')]=_[_0x1794('0x2a')](_0x2ca1a0,'name');_0x3134d7[_0x1794('0x2b')]=_[_0x1794('0x2c')](_0xcfa3a8[_0x1794('0x2b')]);_0x3134d7[_0x1794('0x2d')]=_[_0x1794('0x2e')](_0x3134d7[_0x1794('0x29')],_0x3134d7['query']);_0x39bae8[_0x1794('0x2f')]=_['intersection'](_0x3134d7[_0x1794('0x29')],qs[_0x1794('0x30')](_0xcfa3a8['query'][_0x1794('0x30')]));_0x39bae8[_0x1794('0x2f')]=_0x39bae8['attributes'][_0x1794('0x31')]?_0x39bae8[_0x1794('0x2f')]:_0x3134d7[_0x1794('0x29')];if(!_0xcfa3a8[_0x1794('0x2b')]['hasOwnProperty']('nolimit')){_0x39bae8[_0x1794('0x1a')]=qs[_0x1794('0x1a')](_0xcfa3a8['query'][_0x1794('0x1a')]);_0x39bae8['offset']=qs[_0x1794('0x19')](_0xcfa3a8[_0x1794('0x2b')]['offset']);}_0x39bae8[_0x1794('0x32')]=qs[_0x1794('0x33')](_0xcfa3a8['query'][_0x1794('0x33')]);_0x39bae8[_0x1794('0x34')]=qs['filters'](_[_0x1794('0x35')](_0xcfa3a8[_0x1794('0x2b')],_0x3134d7[_0x1794('0x2d')]),_0x2ca1a0);if(_0xcfa3a8[_0x1794('0x2b')][_0x1794('0x36')]){_0x39bae8[_0x1794('0x34')]=_[_0x1794('0x37')](_0x39bae8[_0x1794('0x34')],{'$or':_[_0x1794('0x2a')](_0x2ca1a0,function(_0xba3952){if(_0xba3952['type']!==_0x1794('0x38')){var _0x448e08={};_0x448e08[_0xba3952[_0x1794('0x23')]]={'$like':'%'+_0xcfa3a8[_0x1794('0x2b')][_0x1794('0x36')]+'%'};return _0x448e08;}})});}_0x39bae8=_[_0x1794('0x37')]({},_0x39bae8,_0xcfa3a8[_0x1794('0x39')]);var _0x196de2={'where':_0x39bae8[_0x1794('0x34')]};return db[_0x1794('0x3a')][_0x1794('0x1c')](_0x196de2)[_0x1794('0x21')](function(_0x21cbac){_0x4762fd['count']=_0x21cbac;if(_0xcfa3a8[_0x1794('0x2b')][_0x1794('0x3b')]){_0x39bae8['include']=[{'all':!![]}];}return db[_0x1794('0x3a')]['findAll'](_0x39bae8);})[_0x1794('0x21')](function(_0x4c81a5){_0x4762fd[_0x1794('0x3c')]=_0x4c81a5;return _0x4762fd;})[_0x1794('0x21')](respondWithFilteredResult(_0x15f592,_0x39bae8))[_0x1794('0x3d')](handleError(_0x15f592,null));};exports[_0x1794('0x3e')]=function(_0x59a7a6,_0x56a2ef){var _0x56ca8c={'raw':!![],'where':{'id':_0x59a7a6[_0x1794('0x3f')]['id']}},_0x30493c={};_0x30493c[_0x1794('0x29')]=_[_0x1794('0x2c')](db[_0x1794('0x3a')][_0x1794('0x25')]);_0x30493c[_0x1794('0x2b')]=_[_0x1794('0x2c')](_0x59a7a6['query']);_0x30493c['filters']=_['intersection'](_0x30493c[_0x1794('0x29')],_0x30493c[_0x1794('0x2b')]);_0x56ca8c[_0x1794('0x2f')]=_['intersection'](_0x30493c['model'],qs[_0x1794('0x30')](_0x59a7a6[_0x1794('0x2b')][_0x1794('0x30')]));_0x56ca8c[_0x1794('0x2f')]=_0x56ca8c[_0x1794('0x2f')][_0x1794('0x31')]?_0x56ca8c[_0x1794('0x2f')]:_0x30493c[_0x1794('0x29')];if(_0x59a7a6[_0x1794('0x2b')][_0x1794('0x3b')]){_0x56ca8c[_0x1794('0x40')]=[{'all':!![]}];}_0x56ca8c=_[_0x1794('0x37')]({},_0x56ca8c,_0x59a7a6[_0x1794('0x39')]);return db[_0x1794('0x3a')][_0x1794('0x41')](_0x56ca8c)[_0x1794('0x21')](handleEntityNotFound(_0x56a2ef,null))[_0x1794('0x21')](respondWithResult(_0x56a2ef,null))[_0x1794('0x3d')](handleError(_0x56a2ef,null));};exports[_0x1794('0x42')]=function(_0x564740,_0x47d915){return db[_0x1794('0x3a')][_0x1794('0x42')](_0x564740['body'],{})[_0x1794('0x21')](respondWithResult(_0x47d915,0xc9))['catch'](handleError(_0x47d915,null));};exports[_0x1794('0x20')]=function(_0x41a076,_0x3d7cf4){if(_0x41a076[_0x1794('0x43')]['id']){delete _0x41a076['body']['id'];}return db[_0x1794('0x3a')]['find']({'where':{'id':_0x41a076[_0x1794('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3d7cf4,null))[_0x1794('0x21')](saveUpdates(_0x41a076[_0x1794('0x43')],null))[_0x1794('0x21')](respondWithResult(_0x3d7cf4,null))[_0x1794('0x3d')](handleError(_0x3d7cf4,null));};exports[_0x1794('0x44')]=function(_0x5a29df,_0x5121e3){return db[_0x1794('0x3a')][_0x1794('0x41')]({'where':{'id':_0x5a29df[_0x1794('0x3f')]['id']}})[_0x1794('0x21')](handleEntityNotFound(_0x5121e3,null))[_0x1794('0x21')](removeEntity(_0x5121e3,null))[_0x1794('0x3d')](handleError(_0x5121e3,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 752091f..ea7dbcb 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 _0xf55c=['moment','bluebird','request-promise','path','rimraf','./intFreshsalesField.attributes','exports','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','lodash','../../config/logger','api'];(function(_0x5e8282,_0x1f2962){var _0x5cd37d=function(_0x208ec7){while(--_0x208ec7){_0x5e8282['push'](_0x5e8282['shift']());}};_0x5cd37d(++_0x1f2962);}(_0xf55c,0x1e7));var _0xcf55=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xf55c[_0x102e37];return _0x35a07c;};'use strict';var _=require(_0xcf55('0x0'));var util=require('util');var logger=require(_0xcf55('0x1'))(_0xcf55('0x2'));var moment=require(_0xcf55('0x3'));var BPromise=require(_0xcf55('0x4'));var rp=require(_0xcf55('0x5'));var fs=require('fs');var path=require(_0xcf55('0x6'));var rimraf=require(_0xcf55('0x7'));var config=require('../../config/environment');var attributes=require(_0xcf55('0x8'));module[_0xcf55('0x9')]=function(_0x14574c,_0x3a6de7){return _0x14574c['define'](_0xcf55('0xa'),attributes,{'tableName':_0xcf55('0xb'),'paranoid':![],'indexes':[{'name':_0xcf55('0xc'),'fields':[_0xcf55('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x88c3=['idField','FieldId','lodash','../../config/logger','bluebird','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','FreshsalesField','int_freshsales_fields','freshsales_unique_index'];(function(_0x33be60,_0x1027f5){var _0x5b1a9d=function(_0x366f99){while(--_0x366f99){_0x33be60['push'](_0x33be60['shift']());}};_0x5b1a9d(++_0x1027f5);}(_0x88c3,0x1ee));var _0x388c=function(_0x5ba479,_0x5c16ee){_0x5ba479=_0x5ba479-0x0;var _0x201af0=_0x88c3[_0x5ba479];return _0x201af0;};'use strict';var _=require(_0x388c('0x0'));var util=require('util');var logger=require(_0x388c('0x1'))('api');var moment=require('moment');var BPromise=require(_0x388c('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x388c('0x3'));var config=require(_0x388c('0x4'));var attributes=require(_0x388c('0x5'));module[_0x388c('0x6')]=function(_0x28ed4d,_0x23199c){return _0x28ed4d['define'](_0x388c('0x7'),attributes,{'tableName':_0x388c('0x8'),'paranoid':![],'indexes':[{'name':_0x388c('0x9'),'fields':[_0x388c('0xa'),_0x388c('0xb')],'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 b8871a9..4728619 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 _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','FreshsalesField,\x20%s,\x20%s','FreshsalesField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x1a5361,_0x1cef2d){var _0x220abe=function(_0x256acf){while(--_0x256acf){_0x1a5361['push'](_0x1a5361['shift']());}};_0x220abe(++_0x1cef2d);}(_0x2ef3,0xba));var _0x32ef=function(_0x5e1c0b,_0x1aa2a5){_0x5e1c0b=_0x5e1c0b-0x0;var _0x290eb5=_0x2ef3[_0x5e1c0b];return _0x290eb5;};'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')]('FreshsalesField,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('FreshsalesField,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file +var _0x6d38=['request','then','FreshsalesField,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x2847ee,_0x537d52){var _0x41b3f3=function(_0x56c61b){while(--_0x56c61b){_0x2847ee['push'](_0x2847ee['shift']());}};_0x41b3f3(++_0x537d52);}(_0x6d38,0x1ef));var _0x86d3=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x6d38[_0x126558];return _0x1f6d14;};'use strict';var _=require('lodash');var util=require(_0x86d3('0x0'));var moment=require(_0x86d3('0x1'));var BPromise=require(_0x86d3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x86d3('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x86d3('0x4'))(_0x86d3('0x5'));var config=require(_0x86d3('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x86d3('0x7')][_0x86d3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x33d4aa,_0x2eaa15,_0x47e654){return new BPromise(function(_0x552b07,_0x2aea31){return client[_0x86d3('0x9')](_0x33d4aa,_0x47e654)[_0x86d3('0xa')](function(_0x499640){logger['info'](_0x86d3('0xb'),_0x2eaa15,_0x86d3('0xc'));logger['debug']('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x2eaa15,_0x86d3('0xc'),JSON[_0x86d3('0xd')](_0x499640));if(_0x499640['error']){if(_0x499640[_0x86d3('0xe')]['code']===0x1f4){logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);return _0x2aea31(_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);}logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x499640['error'][_0x86d3('0xf')]);return _0x552b07(_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);}else{logger[_0x86d3('0x10')](_0x86d3('0xb'),_0x2eaa15,_0x86d3('0xc'));_0x552b07(_0x499640[_0x86d3('0x11')][_0x86d3('0xf')]);}})['catch'](function(_0x2d5ba9){logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x2d5ba9);_0x2aea31(_0x2d5ba9);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index a0a38ae..dbbdf00 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 _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(_0x4d4356,_0x27f883){var _0x232113=function(_0x402205){while(--_0x402205){_0x4d4356['push'](_0x4d4356['shift']());}};_0x232113(++_0x27f883);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'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','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x4a71aa,_0x1fb776){var _0x246d24=function(_0x33ae45){while(--_0x33ae45){_0x4a71aa['push'](_0x4a71aa['shift']());}};_0x246d24(++_0x1fb776);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'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/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 7cb6b56..629d988 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 _0x6888=['sequelize','STRING','username','ENUM','integrationTab','newTab'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x6888,0xd2));var _0x8688=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x6888[_0x5f1391];return _0x50ebe3;};'use strict';var Sequelize=require(_0x8688('0x0'));module['exports']={'name':{'type':Sequelize[_0x8688('0x1')]},'description':{'type':Sequelize[_0x8688('0x1')]},'username':{'type':Sequelize[_0x8688('0x1')],'unique':_0x8688('0x2')},'remoteUri':{'type':Sequelize[_0x8688('0x1')]},'password':{'type':Sequelize[_0x8688('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0x8688('0x1')]},'serverUrl':{'type':Sequelize[_0x8688('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x8688('0x3')](_0x8688('0x4'),_0x8688('0x5')),'defaultValue':_0x8688('0x4')}}; \ No newline at end of file +var _0x9399=['exports','STRING','username','ENUM','integrationTab','sequelize'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x9399,0x131));var _0x9939=function(_0x3bf4f0,_0x316456){_0x3bf4f0=_0x3bf4f0-0x0;var _0x2c6a5c=_0x9399[_0x3bf4f0];return _0x2c6a5c;};'use strict';var Sequelize=require(_0x9939('0x0'));module[_0x9939('0x1')]={'name':{'type':Sequelize[_0x9939('0x2')]},'description':{'type':Sequelize[_0x9939('0x2')]},'username':{'type':Sequelize[_0x9939('0x2')],'unique':_0x9939('0x3')},'remoteUri':{'type':Sequelize[_0x9939('0x2')]},'password':{'type':Sequelize[_0x9939('0x2')]},'clientId':{'type':Sequelize[_0x9939('0x2')]},'clientSecret':{'type':Sequelize[_0x9939('0x2')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x9939('0x4')](_0x9939('0x5'),'newTab'),'defaultValue':_0x9939('0x5')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 96151ff..eed922b 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 _0x3ba0=['options','SalesforceAccount','include','findAll','rows','catch','includeAll','create','body','find','params','getConfigurations','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','getSubjects','Descriptions','SalesforceConfiguration','getFields','Task','remoteUri','clientId','clientSecret','username','securityToken','slice','Connection','login','password','concat','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','int','picklist','email','textarea','phone','remove','includes','label','custom','picklistValues','value','boolean','True','true','False','false','test','statusCode','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge'];(function(_0x27b0fe,_0x1d2394){var _0x393919=function(_0x2eea9a){while(--_0x2eea9a){_0x27b0fe['push'](_0x27b0fe['shift']());}};_0x393919(++_0x1d2394);}(_0x3ba0,0xbc));var _0x03ba=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x3ba0[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0x03ba('0x0'));var rimraf=require(_0x03ba('0x1'));var zipdir=require(_0x03ba('0x2'));var jsonpatch=require(_0x03ba('0x3'));var rp=require('request-promise');var moment=require(_0x03ba('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x03ba('0x5'));var util=require('util');var path=require(_0x03ba('0x6'));var sox=require(_0x03ba('0x7'));var csv=require(_0x03ba('0x8'));var ejs=require(_0x03ba('0x9'));var fs=require('fs');var fs_extra=require(_0x03ba('0xa'));var _=require(_0x03ba('0xb'));var squel=require(_0x03ba('0xc'));var crypto=require('crypto');var jsforce=require(_0x03ba('0xd'));var deskjs=require(_0x03ba('0xe'));var toCsv=require(_0x03ba('0x8'));var querystring=require(_0x03ba('0xf'));var Papa=require(_0x03ba('0x10'));var Redis=require(_0x03ba('0x11'));var authService=require(_0x03ba('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x03ba('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x03ba('0x14'));var utils=require('../../config/utils');var config=require(_0x03ba('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x03ba('0x16'))['db'];var integrations=require(_0x03ba('0x17'));function respondWithStatusCode(_0xedb9ca,_0x14d539){_0x14d539=_0x14d539||0xcc;return function(_0x38f394){if(_0x38f394){return _0xedb9ca['sendStatus'](_0x14d539);}return _0xedb9ca[_0x03ba('0x18')](_0x14d539)[_0x03ba('0x19')]();};}function respondWithResult(_0x301a5c,_0x207300){_0x207300=_0x207300||0xc8;return function(_0x522097){if(_0x522097){return _0x301a5c[_0x03ba('0x18')](_0x207300)[_0x03ba('0x1a')](_0x522097);}};}function respondWithFilteredResult(_0x56765f,_0x5e2069){return function(_0x2de75d){if(_0x2de75d){var _0x49c38e=typeof _0x5e2069[_0x03ba('0x1b')]===_0x03ba('0x1c')&&typeof _0x5e2069[_0x03ba('0x1d')]==='undefined';var _0x36d6=_0x2de75d[_0x03ba('0x1e')];var _0x514095=_0x49c38e?0x0:_0x5e2069[_0x03ba('0x1b')];var _0x5be112=_0x49c38e?_0x2de75d[_0x03ba('0x1e')]:_0x5e2069[_0x03ba('0x1b')]+_0x5e2069[_0x03ba('0x1d')];var _0x3d1181;if(_0x5be112>=_0x36d6){_0x5be112=_0x36d6;_0x3d1181=0xc8;}else{_0x3d1181=0xce;}_0x56765f[_0x03ba('0x18')](_0x3d1181);return _0x56765f[_0x03ba('0x1f')](_0x03ba('0x20'),_0x514095+'-'+_0x5be112+'/'+_0x36d6)[_0x03ba('0x1a')](_0x2de75d);}return null;};}function patchUpdates(_0x464c2f){return function(_0x4f4b8a){try{jsonpatch[_0x03ba('0x21')](_0x4f4b8a,_0x464c2f,!![]);}catch(_0x5e7ec1){return BPromise[_0x03ba('0x22')](_0x5e7ec1);}return _0x4f4b8a[_0x03ba('0x23')]();};}function saveUpdates(_0x4f317e,_0x5dcd72){return function(_0x10375b){if(_0x10375b){return _0x10375b[_0x03ba('0x24')](_0x4f317e)[_0x03ba('0x25')](function(_0x218645){return _0x218645;});}return null;};}function removeEntity(_0x15224e,_0x3388be){return function(_0x44183d){if(_0x44183d){return _0x44183d[_0x03ba('0x26')]()[_0x03ba('0x25')](function(){_0x15224e[_0x03ba('0x18')](0xcc)[_0x03ba('0x19')]();});}};}function handleEntityNotFound(_0x4d94bb,_0x6bfc13){return function(_0x4bb6cc){if(!_0x4bb6cc){_0x4d94bb[_0x03ba('0x27')](0x194);}return _0x4bb6cc;};}function handleError(_0x46b326,_0x3c210b){_0x3c210b=_0x3c210b||0x1f4;return function(_0x2c631b){logger[_0x03ba('0x28')](_0x2c631b[_0x03ba('0x29')]);if(_0x2c631b[_0x03ba('0x2a')]){delete _0x2c631b['name'];}_0x46b326[_0x03ba('0x18')](_0x3c210b)[_0x03ba('0x2b')](_0x2c631b);};}exports[_0x03ba('0x2c')]=function(_0x52059d,_0x437fb2){var _0x524ff4={},_0x5571fc={},_0x5bdec0={'count':0x0,'rows':[]};var _0x49bb20=_[_0x03ba('0x2d')](db['SalesforceAccount'][_0x03ba('0x2e')],function(_0x483b76){return{'name':_0x483b76[_0x03ba('0x2f')],'type':_0x483b76[_0x03ba('0x30')]['key']};});_0x5571fc[_0x03ba('0x31')]=_[_0x03ba('0x2d')](_0x49bb20,'name');_0x5571fc[_0x03ba('0x32')]=_[_0x03ba('0x33')](_0x52059d[_0x03ba('0x32')]);_0x5571fc[_0x03ba('0x34')]=_[_0x03ba('0x35')](_0x5571fc[_0x03ba('0x31')],_0x5571fc[_0x03ba('0x32')]);_0x524ff4['attributes']=_[_0x03ba('0x35')](_0x5571fc['model'],qs[_0x03ba('0x36')](_0x52059d[_0x03ba('0x32')]['fields']));_0x524ff4[_0x03ba('0x37')]=_0x524ff4['attributes'][_0x03ba('0x38')]?_0x524ff4[_0x03ba('0x37')]:_0x5571fc[_0x03ba('0x31')];if(!_0x52059d[_0x03ba('0x32')]['hasOwnProperty'](_0x03ba('0x39'))){_0x524ff4[_0x03ba('0x1d')]=qs[_0x03ba('0x1d')](_0x52059d[_0x03ba('0x32')][_0x03ba('0x1d')]);_0x524ff4[_0x03ba('0x1b')]=qs['offset'](_0x52059d[_0x03ba('0x32')][_0x03ba('0x1b')]);}_0x524ff4[_0x03ba('0x3a')]=qs[_0x03ba('0x3b')](_0x52059d[_0x03ba('0x32')]['sort']);_0x524ff4[_0x03ba('0x3c')]=qs['filters'](_[_0x03ba('0x3d')](_0x52059d[_0x03ba('0x32')],_0x5571fc[_0x03ba('0x34')]),_0x49bb20);if(_0x52059d[_0x03ba('0x32')][_0x03ba('0x3e')]){_0x524ff4[_0x03ba('0x3c')]=_['merge'](_0x524ff4[_0x03ba('0x3c')],{'$or':_['map'](_0x49bb20,function(_0x5ef3c8){if(_0x5ef3c8[_0x03ba('0x30')]!=='VIRTUAL'){var _0x279298={};_0x279298[_0x5ef3c8[_0x03ba('0x2a')]]={'$like':'%'+_0x52059d[_0x03ba('0x32')]['filter']+'%'};return _0x279298;}})});}_0x524ff4=_[_0x03ba('0x3f')]({},_0x524ff4,_0x52059d[_0x03ba('0x40')]);var _0x510294={'where':_0x524ff4[_0x03ba('0x3c')]};return db[_0x03ba('0x41')][_0x03ba('0x1e')](_0x510294)['then'](function(_0x133dc7){_0x5bdec0[_0x03ba('0x1e')]=_0x133dc7;if(_0x52059d[_0x03ba('0x32')]['includeAll']){_0x524ff4[_0x03ba('0x42')]=[{'all':!![]}];}return db['SalesforceAccount'][_0x03ba('0x43')](_0x524ff4);})[_0x03ba('0x25')](function(_0x3eff33){_0x5bdec0[_0x03ba('0x44')]=_0x3eff33;return _0x5bdec0;})[_0x03ba('0x25')](respondWithFilteredResult(_0x437fb2,_0x524ff4))[_0x03ba('0x45')](handleError(_0x437fb2,null));};exports['show']=function(_0x358853,_0x197dba){var _0x197f68={'raw':![],'where':{'id':_0x358853['params']['id']}},_0xa3ced3={};_0xa3ced3[_0x03ba('0x31')]=_[_0x03ba('0x33')](db[_0x03ba('0x41')][_0x03ba('0x2e')]);_0xa3ced3[_0x03ba('0x32')]=_[_0x03ba('0x33')](_0x358853[_0x03ba('0x32')]);_0xa3ced3[_0x03ba('0x34')]=_[_0x03ba('0x35')](_0xa3ced3[_0x03ba('0x31')],_0xa3ced3['query']);_0x197f68[_0x03ba('0x37')]=_[_0x03ba('0x35')](_0xa3ced3[_0x03ba('0x31')],qs[_0x03ba('0x36')](_0x358853['query'][_0x03ba('0x36')]));_0x197f68[_0x03ba('0x37')]=_0x197f68['attributes'][_0x03ba('0x38')]?_0x197f68[_0x03ba('0x37')]:_0xa3ced3['model'];if(_0x358853[_0x03ba('0x32')][_0x03ba('0x46')]){_0x197f68[_0x03ba('0x42')]=[{'all':!![]}];}_0x197f68=_[_0x03ba('0x3f')]({},_0x197f68,_0x358853[_0x03ba('0x40')]);return db[_0x03ba('0x41')]['find'](_0x197f68)[_0x03ba('0x25')](handleEntityNotFound(_0x197dba,null))[_0x03ba('0x25')](respondWithResult(_0x197dba,null))[_0x03ba('0x45')](handleError(_0x197dba,null));};exports['create']=function(_0xdea00e,_0x1736ff){return db[_0x03ba('0x41')][_0x03ba('0x47')](_0xdea00e['body'],{})[_0x03ba('0x25')](respondWithResult(_0x1736ff,0xc9))[_0x03ba('0x45')](handleError(_0x1736ff,null));};exports['update']=function(_0x1d80e8,_0x4c7b9d){if(_0x1d80e8[_0x03ba('0x48')]['id']){delete _0x1d80e8[_0x03ba('0x48')]['id'];}return db['SalesforceAccount'][_0x03ba('0x49')]({'where':{'id':_0x1d80e8[_0x03ba('0x4a')]['id']}})[_0x03ba('0x25')](handleEntityNotFound(_0x4c7b9d,null))[_0x03ba('0x25')](saveUpdates(_0x1d80e8[_0x03ba('0x48')],null))[_0x03ba('0x25')](respondWithResult(_0x4c7b9d,null))[_0x03ba('0x45')](handleError(_0x4c7b9d,null));};exports[_0x03ba('0x26')]=function(_0x3a32ee,_0x578e4a){return db[_0x03ba('0x41')][_0x03ba('0x49')]({'where':{'id':_0x3a32ee[_0x03ba('0x4a')]['id']}})['then'](handleEntityNotFound(_0x578e4a,null))[_0x03ba('0x25')](removeEntity(_0x578e4a,null))[_0x03ba('0x45')](handleError(_0x578e4a,null));};exports[_0x03ba('0x4b')]=function(_0x1aadd4,_0x4fc7df,_0x588b98){var _0x30dfdd={};var _0x3d54ae={};var _0x24af57;var _0x14ffac;return db[_0x03ba('0x41')]['findOne']({'where':{'id':_0x1aadd4[_0x03ba('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4fc7df,null))[_0x03ba('0x25')](function(_0x3fd1b4){if(_0x3fd1b4){_0x24af57=_0x3fd1b4;_0x3d54ae['model']=_[_0x03ba('0x33')](db['SalesforceConfiguration'][_0x03ba('0x2e')]);_0x3d54ae['query']=_['keys'](_0x1aadd4['query']);_0x3d54ae[_0x03ba('0x34')]=_[_0x03ba('0x35')](_0x3d54ae[_0x03ba('0x31')],_0x3d54ae['query']);_0x30dfdd[_0x03ba('0x37')]=_['intersection'](_0x3d54ae['model'],qs[_0x03ba('0x36')](_0x1aadd4[_0x03ba('0x32')][_0x03ba('0x36')]));_0x30dfdd[_0x03ba('0x37')]=_0x30dfdd[_0x03ba('0x37')][_0x03ba('0x38')]?_0x30dfdd[_0x03ba('0x37')]:_0x3d54ae[_0x03ba('0x31')];_0x30dfdd[_0x03ba('0x3a')]=qs[_0x03ba('0x3b')](_0x1aadd4['query']['sort']);_0x30dfdd[_0x03ba('0x3c')]=qs['filters'](_[_0x03ba('0x3d')](_0x1aadd4[_0x03ba('0x32')],_0x3d54ae[_0x03ba('0x34')]));if(_0x1aadd4['query']['filter']){_0x30dfdd['where']=_[_0x03ba('0x3f')](_0x30dfdd[_0x03ba('0x3c')],{'$or':_[_0x03ba('0x2d')](_0x30dfdd['attributes'],function(_0x5885d3){var _0x9e02f1={};_0x9e02f1[_0x5885d3]={'$like':'%'+_0x1aadd4[_0x03ba('0x32')][_0x03ba('0x3e')]+'%'};return _0x9e02f1;})});}_0x30dfdd=_[_0x03ba('0x3f')]({},_0x30dfdd,_0x1aadd4[_0x03ba('0x40')]);return _0x24af57[_0x03ba('0x4b')](_0x30dfdd);}})[_0x03ba('0x25')](function(_0x188160){if(_0x188160){_0x14ffac=_0x188160[_0x03ba('0x38')];if(!_0x1aadd4[_0x03ba('0x32')][_0x03ba('0x4c')](_0x03ba('0x39'))){_0x30dfdd[_0x03ba('0x1d')]=qs[_0x03ba('0x1d')](_0x1aadd4[_0x03ba('0x32')][_0x03ba('0x1d')]);_0x30dfdd['offset']=qs['offset'](_0x1aadd4[_0x03ba('0x32')][_0x03ba('0x1b')]);}return _0x24af57[_0x03ba('0x4b')](_0x30dfdd);}})[_0x03ba('0x25')](function(_0x3f1a00){if(_0x3f1a00){return _0x3f1a00?{'count':_0x14ffac,'rows':_0x3f1a00}:null;}})['then'](respondWithResult(_0x4fc7df,null))[_0x03ba('0x45')](handleError(_0x4fc7df,null));};exports[_0x03ba('0x4d')]=function(_0x2e686f,_0x5a4f24,_0x4514ef){if(_0x2e686f[_0x03ba('0x48')]['id']){delete _0x2e686f[_0x03ba('0x48')]['id'];}return db[_0x03ba('0x41')][_0x03ba('0x4e')]({'where':{'id':_0x2e686f[_0x03ba('0x4a')]['id']}})[_0x03ba('0x25')](handleEntityNotFound(_0x5a4f24,null))['then'](function(_0xb4ac34){if(_0xb4ac34){_0x2e686f[_0x03ba('0x48')][_0x03ba('0x4f')]=_0xb4ac34['id'];_0x2e686f[_0x03ba('0x48')][_0x03ba('0x50')]=integrations[_0x03ba('0x51')](_0x2e686f[_0x03ba('0x48')]['channel'],_0x2e686f[_0x03ba('0x48')][_0x03ba('0x30')]);_0x2e686f[_0x03ba('0x48')][_0x03ba('0x52')]=integrations['getDescriptions'](_0x2e686f[_0x03ba('0x48')]['channel'],_0x2e686f['body'][_0x03ba('0x30')]);return db[_0x03ba('0x53')][_0x03ba('0x47')](_0x2e686f[_0x03ba('0x48')],{'include':[{'model':db['SalesforceField'],'as':_0x03ba('0x50')},{'model':db['SalesforceField'],'as':'Descriptions'}]});}return null;})[_0x03ba('0x25')](respondWithResult(_0x5a4f24,null))[_0x03ba('0x45')](handleError(_0x5a4f24,null));};exports[_0x03ba('0x54')]=function(_0x40c5a1,_0x2802c4,_0x76197a){var _0x31c3c1;var _0x579f9f='';var _0x13c2cc=_0x03ba('0x55');return db[_0x03ba('0x41')]['findOne']({'where':{'id':_0x40c5a1[_0x03ba('0x4a')]['id']},'attributes':['id',_0x03ba('0x56'),_0x03ba('0x57'),_0x03ba('0x58'),_0x03ba('0x59'),'password',_0x03ba('0x5a')]})[_0x03ba('0x25')](handleEntityNotFound(_0x2802c4,null))[_0x03ba('0x25')](function(_0x3abb86){if(_0x3abb86){_0x579f9f=_0x3abb86[_0x03ba('0x56')];var _0x4bb1b5=_0x579f9f[_0x03ba('0x5b')](-0x1);if(_0x4bb1b5==='/'){_0x579f9f=_0x579f9f['substring'](0x0,_0x579f9f['lastIndexOf'](_0x4bb1b5));}_0x31c3c1=new jsforce[(_0x03ba('0x5c'))]({'oauth2':{'loginUrl':_0x579f9f,'clientId':_0x3abb86[_0x03ba('0x57')],'clientSecret':_0x3abb86[_0x03ba('0x58')]}});return _0x31c3c1[_0x03ba('0x5d')](_0x3abb86[_0x03ba('0x59')],_0x3abb86[_0x03ba('0x5e')][_0x03ba('0x5f')](_0x3abb86[_0x03ba('0x5a')]));}})[_0x03ba('0x25')](function(_0x347537){if(_0x347537){if(!_[_0x03ba('0x60')](_0x40c5a1[_0x03ba('0x32')][_0x03ba('0x61')])){_0x13c2cc=_0x40c5a1[_0x03ba('0x32')][_0x03ba('0x61')];}return _0x31c3c1[_0x03ba('0x62')](_0x13c2cc)[_0x03ba('0x63')]();}})[_0x03ba('0x25')](function(_0x1306d7){var _0x3de4c8=[_0x03ba('0x64'),_0x03ba('0x65'),_0x03ba('0x66'),_0x03ba('0x67'),_0x03ba('0x68'),_0x03ba('0x69')];var _0x12c705=[_0x03ba('0x6a'),_0x03ba('0x6b'),_0x03ba('0x6c'),'boolean',_0x03ba('0x6d'),_0x03ba('0x6e'),_0x03ba('0x6f')];if(_0x1306d7){_[_0x03ba('0x70')](_0x1306d7[_0x03ba('0x36')],function(_0x19376b){return _0x3de4c8[_0x03ba('0x71')](_0x19376b['name'])||!_0x12c705[_0x03ba('0x71')](_0x19376b[_0x03ba('0x30')]);});return{'count':_0x1306d7[_0x03ba('0x36')][_0x03ba('0x38')],'rows':_[_0x03ba('0x2d')](_0x1306d7[_0x03ba('0x36')],function(_0x18b819){return{'id':_0x18b819['name'],'name':_0x18b819[_0x03ba('0x72')],'custom':_0x18b819[_0x03ba('0x73')],'options':_0x18b819[_0x03ba('0x74')][_0x03ba('0x38')]>0x0?_[_0x03ba('0x2d')](_0x18b819['picklistValues'],function(_0x498171){return{'name':_0x498171[_0x03ba('0x72')],'value':_0x498171[_0x03ba('0x75')]};}):_0x18b819[_0x03ba('0x30')]==_0x03ba('0x76')?[{'name':_0x03ba('0x77'),'value':_0x03ba('0x78')},{'name':_0x03ba('0x79'),'value':_0x03ba('0x7a')}]:[]};})};}})[_0x03ba('0x25')](respondWithResult(_0x2802c4,null))[_0x03ba('0x45')](function(_0x2abda1){var _0x468c11=_0x40c5a1[_0x03ba('0x32')][_0x03ba('0x7b')]?0x1f4:_0x2abda1[_0x03ba('0x7c')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x468c11,JSON['stringify'](_0x2abda1));delete _0x2abda1['name'];if(_0x468c11===0x191){_0x468c11=0x190;}_0x2802c4[_0x03ba('0x18')](_0x468c11)[_0x03ba('0x2b')](_0x40c5a1[_0x03ba('0x32')][_0x03ba('0x7b')]?{'message':_0x03ba('0x7d'),'statusCode':_0x2abda1[_0x03ba('0x7c')]}:_0x2abda1);});}; \ No newline at end of file +var _0xf4d9=['body','destroy','getConfigurations','findOne','SalesforceConfiguration','order','nolimit','addConfiguration','AccountId','channel','Descriptions','getDescriptions','SalesforceField','Subjects','getFields','clientId','clientSecret','password','securityToken','remoteUri','slice','substring','Connection','login','username','isNil','ticketType','sobject','describe','OwnerId','IsReminderSet','IsRecurrence','Description','string','picklist','email','textarea','phone','remove','includes','label','picklistValues','value','True','true','False','false','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','rimraf','request-promise','bluebird','util','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/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','send','index','map','rawAttributes','type','key','model','name','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','SalesforceAccount','includeAll','findAll','rows','params','include','find','catch','create'];(function(_0x1bccf4,_0x4baff9){var _0x3a8b1e=function(_0x311891){while(--_0x311891){_0x1bccf4['push'](_0x1bccf4['shift']());}};_0x3a8b1e(++_0x4baff9);}(_0xf4d9,0x1a4));var _0x9f4d=function(_0x3e685f,_0x70b6d5){_0x3e685f=_0x3e685f-0x0;var _0x5cd900=_0xf4d9[_0x3e685f];return _0x5cd900;};'use strict';var emlformat=require(_0x9f4d('0x0'));var rimraf=require(_0x9f4d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9f4d('0x2'));var moment=require('moment');var BPromise=require(_0x9f4d('0x3'));var Mustache=require('mustache');var util=require(_0x9f4d('0x4'));var path=require('path');var sox=require(_0x9f4d('0x5'));var csv=require(_0x9f4d('0x6'));var ejs=require(_0x9f4d('0x7'));var fs=require('fs');var fs_extra=require(_0x9f4d('0x8'));var _=require(_0x9f4d('0x9'));var squel=require(_0x9f4d('0xa'));var crypto=require(_0x9f4d('0xb'));var jsforce=require(_0x9f4d('0xc'));var deskjs=require(_0x9f4d('0xd'));var toCsv=require(_0x9f4d('0x6'));var querystring=require(_0x9f4d('0xe'));var Papa=require(_0x9f4d('0xf'));var Redis=require('ioredis');var authService=require(_0x9f4d('0x10'));var qs=require(_0x9f4d('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9f4d('0x12'));var logger=require(_0x9f4d('0x13'))(_0x9f4d('0x14'));var utils=require(_0x9f4d('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x9f4d('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0x9f4d('0x17'));function respondWithStatusCode(_0x37bfaf,_0x573a78){_0x573a78=_0x573a78||0xcc;return function(_0x4d2b7d){if(_0x4d2b7d){return _0x37bfaf[_0x9f4d('0x18')](_0x573a78);}return _0x37bfaf[_0x9f4d('0x19')](_0x573a78)[_0x9f4d('0x1a')]();};}function respondWithResult(_0x5899f2,_0x221379){_0x221379=_0x221379||0xc8;return function(_0x18aebb){if(_0x18aebb){return _0x5899f2[_0x9f4d('0x19')](_0x221379)[_0x9f4d('0x1b')](_0x18aebb);}};}function respondWithFilteredResult(_0x33d106,_0x5df830){return function(_0x3fc38c){if(_0x3fc38c){var _0x3a3b85=typeof _0x5df830[_0x9f4d('0x1c')]===_0x9f4d('0x1d')&&typeof _0x5df830[_0x9f4d('0x1e')]===_0x9f4d('0x1d');var _0x46fcf0=_0x3fc38c[_0x9f4d('0x1f')];var _0x30a585=_0x3a3b85?0x0:_0x5df830['offset'];var _0x108617=_0x3a3b85?_0x3fc38c[_0x9f4d('0x1f')]:_0x5df830[_0x9f4d('0x1c')]+_0x5df830[_0x9f4d('0x1e')];var _0x40851b;if(_0x108617>=_0x46fcf0){_0x108617=_0x46fcf0;_0x40851b=0xc8;}else{_0x40851b=0xce;}_0x33d106['status'](_0x40851b);return _0x33d106['set'](_0x9f4d('0x20'),_0x30a585+'-'+_0x108617+'/'+_0x46fcf0)[_0x9f4d('0x1b')](_0x3fc38c);}return null;};}function patchUpdates(_0x949a5){return function(_0x40a9e5){try{jsonpatch[_0x9f4d('0x21')](_0x40a9e5,_0x949a5,!![]);}catch(_0x35e82e){return BPromise[_0x9f4d('0x22')](_0x35e82e);}return _0x40a9e5[_0x9f4d('0x23')]();};}function saveUpdates(_0x3c9aaa,_0x56c013){return function(_0x5eb4e2){if(_0x5eb4e2){return _0x5eb4e2[_0x9f4d('0x24')](_0x3c9aaa)[_0x9f4d('0x25')](function(_0x2b8f3a){return _0x2b8f3a;});}return null;};}function removeEntity(_0x5aa11c,_0x4da896){return function(_0x57bc0){if(_0x57bc0){return _0x57bc0['destroy']()[_0x9f4d('0x25')](function(){_0x5aa11c['status'](0xcc)[_0x9f4d('0x1a')]();});}};}function handleEntityNotFound(_0xf95d83,_0x7f581d){return function(_0x10797a){if(!_0x10797a){_0xf95d83[_0x9f4d('0x18')](0x194);}return _0x10797a;};}function handleError(_0x9e4dde,_0xcced18){_0xcced18=_0xcced18||0x1f4;return function(_0x250f53){logger[_0x9f4d('0x26')](_0x250f53[_0x9f4d('0x27')]);if(_0x250f53['name']){delete _0x250f53['name'];}_0x9e4dde['status'](_0xcced18)[_0x9f4d('0x28')](_0x250f53);};}exports[_0x9f4d('0x29')]=function(_0x30c8ba,_0x5c53cc){var _0x19fe83={},_0x1f5164={},_0x2c58f4={'count':0x0,'rows':[]};var _0x66ebbd=_[_0x9f4d('0x2a')](db['SalesforceAccount'][_0x9f4d('0x2b')],function(_0x51c6dc){return{'name':_0x51c6dc['fieldName'],'type':_0x51c6dc[_0x9f4d('0x2c')][_0x9f4d('0x2d')]};});_0x1f5164[_0x9f4d('0x2e')]=_[_0x9f4d('0x2a')](_0x66ebbd,_0x9f4d('0x2f'));_0x1f5164[_0x9f4d('0x30')]=_[_0x9f4d('0x31')](_0x30c8ba['query']);_0x1f5164[_0x9f4d('0x32')]=_['intersection'](_0x1f5164[_0x9f4d('0x2e')],_0x1f5164[_0x9f4d('0x30')]);_0x19fe83[_0x9f4d('0x33')]=_[_0x9f4d('0x34')](_0x1f5164[_0x9f4d('0x2e')],qs[_0x9f4d('0x35')](_0x30c8ba['query'][_0x9f4d('0x35')]));_0x19fe83[_0x9f4d('0x33')]=_0x19fe83[_0x9f4d('0x33')][_0x9f4d('0x36')]?_0x19fe83[_0x9f4d('0x33')]:_0x1f5164['model'];if(!_0x30c8ba['query'][_0x9f4d('0x37')]('nolimit')){_0x19fe83[_0x9f4d('0x1e')]=qs[_0x9f4d('0x1e')](_0x30c8ba[_0x9f4d('0x30')][_0x9f4d('0x1e')]);_0x19fe83['offset']=qs[_0x9f4d('0x1c')](_0x30c8ba[_0x9f4d('0x30')][_0x9f4d('0x1c')]);}_0x19fe83['order']=qs[_0x9f4d('0x38')](_0x30c8ba[_0x9f4d('0x30')][_0x9f4d('0x38')]);_0x19fe83[_0x9f4d('0x39')]=qs[_0x9f4d('0x32')](_[_0x9f4d('0x3a')](_0x30c8ba[_0x9f4d('0x30')],_0x1f5164['filters']),_0x66ebbd);if(_0x30c8ba[_0x9f4d('0x30')][_0x9f4d('0x3b')]){_0x19fe83['where']=_[_0x9f4d('0x3c')](_0x19fe83[_0x9f4d('0x39')],{'$or':_[_0x9f4d('0x2a')](_0x66ebbd,function(_0x1577f6){if(_0x1577f6[_0x9f4d('0x2c')]!==_0x9f4d('0x3d')){var _0x378bc3={};_0x378bc3[_0x1577f6[_0x9f4d('0x2f')]]={'$like':'%'+_0x30c8ba[_0x9f4d('0x30')][_0x9f4d('0x3b')]+'%'};return _0x378bc3;}})});}_0x19fe83=_[_0x9f4d('0x3c')]({},_0x19fe83,_0x30c8ba[_0x9f4d('0x3e')]);var _0x494e51={'where':_0x19fe83[_0x9f4d('0x39')]};return db[_0x9f4d('0x3f')]['count'](_0x494e51)[_0x9f4d('0x25')](function(_0x4233f3){_0x2c58f4[_0x9f4d('0x1f')]=_0x4233f3;if(_0x30c8ba['query'][_0x9f4d('0x40')]){_0x19fe83['include']=[{'all':!![]}];}return db[_0x9f4d('0x3f')][_0x9f4d('0x41')](_0x19fe83);})[_0x9f4d('0x25')](function(_0x4d5229){_0x2c58f4[_0x9f4d('0x42')]=_0x4d5229;return _0x2c58f4;})[_0x9f4d('0x25')](respondWithFilteredResult(_0x5c53cc,_0x19fe83))['catch'](handleError(_0x5c53cc,null));};exports['show']=function(_0x5be0a3,_0x1f4f56){var _0x442911={'raw':![],'where':{'id':_0x5be0a3[_0x9f4d('0x43')]['id']}},_0x191983={};_0x191983[_0x9f4d('0x2e')]=_[_0x9f4d('0x31')](db[_0x9f4d('0x3f')][_0x9f4d('0x2b')]);_0x191983[_0x9f4d('0x30')]=_['keys'](_0x5be0a3['query']);_0x191983['filters']=_[_0x9f4d('0x34')](_0x191983['model'],_0x191983[_0x9f4d('0x30')]);_0x442911[_0x9f4d('0x33')]=_['intersection'](_0x191983[_0x9f4d('0x2e')],qs[_0x9f4d('0x35')](_0x5be0a3[_0x9f4d('0x30')][_0x9f4d('0x35')]));_0x442911['attributes']=_0x442911['attributes'][_0x9f4d('0x36')]?_0x442911['attributes']:_0x191983['model'];if(_0x5be0a3[_0x9f4d('0x30')][_0x9f4d('0x40')]){_0x442911[_0x9f4d('0x44')]=[{'all':!![]}];}_0x442911=_[_0x9f4d('0x3c')]({},_0x442911,_0x5be0a3['options']);return db[_0x9f4d('0x3f')][_0x9f4d('0x45')](_0x442911)[_0x9f4d('0x25')](handleEntityNotFound(_0x1f4f56,null))[_0x9f4d('0x25')](respondWithResult(_0x1f4f56,null))[_0x9f4d('0x46')](handleError(_0x1f4f56,null));};exports[_0x9f4d('0x47')]=function(_0x140a57,_0x5beba1){return db['SalesforceAccount'][_0x9f4d('0x47')](_0x140a57[_0x9f4d('0x48')],{})['then'](respondWithResult(_0x5beba1,0xc9))[_0x9f4d('0x46')](handleError(_0x5beba1,null));};exports[_0x9f4d('0x24')]=function(_0x291ed8,_0x10f0ce){if(_0x291ed8[_0x9f4d('0x48')]['id']){delete _0x291ed8['body']['id'];}return db[_0x9f4d('0x3f')]['find']({'where':{'id':_0x291ed8[_0x9f4d('0x43')]['id']}})['then'](handleEntityNotFound(_0x10f0ce,null))[_0x9f4d('0x25')](saveUpdates(_0x291ed8[_0x9f4d('0x48')],null))[_0x9f4d('0x25')](respondWithResult(_0x10f0ce,null))[_0x9f4d('0x46')](handleError(_0x10f0ce,null));};exports[_0x9f4d('0x49')]=function(_0x4fb673,_0x3e9e9d){return db[_0x9f4d('0x3f')][_0x9f4d('0x45')]({'where':{'id':_0x4fb673[_0x9f4d('0x43')]['id']}})[_0x9f4d('0x25')](handleEntityNotFound(_0x3e9e9d,null))[_0x9f4d('0x25')](removeEntity(_0x3e9e9d,null))['catch'](handleError(_0x3e9e9d,null));};exports[_0x9f4d('0x4a')]=function(_0x3235af,_0x41bba3,_0x276e8f){var _0x23a13c={};var _0x14e498={};var _0x16b6bf;var _0x188449;return db[_0x9f4d('0x3f')][_0x9f4d('0x4b')]({'where':{'id':_0x3235af[_0x9f4d('0x43')]['id']}})[_0x9f4d('0x25')](handleEntityNotFound(_0x41bba3,null))[_0x9f4d('0x25')](function(_0x49f2a1){if(_0x49f2a1){_0x16b6bf=_0x49f2a1;_0x14e498[_0x9f4d('0x2e')]=_[_0x9f4d('0x31')](db[_0x9f4d('0x4c')][_0x9f4d('0x2b')]);_0x14e498[_0x9f4d('0x30')]=_[_0x9f4d('0x31')](_0x3235af[_0x9f4d('0x30')]);_0x14e498[_0x9f4d('0x32')]=_['intersection'](_0x14e498[_0x9f4d('0x2e')],_0x14e498[_0x9f4d('0x30')]);_0x23a13c[_0x9f4d('0x33')]=_[_0x9f4d('0x34')](_0x14e498[_0x9f4d('0x2e')],qs['fields'](_0x3235af[_0x9f4d('0x30')][_0x9f4d('0x35')]));_0x23a13c[_0x9f4d('0x33')]=_0x23a13c[_0x9f4d('0x33')]['length']?_0x23a13c['attributes']:_0x14e498[_0x9f4d('0x2e')];_0x23a13c[_0x9f4d('0x4d')]=qs['sort'](_0x3235af[_0x9f4d('0x30')]['sort']);_0x23a13c[_0x9f4d('0x39')]=qs[_0x9f4d('0x32')](_['pick'](_0x3235af[_0x9f4d('0x30')],_0x14e498['filters']));if(_0x3235af[_0x9f4d('0x30')][_0x9f4d('0x3b')]){_0x23a13c['where']=_['merge'](_0x23a13c['where'],{'$or':_[_0x9f4d('0x2a')](_0x23a13c[_0x9f4d('0x33')],function(_0x20784b){var _0x4f3af0={};_0x4f3af0[_0x20784b]={'$like':'%'+_0x3235af[_0x9f4d('0x30')][_0x9f4d('0x3b')]+'%'};return _0x4f3af0;})});}_0x23a13c=_[_0x9f4d('0x3c')]({},_0x23a13c,_0x3235af[_0x9f4d('0x3e')]);return _0x16b6bf['getConfigurations'](_0x23a13c);}})[_0x9f4d('0x25')](function(_0x2c2e31){if(_0x2c2e31){_0x188449=_0x2c2e31[_0x9f4d('0x36')];if(!_0x3235af[_0x9f4d('0x30')][_0x9f4d('0x37')](_0x9f4d('0x4e'))){_0x23a13c[_0x9f4d('0x1e')]=qs[_0x9f4d('0x1e')](_0x3235af[_0x9f4d('0x30')]['limit']);_0x23a13c['offset']=qs[_0x9f4d('0x1c')](_0x3235af[_0x9f4d('0x30')]['offset']);}return _0x16b6bf[_0x9f4d('0x4a')](_0x23a13c);}})[_0x9f4d('0x25')](function(_0x3feed5){if(_0x3feed5){return _0x3feed5?{'count':_0x188449,'rows':_0x3feed5}:null;}})[_0x9f4d('0x25')](respondWithResult(_0x41bba3,null))[_0x9f4d('0x46')](handleError(_0x41bba3,null));};exports[_0x9f4d('0x4f')]=function(_0x47fdf7,_0x2a5400,_0x131490){if(_0x47fdf7[_0x9f4d('0x48')]['id']){delete _0x47fdf7[_0x9f4d('0x48')]['id'];}return db[_0x9f4d('0x3f')][_0x9f4d('0x4b')]({'where':{'id':_0x47fdf7['params']['id']}})[_0x9f4d('0x25')](handleEntityNotFound(_0x2a5400,null))[_0x9f4d('0x25')](function(_0x4b99d6){if(_0x4b99d6){_0x47fdf7[_0x9f4d('0x48')][_0x9f4d('0x50')]=_0x4b99d6['id'];_0x47fdf7[_0x9f4d('0x48')]['Subjects']=integrations['getSubjects'](_0x47fdf7['body'][_0x9f4d('0x51')],_0x47fdf7[_0x9f4d('0x48')][_0x9f4d('0x2c')]);_0x47fdf7[_0x9f4d('0x48')][_0x9f4d('0x52')]=integrations[_0x9f4d('0x53')](_0x47fdf7[_0x9f4d('0x48')][_0x9f4d('0x51')],_0x47fdf7['body'][_0x9f4d('0x2c')]);return db['SalesforceConfiguration']['create'](_0x47fdf7['body'],{'include':[{'model':db[_0x9f4d('0x54')],'as':_0x9f4d('0x55')},{'model':db[_0x9f4d('0x54')],'as':'Descriptions'}]});}return null;})[_0x9f4d('0x25')](respondWithResult(_0x2a5400,null))['catch'](handleError(_0x2a5400,null));};exports[_0x9f4d('0x56')]=function(_0x36d40b,_0x112013,_0x337521){var _0x3aa38c;var _0xaf37bc='';var _0x1b26ac='Task';return db[_0x9f4d('0x3f')][_0x9f4d('0x4b')]({'where':{'id':_0x36d40b[_0x9f4d('0x43')]['id']},'attributes':['id','remoteUri',_0x9f4d('0x57'),_0x9f4d('0x58'),'username',_0x9f4d('0x59'),_0x9f4d('0x5a')]})['then'](handleEntityNotFound(_0x112013,null))[_0x9f4d('0x25')](function(_0x95daaa){if(_0x95daaa){_0xaf37bc=_0x95daaa[_0x9f4d('0x5b')];var _0x307847=_0xaf37bc[_0x9f4d('0x5c')](-0x1);if(_0x307847==='/'){_0xaf37bc=_0xaf37bc[_0x9f4d('0x5d')](0x0,_0xaf37bc['lastIndexOf'](_0x307847));}_0x3aa38c=new jsforce[(_0x9f4d('0x5e'))]({'oauth2':{'loginUrl':_0xaf37bc,'clientId':_0x95daaa[_0x9f4d('0x57')],'clientSecret':_0x95daaa[_0x9f4d('0x58')]}});return _0x3aa38c[_0x9f4d('0x5f')](_0x95daaa[_0x9f4d('0x60')],_0x95daaa['password']['concat'](_0x95daaa['securityToken']));}})[_0x9f4d('0x25')](function(_0x1c5b65){if(_0x1c5b65){if(!_[_0x9f4d('0x61')](_0x36d40b[_0x9f4d('0x30')][_0x9f4d('0x62')])){_0x1b26ac=_0x36d40b[_0x9f4d('0x30')][_0x9f4d('0x62')];}return _0x3aa38c[_0x9f4d('0x63')](_0x1b26ac)[_0x9f4d('0x64')]();}})[_0x9f4d('0x25')](function(_0x51b8ed){var _0x556426=[_0x9f4d('0x65'),'ActivityDate',_0x9f4d('0x66'),_0x9f4d('0x67'),'Subject',_0x9f4d('0x68')];var _0x398d7a=[_0x9f4d('0x69'),'int',_0x9f4d('0x6a'),'boolean',_0x9f4d('0x6b'),_0x9f4d('0x6c'),_0x9f4d('0x6d')];if(_0x51b8ed){_[_0x9f4d('0x6e')](_0x51b8ed[_0x9f4d('0x35')],function(_0x129164){return _0x556426[_0x9f4d('0x6f')](_0x129164[_0x9f4d('0x2f')])||!_0x398d7a[_0x9f4d('0x6f')](_0x129164[_0x9f4d('0x2c')]);});return{'count':_0x51b8ed['fields']['length'],'rows':_[_0x9f4d('0x2a')](_0x51b8ed[_0x9f4d('0x35')],function(_0x3b949c){return{'id':_0x3b949c[_0x9f4d('0x2f')],'name':_0x3b949c[_0x9f4d('0x70')],'custom':_0x3b949c['custom'],'options':_0x3b949c[_0x9f4d('0x71')]['length']>0x0?_['map'](_0x3b949c[_0x9f4d('0x71')],function(_0x596280){return{'name':_0x596280[_0x9f4d('0x70')],'value':_0x596280[_0x9f4d('0x72')]};}):_0x3b949c['type']=='boolean'?[{'name':_0x9f4d('0x73'),'value':_0x9f4d('0x74')},{'name':_0x9f4d('0x75'),'value':_0x9f4d('0x76')}]:[]};})};}})[_0x9f4d('0x25')](respondWithResult(_0x112013,null))[_0x9f4d('0x46')](function(_0x5e0076){var _0xcd10b5=_0x36d40b[_0x9f4d('0x30')]['test']?0x1f4:_0x5e0076['statusCode']||0x1f4;logger[_0x9f4d('0x26')](_0x9f4d('0x77'),_0x9f4d('0x56'),_0xcd10b5,JSON[_0x9f4d('0x78')](_0x5e0076));delete _0x5e0076[_0x9f4d('0x2f')];if(_0xcd10b5===0x191){_0xcd10b5=0x190;}_0x112013[_0x9f4d('0x19')](_0xcd10b5)[_0x9f4d('0x28')](_0x36d40b[_0x9f4d('0x30')][_0x9f4d('0x79')]?{'message':_0x9f4d('0x7a'),'statusCode':_0x5e0076['statusCode']}:_0x5e0076);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 2c39c5c..57a7698 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 _0xc68d=['./intSalesforceAccount.attributes','exports','SalesforceAccount','int_salesforce_accounts','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x512e84,_0x2234b8){var _0x58a7f0=function(_0x202b00){while(--_0x202b00){_0x512e84['push'](_0x512e84['shift']());}};_0x58a7f0(++_0x2234b8);}(_0xc68d,0x17a));var _0xdc68=function(_0xadecaf,_0x14cb6b){_0xadecaf=_0xadecaf-0x0;var _0x5adf80=_0xc68d[_0xadecaf];return _0x5adf80;};'use strict';var _=require('lodash');var util=require(_0xdc68('0x0'));var logger=require(_0xdc68('0x1'))('api');var moment=require('moment');var BPromise=require(_0xdc68('0x2'));var rp=require(_0xdc68('0x3'));var fs=require('fs');var path=require(_0xdc68('0x4'));var rimraf=require(_0xdc68('0x5'));var config=require(_0xdc68('0x6'));var attributes=require(_0xdc68('0x7'));var integrations=require('../../components/integrations/configuration');module[_0xdc68('0x8')]=function(_0x2709db,_0x9507b2){return _0x2709db['define'](_0xdc68('0x9'),attributes,{'tableName':_0xdc68('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe553=['util','../../config/logger','api','moment','bluebird','request-promise','path','exports','SalesforceAccount','int_salesforce_accounts','lodash'];(function(_0x2cd1fb,_0x291f55){var _0x48fd2b=function(_0x18e23e){while(--_0x18e23e){_0x2cd1fb['push'](_0x2cd1fb['shift']());}};_0x48fd2b(++_0x291f55);}(_0xe553,0x1a1));var _0x3e55=function(_0x2212d1,_0x483fc8){_0x2212d1=_0x2212d1-0x0;var _0x15eec5=_0xe553[_0x2212d1];return _0x15eec5;};'use strict';var _=require(_0x3e55('0x0'));var util=require(_0x3e55('0x1'));var logger=require(_0x3e55('0x2'))(_0x3e55('0x3'));var moment=require(_0x3e55('0x4'));var BPromise=require(_0x3e55('0x5'));var rp=require(_0x3e55('0x6'));var fs=require('fs');var path=require(_0x3e55('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intSalesforceAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x3e55('0x8')]=function(_0x1c05ac,_0x212baa){return _0x1c05ac['define'](_0x3e55('0x9'),attributes,{'tableName':_0x3e55('0xa'),'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 2c2737b..11af8f5 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 _0xb56f=['message','catch','GetSalesforceAccount','SalesforceAccount','options','raw','where','attributes','limit','include','map','model','ShowSalesforceAccount','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error'];(function(_0x2c99d8,_0x4fbf09){var _0x509466=function(_0x2bf6ba){while(--_0x2bf6ba){_0x2c99d8['push'](_0x2c99d8['shift']());}};_0x509466(++_0x4fbf09);}(_0xb56f,0x70));var _0xfb56=function(_0xee7f06,_0x57016){_0xee7f06=_0xee7f06-0x0;var _0x5b05b8=_0xb56f[_0xee7f06];return _0x5b05b8;};'use strict';var _=require(_0xfb56('0x0'));var util=require(_0xfb56('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfb56('0x2'));var fs=require('fs');var Redis=require(_0xfb56('0x3'));var db=require(_0xfb56('0x4'))['db'];var utils=require(_0xfb56('0x5'));var logger=require(_0xfb56('0x6'))(_0xfb56('0x7'));var config=require(_0xfb56('0x8'));var jayson=require(_0xfb56('0x9'));var client=jayson[_0xfb56('0xa')][_0xfb56('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x26c86b,_0xa800c0,_0x328c59){return new BPromise(function(_0x58274b,_0x1dfea8){return client[_0xfb56('0xc')](_0x26c86b,_0x328c59)[_0xfb56('0xd')](function(_0x417ac2){logger[_0xfb56('0xe')](_0xfb56('0xf'),_0xa800c0,_0xfb56('0x10'));logger[_0xfb56('0x11')](_0xfb56('0x12'),_0xa800c0,_0xfb56('0x10'),JSON['stringify'](_0x417ac2));if(_0x417ac2['error']){if(_0x417ac2[_0xfb56('0x13')]['code']===0x1f4){logger['error'](_0xfb56('0xf'),_0xa800c0,_0x417ac2[_0xfb56('0x13')][_0xfb56('0x14')]);return _0x1dfea8(_0x417ac2[_0xfb56('0x13')][_0xfb56('0x14')]);}logger[_0xfb56('0x13')](_0xfb56('0xf'),_0xa800c0,_0x417ac2[_0xfb56('0x13')][_0xfb56('0x14')]);return _0x58274b(_0x417ac2[_0xfb56('0x13')][_0xfb56('0x14')]);}else{logger[_0xfb56('0xe')](_0xfb56('0xf'),_0xa800c0,_0xfb56('0x10'));_0x58274b(_0x417ac2['result'][_0xfb56('0x14')]);}})[_0xfb56('0x15')](function(_0x4c37e2){logger[_0xfb56('0x13')](_0xfb56('0xf'),_0xa800c0,_0x4c37e2);_0x1dfea8(_0x4c37e2);});});}exports[_0xfb56('0x16')]=function(_0x5b30c9){var _0x41b473=this;return new Promise(function(_0x203fb3,_0x2d381f){return db[_0xfb56('0x17')]['findAll']({'raw':_0x5b30c9[_0xfb56('0x18')]?_0x5b30c9[_0xfb56('0x18')][_0xfb56('0x19')]===undefined?!![]:![]:!![],'where':_0x5b30c9[_0xfb56('0x18')]?_0x5b30c9[_0xfb56('0x18')][_0xfb56('0x1a')]||null:null,'attributes':_0x5b30c9['options']?_0x5b30c9[_0xfb56('0x18')][_0xfb56('0x1b')]||null:null,'limit':_0x5b30c9['options']?_0x5b30c9[_0xfb56('0x18')][_0xfb56('0x1c')]||null:null,'include':_0x5b30c9[_0xfb56('0x18')]?_0x5b30c9[_0xfb56('0x18')][_0xfb56('0x1d')]?_[_0xfb56('0x1e')](_0x5b30c9[_0xfb56('0x18')][_0xfb56('0x1d')],function(_0x4ca0c1){return{'model':db[_0x4ca0c1[_0xfb56('0x1f')]],'as':_0x4ca0c1['as'],'attributes':_0x4ca0c1[_0xfb56('0x1b')],'include':_0x4ca0c1[_0xfb56('0x1d')]?_[_0xfb56('0x1e')](_0x4ca0c1[_0xfb56('0x1d')],function(_0x417690){return{'model':db[_0x417690[_0xfb56('0x1f')]],'as':_0x417690['as'],'attributes':_0x417690[_0xfb56('0x1b')],'include':_0x417690[_0xfb56('0x1d')]?_[_0xfb56('0x1e')](_0x417690[_0xfb56('0x1d')],function(_0x15bf3f){return{'model':db[_0x15bf3f[_0xfb56('0x1f')]],'as':_0x15bf3f['as'],'attributes':_0x15bf3f[_0xfb56('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xfb56('0xd')](function(_0xfea4c9){logger[_0xfb56('0xe')](_0xfb56('0x16'),_0x5b30c9);logger[_0xfb56('0x11')](_0xfb56('0x16'),_0x5b30c9,JSON['stringify'](_0xfea4c9));_0x203fb3(_0xfea4c9);})[_0xfb56('0x15')](function(_0x4ad42e){logger[_0xfb56('0x13')](_0xfb56('0x16'),_0x4ad42e[_0xfb56('0x14')],_0x5b30c9);_0x2d381f(_0x41b473[_0xfb56('0x13')](0x1f4,_0x4ad42e[_0xfb56('0x14')]));});});};exports['ShowSalesforceAccount']=function(_0x3c2fc0){var _0x3f6106=this;return new Promise(function(_0x1117d5,_0x3b3304){return db[_0xfb56('0x17')]['find']({'raw':_0x3c2fc0[_0xfb56('0x18')]?_0x3c2fc0[_0xfb56('0x18')][_0xfb56('0x19')]===undefined?!![]:![]:!![],'where':_0x3c2fc0[_0xfb56('0x18')]?_0x3c2fc0[_0xfb56('0x18')][_0xfb56('0x1a')]||null:null,'attributes':_0x3c2fc0[_0xfb56('0x18')]?_0x3c2fc0['options'][_0xfb56('0x1b')]||null:null,'include':_0x3c2fc0['options']?_0x3c2fc0['options'][_0xfb56('0x1d')]?_[_0xfb56('0x1e')](_0x3c2fc0[_0xfb56('0x18')][_0xfb56('0x1d')],function(_0xefea57){return{'model':db[_0xefea57[_0xfb56('0x1f')]],'as':_0xefea57['as'],'attributes':_0xefea57[_0xfb56('0x1b')],'include':_0xefea57[_0xfb56('0x1d')]?_[_0xfb56('0x1e')](_0xefea57['include'],function(_0x4fb3dd){return{'model':db[_0x4fb3dd[_0xfb56('0x1f')]],'as':_0x4fb3dd['as'],'attributes':_0x4fb3dd[_0xfb56('0x1b')],'include':_0x4fb3dd['include']?_['map'](_0x4fb3dd['include'],function(_0x230db5){return{'model':db[_0x230db5['model']],'as':_0x230db5['as'],'attributes':_0x230db5['attributes']};}):[]};}):[]};}):[]:[]})[_0xfb56('0xd')](function(_0xcef67a){logger['info'](_0xfb56('0x20'),_0x3c2fc0);logger[_0xfb56('0x11')](_0xfb56('0x20'),_0x3c2fc0,JSON['stringify'](_0xcef67a));_0x1117d5(_0xcef67a);})[_0xfb56('0x15')](function(_0x160f86){logger[_0xfb56('0x13')](_0xfb56('0x20'),_0x160f86[_0xfb56('0x14')],_0x3c2fc0);_0x3b3304(_0x3f6106[_0xfb56('0x13')](0x1f4,_0x160f86[_0xfb56('0x14')]));});});}; \ No newline at end of file +var _0xf561=['options','raw','where','include','attributes','map','model','debug','ShowSalesforceAccount','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll'];(function(_0x12bf41,_0x55e9ea){var _0x671cea=function(_0x5afdcb){while(--_0x5afdcb){_0x12bf41['push'](_0x12bf41['shift']());}};_0x671cea(++_0x55e9ea);}(_0xf561,0x145));var _0x1f56=function(_0x4fbac9,_0x86fa6b){_0x4fbac9=_0x4fbac9-0x0;var _0x2cde19=_0xf561[_0x4fbac9];return _0x2cde19;};'use strict';var _=require(_0x1f56('0x0'));var util=require(_0x1f56('0x1'));var moment=require(_0x1f56('0x2'));var BPromise=require(_0x1f56('0x3'));var rs=require(_0x1f56('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1f56('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1f56('0x6'))('rpc');var config=require(_0x1f56('0x7'));var jayson=require(_0x1f56('0x8'));var client=jayson[_0x1f56('0x9')][_0x1f56('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59e3d2,_0x36e9e0,_0x467bd0){return new BPromise(function(_0x3d269c,_0x416999){return client['request'](_0x59e3d2,_0x467bd0)[_0x1f56('0xb')](function(_0x460f5a){logger[_0x1f56('0xc')](_0x1f56('0xd'),_0x36e9e0,_0x1f56('0xe'));logger['debug'](_0x1f56('0xf'),_0x36e9e0,_0x1f56('0xe'),JSON[_0x1f56('0x10')](_0x460f5a));if(_0x460f5a[_0x1f56('0x11')]){if(_0x460f5a[_0x1f56('0x11')][_0x1f56('0x12')]===0x1f4){logger[_0x1f56('0x11')](_0x1f56('0xd'),_0x36e9e0,_0x460f5a[_0x1f56('0x11')]['message']);return _0x416999(_0x460f5a[_0x1f56('0x11')][_0x1f56('0x13')]);}logger[_0x1f56('0x11')](_0x1f56('0xd'),_0x36e9e0,_0x460f5a['error'][_0x1f56('0x13')]);return _0x3d269c(_0x460f5a[_0x1f56('0x11')][_0x1f56('0x13')]);}else{logger[_0x1f56('0xc')]('SalesforceAccount,\x20%s,\x20%s',_0x36e9e0,_0x1f56('0xe'));_0x3d269c(_0x460f5a[_0x1f56('0x14')][_0x1f56('0x13')]);}})[_0x1f56('0x15')](function(_0x4ee6ec){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x36e9e0,_0x4ee6ec);_0x416999(_0x4ee6ec);});});}exports[_0x1f56('0x16')]=function(_0x1f7a66){var _0x1514c5=this;return new Promise(function(_0x2a6f87,_0x26168f){return db[_0x1f56('0x17')][_0x1f56('0x18')]({'raw':_0x1f7a66[_0x1f56('0x19')]?_0x1f7a66[_0x1f56('0x19')][_0x1f56('0x1a')]===undefined?!![]:![]:!![],'where':_0x1f7a66[_0x1f56('0x19')]?_0x1f7a66[_0x1f56('0x19')][_0x1f56('0x1b')]||null:null,'attributes':_0x1f7a66[_0x1f56('0x19')]?_0x1f7a66[_0x1f56('0x19')]['attributes']||null:null,'limit':_0x1f7a66[_0x1f56('0x19')]?_0x1f7a66['options']['limit']||null:null,'include':_0x1f7a66[_0x1f56('0x19')]?_0x1f7a66['options'][_0x1f56('0x1c')]?_['map'](_0x1f7a66[_0x1f56('0x19')][_0x1f56('0x1c')],function(_0x184f00){return{'model':db[_0x184f00['model']],'as':_0x184f00['as'],'attributes':_0x184f00[_0x1f56('0x1d')],'include':_0x184f00[_0x1f56('0x1c')]?_[_0x1f56('0x1e')](_0x184f00[_0x1f56('0x1c')],function(_0x2bff51){return{'model':db[_0x2bff51[_0x1f56('0x1f')]],'as':_0x2bff51['as'],'attributes':_0x2bff51[_0x1f56('0x1d')],'include':_0x2bff51[_0x1f56('0x1c')]?_[_0x1f56('0x1e')](_0x2bff51['include'],function(_0xcf682){return{'model':db[_0xcf682['model']],'as':_0xcf682['as'],'attributes':_0xcf682[_0x1f56('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1f56('0xb')](function(_0x7cc858){logger['info']('GetSalesforceAccount',_0x1f7a66);logger[_0x1f56('0x20')](_0x1f56('0x16'),_0x1f7a66,JSON['stringify'](_0x7cc858));_0x2a6f87(_0x7cc858);})[_0x1f56('0x15')](function(_0x5f3137){logger[_0x1f56('0x11')](_0x1f56('0x16'),_0x5f3137[_0x1f56('0x13')],_0x1f7a66);_0x26168f(_0x1514c5[_0x1f56('0x11')](0x1f4,_0x5f3137['message']));});});};exports[_0x1f56('0x21')]=function(_0x3aaf85){var _0x213425=this;return new Promise(function(_0x207b87,_0x5ab979){return db['SalesforceAccount'][_0x1f56('0x22')]({'raw':_0x3aaf85[_0x1f56('0x19')]?_0x3aaf85[_0x1f56('0x19')][_0x1f56('0x1a')]===undefined?!![]:![]:!![],'where':_0x3aaf85[_0x1f56('0x19')]?_0x3aaf85[_0x1f56('0x19')][_0x1f56('0x1b')]||null:null,'attributes':_0x3aaf85['options']?_0x3aaf85['options'][_0x1f56('0x1d')]||null:null,'include':_0x3aaf85[_0x1f56('0x19')]?_0x3aaf85[_0x1f56('0x19')][_0x1f56('0x1c')]?_[_0x1f56('0x1e')](_0x3aaf85[_0x1f56('0x19')][_0x1f56('0x1c')],function(_0x7d6254){return{'model':db[_0x7d6254['model']],'as':_0x7d6254['as'],'attributes':_0x7d6254[_0x1f56('0x1d')],'include':_0x7d6254['include']?_[_0x1f56('0x1e')](_0x7d6254[_0x1f56('0x1c')],function(_0x7d1f78){return{'model':db[_0x7d1f78[_0x1f56('0x1f')]],'as':_0x7d1f78['as'],'attributes':_0x7d1f78[_0x1f56('0x1d')],'include':_0x7d1f78['include']?_['map'](_0x7d1f78[_0x1f56('0x1c')],function(_0x51ea39){return{'model':db[_0x51ea39['model']],'as':_0x51ea39['as'],'attributes':_0x51ea39[_0x1f56('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1f56('0xb')](function(_0x270d21){logger[_0x1f56('0xc')](_0x1f56('0x21'),_0x3aaf85);logger[_0x1f56('0x20')](_0x1f56('0x21'),_0x3aaf85,JSON[_0x1f56('0x10')](_0x270d21));_0x207b87(_0x270d21);})[_0x1f56('0x15')](function(_0x5c3d0c){logger[_0x1f56('0x11')]('ShowSalesforceAccount',_0x5c3d0c[_0x1f56('0x13')],_0x3aaf85);_0x5ab979(_0x213425[_0x1f56('0x11')](0x1f4,_0x5c3d0c[_0x1f56('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 5d2bbe7..9268bc7 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 _0xadb5=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','util','connect-timeout','express'];(function(_0x4cfcc0,_0x45f078){var _0x2bbc8f=function(_0x321b19){while(--_0x321b19){_0x4cfcc0['push'](_0x4cfcc0['shift']());}};_0x2bbc8f(++_0x45f078);}(_0xadb5,0xad));var _0x5adb=function(_0x2d2d38,_0x76db63){_0x2d2d38=_0x2d2d38-0x0;var _0x30d37d=_0xadb5[_0x2d2d38];return _0x30d37d;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0x7')](_0x5adb('0xe'),auth[_0x5adb('0x8')](),controller['getSubjects']);router['get'](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x10')]);router['post']('/',auth[_0x5adb('0x8')](),controller['create']);router[_0x5adb('0x11')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x12')]);router[_0x5adb('0x13')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x14')]);module[_0x5adb('0x15')]=router; \ No newline at end of file +var _0xadb5=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','util','connect-timeout','express'];(function(_0x47ea8f,_0x189728){var _0x310b97=function(_0x206af9){while(--_0x206af9){_0x47ea8f['push'](_0x47ea8f['shift']());}};_0x310b97(++_0x189728);}(_0xadb5,0xad));var _0x5adb=function(_0x4b9acb,_0x563e22){_0x4b9acb=_0x4b9acb-0x0;var _0x46a818=_0xadb5[_0x4b9acb];return _0x46a818;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0x7')](_0x5adb('0xe'),auth[_0x5adb('0x8')](),controller['getSubjects']);router['get'](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x10')]);router['post']('/',auth[_0x5adb('0x8')](),controller['create']);router[_0x5adb('0x11')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x12')]);router[_0x5adb('0x13')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x14')]);module[_0x5adb('0x15')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 566f703..2e1cc9e 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 _0xb60c=['account','contact','sequelize','STRING','ENUM','Task','Case','contact_lead','lead','account_contact_lead'];(function(_0x28a9da,_0x42a724){var _0xcc9b8d=function(_0x5d1b35){while(--_0x5d1b35){_0x28a9da['push'](_0x28a9da['shift']());}};_0xcc9b8d(++_0x42a724);}(_0xb60c,0x142));var _0xcb60=function(_0x1c543a,_0x1666c8){_0x1c543a=_0x1c543a-0x0;var _0x9ed567=_0xb60c[_0x1c543a];return _0x9ed567;};'use strict';var Sequelize=require(_0xcb60('0x0'));module['exports']={'name':{'type':Sequelize[_0xcb60('0x1')]},'description':{'type':Sequelize[_0xcb60('0x1')]},'ticketType':{'type':Sequelize[_0xcb60('0x2')](_0xcb60('0x3'),_0xcb60('0x4')),'defaultValue':_0xcb60('0x3')},'moduleSearch':{'type':Sequelize[_0xcb60('0x2')](_0xcb60('0x5'),'contact',_0xcb60('0x6'),_0xcb60('0x7'),_0xcb60('0x8')),'defaultValue':_0xcb60('0x5')},'moduleCreate':{'type':Sequelize['ENUM']('nothing',_0xcb60('0x9'),_0xcb60('0x6'),_0xcb60('0x8')),'defaultValue':_0xcb60('0x6')},'leadId':{'type':Sequelize[_0xcb60('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0xcb60('0x1')]},'additionalSearchContact':{'type':Sequelize[_0xcb60('0x1')]},'additionalSearchLead':{'type':Sequelize[_0xcb60('0x1')]}}; \ No newline at end of file +var _0x83b4=['Task','Case','contact_lead','contact','lead','account_contact_lead','account','nothing','sequelize','STRING','ENUM'];(function(_0x163b5b,_0x102e0f){var _0x595123=function(_0x7d5c7e){while(--_0x7d5c7e){_0x163b5b['push'](_0x163b5b['shift']());}};_0x595123(++_0x102e0f);}(_0x83b4,0x126));var _0x483b=function(_0x1130fe,_0x5b9fc8){_0x1130fe=_0x1130fe-0x0;var _0x2fac41=_0x83b4[_0x1130fe];return _0x2fac41;};'use strict';var Sequelize=require(_0x483b('0x0'));module['exports']={'name':{'type':Sequelize[_0x483b('0x1')]},'description':{'type':Sequelize[_0x483b('0x1')]},'ticketType':{'type':Sequelize[_0x483b('0x2')](_0x483b('0x3'),_0x483b('0x4')),'defaultValue':_0x483b('0x3')},'moduleSearch':{'type':Sequelize[_0x483b('0x2')](_0x483b('0x5'),_0x483b('0x6'),_0x483b('0x7'),_0x483b('0x8'),_0x483b('0x9')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0x483b('0x2')](_0x483b('0xa'),_0x483b('0x6'),_0x483b('0x7'),_0x483b('0x9')),'defaultValue':_0x483b('0x7')},'leadId':{'type':Sequelize[_0x483b('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0x483b('0x1')]},'additionalSearchContact':{'type':Sequelize[_0x483b('0x1')]},'additionalSearchLead':{'type':Sequelize[_0x483b('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index a24b4af..a3f55c3 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 _0x9dd7=['ejs','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','end','status','json','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','include','findAll','catch','fields','includeAll','create','body','find','params','getFields','getSubjects','SalesforceField','findOne','getDescriptions','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv'];(function(_0x454018,_0x46e33a){var _0x24697d=function(_0x3ec647){while(--_0x3ec647){_0x454018['push'](_0x454018['shift']());}};_0x24697d(++_0x46e33a);}(_0x9dd7,0x195));var _0x79dd=function(_0x304bdc,_0x286784){_0x304bdc=_0x304bdc-0x0;var _0x514d41=_0x9dd7[_0x304bdc];return _0x514d41;};'use strict';var emlformat=require(_0x79dd('0x0'));var rimraf=require(_0x79dd('0x1'));var zipdir=require(_0x79dd('0x2'));var jsonpatch=require(_0x79dd('0x3'));var rp=require(_0x79dd('0x4'));var moment=require(_0x79dd('0x5'));var BPromise=require(_0x79dd('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x79dd('0x7'));var sox=require(_0x79dd('0x8'));var csv=require(_0x79dd('0x9'));var ejs=require(_0x79dd('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x79dd('0xb'));var crypto=require(_0x79dd('0xc'));var jsforce=require(_0x79dd('0xd'));var deskjs=require(_0x79dd('0xe'));var toCsv=require('to-csv');var querystring=require(_0x79dd('0xf'));var Papa=require(_0x79dd('0x10'));var Redis=require(_0x79dd('0x11'));var authService=require(_0x79dd('0x12'));var qs=require(_0x79dd('0x13'));var as=require(_0x79dd('0x14'));var hardwareService=require(_0x79dd('0x15'));var logger=require(_0x79dd('0x16'))(_0x79dd('0x17'));var utils=require(_0x79dd('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x79dd('0x19'));var db=require(_0x79dd('0x1a'))['db'];function respondWithStatusCode(_0x48cf30,_0x2fbe9b){_0x2fbe9b=_0x2fbe9b||0xcc;return function(_0x19d4c8){if(_0x19d4c8){return _0x48cf30['sendStatus'](_0x2fbe9b);}return _0x48cf30['status'](_0x2fbe9b)[_0x79dd('0x1b')]();};}function respondWithResult(_0xf2de63,_0x537c14){_0x537c14=_0x537c14||0xc8;return function(_0x3eb64d){if(_0x3eb64d){return _0xf2de63[_0x79dd('0x1c')](_0x537c14)[_0x79dd('0x1d')](_0x3eb64d);}};}function respondWithFilteredResult(_0x196bc2,_0x5eaf3b){return function(_0x53134a){if(_0x53134a){var _0x27ebff=typeof _0x5eaf3b['offset']==='undefined'&&typeof _0x5eaf3b[_0x79dd('0x1e')]==='undefined';var _0x42de0d=_0x53134a[_0x79dd('0x1f')];var _0x44eafd=_0x27ebff?0x0:_0x5eaf3b['offset'];var _0x56faa5=_0x27ebff?_0x53134a[_0x79dd('0x1f')]:_0x5eaf3b[_0x79dd('0x20')]+_0x5eaf3b[_0x79dd('0x1e')];var _0x35efb0;if(_0x56faa5>=_0x42de0d){_0x56faa5=_0x42de0d;_0x35efb0=0xc8;}else{_0x35efb0=0xce;}_0x196bc2[_0x79dd('0x1c')](_0x35efb0);return _0x196bc2[_0x79dd('0x21')](_0x79dd('0x22'),_0x44eafd+'-'+_0x56faa5+'/'+_0x42de0d)['json'](_0x53134a);}return null;};}function patchUpdates(_0x1910e2){return function(_0x18e3da){try{jsonpatch[_0x79dd('0x23')](_0x18e3da,_0x1910e2,!![]);}catch(_0x328b4d){return BPromise[_0x79dd('0x24')](_0x328b4d);}return _0x18e3da[_0x79dd('0x25')]();};}function saveUpdates(_0x40d641,_0x4c8cc5){return function(_0x4969f1){if(_0x4969f1){return _0x4969f1[_0x79dd('0x26')](_0x40d641)[_0x79dd('0x27')](function(_0x1134ac){return _0x1134ac;});}return null;};}function removeEntity(_0x2be99f,_0x208e5b){return function(_0x5187c0){if(_0x5187c0){return _0x5187c0[_0x79dd('0x28')]()['then'](function(){_0x2be99f[_0x79dd('0x1c')](0xcc)[_0x79dd('0x1b')]();});}};}function handleEntityNotFound(_0x4ad891,_0x25df39){return function(_0x10f28e){if(!_0x10f28e){_0x4ad891[_0x79dd('0x29')](0x194);}return _0x10f28e;};}function handleError(_0x2dbf2b,_0x58ad3b){_0x58ad3b=_0x58ad3b||0x1f4;return function(_0x364e31){logger[_0x79dd('0x2a')](_0x364e31[_0x79dd('0x2b')]);if(_0x364e31[_0x79dd('0x2c')]){delete _0x364e31[_0x79dd('0x2c')];}_0x2dbf2b['status'](_0x58ad3b)[_0x79dd('0x2d')](_0x364e31);};}exports[_0x79dd('0x2e')]=function(_0x24e983,_0x3c03ed){var _0x1b496d={},_0x35ec5e={},_0xa88aa={'count':0x0,'rows':[]};var _0x37b906=_[_0x79dd('0x2f')](db[_0x79dd('0x30')][_0x79dd('0x31')],function(_0x167580){return{'name':_0x167580[_0x79dd('0x32')],'type':_0x167580[_0x79dd('0x33')][_0x79dd('0x34')]};});_0x35ec5e[_0x79dd('0x35')]=_[_0x79dd('0x2f')](_0x37b906,'name');_0x35ec5e[_0x79dd('0x36')]=_[_0x79dd('0x37')](_0x24e983[_0x79dd('0x36')]);_0x35ec5e[_0x79dd('0x38')]=_[_0x79dd('0x39')](_0x35ec5e[_0x79dd('0x35')],_0x35ec5e[_0x79dd('0x36')]);_0x1b496d[_0x79dd('0x3a')]=_[_0x79dd('0x39')](_0x35ec5e['model'],qs['fields'](_0x24e983[_0x79dd('0x36')]['fields']));_0x1b496d[_0x79dd('0x3a')]=_0x1b496d[_0x79dd('0x3a')][_0x79dd('0x3b')]?_0x1b496d[_0x79dd('0x3a')]:_0x35ec5e['model'];if(!_0x24e983[_0x79dd('0x36')][_0x79dd('0x3c')]('nolimit')){_0x1b496d[_0x79dd('0x1e')]=qs['limit'](_0x24e983['query'][_0x79dd('0x1e')]);_0x1b496d[_0x79dd('0x20')]=qs['offset'](_0x24e983[_0x79dd('0x36')]['offset']);}_0x1b496d[_0x79dd('0x3d')]=qs[_0x79dd('0x3e')](_0x24e983['query'][_0x79dd('0x3e')]);_0x1b496d[_0x79dd('0x3f')]=qs[_0x79dd('0x38')](_[_0x79dd('0x40')](_0x24e983[_0x79dd('0x36')],_0x35ec5e[_0x79dd('0x38')]),_0x37b906);if(_0x24e983[_0x79dd('0x36')][_0x79dd('0x41')]){_0x1b496d[_0x79dd('0x3f')]=_[_0x79dd('0x42')](_0x1b496d[_0x79dd('0x3f')],{'$or':_['map'](_0x37b906,function(_0x262c23){if(_0x262c23[_0x79dd('0x33')]!=='VIRTUAL'){var _0x74f6e2={};_0x74f6e2[_0x262c23[_0x79dd('0x2c')]]={'$like':'%'+_0x24e983[_0x79dd('0x36')][_0x79dd('0x41')]+'%'};return _0x74f6e2;}})});}_0x1b496d=_[_0x79dd('0x42')]({},_0x1b496d,_0x24e983[_0x79dd('0x43')]);var _0x205155={'where':_0x1b496d['where']};return db[_0x79dd('0x30')][_0x79dd('0x1f')](_0x205155)[_0x79dd('0x27')](function(_0x4e9f9d){_0xa88aa[_0x79dd('0x1f')]=_0x4e9f9d;if(_0x24e983[_0x79dd('0x36')]['includeAll']){_0x1b496d[_0x79dd('0x44')]=[{'all':!![]}];}return db[_0x79dd('0x30')][_0x79dd('0x45')](_0x1b496d);})[_0x79dd('0x27')](function(_0x1e987f){_0xa88aa['rows']=_0x1e987f;return _0xa88aa;})[_0x79dd('0x27')](respondWithFilteredResult(_0x3c03ed,_0x1b496d))[_0x79dd('0x46')](handleError(_0x3c03ed,null));};exports['show']=function(_0x3fdeaf,_0x12fd02){var _0x4aa965={'raw':![],'where':{'id':_0x3fdeaf['params']['id']}},_0x25e52c={};_0x25e52c['model']=_['keys'](db[_0x79dd('0x30')][_0x79dd('0x31')]);_0x25e52c[_0x79dd('0x36')]=_[_0x79dd('0x37')](_0x3fdeaf['query']);_0x25e52c[_0x79dd('0x38')]=_[_0x79dd('0x39')](_0x25e52c['model'],_0x25e52c['query']);_0x4aa965['attributes']=_['intersection'](_0x25e52c[_0x79dd('0x35')],qs[_0x79dd('0x47')](_0x3fdeaf['query']['fields']));_0x4aa965[_0x79dd('0x3a')]=_0x4aa965['attributes']['length']?_0x4aa965[_0x79dd('0x3a')]:_0x25e52c[_0x79dd('0x35')];if(_0x3fdeaf['query'][_0x79dd('0x48')]){_0x4aa965[_0x79dd('0x44')]=[{'all':!![]}];}_0x4aa965=_[_0x79dd('0x42')]({},_0x4aa965,_0x3fdeaf[_0x79dd('0x43')]);return db[_0x79dd('0x30')]['find'](_0x4aa965)[_0x79dd('0x27')](handleEntityNotFound(_0x12fd02,null))['then'](respondWithResult(_0x12fd02,null))[_0x79dd('0x46')](handleError(_0x12fd02,null));};exports[_0x79dd('0x49')]=function(_0x270726,_0x5ca3a8){return db['SalesforceConfiguration'][_0x79dd('0x49')](_0x270726[_0x79dd('0x4a')],{})[_0x79dd('0x27')](respondWithResult(_0x5ca3a8,0xc9))[_0x79dd('0x46')](handleError(_0x5ca3a8,null));};exports['update']=function(_0x5830d8,_0x109450){if(_0x5830d8['body']['id']){delete _0x5830d8[_0x79dd('0x4a')]['id'];}return db[_0x79dd('0x30')][_0x79dd('0x4b')]({'where':{'id':_0x5830d8['params']['id']}})[_0x79dd('0x27')](handleEntityNotFound(_0x109450,null))[_0x79dd('0x27')](saveUpdates(_0x5830d8[_0x79dd('0x4a')],null))[_0x79dd('0x27')](respondWithResult(_0x109450,null))[_0x79dd('0x46')](handleError(_0x109450,null));};exports[_0x79dd('0x28')]=function(_0x3af6b9,_0x339747){return db['SalesforceConfiguration'][_0x79dd('0x4b')]({'where':{'id':_0x3af6b9['params']['id']}})[_0x79dd('0x27')](handleEntityNotFound(_0x339747,null))[_0x79dd('0x27')](removeEntity(_0x339747,null))[_0x79dd('0x46')](handleError(_0x339747,null));};exports['getFields']=function(_0x593dfc,_0x357849,_0x16528a){var _0x9ad092={};var _0x1b5e7c={};var _0xd861a0;var _0x505af9;return db[_0x79dd('0x30')]['findOne']({'where':{'id':_0x593dfc[_0x79dd('0x4c')]['id']}})[_0x79dd('0x27')](handleEntityNotFound(_0x357849,null))[_0x79dd('0x27')](function(_0x940db2){if(_0x940db2){_0xd861a0=_0x940db2;_0x1b5e7c[_0x79dd('0x35')]=_[_0x79dd('0x37')](db['SalesforceField'][_0x79dd('0x31')]);_0x1b5e7c[_0x79dd('0x36')]=_[_0x79dd('0x37')](_0x593dfc['query']);_0x1b5e7c['filters']=_[_0x79dd('0x39')](_0x1b5e7c[_0x79dd('0x35')],_0x1b5e7c[_0x79dd('0x36')]);_0x9ad092[_0x79dd('0x3a')]=_[_0x79dd('0x39')](_0x1b5e7c[_0x79dd('0x35')],qs[_0x79dd('0x47')](_0x593dfc[_0x79dd('0x36')][_0x79dd('0x47')]));_0x9ad092['attributes']=_0x9ad092['attributes']['length']?_0x9ad092[_0x79dd('0x3a')]:_0x1b5e7c[_0x79dd('0x35')];_0x9ad092['order']=qs[_0x79dd('0x3e')](_0x593dfc['query']['sort']);_0x9ad092[_0x79dd('0x3f')]=qs['filters'](_[_0x79dd('0x40')](_0x593dfc[_0x79dd('0x36')],_0x1b5e7c['filters']));if(_0x593dfc[_0x79dd('0x36')]['filter']){_0x9ad092[_0x79dd('0x3f')]=_[_0x79dd('0x42')](_0x9ad092['where'],{'$or':_['map'](_0x9ad092[_0x79dd('0x3a')],function(_0x434769){var _0x485ebf={};_0x485ebf[_0x434769]={'$like':'%'+_0x593dfc[_0x79dd('0x36')][_0x79dd('0x41')]+'%'};return _0x485ebf;})});}_0x9ad092=_[_0x79dd('0x42')]({},_0x9ad092,_0x593dfc[_0x79dd('0x43')]);return _0xd861a0['getFields'](_0x9ad092);}})['then'](function(_0x47cd9c){if(_0x47cd9c){_0x505af9=_0x47cd9c[_0x79dd('0x3b')];if(!_0x593dfc[_0x79dd('0x36')][_0x79dd('0x3c')]('nolimit')){_0x9ad092['limit']=qs['limit'](_0x593dfc[_0x79dd('0x36')][_0x79dd('0x1e')]);_0x9ad092['offset']=qs[_0x79dd('0x20')](_0x593dfc['query'][_0x79dd('0x20')]);}return _0xd861a0[_0x79dd('0x4d')](_0x9ad092);}})[_0x79dd('0x27')](function(_0x4ce89){if(_0x4ce89){return _0x4ce89?{'count':_0x505af9,'rows':_0x4ce89}:null;}})['then'](respondWithResult(_0x357849,null))[_0x79dd('0x46')](handleError(_0x357849,null));};exports[_0x79dd('0x4e')]=function(_0x4585c3,_0x29cec6,_0x10bfb6){var _0x385d99={};var _0x5a6978={};var _0x34bc70;var _0x352eda;return db[_0x79dd('0x30')]['findOne']({'where':{'id':_0x4585c3['params']['id']}})[_0x79dd('0x27')](handleEntityNotFound(_0x29cec6,null))[_0x79dd('0x27')](function(_0x47c073){if(_0x47c073){_0x34bc70=_0x47c073;_0x5a6978[_0x79dd('0x35')]=_['keys'](db[_0x79dd('0x4f')][_0x79dd('0x31')]);_0x5a6978[_0x79dd('0x36')]=_[_0x79dd('0x37')](_0x4585c3[_0x79dd('0x36')]);_0x5a6978[_0x79dd('0x38')]=_[_0x79dd('0x39')](_0x5a6978[_0x79dd('0x35')],_0x5a6978['query']);_0x385d99[_0x79dd('0x3a')]=_[_0x79dd('0x39')](_0x5a6978['model'],qs[_0x79dd('0x47')](_0x4585c3[_0x79dd('0x36')]['fields']));_0x385d99['attributes']=_0x385d99[_0x79dd('0x3a')][_0x79dd('0x3b')]?_0x385d99[_0x79dd('0x3a')]:_0x5a6978[_0x79dd('0x35')];_0x385d99[_0x79dd('0x3d')]=qs['sort'](_0x4585c3[_0x79dd('0x36')][_0x79dd('0x3e')]);_0x385d99['where']=qs['filters'](_[_0x79dd('0x40')](_0x4585c3['query'],_0x5a6978[_0x79dd('0x38')]));if(_0x4585c3[_0x79dd('0x36')][_0x79dd('0x41')]){_0x385d99[_0x79dd('0x3f')]=_['merge'](_0x385d99['where'],{'$or':_[_0x79dd('0x2f')](_0x385d99['attributes'],function(_0x42616e){var _0x1a30ed={};_0x1a30ed[_0x42616e]={'$like':'%'+_0x4585c3[_0x79dd('0x36')][_0x79dd('0x41')]+'%'};return _0x1a30ed;})});}_0x385d99=_[_0x79dd('0x42')]({},_0x385d99,_0x4585c3[_0x79dd('0x43')]);return _0x34bc70[_0x79dd('0x4e')](_0x385d99);}})['then'](function(_0x4864c6){if(_0x4864c6){_0x352eda=_0x4864c6[_0x79dd('0x3b')];if(!_0x4585c3[_0x79dd('0x36')][_0x79dd('0x3c')]('nolimit')){_0x385d99[_0x79dd('0x1e')]=qs[_0x79dd('0x1e')](_0x4585c3['query'][_0x79dd('0x1e')]);_0x385d99['offset']=qs[_0x79dd('0x20')](_0x4585c3['query'][_0x79dd('0x20')]);}return _0x34bc70['getSubjects'](_0x385d99);}})[_0x79dd('0x27')](function(_0x5d4d10){if(_0x5d4d10){return _0x5d4d10?{'count':_0x352eda,'rows':_0x5d4d10}:null;}})[_0x79dd('0x27')](respondWithResult(_0x29cec6,null))[_0x79dd('0x46')](handleError(_0x29cec6,null));};exports['getDescriptions']=function(_0x181fde,_0x14e49a,_0x362ad4){var _0x5d3ba6={};var _0x39b6c5={};var _0x311e9c;var _0x55c5cb;return db[_0x79dd('0x30')][_0x79dd('0x50')]({'where':{'id':_0x181fde[_0x79dd('0x4c')]['id']}})['then'](handleEntityNotFound(_0x14e49a,null))[_0x79dd('0x27')](function(_0x4261bc){if(_0x4261bc){_0x311e9c=_0x4261bc;_0x39b6c5[_0x79dd('0x35')]=_['keys'](db[_0x79dd('0x4f')]['rawAttributes']);_0x39b6c5[_0x79dd('0x36')]=_[_0x79dd('0x37')](_0x181fde['query']);_0x39b6c5[_0x79dd('0x38')]=_[_0x79dd('0x39')](_0x39b6c5['model'],_0x39b6c5[_0x79dd('0x36')]);_0x5d3ba6[_0x79dd('0x3a')]=_[_0x79dd('0x39')](_0x39b6c5[_0x79dd('0x35')],qs[_0x79dd('0x47')](_0x181fde[_0x79dd('0x36')][_0x79dd('0x47')]));_0x5d3ba6[_0x79dd('0x3a')]=_0x5d3ba6['attributes'][_0x79dd('0x3b')]?_0x5d3ba6[_0x79dd('0x3a')]:_0x39b6c5[_0x79dd('0x35')];_0x5d3ba6['order']=qs[_0x79dd('0x3e')](_0x181fde[_0x79dd('0x36')][_0x79dd('0x3e')]);_0x5d3ba6[_0x79dd('0x3f')]=qs[_0x79dd('0x38')](_[_0x79dd('0x40')](_0x181fde[_0x79dd('0x36')],_0x39b6c5[_0x79dd('0x38')]));if(_0x181fde[_0x79dd('0x36')]['filter']){_0x5d3ba6['where']=_[_0x79dd('0x42')](_0x5d3ba6['where'],{'$or':_['map'](_0x5d3ba6[_0x79dd('0x3a')],function(_0x4916fe){var _0x327021={};_0x327021[_0x4916fe]={'$like':'%'+_0x181fde['query'][_0x79dd('0x41')]+'%'};return _0x327021;})});}_0x5d3ba6=_[_0x79dd('0x42')]({},_0x5d3ba6,_0x181fde[_0x79dd('0x43')]);return _0x311e9c[_0x79dd('0x51')](_0x5d3ba6);}})[_0x79dd('0x27')](function(_0x5705bc){if(_0x5705bc){_0x55c5cb=_0x5705bc['length'];if(!_0x181fde[_0x79dd('0x36')][_0x79dd('0x3c')](_0x79dd('0x52'))){_0x5d3ba6[_0x79dd('0x1e')]=qs[_0x79dd('0x1e')](_0x181fde[_0x79dd('0x36')]['limit']);_0x5d3ba6[_0x79dd('0x20')]=qs[_0x79dd('0x20')](_0x181fde[_0x79dd('0x36')][_0x79dd('0x20')]);}return _0x311e9c['getDescriptions'](_0x5d3ba6);}})['then'](function(_0x3088e0){if(_0x3088e0){return _0x3088e0?{'count':_0x55c5cb,'rows':_0x3088e0}:null;}})[_0x79dd('0x27')](respondWithResult(_0x14e49a,null))[_0x79dd('0x46')](handleError(_0x14e49a,null));}; \ No newline at end of file +var _0xfc7b=['stack','name','send','map','SalesforceConfiguration','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','includeAll','include','rows','catch','show','params','length','options','find','create','body','getFields','findOne','SalesforceField','rawAttributes','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','status','end','undefined','limit','offset','count','set','json','apply','save','update','then','destroy','sendStatus'];(function(_0x24bc32,_0x50960f){var _0x5d9192=function(_0x3cfc2a){while(--_0x3cfc2a){_0x24bc32['push'](_0x24bc32['shift']());}};_0x5d9192(++_0x50960f);}(_0xfc7b,0xc1));var _0xbfc7=function(_0x59dc86,_0x34812a){_0x59dc86=_0x59dc86-0x0;var _0x37c79c=_0xfc7b[_0x59dc86];return _0x37c79c;};'use strict';var emlformat=require(_0xbfc7('0x0'));var rimraf=require(_0xbfc7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbfc7('0x2'));var rp=require(_0xbfc7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbfc7('0x4'));var util=require('util');var path=require(_0xbfc7('0x5'));var sox=require(_0xbfc7('0x6'));var csv=require(_0xbfc7('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbfc7('0x8'));var _=require(_0xbfc7('0x9'));var squel=require(_0xbfc7('0xa'));var crypto=require(_0xbfc7('0xb'));var jsforce=require(_0xbfc7('0xc'));var deskjs=require(_0xbfc7('0xd'));var toCsv=require(_0xbfc7('0x7'));var querystring=require('querystring');var Papa=require(_0xbfc7('0xe'));var Redis=require(_0xbfc7('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xbfc7('0x10'));var hardwareService=require(_0xbfc7('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xbfc7('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xbfc7('0x13'));var db=require(_0xbfc7('0x14'))['db'];function respondWithStatusCode(_0x392593,_0x193e17){_0x193e17=_0x193e17||0xcc;return function(_0x19d97c){if(_0x19d97c){return _0x392593['sendStatus'](_0x193e17);}return _0x392593[_0xbfc7('0x15')](_0x193e17)[_0xbfc7('0x16')]();};}function respondWithResult(_0x1d566b,_0x220486){_0x220486=_0x220486||0xc8;return function(_0x312729){if(_0x312729){return _0x1d566b[_0xbfc7('0x15')](_0x220486)['json'](_0x312729);}};}function respondWithFilteredResult(_0x11f812,_0x5b5c62){return function(_0x3fa8cc){if(_0x3fa8cc){var _0x3e763a=typeof _0x5b5c62['offset']===_0xbfc7('0x17')&&typeof _0x5b5c62[_0xbfc7('0x18')]===_0xbfc7('0x17');var _0x2f4e88=_0x3fa8cc['count'];var _0xfd2aec=_0x3e763a?0x0:_0x5b5c62[_0xbfc7('0x19')];var _0x5174f5=_0x3e763a?_0x3fa8cc[_0xbfc7('0x1a')]:_0x5b5c62[_0xbfc7('0x19')]+_0x5b5c62['limit'];var _0x48a04b;if(_0x5174f5>=_0x2f4e88){_0x5174f5=_0x2f4e88;_0x48a04b=0xc8;}else{_0x48a04b=0xce;}_0x11f812['status'](_0x48a04b);return _0x11f812[_0xbfc7('0x1b')]('Content-Range',_0xfd2aec+'-'+_0x5174f5+'/'+_0x2f4e88)[_0xbfc7('0x1c')](_0x3fa8cc);}return null;};}function patchUpdates(_0x5dc398){return function(_0x5a9bbd){try{jsonpatch[_0xbfc7('0x1d')](_0x5a9bbd,_0x5dc398,!![]);}catch(_0x370bd1){return BPromise['reject'](_0x370bd1);}return _0x5a9bbd[_0xbfc7('0x1e')]();};}function saveUpdates(_0x192dbf,_0x19da3b){return function(_0x1a24dc){if(_0x1a24dc){return _0x1a24dc[_0xbfc7('0x1f')](_0x192dbf)[_0xbfc7('0x20')](function(_0xc38e7a){return _0xc38e7a;});}return null;};}function removeEntity(_0x1a1829,_0x118d0a){return function(_0x2213ff){if(_0x2213ff){return _0x2213ff[_0xbfc7('0x21')]()[_0xbfc7('0x20')](function(){_0x1a1829['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xafa521,_0x54acc7){return function(_0x39804){if(!_0x39804){_0xafa521[_0xbfc7('0x22')](0x194);}return _0x39804;};}function handleError(_0x29a2ef,_0x440919){_0x440919=_0x440919||0x1f4;return function(_0x2d6588){logger['error'](_0x2d6588[_0xbfc7('0x23')]);if(_0x2d6588['name']){delete _0x2d6588[_0xbfc7('0x24')];}_0x29a2ef['status'](_0x440919)[_0xbfc7('0x25')](_0x2d6588);};}exports['index']=function(_0x31d2e0,_0x5cae2f){var _0x33714c={},_0x5bcf73={},_0x3dffba={'count':0x0,'rows':[]};var _0x3403ba=_[_0xbfc7('0x26')](db[_0xbfc7('0x27')]['rawAttributes'],function(_0x7c1ec2){return{'name':_0x7c1ec2[_0xbfc7('0x28')],'type':_0x7c1ec2['type'][_0xbfc7('0x29')]};});_0x5bcf73[_0xbfc7('0x2a')]=_['map'](_0x3403ba,_0xbfc7('0x24'));_0x5bcf73[_0xbfc7('0x2b')]=_[_0xbfc7('0x2c')](_0x31d2e0['query']);_0x5bcf73[_0xbfc7('0x2d')]=_[_0xbfc7('0x2e')](_0x5bcf73[_0xbfc7('0x2a')],_0x5bcf73[_0xbfc7('0x2b')]);_0x33714c[_0xbfc7('0x2f')]=_['intersection'](_0x5bcf73[_0xbfc7('0x2a')],qs[_0xbfc7('0x30')](_0x31d2e0[_0xbfc7('0x2b')][_0xbfc7('0x30')]));_0x33714c['attributes']=_0x33714c['attributes']['length']?_0x33714c['attributes']:_0x5bcf73[_0xbfc7('0x2a')];if(!_0x31d2e0[_0xbfc7('0x2b')][_0xbfc7('0x31')](_0xbfc7('0x32'))){_0x33714c[_0xbfc7('0x18')]=qs[_0xbfc7('0x18')](_0x31d2e0['query'][_0xbfc7('0x18')]);_0x33714c[_0xbfc7('0x19')]=qs['offset'](_0x31d2e0['query'][_0xbfc7('0x19')]);}_0x33714c[_0xbfc7('0x33')]=qs[_0xbfc7('0x34')](_0x31d2e0[_0xbfc7('0x2b')][_0xbfc7('0x34')]);_0x33714c[_0xbfc7('0x35')]=qs[_0xbfc7('0x2d')](_[_0xbfc7('0x36')](_0x31d2e0['query'],_0x5bcf73[_0xbfc7('0x2d')]),_0x3403ba);if(_0x31d2e0[_0xbfc7('0x2b')][_0xbfc7('0x37')]){_0x33714c[_0xbfc7('0x35')]=_['merge'](_0x33714c[_0xbfc7('0x35')],{'$or':_[_0xbfc7('0x26')](_0x3403ba,function(_0x33b057){if(_0x33b057[_0xbfc7('0x38')]!==_0xbfc7('0x39')){var _0x9441c0={};_0x9441c0[_0x33b057[_0xbfc7('0x24')]]={'$like':'%'+_0x31d2e0['query'][_0xbfc7('0x37')]+'%'};return _0x9441c0;}})});}_0x33714c=_[_0xbfc7('0x3a')]({},_0x33714c,_0x31d2e0['options']);var _0x48d289={'where':_0x33714c[_0xbfc7('0x35')]};return db[_0xbfc7('0x27')]['count'](_0x48d289)['then'](function(_0x48bbe0){_0x3dffba[_0xbfc7('0x1a')]=_0x48bbe0;if(_0x31d2e0['query'][_0xbfc7('0x3b')]){_0x33714c[_0xbfc7('0x3c')]=[{'all':!![]}];}return db[_0xbfc7('0x27')]['findAll'](_0x33714c);})['then'](function(_0x56fe8c){_0x3dffba[_0xbfc7('0x3d')]=_0x56fe8c;return _0x3dffba;})[_0xbfc7('0x20')](respondWithFilteredResult(_0x5cae2f,_0x33714c))[_0xbfc7('0x3e')](handleError(_0x5cae2f,null));};exports[_0xbfc7('0x3f')]=function(_0xc2d13,_0x1c3b8e){var _0x253cd7={'raw':![],'where':{'id':_0xc2d13[_0xbfc7('0x40')]['id']}},_0xea2df1={};_0xea2df1[_0xbfc7('0x2a')]=_[_0xbfc7('0x2c')](db[_0xbfc7('0x27')]['rawAttributes']);_0xea2df1[_0xbfc7('0x2b')]=_[_0xbfc7('0x2c')](_0xc2d13['query']);_0xea2df1[_0xbfc7('0x2d')]=_[_0xbfc7('0x2e')](_0xea2df1[_0xbfc7('0x2a')],_0xea2df1[_0xbfc7('0x2b')]);_0x253cd7[_0xbfc7('0x2f')]=_[_0xbfc7('0x2e')](_0xea2df1[_0xbfc7('0x2a')],qs[_0xbfc7('0x30')](_0xc2d13[_0xbfc7('0x2b')][_0xbfc7('0x30')]));_0x253cd7[_0xbfc7('0x2f')]=_0x253cd7['attributes'][_0xbfc7('0x41')]?_0x253cd7[_0xbfc7('0x2f')]:_0xea2df1['model'];if(_0xc2d13[_0xbfc7('0x2b')][_0xbfc7('0x3b')]){_0x253cd7[_0xbfc7('0x3c')]=[{'all':!![]}];}_0x253cd7=_['merge']({},_0x253cd7,_0xc2d13[_0xbfc7('0x42')]);return db['SalesforceConfiguration'][_0xbfc7('0x43')](_0x253cd7)[_0xbfc7('0x20')](handleEntityNotFound(_0x1c3b8e,null))['then'](respondWithResult(_0x1c3b8e,null))[_0xbfc7('0x3e')](handleError(_0x1c3b8e,null));};exports[_0xbfc7('0x44')]=function(_0x322924,_0x252525){return db[_0xbfc7('0x27')]['create'](_0x322924['body'],{})[_0xbfc7('0x20')](respondWithResult(_0x252525,0xc9))[_0xbfc7('0x3e')](handleError(_0x252525,null));};exports[_0xbfc7('0x1f')]=function(_0x4f6594,_0xfc1544){if(_0x4f6594[_0xbfc7('0x45')]['id']){delete _0x4f6594['body']['id'];}return db['SalesforceConfiguration'][_0xbfc7('0x43')]({'where':{'id':_0x4f6594['params']['id']}})[_0xbfc7('0x20')](handleEntityNotFound(_0xfc1544,null))[_0xbfc7('0x20')](saveUpdates(_0x4f6594[_0xbfc7('0x45')],null))[_0xbfc7('0x20')](respondWithResult(_0xfc1544,null))[_0xbfc7('0x3e')](handleError(_0xfc1544,null));};exports[_0xbfc7('0x21')]=function(_0x31c5de,_0x1b73ae){return db[_0xbfc7('0x27')][_0xbfc7('0x43')]({'where':{'id':_0x31c5de[_0xbfc7('0x40')]['id']}})[_0xbfc7('0x20')](handleEntityNotFound(_0x1b73ae,null))[_0xbfc7('0x20')](removeEntity(_0x1b73ae,null))['catch'](handleError(_0x1b73ae,null));};exports[_0xbfc7('0x46')]=function(_0x5dbd65,_0x38eea3,_0x4c66ab){var _0x64f2c8={};var _0x3c7803={};var _0x3d5975;var _0x4807ee;return db[_0xbfc7('0x27')][_0xbfc7('0x47')]({'where':{'id':_0x5dbd65[_0xbfc7('0x40')]['id']}})['then'](handleEntityNotFound(_0x38eea3,null))['then'](function(_0x4628c2){if(_0x4628c2){_0x3d5975=_0x4628c2;_0x3c7803['model']=_[_0xbfc7('0x2c')](db[_0xbfc7('0x48')][_0xbfc7('0x49')]);_0x3c7803['query']=_[_0xbfc7('0x2c')](_0x5dbd65[_0xbfc7('0x2b')]);_0x3c7803[_0xbfc7('0x2d')]=_[_0xbfc7('0x2e')](_0x3c7803[_0xbfc7('0x2a')],_0x3c7803['query']);_0x64f2c8[_0xbfc7('0x2f')]=_[_0xbfc7('0x2e')](_0x3c7803[_0xbfc7('0x2a')],qs['fields'](_0x5dbd65[_0xbfc7('0x2b')]['fields']));_0x64f2c8[_0xbfc7('0x2f')]=_0x64f2c8['attributes'][_0xbfc7('0x41')]?_0x64f2c8[_0xbfc7('0x2f')]:_0x3c7803[_0xbfc7('0x2a')];_0x64f2c8[_0xbfc7('0x33')]=qs[_0xbfc7('0x34')](_0x5dbd65['query'][_0xbfc7('0x34')]);_0x64f2c8[_0xbfc7('0x35')]=qs[_0xbfc7('0x2d')](_[_0xbfc7('0x36')](_0x5dbd65[_0xbfc7('0x2b')],_0x3c7803[_0xbfc7('0x2d')]));if(_0x5dbd65[_0xbfc7('0x2b')][_0xbfc7('0x37')]){_0x64f2c8['where']=_[_0xbfc7('0x3a')](_0x64f2c8[_0xbfc7('0x35')],{'$or':_[_0xbfc7('0x26')](_0x64f2c8[_0xbfc7('0x2f')],function(_0x5dad85){var _0x2c5bcc={};_0x2c5bcc[_0x5dad85]={'$like':'%'+_0x5dbd65[_0xbfc7('0x2b')][_0xbfc7('0x37')]+'%'};return _0x2c5bcc;})});}_0x64f2c8=_[_0xbfc7('0x3a')]({},_0x64f2c8,_0x5dbd65[_0xbfc7('0x42')]);return _0x3d5975[_0xbfc7('0x46')](_0x64f2c8);}})['then'](function(_0x40efa3){if(_0x40efa3){_0x4807ee=_0x40efa3['length'];if(!_0x5dbd65[_0xbfc7('0x2b')][_0xbfc7('0x31')]('nolimit')){_0x64f2c8[_0xbfc7('0x18')]=qs[_0xbfc7('0x18')](_0x5dbd65[_0xbfc7('0x2b')][_0xbfc7('0x18')]);_0x64f2c8[_0xbfc7('0x19')]=qs[_0xbfc7('0x19')](_0x5dbd65[_0xbfc7('0x2b')]['offset']);}return _0x3d5975[_0xbfc7('0x46')](_0x64f2c8);}})[_0xbfc7('0x20')](function(_0x220998){if(_0x220998){return _0x220998?{'count':_0x4807ee,'rows':_0x220998}:null;}})[_0xbfc7('0x20')](respondWithResult(_0x38eea3,null))[_0xbfc7('0x3e')](handleError(_0x38eea3,null));};exports[_0xbfc7('0x4a')]=function(_0x1bde5f,_0x420f77,_0x5749e6){var _0x2c5f6c={};var _0x442c58={};var _0x87dca4;var _0x197939;return db[_0xbfc7('0x27')][_0xbfc7('0x47')]({'where':{'id':_0x1bde5f[_0xbfc7('0x40')]['id']}})[_0xbfc7('0x20')](handleEntityNotFound(_0x420f77,null))['then'](function(_0x17984b){if(_0x17984b){_0x87dca4=_0x17984b;_0x442c58[_0xbfc7('0x2a')]=_[_0xbfc7('0x2c')](db[_0xbfc7('0x48')][_0xbfc7('0x49')]);_0x442c58[_0xbfc7('0x2b')]=_['keys'](_0x1bde5f[_0xbfc7('0x2b')]);_0x442c58[_0xbfc7('0x2d')]=_[_0xbfc7('0x2e')](_0x442c58['model'],_0x442c58[_0xbfc7('0x2b')]);_0x2c5f6c[_0xbfc7('0x2f')]=_[_0xbfc7('0x2e')](_0x442c58[_0xbfc7('0x2a')],qs[_0xbfc7('0x30')](_0x1bde5f[_0xbfc7('0x2b')][_0xbfc7('0x30')]));_0x2c5f6c[_0xbfc7('0x2f')]=_0x2c5f6c[_0xbfc7('0x2f')]['length']?_0x2c5f6c['attributes']:_0x442c58[_0xbfc7('0x2a')];_0x2c5f6c[_0xbfc7('0x33')]=qs['sort'](_0x1bde5f[_0xbfc7('0x2b')][_0xbfc7('0x34')]);_0x2c5f6c[_0xbfc7('0x35')]=qs['filters'](_[_0xbfc7('0x36')](_0x1bde5f[_0xbfc7('0x2b')],_0x442c58[_0xbfc7('0x2d')]));if(_0x1bde5f['query']['filter']){_0x2c5f6c[_0xbfc7('0x35')]=_[_0xbfc7('0x3a')](_0x2c5f6c[_0xbfc7('0x35')],{'$or':_[_0xbfc7('0x26')](_0x2c5f6c[_0xbfc7('0x2f')],function(_0xca47c6){var _0x8efb1c={};_0x8efb1c[_0xca47c6]={'$like':'%'+_0x1bde5f[_0xbfc7('0x2b')][_0xbfc7('0x37')]+'%'};return _0x8efb1c;})});}_0x2c5f6c=_[_0xbfc7('0x3a')]({},_0x2c5f6c,_0x1bde5f[_0xbfc7('0x42')]);return _0x87dca4[_0xbfc7('0x4a')](_0x2c5f6c);}})[_0xbfc7('0x20')](function(_0x20a490){if(_0x20a490){_0x197939=_0x20a490[_0xbfc7('0x41')];if(!_0x1bde5f['query'][_0xbfc7('0x31')](_0xbfc7('0x32'))){_0x2c5f6c[_0xbfc7('0x18')]=qs[_0xbfc7('0x18')](_0x1bde5f['query'][_0xbfc7('0x18')]);_0x2c5f6c[_0xbfc7('0x19')]=qs[_0xbfc7('0x19')](_0x1bde5f['query'][_0xbfc7('0x19')]);}return _0x87dca4[_0xbfc7('0x4a')](_0x2c5f6c);}})[_0xbfc7('0x20')](function(_0x9f668a){if(_0x9f668a){return _0x9f668a?{'count':_0x197939,'rows':_0x9f668a}:null;}})[_0xbfc7('0x20')](respondWithResult(_0x420f77,null))[_0xbfc7('0x3e')](handleError(_0x420f77,null));};exports[_0xbfc7('0x4b')]=function(_0x6323f5,_0x592d5b,_0x503105){var _0x1b4a51={};var _0xd4e874={};var _0x3c1f1b;var _0x236b3e;return db[_0xbfc7('0x27')][_0xbfc7('0x47')]({'where':{'id':_0x6323f5['params']['id']}})[_0xbfc7('0x20')](handleEntityNotFound(_0x592d5b,null))[_0xbfc7('0x20')](function(_0x36dc84){if(_0x36dc84){_0x3c1f1b=_0x36dc84;_0xd4e874[_0xbfc7('0x2a')]=_[_0xbfc7('0x2c')](db[_0xbfc7('0x48')]['rawAttributes']);_0xd4e874['query']=_['keys'](_0x6323f5[_0xbfc7('0x2b')]);_0xd4e874[_0xbfc7('0x2d')]=_['intersection'](_0xd4e874['model'],_0xd4e874[_0xbfc7('0x2b')]);_0x1b4a51['attributes']=_[_0xbfc7('0x2e')](_0xd4e874[_0xbfc7('0x2a')],qs[_0xbfc7('0x30')](_0x6323f5[_0xbfc7('0x2b')][_0xbfc7('0x30')]));_0x1b4a51['attributes']=_0x1b4a51[_0xbfc7('0x2f')][_0xbfc7('0x41')]?_0x1b4a51[_0xbfc7('0x2f')]:_0xd4e874[_0xbfc7('0x2a')];_0x1b4a51[_0xbfc7('0x33')]=qs[_0xbfc7('0x34')](_0x6323f5[_0xbfc7('0x2b')][_0xbfc7('0x34')]);_0x1b4a51[_0xbfc7('0x35')]=qs[_0xbfc7('0x2d')](_[_0xbfc7('0x36')](_0x6323f5[_0xbfc7('0x2b')],_0xd4e874[_0xbfc7('0x2d')]));if(_0x6323f5[_0xbfc7('0x2b')][_0xbfc7('0x37')]){_0x1b4a51[_0xbfc7('0x35')]=_[_0xbfc7('0x3a')](_0x1b4a51[_0xbfc7('0x35')],{'$or':_[_0xbfc7('0x26')](_0x1b4a51[_0xbfc7('0x2f')],function(_0x2582e3){var _0x2ab796={};_0x2ab796[_0x2582e3]={'$like':'%'+_0x6323f5[_0xbfc7('0x2b')]['filter']+'%'};return _0x2ab796;})});}_0x1b4a51=_[_0xbfc7('0x3a')]({},_0x1b4a51,_0x6323f5['options']);return _0x3c1f1b[_0xbfc7('0x4b')](_0x1b4a51);}})[_0xbfc7('0x20')](function(_0x217e42){if(_0x217e42){_0x236b3e=_0x217e42[_0xbfc7('0x41')];if(!_0x6323f5[_0xbfc7('0x2b')]['hasOwnProperty'](_0xbfc7('0x32'))){_0x1b4a51['limit']=qs[_0xbfc7('0x18')](_0x6323f5[_0xbfc7('0x2b')][_0xbfc7('0x18')]);_0x1b4a51[_0xbfc7('0x19')]=qs[_0xbfc7('0x19')](_0x6323f5[_0xbfc7('0x2b')][_0xbfc7('0x19')]);}return _0x3c1f1b[_0xbfc7('0x4b')](_0x1b4a51);}})[_0xbfc7('0x20')](function(_0x4faf9b){if(_0x4faf9b){return _0x4faf9b?{'count':_0x236b3e,'rows':_0x4faf9b}:null;}})[_0xbfc7('0x20')](respondWithResult(_0x592d5b,null))[_0xbfc7('0x3e')](handleError(_0x592d5b,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index a040b1c..68291e8 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 _0xa79c=['bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','lodash','util','moment'];(function(_0x2fb87c,_0x2dee49){var _0x43038b=function(_0x7e5396){while(--_0x7e5396){_0x2fb87c['push'](_0x2fb87c['shift']());}};_0x43038b(++_0x2dee49);}(_0xa79c,0x195));var _0xca79=function(_0x165b1a,_0xc3e9d){_0x165b1a=_0x165b1a-0x0;var _0x5e979f=_0xa79c[_0x165b1a];return _0x5e979f;};'use strict';var _=require(_0xca79('0x0'));var util=require(_0xca79('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xca79('0x2'));var BPromise=require(_0xca79('0x3'));var rp=require(_0xca79('0x4'));var fs=require('fs');var path=require(_0xca79('0x5'));var rimraf=require(_0xca79('0x6'));var config=require(_0xca79('0x7'));var attributes=require(_0xca79('0x8'));module[_0xca79('0x9')]=function(_0x2bc882,_0x108136){return _0x2bc882[_0xca79('0xa')](_0xca79('0xb'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6c3e=['SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intSalesforceConfiguration.attributes','exports'];(function(_0x449a07,_0x3bd057){var _0x377ba9=function(_0x4eaffb){while(--_0x4eaffb){_0x449a07['push'](_0x449a07['shift']());}};_0x377ba9(++_0x3bd057);}(_0x6c3e,0x1a2));var _0xe6c3=function(_0x30afe3,_0x530f16){_0x30afe3=_0x30afe3-0x0;var _0x491937=_0x6c3e[_0x30afe3];return _0x491937;};'use strict';var _=require(_0xe6c3('0x0'));var util=require(_0xe6c3('0x1'));var logger=require(_0xe6c3('0x2'))(_0xe6c3('0x3'));var moment=require(_0xe6c3('0x4'));var BPromise=require(_0xe6c3('0x5'));var rp=require(_0xe6c3('0x6'));var fs=require('fs');var path=require(_0xe6c3('0x7'));var rimraf=require(_0xe6c3('0x8'));var config=require('../../config/environment');var attributes=require(_0xe6c3('0x9'));module[_0xe6c3('0xa')]=function(_0x1bda61,_0x40bd80){return _0x1bda61['define'](_0xe6c3('0xb'),attributes,{'tableName':_0xe6c3('0xc'),'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 66c1ec2..a17c7c2 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 _0x780d=['jayson/promise','client','http','request','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x41c35f,_0x48c5d0){var _0x15deae=function(_0x1b98b7){while(--_0x1b98b7){_0x41c35f['push'](_0x41c35f['shift']());}};_0x15deae(++_0x48c5d0);}(_0x780d,0x76));var _0xd780=function(_0x3eb7c4,_0x33127c){_0x3eb7c4=_0x3eb7c4-0x0;var _0x4fd396=_0x780d[_0x3eb7c4];return _0x4fd396;};'use strict';var _=require(_0xd780('0x0'));var util=require('util');var moment=require(_0xd780('0x1'));var BPromise=require('bluebird');var rs=require(_0xd780('0x2'));var fs=require('fs');var Redis=require(_0xd780('0x3'));var db=require(_0xd780('0x4'))['db'];var utils=require(_0xd780('0x5'));var logger=require('../../config/logger')(_0xd780('0x6'));var config=require(_0xd780('0x7'));var jayson=require(_0xd780('0x8'));var client=jayson[_0xd780('0x9')][_0xd780('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x239d37,_0x317451,_0x1ab513){return new BPromise(function(_0x19c04e,_0x2fabb1){return client[_0xd780('0xb')](_0x239d37,_0x1ab513)['then'](function(_0xeb8988){logger['info'](_0xd780('0xc'),_0x317451,_0xd780('0xd'));logger[_0xd780('0xe')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x317451,'request\x20sent',JSON[_0xd780('0xf')](_0xeb8988));if(_0xeb8988['error']){if(_0xeb8988[_0xd780('0x10')][_0xd780('0x11')]===0x1f4){logger[_0xd780('0x10')](_0xd780('0xc'),_0x317451,_0xeb8988[_0xd780('0x10')][_0xd780('0x12')]);return _0x2fabb1(_0xeb8988[_0xd780('0x10')][_0xd780('0x12')]);}logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x317451,_0xeb8988['error'][_0xd780('0x12')]);return _0x19c04e(_0xeb8988[_0xd780('0x10')][_0xd780('0x12')]);}else{logger[_0xd780('0x13')](_0xd780('0xc'),_0x317451,_0xd780('0xd'));_0x19c04e(_0xeb8988['result']['message']);}})[_0xd780('0x14')](function(_0x4cc557){logger[_0xd780('0x10')](_0xd780('0xc'),_0x317451,_0x4cc557);_0x2fabb1(_0x4cc557);});});} \ No newline at end of file +var _0x2d44=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util'];(function(_0x4ad6d0,_0x360eaf){var _0x2d78ff=function(_0x8cf197){while(--_0x8cf197){_0x4ad6d0['push'](_0x4ad6d0['shift']());}};_0x2d78ff(++_0x360eaf);}(_0x2d44,0x1e2));var _0x42d4=function(_0x307f89,_0x19b0b0){_0x307f89=_0x307f89-0x0;var _0x657065=_0x2d44[_0x307f89];return _0x657065;};'use strict';var _=require(_0x42d4('0x0'));var util=require(_0x42d4('0x1'));var moment=require(_0x42d4('0x2'));var BPromise=require(_0x42d4('0x3'));var rs=require(_0x42d4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x42d4('0x5'))['db'];var utils=require(_0x42d4('0x6'));var logger=require(_0x42d4('0x7'))(_0x42d4('0x8'));var config=require(_0x42d4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x42d4('0xa')][_0x42d4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x25626c,_0x4485e2,_0x45f402){return new BPromise(function(_0x5880e5,_0x120d2f){return client['request'](_0x25626c,_0x45f402)[_0x42d4('0xc')](function(_0x3412bc){logger[_0x42d4('0xd')](_0x42d4('0xe'),_0x4485e2,_0x42d4('0xf'));logger[_0x42d4('0x10')](_0x42d4('0x11'),_0x4485e2,_0x42d4('0xf'),JSON['stringify'](_0x3412bc));if(_0x3412bc[_0x42d4('0x12')]){if(_0x3412bc[_0x42d4('0x12')][_0x42d4('0x13')]===0x1f4){logger[_0x42d4('0x12')](_0x42d4('0xe'),_0x4485e2,_0x3412bc[_0x42d4('0x12')][_0x42d4('0x14')]);return _0x120d2f(_0x3412bc[_0x42d4('0x12')][_0x42d4('0x14')]);}logger[_0x42d4('0x12')](_0x42d4('0xe'),_0x4485e2,_0x3412bc['error']['message']);return _0x5880e5(_0x3412bc['error']['message']);}else{logger[_0x42d4('0xd')](_0x42d4('0xe'),_0x4485e2,_0x42d4('0xf'));_0x5880e5(_0x3412bc['result'][_0x42d4('0x14')]);}})[_0x42d4('0x15')](function(_0x52220a){logger['error'](_0x42d4('0xe'),_0x4485e2,_0x52220a);_0x120d2f(_0x52220a);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index d5003f0..d1c900c 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 _0x943d=['get','isAuthenticated','index','post','create','put','/:id','update','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intSalesforceField.controller'];(function(_0x104c1e,_0xc9c278){var _0x2c92a7=function(_0x57363c){while(--_0x57363c){_0x104c1e['push'](_0x104c1e['shift']());}};_0x2c92a7(++_0xc9c278);}(_0x943d,0xd6));var _0xd943=function(_0x38af48,_0x400460){_0x38af48=_0x38af48-0x0;var _0x445384=_0x943d[_0x38af48];return _0x445384;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd943('0x0'));var timeout=require(_0xd943('0x1'));var express=require('express');var router=express[_0xd943('0x2')]();var fs_extra=require(_0xd943('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xd943('0x4'));var config=require(_0xd943('0x5'));var controller=require(_0xd943('0x6'));router[_0xd943('0x7')]('/',auth[_0xd943('0x8')](),controller[_0xd943('0x9')]);router[_0xd943('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xd943('0xa')]('/',auth[_0xd943('0x8')](),controller[_0xd943('0xb')]);router[_0xd943('0xc')](_0xd943('0xd'),auth[_0xd943('0x8')](),controller[_0xd943('0xe')]);router['delete']('/:id',auth[_0xd943('0x8')](),controller[_0xd943('0xf')]);module[_0xd943('0x10')]=router; \ No newline at end of file +var _0x98f1=['post','create','/:id','delete','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceField.controller','get','index','isAuthenticated','show'];(function(_0x2d8c99,_0x32ce92){var _0x1b4826=function(_0x38cc7e){while(--_0x38cc7e){_0x2d8c99['push'](_0x2d8c99['shift']());}};_0x1b4826(++_0x32ce92);}(_0x98f1,0xb5));var _0x198f=function(_0x4737a0,_0x36520e){_0x4737a0=_0x4737a0-0x0;var _0x4d558b=_0x98f1[_0x4737a0];return _0x4d558b;};'use strict';var multer=require('multer');var util=require(_0x198f('0x0'));var path=require(_0x198f('0x1'));var timeout=require('connect-timeout');var express=require(_0x198f('0x2'));var router=express[_0x198f('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x198f('0x4'));var interaction=require(_0x198f('0x5'));var config=require('../../config/environment');var controller=require(_0x198f('0x6'));router[_0x198f('0x7')]('/',auth['isAuthenticated'](),controller[_0x198f('0x8')]);router['get']('/:id',auth[_0x198f('0x9')](),controller[_0x198f('0xa')]);router[_0x198f('0xb')]('/',auth[_0x198f('0x9')](),controller[_0x198f('0xc')]);router['put'](_0x198f('0xd'),auth[_0x198f('0x9')](),controller['update']);router[_0x198f('0xe')](_0x198f('0xd'),auth[_0x198f('0x9')](),controller['destroy']);module[_0x198f('0xf')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 50193d3..0f523fa 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 _0xa50f=['variable','keyValue','picklist','STRING','ENUM','string'];(function(_0x69a451,_0x49fd37){var _0x3d6ef5=function(_0x27ebf4){while(--_0x27ebf4){_0x69a451['push'](_0x69a451['shift']());}};_0x3d6ef5(++_0x49fd37);}(_0xa50f,0xa7));var _0xfa50=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xa50f[_0x126558];return _0x1f6d14;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM'](_0xfa50('0x0'),_0xfa50('0x1'),'customVariable',_0xfa50('0x2'),_0xfa50('0x3')),'defaultValue':_0xfa50('0x0')},'content':{'type':Sequelize[_0xfa50('0x4')]},'key':{'type':Sequelize[_0xfa50('0x4')]},'keyType':{'type':Sequelize[_0xfa50('0x5')](_0xfa50('0x0'),_0xfa50('0x1'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xfa50('0x4')]},'variableName':{'type':Sequelize[_0xfa50('0x4')]}}; \ No newline at end of file +var _0xc496=['sequelize','exports','ENUM','string','variable','keyValue','picklist','STRING','customVariable'];(function(_0x58abec,_0xad6867){var _0x7648a2=function(_0x36cc5d){while(--_0x36cc5d){_0x58abec['push'](_0x58abec['shift']());}};_0x7648a2(++_0xad6867);}(_0xc496,0xe1));var _0x6c49=function(_0x4c9f6a,_0xcb2cb2){_0x4c9f6a=_0x4c9f6a-0x0;var _0x5df5b9=_0xc496[_0x4c9f6a];return _0x5df5b9;};'use strict';var Sequelize=require(_0x6c49('0x0'));module[_0x6c49('0x1')]={'type':{'type':Sequelize[_0x6c49('0x2')](_0x6c49('0x3'),_0x6c49('0x4'),'customVariable',_0x6c49('0x5'),_0x6c49('0x6')),'defaultValue':_0x6c49('0x3')},'content':{'type':Sequelize[_0x6c49('0x7')]},'key':{'type':Sequelize[_0x6c49('0x7')]},'keyType':{'type':Sequelize[_0x6c49('0x2')](_0x6c49('0x3'),_0x6c49('0x4'),_0x6c49('0x8'))},'keyContent':{'type':Sequelize[_0x6c49('0x7')]},'idField':{'type':Sequelize[_0x6c49('0x7')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 76439b7..bcd5103 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 _0xdb4c=['status','set','Content-Range','json','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','SalesforceField','rawAttributes','fieldName','type','key','query','keys','filters','model','intersection','fields','attributes','length','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','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/environment','../../config/license/util','end','offset','limit','undefined','count'];(function(_0x5a7d6d,_0xd9f4c6){var _0x830b1f=function(_0x47510f){while(--_0x47510f){_0x5a7d6d['push'](_0x5a7d6d['shift']());}};_0x830b1f(++_0xd9f4c6);}(_0xdb4c,0x15d));var _0xcdb4=function(_0x557537,_0x20b3b2){_0x557537=_0x557537-0x0;var _0x1f29b9=_0xdb4c[_0x557537];return _0x1f29b9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcdb4('0x0'));var zipdir=require(_0xcdb4('0x1'));var jsonpatch=require(_0xcdb4('0x2'));var rp=require('request-promise');var moment=require(_0xcdb4('0x3'));var BPromise=require(_0xcdb4('0x4'));var Mustache=require(_0xcdb4('0x5'));var util=require(_0xcdb4('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xcdb4('0x7'));var ejs=require(_0xcdb4('0x8'));var fs=require('fs');var fs_extra=require(_0xcdb4('0x9'));var _=require(_0xcdb4('0xa'));var squel=require(_0xcdb4('0xb'));var crypto=require(_0xcdb4('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xcdb4('0xd'));var toCsv=require(_0xcdb4('0x7'));var querystring=require(_0xcdb4('0xe'));var Papa=require(_0xcdb4('0xf'));var Redis=require(_0xcdb4('0x10'));var authService=require(_0xcdb4('0x11'));var qs=require(_0xcdb4('0x12'));var as=require(_0xcdb4('0x13'));var hardwareService=require(_0xcdb4('0x14'));var logger=require(_0xcdb4('0x15'))(_0xcdb4('0x16'));var utils=require(_0xcdb4('0x17'));var config=require(_0xcdb4('0x18'));var licenseUtil=require(_0xcdb4('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x53cf70,_0x39eed4){_0x39eed4=_0x39eed4||0xcc;return function(_0xed523c){if(_0xed523c){return _0x53cf70['sendStatus'](_0x39eed4);}return _0x53cf70['status'](_0x39eed4)[_0xcdb4('0x1a')]();};}function respondWithResult(_0x2cd0a3,_0x223d79){_0x223d79=_0x223d79||0xc8;return function(_0x32cb2b){if(_0x32cb2b){return _0x2cd0a3['status'](_0x223d79)['json'](_0x32cb2b);}};}function respondWithFilteredResult(_0x1734ff,_0x73edd3){return function(_0x23cf16){if(_0x23cf16){var _0x3e2b4d=typeof _0x73edd3[_0xcdb4('0x1b')]==='undefined'&&typeof _0x73edd3[_0xcdb4('0x1c')]===_0xcdb4('0x1d');var _0xf2b149=_0x23cf16[_0xcdb4('0x1e')];var _0x18fafc=_0x3e2b4d?0x0:_0x73edd3['offset'];var _0x4dacbd=_0x3e2b4d?_0x23cf16[_0xcdb4('0x1e')]:_0x73edd3[_0xcdb4('0x1b')]+_0x73edd3[_0xcdb4('0x1c')];var _0x6b521b;if(_0x4dacbd>=_0xf2b149){_0x4dacbd=_0xf2b149;_0x6b521b=0xc8;}else{_0x6b521b=0xce;}_0x1734ff[_0xcdb4('0x1f')](_0x6b521b);return _0x1734ff[_0xcdb4('0x20')](_0xcdb4('0x21'),_0x18fafc+'-'+_0x4dacbd+'/'+_0xf2b149)[_0xcdb4('0x22')](_0x23cf16);}return null;};}function patchUpdates(_0x5f2857){return function(_0x5f0408){try{jsonpatch['apply'](_0x5f0408,_0x5f2857,!![]);}catch(_0x1fbe72){return BPromise[_0xcdb4('0x23')](_0x1fbe72);}return _0x5f0408[_0xcdb4('0x24')]();};}function saveUpdates(_0x505155,_0x2b0851){return function(_0x3f09f3){if(_0x3f09f3){return _0x3f09f3[_0xcdb4('0x25')](_0x505155)[_0xcdb4('0x26')](function(_0x2c5c84){return _0x2c5c84;});}return null;};}function removeEntity(_0x5c4d2a,_0x5c3c92){return function(_0x1a5719){if(_0x1a5719){return _0x1a5719[_0xcdb4('0x27')]()['then'](function(){_0x5c4d2a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b5543,_0x2cc561){return function(_0x413bb4){if(!_0x413bb4){_0x5b5543[_0xcdb4('0x28')](0x194);}return _0x413bb4;};}function handleError(_0x3cbabf,_0x19f7e9){_0x19f7e9=_0x19f7e9||0x1f4;return function(_0x3df4a6){logger[_0xcdb4('0x29')](_0x3df4a6[_0xcdb4('0x2a')]);if(_0x3df4a6['name']){delete _0x3df4a6[_0xcdb4('0x2b')];}_0x3cbabf[_0xcdb4('0x1f')](_0x19f7e9)[_0xcdb4('0x2c')](_0x3df4a6);};}exports[_0xcdb4('0x2d')]=function(_0x433466,_0x4c5e48){var _0x207ebd={},_0x23b8ef={},_0x5d1b58={'count':0x0,'rows':[]};var _0x4dfb4b=_[_0xcdb4('0x2e')](db[_0xcdb4('0x2f')][_0xcdb4('0x30')],function(_0x45a2bb){return{'name':_0x45a2bb[_0xcdb4('0x31')],'type':_0x45a2bb[_0xcdb4('0x32')][_0xcdb4('0x33')]};});_0x23b8ef['model']=_[_0xcdb4('0x2e')](_0x4dfb4b,_0xcdb4('0x2b'));_0x23b8ef[_0xcdb4('0x34')]=_[_0xcdb4('0x35')](_0x433466[_0xcdb4('0x34')]);_0x23b8ef[_0xcdb4('0x36')]=_['intersection'](_0x23b8ef[_0xcdb4('0x37')],_0x23b8ef[_0xcdb4('0x34')]);_0x207ebd['attributes']=_[_0xcdb4('0x38')](_0x23b8ef[_0xcdb4('0x37')],qs[_0xcdb4('0x39')](_0x433466[_0xcdb4('0x34')][_0xcdb4('0x39')]));_0x207ebd['attributes']=_0x207ebd[_0xcdb4('0x3a')][_0xcdb4('0x3b')]?_0x207ebd['attributes']:_0x23b8ef[_0xcdb4('0x37')];if(!_0x433466[_0xcdb4('0x34')]['hasOwnProperty']('nolimit')){_0x207ebd[_0xcdb4('0x1c')]=qs[_0xcdb4('0x1c')](_0x433466[_0xcdb4('0x34')][_0xcdb4('0x1c')]);_0x207ebd[_0xcdb4('0x1b')]=qs['offset'](_0x433466[_0xcdb4('0x34')][_0xcdb4('0x1b')]);}_0x207ebd['order']=qs[_0xcdb4('0x3c')](_0x433466[_0xcdb4('0x34')]['sort']);_0x207ebd[_0xcdb4('0x3d')]=qs[_0xcdb4('0x36')](_[_0xcdb4('0x3e')](_0x433466[_0xcdb4('0x34')],_0x23b8ef[_0xcdb4('0x36')]),_0x4dfb4b);if(_0x433466[_0xcdb4('0x34')][_0xcdb4('0x3f')]){_0x207ebd[_0xcdb4('0x3d')]=_[_0xcdb4('0x40')](_0x207ebd[_0xcdb4('0x3d')],{'$or':_[_0xcdb4('0x2e')](_0x4dfb4b,function(_0xea3b6a){if(_0xea3b6a[_0xcdb4('0x32')]!==_0xcdb4('0x41')){var _0x3e454d={};_0x3e454d[_0xea3b6a['name']]={'$like':'%'+_0x433466[_0xcdb4('0x34')][_0xcdb4('0x3f')]+'%'};return _0x3e454d;}})});}_0x207ebd=_['merge']({},_0x207ebd,_0x433466[_0xcdb4('0x42')]);var _0x2a053c={'where':_0x207ebd[_0xcdb4('0x3d')]};return db[_0xcdb4('0x2f')][_0xcdb4('0x1e')](_0x2a053c)[_0xcdb4('0x26')](function(_0x55631d){_0x5d1b58[_0xcdb4('0x1e')]=_0x55631d;if(_0x433466[_0xcdb4('0x34')][_0xcdb4('0x43')]){_0x207ebd[_0xcdb4('0x44')]=[{'all':!![]}];}return db[_0xcdb4('0x2f')][_0xcdb4('0x45')](_0x207ebd);})['then'](function(_0x3aa6d0){_0x5d1b58[_0xcdb4('0x46')]=_0x3aa6d0;return _0x5d1b58;})[_0xcdb4('0x26')](respondWithFilteredResult(_0x4c5e48,_0x207ebd))[_0xcdb4('0x47')](handleError(_0x4c5e48,null));};exports['show']=function(_0x5e6c4c,_0x1049a4){var _0x351294={'raw':!![],'where':{'id':_0x5e6c4c[_0xcdb4('0x48')]['id']}},_0x35620a={};_0x35620a[_0xcdb4('0x37')]=_[_0xcdb4('0x35')](db[_0xcdb4('0x2f')][_0xcdb4('0x30')]);_0x35620a[_0xcdb4('0x34')]=_[_0xcdb4('0x35')](_0x5e6c4c[_0xcdb4('0x34')]);_0x35620a[_0xcdb4('0x36')]=_[_0xcdb4('0x38')](_0x35620a[_0xcdb4('0x37')],_0x35620a[_0xcdb4('0x34')]);_0x351294[_0xcdb4('0x3a')]=_[_0xcdb4('0x38')](_0x35620a[_0xcdb4('0x37')],qs['fields'](_0x5e6c4c[_0xcdb4('0x34')]['fields']));_0x351294[_0xcdb4('0x3a')]=_0x351294[_0xcdb4('0x3a')][_0xcdb4('0x3b')]?_0x351294[_0xcdb4('0x3a')]:_0x35620a['model'];if(_0x5e6c4c[_0xcdb4('0x34')][_0xcdb4('0x43')]){_0x351294['include']=[{'all':!![]}];}_0x351294=_[_0xcdb4('0x40')]({},_0x351294,_0x5e6c4c[_0xcdb4('0x42')]);return db[_0xcdb4('0x2f')][_0xcdb4('0x49')](_0x351294)[_0xcdb4('0x26')](handleEntityNotFound(_0x1049a4,null))[_0xcdb4('0x26')](respondWithResult(_0x1049a4,null))[_0xcdb4('0x47')](handleError(_0x1049a4,null));};exports[_0xcdb4('0x4a')]=function(_0x228570,_0x110f4d){return db[_0xcdb4('0x2f')][_0xcdb4('0x4a')](_0x228570[_0xcdb4('0x4b')],{})[_0xcdb4('0x26')](respondWithResult(_0x110f4d,0xc9))['catch'](handleError(_0x110f4d,null));};exports[_0xcdb4('0x25')]=function(_0x1ace63,_0x3af190){if(_0x1ace63[_0xcdb4('0x4b')]['id']){delete _0x1ace63['body']['id'];}return db['SalesforceField'][_0xcdb4('0x49')]({'where':{'id':_0x1ace63[_0xcdb4('0x48')]['id']}})['then'](handleEntityNotFound(_0x3af190,null))['then'](saveUpdates(_0x1ace63[_0xcdb4('0x4b')],null))[_0xcdb4('0x26')](respondWithResult(_0x3af190,null))['catch'](handleError(_0x3af190,null));};exports['destroy']=function(_0xba5d07,_0x2f1220){return db[_0xcdb4('0x2f')][_0xcdb4('0x49')]({'where':{'id':_0xba5d07[_0xcdb4('0x48')]['id']}})[_0xcdb4('0x26')](handleEntityNotFound(_0x2f1220,null))[_0xcdb4('0x26')](removeEntity(_0x2f1220,null))[_0xcdb4('0x47')](handleError(_0x2f1220,null));}; \ No newline at end of file +var _0x3d34=['reject','save','then','destroy','error','stack','name','send','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','options','includeAll','SalesforceField','findAll','rows','catch','show','params','rawAttributes','include','find','create','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','sendStatus','end','offset','undefined','count','limit','status','set','Content-Range','json','apply'];(function(_0x4b88ea,_0x4fcc25){var _0x156bdf=function(_0x1536a){while(--_0x1536a){_0x4b88ea['push'](_0x4b88ea['shift']());}};_0x156bdf(++_0x4fcc25);}(_0x3d34,0x1a4));var _0x43d3=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x3d34[_0x2aec52];return _0x3b8835;};'use strict';var emlformat=require(_0x43d3('0x0'));var rimraf=require(_0x43d3('0x1'));var zipdir=require(_0x43d3('0x2'));var jsonpatch=require(_0x43d3('0x3'));var rp=require(_0x43d3('0x4'));var moment=require(_0x43d3('0x5'));var BPromise=require(_0x43d3('0x6'));var Mustache=require(_0x43d3('0x7'));var util=require(_0x43d3('0x8'));var path=require(_0x43d3('0x9'));var sox=require(_0x43d3('0xa'));var csv=require('to-csv');var ejs=require(_0x43d3('0xb'));var fs=require('fs');var fs_extra=require(_0x43d3('0xc'));var _=require(_0x43d3('0xd'));var squel=require('squel');var crypto=require(_0x43d3('0xe'));var jsforce=require(_0x43d3('0xf'));var deskjs=require(_0x43d3('0x10'));var toCsv=require(_0x43d3('0x11'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x43d3('0x12'));var authService=require(_0x43d3('0x13'));var qs=require(_0x43d3('0x14'));var as=require(_0x43d3('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43d3('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x43d3('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x43d3('0x18'))['db'];function respondWithStatusCode(_0x2e6fe6,_0x5ed3fa){_0x5ed3fa=_0x5ed3fa||0xcc;return function(_0x52f458){if(_0x52f458){return _0x2e6fe6[_0x43d3('0x19')](_0x5ed3fa);}return _0x2e6fe6['status'](_0x5ed3fa)[_0x43d3('0x1a')]();};}function respondWithResult(_0x20cd32,_0x46325f){_0x46325f=_0x46325f||0xc8;return function(_0x4fabdc){if(_0x4fabdc){return _0x20cd32['status'](_0x46325f)['json'](_0x4fabdc);}};}function respondWithFilteredResult(_0x16c2f4,_0x152007){return function(_0x247f4a){if(_0x247f4a){var _0x7d89c9=typeof _0x152007[_0x43d3('0x1b')]==='undefined'&&typeof _0x152007['limit']===_0x43d3('0x1c');var _0x37ef90=_0x247f4a[_0x43d3('0x1d')];var _0x21c8f9=_0x7d89c9?0x0:_0x152007[_0x43d3('0x1b')];var _0x48de15=_0x7d89c9?_0x247f4a['count']:_0x152007[_0x43d3('0x1b')]+_0x152007[_0x43d3('0x1e')];var _0x5229b3;if(_0x48de15>=_0x37ef90){_0x48de15=_0x37ef90;_0x5229b3=0xc8;}else{_0x5229b3=0xce;}_0x16c2f4[_0x43d3('0x1f')](_0x5229b3);return _0x16c2f4[_0x43d3('0x20')](_0x43d3('0x21'),_0x21c8f9+'-'+_0x48de15+'/'+_0x37ef90)[_0x43d3('0x22')](_0x247f4a);}return null;};}function patchUpdates(_0x4d1e31){return function(_0x25c5e5){try{jsonpatch[_0x43d3('0x23')](_0x25c5e5,_0x4d1e31,!![]);}catch(_0x5cb29c){return BPromise[_0x43d3('0x24')](_0x5cb29c);}return _0x25c5e5[_0x43d3('0x25')]();};}function saveUpdates(_0x544783,_0x5e6dd1){return function(_0x5b3ffd){if(_0x5b3ffd){return _0x5b3ffd['update'](_0x544783)[_0x43d3('0x26')](function(_0x564d4a){return _0x564d4a;});}return null;};}function removeEntity(_0x30b7ee,_0x5f502a){return function(_0x27e517){if(_0x27e517){return _0x27e517[_0x43d3('0x27')]()['then'](function(){_0x30b7ee[_0x43d3('0x1f')](0xcc)[_0x43d3('0x1a')]();});}};}function handleEntityNotFound(_0x9ecc95,_0x104dc7){return function(_0x4964d0){if(!_0x4964d0){_0x9ecc95['sendStatus'](0x194);}return _0x4964d0;};}function handleError(_0x3ad35d,_0x206eef){_0x206eef=_0x206eef||0x1f4;return function(_0x50bcd7){logger[_0x43d3('0x28')](_0x50bcd7[_0x43d3('0x29')]);if(_0x50bcd7['name']){delete _0x50bcd7[_0x43d3('0x2a')];}_0x3ad35d[_0x43d3('0x1f')](_0x206eef)[_0x43d3('0x2b')](_0x50bcd7);};}exports['index']=function(_0x12a450,_0x2ddca6){var _0x59666d={},_0x17c183={},_0x84f2ce={'count':0x0,'rows':[]};var _0x5b2554=_[_0x43d3('0x2c')](db['SalesforceField']['rawAttributes'],function(_0x1e8e1){return{'name':_0x1e8e1[_0x43d3('0x2d')],'type':_0x1e8e1[_0x43d3('0x2e')][_0x43d3('0x2f')]};});_0x17c183[_0x43d3('0x30')]=_[_0x43d3('0x2c')](_0x5b2554,_0x43d3('0x2a'));_0x17c183[_0x43d3('0x31')]=_[_0x43d3('0x32')](_0x12a450['query']);_0x17c183[_0x43d3('0x33')]=_[_0x43d3('0x34')](_0x17c183[_0x43d3('0x30')],_0x17c183[_0x43d3('0x31')]);_0x59666d[_0x43d3('0x35')]=_[_0x43d3('0x34')](_0x17c183[_0x43d3('0x30')],qs['fields'](_0x12a450['query'][_0x43d3('0x36')]));_0x59666d[_0x43d3('0x35')]=_0x59666d[_0x43d3('0x35')][_0x43d3('0x37')]?_0x59666d[_0x43d3('0x35')]:_0x17c183[_0x43d3('0x30')];if(!_0x12a450[_0x43d3('0x31')]['hasOwnProperty'](_0x43d3('0x38'))){_0x59666d[_0x43d3('0x1e')]=qs[_0x43d3('0x1e')](_0x12a450[_0x43d3('0x31')][_0x43d3('0x1e')]);_0x59666d['offset']=qs['offset'](_0x12a450[_0x43d3('0x31')]['offset']);}_0x59666d[_0x43d3('0x39')]=qs[_0x43d3('0x3a')](_0x12a450[_0x43d3('0x31')][_0x43d3('0x3a')]);_0x59666d[_0x43d3('0x3b')]=qs['filters'](_['pick'](_0x12a450[_0x43d3('0x31')],_0x17c183[_0x43d3('0x33')]),_0x5b2554);if(_0x12a450['query'][_0x43d3('0x3c')]){_0x59666d[_0x43d3('0x3b')]=_['merge'](_0x59666d[_0x43d3('0x3b')],{'$or':_[_0x43d3('0x2c')](_0x5b2554,function(_0x580815){if(_0x580815[_0x43d3('0x2e')]!=='VIRTUAL'){var _0xa20a90={};_0xa20a90[_0x580815[_0x43d3('0x2a')]]={'$like':'%'+_0x12a450[_0x43d3('0x31')]['filter']+'%'};return _0xa20a90;}})});}_0x59666d=_[_0x43d3('0x3d')]({},_0x59666d,_0x12a450[_0x43d3('0x3e')]);var _0x2730b1={'where':_0x59666d['where']};return db['SalesforceField'][_0x43d3('0x1d')](_0x2730b1)[_0x43d3('0x26')](function(_0x243f96){_0x84f2ce[_0x43d3('0x1d')]=_0x243f96;if(_0x12a450['query'][_0x43d3('0x3f')]){_0x59666d['include']=[{'all':!![]}];}return db[_0x43d3('0x40')][_0x43d3('0x41')](_0x59666d);})[_0x43d3('0x26')](function(_0x468666){_0x84f2ce[_0x43d3('0x42')]=_0x468666;return _0x84f2ce;})['then'](respondWithFilteredResult(_0x2ddca6,_0x59666d))[_0x43d3('0x43')](handleError(_0x2ddca6,null));};exports[_0x43d3('0x44')]=function(_0x3371b7,_0x2378a0){var _0x2c1e41={'raw':!![],'where':{'id':_0x3371b7[_0x43d3('0x45')]['id']}},_0x2675a5={};_0x2675a5[_0x43d3('0x30')]=_[_0x43d3('0x32')](db[_0x43d3('0x40')][_0x43d3('0x46')]);_0x2675a5['query']=_['keys'](_0x3371b7[_0x43d3('0x31')]);_0x2675a5[_0x43d3('0x33')]=_[_0x43d3('0x34')](_0x2675a5[_0x43d3('0x30')],_0x2675a5[_0x43d3('0x31')]);_0x2c1e41['attributes']=_[_0x43d3('0x34')](_0x2675a5[_0x43d3('0x30')],qs['fields'](_0x3371b7[_0x43d3('0x31')][_0x43d3('0x36')]));_0x2c1e41['attributes']=_0x2c1e41[_0x43d3('0x35')][_0x43d3('0x37')]?_0x2c1e41[_0x43d3('0x35')]:_0x2675a5[_0x43d3('0x30')];if(_0x3371b7[_0x43d3('0x31')][_0x43d3('0x3f')]){_0x2c1e41[_0x43d3('0x47')]=[{'all':!![]}];}_0x2c1e41=_[_0x43d3('0x3d')]({},_0x2c1e41,_0x3371b7['options']);return db['SalesforceField'][_0x43d3('0x48')](_0x2c1e41)[_0x43d3('0x26')](handleEntityNotFound(_0x2378a0,null))[_0x43d3('0x26')](respondWithResult(_0x2378a0,null))[_0x43d3('0x43')](handleError(_0x2378a0,null));};exports[_0x43d3('0x49')]=function(_0x457404,_0x50c9b){return db['SalesforceField']['create'](_0x457404['body'],{})[_0x43d3('0x26')](respondWithResult(_0x50c9b,0xc9))[_0x43d3('0x43')](handleError(_0x50c9b,null));};exports[_0x43d3('0x4a')]=function(_0x3a2ee9,_0x111d4c){if(_0x3a2ee9['body']['id']){delete _0x3a2ee9['body']['id'];}return db['SalesforceField'][_0x43d3('0x48')]({'where':{'id':_0x3a2ee9[_0x43d3('0x45')]['id']}})[_0x43d3('0x26')](handleEntityNotFound(_0x111d4c,null))['then'](saveUpdates(_0x3a2ee9[_0x43d3('0x4b')],null))['then'](respondWithResult(_0x111d4c,null))['catch'](handleError(_0x111d4c,null));};exports[_0x43d3('0x27')]=function(_0x168a08,_0x1fdac8){return db[_0x43d3('0x40')]['find']({'where':{'id':_0x168a08[_0x43d3('0x45')]['id']}})['then'](handleEntityNotFound(_0x1fdac8,null))['then'](removeEntity(_0x1fdac8,null))[_0x43d3('0x43')](handleError(_0x1fdac8,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 1ed2cb1..531fd85 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 _0x4548=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','util','../../config/logger'];(function(_0x475222,_0x1b180d){var _0x901560=function(_0xfcd97f){while(--_0xfcd97f){_0x475222['push'](_0x475222['shift']());}};_0x901560(++_0x1b180d);}(_0x4548,0x75));var _0x8454=function(_0x32ba61,_0xba8dd9){_0x32ba61=_0x32ba61-0x0;var _0x3a1f7c=_0x4548[_0x32ba61];return _0x3a1f7c;};'use strict';var _=require(_0x8454('0x0'));var util=require(_0x8454('0x1'));var logger=require(_0x8454('0x2'))(_0x8454('0x3'));var moment=require(_0x8454('0x4'));var BPromise=require(_0x8454('0x5'));var rp=require(_0x8454('0x6'));var fs=require('fs');var path=require(_0x8454('0x7'));var rimraf=require(_0x8454('0x8'));var config=require(_0x8454('0x9'));var attributes=require('./intSalesforceField.attributes');module['exports']=function(_0x221106,_0x25c461){return _0x221106[_0x8454('0xa')]('SalesforceField',attributes,{'tableName':_0x8454('0xb'),'paranoid':![],'indexes':[{'name':_0x8454('0xc'),'fields':[_0x8454('0xd'),_0x8454('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3292=['idField','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x3292,0x177));var _0x2329=function(_0x1cea1c,_0x4385ac){_0x1cea1c=_0x1cea1c-0x0;var _0x5c6636=_0x3292[_0x1cea1c];return _0x5c6636;};'use strict';var _=require(_0x2329('0x0'));var util=require(_0x2329('0x1'));var logger=require(_0x2329('0x2'))(_0x2329('0x3'));var moment=require(_0x2329('0x4'));var BPromise=require(_0x2329('0x5'));var rp=require(_0x2329('0x6'));var fs=require('fs');var path=require(_0x2329('0x7'));var rimraf=require(_0x2329('0x8'));var config=require(_0x2329('0x9'));var attributes=require(_0x2329('0xa'));module[_0x2329('0xb')]=function(_0x1513c2,_0x2692e8){return _0x1513c2[_0x2329('0xc')](_0x2329('0xd'),attributes,{'tableName':_0x2329('0xe'),'paranoid':![],'indexes':[{'name':_0x2329('0xf'),'fields':[_0x2329('0x10'),'FieldId'],'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 4724ccd..fa3f8a7 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 _0x8160=['SalesforceField,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','request','then','info'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8160,0x15b));var _0x0816=function(_0xce14b1,_0x4de01e){_0xce14b1=_0xce14b1-0x0;var _0x393a9e=_0x8160[_0xce14b1];return _0x393a9e;};'use strict';var _=require(_0x0816('0x0'));var util=require('util');var moment=require(_0x0816('0x1'));var BPromise=require(_0x0816('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0816('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0816('0x4'));var logger=require('../../config/logger')(_0x0816('0x5'));var config=require(_0x0816('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5ab779,_0x3e6e64,_0x47f0ce){return new BPromise(function(_0x1bcfe3,_0x20ccdb){return client[_0x0816('0x7')](_0x5ab779,_0x47f0ce)[_0x0816('0x8')](function(_0x4c00f2){logger[_0x0816('0x9')](_0x0816('0xa'),_0x3e6e64,_0x0816('0xb'));logger['debug']('SalesforceField,\x20%s,\x20%s,\x20%s',_0x3e6e64,_0x0816('0xb'),JSON['stringify'](_0x4c00f2));if(_0x4c00f2[_0x0816('0xc')]){if(_0x4c00f2['error'][_0x0816('0xd')]===0x1f4){logger['error'](_0x0816('0xa'),_0x3e6e64,_0x4c00f2[_0x0816('0xc')]['message']);return _0x20ccdb(_0x4c00f2[_0x0816('0xc')]['message']);}logger[_0x0816('0xc')]('SalesforceField,\x20%s,\x20%s',_0x3e6e64,_0x4c00f2[_0x0816('0xc')][_0x0816('0xe')]);return _0x1bcfe3(_0x4c00f2['error'][_0x0816('0xe')]);}else{logger[_0x0816('0x9')]('SalesforceField,\x20%s,\x20%s',_0x3e6e64,_0x0816('0xb'));_0x1bcfe3(_0x4c00f2[_0x0816('0xf')][_0x0816('0xe')]);}})[_0x0816('0x10')](function(_0x3eabcb){logger[_0x0816('0xc')]('SalesforceField,\x20%s,\x20%s',_0x3e6e64,_0x3eabcb);_0x20ccdb(_0x3eabcb);});});} \ No newline at end of file +var _0x919b=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','request\x20sent','SalesforceField,\x20%s,\x20%s,\x20%s','error','code','SalesforceField,\x20%s,\x20%s','message','info','result','util'];(function(_0x2b20c7,_0x278d49){var _0x3a6e02=function(_0x485469){while(--_0x485469){_0x2b20c7['push'](_0x2b20c7['shift']());}};_0x3a6e02(++_0x278d49);}(_0x919b,0x97));var _0xb919=function(_0x5081bc,_0x161a64){_0x5081bc=_0x5081bc-0x0;var _0xa9f541=_0x919b[_0x5081bc];return _0xa9f541;};'use strict';var _=require('lodash');var util=require(_0xb919('0x0'));var moment=require('moment');var BPromise=require(_0xb919('0x1'));var rs=require(_0xb919('0x2'));var fs=require('fs');var Redis=require(_0xb919('0x3'));var db=require(_0xb919('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb919('0x5'))('rpc');var config=require(_0xb919('0x6'));var jayson=require(_0xb919('0x7'));var client=jayson[_0xb919('0x8')][_0xb919('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x23a83b,_0x692953,_0x315301){return new BPromise(function(_0x34d071,_0x1d8e00){return client['request'](_0x23a83b,_0x315301)[_0xb919('0xa')](function(_0x457971){logger['info']('SalesforceField,\x20%s,\x20%s',_0x692953,_0xb919('0xb'));logger['debug'](_0xb919('0xc'),_0x692953,_0xb919('0xb'),JSON['stringify'](_0x457971));if(_0x457971['error']){if(_0x457971[_0xb919('0xd')][_0xb919('0xe')]===0x1f4){logger[_0xb919('0xd')](_0xb919('0xf'),_0x692953,_0x457971['error'][_0xb919('0x10')]);return _0x1d8e00(_0x457971[_0xb919('0xd')]['message']);}logger[_0xb919('0xd')](_0xb919('0xf'),_0x692953,_0x457971[_0xb919('0xd')][_0xb919('0x10')]);return _0x34d071(_0x457971[_0xb919('0xd')][_0xb919('0x10')]);}else{logger[_0xb919('0x11')]('SalesforceField,\x20%s,\x20%s',_0x692953,'request\x20sent');_0x34d071(_0x457971[_0xb919('0x12')]['message']);}})['catch'](function(_0x30861b){logger[_0xb919('0xd')](_0xb919('0xf'),_0x692953,_0x30861b);_0x1d8e00(_0x30861b);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 17eb07b..be2e5dc 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 _0x1123=['path','express','Router','fs-extra','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','create','post','put','update','delete','exports'];(function(_0x34942d,_0xe658ef){var _0x39bb78=function(_0x29db89){while(--_0x29db89){_0x34942d['push'](_0x34942d['shift']());}};_0x39bb78(++_0xe658ef);}(_0x1123,0x118));var _0x3112=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x1123[_0x21a9d9];return _0x46adce;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3112('0x0'));var timeout=require('connect-timeout');var express=require(_0x3112('0x1'));var router=express[_0x3112('0x2')]();var fs_extra=require(_0x3112('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3112('0x4'));var controller=require(_0x3112('0x5'));router[_0x3112('0x6')]('/',auth[_0x3112('0x7')](),controller[_0x3112('0x8')]);router[_0x3112('0x6')](_0x3112('0x9'),auth[_0x3112('0x7')](),controller[_0x3112('0xa')]);router['get'](_0x3112('0xb'),auth[_0x3112('0x7')](),controller[_0x3112('0xc')]);router[_0x3112('0x6')](_0x3112('0xd'),auth[_0x3112('0x7')](),controller['getFields']);router['post']('/',auth[_0x3112('0x7')](),controller[_0x3112('0xe')]);router[_0x3112('0xf')](_0x3112('0xb'),auth[_0x3112('0x7')](),controller['addConfiguration']);router[_0x3112('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x3112('0x11')]);router[_0x3112('0x12')](_0x3112('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x3112('0x13')]=router; \ No newline at end of file +var _0xc112=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','/:id','show','getConfigurations','/:id/fields','getFields','post','/:id/configurations','addConfiguration','put','delete','destroy','exports','multer','util','path','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc112,0xec));var _0x2c11=function(_0x3da1b6,_0x5eb3fe){_0x3da1b6=_0x3da1b6-0x0;var _0x58d9a5=_0xc112[_0x3da1b6];return _0x58d9a5;};'use strict';var multer=require(_0x2c11('0x0'));var util=require(_0x2c11('0x1'));var path=require(_0x2c11('0x2'));var timeout=require('connect-timeout');var express=require(_0x2c11('0x3'));var router=express[_0x2c11('0x4')]();var fs_extra=require(_0x2c11('0x5'));var auth=require(_0x2c11('0x6'));var interaction=require(_0x2c11('0x7'));var config=require(_0x2c11('0x8'));var controller=require(_0x2c11('0x9'));router[_0x2c11('0xa')]('/',auth[_0x2c11('0xb')](),controller['index']);router['get'](_0x2c11('0xc'),auth[_0x2c11('0xb')](),controller[_0x2c11('0xd')]);router[_0x2c11('0xa')]('/:id/configurations',auth[_0x2c11('0xb')](),controller[_0x2c11('0xe')]);router['get'](_0x2c11('0xf'),auth[_0x2c11('0xb')](),controller[_0x2c11('0x10')]);router[_0x2c11('0x11')]('/',auth[_0x2c11('0xb')](),controller['create']);router[_0x2c11('0x11')](_0x2c11('0x12'),auth[_0x2c11('0xb')](),controller[_0x2c11('0x13')]);router[_0x2c11('0x14')](_0x2c11('0xc'),auth[_0x2c11('0xb')](),controller['update']);router[_0x2c11('0x15')](_0x2c11('0xc'),auth[_0x2c11('0xb')](),controller[_0x2c11('0x16')]);module[_0x2c11('0x17')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 4e272b5..e16222e 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 _0x24e7=['STRING','username','remoteUri','sequelize','exports'];(function(_0x5b6cf1,_0x32fdcd){var _0x46278c=function(_0x53fd9b){while(--_0x53fd9b){_0x5b6cf1['push'](_0x5b6cf1['shift']());}};_0x46278c(++_0x32fdcd);}(_0x24e7,0x1de));var _0x724e=function(_0x25a5cc,_0x29d283){_0x25a5cc=_0x25a5cc-0x0;var _0x42b15e=_0x24e7[_0x25a5cc];return _0x42b15e;};'use strict';var Sequelize=require(_0x724e('0x0'));module[_0x724e('0x1')]={'name':{'type':Sequelize[_0x724e('0x2')]},'description':{'type':Sequelize[_0x724e('0x2')]},'username':{'type':Sequelize[_0x724e('0x2')],'unique':_0x724e('0x3')},'password':{'type':Sequelize[_0x724e('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x724e('0x2')],'unique':_0x724e('0x4')},'serverUrl':{'type':Sequelize[_0x724e('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x09f3=['username','remoteUri','sequelize','STRING'];(function(_0x5b0675,_0x21cf5b){var _0x5ae435=function(_0xd67cc0){while(--_0xd67cc0){_0x5b0675['push'](_0x5b0675['shift']());}};_0x5ae435(++_0x21cf5b);}(_0x09f3,0x10a));var _0x309f=function(_0x332684,_0x4c5b5b){_0x332684=_0x332684-0x0;var _0x42c520=_0x09f3[_0x332684];return _0x42c520;};'use strict';var Sequelize=require(_0x309f('0x0'));module['exports']={'name':{'type':Sequelize[_0x309f('0x1')]},'description':{'type':Sequelize[_0x309f('0x1')]},'username':{'type':Sequelize[_0x309f('0x1')],'unique':_0x309f('0x2')},'password':{'type':Sequelize[_0x309f('0x1')]},'email':{'type':Sequelize[_0x309f('0x1')]},'remoteUri':{'type':Sequelize[_0x309f('0x1')],'unique':_0x309f('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 4952db8..7b4faf0 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 _0x8744=['short_description','correlation_display','delivery_task','assignment_group','business_stc','additional_assignee_list','calendar_duration','sys_class_name','close_notes','closed_by','contact_type','reopened_by','urgency','problem_id','company','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','email','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','username','GET','result','log','incident\x20table\x20objects','assign','includes','forEach','internalType','push','all','TCL:\x20_object','remove','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','label','concat','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','ServicenowAccount','rawAttributes','type','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','findAll','rows','catch','show','params','includeAll','include','create','find','body','findOne','getConfigurations','addConfiguration','AccountId','channel','Descriptions','ServicenowConfiguration','ServicenowField','Subjects','getFields','made_sla','hold_reason','subcategory','close_code','notify','incident_state','severity','parent','caused_by','watch_list','upon_reject','resolved_by','sys_updated_by','user_input','sys_created_on','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','business_service','sys_domain_path','rfc','expected_start','opened_at','business_duration','work_end','reopened_time','resolved_at','approval_set','work_notes'];(function(_0x24c57b,_0x2ab0c0){var _0x1d0146=function(_0x420e86){while(--_0x420e86){_0x24c57b['push'](_0x24c57b['shift']());}};_0x1d0146(++_0x2ab0c0);}(_0x8744,0x1a8));var _0x4874=function(_0x571b8c,_0x134273){_0x571b8c=_0x571b8c-0x0;var _0x4f01a6=_0x8744[_0x571b8c];return _0x4f01a6;};'use strict';var emlformat=require(_0x4874('0x0'));var rimraf=require(_0x4874('0x1'));var zipdir=require(_0x4874('0x2'));var jsonpatch=require(_0x4874('0x3'));var rp=require(_0x4874('0x4'));var moment=require(_0x4874('0x5'));var BPromise=require(_0x4874('0x6'));var Mustache=require('mustache');var util=require(_0x4874('0x7'));var path=require(_0x4874('0x8'));var sox=require(_0x4874('0x9'));var csv=require(_0x4874('0xa'));var ejs=require(_0x4874('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4874('0xc'));var squel=require(_0x4874('0xd'));var crypto=require('crypto');var jsforce=require(_0x4874('0xe'));var deskjs=require(_0x4874('0xf'));var toCsv=require(_0x4874('0xa'));var querystring=require('querystring');var Papa=require(_0x4874('0x10'));var Redis=require('ioredis');var authService=require(_0x4874('0x11'));var qs=require(_0x4874('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4874('0x13'));var utils=require('../../config/utils');var config=require(_0x4874('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x4874('0x15'))['db'];var integrations=require(_0x4874('0x16'));function respondWithStatusCode(_0x1f7ba1,_0x2d0a00){_0x2d0a00=_0x2d0a00||0xcc;return function(_0x4bf844){if(_0x4bf844){return _0x1f7ba1[_0x4874('0x17')](_0x2d0a00);}return _0x1f7ba1[_0x4874('0x18')](_0x2d0a00)[_0x4874('0x19')]();};}function respondWithResult(_0x352bf1,_0x1f45f5){_0x1f45f5=_0x1f45f5||0xc8;return function(_0x103eaf){if(_0x103eaf){return _0x352bf1[_0x4874('0x18')](_0x1f45f5)[_0x4874('0x1a')](_0x103eaf);}};}function respondWithFilteredResult(_0x254c70,_0x5ccdc2){return function(_0x433c0d){if(_0x433c0d){var _0x3da042=typeof _0x5ccdc2[_0x4874('0x1b')]===_0x4874('0x1c')&&typeof _0x5ccdc2[_0x4874('0x1d')]===_0x4874('0x1c');var _0x5a700d=_0x433c0d[_0x4874('0x1e')];var _0x28eae9=_0x3da042?0x0:_0x5ccdc2[_0x4874('0x1b')];var _0x241fe5=_0x3da042?_0x433c0d[_0x4874('0x1e')]:_0x5ccdc2[_0x4874('0x1b')]+_0x5ccdc2['limit'];var _0x3fd997;if(_0x241fe5>=_0x5a700d){_0x241fe5=_0x5a700d;_0x3fd997=0xc8;}else{_0x3fd997=0xce;}_0x254c70[_0x4874('0x18')](_0x3fd997);return _0x254c70['set'](_0x4874('0x1f'),_0x28eae9+'-'+_0x241fe5+'/'+_0x5a700d)[_0x4874('0x1a')](_0x433c0d);}return null;};}function patchUpdates(_0x428319){return function(_0x1aee91){try{jsonpatch[_0x4874('0x20')](_0x1aee91,_0x428319,!![]);}catch(_0x3682eb){return BPromise[_0x4874('0x21')](_0x3682eb);}return _0x1aee91[_0x4874('0x22')]();};}function saveUpdates(_0x24bc37,_0x5c558b){return function(_0x3e8947){if(_0x3e8947){return _0x3e8947[_0x4874('0x23')](_0x24bc37)[_0x4874('0x24')](function(_0x3e2e8e){return _0x3e2e8e;});}return null;};}function removeEntity(_0x415703,_0x33d8dc){return function(_0x444423){if(_0x444423){return _0x444423[_0x4874('0x25')]()[_0x4874('0x24')](function(){_0x415703['status'](0xcc)[_0x4874('0x19')]();});}};}function handleEntityNotFound(_0x84aaa3,_0x1cdde3){return function(_0x566a9a){if(!_0x566a9a){_0x84aaa3['sendStatus'](0x194);}return _0x566a9a;};}function handleError(_0x341082,_0x38d43a){_0x38d43a=_0x38d43a||0x1f4;return function(_0x400b0b){logger['error'](_0x400b0b[_0x4874('0x26')]);if(_0x400b0b[_0x4874('0x27')]){delete _0x400b0b['name'];}_0x341082[_0x4874('0x18')](_0x38d43a)[_0x4874('0x28')](_0x400b0b);};}exports[_0x4874('0x29')]=function(_0x1ae22a,_0x367fbd){var _0x3ef419={},_0x2a495d={},_0x332ac8={'count':0x0,'rows':[]};var _0x5aadbd=_[_0x4874('0x2a')](db[_0x4874('0x2b')][_0x4874('0x2c')],function(_0x1c5e80){return{'name':_0x1c5e80['fieldName'],'type':_0x1c5e80[_0x4874('0x2d')][_0x4874('0x2e')]};});_0x2a495d['model']=_[_0x4874('0x2a')](_0x5aadbd,_0x4874('0x27'));_0x2a495d['query']=_[_0x4874('0x2f')](_0x1ae22a[_0x4874('0x30')]);_0x2a495d[_0x4874('0x31')]=_[_0x4874('0x32')](_0x2a495d['model'],_0x2a495d['query']);_0x3ef419['attributes']=_[_0x4874('0x32')](_0x2a495d[_0x4874('0x33')],qs[_0x4874('0x34')](_0x1ae22a[_0x4874('0x30')][_0x4874('0x34')]));_0x3ef419[_0x4874('0x35')]=_0x3ef419[_0x4874('0x35')][_0x4874('0x36')]?_0x3ef419['attributes']:_0x2a495d[_0x4874('0x33')];if(!_0x1ae22a['query'][_0x4874('0x37')](_0x4874('0x38'))){_0x3ef419[_0x4874('0x1d')]=qs[_0x4874('0x1d')](_0x1ae22a[_0x4874('0x30')]['limit']);_0x3ef419[_0x4874('0x1b')]=qs[_0x4874('0x1b')](_0x1ae22a[_0x4874('0x30')][_0x4874('0x1b')]);}_0x3ef419[_0x4874('0x39')]=qs[_0x4874('0x3a')](_0x1ae22a[_0x4874('0x30')]['sort']);_0x3ef419['where']=qs['filters'](_['pick'](_0x1ae22a[_0x4874('0x30')],_0x2a495d['filters']),_0x5aadbd);if(_0x1ae22a[_0x4874('0x30')][_0x4874('0x3b')]){_0x3ef419[_0x4874('0x3c')]=_[_0x4874('0x3d')](_0x3ef419[_0x4874('0x3c')],{'$or':_[_0x4874('0x2a')](_0x5aadbd,function(_0x5b27f8){if(_0x5b27f8['type']!=='VIRTUAL'){var _0x323331={};_0x323331[_0x5b27f8[_0x4874('0x27')]]={'$like':'%'+_0x1ae22a[_0x4874('0x30')][_0x4874('0x3b')]+'%'};return _0x323331;}})});}_0x3ef419=_['merge']({},_0x3ef419,_0x1ae22a[_0x4874('0x3e')]);var _0x596f66={'where':_0x3ef419[_0x4874('0x3c')]};return db['ServicenowAccount'][_0x4874('0x1e')](_0x596f66)[_0x4874('0x24')](function(_0xdaa140){_0x332ac8[_0x4874('0x1e')]=_0xdaa140;if(_0x1ae22a[_0x4874('0x30')]['includeAll']){_0x3ef419['include']=[{'all':!![]}];}return db[_0x4874('0x2b')][_0x4874('0x3f')](_0x3ef419);})[_0x4874('0x24')](function(_0x496d26){_0x332ac8[_0x4874('0x40')]=_0x496d26;return _0x332ac8;})[_0x4874('0x24')](respondWithFilteredResult(_0x367fbd,_0x3ef419))[_0x4874('0x41')](handleError(_0x367fbd,null));};exports[_0x4874('0x42')]=function(_0x583979,_0x6dd273){var _0x26fc8d={'raw':![],'where':{'id':_0x583979[_0x4874('0x43')]['id']}},_0x2ff31d={};_0x2ff31d['model']=_[_0x4874('0x2f')](db[_0x4874('0x2b')][_0x4874('0x2c')]);_0x2ff31d[_0x4874('0x30')]=_[_0x4874('0x2f')](_0x583979[_0x4874('0x30')]);_0x2ff31d[_0x4874('0x31')]=_['intersection'](_0x2ff31d[_0x4874('0x33')],_0x2ff31d[_0x4874('0x30')]);_0x26fc8d['attributes']=_[_0x4874('0x32')](_0x2ff31d[_0x4874('0x33')],qs[_0x4874('0x34')](_0x583979['query'][_0x4874('0x34')]));_0x26fc8d[_0x4874('0x35')]=_0x26fc8d[_0x4874('0x35')][_0x4874('0x36')]?_0x26fc8d['attributes']:_0x2ff31d[_0x4874('0x33')];if(_0x583979[_0x4874('0x30')][_0x4874('0x44')]){_0x26fc8d[_0x4874('0x45')]=[{'all':!![]}];}_0x26fc8d=_[_0x4874('0x3d')]({},_0x26fc8d,_0x583979['options']);return db['ServicenowAccount']['find'](_0x26fc8d)[_0x4874('0x24')](handleEntityNotFound(_0x6dd273,null))[_0x4874('0x24')](respondWithResult(_0x6dd273,null))['catch'](handleError(_0x6dd273,null));};exports[_0x4874('0x46')]=function(_0x7d62e7,_0x33e930){return db[_0x4874('0x2b')][_0x4874('0x46')](_0x7d62e7['body'],{})[_0x4874('0x24')](respondWithResult(_0x33e930,0xc9))['catch'](handleError(_0x33e930,null));};exports[_0x4874('0x23')]=function(_0xd50090,_0x42d3cd){if(_0xd50090['body']['id']){delete _0xd50090['body']['id'];}return db[_0x4874('0x2b')][_0x4874('0x47')]({'where':{'id':_0xd50090[_0x4874('0x43')]['id']}})[_0x4874('0x24')](handleEntityNotFound(_0x42d3cd,null))['then'](saveUpdates(_0xd50090[_0x4874('0x48')],null))[_0x4874('0x24')](respondWithResult(_0x42d3cd,null))[_0x4874('0x41')](handleError(_0x42d3cd,null));};exports[_0x4874('0x25')]=function(_0x66eb02,_0x48ca91){return db[_0x4874('0x2b')][_0x4874('0x47')]({'where':{'id':_0x66eb02['params']['id']}})['then'](handleEntityNotFound(_0x48ca91,null))[_0x4874('0x24')](removeEntity(_0x48ca91,null))[_0x4874('0x41')](handleError(_0x48ca91,null));};exports['getConfigurations']=function(_0x86872b,_0x4e0144,_0x180bee){var _0xb338b8={};var _0x2d3f21={};var _0x3ee65b;var _0x1552a8;return db[_0x4874('0x2b')][_0x4874('0x49')]({'where':{'id':_0x86872b[_0x4874('0x43')]['id']}})['then'](handleEntityNotFound(_0x4e0144,null))[_0x4874('0x24')](function(_0x10f436){if(_0x10f436){_0x3ee65b=_0x10f436;_0x2d3f21[_0x4874('0x33')]=_[_0x4874('0x2f')](db['ServicenowConfiguration'][_0x4874('0x2c')]);_0x2d3f21[_0x4874('0x30')]=_[_0x4874('0x2f')](_0x86872b[_0x4874('0x30')]);_0x2d3f21[_0x4874('0x31')]=_[_0x4874('0x32')](_0x2d3f21[_0x4874('0x33')],_0x2d3f21[_0x4874('0x30')]);_0xb338b8[_0x4874('0x35')]=_['intersection'](_0x2d3f21[_0x4874('0x33')],qs['fields'](_0x86872b['query']['fields']));_0xb338b8[_0x4874('0x35')]=_0xb338b8[_0x4874('0x35')][_0x4874('0x36')]?_0xb338b8[_0x4874('0x35')]:_0x2d3f21[_0x4874('0x33')];_0xb338b8[_0x4874('0x39')]=qs[_0x4874('0x3a')](_0x86872b[_0x4874('0x30')][_0x4874('0x3a')]);_0xb338b8[_0x4874('0x3c')]=qs[_0x4874('0x31')](_['pick'](_0x86872b[_0x4874('0x30')],_0x2d3f21[_0x4874('0x31')]));if(_0x86872b[_0x4874('0x30')][_0x4874('0x3b')]){_0xb338b8['where']=_[_0x4874('0x3d')](_0xb338b8['where'],{'$or':_['map'](_0xb338b8[_0x4874('0x35')],function(_0x3fdbf1){var _0x49b883={};_0x49b883[_0x3fdbf1]={'$like':'%'+_0x86872b[_0x4874('0x30')][_0x4874('0x3b')]+'%'};return _0x49b883;})});}_0xb338b8=_[_0x4874('0x3d')]({},_0xb338b8,_0x86872b[_0x4874('0x3e')]);return _0x3ee65b['getConfigurations'](_0xb338b8);}})[_0x4874('0x24')](function(_0x2118c3){if(_0x2118c3){_0x1552a8=_0x2118c3[_0x4874('0x36')];if(!_0x86872b[_0x4874('0x30')][_0x4874('0x37')](_0x4874('0x38'))){_0xb338b8['limit']=qs[_0x4874('0x1d')](_0x86872b[_0x4874('0x30')]['limit']);_0xb338b8[_0x4874('0x1b')]=qs[_0x4874('0x1b')](_0x86872b[_0x4874('0x30')]['offset']);}return _0x3ee65b[_0x4874('0x4a')](_0xb338b8);}})[_0x4874('0x24')](function(_0x5de783){if(_0x5de783){return _0x5de783?{'count':_0x1552a8,'rows':_0x5de783}:null;}})[_0x4874('0x24')](respondWithResult(_0x4e0144,null))[_0x4874('0x41')](handleError(_0x4e0144,null));};exports[_0x4874('0x4b')]=function(_0x10055,_0x259c40,_0x50bf02){if(_0x10055[_0x4874('0x48')]['id']){delete _0x10055['body']['id'];}return db[_0x4874('0x2b')]['findOne']({'where':{'id':_0x10055[_0x4874('0x43')]['id']}})[_0x4874('0x24')](handleEntityNotFound(_0x259c40,null))[_0x4874('0x24')](function(_0x12f8ac){if(_0x12f8ac){_0x10055[_0x4874('0x48')][_0x4874('0x4c')]=_0x12f8ac['id'];_0x10055[_0x4874('0x48')]['Subjects']=integrations['getSubjects'](_0x10055[_0x4874('0x48')][_0x4874('0x4d')],_0x10055[_0x4874('0x48')][_0x4874('0x2d')]);_0x10055[_0x4874('0x48')][_0x4874('0x4e')]=integrations['getDescriptions'](_0x10055[_0x4874('0x48')][_0x4874('0x4d')],_0x10055[_0x4874('0x48')][_0x4874('0x2d')]);return db[_0x4874('0x4f')][_0x4874('0x46')](_0x10055[_0x4874('0x48')],{'include':[{'model':db[_0x4874('0x50')],'as':_0x4874('0x51')},{'model':db[_0x4874('0x50')],'as':_0x4874('0x4e')}]});}return null;})[_0x4874('0x24')](respondWithResult(_0x259c40,null))[_0x4874('0x41')](handleError(_0x259c40,null));};exports[_0x4874('0x52')]=function(_0x3bf5b7,_0x3bc36d,_0xf3dd6e){var _0x310aab=[_0x4874('0x53'),_0x4874('0x54'),'knowledge',_0x4874('0x55'),_0x4874('0x56'),_0x4874('0x57'),_0x4874('0x58'),_0x4874('0x59'),'category'];var _0x23bc83=[_0x4874('0x5a'),'made_sla',_0x4874('0x5b'),_0x4874('0x5c'),_0x4874('0x5d'),'sys_updated_on','child_incidents',_0x4874('0x54'),'approval_history','number',_0x4874('0x5e'),_0x4874('0x5f'),'opened_by',_0x4874('0x60'),_0x4874('0x61'),'sys_domain',_0x4874('0x62'),_0x4874('0x63'),'knowledge','order',_0x4874('0x64'),_0x4874('0x65'),_0x4874('0x66'),_0x4874('0x67'),_0x4874('0x68'),'active','work_notes_list',_0x4874('0x69'),'priority',_0x4874('0x6a'),_0x4874('0x6b'),'time_worked',_0x4874('0x6c'),_0x4874('0x6d'),_0x4874('0x6e'),'group_list',_0x4874('0x6f'),_0x4874('0x70'),_0x4874('0x71'),'caller_id',_0x4874('0x72'),_0x4874('0x55'),_0x4874('0x73'),_0x4874('0x74'),'close_code',_0x4874('0x75'),_0x4874('0x76'),'work_start',_0x4874('0x77'),_0x4874('0x78'),_0x4874('0x79'),'description',_0x4874('0x7a'),_0x4874('0x57'),_0x4874('0x7b'),_0x4874('0x7c'),_0x4874('0x7d'),'follow_up','parent_incident','sys_id',_0x4874('0x7e'),_0x4874('0x7f'),'incident_state',_0x4874('0x80'),_0x4874('0x81'),_0x4874('0x82'),'reassignment_count',_0x4874('0x83'),_0x4874('0x84'),_0x4874('0x59'),_0x4874('0x85'),_0x4874('0x86'),_0x4874('0x87'),_0x4874('0x88'),'due_date','sys_mod_count',_0x4874('0x89'),_0x4874('0x8a'),_0x4874('0x8b'),_0x4874('0x8c'),_0x4874('0x8d'),_0x4874('0x8e'),'category'];var _0x4cd79a='';var _0x22ac9e='';var _0x277a8a=[];var _0x2e20f9='';var _0x2ca059='';var _0x17ff7e=[];var _0x3d4d33='';var _0x596c3='';var _0x550ada={};var _0x453a20='';return db[_0x4874('0x2b')][_0x4874('0x49')]({'where':{'id':_0x3bf5b7[_0x4874('0x43')]['id']},'attributes':['id','username','password',_0x4874('0x8f'),_0x4874('0x90'),_0x4874('0x91')]})[_0x4874('0x24')](handleEntityNotFound(_0x3bc36d,null))[_0x4874('0x24')](function(_0x17c31f){if(_0x17c31f){_0x453a20=_0x17c31f[_0x4874('0x90')];var _0x2b99bb=_0x453a20[_0x4874('0x92')](-0x1);if(_0x2b99bb==='/'){_0x453a20=_0x453a20[_0x4874('0x93')](0x0,_0x453a20[_0x4874('0x94')](_0x2b99bb));}_0x596c3=util[_0x4874('0x95')](_0x4874('0x96'),_0x453a20);_0x3d4d33=util[_0x4874('0x95')](_0x4874('0x97'),_0x453a20);_0x550ada={'user':_0x17c31f[_0x4874('0x98')],'pass':_0x17c31f['password']};var _0x3f4d54={'method':_0x4874('0x99'),'uri':_0x596c3+'incident?sysparm_display_value=all','auth':_0x550ada,'json':!![]};return rp(_0x3f4d54);}})['then'](function(_0x4ec6a1){if(_0x4ec6a1[_0x4874('0x9a')]['length']>0x0){_0x4cd79a=_0x4ec6a1[_0x4874('0x9a')];}console[_0x4874('0x9b')](_0x4874('0x9c'),_0x4cd79a);_0x17ff7e=[];_0x22ac9e=Object[_0x4874('0x9d')]([],_0x4cd79a);_['remove'](_0x22ac9e,function(_0x5cc382){return!_0x310aab[_0x4874('0x9e')](_0x5cc382[_0x4874('0x27')]);});_0x22ac9e[_0x4874('0x9f')](function(_0x3839ed){var _0xd6b4de=createFieldObject(_0x3d4d33,_0x550ada,_0x3839ed[_0x4874('0xa0')],_0x3839ed[_0x4874('0x27')],_0x3839ed['label'],![]);_0x17ff7e[_0x4874('0xa1')](_0xd6b4de);});return Promise[_0x4874('0xa2')](_0x17ff7e);})[_0x4874('0x24')](function(_0x1269e9){_0x277a8a=_0x1269e9;_0x2e20f9=Object['assign']([],_0x4cd79a);console[_0x4874('0x9b')](_0x4874('0xa3'),_0x4cd79a);_[_0x4874('0xa4')](_0x2e20f9,function(_0x41b032){return _0x23bc83[_0x4874('0x9e')](_0x41b032['name']);});console[_0x4874('0x9b')](_0x4874('0xa5'),_0x2e20f9);_0x17ff7e=[];_0x2e20f9[_0x4874('0x9f')](function(_0x2cfadd){var _0x1e0edb=createFieldObject(_0x3d4d33,_0x550ada,_0x2cfadd[_0x4874('0xa0')],_0x2cfadd[_0x4874('0x27')],_0x2cfadd[_0x4874('0xa6')],!![]);_0x17ff7e[_0x4874('0xa1')](_0x1e0edb);});return Promise[_0x4874('0xa2')](_0x17ff7e);})['then'](function(_0x44d7cf){_0x2ca059=_0x44d7cf;var _0x4f0db6=_0x277a8a[_0x4874('0xa7')](_0x2ca059);return{'count':_0x4f0db6[_0x4874('0x36')],'rows':_0x4f0db6};})[_0x4874('0x24')](respondWithResult(_0x3bc36d,null))[_0x4874('0x41')](function(_0x115d9b){console['log'](_0x4874('0xa8')+_0x115d9b);var _0x115276=_0x3bf5b7['query'][_0x4874('0xa9')]?0x1f4:_0x115d9b[_0x4874('0xaa')]||0x1f4;logger['error'](_0x115d9b[_0x4874('0x26')]);delete _0x115d9b[_0x4874('0x27')];if(_0x115276===0x191){_0x115276=0x190;}_0x3bc36d[_0x4874('0x18')](_0x115276)[_0x4874('0x28')](_0x3bf5b7[_0x4874('0x30')][_0x4874('0xa9')]?{'message':_0x4874('0xab'),'statusCode':_0x115d9b['statusCode']}:_0x115d9b);});};function createFieldObject(_0x109015,_0x53635e,_0x29976d,_0x29704e,_0x2cd6e0,_0xf0d5a1){return new Promise(function(_0x224d62,_0xa94a5){var _0x2ae912={'id':_0x29704e,'name':_0x2cd6e0,'custom':_0xf0d5a1};if(_0x29976d===_0x4874('0xac')){_0x2ae912[_0x4874('0x3e')]=[{'name':_0x4874('0xad'),'value':_0x4874('0xae')},{'name':_0x4874('0xaf'),'value':_0x4874('0xb0')}];_0x224d62(_0x2ae912);}else{var _0x11766d={'method':'GET','uri':_0x109015+_0x4874('0xb1')+_0x29704e,'auth':_0x53635e,'json':!![]};return rp(_0x11766d)[_0x4874('0x24')](function(_0x36f011){var _0x30c401=[];if(_0x36f011[_0x4874('0x9a')][_0x4874('0x36')]>0x0){_0x36f011[_0x4874('0x9a')][_0x4874('0x9f')](function(_0x4d6fc4){if(_0x4d6fc4[_0x4874('0xb2')]==='false'){var _0x208791={'name':_0x4d6fc4[_0x4874('0xa6')],'value':_0x4d6fc4[_0x4874('0xb3')]};_0x30c401[_0x4874('0xa1')](_0x208791);}});}_0x2ae912['options']=_0x30c401;if(_0x2ae912[_0x4874('0x3e')][_0x4874('0x36')]>0x0){_0x224d62(_0x2ae912);}else{if(_0xf0d5a1==![]){_0x224d62();}else{_0x224d62(_0x2ae912);}}});}});} \ No newline at end of file +var _0x0c73=['made_sla','hold_reason','close_code','notify','incident_state','severity','category','parent','caused_by','upon_reject','sys_updated_on','child_incidents','approval_history','opened_by','user_input','sys_created_on','state','sys_created_by','closed_at','cmdb_ci','delivery_plan','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','business_duration','group_list','work_end','caller_id','approval_set','subcategory','work_notes','short_description','delivery_task','work_start','assignment_group','business_stc','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','sys_tags','escalation','upon_approval','correlation_id','location','username','password','email','remoteUri','slice','substring','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','push','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','all','ServiceNow\x20error:\x20','statusCode','error','boolean','True','true','False','sys_choice?sysparm_query=name=incident^element=','inactive','false','label','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','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','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','name','send','map','ServicenowAccount','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','getConfigurations','ServicenowConfiguration','pick','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','ServicenowField','Descriptions','getFields'];(function(_0x7aef09,_0x192202){var _0x224203=function(_0x864545){while(--_0x864545){_0x7aef09['push'](_0x7aef09['shift']());}};_0x224203(++_0x192202);}(_0x0c73,0x65));var _0x30c7=function(_0x3f082b,_0x30f37a){_0x3f082b=_0x3f082b-0x0;var _0x163d64=_0x0c73[_0x3f082b];return _0x163d64;};'use strict';var emlformat=require(_0x30c7('0x0'));var rimraf=require(_0x30c7('0x1'));var zipdir=require(_0x30c7('0x2'));var jsonpatch=require(_0x30c7('0x3'));var rp=require(_0x30c7('0x4'));var moment=require(_0x30c7('0x5'));var BPromise=require(_0x30c7('0x6'));var Mustache=require('mustache');var util=require(_0x30c7('0x7'));var path=require(_0x30c7('0x8'));var sox=require('sox');var csv=require(_0x30c7('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x30c7('0xa'));var _=require(_0x30c7('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x30c7('0xc'));var deskjs=require(_0x30c7('0xd'));var toCsv=require('to-csv');var querystring=require(_0x30c7('0xe'));var Papa=require(_0x30c7('0xf'));var Redis=require(_0x30c7('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x30c7('0x11'));var as=require(_0x30c7('0x12'));var hardwareService=require(_0x30c7('0x13'));var logger=require(_0x30c7('0x14'))(_0x30c7('0x15'));var utils=require(_0x30c7('0x16'));var config=require(_0x30c7('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x30c7('0x18'))['db'];var integrations=require(_0x30c7('0x19'));function respondWithStatusCode(_0x2733ed,_0x778e09){_0x778e09=_0x778e09||0xcc;return function(_0x351d6d){if(_0x351d6d){return _0x2733ed[_0x30c7('0x1a')](_0x778e09);}return _0x2733ed[_0x30c7('0x1b')](_0x778e09)[_0x30c7('0x1c')]();};}function respondWithResult(_0xe9cd92,_0x1ff58b){_0x1ff58b=_0x1ff58b||0xc8;return function(_0x46ffaa){if(_0x46ffaa){return _0xe9cd92[_0x30c7('0x1b')](_0x1ff58b)[_0x30c7('0x1d')](_0x46ffaa);}};}function respondWithFilteredResult(_0x1a0960,_0x3eab83){return function(_0x5a49b0){if(_0x5a49b0){var _0x497deb=typeof _0x3eab83['offset']===_0x30c7('0x1e')&&typeof _0x3eab83[_0x30c7('0x1f')]===_0x30c7('0x1e');var _0x3df5bc=_0x5a49b0['count'];var _0x3f7561=_0x497deb?0x0:_0x3eab83[_0x30c7('0x20')];var _0x3c5607=_0x497deb?_0x5a49b0[_0x30c7('0x21')]:_0x3eab83[_0x30c7('0x20')]+_0x3eab83[_0x30c7('0x1f')];var _0x431a4f;if(_0x3c5607>=_0x3df5bc){_0x3c5607=_0x3df5bc;_0x431a4f=0xc8;}else{_0x431a4f=0xce;}_0x1a0960[_0x30c7('0x1b')](_0x431a4f);return _0x1a0960[_0x30c7('0x22')](_0x30c7('0x23'),_0x3f7561+'-'+_0x3c5607+'/'+_0x3df5bc)[_0x30c7('0x1d')](_0x5a49b0);}return null;};}function patchUpdates(_0x20fc3d){return function(_0x3b96b7){try{jsonpatch[_0x30c7('0x24')](_0x3b96b7,_0x20fc3d,!![]);}catch(_0x2fbf7d){return BPromise['reject'](_0x2fbf7d);}return _0x3b96b7[_0x30c7('0x25')]();};}function saveUpdates(_0x37470f,_0x47e3b6){return function(_0x40584a){if(_0x40584a){return _0x40584a[_0x30c7('0x26')](_0x37470f)['then'](function(_0x5ca603){return _0x5ca603;});}return null;};}function removeEntity(_0x318ade,_0x5c69ce){return function(_0x20d5d5){if(_0x20d5d5){return _0x20d5d5['destroy']()[_0x30c7('0x27')](function(){_0x318ade['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xdabea5,_0x1cd69a){return function(_0x51488c){if(!_0x51488c){_0xdabea5[_0x30c7('0x1a')](0x194);}return _0x51488c;};}function handleError(_0x5db28f,_0x3c6f09){_0x3c6f09=_0x3c6f09||0x1f4;return function(_0x46cb6b){logger['error'](_0x46cb6b['stack']);if(_0x46cb6b[_0x30c7('0x28')]){delete _0x46cb6b[_0x30c7('0x28')];}_0x5db28f['status'](_0x3c6f09)[_0x30c7('0x29')](_0x46cb6b);};}exports['index']=function(_0x2d0b16,_0x1b03c0){var _0x37ff49={},_0x480287={},_0x4b62ed={'count':0x0,'rows':[]};var _0x2d490d=_[_0x30c7('0x2a')](db[_0x30c7('0x2b')]['rawAttributes'],function(_0x5cb875){return{'name':_0x5cb875[_0x30c7('0x2c')],'type':_0x5cb875[_0x30c7('0x2d')]['key']};});_0x480287[_0x30c7('0x2e')]=_[_0x30c7('0x2a')](_0x2d490d,_0x30c7('0x28'));_0x480287['query']=_[_0x30c7('0x2f')](_0x2d0b16[_0x30c7('0x30')]);_0x480287[_0x30c7('0x31')]=_[_0x30c7('0x32')](_0x480287['model'],_0x480287[_0x30c7('0x30')]);_0x37ff49[_0x30c7('0x33')]=_[_0x30c7('0x32')](_0x480287[_0x30c7('0x2e')],qs[_0x30c7('0x34')](_0x2d0b16[_0x30c7('0x30')]['fields']));_0x37ff49['attributes']=_0x37ff49[_0x30c7('0x33')][_0x30c7('0x35')]?_0x37ff49[_0x30c7('0x33')]:_0x480287['model'];if(!_0x2d0b16[_0x30c7('0x30')]['hasOwnProperty'](_0x30c7('0x36'))){_0x37ff49['limit']=qs[_0x30c7('0x1f')](_0x2d0b16['query'][_0x30c7('0x1f')]);_0x37ff49[_0x30c7('0x20')]=qs[_0x30c7('0x20')](_0x2d0b16[_0x30c7('0x30')][_0x30c7('0x20')]);}_0x37ff49[_0x30c7('0x37')]=qs[_0x30c7('0x38')](_0x2d0b16[_0x30c7('0x30')][_0x30c7('0x38')]);_0x37ff49[_0x30c7('0x39')]=qs[_0x30c7('0x31')](_['pick'](_0x2d0b16['query'],_0x480287[_0x30c7('0x31')]),_0x2d490d);if(_0x2d0b16[_0x30c7('0x30')][_0x30c7('0x3a')]){_0x37ff49['where']=_[_0x30c7('0x3b')](_0x37ff49['where'],{'$or':_['map'](_0x2d490d,function(_0x460181){if(_0x460181[_0x30c7('0x2d')]!==_0x30c7('0x3c')){var _0x2cfe92={};_0x2cfe92[_0x460181[_0x30c7('0x28')]]={'$like':'%'+_0x2d0b16[_0x30c7('0x30')][_0x30c7('0x3a')]+'%'};return _0x2cfe92;}})});}_0x37ff49=_[_0x30c7('0x3b')]({},_0x37ff49,_0x2d0b16[_0x30c7('0x3d')]);var _0x801b3c={'where':_0x37ff49[_0x30c7('0x39')]};return db['ServicenowAccount'][_0x30c7('0x21')](_0x801b3c)[_0x30c7('0x27')](function(_0x49b5ef){_0x4b62ed[_0x30c7('0x21')]=_0x49b5ef;if(_0x2d0b16[_0x30c7('0x30')][_0x30c7('0x3e')]){_0x37ff49[_0x30c7('0x3f')]=[{'all':!![]}];}return db['ServicenowAccount'][_0x30c7('0x40')](_0x37ff49);})[_0x30c7('0x27')](function(_0x2eae6e){_0x4b62ed[_0x30c7('0x41')]=_0x2eae6e;return _0x4b62ed;})[_0x30c7('0x27')](respondWithFilteredResult(_0x1b03c0,_0x37ff49))[_0x30c7('0x42')](handleError(_0x1b03c0,null));};exports[_0x30c7('0x43')]=function(_0x3841a1,_0x32e38b){var _0x3c9377={'raw':![],'where':{'id':_0x3841a1[_0x30c7('0x44')]['id']}},_0x5e0abf={};_0x5e0abf[_0x30c7('0x2e')]=_[_0x30c7('0x2f')](db[_0x30c7('0x2b')][_0x30c7('0x45')]);_0x5e0abf[_0x30c7('0x30')]=_[_0x30c7('0x2f')](_0x3841a1[_0x30c7('0x30')]);_0x5e0abf[_0x30c7('0x31')]=_[_0x30c7('0x32')](_0x5e0abf['model'],_0x5e0abf[_0x30c7('0x30')]);_0x3c9377[_0x30c7('0x33')]=_[_0x30c7('0x32')](_0x5e0abf[_0x30c7('0x2e')],qs[_0x30c7('0x34')](_0x3841a1[_0x30c7('0x30')][_0x30c7('0x34')]));_0x3c9377[_0x30c7('0x33')]=_0x3c9377[_0x30c7('0x33')][_0x30c7('0x35')]?_0x3c9377[_0x30c7('0x33')]:_0x5e0abf[_0x30c7('0x2e')];if(_0x3841a1[_0x30c7('0x30')][_0x30c7('0x3e')]){_0x3c9377[_0x30c7('0x3f')]=[{'all':!![]}];}_0x3c9377=_['merge']({},_0x3c9377,_0x3841a1[_0x30c7('0x3d')]);return db[_0x30c7('0x2b')][_0x30c7('0x46')](_0x3c9377)[_0x30c7('0x27')](handleEntityNotFound(_0x32e38b,null))[_0x30c7('0x27')](respondWithResult(_0x32e38b,null))['catch'](handleError(_0x32e38b,null));};exports[_0x30c7('0x47')]=function(_0x30ffa2,_0x4cec8f){return db['ServicenowAccount'][_0x30c7('0x47')](_0x30ffa2[_0x30c7('0x48')],{})[_0x30c7('0x27')](respondWithResult(_0x4cec8f,0xc9))[_0x30c7('0x42')](handleError(_0x4cec8f,null));};exports[_0x30c7('0x26')]=function(_0x3722b2,_0xd86780){if(_0x3722b2[_0x30c7('0x48')]['id']){delete _0x3722b2[_0x30c7('0x48')]['id'];}return db[_0x30c7('0x2b')]['find']({'where':{'id':_0x3722b2[_0x30c7('0x44')]['id']}})[_0x30c7('0x27')](handleEntityNotFound(_0xd86780,null))[_0x30c7('0x27')](saveUpdates(_0x3722b2[_0x30c7('0x48')],null))[_0x30c7('0x27')](respondWithResult(_0xd86780,null))['catch'](handleError(_0xd86780,null));};exports['destroy']=function(_0x8065d2,_0x2f56c2){return db[_0x30c7('0x2b')]['find']({'where':{'id':_0x8065d2[_0x30c7('0x44')]['id']}})[_0x30c7('0x27')](handleEntityNotFound(_0x2f56c2,null))[_0x30c7('0x27')](removeEntity(_0x2f56c2,null))[_0x30c7('0x42')](handleError(_0x2f56c2,null));};exports[_0x30c7('0x49')]=function(_0x2e0a40,_0x3beb6e,_0x2296b3){var _0x113d29={};var _0x18f12d={};var _0x4e6e3e;var _0x207619;return db[_0x30c7('0x2b')]['findOne']({'where':{'id':_0x2e0a40[_0x30c7('0x44')]['id']}})['then'](handleEntityNotFound(_0x3beb6e,null))[_0x30c7('0x27')](function(_0x3e076c){if(_0x3e076c){_0x4e6e3e=_0x3e076c;_0x18f12d[_0x30c7('0x2e')]=_[_0x30c7('0x2f')](db[_0x30c7('0x4a')][_0x30c7('0x45')]);_0x18f12d['query']=_['keys'](_0x2e0a40[_0x30c7('0x30')]);_0x18f12d[_0x30c7('0x31')]=_['intersection'](_0x18f12d[_0x30c7('0x2e')],_0x18f12d[_0x30c7('0x30')]);_0x113d29[_0x30c7('0x33')]=_['intersection'](_0x18f12d['model'],qs[_0x30c7('0x34')](_0x2e0a40[_0x30c7('0x30')][_0x30c7('0x34')]));_0x113d29['attributes']=_0x113d29['attributes'][_0x30c7('0x35')]?_0x113d29[_0x30c7('0x33')]:_0x18f12d[_0x30c7('0x2e')];_0x113d29[_0x30c7('0x37')]=qs[_0x30c7('0x38')](_0x2e0a40['query'][_0x30c7('0x38')]);_0x113d29['where']=qs['filters'](_[_0x30c7('0x4b')](_0x2e0a40[_0x30c7('0x30')],_0x18f12d[_0x30c7('0x31')]));if(_0x2e0a40[_0x30c7('0x30')][_0x30c7('0x3a')]){_0x113d29[_0x30c7('0x39')]=_[_0x30c7('0x3b')](_0x113d29[_0x30c7('0x39')],{'$or':_['map'](_0x113d29[_0x30c7('0x33')],function(_0x55a256){var _0x3f97e6={};_0x3f97e6[_0x55a256]={'$like':'%'+_0x2e0a40['query'][_0x30c7('0x3a')]+'%'};return _0x3f97e6;})});}_0x113d29=_['merge']({},_0x113d29,_0x2e0a40[_0x30c7('0x3d')]);return _0x4e6e3e['getConfigurations'](_0x113d29);}})['then'](function(_0x16361d){if(_0x16361d){_0x207619=_0x16361d['length'];if(!_0x2e0a40[_0x30c7('0x30')][_0x30c7('0x4c')](_0x30c7('0x36'))){_0x113d29[_0x30c7('0x1f')]=qs['limit'](_0x2e0a40['query'][_0x30c7('0x1f')]);_0x113d29['offset']=qs[_0x30c7('0x20')](_0x2e0a40[_0x30c7('0x30')][_0x30c7('0x20')]);}return _0x4e6e3e[_0x30c7('0x49')](_0x113d29);}})[_0x30c7('0x27')](function(_0x46bc3f){if(_0x46bc3f){return _0x46bc3f?{'count':_0x207619,'rows':_0x46bc3f}:null;}})[_0x30c7('0x27')](respondWithResult(_0x3beb6e,null))['catch'](handleError(_0x3beb6e,null));};exports[_0x30c7('0x4d')]=function(_0x3cbe97,_0x45e34c,_0x4bb48a){if(_0x3cbe97[_0x30c7('0x48')]['id']){delete _0x3cbe97['body']['id'];}return db[_0x30c7('0x2b')]['findOne']({'where':{'id':_0x3cbe97[_0x30c7('0x44')]['id']}})[_0x30c7('0x27')](handleEntityNotFound(_0x45e34c,null))[_0x30c7('0x27')](function(_0x1a9164){if(_0x1a9164){_0x3cbe97[_0x30c7('0x48')][_0x30c7('0x4e')]=_0x1a9164['id'];_0x3cbe97[_0x30c7('0x48')][_0x30c7('0x4f')]=integrations[_0x30c7('0x50')](_0x3cbe97[_0x30c7('0x48')][_0x30c7('0x51')],_0x3cbe97[_0x30c7('0x48')]['type']);_0x3cbe97['body']['Descriptions']=integrations[_0x30c7('0x52')](_0x3cbe97[_0x30c7('0x48')]['channel'],_0x3cbe97[_0x30c7('0x48')][_0x30c7('0x2d')]);return db['ServicenowConfiguration'][_0x30c7('0x47')](_0x3cbe97[_0x30c7('0x48')],{'include':[{'model':db[_0x30c7('0x53')],'as':_0x30c7('0x4f')},{'model':db[_0x30c7('0x53')],'as':_0x30c7('0x54')}]});}return null;})[_0x30c7('0x27')](respondWithResult(_0x45e34c,null))[_0x30c7('0x42')](handleError(_0x45e34c,null));};exports[_0x30c7('0x55')]=function(_0x287c02,_0x20f61b,_0x680d0a){var _0x87db3e=[_0x30c7('0x56'),_0x30c7('0x57'),'knowledge','subcategory',_0x30c7('0x58'),_0x30c7('0x59'),_0x30c7('0x5a'),_0x30c7('0x5b'),_0x30c7('0x5c')];var _0x26a6cc=[_0x30c7('0x5d'),_0x30c7('0x56'),_0x30c7('0x5e'),'watch_list',_0x30c7('0x5f'),_0x30c7('0x60'),_0x30c7('0x61'),_0x30c7('0x57'),_0x30c7('0x62'),'number','resolved_by','sys_updated_by',_0x30c7('0x63'),_0x30c7('0x64'),_0x30c7('0x65'),'sys_domain',_0x30c7('0x66'),_0x30c7('0x67'),'knowledge',_0x30c7('0x37'),'calendar_stc',_0x30c7('0x68'),_0x30c7('0x69'),_0x30c7('0x6a'),'impact',_0x30c7('0x6b'),_0x30c7('0x6c'),_0x30c7('0x6d'),_0x30c7('0x6e'),_0x30c7('0x6f'),_0x30c7('0x70'),_0x30c7('0x71'),'expected_start','opened_at',_0x30c7('0x72'),_0x30c7('0x73'),_0x30c7('0x74'),'reopened_time','resolved_at',_0x30c7('0x75'),_0x30c7('0x76'),_0x30c7('0x77'),_0x30c7('0x78'),_0x30c7('0x79'),_0x30c7('0x58'),'correlation_display',_0x30c7('0x7a'),_0x30c7('0x7b'),_0x30c7('0x7c'),_0x30c7('0x7d'),'additional_assignee_list',_0x30c7('0x7e'),_0x30c7('0x7f'),_0x30c7('0x59'),_0x30c7('0x80'),_0x30c7('0x81'),_0x30c7('0x82'),_0x30c7('0x83'),_0x30c7('0x84'),_0x30c7('0x85'),_0x30c7('0x86'),'reopened_by',_0x30c7('0x5a'),_0x30c7('0x87'),_0x30c7('0x88'),_0x30c7('0x89'),_0x30c7('0x8a'),_0x30c7('0x8b'),_0x30c7('0x8c'),'severity',_0x30c7('0x8d'),_0x30c7('0x8e'),_0x30c7('0x8f'),_0x30c7('0x90'),_0x30c7('0x91'),_0x30c7('0x92'),'reopen_count',_0x30c7('0x93'),_0x30c7('0x94'),_0x30c7('0x95'),_0x30c7('0x96'),_0x30c7('0x97'),_0x30c7('0x5c')];var _0x2346f6='';var _0x49acac='';var _0x3e39c5=[];var _0x446bca='';var _0x52e541='';var _0x2cc94d=[];var _0x56ebc5='';var _0x2007e1='';var _0x5514b0={};var _0x40c1cf='';return db[_0x30c7('0x2b')]['findOne']({'where':{'id':_0x287c02['params']['id']},'attributes':['id',_0x30c7('0x98'),_0x30c7('0x99'),_0x30c7('0x9a'),_0x30c7('0x9b'),'serverUrl']})[_0x30c7('0x27')](handleEntityNotFound(_0x20f61b,null))[_0x30c7('0x27')](function(_0x11a5a0){if(_0x11a5a0){_0x40c1cf=_0x11a5a0[_0x30c7('0x9b')];var _0x3db157=_0x40c1cf[_0x30c7('0x9c')](-0x1);if(_0x3db157==='/'){_0x40c1cf=_0x40c1cf[_0x30c7('0x9d')](0x0,_0x40c1cf['lastIndexOf'](_0x3db157));}_0x2007e1=util[_0x30c7('0x9e')](_0x30c7('0x9f'),_0x40c1cf);_0x56ebc5=util[_0x30c7('0x9e')](_0x30c7('0xa0'),_0x40c1cf);_0x5514b0={'user':_0x11a5a0[_0x30c7('0x98')],'pass':_0x11a5a0[_0x30c7('0x99')]};var _0x1353c7={'method':_0x30c7('0xa1'),'uri':_0x2007e1+_0x30c7('0xa2'),'auth':_0x5514b0,'json':!![]};return rp(_0x1353c7);}})[_0x30c7('0x27')](function(_0x52e713){if(_0x52e713['result'][_0x30c7('0x35')]>0x0){_0x2346f6=_0x52e713[_0x30c7('0xa3')];}console[_0x30c7('0xa4')](_0x30c7('0xa5'),_0x2346f6);_0x2cc94d=[];_0x49acac=Object[_0x30c7('0xa6')]([],_0x2346f6);_[_0x30c7('0xa7')](_0x49acac,function(_0x232f40){return!_0x87db3e[_0x30c7('0xa8')](_0x232f40[_0x30c7('0x28')]);});_0x49acac[_0x30c7('0xa9')](function(_0xcb90e3){var _0x54a9e2=createFieldObject(_0x56ebc5,_0x5514b0,_0xcb90e3[_0x30c7('0xaa')],_0xcb90e3[_0x30c7('0x28')],_0xcb90e3['label'],![]);_0x2cc94d[_0x30c7('0xab')](_0x54a9e2);});return Promise['all'](_0x2cc94d);})[_0x30c7('0x27')](function(_0x1c6557){_0x3e39c5=_0x1c6557;_0x446bca=Object[_0x30c7('0xa6')]([],_0x2346f6);console[_0x30c7('0xa4')](_0x30c7('0xac'),_0x2346f6);_['remove'](_0x446bca,function(_0x1dadb8){return _0x26a6cc[_0x30c7('0xa8')](_0x1dadb8[_0x30c7('0x28')]);});console[_0x30c7('0xa4')](_0x30c7('0xad'),_0x446bca);_0x2cc94d=[];_0x446bca[_0x30c7('0xa9')](function(_0x20c586){var _0x1008ab=createFieldObject(_0x56ebc5,_0x5514b0,_0x20c586[_0x30c7('0xaa')],_0x20c586['name'],_0x20c586['label'],!![]);_0x2cc94d[_0x30c7('0xab')](_0x1008ab);});return Promise[_0x30c7('0xae')](_0x2cc94d);})['then'](function(_0xcf64ad){_0x52e541=_0xcf64ad;var _0x32717a=_0x3e39c5['concat'](_0x52e541);return{'count':_0x32717a[_0x30c7('0x35')],'rows':_0x32717a};})[_0x30c7('0x27')](respondWithResult(_0x20f61b,null))[_0x30c7('0x42')](function(_0x5419d8){console[_0x30c7('0xa4')](_0x30c7('0xaf')+_0x5419d8);var _0x29f28c=_0x287c02[_0x30c7('0x30')]['test']?0x1f4:_0x5419d8[_0x30c7('0xb0')]||0x1f4;logger[_0x30c7('0xb1')](_0x5419d8['stack']);delete _0x5419d8[_0x30c7('0x28')];if(_0x29f28c===0x191){_0x29f28c=0x190;}_0x20f61b[_0x30c7('0x1b')](_0x29f28c)[_0x30c7('0x29')](_0x287c02['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x5419d8[_0x30c7('0xb0')]}:_0x5419d8);});};function createFieldObject(_0x8896cf,_0x26fa3a,_0x451f25,_0x3bed40,_0x2bbba4,_0x50e8be){return new Promise(function(_0x5ab5a2,_0x1e25d0){var _0x6c01d4={'id':_0x3bed40,'name':_0x2bbba4,'custom':_0x50e8be};if(_0x451f25===_0x30c7('0xb2')){_0x6c01d4[_0x30c7('0x3d')]=[{'name':_0x30c7('0xb3'),'value':_0x30c7('0xb4')},{'name':_0x30c7('0xb5'),'value':'false'}];_0x5ab5a2(_0x6c01d4);}else{var _0x45e4d8={'method':_0x30c7('0xa1'),'uri':_0x8896cf+_0x30c7('0xb6')+_0x3bed40,'auth':_0x26fa3a,'json':!![]};return rp(_0x45e4d8)[_0x30c7('0x27')](function(_0x54bcb9){var _0x36560b=[];if(_0x54bcb9[_0x30c7('0xa3')]['length']>0x0){_0x54bcb9[_0x30c7('0xa3')][_0x30c7('0xa9')](function(_0x5dafae){if(_0x5dafae[_0x30c7('0xb7')]===_0x30c7('0xb8')){var _0x591b9b={'name':_0x5dafae[_0x30c7('0xb9')],'value':_0x5dafae[_0x30c7('0xba')]};_0x36560b[_0x30c7('0xab')](_0x591b9b);}});}_0x6c01d4[_0x30c7('0x3d')]=_0x36560b;if(_0x6c01d4['options'][_0x30c7('0x35')]>0x0){_0x5ab5a2(_0x6c01d4);}else{if(_0x50e8be==![]){_0x5ab5a2();}else{_0x5ab5a2(_0x6c01d4);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 26d782e..23cb94d 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 _0xd8fb=['../../components/integrations/configuration','define','int_servicenow_accounts','lodash','util','../../config/logger','api','path','rimraf','./intServicenowAccount.attributes'];(function(_0xfbe34f,_0x57d59f){var _0x437c1c=function(_0x5e2de1){while(--_0x5e2de1){_0xfbe34f['push'](_0xfbe34f['shift']());}};_0x437c1c(++_0x57d59f);}(_0xd8fb,0x99));var _0xbd8f=function(_0x6ffaa6,_0x2e7fa4){_0x6ffaa6=_0x6ffaa6-0x0;var _0x1eee92=_0xd8fb[_0x6ffaa6];return _0x1eee92;};'use strict';var _=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var logger=require(_0xbd8f('0x2'))(_0xbd8f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbd8f('0x4'));var rimraf=require(_0xbd8f('0x5'));var config=require('../../config/environment');var attributes=require(_0xbd8f('0x6'));var integrations=require(_0xbd8f('0x7'));module['exports']=function(_0x33d541,_0x4e97cf){return _0x33d541[_0xbd8f('0x8')]('ServicenowAccount',attributes,{'tableName':_0xbd8f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc1c6=['rimraf','../../components/integrations/configuration','define','ServicenowAccount','int_servicenow_accounts','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x1f20db,_0x10f8f7){var _0xcc4c54=function(_0x58ad43){while(--_0x58ad43){_0x1f20db['push'](_0x1f20db['shift']());}};_0xcc4c54(++_0x10f8f7);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x34ba93,_0x3cf066){_0x34ba93=_0x34ba93-0x0;var _0xd05246=_0xc1c6[_0x34ba93];return _0xd05246;};'use strict';var _=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var logger=require(_0x6c1c('0x2'))('api');var moment=require(_0x6c1c('0x3'));var BPromise=require('bluebird');var rp=require(_0x6c1c('0x4'));var fs=require('fs');var path=require(_0x6c1c('0x5'));var rimraf=require(_0x6c1c('0x6'));var config=require('../../config/environment');var attributes=require('./intServicenowAccount.attributes');var integrations=require(_0x6c1c('0x7'));module['exports']=function(_0x50c1bb,_0x582bec){return _0x50c1bb[_0x6c1c('0x8')](_0x6c1c('0x9'),attributes,{'tableName':_0x6c1c('0xa'),'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 7b96102..c5d4f9f 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 _0xdb8e=['findAll','options','raw','attributes','map','include','model','catch','ShowServicenowAccount','find','where','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','http','then','info','ServicenowAccount,\x20%s,\x20%s','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','GetServicenowAccount','ServicenowAccount'];(function(_0x47d4d5,_0xdc7cfe){var _0x131da5=function(_0x3abbd4){while(--_0x3abbd4){_0x47d4d5['push'](_0x47d4d5['shift']());}};_0x131da5(++_0xdc7cfe);}(_0xdb8e,0x16b));var _0xedb8=function(_0x46f7f0,_0x4ef418){_0x46f7f0=_0x46f7f0-0x0;var _0x783786=_0xdb8e[_0x46f7f0];return _0x783786;};'use strict';var _=require('lodash');var util=require(_0xedb8('0x0'));var moment=require(_0xedb8('0x1'));var BPromise=require(_0xedb8('0x2'));var rs=require(_0xedb8('0x3'));var fs=require('fs');var Redis=require(_0xedb8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xedb8('0x5'));var logger=require('../../config/logger')(_0xedb8('0x6'));var config=require('../../config/environment');var jayson=require(_0xedb8('0x7'));var client=jayson['client'][_0xedb8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4ce5c5,_0x254f3d,_0x1f4b11){return new BPromise(function(_0x5d28d7,_0x157cf0){return client['request'](_0x4ce5c5,_0x1f4b11)[_0xedb8('0x9')](function(_0x3afc3d){logger[_0xedb8('0xa')](_0xedb8('0xb'),_0x254f3d,'request\x20sent');logger[_0xedb8('0xc')](_0xedb8('0xd'),_0x254f3d,_0xedb8('0xe'),JSON[_0xedb8('0xf')](_0x3afc3d));if(_0x3afc3d[_0xedb8('0x10')]){if(_0x3afc3d['error'][_0xedb8('0x11')]===0x1f4){logger[_0xedb8('0x10')]('ServicenowAccount,\x20%s,\x20%s',_0x254f3d,_0x3afc3d[_0xedb8('0x10')][_0xedb8('0x12')]);return _0x157cf0(_0x3afc3d[_0xedb8('0x10')]['message']);}logger[_0xedb8('0x10')]('ServicenowAccount,\x20%s,\x20%s',_0x254f3d,_0x3afc3d[_0xedb8('0x10')][_0xedb8('0x12')]);return _0x5d28d7(_0x3afc3d[_0xedb8('0x10')]['message']);}else{logger[_0xedb8('0xa')]('ServicenowAccount,\x20%s,\x20%s',_0x254f3d,'request\x20sent');_0x5d28d7(_0x3afc3d['result'][_0xedb8('0x12')]);}})['catch'](function(_0x262b2a){logger[_0xedb8('0x10')](_0xedb8('0xb'),_0x254f3d,_0x262b2a);_0x157cf0(_0x262b2a);});});}exports[_0xedb8('0x13')]=function(_0x312f1d){var _0xb27e1=this;return new Promise(function(_0x158f00,_0x520c1b){return db[_0xedb8('0x14')][_0xedb8('0x15')]({'raw':_0x312f1d[_0xedb8('0x16')]?_0x312f1d['options'][_0xedb8('0x17')]===undefined?!![]:![]:!![],'where':_0x312f1d[_0xedb8('0x16')]?_0x312f1d[_0xedb8('0x16')]['where']||null:null,'attributes':_0x312f1d['options']?_0x312f1d[_0xedb8('0x16')][_0xedb8('0x18')]||null:null,'limit':_0x312f1d[_0xedb8('0x16')]?_0x312f1d[_0xedb8('0x16')]['limit']||null:null,'include':_0x312f1d[_0xedb8('0x16')]?_0x312f1d[_0xedb8('0x16')]['include']?_[_0xedb8('0x19')](_0x312f1d['options'][_0xedb8('0x1a')],function(_0x4dae8b){return{'model':db[_0x4dae8b['model']],'as':_0x4dae8b['as'],'attributes':_0x4dae8b[_0xedb8('0x18')],'include':_0x4dae8b[_0xedb8('0x1a')]?_[_0xedb8('0x19')](_0x4dae8b[_0xedb8('0x1a')],function(_0x445679){return{'model':db[_0x445679[_0xedb8('0x1b')]],'as':_0x445679['as'],'attributes':_0x445679[_0xedb8('0x18')],'include':_0x445679['include']?_[_0xedb8('0x19')](_0x445679['include'],function(_0x122a88){return{'model':db[_0x122a88['model']],'as':_0x122a88['as'],'attributes':_0x122a88[_0xedb8('0x18')]};}):[]};}):[]};}):[]:[]})[_0xedb8('0x9')](function(_0x230f04){logger[_0xedb8('0xa')](_0xedb8('0x13'),_0x312f1d);logger[_0xedb8('0xc')](_0xedb8('0x13'),_0x312f1d,JSON[_0xedb8('0xf')](_0x230f04));_0x158f00(_0x230f04);})[_0xedb8('0x1c')](function(_0x42ed34){logger[_0xedb8('0x10')](_0xedb8('0x13'),_0x42ed34[_0xedb8('0x12')],_0x312f1d);_0x520c1b(_0xb27e1[_0xedb8('0x10')](0x1f4,_0x42ed34['message']));});});};exports[_0xedb8('0x1d')]=function(_0x49158d){var _0x388d4f=this;return new Promise(function(_0x3b9b70,_0x5611a7){return db[_0xedb8('0x14')][_0xedb8('0x1e')]({'raw':_0x49158d[_0xedb8('0x16')]?_0x49158d[_0xedb8('0x16')][_0xedb8('0x17')]===undefined?!![]:![]:!![],'where':_0x49158d[_0xedb8('0x16')]?_0x49158d[_0xedb8('0x16')][_0xedb8('0x1f')]||null:null,'attributes':_0x49158d[_0xedb8('0x16')]?_0x49158d[_0xedb8('0x16')][_0xedb8('0x18')]||null:null,'include':_0x49158d[_0xedb8('0x16')]?_0x49158d[_0xedb8('0x16')][_0xedb8('0x1a')]?_[_0xedb8('0x19')](_0x49158d[_0xedb8('0x16')]['include'],function(_0x4ef62b){return{'model':db[_0x4ef62b['model']],'as':_0x4ef62b['as'],'attributes':_0x4ef62b[_0xedb8('0x18')],'include':_0x4ef62b[_0xedb8('0x1a')]?_[_0xedb8('0x19')](_0x4ef62b['include'],function(_0x28b71b){return{'model':db[_0x28b71b['model']],'as':_0x28b71b['as'],'attributes':_0x28b71b['attributes'],'include':_0x28b71b[_0xedb8('0x1a')]?_[_0xedb8('0x19')](_0x28b71b['include'],function(_0x474635){return{'model':db[_0x474635[_0xedb8('0x1b')]],'as':_0x474635['as'],'attributes':_0x474635[_0xedb8('0x18')]};}):[]};}):[]};}):[]:[]})[_0xedb8('0x9')](function(_0x275e8c){logger[_0xedb8('0xa')](_0xedb8('0x1d'),_0x49158d);logger[_0xedb8('0xc')](_0xedb8('0x1d'),_0x49158d,JSON['stringify'](_0x275e8c));_0x3b9b70(_0x275e8c);})[_0xedb8('0x1c')](function(_0xe6951e){logger[_0xedb8('0x10')]('ShowServicenowAccount',_0xe6951e[_0xedb8('0x12')],_0x49158d);_0x5611a7(_0x388d4f['error'](0x1f4,_0xe6951e[_0xedb8('0x12')]));});});}; \ No newline at end of file +var _0xad7b=['request','then','info','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','ServicenowAccount,\x20%s,\x20%s','message','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','attributes','include','model','map','debug','ShowServicenowAccount','stringify','lodash','util','moment','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xcb14cb,_0x102701){var _0x4ef068=function(_0x343870){while(--_0x343870){_0xcb14cb['push'](_0xcb14cb['shift']());}};_0x4ef068(++_0x102701);}(_0xad7b,0x1e5));var _0xbad7=function(_0x3c22ee,_0x16d31a){_0x3c22ee=_0x3c22ee-0x0;var _0x30d59b=_0xad7b[_0x3c22ee];return _0x30d59b;};'use strict';var _=require(_0xbad7('0x0'));var util=require(_0xbad7('0x1'));var moment=require(_0xbad7('0x2'));var BPromise=require('bluebird');var rs=require(_0xbad7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbad7('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xbad7('0x5'));var config=require(_0xbad7('0x6'));var jayson=require(_0xbad7('0x7'));var client=jayson[_0xbad7('0x8')][_0xbad7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x49484d,_0x201841,_0x31be09){return new BPromise(function(_0x2625cf,_0x17e4ba){return client[_0xbad7('0xa')](_0x49484d,_0x31be09)[_0xbad7('0xb')](function(_0xb5f3f0){logger[_0xbad7('0xc')]('ServicenowAccount,\x20%s,\x20%s',_0x201841,_0xbad7('0xd'));logger['debug'](_0xbad7('0xe'),_0x201841,_0xbad7('0xd'),JSON['stringify'](_0xb5f3f0));if(_0xb5f3f0[_0xbad7('0xf')]){if(_0xb5f3f0[_0xbad7('0xf')]['code']===0x1f4){logger[_0xbad7('0xf')](_0xbad7('0x10'),_0x201841,_0xb5f3f0['error'][_0xbad7('0x11')]);return _0x17e4ba(_0xb5f3f0[_0xbad7('0xf')][_0xbad7('0x11')]);}logger[_0xbad7('0xf')](_0xbad7('0x10'),_0x201841,_0xb5f3f0[_0xbad7('0xf')][_0xbad7('0x11')]);return _0x2625cf(_0xb5f3f0[_0xbad7('0xf')]['message']);}else{logger['info'](_0xbad7('0x10'),_0x201841,'request\x20sent');_0x2625cf(_0xb5f3f0[_0xbad7('0x12')][_0xbad7('0x11')]);}})[_0xbad7('0x13')](function(_0x14cd0a){logger[_0xbad7('0xf')](_0xbad7('0x10'),_0x201841,_0x14cd0a);_0x17e4ba(_0x14cd0a);});});}exports[_0xbad7('0x14')]=function(_0x3fc6a5){var _0x3dabfc=this;return new Promise(function(_0x4f58ac,_0x14f788){return db[_0xbad7('0x15')][_0xbad7('0x16')]({'raw':_0x3fc6a5[_0xbad7('0x17')]?_0x3fc6a5['options'][_0xbad7('0x18')]===undefined?!![]:![]:!![],'where':_0x3fc6a5[_0xbad7('0x17')]?_0x3fc6a5['options'][_0xbad7('0x19')]||null:null,'attributes':_0x3fc6a5['options']?_0x3fc6a5[_0xbad7('0x17')][_0xbad7('0x1a')]||null:null,'limit':_0x3fc6a5[_0xbad7('0x17')]?_0x3fc6a5['options']['limit']||null:null,'include':_0x3fc6a5[_0xbad7('0x17')]?_0x3fc6a5[_0xbad7('0x17')][_0xbad7('0x1b')]?_['map'](_0x3fc6a5[_0xbad7('0x17')][_0xbad7('0x1b')],function(_0x1211dc){return{'model':db[_0x1211dc[_0xbad7('0x1c')]],'as':_0x1211dc['as'],'attributes':_0x1211dc['attributes'],'include':_0x1211dc[_0xbad7('0x1b')]?_[_0xbad7('0x1d')](_0x1211dc['include'],function(_0x15ff3d){return{'model':db[_0x15ff3d[_0xbad7('0x1c')]],'as':_0x15ff3d['as'],'attributes':_0x15ff3d['attributes'],'include':_0x15ff3d[_0xbad7('0x1b')]?_[_0xbad7('0x1d')](_0x15ff3d['include'],function(_0x486e3b){return{'model':db[_0x486e3b[_0xbad7('0x1c')]],'as':_0x486e3b['as'],'attributes':_0x486e3b[_0xbad7('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1239f2){logger[_0xbad7('0xc')](_0xbad7('0x14'),_0x3fc6a5);logger[_0xbad7('0x1e')](_0xbad7('0x14'),_0x3fc6a5,JSON['stringify'](_0x1239f2));_0x4f58ac(_0x1239f2);})[_0xbad7('0x13')](function(_0x307408){logger[_0xbad7('0xf')](_0xbad7('0x14'),_0x307408[_0xbad7('0x11')],_0x3fc6a5);_0x14f788(_0x3dabfc[_0xbad7('0xf')](0x1f4,_0x307408[_0xbad7('0x11')]));});});};exports[_0xbad7('0x1f')]=function(_0x40d0da){var _0x4dc7a9=this;return new Promise(function(_0x3cf5c7,_0x483330){return db[_0xbad7('0x15')]['find']({'raw':_0x40d0da[_0xbad7('0x17')]?_0x40d0da[_0xbad7('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x40d0da[_0xbad7('0x17')]?_0x40d0da[_0xbad7('0x17')][_0xbad7('0x19')]||null:null,'attributes':_0x40d0da['options']?_0x40d0da[_0xbad7('0x17')][_0xbad7('0x1a')]||null:null,'include':_0x40d0da['options']?_0x40d0da[_0xbad7('0x17')][_0xbad7('0x1b')]?_[_0xbad7('0x1d')](_0x40d0da[_0xbad7('0x17')]['include'],function(_0xa1418e){return{'model':db[_0xa1418e[_0xbad7('0x1c')]],'as':_0xa1418e['as'],'attributes':_0xa1418e[_0xbad7('0x1a')],'include':_0xa1418e['include']?_['map'](_0xa1418e[_0xbad7('0x1b')],function(_0x49c4ce){return{'model':db[_0x49c4ce[_0xbad7('0x1c')]],'as':_0x49c4ce['as'],'attributes':_0x49c4ce[_0xbad7('0x1a')],'include':_0x49c4ce[_0xbad7('0x1b')]?_[_0xbad7('0x1d')](_0x49c4ce[_0xbad7('0x1b')],function(_0x3e2b0f){return{'model':db[_0x3e2b0f['model']],'as':_0x3e2b0f['as'],'attributes':_0x3e2b0f[_0xbad7('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x202d42){logger['info'](_0xbad7('0x1f'),_0x40d0da);logger[_0xbad7('0x1e')](_0xbad7('0x1f'),_0x40d0da,JSON[_0xbad7('0x20')](_0x202d42));_0x3cf5c7(_0x202d42);})[_0xbad7('0x13')](function(_0xc03e08){logger[_0xbad7('0xf')](_0xbad7('0x1f'),_0xc03e08[_0xbad7('0x11')],_0x40d0da);_0x483330(_0x4dc7a9['error'](0x1f4,_0xc03e08['message']));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 0841df5..800ad6a 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 _0x3ec0=['show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated'];(function(_0x136c56,_0xaa9c2a){var _0x29b919=function(_0x228632){while(--_0x228632){_0x136c56['push'](_0x136c56['shift']());}};_0x29b919(++_0xaa9c2a);}(_0x3ec0,0x12c));var _0x03ec=function(_0x5769c9,_0x56a8b7){_0x5769c9=_0x5769c9-0x0;var _0x523a9a=_0x3ec0[_0x5769c9];return _0x523a9a;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x03ec('0x0'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x03ec('0x1'));var interaction=require(_0x03ec('0x2'));var config=require(_0x03ec('0x3'));var controller=require('./intServicenowConfiguration.controller');router[_0x03ec('0x4')]('/',auth['isAuthenticated'](),controller[_0x03ec('0x5')]);router[_0x03ec('0x4')](_0x03ec('0x6'),auth[_0x03ec('0x7')](),controller[_0x03ec('0x8')]);router['get'](_0x03ec('0x9'),auth['isAuthenticated'](),controller[_0x03ec('0xa')]);router[_0x03ec('0x4')](_0x03ec('0xb'),auth['isAuthenticated'](),controller[_0x03ec('0xc')]);router[_0x03ec('0x4')](_0x03ec('0xd'),auth[_0x03ec('0x7')](),controller[_0x03ec('0xe')]);router[_0x03ec('0xf')]('/',auth[_0x03ec('0x7')](),controller[_0x03ec('0x10')]);router[_0x03ec('0x11')](_0x03ec('0x6'),auth[_0x03ec('0x7')](),controller[_0x03ec('0x12')]);router[_0x03ec('0x13')](_0x03ec('0x6'),auth[_0x03ec('0x7')](),controller[_0x03ec('0x14')]);module[_0x03ec('0x15')]=router; \ No newline at end of file +var _0xde19=['/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','isAuthenticated','index','get'];(function(_0x340916,_0x2b1417){var _0x489be0=function(_0x43a51a){while(--_0x43a51a){_0x340916['push'](_0x340916['shift']());}};_0x489be0(++_0x2b1417);}(_0xde19,0x1b5));var _0x9de1=function(_0x55036a,_0x1e43dc){_0x55036a=_0x55036a-0x0;var _0x2ebe00=_0xde19[_0x55036a];return _0x2ebe00;};'use strict';var multer=require(_0x9de1('0x0'));var util=require(_0x9de1('0x1'));var path=require(_0x9de1('0x2'));var timeout=require(_0x9de1('0x3'));var express=require('express');var router=express[_0x9de1('0x4')]();var fs_extra=require(_0x9de1('0x5'));var auth=require(_0x9de1('0x6'));var interaction=require(_0x9de1('0x7'));var config=require(_0x9de1('0x8'));var controller=require(_0x9de1('0x9'));router['get']('/',auth[_0x9de1('0xa')](),controller[_0x9de1('0xb')]);router[_0x9de1('0xc')](_0x9de1('0xd'),auth[_0x9de1('0xa')](),controller[_0x9de1('0xe')]);router[_0x9de1('0xc')]('/:id/fields',auth[_0x9de1('0xa')](),controller[_0x9de1('0xf')]);router['get'](_0x9de1('0x10'),auth[_0x9de1('0xa')](),controller[_0x9de1('0x11')]);router['get'](_0x9de1('0x12'),auth['isAuthenticated'](),controller[_0x9de1('0x13')]);router[_0x9de1('0x14')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x9de1('0xd'),auth[_0x9de1('0xa')](),controller[_0x9de1('0x15')]);router[_0x9de1('0x16')](_0x9de1('0xd'),auth['isAuthenticated'](),controller[_0x9de1('0x17')]);module[_0x9de1('0x18')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 796d56a..6634020 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 _0x6375=['sequelize','exports','STRING'];(function(_0x8a8fe5,_0x6d9b85){var _0x3ffcc4=function(_0x10c31e){while(--_0x10c31e){_0x8a8fe5['push'](_0x8a8fe5['shift']());}};_0x3ffcc4(++_0x6d9b85);}(_0x6375,0x192));var _0x5637=function(_0x26fc81,_0x57fc19){_0x26fc81=_0x26fc81-0x0;var _0x9feece=_0x6375[_0x26fc81];return _0x9feece;};'use strict';var Sequelize=require(_0x5637('0x0'));module[_0x5637('0x1')]={'name':{'type':Sequelize[_0x5637('0x2')]},'description':{'type':Sequelize[_0x5637('0x2')]}}; \ No newline at end of file +var _0xe1cc=['exports','STRING','sequelize'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xe1cc,0x137));var _0xce1c=function(_0x52eef9,_0x3ddfb2){_0x52eef9=_0x52eef9-0x0;var _0x3ede5e=_0xe1cc[_0x52eef9];return _0x3ede5e;};'use strict';var Sequelize=require(_0xce1c('0x0'));module[_0xce1c('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xce1c('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 01f4241..e7e6b18 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 _0xe1d8=['limit','undefined','count','set','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','fieldName','type','key','query','intersection','model','attributes','fields','nolimit','order','sort','where','filters','pick','filter','merge','options','ServicenowConfiguration','rows','catch','show','params','rawAttributes','keys','length','include','create','body','find','getFields','findOne','ServicenowField','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','json','offset'];(function(_0x1f0488,_0x52cc7f){var _0x3cd40c=function(_0x29a635){while(--_0x29a635){_0x1f0488['push'](_0x1f0488['shift']());}};_0x3cd40c(++_0x52cc7f);}(_0xe1d8,0x127));var _0x8e1d=function(_0x3f3d23,_0x2c0efb){_0x3f3d23=_0x3f3d23-0x0;var _0x247a56=_0xe1d8[_0x3f3d23];return _0x247a56;};'use strict';var emlformat=require(_0x8e1d('0x0'));var rimraf=require(_0x8e1d('0x1'));var zipdir=require(_0x8e1d('0x2'));var jsonpatch=require(_0x8e1d('0x3'));var rp=require(_0x8e1d('0x4'));var moment=require(_0x8e1d('0x5'));var BPromise=require(_0x8e1d('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8e1d('0x7'));var sox=require(_0x8e1d('0x8'));var csv=require(_0x8e1d('0x9'));var ejs=require(_0x8e1d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8e1d('0xb'));var squel=require(_0x8e1d('0xc'));var crypto=require(_0x8e1d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8e1d('0xe'));var toCsv=require(_0x8e1d('0x9'));var querystring=require(_0x8e1d('0xf'));var Papa=require(_0x8e1d('0x10'));var Redis=require(_0x8e1d('0x11'));var authService=require(_0x8e1d('0x12'));var qs=require(_0x8e1d('0x13'));var as=require(_0x8e1d('0x14'));var hardwareService=require(_0x8e1d('0x15'));var logger=require(_0x8e1d('0x16'))(_0x8e1d('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8e1d('0x18'))['db'];function respondWithStatusCode(_0x167526,_0x2963ea){_0x2963ea=_0x2963ea||0xcc;return function(_0x52fb24){if(_0x52fb24){return _0x167526[_0x8e1d('0x19')](_0x2963ea);}return _0x167526[_0x8e1d('0x1a')](_0x2963ea)['end']();};}function respondWithResult(_0x3bca51,_0x47c4e4){_0x47c4e4=_0x47c4e4||0xc8;return function(_0x268c06){if(_0x268c06){return _0x3bca51['status'](_0x47c4e4)[_0x8e1d('0x1b')](_0x268c06);}};}function respondWithFilteredResult(_0x2362a5,_0x1855f3){return function(_0x400016){if(_0x400016){var _0x608cbc=typeof _0x1855f3[_0x8e1d('0x1c')]==='undefined'&&typeof _0x1855f3[_0x8e1d('0x1d')]===_0x8e1d('0x1e');var _0x442c09=_0x400016[_0x8e1d('0x1f')];var _0x49be96=_0x608cbc?0x0:_0x1855f3[_0x8e1d('0x1c')];var _0x36c760=_0x608cbc?_0x400016[_0x8e1d('0x1f')]:_0x1855f3[_0x8e1d('0x1c')]+_0x1855f3[_0x8e1d('0x1d')];var _0x5e28ef;if(_0x36c760>=_0x442c09){_0x36c760=_0x442c09;_0x5e28ef=0xc8;}else{_0x5e28ef=0xce;}_0x2362a5[_0x8e1d('0x1a')](_0x5e28ef);return _0x2362a5[_0x8e1d('0x20')]('Content-Range',_0x49be96+'-'+_0x36c760+'/'+_0x442c09)[_0x8e1d('0x1b')](_0x400016);}return null;};}function patchUpdates(_0x273ded){return function(_0xe458e8){try{jsonpatch[_0x8e1d('0x21')](_0xe458e8,_0x273ded,!![]);}catch(_0xe43be0){return BPromise[_0x8e1d('0x22')](_0xe43be0);}return _0xe458e8[_0x8e1d('0x23')]();};}function saveUpdates(_0x1f239a,_0x19351c){return function(_0x49c73f){if(_0x49c73f){return _0x49c73f[_0x8e1d('0x24')](_0x1f239a)[_0x8e1d('0x25')](function(_0x47bf49){return _0x47bf49;});}return null;};}function removeEntity(_0x1a7073,_0x1a0369){return function(_0x3aab92){if(_0x3aab92){return _0x3aab92[_0x8e1d('0x26')]()['then'](function(){_0x1a7073[_0x8e1d('0x1a')](0xcc)[_0x8e1d('0x27')]();});}};}function handleEntityNotFound(_0x6136c5,_0x40b7b0){return function(_0x3eec59){if(!_0x3eec59){_0x6136c5[_0x8e1d('0x19')](0x194);}return _0x3eec59;};}function handleError(_0x268ef3,_0x268421){_0x268421=_0x268421||0x1f4;return function(_0x65b3f7){logger[_0x8e1d('0x28')](_0x65b3f7[_0x8e1d('0x29')]);if(_0x65b3f7[_0x8e1d('0x2a')]){delete _0x65b3f7[_0x8e1d('0x2a')];}_0x268ef3[_0x8e1d('0x1a')](_0x268421)[_0x8e1d('0x2b')](_0x65b3f7);};}exports[_0x8e1d('0x2c')]=function(_0x419d37,_0xcf5be1){var _0x31aa8f={},_0x327880={},_0x21d071={'count':0x0,'rows':[]};var _0x491bef=_[_0x8e1d('0x2d')](db['ServicenowConfiguration']['rawAttributes'],function(_0x45771c){return{'name':_0x45771c[_0x8e1d('0x2e')],'type':_0x45771c[_0x8e1d('0x2f')][_0x8e1d('0x30')]};});_0x327880['model']=_[_0x8e1d('0x2d')](_0x491bef,_0x8e1d('0x2a'));_0x327880[_0x8e1d('0x31')]=_['keys'](_0x419d37[_0x8e1d('0x31')]);_0x327880['filters']=_[_0x8e1d('0x32')](_0x327880[_0x8e1d('0x33')],_0x327880['query']);_0x31aa8f[_0x8e1d('0x34')]=_[_0x8e1d('0x32')](_0x327880[_0x8e1d('0x33')],qs[_0x8e1d('0x35')](_0x419d37[_0x8e1d('0x31')][_0x8e1d('0x35')]));_0x31aa8f[_0x8e1d('0x34')]=_0x31aa8f['attributes']['length']?_0x31aa8f['attributes']:_0x327880['model'];if(!_0x419d37[_0x8e1d('0x31')]['hasOwnProperty'](_0x8e1d('0x36'))){_0x31aa8f['limit']=qs[_0x8e1d('0x1d')](_0x419d37[_0x8e1d('0x31')][_0x8e1d('0x1d')]);_0x31aa8f[_0x8e1d('0x1c')]=qs['offset'](_0x419d37[_0x8e1d('0x31')][_0x8e1d('0x1c')]);}_0x31aa8f[_0x8e1d('0x37')]=qs[_0x8e1d('0x38')](_0x419d37[_0x8e1d('0x31')]['sort']);_0x31aa8f[_0x8e1d('0x39')]=qs[_0x8e1d('0x3a')](_[_0x8e1d('0x3b')](_0x419d37[_0x8e1d('0x31')],_0x327880['filters']),_0x491bef);if(_0x419d37[_0x8e1d('0x31')][_0x8e1d('0x3c')]){_0x31aa8f[_0x8e1d('0x39')]=_['merge'](_0x31aa8f[_0x8e1d('0x39')],{'$or':_[_0x8e1d('0x2d')](_0x491bef,function(_0x3ad5fa){if(_0x3ad5fa['type']!=='VIRTUAL'){var _0x2c1bc5={};_0x2c1bc5[_0x3ad5fa[_0x8e1d('0x2a')]]={'$like':'%'+_0x419d37[_0x8e1d('0x31')][_0x8e1d('0x3c')]+'%'};return _0x2c1bc5;}})});}_0x31aa8f=_[_0x8e1d('0x3d')]({},_0x31aa8f,_0x419d37[_0x8e1d('0x3e')]);var _0x571736={'where':_0x31aa8f[_0x8e1d('0x39')]};return db[_0x8e1d('0x3f')][_0x8e1d('0x1f')](_0x571736)[_0x8e1d('0x25')](function(_0x4c89dc){_0x21d071['count']=_0x4c89dc;if(_0x419d37[_0x8e1d('0x31')]['includeAll']){_0x31aa8f['include']=[{'all':!![]}];}return db[_0x8e1d('0x3f')]['findAll'](_0x31aa8f);})[_0x8e1d('0x25')](function(_0x2503f3){_0x21d071[_0x8e1d('0x40')]=_0x2503f3;return _0x21d071;})[_0x8e1d('0x25')](respondWithFilteredResult(_0xcf5be1,_0x31aa8f))[_0x8e1d('0x41')](handleError(_0xcf5be1,null));};exports[_0x8e1d('0x42')]=function(_0x55cf2a,_0x2a2eea){var _0x4f5380={'raw':![],'where':{'id':_0x55cf2a[_0x8e1d('0x43')]['id']}},_0xf60f75={};_0xf60f75[_0x8e1d('0x33')]=_['keys'](db['ServicenowConfiguration'][_0x8e1d('0x44')]);_0xf60f75['query']=_[_0x8e1d('0x45')](_0x55cf2a[_0x8e1d('0x31')]);_0xf60f75[_0x8e1d('0x3a')]=_['intersection'](_0xf60f75[_0x8e1d('0x33')],_0xf60f75[_0x8e1d('0x31')]);_0x4f5380['attributes']=_[_0x8e1d('0x32')](_0xf60f75[_0x8e1d('0x33')],qs[_0x8e1d('0x35')](_0x55cf2a['query'][_0x8e1d('0x35')]));_0x4f5380['attributes']=_0x4f5380[_0x8e1d('0x34')][_0x8e1d('0x46')]?_0x4f5380[_0x8e1d('0x34')]:_0xf60f75['model'];if(_0x55cf2a[_0x8e1d('0x31')]['includeAll']){_0x4f5380[_0x8e1d('0x47')]=[{'all':!![]}];}_0x4f5380=_['merge']({},_0x4f5380,_0x55cf2a[_0x8e1d('0x3e')]);return db[_0x8e1d('0x3f')]['find'](_0x4f5380)[_0x8e1d('0x25')](handleEntityNotFound(_0x2a2eea,null))[_0x8e1d('0x25')](respondWithResult(_0x2a2eea,null))[_0x8e1d('0x41')](handleError(_0x2a2eea,null));};exports['create']=function(_0x44dcb0,_0x134702){return db[_0x8e1d('0x3f')][_0x8e1d('0x48')](_0x44dcb0[_0x8e1d('0x49')],{})[_0x8e1d('0x25')](respondWithResult(_0x134702,0xc9))[_0x8e1d('0x41')](handleError(_0x134702,null));};exports[_0x8e1d('0x24')]=function(_0x3d62e7,_0x5f476a){if(_0x3d62e7[_0x8e1d('0x49')]['id']){delete _0x3d62e7[_0x8e1d('0x49')]['id'];}return db['ServicenowConfiguration'][_0x8e1d('0x4a')]({'where':{'id':_0x3d62e7['params']['id']}})[_0x8e1d('0x25')](handleEntityNotFound(_0x5f476a,null))['then'](saveUpdates(_0x3d62e7[_0x8e1d('0x49')],null))[_0x8e1d('0x25')](respondWithResult(_0x5f476a,null))[_0x8e1d('0x41')](handleError(_0x5f476a,null));};exports[_0x8e1d('0x26')]=function(_0x2e879d,_0x59842b){return db['ServicenowConfiguration']['find']({'where':{'id':_0x2e879d[_0x8e1d('0x43')]['id']}})['then'](handleEntityNotFound(_0x59842b,null))[_0x8e1d('0x25')](removeEntity(_0x59842b,null))['catch'](handleError(_0x59842b,null));};exports[_0x8e1d('0x4b')]=function(_0x4a2a6a,_0x46d1e1,_0x1a52db){var _0x368010={};var _0x250990={};var _0x2dfb4b;var _0x46e317;return db[_0x8e1d('0x3f')][_0x8e1d('0x4c')]({'where':{'id':_0x4a2a6a[_0x8e1d('0x43')]['id']}})[_0x8e1d('0x25')](handleEntityNotFound(_0x46d1e1,null))[_0x8e1d('0x25')](function(_0x1c4c7b){if(_0x1c4c7b){_0x2dfb4b=_0x1c4c7b;_0x250990['model']=_[_0x8e1d('0x45')](db[_0x8e1d('0x4d')][_0x8e1d('0x44')]);_0x250990['query']=_['keys'](_0x4a2a6a[_0x8e1d('0x31')]);_0x250990[_0x8e1d('0x3a')]=_['intersection'](_0x250990[_0x8e1d('0x33')],_0x250990['query']);_0x368010[_0x8e1d('0x34')]=_[_0x8e1d('0x32')](_0x250990[_0x8e1d('0x33')],qs['fields'](_0x4a2a6a[_0x8e1d('0x31')][_0x8e1d('0x35')]));_0x368010[_0x8e1d('0x34')]=_0x368010[_0x8e1d('0x34')][_0x8e1d('0x46')]?_0x368010[_0x8e1d('0x34')]:_0x250990[_0x8e1d('0x33')];_0x368010[_0x8e1d('0x37')]=qs[_0x8e1d('0x38')](_0x4a2a6a['query'][_0x8e1d('0x38')]);_0x368010[_0x8e1d('0x39')]=qs[_0x8e1d('0x3a')](_['pick'](_0x4a2a6a[_0x8e1d('0x31')],_0x250990[_0x8e1d('0x3a')]));if(_0x4a2a6a[_0x8e1d('0x31')][_0x8e1d('0x3c')]){_0x368010[_0x8e1d('0x39')]=_['merge'](_0x368010['where'],{'$or':_[_0x8e1d('0x2d')](_0x368010[_0x8e1d('0x34')],function(_0x54d5f9){var _0x3ca9a7={};_0x3ca9a7[_0x54d5f9]={'$like':'%'+_0x4a2a6a[_0x8e1d('0x31')][_0x8e1d('0x3c')]+'%'};return _0x3ca9a7;})});}_0x368010=_[_0x8e1d('0x3d')]({},_0x368010,_0x4a2a6a['options']);return _0x2dfb4b[_0x8e1d('0x4b')](_0x368010);}})[_0x8e1d('0x25')](function(_0x39540c){if(_0x39540c){_0x46e317=_0x39540c[_0x8e1d('0x46')];if(!_0x4a2a6a[_0x8e1d('0x31')][_0x8e1d('0x4e')]('nolimit')){_0x368010['limit']=qs['limit'](_0x4a2a6a['query'][_0x8e1d('0x1d')]);_0x368010[_0x8e1d('0x1c')]=qs['offset'](_0x4a2a6a[_0x8e1d('0x31')][_0x8e1d('0x1c')]);}return _0x2dfb4b[_0x8e1d('0x4b')](_0x368010);}})['then'](function(_0x181bae){if(_0x181bae){return _0x181bae?{'count':_0x46e317,'rows':_0x181bae}:null;}})[_0x8e1d('0x25')](respondWithResult(_0x46d1e1,null))[_0x8e1d('0x41')](handleError(_0x46d1e1,null));};exports[_0x8e1d('0x4f')]=function(_0x2de3b0,_0x44488b,_0x26f403){var _0x5de089={};var _0xdc45f7={};var _0x4b707b;var _0x3451fa;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x2de3b0[_0x8e1d('0x43')]['id']}})[_0x8e1d('0x25')](handleEntityNotFound(_0x44488b,null))[_0x8e1d('0x25')](function(_0x5b3bb2){if(_0x5b3bb2){_0x4b707b=_0x5b3bb2;_0xdc45f7[_0x8e1d('0x33')]=_[_0x8e1d('0x45')](db[_0x8e1d('0x4d')][_0x8e1d('0x44')]);_0xdc45f7[_0x8e1d('0x31')]=_[_0x8e1d('0x45')](_0x2de3b0[_0x8e1d('0x31')]);_0xdc45f7['filters']=_['intersection'](_0xdc45f7[_0x8e1d('0x33')],_0xdc45f7[_0x8e1d('0x31')]);_0x5de089[_0x8e1d('0x34')]=_[_0x8e1d('0x32')](_0xdc45f7[_0x8e1d('0x33')],qs[_0x8e1d('0x35')](_0x2de3b0[_0x8e1d('0x31')][_0x8e1d('0x35')]));_0x5de089['attributes']=_0x5de089['attributes'][_0x8e1d('0x46')]?_0x5de089[_0x8e1d('0x34')]:_0xdc45f7['model'];_0x5de089['order']=qs[_0x8e1d('0x38')](_0x2de3b0[_0x8e1d('0x31')][_0x8e1d('0x38')]);_0x5de089['where']=qs[_0x8e1d('0x3a')](_[_0x8e1d('0x3b')](_0x2de3b0[_0x8e1d('0x31')],_0xdc45f7[_0x8e1d('0x3a')]));if(_0x2de3b0[_0x8e1d('0x31')][_0x8e1d('0x3c')]){_0x5de089[_0x8e1d('0x39')]=_[_0x8e1d('0x3d')](_0x5de089[_0x8e1d('0x39')],{'$or':_[_0x8e1d('0x2d')](_0x5de089['attributes'],function(_0xdf93be){var _0x505dd2={};_0x505dd2[_0xdf93be]={'$like':'%'+_0x2de3b0[_0x8e1d('0x31')][_0x8e1d('0x3c')]+'%'};return _0x505dd2;})});}_0x5de089=_[_0x8e1d('0x3d')]({},_0x5de089,_0x2de3b0['options']);return _0x4b707b[_0x8e1d('0x4f')](_0x5de089);}})['then'](function(_0x1af638){if(_0x1af638){_0x3451fa=_0x1af638[_0x8e1d('0x46')];if(!_0x2de3b0['query'][_0x8e1d('0x4e')](_0x8e1d('0x36'))){_0x5de089[_0x8e1d('0x1d')]=qs[_0x8e1d('0x1d')](_0x2de3b0[_0x8e1d('0x31')]['limit']);_0x5de089['offset']=qs[_0x8e1d('0x1c')](_0x2de3b0[_0x8e1d('0x31')][_0x8e1d('0x1c')]);}return _0x4b707b[_0x8e1d('0x4f')](_0x5de089);}})[_0x8e1d('0x25')](function(_0x8cf1c7){if(_0x8cf1c7){return _0x8cf1c7?{'count':_0x3451fa,'rows':_0x8cf1c7}:null;}})['then'](respondWithResult(_0x44488b,null))['catch'](handleError(_0x44488b,null));};exports['getDescriptions']=function(_0x7452aa,_0x41682d,_0x549311){var _0x432fd4={};var _0x1e6ff3={};var _0x51b69e;var _0x5c01c5;return db[_0x8e1d('0x3f')][_0x8e1d('0x4c')]({'where':{'id':_0x7452aa['params']['id']}})[_0x8e1d('0x25')](handleEntityNotFound(_0x41682d,null))[_0x8e1d('0x25')](function(_0xde873e){if(_0xde873e){_0x51b69e=_0xde873e;_0x1e6ff3[_0x8e1d('0x33')]=_['keys'](db['ServicenowField']['rawAttributes']);_0x1e6ff3[_0x8e1d('0x31')]=_['keys'](_0x7452aa[_0x8e1d('0x31')]);_0x1e6ff3[_0x8e1d('0x3a')]=_[_0x8e1d('0x32')](_0x1e6ff3[_0x8e1d('0x33')],_0x1e6ff3[_0x8e1d('0x31')]);_0x432fd4[_0x8e1d('0x34')]=_[_0x8e1d('0x32')](_0x1e6ff3['model'],qs[_0x8e1d('0x35')](_0x7452aa[_0x8e1d('0x31')][_0x8e1d('0x35')]));_0x432fd4[_0x8e1d('0x34')]=_0x432fd4[_0x8e1d('0x34')][_0x8e1d('0x46')]?_0x432fd4[_0x8e1d('0x34')]:_0x1e6ff3[_0x8e1d('0x33')];_0x432fd4[_0x8e1d('0x37')]=qs['sort'](_0x7452aa[_0x8e1d('0x31')][_0x8e1d('0x38')]);_0x432fd4[_0x8e1d('0x39')]=qs[_0x8e1d('0x3a')](_['pick'](_0x7452aa[_0x8e1d('0x31')],_0x1e6ff3['filters']));if(_0x7452aa[_0x8e1d('0x31')][_0x8e1d('0x3c')]){_0x432fd4[_0x8e1d('0x39')]=_[_0x8e1d('0x3d')](_0x432fd4[_0x8e1d('0x39')],{'$or':_[_0x8e1d('0x2d')](_0x432fd4[_0x8e1d('0x34')],function(_0x4df8b0){var _0x59a26f={};_0x59a26f[_0x4df8b0]={'$like':'%'+_0x7452aa['query']['filter']+'%'};return _0x59a26f;})});}_0x432fd4=_[_0x8e1d('0x3d')]({},_0x432fd4,_0x7452aa[_0x8e1d('0x3e')]);return _0x51b69e[_0x8e1d('0x50')](_0x432fd4);}})['then'](function(_0x4e4238){if(_0x4e4238){_0x5c01c5=_0x4e4238[_0x8e1d('0x46')];if(!_0x7452aa[_0x8e1d('0x31')][_0x8e1d('0x4e')](_0x8e1d('0x36'))){_0x432fd4[_0x8e1d('0x1d')]=qs[_0x8e1d('0x1d')](_0x7452aa[_0x8e1d('0x31')][_0x8e1d('0x1d')]);_0x432fd4[_0x8e1d('0x1c')]=qs['offset'](_0x7452aa[_0x8e1d('0x31')][_0x8e1d('0x1c')]);}return _0x51b69e['getDescriptions'](_0x432fd4);}})[_0x8e1d('0x25')](function(_0x11ddd6){if(_0x11ddd6){return _0x11ddd6?{'count':_0x5c01c5,'rows':_0x11ddd6}:null;}})[_0x8e1d('0x25')](respondWithResult(_0x41682d,null))[_0x8e1d('0x41')](handleError(_0x41682d,null));}; \ No newline at end of file +var _0xab57=['where','pick','merge','VIRTUAL','options','include','rows','catch','show','find','create','body','params','findOne','ServicenowField','filter','getFields','getSubjects','eml-format','rimraf','zip-dir','fast-json-patch','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','end','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x4603e1,_0x3aefee){var _0x52bb1e=function(_0xd41704){while(--_0xd41704){_0x4603e1['push'](_0x4603e1['shift']());}};_0x52bb1e(++_0x3aefee);}(_0xab57,0x142));var _0x7ab5=function(_0xbc912,_0x2e1799){_0xbc912=_0xbc912-0x0;var _0x396547=_0xab57[_0xbc912];return _0x396547;};'use strict';var emlformat=require(_0x7ab5('0x0'));var rimraf=require(_0x7ab5('0x1'));var zipdir=require(_0x7ab5('0x2'));var jsonpatch=require(_0x7ab5('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7ab5('0x4'));var path=require(_0x7ab5('0x5'));var sox=require(_0x7ab5('0x6'));var csv=require('to-csv');var ejs=require(_0x7ab5('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7ab5('0x8'));var crypto=require(_0x7ab5('0x9'));var jsforce=require(_0x7ab5('0xa'));var deskjs=require(_0x7ab5('0xb'));var toCsv=require(_0x7ab5('0xc'));var querystring=require(_0x7ab5('0xd'));var Papa=require(_0x7ab5('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7ab5('0xf'));var as=require(_0x7ab5('0x10'));var hardwareService=require(_0x7ab5('0x11'));var logger=require(_0x7ab5('0x12'))(_0x7ab5('0x13'));var utils=require(_0x7ab5('0x14'));var config=require(_0x7ab5('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a84bf,_0x14a36b){_0x14a36b=_0x14a36b||0xcc;return function(_0x1ac596){if(_0x1ac596){return _0x4a84bf[_0x7ab5('0x16')](_0x14a36b);}return _0x4a84bf[_0x7ab5('0x17')](_0x14a36b)['end']();};}function respondWithResult(_0x1b71fa,_0x4aee33){_0x4aee33=_0x4aee33||0xc8;return function(_0x104fe8){if(_0x104fe8){return _0x1b71fa[_0x7ab5('0x17')](_0x4aee33)[_0x7ab5('0x18')](_0x104fe8);}};}function respondWithFilteredResult(_0x61c3ad,_0x96f586){return function(_0x229774){if(_0x229774){var _0x52113b=typeof _0x96f586[_0x7ab5('0x19')]===_0x7ab5('0x1a')&&typeof _0x96f586[_0x7ab5('0x1b')]===_0x7ab5('0x1a');var _0x400b9f=_0x229774[_0x7ab5('0x1c')];var _0x4b4976=_0x52113b?0x0:_0x96f586['offset'];var _0x33a605=_0x52113b?_0x229774[_0x7ab5('0x1c')]:_0x96f586[_0x7ab5('0x19')]+_0x96f586['limit'];var _0x8bb632;if(_0x33a605>=_0x400b9f){_0x33a605=_0x400b9f;_0x8bb632=0xc8;}else{_0x8bb632=0xce;}_0x61c3ad[_0x7ab5('0x17')](_0x8bb632);return _0x61c3ad[_0x7ab5('0x1d')](_0x7ab5('0x1e'),_0x4b4976+'-'+_0x33a605+'/'+_0x400b9f)[_0x7ab5('0x18')](_0x229774);}return null;};}function patchUpdates(_0x327434){return function(_0xf9898){try{jsonpatch['apply'](_0xf9898,_0x327434,!![]);}catch(_0x738b8e){return BPromise[_0x7ab5('0x1f')](_0x738b8e);}return _0xf9898[_0x7ab5('0x20')]();};}function saveUpdates(_0x2c6f0d,_0x264b60){return function(_0x128135){if(_0x128135){return _0x128135[_0x7ab5('0x21')](_0x2c6f0d)[_0x7ab5('0x22')](function(_0x11344b){return _0x11344b;});}return null;};}function removeEntity(_0x34beba,_0x4f73db){return function(_0x1c4479){if(_0x1c4479){return _0x1c4479['destroy']()[_0x7ab5('0x22')](function(){_0x34beba[_0x7ab5('0x17')](0xcc)[_0x7ab5('0x23')]();});}};}function handleEntityNotFound(_0x1cbb8b,_0x265d33){return function(_0x40a72c){if(!_0x40a72c){_0x1cbb8b[_0x7ab5('0x16')](0x194);}return _0x40a72c;};}function handleError(_0x1ebc38,_0x2536c1){_0x2536c1=_0x2536c1||0x1f4;return function(_0x530a2b){logger['error'](_0x530a2b[_0x7ab5('0x24')]);if(_0x530a2b[_0x7ab5('0x25')]){delete _0x530a2b[_0x7ab5('0x25')];}_0x1ebc38[_0x7ab5('0x17')](_0x2536c1)[_0x7ab5('0x26')](_0x530a2b);};}exports[_0x7ab5('0x27')]=function(_0x5ba07f,_0x23aa9f){var _0x392e4a={},_0x63a80b={},_0x4e1cec={'count':0x0,'rows':[]};var _0x16c9bd=_[_0x7ab5('0x28')](db[_0x7ab5('0x29')][_0x7ab5('0x2a')],function(_0x300de6){return{'name':_0x300de6[_0x7ab5('0x2b')],'type':_0x300de6[_0x7ab5('0x2c')][_0x7ab5('0x2d')]};});_0x63a80b[_0x7ab5('0x2e')]=_[_0x7ab5('0x28')](_0x16c9bd,_0x7ab5('0x25'));_0x63a80b[_0x7ab5('0x2f')]=_[_0x7ab5('0x30')](_0x5ba07f[_0x7ab5('0x2f')]);_0x63a80b[_0x7ab5('0x31')]=_[_0x7ab5('0x32')](_0x63a80b[_0x7ab5('0x2e')],_0x63a80b[_0x7ab5('0x2f')]);_0x392e4a[_0x7ab5('0x33')]=_[_0x7ab5('0x32')](_0x63a80b[_0x7ab5('0x2e')],qs[_0x7ab5('0x34')](_0x5ba07f['query'][_0x7ab5('0x34')]));_0x392e4a[_0x7ab5('0x33')]=_0x392e4a[_0x7ab5('0x33')][_0x7ab5('0x35')]?_0x392e4a[_0x7ab5('0x33')]:_0x63a80b[_0x7ab5('0x2e')];if(!_0x5ba07f[_0x7ab5('0x2f')][_0x7ab5('0x36')](_0x7ab5('0x37'))){_0x392e4a[_0x7ab5('0x1b')]=qs[_0x7ab5('0x1b')](_0x5ba07f['query'][_0x7ab5('0x1b')]);_0x392e4a[_0x7ab5('0x19')]=qs[_0x7ab5('0x19')](_0x5ba07f['query'][_0x7ab5('0x19')]);}_0x392e4a[_0x7ab5('0x38')]=qs[_0x7ab5('0x39')](_0x5ba07f[_0x7ab5('0x2f')][_0x7ab5('0x39')]);_0x392e4a[_0x7ab5('0x3a')]=qs[_0x7ab5('0x31')](_[_0x7ab5('0x3b')](_0x5ba07f[_0x7ab5('0x2f')],_0x63a80b[_0x7ab5('0x31')]),_0x16c9bd);if(_0x5ba07f[_0x7ab5('0x2f')]['filter']){_0x392e4a[_0x7ab5('0x3a')]=_[_0x7ab5('0x3c')](_0x392e4a[_0x7ab5('0x3a')],{'$or':_['map'](_0x16c9bd,function(_0x79258e){if(_0x79258e[_0x7ab5('0x2c')]!==_0x7ab5('0x3d')){var _0x43ebfd={};_0x43ebfd[_0x79258e[_0x7ab5('0x25')]]={'$like':'%'+_0x5ba07f['query']['filter']+'%'};return _0x43ebfd;}})});}_0x392e4a=_[_0x7ab5('0x3c')]({},_0x392e4a,_0x5ba07f[_0x7ab5('0x3e')]);var _0x4aed4b={'where':_0x392e4a[_0x7ab5('0x3a')]};return db[_0x7ab5('0x29')][_0x7ab5('0x1c')](_0x4aed4b)['then'](function(_0x45212d){_0x4e1cec['count']=_0x45212d;if(_0x5ba07f['query']['includeAll']){_0x392e4a[_0x7ab5('0x3f')]=[{'all':!![]}];}return db[_0x7ab5('0x29')]['findAll'](_0x392e4a);})[_0x7ab5('0x22')](function(_0x47485f){_0x4e1cec[_0x7ab5('0x40')]=_0x47485f;return _0x4e1cec;})['then'](respondWithFilteredResult(_0x23aa9f,_0x392e4a))[_0x7ab5('0x41')](handleError(_0x23aa9f,null));};exports[_0x7ab5('0x42')]=function(_0xb3ffdb,_0x415ebc){var _0x3d27b6={'raw':![],'where':{'id':_0xb3ffdb['params']['id']}},_0x5a2b94={};_0x5a2b94['model']=_[_0x7ab5('0x30')](db[_0x7ab5('0x29')][_0x7ab5('0x2a')]);_0x5a2b94[_0x7ab5('0x2f')]=_['keys'](_0xb3ffdb[_0x7ab5('0x2f')]);_0x5a2b94[_0x7ab5('0x31')]=_[_0x7ab5('0x32')](_0x5a2b94['model'],_0x5a2b94[_0x7ab5('0x2f')]);_0x3d27b6['attributes']=_[_0x7ab5('0x32')](_0x5a2b94[_0x7ab5('0x2e')],qs[_0x7ab5('0x34')](_0xb3ffdb[_0x7ab5('0x2f')]['fields']));_0x3d27b6[_0x7ab5('0x33')]=_0x3d27b6[_0x7ab5('0x33')][_0x7ab5('0x35')]?_0x3d27b6['attributes']:_0x5a2b94['model'];if(_0xb3ffdb[_0x7ab5('0x2f')]['includeAll']){_0x3d27b6['include']=[{'all':!![]}];}_0x3d27b6=_[_0x7ab5('0x3c')]({},_0x3d27b6,_0xb3ffdb['options']);return db[_0x7ab5('0x29')][_0x7ab5('0x43')](_0x3d27b6)[_0x7ab5('0x22')](handleEntityNotFound(_0x415ebc,null))[_0x7ab5('0x22')](respondWithResult(_0x415ebc,null))[_0x7ab5('0x41')](handleError(_0x415ebc,null));};exports[_0x7ab5('0x44')]=function(_0x56dfd2,_0x48ecd0){return db[_0x7ab5('0x29')][_0x7ab5('0x44')](_0x56dfd2[_0x7ab5('0x45')],{})[_0x7ab5('0x22')](respondWithResult(_0x48ecd0,0xc9))[_0x7ab5('0x41')](handleError(_0x48ecd0,null));};exports[_0x7ab5('0x21')]=function(_0x347346,_0x3e2d9b){if(_0x347346[_0x7ab5('0x45')]['id']){delete _0x347346['body']['id'];}return db[_0x7ab5('0x29')][_0x7ab5('0x43')]({'where':{'id':_0x347346[_0x7ab5('0x46')]['id']}})[_0x7ab5('0x22')](handleEntityNotFound(_0x3e2d9b,null))['then'](saveUpdates(_0x347346[_0x7ab5('0x45')],null))[_0x7ab5('0x22')](respondWithResult(_0x3e2d9b,null))[_0x7ab5('0x41')](handleError(_0x3e2d9b,null));};exports['destroy']=function(_0x3e03e4,_0x530f53){return db[_0x7ab5('0x29')][_0x7ab5('0x43')]({'where':{'id':_0x3e03e4[_0x7ab5('0x46')]['id']}})[_0x7ab5('0x22')](handleEntityNotFound(_0x530f53,null))['then'](removeEntity(_0x530f53,null))['catch'](handleError(_0x530f53,null));};exports['getFields']=function(_0x2308ab,_0x4b6624,_0xe8d401){var _0x4e859f={};var _0x2622a0={};var _0x38ea55;var _0x26e023;return db[_0x7ab5('0x29')][_0x7ab5('0x47')]({'where':{'id':_0x2308ab[_0x7ab5('0x46')]['id']}})['then'](handleEntityNotFound(_0x4b6624,null))[_0x7ab5('0x22')](function(_0x25e771){if(_0x25e771){_0x38ea55=_0x25e771;_0x2622a0['model']=_[_0x7ab5('0x30')](db[_0x7ab5('0x48')][_0x7ab5('0x2a')]);_0x2622a0[_0x7ab5('0x2f')]=_[_0x7ab5('0x30')](_0x2308ab[_0x7ab5('0x2f')]);_0x2622a0['filters']=_['intersection'](_0x2622a0[_0x7ab5('0x2e')],_0x2622a0[_0x7ab5('0x2f')]);_0x4e859f[_0x7ab5('0x33')]=_[_0x7ab5('0x32')](_0x2622a0[_0x7ab5('0x2e')],qs['fields'](_0x2308ab['query']['fields']));_0x4e859f[_0x7ab5('0x33')]=_0x4e859f['attributes'][_0x7ab5('0x35')]?_0x4e859f[_0x7ab5('0x33')]:_0x2622a0[_0x7ab5('0x2e')];_0x4e859f[_0x7ab5('0x38')]=qs[_0x7ab5('0x39')](_0x2308ab[_0x7ab5('0x2f')][_0x7ab5('0x39')]);_0x4e859f[_0x7ab5('0x3a')]=qs['filters'](_['pick'](_0x2308ab[_0x7ab5('0x2f')],_0x2622a0['filters']));if(_0x2308ab[_0x7ab5('0x2f')]['filter']){_0x4e859f[_0x7ab5('0x3a')]=_[_0x7ab5('0x3c')](_0x4e859f[_0x7ab5('0x3a')],{'$or':_[_0x7ab5('0x28')](_0x4e859f[_0x7ab5('0x33')],function(_0xb6343e){var _0x4234c2={};_0x4234c2[_0xb6343e]={'$like':'%'+_0x2308ab[_0x7ab5('0x2f')][_0x7ab5('0x49')]+'%'};return _0x4234c2;})});}_0x4e859f=_['merge']({},_0x4e859f,_0x2308ab[_0x7ab5('0x3e')]);return _0x38ea55[_0x7ab5('0x4a')](_0x4e859f);}})[_0x7ab5('0x22')](function(_0x58a201){if(_0x58a201){_0x26e023=_0x58a201[_0x7ab5('0x35')];if(!_0x2308ab[_0x7ab5('0x2f')]['hasOwnProperty'](_0x7ab5('0x37'))){_0x4e859f[_0x7ab5('0x1b')]=qs[_0x7ab5('0x1b')](_0x2308ab['query']['limit']);_0x4e859f[_0x7ab5('0x19')]=qs[_0x7ab5('0x19')](_0x2308ab[_0x7ab5('0x2f')][_0x7ab5('0x19')]);}return _0x38ea55[_0x7ab5('0x4a')](_0x4e859f);}})[_0x7ab5('0x22')](function(_0x44594c){if(_0x44594c){return _0x44594c?{'count':_0x26e023,'rows':_0x44594c}:null;}})['then'](respondWithResult(_0x4b6624,null))[_0x7ab5('0x41')](handleError(_0x4b6624,null));};exports[_0x7ab5('0x4b')]=function(_0x368126,_0x5bd996,_0x553ed7){var _0x3f28f3={};var _0x1a949c={};var _0x511615;var _0x32eac4;return db[_0x7ab5('0x29')][_0x7ab5('0x47')]({'where':{'id':_0x368126['params']['id']}})[_0x7ab5('0x22')](handleEntityNotFound(_0x5bd996,null))[_0x7ab5('0x22')](function(_0x210ecd){if(_0x210ecd){_0x511615=_0x210ecd;_0x1a949c[_0x7ab5('0x2e')]=_[_0x7ab5('0x30')](db[_0x7ab5('0x48')]['rawAttributes']);_0x1a949c[_0x7ab5('0x2f')]=_[_0x7ab5('0x30')](_0x368126[_0x7ab5('0x2f')]);_0x1a949c[_0x7ab5('0x31')]=_['intersection'](_0x1a949c['model'],_0x1a949c[_0x7ab5('0x2f')]);_0x3f28f3[_0x7ab5('0x33')]=_[_0x7ab5('0x32')](_0x1a949c['model'],qs[_0x7ab5('0x34')](_0x368126['query'][_0x7ab5('0x34')]));_0x3f28f3['attributes']=_0x3f28f3['attributes']['length']?_0x3f28f3[_0x7ab5('0x33')]:_0x1a949c[_0x7ab5('0x2e')];_0x3f28f3[_0x7ab5('0x38')]=qs[_0x7ab5('0x39')](_0x368126[_0x7ab5('0x2f')]['sort']);_0x3f28f3[_0x7ab5('0x3a')]=qs[_0x7ab5('0x31')](_[_0x7ab5('0x3b')](_0x368126['query'],_0x1a949c[_0x7ab5('0x31')]));if(_0x368126[_0x7ab5('0x2f')][_0x7ab5('0x49')]){_0x3f28f3['where']=_[_0x7ab5('0x3c')](_0x3f28f3[_0x7ab5('0x3a')],{'$or':_['map'](_0x3f28f3['attributes'],function(_0x1f33c9){var _0x2ad469={};_0x2ad469[_0x1f33c9]={'$like':'%'+_0x368126[_0x7ab5('0x2f')][_0x7ab5('0x49')]+'%'};return _0x2ad469;})});}_0x3f28f3=_[_0x7ab5('0x3c')]({},_0x3f28f3,_0x368126[_0x7ab5('0x3e')]);return _0x511615['getSubjects'](_0x3f28f3);}})['then'](function(_0x1cd9f2){if(_0x1cd9f2){_0x32eac4=_0x1cd9f2[_0x7ab5('0x35')];if(!_0x368126[_0x7ab5('0x2f')][_0x7ab5('0x36')]('nolimit')){_0x3f28f3[_0x7ab5('0x1b')]=qs[_0x7ab5('0x1b')](_0x368126[_0x7ab5('0x2f')]['limit']);_0x3f28f3[_0x7ab5('0x19')]=qs[_0x7ab5('0x19')](_0x368126[_0x7ab5('0x2f')][_0x7ab5('0x19')]);}return _0x511615[_0x7ab5('0x4b')](_0x3f28f3);}})[_0x7ab5('0x22')](function(_0x268b66){if(_0x268b66){return _0x268b66?{'count':_0x32eac4,'rows':_0x268b66}:null;}})[_0x7ab5('0x22')](respondWithResult(_0x5bd996,null))[_0x7ab5('0x41')](handleError(_0x5bd996,null));};exports['getDescriptions']=function(_0x67903a,_0x5d118d,_0x5d02b9){var _0x4f3df5={};var _0x8aa6f1={};var _0x43cb5a;var _0x1d66ac;return db['ServicenowConfiguration'][_0x7ab5('0x47')]({'where':{'id':_0x67903a[_0x7ab5('0x46')]['id']}})[_0x7ab5('0x22')](handleEntityNotFound(_0x5d118d,null))[_0x7ab5('0x22')](function(_0x5b1f05){if(_0x5b1f05){_0x43cb5a=_0x5b1f05;_0x8aa6f1[_0x7ab5('0x2e')]=_[_0x7ab5('0x30')](db[_0x7ab5('0x48')][_0x7ab5('0x2a')]);_0x8aa6f1[_0x7ab5('0x2f')]=_[_0x7ab5('0x30')](_0x67903a[_0x7ab5('0x2f')]);_0x8aa6f1[_0x7ab5('0x31')]=_[_0x7ab5('0x32')](_0x8aa6f1[_0x7ab5('0x2e')],_0x8aa6f1['query']);_0x4f3df5['attributes']=_[_0x7ab5('0x32')](_0x8aa6f1[_0x7ab5('0x2e')],qs[_0x7ab5('0x34')](_0x67903a['query'][_0x7ab5('0x34')]));_0x4f3df5[_0x7ab5('0x33')]=_0x4f3df5[_0x7ab5('0x33')][_0x7ab5('0x35')]?_0x4f3df5['attributes']:_0x8aa6f1[_0x7ab5('0x2e')];_0x4f3df5[_0x7ab5('0x38')]=qs[_0x7ab5('0x39')](_0x67903a[_0x7ab5('0x2f')][_0x7ab5('0x39')]);_0x4f3df5[_0x7ab5('0x3a')]=qs[_0x7ab5('0x31')](_[_0x7ab5('0x3b')](_0x67903a['query'],_0x8aa6f1[_0x7ab5('0x31')]));if(_0x67903a[_0x7ab5('0x2f')][_0x7ab5('0x49')]){_0x4f3df5[_0x7ab5('0x3a')]=_[_0x7ab5('0x3c')](_0x4f3df5['where'],{'$or':_[_0x7ab5('0x28')](_0x4f3df5[_0x7ab5('0x33')],function(_0x5672bc){var _0x1ee0f0={};_0x1ee0f0[_0x5672bc]={'$like':'%'+_0x67903a[_0x7ab5('0x2f')]['filter']+'%'};return _0x1ee0f0;})});}_0x4f3df5=_[_0x7ab5('0x3c')]({},_0x4f3df5,_0x67903a[_0x7ab5('0x3e')]);return _0x43cb5a['getDescriptions'](_0x4f3df5);}})['then'](function(_0x1b2d78){if(_0x1b2d78){_0x1d66ac=_0x1b2d78[_0x7ab5('0x35')];if(!_0x67903a[_0x7ab5('0x2f')][_0x7ab5('0x36')](_0x7ab5('0x37'))){_0x4f3df5[_0x7ab5('0x1b')]=qs[_0x7ab5('0x1b')](_0x67903a[_0x7ab5('0x2f')][_0x7ab5('0x1b')]);_0x4f3df5[_0x7ab5('0x19')]=qs[_0x7ab5('0x19')](_0x67903a[_0x7ab5('0x2f')]['offset']);}return _0x43cb5a['getDescriptions'](_0x4f3df5);}})['then'](function(_0x2da5ec){if(_0x2da5ec){return _0x2da5ec?{'count':_0x1d66ac,'rows':_0x2da5ec}:null;}})[_0x7ab5('0x22')](respondWithResult(_0x5d118d,null))[_0x7ab5('0x41')](handleError(_0x5d118d,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 3155407..a4afb47 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 _0x1516=['bluebird','request-promise','path','rimraf','./intServicenowConfiguration.attributes','define','ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger','moment'];(function(_0x680a92,_0x5273ad){var _0x318abe=function(_0x23fb87){while(--_0x23fb87){_0x680a92['push'](_0x680a92['shift']());}};_0x318abe(++_0x5273ad);}(_0x1516,0xb0));var _0x6151=function(_0x1e7482,_0x3cb4c3){_0x1e7482=_0x1e7482-0x0;var _0x1d9c32=_0x1516[_0x1e7482];return _0x1d9c32;};'use strict';var _=require(_0x6151('0x0'));var util=require(_0x6151('0x1'));var logger=require(_0x6151('0x2'))('api');var moment=require(_0x6151('0x3'));var BPromise=require(_0x6151('0x4'));var rp=require(_0x6151('0x5'));var fs=require('fs');var path=require(_0x6151('0x6'));var rimraf=require(_0x6151('0x7'));var config=require('../../config/environment');var attributes=require(_0x6151('0x8'));module['exports']=function(_0x69f924,_0x2585cd){return _0x69f924[_0x6151('0x9')](_0x6151('0xa'),attributes,{'tableName':_0x6151('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x60a5=['request-promise','path','rimraf','./intServicenowConfiguration.attributes','exports','lodash','api'];(function(_0x3943ab,_0x11ea63){var _0x38fb4e=function(_0x523ffd){while(--_0x523ffd){_0x3943ab['push'](_0x3943ab['shift']());}};_0x38fb4e(++_0x11ea63);}(_0x60a5,0x83));var _0x560a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x60a5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x560a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x560a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x560a('0x2'));var fs=require('fs');var path=require(_0x560a('0x3'));var rimraf=require(_0x560a('0x4'));var config=require('../../config/environment');var attributes=require(_0x560a('0x5'));module[_0x560a('0x6')]=function(_0x3856ae,_0x5aaec6){return _0x3856ae['define']('ServicenowConfiguration',attributes,{'tableName':'int_servicenow_configurations','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 2d14388..383c128 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 _0x28ff=['request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','code','ServicenowConfiguration,\x20%s,\x20%s','message','info','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then'];(function(_0x40acb6,_0x1117d4){var _0x451021=function(_0x11edd7){while(--_0x11edd7){_0x40acb6['push'](_0x40acb6['shift']());}};_0x451021(++_0x1117d4);}(_0x28ff,0x7a));var _0xf28f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x28ff[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xf28f('0x0'));var moment=require(_0xf28f('0x1'));var BPromise=require(_0xf28f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf28f('0x3'));var db=require(_0xf28f('0x4'))['db'];var utils=require(_0xf28f('0x5'));var logger=require('../../config/logger')(_0xf28f('0x6'));var config=require(_0xf28f('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf28f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1593a1,_0x1cb55d,_0x5aa2cf){return new BPromise(function(_0x2ac03d,_0x546ac7){return client[_0xf28f('0x9')](_0x1593a1,_0x5aa2cf)[_0xf28f('0xa')](function(_0x29c486){logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x1cb55d,_0xf28f('0xb'));logger['debug'](_0xf28f('0xc'),_0x1cb55d,_0xf28f('0xb'),JSON['stringify'](_0x29c486));if(_0x29c486[_0xf28f('0xd')]){if(_0x29c486['error'][_0xf28f('0xe')]===0x1f4){logger['error'](_0xf28f('0xf'),_0x1cb55d,_0x29c486[_0xf28f('0xd')][_0xf28f('0x10')]);return _0x546ac7(_0x29c486[_0xf28f('0xd')]['message']);}logger[_0xf28f('0xd')](_0xf28f('0xf'),_0x1cb55d,_0x29c486[_0xf28f('0xd')][_0xf28f('0x10')]);return _0x2ac03d(_0x29c486[_0xf28f('0xd')][_0xf28f('0x10')]);}else{logger[_0xf28f('0x11')](_0xf28f('0xf'),_0x1cb55d,'request\x20sent');_0x2ac03d(_0x29c486['result'][_0xf28f('0x10')]);}})[_0xf28f('0x12')](function(_0x1b96c9){logger[_0xf28f('0xd')](_0xf28f('0xf'),_0x1cb55d,_0x1b96c9);_0x546ac7(_0x1b96c9);});});} \ No newline at end of file +var _0xa16e=['client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0xa16e,0x133));var _0xea16=function(_0x44a387,_0xaad7c6){_0x44a387=_0x44a387-0x0;var _0x8f6d32=_0xa16e[_0x44a387];return _0x8f6d32;};'use strict';var _=require(_0xea16('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xea16('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xea16('0x2'));var db=require(_0xea16('0x3'))['db'];var utils=require(_0xea16('0x4'));var logger=require('../../config/logger')(_0xea16('0x5'));var config=require(_0xea16('0x6'));var jayson=require(_0xea16('0x7'));var client=jayson[_0xea16('0x8')][_0xea16('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x28f55a,_0x6afef0,_0x3d956d){return new BPromise(function(_0x575371,_0x2f892b){return client[_0xea16('0xa')](_0x28f55a,_0x3d956d)[_0xea16('0xb')](function(_0x341554){logger[_0xea16('0xc')](_0xea16('0xd'),_0x6afef0,_0xea16('0xe'));logger[_0xea16('0xf')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x6afef0,_0xea16('0xe'),JSON['stringify'](_0x341554));if(_0x341554[_0xea16('0x10')]){if(_0x341554['error'][_0xea16('0x11')]===0x1f4){logger[_0xea16('0x10')](_0xea16('0xd'),_0x6afef0,_0x341554[_0xea16('0x10')][_0xea16('0x12')]);return _0x2f892b(_0x341554[_0xea16('0x10')][_0xea16('0x12')]);}logger[_0xea16('0x10')]('ServicenowConfiguration,\x20%s,\x20%s',_0x6afef0,_0x341554[_0xea16('0x10')]['message']);return _0x575371(_0x341554[_0xea16('0x10')][_0xea16('0x12')]);}else{logger[_0xea16('0xc')](_0xea16('0xd'),_0x6afef0,_0xea16('0xe'));_0x575371(_0x341554[_0xea16('0x13')][_0xea16('0x12')]);}})[_0xea16('0x14')](function(_0x3c2c7f){logger[_0xea16('0x10')](_0xea16('0xd'),_0x6afef0,_0x3c2c7f);_0x2f892b(_0x3c2c7f);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index d974ee7..31faa64 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 _0x4ec8=['multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','/:id','isAuthenticated','show','post','create','put','update','destroy'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x4ec8,0xb4));var _0x84ec=function(_0x152433,_0x7bac01){_0x152433=_0x152433-0x0;var _0x46818f=_0x4ec8[_0x152433];return _0x46818f;};'use strict';var multer=require(_0x84ec('0x0'));var util=require(_0x84ec('0x1'));var path=require(_0x84ec('0x2'));var timeout=require('connect-timeout');var express=require(_0x84ec('0x3'));var router=express[_0x84ec('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x84ec('0x5'));var interaction=require(_0x84ec('0x6'));var config=require(_0x84ec('0x7'));var controller=require(_0x84ec('0x8'));router[_0x84ec('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x84ec('0x9')](_0x84ec('0xa'),auth[_0x84ec('0xb')](),controller[_0x84ec('0xc')]);router[_0x84ec('0xd')]('/',auth[_0x84ec('0xb')](),controller[_0x84ec('0xe')]);router[_0x84ec('0xf')](_0x84ec('0xa'),auth[_0x84ec('0xb')](),controller[_0x84ec('0x10')]);router['delete'](_0x84ec('0xa'),auth['isAuthenticated'](),controller[_0x84ec('0x11')]);module['exports']=router; \ No newline at end of file +var _0x955c=['connect-timeout','express','Router','./intServicenowField.controller','get','isAuthenticated','index','show','post','create','put','/:id','multer','util','path'];(function(_0x143b0b,_0x4ff2f8){var _0x2037d5=function(_0x4c42fb){while(--_0x4c42fb){_0x143b0b['push'](_0x143b0b['shift']());}};_0x2037d5(++_0x4ff2f8);}(_0x955c,0x93));var _0xc955=function(_0x2b018c,_0xa080e1){_0x2b018c=_0x2b018c-0x0;var _0x210909=_0x955c[_0x2b018c];return _0x210909;};'use strict';var multer=require(_0xc955('0x0'));var util=require(_0xc955('0x1'));var path=require(_0xc955('0x2'));var timeout=require(_0xc955('0x3'));var express=require(_0xc955('0x4'));var router=express[_0xc955('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc955('0x6'));router[_0xc955('0x7')]('/',auth[_0xc955('0x8')](),controller[_0xc955('0x9')]);router[_0xc955('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xc955('0xa')]);router[_0xc955('0xb')]('/',auth[_0xc955('0x8')](),controller[_0xc955('0xc')]);router[_0xc955('0xd')](_0xc955('0xe'),auth[_0xc955('0x8')](),controller['update']);router['delete']('/:id',auth[_0xc955('0x8')](),controller['destroy']);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 687f234..2b13842 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 _0x781d=['BOOLEAN','sequelize','exports','ENUM','variable','customVariable','keyValue','string','STRING'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x781d,0xb5));var _0xd781=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x781d[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0xd781('0x0'));module[_0xd781('0x1')]={'type':{'type':Sequelize[_0xd781('0x2')]('string',_0xd781('0x3'),_0xd781('0x4'),_0xd781('0x5'),'picklist'),'defaultValue':_0xd781('0x6')},'content':{'type':Sequelize[_0xd781('0x7')]},'key':{'type':Sequelize[_0xd781('0x7')]},'keyType':{'type':Sequelize[_0xd781('0x2')](_0xd781('0x6'),_0xd781('0x3'),_0xd781('0x4'))},'keyContent':{'type':Sequelize[_0xd781('0x7')]},'idField':{'type':Sequelize[_0xd781('0x7')]},'nameField':{'type':Sequelize[_0xd781('0x7')]},'customField':{'type':Sequelize[_0xd781('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9977=['variable','customVariable','keyValue','string','STRING','ENUM','BOOLEAN','sequelize'];(function(_0x57168d,_0x3ecb2c){var _0x1f88a4=function(_0x3b471a){while(--_0x3b471a){_0x57168d['push'](_0x57168d['shift']());}};_0x1f88a4(++_0x3ecb2c);}(_0x9977,0x157));var _0x7997=function(_0x205b46,_0x3ca65b){_0x205b46=_0x205b46-0x0;var _0x2b6ae8=_0x9977[_0x205b46];return _0x2b6ae8;};'use strict';var Sequelize=require(_0x7997('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('string',_0x7997('0x1'),_0x7997('0x2'),_0x7997('0x3'),'picklist'),'defaultValue':_0x7997('0x4')},'content':{'type':Sequelize[_0x7997('0x5')]},'key':{'type':Sequelize[_0x7997('0x5')]},'keyType':{'type':Sequelize[_0x7997('0x6')]('string',_0x7997('0x1'),_0x7997('0x2'))},'keyContent':{'type':Sequelize[_0x7997('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x7997('0x5')]},'customField':{'type':Sequelize[_0x7997('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7997('0x5')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 6adec70..ee3927f 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 _0xb0bd=['order','sort','where','filter','VIRTUAL','merge','options','ServicenowField','count','includeAll','include','rows','catch','show','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','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','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','apply','reject','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x168ea5,_0x3dacab){var _0x460baa=function(_0x399366){while(--_0x399366){_0x168ea5['push'](_0x168ea5['shift']());}};_0x460baa(++_0x3dacab);}(_0xb0bd,0x14e));var _0xdb0b=function(_0x39cdd9,_0x1881d6){_0x39cdd9=_0x39cdd9-0x0;var _0x1b0c56=_0xb0bd[_0x39cdd9];return _0x1b0c56;};'use strict';var emlformat=require(_0xdb0b('0x0'));var rimraf=require(_0xdb0b('0x1'));var zipdir=require(_0xdb0b('0x2'));var jsonpatch=require(_0xdb0b('0x3'));var rp=require(_0xdb0b('0x4'));var moment=require(_0xdb0b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdb0b('0x6'));var util=require(_0xdb0b('0x7'));var path=require(_0xdb0b('0x8'));var sox=require(_0xdb0b('0x9'));var csv=require('to-csv');var ejs=require(_0xdb0b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdb0b('0xb'));var squel=require(_0xdb0b('0xc'));var crypto=require(_0xdb0b('0xd'));var jsforce=require(_0xdb0b('0xe'));var deskjs=require(_0xdb0b('0xf'));var toCsv=require('to-csv');var querystring=require(_0xdb0b('0x10'));var Papa=require(_0xdb0b('0x11'));var Redis=require(_0xdb0b('0x12'));var authService=require(_0xdb0b('0x13'));var qs=require(_0xdb0b('0x14'));var as=require(_0xdb0b('0x15'));var hardwareService=require(_0xdb0b('0x16'));var logger=require('../../config/logger')(_0xdb0b('0x17'));var utils=require(_0xdb0b('0x18'));var config=require(_0xdb0b('0x19'));var licenseUtil=require(_0xdb0b('0x1a'));var db=require(_0xdb0b('0x1b'))['db'];function respondWithStatusCode(_0xe7a3e1,_0x32c79c){_0x32c79c=_0x32c79c||0xcc;return function(_0x47f23a){if(_0x47f23a){return _0xe7a3e1[_0xdb0b('0x1c')](_0x32c79c);}return _0xe7a3e1[_0xdb0b('0x1d')](_0x32c79c)[_0xdb0b('0x1e')]();};}function respondWithResult(_0x1ecfa8,_0x4bb54c){_0x4bb54c=_0x4bb54c||0xc8;return function(_0x3a4918){if(_0x3a4918){return _0x1ecfa8[_0xdb0b('0x1d')](_0x4bb54c)[_0xdb0b('0x1f')](_0x3a4918);}};}function respondWithFilteredResult(_0x8b9a41,_0x1f87a2){return function(_0x466b34){if(_0x466b34){var _0x4d12d6=typeof _0x1f87a2[_0xdb0b('0x20')]===_0xdb0b('0x21')&&typeof _0x1f87a2[_0xdb0b('0x22')]===_0xdb0b('0x21');var _0x158730=_0x466b34['count'];var _0x53ea18=_0x4d12d6?0x0:_0x1f87a2[_0xdb0b('0x20')];var _0x44619a=_0x4d12d6?_0x466b34['count']:_0x1f87a2['offset']+_0x1f87a2['limit'];var _0x4f224d;if(_0x44619a>=_0x158730){_0x44619a=_0x158730;_0x4f224d=0xc8;}else{_0x4f224d=0xce;}_0x8b9a41[_0xdb0b('0x1d')](_0x4f224d);return _0x8b9a41[_0xdb0b('0x23')]('Content-Range',_0x53ea18+'-'+_0x44619a+'/'+_0x158730)[_0xdb0b('0x1f')](_0x466b34);}return null;};}function patchUpdates(_0x4ea7b8){return function(_0x4c7947){try{jsonpatch[_0xdb0b('0x24')](_0x4c7947,_0x4ea7b8,!![]);}catch(_0x3d94a9){return BPromise[_0xdb0b('0x25')](_0x3d94a9);}return _0x4c7947['save']();};}function saveUpdates(_0x30ba28,_0x9636c0){return function(_0x1a0a82){if(_0x1a0a82){return _0x1a0a82[_0xdb0b('0x26')](_0x30ba28)[_0xdb0b('0x27')](function(_0x486d0c){return _0x486d0c;});}return null;};}function removeEntity(_0x24cec5,_0x54410b){return function(_0x4c60ef){if(_0x4c60ef){return _0x4c60ef[_0xdb0b('0x28')]()[_0xdb0b('0x27')](function(){_0x24cec5[_0xdb0b('0x1d')](0xcc)[_0xdb0b('0x1e')]();});}};}function handleEntityNotFound(_0x1efbd8,_0x481b95){return function(_0x5e8081){if(!_0x5e8081){_0x1efbd8[_0xdb0b('0x1c')](0x194);}return _0x5e8081;};}function handleError(_0x1876b6,_0x388e0a){_0x388e0a=_0x388e0a||0x1f4;return function(_0x3679ac){logger[_0xdb0b('0x29')](_0x3679ac[_0xdb0b('0x2a')]);if(_0x3679ac[_0xdb0b('0x2b')]){delete _0x3679ac[_0xdb0b('0x2b')];}_0x1876b6[_0xdb0b('0x1d')](_0x388e0a)[_0xdb0b('0x2c')](_0x3679ac);};}exports[_0xdb0b('0x2d')]=function(_0x19950a,_0x566603){var _0x5211ba={},_0x2f742a={},_0x370377={'count':0x0,'rows':[]};var _0x321655=_['map'](db['ServicenowField'][_0xdb0b('0x2e')],function(_0x3bd152){return{'name':_0x3bd152[_0xdb0b('0x2f')],'type':_0x3bd152[_0xdb0b('0x30')][_0xdb0b('0x31')]};});_0x2f742a['model']=_[_0xdb0b('0x32')](_0x321655,_0xdb0b('0x2b'));_0x2f742a[_0xdb0b('0x33')]=_[_0xdb0b('0x34')](_0x19950a[_0xdb0b('0x33')]);_0x2f742a[_0xdb0b('0x35')]=_[_0xdb0b('0x36')](_0x2f742a[_0xdb0b('0x37')],_0x2f742a['query']);_0x5211ba[_0xdb0b('0x38')]=_[_0xdb0b('0x36')](_0x2f742a['model'],qs[_0xdb0b('0x39')](_0x19950a[_0xdb0b('0x33')][_0xdb0b('0x39')]));_0x5211ba[_0xdb0b('0x38')]=_0x5211ba['attributes'][_0xdb0b('0x3a')]?_0x5211ba[_0xdb0b('0x38')]:_0x2f742a[_0xdb0b('0x37')];if(!_0x19950a[_0xdb0b('0x33')][_0xdb0b('0x3b')](_0xdb0b('0x3c'))){_0x5211ba[_0xdb0b('0x22')]=qs[_0xdb0b('0x22')](_0x19950a['query'][_0xdb0b('0x22')]);_0x5211ba[_0xdb0b('0x20')]=qs[_0xdb0b('0x20')](_0x19950a[_0xdb0b('0x33')][_0xdb0b('0x20')]);}_0x5211ba[_0xdb0b('0x3d')]=qs[_0xdb0b('0x3e')](_0x19950a[_0xdb0b('0x33')][_0xdb0b('0x3e')]);_0x5211ba[_0xdb0b('0x3f')]=qs['filters'](_['pick'](_0x19950a[_0xdb0b('0x33')],_0x2f742a[_0xdb0b('0x35')]),_0x321655);if(_0x19950a['query'][_0xdb0b('0x40')]){_0x5211ba['where']=_['merge'](_0x5211ba['where'],{'$or':_[_0xdb0b('0x32')](_0x321655,function(_0x181450){if(_0x181450[_0xdb0b('0x30')]!==_0xdb0b('0x41')){var _0x22b0e3={};_0x22b0e3[_0x181450[_0xdb0b('0x2b')]]={'$like':'%'+_0x19950a[_0xdb0b('0x33')][_0xdb0b('0x40')]+'%'};return _0x22b0e3;}})});}_0x5211ba=_[_0xdb0b('0x42')]({},_0x5211ba,_0x19950a[_0xdb0b('0x43')]);var _0x1274ee={'where':_0x5211ba['where']};return db[_0xdb0b('0x44')][_0xdb0b('0x45')](_0x1274ee)[_0xdb0b('0x27')](function(_0x3a693f){_0x370377['count']=_0x3a693f;if(_0x19950a[_0xdb0b('0x33')][_0xdb0b('0x46')]){_0x5211ba[_0xdb0b('0x47')]=[{'all':!![]}];}return db[_0xdb0b('0x44')]['findAll'](_0x5211ba);})[_0xdb0b('0x27')](function(_0xa7d2a6){_0x370377[_0xdb0b('0x48')]=_0xa7d2a6;return _0x370377;})[_0xdb0b('0x27')](respondWithFilteredResult(_0x566603,_0x5211ba))[_0xdb0b('0x49')](handleError(_0x566603,null));};exports[_0xdb0b('0x4a')]=function(_0x5cfe63,_0xbbdac2){var _0x47a273={'raw':!![],'where':{'id':_0x5cfe63['params']['id']}},_0x18e097={};_0x18e097[_0xdb0b('0x37')]=_['keys'](db[_0xdb0b('0x44')]['rawAttributes']);_0x18e097[_0xdb0b('0x33')]=_['keys'](_0x5cfe63[_0xdb0b('0x33')]);_0x18e097[_0xdb0b('0x35')]=_[_0xdb0b('0x36')](_0x18e097[_0xdb0b('0x37')],_0x18e097[_0xdb0b('0x33')]);_0x47a273[_0xdb0b('0x38')]=_['intersection'](_0x18e097[_0xdb0b('0x37')],qs['fields'](_0x5cfe63[_0xdb0b('0x33')]['fields']));_0x47a273[_0xdb0b('0x38')]=_0x47a273[_0xdb0b('0x38')][_0xdb0b('0x3a')]?_0x47a273[_0xdb0b('0x38')]:_0x18e097[_0xdb0b('0x37')];if(_0x5cfe63[_0xdb0b('0x33')]['includeAll']){_0x47a273['include']=[{'all':!![]}];}_0x47a273=_[_0xdb0b('0x42')]({},_0x47a273,_0x5cfe63[_0xdb0b('0x43')]);return db['ServicenowField'][_0xdb0b('0x4b')](_0x47a273)[_0xdb0b('0x27')](handleEntityNotFound(_0xbbdac2,null))['then'](respondWithResult(_0xbbdac2,null))[_0xdb0b('0x49')](handleError(_0xbbdac2,null));};exports[_0xdb0b('0x4c')]=function(_0x4c52ac,_0x1055db){return db[_0xdb0b('0x44')][_0xdb0b('0x4c')](_0x4c52ac[_0xdb0b('0x4d')],{})[_0xdb0b('0x27')](respondWithResult(_0x1055db,0xc9))['catch'](handleError(_0x1055db,null));};exports['update']=function(_0x2257d3,_0x2327a1){if(_0x2257d3[_0xdb0b('0x4d')]['id']){delete _0x2257d3[_0xdb0b('0x4d')]['id'];}return db[_0xdb0b('0x44')][_0xdb0b('0x4b')]({'where':{'id':_0x2257d3[_0xdb0b('0x4e')]['id']}})[_0xdb0b('0x27')](handleEntityNotFound(_0x2327a1,null))[_0xdb0b('0x27')](saveUpdates(_0x2257d3['body'],null))[_0xdb0b('0x27')](respondWithResult(_0x2327a1,null))['catch'](handleError(_0x2327a1,null));};exports[_0xdb0b('0x28')]=function(_0x74e2a3,_0x72d368){return db[_0xdb0b('0x44')][_0xdb0b('0x4b')]({'where':{'id':_0x74e2a3[_0xdb0b('0x4e')]['id']}})[_0xdb0b('0x27')](handleEntityNotFound(_0x72d368,null))[_0xdb0b('0x27')](removeEntity(_0x72d368,null))['catch'](handleError(_0x72d368,null));}; \ No newline at end of file +var _0x14d7=['rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','merge','options','create','body','update','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','json','apply','reject','save','destroy','then','error','stack','send','index','map','ServicenowField'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x14d7,0xba));var _0x714d=function(_0x237546,_0xa81b26){_0x237546=_0x237546-0x0;var _0x233e29=_0x14d7[_0x237546];return _0x233e29;};'use strict';var emlformat=require(_0x714d('0x0'));var rimraf=require(_0x714d('0x1'));var zipdir=require(_0x714d('0x2'));var jsonpatch=require(_0x714d('0x3'));var rp=require(_0x714d('0x4'));var moment=require(_0x714d('0x5'));var BPromise=require(_0x714d('0x6'));var Mustache=require('mustache');var util=require(_0x714d('0x7'));var path=require('path');var sox=require(_0x714d('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x714d('0x9'));var _=require(_0x714d('0xa'));var squel=require(_0x714d('0xb'));var crypto=require(_0x714d('0xc'));var jsforce=require(_0x714d('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x714d('0xe'));var Papa=require('papaparse');var Redis=require(_0x714d('0xf'));var authService=require(_0x714d('0x10'));var qs=require(_0x714d('0x11'));var as=require(_0x714d('0x12'));var hardwareService=require(_0x714d('0x13'));var logger=require('../../config/logger')(_0x714d('0x14'));var utils=require(_0x714d('0x15'));var config=require(_0x714d('0x16'));var licenseUtil=require(_0x714d('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x52824b,_0x5b1f16){_0x5b1f16=_0x5b1f16||0xcc;return function(_0x5018c7){if(_0x5018c7){return _0x52824b[_0x714d('0x18')](_0x5b1f16);}return _0x52824b['status'](_0x5b1f16)[_0x714d('0x19')]();};}function respondWithResult(_0x3ecdbf,_0x50e6e9){_0x50e6e9=_0x50e6e9||0xc8;return function(_0x221756){if(_0x221756){return _0x3ecdbf['status'](_0x50e6e9)['json'](_0x221756);}};}function respondWithFilteredResult(_0x3741cf,_0x10e6d4){return function(_0x28f211){if(_0x28f211){var _0x1f1135=typeof _0x10e6d4[_0x714d('0x1a')]===_0x714d('0x1b')&&typeof _0x10e6d4[_0x714d('0x1c')]===_0x714d('0x1b');var _0x1f8bf8=_0x28f211[_0x714d('0x1d')];var _0x3514cd=_0x1f1135?0x0:_0x10e6d4['offset'];var _0x4530da=_0x1f1135?_0x28f211[_0x714d('0x1d')]:_0x10e6d4[_0x714d('0x1a')]+_0x10e6d4['limit'];var _0x4ed789;if(_0x4530da>=_0x1f8bf8){_0x4530da=_0x1f8bf8;_0x4ed789=0xc8;}else{_0x4ed789=0xce;}_0x3741cf[_0x714d('0x1e')](_0x4ed789);return _0x3741cf[_0x714d('0x1f')](_0x714d('0x20'),_0x3514cd+'-'+_0x4530da+'/'+_0x1f8bf8)[_0x714d('0x21')](_0x28f211);}return null;};}function patchUpdates(_0x55c4b6){return function(_0x26a89f){try{jsonpatch[_0x714d('0x22')](_0x26a89f,_0x55c4b6,!![]);}catch(_0x4d092e){return BPromise[_0x714d('0x23')](_0x4d092e);}return _0x26a89f[_0x714d('0x24')]();};}function saveUpdates(_0x3ca067,_0x193600){return function(_0x4ae71b){if(_0x4ae71b){return _0x4ae71b['update'](_0x3ca067)['then'](function(_0x56ec24){return _0x56ec24;});}return null;};}function removeEntity(_0x54d2b8,_0x1b3daa){return function(_0x32bfa9){if(_0x32bfa9){return _0x32bfa9[_0x714d('0x25')]()[_0x714d('0x26')](function(){_0x54d2b8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x36bd57,_0x490397){return function(_0xfdbf05){if(!_0xfdbf05){_0x36bd57[_0x714d('0x18')](0x194);}return _0xfdbf05;};}function handleError(_0x219c85,_0x4cd688){_0x4cd688=_0x4cd688||0x1f4;return function(_0x159099){logger[_0x714d('0x27')](_0x159099[_0x714d('0x28')]);if(_0x159099['name']){delete _0x159099['name'];}_0x219c85[_0x714d('0x1e')](_0x4cd688)[_0x714d('0x29')](_0x159099);};}exports[_0x714d('0x2a')]=function(_0x46139d,_0x2bd6f9){var _0x57d60e={},_0x1d06d8={},_0x1abd61={'count':0x0,'rows':[]};var _0x267c0d=_[_0x714d('0x2b')](db[_0x714d('0x2c')][_0x714d('0x2d')],function(_0x400408){return{'name':_0x400408[_0x714d('0x2e')],'type':_0x400408['type'][_0x714d('0x2f')]};});_0x1d06d8[_0x714d('0x30')]=_[_0x714d('0x2b')](_0x267c0d,'name');_0x1d06d8[_0x714d('0x31')]=_['keys'](_0x46139d[_0x714d('0x31')]);_0x1d06d8[_0x714d('0x32')]=_[_0x714d('0x33')](_0x1d06d8['model'],_0x1d06d8[_0x714d('0x31')]);_0x57d60e[_0x714d('0x34')]=_[_0x714d('0x33')](_0x1d06d8['model'],qs[_0x714d('0x35')](_0x46139d[_0x714d('0x31')]['fields']));_0x57d60e[_0x714d('0x34')]=_0x57d60e[_0x714d('0x34')][_0x714d('0x36')]?_0x57d60e[_0x714d('0x34')]:_0x1d06d8[_0x714d('0x30')];if(!_0x46139d['query'][_0x714d('0x37')](_0x714d('0x38'))){_0x57d60e['limit']=qs[_0x714d('0x1c')](_0x46139d[_0x714d('0x31')][_0x714d('0x1c')]);_0x57d60e['offset']=qs[_0x714d('0x1a')](_0x46139d[_0x714d('0x31')][_0x714d('0x1a')]);}_0x57d60e[_0x714d('0x39')]=qs['sort'](_0x46139d[_0x714d('0x31')][_0x714d('0x3a')]);_0x57d60e[_0x714d('0x3b')]=qs['filters'](_[_0x714d('0x3c')](_0x46139d[_0x714d('0x31')],_0x1d06d8[_0x714d('0x32')]),_0x267c0d);if(_0x46139d[_0x714d('0x31')][_0x714d('0x3d')]){_0x57d60e[_0x714d('0x3b')]=_['merge'](_0x57d60e['where'],{'$or':_['map'](_0x267c0d,function(_0x1accce){if(_0x1accce['type']!==_0x714d('0x3e')){var _0x387dd4={};_0x387dd4[_0x1accce['name']]={'$like':'%'+_0x46139d[_0x714d('0x31')]['filter']+'%'};return _0x387dd4;}})});}_0x57d60e=_['merge']({},_0x57d60e,_0x46139d['options']);var _0x30810f={'where':_0x57d60e[_0x714d('0x3b')]};return db['ServicenowField'][_0x714d('0x1d')](_0x30810f)[_0x714d('0x26')](function(_0x50ad4f){_0x1abd61['count']=_0x50ad4f;if(_0x46139d[_0x714d('0x31')][_0x714d('0x3f')]){_0x57d60e[_0x714d('0x40')]=[{'all':!![]}];}return db[_0x714d('0x2c')][_0x714d('0x41')](_0x57d60e);})[_0x714d('0x26')](function(_0x2674c2){_0x1abd61[_0x714d('0x42')]=_0x2674c2;return _0x1abd61;})['then'](respondWithFilteredResult(_0x2bd6f9,_0x57d60e))[_0x714d('0x43')](handleError(_0x2bd6f9,null));};exports[_0x714d('0x44')]=function(_0x303373,_0x25e047){var _0x101df2={'raw':!![],'where':{'id':_0x303373[_0x714d('0x45')]['id']}},_0x17bc5a={};_0x17bc5a['model']=_[_0x714d('0x46')](db['ServicenowField'][_0x714d('0x2d')]);_0x17bc5a['query']=_[_0x714d('0x46')](_0x303373['query']);_0x17bc5a[_0x714d('0x32')]=_[_0x714d('0x33')](_0x17bc5a['model'],_0x17bc5a[_0x714d('0x31')]);_0x101df2[_0x714d('0x34')]=_[_0x714d('0x33')](_0x17bc5a[_0x714d('0x30')],qs[_0x714d('0x35')](_0x303373[_0x714d('0x31')][_0x714d('0x35')]));_0x101df2[_0x714d('0x34')]=_0x101df2['attributes']['length']?_0x101df2[_0x714d('0x34')]:_0x17bc5a['model'];if(_0x303373['query'][_0x714d('0x3f')]){_0x101df2[_0x714d('0x40')]=[{'all':!![]}];}_0x101df2=_[_0x714d('0x47')]({},_0x101df2,_0x303373[_0x714d('0x48')]);return db[_0x714d('0x2c')]['find'](_0x101df2)['then'](handleEntityNotFound(_0x25e047,null))['then'](respondWithResult(_0x25e047,null))['catch'](handleError(_0x25e047,null));};exports[_0x714d('0x49')]=function(_0x32ef59,_0x41ef7a){return db['ServicenowField'][_0x714d('0x49')](_0x32ef59[_0x714d('0x4a')],{})['then'](respondWithResult(_0x41ef7a,0xc9))[_0x714d('0x43')](handleError(_0x41ef7a,null));};exports[_0x714d('0x4b')]=function(_0x27c20b,_0x189f6d){if(_0x27c20b['body']['id']){delete _0x27c20b[_0x714d('0x4a')]['id'];}return db[_0x714d('0x2c')][_0x714d('0x4c')]({'where':{'id':_0x27c20b[_0x714d('0x45')]['id']}})[_0x714d('0x26')](handleEntityNotFound(_0x189f6d,null))[_0x714d('0x26')](saveUpdates(_0x27c20b[_0x714d('0x4a')],null))[_0x714d('0x26')](respondWithResult(_0x189f6d,null))[_0x714d('0x43')](handleError(_0x189f6d,null));};exports[_0x714d('0x25')]=function(_0x47fcca,_0xc20d25){return db[_0x714d('0x2c')][_0x714d('0x4c')]({'where':{'id':_0x47fcca['params']['id']}})[_0x714d('0x26')](handleEntityNotFound(_0xc20d25,null))[_0x714d('0x26')](removeEntity(_0xc20d25,null))[_0x714d('0x43')](handleError(_0xc20d25,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 5404cef..91feceb 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 _0xdaf7=['exports','define','ServicenowField','int_servicenow_fields','idField','FieldId','lodash','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intServicenowField.attributes'];(function(_0x1ccf9b,_0x4fe9f6){var _0x37d4a6=function(_0x16471d){while(--_0x16471d){_0x1ccf9b['push'](_0x1ccf9b['shift']());}};_0x37d4a6(++_0x4fe9f6);}(_0xdaf7,0x1f0));var _0x7daf=function(_0x261297,_0x2284cc){_0x261297=_0x261297-0x0;var _0xd3c0a6=_0xdaf7[_0x261297];return _0xd3c0a6;};'use strict';var _=require(_0x7daf('0x0'));var util=require('util');var logger=require(_0x7daf('0x1'))(_0x7daf('0x2'));var moment=require('moment');var BPromise=require(_0x7daf('0x3'));var rp=require(_0x7daf('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7daf('0x5'));var config=require(_0x7daf('0x6'));var attributes=require(_0x7daf('0x7'));module[_0x7daf('0x8')]=function(_0x38b840,_0x4219c3){return _0x38b840[_0x7daf('0x9')](_0x7daf('0xa'),attributes,{'tableName':_0x7daf('0xb'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x7daf('0xc'),_0x7daf('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa812=['./intServicenowField.attributes','exports','define','servicenow_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment'];(function(_0x572944,_0xd5c0df){var _0x2f457a=function(_0x5ba3bf){while(--_0x5ba3bf){_0x572944['push'](_0x572944['shift']());}};_0x2f457a(++_0xd5c0df);}(_0xa812,0x18c));var _0x2a81=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0xa812[_0x50a0c2];return _0x5ebadd;};'use strict';var _=require(_0x2a81('0x0'));var util=require(_0x2a81('0x1'));var logger=require(_0x2a81('0x2'))(_0x2a81('0x3'));var moment=require(_0x2a81('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2a81('0x5'));var config=require(_0x2a81('0x6'));var attributes=require(_0x2a81('0x7'));module[_0x2a81('0x8')]=function(_0x2fc89c,_0x49c801){return _0x2fc89c[_0x2a81('0x9')]('ServicenowField',attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0x2a81('0xa'),'fields':[_0x2a81('0xb'),_0x2a81('0xc')],'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 b7f2b12..88e1112 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 _0xbaf0=['client','http','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1de43c,_0xaa29de){var _0x296d3e=function(_0x50b76f){while(--_0x50b76f){_0x1de43c['push'](_0x1de43c['shift']());}};_0x296d3e(++_0xaa29de);}(_0xbaf0,0x12a));var _0x0baf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbaf0[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var BPromise=require(_0x0baf('0x2'));var rs=require(_0x0baf('0x3'));var fs=require('fs');var Redis=require(_0x0baf('0x4'));var db=require(_0x0baf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0baf('0x6'))(_0x0baf('0x7'));var config=require(_0x0baf('0x8'));var jayson=require(_0x0baf('0x9'));var client=jayson[_0x0baf('0xa')][_0x0baf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){return client['request'](_0x1a10b1,_0x1d0a0d)[_0x0baf('0xc')](function(_0x2c7442){logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,_0x0baf('0xf'));logger[_0x0baf('0x10')](_0x0baf('0x11'),_0x2dcaac,_0x0baf('0xf'),JSON[_0x0baf('0x12')](_0x2c7442));if(_0x2c7442[_0x0baf('0x13')]){if(_0x2c7442[_0x0baf('0x13')]['code']===0x1f4){logger['error'](_0x0baf('0xe'),_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x11b947(_0x2c7442[_0x0baf('0x13')]['message']);}logger[_0x0baf('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x5f5030(_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);}else{logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,'request\x20sent');_0x5f5030(_0x2c7442['result'][_0x0baf('0x14')]);}})[_0x0baf('0x15')](function(_0x283408){logger[_0x0baf('0x13')](_0x0baf('0xe'),_0x2dcaac,_0x283408);_0x11b947(_0x283408);});});} \ No newline at end of file +var _0xb7e7=['ServicenowField,\x20%s,\x20%s','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info'];(function(_0x3a0662,_0x4a6cd4){var _0x20007a=function(_0xd1a323){while(--_0xd1a323){_0x3a0662['push'](_0x3a0662['shift']());}};_0x20007a(++_0x4a6cd4);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0xb7e7[_0x1ccdf7];return _0x52a0ae;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var moment=require(_0x7b7e('0x1'));var BPromise=require('bluebird');var rs=require(_0x7b7e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b7e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b7e('0x4'))(_0x7b7e('0x5'));var config=require(_0x7b7e('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7b7e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x372bde,_0x7f87e0,_0x55ce81){return new BPromise(function(_0x42b871,_0x223587){return client[_0x7b7e('0x8')](_0x372bde,_0x55ce81)[_0x7b7e('0x9')](function(_0x148964){logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');logger[_0x7b7e('0xc')](_0x7b7e('0xd'),_0x7f87e0,_0x7b7e('0xe'),JSON[_0x7b7e('0xf')](_0x148964));if(_0x148964[_0x7b7e('0x10')]){if(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x11')]===0x1f4){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x223587(_0x148964[_0x7b7e('0x10')]['message']);}logger[_0x7b7e('0x10')]('ServicenowField,\x20%s,\x20%s',_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x42b871(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x12')]);}else{logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');_0x42b871(_0x148964['result'][_0x7b7e('0x12')]);}})[_0x7b7e('0x13')](function(_0x27f999){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x27f999);_0x223587(_0x27f999);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 70ad3d5..2244c12 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 _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(_0x281c82,_0x23f870){var _0x455049=function(_0x2c0ebd){while(--_0x2c0ebd){_0x281c82['push'](_0x281c82['shift']());}};_0x455049(++_0x23f870);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'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','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x363bb1,_0x961d24){var _0x3348c6=function(_0xd37a9f){while(--_0xd37a9f){_0x363bb1['push'](_0x363bb1['shift']());}};_0x3348c6(++_0x961d24);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'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/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 90cf51e..cc9bd18 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(_0x194760,_0x1d3d53){var _0x633126=function(_0x4c7ce0){while(--_0x4c7ce0){_0x194760['push'](_0x194760['shift']());}};_0x633126(++_0x1d3d53);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'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(_0x621b52,_0x5988e1){var _0x40492e=function(_0x4a180d){while(--_0x4a180d){_0x621b52['push'](_0x621b52['shift']());}};_0x40492e(++_0x5988e1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'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 2cbdbae..844513d 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 _0xfdee=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','SugarcrmAccount','findAll','rows','params','include','find','catch','create','body','getConfigurations','findOne','SugarcrmConfiguration','order','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','SugarcrmField','getFields','assigned_user_id','description','duration_hours','duration_minutes','parent_type','parent_name','direction','username','password','remoteUri','slice','substring','lastIndexOf','POST','format','login','JSON','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','%s%s','/service/v4_1/rest.php','get_module_fields','Calls','module_fields','includes','label','endsWith','values','statusCode','stringify','test','Wrong\x20credentials','eml-format','rimraf'];(function(_0x57c36d,_0x258266){var _0xf018c9=function(_0x1eeccc){while(--_0x1eeccc){_0x57c36d['push'](_0x57c36d['shift']());}};_0xf018c9(++_0x258266);}(_0xfdee,0xf6));var _0xefde=function(_0x1428d9,_0xded63c){_0x1428d9=_0x1428d9-0x0;var _0x438019=_0xfdee[_0x1428d9];return _0x438019;};'use strict';var emlformat=require(_0xefde('0x0'));var rimraf=require(_0xefde('0x1'));var zipdir=require(_0xefde('0x2'));var jsonpatch=require(_0xefde('0x3'));var rp=require(_0xefde('0x4'));var moment=require(_0xefde('0x5'));var BPromise=require(_0xefde('0x6'));var Mustache=require(_0xefde('0x7'));var util=require(_0xefde('0x8'));var path=require(_0xefde('0x9'));var sox=require(_0xefde('0xa'));var csv=require(_0xefde('0xb'));var ejs=require(_0xefde('0xc'));var fs=require('fs');var fs_extra=require(_0xefde('0xd'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xefde('0xe'));var jsforce=require(_0xefde('0xf'));var deskjs=require(_0xefde('0x10'));var toCsv=require(_0xefde('0xb'));var querystring=require(_0xefde('0x11'));var Papa=require(_0xefde('0x12'));var Redis=require(_0xefde('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xefde('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xefde('0x15'));var logger=require(_0xefde('0x16'))(_0xefde('0x17'));var utils=require(_0xefde('0x18'));var config=require(_0xefde('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xefde('0x1a'))['db'];var integrations=require(_0xefde('0x1b'));function respondWithStatusCode(_0xc14b64,_0x4bf7ad){_0x4bf7ad=_0x4bf7ad||0xcc;return function(_0x79997f){if(_0x79997f){return _0xc14b64[_0xefde('0x1c')](_0x4bf7ad);}return _0xc14b64['status'](_0x4bf7ad)[_0xefde('0x1d')]();};}function respondWithResult(_0x172dae,_0x1e7a0c){_0x1e7a0c=_0x1e7a0c||0xc8;return function(_0x378d63){if(_0x378d63){return _0x172dae[_0xefde('0x1e')](_0x1e7a0c)[_0xefde('0x1f')](_0x378d63);}};}function respondWithFilteredResult(_0x10c13b,_0x39e1a6){return function(_0x52c5ba){if(_0x52c5ba){var _0x13d8ae=typeof _0x39e1a6['offset']===_0xefde('0x20')&&typeof _0x39e1a6['limit']===_0xefde('0x20');var _0x30ce57=_0x52c5ba[_0xefde('0x21')];var _0x1da8c7=_0x13d8ae?0x0:_0x39e1a6[_0xefde('0x22')];var _0x341478=_0x13d8ae?_0x52c5ba[_0xefde('0x21')]:_0x39e1a6['offset']+_0x39e1a6[_0xefde('0x23')];var _0x59e44b;if(_0x341478>=_0x30ce57){_0x341478=_0x30ce57;_0x59e44b=0xc8;}else{_0x59e44b=0xce;}_0x10c13b[_0xefde('0x1e')](_0x59e44b);return _0x10c13b[_0xefde('0x24')](_0xefde('0x25'),_0x1da8c7+'-'+_0x341478+'/'+_0x30ce57)[_0xefde('0x1f')](_0x52c5ba);}return null;};}function patchUpdates(_0x55ff24){return function(_0x5df905){try{jsonpatch[_0xefde('0x26')](_0x5df905,_0x55ff24,!![]);}catch(_0x468776){return BPromise[_0xefde('0x27')](_0x468776);}return _0x5df905[_0xefde('0x28')]();};}function saveUpdates(_0x44865c,_0x393596){return function(_0x332bbe){if(_0x332bbe){return _0x332bbe[_0xefde('0x29')](_0x44865c)[_0xefde('0x2a')](function(_0x13f4de){return _0x13f4de;});}return null;};}function removeEntity(_0x35d924,_0x3ca883){return function(_0xb89ce0){if(_0xb89ce0){return _0xb89ce0[_0xefde('0x2b')]()[_0xefde('0x2a')](function(){_0x35d924['status'](0xcc)[_0xefde('0x1d')]();});}};}function handleEntityNotFound(_0x16be10,_0x191708){return function(_0x34ce09){if(!_0x34ce09){_0x16be10[_0xefde('0x1c')](0x194);}return _0x34ce09;};}function handleError(_0x1dd20a,_0x1fa066){_0x1fa066=_0x1fa066||0x1f4;return function(_0x588bd1){logger[_0xefde('0x2c')](_0x588bd1['stack']);if(_0x588bd1[_0xefde('0x2d')]){delete _0x588bd1['name'];}_0x1dd20a[_0xefde('0x1e')](_0x1fa066)[_0xefde('0x2e')](_0x588bd1);};}exports[_0xefde('0x2f')]=function(_0x346a91,_0x5a31fa){var _0x34f650={},_0x3822bb={},_0x3aebec={'count':0x0,'rows':[]};var _0xa026c=_[_0xefde('0x30')](db['SugarcrmAccount'][_0xefde('0x31')],function(_0x1b6f65){return{'name':_0x1b6f65['fieldName'],'type':_0x1b6f65[_0xefde('0x32')][_0xefde('0x33')]};});_0x3822bb[_0xefde('0x34')]=_[_0xefde('0x30')](_0xa026c,_0xefde('0x2d'));_0x3822bb[_0xefde('0x35')]=_[_0xefde('0x36')](_0x346a91[_0xefde('0x35')]);_0x3822bb[_0xefde('0x37')]=_[_0xefde('0x38')](_0x3822bb[_0xefde('0x34')],_0x3822bb[_0xefde('0x35')]);_0x34f650[_0xefde('0x39')]=_[_0xefde('0x38')](_0x3822bb[_0xefde('0x34')],qs['fields'](_0x346a91[_0xefde('0x35')][_0xefde('0x3a')]));_0x34f650[_0xefde('0x39')]=_0x34f650[_0xefde('0x39')][_0xefde('0x3b')]?_0x34f650[_0xefde('0x39')]:_0x3822bb[_0xefde('0x34')];if(!_0x346a91[_0xefde('0x35')][_0xefde('0x3c')](_0xefde('0x3d'))){_0x34f650['limit']=qs[_0xefde('0x23')](_0x346a91['query'][_0xefde('0x23')]);_0x34f650[_0xefde('0x22')]=qs[_0xefde('0x22')](_0x346a91[_0xefde('0x35')][_0xefde('0x22')]);}_0x34f650['order']=qs[_0xefde('0x3e')](_0x346a91[_0xefde('0x35')][_0xefde('0x3e')]);_0x34f650[_0xefde('0x3f')]=qs[_0xefde('0x37')](_[_0xefde('0x40')](_0x346a91[_0xefde('0x35')],_0x3822bb[_0xefde('0x37')]),_0xa026c);if(_0x346a91[_0xefde('0x35')][_0xefde('0x41')]){_0x34f650[_0xefde('0x3f')]=_[_0xefde('0x42')](_0x34f650[_0xefde('0x3f')],{'$or':_[_0xefde('0x30')](_0xa026c,function(_0x2eace7){if(_0x2eace7[_0xefde('0x32')]!==_0xefde('0x43')){var _0xa1ee1d={};_0xa1ee1d[_0x2eace7[_0xefde('0x2d')]]={'$like':'%'+_0x346a91[_0xefde('0x35')]['filter']+'%'};return _0xa1ee1d;}})});}_0x34f650=_[_0xefde('0x42')]({},_0x34f650,_0x346a91[_0xefde('0x44')]);var _0x19cd13={'where':_0x34f650[_0xefde('0x3f')]};return db[_0xefde('0x45')]['count'](_0x19cd13)['then'](function(_0xdd7070){_0x3aebec[_0xefde('0x21')]=_0xdd7070;if(_0x346a91[_0xefde('0x35')]['includeAll']){_0x34f650['include']=[{'all':!![]}];}return db[_0xefde('0x45')][_0xefde('0x46')](_0x34f650);})[_0xefde('0x2a')](function(_0x2d81c5){_0x3aebec[_0xefde('0x47')]=_0x2d81c5;return _0x3aebec;})[_0xefde('0x2a')](respondWithFilteredResult(_0x5a31fa,_0x34f650))['catch'](handleError(_0x5a31fa,null));};exports['show']=function(_0x103e21,_0xdc03c0){var _0x465f81={'raw':![],'where':{'id':_0x103e21[_0xefde('0x48')]['id']}},_0x2e3633={};_0x2e3633['model']=_[_0xefde('0x36')](db[_0xefde('0x45')][_0xefde('0x31')]);_0x2e3633[_0xefde('0x35')]=_[_0xefde('0x36')](_0x103e21['query']);_0x2e3633[_0xefde('0x37')]=_[_0xefde('0x38')](_0x2e3633['model'],_0x2e3633[_0xefde('0x35')]);_0x465f81[_0xefde('0x39')]=_['intersection'](_0x2e3633[_0xefde('0x34')],qs[_0xefde('0x3a')](_0x103e21[_0xefde('0x35')][_0xefde('0x3a')]));_0x465f81[_0xefde('0x39')]=_0x465f81[_0xefde('0x39')][_0xefde('0x3b')]?_0x465f81[_0xefde('0x39')]:_0x2e3633[_0xefde('0x34')];if(_0x103e21['query']['includeAll']){_0x465f81[_0xefde('0x49')]=[{'all':!![]}];}_0x465f81=_[_0xefde('0x42')]({},_0x465f81,_0x103e21[_0xefde('0x44')]);return db[_0xefde('0x45')][_0xefde('0x4a')](_0x465f81)[_0xefde('0x2a')](handleEntityNotFound(_0xdc03c0,null))[_0xefde('0x2a')](respondWithResult(_0xdc03c0,null))[_0xefde('0x4b')](handleError(_0xdc03c0,null));};exports[_0xefde('0x4c')]=function(_0x4b2372,_0x3fd70f){return db[_0xefde('0x45')][_0xefde('0x4c')](_0x4b2372['body'],{})[_0xefde('0x2a')](respondWithResult(_0x3fd70f,0xc9))[_0xefde('0x4b')](handleError(_0x3fd70f,null));};exports['update']=function(_0x24982c,_0x3e0ebf){if(_0x24982c[_0xefde('0x4d')]['id']){delete _0x24982c[_0xefde('0x4d')]['id'];}return db['SugarcrmAccount'][_0xefde('0x4a')]({'where':{'id':_0x24982c[_0xefde('0x48')]['id']}})[_0xefde('0x2a')](handleEntityNotFound(_0x3e0ebf,null))['then'](saveUpdates(_0x24982c[_0xefde('0x4d')],null))[_0xefde('0x2a')](respondWithResult(_0x3e0ebf,null))[_0xefde('0x4b')](handleError(_0x3e0ebf,null));};exports[_0xefde('0x2b')]=function(_0x7598e7,_0x120bef){return db[_0xefde('0x45')][_0xefde('0x4a')]({'where':{'id':_0x7598e7[_0xefde('0x48')]['id']}})['then'](handleEntityNotFound(_0x120bef,null))[_0xefde('0x2a')](removeEntity(_0x120bef,null))['catch'](handleError(_0x120bef,null));};exports[_0xefde('0x4e')]=function(_0x155113,_0x3a1ea2,_0x4eaf5f){var _0x20a261={};var _0x15a72b={};var _0x2ae0dc;var _0x275417;return db['SugarcrmAccount'][_0xefde('0x4f')]({'where':{'id':_0x155113[_0xefde('0x48')]['id']}})[_0xefde('0x2a')](handleEntityNotFound(_0x3a1ea2,null))['then'](function(_0x133c02){if(_0x133c02){_0x2ae0dc=_0x133c02;_0x15a72b[_0xefde('0x34')]=_['keys'](db[_0xefde('0x50')][_0xefde('0x31')]);_0x15a72b[_0xefde('0x35')]=_['keys'](_0x155113['query']);_0x15a72b[_0xefde('0x37')]=_['intersection'](_0x15a72b['model'],_0x15a72b[_0xefde('0x35')]);_0x20a261[_0xefde('0x39')]=_[_0xefde('0x38')](_0x15a72b[_0xefde('0x34')],qs[_0xefde('0x3a')](_0x155113[_0xefde('0x35')][_0xefde('0x3a')]));_0x20a261[_0xefde('0x39')]=_0x20a261[_0xefde('0x39')][_0xefde('0x3b')]?_0x20a261[_0xefde('0x39')]:_0x15a72b['model'];_0x20a261[_0xefde('0x51')]=qs[_0xefde('0x3e')](_0x155113['query'][_0xefde('0x3e')]);_0x20a261[_0xefde('0x3f')]=qs[_0xefde('0x37')](_['pick'](_0x155113[_0xefde('0x35')],_0x15a72b[_0xefde('0x37')]));if(_0x155113[_0xefde('0x35')][_0xefde('0x41')]){_0x20a261[_0xefde('0x3f')]=_[_0xefde('0x42')](_0x20a261[_0xefde('0x3f')],{'$or':_[_0xefde('0x30')](_0x20a261[_0xefde('0x39')],function(_0x18ccaf){var _0x2eb0b9={};_0x2eb0b9[_0x18ccaf]={'$like':'%'+_0x155113[_0xefde('0x35')][_0xefde('0x41')]+'%'};return _0x2eb0b9;})});}_0x20a261=_['merge']({},_0x20a261,_0x155113[_0xefde('0x44')]);return _0x2ae0dc['getConfigurations'](_0x20a261);}})[_0xefde('0x2a')](function(_0x31b7f6){if(_0x31b7f6){_0x275417=_0x31b7f6['length'];if(!_0x155113[_0xefde('0x35')][_0xefde('0x3c')](_0xefde('0x3d'))){_0x20a261['limit']=qs[_0xefde('0x23')](_0x155113[_0xefde('0x35')]['limit']);_0x20a261['offset']=qs['offset'](_0x155113[_0xefde('0x35')]['offset']);}return _0x2ae0dc[_0xefde('0x4e')](_0x20a261);}})[_0xefde('0x2a')](function(_0x234563){if(_0x234563){return _0x234563?{'count':_0x275417,'rows':_0x234563}:null;}})[_0xefde('0x2a')](respondWithResult(_0x3a1ea2,null))[_0xefde('0x4b')](handleError(_0x3a1ea2,null));};exports[_0xefde('0x52')]=function(_0x48d0b6,_0x2b1f3d,_0x12819b){if(_0x48d0b6[_0xefde('0x4d')]['id']){delete _0x48d0b6[_0xefde('0x4d')]['id'];}return db[_0xefde('0x45')][_0xefde('0x4f')]({'where':{'id':_0x48d0b6[_0xefde('0x48')]['id']}})[_0xefde('0x2a')](handleEntityNotFound(_0x2b1f3d,null))[_0xefde('0x2a')](function(_0x483b66){if(_0x483b66){_0x48d0b6[_0xefde('0x4d')][_0xefde('0x53')]=_0x483b66['id'];_0x48d0b6[_0xefde('0x4d')][_0xefde('0x54')]=integrations[_0xefde('0x55')](_0x48d0b6[_0xefde('0x4d')][_0xefde('0x56')],_0x48d0b6[_0xefde('0x4d')][_0xefde('0x32')]);_0x48d0b6['body'][_0xefde('0x57')]=integrations['getDescriptions'](_0x48d0b6[_0xefde('0x4d')]['channel'],_0x48d0b6['body'][_0xefde('0x32')]);return db[_0xefde('0x50')][_0xefde('0x4c')](_0x48d0b6[_0xefde('0x4d')],{'include':[{'model':db[_0xefde('0x58')],'as':_0xefde('0x54')},{'model':db[_0xefde('0x58')],'as':_0xefde('0x57')}]});}return null;})[_0xefde('0x2a')](respondWithResult(_0x2b1f3d,null))[_0xefde('0x4b')](handleError(_0x2b1f3d,null));};exports[_0xefde('0x59')]=function(_0xfae902,_0x157126,_0x4e47b3){var _0xa7a79e='';var _0x5275f7=['id','name',_0xefde('0x5a'),'created_by',_0xefde('0x5b'),'date_start',_0xefde('0x5c'),_0xefde('0x5d'),'parent_id',_0xefde('0x5e'),_0xefde('0x5f'),_0xefde('0x60')];return db['SugarcrmAccount']['findOne']({'where':{'id':_0xfae902[_0xefde('0x48')]['id']},'attributes':['id',_0xefde('0x61'),_0xefde('0x62'),_0xefde('0x63')]})[_0xefde('0x2a')](handleEntityNotFound(_0x157126,null))[_0xefde('0x2a')](function(_0x20b1a4){if(_0x20b1a4){_0xa7a79e=_0x20b1a4[_0xefde('0x63')];var _0x492986=_0xa7a79e[_0xefde('0x64')](-0x1);if(_0x492986==='/'){_0xa7a79e=_0xa7a79e[_0xefde('0x65')](0x0,_0xa7a79e[_0xefde('0x66')](_0x492986));}return rp({'method':_0xefde('0x67'),'uri':util[_0xefde('0x68')]('%s%s',_0xa7a79e,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xefde('0x69'),'input_type':_0xefde('0x6a'),'response_type':_0xefde('0x6a'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x20b1a4[_0xefde('0x61')],'password':_0x20b1a4['password'],'encryption':_0xefde('0x6b')},'application':_0xefde('0x6c')})}});}})['then'](function(_0x2ebc31){if(_0x2ebc31&&_0x2ebc31[_0xefde('0x2d')]!==_0xefde('0x6d')&&_0x2ebc31[_0xefde('0x2d')]!==_0xefde('0x6e')){return rp({'method':'POST','uri':util[_0xefde('0x68')](_0xefde('0x6f'),_0xa7a79e,_0xefde('0x70')),'json':!![],'form':{'method':_0xefde('0x71'),'input_type':_0xefde('0x6a'),'response_type':_0xefde('0x6a'),'rest_data':JSON['stringify']({'session':_0x2ebc31['id'],'module_name':_0xefde('0x72')})}})[_0xefde('0x2a')](function(_0x11b4e4){if(_0x11b4e4){var _0x15ed5d=_['values'](_0x11b4e4[_0xefde('0x73')]);_['remove'](_0x15ed5d,function(_0x251281){return _0x5275f7[_0xefde('0x74')](_0x251281[_0xefde('0x2d')]);});return{'count':_0x15ed5d[_0xefde('0x3b')],'rows':_[_0xefde('0x30')](_0x15ed5d,function(_0x3c303f){return{'id':_0x3c303f[_0xefde('0x2d')],'name':_0x3c303f[_0xefde('0x75')],'custom':_[_0xefde('0x76')](_0x3c303f['name'],'_c')?!![]:![],'options':_0x3c303f['options']?_[_0xefde('0x30')](_[_0xefde('0x77')](_0x3c303f['options']),function(_0xbcf18f){return{'name':_0xbcf18f['value'],'value':_0xbcf18f[_0xefde('0x2d')]};}):[]};})};}})['then'](respondWithResult(_0x157126,null))[_0xefde('0x4b')](function(_0x1ac4d2){var _0x454979=_0xfae902['query']['test']?0x1f4:_0x1ac4d2[_0xefde('0x78')]||0x1f4;logger[_0xefde('0x2c')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x454979,JSON[_0xefde('0x79')](_0x1ac4d2));delete _0x1ac4d2[_0xefde('0x2d')];if(_0x454979===0x191){_0x454979=0x190;}_0x157126['status'](_0x454979)[_0xefde('0x2e')](_0xfae902[_0xefde('0x35')][_0xefde('0x7a')]?{'message':'Wrong\x20credentials','statusCode':_0x1ac4d2[_0xefde('0x78')]}:_0x1ac4d2);});}else{var _0x3f0506=0x1f4;_0x157126[_0xefde('0x1e')](_0x3f0506)[_0xefde('0x2e')]({'message':_0xefde('0x7b'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x1a72=['filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','create','body','find','destroy','getConfigurations','findOne','SugarcrmConfiguration','addConfiguration','AccountId','Subjects','getSubjects','getDescriptions','SugarcrmField','Descriptions','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_type','parent_name','username','password','remoteUri','slice','substring','POST','format','/service/v4_1/rest.php','login','JSON','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','get_module_fields','stringify','Calls','module_fields','remove','label','values','value','test','getFields,\x20%s,\x20%s,\x20%s','getFields','send','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','then','error','name','map','SugarcrmAccount','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters'];(function(_0x30e613,_0x327e3e){var _0xbbbdc1=function(_0x97955c){while(--_0x97955c){_0x30e613['push'](_0x30e613['shift']());}};_0xbbbdc1(++_0x327e3e);}(_0x1a72,0xad));var _0x21a7=function(_0x1ad045,_0x14b8f6){_0x1ad045=_0x1ad045-0x0;var _0x6a5ae4=_0x1a72[_0x1ad045];return _0x6a5ae4;};'use strict';var emlformat=require(_0x21a7('0x0'));var rimraf=require(_0x21a7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x21a7('0x2'));var rp=require(_0x21a7('0x3'));var moment=require('moment');var BPromise=require(_0x21a7('0x4'));var Mustache=require('mustache');var util=require(_0x21a7('0x5'));var path=require('path');var sox=require(_0x21a7('0x6'));var csv=require('to-csv');var ejs=require(_0x21a7('0x7'));var fs=require('fs');var fs_extra=require(_0x21a7('0x8'));var _=require(_0x21a7('0x9'));var squel=require(_0x21a7('0xa'));var crypto=require(_0x21a7('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x21a7('0xc'));var querystring=require(_0x21a7('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x21a7('0xe'));var qs=require(_0x21a7('0xf'));var as=require(_0x21a7('0x10'));var hardwareService=require(_0x21a7('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x21a7('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x21a7('0x13'));var db=require(_0x21a7('0x14'))['db'];var integrations=require(_0x21a7('0x15'));function respondWithStatusCode(_0x5daeb4,_0x3710e2){_0x3710e2=_0x3710e2||0xcc;return function(_0x1a18b3){if(_0x1a18b3){return _0x5daeb4[_0x21a7('0x16')](_0x3710e2);}return _0x5daeb4[_0x21a7('0x17')](_0x3710e2)[_0x21a7('0x18')]();};}function respondWithResult(_0x4625a2,_0x2c0eb8){_0x2c0eb8=_0x2c0eb8||0xc8;return function(_0x3e5ad0){if(_0x3e5ad0){return _0x4625a2[_0x21a7('0x17')](_0x2c0eb8)['json'](_0x3e5ad0);}};}function respondWithFilteredResult(_0x1e3598,_0x3bb205){return function(_0x5c5f26){if(_0x5c5f26){var _0x4de17b=typeof _0x3bb205[_0x21a7('0x19')]===_0x21a7('0x1a')&&typeof _0x3bb205[_0x21a7('0x1b')]==='undefined';var _0x30abdd=_0x5c5f26[_0x21a7('0x1c')];var _0x41cc4a=_0x4de17b?0x0:_0x3bb205[_0x21a7('0x19')];var _0x5cb975=_0x4de17b?_0x5c5f26[_0x21a7('0x1c')]:_0x3bb205[_0x21a7('0x19')]+_0x3bb205[_0x21a7('0x1b')];var _0x120b99;if(_0x5cb975>=_0x30abdd){_0x5cb975=_0x30abdd;_0x120b99=0xc8;}else{_0x120b99=0xce;}_0x1e3598[_0x21a7('0x17')](_0x120b99);return _0x1e3598[_0x21a7('0x1d')](_0x21a7('0x1e'),_0x41cc4a+'-'+_0x5cb975+'/'+_0x30abdd)[_0x21a7('0x1f')](_0x5c5f26);}return null;};}function patchUpdates(_0x409e0e){return function(_0x2220df){try{jsonpatch['apply'](_0x2220df,_0x409e0e,!![]);}catch(_0x1f68e0){return BPromise[_0x21a7('0x20')](_0x1f68e0);}return _0x2220df[_0x21a7('0x21')]();};}function saveUpdates(_0x5265c4,_0x3be456){return function(_0x3aabb6){if(_0x3aabb6){return _0x3aabb6['update'](_0x5265c4)['then'](function(_0x2f64b1){return _0x2f64b1;});}return null;};}function removeEntity(_0xe50d0b,_0x372c38){return function(_0x5cf566){if(_0x5cf566){return _0x5cf566['destroy']()[_0x21a7('0x22')](function(){_0xe50d0b[_0x21a7('0x17')](0xcc)[_0x21a7('0x18')]();});}};}function handleEntityNotFound(_0x32f78a,_0x26773e){return function(_0x11c3d3){if(!_0x11c3d3){_0x32f78a['sendStatus'](0x194);}return _0x11c3d3;};}function handleError(_0x1739ec,_0x5abf51){_0x5abf51=_0x5abf51||0x1f4;return function(_0x41c5b0){logger[_0x21a7('0x23')](_0x41c5b0['stack']);if(_0x41c5b0[_0x21a7('0x24')]){delete _0x41c5b0[_0x21a7('0x24')];}_0x1739ec[_0x21a7('0x17')](_0x5abf51)['send'](_0x41c5b0);};}exports['index']=function(_0xc7f89,_0x1e038f){var _0x489f2a={},_0x441559={},_0x4bb389={'count':0x0,'rows':[]};var _0x467895=_[_0x21a7('0x25')](db[_0x21a7('0x26')][_0x21a7('0x27')],function(_0x58904c){return{'name':_0x58904c['fieldName'],'type':_0x58904c[_0x21a7('0x28')][_0x21a7('0x29')]};});_0x441559['model']=_[_0x21a7('0x25')](_0x467895,_0x21a7('0x24'));_0x441559[_0x21a7('0x2a')]=_[_0x21a7('0x2b')](_0xc7f89[_0x21a7('0x2a')]);_0x441559['filters']=_[_0x21a7('0x2c')](_0x441559[_0x21a7('0x2d')],_0x441559[_0x21a7('0x2a')]);_0x489f2a[_0x21a7('0x2e')]=_['intersection'](_0x441559[_0x21a7('0x2d')],qs[_0x21a7('0x2f')](_0xc7f89[_0x21a7('0x2a')][_0x21a7('0x2f')]));_0x489f2a['attributes']=_0x489f2a[_0x21a7('0x2e')][_0x21a7('0x30')]?_0x489f2a[_0x21a7('0x2e')]:_0x441559[_0x21a7('0x2d')];if(!_0xc7f89[_0x21a7('0x2a')][_0x21a7('0x31')](_0x21a7('0x32'))){_0x489f2a['limit']=qs['limit'](_0xc7f89['query'][_0x21a7('0x1b')]);_0x489f2a[_0x21a7('0x19')]=qs[_0x21a7('0x19')](_0xc7f89[_0x21a7('0x2a')][_0x21a7('0x19')]);}_0x489f2a['order']=qs[_0x21a7('0x33')](_0xc7f89['query'][_0x21a7('0x33')]);_0x489f2a[_0x21a7('0x34')]=qs['filters'](_[_0x21a7('0x35')](_0xc7f89[_0x21a7('0x2a')],_0x441559[_0x21a7('0x36')]),_0x467895);if(_0xc7f89['query'][_0x21a7('0x37')]){_0x489f2a[_0x21a7('0x34')]=_['merge'](_0x489f2a['where'],{'$or':_[_0x21a7('0x25')](_0x467895,function(_0x46d14a){if(_0x46d14a['type']!==_0x21a7('0x38')){var _0x3e9930={};_0x3e9930[_0x46d14a[_0x21a7('0x24')]]={'$like':'%'+_0xc7f89[_0x21a7('0x2a')][_0x21a7('0x37')]+'%'};return _0x3e9930;}})});}_0x489f2a=_[_0x21a7('0x39')]({},_0x489f2a,_0xc7f89[_0x21a7('0x3a')]);var _0x3ee1c7={'where':_0x489f2a['where']};return db[_0x21a7('0x26')][_0x21a7('0x1c')](_0x3ee1c7)[_0x21a7('0x22')](function(_0x5c21dc){_0x4bb389['count']=_0x5c21dc;if(_0xc7f89[_0x21a7('0x2a')][_0x21a7('0x3b')]){_0x489f2a[_0x21a7('0x3c')]=[{'all':!![]}];}return db['SugarcrmAccount']['findAll'](_0x489f2a);})[_0x21a7('0x22')](function(_0x501bf4){_0x4bb389[_0x21a7('0x3d')]=_0x501bf4;return _0x4bb389;})[_0x21a7('0x22')](respondWithFilteredResult(_0x1e038f,_0x489f2a))[_0x21a7('0x3e')](handleError(_0x1e038f,null));};exports[_0x21a7('0x3f')]=function(_0x3c2f43,_0x2e14ff){var _0x420db6={'raw':![],'where':{'id':_0x3c2f43[_0x21a7('0x40')]['id']}},_0x3c718c={};_0x3c718c[_0x21a7('0x2d')]=_[_0x21a7('0x2b')](db[_0x21a7('0x26')][_0x21a7('0x27')]);_0x3c718c[_0x21a7('0x2a')]=_[_0x21a7('0x2b')](_0x3c2f43[_0x21a7('0x2a')]);_0x3c718c[_0x21a7('0x36')]=_[_0x21a7('0x2c')](_0x3c718c[_0x21a7('0x2d')],_0x3c718c[_0x21a7('0x2a')]);_0x420db6['attributes']=_[_0x21a7('0x2c')](_0x3c718c['model'],qs[_0x21a7('0x2f')](_0x3c2f43[_0x21a7('0x2a')]['fields']));_0x420db6['attributes']=_0x420db6[_0x21a7('0x2e')][_0x21a7('0x30')]?_0x420db6[_0x21a7('0x2e')]:_0x3c718c[_0x21a7('0x2d')];if(_0x3c2f43['query'][_0x21a7('0x3b')]){_0x420db6['include']=[{'all':!![]}];}_0x420db6=_[_0x21a7('0x39')]({},_0x420db6,_0x3c2f43[_0x21a7('0x3a')]);return db[_0x21a7('0x26')]['find'](_0x420db6)['then'](handleEntityNotFound(_0x2e14ff,null))[_0x21a7('0x22')](respondWithResult(_0x2e14ff,null))[_0x21a7('0x3e')](handleError(_0x2e14ff,null));};exports['create']=function(_0x34f203,_0x540539){return db[_0x21a7('0x26')][_0x21a7('0x41')](_0x34f203[_0x21a7('0x42')],{})[_0x21a7('0x22')](respondWithResult(_0x540539,0xc9))[_0x21a7('0x3e')](handleError(_0x540539,null));};exports['update']=function(_0x19f1f2,_0xc9fa65){if(_0x19f1f2[_0x21a7('0x42')]['id']){delete _0x19f1f2[_0x21a7('0x42')]['id'];}return db[_0x21a7('0x26')][_0x21a7('0x43')]({'where':{'id':_0x19f1f2[_0x21a7('0x40')]['id']}})[_0x21a7('0x22')](handleEntityNotFound(_0xc9fa65,null))[_0x21a7('0x22')](saveUpdates(_0x19f1f2['body'],null))['then'](respondWithResult(_0xc9fa65,null))[_0x21a7('0x3e')](handleError(_0xc9fa65,null));};exports[_0x21a7('0x44')]=function(_0x2e71e0,_0x769af2){return db[_0x21a7('0x26')][_0x21a7('0x43')]({'where':{'id':_0x2e71e0['params']['id']}})[_0x21a7('0x22')](handleEntityNotFound(_0x769af2,null))[_0x21a7('0x22')](removeEntity(_0x769af2,null))['catch'](handleError(_0x769af2,null));};exports[_0x21a7('0x45')]=function(_0x39aa17,_0x26c8bd,_0x59d60b){var _0x58b016={};var _0x5766f0={};var _0x2ff6d9;var _0x3767d1;return db[_0x21a7('0x26')][_0x21a7('0x46')]({'where':{'id':_0x39aa17[_0x21a7('0x40')]['id']}})[_0x21a7('0x22')](handleEntityNotFound(_0x26c8bd,null))[_0x21a7('0x22')](function(_0x510c36){if(_0x510c36){_0x2ff6d9=_0x510c36;_0x5766f0['model']=_['keys'](db[_0x21a7('0x47')][_0x21a7('0x27')]);_0x5766f0[_0x21a7('0x2a')]=_[_0x21a7('0x2b')](_0x39aa17[_0x21a7('0x2a')]);_0x5766f0[_0x21a7('0x36')]=_[_0x21a7('0x2c')](_0x5766f0[_0x21a7('0x2d')],_0x5766f0[_0x21a7('0x2a')]);_0x58b016[_0x21a7('0x2e')]=_[_0x21a7('0x2c')](_0x5766f0[_0x21a7('0x2d')],qs[_0x21a7('0x2f')](_0x39aa17[_0x21a7('0x2a')][_0x21a7('0x2f')]));_0x58b016['attributes']=_0x58b016[_0x21a7('0x2e')]['length']?_0x58b016[_0x21a7('0x2e')]:_0x5766f0['model'];_0x58b016['order']=qs['sort'](_0x39aa17[_0x21a7('0x2a')]['sort']);_0x58b016[_0x21a7('0x34')]=qs[_0x21a7('0x36')](_[_0x21a7('0x35')](_0x39aa17[_0x21a7('0x2a')],_0x5766f0[_0x21a7('0x36')]));if(_0x39aa17[_0x21a7('0x2a')]['filter']){_0x58b016[_0x21a7('0x34')]=_['merge'](_0x58b016['where'],{'$or':_[_0x21a7('0x25')](_0x58b016[_0x21a7('0x2e')],function(_0x157eb7){var _0x5d7a9b={};_0x5d7a9b[_0x157eb7]={'$like':'%'+_0x39aa17[_0x21a7('0x2a')][_0x21a7('0x37')]+'%'};return _0x5d7a9b;})});}_0x58b016=_[_0x21a7('0x39')]({},_0x58b016,_0x39aa17[_0x21a7('0x3a')]);return _0x2ff6d9[_0x21a7('0x45')](_0x58b016);}})[_0x21a7('0x22')](function(_0x57d7de){if(_0x57d7de){_0x3767d1=_0x57d7de[_0x21a7('0x30')];if(!_0x39aa17[_0x21a7('0x2a')]['hasOwnProperty'](_0x21a7('0x32'))){_0x58b016['limit']=qs[_0x21a7('0x1b')](_0x39aa17['query'][_0x21a7('0x1b')]);_0x58b016['offset']=qs[_0x21a7('0x19')](_0x39aa17[_0x21a7('0x2a')][_0x21a7('0x19')]);}return _0x2ff6d9[_0x21a7('0x45')](_0x58b016);}})[_0x21a7('0x22')](function(_0x23e8f7){if(_0x23e8f7){return _0x23e8f7?{'count':_0x3767d1,'rows':_0x23e8f7}:null;}})[_0x21a7('0x22')](respondWithResult(_0x26c8bd,null))[_0x21a7('0x3e')](handleError(_0x26c8bd,null));};exports[_0x21a7('0x48')]=function(_0x49b44e,_0x57759d,_0x2163fd){if(_0x49b44e[_0x21a7('0x42')]['id']){delete _0x49b44e[_0x21a7('0x42')]['id'];}return db[_0x21a7('0x26')][_0x21a7('0x46')]({'where':{'id':_0x49b44e['params']['id']}})[_0x21a7('0x22')](handleEntityNotFound(_0x57759d,null))['then'](function(_0x489602){if(_0x489602){_0x49b44e[_0x21a7('0x42')][_0x21a7('0x49')]=_0x489602['id'];_0x49b44e[_0x21a7('0x42')][_0x21a7('0x4a')]=integrations[_0x21a7('0x4b')](_0x49b44e[_0x21a7('0x42')]['channel'],_0x49b44e['body'][_0x21a7('0x28')]);_0x49b44e[_0x21a7('0x42')]['Descriptions']=integrations[_0x21a7('0x4c')](_0x49b44e[_0x21a7('0x42')]['channel'],_0x49b44e[_0x21a7('0x42')]['type']);return db[_0x21a7('0x47')][_0x21a7('0x41')](_0x49b44e[_0x21a7('0x42')],{'include':[{'model':db[_0x21a7('0x4d')],'as':_0x21a7('0x4a')},{'model':db[_0x21a7('0x4d')],'as':_0x21a7('0x4e')}]});}return null;})['then'](respondWithResult(_0x57759d,null))[_0x21a7('0x3e')](handleError(_0x57759d,null));};exports['getFields']=function(_0x1ff45d,_0x28972d,_0x44643e){var _0xbf121c='';var _0x582d7c=['id',_0x21a7('0x24'),_0x21a7('0x4f'),_0x21a7('0x50'),_0x21a7('0x51'),_0x21a7('0x52'),_0x21a7('0x53'),_0x21a7('0x54'),'parent_id',_0x21a7('0x55'),_0x21a7('0x56'),'direction'];return db['SugarcrmAccount'][_0x21a7('0x46')]({'where':{'id':_0x1ff45d[_0x21a7('0x40')]['id']},'attributes':['id',_0x21a7('0x57'),_0x21a7('0x58'),_0x21a7('0x59')]})[_0x21a7('0x22')](handleEntityNotFound(_0x28972d,null))[_0x21a7('0x22')](function(_0x48ad2d){if(_0x48ad2d){_0xbf121c=_0x48ad2d[_0x21a7('0x59')];var _0x644d1d=_0xbf121c[_0x21a7('0x5a')](-0x1);if(_0x644d1d==='/'){_0xbf121c=_0xbf121c[_0x21a7('0x5b')](0x0,_0xbf121c['lastIndexOf'](_0x644d1d));}return rp({'method':_0x21a7('0x5c'),'uri':util[_0x21a7('0x5d')]('%s%s',_0xbf121c,_0x21a7('0x5e')),'json':!![],'form':{'method':_0x21a7('0x5f'),'input_type':_0x21a7('0x60'),'response_type':'JSON','rest_data':JSON['stringify']({'user_auth':{'user_name':_0x48ad2d['username'],'password':_0x48ad2d[_0x21a7('0x58')],'encryption':_0x21a7('0x61')},'application':_0x21a7('0x62')})}});}})[_0x21a7('0x22')](function(_0x928d1){if(_0x928d1&&_0x928d1['name']!==_0x21a7('0x63')&&_0x928d1[_0x21a7('0x24')]!==_0x21a7('0x64')){return rp({'method':'POST','uri':util[_0x21a7('0x5d')]('%s%s',_0xbf121c,_0x21a7('0x5e')),'json':!![],'form':{'method':_0x21a7('0x65'),'input_type':_0x21a7('0x60'),'response_type':_0x21a7('0x60'),'rest_data':JSON[_0x21a7('0x66')]({'session':_0x928d1['id'],'module_name':_0x21a7('0x67')})}})[_0x21a7('0x22')](function(_0x3ff164){if(_0x3ff164){var _0x5f2581=_['values'](_0x3ff164[_0x21a7('0x68')]);_[_0x21a7('0x69')](_0x5f2581,function(_0x1c6832){return _0x582d7c['includes'](_0x1c6832[_0x21a7('0x24')]);});return{'count':_0x5f2581['length'],'rows':_['map'](_0x5f2581,function(_0x4c6e27){return{'id':_0x4c6e27[_0x21a7('0x24')],'name':_0x4c6e27[_0x21a7('0x6a')],'custom':_['endsWith'](_0x4c6e27[_0x21a7('0x24')],'_c')?!![]:![],'options':_0x4c6e27['options']?_['map'](_[_0x21a7('0x6b')](_0x4c6e27[_0x21a7('0x3a')]),function(_0x2f6026){return{'name':_0x2f6026[_0x21a7('0x6c')],'value':_0x2f6026[_0x21a7('0x24')]};}):[]};})};}})[_0x21a7('0x22')](respondWithResult(_0x28972d,null))['catch'](function(_0x3cf323){var _0x2f257b=_0x1ff45d[_0x21a7('0x2a')][_0x21a7('0x6d')]?0x1f4:_0x3cf323['statusCode']||0x1f4;logger[_0x21a7('0x23')](_0x21a7('0x6e'),_0x21a7('0x6f'),_0x2f257b,JSON[_0x21a7('0x66')](_0x3cf323));delete _0x3cf323['name'];if(_0x2f257b===0x191){_0x2f257b=0x190;}_0x28972d[_0x21a7('0x17')](_0x2f257b)[_0x21a7('0x70')](_0x1ff45d[_0x21a7('0x2a')][_0x21a7('0x6d')]?{'message':'Wrong\x20credentials','statusCode':_0x3cf323['statusCode']}:_0x3cf323);});}else{var _0xfd2778=0x1f4;_0x28972d[_0x21a7('0x17')](_0xfd2778)[_0x21a7('0x70')]({'message':_0x21a7('0x71'),'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 1752208..a71e3e1 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 _0xfcb2=['./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','int_sugarcrm_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x9de67e,_0x17f767){var _0x317287=function(_0x130835){while(--_0x130835){_0x9de67e['push'](_0x9de67e['shift']());}};_0x317287(++_0x17f767);}(_0xfcb2,0x1be));var _0x2fcb=function(_0x540ad9,_0x1bab22){_0x540ad9=_0x540ad9-0x0;var _0x52b87b=_0xfcb2[_0x540ad9];return _0x52b87b;};'use strict';var _=require(_0x2fcb('0x0'));var util=require(_0x2fcb('0x1'));var logger=require(_0x2fcb('0x2'))(_0x2fcb('0x3'));var moment=require('moment');var BPromise=require(_0x2fcb('0x4'));var rp=require(_0x2fcb('0x5'));var fs=require('fs');var path=require(_0x2fcb('0x6'));var rimraf=require(_0x2fcb('0x7'));var config=require(_0x2fcb('0x8'));var attributes=require(_0x2fcb('0x9'));var integrations=require(_0x2fcb('0xa'));module[_0x2fcb('0xb')]=function(_0x42649a,_0x49fd91){return _0x42649a['define']('SugarcrmAccount',attributes,{'tableName':_0x2fcb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdacc=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','util'];(function(_0x46fdbb,_0x217295){var _0x219d7e=function(_0x1350b8){while(--_0x1350b8){_0x46fdbb['push'](_0x46fdbb['shift']());}};_0x219d7e(++_0x217295);}(_0xdacc,0x14f));var _0xcdac=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xdacc[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require(_0xcdac('0x0'));var logger=require(_0xcdac('0x1'))(_0xcdac('0x2'));var moment=require(_0xcdac('0x3'));var BPromise=require(_0xcdac('0x4'));var rp=require(_0xcdac('0x5'));var fs=require('fs');var path=require(_0xcdac('0x6'));var rimraf=require('rimraf');var config=require(_0xcdac('0x7'));var attributes=require(_0xcdac('0x8'));var integrations=require(_0xcdac('0x9'));module[_0xcdac('0xa')]=function(_0x323492,_0x2a10a1){return _0x323492[_0xcdac('0xb')](_0xcdac('0xc'),attributes,{'tableName':_0xcdac('0xd'),'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 4aeb929..884ecd0 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 _0x0f6a=['info','SugarcrmAccount,\x20%s,\x20%s','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','GetSugarcrmAccount','SugarcrmAccount','findAll','options','where','limit','include','map','model','attributes','stringify','catch','find','raw','ShowSugarcrmAccount','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x547add,_0x387042){var _0x2ed1f3=function(_0x3bbb4d){while(--_0x3bbb4d){_0x547add['push'](_0x547add['shift']());}};_0x2ed1f3(++_0x387042);}(_0x0f6a,0xcc));var _0xa0f6=function(_0x45a378,_0x56cf3b){_0x45a378=_0x45a378-0x0;var _0x554df2=_0x0f6a[_0x45a378];return _0x554df2;};'use strict';var _=require(_0xa0f6('0x0'));var util=require(_0xa0f6('0x1'));var moment=require('moment');var BPromise=require(_0xa0f6('0x2'));var rs=require(_0xa0f6('0x3'));var fs=require('fs');var Redis=require(_0xa0f6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa0f6('0x5'));var logger=require('../../config/logger')(_0xa0f6('0x6'));var config=require(_0xa0f6('0x7'));var jayson=require(_0xa0f6('0x8'));var client=jayson[_0xa0f6('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x475e8e,_0x364f3e,_0x592a75){return new BPromise(function(_0x13c66a,_0x173814){return client[_0xa0f6('0xa')](_0x475e8e,_0x592a75)[_0xa0f6('0xb')](function(_0x18bbe0){logger[_0xa0f6('0xc')](_0xa0f6('0xd'),_0x364f3e,'request\x20sent');logger[_0xa0f6('0xe')](_0xa0f6('0xf'),_0x364f3e,_0xa0f6('0x10'),JSON['stringify'](_0x18bbe0));if(_0x18bbe0[_0xa0f6('0x11')]){if(_0x18bbe0[_0xa0f6('0x11')][_0xa0f6('0x12')]===0x1f4){logger[_0xa0f6('0x11')]('SugarcrmAccount,\x20%s,\x20%s',_0x364f3e,_0x18bbe0[_0xa0f6('0x11')][_0xa0f6('0x13')]);return _0x173814(_0x18bbe0[_0xa0f6('0x11')][_0xa0f6('0x13')]);}logger['error'](_0xa0f6('0xd'),_0x364f3e,_0x18bbe0[_0xa0f6('0x11')][_0xa0f6('0x13')]);return _0x13c66a(_0x18bbe0[_0xa0f6('0x11')][_0xa0f6('0x13')]);}else{logger[_0xa0f6('0xc')](_0xa0f6('0xd'),_0x364f3e,'request\x20sent');_0x13c66a(_0x18bbe0[_0xa0f6('0x14')][_0xa0f6('0x13')]);}})['catch'](function(_0x240230){logger['error'](_0xa0f6('0xd'),_0x364f3e,_0x240230);_0x173814(_0x240230);});});}exports[_0xa0f6('0x15')]=function(_0x5ba7a9){var _0x2d19a7=this;return new Promise(function(_0x44c3f6,_0x45d2cf){return db[_0xa0f6('0x16')][_0xa0f6('0x17')]({'raw':_0x5ba7a9[_0xa0f6('0x18')]?_0x5ba7a9['options']['raw']===undefined?!![]:![]:!![],'where':_0x5ba7a9[_0xa0f6('0x18')]?_0x5ba7a9[_0xa0f6('0x18')][_0xa0f6('0x19')]||null:null,'attributes':_0x5ba7a9[_0xa0f6('0x18')]?_0x5ba7a9[_0xa0f6('0x18')]['attributes']||null:null,'limit':_0x5ba7a9['options']?_0x5ba7a9[_0xa0f6('0x18')][_0xa0f6('0x1a')]||null:null,'include':_0x5ba7a9[_0xa0f6('0x18')]?_0x5ba7a9[_0xa0f6('0x18')][_0xa0f6('0x1b')]?_[_0xa0f6('0x1c')](_0x5ba7a9[_0xa0f6('0x18')][_0xa0f6('0x1b')],function(_0x47db06){return{'model':db[_0x47db06[_0xa0f6('0x1d')]],'as':_0x47db06['as'],'attributes':_0x47db06[_0xa0f6('0x1e')],'include':_0x47db06['include']?_[_0xa0f6('0x1c')](_0x47db06[_0xa0f6('0x1b')],function(_0x144435){return{'model':db[_0x144435[_0xa0f6('0x1d')]],'as':_0x144435['as'],'attributes':_0x144435[_0xa0f6('0x1e')],'include':_0x144435['include']?_[_0xa0f6('0x1c')](_0x144435[_0xa0f6('0x1b')],function(_0x24c0f2){return{'model':db[_0x24c0f2[_0xa0f6('0x1d')]],'as':_0x24c0f2['as'],'attributes':_0x24c0f2[_0xa0f6('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2713f1){logger[_0xa0f6('0xc')](_0xa0f6('0x15'),_0x5ba7a9);logger['debug'](_0xa0f6('0x15'),_0x5ba7a9,JSON[_0xa0f6('0x1f')](_0x2713f1));_0x44c3f6(_0x2713f1);})[_0xa0f6('0x20')](function(_0x56e410){logger[_0xa0f6('0x11')](_0xa0f6('0x15'),_0x56e410[_0xa0f6('0x13')],_0x5ba7a9);_0x45d2cf(_0x2d19a7['error'](0x1f4,_0x56e410[_0xa0f6('0x13')]));});});};exports['ShowSugarcrmAccount']=function(_0xa85c62){var _0x2955b0=this;return new Promise(function(_0x5ee011,_0x4234f7){return db[_0xa0f6('0x16')][_0xa0f6('0x21')]({'raw':_0xa85c62[_0xa0f6('0x18')]?_0xa85c62['options'][_0xa0f6('0x22')]===undefined?!![]:![]:!![],'where':_0xa85c62['options']?_0xa85c62['options']['where']||null:null,'attributes':_0xa85c62[_0xa0f6('0x18')]?_0xa85c62['options'][_0xa0f6('0x1e')]||null:null,'include':_0xa85c62[_0xa0f6('0x18')]?_0xa85c62[_0xa0f6('0x18')][_0xa0f6('0x1b')]?_[_0xa0f6('0x1c')](_0xa85c62[_0xa0f6('0x18')][_0xa0f6('0x1b')],function(_0x26014e){return{'model':db[_0x26014e[_0xa0f6('0x1d')]],'as':_0x26014e['as'],'attributes':_0x26014e[_0xa0f6('0x1e')],'include':_0x26014e[_0xa0f6('0x1b')]?_[_0xa0f6('0x1c')](_0x26014e[_0xa0f6('0x1b')],function(_0x585167){return{'model':db[_0x585167[_0xa0f6('0x1d')]],'as':_0x585167['as'],'attributes':_0x585167[_0xa0f6('0x1e')],'include':_0x585167['include']?_[_0xa0f6('0x1c')](_0x585167[_0xa0f6('0x1b')],function(_0x19db44){return{'model':db[_0x19db44[_0xa0f6('0x1d')]],'as':_0x19db44['as'],'attributes':_0x19db44[_0xa0f6('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xa0f6('0xb')](function(_0x5bf0d8){logger[_0xa0f6('0xc')](_0xa0f6('0x23'),_0xa85c62);logger[_0xa0f6('0xe')](_0xa0f6('0x23'),_0xa85c62,JSON[_0xa0f6('0x1f')](_0x5bf0d8));_0x5ee011(_0x5bf0d8);})[_0xa0f6('0x20')](function(_0x518190){logger[_0xa0f6('0x11')](_0xa0f6('0x23'),_0x518190[_0xa0f6('0x13')],_0xa85c62);_0x4234f7(_0x2955b0['error'](0x1f4,_0x518190['message']));});});}; \ No newline at end of file +var _0xbe05=['jayson/promise','http','request','then','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetSugarcrmAccount','SugarcrmAccount','findAll','options','where','attributes','limit','include','map','model','info','find','raw','ShowSugarcrmAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xbe05,0x155));var _0x5be0=function(_0x4ea1b7,_0x320ece){_0x4ea1b7=_0x4ea1b7-0x0;var _0x4de0da=_0xbe05[_0x4ea1b7];return _0x4de0da;};'use strict';var _=require(_0x5be0('0x0'));var util=require(_0x5be0('0x1'));var moment=require(_0x5be0('0x2'));var BPromise=require(_0x5be0('0x3'));var rs=require(_0x5be0('0x4'));var fs=require('fs');var Redis=require(_0x5be0('0x5'));var db=require(_0x5be0('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5be0('0x7'));var config=require(_0x5be0('0x8'));var jayson=require(_0x5be0('0x9'));var client=jayson['client'][_0x5be0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x32fc9e,_0x31facb,_0xf31e77){return new BPromise(function(_0x54973e,_0x1d9219){return client[_0x5be0('0xb')](_0x32fc9e,_0xf31e77)[_0x5be0('0xc')](function(_0x3db715){logger['info'](_0x5be0('0xd'),_0x31facb,_0x5be0('0xe'));logger[_0x5be0('0xf')](_0x5be0('0x10'),_0x31facb,_0x5be0('0xe'),JSON[_0x5be0('0x11')](_0x3db715));if(_0x3db715['error']){if(_0x3db715[_0x5be0('0x12')]['code']===0x1f4){logger['error'](_0x5be0('0xd'),_0x31facb,_0x3db715[_0x5be0('0x12')]['message']);return _0x1d9219(_0x3db715[_0x5be0('0x12')][_0x5be0('0x13')]);}logger['error'](_0x5be0('0xd'),_0x31facb,_0x3db715[_0x5be0('0x12')][_0x5be0('0x13')]);return _0x54973e(_0x3db715[_0x5be0('0x12')][_0x5be0('0x13')]);}else{logger['info'](_0x5be0('0xd'),_0x31facb,_0x5be0('0xe'));_0x54973e(_0x3db715[_0x5be0('0x14')][_0x5be0('0x13')]);}})['catch'](function(_0x2973e4){logger[_0x5be0('0x12')](_0x5be0('0xd'),_0x31facb,_0x2973e4);_0x1d9219(_0x2973e4);});});}exports[_0x5be0('0x15')]=function(_0x255fdc){var _0xdc5de9=this;return new Promise(function(_0x354d26,_0x5114c5){return db[_0x5be0('0x16')][_0x5be0('0x17')]({'raw':_0x255fdc[_0x5be0('0x18')]?_0x255fdc[_0x5be0('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x255fdc[_0x5be0('0x18')]?_0x255fdc['options'][_0x5be0('0x19')]||null:null,'attributes':_0x255fdc[_0x5be0('0x18')]?_0x255fdc['options'][_0x5be0('0x1a')]||null:null,'limit':_0x255fdc['options']?_0x255fdc[_0x5be0('0x18')][_0x5be0('0x1b')]||null:null,'include':_0x255fdc[_0x5be0('0x18')]?_0x255fdc[_0x5be0('0x18')][_0x5be0('0x1c')]?_[_0x5be0('0x1d')](_0x255fdc['options'][_0x5be0('0x1c')],function(_0x2d9ed7){return{'model':db[_0x2d9ed7['model']],'as':_0x2d9ed7['as'],'attributes':_0x2d9ed7[_0x5be0('0x1a')],'include':_0x2d9ed7[_0x5be0('0x1c')]?_[_0x5be0('0x1d')](_0x2d9ed7[_0x5be0('0x1c')],function(_0x15e482){return{'model':db[_0x15e482['model']],'as':_0x15e482['as'],'attributes':_0x15e482[_0x5be0('0x1a')],'include':_0x15e482[_0x5be0('0x1c')]?_[_0x5be0('0x1d')](_0x15e482['include'],function(_0x2c2b52){return{'model':db[_0x2c2b52[_0x5be0('0x1e')]],'as':_0x2c2b52['as'],'attributes':_0x2c2b52[_0x5be0('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x5be0('0xc')](function(_0x1a5ca2){logger[_0x5be0('0x1f')](_0x5be0('0x15'),_0x255fdc);logger[_0x5be0('0xf')](_0x5be0('0x15'),_0x255fdc,JSON['stringify'](_0x1a5ca2));_0x354d26(_0x1a5ca2);})['catch'](function(_0x4ba171){logger['error'](_0x5be0('0x15'),_0x4ba171['message'],_0x255fdc);_0x5114c5(_0xdc5de9[_0x5be0('0x12')](0x1f4,_0x4ba171['message']));});});};exports['ShowSugarcrmAccount']=function(_0x2fafdc){var _0x5ed0af=this;return new Promise(function(_0x30b43d,_0x21908b){return db[_0x5be0('0x16')][_0x5be0('0x20')]({'raw':_0x2fafdc[_0x5be0('0x18')]?_0x2fafdc['options'][_0x5be0('0x21')]===undefined?!![]:![]:!![],'where':_0x2fafdc['options']?_0x2fafdc[_0x5be0('0x18')][_0x5be0('0x19')]||null:null,'attributes':_0x2fafdc['options']?_0x2fafdc[_0x5be0('0x18')][_0x5be0('0x1a')]||null:null,'include':_0x2fafdc[_0x5be0('0x18')]?_0x2fafdc[_0x5be0('0x18')]['include']?_['map'](_0x2fafdc[_0x5be0('0x18')]['include'],function(_0x4fb3c4){return{'model':db[_0x4fb3c4[_0x5be0('0x1e')]],'as':_0x4fb3c4['as'],'attributes':_0x4fb3c4['attributes'],'include':_0x4fb3c4[_0x5be0('0x1c')]?_[_0x5be0('0x1d')](_0x4fb3c4[_0x5be0('0x1c')],function(_0xd3245b){return{'model':db[_0xd3245b[_0x5be0('0x1e')]],'as':_0xd3245b['as'],'attributes':_0xd3245b[_0x5be0('0x1a')],'include':_0xd3245b['include']?_[_0x5be0('0x1d')](_0xd3245b[_0x5be0('0x1c')],function(_0x4fda5d){return{'model':db[_0x4fda5d[_0x5be0('0x1e')]],'as':_0x4fda5d['as'],'attributes':_0x4fda5d[_0x5be0('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5d98fc){logger['info'](_0x5be0('0x22'),_0x2fafdc);logger[_0x5be0('0xf')]('ShowSugarcrmAccount',_0x2fafdc,JSON['stringify'](_0x5d98fc));_0x30b43d(_0x5d98fc);})['catch'](function(_0x52d750){logger[_0x5be0('0x12')]('ShowSugarcrmAccount',_0x52d750[_0x5be0('0x13')],_0x2fafdc);_0x21908b(_0x5ed0af[_0x5be0('0x12')](0x1f4,_0x52d750[_0x5be0('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 462f3d8..8c0fb4c 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 _0x7f24=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id/fields','getSubjects','/:id/descriptions','getDescriptions','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0xfb1c94,_0x39fda5){var _0xa7a7d7=function(_0x5142c3){while(--_0x5142c3){_0xfb1c94['push'](_0xfb1c94['shift']());}};_0xa7a7d7(++_0x39fda5);}(_0x7f24,0x156));var _0x47f2=function(_0x422890,_0x434494){_0x422890=_0x422890-0x0;var _0x202cf0=_0x7f24[_0x422890];return _0x202cf0;};'use strict';var multer=require('multer');var util=require(_0x47f2('0x0'));var path=require(_0x47f2('0x1'));var timeout=require(_0x47f2('0x2'));var express=require(_0x47f2('0x3'));var router=express[_0x47f2('0x4')]();var fs_extra=require(_0x47f2('0x5'));var auth=require(_0x47f2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x47f2('0x7'));var controller=require(_0x47f2('0x8'));router[_0x47f2('0x9')]('/',auth[_0x47f2('0xa')](),controller[_0x47f2('0xb')]);router[_0x47f2('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x47f2('0x9')](_0x47f2('0xc'),auth['isAuthenticated'](),controller['getFields']);router['get']('/:id/subjects',auth['isAuthenticated'](),controller[_0x47f2('0xd')]);router[_0x47f2('0x9')](_0x47f2('0xe'),auth[_0x47f2('0xa')](),controller[_0x47f2('0xf')]);router['post']('/',auth[_0x47f2('0xa')](),controller[_0x47f2('0x10')]);router[_0x47f2('0x11')](_0x47f2('0x12'),auth[_0x47f2('0xa')](),controller[_0x47f2('0x13')]);router[_0x47f2('0x14')]('/:id',auth[_0x47f2('0xa')](),controller[_0x47f2('0x15')]);module[_0x47f2('0x16')]=router; \ No newline at end of file +var _0xd248=['delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','isAuthenticated','get','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','update'];(function(_0x3d453a,_0x1d7a1d){var _0x2d6742=function(_0x3ec995){while(--_0x3ec995){_0x3d453a['push'](_0x3d453a['shift']());}};_0x2d6742(++_0x1d7a1d);}(_0xd248,0x153));var _0x8d24=function(_0x4d4a06,_0x30289a){_0x4d4a06=_0x4d4a06-0x0;var _0x1dbcd8=_0xd248[_0x4d4a06];return _0x1dbcd8;};'use strict';var multer=require('multer');var util=require(_0x8d24('0x0'));var path=require(_0x8d24('0x1'));var timeout=require(_0x8d24('0x2'));var express=require(_0x8d24('0x3'));var router=express[_0x8d24('0x4')]();var fs_extra=require(_0x8d24('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8d24('0x6'));var config=require(_0x8d24('0x7'));var controller=require(_0x8d24('0x8'));router['get']('/',auth[_0x8d24('0x9')](),controller['index']);router[_0x8d24('0xa')](_0x8d24('0xb'),auth[_0x8d24('0x9')](),controller[_0x8d24('0xc')]);router['get'](_0x8d24('0xd'),auth[_0x8d24('0x9')](),controller[_0x8d24('0xe')]);router['get']('/:id/subjects',auth[_0x8d24('0x9')](),controller[_0x8d24('0xf')]);router[_0x8d24('0xa')](_0x8d24('0x10'),auth[_0x8d24('0x9')](),controller[_0x8d24('0x11')]);router[_0x8d24('0x12')]('/',auth['isAuthenticated'](),controller[_0x8d24('0x13')]);router['put'](_0x8d24('0xb'),auth['isAuthenticated'](),controller[_0x8d24('0x14')]);router[_0x8d24('0x15')](_0x8d24('0xb'),auth['isAuthenticated'](),controller[_0x8d24('0x16')]);module[_0x8d24('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index d46944e..878782e 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 _0x57d2=['sequelize','exports','STRING'];(function(_0x2edfd5,_0x52d329){var _0x43c997=function(_0x46da39){while(--_0x46da39){_0x2edfd5['push'](_0x2edfd5['shift']());}};_0x43c997(++_0x52d329);}(_0x57d2,0x186));var _0x257d=function(_0x292bba,_0x457446){_0x292bba=_0x292bba-0x0;var _0x5616f7=_0x57d2[_0x292bba];return _0x5616f7;};'use strict';var Sequelize=require(_0x257d('0x0'));module[_0x257d('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x257d('0x2')]}}; \ No newline at end of file +var _0x098a=['STRING','sequelize','exports'];(function(_0x5bd0c3,_0x4dfa49){var _0x58efb4=function(_0x801c44){while(--_0x801c44){_0x5bd0c3['push'](_0x5bd0c3['shift']());}};_0x58efb4(++_0x4dfa49);}(_0x098a,0xc1));var _0xa098=function(_0x36163c,_0x82800a){_0x36163c=_0x36163c-0x0;var _0xc92d9b=_0x098a[_0x36163c];return _0xc92d9b;};'use strict';var Sequelize=require(_0xa098('0x0'));module[_0xa098('0x1')]={'name':{'type':Sequelize[_0xa098('0x2')]},'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 2cf4a2b..651b3ca 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 _0xe68d=['lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','VIRTUAL','options','SugarcrmConfiguration','includeAll','include','findAll','rows','show','find','catch','create','body','params','findOne','SugarcrmField','order','getFields','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','fs-extra'];(function(_0x32ecfb,_0x30f1b5){var _0x5ab65f=function(_0x34b45f){while(--_0x34b45f){_0x32ecfb['push'](_0x32ecfb['shift']());}};_0x5ab65f(++_0x30f1b5);}(_0xe68d,0x181));var _0xde68=function(_0x39772f,_0x5605cb){_0x39772f=_0x39772f-0x0;var _0xc9edbf=_0xe68d[_0x39772f];return _0xc9edbf;};'use strict';var emlformat=require(_0xde68('0x0'));var rimraf=require(_0xde68('0x1'));var zipdir=require(_0xde68('0x2'));var jsonpatch=require(_0xde68('0x3'));var rp=require('request-promise');var moment=require(_0xde68('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xde68('0x5'));var util=require(_0xde68('0x6'));var path=require('path');var sox=require(_0xde68('0x7'));var csv=require(_0xde68('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xde68('0x9'));var _=require(_0xde68('0xa'));var squel=require(_0xde68('0xb'));var crypto=require('crypto');var jsforce=require(_0xde68('0xc'));var deskjs=require(_0xde68('0xd'));var toCsv=require(_0xde68('0x8'));var querystring=require(_0xde68('0xe'));var Papa=require('papaparse');var Redis=require(_0xde68('0xf'));var authService=require(_0xde68('0x10'));var qs=require(_0xde68('0x11'));var as=require(_0xde68('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xde68('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xde68('0x14'));var licenseUtil=require(_0xde68('0x15'));var db=require(_0xde68('0x16'))['db'];function respondWithStatusCode(_0x3eaec5,_0x4a6d48){_0x4a6d48=_0x4a6d48||0xcc;return function(_0x2649cf){if(_0x2649cf){return _0x3eaec5[_0xde68('0x17')](_0x4a6d48);}return _0x3eaec5[_0xde68('0x18')](_0x4a6d48)[_0xde68('0x19')]();};}function respondWithResult(_0x76bfbe,_0xaedcea){_0xaedcea=_0xaedcea||0xc8;return function(_0x15cfec){if(_0x15cfec){return _0x76bfbe['status'](_0xaedcea)[_0xde68('0x1a')](_0x15cfec);}};}function respondWithFilteredResult(_0x23b2d5,_0x16ec03){return function(_0x889fb6){if(_0x889fb6){var _0x4cfac6=typeof _0x16ec03['offset']==='undefined'&&typeof _0x16ec03[_0xde68('0x1b')]===_0xde68('0x1c');var _0x367eab=_0x889fb6[_0xde68('0x1d')];var _0x28373c=_0x4cfac6?0x0:_0x16ec03['offset'];var _0x3da5d8=_0x4cfac6?_0x889fb6['count']:_0x16ec03[_0xde68('0x1e')]+_0x16ec03[_0xde68('0x1b')];var _0x1f6f9b;if(_0x3da5d8>=_0x367eab){_0x3da5d8=_0x367eab;_0x1f6f9b=0xc8;}else{_0x1f6f9b=0xce;}_0x23b2d5['status'](_0x1f6f9b);return _0x23b2d5[_0xde68('0x1f')](_0xde68('0x20'),_0x28373c+'-'+_0x3da5d8+'/'+_0x367eab)[_0xde68('0x1a')](_0x889fb6);}return null;};}function patchUpdates(_0x3758ac){return function(_0x495e88){try{jsonpatch['apply'](_0x495e88,_0x3758ac,!![]);}catch(_0x51303c){return BPromise['reject'](_0x51303c);}return _0x495e88[_0xde68('0x21')]();};}function saveUpdates(_0x5691bf,_0x3e017b){return function(_0x544a66){if(_0x544a66){return _0x544a66[_0xde68('0x22')](_0x5691bf)[_0xde68('0x23')](function(_0xee626c){return _0xee626c;});}return null;};}function removeEntity(_0x2bdaa2,_0x57a220){return function(_0x3af501){if(_0x3af501){return _0x3af501[_0xde68('0x24')]()['then'](function(){_0x2bdaa2[_0xde68('0x18')](0xcc)[_0xde68('0x19')]();});}};}function handleEntityNotFound(_0x4c595f,_0x31a5e7){return function(_0x4999ca){if(!_0x4999ca){_0x4c595f['sendStatus'](0x194);}return _0x4999ca;};}function handleError(_0x5ad8a3,_0x52da5d){_0x52da5d=_0x52da5d||0x1f4;return function(_0x10845b){logger['error'](_0x10845b[_0xde68('0x25')]);if(_0x10845b[_0xde68('0x26')]){delete _0x10845b[_0xde68('0x26')];}_0x5ad8a3[_0xde68('0x18')](_0x52da5d)[_0xde68('0x27')](_0x10845b);};}exports[_0xde68('0x28')]=function(_0xdea8a2,_0x146979){var _0x261909={},_0x4930df={},_0x4ccfc3={'count':0x0,'rows':[]};var _0x2ec77a=_[_0xde68('0x29')](db['SugarcrmConfiguration'][_0xde68('0x2a')],function(_0xd1299c){return{'name':_0xd1299c[_0xde68('0x2b')],'type':_0xd1299c[_0xde68('0x2c')]['key']};});_0x4930df['model']=_[_0xde68('0x29')](_0x2ec77a,_0xde68('0x26'));_0x4930df[_0xde68('0x2d')]=_[_0xde68('0x2e')](_0xdea8a2[_0xde68('0x2d')]);_0x4930df[_0xde68('0x2f')]=_[_0xde68('0x30')](_0x4930df[_0xde68('0x31')],_0x4930df[_0xde68('0x2d')]);_0x261909[_0xde68('0x32')]=_[_0xde68('0x30')](_0x4930df[_0xde68('0x31')],qs[_0xde68('0x33')](_0xdea8a2[_0xde68('0x2d')]['fields']));_0x261909[_0xde68('0x32')]=_0x261909[_0xde68('0x32')][_0xde68('0x34')]?_0x261909[_0xde68('0x32')]:_0x4930df[_0xde68('0x31')];if(!_0xdea8a2[_0xde68('0x2d')][_0xde68('0x35')](_0xde68('0x36'))){_0x261909[_0xde68('0x1b')]=qs['limit'](_0xdea8a2['query']['limit']);_0x261909[_0xde68('0x1e')]=qs['offset'](_0xdea8a2[_0xde68('0x2d')][_0xde68('0x1e')]);}_0x261909['order']=qs[_0xde68('0x37')](_0xdea8a2['query']['sort']);_0x261909['where']=qs[_0xde68('0x2f')](_[_0xde68('0x38')](_0xdea8a2[_0xde68('0x2d')],_0x4930df[_0xde68('0x2f')]),_0x2ec77a);if(_0xdea8a2[_0xde68('0x2d')][_0xde68('0x39')]){_0x261909['where']=_[_0xde68('0x3a')](_0x261909[_0xde68('0x3b')],{'$or':_[_0xde68('0x29')](_0x2ec77a,function(_0x1f6a1d){if(_0x1f6a1d[_0xde68('0x2c')]!==_0xde68('0x3c')){var _0x49dac4={};_0x49dac4[_0x1f6a1d[_0xde68('0x26')]]={'$like':'%'+_0xdea8a2['query'][_0xde68('0x39')]+'%'};return _0x49dac4;}})});}_0x261909=_[_0xde68('0x3a')]({},_0x261909,_0xdea8a2[_0xde68('0x3d')]);var _0x3c6580={'where':_0x261909['where']};return db[_0xde68('0x3e')]['count'](_0x3c6580)[_0xde68('0x23')](function(_0x4cb462){_0x4ccfc3['count']=_0x4cb462;if(_0xdea8a2[_0xde68('0x2d')][_0xde68('0x3f')]){_0x261909[_0xde68('0x40')]=[{'all':!![]}];}return db[_0xde68('0x3e')][_0xde68('0x41')](_0x261909);})[_0xde68('0x23')](function(_0x439092){_0x4ccfc3[_0xde68('0x42')]=_0x439092;return _0x4ccfc3;})[_0xde68('0x23')](respondWithFilteredResult(_0x146979,_0x261909))['catch'](handleError(_0x146979,null));};exports[_0xde68('0x43')]=function(_0x3faaf0,_0x16eb3a){var _0x58a7b5={'raw':![],'where':{'id':_0x3faaf0['params']['id']}},_0x7594f7={};_0x7594f7[_0xde68('0x31')]=_[_0xde68('0x2e')](db['SugarcrmConfiguration']['rawAttributes']);_0x7594f7[_0xde68('0x2d')]=_[_0xde68('0x2e')](_0x3faaf0[_0xde68('0x2d')]);_0x7594f7[_0xde68('0x2f')]=_[_0xde68('0x30')](_0x7594f7[_0xde68('0x31')],_0x7594f7[_0xde68('0x2d')]);_0x58a7b5[_0xde68('0x32')]=_['intersection'](_0x7594f7[_0xde68('0x31')],qs['fields'](_0x3faaf0[_0xde68('0x2d')][_0xde68('0x33')]));_0x58a7b5[_0xde68('0x32')]=_0x58a7b5[_0xde68('0x32')][_0xde68('0x34')]?_0x58a7b5[_0xde68('0x32')]:_0x7594f7['model'];if(_0x3faaf0['query']['includeAll']){_0x58a7b5['include']=[{'all':!![]}];}_0x58a7b5=_[_0xde68('0x3a')]({},_0x58a7b5,_0x3faaf0['options']);return db[_0xde68('0x3e')][_0xde68('0x44')](_0x58a7b5)['then'](handleEntityNotFound(_0x16eb3a,null))[_0xde68('0x23')](respondWithResult(_0x16eb3a,null))[_0xde68('0x45')](handleError(_0x16eb3a,null));};exports[_0xde68('0x46')]=function(_0x380df8,_0x5d4bed){return db[_0xde68('0x3e')][_0xde68('0x46')](_0x380df8[_0xde68('0x47')],{})[_0xde68('0x23')](respondWithResult(_0x5d4bed,0xc9))['catch'](handleError(_0x5d4bed,null));};exports['update']=function(_0x4291d1,_0x5d3c47){if(_0x4291d1[_0xde68('0x47')]['id']){delete _0x4291d1[_0xde68('0x47')]['id'];}return db['SugarcrmConfiguration'][_0xde68('0x44')]({'where':{'id':_0x4291d1[_0xde68('0x48')]['id']}})[_0xde68('0x23')](handleEntityNotFound(_0x5d3c47,null))[_0xde68('0x23')](saveUpdates(_0x4291d1[_0xde68('0x47')],null))[_0xde68('0x23')](respondWithResult(_0x5d3c47,null))['catch'](handleError(_0x5d3c47,null));};exports['destroy']=function(_0x8499eb,_0x166988){return db[_0xde68('0x3e')][_0xde68('0x44')]({'where':{'id':_0x8499eb[_0xde68('0x48')]['id']}})['then'](handleEntityNotFound(_0x166988,null))[_0xde68('0x23')](removeEntity(_0x166988,null))[_0xde68('0x45')](handleError(_0x166988,null));};exports['getFields']=function(_0x24ed10,_0x11e0c6,_0x545a2a){var _0x5470ff={};var _0x10dadb={};var _0x91def7;var _0x540f1a;return db[_0xde68('0x3e')][_0xde68('0x49')]({'where':{'id':_0x24ed10[_0xde68('0x48')]['id']}})[_0xde68('0x23')](handleEntityNotFound(_0x11e0c6,null))[_0xde68('0x23')](function(_0x5c9e02){if(_0x5c9e02){_0x91def7=_0x5c9e02;_0x10dadb['model']=_['keys'](db[_0xde68('0x4a')][_0xde68('0x2a')]);_0x10dadb[_0xde68('0x2d')]=_[_0xde68('0x2e')](_0x24ed10[_0xde68('0x2d')]);_0x10dadb['filters']=_[_0xde68('0x30')](_0x10dadb['model'],_0x10dadb['query']);_0x5470ff[_0xde68('0x32')]=_[_0xde68('0x30')](_0x10dadb[_0xde68('0x31')],qs[_0xde68('0x33')](_0x24ed10[_0xde68('0x2d')]['fields']));_0x5470ff['attributes']=_0x5470ff[_0xde68('0x32')]['length']?_0x5470ff[_0xde68('0x32')]:_0x10dadb[_0xde68('0x31')];_0x5470ff[_0xde68('0x4b')]=qs[_0xde68('0x37')](_0x24ed10['query'][_0xde68('0x37')]);_0x5470ff[_0xde68('0x3b')]=qs[_0xde68('0x2f')](_[_0xde68('0x38')](_0x24ed10[_0xde68('0x2d')],_0x10dadb[_0xde68('0x2f')]));if(_0x24ed10[_0xde68('0x2d')][_0xde68('0x39')]){_0x5470ff[_0xde68('0x3b')]=_[_0xde68('0x3a')](_0x5470ff[_0xde68('0x3b')],{'$or':_['map'](_0x5470ff[_0xde68('0x32')],function(_0xdef6b9){var _0x14fa26={};_0x14fa26[_0xdef6b9]={'$like':'%'+_0x24ed10['query']['filter']+'%'};return _0x14fa26;})});}_0x5470ff=_[_0xde68('0x3a')]({},_0x5470ff,_0x24ed10[_0xde68('0x3d')]);return _0x91def7[_0xde68('0x4c')](_0x5470ff);}})[_0xde68('0x23')](function(_0x77eee5){if(_0x77eee5){_0x540f1a=_0x77eee5[_0xde68('0x34')];if(!_0x24ed10[_0xde68('0x2d')][_0xde68('0x35')]('nolimit')){_0x5470ff[_0xde68('0x1b')]=qs[_0xde68('0x1b')](_0x24ed10[_0xde68('0x2d')][_0xde68('0x1b')]);_0x5470ff[_0xde68('0x1e')]=qs[_0xde68('0x1e')](_0x24ed10['query'][_0xde68('0x1e')]);}return _0x91def7[_0xde68('0x4c')](_0x5470ff);}})[_0xde68('0x23')](function(_0x32de19){if(_0x32de19){return _0x32de19?{'count':_0x540f1a,'rows':_0x32de19}:null;}})[_0xde68('0x23')](respondWithResult(_0x11e0c6,null))['catch'](handleError(_0x11e0c6,null));};exports[_0xde68('0x4d')]=function(_0x52014f,_0x225053,_0x52d8c9){var _0x54d166={};var _0x284585={};var _0x15736a;var _0x7e0c2c;return db[_0xde68('0x3e')][_0xde68('0x49')]({'where':{'id':_0x52014f['params']['id']}})[_0xde68('0x23')](handleEntityNotFound(_0x225053,null))['then'](function(_0x3cf144){if(_0x3cf144){_0x15736a=_0x3cf144;_0x284585['model']=_[_0xde68('0x2e')](db[_0xde68('0x4a')][_0xde68('0x2a')]);_0x284585[_0xde68('0x2d')]=_[_0xde68('0x2e')](_0x52014f[_0xde68('0x2d')]);_0x284585[_0xde68('0x2f')]=_[_0xde68('0x30')](_0x284585['model'],_0x284585[_0xde68('0x2d')]);_0x54d166[_0xde68('0x32')]=_[_0xde68('0x30')](_0x284585['model'],qs[_0xde68('0x33')](_0x52014f[_0xde68('0x2d')][_0xde68('0x33')]));_0x54d166['attributes']=_0x54d166[_0xde68('0x32')][_0xde68('0x34')]?_0x54d166[_0xde68('0x32')]:_0x284585[_0xde68('0x31')];_0x54d166[_0xde68('0x4b')]=qs['sort'](_0x52014f[_0xde68('0x2d')][_0xde68('0x37')]);_0x54d166[_0xde68('0x3b')]=qs[_0xde68('0x2f')](_['pick'](_0x52014f['query'],_0x284585[_0xde68('0x2f')]));if(_0x52014f[_0xde68('0x2d')][_0xde68('0x39')]){_0x54d166[_0xde68('0x3b')]=_[_0xde68('0x3a')](_0x54d166[_0xde68('0x3b')],{'$or':_['map'](_0x54d166[_0xde68('0x32')],function(_0x617b6d){var _0x554b05={};_0x554b05[_0x617b6d]={'$like':'%'+_0x52014f[_0xde68('0x2d')][_0xde68('0x39')]+'%'};return _0x554b05;})});}_0x54d166=_['merge']({},_0x54d166,_0x52014f[_0xde68('0x3d')]);return _0x15736a[_0xde68('0x4d')](_0x54d166);}})[_0xde68('0x23')](function(_0x1c874a){if(_0x1c874a){_0x7e0c2c=_0x1c874a[_0xde68('0x34')];if(!_0x52014f[_0xde68('0x2d')]['hasOwnProperty'](_0xde68('0x36'))){_0x54d166[_0xde68('0x1b')]=qs[_0xde68('0x1b')](_0x52014f['query'][_0xde68('0x1b')]);_0x54d166[_0xde68('0x1e')]=qs[_0xde68('0x1e')](_0x52014f['query'][_0xde68('0x1e')]);}return _0x15736a[_0xde68('0x4d')](_0x54d166);}})[_0xde68('0x23')](function(_0x44d905){if(_0x44d905){return _0x44d905?{'count':_0x7e0c2c,'rows':_0x44d905}:null;}})[_0xde68('0x23')](respondWithResult(_0x225053,null))[_0xde68('0x45')](handleError(_0x225053,null));};exports['getDescriptions']=function(_0x5789e1,_0x41b4dd,_0x36d016){var _0x3c66fc={};var _0xe169c3={};var _0x23bb5d;var _0x1f15bb;return db[_0xde68('0x3e')][_0xde68('0x49')]({'where':{'id':_0x5789e1[_0xde68('0x48')]['id']}})[_0xde68('0x23')](handleEntityNotFound(_0x41b4dd,null))[_0xde68('0x23')](function(_0x58661a){if(_0x58661a){_0x23bb5d=_0x58661a;_0xe169c3['model']=_['keys'](db['SugarcrmField'][_0xde68('0x2a')]);_0xe169c3[_0xde68('0x2d')]=_[_0xde68('0x2e')](_0x5789e1['query']);_0xe169c3[_0xde68('0x2f')]=_['intersection'](_0xe169c3[_0xde68('0x31')],_0xe169c3[_0xde68('0x2d')]);_0x3c66fc[_0xde68('0x32')]=_[_0xde68('0x30')](_0xe169c3[_0xde68('0x31')],qs[_0xde68('0x33')](_0x5789e1[_0xde68('0x2d')][_0xde68('0x33')]));_0x3c66fc['attributes']=_0x3c66fc[_0xde68('0x32')][_0xde68('0x34')]?_0x3c66fc[_0xde68('0x32')]:_0xe169c3[_0xde68('0x31')];_0x3c66fc[_0xde68('0x4b')]=qs[_0xde68('0x37')](_0x5789e1['query'][_0xde68('0x37')]);_0x3c66fc[_0xde68('0x3b')]=qs['filters'](_[_0xde68('0x38')](_0x5789e1[_0xde68('0x2d')],_0xe169c3[_0xde68('0x2f')]));if(_0x5789e1[_0xde68('0x2d')][_0xde68('0x39')]){_0x3c66fc[_0xde68('0x3b')]=_[_0xde68('0x3a')](_0x3c66fc[_0xde68('0x3b')],{'$or':_['map'](_0x3c66fc['attributes'],function(_0x55e554){var _0x446cb3={};_0x446cb3[_0x55e554]={'$like':'%'+_0x5789e1[_0xde68('0x2d')][_0xde68('0x39')]+'%'};return _0x446cb3;})});}_0x3c66fc=_[_0xde68('0x3a')]({},_0x3c66fc,_0x5789e1[_0xde68('0x3d')]);return _0x23bb5d['getDescriptions'](_0x3c66fc);}})[_0xde68('0x23')](function(_0x297de3){if(_0x297de3){_0x1f15bb=_0x297de3[_0xde68('0x34')];if(!_0x5789e1[_0xde68('0x2d')][_0xde68('0x35')]('nolimit')){_0x3c66fc['limit']=qs['limit'](_0x5789e1[_0xde68('0x2d')][_0xde68('0x1b')]);_0x3c66fc[_0xde68('0x1e')]=qs[_0xde68('0x1e')](_0x5789e1[_0xde68('0x2d')][_0xde68('0x1e')]);}return _0x23bb5d[_0xde68('0x4e')](_0x3c66fc);}})[_0xde68('0x23')](function(_0x437eb9){if(_0x437eb9){return _0x437eb9?{'count':_0x1f15bb,'rows':_0x437eb9}:null;}})[_0xde68('0x23')](respondWithResult(_0x41b4dd,null))[_0xde68('0x45')](handleError(_0x41b4dd,null));}; \ No newline at end of file +var _0x2805=['undefined','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','SugarcrmConfiguration','rawAttributes','key','model','query','filters','intersection','attributes','fields','order','sort','where','filter','merge','type','VIRTUAL','options','then','count','includeAll','include','findAll','rows','catch','show','keys','length','find','create','body','params','getFields','findOne','SugarcrmField','pick','hasOwnProperty','nolimit','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset'];(function(_0x19a0cd,_0x124948){var _0xf74259=function(_0x3f59c7){while(--_0x3f59c7){_0x19a0cd['push'](_0x19a0cd['shift']());}};_0xf74259(++_0x124948);}(_0x2805,0x17d));var _0x5280=function(_0xd09668,_0x1435b2){_0xd09668=_0xd09668-0x0;var _0x68726=_0x2805[_0xd09668];return _0x68726;};'use strict';var emlformat=require(_0x5280('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5280('0x1'));var jsonpatch=require(_0x5280('0x2'));var rp=require(_0x5280('0x3'));var moment=require(_0x5280('0x4'));var BPromise=require(_0x5280('0x5'));var Mustache=require(_0x5280('0x6'));var util=require(_0x5280('0x7'));var path=require('path');var sox=require(_0x5280('0x8'));var csv=require(_0x5280('0x9'));var ejs=require(_0x5280('0xa'));var fs=require('fs');var fs_extra=require(_0x5280('0xb'));var _=require(_0x5280('0xc'));var squel=require('squel');var crypto=require(_0x5280('0xd'));var jsforce=require(_0x5280('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5280('0x9'));var querystring=require(_0x5280('0xf'));var Papa=require(_0x5280('0x10'));var Redis=require('ioredis');var authService=require(_0x5280('0x11'));var qs=require(_0x5280('0x12'));var as=require(_0x5280('0x13'));var hardwareService=require(_0x5280('0x14'));var logger=require(_0x5280('0x15'))('api');var utils=require(_0x5280('0x16'));var config=require(_0x5280('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5280('0x18'))['db'];function respondWithStatusCode(_0x14fa8d,_0x35fce5){_0x35fce5=_0x35fce5||0xcc;return function(_0x4a7417){if(_0x4a7417){return _0x14fa8d[_0x5280('0x19')](_0x35fce5);}return _0x14fa8d[_0x5280('0x1a')](_0x35fce5)[_0x5280('0x1b')]();};}function respondWithResult(_0x2bab4b,_0x4abeda){_0x4abeda=_0x4abeda||0xc8;return function(_0x433a0b){if(_0x433a0b){return _0x2bab4b[_0x5280('0x1a')](_0x4abeda)['json'](_0x433a0b);}};}function respondWithFilteredResult(_0xa8623d,_0x18839e){return function(_0x28f852){if(_0x28f852){var _0x510e4d=typeof _0x18839e[_0x5280('0x1c')]===_0x5280('0x1d')&&typeof _0x18839e[_0x5280('0x1e')]===_0x5280('0x1d');var _0x1cfc96=_0x28f852['count'];var _0x463c22=_0x510e4d?0x0:_0x18839e['offset'];var _0x23788f=_0x510e4d?_0x28f852['count']:_0x18839e['offset']+_0x18839e[_0x5280('0x1e')];var _0x78e6b;if(_0x23788f>=_0x1cfc96){_0x23788f=_0x1cfc96;_0x78e6b=0xc8;}else{_0x78e6b=0xce;}_0xa8623d['status'](_0x78e6b);return _0xa8623d[_0x5280('0x1f')](_0x5280('0x20'),_0x463c22+'-'+_0x23788f+'/'+_0x1cfc96)['json'](_0x28f852);}return null;};}function patchUpdates(_0x1b0f9e){return function(_0x4c6caa){try{jsonpatch[_0x5280('0x21')](_0x4c6caa,_0x1b0f9e,!![]);}catch(_0xaa26b4){return BPromise[_0x5280('0x22')](_0xaa26b4);}return _0x4c6caa[_0x5280('0x23')]();};}function saveUpdates(_0x185126,_0x5ae9f3){return function(_0x3ddce3){if(_0x3ddce3){return _0x3ddce3[_0x5280('0x24')](_0x185126)['then'](function(_0x158023){return _0x158023;});}return null;};}function removeEntity(_0x1f1069,_0x36aa72){return function(_0x145a39){if(_0x145a39){return _0x145a39[_0x5280('0x25')]()['then'](function(){_0x1f1069['status'](0xcc)[_0x5280('0x1b')]();});}};}function handleEntityNotFound(_0x294619,_0x2a7d6a){return function(_0x8125bf){if(!_0x8125bf){_0x294619[_0x5280('0x19')](0x194);}return _0x8125bf;};}function handleError(_0x1e6827,_0x1b0cd3){_0x1b0cd3=_0x1b0cd3||0x1f4;return function(_0x1becf8){logger['error'](_0x1becf8[_0x5280('0x26')]);if(_0x1becf8[_0x5280('0x27')]){delete _0x1becf8[_0x5280('0x27')];}_0x1e6827['status'](_0x1b0cd3)[_0x5280('0x28')](_0x1becf8);};}exports[_0x5280('0x29')]=function(_0x3846d4,_0x5eece6){var _0x4500b4={},_0x529e2f={},_0x597685={'count':0x0,'rows':[]};var _0x2ad105=_[_0x5280('0x2a')](db[_0x5280('0x2b')][_0x5280('0x2c')],function(_0x32cbcf){return{'name':_0x32cbcf['fieldName'],'type':_0x32cbcf['type'][_0x5280('0x2d')]};});_0x529e2f[_0x5280('0x2e')]=_[_0x5280('0x2a')](_0x2ad105,_0x5280('0x27'));_0x529e2f[_0x5280('0x2f')]=_['keys'](_0x3846d4[_0x5280('0x2f')]);_0x529e2f[_0x5280('0x30')]=_[_0x5280('0x31')](_0x529e2f[_0x5280('0x2e')],_0x529e2f['query']);_0x4500b4[_0x5280('0x32')]=_['intersection'](_0x529e2f[_0x5280('0x2e')],qs[_0x5280('0x33')](_0x3846d4['query'][_0x5280('0x33')]));_0x4500b4[_0x5280('0x32')]=_0x4500b4['attributes']['length']?_0x4500b4[_0x5280('0x32')]:_0x529e2f['model'];if(!_0x3846d4['query']['hasOwnProperty']('nolimit')){_0x4500b4[_0x5280('0x1e')]=qs['limit'](_0x3846d4[_0x5280('0x2f')][_0x5280('0x1e')]);_0x4500b4[_0x5280('0x1c')]=qs[_0x5280('0x1c')](_0x3846d4['query'][_0x5280('0x1c')]);}_0x4500b4[_0x5280('0x34')]=qs[_0x5280('0x35')](_0x3846d4[_0x5280('0x2f')][_0x5280('0x35')]);_0x4500b4[_0x5280('0x36')]=qs['filters'](_['pick'](_0x3846d4[_0x5280('0x2f')],_0x529e2f['filters']),_0x2ad105);if(_0x3846d4[_0x5280('0x2f')][_0x5280('0x37')]){_0x4500b4[_0x5280('0x36')]=_[_0x5280('0x38')](_0x4500b4[_0x5280('0x36')],{'$or':_[_0x5280('0x2a')](_0x2ad105,function(_0x310a5e){if(_0x310a5e[_0x5280('0x39')]!==_0x5280('0x3a')){var _0x5f5c98={};_0x5f5c98[_0x310a5e[_0x5280('0x27')]]={'$like':'%'+_0x3846d4[_0x5280('0x2f')][_0x5280('0x37')]+'%'};return _0x5f5c98;}})});}_0x4500b4=_[_0x5280('0x38')]({},_0x4500b4,_0x3846d4[_0x5280('0x3b')]);var _0x170c78={'where':_0x4500b4[_0x5280('0x36')]};return db[_0x5280('0x2b')]['count'](_0x170c78)[_0x5280('0x3c')](function(_0x1e7106){_0x597685[_0x5280('0x3d')]=_0x1e7106;if(_0x3846d4[_0x5280('0x2f')][_0x5280('0x3e')]){_0x4500b4[_0x5280('0x3f')]=[{'all':!![]}];}return db[_0x5280('0x2b')][_0x5280('0x40')](_0x4500b4);})[_0x5280('0x3c')](function(_0x8496cf){_0x597685[_0x5280('0x41')]=_0x8496cf;return _0x597685;})[_0x5280('0x3c')](respondWithFilteredResult(_0x5eece6,_0x4500b4))[_0x5280('0x42')](handleError(_0x5eece6,null));};exports[_0x5280('0x43')]=function(_0x310c0f,_0x5616a0){var _0x35f936={'raw':![],'where':{'id':_0x310c0f['params']['id']}},_0x190ec4={};_0x190ec4[_0x5280('0x2e')]=_[_0x5280('0x44')](db[_0x5280('0x2b')][_0x5280('0x2c')]);_0x190ec4[_0x5280('0x2f')]=_[_0x5280('0x44')](_0x310c0f[_0x5280('0x2f')]);_0x190ec4[_0x5280('0x30')]=_[_0x5280('0x31')](_0x190ec4[_0x5280('0x2e')],_0x190ec4[_0x5280('0x2f')]);_0x35f936[_0x5280('0x32')]=_['intersection'](_0x190ec4[_0x5280('0x2e')],qs['fields'](_0x310c0f[_0x5280('0x2f')][_0x5280('0x33')]));_0x35f936[_0x5280('0x32')]=_0x35f936[_0x5280('0x32')][_0x5280('0x45')]?_0x35f936['attributes']:_0x190ec4[_0x5280('0x2e')];if(_0x310c0f[_0x5280('0x2f')][_0x5280('0x3e')]){_0x35f936[_0x5280('0x3f')]=[{'all':!![]}];}_0x35f936=_[_0x5280('0x38')]({},_0x35f936,_0x310c0f[_0x5280('0x3b')]);return db['SugarcrmConfiguration'][_0x5280('0x46')](_0x35f936)[_0x5280('0x3c')](handleEntityNotFound(_0x5616a0,null))['then'](respondWithResult(_0x5616a0,null))[_0x5280('0x42')](handleError(_0x5616a0,null));};exports[_0x5280('0x47')]=function(_0x36c8e5,_0x216cc5){return db[_0x5280('0x2b')][_0x5280('0x47')](_0x36c8e5[_0x5280('0x48')],{})[_0x5280('0x3c')](respondWithResult(_0x216cc5,0xc9))[_0x5280('0x42')](handleError(_0x216cc5,null));};exports[_0x5280('0x24')]=function(_0x587c37,_0x497431){if(_0x587c37[_0x5280('0x48')]['id']){delete _0x587c37['body']['id'];}return db[_0x5280('0x2b')][_0x5280('0x46')]({'where':{'id':_0x587c37[_0x5280('0x49')]['id']}})[_0x5280('0x3c')](handleEntityNotFound(_0x497431,null))['then'](saveUpdates(_0x587c37[_0x5280('0x48')],null))[_0x5280('0x3c')](respondWithResult(_0x497431,null))[_0x5280('0x42')](handleError(_0x497431,null));};exports[_0x5280('0x25')]=function(_0x1811b4,_0x386624){return db[_0x5280('0x2b')]['find']({'where':{'id':_0x1811b4['params']['id']}})[_0x5280('0x3c')](handleEntityNotFound(_0x386624,null))[_0x5280('0x3c')](removeEntity(_0x386624,null))['catch'](handleError(_0x386624,null));};exports[_0x5280('0x4a')]=function(_0x3904dd,_0x1ad0a0,_0x566ead){var _0x22cdc6={};var _0x14b64b={};var _0x3d69b1;var _0x33ab59;return db[_0x5280('0x2b')][_0x5280('0x4b')]({'where':{'id':_0x3904dd[_0x5280('0x49')]['id']}})[_0x5280('0x3c')](handleEntityNotFound(_0x1ad0a0,null))[_0x5280('0x3c')](function(_0x498398){if(_0x498398){_0x3d69b1=_0x498398;_0x14b64b[_0x5280('0x2e')]=_['keys'](db[_0x5280('0x4c')][_0x5280('0x2c')]);_0x14b64b[_0x5280('0x2f')]=_['keys'](_0x3904dd[_0x5280('0x2f')]);_0x14b64b[_0x5280('0x30')]=_[_0x5280('0x31')](_0x14b64b['model'],_0x14b64b[_0x5280('0x2f')]);_0x22cdc6[_0x5280('0x32')]=_['intersection'](_0x14b64b[_0x5280('0x2e')],qs[_0x5280('0x33')](_0x3904dd[_0x5280('0x2f')]['fields']));_0x22cdc6['attributes']=_0x22cdc6[_0x5280('0x32')][_0x5280('0x45')]?_0x22cdc6[_0x5280('0x32')]:_0x14b64b[_0x5280('0x2e')];_0x22cdc6[_0x5280('0x34')]=qs[_0x5280('0x35')](_0x3904dd[_0x5280('0x2f')][_0x5280('0x35')]);_0x22cdc6['where']=qs[_0x5280('0x30')](_[_0x5280('0x4d')](_0x3904dd[_0x5280('0x2f')],_0x14b64b['filters']));if(_0x3904dd[_0x5280('0x2f')][_0x5280('0x37')]){_0x22cdc6[_0x5280('0x36')]=_[_0x5280('0x38')](_0x22cdc6[_0x5280('0x36')],{'$or':_['map'](_0x22cdc6[_0x5280('0x32')],function(_0xed8472){var _0x1c410e={};_0x1c410e[_0xed8472]={'$like':'%'+_0x3904dd['query'][_0x5280('0x37')]+'%'};return _0x1c410e;})});}_0x22cdc6=_['merge']({},_0x22cdc6,_0x3904dd[_0x5280('0x3b')]);return _0x3d69b1[_0x5280('0x4a')](_0x22cdc6);}})[_0x5280('0x3c')](function(_0x23538e){if(_0x23538e){_0x33ab59=_0x23538e['length'];if(!_0x3904dd[_0x5280('0x2f')][_0x5280('0x4e')](_0x5280('0x4f'))){_0x22cdc6['limit']=qs[_0x5280('0x1e')](_0x3904dd[_0x5280('0x2f')][_0x5280('0x1e')]);_0x22cdc6[_0x5280('0x1c')]=qs[_0x5280('0x1c')](_0x3904dd[_0x5280('0x2f')]['offset']);}return _0x3d69b1['getFields'](_0x22cdc6);}})['then'](function(_0x1946ba){if(_0x1946ba){return _0x1946ba?{'count':_0x33ab59,'rows':_0x1946ba}:null;}})[_0x5280('0x3c')](respondWithResult(_0x1ad0a0,null))[_0x5280('0x42')](handleError(_0x1ad0a0,null));};exports[_0x5280('0x50')]=function(_0x2e488e,_0x14096b,_0x25054c){var _0x1b3690={};var _0x45320d={};var _0x58174d;var _0x5fd0f5;return db[_0x5280('0x2b')]['findOne']({'where':{'id':_0x2e488e[_0x5280('0x49')]['id']}})[_0x5280('0x3c')](handleEntityNotFound(_0x14096b,null))[_0x5280('0x3c')](function(_0x4ab613){if(_0x4ab613){_0x58174d=_0x4ab613;_0x45320d[_0x5280('0x2e')]=_['keys'](db[_0x5280('0x4c')][_0x5280('0x2c')]);_0x45320d[_0x5280('0x2f')]=_[_0x5280('0x44')](_0x2e488e[_0x5280('0x2f')]);_0x45320d['filters']=_[_0x5280('0x31')](_0x45320d[_0x5280('0x2e')],_0x45320d[_0x5280('0x2f')]);_0x1b3690['attributes']=_[_0x5280('0x31')](_0x45320d[_0x5280('0x2e')],qs[_0x5280('0x33')](_0x2e488e[_0x5280('0x2f')][_0x5280('0x33')]));_0x1b3690[_0x5280('0x32')]=_0x1b3690[_0x5280('0x32')][_0x5280('0x45')]?_0x1b3690[_0x5280('0x32')]:_0x45320d[_0x5280('0x2e')];_0x1b3690[_0x5280('0x34')]=qs[_0x5280('0x35')](_0x2e488e[_0x5280('0x2f')]['sort']);_0x1b3690[_0x5280('0x36')]=qs[_0x5280('0x30')](_[_0x5280('0x4d')](_0x2e488e['query'],_0x45320d[_0x5280('0x30')]));if(_0x2e488e[_0x5280('0x2f')]['filter']){_0x1b3690[_0x5280('0x36')]=_[_0x5280('0x38')](_0x1b3690[_0x5280('0x36')],{'$or':_[_0x5280('0x2a')](_0x1b3690[_0x5280('0x32')],function(_0x448227){var _0x198f6b={};_0x198f6b[_0x448227]={'$like':'%'+_0x2e488e[_0x5280('0x2f')]['filter']+'%'};return _0x198f6b;})});}_0x1b3690=_[_0x5280('0x38')]({},_0x1b3690,_0x2e488e[_0x5280('0x3b')]);return _0x58174d[_0x5280('0x50')](_0x1b3690);}})[_0x5280('0x3c')](function(_0x174467){if(_0x174467){_0x5fd0f5=_0x174467[_0x5280('0x45')];if(!_0x2e488e[_0x5280('0x2f')][_0x5280('0x4e')](_0x5280('0x4f'))){_0x1b3690[_0x5280('0x1e')]=qs['limit'](_0x2e488e['query'][_0x5280('0x1e')]);_0x1b3690['offset']=qs[_0x5280('0x1c')](_0x2e488e['query'][_0x5280('0x1c')]);}return _0x58174d[_0x5280('0x50')](_0x1b3690);}})[_0x5280('0x3c')](function(_0x2d15da){if(_0x2d15da){return _0x2d15da?{'count':_0x5fd0f5,'rows':_0x2d15da}:null;}})[_0x5280('0x3c')](respondWithResult(_0x14096b,null))[_0x5280('0x42')](handleError(_0x14096b,null));};exports[_0x5280('0x51')]=function(_0x574d13,_0x2ba39a,_0x8e3b0c){var _0x10ebd6={};var _0x183e76={};var _0x4f0ae4;var _0x1af4f7;return db[_0x5280('0x2b')][_0x5280('0x4b')]({'where':{'id':_0x574d13[_0x5280('0x49')]['id']}})['then'](handleEntityNotFound(_0x2ba39a,null))[_0x5280('0x3c')](function(_0x352d52){if(_0x352d52){_0x4f0ae4=_0x352d52;_0x183e76[_0x5280('0x2e')]=_[_0x5280('0x44')](db[_0x5280('0x4c')]['rawAttributes']);_0x183e76[_0x5280('0x2f')]=_[_0x5280('0x44')](_0x574d13[_0x5280('0x2f')]);_0x183e76[_0x5280('0x30')]=_['intersection'](_0x183e76[_0x5280('0x2e')],_0x183e76['query']);_0x10ebd6[_0x5280('0x32')]=_[_0x5280('0x31')](_0x183e76['model'],qs[_0x5280('0x33')](_0x574d13['query'][_0x5280('0x33')]));_0x10ebd6[_0x5280('0x32')]=_0x10ebd6['attributes'][_0x5280('0x45')]?_0x10ebd6['attributes']:_0x183e76[_0x5280('0x2e')];_0x10ebd6[_0x5280('0x34')]=qs[_0x5280('0x35')](_0x574d13[_0x5280('0x2f')]['sort']);_0x10ebd6['where']=qs[_0x5280('0x30')](_['pick'](_0x574d13['query'],_0x183e76['filters']));if(_0x574d13['query'][_0x5280('0x37')]){_0x10ebd6[_0x5280('0x36')]=_[_0x5280('0x38')](_0x10ebd6['where'],{'$or':_[_0x5280('0x2a')](_0x10ebd6[_0x5280('0x32')],function(_0x4a386f){var _0x10ac71={};_0x10ac71[_0x4a386f]={'$like':'%'+_0x574d13[_0x5280('0x2f')][_0x5280('0x37')]+'%'};return _0x10ac71;})});}_0x10ebd6=_[_0x5280('0x38')]({},_0x10ebd6,_0x574d13[_0x5280('0x3b')]);return _0x4f0ae4[_0x5280('0x51')](_0x10ebd6);}})[_0x5280('0x3c')](function(_0x25c7e9){if(_0x25c7e9){_0x1af4f7=_0x25c7e9[_0x5280('0x45')];if(!_0x574d13[_0x5280('0x2f')][_0x5280('0x4e')](_0x5280('0x4f'))){_0x10ebd6['limit']=qs['limit'](_0x574d13[_0x5280('0x2f')]['limit']);_0x10ebd6[_0x5280('0x1c')]=qs['offset'](_0x574d13[_0x5280('0x2f')][_0x5280('0x1c')]);}return _0x4f0ae4['getDescriptions'](_0x10ebd6);}})[_0x5280('0x3c')](function(_0x2d6e08){if(_0x2d6e08){return _0x2d6e08?{'count':_0x1af4f7,'rows':_0x2d6e08}:null;}})[_0x5280('0x3c')](respondWithResult(_0x2ba39a,null))[_0x5280('0x42')](handleError(_0x2ba39a,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index fd0167b..fa4fd0e 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 _0x88b1=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','SugarcrmConfiguration','int_sugarcrm_configurations'];(function(_0x2414a4,_0x40295){var _0x2520fb=function(_0x2a8ee5){while(--_0x2a8ee5){_0x2414a4['push'](_0x2414a4['shift']());}};_0x2520fb(++_0x40295);}(_0x88b1,0xb4));var _0x188b=function(_0xeb9c41,_0x2ac6bc){_0xeb9c41=_0xeb9c41-0x0;var _0x461911=_0x88b1[_0xeb9c41];return _0x461911;};'use strict';var _=require(_0x188b('0x0'));var util=require(_0x188b('0x1'));var logger=require(_0x188b('0x2'))('api');var moment=require(_0x188b('0x3'));var BPromise=require(_0x188b('0x4'));var rp=require(_0x188b('0x5'));var fs=require('fs');var path=require(_0x188b('0x6'));var rimraf=require(_0x188b('0x7'));var config=require(_0x188b('0x8'));var attributes=require(_0x188b('0x9'));module['exports']=function(_0x9337f,_0x22e436){return _0x9337f['define'](_0x188b('0xa'),attributes,{'tableName':_0x188b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7bbc=['bluebird','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x36e14d,_0x19e3c6){var _0x564005=function(_0x15c240){while(--_0x15c240){_0x36e14d['push'](_0x36e14d['shift']());}};_0x564005(++_0x19e3c6);}(_0x7bbc,0xcb));var _0xc7bb=function(_0x25b50a,_0x364868){_0x25b50a=_0x25b50a-0x0;var _0xf6a93=_0x7bbc[_0x25b50a];return _0xf6a93;};'use strict';var _=require(_0xc7bb('0x0'));var util=require(_0xc7bb('0x1'));var logger=require(_0xc7bb('0x2'))(_0xc7bb('0x3'));var moment=require(_0xc7bb('0x4'));var BPromise=require(_0xc7bb('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc7bb('0x6'));var rimraf=require(_0xc7bb('0x7'));var config=require(_0xc7bb('0x8'));var attributes=require(_0xc7bb('0x9'));module[_0xc7bb('0xa')]=function(_0x24a8c6,_0x2882c2){return _0x24a8c6['define'](_0xc7bb('0xb'),attributes,{'tableName':_0xc7bb('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 885e2a6..8991388 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 _0x2a8c=['SugarcrmConfiguration,\x20%s,\x20%s','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x5b87d7,_0x6ac4eb){var _0x3a6344=function(_0x4c8673){while(--_0x4c8673){_0x5b87d7['push'](_0x5b87d7['shift']());}};_0x3a6344(++_0x6ac4eb);}(_0x2a8c,0x183));var _0xc2a8=function(_0x437fe6,_0x1b1d39){_0x437fe6=_0x437fe6-0x0;var _0x1ae3c8=_0x2a8c[_0x437fe6];return _0x1ae3c8;};'use strict';var _=require(_0xc2a8('0x0'));var util=require('util');var moment=require(_0xc2a8('0x1'));var BPromise=require('bluebird');var rs=require(_0xc2a8('0x2'));var fs=require('fs');var Redis=require(_0xc2a8('0x3'));var db=require(_0xc2a8('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc2a8('0x5'))('rpc');var config=require(_0xc2a8('0x6'));var jayson=require(_0xc2a8('0x7'));var client=jayson[_0xc2a8('0x8')][_0xc2a8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x46e8b2,_0x168f75,_0x24fdd6){return new BPromise(function(_0x49e731,_0x1f2eb3){return client['request'](_0x46e8b2,_0x24fdd6)[_0xc2a8('0xa')](function(_0x4c6146){logger[_0xc2a8('0xb')](_0xc2a8('0xc'),_0x168f75,'request\x20sent');logger[_0xc2a8('0xd')](_0xc2a8('0xe'),_0x168f75,_0xc2a8('0xf'),JSON[_0xc2a8('0x10')](_0x4c6146));if(_0x4c6146[_0xc2a8('0x11')]){if(_0x4c6146[_0xc2a8('0x11')][_0xc2a8('0x12')]===0x1f4){logger['error'](_0xc2a8('0xc'),_0x168f75,_0x4c6146[_0xc2a8('0x11')][_0xc2a8('0x13')]);return _0x1f2eb3(_0x4c6146['error']['message']);}logger[_0xc2a8('0x11')](_0xc2a8('0xc'),_0x168f75,_0x4c6146[_0xc2a8('0x11')]['message']);return _0x49e731(_0x4c6146[_0xc2a8('0x11')][_0xc2a8('0x13')]);}else{logger[_0xc2a8('0xb')](_0xc2a8('0xc'),_0x168f75,_0xc2a8('0xf'));_0x49e731(_0x4c6146[_0xc2a8('0x14')][_0xc2a8('0x13')]);}})['catch'](function(_0x5c748d){logger[_0xc2a8('0x11')](_0xc2a8('0xc'),_0x168f75,_0x5c748d);_0x1f2eb3(_0x5c748d);});});} \ No newline at end of file +var _0x6100=['bluebird','randomstring','ioredis','rpc','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x6100,0x8a));var _0x0610=function(_0x239dfb,_0x40ee47){_0x239dfb=_0x239dfb-0x0;var _0x203fca=_0x6100[_0x239dfb];return _0x203fca;};'use strict';var _=require(_0x0610('0x0'));var util=require('util');var moment=require(_0x0610('0x1'));var BPromise=require(_0x0610('0x2'));var rs=require(_0x0610('0x3'));var fs=require('fs');var Redis=require(_0x0610('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0610('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0610('0x6')][_0x0610('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5efe51,_0x1ed905,_0x121729){return new BPromise(function(_0x4501e0,_0x462863){return client[_0x0610('0x8')](_0x5efe51,_0x121729)[_0x0610('0x9')](function(_0x25b8b7){logger[_0x0610('0xa')](_0x0610('0xb'),_0x1ed905,_0x0610('0xc'));logger[_0x0610('0xd')](_0x0610('0xe'),_0x1ed905,_0x0610('0xc'),JSON[_0x0610('0xf')](_0x25b8b7));if(_0x25b8b7[_0x0610('0x10')]){if(_0x25b8b7[_0x0610('0x10')]['code']===0x1f4){logger[_0x0610('0x10')](_0x0610('0xb'),_0x1ed905,_0x25b8b7['error'][_0x0610('0x11')]);return _0x462863(_0x25b8b7[_0x0610('0x10')][_0x0610('0x11')]);}logger[_0x0610('0x10')](_0x0610('0xb'),_0x1ed905,_0x25b8b7['error'][_0x0610('0x11')]);return _0x4501e0(_0x25b8b7[_0x0610('0x10')][_0x0610('0x11')]);}else{logger[_0x0610('0xa')](_0x0610('0xb'),_0x1ed905,_0x0610('0xc'));_0x4501e0(_0x25b8b7[_0x0610('0x12')]['message']);}})[_0x0610('0x13')](function(_0x2b6319){logger[_0x0610('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x1ed905,_0x2b6319);_0x462863(_0x2b6319);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 05fa778..2f4fa16 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 _0xf788=['create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x4c533e,_0x49a834){var _0x55fc3b=function(_0x44fbdf){while(--_0x44fbdf){_0x4c533e['push'](_0x4c533e['shift']());}};_0x55fc3b(++_0x49a834);}(_0xf788,0x1d3));var _0x8f78=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xf788[_0xdea41a];return _0x15d0d8;};'use strict';var multer=require(_0x8f78('0x0'));var util=require(_0x8f78('0x1'));var path=require(_0x8f78('0x2'));var timeout=require(_0x8f78('0x3'));var express=require(_0x8f78('0x4'));var router=express[_0x8f78('0x5')]();var fs_extra=require(_0x8f78('0x6'));var auth=require(_0x8f78('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8f78('0x8'));var controller=require(_0x8f78('0x9'));router[_0x8f78('0xa')]('/',auth[_0x8f78('0xb')](),controller[_0x8f78('0xc')]);router[_0x8f78('0xa')](_0x8f78('0xd'),auth[_0x8f78('0xb')](),controller[_0x8f78('0xe')]);router[_0x8f78('0xf')]('/',auth['isAuthenticated'](),controller[_0x8f78('0x10')]);router[_0x8f78('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x8f78('0x12')]);router['delete'](_0x8f78('0xd'),auth['isAuthenticated'](),controller[_0x8f78('0x13')]);module[_0x8f78('0x14')]=router; \ No newline at end of file +var _0x9070=['/:id','post','create','put','update','delete','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x9070,0x79));var _0x0907=function(_0x48999d,_0x1e02cb){_0x48999d=_0x48999d-0x0;var _0x1ad0d1=_0x9070[_0x48999d];return _0x1ad0d1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0907('0x0'));var timeout=require(_0x0907('0x1'));var express=require(_0x0907('0x2'));var router=express[_0x0907('0x3')]();var fs_extra=require(_0x0907('0x4'));var auth=require(_0x0907('0x5'));var interaction=require(_0x0907('0x6'));var config=require(_0x0907('0x7'));var controller=require(_0x0907('0x8'));router[_0x0907('0x9')]('/',auth[_0x0907('0xa')](),controller[_0x0907('0xb')]);router[_0x0907('0x9')](_0x0907('0xc'),auth[_0x0907('0xa')](),controller['show']);router[_0x0907('0xd')]('/',auth[_0x0907('0xa')](),controller[_0x0907('0xe')]);router[_0x0907('0xf')](_0x0907('0xc'),auth['isAuthenticated'](),controller[_0x0907('0x10')]);router[_0x0907('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x0907('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 18f99ac..b91e64c 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 _0x6509=['STRING','variable','customVariable','BOOLEAN','sequelize','exports','ENUM','string','keyValue','picklist'];(function(_0xcceb4e,_0x16b9cd){var _0x458bda=function(_0x2efa9c){while(--_0x2efa9c){_0xcceb4e['push'](_0xcceb4e['shift']());}};_0x458bda(++_0x16b9cd);}(_0x6509,0xb8));var _0x9650=function(_0xc82d1a,_0x145c50){_0xc82d1a=_0xc82d1a-0x0;var _0x32fad2=_0x6509[_0xc82d1a];return _0x32fad2;};'use strict';var Sequelize=require(_0x9650('0x0'));module[_0x9650('0x1')]={'type':{'type':Sequelize[_0x9650('0x2')](_0x9650('0x3'),'variable','customVariable',_0x9650('0x4'),_0x9650('0x5')),'defaultValue':_0x9650('0x3')},'content':{'type':Sequelize[_0x9650('0x6')]},'key':{'type':Sequelize[_0x9650('0x6')]},'keyType':{'type':Sequelize['ENUM']('string',_0x9650('0x7'),_0x9650('0x8'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x9650('0x6')]},'nameField':{'type':Sequelize[_0x9650('0x6')]},'customField':{'type':Sequelize[_0x9650('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9650('0x6')]}}; \ No newline at end of file +var _0x4660=['customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','ENUM','string','variable'];(function(_0x6cf5ec,_0x194d2e){var _0x271c4f=function(_0x206fee){while(--_0x206fee){_0x6cf5ec['push'](_0x6cf5ec['shift']());}};_0x271c4f(++_0x194d2e);}(_0x4660,0x95));var _0x0466=function(_0x18b9c1,_0x1a9f5a){_0x18b9c1=_0x18b9c1-0x0;var _0x3e1a13=_0x4660[_0x18b9c1];return _0x3e1a13;};'use strict';var Sequelize=require(_0x0466('0x0'));module['exports']={'type':{'type':Sequelize[_0x0466('0x1')](_0x0466('0x2'),_0x0466('0x3'),_0x0466('0x4'),_0x0466('0x5'),_0x0466('0x6')),'defaultValue':_0x0466('0x2')},'content':{'type':Sequelize[_0x0466('0x7')]},'key':{'type':Sequelize[_0x0466('0x7')]},'keyType':{'type':Sequelize['ENUM']('string',_0x0466('0x3'),_0x0466('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x0466('0x7')]},'nameField':{'type':Sequelize[_0x0466('0x7')]},'customField':{'type':Sequelize[_0x0466('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index a11d349..b5627f9 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 _0x3946=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','SugarcrmField','rawAttributes','fieldName','type','filters','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','rows','catch','params','keys','includeAll','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','../../components/auth/service'];(function(_0x245545,_0x4983b3){var _0x106a5f=function(_0x278277){while(--_0x278277){_0x245545['push'](_0x245545['shift']());}};_0x106a5f(++_0x4983b3);}(_0x3946,0x153));var _0x6394=function(_0x5ce68f,_0x1c468d){_0x5ce68f=_0x5ce68f-0x0;var _0x2a7421=_0x3946[_0x5ce68f];return _0x2a7421;};'use strict';var emlformat=require(_0x6394('0x0'));var rimraf=require(_0x6394('0x1'));var zipdir=require(_0x6394('0x2'));var jsonpatch=require(_0x6394('0x3'));var rp=require(_0x6394('0x4'));var moment=require(_0x6394('0x5'));var BPromise=require(_0x6394('0x6'));var Mustache=require(_0x6394('0x7'));var util=require('util');var path=require('path');var sox=require(_0x6394('0x8'));var csv=require(_0x6394('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6394('0xa'));var _=require(_0x6394('0xb'));var squel=require(_0x6394('0xc'));var crypto=require(_0x6394('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6394('0x9'));var querystring=require(_0x6394('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6394('0xf'));var qs=require(_0x6394('0x10'));var as=require(_0x6394('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6394('0x12'))('api');var utils=require(_0x6394('0x13'));var config=require(_0x6394('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2cd976,_0x2e888c){_0x2e888c=_0x2e888c||0xcc;return function(_0x10912c){if(_0x10912c){return _0x2cd976[_0x6394('0x15')](_0x2e888c);}return _0x2cd976['status'](_0x2e888c)[_0x6394('0x16')]();};}function respondWithResult(_0x1e2f6e,_0x31c7b0){_0x31c7b0=_0x31c7b0||0xc8;return function(_0x170216){if(_0x170216){return _0x1e2f6e['status'](_0x31c7b0)[_0x6394('0x17')](_0x170216);}};}function respondWithFilteredResult(_0x5af9c5,_0x121ba2){return function(_0x400ecc){if(_0x400ecc){var _0x39062b=typeof _0x121ba2[_0x6394('0x18')]===_0x6394('0x19')&&typeof _0x121ba2[_0x6394('0x1a')]===_0x6394('0x19');var _0x495ae0=_0x400ecc[_0x6394('0x1b')];var _0x5508d7=_0x39062b?0x0:_0x121ba2['offset'];var _0x23b60d=_0x39062b?_0x400ecc[_0x6394('0x1b')]:_0x121ba2[_0x6394('0x18')]+_0x121ba2[_0x6394('0x1a')];var _0x14108c;if(_0x23b60d>=_0x495ae0){_0x23b60d=_0x495ae0;_0x14108c=0xc8;}else{_0x14108c=0xce;}_0x5af9c5[_0x6394('0x1c')](_0x14108c);return _0x5af9c5[_0x6394('0x1d')](_0x6394('0x1e'),_0x5508d7+'-'+_0x23b60d+'/'+_0x495ae0)[_0x6394('0x17')](_0x400ecc);}return null;};}function patchUpdates(_0x10dff5){return function(_0x5c772c){try{jsonpatch[_0x6394('0x1f')](_0x5c772c,_0x10dff5,!![]);}catch(_0x4d6ae6){return BPromise[_0x6394('0x20')](_0x4d6ae6);}return _0x5c772c[_0x6394('0x21')]();};}function saveUpdates(_0x25582a,_0x5e6a6a){return function(_0x4e895b){if(_0x4e895b){return _0x4e895b[_0x6394('0x22')](_0x25582a)[_0x6394('0x23')](function(_0x5136fd){return _0x5136fd;});}return null;};}function removeEntity(_0x2a3690,_0x5e1a85){return function(_0x5e38b8){if(_0x5e38b8){return _0x5e38b8[_0x6394('0x24')]()[_0x6394('0x23')](function(){_0x2a3690[_0x6394('0x1c')](0xcc)[_0x6394('0x16')]();});}};}function handleEntityNotFound(_0x40331,_0x145728){return function(_0x15eb69){if(!_0x15eb69){_0x40331[_0x6394('0x15')](0x194);}return _0x15eb69;};}function handleError(_0x27d13a,_0x18262b){_0x18262b=_0x18262b||0x1f4;return function(_0x55141c){logger[_0x6394('0x25')](_0x55141c[_0x6394('0x26')]);if(_0x55141c['name']){delete _0x55141c[_0x6394('0x27')];}_0x27d13a[_0x6394('0x1c')](_0x18262b)[_0x6394('0x28')](_0x55141c);};}exports['index']=function(_0x14b934,_0x52be50){var _0x2645d2={},_0x1476cb={},_0x521ab5={'count':0x0,'rows':[]};var _0x2f4426=_[_0x6394('0x29')](db[_0x6394('0x2a')][_0x6394('0x2b')],function(_0x46e6e7){return{'name':_0x46e6e7[_0x6394('0x2c')],'type':_0x46e6e7[_0x6394('0x2d')]['key']};});_0x1476cb['model']=_[_0x6394('0x29')](_0x2f4426,_0x6394('0x27'));_0x1476cb['query']=_['keys'](_0x14b934['query']);_0x1476cb[_0x6394('0x2e')]=_['intersection'](_0x1476cb['model'],_0x1476cb[_0x6394('0x2f')]);_0x2645d2['attributes']=_[_0x6394('0x30')](_0x1476cb[_0x6394('0x31')],qs[_0x6394('0x32')](_0x14b934[_0x6394('0x2f')][_0x6394('0x32')]));_0x2645d2[_0x6394('0x33')]=_0x2645d2[_0x6394('0x33')][_0x6394('0x34')]?_0x2645d2[_0x6394('0x33')]:_0x1476cb[_0x6394('0x31')];if(!_0x14b934[_0x6394('0x2f')][_0x6394('0x35')](_0x6394('0x36'))){_0x2645d2['limit']=qs[_0x6394('0x1a')](_0x14b934[_0x6394('0x2f')][_0x6394('0x1a')]);_0x2645d2[_0x6394('0x18')]=qs[_0x6394('0x18')](_0x14b934[_0x6394('0x2f')][_0x6394('0x18')]);}_0x2645d2[_0x6394('0x37')]=qs[_0x6394('0x38')](_0x14b934['query'][_0x6394('0x38')]);_0x2645d2[_0x6394('0x39')]=qs[_0x6394('0x2e')](_[_0x6394('0x3a')](_0x14b934['query'],_0x1476cb[_0x6394('0x2e')]),_0x2f4426);if(_0x14b934[_0x6394('0x2f')]['filter']){_0x2645d2[_0x6394('0x39')]=_[_0x6394('0x3b')](_0x2645d2[_0x6394('0x39')],{'$or':_[_0x6394('0x29')](_0x2f4426,function(_0xc34e07){if(_0xc34e07[_0x6394('0x2d')]!==_0x6394('0x3c')){var _0x4c8333={};_0x4c8333[_0xc34e07[_0x6394('0x27')]]={'$like':'%'+_0x14b934[_0x6394('0x2f')]['filter']+'%'};return _0x4c8333;}})});}_0x2645d2=_[_0x6394('0x3b')]({},_0x2645d2,_0x14b934[_0x6394('0x3d')]);var _0x441051={'where':_0x2645d2[_0x6394('0x39')]};return db[_0x6394('0x2a')][_0x6394('0x1b')](_0x441051)[_0x6394('0x23')](function(_0x3a2cfa){_0x521ab5[_0x6394('0x1b')]=_0x3a2cfa;if(_0x14b934[_0x6394('0x2f')]['includeAll']){_0x2645d2['include']=[{'all':!![]}];}return db['SugarcrmField']['findAll'](_0x2645d2);})[_0x6394('0x23')](function(_0x9cf577){_0x521ab5[_0x6394('0x3e')]=_0x9cf577;return _0x521ab5;})[_0x6394('0x23')](respondWithFilteredResult(_0x52be50,_0x2645d2))[_0x6394('0x3f')](handleError(_0x52be50,null));};exports['show']=function(_0x59e6a2,_0x32d174){var _0x522eff={'raw':!![],'where':{'id':_0x59e6a2[_0x6394('0x40')]['id']}},_0x347e4a={};_0x347e4a[_0x6394('0x31')]=_[_0x6394('0x41')](db[_0x6394('0x2a')][_0x6394('0x2b')]);_0x347e4a[_0x6394('0x2f')]=_['keys'](_0x59e6a2[_0x6394('0x2f')]);_0x347e4a[_0x6394('0x2e')]=_[_0x6394('0x30')](_0x347e4a[_0x6394('0x31')],_0x347e4a[_0x6394('0x2f')]);_0x522eff[_0x6394('0x33')]=_[_0x6394('0x30')](_0x347e4a['model'],qs[_0x6394('0x32')](_0x59e6a2[_0x6394('0x2f')][_0x6394('0x32')]));_0x522eff[_0x6394('0x33')]=_0x522eff[_0x6394('0x33')][_0x6394('0x34')]?_0x522eff[_0x6394('0x33')]:_0x347e4a['model'];if(_0x59e6a2[_0x6394('0x2f')][_0x6394('0x42')]){_0x522eff[_0x6394('0x43')]=[{'all':!![]}];}_0x522eff=_[_0x6394('0x3b')]({},_0x522eff,_0x59e6a2[_0x6394('0x3d')]);return db[_0x6394('0x2a')][_0x6394('0x44')](_0x522eff)['then'](handleEntityNotFound(_0x32d174,null))['then'](respondWithResult(_0x32d174,null))[_0x6394('0x3f')](handleError(_0x32d174,null));};exports[_0x6394('0x45')]=function(_0x3330fb,_0x19d396){return db[_0x6394('0x2a')][_0x6394('0x45')](_0x3330fb[_0x6394('0x46')],{})[_0x6394('0x23')](respondWithResult(_0x19d396,0xc9))['catch'](handleError(_0x19d396,null));};exports['update']=function(_0x49df6f,_0x644b7c){if(_0x49df6f[_0x6394('0x46')]['id']){delete _0x49df6f[_0x6394('0x46')]['id'];}return db[_0x6394('0x2a')][_0x6394('0x44')]({'where':{'id':_0x49df6f[_0x6394('0x40')]['id']}})[_0x6394('0x23')](handleEntityNotFound(_0x644b7c,null))[_0x6394('0x23')](saveUpdates(_0x49df6f[_0x6394('0x46')],null))[_0x6394('0x23')](respondWithResult(_0x644b7c,null))[_0x6394('0x3f')](handleError(_0x644b7c,null));};exports[_0x6394('0x24')]=function(_0x55cf14,_0x1fa8c2){return db[_0x6394('0x2a')][_0x6394('0x44')]({'where':{'id':_0x55cf14[_0x6394('0x40')]['id']}})[_0x6394('0x23')](handleEntityNotFound(_0x1fa8c2,null))[_0x6394('0x23')](removeEntity(_0x1fa8c2,null))[_0x6394('0x3f')](handleError(_0x1fa8c2,null));}; \ No newline at end of file +var _0x7c79=['../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','sendStatus','stack','name','send','index','map','SugarcrmField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','fields','find','body','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x514da6,_0x3b61d9){var _0x3a47e7=function(_0x14f081){while(--_0x14f081){_0x514da6['push'](_0x514da6['shift']());}};_0x3a47e7(++_0x3b61d9);}(_0x7c79,0x1a3));var _0x97c7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7c79[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x97c7('0x0'));var rimraf=require(_0x97c7('0x1'));var zipdir=require(_0x97c7('0x2'));var jsonpatch=require(_0x97c7('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x97c7('0x4'));var util=require(_0x97c7('0x5'));var path=require(_0x97c7('0x6'));var sox=require(_0x97c7('0x7'));var csv=require(_0x97c7('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x97c7('0x9'));var _=require(_0x97c7('0xa'));var squel=require(_0x97c7('0xb'));var crypto=require(_0x97c7('0xc'));var jsforce=require(_0x97c7('0xd'));var deskjs=require(_0x97c7('0xe'));var toCsv=require(_0x97c7('0x8'));var querystring=require(_0x97c7('0xf'));var Papa=require('papaparse');var Redis=require(_0x97c7('0x10'));var authService=require(_0x97c7('0x11'));var qs=require(_0x97c7('0x12'));var as=require(_0x97c7('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x97c7('0x14'))('api');var utils=require(_0x97c7('0x15'));var config=require(_0x97c7('0x16'));var licenseUtil=require(_0x97c7('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3be20a,_0x4b895b){_0x4b895b=_0x4b895b||0xcc;return function(_0x474178){if(_0x474178){return _0x3be20a['sendStatus'](_0x4b895b);}return _0x3be20a[_0x97c7('0x18')](_0x4b895b)['end']();};}function respondWithResult(_0x56e76b,_0x30caac){_0x30caac=_0x30caac||0xc8;return function(_0x172497){if(_0x172497){return _0x56e76b[_0x97c7('0x18')](_0x30caac)[_0x97c7('0x19')](_0x172497);}};}function respondWithFilteredResult(_0x4d2242,_0x8a22c7){return function(_0x3263c0){if(_0x3263c0){var _0x113615=typeof _0x8a22c7[_0x97c7('0x1a')]===_0x97c7('0x1b')&&typeof _0x8a22c7[_0x97c7('0x1c')]==='undefined';var _0x18de5b=_0x3263c0[_0x97c7('0x1d')];var _0x3906c7=_0x113615?0x0:_0x8a22c7[_0x97c7('0x1a')];var _0x5c3899=_0x113615?_0x3263c0[_0x97c7('0x1d')]:_0x8a22c7[_0x97c7('0x1a')]+_0x8a22c7[_0x97c7('0x1c')];var _0x9f428c;if(_0x5c3899>=_0x18de5b){_0x5c3899=_0x18de5b;_0x9f428c=0xc8;}else{_0x9f428c=0xce;}_0x4d2242[_0x97c7('0x18')](_0x9f428c);return _0x4d2242[_0x97c7('0x1e')](_0x97c7('0x1f'),_0x3906c7+'-'+_0x5c3899+'/'+_0x18de5b)['json'](_0x3263c0);}return null;};}function patchUpdates(_0x4d7536){return function(_0x7c6a74){try{jsonpatch['apply'](_0x7c6a74,_0x4d7536,!![]);}catch(_0x1a0f05){return BPromise[_0x97c7('0x20')](_0x1a0f05);}return _0x7c6a74[_0x97c7('0x21')]();};}function saveUpdates(_0x27f2ee,_0x44acc3){return function(_0x4b3d3f){if(_0x4b3d3f){return _0x4b3d3f[_0x97c7('0x22')](_0x27f2ee)[_0x97c7('0x23')](function(_0x187db4){return _0x187db4;});}return null;};}function removeEntity(_0x559dcc,_0x56974d){return function(_0x13e63e){if(_0x13e63e){return _0x13e63e[_0x97c7('0x24')]()['then'](function(){_0x559dcc[_0x97c7('0x18')](0xcc)[_0x97c7('0x25')]();});}};}function handleEntityNotFound(_0x271d24,_0x416138){return function(_0x273798){if(!_0x273798){_0x271d24[_0x97c7('0x26')](0x194);}return _0x273798;};}function handleError(_0x217dcb,_0xa41d55){_0xa41d55=_0xa41d55||0x1f4;return function(_0x461dc7){logger['error'](_0x461dc7[_0x97c7('0x27')]);if(_0x461dc7[_0x97c7('0x28')]){delete _0x461dc7[_0x97c7('0x28')];}_0x217dcb['status'](_0xa41d55)[_0x97c7('0x29')](_0x461dc7);};}exports[_0x97c7('0x2a')]=function(_0x30b238,_0x4c2481){var _0x8fcd44={},_0x14d027={},_0x54e787={'count':0x0,'rows':[]};var _0xb50258=_[_0x97c7('0x2b')](db[_0x97c7('0x2c')][_0x97c7('0x2d')],function(_0x4c7d2f){return{'name':_0x4c7d2f[_0x97c7('0x2e')],'type':_0x4c7d2f[_0x97c7('0x2f')][_0x97c7('0x30')]};});_0x14d027[_0x97c7('0x31')]=_[_0x97c7('0x2b')](_0xb50258,_0x97c7('0x28'));_0x14d027[_0x97c7('0x32')]=_[_0x97c7('0x33')](_0x30b238[_0x97c7('0x32')]);_0x14d027[_0x97c7('0x34')]=_[_0x97c7('0x35')](_0x14d027['model'],_0x14d027[_0x97c7('0x32')]);_0x8fcd44['attributes']=_[_0x97c7('0x35')](_0x14d027[_0x97c7('0x31')],qs['fields'](_0x30b238[_0x97c7('0x32')]['fields']));_0x8fcd44['attributes']=_0x8fcd44[_0x97c7('0x36')][_0x97c7('0x37')]?_0x8fcd44['attributes']:_0x14d027[_0x97c7('0x31')];if(!_0x30b238[_0x97c7('0x32')][_0x97c7('0x38')]('nolimit')){_0x8fcd44[_0x97c7('0x1c')]=qs['limit'](_0x30b238[_0x97c7('0x32')][_0x97c7('0x1c')]);_0x8fcd44[_0x97c7('0x1a')]=qs[_0x97c7('0x1a')](_0x30b238[_0x97c7('0x32')][_0x97c7('0x1a')]);}_0x8fcd44[_0x97c7('0x39')]=qs[_0x97c7('0x3a')](_0x30b238[_0x97c7('0x32')][_0x97c7('0x3a')]);_0x8fcd44['where']=qs['filters'](_[_0x97c7('0x3b')](_0x30b238['query'],_0x14d027[_0x97c7('0x34')]),_0xb50258);if(_0x30b238[_0x97c7('0x32')]['filter']){_0x8fcd44[_0x97c7('0x3c')]=_[_0x97c7('0x3d')](_0x8fcd44[_0x97c7('0x3c')],{'$or':_[_0x97c7('0x2b')](_0xb50258,function(_0x35eae1){if(_0x35eae1[_0x97c7('0x2f')]!==_0x97c7('0x3e')){var _0x2bcee1={};_0x2bcee1[_0x35eae1['name']]={'$like':'%'+_0x30b238['query']['filter']+'%'};return _0x2bcee1;}})});}_0x8fcd44=_[_0x97c7('0x3d')]({},_0x8fcd44,_0x30b238[_0x97c7('0x3f')]);var _0x69638a={'where':_0x8fcd44[_0x97c7('0x3c')]};return db['SugarcrmField'][_0x97c7('0x1d')](_0x69638a)[_0x97c7('0x23')](function(_0x5a32e2){_0x54e787['count']=_0x5a32e2;if(_0x30b238['query'][_0x97c7('0x40')]){_0x8fcd44[_0x97c7('0x41')]=[{'all':!![]}];}return db[_0x97c7('0x2c')][_0x97c7('0x42')](_0x8fcd44);})[_0x97c7('0x23')](function(_0x309a45){_0x54e787[_0x97c7('0x43')]=_0x309a45;return _0x54e787;})['then'](respondWithFilteredResult(_0x4c2481,_0x8fcd44))[_0x97c7('0x44')](handleError(_0x4c2481,null));};exports['show']=function(_0x5b1baa,_0xf758ad){var _0x8e71f3={'raw':!![],'where':{'id':_0x5b1baa[_0x97c7('0x45')]['id']}},_0x29e63a={};_0x29e63a[_0x97c7('0x31')]=_[_0x97c7('0x33')](db[_0x97c7('0x2c')][_0x97c7('0x2d')]);_0x29e63a['query']=_[_0x97c7('0x33')](_0x5b1baa[_0x97c7('0x32')]);_0x29e63a[_0x97c7('0x34')]=_['intersection'](_0x29e63a['model'],_0x29e63a[_0x97c7('0x32')]);_0x8e71f3[_0x97c7('0x36')]=_[_0x97c7('0x35')](_0x29e63a[_0x97c7('0x31')],qs[_0x97c7('0x46')](_0x5b1baa[_0x97c7('0x32')][_0x97c7('0x46')]));_0x8e71f3[_0x97c7('0x36')]=_0x8e71f3[_0x97c7('0x36')]['length']?_0x8e71f3[_0x97c7('0x36')]:_0x29e63a['model'];if(_0x5b1baa['query'][_0x97c7('0x40')]){_0x8e71f3[_0x97c7('0x41')]=[{'all':!![]}];}_0x8e71f3=_['merge']({},_0x8e71f3,_0x5b1baa[_0x97c7('0x3f')]);return db[_0x97c7('0x2c')][_0x97c7('0x47')](_0x8e71f3)['then'](handleEntityNotFound(_0xf758ad,null))[_0x97c7('0x23')](respondWithResult(_0xf758ad,null))['catch'](handleError(_0xf758ad,null));};exports['create']=function(_0x48b1bb,_0xbcd0e1){return db[_0x97c7('0x2c')]['create'](_0x48b1bb[_0x97c7('0x48')],{})['then'](respondWithResult(_0xbcd0e1,0xc9))[_0x97c7('0x44')](handleError(_0xbcd0e1,null));};exports[_0x97c7('0x22')]=function(_0x4183e4,_0x33b988){if(_0x4183e4[_0x97c7('0x48')]['id']){delete _0x4183e4[_0x97c7('0x48')]['id'];}return db['SugarcrmField'][_0x97c7('0x47')]({'where':{'id':_0x4183e4[_0x97c7('0x45')]['id']}})['then'](handleEntityNotFound(_0x33b988,null))['then'](saveUpdates(_0x4183e4[_0x97c7('0x48')],null))['then'](respondWithResult(_0x33b988,null))['catch'](handleError(_0x33b988,null));};exports['destroy']=function(_0x50c1df,_0x182588){return db[_0x97c7('0x2c')][_0x97c7('0x47')]({'where':{'id':_0x50c1df[_0x97c7('0x45')]['id']}})['then'](handleEntityNotFound(_0x182588,null))['then'](removeEntity(_0x182588,null))[_0x97c7('0x44')](handleError(_0x182588,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 407fa5c..df13258 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 _0xd05b=['path','rimraf','../../config/environment','./intSugarcrmField.attributes','define','int_sugarcrm_fields','sugarcrm_unique_index','idField','lodash','util','moment','request-promise'];(function(_0x4653f7,_0x3d3ae3){var _0x5454da=function(_0x448f55){while(--_0x448f55){_0x4653f7['push'](_0x4653f7['shift']());}};_0x5454da(++_0x3d3ae3);}(_0xd05b,0x1b8));var _0xbd05=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0xd05b[_0x243b2f];return _0xcb3c2d;};'use strict';var _=require(_0xbd05('0x0'));var util=require(_0xbd05('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbd05('0x2'));var BPromise=require('bluebird');var rp=require(_0xbd05('0x3'));var fs=require('fs');var path=require(_0xbd05('0x4'));var rimraf=require(_0xbd05('0x5'));var config=require(_0xbd05('0x6'));var attributes=require(_0xbd05('0x7'));module['exports']=function(_0x4711ad,_0x5c0341){return _0x4711ad[_0xbd05('0x8')]('SugarcrmField',attributes,{'tableName':_0xbd05('0x9'),'paranoid':![],'indexes':[{'name':_0xbd05('0xa'),'fields':[_0xbd05('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xccc0=['request-promise','path','rimraf','../../config/environment','define','int_sugarcrm_fields','idField','FieldId','lodash','api','moment','bluebird'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0xccc0,0xe0));var _0x0ccc=function(_0x26b123,_0x26288b){_0x26b123=_0x26b123-0x0;var _0x408ba7=_0xccc0[_0x26b123];return _0x408ba7;};'use strict';var _=require(_0x0ccc('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0ccc('0x1'));var moment=require(_0x0ccc('0x2'));var BPromise=require(_0x0ccc('0x3'));var rp=require(_0x0ccc('0x4'));var fs=require('fs');var path=require(_0x0ccc('0x5'));var rimraf=require(_0x0ccc('0x6'));var config=require(_0x0ccc('0x7'));var attributes=require('./intSugarcrmField.attributes');module['exports']=function(_0x4675ce,_0xf12742){return _0x4675ce[_0x0ccc('0x8')]('SugarcrmField',attributes,{'tableName':_0x0ccc('0x9'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0x0ccc('0xa'),_0x0ccc('0xb')],'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 846d17d..c1c5745 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 _0xe242=['client','request','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x323a71,_0x163285){var _0xfd2d1b=function(_0x2a2aad){while(--_0x2a2aad){_0x323a71['push'](_0x323a71['shift']());}};_0xfd2d1b(++_0x163285);}(_0xe242,0xdc));var _0x2e24=function(_0x5cfbd2,_0x18bf52){_0x5cfbd2=_0x5cfbd2-0x0;var _0x40d47d=_0xe242[_0x5cfbd2];return _0x40d47d;};'use strict';var _=require('lodash');var util=require(_0x2e24('0x0'));var moment=require('moment');var BPromise=require(_0x2e24('0x1'));var rs=require(_0x2e24('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2e24('0x3'));var logger=require(_0x2e24('0x4'))(_0x2e24('0x5'));var config=require(_0x2e24('0x6'));var jayson=require(_0x2e24('0x7'));var client=jayson[_0x2e24('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x39aa17,_0x43673e,_0x3af744){return new BPromise(function(_0x535f3e,_0x13e0ec){return client[_0x2e24('0x9')](_0x39aa17,_0x3af744)['then'](function(_0xef6513){logger[_0x2e24('0xa')](_0x2e24('0xb'),_0x43673e,_0x2e24('0xc'));logger[_0x2e24('0xd')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x43673e,_0x2e24('0xc'),JSON[_0x2e24('0xe')](_0xef6513));if(_0xef6513[_0x2e24('0xf')]){if(_0xef6513[_0x2e24('0xf')][_0x2e24('0x10')]===0x1f4){logger[_0x2e24('0xf')](_0x2e24('0xb'),_0x43673e,_0xef6513[_0x2e24('0xf')][_0x2e24('0x11')]);return _0x13e0ec(_0xef6513[_0x2e24('0xf')][_0x2e24('0x11')]);}logger[_0x2e24('0xf')](_0x2e24('0xb'),_0x43673e,_0xef6513['error'][_0x2e24('0x11')]);return _0x535f3e(_0xef6513[_0x2e24('0xf')][_0x2e24('0x11')]);}else{logger[_0x2e24('0xa')](_0x2e24('0xb'),_0x43673e,_0x2e24('0xc'));_0x535f3e(_0xef6513['result'][_0x2e24('0x11')]);}})[_0x2e24('0x12')](function(_0x195c02){logger[_0x2e24('0xf')](_0x2e24('0xb'),_0x43673e,_0x195c02);_0x13e0ec(_0x195c02);});});} \ No newline at end of file +var _0x5ff3=['debug','stringify','error','code','message','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','info','SugarcrmField,\x20%s,\x20%s','request\x20sent'];(function(_0x29e7de,_0x2cb5ec){var _0x19edbd=function(_0x47771b){while(--_0x47771b){_0x29e7de['push'](_0x29e7de['shift']());}};_0x19edbd(++_0x2cb5ec);}(_0x5ff3,0x195));var _0x35ff=function(_0xbacd15,_0x5a9b30){_0xbacd15=_0xbacd15-0x0;var _0x4675bd=_0x5ff3[_0xbacd15];return _0x4675bd;};'use strict';var _=require('lodash');var util=require(_0x35ff('0x0'));var moment=require('moment');var BPromise=require(_0x35ff('0x1'));var rs=require(_0x35ff('0x2'));var fs=require('fs');var Redis=require(_0x35ff('0x3'));var db=require(_0x35ff('0x4'))['db'];var utils=require(_0x35ff('0x5'));var logger=require(_0x35ff('0x6'))(_0x35ff('0x7'));var config=require(_0x35ff('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x35ff('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x80a7ea,_0x453f1d,_0x467eb4){return new BPromise(function(_0x374683,_0x5a045f){return client['request'](_0x80a7ea,_0x467eb4)['then'](function(_0x2c464e){logger[_0x35ff('0xa')](_0x35ff('0xb'),_0x453f1d,_0x35ff('0xc'));logger[_0x35ff('0xd')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x453f1d,'request\x20sent',JSON[_0x35ff('0xe')](_0x2c464e));if(_0x2c464e['error']){if(_0x2c464e[_0x35ff('0xf')][_0x35ff('0x10')]===0x1f4){logger[_0x35ff('0xf')](_0x35ff('0xb'),_0x453f1d,_0x2c464e[_0x35ff('0xf')][_0x35ff('0x11')]);return _0x5a045f(_0x2c464e[_0x35ff('0xf')][_0x35ff('0x11')]);}logger['error'](_0x35ff('0xb'),_0x453f1d,_0x2c464e[_0x35ff('0xf')][_0x35ff('0x11')]);return _0x374683(_0x2c464e['error'][_0x35ff('0x11')]);}else{logger['info'](_0x35ff('0xb'),_0x453f1d,_0x35ff('0xc'));_0x374683(_0x2c464e[_0x35ff('0x12')]['message']);}})['catch'](function(_0x336f93){logger[_0x35ff('0xf')](_0x35ff('0xb'),_0x453f1d,_0x336f93);_0x5a045f(_0x336f93);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 0748ab9..b560d70 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 _0xeb79=['post','create','addConfiguration','put','/:id','update','delete','destroy','exports','path','express','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','show','/:id/configurations','getConfigurations','getFields'];(function(_0x105297,_0x5bc77b){var _0x122470=function(_0x114139){while(--_0x114139){_0x105297['push'](_0x105297['shift']());}};_0x122470(++_0x5bc77b);}(_0xeb79,0x87));var _0x9eb7=function(_0x4b047c,_0xaa111d){_0x4b047c=_0x4b047c-0x0;var _0xedbbf4=_0xeb79[_0x4b047c];return _0xedbbf4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9eb7('0x0'));var timeout=require('connect-timeout');var express=require(_0x9eb7('0x1'));var router=express['Router']();var fs_extra=require(_0x9eb7('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x9eb7('0x3'));var config=require(_0x9eb7('0x4'));var controller=require(_0x9eb7('0x5'));router[_0x9eb7('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9eb7('0x6')]('/:id',auth[_0x9eb7('0x7')](),controller[_0x9eb7('0x8')]);router[_0x9eb7('0x6')](_0x9eb7('0x9'),auth[_0x9eb7('0x7')](),controller[_0x9eb7('0xa')]);router[_0x9eb7('0x6')]('/:id/fields',auth[_0x9eb7('0x7')](),controller[_0x9eb7('0xb')]);router[_0x9eb7('0xc')]('/',auth[_0x9eb7('0x7')](),controller[_0x9eb7('0xd')]);router[_0x9eb7('0xc')](_0x9eb7('0x9'),auth[_0x9eb7('0x7')](),controller[_0x9eb7('0xe')]);router[_0x9eb7('0xf')](_0x9eb7('0x10'),auth[_0x9eb7('0x7')](),controller[_0x9eb7('0x11')]);router[_0x9eb7('0x12')](_0x9eb7('0x10'),auth['isAuthenticated'](),controller[_0x9eb7('0x13')]);module[_0x9eb7('0x14')]=router; \ No newline at end of file +var _0xd0ba=['index','/:id','getConfigurations','/:id/fields','post','create','addConfiguration','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x4a34e4,_0x3ab227){var _0x3f14e3=function(_0x3790ea){while(--_0x3790ea){_0x4a34e4['push'](_0x4a34e4['shift']());}};_0x3f14e3(++_0x3ab227);}(_0xd0ba,0x17c));var _0xad0b=function(_0x1030ce,_0xbe3f74){_0x1030ce=_0x1030ce-0x0;var _0x3367fd=_0xd0ba[_0x1030ce];return _0x3367fd;};'use strict';var multer=require('multer');var util=require(_0xad0b('0x0'));var path=require(_0xad0b('0x1'));var timeout=require(_0xad0b('0x2'));var express=require(_0xad0b('0x3'));var router=express[_0xad0b('0x4')]();var fs_extra=require(_0xad0b('0x5'));var auth=require(_0xad0b('0x6'));var interaction=require(_0xad0b('0x7'));var config=require(_0xad0b('0x8'));var controller=require('./intVtigerAccount.controller');router[_0xad0b('0x9')]('/',auth[_0xad0b('0xa')](),controller[_0xad0b('0xb')]);router['get'](_0xad0b('0xc'),auth[_0xad0b('0xa')](),controller['show']);router['get']('/:id/configurations',auth['isAuthenticated'](),controller[_0xad0b('0xd')]);router['get'](_0xad0b('0xe'),auth[_0xad0b('0xa')](),controller['getFields']);router[_0xad0b('0xf')]('/',auth[_0xad0b('0xa')](),controller[_0xad0b('0x10')]);router[_0xad0b('0xf')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xad0b('0x11')]);router[_0xad0b('0x12')](_0xad0b('0xc'),auth[_0xad0b('0xa')](),controller[_0xad0b('0x13')]);router[_0xad0b('0x14')](_0xad0b('0xc'),auth[_0xad0b('0xa')](),controller[_0xad0b('0x15')]);module[_0xad0b('0x16')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index c6cf24c..fa30768 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 _0x41ae=['exports','STRING','HelpDesk','sequelize'];(function(_0x470925,_0x3c14fc){var _0x53a5a3=function(_0x38facc){while(--_0x38facc){_0x470925['push'](_0x470925['shift']());}};_0x53a5a3(++_0x3c14fc);}(_0x41ae,0x1af));var _0xe41a=function(_0x35940f,_0x1a8d9a){_0x35940f=_0x35940f-0x0;var _0x3ca801=_0x41ae[_0x35940f];return _0x3ca801;};'use strict';var Sequelize=require(_0xe41a('0x0'));module[_0xe41a('0x1')]={'name':{'type':Sequelize[_0xe41a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xe41a('0x2')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xe41a('0x3')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xe41a('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xe41a('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x2cb4=['sequelize','STRING','HelpDesk'];(function(_0x3c9b9b,_0x39e9ae){var _0x528a90=function(_0x59bcd3){while(--_0x59bcd3){_0x3c9b9b['push'](_0x3c9b9b['shift']());}};_0x528a90(++_0x39e9ae);}(_0x2cb4,0x69));var _0x42cb=function(_0x1f16de,_0x548eb9){_0x1f16de=_0x1f16de-0x0;var _0x36cd80=_0x2cb4[_0x1f16de];return _0x36cd80;};'use strict';var Sequelize=require(_0x42cb('0x0'));module['exports']={'name':{'type':Sequelize[_0x42cb('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x42cb('0x1')]},'username':{'type':Sequelize[_0x42cb('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x42cb('0x1')],'allowNull':![],'defaultValue':_0x42cb('0x2')},'remoteUri':{'type':Sequelize[_0x42cb('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x42cb('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x42cb('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 2bd68d5..92af39b 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 _0xaa6c=['query','intersection','attributes','fields','length','nolimit','sort','pick','where','VIRTUAL','name','merge','options','VtigerAccount','includeAll','findAll','catch','params','keys','filters','include','find','create','body','getConfigurations','findOne','VtigerConfiguration','filter','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','md5','description','moduleName','serverUrl','username','accessKey','remoteUri','slice','substring','format','GET','getchallenge','success','POST','login','token','describe','result','sessionName','autogenerated','false','label','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','getFields,\x20%s,\x20%s,\x20%s','statusCode','eml-format','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../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','save','update','destroy','then','end','error','stack','send','index','rawAttributes','fieldName','type','key','model','map'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xaa6c,0xb8));var _0xcaa6=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0xaa6c[_0x2e4aa2];return _0x5e6092;};'use strict';var emlformat=require(_0xcaa6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcaa6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcaa6('0x2'));var moment=require(_0xcaa6('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xcaa6('0x4'));var util=require(_0xcaa6('0x5'));var path=require(_0xcaa6('0x6'));var sox=require('sox');var csv=require(_0xcaa6('0x7'));var ejs=require(_0xcaa6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xcaa6('0x9'));var crypto=require(_0xcaa6('0xa'));var jsforce=require(_0xcaa6('0xb'));var deskjs=require(_0xcaa6('0xc'));var toCsv=require(_0xcaa6('0x7'));var querystring=require('querystring');var Papa=require(_0xcaa6('0xd'));var Redis=require('ioredis');var authService=require(_0xcaa6('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xcaa6('0xf'));var hardwareService=require(_0xcaa6('0x10'));var logger=require(_0xcaa6('0x11'))(_0xcaa6('0x12'));var utils=require(_0xcaa6('0x13'));var config=require(_0xcaa6('0x14'));var licenseUtil=require(_0xcaa6('0x15'));var db=require(_0xcaa6('0x16'))['db'];var integrations=require(_0xcaa6('0x17'));function respondWithStatusCode(_0x1e7f77,_0x5d7c9c){_0x5d7c9c=_0x5d7c9c||0xcc;return function(_0x414e92){if(_0x414e92){return _0x1e7f77[_0xcaa6('0x18')](_0x5d7c9c);}return _0x1e7f77[_0xcaa6('0x19')](_0x5d7c9c)['end']();};}function respondWithResult(_0x145c33,_0x928530){_0x928530=_0x928530||0xc8;return function(_0x3594fe){if(_0x3594fe){return _0x145c33['status'](_0x928530)[_0xcaa6('0x1a')](_0x3594fe);}};}function respondWithFilteredResult(_0x43fbe7,_0x5a4f2b){return function(_0x54d093){if(_0x54d093){var _0x31a2db=typeof _0x5a4f2b[_0xcaa6('0x1b')]===_0xcaa6('0x1c')&&typeof _0x5a4f2b[_0xcaa6('0x1d')]===_0xcaa6('0x1c');var _0x33b03b=_0x54d093[_0xcaa6('0x1e')];var _0x47d8d1=_0x31a2db?0x0:_0x5a4f2b[_0xcaa6('0x1b')];var _0x269752=_0x31a2db?_0x54d093[_0xcaa6('0x1e')]:_0x5a4f2b[_0xcaa6('0x1b')]+_0x5a4f2b[_0xcaa6('0x1d')];var _0x462530;if(_0x269752>=_0x33b03b){_0x269752=_0x33b03b;_0x462530=0xc8;}else{_0x462530=0xce;}_0x43fbe7[_0xcaa6('0x19')](_0x462530);return _0x43fbe7[_0xcaa6('0x1f')](_0xcaa6('0x20'),_0x47d8d1+'-'+_0x269752+'/'+_0x33b03b)[_0xcaa6('0x1a')](_0x54d093);}return null;};}function patchUpdates(_0x47bdd4){return function(_0x4a0a03){try{jsonpatch[_0xcaa6('0x21')](_0x4a0a03,_0x47bdd4,!![]);}catch(_0x4c44ff){return BPromise[_0xcaa6('0x22')](_0x4c44ff);}return _0x4a0a03[_0xcaa6('0x23')]();};}function saveUpdates(_0x2038d3,_0xc2d647){return function(_0x49e1a5){if(_0x49e1a5){return _0x49e1a5[_0xcaa6('0x24')](_0x2038d3)['then'](function(_0x585048){return _0x585048;});}return null;};}function removeEntity(_0x224054,_0x5ba638){return function(_0x56962f){if(_0x56962f){return _0x56962f[_0xcaa6('0x25')]()[_0xcaa6('0x26')](function(){_0x224054[_0xcaa6('0x19')](0xcc)[_0xcaa6('0x27')]();});}};}function handleEntityNotFound(_0x22d655,_0x342235){return function(_0x335f77){if(!_0x335f77){_0x22d655[_0xcaa6('0x18')](0x194);}return _0x335f77;};}function handleError(_0x22d9ee,_0x438ed1){_0x438ed1=_0x438ed1||0x1f4;return function(_0x38fb1d){logger[_0xcaa6('0x28')](_0x38fb1d[_0xcaa6('0x29')]);if(_0x38fb1d['name']){delete _0x38fb1d['name'];}_0x22d9ee[_0xcaa6('0x19')](_0x438ed1)[_0xcaa6('0x2a')](_0x38fb1d);};}exports[_0xcaa6('0x2b')]=function(_0x52ed63,_0x455f27){var _0x991919={},_0x58f4f6={},_0x547e70={'count':0x0,'rows':[]};var _0x11b1bd=_['map'](db['VtigerAccount'][_0xcaa6('0x2c')],function(_0x3c1ce1){return{'name':_0x3c1ce1[_0xcaa6('0x2d')],'type':_0x3c1ce1[_0xcaa6('0x2e')][_0xcaa6('0x2f')]};});_0x58f4f6[_0xcaa6('0x30')]=_[_0xcaa6('0x31')](_0x11b1bd,'name');_0x58f4f6[_0xcaa6('0x32')]=_['keys'](_0x52ed63[_0xcaa6('0x32')]);_0x58f4f6['filters']=_[_0xcaa6('0x33')](_0x58f4f6[_0xcaa6('0x30')],_0x58f4f6[_0xcaa6('0x32')]);_0x991919[_0xcaa6('0x34')]=_['intersection'](_0x58f4f6[_0xcaa6('0x30')],qs[_0xcaa6('0x35')](_0x52ed63[_0xcaa6('0x32')][_0xcaa6('0x35')]));_0x991919['attributes']=_0x991919[_0xcaa6('0x34')][_0xcaa6('0x36')]?_0x991919[_0xcaa6('0x34')]:_0x58f4f6[_0xcaa6('0x30')];if(!_0x52ed63['query']['hasOwnProperty'](_0xcaa6('0x37'))){_0x991919[_0xcaa6('0x1d')]=qs[_0xcaa6('0x1d')](_0x52ed63['query'][_0xcaa6('0x1d')]);_0x991919['offset']=qs[_0xcaa6('0x1b')](_0x52ed63[_0xcaa6('0x32')][_0xcaa6('0x1b')]);}_0x991919['order']=qs[_0xcaa6('0x38')](_0x52ed63['query'][_0xcaa6('0x38')]);_0x991919['where']=qs['filters'](_[_0xcaa6('0x39')](_0x52ed63[_0xcaa6('0x32')],_0x58f4f6['filters']),_0x11b1bd);if(_0x52ed63[_0xcaa6('0x32')]['filter']){_0x991919[_0xcaa6('0x3a')]=_['merge'](_0x991919[_0xcaa6('0x3a')],{'$or':_[_0xcaa6('0x31')](_0x11b1bd,function(_0x84f139){if(_0x84f139[_0xcaa6('0x2e')]!==_0xcaa6('0x3b')){var _0x1b5d73={};_0x1b5d73[_0x84f139[_0xcaa6('0x3c')]]={'$like':'%'+_0x52ed63[_0xcaa6('0x32')]['filter']+'%'};return _0x1b5d73;}})});}_0x991919=_[_0xcaa6('0x3d')]({},_0x991919,_0x52ed63[_0xcaa6('0x3e')]);var _0x55ffb6={'where':_0x991919[_0xcaa6('0x3a')]};return db[_0xcaa6('0x3f')][_0xcaa6('0x1e')](_0x55ffb6)['then'](function(_0x488288){_0x547e70['count']=_0x488288;if(_0x52ed63[_0xcaa6('0x32')][_0xcaa6('0x40')]){_0x991919['include']=[{'all':!![]}];}return db[_0xcaa6('0x3f')][_0xcaa6('0x41')](_0x991919);})[_0xcaa6('0x26')](function(_0x206294){_0x547e70['rows']=_0x206294;return _0x547e70;})[_0xcaa6('0x26')](respondWithFilteredResult(_0x455f27,_0x991919))[_0xcaa6('0x42')](handleError(_0x455f27,null));};exports['show']=function(_0x39e6cc,_0x4f7d51){var _0x53e5f2={'raw':![],'where':{'id':_0x39e6cc[_0xcaa6('0x43')]['id']}},_0x84fd81={};_0x84fd81[_0xcaa6('0x30')]=_[_0xcaa6('0x44')](db[_0xcaa6('0x3f')]['rawAttributes']);_0x84fd81['query']=_['keys'](_0x39e6cc[_0xcaa6('0x32')]);_0x84fd81[_0xcaa6('0x45')]=_['intersection'](_0x84fd81[_0xcaa6('0x30')],_0x84fd81[_0xcaa6('0x32')]);_0x53e5f2[_0xcaa6('0x34')]=_['intersection'](_0x84fd81['model'],qs[_0xcaa6('0x35')](_0x39e6cc[_0xcaa6('0x32')][_0xcaa6('0x35')]));_0x53e5f2[_0xcaa6('0x34')]=_0x53e5f2[_0xcaa6('0x34')][_0xcaa6('0x36')]?_0x53e5f2[_0xcaa6('0x34')]:_0x84fd81['model'];if(_0x39e6cc[_0xcaa6('0x32')][_0xcaa6('0x40')]){_0x53e5f2[_0xcaa6('0x46')]=[{'all':!![]}];}_0x53e5f2=_[_0xcaa6('0x3d')]({},_0x53e5f2,_0x39e6cc[_0xcaa6('0x3e')]);return db['VtigerAccount'][_0xcaa6('0x47')](_0x53e5f2)[_0xcaa6('0x26')](handleEntityNotFound(_0x4f7d51,null))[_0xcaa6('0x26')](respondWithResult(_0x4f7d51,null))['catch'](handleError(_0x4f7d51,null));};exports[_0xcaa6('0x48')]=function(_0x11274e,_0x4140d2){return db['VtigerAccount'][_0xcaa6('0x48')](_0x11274e[_0xcaa6('0x49')],{})[_0xcaa6('0x26')](respondWithResult(_0x4140d2,0xc9))[_0xcaa6('0x42')](handleError(_0x4140d2,null));};exports[_0xcaa6('0x24')]=function(_0x151e6b,_0x9cdc2b){if(_0x151e6b[_0xcaa6('0x49')]['id']){delete _0x151e6b['body']['id'];}return db[_0xcaa6('0x3f')][_0xcaa6('0x47')]({'where':{'id':_0x151e6b['params']['id']}})[_0xcaa6('0x26')](handleEntityNotFound(_0x9cdc2b,null))['then'](saveUpdates(_0x151e6b[_0xcaa6('0x49')],null))[_0xcaa6('0x26')](respondWithResult(_0x9cdc2b,null))['catch'](handleError(_0x9cdc2b,null));};exports[_0xcaa6('0x25')]=function(_0x26a65a,_0x5bc8b7){return db[_0xcaa6('0x3f')][_0xcaa6('0x47')]({'where':{'id':_0x26a65a[_0xcaa6('0x43')]['id']}})['then'](handleEntityNotFound(_0x5bc8b7,null))[_0xcaa6('0x26')](removeEntity(_0x5bc8b7,null))[_0xcaa6('0x42')](handleError(_0x5bc8b7,null));};exports[_0xcaa6('0x4a')]=function(_0x1d3ce8,_0xf8097a,_0x20d5ef){var _0x3081f6={};var _0x22006c={};var _0x319900;var _0x49ae2a;return db[_0xcaa6('0x3f')][_0xcaa6('0x4b')]({'where':{'id':_0x1d3ce8['params']['id']}})[_0xcaa6('0x26')](handleEntityNotFound(_0xf8097a,null))['then'](function(_0x53b3d4){if(_0x53b3d4){_0x319900=_0x53b3d4;_0x22006c[_0xcaa6('0x30')]=_[_0xcaa6('0x44')](db[_0xcaa6('0x4c')][_0xcaa6('0x2c')]);_0x22006c[_0xcaa6('0x32')]=_['keys'](_0x1d3ce8['query']);_0x22006c[_0xcaa6('0x45')]=_[_0xcaa6('0x33')](_0x22006c[_0xcaa6('0x30')],_0x22006c[_0xcaa6('0x32')]);_0x3081f6[_0xcaa6('0x34')]=_[_0xcaa6('0x33')](_0x22006c['model'],qs['fields'](_0x1d3ce8[_0xcaa6('0x32')][_0xcaa6('0x35')]));_0x3081f6[_0xcaa6('0x34')]=_0x3081f6[_0xcaa6('0x34')][_0xcaa6('0x36')]?_0x3081f6[_0xcaa6('0x34')]:_0x22006c['model'];_0x3081f6['order']=qs['sort'](_0x1d3ce8[_0xcaa6('0x32')][_0xcaa6('0x38')]);_0x3081f6[_0xcaa6('0x3a')]=qs[_0xcaa6('0x45')](_[_0xcaa6('0x39')](_0x1d3ce8[_0xcaa6('0x32')],_0x22006c[_0xcaa6('0x45')]));if(_0x1d3ce8['query']['filter']){_0x3081f6[_0xcaa6('0x3a')]=_[_0xcaa6('0x3d')](_0x3081f6['where'],{'$or':_['map'](_0x3081f6[_0xcaa6('0x34')],function(_0x3349e1){var _0x5d71a8={};_0x5d71a8[_0x3349e1]={'$like':'%'+_0x1d3ce8[_0xcaa6('0x32')][_0xcaa6('0x4d')]+'%'};return _0x5d71a8;})});}_0x3081f6=_['merge']({},_0x3081f6,_0x1d3ce8[_0xcaa6('0x3e')]);return _0x319900[_0xcaa6('0x4a')](_0x3081f6);}})[_0xcaa6('0x26')](function(_0x191c06){if(_0x191c06){_0x49ae2a=_0x191c06[_0xcaa6('0x36')];if(!_0x1d3ce8[_0xcaa6('0x32')]['hasOwnProperty'](_0xcaa6('0x37'))){_0x3081f6[_0xcaa6('0x1d')]=qs[_0xcaa6('0x1d')](_0x1d3ce8['query'][_0xcaa6('0x1d')]);_0x3081f6[_0xcaa6('0x1b')]=qs[_0xcaa6('0x1b')](_0x1d3ce8['query'][_0xcaa6('0x1b')]);}return _0x319900[_0xcaa6('0x4a')](_0x3081f6);}})[_0xcaa6('0x26')](function(_0x5ed76e){if(_0x5ed76e){return _0x5ed76e?{'count':_0x49ae2a,'rows':_0x5ed76e}:null;}})[_0xcaa6('0x26')](respondWithResult(_0xf8097a,null))[_0xcaa6('0x42')](handleError(_0xf8097a,null));};exports['addConfiguration']=function(_0x27f925,_0x26a719,_0x42aead){if(_0x27f925[_0xcaa6('0x49')]['id']){delete _0x27f925[_0xcaa6('0x49')]['id'];}return db[_0xcaa6('0x3f')]['findOne']({'where':{'id':_0x27f925[_0xcaa6('0x43')]['id']}})['then'](handleEntityNotFound(_0x26a719,null))['then'](function(_0x4d2b51){if(_0x4d2b51){_0x27f925[_0xcaa6('0x49')][_0xcaa6('0x4e')]=_0x4d2b51['id'];_0x27f925['body'][_0xcaa6('0x4f')]=integrations[_0xcaa6('0x50')](_0x27f925[_0xcaa6('0x49')][_0xcaa6('0x51')],_0x27f925[_0xcaa6('0x49')][_0xcaa6('0x2e')]);_0x27f925[_0xcaa6('0x49')][_0xcaa6('0x52')]=integrations[_0xcaa6('0x53')](_0x27f925[_0xcaa6('0x49')][_0xcaa6('0x51')],_0x27f925[_0xcaa6('0x49')][_0xcaa6('0x2e')]);return db[_0xcaa6('0x4c')]['create'](_0x27f925[_0xcaa6('0x49')],{'include':[{'model':db[_0xcaa6('0x54')],'as':_0xcaa6('0x4f')},{'model':db[_0xcaa6('0x54')],'as':_0xcaa6('0x52')}]});}return null;})[_0xcaa6('0x26')](respondWithResult(_0x26a719,null))[_0xcaa6('0x42')](handleError(_0x26a719,null));};var md5=require(_0xcaa6('0x55'));exports['getFields']=function(_0x37fc05,_0x31943c,_0x3e462e){var _0x2f21da=null;var _0x44e04f=null;var _0x40914f=null;var _0xa6c951=null;var _0x56cbac='';return db['VtigerAccount'][_0xcaa6('0x4b')]({'where':{'id':_0x37fc05['params']['id']},'attributes':['id','name','username',_0xcaa6('0x56'),_0xcaa6('0x57'),'remoteUri',_0xcaa6('0x58'),'accessKey']})['then'](handleEntityNotFound(_0x31943c,null))[_0xcaa6('0x26')](function(_0x4a2664){if(_0x4a2664){_0x2f21da=_0x4a2664[_0xcaa6('0x59')];_0x44e04f=_0x4a2664[_0xcaa6('0x5a')];_0x40914f=_0x4a2664['moduleName'];_0x56cbac=_0x4a2664[_0xcaa6('0x5b')];var _0x26bdd4=_0x56cbac[_0xcaa6('0x5c')](-0x1);if(_0x26bdd4==='/'){_0x56cbac=_0x56cbac[_0xcaa6('0x5d')](0x0,_0x56cbac['lastIndexOf'](_0x26bdd4));}_0xa6c951=util[_0xcaa6('0x5e')]('%s/webservice.php',_0x56cbac);var _0xb21485={'method':_0xcaa6('0x5f'),'uri':_0xa6c951,'qs':{'operation':_0xcaa6('0x60'),'username':_0x4a2664[_0xcaa6('0x59')]},'json':!![]};return rp(_0xb21485);}})[_0xcaa6('0x26')](function(_0x2258e6){if(_0x2258e6[_0xcaa6('0x61')]){var _0xc7a1ea={'method':_0xcaa6('0x62'),'uri':_0xa6c951,'form':{'operation':_0xcaa6('0x63'),'username':_0x2f21da,'accessKey':md5(_0x2258e6['result'][_0xcaa6('0x64')]+_0x44e04f)},'json':!![]};return rp(_0xc7a1ea);}})[_0xcaa6('0x26')](function(_0x2ba1f5){if(_0x2ba1f5[_0xcaa6('0x61')]){var _0x69f20={'method':_0xcaa6('0x5f'),'uri':_0xa6c951,'qs':{'operation':_0xcaa6('0x65'),'username':_0x2f21da,'sessionName':_0x2ba1f5[_0xcaa6('0x66')][_0xcaa6('0x67')],'elementType':_0x40914f},'json':!![]};return rp(_0x69f20);}})[_0xcaa6('0x26')](function(_0xb2840d){if(_0xb2840d[_0xcaa6('0x61')]){var _0xb52751=[_0xcaa6('0x68'),'reference','owner'];_['remove'](_0xb2840d[_0xcaa6('0x66')][_0xcaa6('0x35')],function(_0x2f6a45){return _0xb52751['includes'](_0x2f6a45[_0xcaa6('0x2e')][_0xcaa6('0x3c')]);});_['remove'](_0xb2840d[_0xcaa6('0x66')][_0xcaa6('0x35')],function(_0x27116d){return _0x27116d['editable']===_0xcaa6('0x69');});return{'count':_0xb2840d[_0xcaa6('0x66')][_0xcaa6('0x35')]['length'],'rows':_[_0xcaa6('0x31')](_0xb2840d[_0xcaa6('0x66')][_0xcaa6('0x35')],function(_0x58a4bc){return{'id':_0x58a4bc[_0xcaa6('0x3c')],'name':_0x58a4bc[_0xcaa6('0x6a')],'custom':_[_0xcaa6('0x6b')](_0x58a4bc[_0xcaa6('0x3c')],_0xcaa6('0x6c'))?!![]:![],'options':_0x58a4bc[_0xcaa6('0x2e')][_0xcaa6('0x3c')]===_0xcaa6('0x6d')&&_0x58a4bc[_0xcaa6('0x2e')]['picklistValues']['length']>0x0?_[_0xcaa6('0x31')](_0x58a4bc[_0xcaa6('0x2e')][_0xcaa6('0x6e')],function(_0x5e1d9a){return{'name':_0x5e1d9a['label'],'value':_0x5e1d9a[_0xcaa6('0x6f')]};}):[]};})};}})[_0xcaa6('0x26')](respondWithResult(_0x31943c,null))[_0xcaa6('0x42')](function(_0x2200b5){console[_0xcaa6('0x70')](_0xcaa6('0x71')+_0x2200b5);var _0x30ffa8=_0x37fc05['query'][_0xcaa6('0x72')]?0x1f4:_0x2200b5['statusCode']||0x1f4;logger[_0xcaa6('0x28')](_0xcaa6('0x73'),'getFields',_0x30ffa8,JSON['stringify'](_0x2200b5));delete _0x2200b5[_0xcaa6('0x3c')];if(_0x30ffa8===0x191){_0x30ffa8=0x190;}_0x31943c['status'](_0x30ffa8)[_0xcaa6('0x2a')](_0x37fc05[_0xcaa6('0x32')][_0xcaa6('0x72')]?{'message':'Wrong\x20credentials','statusCode':_0x2200b5[_0xcaa6('0x74')]}:_0x2200b5);});}; \ No newline at end of file +var _0xb1c8=['../../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','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VtigerAccount','includeAll','include','findAll','catch','show','params','find','create','body','findOne','getConfigurations','addConfiguration','AccountId','channel','getDescriptions','VtigerConfiguration','VtigerField','Subjects','md5','getFields','username','moduleName','remoteUri','serverUrl','accessKey','slice','lastIndexOf','%s/webservice.php','getchallenge','success','POST','login','result','GET','describe','sessionName','autogenerated','owner','includes','remove','false','label','startsWith','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','bluebird','util','path','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs'];(function(_0x484832,_0x144f32){var _0x2aca7b=function(_0x40c0be){while(--_0x40c0be){_0x484832['push'](_0x484832['shift']());}};_0x2aca7b(++_0x144f32);}(_0xb1c8,0xdf));var _0x8b1c=function(_0x5db99b,_0xdee23a){_0x5db99b=_0x5db99b-0x0;var _0x4b2d0e=_0xb1c8[_0x5db99b];return _0x4b2d0e;};'use strict';var emlformat=require(_0x8b1c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8b1c('0x1'));var jsonpatch=require(_0x8b1c('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8b1c('0x3'));var Mustache=require('mustache');var util=require(_0x8b1c('0x4'));var path=require(_0x8b1c('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8b1c('0x6'));var _=require(_0x8b1c('0x7'));var squel=require('squel');var crypto=require(_0x8b1c('0x8'));var jsforce=require(_0x8b1c('0x9'));var deskjs=require(_0x8b1c('0xa'));var toCsv=require(_0x8b1c('0xb'));var querystring=require(_0x8b1c('0xc'));var Papa=require(_0x8b1c('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8b1c('0xe'));var as=require(_0x8b1c('0xf'));var hardwareService=require(_0x8b1c('0x10'));var logger=require(_0x8b1c('0x11'))(_0x8b1c('0x12'));var utils=require(_0x8b1c('0x13'));var config=require(_0x8b1c('0x14'));var licenseUtil=require(_0x8b1c('0x15'));var db=require(_0x8b1c('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x29e2e5,_0x3135f7){_0x3135f7=_0x3135f7||0xcc;return function(_0x3241e4){if(_0x3241e4){return _0x29e2e5[_0x8b1c('0x17')](_0x3135f7);}return _0x29e2e5[_0x8b1c('0x18')](_0x3135f7)[_0x8b1c('0x19')]();};}function respondWithResult(_0xbc78dc,_0x28ebfd){_0x28ebfd=_0x28ebfd||0xc8;return function(_0x1cd1a5){if(_0x1cd1a5){return _0xbc78dc[_0x8b1c('0x18')](_0x28ebfd)[_0x8b1c('0x1a')](_0x1cd1a5);}};}function respondWithFilteredResult(_0x5940ca,_0x5a186c){return function(_0x23a943){if(_0x23a943){var _0x446e5d=typeof _0x5a186c[_0x8b1c('0x1b')]===_0x8b1c('0x1c')&&typeof _0x5a186c['limit']===_0x8b1c('0x1c');var _0x17ffab=_0x23a943[_0x8b1c('0x1d')];var _0x1e1c52=_0x446e5d?0x0:_0x5a186c['offset'];var _0x105fe1=_0x446e5d?_0x23a943[_0x8b1c('0x1d')]:_0x5a186c[_0x8b1c('0x1b')]+_0x5a186c[_0x8b1c('0x1e')];var _0x121c5f;if(_0x105fe1>=_0x17ffab){_0x105fe1=_0x17ffab;_0x121c5f=0xc8;}else{_0x121c5f=0xce;}_0x5940ca[_0x8b1c('0x18')](_0x121c5f);return _0x5940ca[_0x8b1c('0x1f')](_0x8b1c('0x20'),_0x1e1c52+'-'+_0x105fe1+'/'+_0x17ffab)['json'](_0x23a943);}return null;};}function patchUpdates(_0x3b03b6){return function(_0x23657c){try{jsonpatch[_0x8b1c('0x21')](_0x23657c,_0x3b03b6,!![]);}catch(_0x56abf2){return BPromise[_0x8b1c('0x22')](_0x56abf2);}return _0x23657c[_0x8b1c('0x23')]();};}function saveUpdates(_0x37ade3,_0x39168e){return function(_0x5d9039){if(_0x5d9039){return _0x5d9039[_0x8b1c('0x24')](_0x37ade3)[_0x8b1c('0x25')](function(_0x434939){return _0x434939;});}return null;};}function removeEntity(_0x7e274,_0x33c4bc){return function(_0x18e777){if(_0x18e777){return _0x18e777[_0x8b1c('0x26')]()['then'](function(){_0x7e274[_0x8b1c('0x18')](0xcc)[_0x8b1c('0x19')]();});}};}function handleEntityNotFound(_0x3b3266,_0x2ff417){return function(_0x3f131d){if(!_0x3f131d){_0x3b3266[_0x8b1c('0x17')](0x194);}return _0x3f131d;};}function handleError(_0x45ec34,_0x5772ba){_0x5772ba=_0x5772ba||0x1f4;return function(_0x5c68db){logger['error'](_0x5c68db['stack']);if(_0x5c68db[_0x8b1c('0x27')]){delete _0x5c68db[_0x8b1c('0x27')];}_0x45ec34[_0x8b1c('0x18')](_0x5772ba)[_0x8b1c('0x28')](_0x5c68db);};}exports[_0x8b1c('0x29')]=function(_0x1646c5,_0xc46c43){var _0x1e7dba={},_0x37e8e7={},_0x208316={'count':0x0,'rows':[]};var _0x12999d=_['map'](db['VtigerAccount'][_0x8b1c('0x2a')],function(_0x211505){return{'name':_0x211505[_0x8b1c('0x2b')],'type':_0x211505[_0x8b1c('0x2c')][_0x8b1c('0x2d')]};});_0x37e8e7[_0x8b1c('0x2e')]=_[_0x8b1c('0x2f')](_0x12999d,_0x8b1c('0x27'));_0x37e8e7[_0x8b1c('0x30')]=_[_0x8b1c('0x31')](_0x1646c5[_0x8b1c('0x30')]);_0x37e8e7[_0x8b1c('0x32')]=_[_0x8b1c('0x33')](_0x37e8e7[_0x8b1c('0x2e')],_0x37e8e7['query']);_0x1e7dba[_0x8b1c('0x34')]=_[_0x8b1c('0x33')](_0x37e8e7['model'],qs[_0x8b1c('0x35')](_0x1646c5[_0x8b1c('0x30')][_0x8b1c('0x35')]));_0x1e7dba[_0x8b1c('0x34')]=_0x1e7dba[_0x8b1c('0x34')][_0x8b1c('0x36')]?_0x1e7dba[_0x8b1c('0x34')]:_0x37e8e7[_0x8b1c('0x2e')];if(!_0x1646c5[_0x8b1c('0x30')][_0x8b1c('0x37')](_0x8b1c('0x38'))){_0x1e7dba['limit']=qs['limit'](_0x1646c5[_0x8b1c('0x30')][_0x8b1c('0x1e')]);_0x1e7dba[_0x8b1c('0x1b')]=qs[_0x8b1c('0x1b')](_0x1646c5[_0x8b1c('0x30')][_0x8b1c('0x1b')]);}_0x1e7dba[_0x8b1c('0x39')]=qs[_0x8b1c('0x3a')](_0x1646c5[_0x8b1c('0x30')][_0x8b1c('0x3a')]);_0x1e7dba[_0x8b1c('0x3b')]=qs[_0x8b1c('0x32')](_[_0x8b1c('0x3c')](_0x1646c5[_0x8b1c('0x30')],_0x37e8e7[_0x8b1c('0x32')]),_0x12999d);if(_0x1646c5['query'][_0x8b1c('0x3d')]){_0x1e7dba[_0x8b1c('0x3b')]=_[_0x8b1c('0x3e')](_0x1e7dba['where'],{'$or':_[_0x8b1c('0x2f')](_0x12999d,function(_0x1c80d0){if(_0x1c80d0[_0x8b1c('0x2c')]!==_0x8b1c('0x3f')){var _0x525f30={};_0x525f30[_0x1c80d0[_0x8b1c('0x27')]]={'$like':'%'+_0x1646c5[_0x8b1c('0x30')]['filter']+'%'};return _0x525f30;}})});}_0x1e7dba=_[_0x8b1c('0x3e')]({},_0x1e7dba,_0x1646c5[_0x8b1c('0x40')]);var _0x4fa105={'where':_0x1e7dba[_0x8b1c('0x3b')]};return db[_0x8b1c('0x41')][_0x8b1c('0x1d')](_0x4fa105)['then'](function(_0x483f18){_0x208316[_0x8b1c('0x1d')]=_0x483f18;if(_0x1646c5[_0x8b1c('0x30')][_0x8b1c('0x42')]){_0x1e7dba[_0x8b1c('0x43')]=[{'all':!![]}];}return db[_0x8b1c('0x41')][_0x8b1c('0x44')](_0x1e7dba);})['then'](function(_0xad049e){_0x208316['rows']=_0xad049e;return _0x208316;})['then'](respondWithFilteredResult(_0xc46c43,_0x1e7dba))[_0x8b1c('0x45')](handleError(_0xc46c43,null));};exports[_0x8b1c('0x46')]=function(_0x36f48d,_0x48e488){var _0x72c0c={'raw':![],'where':{'id':_0x36f48d[_0x8b1c('0x47')]['id']}},_0x4815f4={};_0x4815f4['model']=_['keys'](db[_0x8b1c('0x41')][_0x8b1c('0x2a')]);_0x4815f4['query']=_[_0x8b1c('0x31')](_0x36f48d['query']);_0x4815f4[_0x8b1c('0x32')]=_[_0x8b1c('0x33')](_0x4815f4[_0x8b1c('0x2e')],_0x4815f4['query']);_0x72c0c[_0x8b1c('0x34')]=_[_0x8b1c('0x33')](_0x4815f4[_0x8b1c('0x2e')],qs['fields'](_0x36f48d[_0x8b1c('0x30')][_0x8b1c('0x35')]));_0x72c0c[_0x8b1c('0x34')]=_0x72c0c[_0x8b1c('0x34')][_0x8b1c('0x36')]?_0x72c0c['attributes']:_0x4815f4[_0x8b1c('0x2e')];if(_0x36f48d[_0x8b1c('0x30')][_0x8b1c('0x42')]){_0x72c0c['include']=[{'all':!![]}];}_0x72c0c=_[_0x8b1c('0x3e')]({},_0x72c0c,_0x36f48d['options']);return db[_0x8b1c('0x41')][_0x8b1c('0x48')](_0x72c0c)[_0x8b1c('0x25')](handleEntityNotFound(_0x48e488,null))[_0x8b1c('0x25')](respondWithResult(_0x48e488,null))[_0x8b1c('0x45')](handleError(_0x48e488,null));};exports[_0x8b1c('0x49')]=function(_0x274acf,_0xe61390){return db[_0x8b1c('0x41')]['create'](_0x274acf[_0x8b1c('0x4a')],{})[_0x8b1c('0x25')](respondWithResult(_0xe61390,0xc9))['catch'](handleError(_0xe61390,null));};exports[_0x8b1c('0x24')]=function(_0x502df2,_0x5a07c3){if(_0x502df2[_0x8b1c('0x4a')]['id']){delete _0x502df2[_0x8b1c('0x4a')]['id'];}return db[_0x8b1c('0x41')][_0x8b1c('0x48')]({'where':{'id':_0x502df2['params']['id']}})[_0x8b1c('0x25')](handleEntityNotFound(_0x5a07c3,null))[_0x8b1c('0x25')](saveUpdates(_0x502df2[_0x8b1c('0x4a')],null))[_0x8b1c('0x25')](respondWithResult(_0x5a07c3,null))[_0x8b1c('0x45')](handleError(_0x5a07c3,null));};exports[_0x8b1c('0x26')]=function(_0x3cbb0f,_0x426d82){return db[_0x8b1c('0x41')][_0x8b1c('0x48')]({'where':{'id':_0x3cbb0f[_0x8b1c('0x47')]['id']}})[_0x8b1c('0x25')](handleEntityNotFound(_0x426d82,null))['then'](removeEntity(_0x426d82,null))[_0x8b1c('0x45')](handleError(_0x426d82,null));};exports['getConfigurations']=function(_0x59162a,_0x1bab65,_0x1e9878){var _0x5a5c51={};var _0x372a97={};var _0x56d89d;var _0x384f97;return db['VtigerAccount'][_0x8b1c('0x4b')]({'where':{'id':_0x59162a[_0x8b1c('0x47')]['id']}})['then'](handleEntityNotFound(_0x1bab65,null))[_0x8b1c('0x25')](function(_0x488fce){if(_0x488fce){_0x56d89d=_0x488fce;_0x372a97[_0x8b1c('0x2e')]=_[_0x8b1c('0x31')](db['VtigerConfiguration'][_0x8b1c('0x2a')]);_0x372a97[_0x8b1c('0x30')]=_[_0x8b1c('0x31')](_0x59162a[_0x8b1c('0x30')]);_0x372a97[_0x8b1c('0x32')]=_[_0x8b1c('0x33')](_0x372a97[_0x8b1c('0x2e')],_0x372a97[_0x8b1c('0x30')]);_0x5a5c51[_0x8b1c('0x34')]=_['intersection'](_0x372a97[_0x8b1c('0x2e')],qs['fields'](_0x59162a[_0x8b1c('0x30')][_0x8b1c('0x35')]));_0x5a5c51['attributes']=_0x5a5c51[_0x8b1c('0x34')][_0x8b1c('0x36')]?_0x5a5c51['attributes']:_0x372a97[_0x8b1c('0x2e')];_0x5a5c51['order']=qs[_0x8b1c('0x3a')](_0x59162a[_0x8b1c('0x30')]['sort']);_0x5a5c51[_0x8b1c('0x3b')]=qs[_0x8b1c('0x32')](_[_0x8b1c('0x3c')](_0x59162a[_0x8b1c('0x30')],_0x372a97[_0x8b1c('0x32')]));if(_0x59162a['query'][_0x8b1c('0x3d')]){_0x5a5c51[_0x8b1c('0x3b')]=_[_0x8b1c('0x3e')](_0x5a5c51[_0x8b1c('0x3b')],{'$or':_[_0x8b1c('0x2f')](_0x5a5c51[_0x8b1c('0x34')],function(_0x41c19f){var _0x2c1964={};_0x2c1964[_0x41c19f]={'$like':'%'+_0x59162a[_0x8b1c('0x30')][_0x8b1c('0x3d')]+'%'};return _0x2c1964;})});}_0x5a5c51=_['merge']({},_0x5a5c51,_0x59162a[_0x8b1c('0x40')]);return _0x56d89d[_0x8b1c('0x4c')](_0x5a5c51);}})['then'](function(_0x831ecc){if(_0x831ecc){_0x384f97=_0x831ecc[_0x8b1c('0x36')];if(!_0x59162a[_0x8b1c('0x30')][_0x8b1c('0x37')]('nolimit')){_0x5a5c51['limit']=qs['limit'](_0x59162a[_0x8b1c('0x30')][_0x8b1c('0x1e')]);_0x5a5c51['offset']=qs[_0x8b1c('0x1b')](_0x59162a[_0x8b1c('0x30')][_0x8b1c('0x1b')]);}return _0x56d89d[_0x8b1c('0x4c')](_0x5a5c51);}})['then'](function(_0x106557){if(_0x106557){return _0x106557?{'count':_0x384f97,'rows':_0x106557}:null;}})[_0x8b1c('0x25')](respondWithResult(_0x1bab65,null))[_0x8b1c('0x45')](handleError(_0x1bab65,null));};exports[_0x8b1c('0x4d')]=function(_0x712491,_0x50a3b9,_0x2be074){if(_0x712491[_0x8b1c('0x4a')]['id']){delete _0x712491[_0x8b1c('0x4a')]['id'];}return db[_0x8b1c('0x41')]['findOne']({'where':{'id':_0x712491[_0x8b1c('0x47')]['id']}})[_0x8b1c('0x25')](handleEntityNotFound(_0x50a3b9,null))[_0x8b1c('0x25')](function(_0x49947f){if(_0x49947f){_0x712491[_0x8b1c('0x4a')][_0x8b1c('0x4e')]=_0x49947f['id'];_0x712491['body']['Subjects']=integrations['getSubjects'](_0x712491[_0x8b1c('0x4a')][_0x8b1c('0x4f')],_0x712491[_0x8b1c('0x4a')][_0x8b1c('0x2c')]);_0x712491[_0x8b1c('0x4a')]['Descriptions']=integrations[_0x8b1c('0x50')](_0x712491[_0x8b1c('0x4a')][_0x8b1c('0x4f')],_0x712491[_0x8b1c('0x4a')][_0x8b1c('0x2c')]);return db[_0x8b1c('0x51')][_0x8b1c('0x49')](_0x712491['body'],{'include':[{'model':db[_0x8b1c('0x52')],'as':_0x8b1c('0x53')},{'model':db['VtigerField'],'as':'Descriptions'}]});}return null;})[_0x8b1c('0x25')](respondWithResult(_0x50a3b9,null))[_0x8b1c('0x45')](handleError(_0x50a3b9,null));};var md5=require(_0x8b1c('0x54'));exports[_0x8b1c('0x55')]=function(_0x8d2cff,_0x316c55,_0x1bca58){var _0xacdb5b=null;var _0x24ad30=null;var _0x34a8b0=null;var _0x1fa1f3=null;var _0x241471='';return db[_0x8b1c('0x41')][_0x8b1c('0x4b')]({'where':{'id':_0x8d2cff[_0x8b1c('0x47')]['id']},'attributes':['id','name',_0x8b1c('0x56'),'description',_0x8b1c('0x57'),_0x8b1c('0x58'),_0x8b1c('0x59'),_0x8b1c('0x5a')]})['then'](handleEntityNotFound(_0x316c55,null))[_0x8b1c('0x25')](function(_0x4234a0){if(_0x4234a0){_0xacdb5b=_0x4234a0[_0x8b1c('0x56')];_0x24ad30=_0x4234a0[_0x8b1c('0x5a')];_0x34a8b0=_0x4234a0[_0x8b1c('0x57')];_0x241471=_0x4234a0[_0x8b1c('0x58')];var _0x558887=_0x241471[_0x8b1c('0x5b')](-0x1);if(_0x558887==='/'){_0x241471=_0x241471['substring'](0x0,_0x241471[_0x8b1c('0x5c')](_0x558887));}_0x1fa1f3=util['format'](_0x8b1c('0x5d'),_0x241471);var _0x59d917={'method':'GET','uri':_0x1fa1f3,'qs':{'operation':_0x8b1c('0x5e'),'username':_0x4234a0[_0x8b1c('0x56')]},'json':!![]};return rp(_0x59d917);}})[_0x8b1c('0x25')](function(_0x2b499c){if(_0x2b499c[_0x8b1c('0x5f')]){var _0x3d99d3={'method':_0x8b1c('0x60'),'uri':_0x1fa1f3,'form':{'operation':_0x8b1c('0x61'),'username':_0xacdb5b,'accessKey':md5(_0x2b499c[_0x8b1c('0x62')]['token']+_0x24ad30)},'json':!![]};return rp(_0x3d99d3);}})[_0x8b1c('0x25')](function(_0x56c8d0){if(_0x56c8d0[_0x8b1c('0x5f')]){var _0x44c467={'method':_0x8b1c('0x63'),'uri':_0x1fa1f3,'qs':{'operation':_0x8b1c('0x64'),'username':_0xacdb5b,'sessionName':_0x56c8d0['result'][_0x8b1c('0x65')],'elementType':_0x34a8b0},'json':!![]};return rp(_0x44c467);}})[_0x8b1c('0x25')](function(_0x37e628){if(_0x37e628[_0x8b1c('0x5f')]){var _0x431527=[_0x8b1c('0x66'),'reference',_0x8b1c('0x67')];_['remove'](_0x37e628[_0x8b1c('0x62')][_0x8b1c('0x35')],function(_0x1d188b){return _0x431527[_0x8b1c('0x68')](_0x1d188b['type'][_0x8b1c('0x27')]);});_[_0x8b1c('0x69')](_0x37e628[_0x8b1c('0x62')]['fields'],function(_0x546974){return _0x546974['editable']===_0x8b1c('0x6a');});return{'count':_0x37e628[_0x8b1c('0x62')][_0x8b1c('0x35')][_0x8b1c('0x36')],'rows':_[_0x8b1c('0x2f')](_0x37e628[_0x8b1c('0x62')][_0x8b1c('0x35')],function(_0xa55b62){return{'id':_0xa55b62['name'],'name':_0xa55b62[_0x8b1c('0x6b')],'custom':_[_0x8b1c('0x6c')](_0xa55b62[_0x8b1c('0x27')],'cf_')?!![]:![],'options':_0xa55b62[_0x8b1c('0x2c')]['name']===_0x8b1c('0x6d')&&_0xa55b62[_0x8b1c('0x2c')][_0x8b1c('0x6e')][_0x8b1c('0x36')]>0x0?_['map'](_0xa55b62[_0x8b1c('0x2c')]['picklistValues'],function(_0x14ccd3){return{'name':_0x14ccd3['label'],'value':_0x14ccd3[_0x8b1c('0x6f')]};}):[]};})};}})[_0x8b1c('0x25')](respondWithResult(_0x316c55,null))['catch'](function(_0x4a5654){console[_0x8b1c('0x70')](_0x8b1c('0x71')+_0x4a5654);var _0x1ad92f=_0x8d2cff[_0x8b1c('0x30')][_0x8b1c('0x72')]?0x1f4:_0x4a5654[_0x8b1c('0x73')]||0x1f4;logger['error'](_0x8b1c('0x74'),_0x8b1c('0x55'),_0x1ad92f,JSON[_0x8b1c('0x75')](_0x4a5654));delete _0x4a5654['name'];if(_0x1ad92f===0x191){_0x1ad92f=0x190;}_0x316c55[_0x8b1c('0x18')](_0x1ad92f)[_0x8b1c('0x28')](_0x8d2cff[_0x8b1c('0x30')][_0x8b1c('0x72')]?{'message':_0x8b1c('0x76'),'statusCode':_0x4a5654[_0x8b1c('0x73')]}:_0x4a5654);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index de767cd..ea29b8d 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 _0x3e5a=['bluebird','request-promise','path','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','int_vtiger_accounts','lodash','util','../../config/logger','api'];(function(_0x4debdd,_0x114aab){var _0x4a83e6=function(_0x4e8ed8){while(--_0x4e8ed8){_0x4debdd['push'](_0x4debdd['shift']());}};_0x4a83e6(++_0x114aab);}(_0x3e5a,0x182));var _0xa3e5=function(_0x2c6928,_0x405d1a){_0x2c6928=_0x2c6928-0x0;var _0x56d1d8=_0x3e5a[_0x2c6928];return _0x56d1d8;};'use strict';var _=require(_0xa3e5('0x0'));var util=require(_0xa3e5('0x1'));var logger=require(_0xa3e5('0x2'))(_0xa3e5('0x3'));var moment=require('moment');var BPromise=require(_0xa3e5('0x4'));var rp=require(_0xa3e5('0x5'));var fs=require('fs');var path=require(_0xa3e5('0x6'));var rimraf=require('rimraf');var config=require(_0xa3e5('0x7'));var attributes=require(_0xa3e5('0x8'));var integrations=require(_0xa3e5('0x9'));module[_0xa3e5('0xa')]=function(_0x149cc4,_0x41ad77){return _0x149cc4[_0xa3e5('0xb')]('VtigerAccount',attributes,{'tableName':_0xa3e5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4aab=['rimraf','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x53d11c,_0x28ccde){var _0x1176ee=function(_0xe24a95){while(--_0xe24a95){_0x53d11c['push'](_0x53d11c['shift']());}};_0x1176ee(++_0x28ccde);}(_0x4aab,0x111));var _0xb4aa=function(_0x3fad6a,_0x1a3c3e){_0x3fad6a=_0x3fad6a-0x0;var _0x48de6c=_0x4aab[_0x3fad6a];return _0x48de6c;};'use strict';var _=require('lodash');var util=require(_0xb4aa('0x0'));var logger=require(_0xb4aa('0x1'))(_0xb4aa('0x2'));var moment=require(_0xb4aa('0x3'));var BPromise=require(_0xb4aa('0x4'));var rp=require(_0xb4aa('0x5'));var fs=require('fs');var path=require(_0xb4aa('0x6'));var rimraf=require(_0xb4aa('0x7'));var config=require('../../config/environment');var attributes=require(_0xb4aa('0x8'));var integrations=require(_0xb4aa('0x9'));module[_0xb4aa('0xa')]=function(_0x3ca603,_0x5ca496){return _0x3ca603[_0xb4aa('0xb')](_0xb4aa('0xc'),attributes,{'tableName':_0xb4aa('0xd'),'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 d003dc4..5b74931 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 _0x153f=['GetVtigerAccount','VtigerAccount','findAll','options','raw','where','attributes','limit','include','map','model','catch','ShowVtigerAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x1a2a9e,_0xa33cc1){var _0x109ca7=function(_0x1e1a1c){while(--_0x1e1a1c){_0x1a2a9e['push'](_0x1a2a9e['shift']());}};_0x109ca7(++_0xa33cc1);}(_0x153f,0x15b));var _0xf153=function(_0x22deaf,_0x2a1eb6){_0x22deaf=_0x22deaf-0x0;var _0x5c07ba=_0x153f[_0x22deaf];return _0x5c07ba;};'use strict';var _=require(_0xf153('0x0'));var util=require(_0xf153('0x1'));var moment=require(_0xf153('0x2'));var BPromise=require(_0xf153('0x3'));var rs=require(_0xf153('0x4'));var fs=require('fs');var Redis=require(_0xf153('0x5'));var db=require(_0xf153('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xf153('0x7'))('rpc');var config=require(_0xf153('0x8'));var jayson=require(_0xf153('0x9'));var client=jayson[_0xf153('0xa')][_0xf153('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x21f432,_0x4c8ae5,_0x17ba96){return new BPromise(function(_0x143497,_0x224f88){return client[_0xf153('0xc')](_0x21f432,_0x17ba96)[_0xf153('0xd')](function(_0x3e7a82){logger[_0xf153('0xe')](_0xf153('0xf'),_0x4c8ae5,_0xf153('0x10'));logger[_0xf153('0x11')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x4c8ae5,_0xf153('0x10'),JSON[_0xf153('0x12')](_0x3e7a82));if(_0x3e7a82[_0xf153('0x13')]){if(_0x3e7a82['error'][_0xf153('0x14')]===0x1f4){logger[_0xf153('0x13')](_0xf153('0xf'),_0x4c8ae5,_0x3e7a82[_0xf153('0x13')][_0xf153('0x15')]);return _0x224f88(_0x3e7a82[_0xf153('0x13')][_0xf153('0x15')]);}logger[_0xf153('0x13')](_0xf153('0xf'),_0x4c8ae5,_0x3e7a82['error'][_0xf153('0x15')]);return _0x143497(_0x3e7a82[_0xf153('0x13')][_0xf153('0x15')]);}else{logger[_0xf153('0xe')](_0xf153('0xf'),_0x4c8ae5,_0xf153('0x10'));_0x143497(_0x3e7a82[_0xf153('0x16')][_0xf153('0x15')]);}})['catch'](function(_0x35f4e8){logger['error'](_0xf153('0xf'),_0x4c8ae5,_0x35f4e8);_0x224f88(_0x35f4e8);});});}exports[_0xf153('0x17')]=function(_0x138dbe){var _0x44272e=this;return new Promise(function(_0x4e790d,_0x357d57){return db[_0xf153('0x18')][_0xf153('0x19')]({'raw':_0x138dbe[_0xf153('0x1a')]?_0x138dbe[_0xf153('0x1a')][_0xf153('0x1b')]===undefined?!![]:![]:!![],'where':_0x138dbe[_0xf153('0x1a')]?_0x138dbe[_0xf153('0x1a')][_0xf153('0x1c')]||null:null,'attributes':_0x138dbe[_0xf153('0x1a')]?_0x138dbe[_0xf153('0x1a')][_0xf153('0x1d')]||null:null,'limit':_0x138dbe['options']?_0x138dbe[_0xf153('0x1a')][_0xf153('0x1e')]||null:null,'include':_0x138dbe[_0xf153('0x1a')]?_0x138dbe[_0xf153('0x1a')][_0xf153('0x1f')]?_[_0xf153('0x20')](_0x138dbe[_0xf153('0x1a')][_0xf153('0x1f')],function(_0xf67cde){return{'model':db[_0xf67cde[_0xf153('0x21')]],'as':_0xf67cde['as'],'attributes':_0xf67cde[_0xf153('0x1d')],'include':_0xf67cde[_0xf153('0x1f')]?_[_0xf153('0x20')](_0xf67cde[_0xf153('0x1f')],function(_0xe490f8){return{'model':db[_0xe490f8[_0xf153('0x21')]],'as':_0xe490f8['as'],'attributes':_0xe490f8[_0xf153('0x1d')],'include':_0xe490f8[_0xf153('0x1f')]?_[_0xf153('0x20')](_0xe490f8[_0xf153('0x1f')],function(_0x48ebdc){return{'model':db[_0x48ebdc[_0xf153('0x21')]],'as':_0x48ebdc['as'],'attributes':_0x48ebdc[_0xf153('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x16cdcd){logger[_0xf153('0xe')]('GetVtigerAccount',_0x138dbe);logger[_0xf153('0x11')](_0xf153('0x17'),_0x138dbe,JSON[_0xf153('0x12')](_0x16cdcd));_0x4e790d(_0x16cdcd);})[_0xf153('0x22')](function(_0x339e96){logger[_0xf153('0x13')](_0xf153('0x17'),_0x339e96[_0xf153('0x15')],_0x138dbe);_0x357d57(_0x44272e[_0xf153('0x13')](0x1f4,_0x339e96[_0xf153('0x15')]));});});};exports[_0xf153('0x23')]=function(_0x415a5f){var _0x5b5237=this;return new Promise(function(_0x258fb0,_0xbb3619){return db[_0xf153('0x18')][_0xf153('0x24')]({'raw':_0x415a5f['options']?_0x415a5f['options'][_0xf153('0x1b')]===undefined?!![]:![]:!![],'where':_0x415a5f['options']?_0x415a5f['options'][_0xf153('0x1c')]||null:null,'attributes':_0x415a5f['options']?_0x415a5f[_0xf153('0x1a')]['attributes']||null:null,'include':_0x415a5f[_0xf153('0x1a')]?_0x415a5f[_0xf153('0x1a')]['include']?_[_0xf153('0x20')](_0x415a5f[_0xf153('0x1a')][_0xf153('0x1f')],function(_0x40be52){return{'model':db[_0x40be52[_0xf153('0x21')]],'as':_0x40be52['as'],'attributes':_0x40be52[_0xf153('0x1d')],'include':_0x40be52['include']?_[_0xf153('0x20')](_0x40be52['include'],function(_0x40834b){return{'model':db[_0x40834b[_0xf153('0x21')]],'as':_0x40834b['as'],'attributes':_0x40834b[_0xf153('0x1d')],'include':_0x40834b[_0xf153('0x1f')]?_[_0xf153('0x20')](_0x40834b[_0xf153('0x1f')],function(_0x4becf3){return{'model':db[_0x4becf3[_0xf153('0x21')]],'as':_0x4becf3['as'],'attributes':_0x4becf3[_0xf153('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xf153('0xd')](function(_0x4e0634){logger[_0xf153('0xe')](_0xf153('0x23'),_0x415a5f);logger[_0xf153('0x11')](_0xf153('0x23'),_0x415a5f,JSON[_0xf153('0x12')](_0x4e0634));_0x258fb0(_0x4e0634);})[_0xf153('0x22')](function(_0x4cc481){logger[_0xf153('0x13')](_0xf153('0x23'),_0x4cc481['message'],_0x415a5f);_0xbb3619(_0x5b5237[_0xf153('0x13')](0x1f4,_0x4cc481[_0xf153('0x15')]));});});}; \ No newline at end of file +var _0x36ee=['message','info','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','attributes','include','map','model','find','ShowVtigerAccount','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x1171f2,_0xeacc70){var _0x4c182c=function(_0x29a351){while(--_0x29a351){_0x1171f2['push'](_0x1171f2['shift']());}};_0x4c182c(++_0xeacc70);}(_0x36ee,0xe8));var _0xe36e=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x36ee[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe36e('0x0'));var BPromise=require('bluebird');var rs=require(_0xe36e('0x1'));var fs=require('fs');var Redis=require(_0xe36e('0x2'));var db=require(_0xe36e('0x3'))['db'];var utils=require(_0xe36e('0x4'));var logger=require(_0xe36e('0x5'))(_0xe36e('0x6'));var config=require(_0xe36e('0x7'));var jayson=require(_0xe36e('0x8'));var client=jayson[_0xe36e('0x9')][_0xe36e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21be0b,_0x1aa596,_0x51b4bd){return new BPromise(function(_0x74b4b7,_0x4aebdd){return client[_0xe36e('0xb')](_0x21be0b,_0x51b4bd)[_0xe36e('0xc')](function(_0x46f239){logger['info'](_0xe36e('0xd'),_0x1aa596,'request\x20sent');logger[_0xe36e('0xe')](_0xe36e('0xf'),_0x1aa596,_0xe36e('0x10'),JSON[_0xe36e('0x11')](_0x46f239));if(_0x46f239[_0xe36e('0x12')]){if(_0x46f239[_0xe36e('0x12')][_0xe36e('0x13')]===0x1f4){logger[_0xe36e('0x12')]('VtigerAccount,\x20%s,\x20%s',_0x1aa596,_0x46f239[_0xe36e('0x12')][_0xe36e('0x14')]);return _0x4aebdd(_0x46f239[_0xe36e('0x12')][_0xe36e('0x14')]);}logger['error'](_0xe36e('0xd'),_0x1aa596,_0x46f239['error']['message']);return _0x74b4b7(_0x46f239[_0xe36e('0x12')][_0xe36e('0x14')]);}else{logger[_0xe36e('0x15')](_0xe36e('0xd'),_0x1aa596,_0xe36e('0x10'));_0x74b4b7(_0x46f239[_0xe36e('0x16')][_0xe36e('0x14')]);}})[_0xe36e('0x17')](function(_0x387c37){logger[_0xe36e('0x12')]('VtigerAccount,\x20%s,\x20%s',_0x1aa596,_0x387c37);_0x4aebdd(_0x387c37);});});}exports[_0xe36e('0x18')]=function(_0x2184ae){var _0x56c019=this;return new Promise(function(_0x21d9a3,_0x533c06){return db[_0xe36e('0x19')][_0xe36e('0x1a')]({'raw':_0x2184ae['options']?_0x2184ae[_0xe36e('0x1b')][_0xe36e('0x1c')]===undefined?!![]:![]:!![],'where':_0x2184ae[_0xe36e('0x1b')]?_0x2184ae['options'][_0xe36e('0x1d')]||null:null,'attributes':_0x2184ae[_0xe36e('0x1b')]?_0x2184ae[_0xe36e('0x1b')][_0xe36e('0x1e')]||null:null,'limit':_0x2184ae[_0xe36e('0x1b')]?_0x2184ae[_0xe36e('0x1b')]['limit']||null:null,'include':_0x2184ae[_0xe36e('0x1b')]?_0x2184ae[_0xe36e('0x1b')][_0xe36e('0x1f')]?_[_0xe36e('0x20')](_0x2184ae[_0xe36e('0x1b')]['include'],function(_0x598a7a){return{'model':db[_0x598a7a[_0xe36e('0x21')]],'as':_0x598a7a['as'],'attributes':_0x598a7a[_0xe36e('0x1e')],'include':_0x598a7a[_0xe36e('0x1f')]?_[_0xe36e('0x20')](_0x598a7a[_0xe36e('0x1f')],function(_0x1507f9){return{'model':db[_0x1507f9[_0xe36e('0x21')]],'as':_0x1507f9['as'],'attributes':_0x1507f9['attributes'],'include':_0x1507f9[_0xe36e('0x1f')]?_[_0xe36e('0x20')](_0x1507f9[_0xe36e('0x1f')],function(_0x262caa){return{'model':db[_0x262caa['model']],'as':_0x262caa['as'],'attributes':_0x262caa[_0xe36e('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xf7b02e){logger['info'](_0xe36e('0x18'),_0x2184ae);logger['debug'](_0xe36e('0x18'),_0x2184ae,JSON['stringify'](_0xf7b02e));_0x21d9a3(_0xf7b02e);})[_0xe36e('0x17')](function(_0x59548b){logger['error']('GetVtigerAccount',_0x59548b['message'],_0x2184ae);_0x533c06(_0x56c019[_0xe36e('0x12')](0x1f4,_0x59548b[_0xe36e('0x14')]));});});};exports['ShowVtigerAccount']=function(_0x4ac819){var _0x1fa1ec=this;return new Promise(function(_0xb8d44e,_0x259e19){return db[_0xe36e('0x19')][_0xe36e('0x22')]({'raw':_0x4ac819[_0xe36e('0x1b')]?_0x4ac819['options'][_0xe36e('0x1c')]===undefined?!![]:![]:!![],'where':_0x4ac819[_0xe36e('0x1b')]?_0x4ac819['options'][_0xe36e('0x1d')]||null:null,'attributes':_0x4ac819[_0xe36e('0x1b')]?_0x4ac819[_0xe36e('0x1b')][_0xe36e('0x1e')]||null:null,'include':_0x4ac819[_0xe36e('0x1b')]?_0x4ac819[_0xe36e('0x1b')][_0xe36e('0x1f')]?_[_0xe36e('0x20')](_0x4ac819[_0xe36e('0x1b')][_0xe36e('0x1f')],function(_0xf808f5){return{'model':db[_0xf808f5['model']],'as':_0xf808f5['as'],'attributes':_0xf808f5[_0xe36e('0x1e')],'include':_0xf808f5['include']?_['map'](_0xf808f5[_0xe36e('0x1f')],function(_0x4f620d){return{'model':db[_0x4f620d[_0xe36e('0x21')]],'as':_0x4f620d['as'],'attributes':_0x4f620d[_0xe36e('0x1e')],'include':_0x4f620d[_0xe36e('0x1f')]?_[_0xe36e('0x20')](_0x4f620d['include'],function(_0x56135c){return{'model':db[_0x56135c[_0xe36e('0x21')]],'as':_0x56135c['as'],'attributes':_0x56135c[_0xe36e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xe36e('0xc')](function(_0x243338){logger['info'](_0xe36e('0x23'),_0x4ac819);logger[_0xe36e('0xe')](_0xe36e('0x23'),_0x4ac819,JSON['stringify'](_0x243338));_0xb8d44e(_0x243338);})[_0xe36e('0x17')](function(_0x2ff8f4){logger['error'](_0xe36e('0x23'),_0x2ff8f4[_0xe36e('0x14')],_0x4ac819);_0x259e19(_0x1fa1ec[_0xe36e('0x12')](0x1f4,_0x2ff8f4[_0xe36e('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 68757d6..39c71dc 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 _0xaad4=['delete','destroy','exports','path','express','Router','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','create','put'];(function(_0x483c23,_0x381109){var _0x28905d=function(_0xc5d210){while(--_0xc5d210){_0x483c23['push'](_0x483c23['shift']());}};_0x28905d(++_0x381109);}(_0xaad4,0x96));var _0x4aad=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xaad4[_0x122ef9];return _0x42fba0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4aad('0x0'));var timeout=require('connect-timeout');var express=require(_0x4aad('0x1'));var router=express[_0x4aad('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4aad('0x3'));var config=require(_0x4aad('0x4'));var controller=require(_0x4aad('0x5'));router[_0x4aad('0x6')]('/',auth[_0x4aad('0x7')](),controller[_0x4aad('0x8')]);router[_0x4aad('0x6')](_0x4aad('0x9'),auth[_0x4aad('0x7')](),controller[_0x4aad('0xa')]);router[_0x4aad('0x6')](_0x4aad('0xb'),auth[_0x4aad('0x7')](),controller[_0x4aad('0xc')]);router[_0x4aad('0x6')](_0x4aad('0xd'),auth[_0x4aad('0x7')](),controller['getSubjects']);router[_0x4aad('0x6')](_0x4aad('0xe'),auth[_0x4aad('0x7')](),controller[_0x4aad('0xf')]);router['post']('/',auth[_0x4aad('0x7')](),controller[_0x4aad('0x10')]);router[_0x4aad('0x11')](_0x4aad('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x4aad('0x12')](_0x4aad('0x9'),auth['isAuthenticated'](),controller[_0x4aad('0x13')]);module[_0x4aad('0x14')]=router; \ No newline at end of file +var _0xba7d=['/:id','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','delete','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index'];(function(_0x24a254,_0x4ad4ef){var _0xfbe841=function(_0x3f40a3){while(--_0x3f40a3){_0x24a254['push'](_0x24a254['shift']());}};_0xfbe841(++_0x4ad4ef);}(_0xba7d,0x129));var _0xdba7=function(_0x2a8b24,_0xb25f90){_0x2a8b24=_0x2a8b24-0x0;var _0x2a2aa4=_0xba7d[_0x2a8b24];return _0x2a2aa4;};'use strict';var multer=require('multer');var util=require(_0xdba7('0x0'));var path=require(_0xdba7('0x1'));var timeout=require(_0xdba7('0x2'));var express=require(_0xdba7('0x3'));var router=express[_0xdba7('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xdba7('0x5'));var config=require(_0xdba7('0x6'));var controller=require(_0xdba7('0x7'));router[_0xdba7('0x8')]('/',auth[_0xdba7('0x9')](),controller[_0xdba7('0xa')]);router['get'](_0xdba7('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xdba7('0x8')]('/:id/fields',auth[_0xdba7('0x9')](),controller[_0xdba7('0xc')]);router[_0xdba7('0x8')](_0xdba7('0xd'),auth[_0xdba7('0x9')](),controller[_0xdba7('0xe')]);router[_0xdba7('0x8')](_0xdba7('0xf'),auth[_0xdba7('0x9')](),controller[_0xdba7('0x10')]);router[_0xdba7('0x11')]('/',auth[_0xdba7('0x9')](),controller[_0xdba7('0x12')]);router[_0xdba7('0x13')](_0xdba7('0xb'),auth[_0xdba7('0x9')](),controller['update']);router[_0xdba7('0x14')](_0xdba7('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xdba7('0x15')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 11e8bd7..d068d7a 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 _0x5b39=['exports','STRING'];(function(_0x1b0566,_0x11d737){var _0x1718fd=function(_0x2cf5bf){while(--_0x2cf5bf){_0x1b0566['push'](_0x1b0566['shift']());}};_0x1718fd(++_0x11d737);}(_0x5b39,0x64));var _0x95b3=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x5b39[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require('sequelize');module[_0x95b3('0x0')]={'name':{'type':Sequelize[_0x95b3('0x1')]},'description':{'type':Sequelize[_0x95b3('0x1')]}}; \ No newline at end of file +var _0x9d05=['STRING','sequelize','exports'];(function(_0x38b621,_0x263776){var _0x4652d9=function(_0x2af544){while(--_0x2af544){_0x38b621['push'](_0x38b621['shift']());}};_0x4652d9(++_0x263776);}(_0x9d05,0x130));var _0x59d0=function(_0x1a4e14,_0x4e29a7){_0x1a4e14=_0x1a4e14-0x0;var _0x4256a7=_0x9d05[_0x1a4e14];return _0x4256a7;};'use strict';var Sequelize=require(_0x59d0('0x0'));module[_0x59d0('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x59d0('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 2be35b4..6d76d29 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 _0xca3d=['path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','VtigerConfiguration','rawAttributes','type','keys','query','filters','model','intersection','fields','attributes','length','nolimit','limit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','getFields','VtigerField','order','hasOwnProperty','getSubjects','findOne','getDescriptions','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x396eb0,_0x17b61d){var _0x436d7c=function(_0x2528b7){while(--_0x2528b7){_0x396eb0['push'](_0x396eb0['shift']());}};_0x436d7c(++_0x17b61d);}(_0xca3d,0x1a2));var _0xdca3=function(_0x39bc80,_0x18f609){_0x39bc80=_0x39bc80-0x0;var _0x350050=_0xca3d[_0x39bc80];return _0x350050;};'use strict';var emlformat=require(_0xdca3('0x0'));var rimraf=require(_0xdca3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdca3('0x2'));var rp=require('request-promise');var moment=require(_0xdca3('0x3'));var BPromise=require(_0xdca3('0x4'));var Mustache=require(_0xdca3('0x5'));var util=require(_0xdca3('0x6'));var path=require(_0xdca3('0x7'));var sox=require(_0xdca3('0x8'));var csv=require(_0xdca3('0x9'));var ejs=require(_0xdca3('0xa'));var fs=require('fs');var fs_extra=require(_0xdca3('0xb'));var _=require(_0xdca3('0xc'));var squel=require(_0xdca3('0xd'));var crypto=require(_0xdca3('0xe'));var jsforce=require(_0xdca3('0xf'));var deskjs=require(_0xdca3('0x10'));var toCsv=require(_0xdca3('0x9'));var querystring=require(_0xdca3('0x11'));var Papa=require(_0xdca3('0x12'));var Redis=require(_0xdca3('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xdca3('0x14'));var as=require(_0xdca3('0x15'));var hardwareService=require(_0xdca3('0x16'));var logger=require(_0xdca3('0x17'))('api');var utils=require(_0xdca3('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xdca3('0x19'));var db=require(_0xdca3('0x1a'))['db'];function respondWithStatusCode(_0x65b4e1,_0x4b123c){_0x4b123c=_0x4b123c||0xcc;return function(_0x4acb57){if(_0x4acb57){return _0x65b4e1['sendStatus'](_0x4b123c);}return _0x65b4e1[_0xdca3('0x1b')](_0x4b123c)[_0xdca3('0x1c')]();};}function respondWithResult(_0x2351eb,_0x2b310a){_0x2b310a=_0x2b310a||0xc8;return function(_0xe18ad2){if(_0xe18ad2){return _0x2351eb[_0xdca3('0x1b')](_0x2b310a)[_0xdca3('0x1d')](_0xe18ad2);}};}function respondWithFilteredResult(_0x18a6fc,_0x4c5939){return function(_0x144c79){if(_0x144c79){var _0x53634e=typeof _0x4c5939[_0xdca3('0x1e')]===_0xdca3('0x1f')&&typeof _0x4c5939['limit']===_0xdca3('0x1f');var _0x32b198=_0x144c79[_0xdca3('0x20')];var _0x4f1335=_0x53634e?0x0:_0x4c5939[_0xdca3('0x1e')];var _0x94babd=_0x53634e?_0x144c79['count']:_0x4c5939[_0xdca3('0x1e')]+_0x4c5939['limit'];var _0x5e9a34;if(_0x94babd>=_0x32b198){_0x94babd=_0x32b198;_0x5e9a34=0xc8;}else{_0x5e9a34=0xce;}_0x18a6fc['status'](_0x5e9a34);return _0x18a6fc[_0xdca3('0x21')](_0xdca3('0x22'),_0x4f1335+'-'+_0x94babd+'/'+_0x32b198)[_0xdca3('0x1d')](_0x144c79);}return null;};}function patchUpdates(_0x35578e){return function(_0x257c1d){try{jsonpatch[_0xdca3('0x23')](_0x257c1d,_0x35578e,!![]);}catch(_0x4d665b){return BPromise[_0xdca3('0x24')](_0x4d665b);}return _0x257c1d[_0xdca3('0x25')]();};}function saveUpdates(_0x562f7f,_0x57366d){return function(_0x497c83){if(_0x497c83){return _0x497c83[_0xdca3('0x26')](_0x562f7f)[_0xdca3('0x27')](function(_0x2445ca){return _0x2445ca;});}return null;};}function removeEntity(_0x381f91,_0x19eb33){return function(_0x20c016){if(_0x20c016){return _0x20c016[_0xdca3('0x28')]()[_0xdca3('0x27')](function(){_0x381f91[_0xdca3('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ba131,_0x3cdca2){return function(_0x458fef){if(!_0x458fef){_0x5ba131[_0xdca3('0x29')](0x194);}return _0x458fef;};}function handleError(_0x2a66ff,_0x57994c){_0x57994c=_0x57994c||0x1f4;return function(_0x48d945){logger[_0xdca3('0x2a')](_0x48d945[_0xdca3('0x2b')]);if(_0x48d945['name']){delete _0x48d945[_0xdca3('0x2c')];}_0x2a66ff[_0xdca3('0x1b')](_0x57994c)[_0xdca3('0x2d')](_0x48d945);};}exports[_0xdca3('0x2e')]=function(_0x39a886,_0x4ada6b){var _0x458c4e={},_0x5e9774={},_0x492b19={'count':0x0,'rows':[]};var _0x6f89bd=_[_0xdca3('0x2f')](db[_0xdca3('0x30')][_0xdca3('0x31')],function(_0xfdfb33){return{'name':_0xfdfb33['fieldName'],'type':_0xfdfb33[_0xdca3('0x32')]['key']};});_0x5e9774['model']=_[_0xdca3('0x2f')](_0x6f89bd,'name');_0x5e9774['query']=_[_0xdca3('0x33')](_0x39a886[_0xdca3('0x34')]);_0x5e9774[_0xdca3('0x35')]=_['intersection'](_0x5e9774[_0xdca3('0x36')],_0x5e9774[_0xdca3('0x34')]);_0x458c4e['attributes']=_[_0xdca3('0x37')](_0x5e9774[_0xdca3('0x36')],qs[_0xdca3('0x38')](_0x39a886['query']['fields']));_0x458c4e[_0xdca3('0x39')]=_0x458c4e[_0xdca3('0x39')][_0xdca3('0x3a')]?_0x458c4e['attributes']:_0x5e9774[_0xdca3('0x36')];if(!_0x39a886[_0xdca3('0x34')]['hasOwnProperty'](_0xdca3('0x3b'))){_0x458c4e[_0xdca3('0x3c')]=qs[_0xdca3('0x3c')](_0x39a886['query']['limit']);_0x458c4e[_0xdca3('0x1e')]=qs['offset'](_0x39a886[_0xdca3('0x34')]['offset']);}_0x458c4e['order']=qs[_0xdca3('0x3d')](_0x39a886[_0xdca3('0x34')][_0xdca3('0x3d')]);_0x458c4e[_0xdca3('0x3e')]=qs[_0xdca3('0x35')](_[_0xdca3('0x3f')](_0x39a886[_0xdca3('0x34')],_0x5e9774[_0xdca3('0x35')]),_0x6f89bd);if(_0x39a886[_0xdca3('0x34')][_0xdca3('0x40')]){_0x458c4e[_0xdca3('0x3e')]=_['merge'](_0x458c4e[_0xdca3('0x3e')],{'$or':_[_0xdca3('0x2f')](_0x6f89bd,function(_0xa15291){if(_0xa15291[_0xdca3('0x32')]!==_0xdca3('0x41')){var _0x7a0d15={};_0x7a0d15[_0xa15291['name']]={'$like':'%'+_0x39a886[_0xdca3('0x34')][_0xdca3('0x40')]+'%'};return _0x7a0d15;}})});}_0x458c4e=_[_0xdca3('0x42')]({},_0x458c4e,_0x39a886[_0xdca3('0x43')]);var _0x46ac33={'where':_0x458c4e['where']};return db[_0xdca3('0x30')][_0xdca3('0x20')](_0x46ac33)[_0xdca3('0x27')](function(_0x1324e8){_0x492b19[_0xdca3('0x20')]=_0x1324e8;if(_0x39a886[_0xdca3('0x34')][_0xdca3('0x44')]){_0x458c4e[_0xdca3('0x45')]=[{'all':!![]}];}return db[_0xdca3('0x30')][_0xdca3('0x46')](_0x458c4e);})[_0xdca3('0x27')](function(_0xde2b57){_0x492b19[_0xdca3('0x47')]=_0xde2b57;return _0x492b19;})['then'](respondWithFilteredResult(_0x4ada6b,_0x458c4e))['catch'](handleError(_0x4ada6b,null));};exports[_0xdca3('0x48')]=function(_0x5a66ea,_0x52c2d4){var _0x62eb62={'raw':![],'where':{'id':_0x5a66ea[_0xdca3('0x49')]['id']}},_0x3342a9={};_0x3342a9[_0xdca3('0x36')]=_[_0xdca3('0x33')](db[_0xdca3('0x30')][_0xdca3('0x31')]);_0x3342a9[_0xdca3('0x34')]=_[_0xdca3('0x33')](_0x5a66ea[_0xdca3('0x34')]);_0x3342a9[_0xdca3('0x35')]=_[_0xdca3('0x37')](_0x3342a9[_0xdca3('0x36')],_0x3342a9['query']);_0x62eb62[_0xdca3('0x39')]=_['intersection'](_0x3342a9[_0xdca3('0x36')],qs[_0xdca3('0x38')](_0x5a66ea[_0xdca3('0x34')][_0xdca3('0x38')]));_0x62eb62[_0xdca3('0x39')]=_0x62eb62[_0xdca3('0x39')]['length']?_0x62eb62[_0xdca3('0x39')]:_0x3342a9[_0xdca3('0x36')];if(_0x5a66ea[_0xdca3('0x34')][_0xdca3('0x44')]){_0x62eb62[_0xdca3('0x45')]=[{'all':!![]}];}_0x62eb62=_[_0xdca3('0x42')]({},_0x62eb62,_0x5a66ea[_0xdca3('0x43')]);return db[_0xdca3('0x30')][_0xdca3('0x4a')](_0x62eb62)[_0xdca3('0x27')](handleEntityNotFound(_0x52c2d4,null))[_0xdca3('0x27')](respondWithResult(_0x52c2d4,null))[_0xdca3('0x4b')](handleError(_0x52c2d4,null));};exports[_0xdca3('0x4c')]=function(_0x3e2f48,_0x240f88){return db['VtigerConfiguration'][_0xdca3('0x4c')](_0x3e2f48['body'],{})[_0xdca3('0x27')](respondWithResult(_0x240f88,0xc9))[_0xdca3('0x4b')](handleError(_0x240f88,null));};exports[_0xdca3('0x26')]=function(_0x3e2a45,_0x2bd823){if(_0x3e2a45['body']['id']){delete _0x3e2a45[_0xdca3('0x4d')]['id'];}return db[_0xdca3('0x30')]['find']({'where':{'id':_0x3e2a45[_0xdca3('0x49')]['id']}})[_0xdca3('0x27')](handleEntityNotFound(_0x2bd823,null))[_0xdca3('0x27')](saveUpdates(_0x3e2a45[_0xdca3('0x4d')],null))['then'](respondWithResult(_0x2bd823,null))['catch'](handleError(_0x2bd823,null));};exports['destroy']=function(_0x1b0fd7,_0x3ab387){return db[_0xdca3('0x30')]['find']({'where':{'id':_0x1b0fd7[_0xdca3('0x49')]['id']}})[_0xdca3('0x27')](handleEntityNotFound(_0x3ab387,null))[_0xdca3('0x27')](removeEntity(_0x3ab387,null))[_0xdca3('0x4b')](handleError(_0x3ab387,null));};exports[_0xdca3('0x4e')]=function(_0x4183e6,_0x4821eb,_0x408204){var _0x496358={};var _0x10d718={};var _0x400e2a;var _0x398555;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x4183e6[_0xdca3('0x49')]['id']}})[_0xdca3('0x27')](handleEntityNotFound(_0x4821eb,null))['then'](function(_0x281bab){if(_0x281bab){_0x400e2a=_0x281bab;_0x10d718['model']=_[_0xdca3('0x33')](db[_0xdca3('0x4f')][_0xdca3('0x31')]);_0x10d718[_0xdca3('0x34')]=_[_0xdca3('0x33')](_0x4183e6[_0xdca3('0x34')]);_0x10d718[_0xdca3('0x35')]=_[_0xdca3('0x37')](_0x10d718[_0xdca3('0x36')],_0x10d718['query']);_0x496358[_0xdca3('0x39')]=_[_0xdca3('0x37')](_0x10d718[_0xdca3('0x36')],qs[_0xdca3('0x38')](_0x4183e6[_0xdca3('0x34')][_0xdca3('0x38')]));_0x496358[_0xdca3('0x39')]=_0x496358['attributes'][_0xdca3('0x3a')]?_0x496358[_0xdca3('0x39')]:_0x10d718[_0xdca3('0x36')];_0x496358[_0xdca3('0x50')]=qs['sort'](_0x4183e6[_0xdca3('0x34')][_0xdca3('0x3d')]);_0x496358[_0xdca3('0x3e')]=qs['filters'](_[_0xdca3('0x3f')](_0x4183e6[_0xdca3('0x34')],_0x10d718[_0xdca3('0x35')]));if(_0x4183e6['query'][_0xdca3('0x40')]){_0x496358['where']=_[_0xdca3('0x42')](_0x496358[_0xdca3('0x3e')],{'$or':_[_0xdca3('0x2f')](_0x496358[_0xdca3('0x39')],function(_0x133823){var _0x5b752c={};_0x5b752c[_0x133823]={'$like':'%'+_0x4183e6[_0xdca3('0x34')][_0xdca3('0x40')]+'%'};return _0x5b752c;})});}_0x496358=_[_0xdca3('0x42')]({},_0x496358,_0x4183e6[_0xdca3('0x43')]);return _0x400e2a[_0xdca3('0x4e')](_0x496358);}})['then'](function(_0x41a43f){if(_0x41a43f){_0x398555=_0x41a43f['length'];if(!_0x4183e6[_0xdca3('0x34')][_0xdca3('0x51')](_0xdca3('0x3b'))){_0x496358[_0xdca3('0x3c')]=qs[_0xdca3('0x3c')](_0x4183e6[_0xdca3('0x34')][_0xdca3('0x3c')]);_0x496358['offset']=qs[_0xdca3('0x1e')](_0x4183e6['query'][_0xdca3('0x1e')]);}return _0x400e2a['getFields'](_0x496358);}})['then'](function(_0x31d14b){if(_0x31d14b){return _0x31d14b?{'count':_0x398555,'rows':_0x31d14b}:null;}})['then'](respondWithResult(_0x4821eb,null))[_0xdca3('0x4b')](handleError(_0x4821eb,null));};exports[_0xdca3('0x52')]=function(_0x52737e,_0x461463,_0x364e03){var _0x23c9f9={};var _0x27fab4={};var _0x10afb5;var _0x28f26b;return db[_0xdca3('0x30')][_0xdca3('0x53')]({'where':{'id':_0x52737e[_0xdca3('0x49')]['id']}})['then'](handleEntityNotFound(_0x461463,null))[_0xdca3('0x27')](function(_0x5af438){if(_0x5af438){_0x10afb5=_0x5af438;_0x27fab4[_0xdca3('0x36')]=_['keys'](db[_0xdca3('0x4f')]['rawAttributes']);_0x27fab4['query']=_[_0xdca3('0x33')](_0x52737e[_0xdca3('0x34')]);_0x27fab4[_0xdca3('0x35')]=_['intersection'](_0x27fab4[_0xdca3('0x36')],_0x27fab4[_0xdca3('0x34')]);_0x23c9f9[_0xdca3('0x39')]=_[_0xdca3('0x37')](_0x27fab4[_0xdca3('0x36')],qs['fields'](_0x52737e[_0xdca3('0x34')][_0xdca3('0x38')]));_0x23c9f9[_0xdca3('0x39')]=_0x23c9f9[_0xdca3('0x39')][_0xdca3('0x3a')]?_0x23c9f9[_0xdca3('0x39')]:_0x27fab4[_0xdca3('0x36')];_0x23c9f9[_0xdca3('0x50')]=qs[_0xdca3('0x3d')](_0x52737e[_0xdca3('0x34')][_0xdca3('0x3d')]);_0x23c9f9[_0xdca3('0x3e')]=qs[_0xdca3('0x35')](_['pick'](_0x52737e[_0xdca3('0x34')],_0x27fab4[_0xdca3('0x35')]));if(_0x52737e[_0xdca3('0x34')][_0xdca3('0x40')]){_0x23c9f9[_0xdca3('0x3e')]=_[_0xdca3('0x42')](_0x23c9f9[_0xdca3('0x3e')],{'$or':_['map'](_0x23c9f9[_0xdca3('0x39')],function(_0x589f78){var _0x4eb634={};_0x4eb634[_0x589f78]={'$like':'%'+_0x52737e[_0xdca3('0x34')]['filter']+'%'};return _0x4eb634;})});}_0x23c9f9=_[_0xdca3('0x42')]({},_0x23c9f9,_0x52737e[_0xdca3('0x43')]);return _0x10afb5[_0xdca3('0x52')](_0x23c9f9);}})[_0xdca3('0x27')](function(_0x397294){if(_0x397294){_0x28f26b=_0x397294[_0xdca3('0x3a')];if(!_0x52737e[_0xdca3('0x34')][_0xdca3('0x51')](_0xdca3('0x3b'))){_0x23c9f9['limit']=qs[_0xdca3('0x3c')](_0x52737e[_0xdca3('0x34')][_0xdca3('0x3c')]);_0x23c9f9[_0xdca3('0x1e')]=qs[_0xdca3('0x1e')](_0x52737e[_0xdca3('0x34')][_0xdca3('0x1e')]);}return _0x10afb5[_0xdca3('0x52')](_0x23c9f9);}})[_0xdca3('0x27')](function(_0x2c70a7){if(_0x2c70a7){return _0x2c70a7?{'count':_0x28f26b,'rows':_0x2c70a7}:null;}})[_0xdca3('0x27')](respondWithResult(_0x461463,null))['catch'](handleError(_0x461463,null));};exports[_0xdca3('0x54')]=function(_0x28cba6,_0x5628d7,_0x48ce4e){var _0x1de7eb={};var _0x1c3717={};var _0xc5ef0;var _0x1bb4d1;return db[_0xdca3('0x30')][_0xdca3('0x53')]({'where':{'id':_0x28cba6[_0xdca3('0x49')]['id']}})[_0xdca3('0x27')](handleEntityNotFound(_0x5628d7,null))[_0xdca3('0x27')](function(_0x4a7e9e){if(_0x4a7e9e){_0xc5ef0=_0x4a7e9e;_0x1c3717[_0xdca3('0x36')]=_['keys'](db[_0xdca3('0x4f')][_0xdca3('0x31')]);_0x1c3717[_0xdca3('0x34')]=_[_0xdca3('0x33')](_0x28cba6[_0xdca3('0x34')]);_0x1c3717[_0xdca3('0x35')]=_[_0xdca3('0x37')](_0x1c3717[_0xdca3('0x36')],_0x1c3717[_0xdca3('0x34')]);_0x1de7eb['attributes']=_[_0xdca3('0x37')](_0x1c3717[_0xdca3('0x36')],qs[_0xdca3('0x38')](_0x28cba6[_0xdca3('0x34')]['fields']));_0x1de7eb[_0xdca3('0x39')]=_0x1de7eb[_0xdca3('0x39')]['length']?_0x1de7eb[_0xdca3('0x39')]:_0x1c3717[_0xdca3('0x36')];_0x1de7eb[_0xdca3('0x50')]=qs['sort'](_0x28cba6[_0xdca3('0x34')][_0xdca3('0x3d')]);_0x1de7eb[_0xdca3('0x3e')]=qs[_0xdca3('0x35')](_[_0xdca3('0x3f')](_0x28cba6[_0xdca3('0x34')],_0x1c3717[_0xdca3('0x35')]));if(_0x28cba6[_0xdca3('0x34')][_0xdca3('0x40')]){_0x1de7eb['where']=_[_0xdca3('0x42')](_0x1de7eb[_0xdca3('0x3e')],{'$or':_['map'](_0x1de7eb[_0xdca3('0x39')],function(_0x19b1f7){var _0x364fb4={};_0x364fb4[_0x19b1f7]={'$like':'%'+_0x28cba6[_0xdca3('0x34')][_0xdca3('0x40')]+'%'};return _0x364fb4;})});}_0x1de7eb=_[_0xdca3('0x42')]({},_0x1de7eb,_0x28cba6[_0xdca3('0x43')]);return _0xc5ef0[_0xdca3('0x54')](_0x1de7eb);}})[_0xdca3('0x27')](function(_0x325249){if(_0x325249){_0x1bb4d1=_0x325249[_0xdca3('0x3a')];if(!_0x28cba6[_0xdca3('0x34')]['hasOwnProperty'](_0xdca3('0x3b'))){_0x1de7eb['limit']=qs[_0xdca3('0x3c')](_0x28cba6[_0xdca3('0x34')]['limit']);_0x1de7eb[_0xdca3('0x1e')]=qs[_0xdca3('0x1e')](_0x28cba6[_0xdca3('0x34')]['offset']);}return _0xc5ef0[_0xdca3('0x54')](_0x1de7eb);}})['then'](function(_0x4ed312){if(_0x4ed312){return _0x4ed312?{'count':_0x1bb4d1,'rows':_0x4ed312}:null;}})[_0xdca3('0x27')](respondWithResult(_0x5628d7,null))[_0xdca3('0x4b')](handleError(_0x5628d7,null));}; \ No newline at end of file +var _0x5c5a=['show','params','rawAttributes','length','includeAll','find','create','body','getFields','findOne','VtigerField','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','index','map','VtigerConfiguration','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch'];(function(_0x5c1930,_0x1b15e7){var _0x163a34=function(_0x52b4b5){while(--_0x52b4b5){_0x5c1930['push'](_0x5c1930['shift']());}};_0x163a34(++_0x1b15e7);}(_0x5c5a,0x198));var _0xa5c5=function(_0x41b6e0,_0x538934){_0x41b6e0=_0x41b6e0-0x0;var _0x162332=_0x5c5a[_0x41b6e0];return _0x162332;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa5c5('0x0'));var zipdir=require(_0xa5c5('0x1'));var jsonpatch=require(_0xa5c5('0x2'));var rp=require('request-promise');var moment=require(_0xa5c5('0x3'));var BPromise=require(_0xa5c5('0x4'));var Mustache=require(_0xa5c5('0x5'));var util=require(_0xa5c5('0x6'));var path=require('path');var sox=require(_0xa5c5('0x7'));var csv=require(_0xa5c5('0x8'));var ejs=require(_0xa5c5('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa5c5('0xa'));var squel=require('squel');var crypto=require(_0xa5c5('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xa5c5('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa5c5('0xd'));var Papa=require('papaparse');var Redis=require(_0xa5c5('0xe'));var authService=require(_0xa5c5('0xf'));var qs=require(_0xa5c5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa5c5('0x11'));var utils=require(_0xa5c5('0x12'));var config=require(_0xa5c5('0x13'));var licenseUtil=require(_0xa5c5('0x14'));var db=require(_0xa5c5('0x15'))['db'];function respondWithStatusCode(_0x4eacd2,_0x2d4e0c){_0x2d4e0c=_0x2d4e0c||0xcc;return function(_0x543241){if(_0x543241){return _0x4eacd2[_0xa5c5('0x16')](_0x2d4e0c);}return _0x4eacd2[_0xa5c5('0x17')](_0x2d4e0c)['end']();};}function respondWithResult(_0x31bc79,_0x1adcec){_0x1adcec=_0x1adcec||0xc8;return function(_0x23292a){if(_0x23292a){return _0x31bc79[_0xa5c5('0x17')](_0x1adcec)[_0xa5c5('0x18')](_0x23292a);}};}function respondWithFilteredResult(_0x387d12,_0xaf67a9){return function(_0x4a0e98){if(_0x4a0e98){var _0x5c9b0b=typeof _0xaf67a9[_0xa5c5('0x19')]==='undefined'&&typeof _0xaf67a9[_0xa5c5('0x1a')]===_0xa5c5('0x1b');var _0x4c3842=_0x4a0e98[_0xa5c5('0x1c')];var _0x34c7f9=_0x5c9b0b?0x0:_0xaf67a9['offset'];var _0xb1340b=_0x5c9b0b?_0x4a0e98[_0xa5c5('0x1c')]:_0xaf67a9[_0xa5c5('0x19')]+_0xaf67a9[_0xa5c5('0x1a')];var _0x36daa5;if(_0xb1340b>=_0x4c3842){_0xb1340b=_0x4c3842;_0x36daa5=0xc8;}else{_0x36daa5=0xce;}_0x387d12[_0xa5c5('0x17')](_0x36daa5);return _0x387d12['set'](_0xa5c5('0x1d'),_0x34c7f9+'-'+_0xb1340b+'/'+_0x4c3842)[_0xa5c5('0x18')](_0x4a0e98);}return null;};}function patchUpdates(_0x5979e6){return function(_0x3cd672){try{jsonpatch[_0xa5c5('0x1e')](_0x3cd672,_0x5979e6,!![]);}catch(_0x3a2314){return BPromise[_0xa5c5('0x1f')](_0x3a2314);}return _0x3cd672[_0xa5c5('0x20')]();};}function saveUpdates(_0x34ef26,_0x57a5f3){return function(_0x5a8ad4){if(_0x5a8ad4){return _0x5a8ad4[_0xa5c5('0x21')](_0x34ef26)['then'](function(_0x1b8ce0){return _0x1b8ce0;});}return null;};}function removeEntity(_0x495360,_0x222e78){return function(_0x2c4b77){if(_0x2c4b77){return _0x2c4b77[_0xa5c5('0x22')]()[_0xa5c5('0x23')](function(){_0x495360[_0xa5c5('0x17')](0xcc)[_0xa5c5('0x24')]();});}};}function handleEntityNotFound(_0x4d0bce,_0x4bf777){return function(_0xeb0ab0){if(!_0xeb0ab0){_0x4d0bce[_0xa5c5('0x16')](0x194);}return _0xeb0ab0;};}function handleError(_0x5494ac,_0x424c1d){_0x424c1d=_0x424c1d||0x1f4;return function(_0x11d23f){logger[_0xa5c5('0x25')](_0x11d23f[_0xa5c5('0x26')]);if(_0x11d23f[_0xa5c5('0x27')]){delete _0x11d23f[_0xa5c5('0x27')];}_0x5494ac[_0xa5c5('0x17')](_0x424c1d)['send'](_0x11d23f);};}exports[_0xa5c5('0x28')]=function(_0x1fe18c,_0x13b782){var _0x2c3c55={},_0x8e1c40={},_0x216408={'count':0x0,'rows':[]};var _0x34fdd0=_[_0xa5c5('0x29')](db[_0xa5c5('0x2a')]['rawAttributes'],function(_0x9f9107){return{'name':_0x9f9107[_0xa5c5('0x2b')],'type':_0x9f9107[_0xa5c5('0x2c')][_0xa5c5('0x2d')]};});_0x8e1c40['model']=_[_0xa5c5('0x29')](_0x34fdd0,_0xa5c5('0x27'));_0x8e1c40['query']=_[_0xa5c5('0x2e')](_0x1fe18c[_0xa5c5('0x2f')]);_0x8e1c40[_0xa5c5('0x30')]=_[_0xa5c5('0x31')](_0x8e1c40[_0xa5c5('0x32')],_0x8e1c40['query']);_0x2c3c55['attributes']=_[_0xa5c5('0x31')](_0x8e1c40[_0xa5c5('0x32')],qs[_0xa5c5('0x33')](_0x1fe18c[_0xa5c5('0x2f')]['fields']));_0x2c3c55[_0xa5c5('0x34')]=_0x2c3c55[_0xa5c5('0x34')]['length']?_0x2c3c55[_0xa5c5('0x34')]:_0x8e1c40[_0xa5c5('0x32')];if(!_0x1fe18c[_0xa5c5('0x2f')][_0xa5c5('0x35')](_0xa5c5('0x36'))){_0x2c3c55[_0xa5c5('0x1a')]=qs[_0xa5c5('0x1a')](_0x1fe18c[_0xa5c5('0x2f')][_0xa5c5('0x1a')]);_0x2c3c55['offset']=qs[_0xa5c5('0x19')](_0x1fe18c[_0xa5c5('0x2f')][_0xa5c5('0x19')]);}_0x2c3c55[_0xa5c5('0x37')]=qs[_0xa5c5('0x38')](_0x1fe18c['query'][_0xa5c5('0x38')]);_0x2c3c55[_0xa5c5('0x39')]=qs[_0xa5c5('0x30')](_[_0xa5c5('0x3a')](_0x1fe18c['query'],_0x8e1c40[_0xa5c5('0x30')]),_0x34fdd0);if(_0x1fe18c[_0xa5c5('0x2f')][_0xa5c5('0x3b')]){_0x2c3c55['where']=_[_0xa5c5('0x3c')](_0x2c3c55[_0xa5c5('0x39')],{'$or':_['map'](_0x34fdd0,function(_0x1de0ea){if(_0x1de0ea[_0xa5c5('0x2c')]!==_0xa5c5('0x3d')){var _0x208325={};_0x208325[_0x1de0ea[_0xa5c5('0x27')]]={'$like':'%'+_0x1fe18c[_0xa5c5('0x2f')][_0xa5c5('0x3b')]+'%'};return _0x208325;}})});}_0x2c3c55=_[_0xa5c5('0x3c')]({},_0x2c3c55,_0x1fe18c[_0xa5c5('0x3e')]);var _0x4a9ec6={'where':_0x2c3c55[_0xa5c5('0x39')]};return db['VtigerConfiguration']['count'](_0x4a9ec6)[_0xa5c5('0x23')](function(_0x4ee7db){_0x216408['count']=_0x4ee7db;if(_0x1fe18c['query']['includeAll']){_0x2c3c55[_0xa5c5('0x3f')]=[{'all':!![]}];}return db[_0xa5c5('0x2a')][_0xa5c5('0x40')](_0x2c3c55);})[_0xa5c5('0x23')](function(_0xd2d29d){_0x216408['rows']=_0xd2d29d;return _0x216408;})[_0xa5c5('0x23')](respondWithFilteredResult(_0x13b782,_0x2c3c55))[_0xa5c5('0x41')](handleError(_0x13b782,null));};exports[_0xa5c5('0x42')]=function(_0x3522ef,_0x59f9dd){var _0x5b8745={'raw':![],'where':{'id':_0x3522ef[_0xa5c5('0x43')]['id']}},_0x2f5497={};_0x2f5497[_0xa5c5('0x32')]=_['keys'](db[_0xa5c5('0x2a')][_0xa5c5('0x44')]);_0x2f5497[_0xa5c5('0x2f')]=_[_0xa5c5('0x2e')](_0x3522ef[_0xa5c5('0x2f')]);_0x2f5497[_0xa5c5('0x30')]=_[_0xa5c5('0x31')](_0x2f5497[_0xa5c5('0x32')],_0x2f5497[_0xa5c5('0x2f')]);_0x5b8745[_0xa5c5('0x34')]=_[_0xa5c5('0x31')](_0x2f5497[_0xa5c5('0x32')],qs[_0xa5c5('0x33')](_0x3522ef['query'][_0xa5c5('0x33')]));_0x5b8745[_0xa5c5('0x34')]=_0x5b8745[_0xa5c5('0x34')][_0xa5c5('0x45')]?_0x5b8745[_0xa5c5('0x34')]:_0x2f5497[_0xa5c5('0x32')];if(_0x3522ef['query'][_0xa5c5('0x46')]){_0x5b8745[_0xa5c5('0x3f')]=[{'all':!![]}];}_0x5b8745=_[_0xa5c5('0x3c')]({},_0x5b8745,_0x3522ef[_0xa5c5('0x3e')]);return db[_0xa5c5('0x2a')][_0xa5c5('0x47')](_0x5b8745)[_0xa5c5('0x23')](handleEntityNotFound(_0x59f9dd,null))[_0xa5c5('0x23')](respondWithResult(_0x59f9dd,null))[_0xa5c5('0x41')](handleError(_0x59f9dd,null));};exports[_0xa5c5('0x48')]=function(_0x20d155,_0x588dbe){return db[_0xa5c5('0x2a')][_0xa5c5('0x48')](_0x20d155[_0xa5c5('0x49')],{})[_0xa5c5('0x23')](respondWithResult(_0x588dbe,0xc9))['catch'](handleError(_0x588dbe,null));};exports['update']=function(_0x25a351,_0x2f2b1b){if(_0x25a351[_0xa5c5('0x49')]['id']){delete _0x25a351[_0xa5c5('0x49')]['id'];}return db['VtigerConfiguration'][_0xa5c5('0x47')]({'where':{'id':_0x25a351[_0xa5c5('0x43')]['id']}})[_0xa5c5('0x23')](handleEntityNotFound(_0x2f2b1b,null))['then'](saveUpdates(_0x25a351[_0xa5c5('0x49')],null))[_0xa5c5('0x23')](respondWithResult(_0x2f2b1b,null))['catch'](handleError(_0x2f2b1b,null));};exports[_0xa5c5('0x22')]=function(_0x27f641,_0x33284f){return db['VtigerConfiguration'][_0xa5c5('0x47')]({'where':{'id':_0x27f641[_0xa5c5('0x43')]['id']}})['then'](handleEntityNotFound(_0x33284f,null))[_0xa5c5('0x23')](removeEntity(_0x33284f,null))[_0xa5c5('0x41')](handleError(_0x33284f,null));};exports[_0xa5c5('0x4a')]=function(_0x3d3c0e,_0x266af4,_0x28a29e){var _0x719dce={};var _0x2d27a8={};var _0x2aa932;var _0x46b35f;return db[_0xa5c5('0x2a')][_0xa5c5('0x4b')]({'where':{'id':_0x3d3c0e[_0xa5c5('0x43')]['id']}})['then'](handleEntityNotFound(_0x266af4,null))['then'](function(_0x9afef7){if(_0x9afef7){_0x2aa932=_0x9afef7;_0x2d27a8[_0xa5c5('0x32')]=_[_0xa5c5('0x2e')](db[_0xa5c5('0x4c')][_0xa5c5('0x44')]);_0x2d27a8['query']=_['keys'](_0x3d3c0e[_0xa5c5('0x2f')]);_0x2d27a8[_0xa5c5('0x30')]=_['intersection'](_0x2d27a8['model'],_0x2d27a8[_0xa5c5('0x2f')]);_0x719dce['attributes']=_[_0xa5c5('0x31')](_0x2d27a8[_0xa5c5('0x32')],qs[_0xa5c5('0x33')](_0x3d3c0e[_0xa5c5('0x2f')][_0xa5c5('0x33')]));_0x719dce['attributes']=_0x719dce[_0xa5c5('0x34')][_0xa5c5('0x45')]?_0x719dce[_0xa5c5('0x34')]:_0x2d27a8[_0xa5c5('0x32')];_0x719dce[_0xa5c5('0x37')]=qs[_0xa5c5('0x38')](_0x3d3c0e[_0xa5c5('0x2f')]['sort']);_0x719dce[_0xa5c5('0x39')]=qs[_0xa5c5('0x30')](_[_0xa5c5('0x3a')](_0x3d3c0e[_0xa5c5('0x2f')],_0x2d27a8['filters']));if(_0x3d3c0e[_0xa5c5('0x2f')][_0xa5c5('0x3b')]){_0x719dce[_0xa5c5('0x39')]=_[_0xa5c5('0x3c')](_0x719dce[_0xa5c5('0x39')],{'$or':_['map'](_0x719dce[_0xa5c5('0x34')],function(_0x2d33f2){var _0x279b66={};_0x279b66[_0x2d33f2]={'$like':'%'+_0x3d3c0e[_0xa5c5('0x2f')][_0xa5c5('0x3b')]+'%'};return _0x279b66;})});}_0x719dce=_[_0xa5c5('0x3c')]({},_0x719dce,_0x3d3c0e[_0xa5c5('0x3e')]);return _0x2aa932[_0xa5c5('0x4a')](_0x719dce);}})[_0xa5c5('0x23')](function(_0x4180fc){if(_0x4180fc){_0x46b35f=_0x4180fc[_0xa5c5('0x45')];if(!_0x3d3c0e[_0xa5c5('0x2f')][_0xa5c5('0x35')](_0xa5c5('0x36'))){_0x719dce[_0xa5c5('0x1a')]=qs[_0xa5c5('0x1a')](_0x3d3c0e[_0xa5c5('0x2f')][_0xa5c5('0x1a')]);_0x719dce[_0xa5c5('0x19')]=qs['offset'](_0x3d3c0e[_0xa5c5('0x2f')]['offset']);}return _0x2aa932[_0xa5c5('0x4a')](_0x719dce);}})[_0xa5c5('0x23')](function(_0x54488a){if(_0x54488a){return _0x54488a?{'count':_0x46b35f,'rows':_0x54488a}:null;}})[_0xa5c5('0x23')](respondWithResult(_0x266af4,null))['catch'](handleError(_0x266af4,null));};exports['getSubjects']=function(_0x268eee,_0xd90f4e,_0x56433d){var _0x486bbe={};var _0x3f7dbc={};var _0x2356b1;var _0x4cac1c;return db[_0xa5c5('0x2a')][_0xa5c5('0x4b')]({'where':{'id':_0x268eee[_0xa5c5('0x43')]['id']}})[_0xa5c5('0x23')](handleEntityNotFound(_0xd90f4e,null))[_0xa5c5('0x23')](function(_0x48df6d){if(_0x48df6d){_0x2356b1=_0x48df6d;_0x3f7dbc[_0xa5c5('0x32')]=_[_0xa5c5('0x2e')](db[_0xa5c5('0x4c')]['rawAttributes']);_0x3f7dbc[_0xa5c5('0x2f')]=_[_0xa5c5('0x2e')](_0x268eee['query']);_0x3f7dbc[_0xa5c5('0x30')]=_[_0xa5c5('0x31')](_0x3f7dbc[_0xa5c5('0x32')],_0x3f7dbc[_0xa5c5('0x2f')]);_0x486bbe[_0xa5c5('0x34')]=_[_0xa5c5('0x31')](_0x3f7dbc[_0xa5c5('0x32')],qs[_0xa5c5('0x33')](_0x268eee[_0xa5c5('0x2f')][_0xa5c5('0x33')]));_0x486bbe['attributes']=_0x486bbe[_0xa5c5('0x34')][_0xa5c5('0x45')]?_0x486bbe[_0xa5c5('0x34')]:_0x3f7dbc[_0xa5c5('0x32')];_0x486bbe[_0xa5c5('0x37')]=qs[_0xa5c5('0x38')](_0x268eee[_0xa5c5('0x2f')][_0xa5c5('0x38')]);_0x486bbe[_0xa5c5('0x39')]=qs[_0xa5c5('0x30')](_[_0xa5c5('0x3a')](_0x268eee[_0xa5c5('0x2f')],_0x3f7dbc[_0xa5c5('0x30')]));if(_0x268eee[_0xa5c5('0x2f')][_0xa5c5('0x3b')]){_0x486bbe[_0xa5c5('0x39')]=_[_0xa5c5('0x3c')](_0x486bbe[_0xa5c5('0x39')],{'$or':_[_0xa5c5('0x29')](_0x486bbe[_0xa5c5('0x34')],function(_0x10ece7){var _0x204227={};_0x204227[_0x10ece7]={'$like':'%'+_0x268eee[_0xa5c5('0x2f')]['filter']+'%'};return _0x204227;})});}_0x486bbe=_[_0xa5c5('0x3c')]({},_0x486bbe,_0x268eee[_0xa5c5('0x3e')]);return _0x2356b1[_0xa5c5('0x4d')](_0x486bbe);}})[_0xa5c5('0x23')](function(_0x46f5a9){if(_0x46f5a9){_0x4cac1c=_0x46f5a9['length'];if(!_0x268eee[_0xa5c5('0x2f')][_0xa5c5('0x35')](_0xa5c5('0x36'))){_0x486bbe[_0xa5c5('0x1a')]=qs[_0xa5c5('0x1a')](_0x268eee[_0xa5c5('0x2f')][_0xa5c5('0x1a')]);_0x486bbe[_0xa5c5('0x19')]=qs[_0xa5c5('0x19')](_0x268eee[_0xa5c5('0x2f')][_0xa5c5('0x19')]);}return _0x2356b1['getSubjects'](_0x486bbe);}})[_0xa5c5('0x23')](function(_0x46867e){if(_0x46867e){return _0x46867e?{'count':_0x4cac1c,'rows':_0x46867e}:null;}})[_0xa5c5('0x23')](respondWithResult(_0xd90f4e,null))['catch'](handleError(_0xd90f4e,null));};exports[_0xa5c5('0x4e')]=function(_0x5a2a03,_0x4c17d3,_0x5525e0){var _0x36edcd={};var _0xc9a004={};var _0xff5eee;var _0x564d52;return db['VtigerConfiguration'][_0xa5c5('0x4b')]({'where':{'id':_0x5a2a03[_0xa5c5('0x43')]['id']}})[_0xa5c5('0x23')](handleEntityNotFound(_0x4c17d3,null))['then'](function(_0x5abfbd){if(_0x5abfbd){_0xff5eee=_0x5abfbd;_0xc9a004[_0xa5c5('0x32')]=_[_0xa5c5('0x2e')](db[_0xa5c5('0x4c')]['rawAttributes']);_0xc9a004['query']=_[_0xa5c5('0x2e')](_0x5a2a03[_0xa5c5('0x2f')]);_0xc9a004['filters']=_[_0xa5c5('0x31')](_0xc9a004[_0xa5c5('0x32')],_0xc9a004[_0xa5c5('0x2f')]);_0x36edcd['attributes']=_[_0xa5c5('0x31')](_0xc9a004['model'],qs[_0xa5c5('0x33')](_0x5a2a03[_0xa5c5('0x2f')]['fields']));_0x36edcd['attributes']=_0x36edcd['attributes'][_0xa5c5('0x45')]?_0x36edcd[_0xa5c5('0x34')]:_0xc9a004[_0xa5c5('0x32')];_0x36edcd[_0xa5c5('0x37')]=qs[_0xa5c5('0x38')](_0x5a2a03[_0xa5c5('0x2f')][_0xa5c5('0x38')]);_0x36edcd['where']=qs['filters'](_[_0xa5c5('0x3a')](_0x5a2a03[_0xa5c5('0x2f')],_0xc9a004[_0xa5c5('0x30')]));if(_0x5a2a03['query'][_0xa5c5('0x3b')]){_0x36edcd['where']=_['merge'](_0x36edcd['where'],{'$or':_[_0xa5c5('0x29')](_0x36edcd[_0xa5c5('0x34')],function(_0x48c328){var _0x5db060={};_0x5db060[_0x48c328]={'$like':'%'+_0x5a2a03['query'][_0xa5c5('0x3b')]+'%'};return _0x5db060;})});}_0x36edcd=_[_0xa5c5('0x3c')]({},_0x36edcd,_0x5a2a03[_0xa5c5('0x3e')]);return _0xff5eee[_0xa5c5('0x4e')](_0x36edcd);}})[_0xa5c5('0x23')](function(_0x25566b){if(_0x25566b){_0x564d52=_0x25566b[_0xa5c5('0x45')];if(!_0x5a2a03['query'][_0xa5c5('0x35')](_0xa5c5('0x36'))){_0x36edcd['limit']=qs[_0xa5c5('0x1a')](_0x5a2a03[_0xa5c5('0x2f')][_0xa5c5('0x1a')]);_0x36edcd[_0xa5c5('0x19')]=qs['offset'](_0x5a2a03[_0xa5c5('0x2f')][_0xa5c5('0x19')]);}return _0xff5eee['getDescriptions'](_0x36edcd);}})[_0xa5c5('0x23')](function(_0x329d7a){if(_0x329d7a){return _0x329d7a?{'count':_0x564d52,'rows':_0x329d7a}:null;}})[_0xa5c5('0x23')](respondWithResult(_0x4c17d3,null))[_0xa5c5('0x41')](handleError(_0x4c17d3,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index bec4da3..b2955c9 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 _0x0285=['rimraf','../../config/environment','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','../../config/logger','api','moment','bluebird','path'];(function(_0x1ffb61,_0x2809b6){var _0x4ba90b=function(_0x3840a8){while(--_0x3840a8){_0x1ffb61['push'](_0x1ffb61['shift']());}};_0x4ba90b(++_0x2809b6);}(_0x0285,0xba));var _0x5028=function(_0x188360,_0x3d93f8){_0x188360=_0x188360-0x0;var _0x1fbe6d=_0x0285[_0x188360];return _0x1fbe6d;};'use strict';var _=require(_0x5028('0x0'));var util=require('util');var logger=require(_0x5028('0x1'))(_0x5028('0x2'));var moment=require(_0x5028('0x3'));var BPromise=require(_0x5028('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5028('0x5'));var rimraf=require(_0x5028('0x6'));var config=require(_0x5028('0x7'));var attributes=require('./intVtigerConfiguration.attributes');module[_0x5028('0x8')]=function(_0x375d02,_0x1a6903){return _0x375d02[_0x5028('0x9')](_0x5028('0xa'),attributes,{'tableName':_0x5028('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x100b=['lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations'];(function(_0x5f2afa,_0x3d2cd2){var _0xc21b56=function(_0x14825b){while(--_0x14825b){_0x5f2afa['push'](_0x5f2afa['shift']());}};_0xc21b56(++_0x3d2cd2);}(_0x100b,0x1d4));var _0xb100=function(_0x3cc2de,_0x51fa69){_0x3cc2de=_0x3cc2de-0x0;var _0x1a64fe=_0x100b[_0x3cc2de];return _0x1a64fe;};'use strict';var _=require(_0xb100('0x0'));var util=require(_0xb100('0x1'));var logger=require('../../config/logger')(_0xb100('0x2'));var moment=require(_0xb100('0x3'));var BPromise=require('bluebird');var rp=require(_0xb100('0x4'));var fs=require('fs');var path=require(_0xb100('0x5'));var rimraf=require(_0xb100('0x6'));var config=require(_0xb100('0x7'));var attributes=require(_0xb100('0x8'));module[_0xb100('0x9')]=function(_0x5384bd,_0x2c1b1c){return _0x5384bd[_0xb100('0xa')](_0xb100('0xb'),attributes,{'tableName':_0xb100('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 6eacc12..d4a58fa 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 _0x5032=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','request','info','VtigerConfiguration,\x20%s,\x20%s','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x280481,_0x36fa9c){var _0x572394=function(_0x17cb88){while(--_0x17cb88){_0x280481['push'](_0x280481['shift']());}};_0x572394(++_0x36fa9c);}(_0x5032,0x73));var _0x2503=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x5032[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x2503('0x0'));var util=require('util');var moment=require(_0x2503('0x1'));var BPromise=require(_0x2503('0x2'));var rs=require(_0x2503('0x3'));var fs=require('fs');var Redis=require(_0x2503('0x4'));var db=require(_0x2503('0x5'))['db'];var utils=require(_0x2503('0x6'));var logger=require(_0x2503('0x7'))('rpc');var config=require(_0x2503('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x41fd9d,_0x3ac19a,_0x539638){return new BPromise(function(_0x33a4e4,_0x24a83b){return client[_0x2503('0x9')](_0x41fd9d,_0x539638)['then'](function(_0x366645){logger[_0x2503('0xa')](_0x2503('0xb'),_0x3ac19a,'request\x20sent');logger['debug'](_0x2503('0xc'),_0x3ac19a,_0x2503('0xd'),JSON[_0x2503('0xe')](_0x366645));if(_0x366645[_0x2503('0xf')]){if(_0x366645[_0x2503('0xf')][_0x2503('0x10')]===0x1f4){logger[_0x2503('0xf')](_0x2503('0xb'),_0x3ac19a,_0x366645['error'][_0x2503('0x11')]);return _0x24a83b(_0x366645[_0x2503('0xf')][_0x2503('0x11')]);}logger[_0x2503('0xf')](_0x2503('0xb'),_0x3ac19a,_0x366645['error'][_0x2503('0x11')]);return _0x33a4e4(_0x366645['error']['message']);}else{logger[_0x2503('0xa')]('VtigerConfiguration,\x20%s,\x20%s',_0x3ac19a,'request\x20sent');_0x33a4e4(_0x366645[_0x2503('0x12')][_0x2503('0x11')]);}})[_0x2503('0x13')](function(_0x3ae414){logger[_0x2503('0xf')](_0x2503('0xb'),_0x3ac19a,_0x3ae414);_0x24a83b(_0x3ae414);});});} \ No newline at end of file +var _0x6e82=['rpc','jayson/promise','client','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3afb47,_0x54bee0){var _0xe566d2=function(_0x214891){while(--_0x214891){_0x3afb47['push'](_0x3afb47['shift']());}};_0xe566d2(++_0x54bee0);}(_0x6e82,0x173));var _0x26e8=function(_0x347ea8,_0x2ac098){_0x347ea8=_0x347ea8-0x0;var _0x2e83f4=_0x6e82[_0x347ea8];return _0x2e83f4;};'use strict';var _=require(_0x26e8('0x0'));var util=require(_0x26e8('0x1'));var moment=require(_0x26e8('0x2'));var BPromise=require('bluebird');var rs=require(_0x26e8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x26e8('0x4'))['db'];var utils=require(_0x26e8('0x5'));var logger=require(_0x26e8('0x6'))(_0x26e8('0x7'));var config=require('../../config/environment');var jayson=require(_0x26e8('0x8'));var client=jayson[_0x26e8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43152b,_0x3a41e6,_0x4bf8de){return new BPromise(function(_0x1e10d3,_0x3be6c5){return client[_0x26e8('0xa')](_0x43152b,_0x4bf8de)[_0x26e8('0xb')](function(_0x3ff3ed){logger[_0x26e8('0xc')](_0x26e8('0xd'),_0x3a41e6,_0x26e8('0xe'));logger[_0x26e8('0xf')](_0x26e8('0x10'),_0x3a41e6,_0x26e8('0xe'),JSON[_0x26e8('0x11')](_0x3ff3ed));if(_0x3ff3ed[_0x26e8('0x12')]){if(_0x3ff3ed[_0x26e8('0x12')]['code']===0x1f4){logger[_0x26e8('0x12')]('VtigerConfiguration,\x20%s,\x20%s',_0x3a41e6,_0x3ff3ed['error'][_0x26e8('0x13')]);return _0x3be6c5(_0x3ff3ed['error'][_0x26e8('0x13')]);}logger['error'](_0x26e8('0xd'),_0x3a41e6,_0x3ff3ed[_0x26e8('0x12')][_0x26e8('0x13')]);return _0x1e10d3(_0x3ff3ed['error'][_0x26e8('0x13')]);}else{logger[_0x26e8('0xc')](_0x26e8('0xd'),_0x3a41e6,_0x26e8('0xe'));_0x1e10d3(_0x3ff3ed['result'][_0x26e8('0x13')]);}})[_0x26e8('0x14')](function(_0x28d699){logger[_0x26e8('0x12')](_0x26e8('0xd'),_0x3a41e6,_0x28d699);_0x3be6c5(_0x28d699);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index a033b34..653ddfb 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 _0x2823=['../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','create','put','update','exports','multer','util','path','connect-timeout','Router'];(function(_0x1ca59f,_0x1a5cd7){var _0x2f3153=function(_0xcd56ca){while(--_0xcd56ca){_0x1ca59f['push'](_0x1ca59f['shift']());}};_0x2f3153(++_0x1a5cd7);}(_0x2823,0x1bd));var _0x3282=function(_0x355734,_0x30a816){_0x355734=_0x355734-0x0;var _0x1c5f7b=_0x2823[_0x355734];return _0x1c5f7b;};'use strict';var multer=require(_0x3282('0x0'));var util=require(_0x3282('0x1'));var path=require(_0x3282('0x2'));var timeout=require(_0x3282('0x3'));var express=require('express');var router=express[_0x3282('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3282('0x5'));var interaction=require(_0x3282('0x6'));var config=require(_0x3282('0x7'));var controller=require('./intVtigerField.controller');router['get']('/',auth[_0x3282('0x8')](),controller[_0x3282('0x9')]);router[_0x3282('0xa')](_0x3282('0xb'),auth['isAuthenticated'](),controller[_0x3282('0xc')]);router[_0x3282('0xd')]('/',auth['isAuthenticated'](),controller[_0x3282('0xe')]);router[_0x3282('0xf')]('/:id',auth[_0x3282('0x8')](),controller[_0x3282('0x10')]);router['delete'](_0x3282('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x3282('0x11')]=router; \ No newline at end of file +var _0x61ce=['get','/:id','show','post','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intVtigerField.controller','isAuthenticated','index'];(function(_0x3f8647,_0x39c233){var _0x39d095=function(_0x367490){while(--_0x367490){_0x3f8647['push'](_0x3f8647['shift']());}};_0x39d095(++_0x39c233);}(_0x61ce,0x125));var _0xe61c=function(_0x297a33,_0x5a6579){_0x297a33=_0x297a33-0x0;var _0x5e1f39=_0x61ce[_0x297a33];return _0x5e1f39;};'use strict';var multer=require(_0xe61c('0x0'));var util=require(_0xe61c('0x1'));var path=require(_0xe61c('0x2'));var timeout=require(_0xe61c('0x3'));var express=require('express');var router=express[_0xe61c('0x4')]();var fs_extra=require(_0xe61c('0x5'));var auth=require(_0xe61c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe61c('0x7'));var controller=require(_0xe61c('0x8'));router['get']('/',auth[_0xe61c('0x9')](),controller[_0xe61c('0xa')]);router[_0xe61c('0xb')](_0xe61c('0xc'),auth[_0xe61c('0x9')](),controller[_0xe61c('0xd')]);router[_0xe61c('0xe')]('/',auth[_0xe61c('0x9')](),controller['create']);router[_0xe61c('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xe61c('0x10')]);router[_0xe61c('0x11')](_0xe61c('0xc'),auth[_0xe61c('0x9')](),controller['destroy']);module[_0xe61c('0x12')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 076fa2a..0b4c8df 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 _0xa4dc=['exports','keyValue','picklist','string','STRING','ENUM','variable','BOOLEAN'];(function(_0x538152,_0x517bb3){var _0xfd3e35=function(_0x3ebc14){while(--_0x3ebc14){_0x538152['push'](_0x538152['shift']());}};_0xfd3e35(++_0x517bb3);}(_0xa4dc,0x140));var _0xca4d=function(_0x31a371,_0x50828e){_0x31a371=_0x31a371-0x0;var _0x2a5bd6=_0xa4dc[_0x31a371];return _0x2a5bd6;};'use strict';var Sequelize=require('sequelize');module[_0xca4d('0x0')]={'type':{'type':Sequelize['ENUM']('string','variable','customVariable',_0xca4d('0x1'),_0xca4d('0x2')),'defaultValue':_0xca4d('0x3')},'content':{'type':Sequelize[_0xca4d('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xca4d('0x5')]('string',_0xca4d('0x6'),'customVariable')},'keyContent':{'type':Sequelize[_0xca4d('0x4')]},'idField':{'type':Sequelize[_0xca4d('0x4')]},'nameField':{'type':Sequelize[_0xca4d('0x4')]},'customField':{'type':Sequelize[_0xca4d('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xca4d('0x4')]}}; \ No newline at end of file +var _0x6515=['string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','ENUM'];(function(_0x1a72f3,_0x217011){var _0x57ef47=function(_0x20123d){while(--_0x20123d){_0x1a72f3['push'](_0x1a72f3['shift']());}};_0x57ef47(++_0x217011);}(_0x6515,0x115));var _0x5651=function(_0x350675,_0x5c887b){_0x350675=_0x350675-0x0;var _0x1067f2=_0x6515[_0x350675];return _0x1067f2;};'use strict';var Sequelize=require(_0x5651('0x0'));module['exports']={'type':{'type':Sequelize[_0x5651('0x1')](_0x5651('0x2'),_0x5651('0x3'),_0x5651('0x4'),_0x5651('0x5'),_0x5651('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x5651('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x5651('0x1')](_0x5651('0x2'),_0x5651('0x3'),_0x5651('0x4'))},'keyContent':{'type':Sequelize[_0x5651('0x7')]},'idField':{'type':Sequelize[_0x5651('0x7')]},'nameField':{'type':Sequelize[_0x5651('0x7')]},'customField':{'type':Sequelize[_0x5651('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5651('0x7')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 14a4d66..32d7ac4 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 _0xbc52=['filters','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','include','findAll','params','intersection','length','includeAll','find','catch','create','body','destroy','eml-format','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','name','send','index','map','VtigerField','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x1da1b0,_0x4f76ec){var _0x4ffdee=function(_0x568fa3){while(--_0x568fa3){_0x1da1b0['push'](_0x1da1b0['shift']());}};_0x4ffdee(++_0x4f76ec);}(_0xbc52,0x1cc));var _0x2bc5=function(_0x4bd1db,_0x8d2f7a){_0x4bd1db=_0x4bd1db-0x0;var _0x27a416=_0xbc52[_0x4bd1db];return _0x27a416;};'use strict';var emlformat=require(_0x2bc5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2bc5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2bc5('0x2'));var moment=require(_0x2bc5('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2bc5('0x4'));var util=require('util');var path=require(_0x2bc5('0x5'));var sox=require(_0x2bc5('0x6'));var csv=require(_0x2bc5('0x7'));var ejs=require(_0x2bc5('0x8'));var fs=require('fs');var fs_extra=require(_0x2bc5('0x9'));var _=require(_0x2bc5('0xa'));var squel=require(_0x2bc5('0xb'));var crypto=require(_0x2bc5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x2bc5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2bc5('0xe'));var Redis=require(_0x2bc5('0xf'));var authService=require(_0x2bc5('0x10'));var qs=require(_0x2bc5('0x11'));var as=require(_0x2bc5('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2bc5('0x13'))('api');var utils=require(_0x2bc5('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x2bc5('0x15'));var db=require(_0x2bc5('0x16'))['db'];function respondWithStatusCode(_0x5ddf04,_0x43ab41){_0x43ab41=_0x43ab41||0xcc;return function(_0x31391f){if(_0x31391f){return _0x5ddf04[_0x2bc5('0x17')](_0x43ab41);}return _0x5ddf04['status'](_0x43ab41)[_0x2bc5('0x18')]();};}function respondWithResult(_0x56628a,_0x5d6a81){_0x5d6a81=_0x5d6a81||0xc8;return function(_0x3e57d8){if(_0x3e57d8){return _0x56628a[_0x2bc5('0x19')](_0x5d6a81)[_0x2bc5('0x1a')](_0x3e57d8);}};}function respondWithFilteredResult(_0x2dd36a,_0x4daf80){return function(_0x158591){if(_0x158591){var _0x162efd=typeof _0x4daf80[_0x2bc5('0x1b')]===_0x2bc5('0x1c')&&typeof _0x4daf80[_0x2bc5('0x1d')]==='undefined';var _0x3840d4=_0x158591[_0x2bc5('0x1e')];var _0x2f0dc8=_0x162efd?0x0:_0x4daf80[_0x2bc5('0x1b')];var _0x161e1d=_0x162efd?_0x158591[_0x2bc5('0x1e')]:_0x4daf80[_0x2bc5('0x1b')]+_0x4daf80[_0x2bc5('0x1d')];var _0x562ebc;if(_0x161e1d>=_0x3840d4){_0x161e1d=_0x3840d4;_0x562ebc=0xc8;}else{_0x562ebc=0xce;}_0x2dd36a[_0x2bc5('0x19')](_0x562ebc);return _0x2dd36a[_0x2bc5('0x1f')](_0x2bc5('0x20'),_0x2f0dc8+'-'+_0x161e1d+'/'+_0x3840d4)[_0x2bc5('0x1a')](_0x158591);}return null;};}function patchUpdates(_0x45e9d7){return function(_0x138e52){try{jsonpatch['apply'](_0x138e52,_0x45e9d7,!![]);}catch(_0x1b4352){return BPromise[_0x2bc5('0x21')](_0x1b4352);}return _0x138e52[_0x2bc5('0x22')]();};}function saveUpdates(_0xa353f2,_0x1a59fe){return function(_0x31ded6){if(_0x31ded6){return _0x31ded6[_0x2bc5('0x23')](_0xa353f2)[_0x2bc5('0x24')](function(_0x24863a){return _0x24863a;});}return null;};}function removeEntity(_0x29d08c,_0x54d00b){return function(_0x5bd401){if(_0x5bd401){return _0x5bd401['destroy']()[_0x2bc5('0x24')](function(){_0x29d08c[_0x2bc5('0x19')](0xcc)[_0x2bc5('0x18')]();});}};}function handleEntityNotFound(_0x102d2d,_0x5bf653){return function(_0x1bf085){if(!_0x1bf085){_0x102d2d[_0x2bc5('0x17')](0x194);}return _0x1bf085;};}function handleError(_0x5a38c6,_0x5179e0){_0x5179e0=_0x5179e0||0x1f4;return function(_0x22ce9d){logger[_0x2bc5('0x25')](_0x22ce9d[_0x2bc5('0x26')]);if(_0x22ce9d[_0x2bc5('0x27')]){delete _0x22ce9d[_0x2bc5('0x27')];}_0x5a38c6[_0x2bc5('0x19')](_0x5179e0)[_0x2bc5('0x28')](_0x22ce9d);};}exports[_0x2bc5('0x29')]=function(_0x5bb7c0,_0x4df9ab){var _0x400c55={},_0x3a2a8a={},_0x19dbac={'count':0x0,'rows':[]};var _0x316c15=_[_0x2bc5('0x2a')](db[_0x2bc5('0x2b')][_0x2bc5('0x2c')],function(_0x157a80){return{'name':_0x157a80[_0x2bc5('0x2d')],'type':_0x157a80[_0x2bc5('0x2e')][_0x2bc5('0x2f')]};});_0x3a2a8a[_0x2bc5('0x30')]=_[_0x2bc5('0x2a')](_0x316c15,_0x2bc5('0x27'));_0x3a2a8a[_0x2bc5('0x31')]=_[_0x2bc5('0x32')](_0x5bb7c0['query']);_0x3a2a8a[_0x2bc5('0x33')]=_['intersection'](_0x3a2a8a[_0x2bc5('0x30')],_0x3a2a8a['query']);_0x400c55[_0x2bc5('0x34')]=_['intersection'](_0x3a2a8a['model'],qs[_0x2bc5('0x35')](_0x5bb7c0[_0x2bc5('0x31')][_0x2bc5('0x35')]));_0x400c55['attributes']=_0x400c55[_0x2bc5('0x34')]['length']?_0x400c55[_0x2bc5('0x34')]:_0x3a2a8a[_0x2bc5('0x30')];if(!_0x5bb7c0['query'][_0x2bc5('0x36')](_0x2bc5('0x37'))){_0x400c55[_0x2bc5('0x1d')]=qs[_0x2bc5('0x1d')](_0x5bb7c0[_0x2bc5('0x31')][_0x2bc5('0x1d')]);_0x400c55[_0x2bc5('0x1b')]=qs[_0x2bc5('0x1b')](_0x5bb7c0[_0x2bc5('0x31')][_0x2bc5('0x1b')]);}_0x400c55['order']=qs[_0x2bc5('0x38')](_0x5bb7c0[_0x2bc5('0x31')][_0x2bc5('0x38')]);_0x400c55[_0x2bc5('0x39')]=qs[_0x2bc5('0x33')](_[_0x2bc5('0x3a')](_0x5bb7c0[_0x2bc5('0x31')],_0x3a2a8a[_0x2bc5('0x33')]),_0x316c15);if(_0x5bb7c0['query'][_0x2bc5('0x3b')]){_0x400c55[_0x2bc5('0x39')]=_[_0x2bc5('0x3c')](_0x400c55['where'],{'$or':_[_0x2bc5('0x2a')](_0x316c15,function(_0x4cd804){if(_0x4cd804['type']!=='VIRTUAL'){var _0x384c37={};_0x384c37[_0x4cd804[_0x2bc5('0x27')]]={'$like':'%'+_0x5bb7c0['query'][_0x2bc5('0x3b')]+'%'};return _0x384c37;}})});}_0x400c55=_[_0x2bc5('0x3c')]({},_0x400c55,_0x5bb7c0[_0x2bc5('0x3d')]);var _0xf5689e={'where':_0x400c55[_0x2bc5('0x39')]};return db[_0x2bc5('0x2b')][_0x2bc5('0x1e')](_0xf5689e)[_0x2bc5('0x24')](function(_0x224ba3){_0x19dbac[_0x2bc5('0x1e')]=_0x224ba3;if(_0x5bb7c0['query']['includeAll']){_0x400c55[_0x2bc5('0x3e')]=[{'all':!![]}];}return db[_0x2bc5('0x2b')][_0x2bc5('0x3f')](_0x400c55);})[_0x2bc5('0x24')](function(_0x47cf05){_0x19dbac['rows']=_0x47cf05;return _0x19dbac;})['then'](respondWithFilteredResult(_0x4df9ab,_0x400c55))['catch'](handleError(_0x4df9ab,null));};exports['show']=function(_0x5ac9f0,_0x343d54){var _0x6e4363={'raw':!![],'where':{'id':_0x5ac9f0[_0x2bc5('0x40')]['id']}},_0x490bcb={};_0x490bcb[_0x2bc5('0x30')]=_[_0x2bc5('0x32')](db['VtigerField'][_0x2bc5('0x2c')]);_0x490bcb['query']=_['keys'](_0x5ac9f0['query']);_0x490bcb[_0x2bc5('0x33')]=_['intersection'](_0x490bcb['model'],_0x490bcb[_0x2bc5('0x31')]);_0x6e4363[_0x2bc5('0x34')]=_[_0x2bc5('0x41')](_0x490bcb[_0x2bc5('0x30')],qs[_0x2bc5('0x35')](_0x5ac9f0[_0x2bc5('0x31')][_0x2bc5('0x35')]));_0x6e4363[_0x2bc5('0x34')]=_0x6e4363[_0x2bc5('0x34')][_0x2bc5('0x42')]?_0x6e4363[_0x2bc5('0x34')]:_0x490bcb['model'];if(_0x5ac9f0[_0x2bc5('0x31')][_0x2bc5('0x43')]){_0x6e4363['include']=[{'all':!![]}];}_0x6e4363=_[_0x2bc5('0x3c')]({},_0x6e4363,_0x5ac9f0['options']);return db[_0x2bc5('0x2b')][_0x2bc5('0x44')](_0x6e4363)[_0x2bc5('0x24')](handleEntityNotFound(_0x343d54,null))[_0x2bc5('0x24')](respondWithResult(_0x343d54,null))[_0x2bc5('0x45')](handleError(_0x343d54,null));};exports['create']=function(_0x4f4d6a,_0x420d51){return db[_0x2bc5('0x2b')][_0x2bc5('0x46')](_0x4f4d6a[_0x2bc5('0x47')],{})[_0x2bc5('0x24')](respondWithResult(_0x420d51,0xc9))[_0x2bc5('0x45')](handleError(_0x420d51,null));};exports[_0x2bc5('0x23')]=function(_0x321797,_0x4897ea){if(_0x321797[_0x2bc5('0x47')]['id']){delete _0x321797[_0x2bc5('0x47')]['id'];}return db['VtigerField']['find']({'where':{'id':_0x321797[_0x2bc5('0x40')]['id']}})['then'](handleEntityNotFound(_0x4897ea,null))['then'](saveUpdates(_0x321797[_0x2bc5('0x47')],null))[_0x2bc5('0x24')](respondWithResult(_0x4897ea,null))[_0x2bc5('0x45')](handleError(_0x4897ea,null));};exports[_0x2bc5('0x48')]=function(_0x504fc6,_0x12efb9){return db[_0x2bc5('0x2b')][_0x2bc5('0x44')]({'where':{'id':_0x504fc6[_0x2bc5('0x40')]['id']}})[_0x2bc5('0x24')](handleEntityNotFound(_0x12efb9,null))[_0x2bc5('0x24')](removeEntity(_0x12efb9,null))['catch'](handleError(_0x12efb9,null));}; \ No newline at end of file +var _0xad14=['VtigerField','rawAttributes','fieldName','type','key','map','keys','filters','intersection','query','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','length','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index'];(function(_0x1f7c1c,_0x2711f9){var _0x1c152d=function(_0x281a8a){while(--_0x281a8a){_0x1f7c1c['push'](_0x1f7c1c['shift']());}};_0x1c152d(++_0x2711f9);}(_0xad14,0x18d));var _0x4ad1=function(_0x36d04d,_0x469817){_0x36d04d=_0x36d04d-0x0;var _0x213b48=_0xad14[_0x36d04d];return _0x213b48;};'use strict';var emlformat=require(_0x4ad1('0x0'));var rimraf=require(_0x4ad1('0x1'));var zipdir=require(_0x4ad1('0x2'));var jsonpatch=require(_0x4ad1('0x3'));var rp=require(_0x4ad1('0x4'));var moment=require(_0x4ad1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4ad1('0x6'));var util=require('util');var path=require(_0x4ad1('0x7'));var sox=require(_0x4ad1('0x8'));var csv=require(_0x4ad1('0x9'));var ejs=require(_0x4ad1('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4ad1('0xb'));var crypto=require(_0x4ad1('0xc'));var jsforce=require(_0x4ad1('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x4ad1('0x9'));var querystring=require(_0x4ad1('0xe'));var Papa=require(_0x4ad1('0xf'));var Redis=require(_0x4ad1('0x10'));var authService=require(_0x4ad1('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4ad1('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x4ad1('0x13'));var config=require(_0x4ad1('0x14'));var licenseUtil=require(_0x4ad1('0x15'));var db=require(_0x4ad1('0x16'))['db'];function respondWithStatusCode(_0x3dc174,_0x54822c){_0x54822c=_0x54822c||0xcc;return function(_0x37874c){if(_0x37874c){return _0x3dc174[_0x4ad1('0x17')](_0x54822c);}return _0x3dc174[_0x4ad1('0x18')](_0x54822c)[_0x4ad1('0x19')]();};}function respondWithResult(_0x16d12e,_0xc441bd){_0xc441bd=_0xc441bd||0xc8;return function(_0x10a627){if(_0x10a627){return _0x16d12e[_0x4ad1('0x18')](_0xc441bd)['json'](_0x10a627);}};}function respondWithFilteredResult(_0x39f361,_0x4276cf){return function(_0x229ea5){if(_0x229ea5){var _0x428c41=typeof _0x4276cf['offset']===_0x4ad1('0x1a')&&typeof _0x4276cf[_0x4ad1('0x1b')]===_0x4ad1('0x1a');var _0x1a5abb=_0x229ea5[_0x4ad1('0x1c')];var _0x169390=_0x428c41?0x0:_0x4276cf[_0x4ad1('0x1d')];var _0x3763bd=_0x428c41?_0x229ea5[_0x4ad1('0x1c')]:_0x4276cf['offset']+_0x4276cf[_0x4ad1('0x1b')];var _0x32f2a9;if(_0x3763bd>=_0x1a5abb){_0x3763bd=_0x1a5abb;_0x32f2a9=0xc8;}else{_0x32f2a9=0xce;}_0x39f361['status'](_0x32f2a9);return _0x39f361[_0x4ad1('0x1e')](_0x4ad1('0x1f'),_0x169390+'-'+_0x3763bd+'/'+_0x1a5abb)['json'](_0x229ea5);}return null;};}function patchUpdates(_0x589585){return function(_0x3a339e){try{jsonpatch[_0x4ad1('0x20')](_0x3a339e,_0x589585,!![]);}catch(_0x27deba){return BPromise[_0x4ad1('0x21')](_0x27deba);}return _0x3a339e[_0x4ad1('0x22')]();};}function saveUpdates(_0xb52d2,_0x3b356f){return function(_0x310afb){if(_0x310afb){return _0x310afb[_0x4ad1('0x23')](_0xb52d2)[_0x4ad1('0x24')](function(_0x123296){return _0x123296;});}return null;};}function removeEntity(_0x43bbff,_0xbd2ea2){return function(_0x18686a){if(_0x18686a){return _0x18686a[_0x4ad1('0x25')]()['then'](function(){_0x43bbff[_0x4ad1('0x18')](0xcc)[_0x4ad1('0x19')]();});}};}function handleEntityNotFound(_0x35e9a4,_0x24e3bd){return function(_0x11d982){if(!_0x11d982){_0x35e9a4[_0x4ad1('0x17')](0x194);}return _0x11d982;};}function handleError(_0x5e5e8a,_0x121b52){_0x121b52=_0x121b52||0x1f4;return function(_0x211d06){logger[_0x4ad1('0x26')](_0x211d06['stack']);if(_0x211d06[_0x4ad1('0x27')]){delete _0x211d06['name'];}_0x5e5e8a[_0x4ad1('0x18')](_0x121b52)['send'](_0x211d06);};}exports[_0x4ad1('0x28')]=function(_0x1d338e,_0x3194b2){var _0x279e3b={},_0x4ed4aa={},_0x59dbdc={'count':0x0,'rows':[]};var _0x149130=_['map'](db[_0x4ad1('0x29')][_0x4ad1('0x2a')],function(_0x356341){return{'name':_0x356341[_0x4ad1('0x2b')],'type':_0x356341[_0x4ad1('0x2c')][_0x4ad1('0x2d')]};});_0x4ed4aa['model']=_[_0x4ad1('0x2e')](_0x149130,_0x4ad1('0x27'));_0x4ed4aa['query']=_[_0x4ad1('0x2f')](_0x1d338e['query']);_0x4ed4aa[_0x4ad1('0x30')]=_[_0x4ad1('0x31')](_0x4ed4aa['model'],_0x4ed4aa[_0x4ad1('0x32')]);_0x279e3b[_0x4ad1('0x33')]=_[_0x4ad1('0x31')](_0x4ed4aa[_0x4ad1('0x34')],qs['fields'](_0x1d338e[_0x4ad1('0x32')][_0x4ad1('0x35')]));_0x279e3b[_0x4ad1('0x33')]=_0x279e3b[_0x4ad1('0x33')]['length']?_0x279e3b[_0x4ad1('0x33')]:_0x4ed4aa['model'];if(!_0x1d338e[_0x4ad1('0x32')][_0x4ad1('0x36')](_0x4ad1('0x37'))){_0x279e3b['limit']=qs[_0x4ad1('0x1b')](_0x1d338e[_0x4ad1('0x32')][_0x4ad1('0x1b')]);_0x279e3b['offset']=qs['offset'](_0x1d338e[_0x4ad1('0x32')][_0x4ad1('0x1d')]);}_0x279e3b[_0x4ad1('0x38')]=qs['sort'](_0x1d338e[_0x4ad1('0x32')][_0x4ad1('0x39')]);_0x279e3b[_0x4ad1('0x3a')]=qs[_0x4ad1('0x30')](_[_0x4ad1('0x3b')](_0x1d338e[_0x4ad1('0x32')],_0x4ed4aa['filters']),_0x149130);if(_0x1d338e[_0x4ad1('0x32')]['filter']){_0x279e3b['where']=_[_0x4ad1('0x3c')](_0x279e3b[_0x4ad1('0x3a')],{'$or':_[_0x4ad1('0x2e')](_0x149130,function(_0x543736){if(_0x543736[_0x4ad1('0x2c')]!==_0x4ad1('0x3d')){var _0x3f6bca={};_0x3f6bca[_0x543736[_0x4ad1('0x27')]]={'$like':'%'+_0x1d338e[_0x4ad1('0x32')]['filter']+'%'};return _0x3f6bca;}})});}_0x279e3b=_['merge']({},_0x279e3b,_0x1d338e[_0x4ad1('0x3e')]);var _0x33857a={'where':_0x279e3b[_0x4ad1('0x3a')]};return db[_0x4ad1('0x29')]['count'](_0x33857a)[_0x4ad1('0x24')](function(_0x244305){_0x59dbdc['count']=_0x244305;if(_0x1d338e['query'][_0x4ad1('0x3f')]){_0x279e3b[_0x4ad1('0x40')]=[{'all':!![]}];}return db[_0x4ad1('0x29')][_0x4ad1('0x41')](_0x279e3b);})['then'](function(_0x2a9a2e){_0x59dbdc['rows']=_0x2a9a2e;return _0x59dbdc;})[_0x4ad1('0x24')](respondWithFilteredResult(_0x3194b2,_0x279e3b))[_0x4ad1('0x42')](handleError(_0x3194b2,null));};exports[_0x4ad1('0x43')]=function(_0xea9022,_0x48dcab){var _0x2e884c={'raw':!![],'where':{'id':_0xea9022[_0x4ad1('0x44')]['id']}},_0x19cca1={};_0x19cca1[_0x4ad1('0x34')]=_[_0x4ad1('0x2f')](db[_0x4ad1('0x29')][_0x4ad1('0x2a')]);_0x19cca1[_0x4ad1('0x32')]=_[_0x4ad1('0x2f')](_0xea9022['query']);_0x19cca1[_0x4ad1('0x30')]=_[_0x4ad1('0x31')](_0x19cca1[_0x4ad1('0x34')],_0x19cca1[_0x4ad1('0x32')]);_0x2e884c[_0x4ad1('0x33')]=_['intersection'](_0x19cca1[_0x4ad1('0x34')],qs[_0x4ad1('0x35')](_0xea9022[_0x4ad1('0x32')][_0x4ad1('0x35')]));_0x2e884c[_0x4ad1('0x33')]=_0x2e884c[_0x4ad1('0x33')][_0x4ad1('0x45')]?_0x2e884c['attributes']:_0x19cca1[_0x4ad1('0x34')];if(_0xea9022['query'][_0x4ad1('0x3f')]){_0x2e884c[_0x4ad1('0x40')]=[{'all':!![]}];}_0x2e884c=_[_0x4ad1('0x3c')]({},_0x2e884c,_0xea9022[_0x4ad1('0x3e')]);return db[_0x4ad1('0x29')][_0x4ad1('0x46')](_0x2e884c)['then'](handleEntityNotFound(_0x48dcab,null))['then'](respondWithResult(_0x48dcab,null))[_0x4ad1('0x42')](handleError(_0x48dcab,null));};exports[_0x4ad1('0x47')]=function(_0x35dca1,_0x5af574){return db[_0x4ad1('0x29')][_0x4ad1('0x47')](_0x35dca1[_0x4ad1('0x48')],{})['then'](respondWithResult(_0x5af574,0xc9))['catch'](handleError(_0x5af574,null));};exports['update']=function(_0x365a2c,_0x5b4bdc){if(_0x365a2c[_0x4ad1('0x48')]['id']){delete _0x365a2c[_0x4ad1('0x48')]['id'];}return db[_0x4ad1('0x29')][_0x4ad1('0x46')]({'where':{'id':_0x365a2c[_0x4ad1('0x44')]['id']}})['then'](handleEntityNotFound(_0x5b4bdc,null))[_0x4ad1('0x24')](saveUpdates(_0x365a2c['body'],null))[_0x4ad1('0x24')](respondWithResult(_0x5b4bdc,null))[_0x4ad1('0x42')](handleError(_0x5b4bdc,null));};exports[_0x4ad1('0x25')]=function(_0x438e6f,_0x371f69){return db[_0x4ad1('0x29')][_0x4ad1('0x46')]({'where':{'id':_0x438e6f[_0x4ad1('0x44')]['id']}})[_0x4ad1('0x24')](handleEntityNotFound(_0x371f69,null))[_0x4ad1('0x24')](removeEntity(_0x371f69,null))[_0x4ad1('0x42')](handleError(_0x371f69,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index e3683c0..97dcf5c 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 _0xab4a=['idField','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','define','VtigerField','vtiger_unique_index'];(function(_0x2d48fa,_0x103065){var _0x4645b7=function(_0x5c8751){while(--_0x5c8751){_0x2d48fa['push'](_0x2d48fa['shift']());}};_0x4645b7(++_0x103065);}(_0xab4a,0x12a));var _0xaab4=function(_0x11e03f,_0x20b967){_0x11e03f=_0x11e03f-0x0;var _0x5666fe=_0xab4a[_0x11e03f];return _0x5666fe;};'use strict';var _=require('lodash');var util=require(_0xaab4('0x0'));var logger=require(_0xaab4('0x1'))('api');var moment=require(_0xaab4('0x2'));var BPromise=require('bluebird');var rp=require(_0xaab4('0x3'));var fs=require('fs');var path=require(_0xaab4('0x4'));var rimraf=require(_0xaab4('0x5'));var config=require(_0xaab4('0x6'));var attributes=require('./intVtigerField.attributes');module['exports']=function(_0x35e77a,_0x1f5b95){return _0x35e77a[_0xaab4('0x7')](_0xaab4('0x8'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0xaab4('0x9'),'fields':[_0xaab4('0xa'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf287=['../../config/logger','api','moment','rimraf','../../config/environment','./intVtigerField.attributes','exports','define','VtigerField','vtiger_unique_index','lodash','util'];(function(_0x401609,_0x5eb61d){var _0x35fd57=function(_0x5dcddd){while(--_0x5dcddd){_0x401609['push'](_0x401609['shift']());}};_0x35fd57(++_0x5eb61d);}(_0xf287,0x11e));var _0x7f28=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xf287[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x7f28('0x0'));var util=require(_0x7f28('0x1'));var logger=require(_0x7f28('0x2'))(_0x7f28('0x3'));var moment=require(_0x7f28('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7f28('0x5'));var config=require(_0x7f28('0x6'));var attributes=require(_0x7f28('0x7'));module[_0x7f28('0x8')]=function(_0x3fa757,_0x4592aa){return _0x3fa757[_0x7f28('0x9')](_0x7f28('0xa'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0x7f28('0xb'),'fields':['idField','FieldId'],'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 abae808..e2d6c27 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 _0x66e4=['request','VtigerField,\x20%s,\x20%s','request\x20sent','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2901a9,_0x33b483){var _0x228cb9=function(_0xfa360b){while(--_0xfa360b){_0x2901a9['push'](_0x2901a9['shift']());}};_0x228cb9(++_0x33b483);}(_0x66e4,0x8f));var _0x466e=function(_0x25a52e,_0x260b10){_0x25a52e=_0x25a52e-0x0;var _0x2ea938=_0x66e4[_0x25a52e];return _0x2ea938;};'use strict';var _=require('lodash');var util=require(_0x466e('0x0'));var moment=require('moment');var BPromise=require(_0x466e('0x1'));var rs=require(_0x466e('0x2'));var fs=require('fs');var Redis=require(_0x466e('0x3'));var db=require(_0x466e('0x4'))['db'];var utils=require(_0x466e('0x5'));var logger=require(_0x466e('0x6'))(_0x466e('0x7'));var config=require(_0x466e('0x8'));var jayson=require(_0x466e('0x9'));var client=jayson[_0x466e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x97320b,_0x398ae5,_0x38d8a3){return new BPromise(function(_0x5d40f8,_0x5b24dc){return client[_0x466e('0xb')](_0x97320b,_0x38d8a3)['then'](function(_0x1de825){logger['info'](_0x466e('0xc'),_0x398ae5,_0x466e('0xd'));logger['debug'](_0x466e('0xe'),_0x398ae5,'request\x20sent',JSON[_0x466e('0xf')](_0x1de825));if(_0x1de825['error']){if(_0x1de825[_0x466e('0x10')][_0x466e('0x11')]===0x1f4){logger[_0x466e('0x10')]('VtigerField,\x20%s,\x20%s',_0x398ae5,_0x1de825[_0x466e('0x10')]['message']);return _0x5b24dc(_0x1de825['error'][_0x466e('0x12')]);}logger['error'](_0x466e('0xc'),_0x398ae5,_0x1de825[_0x466e('0x10')][_0x466e('0x12')]);return _0x5d40f8(_0x1de825[_0x466e('0x10')][_0x466e('0x12')]);}else{logger[_0x466e('0x13')](_0x466e('0xc'),_0x398ae5,_0x466e('0xd'));_0x5d40f8(_0x1de825[_0x466e('0x14')][_0x466e('0x12')]);}})[_0x466e('0x15')](function(_0x4a65eb){logger[_0x466e('0x10')](_0x466e('0xc'),_0x398ae5,_0x4a65eb);_0x5b24dc(_0x4a65eb);});});} \ No newline at end of file +var _0x14c5=['then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http'];(function(_0x54ab34,_0x30f662){var _0x5e5abd=function(_0x21dea1){while(--_0x21dea1){_0x54ab34['push'](_0x54ab34['shift']());}};_0x5e5abd(++_0x30f662);}(_0x14c5,0x173));var _0x514c=function(_0x4429af,_0x21e9a2){_0x4429af=_0x4429af-0x0;var _0x15a130=_0x14c5[_0x4429af];return _0x15a130;};'use strict';var _=require(_0x514c('0x0'));var util=require(_0x514c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x514c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x514c('0x3'))['db'];var utils=require(_0x514c('0x4'));var logger=require(_0x514c('0x5'))(_0x514c('0x6'));var config=require('../../config/environment');var jayson=require(_0x514c('0x7'));var client=jayson['client'][_0x514c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3ad577,_0x4fc471,_0x35e032){return new BPromise(function(_0x4cb8fd,_0x1ab92f){return client['request'](_0x3ad577,_0x35e032)[_0x514c('0x9')](function(_0x3ef42d){logger[_0x514c('0xa')](_0x514c('0xb'),_0x4fc471,_0x514c('0xc'));logger[_0x514c('0xd')](_0x514c('0xe'),_0x4fc471,_0x514c('0xc'),JSON['stringify'](_0x3ef42d));if(_0x3ef42d[_0x514c('0xf')]){if(_0x3ef42d['error'][_0x514c('0x10')]===0x1f4){logger[_0x514c('0xf')]('VtigerField,\x20%s,\x20%s',_0x4fc471,_0x3ef42d[_0x514c('0xf')]['message']);return _0x1ab92f(_0x3ef42d['error'][_0x514c('0x11')]);}logger[_0x514c('0xf')](_0x514c('0xb'),_0x4fc471,_0x3ef42d[_0x514c('0xf')][_0x514c('0x11')]);return _0x4cb8fd(_0x3ef42d[_0x514c('0xf')]['message']);}else{logger[_0x514c('0xa')](_0x514c('0xb'),_0x4fc471,_0x514c('0xc'));_0x4cb8fd(_0x3ef42d[_0x514c('0x12')][_0x514c('0x11')]);}})[_0x514c('0x13')](function(_0x4fc4e4){logger[_0x514c('0xf')]('VtigerField,\x20%s,\x20%s',_0x4fc471,_0x4fc4e4);_0x1ab92f(_0x4fc4e4);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index de5e1ad..454d77e 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 _0x0a44=['get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller'];(function(_0x151721,_0x20d5bc){var _0x2deaa7=function(_0x499812){while(--_0x499812){_0x151721['push'](_0x151721['shift']());}};_0x2deaa7(++_0x20d5bc);}(_0x0a44,0x1a6));var _0x40a4=function(_0x3d0a53,_0x19217d){_0x3d0a53=_0x3d0a53-0x0;var _0x49d926=_0x0a44[_0x3d0a53];return _0x49d926;};'use strict';var multer=require(_0x40a4('0x0'));var util=require(_0x40a4('0x1'));var path=require(_0x40a4('0x2'));var timeout=require(_0x40a4('0x3'));var express=require(_0x40a4('0x4'));var router=express['Router']();var fs_extra=require(_0x40a4('0x5'));var auth=require(_0x40a4('0x6'));var interaction=require(_0x40a4('0x7'));var config=require(_0x40a4('0x8'));var controller=require(_0x40a4('0x9'));router[_0x40a4('0xa')]('/',auth['isAuthenticated'](),controller[_0x40a4('0xb')]);router[_0x40a4('0xa')](_0x40a4('0xc'),auth[_0x40a4('0xd')](),controller[_0x40a4('0xe')]);router['get'](_0x40a4('0xf'),auth[_0x40a4('0xd')](),controller[_0x40a4('0x10')]);router[_0x40a4('0xa')](_0x40a4('0x11'),auth[_0x40a4('0xd')](),controller[_0x40a4('0x12')]);router[_0x40a4('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0x40a4('0x13')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x40a4('0x14')]);router['put']('/:id',auth[_0x40a4('0xd')](),controller[_0x40a4('0x15')]);router[_0x40a4('0x16')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x40a4('0x17')]=router; \ No newline at end of file +var _0xe590=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','post','create','put','update','delete'];(function(_0x21be1a,_0x598997){var _0x2f2ab5=function(_0x3be34b){while(--_0x3be34b){_0x21be1a['push'](_0x21be1a['shift']());}};_0x2f2ab5(++_0x598997);}(_0xe590,0xca));var _0x0e59=function(_0x2ac4b9,_0x2cf8a3){_0x2ac4b9=_0x2ac4b9-0x0;var _0x3c6911=_0xe590[_0x2ac4b9];return _0x3c6911;};'use strict';var multer=require(_0x0e59('0x0'));var util=require(_0x0e59('0x1'));var path=require(_0x0e59('0x2'));var timeout=require(_0x0e59('0x3'));var express=require(_0x0e59('0x4'));var router=express[_0x0e59('0x5')]();var fs_extra=require(_0x0e59('0x6'));var auth=require(_0x0e59('0x7'));var interaction=require(_0x0e59('0x8'));var config=require(_0x0e59('0x9'));var controller=require('./intZendeskAccount.controller');router[_0x0e59('0xa')]('/',auth[_0x0e59('0xb')](),controller[_0x0e59('0xc')]);router['get'](_0x0e59('0xd'),auth['isAuthenticated'](),controller[_0x0e59('0xe')]);router[_0x0e59('0xa')](_0x0e59('0xf'),auth[_0x0e59('0xb')](),controller[_0x0e59('0x10')]);router[_0x0e59('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0x0e59('0x11')]);router[_0x0e59('0x12')]('/',auth[_0x0e59('0xb')](),controller[_0x0e59('0x13')]);router[_0x0e59('0x12')](_0x0e59('0xf'),auth[_0x0e59('0xb')](),controller['addConfiguration']);router[_0x0e59('0x14')]('/:id',auth[_0x0e59('0xb')](),controller[_0x0e59('0x15')]);router[_0x0e59('0x16')](_0x0e59('0xd'),auth[_0x0e59('0xb')](),controller[_0x0e59('0x17')]);module[_0x0e59('0x18')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 2b9c1fe..e8ee6bc 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 _0x1228=['remoteUri','password','token','ENUM','newTab','integrationTab','sequelize','STRING','username'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1228,0x12f));var _0x8122=function(_0x350ff3,_0x2c05a8){_0x350ff3=_0x350ff3-0x0;var _0x9d68cb=_0x1228[_0x350ff3];return _0x9d68cb;};'use strict';var Sequelize=require(_0x8122('0x0'));module['exports']={'name':{'type':Sequelize[_0x8122('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x8122('0x1')],'unique':_0x8122('0x2')},'password':{'type':Sequelize[_0x8122('0x1')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x8122('0x1')],'unique':_0x8122('0x3')},'authType':{'type':Sequelize['ENUM'](_0x8122('0x4'),_0x8122('0x5')),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0x8122('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x8122('0x6')]('integrationTab',_0x8122('0x7')),'defaultValue':_0x8122('0x8')}}; \ No newline at end of file +var _0xdb8b=['ENUM','password','integrationTab','newTab','exports','STRING','remoteUri'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xdb8b,0x1c4));var _0xbdb8=function(_0x545245,_0xc0bda5){_0x545245=_0x545245-0x0;var _0x396cbc=_0xdb8b[_0x545245];return _0x396cbc;};'use strict';var Sequelize=require('sequelize');module[_0xbdb8('0x0')]={'name':{'type':Sequelize[_0xbdb8('0x1')]},'description':{'type':Sequelize[_0xbdb8('0x1')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize[_0xbdb8('0x1')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xbdb8('0x1')],'unique':_0xbdb8('0x2')},'authType':{'type':Sequelize[_0xbdb8('0x3')](_0xbdb8('0x4'),'token'),'defaultValue':_0xbdb8('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xbdb8('0x3')](_0xbdb8('0x5'),_0xbdb8('0x6')),'defaultValue':_0xbdb8('0x5')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 9634283..e387f3e 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 _0xeb74=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','status','json','offset','undefined','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','ZendeskAccount','rawAttributes','fieldName','type','key','model','map','keys','filters','intersection','attributes','fields','length','query','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','getConfigurations','findOne','ZendeskConfiguration','filter','AccountId','channel','Descriptions','ZendeskField','Subjects','getFields','username','token','authType','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','password','headers','%s:%s','toString','base64','Basic\x20%s','%s/token:%s','Sequelize','subject','description','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0xeb74,0xe3));var _0x4eb7=function(_0x544aa1,_0x503e87){_0x544aa1=_0x544aa1-0x0;var _0x59aeff=_0xeb74[_0x544aa1];return _0x59aeff;};'use strict';var emlformat=require(_0x4eb7('0x0'));var rimraf=require(_0x4eb7('0x1'));var zipdir=require(_0x4eb7('0x2'));var jsonpatch=require(_0x4eb7('0x3'));var rp=require(_0x4eb7('0x4'));var moment=require(_0x4eb7('0x5'));var BPromise=require(_0x4eb7('0x6'));var Mustache=require('mustache');var util=require(_0x4eb7('0x7'));var path=require(_0x4eb7('0x8'));var sox=require(_0x4eb7('0x9'));var csv=require(_0x4eb7('0xa'));var ejs=require(_0x4eb7('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4eb7('0xc'));var squel=require('squel');var crypto=require(_0x4eb7('0xd'));var jsforce=require(_0x4eb7('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4eb7('0xf'));var Papa=require(_0x4eb7('0x10'));var Redis=require('ioredis');var authService=require(_0x4eb7('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4eb7('0x12'));var hardwareService=require(_0x4eb7('0x13'));var logger=require(_0x4eb7('0x14'))('api');var utils=require(_0x4eb7('0x15'));var config=require(_0x4eb7('0x16'));var licenseUtil=require(_0x4eb7('0x17'));var db=require(_0x4eb7('0x18'))['db'];var integrations=require(_0x4eb7('0x19'));function respondWithStatusCode(_0x4194e1,_0x3c9f45){_0x3c9f45=_0x3c9f45||0xcc;return function(_0x4c27a4){if(_0x4c27a4){return _0x4194e1['sendStatus'](_0x3c9f45);}return _0x4194e1['status'](_0x3c9f45)[_0x4eb7('0x1a')]();};}function respondWithResult(_0x51f09d,_0x84c68b){_0x84c68b=_0x84c68b||0xc8;return function(_0x119afa){if(_0x119afa){return _0x51f09d[_0x4eb7('0x1b')](_0x84c68b)[_0x4eb7('0x1c')](_0x119afa);}};}function respondWithFilteredResult(_0x5d6d5,_0x21433d){return function(_0x11674f){if(_0x11674f){var _0x76988=typeof _0x21433d[_0x4eb7('0x1d')]===_0x4eb7('0x1e')&&typeof _0x21433d['limit']===_0x4eb7('0x1e');var _0x11ac9f=_0x11674f[_0x4eb7('0x1f')];var _0xf14478=_0x76988?0x0:_0x21433d[_0x4eb7('0x1d')];var _0x44f1b9=_0x76988?_0x11674f[_0x4eb7('0x1f')]:_0x21433d[_0x4eb7('0x1d')]+_0x21433d['limit'];var _0x3cf53a;if(_0x44f1b9>=_0x11ac9f){_0x44f1b9=_0x11ac9f;_0x3cf53a=0xc8;}else{_0x3cf53a=0xce;}_0x5d6d5[_0x4eb7('0x1b')](_0x3cf53a);return _0x5d6d5[_0x4eb7('0x20')](_0x4eb7('0x21'),_0xf14478+'-'+_0x44f1b9+'/'+_0x11ac9f)[_0x4eb7('0x1c')](_0x11674f);}return null;};}function patchUpdates(_0x2efd67){return function(_0x11fb0a){try{jsonpatch['apply'](_0x11fb0a,_0x2efd67,!![]);}catch(_0x214a28){return BPromise[_0x4eb7('0x22')](_0x214a28);}return _0x11fb0a[_0x4eb7('0x23')]();};}function saveUpdates(_0x164515,_0x14a7be){return function(_0x1b4640){if(_0x1b4640){return _0x1b4640[_0x4eb7('0x24')](_0x164515)[_0x4eb7('0x25')](function(_0x1a2b8b){return _0x1a2b8b;});}return null;};}function removeEntity(_0x13e871,_0x4de2d9){return function(_0x3e72cd){if(_0x3e72cd){return _0x3e72cd[_0x4eb7('0x26')]()[_0x4eb7('0x25')](function(){_0x13e871[_0x4eb7('0x1b')](0xcc)[_0x4eb7('0x1a')]();});}};}function handleEntityNotFound(_0x25eb74,_0x365060){return function(_0xe9db8){if(!_0xe9db8){_0x25eb74[_0x4eb7('0x27')](0x194);}return _0xe9db8;};}function handleError(_0x248759,_0xf83c11){_0xf83c11=_0xf83c11||0x1f4;return function(_0x2984b2){logger[_0x4eb7('0x28')](_0x2984b2[_0x4eb7('0x29')]);if(_0x2984b2[_0x4eb7('0x2a')]){delete _0x2984b2[_0x4eb7('0x2a')];}_0x248759[_0x4eb7('0x1b')](_0xf83c11)[_0x4eb7('0x2b')](_0x2984b2);};}exports[_0x4eb7('0x2c')]=function(_0x28fda8,_0x114c68){var _0x17030a={},_0x3ed224={},_0x50209d={'count':0x0,'rows':[]};var _0x34515c=_['map'](db[_0x4eb7('0x2d')][_0x4eb7('0x2e')],function(_0xc5aa21){return{'name':_0xc5aa21[_0x4eb7('0x2f')],'type':_0xc5aa21[_0x4eb7('0x30')][_0x4eb7('0x31')]};});_0x3ed224[_0x4eb7('0x32')]=_[_0x4eb7('0x33')](_0x34515c,_0x4eb7('0x2a'));_0x3ed224['query']=_[_0x4eb7('0x34')](_0x28fda8['query']);_0x3ed224[_0x4eb7('0x35')]=_[_0x4eb7('0x36')](_0x3ed224['model'],_0x3ed224['query']);_0x17030a[_0x4eb7('0x37')]=_[_0x4eb7('0x36')](_0x3ed224[_0x4eb7('0x32')],qs[_0x4eb7('0x38')](_0x28fda8['query'][_0x4eb7('0x38')]));_0x17030a[_0x4eb7('0x37')]=_0x17030a[_0x4eb7('0x37')][_0x4eb7('0x39')]?_0x17030a[_0x4eb7('0x37')]:_0x3ed224['model'];if(!_0x28fda8[_0x4eb7('0x3a')][_0x4eb7('0x3b')](_0x4eb7('0x3c'))){_0x17030a['limit']=qs[_0x4eb7('0x3d')](_0x28fda8[_0x4eb7('0x3a')][_0x4eb7('0x3d')]);_0x17030a['offset']=qs[_0x4eb7('0x1d')](_0x28fda8['query'][_0x4eb7('0x1d')]);}_0x17030a[_0x4eb7('0x3e')]=qs[_0x4eb7('0x3f')](_0x28fda8[_0x4eb7('0x3a')]['sort']);_0x17030a[_0x4eb7('0x40')]=qs[_0x4eb7('0x35')](_[_0x4eb7('0x41')](_0x28fda8[_0x4eb7('0x3a')],_0x3ed224['filters']),_0x34515c);if(_0x28fda8['query']['filter']){_0x17030a[_0x4eb7('0x40')]=_[_0x4eb7('0x42')](_0x17030a[_0x4eb7('0x40')],{'$or':_[_0x4eb7('0x33')](_0x34515c,function(_0x210c20){if(_0x210c20[_0x4eb7('0x30')]!==_0x4eb7('0x43')){var _0x20d2bc={};_0x20d2bc[_0x210c20[_0x4eb7('0x2a')]]={'$like':'%'+_0x28fda8[_0x4eb7('0x3a')]['filter']+'%'};return _0x20d2bc;}})});}_0x17030a=_[_0x4eb7('0x42')]({},_0x17030a,_0x28fda8[_0x4eb7('0x44')]);var _0xe04d76={'where':_0x17030a[_0x4eb7('0x40')]};return db[_0x4eb7('0x2d')][_0x4eb7('0x1f')](_0xe04d76)[_0x4eb7('0x25')](function(_0xef998f){_0x50209d[_0x4eb7('0x1f')]=_0xef998f;if(_0x28fda8[_0x4eb7('0x3a')][_0x4eb7('0x45')]){_0x17030a[_0x4eb7('0x46')]=[{'all':!![]}];}return db[_0x4eb7('0x2d')][_0x4eb7('0x47')](_0x17030a);})[_0x4eb7('0x25')](function(_0x5b819f){_0x50209d[_0x4eb7('0x48')]=_0x5b819f;return _0x50209d;})[_0x4eb7('0x25')](respondWithFilteredResult(_0x114c68,_0x17030a))[_0x4eb7('0x49')](handleError(_0x114c68,null));};exports[_0x4eb7('0x4a')]=function(_0x5eff9e,_0x2fd5c2){var _0x2df542={'raw':![],'where':{'id':_0x5eff9e[_0x4eb7('0x4b')]['id']}},_0x482357={};_0x482357[_0x4eb7('0x32')]=_[_0x4eb7('0x34')](db[_0x4eb7('0x2d')][_0x4eb7('0x2e')]);_0x482357[_0x4eb7('0x3a')]=_['keys'](_0x5eff9e[_0x4eb7('0x3a')]);_0x482357['filters']=_[_0x4eb7('0x36')](_0x482357[_0x4eb7('0x32')],_0x482357[_0x4eb7('0x3a')]);_0x2df542['attributes']=_[_0x4eb7('0x36')](_0x482357[_0x4eb7('0x32')],qs[_0x4eb7('0x38')](_0x5eff9e[_0x4eb7('0x3a')]['fields']));_0x2df542[_0x4eb7('0x37')]=_0x2df542['attributes'][_0x4eb7('0x39')]?_0x2df542[_0x4eb7('0x37')]:_0x482357[_0x4eb7('0x32')];if(_0x5eff9e[_0x4eb7('0x3a')][_0x4eb7('0x45')]){_0x2df542['include']=[{'all':!![]}];}_0x2df542=_['merge']({},_0x2df542,_0x5eff9e[_0x4eb7('0x44')]);return db[_0x4eb7('0x2d')][_0x4eb7('0x4c')](_0x2df542)[_0x4eb7('0x25')](handleEntityNotFound(_0x2fd5c2,null))[_0x4eb7('0x25')](respondWithResult(_0x2fd5c2,null))['catch'](handleError(_0x2fd5c2,null));};exports[_0x4eb7('0x4d')]=function(_0x104284,_0x56609e){return db[_0x4eb7('0x2d')][_0x4eb7('0x4d')](_0x104284['body'],{})[_0x4eb7('0x25')](respondWithResult(_0x56609e,0xc9))[_0x4eb7('0x49')](handleError(_0x56609e,null));};exports[_0x4eb7('0x24')]=function(_0x5774d5,_0x130113){if(_0x5774d5['body']['id']){delete _0x5774d5['body']['id'];}return db[_0x4eb7('0x2d')][_0x4eb7('0x4c')]({'where':{'id':_0x5774d5[_0x4eb7('0x4b')]['id']}})[_0x4eb7('0x25')](handleEntityNotFound(_0x130113,null))[_0x4eb7('0x25')](saveUpdates(_0x5774d5[_0x4eb7('0x4e')],null))[_0x4eb7('0x25')](respondWithResult(_0x130113,null))[_0x4eb7('0x49')](handleError(_0x130113,null));};exports[_0x4eb7('0x26')]=function(_0x23c0d5,_0x42a1d9){return db[_0x4eb7('0x2d')][_0x4eb7('0x4c')]({'where':{'id':_0x23c0d5[_0x4eb7('0x4b')]['id']}})[_0x4eb7('0x25')](handleEntityNotFound(_0x42a1d9,null))[_0x4eb7('0x25')](removeEntity(_0x42a1d9,null))[_0x4eb7('0x49')](handleError(_0x42a1d9,null));};exports[_0x4eb7('0x4f')]=function(_0x1411c9,_0x11cc3d,_0x4cfba8){var _0x3f3d41={};var _0x550888={};var _0x4db5f7;var _0x3f3a5f;return db[_0x4eb7('0x2d')][_0x4eb7('0x50')]({'where':{'id':_0x1411c9[_0x4eb7('0x4b')]['id']}})[_0x4eb7('0x25')](handleEntityNotFound(_0x11cc3d,null))['then'](function(_0x4e3163){if(_0x4e3163){_0x4db5f7=_0x4e3163;_0x550888[_0x4eb7('0x32')]=_['keys'](db[_0x4eb7('0x51')][_0x4eb7('0x2e')]);_0x550888[_0x4eb7('0x3a')]=_[_0x4eb7('0x34')](_0x1411c9['query']);_0x550888[_0x4eb7('0x35')]=_[_0x4eb7('0x36')](_0x550888[_0x4eb7('0x32')],_0x550888[_0x4eb7('0x3a')]);_0x3f3d41['attributes']=_[_0x4eb7('0x36')](_0x550888[_0x4eb7('0x32')],qs['fields'](_0x1411c9[_0x4eb7('0x3a')][_0x4eb7('0x38')]));_0x3f3d41['attributes']=_0x3f3d41[_0x4eb7('0x37')]['length']?_0x3f3d41[_0x4eb7('0x37')]:_0x550888['model'];_0x3f3d41[_0x4eb7('0x3e')]=qs[_0x4eb7('0x3f')](_0x1411c9[_0x4eb7('0x3a')][_0x4eb7('0x3f')]);_0x3f3d41[_0x4eb7('0x40')]=qs[_0x4eb7('0x35')](_['pick'](_0x1411c9['query'],_0x550888[_0x4eb7('0x35')]));if(_0x1411c9[_0x4eb7('0x3a')][_0x4eb7('0x52')]){_0x3f3d41[_0x4eb7('0x40')]=_['merge'](_0x3f3d41[_0x4eb7('0x40')],{'$or':_[_0x4eb7('0x33')](_0x3f3d41['attributes'],function(_0x452f21){var _0xba9272={};_0xba9272[_0x452f21]={'$like':'%'+_0x1411c9[_0x4eb7('0x3a')][_0x4eb7('0x52')]+'%'};return _0xba9272;})});}_0x3f3d41=_[_0x4eb7('0x42')]({},_0x3f3d41,_0x1411c9[_0x4eb7('0x44')]);return _0x4db5f7[_0x4eb7('0x4f')](_0x3f3d41);}})['then'](function(_0x5839f1){if(_0x5839f1){_0x3f3a5f=_0x5839f1[_0x4eb7('0x39')];if(!_0x1411c9['query'][_0x4eb7('0x3b')]('nolimit')){_0x3f3d41[_0x4eb7('0x3d')]=qs['limit'](_0x1411c9['query'][_0x4eb7('0x3d')]);_0x3f3d41[_0x4eb7('0x1d')]=qs['offset'](_0x1411c9[_0x4eb7('0x3a')]['offset']);}return _0x4db5f7[_0x4eb7('0x4f')](_0x3f3d41);}})[_0x4eb7('0x25')](function(_0x4ab8e8){if(_0x4ab8e8){return _0x4ab8e8?{'count':_0x3f3a5f,'rows':_0x4ab8e8}:null;}})[_0x4eb7('0x25')](respondWithResult(_0x11cc3d,null))[_0x4eb7('0x49')](handleError(_0x11cc3d,null));};exports['addConfiguration']=function(_0x4b492a,_0x5c8d45,_0x59e2f2){if(_0x4b492a[_0x4eb7('0x4e')]['id']){delete _0x4b492a['body']['id'];}return db[_0x4eb7('0x2d')][_0x4eb7('0x50')]({'where':{'id':_0x4b492a['params']['id']}})[_0x4eb7('0x25')](handleEntityNotFound(_0x5c8d45,null))[_0x4eb7('0x25')](function(_0x463ab6){if(_0x463ab6){_0x4b492a[_0x4eb7('0x4e')][_0x4eb7('0x53')]=_0x463ab6['id'];_0x4b492a[_0x4eb7('0x4e')]['Subjects']=integrations['getSubjects'](_0x4b492a['body'][_0x4eb7('0x54')],_0x4b492a[_0x4eb7('0x4e')][_0x4eb7('0x30')]);_0x4b492a[_0x4eb7('0x4e')][_0x4eb7('0x55')]=integrations['getDescriptions'](_0x4b492a['body'][_0x4eb7('0x54')],_0x4b492a[_0x4eb7('0x4e')][_0x4eb7('0x30')]);return db[_0x4eb7('0x51')][_0x4eb7('0x4d')](_0x4b492a['body'],{'include':[{'model':db[_0x4eb7('0x56')],'as':_0x4eb7('0x57')},{'model':db[_0x4eb7('0x56')],'as':_0x4eb7('0x55')}]});}return null;})['then'](respondWithResult(_0x5c8d45,null))['catch'](handleError(_0x5c8d45,null));};exports[_0x4eb7('0x58')]=function(_0x3883f3,_0x4e8125,_0x1911ad){var _0x4b698b='';return db[_0x4eb7('0x2d')][_0x4eb7('0x50')]({'where':{'id':_0x3883f3[_0x4eb7('0x4b')]['id']},'attributes':['id',_0x4eb7('0x59'),'password',_0x4eb7('0x5a'),_0x4eb7('0x5b'),_0x4eb7('0x5c')]})[_0x4eb7('0x25')](handleEntityNotFound(_0x4e8125,null))[_0x4eb7('0x25')](function(_0x3271d0){if(_0x3271d0){_0x4b698b=_0x3271d0[_0x4eb7('0x5c')];var _0x232242=_0x4b698b[_0x4eb7('0x5d')](-0x1);if(_0x232242==='/'){_0x4b698b=_0x4b698b[_0x4eb7('0x5e')](0x0,_0x4b698b[_0x4eb7('0x5f')](_0x232242));}var _0x713b0a={'method':_0x4eb7('0x60'),'uri':util[_0x4eb7('0x61')](_0x4eb7('0x62'),_0x4b698b,_0x4eb7('0x63')),'json':!![]};switch(_0x3271d0[_0x4eb7('0x5b')]){case _0x4eb7('0x64'):_0x713b0a[_0x4eb7('0x65')]={'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0x4eb7('0x61')](_0x4eb7('0x66'),_0x3271d0[_0x4eb7('0x59')],_0x3271d0[_0x4eb7('0x64')]))[_0x4eb7('0x67')](_0x4eb7('0x68')))};break;case _0x4eb7('0x5a'):_0x713b0a[_0x4eb7('0x65')]={'Authorization':util['format'](_0x4eb7('0x69'),new Buffer(util[_0x4eb7('0x61')](_0x4eb7('0x6a'),_0x3271d0['username'],_0x3271d0['token']))[_0x4eb7('0x67')](_0x4eb7('0x68')))};break;default:throw new db[(_0x4eb7('0x6b'))]['ValidationError']('Unknown\x20authentication\x20type');}return rp(_0x713b0a);}})[_0x4eb7('0x25')](function(_0x1a1525){if(_0x1a1525){var _0x4778f9=[_0x4eb7('0x6c'),_0x4eb7('0x6d'),_0x4eb7('0x6e'),_0x4eb7('0x6f')];_[_0x4eb7('0x70')](_0x1a1525[_0x4eb7('0x63')],function(_0x2e531e){return _0x4778f9[_0x4eb7('0x71')](_0x2e531e[_0x4eb7('0x30')]);});return{'count':_0x1a1525['ticket_fields']['length'],'rows':_[_0x4eb7('0x33')](_0x1a1525[_0x4eb7('0x63')],function(_0x14648d){return{'id':_0x14648d['id'],'name':_0x14648d[_0x4eb7('0x72')]>0x7?_0x14648d[_0x4eb7('0x73')]:_0x14648d[_0x4eb7('0x30')],'custom':_0x14648d['position']>0x7?!![]:![],'options':_0x14648d['system_field_options']?_0x14648d[_0x4eb7('0x74')]:_0x14648d[_0x4eb7('0x75')]?_0x14648d[_0x4eb7('0x75')]:[]};})};}})[_0x4eb7('0x25')](respondWithResult(_0x4e8125,null))[_0x4eb7('0x49')](function(_0x2480ed){var _0x13f574=_0x3883f3[_0x4eb7('0x3a')][_0x4eb7('0x76')]?0x1f4:_0x2480ed[_0x4eb7('0x77')]||0x1f4;logger[_0x4eb7('0x28')](_0x4eb7('0x78'),_0x4eb7('0x58'),_0x13f574,JSON[_0x4eb7('0x79')](_0x2480ed));delete _0x2480ed['name'];if(_0x13f574===0x191){_0x13f574=0x190;}_0x4e8125[_0x4eb7('0x1b')](_0x13f574)[_0x4eb7('0x2b')](_0x3883f3[_0x4eb7('0x3a')][_0x4eb7('0x76')]?{'message':'Wrong\x20credentials','statusCode':_0x2480ed[_0x4eb7('0x77')]}:_0x2480ed);});}; \ No newline at end of file +var _0xeffd=['querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','end','json','offset','undefined','count','limit','status','set','Content-Range','save','update','destroy','then','sendStatus','error','stack','send','index','map','ZendeskAccount','fieldName','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','length','create','body','find','findOne','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','ZendeskConfiguration','ZendeskField','Descriptions','password','token','authType','remoteUri','slice','substring','lastIndexOf','GET','%s/%s','ticket_fields','headers','format','Basic\x20%s','%s:%s','username','toString','%s/token:%s','base64','Sequelize','Unknown\x20authentication\x20type','subject','group','assignee','remove','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','name','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x538638,_0x4f467b){var _0x1c2f3b=function(_0x2dea5b){while(--_0x2dea5b){_0x538638['push'](_0x538638['shift']());}};_0x1c2f3b(++_0x4f467b);}(_0xeffd,0x6b));var _0xdeff=function(_0x266298,_0x1e49e4){_0x266298=_0x266298-0x0;var _0x338a74=_0xeffd[_0x266298];return _0x338a74;};'use strict';var emlformat=require(_0xdeff('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdeff('0x1'));var jsonpatch=require(_0xdeff('0x2'));var rp=require(_0xdeff('0x3'));var moment=require(_0xdeff('0x4'));var BPromise=require(_0xdeff('0x5'));var Mustache=require(_0xdeff('0x6'));var util=require(_0xdeff('0x7'));var path=require(_0xdeff('0x8'));var sox=require(_0xdeff('0x9'));var csv=require(_0xdeff('0xa'));var ejs=require(_0xdeff('0xb'));var fs=require('fs');var fs_extra=require(_0xdeff('0xc'));var _=require(_0xdeff('0xd'));var squel=require(_0xdeff('0xe'));var crypto=require(_0xdeff('0xf'));var jsforce=require(_0xdeff('0x10'));var deskjs=require(_0xdeff('0x11'));var toCsv=require('to-csv');var querystring=require(_0xdeff('0x12'));var Papa=require(_0xdeff('0x13'));var Redis=require(_0xdeff('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xdeff('0x15'));var as=require(_0xdeff('0x16'));var hardwareService=require(_0xdeff('0x17'));var logger=require(_0xdeff('0x18'))(_0xdeff('0x19'));var utils=require(_0xdeff('0x1a'));var config=require(_0xdeff('0x1b'));var licenseUtil=require(_0xdeff('0x1c'));var db=require('../../mysqldb')['db'];var integrations=require(_0xdeff('0x1d'));function respondWithStatusCode(_0x116bf9,_0x4952f2){_0x4952f2=_0x4952f2||0xcc;return function(_0x2e614c){if(_0x2e614c){return _0x116bf9['sendStatus'](_0x4952f2);}return _0x116bf9['status'](_0x4952f2)[_0xdeff('0x1e')]();};}function respondWithResult(_0x47410f,_0x1585e8){_0x1585e8=_0x1585e8||0xc8;return function(_0xb4bc82){if(_0xb4bc82){return _0x47410f['status'](_0x1585e8)[_0xdeff('0x1f')](_0xb4bc82);}};}function respondWithFilteredResult(_0x314ded,_0xea6c4){return function(_0x391633){if(_0x391633){var _0x3dbba1=typeof _0xea6c4[_0xdeff('0x20')]==='undefined'&&typeof _0xea6c4['limit']===_0xdeff('0x21');var _0x4cf724=_0x391633['count'];var _0x35635f=_0x3dbba1?0x0:_0xea6c4[_0xdeff('0x20')];var _0x4b14b6=_0x3dbba1?_0x391633[_0xdeff('0x22')]:_0xea6c4[_0xdeff('0x20')]+_0xea6c4[_0xdeff('0x23')];var _0x3a677a;if(_0x4b14b6>=_0x4cf724){_0x4b14b6=_0x4cf724;_0x3a677a=0xc8;}else{_0x3a677a=0xce;}_0x314ded[_0xdeff('0x24')](_0x3a677a);return _0x314ded[_0xdeff('0x25')](_0xdeff('0x26'),_0x35635f+'-'+_0x4b14b6+'/'+_0x4cf724)[_0xdeff('0x1f')](_0x391633);}return null;};}function patchUpdates(_0x488faa){return function(_0x5591fa){try{jsonpatch['apply'](_0x5591fa,_0x488faa,!![]);}catch(_0x2f3fd6){return BPromise['reject'](_0x2f3fd6);}return _0x5591fa[_0xdeff('0x27')]();};}function saveUpdates(_0x91c0b4,_0x543653){return function(_0x18338c){if(_0x18338c){return _0x18338c[_0xdeff('0x28')](_0x91c0b4)['then'](function(_0x5dbe96){return _0x5dbe96;});}return null;};}function removeEntity(_0x3b2554,_0x15c425){return function(_0x253eed){if(_0x253eed){return _0x253eed[_0xdeff('0x29')]()[_0xdeff('0x2a')](function(){_0x3b2554['status'](0xcc)[_0xdeff('0x1e')]();});}};}function handleEntityNotFound(_0x412db3,_0x3741fb){return function(_0x393659){if(!_0x393659){_0x412db3[_0xdeff('0x2b')](0x194);}return _0x393659;};}function handleError(_0x35823c,_0x3d0111){_0x3d0111=_0x3d0111||0x1f4;return function(_0x52ea5d){logger[_0xdeff('0x2c')](_0x52ea5d[_0xdeff('0x2d')]);if(_0x52ea5d['name']){delete _0x52ea5d['name'];}_0x35823c[_0xdeff('0x24')](_0x3d0111)[_0xdeff('0x2e')](_0x52ea5d);};}exports[_0xdeff('0x2f')]=function(_0xcb819c,_0x533069){var _0xf9b278={},_0xbc75ee={},_0x4e0ff2={'count':0x0,'rows':[]};var _0x331ddc=_[_0xdeff('0x30')](db[_0xdeff('0x31')]['rawAttributes'],function(_0x59f7a0){return{'name':_0x59f7a0[_0xdeff('0x32')],'type':_0x59f7a0['type'][_0xdeff('0x33')]};});_0xbc75ee[_0xdeff('0x34')]=_[_0xdeff('0x30')](_0x331ddc,'name');_0xbc75ee[_0xdeff('0x35')]=_['keys'](_0xcb819c['query']);_0xbc75ee[_0xdeff('0x36')]=_[_0xdeff('0x37')](_0xbc75ee[_0xdeff('0x34')],_0xbc75ee[_0xdeff('0x35')]);_0xf9b278['attributes']=_[_0xdeff('0x37')](_0xbc75ee[_0xdeff('0x34')],qs[_0xdeff('0x38')](_0xcb819c[_0xdeff('0x35')][_0xdeff('0x38')]));_0xf9b278[_0xdeff('0x39')]=_0xf9b278[_0xdeff('0x39')]['length']?_0xf9b278[_0xdeff('0x39')]:_0xbc75ee['model'];if(!_0xcb819c[_0xdeff('0x35')][_0xdeff('0x3a')](_0xdeff('0x3b'))){_0xf9b278[_0xdeff('0x23')]=qs[_0xdeff('0x23')](_0xcb819c[_0xdeff('0x35')]['limit']);_0xf9b278[_0xdeff('0x20')]=qs[_0xdeff('0x20')](_0xcb819c['query'][_0xdeff('0x20')]);}_0xf9b278[_0xdeff('0x3c')]=qs[_0xdeff('0x3d')](_0xcb819c[_0xdeff('0x35')][_0xdeff('0x3d')]);_0xf9b278[_0xdeff('0x3e')]=qs[_0xdeff('0x36')](_[_0xdeff('0x3f')](_0xcb819c['query'],_0xbc75ee[_0xdeff('0x36')]),_0x331ddc);if(_0xcb819c['query'][_0xdeff('0x40')]){_0xf9b278[_0xdeff('0x3e')]=_[_0xdeff('0x41')](_0xf9b278['where'],{'$or':_[_0xdeff('0x30')](_0x331ddc,function(_0x280a86){if(_0x280a86[_0xdeff('0x42')]!==_0xdeff('0x43')){var _0x226028={};_0x226028[_0x280a86['name']]={'$like':'%'+_0xcb819c[_0xdeff('0x35')]['filter']+'%'};return _0x226028;}})});}_0xf9b278=_[_0xdeff('0x41')]({},_0xf9b278,_0xcb819c[_0xdeff('0x44')]);var _0x518280={'where':_0xf9b278[_0xdeff('0x3e')]};return db[_0xdeff('0x31')][_0xdeff('0x22')](_0x518280)[_0xdeff('0x2a')](function(_0x3e2be3){_0x4e0ff2['count']=_0x3e2be3;if(_0xcb819c[_0xdeff('0x35')][_0xdeff('0x45')]){_0xf9b278[_0xdeff('0x46')]=[{'all':!![]}];}return db[_0xdeff('0x31')][_0xdeff('0x47')](_0xf9b278);})['then'](function(_0x5f1110){_0x4e0ff2[_0xdeff('0x48')]=_0x5f1110;return _0x4e0ff2;})[_0xdeff('0x2a')](respondWithFilteredResult(_0x533069,_0xf9b278))[_0xdeff('0x49')](handleError(_0x533069,null));};exports[_0xdeff('0x4a')]=function(_0x3c4fd2,_0x289f70){var _0x2cd68a={'raw':![],'where':{'id':_0x3c4fd2[_0xdeff('0x4b')]['id']}},_0x4f02f5={};_0x4f02f5[_0xdeff('0x34')]=_[_0xdeff('0x4c')](db['ZendeskAccount'][_0xdeff('0x4d')]);_0x4f02f5[_0xdeff('0x35')]=_[_0xdeff('0x4c')](_0x3c4fd2[_0xdeff('0x35')]);_0x4f02f5['filters']=_[_0xdeff('0x37')](_0x4f02f5[_0xdeff('0x34')],_0x4f02f5[_0xdeff('0x35')]);_0x2cd68a[_0xdeff('0x39')]=_[_0xdeff('0x37')](_0x4f02f5[_0xdeff('0x34')],qs[_0xdeff('0x38')](_0x3c4fd2[_0xdeff('0x35')]['fields']));_0x2cd68a[_0xdeff('0x39')]=_0x2cd68a[_0xdeff('0x39')][_0xdeff('0x4e')]?_0x2cd68a[_0xdeff('0x39')]:_0x4f02f5[_0xdeff('0x34')];if(_0x3c4fd2['query'][_0xdeff('0x45')]){_0x2cd68a[_0xdeff('0x46')]=[{'all':!![]}];}_0x2cd68a=_[_0xdeff('0x41')]({},_0x2cd68a,_0x3c4fd2[_0xdeff('0x44')]);return db[_0xdeff('0x31')]['find'](_0x2cd68a)[_0xdeff('0x2a')](handleEntityNotFound(_0x289f70,null))['then'](respondWithResult(_0x289f70,null))[_0xdeff('0x49')](handleError(_0x289f70,null));};exports[_0xdeff('0x4f')]=function(_0x1bf17c,_0x46c428){return db[_0xdeff('0x31')][_0xdeff('0x4f')](_0x1bf17c['body'],{})['then'](respondWithResult(_0x46c428,0xc9))[_0xdeff('0x49')](handleError(_0x46c428,null));};exports[_0xdeff('0x28')]=function(_0x3dc206,_0x49de92){if(_0x3dc206['body']['id']){delete _0x3dc206[_0xdeff('0x50')]['id'];}return db[_0xdeff('0x31')]['find']({'where':{'id':_0x3dc206[_0xdeff('0x4b')]['id']}})[_0xdeff('0x2a')](handleEntityNotFound(_0x49de92,null))[_0xdeff('0x2a')](saveUpdates(_0x3dc206['body'],null))[_0xdeff('0x2a')](respondWithResult(_0x49de92,null))[_0xdeff('0x49')](handleError(_0x49de92,null));};exports[_0xdeff('0x29')]=function(_0x59ae32,_0xce8379){return db[_0xdeff('0x31')][_0xdeff('0x51')]({'where':{'id':_0x59ae32[_0xdeff('0x4b')]['id']}})[_0xdeff('0x2a')](handleEntityNotFound(_0xce8379,null))[_0xdeff('0x2a')](removeEntity(_0xce8379,null))[_0xdeff('0x49')](handleError(_0xce8379,null));};exports['getConfigurations']=function(_0x4517d1,_0x1b90a9,_0x5e0c60){var _0xe5a773={};var _0x1b676b={};var _0x2967b4;var _0x33482b;return db[_0xdeff('0x31')][_0xdeff('0x52')]({'where':{'id':_0x4517d1[_0xdeff('0x4b')]['id']}})[_0xdeff('0x2a')](handleEntityNotFound(_0x1b90a9,null))['then'](function(_0x1b7eb3){if(_0x1b7eb3){_0x2967b4=_0x1b7eb3;_0x1b676b[_0xdeff('0x34')]=_[_0xdeff('0x4c')](db['ZendeskConfiguration']['rawAttributes']);_0x1b676b[_0xdeff('0x35')]=_[_0xdeff('0x4c')](_0x4517d1[_0xdeff('0x35')]);_0x1b676b[_0xdeff('0x36')]=_[_0xdeff('0x37')](_0x1b676b[_0xdeff('0x34')],_0x1b676b['query']);_0xe5a773['attributes']=_[_0xdeff('0x37')](_0x1b676b[_0xdeff('0x34')],qs['fields'](_0x4517d1['query'][_0xdeff('0x38')]));_0xe5a773[_0xdeff('0x39')]=_0xe5a773['attributes'][_0xdeff('0x4e')]?_0xe5a773[_0xdeff('0x39')]:_0x1b676b['model'];_0xe5a773[_0xdeff('0x3c')]=qs[_0xdeff('0x3d')](_0x4517d1['query'][_0xdeff('0x3d')]);_0xe5a773[_0xdeff('0x3e')]=qs['filters'](_[_0xdeff('0x3f')](_0x4517d1[_0xdeff('0x35')],_0x1b676b[_0xdeff('0x36')]));if(_0x4517d1['query']['filter']){_0xe5a773[_0xdeff('0x3e')]=_['merge'](_0xe5a773[_0xdeff('0x3e')],{'$or':_[_0xdeff('0x30')](_0xe5a773[_0xdeff('0x39')],function(_0x34d033){var _0x300955={};_0x300955[_0x34d033]={'$like':'%'+_0x4517d1['query']['filter']+'%'};return _0x300955;})});}_0xe5a773=_[_0xdeff('0x41')]({},_0xe5a773,_0x4517d1[_0xdeff('0x44')]);return _0x2967b4[_0xdeff('0x53')](_0xe5a773);}})[_0xdeff('0x2a')](function(_0x106976){if(_0x106976){_0x33482b=_0x106976[_0xdeff('0x4e')];if(!_0x4517d1['query'][_0xdeff('0x3a')]('nolimit')){_0xe5a773[_0xdeff('0x23')]=qs[_0xdeff('0x23')](_0x4517d1[_0xdeff('0x35')][_0xdeff('0x23')]);_0xe5a773[_0xdeff('0x20')]=qs[_0xdeff('0x20')](_0x4517d1[_0xdeff('0x35')][_0xdeff('0x20')]);}return _0x2967b4[_0xdeff('0x53')](_0xe5a773);}})['then'](function(_0x43f74){if(_0x43f74){return _0x43f74?{'count':_0x33482b,'rows':_0x43f74}:null;}})['then'](respondWithResult(_0x1b90a9,null))[_0xdeff('0x49')](handleError(_0x1b90a9,null));};exports[_0xdeff('0x54')]=function(_0x5a51d4,_0x286e4d,_0x492372){if(_0x5a51d4[_0xdeff('0x50')]['id']){delete _0x5a51d4['body']['id'];}return db['ZendeskAccount'][_0xdeff('0x52')]({'where':{'id':_0x5a51d4[_0xdeff('0x4b')]['id']}})['then'](handleEntityNotFound(_0x286e4d,null))[_0xdeff('0x2a')](function(_0x196e90){if(_0x196e90){_0x5a51d4[_0xdeff('0x50')][_0xdeff('0x55')]=_0x196e90['id'];_0x5a51d4[_0xdeff('0x50')][_0xdeff('0x56')]=integrations[_0xdeff('0x57')](_0x5a51d4[_0xdeff('0x50')][_0xdeff('0x58')],_0x5a51d4['body'][_0xdeff('0x42')]);_0x5a51d4[_0xdeff('0x50')]['Descriptions']=integrations['getDescriptions'](_0x5a51d4[_0xdeff('0x50')][_0xdeff('0x58')],_0x5a51d4['body'][_0xdeff('0x42')]);return db[_0xdeff('0x59')][_0xdeff('0x4f')](_0x5a51d4[_0xdeff('0x50')],{'include':[{'model':db[_0xdeff('0x5a')],'as':_0xdeff('0x56')},{'model':db[_0xdeff('0x5a')],'as':_0xdeff('0x5b')}]});}return null;})[_0xdeff('0x2a')](respondWithResult(_0x286e4d,null))[_0xdeff('0x49')](handleError(_0x286e4d,null));};exports['getFields']=function(_0x221af0,_0x169145,_0x190191){var _0x44bad3='';return db[_0xdeff('0x31')]['findOne']({'where':{'id':_0x221af0['params']['id']},'attributes':['id','username',_0xdeff('0x5c'),_0xdeff('0x5d'),_0xdeff('0x5e'),_0xdeff('0x5f')]})['then'](handleEntityNotFound(_0x169145,null))['then'](function(_0x19de80){if(_0x19de80){_0x44bad3=_0x19de80[_0xdeff('0x5f')];var _0x46e1d5=_0x44bad3[_0xdeff('0x60')](-0x1);if(_0x46e1d5==='/'){_0x44bad3=_0x44bad3[_0xdeff('0x61')](0x0,_0x44bad3[_0xdeff('0x62')](_0x46e1d5));}var _0x1eb1a3={'method':_0xdeff('0x63'),'uri':util['format'](_0xdeff('0x64'),_0x44bad3,_0xdeff('0x65')),'json':!![]};switch(_0x19de80[_0xdeff('0x5e')]){case _0xdeff('0x5c'):_0x1eb1a3[_0xdeff('0x66')]={'Authorization':util[_0xdeff('0x67')](_0xdeff('0x68'),new Buffer(util[_0xdeff('0x67')](_0xdeff('0x69'),_0x19de80[_0xdeff('0x6a')],_0x19de80[_0xdeff('0x5c')]))[_0xdeff('0x6b')]('base64'))};break;case _0xdeff('0x5d'):_0x1eb1a3[_0xdeff('0x66')]={'Authorization':util[_0xdeff('0x67')]('Basic\x20%s',new Buffer(util[_0xdeff('0x67')](_0xdeff('0x6c'),_0x19de80[_0xdeff('0x6a')],_0x19de80[_0xdeff('0x5d')]))['toString'](_0xdeff('0x6d')))};break;default:throw new db[(_0xdeff('0x6e'))]['ValidationError'](_0xdeff('0x6f'));}return rp(_0x1eb1a3);}})[_0xdeff('0x2a')](function(_0x1430e8){if(_0x1430e8){var _0x1cc1d3=[_0xdeff('0x70'),'description',_0xdeff('0x71'),_0xdeff('0x72')];_[_0xdeff('0x73')](_0x1430e8[_0xdeff('0x65')],function(_0xe85561){return _0x1cc1d3['includes'](_0xe85561[_0xdeff('0x42')]);});return{'count':_0x1430e8[_0xdeff('0x65')]['length'],'rows':_[_0xdeff('0x30')](_0x1430e8[_0xdeff('0x65')],function(_0x1fe603){return{'id':_0x1fe603['id'],'name':_0x1fe603['position']>0x7?_0x1fe603[_0xdeff('0x74')]:_0x1fe603[_0xdeff('0x42')],'custom':_0x1fe603['position']>0x7?!![]:![],'options':_0x1fe603[_0xdeff('0x75')]?_0x1fe603[_0xdeff('0x75')]:_0x1fe603[_0xdeff('0x76')]?_0x1fe603[_0xdeff('0x76')]:[]};})};}})['then'](respondWithResult(_0x169145,null))[_0xdeff('0x49')](function(_0x3b8f20){var _0x14a77f=_0x221af0[_0xdeff('0x35')][_0xdeff('0x77')]?0x1f4:_0x3b8f20[_0xdeff('0x78')]||0x1f4;logger[_0xdeff('0x2c')](_0xdeff('0x79'),_0xdeff('0x7a'),_0x14a77f,JSON['stringify'](_0x3b8f20));delete _0x3b8f20[_0xdeff('0x7b')];if(_0x14a77f===0x191){_0x14a77f=0x190;}_0x169145['status'](_0x14a77f)[_0xdeff('0x2e')](_0x221af0['query']['test']?{'message':_0xdeff('0x7c'),'statusCode':_0x3b8f20[_0xdeff('0x78')]}:_0x3b8f20);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 29a2b18..d22d321 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 _0x27ac=['ZendeskAccount','int_zendesk_accounts','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','define'];(function(_0x51630f,_0x54b703){var _0x2de9ef=function(_0x2a1348){while(--_0x2a1348){_0x51630f['push'](_0x51630f['shift']());}};_0x2de9ef(++_0x54b703);}(_0x27ac,0x19a));var _0xc27a=function(_0x4d8d34,_0x329802){_0x4d8d34=_0x4d8d34-0x0;var _0x2a97a8=_0x27ac[_0x4d8d34];return _0x2a97a8;};'use strict';var _=require(_0xc27a('0x0'));var util=require('util');var logger=require(_0xc27a('0x1'))(_0xc27a('0x2'));var moment=require(_0xc27a('0x3'));var BPromise=require('bluebird');var rp=require(_0xc27a('0x4'));var fs=require('fs');var path=require(_0xc27a('0x5'));var rimraf=require(_0xc27a('0x6'));var config=require(_0xc27a('0x7'));var attributes=require(_0xc27a('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x470edd,_0x4ba9f3){return _0x470edd[_0xc27a('0x9')](_0xc27a('0xa'),attributes,{'tableName':_0xc27a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x27c5=['request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','exports','define','int_zendesk_accounts','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3c424f,_0x1c61c2){var _0x3fee82=function(_0xc78512){while(--_0xc78512){_0x3c424f['push'](_0x3c424f['shift']());}};_0x3fee82(++_0x1c61c2);}(_0x27c5,0x174));var _0x527c=function(_0x41d364,_0xdfdc1a){_0x41d364=_0x41d364-0x0;var _0x5ace98=_0x27c5[_0x41d364];return _0x5ace98;};'use strict';var _=require(_0x527c('0x0'));var util=require(_0x527c('0x1'));var logger=require(_0x527c('0x2'))(_0x527c('0x3'));var moment=require(_0x527c('0x4'));var BPromise=require(_0x527c('0x5'));var rp=require(_0x527c('0x6'));var fs=require('fs');var path=require(_0x527c('0x7'));var rimraf=require(_0x527c('0x8'));var config=require(_0x527c('0x9'));var attributes=require(_0x527c('0xa'));var integrations=require('../../components/integrations/configuration');module[_0x527c('0xb')]=function(_0x1c66e5,_0x30b18d){return _0x1c66e5[_0x527c('0xc')]('ZendeskAccount',attributes,{'tableName':_0x527c('0xd'),'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 8ec8595..3831941 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 _0x9828=['info','ZendeskAccount,\x20%s,\x20%s','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','findAll','options','where','attributes','limit','include','map','model','then','GetZendeskAccount','stringify','catch','ShowZendeskAccount','ZendeskAccount','find','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x2afbb0,_0x44f16d){var _0x411ff2=function(_0x5edd7e){while(--_0x5edd7e){_0x2afbb0['push'](_0x2afbb0['shift']());}};_0x411ff2(++_0x44f16d);}(_0x9828,0xef));var _0x8982=function(_0x4c5e80,_0x4cc743){_0x4c5e80=_0x4c5e80-0x0;var _0x445cda=_0x9828[_0x4c5e80];return _0x445cda;};'use strict';var _=require('lodash');var util=require(_0x8982('0x0'));var moment=require(_0x8982('0x1'));var BPromise=require(_0x8982('0x2'));var rs=require(_0x8982('0x3'));var fs=require('fs');var Redis=require(_0x8982('0x4'));var db=require(_0x8982('0x5'))['db'];var utils=require(_0x8982('0x6'));var logger=require(_0x8982('0x7'))(_0x8982('0x8'));var config=require(_0x8982('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8982('0xa')][_0x8982('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e4e02,_0x3485d4,_0x407cf6){return new BPromise(function(_0x5766dd,_0x3c2511){return client[_0x8982('0xc')](_0x4e4e02,_0x407cf6)['then'](function(_0x1d49c){logger[_0x8982('0xd')](_0x8982('0xe'),_0x3485d4,'request\x20sent');logger[_0x8982('0xf')](_0x8982('0x10'),_0x3485d4,_0x8982('0x11'),JSON['stringify'](_0x1d49c));if(_0x1d49c[_0x8982('0x12')]){if(_0x1d49c[_0x8982('0x12')]['code']===0x1f4){logger[_0x8982('0x12')](_0x8982('0xe'),_0x3485d4,_0x1d49c['error'][_0x8982('0x13')]);return _0x3c2511(_0x1d49c['error'][_0x8982('0x13')]);}logger[_0x8982('0x12')](_0x8982('0xe'),_0x3485d4,_0x1d49c[_0x8982('0x12')]['message']);return _0x5766dd(_0x1d49c[_0x8982('0x12')][_0x8982('0x13')]);}else{logger[_0x8982('0xd')](_0x8982('0xe'),_0x3485d4,_0x8982('0x11'));_0x5766dd(_0x1d49c['result'][_0x8982('0x13')]);}})['catch'](function(_0x344a5a){logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x3485d4,_0x344a5a);_0x3c2511(_0x344a5a);});});}exports['GetZendeskAccount']=function(_0x4b8a7d){var _0x5a49f1=this;return new Promise(function(_0x3abc75,_0x359710){return db['ZendeskAccount'][_0x8982('0x14')]({'raw':_0x4b8a7d[_0x8982('0x15')]?_0x4b8a7d['options']['raw']===undefined?!![]:![]:!![],'where':_0x4b8a7d['options']?_0x4b8a7d[_0x8982('0x15')][_0x8982('0x16')]||null:null,'attributes':_0x4b8a7d[_0x8982('0x15')]?_0x4b8a7d['options'][_0x8982('0x17')]||null:null,'limit':_0x4b8a7d[_0x8982('0x15')]?_0x4b8a7d[_0x8982('0x15')][_0x8982('0x18')]||null:null,'include':_0x4b8a7d[_0x8982('0x15')]?_0x4b8a7d['options'][_0x8982('0x19')]?_[_0x8982('0x1a')](_0x4b8a7d[_0x8982('0x15')][_0x8982('0x19')],function(_0x2f777b){return{'model':db[_0x2f777b['model']],'as':_0x2f777b['as'],'attributes':_0x2f777b[_0x8982('0x17')],'include':_0x2f777b[_0x8982('0x19')]?_[_0x8982('0x1a')](_0x2f777b[_0x8982('0x19')],function(_0x388153){return{'model':db[_0x388153[_0x8982('0x1b')]],'as':_0x388153['as'],'attributes':_0x388153[_0x8982('0x17')],'include':_0x388153[_0x8982('0x19')]?_['map'](_0x388153[_0x8982('0x19')],function(_0x9b364a){return{'model':db[_0x9b364a[_0x8982('0x1b')]],'as':_0x9b364a['as'],'attributes':_0x9b364a['attributes']};}):[]};}):[]};}):[]:[]})[_0x8982('0x1c')](function(_0xd7aa93){logger[_0x8982('0xd')](_0x8982('0x1d'),_0x4b8a7d);logger[_0x8982('0xf')](_0x8982('0x1d'),_0x4b8a7d,JSON[_0x8982('0x1e')](_0xd7aa93));_0x3abc75(_0xd7aa93);})[_0x8982('0x1f')](function(_0x280c61){logger[_0x8982('0x12')](_0x8982('0x1d'),_0x280c61[_0x8982('0x13')],_0x4b8a7d);_0x359710(_0x5a49f1['error'](0x1f4,_0x280c61[_0x8982('0x13')]));});});};exports[_0x8982('0x20')]=function(_0x5674c0){var _0x467503=this;return new Promise(function(_0x16d2fd,_0xe24dd5){return db[_0x8982('0x21')][_0x8982('0x22')]({'raw':_0x5674c0['options']?_0x5674c0[_0x8982('0x15')][_0x8982('0x23')]===undefined?!![]:![]:!![],'where':_0x5674c0['options']?_0x5674c0['options'][_0x8982('0x16')]||null:null,'attributes':_0x5674c0[_0x8982('0x15')]?_0x5674c0[_0x8982('0x15')][_0x8982('0x17')]||null:null,'include':_0x5674c0['options']?_0x5674c0[_0x8982('0x15')][_0x8982('0x19')]?_[_0x8982('0x1a')](_0x5674c0[_0x8982('0x15')][_0x8982('0x19')],function(_0x271c67){return{'model':db[_0x271c67[_0x8982('0x1b')]],'as':_0x271c67['as'],'attributes':_0x271c67['attributes'],'include':_0x271c67[_0x8982('0x19')]?_[_0x8982('0x1a')](_0x271c67[_0x8982('0x19')],function(_0x56361d){return{'model':db[_0x56361d[_0x8982('0x1b')]],'as':_0x56361d['as'],'attributes':_0x56361d[_0x8982('0x17')],'include':_0x56361d[_0x8982('0x19')]?_[_0x8982('0x1a')](_0x56361d[_0x8982('0x19')],function(_0x230a0f){return{'model':db[_0x230a0f['model']],'as':_0x230a0f['as'],'attributes':_0x230a0f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x25a4b4){logger[_0x8982('0xd')](_0x8982('0x20'),_0x5674c0);logger['debug'](_0x8982('0x20'),_0x5674c0,JSON[_0x8982('0x1e')](_0x25a4b4));_0x16d2fd(_0x25a4b4);})[_0x8982('0x1f')](function(_0x5be526){logger[_0x8982('0x12')]('ShowZendeskAccount',_0x5be526[_0x8982('0x13')],_0x5674c0);_0xe24dd5(_0x467503['error'](0x1f4,_0x5be526[_0x8982('0x13')]));});});}; \ No newline at end of file +var _0x061b=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','ZendeskAccount,\x20%s,\x20%s','message','result','catch','ZendeskAccount','findAll','options','raw','attributes','limit','map','include','model','GetZendeskAccount','find','where','ShowZendeskAccount'];(function(_0x18445e,_0x17679e){var _0x1008cf=function(_0x2c8b8d){while(--_0x2c8b8d){_0x18445e['push'](_0x18445e['shift']());}};_0x1008cf(++_0x17679e);}(_0x061b,0x6f));var _0xb061=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x061b[_0x4fde08];return _0x12e725;};'use strict';var _=require(_0xb061('0x0'));var util=require(_0xb061('0x1'));var moment=require(_0xb061('0x2'));var BPromise=require('bluebird');var rs=require(_0xb061('0x3'));var fs=require('fs');var Redis=require(_0xb061('0x4'));var db=require(_0xb061('0x5'))['db'];var utils=require(_0xb061('0x6'));var logger=require(_0xb061('0x7'))('rpc');var config=require(_0xb061('0x8'));var jayson=require(_0xb061('0x9'));var client=jayson[_0xb061('0xa')][_0xb061('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4d865b,_0x35d8f2,_0x42b322){return new BPromise(function(_0x3e92cd,_0x49fbd1){return client['request'](_0x4d865b,_0x42b322)[_0xb061('0xc')](function(_0x3d3a05){logger[_0xb061('0xd')]('ZendeskAccount,\x20%s,\x20%s',_0x35d8f2,_0xb061('0xe'));logger[_0xb061('0xf')](_0xb061('0x10'),_0x35d8f2,_0xb061('0xe'),JSON[_0xb061('0x11')](_0x3d3a05));if(_0x3d3a05['error']){if(_0x3d3a05['error'][_0xb061('0x12')]===0x1f4){logger[_0xb061('0x13')](_0xb061('0x14'),_0x35d8f2,_0x3d3a05['error'][_0xb061('0x15')]);return _0x49fbd1(_0x3d3a05[_0xb061('0x13')][_0xb061('0x15')]);}logger[_0xb061('0x13')](_0xb061('0x14'),_0x35d8f2,_0x3d3a05[_0xb061('0x13')][_0xb061('0x15')]);return _0x3e92cd(_0x3d3a05['error'][_0xb061('0x15')]);}else{logger[_0xb061('0xd')](_0xb061('0x14'),_0x35d8f2,_0xb061('0xe'));_0x3e92cd(_0x3d3a05[_0xb061('0x16')][_0xb061('0x15')]);}})[_0xb061('0x17')](function(_0x293bc9){logger[_0xb061('0x13')](_0xb061('0x14'),_0x35d8f2,_0x293bc9);_0x49fbd1(_0x293bc9);});});}exports['GetZendeskAccount']=function(_0x4d1506){var _0x4e2256=this;return new Promise(function(_0x255d38,_0x20e518){return db[_0xb061('0x18')][_0xb061('0x19')]({'raw':_0x4d1506[_0xb061('0x1a')]?_0x4d1506['options'][_0xb061('0x1b')]===undefined?!![]:![]:!![],'where':_0x4d1506['options']?_0x4d1506['options']['where']||null:null,'attributes':_0x4d1506['options']?_0x4d1506[_0xb061('0x1a')][_0xb061('0x1c')]||null:null,'limit':_0x4d1506[_0xb061('0x1a')]?_0x4d1506[_0xb061('0x1a')][_0xb061('0x1d')]||null:null,'include':_0x4d1506[_0xb061('0x1a')]?_0x4d1506[_0xb061('0x1a')]['include']?_[_0xb061('0x1e')](_0x4d1506['options'][_0xb061('0x1f')],function(_0x2b4921){return{'model':db[_0x2b4921[_0xb061('0x20')]],'as':_0x2b4921['as'],'attributes':_0x2b4921[_0xb061('0x1c')],'include':_0x2b4921[_0xb061('0x1f')]?_[_0xb061('0x1e')](_0x2b4921[_0xb061('0x1f')],function(_0x1b5cec){return{'model':db[_0x1b5cec[_0xb061('0x20')]],'as':_0x1b5cec['as'],'attributes':_0x1b5cec['attributes'],'include':_0x1b5cec[_0xb061('0x1f')]?_[_0xb061('0x1e')](_0x1b5cec[_0xb061('0x1f')],function(_0x49c8d3){return{'model':db[_0x49c8d3[_0xb061('0x20')]],'as':_0x49c8d3['as'],'attributes':_0x49c8d3[_0xb061('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45ea78){logger[_0xb061('0xd')](_0xb061('0x21'),_0x4d1506);logger['debug'](_0xb061('0x21'),_0x4d1506,JSON[_0xb061('0x11')](_0x45ea78));_0x255d38(_0x45ea78);})['catch'](function(_0x1fec75){logger['error']('GetZendeskAccount',_0x1fec75[_0xb061('0x15')],_0x4d1506);_0x20e518(_0x4e2256[_0xb061('0x13')](0x1f4,_0x1fec75['message']));});});};exports['ShowZendeskAccount']=function(_0x12c542){var _0x29b447=this;return new Promise(function(_0x7df5d5,_0x3c8a9b){return db[_0xb061('0x18')][_0xb061('0x22')]({'raw':_0x12c542[_0xb061('0x1a')]?_0x12c542['options'][_0xb061('0x1b')]===undefined?!![]:![]:!![],'where':_0x12c542[_0xb061('0x1a')]?_0x12c542[_0xb061('0x1a')][_0xb061('0x23')]||null:null,'attributes':_0x12c542[_0xb061('0x1a')]?_0x12c542[_0xb061('0x1a')]['attributes']||null:null,'include':_0x12c542[_0xb061('0x1a')]?_0x12c542[_0xb061('0x1a')][_0xb061('0x1f')]?_['map'](_0x12c542['options'][_0xb061('0x1f')],function(_0x1afae5){return{'model':db[_0x1afae5[_0xb061('0x20')]],'as':_0x1afae5['as'],'attributes':_0x1afae5[_0xb061('0x1c')],'include':_0x1afae5[_0xb061('0x1f')]?_[_0xb061('0x1e')](_0x1afae5[_0xb061('0x1f')],function(_0x564037){return{'model':db[_0x564037['model']],'as':_0x564037['as'],'attributes':_0x564037[_0xb061('0x1c')],'include':_0x564037[_0xb061('0x1f')]?_[_0xb061('0x1e')](_0x564037['include'],function(_0x145d77){return{'model':db[_0x145d77[_0xb061('0x20')]],'as':_0x145d77['as'],'attributes':_0x145d77['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x501c61){logger[_0xb061('0xd')](_0xb061('0x24'),_0x12c542);logger[_0xb061('0xf')](_0xb061('0x24'),_0x12c542,JSON[_0xb061('0x11')](_0x501c61));_0x7df5d5(_0x501c61);})[_0xb061('0x17')](function(_0x29e53f){logger['error'](_0xb061('0x24'),_0x29e53f[_0xb061('0x15')],_0x12c542);_0x3c8a9b(_0x29b447[_0xb061('0x13')](0x1f4,_0x29e53f[_0xb061('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index b03f11c..0295d67 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 _0xb10b=['getFields','/:id/subjects','/:id/descriptions','getTags','post','create','setTags','put','/:id','update','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','index','isAuthenticated','show','/:id/fields'];(function(_0x11a2cb,_0x511230){var _0xf9a5ff=function(_0xf91f67){while(--_0xf91f67){_0x11a2cb['push'](_0x11a2cb['shift']());}};_0xf9a5ff(++_0x511230);}(_0xb10b,0x12a));var _0xbb10=function(_0xec3cab,_0x3d89a1){_0xec3cab=_0xec3cab-0x0;var _0x2e4e51=_0xb10b[_0xec3cab];return _0x2e4e51;};'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['getSubjects']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getDescriptions']);router[_0xbb10('0x9')]('/:id/tags',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x12')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router[_0xbb10('0x12')]('/:id/tags',auth[_0xbb10('0xb')](),controller[_0xbb10('0x14')]);router[_0xbb10('0x15')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x18')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x19')]);module['exports']=router; \ No newline at end of file +var _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','/:id/tags','getTags','post','create','put','update','delete','exports','multer','util','path','express','Router'];(function(_0x49dc35,_0x15cd14){var _0x5c24b6=function(_0x5b9a72){while(--_0x5b9a72){_0x49dc35['push'](_0x49dc35['shift']());}};_0x5c24b6(++_0x15cd14);}(_0xe706,0xa3));var _0x6e70=function(_0x4b006b,_0x3c1db3){_0x4b006b=_0x4b006b-0x0;var _0x362121=_0xe706[_0x4b006b];return _0x362121;};'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'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0xa')](_0x6e70('0x11'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0xa')](_0x6e70('0x13'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x6e70('0xa')](_0x6e70('0x14'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x15')]);router[_0x6e70('0x16')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x17')]);router[_0x6e70('0x16')]('/:id/tags',auth['isAuthenticated'](),controller['setTags']);router[_0x6e70('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x6e70('0x19')]);router[_0x6e70('0x1a')]('/:id',auth[_0x6e70('0xb')](),controller['destroy']);module[_0x6e70('0x1b')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 93823ff..3c82920 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 _0x0a6d=['exports','STRING','sequelize'];(function(_0x101383,_0x5bd543){var _0x46cfe9=function(_0x7e308a){while(--_0x7e308a){_0x101383['push'](_0x101383['shift']());}};_0x46cfe9(++_0x5bd543);}(_0x0a6d,0x11c));var _0xd0a6=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x0a6d[_0x422905];return _0x33dc6c;};'use strict';var Sequelize=require(_0xd0a6('0x0'));module[_0xd0a6('0x1')]={'name':{'type':Sequelize[_0xd0a6('0x2')]},'description':{'type':Sequelize[_0xd0a6('0x2')]}}; \ No newline at end of file +var _0x9060=['exports','STRING'];(function(_0x50a635,_0x158de3){var _0x15fcdf=function(_0x16342e){while(--_0x16342e){_0x50a635['push'](_0x50a635['shift']());}};_0x15fcdf(++_0x158de3);}(_0x9060,0x178));var _0x0906=function(_0x5c9307,_0x5b97e4){_0x5c9307=_0x5c9307-0x0;var _0x373e29=_0x9060[_0x5c9307];return _0x373e29;};'use strict';var Sequelize=require('sequelize');module[_0x0906('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0906('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index d79a9bc..da5895c 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 _0x8ee8=['reject','update','then','destroy','sendStatus','error','stack','name','index','map','ZendeskConfiguration','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','count','includeAll','findAll','rows','catch','show','params','include','merge','find','create','body','getFields','findOne','rawAttributes','options','ZendeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','offset','set','Content-Range','apply'];(function(_0x32f453,_0x3812be){var _0xa47333=function(_0x5df11e){while(--_0x5df11e){_0x32f453['push'](_0x32f453['shift']());}};_0xa47333(++_0x3812be);}(_0x8ee8,0x137));var _0x88ee=function(_0x1d930e,_0x20d8b8){_0x1d930e=_0x1d930e-0x0;var _0x5bbd66=_0x8ee8[_0x1d930e];return _0x5bbd66;};'use strict';var emlformat=require(_0x88ee('0x0'));var rimraf=require(_0x88ee('0x1'));var zipdir=require(_0x88ee('0x2'));var jsonpatch=require(_0x88ee('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x88ee('0x4'));var Mustache=require(_0x88ee('0x5'));var util=require('util');var path=require(_0x88ee('0x6'));var sox=require(_0x88ee('0x7'));var csv=require(_0x88ee('0x8'));var ejs=require(_0x88ee('0x9'));var fs=require('fs');var fs_extra=require(_0x88ee('0xa'));var _=require(_0x88ee('0xb'));var squel=require(_0x88ee('0xc'));var crypto=require('crypto');var jsforce=require(_0x88ee('0xd'));var deskjs=require(_0x88ee('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x88ee('0xf'));var Redis=require(_0x88ee('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x88ee('0x11'));var hardwareService=require(_0x88ee('0x12'));var logger=require('../../config/logger')(_0x88ee('0x13'));var utils=require(_0x88ee('0x14'));var config=require(_0x88ee('0x15'));var licenseUtil=require(_0x88ee('0x16'));var db=require(_0x88ee('0x17'))['db'];function respondWithStatusCode(_0x3704fc,_0x837c03){_0x837c03=_0x837c03||0xcc;return function(_0x28b794){if(_0x28b794){return _0x3704fc['sendStatus'](_0x837c03);}return _0x3704fc[_0x88ee('0x18')](_0x837c03)[_0x88ee('0x19')]();};}function respondWithResult(_0x2a45ef,_0x37227){_0x37227=_0x37227||0xc8;return function(_0x5e68e3){if(_0x5e68e3){return _0x2a45ef[_0x88ee('0x18')](_0x37227)[_0x88ee('0x1a')](_0x5e68e3);}};}function respondWithFilteredResult(_0x61ad55,_0x150d4d){return function(_0x2cbd74){if(_0x2cbd74){var _0x32c74f=typeof _0x150d4d['offset']===_0x88ee('0x1b')&&typeof _0x150d4d[_0x88ee('0x1c')]===_0x88ee('0x1b');var _0x54cf35=_0x2cbd74['count'];var _0x81cecc=_0x32c74f?0x0:_0x150d4d[_0x88ee('0x1d')];var _0x267516=_0x32c74f?_0x2cbd74['count']:_0x150d4d[_0x88ee('0x1d')]+_0x150d4d[_0x88ee('0x1c')];var _0x12b285;if(_0x267516>=_0x54cf35){_0x267516=_0x54cf35;_0x12b285=0xc8;}else{_0x12b285=0xce;}_0x61ad55[_0x88ee('0x18')](_0x12b285);return _0x61ad55[_0x88ee('0x1e')](_0x88ee('0x1f'),_0x81cecc+'-'+_0x267516+'/'+_0x54cf35)['json'](_0x2cbd74);}return null;};}function patchUpdates(_0x50e435){return function(_0x39b6e8){try{jsonpatch[_0x88ee('0x20')](_0x39b6e8,_0x50e435,!![]);}catch(_0x23d7b8){return BPromise[_0x88ee('0x21')](_0x23d7b8);}return _0x39b6e8['save']();};}function saveUpdates(_0xe6da3,_0x54fe2a){return function(_0x3ee12b){if(_0x3ee12b){return _0x3ee12b[_0x88ee('0x22')](_0xe6da3)[_0x88ee('0x23')](function(_0x255837){return _0x255837;});}return null;};}function removeEntity(_0x5a486c,_0x48532c){return function(_0x1d6a68){if(_0x1d6a68){return _0x1d6a68[_0x88ee('0x24')]()[_0x88ee('0x23')](function(){_0x5a486c[_0x88ee('0x18')](0xcc)[_0x88ee('0x19')]();});}};}function handleEntityNotFound(_0x553956,_0x162dfd){return function(_0x980b57){if(!_0x980b57){_0x553956[_0x88ee('0x25')](0x194);}return _0x980b57;};}function handleError(_0x50240d,_0x51ff65){_0x51ff65=_0x51ff65||0x1f4;return function(_0x25d65f){logger[_0x88ee('0x26')](_0x25d65f[_0x88ee('0x27')]);if(_0x25d65f[_0x88ee('0x28')]){delete _0x25d65f[_0x88ee('0x28')];}_0x50240d[_0x88ee('0x18')](_0x51ff65)['send'](_0x25d65f);};}exports[_0x88ee('0x29')]=function(_0x1e3cf3,_0x5571db){var _0x338a27={},_0x2b382d={},_0x374c44={'count':0x0,'rows':[]};var _0x8e05aa=_[_0x88ee('0x2a')](db[_0x88ee('0x2b')]['rawAttributes'],function(_0x1c9467){return{'name':_0x1c9467[_0x88ee('0x2c')],'type':_0x1c9467[_0x88ee('0x2d')][_0x88ee('0x2e')]};});_0x2b382d['model']=_[_0x88ee('0x2a')](_0x8e05aa,'name');_0x2b382d[_0x88ee('0x2f')]=_[_0x88ee('0x30')](_0x1e3cf3[_0x88ee('0x2f')]);_0x2b382d[_0x88ee('0x31')]=_['intersection'](_0x2b382d[_0x88ee('0x32')],_0x2b382d[_0x88ee('0x2f')]);_0x338a27[_0x88ee('0x33')]=_[_0x88ee('0x34')](_0x2b382d['model'],qs[_0x88ee('0x35')](_0x1e3cf3[_0x88ee('0x2f')][_0x88ee('0x35')]));_0x338a27[_0x88ee('0x33')]=_0x338a27[_0x88ee('0x33')][_0x88ee('0x36')]?_0x338a27[_0x88ee('0x33')]:_0x2b382d[_0x88ee('0x32')];if(!_0x1e3cf3['query'][_0x88ee('0x37')](_0x88ee('0x38'))){_0x338a27[_0x88ee('0x1c')]=qs['limit'](_0x1e3cf3[_0x88ee('0x2f')][_0x88ee('0x1c')]);_0x338a27[_0x88ee('0x1d')]=qs[_0x88ee('0x1d')](_0x1e3cf3[_0x88ee('0x2f')][_0x88ee('0x1d')]);}_0x338a27[_0x88ee('0x39')]=qs[_0x88ee('0x3a')](_0x1e3cf3[_0x88ee('0x2f')][_0x88ee('0x3a')]);_0x338a27[_0x88ee('0x3b')]=qs['filters'](_[_0x88ee('0x3c')](_0x1e3cf3[_0x88ee('0x2f')],_0x2b382d[_0x88ee('0x31')]),_0x8e05aa);if(_0x1e3cf3[_0x88ee('0x2f')][_0x88ee('0x3d')]){_0x338a27[_0x88ee('0x3b')]=_['merge'](_0x338a27['where'],{'$or':_[_0x88ee('0x2a')](_0x8e05aa,function(_0x422a7a){if(_0x422a7a[_0x88ee('0x2d')]!==_0x88ee('0x3e')){var _0xe0f4af={};_0xe0f4af[_0x422a7a[_0x88ee('0x28')]]={'$like':'%'+_0x1e3cf3[_0x88ee('0x2f')][_0x88ee('0x3d')]+'%'};return _0xe0f4af;}})});}_0x338a27=_['merge']({},_0x338a27,_0x1e3cf3['options']);var _0x147c49={'where':_0x338a27['where']};return db[_0x88ee('0x2b')][_0x88ee('0x3f')](_0x147c49)[_0x88ee('0x23')](function(_0xa8f1b1){_0x374c44[_0x88ee('0x3f')]=_0xa8f1b1;if(_0x1e3cf3[_0x88ee('0x2f')][_0x88ee('0x40')]){_0x338a27['include']=[{'all':!![]}];}return db[_0x88ee('0x2b')][_0x88ee('0x41')](_0x338a27);})[_0x88ee('0x23')](function(_0x3ffd3f){_0x374c44[_0x88ee('0x42')]=_0x3ffd3f;return _0x374c44;})['then'](respondWithFilteredResult(_0x5571db,_0x338a27))[_0x88ee('0x43')](handleError(_0x5571db,null));};exports[_0x88ee('0x44')]=function(_0x236bfc,_0x6917a5){var _0x1a638b={'raw':![],'where':{'id':_0x236bfc[_0x88ee('0x45')]['id']}},_0x2492a2={};_0x2492a2['model']=_['keys'](db[_0x88ee('0x2b')]['rawAttributes']);_0x2492a2[_0x88ee('0x2f')]=_['keys'](_0x236bfc[_0x88ee('0x2f')]);_0x2492a2[_0x88ee('0x31')]=_[_0x88ee('0x34')](_0x2492a2[_0x88ee('0x32')],_0x2492a2[_0x88ee('0x2f')]);_0x1a638b['attributes']=_['intersection'](_0x2492a2[_0x88ee('0x32')],qs[_0x88ee('0x35')](_0x236bfc[_0x88ee('0x2f')][_0x88ee('0x35')]));_0x1a638b[_0x88ee('0x33')]=_0x1a638b[_0x88ee('0x33')][_0x88ee('0x36')]?_0x1a638b[_0x88ee('0x33')]:_0x2492a2[_0x88ee('0x32')];if(_0x236bfc['query'][_0x88ee('0x40')]){_0x1a638b[_0x88ee('0x46')]=[{'all':!![]}];}_0x1a638b=_[_0x88ee('0x47')]({},_0x1a638b,_0x236bfc['options']);return db[_0x88ee('0x2b')][_0x88ee('0x48')](_0x1a638b)[_0x88ee('0x23')](handleEntityNotFound(_0x6917a5,null))[_0x88ee('0x23')](respondWithResult(_0x6917a5,null))[_0x88ee('0x43')](handleError(_0x6917a5,null));};exports[_0x88ee('0x49')]=function(_0x25e89a,_0x3b9051){return db['ZendeskConfiguration'][_0x88ee('0x49')](_0x25e89a['body'],{})[_0x88ee('0x23')](respondWithResult(_0x3b9051,0xc9))[_0x88ee('0x43')](handleError(_0x3b9051,null));};exports[_0x88ee('0x22')]=function(_0x3ee5c4,_0x13c517){if(_0x3ee5c4[_0x88ee('0x4a')]['id']){delete _0x3ee5c4[_0x88ee('0x4a')]['id'];}return db[_0x88ee('0x2b')]['find']({'where':{'id':_0x3ee5c4[_0x88ee('0x45')]['id']}})[_0x88ee('0x23')](handleEntityNotFound(_0x13c517,null))[_0x88ee('0x23')](saveUpdates(_0x3ee5c4['body'],null))[_0x88ee('0x23')](respondWithResult(_0x13c517,null))[_0x88ee('0x43')](handleError(_0x13c517,null));};exports[_0x88ee('0x24')]=function(_0x555095,_0x2a10ad){return db[_0x88ee('0x2b')][_0x88ee('0x48')]({'where':{'id':_0x555095[_0x88ee('0x45')]['id']}})[_0x88ee('0x23')](handleEntityNotFound(_0x2a10ad,null))[_0x88ee('0x23')](removeEntity(_0x2a10ad,null))[_0x88ee('0x43')](handleError(_0x2a10ad,null));};exports[_0x88ee('0x4b')]=function(_0x122934,_0x5772f9,_0x289a7f){var _0x9093b4={};var _0x43e8af={};var _0x2fbbef;var _0x227d2b;return db[_0x88ee('0x2b')][_0x88ee('0x4c')]({'where':{'id':_0x122934[_0x88ee('0x45')]['id']}})[_0x88ee('0x23')](handleEntityNotFound(_0x5772f9,null))[_0x88ee('0x23')](function(_0x30ba05){if(_0x30ba05){_0x2fbbef=_0x30ba05;_0x43e8af[_0x88ee('0x32')]=_[_0x88ee('0x30')](db['ZendeskField'][_0x88ee('0x4d')]);_0x43e8af[_0x88ee('0x2f')]=_['keys'](_0x122934[_0x88ee('0x2f')]);_0x43e8af['filters']=_[_0x88ee('0x34')](_0x43e8af[_0x88ee('0x32')],_0x43e8af[_0x88ee('0x2f')]);_0x9093b4['attributes']=_[_0x88ee('0x34')](_0x43e8af[_0x88ee('0x32')],qs[_0x88ee('0x35')](_0x122934[_0x88ee('0x2f')][_0x88ee('0x35')]));_0x9093b4['attributes']=_0x9093b4[_0x88ee('0x33')][_0x88ee('0x36')]?_0x9093b4[_0x88ee('0x33')]:_0x43e8af['model'];_0x9093b4[_0x88ee('0x39')]=qs['sort'](_0x122934['query'][_0x88ee('0x3a')]);_0x9093b4['where']=qs[_0x88ee('0x31')](_[_0x88ee('0x3c')](_0x122934['query'],_0x43e8af['filters']));if(_0x122934[_0x88ee('0x2f')][_0x88ee('0x3d')]){_0x9093b4[_0x88ee('0x3b')]=_['merge'](_0x9093b4[_0x88ee('0x3b')],{'$or':_[_0x88ee('0x2a')](_0x9093b4[_0x88ee('0x33')],function(_0x54a503){var _0x5c95db={};_0x5c95db[_0x54a503]={'$like':'%'+_0x122934[_0x88ee('0x2f')][_0x88ee('0x3d')]+'%'};return _0x5c95db;})});}_0x9093b4=_[_0x88ee('0x47')]({},_0x9093b4,_0x122934[_0x88ee('0x4e')]);return _0x2fbbef[_0x88ee('0x4b')](_0x9093b4);}})[_0x88ee('0x23')](function(_0x302ca8){if(_0x302ca8){_0x227d2b=_0x302ca8[_0x88ee('0x36')];if(!_0x122934[_0x88ee('0x2f')][_0x88ee('0x37')]('nolimit')){_0x9093b4[_0x88ee('0x1c')]=qs[_0x88ee('0x1c')](_0x122934[_0x88ee('0x2f')][_0x88ee('0x1c')]);_0x9093b4[_0x88ee('0x1d')]=qs[_0x88ee('0x1d')](_0x122934[_0x88ee('0x2f')][_0x88ee('0x1d')]);}return _0x2fbbef[_0x88ee('0x4b')](_0x9093b4);}})[_0x88ee('0x23')](function(_0x2be043){if(_0x2be043){return _0x2be043?{'count':_0x227d2b,'rows':_0x2be043}:null;}})['then'](respondWithResult(_0x5772f9,null))[_0x88ee('0x43')](handleError(_0x5772f9,null));};exports['getSubjects']=function(_0x2e4ed4,_0x5a1844,_0x6149bb){var _0x47e3d8={};var _0xa3c52f={};var _0x8efecf;var _0x13b181;return db[_0x88ee('0x2b')][_0x88ee('0x4c')]({'where':{'id':_0x2e4ed4[_0x88ee('0x45')]['id']}})[_0x88ee('0x23')](handleEntityNotFound(_0x5a1844,null))['then'](function(_0x3ca0a0){if(_0x3ca0a0){_0x8efecf=_0x3ca0a0;_0xa3c52f['model']=_[_0x88ee('0x30')](db[_0x88ee('0x4f')][_0x88ee('0x4d')]);_0xa3c52f[_0x88ee('0x2f')]=_[_0x88ee('0x30')](_0x2e4ed4['query']);_0xa3c52f['filters']=_[_0x88ee('0x34')](_0xa3c52f[_0x88ee('0x32')],_0xa3c52f[_0x88ee('0x2f')]);_0x47e3d8['attributes']=_[_0x88ee('0x34')](_0xa3c52f['model'],qs[_0x88ee('0x35')](_0x2e4ed4['query'][_0x88ee('0x35')]));_0x47e3d8[_0x88ee('0x33')]=_0x47e3d8[_0x88ee('0x33')][_0x88ee('0x36')]?_0x47e3d8['attributes']:_0xa3c52f[_0x88ee('0x32')];_0x47e3d8[_0x88ee('0x39')]=qs[_0x88ee('0x3a')](_0x2e4ed4[_0x88ee('0x2f')][_0x88ee('0x3a')]);_0x47e3d8[_0x88ee('0x3b')]=qs[_0x88ee('0x31')](_[_0x88ee('0x3c')](_0x2e4ed4[_0x88ee('0x2f')],_0xa3c52f['filters']));if(_0x2e4ed4[_0x88ee('0x2f')]['filter']){_0x47e3d8[_0x88ee('0x3b')]=_[_0x88ee('0x47')](_0x47e3d8[_0x88ee('0x3b')],{'$or':_['map'](_0x47e3d8[_0x88ee('0x33')],function(_0x582b1a){var _0x55e326={};_0x55e326[_0x582b1a]={'$like':'%'+_0x2e4ed4['query'][_0x88ee('0x3d')]+'%'};return _0x55e326;})});}_0x47e3d8=_[_0x88ee('0x47')]({},_0x47e3d8,_0x2e4ed4[_0x88ee('0x4e')]);return _0x8efecf[_0x88ee('0x50')](_0x47e3d8);}})['then'](function(_0x326199){if(_0x326199){_0x13b181=_0x326199[_0x88ee('0x36')];if(!_0x2e4ed4[_0x88ee('0x2f')][_0x88ee('0x37')](_0x88ee('0x38'))){_0x47e3d8[_0x88ee('0x1c')]=qs[_0x88ee('0x1c')](_0x2e4ed4[_0x88ee('0x2f')][_0x88ee('0x1c')]);_0x47e3d8[_0x88ee('0x1d')]=qs['offset'](_0x2e4ed4[_0x88ee('0x2f')][_0x88ee('0x1d')]);}return _0x8efecf[_0x88ee('0x50')](_0x47e3d8);}})[_0x88ee('0x23')](function(_0x45837d){if(_0x45837d){return _0x45837d?{'count':_0x13b181,'rows':_0x45837d}:null;}})[_0x88ee('0x23')](respondWithResult(_0x5a1844,null))['catch'](handleError(_0x5a1844,null));};exports[_0x88ee('0x51')]=function(_0x2f0870,_0x58951c,_0x344bed){var _0x2e337b={};var _0x24b522={};var _0x3381f2;var _0x1de531;return db[_0x88ee('0x2b')]['findOne']({'where':{'id':_0x2f0870[_0x88ee('0x45')]['id']}})[_0x88ee('0x23')](handleEntityNotFound(_0x58951c,null))[_0x88ee('0x23')](function(_0x8c4184){if(_0x8c4184){_0x3381f2=_0x8c4184;_0x24b522[_0x88ee('0x32')]=_[_0x88ee('0x30')](db['ZendeskField']['rawAttributes']);_0x24b522[_0x88ee('0x2f')]=_[_0x88ee('0x30')](_0x2f0870[_0x88ee('0x2f')]);_0x24b522['filters']=_[_0x88ee('0x34')](_0x24b522[_0x88ee('0x32')],_0x24b522['query']);_0x2e337b[_0x88ee('0x33')]=_[_0x88ee('0x34')](_0x24b522['model'],qs[_0x88ee('0x35')](_0x2f0870[_0x88ee('0x2f')]['fields']));_0x2e337b[_0x88ee('0x33')]=_0x2e337b[_0x88ee('0x33')][_0x88ee('0x36')]?_0x2e337b['attributes']:_0x24b522['model'];_0x2e337b[_0x88ee('0x39')]=qs[_0x88ee('0x3a')](_0x2f0870['query']['sort']);_0x2e337b[_0x88ee('0x3b')]=qs[_0x88ee('0x31')](_[_0x88ee('0x3c')](_0x2f0870[_0x88ee('0x2f')],_0x24b522[_0x88ee('0x31')]));if(_0x2f0870[_0x88ee('0x2f')]['filter']){_0x2e337b[_0x88ee('0x3b')]=_[_0x88ee('0x47')](_0x2e337b[_0x88ee('0x3b')],{'$or':_['map'](_0x2e337b[_0x88ee('0x33')],function(_0x5667db){var _0x4af045={};_0x4af045[_0x5667db]={'$like':'%'+_0x2f0870[_0x88ee('0x2f')][_0x88ee('0x3d')]+'%'};return _0x4af045;})});}_0x2e337b=_['merge']({},_0x2e337b,_0x2f0870[_0x88ee('0x4e')]);return _0x3381f2['getDescriptions'](_0x2e337b);}})[_0x88ee('0x23')](function(_0x34181f){if(_0x34181f){_0x1de531=_0x34181f[_0x88ee('0x36')];if(!_0x2f0870[_0x88ee('0x2f')]['hasOwnProperty'](_0x88ee('0x38'))){_0x2e337b[_0x88ee('0x1c')]=qs['limit'](_0x2f0870[_0x88ee('0x2f')][_0x88ee('0x1c')]);_0x2e337b['offset']=qs[_0x88ee('0x1d')](_0x2f0870['query'][_0x88ee('0x1d')]);}return _0x3381f2[_0x88ee('0x51')](_0x2e337b);}})['then'](function(_0x48699b){if(_0x48699b){return _0x48699b?{'count':_0x1de531,'rows':_0x48699b}:null;}})[_0x88ee('0x23')](respondWithResult(_0x58951c,null))[_0x88ee('0x43')](handleError(_0x58951c,null));};exports[_0x88ee('0x52')]=function(_0x316618,_0x1f85a5,_0x5e3b03){var _0xad4d07={};var _0x445d9c={};var _0x5cb451;var _0x42a8e1;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x316618[_0x88ee('0x45')]['id']}})[_0x88ee('0x23')](handleEntityNotFound(_0x1f85a5,null))[_0x88ee('0x23')](function(_0x636903){if(_0x636903){_0x5cb451=_0x636903;_0x445d9c[_0x88ee('0x32')]=_[_0x88ee('0x30')](db[_0x88ee('0x53')][_0x88ee('0x4d')]);_0x445d9c['query']=_[_0x88ee('0x30')](_0x316618[_0x88ee('0x2f')]);_0x445d9c[_0x88ee('0x31')]=_[_0x88ee('0x34')](_0x445d9c[_0x88ee('0x32')],_0x445d9c[_0x88ee('0x2f')]);_0xad4d07[_0x88ee('0x33')]=_['intersection'](_0x445d9c[_0x88ee('0x32')],qs[_0x88ee('0x35')](_0x316618[_0x88ee('0x2f')][_0x88ee('0x35')]));_0xad4d07[_0x88ee('0x33')]=_0xad4d07['attributes'][_0x88ee('0x36')]?_0xad4d07[_0x88ee('0x33')]:_0x445d9c[_0x88ee('0x32')];_0xad4d07[_0x88ee('0x39')]=qs[_0x88ee('0x3a')](_0x316618[_0x88ee('0x2f')][_0x88ee('0x3a')]);_0xad4d07[_0x88ee('0x3b')]=qs[_0x88ee('0x31')](_[_0x88ee('0x3c')](_0x316618[_0x88ee('0x2f')],_0x445d9c[_0x88ee('0x31')]));if(_0x316618[_0x88ee('0x2f')][_0x88ee('0x3d')]){_0xad4d07[_0x88ee('0x3b')]=_[_0x88ee('0x47')](_0xad4d07[_0x88ee('0x3b')],{'$or':_[_0x88ee('0x2a')](_0xad4d07['attributes'],function(_0x7aeb72){var _0x36c104={};_0x36c104[_0x7aeb72]={'$like':'%'+_0x316618[_0x88ee('0x2f')][_0x88ee('0x3d')]+'%'};return _0x36c104;})});}_0xad4d07=_[_0x88ee('0x47')]({},_0xad4d07,_0x316618['options']);return _0x5cb451[_0x88ee('0x52')](_0xad4d07);}})[_0x88ee('0x23')](function(_0x42b611){if(_0x42b611){_0x42a8e1=_0x42b611['length'];if(!_0x316618[_0x88ee('0x2f')][_0x88ee('0x37')](_0x88ee('0x38'))){_0xad4d07[_0x88ee('0x1c')]=qs[_0x88ee('0x1c')](_0x316618[_0x88ee('0x2f')]['limit']);_0xad4d07[_0x88ee('0x1d')]=qs['offset'](_0x316618[_0x88ee('0x2f')][_0x88ee('0x1d')]);}return _0x5cb451[_0x88ee('0x52')](_0xad4d07);}})[_0x88ee('0x23')](function(_0x53dc1a){if(_0x53dc1a){return _0x53dc1a?{'count':_0x42a8e1,'rows':_0x53dc1a}:null;}})[_0x88ee('0x23')](respondWithResult(_0x1f85a5,null))['catch'](handleError(_0x1f85a5,null));};exports['setTags']=function(_0x260a98,_0x5d5f3b,_0x13e460){if(_0x260a98[_0x88ee('0x4a')]['id']){delete _0x260a98[_0x88ee('0x4a')]['id'];}return db[_0x88ee('0x2b')][_0x88ee('0x4c')]({'where':{'id':_0x260a98[_0x88ee('0x45')]['id']}})[_0x88ee('0x23')](handleEntityNotFound(_0x5d5f3b,null))[_0x88ee('0x23')](function(_0x2073f5){if(_0x2073f5){return _0x2073f5[_0x88ee('0x54')](_0x260a98[_0x88ee('0x4a')][_0x88ee('0x55')]||[]);}return null;})[_0x88ee('0x23')](respondWithResult(_0x5d5f3b,null))[_0x88ee('0x43')](handleError(_0x5d5f3b,null));}; \ No newline at end of file +var _0x68b5=['getFields','findOne','ZendeskField','hasOwnProperty','getSubjects','getDescriptions','nolimit','Tag','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','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','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','ZendeskConfiguration','type','key','model','query','keys','intersection','attributes','fields','length','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','catch','show','params','rawAttributes','options','find','create','body','destroy'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x68b5,0x16f));var _0x568b=function(_0x1ffb7e,_0x5ac8c1){_0x1ffb7e=_0x1ffb7e-0x0;var _0x44dc91=_0x68b5[_0x1ffb7e];return _0x44dc91;};'use strict';var emlformat=require(_0x568b('0x0'));var rimraf=require(_0x568b('0x1'));var zipdir=require(_0x568b('0x2'));var jsonpatch=require(_0x568b('0x3'));var rp=require(_0x568b('0x4'));var moment=require(_0x568b('0x5'));var BPromise=require(_0x568b('0x6'));var Mustache=require(_0x568b('0x7'));var util=require(_0x568b('0x8'));var path=require('path');var sox=require(_0x568b('0x9'));var csv=require(_0x568b('0xa'));var ejs=require(_0x568b('0xb'));var fs=require('fs');var fs_extra=require(_0x568b('0xc'));var _=require(_0x568b('0xd'));var squel=require(_0x568b('0xe'));var crypto=require('crypto');var jsforce=require(_0x568b('0xf'));var deskjs=require(_0x568b('0x10'));var toCsv=require(_0x568b('0xa'));var querystring=require('querystring');var Papa=require(_0x568b('0x11'));var Redis=require(_0x568b('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x568b('0x13'));var as=require(_0x568b('0x14'));var hardwareService=require(_0x568b('0x15'));var logger=require(_0x568b('0x16'))(_0x568b('0x17'));var utils=require(_0x568b('0x18'));var config=require(_0x568b('0x19'));var licenseUtil=require(_0x568b('0x1a'));var db=require(_0x568b('0x1b'))['db'];function respondWithStatusCode(_0x1e6469,_0x2a7533){_0x2a7533=_0x2a7533||0xcc;return function(_0x4c36c6){if(_0x4c36c6){return _0x1e6469[_0x568b('0x1c')](_0x2a7533);}return _0x1e6469['status'](_0x2a7533)[_0x568b('0x1d')]();};}function respondWithResult(_0x25af33,_0x2bf248){_0x2bf248=_0x2bf248||0xc8;return function(_0x534e63){if(_0x534e63){return _0x25af33[_0x568b('0x1e')](_0x2bf248)[_0x568b('0x1f')](_0x534e63);}};}function respondWithFilteredResult(_0x458168,_0x322052){return function(_0x40cc40){if(_0x40cc40){var _0x2179c7=typeof _0x322052[_0x568b('0x20')]===_0x568b('0x21')&&typeof _0x322052[_0x568b('0x22')]===_0x568b('0x21');var _0x188b7f=_0x40cc40[_0x568b('0x23')];var _0xc20df=_0x2179c7?0x0:_0x322052[_0x568b('0x20')];var _0x1663cc=_0x2179c7?_0x40cc40[_0x568b('0x23')]:_0x322052[_0x568b('0x20')]+_0x322052[_0x568b('0x22')];var _0x3f42a0;if(_0x1663cc>=_0x188b7f){_0x1663cc=_0x188b7f;_0x3f42a0=0xc8;}else{_0x3f42a0=0xce;}_0x458168['status'](_0x3f42a0);return _0x458168[_0x568b('0x24')](_0x568b('0x25'),_0xc20df+'-'+_0x1663cc+'/'+_0x188b7f)[_0x568b('0x1f')](_0x40cc40);}return null;};}function patchUpdates(_0x2cff1b){return function(_0x4be8ad){try{jsonpatch[_0x568b('0x26')](_0x4be8ad,_0x2cff1b,!![]);}catch(_0x3f4070){return BPromise[_0x568b('0x27')](_0x3f4070);}return _0x4be8ad[_0x568b('0x28')]();};}function saveUpdates(_0x4674f0,_0x5b3fd7){return function(_0x838681){if(_0x838681){return _0x838681[_0x568b('0x29')](_0x4674f0)[_0x568b('0x2a')](function(_0x17fbc0){return _0x17fbc0;});}return null;};}function removeEntity(_0x480c41,_0x5e86a6){return function(_0x41ac09){if(_0x41ac09){return _0x41ac09['destroy']()[_0x568b('0x2a')](function(){_0x480c41[_0x568b('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x425085,_0x128043){return function(_0x45e632){if(!_0x45e632){_0x425085['sendStatus'](0x194);}return _0x45e632;};}function handleError(_0x1f4a72,_0x46476b){_0x46476b=_0x46476b||0x1f4;return function(_0x54f4ce){logger[_0x568b('0x2b')](_0x54f4ce[_0x568b('0x2c')]);if(_0x54f4ce[_0x568b('0x2d')]){delete _0x54f4ce[_0x568b('0x2d')];}_0x1f4a72[_0x568b('0x1e')](_0x46476b)[_0x568b('0x2e')](_0x54f4ce);};}exports[_0x568b('0x2f')]=function(_0x1f27a5,_0x5e6727){var _0x3334f2={},_0x28f726={},_0x3ecc59={'count':0x0,'rows':[]};var _0x5402cf=_[_0x568b('0x30')](db[_0x568b('0x31')]['rawAttributes'],function(_0x5b67f7){return{'name':_0x5b67f7['fieldName'],'type':_0x5b67f7[_0x568b('0x32')][_0x568b('0x33')]};});_0x28f726[_0x568b('0x34')]=_[_0x568b('0x30')](_0x5402cf,'name');_0x28f726[_0x568b('0x35')]=_[_0x568b('0x36')](_0x1f27a5[_0x568b('0x35')]);_0x28f726['filters']=_[_0x568b('0x37')](_0x28f726[_0x568b('0x34')],_0x28f726[_0x568b('0x35')]);_0x3334f2[_0x568b('0x38')]=_[_0x568b('0x37')](_0x28f726[_0x568b('0x34')],qs[_0x568b('0x39')](_0x1f27a5[_0x568b('0x35')][_0x568b('0x39')]));_0x3334f2[_0x568b('0x38')]=_0x3334f2['attributes'][_0x568b('0x3a')]?_0x3334f2[_0x568b('0x38')]:_0x28f726[_0x568b('0x34')];if(!_0x1f27a5[_0x568b('0x35')]['hasOwnProperty']('nolimit')){_0x3334f2[_0x568b('0x22')]=qs[_0x568b('0x22')](_0x1f27a5[_0x568b('0x35')]['limit']);_0x3334f2[_0x568b('0x20')]=qs['offset'](_0x1f27a5[_0x568b('0x35')][_0x568b('0x20')]);}_0x3334f2[_0x568b('0x3b')]=qs['sort'](_0x1f27a5[_0x568b('0x35')][_0x568b('0x3c')]);_0x3334f2[_0x568b('0x3d')]=qs[_0x568b('0x3e')](_[_0x568b('0x3f')](_0x1f27a5[_0x568b('0x35')],_0x28f726[_0x568b('0x3e')]),_0x5402cf);if(_0x1f27a5[_0x568b('0x35')][_0x568b('0x40')]){_0x3334f2[_0x568b('0x3d')]=_[_0x568b('0x41')](_0x3334f2[_0x568b('0x3d')],{'$or':_['map'](_0x5402cf,function(_0x3ddbf9){if(_0x3ddbf9[_0x568b('0x32')]!==_0x568b('0x42')){var _0x5afc09={};_0x5afc09[_0x3ddbf9[_0x568b('0x2d')]]={'$like':'%'+_0x1f27a5['query'][_0x568b('0x40')]+'%'};return _0x5afc09;}})});}_0x3334f2=_[_0x568b('0x41')]({},_0x3334f2,_0x1f27a5['options']);var _0x4ec747={'where':_0x3334f2[_0x568b('0x3d')]};return db['ZendeskConfiguration'][_0x568b('0x23')](_0x4ec747)[_0x568b('0x2a')](function(_0x25c788){_0x3ecc59[_0x568b('0x23')]=_0x25c788;if(_0x1f27a5[_0x568b('0x35')][_0x568b('0x43')]){_0x3334f2[_0x568b('0x44')]=[{'all':!![]}];}return db['ZendeskConfiguration']['findAll'](_0x3334f2);})[_0x568b('0x2a')](function(_0x3fe805){_0x3ecc59['rows']=_0x3fe805;return _0x3ecc59;})[_0x568b('0x2a')](respondWithFilteredResult(_0x5e6727,_0x3334f2))[_0x568b('0x45')](handleError(_0x5e6727,null));};exports[_0x568b('0x46')]=function(_0x4c01c5,_0x216e03){var _0x37da92={'raw':![],'where':{'id':_0x4c01c5[_0x568b('0x47')]['id']}},_0x29cd52={};_0x29cd52[_0x568b('0x34')]=_['keys'](db[_0x568b('0x31')][_0x568b('0x48')]);_0x29cd52[_0x568b('0x35')]=_['keys'](_0x4c01c5['query']);_0x29cd52[_0x568b('0x3e')]=_[_0x568b('0x37')](_0x29cd52[_0x568b('0x34')],_0x29cd52[_0x568b('0x35')]);_0x37da92[_0x568b('0x38')]=_[_0x568b('0x37')](_0x29cd52[_0x568b('0x34')],qs[_0x568b('0x39')](_0x4c01c5[_0x568b('0x35')][_0x568b('0x39')]));_0x37da92[_0x568b('0x38')]=_0x37da92[_0x568b('0x38')][_0x568b('0x3a')]?_0x37da92[_0x568b('0x38')]:_0x29cd52[_0x568b('0x34')];if(_0x4c01c5[_0x568b('0x35')][_0x568b('0x43')]){_0x37da92['include']=[{'all':!![]}];}_0x37da92=_[_0x568b('0x41')]({},_0x37da92,_0x4c01c5[_0x568b('0x49')]);return db[_0x568b('0x31')][_0x568b('0x4a')](_0x37da92)[_0x568b('0x2a')](handleEntityNotFound(_0x216e03,null))['then'](respondWithResult(_0x216e03,null))[_0x568b('0x45')](handleError(_0x216e03,null));};exports[_0x568b('0x4b')]=function(_0x5ee0e2,_0x53d1ce){return db[_0x568b('0x31')][_0x568b('0x4b')](_0x5ee0e2[_0x568b('0x4c')],{})['then'](respondWithResult(_0x53d1ce,0xc9))['catch'](handleError(_0x53d1ce,null));};exports['update']=function(_0x110275,_0x539273){if(_0x110275[_0x568b('0x4c')]['id']){delete _0x110275[_0x568b('0x4c')]['id'];}return db[_0x568b('0x31')][_0x568b('0x4a')]({'where':{'id':_0x110275[_0x568b('0x47')]['id']}})['then'](handleEntityNotFound(_0x539273,null))['then'](saveUpdates(_0x110275['body'],null))[_0x568b('0x2a')](respondWithResult(_0x539273,null))[_0x568b('0x45')](handleError(_0x539273,null));};exports[_0x568b('0x4d')]=function(_0x344031,_0xc119be){return db[_0x568b('0x31')][_0x568b('0x4a')]({'where':{'id':_0x344031[_0x568b('0x47')]['id']}})[_0x568b('0x2a')](handleEntityNotFound(_0xc119be,null))['then'](removeEntity(_0xc119be,null))[_0x568b('0x45')](handleError(_0xc119be,null));};exports[_0x568b('0x4e')]=function(_0x57b488,_0x25fb4a,_0x4bcdcd){var _0x44ba39={};var _0x5d44c8={};var _0x3b7205;var _0x55f99c;return db[_0x568b('0x31')][_0x568b('0x4f')]({'where':{'id':_0x57b488[_0x568b('0x47')]['id']}})[_0x568b('0x2a')](handleEntityNotFound(_0x25fb4a,null))[_0x568b('0x2a')](function(_0x48a483){if(_0x48a483){_0x3b7205=_0x48a483;_0x5d44c8[_0x568b('0x34')]=_['keys'](db[_0x568b('0x50')][_0x568b('0x48')]);_0x5d44c8['query']=_[_0x568b('0x36')](_0x57b488['query']);_0x5d44c8[_0x568b('0x3e')]=_[_0x568b('0x37')](_0x5d44c8[_0x568b('0x34')],_0x5d44c8['query']);_0x44ba39[_0x568b('0x38')]=_[_0x568b('0x37')](_0x5d44c8['model'],qs[_0x568b('0x39')](_0x57b488[_0x568b('0x35')][_0x568b('0x39')]));_0x44ba39[_0x568b('0x38')]=_0x44ba39['attributes'][_0x568b('0x3a')]?_0x44ba39[_0x568b('0x38')]:_0x5d44c8[_0x568b('0x34')];_0x44ba39[_0x568b('0x3b')]=qs[_0x568b('0x3c')](_0x57b488[_0x568b('0x35')][_0x568b('0x3c')]);_0x44ba39['where']=qs[_0x568b('0x3e')](_['pick'](_0x57b488[_0x568b('0x35')],_0x5d44c8[_0x568b('0x3e')]));if(_0x57b488['query'][_0x568b('0x40')]){_0x44ba39[_0x568b('0x3d')]=_[_0x568b('0x41')](_0x44ba39['where'],{'$or':_[_0x568b('0x30')](_0x44ba39[_0x568b('0x38')],function(_0x5e65cd){var _0x2dbabb={};_0x2dbabb[_0x5e65cd]={'$like':'%'+_0x57b488['query'][_0x568b('0x40')]+'%'};return _0x2dbabb;})});}_0x44ba39=_[_0x568b('0x41')]({},_0x44ba39,_0x57b488[_0x568b('0x49')]);return _0x3b7205[_0x568b('0x4e')](_0x44ba39);}})[_0x568b('0x2a')](function(_0x1d591e){if(_0x1d591e){_0x55f99c=_0x1d591e[_0x568b('0x3a')];if(!_0x57b488[_0x568b('0x35')][_0x568b('0x51')]('nolimit')){_0x44ba39[_0x568b('0x22')]=qs['limit'](_0x57b488[_0x568b('0x35')][_0x568b('0x22')]);_0x44ba39[_0x568b('0x20')]=qs[_0x568b('0x20')](_0x57b488[_0x568b('0x35')][_0x568b('0x20')]);}return _0x3b7205[_0x568b('0x4e')](_0x44ba39);}})[_0x568b('0x2a')](function(_0x1bb377){if(_0x1bb377){return _0x1bb377?{'count':_0x55f99c,'rows':_0x1bb377}:null;}})[_0x568b('0x2a')](respondWithResult(_0x25fb4a,null))[_0x568b('0x45')](handleError(_0x25fb4a,null));};exports[_0x568b('0x52')]=function(_0x11b092,_0x11f5e2,_0x3dadda){var _0x595b76={};var _0x195307={};var _0x434803;var _0x56230e;return db[_0x568b('0x31')][_0x568b('0x4f')]({'where':{'id':_0x11b092[_0x568b('0x47')]['id']}})[_0x568b('0x2a')](handleEntityNotFound(_0x11f5e2,null))[_0x568b('0x2a')](function(_0x26a6dc){if(_0x26a6dc){_0x434803=_0x26a6dc;_0x195307[_0x568b('0x34')]=_[_0x568b('0x36')](db[_0x568b('0x50')][_0x568b('0x48')]);_0x195307[_0x568b('0x35')]=_['keys'](_0x11b092[_0x568b('0x35')]);_0x195307['filters']=_[_0x568b('0x37')](_0x195307[_0x568b('0x34')],_0x195307[_0x568b('0x35')]);_0x595b76[_0x568b('0x38')]=_[_0x568b('0x37')](_0x195307[_0x568b('0x34')],qs['fields'](_0x11b092[_0x568b('0x35')]['fields']));_0x595b76[_0x568b('0x38')]=_0x595b76[_0x568b('0x38')]['length']?_0x595b76[_0x568b('0x38')]:_0x195307[_0x568b('0x34')];_0x595b76['order']=qs[_0x568b('0x3c')](_0x11b092[_0x568b('0x35')][_0x568b('0x3c')]);_0x595b76['where']=qs[_0x568b('0x3e')](_['pick'](_0x11b092[_0x568b('0x35')],_0x195307[_0x568b('0x3e')]));if(_0x11b092[_0x568b('0x35')][_0x568b('0x40')]){_0x595b76[_0x568b('0x3d')]=_[_0x568b('0x41')](_0x595b76['where'],{'$or':_[_0x568b('0x30')](_0x595b76[_0x568b('0x38')],function(_0x2bc581){var _0x582fa5={};_0x582fa5[_0x2bc581]={'$like':'%'+_0x11b092[_0x568b('0x35')][_0x568b('0x40')]+'%'};return _0x582fa5;})});}_0x595b76=_[_0x568b('0x41')]({},_0x595b76,_0x11b092[_0x568b('0x49')]);return _0x434803[_0x568b('0x52')](_0x595b76);}})['then'](function(_0x4a8c34){if(_0x4a8c34){_0x56230e=_0x4a8c34['length'];if(!_0x11b092['query'][_0x568b('0x51')]('nolimit')){_0x595b76[_0x568b('0x22')]=qs[_0x568b('0x22')](_0x11b092['query']['limit']);_0x595b76[_0x568b('0x20')]=qs[_0x568b('0x20')](_0x11b092[_0x568b('0x35')]['offset']);}return _0x434803[_0x568b('0x52')](_0x595b76);}})['then'](function(_0x426a4c){if(_0x426a4c){return _0x426a4c?{'count':_0x56230e,'rows':_0x426a4c}:null;}})[_0x568b('0x2a')](respondWithResult(_0x11f5e2,null))[_0x568b('0x45')](handleError(_0x11f5e2,null));};exports[_0x568b('0x53')]=function(_0x16124,_0x1618da,_0xcaead8){var _0x3c5419={};var _0xebcde9={};var _0x203933;var _0x54591f;return db[_0x568b('0x31')][_0x568b('0x4f')]({'where':{'id':_0x16124[_0x568b('0x47')]['id']}})[_0x568b('0x2a')](handleEntityNotFound(_0x1618da,null))[_0x568b('0x2a')](function(_0xd0a0){if(_0xd0a0){_0x203933=_0xd0a0;_0xebcde9[_0x568b('0x34')]=_[_0x568b('0x36')](db[_0x568b('0x50')][_0x568b('0x48')]);_0xebcde9[_0x568b('0x35')]=_[_0x568b('0x36')](_0x16124[_0x568b('0x35')]);_0xebcde9[_0x568b('0x3e')]=_[_0x568b('0x37')](_0xebcde9[_0x568b('0x34')],_0xebcde9[_0x568b('0x35')]);_0x3c5419[_0x568b('0x38')]=_[_0x568b('0x37')](_0xebcde9['model'],qs[_0x568b('0x39')](_0x16124[_0x568b('0x35')]['fields']));_0x3c5419['attributes']=_0x3c5419['attributes'][_0x568b('0x3a')]?_0x3c5419['attributes']:_0xebcde9[_0x568b('0x34')];_0x3c5419[_0x568b('0x3b')]=qs['sort'](_0x16124[_0x568b('0x35')][_0x568b('0x3c')]);_0x3c5419['where']=qs['filters'](_[_0x568b('0x3f')](_0x16124[_0x568b('0x35')],_0xebcde9[_0x568b('0x3e')]));if(_0x16124['query'][_0x568b('0x40')]){_0x3c5419[_0x568b('0x3d')]=_['merge'](_0x3c5419[_0x568b('0x3d')],{'$or':_[_0x568b('0x30')](_0x3c5419[_0x568b('0x38')],function(_0x21ec5d){var _0x182785={};_0x182785[_0x21ec5d]={'$like':'%'+_0x16124[_0x568b('0x35')][_0x568b('0x40')]+'%'};return _0x182785;})});}_0x3c5419=_['merge']({},_0x3c5419,_0x16124[_0x568b('0x49')]);return _0x203933[_0x568b('0x53')](_0x3c5419);}})[_0x568b('0x2a')](function(_0x189261){if(_0x189261){_0x54591f=_0x189261['length'];if(!_0x16124[_0x568b('0x35')][_0x568b('0x51')](_0x568b('0x54'))){_0x3c5419[_0x568b('0x22')]=qs[_0x568b('0x22')](_0x16124[_0x568b('0x35')][_0x568b('0x22')]);_0x3c5419['offset']=qs['offset'](_0x16124[_0x568b('0x35')][_0x568b('0x20')]);}return _0x203933[_0x568b('0x53')](_0x3c5419);}})[_0x568b('0x2a')](function(_0x57e2a8){if(_0x57e2a8){return _0x57e2a8?{'count':_0x54591f,'rows':_0x57e2a8}:null;}})['then'](respondWithResult(_0x1618da,null))['catch'](handleError(_0x1618da,null));};exports['getTags']=function(_0x1b2bcf,_0x2e2ed2,_0x46da4d){var _0x2fe519={};var _0x55d070={};var _0x5c9eba;var _0x1cced4;return db[_0x568b('0x31')][_0x568b('0x4f')]({'where':{'id':_0x1b2bcf[_0x568b('0x47')]['id']}})[_0x568b('0x2a')](handleEntityNotFound(_0x2e2ed2,null))[_0x568b('0x2a')](function(_0x119c40){if(_0x119c40){_0x5c9eba=_0x119c40;_0x55d070[_0x568b('0x34')]=_[_0x568b('0x36')](db[_0x568b('0x55')]['rawAttributes']);_0x55d070[_0x568b('0x35')]=_['keys'](_0x1b2bcf[_0x568b('0x35')]);_0x55d070[_0x568b('0x3e')]=_['intersection'](_0x55d070[_0x568b('0x34')],_0x55d070[_0x568b('0x35')]);_0x2fe519[_0x568b('0x38')]=_[_0x568b('0x37')](_0x55d070[_0x568b('0x34')],qs['fields'](_0x1b2bcf[_0x568b('0x35')][_0x568b('0x39')]));_0x2fe519[_0x568b('0x38')]=_0x2fe519['attributes'][_0x568b('0x3a')]?_0x2fe519['attributes']:_0x55d070[_0x568b('0x34')];_0x2fe519[_0x568b('0x3b')]=qs[_0x568b('0x3c')](_0x1b2bcf[_0x568b('0x35')]['sort']);_0x2fe519[_0x568b('0x3d')]=qs[_0x568b('0x3e')](_[_0x568b('0x3f')](_0x1b2bcf[_0x568b('0x35')],_0x55d070['filters']));if(_0x1b2bcf[_0x568b('0x35')][_0x568b('0x40')]){_0x2fe519['where']=_[_0x568b('0x41')](_0x2fe519[_0x568b('0x3d')],{'$or':_[_0x568b('0x30')](_0x2fe519[_0x568b('0x38')],function(_0x57fe06){var _0x27a5e7={};_0x27a5e7[_0x57fe06]={'$like':'%'+_0x1b2bcf[_0x568b('0x35')][_0x568b('0x40')]+'%'};return _0x27a5e7;})});}_0x2fe519=_['merge']({},_0x2fe519,_0x1b2bcf[_0x568b('0x49')]);return _0x5c9eba[_0x568b('0x56')](_0x2fe519);}})[_0x568b('0x2a')](function(_0x11dcd9){if(_0x11dcd9){_0x1cced4=_0x11dcd9['length'];if(!_0x1b2bcf['query'][_0x568b('0x51')](_0x568b('0x54'))){_0x2fe519[_0x568b('0x22')]=qs[_0x568b('0x22')](_0x1b2bcf[_0x568b('0x35')][_0x568b('0x22')]);_0x2fe519[_0x568b('0x20')]=qs[_0x568b('0x20')](_0x1b2bcf[_0x568b('0x35')][_0x568b('0x20')]);}return _0x5c9eba['getTags'](_0x2fe519);}})[_0x568b('0x2a')](function(_0x233813){if(_0x233813){return _0x233813?{'count':_0x1cced4,'rows':_0x233813}:null;}})[_0x568b('0x2a')](respondWithResult(_0x2e2ed2,null))['catch'](handleError(_0x2e2ed2,null));};exports[_0x568b('0x57')]=function(_0x525a06,_0x28dc95,_0x49538f){if(_0x525a06[_0x568b('0x4c')]['id']){delete _0x525a06[_0x568b('0x4c')]['id'];}return db[_0x568b('0x31')][_0x568b('0x4f')]({'where':{'id':_0x525a06[_0x568b('0x47')]['id']}})[_0x568b('0x2a')](handleEntityNotFound(_0x28dc95,null))[_0x568b('0x2a')](function(_0x1f80d0){if(_0x1f80d0){return _0x1f80d0['setTags'](_0x525a06['body'][_0x568b('0x58')]||[]);}return null;})[_0x568b('0x2a')](respondWithResult(_0x28dc95,null))[_0x568b('0x45')](handleError(_0x28dc95,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 526a755..b1d793c 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 _0x8603=['util','../../config/logger','api','request-promise','path','rimraf','./intZendeskConfiguration.attributes','define','ZendeskConfiguration','int_zendesk_configurations'];(function(_0x121035,_0x427bb2){var _0x236663=function(_0x479984){while(--_0x479984){_0x121035['push'](_0x121035['shift']());}};_0x236663(++_0x427bb2);}(_0x8603,0x190));var _0x3860=function(_0x4109e7,_0x2c8158){_0x4109e7=_0x4109e7-0x0;var _0x28d807=_0x8603[_0x4109e7];return _0x28d807;};'use strict';var _=require('lodash');var util=require(_0x3860('0x0'));var logger=require(_0x3860('0x1'))(_0x3860('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3860('0x3'));var fs=require('fs');var path=require(_0x3860('0x4'));var rimraf=require(_0x3860('0x5'));var config=require('../../config/environment');var attributes=require(_0x3860('0x6'));module['exports']=function(_0xb0fc24,_0x40739b){return _0xb0fc24[_0x3860('0x7')](_0x3860('0x8'),attributes,{'tableName':_0x3860('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa571=['util','../../config/logger','api','bluebird','request-promise','../../config/environment','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash'];(function(_0x5cc59f,_0x1e334c){var _0x140bee=function(_0x4242f2){while(--_0x4242f2){_0x5cc59f['push'](_0x5cc59f['shift']());}};_0x140bee(++_0x1e334c);}(_0xa571,0x107));var _0x1a57=function(_0x41596d,_0x26b03d){_0x41596d=_0x41596d-0x0;var _0x598a36=_0xa571[_0x41596d];return _0x598a36;};'use strict';var _=require(_0x1a57('0x0'));var util=require(_0x1a57('0x1'));var logger=require(_0x1a57('0x2'))(_0x1a57('0x3'));var moment=require('moment');var BPromise=require(_0x1a57('0x4'));var rp=require(_0x1a57('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1a57('0x6'));var attributes=require('./intZendeskConfiguration.attributes');module[_0x1a57('0x7')]=function(_0xd97a33,_0x22ca20){return _0xd97a33[_0x1a57('0x8')](_0x1a57('0x9'),attributes,{'tableName':_0x1a57('0xa'),'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 f9d19bf..1f85152 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 _0xacab=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','ZendeskConfiguration,\x20%s,\x20%s','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','catch','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x4bc09d,_0x54df83){var _0x26c8a1=function(_0x1d830f){while(--_0x1d830f){_0x4bc09d['push'](_0x4bc09d['shift']());}};_0x26c8a1(++_0x54df83);}(_0xacab,0x19d));var _0xbaca=function(_0x2f57ac,_0x4c1f9f){_0x2f57ac=_0x2f57ac-0x0;var _0x73dfc2=_0xacab[_0x2f57ac];return _0x73dfc2;};'use strict';var _=require('lodash');var util=require(_0xbaca('0x0'));var moment=require(_0xbaca('0x1'));var BPromise=require('bluebird');var rs=require(_0xbaca('0x2'));var fs=require('fs');var Redis=require(_0xbaca('0x3'));var db=require(_0xbaca('0x4'))['db'];var utils=require(_0xbaca('0x5'));var logger=require(_0xbaca('0x6'))('rpc');var config=require(_0xbaca('0x7'));var jayson=require(_0xbaca('0x8'));var client=jayson[_0xbaca('0x9')][_0xbaca('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x427801,_0x24f68a,_0x277a9d){return new BPromise(function(_0x27ff4c,_0x5b3f58){return client[_0xbaca('0xb')](_0x427801,_0x277a9d)[_0xbaca('0xc')](function(_0x58e8f2){logger['info'](_0xbaca('0xd'),_0x24f68a,'request\x20sent');logger[_0xbaca('0xe')](_0xbaca('0xf'),_0x24f68a,_0xbaca('0x10'),JSON[_0xbaca('0x11')](_0x58e8f2));if(_0x58e8f2[_0xbaca('0x12')]){if(_0x58e8f2['error']['code']===0x1f4){logger['error'](_0xbaca('0xd'),_0x24f68a,_0x58e8f2[_0xbaca('0x12')][_0xbaca('0x13')]);return _0x5b3f58(_0x58e8f2[_0xbaca('0x12')]['message']);}logger['error'](_0xbaca('0xd'),_0x24f68a,_0x58e8f2[_0xbaca('0x12')][_0xbaca('0x13')]);return _0x27ff4c(_0x58e8f2[_0xbaca('0x12')][_0xbaca('0x13')]);}else{logger[_0xbaca('0x14')]('ZendeskConfiguration,\x20%s,\x20%s',_0x24f68a,'request\x20sent');_0x27ff4c(_0x58e8f2['result'][_0xbaca('0x13')]);}})[_0xbaca('0x15')](function(_0x55ef07){logger[_0xbaca('0x12')]('ZendeskConfiguration,\x20%s,\x20%s',_0x24f68a,_0x55ef07);_0x5b3f58(_0x55ef07);});});} \ No newline at end of file +var _0x2120=['result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskConfiguration,\x20%s,\x20%s','message'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x2120,0xda));var _0x0212=function(_0x581af1,_0x4f02c5){_0x581af1=_0x581af1-0x0;var _0x54c22e=_0x2120[_0x581af1];return _0x54c22e;};'use strict';var _=require(_0x0212('0x0'));var util=require(_0x0212('0x1'));var moment=require(_0x0212('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0212('0x3'));var db=require(_0x0212('0x4'))['db'];var utils=require(_0x0212('0x5'));var logger=require(_0x0212('0x6'))(_0x0212('0x7'));var config=require(_0x0212('0x8'));var jayson=require(_0x0212('0x9'));var client=jayson[_0x0212('0xa')][_0x0212('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x390ef5,_0x45a891,_0x4a1590){return new BPromise(function(_0x92250a,_0x4baf41){return client['request'](_0x390ef5,_0x4a1590)[_0x0212('0xc')](function(_0x30bacb){logger[_0x0212('0xd')]('ZendeskConfiguration,\x20%s,\x20%s',_0x45a891,_0x0212('0xe'));logger[_0x0212('0xf')](_0x0212('0x10'),_0x45a891,_0x0212('0xe'),JSON[_0x0212('0x11')](_0x30bacb));if(_0x30bacb[_0x0212('0x12')]){if(_0x30bacb['error'][_0x0212('0x13')]===0x1f4){logger[_0x0212('0x12')](_0x0212('0x14'),_0x45a891,_0x30bacb[_0x0212('0x12')][_0x0212('0x15')]);return _0x4baf41(_0x30bacb[_0x0212('0x12')]['message']);}logger[_0x0212('0x12')](_0x0212('0x14'),_0x45a891,_0x30bacb[_0x0212('0x12')]['message']);return _0x92250a(_0x30bacb['error']['message']);}else{logger[_0x0212('0xd')](_0x0212('0x14'),_0x45a891,_0x0212('0xe'));_0x92250a(_0x30bacb[_0x0212('0x16')][_0x0212('0x15')]);}})[_0x0212('0x17')](function(_0x122732){logger[_0x0212('0x12')]('ZendeskConfiguration,\x20%s,\x20%s',_0x45a891,_0x122732);_0x4baf41(_0x122732);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index f84f741..e203017 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 _0xc349=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','update','delete','destroy','multer','path','connect-timeout','express'];(function(_0x1a1d40,_0x4bfe26){var _0x1bb229=function(_0x5f42ef){while(--_0x5f42ef){_0x1a1d40['push'](_0x1a1d40['shift']());}};_0x1bb229(++_0x4bfe26);}(_0xc349,0x11d));var _0x9c34=function(_0x23fc25,_0xb4b802){_0x23fc25=_0x23fc25-0x0;var _0x59122b=_0xc349[_0x23fc25];return _0x59122b;};'use strict';var multer=require(_0x9c34('0x0'));var util=require('util');var path=require(_0x9c34('0x1'));var timeout=require(_0x9c34('0x2'));var express=require(_0x9c34('0x3'));var router=express[_0x9c34('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9c34('0x5'));var interaction=require(_0x9c34('0x6'));var config=require(_0x9c34('0x7'));var controller=require('./intZendeskField.controller');router[_0x9c34('0x8')]('/',auth['isAuthenticated'](),controller[_0x9c34('0x9')]);router['get'](_0x9c34('0xa'),auth[_0x9c34('0xb')](),controller[_0x9c34('0xc')]);router[_0x9c34('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x9c34('0xa'),auth[_0x9c34('0xb')](),controller[_0x9c34('0xe')]);router[_0x9c34('0xf')](_0x9c34('0xa'),auth[_0x9c34('0xb')](),controller[_0x9c34('0x10')]);module['exports']=router; \ No newline at end of file +var _0x71d9=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','multer','util','path','express','Router','fs-extra'];(function(_0x3ff609,_0x13f623){var _0x30804d=function(_0x4d6fb3){while(--_0x4d6fb3){_0x3ff609['push'](_0x3ff609['shift']());}};_0x30804d(++_0x13f623);}(_0x71d9,0x1c6));var _0x971d=function(_0x8143a8,_0x4c5e16){_0x8143a8=_0x8143a8-0x0;var _0x6e96=_0x71d9[_0x8143a8];return _0x6e96;};'use strict';var multer=require(_0x971d('0x0'));var util=require(_0x971d('0x1'));var path=require(_0x971d('0x2'));var timeout=require('connect-timeout');var express=require(_0x971d('0x3'));var router=express[_0x971d('0x4')]();var fs_extra=require(_0x971d('0x5'));var auth=require(_0x971d('0x6'));var interaction=require(_0x971d('0x7'));var config=require(_0x971d('0x8'));var controller=require('./intZendeskField.controller');router[_0x971d('0x9')]('/',auth['isAuthenticated'](),controller[_0x971d('0xa')]);router['get'](_0x971d('0xb'),auth[_0x971d('0xc')](),controller[_0x971d('0xd')]);router[_0x971d('0xe')]('/',auth[_0x971d('0xc')](),controller[_0x971d('0xf')]);router[_0x971d('0x10')](_0x971d('0xb'),auth[_0x971d('0xc')](),controller[_0x971d('0x11')]);router[_0x971d('0x12')](_0x971d('0xb'),auth[_0x971d('0xc')](),controller[_0x971d('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index e343e96..7045370 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 _0x2032=['sequelize','exports','ENUM','string','variable','customVariable','picklist','STRING','BOOLEAN'];(function(_0x2b525b,_0x547e47){var _0x2e21d8=function(_0x5ab85c){while(--_0x5ab85c){_0x2b525b['push'](_0x2b525b['shift']());}};_0x2e21d8(++_0x547e47);}(_0x2032,0xea));var _0x2203=function(_0x47a0e3,_0x42ae85){_0x47a0e3=_0x47a0e3-0x0;var _0x2e0cf9=_0x2032[_0x47a0e3];return _0x2e0cf9;};'use strict';var Sequelize=require(_0x2203('0x0'));module[_0x2203('0x1')]={'type':{'type':Sequelize[_0x2203('0x2')](_0x2203('0x3'),_0x2203('0x4'),_0x2203('0x5'),'keyValue',_0x2203('0x6')),'defaultValue':_0x2203('0x3')},'content':{'type':Sequelize[_0x2203('0x7')]},'key':{'type':Sequelize[_0x2203('0x7')]},'keyType':{'type':Sequelize[_0x2203('0x2')](_0x2203('0x3'),_0x2203('0x4'),_0x2203('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x2203('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x2203('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2203('0x7')]}}; \ No newline at end of file +var _0x7b2b=['variable','customVariable','keyValue','STRING','ENUM','exports','string'];(function(_0x51f116,_0x355db3){var _0x517f39=function(_0x47256e){while(--_0x47256e){_0x51f116['push'](_0x51f116['shift']());}};_0x517f39(++_0x355db3);}(_0x7b2b,0x116));var _0xb7b2=function(_0x196a99,_0x449460){_0x196a99=_0x196a99-0x0;var _0x55103e=_0x7b2b[_0x196a99];return _0x55103e;};'use strict';var Sequelize=require('sequelize');module[_0xb7b2('0x0')]={'type':{'type':Sequelize['ENUM'](_0xb7b2('0x1'),_0xb7b2('0x2'),_0xb7b2('0x3'),_0xb7b2('0x4'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0xb7b2('0x5')]},'key':{'type':Sequelize[_0xb7b2('0x5')]},'keyType':{'type':Sequelize[_0xb7b2('0x6')]('string',_0xb7b2('0x2'),_0xb7b2('0x3'))},'keyContent':{'type':Sequelize[_0xb7b2('0x5')]},'idField':{'type':Sequelize[_0xb7b2('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 11c4980..4745144 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 _0xb28a=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','save','then','destroy','error','stack','name','index','map','ZendeskField','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','keys','length','include','find','create','catch','body','params','rimraf','zip-dir','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js'];(function(_0x1182ae,_0x4b1516){var _0x24047a=function(_0x1947c9){while(--_0x1947c9){_0x1182ae['push'](_0x1182ae['shift']());}};_0x24047a(++_0x4b1516);}(_0xb28a,0x166));var _0xab28=function(_0x9c0dd2,_0x523ac9){_0x9c0dd2=_0x9c0dd2-0x0;var _0x5bbd0a=_0xb28a[_0x9c0dd2];return _0x5bbd0a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xab28('0x0'));var zipdir=require(_0xab28('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xab28('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xab28('0x3'));var path=require(_0xab28('0x4'));var sox=require(_0xab28('0x5'));var csv=require(_0xab28('0x6'));var ejs=require(_0xab28('0x7'));var fs=require('fs');var fs_extra=require(_0xab28('0x8'));var _=require(_0xab28('0x9'));var squel=require(_0xab28('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xab28('0xb'));var toCsv=require(_0xab28('0x6'));var querystring=require(_0xab28('0xc'));var Papa=require(_0xab28('0xd'));var Redis=require(_0xab28('0xe'));var authService=require(_0xab28('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xab28('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xab28('0x11'))(_0xab28('0x12'));var utils=require(_0xab28('0x13'));var config=require(_0xab28('0x14'));var licenseUtil=require(_0xab28('0x15'));var db=require(_0xab28('0x16'))['db'];function respondWithStatusCode(_0x3fd6f2,_0x1976a5){_0x1976a5=_0x1976a5||0xcc;return function(_0x5b32d6){if(_0x5b32d6){return _0x3fd6f2[_0xab28('0x17')](_0x1976a5);}return _0x3fd6f2[_0xab28('0x18')](_0x1976a5)[_0xab28('0x19')]();};}function respondWithResult(_0x389fc3,_0x2c05bc){_0x2c05bc=_0x2c05bc||0xc8;return function(_0x19029e){if(_0x19029e){return _0x389fc3['status'](_0x2c05bc)['json'](_0x19029e);}};}function respondWithFilteredResult(_0x7c1921,_0x3d133e){return function(_0x14e8b4){if(_0x14e8b4){var _0xaaeb24=typeof _0x3d133e['offset']===_0xab28('0x1a')&&typeof _0x3d133e['limit']===_0xab28('0x1a');var _0x54f79b=_0x14e8b4[_0xab28('0x1b')];var _0x2b0b5c=_0xaaeb24?0x0:_0x3d133e[_0xab28('0x1c')];var _0x4005fd=_0xaaeb24?_0x14e8b4[_0xab28('0x1b')]:_0x3d133e[_0xab28('0x1c')]+_0x3d133e[_0xab28('0x1d')];var _0x300cbd;if(_0x4005fd>=_0x54f79b){_0x4005fd=_0x54f79b;_0x300cbd=0xc8;}else{_0x300cbd=0xce;}_0x7c1921['status'](_0x300cbd);return _0x7c1921[_0xab28('0x1e')](_0xab28('0x1f'),_0x2b0b5c+'-'+_0x4005fd+'/'+_0x54f79b)[_0xab28('0x20')](_0x14e8b4);}return null;};}function patchUpdates(_0x170a80){return function(_0x2f6541){try{jsonpatch[_0xab28('0x21')](_0x2f6541,_0x170a80,!![]);}catch(_0x1b0fc6){return BPromise['reject'](_0x1b0fc6);}return _0x2f6541[_0xab28('0x22')]();};}function saveUpdates(_0x4ec564,_0x1db226){return function(_0x127e2b){if(_0x127e2b){return _0x127e2b['update'](_0x4ec564)[_0xab28('0x23')](function(_0x1829bd){return _0x1829bd;});}return null;};}function removeEntity(_0x3bef23,_0x46a24b){return function(_0x4549e6){if(_0x4549e6){return _0x4549e6[_0xab28('0x24')]()[_0xab28('0x23')](function(){_0x3bef23['status'](0xcc)[_0xab28('0x19')]();});}};}function handleEntityNotFound(_0x50ae27,_0x2163d2){return function(_0x2e6359){if(!_0x2e6359){_0x50ae27['sendStatus'](0x194);}return _0x2e6359;};}function handleError(_0x3928f0,_0x5e0099){_0x5e0099=_0x5e0099||0x1f4;return function(_0x2fd3aa){logger[_0xab28('0x25')](_0x2fd3aa[_0xab28('0x26')]);if(_0x2fd3aa['name']){delete _0x2fd3aa[_0xab28('0x27')];}_0x3928f0[_0xab28('0x18')](_0x5e0099)['send'](_0x2fd3aa);};}exports[_0xab28('0x28')]=function(_0x46b19b,_0x323e0d){var _0x1fe502={},_0x537f64={},_0x163f1b={'count':0x0,'rows':[]};var _0x299da7=_[_0xab28('0x29')](db[_0xab28('0x2a')][_0xab28('0x2b')],function(_0x4114fd){return{'name':_0x4114fd[_0xab28('0x2c')],'type':_0x4114fd[_0xab28('0x2d')][_0xab28('0x2e')]};});_0x537f64[_0xab28('0x2f')]=_['map'](_0x299da7,'name');_0x537f64[_0xab28('0x30')]=_['keys'](_0x46b19b['query']);_0x537f64[_0xab28('0x31')]=_[_0xab28('0x32')](_0x537f64[_0xab28('0x2f')],_0x537f64[_0xab28('0x30')]);_0x1fe502[_0xab28('0x33')]=_[_0xab28('0x32')](_0x537f64['model'],qs[_0xab28('0x34')](_0x46b19b[_0xab28('0x30')][_0xab28('0x34')]));_0x1fe502['attributes']=_0x1fe502[_0xab28('0x33')]['length']?_0x1fe502[_0xab28('0x33')]:_0x537f64[_0xab28('0x2f')];if(!_0x46b19b['query'][_0xab28('0x35')](_0xab28('0x36'))){_0x1fe502[_0xab28('0x1d')]=qs[_0xab28('0x1d')](_0x46b19b[_0xab28('0x30')][_0xab28('0x1d')]);_0x1fe502['offset']=qs[_0xab28('0x1c')](_0x46b19b[_0xab28('0x30')]['offset']);}_0x1fe502[_0xab28('0x37')]=qs[_0xab28('0x38')](_0x46b19b[_0xab28('0x30')][_0xab28('0x38')]);_0x1fe502[_0xab28('0x39')]=qs[_0xab28('0x31')](_[_0xab28('0x3a')](_0x46b19b[_0xab28('0x30')],_0x537f64['filters']),_0x299da7);if(_0x46b19b[_0xab28('0x30')][_0xab28('0x3b')]){_0x1fe502['where']=_[_0xab28('0x3c')](_0x1fe502[_0xab28('0x39')],{'$or':_['map'](_0x299da7,function(_0x24fc45){if(_0x24fc45[_0xab28('0x2d')]!==_0xab28('0x3d')){var _0x33604b={};_0x33604b[_0x24fc45[_0xab28('0x27')]]={'$like':'%'+_0x46b19b[_0xab28('0x30')][_0xab28('0x3b')]+'%'};return _0x33604b;}})});}_0x1fe502=_['merge']({},_0x1fe502,_0x46b19b[_0xab28('0x3e')]);var _0x38e846={'where':_0x1fe502['where']};return db[_0xab28('0x2a')][_0xab28('0x1b')](_0x38e846)[_0xab28('0x23')](function(_0x86b83b){_0x163f1b[_0xab28('0x1b')]=_0x86b83b;if(_0x46b19b['query'][_0xab28('0x3f')]){_0x1fe502['include']=[{'all':!![]}];}return db['ZendeskField'][_0xab28('0x40')](_0x1fe502);})[_0xab28('0x23')](function(_0x23ada2){_0x163f1b[_0xab28('0x41')]=_0x23ada2;return _0x163f1b;})[_0xab28('0x23')](respondWithFilteredResult(_0x323e0d,_0x1fe502))['catch'](handleError(_0x323e0d,null));};exports['show']=function(_0x433c0e,_0x4b12be){var _0x2a8b57={'raw':!![],'where':{'id':_0x433c0e['params']['id']}},_0x47a122={};_0x47a122[_0xab28('0x2f')]=_[_0xab28('0x42')](db[_0xab28('0x2a')][_0xab28('0x2b')]);_0x47a122[_0xab28('0x30')]=_[_0xab28('0x42')](_0x433c0e['query']);_0x47a122['filters']=_[_0xab28('0x32')](_0x47a122['model'],_0x47a122[_0xab28('0x30')]);_0x2a8b57['attributes']=_[_0xab28('0x32')](_0x47a122['model'],qs['fields'](_0x433c0e[_0xab28('0x30')]['fields']));_0x2a8b57['attributes']=_0x2a8b57['attributes'][_0xab28('0x43')]?_0x2a8b57['attributes']:_0x47a122[_0xab28('0x2f')];if(_0x433c0e[_0xab28('0x30')][_0xab28('0x3f')]){_0x2a8b57[_0xab28('0x44')]=[{'all':!![]}];}_0x2a8b57=_['merge']({},_0x2a8b57,_0x433c0e[_0xab28('0x3e')]);return db[_0xab28('0x2a')][_0xab28('0x45')](_0x2a8b57)[_0xab28('0x23')](handleEntityNotFound(_0x4b12be,null))[_0xab28('0x23')](respondWithResult(_0x4b12be,null))['catch'](handleError(_0x4b12be,null));};exports[_0xab28('0x46')]=function(_0x642d7e,_0x49bb4f){return db[_0xab28('0x2a')]['create'](_0x642d7e['body'],{})[_0xab28('0x23')](respondWithResult(_0x49bb4f,0xc9))[_0xab28('0x47')](handleError(_0x49bb4f,null));};exports['update']=function(_0x39a4ef,_0x52fa3a){if(_0x39a4ef[_0xab28('0x48')]['id']){delete _0x39a4ef[_0xab28('0x48')]['id'];}return db[_0xab28('0x2a')][_0xab28('0x45')]({'where':{'id':_0x39a4ef['params']['id']}})[_0xab28('0x23')](handleEntityNotFound(_0x52fa3a,null))['then'](saveUpdates(_0x39a4ef['body'],null))[_0xab28('0x23')](respondWithResult(_0x52fa3a,null))['catch'](handleError(_0x52fa3a,null));};exports[_0xab28('0x24')]=function(_0x199734,_0x4ada8a){return db[_0xab28('0x2a')][_0xab28('0x45')]({'where':{'id':_0x199734[_0xab28('0x49')]['id']}})[_0xab28('0x23')](handleEntityNotFound(_0x4ada8a,null))['then'](removeEntity(_0x4ada8a,null))[_0xab28('0x47')](handleError(_0x4ada8a,null));}; \ No newline at end of file +var _0x9fdc=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','offset','count','set','Content-Range','json','reject','save','update','then','destroy','end','name','send','index','map','ZendeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','catch','show','params','include','find','create','body','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce'];(function(_0x4a768a,_0x3389bd){var _0xb0082c=function(_0x32e56f){while(--_0x32e56f){_0x4a768a['push'](_0x4a768a['shift']());}};_0xb0082c(++_0x3389bd);}(_0x9fdc,0xce));var _0xc9fd=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0x9fdc[_0x474bc0];return _0x4b24cf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc9fd('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc9fd('0x1'));var rp=require(_0xc9fd('0x2'));var moment=require(_0xc9fd('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc9fd('0x4'));var util=require(_0xc9fd('0x5'));var path=require(_0xc9fd('0x6'));var sox=require('sox');var csv=require(_0xc9fd('0x7'));var ejs=require(_0xc9fd('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc9fd('0x9'));var squel=require(_0xc9fd('0xa'));var crypto=require(_0xc9fd('0xb'));var jsforce=require(_0xc9fd('0xc'));var deskjs=require(_0xc9fd('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc9fd('0xe'));var Papa=require(_0xc9fd('0xf'));var Redis=require(_0xc9fd('0x10'));var authService=require(_0xc9fd('0x11'));var qs=require(_0xc9fd('0x12'));var as=require(_0xc9fd('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc9fd('0x14'));var utils=require(_0xc9fd('0x15'));var config=require(_0xc9fd('0x16'));var licenseUtil=require(_0xc9fd('0x17'));var db=require(_0xc9fd('0x18'))['db'];function respondWithStatusCode(_0x383715,_0xd94916){_0xd94916=_0xd94916||0xcc;return function(_0x5d73ae){if(_0x5d73ae){return _0x383715[_0xc9fd('0x19')](_0xd94916);}return _0x383715[_0xc9fd('0x1a')](_0xd94916)['end']();};}function respondWithResult(_0x2d9f15,_0x463c80){_0x463c80=_0x463c80||0xc8;return function(_0x48b0a3){if(_0x48b0a3){return _0x2d9f15['status'](_0x463c80)['json'](_0x48b0a3);}};}function respondWithFilteredResult(_0x1ed43c,_0x2520c8){return function(_0x216c0e){if(_0x216c0e){var _0x33c8a1=typeof _0x2520c8['offset']===_0xc9fd('0x1b')&&typeof _0x2520c8[_0xc9fd('0x1c')]===_0xc9fd('0x1b');var _0xa33fe5=_0x216c0e['count'];var _0x98bf8a=_0x33c8a1?0x0:_0x2520c8[_0xc9fd('0x1d')];var _0x47d5b3=_0x33c8a1?_0x216c0e[_0xc9fd('0x1e')]:_0x2520c8['offset']+_0x2520c8[_0xc9fd('0x1c')];var _0x5be59d;if(_0x47d5b3>=_0xa33fe5){_0x47d5b3=_0xa33fe5;_0x5be59d=0xc8;}else{_0x5be59d=0xce;}_0x1ed43c[_0xc9fd('0x1a')](_0x5be59d);return _0x1ed43c[_0xc9fd('0x1f')](_0xc9fd('0x20'),_0x98bf8a+'-'+_0x47d5b3+'/'+_0xa33fe5)[_0xc9fd('0x21')](_0x216c0e);}return null;};}function patchUpdates(_0x228490){return function(_0x3c77e4){try{jsonpatch['apply'](_0x3c77e4,_0x228490,!![]);}catch(_0x5595c7){return BPromise[_0xc9fd('0x22')](_0x5595c7);}return _0x3c77e4[_0xc9fd('0x23')]();};}function saveUpdates(_0x3da305,_0x5239be){return function(_0xd83895){if(_0xd83895){return _0xd83895[_0xc9fd('0x24')](_0x3da305)[_0xc9fd('0x25')](function(_0x500bd4){return _0x500bd4;});}return null;};}function removeEntity(_0x14ff1c,_0x37c238){return function(_0x232ccf){if(_0x232ccf){return _0x232ccf[_0xc9fd('0x26')]()[_0xc9fd('0x25')](function(){_0x14ff1c['status'](0xcc)[_0xc9fd('0x27')]();});}};}function handleEntityNotFound(_0x32feaf,_0x140dce){return function(_0x2e71df){if(!_0x2e71df){_0x32feaf[_0xc9fd('0x19')](0x194);}return _0x2e71df;};}function handleError(_0x5d0870,_0x5da3fd){_0x5da3fd=_0x5da3fd||0x1f4;return function(_0x3090f2){logger['error'](_0x3090f2['stack']);if(_0x3090f2[_0xc9fd('0x28')]){delete _0x3090f2['name'];}_0x5d0870[_0xc9fd('0x1a')](_0x5da3fd)[_0xc9fd('0x29')](_0x3090f2);};}exports[_0xc9fd('0x2a')]=function(_0x2fa1bd,_0x2514b5){var _0x1bf499={},_0x3ff7de={},_0x3bb28c={'count':0x0,'rows':[]};var _0x380ea1=_[_0xc9fd('0x2b')](db[_0xc9fd('0x2c')][_0xc9fd('0x2d')],function(_0x4239d5){return{'name':_0x4239d5[_0xc9fd('0x2e')],'type':_0x4239d5[_0xc9fd('0x2f')][_0xc9fd('0x30')]};});_0x3ff7de[_0xc9fd('0x31')]=_[_0xc9fd('0x2b')](_0x380ea1,_0xc9fd('0x28'));_0x3ff7de[_0xc9fd('0x32')]=_[_0xc9fd('0x33')](_0x2fa1bd['query']);_0x3ff7de[_0xc9fd('0x34')]=_[_0xc9fd('0x35')](_0x3ff7de[_0xc9fd('0x31')],_0x3ff7de['query']);_0x1bf499[_0xc9fd('0x36')]=_['intersection'](_0x3ff7de[_0xc9fd('0x31')],qs[_0xc9fd('0x37')](_0x2fa1bd['query'][_0xc9fd('0x37')]));_0x1bf499[_0xc9fd('0x36')]=_0x1bf499[_0xc9fd('0x36')]['length']?_0x1bf499['attributes']:_0x3ff7de[_0xc9fd('0x31')];if(!_0x2fa1bd[_0xc9fd('0x32')][_0xc9fd('0x38')](_0xc9fd('0x39'))){_0x1bf499['limit']=qs[_0xc9fd('0x1c')](_0x2fa1bd[_0xc9fd('0x32')][_0xc9fd('0x1c')]);_0x1bf499[_0xc9fd('0x1d')]=qs[_0xc9fd('0x1d')](_0x2fa1bd['query'][_0xc9fd('0x1d')]);}_0x1bf499['order']=qs[_0xc9fd('0x3a')](_0x2fa1bd[_0xc9fd('0x32')]['sort']);_0x1bf499[_0xc9fd('0x3b')]=qs['filters'](_[_0xc9fd('0x3c')](_0x2fa1bd[_0xc9fd('0x32')],_0x3ff7de['filters']),_0x380ea1);if(_0x2fa1bd[_0xc9fd('0x32')]['filter']){_0x1bf499[_0xc9fd('0x3b')]=_[_0xc9fd('0x3d')](_0x1bf499[_0xc9fd('0x3b')],{'$or':_[_0xc9fd('0x2b')](_0x380ea1,function(_0x5b48c6){if(_0x5b48c6[_0xc9fd('0x2f')]!==_0xc9fd('0x3e')){var _0x35be8d={};_0x35be8d[_0x5b48c6[_0xc9fd('0x28')]]={'$like':'%'+_0x2fa1bd[_0xc9fd('0x32')][_0xc9fd('0x3f')]+'%'};return _0x35be8d;}})});}_0x1bf499=_[_0xc9fd('0x3d')]({},_0x1bf499,_0x2fa1bd[_0xc9fd('0x40')]);var _0xf4ff2a={'where':_0x1bf499[_0xc9fd('0x3b')]};return db[_0xc9fd('0x2c')][_0xc9fd('0x1e')](_0xf4ff2a)[_0xc9fd('0x25')](function(_0x5efaa1){_0x3bb28c[_0xc9fd('0x1e')]=_0x5efaa1;if(_0x2fa1bd[_0xc9fd('0x32')][_0xc9fd('0x41')]){_0x1bf499['include']=[{'all':!![]}];}return db[_0xc9fd('0x2c')]['findAll'](_0x1bf499);})[_0xc9fd('0x25')](function(_0xda212e){_0x3bb28c['rows']=_0xda212e;return _0x3bb28c;})['then'](respondWithFilteredResult(_0x2514b5,_0x1bf499))[_0xc9fd('0x42')](handleError(_0x2514b5,null));};exports[_0xc9fd('0x43')]=function(_0xedaf18,_0x252b4f){var _0x26e627={'raw':!![],'where':{'id':_0xedaf18[_0xc9fd('0x44')]['id']}},_0x31bc5d={};_0x31bc5d[_0xc9fd('0x31')]=_['keys'](db[_0xc9fd('0x2c')][_0xc9fd('0x2d')]);_0x31bc5d[_0xc9fd('0x32')]=_[_0xc9fd('0x33')](_0xedaf18[_0xc9fd('0x32')]);_0x31bc5d[_0xc9fd('0x34')]=_[_0xc9fd('0x35')](_0x31bc5d['model'],_0x31bc5d[_0xc9fd('0x32')]);_0x26e627[_0xc9fd('0x36')]=_['intersection'](_0x31bc5d[_0xc9fd('0x31')],qs[_0xc9fd('0x37')](_0xedaf18[_0xc9fd('0x32')][_0xc9fd('0x37')]));_0x26e627[_0xc9fd('0x36')]=_0x26e627[_0xc9fd('0x36')]['length']?_0x26e627[_0xc9fd('0x36')]:_0x31bc5d[_0xc9fd('0x31')];if(_0xedaf18[_0xc9fd('0x32')]['includeAll']){_0x26e627[_0xc9fd('0x45')]=[{'all':!![]}];}_0x26e627=_[_0xc9fd('0x3d')]({},_0x26e627,_0xedaf18['options']);return db['ZendeskField'][_0xc9fd('0x46')](_0x26e627)[_0xc9fd('0x25')](handleEntityNotFound(_0x252b4f,null))['then'](respondWithResult(_0x252b4f,null))[_0xc9fd('0x42')](handleError(_0x252b4f,null));};exports['create']=function(_0x49ef9d,_0x2ac338){return db[_0xc9fd('0x2c')][_0xc9fd('0x47')](_0x49ef9d['body'],{})[_0xc9fd('0x25')](respondWithResult(_0x2ac338,0xc9))['catch'](handleError(_0x2ac338,null));};exports[_0xc9fd('0x24')]=function(_0x46be85,_0x365021){if(_0x46be85[_0xc9fd('0x48')]['id']){delete _0x46be85[_0xc9fd('0x48')]['id'];}return db[_0xc9fd('0x2c')]['find']({'where':{'id':_0x46be85[_0xc9fd('0x44')]['id']}})['then'](handleEntityNotFound(_0x365021,null))[_0xc9fd('0x25')](saveUpdates(_0x46be85['body'],null))[_0xc9fd('0x25')](respondWithResult(_0x365021,null))[_0xc9fd('0x42')](handleError(_0x365021,null));};exports[_0xc9fd('0x26')]=function(_0x314545,_0x687cda){return db[_0xc9fd('0x2c')][_0xc9fd('0x46')]({'where':{'id':_0x314545[_0xc9fd('0x44')]['id']}})['then'](handleEntityNotFound(_0x687cda,null))[_0xc9fd('0x25')](removeEntity(_0x687cda,null))[_0xc9fd('0x42')](handleError(_0x687cda,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 0b47cad..cdef467 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 _0x6a2a=['api','moment','request-promise','../../config/environment','./intZendeskField.attributes','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','util','../../config/logger'];(function(_0x5acedf,_0x15c353){var _0x31c773=function(_0x1ca87a){while(--_0x1ca87a){_0x5acedf['push'](_0x5acedf['shift']());}};_0x31c773(++_0x15c353);}(_0x6a2a,0xe7));var _0xa6a2=function(_0x20a74e,_0x26c09d){_0x20a74e=_0x20a74e-0x0;var _0x513e0f=_0x6a2a[_0x20a74e];return _0x513e0f;};'use strict';var _=require(_0xa6a2('0x0'));var util=require(_0xa6a2('0x1'));var logger=require(_0xa6a2('0x2'))(_0xa6a2('0x3'));var moment=require(_0xa6a2('0x4'));var BPromise=require('bluebird');var rp=require(_0xa6a2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa6a2('0x6'));var attributes=require(_0xa6a2('0x7'));module['exports']=function(_0x7087b0,_0x51a916){return _0x7087b0['define'](_0xa6a2('0x8'),attributes,{'tableName':_0xa6a2('0x9'),'paranoid':![],'indexes':[{'name':_0xa6a2('0xa'),'fields':[_0xa6a2('0xb'),_0xa6a2('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x13ee=['api','moment','bluebird','request-promise','path','./intZendeskField.attributes','exports','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','../../config/logger'];(function(_0x2bda14,_0x4fab1b){var _0xb5dd49=function(_0x1da71e){while(--_0x1da71e){_0x2bda14['push'](_0x2bda14['shift']());}};_0xb5dd49(++_0x4fab1b);}(_0x13ee,0x167));var _0xe13e=function(_0x2d364e,_0x301c5e){_0x2d364e=_0x2d364e-0x0;var _0x1b9312=_0x13ee[_0x2d364e];return _0x1b9312;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe13e('0x0'))(_0xe13e('0x1'));var moment=require(_0xe13e('0x2'));var BPromise=require(_0xe13e('0x3'));var rp=require(_0xe13e('0x4'));var fs=require('fs');var path=require(_0xe13e('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe13e('0x6'));module[_0xe13e('0x7')]=function(_0x4d019e,_0x59f374){return _0x4d019e['define'](_0xe13e('0x8'),attributes,{'tableName':_0xe13e('0x9'),'paranoid':![],'indexes':[{'name':_0xe13e('0xa'),'fields':[_0xe13e('0xb'),'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 5d19bd3..f6a161d 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 _0xcca1=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','error','code','message','ZendeskField,\x20%s,\x20%s','result','lodash','util','moment','bluebird'];(function(_0x3163ce,_0x40a33a){var _0x48556f=function(_0x3d38cd){while(--_0x3d38cd){_0x3163ce['push'](_0x3163ce['shift']());}};_0x48556f(++_0x40a33a);}(_0xcca1,0x104));var _0x1cca=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcca1[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x1cca('0x0'));var util=require(_0x1cca('0x1'));var moment=require(_0x1cca('0x2'));var BPromise=require(_0x1cca('0x3'));var rs=require(_0x1cca('0x4'));var fs=require('fs');var Redis=require(_0x1cca('0x5'));var db=require(_0x1cca('0x6'))['db'];var utils=require(_0x1cca('0x7'));var logger=require(_0x1cca('0x8'))(_0x1cca('0x9'));var config=require(_0x1cca('0xa'));var jayson=require(_0x1cca('0xb'));var client=jayson['client'][_0x1cca('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xe66af4,_0x438bed,_0x3d9fe8){return new BPromise(function(_0x52b942,_0x568683){return client[_0x1cca('0xd')](_0xe66af4,_0x3d9fe8)['then'](function(_0x268d89){logger[_0x1cca('0xe')]('ZendeskField,\x20%s,\x20%s',_0x438bed,_0x1cca('0xf'));logger[_0x1cca('0x10')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x438bed,_0x1cca('0xf'),JSON['stringify'](_0x268d89));if(_0x268d89[_0x1cca('0x11')]){if(_0x268d89[_0x1cca('0x11')][_0x1cca('0x12')]===0x1f4){logger['error']('ZendeskField,\x20%s,\x20%s',_0x438bed,_0x268d89['error'][_0x1cca('0x13')]);return _0x568683(_0x268d89[_0x1cca('0x11')]['message']);}logger[_0x1cca('0x11')]('ZendeskField,\x20%s,\x20%s',_0x438bed,_0x268d89['error'][_0x1cca('0x13')]);return _0x52b942(_0x268d89[_0x1cca('0x11')][_0x1cca('0x13')]);}else{logger[_0x1cca('0xe')](_0x1cca('0x14'),_0x438bed,_0x1cca('0xf'));_0x52b942(_0x268d89[_0x1cca('0x15')][_0x1cca('0x13')]);}})['catch'](function(_0x12373f){logger[_0x1cca('0x11')](_0x1cca('0x14'),_0x438bed,_0x12373f);_0x568683(_0x12373f);});});} \ No newline at end of file +var _0x9880=['rpc','../../config/environment','client','http','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1597bc,_0x42faa5){var _0x6299f1=function(_0x5c546c){while(--_0x5c546c){_0x1597bc['push'](_0x1597bc['shift']());}};_0x6299f1(++_0x42faa5);}(_0x9880,0x178));var _0x0988=function(_0x13ac10,_0x46e79e){_0x13ac10=_0x13ac10-0x0;var _0x28eda2=_0x9880[_0x13ac10];return _0x28eda2;};'use strict';var _=require(_0x0988('0x0'));var util=require('util');var moment=require(_0x0988('0x1'));var BPromise=require(_0x0988('0x2'));var rs=require(_0x0988('0x3'));var fs=require('fs');var Redis=require(_0x0988('0x4'));var db=require(_0x0988('0x5'))['db'];var utils=require(_0x0988('0x6'));var logger=require(_0x0988('0x7'))(_0x0988('0x8'));var config=require(_0x0988('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0988('0xa')][_0x0988('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xa9771d,_0x28d3de,_0x1207a2){return new BPromise(function(_0x36159e,_0x5461ce){return client['request'](_0xa9771d,_0x1207a2)[_0x0988('0xc')](function(_0xab4fe1){logger[_0x0988('0xd')](_0x0988('0xe'),_0x28d3de,_0x0988('0xf'));logger[_0x0988('0x10')](_0x0988('0x11'),_0x28d3de,'request\x20sent',JSON[_0x0988('0x12')](_0xab4fe1));if(_0xab4fe1[_0x0988('0x13')]){if(_0xab4fe1['error'][_0x0988('0x14')]===0x1f4){logger[_0x0988('0x13')](_0x0988('0xe'),_0x28d3de,_0xab4fe1[_0x0988('0x13')][_0x0988('0x15')]);return _0x5461ce(_0xab4fe1['error'][_0x0988('0x15')]);}logger[_0x0988('0x13')](_0x0988('0xe'),_0x28d3de,_0xab4fe1[_0x0988('0x13')][_0x0988('0x15')]);return _0x36159e(_0xab4fe1['error'][_0x0988('0x15')]);}else{logger[_0x0988('0xd')](_0x0988('0xe'),_0x28d3de,_0x0988('0xf'));_0x36159e(_0xab4fe1[_0x0988('0x16')][_0x0988('0x15')]);}})[_0x0988('0x17')](function(_0x263793){logger[_0x0988('0x13')]('ZendeskField,\x20%s,\x20%s',_0x28d3de,_0x263793);_0x5461ce(_0x263793);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index aebc627..476467b 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 _0xf072=['put','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intZohoAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','getFields','post','create'];(function(_0x5ea451,_0x133637){var _0x37a06a=function(_0x6fb5bf){while(--_0x6fb5bf){_0x5ea451['push'](_0x5ea451['shift']());}};_0x37a06a(++_0x133637);}(_0xf072,0x87));var _0x2f07=function(_0x38c40f,_0x91d4b6){_0x38c40f=_0x38c40f-0x0;var _0x5d59b1=_0xf072[_0x38c40f];return _0x5d59b1;};'use strict';var multer=require(_0x2f07('0x0'));var util=require(_0x2f07('0x1'));var path=require(_0x2f07('0x2'));var timeout=require(_0x2f07('0x3'));var express=require(_0x2f07('0x4'));var router=express['Router']();var fs_extra=require(_0x2f07('0x5'));var auth=require(_0x2f07('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2f07('0x7'));var controller=require(_0x2f07('0x8'));router[_0x2f07('0x9')]('/',auth['isAuthenticated'](),controller[_0x2f07('0xa')]);router['get'](_0x2f07('0xb'),auth[_0x2f07('0xc')](),controller[_0x2f07('0xd')]);router['get'](_0x2f07('0xe'),auth[_0x2f07('0xc')](),controller[_0x2f07('0xf')]);router[_0x2f07('0x9')]('/:id/fields',auth[_0x2f07('0xc')](),controller[_0x2f07('0x10')]);router[_0x2f07('0x11')]('/',auth[_0x2f07('0xc')](),controller[_0x2f07('0x12')]);router[_0x2f07('0x11')](_0x2f07('0xe'),auth[_0x2f07('0xc')](),controller['addConfiguration']);router[_0x2f07('0x13')]('/:id',auth[_0x2f07('0xc')](),controller['update']);router[_0x2f07('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x2f07('0x15')]);module['exports']=router; \ No newline at end of file +var _0x3851=['express','../../components/auth/service','./intZohoAccount.controller','get','isAuthenticated','show','/:id/configurations','getConfigurations','getFields','post','addConfiguration','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x20235b,_0x45a1ab){var _0x52b38c=function(_0x20557d){while(--_0x20557d){_0x20235b['push'](_0x20235b['shift']());}};_0x52b38c(++_0x45a1ab);}(_0x3851,0x1b5));var _0x1385=function(_0x575cfe,_0x413cac){_0x575cfe=_0x575cfe-0x0;var _0x123bb0=_0x3851[_0x575cfe];return _0x123bb0;};'use strict';var multer=require(_0x1385('0x0'));var util=require('util');var path=require(_0x1385('0x1'));var timeout=require(_0x1385('0x2'));var express=require(_0x1385('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1385('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1385('0x5'));router[_0x1385('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1385('0x6')]('/:id',auth[_0x1385('0x7')](),controller[_0x1385('0x8')]);router[_0x1385('0x6')](_0x1385('0x9'),auth[_0x1385('0x7')](),controller[_0x1385('0xa')]);router[_0x1385('0x6')]('/:id/fields',auth[_0x1385('0x7')](),controller[_0x1385('0xb')]);router[_0x1385('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1385('0xc')](_0x1385('0x9'),auth[_0x1385('0x7')](),controller[_0x1385('0xd')]);router[_0x1385('0xe')](_0x1385('0xf'),auth[_0x1385('0x7')](),controller[_0x1385('0x10')]);router[_0x1385('0x11')](_0x1385('0xf'),auth[_0x1385('0x7')](),controller[_0x1385('0x12')]);module[_0x1385('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index df3f845..1ac2fe0 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 _0xaa88=['exports','STRING','sequelize'];(function(_0x11c6fa,_0x3deba6){var _0x4813aa=function(_0x14e3bb){while(--_0x14e3bb){_0x11c6fa['push'](_0x11c6fa['shift']());}};_0x4813aa(++_0x3deba6);}(_0xaa88,0x137));var _0x8aa8=function(_0x5e6cb8,_0x16cf56){_0x5e6cb8=_0x5e6cb8-0x0;var _0x3faeb3=_0xaa88[_0x5e6cb8];return _0x3faeb3;};'use strict';var Sequelize=require(_0x8aa8('0x0'));module[_0x8aa8('0x1')]={'name':{'type':Sequelize[_0x8aa8('0x2')]},'description':{'type':Sequelize[_0x8aa8('0x2')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x8aa8('0x2')]},'clientId':{'type':Sequelize[_0x8aa8('0x2')]},'clientSecret':{'type':Sequelize[_0x8aa8('0x2')]},'serverUrl':{'type':Sequelize[_0x8aa8('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x8aa8('0x2')]},'refreshToken':{'type':Sequelize[_0x8aa8('0x2')]}}; \ No newline at end of file +var _0xbec5=['STRING','sequelize','exports'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xbec5,0xe5));var _0x5bec=function(_0x5f08a6,_0x400121){_0x5f08a6=_0x5f08a6-0x0;var _0x5d0641=_0xbec5[_0x5f08a6];return _0x5d0641;};'use strict';var Sequelize=require(_0x5bec('0x0'));module[_0x5bec('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5bec('0x2')]},'host':{'type':Sequelize[_0x5bec('0x2')]},'zone':{'type':Sequelize[_0x5bec('0x2')]},'clientId':{'type':Sequelize[_0x5bec('0x2')]},'clientSecret':{'type':Sequelize[_0x5bec('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'code':{'type':Sequelize[_0x5bec('0x2')]},'refreshToken':{'type':Sequelize[_0x5bec('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 6a2039c..1f5e823 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 _0x1912=['test','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','sendStatus','error','stack','name','map','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','ZohoAccount','include','findAll','rows','params','includeAll','find','catch','create','body','findOne','ZohoConfiguration','getConfigurations','addConfiguration','Subjects','getSubjects','channel','ZohoField','Descriptions','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientId','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','zone','clientSecret','serverUrl','code','zoho.eu','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','Calls','Zoho-oauthtoken\x20','response','Owner','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'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x1912,0x192));var _0x2191=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x1912[_0x160c73];return _0xd9302;};'use strict';var emlformat=require(_0x2191('0x0'));var rimraf=require(_0x2191('0x1'));var zipdir=require(_0x2191('0x2'));var jsonpatch=require(_0x2191('0x3'));var rp=require('request-promise');var moment=require(_0x2191('0x4'));var BPromise=require(_0x2191('0x5'));var Mustache=require(_0x2191('0x6'));var util=require(_0x2191('0x7'));var path=require('path');var sox=require(_0x2191('0x8'));var csv=require(_0x2191('0x9'));var ejs=require(_0x2191('0xa'));var fs=require('fs');var fs_extra=require(_0x2191('0xb'));var _=require('lodash');var squel=require(_0x2191('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2191('0xd'));var toCsv=require(_0x2191('0x9'));var querystring=require(_0x2191('0xe'));var Papa=require(_0x2191('0xf'));var Redis=require(_0x2191('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x2191('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2191('0x12'))('api');var utils=require(_0x2191('0x13'));var config=require(_0x2191('0x14'));var licenseUtil=require(_0x2191('0x15'));var db=require(_0x2191('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1de7f5,_0x2f6d56){_0x2f6d56=_0x2f6d56||0xcc;return function(_0x26a4c2){if(_0x26a4c2){return _0x1de7f5['sendStatus'](_0x2f6d56);}return _0x1de7f5[_0x2191('0x17')](_0x2f6d56)[_0x2191('0x18')]();};}function respondWithResult(_0x2ce8c7,_0x2ce277){_0x2ce277=_0x2ce277||0xc8;return function(_0x26c026){if(_0x26c026){return _0x2ce8c7['status'](_0x2ce277)[_0x2191('0x19')](_0x26c026);}};}function respondWithFilteredResult(_0x525633,_0x24651a){return function(_0x2c7e38){if(_0x2c7e38){var _0x4a8c3e=typeof _0x24651a[_0x2191('0x1a')]===_0x2191('0x1b')&&typeof _0x24651a[_0x2191('0x1c')]===_0x2191('0x1b');var _0x5687e1=_0x2c7e38['count'];var _0x4090e0=_0x4a8c3e?0x0:_0x24651a[_0x2191('0x1a')];var _0x360ed2=_0x4a8c3e?_0x2c7e38[_0x2191('0x1d')]:_0x24651a[_0x2191('0x1a')]+_0x24651a[_0x2191('0x1c')];var _0xd9d20f;if(_0x360ed2>=_0x5687e1){_0x360ed2=_0x5687e1;_0xd9d20f=0xc8;}else{_0xd9d20f=0xce;}_0x525633[_0x2191('0x17')](_0xd9d20f);return _0x525633[_0x2191('0x1e')](_0x2191('0x1f'),_0x4090e0+'-'+_0x360ed2+'/'+_0x5687e1)[_0x2191('0x19')](_0x2c7e38);}return null;};}function patchUpdates(_0x4d99ac){return function(_0x2dccdf){try{jsonpatch[_0x2191('0x20')](_0x2dccdf,_0x4d99ac,!![]);}catch(_0xff8182){return BPromise['reject'](_0xff8182);}return _0x2dccdf[_0x2191('0x21')]();};}function saveUpdates(_0x1290cc,_0x18f25f){return function(_0x38f320){if(_0x38f320){return _0x38f320[_0x2191('0x22')](_0x1290cc)['then'](function(_0x2f4de7){return _0x2f4de7;});}return null;};}function removeEntity(_0x4adf24,_0x339905){return function(_0x386924){if(_0x386924){return _0x386924[_0x2191('0x23')]()[_0x2191('0x24')](function(){_0x4adf24[_0x2191('0x17')](0xcc)[_0x2191('0x18')]();});}};}function handleEntityNotFound(_0x281c8d,_0x3db060){return function(_0x2394cc){if(!_0x2394cc){_0x281c8d[_0x2191('0x25')](0x194);}return _0x2394cc;};}function handleError(_0x81991e,_0x28b106){_0x28b106=_0x28b106||0x1f4;return function(_0x532ceb){logger[_0x2191('0x26')](_0x532ceb[_0x2191('0x27')]);if(_0x532ceb[_0x2191('0x28')]){delete _0x532ceb['name'];}_0x81991e[_0x2191('0x17')](_0x28b106)['send'](_0x532ceb);};}exports['index']=function(_0x32a823,_0x2df938){var _0x27571d={},_0x10affc={},_0x3f3b55={'count':0x0,'rows':[]};var _0xf16a73=_[_0x2191('0x29')](db['ZohoAccount'][_0x2191('0x2a')],function(_0x5b0dac){return{'name':_0x5b0dac[_0x2191('0x2b')],'type':_0x5b0dac[_0x2191('0x2c')][_0x2191('0x2d')]};});_0x10affc['model']=_[_0x2191('0x29')](_0xf16a73,'name');_0x10affc['query']=_[_0x2191('0x2e')](_0x32a823[_0x2191('0x2f')]);_0x10affc[_0x2191('0x30')]=_[_0x2191('0x31')](_0x10affc[_0x2191('0x32')],_0x10affc[_0x2191('0x2f')]);_0x27571d[_0x2191('0x33')]=_[_0x2191('0x31')](_0x10affc[_0x2191('0x32')],qs[_0x2191('0x34')](_0x32a823[_0x2191('0x2f')][_0x2191('0x34')]));_0x27571d[_0x2191('0x33')]=_0x27571d['attributes'][_0x2191('0x35')]?_0x27571d[_0x2191('0x33')]:_0x10affc['model'];if(!_0x32a823[_0x2191('0x2f')][_0x2191('0x36')](_0x2191('0x37'))){_0x27571d['limit']=qs['limit'](_0x32a823[_0x2191('0x2f')]['limit']);_0x27571d[_0x2191('0x1a')]=qs[_0x2191('0x1a')](_0x32a823['query']['offset']);}_0x27571d[_0x2191('0x38')]=qs[_0x2191('0x39')](_0x32a823[_0x2191('0x2f')][_0x2191('0x39')]);_0x27571d[_0x2191('0x3a')]=qs[_0x2191('0x30')](_[_0x2191('0x3b')](_0x32a823[_0x2191('0x2f')],_0x10affc[_0x2191('0x30')]),_0xf16a73);if(_0x32a823[_0x2191('0x2f')]['filter']){_0x27571d['where']=_['merge'](_0x27571d[_0x2191('0x3a')],{'$or':_[_0x2191('0x29')](_0xf16a73,function(_0x541f8d){if(_0x541f8d['type']!==_0x2191('0x3c')){var _0x257f49={};_0x257f49[_0x541f8d[_0x2191('0x28')]]={'$like':'%'+_0x32a823[_0x2191('0x2f')][_0x2191('0x3d')]+'%'};return _0x257f49;}})});}_0x27571d=_[_0x2191('0x3e')]({},_0x27571d,_0x32a823[_0x2191('0x3f')]);var _0x229cd1={'where':_0x27571d[_0x2191('0x3a')]};return db[_0x2191('0x40')][_0x2191('0x1d')](_0x229cd1)[_0x2191('0x24')](function(_0x109508){_0x3f3b55['count']=_0x109508;if(_0x32a823[_0x2191('0x2f')]['includeAll']){_0x27571d[_0x2191('0x41')]=[{'all':!![]}];}return db[_0x2191('0x40')][_0x2191('0x42')](_0x27571d);})['then'](function(_0x22b952){_0x3f3b55[_0x2191('0x43')]=_0x22b952;return _0x3f3b55;})[_0x2191('0x24')](respondWithFilteredResult(_0x2df938,_0x27571d))['catch'](handleError(_0x2df938,null));};exports['show']=function(_0x2dfb52,_0xe50691){var _0x54b05d={'raw':![],'where':{'id':_0x2dfb52[_0x2191('0x44')]['id']}},_0x47584d={};_0x47584d['model']=_[_0x2191('0x2e')](db[_0x2191('0x40')][_0x2191('0x2a')]);_0x47584d[_0x2191('0x2f')]=_[_0x2191('0x2e')](_0x2dfb52[_0x2191('0x2f')]);_0x47584d['filters']=_[_0x2191('0x31')](_0x47584d[_0x2191('0x32')],_0x47584d[_0x2191('0x2f')]);_0x54b05d[_0x2191('0x33')]=_[_0x2191('0x31')](_0x47584d[_0x2191('0x32')],qs[_0x2191('0x34')](_0x2dfb52[_0x2191('0x2f')][_0x2191('0x34')]));_0x54b05d['attributes']=_0x54b05d[_0x2191('0x33')][_0x2191('0x35')]?_0x54b05d['attributes']:_0x47584d['model'];if(_0x2dfb52[_0x2191('0x2f')][_0x2191('0x45')]){_0x54b05d[_0x2191('0x41')]=[{'all':!![]}];}_0x54b05d=_[_0x2191('0x3e')]({},_0x54b05d,_0x2dfb52[_0x2191('0x3f')]);return db['ZohoAccount'][_0x2191('0x46')](_0x54b05d)[_0x2191('0x24')](handleEntityNotFound(_0xe50691,null))[_0x2191('0x24')](respondWithResult(_0xe50691,null))[_0x2191('0x47')](handleError(_0xe50691,null));};exports[_0x2191('0x48')]=function(_0x123c0f,_0x3d06b7){return db[_0x2191('0x40')][_0x2191('0x48')](_0x123c0f['body'],{})['then'](respondWithResult(_0x3d06b7,0xc9))['catch'](handleError(_0x3d06b7,null));};exports[_0x2191('0x22')]=function(_0x3a07d4,_0x252b03){if(_0x3a07d4[_0x2191('0x49')]['id']){delete _0x3a07d4[_0x2191('0x49')]['id'];}return db['ZohoAccount'][_0x2191('0x46')]({'where':{'id':_0x3a07d4[_0x2191('0x44')]['id']}})[_0x2191('0x24')](handleEntityNotFound(_0x252b03,null))[_0x2191('0x24')](saveUpdates(_0x3a07d4[_0x2191('0x49')],null))[_0x2191('0x24')](respondWithResult(_0x252b03,null))[_0x2191('0x47')](handleError(_0x252b03,null));};exports[_0x2191('0x23')]=function(_0x129081,_0x498b30){return db[_0x2191('0x40')]['find']({'where':{'id':_0x129081[_0x2191('0x44')]['id']}})[_0x2191('0x24')](handleEntityNotFound(_0x498b30,null))[_0x2191('0x24')](removeEntity(_0x498b30,null))[_0x2191('0x47')](handleError(_0x498b30,null));};exports['getConfigurations']=function(_0x37439d,_0x21d19a,_0x4da158){var _0xb6158c={};var _0x4b84ac={};var _0x4c4b0f;var _0xe66995;return db[_0x2191('0x40')][_0x2191('0x4a')]({'where':{'id':_0x37439d['params']['id']}})[_0x2191('0x24')](handleEntityNotFound(_0x21d19a,null))['then'](function(_0x2e14fb){if(_0x2e14fb){_0x4c4b0f=_0x2e14fb;_0x4b84ac[_0x2191('0x32')]=_[_0x2191('0x2e')](db[_0x2191('0x4b')]['rawAttributes']);_0x4b84ac[_0x2191('0x2f')]=_['keys'](_0x37439d[_0x2191('0x2f')]);_0x4b84ac[_0x2191('0x30')]=_['intersection'](_0x4b84ac['model'],_0x4b84ac['query']);_0xb6158c[_0x2191('0x33')]=_[_0x2191('0x31')](_0x4b84ac[_0x2191('0x32')],qs[_0x2191('0x34')](_0x37439d[_0x2191('0x2f')][_0x2191('0x34')]));_0xb6158c['attributes']=_0xb6158c[_0x2191('0x33')][_0x2191('0x35')]?_0xb6158c['attributes']:_0x4b84ac[_0x2191('0x32')];_0xb6158c[_0x2191('0x38')]=qs['sort'](_0x37439d[_0x2191('0x2f')]['sort']);_0xb6158c[_0x2191('0x3a')]=qs[_0x2191('0x30')](_[_0x2191('0x3b')](_0x37439d[_0x2191('0x2f')],_0x4b84ac[_0x2191('0x30')]));if(_0x37439d[_0x2191('0x2f')][_0x2191('0x3d')]){_0xb6158c[_0x2191('0x3a')]=_[_0x2191('0x3e')](_0xb6158c[_0x2191('0x3a')],{'$or':_[_0x2191('0x29')](_0xb6158c[_0x2191('0x33')],function(_0x5162d0){var _0x270b16={};_0x270b16[_0x5162d0]={'$like':'%'+_0x37439d[_0x2191('0x2f')][_0x2191('0x3d')]+'%'};return _0x270b16;})});}_0xb6158c=_[_0x2191('0x3e')]({},_0xb6158c,_0x37439d[_0x2191('0x3f')]);return _0x4c4b0f[_0x2191('0x4c')](_0xb6158c);}})['then'](function(_0x6ecc5e){if(_0x6ecc5e){_0xe66995=_0x6ecc5e[_0x2191('0x35')];if(!_0x37439d[_0x2191('0x2f')]['hasOwnProperty'](_0x2191('0x37'))){_0xb6158c['limit']=qs[_0x2191('0x1c')](_0x37439d['query'][_0x2191('0x1c')]);_0xb6158c[_0x2191('0x1a')]=qs[_0x2191('0x1a')](_0x37439d[_0x2191('0x2f')][_0x2191('0x1a')]);}return _0x4c4b0f['getConfigurations'](_0xb6158c);}})[_0x2191('0x24')](function(_0x5f299a){if(_0x5f299a){return _0x5f299a?{'count':_0xe66995,'rows':_0x5f299a}:null;}})[_0x2191('0x24')](respondWithResult(_0x21d19a,null))[_0x2191('0x47')](handleError(_0x21d19a,null));};exports[_0x2191('0x4d')]=function(_0x5afd5e,_0x1df7d4,_0x4fd19f){if(_0x5afd5e[_0x2191('0x49')]['id']){delete _0x5afd5e[_0x2191('0x49')]['id'];}return db[_0x2191('0x40')]['findOne']({'where':{'id':_0x5afd5e[_0x2191('0x44')]['id']}})[_0x2191('0x24')](handleEntityNotFound(_0x1df7d4,null))['then'](function(_0x50ba78){if(_0x50ba78){_0x5afd5e[_0x2191('0x49')]['AccountId']=_0x50ba78['id'];_0x5afd5e['body'][_0x2191('0x4e')]=integrations[_0x2191('0x4f')](_0x5afd5e[_0x2191('0x49')]['channel'],_0x5afd5e['body'][_0x2191('0x2c')]);_0x5afd5e[_0x2191('0x49')]['Descriptions']=integrations['getDescriptions'](_0x5afd5e[_0x2191('0x49')][_0x2191('0x50')],_0x5afd5e[_0x2191('0x49')][_0x2191('0x2c')]);return db['ZohoConfiguration'][_0x2191('0x48')](_0x5afd5e[_0x2191('0x49')],{'include':[{'model':db[_0x2191('0x51')],'as':_0x2191('0x4e')},{'model':db['ZohoField'],'as':_0x2191('0x52')}]});}return null;})[_0x2191('0x24')](respondWithResult(_0x1df7d4,null))[_0x2191('0x47')](handleError(_0x1df7d4,null));};function getAccessToken(_0x565449){return new Promise(function(_0x3d3138,_0x88eef6){var _0x471038;switch(_0x565449['zone']){case'US':_0x471038='https://accounts.zoho.com';break;case'AU':_0x471038=_0x2191('0x53');break;case'EU':_0x471038=_0x2191('0x54');break;case'IN':_0x471038=_0x2191('0x55');break;case'CN':_0x471038=_0x2191('0x56');break;default:_0x471038='https://accounts.zoho.eu';break;}var _0x2c7fa8={'method':'POST','uri':_0x471038+_0x2191('0x57'),'qs':{'refresh_token':_0x565449[_0x2191('0x58')],'client_id':_0x565449[_0x2191('0x59')],'client_secret':_0x565449['clientSecret'],'grant_type':_0x2191('0x5a')},'json':!![]};return rp(_0x2c7fa8)[_0x2191('0x24')](function(_0x378399){if(_0x378399['access_token']){_0x3d3138(_0x378399[_0x2191('0x5b')]);}else{_0x88eef6(_0x2191('0x5c'));}})['catch'](function(_0x4cfa53){_0x88eef6(_0x4cfa53);});});}exports[_0x2191('0x5d')]=function(_0x24ad4b,_0x559a2f,_0x146fb9){var _0x25f467,_0x2f8777,_0x4aeb1c,_0x3fa78b,_0x226211;return db[_0x2191('0x40')][_0x2191('0x4a')]({'where':{'id':_0x24ad4b[_0x2191('0x44')]['id']},'attributes':['id',_0x2191('0x5e'),_0x2191('0x5f'),_0x2191('0x59'),_0x2191('0x60'),_0x2191('0x61'),_0x2191('0x62'),'refreshToken']})['then'](handleEntityNotFound(_0x559a2f,null))['then'](function(_0xfebae6){_0x226211=_0xfebae6;_0x25f467=_0x226211[_0x2191('0x5e')];_0x2f8777=_0x25f467===_0x2191('0x63')?'eu':'com';_0x4aeb1c=_0x226211['serverUrl'];var _0x5ea8f1=_0x4aeb1c[_0x2191('0x64')](-0x1);if(_0x5ea8f1==='/'||_0x5ea8f1==='\x5c'||_0x5ea8f1===':'){_0x4aeb1c=_0x4aeb1c[_0x2191('0x65')](0x0,_0x4aeb1c[_0x2191('0x66')](_0x5ea8f1));}if(!_0x226211[_0x2191('0x58')]){throw new Error(_0x2191('0x67'));}return getAccessToken(_0x226211);})[_0x2191('0x24')](function(_0x412fd5){if(_0x412fd5){return rp({'method':'GET','uri':util[_0x2191('0x68')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x2f8777),'qs':{'module':_0x2191('0x69')},'headers':{'Authorization':_0x2191('0x6a')+_0x412fd5},'json':!![]});}})[_0x2191('0x24')](function(_0x11f022){if(_0x11f022){if(_0x11f022[_0x2191('0x6b')]&&_0x11f022['response']['error']){throw new Error(_0x11f022[_0x2191('0x6b')][_0x2191('0x26')]['message']);}var _0x119d6f=[];var _0x44a2ed=[];var _0x3b1d55=[_0x2191('0x6c'),_0x2191('0x6d'),_0x2191('0x6e'),_0x2191('0x6f'),_0x2191('0x70'),_0x2191('0x71'),_0x2191('0x72'),_0x2191('0x73')];_0x44a2ed=_[_0x2191('0x74')](_0x11f022[_0x2191('0x34')],function(_0x136e4d){return _0x3b1d55[_0x2191('0x75')](_0x136e4d[_0x2191('0x76')]);});for(var _0x59d9a4=0x0;_0x59d9a4<_0x44a2ed[_0x2191('0x35')];_0x59d9a4++){if(_0x44a2ed[_0x59d9a4][_0x2191('0x77')]===![]){_0x119d6f[_0x2191('0x78')]({'id':_0x44a2ed[_0x59d9a4]['id'],'name':_0x44a2ed[_0x59d9a4][_0x2191('0x79')],'custom':_0x44a2ed[_0x59d9a4][_0x2191('0x7a')],'options':_0x44a2ed[_0x59d9a4][_0x2191('0x7b')]===_0x2191('0x7c')&&_0x44a2ed[_0x59d9a4][_0x2191('0x7d')][_0x2191('0x35')]>-0x1?_[_0x2191('0x29')](_0x44a2ed[_0x59d9a4][_0x2191('0x7d')],function(_0x22b549){return{'name':_0x22b549,'value':_0x22b549};}):[]});}}return{'count':_0x119d6f['length'],'rows':_0x119d6f};}else{return{'count':0x0,'rows':[]};}})[_0x2191('0x24')](respondWithResult(_0x559a2f,null))[_0x2191('0x47')](function(_0x51427d){var _0x4521f7=_0x24ad4b['query'][_0x2191('0x7e')]?0x1f4:_0x51427d['statusCode']||0x1f4;logger['error'](_0x2191('0x7f'),'getFields',_0x4521f7,JSON[_0x2191('0x80')](_0x51427d));delete _0x51427d[_0x2191('0x28')];if(_0x4521f7===0x191){_0x4521f7=0x190;}_0x559a2f['status'](_0x4521f7)[_0x2191('0x81')](_0x24ad4b[_0x2191('0x2f')][_0x2191('0x7e')]?{'message':_0x2191('0x82'),'statusCode':_0x51427d[_0x2191('0x83')]}:_0x51427d);});}; \ No newline at end of file +var _0xa495=['stack','name','send','index','map','ZohoAccount','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','keys','rawAttributes','find','catch','create','body','params','destroy','getConfigurations','findOne','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoConfiguration','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','/oauth/v2/token','refreshToken','clientId','clientSecret','access_token','getFields','serverUrl','code','zoho.eu','slice','substring','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','Calls','Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','WhoId','Call_Result','Call_Start_Time','Call_Type','remove','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','test','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','request-promise','moment','util','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','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','count','limit','Content-Range','reject','save','update','then','sendStatus'];(function(_0x526d64,_0x47a3cc){var _0x218bcd=function(_0x479fcc){while(--_0x479fcc){_0x526d64['push'](_0x526d64['shift']());}};_0x218bcd(++_0x47a3cc);}(_0xa495,0x1e7));var _0x5a49=function(_0x2cb1bd,_0x42b64c){_0x2cb1bd=_0x2cb1bd-0x0;var _0x393fdf=_0xa495[_0x2cb1bd];return _0x393fdf;};'use strict';var emlformat=require(_0x5a49('0x0'));var rimraf=require(_0x5a49('0x1'));var zipdir=require(_0x5a49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5a49('0x3'));var moment=require(_0x5a49('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5a49('0x5'));var path=require(_0x5a49('0x6'));var sox=require(_0x5a49('0x7'));var csv=require(_0x5a49('0x8'));var ejs=require(_0x5a49('0x9'));var fs=require('fs');var fs_extra=require(_0x5a49('0xa'));var _=require(_0x5a49('0xb'));var squel=require(_0x5a49('0xc'));var crypto=require(_0x5a49('0xd'));var jsforce=require(_0x5a49('0xe'));var deskjs=require(_0x5a49('0xf'));var toCsv=require(_0x5a49('0x8'));var querystring=require(_0x5a49('0x10'));var Papa=require(_0x5a49('0x11'));var Redis=require(_0x5a49('0x12'));var authService=require(_0x5a49('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x5a49('0x14'));var hardwareService=require(_0x5a49('0x15'));var logger=require(_0x5a49('0x16'))(_0x5a49('0x17'));var utils=require(_0x5a49('0x18'));var config=require(_0x5a49('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x5a49('0x1a'))['db'];var integrations=require(_0x5a49('0x1b'));function respondWithStatusCode(_0x475aa9,_0x19fe16){_0x19fe16=_0x19fe16||0xcc;return function(_0x3e7bb9){if(_0x3e7bb9){return _0x475aa9['sendStatus'](_0x19fe16);}return _0x475aa9[_0x5a49('0x1c')](_0x19fe16)[_0x5a49('0x1d')]();};}function respondWithResult(_0x3cb516,_0x41b464){_0x41b464=_0x41b464||0xc8;return function(_0x41baab){if(_0x41baab){return _0x3cb516[_0x5a49('0x1c')](_0x41b464)[_0x5a49('0x1e')](_0x41baab);}};}function respondWithFilteredResult(_0x1bebc6,_0x56945b){return function(_0x5dee82){if(_0x5dee82){var _0x17cc21=typeof _0x56945b[_0x5a49('0x1f')]===_0x5a49('0x20')&&typeof _0x56945b['limit']===_0x5a49('0x20');var _0x65d772=_0x5dee82[_0x5a49('0x21')];var _0x2df5b8=_0x17cc21?0x0:_0x56945b[_0x5a49('0x1f')];var _0x4ef26f=_0x17cc21?_0x5dee82['count']:_0x56945b['offset']+_0x56945b[_0x5a49('0x22')];var _0x22f236;if(_0x4ef26f>=_0x65d772){_0x4ef26f=_0x65d772;_0x22f236=0xc8;}else{_0x22f236=0xce;}_0x1bebc6[_0x5a49('0x1c')](_0x22f236);return _0x1bebc6['set'](_0x5a49('0x23'),_0x2df5b8+'-'+_0x4ef26f+'/'+_0x65d772)[_0x5a49('0x1e')](_0x5dee82);}return null;};}function patchUpdates(_0xd8c004){return function(_0x50463c){try{jsonpatch['apply'](_0x50463c,_0xd8c004,!![]);}catch(_0x29e32e){return BPromise[_0x5a49('0x24')](_0x29e32e);}return _0x50463c[_0x5a49('0x25')]();};}function saveUpdates(_0x45125a,_0x31fd32){return function(_0x2c5bd6){if(_0x2c5bd6){return _0x2c5bd6[_0x5a49('0x26')](_0x45125a)[_0x5a49('0x27')](function(_0x514381){return _0x514381;});}return null;};}function removeEntity(_0x1683ba,_0xe4ca9){return function(_0x481141){if(_0x481141){return _0x481141['destroy']()[_0x5a49('0x27')](function(){_0x1683ba[_0x5a49('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29bb15,_0x434424){return function(_0x207e4f){if(!_0x207e4f){_0x29bb15[_0x5a49('0x28')](0x194);}return _0x207e4f;};}function handleError(_0x1f12c6,_0x15bb4f){_0x15bb4f=_0x15bb4f||0x1f4;return function(_0x3be9d2){logger['error'](_0x3be9d2[_0x5a49('0x29')]);if(_0x3be9d2['name']){delete _0x3be9d2[_0x5a49('0x2a')];}_0x1f12c6[_0x5a49('0x1c')](_0x15bb4f)[_0x5a49('0x2b')](_0x3be9d2);};}exports[_0x5a49('0x2c')]=function(_0x27fe6c,_0x1d5461){var _0x45bdeb={},_0x5a7eeb={},_0x176e82={'count':0x0,'rows':[]};var _0x4828e0=_[_0x5a49('0x2d')](db[_0x5a49('0x2e')]['rawAttributes'],function(_0x2c0b96){return{'name':_0x2c0b96[_0x5a49('0x2f')],'type':_0x2c0b96['type'][_0x5a49('0x30')]};});_0x5a7eeb[_0x5a49('0x31')]=_['map'](_0x4828e0,_0x5a49('0x2a'));_0x5a7eeb[_0x5a49('0x32')]=_['keys'](_0x27fe6c['query']);_0x5a7eeb[_0x5a49('0x33')]=_[_0x5a49('0x34')](_0x5a7eeb[_0x5a49('0x31')],_0x5a7eeb['query']);_0x45bdeb[_0x5a49('0x35')]=_[_0x5a49('0x34')](_0x5a7eeb['model'],qs[_0x5a49('0x36')](_0x27fe6c[_0x5a49('0x32')][_0x5a49('0x36')]));_0x45bdeb['attributes']=_0x45bdeb[_0x5a49('0x35')][_0x5a49('0x37')]?_0x45bdeb[_0x5a49('0x35')]:_0x5a7eeb[_0x5a49('0x31')];if(!_0x27fe6c['query'][_0x5a49('0x38')](_0x5a49('0x39'))){_0x45bdeb[_0x5a49('0x22')]=qs[_0x5a49('0x22')](_0x27fe6c['query'][_0x5a49('0x22')]);_0x45bdeb[_0x5a49('0x1f')]=qs['offset'](_0x27fe6c[_0x5a49('0x32')][_0x5a49('0x1f')]);}_0x45bdeb[_0x5a49('0x3a')]=qs[_0x5a49('0x3b')](_0x27fe6c[_0x5a49('0x32')]['sort']);_0x45bdeb['where']=qs[_0x5a49('0x33')](_[_0x5a49('0x3c')](_0x27fe6c['query'],_0x5a7eeb[_0x5a49('0x33')]),_0x4828e0);if(_0x27fe6c[_0x5a49('0x32')]['filter']){_0x45bdeb[_0x5a49('0x3d')]=_[_0x5a49('0x3e')](_0x45bdeb[_0x5a49('0x3d')],{'$or':_[_0x5a49('0x2d')](_0x4828e0,function(_0x348f56){if(_0x348f56[_0x5a49('0x3f')]!==_0x5a49('0x40')){var _0x11534e={};_0x11534e[_0x348f56[_0x5a49('0x2a')]]={'$like':'%'+_0x27fe6c['query'][_0x5a49('0x41')]+'%'};return _0x11534e;}})});}_0x45bdeb=_['merge']({},_0x45bdeb,_0x27fe6c[_0x5a49('0x42')]);var _0x97f4d3={'where':_0x45bdeb[_0x5a49('0x3d')]};return db['ZohoAccount'][_0x5a49('0x21')](_0x97f4d3)['then'](function(_0x93492d){_0x176e82['count']=_0x93492d;if(_0x27fe6c[_0x5a49('0x32')][_0x5a49('0x43')]){_0x45bdeb[_0x5a49('0x44')]=[{'all':!![]}];}return db[_0x5a49('0x2e')][_0x5a49('0x45')](_0x45bdeb);})[_0x5a49('0x27')](function(_0x3fa084){_0x176e82[_0x5a49('0x46')]=_0x3fa084;return _0x176e82;})[_0x5a49('0x27')](respondWithFilteredResult(_0x1d5461,_0x45bdeb))['catch'](handleError(_0x1d5461,null));};exports['show']=function(_0x42ac8e,_0x1a503c){var _0x501333={'raw':![],'where':{'id':_0x42ac8e['params']['id']}},_0x5c9479={};_0x5c9479[_0x5a49('0x31')]=_[_0x5a49('0x47')](db['ZohoAccount'][_0x5a49('0x48')]);_0x5c9479[_0x5a49('0x32')]=_['keys'](_0x42ac8e[_0x5a49('0x32')]);_0x5c9479[_0x5a49('0x33')]=_[_0x5a49('0x34')](_0x5c9479[_0x5a49('0x31')],_0x5c9479[_0x5a49('0x32')]);_0x501333['attributes']=_[_0x5a49('0x34')](_0x5c9479[_0x5a49('0x31')],qs[_0x5a49('0x36')](_0x42ac8e[_0x5a49('0x32')][_0x5a49('0x36')]));_0x501333[_0x5a49('0x35')]=_0x501333[_0x5a49('0x35')][_0x5a49('0x37')]?_0x501333[_0x5a49('0x35')]:_0x5c9479[_0x5a49('0x31')];if(_0x42ac8e[_0x5a49('0x32')][_0x5a49('0x43')]){_0x501333['include']=[{'all':!![]}];}_0x501333=_['merge']({},_0x501333,_0x42ac8e[_0x5a49('0x42')]);return db['ZohoAccount'][_0x5a49('0x49')](_0x501333)['then'](handleEntityNotFound(_0x1a503c,null))['then'](respondWithResult(_0x1a503c,null))[_0x5a49('0x4a')](handleError(_0x1a503c,null));};exports['create']=function(_0x127087,_0x4cb46d){return db['ZohoAccount'][_0x5a49('0x4b')](_0x127087['body'],{})['then'](respondWithResult(_0x4cb46d,0xc9))[_0x5a49('0x4a')](handleError(_0x4cb46d,null));};exports[_0x5a49('0x26')]=function(_0x2d8bcf,_0x11496f){if(_0x2d8bcf[_0x5a49('0x4c')]['id']){delete _0x2d8bcf[_0x5a49('0x4c')]['id'];}return db[_0x5a49('0x2e')]['find']({'where':{'id':_0x2d8bcf[_0x5a49('0x4d')]['id']}})[_0x5a49('0x27')](handleEntityNotFound(_0x11496f,null))[_0x5a49('0x27')](saveUpdates(_0x2d8bcf[_0x5a49('0x4c')],null))[_0x5a49('0x27')](respondWithResult(_0x11496f,null))[_0x5a49('0x4a')](handleError(_0x11496f,null));};exports[_0x5a49('0x4e')]=function(_0x22f4e8,_0x40c89f){return db[_0x5a49('0x2e')][_0x5a49('0x49')]({'where':{'id':_0x22f4e8[_0x5a49('0x4d')]['id']}})[_0x5a49('0x27')](handleEntityNotFound(_0x40c89f,null))[_0x5a49('0x27')](removeEntity(_0x40c89f,null))[_0x5a49('0x4a')](handleError(_0x40c89f,null));};exports[_0x5a49('0x4f')]=function(_0x5d1188,_0x31ce87,_0x18944b){var _0x4ad753={};var _0x8fb18c={};var _0xa5c34d;var _0x3f4d70;return db[_0x5a49('0x2e')][_0x5a49('0x50')]({'where':{'id':_0x5d1188[_0x5a49('0x4d')]['id']}})['then'](handleEntityNotFound(_0x31ce87,null))[_0x5a49('0x27')](function(_0x338440){if(_0x338440){_0xa5c34d=_0x338440;_0x8fb18c[_0x5a49('0x31')]=_[_0x5a49('0x47')](db['ZohoConfiguration']['rawAttributes']);_0x8fb18c['query']=_['keys'](_0x5d1188[_0x5a49('0x32')]);_0x8fb18c['filters']=_[_0x5a49('0x34')](_0x8fb18c[_0x5a49('0x31')],_0x8fb18c[_0x5a49('0x32')]);_0x4ad753[_0x5a49('0x35')]=_['intersection'](_0x8fb18c['model'],qs[_0x5a49('0x36')](_0x5d1188[_0x5a49('0x32')][_0x5a49('0x36')]));_0x4ad753[_0x5a49('0x35')]=_0x4ad753[_0x5a49('0x35')]['length']?_0x4ad753['attributes']:_0x8fb18c[_0x5a49('0x31')];_0x4ad753[_0x5a49('0x3a')]=qs[_0x5a49('0x3b')](_0x5d1188[_0x5a49('0x32')][_0x5a49('0x3b')]);_0x4ad753[_0x5a49('0x3d')]=qs['filters'](_[_0x5a49('0x3c')](_0x5d1188['query'],_0x8fb18c[_0x5a49('0x33')]));if(_0x5d1188[_0x5a49('0x32')][_0x5a49('0x41')]){_0x4ad753[_0x5a49('0x3d')]=_[_0x5a49('0x3e')](_0x4ad753[_0x5a49('0x3d')],{'$or':_[_0x5a49('0x2d')](_0x4ad753['attributes'],function(_0x5001ca){var _0x11135d={};_0x11135d[_0x5001ca]={'$like':'%'+_0x5d1188[_0x5a49('0x32')][_0x5a49('0x41')]+'%'};return _0x11135d;})});}_0x4ad753=_[_0x5a49('0x3e')]({},_0x4ad753,_0x5d1188['options']);return _0xa5c34d[_0x5a49('0x4f')](_0x4ad753);}})[_0x5a49('0x27')](function(_0x4381fd){if(_0x4381fd){_0x3f4d70=_0x4381fd[_0x5a49('0x37')];if(!_0x5d1188[_0x5a49('0x32')][_0x5a49('0x38')](_0x5a49('0x39'))){_0x4ad753[_0x5a49('0x22')]=qs[_0x5a49('0x22')](_0x5d1188[_0x5a49('0x32')][_0x5a49('0x22')]);_0x4ad753[_0x5a49('0x1f')]=qs['offset'](_0x5d1188[_0x5a49('0x32')][_0x5a49('0x1f')]);}return _0xa5c34d[_0x5a49('0x4f')](_0x4ad753);}})['then'](function(_0x236120){if(_0x236120){return _0x236120?{'count':_0x3f4d70,'rows':_0x236120}:null;}})['then'](respondWithResult(_0x31ce87,null))[_0x5a49('0x4a')](handleError(_0x31ce87,null));};exports['addConfiguration']=function(_0x46012a,_0x2a7cfd,_0x432524){if(_0x46012a['body']['id']){delete _0x46012a[_0x5a49('0x4c')]['id'];}return db[_0x5a49('0x2e')][_0x5a49('0x50')]({'where':{'id':_0x46012a[_0x5a49('0x4d')]['id']}})[_0x5a49('0x27')](handleEntityNotFound(_0x2a7cfd,null))[_0x5a49('0x27')](function(_0x56fbb4){if(_0x56fbb4){_0x46012a[_0x5a49('0x4c')]['AccountId']=_0x56fbb4['id'];_0x46012a['body'][_0x5a49('0x51')]=integrations[_0x5a49('0x52')](_0x46012a['body'][_0x5a49('0x53')],_0x46012a[_0x5a49('0x4c')]['type']);_0x46012a[_0x5a49('0x4c')][_0x5a49('0x54')]=integrations[_0x5a49('0x55')](_0x46012a['body'][_0x5a49('0x53')],_0x46012a['body'][_0x5a49('0x3f')]);return db[_0x5a49('0x56')][_0x5a49('0x4b')](_0x46012a[_0x5a49('0x4c')],{'include':[{'model':db['ZohoField'],'as':_0x5a49('0x51')},{'model':db[_0x5a49('0x57')],'as':_0x5a49('0x54')}]});}return null;})['then'](respondWithResult(_0x2a7cfd,null))[_0x5a49('0x4a')](handleError(_0x2a7cfd,null));};function getAccessToken(_0x12f227){return new Promise(function(_0x41fb9b,_0x173bf0){var _0x29496c;switch(_0x12f227[_0x5a49('0x58')]){case'US':_0x29496c=_0x5a49('0x59');break;case'AU':_0x29496c=_0x5a49('0x5a');break;case'EU':_0x29496c=_0x5a49('0x5b');break;case'IN':_0x29496c=_0x5a49('0x5c');break;case'CN':_0x29496c='https://accounts.zoho.com.cn';break;default:_0x29496c=_0x5a49('0x5b');break;}var _0x58a26c={'method':'POST','uri':_0x29496c+_0x5a49('0x5d'),'qs':{'refresh_token':_0x12f227[_0x5a49('0x5e')],'client_id':_0x12f227[_0x5a49('0x5f')],'client_secret':_0x12f227[_0x5a49('0x60')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x58a26c)['then'](function(_0x413157){if(_0x413157['access_token']){_0x41fb9b(_0x413157[_0x5a49('0x61')]);}else{_0x173bf0('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0x5a49('0x4a')](function(_0x3e08d7){_0x173bf0(_0x3e08d7);});});}exports[_0x5a49('0x62')]=function(_0x1b0613,_0x534a02,_0x1951d4){var _0x819973,_0x201bd9,_0x2253a1,_0x37575e,_0x489d50;return db[_0x5a49('0x2e')][_0x5a49('0x50')]({'where':{'id':_0x1b0613[_0x5a49('0x4d')]['id']},'attributes':['id','host','zone',_0x5a49('0x5f'),_0x5a49('0x60'),_0x5a49('0x63'),_0x5a49('0x64'),_0x5a49('0x5e')]})[_0x5a49('0x27')](handleEntityNotFound(_0x534a02,null))[_0x5a49('0x27')](function(_0x52dfd7){_0x489d50=_0x52dfd7;_0x819973=_0x489d50['host'];_0x201bd9=_0x819973===_0x5a49('0x65')?'eu':'com';_0x2253a1=_0x489d50[_0x5a49('0x63')];var _0x32e195=_0x2253a1[_0x5a49('0x66')](-0x1);if(_0x32e195==='/'||_0x32e195==='\x5c'||_0x32e195===':'){_0x2253a1=_0x2253a1[_0x5a49('0x67')](0x0,_0x2253a1['lastIndexOf'](_0x32e195));}if(!_0x489d50[_0x5a49('0x5e')]){throw new Error(_0x5a49('0x68'));}return getAccessToken(_0x489d50);})['then'](function(_0x4644bd){if(_0x4644bd){return rp({'method':_0x5a49('0x69'),'uri':util[_0x5a49('0x6a')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x201bd9),'qs':{'module':_0x5a49('0x6b')},'headers':{'Authorization':_0x5a49('0x6c')+_0x4644bd},'json':!![]});}})[_0x5a49('0x27')](function(_0x23170a){if(_0x23170a){if(_0x23170a['response']&&_0x23170a[_0x5a49('0x6d')]['error']){throw new Error(_0x23170a[_0x5a49('0x6d')]['error'][_0x5a49('0x6e')]);}var _0x285982=[];var _0x53543a=[];var _0x1e8ef6=[_0x5a49('0x6f'),_0x5a49('0x70'),_0x5a49('0x71'),_0x5a49('0x72'),'Call_Duration',_0x5a49('0x73'),_0x5a49('0x74'),_0x5a49('0x75')];_0x53543a=_[_0x5a49('0x76')](_0x23170a[_0x5a49('0x36')],function(_0x25d16e){return _0x1e8ef6['includes'](_0x25d16e['api_name']);});for(var _0x3a4e25=0x0;_0x3a4e25<_0x53543a['length'];_0x3a4e25++){if(_0x53543a[_0x3a4e25][_0x5a49('0x77')]===![]){_0x285982[_0x5a49('0x78')]({'id':_0x53543a[_0x3a4e25]['id'],'name':_0x53543a[_0x3a4e25][_0x5a49('0x79')],'custom':_0x53543a[_0x3a4e25][_0x5a49('0x7a')],'options':_0x53543a[_0x3a4e25][_0x5a49('0x7b')]===_0x5a49('0x7c')&&_0x53543a[_0x3a4e25]['pick_list_values'][_0x5a49('0x37')]>-0x1?_['map'](_0x53543a[_0x3a4e25][_0x5a49('0x7d')],function(_0x383195){return{'name':_0x383195,'value':_0x383195};}):[]});}}return{'count':_0x285982[_0x5a49('0x37')],'rows':_0x285982};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x534a02,null))[_0x5a49('0x4a')](function(_0x54cca0){var _0x2a0611=_0x1b0613[_0x5a49('0x32')][_0x5a49('0x7e')]?0x1f4:_0x54cca0['statusCode']||0x1f4;logger[_0x5a49('0x7f')](_0x5a49('0x80'),_0x5a49('0x62'),_0x2a0611,JSON[_0x5a49('0x81')](_0x54cca0));delete _0x54cca0[_0x5a49('0x2a')];if(_0x2a0611===0x191){_0x2a0611=0x190;}_0x534a02[_0x5a49('0x1c')](_0x2a0611)[_0x5a49('0x2b')](_0x1b0613['query'][_0x5a49('0x7e')]?{'message':_0x5a49('0x82'),'statusCode':_0x54cca0[_0x5a49('0x83')]}:_0x54cca0);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 29b0d0d..ae95adb 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 _0x32bf=['code','slice','substring','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','then','parse','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','host','lastIndexOf','https://accounts.zoho.com','lodash','util','../../config/logger','api','moment','path','rimraf','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','changed','zone','serverUrl','clientId','clientSecret'];(function(_0x5df4c6,_0x3962cc){var _0x1e2fda=function(_0x3cbaf5){while(--_0x3cbaf5){_0x5df4c6['push'](_0x5df4c6['shift']());}};_0x1e2fda(++_0x3962cc);}(_0x32bf,0x1c8));var _0xf32b=function(_0x8f65f3,_0x3f8d57){_0x8f65f3=_0x8f65f3-0x0;var _0x3f1f87=_0x32bf[_0x8f65f3];return _0x3f1f87;};'use strict';var _=require(_0xf32b('0x0'));var util=require(_0xf32b('0x1'));var logger=require(_0xf32b('0x2'))(_0xf32b('0x3'));var moment=require(_0xf32b('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf32b('0x5'));var rimraf=require(_0xf32b('0x6'));var config=require('../../config/environment');var attributes=require(_0xf32b('0x7'));var integrations=require(_0xf32b('0x8'));module[_0xf32b('0x9')]=function(_0xfd076c,_0x402ee4){return _0xfd076c[_0xf32b('0xa')](_0xf32b('0xb'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4dbefa,_0x547632,_0x5ec7a6){if(_0x4dbefa[_0xf32b('0xc')](_0xf32b('0xd'))||_0x4dbefa[_0xf32b('0xc')](_0xf32b('0xe'))||_0x4dbefa[_0xf32b('0xc')](_0xf32b('0xf'))||_0x4dbefa[_0xf32b('0xc')](_0xf32b('0x10'))||_0x4dbefa[_0xf32b('0xc')](_0xf32b('0x11'))||_0x4dbefa[_0xf32b('0xc')]('host')){var _0x5ba6fd,_0x3b1668;_0x5ba6fd=_0x4dbefa[_0xf32b('0xe')];var _0x278b28=_0x5ba6fd[_0xf32b('0x12')](-0x1);if(_0x278b28==='/'||_0x278b28==='\x5c'||_0x278b28===':'){_0x5ba6fd=_0x5ba6fd[_0xf32b('0x13')](0x0,_0x5ba6fd['lastIndexOf'](_0x278b28));}switch(_0x4dbefa['zone']){case'US':_0x3b1668='https://accounts.zoho.com';break;case'AU':_0x3b1668=_0xf32b('0x14');break;case'IN':_0x3b1668=_0xf32b('0x15');break;case'CN':_0x3b1668=_0xf32b('0x16');break;default:_0x3b1668=_0xf32b('0x17');break;}var _0x4ac811={'method':_0xf32b('0x18'),'uri':_0x3b1668+_0xf32b('0x19'),'form':{'grant_type':_0xf32b('0x1a'),'client_id':_0x4dbefa[_0xf32b('0xf')],'client_secret':_0x4dbefa[_0xf32b('0x10')],'redirect_uri':_0x4dbefa[_0xf32b('0xe')],'code':_0x4dbefa[_0xf32b('0x11')]},'headers':{'Content-Type':_0xf32b('0x1b')}};return rp(_0x4ac811)[_0xf32b('0x1c')](function(_0x15b76a){var _0x35b4ba=JSON[_0xf32b('0x1d')](_0x15b76a);if(_0x35b4ba[_0xf32b('0x1e')]){_0x4dbefa[_0xf32b('0x1f')]=_0x35b4ba[_0xf32b('0x1e')];logger[_0xf32b('0x20')](util['format'](_0xf32b('0x21'),_0x4dbefa[_0xf32b('0x22')],_0x4dbefa['id']));}else{logger[_0xf32b('0x23')](util[_0xf32b('0x24')](_0xf32b('0x25'),_0x4dbefa['name'],_0x4dbefa['id']),util[_0xf32b('0x26')](_0x35b4ba,{'showHidden':![],'depth':null}));}return _0x5ec7a6(null,_0x547632);})[_0xf32b('0x27')](function(_0xa0a471){logger[_0xf32b('0x23')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4dbefa[_0xf32b('0x22')],_0x4dbefa['id']),util[_0xf32b('0x26')](parsedResult,{'showHidden':![],'depth':null}));return _0x5ec7a6(_0xa0a471);});}else{return _0x5ec7a6(null,_0x547632);}},'beforeUpdate':function(_0x5341fb,_0x4c0fbd,_0x376e83){if(_0x5341fb['changed'](_0xf32b('0xd'))||_0x5341fb[_0xf32b('0xc')](_0xf32b('0xe'))||_0x5341fb[_0xf32b('0xc')](_0xf32b('0xf'))||_0x5341fb[_0xf32b('0xc')]('clientSecret')||_0x5341fb[_0xf32b('0xc')](_0xf32b('0x11'))||_0x5341fb[_0xf32b('0xc')](_0xf32b('0x28'))){var _0x1373a2,_0x2ffe71;_0x1373a2=_0x5341fb[_0xf32b('0xe')];var _0x2e798e=_0x1373a2[_0xf32b('0x12')](-0x1);if(_0x2e798e==='/'||_0x2e798e==='\x5c'||_0x2e798e===':'){_0x1373a2=_0x1373a2['substring'](0x0,_0x1373a2[_0xf32b('0x29')](_0x2e798e));}switch(_0x5341fb[_0xf32b('0xd')]){case'US':_0x2ffe71=_0xf32b('0x2a');break;case'AU':_0x2ffe71=_0xf32b('0x14');break;case'IN':_0x2ffe71='https://accounts.zoho.in';break;case'CN':_0x2ffe71='https://accounts.zoho.com.cn';break;default:_0x2ffe71='https://accounts.zoho.eu';break;}var _0x224164={'method':_0xf32b('0x18'),'uri':_0x2ffe71+_0xf32b('0x19'),'form':{'grant_type':'authorization_code','client_id':_0x5341fb[_0xf32b('0xf')],'client_secret':_0x5341fb[_0xf32b('0x10')],'redirect_uri':_0x5341fb[_0xf32b('0xe')],'code':_0x5341fb['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x224164)['then'](function(_0x3e80e8){var _0x86016f=JSON['parse'](_0x3e80e8);if(_0x86016f[_0xf32b('0x1e')]){_0x5341fb['refreshToken']=_0x86016f[_0xf32b('0x1e')];logger[_0xf32b('0x20')](util[_0xf32b('0x24')](_0xf32b('0x21'),_0x5341fb[_0xf32b('0x22')],_0x5341fb['id']));}else{logger[_0xf32b('0x23')](util[_0xf32b('0x24')](_0xf32b('0x25'),_0x5341fb['name'],_0x5341fb['id']),util[_0xf32b('0x26')](_0x86016f,{'showHidden':![],'depth':null}));}return _0x376e83(null,_0x4c0fbd);})[_0xf32b('0x27')](function(_0x368c3c){logger[_0xf32b('0x23')](util[_0xf32b('0x24')](_0xf32b('0x25'),_0x5341fb['name'],_0x5341fb['id']),util[_0xf32b('0x26')](parsedResult,{'showHidden':![],'depth':null}));return _0x376e83(_0x368c3c);});}else{return _0x376e83(null,_0x4c0fbd);}}}});}; \ No newline at end of file +var _0x0b3a=['ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','api','moment','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','int_zoho_accounts','zone','changed','clientId','code','host','serverUrl','slice','substring','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','clientSecret','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','info','format','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch'];(function(_0xda99d6,_0x5d0efa){var _0x4d8540=function(_0x5e2e94){while(--_0x5e2e94){_0xda99d6['push'](_0xda99d6['shift']());}};_0x4d8540(++_0x5d0efa);}(_0x0b3a,0x1d5));var _0xa0b3=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x0b3a[_0x297fd3];return _0x2af381;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xa0b3('0x0'));var moment=require(_0xa0b3('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa0b3('0x2'));var rimraf=require(_0xa0b3('0x3'));var config=require(_0xa0b3('0x4'));var attributes=require(_0xa0b3('0x5'));var integrations=require(_0xa0b3('0x6'));module[_0xa0b3('0x7')]=function(_0x53ab73,_0x27771b){return _0x53ab73[_0xa0b3('0x8')]('ZohoAccount',attributes,{'tableName':_0xa0b3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2ff2de,_0x857180,_0xa5de7a){if(_0x2ff2de['changed'](_0xa0b3('0xa'))||_0x2ff2de['changed']('serverUrl')||_0x2ff2de[_0xa0b3('0xb')](_0xa0b3('0xc'))||_0x2ff2de['changed']('clientSecret')||_0x2ff2de[_0xa0b3('0xb')](_0xa0b3('0xd'))||_0x2ff2de[_0xa0b3('0xb')](_0xa0b3('0xe'))){var _0x49fcf2,_0x35331e;_0x49fcf2=_0x2ff2de[_0xa0b3('0xf')];var _0x3eb659=_0x49fcf2[_0xa0b3('0x10')](-0x1);if(_0x3eb659==='/'||_0x3eb659==='\x5c'||_0x3eb659===':'){_0x49fcf2=_0x49fcf2[_0xa0b3('0x11')](0x0,_0x49fcf2['lastIndexOf'](_0x3eb659));}switch(_0x2ff2de[_0xa0b3('0xa')]){case'US':_0x35331e=_0xa0b3('0x12');break;case'AU':_0x35331e=_0xa0b3('0x13');break;case'IN':_0x35331e=_0xa0b3('0x14');break;case'CN':_0x35331e=_0xa0b3('0x15');break;default:_0x35331e=_0xa0b3('0x16');break;}var _0x25ccd2={'method':_0xa0b3('0x17'),'uri':_0x35331e+_0xa0b3('0x18'),'form':{'grant_type':'authorization_code','client_id':_0x2ff2de[_0xa0b3('0xc')],'client_secret':_0x2ff2de[_0xa0b3('0x19')],'redirect_uri':_0x2ff2de[_0xa0b3('0xf')],'code':_0x2ff2de[_0xa0b3('0xd')]},'headers':{'Content-Type':_0xa0b3('0x1a')}};return rp(_0x25ccd2)[_0xa0b3('0x1b')](function(_0x10501a){var _0x47e0d8=JSON[_0xa0b3('0x1c')](_0x10501a);if(_0x47e0d8[_0xa0b3('0x1d')]){_0x2ff2de[_0xa0b3('0x1e')]=_0x47e0d8[_0xa0b3('0x1d')];logger[_0xa0b3('0x1f')](util[_0xa0b3('0x20')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x2ff2de[_0xa0b3('0x21')],_0x2ff2de['id']));}else{logger[_0xa0b3('0x22')](util[_0xa0b3('0x20')](_0xa0b3('0x23'),_0x2ff2de['name'],_0x2ff2de['id']),util[_0xa0b3('0x24')](_0x47e0d8,{'showHidden':![],'depth':null}));}return _0xa5de7a(null,_0x857180);})[_0xa0b3('0x25')](function(_0x16a4ab){logger['error'](util[_0xa0b3('0x20')](_0xa0b3('0x23'),_0x2ff2de[_0xa0b3('0x21')],_0x2ff2de['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0xa5de7a(_0x16a4ab);});}else{return _0xa5de7a(null,_0x857180);}},'beforeUpdate':function(_0x38c795,_0x243ea9,_0x47d8aa){if(_0x38c795[_0xa0b3('0xb')](_0xa0b3('0xa'))||_0x38c795[_0xa0b3('0xb')](_0xa0b3('0xf'))||_0x38c795[_0xa0b3('0xb')](_0xa0b3('0xc'))||_0x38c795[_0xa0b3('0xb')]('clientSecret')||_0x38c795[_0xa0b3('0xb')]('code')||_0x38c795[_0xa0b3('0xb')](_0xa0b3('0xe'))){var _0x453879,_0x13d9f2;_0x453879=_0x38c795[_0xa0b3('0xf')];var _0x6090b5=_0x453879[_0xa0b3('0x10')](-0x1);if(_0x6090b5==='/'||_0x6090b5==='\x5c'||_0x6090b5===':'){_0x453879=_0x453879[_0xa0b3('0x11')](0x0,_0x453879['lastIndexOf'](_0x6090b5));}switch(_0x38c795[_0xa0b3('0xa')]){case'US':_0x13d9f2=_0xa0b3('0x12');break;case'AU':_0x13d9f2=_0xa0b3('0x13');break;case'IN':_0x13d9f2=_0xa0b3('0x14');break;case'CN':_0x13d9f2='https://accounts.zoho.com.cn';break;default:_0x13d9f2=_0xa0b3('0x16');break;}var _0x4c0b8c={'method':_0xa0b3('0x17'),'uri':_0x13d9f2+_0xa0b3('0x18'),'form':{'grant_type':'authorization_code','client_id':_0x38c795[_0xa0b3('0xc')],'client_secret':_0x38c795[_0xa0b3('0x19')],'redirect_uri':_0x38c795[_0xa0b3('0xf')],'code':_0x38c795[_0xa0b3('0xd')]},'headers':{'Content-Type':_0xa0b3('0x1a')}};return rp(_0x4c0b8c)[_0xa0b3('0x1b')](function(_0x47ad38){var _0x1c6da5=JSON[_0xa0b3('0x1c')](_0x47ad38);if(_0x1c6da5[_0xa0b3('0x1d')]){_0x38c795[_0xa0b3('0x1e')]=_0x1c6da5['refresh_token'];logger['info'](util[_0xa0b3('0x20')](_0xa0b3('0x26'),_0x38c795['name'],_0x38c795['id']));}else{logger[_0xa0b3('0x22')](util['format'](_0xa0b3('0x23'),_0x38c795[_0xa0b3('0x21')],_0x38c795['id']),util[_0xa0b3('0x24')](_0x1c6da5,{'showHidden':![],'depth':null}));}return _0x47d8aa(null,_0x243ea9);})[_0xa0b3('0x25')](function(_0x1e4aaf){logger[_0xa0b3('0x22')](util[_0xa0b3('0x20')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x38c795[_0xa0b3('0x21')],_0x38c795['id']),util[_0xa0b3('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x47d8aa(_0x1e4aaf);});}else{return _0x47d8aa(null,_0x243ea9);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 739d7b2..246259d 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 _0x9264=['info','result','catch','findAll','options','raw','limit','map','include','model','attributes','GetZohoAccount','stringify','ZohoAccount','find','where','ShowZohoAccount','lodash','util','moment','bluebird','../../mysqldb','rpc','http','request','then','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0x3b16c0,_0x12a93a){var _0x446443=function(_0x5dfa07){while(--_0x5dfa07){_0x3b16c0['push'](_0x3b16c0['shift']());}};_0x446443(++_0x12a93a);}(_0x9264,0xb1));var _0x4926=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9264[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x4926('0x0'));var util=require(_0x4926('0x1'));var moment=require(_0x4926('0x2'));var BPromise=require(_0x4926('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4926('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4926('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x4926('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1dbcbe,_0x57c13c,_0x1299c8){return new BPromise(function(_0x2f5445,_0x4da9b6){return client[_0x4926('0x7')](_0x1dbcbe,_0x1299c8)[_0x4926('0x8')](function(_0x2a5ce3){logger['info'](_0x4926('0x9'),_0x57c13c,_0x4926('0xa'));logger[_0x4926('0xb')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x57c13c,_0x4926('0xa'),JSON['stringify'](_0x2a5ce3));if(_0x2a5ce3['error']){if(_0x2a5ce3[_0x4926('0xc')][_0x4926('0xd')]===0x1f4){logger[_0x4926('0xc')]('ZohoAccount,\x20%s,\x20%s',_0x57c13c,_0x2a5ce3[_0x4926('0xc')][_0x4926('0xe')]);return _0x4da9b6(_0x2a5ce3[_0x4926('0xc')][_0x4926('0xe')]);}logger[_0x4926('0xc')](_0x4926('0x9'),_0x57c13c,_0x2a5ce3[_0x4926('0xc')][_0x4926('0xe')]);return _0x2f5445(_0x2a5ce3[_0x4926('0xc')][_0x4926('0xe')]);}else{logger[_0x4926('0xf')](_0x4926('0x9'),_0x57c13c,_0x4926('0xa'));_0x2f5445(_0x2a5ce3[_0x4926('0x10')]['message']);}})[_0x4926('0x11')](function(_0x258914){logger[_0x4926('0xc')]('ZohoAccount,\x20%s,\x20%s',_0x57c13c,_0x258914);_0x4da9b6(_0x258914);});});}exports['GetZohoAccount']=function(_0x1dd78e){var _0x5630a8=this;return new Promise(function(_0x214e36,_0x371803){return db['ZohoAccount'][_0x4926('0x12')]({'raw':_0x1dd78e['options']?_0x1dd78e[_0x4926('0x13')][_0x4926('0x14')]===undefined?!![]:![]:!![],'where':_0x1dd78e[_0x4926('0x13')]?_0x1dd78e[_0x4926('0x13')]['where']||null:null,'attributes':_0x1dd78e['options']?_0x1dd78e[_0x4926('0x13')]['attributes']||null:null,'limit':_0x1dd78e['options']?_0x1dd78e[_0x4926('0x13')][_0x4926('0x15')]||null:null,'include':_0x1dd78e['options']?_0x1dd78e[_0x4926('0x13')]['include']?_[_0x4926('0x16')](_0x1dd78e['options'][_0x4926('0x17')],function(_0x34d600){return{'model':db[_0x34d600[_0x4926('0x18')]],'as':_0x34d600['as'],'attributes':_0x34d600[_0x4926('0x19')],'include':_0x34d600['include']?_['map'](_0x34d600['include'],function(_0x1c02e7){return{'model':db[_0x1c02e7[_0x4926('0x18')]],'as':_0x1c02e7['as'],'attributes':_0x1c02e7[_0x4926('0x19')],'include':_0x1c02e7[_0x4926('0x17')]?_['map'](_0x1c02e7['include'],function(_0x55413a){return{'model':db[_0x55413a[_0x4926('0x18')]],'as':_0x55413a['as'],'attributes':_0x55413a[_0x4926('0x19')]};}):[]};}):[]};}):[]:[]})[_0x4926('0x8')](function(_0x4adb87){logger['info']('GetZohoAccount',_0x1dd78e);logger[_0x4926('0xb')](_0x4926('0x1a'),_0x1dd78e,JSON[_0x4926('0x1b')](_0x4adb87));_0x214e36(_0x4adb87);})['catch'](function(_0x180421){logger[_0x4926('0xc')](_0x4926('0x1a'),_0x180421[_0x4926('0xe')],_0x1dd78e);_0x371803(_0x5630a8[_0x4926('0xc')](0x1f4,_0x180421[_0x4926('0xe')]));});});};exports['ShowZohoAccount']=function(_0x39ad37){var _0x717a1a=this;return new Promise(function(_0x32a6c2,_0x14d8b8){return db[_0x4926('0x1c')][_0x4926('0x1d')]({'raw':_0x39ad37[_0x4926('0x13')]?_0x39ad37['options'][_0x4926('0x14')]===undefined?!![]:![]:!![],'where':_0x39ad37[_0x4926('0x13')]?_0x39ad37['options'][_0x4926('0x1e')]||null:null,'attributes':_0x39ad37[_0x4926('0x13')]?_0x39ad37[_0x4926('0x13')][_0x4926('0x19')]||null:null,'include':_0x39ad37[_0x4926('0x13')]?_0x39ad37[_0x4926('0x13')][_0x4926('0x17')]?_[_0x4926('0x16')](_0x39ad37[_0x4926('0x13')][_0x4926('0x17')],function(_0x3c09b0){return{'model':db[_0x3c09b0[_0x4926('0x18')]],'as':_0x3c09b0['as'],'attributes':_0x3c09b0[_0x4926('0x19')],'include':_0x3c09b0[_0x4926('0x17')]?_['map'](_0x3c09b0[_0x4926('0x17')],function(_0x12d414){return{'model':db[_0x12d414[_0x4926('0x18')]],'as':_0x12d414['as'],'attributes':_0x12d414[_0x4926('0x19')],'include':_0x12d414['include']?_[_0x4926('0x16')](_0x12d414[_0x4926('0x17')],function(_0x180a34){return{'model':db[_0x180a34[_0x4926('0x18')]],'as':_0x180a34['as'],'attributes':_0x180a34[_0x4926('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x42271e){logger[_0x4926('0xf')](_0x4926('0x1f'),_0x39ad37);logger['debug'](_0x4926('0x1f'),_0x39ad37,JSON[_0x4926('0x1b')](_0x42271e));_0x32a6c2(_0x42271e);})[_0x4926('0x11')](function(_0x45a3bc){logger[_0x4926('0xc')](_0x4926('0x1f'),_0x45a3bc['message'],_0x39ad37);_0x14d8b8(_0x717a1a[_0x4926('0xc')](0x1f4,_0x45a3bc[_0x4926('0xe')]));});});}; \ No newline at end of file +var _0xfa25=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','info','ZohoAccount,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','GetZohoAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','catch','ShowZohoAccount','ZohoAccount','find','util'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xfa25,0xd1));var _0x5fa2=function(_0x3ced49,_0x1b8e8b){_0x3ced49=_0x3ced49-0x0;var _0x3ba782=_0xfa25[_0x3ced49];return _0x3ba782;};'use strict';var _=require('lodash');var util=require(_0x5fa2('0x0'));var moment=require(_0x5fa2('0x1'));var BPromise=require(_0x5fa2('0x2'));var rs=require(_0x5fa2('0x3'));var fs=require('fs');var Redis=require(_0x5fa2('0x4'));var db=require(_0x5fa2('0x5'))['db'];var utils=require(_0x5fa2('0x6'));var logger=require(_0x5fa2('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5fa2('0x8'));var client=jayson[_0x5fa2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x53a560,_0x2a9a69,_0x4b04ea){return new BPromise(function(_0x35c145,_0x9c9f1c){return client[_0x5fa2('0xa')](_0x53a560,_0x4b04ea)['then'](function(_0x36778e){logger[_0x5fa2('0xb')](_0x5fa2('0xc'),_0x2a9a69,'request\x20sent');logger[_0x5fa2('0xd')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x2a9a69,'request\x20sent',JSON[_0x5fa2('0xe')](_0x36778e));if(_0x36778e[_0x5fa2('0xf')]){if(_0x36778e['error'][_0x5fa2('0x10')]===0x1f4){logger[_0x5fa2('0xf')](_0x5fa2('0xc'),_0x2a9a69,_0x36778e[_0x5fa2('0xf')][_0x5fa2('0x11')]);return _0x9c9f1c(_0x36778e[_0x5fa2('0xf')][_0x5fa2('0x11')]);}logger[_0x5fa2('0xf')](_0x5fa2('0xc'),_0x2a9a69,_0x36778e[_0x5fa2('0xf')][_0x5fa2('0x11')]);return _0x35c145(_0x36778e[_0x5fa2('0xf')][_0x5fa2('0x11')]);}else{logger[_0x5fa2('0xb')]('ZohoAccount,\x20%s,\x20%s',_0x2a9a69,_0x5fa2('0x12'));_0x35c145(_0x36778e[_0x5fa2('0x13')][_0x5fa2('0x11')]);}})['catch'](function(_0x4e20d1){logger[_0x5fa2('0xf')](_0x5fa2('0xc'),_0x2a9a69,_0x4e20d1);_0x9c9f1c(_0x4e20d1);});});}exports[_0x5fa2('0x14')]=function(_0x522f1c){var _0x427205=this;return new Promise(function(_0x593815,_0x41be51){return db['ZohoAccount'][_0x5fa2('0x15')]({'raw':_0x522f1c[_0x5fa2('0x16')]?_0x522f1c['options'][_0x5fa2('0x17')]===undefined?!![]:![]:!![],'where':_0x522f1c[_0x5fa2('0x16')]?_0x522f1c[_0x5fa2('0x16')][_0x5fa2('0x18')]||null:null,'attributes':_0x522f1c['options']?_0x522f1c[_0x5fa2('0x16')][_0x5fa2('0x19')]||null:null,'limit':_0x522f1c[_0x5fa2('0x16')]?_0x522f1c[_0x5fa2('0x16')][_0x5fa2('0x1a')]||null:null,'include':_0x522f1c[_0x5fa2('0x16')]?_0x522f1c[_0x5fa2('0x16')][_0x5fa2('0x1b')]?_[_0x5fa2('0x1c')](_0x522f1c[_0x5fa2('0x16')][_0x5fa2('0x1b')],function(_0x2cac01){return{'model':db[_0x2cac01[_0x5fa2('0x1d')]],'as':_0x2cac01['as'],'attributes':_0x2cac01['attributes'],'include':_0x2cac01[_0x5fa2('0x1b')]?_[_0x5fa2('0x1c')](_0x2cac01[_0x5fa2('0x1b')],function(_0x45af15){return{'model':db[_0x45af15['model']],'as':_0x45af15['as'],'attributes':_0x45af15['attributes'],'include':_0x45af15[_0x5fa2('0x1b')]?_[_0x5fa2('0x1c')](_0x45af15['include'],function(_0x12b99b){return{'model':db[_0x12b99b[_0x5fa2('0x1d')]],'as':_0x12b99b['as'],'attributes':_0x12b99b[_0x5fa2('0x19')]};}):[]};}):[]};}):[]:[]})[_0x5fa2('0x1e')](function(_0x18cbd7){logger[_0x5fa2('0xb')]('GetZohoAccount',_0x522f1c);logger[_0x5fa2('0xd')](_0x5fa2('0x14'),_0x522f1c,JSON[_0x5fa2('0xe')](_0x18cbd7));_0x593815(_0x18cbd7);})[_0x5fa2('0x1f')](function(_0x4fd561){logger[_0x5fa2('0xf')](_0x5fa2('0x14'),_0x4fd561['message'],_0x522f1c);_0x41be51(_0x427205['error'](0x1f4,_0x4fd561['message']));});});};exports[_0x5fa2('0x20')]=function(_0xc5a40c){var _0x5a0d50=this;return new Promise(function(_0x22f054,_0x3d1d41){return db[_0x5fa2('0x21')][_0x5fa2('0x22')]({'raw':_0xc5a40c[_0x5fa2('0x16')]?_0xc5a40c['options'][_0x5fa2('0x17')]===undefined?!![]:![]:!![],'where':_0xc5a40c[_0x5fa2('0x16')]?_0xc5a40c[_0x5fa2('0x16')][_0x5fa2('0x18')]||null:null,'attributes':_0xc5a40c[_0x5fa2('0x16')]?_0xc5a40c['options'][_0x5fa2('0x19')]||null:null,'include':_0xc5a40c[_0x5fa2('0x16')]?_0xc5a40c['options']['include']?_['map'](_0xc5a40c[_0x5fa2('0x16')][_0x5fa2('0x1b')],function(_0x293948){return{'model':db[_0x293948['model']],'as':_0x293948['as'],'attributes':_0x293948[_0x5fa2('0x19')],'include':_0x293948[_0x5fa2('0x1b')]?_['map'](_0x293948['include'],function(_0x3ba30e){return{'model':db[_0x3ba30e['model']],'as':_0x3ba30e['as'],'attributes':_0x3ba30e[_0x5fa2('0x19')],'include':_0x3ba30e[_0x5fa2('0x1b')]?_['map'](_0x3ba30e[_0x5fa2('0x1b')],function(_0x5e7419){return{'model':db[_0x5e7419[_0x5fa2('0x1d')]],'as':_0x5e7419['as'],'attributes':_0x5e7419['attributes']};}):[]};}):[]};}):[]:[]})[_0x5fa2('0x1e')](function(_0x2e9614){logger['info'](_0x5fa2('0x20'),_0xc5a40c);logger[_0x5fa2('0xd')](_0x5fa2('0x20'),_0xc5a40c,JSON[_0x5fa2('0xe')](_0x2e9614));_0x22f054(_0x2e9614);})[_0x5fa2('0x1f')](function(_0x2e0a26){logger[_0x5fa2('0xf')](_0x5fa2('0x20'),_0x2e0a26[_0x5fa2('0x11')],_0xc5a40c);_0x3d1d41(_0x5a0d50[_0x5fa2('0xf')](0x1f4,_0x2e0a26[_0x5fa2('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 84f4cbf..4fc68fa 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 _0x09fe=['fs-extra','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','/:id','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x3fb9dd,_0x174fff){var _0x20136a=function(_0x480081){while(--_0x480081){_0x3fb9dd['push'](_0x3fb9dd['shift']());}};_0x20136a(++_0x174fff);}(_0x09fe,0x9c));var _0xe09f=function(_0x5b5ef5,_0x53eed8){_0x5b5ef5=_0x5b5ef5-0x0;var _0x128985=_0x09fe[_0x5b5ef5];return _0x128985;};'use strict';var multer=require(_0xe09f('0x0'));var util=require(_0xe09f('0x1'));var path=require(_0xe09f('0x2'));var timeout=require(_0xe09f('0x3'));var express=require(_0xe09f('0x4'));var router=express['Router']();var fs_extra=require(_0xe09f('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe09f('0x6'));var controller=require(_0xe09f('0x7'));router[_0xe09f('0x8')]('/',auth[_0xe09f('0x9')](),controller[_0xe09f('0xa')]);router[_0xe09f('0x8')]('/:id',auth[_0xe09f('0x9')](),controller[_0xe09f('0xb')]);router[_0xe09f('0x8')](_0xe09f('0xc'),auth['isAuthenticated'](),controller[_0xe09f('0xd')]);router[_0xe09f('0x8')](_0xe09f('0xe'),auth[_0xe09f('0x9')](),controller[_0xe09f('0xf')]);router['get'](_0xe09f('0x10'),auth[_0xe09f('0x9')](),controller[_0xe09f('0x11')]);router[_0xe09f('0x12')]('/',auth[_0xe09f('0x9')](),controller[_0xe09f('0x13')]);router['put']('/:id',auth[_0xe09f('0x9')](),controller['update']);router['delete'](_0xe09f('0x14'),auth['isAuthenticated'](),controller[_0xe09f('0x15')]);module[_0xe09f('0x16')]=router; \ No newline at end of file +var _0x13dc=['post','create','put','update','delete','/:id','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','get','/:id/descriptions'];(function(_0x4515b5,_0x5bff9b){var _0xefcffd=function(_0x4b5683){while(--_0x4b5683){_0x4515b5['push'](_0x4515b5['shift']());}};_0xefcffd(++_0x5bff9b);}(_0x13dc,0xbf));var _0xc13d=function(_0x175827,_0x2bcaf0){_0x175827=_0x175827-0x0;var _0x3097c5=_0x13dc[_0x175827];return _0x3097c5;};'use strict';var multer=require(_0xc13d('0x0'));var util=require(_0xc13d('0x1'));var path=require(_0xc13d('0x2'));var timeout=require(_0xc13d('0x3'));var express=require('express');var router=express[_0xc13d('0x4')]();var fs_extra=require(_0xc13d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc13d('0x6'));var config=require(_0xc13d('0x7'));var controller=require(_0xc13d('0x8'));router['get']('/',auth[_0xc13d('0x9')](),controller['index']);router['get']('/:id',auth[_0xc13d('0x9')](),controller[_0xc13d('0xa')]);router['get'](_0xc13d('0xb'),auth[_0xc13d('0x9')](),controller[_0xc13d('0xc')]);router['get'](_0xc13d('0xd'),auth[_0xc13d('0x9')](),controller['getSubjects']);router[_0xc13d('0xe')](_0xc13d('0xf'),auth[_0xc13d('0x9')](),controller['getDescriptions']);router[_0xc13d('0x10')]('/',auth[_0xc13d('0x9')](),controller[_0xc13d('0x11')]);router[_0xc13d('0x12')]('/:id',auth[_0xc13d('0x9')](),controller[_0xc13d('0x13')]);router[_0xc13d('0x14')](_0xc13d('0x15'),auth[_0xc13d('0x9')](),controller['destroy']);module[_0xc13d('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index ca87a94..7ab0178 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 _0x2cff=['exports','STRING','ENUM','lead','contact','nothing','contact_lead','sequelize'];(function(_0x40cfc0,_0x4241c9){var _0xf5f08d=function(_0x534f63){while(--_0x534f63){_0x40cfc0['push'](_0x40cfc0['shift']());}};_0xf5f08d(++_0x4241c9);}(_0x2cff,0xa7));var _0xf2cf=function(_0x309cec,_0x3ad368){_0x309cec=_0x309cec-0x0;var _0x383ffa=_0x2cff[_0x309cec];return _0x383ffa;};'use strict';var Sequelize=require(_0xf2cf('0x0'));module[_0xf2cf('0x1')]={'name':{'type':Sequelize[_0xf2cf('0x2')]},'moduleCreate':{'type':Sequelize[_0xf2cf('0x3')](_0xf2cf('0x4'),_0xf2cf('0x5'),_0xf2cf('0x6')),'defaultValue':_0xf2cf('0x4')},'moduleSearch':{'type':Sequelize[_0xf2cf('0x3')]('contact_lead','contact',_0xf2cf('0x4')),'defaultValue':_0xf2cf('0x7')},'description':{'type':Sequelize[_0xf2cf('0x2')]}}; \ No newline at end of file +var _0x9087=['ENUM','contact','lead','contact_lead','STRING','sequelize','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x9087,0x1cc));var _0x7908=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9087[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x7908('0x0'));module[_0x7908('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0x7908('0x2')]('lead',_0x7908('0x3'),'nothing'),'defaultValue':_0x7908('0x4')},'moduleSearch':{'type':Sequelize[_0x7908('0x2')](_0x7908('0x5'),_0x7908('0x3'),_0x7908('0x4')),'defaultValue':_0x7908('0x5')},'description':{'type':Sequelize[_0x7908('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index f8cb9ae..bc859db 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 _0x3be2=['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','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','index','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','ZohoConfiguration','includeAll','include','rows','catch','show','find','create','body','params','getFields','ZohoField','hasOwnProperty','getSubjects','findOne','getDescriptions','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js'];(function(_0x5f046f,_0x237857){var _0x16d1ca=function(_0x59a229){while(--_0x59a229){_0x5f046f['push'](_0x5f046f['shift']());}};_0x16d1ca(++_0x237857);}(_0x3be2,0x93));var _0x23be=function(_0x13d6c0,_0xda18c8){_0x13d6c0=_0x13d6c0-0x0;var _0x17ab39=_0x3be2[_0x13d6c0];return _0x17ab39;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x23be('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x23be('0x1'));var moment=require(_0x23be('0x2'));var BPromise=require(_0x23be('0x3'));var Mustache=require(_0x23be('0x4'));var util=require(_0x23be('0x5'));var path=require(_0x23be('0x6'));var sox=require(_0x23be('0x7'));var csv=require(_0x23be('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x23be('0x9'));var _=require('lodash');var squel=require(_0x23be('0xa'));var crypto=require('crypto');var jsforce=require(_0x23be('0xb'));var deskjs=require(_0x23be('0xc'));var toCsv=require(_0x23be('0x8'));var querystring=require('querystring');var Papa=require(_0x23be('0xd'));var Redis=require('ioredis');var authService=require(_0x23be('0xe'));var qs=require(_0x23be('0xf'));var as=require(_0x23be('0x10'));var hardwareService=require(_0x23be('0x11'));var logger=require(_0x23be('0x12'))(_0x23be('0x13'));var utils=require(_0x23be('0x14'));var config=require(_0x23be('0x15'));var licenseUtil=require(_0x23be('0x16'));var db=require(_0x23be('0x17'))['db'];function respondWithStatusCode(_0x5c3ec8,_0x502185){_0x502185=_0x502185||0xcc;return function(_0x10e631){if(_0x10e631){return _0x5c3ec8[_0x23be('0x18')](_0x502185);}return _0x5c3ec8[_0x23be('0x19')](_0x502185)['end']();};}function respondWithResult(_0x5b138a,_0x537e47){_0x537e47=_0x537e47||0xc8;return function(_0x431247){if(_0x431247){return _0x5b138a[_0x23be('0x19')](_0x537e47)[_0x23be('0x1a')](_0x431247);}};}function respondWithFilteredResult(_0x4df265,_0x20fc4b){return function(_0x365777){if(_0x365777){var _0xf7272d=typeof _0x20fc4b[_0x23be('0x1b')]===_0x23be('0x1c')&&typeof _0x20fc4b['limit']==='undefined';var _0x155e51=_0x365777[_0x23be('0x1d')];var _0x95cbac=_0xf7272d?0x0:_0x20fc4b[_0x23be('0x1b')];var _0x4f19eb=_0xf7272d?_0x365777[_0x23be('0x1d')]:_0x20fc4b[_0x23be('0x1b')]+_0x20fc4b[_0x23be('0x1e')];var _0x176fcb;if(_0x4f19eb>=_0x155e51){_0x4f19eb=_0x155e51;_0x176fcb=0xc8;}else{_0x176fcb=0xce;}_0x4df265[_0x23be('0x19')](_0x176fcb);return _0x4df265['set'](_0x23be('0x1f'),_0x95cbac+'-'+_0x4f19eb+'/'+_0x155e51)[_0x23be('0x1a')](_0x365777);}return null;};}function patchUpdates(_0x4779d4){return function(_0x449151){try{jsonpatch[_0x23be('0x20')](_0x449151,_0x4779d4,!![]);}catch(_0x326973){return BPromise[_0x23be('0x21')](_0x326973);}return _0x449151[_0x23be('0x22')]();};}function saveUpdates(_0x21d6da,_0x995668){return function(_0x39bf98){if(_0x39bf98){return _0x39bf98[_0x23be('0x23')](_0x21d6da)[_0x23be('0x24')](function(_0x478190){return _0x478190;});}return null;};}function removeEntity(_0xf4dd4a,_0x4678d7){return function(_0x56681c){if(_0x56681c){return _0x56681c[_0x23be('0x25')]()['then'](function(){_0xf4dd4a[_0x23be('0x19')](0xcc)[_0x23be('0x26')]();});}};}function handleEntityNotFound(_0x3759d8,_0xd3a2ef){return function(_0x1bbf0a){if(!_0x1bbf0a){_0x3759d8[_0x23be('0x18')](0x194);}return _0x1bbf0a;};}function handleError(_0x17328f,_0x1795a3){_0x1795a3=_0x1795a3||0x1f4;return function(_0xca442e){logger['error'](_0xca442e[_0x23be('0x27')]);if(_0xca442e[_0x23be('0x28')]){delete _0xca442e['name'];}_0x17328f[_0x23be('0x19')](_0x1795a3)[_0x23be('0x29')](_0xca442e);};}exports[_0x23be('0x2a')]=function(_0x269d15,_0x408846){var _0x161651={},_0xffe96f={},_0x54a110={'count':0x0,'rows':[]};var _0x40e581=_[_0x23be('0x2b')](db['ZohoConfiguration'][_0x23be('0x2c')],function(_0x336917){return{'name':_0x336917[_0x23be('0x2d')],'type':_0x336917[_0x23be('0x2e')]['key']};});_0xffe96f['model']=_[_0x23be('0x2b')](_0x40e581,'name');_0xffe96f[_0x23be('0x2f')]=_[_0x23be('0x30')](_0x269d15[_0x23be('0x2f')]);_0xffe96f[_0x23be('0x31')]=_[_0x23be('0x32')](_0xffe96f[_0x23be('0x33')],_0xffe96f[_0x23be('0x2f')]);_0x161651['attributes']=_[_0x23be('0x32')](_0xffe96f[_0x23be('0x33')],qs[_0x23be('0x34')](_0x269d15[_0x23be('0x2f')]['fields']));_0x161651[_0x23be('0x35')]=_0x161651[_0x23be('0x35')][_0x23be('0x36')]?_0x161651[_0x23be('0x35')]:_0xffe96f[_0x23be('0x33')];if(!_0x269d15[_0x23be('0x2f')]['hasOwnProperty'](_0x23be('0x37'))){_0x161651[_0x23be('0x1e')]=qs[_0x23be('0x1e')](_0x269d15[_0x23be('0x2f')]['limit']);_0x161651[_0x23be('0x1b')]=qs['offset'](_0x269d15[_0x23be('0x2f')][_0x23be('0x1b')]);}_0x161651[_0x23be('0x38')]=qs[_0x23be('0x39')](_0x269d15[_0x23be('0x2f')][_0x23be('0x39')]);_0x161651['where']=qs[_0x23be('0x31')](_[_0x23be('0x3a')](_0x269d15[_0x23be('0x2f')],_0xffe96f[_0x23be('0x31')]),_0x40e581);if(_0x269d15['query'][_0x23be('0x3b')]){_0x161651[_0x23be('0x3c')]=_[_0x23be('0x3d')](_0x161651[_0x23be('0x3c')],{'$or':_[_0x23be('0x2b')](_0x40e581,function(_0x94c6e8){if(_0x94c6e8[_0x23be('0x2e')]!==_0x23be('0x3e')){var _0x3236b6={};_0x3236b6[_0x94c6e8[_0x23be('0x28')]]={'$like':'%'+_0x269d15[_0x23be('0x2f')]['filter']+'%'};return _0x3236b6;}})});}_0x161651=_[_0x23be('0x3d')]({},_0x161651,_0x269d15[_0x23be('0x3f')]);var _0x1c1122={'where':_0x161651[_0x23be('0x3c')]};return db[_0x23be('0x40')][_0x23be('0x1d')](_0x1c1122)['then'](function(_0x398d83){_0x54a110[_0x23be('0x1d')]=_0x398d83;if(_0x269d15[_0x23be('0x2f')][_0x23be('0x41')]){_0x161651[_0x23be('0x42')]=[{'all':!![]}];}return db[_0x23be('0x40')]['findAll'](_0x161651);})[_0x23be('0x24')](function(_0xb069f7){_0x54a110[_0x23be('0x43')]=_0xb069f7;return _0x54a110;})[_0x23be('0x24')](respondWithFilteredResult(_0x408846,_0x161651))[_0x23be('0x44')](handleError(_0x408846,null));};exports[_0x23be('0x45')]=function(_0x112f01,_0x534e63){var _0x7208d3={'raw':![],'where':{'id':_0x112f01['params']['id']}},_0xd422f5={};_0xd422f5[_0x23be('0x33')]=_[_0x23be('0x30')](db[_0x23be('0x40')][_0x23be('0x2c')]);_0xd422f5[_0x23be('0x2f')]=_[_0x23be('0x30')](_0x112f01[_0x23be('0x2f')]);_0xd422f5['filters']=_['intersection'](_0xd422f5['model'],_0xd422f5[_0x23be('0x2f')]);_0x7208d3['attributes']=_[_0x23be('0x32')](_0xd422f5[_0x23be('0x33')],qs[_0x23be('0x34')](_0x112f01[_0x23be('0x2f')][_0x23be('0x34')]));_0x7208d3[_0x23be('0x35')]=_0x7208d3['attributes']['length']?_0x7208d3[_0x23be('0x35')]:_0xd422f5[_0x23be('0x33')];if(_0x112f01['query']['includeAll']){_0x7208d3['include']=[{'all':!![]}];}_0x7208d3=_[_0x23be('0x3d')]({},_0x7208d3,_0x112f01[_0x23be('0x3f')]);return db[_0x23be('0x40')][_0x23be('0x46')](_0x7208d3)[_0x23be('0x24')](handleEntityNotFound(_0x534e63,null))[_0x23be('0x24')](respondWithResult(_0x534e63,null))[_0x23be('0x44')](handleError(_0x534e63,null));};exports[_0x23be('0x47')]=function(_0x5e59d9,_0x1a05b7){return db[_0x23be('0x40')][_0x23be('0x47')](_0x5e59d9['body'],{})[_0x23be('0x24')](respondWithResult(_0x1a05b7,0xc9))[_0x23be('0x44')](handleError(_0x1a05b7,null));};exports[_0x23be('0x23')]=function(_0xe7d230,_0x1cc3a3){if(_0xe7d230[_0x23be('0x48')]['id']){delete _0xe7d230[_0x23be('0x48')]['id'];}return db[_0x23be('0x40')]['find']({'where':{'id':_0xe7d230[_0x23be('0x49')]['id']}})[_0x23be('0x24')](handleEntityNotFound(_0x1cc3a3,null))[_0x23be('0x24')](saveUpdates(_0xe7d230['body'],null))[_0x23be('0x24')](respondWithResult(_0x1cc3a3,null))['catch'](handleError(_0x1cc3a3,null));};exports[_0x23be('0x25')]=function(_0x53446e,_0x1a6b96){return db[_0x23be('0x40')][_0x23be('0x46')]({'where':{'id':_0x53446e[_0x23be('0x49')]['id']}})[_0x23be('0x24')](handleEntityNotFound(_0x1a6b96,null))['then'](removeEntity(_0x1a6b96,null))['catch'](handleError(_0x1a6b96,null));};exports[_0x23be('0x4a')]=function(_0x103830,_0x472437,_0x204708){var _0x41550b={};var _0x596bfc={};var _0x3a45d5;var _0x3e21e9;return db[_0x23be('0x40')]['findOne']({'where':{'id':_0x103830[_0x23be('0x49')]['id']}})['then'](handleEntityNotFound(_0x472437,null))[_0x23be('0x24')](function(_0x20a442){if(_0x20a442){_0x3a45d5=_0x20a442;_0x596bfc[_0x23be('0x33')]=_[_0x23be('0x30')](db[_0x23be('0x4b')][_0x23be('0x2c')]);_0x596bfc[_0x23be('0x2f')]=_[_0x23be('0x30')](_0x103830[_0x23be('0x2f')]);_0x596bfc[_0x23be('0x31')]=_[_0x23be('0x32')](_0x596bfc[_0x23be('0x33')],_0x596bfc[_0x23be('0x2f')]);_0x41550b[_0x23be('0x35')]=_[_0x23be('0x32')](_0x596bfc[_0x23be('0x33')],qs[_0x23be('0x34')](_0x103830[_0x23be('0x2f')][_0x23be('0x34')]));_0x41550b[_0x23be('0x35')]=_0x41550b[_0x23be('0x35')][_0x23be('0x36')]?_0x41550b[_0x23be('0x35')]:_0x596bfc[_0x23be('0x33')];_0x41550b[_0x23be('0x38')]=qs[_0x23be('0x39')](_0x103830[_0x23be('0x2f')][_0x23be('0x39')]);_0x41550b[_0x23be('0x3c')]=qs[_0x23be('0x31')](_[_0x23be('0x3a')](_0x103830[_0x23be('0x2f')],_0x596bfc[_0x23be('0x31')]));if(_0x103830[_0x23be('0x2f')][_0x23be('0x3b')]){_0x41550b[_0x23be('0x3c')]=_[_0x23be('0x3d')](_0x41550b[_0x23be('0x3c')],{'$or':_[_0x23be('0x2b')](_0x41550b[_0x23be('0x35')],function(_0x58fd0e){var _0x59ba2a={};_0x59ba2a[_0x58fd0e]={'$like':'%'+_0x103830[_0x23be('0x2f')][_0x23be('0x3b')]+'%'};return _0x59ba2a;})});}_0x41550b=_[_0x23be('0x3d')]({},_0x41550b,_0x103830[_0x23be('0x3f')]);return _0x3a45d5[_0x23be('0x4a')](_0x41550b);}})[_0x23be('0x24')](function(_0x195661){if(_0x195661){_0x3e21e9=_0x195661[_0x23be('0x36')];if(!_0x103830[_0x23be('0x2f')][_0x23be('0x4c')](_0x23be('0x37'))){_0x41550b[_0x23be('0x1e')]=qs['limit'](_0x103830[_0x23be('0x2f')][_0x23be('0x1e')]);_0x41550b[_0x23be('0x1b')]=qs[_0x23be('0x1b')](_0x103830[_0x23be('0x2f')][_0x23be('0x1b')]);}return _0x3a45d5['getFields'](_0x41550b);}})['then'](function(_0x3aa695){if(_0x3aa695){return _0x3aa695?{'count':_0x3e21e9,'rows':_0x3aa695}:null;}})[_0x23be('0x24')](respondWithResult(_0x472437,null))[_0x23be('0x44')](handleError(_0x472437,null));};exports[_0x23be('0x4d')]=function(_0x4479b5,_0x32e8a5,_0x2a66c7){var _0x81bdf8={};var _0x4c4a71={};var _0x439631;var _0x4d05c6;return db[_0x23be('0x40')][_0x23be('0x4e')]({'where':{'id':_0x4479b5['params']['id']}})['then'](handleEntityNotFound(_0x32e8a5,null))[_0x23be('0x24')](function(_0xeead83){if(_0xeead83){_0x439631=_0xeead83;_0x4c4a71[_0x23be('0x33')]=_[_0x23be('0x30')](db[_0x23be('0x4b')]['rawAttributes']);_0x4c4a71[_0x23be('0x2f')]=_[_0x23be('0x30')](_0x4479b5[_0x23be('0x2f')]);_0x4c4a71[_0x23be('0x31')]=_['intersection'](_0x4c4a71[_0x23be('0x33')],_0x4c4a71[_0x23be('0x2f')]);_0x81bdf8[_0x23be('0x35')]=_['intersection'](_0x4c4a71[_0x23be('0x33')],qs[_0x23be('0x34')](_0x4479b5[_0x23be('0x2f')][_0x23be('0x34')]));_0x81bdf8[_0x23be('0x35')]=_0x81bdf8[_0x23be('0x35')]['length']?_0x81bdf8[_0x23be('0x35')]:_0x4c4a71['model'];_0x81bdf8[_0x23be('0x38')]=qs[_0x23be('0x39')](_0x4479b5[_0x23be('0x2f')][_0x23be('0x39')]);_0x81bdf8[_0x23be('0x3c')]=qs[_0x23be('0x31')](_[_0x23be('0x3a')](_0x4479b5['query'],_0x4c4a71[_0x23be('0x31')]));if(_0x4479b5[_0x23be('0x2f')][_0x23be('0x3b')]){_0x81bdf8[_0x23be('0x3c')]=_[_0x23be('0x3d')](_0x81bdf8[_0x23be('0x3c')],{'$or':_[_0x23be('0x2b')](_0x81bdf8[_0x23be('0x35')],function(_0x1cdb73){var _0x57006c={};_0x57006c[_0x1cdb73]={'$like':'%'+_0x4479b5[_0x23be('0x2f')][_0x23be('0x3b')]+'%'};return _0x57006c;})});}_0x81bdf8=_[_0x23be('0x3d')]({},_0x81bdf8,_0x4479b5[_0x23be('0x3f')]);return _0x439631[_0x23be('0x4d')](_0x81bdf8);}})['then'](function(_0x13fcd1){if(_0x13fcd1){_0x4d05c6=_0x13fcd1[_0x23be('0x36')];if(!_0x4479b5[_0x23be('0x2f')]['hasOwnProperty']('nolimit')){_0x81bdf8[_0x23be('0x1e')]=qs[_0x23be('0x1e')](_0x4479b5[_0x23be('0x2f')][_0x23be('0x1e')]);_0x81bdf8[_0x23be('0x1b')]=qs[_0x23be('0x1b')](_0x4479b5['query']['offset']);}return _0x439631[_0x23be('0x4d')](_0x81bdf8);}})[_0x23be('0x24')](function(_0x38fb69){if(_0x38fb69){return _0x38fb69?{'count':_0x4d05c6,'rows':_0x38fb69}:null;}})[_0x23be('0x24')](respondWithResult(_0x32e8a5,null))['catch'](handleError(_0x32e8a5,null));};exports[_0x23be('0x4f')]=function(_0x347d6c,_0x9c8615,_0x488628){var _0x2bfd59={};var _0x3fcc67={};var _0x4360a6;var _0x2742e6;return db['ZohoConfiguration'][_0x23be('0x4e')]({'where':{'id':_0x347d6c[_0x23be('0x49')]['id']}})[_0x23be('0x24')](handleEntityNotFound(_0x9c8615,null))['then'](function(_0x4156bb){if(_0x4156bb){_0x4360a6=_0x4156bb;_0x3fcc67[_0x23be('0x33')]=_[_0x23be('0x30')](db[_0x23be('0x4b')][_0x23be('0x2c')]);_0x3fcc67[_0x23be('0x2f')]=_[_0x23be('0x30')](_0x347d6c[_0x23be('0x2f')]);_0x3fcc67[_0x23be('0x31')]=_[_0x23be('0x32')](_0x3fcc67[_0x23be('0x33')],_0x3fcc67[_0x23be('0x2f')]);_0x2bfd59[_0x23be('0x35')]=_[_0x23be('0x32')](_0x3fcc67['model'],qs[_0x23be('0x34')](_0x347d6c[_0x23be('0x2f')][_0x23be('0x34')]));_0x2bfd59[_0x23be('0x35')]=_0x2bfd59[_0x23be('0x35')][_0x23be('0x36')]?_0x2bfd59['attributes']:_0x3fcc67['model'];_0x2bfd59['order']=qs[_0x23be('0x39')](_0x347d6c[_0x23be('0x2f')][_0x23be('0x39')]);_0x2bfd59[_0x23be('0x3c')]=qs[_0x23be('0x31')](_[_0x23be('0x3a')](_0x347d6c[_0x23be('0x2f')],_0x3fcc67['filters']));if(_0x347d6c[_0x23be('0x2f')][_0x23be('0x3b')]){_0x2bfd59['where']=_[_0x23be('0x3d')](_0x2bfd59[_0x23be('0x3c')],{'$or':_[_0x23be('0x2b')](_0x2bfd59[_0x23be('0x35')],function(_0x27c87b){var _0x1fc577={};_0x1fc577[_0x27c87b]={'$like':'%'+_0x347d6c['query'][_0x23be('0x3b')]+'%'};return _0x1fc577;})});}_0x2bfd59=_[_0x23be('0x3d')]({},_0x2bfd59,_0x347d6c[_0x23be('0x3f')]);return _0x4360a6['getDescriptions'](_0x2bfd59);}})[_0x23be('0x24')](function(_0x1d3187){if(_0x1d3187){_0x2742e6=_0x1d3187[_0x23be('0x36')];if(!_0x347d6c['query'][_0x23be('0x4c')]('nolimit')){_0x2bfd59[_0x23be('0x1e')]=qs['limit'](_0x347d6c[_0x23be('0x2f')][_0x23be('0x1e')]);_0x2bfd59[_0x23be('0x1b')]=qs['offset'](_0x347d6c[_0x23be('0x2f')][_0x23be('0x1b')]);}return _0x4360a6[_0x23be('0x4f')](_0x2bfd59);}})[_0x23be('0x24')](function(_0x5c3e2a){if(_0x5c3e2a){return _0x5c3e2a?{'count':_0x2742e6,'rows':_0x5c3e2a}:null;}})[_0x23be('0x24')](respondWithResult(_0x9c8615,null))[_0x23be('0x44')](handleError(_0x9c8615,null));}; \ No newline at end of file +var _0xce9e=['where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','keys','options','find','create','body','getFields','findOne','order','getSubjects','ZohoField','getDescriptions','eml-format','zip-dir','fast-json-patch','moment','mustache','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','limit','undefined','count','offset','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ZohoConfiguration','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort'];(function(_0x598cb7,_0x379c4b){var _0x2f7f42=function(_0x2814bf){while(--_0x2814bf){_0x598cb7['push'](_0x598cb7['shift']());}};_0x2f7f42(++_0x379c4b);}(_0xce9e,0x14e));var _0xece9=function(_0x1d2ca4,_0x469af6){_0x1d2ca4=_0x1d2ca4-0x0;var _0x35398a=_0xce9e[_0x1d2ca4];return _0x35398a;};'use strict';var emlformat=require(_0xece9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xece9('0x1'));var jsonpatch=require(_0xece9('0x2'));var rp=require('request-promise');var moment=require(_0xece9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xece9('0x4'));var util=require(_0xece9('0x5'));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(_0xece9('0x6'));var _=require(_0xece9('0x7'));var squel=require(_0xece9('0x8'));var crypto=require(_0xece9('0x9'));var jsforce=require(_0xece9('0xa'));var deskjs=require(_0xece9('0xb'));var toCsv=require(_0xece9('0xc'));var querystring=require(_0xece9('0xd'));var Papa=require(_0xece9('0xe'));var Redis=require('ioredis');var authService=require(_0xece9('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xece9('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xece9('0x11'))('api');var utils=require(_0xece9('0x12'));var config=require(_0xece9('0x13'));var licenseUtil=require(_0xece9('0x14'));var db=require(_0xece9('0x15'))['db'];function respondWithStatusCode(_0x211ea0,_0x4825bc){_0x4825bc=_0x4825bc||0xcc;return function(_0xa0d48a){if(_0xa0d48a){return _0x211ea0[_0xece9('0x16')](_0x4825bc);}return _0x211ea0['status'](_0x4825bc)[_0xece9('0x17')]();};}function respondWithResult(_0x4c3b06,_0x16a1f2){_0x16a1f2=_0x16a1f2||0xc8;return function(_0x37627e){if(_0x37627e){return _0x4c3b06[_0xece9('0x18')](_0x16a1f2)['json'](_0x37627e);}};}function respondWithFilteredResult(_0x382a91,_0x2c1c09){return function(_0x1732e0){if(_0x1732e0){var _0x153593=typeof _0x2c1c09['offset']==='undefined'&&typeof _0x2c1c09[_0xece9('0x19')]===_0xece9('0x1a');var _0xd1199=_0x1732e0[_0xece9('0x1b')];var _0x2bca27=_0x153593?0x0:_0x2c1c09[_0xece9('0x1c')];var _0x198145=_0x153593?_0x1732e0['count']:_0x2c1c09['offset']+_0x2c1c09[_0xece9('0x19')];var _0x5a4fa7;if(_0x198145>=_0xd1199){_0x198145=_0xd1199;_0x5a4fa7=0xc8;}else{_0x5a4fa7=0xce;}_0x382a91[_0xece9('0x18')](_0x5a4fa7);return _0x382a91['set']('Content-Range',_0x2bca27+'-'+_0x198145+'/'+_0xd1199)[_0xece9('0x1d')](_0x1732e0);}return null;};}function patchUpdates(_0x25f84a){return function(_0x26eb9e){try{jsonpatch[_0xece9('0x1e')](_0x26eb9e,_0x25f84a,!![]);}catch(_0x56ef82){return BPromise[_0xece9('0x1f')](_0x56ef82);}return _0x26eb9e[_0xece9('0x20')]();};}function saveUpdates(_0x1c6b70,_0x4e8b22){return function(_0x3a52d3){if(_0x3a52d3){return _0x3a52d3[_0xece9('0x21')](_0x1c6b70)[_0xece9('0x22')](function(_0x48d333){return _0x48d333;});}return null;};}function removeEntity(_0x22f186,_0xd42dc2){return function(_0x1acc26){if(_0x1acc26){return _0x1acc26[_0xece9('0x23')]()[_0xece9('0x22')](function(){_0x22f186['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x835236,_0x18831a){return function(_0x1a0129){if(!_0x1a0129){_0x835236[_0xece9('0x16')](0x194);}return _0x1a0129;};}function handleError(_0x253d69,_0x247ac4){_0x247ac4=_0x247ac4||0x1f4;return function(_0x4c0b78){logger[_0xece9('0x24')](_0x4c0b78[_0xece9('0x25')]);if(_0x4c0b78[_0xece9('0x26')]){delete _0x4c0b78[_0xece9('0x26')];}_0x253d69[_0xece9('0x18')](_0x247ac4)[_0xece9('0x27')](_0x4c0b78);};}exports[_0xece9('0x28')]=function(_0x502dcb,_0x24f7e8){var _0x2d539a={},_0x1a1708={},_0x18b00f={'count':0x0,'rows':[]};var _0x4f5d24=_[_0xece9('0x29')](db[_0xece9('0x2a')][_0xece9('0x2b')],function(_0x1c461b){return{'name':_0x1c461b[_0xece9('0x2c')],'type':_0x1c461b['type'][_0xece9('0x2d')]};});_0x1a1708[_0xece9('0x2e')]=_[_0xece9('0x29')](_0x4f5d24,_0xece9('0x26'));_0x1a1708[_0xece9('0x2f')]=_['keys'](_0x502dcb[_0xece9('0x2f')]);_0x1a1708[_0xece9('0x30')]=_[_0xece9('0x31')](_0x1a1708[_0xece9('0x2e')],_0x1a1708[_0xece9('0x2f')]);_0x2d539a[_0xece9('0x32')]=_[_0xece9('0x31')](_0x1a1708[_0xece9('0x2e')],qs[_0xece9('0x33')](_0x502dcb[_0xece9('0x2f')]['fields']));_0x2d539a[_0xece9('0x32')]=_0x2d539a[_0xece9('0x32')][_0xece9('0x34')]?_0x2d539a[_0xece9('0x32')]:_0x1a1708[_0xece9('0x2e')];if(!_0x502dcb[_0xece9('0x2f')][_0xece9('0x35')](_0xece9('0x36'))){_0x2d539a[_0xece9('0x19')]=qs[_0xece9('0x19')](_0x502dcb[_0xece9('0x2f')][_0xece9('0x19')]);_0x2d539a[_0xece9('0x1c')]=qs[_0xece9('0x1c')](_0x502dcb[_0xece9('0x2f')][_0xece9('0x1c')]);}_0x2d539a['order']=qs[_0xece9('0x37')](_0x502dcb[_0xece9('0x2f')]['sort']);_0x2d539a[_0xece9('0x38')]=qs['filters'](_[_0xece9('0x39')](_0x502dcb['query'],_0x1a1708[_0xece9('0x30')]),_0x4f5d24);if(_0x502dcb[_0xece9('0x2f')][_0xece9('0x3a')]){_0x2d539a[_0xece9('0x38')]=_[_0xece9('0x3b')](_0x2d539a['where'],{'$or':_[_0xece9('0x29')](_0x4f5d24,function(_0xd9beab){if(_0xd9beab['type']!==_0xece9('0x3c')){var _0x5b2b95={};_0x5b2b95[_0xd9beab[_0xece9('0x26')]]={'$like':'%'+_0x502dcb['query'][_0xece9('0x3a')]+'%'};return _0x5b2b95;}})});}_0x2d539a=_[_0xece9('0x3b')]({},_0x2d539a,_0x502dcb['options']);var _0x49fdc9={'where':_0x2d539a[_0xece9('0x38')]};return db[_0xece9('0x2a')][_0xece9('0x1b')](_0x49fdc9)[_0xece9('0x22')](function(_0xf9f0d){_0x18b00f[_0xece9('0x1b')]=_0xf9f0d;if(_0x502dcb[_0xece9('0x2f')][_0xece9('0x3d')]){_0x2d539a[_0xece9('0x3e')]=[{'all':!![]}];}return db['ZohoConfiguration'][_0xece9('0x3f')](_0x2d539a);})['then'](function(_0x24ac44){_0x18b00f[_0xece9('0x40')]=_0x24ac44;return _0x18b00f;})[_0xece9('0x22')](respondWithFilteredResult(_0x24f7e8,_0x2d539a))[_0xece9('0x41')](handleError(_0x24f7e8,null));};exports['show']=function(_0x402d74,_0x342cd5){var _0x408940={'raw':![],'where':{'id':_0x402d74[_0xece9('0x42')]['id']}},_0xbb5515={};_0xbb5515[_0xece9('0x2e')]=_[_0xece9('0x43')](db[_0xece9('0x2a')][_0xece9('0x2b')]);_0xbb5515[_0xece9('0x2f')]=_[_0xece9('0x43')](_0x402d74[_0xece9('0x2f')]);_0xbb5515[_0xece9('0x30')]=_[_0xece9('0x31')](_0xbb5515[_0xece9('0x2e')],_0xbb5515['query']);_0x408940[_0xece9('0x32')]=_[_0xece9('0x31')](_0xbb5515[_0xece9('0x2e')],qs['fields'](_0x402d74[_0xece9('0x2f')][_0xece9('0x33')]));_0x408940[_0xece9('0x32')]=_0x408940[_0xece9('0x32')][_0xece9('0x34')]?_0x408940[_0xece9('0x32')]:_0xbb5515[_0xece9('0x2e')];if(_0x402d74[_0xece9('0x2f')][_0xece9('0x3d')]){_0x408940[_0xece9('0x3e')]=[{'all':!![]}];}_0x408940=_[_0xece9('0x3b')]({},_0x408940,_0x402d74[_0xece9('0x44')]);return db[_0xece9('0x2a')][_0xece9('0x45')](_0x408940)[_0xece9('0x22')](handleEntityNotFound(_0x342cd5,null))['then'](respondWithResult(_0x342cd5,null))['catch'](handleError(_0x342cd5,null));};exports['create']=function(_0x451d4a,_0x4ba76a){return db[_0xece9('0x2a')][_0xece9('0x46')](_0x451d4a[_0xece9('0x47')],{})[_0xece9('0x22')](respondWithResult(_0x4ba76a,0xc9))[_0xece9('0x41')](handleError(_0x4ba76a,null));};exports[_0xece9('0x21')]=function(_0x3c5cde,_0x997fe5){if(_0x3c5cde[_0xece9('0x47')]['id']){delete _0x3c5cde[_0xece9('0x47')]['id'];}return db[_0xece9('0x2a')][_0xece9('0x45')]({'where':{'id':_0x3c5cde[_0xece9('0x42')]['id']}})[_0xece9('0x22')](handleEntityNotFound(_0x997fe5,null))['then'](saveUpdates(_0x3c5cde['body'],null))[_0xece9('0x22')](respondWithResult(_0x997fe5,null))[_0xece9('0x41')](handleError(_0x997fe5,null));};exports[_0xece9('0x23')]=function(_0x5c65a7,_0x226d5f){return db[_0xece9('0x2a')][_0xece9('0x45')]({'where':{'id':_0x5c65a7['params']['id']}})[_0xece9('0x22')](handleEntityNotFound(_0x226d5f,null))[_0xece9('0x22')](removeEntity(_0x226d5f,null))[_0xece9('0x41')](handleError(_0x226d5f,null));};exports[_0xece9('0x48')]=function(_0x3d553e,_0x54513c,_0x16e485){var _0x538605={};var _0x243461={};var _0x312c34;var _0x6447ad;return db[_0xece9('0x2a')][_0xece9('0x49')]({'where':{'id':_0x3d553e[_0xece9('0x42')]['id']}})[_0xece9('0x22')](handleEntityNotFound(_0x54513c,null))[_0xece9('0x22')](function(_0xb60c9){if(_0xb60c9){_0x312c34=_0xb60c9;_0x243461[_0xece9('0x2e')]=_['keys'](db['ZohoField'][_0xece9('0x2b')]);_0x243461[_0xece9('0x2f')]=_[_0xece9('0x43')](_0x3d553e['query']);_0x243461['filters']=_[_0xece9('0x31')](_0x243461['model'],_0x243461[_0xece9('0x2f')]);_0x538605[_0xece9('0x32')]=_[_0xece9('0x31')](_0x243461[_0xece9('0x2e')],qs[_0xece9('0x33')](_0x3d553e[_0xece9('0x2f')][_0xece9('0x33')]));_0x538605[_0xece9('0x32')]=_0x538605[_0xece9('0x32')][_0xece9('0x34')]?_0x538605[_0xece9('0x32')]:_0x243461[_0xece9('0x2e')];_0x538605[_0xece9('0x4a')]=qs[_0xece9('0x37')](_0x3d553e[_0xece9('0x2f')][_0xece9('0x37')]);_0x538605['where']=qs[_0xece9('0x30')](_[_0xece9('0x39')](_0x3d553e['query'],_0x243461[_0xece9('0x30')]));if(_0x3d553e[_0xece9('0x2f')][_0xece9('0x3a')]){_0x538605[_0xece9('0x38')]=_[_0xece9('0x3b')](_0x538605[_0xece9('0x38')],{'$or':_[_0xece9('0x29')](_0x538605[_0xece9('0x32')],function(_0x221d79){var _0x54b3a5={};_0x54b3a5[_0x221d79]={'$like':'%'+_0x3d553e['query'][_0xece9('0x3a')]+'%'};return _0x54b3a5;})});}_0x538605=_[_0xece9('0x3b')]({},_0x538605,_0x3d553e[_0xece9('0x44')]);return _0x312c34['getFields'](_0x538605);}})[_0xece9('0x22')](function(_0x1950f4){if(_0x1950f4){_0x6447ad=_0x1950f4[_0xece9('0x34')];if(!_0x3d553e[_0xece9('0x2f')][_0xece9('0x35')](_0xece9('0x36'))){_0x538605['limit']=qs[_0xece9('0x19')](_0x3d553e['query']['limit']);_0x538605[_0xece9('0x1c')]=qs['offset'](_0x3d553e['query'][_0xece9('0x1c')]);}return _0x312c34[_0xece9('0x48')](_0x538605);}})[_0xece9('0x22')](function(_0x461072){if(_0x461072){return _0x461072?{'count':_0x6447ad,'rows':_0x461072}:null;}})[_0xece9('0x22')](respondWithResult(_0x54513c,null))[_0xece9('0x41')](handleError(_0x54513c,null));};exports['getSubjects']=function(_0x3349cd,_0x243cd0,_0x4b8652){var _0x974b5c={};var _0x2e6b4d={};var _0x5c399e;var _0x2280a9;return db['ZohoConfiguration'][_0xece9('0x49')]({'where':{'id':_0x3349cd[_0xece9('0x42')]['id']}})['then'](handleEntityNotFound(_0x243cd0,null))[_0xece9('0x22')](function(_0x3a7928){if(_0x3a7928){_0x5c399e=_0x3a7928;_0x2e6b4d['model']=_['keys'](db['ZohoField']['rawAttributes']);_0x2e6b4d[_0xece9('0x2f')]=_[_0xece9('0x43')](_0x3349cd[_0xece9('0x2f')]);_0x2e6b4d['filters']=_[_0xece9('0x31')](_0x2e6b4d[_0xece9('0x2e')],_0x2e6b4d[_0xece9('0x2f')]);_0x974b5c['attributes']=_['intersection'](_0x2e6b4d[_0xece9('0x2e')],qs[_0xece9('0x33')](_0x3349cd['query'][_0xece9('0x33')]));_0x974b5c[_0xece9('0x32')]=_0x974b5c[_0xece9('0x32')][_0xece9('0x34')]?_0x974b5c[_0xece9('0x32')]:_0x2e6b4d[_0xece9('0x2e')];_0x974b5c[_0xece9('0x4a')]=qs[_0xece9('0x37')](_0x3349cd[_0xece9('0x2f')][_0xece9('0x37')]);_0x974b5c[_0xece9('0x38')]=qs[_0xece9('0x30')](_[_0xece9('0x39')](_0x3349cd[_0xece9('0x2f')],_0x2e6b4d[_0xece9('0x30')]));if(_0x3349cd[_0xece9('0x2f')][_0xece9('0x3a')]){_0x974b5c[_0xece9('0x38')]=_[_0xece9('0x3b')](_0x974b5c[_0xece9('0x38')],{'$or':_['map'](_0x974b5c[_0xece9('0x32')],function(_0x297a36){var _0x5acfa4={};_0x5acfa4[_0x297a36]={'$like':'%'+_0x3349cd[_0xece9('0x2f')][_0xece9('0x3a')]+'%'};return _0x5acfa4;})});}_0x974b5c=_[_0xece9('0x3b')]({},_0x974b5c,_0x3349cd['options']);return _0x5c399e[_0xece9('0x4b')](_0x974b5c);}})[_0xece9('0x22')](function(_0x314b97){if(_0x314b97){_0x2280a9=_0x314b97['length'];if(!_0x3349cd[_0xece9('0x2f')][_0xece9('0x35')](_0xece9('0x36'))){_0x974b5c[_0xece9('0x19')]=qs[_0xece9('0x19')](_0x3349cd['query']['limit']);_0x974b5c[_0xece9('0x1c')]=qs[_0xece9('0x1c')](_0x3349cd[_0xece9('0x2f')][_0xece9('0x1c')]);}return _0x5c399e['getSubjects'](_0x974b5c);}})['then'](function(_0x3d930e){if(_0x3d930e){return _0x3d930e?{'count':_0x2280a9,'rows':_0x3d930e}:null;}})[_0xece9('0x22')](respondWithResult(_0x243cd0,null))['catch'](handleError(_0x243cd0,null));};exports['getDescriptions']=function(_0x5e85eb,_0x356af1,_0x4d428f){var _0x2cf0be={};var _0x27ec52={};var _0x4a280e;var _0x40ef28;return db[_0xece9('0x2a')][_0xece9('0x49')]({'where':{'id':_0x5e85eb[_0xece9('0x42')]['id']}})[_0xece9('0x22')](handleEntityNotFound(_0x356af1,null))[_0xece9('0x22')](function(_0x234588){if(_0x234588){_0x4a280e=_0x234588;_0x27ec52[_0xece9('0x2e')]=_['keys'](db[_0xece9('0x4c')]['rawAttributes']);_0x27ec52[_0xece9('0x2f')]=_[_0xece9('0x43')](_0x5e85eb['query']);_0x27ec52[_0xece9('0x30')]=_[_0xece9('0x31')](_0x27ec52['model'],_0x27ec52['query']);_0x2cf0be[_0xece9('0x32')]=_[_0xece9('0x31')](_0x27ec52[_0xece9('0x2e')],qs['fields'](_0x5e85eb[_0xece9('0x2f')]['fields']));_0x2cf0be[_0xece9('0x32')]=_0x2cf0be[_0xece9('0x32')]['length']?_0x2cf0be['attributes']:_0x27ec52[_0xece9('0x2e')];_0x2cf0be['order']=qs[_0xece9('0x37')](_0x5e85eb[_0xece9('0x2f')]['sort']);_0x2cf0be[_0xece9('0x38')]=qs[_0xece9('0x30')](_[_0xece9('0x39')](_0x5e85eb[_0xece9('0x2f')],_0x27ec52['filters']));if(_0x5e85eb[_0xece9('0x2f')][_0xece9('0x3a')]){_0x2cf0be[_0xece9('0x38')]=_[_0xece9('0x3b')](_0x2cf0be[_0xece9('0x38')],{'$or':_['map'](_0x2cf0be[_0xece9('0x32')],function(_0x42fdb9){var _0x11fbd6={};_0x11fbd6[_0x42fdb9]={'$like':'%'+_0x5e85eb[_0xece9('0x2f')]['filter']+'%'};return _0x11fbd6;})});}_0x2cf0be=_['merge']({},_0x2cf0be,_0x5e85eb[_0xece9('0x44')]);return _0x4a280e[_0xece9('0x4d')](_0x2cf0be);}})['then'](function(_0x20d515){if(_0x20d515){_0x40ef28=_0x20d515[_0xece9('0x34')];if(!_0x5e85eb[_0xece9('0x2f')]['hasOwnProperty'](_0xece9('0x36'))){_0x2cf0be[_0xece9('0x19')]=qs[_0xece9('0x19')](_0x5e85eb['query'][_0xece9('0x19')]);_0x2cf0be[_0xece9('0x1c')]=qs[_0xece9('0x1c')](_0x5e85eb[_0xece9('0x2f')][_0xece9('0x1c')]);}return _0x4a280e[_0xece9('0x4d')](_0x2cf0be);}})[_0xece9('0x22')](function(_0x5cde51){if(_0x5cde51){return _0x5cde51?{'count':_0x40ef28,'rows':_0x5cde51}:null;}})[_0xece9('0x22')](respondWithResult(_0x356af1,null))['catch'](handleError(_0x356af1,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index e825a91..7532073 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 _0x39db=['path','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x39db,0x14c));var _0xb39d=function(_0x363b81,_0x81e6ca){_0x363b81=_0x363b81-0x0;var _0x1d92fb=_0x39db[_0x363b81];return _0x1d92fb;};'use strict';var _=require(_0xb39d('0x0'));var util=require('util');var logger=require(_0xb39d('0x1'))(_0xb39d('0x2'));var moment=require(_0xb39d('0x3'));var BPromise=require(_0xb39d('0x4'));var rp=require(_0xb39d('0x5'));var fs=require('fs');var path=require(_0xb39d('0x6'));var rimraf=require('rimraf');var config=require(_0xb39d('0x7'));var attributes=require(_0xb39d('0x8'));module[_0xb39d('0x9')]=function(_0x118b03,_0x3623b1){return _0x118b03[_0xb39d('0xa')](_0xb39d('0xb'),attributes,{'tableName':_0xb39d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb0e2=['bluebird','rimraf','../../config/environment','./intZohoConfiguration.attributes','define','ZohoConfiguration','int_zoho_configurations','lodash','util','moment'];(function(_0x949f6,_0x50baac){var _0x4525d5=function(_0x17be77){while(--_0x17be77){_0x949f6['push'](_0x949f6['shift']());}};_0x4525d5(++_0x50baac);}(_0xb0e2,0x16f));var _0x2b0e=function(_0x32edef,_0x55b9a0){_0x32edef=_0x32edef-0x0;var _0x2c3a88=_0xb0e2[_0x32edef];return _0x2c3a88;};'use strict';var _=require(_0x2b0e('0x0'));var util=require(_0x2b0e('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2b0e('0x2'));var BPromise=require(_0x2b0e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2b0e('0x4'));var config=require(_0x2b0e('0x5'));var attributes=require(_0x2b0e('0x6'));module['exports']=function(_0x44d0d0,_0x4629e5){return _0x44d0d0[_0x2b0e('0x7')](_0x2b0e('0x8'),attributes,{'tableName':_0x2b0e('0x9'),'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 2e1699a..aedff5b 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 _0x060d=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash'];(function(_0x3df9dd,_0x26f5cd){var _0x4f11e4=function(_0x1993fe){while(--_0x1993fe){_0x3df9dd['push'](_0x3df9dd['shift']());}};_0x4f11e4(++_0x26f5cd);}(_0x060d,0xd1));var _0xd060=function(_0x547fb7,_0x24cf61){_0x547fb7=_0x547fb7-0x0;var _0x3bb9af=_0x060d[_0x547fb7];return _0x3bb9af;};'use strict';var _=require(_0xd060('0x0'));var util=require(_0xd060('0x1'));var moment=require(_0xd060('0x2'));var BPromise=require(_0xd060('0x3'));var rs=require(_0xd060('0x4'));var fs=require('fs');var Redis=require(_0xd060('0x5'));var db=require(_0xd060('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd060('0x7'));var config=require(_0xd060('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd060('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ccca4,_0x53f3c0,_0x46a844){return new BPromise(function(_0x2f740f,_0x429402){return client[_0xd060('0xa')](_0x2ccca4,_0x46a844)[_0xd060('0xb')](function(_0x5e3c34){logger[_0xd060('0xc')](_0xd060('0xd'),_0x53f3c0,'request\x20sent');logger[_0xd060('0xe')](_0xd060('0xf'),_0x53f3c0,'request\x20sent',JSON[_0xd060('0x10')](_0x5e3c34));if(_0x5e3c34[_0xd060('0x11')]){if(_0x5e3c34['error'][_0xd060('0x12')]===0x1f4){logger[_0xd060('0x11')](_0xd060('0xd'),_0x53f3c0,_0x5e3c34[_0xd060('0x11')]['message']);return _0x429402(_0x5e3c34[_0xd060('0x11')][_0xd060('0x13')]);}logger[_0xd060('0x11')](_0xd060('0xd'),_0x53f3c0,_0x5e3c34['error'][_0xd060('0x13')]);return _0x2f740f(_0x5e3c34[_0xd060('0x11')][_0xd060('0x13')]);}else{logger[_0xd060('0xc')](_0xd060('0xd'),_0x53f3c0,'request\x20sent');_0x2f740f(_0x5e3c34['result'][_0xd060('0x13')]);}})[_0xd060('0x14')](function(_0x3ce5ee){logger[_0xd060('0x11')](_0xd060('0xd'),_0x53f3c0,_0x3ce5ee);_0x429402(_0x3ce5ee);});});} \ No newline at end of file +var _0xf031=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','message','ZohoConfiguration,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x546c82,_0x1f0998){var _0x598e2a=function(_0x517ce5){while(--_0x517ce5){_0x546c82['push'](_0x546c82['shift']());}};_0x598e2a(++_0x1f0998);}(_0xf031,0x1dd));var _0x1f03=function(_0x1de822,_0x5c585e){_0x1de822=_0x1de822-0x0;var _0x3f35a7=_0xf031[_0x1de822];return _0x3f35a7;};'use strict';var _=require(_0x1f03('0x0'));var util=require(_0x1f03('0x1'));var moment=require(_0x1f03('0x2'));var BPromise=require(_0x1f03('0x3'));var rs=require(_0x1f03('0x4'));var fs=require('fs');var Redis=require(_0x1f03('0x5'));var db=require(_0x1f03('0x6'))['db'];var utils=require(_0x1f03('0x7'));var logger=require(_0x1f03('0x8'))(_0x1f03('0x9'));var config=require(_0x1f03('0xa'));var jayson=require(_0x1f03('0xb'));var client=jayson['client'][_0x1f03('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4103ba,_0xf89e85,_0x1a64e6){return new BPromise(function(_0x3fa1a4,_0x2074f1){return client[_0x1f03('0xd')](_0x4103ba,_0x1a64e6)['then'](function(_0x24486b){logger[_0x1f03('0xe')]('ZohoConfiguration,\x20%s,\x20%s',_0xf89e85,'request\x20sent');logger[_0x1f03('0xf')](_0x1f03('0x10'),_0xf89e85,'request\x20sent',JSON['stringify'](_0x24486b));if(_0x24486b['error']){if(_0x24486b[_0x1f03('0x11')]['code']===0x1f4){logger[_0x1f03('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0xf89e85,_0x24486b[_0x1f03('0x11')][_0x1f03('0x12')]);return _0x2074f1(_0x24486b[_0x1f03('0x11')][_0x1f03('0x12')]);}logger[_0x1f03('0x11')](_0x1f03('0x13'),_0xf89e85,_0x24486b[_0x1f03('0x11')]['message']);return _0x3fa1a4(_0x24486b['error'][_0x1f03('0x12')]);}else{logger[_0x1f03('0xe')](_0x1f03('0x13'),_0xf89e85,'request\x20sent');_0x3fa1a4(_0x24486b[_0x1f03('0x14')][_0x1f03('0x12')]);}})[_0x1f03('0x15')](function(_0x1e084d){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0xf89e85,_0x1e084d);_0x2074f1(_0x1e084d);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 7a60dac..c7a969d 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 _0xa04e=['index','show','post','create','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intZohoField.controller','get','isAuthenticated'];(function(_0x188f0e,_0x1f1ee6){var _0x285463=function(_0x6c280d){while(--_0x6c280d){_0x188f0e['push'](_0x188f0e['shift']());}};_0x285463(++_0x1f1ee6);}(_0xa04e,0x1aa));var _0xea04=function(_0x764704,_0x5913b6){_0x764704=_0x764704-0x0;var _0x554f1e=_0xa04e[_0x764704];return _0x554f1e;};'use strict';var multer=require(_0xea04('0x0'));var util=require(_0xea04('0x1'));var path=require(_0xea04('0x2'));var timeout=require(_0xea04('0x3'));var express=require(_0xea04('0x4'));var router=express['Router']();var fs_extra=require(_0xea04('0x5'));var auth=require(_0xea04('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xea04('0x7'));var controller=require(_0xea04('0x8'));router[_0xea04('0x9')]('/',auth[_0xea04('0xa')](),controller[_0xea04('0xb')]);router[_0xea04('0x9')]('/:id',auth[_0xea04('0xa')](),controller[_0xea04('0xc')]);router[_0xea04('0xd')]('/',auth[_0xea04('0xa')](),controller[_0xea04('0xe')]);router['put'](_0xea04('0xf'),auth['isAuthenticated'](),controller['update']);router[_0xea04('0x10')](_0xea04('0xf'),auth['isAuthenticated'](),controller[_0xea04('0x11')]);module[_0xea04('0x12')]=router; \ No newline at end of file +var _0x0aa6=['update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','isAuthenticated','get','show','create','/:id'];(function(_0x16b860,_0x42a1a7){var _0x5b6524=function(_0x2f9961){while(--_0x2f9961){_0x16b860['push'](_0x16b860['shift']());}};_0x5b6524(++_0x42a1a7);}(_0x0aa6,0x1d8));var _0x60aa=function(_0xf7d13b,_0x20bf3b){_0xf7d13b=_0xf7d13b-0x0;var _0x3aca5f=_0x0aa6[_0xf7d13b];return _0x3aca5f;};'use strict';var multer=require(_0x60aa('0x0'));var util=require(_0x60aa('0x1'));var path=require(_0x60aa('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x60aa('0x3')]();var fs_extra=require(_0x60aa('0x4'));var auth=require(_0x60aa('0x5'));var interaction=require(_0x60aa('0x6'));var config=require(_0x60aa('0x7'));var controller=require(_0x60aa('0x8'));router['get']('/',auth[_0x60aa('0x9')](),controller['index']);router[_0x60aa('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x60aa('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x60aa('0xc')]);router['put'](_0x60aa('0xd'),auth['isAuthenticated'](),controller[_0x60aa('0xe')]);router[_0x60aa('0xf')](_0x60aa('0xd'),auth[_0x60aa('0x9')](),controller[_0x60aa('0x10')]);module[_0x60aa('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 39530e1..6ba63a3 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 _0xf69b=['customVariable','keyValue','STRING','BOOLEAN','exports','ENUM','string'];(function(_0x356599,_0x115fed){var _0x4b5abc=function(_0x53d615){while(--_0x53d615){_0x356599['push'](_0x356599['shift']());}};_0x4b5abc(++_0x115fed);}(_0xf69b,0xd6));var _0xbf69=function(_0x3bddc9,_0x2a40f0){_0x3bddc9=_0x3bddc9-0x0;var _0x3ac6dc=_0xf69b[_0x3bddc9];return _0x3ac6dc;};'use strict';var Sequelize=require('sequelize');module[_0xbf69('0x0')]={'type':{'type':Sequelize[_0xbf69('0x1')](_0xbf69('0x2'),'variable',_0xbf69('0x3'),_0xbf69('0x4'),'picklist'),'defaultValue':_0xbf69('0x2')},'content':{'type':Sequelize[_0xbf69('0x5')]},'key':{'type':Sequelize[_0xbf69('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0xbf69('0x2'),'variable',_0xbf69('0x3'))},'keyContent':{'type':Sequelize[_0xbf69('0x5')]},'idField':{'type':Sequelize[_0xbf69('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xbf69('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xffb4=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x2f2360,_0x151089){var _0x1cc8d3=function(_0x5e356f){while(--_0x5e356f){_0x2f2360['push'](_0x2f2360['shift']());}};_0x1cc8d3(++_0x151089);}(_0xffb4,0x156));var _0x4ffb=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0xffb4[_0x243b59];return _0x3e1676;};'use strict';var Sequelize=require(_0x4ffb('0x0'));module[_0x4ffb('0x1')]={'type':{'type':Sequelize[_0x4ffb('0x2')](_0x4ffb('0x3'),_0x4ffb('0x4'),_0x4ffb('0x5'),_0x4ffb('0x6'),_0x4ffb('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0x4ffb('0x8')]},'key':{'type':Sequelize[_0x4ffb('0x8')]},'keyType':{'type':Sequelize[_0x4ffb('0x2')](_0x4ffb('0x3'),_0x4ffb('0x4'),_0x4ffb('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x4ffb('0x8')]},'nameField':{'type':Sequelize[_0x4ffb('0x8')]},'customField':{'type':Sequelize[_0x4ffb('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4ffb('0x8')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 17a69ff..d887382 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 _0x756f=['type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','include','findAll','catch','params','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','json','apply','save','update','then','destroy','end','stack','name','send','ZohoField','rawAttributes','fieldName'];(function(_0x29ca3a,_0x118266){var _0x45371e=function(_0x3fe942){while(--_0x3fe942){_0x29ca3a['push'](_0x29ca3a['shift']());}};_0x45371e(++_0x118266);}(_0x756f,0x137));var _0xf756=function(_0x60ad6,_0x2dae52){_0x60ad6=_0x60ad6-0x0;var _0xe3b1fa=_0x756f[_0x60ad6];return _0xe3b1fa;};'use strict';var emlformat=require(_0xf756('0x0'));var rimraf=require(_0xf756('0x1'));var zipdir=require(_0xf756('0x2'));var jsonpatch=require(_0xf756('0x3'));var rp=require('request-promise');var moment=require(_0xf756('0x4'));var BPromise=require(_0xf756('0x5'));var Mustache=require(_0xf756('0x6'));var util=require(_0xf756('0x7'));var path=require(_0xf756('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf756('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf756('0xa'));var squel=require(_0xf756('0xb'));var crypto=require(_0xf756('0xc'));var jsforce=require(_0xf756('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf756('0xe'));var Papa=require(_0xf756('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf756('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf756('0x11'));var logger=require(_0xf756('0x12'))(_0xf756('0x13'));var utils=require(_0xf756('0x14'));var config=require(_0xf756('0x15'));var licenseUtil=require(_0xf756('0x16'));var db=require(_0xf756('0x17'))['db'];function respondWithStatusCode(_0x24e0b9,_0x43d40c){_0x43d40c=_0x43d40c||0xcc;return function(_0x3e2ce7){if(_0x3e2ce7){return _0x24e0b9[_0xf756('0x18')](_0x43d40c);}return _0x24e0b9[_0xf756('0x19')](_0x43d40c)['end']();};}function respondWithResult(_0x159436,_0x35f91d){_0x35f91d=_0x35f91d||0xc8;return function(_0x31e27e){if(_0x31e27e){return _0x159436['status'](_0x35f91d)['json'](_0x31e27e);}};}function respondWithFilteredResult(_0x560976,_0x532520){return function(_0x479e90){if(_0x479e90){var _0x4a340f=typeof _0x532520[_0xf756('0x1a')]==='undefined'&&typeof _0x532520['limit']===_0xf756('0x1b');var _0x2bcea4=_0x479e90[_0xf756('0x1c')];var _0x2b6430=_0x4a340f?0x0:_0x532520[_0xf756('0x1a')];var _0x348fdc=_0x4a340f?_0x479e90['count']:_0x532520[_0xf756('0x1a')]+_0x532520[_0xf756('0x1d')];var _0x3b32f8;if(_0x348fdc>=_0x2bcea4){_0x348fdc=_0x2bcea4;_0x3b32f8=0xc8;}else{_0x3b32f8=0xce;}_0x560976[_0xf756('0x19')](_0x3b32f8);return _0x560976[_0xf756('0x1e')]('Content-Range',_0x2b6430+'-'+_0x348fdc+'/'+_0x2bcea4)[_0xf756('0x1f')](_0x479e90);}return null;};}function patchUpdates(_0x1f481a){return function(_0x210f2e){try{jsonpatch[_0xf756('0x20')](_0x210f2e,_0x1f481a,!![]);}catch(_0x56c9d4){return BPromise['reject'](_0x56c9d4);}return _0x210f2e[_0xf756('0x21')]();};}function saveUpdates(_0x4399c7,_0x198613){return function(_0x1af286){if(_0x1af286){return _0x1af286[_0xf756('0x22')](_0x4399c7)[_0xf756('0x23')](function(_0x252112){return _0x252112;});}return null;};}function removeEntity(_0x36d62c,_0x4075b5){return function(_0x58117d){if(_0x58117d){return _0x58117d[_0xf756('0x24')]()[_0xf756('0x23')](function(){_0x36d62c[_0xf756('0x19')](0xcc)[_0xf756('0x25')]();});}};}function handleEntityNotFound(_0x22eb27,_0x126dc1){return function(_0x53cdcb){if(!_0x53cdcb){_0x22eb27[_0xf756('0x18')](0x194);}return _0x53cdcb;};}function handleError(_0x1df3ef,_0xb40b97){_0xb40b97=_0xb40b97||0x1f4;return function(_0x2fb858){logger['error'](_0x2fb858[_0xf756('0x26')]);if(_0x2fb858[_0xf756('0x27')]){delete _0x2fb858[_0xf756('0x27')];}_0x1df3ef[_0xf756('0x19')](_0xb40b97)[_0xf756('0x28')](_0x2fb858);};}exports['index']=function(_0x186a10,_0x2ad930){var _0x2da963={},_0x2d84f4={},_0x100e92={'count':0x0,'rows':[]};var _0x4fb308=_['map'](db[_0xf756('0x29')][_0xf756('0x2a')],function(_0x59266e){return{'name':_0x59266e[_0xf756('0x2b')],'type':_0x59266e[_0xf756('0x2c')][_0xf756('0x2d')]};});_0x2d84f4[_0xf756('0x2e')]=_[_0xf756('0x2f')](_0x4fb308,_0xf756('0x27'));_0x2d84f4[_0xf756('0x30')]=_[_0xf756('0x31')](_0x186a10[_0xf756('0x30')]);_0x2d84f4[_0xf756('0x32')]=_[_0xf756('0x33')](_0x2d84f4['model'],_0x2d84f4[_0xf756('0x30')]);_0x2da963['attributes']=_[_0xf756('0x33')](_0x2d84f4['model'],qs[_0xf756('0x34')](_0x186a10[_0xf756('0x30')]['fields']));_0x2da963[_0xf756('0x35')]=_0x2da963[_0xf756('0x35')][_0xf756('0x36')]?_0x2da963[_0xf756('0x35')]:_0x2d84f4[_0xf756('0x2e')];if(!_0x186a10[_0xf756('0x30')][_0xf756('0x37')](_0xf756('0x38'))){_0x2da963[_0xf756('0x1d')]=qs[_0xf756('0x1d')](_0x186a10[_0xf756('0x30')]['limit']);_0x2da963[_0xf756('0x1a')]=qs[_0xf756('0x1a')](_0x186a10[_0xf756('0x30')][_0xf756('0x1a')]);}_0x2da963['order']=qs[_0xf756('0x39')](_0x186a10[_0xf756('0x30')][_0xf756('0x39')]);_0x2da963[_0xf756('0x3a')]=qs[_0xf756('0x32')](_['pick'](_0x186a10[_0xf756('0x30')],_0x2d84f4[_0xf756('0x32')]),_0x4fb308);if(_0x186a10[_0xf756('0x30')][_0xf756('0x3b')]){_0x2da963[_0xf756('0x3a')]=_[_0xf756('0x3c')](_0x2da963[_0xf756('0x3a')],{'$or':_[_0xf756('0x2f')](_0x4fb308,function(_0x119178){if(_0x119178[_0xf756('0x2c')]!==_0xf756('0x3d')){var _0x2cf443={};_0x2cf443[_0x119178[_0xf756('0x27')]]={'$like':'%'+_0x186a10[_0xf756('0x30')][_0xf756('0x3b')]+'%'};return _0x2cf443;}})});}_0x2da963=_['merge']({},_0x2da963,_0x186a10[_0xf756('0x3e')]);var _0x35576c={'where':_0x2da963['where']};return db['ZohoField'][_0xf756('0x1c')](_0x35576c)[_0xf756('0x23')](function(_0x39f2db){_0x100e92[_0xf756('0x1c')]=_0x39f2db;if(_0x186a10[_0xf756('0x30')]['includeAll']){_0x2da963[_0xf756('0x3f')]=[{'all':!![]}];}return db[_0xf756('0x29')][_0xf756('0x40')](_0x2da963);})[_0xf756('0x23')](function(_0x2e3754){_0x100e92['rows']=_0x2e3754;return _0x100e92;})['then'](respondWithFilteredResult(_0x2ad930,_0x2da963))[_0xf756('0x41')](handleError(_0x2ad930,null));};exports['show']=function(_0x1b1a93,_0x1e1efa){var _0x4f0d8a={'raw':!![],'where':{'id':_0x1b1a93[_0xf756('0x42')]['id']}},_0xa3804d={};_0xa3804d[_0xf756('0x2e')]=_[_0xf756('0x31')](db['ZohoField'][_0xf756('0x2a')]);_0xa3804d[_0xf756('0x30')]=_[_0xf756('0x31')](_0x1b1a93['query']);_0xa3804d[_0xf756('0x32')]=_[_0xf756('0x33')](_0xa3804d['model'],_0xa3804d[_0xf756('0x30')]);_0x4f0d8a[_0xf756('0x35')]=_['intersection'](_0xa3804d[_0xf756('0x2e')],qs['fields'](_0x1b1a93['query'][_0xf756('0x34')]));_0x4f0d8a[_0xf756('0x35')]=_0x4f0d8a['attributes'][_0xf756('0x36')]?_0x4f0d8a[_0xf756('0x35')]:_0xa3804d['model'];if(_0x1b1a93['query'][_0xf756('0x43')]){_0x4f0d8a[_0xf756('0x3f')]=[{'all':!![]}];}_0x4f0d8a=_[_0xf756('0x3c')]({},_0x4f0d8a,_0x1b1a93[_0xf756('0x3e')]);return db[_0xf756('0x29')][_0xf756('0x44')](_0x4f0d8a)[_0xf756('0x23')](handleEntityNotFound(_0x1e1efa,null))['then'](respondWithResult(_0x1e1efa,null))['catch'](handleError(_0x1e1efa,null));};exports[_0xf756('0x45')]=function(_0xf70b8,_0x34365a){return db[_0xf756('0x29')][_0xf756('0x45')](_0xf70b8['body'],{})['then'](respondWithResult(_0x34365a,0xc9))[_0xf756('0x41')](handleError(_0x34365a,null));};exports['update']=function(_0x3b543a,_0x5a3ca2){if(_0x3b543a[_0xf756('0x46')]['id']){delete _0x3b543a[_0xf756('0x46')]['id'];}return db[_0xf756('0x29')]['find']({'where':{'id':_0x3b543a[_0xf756('0x42')]['id']}})[_0xf756('0x23')](handleEntityNotFound(_0x5a3ca2,null))[_0xf756('0x23')](saveUpdates(_0x3b543a['body'],null))[_0xf756('0x23')](respondWithResult(_0x5a3ca2,null))[_0xf756('0x41')](handleError(_0x5a3ca2,null));};exports['destroy']=function(_0x48d859,_0x56045b){return db[_0xf756('0x29')]['find']({'where':{'id':_0x48d859[_0xf756('0x42')]['id']}})[_0xf756('0x23')](handleEntityNotFound(_0x56045b,null))[_0xf756('0x23')](removeEntity(_0x56045b,null))[_0xf756('0x41')](handleError(_0x56045b,null));}; \ No newline at end of file +var _0x8d5a=['json','offset','count','limit','set','apply','save','update','then','error','stack','name','index','map','ZohoField','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','findAll','show','params','length','includeAll','include','find','catch','create','body','destroy','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end'];(function(_0x4c13e1,_0x3e05a0){var _0x2e90ac=function(_0x9e682f){while(--_0x9e682f){_0x4c13e1['push'](_0x4c13e1['shift']());}};_0x2e90ac(++_0x3e05a0);}(_0x8d5a,0x1d1));var _0xa8d5=function(_0x39d544,_0x35c14f){_0x39d544=_0x39d544-0x0;var _0x5a5ff2=_0x8d5a[_0x39d544];return _0x5a5ff2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa8d5('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa8d5('0x1'));var rp=require(_0xa8d5('0x2'));var moment=require('moment');var BPromise=require(_0xa8d5('0x3'));var Mustache=require(_0xa8d5('0x4'));var util=require(_0xa8d5('0x5'));var path=require(_0xa8d5('0x6'));var sox=require(_0xa8d5('0x7'));var csv=require(_0xa8d5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa8d5('0x9'));var _=require(_0xa8d5('0xa'));var squel=require(_0xa8d5('0xb'));var crypto=require(_0xa8d5('0xc'));var jsforce=require(_0xa8d5('0xd'));var deskjs=require(_0xa8d5('0xe'));var toCsv=require(_0xa8d5('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa8d5('0xf'));var as=require(_0xa8d5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa8d5('0x11'))(_0xa8d5('0x12'));var utils=require(_0xa8d5('0x13'));var config=require(_0xa8d5('0x14'));var licenseUtil=require(_0xa8d5('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5b3552,_0x36b642){_0x36b642=_0x36b642||0xcc;return function(_0x28574f){if(_0x28574f){return _0x5b3552[_0xa8d5('0x16')](_0x36b642);}return _0x5b3552[_0xa8d5('0x17')](_0x36b642)[_0xa8d5('0x18')]();};}function respondWithResult(_0x551b20,_0x412e24){_0x412e24=_0x412e24||0xc8;return function(_0x520221){if(_0x520221){return _0x551b20[_0xa8d5('0x17')](_0x412e24)[_0xa8d5('0x19')](_0x520221);}};}function respondWithFilteredResult(_0x26058b,_0xf3dd65){return function(_0x36b378){if(_0x36b378){var _0x4cc534=typeof _0xf3dd65[_0xa8d5('0x1a')]==='undefined'&&typeof _0xf3dd65['limit']==='undefined';var _0x34a4cd=_0x36b378['count'];var _0x24c39a=_0x4cc534?0x0:_0xf3dd65[_0xa8d5('0x1a')];var _0x49e02e=_0x4cc534?_0x36b378[_0xa8d5('0x1b')]:_0xf3dd65[_0xa8d5('0x1a')]+_0xf3dd65[_0xa8d5('0x1c')];var _0x5d4010;if(_0x49e02e>=_0x34a4cd){_0x49e02e=_0x34a4cd;_0x5d4010=0xc8;}else{_0x5d4010=0xce;}_0x26058b[_0xa8d5('0x17')](_0x5d4010);return _0x26058b[_0xa8d5('0x1d')]('Content-Range',_0x24c39a+'-'+_0x49e02e+'/'+_0x34a4cd)[_0xa8d5('0x19')](_0x36b378);}return null;};}function patchUpdates(_0xf713c1){return function(_0x54fc58){try{jsonpatch[_0xa8d5('0x1e')](_0x54fc58,_0xf713c1,!![]);}catch(_0x4a8b40){return BPromise['reject'](_0x4a8b40);}return _0x54fc58[_0xa8d5('0x1f')]();};}function saveUpdates(_0x360f0d,_0x5d4816){return function(_0x495cde){if(_0x495cde){return _0x495cde[_0xa8d5('0x20')](_0x360f0d)[_0xa8d5('0x21')](function(_0x4fbd70){return _0x4fbd70;});}return null;};}function removeEntity(_0x15c222,_0xf30c72){return function(_0x308f96){if(_0x308f96){return _0x308f96['destroy']()[_0xa8d5('0x21')](function(){_0x15c222['status'](0xcc)[_0xa8d5('0x18')]();});}};}function handleEntityNotFound(_0x46c4f2,_0x5196d9){return function(_0x84664d){if(!_0x84664d){_0x46c4f2[_0xa8d5('0x16')](0x194);}return _0x84664d;};}function handleError(_0x40f8bb,_0x5af9ec){_0x5af9ec=_0x5af9ec||0x1f4;return function(_0x50481e){logger[_0xa8d5('0x22')](_0x50481e[_0xa8d5('0x23')]);if(_0x50481e[_0xa8d5('0x24')]){delete _0x50481e[_0xa8d5('0x24')];}_0x40f8bb[_0xa8d5('0x17')](_0x5af9ec)['send'](_0x50481e);};}exports[_0xa8d5('0x25')]=function(_0x43784f,_0x1012fe){var _0x283d03={},_0x30f0a8={},_0x40d7d0={'count':0x0,'rows':[]};var _0x26dc5e=_[_0xa8d5('0x26')](db[_0xa8d5('0x27')][_0xa8d5('0x28')],function(_0x32b04f){return{'name':_0x32b04f[_0xa8d5('0x29')],'type':_0x32b04f[_0xa8d5('0x2a')]['key']};});_0x30f0a8[_0xa8d5('0x2b')]=_[_0xa8d5('0x26')](_0x26dc5e,_0xa8d5('0x24'));_0x30f0a8[_0xa8d5('0x2c')]=_[_0xa8d5('0x2d')](_0x43784f[_0xa8d5('0x2c')]);_0x30f0a8['filters']=_[_0xa8d5('0x2e')](_0x30f0a8[_0xa8d5('0x2b')],_0x30f0a8['query']);_0x283d03[_0xa8d5('0x2f')]=_['intersection'](_0x30f0a8['model'],qs[_0xa8d5('0x30')](_0x43784f['query'][_0xa8d5('0x30')]));_0x283d03[_0xa8d5('0x2f')]=_0x283d03[_0xa8d5('0x2f')]['length']?_0x283d03['attributes']:_0x30f0a8[_0xa8d5('0x2b')];if(!_0x43784f['query'][_0xa8d5('0x31')]('nolimit')){_0x283d03[_0xa8d5('0x1c')]=qs[_0xa8d5('0x1c')](_0x43784f[_0xa8d5('0x2c')][_0xa8d5('0x1c')]);_0x283d03['offset']=qs['offset'](_0x43784f[_0xa8d5('0x2c')][_0xa8d5('0x1a')]);}_0x283d03[_0xa8d5('0x32')]=qs[_0xa8d5('0x33')](_0x43784f[_0xa8d5('0x2c')][_0xa8d5('0x33')]);_0x283d03[_0xa8d5('0x34')]=qs[_0xa8d5('0x35')](_[_0xa8d5('0x36')](_0x43784f['query'],_0x30f0a8[_0xa8d5('0x35')]),_0x26dc5e);if(_0x43784f[_0xa8d5('0x2c')][_0xa8d5('0x37')]){_0x283d03[_0xa8d5('0x34')]=_[_0xa8d5('0x38')](_0x283d03[_0xa8d5('0x34')],{'$or':_[_0xa8d5('0x26')](_0x26dc5e,function(_0x28ddf0){if(_0x28ddf0['type']!==_0xa8d5('0x39')){var _0x2f683c={};_0x2f683c[_0x28ddf0['name']]={'$like':'%'+_0x43784f[_0xa8d5('0x2c')][_0xa8d5('0x37')]+'%'};return _0x2f683c;}})});}_0x283d03=_['merge']({},_0x283d03,_0x43784f[_0xa8d5('0x3a')]);var _0x12fe42={'where':_0x283d03[_0xa8d5('0x34')]};return db['ZohoField'][_0xa8d5('0x1b')](_0x12fe42)['then'](function(_0x3ba0ad){_0x40d7d0[_0xa8d5('0x1b')]=_0x3ba0ad;if(_0x43784f[_0xa8d5('0x2c')]['includeAll']){_0x283d03['include']=[{'all':!![]}];}return db[_0xa8d5('0x27')][_0xa8d5('0x3b')](_0x283d03);})[_0xa8d5('0x21')](function(_0xcc5b05){_0x40d7d0['rows']=_0xcc5b05;return _0x40d7d0;})[_0xa8d5('0x21')](respondWithFilteredResult(_0x1012fe,_0x283d03))['catch'](handleError(_0x1012fe,null));};exports[_0xa8d5('0x3c')]=function(_0x185a38,_0x546b57){var _0x3d684f={'raw':!![],'where':{'id':_0x185a38[_0xa8d5('0x3d')]['id']}},_0x1863dc={};_0x1863dc['model']=_['keys'](db[_0xa8d5('0x27')][_0xa8d5('0x28')]);_0x1863dc[_0xa8d5('0x2c')]=_[_0xa8d5('0x2d')](_0x185a38[_0xa8d5('0x2c')]);_0x1863dc[_0xa8d5('0x35')]=_[_0xa8d5('0x2e')](_0x1863dc['model'],_0x1863dc[_0xa8d5('0x2c')]);_0x3d684f[_0xa8d5('0x2f')]=_[_0xa8d5('0x2e')](_0x1863dc['model'],qs[_0xa8d5('0x30')](_0x185a38['query']['fields']));_0x3d684f[_0xa8d5('0x2f')]=_0x3d684f[_0xa8d5('0x2f')][_0xa8d5('0x3e')]?_0x3d684f[_0xa8d5('0x2f')]:_0x1863dc[_0xa8d5('0x2b')];if(_0x185a38[_0xa8d5('0x2c')][_0xa8d5('0x3f')]){_0x3d684f[_0xa8d5('0x40')]=[{'all':!![]}];}_0x3d684f=_[_0xa8d5('0x38')]({},_0x3d684f,_0x185a38[_0xa8d5('0x3a')]);return db[_0xa8d5('0x27')][_0xa8d5('0x41')](_0x3d684f)[_0xa8d5('0x21')](handleEntityNotFound(_0x546b57,null))[_0xa8d5('0x21')](respondWithResult(_0x546b57,null))[_0xa8d5('0x42')](handleError(_0x546b57,null));};exports[_0xa8d5('0x43')]=function(_0x48cbd8,_0x360a81){return db[_0xa8d5('0x27')][_0xa8d5('0x43')](_0x48cbd8[_0xa8d5('0x44')],{})[_0xa8d5('0x21')](respondWithResult(_0x360a81,0xc9))[_0xa8d5('0x42')](handleError(_0x360a81,null));};exports[_0xa8d5('0x20')]=function(_0x27c570,_0x35cc99){if(_0x27c570[_0xa8d5('0x44')]['id']){delete _0x27c570[_0xa8d5('0x44')]['id'];}return db[_0xa8d5('0x27')][_0xa8d5('0x41')]({'where':{'id':_0x27c570[_0xa8d5('0x3d')]['id']}})['then'](handleEntityNotFound(_0x35cc99,null))['then'](saveUpdates(_0x27c570[_0xa8d5('0x44')],null))[_0xa8d5('0x21')](respondWithResult(_0x35cc99,null))['catch'](handleError(_0x35cc99,null));};exports[_0xa8d5('0x45')]=function(_0x5ce2b8,_0x1a938a){return db[_0xa8d5('0x27')]['find']({'where':{'id':_0x5ce2b8[_0xa8d5('0x3d')]['id']}})['then'](handleEntityNotFound(_0x1a938a,null))[_0xa8d5('0x21')](removeEntity(_0x1a938a,null))['catch'](handleError(_0x1a938a,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 63bf0f0..c169511 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 _0x5496=['moment','request-promise','rimraf','../../config/environment','./intZohoField.attributes','define','int_zoho_fields','zoho_unique_index','idField','lodash','util','../../config/logger','api'];(function(_0x47cde9,_0x19d013){var _0x26fdf1=function(_0x32fb69){while(--_0x32fb69){_0x47cde9['push'](_0x47cde9['shift']());}};_0x26fdf1(++_0x19d013);}(_0x5496,0x175));var _0x6549=function(_0x448f72,_0x1344a4){_0x448f72=_0x448f72-0x0;var _0x3d5d68=_0x5496[_0x448f72];return _0x3d5d68;};'use strict';var _=require(_0x6549('0x0'));var util=require(_0x6549('0x1'));var logger=require(_0x6549('0x2'))(_0x6549('0x3'));var moment=require(_0x6549('0x4'));var BPromise=require('bluebird');var rp=require(_0x6549('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6549('0x6'));var config=require(_0x6549('0x7'));var attributes=require(_0x6549('0x8'));module['exports']=function(_0x5a4658,_0x43cb17){return _0x5a4658[_0x6549('0x9')]('ZohoField',attributes,{'tableName':_0x6549('0xa'),'paranoid':![],'indexes':[{'name':_0x6549('0xb'),'fields':[_0x6549('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x781d=['rimraf','../../config/environment','./intZohoField.attributes','exports','ZohoField','int_zoho_fields','zoho_unique_index','idField','lodash','util','moment','bluebird','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x781d,0x14a));var _0xd781=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x781d[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xd781('0x0'));var util=require(_0xd781('0x1'));var logger=require('../../config/logger')('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(_0xd781('0x7'));var attributes=require(_0xd781('0x8'));module[_0xd781('0x9')]=function(_0x830b,_0x2f98ee){return _0x830b['define'](_0xd781('0xa'),attributes,{'tableName':_0xd781('0xb'),'paranoid':![],'indexes':[{'name':_0xd781('0xc'),'fields':[_0xd781('0xd'),'FieldId'],'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 3eb9a5f..a3646e3 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 _0x422d=['message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x138ca0,_0x4c814a){var _0x5ef6cf=function(_0x495a53){while(--_0x495a53){_0x138ca0['push'](_0x138ca0['shift']());}};_0x5ef6cf(++_0x4c814a);}(_0x422d,0x147));var _0xd422=function(_0xaed222,_0x14be57){_0xaed222=_0xaed222-0x0;var _0x2ecd45=_0x422d[_0xaed222];return _0x2ecd45;};'use strict';var _=require(_0xd422('0x0'));var util=require(_0xd422('0x1'));var moment=require(_0xd422('0x2'));var BPromise=require(_0xd422('0x3'));var rs=require(_0xd422('0x4'));var fs=require('fs');var Redis=require(_0xd422('0x5'));var db=require(_0xd422('0x6'))['db'];var utils=require(_0xd422('0x7'));var logger=require(_0xd422('0x8'))(_0xd422('0x9'));var config=require(_0xd422('0xa'));var jayson=require(_0xd422('0xb'));var client=jayson[_0xd422('0xc')][_0xd422('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x94c437,_0x3ae79c,_0x362fa3){return new BPromise(function(_0x52237f,_0x1b070c){return client['request'](_0x94c437,_0x362fa3)[_0xd422('0xe')](function(_0x2dcf69){logger[_0xd422('0xf')](_0xd422('0x10'),_0x3ae79c,_0xd422('0x11'));logger[_0xd422('0x12')](_0xd422('0x13'),_0x3ae79c,_0xd422('0x11'),JSON[_0xd422('0x14')](_0x2dcf69));if(_0x2dcf69[_0xd422('0x15')]){if(_0x2dcf69[_0xd422('0x15')][_0xd422('0x16')]===0x1f4){logger[_0xd422('0x15')](_0xd422('0x10'),_0x3ae79c,_0x2dcf69['error'][_0xd422('0x17')]);return _0x1b070c(_0x2dcf69[_0xd422('0x15')]['message']);}logger[_0xd422('0x15')]('ZohoField,\x20%s,\x20%s',_0x3ae79c,_0x2dcf69[_0xd422('0x15')][_0xd422('0x17')]);return _0x52237f(_0x2dcf69[_0xd422('0x15')][_0xd422('0x17')]);}else{logger[_0xd422('0xf')](_0xd422('0x10'),_0x3ae79c,_0xd422('0x11'));_0x52237f(_0x2dcf69[_0xd422('0x18')]['message']);}})['catch'](function(_0x5d55a1){logger['error'](_0xd422('0x10'),_0x3ae79c,_0x5d55a1);_0x1b070c(_0x5d55a1);});});} \ No newline at end of file +var _0xbe2f=['error','code','ZohoField,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','request\x20sent','debug'];(function(_0x5b3911,_0x4ab81d){var _0x45ebbe=function(_0x1b30a3){while(--_0x1b30a3){_0x5b3911['push'](_0x5b3911['shift']());}};_0x45ebbe(++_0x4ab81d);}(_0xbe2f,0x1bd));var _0xfbe2=function(_0x14e1e7,_0x254d9e){_0x14e1e7=_0x14e1e7-0x0;var _0x26eba5=_0xbe2f[_0x14e1e7];return _0x26eba5;};'use strict';var _=require(_0xfbe2('0x0'));var util=require(_0xfbe2('0x1'));var moment=require(_0xfbe2('0x2'));var BPromise=require(_0xfbe2('0x3'));var rs=require(_0xfbe2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfbe2('0x5'))['db'];var utils=require(_0xfbe2('0x6'));var logger=require(_0xfbe2('0x7'))(_0xfbe2('0x8'));var config=require(_0xfbe2('0x9'));var jayson=require(_0xfbe2('0xa'));var client=jayson['client'][_0xfbe2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x467d42,_0x6fd260,_0x4e15a2){return new BPromise(function(_0x36ebf2,_0x2b5900){return client['request'](_0x467d42,_0x4e15a2)['then'](function(_0x54033c){logger[_0xfbe2('0xc')]('ZohoField,\x20%s,\x20%s',_0x6fd260,_0xfbe2('0xd'));logger[_0xfbe2('0xe')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x6fd260,_0xfbe2('0xd'),JSON['stringify'](_0x54033c));if(_0x54033c[_0xfbe2('0xf')]){if(_0x54033c[_0xfbe2('0xf')][_0xfbe2('0x10')]===0x1f4){logger['error'](_0xfbe2('0x11'),_0x6fd260,_0x54033c[_0xfbe2('0xf')]['message']);return _0x2b5900(_0x54033c[_0xfbe2('0xf')]['message']);}logger[_0xfbe2('0xf')](_0xfbe2('0x11'),_0x6fd260,_0x54033c[_0xfbe2('0xf')]['message']);return _0x36ebf2(_0x54033c['error'][_0xfbe2('0x12')]);}else{logger[_0xfbe2('0xc')](_0xfbe2('0x11'),_0x6fd260,_0xfbe2('0xd'));_0x36ebf2(_0x54033c['result'][_0xfbe2('0x12')]);}})[_0xfbe2('0x13')](function(_0x107f38){logger[_0xfbe2('0xf')](_0xfbe2('0x11'),_0x6fd260,_0x107f38);_0x2b5900(_0x107f38);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 44c2892..bb1a8ee 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x3d264b,_0x459fa5){var _0x216e66=function(_0x274e0b){while(--_0x274e0b){_0x3d264b['push'](_0x3d264b['shift']());}};_0x216e66(++_0x459fa5);}(_0xedd9,0xfc));var _0x9edd=function(_0x46a289,_0x599681){_0x46a289=_0x46a289-0x0;var _0x2e6168=_0xedd9[_0x46a289];return _0x2e6168;};'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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x5e8874,_0x134292){var _0x4bf1de=function(_0x941a8e){while(--_0x941a8e){_0x5e8874['push'](_0x5e8874['shift']());}};_0x4bf1de(++_0x134292);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'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 diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 4321595..2a01634 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 _0x9c13=['state','sequelize','exports','STRING','unique_name_and_version','app.js','BOOLEAN'];(function(_0x1b4b23,_0x5dd6d6){var _0x2a325b=function(_0x175462){while(--_0x175462){_0x1b4b23['push'](_0x1b4b23['shift']());}};_0x2a325b(++_0x5dd6d6);}(_0x9c13,0x127));var _0x39c1=function(_0x102f97,_0x5bda2f){_0x102f97=_0x102f97-0x0;var _0xd22058=_0x9c13[_0x102f97];return _0xd22058;};'use strict';var Sequelize=require(_0x39c1('0x0'));module[_0x39c1('0x1')]={'name':{'type':Sequelize[_0x39c1('0x2')],'allowNull':![],'unique':_0x39c1('0x3')},'version':{'type':Sequelize[_0x39c1('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize['STRING'],'defaultValue':_0x39c1('0x4')},'filename':{'type':Sequelize[_0x39c1('0x2')]},'path':{'type':Sequelize[_0x39c1('0x2')]},'type':{'type':Sequelize[_0x39c1('0x2')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0x39c1('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x39c1('0x2')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize['STRING'],'unique':_0x39c1('0x6')},'description':{'type':Sequelize[_0x39c1('0x2')]},'title':{'type':Sequelize[_0x39c1('0x2')]},'remoteUri':{'type':Sequelize[_0x39c1('0x2')]},'link':{'type':Sequelize[_0x39c1('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0x162d=['exports','STRING','unique_name_and_version','app.js','INTEGER','BOOLEAN'];(function(_0x3a5561,_0x309d85){var _0x379240=function(_0x53594b){while(--_0x53594b){_0x3a5561['push'](_0x3a5561['shift']());}};_0x379240(++_0x309d85);}(_0x162d,0xa8));var _0xd162=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x162d[_0x126558];return _0x1f6d14;};'use strict';var Sequelize=require('sequelize');module[_0xd162('0x0')]={'name':{'type':Sequelize[_0xd162('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xd162('0x2')},'main':{'type':Sequelize[_0xd162('0x1')],'defaultValue':_0xd162('0x3')},'filename':{'type':Sequelize[_0xd162('0x1')]},'path':{'type':Sequelize[_0xd162('0x1')]},'type':{'type':Sequelize[_0xd162('0x1')]},'size':{'type':Sequelize[_0xd162('0x4')]},'active':{'type':Sequelize[_0xd162('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0xd162('0x1')]},'logo':{'type':Sequelize[_0xd162('0x1')]},'state':{'type':Sequelize[_0xd162('0x1')],'unique':'state'},'description':{'type':Sequelize[_0xd162('0x1')]},'title':{'type':Sequelize[_0xd162('0x1')]},'remoteUri':{'type':Sequelize[_0xd162('0x1')]},'link':{'type':Sequelize[_0xd162('0x1')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 6383214..b796c12 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 _0x9582=['rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','offset','count','set','json','reject','save','update','then','destroy','error','name','send','index','map','Integration','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','eml-format'];(function(_0x329664,_0x130748){var _0x4e346e=function(_0x172b0d){while(--_0x172b0d){_0x329664['push'](_0x329664['shift']());}};_0x4e346e(++_0x130748);}(_0x9582,0x95));var _0x2958=function(_0x5fc334,_0x2284a5){_0x5fc334=_0x5fc334-0x0;var _0x3f707c=_0x9582[_0x5fc334];return _0x3f707c;};'use strict';var emlformat=require(_0x2958('0x0'));var rimraf=require(_0x2958('0x1'));var zipdir=require(_0x2958('0x2'));var jsonpatch=require(_0x2958('0x3'));var rp=require(_0x2958('0x4'));var moment=require(_0x2958('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2958('0x6'));var util=require(_0x2958('0x7'));var path=require(_0x2958('0x8'));var sox=require(_0x2958('0x9'));var csv=require(_0x2958('0xa'));var ejs=require(_0x2958('0xb'));var fs=require('fs');var fs_extra=require(_0x2958('0xc'));var _=require(_0x2958('0xd'));var squel=require(_0x2958('0xe'));var crypto=require(_0x2958('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2958('0xa'));var querystring=require('querystring');var Papa=require(_0x2958('0x10'));var Redis=require('ioredis');var authService=require(_0x2958('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2958('0x12'));var hardwareService=require(_0x2958('0x13'));var logger=require(_0x2958('0x14'))(_0x2958('0x15'));var utils=require(_0x2958('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x2958('0x17'));var db=require(_0x2958('0x18'))['db'];function respondWithStatusCode(_0x33a13a,_0x20e06a){_0x20e06a=_0x20e06a||0xcc;return function(_0x47067d){if(_0x47067d){return _0x33a13a[_0x2958('0x19')](_0x20e06a);}return _0x33a13a[_0x2958('0x1a')](_0x20e06a)[_0x2958('0x1b')]();};}function respondWithResult(_0x5bd520,_0x42e976){_0x42e976=_0x42e976||0xc8;return function(_0x2e12d4){if(_0x2e12d4){return _0x5bd520['status'](_0x42e976)['json'](_0x2e12d4);}};}function respondWithFilteredResult(_0x21ed6c,_0x38e724){return function(_0x5f06b1){if(_0x5f06b1){var _0x3bef50=typeof _0x38e724['offset']==='undefined'&&typeof _0x38e724[_0x2958('0x1c')]===_0x2958('0x1d');var _0x55e261=_0x5f06b1['count'];var _0x28a92c=_0x3bef50?0x0:_0x38e724[_0x2958('0x1e')];var _0x310d07=_0x3bef50?_0x5f06b1[_0x2958('0x1f')]:_0x38e724[_0x2958('0x1e')]+_0x38e724['limit'];var _0x19a614;if(_0x310d07>=_0x55e261){_0x310d07=_0x55e261;_0x19a614=0xc8;}else{_0x19a614=0xce;}_0x21ed6c[_0x2958('0x1a')](_0x19a614);return _0x21ed6c[_0x2958('0x20')]('Content-Range',_0x28a92c+'-'+_0x310d07+'/'+_0x55e261)[_0x2958('0x21')](_0x5f06b1);}return null;};}function patchUpdates(_0x53b100){return function(_0x1da684){try{jsonpatch['apply'](_0x1da684,_0x53b100,!![]);}catch(_0x5eaf36){return BPromise[_0x2958('0x22')](_0x5eaf36);}return _0x1da684[_0x2958('0x23')]();};}function saveUpdates(_0x2a02a4,_0x26c5a5){return function(_0x2202f8){if(_0x2202f8){return _0x2202f8[_0x2958('0x24')](_0x2a02a4)[_0x2958('0x25')](function(_0x2b9818){return _0x2b9818;});}return null;};}function removeEntity(_0x330763,_0x2aa514){return function(_0xaf5547){if(_0xaf5547){return _0xaf5547[_0x2958('0x26')]()[_0x2958('0x25')](function(){_0x330763[_0x2958('0x1a')](0xcc)[_0x2958('0x1b')]();});}};}function handleEntityNotFound(_0x4f811a,_0x574df5){return function(_0x3c1155){if(!_0x3c1155){_0x4f811a[_0x2958('0x19')](0x194);}return _0x3c1155;};}function handleError(_0x28c1f5,_0x43cf73){_0x43cf73=_0x43cf73||0x1f4;return function(_0x52bd32){logger[_0x2958('0x27')](_0x52bd32['stack']);if(_0x52bd32[_0x2958('0x28')]){delete _0x52bd32[_0x2958('0x28')];}_0x28c1f5[_0x2958('0x1a')](_0x43cf73)[_0x2958('0x29')](_0x52bd32);};}exports[_0x2958('0x2a')]=function(_0x36e2a5,_0x153958){var _0x5d1dfc={},_0x21b919={},_0x5053d0={'count':0x0,'rows':[]};var _0x48650d=_[_0x2958('0x2b')](db[_0x2958('0x2c')][_0x2958('0x2d')],function(_0x34e56e){return{'name':_0x34e56e[_0x2958('0x2e')],'type':_0x34e56e[_0x2958('0x2f')][_0x2958('0x30')]};});_0x21b919[_0x2958('0x31')]=_['map'](_0x48650d,_0x2958('0x28'));_0x21b919[_0x2958('0x32')]=_['keys'](_0x36e2a5[_0x2958('0x32')]);_0x21b919['filters']=_[_0x2958('0x33')](_0x21b919['model'],_0x21b919[_0x2958('0x32')]);_0x5d1dfc['attributes']=_[_0x2958('0x33')](_0x21b919[_0x2958('0x31')],qs[_0x2958('0x34')](_0x36e2a5[_0x2958('0x32')][_0x2958('0x34')]));_0x5d1dfc[_0x2958('0x35')]=_0x5d1dfc[_0x2958('0x35')][_0x2958('0x36')]?_0x5d1dfc[_0x2958('0x35')]:_0x21b919['model'];if(!_0x36e2a5[_0x2958('0x32')]['hasOwnProperty'](_0x2958('0x37'))){_0x5d1dfc['limit']=qs[_0x2958('0x1c')](_0x36e2a5[_0x2958('0x32')][_0x2958('0x1c')]);_0x5d1dfc[_0x2958('0x1e')]=qs[_0x2958('0x1e')](_0x36e2a5[_0x2958('0x32')][_0x2958('0x1e')]);}_0x5d1dfc[_0x2958('0x38')]=qs[_0x2958('0x39')](_0x36e2a5[_0x2958('0x32')][_0x2958('0x39')]);_0x5d1dfc[_0x2958('0x3a')]=qs[_0x2958('0x3b')](_['pick'](_0x36e2a5[_0x2958('0x32')],_0x21b919[_0x2958('0x3b')]),_0x48650d);if(_0x36e2a5[_0x2958('0x32')][_0x2958('0x3c')]){_0x5d1dfc['where']=_[_0x2958('0x3d')](_0x5d1dfc[_0x2958('0x3a')],{'$or':_[_0x2958('0x2b')](_0x48650d,function(_0x3f7e27){if(_0x3f7e27[_0x2958('0x2f')]!==_0x2958('0x3e')){var _0x1ed89b={};_0x1ed89b[_0x3f7e27[_0x2958('0x28')]]={'$like':'%'+_0x36e2a5[_0x2958('0x32')][_0x2958('0x3c')]+'%'};return _0x1ed89b;}})});}_0x5d1dfc=_[_0x2958('0x3d')]({},_0x5d1dfc,_0x36e2a5[_0x2958('0x3f')]);var _0x319243={'where':_0x5d1dfc['where']};return db[_0x2958('0x2c')][_0x2958('0x1f')](_0x319243)['then'](function(_0x4fe061){_0x5053d0[_0x2958('0x1f')]=_0x4fe061;if(_0x36e2a5[_0x2958('0x32')][_0x2958('0x40')]){_0x5d1dfc[_0x2958('0x41')]=[{'all':!![]}];}return db[_0x2958('0x2c')][_0x2958('0x42')](_0x5d1dfc);})[_0x2958('0x25')](function(_0x13be6d){_0x5053d0[_0x2958('0x43')]=_0x13be6d;return _0x5053d0;})[_0x2958('0x25')](respondWithFilteredResult(_0x153958,_0x5d1dfc))[_0x2958('0x44')](handleError(_0x153958,null));};exports[_0x2958('0x45')]=function(_0xe33c56,_0x5a58ea){var _0x645b66={'raw':![],'where':{'id':_0xe33c56[_0x2958('0x46')]['id']}},_0x112256={};_0x112256[_0x2958('0x31')]=_['keys'](db[_0x2958('0x2c')]['rawAttributes']);_0x112256['query']=_[_0x2958('0x47')](_0xe33c56[_0x2958('0x32')]);_0x112256[_0x2958('0x3b')]=_[_0x2958('0x33')](_0x112256[_0x2958('0x31')],_0x112256[_0x2958('0x32')]);_0x645b66['attributes']=_[_0x2958('0x33')](_0x112256['model'],qs['fields'](_0xe33c56[_0x2958('0x32')]['fields']));_0x645b66[_0x2958('0x35')]=_0x645b66[_0x2958('0x35')][_0x2958('0x36')]?_0x645b66[_0x2958('0x35')]:_0x112256[_0x2958('0x31')];if(_0xe33c56[_0x2958('0x32')][_0x2958('0x40')]){_0x645b66[_0x2958('0x41')]=[{'all':!![]}];}_0x645b66=_['merge']({},_0x645b66,_0xe33c56[_0x2958('0x3f')]);return db[_0x2958('0x2c')][_0x2958('0x48')](_0x645b66)[_0x2958('0x25')](handleEntityNotFound(_0x5a58ea,null))['then'](respondWithResult(_0x5a58ea,null))[_0x2958('0x44')](handleError(_0x5a58ea,null));};exports[_0x2958('0x49')]=function(_0x4a51b1,_0x1b6829){return db[_0x2958('0x2c')][_0x2958('0x49')](_0x4a51b1[_0x2958('0x4a')],{})[_0x2958('0x25')](respondWithResult(_0x1b6829,0xc9))[_0x2958('0x44')](handleError(_0x1b6829,null));};exports['update']=function(_0x1fff2a,_0x38b551){if(_0x1fff2a[_0x2958('0x4a')]['id']){delete _0x1fff2a[_0x2958('0x4a')]['id'];}return db[_0x2958('0x2c')][_0x2958('0x48')]({'where':{'id':_0x1fff2a[_0x2958('0x46')]['id']}})[_0x2958('0x25')](handleEntityNotFound(_0x38b551,null))[_0x2958('0x25')](saveUpdates(_0x1fff2a[_0x2958('0x4a')],null))[_0x2958('0x25')](respondWithResult(_0x38b551,null))[_0x2958('0x44')](handleError(_0x38b551,null));};exports[_0x2958('0x26')]=function(_0x3f7bc1,_0x1bb780){return db[_0x2958('0x2c')][_0x2958('0x48')]({'where':{'id':_0x3f7bc1['params']['id']}})[_0x2958('0x25')](handleEntityNotFound(_0x1bb780,null))['then'](removeEntity(_0x1bb780,null))[_0x2958('0x44')](handleError(_0x1bb780,null));}; \ No newline at end of file +var _0x5f2f=['end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','stack','name','send','index','Integration','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','findAll','rows','catch','keys','find','body','params','destroy','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'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3f08c9,_0x557d0b){_0x3f08c9=_0x3f08c9-0x0;var _0x4c3250=_0x5f2f[_0x3f08c9];return _0x4c3250;};'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')]=[{'all':!![]}];}return db[_0xf5f2('0x29')][_0xf5f2('0x3e')](_0x22c826);})[_0xf5f2('0x24')](function(_0x574f24){_0x11c771[_0xf5f2('0x3f')]=_0x574f24;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x40')](handleError(_0x53cb96,null));};exports['show']=function(_0x509dbc,_0x59eb00){var _0x76d21b={'raw':![],'where':{'id':_0x509dbc['params']['id']}},_0x2ad13c={};_0x2ad13c[_0xf5f2('0x31')]=_[_0xf5f2('0x41')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x2ad13c[_0xf5f2('0x2e')]=_[_0xf5f2('0x41')](_0x509dbc[_0xf5f2('0x2e')]);_0x2ad13c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],_0x2ad13c[_0xf5f2('0x2e')]);_0x76d21b[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],qs['fields'](_0x509dbc[_0xf5f2('0x2e')]['fields']));_0x76d21b[_0xf5f2('0x32')]=_0x76d21b[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x76d21b[_0xf5f2('0x32')]:_0x2ad13c[_0xf5f2('0x31')];if(_0x509dbc[_0xf5f2('0x2e')]['includeAll']){_0x76d21b[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x76d21b=_[_0xf5f2('0x39')]({},_0x76d21b,_0x509dbc[_0xf5f2('0x3b')]);return db[_0xf5f2('0x29')][_0xf5f2('0x42')](_0x76d21b)[_0xf5f2('0x24')](handleEntityNotFound(_0x59eb00,null))[_0xf5f2('0x24')](respondWithResult(_0x59eb00,null))[_0xf5f2('0x40')](handleError(_0x59eb00,null));};exports['create']=function(_0x35dece,_0x33ec29){return db[_0xf5f2('0x29')]['create'](_0x35dece[_0xf5f2('0x43')],{})[_0xf5f2('0x24')](respondWithResult(_0x33ec29,0xc9))[_0xf5f2('0x40')](handleError(_0x33ec29,null));};exports['update']=function(_0x57a7cb,_0x7bb942){if(_0x57a7cb[_0xf5f2('0x43')]['id']){delete _0x57a7cb['body']['id'];}return db[_0xf5f2('0x29')]['find']({'where':{'id':_0x57a7cb[_0xf5f2('0x44')]['id']}})['then'](handleEntityNotFound(_0x7bb942,null))[_0xf5f2('0x24')](saveUpdates(_0x57a7cb['body'],null))[_0xf5f2('0x24')](respondWithResult(_0x7bb942,null))[_0xf5f2('0x40')](handleError(_0x7bb942,null));};exports[_0xf5f2('0x45')]=function(_0x11a083,_0x4fa738){return db[_0xf5f2('0x29')][_0xf5f2('0x42')]({'where':{'id':_0x11a083['params']['id']}})['then'](handleEntityNotFound(_0x4fa738,null))[_0xf5f2('0x24')](removeEntity(_0x4fa738,null))[_0xf5f2('0x40')](handleError(_0x4fa738,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index c0fb5dc..a17f276 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 _0x0305=['api','moment','bluebird','rimraf','../../config/environment','exports','define','Integration','lodash','util'];(function(_0x33d4a9,_0x286c3){var _0x125f3b=function(_0x3b53af){while(--_0x3b53af){_0x33d4a9['push'](_0x33d4a9['shift']());}};_0x125f3b(++_0x286c3);}(_0x0305,0x17a));var _0x5030=function(_0x557fd2,_0x2c0a7a){_0x557fd2=_0x557fd2-0x0;var _0x1b54a2=_0x0305[_0x557fd2];return _0x1b54a2;};'use strict';var _=require(_0x5030('0x0'));var util=require(_0x5030('0x1'));var logger=require('../../config/logger')(_0x5030('0x2'));var moment=require(_0x5030('0x3'));var BPromise=require(_0x5030('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5030('0x5'));var config=require(_0x5030('0x6'));var attributes=require('./integration.attributes');module[_0x5030('0x7')]=function(_0xfdba91,_0x355e7d){return _0xfdba91[_0x5030('0x8')](_0x5030('0x9'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3279=['util','api','bluebird','request-promise','../../config/environment','integrations','lodash'];(function(_0x3fba9f,_0x3b7b9b){var _0x192cf1=function(_0x557290){while(--_0x557290){_0x3fba9f['push'](_0x3fba9f['shift']());}};_0x192cf1(++_0x3b7b9b);}(_0x3279,0x11e));var _0x9327=function(_0xd2f2a2,_0x56caab){_0xd2f2a2=_0xd2f2a2-0x0;var _0x110d27=_0x3279[_0xd2f2a2];return _0x110d27;};'use strict';var _=require(_0x9327('0x0'));var util=require(_0x9327('0x1'));var logger=require('../../config/logger')(_0x9327('0x2'));var moment=require('moment');var BPromise=require(_0x9327('0x3'));var rp=require(_0x9327('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9327('0x5'));var attributes=require('./integration.attributes');module['exports']=function(_0x13136f,_0x47d832){return _0x13136f['define']('Integration',attributes,{'tableName':_0x9327('0x6'),'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 33a12f7..4c6c054 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 _0x57ca=['client','http','request','info','request\x20sent','Integration,\x20%s,\x20%s,\x20%s','error','code','Integration,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x4e7262,_0x1d6c25){var _0x39610c=function(_0x373f8a){while(--_0x373f8a){_0x4e7262['push'](_0x4e7262['shift']());}};_0x39610c(++_0x1d6c25);}(_0x57ca,0x108));var _0xa57c=function(_0x246d7b,_0x330631){_0x246d7b=_0x246d7b-0x0;var _0x1d71dd=_0x57ca[_0x246d7b];return _0x1d71dd;};'use strict';var _=require('lodash');var util=require(_0xa57c('0x0'));var moment=require(_0xa57c('0x1'));var BPromise=require('bluebird');var rs=require(_0xa57c('0x2'));var fs=require('fs');var Redis=require(_0xa57c('0x3'));var db=require(_0xa57c('0x4'))['db'];var utils=require(_0xa57c('0x5'));var logger=require(_0xa57c('0x6'))('rpc');var config=require(_0xa57c('0x7'));var jayson=require(_0xa57c('0x8'));var client=jayson[_0xa57c('0x9')][_0xa57c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbdfffb,_0x314574,_0x19e28e){return new BPromise(function(_0x271ccc,_0x5e3962){return client[_0xa57c('0xb')](_0xbdfffb,_0x19e28e)['then'](function(_0x46ba92){logger[_0xa57c('0xc')]('Integration,\x20%s,\x20%s',_0x314574,_0xa57c('0xd'));logger['debug'](_0xa57c('0xe'),_0x314574,_0xa57c('0xd'),JSON['stringify'](_0x46ba92));if(_0x46ba92[_0xa57c('0xf')]){if(_0x46ba92['error'][_0xa57c('0x10')]===0x1f4){logger[_0xa57c('0xf')](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x5e3962(_0x46ba92['error'][_0xa57c('0x12')]);}logger['error'](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x271ccc(_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);}else{logger[_0xa57c('0xc')](_0xa57c('0x11'),_0x314574,'request\x20sent');_0x271ccc(_0x46ba92[_0xa57c('0x13')][_0xa57c('0x12')]);}})[_0xa57c('0x14')](function(_0x5a6024){logger[_0xa57c('0xf')]('Integration,\x20%s,\x20%s',_0x314574,_0x5a6024);_0x5e3962(_0x5a6024);});});} \ No newline at end of file +var _0x7880=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4b451d,_0x56e817){var _0x2c1c28=function(_0x3d778e){while(--_0x3d778e){_0x4b451d['push'](_0x4b451d['shift']());}};_0x2c1c28(++_0x56e817);}(_0x7880,0x1f4));var _0x0788=function(_0x1e4150,_0x55b02a){_0x1e4150=_0x1e4150-0x0;var _0x1ce3ee=_0x7880[_0x1e4150];return _0x1ce3ee;};'use strict';var _=require('lodash');var util=require(_0x0788('0x0'));var moment=require(_0x0788('0x1'));var BPromise=require(_0x0788('0x2'));var rs=require(_0x0788('0x3'));var fs=require('fs');var Redis=require(_0x0788('0x4'));var db=require(_0x0788('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0788('0x6'))(_0x0788('0x7'));var config=require(_0x0788('0x8'));var jayson=require(_0x0788('0x9'));var client=jayson[_0x0788('0xa')][_0x0788('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f9cb8,_0x44bbb5,_0x3c29f3){return new BPromise(function(_0x422f8b,_0x55e48a){return client[_0x0788('0xc')](_0x3f9cb8,_0x3c29f3)['then'](function(_0xabaf81){logger['info'](_0x0788('0xd'),_0x44bbb5,_0x0788('0xe'));logger[_0x0788('0xf')](_0x0788('0x10'),_0x44bbb5,_0x0788('0xe'),JSON['stringify'](_0xabaf81));if(_0xabaf81[_0x0788('0x11')]){if(_0xabaf81[_0x0788('0x11')][_0x0788('0x12')]===0x1f4){logger[_0x0788('0x11')](_0x0788('0xd'),_0x44bbb5,_0xabaf81[_0x0788('0x11')][_0x0788('0x13')]);return _0x55e48a(_0xabaf81['error'][_0x0788('0x13')]);}logger[_0x0788('0x11')](_0x0788('0xd'),_0x44bbb5,_0xabaf81[_0x0788('0x11')]['message']);return _0x422f8b(_0xabaf81[_0x0788('0x11')]['message']);}else{logger[_0x0788('0x14')](_0x0788('0xd'),_0x44bbb5,_0x0788('0xe'));_0x422f8b(_0xabaf81[_0x0788('0x15')][_0x0788('0x13')]);}})[_0x0788('0x16')](function(_0x5e1a29){logger['error'](_0x0788('0xd'),_0x44bbb5,_0x5e1a29);_0x55e48a(_0x5e1a29);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index fc907be..95d2b63 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 _0x5f2f=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2a811d,_0x8fa7ce){_0x2a811d=_0x2a811d-0x0;var _0x5159b6=_0x5f2f[_0x2a811d];return _0x5159b6;};'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('0x10')]('/',auth[_0xf5f2('0xa')](),controller['create']);router[_0xf5f2('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);router[_0xf5f2('0x13')]('/:id',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x14')]);module[_0xf5f2('0x15')]=router; \ No newline at end of file +var _0x6d38=['path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./integrationReport.controller','isAuthenticated','index','get','/describe','/:id','create','update','destroy','exports','util'];(function(_0x33468b,_0x11d48c){var _0x3404e7=function(_0xeb9bcc){while(--_0xeb9bcc){_0x33468b['push'](_0x33468b['shift']());}};_0x3404e7(++_0x11d48c);}(_0x6d38,0x1ef));var _0x86d3=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x6d38[_0x580576];return _0x3f55a0;};'use strict';var multer=require('multer');var util=require(_0x86d3('0x0'));var path=require(_0x86d3('0x1'));var timeout=require(_0x86d3('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x86d3('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x86d3('0x4'));var config=require(_0x86d3('0x5'));var controller=require(_0x86d3('0x6'));router['get']('/',auth[_0x86d3('0x7')](),controller[_0x86d3('0x8')]);router[_0x86d3('0x9')](_0x86d3('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x86d3('0x9')](_0x86d3('0xb'),auth[_0x86d3('0x7')](),controller['show']);router['post']('/',auth[_0x86d3('0x7')](),controller[_0x86d3('0xc')]);router['put']('/:id',auth[_0x86d3('0x7')](),controller[_0x86d3('0xd')]);router['delete'](_0x86d3('0xb'),auth['isAuthenticated'](),controller[_0x86d3('0xe')]);module[_0x86d3('0xf')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 586e1d3..0a343c0 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 _0x4dbd=['SENDING','FAILED','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT'];(function(_0x4c3085,_0x2cd8ec){var _0x14f33d=function(_0x1f418c){while(--_0x1f418c){_0x4c3085['push'](_0x4c3085['shift']());}};_0x14f33d(++_0x2cd8ec);}(_0x4dbd,0x84));var _0xd4db=function(_0x19dedb,_0x237816){_0x19dedb=_0x19dedb-0x0;var _0x323afe=_0x4dbd[_0x19dedb];return _0x323afe;};'use strict';var Sequelize=require('sequelize');module[_0xd4db('0x0')]={'integration':{'type':Sequelize[_0xd4db('0x1')]},'eventChannel':{'type':Sequelize[_0xd4db('0x1')]},'exitStatus':{'type':Sequelize[_0xd4db('0x1')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0xd4db('0x2')]},'contacts':{'type':Sequelize[_0xd4db('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xd4db('0x1')]},'queue':{'type':Sequelize[_0xd4db('0x1')]},'interface':{'type':Sequelize[_0xd4db('0x1')]},'membername':{'type':Sequelize[_0xd4db('0x1')]},'agentcalledAt':{'type':Sequelize[_0xd4db('0x3')]},'agentconnectAt':{'type':Sequelize[_0xd4db('0x3')]},'holdtime':{'type':Sequelize[_0xd4db('0x2')]},'agentcomplete':{'type':Sequelize[_0xd4db('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xd4db('0x2')]},'reason':{'type':Sequelize[_0xd4db('0x1')]},'agentringnoanswer':{'type':Sequelize[_0xd4db('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0xd4db('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xd4db('0x1')]},'channelstate':{'type':Sequelize[_0xd4db('0x2')]},'channelstatedesc':{'type':Sequelize[_0xd4db('0x1')]},'connectedlinenum':{'type':Sequelize[_0xd4db('0x1')]},'connectedlinename':{'type':Sequelize[_0xd4db('0x1')]},'language':{'type':Sequelize[_0xd4db('0x1')]},'accountcode':{'type':Sequelize[_0xd4db('0x1')]},'context':{'type':Sequelize[_0xd4db('0x1')]},'exten':{'type':Sequelize[_0xd4db('0x1')]},'priority':{'type':Sequelize[_0xd4db('0x1')]},'destchannel':{'type':Sequelize[_0xd4db('0x1')]},'destchannelstate':{'type':Sequelize[_0xd4db('0x2')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xd4db('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xd4db('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xd4db('0x1')]},'destaccountcode':{'type':Sequelize[_0xd4db('0x1')]},'destcontext':{'type':Sequelize[_0xd4db('0x1')]},'destexten':{'type':Sequelize[_0xd4db('0x1')]},'destpriority':{'type':Sequelize[_0xd4db('0x1')]},'destuniqueid':{'type':Sequelize[_0xd4db('0x1')]},'messageId':{'type':Sequelize[_0xd4db('0x1')]},'inReplyTo':{'type':Sequelize[_0xd4db('0x1')]},'subject':{'type':Sequelize[_0xd4db('0x1')]},'from':{'type':Sequelize[_0xd4db('0x1')]},'to':{'type':Sequelize[_0xd4db('0x1')]},'cc':{'type':Sequelize[_0xd4db('0x1')]},'attachment':{'type':Sequelize[_0xd4db('0x5')]},'html':{'type':Sequelize[_0xd4db('0x5')]},'text':{'type':Sequelize[_0xd4db('0x5')]},'status':{'type':Sequelize[_0xd4db('0x6')](_0xd4db('0x7'),_0xd4db('0x8'),'RECEIVED',_0xd4db('0x9'))},'url':{'type':Sequelize[_0xd4db('0x1')]},'app':{'type':Sequelize[_0xd4db('0x1')]},'appdata':{'type':Sequelize[_0xd4db('0x1')]},'projectId':{'type':Sequelize[_0xd4db('0x2')]}}; \ No newline at end of file +var _0x9c02=['BOOLEAN','TEXT','ENUM','SENT','sequelize','exports','STRING','INTEGER','DATE'];(function(_0x1c5857,_0x3252ca){var _0x5822d8=function(_0x18caf4){while(--_0x18caf4){_0x1c5857['push'](_0x1c5857['shift']());}};_0x5822d8(++_0x3252ca);}(_0x9c02,0x1c6));var _0x29c0=function(_0x39fa29,_0x19732b){_0x39fa29=_0x39fa29-0x0;var _0x4c9a8e=_0x9c02[_0x39fa29];return _0x4c9a8e;};'use strict';var Sequelize=require(_0x29c0('0x0'));module[_0x29c0('0x1')]={'integration':{'type':Sequelize[_0x29c0('0x2')]},'eventChannel':{'type':Sequelize[_0x29c0('0x2')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0x29c0('0x2')]},'integrationId':{'type':Sequelize[_0x29c0('0x3')]},'contacts':{'type':Sequelize[_0x29c0('0x2')]},'uniqueid':{'type':Sequelize[_0x29c0('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x29c0('0x2')]},'queue':{'type':Sequelize[_0x29c0('0x2')]},'interface':{'type':Sequelize[_0x29c0('0x2')]},'membername':{'type':Sequelize[_0x29c0('0x2')]},'agentcalledAt':{'type':Sequelize[_0x29c0('0x4')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x29c0('0x3')]},'agentcomplete':{'type':Sequelize[_0x29c0('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x29c0('0x4')]},'talktime':{'type':Sequelize[_0x29c0('0x3')]},'agentacw':{'type':Sequelize[_0x29c0('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x29c0('0x3')]},'reason':{'type':Sequelize[_0x29c0('0x2')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x29c0('0x4')]},'agentdump':{'type':Sequelize[_0x29c0('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x29c0('0x4')]},'lastevent':{'type':Sequelize[_0x29c0('0x2')]},'channel':{'type':Sequelize[_0x29c0('0x2')]},'channelstate':{'type':Sequelize[_0x29c0('0x3')]},'channelstatedesc':{'type':Sequelize[_0x29c0('0x2')]},'connectedlinenum':{'type':Sequelize[_0x29c0('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x29c0('0x2')]},'exten':{'type':Sequelize[_0x29c0('0x2')]},'priority':{'type':Sequelize[_0x29c0('0x2')]},'destchannel':{'type':Sequelize[_0x29c0('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x29c0('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x29c0('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x29c0('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x29c0('0x2')]},'destlanguage':{'type':Sequelize[_0x29c0('0x2')]},'destaccountcode':{'type':Sequelize[_0x29c0('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x29c0('0x2')]},'destpriority':{'type':Sequelize[_0x29c0('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0x29c0('0x2')]},'from':{'type':Sequelize[_0x29c0('0x2')]},'to':{'type':Sequelize[_0x29c0('0x2')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x29c0('0x6')]},'html':{'type':Sequelize[_0x29c0('0x6')]},'text':{'type':Sequelize[_0x29c0('0x6')]},'status':{'type':Sequelize[_0x29c0('0x7')](_0x29c0('0x8'),'SENDING','RECEIVED','FAILED')},'url':{'type':Sequelize[_0x29c0('0x2')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0x29c0('0x2')]},'projectId':{'type':Sequelize[_0x29c0('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 0a9b6d3..7e1c3c7 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 _0x16d7=['IntegrationReport','rawAttributes','fieldName','type','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','order','where','pick','merge','filter','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','destroy','then','error','name','send','map'];(function(_0x6c1312,_0x4a6a7a){var _0x1f986c=function(_0x3367a5){while(--_0x3367a5){_0x6c1312['push'](_0x6c1312['shift']());}};_0x1f986c(++_0x4a6a7a);}(_0x16d7,0xf3));var _0x716d=function(_0x4a2b42,_0x3ffbac){_0x4a2b42=_0x4a2b42-0x0;var _0x3a3540=_0x16d7[_0x4a2b42];return _0x3a3540;};'use strict';var emlformat=require(_0x716d('0x0'));var rimraf=require(_0x716d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x716d('0x2'));var rp=require(_0x716d('0x3'));var moment=require(_0x716d('0x4'));var BPromise=require(_0x716d('0x5'));var Mustache=require('mustache');var util=require(_0x716d('0x6'));var path=require(_0x716d('0x7'));var sox=require('sox');var csv=require(_0x716d('0x8'));var ejs=require(_0x716d('0x9'));var fs=require('fs');var fs_extra=require(_0x716d('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x716d('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x716d('0xc'));var toCsv=require(_0x716d('0x8'));var querystring=require(_0x716d('0xd'));var Papa=require(_0x716d('0xe'));var Redis=require('ioredis');var authService=require(_0x716d('0xf'));var qs=require(_0x716d('0x10'));var as=require(_0x716d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x716d('0x12'));var config=require(_0x716d('0x13'));var licenseUtil=require(_0x716d('0x14'));var db=require(_0x716d('0x15'))['db'];function respondWithStatusCode(_0x467a37,_0x199fca){_0x199fca=_0x199fca||0xcc;return function(_0x329450){if(_0x329450){return _0x467a37[_0x716d('0x16')](_0x199fca);}return _0x467a37[_0x716d('0x17')](_0x199fca)[_0x716d('0x18')]();};}function respondWithResult(_0x3b123a,_0xddedf){_0xddedf=_0xddedf||0xc8;return function(_0x416374){if(_0x416374){return _0x3b123a['status'](_0xddedf)[_0x716d('0x19')](_0x416374);}};}function respondWithFilteredResult(_0x4a4997,_0x3b3850){return function(_0x5f5c8f){if(_0x5f5c8f){var _0x510a85=typeof _0x3b3850[_0x716d('0x1a')]==='undefined'&&typeof _0x3b3850['limit']===_0x716d('0x1b');var _0x36216d=_0x5f5c8f[_0x716d('0x1c')];var _0x1833a7=_0x510a85?0x0:_0x3b3850[_0x716d('0x1a')];var _0x103c09=_0x510a85?_0x5f5c8f['count']:_0x3b3850[_0x716d('0x1a')]+_0x3b3850[_0x716d('0x1d')];var _0x4fc67e;if(_0x103c09>=_0x36216d){_0x103c09=_0x36216d;_0x4fc67e=0xc8;}else{_0x4fc67e=0xce;}_0x4a4997[_0x716d('0x17')](_0x4fc67e);return _0x4a4997[_0x716d('0x1e')]('Content-Range',_0x1833a7+'-'+_0x103c09+'/'+_0x36216d)[_0x716d('0x19')](_0x5f5c8f);}return null;};}function patchUpdates(_0x158446){return function(_0x54546d){try{jsonpatch[_0x716d('0x1f')](_0x54546d,_0x158446,!![]);}catch(_0x5dc783){return BPromise[_0x716d('0x20')](_0x5dc783);}return _0x54546d[_0x716d('0x21')]();};}function saveUpdates(_0x5a6c10,_0x100897){return function(_0x4a5603){if(_0x4a5603){return _0x4a5603[_0x716d('0x22')](_0x5a6c10)['then'](function(_0x3268ac){return _0x3268ac;});}return null;};}function removeEntity(_0x52090a,_0x2316df){return function(_0x12cb7d){if(_0x12cb7d){return _0x12cb7d[_0x716d('0x23')]()[_0x716d('0x24')](function(){_0x52090a[_0x716d('0x17')](0xcc)[_0x716d('0x18')]();});}};}function handleEntityNotFound(_0x397909,_0x520111){return function(_0x5c9864){if(!_0x5c9864){_0x397909[_0x716d('0x16')](0x194);}return _0x5c9864;};}function handleError(_0xba5407,_0x3d5ba8){_0x3d5ba8=_0x3d5ba8||0x1f4;return function(_0x18719c){logger[_0x716d('0x25')](_0x18719c['stack']);if(_0x18719c[_0x716d('0x26')]){delete _0x18719c[_0x716d('0x26')];}_0xba5407[_0x716d('0x17')](_0x3d5ba8)[_0x716d('0x27')](_0x18719c);};}exports['index']=function(_0x419fb9,_0x4bb5c4){var _0x375750={},_0x46113f={},_0x460c4b={'count':0x0,'rows':[]};var _0x1d5bd5=_[_0x716d('0x28')](db[_0x716d('0x29')][_0x716d('0x2a')],function(_0x52bf7d){return{'name':_0x52bf7d[_0x716d('0x2b')],'type':_0x52bf7d[_0x716d('0x2c')]['key']};});_0x46113f['model']=_[_0x716d('0x28')](_0x1d5bd5,_0x716d('0x26'));_0x46113f['query']=_[_0x716d('0x2d')](_0x419fb9[_0x716d('0x2e')]);_0x46113f[_0x716d('0x2f')]=_['intersection'](_0x46113f[_0x716d('0x30')],_0x46113f[_0x716d('0x2e')]);_0x375750['attributes']=_[_0x716d('0x31')](_0x46113f[_0x716d('0x30')],qs[_0x716d('0x32')](_0x419fb9[_0x716d('0x2e')][_0x716d('0x32')]));_0x375750[_0x716d('0x33')]=_0x375750[_0x716d('0x33')][_0x716d('0x34')]?_0x375750[_0x716d('0x33')]:_0x46113f[_0x716d('0x30')];if(!_0x419fb9[_0x716d('0x2e')][_0x716d('0x35')]('nolimit')){_0x375750[_0x716d('0x1d')]=qs[_0x716d('0x1d')](_0x419fb9['query'][_0x716d('0x1d')]);_0x375750[_0x716d('0x1a')]=qs[_0x716d('0x1a')](_0x419fb9[_0x716d('0x2e')][_0x716d('0x1a')]);}_0x375750[_0x716d('0x36')]=qs['sort'](_0x419fb9[_0x716d('0x2e')]['sort']);_0x375750[_0x716d('0x37')]=qs['filters'](_[_0x716d('0x38')](_0x419fb9[_0x716d('0x2e')],_0x46113f[_0x716d('0x2f')]),_0x1d5bd5);if(_0x419fb9[_0x716d('0x2e')]['filter']){_0x375750[_0x716d('0x37')]=_[_0x716d('0x39')](_0x375750['where'],{'$or':_[_0x716d('0x28')](_0x1d5bd5,function(_0x1c4b0e){if(_0x1c4b0e[_0x716d('0x2c')]!=='VIRTUAL'){var _0x4e6641={};_0x4e6641[_0x1c4b0e[_0x716d('0x26')]]={'$like':'%'+_0x419fb9[_0x716d('0x2e')][_0x716d('0x3a')]+'%'};return _0x4e6641;}})});}_0x375750=_[_0x716d('0x39')]({},_0x375750,_0x419fb9['options']);var _0x1df76b={'where':_0x375750[_0x716d('0x37')]};return db[_0x716d('0x29')]['count'](_0x1df76b)['then'](function(_0xc868d1){_0x460c4b['count']=_0xc868d1;if(_0x419fb9[_0x716d('0x2e')][_0x716d('0x3b')]){_0x375750[_0x716d('0x3c')]=[{'all':!![]}];}return db['IntegrationReport'][_0x716d('0x3d')](_0x375750);})[_0x716d('0x24')](function(_0x3530df){_0x460c4b[_0x716d('0x3e')]=_0x3530df;return _0x460c4b;})[_0x716d('0x24')](respondWithFilteredResult(_0x4bb5c4,_0x375750))[_0x716d('0x3f')](handleError(_0x4bb5c4,null));};exports[_0x716d('0x40')]=function(_0x5752d6,_0x53e11e){var _0x580a59={'raw':![],'where':{'id':_0x5752d6[_0x716d('0x41')]['id']}},_0xcee813={};_0xcee813[_0x716d('0x30')]=_['keys'](db['IntegrationReport']['rawAttributes']);_0xcee813['query']=_[_0x716d('0x2d')](_0x5752d6[_0x716d('0x2e')]);_0xcee813[_0x716d('0x2f')]=_[_0x716d('0x31')](_0xcee813[_0x716d('0x30')],_0xcee813[_0x716d('0x2e')]);_0x580a59[_0x716d('0x33')]=_[_0x716d('0x31')](_0xcee813[_0x716d('0x30')],qs[_0x716d('0x32')](_0x5752d6['query'][_0x716d('0x32')]));_0x580a59[_0x716d('0x33')]=_0x580a59[_0x716d('0x33')][_0x716d('0x34')]?_0x580a59[_0x716d('0x33')]:_0xcee813['model'];if(_0x5752d6[_0x716d('0x2e')][_0x716d('0x3b')]){_0x580a59[_0x716d('0x3c')]=[{'all':!![]}];}_0x580a59=_['merge']({},_0x580a59,_0x5752d6[_0x716d('0x42')]);return db[_0x716d('0x29')][_0x716d('0x43')](_0x580a59)[_0x716d('0x24')](handleEntityNotFound(_0x53e11e,null))[_0x716d('0x24')](respondWithResult(_0x53e11e,null))[_0x716d('0x3f')](handleError(_0x53e11e,null));};exports['create']=function(_0xc83c21,_0x14cf7b){return db[_0x716d('0x29')][_0x716d('0x44')](_0xc83c21[_0x716d('0x45')],{})['then'](respondWithResult(_0x14cf7b,0xc9))[_0x716d('0x3f')](handleError(_0x14cf7b,null));};exports[_0x716d('0x22')]=function(_0x196b42,_0x2f7ed9){if(_0x196b42[_0x716d('0x45')]['id']){delete _0x196b42[_0x716d('0x45')]['id'];}return db['IntegrationReport']['find']({'where':{'id':_0x196b42[_0x716d('0x41')]['id']}})['then'](handleEntityNotFound(_0x2f7ed9,null))[_0x716d('0x24')](saveUpdates(_0x196b42['body'],null))[_0x716d('0x24')](respondWithResult(_0x2f7ed9,null))['catch'](handleError(_0x2f7ed9,null));};exports[_0x716d('0x23')]=function(_0x579c2a,_0x45db28){return db[_0x716d('0x29')][_0x716d('0x43')]({'where':{'id':_0x579c2a[_0x716d('0x41')]['id']}})[_0x716d('0x24')](handleEntityNotFound(_0x45db28,null))[_0x716d('0x24')](removeEntity(_0x45db28,null))[_0x716d('0x3f')](handleError(_0x45db28,null));};exports[_0x716d('0x46')]=function(_0x542c13,_0x21d73a){return db['IntegrationReport']['describe']()[_0x716d('0x24')](respondWithResult(_0x21d73a,null))[_0x716d('0x3f')](handleError(_0x21d73a,null));}; \ No newline at end of file +var _0x0fa8=['body','update','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','reject','save','then','destroy','error','stack','name','send','index','map','IntegrationReport','rawAttributes','type','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','filter','merge','options','count','includeAll','findAll','catch','show','length','include','find','create'];(function(_0x159533,_0x2d49ce){var _0x1111f5=function(_0x2e4edc){while(--_0x2e4edc){_0x159533['push'](_0x159533['shift']());}};_0x1111f5(++_0x2d49ce);}(_0x0fa8,0x96));var _0x80fa=function(_0x335f5c,_0xce622c){_0x335f5c=_0x335f5c-0x0;var _0x27458c=_0x0fa8[_0x335f5c];return _0x27458c;};'use strict';var emlformat=require(_0x80fa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x80fa('0x1'));var jsonpatch=require(_0x80fa('0x2'));var rp=require(_0x80fa('0x3'));var moment=require('moment');var BPromise=require(_0x80fa('0x4'));var Mustache=require(_0x80fa('0x5'));var util=require(_0x80fa('0x6'));var path=require(_0x80fa('0x7'));var sox=require(_0x80fa('0x8'));var csv=require(_0x80fa('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x80fa('0xa'));var _=require(_0x80fa('0xb'));var squel=require(_0x80fa('0xc'));var crypto=require(_0x80fa('0xd'));var jsforce=require(_0x80fa('0xe'));var deskjs=require(_0x80fa('0xf'));var toCsv=require(_0x80fa('0x9'));var querystring=require('querystring');var Papa=require(_0x80fa('0x10'));var Redis=require(_0x80fa('0x11'));var authService=require(_0x80fa('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x80fa('0x13'));var hardwareService=require(_0x80fa('0x14'));var logger=require(_0x80fa('0x15'))(_0x80fa('0x16'));var utils=require(_0x80fa('0x17'));var config=require(_0x80fa('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x80fa('0x19'))['db'];function respondWithStatusCode(_0x3663a8,_0x3877bd){_0x3877bd=_0x3877bd||0xcc;return function(_0xe4a7d8){if(_0xe4a7d8){return _0x3663a8[_0x80fa('0x1a')](_0x3877bd);}return _0x3663a8[_0x80fa('0x1b')](_0x3877bd)['end']();};}function respondWithResult(_0xb9e77d,_0x1e6eab){_0x1e6eab=_0x1e6eab||0xc8;return function(_0x55637c){if(_0x55637c){return _0xb9e77d[_0x80fa('0x1b')](_0x1e6eab)[_0x80fa('0x1c')](_0x55637c);}};}function respondWithFilteredResult(_0x2d63cd,_0x303322){return function(_0x49e271){if(_0x49e271){var _0x70a2b=typeof _0x303322[_0x80fa('0x1d')]===_0x80fa('0x1e')&&typeof _0x303322[_0x80fa('0x1f')]===_0x80fa('0x1e');var _0x1d6531=_0x49e271['count'];var _0x4a35a6=_0x70a2b?0x0:_0x303322[_0x80fa('0x1d')];var _0x5f1790=_0x70a2b?_0x49e271['count']:_0x303322[_0x80fa('0x1d')]+_0x303322[_0x80fa('0x1f')];var _0x4037d7;if(_0x5f1790>=_0x1d6531){_0x5f1790=_0x1d6531;_0x4037d7=0xc8;}else{_0x4037d7=0xce;}_0x2d63cd[_0x80fa('0x1b')](_0x4037d7);return _0x2d63cd[_0x80fa('0x20')]('Content-Range',_0x4a35a6+'-'+_0x5f1790+'/'+_0x1d6531)[_0x80fa('0x1c')](_0x49e271);}return null;};}function patchUpdates(_0x18fb4c){return function(_0x50dd24){try{jsonpatch['apply'](_0x50dd24,_0x18fb4c,!![]);}catch(_0x554753){return BPromise[_0x80fa('0x21')](_0x554753);}return _0x50dd24[_0x80fa('0x22')]();};}function saveUpdates(_0x3b9dd3,_0x7732f6){return function(_0xbb1be6){if(_0xbb1be6){return _0xbb1be6['update'](_0x3b9dd3)[_0x80fa('0x23')](function(_0x13b9af){return _0x13b9af;});}return null;};}function removeEntity(_0x3ad68a,_0x2fd406){return function(_0x1f1f4a){if(_0x1f1f4a){return _0x1f1f4a[_0x80fa('0x24')]()[_0x80fa('0x23')](function(){_0x3ad68a[_0x80fa('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x583bb4,_0x4f903c){return function(_0x5d1c13){if(!_0x5d1c13){_0x583bb4[_0x80fa('0x1a')](0x194);}return _0x5d1c13;};}function handleError(_0x985e16,_0x2ee60c){_0x2ee60c=_0x2ee60c||0x1f4;return function(_0x3f9ae7){logger[_0x80fa('0x25')](_0x3f9ae7[_0x80fa('0x26')]);if(_0x3f9ae7[_0x80fa('0x27')]){delete _0x3f9ae7['name'];}_0x985e16['status'](_0x2ee60c)[_0x80fa('0x28')](_0x3f9ae7);};}exports[_0x80fa('0x29')]=function(_0x1ea004,_0x9350b3){var _0x2065a5={},_0x2fb7f3={},_0x17c71d={'count':0x0,'rows':[]};var _0x538f2f=_[_0x80fa('0x2a')](db[_0x80fa('0x2b')][_0x80fa('0x2c')],function(_0x76302f){return{'name':_0x76302f['fieldName'],'type':_0x76302f[_0x80fa('0x2d')]['key']};});_0x2fb7f3[_0x80fa('0x2e')]=_[_0x80fa('0x2a')](_0x538f2f,_0x80fa('0x27'));_0x2fb7f3[_0x80fa('0x2f')]=_[_0x80fa('0x30')](_0x1ea004[_0x80fa('0x2f')]);_0x2fb7f3['filters']=_[_0x80fa('0x31')](_0x2fb7f3[_0x80fa('0x2e')],_0x2fb7f3[_0x80fa('0x2f')]);_0x2065a5['attributes']=_[_0x80fa('0x31')](_0x2fb7f3[_0x80fa('0x2e')],qs[_0x80fa('0x32')](_0x1ea004[_0x80fa('0x2f')][_0x80fa('0x32')]));_0x2065a5[_0x80fa('0x33')]=_0x2065a5[_0x80fa('0x33')]['length']?_0x2065a5[_0x80fa('0x33')]:_0x2fb7f3[_0x80fa('0x2e')];if(!_0x1ea004[_0x80fa('0x2f')][_0x80fa('0x34')](_0x80fa('0x35'))){_0x2065a5[_0x80fa('0x1f')]=qs[_0x80fa('0x1f')](_0x1ea004[_0x80fa('0x2f')][_0x80fa('0x1f')]);_0x2065a5[_0x80fa('0x1d')]=qs[_0x80fa('0x1d')](_0x1ea004[_0x80fa('0x2f')]['offset']);}_0x2065a5['order']=qs['sort'](_0x1ea004[_0x80fa('0x2f')][_0x80fa('0x36')]);_0x2065a5[_0x80fa('0x37')]=qs[_0x80fa('0x38')](_['pick'](_0x1ea004[_0x80fa('0x2f')],_0x2fb7f3[_0x80fa('0x38')]),_0x538f2f);if(_0x1ea004[_0x80fa('0x2f')][_0x80fa('0x39')]){_0x2065a5[_0x80fa('0x37')]=_[_0x80fa('0x3a')](_0x2065a5[_0x80fa('0x37')],{'$or':_[_0x80fa('0x2a')](_0x538f2f,function(_0x5d2e83){if(_0x5d2e83[_0x80fa('0x2d')]!=='VIRTUAL'){var _0x1306b3={};_0x1306b3[_0x5d2e83[_0x80fa('0x27')]]={'$like':'%'+_0x1ea004[_0x80fa('0x2f')]['filter']+'%'};return _0x1306b3;}})});}_0x2065a5=_[_0x80fa('0x3a')]({},_0x2065a5,_0x1ea004[_0x80fa('0x3b')]);var _0x20a911={'where':_0x2065a5['where']};return db[_0x80fa('0x2b')][_0x80fa('0x3c')](_0x20a911)[_0x80fa('0x23')](function(_0x102ab6){_0x17c71d[_0x80fa('0x3c')]=_0x102ab6;if(_0x1ea004[_0x80fa('0x2f')][_0x80fa('0x3d')]){_0x2065a5['include']=[{'all':!![]}];}return db['IntegrationReport'][_0x80fa('0x3e')](_0x2065a5);})[_0x80fa('0x23')](function(_0x1da183){_0x17c71d['rows']=_0x1da183;return _0x17c71d;})[_0x80fa('0x23')](respondWithFilteredResult(_0x9350b3,_0x2065a5))[_0x80fa('0x3f')](handleError(_0x9350b3,null));};exports[_0x80fa('0x40')]=function(_0x52e099,_0x2e8d44){var _0x3bdf27={'raw':![],'where':{'id':_0x52e099['params']['id']}},_0x44f52d={};_0x44f52d[_0x80fa('0x2e')]=_[_0x80fa('0x30')](db[_0x80fa('0x2b')][_0x80fa('0x2c')]);_0x44f52d[_0x80fa('0x2f')]=_[_0x80fa('0x30')](_0x52e099[_0x80fa('0x2f')]);_0x44f52d['filters']=_[_0x80fa('0x31')](_0x44f52d[_0x80fa('0x2e')],_0x44f52d['query']);_0x3bdf27[_0x80fa('0x33')]=_['intersection'](_0x44f52d['model'],qs[_0x80fa('0x32')](_0x52e099['query']['fields']));_0x3bdf27[_0x80fa('0x33')]=_0x3bdf27[_0x80fa('0x33')][_0x80fa('0x41')]?_0x3bdf27[_0x80fa('0x33')]:_0x44f52d[_0x80fa('0x2e')];if(_0x52e099['query'][_0x80fa('0x3d')]){_0x3bdf27[_0x80fa('0x42')]=[{'all':!![]}];}_0x3bdf27=_[_0x80fa('0x3a')]({},_0x3bdf27,_0x52e099[_0x80fa('0x3b')]);return db[_0x80fa('0x2b')][_0x80fa('0x43')](_0x3bdf27)['then'](handleEntityNotFound(_0x2e8d44,null))[_0x80fa('0x23')](respondWithResult(_0x2e8d44,null))[_0x80fa('0x3f')](handleError(_0x2e8d44,null));};exports[_0x80fa('0x44')]=function(_0x3b05fa,_0x2ea0a2){return db['IntegrationReport'][_0x80fa('0x44')](_0x3b05fa[_0x80fa('0x45')],{})[_0x80fa('0x23')](respondWithResult(_0x2ea0a2,0xc9))['catch'](handleError(_0x2ea0a2,null));};exports[_0x80fa('0x46')]=function(_0x49447b,_0x199663){if(_0x49447b['body']['id']){delete _0x49447b['body']['id'];}return db[_0x80fa('0x2b')][_0x80fa('0x43')]({'where':{'id':_0x49447b[_0x80fa('0x47')]['id']}})[_0x80fa('0x23')](handleEntityNotFound(_0x199663,null))[_0x80fa('0x23')](saveUpdates(_0x49447b[_0x80fa('0x45')],null))['then'](respondWithResult(_0x199663,null))[_0x80fa('0x3f')](handleError(_0x199663,null));};exports[_0x80fa('0x24')]=function(_0x89e226,_0x316864){return db['IntegrationReport']['find']({'where':{'id':_0x89e226['params']['id']}})['then'](handleEntityNotFound(_0x316864,null))[_0x80fa('0x23')](removeEntity(_0x316864,null))[_0x80fa('0x3f')](handleError(_0x316864,null));};exports[_0x80fa('0x48')]=function(_0x303900,_0x13182a){return db[_0x80fa('0x2b')][_0x80fa('0x48')]()[_0x80fa('0x23')](respondWithResult(_0x13182a,null))['catch'](handleError(_0x13182a,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 5a18e21..a862456 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 _0x8f96=['lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./integrationReport.attributes','exports','define','report_integration'];(function(_0x63550,_0x1526ec){var _0xcae97a=function(_0x5e0b65){while(--_0x5e0b65){_0x63550['push'](_0x63550['shift']());}};_0xcae97a(++_0x1526ec);}(_0x8f96,0x122));var _0x68f9=function(_0x14ec89,_0x3d481a){_0x14ec89=_0x14ec89-0x0;var _0x24f5c9=_0x8f96[_0x14ec89];return _0x24f5c9;};'use strict';var _=require(_0x68f9('0x0'));var util=require('util');var logger=require(_0x68f9('0x1'))('api');var moment=require(_0x68f9('0x2'));var BPromise=require('bluebird');var rp=require(_0x68f9('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x68f9('0x4'));var config=require(_0x68f9('0x5'));var attributes=require(_0x68f9('0x6'));module[_0x68f9('0x7')]=function(_0x427b93,_0x2aebde){return _0x427b93[_0x68f9('0x8')]('IntegrationReport',attributes,{'tableName':_0x68f9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1dc6=['path','rimraf','../../config/environment','exports','define','IntegrationReport','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x12ddb2,_0x5ad61e){var _0x10b6dd=function(_0x47dd27){while(--_0x47dd27){_0x12ddb2['push'](_0x12ddb2['shift']());}};_0x10b6dd(++_0x5ad61e);}(_0x1dc6,0x1da));var _0x61dc=function(_0x24cb80,_0x5e55d2){_0x24cb80=_0x24cb80-0x0;var _0x16d074=_0x1dc6[_0x24cb80];return _0x16d074;};'use strict';var _=require(_0x61dc('0x0'));var util=require(_0x61dc('0x1'));var logger=require(_0x61dc('0x2'))('api');var moment=require(_0x61dc('0x3'));var BPromise=require(_0x61dc('0x4'));var rp=require(_0x61dc('0x5'));var fs=require('fs');var path=require(_0x61dc('0x6'));var rimraf=require(_0x61dc('0x7'));var config=require(_0x61dc('0x8'));var attributes=require('./integrationReport.attributes');module[_0x61dc('0x9')]=function(_0x230a9b,_0x451596){return _0x230a9b[_0x61dc('0xa')](_0x61dc('0xb'),attributes,{'tableName':'report_integration','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 f4080e6..1dc4611 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 _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x53ec,0x192));var _0xc53e=function(_0x36f5b7,_0x1514ca){_0x36f5b7=_0x36f5b7-0x0;var _0x495dfb=_0x53ec[_0x36f5b7];return _0x495dfb;};'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')]('IntegrationReport,\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 +var _0x326f=['info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x5861e1,_0x3813bb){var _0x357064=function(_0x338356){while(--_0x338356){_0x5861e1['push'](_0x5861e1['shift']());}};_0x357064(++_0x3813bb);}(_0x326f,0xd1));var _0xf326=function(_0x5c4008,_0x356474){_0x5c4008=_0x5c4008-0x0;var _0x3af60f=_0x326f[_0x5c4008];return _0x3af60f;};'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')]('IntegrationReport,\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')]('IntegrationReport,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index bf97cb6..b25d40d 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 _0xdb8b=['index','/:id','isAuthenticated','show','/:id/sub_intervals','post','create','addInterval','put','delete','destroy','exports','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./interval.controller','get'];(function(_0x5769ee,_0x25e241){var _0x554b62=function(_0x482399){while(--_0x482399){_0x5769ee['push'](_0x5769ee['shift']());}};_0x554b62(++_0x25e241);}(_0xdb8b,0x1c4));var _0xbdb8=function(_0x5cd062,_0x369d40){_0x5cd062=_0x5cd062-0x0;var _0x9c56d3=_0xdb8b[_0x5cd062];return _0x9c56d3;};'use strict';var multer=require('multer');var util=require(_0xbdb8('0x0'));var path=require(_0xbdb8('0x1'));var timeout=require(_0xbdb8('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xbdb8('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xbdb8('0x4'));var config=require(_0xbdb8('0x5'));var controller=require(_0xbdb8('0x6'));router[_0xbdb8('0x7')]('/',auth['isAuthenticated'](),controller[_0xbdb8('0x8')]);router['get'](_0xbdb8('0x9'),auth[_0xbdb8('0xa')](),controller[_0xbdb8('0xb')]);router[_0xbdb8('0x7')](_0xbdb8('0xc'),auth[_0xbdb8('0xa')](),controller['getIntervals']);router[_0xbdb8('0xd')]('/',auth[_0xbdb8('0xa')](),controller[_0xbdb8('0xe')]);router[_0xbdb8('0xd')](_0xbdb8('0xc'),auth[_0xbdb8('0xa')](),controller[_0xbdb8('0xf')]);router['post']('/:id/sub_intervals/create_many',auth[_0xbdb8('0xa')](),controller['addIntervals']);router[_0xbdb8('0x10')]('/:id',auth[_0xbdb8('0xa')](),controller['update']);router[_0xbdb8('0x11')](_0xbdb8('0x9'),auth[_0xbdb8('0xa')](),controller[_0xbdb8('0x12')]);module[_0xbdb8('0x13')]=router; \ No newline at end of file +var _0x71ab=['index','/:id','show','/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','update','delete','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated'];(function(_0x30e39c,_0x40752b){var _0x34abe6=function(_0x44fbb0){while(--_0x44fbb0){_0x30e39c['push'](_0x30e39c['shift']());}};_0x34abe6(++_0x40752b);}(_0x71ab,0x64));var _0xb71a=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x71ab[_0x21a9d9];return _0x46adce;};'use strict';var multer=require('multer');var util=require(_0xb71a('0x0'));var path=require('path');var timeout=require(_0xb71a('0x1'));var express=require('express');var router=express[_0xb71a('0x2')]();var fs_extra=require(_0xb71a('0x3'));var auth=require(_0xb71a('0x4'));var interaction=require(_0xb71a('0x5'));var config=require(_0xb71a('0x6'));var controller=require(_0xb71a('0x7'));router[_0xb71a('0x8')]('/',auth[_0xb71a('0x9')](),controller[_0xb71a('0xa')]);router[_0xb71a('0x8')](_0xb71a('0xb'),auth[_0xb71a('0x9')](),controller[_0xb71a('0xc')]);router[_0xb71a('0x8')](_0xb71a('0xd'),auth[_0xb71a('0x9')](),controller[_0xb71a('0xe')]);router[_0xb71a('0xf')]('/',auth['isAuthenticated'](),controller[_0xb71a('0x10')]);router['post'](_0xb71a('0xd'),auth[_0xb71a('0x9')](),controller[_0xb71a('0x11')]);router['post'](_0xb71a('0x12'),auth['isAuthenticated'](),controller[_0xb71a('0x13')]);router['put']('/:id',auth[_0xb71a('0x9')](),controller[_0xb71a('0x14')]);router[_0xb71a('0x15')](_0xb71a('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 8e61cf0..73d348d 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 _0xb417=['STRING','sequelize'];(function(_0x18145c,_0x23c102){var _0x52dd35=function(_0x27ca0a){while(--_0x27ca0a){_0x18145c['push'](_0x18145c['shift']());}};_0x52dd35(++_0x23c102);}(_0xb417,0xbb));var _0x7b41=function(_0xab0f7f,_0x257f4f){_0xab0f7f=_0xab0f7f-0x0;var _0x6f2f93=_0xb417[_0xab0f7f];return _0x6f2f93;};'use strict';var Sequelize=require(_0x7b41('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b41('0x1')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x7b41('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x8ec7=['STRING','sequelize','exports'];(function(_0x3633ca,_0x2d6b25){var _0x53767e=function(_0x1d3f9b){while(--_0x1d3f9b){_0x3633ca['push'](_0x3633ca['shift']());}};_0x53767e(++_0x2d6b25);}(_0x8ec7,0x109));var _0x78ec=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0x8ec7[_0xf0bcac];return _0x4e4c65;};'use strict';var Sequelize=require(_0x78ec('0x0'));module[_0x78ec('0x1')]={'name':{'type':Sequelize[_0x78ec('0x2')]},'description':{'type':Sequelize[_0x78ec('0x2')]},'interval':{'type':Sequelize[_0x78ec('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index cfde43c..d8e53e3 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 _0x9bb4=['options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','IntervalId','getIntervals','findOne','order','sort','hasOwnProperty','addIntervals','sequelize','transaction','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','Intervals','UserProfileResource','destroy','error','stack','name','index','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','nolimit','where','pick','filter','merge','VIRTUAL','includeAll','include','Interval','findAll','rows','catch','show','params','rawAttributes'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x9bb4,0x6e));var _0x49bb=function(_0xf8759f,_0x252345){_0xf8759f=_0xf8759f-0x0;var _0x4e9a9f=_0x9bb4[_0xf8759f];return _0x4e9a9f;};'use strict';var emlformat=require(_0x49bb('0x0'));var rimraf=require(_0x49bb('0x1'));var zipdir=require(_0x49bb('0x2'));var jsonpatch=require(_0x49bb('0x3'));var rp=require('request-promise');var moment=require(_0x49bb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x49bb('0x5'));var util=require(_0x49bb('0x6'));var path=require(_0x49bb('0x7'));var sox=require('sox');var csv=require(_0x49bb('0x8'));var ejs=require(_0x49bb('0x9'));var fs=require('fs');var fs_extra=require(_0x49bb('0xa'));var _=require(_0x49bb('0xb'));var squel=require(_0x49bb('0xc'));var crypto=require(_0x49bb('0xd'));var jsforce=require(_0x49bb('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x49bb('0x8'));var querystring=require(_0x49bb('0xf'));var Papa=require(_0x49bb('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49bb('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x49bb('0x12'));var logger=require(_0x49bb('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49bb('0x14'));var db=require(_0x49bb('0x15'))['db'];var extensions=require(_0x49bb('0x16'));function respondWithStatusCode(_0x31272c,_0x212aba){_0x212aba=_0x212aba||0xcc;return function(_0x3ac126){if(_0x3ac126){return _0x31272c[_0x49bb('0x17')](_0x212aba);}return _0x31272c[_0x49bb('0x18')](_0x212aba)['end']();};}function respondWithResult(_0x462750,_0x5576d5){_0x5576d5=_0x5576d5||0xc8;return function(_0x92ce68){if(_0x92ce68){return _0x462750[_0x49bb('0x18')](_0x5576d5)[_0x49bb('0x19')](_0x92ce68);}};}function respondWithFilteredResult(_0x3ff292,_0xd9a692){return function(_0x348be5){if(_0x348be5){var _0x49f580=typeof _0xd9a692[_0x49bb('0x1a')]===_0x49bb('0x1b')&&typeof _0xd9a692[_0x49bb('0x1c')]===_0x49bb('0x1b');var _0x3ee4fc=_0x348be5[_0x49bb('0x1d')];var _0xd17c24=_0x49f580?0x0:_0xd9a692[_0x49bb('0x1a')];var _0x49d0cb=_0x49f580?_0x348be5['count']:_0xd9a692[_0x49bb('0x1a')]+_0xd9a692[_0x49bb('0x1c')];var _0x545ef2;if(_0x49d0cb>=_0x3ee4fc){_0x49d0cb=_0x3ee4fc;_0x545ef2=0xc8;}else{_0x545ef2=0xce;}_0x3ff292[_0x49bb('0x18')](_0x545ef2);return _0x3ff292[_0x49bb('0x1e')](_0x49bb('0x1f'),_0xd17c24+'-'+_0x49d0cb+'/'+_0x3ee4fc)[_0x49bb('0x19')](_0x348be5);}return null;};}function patchUpdates(_0x46af8d){return function(_0x19dd95){try{jsonpatch[_0x49bb('0x20')](_0x19dd95,_0x46af8d,!![]);}catch(_0x53aa73){return BPromise[_0x49bb('0x21')](_0x53aa73);}return _0x19dd95[_0x49bb('0x22')]();};}function saveUpdates(_0x4b0f1d,_0x15d8b6){return function(_0x25a728){if(_0x25a728){return _0x25a728[_0x49bb('0x23')](_0x4b0f1d)[_0x49bb('0x24')](function(_0x120ccd){return _0x120ccd;});}return null;};}function removeEntity(_0x3a4890,_0x11cd01){return function(_0x1296db){if(_0x1296db){return _0x1296db['destroy']()[_0x49bb('0x24')](function(){var _0x4c5c91=_0x1296db[_0x49bb('0x25')]({'plain':!![]});var _0xbc715=_0x49bb('0x26');return db[_0x49bb('0x27')][_0x49bb('0x28')]({'where':{'type':_0xbc715,'resourceId':_0x4c5c91['id']}})[_0x49bb('0x24')](function(){return _0x1296db;});})[_0x49bb('0x24')](function(){_0x3a4890['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c696a,_0x22a8e2){return function(_0x21d22a){if(!_0x21d22a){_0x3c696a[_0x49bb('0x17')](0x194);}return _0x21d22a;};}function handleError(_0x88bbaa,_0x35179e){_0x35179e=_0x35179e||0x1f4;return function(_0x49a8a5){logger[_0x49bb('0x29')](_0x49a8a5[_0x49bb('0x2a')]);if(_0x49a8a5['name']){delete _0x49a8a5[_0x49bb('0x2b')];}_0x88bbaa['status'](_0x35179e)['send'](_0x49a8a5);};}exports[_0x49bb('0x2c')]=function(_0x33c2ef,_0x558497){var _0x56efb8={},_0x39d463={},_0xae9e09={'count':0x0,'rows':[]};var _0x17ee4=_['map'](db['Interval']['rawAttributes'],function(_0xe09414){return{'name':_0xe09414[_0x49bb('0x2d')],'type':_0xe09414[_0x49bb('0x2e')][_0x49bb('0x2f')]};});_0x39d463[_0x49bb('0x30')]=_[_0x49bb('0x31')](_0x17ee4,_0x49bb('0x2b'));_0x39d463['query']=_[_0x49bb('0x32')](_0x33c2ef[_0x49bb('0x33')]);_0x39d463[_0x49bb('0x34')]=_[_0x49bb('0x35')](_0x39d463['model'],_0x39d463[_0x49bb('0x33')]);_0x56efb8[_0x49bb('0x36')]=_[_0x49bb('0x35')](_0x39d463['model'],qs[_0x49bb('0x37')](_0x33c2ef[_0x49bb('0x33')][_0x49bb('0x37')]));_0x56efb8['attributes']=_0x56efb8[_0x49bb('0x36')][_0x49bb('0x38')]?_0x56efb8[_0x49bb('0x36')]:_0x39d463[_0x49bb('0x30')];if(!_0x33c2ef['query']['hasOwnProperty'](_0x49bb('0x39'))){_0x56efb8[_0x49bb('0x1c')]=qs[_0x49bb('0x1c')](_0x33c2ef[_0x49bb('0x33')][_0x49bb('0x1c')]);_0x56efb8[_0x49bb('0x1a')]=qs['offset'](_0x33c2ef[_0x49bb('0x33')][_0x49bb('0x1a')]);}_0x56efb8['order']=qs['sort'](_0x33c2ef[_0x49bb('0x33')]['sort']);_0x56efb8[_0x49bb('0x3a')]=qs[_0x49bb('0x34')](_[_0x49bb('0x3b')](_0x33c2ef['query'],_0x39d463[_0x49bb('0x34')]),_0x17ee4);if(_0x33c2ef[_0x49bb('0x33')][_0x49bb('0x3c')]){_0x56efb8[_0x49bb('0x3a')]=_[_0x49bb('0x3d')](_0x56efb8[_0x49bb('0x3a')],{'$or':_[_0x49bb('0x31')](_0x17ee4,function(_0x35f407){if(_0x35f407[_0x49bb('0x2e')]!==_0x49bb('0x3e')){var _0x26e495={};_0x26e495[_0x35f407[_0x49bb('0x2b')]]={'$like':'%'+_0x33c2ef[_0x49bb('0x33')][_0x49bb('0x3c')]+'%'};return _0x26e495;}})});}_0x56efb8=_[_0x49bb('0x3d')]({},_0x56efb8,_0x33c2ef['options']);var _0x1688d1={'where':_0x56efb8[_0x49bb('0x3a')]};return db['Interval']['count'](_0x1688d1)['then'](function(_0x144b6b){_0xae9e09[_0x49bb('0x1d')]=_0x144b6b;if(_0x33c2ef['query'][_0x49bb('0x3f')]){_0x56efb8[_0x49bb('0x40')]=[{'all':!![]}];}return db[_0x49bb('0x41')][_0x49bb('0x42')](_0x56efb8);})[_0x49bb('0x24')](function(_0x386faa){_0xae9e09[_0x49bb('0x43')]=_0x386faa;return _0xae9e09;})[_0x49bb('0x24')](respondWithFilteredResult(_0x558497,_0x56efb8))[_0x49bb('0x44')](handleError(_0x558497,null));};exports[_0x49bb('0x45')]=function(_0x29f2b7,_0x1d7ffb){var _0x18d593={'raw':!![],'where':{'id':_0x29f2b7[_0x49bb('0x46')]['id']}},_0x9fd076={};_0x9fd076['model']=_[_0x49bb('0x32')](db[_0x49bb('0x41')][_0x49bb('0x47')]);_0x9fd076[_0x49bb('0x33')]=_[_0x49bb('0x32')](_0x29f2b7[_0x49bb('0x33')]);_0x9fd076['filters']=_[_0x49bb('0x35')](_0x9fd076[_0x49bb('0x30')],_0x9fd076[_0x49bb('0x33')]);_0x18d593[_0x49bb('0x36')]=_[_0x49bb('0x35')](_0x9fd076[_0x49bb('0x30')],qs[_0x49bb('0x37')](_0x29f2b7[_0x49bb('0x33')][_0x49bb('0x37')]));_0x18d593[_0x49bb('0x36')]=_0x18d593[_0x49bb('0x36')][_0x49bb('0x38')]?_0x18d593[_0x49bb('0x36')]:_0x9fd076[_0x49bb('0x30')];if(_0x29f2b7[_0x49bb('0x33')]['includeAll']){_0x18d593[_0x49bb('0x40')]=[{'all':!![]}];}_0x18d593=_['merge']({},_0x18d593,_0x29f2b7[_0x49bb('0x48')]);return db[_0x49bb('0x41')][_0x49bb('0x49')](_0x18d593)['then'](handleEntityNotFound(_0x1d7ffb,null))[_0x49bb('0x24')](respondWithResult(_0x1d7ffb,null))[_0x49bb('0x44')](handleError(_0x1d7ffb,null));};exports[_0x49bb('0x4a')]=function(_0x271fc8,_0x17e319){return db[_0x49bb('0x41')][_0x49bb('0x4a')](_0x271fc8[_0x49bb('0x4b')],{})[_0x49bb('0x24')](function(_0x124e63){var _0x3afc65=_0x271fc8[_0x49bb('0x4c')][_0x49bb('0x25')]({'plain':!![]});if(!_0x3afc65)throw new Error(_0x49bb('0x4d'));if(_0x3afc65['role']==='user'){var _0x6fd55=_0x124e63[_0x49bb('0x25')]({'plain':!![]});var _0xd94530=_0x49bb('0x26');return db[_0x49bb('0x4e')][_0x49bb('0x49')]({'where':{'name':_0xd94530,'userProfileId':_0x3afc65[_0x49bb('0x4f')]},'raw':!![]})[_0x49bb('0x24')](function(_0x15cba4){if(_0x15cba4&&_0x15cba4[_0x49bb('0x50')]===0x0){return db[_0x49bb('0x27')][_0x49bb('0x4a')]({'name':_0x6fd55[_0x49bb('0x2b')],'resourceId':_0x6fd55['id'],'type':_0x15cba4[_0x49bb('0x2b')],'sectionId':_0x15cba4['id']},{})[_0x49bb('0x24')](function(){return _0x124e63;});}else{return _0x124e63;}})[_0x49bb('0x44')](function(_0x48ba92){logger[_0x49bb('0x29')](_0x49bb('0x51'),_0x48ba92);throw _0x48ba92;});}return _0x124e63;})[_0x49bb('0x24')](respondWithResult(_0x17e319,0xc9))[_0x49bb('0x44')](handleError(_0x17e319,null));};exports[_0x49bb('0x23')]=function(_0x46fa0b,_0x5eca03){if(_0x46fa0b[_0x49bb('0x4b')]['id']){delete _0x46fa0b['body']['id'];}return db[_0x49bb('0x41')][_0x49bb('0x49')]({'where':{'id':_0x46fa0b[_0x49bb('0x46')]['id']}})[_0x49bb('0x24')](handleEntityNotFound(_0x5eca03,null))[_0x49bb('0x24')](saveUpdates(_0x46fa0b[_0x49bb('0x4b')],null))[_0x49bb('0x24')](respondWithResult(_0x5eca03,null))['catch'](handleError(_0x5eca03,null));};exports[_0x49bb('0x28')]=function(_0x3fb810,_0x410c16){return db[_0x49bb('0x41')]['find']({'where':{'id':_0x3fb810['params']['id']}})['then'](handleEntityNotFound(_0x410c16,null))[_0x49bb('0x24')](removeEntity(_0x410c16,null))[_0x49bb('0x44')](handleError(_0x410c16,null));};exports['addInterval']=function(_0x2a361c,_0x18785c,_0xbaa94e){if(_0x2a361c[_0x49bb('0x4b')]['id']){delete _0x2a361c[_0x49bb('0x4b')]['id'];}return db[_0x49bb('0x41')][_0x49bb('0x49')]({'where':{'id':_0x2a361c[_0x49bb('0x46')]['id']}})['then'](handleEntityNotFound(_0x18785c,null))['then'](function(_0x41347d){if(_0x41347d){_0x2a361c[_0x49bb('0x4b')][_0x49bb('0x52')]=_0x41347d['id'];return db[_0x49bb('0x41')][_0x49bb('0x4a')](_0x2a361c[_0x49bb('0x4b')]);}})[_0x49bb('0x24')](respondWithResult(_0x18785c,null))['catch'](handleError(_0x18785c,null));};exports[_0x49bb('0x53')]=function(_0x3ac48d,_0x76a7d,_0xc79fbc){var _0x7949e={};var _0x44ec44={};var _0x2a0b60;var _0x2ac8c7;return db[_0x49bb('0x41')][_0x49bb('0x54')]({'where':{'id':_0x3ac48d[_0x49bb('0x46')]['id']}})[_0x49bb('0x24')](handleEntityNotFound(_0x76a7d,null))[_0x49bb('0x24')](function(_0x2bf235){if(_0x2bf235){_0x2a0b60=_0x2bf235;_0x44ec44[_0x49bb('0x30')]=_['keys'](db[_0x49bb('0x41')][_0x49bb('0x47')]);_0x44ec44[_0x49bb('0x33')]=_[_0x49bb('0x32')](_0x3ac48d[_0x49bb('0x33')]);_0x44ec44[_0x49bb('0x34')]=_[_0x49bb('0x35')](_0x44ec44[_0x49bb('0x30')],_0x44ec44[_0x49bb('0x33')]);_0x7949e[_0x49bb('0x36')]=_['intersection'](_0x44ec44[_0x49bb('0x30')],qs[_0x49bb('0x37')](_0x3ac48d[_0x49bb('0x33')]['fields']));_0x7949e['attributes']=_0x7949e[_0x49bb('0x36')][_0x49bb('0x38')]?_0x7949e[_0x49bb('0x36')]:_0x44ec44[_0x49bb('0x30')];_0x7949e[_0x49bb('0x55')]=qs[_0x49bb('0x56')](_0x3ac48d[_0x49bb('0x33')][_0x49bb('0x56')]);_0x7949e['where']=qs['filters'](_[_0x49bb('0x3b')](_0x3ac48d[_0x49bb('0x33')],_0x44ec44[_0x49bb('0x34')]));if(_0x3ac48d[_0x49bb('0x33')][_0x49bb('0x3c')]){_0x7949e[_0x49bb('0x3a')]=_['merge'](_0x7949e[_0x49bb('0x3a')],{'$or':_[_0x49bb('0x31')](_0x7949e[_0x49bb('0x36')],function(_0x3f6bea){var _0x3a8573={};_0x3a8573[_0x3f6bea]={'$like':'%'+_0x3ac48d[_0x49bb('0x33')][_0x49bb('0x3c')]+'%'};return _0x3a8573;})});}_0x7949e=_[_0x49bb('0x3d')]({},_0x7949e,_0x3ac48d[_0x49bb('0x48')]);return _0x2a0b60[_0x49bb('0x53')](_0x7949e);}})[_0x49bb('0x24')](function(_0x1d1823){if(_0x1d1823){_0x2ac8c7=_0x1d1823[_0x49bb('0x38')];if(!_0x3ac48d[_0x49bb('0x33')][_0x49bb('0x57')](_0x49bb('0x39'))){_0x7949e[_0x49bb('0x1c')]=qs[_0x49bb('0x1c')](_0x3ac48d['query'][_0x49bb('0x1c')]);_0x7949e['offset']=qs[_0x49bb('0x1a')](_0x3ac48d[_0x49bb('0x33')][_0x49bb('0x1a')]);}return _0x2a0b60[_0x49bb('0x53')](_0x7949e);}})[_0x49bb('0x24')](function(_0x32a24a){if(_0x32a24a){return _0x32a24a?{'count':_0x2ac8c7,'rows':_0x32a24a}:null;}})[_0x49bb('0x24')](respondWithResult(_0x76a7d,null))['catch'](handleError(_0x76a7d,null));};exports[_0x49bb('0x58')]=function(_0x5d9656,_0x318a6f,_0x246777){return db[_0x49bb('0x41')][_0x49bb('0x54')]({'where':{'id':_0x5d9656[_0x49bb('0x46')]['id']}})[_0x49bb('0x24')](handleEntityNotFound(_0x318a6f,null))[_0x49bb('0x24')](function(_0x42745f){if(_0x42745f){return db[_0x49bb('0x59')][_0x49bb('0x5a')](function(_0x100f71){return db[_0x49bb('0x41')]['destroy']({'where':{'IntervalId':_0x5d9656[_0x49bb('0x46')]['id']},'transaction':_0x100f71})[_0x49bb('0x24')](function(_0x3e7f34){var _0x336fcb=_[_0x49bb('0x31')](_0x5d9656[_0x49bb('0x4b')],function(_0x5d70df){delete _0x5d70df['id'];_0x5d70df[_0x49bb('0x52')]=_0x5d9656['params']['id'];return _0x5d70df;});return db['Interval']['bulkCreate'](_0x336fcb,{'transaction':_0x100f71});});})[_0x49bb('0x24')](function(){return db[_0x49bb('0x41')]['findAll']({'where':{'IntervalId':_0x5d9656[_0x49bb('0x46')]['id']}});});}})[_0x49bb('0x24')](respondWithResult(_0x318a6f,null))['catch'](handleError(_0x318a6f,null));}; \ No newline at end of file +var _0xb805=['show','params','Interval','rawAttributes','includeAll','merge','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','autoAssociation','catch','error','IntervalId','getIntervals','findOne','hasOwnProperty','transaction','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then','destroy','get','Intervals','UserProfileResource','stack','send','index','map','type','key','keys','filters','intersection','model','query','attributes','fields','length','nolimit','order','sort','where','filter','name','options','count','include'];(function(_0x40e2f5,_0x57482d){var _0x37c094=function(_0x218dbd){while(--_0x218dbd){_0x40e2f5['push'](_0x40e2f5['shift']());}};_0x37c094(++_0x57482d);}(_0xb805,0x1d2));var _0x5b80=function(_0x3cbb2c,_0x31b49e){_0x3cbb2c=_0x3cbb2c-0x0;var _0x54ab87=_0xb805[_0x3cbb2c];return _0x54ab87;};'use strict';var emlformat=require(_0x5b80('0x0'));var rimraf=require(_0x5b80('0x1'));var zipdir=require(_0x5b80('0x2'));var jsonpatch=require(_0x5b80('0x3'));var rp=require(_0x5b80('0x4'));var moment=require(_0x5b80('0x5'));var BPromise=require(_0x5b80('0x6'));var Mustache=require(_0x5b80('0x7'));var util=require(_0x5b80('0x8'));var path=require(_0x5b80('0x9'));var sox=require(_0x5b80('0xa'));var csv=require(_0x5b80('0xb'));var ejs=require(_0x5b80('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5b80('0xd'));var crypto=require(_0x5b80('0xe'));var jsforce=require(_0x5b80('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x5b80('0xb'));var querystring=require('querystring');var Papa=require(_0x5b80('0x10'));var Redis=require(_0x5b80('0x11'));var authService=require(_0x5b80('0x12'));var qs=require(_0x5b80('0x13'));var as=require(_0x5b80('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5b80('0x15'))(_0x5b80('0x16'));var utils=require(_0x5b80('0x17'));var config=require(_0x5b80('0x18'));var licenseUtil=require(_0x5b80('0x19'));var db=require(_0x5b80('0x1a'))['db'];var extensions=require(_0x5b80('0x1b'));function respondWithStatusCode(_0x30fa61,_0x31ccd5){_0x31ccd5=_0x31ccd5||0xcc;return function(_0x5c0a37){if(_0x5c0a37){return _0x30fa61[_0x5b80('0x1c')](_0x31ccd5);}return _0x30fa61[_0x5b80('0x1d')](_0x31ccd5)[_0x5b80('0x1e')]();};}function respondWithResult(_0x4bec31,_0x111095){_0x111095=_0x111095||0xc8;return function(_0x1e61c2){if(_0x1e61c2){return _0x4bec31['status'](_0x111095)[_0x5b80('0x1f')](_0x1e61c2);}};}function respondWithFilteredResult(_0x4226e8,_0x27c229){return function(_0x4878b6){if(_0x4878b6){var _0x2d411b=typeof _0x27c229[_0x5b80('0x20')]===_0x5b80('0x21')&&typeof _0x27c229[_0x5b80('0x22')]==='undefined';var _0x4d1556=_0x4878b6['count'];var _0x366067=_0x2d411b?0x0:_0x27c229[_0x5b80('0x20')];var _0x107979=_0x2d411b?_0x4878b6['count']:_0x27c229[_0x5b80('0x20')]+_0x27c229[_0x5b80('0x22')];var _0x2d5cd4;if(_0x107979>=_0x4d1556){_0x107979=_0x4d1556;_0x2d5cd4=0xc8;}else{_0x2d5cd4=0xce;}_0x4226e8['status'](_0x2d5cd4);return _0x4226e8['set'](_0x5b80('0x23'),_0x366067+'-'+_0x107979+'/'+_0x4d1556)[_0x5b80('0x1f')](_0x4878b6);}return null;};}function patchUpdates(_0x595b4c){return function(_0x540337){try{jsonpatch[_0x5b80('0x24')](_0x540337,_0x595b4c,!![]);}catch(_0x289df3){return BPromise[_0x5b80('0x25')](_0x289df3);}return _0x540337[_0x5b80('0x26')]();};}function saveUpdates(_0x1ab7fb,_0x1b6bc1){return function(_0x460eb1){if(_0x460eb1){return _0x460eb1[_0x5b80('0x27')](_0x1ab7fb)[_0x5b80('0x28')](function(_0x1cf6fd){return _0x1cf6fd;});}return null;};}function removeEntity(_0x3d10a3,_0x2a3302){return function(_0x2f2a3c){if(_0x2f2a3c){return _0x2f2a3c[_0x5b80('0x29')]()[_0x5b80('0x28')](function(){var _0x37861b=_0x2f2a3c[_0x5b80('0x2a')]({'plain':!![]});var _0x4125fe=_0x5b80('0x2b');return db[_0x5b80('0x2c')][_0x5b80('0x29')]({'where':{'type':_0x4125fe,'resourceId':_0x37861b['id']}})[_0x5b80('0x28')](function(){return _0x2f2a3c;});})['then'](function(){_0x3d10a3[_0x5b80('0x1d')](0xcc)[_0x5b80('0x1e')]();});}};}function handleEntityNotFound(_0x1cbde7,_0x180ccf){return function(_0x596ebd){if(!_0x596ebd){_0x1cbde7[_0x5b80('0x1c')](0x194);}return _0x596ebd;};}function handleError(_0x2770dc,_0x5a9e1b){_0x5a9e1b=_0x5a9e1b||0x1f4;return function(_0xda939c){logger['error'](_0xda939c[_0x5b80('0x2d')]);if(_0xda939c['name']){delete _0xda939c['name'];}_0x2770dc[_0x5b80('0x1d')](_0x5a9e1b)[_0x5b80('0x2e')](_0xda939c);};}exports[_0x5b80('0x2f')]=function(_0x267e2b,_0x579e52){var _0x1b9b53={},_0x702386={},_0x42a8f3={'count':0x0,'rows':[]};var _0xfc4ecf=_[_0x5b80('0x30')](db['Interval']['rawAttributes'],function(_0x4c46bf){return{'name':_0x4c46bf['fieldName'],'type':_0x4c46bf[_0x5b80('0x31')][_0x5b80('0x32')]};});_0x702386['model']=_[_0x5b80('0x30')](_0xfc4ecf,'name');_0x702386['query']=_[_0x5b80('0x33')](_0x267e2b['query']);_0x702386[_0x5b80('0x34')]=_[_0x5b80('0x35')](_0x702386[_0x5b80('0x36')],_0x702386[_0x5b80('0x37')]);_0x1b9b53[_0x5b80('0x38')]=_['intersection'](_0x702386[_0x5b80('0x36')],qs['fields'](_0x267e2b[_0x5b80('0x37')][_0x5b80('0x39')]));_0x1b9b53['attributes']=_0x1b9b53[_0x5b80('0x38')][_0x5b80('0x3a')]?_0x1b9b53[_0x5b80('0x38')]:_0x702386[_0x5b80('0x36')];if(!_0x267e2b[_0x5b80('0x37')]['hasOwnProperty'](_0x5b80('0x3b'))){_0x1b9b53['limit']=qs['limit'](_0x267e2b['query'][_0x5b80('0x22')]);_0x1b9b53[_0x5b80('0x20')]=qs[_0x5b80('0x20')](_0x267e2b[_0x5b80('0x37')][_0x5b80('0x20')]);}_0x1b9b53[_0x5b80('0x3c')]=qs[_0x5b80('0x3d')](_0x267e2b[_0x5b80('0x37')][_0x5b80('0x3d')]);_0x1b9b53[_0x5b80('0x3e')]=qs[_0x5b80('0x34')](_['pick'](_0x267e2b[_0x5b80('0x37')],_0x702386[_0x5b80('0x34')]),_0xfc4ecf);if(_0x267e2b['query'][_0x5b80('0x3f')]){_0x1b9b53[_0x5b80('0x3e')]=_['merge'](_0x1b9b53['where'],{'$or':_[_0x5b80('0x30')](_0xfc4ecf,function(_0x1ee4ef){if(_0x1ee4ef['type']!=='VIRTUAL'){var _0x345cf6={};_0x345cf6[_0x1ee4ef[_0x5b80('0x40')]]={'$like':'%'+_0x267e2b[_0x5b80('0x37')][_0x5b80('0x3f')]+'%'};return _0x345cf6;}})});}_0x1b9b53=_['merge']({},_0x1b9b53,_0x267e2b[_0x5b80('0x41')]);var _0x2749f2={'where':_0x1b9b53[_0x5b80('0x3e')]};return db['Interval']['count'](_0x2749f2)[_0x5b80('0x28')](function(_0x294bac){_0x42a8f3[_0x5b80('0x42')]=_0x294bac;if(_0x267e2b[_0x5b80('0x37')]['includeAll']){_0x1b9b53[_0x5b80('0x43')]=[{'all':!![]}];}return db['Interval']['findAll'](_0x1b9b53);})[_0x5b80('0x28')](function(_0x4d9725){_0x42a8f3['rows']=_0x4d9725;return _0x42a8f3;})[_0x5b80('0x28')](respondWithFilteredResult(_0x579e52,_0x1b9b53))['catch'](handleError(_0x579e52,null));};exports[_0x5b80('0x44')]=function(_0x3a60af,_0x243128){var _0x835341={'raw':!![],'where':{'id':_0x3a60af[_0x5b80('0x45')]['id']}},_0x380e6e={};_0x380e6e['model']=_['keys'](db[_0x5b80('0x46')][_0x5b80('0x47')]);_0x380e6e[_0x5b80('0x37')]=_[_0x5b80('0x33')](_0x3a60af[_0x5b80('0x37')]);_0x380e6e[_0x5b80('0x34')]=_['intersection'](_0x380e6e[_0x5b80('0x36')],_0x380e6e[_0x5b80('0x37')]);_0x835341[_0x5b80('0x38')]=_['intersection'](_0x380e6e['model'],qs[_0x5b80('0x39')](_0x3a60af[_0x5b80('0x37')][_0x5b80('0x39')]));_0x835341['attributes']=_0x835341['attributes'][_0x5b80('0x3a')]?_0x835341[_0x5b80('0x38')]:_0x380e6e[_0x5b80('0x36')];if(_0x3a60af[_0x5b80('0x37')][_0x5b80('0x48')]){_0x835341[_0x5b80('0x43')]=[{'all':!![]}];}_0x835341=_[_0x5b80('0x49')]({},_0x835341,_0x3a60af[_0x5b80('0x41')]);return db[_0x5b80('0x46')]['find'](_0x835341)[_0x5b80('0x28')](handleEntityNotFound(_0x243128,null))['then'](respondWithResult(_0x243128,null))['catch'](handleError(_0x243128,null));};exports[_0x5b80('0x4a')]=function(_0x2e9ff9,_0x4ed20d){return db[_0x5b80('0x46')]['create'](_0x2e9ff9[_0x5b80('0x4b')],{})[_0x5b80('0x28')](function(_0x4316f8){var _0x45e7d5=_0x2e9ff9[_0x5b80('0x4c')][_0x5b80('0x2a')]({'plain':!![]});if(!_0x45e7d5)throw new Error(_0x5b80('0x4d'));if(_0x45e7d5['role']===_0x5b80('0x4c')){var _0x1581f9=_0x4316f8[_0x5b80('0x2a')]({'plain':!![]});var _0x22aa9a=_0x5b80('0x2b');return db[_0x5b80('0x4e')][_0x5b80('0x4f')]({'where':{'name':_0x22aa9a,'userProfileId':_0x45e7d5['userProfileId']},'raw':!![]})[_0x5b80('0x28')](function(_0x2b3b09){if(_0x2b3b09&&_0x2b3b09[_0x5b80('0x50')]===0x0){return db['UserProfileResource'][_0x5b80('0x4a')]({'name':_0x1581f9[_0x5b80('0x40')],'resourceId':_0x1581f9['id'],'type':_0x2b3b09[_0x5b80('0x40')],'sectionId':_0x2b3b09['id']},{})[_0x5b80('0x28')](function(){return _0x4316f8;});}else{return _0x4316f8;}})[_0x5b80('0x51')](function(_0x5a3c9d){logger[_0x5b80('0x52')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5a3c9d);throw _0x5a3c9d;});}return _0x4316f8;})[_0x5b80('0x28')](respondWithResult(_0x4ed20d,0xc9))[_0x5b80('0x51')](handleError(_0x4ed20d,null));};exports[_0x5b80('0x27')]=function(_0x33aaa7,_0xefe17){if(_0x33aaa7[_0x5b80('0x4b')]['id']){delete _0x33aaa7[_0x5b80('0x4b')]['id'];}return db[_0x5b80('0x46')][_0x5b80('0x4f')]({'where':{'id':_0x33aaa7['params']['id']}})['then'](handleEntityNotFound(_0xefe17,null))['then'](saveUpdates(_0x33aaa7[_0x5b80('0x4b')],null))[_0x5b80('0x28')](respondWithResult(_0xefe17,null))[_0x5b80('0x51')](handleError(_0xefe17,null));};exports[_0x5b80('0x29')]=function(_0x2fb9d0,_0x4e1b43){return db['Interval'][_0x5b80('0x4f')]({'where':{'id':_0x2fb9d0[_0x5b80('0x45')]['id']}})[_0x5b80('0x28')](handleEntityNotFound(_0x4e1b43,null))['then'](removeEntity(_0x4e1b43,null))[_0x5b80('0x51')](handleError(_0x4e1b43,null));};exports['addInterval']=function(_0x51d5e1,_0x3cf7c9,_0x2bdd4a){if(_0x51d5e1[_0x5b80('0x4b')]['id']){delete _0x51d5e1[_0x5b80('0x4b')]['id'];}return db[_0x5b80('0x46')][_0x5b80('0x4f')]({'where':{'id':_0x51d5e1[_0x5b80('0x45')]['id']}})[_0x5b80('0x28')](handleEntityNotFound(_0x3cf7c9,null))[_0x5b80('0x28')](function(_0x103c90){if(_0x103c90){_0x51d5e1[_0x5b80('0x4b')][_0x5b80('0x53')]=_0x103c90['id'];return db[_0x5b80('0x46')][_0x5b80('0x4a')](_0x51d5e1['body']);}})[_0x5b80('0x28')](respondWithResult(_0x3cf7c9,null))[_0x5b80('0x51')](handleError(_0x3cf7c9,null));};exports[_0x5b80('0x54')]=function(_0x390e7d,_0x95eef,_0x1d3059){var _0x1ea240={};var _0x17c9d4={};var _0x212a1b;var _0x491821;return db[_0x5b80('0x46')][_0x5b80('0x55')]({'where':{'id':_0x390e7d[_0x5b80('0x45')]['id']}})[_0x5b80('0x28')](handleEntityNotFound(_0x95eef,null))[_0x5b80('0x28')](function(_0x2b9f26){if(_0x2b9f26){_0x212a1b=_0x2b9f26;_0x17c9d4['model']=_[_0x5b80('0x33')](db['Interval'][_0x5b80('0x47')]);_0x17c9d4[_0x5b80('0x37')]=_[_0x5b80('0x33')](_0x390e7d[_0x5b80('0x37')]);_0x17c9d4[_0x5b80('0x34')]=_[_0x5b80('0x35')](_0x17c9d4[_0x5b80('0x36')],_0x17c9d4[_0x5b80('0x37')]);_0x1ea240[_0x5b80('0x38')]=_[_0x5b80('0x35')](_0x17c9d4[_0x5b80('0x36')],qs[_0x5b80('0x39')](_0x390e7d['query'][_0x5b80('0x39')]));_0x1ea240['attributes']=_0x1ea240[_0x5b80('0x38')][_0x5b80('0x3a')]?_0x1ea240['attributes']:_0x17c9d4[_0x5b80('0x36')];_0x1ea240[_0x5b80('0x3c')]=qs['sort'](_0x390e7d[_0x5b80('0x37')][_0x5b80('0x3d')]);_0x1ea240['where']=qs[_0x5b80('0x34')](_['pick'](_0x390e7d[_0x5b80('0x37')],_0x17c9d4[_0x5b80('0x34')]));if(_0x390e7d[_0x5b80('0x37')][_0x5b80('0x3f')]){_0x1ea240[_0x5b80('0x3e')]=_[_0x5b80('0x49')](_0x1ea240[_0x5b80('0x3e')],{'$or':_[_0x5b80('0x30')](_0x1ea240[_0x5b80('0x38')],function(_0x4d2a5d){var _0x7d6f3c={};_0x7d6f3c[_0x4d2a5d]={'$like':'%'+_0x390e7d[_0x5b80('0x37')]['filter']+'%'};return _0x7d6f3c;})});}_0x1ea240=_['merge']({},_0x1ea240,_0x390e7d[_0x5b80('0x41')]);return _0x212a1b[_0x5b80('0x54')](_0x1ea240);}})['then'](function(_0x1711d0){if(_0x1711d0){_0x491821=_0x1711d0['length'];if(!_0x390e7d[_0x5b80('0x37')][_0x5b80('0x56')](_0x5b80('0x3b'))){_0x1ea240[_0x5b80('0x22')]=qs[_0x5b80('0x22')](_0x390e7d[_0x5b80('0x37')]['limit']);_0x1ea240[_0x5b80('0x20')]=qs['offset'](_0x390e7d[_0x5b80('0x37')]['offset']);}return _0x212a1b['getIntervals'](_0x1ea240);}})[_0x5b80('0x28')](function(_0x48175d){if(_0x48175d){return _0x48175d?{'count':_0x491821,'rows':_0x48175d}:null;}})[_0x5b80('0x28')](respondWithResult(_0x95eef,null))[_0x5b80('0x51')](handleError(_0x95eef,null));};exports['addIntervals']=function(_0x3bc54c,_0x9555ca,_0x25a57e){return db[_0x5b80('0x46')][_0x5b80('0x55')]({'where':{'id':_0x3bc54c[_0x5b80('0x45')]['id']}})['then'](handleEntityNotFound(_0x9555ca,null))[_0x5b80('0x28')](function(_0x34def2){if(_0x34def2){return db['sequelize'][_0x5b80('0x57')](function(_0x56496d){return db['Interval'][_0x5b80('0x29')]({'where':{'IntervalId':_0x3bc54c['params']['id']},'transaction':_0x56496d})[_0x5b80('0x28')](function(_0x15d246){var _0x4b0a82=_['map'](_0x3bc54c[_0x5b80('0x4b')],function(_0x5b9a16){delete _0x5b9a16['id'];_0x5b9a16[_0x5b80('0x53')]=_0x3bc54c['params']['id'];return _0x5b9a16;});return db['Interval']['bulkCreate'](_0x4b0a82,{'transaction':_0x56496d});});})[_0x5b80('0x28')](function(){return db[_0x5b80('0x46')][_0x5b80('0x58')]({'where':{'IntervalId':_0x3bc54c['params']['id']}});});}})[_0x5b80('0x28')](respondWithResult(_0x9555ca,null))['catch'](handleError(_0x9555ca,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 5bd2ce1..dffc281 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 _0xdb7c=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./interval.attributes','exports','define','tools_intervals','rewrite','lodash','util'];(function(_0x13594e,_0x6f0ed0){var _0x1a4f42=function(_0x30b064){while(--_0x30b064){_0x13594e['push'](_0x13594e['shift']());}};_0x1a4f42(++_0x6f0ed0);}(_0xdb7c,0x1d2));var _0xcdb7=function(_0x3284cd,_0x2e10a2){_0x3284cd=_0x3284cd-0x0;var _0xe92280=_0xdb7c[_0x3284cd];return _0xe92280;};'use strict';var _=require(_0xcdb7('0x0'));var util=require(_0xcdb7('0x1'));var logger=require(_0xcdb7('0x2'))('api');var moment=require(_0xcdb7('0x3'));var BPromise=require(_0xcdb7('0x4'));var rp=require(_0xcdb7('0x5'));var fs=require('fs');var path=require(_0xcdb7('0x6'));var rimraf=require('rimraf');var config=require(_0xcdb7('0x7'));var attributes=require(_0xcdb7('0x8'));var extensions=require('../../components/extensions/rewrite');module[_0xcdb7('0x9')]=function(_0x2f8cb1,_0x9a244e){return _0x2f8cb1[_0xcdb7('0xa')]('Interval',attributes,{'tableName':_0xcdb7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4359de,_0x30e1f4){extensions[_0xcdb7('0xc')](_0x2f8cb1,_0x4359de);},'afterBulkCreate':function(_0x4c8d20,_0x4a1fd7,_0x21b9c6){_0x21b9c6();extensions[_0xcdb7('0xc')](_0x2f8cb1,_0x4c8d20[0x0]);},'afterUpdate':function(_0x4984d5,_0x1e1e6){extensions[_0xcdb7('0xc')](_0x2f8cb1,_0x4984d5);},'afterDestroy':function(_0xc9dea3,_0x44d69a){extensions[_0xcdb7('0xc')](_0x2f8cb1,_0xc9dea3);}}});}; \ No newline at end of file +var _0x9036=['rewrite','lodash','util','../../config/logger','moment','bluebird','request-promise','path','./interval.attributes','../../components/extensions/rewrite','exports','define','Interval','tools_intervals'];(function(_0xb3b8f,_0x10edc8){var _0x121447=function(_0x273b72){while(--_0x273b72){_0xb3b8f['push'](_0xb3b8f['shift']());}};_0x121447(++_0x10edc8);}(_0x9036,0x151));var _0x6903=function(_0x24decc,_0x259e4b){_0x24decc=_0x24decc-0x0;var _0x5eb36f=_0x9036[_0x24decc];return _0x5eb36f;};'use strict';var _=require(_0x6903('0x0'));var util=require(_0x6903('0x1'));var logger=require(_0x6903('0x2'))('api');var moment=require(_0x6903('0x3'));var BPromise=require(_0x6903('0x4'));var rp=require(_0x6903('0x5'));var fs=require('fs');var path=require(_0x6903('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6903('0x7'));var extensions=require(_0x6903('0x8'));module[_0x6903('0x9')]=function(_0x23d06c,_0x5d5a7c){return _0x23d06c[_0x6903('0xa')](_0x6903('0xb'),attributes,{'tableName':_0x6903('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x221300,_0x28aa25){extensions[_0x6903('0xd')](_0x23d06c,_0x221300);},'afterBulkCreate':function(_0x52958d,_0x36e697,_0x27b6f8){_0x27b6f8();extensions[_0x6903('0xd')](_0x23d06c,_0x52958d[0x0]);},'afterUpdate':function(_0x5d8729,_0x1245a5){extensions[_0x6903('0xd')](_0x23d06c,_0x5d8729);},'afterDestroy':function(_0x483ed6,_0x527f4f){extensions['rewrite'](_0x23d06c,_0x483ed6);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 195bb35..d2b5d23 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 _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x1b64dd,_0x2cf769){var _0xeb464c=function(_0x38272c){while(--_0x38272c){_0x1b64dd['push'](_0x1b64dd['shift']());}};_0xeb464c(++_0x2cf769);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file +var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x2d994d,_0x168a27){var _0xd54be4=function(_0x1db925){while(--_0x1db925){_0x2d994d['push'](_0x2d994d['shift']());}};_0xd54be4(++_0x168a27);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 3e9935a..06e3e12 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 _0xadb5=['post','isAuthenticated','exports','Router','./jira.controller'];(function(_0x4939c,_0x52e62e){var _0x59497=function(_0x4fd110){while(--_0x4fd110){_0x4939c['push'](_0x4939c['shift']());}};_0x59497(++_0x52e62e);}(_0xadb5,0xad));var _0x5adb=function(_0x252da9,_0x4ef9db){_0x252da9=_0x252da9-0x0;var _0x48c0d8=_0xadb5[_0x252da9];return _0x48c0d8;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['send']);module[_0x5adb('0x4')]=router; \ No newline at end of file +var _0x5f66=['send','exports','Router','./jira.controller','post','isAuthenticated'];(function(_0x17928f,_0x4ad33f){var _0x500b63=function(_0x127644){while(--_0x127644){_0x17928f['push'](_0x17928f['shift']());}};_0x500b63(++_0x4ad33f);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x5f66[_0x4c12ec];return _0x3ae42c;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);module[_0x65f6('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 feca519..225896d 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 _0xf09d=['POST','application/json','Basic\x20','toString','base64','stringify','request','setEncoding','utf8','data','end','status','statusCode','error','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','write','send','headers','x-forwarded-for','connection','remoteAddress','socket','bluebird','https','../../config/logger','support','3eAmWpBVP0','MOTGUI','summary','Report','\x20from\x20','description','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','customfield_11503','name','customfield_11504','reason','/rest/api/2/issue'];(function(_0x403115,_0x2d6d03){var _0x596ef3=function(_0x145d97){while(--_0x145d97){_0x403115['push'](_0x403115['shift']());}};_0x596ef3(++_0x2d6d03);}(_0xf09d,0x1b5));var _0xdf09=function(_0x54a2e4,_0x1ff92c){_0x54a2e4=_0x54a2e4-0x0;var _0x4742d0=_0xf09d[_0x54a2e4];return _0x4742d0;};'use strict';var BPromise=require(_0xdf09('0x0'));var https=require(_0xdf09('0x1'));var logger=require(_0xdf09('0x2'))('api');var USERNAME=_0xdf09('0x3');var PASSWORD=_0xdf09('0x4');function openIssue(_0x1699d7,_0x49bc10){var _0xf78f48={'fields':{'project':{'key':_0x1699d7['key']||_0xdf09('0x5')},'summary':(_0x1699d7[_0xdf09('0x6')]||_0xdf09('0x7'))+_0xdf09('0x8')+_0x1699d7['ip'],'description':_0x1699d7[_0xdf09('0x9')]||JSON['stringify'](_0x1699d7),'issuetype':{'name':_0x1699d7[_0xdf09('0xa')]||_0xdf09('0xb')}}};_0xf78f48[_0xdf09('0xc')][_0xdf09('0xd')]=_0x1699d7[_0xdf09('0xe')];_0xf78f48[_0xdf09('0xc')][_0xdf09('0xf')]=_0x1699d7[_0xdf09('0x10')];_0xf78f48[_0xdf09('0xc')][_0xdf09('0x11')]=_0x1699d7['newToken'];_0xf78f48[_0xdf09('0xc')][_0xdf09('0x12')]=_0x1699d7[_0xdf09('0x13')];_0xf78f48[_0xdf09('0xc')][_0xdf09('0x14')]=_0x1699d7[_0xdf09('0x15')];_0xf78f48['fields']['customfield_10102']=_0x1699d7['ip'];var _0x5b06a7={'host':'track.xcallymotion.com','port':0x1bb,'path':_0xdf09('0x16'),'method':_0xdf09('0x17'),'timeout':0x4e20,'headers':{'Content-Type':_0xdf09('0x18'),'Authorization':_0xdf09('0x19')+new Buffer(USERNAME+':'+PASSWORD)[_0xdf09('0x1a')](_0xdf09('0x1b'))}};var _0x103076=JSON[_0xdf09('0x1c')](_0xf78f48);var _0x25fc5f=https[_0xdf09('0x1d')](_0x5b06a7,function(_0x513840){_0x513840[_0xdf09('0x1e')](_0xdf09('0x1f'));var _0x528936='';_0x513840['on'](_0xdf09('0x20'),function(_0x2f31b6){_0x528936+=_0x2f31b6;});_0x513840['on'](_0xdf09('0x21'),function(){if(_0x49bc10){return _0x49bc10[_0xdf09('0x22')](_0x513840[_0xdf09('0x23')])['json'](JSON['parse'](_0x528936));}});});_0x25fc5f['on'](_0xdf09('0x24'),function(_0x1ddd53){if(_0x49bc10){return _0x49bc10[_0xdf09('0x22')](0x1f4)[_0xdf09('0x25')]({'errors':[{'message':_0xdf09('0x26'),'type':'api.jira'}]});}});_0x25fc5f[_0xdf09('0x27')](_0x103076);_0x25fc5f[_0xdf09('0x21')]();}exports['openIssue']=openIssue;exports[_0xdf09('0x28')]=function(_0x1c287b,_0x58b22c){_0x1c287b['body']['ip']=_0x1c287b[_0xdf09('0x29')][_0xdf09('0x2a')]||_0x1c287b[_0xdf09('0x2b')][_0xdf09('0x2c')]||_0x1c287b['socket'][_0xdf09('0x2c')]||_0x1c287b[_0xdf09('0x2b')][_0xdf09('0x2d')][_0xdf09('0x2c')];return openIssue(_0x1c287b['body'],_0x58b22c);}; \ No newline at end of file +var _0xb2fb=['POST','application/json','base64','stringify','request','setEncoding','data','end','statusCode','json','parse','error','status','write','send','body','headers','connection','socket','remoteAddress','bluebird','../../config/logger','api','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','description','issuetype','Bug','fields','email','customfield_11501','oldToken','newToken','customfield_11503','customfield_11504','reason','track.xcallymotion.com','/rest/api/2/issue'];(function(_0x164af1,_0x3cf772){var _0x5d81a2=function(_0xa57547){while(--_0xa57547){_0x164af1['push'](_0x164af1['shift']());}};_0x5d81a2(++_0x3cf772);}(_0xb2fb,0x68));var _0xbb2f=function(_0x386658,_0x49f7c5){_0x386658=_0x386658-0x0;var _0x146125=_0xb2fb[_0x386658];return _0x146125;};'use strict';var BPromise=require(_0xbb2f('0x0'));var https=require('https');var logger=require(_0xbb2f('0x1'))(_0xbb2f('0x2'));var USERNAME='support';var PASSWORD=_0xbb2f('0x3');function openIssue(_0x428427,_0x1194af){var _0x8b94e9={'fields':{'project':{'key':_0x428427[_0xbb2f('0x4')]||_0xbb2f('0x5')},'summary':(_0x428427[_0xbb2f('0x6')]||_0xbb2f('0x7'))+_0xbb2f('0x8')+_0x428427['ip'],'description':_0x428427[_0xbb2f('0x9')]||JSON['stringify'](_0x428427),'issuetype':{'name':_0x428427[_0xbb2f('0xa')]||_0xbb2f('0xb')}}};_0x8b94e9[_0xbb2f('0xc')]['customfield_11500']=_0x428427[_0xbb2f('0xd')];_0x8b94e9['fields'][_0xbb2f('0xe')]=_0x428427[_0xbb2f('0xf')];_0x8b94e9[_0xbb2f('0xc')]['customfield_11502']=_0x428427[_0xbb2f('0x10')];_0x8b94e9[_0xbb2f('0xc')][_0xbb2f('0x11')]=_0x428427['name'];_0x8b94e9[_0xbb2f('0xc')][_0xbb2f('0x12')]=_0x428427[_0xbb2f('0x13')];_0x8b94e9[_0xbb2f('0xc')]['customfield_10102']=_0x428427['ip'];var _0x4c87cb={'host':_0xbb2f('0x14'),'port':0x1bb,'path':_0xbb2f('0x15'),'method':_0xbb2f('0x16'),'timeout':0x4e20,'headers':{'Content-Type':_0xbb2f('0x17'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0xbb2f('0x18'))}};var _0x504331=JSON[_0xbb2f('0x19')](_0x8b94e9);var _0x3554ba=https[_0xbb2f('0x1a')](_0x4c87cb,function(_0x570bff){_0x570bff[_0xbb2f('0x1b')]('utf8');var _0x117faa='';_0x570bff['on'](_0xbb2f('0x1c'),function(_0x4d1d1a){_0x117faa+=_0x4d1d1a;});_0x570bff['on'](_0xbb2f('0x1d'),function(){if(_0x1194af){return _0x1194af['status'](_0x570bff[_0xbb2f('0x1e')])[_0xbb2f('0x1f')](JSON[_0xbb2f('0x20')](_0x117faa));}});});_0x3554ba['on'](_0xbb2f('0x21'),function(_0x5bbac4){if(_0x1194af){return _0x1194af[_0xbb2f('0x22')](0x1f4)['json']({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':'api.jira'}]});}});_0x3554ba[_0xbb2f('0x23')](_0x504331);_0x3554ba[_0xbb2f('0x1d')]();}exports['openIssue']=openIssue;exports[_0xbb2f('0x24')]=function(_0x440596,_0x570664){_0x440596[_0xbb2f('0x25')]['ip']=_0x440596[_0xbb2f('0x26')]['x-forwarded-for']||_0x440596[_0xbb2f('0x27')]['remoteAddress']||_0x440596[_0xbb2f('0x28')]['remoteAddress']||_0x440596[_0xbb2f('0x27')]['socket'][_0xbb2f('0x29')];return openIssue(_0x440596['body'],_0x570664);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index e1d3468..19a1d16 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 _0x2750=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','index','/describe','isAuthenticated','/:id','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x1c8cc6,_0x411e5c){var _0x522936=function(_0x38d044){while(--_0x38d044){_0x1c8cc6['push'](_0x1c8cc6['shift']());}};_0x522936(++_0x411e5c);}(_0x2750,0x13b));var _0x0275=function(_0x20817a,_0x2a2a9a){_0x20817a=_0x20817a-0x0;var _0x31e4fc=_0x2750[_0x20817a];return _0x31e4fc;};'use strict';var multer=require(_0x0275('0x0'));var util=require('util');var path=require(_0x0275('0x1'));var timeout=require(_0x0275('0x2'));var express=require(_0x0275('0x3'));var router=express[_0x0275('0x4')]();var fs_extra=require(_0x0275('0x5'));var auth=require(_0x0275('0x6'));var interaction=require(_0x0275('0x7'));var config=require(_0x0275('0x8'));var controller=require(_0x0275('0x9'));router[_0x0275('0xa')]('/',auth['isAuthenticated'](),controller[_0x0275('0xb')]);router[_0x0275('0xa')](_0x0275('0xc'),auth[_0x0275('0xd')](),controller['describe']);router[_0x0275('0xa')](_0x0275('0xe'),auth[_0x0275('0xd')](),controller['show']);router['post']('/',auth[_0x0275('0xd')](),controller['create']);router[_0x0275('0xf')](_0x0275('0xe'),auth[_0x0275('0xd')](),controller[_0x0275('0x10')]);router[_0x0275('0x11')]('/:id',auth[_0x0275('0xd')](),controller[_0x0275('0x12')]);module[_0x0275('0x13')]=router; \ No newline at end of file +var _0x99e9=['update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put'];(function(_0x2bf1e7,_0x530dd4){var _0x2dcc12=function(_0x274465){while(--_0x274465){_0x2bf1e7['push'](_0x2bf1e7['shift']());}};_0x2dcc12(++_0x530dd4);}(_0x99e9,0xb4));var _0x999e=function(_0x45ce1a,_0x4f8ea5){_0x45ce1a=_0x45ce1a-0x0;var _0x4926d8=_0x99e9[_0x45ce1a];return _0x4926d8;};'use strict';var multer=require('multer');var util=require(_0x999e('0x0'));var path=require(_0x999e('0x1'));var timeout=require(_0x999e('0x2'));var express=require(_0x999e('0x3'));var router=express['Router']();var fs_extra=require(_0x999e('0x4'));var auth=require(_0x999e('0x5'));var interaction=require(_0x999e('0x6'));var config=require('../../config/environment');var controller=require(_0x999e('0x7'));router['get']('/',auth[_0x999e('0x8')](),controller[_0x999e('0x9')]);router[_0x999e('0xa')](_0x999e('0xb'),auth['isAuthenticated'](),controller[_0x999e('0xc')]);router[_0x999e('0xa')](_0x999e('0xd'),auth[_0x999e('0x8')](),controller[_0x999e('0xe')]);router[_0x999e('0xf')]('/',auth[_0x999e('0x8')](),controller[_0x999e('0x10')]);router[_0x999e('0x11')](_0x999e('0xd'),auth[_0x999e('0x8')](),controller[_0x999e('0x12')]);router[_0x999e('0x13')](_0x999e('0xd'),auth[_0x999e('0x8')](),controller[_0x999e('0x14')]);module[_0x999e('0x15')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index fa63f48..8506dd6 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(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x7a54,0x106));var _0x47a5=function(_0x2f9ec3,_0x17aba2){_0x2f9ec3=_0x2f9ec3-0x0;var _0x51fe3c=_0x7a54[_0x2f9ec3];return _0x51fe3c;};'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(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x7a54,0x106));var _0x47a5=function(_0x3d209a,_0x427880){_0x3d209a=_0x3d209a-0x0;var _0x254637=_0x7a54[_0x3d209a];return _0x254637;};'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 f0a1435..926cf80 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 _0x0618=['catch','show','intersection','options','create','body','update','find','params','describe','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','destroy','end','stack','name','send','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','query','keys','filters','model','fields','attributes','length','hasOwnProperty','nolimit','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','then','rows'];(function(_0x126fb9,_0x122c59){var _0xc8a3b1=function(_0x355744){while(--_0x355744){_0x126fb9['push'](_0x126fb9['shift']());}};_0xc8a3b1(++_0x122c59);}(_0x0618,0x1c6));var _0x8061=function(_0x159d0b,_0x122488){_0x159d0b=_0x159d0b-0x0;var _0xc54138=_0x0618[_0x159d0b];return _0xc54138;};'use strict';var emlformat=require(_0x8061('0x0'));var rimraf=require(_0x8061('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8061('0x2'));var rp=require(_0x8061('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8061('0x4'));var util=require(_0x8061('0x5'));var path=require(_0x8061('0x6'));var sox=require(_0x8061('0x7'));var csv=require(_0x8061('0x8'));var ejs=require(_0x8061('0x9'));var fs=require('fs');var fs_extra=require(_0x8061('0xa'));var _=require(_0x8061('0xb'));var squel=require(_0x8061('0xc'));var crypto=require(_0x8061('0xd'));var jsforce=require(_0x8061('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8061('0x8'));var querystring=require('querystring');var Papa=require(_0x8061('0xf'));var Redis=require(_0x8061('0x10'));var authService=require(_0x8061('0x11'));var qs=require(_0x8061('0x12'));var as=require(_0x8061('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8061('0x14'));var utils=require(_0x8061('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8061('0x16'))['db'];function respondWithStatusCode(_0x141707,_0x724e64){_0x724e64=_0x724e64||0xcc;return function(_0x3537f0){if(_0x3537f0){return _0x141707[_0x8061('0x17')](_0x724e64);}return _0x141707[_0x8061('0x18')](_0x724e64)['end']();};}function respondWithResult(_0x4df59c,_0x19ea89){_0x19ea89=_0x19ea89||0xc8;return function(_0x4da339){if(_0x4da339){return _0x4df59c[_0x8061('0x18')](_0x19ea89)[_0x8061('0x19')](_0x4da339);}};}function respondWithFilteredResult(_0x567988,_0x483af8){return function(_0x460dfd){if(_0x460dfd){var _0x3264ff=typeof _0x483af8[_0x8061('0x1a')]===_0x8061('0x1b')&&typeof _0x483af8[_0x8061('0x1c')]===_0x8061('0x1b');var _0x280f9b=_0x460dfd[_0x8061('0x1d')];var _0x2b0eab=_0x3264ff?0x0:_0x483af8[_0x8061('0x1a')];var _0x14230e=_0x3264ff?_0x460dfd[_0x8061('0x1d')]:_0x483af8[_0x8061('0x1a')]+_0x483af8['limit'];var _0x4d254d;if(_0x14230e>=_0x280f9b){_0x14230e=_0x280f9b;_0x4d254d=0xc8;}else{_0x4d254d=0xce;}_0x567988[_0x8061('0x18')](_0x4d254d);return _0x567988[_0x8061('0x1e')](_0x8061('0x1f'),_0x2b0eab+'-'+_0x14230e+'/'+_0x280f9b)['json'](_0x460dfd);}return null;};}function patchUpdates(_0x53f869){return function(_0x36ccd5){try{jsonpatch[_0x8061('0x20')](_0x36ccd5,_0x53f869,!![]);}catch(_0x2bc509){return BPromise[_0x8061('0x21')](_0x2bc509);}return _0x36ccd5['save']();};}function saveUpdates(_0x49f708,_0x1cd5ed){return function(_0x12e73d){if(_0x12e73d){return _0x12e73d['update'](_0x49f708)['then'](function(_0x3dbaea){return _0x3dbaea;});}return null;};}function removeEntity(_0x554faa,_0x535cc9){return function(_0x37bff0){if(_0x37bff0){return _0x37bff0[_0x8061('0x22')]()['then'](function(){_0x554faa['status'](0xcc)[_0x8061('0x23')]();});}};}function handleEntityNotFound(_0x3f2765,_0x4e0860){return function(_0x1b0ec7){if(!_0x1b0ec7){_0x3f2765[_0x8061('0x17')](0x194);}return _0x1b0ec7;};}function handleError(_0x39fb5c,_0x2f7544){_0x2f7544=_0x2f7544||0x1f4;return function(_0x5f0822){logger['error'](_0x5f0822[_0x8061('0x24')]);if(_0x5f0822[_0x8061('0x25')]){delete _0x5f0822[_0x8061('0x25')];}_0x39fb5c[_0x8061('0x18')](_0x2f7544)[_0x8061('0x26')](_0x5f0822);};}exports['index']=function(_0x4c9202,_0x518700){var _0x59a65d={},_0xfb9138={},_0x38317c={'count':0x0,'rows':[]};var _0x36714f=_[_0x8061('0x27')](db[_0x8061('0x28')][_0x8061('0x29')],function(_0x2d1537){return{'name':_0x2d1537[_0x8061('0x2a')],'type':_0x2d1537[_0x8061('0x2b')][_0x8061('0x2c')]};});_0xfb9138['model']=_['map'](_0x36714f,_0x8061('0x25'));_0xfb9138[_0x8061('0x2d')]=_[_0x8061('0x2e')](_0x4c9202[_0x8061('0x2d')]);_0xfb9138[_0x8061('0x2f')]=_['intersection'](_0xfb9138[_0x8061('0x30')],_0xfb9138[_0x8061('0x2d')]);_0x59a65d['attributes']=_['intersection'](_0xfb9138[_0x8061('0x30')],qs[_0x8061('0x31')](_0x4c9202['query'][_0x8061('0x31')]));_0x59a65d[_0x8061('0x32')]=_0x59a65d[_0x8061('0x32')][_0x8061('0x33')]?_0x59a65d[_0x8061('0x32')]:_0xfb9138[_0x8061('0x30')];if(!_0x4c9202[_0x8061('0x2d')][_0x8061('0x34')](_0x8061('0x35'))){_0x59a65d['limit']=qs[_0x8061('0x1c')](_0x4c9202[_0x8061('0x2d')][_0x8061('0x1c')]);_0x59a65d[_0x8061('0x1a')]=qs['offset'](_0x4c9202['query']['offset']);}_0x59a65d['order']=qs['sort'](_0x4c9202[_0x8061('0x2d')]['sort']);_0x59a65d[_0x8061('0x36')]=qs[_0x8061('0x2f')](_[_0x8061('0x37')](_0x4c9202[_0x8061('0x2d')],_0xfb9138[_0x8061('0x2f')]),_0x36714f);if(_0x4c9202['query'][_0x8061('0x38')]){_0x59a65d[_0x8061('0x36')]=_[_0x8061('0x39')](_0x59a65d[_0x8061('0x36')],{'$or':_[_0x8061('0x27')](_0x36714f,function(_0x31ed9d){if(_0x31ed9d[_0x8061('0x2b')]!==_0x8061('0x3a')){var _0x714833={};_0x714833[_0x31ed9d[_0x8061('0x25')]]={'$like':'%'+_0x4c9202[_0x8061('0x2d')][_0x8061('0x38')]+'%'};return _0x714833;}})});}_0x59a65d=_['merge']({},_0x59a65d,_0x4c9202['options']);var _0xb72481={'where':_0x59a65d['where']};return db[_0x8061('0x28')]['count'](_0xb72481)['then'](function(_0x105747){_0x38317c[_0x8061('0x1d')]=_0x105747;if(_0x4c9202[_0x8061('0x2d')][_0x8061('0x3b')]){_0x59a65d[_0x8061('0x3c')]=[{'all':!![]}];}return db[_0x8061('0x28')][_0x8061('0x3d')](_0x59a65d);})[_0x8061('0x3e')](function(_0x1475b1){_0x38317c[_0x8061('0x3f')]=_0x1475b1;return _0x38317c;})['then'](respondWithFilteredResult(_0x518700,_0x59a65d))[_0x8061('0x40')](handleError(_0x518700,null));};exports[_0x8061('0x41')]=function(_0x177ab1,_0x2675e3){var _0x4435b8={'raw':!![],'where':{'id':_0x177ab1['params']['id']}},_0x4ea342={};_0x4ea342[_0x8061('0x30')]=_[_0x8061('0x2e')](db[_0x8061('0x28')][_0x8061('0x29')]);_0x4ea342[_0x8061('0x2d')]=_[_0x8061('0x2e')](_0x177ab1[_0x8061('0x2d')]);_0x4ea342['filters']=_[_0x8061('0x42')](_0x4ea342[_0x8061('0x30')],_0x4ea342[_0x8061('0x2d')]);_0x4435b8[_0x8061('0x32')]=_[_0x8061('0x42')](_0x4ea342[_0x8061('0x30')],qs[_0x8061('0x31')](_0x177ab1['query'][_0x8061('0x31')]));_0x4435b8['attributes']=_0x4435b8[_0x8061('0x32')][_0x8061('0x33')]?_0x4435b8[_0x8061('0x32')]:_0x4ea342['model'];if(_0x177ab1['query'][_0x8061('0x3b')]){_0x4435b8[_0x8061('0x3c')]=[{'all':!![]}];}_0x4435b8=_[_0x8061('0x39')]({},_0x4435b8,_0x177ab1[_0x8061('0x43')]);return db[_0x8061('0x28')]['find'](_0x4435b8)['then'](handleEntityNotFound(_0x2675e3,null))[_0x8061('0x3e')](respondWithResult(_0x2675e3,null))['catch'](handleError(_0x2675e3,null));};exports[_0x8061('0x44')]=function(_0x393bc9,_0x54546a){return db[_0x8061('0x28')][_0x8061('0x44')](_0x393bc9[_0x8061('0x45')],{})[_0x8061('0x3e')](respondWithResult(_0x54546a,0xc9))['catch'](handleError(_0x54546a,null));};exports[_0x8061('0x46')]=function(_0xb1cc9d,_0x2eaab6){if(_0xb1cc9d[_0x8061('0x45')]['id']){delete _0xb1cc9d[_0x8061('0x45')]['id'];}return db[_0x8061('0x28')][_0x8061('0x47')]({'where':{'id':_0xb1cc9d[_0x8061('0x48')]['id']}})[_0x8061('0x3e')](handleEntityNotFound(_0x2eaab6,null))[_0x8061('0x3e')](saveUpdates(_0xb1cc9d[_0x8061('0x45')],null))[_0x8061('0x3e')](respondWithResult(_0x2eaab6,null))[_0x8061('0x40')](handleError(_0x2eaab6,null));};exports[_0x8061('0x22')]=function(_0x291c8b,_0x30771f){return db[_0x8061('0x28')]['find']({'where':{'id':_0x291c8b[_0x8061('0x48')]['id']}})[_0x8061('0x3e')](handleEntityNotFound(_0x30771f,null))[_0x8061('0x3e')](removeEntity(_0x30771f,null))[_0x8061('0x40')](handleError(_0x30771f,null));};exports['describe']=function(_0x2be970,_0xd63f0e){return db[_0x8061('0x28')][_0x8061('0x49')]()[_0x8061('0x3e')](respondWithResult(_0xd63f0e,null))[_0x8061('0x40')](handleError(_0xd63f0e,null));}; \ No newline at end of file +var _0x1cb9=['rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','length','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','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','undefined','limit','count','offset','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','index','map','JscriptyAnswerReport'];(function(_0x2b5554,_0x720501){var _0x4f718e=function(_0x488b4c){while(--_0x488b4c){_0x2b5554['push'](_0x2b5554['shift']());}};_0x4f718e(++_0x720501);}(_0x1cb9,0x14e));var _0x91cb=function(_0x4d98fa,_0x5e872c){_0x4d98fa=_0x4d98fa-0x0;var _0x512129=_0x1cb9[_0x4d98fa];return _0x512129;};'use strict';var emlformat=require(_0x91cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91cb('0x1'));var jsonpatch=require(_0x91cb('0x2'));var rp=require(_0x91cb('0x3'));var moment=require(_0x91cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x91cb('0x5'));var util=require(_0x91cb('0x6'));var path=require('path');var sox=require(_0x91cb('0x7'));var csv=require(_0x91cb('0x8'));var ejs=require(_0x91cb('0x9'));var fs=require('fs');var fs_extra=require(_0x91cb('0xa'));var _=require(_0x91cb('0xb'));var squel=require(_0x91cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x91cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x91cb('0x8'));var querystring=require('querystring');var Papa=require(_0x91cb('0xe'));var Redis=require(_0x91cb('0xf'));var authService=require(_0x91cb('0x10'));var qs=require(_0x91cb('0x11'));var as=require(_0x91cb('0x12'));var hardwareService=require(_0x91cb('0x13'));var logger=require(_0x91cb('0x14'))(_0x91cb('0x15'));var utils=require(_0x91cb('0x16'));var config=require(_0x91cb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x91cb('0x18'))['db'];function respondWithStatusCode(_0x366f09,_0x4ba2f2){_0x4ba2f2=_0x4ba2f2||0xcc;return function(_0x20e6e0){if(_0x20e6e0){return _0x366f09[_0x91cb('0x19')](_0x4ba2f2);}return _0x366f09[_0x91cb('0x1a')](_0x4ba2f2)[_0x91cb('0x1b')]();};}function respondWithResult(_0x4a7d45,_0x4cc6ef){_0x4cc6ef=_0x4cc6ef||0xc8;return function(_0x4aae25){if(_0x4aae25){return _0x4a7d45[_0x91cb('0x1a')](_0x4cc6ef)['json'](_0x4aae25);}};}function respondWithFilteredResult(_0x528f73,_0x576369){return function(_0xc3629e){if(_0xc3629e){var _0x347980=typeof _0x576369['offset']===_0x91cb('0x1c')&&typeof _0x576369[_0x91cb('0x1d')]==='undefined';var _0xc594e3=_0xc3629e[_0x91cb('0x1e')];var _0x1cd34b=_0x347980?0x0:_0x576369[_0x91cb('0x1f')];var _0x5cc1c3=_0x347980?_0xc3629e[_0x91cb('0x1e')]:_0x576369[_0x91cb('0x1f')]+_0x576369['limit'];var _0x123847;if(_0x5cc1c3>=_0xc594e3){_0x5cc1c3=_0xc594e3;_0x123847=0xc8;}else{_0x123847=0xce;}_0x528f73['status'](_0x123847);return _0x528f73['set'](_0x91cb('0x20'),_0x1cd34b+'-'+_0x5cc1c3+'/'+_0xc594e3)[_0x91cb('0x21')](_0xc3629e);}return null;};}function patchUpdates(_0x56e409){return function(_0x51a1d5){try{jsonpatch['apply'](_0x51a1d5,_0x56e409,!![]);}catch(_0x438162){return BPromise[_0x91cb('0x22')](_0x438162);}return _0x51a1d5[_0x91cb('0x23')]();};}function saveUpdates(_0x1dbee2,_0x5c6a15){return function(_0x45c4b3){if(_0x45c4b3){return _0x45c4b3[_0x91cb('0x24')](_0x1dbee2)[_0x91cb('0x25')](function(_0x55fa78){return _0x55fa78;});}return null;};}function removeEntity(_0x26f18f,_0x1a7a54){return function(_0x2447e7){if(_0x2447e7){return _0x2447e7[_0x91cb('0x26')]()[_0x91cb('0x25')](function(){_0x26f18f[_0x91cb('0x1a')](0xcc)[_0x91cb('0x1b')]();});}};}function handleEntityNotFound(_0x423c4f,_0x264e9b){return function(_0x4c8438){if(!_0x4c8438){_0x423c4f['sendStatus'](0x194);}return _0x4c8438;};}function handleError(_0x234eb1,_0x554350){_0x554350=_0x554350||0x1f4;return function(_0x1c67d2){logger[_0x91cb('0x27')](_0x1c67d2[_0x91cb('0x28')]);if(_0x1c67d2['name']){delete _0x1c67d2[_0x91cb('0x29')];}_0x234eb1['status'](_0x554350)[_0x91cb('0x2a')](_0x1c67d2);};}exports[_0x91cb('0x2b')]=function(_0x3b3ee6,_0x2fb473){var _0x468908={},_0x504275={},_0x2f04a3={'count':0x0,'rows':[]};var _0x52670a=_[_0x91cb('0x2c')](db[_0x91cb('0x2d')][_0x91cb('0x2e')],function(_0x4944bd){return{'name':_0x4944bd[_0x91cb('0x2f')],'type':_0x4944bd[_0x91cb('0x30')][_0x91cb('0x31')]};});_0x504275[_0x91cb('0x32')]=_[_0x91cb('0x2c')](_0x52670a,_0x91cb('0x29'));_0x504275[_0x91cb('0x33')]=_[_0x91cb('0x34')](_0x3b3ee6[_0x91cb('0x33')]);_0x504275['filters']=_[_0x91cb('0x35')](_0x504275[_0x91cb('0x32')],_0x504275[_0x91cb('0x33')]);_0x468908[_0x91cb('0x36')]=_[_0x91cb('0x35')](_0x504275['model'],qs[_0x91cb('0x37')](_0x3b3ee6[_0x91cb('0x33')][_0x91cb('0x37')]));_0x468908[_0x91cb('0x36')]=_0x468908[_0x91cb('0x36')]['length']?_0x468908[_0x91cb('0x36')]:_0x504275['model'];if(!_0x3b3ee6['query']['hasOwnProperty'](_0x91cb('0x38'))){_0x468908['limit']=qs[_0x91cb('0x1d')](_0x3b3ee6['query']['limit']);_0x468908[_0x91cb('0x1f')]=qs[_0x91cb('0x1f')](_0x3b3ee6[_0x91cb('0x33')][_0x91cb('0x1f')]);}_0x468908[_0x91cb('0x39')]=qs['sort'](_0x3b3ee6[_0x91cb('0x33')][_0x91cb('0x3a')]);_0x468908[_0x91cb('0x3b')]=qs[_0x91cb('0x3c')](_['pick'](_0x3b3ee6['query'],_0x504275[_0x91cb('0x3c')]),_0x52670a);if(_0x3b3ee6[_0x91cb('0x33')]['filter']){_0x468908[_0x91cb('0x3b')]=_[_0x91cb('0x3d')](_0x468908['where'],{'$or':_[_0x91cb('0x2c')](_0x52670a,function(_0xddc409){if(_0xddc409['type']!==_0x91cb('0x3e')){var _0x545687={};_0x545687[_0xddc409[_0x91cb('0x29')]]={'$like':'%'+_0x3b3ee6[_0x91cb('0x33')][_0x91cb('0x3f')]+'%'};return _0x545687;}})});}_0x468908=_[_0x91cb('0x3d')]({},_0x468908,_0x3b3ee6[_0x91cb('0x40')]);var _0x20bf50={'where':_0x468908['where']};return db[_0x91cb('0x2d')][_0x91cb('0x1e')](_0x20bf50)['then'](function(_0x312581){_0x2f04a3['count']=_0x312581;if(_0x3b3ee6[_0x91cb('0x33')][_0x91cb('0x41')]){_0x468908[_0x91cb('0x42')]=[{'all':!![]}];}return db[_0x91cb('0x2d')]['findAll'](_0x468908);})[_0x91cb('0x25')](function(_0x5af0e6){_0x2f04a3[_0x91cb('0x43')]=_0x5af0e6;return _0x2f04a3;})[_0x91cb('0x25')](respondWithFilteredResult(_0x2fb473,_0x468908))[_0x91cb('0x44')](handleError(_0x2fb473,null));};exports[_0x91cb('0x45')]=function(_0x451463,_0x111cc0){var _0x325dca={'raw':!![],'where':{'id':_0x451463['params']['id']}},_0x3cc4c1={};_0x3cc4c1[_0x91cb('0x32')]=_['keys'](db[_0x91cb('0x2d')]['rawAttributes']);_0x3cc4c1[_0x91cb('0x33')]=_['keys'](_0x451463[_0x91cb('0x33')]);_0x3cc4c1[_0x91cb('0x3c')]=_[_0x91cb('0x35')](_0x3cc4c1[_0x91cb('0x32')],_0x3cc4c1['query']);_0x325dca[_0x91cb('0x36')]=_[_0x91cb('0x35')](_0x3cc4c1['model'],qs[_0x91cb('0x37')](_0x451463[_0x91cb('0x33')][_0x91cb('0x37')]));_0x325dca[_0x91cb('0x36')]=_0x325dca[_0x91cb('0x36')][_0x91cb('0x46')]?_0x325dca[_0x91cb('0x36')]:_0x3cc4c1[_0x91cb('0x32')];if(_0x451463[_0x91cb('0x33')]['includeAll']){_0x325dca[_0x91cb('0x42')]=[{'all':!![]}];}_0x325dca=_[_0x91cb('0x3d')]({},_0x325dca,_0x451463[_0x91cb('0x40')]);return db[_0x91cb('0x2d')][_0x91cb('0x47')](_0x325dca)[_0x91cb('0x25')](handleEntityNotFound(_0x111cc0,null))[_0x91cb('0x25')](respondWithResult(_0x111cc0,null))[_0x91cb('0x44')](handleError(_0x111cc0,null));};exports['create']=function(_0x348d78,_0x46caf1){return db[_0x91cb('0x2d')][_0x91cb('0x48')](_0x348d78['body'],{})[_0x91cb('0x25')](respondWithResult(_0x46caf1,0xc9))[_0x91cb('0x44')](handleError(_0x46caf1,null));};exports['update']=function(_0x212473,_0x47cdb7){if(_0x212473[_0x91cb('0x49')]['id']){delete _0x212473['body']['id'];}return db['JscriptyAnswerReport']['find']({'where':{'id':_0x212473[_0x91cb('0x4a')]['id']}})[_0x91cb('0x25')](handleEntityNotFound(_0x47cdb7,null))[_0x91cb('0x25')](saveUpdates(_0x212473[_0x91cb('0x49')],null))[_0x91cb('0x25')](respondWithResult(_0x47cdb7,null))['catch'](handleError(_0x47cdb7,null));};exports['destroy']=function(_0x1d26b8,_0xfe6692){return db[_0x91cb('0x2d')][_0x91cb('0x47')]({'where':{'id':_0x1d26b8['params']['id']}})['then'](handleEntityNotFound(_0xfe6692,null))['then'](removeEntity(_0xfe6692,null))[_0x91cb('0x44')](handleError(_0xfe6692,null));};exports['describe']=function(_0x3f22a1,_0x4aa670){return db[_0x91cb('0x2d')][_0x91cb('0x4b')]()[_0x91cb('0x25')](respondWithResult(_0x4aa670,null))[_0x91cb('0x44')](handleError(_0x4aa670,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index cb44c0d..0481edb 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 _0x61d7=['bluebird','request-promise','define','JscriptyAnswerReport','lodash','api'];(function(_0x58c20f,_0x4cdb1b){var _0x3b0318=function(_0x36fa84){while(--_0x36fa84){_0x58c20f['push'](_0x58c20f['shift']());}};_0x3b0318(++_0x4cdb1b);}(_0x61d7,0x136));var _0x761d=function(_0x2aabfa,_0x296e27){_0x2aabfa=_0x2aabfa-0x0;var _0xcfb2b6=_0x61d7[_0x2aabfa];return _0xcfb2b6;};'use strict';var _=require(_0x761d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x761d('0x1'));var moment=require('moment');var BPromise=require(_0x761d('0x2'));var rp=require(_0x761d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./jscriptyAnswerReport.attributes');module['exports']=function(_0x3079f9,_0x2dfdff){return _0x3079f9[_0x761d('0x4')](_0x761d('0x5'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf55d=['path','rimraf','../../config/environment','exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash','util','../../config/logger','moment','bluebird'];(function(_0xd4f46a,_0x189757){var _0x3d325a=function(_0x32fd29){while(--_0x32fd29){_0xd4f46a['push'](_0xd4f46a['shift']());}};_0x3d325a(++_0x189757);}(_0xf55d,0x133));var _0xdf55=function(_0x58dd5b,_0x266c1d){_0x58dd5b=_0x58dd5b-0x0;var _0xa331c1=_0xf55d[_0x58dd5b];return _0xa331c1;};'use strict';var _=require(_0xdf55('0x0'));var util=require(_0xdf55('0x1'));var logger=require(_0xdf55('0x2'))('api');var moment=require(_0xdf55('0x3'));var BPromise=require(_0xdf55('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdf55('0x5'));var rimraf=require(_0xdf55('0x6'));var config=require(_0xdf55('0x7'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0xdf55('0x8')]=function(_0x327e26,_0x3f7eff){return _0x327e26[_0xdf55('0x9')](_0xdf55('0xa'),attributes,{'tableName':_0xdf55('0xb'),'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 b69300d..244b44b 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 _0x3e40=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x19739c,_0x4c393c){var _0x4e72d1=function(_0x52120c){while(--_0x52120c){_0x19739c['push'](_0x19739c['shift']());}};_0x4e72d1(++_0x4c393c);}(_0x3e40,0x121));var _0x03e4=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x3e40[_0x49ca18];return _0x145d54;};'use strict';var _=require(_0x03e4('0x0'));var util=require('util');var moment=require(_0x03e4('0x1'));var BPromise=require(_0x03e4('0x2'));var rs=require(_0x03e4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x03e4('0x4'))['db'];var utils=require(_0x03e4('0x5'));var logger=require(_0x03e4('0x6'))(_0x03e4('0x7'));var config=require(_0x03e4('0x8'));var jayson=require(_0x03e4('0x9'));var client=jayson[_0x03e4('0xa')][_0x03e4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x171caf,_0x3b280d,_0x4e1cbb){return new BPromise(function(_0x24cb7f,_0x4b86e1){return client[_0x03e4('0xc')](_0x171caf,_0x4e1cbb)[_0x03e4('0xd')](function(_0x4f1ee8){logger[_0x03e4('0xe')](_0x03e4('0xf'),_0x3b280d,_0x03e4('0x10'));logger[_0x03e4('0x11')](_0x03e4('0x12'),_0x3b280d,_0x03e4('0x10'),JSON['stringify'](_0x4f1ee8));if(_0x4f1ee8[_0x03e4('0x13')]){if(_0x4f1ee8[_0x03e4('0x13')][_0x03e4('0x14')]===0x1f4){logger['error'](_0x03e4('0xf'),_0x3b280d,_0x4f1ee8[_0x03e4('0x13')][_0x03e4('0x15')]);return _0x4b86e1(_0x4f1ee8[_0x03e4('0x13')]['message']);}logger['error'](_0x03e4('0xf'),_0x3b280d,_0x4f1ee8['error'][_0x03e4('0x15')]);return _0x24cb7f(_0x4f1ee8['error'][_0x03e4('0x15')]);}else{logger['info'](_0x03e4('0xf'),_0x3b280d,_0x03e4('0x10'));_0x24cb7f(_0x4f1ee8[_0x03e4('0x16')][_0x03e4('0x15')]);}})[_0x03e4('0x17')](function(_0x175eac){logger[_0x03e4('0x13')](_0x03e4('0xf'),_0x3b280d,_0x175eac);_0x4b86e1(_0x175eac);});});} \ No newline at end of file +var _0x27e9=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','code','JscriptyAnswerReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0x27e9,0x1ba));var _0x927e=function(_0x5c971a,_0x4f6c51){_0x5c971a=_0x5c971a-0x0;var _0x298c31=_0x27e9[_0x5c971a];return _0x298c31;};'use strict';var _=require(_0x927e('0x0'));var util=require('util');var moment=require(_0x927e('0x1'));var BPromise=require(_0x927e('0x2'));var rs=require(_0x927e('0x3'));var fs=require('fs');var Redis=require(_0x927e('0x4'));var db=require(_0x927e('0x5'))['db'];var utils=require(_0x927e('0x6'));var logger=require(_0x927e('0x7'))(_0x927e('0x8'));var config=require(_0x927e('0x9'));var jayson=require(_0x927e('0xa'));var client=jayson[_0x927e('0xb')][_0x927e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4c1241,_0x327005,_0x38c5a9){return new BPromise(function(_0x4774bb,_0x172349){return client[_0x927e('0xd')](_0x4c1241,_0x38c5a9)[_0x927e('0xe')](function(_0x42bd0f){logger[_0x927e('0xf')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x327005,_0x927e('0x10'));logger[_0x927e('0x11')](_0x927e('0x12'),_0x327005,'request\x20sent',JSON['stringify'](_0x42bd0f));if(_0x42bd0f[_0x927e('0x13')]){if(_0x42bd0f[_0x927e('0x13')][_0x927e('0x14')]===0x1f4){logger[_0x927e('0x13')](_0x927e('0x15'),_0x327005,_0x42bd0f[_0x927e('0x13')][_0x927e('0x16')]);return _0x172349(_0x42bd0f[_0x927e('0x13')]['message']);}logger[_0x927e('0x13')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x327005,_0x42bd0f['error'][_0x927e('0x16')]);return _0x4774bb(_0x42bd0f[_0x927e('0x13')][_0x927e('0x16')]);}else{logger['info'](_0x927e('0x15'),_0x327005,_0x927e('0x10'));_0x4774bb(_0x42bd0f[_0x927e('0x17')]['message']);}})[_0x927e('0x18')](function(_0x4f67dd){logger[_0x927e('0x13')](_0x927e('0x15'),_0x327005,_0x4f67dd);_0x172349(_0x4f67dd);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index ebaaa78..39ff945 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 _0xd555=['isAuthenticated','index','/:id','show','getAnswers','/:id/summary','30s','getSummary','create','post','clone','put','update','delete','destroy','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get'];(function(_0x58b13e,_0x3606fc){var _0x50c324=function(_0x67ff64){while(--_0x67ff64){_0x58b13e['push'](_0x58b13e['shift']());}};_0x50c324(++_0x3606fc);}(_0xd555,0x177));var _0x5d55=function(_0x3ef8f7,_0x35359a){_0x3ef8f7=_0x3ef8f7-0x0;var _0x3b097e=_0xd555[_0x3ef8f7];return _0x3b097e;};'use strict';var multer=require('multer');var util=require(_0x5d55('0x0'));var path=require('path');var timeout=require(_0x5d55('0x1'));var express=require(_0x5d55('0x2'));var router=express['Router']();var fs_extra=require(_0x5d55('0x3'));var auth=require(_0x5d55('0x4'));var interaction=require(_0x5d55('0x5'));var config=require(_0x5d55('0x6'));var controller=require(_0x5d55('0x7'));router[_0x5d55('0x8')]('/',auth[_0x5d55('0x9')](),controller[_0x5d55('0xa')]);router[_0x5d55('0x8')](_0x5d55('0xb'),auth[_0x5d55('0x9')](),controller[_0x5d55('0xc')]);router[_0x5d55('0x8')]('/:id/sessions',auth[_0x5d55('0x9')](),controller['getSessions']);router[_0x5d55('0x8')]('/:id/answers',auth[_0x5d55('0x9')](),controller[_0x5d55('0xd')]);router[_0x5d55('0x8')](_0x5d55('0xe'),auth[_0x5d55('0x9')](),timeout(_0x5d55('0xf')),controller[_0x5d55('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5d55('0x11')]);router[_0x5d55('0x12')]('/:id/clone',auth[_0x5d55('0x9')](),controller[_0x5d55('0x13')]);router[_0x5d55('0x14')](_0x5d55('0xb'),auth['isAuthenticated'](),controller[_0x5d55('0x15')]);router[_0x5d55('0x16')](_0x5d55('0xb'),auth['isAuthenticated'](),controller[_0x5d55('0x17')]);module['exports']=router; \ No newline at end of file +var _0x7038=['fs-extra','../../components/auth/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','/:id','show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','create','post','clone','delete','destroy','multer','util','path','Router'];(function(_0x2e65df,_0x51af1e){var _0x71fa18=function(_0x161867){while(--_0x161867){_0x2e65df['push'](_0x2e65df['shift']());}};_0x71fa18(++_0x51af1e);}(_0x7038,0x80));var _0x8703=function(_0x38b50f,_0x190775){_0x38b50f=_0x38b50f-0x0;var _0x2bb03b=_0x7038[_0x38b50f];return _0x2bb03b;};'use strict';var multer=require(_0x8703('0x0'));var util=require(_0x8703('0x1'));var path=require(_0x8703('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8703('0x3')]();var fs_extra=require(_0x8703('0x4'));var auth=require(_0x8703('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8703('0x6'));var controller=require(_0x8703('0x7'));router[_0x8703('0x8')]('/',auth[_0x8703('0x9')](),controller['index']);router[_0x8703('0x8')](_0x8703('0xa'),auth[_0x8703('0x9')](),controller[_0x8703('0xb')]);router[_0x8703('0x8')](_0x8703('0xc'),auth['isAuthenticated'](),controller[_0x8703('0xd')]);router[_0x8703('0x8')](_0x8703('0xe'),auth['isAuthenticated'](),controller[_0x8703('0xf')]);router[_0x8703('0x8')](_0x8703('0x10'),auth[_0x8703('0x9')](),timeout('30s'),controller['getSummary']);router['post']('/',auth['isAuthenticated'](),controller[_0x8703('0x11')]);router[_0x8703('0x12')]('/:id/clone',auth[_0x8703('0x9')](),controller[_0x8703('0x13')]);router['put'](_0x8703('0xa'),auth[_0x8703('0x9')](),controller['update']);router[_0x8703('0x14')](_0x8703('0xa'),auth[_0x8703('0x9')](),controller[_0x8703('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index b76f8d5..e7d9f40 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 _0x9e4a=['isObjectLike','setDataValue','formData','stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','name','description','sequelize','lodash','util','exports','STRING','long'];(function(_0x35ffeb,_0x515bd8){var _0x2088d7=function(_0x1c96c8){while(--_0x1c96c8){_0x35ffeb['push'](_0x35ffeb['shift']());}};_0x2088d7(++_0x515bd8);}(_0x9e4a,0x1aa));var _0xa9e4=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x9e4a[_0x199572];return _0x13cfa3;};'use strict';var Sequelize=require(_0xa9e4('0x0'));var _=require(_0xa9e4('0x1'));var util=require(_0xa9e4('0x2'));module[_0xa9e4('0x3')]={'name':{'type':Sequelize[_0xa9e4('0x4')],'unique':'name'},'description':{'type':Sequelize[_0xa9e4('0x4')]},'formData':{'type':Sequelize['TEXT'](_0xa9e4('0x5')),'set':function(_0x7bb15){if(_[_0xa9e4('0x6')](_0x7bb15)){this[_0xa9e4('0x7')](_0xa9e4('0x8'),JSON[_0xa9e4('0x9')](_0x7bb15));}else if(_[_0xa9e4('0xa')](_0x7bb15)){this[_0xa9e4('0x7')](_0xa9e4('0x8'),_0x7bb15);}else{this[_0xa9e4('0x7')](_0xa9e4('0x8'),util[_0xa9e4('0xb')](_0xa9e4('0xc'),this[_0xa9e4('0xd')](_0xa9e4('0xe'))||'',this[_0xa9e4('0xd')](_0xa9e4('0xf'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xaceb=['getDataValue','description','BOOLEAN','lodash','exports','name','TEXT','long','isObjectLike','setDataValue','stringify','formData','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}'];(function(_0x179b1e,_0x3a4d26){var _0x16a717=function(_0x481ed6){while(--_0x481ed6){_0x179b1e['push'](_0x179b1e['shift']());}};_0x16a717(++_0x3a4d26);}(_0xaceb,0x11b));var _0xbace=function(_0xec9735,_0x123b3f){_0xec9735=_0xec9735-0x0;var _0x242b3f=_0xaceb[_0xec9735];return _0x242b3f;};'use strict';var Sequelize=require('sequelize');var _=require(_0xbace('0x0'));var util=require('util');module[_0xbace('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xbace('0x2')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xbace('0x3')](_0xbace('0x4')),'set':function(_0x1fb952){if(_[_0xbace('0x5')](_0x1fb952)){this[_0xbace('0x6')]('formData',JSON[_0xbace('0x7')](_0x1fb952));}else if(_['isString'](_0x1fb952)){this[_0xbace('0x6')]('formData',_0x1fb952);}else{this[_0xbace('0x6')](_0xbace('0x8'),util[_0xbace('0x9')](_0xbace('0xa'),this[_0xbace('0xb')](_0xbace('0x2'))||'',this[_0xbace('0xb')](_0xbace('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xbace('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xbace('0xd')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 6e3adb8..d8ccc19 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 _0x7400=['Content-type','text/csv','download','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','get','destroy','error','stack','name','index','map','JscriptyProject','fieldName','key','query','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','merge','where','options','includeAll','include','findAll','rows','show','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Projects','UserProfileSection','autoAssociation','UserProfileResource','clone','keys','omit','createdAt','updatedAt','body','role','userProfileId','catch','params','JscriptySessionReport','nolimit','ProjectId','findOne','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','starttime','-createdAt','questionId','question','format','SessionId','answer','push','isEmpty','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','Jscripty_Project_%d_Summary_%s.csv'];(function(_0x47ae34,_0x2628c8){var _0xf881ea=function(_0x160f29){while(--_0x160f29){_0x47ae34['push'](_0x47ae34['shift']());}};_0xf881ea(++_0x2628c8);}(_0x7400,0x1d7));var _0x0740=function(_0x38fbc2,_0x641aa1){_0x38fbc2=_0x38fbc2-0x0;var _0x43c7d4=_0x7400[_0x38fbc2];return _0x43c7d4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0740('0x0'));var zipdir=require(_0x0740('0x1'));var jsonpatch=require(_0x0740('0x2'));var rp=require(_0x0740('0x3'));var moment=require(_0x0740('0x4'));var BPromise=require(_0x0740('0x5'));var Mustache=require(_0x0740('0x6'));var util=require(_0x0740('0x7'));var path=require(_0x0740('0x8'));var sox=require(_0x0740('0x9'));var csv=require('to-csv');var ejs=require(_0x0740('0xa'));var fs=require('fs');var fs_extra=require(_0x0740('0xb'));var _=require('lodash');var squel=require(_0x0740('0xc'));var crypto=require(_0x0740('0xd'));var jsforce=require(_0x0740('0xe'));var deskjs=require(_0x0740('0xf'));var toCsv=require(_0x0740('0x10'));var querystring=require('querystring');var Papa=require(_0x0740('0x11'));var Redis=require(_0x0740('0x12'));var authService=require(_0x0740('0x13'));var qs=require(_0x0740('0x14'));var as=require(_0x0740('0x15'));var hardwareService=require(_0x0740('0x16'));var logger=require(_0x0740('0x17'))('api');var utils=require(_0x0740('0x18'));var config=require(_0x0740('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x0740('0x1a'))['db'];function respondWithStatusCode(_0x2491d9,_0x126840){_0x126840=_0x126840||0xcc;return function(_0x6f5684){if(_0x6f5684){return _0x2491d9[_0x0740('0x1b')](_0x126840);}return _0x2491d9[_0x0740('0x1c')](_0x126840)[_0x0740('0x1d')]();};}function respondWithResult(_0x36e7d9,_0x534cec){_0x534cec=_0x534cec||0xc8;return function(_0x558a6e){if(_0x558a6e){return _0x36e7d9[_0x0740('0x1c')](_0x534cec)[_0x0740('0x1e')](_0x558a6e);}};}function respondWithFilteredResult(_0x1fc937,_0x374124){return function(_0x51713d){if(_0x51713d){var _0x27cf44=typeof _0x374124[_0x0740('0x1f')]===_0x0740('0x20')&&typeof _0x374124[_0x0740('0x21')]===_0x0740('0x20');var _0x25f8ee=_0x51713d['count'];var _0x41adda=_0x27cf44?0x0:_0x374124[_0x0740('0x1f')];var _0x1c9669=_0x27cf44?_0x51713d[_0x0740('0x22')]:_0x374124['offset']+_0x374124[_0x0740('0x21')];var _0x1d1218;if(_0x1c9669>=_0x25f8ee){_0x1c9669=_0x25f8ee;_0x1d1218=0xc8;}else{_0x1d1218=0xce;}_0x1fc937[_0x0740('0x1c')](_0x1d1218);return _0x1fc937[_0x0740('0x23')](_0x0740('0x24'),_0x41adda+'-'+_0x1c9669+'/'+_0x25f8ee)[_0x0740('0x1e')](_0x51713d);}return null;};}function patchUpdates(_0x3ceb7d){return function(_0x2e2e24){try{jsonpatch[_0x0740('0x25')](_0x2e2e24,_0x3ceb7d,!![]);}catch(_0x11fc6a){return BPromise[_0x0740('0x26')](_0x11fc6a);}return _0x2e2e24['save']();};}function saveUpdates(_0xc20b80,_0x28bb70){return function(_0x327c80){if(_0x327c80){return _0x327c80['update'](_0xc20b80)[_0x0740('0x27')](function(_0x92818d){return _0x92818d;});}return null;};}function removeEntity(_0x14535c,_0x45251c){return function(_0x3e70a7){if(_0x3e70a7){return _0x3e70a7['destroy']()[_0x0740('0x27')](function(){var _0x2060e7=_0x3e70a7[_0x0740('0x28')]({'plain':!![]});var _0x4da3cd='Projects';return db['UserProfileResource'][_0x0740('0x29')]({'where':{'type':_0x4da3cd,'resourceId':_0x2060e7['id']}})[_0x0740('0x27')](function(){return _0x3e70a7;});})[_0x0740('0x27')](function(){_0x14535c[_0x0740('0x1c')](0xcc)[_0x0740('0x1d')]();});}};}function handleEntityNotFound(_0x4004d9,_0x6426bb){return function(_0xe2314d){if(!_0xe2314d){_0x4004d9[_0x0740('0x1b')](0x194);}return _0xe2314d;};}function handleError(_0x2ac79e,_0xc3d044){_0xc3d044=_0xc3d044||0x1f4;return function(_0x3b11dc){logger[_0x0740('0x2a')](_0x3b11dc[_0x0740('0x2b')]);if(_0x3b11dc[_0x0740('0x2c')]){delete _0x3b11dc[_0x0740('0x2c')];}_0x2ac79e[_0x0740('0x1c')](_0xc3d044)['send'](_0x3b11dc);};}exports[_0x0740('0x2d')]=function(_0x417735,_0x4ce9e7){var _0x4bc11f={},_0x2eed03={},_0xf522b={'count':0x0,'rows':[]};var _0x54dc03=_[_0x0740('0x2e')](db[_0x0740('0x2f')]['rawAttributes'],function(_0x2261cf){return{'name':_0x2261cf[_0x0740('0x30')],'type':_0x2261cf['type'][_0x0740('0x31')]};});_0x2eed03['model']=_[_0x0740('0x2e')](_0x54dc03,_0x0740('0x2c'));_0x2eed03[_0x0740('0x32')]=_['keys'](_0x417735[_0x0740('0x32')]);_0x2eed03['filters']=_[_0x0740('0x33')](_0x2eed03[_0x0740('0x34')],_0x2eed03[_0x0740('0x32')]);_0x4bc11f[_0x0740('0x35')]=_[_0x0740('0x33')](_0x2eed03[_0x0740('0x34')],qs[_0x0740('0x36')](_0x417735[_0x0740('0x32')][_0x0740('0x36')]));_0x4bc11f[_0x0740('0x35')]=_0x4bc11f[_0x0740('0x35')][_0x0740('0x37')]?_0x4bc11f[_0x0740('0x35')]:_0x2eed03[_0x0740('0x34')];if(!_0x417735['query'][_0x0740('0x38')]('nolimit')){_0x4bc11f[_0x0740('0x21')]=qs[_0x0740('0x21')](_0x417735['query'][_0x0740('0x21')]);_0x4bc11f[_0x0740('0x1f')]=qs['offset'](_0x417735[_0x0740('0x32')][_0x0740('0x1f')]);}_0x4bc11f[_0x0740('0x39')]=qs['sort'](_0x417735[_0x0740('0x32')][_0x0740('0x3a')]);_0x4bc11f['where']=qs[_0x0740('0x3b')](_[_0x0740('0x3c')](_0x417735[_0x0740('0x32')],_0x2eed03[_0x0740('0x3b')]),_0x54dc03);if(_0x417735['query'][_0x0740('0x3d')]){_0x4bc11f['where']=_[_0x0740('0x3e')](_0x4bc11f[_0x0740('0x3f')],{'$or':_[_0x0740('0x2e')](_0x54dc03,function(_0x7aa1f0){if(_0x7aa1f0['type']!=='VIRTUAL'){var _0x3e42a6={};_0x3e42a6[_0x7aa1f0[_0x0740('0x2c')]]={'$like':'%'+_0x417735[_0x0740('0x32')]['filter']+'%'};return _0x3e42a6;}})});}_0x4bc11f=_[_0x0740('0x3e')]({},_0x4bc11f,_0x417735[_0x0740('0x40')]);var _0x946ef={'where':_0x4bc11f[_0x0740('0x3f')]};return db[_0x0740('0x2f')][_0x0740('0x22')](_0x946ef)[_0x0740('0x27')](function(_0x5eb7cb){_0xf522b[_0x0740('0x22')]=_0x5eb7cb;if(_0x417735[_0x0740('0x32')][_0x0740('0x41')]){_0x4bc11f[_0x0740('0x42')]=[{'all':!![]}];}return db[_0x0740('0x2f')][_0x0740('0x43')](_0x4bc11f);})['then'](function(_0xaf656e){_0xf522b[_0x0740('0x44')]=_0xaf656e;return _0xf522b;})[_0x0740('0x27')](respondWithFilteredResult(_0x4ce9e7,_0x4bc11f))['catch'](handleError(_0x4ce9e7,null));};exports[_0x0740('0x45')]=function(_0x5c31d4,_0xabcec){var _0x3801f4={'raw':![],'where':{'id':_0x5c31d4['params']['id']}},_0x5ae5cc={};_0x5ae5cc[_0x0740('0x34')]=_['keys'](db[_0x0740('0x2f')][_0x0740('0x46')]);_0x5ae5cc[_0x0740('0x32')]=_['keys'](_0x5c31d4[_0x0740('0x32')]);_0x5ae5cc['filters']=_[_0x0740('0x33')](_0x5ae5cc['model'],_0x5ae5cc[_0x0740('0x32')]);_0x3801f4[_0x0740('0x35')]=_[_0x0740('0x33')](_0x5ae5cc[_0x0740('0x34')],qs[_0x0740('0x36')](_0x5c31d4[_0x0740('0x32')][_0x0740('0x36')]));_0x3801f4['attributes']=_0x3801f4[_0x0740('0x35')]['length']?_0x3801f4[_0x0740('0x35')]:_0x5ae5cc[_0x0740('0x34')];if(_0x5c31d4[_0x0740('0x32')][_0x0740('0x41')]){_0x3801f4[_0x0740('0x42')]=[{'all':!![]}];}_0x3801f4=_[_0x0740('0x3e')]({},_0x3801f4,_0x5c31d4[_0x0740('0x40')]);return db[_0x0740('0x2f')][_0x0740('0x47')](_0x3801f4)[_0x0740('0x27')](handleEntityNotFound(_0xabcec,null))[_0x0740('0x27')](respondWithResult(_0xabcec,null))['catch'](handleError(_0xabcec,null));};exports['create']=function(_0xa8718c,_0x1276a0){return db[_0x0740('0x2f')][_0x0740('0x48')](_0xa8718c['body'],{})[_0x0740('0x27')](function(_0x3de7d8){var _0x557d4d=_0xa8718c[_0x0740('0x49')][_0x0740('0x28')]({'plain':!![]});if(!_0x557d4d)throw new Error(_0x0740('0x4a'));if(_0x557d4d['role']===_0x0740('0x49')){var _0x4b3d19=_0x3de7d8[_0x0740('0x28')]({'plain':!![]});var _0x5e6116=_0x0740('0x4b');return db[_0x0740('0x4c')]['find']({'where':{'name':_0x5e6116,'userProfileId':_0x557d4d['userProfileId']},'raw':!![]})[_0x0740('0x27')](function(_0x3b9f86){if(_0x3b9f86&&_0x3b9f86[_0x0740('0x4d')]===0x0){return db[_0x0740('0x4e')][_0x0740('0x48')]({'name':_0x4b3d19[_0x0740('0x2c')],'resourceId':_0x4b3d19['id'],'type':_0x3b9f86[_0x0740('0x2c')],'sectionId':_0x3b9f86['id']},{})[_0x0740('0x27')](function(){return _0x3de7d8;});}else{return _0x3de7d8;}})['catch'](function(_0x223a7d){logger[_0x0740('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x223a7d);throw _0x223a7d;});}return _0x3de7d8;})[_0x0740('0x27')](respondWithResult(_0x1276a0,0xc9))['catch'](handleError(_0x1276a0,null));};exports[_0x0740('0x4f')]=function(_0x38a9fa,_0x4e19da){var _0x43c36b={'where':{'id':_0x38a9fa['params']['id']}},_0x21c5b1={};_0x21c5b1[_0x0740('0x34')]=_[_0x0740('0x50')](db[_0x0740('0x2f')][_0x0740('0x46')]);_0x43c36b[_0x0740('0x35')]=_[_0x0740('0x33')](_0x21c5b1[_0x0740('0x34')],qs[_0x0740('0x36')](_0x38a9fa[_0x0740('0x32')]['fields']));_0x43c36b['attributes']=_0x43c36b['attributes']['length']?_0x43c36b[_0x0740('0x35')]:_0x21c5b1[_0x0740('0x34')];if(_0x38a9fa[_0x0740('0x32')][_0x0740('0x41')]){_0x43c36b[_0x0740('0x42')]=[{'all':!![]}];}_0x43c36b=_[_0x0740('0x3e')]({},_0x43c36b,_0x38a9fa[_0x0740('0x40')]);return db['JscriptyProject'][_0x0740('0x47')](_0x43c36b)['then'](handleEntityNotFound(_0x4e19da,null))[_0x0740('0x27')](function(_0x4ce998){if(_0x4ce998){var _0x5309ee=_0x4ce998[_0x0740('0x28')]({'plain':!![]});_0x5309ee=qs[_0x0740('0x51')](_0x5309ee,['id',_0x0740('0x52'),_0x0740('0x53')]);_0x38a9fa['body']=_[_0x0740('0x51')](_0x38a9fa[_0x0740('0x54')],['id',_0x0740('0x52'),_0x0740('0x53')]);return db[_0x0740('0x2f')][_0x0740('0x48')](_[_0x0740('0x3e')](_0x5309ee,_0x38a9fa[_0x0740('0x54')]),{'include':_0x38a9fa[_0x0740('0x32')][_0x0740('0x41')]?[{'all':!![]}]:undefined})[_0x0740('0x27')](function(_0x3f388f){var _0x2309d0=_0x38a9fa['user']['get']({'plain':!![]});if(!_0x2309d0)throw new Error(_0x0740('0x4a'));if(_0x2309d0[_0x0740('0x55')]===_0x0740('0x49')){var _0x41c671=_0x3f388f[_0x0740('0x28')]({'plain':!![]});var _0x2da739=_0x0740('0x4b');return db[_0x0740('0x4c')]['find']({'where':{'name':_0x2da739,'userProfileId':_0x2309d0[_0x0740('0x56')]},'raw':!![]})[_0x0740('0x27')](function(_0x47b3fa){if(_0x47b3fa&&_0x47b3fa['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x41c671[_0x0740('0x2c')],'resourceId':_0x41c671['id'],'type':_0x47b3fa['name'],'sectionId':_0x47b3fa['id']},{})['then'](function(){return _0x3f388f;});}else{return _0x3f388f;}})[_0x0740('0x57')](function(_0x58290d){logger[_0x0740('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x58290d);throw _0x58290d;});}return _0x3f388f;});}})[_0x0740('0x27')](respondWithResult(_0x4e19da,0xc9))[_0x0740('0x57')](handleError(_0x4e19da,null));};exports['update']=function(_0x47c4e6,_0x287c11){if(_0x47c4e6[_0x0740('0x54')]['id']){delete _0x47c4e6[_0x0740('0x54')]['id'];}return db['JscriptyProject'][_0x0740('0x47')]({'where':{'id':_0x47c4e6[_0x0740('0x58')]['id']}})['then'](handleEntityNotFound(_0x287c11,null))[_0x0740('0x27')](saveUpdates(_0x47c4e6['body'],null))[_0x0740('0x27')](respondWithResult(_0x287c11,null))['catch'](handleError(_0x287c11,null));};exports[_0x0740('0x29')]=function(_0x428fa7,_0x1be550){return db['JscriptyProject'][_0x0740('0x47')]({'where':{'id':_0x428fa7[_0x0740('0x58')]['id']}})[_0x0740('0x27')](handleEntityNotFound(_0x1be550,null))[_0x0740('0x27')](removeEntity(_0x1be550,null))['catch'](handleError(_0x1be550,null));};exports['getSessions']=function(_0x42a9ea,_0x34db6f,_0x375b9e){var _0x186b87={'raw':!![],'where':{}};var _0x15abf4={};var _0x5e06b1={'count':0x0,'rows':[]};return db[_0x0740('0x2f')]['findOne']({'where':{'id':_0x42a9ea[_0x0740('0x58')]['id']}})[_0x0740('0x27')](handleEntityNotFound(_0x34db6f,null))[_0x0740('0x27')](function(_0x15297b){if(_0x15297b){_0x15abf4[_0x0740('0x34')]=_['keys'](db[_0x0740('0x59')][_0x0740('0x46')]);_0x15abf4[_0x0740('0x32')]=_[_0x0740('0x50')](_0x42a9ea[_0x0740('0x32')]);_0x15abf4[_0x0740('0x3b')]=_[_0x0740('0x33')](_0x15abf4[_0x0740('0x34')],_0x15abf4[_0x0740('0x32')]);_0x186b87[_0x0740('0x35')]=_['intersection'](_0x15abf4[_0x0740('0x34')],qs[_0x0740('0x36')](_0x42a9ea[_0x0740('0x32')][_0x0740('0x36')]));_0x186b87[_0x0740('0x35')]=_0x186b87[_0x0740('0x35')]['length']?_0x186b87[_0x0740('0x35')]:_0x15abf4[_0x0740('0x34')];if(!_0x42a9ea[_0x0740('0x32')]['hasOwnProperty'](_0x0740('0x5a'))){_0x186b87[_0x0740('0x21')]=qs[_0x0740('0x21')](_0x42a9ea[_0x0740('0x32')][_0x0740('0x21')]);_0x186b87[_0x0740('0x1f')]=qs[_0x0740('0x1f')](_0x42a9ea[_0x0740('0x32')]['offset']);}_0x186b87[_0x0740('0x39')]=qs['sort'](_0x42a9ea[_0x0740('0x32')][_0x0740('0x3a')]);_0x186b87[_0x0740('0x3f')]=qs[_0x0740('0x3b')](_['pick'](_0x42a9ea['query'],_0x15abf4[_0x0740('0x3b')]));_0x186b87[_0x0740('0x3f')][_0x0740('0x5b')]=_0x15297b['id'];if(_0x42a9ea[_0x0740('0x32')][_0x0740('0x3d')]){_0x186b87[_0x0740('0x3f')]=_['merge'](_0x186b87[_0x0740('0x3f')],{'$or':_[_0x0740('0x2e')](_0x186b87[_0x0740('0x35')],function(_0x2a6547){var _0x52d5d7={};_0x52d5d7[_0x2a6547]={'$like':'%'+_0x42a9ea[_0x0740('0x32')][_0x0740('0x3d')]+'%'};return _0x52d5d7;})});}_0x186b87=_['merge']({},_0x186b87,_0x42a9ea[_0x0740('0x40')]);return db[_0x0740('0x59')][_0x0740('0x22')]({'where':_0x186b87[_0x0740('0x3f')]})[_0x0740('0x27')](function(_0x587b52){_0x5e06b1['count']=_0x587b52;if(_0x42a9ea[_0x0740('0x32')][_0x0740('0x41')]){_0x186b87[_0x0740('0x42')]=[{'all':!![]}];}return db[_0x0740('0x59')][_0x0740('0x43')](_0x186b87);})[_0x0740('0x27')](function(_0x491706){_0x5e06b1[_0x0740('0x44')]=_0x491706;return _0x5e06b1;});}})[_0x0740('0x27')](respondWithFilteredResult(_0x34db6f,_0x186b87))[_0x0740('0x57')](handleError(_0x34db6f,null));};exports['getAnswers']=function(_0x4ecf4c,_0x2a6c0d,_0xd51b8c){var _0x540cb4={'raw':!![],'where':{}};var _0x2cdf2b={};var _0x557718={'count':0x0,'rows':[]};return db[_0x0740('0x2f')][_0x0740('0x5c')]({'where':{'id':_0x4ecf4c[_0x0740('0x58')]['id']}})[_0x0740('0x27')](handleEntityNotFound(_0x2a6c0d,null))['then'](function(_0x224fbf){if(_0x224fbf){_0x2cdf2b[_0x0740('0x34')]=_[_0x0740('0x50')](db[_0x0740('0x5d')]['rawAttributes']);_0x2cdf2b[_0x0740('0x32')]=_[_0x0740('0x50')](_0x4ecf4c[_0x0740('0x32')]);_0x2cdf2b[_0x0740('0x3b')]=_[_0x0740('0x33')](_0x2cdf2b[_0x0740('0x34')],_0x2cdf2b[_0x0740('0x32')]);_0x540cb4[_0x0740('0x35')]=_[_0x0740('0x33')](_0x2cdf2b[_0x0740('0x34')],qs[_0x0740('0x36')](_0x4ecf4c['query'][_0x0740('0x36')]));_0x540cb4[_0x0740('0x35')]=_0x540cb4[_0x0740('0x35')][_0x0740('0x37')]?_0x540cb4[_0x0740('0x35')]:_0x2cdf2b[_0x0740('0x34')];if(!_0x4ecf4c['query']['hasOwnProperty'](_0x0740('0x5a'))){_0x540cb4[_0x0740('0x21')]=qs[_0x0740('0x21')](_0x4ecf4c[_0x0740('0x32')][_0x0740('0x21')]);_0x540cb4[_0x0740('0x1f')]=qs[_0x0740('0x1f')](_0x4ecf4c[_0x0740('0x32')][_0x0740('0x1f')]);}_0x540cb4['order']=qs[_0x0740('0x3a')](_0x4ecf4c['query'][_0x0740('0x3a')]);_0x540cb4[_0x0740('0x3f')]=qs[_0x0740('0x3b')](_['pick'](_0x4ecf4c[_0x0740('0x32')],_0x2cdf2b[_0x0740('0x3b')]));_0x540cb4[_0x0740('0x3f')][_0x0740('0x5b')]=_0x224fbf['id'];if(_0x4ecf4c[_0x0740('0x32')][_0x0740('0x3d')]){_0x540cb4[_0x0740('0x3f')]=_[_0x0740('0x3e')](_0x540cb4[_0x0740('0x3f')],{'$or':_[_0x0740('0x2e')](_0x540cb4[_0x0740('0x35')],function(_0x1a774a){var _0x33029b={};_0x33029b[_0x1a774a]={'$like':'%'+_0x4ecf4c['query'][_0x0740('0x3d')]+'%'};return _0x33029b;})});}_0x540cb4=_[_0x0740('0x3e')]({},_0x540cb4,_0x4ecf4c[_0x0740('0x40')]);return db[_0x0740('0x5d')][_0x0740('0x22')]({'where':_0x540cb4['where']})['then'](function(_0x579f3d){_0x557718['count']=_0x579f3d;if(_0x4ecf4c[_0x0740('0x32')][_0x0740('0x41')]){_0x540cb4[_0x0740('0x42')]=[{'all':!![]}];}return db[_0x0740('0x5d')][_0x0740('0x43')](_0x540cb4);})[_0x0740('0x27')](function(_0x117ae6){_0x557718[_0x0740('0x44')]=_0x117ae6;return _0x557718;});}})[_0x0740('0x27')](respondWithFilteredResult(_0x2a6c0d,_0x540cb4))[_0x0740('0x57')](handleError(_0x2a6c0d,null));};function char(_0x3d3ed1){return _0x0740('0x5e')===typeof _0x3d3ed1?String[_0x0740('0x5f')]['apply'](null,arguments):_0x3d3ed1;}function needsEncapsulation(_0x16c53d){return!!_0x16c53d&&(_0x16c53d[_0x0740('0x60')]()[_0x0740('0x61')](char(0xd))>=0x0||_0x16c53d[_0x0740('0x60')]()[_0x0740('0x61')](char(0xa))>=0x0||_0x16c53d[_0x0740('0x60')]()['indexOf'](char(0x2c))>=0x0||_0x16c53d[_0x0740('0x60')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x385a70){var _0x378151=char(0x22),_0xcdfff4='\x5c'+char(0x22),_0x4217ca=_0x385a70[_0x0740('0x60')]()[_0x0740('0x62')](new RegExp(_0x378151,'g'),_0xcdfff4);return _0x378151+_0x4217ca+_0x378151;}exports[_0x0740('0x63')]=function(_0x2829bf,_0x3262d5,_0x4e9d25){var _0x633a62,_0x51afca;var _0xd73c6d={'where':{'ProjectId':_0x2829bf[_0x0740('0x58')]['id']}};if(_0x2829bf[_0x0740('0x32')][_0x0740('0x64')]){_0xd73c6d['where'][_0x0740('0x65')]=JSON['parse'](_0x2829bf['query'][_0x0740('0x64')]);}return db['JscriptySessionReport'][_0x0740('0x43')](_0xd73c6d)[_0x0740('0x27')](handleEntityNotFound(_0x3262d5,null))['then'](function(_0x464583){if(_0x464583){_0x633a62=_0x464583;return db['JscriptyQuestionReport'][_0x0740('0x43')]({'where':{'SessionId':{'$in':_[_0x0740('0x2e')](_0x633a62,'id')},'ProjectId':_0x2829bf[_0x0740('0x58')]['id']},'order':_0x0740('0x66')});}})[_0x0740('0x27')](handleEntityNotFound(_0x3262d5,null))[_0x0740('0x27')](function(_0x3896fb){if(_0x3896fb){_0x51afca=_0x3896fb;var _0x482898={};for(var _0x1606a4=0x0,_0x2d3047=_0x51afca['length'];_0x1606a4<_0x2d3047;_0x1606a4++){if(!_0x482898[_0x0740('0x38')](_0x51afca[_0x1606a4][_0x0740('0x67')])){_0x482898[_0x51afca[_0x1606a4]['questionId']]=needsEncapsulation(_0x51afca[_0x1606a4]['question'])?encapsulate(_0x51afca[_0x1606a4][_0x0740('0x68')]):_0x51afca[_0x1606a4][_0x0740('0x68')];}}var _0x372ee5=[],_0x42e68d={};for(var _0x590c55=0x0,_0x5702f5=_0x633a62[_0x0740('0x37')];_0x590c55<_0x5702f5;_0x590c55++){_0x42e68d={'ProjectId':_0x2829bf['params']['id'],'SessionId':_0x633a62[_0x590c55]['id'],'StartTime':moment(_0x633a62[_0x590c55]['starttime'])[_0x0740('0x69')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x727305=0x0,_0x1bab32=_0x51afca['length'];_0x727305<_0x1bab32;_0x727305++){if(_0x51afca[_0x727305][_0x0740('0x6a')]==_0x633a62[_0x590c55]['id']&&_0x482898[_0x0740('0x38')](_0x51afca[_0x727305]['questionId'])){_0x42e68d[_0x482898[_0x51afca[_0x727305]['questionId']]]=_0x51afca[_0x727305][_0x0740('0x6b')];}}for(var _0x3ebb90 in _0x482898){if(!_0x42e68d[_0x0740('0x38')](_0x482898[_0x3ebb90])){_0x42e68d[_0x482898[_0x3ebb90]]=null;}}_0x372ee5[_0x0740('0x6c')](_0x42e68d);}return _0x372ee5;}})[_0x0740('0x27')](function(_0x13446b){if(!_[_0x0740('0x6d')](_0x13446b)){var _0x16657e=toCsv(_0x13446b);var _0x2833cf=Date['now']();fs['writeFileSync'](util[_0x0740('0x69')](_0x0740('0x6e'),_0x2829bf[_0x0740('0x58')]['id'],_0x2833cf),_0x16657e);_0x3262d5[_0x0740('0x6f')](_0x0740('0x70'),'attachment;\x20filename='+util['format'](_0x0740('0x71'),_0x2829bf[_0x0740('0x58')]['id'],_0x2833cf));_0x3262d5[_0x0740('0x6f')](_0x0740('0x72'),_0x0740('0x73'));return _0x3262d5[_0x0740('0x74')](util[_0x0740('0x69')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x2829bf[_0x0740('0x58')]['id'],_0x2833cf));}else{return _0x3262d5[_0x0740('0x1b')](0xcc);}})[_0x0740('0x57')](handleError(_0x3262d5,null));}; \ No newline at end of file +var _0xd3d3=['attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','JscriptyProject','includeAll','include','rows','catch','show','params','find','create','user','role','Projects','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','findOne','ProjectId','JscriptySessionReport','getAnswers','JscriptyAnswerReport','findAll','fromCharCode','toString','indexOf','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','download','sendStatus','zip-dir','fast-json-patch','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../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','save','update','then','get','UserProfileResource','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','model'];(function(_0x999b85,_0x1edc2b){var _0x1d7124=function(_0x59cd29){while(--_0x59cd29){_0x999b85['push'](_0x999b85['shift']());}};_0x1d7124(++_0x1edc2b);}(_0xd3d3,0x19a));var _0x3d3d=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xd3d3[_0x51020b];return _0x371e47;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3d3d('0x0'));var jsonpatch=require(_0x3d3d('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3d3d('0x2'));var util=require(_0x3d3d('0x3'));var path=require(_0x3d3d('0x4'));var sox=require('sox');var csv=require(_0x3d3d('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3d3d('0x6'));var _=require(_0x3d3d('0x7'));var squel=require(_0x3d3d('0x8'));var crypto=require(_0x3d3d('0x9'));var jsforce=require(_0x3d3d('0xa'));var deskjs=require(_0x3d3d('0xb'));var toCsv=require(_0x3d3d('0x5'));var querystring=require('querystring');var Papa=require(_0x3d3d('0xc'));var Redis=require(_0x3d3d('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x3d3d('0xe'));var as=require(_0x3d3d('0xf'));var hardwareService=require(_0x3d3d('0x10'));var logger=require(_0x3d3d('0x11'))(_0x3d3d('0x12'));var utils=require(_0x3d3d('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x3d3d('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1cb5f3,_0xe37fe6){_0xe37fe6=_0xe37fe6||0xcc;return function(_0x12cef1){if(_0x12cef1){return _0x1cb5f3['sendStatus'](_0xe37fe6);}return _0x1cb5f3[_0x3d3d('0x15')](_0xe37fe6)[_0x3d3d('0x16')]();};}function respondWithResult(_0x25305d,_0x553f92){_0x553f92=_0x553f92||0xc8;return function(_0x32ca75){if(_0x32ca75){return _0x25305d[_0x3d3d('0x15')](_0x553f92)[_0x3d3d('0x17')](_0x32ca75);}};}function respondWithFilteredResult(_0x16274f,_0xb02393){return function(_0x22bb7d){if(_0x22bb7d){var _0x3840b8=typeof _0xb02393['offset']===_0x3d3d('0x18')&&typeof _0xb02393[_0x3d3d('0x19')]===_0x3d3d('0x18');var _0x5a3bcd=_0x22bb7d[_0x3d3d('0x1a')];var _0x4658b9=_0x3840b8?0x0:_0xb02393[_0x3d3d('0x1b')];var _0x94eba2=_0x3840b8?_0x22bb7d[_0x3d3d('0x1a')]:_0xb02393[_0x3d3d('0x1b')]+_0xb02393[_0x3d3d('0x19')];var _0x4eff34;if(_0x94eba2>=_0x5a3bcd){_0x94eba2=_0x5a3bcd;_0x4eff34=0xc8;}else{_0x4eff34=0xce;}_0x16274f[_0x3d3d('0x15')](_0x4eff34);return _0x16274f['set'](_0x3d3d('0x1c'),_0x4658b9+'-'+_0x94eba2+'/'+_0x5a3bcd)[_0x3d3d('0x17')](_0x22bb7d);}return null;};}function patchUpdates(_0x5691d9){return function(_0x5ede83){try{jsonpatch[_0x3d3d('0x1d')](_0x5ede83,_0x5691d9,!![]);}catch(_0x2cafd4){return BPromise[_0x3d3d('0x1e')](_0x2cafd4);}return _0x5ede83[_0x3d3d('0x1f')]();};}function saveUpdates(_0x49685a,_0x4291cb){return function(_0xf88a7e){if(_0xf88a7e){return _0xf88a7e[_0x3d3d('0x20')](_0x49685a)['then'](function(_0x388900){return _0x388900;});}return null;};}function removeEntity(_0x288002,_0x1dbb69){return function(_0x557bab){if(_0x557bab){return _0x557bab['destroy']()[_0x3d3d('0x21')](function(){var _0x38cd63=_0x557bab[_0x3d3d('0x22')]({'plain':!![]});var _0x25854e='Projects';return db[_0x3d3d('0x23')][_0x3d3d('0x24')]({'where':{'type':_0x25854e,'resourceId':_0x38cd63['id']}})[_0x3d3d('0x21')](function(){return _0x557bab;});})[_0x3d3d('0x21')](function(){_0x288002[_0x3d3d('0x15')](0xcc)[_0x3d3d('0x16')]();});}};}function handleEntityNotFound(_0x158504,_0x50fbad){return function(_0x49a2b7){if(!_0x49a2b7){_0x158504['sendStatus'](0x194);}return _0x49a2b7;};}function handleError(_0x566dd8,_0x5bf25b){_0x5bf25b=_0x5bf25b||0x1f4;return function(_0x51c8fb){logger[_0x3d3d('0x25')](_0x51c8fb[_0x3d3d('0x26')]);if(_0x51c8fb[_0x3d3d('0x27')]){delete _0x51c8fb[_0x3d3d('0x27')];}_0x566dd8[_0x3d3d('0x15')](_0x5bf25b)[_0x3d3d('0x28')](_0x51c8fb);};}exports[_0x3d3d('0x29')]=function(_0x5c1e3c,_0xecbe5b){var _0x20f7b8={},_0x421152={},_0x413e80={'count':0x0,'rows':[]};var _0x237815=_[_0x3d3d('0x2a')](db['JscriptyProject'][_0x3d3d('0x2b')],function(_0x366414){return{'name':_0x366414[_0x3d3d('0x2c')],'type':_0x366414[_0x3d3d('0x2d')][_0x3d3d('0x2e')]};});_0x421152['model']=_['map'](_0x237815,_0x3d3d('0x27'));_0x421152[_0x3d3d('0x2f')]=_[_0x3d3d('0x30')](_0x5c1e3c[_0x3d3d('0x2f')]);_0x421152['filters']=_['intersection'](_0x421152[_0x3d3d('0x31')],_0x421152[_0x3d3d('0x2f')]);_0x20f7b8[_0x3d3d('0x32')]=_[_0x3d3d('0x33')](_0x421152[_0x3d3d('0x31')],qs[_0x3d3d('0x34')](_0x5c1e3c[_0x3d3d('0x2f')][_0x3d3d('0x34')]));_0x20f7b8[_0x3d3d('0x32')]=_0x20f7b8[_0x3d3d('0x32')][_0x3d3d('0x35')]?_0x20f7b8['attributes']:_0x421152[_0x3d3d('0x31')];if(!_0x5c1e3c[_0x3d3d('0x2f')][_0x3d3d('0x36')](_0x3d3d('0x37'))){_0x20f7b8[_0x3d3d('0x19')]=qs[_0x3d3d('0x19')](_0x5c1e3c[_0x3d3d('0x2f')][_0x3d3d('0x19')]);_0x20f7b8[_0x3d3d('0x1b')]=qs['offset'](_0x5c1e3c['query'][_0x3d3d('0x1b')]);}_0x20f7b8[_0x3d3d('0x38')]=qs['sort'](_0x5c1e3c[_0x3d3d('0x2f')][_0x3d3d('0x39')]);_0x20f7b8['where']=qs[_0x3d3d('0x3a')](_[_0x3d3d('0x3b')](_0x5c1e3c[_0x3d3d('0x2f')],_0x421152[_0x3d3d('0x3a')]),_0x237815);if(_0x5c1e3c['query'][_0x3d3d('0x3c')]){_0x20f7b8[_0x3d3d('0x3d')]=_[_0x3d3d('0x3e')](_0x20f7b8[_0x3d3d('0x3d')],{'$or':_[_0x3d3d('0x2a')](_0x237815,function(_0x54647b){if(_0x54647b[_0x3d3d('0x2d')]!==_0x3d3d('0x3f')){var _0x486fc4={};_0x486fc4[_0x54647b[_0x3d3d('0x27')]]={'$like':'%'+_0x5c1e3c[_0x3d3d('0x2f')][_0x3d3d('0x3c')]+'%'};return _0x486fc4;}})});}_0x20f7b8=_['merge']({},_0x20f7b8,_0x5c1e3c[_0x3d3d('0x40')]);var _0x49db65={'where':_0x20f7b8[_0x3d3d('0x3d')]};return db[_0x3d3d('0x41')]['count'](_0x49db65)[_0x3d3d('0x21')](function(_0x130686){_0x413e80[_0x3d3d('0x1a')]=_0x130686;if(_0x5c1e3c[_0x3d3d('0x2f')][_0x3d3d('0x42')]){_0x20f7b8[_0x3d3d('0x43')]=[{'all':!![]}];}return db['JscriptyProject']['findAll'](_0x20f7b8);})['then'](function(_0xe5e1){_0x413e80[_0x3d3d('0x44')]=_0xe5e1;return _0x413e80;})[_0x3d3d('0x21')](respondWithFilteredResult(_0xecbe5b,_0x20f7b8))[_0x3d3d('0x45')](handleError(_0xecbe5b,null));};exports[_0x3d3d('0x46')]=function(_0x214357,_0x4fad9f){var _0x158b1d={'raw':![],'where':{'id':_0x214357[_0x3d3d('0x47')]['id']}},_0xde01a5={};_0xde01a5[_0x3d3d('0x31')]=_['keys'](db[_0x3d3d('0x41')]['rawAttributes']);_0xde01a5[_0x3d3d('0x2f')]=_[_0x3d3d('0x30')](_0x214357[_0x3d3d('0x2f')]);_0xde01a5[_0x3d3d('0x3a')]=_['intersection'](_0xde01a5[_0x3d3d('0x31')],_0xde01a5[_0x3d3d('0x2f')]);_0x158b1d['attributes']=_[_0x3d3d('0x33')](_0xde01a5['model'],qs['fields'](_0x214357['query'][_0x3d3d('0x34')]));_0x158b1d['attributes']=_0x158b1d[_0x3d3d('0x32')]['length']?_0x158b1d['attributes']:_0xde01a5['model'];if(_0x214357[_0x3d3d('0x2f')][_0x3d3d('0x42')]){_0x158b1d['include']=[{'all':!![]}];}_0x158b1d=_[_0x3d3d('0x3e')]({},_0x158b1d,_0x214357['options']);return db[_0x3d3d('0x41')][_0x3d3d('0x48')](_0x158b1d)[_0x3d3d('0x21')](handleEntityNotFound(_0x4fad9f,null))[_0x3d3d('0x21')](respondWithResult(_0x4fad9f,null))[_0x3d3d('0x45')](handleError(_0x4fad9f,null));};exports[_0x3d3d('0x49')]=function(_0x1825e8,_0x437782){return db[_0x3d3d('0x41')][_0x3d3d('0x49')](_0x1825e8['body'],{})[_0x3d3d('0x21')](function(_0x25f7a5){var _0x25d2f6=_0x1825e8[_0x3d3d('0x4a')][_0x3d3d('0x22')]({'plain':!![]});if(!_0x25d2f6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x25d2f6[_0x3d3d('0x4b')]===_0x3d3d('0x4a')){var _0xbad206=_0x25f7a5[_0x3d3d('0x22')]({'plain':!![]});var _0x1b22a9=_0x3d3d('0x4c');return db['UserProfileSection'][_0x3d3d('0x48')]({'where':{'name':_0x1b22a9,'userProfileId':_0x25d2f6['userProfileId']},'raw':!![]})[_0x3d3d('0x21')](function(_0x181c76){if(_0x181c76&&_0x181c76['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0xbad206[_0x3d3d('0x27')],'resourceId':_0xbad206['id'],'type':_0x181c76[_0x3d3d('0x27')],'sectionId':_0x181c76['id']},{})['then'](function(){return _0x25f7a5;});}else{return _0x25f7a5;}})['catch'](function(_0x1a0c6d){logger[_0x3d3d('0x25')](_0x3d3d('0x4d'),_0x1a0c6d);throw _0x1a0c6d;});}return _0x25f7a5;})[_0x3d3d('0x21')](respondWithResult(_0x437782,0xc9))[_0x3d3d('0x45')](handleError(_0x437782,null));};exports[_0x3d3d('0x4e')]=function(_0x346b0c,_0x1a98a1){var _0x50c0b1={'where':{'id':_0x346b0c[_0x3d3d('0x47')]['id']}},_0x24418d={};_0x24418d['model']=_[_0x3d3d('0x30')](db[_0x3d3d('0x41')][_0x3d3d('0x2b')]);_0x50c0b1[_0x3d3d('0x32')]=_['intersection'](_0x24418d['model'],qs['fields'](_0x346b0c['query'][_0x3d3d('0x34')]));_0x50c0b1['attributes']=_0x50c0b1[_0x3d3d('0x32')]['length']?_0x50c0b1[_0x3d3d('0x32')]:_0x24418d[_0x3d3d('0x31')];if(_0x346b0c[_0x3d3d('0x2f')][_0x3d3d('0x42')]){_0x50c0b1[_0x3d3d('0x43')]=[{'all':!![]}];}_0x50c0b1=_['merge']({},_0x50c0b1,_0x346b0c['options']);return db[_0x3d3d('0x41')][_0x3d3d('0x48')](_0x50c0b1)['then'](handleEntityNotFound(_0x1a98a1,null))[_0x3d3d('0x21')](function(_0x51be10){if(_0x51be10){var _0x419c4e=_0x51be10['get']({'plain':!![]});_0x419c4e=qs[_0x3d3d('0x4f')](_0x419c4e,['id',_0x3d3d('0x50'),_0x3d3d('0x51')]);_0x346b0c[_0x3d3d('0x52')]=_['omit'](_0x346b0c[_0x3d3d('0x52')],['id','createdAt',_0x3d3d('0x51')]);return db[_0x3d3d('0x41')]['create'](_[_0x3d3d('0x3e')](_0x419c4e,_0x346b0c[_0x3d3d('0x52')]),{'include':_0x346b0c[_0x3d3d('0x2f')][_0x3d3d('0x42')]?[{'all':!![]}]:undefined})['then'](function(_0x3c68fb){var _0x4d79ce=_0x346b0c[_0x3d3d('0x4a')][_0x3d3d('0x22')]({'plain':!![]});if(!_0x4d79ce)throw new Error(_0x3d3d('0x53'));if(_0x4d79ce[_0x3d3d('0x4b')]===_0x3d3d('0x4a')){var _0x5f0de4=_0x3c68fb['get']({'plain':!![]});var _0x130ee8=_0x3d3d('0x4c');return db['UserProfileSection'][_0x3d3d('0x48')]({'where':{'name':_0x130ee8,'userProfileId':_0x4d79ce[_0x3d3d('0x54')]},'raw':!![]})['then'](function(_0x46de23){if(_0x46de23&&_0x46de23['autoAssociation']===0x0){return db[_0x3d3d('0x23')][_0x3d3d('0x49')]({'name':_0x5f0de4['name'],'resourceId':_0x5f0de4['id'],'type':_0x46de23[_0x3d3d('0x27')],'sectionId':_0x46de23['id']},{})['then'](function(){return _0x3c68fb;});}else{return _0x3c68fb;}})['catch'](function(_0x4eb7da){logger[_0x3d3d('0x25')](_0x3d3d('0x4d'),_0x4eb7da);throw _0x4eb7da;});}return _0x3c68fb;});}})[_0x3d3d('0x21')](respondWithResult(_0x1a98a1,0xc9))[_0x3d3d('0x45')](handleError(_0x1a98a1,null));};exports[_0x3d3d('0x20')]=function(_0x4e7390,_0x57e663){if(_0x4e7390[_0x3d3d('0x52')]['id']){delete _0x4e7390[_0x3d3d('0x52')]['id'];}return db[_0x3d3d('0x41')][_0x3d3d('0x48')]({'where':{'id':_0x4e7390[_0x3d3d('0x47')]['id']}})['then'](handleEntityNotFound(_0x57e663,null))[_0x3d3d('0x21')](saveUpdates(_0x4e7390[_0x3d3d('0x52')],null))[_0x3d3d('0x21')](respondWithResult(_0x57e663,null))[_0x3d3d('0x45')](handleError(_0x57e663,null));};exports[_0x3d3d('0x24')]=function(_0x391c12,_0xbe69c4){return db[_0x3d3d('0x41')][_0x3d3d('0x48')]({'where':{'id':_0x391c12[_0x3d3d('0x47')]['id']}})[_0x3d3d('0x21')](handleEntityNotFound(_0xbe69c4,null))[_0x3d3d('0x21')](removeEntity(_0xbe69c4,null))['catch'](handleError(_0xbe69c4,null));};exports['getSessions']=function(_0x45d1d4,_0x16e672,_0x5b5554){var _0x19dae8={'raw':!![],'where':{}};var _0x158b51={};var _0x3fdd24={'count':0x0,'rows':[]};return db[_0x3d3d('0x41')][_0x3d3d('0x55')]({'where':{'id':_0x45d1d4[_0x3d3d('0x47')]['id']}})[_0x3d3d('0x21')](handleEntityNotFound(_0x16e672,null))[_0x3d3d('0x21')](function(_0x2421a7){if(_0x2421a7){_0x158b51[_0x3d3d('0x31')]=_[_0x3d3d('0x30')](db['JscriptySessionReport'][_0x3d3d('0x2b')]);_0x158b51['query']=_[_0x3d3d('0x30')](_0x45d1d4[_0x3d3d('0x2f')]);_0x158b51[_0x3d3d('0x3a')]=_['intersection'](_0x158b51['model'],_0x158b51[_0x3d3d('0x2f')]);_0x19dae8['attributes']=_[_0x3d3d('0x33')](_0x158b51[_0x3d3d('0x31')],qs[_0x3d3d('0x34')](_0x45d1d4[_0x3d3d('0x2f')][_0x3d3d('0x34')]));_0x19dae8[_0x3d3d('0x32')]=_0x19dae8[_0x3d3d('0x32')][_0x3d3d('0x35')]?_0x19dae8['attributes']:_0x158b51['model'];if(!_0x45d1d4[_0x3d3d('0x2f')][_0x3d3d('0x36')](_0x3d3d('0x37'))){_0x19dae8[_0x3d3d('0x19')]=qs[_0x3d3d('0x19')](_0x45d1d4[_0x3d3d('0x2f')][_0x3d3d('0x19')]);_0x19dae8[_0x3d3d('0x1b')]=qs['offset'](_0x45d1d4[_0x3d3d('0x2f')]['offset']);}_0x19dae8[_0x3d3d('0x38')]=qs[_0x3d3d('0x39')](_0x45d1d4[_0x3d3d('0x2f')][_0x3d3d('0x39')]);_0x19dae8['where']=qs[_0x3d3d('0x3a')](_[_0x3d3d('0x3b')](_0x45d1d4['query'],_0x158b51[_0x3d3d('0x3a')]));_0x19dae8[_0x3d3d('0x3d')][_0x3d3d('0x56')]=_0x2421a7['id'];if(_0x45d1d4['query']['filter']){_0x19dae8[_0x3d3d('0x3d')]=_[_0x3d3d('0x3e')](_0x19dae8[_0x3d3d('0x3d')],{'$or':_[_0x3d3d('0x2a')](_0x19dae8[_0x3d3d('0x32')],function(_0x1417b5){var _0x30de4e={};_0x30de4e[_0x1417b5]={'$like':'%'+_0x45d1d4[_0x3d3d('0x2f')][_0x3d3d('0x3c')]+'%'};return _0x30de4e;})});}_0x19dae8=_['merge']({},_0x19dae8,_0x45d1d4['options']);return db[_0x3d3d('0x57')]['count']({'where':_0x19dae8['where']})[_0x3d3d('0x21')](function(_0x7d16f8){_0x3fdd24[_0x3d3d('0x1a')]=_0x7d16f8;if(_0x45d1d4[_0x3d3d('0x2f')]['includeAll']){_0x19dae8[_0x3d3d('0x43')]=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x19dae8);})[_0x3d3d('0x21')](function(_0x85ba84){_0x3fdd24[_0x3d3d('0x44')]=_0x85ba84;return _0x3fdd24;});}})[_0x3d3d('0x21')](respondWithFilteredResult(_0x16e672,_0x19dae8))[_0x3d3d('0x45')](handleError(_0x16e672,null));};exports[_0x3d3d('0x58')]=function(_0x6557b8,_0x1f78d8,_0x31124f){var _0x352b53={'raw':!![],'where':{}};var _0x221832={};var _0x46b342={'count':0x0,'rows':[]};return db[_0x3d3d('0x41')][_0x3d3d('0x55')]({'where':{'id':_0x6557b8[_0x3d3d('0x47')]['id']}})['then'](handleEntityNotFound(_0x1f78d8,null))[_0x3d3d('0x21')](function(_0x413607){if(_0x413607){_0x221832[_0x3d3d('0x31')]=_[_0x3d3d('0x30')](db['JscriptyAnswerReport']['rawAttributes']);_0x221832[_0x3d3d('0x2f')]=_[_0x3d3d('0x30')](_0x6557b8[_0x3d3d('0x2f')]);_0x221832[_0x3d3d('0x3a')]=_[_0x3d3d('0x33')](_0x221832[_0x3d3d('0x31')],_0x221832[_0x3d3d('0x2f')]);_0x352b53[_0x3d3d('0x32')]=_[_0x3d3d('0x33')](_0x221832[_0x3d3d('0x31')],qs[_0x3d3d('0x34')](_0x6557b8[_0x3d3d('0x2f')][_0x3d3d('0x34')]));_0x352b53['attributes']=_0x352b53[_0x3d3d('0x32')]['length']?_0x352b53['attributes']:_0x221832[_0x3d3d('0x31')];if(!_0x6557b8[_0x3d3d('0x2f')][_0x3d3d('0x36')](_0x3d3d('0x37'))){_0x352b53[_0x3d3d('0x19')]=qs['limit'](_0x6557b8[_0x3d3d('0x2f')][_0x3d3d('0x19')]);_0x352b53['offset']=qs[_0x3d3d('0x1b')](_0x6557b8[_0x3d3d('0x2f')][_0x3d3d('0x1b')]);}_0x352b53[_0x3d3d('0x38')]=qs['sort'](_0x6557b8[_0x3d3d('0x2f')][_0x3d3d('0x39')]);_0x352b53['where']=qs['filters'](_[_0x3d3d('0x3b')](_0x6557b8[_0x3d3d('0x2f')],_0x221832[_0x3d3d('0x3a')]));_0x352b53[_0x3d3d('0x3d')][_0x3d3d('0x56')]=_0x413607['id'];if(_0x6557b8[_0x3d3d('0x2f')][_0x3d3d('0x3c')]){_0x352b53[_0x3d3d('0x3d')]=_[_0x3d3d('0x3e')](_0x352b53[_0x3d3d('0x3d')],{'$or':_[_0x3d3d('0x2a')](_0x352b53['attributes'],function(_0x1f7fa8){var _0x34fa27={};_0x34fa27[_0x1f7fa8]={'$like':'%'+_0x6557b8[_0x3d3d('0x2f')][_0x3d3d('0x3c')]+'%'};return _0x34fa27;})});}_0x352b53=_[_0x3d3d('0x3e')]({},_0x352b53,_0x6557b8[_0x3d3d('0x40')]);return db[_0x3d3d('0x59')][_0x3d3d('0x1a')]({'where':_0x352b53[_0x3d3d('0x3d')]})[_0x3d3d('0x21')](function(_0x22f909){_0x46b342[_0x3d3d('0x1a')]=_0x22f909;if(_0x6557b8['query'][_0x3d3d('0x42')]){_0x352b53[_0x3d3d('0x43')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x3d3d('0x5a')](_0x352b53);})[_0x3d3d('0x21')](function(_0x235d77){_0x46b342[_0x3d3d('0x44')]=_0x235d77;return _0x46b342;});}})[_0x3d3d('0x21')](respondWithFilteredResult(_0x1f78d8,_0x352b53))[_0x3d3d('0x45')](handleError(_0x1f78d8,null));};function char(_0x1b6fd4){return'number'===typeof _0x1b6fd4?String[_0x3d3d('0x5b')]['apply'](null,arguments):_0x1b6fd4;}function needsEncapsulation(_0x31aa86){return!!_0x31aa86&&(_0x31aa86[_0x3d3d('0x5c')]()[_0x3d3d('0x5d')](char(0xd))>=0x0||_0x31aa86[_0x3d3d('0x5c')]()[_0x3d3d('0x5d')](char(0xa))>=0x0||_0x31aa86[_0x3d3d('0x5c')]()['indexOf'](char(0x2c))>=0x0||_0x31aa86[_0x3d3d('0x5c')]()[_0x3d3d('0x5d')](char(0x22))>=0x0);}function encapsulate(_0x3d73ad){var _0x652cb1=char(0x22),_0x18fb1b='\x5c'+char(0x22),_0x357e87=_0x3d73ad['toString']()['replace'](new RegExp(_0x652cb1,'g'),_0x18fb1b);return _0x652cb1+_0x357e87+_0x652cb1;}exports['getSummary']=function(_0x13d0ad,_0x5a34d6,_0x234852){var _0x134965,_0x31ead2;var _0x4159c8={'where':{'ProjectId':_0x13d0ad[_0x3d3d('0x47')]['id']}};if(_0x13d0ad['query'][_0x3d3d('0x5e')]){_0x4159c8['where'][_0x3d3d('0x5f')]=JSON[_0x3d3d('0x60')](_0x13d0ad[_0x3d3d('0x2f')]['startTime']);}return db[_0x3d3d('0x57')][_0x3d3d('0x5a')](_0x4159c8)[_0x3d3d('0x21')](handleEntityNotFound(_0x5a34d6,null))[_0x3d3d('0x21')](function(_0x85ff1f){if(_0x85ff1f){_0x134965=_0x85ff1f;return db[_0x3d3d('0x61')][_0x3d3d('0x5a')]({'where':{'SessionId':{'$in':_[_0x3d3d('0x2a')](_0x134965,'id')},'ProjectId':_0x13d0ad[_0x3d3d('0x47')]['id']},'order':_0x3d3d('0x62')});}})[_0x3d3d('0x21')](handleEntityNotFound(_0x5a34d6,null))[_0x3d3d('0x21')](function(_0x324019){if(_0x324019){_0x31ead2=_0x324019;var _0x4624b0={};for(var _0x22c86c=0x0,_0x30931c=_0x31ead2[_0x3d3d('0x35')];_0x22c86c<_0x30931c;_0x22c86c++){if(!_0x4624b0[_0x3d3d('0x36')](_0x31ead2[_0x22c86c]['questionId'])){_0x4624b0[_0x31ead2[_0x22c86c][_0x3d3d('0x63')]]=needsEncapsulation(_0x31ead2[_0x22c86c]['question'])?encapsulate(_0x31ead2[_0x22c86c][_0x3d3d('0x64')]):_0x31ead2[_0x22c86c][_0x3d3d('0x64')];}}var _0x366b92=[],_0x319b33={};for(var _0x241f56=0x0,_0x5df276=_0x134965['length'];_0x241f56<_0x5df276;_0x241f56++){_0x319b33={'ProjectId':_0x13d0ad[_0x3d3d('0x47')]['id'],'SessionId':_0x134965[_0x241f56]['id'],'StartTime':moment(_0x134965[_0x241f56]['starttime'])[_0x3d3d('0x65')](_0x3d3d('0x66'))};for(var _0x256dcf=0x0,_0x1a6892=_0x31ead2[_0x3d3d('0x35')];_0x256dcf<_0x1a6892;_0x256dcf++){if(_0x31ead2[_0x256dcf][_0x3d3d('0x67')]==_0x134965[_0x241f56]['id']&&_0x4624b0[_0x3d3d('0x36')](_0x31ead2[_0x256dcf][_0x3d3d('0x63')])){_0x319b33[_0x4624b0[_0x31ead2[_0x256dcf][_0x3d3d('0x63')]]]=_0x31ead2[_0x256dcf][_0x3d3d('0x68')];}}for(var _0x5ecd08 in _0x4624b0){if(!_0x319b33[_0x3d3d('0x36')](_0x4624b0[_0x5ecd08])){_0x319b33[_0x4624b0[_0x5ecd08]]=null;}}_0x366b92[_0x3d3d('0x69')](_0x319b33);}return _0x366b92;}})[_0x3d3d('0x21')](function(_0x25f799){if(!_['isEmpty'](_0x25f799)){var _0x817ed1=toCsv(_0x25f799);var _0x5da9be=Date[_0x3d3d('0x6a')]();fs[_0x3d3d('0x6b')](util[_0x3d3d('0x65')](_0x3d3d('0x6c'),_0x13d0ad[_0x3d3d('0x47')]['id'],_0x5da9be),_0x817ed1);_0x5a34d6[_0x3d3d('0x6d')](_0x3d3d('0x6e'),_0x3d3d('0x6f')+util[_0x3d3d('0x65')](_0x3d3d('0x70'),_0x13d0ad[_0x3d3d('0x47')]['id'],_0x5da9be));_0x5a34d6[_0x3d3d('0x6d')]('Content-type','text/csv');return _0x5a34d6[_0x3d3d('0x71')](util['format'](_0x3d3d('0x6c'),_0x13d0ad['params']['id'],_0x5da9be));}else{return _0x5a34d6[_0x3d3d('0x72')](0xcc);}})[_0x3d3d('0x45')](handleError(_0x5a34d6,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 671450e..1751f4b 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 _0x0faf=['path','rimraf','../../config/environment','./jscriptyProject.attributes','define','JscriptyProject','jscripty_projects','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1602ef,_0x447aba){var _0x5870ee=function(_0x4d94e7){while(--_0x4d94e7){_0x1602ef['push'](_0x1602ef['shift']());}};_0x5870ee(++_0x447aba);}(_0x0faf,0x132));var _0xf0fa=function(_0x3f3bad,_0x193f06){_0x3f3bad=_0x3f3bad-0x0;var _0x4f0801=_0x0faf[_0x3f3bad];return _0x4f0801;};'use strict';var _=require(_0xf0fa('0x0'));var util=require('util');var logger=require(_0xf0fa('0x1'))(_0xf0fa('0x2'));var moment=require(_0xf0fa('0x3'));var BPromise=require(_0xf0fa('0x4'));var rp=require(_0xf0fa('0x5'));var fs=require('fs');var path=require(_0xf0fa('0x6'));var rimraf=require(_0xf0fa('0x7'));var config=require(_0xf0fa('0x8'));var attributes=require(_0xf0fa('0x9'));module['exports']=function(_0x3637a3,_0x44ffa0){return _0x3637a3[_0xf0fa('0xa')](_0xf0fa('0xb'),attributes,{'tableName':_0xf0fa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x48e3=['util','api','request-promise','path','rimraf','../../config/environment','exports','define','lodash'];(function(_0xe634e9,_0x262b2c){var _0xb222bf=function(_0x471c36){while(--_0x471c36){_0xe634e9['push'](_0xe634e9['shift']());}};_0xb222bf(++_0x262b2c);}(_0x48e3,0xe9));var _0x348e=function(_0x292e54,_0x571b79){_0x292e54=_0x292e54-0x0;var _0x465fc9=_0x48e3[_0x292e54];return _0x465fc9;};'use strict';var _=require(_0x348e('0x0'));var util=require(_0x348e('0x1'));var logger=require('../../config/logger')(_0x348e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x348e('0x3'));var fs=require('fs');var path=require(_0x348e('0x4'));var rimraf=require(_0x348e('0x5'));var config=require(_0x348e('0x6'));var attributes=require('./jscriptyProject.attributes');module[_0x348e('0x7')]=function(_0x5201ec,_0x5902cd){return _0x5201ec[_0x348e('0x8')]('JscriptyProject',attributes,{'tableName':'jscripty_projects','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 07d2ab5..cedf682 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 _0xda3f=['rpc','jayson/promise','client','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','../../mysqldb','../../config/logger'];(function(_0x42f009,_0x5e27b1){var _0x22a1e0=function(_0x297993){while(--_0x297993){_0x42f009['push'](_0x42f009['shift']());}};_0x22a1e0(++_0x5e27b1);}(_0xda3f,0xec));var _0xfda3=function(_0x1dda72,_0x522fdb){_0x1dda72=_0x1dda72-0x0;var _0x595700=_0xda3f[_0x1dda72];return _0x595700;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var moment=require(_0xfda3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfda3('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xfda3('0x3'))(_0xfda3('0x4'));var config=require('../../config/environment');var jayson=require(_0xfda3('0x5'));var client=jayson[_0xfda3('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e72d1,_0x316792,_0x42476a){return new BPromise(function(_0x125e2a,_0x4018c0){return client[_0xfda3('0x7')](_0x4e72d1,_0x42476a)[_0xfda3('0x8')](function(_0x46655c){logger[_0xfda3('0x9')](_0xfda3('0xa'),_0x316792,_0xfda3('0xb'));logger[_0xfda3('0xc')](_0xfda3('0xd'),_0x316792,'request\x20sent',JSON[_0xfda3('0xe')](_0x46655c));if(_0x46655c[_0xfda3('0xf')]){if(_0x46655c[_0xfda3('0xf')][_0xfda3('0x10')]===0x1f4){logger[_0xfda3('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('JscriptyProject,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('JscriptyProject,\x20%s,\x20%s',_0x316792,_0xfda3('0xb'));_0x125e2a(_0x46655c[_0xfda3('0x12')][_0xfda3('0x11')]);}})[_0xfda3('0x13')](function(_0x34900d){logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x316792,_0x34900d);_0x4018c0(_0x34900d);});});} \ No newline at end of file +var _0xbdb7=['request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','info','JscriptyProject,\x20%s,\x20%s'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x27d2bf,_0x27ec74){_0x27d2bf=_0x27d2bf-0x0;var _0x5498a=_0xbdb7[_0x27d2bf];return _0x5498a;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var moment=require(_0x7bdb('0x2'));var BPromise=require(_0x7bdb('0x3'));var rs=require(_0x7bdb('0x4'));var fs=require('fs');var Redis=require(_0x7bdb('0x5'));var db=require(_0x7bdb('0x6'))['db'];var utils=require(_0x7bdb('0x7'));var logger=require(_0x7bdb('0x8'))('rpc');var config=require(_0x7bdb('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7bdb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e23a3,_0x493bde,_0x513cba){return new BPromise(function(_0x468041,_0x11a877){return client['request'](_0x1e23a3,_0x513cba)['then'](function(_0xdc2ffc){logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));logger[_0x7bdb('0xe')](_0x7bdb('0xf'),_0x493bde,_0x7bdb('0xd'),JSON[_0x7bdb('0x10')](_0xdc2ffc));if(_0xdc2ffc['error']){if(_0xdc2ffc['error']['code']===0x1f4){logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error'][_0x7bdb('0x12')]);return _0x11a877(_0xdc2ffc['error']['message']);}logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error']['message']);return _0x468041(_0xdc2ffc['error'][_0x7bdb('0x12')]);}else{logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));_0x468041(_0xdc2ffc[_0x7bdb('0x13')][_0x7bdb('0x12')]);}})[_0x7bdb('0x14')](function(_0x1b2d9b){logger['error'](_0x7bdb('0xc'),_0x493bde,_0x1b2d9b);_0x11a877(_0x1b2d9b);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index c39cfbc..42fc653 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 _0xa80d=['fs-extra','../../components/interaction/service','./jscriptyQuestionReport.controller','get','isAuthenticated','/describe','/:id','show','put','update','delete','destroy','exports','multer','util','connect-timeout','Router'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa80d,0x73));var _0xda80=function(_0x16d390,_0x20d98e){_0x16d390=_0x16d390-0x0;var _0x2cc640=_0xa80d[_0x16d390];return _0x2cc640;};'use strict';var multer=require(_0xda80('0x0'));var util=require(_0xda80('0x1'));var path=require('path');var timeout=require(_0xda80('0x2'));var express=require('express');var router=express[_0xda80('0x3')]();var fs_extra=require(_0xda80('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xda80('0x5'));var config=require('../../config/environment');var controller=require(_0xda80('0x6'));router[_0xda80('0x7')]('/',auth[_0xda80('0x8')](),controller['index']);router[_0xda80('0x7')](_0xda80('0x9'),auth[_0xda80('0x8')](),controller['describe']);router[_0xda80('0x7')](_0xda80('0xa'),auth[_0xda80('0x8')](),controller[_0xda80('0xb')]);router['post']('/',auth[_0xda80('0x8')](),controller['create']);router[_0xda80('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xda80('0xd')]);router[_0xda80('0xe')](_0xda80('0xa'),auth['isAuthenticated'](),controller[_0xda80('0xf')]);module[_0xda80('0x10')]=router; \ No newline at end of file +var _0xce4f=['create','put','update','delete','destroy','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0xce4f,0x83));var _0xfce4=function(_0x1e174a,_0xb3eb03){_0x1e174a=_0x1e174a-0x0;var _0x38b087=_0xce4f[_0x1e174a];return _0x38b087;};'use strict';var multer=require(_0xfce4('0x0'));var util=require('util');var path=require(_0xfce4('0x1'));var timeout=require(_0xfce4('0x2'));var express=require('express');var router=express[_0xfce4('0x3')]();var fs_extra=require(_0xfce4('0x4'));var auth=require(_0xfce4('0x5'));var interaction=require(_0xfce4('0x6'));var config=require('../../config/environment');var controller=require('./jscriptyQuestionReport.controller');router[_0xfce4('0x7')]('/',auth[_0xfce4('0x8')](),controller[_0xfce4('0x9')]);router['get'](_0xfce4('0xa'),auth['isAuthenticated'](),controller[_0xfce4('0xb')]);router[_0xfce4('0x7')](_0xfce4('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xfce4('0x8')](),controller[_0xfce4('0xd')]);router[_0xfce4('0xe')](_0xfce4('0xc'),auth[_0xfce4('0x8')](),controller[_0xfce4('0xf')]);router[_0xfce4('0x10')](_0xfce4('0xc'),auth[_0xfce4('0x8')](),controller[_0xfce4('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 2ae45f0..c29c92e 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(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x7a54,0x106));var _0x47a5=function(_0x31d0ea,_0x183107){_0x31d0ea=_0x31d0ea-0x0;var _0x146d3f=_0x7a54[_0x31d0ea];return _0x146d3f;};'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(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x7a54,0x106));var _0x47a5=function(_0x2dec3e,_0x42fbf6){_0x2dec3e=_0x2dec3e-0x0;var _0x2e79a2=_0x7a54[_0x2dec3e];return _0x2e79a2;};'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 f8f1b91..64bbbfc 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 _0xed62=['create','body','find','describe','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','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','end','status','json','offset','undefined','limit','count','Content-Range','save','update','destroy','sendStatus','stack','name','index','map','JscriptyQuestionReport','fieldName','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','type','merge','options','then','includeAll','include','findAll','rows','catch','show','params'];(function(_0x1fa482,_0x3099b0){var _0x4550a9=function(_0x3900c0){while(--_0x3900c0){_0x1fa482['push'](_0x1fa482['shift']());}};_0x4550a9(++_0x3099b0);}(_0xed62,0x128));var _0x2ed6=function(_0x307d9b,_0x4e8b6f){_0x307d9b=_0x307d9b-0x0;var _0x587497=_0xed62[_0x307d9b];return _0x587497;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2ed6('0x0'));var zipdir=require(_0x2ed6('0x1'));var jsonpatch=require(_0x2ed6('0x2'));var rp=require(_0x2ed6('0x3'));var moment=require(_0x2ed6('0x4'));var BPromise=require(_0x2ed6('0x5'));var Mustache=require(_0x2ed6('0x6'));var util=require(_0x2ed6('0x7'));var path=require(_0x2ed6('0x8'));var sox=require(_0x2ed6('0x9'));var csv=require(_0x2ed6('0xa'));var ejs=require(_0x2ed6('0xb'));var fs=require('fs');var fs_extra=require(_0x2ed6('0xc'));var _=require(_0x2ed6('0xd'));var squel=require('squel');var crypto=require(_0x2ed6('0xe'));var jsforce=require(_0x2ed6('0xf'));var deskjs=require(_0x2ed6('0x10'));var toCsv=require('to-csv');var querystring=require(_0x2ed6('0x11'));var Papa=require('papaparse');var Redis=require(_0x2ed6('0x12'));var authService=require(_0x2ed6('0x13'));var qs=require(_0x2ed6('0x14'));var as=require(_0x2ed6('0x15'));var hardwareService=require(_0x2ed6('0x16'));var logger=require(_0x2ed6('0x17'))(_0x2ed6('0x18'));var utils=require(_0x2ed6('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x35ff6a,_0x58c1aa){_0x58c1aa=_0x58c1aa||0xcc;return function(_0x44b374){if(_0x44b374){return _0x35ff6a['sendStatus'](_0x58c1aa);}return _0x35ff6a['status'](_0x58c1aa)[_0x2ed6('0x1a')]();};}function respondWithResult(_0x3bf45a,_0x46e17b){_0x46e17b=_0x46e17b||0xc8;return function(_0x418518){if(_0x418518){return _0x3bf45a[_0x2ed6('0x1b')](_0x46e17b)[_0x2ed6('0x1c')](_0x418518);}};}function respondWithFilteredResult(_0x103093,_0x5b41e1){return function(_0x387cb6){if(_0x387cb6){var _0x2fe17e=typeof _0x5b41e1[_0x2ed6('0x1d')]===_0x2ed6('0x1e')&&typeof _0x5b41e1[_0x2ed6('0x1f')]==='undefined';var _0x182e8a=_0x387cb6['count'];var _0x3686c5=_0x2fe17e?0x0:_0x5b41e1['offset'];var _0x520710=_0x2fe17e?_0x387cb6[_0x2ed6('0x20')]:_0x5b41e1[_0x2ed6('0x1d')]+_0x5b41e1[_0x2ed6('0x1f')];var _0x310020;if(_0x520710>=_0x182e8a){_0x520710=_0x182e8a;_0x310020=0xc8;}else{_0x310020=0xce;}_0x103093[_0x2ed6('0x1b')](_0x310020);return _0x103093['set'](_0x2ed6('0x21'),_0x3686c5+'-'+_0x520710+'/'+_0x182e8a)[_0x2ed6('0x1c')](_0x387cb6);}return null;};}function patchUpdates(_0x4663e4){return function(_0x501feb){try{jsonpatch['apply'](_0x501feb,_0x4663e4,!![]);}catch(_0x3b9494){return BPromise['reject'](_0x3b9494);}return _0x501feb[_0x2ed6('0x22')]();};}function saveUpdates(_0x1f7434,_0x11d202){return function(_0x565c77){if(_0x565c77){return _0x565c77[_0x2ed6('0x23')](_0x1f7434)['then'](function(_0x19f30c){return _0x19f30c;});}return null;};}function removeEntity(_0x3ebd51,_0x11f796){return function(_0x3c7d4a){if(_0x3c7d4a){return _0x3c7d4a[_0x2ed6('0x24')]()['then'](function(){_0x3ebd51['status'](0xcc)[_0x2ed6('0x1a')]();});}};}function handleEntityNotFound(_0x51e3ed,_0xe2deef){return function(_0x4dac56){if(!_0x4dac56){_0x51e3ed[_0x2ed6('0x25')](0x194);}return _0x4dac56;};}function handleError(_0x1e5025,_0x4064b1){_0x4064b1=_0x4064b1||0x1f4;return function(_0x5ec949){logger['error'](_0x5ec949[_0x2ed6('0x26')]);if(_0x5ec949[_0x2ed6('0x27')]){delete _0x5ec949[_0x2ed6('0x27')];}_0x1e5025[_0x2ed6('0x1b')](_0x4064b1)['send'](_0x5ec949);};}exports[_0x2ed6('0x28')]=function(_0x37916a,_0x3982e8){var _0x38c3ce={},_0x37813f={},_0x1bfead={'count':0x0,'rows':[]};var _0x27411b=_[_0x2ed6('0x29')](db[_0x2ed6('0x2a')]['rawAttributes'],function(_0x2ebd73){return{'name':_0x2ebd73[_0x2ed6('0x2b')],'type':_0x2ebd73['type']['key']};});_0x37813f[_0x2ed6('0x2c')]=_['map'](_0x27411b,_0x2ed6('0x27'));_0x37813f['query']=_[_0x2ed6('0x2d')](_0x37916a['query']);_0x37813f['filters']=_[_0x2ed6('0x2e')](_0x37813f[_0x2ed6('0x2c')],_0x37813f[_0x2ed6('0x2f')]);_0x38c3ce[_0x2ed6('0x30')]=_['intersection'](_0x37813f['model'],qs[_0x2ed6('0x31')](_0x37916a[_0x2ed6('0x2f')][_0x2ed6('0x31')]));_0x38c3ce[_0x2ed6('0x30')]=_0x38c3ce[_0x2ed6('0x30')][_0x2ed6('0x32')]?_0x38c3ce[_0x2ed6('0x30')]:_0x37813f[_0x2ed6('0x2c')];if(!_0x37916a[_0x2ed6('0x2f')][_0x2ed6('0x33')](_0x2ed6('0x34'))){_0x38c3ce['limit']=qs[_0x2ed6('0x1f')](_0x37916a[_0x2ed6('0x2f')][_0x2ed6('0x1f')]);_0x38c3ce[_0x2ed6('0x1d')]=qs[_0x2ed6('0x1d')](_0x37916a['query'][_0x2ed6('0x1d')]);}_0x38c3ce[_0x2ed6('0x35')]=qs['sort'](_0x37916a['query'][_0x2ed6('0x36')]);_0x38c3ce[_0x2ed6('0x37')]=qs[_0x2ed6('0x38')](_[_0x2ed6('0x39')](_0x37916a['query'],_0x37813f[_0x2ed6('0x38')]),_0x27411b);if(_0x37916a[_0x2ed6('0x2f')]['filter']){_0x38c3ce[_0x2ed6('0x37')]=_['merge'](_0x38c3ce[_0x2ed6('0x37')],{'$or':_[_0x2ed6('0x29')](_0x27411b,function(_0x50a41f){if(_0x50a41f[_0x2ed6('0x3a')]!=='VIRTUAL'){var _0x211397={};_0x211397[_0x50a41f[_0x2ed6('0x27')]]={'$like':'%'+_0x37916a[_0x2ed6('0x2f')]['filter']+'%'};return _0x211397;}})});}_0x38c3ce=_[_0x2ed6('0x3b')]({},_0x38c3ce,_0x37916a[_0x2ed6('0x3c')]);var _0x21e49c={'where':_0x38c3ce[_0x2ed6('0x37')]};return db[_0x2ed6('0x2a')][_0x2ed6('0x20')](_0x21e49c)[_0x2ed6('0x3d')](function(_0x5d56b9){_0x1bfead['count']=_0x5d56b9;if(_0x37916a['query'][_0x2ed6('0x3e')]){_0x38c3ce[_0x2ed6('0x3f')]=[{'all':!![]}];}return db[_0x2ed6('0x2a')][_0x2ed6('0x40')](_0x38c3ce);})['then'](function(_0x333661){_0x1bfead[_0x2ed6('0x41')]=_0x333661;return _0x1bfead;})[_0x2ed6('0x3d')](respondWithFilteredResult(_0x3982e8,_0x38c3ce))[_0x2ed6('0x42')](handleError(_0x3982e8,null));};exports[_0x2ed6('0x43')]=function(_0x49cb2f,_0x4e4ba2){var _0x20588b={'raw':!![],'where':{'id':_0x49cb2f[_0x2ed6('0x44')]['id']}},_0x3b34d7={};_0x3b34d7[_0x2ed6('0x2c')]=_['keys'](db[_0x2ed6('0x2a')]['rawAttributes']);_0x3b34d7['query']=_[_0x2ed6('0x2d')](_0x49cb2f[_0x2ed6('0x2f')]);_0x3b34d7['filters']=_[_0x2ed6('0x2e')](_0x3b34d7[_0x2ed6('0x2c')],_0x3b34d7['query']);_0x20588b[_0x2ed6('0x30')]=_[_0x2ed6('0x2e')](_0x3b34d7[_0x2ed6('0x2c')],qs[_0x2ed6('0x31')](_0x49cb2f['query'][_0x2ed6('0x31')]));_0x20588b[_0x2ed6('0x30')]=_0x20588b['attributes'][_0x2ed6('0x32')]?_0x20588b[_0x2ed6('0x30')]:_0x3b34d7[_0x2ed6('0x2c')];if(_0x49cb2f[_0x2ed6('0x2f')][_0x2ed6('0x3e')]){_0x20588b[_0x2ed6('0x3f')]=[{'all':!![]}];}_0x20588b=_[_0x2ed6('0x3b')]({},_0x20588b,_0x49cb2f[_0x2ed6('0x3c')]);return db[_0x2ed6('0x2a')]['find'](_0x20588b)[_0x2ed6('0x3d')](handleEntityNotFound(_0x4e4ba2,null))[_0x2ed6('0x3d')](respondWithResult(_0x4e4ba2,null))[_0x2ed6('0x42')](handleError(_0x4e4ba2,null));};exports[_0x2ed6('0x45')]=function(_0x21d584,_0xf77df5){return db[_0x2ed6('0x2a')][_0x2ed6('0x45')](_0x21d584[_0x2ed6('0x46')],{})[_0x2ed6('0x3d')](respondWithResult(_0xf77df5,0xc9))[_0x2ed6('0x42')](handleError(_0xf77df5,null));};exports[_0x2ed6('0x23')]=function(_0x235f70,_0x1ee421){if(_0x235f70[_0x2ed6('0x46')]['id']){delete _0x235f70[_0x2ed6('0x46')]['id'];}return db[_0x2ed6('0x2a')][_0x2ed6('0x47')]({'where':{'id':_0x235f70[_0x2ed6('0x44')]['id']}})['then'](handleEntityNotFound(_0x1ee421,null))[_0x2ed6('0x3d')](saveUpdates(_0x235f70[_0x2ed6('0x46')],null))[_0x2ed6('0x3d')](respondWithResult(_0x1ee421,null))[_0x2ed6('0x42')](handleError(_0x1ee421,null));};exports[_0x2ed6('0x24')]=function(_0x29eb4c,_0xe7d043){return db['JscriptyQuestionReport']['find']({'where':{'id':_0x29eb4c[_0x2ed6('0x44')]['id']}})['then'](handleEntityNotFound(_0xe7d043,null))['then'](removeEntity(_0xe7d043,null))['catch'](handleError(_0xe7d043,null));};exports[_0x2ed6('0x48')]=function(_0xf08bcc,_0x72d6f3){return db[_0x2ed6('0x2a')]['describe']()[_0x2ed6('0x3d')](respondWithResult(_0x72d6f3,null))['catch'](handleError(_0x72d6f3,null));}; \ No newline at end of file +var _0x5600=['count','set','apply','save','destroy','then','error','stack','name','send','map','JscriptyQuestionReport','fieldName','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','catch','show','params','rawAttributes','include','find','create','body','update','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../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'];(function(_0x8de68e,_0x56f2f1){var _0x7e4b27=function(_0x2d0c55){while(--_0x2d0c55){_0x8de68e['push'](_0x8de68e['shift']());}};_0x7e4b27(++_0x56f2f1);}(_0x5600,0x1e4));var _0x0560=function(_0x3b16e1,_0x3bda3e){_0x3b16e1=_0x3b16e1-0x0;var _0x311d1b=_0x5600[_0x3b16e1];return _0x311d1b;};'use strict';var emlformat=require(_0x0560('0x0'));var rimraf=require(_0x0560('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0560('0x2'));var rp=require(_0x0560('0x3'));var moment=require(_0x0560('0x4'));var BPromise=require(_0x0560('0x5'));var Mustache=require(_0x0560('0x6'));var util=require('util');var path=require(_0x0560('0x7'));var sox=require(_0x0560('0x8'));var csv=require(_0x0560('0x9'));var ejs=require(_0x0560('0xa'));var fs=require('fs');var fs_extra=require(_0x0560('0xb'));var _=require(_0x0560('0xc'));var squel=require(_0x0560('0xd'));var crypto=require(_0x0560('0xe'));var jsforce=require(_0x0560('0xf'));var deskjs=require(_0x0560('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0560('0x11'));var Redis=require('ioredis');var authService=require(_0x0560('0x12'));var qs=require(_0x0560('0x13'));var as=require(_0x0560('0x14'));var hardwareService=require(_0x0560('0x15'));var logger=require(_0x0560('0x16'))(_0x0560('0x17'));var utils=require(_0x0560('0x18'));var config=require(_0x0560('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x0560('0x1a'))['db'];function respondWithStatusCode(_0x1a1652,_0xa249a0){_0xa249a0=_0xa249a0||0xcc;return function(_0x480e00){if(_0x480e00){return _0x1a1652[_0x0560('0x1b')](_0xa249a0);}return _0x1a1652[_0x0560('0x1c')](_0xa249a0)[_0x0560('0x1d')]();};}function respondWithResult(_0x4ded71,_0x46d583){_0x46d583=_0x46d583||0xc8;return function(_0x43ac56){if(_0x43ac56){return _0x4ded71[_0x0560('0x1c')](_0x46d583)[_0x0560('0x1e')](_0x43ac56);}};}function respondWithFilteredResult(_0x2c90ed,_0xd6e474){return function(_0x504014){if(_0x504014){var _0x4f9d7b=typeof _0xd6e474[_0x0560('0x1f')]===_0x0560('0x20')&&typeof _0xd6e474[_0x0560('0x21')]===_0x0560('0x20');var _0x387022=_0x504014['count'];var _0x43b316=_0x4f9d7b?0x0:_0xd6e474[_0x0560('0x1f')];var _0x2271b4=_0x4f9d7b?_0x504014[_0x0560('0x22')]:_0xd6e474[_0x0560('0x1f')]+_0xd6e474['limit'];var _0x3fee35;if(_0x2271b4>=_0x387022){_0x2271b4=_0x387022;_0x3fee35=0xc8;}else{_0x3fee35=0xce;}_0x2c90ed['status'](_0x3fee35);return _0x2c90ed[_0x0560('0x23')]('Content-Range',_0x43b316+'-'+_0x2271b4+'/'+_0x387022)[_0x0560('0x1e')](_0x504014);}return null;};}function patchUpdates(_0x1622a7){return function(_0x4e7f4a){try{jsonpatch[_0x0560('0x24')](_0x4e7f4a,_0x1622a7,!![]);}catch(_0x42aed5){return BPromise['reject'](_0x42aed5);}return _0x4e7f4a[_0x0560('0x25')]();};}function saveUpdates(_0x24e6d0,_0x4721b3){return function(_0x2eadff){if(_0x2eadff){return _0x2eadff['update'](_0x24e6d0)['then'](function(_0x13d6d4){return _0x13d6d4;});}return null;};}function removeEntity(_0x2eebeb,_0x17ca15){return function(_0x39fe9f){if(_0x39fe9f){return _0x39fe9f[_0x0560('0x26')]()[_0x0560('0x27')](function(){_0x2eebeb['status'](0xcc)[_0x0560('0x1d')]();});}};}function handleEntityNotFound(_0x4557f2,_0x470065){return function(_0x2e41bc){if(!_0x2e41bc){_0x4557f2[_0x0560('0x1b')](0x194);}return _0x2e41bc;};}function handleError(_0x551a13,_0x529e2b){_0x529e2b=_0x529e2b||0x1f4;return function(_0x2bc4a3){logger[_0x0560('0x28')](_0x2bc4a3[_0x0560('0x29')]);if(_0x2bc4a3[_0x0560('0x2a')]){delete _0x2bc4a3[_0x0560('0x2a')];}_0x551a13[_0x0560('0x1c')](_0x529e2b)[_0x0560('0x2b')](_0x2bc4a3);};}exports['index']=function(_0x4ef775,_0x44358f){var _0x37c2be={},_0x380780={},_0x275033={'count':0x0,'rows':[]};var _0x2fb252=_[_0x0560('0x2c')](db[_0x0560('0x2d')]['rawAttributes'],function(_0x293e9f){return{'name':_0x293e9f[_0x0560('0x2e')],'type':_0x293e9f['type']['key']};});_0x380780[_0x0560('0x2f')]=_['map'](_0x2fb252,_0x0560('0x2a'));_0x380780[_0x0560('0x30')]=_[_0x0560('0x31')](_0x4ef775[_0x0560('0x30')]);_0x380780['filters']=_['intersection'](_0x380780[_0x0560('0x2f')],_0x380780[_0x0560('0x30')]);_0x37c2be['attributes']=_[_0x0560('0x32')](_0x380780[_0x0560('0x2f')],qs['fields'](_0x4ef775[_0x0560('0x30')][_0x0560('0x33')]));_0x37c2be['attributes']=_0x37c2be[_0x0560('0x34')][_0x0560('0x35')]?_0x37c2be['attributes']:_0x380780[_0x0560('0x2f')];if(!_0x4ef775[_0x0560('0x30')][_0x0560('0x36')]('nolimit')){_0x37c2be[_0x0560('0x21')]=qs[_0x0560('0x21')](_0x4ef775[_0x0560('0x30')][_0x0560('0x21')]);_0x37c2be[_0x0560('0x1f')]=qs['offset'](_0x4ef775['query'][_0x0560('0x1f')]);}_0x37c2be[_0x0560('0x37')]=qs[_0x0560('0x38')](_0x4ef775[_0x0560('0x30')]['sort']);_0x37c2be[_0x0560('0x39')]=qs[_0x0560('0x3a')](_[_0x0560('0x3b')](_0x4ef775['query'],_0x380780[_0x0560('0x3a')]),_0x2fb252);if(_0x4ef775[_0x0560('0x30')]['filter']){_0x37c2be[_0x0560('0x39')]=_[_0x0560('0x3c')](_0x37c2be[_0x0560('0x39')],{'$or':_['map'](_0x2fb252,function(_0x3492e0){if(_0x3492e0['type']!==_0x0560('0x3d')){var _0x33a1fc={};_0x33a1fc[_0x3492e0[_0x0560('0x2a')]]={'$like':'%'+_0x4ef775['query'][_0x0560('0x3e')]+'%'};return _0x33a1fc;}})});}_0x37c2be=_['merge']({},_0x37c2be,_0x4ef775[_0x0560('0x3f')]);var _0x5d3d14={'where':_0x37c2be['where']};return db[_0x0560('0x2d')]['count'](_0x5d3d14)[_0x0560('0x27')](function(_0x575b1e){_0x275033[_0x0560('0x22')]=_0x575b1e;if(_0x4ef775[_0x0560('0x30')][_0x0560('0x40')]){_0x37c2be['include']=[{'all':!![]}];}return db[_0x0560('0x2d')]['findAll'](_0x37c2be);})[_0x0560('0x27')](function(_0x1cc4c3){_0x275033['rows']=_0x1cc4c3;return _0x275033;})[_0x0560('0x27')](respondWithFilteredResult(_0x44358f,_0x37c2be))[_0x0560('0x41')](handleError(_0x44358f,null));};exports[_0x0560('0x42')]=function(_0x37000d,_0x1ce03b){var _0x502341={'raw':!![],'where':{'id':_0x37000d[_0x0560('0x43')]['id']}},_0x42cde7={};_0x42cde7[_0x0560('0x2f')]=_[_0x0560('0x31')](db['JscriptyQuestionReport'][_0x0560('0x44')]);_0x42cde7[_0x0560('0x30')]=_[_0x0560('0x31')](_0x37000d[_0x0560('0x30')]);_0x42cde7[_0x0560('0x3a')]=_[_0x0560('0x32')](_0x42cde7[_0x0560('0x2f')],_0x42cde7[_0x0560('0x30')]);_0x502341[_0x0560('0x34')]=_[_0x0560('0x32')](_0x42cde7['model'],qs[_0x0560('0x33')](_0x37000d['query'][_0x0560('0x33')]));_0x502341[_0x0560('0x34')]=_0x502341[_0x0560('0x34')][_0x0560('0x35')]?_0x502341['attributes']:_0x42cde7['model'];if(_0x37000d['query'][_0x0560('0x40')]){_0x502341[_0x0560('0x45')]=[{'all':!![]}];}_0x502341=_['merge']({},_0x502341,_0x37000d['options']);return db[_0x0560('0x2d')][_0x0560('0x46')](_0x502341)['then'](handleEntityNotFound(_0x1ce03b,null))[_0x0560('0x27')](respondWithResult(_0x1ce03b,null))['catch'](handleError(_0x1ce03b,null));};exports[_0x0560('0x47')]=function(_0x322e7b,_0xcf5e5a){return db['JscriptyQuestionReport'][_0x0560('0x47')](_0x322e7b[_0x0560('0x48')],{})[_0x0560('0x27')](respondWithResult(_0xcf5e5a,0xc9))[_0x0560('0x41')](handleError(_0xcf5e5a,null));};exports[_0x0560('0x49')]=function(_0x4efdc4,_0x1c881b){if(_0x4efdc4[_0x0560('0x48')]['id']){delete _0x4efdc4[_0x0560('0x48')]['id'];}return db[_0x0560('0x2d')]['find']({'where':{'id':_0x4efdc4[_0x0560('0x43')]['id']}})[_0x0560('0x27')](handleEntityNotFound(_0x1c881b,null))['then'](saveUpdates(_0x4efdc4[_0x0560('0x48')],null))[_0x0560('0x27')](respondWithResult(_0x1c881b,null))['catch'](handleError(_0x1c881b,null));};exports[_0x0560('0x26')]=function(_0x393fde,_0x12c500){return db[_0x0560('0x2d')][_0x0560('0x46')]({'where':{'id':_0x393fde[_0x0560('0x43')]['id']}})[_0x0560('0x27')](handleEntityNotFound(_0x12c500,null))[_0x0560('0x27')](removeEntity(_0x12c500,null))[_0x0560('0x41')](handleError(_0x12c500,null));};exports['describe']=function(_0x46e6bd,_0x301fe5){return db[_0x0560('0x2d')]['describe']()[_0x0560('0x27')](respondWithResult(_0x301fe5,null))[_0x0560('0x41')](handleError(_0x301fe5,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index acad0b9..c731895 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 _0xddc4=['lodash','../../config/logger','api','moment','request-promise','path','../../config/environment','exports','define'];(function(_0x15ff9e,_0x3d474c){var _0x6a5eff=function(_0xe96f18){while(--_0xe96f18){_0x15ff9e['push'](_0x15ff9e['shift']());}};_0x6a5eff(++_0x3d474c);}(_0xddc4,0x87));var _0x4ddc=function(_0x37279b,_0x41005f){_0x37279b=_0x37279b-0x0;var _0x35c254=_0xddc4[_0x37279b];return _0x35c254;};'use strict';var _=require(_0x4ddc('0x0'));var util=require('util');var logger=require(_0x4ddc('0x1'))(_0x4ddc('0x2'));var moment=require(_0x4ddc('0x3'));var BPromise=require('bluebird');var rp=require(_0x4ddc('0x4'));var fs=require('fs');var path=require(_0x4ddc('0x5'));var rimraf=require('rimraf');var config=require(_0x4ddc('0x6'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0x4ddc('0x7')]=function(_0x436be6,_0x533c90){return _0x436be6[_0x4ddc('0x8')]('JscriptyQuestionReport',attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaec7=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','util','../../config/logger'];(function(_0x14fdd7,_0x4797aa){var _0x32e1a6=function(_0x564fc1){while(--_0x564fc1){_0x14fdd7['push'](_0x14fdd7['shift']());}};_0x32e1a6(++_0x4797aa);}(_0xaec7,0x18a));var _0x7aec=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xaec7[_0x28947d];return _0x12d2ee;};'use strict';var _=require('lodash');var util=require(_0x7aec('0x0'));var logger=require(_0x7aec('0x1'))(_0x7aec('0x2'));var moment=require(_0x7aec('0x3'));var BPromise=require(_0x7aec('0x4'));var rp=require(_0x7aec('0x5'));var fs=require('fs');var path=require(_0x7aec('0x6'));var rimraf=require(_0x7aec('0x7'));var config=require(_0x7aec('0x8'));var attributes=require(_0x7aec('0x9'));module[_0x7aec('0xa')]=function(_0x3b91e6,_0x35c81e){return _0x3b91e6[_0x7aec('0xb')]('JscriptyQuestionReport',attributes,{'tableName':'report_jscripty_questions','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 32356db..b4297ae 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 _0xe787=['request\x20sent','debug','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s'];(function(_0x456608,_0x5491a6){var _0x2ca56a=function(_0x9cbc34){while(--_0x9cbc34){_0x456608['push'](_0x456608['shift']());}};_0x2ca56a(++_0x5491a6);}(_0xe787,0x1ab));var _0x7e78=function(_0x8af54b,_0x280be5){_0x8af54b=_0x8af54b-0x0;var _0x27d8f0=_0xe787[_0x8af54b];return _0x27d8f0;};'use strict';var _=require(_0x7e78('0x0'));var util=require('util');var moment=require(_0x7e78('0x1'));var BPromise=require(_0x7e78('0x2'));var rs=require(_0x7e78('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7e78('0x4'));var logger=require('../../config/logger')(_0x7e78('0x5'));var config=require(_0x7e78('0x6'));var jayson=require(_0x7e78('0x7'));var client=jayson[_0x7e78('0x8')][_0x7e78('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x50671c,_0x173f08,_0x2e8693){return new BPromise(function(_0x224977,_0x6ab6c5){return client[_0x7e78('0xa')](_0x50671c,_0x2e8693)[_0x7e78('0xb')](function(_0x3f0251){logger[_0x7e78('0xc')](_0x7e78('0xd'),_0x173f08,_0x7e78('0xe'));logger[_0x7e78('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x173f08,_0x7e78('0xe'),JSON['stringify'](_0x3f0251));if(_0x3f0251[_0x7e78('0x10')]){if(_0x3f0251['error'][_0x7e78('0x11')]===0x1f4){logger[_0x7e78('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x173f08,_0x3f0251['error'][_0x7e78('0x12')]);return _0x6ab6c5(_0x3f0251['error'][_0x7e78('0x12')]);}logger[_0x7e78('0x10')](_0x7e78('0xd'),_0x173f08,_0x3f0251[_0x7e78('0x10')][_0x7e78('0x12')]);return _0x224977(_0x3f0251[_0x7e78('0x10')][_0x7e78('0x12')]);}else{logger[_0x7e78('0xc')](_0x7e78('0xd'),_0x173f08,'request\x20sent');_0x224977(_0x3f0251[_0x7e78('0x13')][_0x7e78('0x12')]);}})[_0x7e78('0x14')](function(_0x256f9d){logger['error'](_0x7e78('0xd'),_0x173f08,_0x256f9d);_0x6ab6c5(_0x256f9d);});});} \ No newline at end of file +var _0x84fd=['../../config/logger','rpc','../../config/environment','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils'];(function(_0x4b7c15,_0x2515be){var _0xf67634=function(_0x22deb8){while(--_0x22deb8){_0x4b7c15['push'](_0x4b7c15['shift']());}};_0xf67634(++_0x2515be);}(_0x84fd,0x181));var _0xd84f=function(_0x11dc3f,_0x22b906){_0x11dc3f=_0x11dc3f-0x0;var _0x5925ee=_0x84fd[_0x11dc3f];return _0x5925ee;};'use strict';var _=require(_0xd84f('0x0'));var util=require(_0xd84f('0x1'));var moment=require(_0xd84f('0x2'));var BPromise=require('bluebird');var rs=require(_0xd84f('0x3'));var fs=require('fs');var Redis=require(_0xd84f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd84f('0x5'));var logger=require(_0xd84f('0x6'))(_0xd84f('0x7'));var config=require(_0xd84f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd84f('0x9')][_0xd84f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x313acc,_0x1b3f1b,_0x57c687){return new BPromise(function(_0x33f590,_0xa32f4e){return client[_0xd84f('0xb')](_0x313acc,_0x57c687)[_0xd84f('0xc')](function(_0x175473){logger[_0xd84f('0xd')](_0xd84f('0xe'),_0x1b3f1b,_0xd84f('0xf'));logger['debug'](_0xd84f('0x10'),_0x1b3f1b,_0xd84f('0xf'),JSON[_0xd84f('0x11')](_0x175473));if(_0x175473[_0xd84f('0x12')]){if(_0x175473['error'][_0xd84f('0x13')]===0x1f4){logger['error'](_0xd84f('0xe'),_0x1b3f1b,_0x175473[_0xd84f('0x12')][_0xd84f('0x14')]);return _0xa32f4e(_0x175473[_0xd84f('0x12')][_0xd84f('0x14')]);}logger[_0xd84f('0x12')](_0xd84f('0xe'),_0x1b3f1b,_0x175473['error']['message']);return _0x33f590(_0x175473[_0xd84f('0x12')]['message']);}else{logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x1b3f1b,'request\x20sent');_0x33f590(_0x175473[_0xd84f('0x15')][_0xd84f('0x14')]);}})[_0xd84f('0x16')](function(_0x457cd9){logger[_0xd84f('0x12')](_0xd84f('0xe'),_0x1b3f1b,_0x457cd9);_0xa32f4e(_0x457cd9);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 9d26083..ce4c9cf 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 _0x4f8f=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/questions','post','create','delete','multer','util','path'];(function(_0x1c03b8,_0x50f690){var _0x45c34b=function(_0x2761ed){while(--_0x2761ed){_0x1c03b8['push'](_0x1c03b8['shift']());}};_0x45c34b(++_0x50f690);}(_0x4f8f,0x1b6));var _0xf4f8=function(_0x2b1d86,_0x1678a3){_0x2b1d86=_0x2b1d86-0x0;var _0x5bc561=_0x4f8f[_0x2b1d86];return _0x5bc561;};'use strict';var multer=require(_0xf4f8('0x0'));var util=require(_0xf4f8('0x1'));var path=require(_0xf4f8('0x2'));var timeout=require(_0xf4f8('0x3'));var express=require(_0xf4f8('0x4'));var router=express[_0xf4f8('0x5')]();var fs_extra=require(_0xf4f8('0x6'));var auth=require(_0xf4f8('0x7'));var interaction=require(_0xf4f8('0x8'));var config=require(_0xf4f8('0x9'));var controller=require('./jscriptySessionReport.controller');router['get']('/',auth[_0xf4f8('0xa')](),controller[_0xf4f8('0xb')]);router[_0xf4f8('0xc')](_0xf4f8('0xd'),auth[_0xf4f8('0xa')](),controller[_0xf4f8('0xe')]);router[_0xf4f8('0xc')](_0xf4f8('0xf'),auth[_0xf4f8('0xa')](),controller[_0xf4f8('0x10')]);router[_0xf4f8('0xc')](_0xf4f8('0x11'),auth[_0xf4f8('0xa')](),controller['getQuestions']);router[_0xf4f8('0x12')]('/',auth[_0xf4f8('0xa')](),controller[_0xf4f8('0x13')]);router['put'](_0xf4f8('0xf'),auth['isAuthenticated'](),controller['update']);router[_0xf4f8('0x14')](_0xf4f8('0xf'),auth[_0xf4f8('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x473e=['create','put','update','delete','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','describe','/:id','show','/:id/questions','post'];(function(_0x30e7de,_0x23c5cc){var _0x4a7722=function(_0x1f6cf9){while(--_0x1f6cf9){_0x30e7de['push'](_0x30e7de['shift']());}};_0x4a7722(++_0x23c5cc);}(_0x473e,0x1a8));var _0xe473=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x473e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xe473('0x0'));var util=require('util');var path=require(_0xe473('0x1'));var timeout=require(_0xe473('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe473('0x3'));var auth=require(_0xe473('0x4'));var interaction=require(_0xe473('0x5'));var config=require(_0xe473('0x6'));var controller=require(_0xe473('0x7'));router[_0xe473('0x8')]('/',auth[_0xe473('0x9')](),controller[_0xe473('0xa')]);router[_0xe473('0x8')]('/describe',auth[_0xe473('0x9')](),controller[_0xe473('0xb')]);router[_0xe473('0x8')](_0xe473('0xc'),auth[_0xe473('0x9')](),controller[_0xe473('0xd')]);router['get'](_0xe473('0xe'),auth[_0xe473('0x9')](),controller['getQuestions']);router[_0xe473('0xf')]('/',auth[_0xe473('0x9')](),controller[_0xe473('0x10')]);router[_0xe473('0x11')]('/:id',auth[_0xe473('0x9')](),controller[_0xe473('0x12')]);router[_0xe473('0x13')]('/:id',auth[_0xe473('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 7924a76..01402bc 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 _0x7b92=['YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','exports','DATE','starttime','format'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7b92,0x1e3));var _0x27b9=function(_0xcf581b,_0x4359dd){_0xcf581b=_0xcf581b-0x0;var _0x4f454d=_0x7b92[_0xcf581b];return _0x4f454d;};'use strict';var moment=require(_0x27b9('0x0'));var Sequelize=require('sequelize');module[_0x27b9('0x1')]={'starttime':{'type':Sequelize[_0x27b9('0x2')],'set':function(_0x4e8c23){this['setDataValue'](_0x27b9('0x3'),_0x4e8c23);this['setDataValue']('endtime',moment()[_0x27b9('0x4')](_0x27b9('0x5')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x27b9('0x6')]},'projectname':{'type':Sequelize[_0x27b9('0x6')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x27b9('0x6')]},'calleridname':{'type':Sequelize[_0x27b9('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0x27b9('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0x1957=['endtime','format','STRING','moment','sequelize','exports','DATE','setDataValue'];(function(_0x2f3fba,_0x3ac8a2){var _0x32dc50=function(_0x36551b){while(--_0x36551b){_0x2f3fba['push'](_0x2f3fba['shift']());}};_0x32dc50(++_0x3ac8a2);}(_0x1957,0xeb));var _0x7195=function(_0x5eae0c,_0x36d39b){_0x5eae0c=_0x5eae0c-0x0;var _0x1695ed=_0x1957[_0x5eae0c];return _0x1695ed;};'use strict';var moment=require(_0x7195('0x0'));var Sequelize=require(_0x7195('0x1'));module[_0x7195('0x2')]={'starttime':{'type':Sequelize[_0x7195('0x3')],'set':function(_0x12d9f8){this[_0x7195('0x4')]('starttime',_0x12d9f8);this[_0x7195('0x4')](_0x7195('0x5'),moment()[_0x7195('0x6')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0x7195('0x3')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x7195('0x7')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x7195('0x7')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x7195('0x7')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 28664a6..99b8066 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 _0x9393=['ejs','fs-extra','lodash','crypto','jsforce','desk.js','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','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','options','JscriptySessionReport','includeAll','include','rows','show','params','keys','merge','find','create','body','catch','update','getQuestions','findOne','JscriptyQuestionReport','pick','SessionId','findAll','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x9393,0x1f4));var _0x3939=function(_0x5673f6,_0x4b58a3){_0x5673f6=_0x5673f6-0x0;var _0x18ac58=_0x9393[_0x5673f6];return _0x18ac58;};'use strict';var emlformat=require(_0x3939('0x0'));var rimraf=require(_0x3939('0x1'));var zipdir=require(_0x3939('0x2'));var jsonpatch=require(_0x3939('0x3'));var rp=require('request-promise');var moment=require(_0x3939('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3939('0x5'));var util=require(_0x3939('0x6'));var path=require(_0x3939('0x7'));var sox=require(_0x3939('0x8'));var csv=require(_0x3939('0x9'));var ejs=require(_0x3939('0xa'));var fs=require('fs');var fs_extra=require(_0x3939('0xb'));var _=require(_0x3939('0xc'));var squel=require('squel');var crypto=require(_0x3939('0xd'));var jsforce=require(_0x3939('0xe'));var deskjs=require(_0x3939('0xf'));var toCsv=require('to-csv');var querystring=require(_0x3939('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3939('0x11'));var qs=require(_0x3939('0x12'));var as=require(_0x3939('0x13'));var hardwareService=require(_0x3939('0x14'));var logger=require(_0x3939('0x15'))(_0x3939('0x16'));var utils=require(_0x3939('0x17'));var config=require(_0x3939('0x18'));var licenseUtil=require(_0x3939('0x19'));var db=require(_0x3939('0x1a'))['db'];function respondWithStatusCode(_0x3eb936,_0x2130c7){_0x2130c7=_0x2130c7||0xcc;return function(_0x35006f){if(_0x35006f){return _0x3eb936[_0x3939('0x1b')](_0x2130c7);}return _0x3eb936[_0x3939('0x1c')](_0x2130c7)[_0x3939('0x1d')]();};}function respondWithResult(_0xe3a2b9,_0x17cebc){_0x17cebc=_0x17cebc||0xc8;return function(_0x3f6575){if(_0x3f6575){return _0xe3a2b9[_0x3939('0x1c')](_0x17cebc)[_0x3939('0x1e')](_0x3f6575);}};}function respondWithFilteredResult(_0xe83277,_0x42b28a){return function(_0x2f2f23){if(_0x2f2f23){var _0x26edf3=typeof _0x42b28a[_0x3939('0x1f')]===_0x3939('0x20')&&typeof _0x42b28a[_0x3939('0x21')]===_0x3939('0x20');var _0x5bef9a=_0x2f2f23[_0x3939('0x22')];var _0x1a6752=_0x26edf3?0x0:_0x42b28a[_0x3939('0x1f')];var _0x1f57ae=_0x26edf3?_0x2f2f23[_0x3939('0x22')]:_0x42b28a[_0x3939('0x1f')]+_0x42b28a[_0x3939('0x21')];var _0x4b758a;if(_0x1f57ae>=_0x5bef9a){_0x1f57ae=_0x5bef9a;_0x4b758a=0xc8;}else{_0x4b758a=0xce;}_0xe83277[_0x3939('0x1c')](_0x4b758a);return _0xe83277[_0x3939('0x23')](_0x3939('0x24'),_0x1a6752+'-'+_0x1f57ae+'/'+_0x5bef9a)[_0x3939('0x1e')](_0x2f2f23);}return null;};}function patchUpdates(_0xaf319a){return function(_0x5eaa4e){try{jsonpatch[_0x3939('0x25')](_0x5eaa4e,_0xaf319a,!![]);}catch(_0x4f85f9){return BPromise[_0x3939('0x26')](_0x4f85f9);}return _0x5eaa4e[_0x3939('0x27')]();};}function saveUpdates(_0x3779e6,_0x54ec80){return function(_0x148a4a){if(_0x148a4a){return _0x148a4a['update'](_0x3779e6)[_0x3939('0x28')](function(_0x3c2b7a){return _0x3c2b7a;});}return null;};}function removeEntity(_0x1b283d,_0x4691c6){return function(_0x43f903){if(_0x43f903){return _0x43f903[_0x3939('0x29')]()[_0x3939('0x28')](function(){_0x1b283d['status'](0xcc)[_0x3939('0x1d')]();});}};}function handleEntityNotFound(_0x13758a,_0x3e81ba){return function(_0x1f5cb9){if(!_0x1f5cb9){_0x13758a[_0x3939('0x1b')](0x194);}return _0x1f5cb9;};}function handleError(_0x5ade31,_0x291ac7){_0x291ac7=_0x291ac7||0x1f4;return function(_0x1c1ce6){logger[_0x3939('0x2a')](_0x1c1ce6[_0x3939('0x2b')]);if(_0x1c1ce6[_0x3939('0x2c')]){delete _0x1c1ce6[_0x3939('0x2c')];}_0x5ade31[_0x3939('0x1c')](_0x291ac7)[_0x3939('0x2d')](_0x1c1ce6);};}exports[_0x3939('0x2e')]=function(_0x56d1ca,_0x21f13e){var _0xf489e={},_0x5e292d={},_0x91c600={'count':0x0,'rows':[]};var _0x23eaea=_[_0x3939('0x2f')](db['JscriptySessionReport'][_0x3939('0x30')],function(_0x48763a){return{'name':_0x48763a[_0x3939('0x31')],'type':_0x48763a[_0x3939('0x32')][_0x3939('0x33')]};});_0x5e292d[_0x3939('0x34')]=_[_0x3939('0x2f')](_0x23eaea,'name');_0x5e292d[_0x3939('0x35')]=_['keys'](_0x56d1ca['query']);_0x5e292d[_0x3939('0x36')]=_['intersection'](_0x5e292d[_0x3939('0x34')],_0x5e292d[_0x3939('0x35')]);_0xf489e[_0x3939('0x37')]=_[_0x3939('0x38')](_0x5e292d[_0x3939('0x34')],qs[_0x3939('0x39')](_0x56d1ca[_0x3939('0x35')][_0x3939('0x39')]));_0xf489e['attributes']=_0xf489e[_0x3939('0x37')][_0x3939('0x3a')]?_0xf489e['attributes']:_0x5e292d['model'];if(!_0x56d1ca[_0x3939('0x35')][_0x3939('0x3b')](_0x3939('0x3c'))){_0xf489e[_0x3939('0x21')]=qs[_0x3939('0x21')](_0x56d1ca[_0x3939('0x35')][_0x3939('0x21')]);_0xf489e['offset']=qs['offset'](_0x56d1ca[_0x3939('0x35')][_0x3939('0x1f')]);}_0xf489e[_0x3939('0x3d')]=qs[_0x3939('0x3e')](_0x56d1ca['query'][_0x3939('0x3e')]);_0xf489e[_0x3939('0x3f')]=qs[_0x3939('0x36')](_['pick'](_0x56d1ca['query'],_0x5e292d[_0x3939('0x36')]),_0x23eaea);if(_0x56d1ca[_0x3939('0x35')][_0x3939('0x40')]){_0xf489e['where']=_['merge'](_0xf489e[_0x3939('0x3f')],{'$or':_['map'](_0x23eaea,function(_0x565c01){if(_0x565c01[_0x3939('0x32')]!=='VIRTUAL'){var _0x2b6845={};_0x2b6845[_0x565c01[_0x3939('0x2c')]]={'$like':'%'+_0x56d1ca[_0x3939('0x35')][_0x3939('0x40')]+'%'};return _0x2b6845;}})});}_0xf489e=_['merge']({},_0xf489e,_0x56d1ca[_0x3939('0x41')]);var _0x195565={'where':_0xf489e['where']};return db[_0x3939('0x42')][_0x3939('0x22')](_0x195565)['then'](function(_0x4bb882){_0x91c600[_0x3939('0x22')]=_0x4bb882;if(_0x56d1ca['query'][_0x3939('0x43')]){_0xf489e[_0x3939('0x44')]=[{'all':!![]}];}return db[_0x3939('0x42')]['findAll'](_0xf489e);})['then'](function(_0x502de2){_0x91c600[_0x3939('0x45')]=_0x502de2;return _0x91c600;})[_0x3939('0x28')](respondWithFilteredResult(_0x21f13e,_0xf489e))['catch'](handleError(_0x21f13e,null));};exports[_0x3939('0x46')]=function(_0x354f89,_0x1924d4){var _0x5db905={'raw':!![],'where':{'id':_0x354f89[_0x3939('0x47')]['id']}},_0xcdda23={};_0xcdda23[_0x3939('0x34')]=_[_0x3939('0x48')](db['JscriptySessionReport']['rawAttributes']);_0xcdda23['query']=_[_0x3939('0x48')](_0x354f89[_0x3939('0x35')]);_0xcdda23[_0x3939('0x36')]=_[_0x3939('0x38')](_0xcdda23[_0x3939('0x34')],_0xcdda23[_0x3939('0x35')]);_0x5db905[_0x3939('0x37')]=_[_0x3939('0x38')](_0xcdda23['model'],qs[_0x3939('0x39')](_0x354f89['query']['fields']));_0x5db905[_0x3939('0x37')]=_0x5db905['attributes'][_0x3939('0x3a')]?_0x5db905[_0x3939('0x37')]:_0xcdda23[_0x3939('0x34')];if(_0x354f89[_0x3939('0x35')][_0x3939('0x43')]){_0x5db905[_0x3939('0x44')]=[{'all':!![]}];}_0x5db905=_[_0x3939('0x49')]({},_0x5db905,_0x354f89['options']);return db[_0x3939('0x42')][_0x3939('0x4a')](_0x5db905)['then'](handleEntityNotFound(_0x1924d4,null))['then'](respondWithResult(_0x1924d4,null))['catch'](handleError(_0x1924d4,null));};exports[_0x3939('0x4b')]=function(_0x2829c0,_0x16ae27){return db[_0x3939('0x42')][_0x3939('0x4b')](_0x2829c0[_0x3939('0x4c')],{})[_0x3939('0x28')](respondWithResult(_0x16ae27,0xc9))[_0x3939('0x4d')](handleError(_0x16ae27,null));};exports[_0x3939('0x4e')]=function(_0x55181f,_0x1a6b39){if(_0x55181f[_0x3939('0x4c')]['id']){delete _0x55181f[_0x3939('0x4c')]['id'];}return db[_0x3939('0x42')][_0x3939('0x4a')]({'where':{'id':_0x55181f[_0x3939('0x47')]['id']}})['then'](handleEntityNotFound(_0x1a6b39,null))['then'](saveUpdates(_0x55181f[_0x3939('0x4c')],null))[_0x3939('0x28')](respondWithResult(_0x1a6b39,null))[_0x3939('0x4d')](handleError(_0x1a6b39,null));};exports[_0x3939('0x29')]=function(_0x46cb8d,_0x35a3fc){return db[_0x3939('0x42')][_0x3939('0x4a')]({'where':{'id':_0x46cb8d[_0x3939('0x47')]['id']}})[_0x3939('0x28')](handleEntityNotFound(_0x35a3fc,null))['then'](removeEntity(_0x35a3fc,null))[_0x3939('0x4d')](handleError(_0x35a3fc,null));};exports['describe']=function(_0x7d9b14,_0xcac556){return db[_0x3939('0x42')]['describe']()[_0x3939('0x28')](respondWithResult(_0xcac556,null))[_0x3939('0x4d')](handleError(_0xcac556,null));};exports[_0x3939('0x4f')]=function(_0x380fc,_0x10a82d,_0x5bd28c){var _0x4a3ffd={'raw':!![],'where':{}};var _0xf90fdb={};var _0x193014={'count':0x0,'rows':[]};return db[_0x3939('0x42')][_0x3939('0x50')]({'where':{'id':_0x380fc[_0x3939('0x47')]['id']}})[_0x3939('0x28')](handleEntityNotFound(_0x10a82d,null))['then'](function(_0x421e9e){if(_0x421e9e){_0xf90fdb[_0x3939('0x34')]=_[_0x3939('0x48')](db[_0x3939('0x51')][_0x3939('0x30')]);_0xf90fdb[_0x3939('0x35')]=_[_0x3939('0x48')](_0x380fc[_0x3939('0x35')]);_0xf90fdb[_0x3939('0x36')]=_['intersection'](_0xf90fdb[_0x3939('0x34')],_0xf90fdb[_0x3939('0x35')]);_0x4a3ffd[_0x3939('0x37')]=_['intersection'](_0xf90fdb[_0x3939('0x34')],qs[_0x3939('0x39')](_0x380fc[_0x3939('0x35')]['fields']));_0x4a3ffd[_0x3939('0x37')]=_0x4a3ffd[_0x3939('0x37')][_0x3939('0x3a')]?_0x4a3ffd['attributes']:_0xf90fdb['model'];if(!_0x380fc[_0x3939('0x35')][_0x3939('0x3b')](_0x3939('0x3c'))){_0x4a3ffd[_0x3939('0x21')]=qs['limit'](_0x380fc[_0x3939('0x35')][_0x3939('0x21')]);_0x4a3ffd['offset']=qs['offset'](_0x380fc[_0x3939('0x35')][_0x3939('0x1f')]);}_0x4a3ffd[_0x3939('0x3d')]=qs['sort'](_0x380fc[_0x3939('0x35')]['sort']);_0x4a3ffd[_0x3939('0x3f')]=qs[_0x3939('0x36')](_[_0x3939('0x52')](_0x380fc['query'],_0xf90fdb['filters']));_0x4a3ffd[_0x3939('0x3f')][_0x3939('0x53')]=_0x421e9e['id'];if(_0x380fc[_0x3939('0x35')]['filter']){_0x4a3ffd['where']=_[_0x3939('0x49')](_0x4a3ffd[_0x3939('0x3f')],{'$or':_[_0x3939('0x2f')](_0x4a3ffd[_0x3939('0x37')],function(_0x46ce03){var _0x49b7d6={};_0x49b7d6[_0x46ce03]={'$like':'%'+_0x380fc['query'][_0x3939('0x40')]+'%'};return _0x49b7d6;})});}_0x4a3ffd=_[_0x3939('0x49')]({},_0x4a3ffd,_0x380fc[_0x3939('0x41')]);return db[_0x3939('0x51')][_0x3939('0x22')]({'where':_0x4a3ffd[_0x3939('0x3f')]})[_0x3939('0x28')](function(_0xcfd4ae){_0x193014[_0x3939('0x22')]=_0xcfd4ae;if(_0x380fc['query'][_0x3939('0x43')]){_0x4a3ffd[_0x3939('0x44')]=[{'all':!![]}];}return db[_0x3939('0x51')][_0x3939('0x54')](_0x4a3ffd);})[_0x3939('0x28')](function(_0x5c8fe9){_0x193014['rows']=_0x5c8fe9;return _0x193014;});}})[_0x3939('0x28')](respondWithFilteredResult(_0x10a82d,_0x4a3ffd))[_0x3939('0x4d')](handleError(_0x10a82d,null));}; \ No newline at end of file +var _0x0c21=['catch','show','create','body','find','params','describe','getQuestions','findOne','JscriptyQuestionReport','SessionId','rows','eml-format','rimraf','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/qs','../../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','save','update','then','destroy','sendStatus','error','stack','send','index','map','rawAttributes','fieldName','type','key','model','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','options','includeAll','include','JscriptySessionReport','findAll'];(function(_0x1519a7,_0x39b0ce){var _0x4c4d55=function(_0x1f9aa8){while(--_0x1f9aa8){_0x1519a7['push'](_0x1519a7['shift']());}};_0x4c4d55(++_0x39b0ce);}(_0x0c21,0x16c));var _0x10c2=function(_0x2ba98a,_0x518a29){_0x2ba98a=_0x2ba98a-0x0;var _0x4538ce=_0x0c21[_0x2ba98a];return _0x4538ce;};'use strict';var emlformat=require(_0x10c2('0x0'));var rimraf=require(_0x10c2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x10c2('0x2'));var rp=require(_0x10c2('0x3'));var moment=require(_0x10c2('0x4'));var BPromise=require(_0x10c2('0x5'));var Mustache=require(_0x10c2('0x6'));var util=require(_0x10c2('0x7'));var path=require(_0x10c2('0x8'));var sox=require('sox');var csv=require(_0x10c2('0x9'));var ejs=require(_0x10c2('0xa'));var fs=require('fs');var fs_extra=require(_0x10c2('0xb'));var _=require(_0x10c2('0xc'));var squel=require(_0x10c2('0xd'));var crypto=require(_0x10c2('0xe'));var jsforce=require(_0x10c2('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x10c2('0x9'));var querystring=require(_0x10c2('0x10'));var Papa=require(_0x10c2('0x11'));var Redis=require(_0x10c2('0x12'));var authService=require(_0x10c2('0x13'));var qs=require(_0x10c2('0x14'));var as=require(_0x10c2('0x15'));var hardwareService=require(_0x10c2('0x16'));var logger=require(_0x10c2('0x17'))(_0x10c2('0x18'));var utils=require(_0x10c2('0x19'));var config=require(_0x10c2('0x1a'));var licenseUtil=require(_0x10c2('0x1b'));var db=require(_0x10c2('0x1c'))['db'];function respondWithStatusCode(_0xdc119c,_0x1ce7db){_0x1ce7db=_0x1ce7db||0xcc;return function(_0xc68f84){if(_0xc68f84){return _0xdc119c['sendStatus'](_0x1ce7db);}return _0xdc119c[_0x10c2('0x1d')](_0x1ce7db)[_0x10c2('0x1e')]();};}function respondWithResult(_0x42ca79,_0x434760){_0x434760=_0x434760||0xc8;return function(_0x4cbc74){if(_0x4cbc74){return _0x42ca79[_0x10c2('0x1d')](_0x434760)[_0x10c2('0x1f')](_0x4cbc74);}};}function respondWithFilteredResult(_0x591f4b,_0x502ceb){return function(_0x1f7400){if(_0x1f7400){var _0xfe64d5=typeof _0x502ceb[_0x10c2('0x20')]===_0x10c2('0x21')&&typeof _0x502ceb[_0x10c2('0x22')]==='undefined';var _0x22c0c2=_0x1f7400[_0x10c2('0x23')];var _0x3a3e07=_0xfe64d5?0x0:_0x502ceb[_0x10c2('0x20')];var _0x1e795b=_0xfe64d5?_0x1f7400[_0x10c2('0x23')]:_0x502ceb[_0x10c2('0x20')]+_0x502ceb[_0x10c2('0x22')];var _0xadfc37;if(_0x1e795b>=_0x22c0c2){_0x1e795b=_0x22c0c2;_0xadfc37=0xc8;}else{_0xadfc37=0xce;}_0x591f4b[_0x10c2('0x1d')](_0xadfc37);return _0x591f4b[_0x10c2('0x24')](_0x10c2('0x25'),_0x3a3e07+'-'+_0x1e795b+'/'+_0x22c0c2)[_0x10c2('0x1f')](_0x1f7400);}return null;};}function patchUpdates(_0x101798){return function(_0x358848){try{jsonpatch[_0x10c2('0x26')](_0x358848,_0x101798,!![]);}catch(_0x1e7799){return BPromise['reject'](_0x1e7799);}return _0x358848[_0x10c2('0x27')]();};}function saveUpdates(_0x23a86e,_0x1be908){return function(_0x429c44){if(_0x429c44){return _0x429c44[_0x10c2('0x28')](_0x23a86e)[_0x10c2('0x29')](function(_0x3a424f){return _0x3a424f;});}return null;};}function removeEntity(_0x505cb7,_0x234f15){return function(_0x491365){if(_0x491365){return _0x491365[_0x10c2('0x2a')]()[_0x10c2('0x29')](function(){_0x505cb7[_0x10c2('0x1d')](0xcc)[_0x10c2('0x1e')]();});}};}function handleEntityNotFound(_0x3067d0,_0x346f83){return function(_0x1eec25){if(!_0x1eec25){_0x3067d0[_0x10c2('0x2b')](0x194);}return _0x1eec25;};}function handleError(_0x26f5de,_0x513799){_0x513799=_0x513799||0x1f4;return function(_0x114978){logger[_0x10c2('0x2c')](_0x114978[_0x10c2('0x2d')]);if(_0x114978['name']){delete _0x114978['name'];}_0x26f5de[_0x10c2('0x1d')](_0x513799)[_0x10c2('0x2e')](_0x114978);};}exports[_0x10c2('0x2f')]=function(_0x5462a3,_0x34d88b){var _0xacf8d6={},_0x33f32b={},_0x5489a2={'count':0x0,'rows':[]};var _0x50af98=_[_0x10c2('0x30')](db['JscriptySessionReport'][_0x10c2('0x31')],function(_0x432a82){return{'name':_0x432a82[_0x10c2('0x32')],'type':_0x432a82[_0x10c2('0x33')][_0x10c2('0x34')]};});_0x33f32b[_0x10c2('0x35')]=_[_0x10c2('0x30')](_0x50af98,_0x10c2('0x36'));_0x33f32b['query']=_[_0x10c2('0x37')](_0x5462a3[_0x10c2('0x38')]);_0x33f32b[_0x10c2('0x39')]=_[_0x10c2('0x3a')](_0x33f32b[_0x10c2('0x35')],_0x33f32b[_0x10c2('0x38')]);_0xacf8d6[_0x10c2('0x3b')]=_['intersection'](_0x33f32b['model'],qs[_0x10c2('0x3c')](_0x5462a3[_0x10c2('0x38')]['fields']));_0xacf8d6['attributes']=_0xacf8d6[_0x10c2('0x3b')][_0x10c2('0x3d')]?_0xacf8d6[_0x10c2('0x3b')]:_0x33f32b['model'];if(!_0x5462a3[_0x10c2('0x38')][_0x10c2('0x3e')](_0x10c2('0x3f'))){_0xacf8d6[_0x10c2('0x22')]=qs['limit'](_0x5462a3[_0x10c2('0x38')][_0x10c2('0x22')]);_0xacf8d6[_0x10c2('0x20')]=qs[_0x10c2('0x20')](_0x5462a3[_0x10c2('0x38')][_0x10c2('0x20')]);}_0xacf8d6[_0x10c2('0x40')]=qs[_0x10c2('0x41')](_0x5462a3['query'][_0x10c2('0x41')]);_0xacf8d6['where']=qs[_0x10c2('0x39')](_[_0x10c2('0x42')](_0x5462a3[_0x10c2('0x38')],_0x33f32b[_0x10c2('0x39')]),_0x50af98);if(_0x5462a3[_0x10c2('0x38')]['filter']){_0xacf8d6['where']=_[_0x10c2('0x43')](_0xacf8d6[_0x10c2('0x44')],{'$or':_[_0x10c2('0x30')](_0x50af98,function(_0x11fdf1){if(_0x11fdf1['type']!==_0x10c2('0x45')){var _0x171db3={};_0x171db3[_0x11fdf1[_0x10c2('0x36')]]={'$like':'%'+_0x5462a3[_0x10c2('0x38')][_0x10c2('0x46')]+'%'};return _0x171db3;}})});}_0xacf8d6=_[_0x10c2('0x43')]({},_0xacf8d6,_0x5462a3[_0x10c2('0x47')]);var _0x4a2fdb={'where':_0xacf8d6[_0x10c2('0x44')]};return db['JscriptySessionReport'][_0x10c2('0x23')](_0x4a2fdb)[_0x10c2('0x29')](function(_0x2db66e){_0x5489a2[_0x10c2('0x23')]=_0x2db66e;if(_0x5462a3['query'][_0x10c2('0x48')]){_0xacf8d6[_0x10c2('0x49')]=[{'all':!![]}];}return db[_0x10c2('0x4a')][_0x10c2('0x4b')](_0xacf8d6);})[_0x10c2('0x29')](function(_0x56bcbf){_0x5489a2['rows']=_0x56bcbf;return _0x5489a2;})[_0x10c2('0x29')](respondWithFilteredResult(_0x34d88b,_0xacf8d6))[_0x10c2('0x4c')](handleError(_0x34d88b,null));};exports[_0x10c2('0x4d')]=function(_0x563ebd,_0x52c1ce){var _0x4bdb6a={'raw':!![],'where':{'id':_0x563ebd['params']['id']}},_0x157fc9={};_0x157fc9[_0x10c2('0x35')]=_[_0x10c2('0x37')](db[_0x10c2('0x4a')][_0x10c2('0x31')]);_0x157fc9[_0x10c2('0x38')]=_[_0x10c2('0x37')](_0x563ebd[_0x10c2('0x38')]);_0x157fc9[_0x10c2('0x39')]=_[_0x10c2('0x3a')](_0x157fc9[_0x10c2('0x35')],_0x157fc9[_0x10c2('0x38')]);_0x4bdb6a[_0x10c2('0x3b')]=_['intersection'](_0x157fc9[_0x10c2('0x35')],qs[_0x10c2('0x3c')](_0x563ebd[_0x10c2('0x38')][_0x10c2('0x3c')]));_0x4bdb6a[_0x10c2('0x3b')]=_0x4bdb6a[_0x10c2('0x3b')]['length']?_0x4bdb6a[_0x10c2('0x3b')]:_0x157fc9[_0x10c2('0x35')];if(_0x563ebd['query']['includeAll']){_0x4bdb6a[_0x10c2('0x49')]=[{'all':!![]}];}_0x4bdb6a=_[_0x10c2('0x43')]({},_0x4bdb6a,_0x563ebd['options']);return db[_0x10c2('0x4a')]['find'](_0x4bdb6a)[_0x10c2('0x29')](handleEntityNotFound(_0x52c1ce,null))[_0x10c2('0x29')](respondWithResult(_0x52c1ce,null))[_0x10c2('0x4c')](handleError(_0x52c1ce,null));};exports['create']=function(_0x5754e6,_0x1e1e90){return db[_0x10c2('0x4a')][_0x10c2('0x4e')](_0x5754e6[_0x10c2('0x4f')],{})[_0x10c2('0x29')](respondWithResult(_0x1e1e90,0xc9))['catch'](handleError(_0x1e1e90,null));};exports['update']=function(_0x3045ed,_0x25ae32){if(_0x3045ed['body']['id']){delete _0x3045ed[_0x10c2('0x4f')]['id'];}return db['JscriptySessionReport'][_0x10c2('0x50')]({'where':{'id':_0x3045ed[_0x10c2('0x51')]['id']}})[_0x10c2('0x29')](handleEntityNotFound(_0x25ae32,null))[_0x10c2('0x29')](saveUpdates(_0x3045ed[_0x10c2('0x4f')],null))[_0x10c2('0x29')](respondWithResult(_0x25ae32,null))[_0x10c2('0x4c')](handleError(_0x25ae32,null));};exports[_0x10c2('0x2a')]=function(_0x2adbf9,_0x4ab730){return db[_0x10c2('0x4a')][_0x10c2('0x50')]({'where':{'id':_0x2adbf9['params']['id']}})['then'](handleEntityNotFound(_0x4ab730,null))[_0x10c2('0x29')](removeEntity(_0x4ab730,null))[_0x10c2('0x4c')](handleError(_0x4ab730,null));};exports[_0x10c2('0x52')]=function(_0x182942,_0x38f62b){return db[_0x10c2('0x4a')][_0x10c2('0x52')]()['then'](respondWithResult(_0x38f62b,null))[_0x10c2('0x4c')](handleError(_0x38f62b,null));};exports[_0x10c2('0x53')]=function(_0x9248d,_0xfa2fad,_0x378c6a){var _0x38849f={'raw':!![],'where':{}};var _0x3dda93={};var _0x545c69={'count':0x0,'rows':[]};return db[_0x10c2('0x4a')][_0x10c2('0x54')]({'where':{'id':_0x9248d[_0x10c2('0x51')]['id']}})[_0x10c2('0x29')](handleEntityNotFound(_0xfa2fad,null))[_0x10c2('0x29')](function(_0x25b3e8){if(_0x25b3e8){_0x3dda93[_0x10c2('0x35')]=_['keys'](db[_0x10c2('0x55')][_0x10c2('0x31')]);_0x3dda93[_0x10c2('0x38')]=_['keys'](_0x9248d['query']);_0x3dda93[_0x10c2('0x39')]=_[_0x10c2('0x3a')](_0x3dda93[_0x10c2('0x35')],_0x3dda93[_0x10c2('0x38')]);_0x38849f[_0x10c2('0x3b')]=_[_0x10c2('0x3a')](_0x3dda93[_0x10c2('0x35')],qs[_0x10c2('0x3c')](_0x9248d[_0x10c2('0x38')][_0x10c2('0x3c')]));_0x38849f[_0x10c2('0x3b')]=_0x38849f['attributes']['length']?_0x38849f[_0x10c2('0x3b')]:_0x3dda93[_0x10c2('0x35')];if(!_0x9248d['query'][_0x10c2('0x3e')](_0x10c2('0x3f'))){_0x38849f['limit']=qs[_0x10c2('0x22')](_0x9248d[_0x10c2('0x38')][_0x10c2('0x22')]);_0x38849f[_0x10c2('0x20')]=qs['offset'](_0x9248d['query']['offset']);}_0x38849f[_0x10c2('0x40')]=qs['sort'](_0x9248d[_0x10c2('0x38')][_0x10c2('0x41')]);_0x38849f[_0x10c2('0x44')]=qs[_0x10c2('0x39')](_[_0x10c2('0x42')](_0x9248d[_0x10c2('0x38')],_0x3dda93['filters']));_0x38849f[_0x10c2('0x44')][_0x10c2('0x56')]=_0x25b3e8['id'];if(_0x9248d[_0x10c2('0x38')][_0x10c2('0x46')]){_0x38849f[_0x10c2('0x44')]=_[_0x10c2('0x43')](_0x38849f[_0x10c2('0x44')],{'$or':_[_0x10c2('0x30')](_0x38849f[_0x10c2('0x3b')],function(_0x330aa2){var _0x44b644={};_0x44b644[_0x330aa2]={'$like':'%'+_0x9248d[_0x10c2('0x38')][_0x10c2('0x46')]+'%'};return _0x44b644;})});}_0x38849f=_['merge']({},_0x38849f,_0x9248d[_0x10c2('0x47')]);return db[_0x10c2('0x55')][_0x10c2('0x23')]({'where':_0x38849f[_0x10c2('0x44')]})['then'](function(_0x6a2e9){_0x545c69[_0x10c2('0x23')]=_0x6a2e9;if(_0x9248d[_0x10c2('0x38')][_0x10c2('0x48')]){_0x38849f[_0x10c2('0x49')]=[{'all':!![]}];}return db[_0x10c2('0x55')][_0x10c2('0x4b')](_0x38849f);})[_0x10c2('0x29')](function(_0x5e4350){_0x545c69[_0x10c2('0x57')]=_0x5e4350;return _0x545c69;});}})['then'](respondWithFilteredResult(_0xfa2fad,_0x38849f))[_0x10c2('0x4c')](handleError(_0xfa2fad,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index aaebb99..a47371d 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 _0x7fbe=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x1c2e29,_0x3ad48a){_0x1c2e29=_0x1c2e29-0x0;var _0x39174d=_0x7fbe[_0x1c2e29];return _0x39174d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe7fb('0x0'))(_0xe7fb('0x1'));var moment=require(_0xe7fb('0x2'));var BPromise=require(_0xe7fb('0x3'));var rp=require(_0xe7fb('0x4'));var fs=require('fs');var path=require(_0xe7fb('0x5'));var rimraf=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var attributes=require(_0xe7fb('0x8'));module[_0xe7fb('0x9')]=function(_0x290172,_0x12d1b0){return _0x290172[_0xe7fb('0xa')](_0xe7fb('0xb'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x90b1=['define','JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x346f58,_0x7e06e8){var _0x30f777=function(_0x44a9bb){while(--_0x44a9bb){_0x346f58['push'](_0x346f58['shift']());}};_0x30f777(++_0x7e06e8);}(_0x90b1,0x1bb));var _0x190b=function(_0x2c8bf6,_0x56eab8){_0x2c8bf6=_0x2c8bf6-0x0;var _0x11efa8=_0x90b1[_0x2c8bf6];return _0x11efa8;};'use strict';var _=require(_0x190b('0x0'));var util=require(_0x190b('0x1'));var logger=require(_0x190b('0x2'))('api');var moment=require('moment');var BPromise=require(_0x190b('0x3'));var rp=require(_0x190b('0x4'));var fs=require('fs');var path=require(_0x190b('0x5'));var rimraf=require(_0x190b('0x6'));var config=require('../../config/environment');var attributes=require('./jscriptySessionReport.attributes');module['exports']=function(_0x5da9c1,_0x27ff8c){return _0x5da9c1[_0x190b('0x7')](_0x190b('0x8'),attributes,{'tableName':_0x190b('0x9'),'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 d171e52..d5cf05c 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 _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x507330,_0x567a70){var _0x2229ab=function(_0x4bdcf9){while(--_0x4bdcf9){_0x507330['push'](_0x507330['shift']());}};_0x2229ab(++_0x567a70);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x5f66[_0x4243a3];return _0x1b2a33;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('JscriptySessionReport,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});} \ No newline at end of file +var _0xbbbc=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','debug','request\x20sent','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x2ace72,_0x814809){var _0x33d102=function(_0x505fd1){while(--_0x505fd1){_0x2ace72['push'](_0x2ace72['shift']());}};_0x33d102(++_0x814809);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x506002,_0x17ad62){_0x506002=_0x506002-0x0;var _0x5a020c=_0xbbbc[_0x506002];return _0x5a020c;};'use strict';var _=require(_0xcbbb('0x0'));var util=require(_0xcbbb('0x1'));var moment=require(_0xcbbb('0x2'));var BPromise=require(_0xcbbb('0x3'));var rs=require(_0xcbbb('0x4'));var fs=require('fs');var Redis=require(_0xcbbb('0x5'));var db=require(_0xcbbb('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xcbbb('0x7'))(_0xcbbb('0x8'));var config=require(_0xcbbb('0x9'));var jayson=require(_0xcbbb('0xa'));var client=jayson[_0xcbbb('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x388197,_0x1796b4,_0x32ec9c){return new BPromise(function(_0x6f4fd8,_0x356249){return client[_0xcbbb('0xc')](_0x388197,_0x32ec9c)[_0xcbbb('0xd')](function(_0x4ec90a){logger[_0xcbbb('0xe')]('JscriptySessionReport,\x20%s,\x20%s',_0x1796b4,'request\x20sent');logger[_0xcbbb('0xf')]('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x1796b4,_0xcbbb('0x10'),JSON['stringify'](_0x4ec90a));if(_0x4ec90a[_0xcbbb('0x11')]){if(_0x4ec90a[_0xcbbb('0x11')]['code']===0x1f4){logger[_0xcbbb('0x11')]('JscriptySessionReport,\x20%s,\x20%s',_0x1796b4,_0x4ec90a[_0xcbbb('0x11')]['message']);return _0x356249(_0x4ec90a[_0xcbbb('0x11')][_0xcbbb('0x12')]);}logger[_0xcbbb('0x11')]('JscriptySessionReport,\x20%s,\x20%s',_0x1796b4,_0x4ec90a[_0xcbbb('0x11')][_0xcbbb('0x12')]);return _0x6f4fd8(_0x4ec90a[_0xcbbb('0x11')][_0xcbbb('0x12')]);}else{logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x1796b4,_0xcbbb('0x10'));_0x6f4fd8(_0x4ec90a[_0xcbbb('0x13')][_0xcbbb('0x12')]);}})[_0xcbbb('0x14')](function(_0x5e25ca){logger[_0xcbbb('0x11')]('JscriptySessionReport,\x20%s,\x20%s',_0x1796b4,_0x5e25ca);_0x356249(_0x5e25ca);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index ad07871..7236592 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 _0x87f7=['../../components/interaction/service','../../config/environment','./license.controller','index','put','/:id','isAuthenticated','update','get','/download_log_file','downloadLogFile','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x6cfbf6,_0x594cf1){var _0x537202=function(_0x1eac35){while(--_0x1eac35){_0x6cfbf6['push'](_0x6cfbf6['shift']());}};_0x537202(++_0x594cf1);}(_0x87f7,0xca));var _0x787f=function(_0x26c03d,_0x277560){_0x26c03d=_0x26c03d-0x0;var _0x31e19e=_0x87f7[_0x26c03d];return _0x31e19e;};'use strict';var multer=require(_0x787f('0x0'));var util=require(_0x787f('0x1'));var path=require(_0x787f('0x2'));var timeout=require('connect-timeout');var express=require(_0x787f('0x3'));var router=express[_0x787f('0x4')]();var fs_extra=require(_0x787f('0x5'));var auth=require(_0x787f('0x6'));var interaction=require(_0x787f('0x7'));var config=require(_0x787f('0x8'));var controller=require(_0x787f('0x9'));router['get']('/',controller[_0x787f('0xa')]);router[_0x787f('0xb')](_0x787f('0xc'),auth[_0x787f('0xd')](),controller[_0x787f('0xe')]);router[_0x787f('0xf')](_0x787f('0x10'),auth[_0x787f('0xd')](),controller[_0x787f('0x11')]);module[_0x787f('0x12')]=router; \ No newline at end of file +var _0x33ee=['../../config/environment','./license.controller','get','index','put','/:id','update','/download_log_file','isAuthenticated','downloadLogFile','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2d635a,_0x4f033c){var _0x447d3a=function(_0x36da7d){while(--_0x36da7d){_0x2d635a['push'](_0x2d635a['shift']());}};_0x447d3a(++_0x4f033c);}(_0x33ee,0x1f1));var _0xe33e=function(_0x382a62,_0x1baa5e){_0x382a62=_0x382a62-0x0;var _0x490a25=_0x33ee[_0x382a62];return _0x490a25;};'use strict';var multer=require(_0xe33e('0x0'));var util=require('util');var path=require(_0xe33e('0x1'));var timeout=require('connect-timeout');var express=require(_0xe33e('0x2'));var router=express[_0xe33e('0x3')]();var fs_extra=require(_0xe33e('0x4'));var auth=require(_0xe33e('0x5'));var interaction=require(_0xe33e('0x6'));var config=require(_0xe33e('0x7'));var controller=require(_0xe33e('0x8'));router[_0xe33e('0x9')]('/',controller[_0xe33e('0xa')]);router[_0xe33e('0xb')](_0xe33e('0xc'),auth['isAuthenticated'](),controller[_0xe33e('0xd')]);router[_0xe33e('0x9')](_0xe33e('0xe'),auth[_0xe33e('0xf')](),controller[_0xe33e('0x10')]);module[_0xe33e('0x11')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index ae65565..f3cfefc 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 _0x0671=['INTEGER','sequelize','exports','TEXT','STRING'];(function(_0x2b8388,_0x246b8f){var _0x3ba12a=function(_0x848995){while(--_0x848995){_0x2b8388['push'](_0x2b8388['shift']());}};_0x3ba12a(++_0x246b8f);}(_0x0671,0xf1));var _0x1067=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0x0671[_0x3c2a69];return _0x596bc8;};'use strict';var Sequelize=require(_0x1067('0x0'));module[_0x1067('0x1')]={'license':{'type':Sequelize[_0x1067('0x2')]},'data1':{'type':Sequelize[_0x1067('0x3')]},'data2':{'type':Sequelize[_0x1067('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x1067('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7abf=['STRING','sequelize','exports'];(function(_0x213f46,_0x3d0809){var _0x177c27=function(_0x3c2d26){while(--_0x3c2d26){_0x213f46['push'](_0x213f46['shift']());}};_0x177c27(++_0x3d0809);}(_0x7abf,0x73));var _0xf7ab=function(_0x2c3514,_0x5604d4){_0x2c3514=_0x2c3514-0x0;var _0x22ab07=_0x7abf[_0x2c3514];return _0x22ab07;};'use strict';var Sequelize=require(_0xf7ab('0x0'));module[_0xf7ab('0x1')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0xf7ab('0x2')]},'data2':{'type':Sequelize[_0xf7ab('0x2')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'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 2e39156..e212236 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 _0x2272=['error','stack','name','send','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','merge','options','catch','body','License','find','then','get','checkLicense','key','demo','downloadLogFile','license-info.log','join','/var','log','xcally','setHeader','Content-disposition','attachment;\x20filename=','text/plain','download','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','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','end','json','offset','count','limit','set','Content-Range','apply','reject','save','update','destroy'];(function(_0x21bf07,_0x3c89ba){var _0x2bfb7b=function(_0x5296cd){while(--_0x5296cd){_0x21bf07['push'](_0x21bf07['shift']());}};_0x2bfb7b(++_0x3c89ba);}(_0x2272,0x104));var _0x2227=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2272[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2227('0x0'));var zipdir=require(_0x2227('0x1'));var jsonpatch=require(_0x2227('0x2'));var rp=require(_0x2227('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2227('0x4'));var util=require('util');var path=require(_0x2227('0x5'));var sox=require(_0x2227('0x6'));var csv=require(_0x2227('0x7'));var ejs=require(_0x2227('0x8'));var fs=require('fs');var fs_extra=require(_0x2227('0x9'));var _=require(_0x2227('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2227('0xb'));var deskjs=require(_0x2227('0xc'));var toCsv=require('to-csv');var querystring=require(_0x2227('0xd'));var Papa=require(_0x2227('0xe'));var Redis=require(_0x2227('0xf'));var authService=require(_0x2227('0x10'));var qs=require(_0x2227('0x11'));var as=require(_0x2227('0x12'));var hardwareService=require(_0x2227('0x13'));var logger=require(_0x2227('0x14'))(_0x2227('0x15'));var utils=require(_0x2227('0x16'));var config=require(_0x2227('0x17'));var licenseUtil=require(_0x2227('0x18'));var db=require(_0x2227('0x19'))['db'];function respondWithStatusCode(_0x3aefa4,_0x23738e){_0x23738e=_0x23738e||0xcc;return function(_0x488ded){if(_0x488ded){return _0x3aefa4[_0x2227('0x1a')](_0x23738e);}return _0x3aefa4[_0x2227('0x1b')](_0x23738e)[_0x2227('0x1c')]();};}function respondWithResult(_0x3b4f73,_0x3a4d95){_0x3a4d95=_0x3a4d95||0xc8;return function(_0x82f470){if(_0x82f470){return _0x3b4f73[_0x2227('0x1b')](_0x3a4d95)[_0x2227('0x1d')](_0x82f470);}};}function respondWithFilteredResult(_0x2e2c1c,_0x2614a2){return function(_0x1c5501){if(_0x1c5501){var _0x2de1e9=typeof _0x2614a2[_0x2227('0x1e')]==='undefined'&&typeof _0x2614a2['limit']==='undefined';var _0x2622e2=_0x1c5501[_0x2227('0x1f')];var _0x17412d=_0x2de1e9?0x0:_0x2614a2['offset'];var _0x41b613=_0x2de1e9?_0x1c5501[_0x2227('0x1f')]:_0x2614a2['offset']+_0x2614a2[_0x2227('0x20')];var _0x2518e1;if(_0x41b613>=_0x2622e2){_0x41b613=_0x2622e2;_0x2518e1=0xc8;}else{_0x2518e1=0xce;}_0x2e2c1c[_0x2227('0x1b')](_0x2518e1);return _0x2e2c1c[_0x2227('0x21')](_0x2227('0x22'),_0x17412d+'-'+_0x41b613+'/'+_0x2622e2)[_0x2227('0x1d')](_0x1c5501);}return null;};}function patchUpdates(_0x311f61){return function(_0x4cc23a){try{jsonpatch[_0x2227('0x23')](_0x4cc23a,_0x311f61,!![]);}catch(_0x372de1){return BPromise[_0x2227('0x24')](_0x372de1);}return _0x4cc23a[_0x2227('0x25')]();};}function saveUpdates(_0xf4d819,_0x4b368f){return function(_0x2e5b1c){if(_0x2e5b1c){return _0x2e5b1c[_0x2227('0x26')](_0xf4d819)['then'](function(_0x585ab0){return _0x585ab0;});}return null;};}function removeEntity(_0x5300e9,_0xf2e555){return function(_0x42982f){if(_0x42982f){return _0x42982f[_0x2227('0x27')]()['then'](function(){_0x5300e9[_0x2227('0x1b')](0xcc)[_0x2227('0x1c')]();});}};}function handleEntityNotFound(_0x2bc436,_0x45116){return function(_0x40613f){if(!_0x40613f){_0x2bc436['sendStatus'](0x194);}return _0x40613f;};}function handleError(_0x51f3d3,_0x1a26fe){_0x1a26fe=_0x1a26fe||0x1f4;return function(_0x4eba92){logger[_0x2227('0x28')](_0x4eba92[_0x2227('0x29')]);if(_0x4eba92[_0x2227('0x2a')]){delete _0x4eba92[_0x2227('0x2a')];}_0x51f3d3[_0x2227('0x1b')](_0x1a26fe)[_0x2227('0x2b')](_0x4eba92);};}var utilLicense=require(_0x2227('0x18'));exports['index']=function(_0x3c07a7,_0x4fbc9d){var _0x5eb7d8={'raw':!![],'where':{'id':0x1}},_0x599c3e={};_0x599c3e[_0x2227('0x2c')]=_[_0x2227('0x2d')](db['License'][_0x2227('0x2e')]);_0x599c3e[_0x2227('0x2f')]=_[_0x2227('0x2d')](_0x3c07a7[_0x2227('0x2f')]);_0x599c3e[_0x2227('0x30')]=_[_0x2227('0x31')](_0x599c3e[_0x2227('0x2c')],_0x599c3e[_0x2227('0x2f')]);_0x5eb7d8[_0x2227('0x32')]=_['intersection'](_0x599c3e[_0x2227('0x2c')],qs[_0x2227('0x33')](_0x3c07a7[_0x2227('0x2f')][_0x2227('0x33')]));_0x5eb7d8[_0x2227('0x32')]=_0x5eb7d8[_0x2227('0x32')][_0x2227('0x34')]?_0x5eb7d8['attributes']:_0x599c3e[_0x2227('0x2c')];_0x5eb7d8=_[_0x2227('0x35')]({},_0x5eb7d8,_0x3c07a7[_0x2227('0x36')]);return utilLicense['getLicense'](_0x5eb7d8)['then'](respondWithResult(_0x4fbc9d,null))[_0x2227('0x37')](handleError(_0x4fbc9d,null));};exports[_0x2227('0x26')]=function(_0x4fb832,_0x447cb6){if(_0x4fb832[_0x2227('0x38')]['id']){delete _0x4fb832['body']['id'];}return db[_0x2227('0x39')][_0x2227('0x3a')]({'where':{'id':_0x4fb832['params']['id']}})[_0x2227('0x3b')](handleEntityNotFound(_0x447cb6,null))[_0x2227('0x3b')](function(_0x361b77){var _0x12b26e=_0x361b77[_0x2227('0x3c')]({'plain':!![]});return utilLicense[_0x2227('0x3d')](_0x12b26e,_0x4fb832['body'][_0x2227('0x3e')]);})['then'](function(_0x49e3dd){if(!_0x49e3dd[_0x2227('0x3f')]){return saveUpdates(_0x4fb832['body'],null);}return _0x49e3dd;})['then'](respondWithResult(_0x447cb6,null))[_0x2227('0x37')](handleError(_0x447cb6,null));};exports[_0x2227('0x40')]=function(_0x31a9a9,_0x214ecb){var _0xf7a996=_0x2227('0x41');var _0x46aa08=path[_0x2227('0x42')](_0x2227('0x43'),_0x2227('0x44'),_0x2227('0x45'),_0xf7a996);_0x214ecb[_0x2227('0x46')](_0x2227('0x47'),_0x2227('0x48')+_0xf7a996);_0x214ecb['set']('Content-Type',_0x2227('0x49'));_0x214ecb[_0x2227('0x4a')](_0x46aa08);}; \ No newline at end of file +var _0xbf09=['fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','model','keys','License','query','intersection','attributes','fields','length','merge','options','getLicense','catch','body','find','params','get','checkLicense','key','downloadLogFile','license-info.log','join','/var','log','xcally','setHeader','attachment;\x20filename=','Content-Type','text/plain','download','eml-format','rimraf','zip-dir'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0xbf09,0x115));var _0x9bf0=function(_0x417df0,_0x52da86){_0x417df0=_0x417df0-0x0;var _0x3e1b72=_0xbf09[_0x417df0];return _0x3e1b72;};'use strict';var emlformat=require(_0x9bf0('0x0'));var rimraf=require(_0x9bf0('0x1'));var zipdir=require(_0x9bf0('0x2'));var jsonpatch=require(_0x9bf0('0x3'));var rp=require('request-promise');var moment=require(_0x9bf0('0x4'));var BPromise=require(_0x9bf0('0x5'));var Mustache=require(_0x9bf0('0x6'));var util=require(_0x9bf0('0x7'));var path=require('path');var sox=require(_0x9bf0('0x8'));var csv=require('to-csv');var ejs=require(_0x9bf0('0x9'));var fs=require('fs');var fs_extra=require(_0x9bf0('0xa'));var _=require(_0x9bf0('0xb'));var squel=require(_0x9bf0('0xc'));var crypto=require('crypto');var jsforce=require(_0x9bf0('0xd'));var deskjs=require(_0x9bf0('0xe'));var toCsv=require(_0x9bf0('0xf'));var querystring=require(_0x9bf0('0x10'));var Papa=require(_0x9bf0('0x11'));var Redis=require('ioredis');var authService=require(_0x9bf0('0x12'));var qs=require(_0x9bf0('0x13'));var as=require(_0x9bf0('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9bf0('0x15'));var utils=require('../../config/utils');var config=require(_0x9bf0('0x16'));var licenseUtil=require(_0x9bf0('0x17'));var db=require(_0x9bf0('0x18'))['db'];function respondWithStatusCode(_0xcff48,_0x2fe962){_0x2fe962=_0x2fe962||0xcc;return function(_0x1d85ce){if(_0x1d85ce){return _0xcff48[_0x9bf0('0x19')](_0x2fe962);}return _0xcff48[_0x9bf0('0x1a')](_0x2fe962)[_0x9bf0('0x1b')]();};}function respondWithResult(_0x213409,_0x31ed98){_0x31ed98=_0x31ed98||0xc8;return function(_0x3b7d46){if(_0x3b7d46){return _0x213409[_0x9bf0('0x1a')](_0x31ed98)[_0x9bf0('0x1c')](_0x3b7d46);}};}function respondWithFilteredResult(_0x53946e,_0x13936a){return function(_0x9a92e9){if(_0x9a92e9){var _0x1b329c=typeof _0x13936a[_0x9bf0('0x1d')]===_0x9bf0('0x1e')&&typeof _0x13936a['limit']===_0x9bf0('0x1e');var _0x457217=_0x9a92e9[_0x9bf0('0x1f')];var _0x11d876=_0x1b329c?0x0:_0x13936a[_0x9bf0('0x1d')];var _0x524460=_0x1b329c?_0x9a92e9['count']:_0x13936a[_0x9bf0('0x1d')]+_0x13936a['limit'];var _0x54df03;if(_0x524460>=_0x457217){_0x524460=_0x457217;_0x54df03=0xc8;}else{_0x54df03=0xce;}_0x53946e['status'](_0x54df03);return _0x53946e[_0x9bf0('0x20')](_0x9bf0('0x21'),_0x11d876+'-'+_0x524460+'/'+_0x457217)[_0x9bf0('0x1c')](_0x9a92e9);}return null;};}function patchUpdates(_0x4ac8a9){return function(_0x46c0b9){try{jsonpatch[_0x9bf0('0x22')](_0x46c0b9,_0x4ac8a9,!![]);}catch(_0xd8c179){return BPromise[_0x9bf0('0x23')](_0xd8c179);}return _0x46c0b9[_0x9bf0('0x24')]();};}function saveUpdates(_0x3b8032,_0x1287ef){return function(_0xcb3e80){if(_0xcb3e80){return _0xcb3e80[_0x9bf0('0x25')](_0x3b8032)[_0x9bf0('0x26')](function(_0x2faa30){return _0x2faa30;});}return null;};}function removeEntity(_0x4c0f00,_0x5d70ec){return function(_0x5d403c){if(_0x5d403c){return _0x5d403c[_0x9bf0('0x27')]()[_0x9bf0('0x26')](function(){_0x4c0f00[_0x9bf0('0x1a')](0xcc)[_0x9bf0('0x1b')]();});}};}function handleEntityNotFound(_0x137dfa,_0x2372c2){return function(_0x47a2a7){if(!_0x47a2a7){_0x137dfa[_0x9bf0('0x19')](0x194);}return _0x47a2a7;};}function handleError(_0x49acdd,_0x237445){_0x237445=_0x237445||0x1f4;return function(_0x1d76d9){logger[_0x9bf0('0x28')](_0x1d76d9['stack']);if(_0x1d76d9['name']){delete _0x1d76d9['name'];}_0x49acdd[_0x9bf0('0x1a')](_0x237445)['send'](_0x1d76d9);};}var utilLicense=require(_0x9bf0('0x17'));exports['index']=function(_0x406cee,_0x3249ff){var _0x3147bb={'raw':!![],'where':{'id':0x1}},_0x4c1364={};_0x4c1364[_0x9bf0('0x29')]=_[_0x9bf0('0x2a')](db[_0x9bf0('0x2b')]['rawAttributes']);_0x4c1364['query']=_[_0x9bf0('0x2a')](_0x406cee[_0x9bf0('0x2c')]);_0x4c1364['filters']=_[_0x9bf0('0x2d')](_0x4c1364[_0x9bf0('0x29')],_0x4c1364[_0x9bf0('0x2c')]);_0x3147bb[_0x9bf0('0x2e')]=_[_0x9bf0('0x2d')](_0x4c1364[_0x9bf0('0x29')],qs['fields'](_0x406cee[_0x9bf0('0x2c')][_0x9bf0('0x2f')]));_0x3147bb[_0x9bf0('0x2e')]=_0x3147bb[_0x9bf0('0x2e')][_0x9bf0('0x30')]?_0x3147bb[_0x9bf0('0x2e')]:_0x4c1364['model'];_0x3147bb=_[_0x9bf0('0x31')]({},_0x3147bb,_0x406cee[_0x9bf0('0x32')]);return utilLicense[_0x9bf0('0x33')](_0x3147bb)[_0x9bf0('0x26')](respondWithResult(_0x3249ff,null))[_0x9bf0('0x34')](handleError(_0x3249ff,null));};exports[_0x9bf0('0x25')]=function(_0x4630d8,_0x7b050d){if(_0x4630d8[_0x9bf0('0x35')]['id']){delete _0x4630d8[_0x9bf0('0x35')]['id'];}return db[_0x9bf0('0x2b')][_0x9bf0('0x36')]({'where':{'id':_0x4630d8[_0x9bf0('0x37')]['id']}})[_0x9bf0('0x26')](handleEntityNotFound(_0x7b050d,null))[_0x9bf0('0x26')](function(_0x3eb50d){var _0x115842=_0x3eb50d[_0x9bf0('0x38')]({'plain':!![]});return utilLicense[_0x9bf0('0x39')](_0x115842,_0x4630d8[_0x9bf0('0x35')][_0x9bf0('0x3a')]);})['then'](function(_0x1df945){if(!_0x1df945['demo']){return saveUpdates(_0x4630d8[_0x9bf0('0x35')],null);}return _0x1df945;})[_0x9bf0('0x26')](respondWithResult(_0x7b050d,null))['catch'](handleError(_0x7b050d,null));};exports[_0x9bf0('0x3b')]=function(_0x814ddc,_0x1a0ccf){var _0x451405=_0x9bf0('0x3c');var _0x51f050=path[_0x9bf0('0x3d')](_0x9bf0('0x3e'),_0x9bf0('0x3f'),_0x9bf0('0x40'),_0x451405);_0x1a0ccf[_0x9bf0('0x41')]('Content-disposition',_0x9bf0('0x42')+_0x451405);_0x1a0ccf[_0x9bf0('0x20')](_0x9bf0('0x43'),_0x9bf0('0x44'));_0x1a0ccf[_0x9bf0('0x45')](_0x51f050);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 21b2515..402e84e 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 _0xf8dc=['lodash','util','api','path','../../config/environment','exports','define','License','license'];(function(_0x54b396,_0x3612ee){var _0x532e6d=function(_0xc8286e){while(--_0xc8286e){_0x54b396['push'](_0x54b396['shift']());}};_0x532e6d(++_0x3612ee);}(_0xf8dc,0x132));var _0xcf8d=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xf8dc[_0x1ddedd];return _0xa3e1ac;};'use strict';var _=require(_0xcf8d('0x0'));var util=require(_0xcf8d('0x1'));var logger=require('../../config/logger')(_0xcf8d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xcf8d('0x3'));var rimraf=require('rimraf');var config=require(_0xcf8d('0x4'));var attributes=require('./license.attributes');module[_0xcf8d('0x5')]=function(_0x2666cf,_0xda1751){return _0x2666cf[_0xcf8d('0x6')](_0xcf8d('0x7'),attributes,{'tableName':_0xcf8d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3fc4=['api','moment','bluebird','request-promise','path','rimraf','./license.attributes','exports','define','license','lodash','util','../../config/logger'];(function(_0x1d38d4,_0x2a5df1){var _0x3dc2f7=function(_0x2f023f){while(--_0x2f023f){_0x1d38d4['push'](_0x1d38d4['shift']());}};_0x3dc2f7(++_0x2a5df1);}(_0x3fc4,0x1aa));var _0x43fc=function(_0x51ea54,_0x47ce48){_0x51ea54=_0x51ea54-0x0;var _0x35f7f3=_0x3fc4[_0x51ea54];return _0x35f7f3;};'use strict';var _=require(_0x43fc('0x0'));var util=require(_0x43fc('0x1'));var logger=require(_0x43fc('0x2'))(_0x43fc('0x3'));var moment=require(_0x43fc('0x4'));var BPromise=require(_0x43fc('0x5'));var rp=require(_0x43fc('0x6'));var fs=require('fs');var path=require(_0x43fc('0x7'));var rimraf=require(_0x43fc('0x8'));var config=require('../../config/environment');var attributes=require(_0x43fc('0x9'));module[_0x43fc('0xa')]=function(_0x1600d9,_0x191a4a){return _0x1600d9[_0x43fc('0xb')]('License',attributes,{'tableName':_0x43fc('0xc'),'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 11dea49..6acf273 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 _0xe503=['error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s'];(function(_0x242a98,_0x13988e){var _0x580999=function(_0x341927){while(--_0x341927){_0x242a98['push'](_0x242a98['shift']());}};_0x580999(++_0x13988e);}(_0xe503,0x15e));var _0x3e50=function(_0x3b150c,_0x2f93f8){_0x3b150c=_0x3b150c-0x0;var _0x5cd414=_0xe503[_0x3b150c];return _0x5cd414;};'use strict';var _=require(_0x3e50('0x0'));var util=require(_0x3e50('0x1'));var moment=require(_0x3e50('0x2'));var BPromise=require(_0x3e50('0x3'));var rs=require(_0x3e50('0x4'));var fs=require('fs');var Redis=require(_0x3e50('0x5'));var db=require(_0x3e50('0x6'))['db'];var utils=require(_0x3e50('0x7'));var logger=require('../../config/logger')(_0x3e50('0x8'));var config=require(_0x3e50('0x9'));var jayson=require(_0x3e50('0xa'));var client=jayson['client'][_0x3e50('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1148a8,_0x6143c9,_0x201880){return new BPromise(function(_0x401f0a,_0x1bc2c3){return client[_0x3e50('0xc')](_0x1148a8,_0x201880)[_0x3e50('0xd')](function(_0xa1b134){logger['info'](_0x3e50('0xe'),_0x6143c9,_0x3e50('0xf'));logger[_0x3e50('0x10')](_0x3e50('0x11'),_0x6143c9,_0x3e50('0xf'),JSON['stringify'](_0xa1b134));if(_0xa1b134['error']){if(_0xa1b134[_0x3e50('0x12')][_0x3e50('0x13')]===0x1f4){logger[_0x3e50('0x12')]('License,\x20%s,\x20%s',_0x6143c9,_0xa1b134['error'][_0x3e50('0x14')]);return _0x1bc2c3(_0xa1b134[_0x3e50('0x12')][_0x3e50('0x14')]);}logger['error'](_0x3e50('0xe'),_0x6143c9,_0xa1b134[_0x3e50('0x12')][_0x3e50('0x14')]);return _0x401f0a(_0xa1b134[_0x3e50('0x12')][_0x3e50('0x14')]);}else{logger[_0x3e50('0x15')](_0x3e50('0xe'),_0x6143c9,_0x3e50('0xf'));_0x401f0a(_0xa1b134['result'][_0x3e50('0x14')]);}})[_0x3e50('0x16')](function(_0x24fedb){logger['error'](_0x3e50('0xe'),_0x6143c9,_0x24fedb);_0x1bc2c3(_0x24fedb);});});} \ No newline at end of file +var _0xfa05=['../../config/utils','../../config/logger','client','http','info','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','License,\x20%s,\x20%s','message','util','bluebird','ioredis'];(function(_0x4017b0,_0x4347db){var _0x5ed4f7=function(_0x706c26){while(--_0x706c26){_0x4017b0['push'](_0x4017b0['shift']());}};_0x5ed4f7(++_0x4347db);}(_0xfa05,0xf9));var _0x5fa0=function(_0x1582ed,_0x5a1736){_0x1582ed=_0x1582ed-0x0;var _0x857b2f=_0xfa05[_0x1582ed];return _0x857b2f;};'use strict';var _=require('lodash');var util=require(_0x5fa0('0x0'));var moment=require('moment');var BPromise=require(_0x5fa0('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5fa0('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x5fa0('0x3'));var logger=require(_0x5fa0('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5fa0('0x5')][_0x5fa0('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2121e1,_0x3a234b,_0x3fffc3){return new BPromise(function(_0x3f6448,_0x39f629){return client['request'](_0x2121e1,_0x3fffc3)['then'](function(_0x58e1cc){logger[_0x5fa0('0x7')]('License,\x20%s,\x20%s',_0x3a234b,'request\x20sent');logger[_0x5fa0('0x8')](_0x5fa0('0x9'),_0x3a234b,'request\x20sent',JSON[_0x5fa0('0xa')](_0x58e1cc));if(_0x58e1cc[_0x5fa0('0xb')]){if(_0x58e1cc[_0x5fa0('0xb')]['code']===0x1f4){logger[_0x5fa0('0xb')](_0x5fa0('0xc'),_0x3a234b,_0x58e1cc[_0x5fa0('0xb')][_0x5fa0('0xd')]);return _0x39f629(_0x58e1cc[_0x5fa0('0xb')][_0x5fa0('0xd')]);}logger[_0x5fa0('0xb')](_0x5fa0('0xc'),_0x3a234b,_0x58e1cc['error'][_0x5fa0('0xd')]);return _0x3f6448(_0x58e1cc[_0x5fa0('0xb')][_0x5fa0('0xd')]);}else{logger[_0x5fa0('0x7')](_0x5fa0('0xc'),_0x3a234b,'request\x20sent');_0x3f6448(_0x58e1cc['result']['message']);}})['catch'](function(_0x1f6bac){logger[_0x5fa0('0xb')](_0x5fa0('0xc'),_0x3a234b,_0x1f6bac);_0x39f629(_0x1f6bac);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 39e403f..4a3a2f9 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 _0x15ed=['addAnswer','addImap','addSmtp','/:id/interactions','addInteraction','/:id/send','send','addAgents','put','delete','/:id/canned_answers','removeAnswers','removeImap','destroy','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','isAuthenticated','index','get','/describe','/:id','show','/:id/dispositions','getAnswers','/:id/in_servers','/:id/out_servers','getSmtp','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','verifySmtp','/:id/users','getAgents','post','addDisposition'];(function(_0x4ffa64,_0x271035){var _0x5da001=function(_0x7d1940){while(--_0x7d1940){_0x4ffa64['push'](_0x4ffa64['shift']());}};_0x5da001(++_0x271035);}(_0x15ed,0x1e5));var _0xd15e=function(_0x421cf8,_0x23152c){_0x421cf8=_0x421cf8-0x0;var _0x145c48=_0x15ed[_0x421cf8];return _0x145c48;};'use strict';var multer=require(_0xd15e('0x0'));var util=require(_0xd15e('0x1'));var path=require(_0xd15e('0x2'));var timeout=require(_0xd15e('0x3'));var express=require(_0xd15e('0x4'));var router=express[_0xd15e('0x5')]();var fs_extra=require(_0xd15e('0x6'));var auth=require(_0xd15e('0x7'));var interaction=require(_0xd15e('0x8'));var config=require(_0xd15e('0x9'));var controller=require(_0xd15e('0xa'));router['get']('/',auth[_0xd15e('0xb')](),controller[_0xd15e('0xc')]);router[_0xd15e('0xd')](_0xd15e('0xe'),auth[_0xd15e('0xb')](),controller['describe']);router[_0xd15e('0xd')](_0xd15e('0xf'),auth[_0xd15e('0xb')](),controller[_0xd15e('0x10')]);router['get'](_0xd15e('0x11'),auth[_0xd15e('0xb')](),controller['getDispositions']);router['get']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xd15e('0x12')]);router[_0xd15e('0xd')](_0xd15e('0x13'),auth[_0xd15e('0xb')](),controller['getImap']);router[_0xd15e('0xd')](_0xd15e('0x14'),auth[_0xd15e('0xb')](),controller[_0xd15e('0x15')]);router[_0xd15e('0xd')]('/:id/interactions',auth[_0xd15e('0xb')](),controller[_0xd15e('0x16')]);router[_0xd15e('0xd')](_0xd15e('0x17'),auth[_0xd15e('0xb')](),controller[_0xd15e('0x18')]);router[_0xd15e('0xd')](_0xd15e('0x19'),auth[_0xd15e('0xb')](),controller[_0xd15e('0x1a')]);router[_0xd15e('0xd')]('/:id/verify',auth[_0xd15e('0xb')](),controller[_0xd15e('0x1b')]);router['get'](_0xd15e('0x1c'),auth[_0xd15e('0xb')](),controller[_0xd15e('0x1d')]);router[_0xd15e('0x1e')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xd15e('0x1f')]);router[_0xd15e('0x1e')]('/:id/canned_answers',auth[_0xd15e('0xb')](),controller[_0xd15e('0x20')]);router[_0xd15e('0x1e')]('/',auth[_0xd15e('0xb')](),controller['create']);router[_0xd15e('0x1e')](_0xd15e('0x13'),auth[_0xd15e('0xb')](),controller[_0xd15e('0x21')]);router[_0xd15e('0x1e')](_0xd15e('0x14'),auth['isAuthenticated'](),controller[_0xd15e('0x22')]);router[_0xd15e('0x1e')](_0xd15e('0x23'),auth[_0xd15e('0xb')](),controller[_0xd15e('0x24')]);router[_0xd15e('0x1e')](_0xd15e('0x17'),auth[_0xd15e('0xb')](),controller['addApplications']);router[_0xd15e('0x1e')](_0xd15e('0x25'),auth[_0xd15e('0xb')](),controller[_0xd15e('0x26')]);router[_0xd15e('0x1e')](_0xd15e('0x1c'),auth[_0xd15e('0xb')](),controller[_0xd15e('0x27')]);router[_0xd15e('0x28')](_0xd15e('0xf'),auth[_0xd15e('0xb')](),controller['update']);router[_0xd15e('0x29')](_0xd15e('0x11'),auth['isAuthenticated'](),controller['removeDispositions']);router['delete'](_0xd15e('0x2a'),auth[_0xd15e('0xb')](),controller[_0xd15e('0x2b')]);router[_0xd15e('0x29')](_0xd15e('0x13'),auth[_0xd15e('0xb')](),controller[_0xd15e('0x2c')]);router[_0xd15e('0x29')](_0xd15e('0x14'),auth[_0xd15e('0xb')](),controller['removeSmtp']);router['delete']('/:id',auth[_0xd15e('0xb')](),controller[_0xd15e('0x2d')]);router[_0xd15e('0x29')](_0xd15e('0x1c'),auth[_0xd15e('0xb')](),controller[_0xd15e('0x2e')]);module['exports']=router; \ No newline at end of file +var _0x3283=['send','addAgents','/:id','update','delete','removeDispositions','/:id/canned_answers','removeAnswers','removeImap','destroy','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','getDispositions','getAnswers','/:id/in_servers','getImap','getSmtp','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','/:id/dispositions','addDisposition','addAnswer','create','/:id/out_servers','addSmtp','/:id/interactions','addInteraction','/:id/applications','addApplications','/:id/send'];(function(_0xcb9a48,_0x4f4151){var _0x44861b=function(_0x5ca418){while(--_0x5ca418){_0xcb9a48['push'](_0xcb9a48['shift']());}};_0x44861b(++_0x4f4151);}(_0x3283,0x1ec));var _0x3328=function(_0x429f70,_0x113308){_0x429f70=_0x429f70-0x0;var _0x2d06c9=_0x3283[_0x429f70];return _0x2d06c9;};'use strict';var multer=require(_0x3328('0x0'));var util=require('util');var path=require(_0x3328('0x1'));var timeout=require(_0x3328('0x2'));var express=require(_0x3328('0x3'));var router=express[_0x3328('0x4')]();var fs_extra=require(_0x3328('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3328('0x6'));var config=require(_0x3328('0x7'));var controller=require('./mailAccount.controller');router['get']('/',auth[_0x3328('0x8')](),controller[_0x3328('0x9')]);router[_0x3328('0xa')](_0x3328('0xb'),auth[_0x3328('0x8')](),controller['describe']);router['get']('/:id',auth[_0x3328('0x8')](),controller['show']);router[_0x3328('0xa')]('/:id/dispositions',auth[_0x3328('0x8')](),controller[_0x3328('0xc')]);router[_0x3328('0xa')]('/:id/canned_answers',auth[_0x3328('0x8')](),controller[_0x3328('0xd')]);router[_0x3328('0xa')](_0x3328('0xe'),auth[_0x3328('0x8')](),controller[_0x3328('0xf')]);router['get']('/:id/out_servers',auth[_0x3328('0x8')](),controller[_0x3328('0x10')]);router[_0x3328('0xa')]('/:id/interactions',auth['isAuthenticated'](),controller['getInteractions']);router[_0x3328('0xa')]('/:id/applications',auth[_0x3328('0x8')](),controller[_0x3328('0x11')]);router['get'](_0x3328('0x12'),auth[_0x3328('0x8')](),controller[_0x3328('0x13')]);router[_0x3328('0xa')](_0x3328('0x14'),auth[_0x3328('0x8')](),controller[_0x3328('0x15')]);router[_0x3328('0xa')](_0x3328('0x16'),auth[_0x3328('0x8')](),controller[_0x3328('0x17')]);router[_0x3328('0x18')](_0x3328('0x19'),auth[_0x3328('0x8')](),controller[_0x3328('0x1a')]);router['post']('/:id/canned_answers',auth[_0x3328('0x8')](),controller[_0x3328('0x1b')]);router[_0x3328('0x18')]('/',auth['isAuthenticated'](),controller[_0x3328('0x1c')]);router['post'](_0x3328('0xe'),auth[_0x3328('0x8')](),controller['addImap']);router['post'](_0x3328('0x1d'),auth[_0x3328('0x8')](),controller[_0x3328('0x1e')]);router[_0x3328('0x18')](_0x3328('0x1f'),auth[_0x3328('0x8')](),controller[_0x3328('0x20')]);router[_0x3328('0x18')](_0x3328('0x21'),auth[_0x3328('0x8')](),controller[_0x3328('0x22')]);router[_0x3328('0x18')](_0x3328('0x23'),auth[_0x3328('0x8')](),controller[_0x3328('0x24')]);router[_0x3328('0x18')]('/:id/users',auth[_0x3328('0x8')](),controller[_0x3328('0x25')]);router['put'](_0x3328('0x26'),auth[_0x3328('0x8')](),controller[_0x3328('0x27')]);router[_0x3328('0x28')](_0x3328('0x19'),auth[_0x3328('0x8')](),controller[_0x3328('0x29')]);router[_0x3328('0x28')](_0x3328('0x2a'),auth[_0x3328('0x8')](),controller[_0x3328('0x2b')]);router[_0x3328('0x28')](_0x3328('0xe'),auth[_0x3328('0x8')](),controller[_0x3328('0x2c')]);router['delete'](_0x3328('0x1d'),auth['isAuthenticated'](),controller['removeSmtp']);router['delete']('/:id',auth[_0x3328('0x8')](),controller[_0x3328('0x2d')]);router[_0x3328('0x28')](_0x3328('0x16'),auth['isAuthenticated'](),controller[_0x3328('0x2e')]);module[_0x3328('0x2f')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index a3699f1..6165173 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 _0xdaa0=['hotmail','yahoo','getDataValue','provider','custom','exports','STRING','BOOLEAN','TEXT','INTEGER','UNSIGNED','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','gmail'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xdaa0,0x6b));var _0x0daa=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xdaa0[_0x934425];return _0x31d596;};'use strict';var Sequelize=require('sequelize');module[_0x0daa('0x0')]={'description':{'type':Sequelize[_0x0daa('0x1')]},'name':{'type':Sequelize[_0x0daa('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x0daa('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x0daa('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0x0daa('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x0daa('0x3')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x0daa('0x1')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0x0daa('0x4')](0x2)[_0x0daa('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'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[_0x0daa('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0daa('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x0daa('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0daa('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0daa('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0daa('0x4')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x0daa('0x6'),'set':function(_0x40ba21){if(!_0x40ba21)this[_0x0daa('0x7')](_0x0daa('0x8'),null);this['setDataValue'](_0x0daa('0x9'),_0x40ba21);}},'provider':{'type':Sequelize[_0x0daa('0xa')](_0x0daa('0xb'),_0x0daa('0xc'),_0x0daa('0xd'),'outlook365'),'defaultValue':null,'get':function(){if(!this[_0x0daa('0xe')](_0x0daa('0xf')))return _0x0daa('0x10');return this[_0x0daa('0xe')](_0x0daa('0xf'));},'set':function(_0x1dac4d){if(_0x1dac4d===_0x0daa('0x10'))_0x1dac4d=null;return this[_0x0daa('0x7')](_0x0daa('0xf'),_0x1dac4d);}}}; \ No newline at end of file +var _0xb437=['exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','gmail','hotmail','yahoo','getDataValue','provider','custom','sequelize'];(function(_0x270a81,_0x256f99){var _0x4bd48a=function(_0x1c4280){while(--_0x1c4280){_0x270a81['push'](_0x270a81['shift']());}};_0x4bd48a(++_0x256f99);}(_0xb437,0x84));var _0x7b43=function(_0x3cb29e,_0x18685c){_0x3cb29e=_0x3cb29e-0x0;var _0x578d7e=_0xb437[_0x3cb29e];return _0x578d7e;};'use strict';var Sequelize=require(_0x7b43('0x0'));module[_0x7b43('0x1')]={'description':{'type':Sequelize[_0x7b43('0x2')]},'name':{'type':Sequelize[_0x7b43('0x2')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x7b43('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x7b43('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x7b43('0x4')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7b43('0x5')},'fontSize':{'type':Sequelize[_0x7b43('0x6')](0x2)[_0x7b43('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x7b43('0x4')],'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[_0x7b43('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x7b43('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x7b43('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7b43('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7b43('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x7b43('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x7b43('0x3')],'defaultValue':![],'comment':_0x7b43('0x9'),'set':function(_0x173605){if(!_0x173605)this[_0x7b43('0xa')](_0x7b43('0xb'),null);this[_0x7b43('0xa')](_0x7b43('0xc'),_0x173605);}},'provider':{'type':Sequelize['ENUM'](_0x7b43('0xd'),_0x7b43('0xe'),_0x7b43('0xf'),'outlook365'),'defaultValue':null,'get':function(){if(!this[_0x7b43('0x10')](_0x7b43('0x11')))return _0x7b43('0x12');return this[_0x7b43('0x10')](_0x7b43('0x11'));},'set':function(_0x586ee1){if(_0x586ee1===_0x7b43('0x12'))_0x586ee1=null;return this[_0x7b43('0xa')](_0x7b43('0x11'),_0x586ee1);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 1ce3fc5..efd749d 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 _0x1a2d=['addAnswer','CannedAnswer','removeAnswers','key','custom','email','ListId','isNil','active','description','role','UserProfileSection','MailAccounts','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','getSmtp','addSmtp','removeSmtp','addInteraction','MailInteraction','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','tag','sequelize','transaction','Transaction','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','stack','finally','send','getApplications','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','attachments','root','server/files/attachments','basename','SendMail','sendMail','List','List\x20not\x20found','Contacts','out','messageId','Interaction','Messages','getSmtpOptions','VerifySmtp','verifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','omit','spread','emit','removeAgents','userMailAccount:remove','getAgents','util','path','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','sendStatus','status','end','json','offset','limit','count','set','update','destroy','get','name','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','Unknown\x20email\x20service\x20provider','user','username','password','pass','modernAuthentication','CloudProviderId','host','port','service','authentication','Imap','Smtp','MailServerIn','Pause','MailAccount','rawAttributes','fieldName','type','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','MailServerOut','mandatoryDispositionPause','find','body','provider','secure','describe','addDisposition','Disposition','create','getDispositions','findOne','MailAccountId','options','removeDispositions','ids'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x1a2d,0x1d7));var _0xd1a2=function(_0x2e23d4,_0x4d3062){_0x2e23d4=_0x2e23d4-0x0;var _0x3a2360=_0x1a2d[_0x2e23d4];return _0x3a2360;};'use strict';var moment=require('moment');var BPromise=require('bluebird');var util=require(_0xd1a2('0x0'));var path=require(_0xd1a2('0x1'));var _=require(_0xd1a2('0x2'));var juice=require(_0xd1a2('0x3'));var Redis=require(_0xd1a2('0x4'));var qs=require(_0xd1a2('0x5'));var logger=require(_0xd1a2('0x6'))(_0xd1a2('0x7'));var config=require(_0xd1a2('0x8'));var db=require('../../mysqldb')['db'];config[_0xd1a2('0x9')]=_[_0xd1a2('0xa')](config[_0xd1a2('0x9')],{'host':_0xd1a2('0xb'),'port':0x18eb});var socket=require(_0xd1a2('0xc'))(new Redis(config[_0xd1a2('0x9')]));require(_0xd1a2('0xd'))[_0xd1a2('0xe')](socket);var jayson=require(_0xd1a2('0xf'));var client=jayson[_0xd1a2('0x10')][_0xd1a2('0x11')]({'port':0x232b});function respondWithRpcPromise(_0x3e52f3,_0x596ad4,_0x4e2c40,_0x59fb41){return new BPromise(function(_0x234808,_0x4186c6){var _0x2476ee=_0x59fb41||client;return _0x2476ee[_0xd1a2('0x12')](_0x3e52f3,_0x4e2c40)[_0xd1a2('0x13')](function(_0x3f41b8){logger[_0xd1a2('0x14')](_0xd1a2('0x15'),_0x596ad4,_0xd1a2('0x16'));logger[_0xd1a2('0x17')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x596ad4,_0xd1a2('0x16'),JSON[_0xd1a2('0x18')](_0x3f41b8));if(_0x3f41b8[_0xd1a2('0x19')]){if(_0x3f41b8[_0xd1a2('0x19')]['code']===0x1f4){logger[_0xd1a2('0x19')]('MailAccount,\x20%s,\x20%s',_0x596ad4,_0x3f41b8[_0xd1a2('0x19')][_0xd1a2('0x1a')]);return _0x4186c6(_0x3f41b8['error'][_0xd1a2('0x1a')]);}logger[_0xd1a2('0x19')](_0xd1a2('0x15'),_0x596ad4,_0x3f41b8[_0xd1a2('0x19')][_0xd1a2('0x1a')]);return _0x234808(_0x3f41b8[_0xd1a2('0x19')][_0xd1a2('0x1a')]);}else{logger['info'](_0xd1a2('0x15'),_0x596ad4,_0xd1a2('0x16'));_0x234808(_0x3f41b8[_0xd1a2('0x1b')][_0xd1a2('0x1a')]);}})['catch'](function(_0x28a256){logger[_0xd1a2('0x19')](_0xd1a2('0x15'),_0x596ad4,_0x28a256);_0x4186c6(_0x28a256);});});}function respondWithStatusCode(_0xaa0f43,_0x42c028){_0x42c028=_0x42c028||0xcc;return function(_0x4f7f57){if(_0x4f7f57){return _0xaa0f43[_0xd1a2('0x1c')](_0x42c028);}return _0xaa0f43[_0xd1a2('0x1d')](_0x42c028)[_0xd1a2('0x1e')]();};}function respondWithResult(_0x22ba67,_0x78189c){_0x78189c=_0x78189c||0xc8;return function(_0x4ee35f){if(_0x4ee35f){return _0x22ba67['status'](_0x78189c)[_0xd1a2('0x1f')](_0x4ee35f);}};}function respondWithFilteredResult(_0x23db94,_0xa8f7c9){return function(_0x30a023){if(_0x30a023){var _0x2ece24=typeof _0xa8f7c9[_0xd1a2('0x20')]==='undefined'&&typeof _0xa8f7c9[_0xd1a2('0x21')]==='undefined';var _0x2dd0d1=_0x30a023[_0xd1a2('0x22')];var _0x20a60a=_0x2ece24?0x0:_0xa8f7c9['offset'];var _0x2a4db6=_0x2ece24?_0x30a023['count']:_0xa8f7c9[_0xd1a2('0x20')]+_0xa8f7c9['limit'];var _0x1dce22;if(_0x2a4db6>=_0x2dd0d1){_0x2a4db6=_0x2dd0d1;_0x1dce22=0xc8;}else{_0x1dce22=0xce;}_0x23db94['status'](_0x1dce22);return _0x23db94[_0xd1a2('0x23')]('Content-Range',_0x20a60a+'-'+_0x2a4db6+'/'+_0x2dd0d1)['json'](_0x30a023);}return null;};}function saveUpdates(_0xa1037e){return function(_0x36eb17){if(_0x36eb17){return _0x36eb17[_0xd1a2('0x24')](_0xa1037e)[_0xd1a2('0x13')](function(_0x2e6b9c){return _0x2e6b9c;});}return null;};}function removeEntity(_0x489ccc){return function(_0x5db07f){if(_0x5db07f){return _0x5db07f[_0xd1a2('0x25')]()[_0xd1a2('0x13')](function(){var _0x57afd9=_0x5db07f[_0xd1a2('0x26')]({'plain':!![]});var _0x55d9e8='MailAccounts';return db['UserProfileResource'][_0xd1a2('0x25')]({'where':{'type':_0x55d9e8,'resourceId':_0x57afd9['id']}})['then'](function(){return _0x5db07f;});})[_0xd1a2('0x13')](function(){_0x489ccc[_0xd1a2('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x678139){return function(_0x233f8e){if(!_0x233f8e){_0x678139[_0xd1a2('0x1c')](0x194);}return _0x233f8e;};}function handleError(_0x35aeb7,_0x49cb2c){_0x49cb2c=_0x49cb2c||0x1f4;return function(_0x588e54){logger[_0xd1a2('0x19')](_0x588e54['stack']);if(_0x588e54['name']){delete _0x588e54[_0xd1a2('0x27')];}_0x35aeb7[_0xd1a2('0x1d')](_0x49cb2c)['send'](_0x588e54);};}function getImapHost(_0x45ed0a){switch(_0x45ed0a){case _0xd1a2('0x28'):return _0xd1a2('0x29');case _0xd1a2('0x2a'):return _0xd1a2('0x2b');case _0xd1a2('0x2c'):return _0xd1a2('0x2d');case _0xd1a2('0x2e'):return _0xd1a2('0x2f');}throw new Error('Unknown\x20email\x20service\x20provider',_0x45ed0a);}function getSmtpHost(_0x486aa4){switch(_0x486aa4){case _0xd1a2('0x28'):return _0xd1a2('0x30');case _0xd1a2('0x2a'):return _0xd1a2('0x31');case'hotmail':return _0xd1a2('0x32');case _0xd1a2('0x2e'):return'smtp.office365.com';}throw new Error(_0xd1a2('0x33'),_0x486aa4);}function getAuthenticationOptions(_0x1987d4,_0x43b76b){var _0x3e1911={};var _0x2a7749={};if(_0x1987d4){_0x3e1911[_0xd1a2('0x34')]=_0x2a7749[_0xd1a2('0x34')]=_0x43b76b[_0xd1a2('0x35')];_0x3e1911[_0xd1a2('0x36')]=_0x2a7749[_0xd1a2('0x37')]=_0x43b76b[_0xd1a2('0x36')];if(_0x43b76b[_0xd1a2('0x38')]){_0x3e1911[_0xd1a2('0x38')]=_0x2a7749[_0xd1a2('0x38')]=!![];_0x3e1911['CloudProviderId']=_0x2a7749['CloudProviderId']=_0x43b76b['CloudProviderId'];_0x3e1911[_0xd1a2('0x36')]=_0x2a7749['pass']=null;}else{_0x3e1911[_0xd1a2('0x39')]=_0x2a7749[_0xd1a2('0x39')]=null;}_0x3e1911[_0xd1a2('0x3a')]=getImapHost(_0x1987d4);_0x3e1911[_0xd1a2('0x3b')]=0x3e1;_0x2a7749[_0xd1a2('0x3a')]=getSmtpHost(_0x1987d4);_0x2a7749[_0xd1a2('0x3b')]=0x24b;_0x2a7749['secure']=![];_0x3e1911[_0xd1a2('0x3c')]=_0x2a7749[_0xd1a2('0x3c')]=null;}else{if(_0x43b76b[_0xd1a2('0x3d')]){_0x3e1911['user']=_0x2a7749[_0xd1a2('0x34')]=_0x43b76b['username'];_0x3e1911[_0xd1a2('0x36')]=_0x2a7749['pass']=_0x43b76b[_0xd1a2('0x36')];}else{_0x3e1911[_0xd1a2('0x3d')]=_0x2a7749['authentication']=![];_0x3e1911[_0xd1a2('0x34')]=_0x2a7749[_0xd1a2('0x34')]=null;_0x3e1911[_0xd1a2('0x36')]=_0x2a7749[_0xd1a2('0x37')]=null;}_0x3e1911[_0xd1a2('0x3a')]=_0x43b76b[_0xd1a2('0x3e')][_0xd1a2('0x3a')];_0x3e1911[_0xd1a2('0x3b')]=_0x43b76b[_0xd1a2('0x3e')]['port'];_0x2a7749[_0xd1a2('0x3a')]=_0x43b76b[_0xd1a2('0x3f')]['host'];_0x2a7749[_0xd1a2('0x3b')]=_0x43b76b[_0xd1a2('0x3f')][_0xd1a2('0x3b')];}return{'Imap':_0x3e1911,'Smtp':_0x2a7749};}exports['index']=function(_0x261812,_0x3b413e){var _0x3a7eca={'include':[{'model':db[_0xd1a2('0x40')],'as':_0xd1a2('0x3e')},{'model':db['MailServerOut'],'as':_0xd1a2('0x3f')},{'model':db[_0xd1a2('0x41')],'as':'mandatoryDispositionPause'}]},_0x25ec44={},_0x2f9eaf={'count':0x0,'rows':[]};var _0xe8ecab=_['map'](db[_0xd1a2('0x42')][_0xd1a2('0x43')],function(_0x57231c){return{'name':_0x57231c[_0xd1a2('0x44')],'type':_0x57231c[_0xd1a2('0x45')]['key']};});_0x25ec44[_0xd1a2('0x46')]=_['map'](_0xe8ecab,_0xd1a2('0x27'));_0x25ec44['query']=_[_0xd1a2('0x47')](_0x261812[_0xd1a2('0x48')]);_0x25ec44[_0xd1a2('0x49')]=_['intersection'](_0x25ec44[_0xd1a2('0x46')],_0x25ec44[_0xd1a2('0x48')]);_0x3a7eca[_0xd1a2('0x4a')]=_[_0xd1a2('0x4b')](_0x25ec44[_0xd1a2('0x46')],qs[_0xd1a2('0x4c')](_0x261812[_0xd1a2('0x48')][_0xd1a2('0x4c')]));_0x3a7eca[_0xd1a2('0x4a')]=_0x3a7eca[_0xd1a2('0x4a')][_0xd1a2('0x4d')]?_0x3a7eca['attributes']:_0x25ec44['model'];if(!_0x261812[_0xd1a2('0x48')][_0xd1a2('0x4e')](_0xd1a2('0x4f'))){_0x3a7eca[_0xd1a2('0x21')]=qs[_0xd1a2('0x21')](_0x261812[_0xd1a2('0x48')][_0xd1a2('0x21')]);_0x3a7eca['offset']=qs[_0xd1a2('0x20')](_0x261812[_0xd1a2('0x48')][_0xd1a2('0x20')]);}_0x3a7eca[_0xd1a2('0x50')]=qs[_0xd1a2('0x51')](_0x261812[_0xd1a2('0x48')][_0xd1a2('0x51')]);_0x3a7eca[_0xd1a2('0x52')]=qs['filters'](_[_0xd1a2('0x53')](_0x261812[_0xd1a2('0x48')],_0x25ec44['filters']),_0xe8ecab);if(_0x261812[_0xd1a2('0x48')][_0xd1a2('0x54')]){_0x3a7eca[_0xd1a2('0x52')]=_[_0xd1a2('0x55')](_0x3a7eca[_0xd1a2('0x52')],{'$or':_[_0xd1a2('0x56')](_0xe8ecab,function(_0x2d7e36){if(_0x2d7e36['type']!==_0xd1a2('0x57')){var _0x19a34d={};_0x19a34d[_0x2d7e36[_0xd1a2('0x27')]]={'$like':'%'+_0x261812[_0xd1a2('0x48')][_0xd1a2('0x54')]+'%'};return _0x19a34d;}})});}_0x3a7eca=_[_0xd1a2('0x55')]({},_0x3a7eca,_0x261812['options']);var _0x7572fe={'where':_0x3a7eca['where']};return db['MailAccount'][_0xd1a2('0x22')](_0x7572fe)[_0xd1a2('0x13')](function(_0x2f7079){_0x2f9eaf[_0xd1a2('0x22')]=_0x2f7079;if(_0x261812[_0xd1a2('0x48')][_0xd1a2('0x58')]){_0x3a7eca[_0xd1a2('0x59')]=[{'all':!![]}];}return db['MailAccount'][_0xd1a2('0x5a')](_0x3a7eca);})['then'](function(_0x131408){_0x2f9eaf[_0xd1a2('0x5b')]=_0x131408;return _0x2f9eaf;})[_0xd1a2('0x13')](respondWithFilteredResult(_0x3b413e,_0x3a7eca))[_0xd1a2('0x5c')](handleError(_0x3b413e,null));};exports[_0xd1a2('0x5d')]=function(_0x20e3ec,_0x3d83ce){var _0x2846c2={'raw':![],'where':{'id':_0x20e3ec[_0xd1a2('0x5e')]['id']},'include':[{'model':db[_0xd1a2('0x40')],'as':'Imap'},{'model':db[_0xd1a2('0x5f')],'as':_0xd1a2('0x3f')},{'model':db[_0xd1a2('0x41')],'as':_0xd1a2('0x60')}]},_0x31dc8d={};_0x31dc8d[_0xd1a2('0x46')]=_[_0xd1a2('0x47')](db[_0xd1a2('0x42')][_0xd1a2('0x43')]);_0x31dc8d['query']=_['keys'](_0x20e3ec[_0xd1a2('0x48')]);_0x31dc8d[_0xd1a2('0x49')]=_[_0xd1a2('0x4b')](_0x31dc8d[_0xd1a2('0x46')],_0x31dc8d[_0xd1a2('0x48')]);_0x2846c2[_0xd1a2('0x4a')]=_[_0xd1a2('0x4b')](_0x31dc8d[_0xd1a2('0x46')],qs['fields'](_0x20e3ec[_0xd1a2('0x48')][_0xd1a2('0x4c')]));_0x2846c2[_0xd1a2('0x4a')]=_0x2846c2[_0xd1a2('0x4a')][_0xd1a2('0x4d')]?_0x2846c2[_0xd1a2('0x4a')]:_0x31dc8d['model'];if(_0x20e3ec[_0xd1a2('0x48')][_0xd1a2('0x58')]){_0x2846c2[_0xd1a2('0x59')]=[{'all':!![]}];}_0x2846c2=_[_0xd1a2('0x55')]({},_0x2846c2,_0x20e3ec['options']);return db['MailAccount'][_0xd1a2('0x61')](_0x2846c2)[_0xd1a2('0x13')](handleEntityNotFound(_0x3d83ce,null))[_0xd1a2('0x13')](respondWithResult(_0x3d83ce,null))[_0xd1a2('0x5c')](handleError(_0x3d83ce,null));};exports[_0xd1a2('0x24')]=function(_0x3c0700,_0x55ef3c){if(_0x3c0700[_0xd1a2('0x62')]['id']){delete _0x3c0700[_0xd1a2('0x62')]['id'];}var _0x57c4eb=_0x3c0700[_0xd1a2('0x62')][_0xd1a2('0x63')]==='custom'?null:_0x3c0700['body'][_0xd1a2('0x63')];var _0x4743aa=_0x3c0700['body'][_0xd1a2('0x3e')]||{};var _0x413774=_0x3c0700[_0xd1a2('0x62')][_0xd1a2('0x3f')]||{};if(_0x57c4eb){_0x4743aa[_0xd1a2('0x3a')]=getImapHost(_0x57c4eb);_0x4743aa[_0xd1a2('0x3b')]=0x3e1;_0x413774['host']=getSmtpHost(_0x57c4eb);_0x413774[_0xd1a2('0x3b')]=0x24b;_0x413774[_0xd1a2('0x64')]=![];}if(_0x413774[_0xd1a2('0x38')]){_0x413774[_0xd1a2('0x64')]=![];}else{_0x413774[_0xd1a2('0x39')]=null;}if(!_0x4743aa[_0xd1a2('0x38')])_0x4743aa[_0xd1a2('0x39')]=null;_0x3c0700[_0xd1a2('0x62')]['Imap']=_0x4743aa;_0x3c0700[_0xd1a2('0x62')][_0xd1a2('0x3f')]=_0x413774;return db['MailAccount'][_0xd1a2('0x61')]({'where':{'id':_0x3c0700[_0xd1a2('0x5e')]['id']},'include':[{'model':db[_0xd1a2('0x40')],'as':_0xd1a2('0x3e')},{'model':db['MailServerOut'],'as':_0xd1a2('0x3f')},{'model':db[_0xd1a2('0x41')],'as':_0xd1a2('0x60')}]})[_0xd1a2('0x13')](handleEntityNotFound(_0x55ef3c,null))['then'](function(_0x39f72b){if(!_0x39f72b)throw new Error('Mail\x20Account\x20not\x20found');if(_0x39f72b[_0xd1a2('0x3c')])delete _0x3c0700[_0xd1a2('0x62')][_0xd1a2('0x3e')];return _0x39f72b;})[_0xd1a2('0x13')](saveUpdates(_0x3c0700[_0xd1a2('0x62')],null))[_0xd1a2('0x13')](function(_0x2bc910){if(!_0x3c0700[_0xd1a2('0x62')][_0xd1a2('0x3e')])return _0x2bc910;return db[_0xd1a2('0x40')][_0xd1a2('0x24')](_0x3c0700[_0xd1a2('0x62')][_0xd1a2('0x3e')],{'where':{'MailAccountId':_0x2bc910['id']}})[_0xd1a2('0x13')](function(){return _0x2bc910;});})[_0xd1a2('0x13')](function(_0x31327a){if(!_0x3c0700[_0xd1a2('0x62')][_0xd1a2('0x3f')])return _0x31327a;return db[_0xd1a2('0x5f')][_0xd1a2('0x24')](_0x3c0700[_0xd1a2('0x62')]['Smtp'],{'where':{'MailAccountId':_0x31327a['id']}})[_0xd1a2('0x13')](function(){return _0x31327a;});})[_0xd1a2('0x13')](respondWithResult(_0x55ef3c,null))[_0xd1a2('0x5c')](handleError(_0x55ef3c,null));};exports['describe']=function(_0x4af797,_0x706c65){return db[_0xd1a2('0x42')][_0xd1a2('0x65')]()[_0xd1a2('0x13')](respondWithResult(_0x706c65,null))[_0xd1a2('0x5c')](handleError(_0x706c65,null));};exports[_0xd1a2('0x66')]=function(_0x40f16a,_0x2b2ac6){if(_0x40f16a[_0xd1a2('0x62')]['id']){delete _0x40f16a[_0xd1a2('0x62')]['id'];}return db[_0xd1a2('0x42')]['find']({'where':{'id':_0x40f16a[_0xd1a2('0x5e')]['id']}})[_0xd1a2('0x13')](handleEntityNotFound(_0x2b2ac6,null))['then'](function(_0x428d13){if(_0x428d13){_0x40f16a[_0xd1a2('0x62')]['MailAccountId']=_0x428d13['id'];return db[_0xd1a2('0x67')][_0xd1a2('0x68')](_0x40f16a[_0xd1a2('0x62')]);}})['then'](respondWithResult(_0x2b2ac6,null))[_0xd1a2('0x5c')](handleError(_0x2b2ac6,null));};exports[_0xd1a2('0x69')]=function(_0x4b3330,_0x4cb247){var _0x197d80={'raw':![],'where':{}};var _0x354335={};var _0x2bd35e={'count':0x0,'rows':[]};return db['MailAccount'][_0xd1a2('0x6a')]({'where':{'id':_0x4b3330[_0xd1a2('0x5e')]['id']}})[_0xd1a2('0x13')](handleEntityNotFound(_0x4cb247,null))[_0xd1a2('0x13')](function(_0x54198f){if(_0x54198f){_0x354335['model']=_['keys'](db['Disposition'][_0xd1a2('0x43')]);_0x354335[_0xd1a2('0x48')]=_[_0xd1a2('0x47')](_0x4b3330[_0xd1a2('0x48')]);_0x354335[_0xd1a2('0x49')]=_[_0xd1a2('0x4b')](_0x354335[_0xd1a2('0x46')],_0x354335[_0xd1a2('0x48')]);_0x197d80[_0xd1a2('0x4a')]=_[_0xd1a2('0x4b')](_0x354335['model'],qs[_0xd1a2('0x4c')](_0x4b3330[_0xd1a2('0x48')]['fields']));_0x197d80[_0xd1a2('0x4a')]=_0x197d80[_0xd1a2('0x4a')][_0xd1a2('0x4d')]?_0x197d80[_0xd1a2('0x4a')]:_0x354335['model'];if(!_0x4b3330[_0xd1a2('0x48')][_0xd1a2('0x4e')](_0xd1a2('0x4f'))){_0x197d80[_0xd1a2('0x21')]=qs[_0xd1a2('0x21')](_0x4b3330[_0xd1a2('0x48')]['limit']);_0x197d80['offset']=qs[_0xd1a2('0x20')](_0x4b3330[_0xd1a2('0x48')][_0xd1a2('0x20')]);}_0x197d80[_0xd1a2('0x50')]=qs['sort'](_0x4b3330['query'][_0xd1a2('0x51')]);_0x197d80[_0xd1a2('0x52')]=qs['filters'](_[_0xd1a2('0x53')](_0x4b3330[_0xd1a2('0x48')],_0x354335[_0xd1a2('0x49')]));_0x197d80[_0xd1a2('0x52')][_0xd1a2('0x6b')]=_0x54198f['id'];if(_0x4b3330[_0xd1a2('0x48')]['filter']){_0x197d80[_0xd1a2('0x52')]=_[_0xd1a2('0x55')](_0x197d80[_0xd1a2('0x52')],{'$or':_[_0xd1a2('0x56')](_0x197d80['attributes'],function(_0x143072){var _0x1110fe={};_0x1110fe[_0x143072]={'$like':'%'+_0x4b3330[_0xd1a2('0x48')][_0xd1a2('0x54')]+'%'};return _0x1110fe;})});}_0x197d80=_[_0xd1a2('0x55')]({},_0x197d80,_0x4b3330[_0xd1a2('0x6c')]);return db[_0xd1a2('0x67')][_0xd1a2('0x22')]({'where':_0x197d80['where']})['then'](function(_0x542511){_0x2bd35e[_0xd1a2('0x22')]=_0x542511;if(_0x4b3330[_0xd1a2('0x48')]['includeAll']){_0x197d80[_0xd1a2('0x59')]=[{'all':!![]}];}return db[_0xd1a2('0x67')][_0xd1a2('0x5a')](_0x197d80);})[_0xd1a2('0x13')](function(_0x58fdeb){_0x2bd35e[_0xd1a2('0x5b')]=_0x58fdeb;return _0x2bd35e;});}})['then'](respondWithFilteredResult(_0x4cb247,_0x197d80))[_0xd1a2('0x5c')](handleError(_0x4cb247,null));};exports[_0xd1a2('0x6d')]=function(_0x454bb4,_0x39ad17){return db['MailAccount'][_0xd1a2('0x61')]({'where':{'id':_0x454bb4[_0xd1a2('0x5e')]['id']}})[_0xd1a2('0x13')](handleEntityNotFound(_0x39ad17,null))[_0xd1a2('0x13')](function(_0x1a6876){if(_0x1a6876){return _0x1a6876['removeDispositions'](_0x454bb4['query'][_0xd1a2('0x6e')]);}})['then'](respondWithStatusCode(_0x39ad17,null))['catch'](handleError(_0x39ad17,null));};exports[_0xd1a2('0x6f')]=function(_0x7d327e,_0x19714f){if(_0x7d327e[_0xd1a2('0x62')]['id']){delete _0x7d327e[_0xd1a2('0x62')]['id'];}return db[_0xd1a2('0x42')][_0xd1a2('0x61')]({'where':{'id':_0x7d327e[_0xd1a2('0x5e')]['id']}})[_0xd1a2('0x13')](handleEntityNotFound(_0x19714f,null))['then'](function(_0x27a45a){if(_0x27a45a){_0x7d327e[_0xd1a2('0x62')][_0xd1a2('0x6b')]=_0x27a45a['id'];return db['CannedAnswer'][_0xd1a2('0x68')](_0x7d327e[_0xd1a2('0x62')]);}})[_0xd1a2('0x13')](respondWithResult(_0x19714f,null))['catch'](handleError(_0x19714f,null));};exports['getAnswers']=function(_0x526f77,_0x2556fd){var _0x527c47={'raw':![],'where':{}};var _0x9e5a0f={};var _0x212ee5={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x526f77[_0xd1a2('0x5e')]['id']}})[_0xd1a2('0x13')](handleEntityNotFound(_0x2556fd,null))[_0xd1a2('0x13')](function(_0x4bcc59){if(_0x4bcc59){_0x9e5a0f['model']=_[_0xd1a2('0x47')](db[_0xd1a2('0x70')][_0xd1a2('0x43')]);_0x9e5a0f[_0xd1a2('0x48')]=_[_0xd1a2('0x47')](_0x526f77[_0xd1a2('0x48')]);_0x9e5a0f[_0xd1a2('0x49')]=_[_0xd1a2('0x4b')](_0x9e5a0f[_0xd1a2('0x46')],_0x9e5a0f[_0xd1a2('0x48')]);_0x527c47['attributes']=_[_0xd1a2('0x4b')](_0x9e5a0f[_0xd1a2('0x46')],qs['fields'](_0x526f77[_0xd1a2('0x48')][_0xd1a2('0x4c')]));_0x527c47[_0xd1a2('0x4a')]=_0x527c47['attributes'][_0xd1a2('0x4d')]?_0x527c47[_0xd1a2('0x4a')]:_0x9e5a0f[_0xd1a2('0x46')];if(!_0x526f77[_0xd1a2('0x48')][_0xd1a2('0x4e')](_0xd1a2('0x4f'))){_0x527c47[_0xd1a2('0x21')]=qs[_0xd1a2('0x21')](_0x526f77[_0xd1a2('0x48')][_0xd1a2('0x21')]);_0x527c47['offset']=qs[_0xd1a2('0x20')](_0x526f77['query'][_0xd1a2('0x20')]);}_0x527c47[_0xd1a2('0x50')]=qs[_0xd1a2('0x51')](_0x526f77[_0xd1a2('0x48')][_0xd1a2('0x51')]);_0x527c47[_0xd1a2('0x52')]=qs[_0xd1a2('0x49')](_[_0xd1a2('0x53')](_0x526f77[_0xd1a2('0x48')],_0x9e5a0f[_0xd1a2('0x49')]));_0x527c47[_0xd1a2('0x52')][_0xd1a2('0x6b')]=_0x4bcc59['id'];if(_0x526f77[_0xd1a2('0x48')][_0xd1a2('0x54')]){_0x527c47[_0xd1a2('0x52')]=_[_0xd1a2('0x55')](_0x527c47[_0xd1a2('0x52')],{'$or':_[_0xd1a2('0x56')](_0x527c47[_0xd1a2('0x4a')],function(_0x17d1b6){var _0x5ef4ae={};_0x5ef4ae[_0x17d1b6]={'$like':'%'+_0x526f77[_0xd1a2('0x48')]['filter']+'%'};return _0x5ef4ae;})});}_0x527c47=_[_0xd1a2('0x55')]({},_0x527c47,_0x526f77[_0xd1a2('0x6c')]);return db[_0xd1a2('0x70')][_0xd1a2('0x22')]({'where':_0x527c47['where']})[_0xd1a2('0x13')](function(_0x4b1782){_0x212ee5['count']=_0x4b1782;if(_0x526f77[_0xd1a2('0x48')][_0xd1a2('0x58')]){_0x527c47[_0xd1a2('0x59')]=[{'all':!![]}];}return db[_0xd1a2('0x70')][_0xd1a2('0x5a')](_0x527c47);})[_0xd1a2('0x13')](function(_0x236062){_0x212ee5[_0xd1a2('0x5b')]=_0x236062;return _0x212ee5;});}})[_0xd1a2('0x13')](respondWithFilteredResult(_0x2556fd,_0x527c47))[_0xd1a2('0x5c')](handleError(_0x2556fd,null));};exports[_0xd1a2('0x71')]=function(_0x39e324,_0x31305f){return db[_0xd1a2('0x42')][_0xd1a2('0x61')]({'where':{'id':_0x39e324[_0xd1a2('0x5e')]['id']}})[_0xd1a2('0x13')](handleEntityNotFound(_0x31305f,null))[_0xd1a2('0x13')](function(_0x53df3d){if(_0x53df3d){return _0x53df3d[_0xd1a2('0x71')](_0x39e324[_0xd1a2('0x48')][_0xd1a2('0x6e')]);}})[_0xd1a2('0x13')](respondWithStatusCode(_0x31305f,null))[_0xd1a2('0x5c')](handleError(_0x31305f,null));};exports[_0xd1a2('0x68')]=function(_0x3877a0,_0x128fb2){var _0x14de08={'name':_0x3877a0[_0xd1a2('0x62')][_0xd1a2('0x27')],'key':_0x3877a0['body'][_0xd1a2('0x72')],'provider':_0x3877a0[_0xd1a2('0x62')]['provider']===_0xd1a2('0x73')?null:_0x3877a0[_0xd1a2('0x62')]['provider'],'email':_0x3877a0[_0xd1a2('0x62')][_0xd1a2('0x74')],'ListId':_0x3877a0['body'][_0xd1a2('0x75')],'active':!_[_0xd1a2('0x76')](_0x3877a0['body'][_0xd1a2('0x77')])?_0x3877a0['body']['active']:!![],'description':_0x3877a0['body'][_0xd1a2('0x78')]||null};var _0x1f5931=getAuthenticationOptions(_0x14de08[_0xd1a2('0x63')],_0x3877a0[_0xd1a2('0x62')]);_0x14de08[_0xd1a2('0x3e')]=_0x1f5931[_0xd1a2('0x3e')];_0x14de08[_0xd1a2('0x3f')]=_0x1f5931[_0xd1a2('0x3f')];return db['MailAccount'][_0xd1a2('0x68')](_0x14de08,{'include':[{'model':db[_0xd1a2('0x5f')],'as':_0xd1a2('0x3f')},{'model':db[_0xd1a2('0x40')],'as':_0xd1a2('0x3e')}]})[_0xd1a2('0x13')](function(_0x1106e9){var _0x2ccd84=_0x3877a0[_0xd1a2('0x34')][_0xd1a2('0x26')]({'plain':!![]});if(!_0x2ccd84)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2ccd84[_0xd1a2('0x79')]===_0xd1a2('0x34')){var _0x3329d7=_0x1106e9[_0xd1a2('0x26')]({'plain':!![]});return db[_0xd1a2('0x7a')]['find']({'where':{'name':_0xd1a2('0x7b'),'userProfileId':_0x2ccd84[_0xd1a2('0x7c')]},'raw':!![]})[_0xd1a2('0x13')](function(_0x358956){if(_0x358956&&_0x358956['autoAssociation']===0x0){return db[_0xd1a2('0x7d')][_0xd1a2('0x68')]({'name':_0x3329d7[_0xd1a2('0x27')],'resourceId':_0x3329d7['id'],'type':_0x358956['name'],'sectionId':_0x358956['id']},{})[_0xd1a2('0x13')](function(){return _0x1106e9;});}else{return _0x1106e9;}})[_0xd1a2('0x5c')](function(_0x5882fd){logger[_0xd1a2('0x19')](_0xd1a2('0x7e'),_0x5882fd);throw _0x5882fd;});}return _0x1106e9;})['then'](respondWithResult(_0x128fb2,0xc9))[_0xd1a2('0x5c')](handleError(_0x128fb2,null));};exports[_0xd1a2('0x7f')]=function(_0xa2698a,_0x363b68){return db['MailAccount'][_0xd1a2('0x6a')]({'where':{'id':_0xa2698a[_0xd1a2('0x5e')]['id']}})[_0xd1a2('0x13')](handleEntityNotFound(_0x363b68,null))[_0xd1a2('0x13')](function(_0x433bb7){if(_0x433bb7){return _0x433bb7[_0xd1a2('0x7f')]();}return null;})[_0xd1a2('0x13')](respondWithResult(_0x363b68,null))['catch'](handleError(_0x363b68,null));};exports[_0xd1a2('0x80')]=function(_0x4bfe1d,_0x3db08b){if(_0x4bfe1d[_0xd1a2('0x62')]['id']){delete _0x4bfe1d[_0xd1a2('0x62')]['id'];}return db[_0xd1a2('0x42')][_0xd1a2('0x61')]({'where':{'id':_0x4bfe1d[_0xd1a2('0x5e')]['id']}})[_0xd1a2('0x13')](handleEntityNotFound(_0x3db08b,null))[_0xd1a2('0x13')](function(_0x49ff7b){if(_0x49ff7b){_0x4bfe1d['body'][_0xd1a2('0x6b')]=_0x49ff7b['id'];return db['MailServerIn'][_0xd1a2('0x68')](_0x4bfe1d[_0xd1a2('0x62')]);}})[_0xd1a2('0x13')](respondWithResult(_0x3db08b,null))['catch'](handleError(_0x3db08b,null));};exports[_0xd1a2('0x81')]=function(_0x5e1406,_0x3ccfaa){return db[_0xd1a2('0x42')][_0xd1a2('0x6a')]({'where':{'id':_0x5e1406[_0xd1a2('0x5e')]['id']}})[_0xd1a2('0x13')](handleEntityNotFound(_0x3ccfaa,null))[_0xd1a2('0x13')](function(_0x5c9ef5){if(_0x5c9ef5){return _0x5c9ef5['setImap'](null);}return null;})['then'](respondWithStatusCode(_0x3ccfaa,null))[_0xd1a2('0x5c')](handleError(_0x3ccfaa,null));};exports[_0xd1a2('0x82')]=function(_0x18160d,_0x304756){return db[_0xd1a2('0x42')][_0xd1a2('0x6a')]({'where':{'id':_0x18160d['params']['id']}})[_0xd1a2('0x13')](handleEntityNotFound(_0x304756,null))[_0xd1a2('0x13')](function(_0x11b067){if(_0x11b067){return _0x11b067[_0xd1a2('0x82')]();}return null;})['then'](respondWithResult(_0x304756,null))[_0xd1a2('0x5c')](handleError(_0x304756,null));};exports[_0xd1a2('0x83')]=function(_0x53148a,_0xa9888c){if(_0x53148a[_0xd1a2('0x62')]['id']){delete _0x53148a[_0xd1a2('0x62')]['id'];}return db[_0xd1a2('0x42')]['find']({'where':{'id':_0x53148a['params']['id']}})[_0xd1a2('0x13')](handleEntityNotFound(_0xa9888c,null))[_0xd1a2('0x13')](function(_0x4c80b9){if(_0x4c80b9){_0x53148a['body']['MailAccountId']=_0x4c80b9['id'];return db[_0xd1a2('0x5f')][_0xd1a2('0x68')](_0x53148a[_0xd1a2('0x62')]);}})[_0xd1a2('0x13')](respondWithResult(_0xa9888c,null))[_0xd1a2('0x5c')](handleError(_0xa9888c,null));};exports[_0xd1a2('0x84')]=function(_0x320b57,_0x24d2f2){return db[_0xd1a2('0x42')][_0xd1a2('0x6a')]({'where':{'id':_0x320b57[_0xd1a2('0x5e')]['id']}})[_0xd1a2('0x13')](handleEntityNotFound(_0x24d2f2,null))[_0xd1a2('0x13')](function(_0x175a70){if(_0x175a70){return _0x175a70['setSmtp'](null);}return null;})['then'](respondWithStatusCode(_0x24d2f2,null))[_0xd1a2('0x5c')](handleError(_0x24d2f2,null));};exports[_0xd1a2('0x85')]=function(_0x1761a1,_0x1b8b1a){return db[_0xd1a2('0x86')][_0xd1a2('0x61')]({'where':{'id':_0x1761a1[_0xd1a2('0x5e')]['id']}})[_0xd1a2('0x13')](handleEntityNotFound(_0x1b8b1a,null))[_0xd1a2('0x13')](function(_0x5693da){if(_0x5693da){return _0x5693da[_0xd1a2('0x85')](_0x1761a1[_0xd1a2('0x62')][_0xd1a2('0x6e')],_['omit'](_0x1761a1['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x1b8b1a,null))[_0xd1a2('0x5c')](handleError(_0x1b8b1a,null));};exports[_0xd1a2('0x87')]=function(_0x2b9350,_0x4a4e6d){var _0x273db5={'raw':![],'where':{}};var _0x30c06a={};var _0x36d381={'count':0x0,'rows':[]};return db[_0xd1a2('0x42')][_0xd1a2('0x6a')]({'where':{'id':_0x2b9350[_0xd1a2('0x5e')]['id']}})[_0xd1a2('0x13')](handleEntityNotFound(_0x4a4e6d,null))[_0xd1a2('0x13')](function(_0x49c88e){if(_0x49c88e){_0x30c06a['model']=_[_0xd1a2('0x47')](db[_0xd1a2('0x86')][_0xd1a2('0x43')]);_0x30c06a[_0xd1a2('0x48')]=_[_0xd1a2('0x47')](_0x2b9350[_0xd1a2('0x48')]);_0x30c06a[_0xd1a2('0x49')]=_[_0xd1a2('0x4b')](_0x30c06a[_0xd1a2('0x46')],_0x30c06a[_0xd1a2('0x48')]);_0x273db5[_0xd1a2('0x4a')]=_[_0xd1a2('0x4b')](_0x30c06a[_0xd1a2('0x46')],qs[_0xd1a2('0x4c')](_0x2b9350['query']['fields']));_0x273db5[_0xd1a2('0x4a')]=_0x273db5[_0xd1a2('0x4a')][_0xd1a2('0x4d')]?_0x273db5[_0xd1a2('0x4a')]:_0x30c06a[_0xd1a2('0x46')];if(!_0x2b9350[_0xd1a2('0x48')]['hasOwnProperty']('nolimit')){_0x273db5[_0xd1a2('0x21')]=qs[_0xd1a2('0x21')](_0x2b9350['query'][_0xd1a2('0x21')]);_0x273db5[_0xd1a2('0x20')]=qs[_0xd1a2('0x20')](_0x2b9350[_0xd1a2('0x48')][_0xd1a2('0x20')]);}_0x273db5[_0xd1a2('0x50')]=qs[_0xd1a2('0x51')](_0x2b9350[_0xd1a2('0x48')][_0xd1a2('0x51')]);_0x273db5[_0xd1a2('0x52')]=qs[_0xd1a2('0x49')](_['pick'](_0x2b9350[_0xd1a2('0x48')],_0x30c06a[_0xd1a2('0x49')]));_0x273db5[_0xd1a2('0x52')][_0xd1a2('0x6b')]=_0x49c88e['id'];if(_0x2b9350[_0xd1a2('0x48')][_0xd1a2('0x54')]){_0x273db5[_0xd1a2('0x52')]=_[_0xd1a2('0x55')](_0x273db5[_0xd1a2('0x52')],{'$or':_[_0xd1a2('0x56')](_0x273db5[_0xd1a2('0x4a')],function(_0xce3437){var _0x40a3f7={};_0x40a3f7[_0xce3437]={'$like':'%'+_0x2b9350[_0xd1a2('0x48')][_0xd1a2('0x54')]+'%'};return _0x40a3f7;})});}_0x273db5=_[_0xd1a2('0x55')]({},_0x273db5,_0x2b9350[_0xd1a2('0x6c')]);return db[_0xd1a2('0x86')]['count']({'where':_0x273db5[_0xd1a2('0x52')]})['then'](function(_0x424cbb){_0x36d381[_0xd1a2('0x22')]=_0x424cbb;if(_0x2b9350[_0xd1a2('0x48')]['includeAll']){_0x273db5[_0xd1a2('0x59')]=[{'model':db[_0xd1a2('0x88')],'as':_0xd1a2('0x89'),'required':![]},{'model':db[_0xd1a2('0x8a')],'as':_0xd1a2('0x8b'),'attributes':[_0xd1a2('0x27'),_0xd1a2('0x8c'),_0xd1a2('0x8d')],'required':![]},{'model':db[_0xd1a2('0x8e')],'as':_0xd1a2('0x8f'),'attributes':['id',_0xd1a2('0x27'),'color'],'where':_0x2b9350['query']['tag']?{'id':_0x2b9350[_0xd1a2('0x48')][_0xd1a2('0x90')]}:undefined,'required':_0x2b9350[_0xd1a2('0x48')][_0xd1a2('0x90')]?!![]:![]}];}return db[_0xd1a2('0x86')]['findAll'](_0x273db5);})[_0xd1a2('0x13')](function(_0x352576){_0x36d381['rows']=_0x352576;return _0x36d381;});}})[_0xd1a2('0x13')](respondWithFilteredResult(_0x4a4e6d,_0x273db5))['catch'](handleError(_0x4a4e6d,null));};exports['addApplications']=function addApplications(_0x2d2164,_0x514767){var _0x604aa2=_0x2d2164['params']['id'];var _0xbf6e62=_0x2d2164[_0xd1a2('0x62')];var _0x3f0c42=0xc8;var _0x175504=null;return db[_0xd1a2('0x91')][_0xd1a2('0x92')]({'isolationLevel':db[_0xd1a2('0x91')][_0xd1a2('0x93')]['ISOLATION_LEVELS'][_0xd1a2('0x94')]},function(_0xf6a531){return db['MailAccount'][_0xd1a2('0x6a')]({'where':{'id':_0x604aa2},'transaction':_0xf6a531})[_0xd1a2('0x13')](function(_0x480cef){if(_0x480cef){return db[_0xd1a2('0x95')][_0xd1a2('0x25')]({'where':{'MailAccountId':_0x604aa2},'transaction':_0xf6a531})[_0xd1a2('0x13')](function(){var _0x1fc9cd=_['map'](_0xbf6e62,function(_0x5867aa){_0x5867aa[_0xd1a2('0x6b')]=_0x604aa2;return _0x5867aa;});return db['MailApplication'][_0xd1a2('0x96')](_0x1fc9cd,{'transaction':_0xf6a531});});}else{_0x3f0c42=0x194;_0x175504=[];}});})[_0xd1a2('0x13')](function(){if(_0x3f0c42!==0x194){return db[_0xd1a2('0x95')][_0xd1a2('0x97')]({'where':{'MailAccountId':_0x604aa2},'order':'priority'})[_0xd1a2('0x13')](function(_0x2b449c){_0x175504=_0x2b449c;});}})['catch'](function(_0x5dfbb0){_0x3f0c42=0x1f4;logger[_0xd1a2('0x19')](_0x5dfbb0[_0xd1a2('0x98')]);if(_0x5dfbb0[_0xd1a2('0x27')]){delete _0x5dfbb0[_0xd1a2('0x27')];}_0x175504=_0x5dfbb0;})[_0xd1a2('0x99')](function(){if(_0x175504===null){_0x514767['sendStatus'](_0x3f0c42);}else{if(_0x3f0c42===0x1f4){_0x514767[_0xd1a2('0x1d')](_0x3f0c42)[_0xd1a2('0x9a')](_0x175504);}else{_0x514767[_0xd1a2('0x1d')](_0x3f0c42)['json'](_0x175504);}}});};exports[_0xd1a2('0x9b')]=function(_0x260a26,_0x16a496){var _0x2ba93e={};var _0xaf1256={};var _0x43bfc4;var _0x3ca349;return db[_0xd1a2('0x42')][_0xd1a2('0x6a')]({'where':{'id':_0x260a26[_0xd1a2('0x5e')]['id']}})[_0xd1a2('0x13')](handleEntityNotFound(_0x16a496,null))[_0xd1a2('0x13')](function(_0x484967){if(_0x484967){_0x43bfc4=_0x484967;_0xaf1256[_0xd1a2('0x46')]=_[_0xd1a2('0x47')](db[_0xd1a2('0x95')][_0xd1a2('0x43')]);_0xaf1256[_0xd1a2('0x48')]=_[_0xd1a2('0x47')](_0x260a26[_0xd1a2('0x48')]);_0xaf1256[_0xd1a2('0x49')]=_[_0xd1a2('0x4b')](_0xaf1256[_0xd1a2('0x46')],_0xaf1256['query']);_0x2ba93e[_0xd1a2('0x4a')]=_[_0xd1a2('0x4b')](_0xaf1256[_0xd1a2('0x46')],qs[_0xd1a2('0x4c')](_0x260a26['query'][_0xd1a2('0x4c')]));_0x2ba93e['attributes']=_0x2ba93e['attributes']['length']?_0x2ba93e[_0xd1a2('0x4a')]:_0xaf1256[_0xd1a2('0x46')];_0x2ba93e[_0xd1a2('0x50')]=qs[_0xd1a2('0x51')](_0x260a26['query'][_0xd1a2('0x51')]);_0x2ba93e[_0xd1a2('0x52')]=qs['filters'](_[_0xd1a2('0x53')](_0x260a26['query'],_0xaf1256[_0xd1a2('0x49')]));if(_0x260a26[_0xd1a2('0x48')]['filter']){_0x2ba93e[_0xd1a2('0x52')]=_[_0xd1a2('0x55')](_0x2ba93e[_0xd1a2('0x52')],{'$or':_[_0xd1a2('0x56')](_0x2ba93e[_0xd1a2('0x4a')],function(_0x455d86){var _0x494961={};_0x494961[_0x455d86]={'$like':'%'+_0x260a26['query']['filter']+'%'};return _0x494961;})});}_0x2ba93e=_[_0xd1a2('0x55')]({},_0x2ba93e,_0x260a26['options']);return _0x43bfc4[_0xd1a2('0x9b')](_0x2ba93e);}})[_0xd1a2('0x13')](function(_0x3e9277){if(_0x3e9277){_0x3ca349=_0x3e9277[_0xd1a2('0x4d')];if(!_0x260a26['query'][_0xd1a2('0x4e')](_0xd1a2('0x4f'))){_0x2ba93e[_0xd1a2('0x21')]=qs[_0xd1a2('0x21')](_0x260a26[_0xd1a2('0x48')][_0xd1a2('0x21')]);_0x2ba93e['offset']=qs[_0xd1a2('0x20')](_0x260a26[_0xd1a2('0x48')][_0xd1a2('0x20')]);}return _0x43bfc4['getApplications'](_0x2ba93e);}})[_0xd1a2('0x13')](function(_0x4e516c){if(_0x4e516c){return _0x4e516c?{'count':_0x3ca349,'rows':_0x4e516c}:null;}})[_0xd1a2('0x13')](respondWithResult(_0x16a496,null))['catch'](handleError(_0x16a496,null));};exports['getMessages']=function(_0x48199f,_0x34afc9){var _0x40ed9e={'raw':!![],'where':{}};var _0x287a14={};var _0x3496fe={'count':0x0,'rows':[]};return db[_0xd1a2('0x42')][_0xd1a2('0x6a')]({'where':{'id':_0x48199f['params']['id']}})[_0xd1a2('0x13')](handleEntityNotFound(_0x34afc9,null))[_0xd1a2('0x13')](function(_0x4e4e85){if(_0x4e4e85){_0x287a14[_0xd1a2('0x46')]=_['keys'](db[_0xd1a2('0x9c')][_0xd1a2('0x43')]);_0x287a14[_0xd1a2('0x48')]=_[_0xd1a2('0x47')](_0x48199f[_0xd1a2('0x48')]);_0x287a14[_0xd1a2('0x49')]=_['intersection'](_0x287a14[_0xd1a2('0x46')],_0x287a14[_0xd1a2('0x48')]);_0x40ed9e[_0xd1a2('0x4a')]=_['intersection'](_0x287a14['model'],qs[_0xd1a2('0x4c')](_0x48199f[_0xd1a2('0x48')][_0xd1a2('0x4c')]));_0x40ed9e[_0xd1a2('0x4a')]=_0x40ed9e[_0xd1a2('0x4a')][_0xd1a2('0x4d')]?_0x40ed9e[_0xd1a2('0x4a')]:_0x287a14[_0xd1a2('0x46')];if(!_0x48199f[_0xd1a2('0x48')][_0xd1a2('0x4e')](_0xd1a2('0x4f'))){_0x40ed9e[_0xd1a2('0x21')]=qs['limit'](_0x48199f[_0xd1a2('0x48')][_0xd1a2('0x21')]);_0x40ed9e[_0xd1a2('0x20')]=qs[_0xd1a2('0x20')](_0x48199f[_0xd1a2('0x48')][_0xd1a2('0x20')]);}_0x40ed9e[_0xd1a2('0x50')]=qs[_0xd1a2('0x51')](_0x48199f[_0xd1a2('0x48')][_0xd1a2('0x51')]);_0x40ed9e[_0xd1a2('0x52')]=qs['filters'](_[_0xd1a2('0x53')](_0x48199f[_0xd1a2('0x48')],_0x287a14[_0xd1a2('0x49')]));_0x40ed9e[_0xd1a2('0x52')]['MailAccountId']=_0x4e4e85['id'];if(_0x48199f[_0xd1a2('0x48')]['filter']){_0x40ed9e[_0xd1a2('0x52')]=_[_0xd1a2('0x55')](_0x40ed9e[_0xd1a2('0x52')],{'$or':_[_0xd1a2('0x56')](_0x40ed9e[_0xd1a2('0x4a')],function(_0x2e6302){var _0x3cf48c={};_0x3cf48c[_0x2e6302]={'$like':'%'+_0x48199f['query'][_0xd1a2('0x54')]+'%'};return _0x3cf48c;})});}if(_0x48199f[_0xd1a2('0x48')]['$gte']){var _0x12172d=_0x48199f[_0xd1a2('0x48')][_0xd1a2('0x9d')][_0xd1a2('0x9e')](',');var _0x68c4e2={};_0x68c4e2[_0x12172d[0x0]]={'$gte':moment(_0x12172d[0x1])[_0xd1a2('0x9f')](_0xd1a2('0xa0'))};_0x40ed9e[_0xd1a2('0x52')]=_[_0xd1a2('0x55')](_0x40ed9e[_0xd1a2('0x52')],_0x68c4e2);}_0x40ed9e=_[_0xd1a2('0x55')]({},_0x40ed9e,_0x48199f[_0xd1a2('0x6c')]);return db[_0xd1a2('0x9c')][_0xd1a2('0x22')]({'where':_0x40ed9e['where']})[_0xd1a2('0x13')](function(_0x42e145){_0x3496fe[_0xd1a2('0x22')]=_0x42e145;if(_0x48199f[_0xd1a2('0x48')][_0xd1a2('0x58')]){_0x40ed9e[_0xd1a2('0x59')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x40ed9e);})[_0xd1a2('0x13')](function(_0x33126b){if(_0x48199f[_0xd1a2('0x48')][_0xd1a2('0xa1')]===_0xd1a2('0xa2')){for(var _0x1f4e7e=0x0;_0x1f4e7e<_0x33126b[_0xd1a2('0x4d')];_0x1f4e7e++){_0x33126b[_0x1f4e7e][_0xd1a2('0x62')]=juice(_0x33126b[_0x1f4e7e][_0xd1a2('0x62')]);}}_0x3496fe[_0xd1a2('0x5b')]=_0x33126b;return _0x3496fe;});}})['then'](respondWithFilteredResult(_0x34afc9,_0x40ed9e))[_0xd1a2('0x5c')](handleError(_0x34afc9,null));};exports[_0xd1a2('0x9a')]=function(_0x193f90,_0x4b1a2e){var _0x33a7e1,_0x3fbbfe={},_0x400e40;if(_0x193f90[_0xd1a2('0x62')]['to']){_0x400e40=_0x193f90[_0xd1a2('0x62')]['to'][_0xd1a2('0x9e')](',')[0x0];}return db['MailAccount'][_0xd1a2('0x61')]({'where':{'id':_0x193f90['params']['id']},'include':[{'model':db[_0xd1a2('0xa3')],'as':'List','include':[{'model':db[_0xd1a2('0x88')],'as':'Contacts','where':{'email':_0x400e40},'limit':0x1,'order':[['updatedAt',_0xd1a2('0xa4')]]}]},{'model':db[_0xd1a2('0x5f')],'as':_0xd1a2('0x3f'),'raw':!![],'include':[{'model':db[_0xd1a2('0xa5')],'as':_0xd1a2('0xa5'),'raw':!![]}]}]})[_0xd1a2('0x13')](handleEntityNotFound(_0x4b1a2e,null))[_0xd1a2('0x13')](function(_0x5626a7){if(!_0x5626a7)return;_0x33a7e1=_0x5626a7;if(!_0x5626a7[_0xd1a2('0x3f')])throw new Error(_0xd1a2('0xa6'));if(_[_0xd1a2('0x76')](_0x193f90[_0xd1a2('0x62')]['from'])){_0x193f90[_0xd1a2('0x62')][_0xd1a2('0xa7')]=util[_0xd1a2('0x9f')](_0xd1a2('0xa8'),_0x5626a7[_0xd1a2('0x27')],_0x5626a7[_0xd1a2('0x74')]||_0x5626a7[_0xd1a2('0x3f')][_0xd1a2('0x34')]);}if(_0x193f90[_0xd1a2('0x62')][_0xd1a2('0xa9')]&&_0x193f90[_0xd1a2('0x62')][_0xd1a2('0xa9')][_0xd1a2('0x4d')]){for(var _0x3d770b=0x0;_0x3d770b<_0x193f90[_0xd1a2('0x62')][_0xd1a2('0xa9')][_0xd1a2('0x4d')];_0x3d770b+=0x1){_0x193f90[_0xd1a2('0x62')][_0xd1a2('0xa9')][_0x3d770b]={'filename':_0x193f90[_0xd1a2('0x62')][_0xd1a2('0xa9')][_0x3d770b][_0xd1a2('0x27')],'path':path['join'](config[_0xd1a2('0xaa')],_0xd1a2('0xab'),_0x193f90['body'][_0xd1a2('0xa9')][_0x3d770b][_0xd1a2('0xac')])};}}var _0x5344fa=_0x5626a7['getSmtpOptions']();return respondWithRpcPromise(_0xd1a2('0xad'),_0xd1a2('0xae'),{'account':_0x5344fa,'message':_0x193f90['body']});})[_0xd1a2('0x13')](function(_0x57d030){if(!_0x57d030)return;_0x3fbbfe=_0x57d030;if(!_0x33a7e1[_0xd1a2('0xaf')])throw new Error(_0xd1a2('0xb0'));if(_0x33a7e1[_0xd1a2('0xaf')]['Contacts'][_0xd1a2('0x4d')])return _0x33a7e1['List'][_0xd1a2('0xb1')][0x0];return db[_0xd1a2('0x88')][_0xd1a2('0x68')](_[_0xd1a2('0xa')](_0x193f90['body'],{'firstName':_0x193f90[_0xd1a2('0x62')]['to'],'email':_0x193f90[_0xd1a2('0x62')]['to'],'phone':_0x193f90[_0xd1a2('0x62')]['to'],'ListId':_0x33a7e1[_0xd1a2('0x75')]}));})['then'](function(_0x4dc266){if(!_0x4dc266)return;var _0x3e5a4e={'UserId':_0x193f90[_0xd1a2('0x34')]['id'],'ContactId':_0x4dc266['id'],'MailAccountId':_0x33a7e1['id'],'inReplyTo':_0x3fbbfe['messageId'],'to':_0x193f90[_0xd1a2('0x62')]['from'],'cc':_0x193f90[_0xd1a2('0x62')]['cc'],'subject':_0x193f90['body']['subject'],'attach':_0x193f90['body']['attach'],'firstMsgDirection':_0xd1a2('0xb2'),'lastMsgAt':moment()[_0xd1a2('0x9f')](_0xd1a2('0xa0')),'lastMsgDirection':'out','Messages':[_[_0xd1a2('0x55')](_0x193f90[_0xd1a2('0x62')],{'messageId':_0x3fbbfe[_0xd1a2('0xb3')],'sentAt':moment()[_0xd1a2('0x9f')](_0xd1a2('0xa0')),'read':!![],'MailAccountId':_0x33a7e1['id'],'UserId':_0x193f90[_0xd1a2('0x34')]['id'],'ContactId':_0x4dc266['id']})]};if(_0x193f90[_0xd1a2('0x62')][_0xd1a2('0xb4')]){_0x3e5a4e=_['merge'](_0x3e5a4e,_0x193f90[_0xd1a2('0x62')][_0xd1a2('0xb4')]);}return db[_0xd1a2('0x86')][_0xd1a2('0x68')](_0x3e5a4e,{'include':[{'model':db['MailMessage'],'as':_0xd1a2('0xb5')}]});})['then'](respondWithResult(_0x4b1a2e,null))['catch'](handleError(_0x4b1a2e,null));};exports['verifySmtp']=function(_0x111a39,_0x29e3be){return db[_0xd1a2('0x42')][_0xd1a2('0x61')]({'where':{'id':_0x111a39[_0xd1a2('0x5e')]['id']},'include':[{'model':db[_0xd1a2('0x5f')],'as':_0xd1a2('0x3f'),'raw':!![],'include':[{'model':db[_0xd1a2('0xa5')],'as':_0xd1a2('0xa5'),'raw':!![]}]}]})[_0xd1a2('0x13')](handleEntityNotFound(_0x29e3be,null))['then'](function(_0x48b7d9){if(!_0x48b7d9[_0xd1a2('0x3f')])return;var _0x1db8e3=_0x48b7d9[_0xd1a2('0xb6')]();return respondWithRpcPromise(_0xd1a2('0xb7'),_0xd1a2('0xb8'),{'account':_0x1db8e3});})[_0xd1a2('0x13')](respondWithResult(_0x29e3be,null))['catch'](handleError(_0x29e3be,null));};exports['destroy']=function(_0x55eb86,_0x1152f6){return db['MailAccount'][_0xd1a2('0x61')]({'where':{'id':_0x55eb86[_0xd1a2('0x5e')]['id']}})[_0xd1a2('0x13')](handleEntityNotFound(_0x1152f6,null))['then'](function(_0x34db7a){if(_0x34db7a&&_0x34db7a[_0xd1a2('0x3c')]){throw new db['Sequelize'][(_0xd1a2('0xb9'))](_0xd1a2('0xba'));}return _0x34db7a;})[_0xd1a2('0x13')](removeEntity(_0x1152f6,null))[_0xd1a2('0x5c')](handleError(_0x1152f6,null));};exports[_0xd1a2('0xbb')]=function(_0x122500,_0x33aa48){return db['MailAccount'][_0xd1a2('0x61')]({'where':{'id':_0x122500[_0xd1a2('0x5e')]['id']}})[_0xd1a2('0x13')](handleEntityNotFound(_0x33aa48,null))['then'](function(_0x3163bc){if(_0x3163bc){return _0x3163bc[_0xd1a2('0xbb')](_0x122500['body'][_0xd1a2('0x6e')],_[_0xd1a2('0xbc')](_0x122500[_0xd1a2('0x62')],[_0xd1a2('0x6e'),'id'])||{})[_0xd1a2('0xbd')](function(_0x4888cb){for(var _0x583228=0x0;_0x583228<_0x122500[_0xd1a2('0x62')]['ids']['length'];_0x583228+=0x1){socket[_0xd1a2('0xbe')]('userMailAccount:save',{'UserId':Number(_0x122500[_0xd1a2('0x62')][_0xd1a2('0x6e')][_0x583228]),'MailAccountId':Number(_0x122500[_0xd1a2('0x5e')]['id'])});}return _0x4888cb;});}})['then'](respondWithResult(_0x33aa48,null))[_0xd1a2('0x5c')](handleError(_0x33aa48,null));};exports[_0xd1a2('0xbf')]=function(_0x28500f,_0x15705){return db['MailAccount']['find']({'where':{'id':_0x28500f[_0xd1a2('0x5e')]['id']}})[_0xd1a2('0x13')](handleEntityNotFound(_0x15705,null))[_0xd1a2('0x13')](function(_0x7a9c8e){if(_0x7a9c8e){return _0x7a9c8e['removeAgents'](_0x28500f[_0xd1a2('0x48')]['ids'])[_0xd1a2('0x13')](function(){if(_['isArray'](_0x28500f[_0xd1a2('0x48')][_0xd1a2('0x6e')])){for(var _0x43dc5e=0x0;_0x43dc5e<_0x28500f[_0xd1a2('0x48')][_0xd1a2('0x6e')]['length'];_0x43dc5e+=0x1){socket[_0xd1a2('0xbe')](_0xd1a2('0xc0'),{'UserId':Number(_0x28500f[_0xd1a2('0x48')]['ids'][_0x43dc5e]),'MailAccountId':Number(_0x28500f[_0xd1a2('0x5e')]['id'])});}}else{socket[_0xd1a2('0xbe')](_0xd1a2('0xc0'),{'UserId':Number(_0x28500f['query'][_0xd1a2('0x6e')]),'MailAccountId':Number(_0x28500f['params']['id'])});}});}})['then'](respondWithStatusCode(_0x15705,null))['catch'](handleError(_0x15705,null));};exports['getAgents']=function(_0x195525,_0x6eb83f){var _0x5a6daa={};var _0x2a7a2a={};var _0xb05620;var _0x5c015b;return db['MailAccount'][_0xd1a2('0x6a')]({'where':{'id':_0x195525['params']['id']}})[_0xd1a2('0x13')](handleEntityNotFound(_0x6eb83f,null))[_0xd1a2('0x13')](function(_0x13f525){if(_0x13f525){_0xb05620=_0x13f525;_0x2a7a2a[_0xd1a2('0x46')]=_['keys'](db['User'][_0xd1a2('0x43')]);_0x2a7a2a[_0xd1a2('0x48')]=_[_0xd1a2('0x47')](_0x195525[_0xd1a2('0x48')]);_0x2a7a2a['filters']=_['intersection'](_0x2a7a2a['model'],_0x2a7a2a['query']);_0x5a6daa[_0xd1a2('0x4a')]=_['intersection'](_0x2a7a2a[_0xd1a2('0x46')],qs['fields'](_0x195525[_0xd1a2('0x48')][_0xd1a2('0x4c')]));_0x5a6daa[_0xd1a2('0x4a')]=_0x5a6daa['attributes'][_0xd1a2('0x4d')]?_0x5a6daa['attributes']:_0x2a7a2a['model'];_0x5a6daa[_0xd1a2('0x50')]=qs[_0xd1a2('0x51')](_0x195525[_0xd1a2('0x48')][_0xd1a2('0x51')]);_0x5a6daa[_0xd1a2('0x52')]=qs[_0xd1a2('0x49')](_[_0xd1a2('0x53')](_0x195525[_0xd1a2('0x48')],_0x2a7a2a[_0xd1a2('0x49')]));if(_0x195525[_0xd1a2('0x48')]['filter']){_0x5a6daa[_0xd1a2('0x52')]=_['merge'](_0x5a6daa[_0xd1a2('0x52')],{'$or':_[_0xd1a2('0x56')](_0x5a6daa[_0xd1a2('0x4a')],function(_0x15a94a){var _0x1f4ce9={};_0x1f4ce9[_0x15a94a]={'$like':'%'+_0x195525[_0xd1a2('0x48')][_0xd1a2('0x54')]+'%'};return _0x1f4ce9;})});}_0x5a6daa=_[_0xd1a2('0x55')]({},_0x5a6daa,_0x195525['options']);return _0xb05620[_0xd1a2('0xc1')](_0x5a6daa);}})['then'](function(_0x565114){if(_0x565114){_0x5c015b=_0x565114[_0xd1a2('0x4d')];if(!_0x195525[_0xd1a2('0x48')]['hasOwnProperty'](_0xd1a2('0x4f'))){_0x5a6daa[_0xd1a2('0x21')]=qs[_0xd1a2('0x21')](_0x195525['query'][_0xd1a2('0x21')]);_0x5a6daa[_0xd1a2('0x20')]=qs['offset'](_0x195525['query'][_0xd1a2('0x20')]);}return _0xb05620[_0xd1a2('0xc1')](_0x5a6daa);}})['then'](function(_0x18126c){if(_0x18126c){return _0x18126c?{'count':_0x5c015b,'rows':_0x18126c}:null;}})[_0xd1a2('0x13')](respondWithResult(_0x6eb83f,null))[_0xd1a2('0x5c')](handleError(_0x6eb83f,null));}; \ No newline at end of file +var _0x5f34=['register','jayson/promise','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','update','destroy','get','MailAccounts','UserProfileResource','name','imap.gmail.com','yahoo','hotmail','outlook365','outlook.office365.com','gmail','smtp.gmail.com','smtp.mail.yahoo.com','user','username','password','pass','modernAuthentication','CloudProviderId','host','port','secure','service','authentication','Imap','Smtp','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','MailAccount','fieldName','type','query','keys','intersection','model','attributes','fields','length','nolimit','sort','where','filters','pick','filter','merge','map','VIRTUAL','includeAll','include','findAll','show','params','find','body','custom','Mail\x20Account\x20not\x20found','describe','addDisposition','MailAccountId','create','getDispositions','Disposition','rawAttributes','hasOwnProperty','options','rows','removeDispositions','ids','addAnswer','CannedAnswer','findOne','order','removeAnswers','key','provider','email','isNil','active','description','role','UserProfileSection','userProfileId','autoAssociation','getImap','addImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','CmContact','User','Owner','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','findAndCountAll','priority','stack','send','getApplications','getMessages','MailMessage','$gte','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','split','CmList','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','format','%s\x20<%s>','attachments','join','server/files/attachments','basename','getSmtpOptions','SendMail','sendMail','List','List\x20not\x20found','Contacts','ListId','messageId','subject','attach','out','Interaction','Messages','verifySmtp','VerifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','userMailAccount:save','removeAgents','isArray','emit','userMailAccount:remove','getAgents','bluebird','util','lodash','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./mailAccount.socket'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5f34,0xba));var _0x45f3=function(_0x15bb34,_0x5bbf36){_0x15bb34=_0x15bb34-0x0;var _0x38cbed=_0x5f34[_0x15bb34];return _0x38cbed;};'use strict';var moment=require('moment');var BPromise=require(_0x45f3('0x0'));var util=require(_0x45f3('0x1'));var path=require('path');var _=require(_0x45f3('0x2'));var juice=require('juice');var Redis=require('ioredis');var qs=require(_0x45f3('0x3'));var logger=require('../../config/logger')(_0x45f3('0x4'));var config=require(_0x45f3('0x5'));var db=require(_0x45f3('0x6'))['db'];config[_0x45f3('0x7')]=_[_0x45f3('0x8')](config['redis'],{'host':_0x45f3('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x45f3('0x7')]));require(_0x45f3('0xa'))[_0x45f3('0xb')](socket);var jayson=require(_0x45f3('0xc'));var client=jayson['client'][_0x45f3('0xd')]({'port':0x232b});function respondWithRpcPromise(_0xa23c95,_0x558adb,_0x55755a,_0x32d7c5){return new BPromise(function(_0x350d0e,_0xe0ab1){var _0x22d941=_0x32d7c5||client;return _0x22d941[_0x45f3('0xe')](_0xa23c95,_0x55755a)[_0x45f3('0xf')](function(_0x247a60){logger[_0x45f3('0x10')](_0x45f3('0x11'),_0x558adb,_0x45f3('0x12'));logger[_0x45f3('0x13')](_0x45f3('0x14'),_0x558adb,_0x45f3('0x12'),JSON[_0x45f3('0x15')](_0x247a60));if(_0x247a60[_0x45f3('0x16')]){if(_0x247a60[_0x45f3('0x16')][_0x45f3('0x17')]===0x1f4){logger['error'](_0x45f3('0x11'),_0x558adb,_0x247a60[_0x45f3('0x16')][_0x45f3('0x18')]);return _0xe0ab1(_0x247a60[_0x45f3('0x16')][_0x45f3('0x18')]);}logger[_0x45f3('0x16')](_0x45f3('0x11'),_0x558adb,_0x247a60['error'][_0x45f3('0x18')]);return _0x350d0e(_0x247a60[_0x45f3('0x16')][_0x45f3('0x18')]);}else{logger[_0x45f3('0x10')](_0x45f3('0x11'),_0x558adb,_0x45f3('0x12'));_0x350d0e(_0x247a60[_0x45f3('0x19')][_0x45f3('0x18')]);}})[_0x45f3('0x1a')](function(_0x4d7946){logger['error'](_0x45f3('0x11'),_0x558adb,_0x4d7946);_0xe0ab1(_0x4d7946);});});}function respondWithStatusCode(_0x5a9ab8,_0x4f1428){_0x4f1428=_0x4f1428||0xcc;return function(_0x5e7f8d){if(_0x5e7f8d){return _0x5a9ab8[_0x45f3('0x1b')](_0x4f1428);}return _0x5a9ab8['status'](_0x4f1428)[_0x45f3('0x1c')]();};}function respondWithResult(_0x1f51ae,_0xd271b0){_0xd271b0=_0xd271b0||0xc8;return function(_0x26f18e){if(_0x26f18e){return _0x1f51ae[_0x45f3('0x1d')](_0xd271b0)[_0x45f3('0x1e')](_0x26f18e);}};}function respondWithFilteredResult(_0xac0755,_0x53cdf1){return function(_0x616e4b){if(_0x616e4b){var _0x4c765f=typeof _0x53cdf1[_0x45f3('0x1f')]==='undefined'&&typeof _0x53cdf1[_0x45f3('0x20')]===_0x45f3('0x21');var _0x28131d=_0x616e4b[_0x45f3('0x22')];var _0x511df9=_0x4c765f?0x0:_0x53cdf1[_0x45f3('0x1f')];var _0x27ebf9=_0x4c765f?_0x616e4b[_0x45f3('0x22')]:_0x53cdf1[_0x45f3('0x1f')]+_0x53cdf1[_0x45f3('0x20')];var _0x4865d4;if(_0x27ebf9>=_0x28131d){_0x27ebf9=_0x28131d;_0x4865d4=0xc8;}else{_0x4865d4=0xce;}_0xac0755[_0x45f3('0x1d')](_0x4865d4);return _0xac0755[_0x45f3('0x23')](_0x45f3('0x24'),_0x511df9+'-'+_0x27ebf9+'/'+_0x28131d)[_0x45f3('0x1e')](_0x616e4b);}return null;};}function saveUpdates(_0x53fe4d){return function(_0xe273c6){if(_0xe273c6){return _0xe273c6[_0x45f3('0x25')](_0x53fe4d)[_0x45f3('0xf')](function(_0x40ad59){return _0x40ad59;});}return null;};}function removeEntity(_0x3421b6){return function(_0x7ac069){if(_0x7ac069){return _0x7ac069[_0x45f3('0x26')]()[_0x45f3('0xf')](function(){var _0x1999b3=_0x7ac069[_0x45f3('0x27')]({'plain':!![]});var _0xa7aa8e=_0x45f3('0x28');return db[_0x45f3('0x29')][_0x45f3('0x26')]({'where':{'type':_0xa7aa8e,'resourceId':_0x1999b3['id']}})[_0x45f3('0xf')](function(){return _0x7ac069;});})['then'](function(){_0x3421b6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x52148c){return function(_0x4edd8a){if(!_0x4edd8a){_0x52148c['sendStatus'](0x194);}return _0x4edd8a;};}function handleError(_0xcb0df3,_0x5010b5){_0x5010b5=_0x5010b5||0x1f4;return function(_0x8d264b){logger['error'](_0x8d264b['stack']);if(_0x8d264b['name']){delete _0x8d264b[_0x45f3('0x2a')];}_0xcb0df3['status'](_0x5010b5)['send'](_0x8d264b);};}function getImapHost(_0x4e93f2){switch(_0x4e93f2){case'gmail':return _0x45f3('0x2b');case _0x45f3('0x2c'):return'imap.mail.yahoo.com';case _0x45f3('0x2d'):return'imap-mail.outlook.com';case _0x45f3('0x2e'):return _0x45f3('0x2f');}throw new Error('Unknown\x20email\x20service\x20provider',_0x4e93f2);}function getSmtpHost(_0x5cda3c){switch(_0x5cda3c){case _0x45f3('0x30'):return _0x45f3('0x31');case _0x45f3('0x2c'):return _0x45f3('0x32');case'hotmail':return'smtp-mail.outlook.com';case'outlook365':return'smtp.office365.com';}throw new Error('Unknown\x20email\x20service\x20provider',_0x5cda3c);}function getAuthenticationOptions(_0x5a1de9,_0x594c75){var _0x23a905={};var _0x56e547={};if(_0x5a1de9){_0x23a905[_0x45f3('0x33')]=_0x56e547['user']=_0x594c75[_0x45f3('0x34')];_0x23a905[_0x45f3('0x35')]=_0x56e547[_0x45f3('0x36')]=_0x594c75[_0x45f3('0x35')];if(_0x594c75[_0x45f3('0x37')]){_0x23a905[_0x45f3('0x37')]=_0x56e547[_0x45f3('0x37')]=!![];_0x23a905[_0x45f3('0x38')]=_0x56e547[_0x45f3('0x38')]=_0x594c75[_0x45f3('0x38')];_0x23a905['password']=_0x56e547[_0x45f3('0x36')]=null;}else{_0x23a905[_0x45f3('0x38')]=_0x56e547[_0x45f3('0x38')]=null;}_0x23a905[_0x45f3('0x39')]=getImapHost(_0x5a1de9);_0x23a905[_0x45f3('0x3a')]=0x3e1;_0x56e547[_0x45f3('0x39')]=getSmtpHost(_0x5a1de9);_0x56e547[_0x45f3('0x3a')]=0x24b;_0x56e547[_0x45f3('0x3b')]=![];_0x23a905[_0x45f3('0x3c')]=_0x56e547[_0x45f3('0x3c')]=null;}else{if(_0x594c75[_0x45f3('0x3d')]){_0x23a905[_0x45f3('0x33')]=_0x56e547[_0x45f3('0x33')]=_0x594c75['username'];_0x23a905[_0x45f3('0x35')]=_0x56e547[_0x45f3('0x36')]=_0x594c75[_0x45f3('0x35')];}else{_0x23a905['authentication']=_0x56e547[_0x45f3('0x3d')]=![];_0x23a905[_0x45f3('0x33')]=_0x56e547[_0x45f3('0x33')]=null;_0x23a905[_0x45f3('0x35')]=_0x56e547[_0x45f3('0x36')]=null;}_0x23a905[_0x45f3('0x39')]=_0x594c75[_0x45f3('0x3e')][_0x45f3('0x39')];_0x23a905['port']=_0x594c75[_0x45f3('0x3e')]['port'];_0x56e547[_0x45f3('0x39')]=_0x594c75[_0x45f3('0x3f')]['host'];_0x56e547[_0x45f3('0x3a')]=_0x594c75[_0x45f3('0x3f')][_0x45f3('0x3a')];}return{'Imap':_0x23a905,'Smtp':_0x56e547};}exports['index']=function(_0x2d1896,_0x463eb4){var _0x361ffa={'include':[{'model':db[_0x45f3('0x40')],'as':_0x45f3('0x3e')},{'model':db[_0x45f3('0x41')],'as':_0x45f3('0x3f')},{'model':db[_0x45f3('0x42')],'as':_0x45f3('0x43')}]},_0x8a0b01={},_0x22b7b7={'count':0x0,'rows':[]};var _0x234457=_['map'](db[_0x45f3('0x44')]['rawAttributes'],function(_0xd46051){return{'name':_0xd46051[_0x45f3('0x45')],'type':_0xd46051[_0x45f3('0x46')]['key']};});_0x8a0b01['model']=_['map'](_0x234457,_0x45f3('0x2a'));_0x8a0b01[_0x45f3('0x47')]=_[_0x45f3('0x48')](_0x2d1896[_0x45f3('0x47')]);_0x8a0b01['filters']=_[_0x45f3('0x49')](_0x8a0b01[_0x45f3('0x4a')],_0x8a0b01['query']);_0x361ffa[_0x45f3('0x4b')]=_[_0x45f3('0x49')](_0x8a0b01[_0x45f3('0x4a')],qs[_0x45f3('0x4c')](_0x2d1896[_0x45f3('0x47')]['fields']));_0x361ffa['attributes']=_0x361ffa[_0x45f3('0x4b')][_0x45f3('0x4d')]?_0x361ffa['attributes']:_0x8a0b01['model'];if(!_0x2d1896[_0x45f3('0x47')]['hasOwnProperty'](_0x45f3('0x4e'))){_0x361ffa['limit']=qs[_0x45f3('0x20')](_0x2d1896[_0x45f3('0x47')][_0x45f3('0x20')]);_0x361ffa[_0x45f3('0x1f')]=qs['offset'](_0x2d1896[_0x45f3('0x47')][_0x45f3('0x1f')]);}_0x361ffa['order']=qs['sort'](_0x2d1896[_0x45f3('0x47')][_0x45f3('0x4f')]);_0x361ffa[_0x45f3('0x50')]=qs[_0x45f3('0x51')](_[_0x45f3('0x52')](_0x2d1896[_0x45f3('0x47')],_0x8a0b01['filters']),_0x234457);if(_0x2d1896['query'][_0x45f3('0x53')]){_0x361ffa[_0x45f3('0x50')]=_[_0x45f3('0x54')](_0x361ffa[_0x45f3('0x50')],{'$or':_[_0x45f3('0x55')](_0x234457,function(_0x5ad31e){if(_0x5ad31e['type']!==_0x45f3('0x56')){var _0x3d31f8={};_0x3d31f8[_0x5ad31e[_0x45f3('0x2a')]]={'$like':'%'+_0x2d1896[_0x45f3('0x47')][_0x45f3('0x53')]+'%'};return _0x3d31f8;}})});}_0x361ffa=_[_0x45f3('0x54')]({},_0x361ffa,_0x2d1896['options']);var _0x27cb17={'where':_0x361ffa[_0x45f3('0x50')]};return db[_0x45f3('0x44')]['count'](_0x27cb17)[_0x45f3('0xf')](function(_0x3c1d26){_0x22b7b7['count']=_0x3c1d26;if(_0x2d1896[_0x45f3('0x47')][_0x45f3('0x57')]){_0x361ffa[_0x45f3('0x58')]=[{'all':!![]}];}return db[_0x45f3('0x44')][_0x45f3('0x59')](_0x361ffa);})[_0x45f3('0xf')](function(_0x79782e){_0x22b7b7['rows']=_0x79782e;return _0x22b7b7;})[_0x45f3('0xf')](respondWithFilteredResult(_0x463eb4,_0x361ffa))[_0x45f3('0x1a')](handleError(_0x463eb4,null));};exports[_0x45f3('0x5a')]=function(_0x1b06cc,_0x4a497a){var _0x558e62={'raw':![],'where':{'id':_0x1b06cc[_0x45f3('0x5b')]['id']},'include':[{'model':db[_0x45f3('0x40')],'as':'Imap'},{'model':db[_0x45f3('0x41')],'as':_0x45f3('0x3f')},{'model':db['Pause'],'as':_0x45f3('0x43')}]},_0x5b5a07={};_0x5b5a07[_0x45f3('0x4a')]=_[_0x45f3('0x48')](db['MailAccount']['rawAttributes']);_0x5b5a07[_0x45f3('0x47')]=_['keys'](_0x1b06cc['query']);_0x5b5a07[_0x45f3('0x51')]=_[_0x45f3('0x49')](_0x5b5a07[_0x45f3('0x4a')],_0x5b5a07[_0x45f3('0x47')]);_0x558e62[_0x45f3('0x4b')]=_[_0x45f3('0x49')](_0x5b5a07[_0x45f3('0x4a')],qs[_0x45f3('0x4c')](_0x1b06cc[_0x45f3('0x47')][_0x45f3('0x4c')]));_0x558e62[_0x45f3('0x4b')]=_0x558e62[_0x45f3('0x4b')][_0x45f3('0x4d')]?_0x558e62[_0x45f3('0x4b')]:_0x5b5a07['model'];if(_0x1b06cc['query'][_0x45f3('0x57')]){_0x558e62[_0x45f3('0x58')]=[{'all':!![]}];}_0x558e62=_[_0x45f3('0x54')]({},_0x558e62,_0x1b06cc['options']);return db[_0x45f3('0x44')][_0x45f3('0x5c')](_0x558e62)['then'](handleEntityNotFound(_0x4a497a,null))['then'](respondWithResult(_0x4a497a,null))[_0x45f3('0x1a')](handleError(_0x4a497a,null));};exports[_0x45f3('0x25')]=function(_0x37b80c,_0x4d0a7b){if(_0x37b80c[_0x45f3('0x5d')]['id']){delete _0x37b80c[_0x45f3('0x5d')]['id'];}var _0x216d9a=_0x37b80c[_0x45f3('0x5d')]['provider']===_0x45f3('0x5e')?null:_0x37b80c[_0x45f3('0x5d')]['provider'];var _0x15d308=_0x37b80c[_0x45f3('0x5d')][_0x45f3('0x3e')]||{};var _0x59f38b=_0x37b80c[_0x45f3('0x5d')]['Smtp']||{};if(_0x216d9a){_0x15d308[_0x45f3('0x39')]=getImapHost(_0x216d9a);_0x15d308[_0x45f3('0x3a')]=0x3e1;_0x59f38b[_0x45f3('0x39')]=getSmtpHost(_0x216d9a);_0x59f38b[_0x45f3('0x3a')]=0x24b;_0x59f38b[_0x45f3('0x3b')]=![];}if(_0x59f38b[_0x45f3('0x37')]){_0x59f38b[_0x45f3('0x3b')]=![];}else{_0x59f38b[_0x45f3('0x38')]=null;}if(!_0x15d308[_0x45f3('0x37')])_0x15d308[_0x45f3('0x38')]=null;_0x37b80c[_0x45f3('0x5d')][_0x45f3('0x3e')]=_0x15d308;_0x37b80c['body'][_0x45f3('0x3f')]=_0x59f38b;return db[_0x45f3('0x44')]['find']({'where':{'id':_0x37b80c[_0x45f3('0x5b')]['id']},'include':[{'model':db[_0x45f3('0x40')],'as':_0x45f3('0x3e')},{'model':db[_0x45f3('0x41')],'as':_0x45f3('0x3f')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x4d0a7b,null))[_0x45f3('0xf')](function(_0xdd103a){if(!_0xdd103a)throw new Error(_0x45f3('0x5f'));if(_0xdd103a[_0x45f3('0x3c')])delete _0x37b80c[_0x45f3('0x5d')][_0x45f3('0x3e')];return _0xdd103a;})['then'](saveUpdates(_0x37b80c[_0x45f3('0x5d')],null))[_0x45f3('0xf')](function(_0x5a4bea){if(!_0x37b80c[_0x45f3('0x5d')][_0x45f3('0x3e')])return _0x5a4bea;return db[_0x45f3('0x40')][_0x45f3('0x25')](_0x37b80c[_0x45f3('0x5d')][_0x45f3('0x3e')],{'where':{'MailAccountId':_0x5a4bea['id']}})[_0x45f3('0xf')](function(){return _0x5a4bea;});})['then'](function(_0x421f63){if(!_0x37b80c[_0x45f3('0x5d')][_0x45f3('0x3f')])return _0x421f63;return db[_0x45f3('0x41')][_0x45f3('0x25')](_0x37b80c[_0x45f3('0x5d')][_0x45f3('0x3f')],{'where':{'MailAccountId':_0x421f63['id']}})[_0x45f3('0xf')](function(){return _0x421f63;});})[_0x45f3('0xf')](respondWithResult(_0x4d0a7b,null))['catch'](handleError(_0x4d0a7b,null));};exports[_0x45f3('0x60')]=function(_0x3ec9f4,_0x5b4639){return db[_0x45f3('0x44')][_0x45f3('0x60')]()['then'](respondWithResult(_0x5b4639,null))[_0x45f3('0x1a')](handleError(_0x5b4639,null));};exports[_0x45f3('0x61')]=function(_0x1d93c,_0x488ea6){if(_0x1d93c[_0x45f3('0x5d')]['id']){delete _0x1d93c[_0x45f3('0x5d')]['id'];}return db['MailAccount'][_0x45f3('0x5c')]({'where':{'id':_0x1d93c[_0x45f3('0x5b')]['id']}})[_0x45f3('0xf')](handleEntityNotFound(_0x488ea6,null))[_0x45f3('0xf')](function(_0x2fc0bb){if(_0x2fc0bb){_0x1d93c[_0x45f3('0x5d')][_0x45f3('0x62')]=_0x2fc0bb['id'];return db['Disposition'][_0x45f3('0x63')](_0x1d93c[_0x45f3('0x5d')]);}})['then'](respondWithResult(_0x488ea6,null))['catch'](handleError(_0x488ea6,null));};exports[_0x45f3('0x64')]=function(_0x36f33e,_0x332911){var _0x525f8b={'raw':![],'where':{}};var _0x1c09c7={};var _0x4a4204={'count':0x0,'rows':[]};return db[_0x45f3('0x44')]['findOne']({'where':{'id':_0x36f33e[_0x45f3('0x5b')]['id']}})[_0x45f3('0xf')](handleEntityNotFound(_0x332911,null))[_0x45f3('0xf')](function(_0x4fb89e){if(_0x4fb89e){_0x1c09c7[_0x45f3('0x4a')]=_[_0x45f3('0x48')](db[_0x45f3('0x65')][_0x45f3('0x66')]);_0x1c09c7[_0x45f3('0x47')]=_['keys'](_0x36f33e[_0x45f3('0x47')]);_0x1c09c7[_0x45f3('0x51')]=_[_0x45f3('0x49')](_0x1c09c7[_0x45f3('0x4a')],_0x1c09c7[_0x45f3('0x47')]);_0x525f8b[_0x45f3('0x4b')]=_[_0x45f3('0x49')](_0x1c09c7[_0x45f3('0x4a')],qs[_0x45f3('0x4c')](_0x36f33e[_0x45f3('0x47')][_0x45f3('0x4c')]));_0x525f8b[_0x45f3('0x4b')]=_0x525f8b[_0x45f3('0x4b')][_0x45f3('0x4d')]?_0x525f8b[_0x45f3('0x4b')]:_0x1c09c7[_0x45f3('0x4a')];if(!_0x36f33e[_0x45f3('0x47')][_0x45f3('0x67')](_0x45f3('0x4e'))){_0x525f8b['limit']=qs[_0x45f3('0x20')](_0x36f33e['query'][_0x45f3('0x20')]);_0x525f8b['offset']=qs[_0x45f3('0x1f')](_0x36f33e[_0x45f3('0x47')][_0x45f3('0x1f')]);}_0x525f8b['order']=qs[_0x45f3('0x4f')](_0x36f33e[_0x45f3('0x47')][_0x45f3('0x4f')]);_0x525f8b[_0x45f3('0x50')]=qs[_0x45f3('0x51')](_['pick'](_0x36f33e[_0x45f3('0x47')],_0x1c09c7[_0x45f3('0x51')]));_0x525f8b[_0x45f3('0x50')][_0x45f3('0x62')]=_0x4fb89e['id'];if(_0x36f33e['query'][_0x45f3('0x53')]){_0x525f8b['where']=_[_0x45f3('0x54')](_0x525f8b[_0x45f3('0x50')],{'$or':_['map'](_0x525f8b[_0x45f3('0x4b')],function(_0x137499){var _0x56ea53={};_0x56ea53[_0x137499]={'$like':'%'+_0x36f33e[_0x45f3('0x47')][_0x45f3('0x53')]+'%'};return _0x56ea53;})});}_0x525f8b=_[_0x45f3('0x54')]({},_0x525f8b,_0x36f33e[_0x45f3('0x68')]);return db[_0x45f3('0x65')][_0x45f3('0x22')]({'where':_0x525f8b[_0x45f3('0x50')]})[_0x45f3('0xf')](function(_0x1fab6e){_0x4a4204[_0x45f3('0x22')]=_0x1fab6e;if(_0x36f33e['query'][_0x45f3('0x57')]){_0x525f8b[_0x45f3('0x58')]=[{'all':!![]}];}return db[_0x45f3('0x65')][_0x45f3('0x59')](_0x525f8b);})[_0x45f3('0xf')](function(_0x17c0de){_0x4a4204[_0x45f3('0x69')]=_0x17c0de;return _0x4a4204;});}})['then'](respondWithFilteredResult(_0x332911,_0x525f8b))['catch'](handleError(_0x332911,null));};exports[_0x45f3('0x6a')]=function(_0x31e897,_0x356e4f){return db['MailAccount']['find']({'where':{'id':_0x31e897[_0x45f3('0x5b')]['id']}})[_0x45f3('0xf')](handleEntityNotFound(_0x356e4f,null))[_0x45f3('0xf')](function(_0x542f46){if(_0x542f46){return _0x542f46[_0x45f3('0x6a')](_0x31e897[_0x45f3('0x47')][_0x45f3('0x6b')]);}})[_0x45f3('0xf')](respondWithStatusCode(_0x356e4f,null))[_0x45f3('0x1a')](handleError(_0x356e4f,null));};exports[_0x45f3('0x6c')]=function(_0x3090fa,_0x4444f4){if(_0x3090fa[_0x45f3('0x5d')]['id']){delete _0x3090fa[_0x45f3('0x5d')]['id'];}return db['MailAccount'][_0x45f3('0x5c')]({'where':{'id':_0x3090fa[_0x45f3('0x5b')]['id']}})[_0x45f3('0xf')](handleEntityNotFound(_0x4444f4,null))['then'](function(_0x413b7f){if(_0x413b7f){_0x3090fa[_0x45f3('0x5d')][_0x45f3('0x62')]=_0x413b7f['id'];return db[_0x45f3('0x6d')][_0x45f3('0x63')](_0x3090fa[_0x45f3('0x5d')]);}})['then'](respondWithResult(_0x4444f4,null))[_0x45f3('0x1a')](handleError(_0x4444f4,null));};exports['getAnswers']=function(_0x4af677,_0x1d06c4){var _0x399eec={'raw':![],'where':{}};var _0x2bd4b3={};var _0x46375d={'count':0x0,'rows':[]};return db['MailAccount'][_0x45f3('0x6e')]({'where':{'id':_0x4af677[_0x45f3('0x5b')]['id']}})[_0x45f3('0xf')](handleEntityNotFound(_0x1d06c4,null))[_0x45f3('0xf')](function(_0x399c5f){if(_0x399c5f){_0x2bd4b3[_0x45f3('0x4a')]=_[_0x45f3('0x48')](db['CannedAnswer'][_0x45f3('0x66')]);_0x2bd4b3[_0x45f3('0x47')]=_[_0x45f3('0x48')](_0x4af677['query']);_0x2bd4b3['filters']=_[_0x45f3('0x49')](_0x2bd4b3[_0x45f3('0x4a')],_0x2bd4b3[_0x45f3('0x47')]);_0x399eec[_0x45f3('0x4b')]=_[_0x45f3('0x49')](_0x2bd4b3['model'],qs[_0x45f3('0x4c')](_0x4af677[_0x45f3('0x47')]['fields']));_0x399eec['attributes']=_0x399eec[_0x45f3('0x4b')][_0x45f3('0x4d')]?_0x399eec[_0x45f3('0x4b')]:_0x2bd4b3['model'];if(!_0x4af677['query'][_0x45f3('0x67')](_0x45f3('0x4e'))){_0x399eec[_0x45f3('0x20')]=qs[_0x45f3('0x20')](_0x4af677['query']['limit']);_0x399eec[_0x45f3('0x1f')]=qs[_0x45f3('0x1f')](_0x4af677[_0x45f3('0x47')]['offset']);}_0x399eec[_0x45f3('0x6f')]=qs[_0x45f3('0x4f')](_0x4af677[_0x45f3('0x47')][_0x45f3('0x4f')]);_0x399eec[_0x45f3('0x50')]=qs[_0x45f3('0x51')](_['pick'](_0x4af677[_0x45f3('0x47')],_0x2bd4b3[_0x45f3('0x51')]));_0x399eec['where']['MailAccountId']=_0x399c5f['id'];if(_0x4af677['query'][_0x45f3('0x53')]){_0x399eec[_0x45f3('0x50')]=_['merge'](_0x399eec['where'],{'$or':_['map'](_0x399eec[_0x45f3('0x4b')],function(_0x553f95){var _0x9db93f={};_0x9db93f[_0x553f95]={'$like':'%'+_0x4af677[_0x45f3('0x47')][_0x45f3('0x53')]+'%'};return _0x9db93f;})});}_0x399eec=_[_0x45f3('0x54')]({},_0x399eec,_0x4af677[_0x45f3('0x68')]);return db['CannedAnswer'][_0x45f3('0x22')]({'where':_0x399eec[_0x45f3('0x50')]})[_0x45f3('0xf')](function(_0x54ffa5){_0x46375d[_0x45f3('0x22')]=_0x54ffa5;if(_0x4af677['query'][_0x45f3('0x57')]){_0x399eec['include']=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x399eec);})[_0x45f3('0xf')](function(_0x40e1cf){_0x46375d[_0x45f3('0x69')]=_0x40e1cf;return _0x46375d;});}})[_0x45f3('0xf')](respondWithFilteredResult(_0x1d06c4,_0x399eec))[_0x45f3('0x1a')](handleError(_0x1d06c4,null));};exports[_0x45f3('0x70')]=function(_0x32f93f,_0x7d97a1){return db[_0x45f3('0x44')]['find']({'where':{'id':_0x32f93f['params']['id']}})['then'](handleEntityNotFound(_0x7d97a1,null))[_0x45f3('0xf')](function(_0x36b526){if(_0x36b526){return _0x36b526[_0x45f3('0x70')](_0x32f93f[_0x45f3('0x47')]['ids']);}})[_0x45f3('0xf')](respondWithStatusCode(_0x7d97a1,null))['catch'](handleError(_0x7d97a1,null));};exports[_0x45f3('0x63')]=function(_0x5e7483,_0x4f0c5d){var _0x144970={'name':_0x5e7483['body']['name'],'key':_0x5e7483[_0x45f3('0x5d')][_0x45f3('0x71')],'provider':_0x5e7483[_0x45f3('0x5d')][_0x45f3('0x72')]===_0x45f3('0x5e')?null:_0x5e7483[_0x45f3('0x5d')][_0x45f3('0x72')],'email':_0x5e7483[_0x45f3('0x5d')][_0x45f3('0x73')],'ListId':_0x5e7483[_0x45f3('0x5d')]['ListId'],'active':!_[_0x45f3('0x74')](_0x5e7483['body'][_0x45f3('0x75')])?_0x5e7483[_0x45f3('0x5d')][_0x45f3('0x75')]:!![],'description':_0x5e7483['body'][_0x45f3('0x76')]||null};var _0x5efedd=getAuthenticationOptions(_0x144970[_0x45f3('0x72')],_0x5e7483['body']);_0x144970[_0x45f3('0x3e')]=_0x5efedd[_0x45f3('0x3e')];_0x144970[_0x45f3('0x3f')]=_0x5efedd[_0x45f3('0x3f')];return db[_0x45f3('0x44')][_0x45f3('0x63')](_0x144970,{'include':[{'model':db[_0x45f3('0x41')],'as':_0x45f3('0x3f')},{'model':db['MailServerIn'],'as':_0x45f3('0x3e')}]})[_0x45f3('0xf')](function(_0x4b255e){var _0x337124=_0x5e7483[_0x45f3('0x33')][_0x45f3('0x27')]({'plain':!![]});if(!_0x337124)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x337124[_0x45f3('0x77')]===_0x45f3('0x33')){var _0x1d7b59=_0x4b255e[_0x45f3('0x27')]({'plain':!![]});return db[_0x45f3('0x78')][_0x45f3('0x5c')]({'where':{'name':_0x45f3('0x28'),'userProfileId':_0x337124[_0x45f3('0x79')]},'raw':!![]})[_0x45f3('0xf')](function(_0x1be369){if(_0x1be369&&_0x1be369[_0x45f3('0x7a')]===0x0){return db[_0x45f3('0x29')][_0x45f3('0x63')]({'name':_0x1d7b59[_0x45f3('0x2a')],'resourceId':_0x1d7b59['id'],'type':_0x1be369[_0x45f3('0x2a')],'sectionId':_0x1be369['id']},{})[_0x45f3('0xf')](function(){return _0x4b255e;});}else{return _0x4b255e;}})['catch'](function(_0x418b52){logger[_0x45f3('0x16')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x418b52);throw _0x418b52;});}return _0x4b255e;})['then'](respondWithResult(_0x4f0c5d,0xc9))['catch'](handleError(_0x4f0c5d,null));};exports[_0x45f3('0x7b')]=function(_0x265448,_0x2bbe86){return db['MailAccount'][_0x45f3('0x6e')]({'where':{'id':_0x265448[_0x45f3('0x5b')]['id']}})[_0x45f3('0xf')](handleEntityNotFound(_0x2bbe86,null))['then'](function(_0x19ab8f){if(_0x19ab8f){return _0x19ab8f[_0x45f3('0x7b')]();}return null;})[_0x45f3('0xf')](respondWithResult(_0x2bbe86,null))['catch'](handleError(_0x2bbe86,null));};exports[_0x45f3('0x7c')]=function(_0x92d3be,_0x48f823){if(_0x92d3be['body']['id']){delete _0x92d3be[_0x45f3('0x5d')]['id'];}return db['MailAccount'][_0x45f3('0x5c')]({'where':{'id':_0x92d3be[_0x45f3('0x5b')]['id']}})[_0x45f3('0xf')](handleEntityNotFound(_0x48f823,null))[_0x45f3('0xf')](function(_0x2e532a){if(_0x2e532a){_0x92d3be[_0x45f3('0x5d')][_0x45f3('0x62')]=_0x2e532a['id'];return db[_0x45f3('0x40')][_0x45f3('0x63')](_0x92d3be[_0x45f3('0x5d')]);}})[_0x45f3('0xf')](respondWithResult(_0x48f823,null))[_0x45f3('0x1a')](handleError(_0x48f823,null));};exports['removeImap']=function(_0x15e796,_0x49e646){return db['MailAccount'][_0x45f3('0x6e')]({'where':{'id':_0x15e796[_0x45f3('0x5b')]['id']}})['then'](handleEntityNotFound(_0x49e646,null))[_0x45f3('0xf')](function(_0x4b4389){if(_0x4b4389){return _0x4b4389[_0x45f3('0x7d')](null);}return null;})[_0x45f3('0xf')](respondWithStatusCode(_0x49e646,null))[_0x45f3('0x1a')](handleError(_0x49e646,null));};exports[_0x45f3('0x7e')]=function(_0x256634,_0x4998a1){return db[_0x45f3('0x44')][_0x45f3('0x6e')]({'where':{'id':_0x256634[_0x45f3('0x5b')]['id']}})[_0x45f3('0xf')](handleEntityNotFound(_0x4998a1,null))[_0x45f3('0xf')](function(_0x404fcc){if(_0x404fcc){return _0x404fcc[_0x45f3('0x7e')]();}return null;})[_0x45f3('0xf')](respondWithResult(_0x4998a1,null))[_0x45f3('0x1a')](handleError(_0x4998a1,null));};exports[_0x45f3('0x7f')]=function(_0x1bfe4d,_0x38ebf0){if(_0x1bfe4d[_0x45f3('0x5d')]['id']){delete _0x1bfe4d[_0x45f3('0x5d')]['id'];}return db[_0x45f3('0x44')][_0x45f3('0x5c')]({'where':{'id':_0x1bfe4d[_0x45f3('0x5b')]['id']}})[_0x45f3('0xf')](handleEntityNotFound(_0x38ebf0,null))[_0x45f3('0xf')](function(_0x500bf2){if(_0x500bf2){_0x1bfe4d[_0x45f3('0x5d')]['MailAccountId']=_0x500bf2['id'];return db[_0x45f3('0x41')]['create'](_0x1bfe4d[_0x45f3('0x5d')]);}})[_0x45f3('0xf')](respondWithResult(_0x38ebf0,null))['catch'](handleError(_0x38ebf0,null));};exports[_0x45f3('0x80')]=function(_0x4d32dd,_0x5dbd5c){return db[_0x45f3('0x44')][_0x45f3('0x6e')]({'where':{'id':_0x4d32dd[_0x45f3('0x5b')]['id']}})[_0x45f3('0xf')](handleEntityNotFound(_0x5dbd5c,null))[_0x45f3('0xf')](function(_0x43ac32){if(_0x43ac32){return _0x43ac32[_0x45f3('0x81')](null);}return null;})[_0x45f3('0xf')](respondWithStatusCode(_0x5dbd5c,null))[_0x45f3('0x1a')](handleError(_0x5dbd5c,null));};exports[_0x45f3('0x82')]=function(_0x236b1f,_0x23deaf){return db[_0x45f3('0x83')]['find']({'where':{'id':_0x236b1f[_0x45f3('0x5b')]['id']}})[_0x45f3('0xf')](handleEntityNotFound(_0x23deaf,null))['then'](function(_0x40f9ec){if(_0x40f9ec){return _0x40f9ec[_0x45f3('0x82')](_0x236b1f[_0x45f3('0x5d')][_0x45f3('0x6b')],_[_0x45f3('0x84')](_0x236b1f[_0x45f3('0x5d')],[_0x45f3('0x6b'),'id'])||{});}})['then'](respondWithResult(_0x23deaf,null))[_0x45f3('0x1a')](handleError(_0x23deaf,null));};exports['getInteractions']=function(_0x5d68b7,_0x5e89af){var _0x1cb962={'raw':![],'where':{}};var _0x24dbac={};var _0x2cfe5f={'count':0x0,'rows':[]};return db[_0x45f3('0x44')][_0x45f3('0x6e')]({'where':{'id':_0x5d68b7['params']['id']}})[_0x45f3('0xf')](handleEntityNotFound(_0x5e89af,null))['then'](function(_0x5e18a4){if(_0x5e18a4){_0x24dbac['model']=_[_0x45f3('0x48')](db[_0x45f3('0x83')][_0x45f3('0x66')]);_0x24dbac[_0x45f3('0x47')]=_[_0x45f3('0x48')](_0x5d68b7['query']);_0x24dbac[_0x45f3('0x51')]=_['intersection'](_0x24dbac['model'],_0x24dbac[_0x45f3('0x47')]);_0x1cb962['attributes']=_[_0x45f3('0x49')](_0x24dbac[_0x45f3('0x4a')],qs['fields'](_0x5d68b7[_0x45f3('0x47')][_0x45f3('0x4c')]));_0x1cb962['attributes']=_0x1cb962[_0x45f3('0x4b')][_0x45f3('0x4d')]?_0x1cb962[_0x45f3('0x4b')]:_0x24dbac['model'];if(!_0x5d68b7['query'][_0x45f3('0x67')]('nolimit')){_0x1cb962[_0x45f3('0x20')]=qs[_0x45f3('0x20')](_0x5d68b7[_0x45f3('0x47')][_0x45f3('0x20')]);_0x1cb962[_0x45f3('0x1f')]=qs[_0x45f3('0x1f')](_0x5d68b7[_0x45f3('0x47')][_0x45f3('0x1f')]);}_0x1cb962[_0x45f3('0x6f')]=qs[_0x45f3('0x4f')](_0x5d68b7[_0x45f3('0x47')][_0x45f3('0x4f')]);_0x1cb962[_0x45f3('0x50')]=qs['filters'](_[_0x45f3('0x52')](_0x5d68b7[_0x45f3('0x47')],_0x24dbac['filters']));_0x1cb962['where'][_0x45f3('0x62')]=_0x5e18a4['id'];if(_0x5d68b7[_0x45f3('0x47')]['filter']){_0x1cb962[_0x45f3('0x50')]=_['merge'](_0x1cb962[_0x45f3('0x50')],{'$or':_['map'](_0x1cb962['attributes'],function(_0x409836){var _0x230552={};_0x230552[_0x409836]={'$like':'%'+_0x5d68b7[_0x45f3('0x47')][_0x45f3('0x53')]+'%'};return _0x230552;})});}_0x1cb962=_[_0x45f3('0x54')]({},_0x1cb962,_0x5d68b7['options']);return db[_0x45f3('0x83')][_0x45f3('0x22')]({'where':_0x1cb962[_0x45f3('0x50')]})[_0x45f3('0xf')](function(_0x4e2bfb){_0x2cfe5f[_0x45f3('0x22')]=_0x4e2bfb;if(_0x5d68b7['query'][_0x45f3('0x57')]){_0x1cb962[_0x45f3('0x58')]=[{'model':db[_0x45f3('0x85')],'as':'Contact','required':![]},{'model':db[_0x45f3('0x86')],'as':_0x45f3('0x87'),'attributes':[_0x45f3('0x2a'),'fullname',_0x45f3('0x88')],'required':![]},{'model':db[_0x45f3('0x89')],'as':_0x45f3('0x8a'),'attributes':['id','name',_0x45f3('0x8b')],'where':_0x5d68b7['query'][_0x45f3('0x8c')]?{'id':_0x5d68b7[_0x45f3('0x47')][_0x45f3('0x8c')]}:undefined,'required':_0x5d68b7[_0x45f3('0x47')]['tag']?!![]:![]}];}return db[_0x45f3('0x83')]['findAll'](_0x1cb962);})[_0x45f3('0xf')](function(_0x567aea){_0x2cfe5f[_0x45f3('0x69')]=_0x567aea;return _0x2cfe5f;});}})[_0x45f3('0xf')](respondWithFilteredResult(_0x5e89af,_0x1cb962))['catch'](handleError(_0x5e89af,null));};exports[_0x45f3('0x8d')]=function addApplications(_0x3c9163,_0x35efef){var _0x430541=_0x3c9163[_0x45f3('0x5b')]['id'];var _0x3b03eb=_0x3c9163[_0x45f3('0x5d')];var _0x425a8f=0xc8;var _0x51504f=null;return db[_0x45f3('0x8e')][_0x45f3('0x8f')]({'isolationLevel':db[_0x45f3('0x8e')][_0x45f3('0x90')][_0x45f3('0x91')][_0x45f3('0x92')]},function(_0x5762df){return db['MailAccount'][_0x45f3('0x6e')]({'where':{'id':_0x430541},'transaction':_0x5762df})[_0x45f3('0xf')](function(_0x7d5a40){if(_0x7d5a40){return db[_0x45f3('0x93')]['destroy']({'where':{'MailAccountId':_0x430541},'transaction':_0x5762df})[_0x45f3('0xf')](function(){var _0x44bd0b=_[_0x45f3('0x55')](_0x3b03eb,function(_0x333f68){_0x333f68['MailAccountId']=_0x430541;return _0x333f68;});return db[_0x45f3('0x93')]['bulkCreate'](_0x44bd0b,{'transaction':_0x5762df});});}else{_0x425a8f=0x194;_0x51504f=[];}});})['then'](function(){if(_0x425a8f!==0x194){return db[_0x45f3('0x93')][_0x45f3('0x94')]({'where':{'MailAccountId':_0x430541},'order':_0x45f3('0x95')})['then'](function(_0x5bb2c2){_0x51504f=_0x5bb2c2;});}})[_0x45f3('0x1a')](function(_0x23717d){_0x425a8f=0x1f4;logger[_0x45f3('0x16')](_0x23717d[_0x45f3('0x96')]);if(_0x23717d[_0x45f3('0x2a')]){delete _0x23717d[_0x45f3('0x2a')];}_0x51504f=_0x23717d;})['finally'](function(){if(_0x51504f===null){_0x35efef['sendStatus'](_0x425a8f);}else{if(_0x425a8f===0x1f4){_0x35efef[_0x45f3('0x1d')](_0x425a8f)[_0x45f3('0x97')](_0x51504f);}else{_0x35efef[_0x45f3('0x1d')](_0x425a8f)['json'](_0x51504f);}}});};exports['getApplications']=function(_0xd394f9,_0x302679){var _0x35a1d9={};var _0x18dc9c={};var _0x30ee55;var _0x36c43a;return db[_0x45f3('0x44')][_0x45f3('0x6e')]({'where':{'id':_0xd394f9['params']['id']}})[_0x45f3('0xf')](handleEntityNotFound(_0x302679,null))[_0x45f3('0xf')](function(_0x52f263){if(_0x52f263){_0x30ee55=_0x52f263;_0x18dc9c[_0x45f3('0x4a')]=_[_0x45f3('0x48')](db['MailApplication'][_0x45f3('0x66')]);_0x18dc9c[_0x45f3('0x47')]=_[_0x45f3('0x48')](_0xd394f9[_0x45f3('0x47')]);_0x18dc9c[_0x45f3('0x51')]=_[_0x45f3('0x49')](_0x18dc9c[_0x45f3('0x4a')],_0x18dc9c[_0x45f3('0x47')]);_0x35a1d9[_0x45f3('0x4b')]=_[_0x45f3('0x49')](_0x18dc9c[_0x45f3('0x4a')],qs[_0x45f3('0x4c')](_0xd394f9[_0x45f3('0x47')][_0x45f3('0x4c')]));_0x35a1d9[_0x45f3('0x4b')]=_0x35a1d9['attributes'][_0x45f3('0x4d')]?_0x35a1d9[_0x45f3('0x4b')]:_0x18dc9c[_0x45f3('0x4a')];_0x35a1d9[_0x45f3('0x6f')]=qs[_0x45f3('0x4f')](_0xd394f9[_0x45f3('0x47')][_0x45f3('0x4f')]);_0x35a1d9[_0x45f3('0x50')]=qs['filters'](_['pick'](_0xd394f9[_0x45f3('0x47')],_0x18dc9c[_0x45f3('0x51')]));if(_0xd394f9[_0x45f3('0x47')][_0x45f3('0x53')]){_0x35a1d9[_0x45f3('0x50')]=_['merge'](_0x35a1d9[_0x45f3('0x50')],{'$or':_['map'](_0x35a1d9[_0x45f3('0x4b')],function(_0x2d15e0){var _0x569f46={};_0x569f46[_0x2d15e0]={'$like':'%'+_0xd394f9[_0x45f3('0x47')]['filter']+'%'};return _0x569f46;})});}_0x35a1d9=_['merge']({},_0x35a1d9,_0xd394f9[_0x45f3('0x68')]);return _0x30ee55[_0x45f3('0x98')](_0x35a1d9);}})[_0x45f3('0xf')](function(_0x23c774){if(_0x23c774){_0x36c43a=_0x23c774['length'];if(!_0xd394f9['query']['hasOwnProperty']('nolimit')){_0x35a1d9['limit']=qs[_0x45f3('0x20')](_0xd394f9[_0x45f3('0x47')]['limit']);_0x35a1d9[_0x45f3('0x1f')]=qs[_0x45f3('0x1f')](_0xd394f9[_0x45f3('0x47')]['offset']);}return _0x30ee55['getApplications'](_0x35a1d9);}})[_0x45f3('0xf')](function(_0x551248){if(_0x551248){return _0x551248?{'count':_0x36c43a,'rows':_0x551248}:null;}})[_0x45f3('0xf')](respondWithResult(_0x302679,null))[_0x45f3('0x1a')](handleError(_0x302679,null));};exports[_0x45f3('0x99')]=function(_0x317aef,_0x525319){var _0x3d6a53={'raw':!![],'where':{}};var _0x3c8a4b={};var _0x4b50d6={'count':0x0,'rows':[]};return db[_0x45f3('0x44')][_0x45f3('0x6e')]({'where':{'id':_0x317aef[_0x45f3('0x5b')]['id']}})[_0x45f3('0xf')](handleEntityNotFound(_0x525319,null))[_0x45f3('0xf')](function(_0x2aa49f){if(_0x2aa49f){_0x3c8a4b[_0x45f3('0x4a')]=_['keys'](db[_0x45f3('0x9a')][_0x45f3('0x66')]);_0x3c8a4b[_0x45f3('0x47')]=_['keys'](_0x317aef['query']);_0x3c8a4b[_0x45f3('0x51')]=_['intersection'](_0x3c8a4b[_0x45f3('0x4a')],_0x3c8a4b[_0x45f3('0x47')]);_0x3d6a53[_0x45f3('0x4b')]=_[_0x45f3('0x49')](_0x3c8a4b['model'],qs[_0x45f3('0x4c')](_0x317aef['query'][_0x45f3('0x4c')]));_0x3d6a53[_0x45f3('0x4b')]=_0x3d6a53[_0x45f3('0x4b')][_0x45f3('0x4d')]?_0x3d6a53['attributes']:_0x3c8a4b['model'];if(!_0x317aef[_0x45f3('0x47')][_0x45f3('0x67')]('nolimit')){_0x3d6a53[_0x45f3('0x20')]=qs[_0x45f3('0x20')](_0x317aef['query'][_0x45f3('0x20')]);_0x3d6a53[_0x45f3('0x1f')]=qs[_0x45f3('0x1f')](_0x317aef[_0x45f3('0x47')][_0x45f3('0x1f')]);}_0x3d6a53['order']=qs['sort'](_0x317aef['query'][_0x45f3('0x4f')]);_0x3d6a53[_0x45f3('0x50')]=qs[_0x45f3('0x51')](_[_0x45f3('0x52')](_0x317aef['query'],_0x3c8a4b[_0x45f3('0x51')]));_0x3d6a53[_0x45f3('0x50')][_0x45f3('0x62')]=_0x2aa49f['id'];if(_0x317aef[_0x45f3('0x47')][_0x45f3('0x53')]){_0x3d6a53['where']=_['merge'](_0x3d6a53[_0x45f3('0x50')],{'$or':_[_0x45f3('0x55')](_0x3d6a53[_0x45f3('0x4b')],function(_0x5095c4){var _0x54ef5e={};_0x54ef5e[_0x5095c4]={'$like':'%'+_0x317aef[_0x45f3('0x47')][_0x45f3('0x53')]+'%'};return _0x54ef5e;})});}if(_0x317aef[_0x45f3('0x47')]['$gte']){var _0x3d228f=_0x317aef['query'][_0x45f3('0x9b')]['split'](',');var _0x2810ac={};_0x2810ac[_0x3d228f[0x0]]={'$gte':moment(_0x3d228f[0x1])['format'](_0x45f3('0x9c'))};_0x3d6a53['where']=_[_0x45f3('0x54')](_0x3d6a53[_0x45f3('0x50')],_0x2810ac);}_0x3d6a53=_[_0x45f3('0x54')]({},_0x3d6a53,_0x317aef[_0x45f3('0x68')]);return db[_0x45f3('0x9a')][_0x45f3('0x22')]({'where':_0x3d6a53['where']})[_0x45f3('0xf')](function(_0x5cdc30){_0x4b50d6['count']=_0x5cdc30;if(_0x317aef['query'][_0x45f3('0x57')]){_0x3d6a53['include']=[{'all':!![]}];}return db['MailMessage'][_0x45f3('0x59')](_0x3d6a53);})[_0x45f3('0xf')](function(_0x192179){if(_0x317aef[_0x45f3('0x47')][_0x45f3('0x9d')]===_0x45f3('0x9e')){for(var _0x45e9d1=0x0;_0x45e9d1<_0x192179['length'];_0x45e9d1++){_0x192179[_0x45e9d1][_0x45f3('0x5d')]=juice(_0x192179[_0x45e9d1][_0x45f3('0x5d')]);}}_0x4b50d6['rows']=_0x192179;return _0x4b50d6;});}})[_0x45f3('0xf')](respondWithFilteredResult(_0x525319,_0x3d6a53))['catch'](handleError(_0x525319,null));};exports['send']=function(_0x20d4d7,_0x4fbf46){var _0x14c185,_0x2820c2={},_0x3803cc;if(_0x20d4d7[_0x45f3('0x5d')]['to']){_0x3803cc=_0x20d4d7[_0x45f3('0x5d')]['to'][_0x45f3('0x9f')](',')[0x0];}return db[_0x45f3('0x44')][_0x45f3('0x5c')]({'where':{'id':_0x20d4d7[_0x45f3('0x5b')]['id']},'include':[{'model':db[_0x45f3('0xa0')],'as':'List','include':[{'model':db[_0x45f3('0x85')],'as':'Contacts','where':{'email':_0x3803cc},'limit':0x1,'order':[[_0x45f3('0xa1'),_0x45f3('0xa2')]]}]},{'model':db[_0x45f3('0x41')],'as':_0x45f3('0x3f'),'raw':!![],'include':[{'model':db[_0x45f3('0xa3')],'as':_0x45f3('0xa3'),'raw':!![]}]}]})[_0x45f3('0xf')](handleEntityNotFound(_0x4fbf46,null))[_0x45f3('0xf')](function(_0x48e0ac){if(!_0x48e0ac)return;_0x14c185=_0x48e0ac;if(!_0x48e0ac[_0x45f3('0x3f')])throw new Error(_0x45f3('0xa4'));if(_['isNil'](_0x20d4d7[_0x45f3('0x5d')][_0x45f3('0xa5')])){_0x20d4d7['body'][_0x45f3('0xa5')]=util[_0x45f3('0xa6')](_0x45f3('0xa7'),_0x48e0ac[_0x45f3('0x2a')],_0x48e0ac[_0x45f3('0x73')]||_0x48e0ac[_0x45f3('0x3f')][_0x45f3('0x33')]);}if(_0x20d4d7[_0x45f3('0x5d')][_0x45f3('0xa8')]&&_0x20d4d7[_0x45f3('0x5d')][_0x45f3('0xa8')]['length']){for(var _0x133727=0x0;_0x133727<_0x20d4d7[_0x45f3('0x5d')][_0x45f3('0xa8')][_0x45f3('0x4d')];_0x133727+=0x1){_0x20d4d7[_0x45f3('0x5d')][_0x45f3('0xa8')][_0x133727]={'filename':_0x20d4d7[_0x45f3('0x5d')][_0x45f3('0xa8')][_0x133727][_0x45f3('0x2a')],'path':path[_0x45f3('0xa9')](config['root'],_0x45f3('0xaa'),_0x20d4d7[_0x45f3('0x5d')][_0x45f3('0xa8')][_0x133727][_0x45f3('0xab')])};}}var _0x31378f=_0x48e0ac[_0x45f3('0xac')]();return respondWithRpcPromise(_0x45f3('0xad'),_0x45f3('0xae'),{'account':_0x31378f,'message':_0x20d4d7[_0x45f3('0x5d')]});})[_0x45f3('0xf')](function(_0x3fb0b8){if(!_0x3fb0b8)return;_0x2820c2=_0x3fb0b8;if(!_0x14c185[_0x45f3('0xaf')])throw new Error(_0x45f3('0xb0'));if(_0x14c185[_0x45f3('0xaf')][_0x45f3('0xb1')][_0x45f3('0x4d')])return _0x14c185[_0x45f3('0xaf')]['Contacts'][0x0];return db[_0x45f3('0x85')]['create'](_['defaults'](_0x20d4d7[_0x45f3('0x5d')],{'firstName':_0x20d4d7[_0x45f3('0x5d')]['to'],'email':_0x20d4d7['body']['to'],'phone':_0x20d4d7[_0x45f3('0x5d')]['to'],'ListId':_0x14c185[_0x45f3('0xb2')]}));})[_0x45f3('0xf')](function(_0x1d5715){if(!_0x1d5715)return;var _0x200368={'UserId':_0x20d4d7[_0x45f3('0x33')]['id'],'ContactId':_0x1d5715['id'],'MailAccountId':_0x14c185['id'],'inReplyTo':_0x2820c2[_0x45f3('0xb3')],'to':_0x20d4d7[_0x45f3('0x5d')][_0x45f3('0xa5')],'cc':_0x20d4d7['body']['cc'],'subject':_0x20d4d7['body'][_0x45f3('0xb4')],'attach':_0x20d4d7[_0x45f3('0x5d')][_0x45f3('0xb5')],'firstMsgDirection':_0x45f3('0xb6'),'lastMsgAt':moment()[_0x45f3('0xa6')](_0x45f3('0x9c')),'lastMsgDirection':_0x45f3('0xb6'),'Messages':[_[_0x45f3('0x54')](_0x20d4d7[_0x45f3('0x5d')],{'messageId':_0x2820c2[_0x45f3('0xb3')],'sentAt':moment()[_0x45f3('0xa6')](_0x45f3('0x9c')),'read':!![],'MailAccountId':_0x14c185['id'],'UserId':_0x20d4d7[_0x45f3('0x33')]['id'],'ContactId':_0x1d5715['id']})]};if(_0x20d4d7[_0x45f3('0x5d')][_0x45f3('0xb7')]){_0x200368=_[_0x45f3('0x54')](_0x200368,_0x20d4d7[_0x45f3('0x5d')][_0x45f3('0xb7')]);}return db[_0x45f3('0x83')][_0x45f3('0x63')](_0x200368,{'include':[{'model':db[_0x45f3('0x9a')],'as':_0x45f3('0xb8')}]});})[_0x45f3('0xf')](respondWithResult(_0x4fbf46,null))[_0x45f3('0x1a')](handleError(_0x4fbf46,null));};exports[_0x45f3('0xb9')]=function(_0x197447,_0x220547){return db[_0x45f3('0x44')]['find']({'where':{'id':_0x197447[_0x45f3('0x5b')]['id']},'include':[{'model':db['MailServerOut'],'as':_0x45f3('0x3f'),'raw':!![],'include':[{'model':db[_0x45f3('0xa3')],'as':'CloudProvider','raw':!![]}]}]})[_0x45f3('0xf')](handleEntityNotFound(_0x220547,null))[_0x45f3('0xf')](function(_0x318645){if(!_0x318645[_0x45f3('0x3f')])return;var _0x4209ff=_0x318645[_0x45f3('0xac')]();return respondWithRpcPromise(_0x45f3('0xba'),_0x45f3('0xb9'),{'account':_0x4209ff});})[_0x45f3('0xf')](respondWithResult(_0x220547,null))[_0x45f3('0x1a')](handleError(_0x220547,null));};exports[_0x45f3('0x26')]=function(_0x25018a,_0x1093de){return db[_0x45f3('0x44')][_0x45f3('0x5c')]({'where':{'id':_0x25018a[_0x45f3('0x5b')]['id']}})['then'](handleEntityNotFound(_0x1093de,null))[_0x45f3('0xf')](function(_0x1edcc9){if(_0x1edcc9&&_0x1edcc9[_0x45f3('0x3c')]){throw new db['Sequelize'][(_0x45f3('0xbb'))](_0x45f3('0xbc'));}return _0x1edcc9;})['then'](removeEntity(_0x1093de,null))[_0x45f3('0x1a')](handleError(_0x1093de,null));};exports[_0x45f3('0xbd')]=function(_0x3a9763,_0x384ada){return db[_0x45f3('0x44')][_0x45f3('0x5c')]({'where':{'id':_0x3a9763[_0x45f3('0x5b')]['id']}})[_0x45f3('0xf')](handleEntityNotFound(_0x384ada,null))['then'](function(_0x49cf52){if(_0x49cf52){return _0x49cf52['addAgents'](_0x3a9763[_0x45f3('0x5d')][_0x45f3('0x6b')],_[_0x45f3('0x84')](_0x3a9763[_0x45f3('0x5d')],[_0x45f3('0x6b'),'id'])||{})[_0x45f3('0xbe')](function(_0x157a58){for(var _0x449229=0x0;_0x449229<_0x3a9763[_0x45f3('0x5d')]['ids'][_0x45f3('0x4d')];_0x449229+=0x1){socket['emit'](_0x45f3('0xbf'),{'UserId':Number(_0x3a9763[_0x45f3('0x5d')][_0x45f3('0x6b')][_0x449229]),'MailAccountId':Number(_0x3a9763['params']['id'])});}return _0x157a58;});}})[_0x45f3('0xf')](respondWithResult(_0x384ada,null))[_0x45f3('0x1a')](handleError(_0x384ada,null));};exports[_0x45f3('0xc0')]=function(_0x305689,_0x5d69d2){return db[_0x45f3('0x44')][_0x45f3('0x5c')]({'where':{'id':_0x305689[_0x45f3('0x5b')]['id']}})[_0x45f3('0xf')](handleEntityNotFound(_0x5d69d2,null))[_0x45f3('0xf')](function(_0x45efed){if(_0x45efed){return _0x45efed[_0x45f3('0xc0')](_0x305689[_0x45f3('0x47')]['ids'])['then'](function(){if(_[_0x45f3('0xc1')](_0x305689[_0x45f3('0x47')][_0x45f3('0x6b')])){for(var _0x3bf4c3=0x0;_0x3bf4c3<_0x305689[_0x45f3('0x47')][_0x45f3('0x6b')]['length'];_0x3bf4c3+=0x1){socket[_0x45f3('0xc2')](_0x45f3('0xc3'),{'UserId':Number(_0x305689['query'][_0x45f3('0x6b')][_0x3bf4c3]),'MailAccountId':Number(_0x305689[_0x45f3('0x5b')]['id'])});}}else{socket[_0x45f3('0xc2')]('userMailAccount:remove',{'UserId':Number(_0x305689[_0x45f3('0x47')]['ids']),'MailAccountId':Number(_0x305689[_0x45f3('0x5b')]['id'])});}});}})[_0x45f3('0xf')](respondWithStatusCode(_0x5d69d2,null))['catch'](handleError(_0x5d69d2,null));};exports[_0x45f3('0xc4')]=function(_0x1dbb0f,_0x5316eb){var _0x33a0b3={};var _0x866310={};var _0x2c74f1;var _0x457cea;return db[_0x45f3('0x44')][_0x45f3('0x6e')]({'where':{'id':_0x1dbb0f[_0x45f3('0x5b')]['id']}})[_0x45f3('0xf')](handleEntityNotFound(_0x5316eb,null))['then'](function(_0x1a46be){if(_0x1a46be){_0x2c74f1=_0x1a46be;_0x866310[_0x45f3('0x4a')]=_['keys'](db[_0x45f3('0x86')][_0x45f3('0x66')]);_0x866310[_0x45f3('0x47')]=_[_0x45f3('0x48')](_0x1dbb0f[_0x45f3('0x47')]);_0x866310[_0x45f3('0x51')]=_[_0x45f3('0x49')](_0x866310[_0x45f3('0x4a')],_0x866310[_0x45f3('0x47')]);_0x33a0b3[_0x45f3('0x4b')]=_['intersection'](_0x866310[_0x45f3('0x4a')],qs[_0x45f3('0x4c')](_0x1dbb0f[_0x45f3('0x47')][_0x45f3('0x4c')]));_0x33a0b3[_0x45f3('0x4b')]=_0x33a0b3[_0x45f3('0x4b')][_0x45f3('0x4d')]?_0x33a0b3[_0x45f3('0x4b')]:_0x866310['model'];_0x33a0b3[_0x45f3('0x6f')]=qs[_0x45f3('0x4f')](_0x1dbb0f[_0x45f3('0x47')]['sort']);_0x33a0b3[_0x45f3('0x50')]=qs[_0x45f3('0x51')](_[_0x45f3('0x52')](_0x1dbb0f['query'],_0x866310[_0x45f3('0x51')]));if(_0x1dbb0f[_0x45f3('0x47')][_0x45f3('0x53')]){_0x33a0b3[_0x45f3('0x50')]=_[_0x45f3('0x54')](_0x33a0b3['where'],{'$or':_[_0x45f3('0x55')](_0x33a0b3[_0x45f3('0x4b')],function(_0x13f69d){var _0x537604={};_0x537604[_0x13f69d]={'$like':'%'+_0x1dbb0f[_0x45f3('0x47')][_0x45f3('0x53')]+'%'};return _0x537604;})});}_0x33a0b3=_[_0x45f3('0x54')]({},_0x33a0b3,_0x1dbb0f[_0x45f3('0x68')]);return _0x2c74f1['getAgents'](_0x33a0b3);}})[_0x45f3('0xf')](function(_0x3e7ae6){if(_0x3e7ae6){_0x457cea=_0x3e7ae6[_0x45f3('0x4d')];if(!_0x1dbb0f['query'][_0x45f3('0x67')](_0x45f3('0x4e'))){_0x33a0b3['limit']=qs['limit'](_0x1dbb0f[_0x45f3('0x47')][_0x45f3('0x20')]);_0x33a0b3[_0x45f3('0x1f')]=qs[_0x45f3('0x1f')](_0x1dbb0f[_0x45f3('0x47')][_0x45f3('0x1f')]);}return _0x2c74f1[_0x45f3('0xc4')](_0x33a0b3);}})[_0x45f3('0xf')](function(_0x5ba293){if(_0x5ba293){return _0x5ba293?{'count':_0x457cea,'rows':_0x5ba293}:null;}})[_0x45f3('0xf')](respondWithResult(_0x5316eb,null))[_0x45f3('0x1a')](handleError(_0x5316eb,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index c8df69b..0dae5e2 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 _0xf194=['save','update','emit','hasOwnProperty','hook','exports','../../mysqldb','MailAccount','setMaxListeners'];(function(_0x275896,_0x518a08){var _0x11b763=function(_0x39fa05){while(--_0x39fa05){_0x275896['push'](_0x275896['shift']());}};_0x11b763(++_0x518a08);}(_0xf194,0x19b));var _0x4f19=function(_0x41db59,_0x5d725f){_0x41db59=_0x41db59-0x0;var _0x20a99b=_0xf194[_0x41db59];return _0x20a99b;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0x4f19('0x0'))['db'][_0x4f19('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x4f19('0x2')](0x0);var events={'afterCreate':_0x4f19('0x3'),'afterUpdate':_0x4f19('0x4'),'afterDestroy':'remove'};function emitEvent(_0xad1c0e){return function(_0x2db23f,_0x47c5d4,_0x5a5d23){MailAccountEvents[_0x4f19('0x5')](_0xad1c0e+':'+_0x2db23f['id'],_0x2db23f);MailAccountEvents[_0x4f19('0x5')](_0xad1c0e,_0x2db23f);_0x5a5d23(null);};}for(var e in events){if(events[_0x4f19('0x6')](e)){var event=events[e];MailAccount[_0x4f19('0x7')](e,emitEvent(event));}}module[_0x4f19('0x8')]=MailAccountEvents; \ No newline at end of file +var _0xfa75=['events','../../mysqldb','MailAccount','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x26b8a8,_0xd715e3){var _0x41bdf5=function(_0x1829e5){while(--_0x1829e5){_0x26b8a8['push'](_0x26b8a8['shift']());}};_0x41bdf5(++_0xd715e3);}(_0xfa75,0x1ef));var _0x5fa7=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfa75[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x5fa7('0x0'));var MailAccount=require(_0x5fa7('0x1'))['db'][_0x5fa7('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5fa7('0x3'),'afterUpdate':_0x5fa7('0x4'),'afterDestroy':_0x5fa7('0x5')};function emitEvent(_0x30dfd9){return function(_0x4c1a34,_0x6a44ff,_0xd10f54){MailAccountEvents[_0x5fa7('0x6')](_0x30dfd9+':'+_0x4c1a34['id'],_0x4c1a34);MailAccountEvents[_0x5fa7('0x6')](_0x30dfd9,_0x4c1a34);_0xd10f54(null);};}for(var e in events){if(events[_0x5fa7('0x7')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0x5fa7('0x8')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index ed0d743..859df15 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 _0x7828=['mail_accounts','provider','custom','service','host','Smtp','port','secure','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2','user','pass','exports','MailAccount'];(function(_0x25a440,_0x2322a8){var _0x3ccb3f=function(_0x2268c6){while(--_0x2268c6){_0x25a440['push'](_0x25a440['shift']());}};_0x3ccb3f(++_0x2322a8);}(_0x7828,0x1eb));var _0x8782=function(_0x651136,_0x2d12fb){_0x651136=_0x651136-0x0;var _0x2de314=_0x7828[_0x651136];return _0x2de314;};'use strict';var attributes=require('./mailAccount.attributes');module[_0x8782('0x0')]=function(_0x1eb96a){return _0x1eb96a['define'](_0x8782('0x1'),attributes,{'tableName':_0x8782('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x41fd95=this;var _0x4f4216={'id':_0x41fd95['id'],'tls':{'rejectUnauthorized':![]}};if(_0x41fd95[_0x8782('0x3')]!==_0x8782('0x4')){_0x4f4216[_0x8782('0x5')]=_0x41fd95[_0x8782('0x3')];}else{_0x4f4216[_0x8782('0x6')]=_0x41fd95[_0x8782('0x7')]['host'];_0x4f4216[_0x8782('0x8')]=_0x41fd95['Smtp']['port'];_0x4f4216[_0x8782('0x9')]=_0x41fd95[_0x8782('0x7')][_0x8782('0x9')];}if(_0x41fd95[_0x8782('0x7')]['authentication']){if(_0x41fd95['Smtp'][_0x8782('0xa')]){if(!_0x41fd95['Smtp'][_0x8782('0xb')])throw new Error(_0x8782('0xc'));_0x4f4216[_0x8782('0xd')]={'type':_0x8782('0xe'),'user':_0x41fd95[_0x8782('0x7')]['user'],'accessToken':_0x41fd95[_0x8782('0x7')][_0x8782('0xb')]['data5']};}else{_0x4f4216[_0x8782('0xd')]={'user':_0x41fd95[_0x8782('0x7')][_0x8782('0xf')],'pass':_0x41fd95[_0x8782('0x7')][_0x8782('0x10')]};}}return _0x4f4216;}}});}; \ No newline at end of file +var _0x8177=['Cloud\x20Provider\x20configuration\x20not\x20found','pass','exports','define','MailAccount','mail_accounts','provider','custom','service','host','Smtp','port','secure','authentication','CloudProvider'];(function(_0x2c7860,_0x32d9d0){var _0x16bdfc=function(_0x327c98){while(--_0x327c98){_0x2c7860['push'](_0x2c7860['shift']());}};_0x16bdfc(++_0x32d9d0);}(_0x8177,0xa7));var _0x7817=function(_0x2e0a85,_0xe2cac1){_0x2e0a85=_0x2e0a85-0x0;var _0x2aa779=_0x8177[_0x2e0a85];return _0x2aa779;};'use strict';var attributes=require('./mailAccount.attributes');module[_0x7817('0x0')]=function(_0x38423f){return _0x38423f[_0x7817('0x1')](_0x7817('0x2'),attributes,{'tableName':_0x7817('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x451e6b=this;var _0x4300a0={'id':_0x451e6b['id'],'tls':{'rejectUnauthorized':![]}};if(_0x451e6b[_0x7817('0x4')]!==_0x7817('0x5')){_0x4300a0[_0x7817('0x6')]=_0x451e6b[_0x7817('0x4')];}else{_0x4300a0[_0x7817('0x7')]=_0x451e6b[_0x7817('0x8')][_0x7817('0x7')];_0x4300a0[_0x7817('0x9')]=_0x451e6b[_0x7817('0x8')][_0x7817('0x9')];_0x4300a0['secure']=_0x451e6b[_0x7817('0x8')][_0x7817('0xa')];}if(_0x451e6b[_0x7817('0x8')][_0x7817('0xb')]){if(_0x451e6b['Smtp']['modernAuthentication']){if(!_0x451e6b[_0x7817('0x8')][_0x7817('0xc')])throw new Error(_0x7817('0xd'));_0x4300a0['auth']={'type':'OAuth2','user':_0x451e6b[_0x7817('0x8')]['user'],'accessToken':_0x451e6b[_0x7817('0x8')][_0x7817('0xc')]['data5']};}else{_0x4300a0['auth']={'user':_0x451e6b[_0x7817('0x8')]['user'],'pass':_0x451e6b[_0x7817('0x8')][_0x7817('0xe')]};}}return _0x4300a0;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 62b2c80..a9f81c5 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 _0xd943=['MailServerOut','Smtp','CloudProvider','get','account','omit','smtpOptions','applications','list','asc','autoclose','close','Contacts','length','defaults','ListId','List\x20not\x20found','contact','messageId','generate','subject','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','Messages','create','spread','attach','interaction','created','attachments','originTo','originCc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','User','name','agent','waitForTheAssignedAgent','Start','startRouting','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','redis','socket.io-emitter','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','MailAccount','findAll','options','where','attributes','limit','include','map','model','stringify','GetMailAccount','ShowMailAccount','smtp','setDataValue','getSmtpOptions','NotifyMailAccount','body','mail','difference','keys','CmContact','updatedAt','CompanyId','isNil','from','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','List','DESC','MailApplication','Applications'];(function(_0x1f345c,_0x8c11d0){var _0x936d3c=function(_0x525f4a){while(--_0x525f4a){_0x1f345c['push'](_0x1f345c['shift']());}};_0x936d3c(++_0x8c11d0);}(_0xd943,0x15d));var _0x3d94=function(_0x3d11f6,_0x208e17){_0x3d11f6=_0x3d11f6-0x0;var _0x46ab84=_0xd943[_0x3d11f6];return _0x46ab84;};'use strict';var _=require(_0x3d94('0x0'));var moment=require(_0x3d94('0x1'));var BPromise=require(_0x3d94('0x2'));var rs=require(_0x3d94('0x3'));var Redis=require('ioredis');var db=require(_0x3d94('0x4'))['db'];var logger=require(_0x3d94('0x5'))(_0x3d94('0x6'));var config=require(_0x3d94('0x7'));var jayson=require(_0x3d94('0x8'));var client=jayson['client']['http']({'port':0x232c});config[_0x3d94('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3d94('0xa'))(new Redis(config[_0x3d94('0x9')]));require('./mailAccount.socket')['register'](socket);function respondWithRpcPromise(_0x3984a3,_0x27e381,_0x1cc58c){return new BPromise(function(_0x5908a7,_0x182066){return client['request'](_0x3984a3,_0x1cc58c)[_0x3d94('0xb')](function(_0x301536){logger['info'](_0x3d94('0xc'),_0x27e381,_0x3d94('0xd'));logger[_0x3d94('0xe')](_0x3d94('0xf'),_0x27e381,_0x3d94('0xd'),JSON['stringify'](_0x301536));if(_0x301536[_0x3d94('0x10')]){if(_0x301536[_0x3d94('0x10')][_0x3d94('0x11')]===0x1f4){logger['error'](_0x3d94('0xc'),_0x27e381,_0x301536[_0x3d94('0x10')][_0x3d94('0x12')]);return _0x182066(_0x301536['error'][_0x3d94('0x12')]);}logger[_0x3d94('0x10')](_0x3d94('0xc'),_0x27e381,_0x301536[_0x3d94('0x10')][_0x3d94('0x12')]);return _0x5908a7(_0x301536[_0x3d94('0x10')][_0x3d94('0x12')]);}else{logger[_0x3d94('0x13')]('MailAccount,\x20%s,\x20%s',_0x27e381,_0x3d94('0xd'));_0x5908a7(_0x301536[_0x3d94('0x14')][_0x3d94('0x12')]);}})[_0x3d94('0x15')](function(_0x4afc92){logger[_0x3d94('0x10')](_0x3d94('0xc'),_0x27e381,_0x4afc92);_0x182066(_0x4afc92);});});}exports['GetMailAccount']=function(_0x9bca24){var _0x59b741=this;return new Promise(function(_0x28bead,_0x193934){return db[_0x3d94('0x16')][_0x3d94('0x17')]({'raw':_0x9bca24[_0x3d94('0x18')]?_0x9bca24['options']['raw']===undefined?!![]:![]:!![],'where':_0x9bca24[_0x3d94('0x18')]?_0x9bca24[_0x3d94('0x18')][_0x3d94('0x19')]||null:null,'attributes':_0x9bca24['options']?_0x9bca24[_0x3d94('0x18')][_0x3d94('0x1a')]||null:null,'limit':_0x9bca24[_0x3d94('0x18')]?_0x9bca24[_0x3d94('0x18')][_0x3d94('0x1b')]||null:null,'include':_0x9bca24[_0x3d94('0x18')]?_0x9bca24[_0x3d94('0x18')][_0x3d94('0x1c')]?_[_0x3d94('0x1d')](_0x9bca24[_0x3d94('0x18')][_0x3d94('0x1c')],function(_0x192839){return{'model':db[_0x192839[_0x3d94('0x1e')]],'as':_0x192839['as'],'attributes':_0x192839[_0x3d94('0x1a')],'include':_0x192839[_0x3d94('0x1c')]?_['map'](_0x192839[_0x3d94('0x1c')],function(_0x558fd2){return{'model':db[_0x558fd2[_0x3d94('0x1e')]],'as':_0x558fd2['as'],'attributes':_0x558fd2[_0x3d94('0x1a')],'include':_0x558fd2[_0x3d94('0x1c')]?_[_0x3d94('0x1d')](_0x558fd2[_0x3d94('0x1c')],function(_0x82b568){return{'model':db[_0x82b568[_0x3d94('0x1e')]],'as':_0x82b568['as'],'attributes':_0x82b568['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x362642){logger['info']('GetMailAccount',_0x9bca24);logger[_0x3d94('0xe')]('GetMailAccount',_0x9bca24,JSON[_0x3d94('0x1f')](_0x362642));_0x28bead(_0x362642);})[_0x3d94('0x15')](function(_0x32403a){logger['error'](_0x3d94('0x20'),_0x32403a['message'],_0x9bca24);_0x193934(_0x59b741[_0x3d94('0x10')](0x1f4,_0x32403a['message']));});});};exports[_0x3d94('0x21')]=function(_0x215ad7){var _0x29b1ff=this;return new Promise(function(_0x246f88,_0x50560c){return db[_0x3d94('0x16')]['find']({'raw':_0x215ad7[_0x3d94('0x18')]?_0x215ad7[_0x3d94('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x215ad7['options']?_0x215ad7[_0x3d94('0x18')][_0x3d94('0x19')]||null:null,'attributes':_0x215ad7[_0x3d94('0x18')]?_0x215ad7['options'][_0x3d94('0x1a')]||null:null,'include':_0x215ad7[_0x3d94('0x18')]?_0x215ad7['options'][_0x3d94('0x1c')]?_[_0x3d94('0x1d')](_0x215ad7[_0x3d94('0x18')][_0x3d94('0x1c')],function(_0x782c1){return{'model':db[_0x782c1['model']],'as':_0x782c1['as'],'attributes':_0x782c1[_0x3d94('0x1a')],'include':_0x782c1[_0x3d94('0x1c')]?_[_0x3d94('0x1d')](_0x782c1[_0x3d94('0x1c')],function(_0xb493f1){return{'model':db[_0xb493f1[_0x3d94('0x1e')]],'as':_0xb493f1['as'],'attributes':_0xb493f1['attributes'],'include':_0xb493f1['include']?_[_0x3d94('0x1d')](_0xb493f1[_0x3d94('0x1c')],function(_0x1c1b25){return{'model':db[_0x1c1b25[_0x3d94('0x1e')]],'as':_0x1c1b25['as'],'attributes':_0x1c1b25[_0x3d94('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x3d94('0xb')](function(_0x2ef743){if(_0x215ad7[_0x3d94('0x18')][_0x3d94('0x22')]===!![])_0x2ef743[_0x3d94('0x23')]('smtpOptions',_0x2ef743[_0x3d94('0x24')]());logger[_0x3d94('0x13')](_0x3d94('0x21'),_0x215ad7);logger[_0x3d94('0xe')]('ShowMailAccount',_0x215ad7,JSON[_0x3d94('0x1f')](_0x2ef743));_0x246f88(_0x2ef743);})[_0x3d94('0x15')](function(_0x35e0e6){logger[_0x3d94('0x10')](_0x3d94('0x21'),_0x35e0e6['message'],_0x215ad7);_0x50560c(_0x29b1ff[_0x3d94('0x10')](0x1f4,_0x35e0e6[_0x3d94('0x12')]));});});};exports[_0x3d94('0x25')]=function(_0x485066){var _0x4eee4d=this;return new Promise(function(_0x4d8a8f,_0x47905e){var _0x3b3550={'body':_0x485066[_0x3d94('0x26')],'channel':_0x3d94('0x27')};var _0x146ccb=_[_0x3d94('0x28')](_[_0x3d94('0x29')](db[_0x3d94('0x2a')]['rawAttributes']),['createdAt',_0x3d94('0x2b'),_0x3d94('0x2c'),'ListId']);var _0x2d0aa2=![];if(_0x485066['body']['id']){delete _0x485066[_0x3d94('0x26')]['id'];}if(_[_0x3d94('0x2d')](_0x485066[_0x3d94('0x26')][_0x3d94('0x2e')])){return _0x47905e(_0x4eee4d[_0x3d94('0x10')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x3d94('0x2d')](_0x485066[_0x3d94('0x26')][_0x3d94('0x26')])||_0x485066['body'][_0x3d94('0x26')]===''){return _0x47905e(_0x4eee4d['error'](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x3d94('0x2d')](_0x485066[_0x3d94('0x26')][_0x3d94('0x2f')])){return _0x47905e(_0x4eee4d[_0x3d94('0x10')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x146ccb));}if(!_[_0x3d94('0x30')](_0x146ccb,_0x485066['body'][_0x3d94('0x2f')])){return _0x47905e(_0x4eee4d[_0x3d94('0x10')](0x1f4,_0x3d94('0x31')+_0x146ccb));}var _0x15c8e7={};_0x15c8e7[_0x485066[_0x3d94('0x26')][_0x3d94('0x2f')]]=_0x485066[_0x3d94('0x26')]['from'];return db[_0x3d94('0x16')][_0x3d94('0x32')]({'where':{'id':_0x485066['account']['id']},'include':[{'model':db['CmList'],'as':_0x3d94('0x33'),'include':[{'model':db[_0x3d94('0x2a')],'as':'Contacts','where':_0x15c8e7,'limit':0x1,'order':[[_0x3d94('0x2b'),_0x3d94('0x34')]]}]},{'model':db[_0x3d94('0x35')],'as':_0x3d94('0x36')},{'model':db[_0x3d94('0x37')],'as':_0x3d94('0x38'),'include':[{'model':db[_0x3d94('0x39')],'as':_0x3d94('0x39')}]}]})[_0x3d94('0xb')](function(_0x2429bc){if(_0x2429bc&&_0x2429bc[_0x3d94('0x33')]){var _0x29682b=_0x2429bc[_0x3d94('0x3a')]({'plain':!![]});_0x3b3550[_0x3d94('0x3b')]=_[_0x3d94('0x3c')](_0x29682b,['Applications',_0x3d94('0x33')]);_0x3b3550[_0x3d94('0x3b')][_0x3d94('0x3d')]=_0x2429bc[_0x3d94('0x24')]();_0x3b3550[_0x3d94('0x3e')]=_0x29682b[_0x3d94('0x36')];_0x3b3550[_0x3d94('0x3f')]=_0x29682b[_0x3d94('0x33')];_0x3b3550[_0x3d94('0x3e')]=_['orderBy'](_0x3b3550[_0x3d94('0x3e')],['priority'],[_0x3d94('0x40')]);if(_0x3b3550[_0x3d94('0x3b')]&&_0x3b3550['account'][_0x3d94('0x41')]){_0x3b3550['applications']['push']({'id':0x0,'priority':_0x3b3550[_0x3d94('0x3e')]['length']+0x1,'app':_0x3d94('0x42'),'appdata':_0x3d94('0x41'),'interval':'*,*,*,*'});}if(_0x3b3550[_0x3d94('0x3b')]['Applications']){delete _0x3b3550['account'][_0x3d94('0x36')];}if(_0x3b3550[_0x3d94('0x3b')][_0x3d94('0x33')]){delete _0x3b3550[_0x3d94('0x3b')][_0x3d94('0x33')];}if(_0x29682b[_0x3d94('0x33')][_0x3d94('0x43')][_0x3d94('0x44')]){return _0x29682b[_0x3d94('0x33')]['Contacts'][0x0];}var _0x28cfbb=_[_0x3d94('0x45')](_0x485066[_0x3d94('0x26')],{'firstName':_0x485066[_0x3d94('0x26')][_0x3d94('0x2e')],'ListId':_0x29682b[_0x3d94('0x46')]});_0x28cfbb[_0x485066[_0x3d94('0x26')][_0x3d94('0x2f')]]=_0x485066[_0x3d94('0x26')][_0x3d94('0x2e')];return db[_0x3d94('0x2a')]['create'](_0x28cfbb);}else{throw new Error(_0x3d94('0x47'));}})['then'](function(_0x709841){_0x3b3550[_0x3d94('0x48')]=_0x709841;if(_0x709841){if(!_0x485066[_0x3d94('0x26')][_0x3d94('0x12')][_0x3d94('0x49')]){_0x485066[_0x3d94('0x26')][_0x3d94('0x12')][_0x3d94('0x49')]=rs[_0x3d94('0x4a')]()+'\x20'+_0x485066['body']['message'][_0x3d94('0x2e')];}var _0x4bd97c={'ContactId':_0x709841['id'],'MailAccountId':_0x485066[_0x3d94('0x3b')]['id'],'inReplyTo':_0x485066[_0x3d94('0x26')]['message'][_0x3d94('0x49')],'to':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')][_0x3d94('0x2e')],'cc':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')]['cc'],'subject':_0x485066[_0x3d94('0x26')]['message'][_0x3d94('0x4b')],'attach':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')]['attach'],'lastMsgAt':moment()[_0x3d94('0x4c')](_0x3d94('0x4d')),'lastMsgDirection':'in'};return db[_0x3d94('0x4e')][_0x3d94('0x32')]({'where':{'closed':![],'MailAccountId':_0x485066['account']['id']},'include':[{'model':db['MailMessage'],'as':_0x3d94('0x4f'),'attributes':[_0x3d94('0x49')],'where':{'messageId':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')]['inReplyTo']}}]})[_0x3d94('0xb')](function(_0x1c99d1){if(_0x1c99d1){return[_0x1c99d1,![]];}return db['MailInteraction'][_0x3d94('0x50')](_0x4bd97c)[_0x3d94('0xb')](function(_0x336e36){return[_0x336e36,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x3d94('0x51')](function(_0x227372,_0x585531){if(_0x227372){_0x2d0aa2=_0x585531;if(!_0x585531){return _0x227372['update']({'inReplyTo':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')]['messageId'],'to':_0x485066['body']['message'][_0x3d94('0x2e')],'cc':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')]['cc'],'subject':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')]['subject'],'attach':_0x227372[_0x3d94('0x52')]?_0x227372[_0x3d94('0x52')]:_0x485066[_0x3d94('0x26')][_0x3d94('0x12')][_0x3d94('0x52')],'substatus':null,'substatusAt':moment()[_0x3d94('0x4c')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0x3d94('0x4c')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x227372;}}})[_0x3d94('0xb')](function(_0x41d561){_0x3b3550[_0x3d94('0x53')]=_0x41d561[_0x3d94('0x3a')]({'plain':!![]});_0x3b3550[_0x3d94('0x53')][_0x3d94('0x54')]=_0x2d0aa2;return db['MailMessage']['create']({'body':_0x485066[_0x3d94('0x26')]['body'],'MailAccountId':_0x485066['account']['id'],'MailInteractionId':_0x41d561['id'],'direction':'in','ContactId':_0x3b3550['contact']['id'],'messageId':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')][_0x3d94('0x49')],'from':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')][_0x3d94('0x2e')],'to':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')]['to'],'cc':_0x485066['body'][_0x3d94('0x12')]['cc'],'subject':_0x485066['body'][_0x3d94('0x12')][_0x3d94('0x4b')],'attach':_0x485066[_0x3d94('0x26')]['message']['attach'],'Attachments':_0x485066['body'][_0x3d94('0x12')][_0x3d94('0x55')],'originTo':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')][_0x3d94('0x56')],'originCc':_0x485066['body']['message'][_0x3d94('0x57')],'bcc':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')]['bcc'],'ChatWebsiteId':_0x485066[_0x3d94('0x26')]['message'][_0x3d94('0x58')]||null,'originChannel':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')][_0x3d94('0x59')]||_0x3d94('0x5a'),'ChatOfflineMessageId':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')][_0x3d94('0x5b')]||null},{'include':[{'model':db[_0x3d94('0x5c')],'as':_0x3d94('0x5d')}]});})[_0x3d94('0xb')](function(_0xe6cfd1){_0x3b3550[_0x3d94('0x12')]=_0xe6cfd1;if(_0x3b3550['interaction'][_0x3d94('0x5e')]){return db[_0x3d94('0x5f')][_0x3d94('0x32')]({'attributes':['id',_0x3d94('0x60')],'where':{'id':_0x3b3550['interaction'][_0x3d94('0x5e')]}})['then'](function(_0x4f217f){if(_0x4f217f){_0x3b3550[_0x3d94('0x3e')]['unshift']({'id':0x0,'priority':0x0,'app':_0x3d94('0x61'),'appdata':_0x4f217f[_0x3d94('0x60')]+','+(_0x3b3550['account'][_0x3d94('0x62')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x3d94('0x63'),_0x3d94('0x64'),_0x3b3550);});}return respondWithRpcPromise('Start','startRouting',_0x3b3550);})['then'](function(_0x833d96){_0x4d8a8f(_0x833d96);})['catch'](function(_0x5a8114){_0x47905e(_0x4eee4d[_0x3d94('0x10')](0x1f4,_0x5a8114[_0x3d94('0x12')]));});});}; \ No newline at end of file +var _0x687b=['originTo','originCc','ChatWebsiteId','originChannel','Attachment','Attachments','UserId','agent','name','waitForTheAssignedAgent','Start','startRouting','lodash','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./mailAccount.socket','request','then','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','MailAccount,\x20%s,\x20%s','message','result','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','include','map','model','stringify','catch','ShowMailAccount','find','smtp','setDataValue','getSmtpOptions','NotifyMailAccount','mail','difference','keys','CmContact','rawAttributes','createdAt','CompanyId','body','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','from','account','Contacts','updatedAt','DESC','Applications','MailServerOut','Smtp','CloudProvider','List','omit','applications','list','orderBy','asc','length','close','autoclose','*,*,*,*','ListId','List\x20not\x20found','messageId','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','inReplyTo','create','spread','update','interaction','get','created','contact'];(function(_0x205d4f,_0x1551d7){var _0x2a740b=function(_0x3c9995){while(--_0x3c9995){_0x205d4f['push'](_0x205d4f['shift']());}};_0x2a740b(++_0x1551d7);}(_0x687b,0x14a));var _0xb687=function(_0x5d3550,_0x107033){_0x5d3550=_0x5d3550-0x0;var _0x5d1299=_0x687b[_0x5d3550];return _0x5d1299;};'use strict';var _=require(_0xb687('0x0'));var moment=require(_0xb687('0x1'));var BPromise=require(_0xb687('0x2'));var rs=require(_0xb687('0x3'));var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var logger=require(_0xb687('0x4'))(_0xb687('0x5'));var config=require(_0xb687('0x6'));var jayson=require(_0xb687('0x7'));var client=jayson[_0xb687('0x8')][_0xb687('0x9')]({'port':0x232c});config[_0xb687('0xa')]=_[_0xb687('0xb')](config[_0xb687('0xa')],{'host':_0xb687('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb687('0xa')]));require(_0xb687('0xd'))['register'](socket);function respondWithRpcPromise(_0x1a99c5,_0x21e3ab,_0x825ad){return new BPromise(function(_0x15dc9a,_0x404fdb){return client[_0xb687('0xe')](_0x1a99c5,_0x825ad)[_0xb687('0xf')](function(_0xaf4727){logger[_0xb687('0x10')]('MailAccount,\x20%s,\x20%s',_0x21e3ab,_0xb687('0x11'));logger[_0xb687('0x12')](_0xb687('0x13'),_0x21e3ab,_0xb687('0x11'),JSON['stringify'](_0xaf4727));if(_0xaf4727['error']){if(_0xaf4727[_0xb687('0x14')][_0xb687('0x15')]===0x1f4){logger['error'](_0xb687('0x16'),_0x21e3ab,_0xaf4727[_0xb687('0x14')][_0xb687('0x17')]);return _0x404fdb(_0xaf4727[_0xb687('0x14')][_0xb687('0x17')]);}logger[_0xb687('0x14')](_0xb687('0x16'),_0x21e3ab,_0xaf4727[_0xb687('0x14')][_0xb687('0x17')]);return _0x15dc9a(_0xaf4727[_0xb687('0x14')][_0xb687('0x17')]);}else{logger[_0xb687('0x10')]('MailAccount,\x20%s,\x20%s',_0x21e3ab,_0xb687('0x11'));_0x15dc9a(_0xaf4727[_0xb687('0x18')][_0xb687('0x17')]);}})['catch'](function(_0x48958d){logger[_0xb687('0x14')](_0xb687('0x16'),_0x21e3ab,_0x48958d);_0x404fdb(_0x48958d);});});}exports[_0xb687('0x19')]=function(_0x4b593b){var _0x42cdd2=this;return new Promise(function(_0x481f1d,_0x1bd2bf){return db[_0xb687('0x1a')][_0xb687('0x1b')]({'raw':_0x4b593b[_0xb687('0x1c')]?_0x4b593b['options'][_0xb687('0x1d')]===undefined?!![]:![]:!![],'where':_0x4b593b['options']?_0x4b593b[_0xb687('0x1c')][_0xb687('0x1e')]||null:null,'attributes':_0x4b593b[_0xb687('0x1c')]?_0x4b593b['options'][_0xb687('0x1f')]||null:null,'limit':_0x4b593b[_0xb687('0x1c')]?_0x4b593b[_0xb687('0x1c')][_0xb687('0x20')]||null:null,'include':_0x4b593b[_0xb687('0x1c')]?_0x4b593b[_0xb687('0x1c')][_0xb687('0x21')]?_[_0xb687('0x22')](_0x4b593b['options'][_0xb687('0x21')],function(_0x129347){return{'model':db[_0x129347[_0xb687('0x23')]],'as':_0x129347['as'],'attributes':_0x129347[_0xb687('0x1f')],'include':_0x129347[_0xb687('0x21')]?_[_0xb687('0x22')](_0x129347[_0xb687('0x21')],function(_0x3cb2f2){return{'model':db[_0x3cb2f2[_0xb687('0x23')]],'as':_0x3cb2f2['as'],'attributes':_0x3cb2f2[_0xb687('0x1f')],'include':_0x3cb2f2['include']?_[_0xb687('0x22')](_0x3cb2f2[_0xb687('0x21')],function(_0x392721){return{'model':db[_0x392721[_0xb687('0x23')]],'as':_0x392721['as'],'attributes':_0x392721[_0xb687('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb687('0xf')](function(_0x4e9a06){logger[_0xb687('0x10')]('GetMailAccount',_0x4b593b);logger[_0xb687('0x12')](_0xb687('0x19'),_0x4b593b,JSON[_0xb687('0x24')](_0x4e9a06));_0x481f1d(_0x4e9a06);})[_0xb687('0x25')](function(_0x1ad3ef){logger[_0xb687('0x14')](_0xb687('0x19'),_0x1ad3ef['message'],_0x4b593b);_0x1bd2bf(_0x42cdd2[_0xb687('0x14')](0x1f4,_0x1ad3ef[_0xb687('0x17')]));});});};exports[_0xb687('0x26')]=function(_0x22cd1d){var _0xa18fec=this;return new Promise(function(_0x263834,_0x44be88){return db[_0xb687('0x1a')][_0xb687('0x27')]({'raw':_0x22cd1d[_0xb687('0x1c')]?_0x22cd1d[_0xb687('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x22cd1d['options']?_0x22cd1d[_0xb687('0x1c')][_0xb687('0x1e')]||null:null,'attributes':_0x22cd1d[_0xb687('0x1c')]?_0x22cd1d[_0xb687('0x1c')]['attributes']||null:null,'include':_0x22cd1d['options']?_0x22cd1d[_0xb687('0x1c')][_0xb687('0x21')]?_['map'](_0x22cd1d[_0xb687('0x1c')][_0xb687('0x21')],function(_0x548b83){return{'model':db[_0x548b83[_0xb687('0x23')]],'as':_0x548b83['as'],'attributes':_0x548b83['attributes'],'include':_0x548b83[_0xb687('0x21')]?_[_0xb687('0x22')](_0x548b83[_0xb687('0x21')],function(_0x3e146a){return{'model':db[_0x3e146a[_0xb687('0x23')]],'as':_0x3e146a['as'],'attributes':_0x3e146a[_0xb687('0x1f')],'include':_0x3e146a['include']?_[_0xb687('0x22')](_0x3e146a[_0xb687('0x21')],function(_0x2a73df){return{'model':db[_0x2a73df[_0xb687('0x23')]],'as':_0x2a73df['as'],'attributes':_0x2a73df['attributes']};}):[]};}):[]};}):[]:[]})[_0xb687('0xf')](function(_0x100f4a){if(_0x22cd1d[_0xb687('0x1c')][_0xb687('0x28')]===!![])_0x100f4a[_0xb687('0x29')]('smtpOptions',_0x100f4a[_0xb687('0x2a')]());logger[_0xb687('0x10')](_0xb687('0x26'),_0x22cd1d);logger[_0xb687('0x12')](_0xb687('0x26'),_0x22cd1d,JSON[_0xb687('0x24')](_0x100f4a));_0x263834(_0x100f4a);})['catch'](function(_0x5ad577){logger[_0xb687('0x14')]('ShowMailAccount',_0x5ad577[_0xb687('0x17')],_0x22cd1d);_0x44be88(_0xa18fec[_0xb687('0x14')](0x1f4,_0x5ad577['message']));});});};exports[_0xb687('0x2b')]=function(_0x2ce07a){var _0x57776b=this;return new Promise(function(_0x394b56,_0x28031e){var _0x127b25={'body':_0x2ce07a['body'],'channel':_0xb687('0x2c')};var _0x9cffb2=_[_0xb687('0x2d')](_[_0xb687('0x2e')](db[_0xb687('0x2f')][_0xb687('0x30')]),[_0xb687('0x31'),'updatedAt',_0xb687('0x32'),'ListId']);var _0x50fdb7=![];if(_0x2ce07a[_0xb687('0x33')]['id']){delete _0x2ce07a[_0xb687('0x33')]['id'];}if(_['isNil'](_0x2ce07a[_0xb687('0x33')]['from'])){return _0x28031e(_0x57776b[_0xb687('0x14')](0x1f4,_0xb687('0x34')));}if(_['isNil'](_0x2ce07a[_0xb687('0x33')][_0xb687('0x33')])||_0x2ce07a['body'][_0xb687('0x33')]===''){return _0x28031e(_0x57776b[_0xb687('0x14')](0x1f4,_0xb687('0x35')));}if(_[_0xb687('0x36')](_0x2ce07a[_0xb687('0x33')][_0xb687('0x37')])){return _0x28031e(_0x57776b[_0xb687('0x14')](0x1f4,_0xb687('0x38')+_0x9cffb2));}if(!_[_0xb687('0x39')](_0x9cffb2,_0x2ce07a[_0xb687('0x33')][_0xb687('0x37')])){return _0x28031e(_0x57776b[_0xb687('0x14')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x9cffb2));}var _0x1ac373={};_0x1ac373[_0x2ce07a['body'][_0xb687('0x37')]]=_0x2ce07a[_0xb687('0x33')][_0xb687('0x3a')];return db[_0xb687('0x1a')][_0xb687('0x27')]({'where':{'id':_0x2ce07a[_0xb687('0x3b')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xb687('0x2f')],'as':_0xb687('0x3c'),'where':_0x1ac373,'limit':0x1,'order':[[_0xb687('0x3d'),_0xb687('0x3e')]]}]},{'model':db['MailApplication'],'as':_0xb687('0x3f')},{'model':db[_0xb687('0x40')],'as':_0xb687('0x41'),'include':[{'model':db[_0xb687('0x42')],'as':'CloudProvider'}]}]})[_0xb687('0xf')](function(_0xfc4c5f){if(_0xfc4c5f&&_0xfc4c5f[_0xb687('0x43')]){var _0x401b99=_0xfc4c5f['get']({'plain':!![]});_0x127b25['account']=_[_0xb687('0x44')](_0x401b99,[_0xb687('0x3f'),_0xb687('0x43')]);_0x127b25['account']['smtpOptions']=_0xfc4c5f[_0xb687('0x2a')]();_0x127b25[_0xb687('0x45')]=_0x401b99[_0xb687('0x3f')];_0x127b25[_0xb687('0x46')]=_0x401b99[_0xb687('0x43')];_0x127b25[_0xb687('0x45')]=_[_0xb687('0x47')](_0x127b25[_0xb687('0x45')],['priority'],[_0xb687('0x48')]);if(_0x127b25[_0xb687('0x3b')]&&_0x127b25[_0xb687('0x3b')]['autoclose']){_0x127b25['applications']['push']({'id':0x0,'priority':_0x127b25['applications'][_0xb687('0x49')]+0x1,'app':_0xb687('0x4a'),'appdata':_0xb687('0x4b'),'interval':_0xb687('0x4c')});}if(_0x127b25[_0xb687('0x3b')][_0xb687('0x3f')]){delete _0x127b25[_0xb687('0x3b')][_0xb687('0x3f')];}if(_0x127b25[_0xb687('0x3b')][_0xb687('0x43')]){delete _0x127b25[_0xb687('0x3b')][_0xb687('0x43')];}if(_0x401b99[_0xb687('0x43')][_0xb687('0x3c')][_0xb687('0x49')]){return _0x401b99[_0xb687('0x43')][_0xb687('0x3c')][0x0];}var _0x4dca01=_['defaults'](_0x2ce07a[_0xb687('0x33')],{'firstName':_0x2ce07a[_0xb687('0x33')][_0xb687('0x3a')],'ListId':_0x401b99[_0xb687('0x4d')]});_0x4dca01[_0x2ce07a['body'][_0xb687('0x37')]]=_0x2ce07a[_0xb687('0x33')]['from'];return db[_0xb687('0x2f')]['create'](_0x4dca01);}else{throw new Error(_0xb687('0x4e'));}})[_0xb687('0xf')](function(_0x50fb31){_0x127b25['contact']=_0x50fb31;if(_0x50fb31){if(!_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['messageId']){_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x4f')]=rs['generate']()+'\x20'+_0x2ce07a[_0xb687('0x33')]['message'][_0xb687('0x3a')];}var _0x1a31f6={'ContactId':_0x50fb31['id'],'MailAccountId':_0x2ce07a[_0xb687('0x3b')]['id'],'inReplyTo':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['messageId'],'to':_0x2ce07a['body'][_0xb687('0x17')]['from'],'cc':_0x2ce07a['body']['message']['cc'],'subject':_0x2ce07a['body'][_0xb687('0x17')][_0xb687('0x50')],'attach':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x51')],'lastMsgAt':moment()[_0xb687('0x52')](_0xb687('0x53')),'lastMsgDirection':'in'};return db[_0xb687('0x54')][_0xb687('0x27')]({'where':{'closed':![],'MailAccountId':_0x2ce07a[_0xb687('0x3b')]['id']},'include':[{'model':db[_0xb687('0x55')],'as':'Messages','attributes':['messageId'],'where':{'messageId':_0x2ce07a[_0xb687('0x33')]['message'][_0xb687('0x56')]}}]})[_0xb687('0xf')](function(_0x1c031f){if(_0x1c031f){return[_0x1c031f,![]];}return db[_0xb687('0x54')][_0xb687('0x57')](_0x1a31f6)['then'](function(_0x22da49){return[_0x22da49,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xb687('0x58')](function(_0x293281,_0x18993a){if(_0x293281){_0x50fdb7=_0x18993a;if(!_0x18993a){return _0x293281[_0xb687('0x59')]({'inReplyTo':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x4f')],'to':_0x2ce07a['body'][_0xb687('0x17')][_0xb687('0x3a')],'cc':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['cc'],'subject':_0x2ce07a[_0xb687('0x33')]['message'][_0xb687('0x50')],'attach':_0x293281[_0xb687('0x51')]?_0x293281[_0xb687('0x51')]:_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x51')],'substatus':null,'substatusAt':moment()[_0xb687('0x52')](_0xb687('0x53')),'lastMsgAt':moment()[_0xb687('0x52')](_0xb687('0x53')),'lastMsgDirection':'in'});}else{return _0x293281;}}})[_0xb687('0xf')](function(_0x48838a){_0x127b25[_0xb687('0x5a')]=_0x48838a[_0xb687('0x5b')]({'plain':!![]});_0x127b25[_0xb687('0x5a')][_0xb687('0x5c')]=_0x50fdb7;return db['MailMessage'][_0xb687('0x57')]({'body':_0x2ce07a[_0xb687('0x33')]['body'],'MailAccountId':_0x2ce07a[_0xb687('0x3b')]['id'],'MailInteractionId':_0x48838a['id'],'direction':'in','ContactId':_0x127b25[_0xb687('0x5d')]['id'],'messageId':_0x2ce07a[_0xb687('0x33')]['message'][_0xb687('0x4f')],'from':_0x2ce07a[_0xb687('0x33')]['message'][_0xb687('0x3a')],'to':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['to'],'cc':_0x2ce07a[_0xb687('0x33')]['message']['cc'],'subject':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['subject'],'attach':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['attach'],'Attachments':_0x2ce07a['body'][_0xb687('0x17')]['attachments'],'originTo':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x5e')],'originCc':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x5f')],'bcc':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['bcc'],'ChatWebsiteId':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x60')]||null,'originChannel':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x61')]||'Email','ChatOfflineMessageId':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['ChatOfflineMessageId']||null},{'include':[{'model':db[_0xb687('0x62')],'as':_0xb687('0x63')}]});})[_0xb687('0xf')](function(_0x1227fe){_0x127b25['message']=_0x1227fe;if(_0x127b25[_0xb687('0x5a')]['UserId']){return db['User'][_0xb687('0x27')]({'attributes':['id','name'],'where':{'id':_0x127b25['interaction'][_0xb687('0x64')]}})['then'](function(_0x137631){if(_0x137631){_0x127b25[_0xb687('0x45')]['unshift']({'id':0x0,'priority':0x0,'app':_0xb687('0x65'),'appdata':_0x137631[_0xb687('0x66')]+','+(_0x127b25['account'][_0xb687('0x67')]||0xa),'interval':_0xb687('0x4c')});}return respondWithRpcPromise(_0xb687('0x68'),_0xb687('0x69'),_0x127b25);});}return respondWithRpcPromise(_0xb687('0x68'),_0xb687('0x69'),_0x127b25);})[_0xb687('0xf')](function(_0x2ce516){_0x394b56(_0x2ce516);})[_0xb687('0x25')](function(_0x4092a0){_0x28031e(_0x57776b[_0xb687('0x14')](0x1f4,_0x4092a0['message']));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 9b872bb..c2169f8 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 _0x6245=['update','emit','removeListener','length','mailAccount:','./mailAccount.events','save','remove'];(function(_0x38c508,_0x26a208){var _0x293cf8=function(_0x4b1c2d){while(--_0x4b1c2d){_0x38c508['push'](_0x38c508['shift']());}};_0x293cf8(++_0x26a208);}(_0x6245,0xe5));var _0x5624=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0x6245[_0x934425];return _0x31d596;};'use strict';var MailAccountEvents=require(_0x5624('0x0'));var events=[_0x5624('0x1'),_0x5624('0x2'),_0x5624('0x3')];function createListener(_0x5f07bd,_0x39f0ec){return function(_0x3b2b39){_0x39f0ec[_0x5624('0x4')](_0x5f07bd,_0x3b2b39);};}function removeListener(_0x50e974,_0x16da51){return function(){MailAccountEvents[_0x5624('0x5')](_0x50e974,_0x16da51);};}exports['register']=function(_0x269a95){for(var _0x381b4a=0x0,_0x6075af=events[_0x5624('0x6')];_0x381b4a<_0x6075af;_0x381b4a++){var _0x46fad9=events[_0x381b4a];var _0x5f7bf5=createListener(_0x5624('0x7')+_0x46fad9,_0x269a95);MailAccountEvents['on'](_0x46fad9,_0x5f7bf5);}}; \ No newline at end of file +var _0xc59f=['remove','emit','removeListener','register','length','mailAccount:','./mailAccount.events'];(function(_0x52d42c,_0xee018e){var _0x526a15=function(_0xd731ec){while(--_0xd731ec){_0x52d42c['push'](_0x52d42c['shift']());}};_0x526a15(++_0xee018e);}(_0xc59f,0x6f));var _0xfc59=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc59f[_0x3dd15e];return _0x231fd0;};'use strict';var MailAccountEvents=require(_0xfc59('0x0'));var events=['save',_0xfc59('0x1'),'update'];function createListener(_0x538e91,_0x1f3f73){return function(_0x4cb052){_0x1f3f73[_0xfc59('0x2')](_0x538e91,_0x4cb052);};}function removeListener(_0x51f799,_0x5804e1){return function(){MailAccountEvents[_0xfc59('0x3')](_0x51f799,_0x5804e1);};}exports[_0xfc59('0x4')]=function(_0x1939ce){for(var _0x1a1ce1=0x0,_0x38e8fa=events[_0xfc59('0x5')];_0x1a1ce1<_0x38e8fa;_0x1a1ce1++){var _0x1d83cf=events[_0x1a1ce1];var _0x4b7343=createListener(_0xfc59('0x6')+_0x1d83cf,_0x1939ce);MailAccountEvents['on'](_0x1d83cf,_0x4b7343);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 455762e..254b8af 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 _0xfb85=['/:id','isAuthenticated','put','update','destroy','util','connect-timeout','Router','fs-extra','../../components/interaction/service','get'];(function(_0x4b3d13,_0x1993d5){var _0xf64dd8=function(_0x2304ed){while(--_0x2304ed){_0x4b3d13['push'](_0x4b3d13['shift']());}};_0xf64dd8(++_0x1993d5);}(_0xfb85,0xaa));var _0x5fb8=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xfb85[_0x51020b];return _0x371e47;};'use strict';var multer=require('multer');var util=require(_0x5fb8('0x0'));var path=require('path');var timeout=require(_0x5fb8('0x1'));var express=require('express');var router=express[_0x5fb8('0x2')]();var fs_extra=require(_0x5fb8('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x5fb8('0x4'));var config=require('../../config/environment');var controller=require('./mailApplication.controller');router[_0x5fb8('0x5')](_0x5fb8('0x6'),auth[_0x5fb8('0x7')](),controller['show']);router[_0x5fb8('0x8')](_0x5fb8('0x6'),auth['isAuthenticated'](),controller[_0x5fb8('0x9')]);router['delete'](_0x5fb8('0x6'),auth[_0x5fb8('0x7')](),controller[_0x5fb8('0xa')]);module['exports']=router; \ No newline at end of file +var _0xcdc0=['/:id','isAuthenticated','show','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller'];(function(_0x28611e,_0x586726){var _0x530f69=function(_0x407906){while(--_0x407906){_0x28611e['push'](_0x28611e['shift']());}};_0x530f69(++_0x586726);}(_0xcdc0,0x170));var _0x0cdc=function(_0x513ca1,_0x272a3e){_0x513ca1=_0x513ca1-0x0;var _0x3c7d64=_0xcdc0[_0x513ca1];return _0x3c7d64;};'use strict';var multer=require(_0x0cdc('0x0'));var util=require(_0x0cdc('0x1'));var path=require(_0x0cdc('0x2'));var timeout=require('connect-timeout');var express=require(_0x0cdc('0x3'));var router=express[_0x0cdc('0x4')]();var fs_extra=require(_0x0cdc('0x5'));var auth=require(_0x0cdc('0x6'));var interaction=require(_0x0cdc('0x7'));var config=require(_0x0cdc('0x8'));var controller=require(_0x0cdc('0x9'));router['get'](_0x0cdc('0xa'),auth[_0x0cdc('0xb')](),controller[_0x0cdc('0xc')]);router[_0x0cdc('0xd')](_0x0cdc('0xa'),auth['isAuthenticated'](),controller[_0x0cdc('0xe')]);router[_0x0cdc('0xf')](_0x0cdc('0xa'),auth[_0x0cdc('0xb')](),controller[_0x0cdc('0x10')]);module[_0x0cdc('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index effdf9d..70be149 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 _0xa82b=['sequelize','exports','INTEGER','noop','TEXT','STRING','*,*,*,*'];(function(_0x36d0eb,_0x4e4f17){var _0x511baa=function(_0x539484){while(--_0x539484){_0x36d0eb['push'](_0x36d0eb['shift']());}};_0x511baa(++_0x4e4f17);}(_0xa82b,0x12d));var _0xba82=function(_0x3a99f4,_0x2a81c1){_0x3a99f4=_0x3a99f4-0x0;var _0xea0b42=_0xa82b[_0x3a99f4];return _0xea0b42;};'use strict';var Sequelize=require(_0xba82('0x0'));module[_0xba82('0x1')]={'priority':{'type':Sequelize[_0xba82('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xba82('0x3')},'appdata':{'type':Sequelize[_0xba82('0x4')]()},'description':{'type':Sequelize[_0xba82('0x5')]},'interval':{'type':Sequelize[_0xba82('0x5')],'defaultValue':_0xba82('0x6')}}; \ No newline at end of file +var _0x80e1=['INTEGER','STRING','noop','*,*,*,*','sequelize'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x80e1,0x10d));var _0x180e=function(_0x51cbd1,_0x14e611){_0x51cbd1=_0x51cbd1-0x0;var _0xf205d3=_0x80e1[_0x51cbd1];return _0xf205d3;};'use strict';var Sequelize=require(_0x180e('0x0'));module['exports']={'priority':{'type':Sequelize[_0x180e('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x180e('0x2')],'allowNull':![],'defaultValue':_0x180e('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x180e('0x2')],'defaultValue':_0x180e('0x4')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 282c525..41a6591 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(_0x384827,_0x446ef0){var _0x1edac6=function(_0x124109){while(--_0x124109){_0x384827['push'](_0x384827['shift']());}};_0x1edac6(++_0x446ef0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'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 _0xd8b0=['attributes','length','include','merge','find','catch','body','params','eml-format','rimraf','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','name','show','model','MailApplication','query','keys','intersection','fields'];(function(_0x3e7fbc,_0x5e039a){var _0x3c1ae9=function(_0x15dbef){while(--_0x15dbef){_0x3e7fbc['push'](_0x3e7fbc['shift']());}};_0x3c1ae9(++_0x5e039a);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0x0d8b('0x0'));var rimraf=require(_0x0d8b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0d8b('0x2'));var BPromise=require(_0x0d8b('0x3'));var Mustache=require(_0x0d8b('0x4'));var util=require(_0x0d8b('0x5'));var path=require(_0x0d8b('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0d8b('0x7'));var fs=require('fs');var fs_extra=require(_0x0d8b('0x8'));var _=require(_0x0d8b('0x9'));var squel=require('squel');var crypto=require(_0x0d8b('0xa'));var jsforce=require(_0x0d8b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d8b('0xc'));var querystring=require(_0x0d8b('0xd'));var Papa=require(_0x0d8b('0xe'));var Redis=require(_0x0d8b('0xf'));var authService=require(_0x0d8b('0x10'));var qs=require(_0x0d8b('0x11'));var as=require(_0x0d8b('0x12'));var hardwareService=require(_0x0d8b('0x13'));var logger=require('../../config/logger')(_0x0d8b('0x14'));var utils=require('../../config/utils');var config=require(_0x0d8b('0x15'));var licenseUtil=require(_0x0d8b('0x16'));var db=require(_0x0d8b('0x17'))['db'];function respondWithStatusCode(_0x92cdd8,_0x35a07b){_0x35a07b=_0x35a07b||0xcc;return function(_0x32bb1a){if(_0x32bb1a){return _0x92cdd8[_0x0d8b('0x18')](_0x35a07b);}return _0x92cdd8[_0x0d8b('0x19')](_0x35a07b)[_0x0d8b('0x1a')]();};}function respondWithResult(_0x2ce75e,_0x5ad086){_0x5ad086=_0x5ad086||0xc8;return function(_0xe65334){if(_0xe65334){return _0x2ce75e[_0x0d8b('0x19')](_0x5ad086)[_0x0d8b('0x1b')](_0xe65334);}};}function respondWithFilteredResult(_0x4f6f21,_0x23eb7b){return function(_0xa86349){if(_0xa86349){var _0x17f7df=typeof _0x23eb7b[_0x0d8b('0x1c')]===_0x0d8b('0x1d')&&typeof _0x23eb7b['limit']===_0x0d8b('0x1d');var _0x4586c2=_0xa86349[_0x0d8b('0x1e')];var _0x5fecbd=_0x17f7df?0x0:_0x23eb7b[_0x0d8b('0x1c')];var _0x18dd2d=_0x17f7df?_0xa86349[_0x0d8b('0x1e')]:_0x23eb7b[_0x0d8b('0x1c')]+_0x23eb7b['limit'];var _0x27512e;if(_0x18dd2d>=_0x4586c2){_0x18dd2d=_0x4586c2;_0x27512e=0xc8;}else{_0x27512e=0xce;}_0x4f6f21[_0x0d8b('0x19')](_0x27512e);return _0x4f6f21[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x5fecbd+'-'+_0x18dd2d+'/'+_0x4586c2)[_0x0d8b('0x1b')](_0xa86349);}return null;};}function patchUpdates(_0x5b709c){return function(_0x393beb){try{jsonpatch[_0x0d8b('0x21')](_0x393beb,_0x5b709c,!![]);}catch(_0x50ec1e){return BPromise['reject'](_0x50ec1e);}return _0x393beb[_0x0d8b('0x22')]();};}function saveUpdates(_0x54a9a7,_0x56c729){return function(_0x5527d8){if(_0x5527d8){return _0x5527d8[_0x0d8b('0x23')](_0x54a9a7)[_0x0d8b('0x24')](function(_0x214778){return _0x214778;});}return null;};}function removeEntity(_0x38efc8,_0x221071){return function(_0x2c64e2){if(_0x2c64e2){return _0x2c64e2[_0x0d8b('0x25')]()[_0x0d8b('0x24')](function(){_0x38efc8[_0x0d8b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe8bbee,_0x4463ee){return function(_0x5363e3){if(!_0x5363e3){_0xe8bbee[_0x0d8b('0x18')](0x194);}return _0x5363e3;};}function handleError(_0x4a0ae4,_0x3dd149){_0x3dd149=_0x3dd149||0x1f4;return function(_0x234bdd){logger[_0x0d8b('0x26')](_0x234bdd['stack']);if(_0x234bdd['name']){delete _0x234bdd[_0x0d8b('0x27')];}_0x4a0ae4[_0x0d8b('0x19')](_0x3dd149)['send'](_0x234bdd);};}exports[_0x0d8b('0x28')]=function(_0x59aa83,_0x1b2b59){var _0x4b59e5={'raw':!![],'where':{'id':_0x59aa83['params']['id']}},_0x97050a={};_0x97050a[_0x0d8b('0x29')]=_['keys'](db[_0x0d8b('0x2a')]['rawAttributes']);_0x97050a[_0x0d8b('0x2b')]=_[_0x0d8b('0x2c')](_0x59aa83[_0x0d8b('0x2b')]);_0x97050a['filters']=_['intersection'](_0x97050a['model'],_0x97050a[_0x0d8b('0x2b')]);_0x4b59e5['attributes']=_[_0x0d8b('0x2d')](_0x97050a['model'],qs['fields'](_0x59aa83[_0x0d8b('0x2b')][_0x0d8b('0x2e')]));_0x4b59e5[_0x0d8b('0x2f')]=_0x4b59e5[_0x0d8b('0x2f')][_0x0d8b('0x30')]?_0x4b59e5[_0x0d8b('0x2f')]:_0x97050a[_0x0d8b('0x29')];if(_0x59aa83[_0x0d8b('0x2b')]['includeAll']){_0x4b59e5[_0x0d8b('0x31')]=[{'all':!![]}];}_0x4b59e5=_[_0x0d8b('0x32')]({},_0x4b59e5,_0x59aa83['options']);return db[_0x0d8b('0x2a')][_0x0d8b('0x33')](_0x4b59e5)[_0x0d8b('0x24')](handleEntityNotFound(_0x1b2b59,null))['then'](respondWithResult(_0x1b2b59,null))[_0x0d8b('0x34')](handleError(_0x1b2b59,null));};exports[_0x0d8b('0x23')]=function(_0x206157,_0x31ceba){if(_0x206157[_0x0d8b('0x35')]['id']){delete _0x206157['body']['id'];}return db[_0x0d8b('0x2a')][_0x0d8b('0x33')]({'where':{'id':_0x206157['params']['id']}})[_0x0d8b('0x24')](handleEntityNotFound(_0x31ceba,null))[_0x0d8b('0x24')](saveUpdates(_0x206157[_0x0d8b('0x35')],null))[_0x0d8b('0x24')](respondWithResult(_0x31ceba,null))[_0x0d8b('0x34')](handleError(_0x31ceba,null));};exports['destroy']=function(_0x497a71,_0x41b4f9){return db['MailApplication']['find']({'where':{'id':_0x497a71[_0x0d8b('0x36')]['id']}})[_0x0d8b('0x24')](handleEntityNotFound(_0x41b4f9,null))[_0x0d8b('0x24')](removeEntity(_0x41b4f9,null))[_0x0d8b('0x34')](handleError(_0x41b4f9,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 25a7d03..8ce2342 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 _0x7f5e=['path','rimraf','../../config/environment','./mailApplication.attributes','define','mail_applications','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','request-promise'];(function(_0xf39e4b,_0x11342f){var _0x286250=function(_0x3b47c6){while(--_0x3b47c6){_0xf39e4b['push'](_0xf39e4b['shift']());}};_0x286250(++_0x11342f);}(_0x7f5e,0x81));var _0xe7f5=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7f5e[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe7f5('0x0'))(_0xe7f5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe7f5('0x2'));var fs=require('fs');var path=require(_0xe7f5('0x3'));var rimraf=require(_0xe7f5('0x4'));var config=require(_0xe7f5('0x5'));var attributes=require(_0xe7f5('0x6'));module['exports']=function(_0xf9f11c,_0x14bf51){return _0xf9f11c[_0xe7f5('0x7')]('MailApplication',attributes,{'tableName':_0xe7f5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe7f5('0x9'),'collate':_0xe7f5('0xa')});}; \ No newline at end of file +var _0x446c=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','define','MailApplication','mail_applications','utf8mb4','lodash','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x446c,0x1ec));var _0xc446=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0x446c[_0x166d93];return _0xba708;};'use strict';var _=require(_0xc446('0x0'));var util=require(_0xc446('0x1'));var logger=require(_0xc446('0x2'))(_0xc446('0x3'));var moment=require(_0xc446('0x4'));var BPromise=require(_0xc446('0x5'));var rp=require(_0xc446('0x6'));var fs=require('fs');var path=require(_0xc446('0x7'));var rimraf=require(_0xc446('0x8'));var config=require(_0xc446('0x9'));var attributes=require(_0xc446('0xa'));module['exports']=function(_0x4ef715,_0x52978b){return _0x4ef715[_0xc446('0xb')](_0xc446('0xc'),attributes,{'tableName':_0xc446('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc446('0xe'),'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 34787e1..bd8aa71 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 _0xfcf1=['result','catch','UpdateMailApplication','MailApplication','update','body','raw','options','where','limit','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x259ba5,_0x4dc51f){var _0x291f0a=function(_0x153fb1){while(--_0x153fb1){_0x259ba5['push'](_0x259ba5['shift']());}};_0x291f0a(++_0x4dc51f);}(_0xfcf1,0x87));var _0x1fcf=function(_0x19eae8,_0x31e07f){_0x19eae8=_0x19eae8-0x0;var _0xa0d3c1=_0xfcf1[_0x19eae8];return _0xa0d3c1;};'use strict';var _=require(_0x1fcf('0x0'));var util=require(_0x1fcf('0x1'));var moment=require(_0x1fcf('0x2'));var BPromise=require('bluebird');var rs=require(_0x1fcf('0x3'));var fs=require('fs');var Redis=require(_0x1fcf('0x4'));var db=require(_0x1fcf('0x5'))['db'];var utils=require(_0x1fcf('0x6'));var logger=require('../../config/logger')(_0x1fcf('0x7'));var config=require(_0x1fcf('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1fcf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x47d420,_0x44cf70,_0x40df3e){return new BPromise(function(_0x5aacd3,_0x4d714e){return client[_0x1fcf('0xa')](_0x47d420,_0x40df3e)[_0x1fcf('0xb')](function(_0x3bb328){logger[_0x1fcf('0xc')](_0x1fcf('0xd'),_0x44cf70,_0x1fcf('0xe'));logger[_0x1fcf('0xf')](_0x1fcf('0x10'),_0x44cf70,_0x1fcf('0xe'),JSON['stringify'](_0x3bb328));if(_0x3bb328[_0x1fcf('0x11')]){if(_0x3bb328[_0x1fcf('0x11')][_0x1fcf('0x12')]===0x1f4){logger[_0x1fcf('0x11')](_0x1fcf('0xd'),_0x44cf70,_0x3bb328[_0x1fcf('0x11')][_0x1fcf('0x13')]);return _0x4d714e(_0x3bb328[_0x1fcf('0x11')][_0x1fcf('0x13')]);}logger[_0x1fcf('0x11')](_0x1fcf('0xd'),_0x44cf70,_0x3bb328[_0x1fcf('0x11')][_0x1fcf('0x13')]);return _0x5aacd3(_0x3bb328[_0x1fcf('0x11')][_0x1fcf('0x13')]);}else{logger[_0x1fcf('0xc')](_0x1fcf('0xd'),_0x44cf70,_0x1fcf('0xe'));_0x5aacd3(_0x3bb328[_0x1fcf('0x14')][_0x1fcf('0x13')]);}})[_0x1fcf('0x15')](function(_0x32a1b3){logger[_0x1fcf('0x11')]('MailApplication,\x20%s,\x20%s',_0x44cf70,_0x32a1b3);_0x4d714e(_0x32a1b3);});});}exports[_0x1fcf('0x16')]=function(_0x25d237){var _0x536dc3=this;return new Promise(function(_0x57f582,_0x22307b){return db[_0x1fcf('0x17')][_0x1fcf('0x18')](_0x25d237[_0x1fcf('0x19')],{'raw':_0x25d237['options']?_0x25d237['options'][_0x1fcf('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x25d237[_0x1fcf('0x1b')]?_0x25d237[_0x1fcf('0x1b')][_0x1fcf('0x1c')]||null:null,'attributes':_0x25d237[_0x1fcf('0x1b')]?_0x25d237[_0x1fcf('0x1b')]['attributes']||null:null,'limit':_0x25d237['options']?_0x25d237[_0x1fcf('0x1b')][_0x1fcf('0x1d')]||null:null})[_0x1fcf('0xb')](function(_0x580340){logger['info'](_0x1fcf('0x16'),_0x25d237);logger['debug'](_0x1fcf('0x16'),_0x25d237,JSON[_0x1fcf('0x1e')](_0x580340));_0x57f582(_0x580340);})[_0x1fcf('0x15')](function(_0x56c0d4){logger[_0x1fcf('0x11')](_0x1fcf('0x16'),_0x56c0d4[_0x1fcf('0x13')],_0x25d237);_0x22307b(_0x536dc3[_0x1fcf('0x11')](0x1f4,_0x56c0d4[_0x1fcf('0x13')]));});});}; \ No newline at end of file +var _0x91bc=['UpdateMailApplication','update','options','raw','where','attributes','limit','stringify','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','error','code','MailApplication,\x20%s,\x20%s','message','catch'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x91bc,0x181));var _0xc91b=function(_0x33d3e8,_0x3f57a6){_0x33d3e8=_0x33d3e8-0x0;var _0x397d73=_0x91bc[_0x33d3e8];return _0x397d73;};'use strict';var _=require(_0xc91b('0x0'));var util=require(_0xc91b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc91b('0x2'));var fs=require('fs');var Redis=require(_0xc91b('0x3'));var db=require(_0xc91b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc91b('0x5'))(_0xc91b('0x6'));var config=require(_0xc91b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc91b('0x8')][_0xc91b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x596d2,_0x56b124,_0x7db757){return new BPromise(function(_0x33efa1,_0x36895d){return client[_0xc91b('0xa')](_0x596d2,_0x7db757)[_0xc91b('0xb')](function(_0x463974){logger[_0xc91b('0xc')]('MailApplication,\x20%s,\x20%s',_0x56b124,_0xc91b('0xd'));logger[_0xc91b('0xe')](_0xc91b('0xf'),_0x56b124,_0xc91b('0xd'),JSON['stringify'](_0x463974));if(_0x463974['error']){if(_0x463974[_0xc91b('0x10')][_0xc91b('0x11')]===0x1f4){logger['error'](_0xc91b('0x12'),_0x56b124,_0x463974[_0xc91b('0x10')][_0xc91b('0x13')]);return _0x36895d(_0x463974[_0xc91b('0x10')]['message']);}logger[_0xc91b('0x10')]('MailApplication,\x20%s,\x20%s',_0x56b124,_0x463974[_0xc91b('0x10')]['message']);return _0x33efa1(_0x463974['error'][_0xc91b('0x13')]);}else{logger[_0xc91b('0xc')](_0xc91b('0x12'),_0x56b124,_0xc91b('0xd'));_0x33efa1(_0x463974['result'][_0xc91b('0x13')]);}})[_0xc91b('0x14')](function(_0x4cc7f6){logger[_0xc91b('0x10')](_0xc91b('0x12'),_0x56b124,_0x4cc7f6);_0x36895d(_0x4cc7f6);});});}exports[_0xc91b('0x15')]=function(_0x5a0af1){var _0x20b6d3=this;return new Promise(function(_0x46f4cb,_0x24115e){return db['MailApplication'][_0xc91b('0x16')](_0x5a0af1['body'],{'raw':_0x5a0af1[_0xc91b('0x17')]?_0x5a0af1[_0xc91b('0x17')][_0xc91b('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a0af1['options']?_0x5a0af1[_0xc91b('0x17')][_0xc91b('0x19')]||null:null,'attributes':_0x5a0af1['options']?_0x5a0af1[_0xc91b('0x17')][_0xc91b('0x1a')]||null:null,'limit':_0x5a0af1['options']?_0x5a0af1['options'][_0xc91b('0x1b')]||null:null})['then'](function(_0x402bb3){logger[_0xc91b('0xc')](_0xc91b('0x15'),_0x5a0af1);logger[_0xc91b('0xe')]('UpdateMailApplication',_0x5a0af1,JSON[_0xc91b('0x1c')](_0x402bb3));_0x46f4cb(_0x402bb3);})[_0xc91b('0x14')](function(_0x2d79e4){logger[_0xc91b('0x10')](_0xc91b('0x15'),_0x2d79e4[_0xc91b('0x13')],_0x5a0af1);_0x24115e(_0x20b6d3[_0xc91b('0x10')](0x1f4,_0x2d79e4[_0xc91b('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index e94630d..5d38035 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 _0x052d=['getMessages','/:id/download','post','/:id/messages','addMessage','/:id/tags','mail','addTags','put','update','delete','/:id','tracked','mailinteraction:destroy','destroy','exports','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','show'];(function(_0x10b25a,_0x9ca7c8){var _0x5478ab=function(_0x53d859){while(--_0x53d859){_0x10b25a['push'](_0x10b25a['shift']());}};_0x5478ab(++_0x9ca7c8);}(_0x052d,0x197));var _0xd052=function(_0x1a13fa,_0x418265){_0x1a13fa=_0x1a13fa-0x0;var _0x2622eb=_0x052d[_0x1a13fa];return _0x2622eb;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0xd052('0x0'));var interaction=require(_0xd052('0x1'));var controller=require('./mailInteraction.controller');router[_0xd052('0x2')]('/',auth[_0xd052('0x3')](),controller[_0xd052('0x4')]);router[_0xd052('0x2')](_0xd052('0x5'),auth[_0xd052('0x3')](),controller['describe']);router[_0xd052('0x2')]('/:id',auth[_0xd052('0x3')](),controller[_0xd052('0x6')]);router['get']('/:id/messages',auth[_0xd052('0x3')](),controller[_0xd052('0x7')]);router['get'](_0xd052('0x8'),auth['isAuthenticated'](),controller['download']);router[_0xd052('0x9')]('/',auth[_0xd052('0x3')](),controller['create']);router[_0xd052('0x9')](_0xd052('0xa'),auth[_0xd052('0x3')](),controller[_0xd052('0xb')]);router[_0xd052('0x9')](_0xd052('0xc'),auth['isAuthenticated'](),interaction['tracked'](_0xd052('0xd'),'mailinteraction:addtags'),controller[_0xd052('0xe')]);router[_0xd052('0xf')]('/:id',auth['isAuthenticated'](),interaction['tracked']('mail','mailinteraction:update'),controller[_0xd052('0x10')]);router[_0xd052('0x11')](_0xd052('0x12'),auth['isAuthenticated'](),interaction[_0xd052('0x13')]('mail',_0xd052('0x14')),controller[_0xd052('0x15')]);router['delete'](_0xd052('0xc'),auth[_0xd052('0x3')](),controller['removeTags']);module[_0xd052('0x16')]=router; \ No newline at end of file +var _0x2401=['destroy','/:id/tags','removeTags','exports','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','tracked','mail','addTags','mailinteraction:update','update','delete','mailinteraction:destroy'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x2401,0xa6));var _0x1240=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2401[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0x1240('0x0'));var router=express[_0x1240('0x1')]();var auth=require(_0x1240('0x2'));var interaction=require(_0x1240('0x3'));var controller=require(_0x1240('0x4'));router[_0x1240('0x5')]('/',auth[_0x1240('0x6')](),controller['index']);router[_0x1240('0x5')]('/describe',auth[_0x1240('0x6')](),controller[_0x1240('0x7')]);router[_0x1240('0x5')](_0x1240('0x8'),auth[_0x1240('0x6')](),controller[_0x1240('0x9')]);router[_0x1240('0x5')](_0x1240('0xa'),auth[_0x1240('0x6')](),controller[_0x1240('0xb')]);router[_0x1240('0x5')](_0x1240('0xc'),auth[_0x1240('0x6')](),controller[_0x1240('0xd')]);router[_0x1240('0xe')]('/',auth[_0x1240('0x6')](),controller['create']);router[_0x1240('0xe')]('/:id/messages',auth['isAuthenticated'](),controller[_0x1240('0xf')]);router['post']('/:id/tags',auth[_0x1240('0x6')](),interaction[_0x1240('0x10')](_0x1240('0x11'),'mailinteraction:addtags'),controller[_0x1240('0x12')]);router['put'](_0x1240('0x8'),auth[_0x1240('0x6')](),interaction[_0x1240('0x10')](_0x1240('0x11'),_0x1240('0x13')),controller[_0x1240('0x14')]);router[_0x1240('0x15')](_0x1240('0x8'),auth[_0x1240('0x6')](),interaction[_0x1240('0x10')](_0x1240('0x11'),_0x1240('0x16')),controller[_0x1240('0x17')]);router[_0x1240('0x15')](_0x1240('0x18'),auth[_0x1240('0x6')](),controller[_0x1240('0x19')]);module[_0x1240('0x1a')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 9e8ac51..5b75acf 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 _0x028b=['exports','BOOLEAN','DATE','STRING','TEXT','long','ENUM','out','sequelize','iconv'];(function(_0x470ff2,_0x553a47){var _0x766eb6=function(_0xa5a4fc){while(--_0xa5a4fc){_0x470ff2['push'](_0x470ff2['shift']());}};_0x766eb6(++_0x553a47);}(_0x028b,0x1c0));var _0xb028=function(_0x5c3d54,_0x337ef5){_0x5c3d54=_0x5c3d54-0x0;var _0x4569cf=_0x028b[_0x5c3d54];return _0x4569cf;};'use strict';var Sequelize=require(_0xb028('0x0'));var iconv=require(_0xb028('0x1'));module[_0xb028('0x2')]={'closed':{'type':Sequelize[_0xb028('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb028('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xb028('0x5')]},'thirdDisposition':{'type':Sequelize[_0xb028('0x5')]},'note':{'type':Sequelize[_0xb028('0x5')]},'inReplyTo':{'type':Sequelize[_0xb028('0x5')](0x1fe)},'to':{'type':Sequelize[_0xb028('0x5')]},'cc':{'type':Sequelize[_0xb028('0x6')](_0xb028('0x7'))},'subject':{'type':Sequelize[_0xb028('0x6')]()},'attach':{'type':Sequelize[_0xb028('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xb028('0x4')]},'substatus':{'type':Sequelize[_0xb028('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0xb028('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xb028('0x8')]('in',_0xb028('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xb028('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xb028('0x8')]('in',_0xb028('0x9')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xfcb2=['BOOLEAN','DATE','STRING','TEXT','ENUM','out','iconv','exports'];(function(_0x3ef9ea,_0x941f31){var _0x4317c4=function(_0xe4540e){while(--_0xe4540e){_0x3ef9ea['push'](_0x3ef9ea['shift']());}};_0x4317c4(++_0x941f31);}(_0xfcb2,0x1ae));var _0x2fcb=function(_0x5a867a,_0x1b90be){_0x5a867a=_0x5a867a-0x0;var _0x15f826=_0xfcb2[_0x5a867a];return _0x15f826;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0x2fcb('0x0'));module[_0x2fcb('0x1')]={'closed':{'type':Sequelize[_0x2fcb('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2fcb('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x2fcb('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x2fcb('0x4')]},'inReplyTo':{'type':Sequelize[_0x2fcb('0x4')](0x1fe)},'to':{'type':Sequelize[_0x2fcb('0x4')]},'cc':{'type':Sequelize[_0x2fcb('0x5')]('long')},'subject':{'type':Sequelize[_0x2fcb('0x5')]()},'attach':{'type':Sequelize[_0x2fcb('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x2fcb('0x3')]},'substatus':{'type':Sequelize[_0x2fcb('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x2fcb('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x2fcb('0x6')]('in',_0x2fcb('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x2fcb('0x6')]('in',_0x2fcb('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x2fcb('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 8528ca1..6a9a502 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 _0xeff8=['value','having','`\x20=\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','isEmpty','forEach','MailAccountId','where','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','Sequelize','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_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.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.to','i.UserId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','Setting','enableEmailPreview','all','rows','show','params','include','create','body','describe','addMessage','ids','pick','format','options','includeAll','findAll','inlineCss','true','setTags','omit','spread','emit','mailInteractionTags:save','removeTags','unix','root','server','files','tmp','join','attachments','transcript-%d-%s.zip','Attachment','Attachments','bcc','Messages','get','mkdirSync','each','subject','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','readFileSync','build','writeFileSync','download','unlinkSync','sendStatus','eml-format','rimraf','moment','bluebird','util','lodash','squel','juice','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','html-entities','redis','defaults','./mailInteraction.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','push','MailMessage','findOne','out','plainBody','-id','lastMsgText','catch','waiting','talking','answered','unmanaged','total','UserId','closed','index','MailInteraction','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','field','color','from','tools_tags','select','u.id','u.fullname','ui.MailInteractionId','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','length','find','unreadMessages'];(function(_0x20c4c9,_0xc44867){var _0x14d9d5=function(_0x298566){while(--_0x298566){_0x20c4c9['push'](_0x20c4c9['shift']());}};_0x14d9d5(++_0xc44867);}(_0xeff8,0x186));var _0x8eff=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0xeff8[_0x45f951];return _0x24756c;};'use strict';var emlformat=require(_0x8eff('0x0'));var rimraf=require(_0x8eff('0x1'));var zipdir=require('zip-dir');var moment=require(_0x8eff('0x2'));var BPromise=require(_0x8eff('0x3'));var util=require(_0x8eff('0x4'));var path=require('path');var fs=require('fs');var _=require(_0x8eff('0x5'));var squel=require(_0x8eff('0x6'));var juice=require(_0x8eff('0x7'));var Redis=require(_0x8eff('0x8'));var qs=require('../../components/parsers/qs');var as=require(_0x8eff('0x9'));var logger=require(_0x8eff('0xa'))(_0x8eff('0xb'));var config=require(_0x8eff('0xc'));var db=require('../../mysqldb')['db'];var htmlEntities=require(_0x8eff('0xd'));config[_0x8eff('0xe')]=_[_0x8eff('0xf')](config[_0x8eff('0xe')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8eff('0xe')]));require(_0x8eff('0x10'))[_0x8eff('0x11')](socket);function respondWithStatusCode(_0x52d250,_0x2a87d2){_0x2a87d2=_0x2a87d2||0xcc;return function(_0x369b5d){if(_0x369b5d){return _0x52d250['sendStatus'](_0x2a87d2);}return _0x52d250[_0x8eff('0x12')](_0x2a87d2)[_0x8eff('0x13')]();};}function respondWithResult(_0x559143,_0x4a399e){_0x4a399e=_0x4a399e||0xc8;return function(_0x45f280){if(_0x45f280){return _0x559143[_0x8eff('0x12')](_0x4a399e)[_0x8eff('0x14')](_0x45f280);}};}function respondWithFilteredResult(_0x42fb24,_0x1349cb){return function(_0x56efdf){if(_0x56efdf){var _0x3e7c01=typeof _0x1349cb[_0x8eff('0x15')]===_0x8eff('0x16')&&typeof _0x1349cb[_0x8eff('0x17')]===_0x8eff('0x16');var _0x4cfc91=_0x56efdf[_0x8eff('0x18')];var _0xdbb753=_0x3e7c01?0x0:_0x1349cb[_0x8eff('0x15')];var _0x427902=_0x3e7c01?_0x56efdf[_0x8eff('0x18')]:_0x1349cb['offset']+_0x1349cb[_0x8eff('0x17')];var _0x38fb15;if(_0x427902>=_0x4cfc91){_0x427902=_0x4cfc91;_0x38fb15=0xc8;}else{_0x38fb15=0xce;}_0x42fb24[_0x8eff('0x12')](_0x38fb15);return _0x42fb24[_0x8eff('0x19')](_0x8eff('0x1a'),_0xdbb753+'-'+_0x427902+'/'+_0x4cfc91)[_0x8eff('0x14')](_0x56efdf);}return null;};}function saveUpdates(_0x38f5ee){return function(_0x399d96){if(_0x399d96){return _0x399d96[_0x8eff('0x1b')](_0x38f5ee)[_0x8eff('0x1c')](function(_0x453c7a){return _0x453c7a;});}return null;};}function removeEntity(_0x1b65f9){return function(_0x1e9ad0){if(_0x1e9ad0){return _0x1e9ad0[_0x8eff('0x1d')]()[_0x8eff('0x1c')](function(){_0x1b65f9[_0x8eff('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ca2e6){return function(_0x4d3e84){if(!_0x4d3e84){_0x1ca2e6['sendStatus'](0x194);}return _0x4d3e84;};}function handleError(_0x1c4ad3,_0x5ea31f){_0x5ea31f=_0x5ea31f||0x1f4;return function(_0x2fe360){logger[_0x8eff('0x1e')](_0x2fe360[_0x8eff('0x1f')]);if(_0x2fe360[_0x8eff('0x20')]){delete _0x2fe360[_0x8eff('0x20')];}_0x1c4ad3['status'](_0x5ea31f)[_0x8eff('0x21')](_0x2fe360);};}function getInteractionUsers(_0x350927,_0x50784c){return new BPromise(function(_0x15b66f,_0x5ec3d7){try{if(_0x50784c[_0x350927['id']]){_0x350927[_0x8eff('0x22')]=_[_0x8eff('0x23')](_0x50784c[_0x350927['id']],function(_0xd60d94){return{'id':_0xd60d94['id'],'fullname':_0xd60d94[_0x8eff('0x24')]};});}}catch(_0x6359df){_0x5ec3d7(_0x6359df);}_0x15b66f(_0x350927);});}function getInteractionTags(_0x2e8067,_0x516173){return new BPromise(function(_0x3e1607,_0x323ffa){try{if(_0x2e8067[_0x8eff('0x25')]){_0x2e8067[_0x8eff('0x26')]=[];_0x2e8067[_0x8eff('0x25')][_0x8eff('0x27')](',')['forEach'](function(_0x4ed3b8){_0x2e8067[_0x8eff('0x26')][_0x8eff('0x28')](_0x516173[_0x4ed3b8]);});}delete _0x2e8067[_0x8eff('0x25')];}catch(_0x5ce071){_0x323ffa(_0x5ce071);}_0x3e1607(_0x2e8067);});}function getLastMessageText(_0x2ebf3a){return new BPromise(function(_0x2f8ad9,_0x229e0d){return db[_0x8eff('0x29')][_0x8eff('0x2a')]({'where':{'$and':[{'MailInteractionId':_0x2ebf3a['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x8eff('0x2b')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x8eff('0x2c')],'order':_0x8eff('0x2d'),'raw':!![]})[_0x8eff('0x1c')](function(_0x1e9a8a){if(_0x1e9a8a&&_0x1e9a8a[_0x8eff('0x2c')]){_0x2ebf3a[_0x8eff('0x2e')]=_['trimStart'](_0x1e9a8a[_0x8eff('0x2c')]);}_0x2f8ad9(_0x2ebf3a);})[_0x8eff('0x2f')](function(_0x115fa4){_0x229e0d(_0x115fa4);});});}function updateMailInteraction(_0x7da1fb,_0x50f211,_0x1f2240,_0x32fd3c){return new BPromise(function(_0x4c4220,_0x4e1256){return getInteractionUsers(_0x7da1fb,_0x1f2240)[_0x8eff('0x1c')](function(_0x271d64){return getInteractionTags(_0x271d64,_0x50f211);})['then'](function(_0x50dfc3){return getStateInteraction(_0x50dfc3);})['then'](function(_0x315691){if(_0x32fd3c){_0x4c4220(getLastMessageText(_0x315691));}else{_0x4c4220(_0x315691);}})['catch'](function(_0x45d9d4){_0x4e1256(_0x45d9d4);});});}function getStateInteraction(_0x59c9cc){return new BPromise(function(_0x2bb00f){_0x59c9cc[_0x8eff('0x30')]=0x0;_0x59c9cc[_0x8eff('0x31')]=0x0;_0x59c9cc[_0x8eff('0x32')]=0x0;_0x59c9cc[_0x8eff('0x33')]=0x0;_0x59c9cc[_0x8eff('0x34')]=0x0;if(!_0x59c9cc['closed']&&!_0x59c9cc[_0x8eff('0x35')]){_0x59c9cc['waiting']+=0x1;}if(!_0x59c9cc[_0x8eff('0x36')]&&_0x59c9cc['UserId']){_0x59c9cc[_0x8eff('0x31')]+=0x1;if(_0x59c9cc[_0x8eff('0x30')]){_0x59c9cc[_0x8eff('0x30')]-=0x1;}}if(_0x59c9cc[_0x8eff('0x36')]&&_0x59c9cc['UserId']){_0x59c9cc[_0x8eff('0x32')]+=0x1;if(_0x59c9cc[_0x8eff('0x31')]){_0x59c9cc[_0x8eff('0x31')]-=0x1;}}if(_0x59c9cc['closed']&&!_0x59c9cc[_0x8eff('0x35')]){_0x59c9cc[_0x8eff('0x33')]+=0x1;if(_0x59c9cc[_0x8eff('0x30')]){_0x59c9cc[_0x8eff('0x30')]-=0x1;}}_0x59c9cc[_0x8eff('0x34')]+=0x1;_0x2bb00f(_0x59c9cc);});}exports[_0x8eff('0x37')]=function(_0x29f68e,_0x26da7a){var _0x661c36={},_0x5c1277={},_0x54a2d9={'count':0x0,'rows':[]};var _0xf67cf3=_[_0x8eff('0x23')](db[_0x8eff('0x38')][_0x8eff('0x39')],function(_0x429c31){return{'name':_0x429c31[_0x8eff('0x3a')],'type':_0x429c31[_0x8eff('0x3b')]['key']};});_0x5c1277[_0x8eff('0x3c')]=_[_0x8eff('0x23')](_0xf67cf3,'name');_0x5c1277[_0x8eff('0x3d')]=_[_0x8eff('0x3e')](_0x29f68e[_0x8eff('0x3d')]);_0x5c1277[_0x8eff('0x3f')]=_[_0x8eff('0x40')](_0x5c1277[_0x8eff('0x3c')],_0x5c1277[_0x8eff('0x3d')]);_0x661c36[_0x8eff('0x41')]=_[_0x8eff('0x40')](_0x5c1277['model'],qs[_0x8eff('0x42')](_0x29f68e[_0x8eff('0x3d')][_0x8eff('0x42')]));_0x661c36[_0x8eff('0x41')]=_0x661c36[_0x8eff('0x41')]['length']?_0x661c36[_0x8eff('0x41')]:_0x5c1277['model'];if(!_0x29f68e[_0x8eff('0x3d')][_0x8eff('0x43')](_0x8eff('0x44'))){_0x661c36[_0x8eff('0x17')]=qs['limit'](_0x29f68e[_0x8eff('0x3d')][_0x8eff('0x17')]);_0x661c36[_0x8eff('0x15')]=qs['offset'](_0x29f68e['query'][_0x8eff('0x15')]);}_0x661c36[_0x8eff('0x45')]=qs[_0x8eff('0x46')](_0x29f68e[_0x8eff('0x3d')][_0x8eff('0x46')]);_0x661c36['where']=qs[_0x8eff('0x3f')](_['pick'](_0x29f68e[_0x8eff('0x3d')],_0x5c1277[_0x8eff('0x3f')]),_0xf67cf3);var _0x577a2b=[];var _0x581a6a=squel['select']()['field']('id')['field']('name')[_0x8eff('0x47')](_0x8eff('0x48'))[_0x8eff('0x49')](_0x8eff('0x4a'));var _0x1aa204=squel[_0x8eff('0x4b')]()[_0x8eff('0x47')](_0x8eff('0x4c'))[_0x8eff('0x47')](_0x8eff('0x4d'))['field'](_0x8eff('0x4e'))['from'](_0x8eff('0x4f'),'ui')[_0x8eff('0x50')](_0x8eff('0x51'),'u',_0x8eff('0x52'));var _0x5c491b=squel[_0x8eff('0x4b')]()[_0x8eff('0x49')](_0x8eff('0x53'),'i')[_0x8eff('0x50')](_0x8eff('0x54'),'c',_0x8eff('0x55'))[_0x8eff('0x50')]('users','o',_0x8eff('0x56'))[_0x8eff('0x50')](_0x8eff('0x57'),'a',_0x8eff('0x58'))[_0x8eff('0x50')](_0x8eff('0x59'),'me',_0x8eff('0x5a'))[_0x8eff('0x50')](_0x8eff('0x5b'),'it','it.MailInteractionId\x20=\x20i.id')['left_join'](_0x8eff('0x4a'),'t',_0x8eff('0x5c'));var _0x430f5e=squel[_0x8eff('0x5d')]();var _0xb99749=[];var _0x9a8a92=squel['expr']();var _0x1d2838;if(_0x29f68e[_0x8eff('0x3d')][_0x8eff('0x5e')]){_0x1d2838=as['parseSearch'](_0x29f68e[_0x8eff('0x3d')][_0x8eff('0x5e')]);var _0x2871cf=_0x1d2838[_0x8eff('0x5f')];for(var _0x549e88=0x0;_0x549e88<_0x1d2838[_0x8eff('0x60')][_0x8eff('0x61')];_0x549e88++){var _0x19da18=_0x1d2838[_0x8eff('0x60')][_0x549e88];var _0x1d56ce='i';var _0x1eccfb=_[_0x8eff('0x62')](_0xf67cf3,['name',_0x19da18[_0x8eff('0x47')]]);if(!_0x1eccfb){switch(_0x19da18[_0x8eff('0x47')]){case _0x8eff('0x63'):if(_0x19da18[_0x8eff('0x64')]==0x1){_0x5c491b[_0x8eff('0x65')]('`'+_0x19da18['field']+_0x8eff('0x66'));}else{_0x5c491b[_0x8eff('0x65')]('`'+_0x19da18[_0x8eff('0x47')]+'`\x20>\x200');}break;case _0x8eff('0x67'):if(_0x19da18['operator']===_0x8eff('0x68')){if(_0x19da18[_0x8eff('0x64')][_0x8eff('0x27')]('\x20')[_0x8eff('0x61')]>0x1){_0x430f5e[_0x2871cf](_0x8eff('0x69'),qs[_0x8eff('0x6a')](_0x19da18[_0x8eff('0x64')]),null);}else{var _0x552006='%'+_0x19da18['value']+'%';_0x430f5e[_0x2871cf](_0x8eff('0x6b'),_0x552006,_0x552006,_0x552006);}}else{_0x1eccfb=_['find'](_0xf67cf3,[_0x8eff('0x20'),_0x8eff('0x6c')]);_0x19da18[_0x8eff('0x47')]=_0x8eff('0x6c');_0x3b216f=as[_0x8eff('0x6d')](_0x1d56ce,_0x1eccfb['type'],_0x19da18);_0x430f5e[_0x2871cf](_0x3b216f[_0x8eff('0x6e')],_0x3b216f[_0x8eff('0x64')][_0x8eff('0x6f')],_0x3b216f[_0x8eff('0x64')][_0x8eff('0x13')]);}break;case _0x8eff('0x70'):var _0x5bfc72=_0x19da18[_0x8eff('0x64')]['split'](',')[_0x8eff('0x23')](function(_0x101c3e){return Number(_0x101c3e);});_0x5bfc72['forEach'](function(_0x1116fe){_0x9a8a92['or'](_0x8eff('0x71'),'%,'+_0x1116fe+',%');});_0xb99749=_[_0x8eff('0x72')](_0xb99749,_0x5bfc72);break;case _0x8eff('0x73'):if(_0x19da18[_0x8eff('0x74')]===_0x8eff('0x68')){_0x430f5e[_0x2871cf](_0x8eff('0x75'),'%'+_0x19da18[_0x8eff('0x64')]+'%',null);}else{_0x1eccfb=_['find'](_0xf67cf3,[_0x8eff('0x20'),'UserId']);_0x19da18['field']=_0x8eff('0x35');_0x3b216f=as[_0x8eff('0x6d')](_0x1d56ce,_0x1eccfb['type'],_0x19da18);_0x430f5e[_0x2871cf](_0x3b216f[_0x8eff('0x6e')],_0x3b216f[_0x8eff('0x64')]['start'],_0x3b216f[_0x8eff('0x64')][_0x8eff('0x13')]);}break;case'plainBody':_0x3b216f=as[_0x8eff('0x6d')]('me',null,_0x19da18);_0x430f5e[_0x2871cf](_0x3b216f[_0x8eff('0x6e')],_0x3b216f[_0x8eff('0x64')][_0x8eff('0x6f')],_0x3b216f[_0x8eff('0x64')][_0x8eff('0x13')]);break;}}else{var _0x3b216f=as['buildExpression'](_0x1d56ce,_0x1eccfb['type'],_0x19da18);_0x430f5e[_0x2871cf](_0x3b216f[_0x8eff('0x6e')],_0x3b216f[_0x8eff('0x64')][_0x8eff('0x6f')],_0x3b216f[_0x8eff('0x64')][_0x8eff('0x13')]);}}}else{var _0x1914ab=_(_0x29f68e[_0x8eff('0x3d')])['keys']()['map'](function(_0x435ee2){return _['some'](_0xf67cf3,['name',_0x435ee2])?_0x435ee2:undefined;})['compact']()[_0x8eff('0x64')]();if(!_[_0x8eff('0x76')](_0x1914ab)){_0x1914ab[_0x8eff('0x77')](function(_0x321159){if(_0x321159===_0x8eff('0x78')){_0x5c491b[_0x8eff('0x79')](_0x8eff('0x7a'),[][_0x8eff('0x7b')](_0x29f68e['query'][_0x321159]));}else if(_0x321159===_0x8eff('0x7c')){var _0x5492df=JSON[_0x8eff('0x7d')](_0x29f68e[_0x8eff('0x3d')][_0x321159])[_0x8eff('0x7e')];var _0x225703=JSON[_0x8eff('0x7d')](_0x29f68e[_0x8eff('0x3d')][_0x321159])['$lte'];_0x5c491b[_0x8eff('0x79')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5492df,_0x225703);}else{if(_0x29f68e[_0x8eff('0x3d')][_0x321159]===_0x8eff('0x7f')){_0x5c491b[_0x8eff('0x79')]('i.'+_0x321159+_0x8eff('0x80'));}else{_0x5c491b[_0x8eff('0x79')]('i.'+_0x321159+_0x8eff('0x81'),_0x29f68e[_0x8eff('0x3d')][_0x321159]);}}});}if(_0x29f68e[_0x8eff('0x3d')][_0x8eff('0x82')]){if(_0x29f68e['query'][_0x8eff('0x82')]==0x1){_0x5c491b[_0x8eff('0x65')](_0x8eff('0x83'));}else{_0x5c491b[_0x8eff('0x65')](_0x8eff('0x84'));}}if(_0x29f68e[_0x8eff('0x3d')][_0x8eff('0x85')]){_0xb99749=_[_0x8eff('0x86')](_0x29f68e[_0x8eff('0x3d')][_0x8eff('0x85')])?_0x29f68e['query']['tag']:new Array(_0x29f68e['query']['tag']);_0xb99749[_0x8eff('0x77')](function(_0x16221f){_0x9a8a92['or'](_0x8eff('0x71'),'%,'+_0x16221f+',%');});}if(_0x29f68e[_0x8eff('0x3d')][_0x8eff('0x87')]){var _0x125ea4=_0x29f68e[_0x8eff('0x3d')]['filter'][_0x8eff('0x88')]('\x5c','\x5c\x5c')[_0x8eff('0x88')](/'/g,'\x27\x27');if(qs[_0x8eff('0x89')](_0x125ea4)){_0x430f5e['or'](_0x8eff('0x8a'),_0x125ea4+'%');}else if(qs['isEmail'](_0x125ea4)){_0x430f5e['or'](_0x8eff('0x8b'),_0x125ea4+'%');}else{_0x430f5e['or'](_0x8eff('0x8c'),qs['getFullTextValue'](_0x125ea4))['or'](_0x8eff('0x8d'),qs[_0x8eff('0x6a')](_0x125ea4));}}}_0x5c491b[_0x8eff('0x79')](_0x430f5e);_0x5c491b['group']('i.id');var _0x49f8f1={'type':db[_0x8eff('0x8e')][_0x8eff('0x8f')][_0x8eff('0x90')],'raw':!![]};var _0x168465=_0x5c491b[_0x8eff('0x91')]();_0x168465[_0x8eff('0x47')](_0x8eff('0x92'));_0x168465[_0x8eff('0x47')](_0x8eff('0x93'),_0x8eff('0x63'));if(_0x661c36[_0x8eff('0x45')]){_0x661c36['order'][_0x8eff('0x77')](function(_0x5201c2){var _0x181bd5=_0x5201c2[0x0]===_0x8eff('0x94')?_0x5201c2[0x0]:'i.'+_0x5201c2[0x0];_0x5c491b['order'](_0x181bd5,_0x5201c2[0x1]===_0x8eff('0x95')?![]:!![]);});}if(!_['isEmpty'](_0xb99749)){_0x5c491b[_0x8eff('0x65')](_0x9a8a92);_0x168465[_0x8eff('0x79')](_0x8eff('0x96'),_0xb99749);}BPromise[_0x8eff('0x97')]()[_0x8eff('0x1c')](function(){if(!_0x1d2838){if(_0x29f68e['query'][_0x8eff('0x78')])return;_0x168465[_0x8eff('0x79')](_0x8eff('0x98'));_0x5c491b[_0x8eff('0x79')](_0x8eff('0x98'));return;}if(_0x29f68e[_0x8eff('0x99')][_0x8eff('0x9a')]!==_0x8eff('0x9b'))return;return _0x29f68e[_0x8eff('0x99')][_0x8eff('0x9c')]({'attributes':['id'],'raw':!![]})[_0x8eff('0x1c')](function(_0x52383c){if(_[_0x8eff('0x76')](_0x52383c)){_0x168465[_0x8eff('0x79')](_0x8eff('0x9d'));_0x5c491b[_0x8eff('0x79')](_0x8eff('0x9d'));}else{_0x168465['where'](_0x8eff('0x7a'),_[_0x8eff('0x23')](_0x52383c,'id'));_0x5c491b['where']('i.MailAccountId\x20IN\x20?',_[_0x8eff('0x23')](_0x52383c,'id'));}});})[_0x8eff('0x1c')](function(){if(_0x29f68e[_0x8eff('0x99')][_0x8eff('0x9a')]===_0x8eff('0x9b')&&!_0x1d2838&&!_0x29f68e[_0x8eff('0x3d')]['MailAccountId'])return[];return db[_0x8eff('0x9e')]['query'](_0x168465[_0x8eff('0x9f')](),_0x49f8f1);})[_0x8eff('0x1c')](function(_0x57878e){_0x54a2d9[_0x8eff('0x18')]=_0x57878e['length'];if(_0x54a2d9['count']===0x0)return[];return db[_0x8eff('0x9e')]['query'](_0x581a6a[_0x8eff('0x9f')](),_0x49f8f1)[_0x8eff('0x1c')](function(_0x4e0128){_0x577a2b=_[_0x8eff('0xa0')](_0x4e0128,'id');_0x49f8f1=_[_0x8eff('0xa1')](_0x49f8f1,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x29f68e[_0x8eff('0x3d')][_0x8eff('0x42')]){_0x661c36[_0x8eff('0x41')][_0x8eff('0x77')](function(_0x22abc5){_0x5c491b[_0x8eff('0x47')]('i.'+_0x22abc5);});}else{_0x5c491b[_0x8eff('0x47')](_0x8eff('0x93'),_0x8eff('0x63'));_0x5c491b['field']('a.key','Account.key');_0x5c491b[_0x8eff('0x47')](_0x8eff('0xa2'),_0x8eff('0xa3'));_0x5c491b['field'](_0x8eff('0xa4'),_0x8eff('0x94'));_0x5c491b[_0x8eff('0x47')](_0x8eff('0x92'));_0x5c491b[_0x8eff('0x47')](_0x8eff('0xa5'));_0x5c491b['field'](_0x8eff('0xa6'));_0x5c491b['field'](_0x8eff('0xa7'));_0x5c491b[_0x8eff('0x47')](_0x8eff('0xa8'));_0x5c491b[_0x8eff('0x47')](_0x8eff('0xa9'));_0x5c491b[_0x8eff('0x47')](_0x8eff('0xaa'));_0x5c491b['field'](_0x8eff('0xab'));_0x5c491b[_0x8eff('0x47')](_0x8eff('0xac'));_0x5c491b[_0x8eff('0x47')](_0x8eff('0xad'));_0x5c491b['field'](_0x8eff('0xae'));_0x5c491b[_0x8eff('0x47')](_0x8eff('0xaf'));_0x5c491b['field']('i.substatus');_0x5c491b[_0x8eff('0x47')](_0x8eff('0xb0'));_0x5c491b[_0x8eff('0x47')]('i.ContactId');_0x5c491b[_0x8eff('0x47')]('i.MailAccountId');_0x5c491b['field'](_0x8eff('0xb1'));_0x5c491b[_0x8eff('0x47')](_0x8eff('0xb2'),_0x8eff('0xb3'));_0x5c491b[_0x8eff('0x47')](_0x8eff('0xb4'),_0x8eff('0xb5'));_0x5c491b[_0x8eff('0x47')](_0x8eff('0xb6'),_0x8eff('0xb7'));_0x5c491b[_0x8eff('0x47')](_0x8eff('0xb8'),'Contact.phone');_0x5c491b[_0x8eff('0x47')](_0x8eff('0xb9'),_0x8eff('0xba'));_0x5c491b[_0x8eff('0x47')](_0x8eff('0xbb'),'Contact.fax');_0x5c491b[_0x8eff('0x47')](_0x8eff('0xbc'),_0x8eff('0xbd'));_0x5c491b[_0x8eff('0x47')]('o.internal','Owner.internal');_0x5c491b[_0x8eff('0x47')](_0x8eff('0xbe'),_0x8eff('0x25'));}if(_0x661c36[_0x8eff('0x17')])_0x5c491b['limit'](_0x661c36[_0x8eff('0x17')]);if(_0x661c36[_0x8eff('0x15')])_0x5c491b[_0x8eff('0x15')](_0x661c36[_0x8eff('0x15')]);return db[_0x8eff('0x9e')][_0x8eff('0x3d')](_0x5c491b[_0x8eff('0x9f')](),_0x49f8f1);})[_0x8eff('0x1c')](function(_0x8ff7ed){if(_0x8ff7ed['length']>0x0)_0x1aa204[_0x8eff('0x79')]('ui.MailInteractionId\x20IN\x20?',_[_0x8eff('0x23')](_0x8ff7ed,'id'));return db[_0x8eff('0x9e')][_0x8eff('0x3d')](_0x1aa204['toString'](),_0x49f8f1)[_0x8eff('0x1c')](function(_0x4ff258){var _0x1dba3f=_[_0x8eff('0xbf')](_0x4ff258,'MailInteractionId');var _0x2c753a=[];return db[_0x8eff('0xc0')][_0x8eff('0x2a')]({'attributes':[_0x8eff('0xc1')],'raw':!![]})[_0x8eff('0x1c')](function(_0xd76532){var _0x537329=_0xd76532[_0x8eff('0xc1')];_0x8ff7ed[_0x8eff('0x77')](function(_0x1fab86){_0x2c753a['push'](updateMailInteraction(_0x1fab86,_0x577a2b,_0x1dba3f,_0x537329));});return BPromise[_0x8eff('0xc2')](_0x2c753a);});});});})[_0x8eff('0x1c')](function(_0x55f961){_0x54a2d9[_0x8eff('0xc3')]=_0x55f961;return _0x54a2d9;})[_0x8eff('0x1c')](respondWithFilteredResult(_0x26da7a,_0x661c36))[_0x8eff('0x2f')](handleError(_0x26da7a,null));};exports[_0x8eff('0xc4')]=function(_0x5bd373,_0x367ec5){var _0x5612a0={'raw':![],'where':{'id':_0x5bd373[_0x8eff('0xc5')]['id']}},_0x359fc6={};_0x359fc6[_0x8eff('0x3c')]=_[_0x8eff('0x3e')](db['MailInteraction'][_0x8eff('0x39')]);_0x359fc6['query']=_[_0x8eff('0x3e')](_0x5bd373[_0x8eff('0x3d')]);_0x359fc6[_0x8eff('0x3f')]=_[_0x8eff('0x40')](_0x359fc6[_0x8eff('0x3c')],_0x359fc6['query']);_0x5612a0[_0x8eff('0x41')]=_[_0x8eff('0x40')](_0x359fc6[_0x8eff('0x3c')],qs[_0x8eff('0x42')](_0x5bd373[_0x8eff('0x3d')][_0x8eff('0x42')]));_0x5612a0[_0x8eff('0x41')]=_0x5612a0[_0x8eff('0x41')]['length']?_0x5612a0[_0x8eff('0x41')]:_0x359fc6[_0x8eff('0x3c')];if(_0x5bd373['query']['includeAll']){_0x5612a0[_0x8eff('0xc6')]=[{'all':!![]}];}_0x5612a0=_['merge']({},_0x5612a0,_0x5bd373['options']);return db[_0x8eff('0x38')][_0x8eff('0x62')](_0x5612a0)['then'](handleEntityNotFound(_0x367ec5,null))[_0x8eff('0x1c')](respondWithResult(_0x367ec5,null))[_0x8eff('0x2f')](handleError(_0x367ec5,null));};exports[_0x8eff('0xc7')]=function(_0x4a126e,_0x3f5c47){return db[_0x8eff('0x38')]['create'](_0x4a126e[_0x8eff('0xc8')],{})[_0x8eff('0x1c')](respondWithResult(_0x3f5c47,0xc9))[_0x8eff('0x2f')](handleError(_0x3f5c47,null));};exports['update']=function(_0x5477c0,_0x52f9b2){if(_0x5477c0[_0x8eff('0xc8')]['id']){delete _0x5477c0[_0x8eff('0xc8')]['id'];}return db[_0x8eff('0x38')][_0x8eff('0x62')]({'where':{'id':_0x5477c0[_0x8eff('0xc5')]['id']}})[_0x8eff('0x1c')](handleEntityNotFound(_0x52f9b2,null))[_0x8eff('0x1c')](saveUpdates(_0x5477c0[_0x8eff('0xc8')],null))[_0x8eff('0x1c')](respondWithResult(_0x52f9b2,null))[_0x8eff('0x2f')](handleError(_0x52f9b2,null));};exports[_0x8eff('0x1d')]=function(_0x4d7417,_0x56d0ed){return db[_0x8eff('0x38')][_0x8eff('0x62')]({'where':{'id':_0x4d7417[_0x8eff('0xc5')]['id']}})[_0x8eff('0x1c')](handleEntityNotFound(_0x56d0ed,null))[_0x8eff('0x1c')](removeEntity(_0x56d0ed,null))[_0x8eff('0x2f')](handleError(_0x56d0ed,null));};exports[_0x8eff('0xc9')]=function(_0x2d1c0b,_0x3bf06d){return db['MailInteraction'][_0x8eff('0xc9')]()[_0x8eff('0x1c')](respondWithResult(_0x3bf06d,null))[_0x8eff('0x2f')](handleError(_0x3bf06d,null));};exports[_0x8eff('0xca')]=function(_0x2bdb10,_0x51017a){return db['MailMessage']['find']({'where':{'id':_0x2bdb10[_0x8eff('0xc5')]['id']}})[_0x8eff('0x1c')](handleEntityNotFound(_0x51017a,null))[_0x8eff('0x1c')](function(_0xfaf42a){if(_0xfaf42a){return _0xfaf42a[_0x8eff('0xca')](_0x2bdb10['body'][_0x8eff('0xcb')],_['omit'](_0x2bdb10['body'],[_0x8eff('0xcb'),'id'])||{});}})[_0x8eff('0x1c')](respondWithResult(_0x51017a,null))[_0x8eff('0x2f')](handleError(_0x51017a,null));};exports['getMessages']=function(_0x16ab23,_0x299f7d){var _0xcc942c={'raw':![],'where':{}};var _0x41f188={};var _0x27a3be={'count':0x0,'rows':[]};return db[_0x8eff('0x38')]['findOne']({'where':{'id':_0x16ab23[_0x8eff('0xc5')]['id']}})['then'](handleEntityNotFound(_0x299f7d,null))[_0x8eff('0x1c')](function(_0x109165){if(_0x109165){_0x41f188[_0x8eff('0x3c')]=_[_0x8eff('0x3e')](db[_0x8eff('0x29')][_0x8eff('0x39')]);_0x41f188['query']=_['keys'](_0x16ab23[_0x8eff('0x3d')]);_0x41f188[_0x8eff('0x3f')]=_[_0x8eff('0x40')](_0x41f188[_0x8eff('0x3c')],_0x41f188[_0x8eff('0x3d')]);_0xcc942c['attributes']=_[_0x8eff('0x40')](_0x41f188[_0x8eff('0x3c')],qs[_0x8eff('0x42')](_0x16ab23['query']['fields']));_0xcc942c[_0x8eff('0x41')]=_0xcc942c[_0x8eff('0x41')][_0x8eff('0x61')]?_0xcc942c[_0x8eff('0x41')]:_0x41f188[_0x8eff('0x3c')];if(!_0x16ab23[_0x8eff('0x3d')][_0x8eff('0x43')](_0x8eff('0x44'))){_0xcc942c['limit']=qs['limit'](_0x16ab23[_0x8eff('0x3d')][_0x8eff('0x17')]);_0xcc942c[_0x8eff('0x15')]=qs[_0x8eff('0x15')](_0x16ab23[_0x8eff('0x3d')][_0x8eff('0x15')]);}_0xcc942c[_0x8eff('0x45')]=qs['sort'](_0x16ab23[_0x8eff('0x3d')][_0x8eff('0x46')]);_0xcc942c[_0x8eff('0x79')]=qs[_0x8eff('0x3f')](_[_0x8eff('0xcc')](_0x16ab23[_0x8eff('0x3d')],_0x41f188['filters']));_0xcc942c['where']['MailInteractionId']=_0x109165['id'];if(_0x16ab23[_0x8eff('0x3d')][_0x8eff('0x87')]){_0xcc942c[_0x8eff('0x79')]=_[_0x8eff('0xa1')](_0xcc942c[_0x8eff('0x79')],{'$or':_[_0x8eff('0x23')](_0xcc942c['attributes'],function(_0x990f6b){var _0x37ab1e={};_0x37ab1e[_0x990f6b]={'$like':'%'+_0x16ab23[_0x8eff('0x3d')][_0x8eff('0x87')]+'%'};return _0x37ab1e;})});}if(_0x16ab23[_0x8eff('0x3d')][_0x8eff('0x7e')]){var _0x2b755d=_0x16ab23[_0x8eff('0x3d')][_0x8eff('0x7e')][_0x8eff('0x27')](',');var _0x2985f2={};_0x2985f2[_0x2b755d[0x0]]={'$gte':moment(_0x2b755d[0x1])[_0x8eff('0xcd')]('YYYY-MM-DD\x20HH:mm:ss')};_0xcc942c[_0x8eff('0x79')]=_[_0x8eff('0xa1')](_0xcc942c[_0x8eff('0x79')],_0x2985f2);}_0xcc942c=_[_0x8eff('0xa1')]({},_0xcc942c,_0x16ab23[_0x8eff('0xce')]);return db[_0x8eff('0x29')]['count']({'where':_0xcc942c[_0x8eff('0x79')]})[_0x8eff('0x1c')](function(_0xe438d2){_0x27a3be['count']=_0xe438d2;if(_0x16ab23['query'][_0x8eff('0xcf')]){_0xcc942c['include']=[{'all':!![]}];}return db['MailMessage'][_0x8eff('0xd0')](_0xcc942c);})[_0x8eff('0x1c')](function(_0x270798){if(_0x16ab23[_0x8eff('0x3d')][_0x8eff('0xd1')]===_0x8eff('0xd2')){for(var _0x1d9e31=0x0;_0x1d9e31<_0x270798[_0x8eff('0x61')];_0x1d9e31++){_0x270798[_0x1d9e31]['body']=juice(_0x270798[_0x1d9e31][_0x8eff('0xc8')]);}}_0x27a3be[_0x8eff('0xc3')]=_0x270798;return _0x27a3be;});}})[_0x8eff('0x1c')](respondWithFilteredResult(_0x299f7d,_0xcc942c))[_0x8eff('0x2f')](handleError(_0x299f7d,null));};exports['addTags']=function(_0x14ab78,_0x2374eb){return db[_0x8eff('0x38')][_0x8eff('0x62')]({'where':{'id':_0x14ab78[_0x8eff('0xc5')]['id']}})[_0x8eff('0x1c')](handleEntityNotFound(_0x2374eb,null))[_0x8eff('0x1c')](function(_0x412a1b){if(_0x412a1b){return _0x412a1b[_0x8eff('0xd3')](_0x14ab78[_0x8eff('0xc8')][_0x8eff('0xcb')],_[_0x8eff('0xd4')](_0x14ab78[_0x8eff('0xc8')],[_0x8eff('0xcb'),'id'])||{})[_0x8eff('0xd5')](function(){return db[_0x8eff('0x70')][_0x8eff('0xd0')]({'attributes':['id',_0x8eff('0x20'),_0x8eff('0x48')],'where':{'id':_0x14ab78[_0x8eff('0xc8')]['ids']}});})['then'](function(_0x4ad88c){socket[_0x8eff('0xd6')](_0x8eff('0xd7'),{'id':Number(_0x14ab78[_0x8eff('0xc5')]['id']),'tags':_0x4ad88c||[]});return{'id':Number(_0x14ab78[_0x8eff('0xc5')]['id']),'tags':_0x4ad88c||[]};});}})['then'](respondWithResult(_0x2374eb,null))[_0x8eff('0x2f')](handleError(_0x2374eb,null));};exports[_0x8eff('0xd8')]=function(_0x23790f,_0x3027b2){return db[_0x8eff('0x38')][_0x8eff('0x62')]({'where':{'id':_0x23790f[_0x8eff('0xc5')]['id']}})['then'](handleEntityNotFound(_0x3027b2,null))[_0x8eff('0x1c')](function(_0x31aaf5){if(_0x31aaf5){return _0x31aaf5[_0x8eff('0xd8')](_0x23790f[_0x8eff('0x3d')][_0x8eff('0xcb')]);}})[_0x8eff('0x1c')](respondWithStatusCode(_0x3027b2,null))[_0x8eff('0x2f')](handleError(_0x3027b2,null));};exports['download']=function(_0x3ad79f,_0x598e48){var _0x2fd205=moment()[_0x8eff('0xd9')]()['toString']();var _0x305413=path['join'](config[_0x8eff('0xda')],_0x8eff('0xdb'),_0x8eff('0xdc'),_0x8eff('0xdd'));var _0x4a4db9=path[_0x8eff('0xde')](config[_0x8eff('0xda')],'server',_0x8eff('0xdc'),_0x8eff('0xdf'));var _0x180fb2=path['join'](_0x305413,_0x2fd205);var _0x49045e=util[_0x8eff('0xcd')](_0x8eff('0xe0'),_0x3ad79f['params']['id'],_0x2fd205);var _0x504138=path[_0x8eff('0xde')](_0x305413,_0x49045e);var _0x7a7432=[];if(_0x3ad79f[_0x8eff('0x3d')]['attachments']){_0x7a7432[_0x8eff('0x28')]({'model':db[_0x8eff('0xe1')],'as':_0x8eff('0xe2'),'raw':!![]});}var _0x1cc384=[{'model':db[_0x8eff('0x29')],'as':'Messages','attributes':['id',_0x8eff('0xc8'),_0x8eff('0x49'),'to','cc',_0x8eff('0xe3'),'subject',_0x8eff('0x7c')],'where':{'secret':![]},'order':qs[_0x8eff('0x46')]('id'),'include':_0x7a7432}];return db[_0x8eff('0x38')][_0x8eff('0x62')]({'where':{'id':_0x3ad79f[_0x8eff('0xc5')]['id']},'include':_0x1cc384})[_0x8eff('0x1c')](handleEntityNotFound(_0x598e48,null))[_0x8eff('0x1c')](function(_0x51f22e){if(_0x51f22e&&_0x51f22e[_0x8eff('0xe4')]){var _0x4cbce7=_0x51f22e[_0x8eff('0xe5')]({'plain':!![]});fs[_0x8eff('0xe6')](_0x180fb2);return BPromise[_0x8eff('0xe7')](_0x4cbce7[_0x8eff('0xe4')],function(_0x1ae192,_0x390347){var _0x3c80de={'from':_0x1ae192[_0x8eff('0x49')],'to':_0x1ae192['to'],'subject':_0x1ae192[_0x8eff('0xe8')],'html':htmlEntities[_0x8eff('0xe9')](_0x1ae192[_0x8eff('0xc8')]),'headers':{'Date':moment(_0x1ae192[_0x8eff('0x7c')])[_0x8eff('0xcd')](_0x8eff('0xea'))},'attachments':[]};if(_0x1ae192['cc']){_0x3c80de[_0x8eff('0xeb')]['Cc']=_0x1ae192['cc'];}if(_0x1ae192[_0x8eff('0xe3')]){_0x3c80de['headers'][_0x8eff('0xec')]=_0x1ae192[_0x8eff('0xe3')];}return new BPromise(function(_0x4d3d36,_0x428adc){if(_0x1ae192['Attachments']){for(var _0x27da0a=0x0;_0x27da0a<_0x1ae192['Attachments'][_0x8eff('0x61')];_0x27da0a++){var _0x3bd4f7=_0x1ae192['Attachments'][_0x27da0a];var _0x775a67=path['join'](_0x4a4db9,_0x3bd4f7[_0x8eff('0xed')]);if(fs[_0x8eff('0xee')](_0x775a67)){_0x3c80de[_0x8eff('0xdf')][_0x8eff('0x28')]({'name':_0x3bd4f7[_0x8eff('0x20')],'contentType':_0x3bd4f7[_0x8eff('0x3b')],'data':fs[_0x8eff('0xef')](_0x775a67)});}}}emlformat[_0x8eff('0xf0')](_0x3c80de,function(_0x337844,_0x24de98){if(_0x337844)return _0x428adc(_0x337844);fs[_0x8eff('0xf1')](path['join'](_0x180fb2,util[_0x8eff('0xcd')]('message%d.eml',_0x390347)),_0x24de98);return _0x4d3d36(_0x24de98);});});})['then'](function(){return new BPromise(function(_0x58c83c,_0x23b120){zipdir(_0x180fb2,{'saveTo':_0x504138},function(_0xfe0170,_0x220890){if(_0xfe0170)return _0x23b120(_0xfe0170);return _0x58c83c(_0x220890);});})[_0x8eff('0x1c')](function(){return new BPromise(function(_0x170413,_0x18cce9){rimraf(_0x180fb2,function(_0x32aaaa){if(_0x32aaaa)_0x18cce9(_0x32aaaa);return _0x170413();});});})['then'](function(){return _0x598e48[_0x8eff('0xf2')](_0x504138,_0x49045e,function(_0x52fc16){if(!_0x52fc16)fs[_0x8eff('0xf3')](_0x504138);});});});}else{return _0x598e48[_0x8eff('0xf4')](0xc8);}})[_0x8eff('0x2f')](handleError(_0x598e48,null));}; \ No newline at end of file +var _0x0763=['text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','keys','some','compact','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','t.id\x20IN\x20?','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','user','agent','getMailAccounts','role','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_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.createdAt','i.updatedAt','i.closed','i.attach','i.lastMsgDirection','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.substatus','i.to','i.ContactId','i.UserId','Contact.firstName','c.lastName','Contact.lastName','c.phone','c.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','enableEmailPreview','push','all','show','params','includeAll','include','options','create','body','destroy','describe','addMessage','MailMessage','ids','omit','getMessages','nolimit','sort','pick','$gte','format','findAll','inlineCss','rows','setTags','emit','mailInteractionTags:save','removeTags','download','unix','join','root','server','files','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','subject','mkdirSync','decode','headers','Bcc','bcc','basename','readFileSync','build','message%d.eml','unlinkSync','eml-format','zip-dir','moment','util','path','lodash','squel','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','html-entities','redis','defaults','localhost','socket.io-emitter','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','then','end','error','stack','name','map','fullname','TagIds','Tags','forEach','findOne','-id','lastMsgText','trimStart','plainBody','catch','waiting','talking','answered','unmanaged','total','closed','UserId','index','MailInteraction','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','where','select','field','color','from','tools_tags','u.id','ui.MailInteractionId','user_has_mail_interactions','left_join','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','mail_accounts','me.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','length','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','value','split','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x0763,0x87));var _0x3076=function(_0xca04ff,_0xcb449f){_0xca04ff=_0xca04ff-0x0;var _0x6b547=_0x0763[_0xca04ff];return _0x6b547;};'use strict';var emlformat=require(_0x3076('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3076('0x1'));var moment=require(_0x3076('0x2'));var BPromise=require('bluebird');var util=require(_0x3076('0x3'));var path=require(_0x3076('0x4'));var fs=require('fs');var _=require(_0x3076('0x5'));var squel=require(_0x3076('0x6'));var juice=require('juice');var Redis=require(_0x3076('0x7'));var qs=require(_0x3076('0x8'));var as=require(_0x3076('0x9'));var logger=require(_0x3076('0xa'))(_0x3076('0xb'));var config=require(_0x3076('0xc'));var db=require(_0x3076('0xd'))['db'];var htmlEntities=require(_0x3076('0xe'));config[_0x3076('0xf')]=_[_0x3076('0x10')](config['redis'],{'host':_0x3076('0x11'),'port':0x18eb});var socket=require(_0x3076('0x12'))(new Redis(config[_0x3076('0xf')]));require('./mailInteraction.socket')['register'](socket);function respondWithStatusCode(_0x366eb6,_0xbc0375){_0xbc0375=_0xbc0375||0xcc;return function(_0x3f038b){if(_0x3f038b){return _0x366eb6[_0x3076('0x13')](_0xbc0375);}return _0x366eb6[_0x3076('0x14')](_0xbc0375)['end']();};}function respondWithResult(_0x203d0,_0x209fc0){_0x209fc0=_0x209fc0||0xc8;return function(_0x2fe9d1){if(_0x2fe9d1){return _0x203d0[_0x3076('0x14')](_0x209fc0)[_0x3076('0x15')](_0x2fe9d1);}};}function respondWithFilteredResult(_0xb7c119,_0x43f24d){return function(_0x3a6f74){if(_0x3a6f74){var _0x54ff6a=typeof _0x43f24d['offset']===_0x3076('0x16')&&typeof _0x43f24d[_0x3076('0x17')]===_0x3076('0x16');var _0x1b2256=_0x3a6f74['count'];var _0x5bf9ec=_0x54ff6a?0x0:_0x43f24d[_0x3076('0x18')];var _0x1ca82d=_0x54ff6a?_0x3a6f74[_0x3076('0x19')]:_0x43f24d[_0x3076('0x18')]+_0x43f24d[_0x3076('0x17')];var _0x3b21bc;if(_0x1ca82d>=_0x1b2256){_0x1ca82d=_0x1b2256;_0x3b21bc=0xc8;}else{_0x3b21bc=0xce;}_0xb7c119[_0x3076('0x14')](_0x3b21bc);return _0xb7c119[_0x3076('0x1a')](_0x3076('0x1b'),_0x5bf9ec+'-'+_0x1ca82d+'/'+_0x1b2256)[_0x3076('0x15')](_0x3a6f74);}return null;};}function saveUpdates(_0x15cf30){return function(_0x456bc2){if(_0x456bc2){return _0x456bc2['update'](_0x15cf30)[_0x3076('0x1c')](function(_0x17d4dd){return _0x17d4dd;});}return null;};}function removeEntity(_0x5a4eaf){return function(_0xf5b8f7){if(_0xf5b8f7){return _0xf5b8f7['destroy']()[_0x3076('0x1c')](function(){_0x5a4eaf[_0x3076('0x14')](0xcc)[_0x3076('0x1d')]();});}};}function handleEntityNotFound(_0x5cd689){return function(_0x3ef86c){if(!_0x3ef86c){_0x5cd689[_0x3076('0x13')](0x194);}return _0x3ef86c;};}function handleError(_0x2398f4,_0x9b4bec){_0x9b4bec=_0x9b4bec||0x1f4;return function(_0x58f284){logger[_0x3076('0x1e')](_0x58f284[_0x3076('0x1f')]);if(_0x58f284[_0x3076('0x20')]){delete _0x58f284[_0x3076('0x20')];}_0x2398f4[_0x3076('0x14')](_0x9b4bec)['send'](_0x58f284);};}function getInteractionUsers(_0x4425c3,_0x599f6f){return new BPromise(function(_0x116de4,_0x4f4bdc){try{if(_0x599f6f[_0x4425c3['id']]){_0x4425c3['Users']=_[_0x3076('0x21')](_0x599f6f[_0x4425c3['id']],function(_0x474468){return{'id':_0x474468['id'],'fullname':_0x474468[_0x3076('0x22')]};});}}catch(_0x1b169b){_0x4f4bdc(_0x1b169b);}_0x116de4(_0x4425c3);});}function getInteractionTags(_0x28d834,_0x258427){return new BPromise(function(_0x52fd6c,_0x2a8c52){try{if(_0x28d834[_0x3076('0x23')]){_0x28d834[_0x3076('0x24')]=[];_0x28d834[_0x3076('0x23')]['split'](',')[_0x3076('0x25')](function(_0x45805e){_0x28d834[_0x3076('0x24')]['push'](_0x258427[_0x45805e]);});}delete _0x28d834[_0x3076('0x23')];}catch(_0x332a3b){_0x2a8c52(_0x332a3b);}_0x52fd6c(_0x28d834);});}function getLastMessageText(_0x587585){return new BPromise(function(_0x1c0706,_0x261d73){return db['MailMessage'][_0x3076('0x26')]({'where':{'$and':[{'MailInteractionId':_0x587585['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0x3076('0x27'),'raw':!![]})[_0x3076('0x1c')](function(_0x223fb7){if(_0x223fb7&&_0x223fb7['plainBody']){_0x587585[_0x3076('0x28')]=_[_0x3076('0x29')](_0x223fb7[_0x3076('0x2a')]);}_0x1c0706(_0x587585);})[_0x3076('0x2b')](function(_0x516e5d){_0x261d73(_0x516e5d);});});}function updateMailInteraction(_0x44fd84,_0x298127,_0x326c5f,_0x1958c4){return new BPromise(function(_0x315c0a,_0x59e291){return getInteractionUsers(_0x44fd84,_0x326c5f)[_0x3076('0x1c')](function(_0x1c60ab){return getInteractionTags(_0x1c60ab,_0x298127);})[_0x3076('0x1c')](function(_0x468564){return getStateInteraction(_0x468564);})[_0x3076('0x1c')](function(_0x39fd2e){if(_0x1958c4){_0x315c0a(getLastMessageText(_0x39fd2e));}else{_0x315c0a(_0x39fd2e);}})['catch'](function(_0x171d0a){_0x59e291(_0x171d0a);});});}function getStateInteraction(_0x538502){return new BPromise(function(_0x445847){_0x538502[_0x3076('0x2c')]=0x0;_0x538502[_0x3076('0x2d')]=0x0;_0x538502[_0x3076('0x2e')]=0x0;_0x538502[_0x3076('0x2f')]=0x0;_0x538502[_0x3076('0x30')]=0x0;if(!_0x538502[_0x3076('0x31')]&&!_0x538502[_0x3076('0x32')]){_0x538502[_0x3076('0x2c')]+=0x1;}if(!_0x538502[_0x3076('0x31')]&&_0x538502[_0x3076('0x32')]){_0x538502[_0x3076('0x2d')]+=0x1;if(_0x538502[_0x3076('0x2c')]){_0x538502[_0x3076('0x2c')]-=0x1;}}if(_0x538502[_0x3076('0x31')]&&_0x538502[_0x3076('0x32')]){_0x538502[_0x3076('0x2e')]+=0x1;if(_0x538502[_0x3076('0x2d')]){_0x538502[_0x3076('0x2d')]-=0x1;}}if(_0x538502[_0x3076('0x31')]&&!_0x538502[_0x3076('0x32')]){_0x538502[_0x3076('0x2f')]+=0x1;if(_0x538502[_0x3076('0x2c')]){_0x538502[_0x3076('0x2c')]-=0x1;}}_0x538502[_0x3076('0x30')]+=0x1;_0x445847(_0x538502);});}exports[_0x3076('0x33')]=function(_0x45ac78,_0x47d04a){var _0x191544={},_0x3a56f2={},_0x454e04={'count':0x0,'rows':[]};var _0x283c6b=_['map'](db[_0x3076('0x34')][_0x3076('0x35')],function(_0x381ff5){return{'name':_0x381ff5[_0x3076('0x36')],'type':_0x381ff5[_0x3076('0x37')]['key']};});_0x3a56f2[_0x3076('0x38')]=_[_0x3076('0x21')](_0x283c6b,_0x3076('0x20'));_0x3a56f2[_0x3076('0x39')]=_['keys'](_0x45ac78[_0x3076('0x39')]);_0x3a56f2[_0x3076('0x3a')]=_[_0x3076('0x3b')](_0x3a56f2[_0x3076('0x38')],_0x3a56f2[_0x3076('0x39')]);_0x191544[_0x3076('0x3c')]=_[_0x3076('0x3b')](_0x3a56f2[_0x3076('0x38')],qs[_0x3076('0x3d')](_0x45ac78['query'][_0x3076('0x3d')]));_0x191544[_0x3076('0x3c')]=_0x191544['attributes']['length']?_0x191544[_0x3076('0x3c')]:_0x3a56f2[_0x3076('0x38')];if(!_0x45ac78[_0x3076('0x39')][_0x3076('0x3e')]('nolimit')){_0x191544[_0x3076('0x17')]=qs[_0x3076('0x17')](_0x45ac78[_0x3076('0x39')]['limit']);_0x191544[_0x3076('0x18')]=qs[_0x3076('0x18')](_0x45ac78['query']['offset']);}_0x191544['order']=qs['sort'](_0x45ac78[_0x3076('0x39')]['sort']);_0x191544[_0x3076('0x3f')]=qs['filters'](_['pick'](_0x45ac78[_0x3076('0x39')],_0x3a56f2[_0x3076('0x3a')]),_0x283c6b);var _0x23307c=[];var _0x7405d6=squel[_0x3076('0x40')]()[_0x3076('0x41')]('id')[_0x3076('0x41')](_0x3076('0x20'))[_0x3076('0x41')](_0x3076('0x42'))[_0x3076('0x43')](_0x3076('0x44'));var _0x4e91dc=squel[_0x3076('0x40')]()['field'](_0x3076('0x45'))[_0x3076('0x41')]('u.fullname')['field'](_0x3076('0x46'))[_0x3076('0x43')](_0x3076('0x47'),'ui')[_0x3076('0x48')]('users','u',_0x3076('0x49'));var _0x163fc2=squel['select']()[_0x3076('0x43')]('mail_interactions','i')['left_join'](_0x3076('0x4a'),'c',_0x3076('0x4b'))[_0x3076('0x48')](_0x3076('0x4c'),'o',_0x3076('0x4d'))[_0x3076('0x48')](_0x3076('0x4e'),'a','a.id\x20=\x20i.MailAccountId')[_0x3076('0x48')]('mail_messages','me',_0x3076('0x4f'))[_0x3076('0x48')]('mail_interaction_has_tags','it','it.MailInteractionId\x20=\x20i.id')['left_join'](_0x3076('0x44'),'t',_0x3076('0x50'));var _0x4674f7=squel['expr']();var _0x496a8b=[];var _0x490d3a=squel[_0x3076('0x51')]();var _0x11fc1f;if(_0x45ac78[_0x3076('0x39')]['search']){_0x11fc1f=as[_0x3076('0x52')](_0x45ac78['query'][_0x3076('0x53')]);var _0x2709fa=_0x11fc1f[_0x3076('0x54')];for(var _0x3fa143=0x0;_0x3fa143<_0x11fc1f[_0x3076('0x55')][_0x3076('0x56')];_0x3fa143++){var _0x5a19a8=_0x11fc1f[_0x3076('0x55')][_0x3fa143];var _0x353054='i';var _0xd02de6=_[_0x3076('0x57')](_0x283c6b,[_0x3076('0x20'),_0x5a19a8['field']]);if(!_0xd02de6){switch(_0x5a19a8[_0x3076('0x41')]){case _0x3076('0x58'):if(_0x5a19a8['value']==0x1){_0x163fc2[_0x3076('0x59')]('`'+_0x5a19a8['field']+_0x3076('0x5a'));}else{_0x163fc2[_0x3076('0x59')]('`'+_0x5a19a8[_0x3076('0x41')]+_0x3076('0x5b'));}break;case _0x3076('0x5c'):if(_0x5a19a8[_0x3076('0x5d')]===_0x3076('0x5e')){if(_0x5a19a8[_0x3076('0x5f')][_0x3076('0x60')]('\x20')[_0x3076('0x56')]>0x1){_0x4674f7[_0x2709fa]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x3076('0x61')](_0x5a19a8['value']),null);}else{var _0xcc85e='%'+_0x5a19a8[_0x3076('0x5f')]+'%';_0x4674f7[_0x2709fa](_0x3076('0x62'),_0xcc85e,_0xcc85e,_0xcc85e);}}else{_0xd02de6=_[_0x3076('0x57')](_0x283c6b,['name','ContactId']);_0x5a19a8['field']=_0x3076('0x63');_0x57c49b=as[_0x3076('0x64')](_0x353054,_0xd02de6[_0x3076('0x37')],_0x5a19a8);_0x4674f7[_0x2709fa](_0x57c49b[_0x3076('0x65')],_0x57c49b[_0x3076('0x5f')][_0x3076('0x66')],_0x57c49b[_0x3076('0x5f')][_0x3076('0x1d')]);}break;case _0x3076('0x67'):var _0x252bf3=_0x5a19a8['value'][_0x3076('0x60')](',')['map'](function(_0x2dbe2d){return Number(_0x2dbe2d);});_0x252bf3[_0x3076('0x25')](function(_0x240ae8){_0x490d3a['or'](_0x3076('0x68'),'%,'+_0x240ae8+',%');});_0x496a8b=_['union'](_0x496a8b,_0x252bf3);break;case _0x3076('0x69'):if(_0x5a19a8['operator']===_0x3076('0x5e')){_0x4674f7[_0x2709fa](_0x3076('0x6a'),'%'+_0x5a19a8[_0x3076('0x5f')]+'%',null);}else{_0xd02de6=_['find'](_0x283c6b,[_0x3076('0x20'),_0x3076('0x32')]);_0x5a19a8['field']=_0x3076('0x32');_0x57c49b=as['buildExpression'](_0x353054,_0xd02de6[_0x3076('0x37')],_0x5a19a8);_0x4674f7[_0x2709fa](_0x57c49b['text'],_0x57c49b[_0x3076('0x5f')][_0x3076('0x66')],_0x57c49b[_0x3076('0x5f')]['end']);}break;case _0x3076('0x2a'):_0x57c49b=as['buildExpression']('me',null,_0x5a19a8);_0x4674f7[_0x2709fa](_0x57c49b[_0x3076('0x65')],_0x57c49b[_0x3076('0x5f')][_0x3076('0x66')],_0x57c49b[_0x3076('0x5f')][_0x3076('0x1d')]);break;}}else{var _0x57c49b=as['buildExpression'](_0x353054,_0xd02de6[_0x3076('0x37')],_0x5a19a8);_0x4674f7[_0x2709fa](_0x57c49b['text'],_0x57c49b[_0x3076('0x5f')][_0x3076('0x66')],_0x57c49b['value'][_0x3076('0x1d')]);}}}else{var _0x56655f=_(_0x45ac78[_0x3076('0x39')])[_0x3076('0x6b')]()['map'](function(_0x1f3d6f){return _[_0x3076('0x6c')](_0x283c6b,[_0x3076('0x20'),_0x1f3d6f])?_0x1f3d6f:undefined;})[_0x3076('0x6d')]()[_0x3076('0x5f')]();if(!_[_0x3076('0x6e')](_0x56655f)){_0x56655f[_0x3076('0x25')](function(_0xec41f){if(_0xec41f===_0x3076('0x6f')){_0x163fc2[_0x3076('0x3f')](_0x3076('0x70'),[][_0x3076('0x71')](_0x45ac78['query'][_0xec41f]));}else if(_0xec41f===_0x3076('0x72')){var _0x2c482d=JSON[_0x3076('0x73')](_0x45ac78[_0x3076('0x39')][_0xec41f])['$gte'];var _0x55b00e=JSON[_0x3076('0x73')](_0x45ac78[_0x3076('0x39')][_0xec41f])[_0x3076('0x74')];_0x163fc2['where'](_0x3076('0x75'),_0x2c482d,_0x55b00e);}else{if(_0x45ac78[_0x3076('0x39')][_0xec41f]===_0x3076('0x76')){_0x163fc2[_0x3076('0x3f')]('i.'+_0xec41f+_0x3076('0x77'));}else{_0x163fc2[_0x3076('0x3f')]('i.'+_0xec41f+_0x3076('0x78'),_0x45ac78[_0x3076('0x39')][_0xec41f]);}}});}if(_0x45ac78[_0x3076('0x39')][_0x3076('0x79')]){if(_0x45ac78['query'][_0x3076('0x79')]==0x1){_0x163fc2[_0x3076('0x59')]('`unreadMessages`\x20=\x200');}else{_0x163fc2[_0x3076('0x59')](_0x3076('0x7a'));}}if(_0x45ac78['query'][_0x3076('0x7b')]){_0x496a8b=_[_0x3076('0x7c')](_0x45ac78[_0x3076('0x39')][_0x3076('0x7b')])?_0x45ac78[_0x3076('0x39')]['tag']:new Array(_0x45ac78[_0x3076('0x39')]['tag']);_0x496a8b[_0x3076('0x25')](function(_0x21ca79){_0x490d3a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x21ca79+',%');});}if(_0x45ac78[_0x3076('0x39')][_0x3076('0x7d')]){var _0x4ed798=_0x45ac78[_0x3076('0x39')]['filter'][_0x3076('0x7e')]('\x5c','\x5c\x5c')[_0x3076('0x7e')](/'/g,'\x27\x27');if(qs[_0x3076('0x7f')](_0x4ed798)){_0x4674f7['or'](_0x3076('0x80'),_0x4ed798+'%');}else if(qs[_0x3076('0x81')](_0x4ed798)){_0x4674f7['or'](_0x3076('0x82'),_0x4ed798+'%');}else{_0x4674f7['or'](_0x3076('0x83'),qs[_0x3076('0x61')](_0x4ed798))['or'](_0x3076('0x84'),qs[_0x3076('0x61')](_0x4ed798));}}}_0x163fc2[_0x3076('0x3f')](_0x4674f7);_0x163fc2['group'](_0x3076('0x85'));var _0xd89565={'type':db[_0x3076('0x86')][_0x3076('0x87')][_0x3076('0x88')],'raw':!![]};var _0x26f476=_0x163fc2[_0x3076('0x89')]();_0x26f476['field'](_0x3076('0x85'));_0x26f476[_0x3076('0x41')](_0x3076('0x8a'),_0x3076('0x58'));if(_0x191544['order']){_0x191544[_0x3076('0x8b')]['forEach'](function(_0x2d13e4){var _0x1c6964=_0x2d13e4[0x0]===_0x3076('0x8c')?_0x2d13e4[0x0]:'i.'+_0x2d13e4[0x0];_0x163fc2[_0x3076('0x8b')](_0x1c6964,_0x2d13e4[0x1]===_0x3076('0x8d')?![]:!![]);});}if(!_[_0x3076('0x6e')](_0x496a8b)){_0x163fc2[_0x3076('0x59')](_0x490d3a);_0x26f476[_0x3076('0x3f')](_0x3076('0x8e'),_0x496a8b);}BPromise[_0x3076('0x8f')]()[_0x3076('0x1c')](function(){if(!_0x11fc1f){if(_0x45ac78[_0x3076('0x39')][_0x3076('0x6f')])return;_0x26f476['where'](_0x3076('0x90'));_0x163fc2[_0x3076('0x3f')](_0x3076('0x90'));return;}if(_0x45ac78[_0x3076('0x91')]['role']!==_0x3076('0x92'))return;return _0x45ac78[_0x3076('0x91')][_0x3076('0x93')]({'attributes':['id'],'raw':!![]})[_0x3076('0x1c')](function(_0x329526){if(_[_0x3076('0x6e')](_0x329526)){_0x26f476[_0x3076('0x3f')]('i.MailAccountId\x20IS\x20NULL');_0x163fc2[_0x3076('0x3f')]('i.MailAccountId\x20IS\x20NULL');}else{_0x26f476[_0x3076('0x3f')]('i.MailAccountId\x20IN\x20?',_[_0x3076('0x21')](_0x329526,'id'));_0x163fc2[_0x3076('0x3f')](_0x3076('0x70'),_[_0x3076('0x21')](_0x329526,'id'));}});})[_0x3076('0x1c')](function(){if(_0x45ac78['user'][_0x3076('0x94')]===_0x3076('0x92')&&!_0x11fc1f&&!_0x45ac78['query'][_0x3076('0x6f')])return[];return db[_0x3076('0x95')][_0x3076('0x39')](_0x26f476[_0x3076('0x96')](),_0xd89565);})[_0x3076('0x1c')](function(_0x21a124){_0x454e04[_0x3076('0x19')]=_0x21a124[_0x3076('0x56')];if(_0x454e04['count']===0x0)return[];return db[_0x3076('0x95')][_0x3076('0x39')](_0x7405d6[_0x3076('0x96')](),_0xd89565)[_0x3076('0x1c')](function(_0x2d0126){_0x23307c=_[_0x3076('0x97')](_0x2d0126,'id');_0xd89565=_[_0x3076('0x98')](_0xd89565,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x45ac78['query']['fields']){_0x191544[_0x3076('0x3c')][_0x3076('0x25')](function(_0x5c5abc){_0x163fc2[_0x3076('0x41')]('i.'+_0x5c5abc);});}else{_0x163fc2[_0x3076('0x41')](_0x3076('0x8a'),_0x3076('0x58'));_0x163fc2[_0x3076('0x41')](_0x3076('0x99'),_0x3076('0x9a'));_0x163fc2[_0x3076('0x41')](_0x3076('0x9b'),_0x3076('0x9c'));_0x163fc2[_0x3076('0x41')](_0x3076('0x9d'),'contactName');_0x163fc2[_0x3076('0x41')](_0x3076('0x85'));_0x163fc2[_0x3076('0x41')](_0x3076('0x9e'));_0x163fc2['field'](_0x3076('0x9f'));_0x163fc2[_0x3076('0x41')](_0x3076('0xa0'));_0x163fc2['field']('i.closedAt');_0x163fc2['field'](_0x3076('0xa1'));_0x163fc2[_0x3076('0x41')]('i.lastMsgAt');_0x163fc2['field'](_0x3076('0xa2'));_0x163fc2[_0x3076('0x41')](_0x3076('0xa3'));_0x163fc2[_0x3076('0x41')](_0x3076('0xa4'));_0x163fc2[_0x3076('0x41')](_0x3076('0xa5'));_0x163fc2[_0x3076('0x41')](_0x3076('0xa6'));_0x163fc2[_0x3076('0x41')](_0x3076('0xa7'));_0x163fc2[_0x3076('0x41')](_0x3076('0xa8'));_0x163fc2['field'](_0x3076('0xa9'));_0x163fc2[_0x3076('0x41')]('i.MailAccountId');_0x163fc2['field'](_0x3076('0xaa'));_0x163fc2['field']('c.firstName',_0x3076('0xab'));_0x163fc2[_0x3076('0x41')](_0x3076('0xac'),_0x3076('0xad'));_0x163fc2[_0x3076('0x41')]('c.email','Contact.email');_0x163fc2[_0x3076('0x41')](_0x3076('0xae'),'Contact.phone');_0x163fc2[_0x3076('0x41')](_0x3076('0xaf'),'Contact.mobile');_0x163fc2['field'](_0x3076('0xb0'),_0x3076('0xb1'));_0x163fc2[_0x3076('0x41')]('o.fullname',_0x3076('0xb2'));_0x163fc2[_0x3076('0x41')](_0x3076('0xb3'),'Owner.internal');_0x163fc2[_0x3076('0x41')](_0x3076('0xb4'),_0x3076('0x23'));}if(_0x191544[_0x3076('0x17')])_0x163fc2[_0x3076('0x17')](_0x191544[_0x3076('0x17')]);if(_0x191544[_0x3076('0x18')])_0x163fc2[_0x3076('0x18')](_0x191544[_0x3076('0x18')]);return db[_0x3076('0x95')][_0x3076('0x39')](_0x163fc2[_0x3076('0x96')](),_0xd89565);})['then'](function(_0x4e44c8){if(_0x4e44c8[_0x3076('0x56')]>0x0)_0x4e91dc['where'](_0x3076('0xb5'),_['map'](_0x4e44c8,'id'));return db['sequelize']['query'](_0x4e91dc[_0x3076('0x96')](),_0xd89565)[_0x3076('0x1c')](function(_0x4a6950){var _0x3c0523=_[_0x3076('0xb6')](_0x4a6950,_0x3076('0xb7'));var _0x5da3d3=[];return db[_0x3076('0xb8')]['findOne']({'attributes':[_0x3076('0xb9')],'raw':!![]})['then'](function(_0x364bc6){var _0x188fb1=_0x364bc6['enableEmailPreview'];_0x4e44c8[_0x3076('0x25')](function(_0x622857){_0x5da3d3[_0x3076('0xba')](updateMailInteraction(_0x622857,_0x23307c,_0x3c0523,_0x188fb1));});return BPromise[_0x3076('0xbb')](_0x5da3d3);});});});})[_0x3076('0x1c')](function(_0x954982){_0x454e04['rows']=_0x954982;return _0x454e04;})[_0x3076('0x1c')](respondWithFilteredResult(_0x47d04a,_0x191544))['catch'](handleError(_0x47d04a,null));};exports[_0x3076('0xbc')]=function(_0x15944e,_0x54a5be){var _0x3074d2={'raw':![],'where':{'id':_0x15944e[_0x3076('0xbd')]['id']}},_0x1dfa13={};_0x1dfa13[_0x3076('0x38')]=_['keys'](db[_0x3076('0x34')][_0x3076('0x35')]);_0x1dfa13['query']=_[_0x3076('0x6b')](_0x15944e['query']);_0x1dfa13[_0x3076('0x3a')]=_[_0x3076('0x3b')](_0x1dfa13[_0x3076('0x38')],_0x1dfa13[_0x3076('0x39')]);_0x3074d2[_0x3076('0x3c')]=_[_0x3076('0x3b')](_0x1dfa13[_0x3076('0x38')],qs[_0x3076('0x3d')](_0x15944e[_0x3076('0x39')][_0x3076('0x3d')]));_0x3074d2[_0x3076('0x3c')]=_0x3074d2[_0x3076('0x3c')]['length']?_0x3074d2[_0x3076('0x3c')]:_0x1dfa13[_0x3076('0x38')];if(_0x15944e['query'][_0x3076('0xbe')]){_0x3074d2[_0x3076('0xbf')]=[{'all':!![]}];}_0x3074d2=_[_0x3076('0x98')]({},_0x3074d2,_0x15944e[_0x3076('0xc0')]);return db[_0x3076('0x34')]['find'](_0x3074d2)['then'](handleEntityNotFound(_0x54a5be,null))[_0x3076('0x1c')](respondWithResult(_0x54a5be,null))['catch'](handleError(_0x54a5be,null));};exports[_0x3076('0xc1')]=function(_0x530fa0,_0x2ebb13){return db[_0x3076('0x34')][_0x3076('0xc1')](_0x530fa0['body'],{})[_0x3076('0x1c')](respondWithResult(_0x2ebb13,0xc9))['catch'](handleError(_0x2ebb13,null));};exports['update']=function(_0x40bda4,_0x4a17dc){if(_0x40bda4[_0x3076('0xc2')]['id']){delete _0x40bda4[_0x3076('0xc2')]['id'];}return db[_0x3076('0x34')]['find']({'where':{'id':_0x40bda4[_0x3076('0xbd')]['id']}})[_0x3076('0x1c')](handleEntityNotFound(_0x4a17dc,null))['then'](saveUpdates(_0x40bda4[_0x3076('0xc2')],null))['then'](respondWithResult(_0x4a17dc,null))[_0x3076('0x2b')](handleError(_0x4a17dc,null));};exports[_0x3076('0xc3')]=function(_0x1ae2ed,_0x1586f5){return db[_0x3076('0x34')][_0x3076('0x57')]({'where':{'id':_0x1ae2ed['params']['id']}})[_0x3076('0x1c')](handleEntityNotFound(_0x1586f5,null))[_0x3076('0x1c')](removeEntity(_0x1586f5,null))['catch'](handleError(_0x1586f5,null));};exports[_0x3076('0xc4')]=function(_0x1f10d5,_0x48c87d){return db[_0x3076('0x34')][_0x3076('0xc4')]()['then'](respondWithResult(_0x48c87d,null))[_0x3076('0x2b')](handleError(_0x48c87d,null));};exports[_0x3076('0xc5')]=function(_0xd5ae7b,_0x4a5167){return db[_0x3076('0xc6')][_0x3076('0x57')]({'where':{'id':_0xd5ae7b['params']['id']}})[_0x3076('0x1c')](handleEntityNotFound(_0x4a5167,null))[_0x3076('0x1c')](function(_0x39dbb4){if(_0x39dbb4){return _0x39dbb4['addMessage'](_0xd5ae7b[_0x3076('0xc2')][_0x3076('0xc7')],_[_0x3076('0xc8')](_0xd5ae7b[_0x3076('0xc2')],[_0x3076('0xc7'),'id'])||{});}})[_0x3076('0x1c')](respondWithResult(_0x4a5167,null))['catch'](handleError(_0x4a5167,null));};exports[_0x3076('0xc9')]=function(_0x4d9ea4,_0x2e5e46){var _0x306154={'raw':![],'where':{}};var _0x410084={};var _0x51f7ba={'count':0x0,'rows':[]};return db['MailInteraction'][_0x3076('0x26')]({'where':{'id':_0x4d9ea4['params']['id']}})[_0x3076('0x1c')](handleEntityNotFound(_0x2e5e46,null))[_0x3076('0x1c')](function(_0x2ee283){if(_0x2ee283){_0x410084[_0x3076('0x38')]=_[_0x3076('0x6b')](db['MailMessage'][_0x3076('0x35')]);_0x410084[_0x3076('0x39')]=_[_0x3076('0x6b')](_0x4d9ea4[_0x3076('0x39')]);_0x410084['filters']=_[_0x3076('0x3b')](_0x410084['model'],_0x410084[_0x3076('0x39')]);_0x306154[_0x3076('0x3c')]=_[_0x3076('0x3b')](_0x410084[_0x3076('0x38')],qs['fields'](_0x4d9ea4[_0x3076('0x39')]['fields']));_0x306154['attributes']=_0x306154['attributes'][_0x3076('0x56')]?_0x306154[_0x3076('0x3c')]:_0x410084[_0x3076('0x38')];if(!_0x4d9ea4[_0x3076('0x39')][_0x3076('0x3e')](_0x3076('0xca'))){_0x306154[_0x3076('0x17')]=qs[_0x3076('0x17')](_0x4d9ea4['query'][_0x3076('0x17')]);_0x306154['offset']=qs[_0x3076('0x18')](_0x4d9ea4['query'][_0x3076('0x18')]);}_0x306154['order']=qs['sort'](_0x4d9ea4['query'][_0x3076('0xcb')]);_0x306154[_0x3076('0x3f')]=qs[_0x3076('0x3a')](_[_0x3076('0xcc')](_0x4d9ea4['query'],_0x410084[_0x3076('0x3a')]));_0x306154[_0x3076('0x3f')][_0x3076('0xb7')]=_0x2ee283['id'];if(_0x4d9ea4[_0x3076('0x39')][_0x3076('0x7d')]){_0x306154[_0x3076('0x3f')]=_[_0x3076('0x98')](_0x306154[_0x3076('0x3f')],{'$or':_[_0x3076('0x21')](_0x306154['attributes'],function(_0x4fd74e){var _0x16b691={};_0x16b691[_0x4fd74e]={'$like':'%'+_0x4d9ea4[_0x3076('0x39')][_0x3076('0x7d')]+'%'};return _0x16b691;})});}if(_0x4d9ea4[_0x3076('0x39')][_0x3076('0xcd')]){var _0x33f5ad=_0x4d9ea4['query'][_0x3076('0xcd')][_0x3076('0x60')](',');var _0x20e950={};_0x20e950[_0x33f5ad[0x0]]={'$gte':moment(_0x33f5ad[0x1])[_0x3076('0xce')]('YYYY-MM-DD\x20HH:mm:ss')};_0x306154[_0x3076('0x3f')]=_[_0x3076('0x98')](_0x306154['where'],_0x20e950);}_0x306154=_[_0x3076('0x98')]({},_0x306154,_0x4d9ea4['options']);return db[_0x3076('0xc6')][_0x3076('0x19')]({'where':_0x306154[_0x3076('0x3f')]})[_0x3076('0x1c')](function(_0x35af1e){_0x51f7ba[_0x3076('0x19')]=_0x35af1e;if(_0x4d9ea4['query']['includeAll']){_0x306154['include']=[{'all':!![]}];}return db[_0x3076('0xc6')][_0x3076('0xcf')](_0x306154);})['then'](function(_0x1fd976){if(_0x4d9ea4[_0x3076('0x39')][_0x3076('0xd0')]==='true'){for(var _0x1dd343=0x0;_0x1dd343<_0x1fd976[_0x3076('0x56')];_0x1dd343++){_0x1fd976[_0x1dd343][_0x3076('0xc2')]=juice(_0x1fd976[_0x1dd343][_0x3076('0xc2')]);}}_0x51f7ba[_0x3076('0xd1')]=_0x1fd976;return _0x51f7ba;});}})[_0x3076('0x1c')](respondWithFilteredResult(_0x2e5e46,_0x306154))[_0x3076('0x2b')](handleError(_0x2e5e46,null));};exports['addTags']=function(_0x5d522e,_0x40f16e){return db[_0x3076('0x34')][_0x3076('0x57')]({'where':{'id':_0x5d522e['params']['id']}})[_0x3076('0x1c')](handleEntityNotFound(_0x40f16e,null))[_0x3076('0x1c')](function(_0x1d4206){if(_0x1d4206){return _0x1d4206[_0x3076('0xd2')](_0x5d522e[_0x3076('0xc2')][_0x3076('0xc7')],_[_0x3076('0xc8')](_0x5d522e[_0x3076('0xc2')],[_0x3076('0xc7'),'id'])||{})['spread'](function(){return db[_0x3076('0x67')][_0x3076('0xcf')]({'attributes':['id',_0x3076('0x20'),_0x3076('0x42')],'where':{'id':_0x5d522e[_0x3076('0xc2')][_0x3076('0xc7')]}});})[_0x3076('0x1c')](function(_0x749f30){socket[_0x3076('0xd3')](_0x3076('0xd4'),{'id':Number(_0x5d522e[_0x3076('0xbd')]['id']),'tags':_0x749f30||[]});return{'id':Number(_0x5d522e[_0x3076('0xbd')]['id']),'tags':_0x749f30||[]};});}})[_0x3076('0x1c')](respondWithResult(_0x40f16e,null))['catch'](handleError(_0x40f16e,null));};exports['removeTags']=function(_0x44cafa,_0x4e8f23){return db[_0x3076('0x34')]['find']({'where':{'id':_0x44cafa['params']['id']}})['then'](handleEntityNotFound(_0x4e8f23,null))[_0x3076('0x1c')](function(_0x100270){if(_0x100270){return _0x100270[_0x3076('0xd5')](_0x44cafa[_0x3076('0x39')][_0x3076('0xc7')]);}})[_0x3076('0x1c')](respondWithStatusCode(_0x4e8f23,null))[_0x3076('0x2b')](handleError(_0x4e8f23,null));};exports[_0x3076('0xd6')]=function(_0x36da1d,_0x387b6b){var _0x299b1e=moment()[_0x3076('0xd7')]()[_0x3076('0x96')]();var _0x4eafec=path[_0x3076('0xd8')](config[_0x3076('0xd9')],_0x3076('0xda'),_0x3076('0xdb'),'tmp');var _0x415a56=path[_0x3076('0xd8')](config[_0x3076('0xd9')],_0x3076('0xda'),_0x3076('0xdb'),_0x3076('0xdc'));var _0x167f16=path['join'](_0x4eafec,_0x299b1e);var _0x57e821=util[_0x3076('0xce')](_0x3076('0xdd'),_0x36da1d[_0x3076('0xbd')]['id'],_0x299b1e);var _0x2085ee=path[_0x3076('0xd8')](_0x4eafec,_0x57e821);var _0x2be087=[];if(_0x36da1d[_0x3076('0x39')][_0x3076('0xdc')]){_0x2be087[_0x3076('0xba')]({'model':db[_0x3076('0xde')],'as':_0x3076('0xdf'),'raw':!![]});}var _0x2ecffa=[{'model':db[_0x3076('0xc6')],'as':_0x3076('0xe0'),'attributes':['id','body','from','to','cc','bcc',_0x3076('0xe1'),_0x3076('0x72')],'where':{'secret':![]},'order':qs[_0x3076('0xcb')]('id'),'include':_0x2be087}];return db[_0x3076('0x34')][_0x3076('0x57')]({'where':{'id':_0x36da1d['params']['id']},'include':_0x2ecffa})['then'](handleEntityNotFound(_0x387b6b,null))['then'](function(_0x39e004){if(_0x39e004&&_0x39e004[_0x3076('0xe0')]){var _0x164733=_0x39e004['get']({'plain':!![]});fs[_0x3076('0xe2')](_0x167f16);return BPromise['each'](_0x164733['Messages'],function(_0xd2989a,_0x491015){var _0xec4c87={'from':_0xd2989a[_0x3076('0x43')],'to':_0xd2989a['to'],'subject':_0xd2989a[_0x3076('0xe1')],'html':htmlEntities[_0x3076('0xe3')](_0xd2989a[_0x3076('0xc2')]),'headers':{'Date':moment(_0xd2989a[_0x3076('0x72')])[_0x3076('0xce')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0xd2989a['cc']){_0xec4c87[_0x3076('0xe4')]['Cc']=_0xd2989a['cc'];}if(_0xd2989a['bcc']){_0xec4c87['headers'][_0x3076('0xe5')]=_0xd2989a[_0x3076('0xe6')];}return new BPromise(function(_0x15a2de,_0xbe0441){if(_0xd2989a[_0x3076('0xdf')]){for(var _0x180a6a=0x0;_0x180a6a<_0xd2989a['Attachments'][_0x3076('0x56')];_0x180a6a++){var _0x4041bd=_0xd2989a[_0x3076('0xdf')][_0x180a6a];var _0x321221=path['join'](_0x415a56,_0x4041bd[_0x3076('0xe7')]);if(fs['existsSync'](_0x321221)){_0xec4c87['attachments'][_0x3076('0xba')]({'name':_0x4041bd[_0x3076('0x20')],'contentType':_0x4041bd['type'],'data':fs[_0x3076('0xe8')](_0x321221)});}}}emlformat[_0x3076('0xe9')](_0xec4c87,function(_0x34690f,_0x17af58){if(_0x34690f)return _0xbe0441(_0x34690f);fs['writeFileSync'](path[_0x3076('0xd8')](_0x167f16,util[_0x3076('0xce')](_0x3076('0xea'),_0x491015)),_0x17af58);return _0x15a2de(_0x17af58);});});})[_0x3076('0x1c')](function(){return new BPromise(function(_0x450138,_0xd3a346){zipdir(_0x167f16,{'saveTo':_0x2085ee},function(_0x4812ab,_0x2d0d40){if(_0x4812ab)return _0xd3a346(_0x4812ab);return _0x450138(_0x2d0d40);});})['then'](function(){return new BPromise(function(_0x224f66,_0x4a8c4d){rimraf(_0x167f16,function(_0x4b7dae){if(_0x4b7dae)_0x4a8c4d(_0x4b7dae);return _0x224f66();});});})[_0x3076('0x1c')](function(){return _0x387b6b[_0x3076('0xd6')](_0x2085ee,_0x57e821,function(_0x4f1222){if(!_0x4f1222)fs[_0x3076('0xeb')](_0x2085ee);});});});}else{return _0x387b6b['sendStatus'](0xc8);}})[_0x3076('0x2b')](handleError(_0x387b6b,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 3492013..9005baa 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 _0xf553=['save','update','remove','then','setDataValue','Users','findAll','unreadMessages','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners'];(function(_0x1302cf,_0x388178){var _0x39729a=function(_0x39af6a){while(--_0x39af6a){_0x1302cf['push'](_0x1302cf['shift']());}};_0x39729a(++_0x388178);}(_0xf553,0x67));var _0x3f55=function(_0x4d2263,_0x3fbf0d){_0x4d2263=_0x4d2263-0x0;var _0x24aba0=_0xf553[_0x4d2263];return _0x24aba0;};'use strict';var EventEmitter=require(_0x3f55('0x0'));var MailInteraction=require(_0x3f55('0x1'))['db'][_0x3f55('0x2')];var MailMessage=require(_0x3f55('0x1'))['db'][_0x3f55('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x3f55('0x4')](0x0);var events={'afterCreate':_0x3f55('0x5'),'afterUpdate':_0x3f55('0x6'),'afterDestroy':_0x3f55('0x7')};function emitEvent(_0x36dd84){return function(_0x23b73f,_0x5b3e96,_0x41f442){_0x23b73f['getUsers']({'attributes':['id'],'raw':!![]})[_0x3f55('0x8')](function(_0x131e38){_0x23b73f[_0x3f55('0x9')](_0x3f55('0xa'),_0x131e38['map'](function(_0x472dba){return{'id':_0x472dba['id']};}));return MailMessage[_0x3f55('0xb')]({'where':{'MailInteractionId':_0x23b73f['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3f55('0x8')](function(_0x25d824){_0x23b73f[_0x3f55('0x9')](_0x3f55('0xc'),_0x25d824[_0x3f55('0xd')]);MailInteractionEvents[_0x3f55('0xe')](_0x36dd84+':'+_0x23b73f['id'],_0x23b73f);MailInteractionEvents[_0x3f55('0xe')](_0x36dd84,_0x23b73f);_0x41f442(null);})['catch'](_0x41f442(null));};}for(var e in events){if(events[_0x3f55('0xf')](e)){var event=events[e];MailInteraction[_0x3f55('0x10')](e,emitEvent(event));}}module[_0x3f55('0x11')]=MailInteractionEvents; \ No newline at end of file +var _0x5a90=['then','setDataValue','Users','map','findAll','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','MailInteraction','save','update','getUsers'];(function(_0x5d0f66,_0x47ea5c){var _0x3fa211=function(_0xc06245){while(--_0xc06245){_0x5d0f66['push'](_0x5d0f66['shift']());}};_0x3fa211(++_0x47ea5c);}(_0x5a90,0x8a));var _0x05a9=function(_0x5359fc,_0x1d6e42){_0x5359fc=_0x5359fc-0x0;var _0x5a7c72=_0x5a90[_0x5359fc];return _0x5a7c72;};'use strict';var EventEmitter=require(_0x05a9('0x0'));var MailInteraction=require(_0x05a9('0x1'))['db'][_0x05a9('0x2')];var MailMessage=require(_0x05a9('0x1'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x05a9('0x3'),'afterUpdate':_0x05a9('0x4'),'afterDestroy':'remove'};function emitEvent(_0x12735b){return function(_0x1896bc,_0x2969fc,_0x224963){_0x1896bc[_0x05a9('0x5')]({'attributes':['id'],'raw':!![]})[_0x05a9('0x6')](function(_0x3bbe51){_0x1896bc[_0x05a9('0x7')](_0x05a9('0x8'),_0x3bbe51[_0x05a9('0x9')](function(_0xce18f4){return{'id':_0xce18f4['id']};}));return MailMessage[_0x05a9('0xa')]({'where':{'MailInteractionId':_0x1896bc['id'],'direction':'in','read':![]},'raw':!![]});})[_0x05a9('0x6')](function(_0x551ba0){_0x1896bc[_0x05a9('0x7')]('unreadMessages',_0x551ba0[_0x05a9('0xb')]);MailInteractionEvents['emit'](_0x12735b+':'+_0x1896bc['id'],_0x1896bc);MailInteractionEvents[_0x05a9('0xc')](_0x12735b,_0x1896bc);_0x224963(null);})[_0x05a9('0xd')](_0x224963(null));};}for(var e in events){if(events[_0x05a9('0xe')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0x05a9('0xf')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 8e3b350..705ab6c 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 _0xe07d=['rimraf','./mailInteraction.attributes','define','MailInteraction','mail_interactions','fti_mail_interactions','substatus','YYYY-MM-DD\x20HH:mm:ss','closed','format','changed','closedAt','substatusAt','get','MailMessage','update','then','catch','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','request-promise','path'];(function(_0x13b7fd,_0x4eaf7f){var _0x32a74a=function(_0x2c5d80){while(--_0x2c5d80){_0x13b7fd['push'](_0x13b7fd['shift']());}};_0x32a74a(++_0x4eaf7f);}(_0xe07d,0x159));var _0xde07=function(_0x233cb1,_0x8ca9a2){_0x233cb1=_0x233cb1-0x0;var _0x29ee7e=_0xe07d[_0x233cb1];return _0x29ee7e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xde07('0x0'))(_0xde07('0x1'));var moment=require(_0xde07('0x2'));var BPromise=require('bluebird');var rp=require(_0xde07('0x3'));var fs=require('fs');var path=require(_0xde07('0x4'));var rimraf=require(_0xde07('0x5'));var config=require('../../config/environment');var attributes=require(_0xde07('0x6'));module['exports']=function(_0x92af60,_0x2402a1){return _0x92af60[_0xde07('0x7')](_0xde07('0x8'),attributes,{'tableName':_0xde07('0x9'),'paranoid':![],'indexes':[{'name':_0xde07('0xa'),'fields':['subject','to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4e8dee,_0x3f38ce,_0x45a2d2){if(_0x4e8dee[_0xde07('0xb')]){_0x4e8dee['substatusAt']=moment()['format'](_0xde07('0xc'));}if(_0x4e8dee[_0xde07('0xd')]){_0x4e8dee['closedAt']=moment()[_0xde07('0xe')](_0xde07('0xc'));}_0x45a2d2(null,_0x3f38ce);},'beforeUpdate':function(_0x16ecd6,_0x259efe,_0x13fef6){if(_0x16ecd6[_0xde07('0xf')](_0xde07('0xb'))){_0x16ecd6['substatusAt']=_0x16ecd6['substatus']?moment()['format'](_0xde07('0xc')):null;}if(_0x16ecd6[_0xde07('0xf')](_0xde07('0xd'))){_0x16ecd6[_0xde07('0x10')]=moment()[_0xde07('0xe')](_0xde07('0xc'));_0x16ecd6[_0xde07('0xb')]=null;_0x16ecd6[_0xde07('0x11')]=null;}_0x13fef6(null,_0x16ecd6);},'afterUpdate':function(_0x1b1ac9,_0x53b8a0,_0x4ef7fe){var _0x25e7bf=_0x92af60['models'];var _0x359491=_0x1b1ac9[_0xde07('0x12')]({'plain':!![]});if(_0x359491['closed']){return _0x25e7bf[_0xde07('0x13')][_0xde07('0x14')]({'read':!![]},{'where':{'MailInteractionId':_0x359491['id']}})[_0xde07('0x15')](function(){_0x4ef7fe();})[_0xde07('0x16')](function(_0x4afa13){_0x4ef7fe(_0x4afa13);});}else{_0x4ef7fe();}}},'charset':_0xde07('0x17'),'collate':_0xde07('0x18')});}; \ No newline at end of file +var _0xe6f3=['subject','FULLTEXT','substatus','substatusAt','format','closedAt','YYYY-MM-DD\x20HH:mm:ss','changed','closed','models','get','MailMessage','update','catch','utf8mb4','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','exports','define','fti_mail_interactions'];(function(_0x2a7b50,_0x545d55){var _0x4224c9=function(_0x2b96f6){while(--_0x2b96f6){_0x2a7b50['push'](_0x2a7b50['shift']());}};_0x4224c9(++_0x545d55);}(_0xe6f3,0x195));var _0x3e6f=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xe6f3[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x3e6f('0x0'));var util=require(_0x3e6f('0x1'));var logger=require(_0x3e6f('0x2'))(_0x3e6f('0x3'));var moment=require(_0x3e6f('0x4'));var BPromise=require('bluebird');var rp=require(_0x3e6f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3e6f('0x6'));var config=require(_0x3e6f('0x7'));var attributes=require('./mailInteraction.attributes');module[_0x3e6f('0x8')]=function(_0x1dc033,_0xf46ac0){return _0x1dc033[_0x3e6f('0x9')]('MailInteraction',attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0x3e6f('0xa'),'fields':[_0x3e6f('0xb'),'to'],'type':_0x3e6f('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2ed2c5,_0x155a9b,_0x215349){if(_0x2ed2c5[_0x3e6f('0xd')]){_0x2ed2c5[_0x3e6f('0xe')]=moment()[_0x3e6f('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x2ed2c5['closed']){_0x2ed2c5[_0x3e6f('0x10')]=moment()['format'](_0x3e6f('0x11'));}_0x215349(null,_0x155a9b);},'beforeUpdate':function(_0x44687b,_0x2ee39b,_0x169c09){if(_0x44687b[_0x3e6f('0x12')](_0x3e6f('0xd'))){_0x44687b[_0x3e6f('0xe')]=_0x44687b[_0x3e6f('0xd')]?moment()['format'](_0x3e6f('0x11')):null;}if(_0x44687b[_0x3e6f('0x12')](_0x3e6f('0x13'))){_0x44687b[_0x3e6f('0x10')]=moment()[_0x3e6f('0xf')]('YYYY-MM-DD\x20HH:mm:ss');_0x44687b[_0x3e6f('0xd')]=null;_0x44687b[_0x3e6f('0xe')]=null;}_0x169c09(null,_0x44687b);},'afterUpdate':function(_0x4ad1d0,_0x97f07a,_0xd863c7){var _0x4f238c=_0x1dc033[_0x3e6f('0x14')];var _0x19451a=_0x4ad1d0[_0x3e6f('0x15')]({'plain':!![]});if(_0x19451a['closed']){return _0x4f238c[_0x3e6f('0x16')][_0x3e6f('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x19451a['id']}})['then'](function(){_0xd863c7();})[_0x3e6f('0x18')](function(_0x2b7a03){_0xd863c7(_0x2b7a03);});}else{_0xd863c7();}}},'charset':_0x3e6f('0x19'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 356b293..9aad4dc 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 _0x90c5=['../../config/environment','client','redis','defaults','localhost','socket.io-emitter','register','then','info','MailInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','UpdateMailInteraction','MailInteraction','update','body','options','where','attributes','catch','AddTagsToMailInteraction','find','addTags','omit','ids','spread','AddTags','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2fdee1,_0x466858){var _0x2c5533=function(_0x1f34de){while(--_0x1f34de){_0x2fdee1['push'](_0x2fdee1['shift']());}};_0x2c5533(++_0x466858);}(_0x90c5,0x17e));var _0x590c=function(_0x2f79e9,_0x4d7fe3){_0x2f79e9=_0x2f79e9-0x0;var _0x567a9d=_0x90c5[_0x2f79e9];return _0x567a9d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x590c('0x0'));var BPromise=require(_0x590c('0x1'));var rs=require(_0x590c('0x2'));var fs=require('fs');var Redis=require(_0x590c('0x3'));var db=require(_0x590c('0x4'))['db'];var utils=require(_0x590c('0x5'));var logger=require(_0x590c('0x6'))(_0x590c('0x7'));var config=require(_0x590c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x590c('0x9')]['http']({'port':0x232a});config[_0x590c('0xa')]=_[_0x590c('0xb')](config['redis'],{'host':_0x590c('0xc'),'port':0x18eb});var socket=require(_0x590c('0xd'))(new Redis(config['redis']));require('./mailInteraction.socket')[_0x590c('0xe')](socket);function respondWithRpcPromise(_0x4fdfe7,_0x1a6e96,_0x567b59){return new BPromise(function(_0x508014,_0x41d2de){return client['request'](_0x4fdfe7,_0x567b59)[_0x590c('0xf')](function(_0x271bbf){logger[_0x590c('0x10')](_0x590c('0x11'),_0x1a6e96,'request\x20sent');logger[_0x590c('0x12')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x1a6e96,_0x590c('0x13'),JSON[_0x590c('0x14')](_0x271bbf));if(_0x271bbf[_0x590c('0x15')]){if(_0x271bbf[_0x590c('0x15')]['code']===0x1f4){logger['error']('MailInteraction,\x20%s,\x20%s',_0x1a6e96,_0x271bbf[_0x590c('0x15')]['message']);return _0x41d2de(_0x271bbf[_0x590c('0x15')][_0x590c('0x16')]);}logger[_0x590c('0x15')](_0x590c('0x11'),_0x1a6e96,_0x271bbf[_0x590c('0x15')][_0x590c('0x16')]);return _0x508014(_0x271bbf['error'][_0x590c('0x16')]);}else{logger['info'](_0x590c('0x11'),_0x1a6e96,_0x590c('0x13'));_0x508014(_0x271bbf[_0x590c('0x17')]['message']);}})['catch'](function(_0x4f028d){logger['error'](_0x590c('0x11'),_0x1a6e96,_0x4f028d);_0x41d2de(_0x4f028d);});});}exports[_0x590c('0x18')]=function(_0x537709){var _0x111c81=this;return new Promise(function(_0x12b79b,_0x7d91d){return db[_0x590c('0x19')][_0x590c('0x1a')](_0x537709[_0x590c('0x1b')],{'raw':_0x537709[_0x590c('0x1c')]?_0x537709['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x537709[_0x590c('0x1c')]?_0x537709[_0x590c('0x1c')][_0x590c('0x1d')]||null:null,'attributes':_0x537709[_0x590c('0x1c')]?_0x537709[_0x590c('0x1c')][_0x590c('0x1e')]||null:null,'limit':_0x537709[_0x590c('0x1c')]?_0x537709['options']['limit']||null:null})[_0x590c('0xf')](function(_0x416752){logger['info'](_0x590c('0x18'),_0x537709);logger['debug'](_0x590c('0x18'),_0x537709,JSON[_0x590c('0x14')](_0x416752));_0x12b79b(_0x416752);})[_0x590c('0x1f')](function(_0x16056d){logger['error'](_0x590c('0x18'),_0x16056d[_0x590c('0x16')],_0x537709);_0x7d91d(_0x111c81[_0x590c('0x15')](0x1f4,_0x16056d[_0x590c('0x16')]));});});};exports[_0x590c('0x20')]=function(_0x3bbe65){return new Promise(function(_0xd23eac,_0x3acf45){return db['MailInteraction'][_0x590c('0x21')]({'where':_0x3bbe65['options']?_0x3bbe65[_0x590c('0x1c')]['where']||null:null})[_0x590c('0xf')](function(_0x281cef){if(_0x281cef){return _0x281cef[_0x590c('0x22')](_0x3bbe65[_0x590c('0x1b')]['ids'],_[_0x590c('0x23')](_0x3bbe65[_0x590c('0x1b')],[_0x590c('0x24'),'id'])||{});}})[_0x590c('0x25')](function(_0x3716a7){logger[_0x590c('0x10')](_0x590c('0x26'),_0x3bbe65);logger['debug'](_0x590c('0x26'),_0x3bbe65,JSON[_0x590c('0x14')](_0x3716a7));_0xd23eac(_0x3716a7);})[_0x590c('0x1f')](function(_0x3290ef){logger[_0x590c('0x15')](_0x590c('0x26'),_0x3290ef['message'],_0x3bbe65);_0x3acf45(_this[_0x590c('0x15')](0x1f4,_0x3290ef['message']));});});}; \ No newline at end of file +var _0xf03a=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','request','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','UpdateMailInteraction','MailInteraction','update','body','options','raw','where','limit','then','stringify','catch','AddTagsToMailInteraction','find','addTags','omit','spread','AddTags','util','moment','bluebird','randomstring'];(function(_0x44c205,_0x5c1e59){var _0x1ccfca=function(_0x393afd){while(--_0x393afd){_0x44c205['push'](_0x44c205['shift']());}};_0x1ccfca(++_0x5c1e59);}(_0xf03a,0x1a0));var _0xaf03=function(_0x46c76e,_0x18ab31){_0x46c76e=_0x46c76e-0x0;var _0xbc01db=_0xf03a[_0x46c76e];return _0xbc01db;};'use strict';var _=require('lodash');var util=require(_0xaf03('0x0'));var moment=require(_0xaf03('0x1'));var BPromise=require(_0xaf03('0x2'));var rs=require(_0xaf03('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaf03('0x4'))['db'];var utils=require(_0xaf03('0x5'));var logger=require('../../config/logger')(_0xaf03('0x6'));var config=require(_0xaf03('0x7'));var jayson=require(_0xaf03('0x8'));var client=jayson[_0xaf03('0x9')]['http']({'port':0x232a});config[_0xaf03('0xa')]=_['defaults'](config[_0xaf03('0xa')],{'host':_0xaf03('0xb'),'port':0x18eb});var socket=require(_0xaf03('0xc'))(new Redis(config[_0xaf03('0xa')]));require(_0xaf03('0xd'))[_0xaf03('0xe')](socket);function respondWithRpcPromise(_0x52d7fe,_0x1f3a5c,_0x12e1a1){return new BPromise(function(_0x4766d1,_0x33803e){return client[_0xaf03('0xf')](_0x52d7fe,_0x12e1a1)['then'](function(_0x1bc5a0){logger[_0xaf03('0x10')](_0xaf03('0x11'),_0x1f3a5c,_0xaf03('0x12'));logger[_0xaf03('0x13')](_0xaf03('0x14'),_0x1f3a5c,_0xaf03('0x12'),JSON['stringify'](_0x1bc5a0));if(_0x1bc5a0['error']){if(_0x1bc5a0[_0xaf03('0x15')][_0xaf03('0x16')]===0x1f4){logger[_0xaf03('0x15')]('MailInteraction,\x20%s,\x20%s',_0x1f3a5c,_0x1bc5a0['error'][_0xaf03('0x17')]);return _0x33803e(_0x1bc5a0[_0xaf03('0x15')][_0xaf03('0x17')]);}logger[_0xaf03('0x15')](_0xaf03('0x11'),_0x1f3a5c,_0x1bc5a0[_0xaf03('0x15')]['message']);return _0x4766d1(_0x1bc5a0[_0xaf03('0x15')][_0xaf03('0x17')]);}else{logger[_0xaf03('0x10')](_0xaf03('0x11'),_0x1f3a5c,_0xaf03('0x12'));_0x4766d1(_0x1bc5a0[_0xaf03('0x18')]['message']);}})['catch'](function(_0x1e3508){logger[_0xaf03('0x15')](_0xaf03('0x11'),_0x1f3a5c,_0x1e3508);_0x33803e(_0x1e3508);});});}exports[_0xaf03('0x19')]=function(_0xfc2e57){var _0x59cf7c=this;return new Promise(function(_0x43a4a4,_0x55eca3){return db[_0xaf03('0x1a')][_0xaf03('0x1b')](_0xfc2e57[_0xaf03('0x1c')],{'raw':_0xfc2e57[_0xaf03('0x1d')]?_0xfc2e57[_0xaf03('0x1d')][_0xaf03('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xfc2e57[_0xaf03('0x1d')]?_0xfc2e57[_0xaf03('0x1d')][_0xaf03('0x1f')]||null:null,'attributes':_0xfc2e57[_0xaf03('0x1d')]?_0xfc2e57[_0xaf03('0x1d')]['attributes']||null:null,'limit':_0xfc2e57[_0xaf03('0x1d')]?_0xfc2e57[_0xaf03('0x1d')][_0xaf03('0x20')]||null:null})[_0xaf03('0x21')](function(_0x4ef6cc){logger['info'](_0xaf03('0x19'),_0xfc2e57);logger[_0xaf03('0x13')]('UpdateMailInteraction',_0xfc2e57,JSON[_0xaf03('0x22')](_0x4ef6cc));_0x43a4a4(_0x4ef6cc);})[_0xaf03('0x23')](function(_0x247b05){logger[_0xaf03('0x15')](_0xaf03('0x19'),_0x247b05[_0xaf03('0x17')],_0xfc2e57);_0x55eca3(_0x59cf7c['error'](0x1f4,_0x247b05['message']));});});};exports[_0xaf03('0x24')]=function(_0x385aa9){return new Promise(function(_0xe104c2,_0x166a23){return db[_0xaf03('0x1a')][_0xaf03('0x25')]({'where':_0x385aa9[_0xaf03('0x1d')]?_0x385aa9[_0xaf03('0x1d')][_0xaf03('0x1f')]||null:null})[_0xaf03('0x21')](function(_0x18ad0c){if(_0x18ad0c){return _0x18ad0c[_0xaf03('0x26')](_0x385aa9[_0xaf03('0x1c')]['ids'],_[_0xaf03('0x27')](_0x385aa9[_0xaf03('0x1c')],['ids','id'])||{});}})[_0xaf03('0x28')](function(_0x480a3b){logger[_0xaf03('0x10')](_0xaf03('0x29'),_0x385aa9);logger[_0xaf03('0x13')](_0xaf03('0x29'),_0x385aa9,JSON[_0xaf03('0x22')](_0x480a3b));_0xe104c2(_0x480a3b);})[_0xaf03('0x23')](function(_0x5a6e1e){logger[_0xaf03('0x15')]('AddTags',_0x5a6e1e[_0xaf03('0x17')],_0x385aa9);_0x166a23(_this[_0xaf03('0x15')](0x1f4,_0x5a6e1e[_0xaf03('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index bd58d73..da64565 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 _0x9536=['emit','removeListener','length','mailInteraction:','./mailInteraction.events','save','remove'];(function(_0x50e757,_0x2c2a81){var _0x456f7a=function(_0x3ac690){while(--_0x3ac690){_0x50e757['push'](_0x50e757['shift']());}};_0x456f7a(++_0x2c2a81);}(_0x9536,0x74));var _0x6953=function(_0x5a187b,_0x1f64fe){_0x5a187b=_0x5a187b-0x0;var _0x14d601=_0x9536[_0x5a187b];return _0x14d601;};'use strict';var MailInteractionEvents=require(_0x6953('0x0'));var events=[_0x6953('0x1'),_0x6953('0x2'),'update'];function createListener(_0x5a3222,_0x2823a7){return function(_0x44c831){_0x2823a7[_0x6953('0x3')](_0x5a3222,_0x44c831);};}function removeListener(_0x429846,_0x1d0783){return function(){MailInteractionEvents[_0x6953('0x4')](_0x429846,_0x1d0783);};}exports['register']=function(_0xe8c25f){for(var _0x1434b1=0x0,_0x5da22b=events[_0x6953('0x5')];_0x1434b1<_0x5da22b;_0x1434b1++){var _0x3661c3=events[_0x1434b1];var _0x970cca=createListener(_0x6953('0x6')+_0x3661c3,_0xe8c25f);MailInteractionEvents['on'](_0x3661c3,_0x970cca);}}; \ No newline at end of file +var _0x2787=['./mailInteraction.events','update','emit','removeListener','register','length','mailInteraction:'];(function(_0x3e38bf,_0x115129){var _0x97e9f4=function(_0x2df143){while(--_0x2df143){_0x3e38bf['push'](_0x3e38bf['shift']());}};_0x97e9f4(++_0x115129);}(_0x2787,0x70));var _0x7278=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x2787[_0x13d07a];return _0x5ee0ee;};'use strict';var MailInteractionEvents=require(_0x7278('0x0'));var events=['save','remove',_0x7278('0x1')];function createListener(_0x46af76,_0x1ffe43){return function(_0x1ae9ae){_0x1ffe43[_0x7278('0x2')](_0x46af76,_0x1ae9ae);};}function removeListener(_0x562376,_0x4e0f49){return function(){MailInteractionEvents[_0x7278('0x3')](_0x562376,_0x4e0f49);};}exports[_0x7278('0x4')]=function(_0x50c857){for(var _0x16a6ed=0x0,_0x129ca0=events[_0x7278('0x5')];_0x16a6ed<_0x129ca0;_0x16a6ed++){var _0xa8a788=events[_0x16a6ed];var _0x2a67b4=createListener(_0x7278('0x6')+_0xa8a788,_0x50c857);MailInteractionEvents['on'](_0xa8a788,_0x2a67b4);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index ced303f..ec9eeb8 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 _0x4899=['put','/:id','/:id/accept','accept','/:id/reject','reject','destroy','exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','isAuthenticated','index','get','/describe','show','/:id/download','download','post','tracked','mail','mailmessage:create'];(function(_0x609988,_0x507944){var _0x159984=function(_0x39d9ce){while(--_0x39d9ce){_0x609988['push'](_0x609988['shift']());}};_0x159984(++_0x507944);}(_0x4899,0x74));var _0x9489=function(_0x546161,_0x122642){_0x546161=_0x546161-0x0;var _0x1fcad3=_0x4899[_0x546161];return _0x1fcad3;};'use strict';var multer=require(_0x9489('0x0'));var util=require('util');var path=require(_0x9489('0x1'));var timeout=require('connect-timeout');var express=require(_0x9489('0x2'));var router=express['Router']();var fs_extra=require(_0x9489('0x3'));var auth=require(_0x9489('0x4'));var interaction=require(_0x9489('0x5'));var config=require(_0x9489('0x6'));var controller=require(_0x9489('0x7'));router['get']('/',auth[_0x9489('0x8')](),controller[_0x9489('0x9')]);router[_0x9489('0xa')](_0x9489('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x9489('0xa')]('/:id',auth[_0x9489('0x8')](),controller[_0x9489('0xc')]);router['get'](_0x9489('0xd'),auth[_0x9489('0x8')](),controller[_0x9489('0xe')]);router[_0x9489('0xf')]('/',auth[_0x9489('0x8')](),interaction[_0x9489('0x10')](_0x9489('0x11'),_0x9489('0x12')),controller['create']);router[_0x9489('0x13')](_0x9489('0x14'),auth[_0x9489('0x8')](),controller['update']);router['put'](_0x9489('0x15'),auth[_0x9489('0x8')](),controller[_0x9489('0x16')]);router['put'](_0x9489('0x17'),auth['isAuthenticated'](),controller[_0x9489('0x18')]);router['delete'](_0x9489('0x14'),auth[_0x9489('0x8')](),controller[_0x9489('0x19')]);module[_0x9489('0x1a')]=router; \ No newline at end of file +var _0xbdeb=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','show','/:id/download','download','post','tracked','mail','put','/:id/accept','accept','/:id/reject','delete','/:id','exports','util','connect-timeout','Router','fs-extra'];(function(_0x30509c,_0x2de0c8){var _0x183c58=function(_0x5ea17f){while(--_0x5ea17f){_0x30509c['push'](_0x30509c['shift']());}};_0x183c58(++_0x2de0c8);}(_0xbdeb,0x6f));var _0xbbde=function(_0x48e1ec,_0x35f468){_0x48e1ec=_0x48e1ec-0x0;var _0x3b33eb=_0xbdeb[_0x48e1ec];return _0x3b33eb;};'use strict';var multer=require('multer');var util=require(_0xbbde('0x0'));var path=require('path');var timeout=require(_0xbbde('0x1'));var express=require('express');var router=express[_0xbbde('0x2')]();var fs_extra=require(_0xbbde('0x3'));var auth=require(_0xbbde('0x4'));var interaction=require(_0xbbde('0x5'));var config=require('../../config/environment');var controller=require('./mailMessage.controller');router[_0xbbde('0x6')]('/',auth[_0xbbde('0x7')](),controller[_0xbbde('0x8')]);router[_0xbbde('0x6')]('/describe',auth['isAuthenticated'](),controller[_0xbbde('0x9')]);router[_0xbbde('0x6')]('/:id',auth[_0xbbde('0x7')](),controller[_0xbbde('0xa')]);router[_0xbbde('0x6')](_0xbbde('0xb'),auth[_0xbbde('0x7')](),controller[_0xbbde('0xc')]);router[_0xbbde('0xd')]('/',auth[_0xbbde('0x7')](),interaction[_0xbbde('0xe')](_0xbbde('0xf'),'mailmessage:create'),controller['create']);router[_0xbbde('0x10')]('/:id',auth[_0xbbde('0x7')](),controller['update']);router[_0xbbde('0x10')](_0xbbde('0x11'),auth[_0xbbde('0x7')](),controller[_0xbbde('0x12')]);router[_0xbbde('0x10')](_0xbbde('0x13'),auth[_0xbbde('0x7')](),controller['reject']);router[_0xbbde('0x14')](_0xbbde('0x15'),auth['isAuthenticated'](),controller['destroy']);module[_0xbbde('0x16')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index e22cf61..f56419b 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 _0xca81=['INTEGER','DATE','Email','Chat','sequelize','lodash','TEXT','long','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x36f364,_0x52948d){var _0x5e707e=function(_0xf17993){while(--_0xf17993){_0x36f364['push'](_0x36f364['shift']());}};_0x5e707e(++_0x52948d);}(_0xca81,0x163));var _0x1ca8=function(_0x1be57f,_0x127cc5){_0x1be57f=_0x1be57f-0x0;var _0x4a9b3d=_0xca81[_0x1be57f];return _0x4a9b3d;};'use strict';var Sequelize=require(_0x1ca8('0x0'));var _=require(_0x1ca8('0x1'));module['exports']={'body':{'type':Sequelize[_0x1ca8('0x2')](_0x1ca8('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x1ca8('0x2')](_0x1ca8('0x4'))},'read':{'type':Sequelize[_0x1ca8('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1ca8('0x6')]('in',_0x1ca8('0x7')),'defaultValue':_0x1ca8('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0x1ca8('0x8')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x1ca8('0x2')](_0x1ca8('0x3'))},'cc':{'type':Sequelize['TEXT'](_0x1ca8('0x3'))},'bcc':{'type':Sequelize[_0x1ca8('0x2')](_0x1ca8('0x3'))},'subject':{'type':Sequelize[_0x1ca8('0x2')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0x1ca8('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x1ca8('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x1ca8('0xa')]},'originTo':{'type':Sequelize[_0x1ca8('0x2')](_0x1ca8('0x3'))},'originCc':{'type':Sequelize[_0x1ca8('0x2')](_0x1ca8('0x3'))},'originChannel':{'type':Sequelize[_0x1ca8('0x6')](_0x1ca8('0xb'),_0x1ca8('0xc')),'defaultValue':_0x1ca8('0xb'),'allowNull':![]}}; \ No newline at end of file +var _0x4282=['sequelize','lodash','exports','TEXT','BOOLEAN','ENUM','out','STRING','long','DATE','INTEGER','Email','Chat'];(function(_0xf466f3,_0x2cb84d){var _0x52615e=function(_0x56cde6){while(--_0x56cde6){_0xf466f3['push'](_0xf466f3['shift']());}};_0x52615e(++_0x2cb84d);}(_0x4282,0x11e));var _0x2428=function(_0x24bfd6,_0x40e032){_0x24bfd6=_0x24bfd6-0x0;var _0x4f46c1=_0x4282[_0x24bfd6];return _0x4f46c1;};'use strict';var Sequelize=require(_0x2428('0x0'));var _=require(_0x2428('0x1'));module[_0x2428('0x2')]={'body':{'type':Sequelize['TEXT']('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0x2428('0x3')]('medium')},'read':{'type':Sequelize[_0x2428('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2428('0x5')]('in',_0x2428('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x2428('0x7')]},'to':{'type':Sequelize[_0x2428('0x3')](_0x2428('0x8'))},'cc':{'type':Sequelize[_0x2428('0x3')](_0x2428('0x8'))},'bcc':{'type':Sequelize[_0x2428('0x3')](_0x2428('0x8'))},'subject':{'type':Sequelize[_0x2428('0x3')]},'sentAt':{'type':Sequelize[_0x2428('0x9')]},'attach':{'type':Sequelize[_0x2428('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x2428('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0x2428('0x3')]('long')},'originCc':{'type':Sequelize[_0x2428('0x3')]('long')},'originChannel':{'type':Sequelize[_0x2428('0x5')](_0x2428('0xb'),_0x2428('0xc')),'defaultValue':'Email','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index a3a1d57..a727ba0 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 _0x225f=['html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','socket.io-emitter','redis','html-entities','./mailMessage.socket','register','jayson/promise','http','client','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','status','json','offset','limit','undefined','count','set','update','then','destroy','sendStatus','name','send','index','map','MailMessage','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','show','params','include','find','body','describe','create','secret','split','findOne','MailAccountId','CmList','List','CmContact','DESC','MailServerOut','Smtp','getSmtpOptions','attachments','root','basename','defaults','ListId','List\x20not\x20found','SendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','readAt','UserId','user','get','MailInteraction','MailInteractionId','isNil','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SELECT','User','agent','fullname','email','internal','manual','channel','event','fromString','EventManager','acceptmessage','interaction','RejectMessage','rejectMessage','sequelize','Sequelize','contact','interface','SIP/%s','motionChannel','reject','rejectmessage','download','unix','toString','files','join','server','message-%s.eml','from','subject','Attachment','Attachments','decode','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','existsSync','readFileSync','writeFileSync','unlinkSync','eml-format','moment','bluebird','path','ioredis'];(function(_0x421196,_0x1cbd94){var _0x2738af=function(_0xc956ff){while(--_0xc956ff){_0x421196['push'](_0x421196['shift']());}};_0x2738af(++_0x1cbd94);}(_0x225f,0x98));var _0xf225=function(_0x1d1e4b,_0x432b71){_0x1d1e4b=_0x1d1e4b-0x0;var _0x5e9f0f=_0x225f[_0x1d1e4b];return _0x5e9f0f;};'use strict';var emlformat=require(_0xf225('0x0'));var moment=require(_0xf225('0x1'));var BPromise=require(_0xf225('0x2'));var util=require('util');var path=require(_0xf225('0x3'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xf225('0x4'));var htmlToText=require(_0xf225('0x5'));var qs=require(_0xf225('0x6'));var logger=require(_0xf225('0x7'))(_0xf225('0x8'));var interaction_log=require(_0xf225('0x7'))(_0xf225('0x9'));var config=require(_0xf225('0xa'));var db=require(_0xf225('0xb'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf225('0xc'))(new Redis(config[_0xf225('0xd')]));var htmlEntities=require(_0xf225('0xe'));require(_0xf225('0xf'))[_0xf225('0x10')](socket);var jayson=require(_0xf225('0x11'));var client=jayson['client'][_0xf225('0x12')]({'port':0x232c});var client9003=jayson[_0xf225('0x13')][_0xf225('0x12')]({'port':0x232b});var client9002=jayson[_0xf225('0x13')][_0xf225('0x12')]({'port':0x232a});function respondWithRpcPromise(_0x41b038,_0x434a52,_0x3f7b73,_0x59384f){return new BPromise(function(_0x45ab52,_0x5f0e14){var _0x46f074=_0x59384f||client;return _0x46f074[_0xf225('0x14')](_0x41b038,_0x3f7b73)['then'](function(_0x4aae81){logger[_0xf225('0x15')](_0xf225('0x16'),_0x434a52,_0xf225('0x17'));logger[_0xf225('0x18')](_0xf225('0x19'),_0x434a52,_0xf225('0x17'),JSON[_0xf225('0x1a')](_0x4aae81));if(_0x4aae81[_0xf225('0x1b')]){if(_0x4aae81[_0xf225('0x1b')]['code']===0x1f4){logger[_0xf225('0x1b')]('MailMessage,\x20%s,\x20%s',_0x434a52,_0x4aae81[_0xf225('0x1b')]['message']);return _0x5f0e14(_0x4aae81['error'][_0xf225('0x1c')]);}logger[_0xf225('0x1b')](_0xf225('0x16'),_0x434a52,_0x4aae81[_0xf225('0x1b')]['message']);return _0x45ab52(_0x4aae81[_0xf225('0x1b')][_0xf225('0x1c')]);}else{logger[_0xf225('0x15')](_0xf225('0x16'),_0x434a52,_0xf225('0x17'));_0x45ab52(_0x4aae81['result']['message']);}})[_0xf225('0x1d')](function(_0x27a4e1){logger[_0xf225('0x1b')](_0xf225('0x16'),_0x434a52,_0x27a4e1);_0x5f0e14(_0x27a4e1);});});}function respondWithResult(_0x12b5e2,_0x18c7b8){_0x18c7b8=_0x18c7b8||0xc8;return function(_0x28863f){if(_0x28863f){return _0x12b5e2[_0xf225('0x1e')](_0x18c7b8)[_0xf225('0x1f')](_0x28863f);}};}function respondWithFilteredResult(_0x42ae0a,_0x326660){return function(_0x44ebbd){if(_0x44ebbd){var _0x57b49c=typeof _0x326660[_0xf225('0x20')]==='undefined'&&typeof _0x326660[_0xf225('0x21')]===_0xf225('0x22');var _0x3bc649=_0x44ebbd[_0xf225('0x23')];var _0xa83553=_0x57b49c?0x0:_0x326660['offset'];var _0x4762e3=_0x57b49c?_0x44ebbd[_0xf225('0x23')]:_0x326660[_0xf225('0x20')]+_0x326660[_0xf225('0x21')];var _0x2dee79;if(_0x4762e3>=_0x3bc649){_0x4762e3=_0x3bc649;_0x2dee79=0xc8;}else{_0x2dee79=0xce;}_0x42ae0a[_0xf225('0x1e')](_0x2dee79);return _0x42ae0a[_0xf225('0x24')]('Content-Range',_0xa83553+'-'+_0x4762e3+'/'+_0x3bc649)['json'](_0x44ebbd);}return null;};}function saveUpdates(_0x47fba4){return function(_0x1039bb){if(_0x1039bb){return _0x1039bb[_0xf225('0x25')](_0x47fba4)[_0xf225('0x26')](function(_0x3e628b){return _0x3e628b;});}return null;};}function removeEntity(_0x30ddd7){return function(_0x3471ce){if(_0x3471ce){return _0x3471ce[_0xf225('0x27')]()[_0xf225('0x26')](function(){_0x30ddd7[_0xf225('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a45cf){return function(_0x5ce6d7){if(!_0x5ce6d7){_0x1a45cf[_0xf225('0x28')](0x194);}return _0x5ce6d7;};}function handleError(_0x15823f,_0x4f47e2){_0x4f47e2=_0x4f47e2||0x1f4;return function(_0xbee8a6){logger['error'](_0xbee8a6['stack']);if(_0xbee8a6[_0xf225('0x29')]){delete _0xbee8a6[_0xf225('0x29')];}_0x15823f['status'](_0x4f47e2)[_0xf225('0x2a')](_0xbee8a6);};}exports[_0xf225('0x2b')]=function(_0x2b8f3f,_0x1d36cf){var _0x16bf54={},_0x356f84={},_0x50da3b={'count':0x0,'rows':[]};var _0x4d136b=_[_0xf225('0x2c')](db[_0xf225('0x2d')][_0xf225('0x2e')],function(_0x68431d){return{'name':_0x68431d[_0xf225('0x2f')],'type':_0x68431d[_0xf225('0x30')][_0xf225('0x31')]};});_0x356f84['model']=_['map'](_0x4d136b,_0xf225('0x29'));_0x356f84[_0xf225('0x32')]=_[_0xf225('0x33')](_0x2b8f3f[_0xf225('0x32')]);_0x356f84[_0xf225('0x34')]=_[_0xf225('0x35')](_0x356f84[_0xf225('0x36')],_0x356f84[_0xf225('0x32')]);_0x16bf54[_0xf225('0x37')]=_[_0xf225('0x35')](_0x356f84[_0xf225('0x36')],qs['fields'](_0x2b8f3f[_0xf225('0x32')][_0xf225('0x38')]));_0x16bf54[_0xf225('0x37')]=_0x16bf54[_0xf225('0x37')][_0xf225('0x39')]?_0x16bf54[_0xf225('0x37')]:_0x356f84['model'];if(!_0x2b8f3f[_0xf225('0x32')][_0xf225('0x3a')](_0xf225('0x3b'))){_0x16bf54[_0xf225('0x21')]=qs[_0xf225('0x21')](_0x2b8f3f[_0xf225('0x32')]['limit']);_0x16bf54[_0xf225('0x20')]=qs[_0xf225('0x20')](_0x2b8f3f['query']['offset']);}_0x16bf54[_0xf225('0x3c')]=qs[_0xf225('0x3d')](_0x2b8f3f[_0xf225('0x32')]['sort']);_0x16bf54[_0xf225('0x3e')]=qs[_0xf225('0x34')](_[_0xf225('0x3f')](_0x2b8f3f[_0xf225('0x32')],_0x356f84[_0xf225('0x34')]),_0x4d136b);if(_0x2b8f3f[_0xf225('0x32')][_0xf225('0x40')]){_0x16bf54[_0xf225('0x3e')]=_[_0xf225('0x41')](_0x16bf54[_0xf225('0x3e')],{'$or':_[_0xf225('0x2c')](_0x4d136b,function(_0x5b6150){if(_0x5b6150[_0xf225('0x30')]!==_0xf225('0x42')){var _0x410099={};_0x410099[_0x5b6150[_0xf225('0x29')]]={'$like':'%'+_0x2b8f3f['query'][_0xf225('0x40')]+'%'};return _0x410099;}})});}_0x16bf54=_[_0xf225('0x41')]({},_0x16bf54,_0x2b8f3f[_0xf225('0x43')]);var _0x57a789={'where':_0x16bf54[_0xf225('0x3e')]};return db['MailMessage'][_0xf225('0x23')](_0x57a789)[_0xf225('0x26')](function(_0x36c866){_0x50da3b[_0xf225('0x23')]=_0x36c866;if(_0x2b8f3f[_0xf225('0x32')][_0xf225('0x44')]){_0x16bf54['include']=[{'all':!![]}];}return db[_0xf225('0x2d')]['findAll'](_0x16bf54);})[_0xf225('0x26')](function(_0x1640dd){_0x50da3b[_0xf225('0x45')]=_0x1640dd;return _0x50da3b;})[_0xf225('0x26')](respondWithFilteredResult(_0x1d36cf,_0x16bf54))['catch'](handleError(_0x1d36cf,null));};exports[_0xf225('0x46')]=function(_0x5a94b1,_0x8256fa){var _0x5c162e={'raw':!![],'where':{'id':_0x5a94b1[_0xf225('0x47')]['id']}},_0x412169={};_0x412169[_0xf225('0x36')]=_[_0xf225('0x33')](db[_0xf225('0x2d')][_0xf225('0x2e')]);_0x412169[_0xf225('0x32')]=_[_0xf225('0x33')](_0x5a94b1[_0xf225('0x32')]);_0x412169[_0xf225('0x34')]=_[_0xf225('0x35')](_0x412169[_0xf225('0x36')],_0x412169['query']);_0x5c162e[_0xf225('0x37')]=_['intersection'](_0x412169[_0xf225('0x36')],qs['fields'](_0x5a94b1[_0xf225('0x32')][_0xf225('0x38')]));_0x5c162e[_0xf225('0x37')]=_0x5c162e[_0xf225('0x37')][_0xf225('0x39')]?_0x5c162e['attributes']:_0x412169['model'];if(_0x5a94b1[_0xf225('0x32')][_0xf225('0x44')]){_0x5c162e[_0xf225('0x48')]=[{'all':!![]}];}_0x5c162e=_[_0xf225('0x41')]({},_0x5c162e,_0x5a94b1[_0xf225('0x43')]);return db['MailMessage'][_0xf225('0x49')](_0x5c162e)['then'](handleEntityNotFound(_0x8256fa,null))[_0xf225('0x26')](respondWithResult(_0x8256fa,null))[_0xf225('0x1d')](handleError(_0x8256fa,null));};exports[_0xf225('0x25')]=function(_0xf110e1,_0x1347a4){if(_0xf110e1[_0xf225('0x4a')]['id']){delete _0xf110e1[_0xf225('0x4a')]['id'];}return db[_0xf225('0x2d')][_0xf225('0x49')]({'where':{'id':_0xf110e1[_0xf225('0x47')]['id']}})['then'](handleEntityNotFound(_0x1347a4,null))[_0xf225('0x26')](saveUpdates(_0xf110e1['body'],null))[_0xf225('0x26')](respondWithResult(_0x1347a4,null))[_0xf225('0x1d')](handleError(_0x1347a4,null));};exports[_0xf225('0x27')]=function(_0x49fceb,_0x30b25a){return db[_0xf225('0x2d')]['find']({'where':{'id':_0x49fceb[_0xf225('0x47')]['id']}})[_0xf225('0x26')](handleEntityNotFound(_0x30b25a,null))[_0xf225('0x26')](removeEntity(_0x30b25a,null))[_0xf225('0x1d')](handleError(_0x30b25a,null));};exports[_0xf225('0x4b')]=function(_0x4bfb2a,_0x50a697){return db['MailMessage'][_0xf225('0x4b')]()['then'](respondWithResult(_0x50a697,null))[_0xf225('0x1d')](handleError(_0x50a697,null));};exports[_0xf225('0x4c')]=function(_0x574c00,_0x1691b5){return db[_0xf225('0x2d')]['create'](_0x574c00[_0xf225('0x4a')])[_0xf225('0x26')](function(_0x475b89){if(_0x475b89){if(_0x475b89['direction']==='out'&&!_0x475b89[_0xf225('0x4d')]){var _0xb9271a,_0xfa6710,_0x368058;if(_0x574c00[_0xf225('0x4a')]['to']){_0xfa6710=_0x574c00['body']['to'][_0xf225('0x4e')](',')[0x0];}return db['MailAccount'][_0xf225('0x4f')]({'where':{'id':_0x475b89[_0xf225('0x50')]},'include':[{'model':db[_0xf225('0x51')],'as':_0xf225('0x52'),'include':[{'model':db[_0xf225('0x53')],'as':'Contacts','where':{'email':_0xfa6710},'limit':0x1,'order':[['updatedAt',_0xf225('0x54')]]}]},{'model':db[_0xf225('0x55')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]})[_0xf225('0x26')](function(_0x4f6004){_0xb9271a=_0x4f6004;if(!_0xb9271a||!_0xb9271a[_0xf225('0x56')])return;var _0x5b6425=_0xb9271a[_0xf225('0x57')]();if(_0x574c00[_0xf225('0x4a')]['attachments']&&_0x574c00[_0xf225('0x4a')][_0xf225('0x58')][_0xf225('0x39')]){for(var _0x1a1e31=0x0;_0x1a1e31<_0x574c00[_0xf225('0x4a')]['attachments'][_0xf225('0x39')];_0x1a1e31+=0x1){_0x574c00['body'][_0xf225('0x58')][_0x1a1e31]={'filename':_0x574c00[_0xf225('0x4a')][_0xf225('0x58')][_0x1a1e31][_0xf225('0x29')],'path':path['join'](config[_0xf225('0x59')],'server/files/attachments',_0x574c00[_0xf225('0x4a')][_0xf225('0x58')][_0x1a1e31][_0xf225('0x5a')])};}}_0x368058={'account':_0x5b6425,'message':_0x574c00[_0xf225('0x4a')]};return;})[_0xf225('0x26')](function(){if(_0xb9271a[_0xf225('0x52')]){if(_0xb9271a[_0xf225('0x52')]['Contacts'][_0xf225('0x39')]){return _0xb9271a[_0xf225('0x52')]['Contacts'][0x0];}else{return db[_0xf225('0x53')][_0xf225('0x4c')](_[_0xf225('0x5b')](_0x574c00[_0xf225('0x4a')],{'firstName':_0x574c00[_0xf225('0x4a')]['to'],'email':_0x574c00[_0xf225('0x4a')]['to'],'phone':_0x574c00['body']['to'],'ListId':_0xb9271a[_0xf225('0x5c')]}));}}else{throw new Error(_0xf225('0x5d'));}})[_0xf225('0x26')](function(){if(_0x368058){return respondWithRpcPromise(_0xf225('0x5e'),'sendMail',_0x368058,client9003)[_0xf225('0x26')](function(_0x552c76){return _0x475b89[_0xf225('0x25')]({'read':!![],'messageId':_0x552c76[_0xf225('0x5f')],'sentAt':moment()[_0xf225('0x60')](_0xf225('0x61'))});})[_0xf225('0x1d')](function(_0x29f27e){logger[_0xf225('0x1b')]('%s',JSON[_0xf225('0x1a')](_0x29f27e));return _0x475b89;});}return _0x475b89;});}return _0x475b89;}})[_0xf225('0x26')](respondWithResult(_0x1691b5,0xc9))['catch'](handleError(_0x1691b5,null));};exports[_0xf225('0x62')]=function(_0x70fff1,_0xd6aedc){var _0x434a57={'agent':{},'channel':'mail'};if(_0x70fff1[_0xf225('0x4a')]['id']){delete _0x70fff1[_0xf225('0x4a')]['id'];}_0x70fff1[_0xf225('0x4a')]['read']=!![];_0x70fff1['body'][_0xf225('0x63')]=moment()['format'](_0xf225('0x61'));_0x70fff1['body'][_0xf225('0x64')]=_0x70fff1[_0xf225('0x4a')][_0xf225('0x64')]||_0x70fff1[_0xf225('0x65')]['id'];_0x434a57['agent']['id']=_0x70fff1[_0xf225('0x4a')][_0xf225('0x64')];return db[_0xf225('0x2d')][_0xf225('0x49')]({'where':{'id':_0x70fff1[_0xf225('0x47')]['id'],'UserId':null}})[_0xf225('0x26')](handleEntityNotFound(_0xd6aedc,null))[_0xf225('0x26')](saveUpdates(_0x70fff1[_0xf225('0x4a')],null))[_0xf225('0x26')](function(_0x44ddc2){if(_0x44ddc2){_0x434a57[_0xf225('0x1c')]=_0x44ddc2[_0xf225('0x66')]({'plain':!![]});return db[_0xf225('0x67')][_0xf225('0x49')]({'where':{'id':_0x44ddc2[_0xf225('0x68')]}});}return null;})[_0xf225('0x26')](handleEntityNotFound(_0xd6aedc,null))[_0xf225('0x26')](function(_0x2f3a0c){if(_0x2f3a0c){return _0x2f3a0c['update']({'UserId':_0x70fff1[_0xf225('0x4a')][_0xf225('0x64')],'read1stAt':_[_0xf225('0x69')](_0x2f3a0c['read1stAt'])?moment()[_0xf225('0x60')](_0xf225('0x61')):undefined});}return null;})[_0xf225('0x26')](function(_0x49b8de){if(_0x49b8de){_0x434a57['interaction']=_0x49b8de[_0xf225('0x66')]({'plain':!![]});interaction_log[_0xf225('0x15')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x70fff1[_0xf225('0x65')]['id'],_0x70fff1[_0xf225('0x65')]['name'],_0x70fff1[_0xf225('0x65')][_0xf225('0x6a')],_0x434a57['interaction']['id'],_0x70fff1['body']?JSON[_0xf225('0x1a')](_0x70fff1[_0xf225('0x4a')]):_0xf225('0x6b'));return respondWithRpcPromise(_0xf225('0x6c'),_0xf225('0x6d'),_0x434a57);}return null;})[_0xf225('0x26')](function(_0x3cdbb8){var _0x1bd4d5=_0xf225('0x6e')+_0x3cdbb8[_0xf225('0x1c')][_0xf225('0x6f')];return db['sequelize'][_0xf225('0x32')](_0x1bd4d5,{'type':db['Sequelize'][_0xf225('0x70')][_0xf225('0x71')],'raw':!![]})['then'](function(_0x1d90c7){return _0x1d90c7;});})['then'](function(_0xf7fa6c){if(_0xf7fa6c){_0x434a57[_0xf225('0x1c')]['contact']=_0xf7fa6c[0x0];if(!_0x70fff1['body'][_0xf225('0x64')])return;return db[_0xf225('0x72')][_0xf225('0x49')]({'where':{'id':_0x70fff1['body'][_0xf225('0x64')],'role':_0xf225('0x73')},'attributes':['id','name',_0xf225('0x74'),_0xf225('0x75'),_0xf225('0x76')],'raw':!![]});}return null;})['then'](function(_0x4ecea6){if(!_0x4ecea6)return null;_0x434a57[_0xf225('0x1c')][_0xf225('0x73')]=_0x4ecea6;return _0x434a57;})[_0xf225('0x26')](function(_0x5dacdb){if(_0x5dacdb){if(_0x70fff1['body'][_0xf225('0x77')]){_0x434a57[_0xf225('0x1c')]['interface']=util[_0xf225('0x60')]('SIP/%s',_0x70fff1[_0xf225('0x65')]['name']);_0x434a57['message'][_0xf225('0x78')]=_0x434a57[_0xf225('0x78')];_0x434a57[_0xf225('0x1c')]['motionChannel']=_0x434a57['channel'];_0x434a57[_0xf225('0x1c')][_0xf225('0x79')]=_0xf225('0x62');_0x434a57[_0xf225('0x1c')]['body']=htmlToText[_0xf225('0x7a')](_0x434a57[_0xf225('0x1c')][_0xf225('0x4a')]);return respondWithRpcPromise(_0xf225('0x7b'),_0xf225('0x7b'),{'event':_0xf225('0x7c'),'message':_0x434a57['message']},client9002)[_0xf225('0x26')](function(){return _0x434a57;});}return _0x434a57;}return null;})[_0xf225('0x26')](respondWithResult(_0xd6aedc,null))['catch'](handleError(_0xd6aedc,null));};exports['reject']=function(_0x535b19,_0x57e536){var _0x329fce={'agent':{},'channel':'mail'};if(_0x535b19[_0xf225('0x4a')]['id']){delete _0x535b19[_0xf225('0x4a')]['id'];}_0x535b19[_0xf225('0x4a')]['UserId']=_0x535b19[_0xf225('0x4a')]['UserId']||_0x535b19[_0xf225('0x65')]['id'];_0x329fce[_0xf225('0x73')]['id']=_0x535b19[_0xf225('0x4a')][_0xf225('0x64')];return db[_0xf225('0x2d')][_0xf225('0x49')]({'where':{'id':_0x535b19[_0xf225('0x47')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x57e536,null))[_0xf225('0x26')](function(_0x2129bb){if(_0x2129bb){_0x329fce[_0xf225('0x1c')]=_0x2129bb[_0xf225('0x66')]({'plain':!![]});return db[_0xf225('0x67')][_0xf225('0x49')]({'where':{'id':_0x2129bb[_0xf225('0x68')]}});}return null;})[_0xf225('0x26')](handleEntityNotFound(_0x57e536,null))['then'](function(_0x1c2ac9){if(_0x1c2ac9){_0x329fce[_0xf225('0x7d')]=_0x1c2ac9[_0xf225('0x66')]({'plain':!![]});interaction_log[_0xf225('0x15')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x535b19[_0xf225('0x65')]['id'],_0x535b19[_0xf225('0x65')][_0xf225('0x29')],_0x535b19['user'][_0xf225('0x6a')],_0x329fce[_0xf225('0x7d')]['id'],_0x535b19['body']?JSON[_0xf225('0x1a')](_0x535b19['body']):_0xf225('0x6b'));return respondWithRpcPromise(_0xf225('0x7e'),_0xf225('0x7f'),_0x329fce);}return null;})['then'](function(_0x2bcc65){var _0x41dd39=_0xf225('0x6e')+_0x2bcc65[_0xf225('0x1c')]['ContactId'];return db[_0xf225('0x80')][_0xf225('0x32')](_0x41dd39,{'type':db[_0xf225('0x81')][_0xf225('0x70')][_0xf225('0x71')],'raw':!![]})[_0xf225('0x26')](function(_0x42435f){return _0x42435f;});})[_0xf225('0x26')](function(_0x12962e){if(_0x12962e){_0x329fce[_0xf225('0x1c')][_0xf225('0x82')]=_0x12962e[0x0];if(!_0x535b19[_0xf225('0x4a')]['UserId'])return;return db['User'][_0xf225('0x49')]({'where':{'id':_0x535b19[_0xf225('0x4a')][_0xf225('0x64')],'role':'agent'},'attributes':['id',_0xf225('0x29'),'fullname',_0xf225('0x75'),_0xf225('0x76')],'raw':!![]});}return null;})['then'](function(_0x1c2df6){if(!_0x1c2df6)return null;_0x329fce[_0xf225('0x1c')][_0xf225('0x73')]=_0x1c2df6;return _0x329fce;})[_0xf225('0x26')](function(_0x35fbc0){if(_0x35fbc0){_0x35fbc0[_0xf225('0x1c')][_0xf225('0x83')]=util[_0xf225('0x60')](_0xf225('0x84'),_0x535b19[_0xf225('0x65')][_0xf225('0x29')]);_0x35fbc0[_0xf225('0x1c')][_0xf225('0x78')]=_0x329fce['channel'];_0x35fbc0[_0xf225('0x1c')][_0xf225('0x85')]=_0x329fce[_0xf225('0x78')];_0x35fbc0[_0xf225('0x1c')][_0xf225('0x79')]=_0xf225('0x86');_0x35fbc0[_0xf225('0x1c')]['body']=htmlToText[_0xf225('0x7a')](_0x329fce[_0xf225('0x1c')][_0xf225('0x4a')]);respondWithRpcPromise('EventManager',_0xf225('0x7b'),{'event':_0xf225('0x87'),'message':_0x35fbc0[_0xf225('0x1c')]},client9002);return _0x329fce;}return null;})[_0xf225('0x26')](respondWithResult(_0x57e536,null))[_0xf225('0x1d')](handleError(_0x57e536,null));};exports[_0xf225('0x88')]=function(_0xb15ec6,_0x1202be){var _0x1a1c9e=moment()[_0xf225('0x89')]()[_0xf225('0x8a')]();var _0x58a5f9=path['join'](config[_0xf225('0x59')],'server',_0xf225('0x8b'),'tmp');var _0x4199ad=path[_0xf225('0x8c')](config[_0xf225('0x59')],_0xf225('0x8d'),_0xf225('0x8b'),_0xf225('0x58'));var _0x354698=util[_0xf225('0x60')](_0xf225('0x8e'),_0x1a1c9e);return db['MailMessage']['find']({'where':{'id':_0xb15ec6[_0xf225('0x47')]['id']},'attributes':['id',_0xf225('0x4a'),_0xf225('0x8f'),'to','cc','bcc',_0xf225('0x90'),'createdAt'],'include':_0xb15ec6[_0xf225('0x32')][_0xf225('0x58')]?[{'model':db[_0xf225('0x91')],'as':_0xf225('0x92')}]:undefined})[_0xf225('0x26')](handleEntityNotFound(_0x1202be,null))[_0xf225('0x26')](function(_0x4aaf17){if(_0x4aaf17){var _0x3d56dd=_0x4aaf17;var _0x172584={'from':_0x3d56dd[_0xf225('0x8f')],'to':_0x3d56dd['to'],'subject':_0x3d56dd[_0xf225('0x90')],'html':htmlEntities[_0xf225('0x93')](_0x3d56dd['body']),'headers':{'Date':moment(_0x3d56dd[_0xf225('0x94')])[_0xf225('0x60')](_0xf225('0x95'))},'attachments':[]};if(_0x4aaf17['cc']){_0x172584[_0xf225('0x96')]['Cc']=_0x4aaf17['cc'];}if(_0x4aaf17[_0xf225('0x97')]){_0x172584['headers'][_0xf225('0x98')]=_0x4aaf17[_0xf225('0x97')];}return new BPromise(function(_0x205c32,_0x298ba7){if(_0x4aaf17[_0xf225('0x92')]){for(var _0x6e8e43=0x0;_0x6e8e43<_0x4aaf17[_0xf225('0x92')][_0xf225('0x39')];_0x6e8e43++){var _0x21e4b0=_0x4aaf17[_0xf225('0x92')][_0x6e8e43];var _0x278642=path['join'](_0x4199ad,_0x21e4b0['basename']);if(fs[_0xf225('0x99')](_0x278642)){_0x172584[_0xf225('0x58')]['push']({'name':_0x21e4b0[_0xf225('0x29')],'contentType':_0x21e4b0[_0xf225('0x30')],'data':fs[_0xf225('0x9a')](_0x278642)});}}}emlformat['build'](_0x172584,function(_0xb57954,_0x555bec){if(_0xb57954)return _0x298ba7(_0xb57954);fs[_0xf225('0x9b')](path[_0xf225('0x8c')](_0x58a5f9,_0x354698),_0x555bec);return _0x205c32(_0x555bec);});});}})[_0xf225('0x26')](function(_0x1f87ac){if(_0x1f87ac){return _0x1202be[_0xf225('0x88')](path[_0xf225('0x8c')](_0x58a5f9,_0x354698),_0x354698,function(_0x49a03d){if(!_0x49a03d)fs[_0xf225('0x9c')](path[_0xf225('0x8c')](_0x58a5f9,_0x354698));});}})[_0xf225('0x1d')](handleError(_0x1202be,null));}; \ No newline at end of file +var _0xe02a=['get','MailInteraction','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','agent','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','reject','role','stringify','rejectMessage','contact','email','rejectmessage','download','unix','toString','root','server','files','tmp','message-%s.eml','from','bcc','Attachment','Attachments','createdAt','headers','Bcc','readFileSync','writeFileSync','unlinkSync','util','path','lodash','html-to-text','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','http','client','request','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','MailMessage,\x20%s,\x20%s','message','result','catch','status','offset','limit','count','set','json','update','then','sendStatus','stack','name','send','index','MailMessage','rawAttributes','fieldName','type','key','map','query','filters','model','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','params','keys','include','find','body','describe','create','direction','out','secret','split','findOne','CmList','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','length','join','server/files/attachments','basename','ListId','SendMail','sendMail','format','accept','mail','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user'];(function(_0x448342,_0x5db768){var _0x59c682=function(_0x129d4b){while(--_0x129d4b){_0x448342['push'](_0x448342['shift']());}};_0x59c682(++_0x5db768);}(_0xe02a,0xc7));var _0xae02=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe02a[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var moment=require('moment');var BPromise=require('bluebird');var util=require(_0xae02('0x0'));var path=require(_0xae02('0x1'));var fs=require('fs');var _=require(_0xae02('0x2'));var Redis=require('ioredis');var htmlToText=require(_0xae02('0x3'));var qs=require('../../components/parsers/qs');var logger=require(_0xae02('0x4'))(_0xae02('0x5'));var interaction_log=require(_0xae02('0x4'))(_0xae02('0x6'));var config=require(_0xae02('0x7'));var db=require(_0xae02('0x8'))['db'];config[_0xae02('0x9')]=_[_0xae02('0xa')](config['redis'],{'host':_0xae02('0xb'),'port':0x18eb});var socket=require(_0xae02('0xc'))(new Redis(config[_0xae02('0x9')]));var htmlEntities=require('html-entities');require('./mailMessage.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xae02('0xd')]({'port':0x232c});var client9003=jayson[_0xae02('0xe')][_0xae02('0xd')]({'port':0x232b});var client9002=jayson[_0xae02('0xe')][_0xae02('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x93a1bf,_0x47d3fd,_0x5c6cb9,_0x1aa53f){return new BPromise(function(_0x30dfb5,_0x2c25d5){var _0x5a6b53=_0x1aa53f||client;return _0x5a6b53[_0xae02('0xf')](_0x93a1bf,_0x5c6cb9)['then'](function(_0x23a1e4){logger[_0xae02('0x10')]('MailMessage,\x20%s,\x20%s',_0x47d3fd,_0xae02('0x11'));logger[_0xae02('0x12')](_0xae02('0x13'),_0x47d3fd,_0xae02('0x11'),JSON['stringify'](_0x23a1e4));if(_0x23a1e4['error']){if(_0x23a1e4[_0xae02('0x14')]['code']===0x1f4){logger[_0xae02('0x14')](_0xae02('0x15'),_0x47d3fd,_0x23a1e4[_0xae02('0x14')][_0xae02('0x16')]);return _0x2c25d5(_0x23a1e4['error']['message']);}logger[_0xae02('0x14')](_0xae02('0x15'),_0x47d3fd,_0x23a1e4['error'][_0xae02('0x16')]);return _0x30dfb5(_0x23a1e4[_0xae02('0x14')][_0xae02('0x16')]);}else{logger[_0xae02('0x10')](_0xae02('0x15'),_0x47d3fd,'request\x20sent');_0x30dfb5(_0x23a1e4[_0xae02('0x17')]['message']);}})[_0xae02('0x18')](function(_0x5ae9c0){logger[_0xae02('0x14')](_0xae02('0x15'),_0x47d3fd,_0x5ae9c0);_0x2c25d5(_0x5ae9c0);});});}function respondWithResult(_0xde5bae,_0x3bbcd0){_0x3bbcd0=_0x3bbcd0||0xc8;return function(_0x16839e){if(_0x16839e){return _0xde5bae[_0xae02('0x19')](_0x3bbcd0)['json'](_0x16839e);}};}function respondWithFilteredResult(_0x3581db,_0x32641a){return function(_0x366fd3){if(_0x366fd3){var _0x5c2eab=typeof _0x32641a[_0xae02('0x1a')]==='undefined'&&typeof _0x32641a[_0xae02('0x1b')]==='undefined';var _0x167538=_0x366fd3[_0xae02('0x1c')];var _0x51e12e=_0x5c2eab?0x0:_0x32641a[_0xae02('0x1a')];var _0xe3f458=_0x5c2eab?_0x366fd3[_0xae02('0x1c')]:_0x32641a[_0xae02('0x1a')]+_0x32641a[_0xae02('0x1b')];var _0x431c4f;if(_0xe3f458>=_0x167538){_0xe3f458=_0x167538;_0x431c4f=0xc8;}else{_0x431c4f=0xce;}_0x3581db['status'](_0x431c4f);return _0x3581db[_0xae02('0x1d')]('Content-Range',_0x51e12e+'-'+_0xe3f458+'/'+_0x167538)[_0xae02('0x1e')](_0x366fd3);}return null;};}function saveUpdates(_0x2837f7){return function(_0x494ce4){if(_0x494ce4){return _0x494ce4[_0xae02('0x1f')](_0x2837f7)['then'](function(_0x3bdba7){return _0x3bdba7;});}return null;};}function removeEntity(_0x3f2f47){return function(_0x4b029d){if(_0x4b029d){return _0x4b029d['destroy']()[_0xae02('0x20')](function(){_0x3f2f47[_0xae02('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x296010){return function(_0x5a09dc){if(!_0x5a09dc){_0x296010[_0xae02('0x21')](0x194);}return _0x5a09dc;};}function handleError(_0x4e56c7,_0x7baae6){_0x7baae6=_0x7baae6||0x1f4;return function(_0x1a7212){logger[_0xae02('0x14')](_0x1a7212[_0xae02('0x22')]);if(_0x1a7212[_0xae02('0x23')]){delete _0x1a7212[_0xae02('0x23')];}_0x4e56c7[_0xae02('0x19')](_0x7baae6)[_0xae02('0x24')](_0x1a7212);};}exports[_0xae02('0x25')]=function(_0x2adbac,_0x5623f5){var _0x7817d5={},_0x533803={},_0x3f0e64={'count':0x0,'rows':[]};var _0x1c12ed=_['map'](db[_0xae02('0x26')][_0xae02('0x27')],function(_0x5be844){return{'name':_0x5be844[_0xae02('0x28')],'type':_0x5be844[_0xae02('0x29')][_0xae02('0x2a')]};});_0x533803['model']=_[_0xae02('0x2b')](_0x1c12ed,'name');_0x533803['query']=_['keys'](_0x2adbac[_0xae02('0x2c')]);_0x533803[_0xae02('0x2d')]=_['intersection'](_0x533803[_0xae02('0x2e')],_0x533803[_0xae02('0x2c')]);_0x7817d5['attributes']=_[_0xae02('0x2f')](_0x533803['model'],qs['fields'](_0x2adbac[_0xae02('0x2c')][_0xae02('0x30')]));_0x7817d5[_0xae02('0x31')]=_0x7817d5[_0xae02('0x31')]['length']?_0x7817d5[_0xae02('0x31')]:_0x533803[_0xae02('0x2e')];if(!_0x2adbac[_0xae02('0x2c')][_0xae02('0x32')](_0xae02('0x33'))){_0x7817d5[_0xae02('0x1b')]=qs[_0xae02('0x1b')](_0x2adbac[_0xae02('0x2c')][_0xae02('0x1b')]);_0x7817d5[_0xae02('0x1a')]=qs[_0xae02('0x1a')](_0x2adbac[_0xae02('0x2c')]['offset']);}_0x7817d5[_0xae02('0x34')]=qs[_0xae02('0x35')](_0x2adbac[_0xae02('0x2c')]['sort']);_0x7817d5[_0xae02('0x36')]=qs[_0xae02('0x2d')](_['pick'](_0x2adbac[_0xae02('0x2c')],_0x533803[_0xae02('0x2d')]),_0x1c12ed);if(_0x2adbac['query'][_0xae02('0x37')]){_0x7817d5[_0xae02('0x36')]=_[_0xae02('0x38')](_0x7817d5[_0xae02('0x36')],{'$or':_[_0xae02('0x2b')](_0x1c12ed,function(_0x428359){if(_0x428359[_0xae02('0x29')]!==_0xae02('0x39')){var _0x3105a0={};_0x3105a0[_0x428359['name']]={'$like':'%'+_0x2adbac['query'][_0xae02('0x37')]+'%'};return _0x3105a0;}})});}_0x7817d5=_['merge']({},_0x7817d5,_0x2adbac[_0xae02('0x3a')]);var _0x4285e9={'where':_0x7817d5[_0xae02('0x36')]};return db[_0xae02('0x26')][_0xae02('0x1c')](_0x4285e9)[_0xae02('0x20')](function(_0x3cd8b3){_0x3f0e64[_0xae02('0x1c')]=_0x3cd8b3;if(_0x2adbac[_0xae02('0x2c')][_0xae02('0x3b')]){_0x7817d5['include']=[{'all':!![]}];}return db[_0xae02('0x26')][_0xae02('0x3c')](_0x7817d5);})[_0xae02('0x20')](function(_0x3c2223){_0x3f0e64[_0xae02('0x3d')]=_0x3c2223;return _0x3f0e64;})[_0xae02('0x20')](respondWithFilteredResult(_0x5623f5,_0x7817d5))[_0xae02('0x18')](handleError(_0x5623f5,null));};exports['show']=function(_0x141aa5,_0x3351e5){var _0x33647d={'raw':!![],'where':{'id':_0x141aa5[_0xae02('0x3e')]['id']}},_0x1e1fad={};_0x1e1fad[_0xae02('0x2e')]=_['keys'](db[_0xae02('0x26')][_0xae02('0x27')]);_0x1e1fad[_0xae02('0x2c')]=_[_0xae02('0x3f')](_0x141aa5[_0xae02('0x2c')]);_0x1e1fad[_0xae02('0x2d')]=_[_0xae02('0x2f')](_0x1e1fad[_0xae02('0x2e')],_0x1e1fad[_0xae02('0x2c')]);_0x33647d[_0xae02('0x31')]=_[_0xae02('0x2f')](_0x1e1fad['model'],qs['fields'](_0x141aa5[_0xae02('0x2c')][_0xae02('0x30')]));_0x33647d[_0xae02('0x31')]=_0x33647d[_0xae02('0x31')]['length']?_0x33647d[_0xae02('0x31')]:_0x1e1fad[_0xae02('0x2e')];if(_0x141aa5[_0xae02('0x2c')]['includeAll']){_0x33647d[_0xae02('0x40')]=[{'all':!![]}];}_0x33647d=_[_0xae02('0x38')]({},_0x33647d,_0x141aa5[_0xae02('0x3a')]);return db['MailMessage'][_0xae02('0x41')](_0x33647d)[_0xae02('0x20')](handleEntityNotFound(_0x3351e5,null))[_0xae02('0x20')](respondWithResult(_0x3351e5,null))[_0xae02('0x18')](handleError(_0x3351e5,null));};exports[_0xae02('0x1f')]=function(_0x4cd34a,_0x3bf230){if(_0x4cd34a[_0xae02('0x42')]['id']){delete _0x4cd34a[_0xae02('0x42')]['id'];}return db['MailMessage'][_0xae02('0x41')]({'where':{'id':_0x4cd34a[_0xae02('0x3e')]['id']}})[_0xae02('0x20')](handleEntityNotFound(_0x3bf230,null))[_0xae02('0x20')](saveUpdates(_0x4cd34a[_0xae02('0x42')],null))['then'](respondWithResult(_0x3bf230,null))[_0xae02('0x18')](handleError(_0x3bf230,null));};exports['destroy']=function(_0x5a99b3,_0x14ef04){return db['MailMessage'][_0xae02('0x41')]({'where':{'id':_0x5a99b3['params']['id']}})['then'](handleEntityNotFound(_0x14ef04,null))[_0xae02('0x20')](removeEntity(_0x14ef04,null))[_0xae02('0x18')](handleError(_0x14ef04,null));};exports[_0xae02('0x43')]=function(_0x5bd894,_0xe9d462){return db[_0xae02('0x26')][_0xae02('0x43')]()[_0xae02('0x20')](respondWithResult(_0xe9d462,null))[_0xae02('0x18')](handleError(_0xe9d462,null));};exports[_0xae02('0x44')]=function(_0xf0520,_0x4af148){return db[_0xae02('0x26')]['create'](_0xf0520[_0xae02('0x42')])[_0xae02('0x20')](function(_0x60be4c){if(_0x60be4c){if(_0x60be4c[_0xae02('0x45')]===_0xae02('0x46')&&!_0x60be4c[_0xae02('0x47')]){var _0xd515fd,_0x26a1fc,_0x2ced73;if(_0xf0520[_0xae02('0x42')]['to']){_0x26a1fc=_0xf0520[_0xae02('0x42')]['to'][_0xae02('0x48')](',')[0x0];}return db['MailAccount'][_0xae02('0x49')]({'where':{'id':_0x60be4c['MailAccountId']},'include':[{'model':db[_0xae02('0x4a')],'as':_0xae02('0x4b'),'include':[{'model':db[_0xae02('0x4c')],'as':_0xae02('0x4d'),'where':{'email':_0x26a1fc},'limit':0x1,'order':[[_0xae02('0x4e'),_0xae02('0x4f')]]}]},{'model':db[_0xae02('0x50')],'as':_0xae02('0x51'),'raw':!![],'include':[{'model':db[_0xae02('0x52')],'as':_0xae02('0x52'),'raw':!![]}]}]})[_0xae02('0x20')](function(_0xce839a){_0xd515fd=_0xce839a;if(!_0xd515fd||!_0xd515fd[_0xae02('0x51')])return;var _0x41938d=_0xd515fd[_0xae02('0x53')]();if(_0xf0520[_0xae02('0x42')]['attachments']&&_0xf0520['body'][_0xae02('0x54')][_0xae02('0x55')]){for(var _0x1848b6=0x0;_0x1848b6<_0xf0520[_0xae02('0x42')][_0xae02('0x54')][_0xae02('0x55')];_0x1848b6+=0x1){_0xf0520['body'][_0xae02('0x54')][_0x1848b6]={'filename':_0xf0520['body'][_0xae02('0x54')][_0x1848b6][_0xae02('0x23')],'path':path[_0xae02('0x56')](config['root'],_0xae02('0x57'),_0xf0520[_0xae02('0x42')][_0xae02('0x54')][_0x1848b6][_0xae02('0x58')])};}}_0x2ced73={'account':_0x41938d,'message':_0xf0520[_0xae02('0x42')]};return;})['then'](function(){if(_0xd515fd[_0xae02('0x4b')]){if(_0xd515fd[_0xae02('0x4b')][_0xae02('0x4d')][_0xae02('0x55')]){return _0xd515fd[_0xae02('0x4b')][_0xae02('0x4d')][0x0];}else{return db[_0xae02('0x4c')]['create'](_[_0xae02('0xa')](_0xf0520[_0xae02('0x42')],{'firstName':_0xf0520[_0xae02('0x42')]['to'],'email':_0xf0520[_0xae02('0x42')]['to'],'phone':_0xf0520[_0xae02('0x42')]['to'],'ListId':_0xd515fd[_0xae02('0x59')]}));}}else{throw new Error('List\x20not\x20found');}})['then'](function(){if(_0x2ced73){return respondWithRpcPromise(_0xae02('0x5a'),_0xae02('0x5b'),_0x2ced73,client9003)[_0xae02('0x20')](function(_0x5f0b46){return _0x60be4c[_0xae02('0x1f')]({'read':!![],'messageId':_0x5f0b46['messageId'],'sentAt':moment()[_0xae02('0x5c')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0xae02('0x18')](function(_0x1aed0f){logger[_0xae02('0x14')]('%s',JSON['stringify'](_0x1aed0f));return _0x60be4c;});}return _0x60be4c;});}return _0x60be4c;}})[_0xae02('0x20')](respondWithResult(_0x4af148,0xc9))[_0xae02('0x18')](handleError(_0x4af148,null));};exports[_0xae02('0x5d')]=function(_0x42d8e1,_0x10a64d){var _0x3195c7={'agent':{},'channel':_0xae02('0x5e')};if(_0x42d8e1[_0xae02('0x42')]['id']){delete _0x42d8e1[_0xae02('0x42')]['id'];}_0x42d8e1[_0xae02('0x42')]['read']=!![];_0x42d8e1[_0xae02('0x42')][_0xae02('0x5f')]=moment()[_0xae02('0x5c')](_0xae02('0x60'));_0x42d8e1[_0xae02('0x42')][_0xae02('0x61')]=_0x42d8e1[_0xae02('0x42')][_0xae02('0x61')]||_0x42d8e1[_0xae02('0x62')]['id'];_0x3195c7['agent']['id']=_0x42d8e1[_0xae02('0x42')][_0xae02('0x61')];return db[_0xae02('0x26')]['find']({'where':{'id':_0x42d8e1[_0xae02('0x3e')]['id'],'UserId':null}})[_0xae02('0x20')](handleEntityNotFound(_0x10a64d,null))['then'](saveUpdates(_0x42d8e1[_0xae02('0x42')],null))[_0xae02('0x20')](function(_0xb85d77){if(_0xb85d77){_0x3195c7[_0xae02('0x16')]=_0xb85d77[_0xae02('0x63')]({'plain':!![]});return db[_0xae02('0x64')][_0xae02('0x41')]({'where':{'id':_0xb85d77['MailInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x10a64d,null))[_0xae02('0x20')](function(_0x49de9b){if(_0x49de9b){return _0x49de9b[_0xae02('0x1f')]({'UserId':_0x42d8e1[_0xae02('0x42')][_0xae02('0x61')],'read1stAt':_['isNil'](_0x49de9b[_0xae02('0x65')])?moment()['format'](_0xae02('0x60')):undefined});}return null;})[_0xae02('0x20')](function(_0x33bfad){if(_0x33bfad){_0x3195c7[_0xae02('0x66')]=_0x33bfad[_0xae02('0x63')]({'plain':!![]});interaction_log['info'](_0xae02('0x67'),_0x42d8e1[_0xae02('0x62')]['id'],_0x42d8e1[_0xae02('0x62')][_0xae02('0x23')],_0x42d8e1[_0xae02('0x62')]['role'],_0x3195c7[_0xae02('0x66')]['id'],_0x42d8e1[_0xae02('0x42')]?JSON['stringify'](_0x42d8e1[_0xae02('0x42')]):_0xae02('0x68'));return respondWithRpcPromise(_0xae02('0x69'),'acceptMessage',_0x3195c7);}return null;})[_0xae02('0x20')](function(_0x58d3e5){var _0x3c140a=_0xae02('0x6a')+_0x58d3e5['message'][_0xae02('0x6b')];return db[_0xae02('0x6c')]['query'](_0x3c140a,{'type':db[_0xae02('0x6d')][_0xae02('0x6e')][_0xae02('0x6f')],'raw':!![]})['then'](function(_0x4e797a){return _0x4e797a;});})['then'](function(_0x2f818a){if(_0x2f818a){_0x3195c7[_0xae02('0x16')]['contact']=_0x2f818a[0x0];if(!_0x42d8e1[_0xae02('0x42')][_0xae02('0x61')])return;return db['User']['find']({'where':{'id':_0x42d8e1['body']['UserId'],'role':_0xae02('0x70')},'attributes':['id',_0xae02('0x23'),_0xae02('0x71'),'email',_0xae02('0x72')],'raw':!![]});}return null;})[_0xae02('0x20')](function(_0x2368e9){if(!_0x2368e9)return null;_0x3195c7[_0xae02('0x16')]['agent']=_0x2368e9;return _0x3195c7;})[_0xae02('0x20')](function(_0x3c4f10){if(_0x3c4f10){if(_0x42d8e1[_0xae02('0x42')][_0xae02('0x73')]){_0x3195c7['message'][_0xae02('0x74')]=util[_0xae02('0x5c')](_0xae02('0x75'),_0x42d8e1['user']['name']);_0x3195c7[_0xae02('0x16')]['channel']=_0x3195c7[_0xae02('0x76')];_0x3195c7[_0xae02('0x16')][_0xae02('0x77')]=_0x3195c7[_0xae02('0x76')];_0x3195c7['message'][_0xae02('0x78')]='accept';_0x3195c7[_0xae02('0x16')]['body']=htmlToText[_0xae02('0x79')](_0x3195c7[_0xae02('0x16')][_0xae02('0x42')]);return respondWithRpcPromise(_0xae02('0x7a'),_0xae02('0x7a'),{'event':_0xae02('0x7b'),'message':_0x3195c7['message']},client9002)['then'](function(){return _0x3195c7;});}return _0x3195c7;}return null;})[_0xae02('0x20')](respondWithResult(_0x10a64d,null))[_0xae02('0x18')](handleError(_0x10a64d,null));};exports[_0xae02('0x7c')]=function(_0x4547ea,_0x1f614d){var _0x14541e={'agent':{},'channel':_0xae02('0x5e')};if(_0x4547ea[_0xae02('0x42')]['id']){delete _0x4547ea[_0xae02('0x42')]['id'];}_0x4547ea[_0xae02('0x42')]['UserId']=_0x4547ea['body'][_0xae02('0x61')]||_0x4547ea[_0xae02('0x62')]['id'];_0x14541e[_0xae02('0x70')]['id']=_0x4547ea[_0xae02('0x42')][_0xae02('0x61')];return db[_0xae02('0x26')][_0xae02('0x41')]({'where':{'id':_0x4547ea['params']['id'],'UserId':null}})[_0xae02('0x20')](handleEntityNotFound(_0x1f614d,null))[_0xae02('0x20')](function(_0x1d9bb9){if(_0x1d9bb9){_0x14541e[_0xae02('0x16')]=_0x1d9bb9[_0xae02('0x63')]({'plain':!![]});return db['MailInteraction'][_0xae02('0x41')]({'where':{'id':_0x1d9bb9['MailInteractionId']}});}return null;})[_0xae02('0x20')](handleEntityNotFound(_0x1f614d,null))[_0xae02('0x20')](function(_0xa964f1){if(_0xa964f1){_0x14541e[_0xae02('0x66')]=_0xa964f1['get']({'plain':!![]});interaction_log[_0xae02('0x10')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4547ea[_0xae02('0x62')]['id'],_0x4547ea[_0xae02('0x62')][_0xae02('0x23')],_0x4547ea[_0xae02('0x62')][_0xae02('0x7d')],_0x14541e[_0xae02('0x66')]['id'],_0x4547ea['body']?JSON[_0xae02('0x7e')](_0x4547ea[_0xae02('0x42')]):_0xae02('0x68'));return respondWithRpcPromise('RejectMessage',_0xae02('0x7f'),_0x14541e);}return null;})[_0xae02('0x20')](function(_0x677028){var _0x4b0f39='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x677028[_0xae02('0x16')][_0xae02('0x6b')];return db[_0xae02('0x6c')][_0xae02('0x2c')](_0x4b0f39,{'type':db['Sequelize'][_0xae02('0x6e')][_0xae02('0x6f')],'raw':!![]})[_0xae02('0x20')](function(_0x1b848e){return _0x1b848e;});})[_0xae02('0x20')](function(_0x3b7e04){if(_0x3b7e04){_0x14541e[_0xae02('0x16')][_0xae02('0x80')]=_0x3b7e04[0x0];if(!_0x4547ea[_0xae02('0x42')][_0xae02('0x61')])return;return db['User'][_0xae02('0x41')]({'where':{'id':_0x4547ea[_0xae02('0x42')][_0xae02('0x61')],'role':'agent'},'attributes':['id',_0xae02('0x23'),_0xae02('0x71'),_0xae02('0x81'),_0xae02('0x72')],'raw':!![]});}return null;})[_0xae02('0x20')](function(_0x36a174){if(!_0x36a174)return null;_0x14541e[_0xae02('0x16')][_0xae02('0x70')]=_0x36a174;return _0x14541e;})[_0xae02('0x20')](function(_0x2fedb4){if(_0x2fedb4){_0x2fedb4[_0xae02('0x16')][_0xae02('0x74')]=util[_0xae02('0x5c')]('SIP/%s',_0x4547ea[_0xae02('0x62')][_0xae02('0x23')]);_0x2fedb4[_0xae02('0x16')][_0xae02('0x76')]=_0x14541e['channel'];_0x2fedb4['message'][_0xae02('0x77')]=_0x14541e[_0xae02('0x76')];_0x2fedb4[_0xae02('0x16')]['event']=_0xae02('0x7c');_0x2fedb4[_0xae02('0x16')]['body']=htmlToText[_0xae02('0x79')](_0x14541e[_0xae02('0x16')][_0xae02('0x42')]);respondWithRpcPromise(_0xae02('0x7a'),_0xae02('0x7a'),{'event':_0xae02('0x82'),'message':_0x2fedb4[_0xae02('0x16')]},client9002);return _0x14541e;}return null;})[_0xae02('0x20')](respondWithResult(_0x1f614d,null))[_0xae02('0x18')](handleError(_0x1f614d,null));};exports[_0xae02('0x83')]=function(_0x34a7b2,_0x4b361f){var _0x435408=moment()[_0xae02('0x84')]()[_0xae02('0x85')]();var _0xb4d511=path[_0xae02('0x56')](config[_0xae02('0x86')],_0xae02('0x87'),_0xae02('0x88'),_0xae02('0x89'));var _0x4d2847=path['join'](config[_0xae02('0x86')],_0xae02('0x87'),'files',_0xae02('0x54'));var _0x243f53=util[_0xae02('0x5c')](_0xae02('0x8a'),_0x435408);return db[_0xae02('0x26')]['find']({'where':{'id':_0x34a7b2[_0xae02('0x3e')]['id']},'attributes':['id',_0xae02('0x42'),_0xae02('0x8b'),'to','cc',_0xae02('0x8c'),'subject','createdAt'],'include':_0x34a7b2['query'][_0xae02('0x54')]?[{'model':db[_0xae02('0x8d')],'as':_0xae02('0x8e')}]:undefined})['then'](handleEntityNotFound(_0x4b361f,null))[_0xae02('0x20')](function(_0x238e38){if(_0x238e38){var _0x569a8d=_0x238e38;var _0x2c2d7d={'from':_0x569a8d[_0xae02('0x8b')],'to':_0x569a8d['to'],'subject':_0x569a8d['subject'],'html':htmlEntities['decode'](_0x569a8d[_0xae02('0x42')]),'headers':{'Date':moment(_0x569a8d[_0xae02('0x8f')])[_0xae02('0x5c')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x238e38['cc']){_0x2c2d7d[_0xae02('0x90')]['Cc']=_0x238e38['cc'];}if(_0x238e38[_0xae02('0x8c')]){_0x2c2d7d[_0xae02('0x90')][_0xae02('0x91')]=_0x238e38[_0xae02('0x8c')];}return new BPromise(function(_0x4c2c4a,_0x21eeac){if(_0x238e38[_0xae02('0x8e')]){for(var _0x1da4d4=0x0;_0x1da4d4<_0x238e38['Attachments'][_0xae02('0x55')];_0x1da4d4++){var _0x4797b2=_0x238e38[_0xae02('0x8e')][_0x1da4d4];var _0x2d9a14=path['join'](_0x4d2847,_0x4797b2[_0xae02('0x58')]);if(fs['existsSync'](_0x2d9a14)){_0x2c2d7d[_0xae02('0x54')]['push']({'name':_0x4797b2[_0xae02('0x23')],'contentType':_0x4797b2[_0xae02('0x29')],'data':fs[_0xae02('0x92')](_0x2d9a14)});}}}emlformat['build'](_0x2c2d7d,function(_0x52e554,_0x4d7b10){if(_0x52e554)return _0x21eeac(_0x52e554);fs[_0xae02('0x93')](path[_0xae02('0x56')](_0xb4d511,_0x243f53),_0x4d7b10);return _0x4c2c4a(_0x4d7b10);});});}})['then'](function(_0x278dd5){if(_0x278dd5){return _0x4b361f['download'](path[_0xae02('0x56')](_0xb4d511,_0x243f53),_0x243f53,function(_0x1228a3){if(!_0x1228a3)fs[_0xae02('0x94')](path[_0xae02('0x56')](_0xb4d511,_0x243f53));});}})[_0xae02('0x18')](handleError(_0x4b361f,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 210a844..549dec5 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 _0x0fdb=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0fdb,0x195));var _0xb0fd=function(_0x10d5c2,_0x3864ad){_0x10d5c2=_0x10d5c2-0x0;var _0x9d2ac8=_0x0fdb[_0x10d5c2];return _0x9d2ac8;};'use strict';var EventEmitter=require(_0xb0fd('0x0'));var MailMessage=require(_0xb0fd('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb0fd('0x2'),'afterUpdate':_0xb0fd('0x3'),'afterDestroy':'remove'};function emitEvent(_0x45cd97){return function(_0x161f1d,_0x48e534,_0xb59f41){MailMessageEvents[_0xb0fd('0x4')](_0x45cd97+':'+_0x161f1d['id'],_0x161f1d);MailMessageEvents['emit'](_0x45cd97,_0x161f1d);_0xb59f41(null);};}for(var e in events){if(events[_0xb0fd('0x5')](e)){var event=events[e];MailMessage[_0xb0fd('0x6')](e,emitEvent(event));}}module[_0xb0fd('0x7')]=MailMessageEvents; \ No newline at end of file +var _0xd42f=['update','emit','hook','events','setMaxListeners'];(function(_0x595399,_0x52d487){var _0x4e0869=function(_0x6b53c7){while(--_0x6b53c7){_0x595399['push'](_0x595399['shift']());}};_0x4e0869(++_0x52d487);}(_0xd42f,0x15c));var _0xfd42=function(_0x3ea7a0,_0x24cb7e){_0x3ea7a0=_0x3ea7a0-0x0;var _0x366b3b=_0xd42f[_0x3ea7a0];return _0x366b3b;};'use strict';var EventEmitter=require(_0xfd42('0x0'));var MailMessage=require('../../mysqldb')['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xfd42('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xfd42('0x2'),'afterDestroy':'remove'};function emitEvent(_0x2ed5d9){return function(_0x5669fa,_0x13cdc4,_0x121fa9){MailMessageEvents[_0xfd42('0x3')](_0x2ed5d9+':'+_0x5669fa['id'],_0x5669fa);MailMessageEvents[_0xfd42('0x3')](_0x2ed5d9,_0x5669fa);_0x121fa9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0xfd42('0x4')](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 13819bb..f57cd05 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 _0xf19d=['FULLTEXT','fromString','body','models','get','direction','toLowerCase','secret','MailInteraction','findOne','then','update','createdAt','catch','error','utf8mb4','util','../../config/logger','api','moment','bluebird','request-promise','html-to-text','rimraf','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','plainBody','subject'];(function(_0x4b661,_0x539a3a){var _0x1e15eb=function(_0x125b66){while(--_0x125b66){_0x4b661['push'](_0x4b661['shift']());}};_0x1e15eb(++_0x539a3a);}(_0xf19d,0x15a));var _0xdf19=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0xf19d[_0x5317b5];return _0x3b7ce2;};'use strict';var _=require('lodash');var util=require(_0xdf19('0x0'));var logger=require(_0xdf19('0x1'))(_0xdf19('0x2'));var moment=require(_0xdf19('0x3'));var BPromise=require(_0xdf19('0x4'));var rp=require(_0xdf19('0x5'));var htmlToText=require(_0xdf19('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdf19('0x7'));var config=require(_0xdf19('0x8'));var attributes=require(_0xdf19('0x9'));module[_0xdf19('0xa')]=function(_0x4bfacd,_0x5a1812){return _0x4bfacd[_0xdf19('0xb')](_0xdf19('0xc'),attributes,{'tableName':_0xdf19('0xd'),'paranoid':![],'indexes':[{'name':_0xdf19('0xe'),'fields':[_0xdf19('0xe')]},{'name':'fti_mail_messages','fields':[_0xdf19('0xf'),_0xdf19('0x10')],'type':_0xdf19('0x11')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2f1278,_0x3a65d0,_0x6b1ba5){if(_0x2f1278['body']){_0x2f1278[_0xdf19('0xf')]=htmlToText[_0xdf19('0x12')](_0x2f1278[_0xdf19('0x13')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x6b1ba5(null,_0x3a65d0);},'afterCreate':function(_0x39c866,_0x473357,_0x2791e6){var _0x18bb3f=_0x4bfacd[_0xdf19('0x14')];var _0x35048d=_0x39c866[_0xdf19('0x15')]({'plain':!![]});if(_0x35048d[_0xdf19('0x16')][_0xdf19('0x17')]()==='in'||_0x35048d['direction'][_0xdf19('0x17')]()==='out'&&!_0x35048d[_0xdf19('0x18')]&&!_['isNil'](_0x35048d['UserId'])){_0x18bb3f[_0xdf19('0x19')][_0xdf19('0x1a')]({'where':{'id':_0x35048d['MailInteractionId']}})[_0xdf19('0x1b')](function(_0x4c590b){if(_0x4c590b){_0x4c590b[_0xdf19('0x1c')]({'lastMsgAt':_0x35048d[_0xdf19('0x1d')],'lastMsgDirection':_0x35048d[_0xdf19('0x16')][_0xdf19('0x17')]()});}})[_0xdf19('0x1e')](function(_0x1a2cf8){console[_0xdf19('0x1f')](_0x1a2cf8);});}_0x2791e6();}},'charset':_0xdf19('0x20'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xd82f=['secret','isNil','UserId','MailInteraction','findOne','MailInteractionId','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString','models','direction','toLowerCase','out'];(function(_0x2f934b,_0x265d07){var _0x21dee3=function(_0x2d0ed7){while(--_0x2d0ed7){_0x2f934b['push'](_0x2f934b['shift']());}};_0x21dee3(++_0x265d07);}(_0xd82f,0x174));var _0xfd82=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xd82f[_0x4a9fb1];return _0x348672;};'use strict';var _=require('lodash');var util=require(_0xfd82('0x0'));var logger=require(_0xfd82('0x1'))(_0xfd82('0x2'));var moment=require(_0xfd82('0x3'));var BPromise=require(_0xfd82('0x4'));var rp=require(_0xfd82('0x5'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0xfd82('0x6'));var rimraf=require(_0xfd82('0x7'));var config=require('../../config/environment');var attributes=require(_0xfd82('0x8'));module[_0xfd82('0x9')]=function(_0xbd6ca9,_0x54781a){return _0xbd6ca9[_0xfd82('0xa')](_0xfd82('0xb'),attributes,{'tableName':_0xfd82('0xc'),'paranoid':![],'indexes':[{'name':_0xfd82('0xd'),'fields':['messageId']},{'name':_0xfd82('0xe'),'fields':[_0xfd82('0xf'),_0xfd82('0x10')],'type':_0xfd82('0x11')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x363e56,_0x273c00,_0x351fd8){if(_0x363e56[_0xfd82('0x12')]){_0x363e56[_0xfd82('0xf')]=htmlToText[_0xfd82('0x13')](_0x363e56[_0xfd82('0x12')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x351fd8(null,_0x273c00);},'afterCreate':function(_0x42c354,_0x2f1e2d,_0x4d8038){var _0x13cd5a=_0xbd6ca9[_0xfd82('0x14')];var _0x221395=_0x42c354['get']({'plain':!![]});if(_0x221395[_0xfd82('0x15')][_0xfd82('0x16')]()==='in'||_0x221395['direction'][_0xfd82('0x16')]()===_0xfd82('0x17')&&!_0x221395[_0xfd82('0x18')]&&!_[_0xfd82('0x19')](_0x221395[_0xfd82('0x1a')])){_0x13cd5a[_0xfd82('0x1b')][_0xfd82('0x1c')]({'where':{'id':_0x221395[_0xfd82('0x1d')]}})['then'](function(_0x260f6e){if(_0x260f6e){_0x260f6e[_0xfd82('0x1e')]({'lastMsgAt':_0x221395[_0xfd82('0x1f')],'lastMsgDirection':_0x221395[_0xfd82('0x15')][_0xfd82('0x16')]()});}})[_0xfd82('0x20')](function(_0xb66a4d){console[_0xfd82('0x21')](_0xb66a4d);});}_0x4d8038();}},'charset':_0xfd82('0x22'),'collate':_0xfd82('0x23')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 7803755..240337f 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 _0xefda=['redis','defaults','socket.io-emitter','./mailMessage.socket','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateMailMessage','MailMessage','create','body','options','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x81fe53,_0x5b8f05){var _0x56f7a7=function(_0x1e7846){while(--_0x1e7846){_0x81fe53['push'](_0x81fe53['shift']());}};_0x56f7a7(++_0x5b8f05);}(_0xefda,0x96));var _0xaefd=function(_0x50c4fb,_0x4d3844){_0x50c4fb=_0x50c4fb-0x0;var _0x4ea2f4=_0xefda[_0x50c4fb];return _0x4ea2f4;};'use strict';var _=require(_0xaefd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xaefd('0x1'));var rs=require(_0xaefd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaefd('0x3'))['db'];var utils=require(_0xaefd('0x4'));var logger=require(_0xaefd('0x5'))(_0xaefd('0x6'));var config=require(_0xaefd('0x7'));var jayson=require(_0xaefd('0x8'));var client=jayson['client'][_0xaefd('0x9')]({'port':0x232a});config[_0xaefd('0xa')]=_[_0xaefd('0xb')](config[_0xaefd('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xaefd('0xc'))(new Redis(config[_0xaefd('0xa')]));require(_0xaefd('0xd'))['register'](socket);function respondWithRpcPromise(_0x48a255,_0x54a3b1,_0xa6239d){return new BPromise(function(_0x16b36e,_0x20135c){return client[_0xaefd('0xe')](_0x48a255,_0xa6239d)[_0xaefd('0xf')](function(_0x1e00fb){logger[_0xaefd('0x10')](_0xaefd('0x11'),_0x54a3b1,_0xaefd('0x12'));logger[_0xaefd('0x13')](_0xaefd('0x14'),_0x54a3b1,'request\x20sent',JSON[_0xaefd('0x15')](_0x1e00fb));if(_0x1e00fb['error']){if(_0x1e00fb[_0xaefd('0x16')][_0xaefd('0x17')]===0x1f4){logger[_0xaefd('0x16')](_0xaefd('0x11'),_0x54a3b1,_0x1e00fb['error'][_0xaefd('0x18')]);return _0x20135c(_0x1e00fb[_0xaefd('0x16')][_0xaefd('0x18')]);}logger[_0xaefd('0x16')](_0xaefd('0x11'),_0x54a3b1,_0x1e00fb[_0xaefd('0x16')][_0xaefd('0x18')]);return _0x16b36e(_0x1e00fb[_0xaefd('0x16')]['message']);}else{logger[_0xaefd('0x10')](_0xaefd('0x11'),_0x54a3b1,_0xaefd('0x12'));_0x16b36e(_0x1e00fb[_0xaefd('0x19')][_0xaefd('0x18')]);}})[_0xaefd('0x1a')](function(_0x516e84){logger[_0xaefd('0x16')](_0xaefd('0x11'),_0x54a3b1,_0x516e84);_0x20135c(_0x516e84);});});}exports[_0xaefd('0x1b')]=function(_0x1260dd){var _0x45ebf2=this;return new Promise(function(_0x1f302c,_0x5282ed){return db[_0xaefd('0x1c')][_0xaefd('0x1d')](_0x1260dd[_0xaefd('0x1e')],{'raw':_0x1260dd[_0xaefd('0x1f')]?_0x1260dd[_0xaefd('0x1f')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x5b9967){logger[_0xaefd('0x10')](_0xaefd('0x1b'),_0x1260dd);logger[_0xaefd('0x13')]('CreateMailMessage',_0x1260dd,JSON[_0xaefd('0x15')](_0x5b9967));_0x1f302c(_0x5b9967);})['catch'](function(_0x3deec8){logger[_0xaefd('0x16')](_0xaefd('0x1b'),_0x3deec8['message'],_0x1260dd);_0x5282ed(_0x45ebf2[_0xaefd('0x16')](0x1f4,_0x3deec8[_0xaefd('0x18')]));});});}; \ No newline at end of file +var _0x9582=['client','http','redis','defaults','register','request','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateMailMessage','MailMessage','options','raw','info','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4f3c22,_0x3f4aea){var _0x155903=function(_0x3dcfd6){while(--_0x3dcfd6){_0x4f3c22['push'](_0x4f3c22['shift']());}};_0x155903(++_0x3f4aea);}(_0x9582,0x95));var _0x2958=function(_0x299507,_0x2a002a){_0x299507=_0x299507-0x0;var _0x53182f=_0x9582[_0x299507];return _0x53182f;};'use strict';var _=require(_0x2958('0x0'));var util=require(_0x2958('0x1'));var moment=require(_0x2958('0x2'));var BPromise=require(_0x2958('0x3'));var rs=require(_0x2958('0x4'));var fs=require('fs');var Redis=require(_0x2958('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2958('0x6'));var logger=require(_0x2958('0x7'))(_0x2958('0x8'));var config=require(_0x2958('0x9'));var jayson=require(_0x2958('0xa'));var client=jayson[_0x2958('0xb')][_0x2958('0xc')]({'port':0x232a});config[_0x2958('0xd')]=_[_0x2958('0xe')](config[_0x2958('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2958('0xd')]));require('./mailMessage.socket')[_0x2958('0xf')](socket);function respondWithRpcPromise(_0x51e460,_0x44cccc,_0x5ef23c){return new BPromise(function(_0x3aacfa,_0x29776c){return client[_0x2958('0x10')](_0x51e460,_0x5ef23c)[_0x2958('0x11')](function(_0x11ec8d){logger['info'](_0x2958('0x12'),_0x44cccc,_0x2958('0x13'));logger[_0x2958('0x14')](_0x2958('0x15'),_0x44cccc,_0x2958('0x13'),JSON[_0x2958('0x16')](_0x11ec8d));if(_0x11ec8d[_0x2958('0x17')]){if(_0x11ec8d[_0x2958('0x17')]['code']===0x1f4){logger[_0x2958('0x17')](_0x2958('0x12'),_0x44cccc,_0x11ec8d['error']['message']);return _0x29776c(_0x11ec8d[_0x2958('0x17')][_0x2958('0x18')]);}logger['error'](_0x2958('0x12'),_0x44cccc,_0x11ec8d['error']['message']);return _0x3aacfa(_0x11ec8d[_0x2958('0x17')][_0x2958('0x18')]);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x44cccc,_0x2958('0x13'));_0x3aacfa(_0x11ec8d[_0x2958('0x19')][_0x2958('0x18')]);}})[_0x2958('0x1a')](function(_0x27599c){logger['error'](_0x2958('0x12'),_0x44cccc,_0x27599c);_0x29776c(_0x27599c);});});}exports[_0x2958('0x1b')]=function(_0x1a12fa){var _0x57b6c5=this;return new Promise(function(_0x1e77eb,_0x53b100){return db[_0x2958('0x1c')]['create'](_0x1a12fa['body'],{'raw':_0x1a12fa[_0x2958('0x1d')]?_0x1a12fa[_0x2958('0x1d')][_0x2958('0x1e')]===undefined?!![]:![]:!![]})[_0x2958('0x11')](function(_0x2202f8){logger[_0x2958('0x1f')](_0x2958('0x1b'),_0x1a12fa);logger[_0x2958('0x14')](_0x2958('0x1b'),_0x1a12fa,JSON[_0x2958('0x16')](_0x2202f8));_0x1e77eb(_0x2202f8);})[_0x2958('0x1a')](function(_0xd58ae1){logger[_0x2958('0x17')](_0x2958('0x1b'),_0xd58ae1[_0x2958('0x18')],_0x1a12fa);_0x53b100(_0x57b6c5['error'](0x1f4,_0xd58ae1['message']));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 5a05578..cac2a05 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 _0x819d=['update','emit','removeListener','register','length','./mailMessage.events','remove'];(function(_0x8f753a,_0x2e0b65){var _0x3c0db4=function(_0x2a3e4e){while(--_0x2a3e4e){_0x8f753a['push'](_0x8f753a['shift']());}};_0x3c0db4(++_0x2e0b65);}(_0x819d,0xc2));var _0xd819=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x819d[_0x167cc1];return _0x10bc4b;};'use strict';var MailMessageEvents=require(_0xd819('0x0'));var events=['save',_0xd819('0x1'),_0xd819('0x2')];function createListener(_0x617134,_0x8df936){return function(_0x17c0ea){_0x8df936[_0xd819('0x3')](_0x617134,_0x17c0ea);};}function removeListener(_0x130321,_0x39d744){return function(){MailMessageEvents[_0xd819('0x4')](_0x130321,_0x39d744);};}exports[_0xd819('0x5')]=function(_0x563680){for(var _0x38f11a=0x0,_0x346463=events[_0xd819('0x6')];_0x38f11a<_0x346463;_0x38f11a++){var _0x274172=events[_0x38f11a];var _0x33f48b=createListener('mailMessage:'+_0x274172,_0x563680);MailMessageEvents['on'](_0x274172,_0x33f48b);}}; \ No newline at end of file +var _0xb223=['save','update','emit','removeListener','register','length','mailMessage:','./mailMessage.events'];(function(_0x503564,_0x55867e){var _0x4be9fd=function(_0x41c543){while(--_0x41c543){_0x503564['push'](_0x503564['shift']());}};_0x4be9fd(++_0x55867e);}(_0xb223,0x157));var _0x3b22=function(_0x449678,_0x288abd){_0x449678=_0x449678-0x0;var _0x58ef92=_0xb223[_0x449678];return _0x58ef92;};'use strict';var MailMessageEvents=require(_0x3b22('0x0'));var events=[_0x3b22('0x1'),'remove',_0x3b22('0x2')];function createListener(_0x34bbfb,_0x1891e6){return function(_0x3fe269){_0x1891e6[_0x3b22('0x3')](_0x34bbfb,_0x3fe269);};}function removeListener(_0xd26aea,_0x3760e8){return function(){MailMessageEvents[_0x3b22('0x4')](_0xd26aea,_0x3760e8);};}exports[_0x3b22('0x5')]=function(_0xcf32b9){for(var _0x58096f=0x0,_0x2c82f8=events[_0x3b22('0x6')];_0x58096f<_0x2c82f8;_0x58096f++){var _0x134763=events[_0x58096f];var _0x846ed=createListener(_0x3b22('0x7')+_0x134763,_0xcf32b9);MailMessageEvents['on'](_0x134763,_0x846ed);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 5f885ff..083ced5 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 _0x5e01=['removeAgents','exports','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','getTeams','getAgents','post','create','/:id/teams','/:id/users','addAgents','update','delete','removeTeams'];(function(_0x368e00,_0x57ac20){var _0x2b73b5=function(_0x7efb06){while(--_0x7efb06){_0x368e00['push'](_0x368e00['shift']());}};_0x2b73b5(++_0x57ac20);}(_0x5e01,0x16e));var _0x15e0=function(_0x419e17,_0x7fe78c){_0x419e17=_0x419e17-0x0;var _0x1f2044=_0x5e01[_0x419e17];return _0x1f2044;};'use strict';var multer=require(_0x15e0('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x15e0('0x1'));var express=require(_0x15e0('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x15e0('0x3'));var interaction=require(_0x15e0('0x4'));var config=require(_0x15e0('0x5'));var controller=require('./mailQueue.controller');router[_0x15e0('0x6')]('/',auth[_0x15e0('0x7')](),controller[_0x15e0('0x8')]);router[_0x15e0('0x6')](_0x15e0('0x9'),auth[_0x15e0('0x7')](),controller[_0x15e0('0xa')]);router[_0x15e0('0x6')](_0x15e0('0xb'),auth['isAuthenticated'](),controller[_0x15e0('0xc')]);router[_0x15e0('0x6')]('/:id/members',auth['isAuthenticated'](),controller[_0x15e0('0xd')]);router['get']('/:id/teams',auth[_0x15e0('0x7')](),controller[_0x15e0('0xe')]);router['get']('/:id/users',auth[_0x15e0('0x7')](),controller[_0x15e0('0xf')]);router[_0x15e0('0x10')]('/',auth[_0x15e0('0x7')](),controller[_0x15e0('0x11')]);router[_0x15e0('0x10')](_0x15e0('0x12'),auth['isAuthenticated'](),controller['addTeams']);router[_0x15e0('0x10')](_0x15e0('0x13'),auth[_0x15e0('0x7')](),controller[_0x15e0('0x14')]);router['put']('/:id',auth[_0x15e0('0x7')](),controller[_0x15e0('0x15')]);router[_0x15e0('0x16')](_0x15e0('0xb'),auth[_0x15e0('0x7')](),controller['destroy']);router[_0x15e0('0x16')](_0x15e0('0x12'),auth[_0x15e0('0x7')](),controller[_0x15e0('0x17')]);router['delete'](_0x15e0('0x13'),auth['isAuthenticated'](),controller[_0x15e0('0x18')]);module[_0x15e0('0x19')]=router; \ No newline at end of file +var _0xf253=['getTeams','getAgents','post','addTeams','/:id/users','addAgents','delete','removeTeams','removeAgents','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','isAuthenticated','index','get','describe','/:id','show','/:id/members','/:id/teams'];(function(_0x284a61,_0x231686){var _0x220e3c=function(_0x104496){while(--_0x104496){_0x284a61['push'](_0x284a61['shift']());}};_0x220e3c(++_0x231686);}(_0xf253,0x118));var _0x3f25=function(_0x2a630f,_0x4a3ecb){_0x2a630f=_0x2a630f-0x0;var _0x12326c=_0xf253[_0x2a630f];return _0x12326c;};'use strict';var multer=require(_0x3f25('0x0'));var util=require('util');var path=require(_0x3f25('0x1'));var timeout=require(_0x3f25('0x2'));var express=require('express');var router=express[_0x3f25('0x3')]();var fs_extra=require(_0x3f25('0x4'));var auth=require(_0x3f25('0x5'));var interaction=require(_0x3f25('0x6'));var config=require(_0x3f25('0x7'));var controller=require(_0x3f25('0x8'));router['get']('/',auth[_0x3f25('0x9')](),controller[_0x3f25('0xa')]);router[_0x3f25('0xb')]('/describe',auth['isAuthenticated'](),controller[_0x3f25('0xc')]);router[_0x3f25('0xb')](_0x3f25('0xd'),auth[_0x3f25('0x9')](),controller[_0x3f25('0xe')]);router[_0x3f25('0xb')](_0x3f25('0xf'),auth[_0x3f25('0x9')](),controller['getMembers']);router[_0x3f25('0xb')](_0x3f25('0x10'),auth[_0x3f25('0x9')](),controller[_0x3f25('0x11')]);router['get']('/:id/users',auth[_0x3f25('0x9')](),controller[_0x3f25('0x12')]);router[_0x3f25('0x13')]('/',auth[_0x3f25('0x9')](),controller['create']);router[_0x3f25('0x13')](_0x3f25('0x10'),auth[_0x3f25('0x9')](),controller[_0x3f25('0x14')]);router['post'](_0x3f25('0x15'),auth[_0x3f25('0x9')](),controller[_0x3f25('0x16')]);router['put'](_0x3f25('0xd'),auth[_0x3f25('0x9')](),controller['update']);router[_0x3f25('0x17')](_0x3f25('0xd'),auth[_0x3f25('0x9')](),controller['destroy']);router[_0x3f25('0x17')](_0x3f25('0x10'),auth['isAuthenticated'](),controller[_0x3f25('0x18')]);router['delete']('/:id/users',auth[_0x3f25('0x9')](),controller[_0x3f25('0x19')]);module[_0x3f25('0x1a')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 759b535..2cf3b5b 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 _0xb0ae=['ENUM','rrmemory','beepall','roundrobin','sequelize','STRING','name'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0xb0ae,0x90));var _0xeb0a=function(_0x585505,_0x19fd7e){_0x585505=_0x585505-0x0;var _0xc5b4a5=_0xb0ae[_0x585505];return _0xc5b4a5;};'use strict';var Sequelize=require(_0xeb0a('0x0'));module['exports']={'name':{'type':Sequelize[_0xeb0a('0x1')],'unique':_0xeb0a('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xeb0a('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xeb0a('0x3')](_0xeb0a('0x4'),_0xeb0a('0x5'),_0xeb0a('0x6'))}}; \ No newline at end of file +var _0xd49a=['name','INTEGER','ENUM','rrmemory','beepall','roundrobin','exports','STRING'];(function(_0x4084b9,_0x2c43d4){var _0x54eb79=function(_0x34675c){while(--_0x34675c){_0x4084b9['push'](_0x4084b9['shift']());}};_0x54eb79(++_0x2c43d4);}(_0xd49a,0x66));var _0xad49=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd49a[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require('sequelize');module[_0xad49('0x0')]={'name':{'type':Sequelize[_0xad49('0x1')],'unique':_0xad49('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xad49('0x1')]},'timeout':{'type':Sequelize[_0xad49('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xad49('0x4')](_0xad49('0x5'),_0xad49('0x6'),_0xad49('0x7'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 4861d19..06c3494 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 _0xae3d=['pick','MailQueueId','User','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','online','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','select','field','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','every','TeamId','includes','all','union','compact','removeTeams','ids','isEmpty','removeAgents','addAgents','spread','userMailQueue:save','userMailQueue:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','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','../../config/utils','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','save','update','then','get','MailQueues','UserProfileResource','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','MailQueue','includeAll','include','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','findOne','UserMailQueue'];(function(_0xee65ee,_0x272dd1){var _0x59301a=function(_0x8ab11f){while(--_0x8ab11f){_0xee65ee['push'](_0xee65ee['shift']());}};_0x59301a(++_0x272dd1);}(_0xae3d,0x1e3));var _0xdae3=function(_0x3aaf0a,_0x450970){_0x3aaf0a=_0x3aaf0a-0x0;var _0x33e6bc=_0xae3d[_0x3aaf0a];return _0x33e6bc;};'use strict';var emlformat=require(_0xdae3('0x0'));var rimraf=require(_0xdae3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdae3('0x2'));var rp=require(_0xdae3('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdae3('0x4'));var util=require(_0xdae3('0x5'));var path=require('path');var sox=require(_0xdae3('0x6'));var csv=require(_0xdae3('0x7'));var ejs=require(_0xdae3('0x8'));var fs=require('fs');var fs_extra=require(_0xdae3('0x9'));var _=require(_0xdae3('0xa'));var squel=require(_0xdae3('0xb'));var crypto=require(_0xdae3('0xc'));var jsforce=require(_0xdae3('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xdae3('0xe'));var Papa=require(_0xdae3('0xf'));var Redis=require(_0xdae3('0x10'));var authService=require(_0xdae3('0x11'));var qs=require(_0xdae3('0x12'));var as=require(_0xdae3('0x13'));var hardwareService=require(_0xdae3('0x14'));var logger=require(_0xdae3('0x15'))('api');var utils=require(_0xdae3('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xdae3('0x17')]=_[_0xdae3('0x18')](config[_0xdae3('0x17')],{'host':_0xdae3('0x19'),'port':0x18eb});var socket=require(_0xdae3('0x1a'))(new Redis(config[_0xdae3('0x17')]));require(_0xdae3('0x1b'))[_0xdae3('0x1c')](socket);function respondWithStatusCode(_0x109ea2,_0x5b7384){_0x5b7384=_0x5b7384||0xcc;return function(_0x2df64d){if(_0x2df64d){return _0x109ea2[_0xdae3('0x1d')](_0x5b7384);}return _0x109ea2[_0xdae3('0x1e')](_0x5b7384)[_0xdae3('0x1f')]();};}function respondWithResult(_0x31560f,_0x156082){_0x156082=_0x156082||0xc8;return function(_0xee56db){if(_0xee56db){return _0x31560f[_0xdae3('0x1e')](_0x156082)[_0xdae3('0x20')](_0xee56db);}};}function respondWithFilteredResult(_0x41cf2b,_0x594a89){return function(_0x2e33dd){if(_0x2e33dd){var _0x18af98=typeof _0x594a89[_0xdae3('0x21')]===_0xdae3('0x22')&&typeof _0x594a89['limit']===_0xdae3('0x22');var _0x2ef5b3=_0x2e33dd[_0xdae3('0x23')];var _0x5f457b=_0x18af98?0x0:_0x594a89['offset'];var _0x68b5bd=_0x18af98?_0x2e33dd[_0xdae3('0x23')]:_0x594a89[_0xdae3('0x21')]+_0x594a89[_0xdae3('0x24')];var _0x57048b;if(_0x68b5bd>=_0x2ef5b3){_0x68b5bd=_0x2ef5b3;_0x57048b=0xc8;}else{_0x57048b=0xce;}_0x41cf2b[_0xdae3('0x1e')](_0x57048b);return _0x41cf2b[_0xdae3('0x25')]('Content-Range',_0x5f457b+'-'+_0x68b5bd+'/'+_0x2ef5b3)['json'](_0x2e33dd);}return null;};}function patchUpdates(_0x2c5581){return function(_0xdc709){try{jsonpatch['apply'](_0xdc709,_0x2c5581,!![]);}catch(_0x1c939f){return BPromise[_0xdae3('0x26')](_0x1c939f);}return _0xdc709[_0xdae3('0x27')]();};}function saveUpdates(_0x287109,_0x550394){return function(_0x43198c){if(_0x43198c){return _0x43198c[_0xdae3('0x28')](_0x287109)['then'](function(_0x4e816a){return _0x4e816a;});}return null;};}function removeEntity(_0x503fa5,_0x22a2be){return function(_0x4e5a7c){if(_0x4e5a7c){return _0x4e5a7c['destroy']()[_0xdae3('0x29')](function(){var _0x311d52=_0x4e5a7c[_0xdae3('0x2a')]({'plain':!![]});var _0x515659=_0xdae3('0x2b');return db[_0xdae3('0x2c')][_0xdae3('0x2d')]({'where':{'type':_0x515659,'resourceId':_0x311d52['id']}})[_0xdae3('0x29')](function(){return _0x4e5a7c;});})[_0xdae3('0x29')](function(){_0x503fa5[_0xdae3('0x1e')](0xcc)[_0xdae3('0x1f')]();});}};}function handleEntityNotFound(_0x4ce842,_0x466b2c){return function(_0x54a1ba){if(!_0x54a1ba){_0x4ce842['sendStatus'](0x194);}return _0x54a1ba;};}function handleError(_0x449aea,_0x2069a1){_0x2069a1=_0x2069a1||0x1f4;return function(_0x4b29a0){logger[_0xdae3('0x2e')](_0x4b29a0[_0xdae3('0x2f')]);if(_0x4b29a0[_0xdae3('0x30')]){delete _0x4b29a0[_0xdae3('0x30')];}_0x449aea[_0xdae3('0x1e')](_0x2069a1)[_0xdae3('0x31')](_0x4b29a0);};}exports[_0xdae3('0x32')]=function(_0x23f5a3,_0x1d69a5){var _0x5a42fc={},_0x159c7e={},_0x14bccd={'count':0x0,'rows':[]};var _0x13bba9=_[_0xdae3('0x33')](db['MailQueue'][_0xdae3('0x34')],function(_0x390461){return{'name':_0x390461[_0xdae3('0x35')],'type':_0x390461['type'][_0xdae3('0x36')]};});_0x159c7e[_0xdae3('0x37')]=_['map'](_0x13bba9,'name');_0x159c7e[_0xdae3('0x38')]=_[_0xdae3('0x39')](_0x23f5a3[_0xdae3('0x38')]);_0x159c7e[_0xdae3('0x3a')]=_[_0xdae3('0x3b')](_0x159c7e[_0xdae3('0x37')],_0x159c7e[_0xdae3('0x38')]);_0x5a42fc[_0xdae3('0x3c')]=_[_0xdae3('0x3b')](_0x159c7e[_0xdae3('0x37')],qs['fields'](_0x23f5a3[_0xdae3('0x38')][_0xdae3('0x3d')]));_0x5a42fc[_0xdae3('0x3c')]=_0x5a42fc[_0xdae3('0x3c')][_0xdae3('0x3e')]?_0x5a42fc[_0xdae3('0x3c')]:_0x159c7e['model'];if(!_0x23f5a3[_0xdae3('0x38')][_0xdae3('0x3f')](_0xdae3('0x40'))){_0x5a42fc[_0xdae3('0x24')]=qs['limit'](_0x23f5a3[_0xdae3('0x38')]['limit']);_0x5a42fc[_0xdae3('0x21')]=qs[_0xdae3('0x21')](_0x23f5a3[_0xdae3('0x38')][_0xdae3('0x21')]);}_0x5a42fc[_0xdae3('0x41')]=qs[_0xdae3('0x42')](_0x23f5a3[_0xdae3('0x38')][_0xdae3('0x42')]);_0x5a42fc[_0xdae3('0x43')]=qs['filters'](_['pick'](_0x23f5a3[_0xdae3('0x38')],_0x159c7e['filters']),_0x13bba9);if(_0x23f5a3[_0xdae3('0x38')][_0xdae3('0x44')]){_0x5a42fc['where']=_[_0xdae3('0x45')](_0x5a42fc['where'],{'$or':_['map'](_0x13bba9,function(_0x37fb42){if(_0x37fb42[_0xdae3('0x46')]!==_0xdae3('0x47')){var _0x26cbac={};_0x26cbac[_0x37fb42[_0xdae3('0x30')]]={'$like':'%'+_0x23f5a3[_0xdae3('0x38')][_0xdae3('0x44')]+'%'};return _0x26cbac;}})});}_0x5a42fc=_[_0xdae3('0x45')]({},_0x5a42fc,_0x23f5a3[_0xdae3('0x48')]);var _0x50aaa6={'where':_0x5a42fc['where']};return db[_0xdae3('0x49')]['count'](_0x50aaa6)[_0xdae3('0x29')](function(_0x2c8631){_0x14bccd['count']=_0x2c8631;if(_0x23f5a3[_0xdae3('0x38')][_0xdae3('0x4a')]){_0x5a42fc[_0xdae3('0x4b')]=[{'all':!![]}];}return db[_0xdae3('0x49')][_0xdae3('0x4c')](_0x5a42fc);})[_0xdae3('0x29')](function(_0xf2f00c){_0x14bccd[_0xdae3('0x4d')]=_0xf2f00c;return _0x14bccd;})[_0xdae3('0x29')](respondWithFilteredResult(_0x1d69a5,_0x5a42fc))[_0xdae3('0x4e')](handleError(_0x1d69a5,null));};exports[_0xdae3('0x4f')]=function(_0x9459df,_0xdbccea){var _0x20219b={'raw':!![],'where':{'id':_0x9459df[_0xdae3('0x50')]['id']}},_0x221721={};_0x221721[_0xdae3('0x37')]=_['keys'](db[_0xdae3('0x49')][_0xdae3('0x34')]);_0x221721[_0xdae3('0x38')]=_[_0xdae3('0x39')](_0x9459df[_0xdae3('0x38')]);_0x221721[_0xdae3('0x3a')]=_['intersection'](_0x221721[_0xdae3('0x37')],_0x221721[_0xdae3('0x38')]);_0x20219b['attributes']=_[_0xdae3('0x3b')](_0x221721[_0xdae3('0x37')],qs[_0xdae3('0x3d')](_0x9459df[_0xdae3('0x38')][_0xdae3('0x3d')]));_0x20219b[_0xdae3('0x3c')]=_0x20219b[_0xdae3('0x3c')][_0xdae3('0x3e')]?_0x20219b[_0xdae3('0x3c')]:_0x221721[_0xdae3('0x37')];if(_0x9459df[_0xdae3('0x38')][_0xdae3('0x4a')]){_0x20219b['include']=[{'all':!![]}];}_0x20219b=_['merge']({},_0x20219b,_0x9459df[_0xdae3('0x48')]);return db[_0xdae3('0x49')][_0xdae3('0x51')](_0x20219b)[_0xdae3('0x29')](handleEntityNotFound(_0xdbccea,null))['then'](respondWithResult(_0xdbccea,null))['catch'](handleError(_0xdbccea,null));};exports[_0xdae3('0x52')]=function(_0x10ab66,_0x1418dd){return db[_0xdae3('0x49')][_0xdae3('0x52')](_0x10ab66['body'],{})[_0xdae3('0x29')](function(_0x5df986){var _0x2c2a60=_0x10ab66[_0xdae3('0x53')]['get']({'plain':!![]});if(!_0x2c2a60)throw new Error(_0xdae3('0x54'));if(_0x2c2a60['role']===_0xdae3('0x53')){var _0x55fd8c=_0x5df986[_0xdae3('0x2a')]({'plain':!![]});var _0x1f860d=_0xdae3('0x2b');return db[_0xdae3('0x55')][_0xdae3('0x51')]({'where':{'name':_0x1f860d,'userProfileId':_0x2c2a60[_0xdae3('0x56')]},'raw':!![]})[_0xdae3('0x29')](function(_0x365e26){if(_0x365e26&&_0x365e26[_0xdae3('0x57')]===0x0){return db['UserProfileResource']['create']({'name':_0x55fd8c[_0xdae3('0x30')],'resourceId':_0x55fd8c['id'],'type':_0x365e26[_0xdae3('0x30')],'sectionId':_0x365e26['id']},{})[_0xdae3('0x29')](function(){return _0x5df986;});}else{return _0x5df986;}})[_0xdae3('0x4e')](function(_0x30fbed){logger[_0xdae3('0x2e')](_0xdae3('0x58'),_0x30fbed);throw _0x30fbed;});}return _0x5df986;})[_0xdae3('0x29')](respondWithResult(_0x1418dd,0xc9))[_0xdae3('0x4e')](handleError(_0x1418dd,null));};exports[_0xdae3('0x28')]=function(_0x4707a,_0x4c7f1d){if(_0x4707a[_0xdae3('0x59')]['id']){delete _0x4707a[_0xdae3('0x59')]['id'];}return db['MailQueue'][_0xdae3('0x51')]({'where':{'id':_0x4707a[_0xdae3('0x50')]['id']}})[_0xdae3('0x29')](handleEntityNotFound(_0x4c7f1d,null))[_0xdae3('0x29')](saveUpdates(_0x4707a[_0xdae3('0x59')],null))[_0xdae3('0x29')](respondWithResult(_0x4c7f1d,null))[_0xdae3('0x4e')](handleError(_0x4c7f1d,null));};exports['destroy']=function(_0x4a8c79,_0x34c2b5){return db[_0xdae3('0x49')][_0xdae3('0x51')]({'where':{'id':_0x4a8c79[_0xdae3('0x50')]['id']}})[_0xdae3('0x29')](handleEntityNotFound(_0x34c2b5,null))[_0xdae3('0x29')](removeEntity(_0x34c2b5,null))[_0xdae3('0x4e')](handleError(_0x34c2b5,null));};exports[_0xdae3('0x5a')]=function(_0xced5a9,_0x1a3db8){return db[_0xdae3('0x49')][_0xdae3('0x5a')]()[_0xdae3('0x29')](respondWithResult(_0x1a3db8,null))['catch'](handleError(_0x1a3db8,null));};exports['getMembers']=function(_0x2e8b83,_0x1d9afc,_0x54ce07){var _0x29f47b={'raw':!![],'where':{}},_0x5dfc1d={},_0x1c7166;return db[_0xdae3('0x49')][_0xdae3('0x5b')]({'where':{'id':_0x2e8b83[_0xdae3('0x50')]['id']}})[_0xdae3('0x29')](handleEntityNotFound(_0x1d9afc,null))[_0xdae3('0x29')](function(_0x2cd659){if(_0x2cd659){_0x1c7166=_0x2cd659[_0xdae3('0x2a')]({'plain':!![]});_0x5dfc1d['model']=_[_0xdae3('0x39')](db[_0xdae3('0x5c')][_0xdae3('0x34')]);_0x5dfc1d[_0xdae3('0x38')]=_[_0xdae3('0x39')](_0x2e8b83[_0xdae3('0x38')]);_0x5dfc1d[_0xdae3('0x3a')]=_['intersection'](_0x5dfc1d['model'],_0x5dfc1d[_0xdae3('0x38')]);_0x29f47b['attributes']=_[_0xdae3('0x3b')](_0x5dfc1d[_0xdae3('0x37')],qs[_0xdae3('0x3d')](_0x2e8b83['query']['fields']));_0x29f47b[_0xdae3('0x3c')]=_0x29f47b[_0xdae3('0x3c')][_0xdae3('0x3e')]?_0x29f47b[_0xdae3('0x3c')]:_0x5dfc1d[_0xdae3('0x37')];if(!_0x2e8b83[_0xdae3('0x38')][_0xdae3('0x3f')](_0xdae3('0x40'))){_0x29f47b[_0xdae3('0x24')]=qs['limit'](_0x2e8b83[_0xdae3('0x38')]['limit']);_0x29f47b[_0xdae3('0x21')]=qs[_0xdae3('0x21')](_0x2e8b83[_0xdae3('0x38')][_0xdae3('0x21')]);}_0x29f47b[_0xdae3('0x41')]=qs['sort'](_0x2e8b83[_0xdae3('0x38')][_0xdae3('0x42')]);_0x29f47b[_0xdae3('0x43')]=qs['filters'](_[_0xdae3('0x5d')](_0x2e8b83['query'],_0x5dfc1d[_0xdae3('0x3a')]));_0x29f47b['where'][_0xdae3('0x5e')]=_0x2cd659['id'];if(_0x2e8b83[_0xdae3('0x38')]['filter']){_0x29f47b[_0xdae3('0x43')]=_['merge'](_0x29f47b[_0xdae3('0x43')],{'$or':_['map'](_0x29f47b[_0xdae3('0x3c')],function(_0x57d168){var _0x11f677={};_0x11f677[_0x57d168]={'$like':'%'+_0x2e8b83[_0xdae3('0x38')][_0xdae3('0x44')]+'%'};return _0x11f677;})});}_0x29f47b=_['merge']({},_0x29f47b,_0x2e8b83[_0xdae3('0x48')]);return db['UserMailQueue'][_0xdae3('0x4c')](_0x29f47b);}})['then'](function(_0x10474c){if(_0x10474c){return db[_0xdae3('0x5f')][_0xdae3('0x60')]({'where':{'id':_[_0xdae3('0x33')](_0x10474c,_0xdae3('0x61')),'role':_0xdae3('0x62')},'attributes':['id','name',_0xdae3('0x63'),_0xdae3('0x64'),_0xdae3('0x65')]});}})[_0xdae3('0x29')](function(_0x3a0de8){if(_0x3a0de8){return{'count':_0x3a0de8['count'],'rows':_[_0xdae3('0x33')](_0x3a0de8[_0xdae3('0x4d')],function(_0x551ae3){return{'membername':_0x551ae3[_0xdae3('0x30')],'UserId':_0x551ae3['id'],'queue_name':_0x1c7166[_0xdae3('0x30')],'MailQueueId':_0x1c7166['id'],'interface':util[_0xdae3('0x66')](_0xdae3('0x67'),_0xdae3('0x68'),_0x551ae3[_0xdae3('0x30')]),'penalty':0x0,'paused':_0x551ae3['mailPause'],'createdAt':_0x551ae3[_0xdae3('0x65')],'updatedAt':_0x551ae3['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xdae3('0x29')](respondWithFilteredResult(_0x1d9afc,_0x29f47b))[_0xdae3('0x4e')](handleError(_0x1d9afc,null));};exports[_0xdae3('0x69')]=function(_0x58a9d1,_0x5da01f,_0x3ce88c){var _0xf79a57={};var _0x1f5234={};var _0x802df4;var _0x14357f;return db[_0xdae3('0x49')][_0xdae3('0x5b')]({'where':{'id':_0x58a9d1['params']['id']}})[_0xdae3('0x29')](handleEntityNotFound(_0x5da01f,null))['then'](function(_0x552280){if(_0x552280){_0x802df4=_0x552280;_0x1f5234[_0xdae3('0x37')]=_[_0xdae3('0x39')](db[_0xdae3('0x6a')]['rawAttributes']);_0x1f5234[_0xdae3('0x38')]=_[_0xdae3('0x39')](_0x58a9d1[_0xdae3('0x38')]);_0x1f5234[_0xdae3('0x3a')]=_[_0xdae3('0x3b')](_0x1f5234[_0xdae3('0x37')],_0x1f5234[_0xdae3('0x38')]);_0xf79a57[_0xdae3('0x3c')]=_[_0xdae3('0x3b')](_0x1f5234[_0xdae3('0x37')],qs['fields'](_0x58a9d1[_0xdae3('0x38')]['fields']));_0xf79a57[_0xdae3('0x3c')]=_0xf79a57[_0xdae3('0x3c')][_0xdae3('0x3e')]?_0xf79a57[_0xdae3('0x3c')]:_0x1f5234['model'];_0xf79a57['order']=qs[_0xdae3('0x42')](_0x58a9d1[_0xdae3('0x38')][_0xdae3('0x42')]);_0xf79a57['where']=qs['filters'](_[_0xdae3('0x5d')](_0x58a9d1['query'],_0x1f5234['filters']));if(_0x58a9d1[_0xdae3('0x38')][_0xdae3('0x44')]){_0xf79a57[_0xdae3('0x43')]=_['merge'](_0xf79a57['where'],{'$or':_['map'](_0xf79a57['attributes'],function(_0x1f2b6c){var _0x374316={};_0x374316[_0x1f2b6c]={'$like':'%'+_0x58a9d1[_0xdae3('0x38')][_0xdae3('0x44')]+'%'};return _0x374316;})});}_0xf79a57=_['merge']({},_0xf79a57,_0x58a9d1['options']);return _0x802df4[_0xdae3('0x69')](_0xf79a57);}})[_0xdae3('0x29')](function(_0x432776){if(_0x432776){_0x14357f=_0x432776[_0xdae3('0x3e')];if(!_0x58a9d1[_0xdae3('0x38')]['hasOwnProperty'](_0xdae3('0x40'))){_0xf79a57[_0xdae3('0x24')]=qs[_0xdae3('0x24')](_0x58a9d1[_0xdae3('0x38')][_0xdae3('0x24')]);_0xf79a57[_0xdae3('0x21')]=qs[_0xdae3('0x21')](_0x58a9d1[_0xdae3('0x38')][_0xdae3('0x21')]);}return _0x802df4['getTeams'](_0xf79a57);}})[_0xdae3('0x29')](function(_0x524bfd){if(_0x524bfd){return _0x524bfd?{'count':_0x14357f,'rows':_0x524bfd}:null;}})[_0xdae3('0x29')](respondWithResult(_0x5da01f,null))[_0xdae3('0x4e')](handleError(_0x5da01f,null));};exports[_0xdae3('0x6b')]=function(_0x58558e,_0x14113d,_0x357527){var _0x3229c7=_0x58558e['body']['ids'];return db[_0xdae3('0x6a')][_0xdae3('0x4c')]({'where':{'id':_0x3229c7},'attributes':['id'],'include':[{'model':db[_0xdae3('0x5f')],'as':'Agents','attributes':['id','name',_0xdae3('0x6c'),'voicePause',_0xdae3('0x6d')],'raw':!![]}]})[_0xdae3('0x29')](function(_0x32008c){if(_0x32008c){var _0x2d8840=_[_0xdae3('0x6e')](_0x32008c,function(_0x38b8d1){var _0x4116a7=_0x38b8d1['get']({'plain':!![]});return _0x4116a7[_0xdae3('0x6f')];});return db[_0xdae3('0x49')][_0xdae3('0x51')]({'where':{'id':_0x58558e['params']['id']}})[_0xdae3('0x29')](function(_0x2af4e4){return db[_0xdae3('0x70')][_0xdae3('0x71')](function(_0x492119){return _0x2af4e4[_0xdae3('0x6b')](_0x3229c7,{'transaction':_0x492119})[_0xdae3('0x29')](function(){return BPromise[_0xdae3('0x72')](_0x2d8840,function(_0x46bce8){return db['UserMailQueue'][_0xdae3('0x73')]({'where':{'UserId':_0x46bce8['id'],'MailQueueId':_0x58558e['params']['id']},'transaction':_0x492119});});})[_0xdae3('0x29')](function(){_0x2d8840[_0xdae3('0x74')](function(_0x387304){socket[_0xdae3('0x75')]('userMailQueue:save',{'UserId':_0x387304['id'],'MailQueueId':_0x2af4e4['id']});});});});});}})[_0xdae3('0x29')](respondWithStatusCode(_0x14113d,null))[_0xdae3('0x4e')](handleError(_0x14113d,null));};exports['removeTeams']=function(_0x10fb77,_0x64229a,_0x553183){return db['Team'][_0xdae3('0x4c')]({'where':{'id':_0x10fb77[_0xdae3('0x38')]['ids']},'attributes':['id'],'include':[{'model':db[_0xdae3('0x5f')],'as':_0xdae3('0x6f'),'attributes':['id'],'raw':!![]}]})[_0xdae3('0x29')](handleEntityNotFound(_0x64229a,null))[_0xdae3('0x29')](function(_0x2485d2){var _0x24432e=_[_0xdae3('0x33')](_0x2485d2,'id');var _0x22beb3=[];var _0x55fc4f=[];var _0xf73133=squel[_0xdae3('0x76')]();_0xf73133[_0xdae3('0x77')]('tq.TeamId')[_0xdae3('0x78')](_0xdae3('0x79'),'tq')[_0xdae3('0x7a')](_0xdae3('0x7b'),'ut',_0xdae3('0x7c'))[_0xdae3('0x43')](_0xdae3('0x7d'),_0x10fb77['params']['id']);for(var _0x35a7fa=0x0;_0x35a7fa<_0x2485d2['length'];_0x35a7fa+=0x1){let _0x6e44c5=_0x2485d2[_0x35a7fa];for(var _0x1486f5=0x0;_0x1486f5<_0x6e44c5['Agents'][_0xdae3('0x3e')];_0x1486f5+=0x1){let _0x22b4a9=_0x6e44c5[_0xdae3('0x6f')][_0x1486f5];var _0x5d2e11=_0xf73133[_0xdae3('0x7e')]();_0x5d2e11[_0xdae3('0x43')](_0xdae3('0x7f'),_0x22b4a9['id']);_0x55fc4f[_0xdae3('0x80')](db[_0xdae3('0x70')][_0xdae3('0x38')](_0x5d2e11['toString'](),{'type':db[_0xdae3('0x70')]['QueryTypes']['SELECT']})['then'](function(_0x29d185){if(_0x29d185[_0xdae3('0x3e')]===0x1){return _0x22b4a9['id'];}else{var _0x525a13=_[_0xdae3('0x81')](_[_0xdae3('0x33')](_0x29d185,_0xdae3('0x82')),function(_0x35ade5){return _[_0xdae3('0x83')](_0x24432e,_0x35ade5);});if(_0x525a13){return _0x22b4a9['id'];}}}));}}return BPromise[_0xdae3('0x84')](_0x55fc4f)['then'](function(_0x436149){_0x22beb3=_(_0x22beb3)[_0xdae3('0x85')](_0x436149)[_0xdae3('0x86')]()['value']();return db[_0xdae3('0x49')][_0xdae3('0x51')]({'where':{'id':_0x10fb77[_0xdae3('0x50')]['id']}})[_0xdae3('0x29')](function(_0x47edc5){return db[_0xdae3('0x70')][_0xdae3('0x71')](function(_0x2be583){return _0x47edc5[_0xdae3('0x87')](_0x10fb77[_0xdae3('0x38')][_0xdae3('0x88')],{'transaction':_0x2be583})[_0xdae3('0x29')](function(){if(!_[_0xdae3('0x89')](_0x22beb3)){return _0x47edc5[_0xdae3('0x8a')](_0x22beb3,{'transaction':_0x2be583});}})[_0xdae3('0x29')](function(){_0x22beb3[_0xdae3('0x74')](function(_0x139906){socket[_0xdae3('0x75')]('userMailQueue:remove',{'UserId':_0x139906,'MailQueueId':_0x47edc5['id']});});});});});});})[_0xdae3('0x29')](respondWithStatusCode(_0x64229a,null))[_0xdae3('0x4e')](handleError(_0x64229a,null));};exports[_0xdae3('0x8b')]=function(_0x387a86,_0x5609dc,_0x4cd8e0){return db[_0xdae3('0x49')][_0xdae3('0x51')]({'where':{'id':_0x387a86['params']['id']}})['then'](handleEntityNotFound(_0x5609dc,null))[_0xdae3('0x29')](function(_0x44b8d9){if(_0x44b8d9){return _0x44b8d9[_0xdae3('0x8b')](_0x387a86['body'][_0xdae3('0x88')],_['omit'](_0x387a86[_0xdae3('0x59')],[_0xdae3('0x88'),'id'])||{})[_0xdae3('0x8c')](function(_0x4d0908){for(var _0x320556=0x0;_0x320556<_0x387a86[_0xdae3('0x59')][_0xdae3('0x88')][_0xdae3('0x3e')];_0x320556+=0x1){socket[_0xdae3('0x75')](_0xdae3('0x8d'),{'UserId':Number(_0x387a86['body']['ids'][_0x320556]),'MailQueueId':Number(_0x387a86['params']['id'])});}return _0x4d0908;});}})['then'](respondWithResult(_0x5609dc,null))[_0xdae3('0x4e')](handleError(_0x5609dc,null));};exports[_0xdae3('0x8a')]=function(_0x474ab7,_0xf0c703,_0x83c0c3){return db[_0xdae3('0x49')][_0xdae3('0x51')]({'where':{'id':_0x474ab7[_0xdae3('0x50')]['id']}})[_0xdae3('0x29')](handleEntityNotFound(_0xf0c703,null))[_0xdae3('0x29')](function(_0x3dc6ec){if(_0x3dc6ec){return _0x3dc6ec[_0xdae3('0x8a')](_0x474ab7[_0xdae3('0x38')][_0xdae3('0x88')])['then'](function(){if(_['isArray'](_0x474ab7[_0xdae3('0x38')]['ids'])){for(var _0x5f22a1=0x0;_0x5f22a1<_0x474ab7[_0xdae3('0x38')][_0xdae3('0x88')][_0xdae3('0x3e')];_0x5f22a1+=0x1){socket[_0xdae3('0x75')](_0xdae3('0x8e'),{'UserId':Number(_0x474ab7[_0xdae3('0x38')]['ids'][_0x5f22a1]),'MailQueueId':Number(_0x474ab7['params']['id'])});}}else{socket[_0xdae3('0x75')](_0xdae3('0x8e'),{'UserId':Number(_0x474ab7[_0xdae3('0x38')]['ids']),'MailQueueId':Number(_0x474ab7[_0xdae3('0x50')]['id'])});}});}})[_0xdae3('0x29')](respondWithStatusCode(_0xf0c703,null))[_0xdae3('0x4e')](handleError(_0xf0c703,null));};exports[_0xdae3('0x8f')]=function(_0x5cf65f,_0x38f8a8,_0x45c25d){var _0xcdb870={};var _0x3e45de={};var _0x45f134;var _0x203f7c;return db[_0xdae3('0x49')]['findOne']({'where':{'id':_0x5cf65f[_0xdae3('0x50')]['id']}})[_0xdae3('0x29')](handleEntityNotFound(_0x38f8a8,null))['then'](function(_0x5a4c3a){if(_0x5a4c3a){_0x45f134=_0x5a4c3a;_0x3e45de[_0xdae3('0x37')]=_[_0xdae3('0x39')](db['User'][_0xdae3('0x34')]);_0x3e45de[_0xdae3('0x38')]=_[_0xdae3('0x39')](_0x5cf65f[_0xdae3('0x38')]);_0x3e45de[_0xdae3('0x3a')]=_['intersection'](_0x3e45de['model'],_0x3e45de[_0xdae3('0x38')]);_0xcdb870[_0xdae3('0x3c')]=_[_0xdae3('0x3b')](_0x3e45de['model'],qs[_0xdae3('0x3d')](_0x5cf65f[_0xdae3('0x38')][_0xdae3('0x3d')]));_0xcdb870['attributes']=_0xcdb870[_0xdae3('0x3c')][_0xdae3('0x3e')]?_0xcdb870[_0xdae3('0x3c')]:_0x3e45de['model'];_0xcdb870[_0xdae3('0x41')]=qs[_0xdae3('0x42')](_0x5cf65f['query']['sort']);_0xcdb870[_0xdae3('0x43')]=qs['filters'](_[_0xdae3('0x5d')](_0x5cf65f[_0xdae3('0x38')],_0x3e45de[_0xdae3('0x3a')]));if(_0x5cf65f[_0xdae3('0x38')]['filter']){_0xcdb870[_0xdae3('0x43')]=_[_0xdae3('0x45')](_0xcdb870['where'],{'$or':_['map'](_0xcdb870[_0xdae3('0x3c')],function(_0x3b66fd){var _0x14ded2={};_0x14ded2[_0x3b66fd]={'$like':'%'+_0x5cf65f[_0xdae3('0x38')][_0xdae3('0x44')]+'%'};return _0x14ded2;})});}_0xcdb870=_[_0xdae3('0x45')]({},_0xcdb870,_0x5cf65f[_0xdae3('0x48')]);return _0x45f134[_0xdae3('0x8f')](_0xcdb870);}})[_0xdae3('0x29')](function(_0x1fe25f){if(_0x1fe25f){_0x203f7c=_0x1fe25f[_0xdae3('0x3e')];if(!_0x5cf65f['query']['hasOwnProperty'](_0xdae3('0x40'))){_0xcdb870[_0xdae3('0x24')]=qs[_0xdae3('0x24')](_0x5cf65f['query'][_0xdae3('0x24')]);_0xcdb870[_0xdae3('0x21')]=qs[_0xdae3('0x21')](_0x5cf65f['query'][_0xdae3('0x21')]);}return _0x45f134[_0xdae3('0x8f')](_0xcdb870);}})['then'](function(_0x2da400){if(_0x2da400){return _0x2da400?{'count':_0x203f7c,'rows':_0x2da400}:null;}})[_0xdae3('0x29')](respondWithResult(_0x38f8a8,null))[_0xdae3('0x4e')](handleError(_0x38f8a8,null));}; \ No newline at end of file +var _0xac3d=['addAgents','spread','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','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','localhost','./mailQueue.socket','register','status','end','json','offset','undefined','limit','apply','reject','save','update','then','destroy','get','MailQueues','UserProfileResource','sendStatus','error','stack','name','send','index','map','MailQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','count','include','findAll','rows','catch','show','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserMailQueue','MailQueueId','findAndCountAll','mailPause','updatedAt','createdAt','format','SIP','getTeams','Team','addTeams','ids','User','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','userMailQueue:save','removeTeams','select','field','from','team_has_mail_queues','user_has_teams','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','isEmpty','removeAgents','emit','userMailQueue:remove'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xac3d,0x92));var _0xdac3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xac3d[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xdac3('0x0'));var rimraf=require(_0xdac3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdac3('0x2'));var rp=require(_0xdac3('0x3'));var moment=require(_0xdac3('0x4'));var BPromise=require(_0xdac3('0x5'));var Mustache=require(_0xdac3('0x6'));var util=require(_0xdac3('0x7'));var path=require(_0xdac3('0x8'));var sox=require(_0xdac3('0x9'));var csv=require('to-csv');var ejs=require(_0xdac3('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdac3('0xb'));var squel=require('squel');var crypto=require(_0xdac3('0xc'));var jsforce=require(_0xdac3('0xd'));var deskjs=require(_0xdac3('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdac3('0xf'));var Papa=require(_0xdac3('0x10'));var Redis=require(_0xdac3('0x11'));var authService=require(_0xdac3('0x12'));var qs=require(_0xdac3('0x13'));var as=require(_0xdac3('0x14'));var hardwareService=require(_0xdac3('0x15'));var logger=require(_0xdac3('0x16'))(_0xdac3('0x17'));var utils=require(_0xdac3('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xdac3('0x19'));var db=require(_0xdac3('0x1a'))['db'];config['redis']=_[_0xdac3('0x1b')](config['redis'],{'host':_0xdac3('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xdac3('0x1d'))[_0xdac3('0x1e')](socket);function respondWithStatusCode(_0x2cbb02,_0x4bd526){_0x4bd526=_0x4bd526||0xcc;return function(_0x460403){if(_0x460403){return _0x2cbb02['sendStatus'](_0x4bd526);}return _0x2cbb02[_0xdac3('0x1f')](_0x4bd526)[_0xdac3('0x20')]();};}function respondWithResult(_0x1c3620,_0x1cd502){_0x1cd502=_0x1cd502||0xc8;return function(_0x500a97){if(_0x500a97){return _0x1c3620[_0xdac3('0x1f')](_0x1cd502)[_0xdac3('0x21')](_0x500a97);}};}function respondWithFilteredResult(_0x38e602,_0x1c4b7d){return function(_0x463474){if(_0x463474){var _0x39ea72=typeof _0x1c4b7d[_0xdac3('0x22')]===_0xdac3('0x23')&&typeof _0x1c4b7d['limit']===_0xdac3('0x23');var _0x29fab9=_0x463474['count'];var _0x7185a9=_0x39ea72?0x0:_0x1c4b7d[_0xdac3('0x22')];var _0x4e17e9=_0x39ea72?_0x463474['count']:_0x1c4b7d[_0xdac3('0x22')]+_0x1c4b7d[_0xdac3('0x24')];var _0x51f9da;if(_0x4e17e9>=_0x29fab9){_0x4e17e9=_0x29fab9;_0x51f9da=0xc8;}else{_0x51f9da=0xce;}_0x38e602['status'](_0x51f9da);return _0x38e602['set']('Content-Range',_0x7185a9+'-'+_0x4e17e9+'/'+_0x29fab9)[_0xdac3('0x21')](_0x463474);}return null;};}function patchUpdates(_0x5ecb90){return function(_0x3d275c){try{jsonpatch[_0xdac3('0x25')](_0x3d275c,_0x5ecb90,!![]);}catch(_0x4fb706){return BPromise[_0xdac3('0x26')](_0x4fb706);}return _0x3d275c[_0xdac3('0x27')]();};}function saveUpdates(_0x3a8b83,_0x4b7121){return function(_0x48876c){if(_0x48876c){return _0x48876c[_0xdac3('0x28')](_0x3a8b83)[_0xdac3('0x29')](function(_0x3a4fb2){return _0x3a4fb2;});}return null;};}function removeEntity(_0x8fd1bc,_0x55b1d7){return function(_0x593039){if(_0x593039){return _0x593039[_0xdac3('0x2a')]()[_0xdac3('0x29')](function(){var _0x5c5c8a=_0x593039[_0xdac3('0x2b')]({'plain':!![]});var _0x4b3e36=_0xdac3('0x2c');return db[_0xdac3('0x2d')][_0xdac3('0x2a')]({'where':{'type':_0x4b3e36,'resourceId':_0x5c5c8a['id']}})[_0xdac3('0x29')](function(){return _0x593039;});})[_0xdac3('0x29')](function(){_0x8fd1bc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x8c0124,_0xcb1b7e){return function(_0x181534){if(!_0x181534){_0x8c0124[_0xdac3('0x2e')](0x194);}return _0x181534;};}function handleError(_0x23af13,_0x3098c8){_0x3098c8=_0x3098c8||0x1f4;return function(_0x4d07ab){logger[_0xdac3('0x2f')](_0x4d07ab[_0xdac3('0x30')]);if(_0x4d07ab[_0xdac3('0x31')]){delete _0x4d07ab[_0xdac3('0x31')];}_0x23af13['status'](_0x3098c8)[_0xdac3('0x32')](_0x4d07ab);};}exports[_0xdac3('0x33')]=function(_0x208656,_0x583080){var _0x2685db={},_0x1359d6={},_0x34582b={'count':0x0,'rows':[]};var _0x27d5e3=_[_0xdac3('0x34')](db[_0xdac3('0x35')][_0xdac3('0x36')],function(_0x3d860c){return{'name':_0x3d860c[_0xdac3('0x37')],'type':_0x3d860c[_0xdac3('0x38')][_0xdac3('0x39')]};});_0x1359d6[_0xdac3('0x3a')]=_['map'](_0x27d5e3,_0xdac3('0x31'));_0x1359d6[_0xdac3('0x3b')]=_[_0xdac3('0x3c')](_0x208656[_0xdac3('0x3b')]);_0x1359d6[_0xdac3('0x3d')]=_[_0xdac3('0x3e')](_0x1359d6[_0xdac3('0x3a')],_0x1359d6['query']);_0x2685db['attributes']=_[_0xdac3('0x3e')](_0x1359d6['model'],qs['fields'](_0x208656[_0xdac3('0x3b')][_0xdac3('0x3f')]));_0x2685db['attributes']=_0x2685db[_0xdac3('0x40')][_0xdac3('0x41')]?_0x2685db[_0xdac3('0x40')]:_0x1359d6[_0xdac3('0x3a')];if(!_0x208656[_0xdac3('0x3b')][_0xdac3('0x42')](_0xdac3('0x43'))){_0x2685db['limit']=qs[_0xdac3('0x24')](_0x208656[_0xdac3('0x3b')][_0xdac3('0x24')]);_0x2685db[_0xdac3('0x22')]=qs[_0xdac3('0x22')](_0x208656[_0xdac3('0x3b')][_0xdac3('0x22')]);}_0x2685db[_0xdac3('0x44')]=qs[_0xdac3('0x45')](_0x208656['query'][_0xdac3('0x45')]);_0x2685db[_0xdac3('0x46')]=qs[_0xdac3('0x3d')](_[_0xdac3('0x47')](_0x208656[_0xdac3('0x3b')],_0x1359d6[_0xdac3('0x3d')]),_0x27d5e3);if(_0x208656[_0xdac3('0x3b')]['filter']){_0x2685db[_0xdac3('0x46')]=_['merge'](_0x2685db[_0xdac3('0x46')],{'$or':_['map'](_0x27d5e3,function(_0x549119){if(_0x549119[_0xdac3('0x38')]!==_0xdac3('0x48')){var _0x4b2433={};_0x4b2433[_0x549119[_0xdac3('0x31')]]={'$like':'%'+_0x208656['query'][_0xdac3('0x49')]+'%'};return _0x4b2433;}})});}_0x2685db=_[_0xdac3('0x4a')]({},_0x2685db,_0x208656[_0xdac3('0x4b')]);var _0x309a3e={'where':_0x2685db['where']};return db[_0xdac3('0x35')]['count'](_0x309a3e)[_0xdac3('0x29')](function(_0x19e0af){_0x34582b[_0xdac3('0x4c')]=_0x19e0af;if(_0x208656[_0xdac3('0x3b')]['includeAll']){_0x2685db[_0xdac3('0x4d')]=[{'all':!![]}];}return db['MailQueue'][_0xdac3('0x4e')](_0x2685db);})[_0xdac3('0x29')](function(_0x4c2dd3){_0x34582b[_0xdac3('0x4f')]=_0x4c2dd3;return _0x34582b;})[_0xdac3('0x29')](respondWithFilteredResult(_0x583080,_0x2685db))[_0xdac3('0x50')](handleError(_0x583080,null));};exports[_0xdac3('0x51')]=function(_0x28a666,_0x3c703a){var _0x3b4654={'raw':!![],'where':{'id':_0x28a666[_0xdac3('0x52')]['id']}},_0x1c824c={};_0x1c824c[_0xdac3('0x3a')]=_['keys'](db[_0xdac3('0x35')][_0xdac3('0x36')]);_0x1c824c[_0xdac3('0x3b')]=_['keys'](_0x28a666['query']);_0x1c824c[_0xdac3('0x3d')]=_[_0xdac3('0x3e')](_0x1c824c[_0xdac3('0x3a')],_0x1c824c[_0xdac3('0x3b')]);_0x3b4654[_0xdac3('0x40')]=_[_0xdac3('0x3e')](_0x1c824c[_0xdac3('0x3a')],qs[_0xdac3('0x3f')](_0x28a666[_0xdac3('0x3b')]['fields']));_0x3b4654[_0xdac3('0x40')]=_0x3b4654['attributes'][_0xdac3('0x41')]?_0x3b4654[_0xdac3('0x40')]:_0x1c824c[_0xdac3('0x3a')];if(_0x28a666[_0xdac3('0x3b')]['includeAll']){_0x3b4654[_0xdac3('0x4d')]=[{'all':!![]}];}_0x3b4654=_[_0xdac3('0x4a')]({},_0x3b4654,_0x28a666[_0xdac3('0x4b')]);return db['MailQueue'][_0xdac3('0x53')](_0x3b4654)[_0xdac3('0x29')](handleEntityNotFound(_0x3c703a,null))[_0xdac3('0x29')](respondWithResult(_0x3c703a,null))[_0xdac3('0x50')](handleError(_0x3c703a,null));};exports[_0xdac3('0x54')]=function(_0x5208cb,_0x336d37){return db[_0xdac3('0x35')]['create'](_0x5208cb['body'],{})[_0xdac3('0x29')](function(_0xa1065a){var _0x2c3ed9=_0x5208cb['user']['get']({'plain':!![]});if(!_0x2c3ed9)throw new Error(_0xdac3('0x55'));if(_0x2c3ed9[_0xdac3('0x56')]==='user'){var _0x129e28=_0xa1065a[_0xdac3('0x2b')]({'plain':!![]});var _0x5e4a06=_0xdac3('0x2c');return db[_0xdac3('0x57')][_0xdac3('0x53')]({'where':{'name':_0x5e4a06,'userProfileId':_0x2c3ed9['userProfileId']},'raw':!![]})['then'](function(_0x11a4b2){if(_0x11a4b2&&_0x11a4b2[_0xdac3('0x58')]===0x0){return db[_0xdac3('0x2d')][_0xdac3('0x54')]({'name':_0x129e28['name'],'resourceId':_0x129e28['id'],'type':_0x11a4b2[_0xdac3('0x31')],'sectionId':_0x11a4b2['id']},{})[_0xdac3('0x29')](function(){return _0xa1065a;});}else{return _0xa1065a;}})[_0xdac3('0x50')](function(_0x5ef383){logger[_0xdac3('0x2f')](_0xdac3('0x59'),_0x5ef383);throw _0x5ef383;});}return _0xa1065a;})[_0xdac3('0x29')](respondWithResult(_0x336d37,0xc9))[_0xdac3('0x50')](handleError(_0x336d37,null));};exports[_0xdac3('0x28')]=function(_0x265954,_0x25360a){if(_0x265954[_0xdac3('0x5a')]['id']){delete _0x265954[_0xdac3('0x5a')]['id'];}return db[_0xdac3('0x35')][_0xdac3('0x53')]({'where':{'id':_0x265954[_0xdac3('0x52')]['id']}})[_0xdac3('0x29')](handleEntityNotFound(_0x25360a,null))[_0xdac3('0x29')](saveUpdates(_0x265954['body'],null))['then'](respondWithResult(_0x25360a,null))[_0xdac3('0x50')](handleError(_0x25360a,null));};exports[_0xdac3('0x2a')]=function(_0x2c0f09,_0x19287b){return db['MailQueue'][_0xdac3('0x53')]({'where':{'id':_0x2c0f09[_0xdac3('0x52')]['id']}})[_0xdac3('0x29')](handleEntityNotFound(_0x19287b,null))[_0xdac3('0x29')](removeEntity(_0x19287b,null))[_0xdac3('0x50')](handleError(_0x19287b,null));};exports['describe']=function(_0x467ba1,_0x437c4f){return db['MailQueue'][_0xdac3('0x5b')]()[_0xdac3('0x29')](respondWithResult(_0x437c4f,null))[_0xdac3('0x50')](handleError(_0x437c4f,null));};exports[_0xdac3('0x5c')]=function(_0x41a8aa,_0x31f6fb,_0x5e3a62){var _0x50b76c={'raw':!![],'where':{}},_0x33e40a={},_0x1cab78;return db['MailQueue'][_0xdac3('0x5d')]({'where':{'id':_0x41a8aa['params']['id']}})[_0xdac3('0x29')](handleEntityNotFound(_0x31f6fb,null))[_0xdac3('0x29')](function(_0x54bec0){if(_0x54bec0){_0x1cab78=_0x54bec0[_0xdac3('0x2b')]({'plain':!![]});_0x33e40a[_0xdac3('0x3a')]=_[_0xdac3('0x3c')](db[_0xdac3('0x5e')][_0xdac3('0x36')]);_0x33e40a['query']=_[_0xdac3('0x3c')](_0x41a8aa['query']);_0x33e40a[_0xdac3('0x3d')]=_['intersection'](_0x33e40a[_0xdac3('0x3a')],_0x33e40a['query']);_0x50b76c['attributes']=_[_0xdac3('0x3e')](_0x33e40a[_0xdac3('0x3a')],qs['fields'](_0x41a8aa[_0xdac3('0x3b')][_0xdac3('0x3f')]));_0x50b76c[_0xdac3('0x40')]=_0x50b76c['attributes'][_0xdac3('0x41')]?_0x50b76c['attributes']:_0x33e40a['model'];if(!_0x41a8aa[_0xdac3('0x3b')][_0xdac3('0x42')]('nolimit')){_0x50b76c[_0xdac3('0x24')]=qs[_0xdac3('0x24')](_0x41a8aa[_0xdac3('0x3b')][_0xdac3('0x24')]);_0x50b76c['offset']=qs[_0xdac3('0x22')](_0x41a8aa[_0xdac3('0x3b')][_0xdac3('0x22')]);}_0x50b76c['order']=qs['sort'](_0x41a8aa[_0xdac3('0x3b')]['sort']);_0x50b76c[_0xdac3('0x46')]=qs[_0xdac3('0x3d')](_[_0xdac3('0x47')](_0x41a8aa[_0xdac3('0x3b')],_0x33e40a[_0xdac3('0x3d')]));_0x50b76c[_0xdac3('0x46')][_0xdac3('0x5f')]=_0x54bec0['id'];if(_0x41a8aa[_0xdac3('0x3b')][_0xdac3('0x49')]){_0x50b76c['where']=_[_0xdac3('0x4a')](_0x50b76c[_0xdac3('0x46')],{'$or':_[_0xdac3('0x34')](_0x50b76c[_0xdac3('0x40')],function(_0x1d3d8c){var _0x54e4f7={};_0x54e4f7[_0x1d3d8c]={'$like':'%'+_0x41a8aa[_0xdac3('0x3b')][_0xdac3('0x49')]+'%'};return _0x54e4f7;})});}_0x50b76c=_[_0xdac3('0x4a')]({},_0x50b76c,_0x41a8aa[_0xdac3('0x4b')]);return db[_0xdac3('0x5e')]['findAll'](_0x50b76c);}})['then'](function(_0x44b1c9){if(_0x44b1c9){return db['User'][_0xdac3('0x60')]({'where':{'id':_[_0xdac3('0x34')](_0x44b1c9,'UserId'),'role':'agent'},'attributes':['id','name',_0xdac3('0x61'),_0xdac3('0x62'),_0xdac3('0x63')]});}})[_0xdac3('0x29')](function(_0x2b3781){if(_0x2b3781){return{'count':_0x2b3781[_0xdac3('0x4c')],'rows':_['map'](_0x2b3781[_0xdac3('0x4f')],function(_0x41f00f){return{'membername':_0x41f00f[_0xdac3('0x31')],'UserId':_0x41f00f['id'],'queue_name':_0x1cab78[_0xdac3('0x31')],'MailQueueId':_0x1cab78['id'],'interface':util[_0xdac3('0x64')]('%s/%s',_0xdac3('0x65'),_0x41f00f['name']),'penalty':0x0,'paused':_0x41f00f[_0xdac3('0x61')],'createdAt':_0x41f00f['createdAt'],'updatedAt':_0x41f00f[_0xdac3('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xdac3('0x29')](respondWithFilteredResult(_0x31f6fb,_0x50b76c))[_0xdac3('0x50')](handleError(_0x31f6fb,null));};exports[_0xdac3('0x66')]=function(_0x27531c,_0x4183d6,_0x53f8b3){var _0x3fcb7b={};var _0x5dffdc={};var _0x44189f;var _0x20c046;return db['MailQueue'][_0xdac3('0x5d')]({'where':{'id':_0x27531c[_0xdac3('0x52')]['id']}})['then'](handleEntityNotFound(_0x4183d6,null))[_0xdac3('0x29')](function(_0xe1a709){if(_0xe1a709){_0x44189f=_0xe1a709;_0x5dffdc[_0xdac3('0x3a')]=_[_0xdac3('0x3c')](db[_0xdac3('0x67')][_0xdac3('0x36')]);_0x5dffdc[_0xdac3('0x3b')]=_[_0xdac3('0x3c')](_0x27531c['query']);_0x5dffdc['filters']=_[_0xdac3('0x3e')](_0x5dffdc['model'],_0x5dffdc[_0xdac3('0x3b')]);_0x3fcb7b[_0xdac3('0x40')]=_[_0xdac3('0x3e')](_0x5dffdc[_0xdac3('0x3a')],qs[_0xdac3('0x3f')](_0x27531c[_0xdac3('0x3b')][_0xdac3('0x3f')]));_0x3fcb7b[_0xdac3('0x40')]=_0x3fcb7b[_0xdac3('0x40')]['length']?_0x3fcb7b['attributes']:_0x5dffdc['model'];_0x3fcb7b[_0xdac3('0x44')]=qs['sort'](_0x27531c[_0xdac3('0x3b')]['sort']);_0x3fcb7b[_0xdac3('0x46')]=qs[_0xdac3('0x3d')](_[_0xdac3('0x47')](_0x27531c[_0xdac3('0x3b')],_0x5dffdc[_0xdac3('0x3d')]));if(_0x27531c[_0xdac3('0x3b')][_0xdac3('0x49')]){_0x3fcb7b['where']=_[_0xdac3('0x4a')](_0x3fcb7b[_0xdac3('0x46')],{'$or':_[_0xdac3('0x34')](_0x3fcb7b[_0xdac3('0x40')],function(_0x2aafc9){var _0x1bf74f={};_0x1bf74f[_0x2aafc9]={'$like':'%'+_0x27531c['query'][_0xdac3('0x49')]+'%'};return _0x1bf74f;})});}_0x3fcb7b=_[_0xdac3('0x4a')]({},_0x3fcb7b,_0x27531c['options']);return _0x44189f[_0xdac3('0x66')](_0x3fcb7b);}})[_0xdac3('0x29')](function(_0x4913e6){if(_0x4913e6){_0x20c046=_0x4913e6[_0xdac3('0x41')];if(!_0x27531c['query'][_0xdac3('0x42')](_0xdac3('0x43'))){_0x3fcb7b['limit']=qs[_0xdac3('0x24')](_0x27531c[_0xdac3('0x3b')]['limit']);_0x3fcb7b[_0xdac3('0x22')]=qs[_0xdac3('0x22')](_0x27531c[_0xdac3('0x3b')]['offset']);}return _0x44189f['getTeams'](_0x3fcb7b);}})[_0xdac3('0x29')](function(_0xbde181){if(_0xbde181){return _0xbde181?{'count':_0x20c046,'rows':_0xbde181}:null;}})[_0xdac3('0x29')](respondWithResult(_0x4183d6,null))[_0xdac3('0x50')](handleError(_0x4183d6,null));};exports[_0xdac3('0x68')]=function(_0xe37b44,_0x38cee3,_0x292c2e){var _0x203361=_0xe37b44[_0xdac3('0x5a')][_0xdac3('0x69')];return db[_0xdac3('0x67')][_0xdac3('0x4e')]({'where':{'id':_0x203361},'attributes':['id'],'include':[{'model':db[_0xdac3('0x6a')],'as':_0xdac3('0x6b'),'attributes':['id',_0xdac3('0x31'),_0xdac3('0x6c'),_0xdac3('0x6d'),_0xdac3('0x6e')],'raw':!![]}]})[_0xdac3('0x29')](function(_0x5de12c){if(_0x5de12c){var _0x5d89b8=_['flatMap'](_0x5de12c,function(_0x51c042){var _0x214b36=_0x51c042['get']({'plain':!![]});return _0x214b36[_0xdac3('0x6b')];});return db[_0xdac3('0x35')]['find']({'where':{'id':_0xe37b44[_0xdac3('0x52')]['id']}})[_0xdac3('0x29')](function(_0x33b757){return db[_0xdac3('0x6f')][_0xdac3('0x70')](function(_0x3fdf78){return _0x33b757['addTeams'](_0x203361,{'transaction':_0x3fdf78})['then'](function(){return BPromise[_0xdac3('0x71')](_0x5d89b8,function(_0x4accc3){return db['UserMailQueue'][_0xdac3('0x72')]({'where':{'UserId':_0x4accc3['id'],'MailQueueId':_0xe37b44['params']['id']},'transaction':_0x3fdf78});});})[_0xdac3('0x29')](function(){_0x5d89b8[_0xdac3('0x73')](function(_0x3765b9){socket['emit'](_0xdac3('0x74'),{'UserId':_0x3765b9['id'],'MailQueueId':_0x33b757['id']});});});});});}})['then'](respondWithStatusCode(_0x38cee3,null))[_0xdac3('0x50')](handleError(_0x38cee3,null));};exports[_0xdac3('0x75')]=function(_0x418259,_0x3a7577,_0x397f9e){return db[_0xdac3('0x67')][_0xdac3('0x4e')]({'where':{'id':_0x418259[_0xdac3('0x3b')][_0xdac3('0x69')]},'attributes':['id'],'include':[{'model':db[_0xdac3('0x6a')],'as':_0xdac3('0x6b'),'attributes':['id'],'raw':!![]}]})[_0xdac3('0x29')](handleEntityNotFound(_0x3a7577,null))[_0xdac3('0x29')](function(_0x1e8f9e){var _0x4f66a4=_[_0xdac3('0x34')](_0x1e8f9e,'id');var _0x34a065=[];var _0x58a6ac=[];var _0x5c835f=squel[_0xdac3('0x76')]();_0x5c835f[_0xdac3('0x77')]('tq.TeamId')[_0xdac3('0x78')](_0xdac3('0x79'),'tq')['join'](_0xdac3('0x7a'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xdac3('0x46')](_0xdac3('0x7b'),_0x418259[_0xdac3('0x52')]['id']);for(var _0x3286f1=0x0;_0x3286f1<_0x1e8f9e[_0xdac3('0x41')];_0x3286f1+=0x1){let _0x376338=_0x1e8f9e[_0x3286f1];for(var _0x5f1440=0x0;_0x5f1440<_0x376338[_0xdac3('0x6b')][_0xdac3('0x41')];_0x5f1440+=0x1){let _0x3ca1ab=_0x376338[_0xdac3('0x6b')][_0x5f1440];var _0x175614=_0x5c835f[_0xdac3('0x7c')]();_0x175614[_0xdac3('0x46')](_0xdac3('0x7d'),_0x3ca1ab['id']);_0x58a6ac[_0xdac3('0x7e')](db[_0xdac3('0x6f')][_0xdac3('0x3b')](_0x175614[_0xdac3('0x7f')](),{'type':db[_0xdac3('0x6f')][_0xdac3('0x80')][_0xdac3('0x81')]})[_0xdac3('0x29')](function(_0x3b8edf){if(_0x3b8edf[_0xdac3('0x41')]===0x1){return _0x3ca1ab['id'];}else{var _0x101fcc=_[_0xdac3('0x82')](_[_0xdac3('0x34')](_0x3b8edf,_0xdac3('0x83')),function(_0x4cacbb){return _['includes'](_0x4f66a4,_0x4cacbb);});if(_0x101fcc){return _0x3ca1ab['id'];}}}));}}return BPromise[_0xdac3('0x84')](_0x58a6ac)['then'](function(_0xa1d7ce){_0x34a065=_(_0x34a065)[_0xdac3('0x85')](_0xa1d7ce)[_0xdac3('0x86')]()[_0xdac3('0x87')]();return db['MailQueue'][_0xdac3('0x53')]({'where':{'id':_0x418259[_0xdac3('0x52')]['id']}})[_0xdac3('0x29')](function(_0x243324){return db[_0xdac3('0x6f')]['transaction'](function(_0x19738f){return _0x243324[_0xdac3('0x75')](_0x418259[_0xdac3('0x3b')][_0xdac3('0x69')],{'transaction':_0x19738f})['then'](function(){if(!_[_0xdac3('0x88')](_0x34a065)){return _0x243324[_0xdac3('0x89')](_0x34a065,{'transaction':_0x19738f});}})[_0xdac3('0x29')](function(){_0x34a065[_0xdac3('0x73')](function(_0x2765b3){socket[_0xdac3('0x8a')](_0xdac3('0x8b'),{'UserId':_0x2765b3,'MailQueueId':_0x243324['id']});});});});});});})[_0xdac3('0x29')](respondWithStatusCode(_0x3a7577,null))['catch'](handleError(_0x3a7577,null));};exports[_0xdac3('0x8c')]=function(_0x145970,_0x4f365b,_0x2ebadb){return db[_0xdac3('0x35')][_0xdac3('0x53')]({'where':{'id':_0x145970[_0xdac3('0x52')]['id']}})[_0xdac3('0x29')](handleEntityNotFound(_0x4f365b,null))[_0xdac3('0x29')](function(_0x52fd79){if(_0x52fd79){return _0x52fd79[_0xdac3('0x8c')](_0x145970[_0xdac3('0x5a')]['ids'],_['omit'](_0x145970['body'],[_0xdac3('0x69'),'id'])||{})[_0xdac3('0x8d')](function(_0x25a24){for(var _0x4b852b=0x0;_0x4b852b<_0x145970[_0xdac3('0x5a')][_0xdac3('0x69')]['length'];_0x4b852b+=0x1){socket[_0xdac3('0x8a')]('userMailQueue:save',{'UserId':Number(_0x145970[_0xdac3('0x5a')][_0xdac3('0x69')][_0x4b852b]),'MailQueueId':Number(_0x145970[_0xdac3('0x52')]['id'])});}return _0x25a24;});}})[_0xdac3('0x29')](respondWithResult(_0x4f365b,null))['catch'](handleError(_0x4f365b,null));};exports[_0xdac3('0x89')]=function(_0x2ab2ec,_0xc1bc3d,_0x3d1e14){return db[_0xdac3('0x35')][_0xdac3('0x53')]({'where':{'id':_0x2ab2ec[_0xdac3('0x52')]['id']}})[_0xdac3('0x29')](handleEntityNotFound(_0xc1bc3d,null))[_0xdac3('0x29')](function(_0x36c6a0){if(_0x36c6a0){return _0x36c6a0['removeAgents'](_0x2ab2ec[_0xdac3('0x3b')][_0xdac3('0x69')])['then'](function(){if(_['isArray'](_0x2ab2ec[_0xdac3('0x3b')]['ids'])){for(var _0x48e543=0x0;_0x48e543<_0x2ab2ec[_0xdac3('0x3b')][_0xdac3('0x69')]['length'];_0x48e543+=0x1){socket[_0xdac3('0x8a')](_0xdac3('0x8b'),{'UserId':Number(_0x2ab2ec[_0xdac3('0x3b')]['ids'][_0x48e543]),'MailQueueId':Number(_0x2ab2ec[_0xdac3('0x52')]['id'])});}}else{socket[_0xdac3('0x8a')](_0xdac3('0x8b'),{'UserId':Number(_0x2ab2ec[_0xdac3('0x3b')][_0xdac3('0x69')]),'MailQueueId':Number(_0x2ab2ec['params']['id'])});}});}})['then'](respondWithStatusCode(_0xc1bc3d,null))[_0xdac3('0x50')](handleError(_0xc1bc3d,null));};exports[_0xdac3('0x8e')]=function(_0x2f0a93,_0x574974,_0x27a499){var _0x1d1a08={};var _0x4fb7d0={};var _0x47081e;var _0x1d5a2e;return db['MailQueue']['findOne']({'where':{'id':_0x2f0a93[_0xdac3('0x52')]['id']}})[_0xdac3('0x29')](handleEntityNotFound(_0x574974,null))[_0xdac3('0x29')](function(_0x56732e){if(_0x56732e){_0x47081e=_0x56732e;_0x4fb7d0[_0xdac3('0x3a')]=_[_0xdac3('0x3c')](db[_0xdac3('0x6a')]['rawAttributes']);_0x4fb7d0['query']=_['keys'](_0x2f0a93[_0xdac3('0x3b')]);_0x4fb7d0[_0xdac3('0x3d')]=_[_0xdac3('0x3e')](_0x4fb7d0[_0xdac3('0x3a')],_0x4fb7d0[_0xdac3('0x3b')]);_0x1d1a08[_0xdac3('0x40')]=_[_0xdac3('0x3e')](_0x4fb7d0[_0xdac3('0x3a')],qs['fields'](_0x2f0a93[_0xdac3('0x3b')][_0xdac3('0x3f')]));_0x1d1a08['attributes']=_0x1d1a08['attributes']['length']?_0x1d1a08[_0xdac3('0x40')]:_0x4fb7d0['model'];_0x1d1a08[_0xdac3('0x44')]=qs[_0xdac3('0x45')](_0x2f0a93[_0xdac3('0x3b')]['sort']);_0x1d1a08[_0xdac3('0x46')]=qs[_0xdac3('0x3d')](_['pick'](_0x2f0a93[_0xdac3('0x3b')],_0x4fb7d0['filters']));if(_0x2f0a93[_0xdac3('0x3b')][_0xdac3('0x49')]){_0x1d1a08['where']=_[_0xdac3('0x4a')](_0x1d1a08[_0xdac3('0x46')],{'$or':_['map'](_0x1d1a08[_0xdac3('0x40')],function(_0x712a56){var _0x13f201={};_0x13f201[_0x712a56]={'$like':'%'+_0x2f0a93[_0xdac3('0x3b')][_0xdac3('0x49')]+'%'};return _0x13f201;})});}_0x1d1a08=_['merge']({},_0x1d1a08,_0x2f0a93['options']);return _0x47081e[_0xdac3('0x8e')](_0x1d1a08);}})[_0xdac3('0x29')](function(_0x54fc2c){if(_0x54fc2c){_0x1d5a2e=_0x54fc2c[_0xdac3('0x41')];if(!_0x2f0a93[_0xdac3('0x3b')][_0xdac3('0x42')](_0xdac3('0x43'))){_0x1d1a08['limit']=qs[_0xdac3('0x24')](_0x2f0a93[_0xdac3('0x3b')][_0xdac3('0x24')]);_0x1d1a08[_0xdac3('0x22')]=qs[_0xdac3('0x22')](_0x2f0a93[_0xdac3('0x3b')][_0xdac3('0x22')]);}return _0x47081e[_0xdac3('0x8e')](_0x1d1a08);}})[_0xdac3('0x29')](function(_0x268fd1){if(_0x268fd1){return _0x268fd1?{'count':_0x1d5a2e,'rows':_0x268fd1}:null;}})[_0xdac3('0x29')](respondWithResult(_0x574974,null))[_0xdac3('0x50')](handleError(_0x574974,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 2ae26d6..089fda7 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 _0xac89=['hook','exports','../../mysqldb','MailQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x41d5a2,_0x403560){var _0x23d761=function(_0x40d036){while(--_0x40d036){_0x41d5a2['push'](_0x41d5a2['shift']());}};_0x23d761(++_0x403560);}(_0xac89,0x11a));var _0x9ac8=function(_0x57ead5,_0x3a74fa){_0x57ead5=_0x57ead5-0x0;var _0xf2c535=_0xac89[_0x57ead5];return _0xf2c535;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x9ac8('0x0'))['db'][_0x9ac8('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x9ac8('0x2')](0x0);var events={'afterCreate':_0x9ac8('0x3'),'afterUpdate':_0x9ac8('0x4'),'afterDestroy':_0x9ac8('0x5')};function emitEvent(_0x1dae0a){return function(_0x5c1adc,_0x3fc3d1,_0x4ffd1d){MailQueueEvents['emit'](_0x1dae0a+':'+_0x5c1adc['id'],_0x5c1adc);MailQueueEvents[_0x9ac8('0x6')](_0x1dae0a,_0x5c1adc);_0x4ffd1d(null);};}for(var e in events){if(events[_0x9ac8('0x7')](e)){var event=events[e];MailQueue[_0x9ac8('0x8')](e,emitEvent(event));}}module[_0x9ac8('0x9')]=MailQueueEvents; \ No newline at end of file +var _0x6bd9=['events','../../mysqldb','MailQueue','setMaxListeners','remove','emit','exports'];(function(_0x1477cf,_0xa2f31d){var _0xe3e3ac=function(_0x22b11b){while(--_0x22b11b){_0x1477cf['push'](_0x1477cf['shift']());}};_0xe3e3ac(++_0xa2f31d);}(_0x6bd9,0x1b9));var _0x96bd=function(_0x272daa,_0x558504){_0x272daa=_0x272daa-0x0;var _0x32a696=_0x6bd9[_0x272daa];return _0x32a696;};'use strict';var EventEmitter=require(_0x96bd('0x0'));var MailQueue=require(_0x96bd('0x1'))['db'][_0x96bd('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x96bd('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x96bd('0x4')};function emitEvent(_0x5d0c18){return function(_0x254cf0,_0x337e3d,_0x243527){MailQueueEvents[_0x96bd('0x5')](_0x5d0c18+':'+_0x254cf0['id'],_0x254cf0);MailQueueEvents[_0x96bd('0x5')](_0x5d0c18,_0x254cf0);_0x243527(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0x96bd('0x6')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index ec07965..ba7f408 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 _0xb822=['./mailQueue.attributes','exports','define','MailQueue','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x3bc3a0,_0x4306e3){var _0x2d2ca2=function(_0x5847f2){while(--_0x5847f2){_0x3bc3a0['push'](_0x3bc3a0['shift']());}};_0x2d2ca2(++_0x4306e3);}(_0xb822,0x178));var _0x2b82=function(_0x5bba1e,_0x2f5684){_0x5bba1e=_0x5bba1e-0x0;var _0x556314=_0xb822[_0x5bba1e];return _0x556314;};'use strict';var _=require(_0x2b82('0x0'));var util=require(_0x2b82('0x1'));var logger=require(_0x2b82('0x2'))('api');var moment=require(_0x2b82('0x3'));var BPromise=require(_0x2b82('0x4'));var rp=require(_0x2b82('0x5'));var fs=require('fs');var path=require(_0x2b82('0x6'));var rimraf=require('rimraf');var config=require(_0x2b82('0x7'));var attributes=require(_0x2b82('0x8'));module[_0x2b82('0x9')]=function(_0x444fb5,_0x3c13bd){return _0x444fb5[_0x2b82('0xa')](_0x2b82('0xb'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xecee=['request-promise','path','../../config/environment','./mailQueue.attributes','exports','define','MailQueue','mail_queues','lodash','../../config/logger','api','bluebird'];(function(_0x3117e9,_0x95f92){var _0x547ddb=function(_0x2c491f){while(--_0x2c491f){_0x3117e9['push'](_0x3117e9['shift']());}};_0x547ddb(++_0x95f92);}(_0xecee,0x170));var _0xeece=function(_0x2d9020,_0x5c77fa){_0x2d9020=_0x2d9020-0x0;var _0x325e1f=_0xecee[_0x2d9020];return _0x325e1f;};'use strict';var _=require(_0xeece('0x0'));var util=require('util');var logger=require(_0xeece('0x1'))(_0xeece('0x2'));var moment=require('moment');var BPromise=require(_0xeece('0x3'));var rp=require(_0xeece('0x4'));var fs=require('fs');var path=require(_0xeece('0x5'));var rimraf=require('rimraf');var config=require(_0xeece('0x6'));var attributes=require(_0xeece('0x7'));module[_0xeece('0x8')]=function(_0x3ee051,_0x54d05f){return _0x3ee051[_0xeece('0x9')](_0xeece('0xa'),attributes,{'tableName':_0xeece('0xb'),'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 d5d489e..aadaeca 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 _0x3d76=['request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetMailQueue','MailQueue','findAll','options','raw','attributes','limit','map','include','model','then','stringify','ShowMailQueue','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','info','MailQueue,\x20%s,\x20%s'];(function(_0x2d2e85,_0x22faa9){var _0x3e9f5e=function(_0x101c22){while(--_0x101c22){_0x2d2e85['push'](_0x2d2e85['shift']());}};_0x3e9f5e(++_0x22faa9);}(_0x3d76,0x13c));var _0x63d7=function(_0x41886e,_0x2f9b3e){_0x41886e=_0x41886e-0x0;var _0x10e7f4=_0x3d76[_0x41886e];return _0x10e7f4;};'use strict';var _=require(_0x63d7('0x0'));var util=require(_0x63d7('0x1'));var moment=require(_0x63d7('0x2'));var BPromise=require(_0x63d7('0x3'));var rs=require(_0x63d7('0x4'));var fs=require('fs');var Redis=require(_0x63d7('0x5'));var db=require(_0x63d7('0x6'))['db'];var utils=require(_0x63d7('0x7'));var logger=require(_0x63d7('0x8'))(_0x63d7('0x9'));var config=require('../../config/environment');var jayson=require(_0x63d7('0xa'));var client=jayson[_0x63d7('0xb')][_0x63d7('0xc')]({'port':0x232a});config[_0x63d7('0xd')]=_[_0x63d7('0xe')](config[_0x63d7('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x63d7('0xf'))(new Redis(config[_0x63d7('0xd')]));require('./mailQueue.socket')[_0x63d7('0x10')](socket);function respondWithRpcPromise(_0x5d73f5,_0x4b5156,_0x2ffba9){return new BPromise(function(_0x40fe82,_0x3a31bd){return client[_0x63d7('0x11')](_0x5d73f5,_0x2ffba9)['then'](function(_0x49b99a){logger[_0x63d7('0x12')](_0x63d7('0x13'),_0x4b5156,_0x63d7('0x14'));logger[_0x63d7('0x15')](_0x63d7('0x16'),_0x4b5156,_0x63d7('0x14'),JSON['stringify'](_0x49b99a));if(_0x49b99a[_0x63d7('0x17')]){if(_0x49b99a[_0x63d7('0x17')][_0x63d7('0x18')]===0x1f4){logger[_0x63d7('0x17')](_0x63d7('0x13'),_0x4b5156,_0x49b99a[_0x63d7('0x17')][_0x63d7('0x19')]);return _0x3a31bd(_0x49b99a['error'][_0x63d7('0x19')]);}logger[_0x63d7('0x17')](_0x63d7('0x13'),_0x4b5156,_0x49b99a[_0x63d7('0x17')]['message']);return _0x40fe82(_0x49b99a[_0x63d7('0x17')][_0x63d7('0x19')]);}else{logger[_0x63d7('0x12')](_0x63d7('0x13'),_0x4b5156,_0x63d7('0x14'));_0x40fe82(_0x49b99a[_0x63d7('0x1a')][_0x63d7('0x19')]);}})[_0x63d7('0x1b')](function(_0x41d468){logger[_0x63d7('0x17')](_0x63d7('0x13'),_0x4b5156,_0x41d468);_0x3a31bd(_0x41d468);});});}exports[_0x63d7('0x1c')]=function(_0x31b268){var _0x351920=this;return new Promise(function(_0xbd7613,_0x414f15){return db[_0x63d7('0x1d')][_0x63d7('0x1e')]({'raw':_0x31b268[_0x63d7('0x1f')]?_0x31b268['options'][_0x63d7('0x20')]===undefined?!![]:![]:!![],'where':_0x31b268[_0x63d7('0x1f')]?_0x31b268['options']['where']||null:null,'attributes':_0x31b268[_0x63d7('0x1f')]?_0x31b268[_0x63d7('0x1f')][_0x63d7('0x21')]||null:null,'limit':_0x31b268[_0x63d7('0x1f')]?_0x31b268['options'][_0x63d7('0x22')]||null:null,'include':_0x31b268[_0x63d7('0x1f')]?_0x31b268[_0x63d7('0x1f')]['include']?_[_0x63d7('0x23')](_0x31b268['options'][_0x63d7('0x24')],function(_0x4fab97){return{'model':db[_0x4fab97[_0x63d7('0x25')]],'as':_0x4fab97['as'],'attributes':_0x4fab97[_0x63d7('0x21')],'include':_0x4fab97[_0x63d7('0x24')]?_[_0x63d7('0x23')](_0x4fab97['include'],function(_0x12d759){return{'model':db[_0x12d759[_0x63d7('0x25')]],'as':_0x12d759['as'],'attributes':_0x12d759['attributes'],'include':_0x12d759[_0x63d7('0x24')]?_[_0x63d7('0x23')](_0x12d759['include'],function(_0x2f02bc){return{'model':db[_0x2f02bc['model']],'as':_0x2f02bc['as'],'attributes':_0x2f02bc['attributes']};}):[]};}):[]};}):[]:[]})[_0x63d7('0x26')](function(_0x4a85a8){logger[_0x63d7('0x12')](_0x63d7('0x1c'),_0x31b268);logger[_0x63d7('0x15')](_0x63d7('0x1c'),_0x31b268,JSON[_0x63d7('0x27')](_0x4a85a8));_0xbd7613(_0x4a85a8);})[_0x63d7('0x1b')](function(_0x1fe1d8){logger[_0x63d7('0x17')]('GetMailQueue',_0x1fe1d8[_0x63d7('0x19')],_0x31b268);_0x414f15(_0x351920[_0x63d7('0x17')](0x1f4,_0x1fe1d8[_0x63d7('0x19')]));});});};exports[_0x63d7('0x28')]=function(_0xad763f){var _0x45509e=this;return new Promise(function(_0xc2df4c,_0x50f7ba){return db[_0x63d7('0x1d')]['find']({'raw':_0xad763f[_0x63d7('0x1f')]?_0xad763f[_0x63d7('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0xad763f[_0x63d7('0x1f')]?_0xad763f['options'][_0x63d7('0x29')]||null:null,'attributes':_0xad763f[_0x63d7('0x1f')]?_0xad763f[_0x63d7('0x1f')][_0x63d7('0x21')]||null:null,'include':_0xad763f['options']?_0xad763f[_0x63d7('0x1f')][_0x63d7('0x24')]?_[_0x63d7('0x23')](_0xad763f[_0x63d7('0x1f')]['include'],function(_0x2b19d1){return{'model':db[_0x2b19d1[_0x63d7('0x25')]],'as':_0x2b19d1['as'],'attributes':_0x2b19d1[_0x63d7('0x21')],'include':_0x2b19d1[_0x63d7('0x24')]?_[_0x63d7('0x23')](_0x2b19d1[_0x63d7('0x24')],function(_0x34400f){return{'model':db[_0x34400f[_0x63d7('0x25')]],'as':_0x34400f['as'],'attributes':_0x34400f['attributes'],'include':_0x34400f['include']?_[_0x63d7('0x23')](_0x34400f[_0x63d7('0x24')],function(_0xa456c9){return{'model':db[_0xa456c9[_0x63d7('0x25')]],'as':_0xa456c9['as'],'attributes':_0xa456c9[_0x63d7('0x21')]};}):[]};}):[]};}):[]:[]})[_0x63d7('0x26')](function(_0x10c4ab){logger[_0x63d7('0x12')]('ShowMailQueue',_0xad763f);logger[_0x63d7('0x15')](_0x63d7('0x28'),_0xad763f,JSON[_0x63d7('0x27')](_0x10c4ab));_0xc2df4c(_0x10c4ab);})[_0x63d7('0x1b')](function(_0x53e430){logger[_0x63d7('0x17')](_0x63d7('0x28'),_0x53e430[_0x63d7('0x19')],_0xad763f);_0x50f7ba(_0x45509e['error'](0x1f4,_0x53e430[_0x63d7('0x19')]));});});}; \ No newline at end of file +var _0xaaff=['catch','GetMailQueue','MailQueue','findAll','options','raw','include','map','model','attributes','ShowMailQueue','find','where','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','request','then','info','debug','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailQueue,\x20%s,\x20%s','message'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xaaff,0xad));var _0xfaaf=function(_0x421752,_0x20f492){_0x421752=_0x421752-0x0;var _0x23ed3e=_0xaaff[_0x421752];return _0x23ed3e;};'use strict';var _=require('lodash');var util=require(_0xfaaf('0x0'));var moment=require(_0xfaaf('0x1'));var BPromise=require(_0xfaaf('0x2'));var rs=require(_0xfaaf('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfaaf('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfaaf('0x5'));var config=require(_0xfaaf('0x6'));var jayson=require(_0xfaaf('0x7'));var client=jayson[_0xfaaf('0x8')][_0xfaaf('0x9')]({'port':0x232a});config[_0xfaaf('0xa')]=_[_0xfaaf('0xb')](config[_0xfaaf('0xa')],{'host':_0xfaaf('0xc'),'port':0x18eb});var socket=require(_0xfaaf('0xd'))(new Redis(config[_0xfaaf('0xa')]));require(_0xfaaf('0xe'))[_0xfaaf('0xf')](socket);function respondWithRpcPromise(_0x5dfb50,_0x54bf0a,_0x34b83c){return new BPromise(function(_0xc7d92e,_0x41950){return client[_0xfaaf('0x10')](_0x5dfb50,_0x34b83c)[_0xfaaf('0x11')](function(_0x84a596){logger[_0xfaaf('0x12')]('MailQueue,\x20%s,\x20%s',_0x54bf0a,'request\x20sent');logger[_0xfaaf('0x13')](_0xfaaf('0x14'),_0x54bf0a,_0xfaaf('0x15'),JSON[_0xfaaf('0x16')](_0x84a596));if(_0x84a596['error']){if(_0x84a596[_0xfaaf('0x17')][_0xfaaf('0x18')]===0x1f4){logger[_0xfaaf('0x17')](_0xfaaf('0x19'),_0x54bf0a,_0x84a596[_0xfaaf('0x17')][_0xfaaf('0x1a')]);return _0x41950(_0x84a596['error'][_0xfaaf('0x1a')]);}logger[_0xfaaf('0x17')](_0xfaaf('0x19'),_0x54bf0a,_0x84a596[_0xfaaf('0x17')][_0xfaaf('0x1a')]);return _0xc7d92e(_0x84a596['error'][_0xfaaf('0x1a')]);}else{logger['info'](_0xfaaf('0x19'),_0x54bf0a,'request\x20sent');_0xc7d92e(_0x84a596['result'][_0xfaaf('0x1a')]);}})[_0xfaaf('0x1b')](function(_0x4b6dc2){logger['error'](_0xfaaf('0x19'),_0x54bf0a,_0x4b6dc2);_0x41950(_0x4b6dc2);});});}exports[_0xfaaf('0x1c')]=function(_0x47641a){var _0x24672e=this;return new Promise(function(_0x1ae346,_0x197691){return db[_0xfaaf('0x1d')][_0xfaaf('0x1e')]({'raw':_0x47641a[_0xfaaf('0x1f')]?_0x47641a['options'][_0xfaaf('0x20')]===undefined?!![]:![]:!![],'where':_0x47641a['options']?_0x47641a[_0xfaaf('0x1f')]['where']||null:null,'attributes':_0x47641a['options']?_0x47641a[_0xfaaf('0x1f')]['attributes']||null:null,'limit':_0x47641a[_0xfaaf('0x1f')]?_0x47641a[_0xfaaf('0x1f')]['limit']||null:null,'include':_0x47641a['options']?_0x47641a[_0xfaaf('0x1f')][_0xfaaf('0x21')]?_[_0xfaaf('0x22')](_0x47641a[_0xfaaf('0x1f')][_0xfaaf('0x21')],function(_0x2ec8ff){return{'model':db[_0x2ec8ff[_0xfaaf('0x23')]],'as':_0x2ec8ff['as'],'attributes':_0x2ec8ff['attributes'],'include':_0x2ec8ff[_0xfaaf('0x21')]?_[_0xfaaf('0x22')](_0x2ec8ff['include'],function(_0xda4a9a){return{'model':db[_0xda4a9a[_0xfaaf('0x23')]],'as':_0xda4a9a['as'],'attributes':_0xda4a9a[_0xfaaf('0x24')],'include':_0xda4a9a['include']?_[_0xfaaf('0x22')](_0xda4a9a[_0xfaaf('0x21')],function(_0x2ef0c6){return{'model':db[_0x2ef0c6[_0xfaaf('0x23')]],'as':_0x2ef0c6['as'],'attributes':_0x2ef0c6['attributes']};}):[]};}):[]};}):[]:[]})[_0xfaaf('0x11')](function(_0x32ed81){logger['info']('GetMailQueue',_0x47641a);logger[_0xfaaf('0x13')]('GetMailQueue',_0x47641a,JSON[_0xfaaf('0x16')](_0x32ed81));_0x1ae346(_0x32ed81);})[_0xfaaf('0x1b')](function(_0x2eee09){logger[_0xfaaf('0x17')](_0xfaaf('0x1c'),_0x2eee09[_0xfaaf('0x1a')],_0x47641a);_0x197691(_0x24672e[_0xfaaf('0x17')](0x1f4,_0x2eee09[_0xfaaf('0x1a')]));});});};exports[_0xfaaf('0x25')]=function(_0x1516b3){var _0x53d8fc=this;return new Promise(function(_0x2c0e21,_0x409195){return db[_0xfaaf('0x1d')][_0xfaaf('0x26')]({'raw':_0x1516b3[_0xfaaf('0x1f')]?_0x1516b3['options']['raw']===undefined?!![]:![]:!![],'where':_0x1516b3[_0xfaaf('0x1f')]?_0x1516b3[_0xfaaf('0x1f')][_0xfaaf('0x27')]||null:null,'attributes':_0x1516b3[_0xfaaf('0x1f')]?_0x1516b3[_0xfaaf('0x1f')][_0xfaaf('0x24')]||null:null,'include':_0x1516b3[_0xfaaf('0x1f')]?_0x1516b3[_0xfaaf('0x1f')]['include']?_[_0xfaaf('0x22')](_0x1516b3['options'][_0xfaaf('0x21')],function(_0x47ee2b){return{'model':db[_0x47ee2b[_0xfaaf('0x23')]],'as':_0x47ee2b['as'],'attributes':_0x47ee2b[_0xfaaf('0x24')],'include':_0x47ee2b[_0xfaaf('0x21')]?_[_0xfaaf('0x22')](_0x47ee2b[_0xfaaf('0x21')],function(_0x1b202e){return{'model':db[_0x1b202e[_0xfaaf('0x23')]],'as':_0x1b202e['as'],'attributes':_0x1b202e['attributes'],'include':_0x1b202e[_0xfaaf('0x21')]?_[_0xfaaf('0x22')](_0x1b202e[_0xfaaf('0x21')],function(_0x4f5fa6){return{'model':db[_0x4f5fa6[_0xfaaf('0x23')]],'as':_0x4f5fa6['as'],'attributes':_0x4f5fa6['attributes']};}):[]};}):[]};}):[]:[]})[_0xfaaf('0x11')](function(_0x47d9b5){logger[_0xfaaf('0x12')]('ShowMailQueue',_0x1516b3);logger['debug'](_0xfaaf('0x25'),_0x1516b3,JSON[_0xfaaf('0x16')](_0x47d9b5));_0x2c0e21(_0x47d9b5);})['catch'](function(_0x308255){logger[_0xfaaf('0x17')]('ShowMailQueue',_0x308255['message'],_0x1516b3);_0x409195(_0x53d8fc[_0xfaaf('0x17')](0x1f4,_0x308255['message']));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 7ef00c6..b3950a3 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 _0x0833=['update','removeListener','register','length','./mailQueue.events','save','remove'];(function(_0x470b0a,_0x2889d6){var _0x4463f6=function(_0x2b5f0e){while(--_0x2b5f0e){_0x470b0a['push'](_0x470b0a['shift']());}};_0x4463f6(++_0x2889d6);}(_0x0833,0x1bd));var _0x3083=function(_0x41e527,_0x3b8746){_0x41e527=_0x41e527-0x0;var _0x5aeaed=_0x0833[_0x41e527];return _0x5aeaed;};'use strict';var MailQueueEvents=require(_0x3083('0x0'));var events=[_0x3083('0x1'),_0x3083('0x2'),_0x3083('0x3')];function createListener(_0x37b521,_0x5c53b1){return function(_0x52255d){_0x5c53b1['emit'](_0x37b521,_0x52255d);};}function removeListener(_0x22717c,_0x58a865){return function(){MailQueueEvents[_0x3083('0x4')](_0x22717c,_0x58a865);};}exports[_0x3083('0x5')]=function(_0x914cec){for(var _0x58ed49=0x0,_0x2f9c3a=events[_0x3083('0x6')];_0x58ed49<_0x2f9c3a;_0x58ed49++){var _0x529df1=events[_0x58ed49];var _0x5591b0=createListener('mailQueue:'+_0x529df1,_0x914cec);MailQueueEvents['on'](_0x529df1,_0x5591b0);}}; \ No newline at end of file +var _0x5a69=['removeListener','length','mailQueue:','save','remove','update','emit'];(function(_0x31c0e5,_0x472b48){var _0x16dce4=function(_0x3fe675){while(--_0x3fe675){_0x31c0e5['push'](_0x31c0e5['shift']());}};_0x16dce4(++_0x472b48);}(_0x5a69,0x88));var _0x95a6=function(_0x544885,_0x5c051e){_0x544885=_0x544885-0x0;var _0x94cb69=_0x5a69[_0x544885];return _0x94cb69;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0x95a6('0x0'),_0x95a6('0x1'),_0x95a6('0x2')];function createListener(_0x59217c,_0x29222c){return function(_0x5a25fa){_0x29222c[_0x95a6('0x3')](_0x59217c,_0x5a25fa);};}function removeListener(_0x470879,_0x1776f1){return function(){MailQueueEvents[_0x95a6('0x4')](_0x470879,_0x1776f1);};}exports['register']=function(_0x3f4617){for(var _0xf1381f=0x0,_0x2a27f9=events[_0x95a6('0x5')];_0xf1381f<_0x2a27f9;_0xf1381f++){var _0x5c4271=events[_0xf1381f];var _0x5ad9e5=createListener(_0x95a6('0x6')+_0x5c4271,_0x3f4617);MailQueueEvents['on'](_0x5c4271,_0x5ad9e5);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index baa3183..67f1149 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 _0x0f89=['../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x1c66d8,_0x16d85d){var _0xf1cc0a=function(_0x2d8ff4){while(--_0x2d8ff4){_0x1c66d8['push'](_0x1c66d8['shift']());}};_0xf1cc0a(++_0x16d85d);}(_0x0f89,0xc9));var _0x90f8=function(_0x58fae8,_0x104d38){_0x58fae8=_0x58fae8-0x0;var _0x18f808=_0x0f89[_0x58fae8];return _0x18f808;};'use strict';var multer=require(_0x90f8('0x0'));var util=require(_0x90f8('0x1'));var path=require(_0x90f8('0x2'));var timeout=require(_0x90f8('0x3'));var express=require(_0x90f8('0x4'));var router=express['Router']();var fs_extra=require(_0x90f8('0x5'));var auth=require(_0x90f8('0x6'));var interaction=require(_0x90f8('0x7'));var config=require(_0x90f8('0x8'));var controller=require(_0x90f8('0x9'));router[_0x90f8('0xa')]('/',auth[_0x90f8('0xb')](),controller[_0x90f8('0xc')]);router[_0x90f8('0xa')](_0x90f8('0xd'),auth[_0x90f8('0xb')](),controller[_0x90f8('0xe')]);router[_0x90f8('0xa')](_0x90f8('0xf'),auth['isAuthenticated'](),controller[_0x90f8('0x10')]);router[_0x90f8('0x11')]('/',auth[_0x90f8('0xb')](),controller[_0x90f8('0x12')]);router[_0x90f8('0x13')](_0x90f8('0xf'),auth['isAuthenticated'](),controller[_0x90f8('0x14')]);router[_0x90f8('0x15')](_0x90f8('0xf'),auth[_0x90f8('0xb')](),controller['destroy']);module[_0x90f8('0x16')]=router; \ No newline at end of file +var _0xaf89=['create','delete','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','post'];(function(_0x3fef1a,_0x337317){var _0xeb8f79=function(_0x820f45){while(--_0x820f45){_0x3fef1a['push'](_0x3fef1a['shift']());}};_0xeb8f79(++_0x337317);}(_0xaf89,0xb6));var _0x9af8=function(_0x503ffd,_0x8ecde){_0x503ffd=_0x503ffd-0x0;var _0x160437=_0xaf89[_0x503ffd];return _0x160437;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9af8('0x0'));var timeout=require(_0x9af8('0x1'));var express=require(_0x9af8('0x2'));var router=express[_0x9af8('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9af8('0x4'));var config=require(_0x9af8('0x5'));var controller=require('./mailQueueReport.controller');router[_0x9af8('0x6')]('/',auth[_0x9af8('0x7')](),controller[_0x9af8('0x8')]);router[_0x9af8('0x6')](_0x9af8('0x9'),auth[_0x9af8('0x7')](),controller['describe']);router[_0x9af8('0x6')](_0x9af8('0xa'),auth[_0x9af8('0x7')](),controller[_0x9af8('0xb')]);router[_0x9af8('0xc')]('/',auth['isAuthenticated'](),controller[_0x9af8('0xd')]);router['put'](_0x9af8('0xa'),auth[_0x9af8('0x7')](),controller['update']);router[_0x9af8('0xe')](_0x9af8('0xa'),auth[_0x9af8('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index aca3703..70c9cbc 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 _0xad07=['DATE','moment','STRING'];(function(_0x4c2869,_0x100bc4){var _0x1dd859=function(_0x372012){while(--_0x372012){_0x4c2869['push'](_0x4c2869['shift']());}};_0x1dd859(++_0x100bc4);}(_0xad07,0x1ab));var _0x7ad0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xad07[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x7ad0('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x7ad0('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x7ad0('0x2')]},'leaveAt':{'type':Sequelize[_0x7ad0('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x7ad0('0x2')]},'reason':{'type':Sequelize[_0x7ad0('0x1')]}}; \ No newline at end of file +var _0x3750=['sequelize','exports','STRING','DATE'];(function(_0xfe8f15,_0x14404a){var _0x2ab71f=function(_0x37c60e){while(--_0x37c60e){_0xfe8f15['push'](_0xfe8f15['shift']());}};_0x2ab71f(++_0x14404a);}(_0x3750,0x6c));var _0x0375=function(_0xb1b616,_0x3b9023){_0xb1b616=_0xb1b616-0x0;var _0x1259b0=_0x3750[_0xb1b616];return _0x1259b0;};'use strict';var moment=require('moment');var Sequelize=require(_0x0375('0x0'));module[_0x0375('0x1')]={'uniqueid':{'type':Sequelize[_0x0375('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x0375('0x2')]},'joinAt':{'type':Sequelize[_0x0375('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x0375('0x3')]},'exitAt':{'type':Sequelize[_0x0375('0x3')]},'reason':{'type':Sequelize[_0x0375('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 551d96e..70fab15 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 _0xb016=['util','path','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','error','name','send','index','map','MailQueueReport','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','update','find','body','describe','eml-format','rimraf','request-promise','bluebird','mustache'];(function(_0x222cd3,_0x2f59b5){var _0x59bf7f=function(_0x4cea0b){while(--_0x4cea0b){_0x222cd3['push'](_0x222cd3['shift']());}};_0x59bf7f(++_0x2f59b5);}(_0xb016,0x159));var _0x6b01=function(_0x999e10,_0x16a959){_0x999e10=_0x999e10-0x0;var _0x21dd96=_0xb016[_0x999e10];return _0x21dd96;};'use strict';var emlformat=require(_0x6b01('0x0'));var rimraf=require(_0x6b01('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6b01('0x2'));var moment=require('moment');var BPromise=require(_0x6b01('0x3'));var Mustache=require(_0x6b01('0x4'));var util=require(_0x6b01('0x5'));var path=require(_0x6b01('0x6'));var sox=require('sox');var csv=require(_0x6b01('0x7'));var ejs=require(_0x6b01('0x8'));var fs=require('fs');var fs_extra=require(_0x6b01('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6b01('0xa'));var jsforce=require(_0x6b01('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6b01('0xc'));var Papa=require(_0x6b01('0xd'));var Redis=require(_0x6b01('0xe'));var authService=require(_0x6b01('0xf'));var qs=require(_0x6b01('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6b01('0x11'))(_0x6b01('0x12'));var utils=require(_0x6b01('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x6b01('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51f976,_0x26f2a0){_0x26f2a0=_0x26f2a0||0xcc;return function(_0x4fa826){if(_0x4fa826){return _0x51f976[_0x6b01('0x15')](_0x26f2a0);}return _0x51f976[_0x6b01('0x16')](_0x26f2a0)['end']();};}function respondWithResult(_0x2c305e,_0x4ea5fa){_0x4ea5fa=_0x4ea5fa||0xc8;return function(_0x50d778){if(_0x50d778){return _0x2c305e['status'](_0x4ea5fa)[_0x6b01('0x17')](_0x50d778);}};}function respondWithFilteredResult(_0x4cbd38,_0x5b2f60){return function(_0x3a259f){if(_0x3a259f){var _0x327e86=typeof _0x5b2f60[_0x6b01('0x18')]===_0x6b01('0x19')&&typeof _0x5b2f60[_0x6b01('0x1a')]===_0x6b01('0x19');var _0x122769=_0x3a259f[_0x6b01('0x1b')];var _0x9c6571=_0x327e86?0x0:_0x5b2f60[_0x6b01('0x18')];var _0x18f336=_0x327e86?_0x3a259f['count']:_0x5b2f60[_0x6b01('0x18')]+_0x5b2f60[_0x6b01('0x1a')];var _0x3b0bab;if(_0x18f336>=_0x122769){_0x18f336=_0x122769;_0x3b0bab=0xc8;}else{_0x3b0bab=0xce;}_0x4cbd38[_0x6b01('0x16')](_0x3b0bab);return _0x4cbd38[_0x6b01('0x1c')](_0x6b01('0x1d'),_0x9c6571+'-'+_0x18f336+'/'+_0x122769)[_0x6b01('0x17')](_0x3a259f);}return null;};}function patchUpdates(_0x3c0573){return function(_0x54a942){try{jsonpatch[_0x6b01('0x1e')](_0x54a942,_0x3c0573,!![]);}catch(_0xc1f453){return BPromise[_0x6b01('0x1f')](_0xc1f453);}return _0x54a942[_0x6b01('0x20')]();};}function saveUpdates(_0x1fced4,_0x181b09){return function(_0x2cea6e){if(_0x2cea6e){return _0x2cea6e['update'](_0x1fced4)[_0x6b01('0x21')](function(_0xcf9200){return _0xcf9200;});}return null;};}function removeEntity(_0x42c990,_0x51243c){return function(_0x399808){if(_0x399808){return _0x399808[_0x6b01('0x22')]()[_0x6b01('0x21')](function(){_0x42c990[_0x6b01('0x16')](0xcc)[_0x6b01('0x23')]();});}};}function handleEntityNotFound(_0x2456e9,_0x1b46fb){return function(_0x136452){if(!_0x136452){_0x2456e9[_0x6b01('0x15')](0x194);}return _0x136452;};}function handleError(_0x152dda,_0x3c0607){_0x3c0607=_0x3c0607||0x1f4;return function(_0xa846d8){logger[_0x6b01('0x24')](_0xa846d8['stack']);if(_0xa846d8[_0x6b01('0x25')]){delete _0xa846d8[_0x6b01('0x25')];}_0x152dda[_0x6b01('0x16')](_0x3c0607)[_0x6b01('0x26')](_0xa846d8);};}exports[_0x6b01('0x27')]=function(_0x528cbd,_0x54f030){var _0x3fae61={},_0x3df3d4={},_0xc574c={'count':0x0,'rows':[]};var _0x8883d1=_[_0x6b01('0x28')](db[_0x6b01('0x29')]['rawAttributes'],function(_0x39f193){return{'name':_0x39f193['fieldName'],'type':_0x39f193[_0x6b01('0x2a')]['key']};});_0x3df3d4[_0x6b01('0x2b')]=_[_0x6b01('0x28')](_0x8883d1,_0x6b01('0x25'));_0x3df3d4[_0x6b01('0x2c')]=_[_0x6b01('0x2d')](_0x528cbd['query']);_0x3df3d4[_0x6b01('0x2e')]=_[_0x6b01('0x2f')](_0x3df3d4[_0x6b01('0x2b')],_0x3df3d4['query']);_0x3fae61['attributes']=_[_0x6b01('0x2f')](_0x3df3d4['model'],qs[_0x6b01('0x30')](_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x30')]));_0x3fae61['attributes']=_0x3fae61[_0x6b01('0x31')][_0x6b01('0x32')]?_0x3fae61[_0x6b01('0x31')]:_0x3df3d4['model'];if(!_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x33')](_0x6b01('0x34'))){_0x3fae61[_0x6b01('0x1a')]=qs[_0x6b01('0x1a')](_0x528cbd['query'][_0x6b01('0x1a')]);_0x3fae61[_0x6b01('0x18')]=qs[_0x6b01('0x18')](_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x18')]);}_0x3fae61[_0x6b01('0x35')]=qs[_0x6b01('0x36')](_0x528cbd[_0x6b01('0x2c')]['sort']);_0x3fae61[_0x6b01('0x37')]=qs['filters'](_[_0x6b01('0x38')](_0x528cbd[_0x6b01('0x2c')],_0x3df3d4[_0x6b01('0x2e')]),_0x8883d1);if(_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x39')]){_0x3fae61[_0x6b01('0x37')]=_[_0x6b01('0x3a')](_0x3fae61['where'],{'$or':_[_0x6b01('0x28')](_0x8883d1,function(_0x15f274){if(_0x15f274[_0x6b01('0x2a')]!==_0x6b01('0x3b')){var _0x1ca3aa={};_0x1ca3aa[_0x15f274[_0x6b01('0x25')]]={'$like':'%'+_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x39')]+'%'};return _0x1ca3aa;}})});}_0x3fae61=_['merge']({},_0x3fae61,_0x528cbd[_0x6b01('0x3c')]);var _0x55907f={'where':_0x3fae61[_0x6b01('0x37')]};return db[_0x6b01('0x29')]['count'](_0x55907f)[_0x6b01('0x21')](function(_0x2e661b){_0xc574c[_0x6b01('0x1b')]=_0x2e661b;if(_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x3d')]){_0x3fae61[_0x6b01('0x3e')]=[{'all':!![]}];}return db[_0x6b01('0x29')][_0x6b01('0x3f')](_0x3fae61);})[_0x6b01('0x21')](function(_0x17f335){_0xc574c['rows']=_0x17f335;return _0xc574c;})[_0x6b01('0x21')](respondWithFilteredResult(_0x54f030,_0x3fae61))[_0x6b01('0x40')](handleError(_0x54f030,null));};exports['show']=function(_0x52cec0,_0x32b9ec){var _0xd11195={'raw':!![],'where':{'id':_0x52cec0[_0x6b01('0x41')]['id']}},_0x558ec1={};_0x558ec1[_0x6b01('0x2b')]=_['keys'](db[_0x6b01('0x29')]['rawAttributes']);_0x558ec1[_0x6b01('0x2c')]=_[_0x6b01('0x2d')](_0x52cec0[_0x6b01('0x2c')]);_0x558ec1['filters']=_[_0x6b01('0x2f')](_0x558ec1[_0x6b01('0x2b')],_0x558ec1['query']);_0xd11195['attributes']=_['intersection'](_0x558ec1[_0x6b01('0x2b')],qs[_0x6b01('0x30')](_0x52cec0[_0x6b01('0x2c')][_0x6b01('0x30')]));_0xd11195[_0x6b01('0x31')]=_0xd11195[_0x6b01('0x31')]['length']?_0xd11195[_0x6b01('0x31')]:_0x558ec1[_0x6b01('0x2b')];if(_0x52cec0[_0x6b01('0x2c')][_0x6b01('0x3d')]){_0xd11195[_0x6b01('0x3e')]=[{'all':!![]}];}_0xd11195=_[_0x6b01('0x3a')]({},_0xd11195,_0x52cec0['options']);return db[_0x6b01('0x29')]['find'](_0xd11195)['then'](handleEntityNotFound(_0x32b9ec,null))[_0x6b01('0x21')](respondWithResult(_0x32b9ec,null))[_0x6b01('0x40')](handleError(_0x32b9ec,null));};exports['create']=function(_0x408bb0,_0x27442e){return db[_0x6b01('0x29')]['create'](_0x408bb0['body'],{})['then'](respondWithResult(_0x27442e,0xc9))[_0x6b01('0x40')](handleError(_0x27442e,null));};exports[_0x6b01('0x42')]=function(_0x518d94,_0x34cef6){if(_0x518d94['body']['id']){delete _0x518d94['body']['id'];}return db['MailQueueReport'][_0x6b01('0x43')]({'where':{'id':_0x518d94[_0x6b01('0x41')]['id']}})['then'](handleEntityNotFound(_0x34cef6,null))['then'](saveUpdates(_0x518d94[_0x6b01('0x44')],null))['then'](respondWithResult(_0x34cef6,null))[_0x6b01('0x40')](handleError(_0x34cef6,null));};exports[_0x6b01('0x22')]=function(_0x32d446,_0x172a56){return db[_0x6b01('0x29')]['find']({'where':{'id':_0x32d446[_0x6b01('0x41')]['id']}})[_0x6b01('0x21')](handleEntityNotFound(_0x172a56,null))[_0x6b01('0x21')](removeEntity(_0x172a56,null))['catch'](handleError(_0x172a56,null));};exports[_0x6b01('0x45')]=function(_0x13ab4f,_0x5617d7){return db[_0x6b01('0x29')][_0x6b01('0x45')]()[_0x6b01('0x21')](respondWithResult(_0x5617d7,null))[_0x6b01('0x40')](handleError(_0x5617d7,null));}; \ No newline at end of file +var _0xc6ac=['filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','show','params','includeAll','include','find','catch','create','body','update','describe','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','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','then','destroy','end','error','name','send','MailQueueReport','rawAttributes','fieldName','type','key','map','query','keys'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x3cf301,_0x4161e1){_0x3cf301=_0x3cf301-0x0;var _0x3785ca=_0xc6ac[_0x3cf301];return _0x3785ca;};'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'];function respondWithStatusCode(_0x59ce6d,_0xf0f6d5){_0xf0f6d5=_0xf0f6d5||0xcc;return function(_0x211444){if(_0x211444){return _0x59ce6d[_0xcc6a('0x1b')](_0xf0f6d5);}return _0x59ce6d['status'](_0xf0f6d5)['end']();};}function respondWithResult(_0x369dc1,_0xcb9e2e){_0xcb9e2e=_0xcb9e2e||0xc8;return function(_0x43710d){if(_0x43710d){return _0x369dc1[_0xcc6a('0x1c')](_0xcb9e2e)[_0xcc6a('0x1d')](_0x43710d);}};}function respondWithFilteredResult(_0x337ec5,_0x4133fa){return function(_0x403b18){if(_0x403b18){var _0x56ffb0=typeof _0x4133fa['offset']==='undefined'&&typeof _0x4133fa[_0xcc6a('0x1e')]===_0xcc6a('0x1f');var _0x307f2a=_0x403b18[_0xcc6a('0x20')];var _0x33079c=_0x56ffb0?0x0:_0x4133fa[_0xcc6a('0x21')];var _0x2d9585=_0x56ffb0?_0x403b18[_0xcc6a('0x20')]:_0x4133fa[_0xcc6a('0x21')]+_0x4133fa[_0xcc6a('0x1e')];var _0x1d20a3;if(_0x2d9585>=_0x307f2a){_0x2d9585=_0x307f2a;_0x1d20a3=0xc8;}else{_0x1d20a3=0xce;}_0x337ec5['status'](_0x1d20a3);return _0x337ec5[_0xcc6a('0x22')](_0xcc6a('0x23'),_0x33079c+'-'+_0x2d9585+'/'+_0x307f2a)[_0xcc6a('0x1d')](_0x403b18);}return null;};}function patchUpdates(_0x368a6e){return function(_0x1495d8){try{jsonpatch[_0xcc6a('0x24')](_0x1495d8,_0x368a6e,!![]);}catch(_0x36c80f){return BPromise[_0xcc6a('0x25')](_0x36c80f);}return _0x1495d8[_0xcc6a('0x26')]();};}function saveUpdates(_0x19d32c,_0x329d17){return function(_0x845088){if(_0x845088){return _0x845088['update'](_0x19d32c)[_0xcc6a('0x27')](function(_0x3a081e){return _0x3a081e;});}return null;};}function removeEntity(_0x38f812,_0x581aae){return function(_0x10016a){if(_0x10016a){return _0x10016a[_0xcc6a('0x28')]()[_0xcc6a('0x27')](function(){_0x38f812[_0xcc6a('0x1c')](0xcc)[_0xcc6a('0x29')]();});}};}function handleEntityNotFound(_0x5fc697,_0x50abc1){return function(_0x26def8){if(!_0x26def8){_0x5fc697[_0xcc6a('0x1b')](0x194);}return _0x26def8;};}function handleError(_0x3514f3,_0x5f27e5){_0x5f27e5=_0x5f27e5||0x1f4;return function(_0x3afb3a){logger[_0xcc6a('0x2a')](_0x3afb3a['stack']);if(_0x3afb3a[_0xcc6a('0x2b')]){delete _0x3afb3a[_0xcc6a('0x2b')];}_0x3514f3[_0xcc6a('0x1c')](_0x5f27e5)[_0xcc6a('0x2c')](_0x3afb3a);};}exports['index']=function(_0x194aab,_0x3cf14c){var _0x2c6d88={},_0x4f176b={},_0x2590a2={'count':0x0,'rows':[]};var _0x5308d4=_['map'](db[_0xcc6a('0x2d')][_0xcc6a('0x2e')],function(_0x3aa315){return{'name':_0x3aa315[_0xcc6a('0x2f')],'type':_0x3aa315[_0xcc6a('0x30')][_0xcc6a('0x31')]};});_0x4f176b['model']=_[_0xcc6a('0x32')](_0x5308d4,_0xcc6a('0x2b'));_0x4f176b[_0xcc6a('0x33')]=_[_0xcc6a('0x34')](_0x194aab[_0xcc6a('0x33')]);_0x4f176b[_0xcc6a('0x35')]=_[_0xcc6a('0x36')](_0x4f176b[_0xcc6a('0x37')],_0x4f176b['query']);_0x2c6d88[_0xcc6a('0x38')]=_[_0xcc6a('0x36')](_0x4f176b[_0xcc6a('0x37')],qs[_0xcc6a('0x39')](_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x39')]));_0x2c6d88[_0xcc6a('0x38')]=_0x2c6d88['attributes'][_0xcc6a('0x3a')]?_0x2c6d88['attributes']:_0x4f176b['model'];if(!_0x194aab['query'][_0xcc6a('0x3b')](_0xcc6a('0x3c'))){_0x2c6d88[_0xcc6a('0x1e')]=qs[_0xcc6a('0x1e')](_0x194aab[_0xcc6a('0x33')]['limit']);_0x2c6d88['offset']=qs[_0xcc6a('0x21')](_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x21')]);}_0x2c6d88['order']=qs[_0xcc6a('0x3d')](_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x3d')]);_0x2c6d88[_0xcc6a('0x3e')]=qs[_0xcc6a('0x35')](_[_0xcc6a('0x3f')](_0x194aab[_0xcc6a('0x33')],_0x4f176b[_0xcc6a('0x35')]),_0x5308d4);if(_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x40')]){_0x2c6d88[_0xcc6a('0x3e')]=_[_0xcc6a('0x41')](_0x2c6d88[_0xcc6a('0x3e')],{'$or':_[_0xcc6a('0x32')](_0x5308d4,function(_0x262a1e){if(_0x262a1e[_0xcc6a('0x30')]!==_0xcc6a('0x42')){var _0x386cbc={};_0x386cbc[_0x262a1e['name']]={'$like':'%'+_0x194aab['query'][_0xcc6a('0x40')]+'%'};return _0x386cbc;}})});}_0x2c6d88=_[_0xcc6a('0x41')]({},_0x2c6d88,_0x194aab[_0xcc6a('0x43')]);var _0x1fd8e1={'where':_0x2c6d88[_0xcc6a('0x3e')]};return db[_0xcc6a('0x2d')][_0xcc6a('0x20')](_0x1fd8e1)[_0xcc6a('0x27')](function(_0x49b65c){_0x2590a2['count']=_0x49b65c;if(_0x194aab[_0xcc6a('0x33')]['includeAll']){_0x2c6d88['include']=[{'all':!![]}];}return db['MailQueueReport'][_0xcc6a('0x44')](_0x2c6d88);})[_0xcc6a('0x27')](function(_0xb42897){_0x2590a2[_0xcc6a('0x45')]=_0xb42897;return _0x2590a2;})[_0xcc6a('0x27')](respondWithFilteredResult(_0x3cf14c,_0x2c6d88))['catch'](handleError(_0x3cf14c,null));};exports[_0xcc6a('0x46')]=function(_0xfbb079,_0x17e5a0){var _0x2f966f={'raw':!![],'where':{'id':_0xfbb079[_0xcc6a('0x47')]['id']}},_0x14ca90={};_0x14ca90['model']=_[_0xcc6a('0x34')](db[_0xcc6a('0x2d')][_0xcc6a('0x2e')]);_0x14ca90[_0xcc6a('0x33')]=_['keys'](_0xfbb079[_0xcc6a('0x33')]);_0x14ca90['filters']=_[_0xcc6a('0x36')](_0x14ca90[_0xcc6a('0x37')],_0x14ca90[_0xcc6a('0x33')]);_0x2f966f['attributes']=_[_0xcc6a('0x36')](_0x14ca90[_0xcc6a('0x37')],qs[_0xcc6a('0x39')](_0xfbb079['query']['fields']));_0x2f966f[_0xcc6a('0x38')]=_0x2f966f[_0xcc6a('0x38')][_0xcc6a('0x3a')]?_0x2f966f[_0xcc6a('0x38')]:_0x14ca90[_0xcc6a('0x37')];if(_0xfbb079['query'][_0xcc6a('0x48')]){_0x2f966f[_0xcc6a('0x49')]=[{'all':!![]}];}_0x2f966f=_['merge']({},_0x2f966f,_0xfbb079[_0xcc6a('0x43')]);return db[_0xcc6a('0x2d')][_0xcc6a('0x4a')](_0x2f966f)[_0xcc6a('0x27')](handleEntityNotFound(_0x17e5a0,null))[_0xcc6a('0x27')](respondWithResult(_0x17e5a0,null))[_0xcc6a('0x4b')](handleError(_0x17e5a0,null));};exports['create']=function(_0x4e1a0b,_0x47c999){return db[_0xcc6a('0x2d')][_0xcc6a('0x4c')](_0x4e1a0b[_0xcc6a('0x4d')],{})[_0xcc6a('0x27')](respondWithResult(_0x47c999,0xc9))['catch'](handleError(_0x47c999,null));};exports[_0xcc6a('0x4e')]=function(_0x5e7bab,_0x3aa7dd){if(_0x5e7bab[_0xcc6a('0x4d')]['id']){delete _0x5e7bab[_0xcc6a('0x4d')]['id'];}return db[_0xcc6a('0x2d')][_0xcc6a('0x4a')]({'where':{'id':_0x5e7bab[_0xcc6a('0x47')]['id']}})['then'](handleEntityNotFound(_0x3aa7dd,null))[_0xcc6a('0x27')](saveUpdates(_0x5e7bab[_0xcc6a('0x4d')],null))[_0xcc6a('0x27')](respondWithResult(_0x3aa7dd,null))[_0xcc6a('0x4b')](handleError(_0x3aa7dd,null));};exports[_0xcc6a('0x28')]=function(_0x362bf6,_0x431684){return db[_0xcc6a('0x2d')][_0xcc6a('0x4a')]({'where':{'id':_0x362bf6[_0xcc6a('0x47')]['id']}})['then'](handleEntityNotFound(_0x431684,null))[_0xcc6a('0x27')](removeEntity(_0x431684,null))[_0xcc6a('0x4b')](handleError(_0x431684,null));};exports[_0xcc6a('0x4f')]=function(_0x34531d,_0x14f5e5){return db[_0xcc6a('0x2d')]['describe']()['then'](respondWithResult(_0x14f5e5,null))[_0xcc6a('0x4b')](handleError(_0x14f5e5,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 036534b..2962ced 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 _0x7772=['lodash','util','api','bluebird','path','rimraf','../../config/environment','exports','define','MailQueueReport','report_mail_queue','uniqueid'];(function(_0x11eef0,_0x16d762){var _0x3a8300=function(_0xf45cb){while(--_0xf45cb){_0x11eef0['push'](_0x11eef0['shift']());}};_0x3a8300(++_0x16d762);}(_0x7772,0x1ec));var _0x2777=function(_0x36f889,_0x11dd84){_0x36f889=_0x36f889-0x0;var _0x438a5e=_0x7772[_0x36f889];return _0x438a5e;};'use strict';var _=require(_0x2777('0x0'));var util=require(_0x2777('0x1'));var logger=require('../../config/logger')(_0x2777('0x2'));var moment=require('moment');var BPromise=require(_0x2777('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2777('0x4'));var rimraf=require(_0x2777('0x5'));var config=require(_0x2777('0x6'));var attributes=require('./mailQueueReport.attributes');module[_0x2777('0x7')]=function(_0x49abc2,_0x267015){return _0x49abc2[_0x2777('0x8')](_0x2777('0x9'),attributes,{'tableName':_0x2777('0xa'),'paranoid':![],'indexes':[{'name':_0x2777('0xb'),'fields':[_0x2777('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2278=['define','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./mailQueueReport.attributes','exports'];(function(_0x3d98f3,_0x3468d6){var _0x2df0eb=function(_0x40c8d3){while(--_0x40c8d3){_0x3d98f3['push'](_0x3d98f3['shift']());}};_0x2df0eb(++_0x3468d6);}(_0x2278,0x17e));var _0x8227=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2278[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8227('0x0'));var util=require(_0x8227('0x1'));var logger=require(_0x8227('0x2'))('api');var moment=require(_0x8227('0x3'));var BPromise=require(_0x8227('0x4'));var rp=require(_0x8227('0x5'));var fs=require('fs');var path=require(_0x8227('0x6'));var rimraf=require('rimraf');var config=require(_0x8227('0x7'));var attributes=require(_0x8227('0x8'));module[_0x8227('0x9')]=function(_0x194c9d,_0x35c242){return _0x194c9d[_0x8227('0xa')](_0x8227('0xb'),attributes,{'tableName':_0x8227('0xc'),'paranoid':![],'indexes':[{'name':_0x8227('0xd'),'fields':[_0x8227('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index bf87c91..0aa6d00 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 _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(_0x2b0d09,_0x638606){var _0x4fedf4=function(_0x5df120){while(--_0x5df120){_0x2b0d09['push'](_0x2b0d09['shift']());}};_0x4fedf4(++_0x638606);}(_0xadb5,0xad));var _0x5adb=function(_0x481bd9,_0x24eb2c){_0x481bd9=_0x481bd9-0x0;var _0x57eb69=_0xadb5[_0x481bd9];return _0x57eb69;};'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 +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(_0x4e04a3,_0x474aa3){var _0x2d34c7=function(_0x315b76){while(--_0x315b76){_0x4e04a3['push'](_0x4e04a3['shift']());}};_0x2d34c7(++_0x474aa3);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xc4aa[_0x465a0c];return _0x1e202e;};'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 diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index cbc2f9d..d38767c 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(_0x2bc9b1,_0x4630da){var _0x3956c4=function(_0x2178d2){while(--_0x2178d2){_0x2bc9b1['push'](_0x2bc9b1['shift']());}};_0x3956c4(++_0x4630da);}(_0x70e0,0x17b));var _0x070e=function(_0xdd604e,_0x2867da){_0xdd604e=_0xdd604e-0x0;var _0x39415e=_0x70e0[_0xdd604e];return _0x39415e;};'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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x2a5d7a,_0x47b143){var _0x231c09=function(_0x48a2a6){while(--_0x48a2a6){_0x2a5d7a['push'](_0x2a5d7a['shift']());}};_0x231c09(++_0x47b143);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 9ee56fc..03240b7 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 _0xe3cf=['STRING','BOOLEAN','INTEGER','INBOX','exports'];(function(_0x2261ce,_0x9ed8b6){var _0x524640=function(_0x3cbb90){while(--_0x3cbb90){_0x2261ce['push'](_0x2261ce['shift']());}};_0x524640(++_0x9ed8b6);}(_0xe3cf,0xfe));var _0xfe3c=function(_0x39ee2b,_0xbffd4d){_0x39ee2b=_0x39ee2b-0x0;var _0xa518e2=_0xe3cf[_0x39ee2b];return _0xa518e2;};'use strict';var Sequelize=require('sequelize');module[_0xfe3c('0x0')]={'description':{'type':Sequelize[_0xfe3c('0x1')]},'host':{'type':Sequelize[_0xfe3c('0x1')]},'authentication':{'type':Sequelize[_0xfe3c('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0xfe3c('0x1')]},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xfe3c('0x3')]},'tls':{'type':Sequelize[_0xfe3c('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xfe3c('0x1')],'defaultValue':_0xfe3c('0x4')},'connTimeout':{'type':Sequelize[_0xfe3c('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xfe3c('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0xfe3c('0x1')]},'modernAuthentication':{'type':Sequelize[_0xfe3c('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xab14=['INTEGER','sequelize','STRING','BOOLEAN','INBOX'];(function(_0x11a104,_0x5d6ef1){var _0xea9b65=function(_0x1c7536){while(--_0x1c7536){_0x11a104['push'](_0x11a104['shift']());}};_0xea9b65(++_0x5d6ef1);}(_0xab14,0xb0));var _0x4ab1=function(_0x12ee53,_0x3848d9){_0x12ee53=_0x12ee53-0x0;var _0x4da405=_0xab14[_0x12ee53];return _0x4da405;};'use strict';var Sequelize=require(_0x4ab1('0x0'));module['exports']={'description':{'type':Sequelize[_0x4ab1('0x1')]},'host':{'type':Sequelize[_0x4ab1('0x1')]},'authentication':{'type':Sequelize[_0x4ab1('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x4ab1('0x1')]},'password':{'type':Sequelize[_0x4ab1('0x1')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0x4ab1('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x4ab1('0x1')],'defaultValue':_0x4ab1('0x3')},'connTimeout':{'type':Sequelize[_0x4ab1('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x4ab1('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0x4ab1('0x1')]},'modernAuthentication':{'type':Sequelize[_0x4ab1('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 0976105..7f6231a 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 _0xe983=['../../config/environment','./mailServerIn.attributes','define','MailServerIn','mail_servers_in','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x599021,_0x108fde){var _0x54e7b6=function(_0x3318eb){while(--_0x3318eb){_0x599021['push'](_0x599021['shift']());}};_0x54e7b6(++_0x108fde);}(_0xe983,0xa1));var _0x3e98=function(_0x160532,_0x15c90f){_0x160532=_0x160532-0x0;var _0x4e8565=_0xe983[_0x160532];return _0x4e8565;};'use strict';var _=require(_0x3e98('0x0'));var util=require(_0x3e98('0x1'));var logger=require('../../config/logger')(_0x3e98('0x2'));var moment=require(_0x3e98('0x3'));var BPromise=require(_0x3e98('0x4'));var rp=require(_0x3e98('0x5'));var fs=require('fs');var path=require(_0x3e98('0x6'));var rimraf=require(_0x3e98('0x7'));var config=require(_0x3e98('0x8'));var attributes=require(_0x3e98('0x9'));module['exports']=function(_0x5365ae,_0x443448){return _0x5365ae[_0x3e98('0xa')](_0x3e98('0xb'),attributes,{'tableName':_0x3e98('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1ee4=['api','moment','bluebird','request-promise','path','rimraf','exports','MailServerIn','mail_servers_in','lodash','util','../../config/logger'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1ee4,0x129));var _0x41ee=function(_0x5020ea,_0x2cf4fa){_0x5020ea=_0x5020ea-0x0;var _0x110e0a=_0x1ee4[_0x5020ea];return _0x110e0a;};'use strict';var _=require(_0x41ee('0x0'));var util=require(_0x41ee('0x1'));var logger=require(_0x41ee('0x2'))(_0x41ee('0x3'));var moment=require(_0x41ee('0x4'));var BPromise=require(_0x41ee('0x5'));var rp=require(_0x41ee('0x6'));var fs=require('fs');var path=require(_0x41ee('0x7'));var rimraf=require(_0x41ee('0x8'));var config=require('../../config/environment');var attributes=require('./mailServerIn.attributes');module[_0x41ee('0x9')]=function(_0x5ad017,_0x8e7263){return _0x5ad017['define'](_0x41ee('0xa'),attributes,{'tableName':_0x41ee('0xb'),'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 fcc5871..6ab2742 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 _0xa788=['http','then','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetMailServerIn','MailServerIn','findAll','options','raw','limit','map','include','model','attributes','info','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0xa788,0x70));var _0x8a78=function(_0x216f7e,_0x5b262f){_0x216f7e=_0x216f7e-0x0;var _0x4ba5a1=_0xa788[_0x216f7e];return _0x4ba5a1;};'use strict';var _=require(_0x8a78('0x0'));var util=require(_0x8a78('0x1'));var moment=require(_0x8a78('0x2'));var BPromise=require(_0x8a78('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a78('0x4'));var db=require(_0x8a78('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8a78('0x6'))(_0x8a78('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x8a78('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x344c6d,_0x539774,_0x4def98){return new BPromise(function(_0x22ebca,_0x542ac5){return client['request'](_0x344c6d,_0x4def98)[_0x8a78('0x9')](function(_0x811201){logger['info'](_0x8a78('0xa'),_0x539774,_0x8a78('0xb'));logger[_0x8a78('0xc')](_0x8a78('0xd'),_0x539774,_0x8a78('0xb'),JSON[_0x8a78('0xe')](_0x811201));if(_0x811201[_0x8a78('0xf')]){if(_0x811201[_0x8a78('0xf')][_0x8a78('0x10')]===0x1f4){logger['error'](_0x8a78('0xa'),_0x539774,_0x811201[_0x8a78('0xf')][_0x8a78('0x11')]);return _0x542ac5(_0x811201['error'][_0x8a78('0x11')]);}logger[_0x8a78('0xf')](_0x8a78('0xa'),_0x539774,_0x811201['error'][_0x8a78('0x11')]);return _0x22ebca(_0x811201['error'][_0x8a78('0x11')]);}else{logger['info'](_0x8a78('0xa'),_0x539774,'request\x20sent');_0x22ebca(_0x811201['result']['message']);}})[_0x8a78('0x12')](function(_0x27822b){logger[_0x8a78('0xf')](_0x8a78('0xa'),_0x539774,_0x27822b);_0x542ac5(_0x27822b);});});}exports[_0x8a78('0x13')]=function(_0x18269a){var _0x9ce954=this;return new Promise(function(_0x1f2cb9,_0x20343b){return db[_0x8a78('0x14')][_0x8a78('0x15')]({'raw':_0x18269a[_0x8a78('0x16')]?_0x18269a[_0x8a78('0x16')][_0x8a78('0x17')]===undefined?!![]:![]:!![],'where':_0x18269a['options']?_0x18269a[_0x8a78('0x16')]['where']||null:null,'attributes':_0x18269a[_0x8a78('0x16')]?_0x18269a[_0x8a78('0x16')]['attributes']||null:null,'limit':_0x18269a[_0x8a78('0x16')]?_0x18269a[_0x8a78('0x16')][_0x8a78('0x18')]||null:null,'include':_0x18269a[_0x8a78('0x16')]?_0x18269a[_0x8a78('0x16')]['include']?_[_0x8a78('0x19')](_0x18269a['options'][_0x8a78('0x1a')],function(_0x43305f){return{'model':db[_0x43305f[_0x8a78('0x1b')]],'as':_0x43305f['as'],'attributes':_0x43305f[_0x8a78('0x1c')],'include':_0x43305f[_0x8a78('0x1a')]?_[_0x8a78('0x19')](_0x43305f['include'],function(_0x5c2115){return{'model':db[_0x5c2115[_0x8a78('0x1b')]],'as':_0x5c2115['as'],'attributes':_0x5c2115[_0x8a78('0x1c')],'include':_0x5c2115[_0x8a78('0x1a')]?_['map'](_0x5c2115[_0x8a78('0x1a')],function(_0x43f182){return{'model':db[_0x43f182[_0x8a78('0x1b')]],'as':_0x43f182['as'],'attributes':_0x43f182[_0x8a78('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x8a78('0x9')](function(_0x38b27d){logger[_0x8a78('0x1d')]('GetMailServerIn',_0x18269a);logger['debug'](_0x8a78('0x13'),_0x18269a,JSON[_0x8a78('0xe')](_0x38b27d));_0x1f2cb9(_0x38b27d);})[_0x8a78('0x12')](function(_0x19c208){logger['error'](_0x8a78('0x13'),_0x19c208[_0x8a78('0x11')],_0x18269a);_0x20343b(_0x9ce954['error'](0x1f4,_0x19c208[_0x8a78('0x11')]));});});}; \ No newline at end of file +var _0xd1d3=['result','catch','GetMailServerIn','MailServerIn','findAll','options','raw','where','limit','include','map','attributes','model','stringify','util','moment','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','MailServerIn,\x20%s,\x20%s','debug','MailServerIn,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info'];(function(_0x304269,_0x43fb9f){var _0x1222c0=function(_0x5d314a){while(--_0x5d314a){_0x304269['push'](_0x304269['shift']());}};_0x1222c0(++_0x43fb9f);}(_0xd1d3,0x68));var _0x3d1d=function(_0x5cda5e,_0x1e0d7f){_0x5cda5e=_0x5cda5e-0x0;var _0x4e4343=_0xd1d3[_0x5cda5e];return _0x4e4343;};'use strict';var _=require('lodash');var util=require(_0x3d1d('0x0'));var moment=require(_0x3d1d('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3d1d('0x2'))['db'];var utils=require(_0x3d1d('0x3'));var logger=require('../../config/logger')(_0x3d1d('0x4'));var config=require(_0x3d1d('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x3d1d('0x6')][_0x3d1d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x11abf9,_0x56b91c,_0x471516){return new BPromise(function(_0x130bbc,_0x5c41d7){return client[_0x3d1d('0x8')](_0x11abf9,_0x471516)['then'](function(_0x7e1ae2){logger['info'](_0x3d1d('0x9'),_0x56b91c,'request\x20sent');logger[_0x3d1d('0xa')](_0x3d1d('0xb'),_0x56b91c,_0x3d1d('0xc'),JSON['stringify'](_0x7e1ae2));if(_0x7e1ae2['error']){if(_0x7e1ae2['error']['code']===0x1f4){logger[_0x3d1d('0xd')]('MailServerIn,\x20%s,\x20%s',_0x56b91c,_0x7e1ae2[_0x3d1d('0xd')][_0x3d1d('0xe')]);return _0x5c41d7(_0x7e1ae2['error'][_0x3d1d('0xe')]);}logger[_0x3d1d('0xd')](_0x3d1d('0x9'),_0x56b91c,_0x7e1ae2[_0x3d1d('0xd')][_0x3d1d('0xe')]);return _0x130bbc(_0x7e1ae2['error'][_0x3d1d('0xe')]);}else{logger[_0x3d1d('0xf')](_0x3d1d('0x9'),_0x56b91c,_0x3d1d('0xc'));_0x130bbc(_0x7e1ae2[_0x3d1d('0x10')][_0x3d1d('0xe')]);}})[_0x3d1d('0x11')](function(_0x51c3a9){logger[_0x3d1d('0xd')](_0x3d1d('0x9'),_0x56b91c,_0x51c3a9);_0x5c41d7(_0x51c3a9);});});}exports[_0x3d1d('0x12')]=function(_0x630b4a){var _0x43d2da=this;return new Promise(function(_0x257dc2,_0x31acf9){return db[_0x3d1d('0x13')][_0x3d1d('0x14')]({'raw':_0x630b4a['options']?_0x630b4a[_0x3d1d('0x15')][_0x3d1d('0x16')]===undefined?!![]:![]:!![],'where':_0x630b4a[_0x3d1d('0x15')]?_0x630b4a[_0x3d1d('0x15')][_0x3d1d('0x17')]||null:null,'attributes':_0x630b4a[_0x3d1d('0x15')]?_0x630b4a[_0x3d1d('0x15')]['attributes']||null:null,'limit':_0x630b4a['options']?_0x630b4a[_0x3d1d('0x15')][_0x3d1d('0x18')]||null:null,'include':_0x630b4a[_0x3d1d('0x15')]?_0x630b4a[_0x3d1d('0x15')][_0x3d1d('0x19')]?_[_0x3d1d('0x1a')](_0x630b4a['options']['include'],function(_0x4420fb){return{'model':db[_0x4420fb['model']],'as':_0x4420fb['as'],'attributes':_0x4420fb[_0x3d1d('0x1b')],'include':_0x4420fb['include']?_[_0x3d1d('0x1a')](_0x4420fb['include'],function(_0x5c8952){return{'model':db[_0x5c8952[_0x3d1d('0x1c')]],'as':_0x5c8952['as'],'attributes':_0x5c8952[_0x3d1d('0x1b')],'include':_0x5c8952[_0x3d1d('0x19')]?_['map'](_0x5c8952[_0x3d1d('0x19')],function(_0x3ea89e){return{'model':db[_0x3ea89e[_0x3d1d('0x1c')]],'as':_0x3ea89e['as'],'attributes':_0x3ea89e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x18d7d5){logger[_0x3d1d('0xf')](_0x3d1d('0x12'),_0x630b4a);logger[_0x3d1d('0xa')](_0x3d1d('0x12'),_0x630b4a,JSON[_0x3d1d('0x1d')](_0x18d7d5));_0x257dc2(_0x18d7d5);})['catch'](function(_0x2edfba){logger['error']('GetMailServerIn',_0x2edfba['message'],_0x630b4a);_0x31acf9(_0x43d2da[_0x3d1d('0xd')](0x1f4,_0x2edfba[_0x3d1d('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 3b8904c..c33bc54 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(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x7a54,0x106));var _0x47a5=function(_0x27a742,_0xc7f8f2){_0x27a742=_0x27a742-0x0;var _0x1dd890=_0x7a54[_0x27a742];return _0x1dd890;};'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 _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'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('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index 73ac2d3..8c26f36 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 _0x02ce=['STRING','INTEGER','BOOLEAN','sequelize','exports'];(function(_0x3f460a,_0x3292aa){var _0x1c0967=function(_0x4e9596){while(--_0x4e9596){_0x3f460a['push'](_0x3f460a['shift']());}};_0x1c0967(++_0x3292aa);}(_0x02ce,0x1ac));var _0xe02c=function(_0x87fdaf,_0x165914){_0x87fdaf=_0x87fdaf-0x0;var _0x5dacf0=_0x02ce[_0x87fdaf];return _0x5dacf0;};'use strict';var Sequelize=require(_0xe02c('0x0'));module[_0xe02c('0x1')]={'description':{'type':Sequelize[_0xe02c('0x2')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0xe02c('0x2')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xe02c('0x3')]},'secure':{'type':Sequelize[_0xe02c('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0xe02c('0x2')]},'authentication':{'type':Sequelize[_0xe02c('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xe02c('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x3c81=['STRING','BOOLEAN','sequelize','exports'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x3c81,0x102));var _0x13c8=function(_0x567b79,_0x4b91ed){_0x567b79=_0x567b79-0x0;var _0x4c7b28=_0x3c81[_0x567b79];return _0x4c7b28;};'use strict';var Sequelize=require(_0x13c8('0x0'));module[_0x13c8('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x13c8('0x2')]},'user':{'type':Sequelize[_0x13c8('0x2')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x13c8('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x13c8('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 091952e..3b5f1bf 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 _0x6e81=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','save','update','destroy','stack','name','index','map','MailServerOut','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','then','catch','show','params','keys','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x39ab26,_0x40f18f){var _0x3a3796=function(_0x154d22){while(--_0x154d22){_0x39ab26['push'](_0x39ab26['shift']());}};_0x3a3796(++_0x40f18f);}(_0x6e81,0x158));var _0x16e8=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x6e81[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require(_0x16e8('0x0'));var rimraf=require(_0x16e8('0x1'));var zipdir=require(_0x16e8('0x2'));var jsonpatch=require(_0x16e8('0x3'));var rp=require('request-promise');var moment=require(_0x16e8('0x4'));var BPromise=require(_0x16e8('0x5'));var Mustache=require('mustache');var util=require(_0x16e8('0x6'));var path=require(_0x16e8('0x7'));var sox=require(_0x16e8('0x8'));var csv=require(_0x16e8('0x9'));var ejs=require(_0x16e8('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x16e8('0xb'));var squel=require(_0x16e8('0xc'));var crypto=require(_0x16e8('0xd'));var jsforce=require(_0x16e8('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x16e8('0xf'));var Redis=require(_0x16e8('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x16e8('0x11'));var as=require(_0x16e8('0x12'));var hardwareService=require(_0x16e8('0x13'));var logger=require(_0x16e8('0x14'))('api');var utils=require(_0x16e8('0x15'));var config=require(_0x16e8('0x16'));var licenseUtil=require(_0x16e8('0x17'));var db=require(_0x16e8('0x18'))['db'];function respondWithStatusCode(_0x4bff89,_0x444f48){_0x444f48=_0x444f48||0xcc;return function(_0x19719a){if(_0x19719a){return _0x4bff89[_0x16e8('0x19')](_0x444f48);}return _0x4bff89[_0x16e8('0x1a')](_0x444f48)[_0x16e8('0x1b')]();};}function respondWithResult(_0x17651a,_0x2f5015){_0x2f5015=_0x2f5015||0xc8;return function(_0x5e0861){if(_0x5e0861){return _0x17651a[_0x16e8('0x1a')](_0x2f5015)[_0x16e8('0x1c')](_0x5e0861);}};}function respondWithFilteredResult(_0x2b3943,_0x570956){return function(_0x1ed5b7){if(_0x1ed5b7){var _0xc8d305=typeof _0x570956[_0x16e8('0x1d')]==='undefined'&&typeof _0x570956[_0x16e8('0x1e')]==='undefined';var _0xa8541c=_0x1ed5b7['count'];var _0x215c18=_0xc8d305?0x0:_0x570956[_0x16e8('0x1d')];var _0x8e1d41=_0xc8d305?_0x1ed5b7[_0x16e8('0x1f')]:_0x570956[_0x16e8('0x1d')]+_0x570956[_0x16e8('0x1e')];var _0x1daf9a;if(_0x8e1d41>=_0xa8541c){_0x8e1d41=_0xa8541c;_0x1daf9a=0xc8;}else{_0x1daf9a=0xce;}_0x2b3943['status'](_0x1daf9a);return _0x2b3943['set'](_0x16e8('0x20'),_0x215c18+'-'+_0x8e1d41+'/'+_0xa8541c)[_0x16e8('0x1c')](_0x1ed5b7);}return null;};}function patchUpdates(_0x6071fd){return function(_0x413007){try{jsonpatch[_0x16e8('0x21')](_0x413007,_0x6071fd,!![]);}catch(_0x5e69e6){return BPromise[_0x16e8('0x22')](_0x5e69e6);}return _0x413007[_0x16e8('0x23')]();};}function saveUpdates(_0x3b8832,_0x4361ef){return function(_0x44a9cf){if(_0x44a9cf){return _0x44a9cf[_0x16e8('0x24')](_0x3b8832)['then'](function(_0xadfcf4){return _0xadfcf4;});}return null;};}function removeEntity(_0x27085a,_0x482b36){return function(_0x493832){if(_0x493832){return _0x493832[_0x16e8('0x25')]()['then'](function(){_0x27085a[_0x16e8('0x1a')](0xcc)[_0x16e8('0x1b')]();});}};}function handleEntityNotFound(_0x35c511,_0x385067){return function(_0x361c3f){if(!_0x361c3f){_0x35c511[_0x16e8('0x19')](0x194);}return _0x361c3f;};}function handleError(_0x53c795,_0x3cce67){_0x3cce67=_0x3cce67||0x1f4;return function(_0x2a5eae){logger['error'](_0x2a5eae[_0x16e8('0x26')]);if(_0x2a5eae[_0x16e8('0x27')]){delete _0x2a5eae[_0x16e8('0x27')];}_0x53c795[_0x16e8('0x1a')](_0x3cce67)['send'](_0x2a5eae);};}exports[_0x16e8('0x28')]=function(_0xf0d776,_0xdde1e9){var _0x19cf31={},_0x17b2bd={},_0x413b98={'count':0x0,'rows':[]};var _0x2a3b0f=_[_0x16e8('0x29')](db[_0x16e8('0x2a')][_0x16e8('0x2b')],function(_0x5bcc44){return{'name':_0x5bcc44['fieldName'],'type':_0x5bcc44['type'][_0x16e8('0x2c')]};});_0x17b2bd[_0x16e8('0x2d')]=_['map'](_0x2a3b0f,'name');_0x17b2bd[_0x16e8('0x2e')]=_['keys'](_0xf0d776[_0x16e8('0x2e')]);_0x17b2bd[_0x16e8('0x2f')]=_[_0x16e8('0x30')](_0x17b2bd[_0x16e8('0x2d')],_0x17b2bd[_0x16e8('0x2e')]);_0x19cf31[_0x16e8('0x31')]=_[_0x16e8('0x30')](_0x17b2bd[_0x16e8('0x2d')],qs[_0x16e8('0x32')](_0xf0d776[_0x16e8('0x2e')][_0x16e8('0x32')]));_0x19cf31[_0x16e8('0x31')]=_0x19cf31[_0x16e8('0x31')][_0x16e8('0x33')]?_0x19cf31[_0x16e8('0x31')]:_0x17b2bd[_0x16e8('0x2d')];if(!_0xf0d776[_0x16e8('0x2e')][_0x16e8('0x34')](_0x16e8('0x35'))){_0x19cf31[_0x16e8('0x1e')]=qs[_0x16e8('0x1e')](_0xf0d776[_0x16e8('0x2e')]['limit']);_0x19cf31[_0x16e8('0x1d')]=qs[_0x16e8('0x1d')](_0xf0d776[_0x16e8('0x2e')][_0x16e8('0x1d')]);}_0x19cf31[_0x16e8('0x36')]=qs[_0x16e8('0x37')](_0xf0d776[_0x16e8('0x2e')]['sort']);_0x19cf31[_0x16e8('0x38')]=qs[_0x16e8('0x2f')](_[_0x16e8('0x39')](_0xf0d776[_0x16e8('0x2e')],_0x17b2bd[_0x16e8('0x2f')]),_0x2a3b0f);if(_0xf0d776[_0x16e8('0x2e')][_0x16e8('0x3a')]){_0x19cf31[_0x16e8('0x38')]=_[_0x16e8('0x3b')](_0x19cf31['where'],{'$or':_[_0x16e8('0x29')](_0x2a3b0f,function(_0x410e76){if(_0x410e76[_0x16e8('0x3c')]!=='VIRTUAL'){var _0x2bad26={};_0x2bad26[_0x410e76[_0x16e8('0x27')]]={'$like':'%'+_0xf0d776[_0x16e8('0x2e')][_0x16e8('0x3a')]+'%'};return _0x2bad26;}})});}_0x19cf31=_[_0x16e8('0x3b')]({},_0x19cf31,_0xf0d776[_0x16e8('0x3d')]);var _0x4bf67b={'where':_0x19cf31[_0x16e8('0x38')]};return db[_0x16e8('0x2a')][_0x16e8('0x1f')](_0x4bf67b)['then'](function(_0x6efd9c){_0x413b98[_0x16e8('0x1f')]=_0x6efd9c;if(_0xf0d776[_0x16e8('0x2e')][_0x16e8('0x3e')]){_0x19cf31[_0x16e8('0x3f')]=[{'all':!![]}];}return db[_0x16e8('0x2a')][_0x16e8('0x40')](_0x19cf31);})[_0x16e8('0x41')](function(_0x406094){_0x413b98['rows']=_0x406094;return _0x413b98;})[_0x16e8('0x41')](respondWithFilteredResult(_0xdde1e9,_0x19cf31))[_0x16e8('0x42')](handleError(_0xdde1e9,null));};exports[_0x16e8('0x43')]=function(_0x132d88,_0x4e913b){var _0xa04a45={'raw':!![],'where':{'id':_0x132d88[_0x16e8('0x44')]['id']}},_0x49a8ac={};_0x49a8ac[_0x16e8('0x2d')]=_['keys'](db[_0x16e8('0x2a')][_0x16e8('0x2b')]);_0x49a8ac[_0x16e8('0x2e')]=_[_0x16e8('0x45')](_0x132d88[_0x16e8('0x2e')]);_0x49a8ac['filters']=_[_0x16e8('0x30')](_0x49a8ac[_0x16e8('0x2d')],_0x49a8ac[_0x16e8('0x2e')]);_0xa04a45[_0x16e8('0x31')]=_['intersection'](_0x49a8ac[_0x16e8('0x2d')],qs[_0x16e8('0x32')](_0x132d88[_0x16e8('0x2e')][_0x16e8('0x32')]));_0xa04a45['attributes']=_0xa04a45['attributes'][_0x16e8('0x33')]?_0xa04a45[_0x16e8('0x31')]:_0x49a8ac[_0x16e8('0x2d')];if(_0x132d88['query'][_0x16e8('0x3e')]){_0xa04a45[_0x16e8('0x3f')]=[{'all':!![]}];}_0xa04a45=_[_0x16e8('0x3b')]({},_0xa04a45,_0x132d88[_0x16e8('0x3d')]);return db[_0x16e8('0x2a')][_0x16e8('0x46')](_0xa04a45)['then'](handleEntityNotFound(_0x4e913b,null))[_0x16e8('0x41')](respondWithResult(_0x4e913b,null))['catch'](handleError(_0x4e913b,null));};exports['create']=function(_0x346700,_0x22922d){return db[_0x16e8('0x2a')][_0x16e8('0x47')](_0x346700[_0x16e8('0x48')],{})[_0x16e8('0x41')](respondWithResult(_0x22922d,0xc9))[_0x16e8('0x42')](handleError(_0x22922d,null));};exports[_0x16e8('0x24')]=function(_0xe765fb,_0x284c93){if(_0xe765fb[_0x16e8('0x48')]['id']){delete _0xe765fb[_0x16e8('0x48')]['id'];}return db[_0x16e8('0x2a')][_0x16e8('0x46')]({'where':{'id':_0xe765fb[_0x16e8('0x44')]['id']}})[_0x16e8('0x41')](handleEntityNotFound(_0x284c93,null))[_0x16e8('0x41')](saveUpdates(_0xe765fb[_0x16e8('0x48')],null))['then'](respondWithResult(_0x284c93,null))['catch'](handleError(_0x284c93,null));};exports[_0x16e8('0x25')]=function(_0x339b07,_0x1e7ef0){return db[_0x16e8('0x2a')][_0x16e8('0x46')]({'where':{'id':_0x339b07[_0x16e8('0x44')]['id']}})[_0x16e8('0x41')](handleEntityNotFound(_0x1e7ef0,null))[_0x16e8('0x41')](removeEntity(_0x1e7ef0,null))['catch'](handleError(_0x1e7ef0,null));}; \ No newline at end of file +var _0xca0f=['bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','reject','save','update','then','destroy','name','index','map','MailServerOut','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','rows','catch','params','keys','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x2f8711,_0x283af8){var _0x292a4f=function(_0x4af53f){while(--_0x4af53f){_0x2f8711['push'](_0x2f8711['shift']());}};_0x292a4f(++_0x283af8);}(_0xca0f,0xcd));var _0xfca0=function(_0x1be8d4,_0x4e9d06){_0x1be8d4=_0x1be8d4-0x0;var _0xa5171a=_0xca0f[_0x1be8d4];return _0xa5171a;};'use strict';var emlformat=require(_0xfca0('0x0'));var rimraf=require(_0xfca0('0x1'));var zipdir=require(_0xfca0('0x2'));var jsonpatch=require(_0xfca0('0x3'));var rp=require(_0xfca0('0x4'));var moment=require('moment');var BPromise=require(_0xfca0('0x5'));var Mustache=require(_0xfca0('0x6'));var util=require(_0xfca0('0x7'));var path=require('path');var sox=require(_0xfca0('0x8'));var csv=require('to-csv');var ejs=require(_0xfca0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfca0('0xa'));var squel=require(_0xfca0('0xb'));var crypto=require(_0xfca0('0xc'));var jsforce=require(_0xfca0('0xd'));var deskjs=require(_0xfca0('0xe'));var toCsv=require(_0xfca0('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xfca0('0x10'));var authService=require(_0xfca0('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfca0('0x12'));var logger=require(_0xfca0('0x13'))(_0xfca0('0x14'));var utils=require(_0xfca0('0x15'));var config=require(_0xfca0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xfca0('0x17'))['db'];function respondWithStatusCode(_0x23c816,_0x132624){_0x132624=_0x132624||0xcc;return function(_0x2f04b6){if(_0x2f04b6){return _0x23c816[_0xfca0('0x18')](_0x132624);}return _0x23c816[_0xfca0('0x19')](_0x132624)[_0xfca0('0x1a')]();};}function respondWithResult(_0x1fe47b,_0x3e156d){_0x3e156d=_0x3e156d||0xc8;return function(_0x3351e2){if(_0x3351e2){return _0x1fe47b['status'](_0x3e156d)[_0xfca0('0x1b')](_0x3351e2);}};}function respondWithFilteredResult(_0x1ae0c1,_0x2f53ae){return function(_0x3da004){if(_0x3da004){var _0x1f5c4b=typeof _0x2f53ae[_0xfca0('0x1c')]==='undefined'&&typeof _0x2f53ae[_0xfca0('0x1d')]==='undefined';var _0x40c04f=_0x3da004[_0xfca0('0x1e')];var _0x854952=_0x1f5c4b?0x0:_0x2f53ae['offset'];var _0x1c01d0=_0x1f5c4b?_0x3da004[_0xfca0('0x1e')]:_0x2f53ae[_0xfca0('0x1c')]+_0x2f53ae[_0xfca0('0x1d')];var _0x56ac01;if(_0x1c01d0>=_0x40c04f){_0x1c01d0=_0x40c04f;_0x56ac01=0xc8;}else{_0x56ac01=0xce;}_0x1ae0c1[_0xfca0('0x19')](_0x56ac01);return _0x1ae0c1[_0xfca0('0x1f')]('Content-Range',_0x854952+'-'+_0x1c01d0+'/'+_0x40c04f)[_0xfca0('0x1b')](_0x3da004);}return null;};}function patchUpdates(_0x11fc48){return function(_0x4511f1){try{jsonpatch['apply'](_0x4511f1,_0x11fc48,!![]);}catch(_0xe1efeb){return BPromise[_0xfca0('0x20')](_0xe1efeb);}return _0x4511f1[_0xfca0('0x21')]();};}function saveUpdates(_0x4158e1,_0x44afdf){return function(_0x3e76ee){if(_0x3e76ee){return _0x3e76ee[_0xfca0('0x22')](_0x4158e1)[_0xfca0('0x23')](function(_0x3de4ad){return _0x3de4ad;});}return null;};}function removeEntity(_0xd98eb,_0x136a10){return function(_0x579c20){if(_0x579c20){return _0x579c20[_0xfca0('0x24')]()[_0xfca0('0x23')](function(){_0xd98eb[_0xfca0('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x245c44,_0x4e7a7){return function(_0x38ab4f){if(!_0x38ab4f){_0x245c44[_0xfca0('0x18')](0x194);}return _0x38ab4f;};}function handleError(_0x43b19b,_0x37ec39){_0x37ec39=_0x37ec39||0x1f4;return function(_0x3db112){logger['error'](_0x3db112['stack']);if(_0x3db112[_0xfca0('0x25')]){delete _0x3db112[_0xfca0('0x25')];}_0x43b19b[_0xfca0('0x19')](_0x37ec39)['send'](_0x3db112);};}exports[_0xfca0('0x26')]=function(_0x5b99d1,_0x2ad155){var _0x427ae8={},_0x128333={},_0x247def={'count':0x0,'rows':[]};var _0x44cae8=_[_0xfca0('0x27')](db[_0xfca0('0x28')][_0xfca0('0x29')],function(_0xc93dfd){return{'name':_0xc93dfd[_0xfca0('0x2a')],'type':_0xc93dfd[_0xfca0('0x2b')][_0xfca0('0x2c')]};});_0x128333[_0xfca0('0x2d')]=_[_0xfca0('0x27')](_0x44cae8,_0xfca0('0x25'));_0x128333[_0xfca0('0x2e')]=_['keys'](_0x5b99d1[_0xfca0('0x2e')]);_0x128333[_0xfca0('0x2f')]=_[_0xfca0('0x30')](_0x128333[_0xfca0('0x2d')],_0x128333['query']);_0x427ae8['attributes']=_[_0xfca0('0x30')](_0x128333['model'],qs[_0xfca0('0x31')](_0x5b99d1[_0xfca0('0x2e')][_0xfca0('0x31')]));_0x427ae8['attributes']=_0x427ae8[_0xfca0('0x32')][_0xfca0('0x33')]?_0x427ae8[_0xfca0('0x32')]:_0x128333[_0xfca0('0x2d')];if(!_0x5b99d1[_0xfca0('0x2e')][_0xfca0('0x34')]('nolimit')){_0x427ae8['limit']=qs[_0xfca0('0x1d')](_0x5b99d1[_0xfca0('0x2e')][_0xfca0('0x1d')]);_0x427ae8[_0xfca0('0x1c')]=qs['offset'](_0x5b99d1[_0xfca0('0x2e')]['offset']);}_0x427ae8[_0xfca0('0x35')]=qs[_0xfca0('0x36')](_0x5b99d1[_0xfca0('0x2e')]['sort']);_0x427ae8[_0xfca0('0x37')]=qs['filters'](_[_0xfca0('0x38')](_0x5b99d1[_0xfca0('0x2e')],_0x128333[_0xfca0('0x2f')]),_0x44cae8);if(_0x5b99d1[_0xfca0('0x2e')]['filter']){_0x427ae8[_0xfca0('0x37')]=_['merge'](_0x427ae8[_0xfca0('0x37')],{'$or':_[_0xfca0('0x27')](_0x44cae8,function(_0x4ade7f){if(_0x4ade7f[_0xfca0('0x2b')]!==_0xfca0('0x39')){var _0x8d099={};_0x8d099[_0x4ade7f['name']]={'$like':'%'+_0x5b99d1['query'][_0xfca0('0x3a')]+'%'};return _0x8d099;}})});}_0x427ae8=_[_0xfca0('0x3b')]({},_0x427ae8,_0x5b99d1[_0xfca0('0x3c')]);var _0x1eb4c0={'where':_0x427ae8['where']};return db[_0xfca0('0x28')][_0xfca0('0x1e')](_0x1eb4c0)[_0xfca0('0x23')](function(_0x3c9a7f){_0x247def[_0xfca0('0x1e')]=_0x3c9a7f;if(_0x5b99d1[_0xfca0('0x2e')][_0xfca0('0x3d')]){_0x427ae8[_0xfca0('0x3e')]=[{'all':!![]}];}return db[_0xfca0('0x28')]['findAll'](_0x427ae8);})[_0xfca0('0x23')](function(_0x478d62){_0x247def[_0xfca0('0x3f')]=_0x478d62;return _0x247def;})[_0xfca0('0x23')](respondWithFilteredResult(_0x2ad155,_0x427ae8))[_0xfca0('0x40')](handleError(_0x2ad155,null));};exports['show']=function(_0x4d845,_0x48d655){var _0x150a0b={'raw':!![],'where':{'id':_0x4d845[_0xfca0('0x41')]['id']}},_0xe7281={};_0xe7281[_0xfca0('0x2d')]=_[_0xfca0('0x42')](db[_0xfca0('0x28')]['rawAttributes']);_0xe7281[_0xfca0('0x2e')]=_['keys'](_0x4d845[_0xfca0('0x2e')]);_0xe7281[_0xfca0('0x2f')]=_[_0xfca0('0x30')](_0xe7281[_0xfca0('0x2d')],_0xe7281[_0xfca0('0x2e')]);_0x150a0b[_0xfca0('0x32')]=_[_0xfca0('0x30')](_0xe7281[_0xfca0('0x2d')],qs[_0xfca0('0x31')](_0x4d845[_0xfca0('0x2e')][_0xfca0('0x31')]));_0x150a0b[_0xfca0('0x32')]=_0x150a0b[_0xfca0('0x32')][_0xfca0('0x33')]?_0x150a0b[_0xfca0('0x32')]:_0xe7281[_0xfca0('0x2d')];if(_0x4d845[_0xfca0('0x2e')]['includeAll']){_0x150a0b['include']=[{'all':!![]}];}_0x150a0b=_['merge']({},_0x150a0b,_0x4d845[_0xfca0('0x3c')]);return db[_0xfca0('0x28')][_0xfca0('0x43')](_0x150a0b)[_0xfca0('0x23')](handleEntityNotFound(_0x48d655,null))[_0xfca0('0x23')](respondWithResult(_0x48d655,null))[_0xfca0('0x40')](handleError(_0x48d655,null));};exports[_0xfca0('0x44')]=function(_0x37b339,_0x3b8022){return db[_0xfca0('0x28')][_0xfca0('0x44')](_0x37b339[_0xfca0('0x45')],{})[_0xfca0('0x23')](respondWithResult(_0x3b8022,0xc9))[_0xfca0('0x40')](handleError(_0x3b8022,null));};exports[_0xfca0('0x22')]=function(_0x446552,_0x4dedd0){if(_0x446552[_0xfca0('0x45')]['id']){delete _0x446552[_0xfca0('0x45')]['id'];}return db['MailServerOut'][_0xfca0('0x43')]({'where':{'id':_0x446552[_0xfca0('0x41')]['id']}})[_0xfca0('0x23')](handleEntityNotFound(_0x4dedd0,null))[_0xfca0('0x23')](saveUpdates(_0x446552[_0xfca0('0x45')],null))['then'](respondWithResult(_0x4dedd0,null))[_0xfca0('0x40')](handleError(_0x4dedd0,null));};exports[_0xfca0('0x24')]=function(_0x1ce799,_0x5719f2){return db[_0xfca0('0x28')][_0xfca0('0x43')]({'where':{'id':_0x1ce799['params']['id']}})[_0xfca0('0x23')](handleEntityNotFound(_0x5719f2,null))['then'](removeEntity(_0x5719f2,null))[_0xfca0('0x40')](handleError(_0x5719f2,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index c28b98e..238bc71 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 _0xf473=['api','moment','bluebird','path','./mailServerOut.attributes','define','MailServerOut','lodash','util','../../config/logger'];(function(_0x1c93c1,_0x2865bc){var _0x1f089b=function(_0x10aa51){while(--_0x10aa51){_0x1c93c1['push'](_0x1c93c1['shift']());}};_0x1f089b(++_0x2865bc);}(_0xf473,0x1a1));var _0x3f47=function(_0x51ce14,_0x5cd58b){_0x51ce14=_0x51ce14-0x0;var _0x301a2d=_0xf473[_0x51ce14];return _0x301a2d;};'use strict';var _=require(_0x3f47('0x0'));var util=require(_0x3f47('0x1'));var logger=require(_0x3f47('0x2'))(_0x3f47('0x3'));var moment=require(_0x3f47('0x4'));var BPromise=require(_0x3f47('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3f47('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3f47('0x7'));module['exports']=function(_0x48a459,_0x4d05a1){return _0x48a459[_0x3f47('0x8')](_0x3f47('0x9'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe8a1=['define','MailServerOut','mail_servers_out','lodash','util','../../config/logger','bluebird','request-promise','path','../../config/environment'];(function(_0xfc6598,_0x554d40){var _0x210628=function(_0x4f810e){while(--_0x4f810e){_0xfc6598['push'](_0xfc6598['shift']());}};_0x210628(++_0x554d40);}(_0xe8a1,0x14d));var _0x1e8a=function(_0x5c7dce,_0x15a599){_0x5c7dce=_0x5c7dce-0x0;var _0x4d25b7=_0xe8a1[_0x5c7dce];return _0x4d25b7;};'use strict';var _=require(_0x1e8a('0x0'));var util=require(_0x1e8a('0x1'));var logger=require(_0x1e8a('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1e8a('0x3'));var rp=require(_0x1e8a('0x4'));var fs=require('fs');var path=require(_0x1e8a('0x5'));var rimraf=require('rimraf');var config=require(_0x1e8a('0x6'));var attributes=require('./mailServerOut.attributes');module['exports']=function(_0x144fdb,_0x562630){return _0x144fdb[_0x1e8a('0x7')](_0x1e8a('0x8'),attributes,{'tableName':_0x1e8a('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 e910f09..df6cd1e 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 _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x5cced4,_0x540d9e){var _0xdb9c7e=function(_0x224b7b){while(--_0x224b7b){_0x5cced4['push'](_0x5cced4['shift']());}};_0xdb9c7e(++_0x540d9e);}(_0xdb28,0x106));var _0x8db2=function(_0x9d3fc8,_0x2ba300){_0x9d3fc8=_0x9d3fc8-0x0;var _0x56a9ad=_0xdb28[_0x9d3fc8];return _0x56a9ad;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file +var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailServerOut,\x20%s,\x20%s','MailServerOut,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x634811,_0xc4455c){var _0x31aa5b=function(_0xec9150){while(--_0xec9150){_0x634811['push'](_0x634811['shift']());}};_0x31aa5b(++_0xc4455c);}(_0x2ef3,0xba));var _0x32ef=function(_0x136bbc,_0x35d5c6){_0x136bbc=_0x136bbc-0x0;var _0x162cf0=_0x2ef3[_0x136bbc];return _0x162cf0;};'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')]('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 159ab85..908162d 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 _0x9faa=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe','/:id','show','post'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9faa,0x194));var _0xa9fa=function(_0x42d64b,_0x2b963){_0x42d64b=_0x42d64b-0x0;var _0x15924f=_0x9faa[_0x42d64b];return _0x15924f;};'use strict';var multer=require(_0xa9fa('0x0'));var util=require(_0xa9fa('0x1'));var path=require(_0xa9fa('0x2'));var timeout=require(_0xa9fa('0x3'));var express=require(_0xa9fa('0x4'));var router=express['Router']();var fs_extra=require(_0xa9fa('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa9fa('0x6'));var config=require(_0xa9fa('0x7'));var controller=require(_0xa9fa('0x8'));router[_0xa9fa('0x9')]('/',auth[_0xa9fa('0xa')](),controller[_0xa9fa('0xb')]);router[_0xa9fa('0x9')](_0xa9fa('0xc'),auth[_0xa9fa('0xa')](),controller['describe']);router[_0xa9fa('0x9')](_0xa9fa('0xd'),auth['isAuthenticated'](),controller[_0xa9fa('0xe')]);router[_0xa9fa('0xf')]('/',auth[_0xa9fa('0xa')](),controller['create']);router['put'](_0xa9fa('0xd'),auth[_0xa9fa('0xa')](),controller[_0xa9fa('0x10')]);router[_0xa9fa('0x11')](_0xa9fa('0xd'),auth[_0xa9fa('0xa')](),controller[_0xa9fa('0x12')]);module[_0xa9fa('0x13')]=router; \ No newline at end of file +var _0xb716=['post','create','update','delete','destroy','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./mailSubstatus.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x5c09b2,_0x70070d){var _0x531e59=function(_0x49a1b5){while(--_0x49a1b5){_0x5c09b2['push'](_0x5c09b2['shift']());}};_0x531e59(++_0x70070d);}(_0xb716,0xa7));var _0x6b71=function(_0x3586a9,_0x1c11cd){_0x3586a9=_0x3586a9-0x0;var _0x380c1e=_0xb716[_0x3586a9];return _0x380c1e;};'use strict';var multer=require(_0x6b71('0x0'));var util=require(_0x6b71('0x1'));var path=require('path');var timeout=require(_0x6b71('0x2'));var express=require(_0x6b71('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6b71('0x4'));var interaction=require(_0x6b71('0x5'));var config=require('../../config/environment');var controller=require(_0x6b71('0x6'));router[_0x6b71('0x7')]('/',auth[_0x6b71('0x8')](),controller[_0x6b71('0x9')]);router[_0x6b71('0x7')](_0x6b71('0xa'),auth[_0x6b71('0x8')](),controller[_0x6b71('0xb')]);router['get'](_0x6b71('0xc'),auth[_0x6b71('0x8')](),controller['show']);router[_0x6b71('0xd')]('/',auth[_0x6b71('0x8')](),controller[_0x6b71('0xe')]);router['put'](_0x6b71('0xc'),auth[_0x6b71('0x8')](),controller[_0x6b71('0xf')]);router[_0x6b71('0x10')](_0x6b71('0xc'),auth[_0x6b71('0x8')](),controller[_0x6b71('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 32a4083..a2b4f96 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 _0x90ec=['sequelize','exports','name','STRING'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x90ec,0x1d4));var _0xc90e=function(_0x560b41,_0x1fa071){_0x560b41=_0x560b41-0x0;var _0xddba81=_0x90ec[_0x560b41];return _0xddba81;};'use strict';var Sequelize=require(_0xc90e('0x0'));module[_0xc90e('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xc90e('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xc90e('0x3')]}}; \ No newline at end of file +var _0x9505=['STRING','sequelize','exports','name'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0x9505,0x1e5));var _0x5950=function(_0x3a5142,_0x55a30c){_0x3a5142=_0x3a5142-0x0;var _0xd19016=_0x9505[_0x3a5142];return _0xd19016;};'use strict';var Sequelize=require(_0x5950('0x0'));module[_0x5950('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x5950('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x5950('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index a195b73..16cd866 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 _0x8c92=['json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','MailSubstatus','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','include','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x1f75fa,_0x1d0a8e){var _0x347593=function(_0x28e63d){while(--_0x28e63d){_0x1f75fa['push'](_0x1f75fa['shift']());}};_0x347593(++_0x1d0a8e);}(_0x8c92,0x7f));var _0x28c9=function(_0x284145,_0x5a7ef0){_0x284145=_0x284145-0x0;var _0x24c78c=_0x8c92[_0x284145];return _0x24c78c;};'use strict';var emlformat=require(_0x28c9('0x0'));var rimraf=require(_0x28c9('0x1'));var zipdir=require(_0x28c9('0x2'));var jsonpatch=require(_0x28c9('0x3'));var rp=require(_0x28c9('0x4'));var moment=require(_0x28c9('0x5'));var BPromise=require(_0x28c9('0x6'));var Mustache=require(_0x28c9('0x7'));var util=require(_0x28c9('0x8'));var path=require(_0x28c9('0x9'));var sox=require(_0x28c9('0xa'));var csv=require(_0x28c9('0xb'));var ejs=require(_0x28c9('0xc'));var fs=require('fs');var fs_extra=require(_0x28c9('0xd'));var _=require('lodash');var squel=require(_0x28c9('0xe'));var crypto=require('crypto');var jsforce=require(_0x28c9('0xf'));var deskjs=require(_0x28c9('0x10'));var toCsv=require(_0x28c9('0xb'));var querystring=require('querystring');var Papa=require(_0x28c9('0x11'));var Redis=require(_0x28c9('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x28c9('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x28c9('0x14'));var logger=require(_0x28c9('0x15'))('api');var utils=require(_0x28c9('0x16'));var config=require(_0x28c9('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x28c9('0x18'))['db'];function respondWithStatusCode(_0x4f617d,_0xf0abe2){_0xf0abe2=_0xf0abe2||0xcc;return function(_0x25c8ac){if(_0x25c8ac){return _0x4f617d[_0x28c9('0x19')](_0xf0abe2);}return _0x4f617d[_0x28c9('0x1a')](_0xf0abe2)['end']();};}function respondWithResult(_0x34e6c1,_0x45db08){_0x45db08=_0x45db08||0xc8;return function(_0x174d9d){if(_0x174d9d){return _0x34e6c1[_0x28c9('0x1a')](_0x45db08)[_0x28c9('0x1b')](_0x174d9d);}};}function respondWithFilteredResult(_0x55b632,_0x567ba4){return function(_0x556ff0){if(_0x556ff0){var _0x31addc=typeof _0x567ba4[_0x28c9('0x1c')]===_0x28c9('0x1d')&&typeof _0x567ba4[_0x28c9('0x1e')]===_0x28c9('0x1d');var _0x5c13f7=_0x556ff0[_0x28c9('0x1f')];var _0x2be653=_0x31addc?0x0:_0x567ba4['offset'];var _0x249ebf=_0x31addc?_0x556ff0[_0x28c9('0x1f')]:_0x567ba4[_0x28c9('0x1c')]+_0x567ba4['limit'];var _0x2f75dd;if(_0x249ebf>=_0x5c13f7){_0x249ebf=_0x5c13f7;_0x2f75dd=0xc8;}else{_0x2f75dd=0xce;}_0x55b632[_0x28c9('0x1a')](_0x2f75dd);return _0x55b632[_0x28c9('0x20')](_0x28c9('0x21'),_0x2be653+'-'+_0x249ebf+'/'+_0x5c13f7)['json'](_0x556ff0);}return null;};}function patchUpdates(_0x3d4f1e){return function(_0x22cd16){try{jsonpatch[_0x28c9('0x22')](_0x22cd16,_0x3d4f1e,!![]);}catch(_0x236731){return BPromise[_0x28c9('0x23')](_0x236731);}return _0x22cd16[_0x28c9('0x24')]();};}function saveUpdates(_0x398350,_0x5afba2){return function(_0x5c332e){if(_0x5c332e){return _0x5c332e[_0x28c9('0x25')](_0x398350)[_0x28c9('0x26')](function(_0x35c4d4){return _0x35c4d4;});}return null;};}function removeEntity(_0x2bad22,_0x5f16f8){return function(_0x1d84db){if(_0x1d84db){return _0x1d84db[_0x28c9('0x27')]()[_0x28c9('0x26')](function(){_0x2bad22[_0x28c9('0x1a')](0xcc)[_0x28c9('0x28')]();});}};}function handleEntityNotFound(_0x76059f,_0xd4d988){return function(_0x3d8c79){if(!_0x3d8c79){_0x76059f[_0x28c9('0x19')](0x194);}return _0x3d8c79;};}function handleError(_0x527b04,_0x3f6a28){_0x3f6a28=_0x3f6a28||0x1f4;return function(_0x26ac99){logger[_0x28c9('0x29')](_0x26ac99[_0x28c9('0x2a')]);if(_0x26ac99['name']){delete _0x26ac99[_0x28c9('0x2b')];}_0x527b04[_0x28c9('0x1a')](_0x3f6a28)[_0x28c9('0x2c')](_0x26ac99);};}exports[_0x28c9('0x2d')]=function(_0x279b31,_0x258f9e){var _0x355f0d={},_0x1fe414={},_0xb90a49={'count':0x0,'rows':[]};var _0x55ceff=_[_0x28c9('0x2e')](db[_0x28c9('0x2f')]['rawAttributes'],function(_0x24b729){return{'name':_0x24b729[_0x28c9('0x30')],'type':_0x24b729[_0x28c9('0x31')][_0x28c9('0x32')]};});_0x1fe414[_0x28c9('0x33')]=_['map'](_0x55ceff,_0x28c9('0x2b'));_0x1fe414[_0x28c9('0x34')]=_[_0x28c9('0x35')](_0x279b31['query']);_0x1fe414[_0x28c9('0x36')]=_[_0x28c9('0x37')](_0x1fe414[_0x28c9('0x33')],_0x1fe414['query']);_0x355f0d['attributes']=_[_0x28c9('0x37')](_0x1fe414['model'],qs[_0x28c9('0x38')](_0x279b31['query'][_0x28c9('0x38')]));_0x355f0d['attributes']=_0x355f0d[_0x28c9('0x39')][_0x28c9('0x3a')]?_0x355f0d[_0x28c9('0x39')]:_0x1fe414[_0x28c9('0x33')];if(!_0x279b31[_0x28c9('0x34')]['hasOwnProperty'](_0x28c9('0x3b'))){_0x355f0d[_0x28c9('0x1e')]=qs[_0x28c9('0x1e')](_0x279b31[_0x28c9('0x34')]['limit']);_0x355f0d[_0x28c9('0x1c')]=qs[_0x28c9('0x1c')](_0x279b31[_0x28c9('0x34')][_0x28c9('0x1c')]);}_0x355f0d['order']=qs[_0x28c9('0x3c')](_0x279b31[_0x28c9('0x34')][_0x28c9('0x3c')]);_0x355f0d[_0x28c9('0x3d')]=qs[_0x28c9('0x36')](_[_0x28c9('0x3e')](_0x279b31['query'],_0x1fe414['filters']),_0x55ceff);if(_0x279b31[_0x28c9('0x34')][_0x28c9('0x3f')]){_0x355f0d['where']=_[_0x28c9('0x40')](_0x355f0d[_0x28c9('0x3d')],{'$or':_[_0x28c9('0x2e')](_0x55ceff,function(_0x4e8f86){if(_0x4e8f86[_0x28c9('0x31')]!==_0x28c9('0x41')){var _0x870c1d={};_0x870c1d[_0x4e8f86[_0x28c9('0x2b')]]={'$like':'%'+_0x279b31[_0x28c9('0x34')][_0x28c9('0x3f')]+'%'};return _0x870c1d;}})});}_0x355f0d=_[_0x28c9('0x40')]({},_0x355f0d,_0x279b31[_0x28c9('0x42')]);var _0x5e035a={'where':_0x355f0d[_0x28c9('0x3d')]};return db[_0x28c9('0x2f')][_0x28c9('0x1f')](_0x5e035a)[_0x28c9('0x26')](function(_0x34182c){_0xb90a49['count']=_0x34182c;if(_0x279b31['query'][_0x28c9('0x43')]){_0x355f0d['include']=[{'all':!![]}];}return db[_0x28c9('0x2f')][_0x28c9('0x44')](_0x355f0d);})[_0x28c9('0x26')](function(_0xf3ed80){_0xb90a49['rows']=_0xf3ed80;return _0xb90a49;})[_0x28c9('0x26')](respondWithFilteredResult(_0x258f9e,_0x355f0d))[_0x28c9('0x45')](handleError(_0x258f9e,null));};exports[_0x28c9('0x46')]=function(_0x3d1e6e,_0x256974){var _0x6fb75c={'raw':!![],'where':{'id':_0x3d1e6e['params']['id']}},_0x4a327e={};_0x4a327e[_0x28c9('0x33')]=_[_0x28c9('0x35')](db['MailSubstatus']['rawAttributes']);_0x4a327e[_0x28c9('0x34')]=_[_0x28c9('0x35')](_0x3d1e6e[_0x28c9('0x34')]);_0x4a327e['filters']=_[_0x28c9('0x37')](_0x4a327e[_0x28c9('0x33')],_0x4a327e[_0x28c9('0x34')]);_0x6fb75c[_0x28c9('0x39')]=_[_0x28c9('0x37')](_0x4a327e[_0x28c9('0x33')],qs[_0x28c9('0x38')](_0x3d1e6e[_0x28c9('0x34')][_0x28c9('0x38')]));_0x6fb75c[_0x28c9('0x39')]=_0x6fb75c['attributes'][_0x28c9('0x3a')]?_0x6fb75c['attributes']:_0x4a327e[_0x28c9('0x33')];if(_0x3d1e6e['query']['includeAll']){_0x6fb75c[_0x28c9('0x47')]=[{'all':!![]}];}_0x6fb75c=_[_0x28c9('0x40')]({},_0x6fb75c,_0x3d1e6e['options']);return db[_0x28c9('0x2f')][_0x28c9('0x48')](_0x6fb75c)[_0x28c9('0x26')](handleEntityNotFound(_0x256974,null))[_0x28c9('0x26')](respondWithResult(_0x256974,null))[_0x28c9('0x45')](handleError(_0x256974,null));};exports[_0x28c9('0x49')]=function(_0x1322cb,_0x487898){return db[_0x28c9('0x2f')]['create'](_0x1322cb[_0x28c9('0x4a')],{})[_0x28c9('0x26')](respondWithResult(_0x487898,0xc9))['catch'](handleError(_0x487898,null));};exports[_0x28c9('0x25')]=function(_0x5af34c,_0xa60c){if(_0x5af34c[_0x28c9('0x4a')]['id']){delete _0x5af34c['body']['id'];}return db[_0x28c9('0x2f')][_0x28c9('0x48')]({'where':{'id':_0x5af34c[_0x28c9('0x4b')]['id']}})[_0x28c9('0x26')](handleEntityNotFound(_0xa60c,null))[_0x28c9('0x26')](saveUpdates(_0x5af34c[_0x28c9('0x4a')],null))['then'](respondWithResult(_0xa60c,null))[_0x28c9('0x45')](handleError(_0xa60c,null));};exports['destroy']=function(_0x42b4c5,_0x46f954){return db['MailSubstatus'][_0x28c9('0x48')]({'where':{'id':_0x42b4c5[_0x28c9('0x4b')]['id']}})[_0x28c9('0x26')](handleEntityNotFound(_0x46f954,null))[_0x28c9('0x26')](removeEntity(_0x46f954,null))['catch'](handleError(_0x46f954,null));};exports[_0x28c9('0x4c')]=function(_0x20fd43,_0x477ec3){return db['MailSubstatus'][_0x28c9('0x4c')]()[_0x28c9('0x26')](respondWithResult(_0x477ec3,null))[_0x28c9('0x45')](handleError(_0x477ec3,null));}; \ No newline at end of file +var _0x301d=['status','end','json','offset','undefined','limit','count','apply','save','update','then','destroy','error','stack','name','send','map','MailSubstatus','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','includeAll','include','rows','catch','show','keys','length','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','squel','crypto','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x459ee0,_0x1e950d){var _0x1b87c8=function(_0x377855){while(--_0x377855){_0x459ee0['push'](_0x459ee0['shift']());}};_0x1b87c8(++_0x1e950d);}(_0x301d,0x101));var _0xd301=function(_0x4c938a,_0x5c17c4){_0x4c938a=_0x4c938a-0x0;var _0x4ab52f=_0x301d[_0x4c938a];return _0x4ab52f;};'use strict';var emlformat=require(_0xd301('0x0'));var rimraf=require(_0xd301('0x1'));var zipdir=require(_0xd301('0x2'));var jsonpatch=require(_0xd301('0x3'));var rp=require(_0xd301('0x4'));var moment=require(_0xd301('0x5'));var BPromise=require(_0xd301('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd301('0x7'));var sox=require(_0xd301('0x8'));var csv=require(_0xd301('0x9'));var ejs=require(_0xd301('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd301('0xb'));var crypto=require(_0xd301('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd301('0x9'));var querystring=require(_0xd301('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd301('0xe'));var as=require(_0xd301('0xf'));var hardwareService=require(_0xd301('0x10'));var logger=require(_0xd301('0x11'))(_0xd301('0x12'));var utils=require('../../config/utils');var config=require(_0xd301('0x13'));var licenseUtil=require(_0xd301('0x14'));var db=require(_0xd301('0x15'))['db'];function respondWithStatusCode(_0x338bb4,_0x17eb4e){_0x17eb4e=_0x17eb4e||0xcc;return function(_0x267a80){if(_0x267a80){return _0x338bb4[_0xd301('0x16')](_0x17eb4e);}return _0x338bb4[_0xd301('0x17')](_0x17eb4e)[_0xd301('0x18')]();};}function respondWithResult(_0xa3dab7,_0x313120){_0x313120=_0x313120||0xc8;return function(_0x3d08ba){if(_0x3d08ba){return _0xa3dab7[_0xd301('0x17')](_0x313120)[_0xd301('0x19')](_0x3d08ba);}};}function respondWithFilteredResult(_0xd73d9b,_0x41810c){return function(_0x3b6bfa){if(_0x3b6bfa){var _0x54ff1f=typeof _0x41810c[_0xd301('0x1a')]===_0xd301('0x1b')&&typeof _0x41810c[_0xd301('0x1c')]==='undefined';var _0x8d59b3=_0x3b6bfa[_0xd301('0x1d')];var _0x61190=_0x54ff1f?0x0:_0x41810c[_0xd301('0x1a')];var _0x185ccf=_0x54ff1f?_0x3b6bfa[_0xd301('0x1d')]:_0x41810c[_0xd301('0x1a')]+_0x41810c[_0xd301('0x1c')];var _0x5ab95d;if(_0x185ccf>=_0x8d59b3){_0x185ccf=_0x8d59b3;_0x5ab95d=0xc8;}else{_0x5ab95d=0xce;}_0xd73d9b[_0xd301('0x17')](_0x5ab95d);return _0xd73d9b['set']('Content-Range',_0x61190+'-'+_0x185ccf+'/'+_0x8d59b3)[_0xd301('0x19')](_0x3b6bfa);}return null;};}function patchUpdates(_0x49c74d){return function(_0x177b6f){try{jsonpatch[_0xd301('0x1e')](_0x177b6f,_0x49c74d,!![]);}catch(_0x535aac){return BPromise['reject'](_0x535aac);}return _0x177b6f[_0xd301('0x1f')]();};}function saveUpdates(_0x472dc2,_0x350c56){return function(_0x3b6f21){if(_0x3b6f21){return _0x3b6f21[_0xd301('0x20')](_0x472dc2)[_0xd301('0x21')](function(_0x152482){return _0x152482;});}return null;};}function removeEntity(_0x5c9f00,_0x1e2e2b){return function(_0x4faa96){if(_0x4faa96){return _0x4faa96[_0xd301('0x22')]()[_0xd301('0x21')](function(){_0x5c9f00['status'](0xcc)[_0xd301('0x18')]();});}};}function handleEntityNotFound(_0x2aed4c,_0x57e815){return function(_0x51af9d){if(!_0x51af9d){_0x2aed4c[_0xd301('0x16')](0x194);}return _0x51af9d;};}function handleError(_0x43c5f4,_0x50cc13){_0x50cc13=_0x50cc13||0x1f4;return function(_0x1cb6b6){logger[_0xd301('0x23')](_0x1cb6b6[_0xd301('0x24')]);if(_0x1cb6b6[_0xd301('0x25')]){delete _0x1cb6b6['name'];}_0x43c5f4[_0xd301('0x17')](_0x50cc13)[_0xd301('0x26')](_0x1cb6b6);};}exports['index']=function(_0xcff8e3,_0x51bf97){var _0x209e9b={},_0x12e078={},_0x1df80c={'count':0x0,'rows':[]};var _0x2dd51e=_[_0xd301('0x27')](db[_0xd301('0x28')][_0xd301('0x29')],function(_0x162f95){return{'name':_0x162f95[_0xd301('0x2a')],'type':_0x162f95['type'][_0xd301('0x2b')]};});_0x12e078[_0xd301('0x2c')]=_['map'](_0x2dd51e,_0xd301('0x25'));_0x12e078[_0xd301('0x2d')]=_['keys'](_0xcff8e3[_0xd301('0x2d')]);_0x12e078[_0xd301('0x2e')]=_[_0xd301('0x2f')](_0x12e078[_0xd301('0x2c')],_0x12e078[_0xd301('0x2d')]);_0x209e9b[_0xd301('0x30')]=_['intersection'](_0x12e078[_0xd301('0x2c')],qs['fields'](_0xcff8e3[_0xd301('0x2d')][_0xd301('0x31')]));_0x209e9b['attributes']=_0x209e9b[_0xd301('0x30')]['length']?_0x209e9b[_0xd301('0x30')]:_0x12e078[_0xd301('0x2c')];if(!_0xcff8e3[_0xd301('0x2d')][_0xd301('0x32')]('nolimit')){_0x209e9b['limit']=qs[_0xd301('0x1c')](_0xcff8e3[_0xd301('0x2d')][_0xd301('0x1c')]);_0x209e9b['offset']=qs[_0xd301('0x1a')](_0xcff8e3[_0xd301('0x2d')][_0xd301('0x1a')]);}_0x209e9b[_0xd301('0x33')]=qs[_0xd301('0x34')](_0xcff8e3[_0xd301('0x2d')][_0xd301('0x34')]);_0x209e9b[_0xd301('0x35')]=qs[_0xd301('0x2e')](_['pick'](_0xcff8e3[_0xd301('0x2d')],_0x12e078['filters']),_0x2dd51e);if(_0xcff8e3['query'][_0xd301('0x36')]){_0x209e9b[_0xd301('0x35')]=_[_0xd301('0x37')](_0x209e9b[_0xd301('0x35')],{'$or':_[_0xd301('0x27')](_0x2dd51e,function(_0x2bd906){if(_0x2bd906[_0xd301('0x38')]!==_0xd301('0x39')){var _0x50b54d={};_0x50b54d[_0x2bd906[_0xd301('0x25')]]={'$like':'%'+_0xcff8e3[_0xd301('0x2d')][_0xd301('0x36')]+'%'};return _0x50b54d;}})});}_0x209e9b=_[_0xd301('0x37')]({},_0x209e9b,_0xcff8e3['options']);var _0x1d1394={'where':_0x209e9b[_0xd301('0x35')]};return db[_0xd301('0x28')][_0xd301('0x1d')](_0x1d1394)['then'](function(_0x4e13e0){_0x1df80c[_0xd301('0x1d')]=_0x4e13e0;if(_0xcff8e3[_0xd301('0x2d')][_0xd301('0x3a')]){_0x209e9b[_0xd301('0x3b')]=[{'all':!![]}];}return db[_0xd301('0x28')]['findAll'](_0x209e9b);})[_0xd301('0x21')](function(_0x4be65a){_0x1df80c[_0xd301('0x3c')]=_0x4be65a;return _0x1df80c;})['then'](respondWithFilteredResult(_0x51bf97,_0x209e9b))[_0xd301('0x3d')](handleError(_0x51bf97,null));};exports[_0xd301('0x3e')]=function(_0x3c9052,_0x2745e9){var _0x5e9286={'raw':!![],'where':{'id':_0x3c9052['params']['id']}},_0xea30cd={};_0xea30cd[_0xd301('0x2c')]=_[_0xd301('0x3f')](db['MailSubstatus'][_0xd301('0x29')]);_0xea30cd['query']=_[_0xd301('0x3f')](_0x3c9052[_0xd301('0x2d')]);_0xea30cd[_0xd301('0x2e')]=_[_0xd301('0x2f')](_0xea30cd[_0xd301('0x2c')],_0xea30cd[_0xd301('0x2d')]);_0x5e9286[_0xd301('0x30')]=_[_0xd301('0x2f')](_0xea30cd[_0xd301('0x2c')],qs[_0xd301('0x31')](_0x3c9052[_0xd301('0x2d')][_0xd301('0x31')]));_0x5e9286['attributes']=_0x5e9286[_0xd301('0x30')][_0xd301('0x40')]?_0x5e9286[_0xd301('0x30')]:_0xea30cd[_0xd301('0x2c')];if(_0x3c9052[_0xd301('0x2d')]['includeAll']){_0x5e9286[_0xd301('0x3b')]=[{'all':!![]}];}_0x5e9286=_['merge']({},_0x5e9286,_0x3c9052['options']);return db[_0xd301('0x28')]['find'](_0x5e9286)[_0xd301('0x21')](handleEntityNotFound(_0x2745e9,null))['then'](respondWithResult(_0x2745e9,null))[_0xd301('0x3d')](handleError(_0x2745e9,null));};exports[_0xd301('0x41')]=function(_0x31e5c8,_0x4bcdb8){return db[_0xd301('0x28')][_0xd301('0x41')](_0x31e5c8[_0xd301('0x42')],{})[_0xd301('0x21')](respondWithResult(_0x4bcdb8,0xc9))[_0xd301('0x3d')](handleError(_0x4bcdb8,null));};exports[_0xd301('0x20')]=function(_0x2f6c19,_0x39a0ee){if(_0x2f6c19[_0xd301('0x42')]['id']){delete _0x2f6c19[_0xd301('0x42')]['id'];}return db[_0xd301('0x28')][_0xd301('0x43')]({'where':{'id':_0x2f6c19[_0xd301('0x44')]['id']}})[_0xd301('0x21')](handleEntityNotFound(_0x39a0ee,null))['then'](saveUpdates(_0x2f6c19[_0xd301('0x42')],null))[_0xd301('0x21')](respondWithResult(_0x39a0ee,null))[_0xd301('0x3d')](handleError(_0x39a0ee,null));};exports[_0xd301('0x22')]=function(_0x4f6a0a,_0x18e9d1){return db[_0xd301('0x28')][_0xd301('0x43')]({'where':{'id':_0x4f6a0a[_0xd301('0x44')]['id']}})['then'](handleEntityNotFound(_0x18e9d1,null))[_0xd301('0x21')](removeEntity(_0x18e9d1,null))[_0xd301('0x3d')](handleError(_0x18e9d1,null));};exports['describe']=function(_0x3ba60b,_0x218efd){return db[_0xd301('0x28')][_0xd301('0x45')]()['then'](respondWithResult(_0x218efd,null))[_0xd301('0x3d')](handleError(_0x218efd,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index c9e022d..dba490f 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 _0x51f9=['../../mysqldb','MailSubstatus','setMaxListeners','update','emit','hasOwnProperty','hook','events'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x51f9,0xef));var _0x951f=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x51f9[_0x3054be];return _0x3df150;};'use strict';var EventEmitter=require(_0x951f('0x0'));var MailSubstatus=require(_0x951f('0x1'))['db'][_0x951f('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x951f('0x3')](0x0);var events={'afterUpdate':_0x951f('0x4')};function emitEvent(_0x46bb81){return function(_0x5a4025,_0x49b105,_0x5efc39){MailSubstatusEvents['emit'](_0x46bb81+':'+_0x5a4025['id'],_0x5a4025);MailSubstatusEvents[_0x951f('0x5')](_0x46bb81,_0x5a4025);_0x5efc39(null);};}for(var e in events){if(events[_0x951f('0x6')](e)){var event=events[e];MailSubstatus[_0x951f('0x7')](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file +var _0xef30=['setMaxListeners','update','emit','hasOwnProperty','hook','exports','events','MailSubstatus'];(function(_0x2bebb2,_0x321313){var _0x277503=function(_0x15c37e){while(--_0x15c37e){_0x2bebb2['push'](_0x2bebb2['shift']());}};_0x277503(++_0x321313);}(_0xef30,0xee));var _0x0ef3=function(_0x18abd2,_0x22d4b3){_0x18abd2=_0x18abd2-0x0;var _0x1dcad6=_0xef30[_0x18abd2];return _0x1dcad6;};'use strict';var EventEmitter=require(_0x0ef3('0x0'));var MailSubstatus=require('../../mysqldb')['db'][_0x0ef3('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x0ef3('0x2')](0x0);var events={'afterUpdate':_0x0ef3('0x3')};function emitEvent(_0x245bc){return function(_0x4a4ee8,_0x37a386,_0x1405cd){MailSubstatusEvents[_0x0ef3('0x4')](_0x245bc+':'+_0x4a4ee8['id'],_0x4a4ee8);MailSubstatusEvents[_0x0ef3('0x4')](_0x245bc,_0x4a4ee8);_0x1405cd(null);};}for(var e in events){if(events[_0x0ef3('0x5')](e)){var event=events[e];MailSubstatus[_0x0ef3('0x6')](e,emitEvent(event));}}module[_0x0ef3('0x7')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index de85a30..fecfde7 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 _0x4b1c=['define','mail_substatuses','Condition','_previousDataValues','name','then','catch','./mailSubstatus.attributes','exports','models'];(function(_0x569f5f,_0x1c6c5c){var _0x3e8e2e=function(_0x46344f){while(--_0x46344f){_0x569f5f['push'](_0x569f5f['shift']());}};_0x3e8e2e(++_0x1c6c5c);}(_0x4b1c,0x11f));var _0xc4b1=function(_0x3e9809,_0x3c2789){_0x3e9809=_0x3e9809-0x0;var _0x68947c=_0x4b1c[_0x3e9809];return _0x68947c;};'use strict';var attributes=require(_0xc4b1('0x0'));module[_0xc4b1('0x1')]=function(_0x578e92){var _0x49a8d4=_0x578e92[_0xc4b1('0x2')];return _0x578e92[_0xc4b1('0x3')]('MailSubstatus',attributes,{'tableName':_0xc4b1('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x3ae4d7,_0x495af9,_0x54152e){return _0x49a8d4[_0xc4b1('0x5')]['update']({'value':_0x3ae4d7['name']},{'where':{'field':'mailSubstatus','value':_0x3ae4d7[_0xc4b1('0x6')][_0xc4b1('0x7')]}})[_0xc4b1('0x8')](function(){_0x54152e();})[_0xc4b1('0x9')](function(_0x2b1737){_0x54152e(_0x2b1737);});}}});}; \ No newline at end of file +var _0xee6c=['name','mailSubstatus','_previousDataValues','catch','./mailSubstatus.attributes','models','define','MailSubstatus','mail_substatuses','Condition'];(function(_0x3e85d4,_0x59f01d){var _0x497787=function(_0x332864){while(--_0x332864){_0x3e85d4['push'](_0x3e85d4['shift']());}};_0x497787(++_0x59f01d);}(_0xee6c,0x1bc));var _0xcee6=function(_0x60f00b,_0x3c93eb){_0x60f00b=_0x60f00b-0x0;var _0x31eafa=_0xee6c[_0x60f00b];return _0x31eafa;};'use strict';var attributes=require(_0xcee6('0x0'));module['exports']=function(_0x30d5df){var _0x3f5e3f=_0x30d5df[_0xcee6('0x1')];return _0x30d5df[_0xcee6('0x2')](_0xcee6('0x3'),attributes,{'tableName':_0xcee6('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x1335bf,_0x206087,_0xa434ce){return _0x3f5e3f[_0xcee6('0x5')]['update']({'value':_0x1335bf[_0xcee6('0x6')]},{'where':{'field':_0xcee6('0x7'),'value':_0x1335bf[_0xcee6('0x8')][_0xcee6('0x6')]}})['then'](function(){_0xa434ce();})[_0xcee6('0x9')](function(_0x4762ca){_0xa434ce(_0x4762ca);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index c5ebd07..2274086 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 _0x3fa9=['MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x3fa9,0x111));var _0x93fa=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0x3fa9[_0x3ce3c];return _0x55a2c9;};'use strict';var _=require(_0x93fa('0x0'));var util=require(_0x93fa('0x1'));var moment=require('moment');var BPromise=require(_0x93fa('0x2'));var rs=require(_0x93fa('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x93fa('0x4'))['db'];var utils=require(_0x93fa('0x5'));var logger=require(_0x93fa('0x6'))(_0x93fa('0x7'));var config=require(_0x93fa('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x93fa('0x9')][_0x93fa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ebdf0,_0x5e819f,_0x1c0b81){return new BPromise(function(_0x5df079,_0x4a6a69){return client[_0x93fa('0xb')](_0x1ebdf0,_0x1c0b81)['then'](function(_0x4d7129){logger[_0x93fa('0xc')](_0x93fa('0xd'),_0x5e819f,_0x93fa('0xe'));logger[_0x93fa('0xf')](_0x93fa('0x10'),_0x5e819f,_0x93fa('0xe'),JSON[_0x93fa('0x11')](_0x4d7129));if(_0x4d7129[_0x93fa('0x12')]){if(_0x4d7129['error'][_0x93fa('0x13')]===0x1f4){logger[_0x93fa('0x12')](_0x93fa('0xd'),_0x5e819f,_0x4d7129[_0x93fa('0x12')]['message']);return _0x4a6a69(_0x4d7129[_0x93fa('0x12')]['message']);}logger[_0x93fa('0x12')](_0x93fa('0xd'),_0x5e819f,_0x4d7129['error'][_0x93fa('0x14')]);return _0x5df079(_0x4d7129[_0x93fa('0x12')][_0x93fa('0x14')]);}else{logger[_0x93fa('0xc')](_0x93fa('0xd'),_0x5e819f,_0x93fa('0xe'));_0x5df079(_0x4d7129['result']['message']);}})[_0x93fa('0x15')](function(_0x1b9f46){logger[_0x93fa('0x12')](_0x93fa('0xd'),_0x5e819f,_0x1b9f46);_0x4a6a69(_0x1b9f46);});});} \ No newline at end of file +var _0x7a5a=['result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x1e381c,_0x47b5b9){var _0x9b5ea9=function(_0x6d2be5){while(--_0x6d2be5){_0x1e381c['push'](_0x1e381c['shift']());}};_0x9b5ea9(++_0x47b5b9);}(_0x7a5a,0xc7));var _0xa7a5=function(_0x56f4ca,_0x176471){_0x56f4ca=_0x56f4ca-0x0;var _0x48bee5=_0x7a5a[_0x56f4ca];return _0x48bee5;};'use strict';var _=require(_0xa7a5('0x0'));var util=require(_0xa7a5('0x1'));var moment=require('moment');var BPromise=require(_0xa7a5('0x2'));var rs=require(_0xa7a5('0x3'));var fs=require('fs');var Redis=require(_0xa7a5('0x4'));var db=require(_0xa7a5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa7a5('0x6'))(_0xa7a5('0x7'));var config=require(_0xa7a5('0x8'));var jayson=require(_0xa7a5('0x9'));var client=jayson[_0xa7a5('0xa')][_0xa7a5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2fbd46,_0x5ec6e2,_0x142b9c){return new BPromise(function(_0x19fcec,_0x2a82c3){return client[_0xa7a5('0xc')](_0x2fbd46,_0x142b9c)[_0xa7a5('0xd')](function(_0x4ec43e){logger[_0xa7a5('0xe')](_0xa7a5('0xf'),_0x5ec6e2,_0xa7a5('0x10'));logger[_0xa7a5('0x11')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x5ec6e2,_0xa7a5('0x10'),JSON[_0xa7a5('0x12')](_0x4ec43e));if(_0x4ec43e[_0xa7a5('0x13')]){if(_0x4ec43e[_0xa7a5('0x13')]['code']===0x1f4){logger[_0xa7a5('0x13')](_0xa7a5('0xf'),_0x5ec6e2,_0x4ec43e[_0xa7a5('0x13')][_0xa7a5('0x14')]);return _0x2a82c3(_0x4ec43e[_0xa7a5('0x13')]['message']);}logger[_0xa7a5('0x13')](_0xa7a5('0xf'),_0x5ec6e2,_0x4ec43e[_0xa7a5('0x13')][_0xa7a5('0x14')]);return _0x19fcec(_0x4ec43e[_0xa7a5('0x13')][_0xa7a5('0x14')]);}else{logger[_0xa7a5('0xe')]('MailSubstatus,\x20%s,\x20%s',_0x5ec6e2,'request\x20sent');_0x19fcec(_0x4ec43e[_0xa7a5('0x15')][_0xa7a5('0x14')]);}})['catch'](function(_0x4a8530){logger[_0xa7a5('0x13')](_0xa7a5('0xf'),_0x5ec6e2,_0x4a8530);_0x2a82c3(_0x4a8530);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 0356f3f..98d5d8a 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 _0x82db=['get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../config/environment'];(function(_0x2c7b54,_0x160f40){var _0x1f42c0=function(_0x2458ab){while(--_0x2458ab){_0x2c7b54['push'](_0x2c7b54['shift']());}};_0x1f42c0(++_0x160f40);}(_0x82db,0x126));var _0xb82d=function(_0x4ae14a,_0x46b9c1){_0x4ae14a=_0x4ae14a-0x0;var _0x2b2eb6=_0x82db[_0x4ae14a];return _0x2b2eb6;};'use strict';var multer=require(_0xb82d('0x0'));var util=require(_0xb82d('0x1'));var path=require(_0xb82d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb82d('0x3')]();var fs_extra=require(_0xb82d('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb82d('0x5'));var controller=require('./mailTransferReport.controller');router[_0xb82d('0x6')]('/',auth['isAuthenticated'](),controller[_0xb82d('0x7')]);router['get'](_0xb82d('0x8'),auth[_0xb82d('0x9')](),controller[_0xb82d('0xa')]);router[_0xb82d('0x6')](_0xb82d('0xb'),auth[_0xb82d('0x9')](),controller[_0xb82d('0xc')]);router[_0xb82d('0xd')]('/',auth['isAuthenticated'](),controller[_0xb82d('0xe')]);router[_0xb82d('0xf')]('/:id',auth[_0xb82d('0x9')](),controller[_0xb82d('0x10')]);router[_0xb82d('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xb82d('0x12')]);module[_0xb82d('0x13')]=router; \ No newline at end of file +var _0xfa62=['index','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailTransferReport.controller','get'];(function(_0x380b08,_0x1df63a){var _0x22f65d=function(_0x507f73){while(--_0x507f73){_0x380b08['push'](_0x380b08['shift']());}};_0x22f65d(++_0x1df63a);}(_0xfa62,0x75));var _0x2fa6=function(_0x482fbf,_0x4ab642){_0x482fbf=_0x482fbf-0x0;var _0x48e85c=_0xfa62[_0x482fbf];return _0x48e85c;};'use strict';var multer=require(_0x2fa6('0x0'));var util=require(_0x2fa6('0x1'));var path=require(_0x2fa6('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2fa6('0x3')]();var fs_extra=require(_0x2fa6('0x4'));var auth=require(_0x2fa6('0x5'));var interaction=require(_0x2fa6('0x6'));var config=require('../../config/environment');var controller=require(_0x2fa6('0x7'));router[_0x2fa6('0x8')]('/',auth['isAuthenticated'](),controller[_0x2fa6('0x9')]);router[_0x2fa6('0x8')]('/describe',auth[_0x2fa6('0xa')](),controller[_0x2fa6('0xb')]);router[_0x2fa6('0x8')](_0x2fa6('0xc'),auth[_0x2fa6('0xa')](),controller[_0x2fa6('0xd')]);router[_0x2fa6('0xe')]('/',auth[_0x2fa6('0xa')](),controller[_0x2fa6('0xf')]);router[_0x2fa6('0x10')]('/:id',auth[_0x2fa6('0xa')](),controller[_0x2fa6('0x11')]);router[_0x2fa6('0x12')](_0x2fa6('0xc'),auth[_0x2fa6('0xa')](),controller[_0x2fa6('0x13')]);module[_0x2fa6('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index dd77200..3ba0f9d 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(_0x3fadf3,_0x45ca06){var _0x4ac770=function(_0x51168f){while(--_0x51168f){_0x3fadf3['push'](_0x3fadf3['shift']());}};_0x4ac770(++_0x45ca06);}(_0xedd9,0xfc));var _0x9edd=function(_0x393bee,_0x5b2076){_0x393bee=_0x393bee-0x0;var _0x2a93d0=_0xedd9[_0x393bee];return _0x2a93d0;};'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 _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x5a2d3f,_0x27b04e){var _0x5c65d8=function(_0x2d1965){while(--_0x2d1965){_0x5a2d3f['push'](_0x5a2d3f['shift']());}};_0x5c65d8(++_0x27b04e);}(_0x9bde,0xe1));var _0xe9bd=function(_0x29434b,_0x966b97){_0x29434b=_0x29434b-0x0;var _0xea5189=_0x9bde[_0x29434b];return _0xea5189;};'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 diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index dc19bdc..2928212 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 _0x55f7=['../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','update','destroy','name','send','index','map','MailTransferReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','then','includeAll','include','findAll','rows','catch','show','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x490297,_0x5bc64c){var _0x317f46=function(_0x45ccf2){while(--_0x45ccf2){_0x490297['push'](_0x490297['shift']());}};_0x317f46(++_0x5bc64c);}(_0x55f7,0x81));var _0x755f=function(_0x5eb7bf,_0x37e90d){_0x5eb7bf=_0x5eb7bf-0x0;var _0x4a3685=_0x55f7[_0x5eb7bf];return _0x4a3685;};'use strict';var emlformat=require(_0x755f('0x0'));var rimraf=require(_0x755f('0x1'));var zipdir=require(_0x755f('0x2'));var jsonpatch=require(_0x755f('0x3'));var rp=require('request-promise');var moment=require(_0x755f('0x4'));var BPromise=require(_0x755f('0x5'));var Mustache=require(_0x755f('0x6'));var util=require(_0x755f('0x7'));var path=require(_0x755f('0x8'));var sox=require(_0x755f('0x9'));var csv=require('to-csv');var ejs=require(_0x755f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x755f('0xb'));var squel=require(_0x755f('0xc'));var crypto=require(_0x755f('0xd'));var jsforce=require(_0x755f('0xe'));var deskjs=require(_0x755f('0xf'));var toCsv=require(_0x755f('0x10'));var querystring=require(_0x755f('0x11'));var Papa=require(_0x755f('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x755f('0x13'));var as=require(_0x755f('0x14'));var hardwareService=require(_0x755f('0x15'));var logger=require(_0x755f('0x16'))('api');var utils=require(_0x755f('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x755f('0x18'));var db=require(_0x755f('0x19'))['db'];function respondWithStatusCode(_0x499ca1,_0x32aec6){_0x32aec6=_0x32aec6||0xcc;return function(_0x1510d4){if(_0x1510d4){return _0x499ca1[_0x755f('0x1a')](_0x32aec6);}return _0x499ca1[_0x755f('0x1b')](_0x32aec6)[_0x755f('0x1c')]();};}function respondWithResult(_0x4b647c,_0x456a77){_0x456a77=_0x456a77||0xc8;return function(_0x102c01){if(_0x102c01){return _0x4b647c[_0x755f('0x1b')](_0x456a77)[_0x755f('0x1d')](_0x102c01);}};}function respondWithFilteredResult(_0x58cabb,_0x1899f9){return function(_0x2086f8){if(_0x2086f8){var _0x5e3575=typeof _0x1899f9[_0x755f('0x1e')]==='undefined'&&typeof _0x1899f9[_0x755f('0x1f')]===_0x755f('0x20');var _0x5fcdf7=_0x2086f8[_0x755f('0x21')];var _0x3c2e5f=_0x5e3575?0x0:_0x1899f9[_0x755f('0x1e')];var _0x203015=_0x5e3575?_0x2086f8[_0x755f('0x21')]:_0x1899f9[_0x755f('0x1e')]+_0x1899f9[_0x755f('0x1f')];var _0x5f051f;if(_0x203015>=_0x5fcdf7){_0x203015=_0x5fcdf7;_0x5f051f=0xc8;}else{_0x5f051f=0xce;}_0x58cabb[_0x755f('0x1b')](_0x5f051f);return _0x58cabb[_0x755f('0x22')](_0x755f('0x23'),_0x3c2e5f+'-'+_0x203015+'/'+_0x5fcdf7)[_0x755f('0x1d')](_0x2086f8);}return null;};}function patchUpdates(_0x834178){return function(_0x3e1ae5){try{jsonpatch['apply'](_0x3e1ae5,_0x834178,!![]);}catch(_0x296702){return BPromise['reject'](_0x296702);}return _0x3e1ae5['save']();};}function saveUpdates(_0x3ac1be,_0xf09ac9){return function(_0x71d98d){if(_0x71d98d){return _0x71d98d[_0x755f('0x24')](_0x3ac1be)['then'](function(_0xdeaa3){return _0xdeaa3;});}return null;};}function removeEntity(_0xfbb83e,_0x352698){return function(_0x3cd2a8){if(_0x3cd2a8){return _0x3cd2a8[_0x755f('0x25')]()['then'](function(){_0xfbb83e['status'](0xcc)[_0x755f('0x1c')]();});}};}function handleEntityNotFound(_0x534dc5,_0x23bd33){return function(_0xfe4be8){if(!_0xfe4be8){_0x534dc5[_0x755f('0x1a')](0x194);}return _0xfe4be8;};}function handleError(_0x3adbd2,_0x524ed3){_0x524ed3=_0x524ed3||0x1f4;return function(_0x131703){logger['error'](_0x131703['stack']);if(_0x131703[_0x755f('0x26')]){delete _0x131703[_0x755f('0x26')];}_0x3adbd2[_0x755f('0x1b')](_0x524ed3)[_0x755f('0x27')](_0x131703);};}exports[_0x755f('0x28')]=function(_0x1937a5,_0x37b3a0){var _0x4a837f={},_0x13c38f={},_0x4307db={'count':0x0,'rows':[]};var _0xedcab2=_[_0x755f('0x29')](db[_0x755f('0x2a')][_0x755f('0x2b')],function(_0x211f2b){return{'name':_0x211f2b[_0x755f('0x2c')],'type':_0x211f2b['type'][_0x755f('0x2d')]};});_0x13c38f[_0x755f('0x2e')]=_[_0x755f('0x29')](_0xedcab2,_0x755f('0x26'));_0x13c38f[_0x755f('0x2f')]=_[_0x755f('0x30')](_0x1937a5[_0x755f('0x2f')]);_0x13c38f[_0x755f('0x31')]=_[_0x755f('0x32')](_0x13c38f[_0x755f('0x2e')],_0x13c38f[_0x755f('0x2f')]);_0x4a837f[_0x755f('0x33')]=_[_0x755f('0x32')](_0x13c38f[_0x755f('0x2e')],qs[_0x755f('0x34')](_0x1937a5[_0x755f('0x2f')][_0x755f('0x34')]));_0x4a837f[_0x755f('0x33')]=_0x4a837f[_0x755f('0x33')][_0x755f('0x35')]?_0x4a837f[_0x755f('0x33')]:_0x13c38f[_0x755f('0x2e')];if(!_0x1937a5[_0x755f('0x2f')][_0x755f('0x36')](_0x755f('0x37'))){_0x4a837f[_0x755f('0x1f')]=qs['limit'](_0x1937a5[_0x755f('0x2f')]['limit']);_0x4a837f[_0x755f('0x1e')]=qs[_0x755f('0x1e')](_0x1937a5[_0x755f('0x2f')][_0x755f('0x1e')]);}_0x4a837f[_0x755f('0x38')]=qs['sort'](_0x1937a5[_0x755f('0x2f')][_0x755f('0x39')]);_0x4a837f[_0x755f('0x3a')]=qs[_0x755f('0x31')](_[_0x755f('0x3b')](_0x1937a5[_0x755f('0x2f')],_0x13c38f[_0x755f('0x31')]),_0xedcab2);if(_0x1937a5[_0x755f('0x2f')]['filter']){_0x4a837f[_0x755f('0x3a')]=_[_0x755f('0x3c')](_0x4a837f['where'],{'$or':_[_0x755f('0x29')](_0xedcab2,function(_0x2b681b){if(_0x2b681b[_0x755f('0x3d')]!==_0x755f('0x3e')){var _0x27e609={};_0x27e609[_0x2b681b[_0x755f('0x26')]]={'$like':'%'+_0x1937a5[_0x755f('0x2f')]['filter']+'%'};return _0x27e609;}})});}_0x4a837f=_['merge']({},_0x4a837f,_0x1937a5['options']);var _0x46fcc3={'where':_0x4a837f[_0x755f('0x3a')]};return db[_0x755f('0x2a')][_0x755f('0x21')](_0x46fcc3)[_0x755f('0x3f')](function(_0x3d1413){_0x4307db['count']=_0x3d1413;if(_0x1937a5[_0x755f('0x2f')][_0x755f('0x40')]){_0x4a837f[_0x755f('0x41')]=[{'all':!![]}];}return db[_0x755f('0x2a')][_0x755f('0x42')](_0x4a837f);})[_0x755f('0x3f')](function(_0x20902b){_0x4307db[_0x755f('0x43')]=_0x20902b;return _0x4307db;})['then'](respondWithFilteredResult(_0x37b3a0,_0x4a837f))[_0x755f('0x44')](handleError(_0x37b3a0,null));};exports[_0x755f('0x45')]=function(_0x332aa8,_0x3fa81a){var _0x4d5004={'raw':!![],'where':{'id':_0x332aa8['params']['id']}},_0x344847={};_0x344847['model']=_['keys'](db[_0x755f('0x2a')]['rawAttributes']);_0x344847[_0x755f('0x2f')]=_[_0x755f('0x30')](_0x332aa8[_0x755f('0x2f')]);_0x344847[_0x755f('0x31')]=_[_0x755f('0x32')](_0x344847[_0x755f('0x2e')],_0x344847['query']);_0x4d5004[_0x755f('0x33')]=_['intersection'](_0x344847[_0x755f('0x2e')],qs[_0x755f('0x34')](_0x332aa8[_0x755f('0x2f')][_0x755f('0x34')]));_0x4d5004['attributes']=_0x4d5004[_0x755f('0x33')][_0x755f('0x35')]?_0x4d5004['attributes']:_0x344847[_0x755f('0x2e')];if(_0x332aa8[_0x755f('0x2f')]['includeAll']){_0x4d5004[_0x755f('0x41')]=[{'all':!![]}];}_0x4d5004=_['merge']({},_0x4d5004,_0x332aa8[_0x755f('0x46')]);return db['MailTransferReport'][_0x755f('0x47')](_0x4d5004)['then'](handleEntityNotFound(_0x3fa81a,null))[_0x755f('0x3f')](respondWithResult(_0x3fa81a,null))['catch'](handleError(_0x3fa81a,null));};exports[_0x755f('0x48')]=function(_0x2e11b1,_0x1623e2){return db[_0x755f('0x2a')][_0x755f('0x48')](_0x2e11b1[_0x755f('0x49')],{})['then'](respondWithResult(_0x1623e2,0xc9))['catch'](handleError(_0x1623e2,null));};exports['update']=function(_0x22b4d3,_0x38a400){if(_0x22b4d3[_0x755f('0x49')]['id']){delete _0x22b4d3[_0x755f('0x49')]['id'];}return db[_0x755f('0x2a')][_0x755f('0x47')]({'where':{'id':_0x22b4d3['params']['id']}})[_0x755f('0x3f')](handleEntityNotFound(_0x38a400,null))[_0x755f('0x3f')](saveUpdates(_0x22b4d3[_0x755f('0x49')],null))[_0x755f('0x3f')](respondWithResult(_0x38a400,null))[_0x755f('0x44')](handleError(_0x38a400,null));};exports['destroy']=function(_0x48b263,_0x3a5695){return db['MailTransferReport'][_0x755f('0x47')]({'where':{'id':_0x48b263[_0x755f('0x4a')]['id']}})[_0x755f('0x3f')](handleEntityNotFound(_0x3a5695,null))[_0x755f('0x3f')](removeEntity(_0x3a5695,null))[_0x755f('0x44')](handleError(_0x3a5695,null));};exports[_0x755f('0x4b')]=function(_0x3f54e6,_0x5d720e){return db['MailTransferReport'][_0x755f('0x4b')]()['then'](respondWithResult(_0x5d720e,null))['catch'](handleError(_0x5d720e,null));}; \ No newline at end of file +var _0x4963=['crypto','desk.js','to-csv','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','end','stack','send','index','map','MailTransferReport','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','keys','length','find','catch','create','body','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','ejs','fs-extra','lodash','squel'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0x4963,0x89));var _0x3496=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4963[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x3496('0x0'));var rimraf=require(_0x3496('0x1'));var zipdir=require(_0x3496('0x2'));var jsonpatch=require(_0x3496('0x3'));var rp=require('request-promise');var moment=require(_0x3496('0x4'));var BPromise=require(_0x3496('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3496('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3496('0x7'));var fs=require('fs');var fs_extra=require(_0x3496('0x8'));var _=require(_0x3496('0x9'));var squel=require(_0x3496('0xa'));var crypto=require(_0x3496('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x3496('0xc'));var toCsv=require(_0x3496('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3496('0xe'));var qs=require(_0x3496('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3496('0x10'));var logger=require(_0x3496('0x11'))(_0x3496('0x12'));var utils=require('../../config/utils');var config=require(_0x3496('0x13'));var licenseUtil=require(_0x3496('0x14'));var db=require(_0x3496('0x15'))['db'];function respondWithStatusCode(_0x4b9d0f,_0x33bc7e){_0x33bc7e=_0x33bc7e||0xcc;return function(_0x3cfda7){if(_0x3cfda7){return _0x4b9d0f[_0x3496('0x16')](_0x33bc7e);}return _0x4b9d0f[_0x3496('0x17')](_0x33bc7e)['end']();};}function respondWithResult(_0x6fe371,_0x3749ce){_0x3749ce=_0x3749ce||0xc8;return function(_0x1942b3){if(_0x1942b3){return _0x6fe371[_0x3496('0x17')](_0x3749ce)[_0x3496('0x18')](_0x1942b3);}};}function respondWithFilteredResult(_0x3399b7,_0x2dfa48){return function(_0xffdc21){if(_0xffdc21){var _0x5cd0c5=typeof _0x2dfa48[_0x3496('0x19')]===_0x3496('0x1a')&&typeof _0x2dfa48[_0x3496('0x1b')]==='undefined';var _0x496bbb=_0xffdc21[_0x3496('0x1c')];var _0x478de4=_0x5cd0c5?0x0:_0x2dfa48[_0x3496('0x19')];var _0x234af8=_0x5cd0c5?_0xffdc21[_0x3496('0x1c')]:_0x2dfa48[_0x3496('0x19')]+_0x2dfa48[_0x3496('0x1b')];var _0x313245;if(_0x234af8>=_0x496bbb){_0x234af8=_0x496bbb;_0x313245=0xc8;}else{_0x313245=0xce;}_0x3399b7['status'](_0x313245);return _0x3399b7['set'](_0x3496('0x1d'),_0x478de4+'-'+_0x234af8+'/'+_0x496bbb)['json'](_0xffdc21);}return null;};}function patchUpdates(_0xada79d){return function(_0x2c0ce4){try{jsonpatch['apply'](_0x2c0ce4,_0xada79d,!![]);}catch(_0x34b185){return BPromise[_0x3496('0x1e')](_0x34b185);}return _0x2c0ce4[_0x3496('0x1f')]();};}function saveUpdates(_0x5cdce0,_0x26c144){return function(_0x1ce615){if(_0x1ce615){return _0x1ce615[_0x3496('0x20')](_0x5cdce0)[_0x3496('0x21')](function(_0x1f6952){return _0x1f6952;});}return null;};}function removeEntity(_0x48959a,_0x8f7cc5){return function(_0x5b907c){if(_0x5b907c){return _0x5b907c['destroy']()[_0x3496('0x21')](function(){_0x48959a[_0x3496('0x17')](0xcc)[_0x3496('0x22')]();});}};}function handleEntityNotFound(_0x3c5d23,_0x218460){return function(_0x9025d9){if(!_0x9025d9){_0x3c5d23[_0x3496('0x16')](0x194);}return _0x9025d9;};}function handleError(_0x2636db,_0x2fe8e0){_0x2fe8e0=_0x2fe8e0||0x1f4;return function(_0x2d2614){logger['error'](_0x2d2614[_0x3496('0x23')]);if(_0x2d2614['name']){delete _0x2d2614['name'];}_0x2636db[_0x3496('0x17')](_0x2fe8e0)[_0x3496('0x24')](_0x2d2614);};}exports[_0x3496('0x25')]=function(_0x5d98b6,_0x136cea){var _0x3b701b={},_0x20ada7={},_0x421bb8={'count':0x0,'rows':[]};var _0x12521=_[_0x3496('0x26')](db[_0x3496('0x27')][_0x3496('0x28')],function(_0x2182e3){return{'name':_0x2182e3[_0x3496('0x29')],'type':_0x2182e3[_0x3496('0x2a')][_0x3496('0x2b')]};});_0x20ada7[_0x3496('0x2c')]=_[_0x3496('0x26')](_0x12521,_0x3496('0x2d'));_0x20ada7['query']=_['keys'](_0x5d98b6[_0x3496('0x2e')]);_0x20ada7[_0x3496('0x2f')]=_[_0x3496('0x30')](_0x20ada7[_0x3496('0x2c')],_0x20ada7[_0x3496('0x2e')]);_0x3b701b[_0x3496('0x31')]=_[_0x3496('0x30')](_0x20ada7[_0x3496('0x2c')],qs[_0x3496('0x32')](_0x5d98b6[_0x3496('0x2e')][_0x3496('0x32')]));_0x3b701b['attributes']=_0x3b701b[_0x3496('0x31')]['length']?_0x3b701b[_0x3496('0x31')]:_0x20ada7['model'];if(!_0x5d98b6[_0x3496('0x2e')][_0x3496('0x33')]('nolimit')){_0x3b701b[_0x3496('0x1b')]=qs[_0x3496('0x1b')](_0x5d98b6['query'][_0x3496('0x1b')]);_0x3b701b['offset']=qs[_0x3496('0x19')](_0x5d98b6[_0x3496('0x2e')][_0x3496('0x19')]);}_0x3b701b[_0x3496('0x34')]=qs[_0x3496('0x35')](_0x5d98b6[_0x3496('0x2e')][_0x3496('0x35')]);_0x3b701b[_0x3496('0x36')]=qs['filters'](_[_0x3496('0x37')](_0x5d98b6[_0x3496('0x2e')],_0x20ada7['filters']),_0x12521);if(_0x5d98b6[_0x3496('0x2e')][_0x3496('0x38')]){_0x3b701b[_0x3496('0x36')]=_[_0x3496('0x39')](_0x3b701b[_0x3496('0x36')],{'$or':_[_0x3496('0x26')](_0x12521,function(_0x42760e){if(_0x42760e['type']!==_0x3496('0x3a')){var _0x4cb1da={};_0x4cb1da[_0x42760e['name']]={'$like':'%'+_0x5d98b6[_0x3496('0x2e')][_0x3496('0x38')]+'%'};return _0x4cb1da;}})});}_0x3b701b=_[_0x3496('0x39')]({},_0x3b701b,_0x5d98b6[_0x3496('0x3b')]);var _0x347342={'where':_0x3b701b['where']};return db[_0x3496('0x27')][_0x3496('0x1c')](_0x347342)[_0x3496('0x21')](function(_0x537aef){_0x421bb8[_0x3496('0x1c')]=_0x537aef;if(_0x5d98b6[_0x3496('0x2e')][_0x3496('0x3c')]){_0x3b701b[_0x3496('0x3d')]=[{'all':!![]}];}return db['MailTransferReport'][_0x3496('0x3e')](_0x3b701b);})[_0x3496('0x21')](function(_0x2f037a){_0x421bb8[_0x3496('0x3f')]=_0x2f037a;return _0x421bb8;})[_0x3496('0x21')](respondWithFilteredResult(_0x136cea,_0x3b701b))['catch'](handleError(_0x136cea,null));};exports[_0x3496('0x40')]=function(_0x24e774,_0x451904){var _0x4708e8={'raw':!![],'where':{'id':_0x24e774['params']['id']}},_0x12008b={};_0x12008b[_0x3496('0x2c')]=_[_0x3496('0x41')](db[_0x3496('0x27')][_0x3496('0x28')]);_0x12008b[_0x3496('0x2e')]=_[_0x3496('0x41')](_0x24e774[_0x3496('0x2e')]);_0x12008b['filters']=_[_0x3496('0x30')](_0x12008b['model'],_0x12008b[_0x3496('0x2e')]);_0x4708e8[_0x3496('0x31')]=_['intersection'](_0x12008b[_0x3496('0x2c')],qs[_0x3496('0x32')](_0x24e774['query'][_0x3496('0x32')]));_0x4708e8[_0x3496('0x31')]=_0x4708e8[_0x3496('0x31')][_0x3496('0x42')]?_0x4708e8['attributes']:_0x12008b[_0x3496('0x2c')];if(_0x24e774[_0x3496('0x2e')][_0x3496('0x3c')]){_0x4708e8[_0x3496('0x3d')]=[{'all':!![]}];}_0x4708e8=_['merge']({},_0x4708e8,_0x24e774[_0x3496('0x3b')]);return db['MailTransferReport'][_0x3496('0x43')](_0x4708e8)[_0x3496('0x21')](handleEntityNotFound(_0x451904,null))['then'](respondWithResult(_0x451904,null))[_0x3496('0x44')](handleError(_0x451904,null));};exports['create']=function(_0x1c6760,_0x22184d){return db['MailTransferReport'][_0x3496('0x45')](_0x1c6760[_0x3496('0x46')],{})['then'](respondWithResult(_0x22184d,0xc9))[_0x3496('0x44')](handleError(_0x22184d,null));};exports[_0x3496('0x20')]=function(_0x105844,_0x497eb9){if(_0x105844['body']['id']){delete _0x105844[_0x3496('0x46')]['id'];}return db[_0x3496('0x27')][_0x3496('0x43')]({'where':{'id':_0x105844[_0x3496('0x47')]['id']}})[_0x3496('0x21')](handleEntityNotFound(_0x497eb9,null))[_0x3496('0x21')](saveUpdates(_0x105844[_0x3496('0x46')],null))['then'](respondWithResult(_0x497eb9,null))[_0x3496('0x44')](handleError(_0x497eb9,null));};exports[_0x3496('0x48')]=function(_0x3a740c,_0x3e2056){return db[_0x3496('0x27')][_0x3496('0x43')]({'where':{'id':_0x3a740c['params']['id']}})['then'](handleEntityNotFound(_0x3e2056,null))[_0x3496('0x21')](removeEntity(_0x3e2056,null))['catch'](handleError(_0x3e2056,null));};exports[_0x3496('0x49')]=function(_0x277b40,_0x3d3e2d){return db['MailTransferReport']['describe']()['then'](respondWithResult(_0x3d3e2d,null))['catch'](handleError(_0x3d3e2d,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index ff6298b..7406ea9 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 _0x99fb=['exports','MailTransferReport','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x3232ea,_0x46753a){var _0x1851eb=function(_0x2250a8){while(--_0x2250a8){_0x3232ea['push'](_0x3232ea['shift']());}};_0x1851eb(++_0x46753a);}(_0x99fb,0x92));var _0xb99f=function(_0x1ab568,_0x5965ec){_0x1ab568=_0x1ab568-0x0;var _0x5813c0=_0x99fb[_0x1ab568];return _0x5813c0;};'use strict';var _=require(_0xb99f('0x0'));var util=require('util');var logger=require(_0xb99f('0x1'))(_0xb99f('0x2'));var moment=require(_0xb99f('0x3'));var BPromise=require(_0xb99f('0x4'));var rp=require(_0xb99f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb99f('0x6'));var config=require(_0xb99f('0x7'));var attributes=require('./mailTransferReport.attributes');module[_0xb99f('0x8')]=function(_0x1f4c29,_0xd9eac9){return _0x1f4c29['define'](_0xb99f('0x9'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0xb99f('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xc73a=['./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0x7aaac8,_0x3a4233){var _0x4a8013=function(_0x45cf4e){while(--_0x45cf4e){_0x7aaac8['push'](_0x7aaac8['shift']());}};_0x4a8013(++_0x3a4233);}(_0xc73a,0x72));var _0xac73=function(_0x348059,_0x4bf50a){_0x348059=_0x348059-0x0;var _0x3a56c7=_0xc73a[_0x348059];return _0x3a56c7;};'use strict';var _=require('lodash');var util=require(_0xac73('0x0'));var logger=require(_0xac73('0x1'))(_0xac73('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xac73('0x3'));var fs=require('fs');var path=require(_0xac73('0x4'));var rimraf=require(_0xac73('0x5'));var config=require('../../config/environment');var attributes=require(_0xac73('0x6'));module[_0xac73('0x7')]=function(_0x23fa68,_0x57992a){return _0x23fa68[_0xac73('0x8')](_0xac73('0x9'),attributes,{'tableName':_0xac73('0xa'),'paranoid':![],'indexes':[{'name':_0xac73('0xb'),'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 ea00c36..c0cb7df 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 _0x418b=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','error','code','MailTransferReport,\x20%s,\x20%s','message','info','result'];(function(_0x4b0609,_0x41a7ed){var _0x2150a2=function(_0x2fc833){while(--_0x2fc833){_0x4b0609['push'](_0x4b0609['shift']());}};_0x2150a2(++_0x41a7ed);}(_0x418b,0x1c3));var _0xb418=function(_0x260d70,_0x2a4469){_0x260d70=_0x260d70-0x0;var _0x3b831e=_0x418b[_0x260d70];return _0x3b831e;};'use strict';var _=require(_0xb418('0x0'));var util=require(_0xb418('0x1'));var moment=require(_0xb418('0x2'));var BPromise=require(_0xb418('0x3'));var rs=require(_0xb418('0x4'));var fs=require('fs');var Redis=require(_0xb418('0x5'));var db=require(_0xb418('0x6'))['db'];var utils=require(_0xb418('0x7'));var logger=require(_0xb418('0x8'))(_0xb418('0x9'));var config=require(_0xb418('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xb418('0xb')][_0xb418('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xffc83d,_0x5812ac,_0x593932){return new BPromise(function(_0x266c32,_0x40bab0){return client[_0xb418('0xd')](_0xffc83d,_0x593932)[_0xb418('0xe')](function(_0x263645){logger['info']('MailTransferReport,\x20%s,\x20%s',_0x5812ac,_0xb418('0xf'));logger[_0xb418('0x10')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x5812ac,_0xb418('0xf'),JSON[_0xb418('0x11')](_0x263645));if(_0x263645['error']){if(_0x263645[_0xb418('0x12')][_0xb418('0x13')]===0x1f4){logger['error'](_0xb418('0x14'),_0x5812ac,_0x263645[_0xb418('0x12')][_0xb418('0x15')]);return _0x40bab0(_0x263645['error'][_0xb418('0x15')]);}logger[_0xb418('0x12')](_0xb418('0x14'),_0x5812ac,_0x263645[_0xb418('0x12')][_0xb418('0x15')]);return _0x266c32(_0x263645[_0xb418('0x12')][_0xb418('0x15')]);}else{logger[_0xb418('0x16')](_0xb418('0x14'),_0x5812ac,'request\x20sent');_0x266c32(_0x263645[_0xb418('0x17')][_0xb418('0x15')]);}})[_0xb418('0x18')](function(_0x3c42f1){logger[_0xb418('0x12')](_0xb418('0x14'),_0x5812ac,_0x3c42f1);_0x40bab0(_0x3c42f1);});});} \ No newline at end of file +var _0x195b=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','request\x20sent','stringify','error','code','MailTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x4fa489,_0x4cba6b){var _0x41d2ce=function(_0x364060){while(--_0x364060){_0x4fa489['push'](_0x4fa489['shift']());}};_0x41d2ce(++_0x4cba6b);}(_0x195b,0x1f2));var _0xb195=function(_0x316676,_0x421066){_0x316676=_0x316676-0x0;var _0x4833e3=_0x195b[_0x316676];return _0x4833e3;};'use strict';var _=require(_0xb195('0x0'));var util=require(_0xb195('0x1'));var moment=require(_0xb195('0x2'));var BPromise=require(_0xb195('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb195('0x4'));var db=require(_0xb195('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb195('0x6'))(_0xb195('0x7'));var config=require(_0xb195('0x8'));var jayson=require(_0xb195('0x9'));var client=jayson[_0xb195('0xa')][_0xb195('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5772eb,_0x30cf9e,_0x1e2b0a){return new BPromise(function(_0x1d3c33,_0x4b89a9){return client[_0xb195('0xc')](_0x5772eb,_0x1e2b0a)[_0xb195('0xd')](function(_0x13e93b){logger[_0xb195('0xe')]('MailTransferReport,\x20%s,\x20%s',_0x30cf9e,'request\x20sent');logger[_0xb195('0xf')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x30cf9e,_0xb195('0x10'),JSON[_0xb195('0x11')](_0x13e93b));if(_0x13e93b[_0xb195('0x12')]){if(_0x13e93b[_0xb195('0x12')][_0xb195('0x13')]===0x1f4){logger[_0xb195('0x12')](_0xb195('0x14'),_0x30cf9e,_0x13e93b['error'][_0xb195('0x15')]);return _0x4b89a9(_0x13e93b[_0xb195('0x12')][_0xb195('0x15')]);}logger[_0xb195('0x12')]('MailTransferReport,\x20%s,\x20%s',_0x30cf9e,_0x13e93b[_0xb195('0x12')][_0xb195('0x15')]);return _0x1d3c33(_0x13e93b[_0xb195('0x12')][_0xb195('0x15')]);}else{logger['info'](_0xb195('0x14'),_0x30cf9e,_0xb195('0x10'));_0x1d3c33(_0x13e93b[_0xb195('0x16')][_0xb195('0x15')]);}})[_0xb195('0x17')](function(_0x4b421a){logger[_0xb195('0x12')](_0xb195('0x14'),_0x30cf9e,_0x4b421a);_0x4b89a9(_0x4b421a);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 555d7d5..beccdc8 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 _0xb79b=['create','put','isAuthenticated','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','/describe','describe','/:id','show'];(function(_0x538877,_0x3b5b54){var _0x30f1e1=function(_0xc2ad52){while(--_0xc2ad52){_0x538877['push'](_0x538877['shift']());}};_0x30f1e1(++_0x3b5b54);}(_0xb79b,0xc5));var _0xbb79=function(_0x547976,_0x3322e2){_0x547976=_0x547976-0x0;var _0x3a2508=_0xb79b[_0x547976];return _0x3a2508;};'use strict';var multer=require('multer');var util=require(_0xbb79('0x0'));var path=require(_0xbb79('0x1'));var timeout=require(_0xbb79('0x2'));var express=require(_0xbb79('0x3'));var router=express[_0xbb79('0x4')]();var fs_extra=require(_0xbb79('0x5'));var auth=require(_0xbb79('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./memberReport.controller');router[_0xbb79('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xbb79('0x7')](_0xbb79('0x8'),auth['isAuthenticated'](),controller[_0xbb79('0x9')]);router[_0xbb79('0x7')](_0xbb79('0xa'),auth['isAuthenticated'](),controller[_0xbb79('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbb79('0xc')]);router[_0xbb79('0xd')](_0xbb79('0xa'),auth[_0xbb79('0xe')](),controller[_0xbb79('0xf')]);router[_0xbb79('0x10')](_0xbb79('0xa'),auth[_0xbb79('0xe')](),controller[_0xbb79('0x11')]);module[_0xbb79('0x12')]=router; \ No newline at end of file +var _0x3297=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','post','create','update','destroy','multer','path','connect-timeout'];(function(_0x24e0c9,_0x284109){var _0x4448f0=function(_0x576980){while(--_0x576980){_0x24e0c9['push'](_0x24e0c9['shift']());}};_0x4448f0(++_0x284109);}(_0x3297,0x1ea));var _0x7329=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x3297[_0x46aff0];return _0x9d78cf;};'use strict';var multer=require(_0x7329('0x0'));var util=require('util');var path=require(_0x7329('0x1'));var timeout=require(_0x7329('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7329('0x3'));var auth=require(_0x7329('0x4'));var interaction=require(_0x7329('0x5'));var config=require(_0x7329('0x6'));var controller=require('./memberReport.controller');router[_0x7329('0x7')]('/',auth[_0x7329('0x8')](),controller[_0x7329('0x9')]);router[_0x7329('0x7')]('/describe',auth[_0x7329('0x8')](),controller[_0x7329('0xa')]);router[_0x7329('0x7')](_0x7329('0xb'),auth['isAuthenticated'](),controller[_0x7329('0xc')]);router[_0x7329('0xd')]('/',auth[_0x7329('0x8')](),controller[_0x7329('0xe')]);router['put'](_0x7329('0xb'),auth[_0x7329('0x8')](),controller[_0x7329('0xf')]);router['delete']('/:id',auth[_0x7329('0x8')](),controller[_0x7329('0x10')]);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 da78bed..f65168f 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 _0xc5a3=['duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','seconds','setDataValue','exitAt'];(function(_0x5d16fb,_0x4fcc7a){var _0x8b5e9d=function(_0x224374){while(--_0x224374){_0x5d16fb['push'](_0x5d16fb['shift']());}};_0x8b5e9d(++_0x4fcc7a);}(_0xc5a3,0x66));var _0x3c5a=function(_0x17b7be,_0x167637){_0x17b7be=_0x17b7be-0x0;var _0x2a715f=_0xc5a3[_0x17b7be];return _0x2a715f;};'use strict';var Sequelize=require(_0x3c5a('0x0'));var moment=require(_0x3c5a('0x1'));module['exports']={'channel':{'type':Sequelize[_0x3c5a('0x2')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x3c5a('0x2')]},'type':{'type':Sequelize[_0x3c5a('0x2')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x3c5a('0x3')},'duration':{'type':Sequelize[_0x3c5a('0x4')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x3c5a('0x5')],'set':function(_0x38ed54){var _0x166d28=moment(_0x38ed54);var _0x31c5ea=moment(this[_0x3c5a('0x6')]('enterAt'));var _0xf0ccf9=_0x166d28['diff'](_0x31c5ea,_0x3c5a('0x7'));this[_0x3c5a('0x8')](_0x3c5a('0x9'),_0x38ed54);this[_0x3c5a('0x8')](_0x3c5a('0xa'),_0xf0ccf9>=0x0?_0xf0ccf9:null);}},'data1':{'type':Sequelize[_0x3c5a('0x2')],'comment':_0x3c5a('0xb')},'data2':{'type':Sequelize[_0x3c5a('0x2')],'comment':_0x3c5a('0xc')},'data3':{'type':Sequelize[_0x3c5a('0x2')],'comment':_0x3c5a('0xd')},'data4':{'type':Sequelize[_0x3c5a('0x2')],'comment':_0x3c5a('0xe')},'data5':{'type':Sequelize[_0x3c5a('0x2')],'comment':_0x3c5a('0xf')},'role':{'type':Sequelize[_0x3c5a('0x2')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x3c5a('0x2')]}}; \ No newline at end of file +var _0x3493=['talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff','setDataValue','exitAt','duration'];(function(_0x107aaa,_0x2dafc4){var _0x13154a=function(_0x23a0c0){while(--_0x23a0c0){_0x107aaa['push'](_0x107aaa['shift']());}};_0x13154a(++_0x2dafc4);}(_0x3493,0xb7));var _0x3349=function(_0x1992da,_0x563461){_0x1992da=_0x1992da-0x0;var _0xba8a45=_0x3493[_0x1992da];return _0xba8a45;};'use strict';var Sequelize=require(_0x3349('0x0'));var moment=require('moment');module[_0x3349('0x1')]={'channel':{'type':Sequelize[_0x3349('0x2')]},'membername':{'type':Sequelize[_0x3349('0x2')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x3349('0x2')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x3349('0x3')},'duration':{'type':Sequelize[_0x3349('0x4')]},'enterAt':{'type':Sequelize[_0x3349('0x5')]},'exitAt':{'type':Sequelize[_0x3349('0x5')],'set':function(_0x48c78f){var _0x1202f1=moment(_0x48c78f);var _0x498399=moment(this[_0x3349('0x6')](_0x3349('0x7')));var _0x3b8c33=_0x1202f1[_0x3349('0x8')](_0x498399,'seconds');this[_0x3349('0x9')](_0x3349('0xa'),_0x48c78f);this[_0x3349('0x9')](_0x3349('0xb'),_0x3b8c33>=0x0?_0x3b8c33:null);}},'data1':{'type':Sequelize['STRING'],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize['STRING'],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0x3349('0x2')],'comment':_0x3349('0xc')},'data4':{'type':Sequelize['STRING'],'comment':_0x3349('0xd')},'data5':{'type':Sequelize[_0x3349('0x2')],'comment':_0x3349('0xe')},'role':{'type':Sequelize[_0x3349('0x2')]},'internal':{'type':Sequelize[_0x3349('0x4')]},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 59194f0..e288d95 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 _0x34e8=['path','sox','to-csv','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/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','map','MemberReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','catch','show','params','keys','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0x34e8,0x12c));var _0x834e=function(_0x60a5b8,_0x21d117){_0x60a5b8=_0x60a5b8-0x0;var _0x48886d=_0x34e8[_0x60a5b8];return _0x48886d;};'use strict';var emlformat=require(_0x834e('0x0'));var rimraf=require(_0x834e('0x1'));var zipdir=require(_0x834e('0x2'));var jsonpatch=require(_0x834e('0x3'));var rp=require('request-promise');var moment=require(_0x834e('0x4'));var BPromise=require(_0x834e('0x5'));var Mustache=require(_0x834e('0x6'));var util=require(_0x834e('0x7'));var path=require(_0x834e('0x8'));var sox=require(_0x834e('0x9'));var csv=require(_0x834e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x834e('0xb'));var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0xa'));var querystring=require(_0x834e('0x10'));var Papa=require(_0x834e('0x11'));var Redis=require(_0x834e('0x12'));var authService=require(_0x834e('0x13'));var qs=require(_0x834e('0x14'));var as=require(_0x834e('0x15'));var hardwareService=require(_0x834e('0x16'));var logger=require(_0x834e('0x17'))(_0x834e('0x18'));var utils=require(_0x834e('0x19'));var config=require(_0x834e('0x1a'));var licenseUtil=require(_0x834e('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e5b6d,_0x6cd9b9){_0x6cd9b9=_0x6cd9b9||0xcc;return function(_0x58a27e){if(_0x58a27e){return _0x5e5b6d[_0x834e('0x1c')](_0x6cd9b9);}return _0x5e5b6d[_0x834e('0x1d')](_0x6cd9b9)[_0x834e('0x1e')]();};}function respondWithResult(_0x21cc0a,_0x50e860){_0x50e860=_0x50e860||0xc8;return function(_0x43156c){if(_0x43156c){return _0x21cc0a[_0x834e('0x1d')](_0x50e860)['json'](_0x43156c);}};}function respondWithFilteredResult(_0x316205,_0x4a9cdc){return function(_0x38a8cd){if(_0x38a8cd){var _0x36d443=typeof _0x4a9cdc['offset']===_0x834e('0x1f')&&typeof _0x4a9cdc[_0x834e('0x20')]===_0x834e('0x1f');var _0x50b3f6=_0x38a8cd[_0x834e('0x21')];var _0x211e9a=_0x36d443?0x0:_0x4a9cdc[_0x834e('0x22')];var _0xb993a1=_0x36d443?_0x38a8cd[_0x834e('0x21')]:_0x4a9cdc[_0x834e('0x22')]+_0x4a9cdc[_0x834e('0x20')];var _0x595515;if(_0xb993a1>=_0x50b3f6){_0xb993a1=_0x50b3f6;_0x595515=0xc8;}else{_0x595515=0xce;}_0x316205[_0x834e('0x1d')](_0x595515);return _0x316205[_0x834e('0x23')](_0x834e('0x24'),_0x211e9a+'-'+_0xb993a1+'/'+_0x50b3f6)[_0x834e('0x25')](_0x38a8cd);}return null;};}function patchUpdates(_0x4ab05d){return function(_0x45a630){try{jsonpatch[_0x834e('0x26')](_0x45a630,_0x4ab05d,!![]);}catch(_0x5a05c0){return BPromise[_0x834e('0x27')](_0x5a05c0);}return _0x45a630[_0x834e('0x28')]();};}function saveUpdates(_0x8d406e,_0x5c55ca){return function(_0x4e3f48){if(_0x4e3f48){return _0x4e3f48[_0x834e('0x29')](_0x8d406e)[_0x834e('0x2a')](function(_0x589dde){return _0x589dde;});}return null;};}function removeEntity(_0x25ee1d,_0x1dc1e0){return function(_0x58f4fd){if(_0x58f4fd){return _0x58f4fd[_0x834e('0x2b')]()[_0x834e('0x2a')](function(){_0x25ee1d[_0x834e('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24fcf7,_0x3e310f){return function(_0x5e1cc5){if(!_0x5e1cc5){_0x24fcf7['sendStatus'](0x194);}return _0x5e1cc5;};}function handleError(_0x1e713a,_0x508a1d){_0x508a1d=_0x508a1d||0x1f4;return function(_0x2826ec){logger[_0x834e('0x2c')](_0x2826ec[_0x834e('0x2d')]);if(_0x2826ec[_0x834e('0x2e')]){delete _0x2826ec[_0x834e('0x2e')];}_0x1e713a[_0x834e('0x1d')](_0x508a1d)['send'](_0x2826ec);};}exports['index']=function(_0x4dc64a,_0x58c1d7){var _0x2c7a8d={},_0x567cea={},_0x106d6a={'count':0x0,'rows':[]};var _0x5dacc1=_[_0x834e('0x2f')](db[_0x834e('0x30')][_0x834e('0x31')],function(_0x1e026a){return{'name':_0x1e026a[_0x834e('0x32')],'type':_0x1e026a[_0x834e('0x33')][_0x834e('0x34')]};});_0x567cea[_0x834e('0x35')]=_[_0x834e('0x2f')](_0x5dacc1,'name');_0x567cea[_0x834e('0x36')]=_['keys'](_0x4dc64a[_0x834e('0x36')]);_0x567cea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],_0x567cea[_0x834e('0x36')]);_0x2c7a8d[_0x834e('0x39')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x4dc64a[_0x834e('0x36')]['fields']));_0x2c7a8d[_0x834e('0x39')]=_0x2c7a8d[_0x834e('0x39')][_0x834e('0x3b')]?_0x2c7a8d[_0x834e('0x39')]:_0x567cea['model'];if(!_0x4dc64a[_0x834e('0x36')][_0x834e('0x3c')]('nolimit')){_0x2c7a8d['limit']=qs['limit'](_0x4dc64a[_0x834e('0x36')][_0x834e('0x20')]);_0x2c7a8d[_0x834e('0x22')]=qs[_0x834e('0x22')](_0x4dc64a[_0x834e('0x36')][_0x834e('0x22')]);}_0x2c7a8d['order']=qs[_0x834e('0x3d')](_0x4dc64a['query'][_0x834e('0x3d')]);_0x2c7a8d[_0x834e('0x3e')]=qs['filters'](_[_0x834e('0x3f')](_0x4dc64a[_0x834e('0x36')],_0x567cea['filters']),_0x5dacc1);if(_0x4dc64a['query'][_0x834e('0x40')]){_0x2c7a8d[_0x834e('0x3e')]=_[_0x834e('0x41')](_0x2c7a8d[_0x834e('0x3e')],{'$or':_[_0x834e('0x2f')](_0x5dacc1,function(_0x4ca43c){if(_0x4ca43c[_0x834e('0x33')]!=='VIRTUAL'){var _0x50c243={};_0x50c243[_0x4ca43c[_0x834e('0x2e')]]={'$like':'%'+_0x4dc64a['query'][_0x834e('0x40')]+'%'};return _0x50c243;}})});}_0x2c7a8d=_[_0x834e('0x41')]({},_0x2c7a8d,_0x4dc64a[_0x834e('0x42')]);var _0x3c59af={'where':_0x2c7a8d[_0x834e('0x3e')]};return db['MemberReport'][_0x834e('0x21')](_0x3c59af)[_0x834e('0x2a')](function(_0x38f266){_0x106d6a['count']=_0x38f266;if(_0x4dc64a[_0x834e('0x36')][_0x834e('0x43')]){_0x2c7a8d['include']=[{'all':!![]}];}return db[_0x834e('0x30')]['findAll'](_0x2c7a8d);})[_0x834e('0x2a')](function(_0x585335){_0x106d6a['rows']=_0x585335;return _0x106d6a;})['then'](respondWithFilteredResult(_0x58c1d7,_0x2c7a8d))[_0x834e('0x44')](handleError(_0x58c1d7,null));};exports[_0x834e('0x45')]=function(_0x3bcbf4,_0xbc1571){var _0x8ad264={'raw':!![],'where':{'id':_0x3bcbf4[_0x834e('0x46')]['id']}},_0x23feea={};_0x23feea['model']=_[_0x834e('0x47')](db['MemberReport'][_0x834e('0x31')]);_0x23feea['query']=_[_0x834e('0x47')](_0x3bcbf4['query']);_0x23feea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x23feea['model'],_0x23feea[_0x834e('0x36')]);_0x8ad264[_0x834e('0x39')]=_[_0x834e('0x38')](_0x23feea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x3bcbf4[_0x834e('0x36')][_0x834e('0x3a')]));_0x8ad264[_0x834e('0x39')]=_0x8ad264[_0x834e('0x39')][_0x834e('0x3b')]?_0x8ad264['attributes']:_0x23feea[_0x834e('0x35')];if(_0x3bcbf4[_0x834e('0x36')]['includeAll']){_0x8ad264[_0x834e('0x48')]=[{'all':!![]}];}_0x8ad264=_[_0x834e('0x41')]({},_0x8ad264,_0x3bcbf4[_0x834e('0x42')]);return db[_0x834e('0x30')][_0x834e('0x49')](_0x8ad264)[_0x834e('0x2a')](handleEntityNotFound(_0xbc1571,null))['then'](respondWithResult(_0xbc1571,null))['catch'](handleError(_0xbc1571,null));};exports[_0x834e('0x4a')]=function(_0x1a5444,_0x30568e){return db[_0x834e('0x30')][_0x834e('0x4a')](_0x1a5444[_0x834e('0x4b')],{})[_0x834e('0x2a')](respondWithResult(_0x30568e,0xc9))[_0x834e('0x44')](handleError(_0x30568e,null));};exports[_0x834e('0x29')]=function(_0x390c45,_0xf02f0d){if(_0x390c45[_0x834e('0x4b')]['id']){delete _0x390c45[_0x834e('0x4b')]['id'];}return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x390c45[_0x834e('0x46')]['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0xf02f0d,null))[_0x834e('0x2a')](saveUpdates(_0x390c45[_0x834e('0x4b')],null))[_0x834e('0x2a')](respondWithResult(_0xf02f0d,null))['catch'](handleError(_0xf02f0d,null));};exports[_0x834e('0x2b')]=function(_0x1f08b9,_0x4e73e0){return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x1f08b9['params']['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0x4e73e0,null))[_0x834e('0x2a')](removeEntity(_0x4e73e0,null))[_0x834e('0x44')](handleError(_0x4e73e0,null));};exports[_0x834e('0x4c')]=function(_0x4288e4,_0xb77aab){return db[_0x834e('0x30')]['describe']()[_0x834e('0x2a')](respondWithResult(_0xb77aab,null))[_0x834e('0x44')](handleError(_0xb77aab,null));}; \ No newline at end of file +var _0x3e74=['show','params','options','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','limit','offset','count','status','set','Content-Range','apply','save','update','then','destroy','sendStatus','name','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows'];(function(_0x1a14ff,_0x4da01c){var _0x324012=function(_0xc92257){while(--_0xc92257){_0x1a14ff['push'](_0x1a14ff['shift']());}};_0x324012(++_0x4da01c);}(_0x3e74,0x175));var _0x43e7=function(_0x32848b,_0x2a2a2b){_0x32848b=_0x32848b-0x0;var _0xd2271b=_0x3e74[_0x32848b];return _0xd2271b;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];function respondWithStatusCode(_0xc960ea,_0x2718d3){_0x2718d3=_0x2718d3||0xcc;return function(_0x3bb83f){if(_0x3bb83f){return _0xc960ea['sendStatus'](_0x2718d3);}return _0xc960ea['status'](_0x2718d3)[_0x43e7('0x15')]();};}function respondWithResult(_0x21fdd3,_0x44b0bd){_0x44b0bd=_0x44b0bd||0xc8;return function(_0x51b974){if(_0x51b974){return _0x21fdd3['status'](_0x44b0bd)[_0x43e7('0x16')](_0x51b974);}};}function respondWithFilteredResult(_0x14c146,_0x203378){return function(_0x328445){if(_0x328445){var _0x4de324=typeof _0x203378['offset']===_0x43e7('0x17')&&typeof _0x203378[_0x43e7('0x18')]===_0x43e7('0x17');var _0x5d346f=_0x328445['count'];var _0x446986=_0x4de324?0x0:_0x203378[_0x43e7('0x19')];var _0x9037d3=_0x4de324?_0x328445[_0x43e7('0x1a')]:_0x203378[_0x43e7('0x19')]+_0x203378[_0x43e7('0x18')];var _0x619236;if(_0x9037d3>=_0x5d346f){_0x9037d3=_0x5d346f;_0x619236=0xc8;}else{_0x619236=0xce;}_0x14c146[_0x43e7('0x1b')](_0x619236);return _0x14c146[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x446986+'-'+_0x9037d3+'/'+_0x5d346f)[_0x43e7('0x16')](_0x328445);}return null;};}function patchUpdates(_0x177ee1){return function(_0x4b5d64){try{jsonpatch[_0x43e7('0x1e')](_0x4b5d64,_0x177ee1,!![]);}catch(_0x3c6625){return BPromise['reject'](_0x3c6625);}return _0x4b5d64[_0x43e7('0x1f')]();};}function saveUpdates(_0x3e281e,_0x3945bb){return function(_0x28aacc){if(_0x28aacc){return _0x28aacc[_0x43e7('0x20')](_0x3e281e)[_0x43e7('0x21')](function(_0x54a9e7){return _0x54a9e7;});}return null;};}function removeEntity(_0x454359,_0x4eea52){return function(_0x4c9df3){if(_0x4c9df3){return _0x4c9df3[_0x43e7('0x22')]()[_0x43e7('0x21')](function(){_0x454359['status'](0xcc)[_0x43e7('0x15')]();});}};}function handleEntityNotFound(_0x4ca5cf,_0x326dab){return function(_0x5c5e67){if(!_0x5c5e67){_0x4ca5cf[_0x43e7('0x23')](0x194);}return _0x5c5e67;};}function handleError(_0x1b5f50,_0x20888b){_0x20888b=_0x20888b||0x1f4;return function(_0x405f85){logger['error'](_0x405f85['stack']);if(_0x405f85[_0x43e7('0x24')]){delete _0x405f85['name'];}_0x1b5f50[_0x43e7('0x1b')](_0x20888b)[_0x43e7('0x25')](_0x405f85);};}exports[_0x43e7('0x26')]=function(_0xb1fc63,_0x5087d7){var _0x33a1a5={},_0x4690a6={},_0x45b675={'count':0x0,'rows':[]};var _0x50f9f5=_[_0x43e7('0x27')](db[_0x43e7('0x28')][_0x43e7('0x29')],function(_0x31b2a6){return{'name':_0x31b2a6[_0x43e7('0x2a')],'type':_0x31b2a6[_0x43e7('0x2b')][_0x43e7('0x2c')]};});_0x4690a6[_0x43e7('0x2d')]=_[_0x43e7('0x27')](_0x50f9f5,_0x43e7('0x24'));_0x4690a6['query']=_[_0x43e7('0x2e')](_0xb1fc63[_0x43e7('0x2f')]);_0x4690a6[_0x43e7('0x30')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],_0x4690a6['query']);_0x33a1a5[_0x43e7('0x32')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],qs[_0x43e7('0x33')](_0xb1fc63['query']['fields']));_0x33a1a5['attributes']=_0x33a1a5[_0x43e7('0x32')][_0x43e7('0x34')]?_0x33a1a5[_0x43e7('0x32')]:_0x4690a6[_0x43e7('0x2d')];if(!_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x35')]('nolimit')){_0x33a1a5['limit']=qs['limit'](_0xb1fc63['query']['limit']);_0x33a1a5['offset']=qs['offset'](_0xb1fc63[_0x43e7('0x2f')]['offset']);}_0x33a1a5[_0x43e7('0x36')]=qs[_0x43e7('0x37')](_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x37')]);_0x33a1a5[_0x43e7('0x38')]=qs[_0x43e7('0x30')](_[_0x43e7('0x39')](_0xb1fc63['query'],_0x4690a6['filters']),_0x50f9f5);if(_0xb1fc63['query'][_0x43e7('0x3a')]){_0x33a1a5[_0x43e7('0x38')]=_[_0x43e7('0x3b')](_0x33a1a5[_0x43e7('0x38')],{'$or':_[_0x43e7('0x27')](_0x50f9f5,function(_0x1ed538){if(_0x1ed538[_0x43e7('0x2b')]!==_0x43e7('0x3c')){var _0x55c798={};_0x55c798[_0x1ed538[_0x43e7('0x24')]]={'$like':'%'+_0xb1fc63[_0x43e7('0x2f')]['filter']+'%'};return _0x55c798;}})});}_0x33a1a5=_[_0x43e7('0x3b')]({},_0x33a1a5,_0xb1fc63['options']);var _0x44d8e4={'where':_0x33a1a5[_0x43e7('0x38')]};return db[_0x43e7('0x28')][_0x43e7('0x1a')](_0x44d8e4)[_0x43e7('0x21')](function(_0x234d8f){_0x45b675['count']=_0x234d8f;if(_0xb1fc63['query'][_0x43e7('0x3d')]){_0x33a1a5[_0x43e7('0x3e')]=[{'all':!![]}];}return db[_0x43e7('0x28')][_0x43e7('0x3f')](_0x33a1a5);})[_0x43e7('0x21')](function(_0x4a4a85){_0x45b675[_0x43e7('0x40')]=_0x4a4a85;return _0x45b675;})[_0x43e7('0x21')](respondWithFilteredResult(_0x5087d7,_0x33a1a5))['catch'](handleError(_0x5087d7,null));};exports[_0x43e7('0x41')]=function(_0x51a69c,_0x2ad8ef){var _0x504101={'raw':!![],'where':{'id':_0x51a69c[_0x43e7('0x42')]['id']}},_0x3d81ae={};_0x3d81ae[_0x43e7('0x2d')]=_[_0x43e7('0x2e')](db['MemberReport']['rawAttributes']);_0x3d81ae[_0x43e7('0x2f')]=_[_0x43e7('0x2e')](_0x51a69c[_0x43e7('0x2f')]);_0x3d81ae[_0x43e7('0x30')]=_['intersection'](_0x3d81ae['model'],_0x3d81ae['query']);_0x504101[_0x43e7('0x32')]=_['intersection'](_0x3d81ae[_0x43e7('0x2d')],qs['fields'](_0x51a69c['query'][_0x43e7('0x33')]));_0x504101['attributes']=_0x504101[_0x43e7('0x32')][_0x43e7('0x34')]?_0x504101[_0x43e7('0x32')]:_0x3d81ae[_0x43e7('0x2d')];if(_0x51a69c['query'][_0x43e7('0x3d')]){_0x504101[_0x43e7('0x3e')]=[{'all':!![]}];}_0x504101=_[_0x43e7('0x3b')]({},_0x504101,_0x51a69c[_0x43e7('0x43')]);return db[_0x43e7('0x28')][_0x43e7('0x44')](_0x504101)['then'](handleEntityNotFound(_0x2ad8ef,null))['then'](respondWithResult(_0x2ad8ef,null))[_0x43e7('0x45')](handleError(_0x2ad8ef,null));};exports[_0x43e7('0x46')]=function(_0x212841,_0x4c00a8){return db['MemberReport']['create'](_0x212841[_0x43e7('0x47')],{})[_0x43e7('0x21')](respondWithResult(_0x4c00a8,0xc9))['catch'](handleError(_0x4c00a8,null));};exports[_0x43e7('0x20')]=function(_0x47686e,_0x3c96fe){if(_0x47686e['body']['id']){delete _0x47686e['body']['id'];}return db['MemberReport']['find']({'where':{'id':_0x47686e[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x3c96fe,null))['then'](saveUpdates(_0x47686e[_0x43e7('0x47')],null))[_0x43e7('0x21')](respondWithResult(_0x3c96fe,null))[_0x43e7('0x45')](handleError(_0x3c96fe,null));};exports[_0x43e7('0x22')]=function(_0x4a0ce5,_0x2718d5){return db['MemberReport']['find']({'where':{'id':_0x4a0ce5[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x2718d5,null))[_0x43e7('0x21')](removeEntity(_0x2718d5,null))[_0x43e7('0x45')](handleError(_0x2718d5,null));};exports[_0x43e7('0x48')]=function(_0x2351cf,_0x1cd87c){return db[_0x43e7('0x28')][_0x43e7('0x48')]()[_0x43e7('0x21')](respondWithResult(_0x1cd87c,null))['catch'](handleError(_0x1cd87c,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index eb02811..c8eb489 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 _0x3a90=['rimraf','../../config/environment','./memberReport.attributes','exports','MemberReport','report_member','membername_interface','membername','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x24b245,_0x1b3508){var _0x56f828=function(_0x21752a){while(--_0x21752a){_0x24b245['push'](_0x24b245['shift']());}};_0x56f828(++_0x1b3508);}(_0x3a90,0x1f2));var _0x03a9=function(_0x374df1,_0x7d6802){_0x374df1=_0x374df1-0x0;var _0x3e8d4c=_0x3a90[_0x374df1];return _0x3e8d4c;};'use strict';var _=require(_0x03a9('0x0'));var util=require('util');var logger=require(_0x03a9('0x1'))(_0x03a9('0x2'));var moment=require(_0x03a9('0x3'));var BPromise=require(_0x03a9('0x4'));var rp=require(_0x03a9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x03a9('0x6'));var config=require(_0x03a9('0x7'));var attributes=require(_0x03a9('0x8'));module[_0x03a9('0x9')]=function(_0x38f21a,_0x50acb6){return _0x38f21a['define'](_0x03a9('0xa'),attributes,{'tableName':_0x03a9('0xb'),'paranoid':![],'indexes':[{'name':_0x03a9('0xc'),'fields':[_0x03a9('0xd'),'interface']}],'timestamps':!![]});}; \ No newline at end of file +var _0x33fe=['moment','bluebird','path','rimraf','../../config/environment','exports','define','report_member','interface','lodash','util','../../config/logger','api'];(function(_0x5c09d4,_0x1c0cb3){var _0x5d617e=function(_0x9924d7){while(--_0x9924d7){_0x5c09d4['push'](_0x5c09d4['shift']());}};_0x5d617e(++_0x1c0cb3);}(_0x33fe,0x175));var _0xe33f=function(_0x1e4082,_0x1fffe1){_0x1e4082=_0x1e4082-0x0;var _0x535748=_0x33fe[_0x1e4082];return _0x535748;};'use strict';var _=require(_0xe33f('0x0'));var util=require(_0xe33f('0x1'));var logger=require(_0xe33f('0x2'))(_0xe33f('0x3'));var moment=require(_0xe33f('0x4'));var BPromise=require(_0xe33f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe33f('0x6'));var rimraf=require(_0xe33f('0x7'));var config=require(_0xe33f('0x8'));var attributes=require('./memberReport.attributes');module[_0xe33f('0x9')]=function(_0x3e39ce,_0x5a2639){return _0x3e39ce[_0xe33f('0xa')]('MemberReport',attributes,{'tableName':_0xe33f('0xb'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':['membername',_0xe33f('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index f8a5180..9196a6e 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 _0x5334=['randomstring','../../mysqldb','../../config/logger','rpc','http','request','then','info','MemberReport,\x20%s,\x20%s','debug','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','options','where','attributes','include','map','model','GetMemberReport','CreateMemberReport','MemberReport','body','raw','UpdateMemberReport','update','limit','lodash','util','moment','bluebird'];(function(_0x39fd7e,_0x17607d){var _0x1d5746=function(_0x11791a){while(--_0x11791a){_0x39fd7e['push'](_0x39fd7e['shift']());}};_0x1d5746(++_0x17607d);}(_0x5334,0x84));var _0x4533=function(_0x33bd66,_0x33dfcd){_0x33bd66=_0x33bd66-0x0;var _0x4055e0=_0x5334[_0x33bd66];return _0x4055e0;};'use strict';var _=require(_0x4533('0x0'));var util=require(_0x4533('0x1'));var moment=require(_0x4533('0x2'));var BPromise=require(_0x4533('0x3'));var rs=require(_0x4533('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4533('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4533('0x6'))(_0x4533('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x4533('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4dea06,_0x4d89e7,_0x487906){return new BPromise(function(_0x3fbdc3,_0x42f94b){return client[_0x4533('0x9')](_0x4dea06,_0x487906)[_0x4533('0xa')](function(_0x31018b){logger[_0x4533('0xb')](_0x4533('0xc'),_0x4d89e7,'request\x20sent');logger[_0x4533('0xd')](_0x4533('0xe'),_0x4d89e7,_0x4533('0xf'),JSON[_0x4533('0x10')](_0x31018b));if(_0x31018b['error']){if(_0x31018b[_0x4533('0x11')]['code']===0x1f4){logger[_0x4533('0x11')](_0x4533('0xc'),_0x4d89e7,_0x31018b[_0x4533('0x11')][_0x4533('0x12')]);return _0x42f94b(_0x31018b['error'][_0x4533('0x12')]);}logger[_0x4533('0x11')](_0x4533('0xc'),_0x4d89e7,_0x31018b[_0x4533('0x11')]['message']);return _0x3fbdc3(_0x31018b[_0x4533('0x11')]['message']);}else{logger['info'](_0x4533('0xc'),_0x4d89e7,_0x4533('0xf'));_0x3fbdc3(_0x31018b['result'][_0x4533('0x12')]);}})[_0x4533('0x13')](function(_0x2a9877){logger['error'](_0x4533('0xc'),_0x4d89e7,_0x2a9877);_0x42f94b(_0x2a9877);});});}exports['GetMemberReport']=function(_0x3ddb36){var _0x3d16a2=this;return new Promise(function(_0x56ab4f,_0xd10c6a){return db['MemberReport']['findAll']({'raw':_0x3ddb36[_0x4533('0x14')]?_0x3ddb36[_0x4533('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x3ddb36['options']?_0x3ddb36[_0x4533('0x14')][_0x4533('0x15')]||null:null,'attributes':_0x3ddb36[_0x4533('0x14')]?_0x3ddb36[_0x4533('0x14')][_0x4533('0x16')]||null:null,'limit':_0x3ddb36[_0x4533('0x14')]?_0x3ddb36[_0x4533('0x14')]['limit']||null:null,'include':_0x3ddb36[_0x4533('0x14')]?_0x3ddb36[_0x4533('0x14')][_0x4533('0x17')]?_['map'](_0x3ddb36['options'][_0x4533('0x17')],function(_0x11e93a){return{'model':db[_0x11e93a['model']],'as':_0x11e93a['as'],'attributes':_0x11e93a['attributes'],'include':_0x11e93a[_0x4533('0x17')]?_[_0x4533('0x18')](_0x11e93a[_0x4533('0x17')],function(_0x4d8189){return{'model':db[_0x4d8189[_0x4533('0x19')]],'as':_0x4d8189['as'],'attributes':_0x4d8189[_0x4533('0x16')],'include':_0x4d8189[_0x4533('0x17')]?_[_0x4533('0x18')](_0x4d8189[_0x4533('0x17')],function(_0x3fc5b0){return{'model':db[_0x3fc5b0[_0x4533('0x19')]],'as':_0x3fc5b0['as'],'attributes':_0x3fc5b0[_0x4533('0x16')]};}):[]};}):[]};}):[]:[]})[_0x4533('0xa')](function(_0x5f16bb){logger['info'](_0x4533('0x1a'),_0x3ddb36);logger['debug'](_0x4533('0x1a'),_0x3ddb36,JSON['stringify'](_0x5f16bb));_0x56ab4f(_0x5f16bb);})[_0x4533('0x13')](function(_0x42ba2d){logger[_0x4533('0x11')](_0x4533('0x1a'),_0x42ba2d[_0x4533('0x12')],_0x3ddb36);_0xd10c6a(_0x3d16a2[_0x4533('0x11')](0x1f4,_0x42ba2d[_0x4533('0x12')]));});});};exports[_0x4533('0x1b')]=function(_0x130566){var _0x43682f=this;return new Promise(function(_0x728791,_0x165df0){return db[_0x4533('0x1c')]['create'](_0x130566[_0x4533('0x1d')],{'raw':_0x130566['options']?_0x130566[_0x4533('0x14')][_0x4533('0x1e')]===undefined?!![]:![]:!![]})[_0x4533('0xa')](function(_0x3b89f0){logger[_0x4533('0xb')](_0x4533('0x1b'),_0x130566);logger[_0x4533('0xd')](_0x4533('0x1b'),_0x130566,JSON[_0x4533('0x10')](_0x3b89f0));_0x728791(_0x3b89f0);})[_0x4533('0x13')](function(_0xc3de12){logger[_0x4533('0x11')]('CreateMemberReport',_0xc3de12[_0x4533('0x12')],_0x130566);_0x165df0(_0x43682f[_0x4533('0x11')](0x1f4,_0xc3de12[_0x4533('0x12')]));});});};exports[_0x4533('0x1f')]=function(_0x42bc08){var _0x55268b=this;return new Promise(function(_0x86c14d,_0x35aefe){return db[_0x4533('0x1c')][_0x4533('0x20')](_0x42bc08[_0x4533('0x1d')],{'raw':_0x42bc08[_0x4533('0x14')]?_0x42bc08['options'][_0x4533('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42bc08[_0x4533('0x14')]?_0x42bc08['options'][_0x4533('0x15')]||null:null,'attributes':_0x42bc08[_0x4533('0x14')]?_0x42bc08[_0x4533('0x14')][_0x4533('0x16')]||null:null,'limit':_0x42bc08[_0x4533('0x14')]?_0x42bc08[_0x4533('0x14')][_0x4533('0x21')]||null:null})[_0x4533('0xa')](function(_0x4448d3){logger[_0x4533('0xb')]('UpdateMemberReport',_0x42bc08);logger[_0x4533('0xd')](_0x4533('0x1f'),_0x42bc08,JSON[_0x4533('0x10')](_0x4448d3));_0x86c14d(_0x4448d3);})[_0x4533('0x13')](function(_0x154ca3){logger[_0x4533('0x11')](_0x4533('0x1f'),_0x154ca3[_0x4533('0x12')],_0x42bc08);_0x35aefe(_0x55268b[_0x4533('0x11')](0x1f4,_0x154ca3[_0x4533('0x12')]));});});}; \ No newline at end of file +var _0xb422=['update','bluebird','../../mysqldb','../../config/logger','../../config/environment','client','http','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetMemberReport','MemberReport','options','where','limit','map','model','attributes','include','then','create','body','raw','CreateMemberReport','UpdateMemberReport'];(function(_0x59027f,_0x942a56){var _0x43db25=function(_0x20bd1f){while(--_0x20bd1f){_0x59027f['push'](_0x59027f['shift']());}};_0x43db25(++_0x942a56);}(_0xb422,0x85));var _0x2b42=function(_0x239a4b,_0x90265a){_0x239a4b=_0x239a4b-0x0;var _0xd6307e=_0xb422[_0x239a4b];return _0xd6307e;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x2b42('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2b42('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0x2b42('0x2'))('rpc');var config=require(_0x2b42('0x3'));var jayson=require('jayson/promise');var client=jayson[_0x2b42('0x4')][_0x2b42('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x750c2,_0x51b3bd,_0xde9c67){return new BPromise(function(_0x1b64f7,_0x12b303){return client['request'](_0x750c2,_0xde9c67)['then'](function(_0x4174e8){logger['info'](_0x2b42('0x6'),_0x51b3bd,_0x2b42('0x7'));logger[_0x2b42('0x8')](_0x2b42('0x9'),_0x51b3bd,'request\x20sent',JSON[_0x2b42('0xa')](_0x4174e8));if(_0x4174e8[_0x2b42('0xb')]){if(_0x4174e8['error'][_0x2b42('0xc')]===0x1f4){logger[_0x2b42('0xb')](_0x2b42('0x6'),_0x51b3bd,_0x4174e8[_0x2b42('0xb')]['message']);return _0x12b303(_0x4174e8['error'][_0x2b42('0xd')]);}logger[_0x2b42('0xb')]('MemberReport,\x20%s,\x20%s',_0x51b3bd,_0x4174e8[_0x2b42('0xb')][_0x2b42('0xd')]);return _0x1b64f7(_0x4174e8[_0x2b42('0xb')][_0x2b42('0xd')]);}else{logger[_0x2b42('0xe')](_0x2b42('0x6'),_0x51b3bd,_0x2b42('0x7'));_0x1b64f7(_0x4174e8[_0x2b42('0xf')][_0x2b42('0xd')]);}})[_0x2b42('0x10')](function(_0x4897d8){logger[_0x2b42('0xb')](_0x2b42('0x6'),_0x51b3bd,_0x4897d8);_0x12b303(_0x4897d8);});});}exports[_0x2b42('0x11')]=function(_0x3e3426){var _0x27419d=this;return new Promise(function(_0x3ab83c,_0xa28ba4){return db[_0x2b42('0x12')]['findAll']({'raw':_0x3e3426[_0x2b42('0x13')]?_0x3e3426[_0x2b42('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x3e3426[_0x2b42('0x13')]?_0x3e3426['options'][_0x2b42('0x14')]||null:null,'attributes':_0x3e3426[_0x2b42('0x13')]?_0x3e3426[_0x2b42('0x13')]['attributes']||null:null,'limit':_0x3e3426['options']?_0x3e3426[_0x2b42('0x13')][_0x2b42('0x15')]||null:null,'include':_0x3e3426[_0x2b42('0x13')]?_0x3e3426[_0x2b42('0x13')]['include']?_[_0x2b42('0x16')](_0x3e3426[_0x2b42('0x13')]['include'],function(_0x2b9531){return{'model':db[_0x2b9531[_0x2b42('0x17')]],'as':_0x2b9531['as'],'attributes':_0x2b9531[_0x2b42('0x18')],'include':_0x2b9531[_0x2b42('0x19')]?_[_0x2b42('0x16')](_0x2b9531[_0x2b42('0x19')],function(_0x5367f0){return{'model':db[_0x5367f0[_0x2b42('0x17')]],'as':_0x5367f0['as'],'attributes':_0x5367f0[_0x2b42('0x18')],'include':_0x5367f0[_0x2b42('0x19')]?_[_0x2b42('0x16')](_0x5367f0[_0x2b42('0x19')],function(_0x807625){return{'model':db[_0x807625[_0x2b42('0x17')]],'as':_0x807625['as'],'attributes':_0x807625[_0x2b42('0x18')]};}):[]};}):[]};}):[]:[]})[_0x2b42('0x1a')](function(_0xe32cdc){logger[_0x2b42('0xe')]('GetMemberReport',_0x3e3426);logger['debug'](_0x2b42('0x11'),_0x3e3426,JSON[_0x2b42('0xa')](_0xe32cdc));_0x3ab83c(_0xe32cdc);})[_0x2b42('0x10')](function(_0x352ef7){logger['error'](_0x2b42('0x11'),_0x352ef7[_0x2b42('0xd')],_0x3e3426);_0xa28ba4(_0x27419d[_0x2b42('0xb')](0x1f4,_0x352ef7['message']));});});};exports['CreateMemberReport']=function(_0x39e32e){var _0x15298d=this;return new Promise(function(_0x41d4ef,_0x17d28a){return db['MemberReport'][_0x2b42('0x1b')](_0x39e32e[_0x2b42('0x1c')],{'raw':_0x39e32e[_0x2b42('0x13')]?_0x39e32e['options'][_0x2b42('0x1d')]===undefined?!![]:![]:!![]})[_0x2b42('0x1a')](function(_0x3e029d){logger[_0x2b42('0xe')](_0x2b42('0x1e'),_0x39e32e);logger[_0x2b42('0x8')](_0x2b42('0x1e'),_0x39e32e,JSON[_0x2b42('0xa')](_0x3e029d));_0x41d4ef(_0x3e029d);})[_0x2b42('0x10')](function(_0x15ebd4){logger[_0x2b42('0xb')]('CreateMemberReport',_0x15ebd4[_0x2b42('0xd')],_0x39e32e);_0x17d28a(_0x15298d['error'](0x1f4,_0x15ebd4['message']));});});};exports[_0x2b42('0x1f')]=function(_0x75f09){var _0x4af6aa=this;return new Promise(function(_0x480315,_0x545fe2){return db[_0x2b42('0x12')][_0x2b42('0x20')](_0x75f09[_0x2b42('0x1c')],{'raw':_0x75f09['options']?_0x75f09[_0x2b42('0x13')][_0x2b42('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x75f09['options']?_0x75f09['options'][_0x2b42('0x14')]||null:null,'attributes':_0x75f09[_0x2b42('0x13')]?_0x75f09[_0x2b42('0x13')]['attributes']||null:null,'limit':_0x75f09[_0x2b42('0x13')]?_0x75f09[_0x2b42('0x13')][_0x2b42('0x15')]||null:null})[_0x2b42('0x1a')](function(_0x175367){logger['info'](_0x2b42('0x1f'),_0x75f09);logger[_0x2b42('0x8')](_0x2b42('0x1f'),_0x75f09,JSON[_0x2b42('0xa')](_0x175367));_0x480315(_0x175367);})[_0x2b42('0x10')](function(_0x27b219){logger[_0x2b42('0xb')](_0x2b42('0x1f'),_0x27b219[_0x2b42('0xd')],_0x75f09);_0x545fe2(_0x4af6aa[_0x2b42('0xb')](0x1f4,_0x27b219['message']));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 825df66..20022f7 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 _0x7343=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./migration.controller','get','index'];(function(_0x15d4d8,_0x447edc){var _0x1ca21f=function(_0x4e903a){while(--_0x4e903a){_0x15d4d8['push'](_0x15d4d8['shift']());}};_0x1ca21f(++_0x447edc);}(_0x7343,0xd9));var _0x3734=function(_0x6168c2,_0x1d5298){_0x6168c2=_0x6168c2-0x0;var _0x123f04=_0x7343[_0x6168c2];return _0x123f04;};'use strict';var multer=require(_0x3734('0x0'));var util=require(_0x3734('0x1'));var path=require('path');var timeout=require(_0x3734('0x2'));var express=require(_0x3734('0x3'));var router=express[_0x3734('0x4')]();var fs_extra=require(_0x3734('0x5'));var auth=require(_0x3734('0x6'));var interaction=require(_0x3734('0x7'));var config=require('../../config/environment');var controller=require(_0x3734('0x8'));router[_0x3734('0x9')]('/',controller[_0x3734('0xa')]);module[_0x3734('0xb')]=router; \ No newline at end of file +var _0x535f=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./migration.controller','get','index','exports','util','path'];(function(_0x233c09,_0x5bd3f3){var _0x34d396=function(_0x45eb11){while(--_0x45eb11){_0x233c09['push'](_0x233c09['shift']());}};_0x34d396(++_0x5bd3f3);}(_0x535f,0x111));var _0xf535=function(_0x26236f,_0x36916c){_0x26236f=_0x26236f-0x0;var _0x11c59f=_0x535f[_0x26236f];return _0x11c59f;};'use strict';var multer=require('multer');var util=require(_0xf535('0x0'));var path=require(_0xf535('0x1'));var timeout=require('connect-timeout');var express=require(_0xf535('0x2'));var router=express[_0xf535('0x3')]();var fs_extra=require(_0xf535('0x4'));var auth=require(_0xf535('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf535('0x6'));var controller=require(_0xf535('0x7'));router[_0xf535('0x8')]('/',controller[_0xf535('0x9')]);module[_0xf535('0xa')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 1d24849..2f7de1f 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 _0x0147=['exports','STRING','version'];(function(_0x2db9f7,_0x2eeaf0){var _0x26120b=function(_0x3bbc9e){while(--_0x3bbc9e){_0x2db9f7['push'](_0x2db9f7['shift']());}};_0x26120b(++_0x2eeaf0);}(_0x0147,0x17d));var _0x7014=function(_0xccdee1,_0x335480){_0xccdee1=_0xccdee1-0x0;var _0x4b1cff=_0x0147[_0xccdee1];return _0x4b1cff;};'use strict';var Sequelize=require('sequelize');module[_0x7014('0x0')]={'version':{'type':Sequelize[_0x7014('0x1')],'unique':_0x7014('0x2')}}; \ No newline at end of file +var _0xdb9a=['STRING','exports'];(function(_0x273987,_0x44056f){var _0x50ebc7=function(_0x4efbf0){while(--_0x4efbf0){_0x273987['push'](_0x273987['shift']());}};_0x50ebc7(++_0x44056f);}(_0xdb9a,0xd5));var _0xadb9=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xdb9a[_0x432682];return _0x463d05;};'use strict';var Sequelize=require('sequelize');module[_0xadb9('0x0')]={'version':{'type':Sequelize[_0xadb9('0x1')],'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 070a496..f284d3c 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 _0xbd80=['order','sort','where','filter','merge','type','VIRTUAL','options','Migration','includeAll','findAll','rows','catch','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','then','name','send','index','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x3b6652,_0x32486d){var _0x14d39f=function(_0x3a595a){while(--_0x3a595a){_0x3b6652['push'](_0x3b6652['shift']());}};_0x14d39f(++_0x32486d);}(_0xbd80,0x91));var _0x0bd8=function(_0x4f2f58,_0x242a68){_0x4f2f58=_0x4f2f58-0x0;var _0xeef339=_0xbd80[_0x4f2f58];return _0xeef339;};'use strict';var emlformat=require(_0x0bd8('0x0'));var rimraf=require(_0x0bd8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0bd8('0x2'));var rp=require(_0x0bd8('0x3'));var moment=require(_0x0bd8('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0bd8('0x5'));var path=require(_0x0bd8('0x6'));var sox=require(_0x0bd8('0x7'));var csv=require('to-csv');var ejs=require(_0x0bd8('0x8'));var fs=require('fs');var fs_extra=require(_0x0bd8('0x9'));var _=require(_0x0bd8('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0bd8('0xb'));var deskjs=require(_0x0bd8('0xc'));var toCsv=require(_0x0bd8('0xd'));var querystring=require(_0x0bd8('0xe'));var Papa=require(_0x0bd8('0xf'));var Redis=require(_0x0bd8('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0bd8('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0bd8('0x12'))(_0x0bd8('0x13'));var utils=require(_0x0bd8('0x14'));var config=require(_0x0bd8('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x0bd8('0x16'))['db'];function respondWithStatusCode(_0x52e34b,_0x256839){_0x256839=_0x256839||0xcc;return function(_0x44b1d9){if(_0x44b1d9){return _0x52e34b[_0x0bd8('0x17')](_0x256839);}return _0x52e34b[_0x0bd8('0x18')](_0x256839)[_0x0bd8('0x19')]();};}function respondWithResult(_0x4246e2,_0x5e380e){_0x5e380e=_0x5e380e||0xc8;return function(_0x33bdb7){if(_0x33bdb7){return _0x4246e2[_0x0bd8('0x18')](_0x5e380e)[_0x0bd8('0x1a')](_0x33bdb7);}};}function respondWithFilteredResult(_0xcea907,_0x7d6523){return function(_0x43cd15){if(_0x43cd15){var _0x5988bd=typeof _0x7d6523['offset']===_0x0bd8('0x1b')&&typeof _0x7d6523['limit']==='undefined';var _0x3ceaff=_0x43cd15[_0x0bd8('0x1c')];var _0x45dc8d=_0x5988bd?0x0:_0x7d6523[_0x0bd8('0x1d')];var _0x98613d=_0x5988bd?_0x43cd15[_0x0bd8('0x1c')]:_0x7d6523[_0x0bd8('0x1d')]+_0x7d6523[_0x0bd8('0x1e')];var _0x5e66be;if(_0x98613d>=_0x3ceaff){_0x98613d=_0x3ceaff;_0x5e66be=0xc8;}else{_0x5e66be=0xce;}_0xcea907[_0x0bd8('0x18')](_0x5e66be);return _0xcea907[_0x0bd8('0x1f')](_0x0bd8('0x20'),_0x45dc8d+'-'+_0x98613d+'/'+_0x3ceaff)[_0x0bd8('0x1a')](_0x43cd15);}return null;};}function patchUpdates(_0x397761){return function(_0x44baa5){try{jsonpatch[_0x0bd8('0x21')](_0x44baa5,_0x397761,!![]);}catch(_0x2a0c04){return BPromise[_0x0bd8('0x22')](_0x2a0c04);}return _0x44baa5[_0x0bd8('0x23')]();};}function saveUpdates(_0x7656f7,_0x2df214){return function(_0x15888a){if(_0x15888a){return _0x15888a['update'](_0x7656f7)[_0x0bd8('0x24')](function(_0x41d894){return _0x41d894;});}return null;};}function removeEntity(_0x2f8a1c,_0x1219e1){return function(_0x58110e){if(_0x58110e){return _0x58110e['destroy']()[_0x0bd8('0x24')](function(){_0x2f8a1c[_0x0bd8('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21cef2,_0x4676a4){return function(_0x517737){if(!_0x517737){_0x21cef2[_0x0bd8('0x17')](0x194);}return _0x517737;};}function handleError(_0x481521,_0x4ddabb){_0x4ddabb=_0x4ddabb||0x1f4;return function(_0x1c9b2a){logger['error'](_0x1c9b2a['stack']);if(_0x1c9b2a[_0x0bd8('0x25')]){delete _0x1c9b2a[_0x0bd8('0x25')];}_0x481521['status'](_0x4ddabb)[_0x0bd8('0x26')](_0x1c9b2a);};}exports[_0x0bd8('0x27')]=function(_0x319408,_0x5290c8){var _0x45a26b={},_0x52554b={},_0x571201={'count':0x0,'rows':[]};var _0x249f73=_['map'](db['Migration'][_0x0bd8('0x28')],function(_0x44d706){return{'name':_0x44d706[_0x0bd8('0x29')],'type':_0x44d706['type'][_0x0bd8('0x2a')]};});_0x52554b[_0x0bd8('0x2b')]=_['map'](_0x249f73,'name');_0x52554b[_0x0bd8('0x2c')]=_[_0x0bd8('0x2d')](_0x319408[_0x0bd8('0x2c')]);_0x52554b[_0x0bd8('0x2e')]=_[_0x0bd8('0x2f')](_0x52554b[_0x0bd8('0x2b')],_0x52554b['query']);_0x45a26b[_0x0bd8('0x30')]=_[_0x0bd8('0x2f')](_0x52554b[_0x0bd8('0x2b')],qs[_0x0bd8('0x31')](_0x319408[_0x0bd8('0x2c')][_0x0bd8('0x31')]));_0x45a26b[_0x0bd8('0x30')]=_0x45a26b[_0x0bd8('0x30')][_0x0bd8('0x32')]?_0x45a26b[_0x0bd8('0x30')]:_0x52554b[_0x0bd8('0x2b')];if(!_0x319408['query'][_0x0bd8('0x33')](_0x0bd8('0x34'))){_0x45a26b[_0x0bd8('0x1e')]=qs['limit'](_0x319408[_0x0bd8('0x2c')][_0x0bd8('0x1e')]);_0x45a26b[_0x0bd8('0x1d')]=qs[_0x0bd8('0x1d')](_0x319408[_0x0bd8('0x2c')][_0x0bd8('0x1d')]);}_0x45a26b[_0x0bd8('0x35')]=qs[_0x0bd8('0x36')](_0x319408[_0x0bd8('0x2c')][_0x0bd8('0x36')]);_0x45a26b[_0x0bd8('0x37')]=qs[_0x0bd8('0x2e')](_['pick'](_0x319408[_0x0bd8('0x2c')],_0x52554b[_0x0bd8('0x2e')]),_0x249f73);if(_0x319408['query'][_0x0bd8('0x38')]){_0x45a26b[_0x0bd8('0x37')]=_[_0x0bd8('0x39')](_0x45a26b['where'],{'$or':_['map'](_0x249f73,function(_0x553745){if(_0x553745[_0x0bd8('0x3a')]!==_0x0bd8('0x3b')){var _0x1361cd={};_0x1361cd[_0x553745[_0x0bd8('0x25')]]={'$like':'%'+_0x319408[_0x0bd8('0x2c')][_0x0bd8('0x38')]+'%'};return _0x1361cd;}})});}_0x45a26b=_[_0x0bd8('0x39')]({},_0x45a26b,_0x319408[_0x0bd8('0x3c')]);var _0x1ad206={'where':_0x45a26b[_0x0bd8('0x37')]};return db[_0x0bd8('0x3d')][_0x0bd8('0x1c')](_0x1ad206)[_0x0bd8('0x24')](function(_0x3ff28c){_0x571201['count']=_0x3ff28c;if(_0x319408[_0x0bd8('0x2c')][_0x0bd8('0x3e')]){_0x45a26b['include']=[{'all':!![]}];}return db[_0x0bd8('0x3d')][_0x0bd8('0x3f')](_0x45a26b);})[_0x0bd8('0x24')](function(_0x3be728){_0x571201[_0x0bd8('0x40')]=_0x3be728;return _0x571201;})[_0x0bd8('0x24')](respondWithFilteredResult(_0x5290c8,_0x45a26b))[_0x0bd8('0x41')](handleError(_0x5290c8,null));}; \ No newline at end of file +var _0xef4b=['json','offset','undefined','limit','count','set','Content-Range','reject','destroy','then','end','sendStatus','error','stack','name','send','index','Migration','fieldName','key','model','map','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','options','includeAll','include','findAll','rows','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status'];(function(_0x25b3d5,_0x27e24f){var _0x1c8e46=function(_0x2947b1){while(--_0x2947b1){_0x25b3d5['push'](_0x25b3d5['shift']());}};_0x1c8e46(++_0x27e24f);}(_0xef4b,0x128));var _0xbef4=function(_0x58175c,_0x2d9373){_0x58175c=_0x58175c-0x0;var _0x55b88f=_0xef4b[_0x58175c];return _0x55b88f;};'use strict';var emlformat=require(_0xbef4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbef4('0x1'));var jsonpatch=require(_0xbef4('0x2'));var rp=require(_0xbef4('0x3'));var moment=require(_0xbef4('0x4'));var BPromise=require(_0xbef4('0x5'));var Mustache=require('mustache');var util=require(_0xbef4('0x6'));var path=require(_0xbef4('0x7'));var sox=require('sox');var csv=require(_0xbef4('0x8'));var ejs=require(_0xbef4('0x9'));var fs=require('fs');var fs_extra=require(_0xbef4('0xa'));var _=require(_0xbef4('0xb'));var squel=require(_0xbef4('0xc'));var crypto=require(_0xbef4('0xd'));var jsforce=require(_0xbef4('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xbef4('0x8'));var querystring=require(_0xbef4('0xf'));var Papa=require(_0xbef4('0x10'));var Redis=require(_0xbef4('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xbef4('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbef4('0x13'))('api');var utils=require(_0xbef4('0x14'));var config=require(_0xbef4('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xbef4('0x16'))['db'];function respondWithStatusCode(_0x238a06,_0x197871){_0x197871=_0x197871||0xcc;return function(_0x4080bb){if(_0x4080bb){return _0x238a06['sendStatus'](_0x197871);}return _0x238a06[_0xbef4('0x17')](_0x197871)['end']();};}function respondWithResult(_0x24056e,_0x1f4c16){_0x1f4c16=_0x1f4c16||0xc8;return function(_0x1493e7){if(_0x1493e7){return _0x24056e[_0xbef4('0x17')](_0x1f4c16)[_0xbef4('0x18')](_0x1493e7);}};}function respondWithFilteredResult(_0x48f6d8,_0x2185de){return function(_0x4bbeaa){if(_0x4bbeaa){var _0x18c9b4=typeof _0x2185de[_0xbef4('0x19')]===_0xbef4('0x1a')&&typeof _0x2185de[_0xbef4('0x1b')]===_0xbef4('0x1a');var _0x5cad66=_0x4bbeaa[_0xbef4('0x1c')];var _0x4d8147=_0x18c9b4?0x0:_0x2185de['offset'];var _0x22fe60=_0x18c9b4?_0x4bbeaa[_0xbef4('0x1c')]:_0x2185de[_0xbef4('0x19')]+_0x2185de['limit'];var _0x1a2062;if(_0x22fe60>=_0x5cad66){_0x22fe60=_0x5cad66;_0x1a2062=0xc8;}else{_0x1a2062=0xce;}_0x48f6d8[_0xbef4('0x17')](_0x1a2062);return _0x48f6d8[_0xbef4('0x1d')](_0xbef4('0x1e'),_0x4d8147+'-'+_0x22fe60+'/'+_0x5cad66)['json'](_0x4bbeaa);}return null;};}function patchUpdates(_0x534abd){return function(_0x5441c7){try{jsonpatch['apply'](_0x5441c7,_0x534abd,!![]);}catch(_0x961009){return BPromise[_0xbef4('0x1f')](_0x961009);}return _0x5441c7['save']();};}function saveUpdates(_0x15c04c,_0xff1253){return function(_0x778368){if(_0x778368){return _0x778368['update'](_0x15c04c)['then'](function(_0x2361dd){return _0x2361dd;});}return null;};}function removeEntity(_0x3eaa91,_0xfd9bd5){return function(_0x630649){if(_0x630649){return _0x630649[_0xbef4('0x20')]()[_0xbef4('0x21')](function(){_0x3eaa91[_0xbef4('0x17')](0xcc)[_0xbef4('0x22')]();});}};}function handleEntityNotFound(_0x24e917,_0x1320c2){return function(_0x4daaa1){if(!_0x4daaa1){_0x24e917[_0xbef4('0x23')](0x194);}return _0x4daaa1;};}function handleError(_0x5216ac,_0x48603d){_0x48603d=_0x48603d||0x1f4;return function(_0x4ebbae){logger[_0xbef4('0x24')](_0x4ebbae[_0xbef4('0x25')]);if(_0x4ebbae[_0xbef4('0x26')]){delete _0x4ebbae[_0xbef4('0x26')];}_0x5216ac[_0xbef4('0x17')](_0x48603d)[_0xbef4('0x27')](_0x4ebbae);};}exports[_0xbef4('0x28')]=function(_0x57357d,_0x335828){var _0x32dd7a={},_0x2353a9={},_0xebbbff={'count':0x0,'rows':[]};var _0x366775=_['map'](db[_0xbef4('0x29')]['rawAttributes'],function(_0x2b8ed7){return{'name':_0x2b8ed7[_0xbef4('0x2a')],'type':_0x2b8ed7['type'][_0xbef4('0x2b')]};});_0x2353a9[_0xbef4('0x2c')]=_[_0xbef4('0x2d')](_0x366775,_0xbef4('0x26'));_0x2353a9[_0xbef4('0x2e')]=_['keys'](_0x57357d[_0xbef4('0x2e')]);_0x2353a9[_0xbef4('0x2f')]=_[_0xbef4('0x30')](_0x2353a9[_0xbef4('0x2c')],_0x2353a9[_0xbef4('0x2e')]);_0x32dd7a['attributes']=_[_0xbef4('0x30')](_0x2353a9[_0xbef4('0x2c')],qs[_0xbef4('0x31')](_0x57357d[_0xbef4('0x2e')][_0xbef4('0x31')]));_0x32dd7a['attributes']=_0x32dd7a[_0xbef4('0x32')]['length']?_0x32dd7a[_0xbef4('0x32')]:_0x2353a9['model'];if(!_0x57357d[_0xbef4('0x2e')][_0xbef4('0x33')](_0xbef4('0x34'))){_0x32dd7a[_0xbef4('0x1b')]=qs[_0xbef4('0x1b')](_0x57357d[_0xbef4('0x2e')][_0xbef4('0x1b')]);_0x32dd7a[_0xbef4('0x19')]=qs[_0xbef4('0x19')](_0x57357d[_0xbef4('0x2e')][_0xbef4('0x19')]);}_0x32dd7a[_0xbef4('0x35')]=qs[_0xbef4('0x36')](_0x57357d[_0xbef4('0x2e')][_0xbef4('0x36')]);_0x32dd7a[_0xbef4('0x37')]=qs[_0xbef4('0x2f')](_['pick'](_0x57357d[_0xbef4('0x2e')],_0x2353a9[_0xbef4('0x2f')]),_0x366775);if(_0x57357d[_0xbef4('0x2e')][_0xbef4('0x38')]){_0x32dd7a['where']=_[_0xbef4('0x39')](_0x32dd7a['where'],{'$or':_['map'](_0x366775,function(_0x32b54b){if(_0x32b54b[_0xbef4('0x3a')]!=='VIRTUAL'){var _0x3081f1={};_0x3081f1[_0x32b54b[_0xbef4('0x26')]]={'$like':'%'+_0x57357d[_0xbef4('0x2e')][_0xbef4('0x38')]+'%'};return _0x3081f1;}})});}_0x32dd7a=_['merge']({},_0x32dd7a,_0x57357d[_0xbef4('0x3b')]);var _0x55ec6b={'where':_0x32dd7a[_0xbef4('0x37')]};return db[_0xbef4('0x29')][_0xbef4('0x1c')](_0x55ec6b)[_0xbef4('0x21')](function(_0x28a076){_0xebbbff[_0xbef4('0x1c')]=_0x28a076;if(_0x57357d[_0xbef4('0x2e')][_0xbef4('0x3c')]){_0x32dd7a[_0xbef4('0x3d')]=[{'all':!![]}];}return db['Migration'][_0xbef4('0x3e')](_0x32dd7a);})[_0xbef4('0x21')](function(_0x10bb7b){_0xebbbff[_0xbef4('0x3f')]=_0x10bb7b;return _0xebbbff;})['then'](respondWithFilteredResult(_0x335828,_0x32dd7a))['catch'](handleError(_0x335828,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 1215031..fd5e91f 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 _0x0d0b=['api','moment','bluebird','request-promise','path','rimraf','./migration.attributes','exports','Migration','lodash','util','../../config/logger'];(function(_0x4ea12d,_0x34f852){var _0x44c52a=function(_0x2b0764){while(--_0x2b0764){_0x4ea12d['push'](_0x4ea12d['shift']());}};_0x44c52a(++_0x34f852);}(_0x0d0b,0x1dd));var _0xb0d0=function(_0xc0638b,_0x2fccf4){_0xc0638b=_0xc0638b-0x0;var _0xd57dfa=_0x0d0b[_0xc0638b];return _0xd57dfa;};'use strict';var _=require(_0xb0d0('0x0'));var util=require(_0xb0d0('0x1'));var logger=require(_0xb0d0('0x2'))(_0xb0d0('0x3'));var moment=require(_0xb0d0('0x4'));var BPromise=require(_0xb0d0('0x5'));var rp=require(_0xb0d0('0x6'));var fs=require('fs');var path=require(_0xb0d0('0x7'));var rimraf=require(_0xb0d0('0x8'));var config=require('../../config/environment');var attributes=require(_0xb0d0('0x9'));module[_0xb0d0('0xa')]=function(_0x537e09,_0xd1aad9){return _0x537e09['define'](_0xb0d0('0xb'),attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8193=['migrations','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./migration.attributes','exports','define','Migration'];(function(_0x1de31e,_0x4a621a){var _0x736a92=function(_0x2be291){while(--_0x2be291){_0x1de31e['push'](_0x1de31e['shift']());}};_0x736a92(++_0x4a621a);}(_0x8193,0x1a5));var _0x3819=function(_0x2f24d0,_0x12efce){_0x2f24d0=_0x2f24d0-0x0;var _0x2f89fe=_0x8193[_0x2f24d0];return _0x2f89fe;};'use strict';var _=require(_0x3819('0x0'));var util=require('util');var logger=require(_0x3819('0x1'))('api');var moment=require(_0x3819('0x2'));var BPromise=require(_0x3819('0x3'));var rp=require(_0x3819('0x4'));var fs=require('fs');var path=require(_0x3819('0x5'));var rimraf=require('rimraf');var config=require(_0x3819('0x6'));var attributes=require(_0x3819('0x7'));module[_0x3819('0x8')]=function(_0xa2f9eb,_0x454c2f){return _0xa2f9eb[_0x3819('0x9')](_0x3819('0xa'),attributes,{'tableName':_0x3819('0xb'),'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 88e1435..7775580 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 _0xad95=['Migration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util','moment','ioredis','../../mysqldb','rpc','then'];(function(_0x3d006e,_0x5e7af2){var _0x19b490=function(_0xc0316d){while(--_0xc0316d){_0x3d006e['push'](_0x3d006e['shift']());}};_0x19b490(++_0x5e7af2);}(_0xad95,0x70));var _0x5ad9=function(_0x236602,_0x579904){_0x236602=_0x236602-0x0;var _0x479a10=_0xad95[_0x236602];return _0x479a10;};'use strict';var _=require(_0x5ad9('0x0'));var util=require(_0x5ad9('0x1'));var moment=require(_0x5ad9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5ad9('0x3'));var db=require(_0x5ad9('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5ad9('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2bef4e,_0x117fde,_0x2a0915){return new BPromise(function(_0x3d937a,_0x404b33){return client['request'](_0x2bef4e,_0x2a0915)[_0x5ad9('0x6')](function(_0x4fdb7b){logger['info'](_0x5ad9('0x7'),_0x117fde,_0x5ad9('0x8'));logger[_0x5ad9('0x9')]('Migration,\x20%s,\x20%s,\x20%s',_0x117fde,_0x5ad9('0x8'),JSON[_0x5ad9('0xa')](_0x4fdb7b));if(_0x4fdb7b['error']){if(_0x4fdb7b[_0x5ad9('0xb')][_0x5ad9('0xc')]===0x1f4){logger[_0x5ad9('0xb')](_0x5ad9('0x7'),_0x117fde,_0x4fdb7b[_0x5ad9('0xb')][_0x5ad9('0xd')]);return _0x404b33(_0x4fdb7b['error']['message']);}logger['error'](_0x5ad9('0x7'),_0x117fde,_0x4fdb7b[_0x5ad9('0xb')]['message']);return _0x3d937a(_0x4fdb7b[_0x5ad9('0xb')][_0x5ad9('0xd')]);}else{logger[_0x5ad9('0xe')](_0x5ad9('0x7'),_0x117fde,_0x5ad9('0x8'));_0x3d937a(_0x4fdb7b[_0x5ad9('0xf')][_0x5ad9('0xd')]);}})[_0x5ad9('0x10')](function(_0x36e61f){logger[_0x5ad9('0xb')]('Migration,\x20%s,\x20%s',_0x117fde,_0x36e61f);_0x404b33(_0x36e61f);});});} \ No newline at end of file +var _0x05b0=['client','http','request','then','Migration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x05b0,0x188));var _0x005b=function(_0x2190fa,_0x4dce91){_0x2190fa=_0x2190fa-0x0;var _0x14c737=_0x05b0[_0x2190fa];return _0x14c737;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x005b('0x0'));var BPromise=require(_0x005b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x005b('0x2'));var db=require(_0x005b('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x005b('0x4'))(_0x005b('0x5'));var config=require('../../config/environment');var jayson=require(_0x005b('0x6'));var client=jayson[_0x005b('0x7')][_0x005b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x98e71c,_0x224c8d,_0x35998d){return new BPromise(function(_0x263bc9,_0x5cff7f){return client[_0x005b('0x9')](_0x98e71c,_0x35998d)[_0x005b('0xa')](function(_0x4c5552){logger['info'](_0x005b('0xb'),_0x224c8d,'request\x20sent');logger['debug']('Migration,\x20%s,\x20%s,\x20%s',_0x224c8d,_0x005b('0xc'),JSON[_0x005b('0xd')](_0x4c5552));if(_0x4c5552['error']){if(_0x4c5552[_0x005b('0xe')][_0x005b('0xf')]===0x1f4){logger[_0x005b('0xe')](_0x005b('0xb'),_0x224c8d,_0x4c5552[_0x005b('0xe')][_0x005b('0x10')]);return _0x5cff7f(_0x4c5552[_0x005b('0xe')]['message']);}logger['error']('Migration,\x20%s,\x20%s',_0x224c8d,_0x4c5552[_0x005b('0xe')]['message']);return _0x263bc9(_0x4c5552[_0x005b('0xe')]['message']);}else{logger[_0x005b('0x11')](_0x005b('0xb'),_0x224c8d,_0x005b('0xc'));_0x263bc9(_0x4c5552[_0x005b('0x12')][_0x005b('0x10')]);}})['catch'](function(_0xa3c3fb){logger[_0x005b('0xe')](_0x005b('0xb'),_0x224c8d,_0xa3c3fb);_0x5cff7f(_0xa3c3fb);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index a30c10d..ecd11d1 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 _0x151b=['express','Router','../../components/auth/service','../../config/environment','./network.controller','get','index','isAuthenticated','show','create','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x3e8a19,_0x572414){var _0x2bf66a=function(_0x1b645c){while(--_0x1b645c){_0x3e8a19['push'](_0x3e8a19['shift']());}};_0x2bf66a(++_0x572414);}(_0x151b,0x152));var _0xb151=function(_0x221a26,_0x277660){_0x221a26=_0x221a26-0x0;var _0x3d8a35=_0x151b[_0x221a26];return _0x3d8a35;};'use strict';var multer=require(_0xb151('0x0'));var util=require(_0xb151('0x1'));var path=require(_0xb151('0x2'));var timeout=require(_0xb151('0x3'));var express=require(_0xb151('0x4'));var router=express[_0xb151('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb151('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb151('0x7'));var controller=require(_0xb151('0x8'));router[_0xb151('0x9')]('/',auth['isAuthenticated'](),controller[_0xb151('0xa')]);router[_0xb151('0x9')]('/:id',auth[_0xb151('0xb')](),controller[_0xb151('0xc')]);router['post']('/',auth[_0xb151('0xb')](),controller[_0xb151('0xd')]);router['put'](_0xb151('0xe'),auth[_0xb151('0xb')](),controller[_0xb151('0xf')]);router[_0xb151('0x10')](_0xb151('0xe'),auth['isAuthenticated'](),controller[_0xb151('0x11')]);module[_0xb151('0x12')]=router; \ No newline at end of file +var _0x377e=['../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service'];(function(_0x34e215,_0x4ce0ba){var _0x3a5e14=function(_0x2de89d){while(--_0x2de89d){_0x34e215['push'](_0x34e215['shift']());}};_0x3a5e14(++_0x4ce0ba);}(_0x377e,0x1e9));var _0xe377=function(_0x5125a2,_0x169e4c){_0x5125a2=_0x5125a2-0x0;var _0x5a8e93=_0x377e[_0x5125a2];return _0x5a8e93;};'use strict';var multer=require(_0xe377('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe377('0x1'));var router=express[_0xe377('0x2')]();var fs_extra=require(_0xe377('0x3'));var auth=require(_0xe377('0x4'));var interaction=require(_0xe377('0x5'));var config=require(_0xe377('0x6'));var controller=require(_0xe377('0x7'));router[_0xe377('0x8')]('/',auth[_0xe377('0x9')](),controller[_0xe377('0xa')]);router['get'](_0xe377('0xb'),auth['isAuthenticated'](),controller[_0xe377('0xc')]);router[_0xe377('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe377('0xe')]('/:id',auth[_0xe377('0x9')](),controller[_0xe377('0xf')]);router[_0xe377('0x10')]('/:id',auth[_0xe377('0x9')](),controller[_0xe377('0x11')]);module[_0xe377('0x12')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 586efc5..a04e724 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 _0x007b=['externip','STRING','ENUM','localnet'];(function(_0x297eea,_0x5060be){var _0x1c42d2=function(_0x3afff4){while(--_0x3afff4){_0x297eea['push'](_0x297eea['shift']());}};_0x1c42d2(++_0x5060be);}(_0x007b,0xa6));var _0xb007=function(_0x2837b9,_0x37115e){_0x2837b9=_0x2837b9-0x0;var _0x565791=_0x007b[_0x2837b9];return _0x565791;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xb007('0x0')](_0xb007('0x1'),_0xb007('0x2'),'stun','turn')},'value':{'type':Sequelize[_0xb007('0x3')]},'username':{'type':Sequelize[_0xb007('0x3')]},'password':{'type':Sequelize[_0xb007('0x3')]}}; \ No newline at end of file +var _0x3212=['stun','turn','STRING','sequelize','exports','localnet','externip'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x3212,0x192));var _0x2321=function(_0x4687b8,_0x3468b3){_0x4687b8=_0x4687b8-0x0;var _0x7e664=_0x3212[_0x4687b8];return _0x7e664;};'use strict';var Sequelize=require(_0x2321('0x0'));module[_0x2321('0x1')]={'type':{'type':Sequelize['ENUM'](_0x2321('0x2'),_0x2321('0x3'),_0x2321('0x4'),_0x2321('0x5'))},'value':{'type':Sequelize[_0x2321('0x6')]},'username':{'type':Sequelize[_0x2321('0x6')]},'password':{'type':Sequelize[_0x2321('0x6')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 9d18f42..fdc11e9 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 _0x0046=['attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','merge','type','VIRTUAL','filter','options','findAll','catch','show','includeAll','include','find','create','transaction','body','STUN','readFileSync','root','server/files/templates/stun_multiple.ejs','utf8','writeFileSync','Reload','res_stun_monitor.so','TURN','join','server/files/templates/turn_multiple.ejs','render','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','toLowerCase','chan_sip.so','update','sequelize','params','toUpperCase','/etc/asterisk/sip_xcally_%s.conf','destroy','/etc/asterisk/stun_xcally.conf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','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/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','sendStatus','status','offset','undefined','count','limit','reject','save','end','stack','name','index','Network','rawAttributes','fieldName','key','model','query','keys','intersection'];(function(_0x52b4a1,_0x541b98){var _0x4e3a9a=function(_0x56e28e){while(--_0x56e28e){_0x52b4a1['push'](_0x52b4a1['shift']());}};_0x4e3a9a(++_0x541b98);}(_0x0046,0x1c9));var _0x6004=function(_0x104bb8,_0x28f41c){_0x104bb8=_0x104bb8-0x0;var _0x32030e=_0x0046[_0x104bb8];return _0x32030e;};'use strict';var emlformat=require(_0x6004('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6004('0x1'));var jsonpatch=require(_0x6004('0x2'));var rp=require(_0x6004('0x3'));var moment=require('moment');var BPromise=require(_0x6004('0x4'));var Mustache=require('mustache');var util=require(_0x6004('0x5'));var path=require(_0x6004('0x6'));var sox=require(_0x6004('0x7'));var csv=require(_0x6004('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6004('0x9'));var _=require(_0x6004('0xa'));var squel=require(_0x6004('0xb'));var crypto=require(_0x6004('0xc'));var jsforce=require(_0x6004('0xd'));var deskjs=require(_0x6004('0xe'));var toCsv=require(_0x6004('0x8'));var querystring=require(_0x6004('0xf'));var Papa=require(_0x6004('0x10'));var Redis=require(_0x6004('0x11'));var authService=require(_0x6004('0x12'));var qs=require(_0x6004('0x13'));var as=require(_0x6004('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6004('0x15'))(_0x6004('0x16'));var utils=require(_0x6004('0x17'));var config=require(_0x6004('0x18'));var licenseUtil=require(_0x6004('0x19'));var db=require(_0x6004('0x1a'))['db'];var jayson=require(_0x6004('0x1b'));var client=jayson[_0x6004('0x1c')][_0x6004('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x5b86f4,_0x3df3dc,_0x4a19bd,_0x3b7756){return new BPromise(function(_0x4303cc,_0x2b3eca){var _0x3ec682=_0x3b7756||client;return _0x3ec682['request'](_0x5b86f4,_0x4a19bd)[_0x6004('0x1e')](function(_0x7be284){logger[_0x6004('0x1f')](_0x6004('0x20'),_0x3df3dc,_0x6004('0x21'));logger['debug']('Network,\x20%s,\x20%s,\x20%s',_0x3df3dc,_0x6004('0x21'),JSON[_0x6004('0x22')](_0x7be284));if(_0x7be284['error']){if(_0x7be284[_0x6004('0x23')][_0x6004('0x24')]===0x1f4){logger[_0x6004('0x23')]('Network,\x20%s,\x20%s',_0x3df3dc,_0x7be284[_0x6004('0x23')]['message']);return _0x2b3eca(_0x7be284[_0x6004('0x23')][_0x6004('0x25')]);}logger['error']('Network,\x20%s,\x20%s',_0x3df3dc,_0x7be284[_0x6004('0x23')][_0x6004('0x25')]);return _0x4303cc(_0x7be284['error'][_0x6004('0x25')]);}else{logger[_0x6004('0x1f')](_0x6004('0x20'),_0x3df3dc,'request\x20sent');_0x4303cc(_0x7be284['result'][_0x6004('0x25')]);}})['catch'](function(_0x5e7073){logger[_0x6004('0x23')](_0x6004('0x20'),_0x3df3dc,_0x5e7073);_0x2b3eca(_0x5e7073);});});}function respondWithStatusCode(_0x3e2caf,_0x22a153){_0x22a153=_0x22a153||0xcc;return function(_0x818ff8){if(_0x818ff8){return _0x3e2caf[_0x6004('0x26')](_0x22a153);}return _0x3e2caf[_0x6004('0x27')](_0x22a153)['end']();};}function respondWithResult(_0x3bd7c8,_0x124f83){_0x124f83=_0x124f83||0xc8;return function(_0x48ae0d){if(_0x48ae0d){return _0x3bd7c8[_0x6004('0x27')](_0x124f83)['json'](_0x48ae0d);}};}function respondWithFilteredResult(_0x2560fe,_0xe59b42){return function(_0x1dfd6f){if(_0x1dfd6f){var _0x65ea9a=typeof _0xe59b42[_0x6004('0x28')]===_0x6004('0x29')&&typeof _0xe59b42['limit']===_0x6004('0x29');var _0x1fdb15=_0x1dfd6f[_0x6004('0x2a')];var _0x304fed=_0x65ea9a?0x0:_0xe59b42[_0x6004('0x28')];var _0x46a5ab=_0x65ea9a?_0x1dfd6f[_0x6004('0x2a')]:_0xe59b42[_0x6004('0x28')]+_0xe59b42[_0x6004('0x2b')];var _0x272913;if(_0x46a5ab>=_0x1fdb15){_0x46a5ab=_0x1fdb15;_0x272913=0xc8;}else{_0x272913=0xce;}_0x2560fe[_0x6004('0x27')](_0x272913);return _0x2560fe['set']('Content-Range',_0x304fed+'-'+_0x46a5ab+'/'+_0x1fdb15)['json'](_0x1dfd6f);}return null;};}function patchUpdates(_0x251dad){return function(_0x4fcda9){try{jsonpatch['apply'](_0x4fcda9,_0x251dad,!![]);}catch(_0x15b0fc){return BPromise[_0x6004('0x2c')](_0x15b0fc);}return _0x4fcda9[_0x6004('0x2d')]();};}function saveUpdates(_0xb68214,_0x3856dd){return function(_0x3bf6e9){if(_0x3bf6e9){return _0x3bf6e9['update'](_0xb68214)[_0x6004('0x1e')](function(_0x320def){return _0x320def;});}return null;};}function removeEntity(_0x52d58b,_0x54ee63){return function(_0x1c0cff){if(_0x1c0cff){return _0x1c0cff['destroy']()[_0x6004('0x1e')](function(){_0x52d58b[_0x6004('0x27')](0xcc)[_0x6004('0x2e')]();});}};}function handleEntityNotFound(_0x780ae5,_0x2c3bf0){return function(_0x54a6d3){if(!_0x54a6d3){_0x780ae5[_0x6004('0x26')](0x194);}return _0x54a6d3;};}function handleError(_0x418f45,_0x2836ed){_0x2836ed=_0x2836ed||0x1f4;return function(_0x1c3c90){logger[_0x6004('0x23')](_0x1c3c90[_0x6004('0x2f')]);if(_0x1c3c90['name']){delete _0x1c3c90[_0x6004('0x30')];}_0x418f45['status'](_0x2836ed)['send'](_0x1c3c90);};}exports[_0x6004('0x31')]=function(_0x2496fa,_0x3bff7e){var _0x157551={},_0x2d1180={},_0xb13473={'count':0x0,'rows':[]};var _0x11390e=_['map'](db[_0x6004('0x32')][_0x6004('0x33')],function(_0x4b203e){return{'name':_0x4b203e[_0x6004('0x34')],'type':_0x4b203e['type'][_0x6004('0x35')]};});_0x2d1180[_0x6004('0x36')]=_['map'](_0x11390e,_0x6004('0x30'));_0x2d1180[_0x6004('0x37')]=_[_0x6004('0x38')](_0x2496fa['query']);_0x2d1180['filters']=_[_0x6004('0x39')](_0x2d1180[_0x6004('0x36')],_0x2d1180[_0x6004('0x37')]);_0x157551[_0x6004('0x3a')]=_[_0x6004('0x39')](_0x2d1180[_0x6004('0x36')],qs[_0x6004('0x3b')](_0x2496fa[_0x6004('0x37')]['fields']));_0x157551[_0x6004('0x3a')]=_0x157551[_0x6004('0x3a')][_0x6004('0x3c')]?_0x157551[_0x6004('0x3a')]:_0x2d1180['model'];if(!_0x2496fa[_0x6004('0x37')][_0x6004('0x3d')](_0x6004('0x3e'))){_0x157551[_0x6004('0x2b')]=qs[_0x6004('0x2b')](_0x2496fa[_0x6004('0x37')][_0x6004('0x2b')]);_0x157551[_0x6004('0x28')]=qs[_0x6004('0x28')](_0x2496fa['query']['offset']);}_0x157551['order']=qs[_0x6004('0x3f')](_0x2496fa['query']['sort']);_0x157551[_0x6004('0x40')]=qs[_0x6004('0x41')](_['pick'](_0x2496fa[_0x6004('0x37')],_0x2d1180['filters']),_0x11390e);if(_0x2496fa[_0x6004('0x37')]['filter']){_0x157551['where']=_[_0x6004('0x42')](_0x157551[_0x6004('0x40')],{'$or':_['map'](_0x11390e,function(_0x5de13c){if(_0x5de13c[_0x6004('0x43')]!==_0x6004('0x44')){var _0x5e9712={};_0x5e9712[_0x5de13c['name']]={'$like':'%'+_0x2496fa['query'][_0x6004('0x45')]+'%'};return _0x5e9712;}})});}_0x157551=_[_0x6004('0x42')]({},_0x157551,_0x2496fa[_0x6004('0x46')]);var _0x21dde6={'where':_0x157551[_0x6004('0x40')]};return db[_0x6004('0x32')]['count'](_0x21dde6)[_0x6004('0x1e')](function(_0x562402){_0xb13473[_0x6004('0x2a')]=_0x562402;if(_0x2496fa[_0x6004('0x37')]['includeAll']){_0x157551['include']=[{'all':!![]}];}return db[_0x6004('0x32')][_0x6004('0x47')](_0x157551);})[_0x6004('0x1e')](function(_0x338477){_0xb13473['rows']=_0x338477;return _0xb13473;})[_0x6004('0x1e')](respondWithFilteredResult(_0x3bff7e,_0x157551))[_0x6004('0x48')](handleError(_0x3bff7e,null));};exports[_0x6004('0x49')]=function(_0x125b9f,_0x4c07e7){var _0x1c5846={'raw':!![],'where':{'id':_0x125b9f['params']['id']}},_0xf6a988={};_0xf6a988[_0x6004('0x36')]=_[_0x6004('0x38')](db[_0x6004('0x32')][_0x6004('0x33')]);_0xf6a988['query']=_[_0x6004('0x38')](_0x125b9f[_0x6004('0x37')]);_0xf6a988[_0x6004('0x41')]=_[_0x6004('0x39')](_0xf6a988[_0x6004('0x36')],_0xf6a988[_0x6004('0x37')]);_0x1c5846[_0x6004('0x3a')]=_['intersection'](_0xf6a988[_0x6004('0x36')],qs[_0x6004('0x3b')](_0x125b9f[_0x6004('0x37')]['fields']));_0x1c5846[_0x6004('0x3a')]=_0x1c5846[_0x6004('0x3a')][_0x6004('0x3c')]?_0x1c5846['attributes']:_0xf6a988[_0x6004('0x36')];if(_0x125b9f[_0x6004('0x37')][_0x6004('0x4a')]){_0x1c5846[_0x6004('0x4b')]=[{'all':!![]}];}_0x1c5846=_[_0x6004('0x42')]({},_0x1c5846,_0x125b9f['options']);return db['Network'][_0x6004('0x4c')](_0x1c5846)[_0x6004('0x1e')](handleEntityNotFound(_0x4c07e7,null))[_0x6004('0x1e')](respondWithResult(_0x4c07e7,null))['catch'](handleError(_0x4c07e7,null));};exports[_0x6004('0x4d')]=function(_0x174bfc,_0x3accb9,_0x33c698){var _0x113a6c;return db['sequelize'][_0x6004('0x4e')](function(_0x4224b1){return db['Network']['create'](_0x174bfc[_0x6004('0x4f')],{'raw':!![]})[_0x6004('0x1e')](function(_0xc9c0d8){_0x113a6c=_0xc9c0d8;return db[_0x6004('0x32')][_0x6004('0x47')]({'where':{'type':_0x174bfc[_0x6004('0x4f')][_0x6004('0x43')]},'raw':!![]});})[_0x6004('0x1e')](function(_0x48753d){if(_0x113a6c[_0x6004('0x43')]['toUpperCase']()==_0x6004('0x50')){var _0x11a5e8=fs[_0x6004('0x51')](path['join'](config[_0x6004('0x52')],_0x6004('0x53')),_0x6004('0x54'));var _0x569dcf=ejs['render'](_0x11a5e8,{'networks':_0x48753d||[]});fs[_0x6004('0x55')]('/etc/asterisk/stun_xcally.conf',_0x569dcf);return respondWithRpcPromise(_0x6004('0x56'),_0x6004('0x4d'),{'module':_0x6004('0x57')});}else if(_0x113a6c[_0x6004('0x43')]['toUpperCase']()==_0x6004('0x58')){var _0x4841c9=fs[_0x6004('0x51')](path[_0x6004('0x59')](config[_0x6004('0x52')],_0x6004('0x5a')),_0x6004('0x54'));var _0x4df8bd=ejs[_0x6004('0x5b')](_0x4841c9,{'networks':_0x48753d||[]});fs[_0x6004('0x55')](_0x6004('0x5c'),_0x4df8bd);return respondWithRpcPromise('Reload',_0x6004('0x4d'),{'module':_0x6004('0x57')});}else{var _0x57b942=fs[_0x6004('0x51')](path[_0x6004('0x59')](config[_0x6004('0x52')],_0x6004('0x5d')),_0x6004('0x54'));var _0x87a9c3=ejs[_0x6004('0x5b')](_0x57b942,{'networks':_0x48753d||[]});fs[_0x6004('0x55')](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x174bfc[_0x6004('0x4f')][_0x6004('0x43')][_0x6004('0x5e')]()),_0x87a9c3);return respondWithRpcPromise('Reload',_0x6004('0x4d'),{'module':_0x6004('0x5f')});}return null;})[_0x6004('0x1e')](function(){return _0x113a6c;});})['then'](respondWithResult(_0x3accb9,0xc9))[_0x6004('0x48')](handleError(_0x3accb9,null));};exports[_0x6004('0x60')]=function(_0x4eadea,_0x43c84e,_0x3de407){var _0x43db2a;return db[_0x6004('0x61')][_0x6004('0x4e')](function(_0x38d186){return db[_0x6004('0x32')]['find']({'where':{'id':_0x4eadea[_0x6004('0x62')]['id']}})[_0x6004('0x1e')](handleEntityNotFound(_0x43c84e,null))[_0x6004('0x1e')](saveUpdates(_0x4eadea[_0x6004('0x4f')],null))[_0x6004('0x1e')](function(_0x581f94){if(_0x581f94){_0x43db2a=_0x581f94;return db[_0x6004('0x32')]['findAll']({'where':{'type':_0x43db2a[_0x6004('0x43')]},'raw':!![]});}return null;})['then'](function(_0xf4e33f){if(_0x43db2a[_0x6004('0x43')]['toUpperCase']()==_0x6004('0x50')){var _0x40d45b=fs[_0x6004('0x51')](path[_0x6004('0x59')](config['root'],_0x6004('0x53')),_0x6004('0x54'));var _0x43b2ed=ejs[_0x6004('0x5b')](_0x40d45b,{'networks':_0xf4e33f||[]});fs[_0x6004('0x55')]('/etc/asterisk/stun_xcally.conf',_0x43b2ed);return respondWithRpcPromise(_0x6004('0x56'),_0x6004('0x60'),{'module':_0x6004('0x57')});}else if(_0x43db2a['type'][_0x6004('0x63')]()==_0x6004('0x58')){var _0x250a17=fs[_0x6004('0x51')](path[_0x6004('0x59')](config[_0x6004('0x52')],_0x6004('0x5a')),_0x6004('0x54'));var _0xdb784=ejs[_0x6004('0x5b')](_0x250a17,{'networks':_0xf4e33f||[]});fs[_0x6004('0x55')](_0x6004('0x5c'),_0xdb784);return respondWithRpcPromise(_0x6004('0x56'),'update',{'module':_0x6004('0x57')});}else{var _0x2af06c=fs[_0x6004('0x51')](path['join'](config[_0x6004('0x52')],_0x6004('0x5d')),_0x6004('0x54'));var _0x514fbc=ejs[_0x6004('0x5b')](_0x2af06c,{'networks':_0xf4e33f||[]});fs['writeFileSync'](util['format'](_0x6004('0x64'),_0x4eadea['body'][_0x6004('0x43')][_0x6004('0x5e')]()),_0x514fbc);return respondWithRpcPromise(_0x6004('0x56'),'update',{'module':_0x6004('0x5f')});}return null;})[_0x6004('0x1e')](function(_0x1cdcfc){if(_0x1cdcfc){return _0x43db2a;}return null;});})['then'](respondWithResult(_0x43c84e,null))[_0x6004('0x48')](handleError(_0x43c84e,null));};exports[_0x6004('0x65')]=function(_0x3a9a94,_0x488ec7,_0xede06c){var _0x531f04;return db[_0x6004('0x32')][_0x6004('0x4c')]({'where':{'id':_0x3a9a94['params']['id']}})[_0x6004('0x1e')](function(_0x556b49){_0x531f04=_0x556b49;return _0x556b49;})[_0x6004('0x1e')](handleEntityNotFound(_0x488ec7,null))['then'](removeEntity(_0x488ec7,null))['then'](function(){if(_0x531f04){return db[_0x6004('0x32')][_0x6004('0x47')]({'where':{'type':_0x531f04[_0x6004('0x43')]},'raw':!![]});}})['then'](function(_0x1d45bc){if(_0x531f04['type'][_0x6004('0x63')]()=='STUN'){var _0x120bde=fs[_0x6004('0x51')](path[_0x6004('0x59')](config[_0x6004('0x52')],_0x6004('0x53')),_0x6004('0x54'));var _0x58d4a3=ejs['render'](_0x120bde,{'networks':_0x1d45bc||[]});fs[_0x6004('0x55')](_0x6004('0x66'),_0x58d4a3);return respondWithRpcPromise(_0x6004('0x56'),_0x6004('0x65'),{'module':_0x6004('0x57')});}else if(_0x531f04[_0x6004('0x43')][_0x6004('0x63')]()==_0x6004('0x58')){var _0x4364f9=fs[_0x6004('0x51')](path[_0x6004('0x59')](config[_0x6004('0x52')],_0x6004('0x5a')),'utf8');var _0x2ac5a1=ejs['render'](_0x4364f9,{'networks':_0x1d45bc||[]});fs['writeFileSync'](_0x6004('0x5c'),_0x2ac5a1);return respondWithRpcPromise(_0x6004('0x56'),_0x6004('0x65'),{'module':'res_stun_monitor.so'});}else{var _0x3b8b1e=fs[_0x6004('0x51')](path['join'](config[_0x6004('0x52')],_0x6004('0x5d')),_0x6004('0x54'));var _0x4b246b=ejs[_0x6004('0x5b')](_0x3b8b1e,{'networks':_0x1d45bc||[]});fs[_0x6004('0x55')](util['format'](_0x6004('0x64'),_0x3a9a94['body'][_0x6004('0x43')][_0x6004('0x5e')]()),_0x4b246b);return respondWithRpcPromise(_0x6004('0x56'),'destroy',{'module':_0x6004('0x5f')});}return null;})[_0x6004('0x48')](handleError(_0x488ec7,null));}; \ No newline at end of file +var _0xb6bf=['reject','save','update','destroy','sendStatus','stack','name','index','map','Network','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','find','create','transaction','body','toUpperCase','STUN','join','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','res_stun_monitor.so','TURN','readFileSync','root','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','Reload','sequelize','params','/etc/asterisk/stun_xcally.conf','server/files/templates/network.ejs','chan_sip.so','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','end','json','offset','undefined','limit','count','status','apply'];(function(_0x442ec6,_0x14d4ca){var _0x59e939=function(_0x517b55){while(--_0x517b55){_0x442ec6['push'](_0x442ec6['shift']());}};_0x59e939(++_0x14d4ca);}(_0xb6bf,0xa9));var _0xfb6b=function(_0x4f7f13,_0x4dcd1f){_0x4f7f13=_0x4f7f13-0x0;var _0x1c04c4=_0xb6bf[_0x4f7f13];return _0x1c04c4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfb6b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfb6b('0x1'));var rp=require(_0xfb6b('0x2'));var moment=require('moment');var BPromise=require(_0xfb6b('0x3'));var Mustache=require(_0xfb6b('0x4'));var util=require(_0xfb6b('0x5'));var path=require(_0xfb6b('0x6'));var sox=require(_0xfb6b('0x7'));var csv=require(_0xfb6b('0x8'));var ejs=require(_0xfb6b('0x9'));var fs=require('fs');var fs_extra=require(_0xfb6b('0xa'));var _=require(_0xfb6b('0xb'));var squel=require('squel');var crypto=require(_0xfb6b('0xc'));var jsforce=require(_0xfb6b('0xd'));var deskjs=require(_0xfb6b('0xe'));var toCsv=require(_0xfb6b('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xfb6b('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xfb6b('0x10'));var as=require(_0xfb6b('0x11'));var hardwareService=require(_0xfb6b('0x12'));var logger=require(_0xfb6b('0x13'))(_0xfb6b('0x14'));var utils=require(_0xfb6b('0x15'));var config=require(_0xfb6b('0x16'));var licenseUtil=require(_0xfb6b('0x17'));var db=require(_0xfb6b('0x18'))['db'];var jayson=require(_0xfb6b('0x19'));var client=jayson[_0xfb6b('0x1a')][_0xfb6b('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x56a689,_0x17434c,_0x329456,_0x3c5ebf){return new BPromise(function(_0x5af9c6,_0x426b5f){var _0x27106d=_0x3c5ebf||client;return _0x27106d[_0xfb6b('0x1c')](_0x56a689,_0x329456)[_0xfb6b('0x1d')](function(_0x4fac0e){logger['info'](_0xfb6b('0x1e'),_0x17434c,_0xfb6b('0x1f'));logger[_0xfb6b('0x20')](_0xfb6b('0x21'),_0x17434c,_0xfb6b('0x1f'),JSON['stringify'](_0x4fac0e));if(_0x4fac0e['error']){if(_0x4fac0e[_0xfb6b('0x22')]['code']===0x1f4){logger[_0xfb6b('0x22')](_0xfb6b('0x1e'),_0x17434c,_0x4fac0e[_0xfb6b('0x22')]['message']);return _0x426b5f(_0x4fac0e['error']['message']);}logger[_0xfb6b('0x22')](_0xfb6b('0x1e'),_0x17434c,_0x4fac0e[_0xfb6b('0x22')][_0xfb6b('0x23')]);return _0x5af9c6(_0x4fac0e[_0xfb6b('0x22')][_0xfb6b('0x23')]);}else{logger[_0xfb6b('0x24')](_0xfb6b('0x1e'),_0x17434c,_0xfb6b('0x1f'));_0x5af9c6(_0x4fac0e[_0xfb6b('0x25')]['message']);}})[_0xfb6b('0x26')](function(_0x3bf0c7){logger[_0xfb6b('0x22')](_0xfb6b('0x1e'),_0x17434c,_0x3bf0c7);_0x426b5f(_0x3bf0c7);});});}function respondWithStatusCode(_0x110461,_0x40cd23){_0x40cd23=_0x40cd23||0xcc;return function(_0x2df0df){if(_0x2df0df){return _0x110461['sendStatus'](_0x40cd23);}return _0x110461['status'](_0x40cd23)[_0xfb6b('0x27')]();};}function respondWithResult(_0x28f23d,_0xdaeb7a){_0xdaeb7a=_0xdaeb7a||0xc8;return function(_0x581b87){if(_0x581b87){return _0x28f23d['status'](_0xdaeb7a)[_0xfb6b('0x28')](_0x581b87);}};}function respondWithFilteredResult(_0x3af3e5,_0x2e8532){return function(_0x34a06c){if(_0x34a06c){var _0x456cea=typeof _0x2e8532[_0xfb6b('0x29')]===_0xfb6b('0x2a')&&typeof _0x2e8532[_0xfb6b('0x2b')]==='undefined';var _0x17fae9=_0x34a06c[_0xfb6b('0x2c')];var _0xafa281=_0x456cea?0x0:_0x2e8532['offset'];var _0x2b05e2=_0x456cea?_0x34a06c[_0xfb6b('0x2c')]:_0x2e8532[_0xfb6b('0x29')]+_0x2e8532['limit'];var _0x4f1b51;if(_0x2b05e2>=_0x17fae9){_0x2b05e2=_0x17fae9;_0x4f1b51=0xc8;}else{_0x4f1b51=0xce;}_0x3af3e5[_0xfb6b('0x2d')](_0x4f1b51);return _0x3af3e5['set']('Content-Range',_0xafa281+'-'+_0x2b05e2+'/'+_0x17fae9)[_0xfb6b('0x28')](_0x34a06c);}return null;};}function patchUpdates(_0x294688){return function(_0x33ee7c){try{jsonpatch[_0xfb6b('0x2e')](_0x33ee7c,_0x294688,!![]);}catch(_0x30594f){return BPromise[_0xfb6b('0x2f')](_0x30594f);}return _0x33ee7c[_0xfb6b('0x30')]();};}function saveUpdates(_0x55af6d,_0x240faf){return function(_0x26bde7){if(_0x26bde7){return _0x26bde7[_0xfb6b('0x31')](_0x55af6d)[_0xfb6b('0x1d')](function(_0x4ddbda){return _0x4ddbda;});}return null;};}function removeEntity(_0x8c6b4c,_0x48617f){return function(_0x1b7b1e){if(_0x1b7b1e){return _0x1b7b1e[_0xfb6b('0x32')]()[_0xfb6b('0x1d')](function(){_0x8c6b4c['status'](0xcc)[_0xfb6b('0x27')]();});}};}function handleEntityNotFound(_0x2a22fa,_0x2d152c){return function(_0x331280){if(!_0x331280){_0x2a22fa[_0xfb6b('0x33')](0x194);}return _0x331280;};}function handleError(_0x4403a0,_0x37a430){_0x37a430=_0x37a430||0x1f4;return function(_0x166d35){logger[_0xfb6b('0x22')](_0x166d35[_0xfb6b('0x34')]);if(_0x166d35['name']){delete _0x166d35[_0xfb6b('0x35')];}_0x4403a0['status'](_0x37a430)['send'](_0x166d35);};}exports[_0xfb6b('0x36')]=function(_0xb2daed,_0x342265){var _0x3dad36={},_0x2969c1={},_0x2b9aae={'count':0x0,'rows':[]};var _0xf4e555=_[_0xfb6b('0x37')](db[_0xfb6b('0x38')][_0xfb6b('0x39')],function(_0x3841d8){return{'name':_0x3841d8[_0xfb6b('0x3a')],'type':_0x3841d8[_0xfb6b('0x3b')][_0xfb6b('0x3c')]};});_0x2969c1[_0xfb6b('0x3d')]=_[_0xfb6b('0x37')](_0xf4e555,_0xfb6b('0x35'));_0x2969c1[_0xfb6b('0x3e')]=_[_0xfb6b('0x3f')](_0xb2daed[_0xfb6b('0x3e')]);_0x2969c1[_0xfb6b('0x40')]=_['intersection'](_0x2969c1[_0xfb6b('0x3d')],_0x2969c1[_0xfb6b('0x3e')]);_0x3dad36[_0xfb6b('0x41')]=_[_0xfb6b('0x42')](_0x2969c1[_0xfb6b('0x3d')],qs[_0xfb6b('0x43')](_0xb2daed['query'][_0xfb6b('0x43')]));_0x3dad36[_0xfb6b('0x41')]=_0x3dad36['attributes'][_0xfb6b('0x44')]?_0x3dad36[_0xfb6b('0x41')]:_0x2969c1[_0xfb6b('0x3d')];if(!_0xb2daed[_0xfb6b('0x3e')][_0xfb6b('0x45')](_0xfb6b('0x46'))){_0x3dad36[_0xfb6b('0x2b')]=qs[_0xfb6b('0x2b')](_0xb2daed[_0xfb6b('0x3e')][_0xfb6b('0x2b')]);_0x3dad36[_0xfb6b('0x29')]=qs[_0xfb6b('0x29')](_0xb2daed[_0xfb6b('0x3e')][_0xfb6b('0x29')]);}_0x3dad36['order']=qs['sort'](_0xb2daed['query'][_0xfb6b('0x47')]);_0x3dad36['where']=qs[_0xfb6b('0x40')](_['pick'](_0xb2daed[_0xfb6b('0x3e')],_0x2969c1[_0xfb6b('0x40')]),_0xf4e555);if(_0xb2daed[_0xfb6b('0x3e')]['filter']){_0x3dad36[_0xfb6b('0x48')]=_['merge'](_0x3dad36[_0xfb6b('0x48')],{'$or':_['map'](_0xf4e555,function(_0x3d99bb){if(_0x3d99bb[_0xfb6b('0x3b')]!==_0xfb6b('0x49')){var _0x57b565={};_0x57b565[_0x3d99bb[_0xfb6b('0x35')]]={'$like':'%'+_0xb2daed[_0xfb6b('0x3e')][_0xfb6b('0x4a')]+'%'};return _0x57b565;}})});}_0x3dad36=_[_0xfb6b('0x4b')]({},_0x3dad36,_0xb2daed[_0xfb6b('0x4c')]);var _0x2a8d8c={'where':_0x3dad36[_0xfb6b('0x48')]};return db[_0xfb6b('0x38')][_0xfb6b('0x2c')](_0x2a8d8c)[_0xfb6b('0x1d')](function(_0x4edd2e){_0x2b9aae[_0xfb6b('0x2c')]=_0x4edd2e;if(_0xb2daed[_0xfb6b('0x3e')][_0xfb6b('0x4d')]){_0x3dad36[_0xfb6b('0x4e')]=[{'all':!![]}];}return db[_0xfb6b('0x38')][_0xfb6b('0x4f')](_0x3dad36);})['then'](function(_0x5ab6fd){_0x2b9aae[_0xfb6b('0x50')]=_0x5ab6fd;return _0x2b9aae;})[_0xfb6b('0x1d')](respondWithFilteredResult(_0x342265,_0x3dad36))[_0xfb6b('0x26')](handleError(_0x342265,null));};exports[_0xfb6b('0x51')]=function(_0x580641,_0x2ac119){var _0x510070={'raw':!![],'where':{'id':_0x580641['params']['id']}},_0x3a2ca4={};_0x3a2ca4['model']=_[_0xfb6b('0x3f')](db[_0xfb6b('0x38')]['rawAttributes']);_0x3a2ca4['query']=_[_0xfb6b('0x3f')](_0x580641[_0xfb6b('0x3e')]);_0x3a2ca4[_0xfb6b('0x40')]=_['intersection'](_0x3a2ca4['model'],_0x3a2ca4[_0xfb6b('0x3e')]);_0x510070['attributes']=_[_0xfb6b('0x42')](_0x3a2ca4[_0xfb6b('0x3d')],qs[_0xfb6b('0x43')](_0x580641[_0xfb6b('0x3e')]['fields']));_0x510070[_0xfb6b('0x41')]=_0x510070['attributes'][_0xfb6b('0x44')]?_0x510070[_0xfb6b('0x41')]:_0x3a2ca4[_0xfb6b('0x3d')];if(_0x580641[_0xfb6b('0x3e')][_0xfb6b('0x4d')]){_0x510070['include']=[{'all':!![]}];}_0x510070=_[_0xfb6b('0x4b')]({},_0x510070,_0x580641[_0xfb6b('0x4c')]);return db['Network'][_0xfb6b('0x52')](_0x510070)[_0xfb6b('0x1d')](handleEntityNotFound(_0x2ac119,null))[_0xfb6b('0x1d')](respondWithResult(_0x2ac119,null))[_0xfb6b('0x26')](handleError(_0x2ac119,null));};exports[_0xfb6b('0x53')]=function(_0x55445b,_0x4f87e1,_0x147d76){var _0x5155f9;return db['sequelize'][_0xfb6b('0x54')](function(_0x546baa){return db[_0xfb6b('0x38')]['create'](_0x55445b[_0xfb6b('0x55')],{'raw':!![]})[_0xfb6b('0x1d')](function(_0x2019d4){_0x5155f9=_0x2019d4;return db[_0xfb6b('0x38')][_0xfb6b('0x4f')]({'where':{'type':_0x55445b[_0xfb6b('0x55')][_0xfb6b('0x3b')]},'raw':!![]});})[_0xfb6b('0x1d')](function(_0x1a28bc){if(_0x5155f9[_0xfb6b('0x3b')][_0xfb6b('0x56')]()==_0xfb6b('0x57')){var _0x50356f=fs['readFileSync'](path[_0xfb6b('0x58')](config['root'],_0xfb6b('0x59')),_0xfb6b('0x5a'));var _0x4b45a5=ejs[_0xfb6b('0x5b')](_0x50356f,{'networks':_0x1a28bc||[]});fs[_0xfb6b('0x5c')]('/etc/asterisk/stun_xcally.conf',_0x4b45a5);return respondWithRpcPromise('Reload',_0xfb6b('0x53'),{'module':_0xfb6b('0x5d')});}else if(_0x5155f9['type']['toUpperCase']()==_0xfb6b('0x5e')){var _0x1bc6cf=fs[_0xfb6b('0x5f')](path[_0xfb6b('0x58')](config[_0xfb6b('0x60')],_0xfb6b('0x61')),_0xfb6b('0x5a'));var _0xa4aaac=ejs['render'](_0x1bc6cf,{'networks':_0x1a28bc||[]});fs[_0xfb6b('0x5c')](_0xfb6b('0x62'),_0xa4aaac);return respondWithRpcPromise('Reload',_0xfb6b('0x53'),{'module':'res_stun_monitor.so'});}else{var _0xb8233b=fs['readFileSync'](path[_0xfb6b('0x58')](config[_0xfb6b('0x60')],'server/files/templates/network.ejs'),_0xfb6b('0x5a'));var _0x1af74c=ejs['render'](_0xb8233b,{'networks':_0x1a28bc||[]});fs[_0xfb6b('0x5c')](util[_0xfb6b('0x63')](_0xfb6b('0x64'),_0x55445b['body']['type'][_0xfb6b('0x65')]()),_0x1af74c);return respondWithRpcPromise(_0xfb6b('0x66'),_0xfb6b('0x53'),{'module':'chan_sip.so'});}return null;})[_0xfb6b('0x1d')](function(){return _0x5155f9;});})[_0xfb6b('0x1d')](respondWithResult(_0x4f87e1,0xc9))['catch'](handleError(_0x4f87e1,null));};exports[_0xfb6b('0x31')]=function(_0x3d2f40,_0x36672d,_0x509632){var _0x5e890a;return db[_0xfb6b('0x67')]['transaction'](function(_0x430d5d){return db[_0xfb6b('0x38')][_0xfb6b('0x52')]({'where':{'id':_0x3d2f40[_0xfb6b('0x68')]['id']}})[_0xfb6b('0x1d')](handleEntityNotFound(_0x36672d,null))[_0xfb6b('0x1d')](saveUpdates(_0x3d2f40['body'],null))['then'](function(_0x209cce){if(_0x209cce){_0x5e890a=_0x209cce;return db['Network']['findAll']({'where':{'type':_0x5e890a[_0xfb6b('0x3b')]},'raw':!![]});}return null;})[_0xfb6b('0x1d')](function(_0x125565){if(_0x5e890a[_0xfb6b('0x3b')]['toUpperCase']()==_0xfb6b('0x57')){var _0x388760=fs[_0xfb6b('0x5f')](path['join'](config[_0xfb6b('0x60')],_0xfb6b('0x59')),'utf8');var _0x387c4c=ejs[_0xfb6b('0x5b')](_0x388760,{'networks':_0x125565||[]});fs['writeFileSync'](_0xfb6b('0x69'),_0x387c4c);return respondWithRpcPromise(_0xfb6b('0x66'),'update',{'module':_0xfb6b('0x5d')});}else if(_0x5e890a[_0xfb6b('0x3b')]['toUpperCase']()=='TURN'){var _0xa43547=fs[_0xfb6b('0x5f')](path[_0xfb6b('0x58')](config['root'],_0xfb6b('0x61')),_0xfb6b('0x5a'));var _0x36da9e=ejs[_0xfb6b('0x5b')](_0xa43547,{'networks':_0x125565||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x36da9e);return respondWithRpcPromise(_0xfb6b('0x66'),_0xfb6b('0x31'),{'module':_0xfb6b('0x5d')});}else{var _0x4801a9=fs[_0xfb6b('0x5f')](path['join'](config[_0xfb6b('0x60')],_0xfb6b('0x6a')),_0xfb6b('0x5a'));var _0x366899=ejs[_0xfb6b('0x5b')](_0x4801a9,{'networks':_0x125565||[]});fs[_0xfb6b('0x5c')](util[_0xfb6b('0x63')]('/etc/asterisk/sip_xcally_%s.conf',_0x3d2f40[_0xfb6b('0x55')][_0xfb6b('0x3b')][_0xfb6b('0x65')]()),_0x366899);return respondWithRpcPromise('Reload',_0xfb6b('0x31'),{'module':_0xfb6b('0x6b')});}return null;})[_0xfb6b('0x1d')](function(_0x214033){if(_0x214033){return _0x5e890a;}return null;});})[_0xfb6b('0x1d')](respondWithResult(_0x36672d,null))[_0xfb6b('0x26')](handleError(_0x36672d,null));};exports[_0xfb6b('0x32')]=function(_0x1d3d5b,_0x3797e3,_0x2ac933){var _0xd0bf7b;return db[_0xfb6b('0x38')][_0xfb6b('0x52')]({'where':{'id':_0x1d3d5b[_0xfb6b('0x68')]['id']}})[_0xfb6b('0x1d')](function(_0x40a553){_0xd0bf7b=_0x40a553;return _0x40a553;})[_0xfb6b('0x1d')](handleEntityNotFound(_0x3797e3,null))[_0xfb6b('0x1d')](removeEntity(_0x3797e3,null))['then'](function(){if(_0xd0bf7b){return db[_0xfb6b('0x38')][_0xfb6b('0x4f')]({'where':{'type':_0xd0bf7b[_0xfb6b('0x3b')]},'raw':!![]});}})['then'](function(_0xcec381){if(_0xd0bf7b[_0xfb6b('0x3b')][_0xfb6b('0x56')]()==_0xfb6b('0x57')){var _0x4c67aa=fs[_0xfb6b('0x5f')](path[_0xfb6b('0x58')](config[_0xfb6b('0x60')],_0xfb6b('0x59')),_0xfb6b('0x5a'));var _0x74d2f7=ejs[_0xfb6b('0x5b')](_0x4c67aa,{'networks':_0xcec381||[]});fs[_0xfb6b('0x5c')](_0xfb6b('0x69'),_0x74d2f7);return respondWithRpcPromise(_0xfb6b('0x66'),_0xfb6b('0x32'),{'module':_0xfb6b('0x5d')});}else if(_0xd0bf7b[_0xfb6b('0x3b')][_0xfb6b('0x56')]()==_0xfb6b('0x5e')){var _0x462548=fs['readFileSync'](path[_0xfb6b('0x58')](config[_0xfb6b('0x60')],'server/files/templates/turn_multiple.ejs'),_0xfb6b('0x5a'));var _0x4b7b48=ejs[_0xfb6b('0x5b')](_0x462548,{'networks':_0xcec381||[]});fs[_0xfb6b('0x5c')]('/etc/asterisk/turn_xcally.conf',_0x4b7b48);return respondWithRpcPromise(_0xfb6b('0x66'),_0xfb6b('0x32'),{'module':_0xfb6b('0x5d')});}else{var _0x421b07=fs[_0xfb6b('0x5f')](path[_0xfb6b('0x58')](config[_0xfb6b('0x60')],_0xfb6b('0x6a')),_0xfb6b('0x5a'));var _0x4f5089=ejs[_0xfb6b('0x5b')](_0x421b07,{'networks':_0xcec381||[]});fs[_0xfb6b('0x5c')](util[_0xfb6b('0x63')](_0xfb6b('0x64'),_0x1d3d5b[_0xfb6b('0x55')][_0xfb6b('0x3b')][_0xfb6b('0x65')]()),_0x4f5089);return respondWithRpcPromise(_0xfb6b('0x66'),'destroy',{'module':_0xfb6b('0x6b')});}return null;})['catch'](handleError(_0x3797e3,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 8065508..a443bfe 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 _0xc788=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Network','lodash','util'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xc788,0xc4));var _0x8c78=function(_0x57cc22,_0x2d351f){_0x57cc22=_0x57cc22-0x0;var _0x6f7bdc=_0xc788[_0x57cc22];return _0x6f7bdc;};'use strict';var _=require(_0x8c78('0x0'));var util=require(_0x8c78('0x1'));var logger=require(_0x8c78('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8c78('0x3'));var rp=require(_0x8c78('0x4'));var fs=require('fs');var path=require(_0x8c78('0x5'));var rimraf=require(_0x8c78('0x6'));var config=require(_0x8c78('0x7'));var attributes=require('./network.attributes');module[_0x8c78('0x8')]=function(_0x4555da,_0x329152){return _0x4555da[_0x8c78('0x9')](_0x8c78('0xa'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xec56=['define','Network','network','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./network.attributes','exports'];(function(_0x9a4402,_0x170c4e){var _0x1b244d=function(_0x121a18){while(--_0x121a18){_0x9a4402['push'](_0x9a4402['shift']());}};_0x1b244d(++_0x170c4e);}(_0xec56,0x1bd));var _0x6ec5=function(_0x15f806,_0x6827d2){_0x15f806=_0x15f806-0x0;var _0x23dfc8=_0xec56[_0x15f806];return _0x23dfc8;};'use strict';var _=require(_0x6ec5('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6ec5('0x1'));var moment=require(_0x6ec5('0x2'));var BPromise=require(_0x6ec5('0x3'));var rp=require(_0x6ec5('0x4'));var fs=require('fs');var path=require(_0x6ec5('0x5'));var rimraf=require(_0x6ec5('0x6'));var config=require(_0x6ec5('0x7'));var attributes=require(_0x6ec5('0x8'));module[_0x6ec5('0x9')]=function(_0x28b12b,_0x2d0a93){return _0x28b12b[_0x6ec5('0xa')](_0x6ec5('0xb'),attributes,{'tableName':_0x6ec5('0xc'),'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 440a9a9..25a4dfd 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(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7a54,0x106));var _0x47a5=function(_0x201b70,_0x4e4628){_0x201b70=_0x201b70-0x0;var _0xef9b45=_0x7a54[_0x201b70];return _0xef9b45;};'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 _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2f0f47,_0x3ce6a8){var _0x179ed3=function(_0x3f43ce){while(--_0x3f43ce){_0x2f0f47['push'](_0x2f0f47['shift']());}};_0x179ed3(++_0x3ce6a8);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 6f44e0d..322bea5 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 _0x4601=['../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','create','post','addDisposition','/:id/canned_answers','/:id/notify','notify','addAgents','send','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','path','Router','fs-extra'];(function(_0x3b9afb,_0x2133f4){var _0x136e05=function(_0x1fb7e2){while(--_0x1fb7e2){_0x3b9afb['push'](_0x3b9afb['shift']());}};_0x136e05(++_0x2133f4);}(_0x4601,0xe6));var _0x1460=function(_0x4335cf,_0x1e5e45){_0x4335cf=_0x4335cf-0x0;var _0x2e1bbe=_0x4601[_0x4335cf];return _0x2e1bbe;};'use strict';var multer=require(_0x1460('0x0'));var util=require('util');var path=require(_0x1460('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1460('0x2')]();var fs_extra=require(_0x1460('0x3'));var auth=require(_0x1460('0x4'));var interaction=require(_0x1460('0x5'));var config=require(_0x1460('0x6'));var controller=require(_0x1460('0x7'));router[_0x1460('0x8')]('/',auth[_0x1460('0x9')](),controller[_0x1460('0xa')]);router[_0x1460('0x8')](_0x1460('0xb'),auth[_0x1460('0x9')](),controller[_0x1460('0xc')]);router[_0x1460('0x8')](_0x1460('0xd'),auth[_0x1460('0x9')](),controller[_0x1460('0xe')]);router[_0x1460('0x8')](_0x1460('0xf'),auth[_0x1460('0x9')](),controller[_0x1460('0x10')]);router[_0x1460('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router[_0x1460('0x8')](_0x1460('0x11'),auth[_0x1460('0x9')](),controller[_0x1460('0x12')]);router[_0x1460('0x8')](_0x1460('0x13'),auth['isAuthenticated'](),controller[_0x1460('0x14')]);router[_0x1460('0x8')](_0x1460('0x15'),auth[_0x1460('0x9')](),controller[_0x1460('0x16')]);router['post']('/',auth[_0x1460('0x9')](),controller[_0x1460('0x17')]);router[_0x1460('0x18')]('/:id/dispositions',auth[_0x1460('0x9')](),controller[_0x1460('0x19')]);router[_0x1460('0x18')](_0x1460('0x1a'),auth[_0x1460('0x9')](),controller['addAnswer']);router[_0x1460('0x18')](_0x1460('0x1b'),controller[_0x1460('0x1c')]);router['post'](_0x1460('0x11'),auth[_0x1460('0x9')](),controller['addApplications']);router[_0x1460('0x18')](_0x1460('0x15'),auth[_0x1460('0x9')](),controller[_0x1460('0x1d')]);router[_0x1460('0x18')]('/:id/send',auth[_0x1460('0x9')](),controller[_0x1460('0x1e')]);router[_0x1460('0x1f')]('/:id',auth[_0x1460('0x9')](),controller[_0x1460('0x20')]);router[_0x1460('0x21')](_0x1460('0xd'),auth[_0x1460('0x9')](),controller[_0x1460('0x22')]);router[_0x1460('0x21')](_0x1460('0xf'),auth[_0x1460('0x9')](),controller[_0x1460('0x23')]);router[_0x1460('0x21')](_0x1460('0x1a'),auth[_0x1460('0x9')](),controller[_0x1460('0x24')]);router['delete'](_0x1460('0x15'),auth['isAuthenticated'](),controller[_0x1460('0x25')]);module[_0x1460('0x26')]=router; \ No newline at end of file +var _0x0f9b=['removeAgents','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./openchannelAccount.controller','get','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','getInteractions','create','addDisposition','addAnswer','post','/:id/notify','notify','addApplications','/:id/users','addAgents','/:id/send','send','put','destroy','delete','removeDispositions','removeAnswers'];(function(_0x4ed520,_0x21be63){var _0x4415a6=function(_0x14b151){while(--_0x14b151){_0x4ed520['push'](_0x4ed520['shift']());}};_0x4415a6(++_0x21be63);}(_0x0f9b,0x6e));var _0xb0f9=function(_0x392f8b,_0xd9fc57){_0x392f8b=_0x392f8b-0x0;var _0x390077=_0x0f9b[_0x392f8b];return _0x390077;};'use strict';var multer=require('multer');var util=require(_0xb0f9('0x0'));var path=require(_0xb0f9('0x1'));var timeout=require(_0xb0f9('0x2'));var express=require(_0xb0f9('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb0f9('0x4'));var interaction=require(_0xb0f9('0x5'));var config=require('../../config/environment');var controller=require(_0xb0f9('0x6'));router[_0xb0f9('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb0f9('0x7')]('/describe',auth[_0xb0f9('0x8')](),controller['describe']);router[_0xb0f9('0x7')](_0xb0f9('0x9'),auth['isAuthenticated'](),controller[_0xb0f9('0xa')]);router['get'](_0xb0f9('0xb'),auth['isAuthenticated'](),controller[_0xb0f9('0xc')]);router[_0xb0f9('0x7')](_0xb0f9('0xd'),auth[_0xb0f9('0x8')](),controller[_0xb0f9('0xe')]);router['get'](_0xb0f9('0xf'),auth[_0xb0f9('0x8')](),controller[_0xb0f9('0x10')]);router[_0xb0f9('0x7')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xb0f9('0x11')]);router[_0xb0f9('0x7')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth[_0xb0f9('0x8')](),controller[_0xb0f9('0x12')]);router['post'](_0xb0f9('0xb'),auth[_0xb0f9('0x8')](),controller[_0xb0f9('0x13')]);router['post'](_0xb0f9('0xd'),auth[_0xb0f9('0x8')](),controller[_0xb0f9('0x14')]);router[_0xb0f9('0x15')](_0xb0f9('0x16'),controller[_0xb0f9('0x17')]);router[_0xb0f9('0x15')](_0xb0f9('0xf'),auth[_0xb0f9('0x8')](),controller[_0xb0f9('0x18')]);router[_0xb0f9('0x15')](_0xb0f9('0x19'),auth[_0xb0f9('0x8')](),controller[_0xb0f9('0x1a')]);router[_0xb0f9('0x15')](_0xb0f9('0x1b'),auth[_0xb0f9('0x8')](),controller[_0xb0f9('0x1c')]);router[_0xb0f9('0x1d')]('/:id',auth[_0xb0f9('0x8')](),controller['update']);router['delete'](_0xb0f9('0x9'),auth[_0xb0f9('0x8')](),controller[_0xb0f9('0x1e')]);router[_0xb0f9('0x1f')](_0xb0f9('0xb'),auth[_0xb0f9('0x8')](),controller[_0xb0f9('0x20')]);router['delete'](_0xb0f9('0xd'),auth['isAuthenticated'](),controller[_0xb0f9('0x21')]);router[_0xb0f9('0x1f')](_0xb0f9('0x19'),auth[_0xb0f9('0x8')](),controller[_0xb0f9('0x22')]);module[_0xb0f9('0x23')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index cd54b5f..ccced79 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 _0x1195=['TEXT','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','name','STRING','generate'];(function(_0x230480,_0x1ee9b9){var _0x397b43=function(_0x1b5b44){while(--_0x1b5b44){_0x230480['push'](_0x230480['shift']());}};_0x397b43(++_0x1ee9b9);}(_0x1195,0x13f));var _0x5119=function(_0x512550,_0x6a8b6f){_0x512550=_0x512550-0x0;var _0x19f661=_0x1195[_0x512550];return _0x19f661;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x5119('0x0'));module[_0x5119('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x5119('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x5119('0x3')]},'token':{'type':Sequelize[_0x5119('0x3')],'defaultValue':function(){return rs[_0x5119('0x4')]();}},'replyUri':{'type':Sequelize[_0x5119('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x5119('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x5119('0x5')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x5119('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5119('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5119('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x5119('0x3')]},'queueTransfer':{'type':Sequelize[_0x5119('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5119('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5119('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5119('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5119('0x7')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x5119('0x8'),'set':function(_0x471a5f){if(!_0x471a5f)this[_0x5119('0x9')](_0x5119('0xa'),null);this[_0x5119('0x9')](_0x5119('0xb'),_0x471a5f);}}}; \ No newline at end of file +var _0x4eba=['sequelize','randomstring','exports','STRING','name','generate','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','mandatoryDispositionPauseId'];(function(_0x41a04f,_0x51e497){var _0x211f50=function(_0x28aa67){while(--_0x28aa67){_0x41a04f['push'](_0x41a04f['shift']());}};_0x211f50(++_0x51e497);}(_0x4eba,0x1d4));var _0xa4eb=function(_0x47f4fd,_0x27bca2){_0x47f4fd=_0x47f4fd-0x0;var _0x2a89ee=_0x4eba[_0x47f4fd];return _0x2a89ee;};'use strict';var Sequelize=require(_0xa4eb('0x0'));var rs=require(_0xa4eb('0x1'));module[_0xa4eb('0x2')]={'name':{'type':Sequelize[_0xa4eb('0x3')],'unique':_0xa4eb('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0xa4eb('0x3')]},'token':{'type':Sequelize[_0xa4eb('0x3')],'defaultValue':function(){return rs[_0xa4eb('0x5')]();}},'replyUri':{'type':Sequelize[_0xa4eb('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xa4eb('0x6')],'defaultValue':function(){return _0xa4eb('0x7');}},'notificationSound':{'type':Sequelize[_0xa4eb('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa4eb('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa4eb('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xa4eb('0x3')]},'queueTransfer':{'type':Sequelize[_0xa4eb('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa4eb('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa4eb('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa4eb('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa4eb('0x9')],'allowNull':!![],'defaultValue':null,'comment':_0xa4eb('0xa')},'mandatoryDisposition':{'type':Sequelize[_0xa4eb('0x8')],'defaultValue':![],'comment':_0xa4eb('0xb'),'set':function(_0x6372ee){if(!_0x6372ee)this['setDataValue'](_0xa4eb('0xc'),null);this['setDataValue']('mandatoryDisposition',_0x6372ee);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 226cc91..61e5196 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 _0xa910=['difference','createdAt','updatedAt','ListId','isNil','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','from','CmList','DESC','OpenchannelApplication','account','applications','Applications','List','orderBy','priority','Contacts','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','UserId','User','unshift','agent','forcedOwnership','Start','EventManager','addApplications','sequelize','Transaction','READ_COMMITTED','bulkCreate','findAndCountAll','finally','send','getApplications','Contact','Owner','fullname','internal','Tag','color','tag','addAgents','ids','omit','userOpenchannelAccount:save','removeAgents','isArray','emit','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','client','http','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','count','limit','apply','reject','save','update','destroy','then','OpenchannelAccounts','UserProfileResource','stack','name','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','filter','includeAll','include','rows','catch','show','keys','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','autoAssociation','params','describe','addDisposition','getDispositions','Disposition','OpenchannelAccountId','findAll','removeDispositions','getAnswers','findOne','CannedAnswer','pick','removeAnswers','notify','openchannel','CmContact','ValidationError','no\x20available\x20attributes'];(function(_0x387cf9,_0x7b244d){var _0x4a2738=function(_0x404455){while(--_0x404455){_0x387cf9['push'](_0x387cf9['shift']());}};_0x4a2738(++_0x7b244d);}(_0xa910,0x1c6));var _0x0a91=function(_0x3d8bd6,_0x4e0677){_0x3d8bd6=_0x3d8bd6-0x0;var _0x5e13b5=_0xa910[_0x3d8bd6];return _0x5e13b5;};'use strict';var emlformat=require(_0x0a91('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0a91('0x1'));var jsonpatch=require(_0x0a91('0x2'));var rp=require(_0x0a91('0x3'));var moment=require(_0x0a91('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0a91('0x5'));var util=require('util');var path=require(_0x0a91('0x6'));var sox=require(_0x0a91('0x7'));var csv=require(_0x0a91('0x8'));var ejs=require(_0x0a91('0x9'));var fs=require('fs');var fs_extra=require(_0x0a91('0xa'));var _=require(_0x0a91('0xb'));var squel=require(_0x0a91('0xc'));var crypto=require('crypto');var jsforce=require(_0x0a91('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0a91('0x8'));var querystring=require(_0x0a91('0xe'));var Papa=require(_0x0a91('0xf'));var Redis=require(_0x0a91('0x10'));var authService=require(_0x0a91('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x0a91('0x12'));var hardwareService=require(_0x0a91('0x13'));var logger=require('../../config/logger')(_0x0a91('0x14'));var utils=require(_0x0a91('0x15'));var config=require(_0x0a91('0x16'));var licenseUtil=require(_0x0a91('0x17'));var db=require(_0x0a91('0x18'))['db'];config[_0x0a91('0x19')]=_[_0x0a91('0x1a')](config[_0x0a91('0x19')],{'host':_0x0a91('0x1b'),'port':0x18eb});var socket=require(_0x0a91('0x1c'))(new Redis(config['redis']));require(_0x0a91('0x1d'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x0a91('0x1e')][_0x0a91('0x1f')]({'port':0x232c});var client9002=jayson[_0x0a91('0x1e')][_0x0a91('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x23b015,_0x122275,_0x41eab1,_0x1a3020){return new BPromise(function(_0x19c3bd,_0x426ab1){var _0x518bfe=_0x1a3020||client;return _0x518bfe[_0x0a91('0x20')](_0x23b015,_0x41eab1)['then'](function(_0x328cbd){logger[_0x0a91('0x21')](_0x0a91('0x22'),_0x122275,_0x0a91('0x23'));logger[_0x0a91('0x24')](_0x0a91('0x25'),_0x122275,_0x0a91('0x23'),JSON[_0x0a91('0x26')](_0x328cbd));if(_0x328cbd[_0x0a91('0x27')]){if(_0x328cbd[_0x0a91('0x27')][_0x0a91('0x28')]===0x1f4){logger[_0x0a91('0x27')]('OpenchannelAccount,\x20%s,\x20%s',_0x122275,_0x328cbd['error'][_0x0a91('0x29')]);return _0x426ab1(_0x328cbd['error']['message']);}logger[_0x0a91('0x27')](_0x0a91('0x22'),_0x122275,_0x328cbd[_0x0a91('0x27')]['message']);return _0x19c3bd(_0x328cbd[_0x0a91('0x27')]['message']);}else{logger[_0x0a91('0x21')]('OpenchannelAccount,\x20%s,\x20%s',_0x122275,_0x0a91('0x23'));_0x19c3bd(_0x328cbd[_0x0a91('0x2a')][_0x0a91('0x29')]);}})['catch'](function(_0x6f636e){logger['error'](_0x0a91('0x22'),_0x122275,_0x6f636e);_0x426ab1(_0x6f636e);});});}function respondWithStatusCode(_0x3765dc,_0x35f9a6){_0x35f9a6=_0x35f9a6||0xcc;return function(_0x224647){if(_0x224647){return _0x3765dc[_0x0a91('0x2b')](_0x35f9a6);}return _0x3765dc[_0x0a91('0x2c')](_0x35f9a6)[_0x0a91('0x2d')]();};}function respondWithResult(_0xd91d9d,_0x495413){_0x495413=_0x495413||0xc8;return function(_0x1b299e){if(_0x1b299e){return _0xd91d9d[_0x0a91('0x2c')](_0x495413)[_0x0a91('0x2e')](_0x1b299e);}};}function respondWithFilteredResult(_0x2ae588,_0x264225){return function(_0x4625ee){if(_0x4625ee){var _0x40fff1=typeof _0x264225[_0x0a91('0x2f')]===_0x0a91('0x30')&&typeof _0x264225['limit']==='undefined';var _0x25bbff=_0x4625ee['count'];var _0x1f7676=_0x40fff1?0x0:_0x264225[_0x0a91('0x2f')];var _0x7fe547=_0x40fff1?_0x4625ee[_0x0a91('0x31')]:_0x264225[_0x0a91('0x2f')]+_0x264225[_0x0a91('0x32')];var _0x2b262f;if(_0x7fe547>=_0x25bbff){_0x7fe547=_0x25bbff;_0x2b262f=0xc8;}else{_0x2b262f=0xce;}_0x2ae588['status'](_0x2b262f);return _0x2ae588['set']('Content-Range',_0x1f7676+'-'+_0x7fe547+'/'+_0x25bbff)[_0x0a91('0x2e')](_0x4625ee);}return null;};}function patchUpdates(_0x1dd827){return function(_0x2430ca){try{jsonpatch[_0x0a91('0x33')](_0x2430ca,_0x1dd827,!![]);}catch(_0xf58fcb){return BPromise[_0x0a91('0x34')](_0xf58fcb);}return _0x2430ca[_0x0a91('0x35')]();};}function saveUpdates(_0x41fe47,_0x4d6583){return function(_0x1594b2){if(_0x1594b2){return _0x1594b2[_0x0a91('0x36')](_0x41fe47)['then'](function(_0xb2ff76){return _0xb2ff76;});}return null;};}function removeEntity(_0x1d8d81,_0x467434){return function(_0x4de4e6){if(_0x4de4e6){return _0x4de4e6[_0x0a91('0x37')]()[_0x0a91('0x38')](function(){var _0x4aa4f7=_0x4de4e6['get']({'plain':!![]});var _0x29f447=_0x0a91('0x39');return db[_0x0a91('0x3a')]['destroy']({'where':{'type':_0x29f447,'resourceId':_0x4aa4f7['id']}})['then'](function(){return _0x4de4e6;});})[_0x0a91('0x38')](function(){_0x1d8d81['status'](0xcc)[_0x0a91('0x2d')]();});}};}function handleEntityNotFound(_0x34a752,_0x4e024c){return function(_0x37f5e0){if(!_0x37f5e0){_0x34a752[_0x0a91('0x2b')](0x194);}return _0x37f5e0;};}function handleError(_0x46591a,_0x26d609){_0x26d609=_0x26d609||0x1f4;return function(_0x12e414){logger['error'](_0x12e414[_0x0a91('0x3b')]);if(_0x12e414[_0x0a91('0x3c')]){delete _0x12e414['name'];}_0x46591a['status'](_0x26d609)['send'](_0x12e414);};}exports['index']=function(_0x4b258f,_0xdd41a4){var _0x88b223={'include':[{'model':db[_0x0a91('0x3d')],'as':_0x0a91('0x3e')}]},_0x4a9487={},_0x5601ec={'count':0x0,'rows':[]};var _0x5f21a8=_[_0x0a91('0x3f')](db[_0x0a91('0x40')][_0x0a91('0x41')],function(_0x4a156c){return{'name':_0x4a156c[_0x0a91('0x42')],'type':_0x4a156c[_0x0a91('0x43')][_0x0a91('0x44')]};});_0x4a9487['model']=_['map'](_0x5f21a8,_0x0a91('0x3c'));_0x4a9487['query']=_['keys'](_0x4b258f[_0x0a91('0x45')]);_0x4a9487['filters']=_[_0x0a91('0x46')](_0x4a9487[_0x0a91('0x47')],_0x4a9487['query']);_0x88b223[_0x0a91('0x48')]=_[_0x0a91('0x46')](_0x4a9487[_0x0a91('0x47')],qs[_0x0a91('0x49')](_0x4b258f['query'][_0x0a91('0x49')]));_0x88b223[_0x0a91('0x48')]=_0x88b223[_0x0a91('0x48')][_0x0a91('0x4a')]?_0x88b223[_0x0a91('0x48')]:_0x4a9487[_0x0a91('0x47')];if(!_0x4b258f[_0x0a91('0x45')][_0x0a91('0x4b')](_0x0a91('0x4c'))){_0x88b223[_0x0a91('0x32')]=qs['limit'](_0x4b258f[_0x0a91('0x45')][_0x0a91('0x32')]);_0x88b223[_0x0a91('0x2f')]=qs['offset'](_0x4b258f[_0x0a91('0x45')]['offset']);}_0x88b223[_0x0a91('0x4d')]=qs['sort'](_0x4b258f[_0x0a91('0x45')][_0x0a91('0x4e')]);_0x88b223[_0x0a91('0x4f')]=qs['filters'](_['pick'](_0x4b258f[_0x0a91('0x45')],_0x4a9487[_0x0a91('0x50')]),_0x5f21a8);if(_0x4b258f[_0x0a91('0x45')]['filter']){_0x88b223[_0x0a91('0x4f')]=_[_0x0a91('0x51')](_0x88b223[_0x0a91('0x4f')],{'$or':_['map'](_0x5f21a8,function(_0xe474af){if(_0xe474af[_0x0a91('0x43')]!=='VIRTUAL'){var _0x183967={};_0x183967[_0xe474af[_0x0a91('0x3c')]]={'$like':'%'+_0x4b258f[_0x0a91('0x45')][_0x0a91('0x52')]+'%'};return _0x183967;}})});}_0x88b223=_['merge']({},_0x88b223,_0x4b258f['options']);var _0x147d87={'where':_0x88b223[_0x0a91('0x4f')]};return db[_0x0a91('0x40')][_0x0a91('0x31')](_0x147d87)[_0x0a91('0x38')](function(_0x5a0f54){_0x5601ec[_0x0a91('0x31')]=_0x5a0f54;if(_0x4b258f[_0x0a91('0x45')][_0x0a91('0x53')]){_0x88b223[_0x0a91('0x54')]=[{'all':!![]}];}return db['OpenchannelAccount']['findAll'](_0x88b223);})[_0x0a91('0x38')](function(_0x5d7fa9){_0x5601ec[_0x0a91('0x55')]=_0x5d7fa9;return _0x5601ec;})[_0x0a91('0x38')](respondWithFilteredResult(_0xdd41a4,_0x88b223))[_0x0a91('0x56')](handleError(_0xdd41a4,null));};exports[_0x0a91('0x57')]=function(_0xe228ee,_0x1d3d75){var _0xd01e96={'raw':![],'where':{'id':_0xe228ee['params']['id']},'include':[{'model':db[_0x0a91('0x3d')],'as':_0x0a91('0x3e')}]},_0x5bd96d={};_0x5bd96d[_0x0a91('0x47')]=_[_0x0a91('0x58')](db[_0x0a91('0x40')]['rawAttributes']);_0x5bd96d['query']=_[_0x0a91('0x58')](_0xe228ee[_0x0a91('0x45')]);_0x5bd96d[_0x0a91('0x50')]=_[_0x0a91('0x46')](_0x5bd96d[_0x0a91('0x47')],_0x5bd96d[_0x0a91('0x45')]);_0xd01e96[_0x0a91('0x48')]=_[_0x0a91('0x46')](_0x5bd96d[_0x0a91('0x47')],qs[_0x0a91('0x49')](_0xe228ee[_0x0a91('0x45')]['fields']));_0xd01e96[_0x0a91('0x48')]=_0xd01e96[_0x0a91('0x48')]['length']?_0xd01e96[_0x0a91('0x48')]:_0x5bd96d[_0x0a91('0x47')];if(_0xe228ee[_0x0a91('0x45')]['includeAll']){_0xd01e96[_0x0a91('0x54')]=[{'all':!![]}];}_0xd01e96=_[_0x0a91('0x51')]({},_0xd01e96,_0xe228ee[_0x0a91('0x59')]);return db['OpenchannelAccount']['find'](_0xd01e96)[_0x0a91('0x38')](handleEntityNotFound(_0x1d3d75,null))[_0x0a91('0x38')](respondWithResult(_0x1d3d75,null))['catch'](handleError(_0x1d3d75,null));};exports[_0x0a91('0x5a')]=function(_0x378465,_0x5ddf9f){return db[_0x0a91('0x40')][_0x0a91('0x5a')](_0x378465[_0x0a91('0x5b')],{})[_0x0a91('0x38')](function(_0x208ec3){var _0x28eab1=_0x378465[_0x0a91('0x5c')][_0x0a91('0x5d')]({'plain':!![]});if(!_0x28eab1)throw new Error(_0x0a91('0x5e'));if(_0x28eab1['role']===_0x0a91('0x5c')){var _0x142174=_0x208ec3[_0x0a91('0x5d')]({'plain':!![]});var _0x4efad7=_0x0a91('0x39');return db[_0x0a91('0x5f')][_0x0a91('0x60')]({'where':{'name':_0x4efad7,'userProfileId':_0x28eab1['userProfileId']},'raw':!![]})[_0x0a91('0x38')](function(_0xa69ed1){if(_0xa69ed1&&_0xa69ed1[_0x0a91('0x61')]===0x0){return db['UserProfileResource'][_0x0a91('0x5a')]({'name':_0x142174['name'],'resourceId':_0x142174['id'],'type':_0xa69ed1['name'],'sectionId':_0xa69ed1['id']},{})['then'](function(){return _0x208ec3;});}else{return _0x208ec3;}})[_0x0a91('0x56')](function(_0x45f917){logger[_0x0a91('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x45f917);throw _0x45f917;});}return _0x208ec3;})[_0x0a91('0x38')](respondWithResult(_0x5ddf9f,0xc9))[_0x0a91('0x56')](handleError(_0x5ddf9f,null));};exports[_0x0a91('0x36')]=function(_0x685646,_0x40a963){if(_0x685646['body']['id']){delete _0x685646[_0x0a91('0x5b')]['id'];}return db[_0x0a91('0x40')]['find']({'where':{'id':_0x685646['params']['id']},'include':[{'model':db['Pause'],'as':_0x0a91('0x3e')}]})['then'](handleEntityNotFound(_0x40a963,null))[_0x0a91('0x38')](saveUpdates(_0x685646['body'],null))[_0x0a91('0x38')](respondWithResult(_0x40a963,null))['catch'](handleError(_0x40a963,null));};exports[_0x0a91('0x37')]=function(_0x21ebfb,_0x79f0f5){return db[_0x0a91('0x40')][_0x0a91('0x60')]({'where':{'id':_0x21ebfb[_0x0a91('0x62')]['id']}})[_0x0a91('0x38')](handleEntityNotFound(_0x79f0f5,null))[_0x0a91('0x38')](removeEntity(_0x79f0f5,null))[_0x0a91('0x56')](handleError(_0x79f0f5,null));};exports[_0x0a91('0x63')]=function(_0x5b19c5,_0x23314d){return db[_0x0a91('0x40')][_0x0a91('0x63')]()['then'](respondWithResult(_0x23314d,null))[_0x0a91('0x56')](handleError(_0x23314d,null));};exports[_0x0a91('0x64')]=function(_0x24017d,_0x3e713f,_0x55d96d){if(_0x24017d[_0x0a91('0x5b')]['id']){delete _0x24017d['body']['id'];}return db[_0x0a91('0x40')]['find']({'where':{'id':_0x24017d['params']['id']}})[_0x0a91('0x38')](handleEntityNotFound(_0x3e713f,null))[_0x0a91('0x38')](function(_0x304777){if(_0x304777){_0x24017d[_0x0a91('0x5b')]['OpenchannelAccountId']=_0x304777['id'];return db['Disposition'][_0x0a91('0x5a')](_0x24017d[_0x0a91('0x5b')]);}})[_0x0a91('0x38')](respondWithResult(_0x3e713f,null))[_0x0a91('0x56')](handleError(_0x3e713f,null));};exports[_0x0a91('0x65')]=function(_0x1c1e43,_0x5eeac2,_0x52a5f3){var _0x139325={'raw':![],'where':{}};var _0x4c47e4={};var _0x50d21c={'count':0x0,'rows':[]};return db[_0x0a91('0x40')]['findOne']({'where':{'id':_0x1c1e43[_0x0a91('0x62')]['id']}})['then'](handleEntityNotFound(_0x5eeac2,null))[_0x0a91('0x38')](function(_0x44e7d3){if(_0x44e7d3){_0x4c47e4[_0x0a91('0x47')]=_['keys'](db[_0x0a91('0x66')][_0x0a91('0x41')]);_0x4c47e4[_0x0a91('0x45')]=_['keys'](_0x1c1e43[_0x0a91('0x45')]);_0x4c47e4[_0x0a91('0x50')]=_[_0x0a91('0x46')](_0x4c47e4[_0x0a91('0x47')],_0x4c47e4['query']);_0x139325[_0x0a91('0x48')]=_['intersection'](_0x4c47e4[_0x0a91('0x47')],qs['fields'](_0x1c1e43['query'][_0x0a91('0x49')]));_0x139325[_0x0a91('0x48')]=_0x139325['attributes'][_0x0a91('0x4a')]?_0x139325[_0x0a91('0x48')]:_0x4c47e4[_0x0a91('0x47')];if(!_0x1c1e43[_0x0a91('0x45')][_0x0a91('0x4b')](_0x0a91('0x4c'))){_0x139325['limit']=qs[_0x0a91('0x32')](_0x1c1e43[_0x0a91('0x45')][_0x0a91('0x32')]);_0x139325[_0x0a91('0x2f')]=qs[_0x0a91('0x2f')](_0x1c1e43[_0x0a91('0x45')][_0x0a91('0x2f')]);}_0x139325[_0x0a91('0x4d')]=qs['sort'](_0x1c1e43[_0x0a91('0x45')][_0x0a91('0x4e')]);_0x139325['where']=qs[_0x0a91('0x50')](_['pick'](_0x1c1e43[_0x0a91('0x45')],_0x4c47e4['filters']));_0x139325['where'][_0x0a91('0x67')]=_0x44e7d3['id'];if(_0x1c1e43['query'][_0x0a91('0x52')]){_0x139325['where']=_[_0x0a91('0x51')](_0x139325[_0x0a91('0x4f')],{'$or':_['map'](_0x139325[_0x0a91('0x48')],function(_0x49d7db){var _0x57a1fc={};_0x57a1fc[_0x49d7db]={'$like':'%'+_0x1c1e43[_0x0a91('0x45')][_0x0a91('0x52')]+'%'};return _0x57a1fc;})});}_0x139325=_[_0x0a91('0x51')]({},_0x139325,_0x1c1e43['options']);return db[_0x0a91('0x66')][_0x0a91('0x31')]({'where':_0x139325[_0x0a91('0x4f')]})[_0x0a91('0x38')](function(_0x42c77c){_0x50d21c[_0x0a91('0x31')]=_0x42c77c;if(_0x1c1e43[_0x0a91('0x45')][_0x0a91('0x53')]){_0x139325['include']=[{'all':!![]}];}return db['Disposition'][_0x0a91('0x68')](_0x139325);})['then'](function(_0x3ca423){_0x50d21c[_0x0a91('0x55')]=_0x3ca423;return _0x50d21c;});}})['then'](respondWithFilteredResult(_0x5eeac2,_0x139325))[_0x0a91('0x56')](handleError(_0x5eeac2,null));};exports['removeDispositions']=function(_0x2da69e,_0x14d32f,_0x4ac4b2){return db['OpenchannelAccount'][_0x0a91('0x60')]({'where':{'id':_0x2da69e['params']['id']}})[_0x0a91('0x38')](handleEntityNotFound(_0x14d32f,null))[_0x0a91('0x38')](function(_0x2f19b2){if(_0x2f19b2){return _0x2f19b2[_0x0a91('0x69')](_0x2da69e[_0x0a91('0x45')]['ids']);}})['then'](respondWithStatusCode(_0x14d32f,null))['catch'](handleError(_0x14d32f,null));};exports['addAnswer']=function(_0x103720,_0x258618,_0x4f5c3a){if(_0x103720['body']['id']){delete _0x103720[_0x0a91('0x5b')]['id'];}return db[_0x0a91('0x40')][_0x0a91('0x60')]({'where':{'id':_0x103720['params']['id']}})[_0x0a91('0x38')](handleEntityNotFound(_0x258618,null))['then'](function(_0x1566bf){if(_0x1566bf){_0x103720[_0x0a91('0x5b')][_0x0a91('0x67')]=_0x1566bf['id'];return db['CannedAnswer']['create'](_0x103720[_0x0a91('0x5b')]);}})[_0x0a91('0x38')](respondWithResult(_0x258618,null))[_0x0a91('0x56')](handleError(_0x258618,null));};exports[_0x0a91('0x6a')]=function(_0x18491d,_0x2002eb,_0x5671f1){var _0x12bddf={'raw':![],'where':{}};var _0x4269d2={};var _0x29072e={'count':0x0,'rows':[]};return db[_0x0a91('0x40')][_0x0a91('0x6b')]({'where':{'id':_0x18491d[_0x0a91('0x62')]['id']}})[_0x0a91('0x38')](handleEntityNotFound(_0x2002eb,null))[_0x0a91('0x38')](function(_0x5a38ff){if(_0x5a38ff){_0x4269d2[_0x0a91('0x47')]=_[_0x0a91('0x58')](db[_0x0a91('0x6c')]['rawAttributes']);_0x4269d2[_0x0a91('0x45')]=_[_0x0a91('0x58')](_0x18491d[_0x0a91('0x45')]);_0x4269d2[_0x0a91('0x50')]=_[_0x0a91('0x46')](_0x4269d2[_0x0a91('0x47')],_0x4269d2[_0x0a91('0x45')]);_0x12bddf[_0x0a91('0x48')]=_[_0x0a91('0x46')](_0x4269d2[_0x0a91('0x47')],qs[_0x0a91('0x49')](_0x18491d[_0x0a91('0x45')][_0x0a91('0x49')]));_0x12bddf[_0x0a91('0x48')]=_0x12bddf[_0x0a91('0x48')][_0x0a91('0x4a')]?_0x12bddf[_0x0a91('0x48')]:_0x4269d2[_0x0a91('0x47')];if(!_0x18491d[_0x0a91('0x45')][_0x0a91('0x4b')](_0x0a91('0x4c'))){_0x12bddf['limit']=qs[_0x0a91('0x32')](_0x18491d['query']['limit']);_0x12bddf[_0x0a91('0x2f')]=qs[_0x0a91('0x2f')](_0x18491d[_0x0a91('0x45')][_0x0a91('0x2f')]);}_0x12bddf[_0x0a91('0x4d')]=qs['sort'](_0x18491d[_0x0a91('0x45')][_0x0a91('0x4e')]);_0x12bddf['where']=qs[_0x0a91('0x50')](_[_0x0a91('0x6d')](_0x18491d[_0x0a91('0x45')],_0x4269d2[_0x0a91('0x50')]));_0x12bddf[_0x0a91('0x4f')][_0x0a91('0x67')]=_0x5a38ff['id'];if(_0x18491d[_0x0a91('0x45')][_0x0a91('0x52')]){_0x12bddf['where']=_[_0x0a91('0x51')](_0x12bddf[_0x0a91('0x4f')],{'$or':_['map'](_0x12bddf['attributes'],function(_0xceadb){var _0x89f11a={};_0x89f11a[_0xceadb]={'$like':'%'+_0x18491d['query'][_0x0a91('0x52')]+'%'};return _0x89f11a;})});}_0x12bddf=_[_0x0a91('0x51')]({},_0x12bddf,_0x18491d[_0x0a91('0x59')]);return db[_0x0a91('0x6c')][_0x0a91('0x31')]({'where':_0x12bddf[_0x0a91('0x4f')]})[_0x0a91('0x38')](function(_0x4c7460){_0x29072e[_0x0a91('0x31')]=_0x4c7460;if(_0x18491d[_0x0a91('0x45')][_0x0a91('0x53')]){_0x12bddf[_0x0a91('0x54')]=[{'all':!![]}];}return db[_0x0a91('0x6c')]['findAll'](_0x12bddf);})['then'](function(_0x5475f9){_0x29072e['rows']=_0x5475f9;return _0x29072e;});}})['then'](respondWithFilteredResult(_0x2002eb,_0x12bddf))[_0x0a91('0x56')](handleError(_0x2002eb,null));};exports[_0x0a91('0x6e')]=function(_0xe7bc5,_0x25e004,_0x46c8fe){return db['OpenchannelAccount']['find']({'where':{'id':_0xe7bc5[_0x0a91('0x62')]['id']}})['then'](handleEntityNotFound(_0x25e004,null))[_0x0a91('0x38')](function(_0x461a89){if(_0x461a89){return _0x461a89[_0x0a91('0x6e')](_0xe7bc5['query']['ids']);}})[_0x0a91('0x38')](respondWithStatusCode(_0x25e004,null))[_0x0a91('0x56')](handleError(_0x25e004,null));};exports[_0x0a91('0x6f')]=function(_0x5e767f,_0x587e99,_0x45f932){var _0x4f1d3e={'body':_0x5e767f[_0x0a91('0x5b')],'channel':_0x0a91('0x70')};var _0x5579c5=[];var _0x3722fc=[];var _0x459e4c={};var _0x75cb02=![];return db[_0x0a91('0x71')][_0x0a91('0x63')]()['then'](function(_0x2f0199){if(!_0x2f0199){throw new db['Sequelize'][(_0x0a91('0x72'))](_0x0a91('0x73'));}_0x5579c5=_[_0x0a91('0x74')](_[_0x0a91('0x58')](_0x2f0199),[_0x0a91('0x75'),_0x0a91('0x76')]);_0x3722fc=_['difference'](_['keys'](_0x2f0199),[_0x0a91('0x75'),_0x0a91('0x76'),'CompanyId',_0x0a91('0x77')]);if(_0x5e767f[_0x0a91('0x5b')]['id']){delete _0x5e767f[_0x0a91('0x5b')]['id'];}if(_[_0x0a91('0x78')](_0x5e767f[_0x0a91('0x5b')]['from'])){throw new db[(_0x0a91('0x79'))][(_0x0a91('0x72'))](_0x0a91('0x7a'));}if(_[_0x0a91('0x78')](_0x5e767f[_0x0a91('0x5b')][_0x0a91('0x5b')])||_0x5e767f[_0x0a91('0x5b')][_0x0a91('0x5b')]===''){throw new db['Sequelize'][(_0x0a91('0x72'))](_0x0a91('0x7b'));}if(_['isNil'](_0x5e767f[_0x0a91('0x5b')]['mapKey'])){throw new db[(_0x0a91('0x79'))][(_0x0a91('0x72'))](_0x0a91('0x7c')+_0x3722fc);}if(!_[_0x0a91('0x7d')](_0x3722fc,_0x5e767f[_0x0a91('0x5b')][_0x0a91('0x7e')])){throw new db[(_0x0a91('0x79'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3722fc);}_0x459e4c[_0x5e767f['body'][_0x0a91('0x7e')]]=_0x5e767f[_0x0a91('0x5b')][_0x0a91('0x7f')];})[_0x0a91('0x38')](function(){return db['OpenchannelAccount'][_0x0a91('0x60')]({'where':{'id':_0x5e767f['params']['id']},'include':[{'model':db[_0x0a91('0x80')],'as':'List','include':[{'model':db[_0x0a91('0x71')],'as':'Contacts','where':_0x459e4c,'limit':0x1,'order':[[_0x0a91('0x76'),_0x0a91('0x81')]]}]},{'model':db[_0x0a91('0x82')],'as':'Applications'}]});})['then'](handleEntityNotFound(_0x587e99,null))['then'](function(_0x55cc3f){if(_0x55cc3f&&_0x55cc3f['List']){_0x4f1d3e[_0x0a91('0x83')]=_0x55cc3f;_0x4f1d3e[_0x0a91('0x84')]=_0x55cc3f[_0x0a91('0x85')];_0x4f1d3e['list']=_0x55cc3f[_0x0a91('0x86')];_0x4f1d3e[_0x0a91('0x84')]=_[_0x0a91('0x87')](_0x4f1d3e[_0x0a91('0x84')],[_0x0a91('0x88')],['asc']);if(_0x4f1d3e['account'][_0x0a91('0x85')]){delete _0x4f1d3e[_0x0a91('0x83')][_0x0a91('0x85')];}if(_0x4f1d3e['account'][_0x0a91('0x86')]&&_0x4f1d3e[_0x0a91('0x83')][_0x0a91('0x86')]['Contacts'][_0x0a91('0x4a')]){return _0x4f1d3e[_0x0a91('0x83')]['List'][_0x0a91('0x89')][0x0];}var _0x294d3e=_[_0x0a91('0x1a')](_0x5e767f[_0x0a91('0x5b')],{'firstName':_0x5e767f[_0x0a91('0x5b')][_0x0a91('0x7f')],'ListId':_0x55cc3f[_0x0a91('0x77')]});_0x294d3e[_0x5e767f['body'][_0x0a91('0x7e')]]=_0x5e767f['body'][_0x0a91('0x7f')];return db['CmContact'][_0x0a91('0x5a')](_0x294d3e,{'fields':_0x5579c5,'raw':!![]});}})['then'](handleEntityNotFound(_0x587e99,null))[_0x0a91('0x38')](function(_0x2a2674){_0x4f1d3e[_0x0a91('0x8a')]=_0x2a2674;if(_0x2a2674){var _0xa75a52={'ContactId':_0x2a2674['id'],'OpenchannelAccountId':_0x5e767f[_0x0a91('0x62')]['id'],'from':(_0x2a2674[_0x0a91('0x8b')]||'')+'\x20'+(_0x2a2674[_0x0a91('0x8c')]||'')};var _0x21e8f9={'OpenchannelAccountId':_0x5e767f[_0x0a91('0x62')]['id'],'closed':![]};if(_0x5e767f[_0x0a91('0x5b')][_0x0a91('0x8d')]){_0x21e8f9[_0x0a91('0x8d')]=_0x5e767f[_0x0a91('0x5b')][_0x0a91('0x8d')];return db[_0x0a91('0x8e')][_0x0a91('0x60')]({'where':_0x21e8f9})[_0x0a91('0x38')](function(_0x10d802){if(_0x10d802){return[_0x10d802,![]];}_0xa75a52[_0x0a91('0x8d')]=_0x5e767f['body'][_0x0a91('0x8d')];_0xa75a52['externalUrl']=_0x5e767f[_0x0a91('0x5b')][_0x0a91('0x8f')];return db[_0x0a91('0x8e')][_0x0a91('0x5a')](_0xa75a52)[_0x0a91('0x38')](function(_0x4f49d6){return[_0x4f49d6,!![]];});});}else{_0x21e8f9[_0x0a91('0x8d')]=null;}_0x21e8f9[_0x0a91('0x90')]=_0x2a2674['id'];return db[_0x0a91('0x8e')][_0x0a91('0x60')]({'where':_0x21e8f9})[_0x0a91('0x38')](function(_0x357e75){if(_0x357e75){return[_0x357e75,![]];}return db[_0x0a91('0x8e')][_0x0a91('0x5a')](_0xa75a52)[_0x0a91('0x38')](function(_0x38cd44){return[_0x38cd44,!![]];});});}})[_0x0a91('0x91')](function(_0x208455,_0x55e142){if(_0x208455){_0x75cb02=_0x55e142;if(!_0x55e142){var _0x2d9ba9={'from':(_0x4f1d3e[_0x0a91('0x8a')][_0x0a91('0x8b')]||'')+'\x20'+(_0x4f1d3e[_0x0a91('0x8a')]['lastName']||'')};if(_0x5e767f[_0x0a91('0x5b')]['threadId']&&_0x5e767f[_0x0a91('0x5b')][_0x0a91('0x92')]&&_0x5e767f[_0x0a91('0x5b')][_0x0a91('0x8d')]!=_0x5e767f[_0x0a91('0x5b')][_0x0a91('0x92')]){_0x2d9ba9['threadId']=_0x5e767f[_0x0a91('0x5b')][_0x0a91('0x92')];}return _0x208455[_0x0a91('0x36')](_0x2d9ba9);}else{return _0x208455;}}})[_0x0a91('0x38')](function(_0x4d6bd8){_0x4f1d3e[_0x0a91('0x93')]=_0x4d6bd8[_0x0a91('0x5d')]({'plain':!![]});_0x4f1d3e['interaction'][_0x0a91('0x94')]=_0x75cb02;if(_0x4f1d3e[_0x0a91('0x93')][_0x0a91('0x94')]){if(_0x4f1d3e[_0x0a91('0x83')][_0x0a91('0x95')]){_0x4f1d3e[_0x0a91('0x84')][_0x0a91('0x96')]({'id':0x0,'priority':_0x4f1d3e[_0x0a91('0x84')][_0x0a91('0x4a')]+0x1,'app':_0x0a91('0x97'),'appdata':_0x0a91('0x98'),'interval':_0x0a91('0x99')});}}return db[_0x0a91('0x9a')][_0x0a91('0x5a')]({'body':_0x5e767f[_0x0a91('0x5b')]['body'],'OpenchannelAccountId':_0x5e767f[_0x0a91('0x62')]['id'],'OpenchannelInteractionId':_0x4d6bd8['id'],'direction':'in','ContactId':_0x4f1d3e['contact']['id'],'AttachmentId':_0x5e767f[_0x0a91('0x5b')]['AttachmentId']});})[_0x0a91('0x38')](function(_0x4a4c4e){_0x4f1d3e['message']=_0x4a4c4e;if(_0x4f1d3e[_0x0a91('0x93')][_0x0a91('0x9b')]){return db[_0x0a91('0x9c')]['find']({'attributes':['id',_0x0a91('0x3c')],'where':{'id':_0x4f1d3e[_0x0a91('0x93')][_0x0a91('0x9b')]}})[_0x0a91('0x38')](function(_0x2bbeff){if(_0x2bbeff){_0x4f1d3e['applications'][_0x0a91('0x9d')]({'id':0x0,'priority':0x0,'app':_0x0a91('0x9e'),'appdata':_0x2bbeff[_0x0a91('0x3c')]+','+(_0x4f1d3e[_0x0a91('0x83')]['waitForTheAssignedAgent']||0xa),'interval':_0x0a91('0x99')});_0x4f1d3e[_0x0a91('0x9f')]=![];}return respondWithRpcPromise(_0x0a91('0xa0'),'startRouting',_0x4f1d3e);});}return respondWithRpcPromise(_0x0a91('0xa0'),'startRouting',_0x4f1d3e);})[_0x0a91('0x38')](function(_0x26fd1a){respondWithRpcPromise(_0x0a91('0xa1'),_0x0a91('0xa1'),{'event':_0x0a91('0x6f'),'message':_0x26fd1a},client9002);return _0x26fd1a;})[_0x0a91('0x38')](respondWithResult(_0x587e99,null))['catch'](handleError(_0x587e99,null));};exports[_0x0a91('0xa2')]=function(_0x5d1950,_0x1b7ab0){var _0x3c9790=_0x5d1950['params']['id'];var _0x402ddb=_0x5d1950[_0x0a91('0x5b')];var _0xa2f410=0xc8;var _0x1d3e92=null;return db['sequelize']['transaction']({'isolationLevel':db[_0x0a91('0xa3')][_0x0a91('0xa4')]['ISOLATION_LEVELS'][_0x0a91('0xa5')]},function(_0x33bcb2){return db[_0x0a91('0x40')]['findOne']({'where':{'id':_0x3c9790},'transaction':_0x33bcb2})[_0x0a91('0x38')](function(_0x5117bc){if(_0x5117bc){return db[_0x0a91('0x82')][_0x0a91('0x37')]({'where':{'OpenchannelAccountId':_0x3c9790},'transaction':_0x33bcb2})[_0x0a91('0x38')](function(){var _0x19920e=_[_0x0a91('0x3f')](_0x402ddb,function(_0x4290e1){_0x4290e1[_0x0a91('0x67')]=_0x3c9790;return _0x4290e1;});return db['OpenchannelApplication'][_0x0a91('0xa6')](_0x19920e,{'transaction':_0x33bcb2});});}else{_0xa2f410=0x194;_0x1d3e92=[];}});})[_0x0a91('0x38')](function(){if(_0xa2f410!==0x194){return db['OpenchannelApplication'][_0x0a91('0xa7')]({'where':{'OpenchannelAccountId':_0x3c9790},'order':_0x0a91('0x88')})[_0x0a91('0x38')](function(_0x2d6f8a){_0x1d3e92=_0x2d6f8a;});}})[_0x0a91('0x56')](function(_0x356faa){_0xa2f410=0x1f4;logger[_0x0a91('0x27')](_0x356faa[_0x0a91('0x3b')]);if(_0x356faa[_0x0a91('0x3c')]){delete _0x356faa[_0x0a91('0x3c')];}_0x1d3e92=_0x356faa;})[_0x0a91('0xa8')](function(){if(_0x1d3e92===null){_0x1b7ab0[_0x0a91('0x2b')](_0xa2f410);}else{if(_0xa2f410===0x1f4){_0x1b7ab0[_0x0a91('0x2c')](_0xa2f410)[_0x0a91('0xa9')](_0x1d3e92);}else{_0x1b7ab0[_0x0a91('0x2c')](_0xa2f410)['json'](_0x1d3e92);}}});};exports[_0x0a91('0xaa')]=function(_0x373e71,_0x39dd74,_0x4a8ffa){var _0x58c3ce={};var _0x1c478e={};var _0xab5fcf;var _0x523b73;return db[_0x0a91('0x40')][_0x0a91('0x6b')]({'where':{'id':_0x373e71[_0x0a91('0x62')]['id']}})['then'](handleEntityNotFound(_0x39dd74,null))[_0x0a91('0x38')](function(_0x2f0773){if(_0x2f0773){_0xab5fcf=_0x2f0773;_0x1c478e[_0x0a91('0x47')]=_['keys'](db[_0x0a91('0x82')]['rawAttributes']);_0x1c478e['query']=_[_0x0a91('0x58')](_0x373e71[_0x0a91('0x45')]);_0x1c478e[_0x0a91('0x50')]=_[_0x0a91('0x46')](_0x1c478e[_0x0a91('0x47')],_0x1c478e[_0x0a91('0x45')]);_0x58c3ce[_0x0a91('0x48')]=_[_0x0a91('0x46')](_0x1c478e[_0x0a91('0x47')],qs['fields'](_0x373e71[_0x0a91('0x45')][_0x0a91('0x49')]));_0x58c3ce[_0x0a91('0x48')]=_0x58c3ce[_0x0a91('0x48')][_0x0a91('0x4a')]?_0x58c3ce['attributes']:_0x1c478e[_0x0a91('0x47')];_0x58c3ce[_0x0a91('0x4d')]=qs[_0x0a91('0x4e')](_0x373e71[_0x0a91('0x45')][_0x0a91('0x4e')]);_0x58c3ce[_0x0a91('0x4f')]=qs[_0x0a91('0x50')](_[_0x0a91('0x6d')](_0x373e71[_0x0a91('0x45')],_0x1c478e[_0x0a91('0x50')]));if(_0x373e71[_0x0a91('0x45')]['filter']){_0x58c3ce[_0x0a91('0x4f')]=_[_0x0a91('0x51')](_0x58c3ce[_0x0a91('0x4f')],{'$or':_[_0x0a91('0x3f')](_0x58c3ce[_0x0a91('0x48')],function(_0x2d8f07){var _0x435e64={};_0x435e64[_0x2d8f07]={'$like':'%'+_0x373e71[_0x0a91('0x45')][_0x0a91('0x52')]+'%'};return _0x435e64;})});}_0x58c3ce=_[_0x0a91('0x51')]({},_0x58c3ce,_0x373e71[_0x0a91('0x59')]);return _0xab5fcf[_0x0a91('0xaa')](_0x58c3ce);}})[_0x0a91('0x38')](function(_0x490561){if(_0x490561){_0x523b73=_0x490561[_0x0a91('0x4a')];if(!_0x373e71[_0x0a91('0x45')][_0x0a91('0x4b')](_0x0a91('0x4c'))){_0x58c3ce[_0x0a91('0x32')]=qs['limit'](_0x373e71[_0x0a91('0x45')]['limit']);_0x58c3ce[_0x0a91('0x2f')]=qs[_0x0a91('0x2f')](_0x373e71[_0x0a91('0x45')]['offset']);}return _0xab5fcf[_0x0a91('0xaa')](_0x58c3ce);}})[_0x0a91('0x38')](function(_0x54349e){if(_0x54349e){return _0x54349e?{'count':_0x523b73,'rows':_0x54349e}:null;}})[_0x0a91('0x38')](respondWithResult(_0x39dd74,null))['catch'](handleError(_0x39dd74,null));};exports['getInteractions']=function(_0x53d250,_0xca8da5,_0x2cd474){var _0xbf68ea={'raw':![],'where':{}};var _0x113faf={};var _0x10ac59={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x0a91('0x6b')]({'where':{'id':_0x53d250['params']['id']}})[_0x0a91('0x38')](handleEntityNotFound(_0xca8da5,null))[_0x0a91('0x38')](function(_0x50e6fa){if(_0x50e6fa){_0x113faf[_0x0a91('0x47')]=_['keys'](db[_0x0a91('0x8e')][_0x0a91('0x41')]);_0x113faf[_0x0a91('0x45')]=_[_0x0a91('0x58')](_0x53d250[_0x0a91('0x45')]);_0x113faf[_0x0a91('0x50')]=_[_0x0a91('0x46')](_0x113faf[_0x0a91('0x47')],_0x113faf[_0x0a91('0x45')]);_0xbf68ea[_0x0a91('0x48')]=_[_0x0a91('0x46')](_0x113faf[_0x0a91('0x47')],qs[_0x0a91('0x49')](_0x53d250[_0x0a91('0x45')][_0x0a91('0x49')]));_0xbf68ea['attributes']=_0xbf68ea['attributes'][_0x0a91('0x4a')]?_0xbf68ea[_0x0a91('0x48')]:_0x113faf[_0x0a91('0x47')];if(!_0x53d250['query'][_0x0a91('0x4b')]('nolimit')){_0xbf68ea[_0x0a91('0x32')]=qs['limit'](_0x53d250[_0x0a91('0x45')]['limit']);_0xbf68ea['offset']=qs['offset'](_0x53d250[_0x0a91('0x45')]['offset']);}_0xbf68ea[_0x0a91('0x4d')]=qs[_0x0a91('0x4e')](_0x53d250[_0x0a91('0x45')][_0x0a91('0x4e')]);_0xbf68ea[_0x0a91('0x4f')]=qs[_0x0a91('0x50')](_[_0x0a91('0x6d')](_0x53d250['query'],_0x113faf['filters']));_0xbf68ea[_0x0a91('0x4f')]['OpenchannelAccountId']=_0x50e6fa['id'];if(_0x53d250['query'][_0x0a91('0x52')]){_0xbf68ea[_0x0a91('0x4f')]=_['merge'](_0xbf68ea['where'],{'$or':_[_0x0a91('0x3f')](_0xbf68ea[_0x0a91('0x48')],function(_0x4befa3){var _0x5741b6={};_0x5741b6[_0x4befa3]={'$like':'%'+_0x53d250['query']['filter']+'%'};return _0x5741b6;})});}_0xbf68ea=_[_0x0a91('0x51')]({},_0xbf68ea,_0x53d250[_0x0a91('0x59')]);return db[_0x0a91('0x8e')][_0x0a91('0x31')]({'where':_0xbf68ea[_0x0a91('0x4f')]})[_0x0a91('0x38')](function(_0x54a8a9){_0x10ac59[_0x0a91('0x31')]=_0x54a8a9;if(_0x53d250[_0x0a91('0x45')]['includeAll']){_0xbf68ea[_0x0a91('0x54')]=[{'model':db[_0x0a91('0x71')],'as':_0x0a91('0xab'),'required':![]},{'model':db[_0x0a91('0x9c')],'as':_0x0a91('0xac'),'attributes':[_0x0a91('0x3c'),_0x0a91('0xad'),_0x0a91('0xae')],'required':![]},{'model':db[_0x0a91('0xaf')],'as':'Tags','attributes':['id',_0x0a91('0x3c'),_0x0a91('0xb0')],'where':_0x53d250[_0x0a91('0x45')][_0x0a91('0xb1')]?{'id':_0x53d250['query'][_0x0a91('0xb1')]}:undefined,'required':_0x53d250[_0x0a91('0x45')][_0x0a91('0xb1')]?!![]:![]}];}return db[_0x0a91('0x8e')]['findAll'](_0xbf68ea);})[_0x0a91('0x38')](function(_0x274198){_0x10ac59[_0x0a91('0x55')]=_0x274198;return _0x10ac59;});}})[_0x0a91('0x38')](respondWithFilteredResult(_0xca8da5,_0xbf68ea))[_0x0a91('0x56')](handleError(_0xca8da5,null));};exports[_0x0a91('0xb2')]=function(_0x68a5ce,_0x33fb5a,_0x1abdf6){return db[_0x0a91('0x40')][_0x0a91('0x60')]({'where':{'id':_0x68a5ce[_0x0a91('0x62')]['id']}})[_0x0a91('0x38')](handleEntityNotFound(_0x33fb5a,null))[_0x0a91('0x38')](function(_0x5ae5ef){if(_0x5ae5ef){return _0x5ae5ef[_0x0a91('0xb2')](_0x68a5ce[_0x0a91('0x5b')][_0x0a91('0xb3')],_[_0x0a91('0xb4')](_0x68a5ce['body'],[_0x0a91('0xb3'),'id'])||{})[_0x0a91('0x91')](function(_0x15a3bf){for(var _0x5cb11b=0x0;_0x5cb11b<_0x68a5ce[_0x0a91('0x5b')][_0x0a91('0xb3')][_0x0a91('0x4a')];_0x5cb11b+=0x1){socket['emit'](_0x0a91('0xb5'),{'UserId':Number(_0x68a5ce[_0x0a91('0x5b')][_0x0a91('0xb3')][_0x5cb11b]),'OpenchannelAccountId':Number(_0x68a5ce[_0x0a91('0x62')]['id'])});}return _0x15a3bf;});}})['then'](respondWithResult(_0x33fb5a,null))['catch'](handleError(_0x33fb5a,null));};exports[_0x0a91('0xb6')]=function(_0x3667ec,_0x1be1d4,_0x830be1){return db[_0x0a91('0x40')][_0x0a91('0x60')]({'where':{'id':_0x3667ec[_0x0a91('0x62')]['id']}})['then'](handleEntityNotFound(_0x1be1d4,null))[_0x0a91('0x38')](function(_0x3535ad){if(_0x3535ad){return _0x3535ad[_0x0a91('0xb6')](_0x3667ec[_0x0a91('0x45')][_0x0a91('0xb3')])[_0x0a91('0x38')](function(){if(_[_0x0a91('0xb7')](_0x3667ec[_0x0a91('0x45')][_0x0a91('0xb3')])){for(var _0x372cc6=0x0;_0x372cc6<_0x3667ec[_0x0a91('0x45')]['ids']['length'];_0x372cc6+=0x1){socket[_0x0a91('0xb8')]('userOpenchannelAccount:remove',{'UserId':Number(_0x3667ec[_0x0a91('0x45')]['ids'][_0x372cc6]),'OpenchannelAccountId':Number(_0x3667ec[_0x0a91('0x62')]['id'])});}}else{socket[_0x0a91('0xb8')](_0x0a91('0xb9'),{'UserId':Number(_0x3667ec['query'][_0x0a91('0xb3')]),'OpenchannelAccountId':Number(_0x3667ec[_0x0a91('0x62')]['id'])});}});}})[_0x0a91('0x38')](respondWithStatusCode(_0x1be1d4,null))[_0x0a91('0x56')](handleError(_0x1be1d4,null));};exports[_0x0a91('0xba')]=function(_0x43825c,_0x3ed035,_0x2970e3){var _0x496ee2={};var _0x1a4c3c={};var _0x196cd5;var _0x558d06;return db['OpenchannelAccount']['findOne']({'where':{'id':_0x43825c[_0x0a91('0x62')]['id']}})[_0x0a91('0x38')](handleEntityNotFound(_0x3ed035,null))[_0x0a91('0x38')](function(_0x22dd76){if(_0x22dd76){_0x196cd5=_0x22dd76;_0x1a4c3c[_0x0a91('0x47')]=_[_0x0a91('0x58')](db[_0x0a91('0x9c')][_0x0a91('0x41')]);_0x1a4c3c[_0x0a91('0x45')]=_['keys'](_0x43825c[_0x0a91('0x45')]);_0x1a4c3c['filters']=_[_0x0a91('0x46')](_0x1a4c3c['model'],_0x1a4c3c['query']);_0x496ee2[_0x0a91('0x48')]=_[_0x0a91('0x46')](_0x1a4c3c[_0x0a91('0x47')],qs['fields'](_0x43825c['query'][_0x0a91('0x49')]));_0x496ee2[_0x0a91('0x48')]=_0x496ee2[_0x0a91('0x48')][_0x0a91('0x4a')]?_0x496ee2[_0x0a91('0x48')]:_0x1a4c3c[_0x0a91('0x47')];_0x496ee2[_0x0a91('0x4d')]=qs[_0x0a91('0x4e')](_0x43825c['query'][_0x0a91('0x4e')]);_0x496ee2[_0x0a91('0x4f')]=qs['filters'](_[_0x0a91('0x6d')](_0x43825c[_0x0a91('0x45')],_0x1a4c3c[_0x0a91('0x50')]));if(_0x43825c[_0x0a91('0x45')][_0x0a91('0x52')]){_0x496ee2[_0x0a91('0x4f')]=_[_0x0a91('0x51')](_0x496ee2[_0x0a91('0x4f')],{'$or':_['map'](_0x496ee2[_0x0a91('0x48')],function(_0x1f7d59){var _0x4b506e={};_0x4b506e[_0x1f7d59]={'$like':'%'+_0x43825c[_0x0a91('0x45')][_0x0a91('0x52')]+'%'};return _0x4b506e;})});}_0x496ee2=_['merge']({},_0x496ee2,_0x43825c['options']);return _0x196cd5[_0x0a91('0xba')](_0x496ee2);}})[_0x0a91('0x38')](function(_0x2f117b){if(_0x2f117b){_0x558d06=_0x2f117b['length'];if(!_0x43825c['query'][_0x0a91('0x4b')](_0x0a91('0x4c'))){_0x496ee2['limit']=qs['limit'](_0x43825c[_0x0a91('0x45')]['limit']);_0x496ee2[_0x0a91('0x2f')]=qs[_0x0a91('0x2f')](_0x43825c[_0x0a91('0x45')][_0x0a91('0x2f')]);}return _0x196cd5[_0x0a91('0xba')](_0x496ee2);}})[_0x0a91('0x38')](function(_0x50975d){if(_0x50975d){return _0x50975d?{'count':_0x558d06,'rows':_0x50975d}:null;}})[_0x0a91('0x38')](respondWithResult(_0x3ed035,null))[_0x0a91('0x56')](handleError(_0x3ed035,null));};exports[_0x0a91('0xa9')]=function(_0x44fe64,_0x34ebfd,_0x18a0ab){var _0x56e213,_0x2fb4ba,_0x5401ec;if(_['isNil'](_0x44fe64[_0x0a91('0x5b')]['body'])||_0x44fe64[_0x0a91('0x5b')][_0x0a91('0x5b')]===''){throw new db[(_0x0a91('0x79'))][(_0x0a91('0x72'))](_0x0a91('0x7b'));}if(_[_0x0a91('0x78')](_0x44fe64[_0x0a91('0x5b')]['to'])){}_0x56e213=_0x44fe64[_0x0a91('0x5b')]['to'];return db[_0x0a91('0x40')]['findOne']({'where':{'id':_0x44fe64[_0x0a91('0x62')]['id']}})[_0x0a91('0x38')](handleEntityNotFound(_0x34ebfd,null))[_0x0a91('0x38')](function(_0x1d0eb3){if(_0x1d0eb3){return db[_0x0a91('0x40')][_0x0a91('0x60')]({'where':{'id':_0x1d0eb3['id']},'include':[{'model':db[_0x0a91('0x80')],'as':_0x0a91('0x86'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{[_0x1d0eb3['mapKey']]:_0x56e213},'limit':0x1,'order':[[_0x0a91('0x76'),_0x0a91('0x81')]]}]}]})[_0x0a91('0x38')](handleEntityNotFound(_0x34ebfd,null))[_0x0a91('0x38')](function(_0x331deb){if(_0x331deb&&_0x331deb[_0x0a91('0x86')]){_0x2fb4ba=_0x331deb['get']({'plain':!![]});if(_0x2fb4ba[_0x0a91('0x86')]&&_0x2fb4ba[_0x0a91('0x86')]['Contacts'][_0x0a91('0x4a')]){return _0x2fb4ba[_0x0a91('0x86')]['Contacts'][0x0];}return db[_0x0a91('0x71')][_0x0a91('0x5a')](_[_0x0a91('0x1a')](_0x44fe64[_0x0a91('0x5b')],{'firstName':_0x56e213,[_0x331deb[_0x0a91('0x7e')]]:_0x56e213,'phone':_0x56e213,'ListId':_0x2fb4ba[_0x0a91('0x77')]}));}})[_0x0a91('0x38')](handleEntityNotFound(_0x34ebfd,null))['then'](function(_0x2455e0){if(_0x2455e0){_0x5401ec=_0x2455e0;return db[_0x0a91('0x8e')][_0x0a91('0x60')]({'where':{'ContactId':_0x5401ec['id'],'closed':![],'OpenchannelAccountId':_0x2fb4ba['id']}})[_0x0a91('0x38')](function(_0x5c7b0d){if(_0x5c7b0d){return[_0x5c7b0d,![]];}return db[_0x0a91('0x8e')][_0x0a91('0x5a')]({'UserId':_0x44fe64[_0x0a91('0x5c')]['id'],'ContactId':_0x5401ec['id'],'OpenchannelAccountId':_0x2fb4ba['id'],'lastMsgDirection':_0x0a91('0xbb'),'Messages':[_[_0x0a91('0x51')](_0x44fe64['body'],{'read':![],'body':_0x44fe64[_0x0a91('0x5b')][_0x0a91('0x5b')],'OpenchannelAccountId':_0x2fb4ba['id'],'UserId':_0x44fe64[_0x0a91('0x5c')]['id'],'ContactId':_0x5401ec['id']})]},{'include':[{'model':db[_0x0a91('0x9a')],'as':_0x0a91('0xbc')}]})[_0x0a91('0x38')](function(_0x511042){return[_0x511042,!![]];});});}})[_0x0a91('0x91')](function(_0x119a03,_0x3f202b){if(_0x3f202b){return _0x119a03;}return db[_0x0a91('0x9a')][_0x0a91('0x5a')](_['merge'](_0x44fe64[_0x0a91('0x5b')],{'read':![],'body':_0x44fe64[_0x0a91('0x5b')][_0x0a91('0x5b')],'OpenchannelAccountId':_0x2fb4ba['id'],'OpenchannelInteractionId':_0x119a03['id'],'UserId':_0x44fe64[_0x0a91('0x5c')]['id'],'ContactId':_0x5401ec['id']}))[_0x0a91('0x38')](function(_0x152b49){_0x119a03[_0x0a91('0xbd')]['Messages']=[];_0x119a03['dataValues'][_0x0a91('0xbc')][_0x0a91('0x96')](_0x152b49[_0x0a91('0xbd')]);return _0x119a03;});});}})['then'](respondWithResult(_0x34ebfd,null))['catch'](handleError(_0x34ebfd,null));}; \ No newline at end of file +var _0x4f06=['dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./openchannelAccount.socket','register','jayson/promise','client','http','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','undefined','count','offset','set','json','reject','save','update','destroy','get','UserProfileResource','stack','name','send','Pause','map','OpenchannelAccount','rawAttributes','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort','where','filter','merge','VIRTUAL','options','include','findAll','catch','show','mandatoryDispositionPause','keys','length','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','pick','rows','removeDispositions','ids','CannedAnswer','removeAnswers','notify','openchannel','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','CompanyId','ListId','isNil','from','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','CmList','Contacts','DESC','List','account','applications','orderBy','priority','asc','Applications','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','spread','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','UserId','User','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','Start','EventManager','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','OpenchannelApplication','bulkCreate','findAndCountAll','finally','getApplications','order','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','OpenchannelMessage','Messages'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4f06,0xc1));var _0x64f0=function(_0x1b48b3,_0x58dabc){_0x1b48b3=_0x1b48b3-0x0;var _0x263698=_0x4f06[_0x1b48b3];return _0x263698;};'use strict';var emlformat=require(_0x64f0('0x0'));var rimraf=require(_0x64f0('0x1'));var zipdir=require(_0x64f0('0x2'));var jsonpatch=require(_0x64f0('0x3'));var rp=require(_0x64f0('0x4'));var moment=require(_0x64f0('0x5'));var BPromise=require(_0x64f0('0x6'));var Mustache=require(_0x64f0('0x7'));var util=require(_0x64f0('0x8'));var path=require('path');var sox=require(_0x64f0('0x9'));var csv=require(_0x64f0('0xa'));var ejs=require(_0x64f0('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x64f0('0xc'));var squel=require('squel');var crypto=require(_0x64f0('0xd'));var jsforce=require(_0x64f0('0xe'));var deskjs=require(_0x64f0('0xf'));var toCsv=require(_0x64f0('0xa'));var querystring=require(_0x64f0('0x10'));var Papa=require(_0x64f0('0x11'));var Redis=require(_0x64f0('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x64f0('0x13'));var hardwareService=require(_0x64f0('0x14'));var logger=require(_0x64f0('0x15'))('api');var utils=require(_0x64f0('0x16'));var config=require(_0x64f0('0x17'));var licenseUtil=require(_0x64f0('0x18'));var db=require(_0x64f0('0x19'))['db'];config[_0x64f0('0x1a')]=_[_0x64f0('0x1b')](config[_0x64f0('0x1a')],{'host':_0x64f0('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x64f0('0x1d'))[_0x64f0('0x1e')](socket);var jayson=require(_0x64f0('0x1f'));var client=jayson[_0x64f0('0x20')][_0x64f0('0x21')]({'port':0x232c});var client9002=jayson[_0x64f0('0x20')][_0x64f0('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x6448e2,_0x4c795f,_0x5c4029,_0x3d8ec3){return new BPromise(function(_0x32b544,_0xdf1e7d){var _0x2681be=_0x3d8ec3||client;return _0x2681be['request'](_0x6448e2,_0x5c4029)[_0x64f0('0x22')](function(_0x5ca655){logger[_0x64f0('0x23')](_0x64f0('0x24'),_0x4c795f,_0x64f0('0x25'));logger['debug'](_0x64f0('0x26'),_0x4c795f,'request\x20sent',JSON[_0x64f0('0x27')](_0x5ca655));if(_0x5ca655[_0x64f0('0x28')]){if(_0x5ca655['error'][_0x64f0('0x29')]===0x1f4){logger[_0x64f0('0x28')]('OpenchannelAccount,\x20%s,\x20%s',_0x4c795f,_0x5ca655[_0x64f0('0x28')][_0x64f0('0x2a')]);return _0xdf1e7d(_0x5ca655[_0x64f0('0x28')][_0x64f0('0x2a')]);}logger[_0x64f0('0x28')](_0x64f0('0x24'),_0x4c795f,_0x5ca655['error'][_0x64f0('0x2a')]);return _0x32b544(_0x5ca655[_0x64f0('0x28')][_0x64f0('0x2a')]);}else{logger['info'](_0x64f0('0x24'),_0x4c795f,_0x64f0('0x25'));_0x32b544(_0x5ca655[_0x64f0('0x2b')]['message']);}})['catch'](function(_0x34dfc6){logger[_0x64f0('0x28')](_0x64f0('0x24'),_0x4c795f,_0x34dfc6);_0xdf1e7d(_0x34dfc6);});});}function respondWithStatusCode(_0xb9311a,_0x54e9ed){_0x54e9ed=_0x54e9ed||0xcc;return function(_0x1002a4){if(_0x1002a4){return _0xb9311a[_0x64f0('0x2c')](_0x54e9ed);}return _0xb9311a[_0x64f0('0x2d')](_0x54e9ed)[_0x64f0('0x2e')]();};}function respondWithResult(_0x5ebe5f,_0x145de3){_0x145de3=_0x145de3||0xc8;return function(_0x2f238b){if(_0x2f238b){return _0x5ebe5f[_0x64f0('0x2d')](_0x145de3)['json'](_0x2f238b);}};}function respondWithFilteredResult(_0x5aa067,_0x51d888){return function(_0x5506da){if(_0x5506da){var _0x4b8a2b=typeof _0x51d888['offset']===_0x64f0('0x2f')&&typeof _0x51d888['limit']==='undefined';var _0xf191c3=_0x5506da[_0x64f0('0x30')];var _0x21dc74=_0x4b8a2b?0x0:_0x51d888[_0x64f0('0x31')];var _0x241b5b=_0x4b8a2b?_0x5506da[_0x64f0('0x30')]:_0x51d888[_0x64f0('0x31')]+_0x51d888['limit'];var _0x2c83f4;if(_0x241b5b>=_0xf191c3){_0x241b5b=_0xf191c3;_0x2c83f4=0xc8;}else{_0x2c83f4=0xce;}_0x5aa067[_0x64f0('0x2d')](_0x2c83f4);return _0x5aa067[_0x64f0('0x32')]('Content-Range',_0x21dc74+'-'+_0x241b5b+'/'+_0xf191c3)[_0x64f0('0x33')](_0x5506da);}return null;};}function patchUpdates(_0x423d1c){return function(_0x33d81c){try{jsonpatch['apply'](_0x33d81c,_0x423d1c,!![]);}catch(_0x362a90){return BPromise[_0x64f0('0x34')](_0x362a90);}return _0x33d81c[_0x64f0('0x35')]();};}function saveUpdates(_0x3890c4,_0x3b2485){return function(_0x160786){if(_0x160786){return _0x160786[_0x64f0('0x36')](_0x3890c4)[_0x64f0('0x22')](function(_0x2fcd32){return _0x2fcd32;});}return null;};}function removeEntity(_0x3a637f,_0x3c79be){return function(_0x69928f){if(_0x69928f){return _0x69928f[_0x64f0('0x37')]()[_0x64f0('0x22')](function(){var _0x25491f=_0x69928f[_0x64f0('0x38')]({'plain':!![]});var _0x47539d='OpenchannelAccounts';return db[_0x64f0('0x39')]['destroy']({'where':{'type':_0x47539d,'resourceId':_0x25491f['id']}})[_0x64f0('0x22')](function(){return _0x69928f;});})[_0x64f0('0x22')](function(){_0x3a637f[_0x64f0('0x2d')](0xcc)[_0x64f0('0x2e')]();});}};}function handleEntityNotFound(_0x5c3ee2,_0x5d9e3f){return function(_0x1d6742){if(!_0x1d6742){_0x5c3ee2[_0x64f0('0x2c')](0x194);}return _0x1d6742;};}function handleError(_0x273d92,_0x2fcf36){_0x2fcf36=_0x2fcf36||0x1f4;return function(_0x40b889){logger[_0x64f0('0x28')](_0x40b889[_0x64f0('0x3a')]);if(_0x40b889[_0x64f0('0x3b')]){delete _0x40b889[_0x64f0('0x3b')];}_0x273d92[_0x64f0('0x2d')](_0x2fcf36)[_0x64f0('0x3c')](_0x40b889);};}exports['index']=function(_0x179219,_0x28a7a3){var _0x1047fd={'include':[{'model':db[_0x64f0('0x3d')],'as':'mandatoryDispositionPause'}]},_0x4e75cc={},_0x194e90={'count':0x0,'rows':[]};var _0x2be8c3=_[_0x64f0('0x3e')](db[_0x64f0('0x3f')][_0x64f0('0x40')],function(_0x552543){return{'name':_0x552543['fieldName'],'type':_0x552543[_0x64f0('0x41')]['key']};});_0x4e75cc[_0x64f0('0x42')]=_[_0x64f0('0x3e')](_0x2be8c3,_0x64f0('0x3b'));_0x4e75cc[_0x64f0('0x43')]=_['keys'](_0x179219[_0x64f0('0x43')]);_0x4e75cc[_0x64f0('0x44')]=_[_0x64f0('0x45')](_0x4e75cc[_0x64f0('0x42')],_0x4e75cc[_0x64f0('0x43')]);_0x1047fd[_0x64f0('0x46')]=_[_0x64f0('0x45')](_0x4e75cc['model'],qs[_0x64f0('0x47')](_0x179219['query'][_0x64f0('0x47')]));_0x1047fd[_0x64f0('0x46')]=_0x1047fd[_0x64f0('0x46')]['length']?_0x1047fd[_0x64f0('0x46')]:_0x4e75cc[_0x64f0('0x42')];if(!_0x179219[_0x64f0('0x43')][_0x64f0('0x48')](_0x64f0('0x49'))){_0x1047fd['limit']=qs[_0x64f0('0x4a')](_0x179219[_0x64f0('0x43')][_0x64f0('0x4a')]);_0x1047fd[_0x64f0('0x31')]=qs[_0x64f0('0x31')](_0x179219[_0x64f0('0x43')][_0x64f0('0x31')]);}_0x1047fd['order']=qs[_0x64f0('0x4b')](_0x179219[_0x64f0('0x43')][_0x64f0('0x4b')]);_0x1047fd[_0x64f0('0x4c')]=qs[_0x64f0('0x44')](_['pick'](_0x179219[_0x64f0('0x43')],_0x4e75cc[_0x64f0('0x44')]),_0x2be8c3);if(_0x179219[_0x64f0('0x43')][_0x64f0('0x4d')]){_0x1047fd[_0x64f0('0x4c')]=_[_0x64f0('0x4e')](_0x1047fd[_0x64f0('0x4c')],{'$or':_[_0x64f0('0x3e')](_0x2be8c3,function(_0x352319){if(_0x352319[_0x64f0('0x41')]!==_0x64f0('0x4f')){var _0x3ba530={};_0x3ba530[_0x352319[_0x64f0('0x3b')]]={'$like':'%'+_0x179219[_0x64f0('0x43')][_0x64f0('0x4d')]+'%'};return _0x3ba530;}})});}_0x1047fd=_[_0x64f0('0x4e')]({},_0x1047fd,_0x179219[_0x64f0('0x50')]);var _0xaf3c93={'where':_0x1047fd[_0x64f0('0x4c')]};return db[_0x64f0('0x3f')][_0x64f0('0x30')](_0xaf3c93)[_0x64f0('0x22')](function(_0x5d35a7){_0x194e90['count']=_0x5d35a7;if(_0x179219[_0x64f0('0x43')]['includeAll']){_0x1047fd[_0x64f0('0x51')]=[{'all':!![]}];}return db[_0x64f0('0x3f')][_0x64f0('0x52')](_0x1047fd);})[_0x64f0('0x22')](function(_0x5f59e9){_0x194e90['rows']=_0x5f59e9;return _0x194e90;})[_0x64f0('0x22')](respondWithFilteredResult(_0x28a7a3,_0x1047fd))[_0x64f0('0x53')](handleError(_0x28a7a3,null));};exports[_0x64f0('0x54')]=function(_0x3ffa40,_0x233eb5){var _0x34aeed={'raw':![],'where':{'id':_0x3ffa40['params']['id']},'include':[{'model':db[_0x64f0('0x3d')],'as':_0x64f0('0x55')}]},_0x19e28a={};_0x19e28a['model']=_[_0x64f0('0x56')](db[_0x64f0('0x3f')][_0x64f0('0x40')]);_0x19e28a['query']=_['keys'](_0x3ffa40[_0x64f0('0x43')]);_0x19e28a[_0x64f0('0x44')]=_[_0x64f0('0x45')](_0x19e28a['model'],_0x19e28a[_0x64f0('0x43')]);_0x34aeed[_0x64f0('0x46')]=_['intersection'](_0x19e28a[_0x64f0('0x42')],qs['fields'](_0x3ffa40[_0x64f0('0x43')][_0x64f0('0x47')]));_0x34aeed['attributes']=_0x34aeed['attributes'][_0x64f0('0x57')]?_0x34aeed[_0x64f0('0x46')]:_0x19e28a[_0x64f0('0x42')];if(_0x3ffa40[_0x64f0('0x43')][_0x64f0('0x58')]){_0x34aeed['include']=[{'all':!![]}];}_0x34aeed=_[_0x64f0('0x4e')]({},_0x34aeed,_0x3ffa40[_0x64f0('0x50')]);return db[_0x64f0('0x3f')][_0x64f0('0x59')](_0x34aeed)[_0x64f0('0x22')](handleEntityNotFound(_0x233eb5,null))[_0x64f0('0x22')](respondWithResult(_0x233eb5,null))[_0x64f0('0x53')](handleError(_0x233eb5,null));};exports[_0x64f0('0x5a')]=function(_0x2b57a7,_0x4d8fc0){return db[_0x64f0('0x3f')]['create'](_0x2b57a7['body'],{})[_0x64f0('0x22')](function(_0x168f2b){var _0x24def1=_0x2b57a7[_0x64f0('0x5b')][_0x64f0('0x38')]({'plain':!![]});if(!_0x24def1)throw new Error(_0x64f0('0x5c'));if(_0x24def1[_0x64f0('0x5d')]===_0x64f0('0x5b')){var _0x4dbf6e=_0x168f2b[_0x64f0('0x38')]({'plain':!![]});var _0x3ad923='OpenchannelAccounts';return db['UserProfileSection'][_0x64f0('0x59')]({'where':{'name':_0x3ad923,'userProfileId':_0x24def1[_0x64f0('0x5e')]},'raw':!![]})['then'](function(_0x278248){if(_0x278248&&_0x278248[_0x64f0('0x5f')]===0x0){return db[_0x64f0('0x39')][_0x64f0('0x5a')]({'name':_0x4dbf6e[_0x64f0('0x3b')],'resourceId':_0x4dbf6e['id'],'type':_0x278248[_0x64f0('0x3b')],'sectionId':_0x278248['id']},{})[_0x64f0('0x22')](function(){return _0x168f2b;});}else{return _0x168f2b;}})['catch'](function(_0x20c11f){logger[_0x64f0('0x28')](_0x64f0('0x60'),_0x20c11f);throw _0x20c11f;});}return _0x168f2b;})[_0x64f0('0x22')](respondWithResult(_0x4d8fc0,0xc9))[_0x64f0('0x53')](handleError(_0x4d8fc0,null));};exports[_0x64f0('0x36')]=function(_0x30af2b,_0x1856d0){if(_0x30af2b[_0x64f0('0x61')]['id']){delete _0x30af2b[_0x64f0('0x61')]['id'];}return db['OpenchannelAccount'][_0x64f0('0x59')]({'where':{'id':_0x30af2b[_0x64f0('0x62')]['id']},'include':[{'model':db['Pause'],'as':_0x64f0('0x55')}]})['then'](handleEntityNotFound(_0x1856d0,null))[_0x64f0('0x22')](saveUpdates(_0x30af2b[_0x64f0('0x61')],null))[_0x64f0('0x22')](respondWithResult(_0x1856d0,null))['catch'](handleError(_0x1856d0,null));};exports[_0x64f0('0x37')]=function(_0x2e3879,_0x1917d0){return db[_0x64f0('0x3f')][_0x64f0('0x59')]({'where':{'id':_0x2e3879['params']['id']}})[_0x64f0('0x22')](handleEntityNotFound(_0x1917d0,null))[_0x64f0('0x22')](removeEntity(_0x1917d0,null))[_0x64f0('0x53')](handleError(_0x1917d0,null));};exports[_0x64f0('0x63')]=function(_0x3e81af,_0x2161b7){return db['OpenchannelAccount'][_0x64f0('0x63')]()['then'](respondWithResult(_0x2161b7,null))[_0x64f0('0x53')](handleError(_0x2161b7,null));};exports[_0x64f0('0x64')]=function(_0x4d0431,_0x24e193,_0x39103e){if(_0x4d0431[_0x64f0('0x61')]['id']){delete _0x4d0431[_0x64f0('0x61')]['id'];}return db[_0x64f0('0x3f')][_0x64f0('0x59')]({'where':{'id':_0x4d0431[_0x64f0('0x62')]['id']}})['then'](handleEntityNotFound(_0x24e193,null))[_0x64f0('0x22')](function(_0x38852d){if(_0x38852d){_0x4d0431[_0x64f0('0x61')][_0x64f0('0x65')]=_0x38852d['id'];return db[_0x64f0('0x66')][_0x64f0('0x5a')](_0x4d0431[_0x64f0('0x61')]);}})[_0x64f0('0x22')](respondWithResult(_0x24e193,null))[_0x64f0('0x53')](handleError(_0x24e193,null));};exports[_0x64f0('0x67')]=function(_0x1f1761,_0x5f0c4a,_0x2fff17){var _0x2a1f1f={'raw':![],'where':{}};var _0x57b418={};var _0x985e18={'count':0x0,'rows':[]};return db[_0x64f0('0x3f')][_0x64f0('0x68')]({'where':{'id':_0x1f1761[_0x64f0('0x62')]['id']}})['then'](handleEntityNotFound(_0x5f0c4a,null))[_0x64f0('0x22')](function(_0x3fae60){if(_0x3fae60){_0x57b418[_0x64f0('0x42')]=_[_0x64f0('0x56')](db['Disposition'][_0x64f0('0x40')]);_0x57b418[_0x64f0('0x43')]=_[_0x64f0('0x56')](_0x1f1761['query']);_0x57b418[_0x64f0('0x44')]=_[_0x64f0('0x45')](_0x57b418[_0x64f0('0x42')],_0x57b418[_0x64f0('0x43')]);_0x2a1f1f['attributes']=_[_0x64f0('0x45')](_0x57b418[_0x64f0('0x42')],qs[_0x64f0('0x47')](_0x1f1761['query'][_0x64f0('0x47')]));_0x2a1f1f[_0x64f0('0x46')]=_0x2a1f1f[_0x64f0('0x46')][_0x64f0('0x57')]?_0x2a1f1f[_0x64f0('0x46')]:_0x57b418[_0x64f0('0x42')];if(!_0x1f1761['query'][_0x64f0('0x48')](_0x64f0('0x49'))){_0x2a1f1f[_0x64f0('0x4a')]=qs[_0x64f0('0x4a')](_0x1f1761[_0x64f0('0x43')]['limit']);_0x2a1f1f[_0x64f0('0x31')]=qs[_0x64f0('0x31')](_0x1f1761[_0x64f0('0x43')][_0x64f0('0x31')]);}_0x2a1f1f['order']=qs[_0x64f0('0x4b')](_0x1f1761[_0x64f0('0x43')]['sort']);_0x2a1f1f[_0x64f0('0x4c')]=qs[_0x64f0('0x44')](_[_0x64f0('0x69')](_0x1f1761[_0x64f0('0x43')],_0x57b418[_0x64f0('0x44')]));_0x2a1f1f['where'][_0x64f0('0x65')]=_0x3fae60['id'];if(_0x1f1761[_0x64f0('0x43')][_0x64f0('0x4d')]){_0x2a1f1f[_0x64f0('0x4c')]=_[_0x64f0('0x4e')](_0x2a1f1f[_0x64f0('0x4c')],{'$or':_['map'](_0x2a1f1f[_0x64f0('0x46')],function(_0x125fc6){var _0x1cbe44={};_0x1cbe44[_0x125fc6]={'$like':'%'+_0x1f1761[_0x64f0('0x43')]['filter']+'%'};return _0x1cbe44;})});}_0x2a1f1f=_[_0x64f0('0x4e')]({},_0x2a1f1f,_0x1f1761['options']);return db['Disposition']['count']({'where':_0x2a1f1f[_0x64f0('0x4c')]})['then'](function(_0x2b8203){_0x985e18[_0x64f0('0x30')]=_0x2b8203;if(_0x1f1761[_0x64f0('0x43')][_0x64f0('0x58')]){_0x2a1f1f[_0x64f0('0x51')]=[{'all':!![]}];}return db['Disposition'][_0x64f0('0x52')](_0x2a1f1f);})[_0x64f0('0x22')](function(_0x5ba514){_0x985e18[_0x64f0('0x6a')]=_0x5ba514;return _0x985e18;});}})[_0x64f0('0x22')](respondWithFilteredResult(_0x5f0c4a,_0x2a1f1f))[_0x64f0('0x53')](handleError(_0x5f0c4a,null));};exports['removeDispositions']=function(_0x3fa069,_0x4ff0aa,_0xc28a0d){return db['OpenchannelAccount'][_0x64f0('0x59')]({'where':{'id':_0x3fa069[_0x64f0('0x62')]['id']}})['then'](handleEntityNotFound(_0x4ff0aa,null))[_0x64f0('0x22')](function(_0x32ba1b){if(_0x32ba1b){return _0x32ba1b[_0x64f0('0x6b')](_0x3fa069[_0x64f0('0x43')][_0x64f0('0x6c')]);}})[_0x64f0('0x22')](respondWithStatusCode(_0x4ff0aa,null))['catch'](handleError(_0x4ff0aa,null));};exports['addAnswer']=function(_0x51c316,_0xa3bd6f,_0x5dcf43){if(_0x51c316[_0x64f0('0x61')]['id']){delete _0x51c316[_0x64f0('0x61')]['id'];}return db[_0x64f0('0x3f')]['find']({'where':{'id':_0x51c316['params']['id']}})[_0x64f0('0x22')](handleEntityNotFound(_0xa3bd6f,null))['then'](function(_0x1ebb70){if(_0x1ebb70){_0x51c316[_0x64f0('0x61')][_0x64f0('0x65')]=_0x1ebb70['id'];return db[_0x64f0('0x6d')][_0x64f0('0x5a')](_0x51c316[_0x64f0('0x61')]);}})['then'](respondWithResult(_0xa3bd6f,null))[_0x64f0('0x53')](handleError(_0xa3bd6f,null));};exports['getAnswers']=function(_0xbebe12,_0x4ba6d6,_0x128dda){var _0x1bc6ce={'raw':![],'where':{}};var _0x371d0c={};var _0x4a7644={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x64f0('0x68')]({'where':{'id':_0xbebe12[_0x64f0('0x62')]['id']}})[_0x64f0('0x22')](handleEntityNotFound(_0x4ba6d6,null))['then'](function(_0xf7e89c){if(_0xf7e89c){_0x371d0c['model']=_[_0x64f0('0x56')](db[_0x64f0('0x6d')][_0x64f0('0x40')]);_0x371d0c[_0x64f0('0x43')]=_[_0x64f0('0x56')](_0xbebe12['query']);_0x371d0c['filters']=_['intersection'](_0x371d0c[_0x64f0('0x42')],_0x371d0c[_0x64f0('0x43')]);_0x1bc6ce[_0x64f0('0x46')]=_[_0x64f0('0x45')](_0x371d0c[_0x64f0('0x42')],qs[_0x64f0('0x47')](_0xbebe12[_0x64f0('0x43')][_0x64f0('0x47')]));_0x1bc6ce[_0x64f0('0x46')]=_0x1bc6ce['attributes'][_0x64f0('0x57')]?_0x1bc6ce[_0x64f0('0x46')]:_0x371d0c[_0x64f0('0x42')];if(!_0xbebe12['query'][_0x64f0('0x48')](_0x64f0('0x49'))){_0x1bc6ce['limit']=qs[_0x64f0('0x4a')](_0xbebe12['query'][_0x64f0('0x4a')]);_0x1bc6ce[_0x64f0('0x31')]=qs[_0x64f0('0x31')](_0xbebe12['query'][_0x64f0('0x31')]);}_0x1bc6ce['order']=qs['sort'](_0xbebe12[_0x64f0('0x43')][_0x64f0('0x4b')]);_0x1bc6ce[_0x64f0('0x4c')]=qs['filters'](_[_0x64f0('0x69')](_0xbebe12[_0x64f0('0x43')],_0x371d0c[_0x64f0('0x44')]));_0x1bc6ce[_0x64f0('0x4c')][_0x64f0('0x65')]=_0xf7e89c['id'];if(_0xbebe12[_0x64f0('0x43')]['filter']){_0x1bc6ce[_0x64f0('0x4c')]=_[_0x64f0('0x4e')](_0x1bc6ce[_0x64f0('0x4c')],{'$or':_[_0x64f0('0x3e')](_0x1bc6ce[_0x64f0('0x46')],function(_0x207c1c){var _0x196653={};_0x196653[_0x207c1c]={'$like':'%'+_0xbebe12[_0x64f0('0x43')]['filter']+'%'};return _0x196653;})});}_0x1bc6ce=_[_0x64f0('0x4e')]({},_0x1bc6ce,_0xbebe12['options']);return db[_0x64f0('0x6d')][_0x64f0('0x30')]({'where':_0x1bc6ce[_0x64f0('0x4c')]})['then'](function(_0x4cdd88){_0x4a7644[_0x64f0('0x30')]=_0x4cdd88;if(_0xbebe12[_0x64f0('0x43')]['includeAll']){_0x1bc6ce[_0x64f0('0x51')]=[{'all':!![]}];}return db['CannedAnswer'][_0x64f0('0x52')](_0x1bc6ce);})[_0x64f0('0x22')](function(_0x45fd85){_0x4a7644['rows']=_0x45fd85;return _0x4a7644;});}})[_0x64f0('0x22')](respondWithFilteredResult(_0x4ba6d6,_0x1bc6ce))[_0x64f0('0x53')](handleError(_0x4ba6d6,null));};exports[_0x64f0('0x6e')]=function(_0x553790,_0x5ab319,_0x16dcb2){return db[_0x64f0('0x3f')]['find']({'where':{'id':_0x553790[_0x64f0('0x62')]['id']}})[_0x64f0('0x22')](handleEntityNotFound(_0x5ab319,null))[_0x64f0('0x22')](function(_0x1e2ed5){if(_0x1e2ed5){return _0x1e2ed5[_0x64f0('0x6e')](_0x553790[_0x64f0('0x43')][_0x64f0('0x6c')]);}})['then'](respondWithStatusCode(_0x5ab319,null))[_0x64f0('0x53')](handleError(_0x5ab319,null));};exports[_0x64f0('0x6f')]=function(_0x59ef92,_0x5538e2,_0x141c17){var _0xee8bc8={'body':_0x59ef92[_0x64f0('0x61')],'channel':_0x64f0('0x70')};var _0x26fd9f=[];var _0x1b153b=[];var _0x1a4882={};var _0x57238e=![];return db[_0x64f0('0x71')][_0x64f0('0x63')]()[_0x64f0('0x22')](function(_0x42404b){if(!_0x42404b){throw new db['Sequelize'][(_0x64f0('0x72'))](_0x64f0('0x73'));}_0x26fd9f=_[_0x64f0('0x74')](_[_0x64f0('0x56')](_0x42404b),[_0x64f0('0x75'),'updatedAt']);_0x1b153b=_[_0x64f0('0x74')](_['keys'](_0x42404b),[_0x64f0('0x75'),'updatedAt',_0x64f0('0x76'),_0x64f0('0x77')]);if(_0x59ef92[_0x64f0('0x61')]['id']){delete _0x59ef92[_0x64f0('0x61')]['id'];}if(_[_0x64f0('0x78')](_0x59ef92[_0x64f0('0x61')][_0x64f0('0x79')])){throw new db['Sequelize'][(_0x64f0('0x72'))]('from\x20is\x20mandatory');}if(_[_0x64f0('0x78')](_0x59ef92['body']['body'])||_0x59ef92[_0x64f0('0x61')][_0x64f0('0x61')]===''){throw new db[(_0x64f0('0x7a'))][(_0x64f0('0x72'))](_0x64f0('0x7b'));}if(_[_0x64f0('0x78')](_0x59ef92['body'][_0x64f0('0x7c')])){throw new db[(_0x64f0('0x7a'))][(_0x64f0('0x72'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1b153b);}if(!_[_0x64f0('0x7d')](_0x1b153b,_0x59ef92[_0x64f0('0x61')][_0x64f0('0x7c')])){throw new db['Sequelize']['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1b153b);}_0x1a4882[_0x59ef92[_0x64f0('0x61')][_0x64f0('0x7c')]]=_0x59ef92[_0x64f0('0x61')][_0x64f0('0x79')];})[_0x64f0('0x22')](function(){return db[_0x64f0('0x3f')][_0x64f0('0x59')]({'where':{'id':_0x59ef92[_0x64f0('0x62')]['id']},'include':[{'model':db[_0x64f0('0x7e')],'as':'List','include':[{'model':db[_0x64f0('0x71')],'as':_0x64f0('0x7f'),'where':_0x1a4882,'limit':0x1,'order':[['updatedAt',_0x64f0('0x80')]]}]},{'model':db['OpenchannelApplication'],'as':'Applications'}]});})['then'](handleEntityNotFound(_0x5538e2,null))[_0x64f0('0x22')](function(_0x5cb237){if(_0x5cb237&&_0x5cb237[_0x64f0('0x81')]){_0xee8bc8[_0x64f0('0x82')]=_0x5cb237;_0xee8bc8[_0x64f0('0x83')]=_0x5cb237['Applications'];_0xee8bc8['list']=_0x5cb237['List'];_0xee8bc8[_0x64f0('0x83')]=_[_0x64f0('0x84')](_0xee8bc8[_0x64f0('0x83')],[_0x64f0('0x85')],[_0x64f0('0x86')]);if(_0xee8bc8['account'][_0x64f0('0x87')]){delete _0xee8bc8['account'][_0x64f0('0x87')];}if(_0xee8bc8['account'][_0x64f0('0x81')]&&_0xee8bc8[_0x64f0('0x82')][_0x64f0('0x81')][_0x64f0('0x7f')]['length']){return _0xee8bc8[_0x64f0('0x82')]['List'][_0x64f0('0x7f')][0x0];}var _0x12ee1d=_['defaults'](_0x59ef92[_0x64f0('0x61')],{'firstName':_0x59ef92[_0x64f0('0x61')][_0x64f0('0x79')],'ListId':_0x5cb237['ListId']});_0x12ee1d[_0x59ef92[_0x64f0('0x61')][_0x64f0('0x7c')]]=_0x59ef92['body']['from'];return db['CmContact'][_0x64f0('0x5a')](_0x12ee1d,{'fields':_0x26fd9f,'raw':!![]});}})[_0x64f0('0x22')](handleEntityNotFound(_0x5538e2,null))[_0x64f0('0x22')](function(_0xf8e36c){_0xee8bc8[_0x64f0('0x88')]=_0xf8e36c;if(_0xf8e36c){var _0x67b707={'ContactId':_0xf8e36c['id'],'OpenchannelAccountId':_0x59ef92[_0x64f0('0x62')]['id'],'from':(_0xf8e36c[_0x64f0('0x89')]||'')+'\x20'+(_0xf8e36c[_0x64f0('0x8a')]||'')};var _0x599785={'OpenchannelAccountId':_0x59ef92[_0x64f0('0x62')]['id'],'closed':![]};if(_0x59ef92[_0x64f0('0x61')]['threadId']){_0x599785['threadId']=_0x59ef92[_0x64f0('0x61')][_0x64f0('0x8b')];return db[_0x64f0('0x8c')]['find']({'where':_0x599785})[_0x64f0('0x22')](function(_0x49fbd0){if(_0x49fbd0){return[_0x49fbd0,![]];}_0x67b707[_0x64f0('0x8b')]=_0x59ef92['body'][_0x64f0('0x8b')];_0x67b707[_0x64f0('0x8d')]=_0x59ef92['body'][_0x64f0('0x8d')];return db['OpenchannelInteraction']['create'](_0x67b707)[_0x64f0('0x22')](function(_0x395c23){return[_0x395c23,!![]];});});}else{_0x599785['threadId']=null;}_0x599785['ContactId']=_0xf8e36c['id'];return db[_0x64f0('0x8c')][_0x64f0('0x59')]({'where':_0x599785})['then'](function(_0x376171){if(_0x376171){return[_0x376171,![]];}return db[_0x64f0('0x8c')][_0x64f0('0x5a')](_0x67b707)['then'](function(_0x654df8){return[_0x654df8,!![]];});});}})[_0x64f0('0x8e')](function(_0x4c90c9,_0xcfcac1){if(_0x4c90c9){_0x57238e=_0xcfcac1;if(!_0xcfcac1){var _0x30a218={'from':(_0xee8bc8[_0x64f0('0x88')][_0x64f0('0x89')]||'')+'\x20'+(_0xee8bc8['contact'][_0x64f0('0x8a')]||'')};if(_0x59ef92['body'][_0x64f0('0x8b')]&&_0x59ef92['body'][_0x64f0('0x8f')]&&_0x59ef92[_0x64f0('0x61')][_0x64f0('0x8b')]!=_0x59ef92[_0x64f0('0x61')][_0x64f0('0x8f')]){_0x30a218['threadId']=_0x59ef92[_0x64f0('0x61')][_0x64f0('0x8f')];}return _0x4c90c9['update'](_0x30a218);}else{return _0x4c90c9;}}})[_0x64f0('0x22')](function(_0x571d13){_0xee8bc8[_0x64f0('0x90')]=_0x571d13[_0x64f0('0x38')]({'plain':!![]});_0xee8bc8[_0x64f0('0x90')][_0x64f0('0x91')]=_0x57238e;if(_0xee8bc8['interaction']['created']){if(_0xee8bc8[_0x64f0('0x82')][_0x64f0('0x92')]){_0xee8bc8[_0x64f0('0x83')][_0x64f0('0x93')]({'id':0x0,'priority':_0xee8bc8[_0x64f0('0x83')][_0x64f0('0x57')]+0x1,'app':_0x64f0('0x94'),'appdata':_0x64f0('0x95'),'interval':_0x64f0('0x96')});}}return db['OpenchannelMessage'][_0x64f0('0x5a')]({'body':_0x59ef92[_0x64f0('0x61')][_0x64f0('0x61')],'OpenchannelAccountId':_0x59ef92['params']['id'],'OpenchannelInteractionId':_0x571d13['id'],'direction':'in','ContactId':_0xee8bc8[_0x64f0('0x88')]['id'],'AttachmentId':_0x59ef92['body']['AttachmentId']});})[_0x64f0('0x22')](function(_0x30b674){_0xee8bc8[_0x64f0('0x2a')]=_0x30b674;if(_0xee8bc8['interaction'][_0x64f0('0x97')]){return db[_0x64f0('0x98')][_0x64f0('0x59')]({'attributes':['id',_0x64f0('0x3b')],'where':{'id':_0xee8bc8[_0x64f0('0x90')][_0x64f0('0x97')]}})[_0x64f0('0x22')](function(_0x59fc57){if(_0x59fc57){_0xee8bc8[_0x64f0('0x83')]['unshift']({'id':0x0,'priority':0x0,'app':_0x64f0('0x99'),'appdata':_0x59fc57[_0x64f0('0x3b')]+','+(_0xee8bc8[_0x64f0('0x82')][_0x64f0('0x9a')]||0xa),'interval':'*,*,*,*'});_0xee8bc8[_0x64f0('0x9b')]=![];}return respondWithRpcPromise('Start',_0x64f0('0x9c'),_0xee8bc8);});}return respondWithRpcPromise(_0x64f0('0x9d'),'startRouting',_0xee8bc8);})[_0x64f0('0x22')](function(_0xabe0be){respondWithRpcPromise(_0x64f0('0x9e'),_0x64f0('0x9e'),{'event':'notify','message':_0xabe0be},client9002);return _0xabe0be;})[_0x64f0('0x22')](respondWithResult(_0x5538e2,null))[_0x64f0('0x53')](handleError(_0x5538e2,null));};exports[_0x64f0('0x9f')]=function(_0x2cf622,_0x3b2334){var _0xbfee57=_0x2cf622[_0x64f0('0x62')]['id'];var _0x3131ca=_0x2cf622[_0x64f0('0x61')];var _0x45866f=0xc8;var _0x3bbbb7=null;return db['sequelize'][_0x64f0('0xa0')]({'isolationLevel':db[_0x64f0('0xa1')][_0x64f0('0xa2')][_0x64f0('0xa3')][_0x64f0('0xa4')]},function(_0x4db54f){return db[_0x64f0('0x3f')]['findOne']({'where':{'id':_0xbfee57},'transaction':_0x4db54f})['then'](function(_0x44496d){if(_0x44496d){return db[_0x64f0('0xa5')][_0x64f0('0x37')]({'where':{'OpenchannelAccountId':_0xbfee57},'transaction':_0x4db54f})['then'](function(){var _0x566ddf=_['map'](_0x3131ca,function(_0x5bb16a){_0x5bb16a[_0x64f0('0x65')]=_0xbfee57;return _0x5bb16a;});return db[_0x64f0('0xa5')][_0x64f0('0xa6')](_0x566ddf,{'transaction':_0x4db54f});});}else{_0x45866f=0x194;_0x3bbbb7=[];}});})[_0x64f0('0x22')](function(){if(_0x45866f!==0x194){return db[_0x64f0('0xa5')][_0x64f0('0xa7')]({'where':{'OpenchannelAccountId':_0xbfee57},'order':_0x64f0('0x85')})[_0x64f0('0x22')](function(_0x13587c){_0x3bbbb7=_0x13587c;});}})[_0x64f0('0x53')](function(_0x1bb29e){_0x45866f=0x1f4;logger[_0x64f0('0x28')](_0x1bb29e[_0x64f0('0x3a')]);if(_0x1bb29e['name']){delete _0x1bb29e[_0x64f0('0x3b')];}_0x3bbbb7=_0x1bb29e;})[_0x64f0('0xa8')](function(){if(_0x3bbbb7===null){_0x3b2334['sendStatus'](_0x45866f);}else{if(_0x45866f===0x1f4){_0x3b2334[_0x64f0('0x2d')](_0x45866f)[_0x64f0('0x3c')](_0x3bbbb7);}else{_0x3b2334[_0x64f0('0x2d')](_0x45866f)[_0x64f0('0x33')](_0x3bbbb7);}}});};exports[_0x64f0('0xa9')]=function(_0x4ce93e,_0x18f031,_0x56f463){var _0x9150cc={};var _0x96d392={};var _0x5dcf15;var _0x111fbd;return db[_0x64f0('0x3f')][_0x64f0('0x68')]({'where':{'id':_0x4ce93e[_0x64f0('0x62')]['id']}})[_0x64f0('0x22')](handleEntityNotFound(_0x18f031,null))[_0x64f0('0x22')](function(_0x278223){if(_0x278223){_0x5dcf15=_0x278223;_0x96d392[_0x64f0('0x42')]=_[_0x64f0('0x56')](db[_0x64f0('0xa5')][_0x64f0('0x40')]);_0x96d392[_0x64f0('0x43')]=_['keys'](_0x4ce93e['query']);_0x96d392[_0x64f0('0x44')]=_['intersection'](_0x96d392[_0x64f0('0x42')],_0x96d392[_0x64f0('0x43')]);_0x9150cc[_0x64f0('0x46')]=_[_0x64f0('0x45')](_0x96d392[_0x64f0('0x42')],qs[_0x64f0('0x47')](_0x4ce93e[_0x64f0('0x43')][_0x64f0('0x47')]));_0x9150cc[_0x64f0('0x46')]=_0x9150cc['attributes'][_0x64f0('0x57')]?_0x9150cc[_0x64f0('0x46')]:_0x96d392['model'];_0x9150cc[_0x64f0('0xaa')]=qs[_0x64f0('0x4b')](_0x4ce93e[_0x64f0('0x43')]['sort']);_0x9150cc[_0x64f0('0x4c')]=qs['filters'](_[_0x64f0('0x69')](_0x4ce93e['query'],_0x96d392['filters']));if(_0x4ce93e['query']['filter']){_0x9150cc[_0x64f0('0x4c')]=_[_0x64f0('0x4e')](_0x9150cc['where'],{'$or':_[_0x64f0('0x3e')](_0x9150cc[_0x64f0('0x46')],function(_0x518440){var _0x13c236={};_0x13c236[_0x518440]={'$like':'%'+_0x4ce93e[_0x64f0('0x43')][_0x64f0('0x4d')]+'%'};return _0x13c236;})});}_0x9150cc=_['merge']({},_0x9150cc,_0x4ce93e[_0x64f0('0x50')]);return _0x5dcf15[_0x64f0('0xa9')](_0x9150cc);}})[_0x64f0('0x22')](function(_0xcb232c){if(_0xcb232c){_0x111fbd=_0xcb232c['length'];if(!_0x4ce93e[_0x64f0('0x43')]['hasOwnProperty'](_0x64f0('0x49'))){_0x9150cc[_0x64f0('0x4a')]=qs[_0x64f0('0x4a')](_0x4ce93e['query']['limit']);_0x9150cc['offset']=qs[_0x64f0('0x31')](_0x4ce93e['query'][_0x64f0('0x31')]);}return _0x5dcf15[_0x64f0('0xa9')](_0x9150cc);}})['then'](function(_0x335a3c){if(_0x335a3c){return _0x335a3c?{'count':_0x111fbd,'rows':_0x335a3c}:null;}})[_0x64f0('0x22')](respondWithResult(_0x18f031,null))['catch'](handleError(_0x18f031,null));};exports[_0x64f0('0xab')]=function(_0x549c8c,_0x3a1110,_0x427f62){var _0x2dc854={'raw':![],'where':{}};var _0x518df9={};var _0x2cc5fd={'count':0x0,'rows':[]};return db[_0x64f0('0x3f')][_0x64f0('0x68')]({'where':{'id':_0x549c8c[_0x64f0('0x62')]['id']}})[_0x64f0('0x22')](handleEntityNotFound(_0x3a1110,null))['then'](function(_0xeef7b1){if(_0xeef7b1){_0x518df9[_0x64f0('0x42')]=_['keys'](db[_0x64f0('0x8c')]['rawAttributes']);_0x518df9[_0x64f0('0x43')]=_[_0x64f0('0x56')](_0x549c8c[_0x64f0('0x43')]);_0x518df9['filters']=_['intersection'](_0x518df9[_0x64f0('0x42')],_0x518df9['query']);_0x2dc854[_0x64f0('0x46')]=_[_0x64f0('0x45')](_0x518df9[_0x64f0('0x42')],qs['fields'](_0x549c8c[_0x64f0('0x43')]['fields']));_0x2dc854[_0x64f0('0x46')]=_0x2dc854['attributes'][_0x64f0('0x57')]?_0x2dc854['attributes']:_0x518df9[_0x64f0('0x42')];if(!_0x549c8c[_0x64f0('0x43')][_0x64f0('0x48')](_0x64f0('0x49'))){_0x2dc854['limit']=qs[_0x64f0('0x4a')](_0x549c8c[_0x64f0('0x43')]['limit']);_0x2dc854[_0x64f0('0x31')]=qs[_0x64f0('0x31')](_0x549c8c[_0x64f0('0x43')][_0x64f0('0x31')]);}_0x2dc854[_0x64f0('0xaa')]=qs[_0x64f0('0x4b')](_0x549c8c[_0x64f0('0x43')][_0x64f0('0x4b')]);_0x2dc854[_0x64f0('0x4c')]=qs['filters'](_[_0x64f0('0x69')](_0x549c8c[_0x64f0('0x43')],_0x518df9['filters']));_0x2dc854['where'][_0x64f0('0x65')]=_0xeef7b1['id'];if(_0x549c8c[_0x64f0('0x43')]['filter']){_0x2dc854[_0x64f0('0x4c')]=_[_0x64f0('0x4e')](_0x2dc854[_0x64f0('0x4c')],{'$or':_[_0x64f0('0x3e')](_0x2dc854[_0x64f0('0x46')],function(_0x442b63){var _0x51c933={};_0x51c933[_0x442b63]={'$like':'%'+_0x549c8c[_0x64f0('0x43')][_0x64f0('0x4d')]+'%'};return _0x51c933;})});}_0x2dc854=_[_0x64f0('0x4e')]({},_0x2dc854,_0x549c8c[_0x64f0('0x50')]);return db[_0x64f0('0x8c')][_0x64f0('0x30')]({'where':_0x2dc854[_0x64f0('0x4c')]})[_0x64f0('0x22')](function(_0x519367){_0x2cc5fd['count']=_0x519367;if(_0x549c8c['query']['includeAll']){_0x2dc854[_0x64f0('0x51')]=[{'model':db[_0x64f0('0x71')],'as':_0x64f0('0xac'),'required':![]},{'model':db[_0x64f0('0x98')],'as':_0x64f0('0xad'),'attributes':['name',_0x64f0('0xae'),_0x64f0('0xaf')],'required':![]},{'model':db[_0x64f0('0xb0')],'as':_0x64f0('0xb1'),'attributes':['id',_0x64f0('0x3b'),_0x64f0('0xb2')],'where':_0x549c8c['query'][_0x64f0('0xb3')]?{'id':_0x549c8c['query']['tag']}:undefined,'required':_0x549c8c[_0x64f0('0x43')][_0x64f0('0xb3')]?!![]:![]}];}return db[_0x64f0('0x8c')][_0x64f0('0x52')](_0x2dc854);})['then'](function(_0x1b24ff){_0x2cc5fd[_0x64f0('0x6a')]=_0x1b24ff;return _0x2cc5fd;});}})[_0x64f0('0x22')](respondWithFilteredResult(_0x3a1110,_0x2dc854))['catch'](handleError(_0x3a1110,null));};exports[_0x64f0('0xb4')]=function(_0x18826a,_0x3ba434,_0x2ddb9a){return db[_0x64f0('0x3f')][_0x64f0('0x59')]({'where':{'id':_0x18826a[_0x64f0('0x62')]['id']}})[_0x64f0('0x22')](handleEntityNotFound(_0x3ba434,null))[_0x64f0('0x22')](function(_0x2f01f2){if(_0x2f01f2){return _0x2f01f2[_0x64f0('0xb4')](_0x18826a[_0x64f0('0x61')]['ids'],_[_0x64f0('0xb5')](_0x18826a[_0x64f0('0x61')],[_0x64f0('0x6c'),'id'])||{})[_0x64f0('0x8e')](function(_0x2cf788){for(var _0x123ea9=0x0;_0x123ea9<_0x18826a[_0x64f0('0x61')][_0x64f0('0x6c')][_0x64f0('0x57')];_0x123ea9+=0x1){socket[_0x64f0('0xb6')](_0x64f0('0xb7'),{'UserId':Number(_0x18826a['body'][_0x64f0('0x6c')][_0x123ea9]),'OpenchannelAccountId':Number(_0x18826a[_0x64f0('0x62')]['id'])});}return _0x2cf788;});}})[_0x64f0('0x22')](respondWithResult(_0x3ba434,null))[_0x64f0('0x53')](handleError(_0x3ba434,null));};exports[_0x64f0('0xb8')]=function(_0x411d93,_0x225d24,_0x381d87){return db['OpenchannelAccount'][_0x64f0('0x59')]({'where':{'id':_0x411d93[_0x64f0('0x62')]['id']}})[_0x64f0('0x22')](handleEntityNotFound(_0x225d24,null))[_0x64f0('0x22')](function(_0x570c92){if(_0x570c92){return _0x570c92[_0x64f0('0xb8')](_0x411d93[_0x64f0('0x43')][_0x64f0('0x6c')])[_0x64f0('0x22')](function(){if(_[_0x64f0('0xb9')](_0x411d93[_0x64f0('0x43')]['ids'])){for(var _0x50419d=0x0;_0x50419d<_0x411d93[_0x64f0('0x43')][_0x64f0('0x6c')][_0x64f0('0x57')];_0x50419d+=0x1){socket[_0x64f0('0xb6')]('userOpenchannelAccount:remove',{'UserId':Number(_0x411d93[_0x64f0('0x43')][_0x64f0('0x6c')][_0x50419d]),'OpenchannelAccountId':Number(_0x411d93[_0x64f0('0x62')]['id'])});}}else{socket[_0x64f0('0xb6')](_0x64f0('0xba'),{'UserId':Number(_0x411d93[_0x64f0('0x43')]['ids']),'OpenchannelAccountId':Number(_0x411d93[_0x64f0('0x62')]['id'])});}});}})[_0x64f0('0x22')](respondWithStatusCode(_0x225d24,null))['catch'](handleError(_0x225d24,null));};exports[_0x64f0('0xbb')]=function(_0x2c07b4,_0x3a7fd6,_0x12ac99){var _0x4dbcf2={};var _0x43cac3={};var _0x2e0cd9;var _0x31446d;return db[_0x64f0('0x3f')][_0x64f0('0x68')]({'where':{'id':_0x2c07b4[_0x64f0('0x62')]['id']}})[_0x64f0('0x22')](handleEntityNotFound(_0x3a7fd6,null))['then'](function(_0x2b9743){if(_0x2b9743){_0x2e0cd9=_0x2b9743;_0x43cac3[_0x64f0('0x42')]=_['keys'](db[_0x64f0('0x98')][_0x64f0('0x40')]);_0x43cac3['query']=_[_0x64f0('0x56')](_0x2c07b4['query']);_0x43cac3['filters']=_[_0x64f0('0x45')](_0x43cac3[_0x64f0('0x42')],_0x43cac3[_0x64f0('0x43')]);_0x4dbcf2[_0x64f0('0x46')]=_[_0x64f0('0x45')](_0x43cac3['model'],qs[_0x64f0('0x47')](_0x2c07b4[_0x64f0('0x43')][_0x64f0('0x47')]));_0x4dbcf2[_0x64f0('0x46')]=_0x4dbcf2['attributes'][_0x64f0('0x57')]?_0x4dbcf2[_0x64f0('0x46')]:_0x43cac3[_0x64f0('0x42')];_0x4dbcf2[_0x64f0('0xaa')]=qs[_0x64f0('0x4b')](_0x2c07b4['query'][_0x64f0('0x4b')]);_0x4dbcf2['where']=qs[_0x64f0('0x44')](_[_0x64f0('0x69')](_0x2c07b4[_0x64f0('0x43')],_0x43cac3[_0x64f0('0x44')]));if(_0x2c07b4['query'][_0x64f0('0x4d')]){_0x4dbcf2['where']=_[_0x64f0('0x4e')](_0x4dbcf2['where'],{'$or':_[_0x64f0('0x3e')](_0x4dbcf2[_0x64f0('0x46')],function(_0x471572){var _0x3fa162={};_0x3fa162[_0x471572]={'$like':'%'+_0x2c07b4['query'][_0x64f0('0x4d')]+'%'};return _0x3fa162;})});}_0x4dbcf2=_[_0x64f0('0x4e')]({},_0x4dbcf2,_0x2c07b4[_0x64f0('0x50')]);return _0x2e0cd9['getAgents'](_0x4dbcf2);}})['then'](function(_0x97a0f7){if(_0x97a0f7){_0x31446d=_0x97a0f7[_0x64f0('0x57')];if(!_0x2c07b4['query']['hasOwnProperty']('nolimit')){_0x4dbcf2[_0x64f0('0x4a')]=qs[_0x64f0('0x4a')](_0x2c07b4[_0x64f0('0x43')][_0x64f0('0x4a')]);_0x4dbcf2[_0x64f0('0x31')]=qs[_0x64f0('0x31')](_0x2c07b4[_0x64f0('0x43')]['offset']);}return _0x2e0cd9[_0x64f0('0xbb')](_0x4dbcf2);}})[_0x64f0('0x22')](function(_0x58deb9){if(_0x58deb9){return _0x58deb9?{'count':_0x31446d,'rows':_0x58deb9}:null;}})[_0x64f0('0x22')](respondWithResult(_0x3a7fd6,null))['catch'](handleError(_0x3a7fd6,null));};exports[_0x64f0('0x3c')]=function(_0x21e49f,_0x42d270,_0x3cbe11){var _0x1b3a8e,_0x294c12,_0x3e4027;if(_[_0x64f0('0x78')](_0x21e49f[_0x64f0('0x61')][_0x64f0('0x61')])||_0x21e49f[_0x64f0('0x61')][_0x64f0('0x61')]===''){throw new db[(_0x64f0('0x7a'))][(_0x64f0('0x72'))](_0x64f0('0x7b'));}if(_[_0x64f0('0x78')](_0x21e49f[_0x64f0('0x61')]['to'])){}_0x1b3a8e=_0x21e49f['body']['to'];return db[_0x64f0('0x3f')]['findOne']({'where':{'id':_0x21e49f['params']['id']}})[_0x64f0('0x22')](handleEntityNotFound(_0x42d270,null))[_0x64f0('0x22')](function(_0x1aa87f){if(_0x1aa87f){return db[_0x64f0('0x3f')][_0x64f0('0x59')]({'where':{'id':_0x1aa87f['id']},'include':[{'model':db[_0x64f0('0x7e')],'as':_0x64f0('0x81'),'include':[{'model':db[_0x64f0('0x71')],'as':_0x64f0('0x7f'),'where':{[_0x1aa87f[_0x64f0('0x7c')]]:_0x1b3a8e},'limit':0x1,'order':[['updatedAt',_0x64f0('0x80')]]}]}]})[_0x64f0('0x22')](handleEntityNotFound(_0x42d270,null))[_0x64f0('0x22')](function(_0x246b17){if(_0x246b17&&_0x246b17[_0x64f0('0x81')]){_0x294c12=_0x246b17[_0x64f0('0x38')]({'plain':!![]});if(_0x294c12[_0x64f0('0x81')]&&_0x294c12[_0x64f0('0x81')][_0x64f0('0x7f')][_0x64f0('0x57')]){return _0x294c12[_0x64f0('0x81')][_0x64f0('0x7f')][0x0];}return db[_0x64f0('0x71')][_0x64f0('0x5a')](_[_0x64f0('0x1b')](_0x21e49f[_0x64f0('0x61')],{'firstName':_0x1b3a8e,[_0x246b17[_0x64f0('0x7c')]]:_0x1b3a8e,'phone':_0x1b3a8e,'ListId':_0x294c12['ListId']}));}})['then'](handleEntityNotFound(_0x42d270,null))[_0x64f0('0x22')](function(_0x285d8d){if(_0x285d8d){_0x3e4027=_0x285d8d;return db[_0x64f0('0x8c')][_0x64f0('0x59')]({'where':{'ContactId':_0x3e4027['id'],'closed':![],'OpenchannelAccountId':_0x294c12['id']}})[_0x64f0('0x22')](function(_0x2a5cd2){if(_0x2a5cd2){return[_0x2a5cd2,![]];}return db[_0x64f0('0x8c')][_0x64f0('0x5a')]({'UserId':_0x21e49f[_0x64f0('0x5b')]['id'],'ContactId':_0x3e4027['id'],'OpenchannelAccountId':_0x294c12['id'],'lastMsgDirection':_0x64f0('0xbc'),'Messages':[_[_0x64f0('0x4e')](_0x21e49f[_0x64f0('0x61')],{'read':![],'body':_0x21e49f['body'][_0x64f0('0x61')],'OpenchannelAccountId':_0x294c12['id'],'UserId':_0x21e49f[_0x64f0('0x5b')]['id'],'ContactId':_0x3e4027['id']})]},{'include':[{'model':db[_0x64f0('0xbd')],'as':_0x64f0('0xbe')}]})[_0x64f0('0x22')](function(_0x250020){return[_0x250020,!![]];});});}})['spread'](function(_0x5b960b,_0xd3a438){if(_0xd3a438){return _0x5b960b;}return db[_0x64f0('0xbd')][_0x64f0('0x5a')](_[_0x64f0('0x4e')](_0x21e49f[_0x64f0('0x61')],{'read':![],'body':_0x21e49f[_0x64f0('0x61')]['body'],'OpenchannelAccountId':_0x294c12['id'],'OpenchannelInteractionId':_0x5b960b['id'],'UserId':_0x21e49f[_0x64f0('0x5b')]['id'],'ContactId':_0x3e4027['id']}))[_0x64f0('0x22')](function(_0x39ee49){_0x5b960b[_0x64f0('0xbf')][_0x64f0('0xbe')]=[];_0x5b960b['dataValues'][_0x64f0('0xbe')][_0x64f0('0x93')](_0x39ee49[_0x64f0('0xbf')]);return _0x5b960b;});});}})[_0x64f0('0x22')](respondWithResult(_0x42d270,null))[_0x64f0('0x53')](handleError(_0x42d270,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index b4bd168..a851096 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 _0x55e0=['remove','emit','hook','events','../../mysqldb','OpenchannelAccount','setMaxListeners'];(function(_0x531d15,_0x599af5){var _0x271a18=function(_0x31284d){while(--_0x31284d){_0x531d15['push'](_0x531d15['shift']());}};_0x271a18(++_0x599af5);}(_0x55e0,0xdc));var _0x055e=function(_0x160b02,_0x463382){_0x160b02=_0x160b02-0x0;var _0x3b92af=_0x55e0[_0x160b02];return _0x3b92af;};'use strict';var EventEmitter=require(_0x055e('0x0'));var OpenchannelAccount=require(_0x055e('0x1'))['db'][_0x055e('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x055e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x055e('0x4')};function emitEvent(_0x2d9bd5){return function(_0x33cd7b,_0x2773e4,_0x157473){OpenchannelAccountEvents[_0x055e('0x5')](_0x2d9bd5+':'+_0x33cd7b['id'],_0x33cd7b);OpenchannelAccountEvents['emit'](_0x2d9bd5,_0x33cd7b);_0x157473(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x055e('0x6')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file +var _0xda3f=['exports','../../mysqldb','OpenchannelAccount','remove','emit'];(function(_0x12ca5f,_0x223d98){var _0xfc3ae9=function(_0x1928fb){while(--_0x1928fb){_0x12ca5f['push'](_0x12ca5f['shift']());}};_0xfc3ae9(++_0x223d98);}(_0xda3f,0xec));var _0xfda3=function(_0x18bf07,_0x4b42d1){_0x18bf07=_0x18bf07-0x0;var _0x2d8baf=_0xda3f[_0x18bf07];return _0x2d8baf;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0xfda3('0x0'))['db'][_0xfda3('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xfda3('0x2')};function emitEvent(_0x581693){return function(_0x36dc71,_0x22187d,_0x516500){OpenchannelAccountEvents[_0xfda3('0x3')](_0x581693+':'+_0x36dc71['id'],_0x36dc71);OpenchannelAccountEvents[_0xfda3('0x3')](_0x581693,_0x36dc71);_0x516500(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module[_0xfda3('0x4')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 365eff1..dab820c 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(_0x1cd35d,_0x548905){var _0x4e22e9=function(_0x56d4fd){while(--_0x56d4fd){_0x1cd35d['push'](_0x1cd35d['shift']());}};_0x4e22e9(++_0x548905);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'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(_0x442518,_0x19aa1b){var _0x89e726=function(_0x514a98){while(--_0x514a98){_0x442518['push'](_0x442518['shift']());}};_0x89e726(++_0x19aa1b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'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 4ddf2a8..9fb625b 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 _0xd64b=['http','redis','defaults','localhost','socket.io-emitter','request','then','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x328ac9,_0x2f7225){var _0x2b3a0a=function(_0x759e26){while(--_0x759e26){_0x328ac9['push'](_0x328ac9['shift']());}};_0x2b3a0a(++_0x2f7225);}(_0xd64b,0xc1));var _0xbd64=function(_0x1af415,_0x443c14){_0x1af415=_0x1af415-0x0;var _0x5158b3=_0xd64b[_0x1af415];return _0x5158b3;};'use strict';var _=require(_0xbd64('0x0'));var util=require('util');var moment=require(_0xbd64('0x1'));var BPromise=require('bluebird');var rs=require(_0xbd64('0x2'));var fs=require('fs');var Redis=require(_0xbd64('0x3'));var db=require(_0xbd64('0x4'))['db'];var utils=require(_0xbd64('0x5'));var logger=require(_0xbd64('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xbd64('0x7')]({'port':0x232a});config[_0xbd64('0x8')]=_[_0xbd64('0x9')](config[_0xbd64('0x8')],{'host':_0xbd64('0xa'),'port':0x18eb});var socket=require(_0xbd64('0xb'))(new Redis(config[_0xbd64('0x8')]));require('./openchannelAccount.socket')['register'](socket);function respondWithRpcPromise(_0x40919e,_0xde7cc8,_0x1250be){return new BPromise(function(_0x4e1adb,_0xc80599){return client[_0xbd64('0xc')](_0x40919e,_0x1250be)[_0xbd64('0xd')](function(_0x18bde8){logger['info'](_0xbd64('0xe'),_0xde7cc8,'request\x20sent');logger[_0xbd64('0xf')](_0xbd64('0x10'),_0xde7cc8,_0xbd64('0x11'),JSON[_0xbd64('0x12')](_0x18bde8));if(_0x18bde8[_0xbd64('0x13')]){if(_0x18bde8[_0xbd64('0x13')][_0xbd64('0x14')]===0x1f4){logger[_0xbd64('0x13')](_0xbd64('0xe'),_0xde7cc8,_0x18bde8['error'][_0xbd64('0x15')]);return _0xc80599(_0x18bde8[_0xbd64('0x13')][_0xbd64('0x15')]);}logger[_0xbd64('0x13')](_0xbd64('0xe'),_0xde7cc8,_0x18bde8['error'][_0xbd64('0x15')]);return _0x4e1adb(_0x18bde8['error'][_0xbd64('0x15')]);}else{logger[_0xbd64('0x16')](_0xbd64('0xe'),_0xde7cc8,_0xbd64('0x11'));_0x4e1adb(_0x18bde8[_0xbd64('0x17')][_0xbd64('0x15')]);}})[_0xbd64('0x18')](function(_0x32c4c7){logger['error'](_0xbd64('0xe'),_0xde7cc8,_0x32c4c7);_0xc80599(_0x32c4c7);});});} \ No newline at end of file +var _0xb574=['info','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','socket.io-emitter','redis','./openchannelAccount.socket','register','request','then','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','OpenchannelAccount,\x20%s,\x20%s'];(function(_0x442c6d,_0x22dd9e){var _0x286f05=function(_0x30e556){while(--_0x30e556){_0x442c6d['push'](_0x442c6d['shift']());}};_0x286f05(++_0x22dd9e);}(_0xb574,0x106));var _0x4b57=function(_0x1a3a3a,_0x145bcb){_0x1a3a3a=_0x1a3a3a-0x0;var _0x403ea8=_0xb574[_0x1a3a3a];return _0x403ea8;};'use strict';var _=require(_0x4b57('0x0'));var util=require(_0x4b57('0x1'));var moment=require('moment');var BPromise=require(_0x4b57('0x2'));var rs=require(_0x4b57('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4b57('0x4'))['db'];var utils=require(_0x4b57('0x5'));var logger=require(_0x4b57('0x6'))(_0x4b57('0x7'));var config=require(_0x4b57('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4b57('0x9')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4b57('0xa'))(new Redis(config[_0x4b57('0xb')]));require(_0x4b57('0xc'))[_0x4b57('0xd')](socket);function respondWithRpcPromise(_0xce47ad,_0x116958,_0x1db79a){return new BPromise(function(_0x43b108,_0x5593b8){return client[_0x4b57('0xe')](_0xce47ad,_0x1db79a)[_0x4b57('0xf')](function(_0x274912){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x116958,_0x4b57('0x10'));logger[_0x4b57('0x11')](_0x4b57('0x12'),_0x116958,_0x4b57('0x10'),JSON[_0x4b57('0x13')](_0x274912));if(_0x274912[_0x4b57('0x14')]){if(_0x274912[_0x4b57('0x14')][_0x4b57('0x15')]===0x1f4){logger[_0x4b57('0x14')]('OpenchannelAccount,\x20%s,\x20%s',_0x116958,_0x274912['error'][_0x4b57('0x16')]);return _0x5593b8(_0x274912[_0x4b57('0x14')][_0x4b57('0x16')]);}logger['error'](_0x4b57('0x17'),_0x116958,_0x274912['error'][_0x4b57('0x16')]);return _0x43b108(_0x274912[_0x4b57('0x14')][_0x4b57('0x16')]);}else{logger[_0x4b57('0x18')](_0x4b57('0x17'),_0x116958,_0x4b57('0x10'));_0x43b108(_0x274912['result'][_0x4b57('0x16')]);}})[_0x4b57('0x19')](function(_0x53f29a){logger[_0x4b57('0x14')]('OpenchannelAccount,\x20%s,\x20%s',_0x116958,_0x53f29a);_0x5593b8(_0x53f29a);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index d04dea7..f3f3dd2 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 _0x85b5=['openchannelAccount:','./openchannelAccount.events','save','update','removeListener','register'];(function(_0x506d83,_0x1899e9){var _0x335e8b=function(_0x4a7044){while(--_0x4a7044){_0x506d83['push'](_0x506d83['shift']());}};_0x335e8b(++_0x1899e9);}(_0x85b5,0x7f));var _0x585b=function(_0x50b4ad,_0x3540da){_0x50b4ad=_0x50b4ad-0x0;var _0x5c9ce8=_0x85b5[_0x50b4ad];return _0x5c9ce8;};'use strict';var OpenchannelAccountEvents=require(_0x585b('0x0'));var events=[_0x585b('0x1'),'remove',_0x585b('0x2')];function createListener(_0x4a79cf,_0x18ab39){return function(_0x5a7ff0){_0x18ab39['emit'](_0x4a79cf,_0x5a7ff0);};}function removeListener(_0x331fe8,_0x4f37a9){return function(){OpenchannelAccountEvents[_0x585b('0x3')](_0x331fe8,_0x4f37a9);};}exports[_0x585b('0x4')]=function(_0x9ccfca){for(var _0x5b9e48=0x0,_0x1605b5=events['length'];_0x5b9e48<_0x1605b5;_0x5b9e48++){var _0x432e2d=events[_0x5b9e48];var _0x2f8895=createListener(_0x585b('0x5')+_0x432e2d,_0x9ccfca);OpenchannelAccountEvents['on'](_0x432e2d,_0x2f8895);}}; \ No newline at end of file +var _0x3ce4=['./openchannelAccount.events','remove','emit','removeListener','register','length','openchannelAccount:'];(function(_0xaf0c26,_0x27a228){var _0x295bcd=function(_0x2243cc){while(--_0x2243cc){_0xaf0c26['push'](_0xaf0c26['shift']());}};_0x295bcd(++_0x27a228);}(_0x3ce4,0xcb));var _0x43ce=function(_0xd1c39b,_0x16f0c6){_0xd1c39b=_0xd1c39b-0x0;var _0x58f5bc=_0x3ce4[_0xd1c39b];return _0x58f5bc;};'use strict';var OpenchannelAccountEvents=require(_0x43ce('0x0'));var events=['save',_0x43ce('0x1'),'update'];function createListener(_0x41cf91,_0x38d2b3){return function(_0x37f85c){_0x38d2b3[_0x43ce('0x2')](_0x41cf91,_0x37f85c);};}function removeListener(_0x3050b7,_0x56f6d7){return function(){OpenchannelAccountEvents[_0x43ce('0x3')](_0x3050b7,_0x56f6d7);};}exports[_0x43ce('0x4')]=function(_0x563597){for(var _0x1412d1=0x0,_0x51e29b=events[_0x43ce('0x5')];_0x1412d1<_0x51e29b;_0x1412d1++){var _0x2fd0e2=events[_0x1412d1];var _0x189654=createListener(_0x43ce('0x6')+_0x2fd0e2,_0x563597);OpenchannelAccountEvents['on'](_0x2fd0e2,_0x189654);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index e4c1dc4..953ad00 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 _0x7bf9=['create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','isAuthenticated','index','post'];(function(_0x51bd64,_0x1c8850){var _0x2c7ee4=function(_0x20d60e){while(--_0x20d60e){_0x51bd64['push'](_0x51bd64['shift']());}};_0x2c7ee4(++_0x1c8850);}(_0x7bf9,0x183));var _0x97bf=function(_0x117648,_0x49d223){_0x117648=_0x117648-0x0;var _0x42b466=_0x7bf9[_0x117648];return _0x42b466;};'use strict';var multer=require(_0x97bf('0x0'));var util=require(_0x97bf('0x1'));var path=require(_0x97bf('0x2'));var timeout=require(_0x97bf('0x3'));var express=require(_0x97bf('0x4'));var router=express[_0x97bf('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x97bf('0x6'));var interaction=require(_0x97bf('0x7'));var config=require(_0x97bf('0x8'));var controller=require(_0x97bf('0x9'));router['get']('/',auth[_0x97bf('0xa')](),controller[_0x97bf('0xb')]);router['get']('/:id',auth[_0x97bf('0xa')](),controller['show']);router[_0x97bf('0xc')]('/',auth['isAuthenticated'](),controller[_0x97bf('0xd')]);router[_0x97bf('0xe')](_0x97bf('0xf'),auth[_0x97bf('0xa')](),controller[_0x97bf('0x10')]);router[_0x97bf('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x97bf('0x12')]);module[_0x97bf('0x13')]=router; \ No newline at end of file +var _0xe63c=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create','delete','exports','multer','util','path','connect-timeout','express'];(function(_0x2d6492,_0x5dede0){var _0x21f818=function(_0x5b4075){while(--_0x5b4075){_0x2d6492['push'](_0x2d6492['shift']());}};_0x21f818(++_0x5dede0);}(_0xe63c,0x175));var _0xce63=function(_0x2918e1,_0x9613bc){_0x2918e1=_0x2918e1-0x0;var _0x2f5165=_0xe63c[_0x2918e1];return _0x2f5165;};'use strict';var multer=require(_0xce63('0x0'));var util=require(_0xce63('0x1'));var path=require(_0xce63('0x2'));var timeout=require(_0xce63('0x3'));var express=require(_0xce63('0x4'));var router=express[_0xce63('0x5')]();var fs_extra=require(_0xce63('0x6'));var auth=require(_0xce63('0x7'));var interaction=require(_0xce63('0x8'));var config=require('../../config/environment');var controller=require('./openchannelApplication.controller');router[_0xce63('0x9')]('/',auth[_0xce63('0xa')](),controller[_0xce63('0xb')]);router['get'](_0xce63('0xc'),auth[_0xce63('0xa')](),controller[_0xce63('0xd')]);router[_0xce63('0xe')]('/',auth[_0xce63('0xa')](),controller[_0xce63('0xf')]);router['put'](_0xce63('0xc'),auth[_0xce63('0xa')](),controller['update']);router[_0xce63('0x10')](_0xce63('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xce63('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 c06a089..f26c502 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 _0x5116=['noop','TEXT','sequelize','exports','STRING'];(function(_0x59f0bf,_0x431c6e){var _0x3643a8=function(_0x345da4){while(--_0x345da4){_0x59f0bf['push'](_0x59f0bf['shift']());}};_0x3643a8(++_0x431c6e);}(_0x5116,0x133));var _0x6511=function(_0x276640,_0x4d27c4){_0x276640=_0x276640-0x0;var _0x2078e5=_0x5116[_0x276640];return _0x2078e5;};'use strict';var Sequelize=require(_0x6511('0x0'));module[_0x6511('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x6511('0x2')],'allowNull':![],'defaultValue':_0x6511('0x3')},'appdata':{'type':Sequelize[_0x6511('0x4')]()},'description':{'type':Sequelize[_0x6511('0x2')]},'interval':{'type':Sequelize[_0x6511('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x8c68=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x5f0e07,_0x10e305){var _0x16d632=function(_0x978c96){while(--_0x978c96){_0x5f0e07['push'](_0x5f0e07['shift']());}};_0x16d632(++_0x10e305);}(_0x8c68,0x15d));var _0x88c6=function(_0x346b4e,_0x1939f4){_0x346b4e=_0x346b4e-0x0;var _0x283063=_0x8c68[_0x346b4e];return _0x283063;};'use strict';var Sequelize=require(_0x88c6('0x0'));module[_0x88c6('0x1')]={'priority':{'type':Sequelize[_0x88c6('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x88c6('0x3')],'allowNull':![],'defaultValue':_0x88c6('0x4')},'appdata':{'type':Sequelize[_0x88c6('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x88c6('0x3')],'defaultValue':_0x88c6('0x6')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 529697c..02c5fee 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 _0x4768=['json','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','map','OpenchannelApplication','rawAttributes','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','include','includeAll','find','catch','create','body','params','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','end','status','offset','undefined','limit','count','set','Content-Range'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x4768,0xfd));var _0x8476=function(_0x74dd87,_0x2e91b0){_0x74dd87=_0x74dd87-0x0;var _0x36f969=_0x4768[_0x74dd87];return _0x36f969;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8476('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8476('0x1'));var rp=require(_0x8476('0x2'));var moment=require(_0x8476('0x3'));var BPromise=require(_0x8476('0x4'));var Mustache=require(_0x8476('0x5'));var util=require(_0x8476('0x6'));var path=require(_0x8476('0x7'));var sox=require(_0x8476('0x8'));var csv=require(_0x8476('0x9'));var ejs=require(_0x8476('0xa'));var fs=require('fs');var fs_extra=require(_0x8476('0xb'));var _=require(_0x8476('0xc'));var squel=require(_0x8476('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8476('0xe'));var toCsv=require(_0x8476('0x9'));var querystring=require(_0x8476('0xf'));var Papa=require(_0x8476('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8476('0x11'));var hardwareService=require(_0x8476('0x12'));var logger=require(_0x8476('0x13'))(_0x8476('0x14'));var utils=require(_0x8476('0x15'));var config=require(_0x8476('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x26c94d,_0x11248b){_0x11248b=_0x11248b||0xcc;return function(_0x4434ff){if(_0x4434ff){return _0x26c94d['sendStatus'](_0x11248b);}return _0x26c94d['status'](_0x11248b)[_0x8476('0x17')]();};}function respondWithResult(_0x379036,_0x128ca7){_0x128ca7=_0x128ca7||0xc8;return function(_0x39d52c){if(_0x39d52c){return _0x379036[_0x8476('0x18')](_0x128ca7)['json'](_0x39d52c);}};}function respondWithFilteredResult(_0x55b72d,_0x36c609){return function(_0xe15529){if(_0xe15529){var _0x1f9bc7=typeof _0x36c609[_0x8476('0x19')]===_0x8476('0x1a')&&typeof _0x36c609[_0x8476('0x1b')]===_0x8476('0x1a');var _0x5d4ace=_0xe15529['count'];var _0x3c33f3=_0x1f9bc7?0x0:_0x36c609[_0x8476('0x19')];var _0xf9b1a=_0x1f9bc7?_0xe15529[_0x8476('0x1c')]:_0x36c609[_0x8476('0x19')]+_0x36c609[_0x8476('0x1b')];var _0x346bb1;if(_0xf9b1a>=_0x5d4ace){_0xf9b1a=_0x5d4ace;_0x346bb1=0xc8;}else{_0x346bb1=0xce;}_0x55b72d[_0x8476('0x18')](_0x346bb1);return _0x55b72d[_0x8476('0x1d')](_0x8476('0x1e'),_0x3c33f3+'-'+_0xf9b1a+'/'+_0x5d4ace)[_0x8476('0x1f')](_0xe15529);}return null;};}function patchUpdates(_0x45b7c8){return function(_0x50d162){try{jsonpatch[_0x8476('0x20')](_0x50d162,_0x45b7c8,!![]);}catch(_0xae95fb){return BPromise[_0x8476('0x21')](_0xae95fb);}return _0x50d162[_0x8476('0x22')]();};}function saveUpdates(_0x49671e,_0x497b1d){return function(_0x9ebf0e){if(_0x9ebf0e){return _0x9ebf0e['update'](_0x49671e)[_0x8476('0x23')](function(_0x19d9a6){return _0x19d9a6;});}return null;};}function removeEntity(_0x51c43b,_0x375653){return function(_0x4ac304){if(_0x4ac304){return _0x4ac304[_0x8476('0x24')]()[_0x8476('0x23')](function(){_0x51c43b[_0x8476('0x18')](0xcc)[_0x8476('0x17')]();});}};}function handleEntityNotFound(_0x1ebf18,_0x493b9a){return function(_0x3f77fd){if(!_0x3f77fd){_0x1ebf18[_0x8476('0x25')](0x194);}return _0x3f77fd;};}function handleError(_0x4f882f,_0xb2c48){_0xb2c48=_0xb2c48||0x1f4;return function(_0x934e58){logger[_0x8476('0x26')](_0x934e58[_0x8476('0x27')]);if(_0x934e58['name']){delete _0x934e58[_0x8476('0x28')];}_0x4f882f[_0x8476('0x18')](_0xb2c48)[_0x8476('0x29')](_0x934e58);};}exports[_0x8476('0x2a')]=function(_0x36800c,_0x4d5491){var _0x27c1bc={},_0x376816={},_0x5c3b67={'count':0x0,'rows':[]};var _0x1b2f71=_[_0x8476('0x2b')](db[_0x8476('0x2c')][_0x8476('0x2d')],function(_0x3ea9c8){return{'name':_0x3ea9c8['fieldName'],'type':_0x3ea9c8[_0x8476('0x2e')][_0x8476('0x2f')]};});_0x376816[_0x8476('0x30')]=_[_0x8476('0x2b')](_0x1b2f71,'name');_0x376816['query']=_[_0x8476('0x31')](_0x36800c[_0x8476('0x32')]);_0x376816['filters']=_[_0x8476('0x33')](_0x376816[_0x8476('0x30')],_0x376816[_0x8476('0x32')]);_0x27c1bc['attributes']=_[_0x8476('0x33')](_0x376816[_0x8476('0x30')],qs['fields'](_0x36800c[_0x8476('0x32')][_0x8476('0x34')]));_0x27c1bc[_0x8476('0x35')]=_0x27c1bc['attributes'][_0x8476('0x36')]?_0x27c1bc[_0x8476('0x35')]:_0x376816[_0x8476('0x30')];if(!_0x36800c[_0x8476('0x32')][_0x8476('0x37')]('nolimit')){_0x27c1bc[_0x8476('0x1b')]=qs[_0x8476('0x1b')](_0x36800c[_0x8476('0x32')][_0x8476('0x1b')]);_0x27c1bc[_0x8476('0x19')]=qs[_0x8476('0x19')](_0x36800c[_0x8476('0x32')]['offset']);}_0x27c1bc[_0x8476('0x38')]=qs[_0x8476('0x39')](_0x36800c[_0x8476('0x32')]['sort']);_0x27c1bc[_0x8476('0x3a')]=qs['filters'](_['pick'](_0x36800c[_0x8476('0x32')],_0x376816[_0x8476('0x3b')]),_0x1b2f71);if(_0x36800c['query'][_0x8476('0x3c')]){_0x27c1bc[_0x8476('0x3a')]=_[_0x8476('0x3d')](_0x27c1bc[_0x8476('0x3a')],{'$or':_[_0x8476('0x2b')](_0x1b2f71,function(_0x112387){if(_0x112387[_0x8476('0x2e')]!==_0x8476('0x3e')){var _0x4bf1b7={};_0x4bf1b7[_0x112387[_0x8476('0x28')]]={'$like':'%'+_0x36800c[_0x8476('0x32')]['filter']+'%'};return _0x4bf1b7;}})});}_0x27c1bc=_['merge']({},_0x27c1bc,_0x36800c[_0x8476('0x3f')]);var _0x52ce66={'where':_0x27c1bc[_0x8476('0x3a')]};return db['OpenchannelApplication'][_0x8476('0x1c')](_0x52ce66)['then'](function(_0x4fc728){_0x5c3b67[_0x8476('0x1c')]=_0x4fc728;if(_0x36800c[_0x8476('0x32')]['includeAll']){_0x27c1bc[_0x8476('0x40')]=[{'all':!![]}];}return db['OpenchannelApplication']['findAll'](_0x27c1bc);})[_0x8476('0x23')](function(_0x1e6e9b){_0x5c3b67['rows']=_0x1e6e9b;return _0x5c3b67;})[_0x8476('0x23')](respondWithFilteredResult(_0x4d5491,_0x27c1bc))['catch'](handleError(_0x4d5491,null));};exports['show']=function(_0x56e376,_0x4f6709){var _0x3e8b8c={'raw':!![],'where':{'id':_0x56e376['params']['id']}},_0x12bff1={};_0x12bff1[_0x8476('0x30')]=_[_0x8476('0x31')](db[_0x8476('0x2c')]['rawAttributes']);_0x12bff1['query']=_[_0x8476('0x31')](_0x56e376[_0x8476('0x32')]);_0x12bff1['filters']=_[_0x8476('0x33')](_0x12bff1[_0x8476('0x30')],_0x12bff1['query']);_0x3e8b8c['attributes']=_[_0x8476('0x33')](_0x12bff1[_0x8476('0x30')],qs[_0x8476('0x34')](_0x56e376[_0x8476('0x32')][_0x8476('0x34')]));_0x3e8b8c[_0x8476('0x35')]=_0x3e8b8c[_0x8476('0x35')][_0x8476('0x36')]?_0x3e8b8c[_0x8476('0x35')]:_0x12bff1[_0x8476('0x30')];if(_0x56e376[_0x8476('0x32')][_0x8476('0x41')]){_0x3e8b8c[_0x8476('0x40')]=[{'all':!![]}];}_0x3e8b8c=_[_0x8476('0x3d')]({},_0x3e8b8c,_0x56e376[_0x8476('0x3f')]);return db['OpenchannelApplication'][_0x8476('0x42')](_0x3e8b8c)[_0x8476('0x23')](handleEntityNotFound(_0x4f6709,null))[_0x8476('0x23')](respondWithResult(_0x4f6709,null))[_0x8476('0x43')](handleError(_0x4f6709,null));};exports[_0x8476('0x44')]=function(_0x41417f,_0x1f4709){return db[_0x8476('0x2c')][_0x8476('0x44')](_0x41417f['body'],{})[_0x8476('0x23')](respondWithResult(_0x1f4709,0xc9))['catch'](handleError(_0x1f4709,null));};exports['update']=function(_0x2b6d8d,_0x3d3896){if(_0x2b6d8d[_0x8476('0x45')]['id']){delete _0x2b6d8d[_0x8476('0x45')]['id'];}return db['OpenchannelApplication'][_0x8476('0x42')]({'where':{'id':_0x2b6d8d[_0x8476('0x46')]['id']}})[_0x8476('0x23')](handleEntityNotFound(_0x3d3896,null))[_0x8476('0x23')](saveUpdates(_0x2b6d8d[_0x8476('0x45')],null))[_0x8476('0x23')](respondWithResult(_0x3d3896,null))[_0x8476('0x43')](handleError(_0x3d3896,null));};exports[_0x8476('0x24')]=function(_0x181818,_0x2401a1){return db[_0x8476('0x2c')][_0x8476('0x42')]({'where':{'id':_0x181818[_0x8476('0x46')]['id']}})[_0x8476('0x23')](handleEntityNotFound(_0x2401a1,null))[_0x8476('0x23')](removeEntity(_0x2401a1,null))[_0x8476('0x43')](handleError(_0x2401a1,null));}; \ No newline at end of file +var _0xecdd=['params','eml-format','fast-json-patch','bluebird','mustache','path','sox','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/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','end','error','stack','send','map','OpenchannelApplication','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','findAll','rows','catch','rawAttributes','include','find','create','body'];(function(_0x5805d7,_0x3d584a){var _0x170fe4=function(_0x3b9b73){while(--_0x3b9b73){_0x5805d7['push'](_0x5805d7['shift']());}};_0x170fe4(++_0x3d584a);}(_0xecdd,0xdf));var _0xdecd=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xecdd[_0x34bf97];return _0x292719;};'use strict';var emlformat=require(_0xdecd('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xdecd('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xdecd('0x2'));var Mustache=require(_0xdecd('0x3'));var util=require('util');var path=require(_0xdecd('0x4'));var sox=require(_0xdecd('0x5'));var csv=require('to-csv');var ejs=require(_0xdecd('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdecd('0x7'));var squel=require(_0xdecd('0x8'));var crypto=require(_0xdecd('0x9'));var jsforce=require(_0xdecd('0xa'));var deskjs=require(_0xdecd('0xb'));var toCsv=require('to-csv');var querystring=require(_0xdecd('0xc'));var Papa=require(_0xdecd('0xd'));var Redis=require(_0xdecd('0xe'));var authService=require(_0xdecd('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xdecd('0x10'));var hardwareService=require(_0xdecd('0x11'));var logger=require(_0xdecd('0x12'))(_0xdecd('0x13'));var utils=require(_0xdecd('0x14'));var config=require(_0xdecd('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xdecd('0x16'))['db'];function respondWithStatusCode(_0x48adba,_0x2e8fcb){_0x2e8fcb=_0x2e8fcb||0xcc;return function(_0x4cb055){if(_0x4cb055){return _0x48adba[_0xdecd('0x17')](_0x2e8fcb);}return _0x48adba['status'](_0x2e8fcb)['end']();};}function respondWithResult(_0xefdc95,_0x32e304){_0x32e304=_0x32e304||0xc8;return function(_0x1aefaf){if(_0x1aefaf){return _0xefdc95[_0xdecd('0x18')](_0x32e304)['json'](_0x1aefaf);}};}function respondWithFilteredResult(_0x127a1b,_0x5dd90e){return function(_0x357b4e){if(_0x357b4e){var _0x18200f=typeof _0x5dd90e[_0xdecd('0x19')]===_0xdecd('0x1a')&&typeof _0x5dd90e[_0xdecd('0x1b')]==='undefined';var _0x3a063a=_0x357b4e['count'];var _0x1b0430=_0x18200f?0x0:_0x5dd90e[_0xdecd('0x19')];var _0x5dbc25=_0x18200f?_0x357b4e[_0xdecd('0x1c')]:_0x5dd90e['offset']+_0x5dd90e[_0xdecd('0x1b')];var _0x1755ad;if(_0x5dbc25>=_0x3a063a){_0x5dbc25=_0x3a063a;_0x1755ad=0xc8;}else{_0x1755ad=0xce;}_0x127a1b['status'](_0x1755ad);return _0x127a1b[_0xdecd('0x1d')](_0xdecd('0x1e'),_0x1b0430+'-'+_0x5dbc25+'/'+_0x3a063a)[_0xdecd('0x1f')](_0x357b4e);}return null;};}function patchUpdates(_0x462339){return function(_0x321bd6){try{jsonpatch[_0xdecd('0x20')](_0x321bd6,_0x462339,!![]);}catch(_0x17afdd){return BPromise[_0xdecd('0x21')](_0x17afdd);}return _0x321bd6[_0xdecd('0x22')]();};}function saveUpdates(_0x9c1bb,_0x40365a){return function(_0xff6641){if(_0xff6641){return _0xff6641[_0xdecd('0x23')](_0x9c1bb)['then'](function(_0x1917e0){return _0x1917e0;});}return null;};}function removeEntity(_0x3e527e,_0x35451e){return function(_0x289f5a){if(_0x289f5a){return _0x289f5a[_0xdecd('0x24')]()[_0xdecd('0x25')](function(){_0x3e527e[_0xdecd('0x18')](0xcc)[_0xdecd('0x26')]();});}};}function handleEntityNotFound(_0x500d06,_0x5bf23d){return function(_0x32ace8){if(!_0x32ace8){_0x500d06[_0xdecd('0x17')](0x194);}return _0x32ace8;};}function handleError(_0xf35595,_0x3ccb1e){_0x3ccb1e=_0x3ccb1e||0x1f4;return function(_0x13cad4){logger[_0xdecd('0x27')](_0x13cad4[_0xdecd('0x28')]);if(_0x13cad4['name']){delete _0x13cad4['name'];}_0xf35595['status'](_0x3ccb1e)[_0xdecd('0x29')](_0x13cad4);};}exports['index']=function(_0x50ea6f,_0x5602cc){var _0x1b8dc6={},_0x3c8994={},_0x126319={'count':0x0,'rows':[]};var _0x3e5c14=_[_0xdecd('0x2a')](db[_0xdecd('0x2b')]['rawAttributes'],function(_0x791f05){return{'name':_0x791f05[_0xdecd('0x2c')],'type':_0x791f05[_0xdecd('0x2d')][_0xdecd('0x2e')]};});_0x3c8994[_0xdecd('0x2f')]=_[_0xdecd('0x2a')](_0x3e5c14,_0xdecd('0x30'));_0x3c8994[_0xdecd('0x31')]=_[_0xdecd('0x32')](_0x50ea6f[_0xdecd('0x31')]);_0x3c8994[_0xdecd('0x33')]=_[_0xdecd('0x34')](_0x3c8994[_0xdecd('0x2f')],_0x3c8994[_0xdecd('0x31')]);_0x1b8dc6[_0xdecd('0x35')]=_[_0xdecd('0x34')](_0x3c8994[_0xdecd('0x2f')],qs[_0xdecd('0x36')](_0x50ea6f[_0xdecd('0x31')][_0xdecd('0x36')]));_0x1b8dc6['attributes']=_0x1b8dc6[_0xdecd('0x35')][_0xdecd('0x37')]?_0x1b8dc6['attributes']:_0x3c8994[_0xdecd('0x2f')];if(!_0x50ea6f[_0xdecd('0x31')][_0xdecd('0x38')]('nolimit')){_0x1b8dc6[_0xdecd('0x1b')]=qs['limit'](_0x50ea6f[_0xdecd('0x31')][_0xdecd('0x1b')]);_0x1b8dc6[_0xdecd('0x19')]=qs['offset'](_0x50ea6f[_0xdecd('0x31')][_0xdecd('0x19')]);}_0x1b8dc6[_0xdecd('0x39')]=qs[_0xdecd('0x3a')](_0x50ea6f['query'][_0xdecd('0x3a')]);_0x1b8dc6[_0xdecd('0x3b')]=qs[_0xdecd('0x33')](_[_0xdecd('0x3c')](_0x50ea6f['query'],_0x3c8994[_0xdecd('0x33')]),_0x3e5c14);if(_0x50ea6f[_0xdecd('0x31')]['filter']){_0x1b8dc6[_0xdecd('0x3b')]=_[_0xdecd('0x3d')](_0x1b8dc6[_0xdecd('0x3b')],{'$or':_[_0xdecd('0x2a')](_0x3e5c14,function(_0x1f81a6){if(_0x1f81a6[_0xdecd('0x2d')]!==_0xdecd('0x3e')){var _0x4b9c36={};_0x4b9c36[_0x1f81a6[_0xdecd('0x30')]]={'$like':'%'+_0x50ea6f[_0xdecd('0x31')][_0xdecd('0x3f')]+'%'};return _0x4b9c36;}})});}_0x1b8dc6=_[_0xdecd('0x3d')]({},_0x1b8dc6,_0x50ea6f[_0xdecd('0x40')]);var _0x4c3bbb={'where':_0x1b8dc6[_0xdecd('0x3b')]};return db[_0xdecd('0x2b')][_0xdecd('0x1c')](_0x4c3bbb)[_0xdecd('0x25')](function(_0x42e081){_0x126319[_0xdecd('0x1c')]=_0x42e081;if(_0x50ea6f[_0xdecd('0x31')]['includeAll']){_0x1b8dc6['include']=[{'all':!![]}];}return db[_0xdecd('0x2b')][_0xdecd('0x41')](_0x1b8dc6);})[_0xdecd('0x25')](function(_0x42cfa4){_0x126319[_0xdecd('0x42')]=_0x42cfa4;return _0x126319;})['then'](respondWithFilteredResult(_0x5602cc,_0x1b8dc6))[_0xdecd('0x43')](handleError(_0x5602cc,null));};exports['show']=function(_0x29d4e2,_0x55377b){var _0x10fa3a={'raw':!![],'where':{'id':_0x29d4e2['params']['id']}},_0x2ac329={};_0x2ac329[_0xdecd('0x2f')]=_[_0xdecd('0x32')](db[_0xdecd('0x2b')][_0xdecd('0x44')]);_0x2ac329[_0xdecd('0x31')]=_[_0xdecd('0x32')](_0x29d4e2[_0xdecd('0x31')]);_0x2ac329[_0xdecd('0x33')]=_[_0xdecd('0x34')](_0x2ac329[_0xdecd('0x2f')],_0x2ac329[_0xdecd('0x31')]);_0x10fa3a['attributes']=_[_0xdecd('0x34')](_0x2ac329['model'],qs[_0xdecd('0x36')](_0x29d4e2[_0xdecd('0x31')][_0xdecd('0x36')]));_0x10fa3a[_0xdecd('0x35')]=_0x10fa3a[_0xdecd('0x35')][_0xdecd('0x37')]?_0x10fa3a[_0xdecd('0x35')]:_0x2ac329[_0xdecd('0x2f')];if(_0x29d4e2['query']['includeAll']){_0x10fa3a[_0xdecd('0x45')]=[{'all':!![]}];}_0x10fa3a=_['merge']({},_0x10fa3a,_0x29d4e2['options']);return db['OpenchannelApplication'][_0xdecd('0x46')](_0x10fa3a)[_0xdecd('0x25')](handleEntityNotFound(_0x55377b,null))[_0xdecd('0x25')](respondWithResult(_0x55377b,null))[_0xdecd('0x43')](handleError(_0x55377b,null));};exports[_0xdecd('0x47')]=function(_0x2467a5,_0x4c9506){return db[_0xdecd('0x2b')][_0xdecd('0x47')](_0x2467a5['body'],{})[_0xdecd('0x25')](respondWithResult(_0x4c9506,0xc9))['catch'](handleError(_0x4c9506,null));};exports[_0xdecd('0x23')]=function(_0x2b3835,_0x20596d){if(_0x2b3835[_0xdecd('0x48')]['id']){delete _0x2b3835[_0xdecd('0x48')]['id'];}return db[_0xdecd('0x2b')]['find']({'where':{'id':_0x2b3835[_0xdecd('0x49')]['id']}})['then'](handleEntityNotFound(_0x20596d,null))[_0xdecd('0x25')](saveUpdates(_0x2b3835[_0xdecd('0x48')],null))[_0xdecd('0x25')](respondWithResult(_0x20596d,null))[_0xdecd('0x43')](handleError(_0x20596d,null));};exports['destroy']=function(_0x1c9d6e,_0x191ce1){return db[_0xdecd('0x2b')][_0xdecd('0x46')]({'where':{'id':_0x1c9d6e[_0xdecd('0x49')]['id']}})[_0xdecd('0x25')](handleEntityNotFound(_0x191ce1,null))['then'](removeEntity(_0x191ce1,null))[_0xdecd('0x43')](handleError(_0x191ce1,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 8f4e845..4e4089a 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 _0x7c26=['../../config/environment','define','openchannel_applications','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x4fe823,_0x16dbde){var _0x3693c9=function(_0xb17e01){while(--_0xb17e01){_0x4fe823['push'](_0x4fe823['shift']());}};_0x3693c9(++_0x16dbde);}(_0x7c26,0xac));var _0x67c2=function(_0x264973,_0x12134f){_0x264973=_0x264973-0x0;var _0x51d3b2=_0x7c26[_0x264973];return _0x51d3b2;};'use strict';var _=require(_0x67c2('0x0'));var util=require(_0x67c2('0x1'));var logger=require(_0x67c2('0x2'))(_0x67c2('0x3'));var moment=require(_0x67c2('0x4'));var BPromise=require(_0x67c2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x67c2('0x6'));var rimraf=require(_0x67c2('0x7'));var config=require(_0x67c2('0x8'));var attributes=require('./openchannelApplication.attributes');module['exports']=function(_0x11ac80,_0x43c334){return _0x11ac80[_0x67c2('0x9')]('OpenchannelApplication',attributes,{'tableName':_0x67c2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x67c2('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x5cbc=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x51a4c4,_0x5cef2e){var _0x47bf59=function(_0xe4d722){while(--_0xe4d722){_0x51a4c4['push'](_0x51a4c4['shift']());}};_0x47bf59(++_0x5cef2e);}(_0x5cbc,0x10d));var _0xc5cb=function(_0x56b029,_0x20c6f4){_0x56b029=_0x56b029-0x0;var _0x15dd11=_0x5cbc[_0x56b029];return _0x15dd11;};'use strict';var _=require(_0xc5cb('0x0'));var util=require(_0xc5cb('0x1'));var logger=require(_0xc5cb('0x2'))(_0xc5cb('0x3'));var moment=require(_0xc5cb('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc5cb('0x5'));var rimraf=require(_0xc5cb('0x6'));var config=require(_0xc5cb('0x7'));var attributes=require(_0xc5cb('0x8'));module[_0xc5cb('0x9')]=function(_0x3c835e,_0x3232f6){return _0x3c835e[_0xc5cb('0xa')](_0xc5cb('0xb'),attributes,{'tableName':_0xc5cb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc5cb('0xd'),'collate':_0xc5cb('0xe')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 68e224f..2e590e1 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 _0x2be6=['http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','attributes','limit','debug','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4f1f88,_0x8776bd){var _0x31307f=function(_0x59d5fc){while(--_0x59d5fc){_0x4f1f88['push'](_0x4f1f88['shift']());}};_0x31307f(++_0x8776bd);}(_0x2be6,0xce));var _0x62be=function(_0x25e28e,_0xe0ab80){_0x25e28e=_0x25e28e-0x0;var _0x402ae2=_0x2be6[_0x25e28e];return _0x402ae2;};'use strict';var _=require('lodash');var util=require(_0x62be('0x0'));var moment=require('moment');var BPromise=require(_0x62be('0x1'));var rs=require(_0x62be('0x2'));var fs=require('fs');var Redis=require(_0x62be('0x3'));var db=require(_0x62be('0x4'))['db'];var utils=require(_0x62be('0x5'));var logger=require(_0x62be('0x6'))(_0x62be('0x7'));var config=require(_0x62be('0x8'));var jayson=require(_0x62be('0x9'));var client=jayson[_0x62be('0xa')][_0x62be('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3a79f9,_0x21f127,_0x29c957){return new BPromise(function(_0x5b35c3,_0x187a92){return client[_0x62be('0xc')](_0x3a79f9,_0x29c957)[_0x62be('0xd')](function(_0x509d98){logger[_0x62be('0xe')](_0x62be('0xf'),_0x21f127,_0x62be('0x10'));logger['debug']('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x21f127,'request\x20sent',JSON[_0x62be('0x11')](_0x509d98));if(_0x509d98[_0x62be('0x12')]){if(_0x509d98[_0x62be('0x12')]['code']===0x1f4){logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x21f127,_0x509d98[_0x62be('0x12')][_0x62be('0x13')]);return _0x187a92(_0x509d98[_0x62be('0x12')][_0x62be('0x13')]);}logger[_0x62be('0x12')](_0x62be('0xf'),_0x21f127,_0x509d98[_0x62be('0x12')][_0x62be('0x13')]);return _0x5b35c3(_0x509d98[_0x62be('0x12')][_0x62be('0x13')]);}else{logger['info'](_0x62be('0xf'),_0x21f127,_0x62be('0x10'));_0x5b35c3(_0x509d98[_0x62be('0x14')]['message']);}})[_0x62be('0x15')](function(_0x307d6b){logger[_0x62be('0x12')](_0x62be('0xf'),_0x21f127,_0x307d6b);_0x187a92(_0x307d6b);});});}exports[_0x62be('0x16')]=function(_0x5c5b30){var _0xa4ee49=this;return new Promise(function(_0x327fb5,_0x13c280){return db[_0x62be('0x17')][_0x62be('0x18')](_0x5c5b30[_0x62be('0x19')],{'raw':_0x5c5b30[_0x62be('0x1a')]?_0x5c5b30[_0x62be('0x1a')][_0x62be('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c5b30[_0x62be('0x1a')]?_0x5c5b30['options']['where']||null:null,'attributes':_0x5c5b30['options']?_0x5c5b30[_0x62be('0x1a')][_0x62be('0x1c')]||null:null,'limit':_0x5c5b30[_0x62be('0x1a')]?_0x5c5b30['options'][_0x62be('0x1d')]||null:null})[_0x62be('0xd')](function(_0x543a53){logger[_0x62be('0xe')](_0x62be('0x16'),_0x5c5b30);logger[_0x62be('0x1e')](_0x62be('0x16'),_0x5c5b30,JSON[_0x62be('0x11')](_0x543a53));_0x327fb5(_0x543a53);})['catch'](function(_0x9be879){logger['error'](_0x62be('0x16'),_0x9be879['message'],_0x5c5b30);_0x13c280(_0xa4ee49[_0x62be('0x12')](0x1f4,_0x9be879['message']));});});}; \ No newline at end of file +var _0x472c=['lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','options','raw','where','attributes','limit','then','stringify'];(function(_0x3d039a,_0x1e7873){var _0x5140f3=function(_0x43cb2c){while(--_0x43cb2c){_0x3d039a['push'](_0x3d039a['shift']());}};_0x5140f3(++_0x1e7873);}(_0x472c,0x117));var _0xc472=function(_0x3c739e,_0x2f0c65){_0x3c739e=_0x3c739e-0x0;var _0x3325dd=_0x472c[_0x3c739e];return _0x3325dd;};'use strict';var _=require(_0xc472('0x0'));var util=require('util');var moment=require(_0xc472('0x1'));var BPromise=require(_0xc472('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc472('0x3'));var db=require(_0xc472('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc472('0x5'))(_0xc472('0x6'));var config=require(_0xc472('0x7'));var jayson=require(_0xc472('0x8'));var client=jayson[_0xc472('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x50673b,_0x1e496a,_0x261a41){return new BPromise(function(_0x442b91,_0x13e31b){return client[_0xc472('0xa')](_0x50673b,_0x261a41)['then'](function(_0x12c200){logger[_0xc472('0xb')](_0xc472('0xc'),_0x1e496a,_0xc472('0xd'));logger[_0xc472('0xe')](_0xc472('0xf'),_0x1e496a,_0xc472('0xd'),JSON['stringify'](_0x12c200));if(_0x12c200[_0xc472('0x10')]){if(_0x12c200[_0xc472('0x10')][_0xc472('0x11')]===0x1f4){logger[_0xc472('0x10')](_0xc472('0xc'),_0x1e496a,_0x12c200['error'][_0xc472('0x12')]);return _0x13e31b(_0x12c200[_0xc472('0x10')][_0xc472('0x12')]);}logger[_0xc472('0x10')](_0xc472('0xc'),_0x1e496a,_0x12c200[_0xc472('0x10')][_0xc472('0x12')]);return _0x442b91(_0x12c200[_0xc472('0x10')][_0xc472('0x12')]);}else{logger[_0xc472('0xb')](_0xc472('0xc'),_0x1e496a,_0xc472('0xd'));_0x442b91(_0x12c200[_0xc472('0x13')][_0xc472('0x12')]);}})[_0xc472('0x14')](function(_0x1a5dc1){logger[_0xc472('0x10')](_0xc472('0xc'),_0x1e496a,_0x1a5dc1);_0x13e31b(_0x1a5dc1);});});}exports[_0xc472('0x15')]=function(_0x23aebf){var _0x737638=this;return new Promise(function(_0x1cb1ac,_0x487071){return db[_0xc472('0x16')][_0xc472('0x17')](_0x23aebf['body'],{'raw':_0x23aebf[_0xc472('0x18')]?_0x23aebf['options'][_0xc472('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x23aebf[_0xc472('0x18')]?_0x23aebf[_0xc472('0x18')][_0xc472('0x1a')]||null:null,'attributes':_0x23aebf[_0xc472('0x18')]?_0x23aebf[_0xc472('0x18')][_0xc472('0x1b')]||null:null,'limit':_0x23aebf[_0xc472('0x18')]?_0x23aebf[_0xc472('0x18')][_0xc472('0x1c')]||null:null})[_0xc472('0x1d')](function(_0x2af2cc){logger[_0xc472('0xb')](_0xc472('0x15'),_0x23aebf);logger[_0xc472('0xe')](_0xc472('0x15'),_0x23aebf,JSON[_0xc472('0x1e')](_0x2af2cc));_0x1cb1ac(_0x2af2cc);})[_0xc472('0x14')](function(_0x47e82a){logger[_0xc472('0x10')]('UpdateOpenchannelApplication',_0x47e82a[_0xc472('0x12')],_0x23aebf);_0x487071(_0x737638[_0xc472('0x10')](0x1f4,_0x47e82a['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index d658f67..13703f0 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 _0x463f=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelInteraction.controller','isAuthenticated','get','/describe','describe','/:id','show','getMessages','/:id/download','post','create','/:id/messages','addMessage','/:id/tags','tracked','openchannelinteraction:addtags','put','delete','openchannelinteraction:destroy','destroy','exports','path','connect-timeout'];(function(_0x2f7a8c,_0x4a7243){var _0xe0e3df=function(_0x8a616c){while(--_0x8a616c){_0x2f7a8c['push'](_0x2f7a8c['shift']());}};_0xe0e3df(++_0x4a7243);}(_0x463f,0x186));var _0xf463=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x463f[_0x40a045];return _0x1a687c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf463('0x0'));var timeout=require(_0xf463('0x1'));var express=require(_0xf463('0x2'));var router=express[_0xf463('0x3')]();var fs_extra=require(_0xf463('0x4'));var auth=require(_0xf463('0x5'));var interaction=require(_0xf463('0x6'));var config=require('../../config/environment');var controller=require(_0xf463('0x7'));router['get']('/',auth[_0xf463('0x8')](),controller['index']);router[_0xf463('0x9')](_0xf463('0xa'),auth[_0xf463('0x8')](),controller[_0xf463('0xb')]);router[_0xf463('0x9')](_0xf463('0xc'),auth['isAuthenticated'](),controller[_0xf463('0xd')]);router[_0xf463('0x9')]('/:id/messages',auth['isAuthenticated'](),controller[_0xf463('0xe')]);router[_0xf463('0x9')](_0xf463('0xf'),auth[_0xf463('0x8')](),controller['download']);router[_0xf463('0x10')]('/',auth['isAuthenticated'](),controller[_0xf463('0x11')]);router[_0xf463('0x10')](_0xf463('0x12'),auth[_0xf463('0x8')](),controller[_0xf463('0x13')]);router['post'](_0xf463('0x14'),auth[_0xf463('0x8')](),interaction[_0xf463('0x15')]('openchannel',_0xf463('0x16')),controller['addTags']);router[_0xf463('0x17')](_0xf463('0xc'),auth[_0xf463('0x8')](),interaction[_0xf463('0x15')]('openchannel','openchannelinteraction:update'),controller['update']);router[_0xf463('0x18')](_0xf463('0xc'),auth[_0xf463('0x8')](),interaction[_0xf463('0x15')]('openchannel',_0xf463('0x19')),controller[_0xf463('0x1a')]);router[_0xf463('0x18')]('/:id/tags',auth['isAuthenticated'](),controller['removeTags']);module[_0xf463('0x1b')]=router; \ No newline at end of file +var _0xc7c9=['getMessages','/:id/download','create','post','addMessage','/:id/tags','openchannel','openchannelinteraction:addtags','tracked','update','delete','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','describe','/:id','show','/:id/messages'];(function(_0x4503f6,_0x3babaf){var _0x2277d1=function(_0x1c005a){while(--_0x1c005a){_0x4503f6['push'](_0x4503f6['shift']());}};_0x2277d1(++_0x3babaf);}(_0xc7c9,0x6e));var _0x9c7c=function(_0x49de50,_0x271c5c){_0x49de50=_0x49de50-0x0;var _0x13bcb7=_0xc7c9[_0x49de50];return _0x13bcb7;};'use strict';var multer=require(_0x9c7c('0x0'));var util=require(_0x9c7c('0x1'));var path=require(_0x9c7c('0x2'));var timeout=require(_0x9c7c('0x3'));var express=require(_0x9c7c('0x4'));var router=express[_0x9c7c('0x5')]();var fs_extra=require(_0x9c7c('0x6'));var auth=require(_0x9c7c('0x7'));var interaction=require(_0x9c7c('0x8'));var config=require(_0x9c7c('0x9'));var controller=require(_0x9c7c('0xa'));router[_0x9c7c('0xb')]('/',auth[_0x9c7c('0xc')](),controller[_0x9c7c('0xd')]);router['get']('/describe',auth[_0x9c7c('0xc')](),controller[_0x9c7c('0xe')]);router[_0x9c7c('0xb')](_0x9c7c('0xf'),auth[_0x9c7c('0xc')](),controller[_0x9c7c('0x10')]);router[_0x9c7c('0xb')](_0x9c7c('0x11'),auth[_0x9c7c('0xc')](),controller[_0x9c7c('0x12')]);router[_0x9c7c('0xb')](_0x9c7c('0x13'),auth[_0x9c7c('0xc')](),controller['download']);router['post']('/',auth[_0x9c7c('0xc')](),controller[_0x9c7c('0x14')]);router[_0x9c7c('0x15')](_0x9c7c('0x11'),auth[_0x9c7c('0xc')](),controller[_0x9c7c('0x16')]);router[_0x9c7c('0x15')](_0x9c7c('0x17'),auth[_0x9c7c('0xc')](),interaction['tracked'](_0x9c7c('0x18'),_0x9c7c('0x19')),controller['addTags']);router['put'](_0x9c7c('0xf'),auth[_0x9c7c('0xc')](),interaction[_0x9c7c('0x1a')](_0x9c7c('0x18'),'openchannelinteraction:update'),controller[_0x9c7c('0x1b')]);router[_0x9c7c('0x1c')](_0x9c7c('0xf'),auth['isAuthenticated'](),interaction[_0x9c7c('0x1a')](_0x9c7c('0x18'),'openchannelinteraction:destroy'),controller[_0x9c7c('0x1d')]);router[_0x9c7c('0x1c')]('/:id/tags',auth['isAuthenticated'](),controller[_0x9c7c('0x1e')]);module[_0x9c7c('0x1f')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 9f483f2..7030909 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 _0x58f4=['BOOLEAN','DATE','STRING','ENUM','exports'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x58f4,0x1b2));var _0x458f=function(_0x343a1e,_0x449a87){_0x343a1e=_0x343a1e-0x0;var _0x3e5a65=_0x58f4[_0x343a1e];return _0x3e5a65;};'use strict';var Sequelize=require('sequelize');module[_0x458f('0x0')]={'closed':{'type':Sequelize[_0x458f('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x458f('0x2')]},'disposition':{'type':Sequelize[_0x458f('0x3')]},'secondDisposition':{'type':Sequelize[_0x458f('0x3')]},'thirdDisposition':{'type':Sequelize[_0x458f('0x3')]},'note':{'type':Sequelize[_0x458f('0x3')]},'read1stAt':{'type':Sequelize[_0x458f('0x2')]},'threadId':{'type':Sequelize[_0x458f('0x3')]},'externalUrl':{'type':Sequelize[_0x458f('0x3')]},'lastMsgAt':{'type':Sequelize[_0x458f('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x458f('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x075e=['out','exports','BOOLEAN','DATE','STRING'];(function(_0xac25c7,_0x43fa4b){var _0x10ae19=function(_0x5ed877){while(--_0x5ed877){_0xac25c7['push'](_0xac25c7['shift']());}};_0x10ae19(++_0x43fa4b);}(_0x075e,0x92));var _0xe075=function(_0x1002f4,_0x4ed14a){_0x1002f4=_0x1002f4-0x0;var _0x518ef2=_0x075e[_0x1002f4];return _0x518ef2;};'use strict';var Sequelize=require('sequelize');module[_0xe075('0x0')]={'closed':{'type':Sequelize[_0xe075('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xe075('0x2')]},'disposition':{'type':Sequelize[_0xe075('0x3')]},'secondDisposition':{'type':Sequelize[_0xe075('0x3')]},'thirdDisposition':{'type':Sequelize[_0xe075('0x3')]},'note':{'type':Sequelize[_0xe075('0x3')]},'read1stAt':{'type':Sequelize[_0xe075('0x2')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0xe075('0x3')]},'lastMsgAt':{'type':Sequelize[_0xe075('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xe075('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xe075('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0xe075('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 3961cdd..c1f0ec0 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 _0x787f=['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','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','Users','fullname','split','Tags','push','TagIds','catch','waiting','talking','unmanaged','total','closed','UserId','answered','index','map','OpenchannelInteraction','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','select','field','color','u.id','ui.OpenchannelInteractionId','from','user_has_openchannel_interactions','left_join','users','openchannel_interactions','cm_contacts','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','forEach','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','some','compact','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.from\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','length','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','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','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','all','rows','show','params','includeAll','include','options','create','body','describe','addMessage','OpenchannelMessage','ids','getMessages','hasOwnProperty','OpenchannelInteractionId','$gte','YYYY-MM-DD\x20HH:mm:ss','omit','spread','emit','openchannelInteractionTags:save','removeTags','download','unix','join','root','server','files','format','transcript-%d-%s.zip','CmContact','lastName','attachments','Attachment','Messages','direction','secret','Owner','get','mkdirSync','Openchannel','Account','N.A.','createdAt','closedAt','disposition','threadId','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','Contact','firstName','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x787f,0xfc));var _0xf787=function(_0x929c7e,_0x38c4cc){_0x929c7e=_0x929c7e-0x0;var _0x5de099=_0x787f[_0x929c7e];return _0x5de099;};'use strict';var emlformat=require(_0xf787('0x0'));var rimraf=require(_0xf787('0x1'));var zipdir=require(_0xf787('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf787('0x3'));var moment=require(_0xf787('0x4'));var BPromise=require(_0xf787('0x5'));var Mustache=require(_0xf787('0x6'));var util=require(_0xf787('0x7'));var path=require(_0xf787('0x8'));var sox=require(_0xf787('0x9'));var csv=require(_0xf787('0xa'));var ejs=require(_0xf787('0xb'));var fs=require('fs');var fs_extra=require(_0xf787('0xc'));var _=require(_0xf787('0xd'));var squel=require(_0xf787('0xe'));var crypto=require(_0xf787('0xf'));var jsforce=require(_0xf787('0x10'));var deskjs=require(_0xf787('0x11'));var toCsv=require('to-csv');var querystring=require(_0xf787('0x12'));var Papa=require('papaparse');var Redis=require(_0xf787('0x13'));var authService=require(_0xf787('0x14'));var qs=require(_0xf787('0x15'));var as=require(_0xf787('0x16'));var pdf=require(_0xf787('0x17'));var hardwareService=require(_0xf787('0x18'));var logger=require(_0xf787('0x19'))(_0xf787('0x1a'));var utils=require(_0xf787('0x1b'));var config=require(_0xf787('0x1c'));var licenseUtil=require('../../config/license/util');var db=require(_0xf787('0x1d'))['db'];config[_0xf787('0x1e')]=_['defaults'](config[_0xf787('0x1e')],{'host':_0xf787('0x1f'),'port':0x18eb});var socket=require(_0xf787('0x20'))(new Redis(config['redis']));require(_0xf787('0x21'))[_0xf787('0x22')](socket);function respondWithStatusCode(_0x3b5b3d,_0xfc98e9){_0xfc98e9=_0xfc98e9||0xcc;return function(_0x2fad5c){if(_0x2fad5c){return _0x3b5b3d[_0xf787('0x23')](_0xfc98e9);}return _0x3b5b3d['status'](_0xfc98e9)[_0xf787('0x24')]();};}function respondWithResult(_0xf19cbd,_0x3c9c50){_0x3c9c50=_0x3c9c50||0xc8;return function(_0x536564){if(_0x536564){return _0xf19cbd[_0xf787('0x25')](_0x3c9c50)[_0xf787('0x26')](_0x536564);}};}function respondWithFilteredResult(_0x36ab85,_0x13ffa5){return function(_0x159646){if(_0x159646){var _0x142414=typeof _0x13ffa5['offset']===_0xf787('0x27')&&typeof _0x13ffa5[_0xf787('0x28')]===_0xf787('0x27');var _0x8209d7=_0x159646[_0xf787('0x29')];var _0x254d52=_0x142414?0x0:_0x13ffa5[_0xf787('0x2a')];var _0x279cf8=_0x142414?_0x159646[_0xf787('0x29')]:_0x13ffa5['offset']+_0x13ffa5[_0xf787('0x28')];var _0x14fe06;if(_0x279cf8>=_0x8209d7){_0x279cf8=_0x8209d7;_0x14fe06=0xc8;}else{_0x14fe06=0xce;}_0x36ab85[_0xf787('0x25')](_0x14fe06);return _0x36ab85[_0xf787('0x2b')](_0xf787('0x2c'),_0x254d52+'-'+_0x279cf8+'/'+_0x8209d7)['json'](_0x159646);}return null;};}function patchUpdates(_0x2f1bfb){return function(_0x4062ec){try{jsonpatch[_0xf787('0x2d')](_0x4062ec,_0x2f1bfb,!![]);}catch(_0x2fffaf){return BPromise[_0xf787('0x2e')](_0x2fffaf);}return _0x4062ec[_0xf787('0x2f')]();};}function saveUpdates(_0x51208a,_0x590ebd){return function(_0x3dd5dd){if(_0x3dd5dd){return _0x3dd5dd[_0xf787('0x30')](_0x51208a)[_0xf787('0x31')](function(_0x5c84b3){return _0x5c84b3;});}return null;};}function removeEntity(_0x3186c0,_0x5ef754){return function(_0x2f66e4){if(_0x2f66e4){return _0x2f66e4[_0xf787('0x32')]()[_0xf787('0x31')](function(){_0x3186c0[_0xf787('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x466051,_0x564546){return function(_0x4acd9e){if(!_0x4acd9e){_0x466051[_0xf787('0x23')](0x194);}return _0x4acd9e;};}function handleError(_0x15329f,_0x22d182){_0x22d182=_0x22d182||0x1f4;return function(_0x44583f){logger[_0xf787('0x33')](_0x44583f[_0xf787('0x34')]);if(_0x44583f[_0xf787('0x35')]){delete _0x44583f['name'];}_0x15329f[_0xf787('0x25')](_0x22d182)[_0xf787('0x36')](_0x44583f);};}function getInteractionUsers(_0x3bb2d8,_0x160ae7){return new BPromise(function(_0x16e401,_0x45d0d0){try{if(_0x160ae7[_0x3bb2d8['id']]){_0x3bb2d8[_0xf787('0x37')]=_['map'](_0x160ae7[_0x3bb2d8['id']],function(_0x46f34b){return{'id':_0x46f34b['id'],'fullname':_0x46f34b[_0xf787('0x38')]};});}}catch(_0x3c5eb1){_0x45d0d0(_0x3c5eb1);}_0x16e401(_0x3bb2d8);});}function getInteractionTags(_0x2bbe37,_0x1cfaee){return new BPromise(function(_0x14383e,_0x2907ab){try{if(_0x2bbe37['TagIds']){_0x2bbe37['Tags']=[];_0x2bbe37['TagIds'][_0xf787('0x39')](',')['forEach'](function(_0x543727){_0x2bbe37[_0xf787('0x3a')][_0xf787('0x3b')](_0x1cfaee[_0x543727]);});}delete _0x2bbe37[_0xf787('0x3c')];}catch(_0xe2c101){_0x2907ab(_0xe2c101);}_0x14383e(_0x2bbe37);});}function updateOpenchannelInteraction(_0x1b824d,_0x34da55,_0x368df9){return new BPromise(function(_0x16117b,_0xb3fde3){return getInteractionUsers(_0x1b824d,_0x368df9)[_0xf787('0x31')](function(_0x2a377b){return getInteractionTags(_0x2a377b,_0x34da55);})['then'](function(_0x38b9c4){return getStateInteraction(_0x38b9c4);})[_0xf787('0x31')](function(_0x15fa9d){_0x16117b(_0x15fa9d);})[_0xf787('0x3d')](function(_0x5d2fb9){_0xb3fde3(_0x5d2fb9);});});}function getStateInteraction(_0x21f635){return new BPromise(function(_0x320b9c){_0x21f635[_0xf787('0x3e')]=0x0;_0x21f635[_0xf787('0x3f')]=0x0;_0x21f635['answered']=0x0;_0x21f635[_0xf787('0x40')]=0x0;_0x21f635[_0xf787('0x41')]=0x0;if(!_0x21f635[_0xf787('0x42')]&&!_0x21f635[_0xf787('0x43')]){_0x21f635[_0xf787('0x3e')]+=0x1;}if(!_0x21f635[_0xf787('0x42')]&&_0x21f635[_0xf787('0x43')]){_0x21f635['talking']+=0x1;if(_0x21f635[_0xf787('0x3e')]){_0x21f635[_0xf787('0x3e')]-=0x1;}}if(_0x21f635[_0xf787('0x42')]&&_0x21f635['UserId']){_0x21f635[_0xf787('0x44')]+=0x1;if(_0x21f635['talking']){_0x21f635['talking']-=0x1;}}if(_0x21f635[_0xf787('0x42')]&&!_0x21f635['UserId']){_0x21f635[_0xf787('0x40')]+=0x1;if(_0x21f635[_0xf787('0x3e')]){_0x21f635[_0xf787('0x3e')]-=0x1;}}_0x21f635[_0xf787('0x41')]+=0x1;_0x320b9c(_0x21f635);});}exports[_0xf787('0x45')]=function(_0x136524,_0x3451b7){var _0x18c716={},_0x4686d4={},_0xd32e0d={'count':0x0,'rows':[]};var _0x41fa5a=_[_0xf787('0x46')](db[_0xf787('0x47')][_0xf787('0x48')],function(_0x3db179){return{'name':_0x3db179[_0xf787('0x49')],'type':_0x3db179[_0xf787('0x4a')]['key']};});_0x4686d4[_0xf787('0x4b')]=_['map'](_0x41fa5a,'name');_0x4686d4[_0xf787('0x4c')]=_[_0xf787('0x4d')](_0x136524['query']);_0x4686d4[_0xf787('0x4e')]=_[_0xf787('0x4f')](_0x4686d4[_0xf787('0x4b')],_0x4686d4['query']);_0x18c716[_0xf787('0x50')]=_[_0xf787('0x4f')](_0x4686d4[_0xf787('0x4b')],qs['fields'](_0x136524[_0xf787('0x4c')][_0xf787('0x51')]));_0x18c716[_0xf787('0x50')]=_0x18c716[_0xf787('0x50')]['length']?_0x18c716[_0xf787('0x50')]:_0x4686d4['model'];if(!_0x136524['query']['hasOwnProperty'](_0xf787('0x52'))){_0x18c716[_0xf787('0x28')]=qs[_0xf787('0x28')](_0x136524[_0xf787('0x4c')]['limit']);_0x18c716[_0xf787('0x2a')]=qs['offset'](_0x136524[_0xf787('0x4c')][_0xf787('0x2a')]);}_0x18c716[_0xf787('0x53')]=qs[_0xf787('0x54')](_0x136524[_0xf787('0x4c')][_0xf787('0x54')]);_0x18c716[_0xf787('0x55')]=qs['filters'](_[_0xf787('0x56')](_0x136524[_0xf787('0x4c')],_0x4686d4[_0xf787('0x4e')]),_0x41fa5a);var _0x2e2c9a=[];var _0x52568d=squel[_0xf787('0x57')]()[_0xf787('0x58')]('id')['field']('name')['field'](_0xf787('0x59'))['from']('tools_tags');var _0x28f9f4=squel[_0xf787('0x57')]()[_0xf787('0x58')](_0xf787('0x5a'))[_0xf787('0x58')]('u.fullname')['field'](_0xf787('0x5b'))[_0xf787('0x5c')](_0xf787('0x5d'),'ui')[_0xf787('0x5e')](_0xf787('0x5f'),'u','u.id\x20=\x20ui.UserId');var _0x539811=squel[_0xf787('0x57')]()[_0xf787('0x5c')](_0xf787('0x60'),'i')[_0xf787('0x5e')](_0xf787('0x61'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0xf787('0x5f'),'o','o.id\x20=\x20i.UserId')[_0xf787('0x5e')](_0xf787('0x62'),'a',_0xf787('0x63'))[_0xf787('0x5e')](_0xf787('0x64'),'me',_0xf787('0x65'))[_0xf787('0x5e')](_0xf787('0x66'),'it','it.OpenchannelInteractionId\x20=\x20i.id')['left_join'](_0xf787('0x67'),'t',_0xf787('0x68'));var _0x3c18c5=squel[_0xf787('0x69')]();var _0x5b36a7=[];var _0x109833=squel['expr']();var _0x3afd2f;if(_0x136524['query'][_0xf787('0x6a')]){_0x3afd2f=as[_0xf787('0x6b')](_0x136524[_0xf787('0x4c')]['search']);var _0x1a9ae3=_0x3afd2f[_0xf787('0x6c')];for(var _0x650b29=0x0;_0x650b29<_0x3afd2f['conditions']['length'];_0x650b29++){var _0x4b959f=_0x3afd2f[_0xf787('0x6d')][_0x650b29];var _0x33bc21='i';var _0x32dabb=_[_0xf787('0x6e')](_0x41fa5a,[_0xf787('0x35'),_0x4b959f[_0xf787('0x58')]]);if(!_0x32dabb){switch(_0x4b959f['field']){case _0xf787('0x6f'):if(_0x4b959f[_0xf787('0x70')]==0x1){_0x539811[_0xf787('0x71')]('`'+_0x4b959f[_0xf787('0x58')]+_0xf787('0x72'));}else{_0x539811[_0xf787('0x71')]('`'+_0x4b959f[_0xf787('0x58')]+'`\x20>\x200');}break;case'Contact':if(_0x4b959f[_0xf787('0x73')]===_0xf787('0x74')){if(_0x4b959f[_0xf787('0x70')]['split']('\x20')['length']>0x1){_0x3c18c5[_0x1a9ae3]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xf787('0x75')](_0x4b959f[_0xf787('0x70')]),null);}else{var _0x5cb7fd='%'+_0x4b959f[_0xf787('0x70')]+'%';_0x3c18c5[_0x1a9ae3](_0xf787('0x76'),_0x5cb7fd,_0x5cb7fd,_0x5cb7fd);}}else{_0x32dabb=_[_0xf787('0x6e')](_0x41fa5a,[_0xf787('0x35'),_0xf787('0x77')]);_0x4b959f[_0xf787('0x58')]=_0xf787('0x77');_0x2218ad=as[_0xf787('0x78')](_0x33bc21,_0x32dabb['type'],_0x4b959f);_0x3c18c5[_0x1a9ae3](_0x2218ad[_0xf787('0x79')],_0x2218ad[_0xf787('0x70')][_0xf787('0x7a')],_0x2218ad[_0xf787('0x70')]['end']);}break;case _0xf787('0x7b'):var _0x12c3a2=_0x4b959f[_0xf787('0x70')]['split'](',')['map'](function(_0x7fe975){return Number(_0x7fe975);});_0x12c3a2[_0xf787('0x7c')](function(_0x55f10c){_0x109833['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x55f10c+',%');});_0x5b36a7=_[_0xf787('0x7d')](_0x5b36a7,_0x12c3a2);break;case _0xf787('0x7e'):if(_0x4b959f[_0xf787('0x73')]==='$substring'){_0x3c18c5[_0x1a9ae3](_0xf787('0x7f'),'%'+_0x4b959f[_0xf787('0x70')]+'%',null);}else{_0x32dabb=_[_0xf787('0x6e')](_0x41fa5a,[_0xf787('0x35'),'UserId']);_0x4b959f[_0xf787('0x58')]='UserId';_0x2218ad=as[_0xf787('0x78')](_0x33bc21,_0x32dabb[_0xf787('0x4a')],_0x4b959f);_0x3c18c5[_0x1a9ae3](_0x2218ad[_0xf787('0x79')],_0x2218ad[_0xf787('0x70')][_0xf787('0x7a')],_0x2218ad['value'][_0xf787('0x24')]);}break;case'body':_0x2218ad=as[_0xf787('0x78')]('me',null,_0x4b959f);_0x3c18c5[_0x1a9ae3](_0x2218ad[_0xf787('0x79')],_0x2218ad['value'][_0xf787('0x7a')],_0x2218ad[_0xf787('0x70')][_0xf787('0x24')]);break;}}else{var _0x2218ad=as['buildExpression'](_0x33bc21,_0x32dabb[_0xf787('0x4a')],_0x4b959f);_0x3c18c5[_0x1a9ae3](_0x2218ad[_0xf787('0x79')],_0x2218ad[_0xf787('0x70')]['start'],_0x2218ad['value'][_0xf787('0x24')]);}}}else{var _0x4ed170=_(_0x136524[_0xf787('0x4c')])[_0xf787('0x4d')]()['map'](function(_0x13bb1c){return _[_0xf787('0x80')](_0x41fa5a,[_0xf787('0x35'),_0x13bb1c])?_0x13bb1c:undefined;})[_0xf787('0x81')]()[_0xf787('0x70')]();if(!_['isEmpty'](_0x4ed170)){_0x4ed170['forEach'](function(_0x1f618a){if(_0x1f618a===_0xf787('0x82')){_0x539811[_0xf787('0x55')](_0xf787('0x83'),[][_0xf787('0x84')](_0x136524[_0xf787('0x4c')][_0x1f618a]));}else if(_0x1f618a==='createdAt'){var _0x3d9920=JSON[_0xf787('0x85')](_0x136524[_0xf787('0x4c')][_0x1f618a])['$gte'];var _0x3dd345=JSON[_0xf787('0x85')](_0x136524[_0xf787('0x4c')][_0x1f618a])[_0xf787('0x86')];_0x539811[_0xf787('0x55')](_0xf787('0x87'),_0x3d9920,_0x3dd345);}else{if(_0x136524[_0xf787('0x4c')][_0x1f618a]==='null'){_0x539811[_0xf787('0x55')]('i.'+_0x1f618a+'\x20IS\x20NULL');}else{_0x539811['where']('i.'+_0x1f618a+_0xf787('0x88'),_0x136524['query'][_0x1f618a]);}}});}if(_0x136524[_0xf787('0x4c')][_0xf787('0x89')]){if(_0x136524['query'][_0xf787('0x89')]==0x1){_0x539811[_0xf787('0x71')](_0xf787('0x8a'));}else{_0x539811['having'](_0xf787('0x8b'));}}if(_0x136524[_0xf787('0x4c')][_0xf787('0x8c')]){_0x5b36a7=_[_0xf787('0x8d')](_0x136524[_0xf787('0x4c')][_0xf787('0x8c')])?_0x136524[_0xf787('0x4c')][_0xf787('0x8c')]:new Array(_0x136524[_0xf787('0x4c')][_0xf787('0x8c')]);_0x5b36a7['forEach'](function(_0x23b2d7){_0x109833['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x23b2d7+',%');});}if(_0x136524[_0xf787('0x4c')][_0xf787('0x8e')]){var _0x3b90ed=_0x136524[_0xf787('0x4c')]['filter'][_0xf787('0x8f')]('\x5c','\x5c\x5c')[_0xf787('0x8f')](/'/g,'\x27\x27');if(qs[_0xf787('0x90')](_0x3b90ed)){_0x3c18c5['or'](_0xf787('0x91'),_0x3b90ed+'%');}else{_0x3c18c5['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xf787('0x75')](_0x3b90ed))['or'](_0xf787('0x92'),_0x3b90ed+'%')['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x3b90ed+'%');}}}_0x539811[_0xf787('0x55')](_0x3c18c5);_0x539811[_0xf787('0x93')](_0xf787('0x94'));var _0x3c3e13={'type':db[_0xf787('0x95')][_0xf787('0x96')]['SELECT'],'raw':!![]};var _0x5659bc=_0x539811[_0xf787('0x97')]();_0x5659bc[_0xf787('0x58')]('i.id');_0x5659bc[_0xf787('0x58')](_0xf787('0x98'),_0xf787('0x6f'));if(_0x18c716['order']){_0x18c716[_0xf787('0x53')][_0xf787('0x7c')](function(_0x18ebea){var _0x39599e=_0x18ebea[0x0]==='contactName'?_0x18ebea[0x0]:'i.'+_0x18ebea[0x0];_0x539811[_0xf787('0x53')](_0x39599e,_0x18ebea[0x1]===_0xf787('0x99')?![]:!![]);});}if(!_[_0xf787('0x9a')](_0x5b36a7)){_0x539811[_0xf787('0x71')](_0x109833);_0x5659bc[_0xf787('0x55')](_0xf787('0x9b'),_0x5b36a7);}BPromise[_0xf787('0x9c')]()[_0xf787('0x31')](function(){if(!_0x3afd2f){if(_0x136524[_0xf787('0x4c')][_0xf787('0x82')])return;_0x5659bc[_0xf787('0x55')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');_0x539811['where'](_0xf787('0x9d'));return;}if(_0x136524['user'][_0xf787('0x9e')]!==_0xf787('0x9f'))return;return _0x136524[_0xf787('0xa0')][_0xf787('0xa1')]({'attributes':['id'],'raw':!![]})[_0xf787('0x31')](function(_0x1dad16){if(_[_0xf787('0x9a')](_0x1dad16)){_0x5659bc[_0xf787('0x55')](_0xf787('0xa2'));_0x539811[_0xf787('0x55')]('i.OpenchannelAccountId\x20IS\x20NULL');}else{_0x5659bc[_0xf787('0x55')](_0xf787('0x83'),_['map'](_0x1dad16,'id'));_0x539811['where'](_0xf787('0x83'),_[_0xf787('0x46')](_0x1dad16,'id'));}});})['then'](function(){if(_0x136524[_0xf787('0xa0')][_0xf787('0x9e')]===_0xf787('0x9f')&&!_0x3afd2f&&!_0x136524[_0xf787('0x4c')][_0xf787('0x82')])return[];return db['sequelize'][_0xf787('0x4c')](_0x5659bc['toString'](),_0x3c3e13);})[_0xf787('0x31')](function(_0x18153f){_0xd32e0d['count']=_0x18153f[_0xf787('0xa3')];if(_0xd32e0d[_0xf787('0x29')]===0x0)return[];return db[_0xf787('0xa4')][_0xf787('0x4c')](_0x52568d[_0xf787('0xa5')](),_0x3c3e13)[_0xf787('0x31')](function(_0x22e674){_0x2e2c9a=_[_0xf787('0xa6')](_0x22e674,'id');_0x3c3e13=_[_0xf787('0xa7')](_0x3c3e13,{'model':db[_0xf787('0x47')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x136524['query'][_0xf787('0x51')]){_0x18c716[_0xf787('0x50')][_0xf787('0x7c')](function(_0x7d2fe5){_0x539811[_0xf787('0x58')]('i.'+_0x7d2fe5);});}else{_0x539811['field'](_0xf787('0x98'),_0xf787('0x6f'));_0x539811[_0xf787('0x58')](_0xf787('0xa8'),_0xf787('0xa9'));_0x539811[_0xf787('0x58')](_0xf787('0xaa'),_0xf787('0xab'));_0x539811[_0xf787('0x58')](_0xf787('0xac'),'contactName');_0x539811['field'](_0xf787('0xad'));_0x539811[_0xf787('0x58')]('c.firstName',_0xf787('0xae'));_0x539811[_0xf787('0x58')](_0xf787('0xaf'),_0xf787('0xb0'));_0x539811['field'](_0xf787('0xb1'),'Contact.email');_0x539811[_0xf787('0x58')]('c.phone',_0xf787('0xb2'));_0x539811[_0xf787('0x58')](_0xf787('0xb3'),_0xf787('0xb4'));_0x539811[_0xf787('0x58')]('c.fax',_0xf787('0xb5'));_0x539811['field'](_0xf787('0xb6'),_0xf787('0xb7'));_0x539811[_0xf787('0x58')]('o.internal',_0xf787('0xb8'));_0x539811['field'](_0xf787('0xb9'),_0xf787('0x3c'));}if(_0x18c716['limit'])_0x539811[_0xf787('0x28')](_0x18c716[_0xf787('0x28')]);if(_0x18c716[_0xf787('0x2a')])_0x539811[_0xf787('0x2a')](_0x18c716['offset']);return db[_0xf787('0xa4')]['query'](_0x539811[_0xf787('0xa5')](),_0x3c3e13);})[_0xf787('0x31')](function(_0x31ccfc){if(_0x31ccfc[_0xf787('0xa3')]>0x0)_0x28f9f4[_0xf787('0x55')](_0xf787('0xba'),_[_0xf787('0x46')](_0x31ccfc,'id'));return db['sequelize'][_0xf787('0x4c')](_0x28f9f4[_0xf787('0xa5')](),_0x3c3e13)[_0xf787('0x31')](function(_0x495632){var _0x5a4949=_[_0xf787('0xbb')](_0x495632,'OpenchannelInteractionId');var _0x2cbffe=[];_0x31ccfc[_0xf787('0x7c')](function(_0x215486){_0x2cbffe[_0xf787('0x3b')](updateOpenchannelInteraction(_0x215486,_0x2e2c9a,_0x5a4949));});return BPromise[_0xf787('0xbc')](_0x2cbffe);});});})['then'](function(_0x369a09){_0xd32e0d[_0xf787('0xbd')]=_0x369a09;return _0xd32e0d;})[_0xf787('0x31')](respondWithFilteredResult(_0x3451b7,_0x18c716))[_0xf787('0x3d')](handleError(_0x3451b7,null));};exports[_0xf787('0xbe')]=function(_0x49c30c,_0x585134){var _0x56d872={};if(_0x49c30c[_0xf787('0x4c')][_0xf787('0x4a')]&&_0x49c30c[_0xf787('0x4c')][_0xf787('0x4a')]===_0xf787('0x5c')){_0x56d872[_0xf787('0x5c')]=_0x49c30c['params']['id'];}else{_0x56d872['id']=_0x49c30c[_0xf787('0xbf')]['id'];}var _0x104789={'raw':![],'where':_0x56d872},_0x683bf={};_0x683bf[_0xf787('0x4b')]=_[_0xf787('0x4d')](db[_0xf787('0x47')][_0xf787('0x48')]);_0x683bf['query']=_[_0xf787('0x4d')](_0x49c30c['query']);_0x683bf['filters']=_[_0xf787('0x4f')](_0x683bf['model'],_0x683bf[_0xf787('0x4c')]);_0x104789['attributes']=_[_0xf787('0x4f')](_0x683bf[_0xf787('0x4b')],qs['fields'](_0x49c30c[_0xf787('0x4c')][_0xf787('0x51')]));_0x104789[_0xf787('0x50')]=_0x104789[_0xf787('0x50')][_0xf787('0xa3')]?_0x104789['attributes']:_0x683bf[_0xf787('0x4b')];if(_0x49c30c[_0xf787('0x4c')][_0xf787('0xc0')]){_0x104789[_0xf787('0xc1')]=[{'all':!![]}];}_0x104789=_['merge']({},_0x104789,_0x49c30c[_0xf787('0xc2')]);return db[_0xf787('0x47')][_0xf787('0x6e')](_0x104789)['then'](handleEntityNotFound(_0x585134,null))[_0xf787('0x31')](respondWithResult(_0x585134,null))['catch'](handleError(_0x585134,null));};exports[_0xf787('0xc3')]=function(_0xad796f,_0x125839){return db['OpenchannelInteraction'][_0xf787('0xc3')](_0xad796f[_0xf787('0xc4')],{})[_0xf787('0x31')](respondWithResult(_0x125839,0xc9))[_0xf787('0x3d')](handleError(_0x125839,null));};exports[_0xf787('0x30')]=function(_0x5429c6,_0x4f391a){if(_0x5429c6[_0xf787('0xc4')]['id']){delete _0x5429c6[_0xf787('0xc4')]['id'];}return db[_0xf787('0x47')][_0xf787('0x6e')]({'where':{'id':_0x5429c6[_0xf787('0xbf')]['id']}})[_0xf787('0x31')](handleEntityNotFound(_0x4f391a,null))['then'](saveUpdates(_0x5429c6[_0xf787('0xc4')],null))['then'](respondWithResult(_0x4f391a,null))[_0xf787('0x3d')](handleError(_0x4f391a,null));};exports[_0xf787('0x32')]=function(_0x5ba014,_0x1be31c){return db['OpenchannelInteraction'][_0xf787('0x6e')]({'where':{'id':_0x5ba014[_0xf787('0xbf')]['id']}})['then'](handleEntityNotFound(_0x1be31c,null))[_0xf787('0x31')](removeEntity(_0x1be31c,null))[_0xf787('0x3d')](handleError(_0x1be31c,null));};exports[_0xf787('0xc5')]=function(_0x4cc2be,_0x5775ba){return db[_0xf787('0x47')][_0xf787('0xc5')]()[_0xf787('0x31')](respondWithResult(_0x5775ba,null))['catch'](handleError(_0x5775ba,null));};exports[_0xf787('0xc6')]=function(_0x43274e,_0x2464b7,_0x59d0af){return db[_0xf787('0xc7')][_0xf787('0x6e')]({'where':{'id':_0x43274e[_0xf787('0xbf')]['id']}})[_0xf787('0x31')](handleEntityNotFound(_0x2464b7,null))[_0xf787('0x31')](function(_0x3a8031){if(_0x3a8031){return _0x3a8031[_0xf787('0xc6')](_0x43274e[_0xf787('0xc4')][_0xf787('0xc8')],_['omit'](_0x43274e[_0xf787('0xc4')],[_0xf787('0xc8'),'id'])||{});}})[_0xf787('0x31')](respondWithResult(_0x2464b7,null))[_0xf787('0x3d')](handleError(_0x2464b7,null));};exports[_0xf787('0xc9')]=function(_0xd2fc32,_0x1baad7,_0x57c82d){var _0x336e46={'raw':![],'where':{}};var _0x2a1fc8={};var _0x3beab3={'count':0x0,'rows':[]};return db[_0xf787('0x47')]['findOne']({'where':{'id':_0xd2fc32[_0xf787('0xbf')]['id']}})[_0xf787('0x31')](handleEntityNotFound(_0x1baad7,null))[_0xf787('0x31')](function(_0x4e39df){if(_0x4e39df){_0x2a1fc8[_0xf787('0x4b')]=_[_0xf787('0x4d')](db[_0xf787('0xc7')]['rawAttributes']);_0x2a1fc8['query']=_[_0xf787('0x4d')](_0xd2fc32[_0xf787('0x4c')]);_0x2a1fc8['filters']=_[_0xf787('0x4f')](_0x2a1fc8[_0xf787('0x4b')],_0x2a1fc8[_0xf787('0x4c')]);_0x336e46[_0xf787('0x50')]=_['intersection'](_0x2a1fc8['model'],qs[_0xf787('0x51')](_0xd2fc32[_0xf787('0x4c')][_0xf787('0x51')]));_0x336e46[_0xf787('0x50')]=_0x336e46[_0xf787('0x50')][_0xf787('0xa3')]?_0x336e46[_0xf787('0x50')]:_0x2a1fc8[_0xf787('0x4b')];if(!_0xd2fc32['query'][_0xf787('0xca')](_0xf787('0x52'))){_0x336e46['limit']=qs[_0xf787('0x28')](_0xd2fc32[_0xf787('0x4c')][_0xf787('0x28')]);_0x336e46[_0xf787('0x2a')]=qs['offset'](_0xd2fc32['query']['offset']);}_0x336e46[_0xf787('0x53')]=qs[_0xf787('0x54')](_0xd2fc32[_0xf787('0x4c')]['sort']);_0x336e46[_0xf787('0x55')]=qs[_0xf787('0x4e')](_[_0xf787('0x56')](_0xd2fc32['query'],_0x2a1fc8['filters']));_0x336e46[_0xf787('0x55')][_0xf787('0xcb')]=_0x4e39df['id'];if(_0xd2fc32[_0xf787('0x4c')][_0xf787('0x8e')]){_0x336e46[_0xf787('0x55')]=_[_0xf787('0xa7')](_0x336e46[_0xf787('0x55')],{'$or':_[_0xf787('0x46')](_0x336e46['attributes'],function(_0x11d8cd){var _0x105d13={};_0x105d13[_0x11d8cd]={'$like':'%'+_0xd2fc32[_0xf787('0x4c')][_0xf787('0x8e')]+'%'};return _0x105d13;})});}if(_0xd2fc32['query']['$gte']){var _0x42cd48=_0xd2fc32[_0xf787('0x4c')][_0xf787('0xcc')]['split'](',');var _0x26121d={};_0x26121d[_0x42cd48[0x0]]={'$gte':moment(_0x42cd48[0x1])['format'](_0xf787('0xcd'))};_0x336e46['where']=_['merge'](_0x336e46[_0xf787('0x55')],_0x26121d);}_0x336e46=_[_0xf787('0xa7')]({},_0x336e46,_0xd2fc32[_0xf787('0xc2')]);return db[_0xf787('0xc7')][_0xf787('0x29')]({'where':_0x336e46['where']})[_0xf787('0x31')](function(_0x424005){_0x3beab3[_0xf787('0x29')]=_0x424005;if(_0xd2fc32[_0xf787('0x4c')]['includeAll']){_0x336e46[_0xf787('0xc1')]=[{'all':!![]}];}return db[_0xf787('0xc7')]['findAll'](_0x336e46);})['then'](function(_0x3165f9){_0x3beab3['rows']=_0x3165f9;return _0x3beab3;});}})[_0xf787('0x31')](respondWithFilteredResult(_0x1baad7,_0x336e46))[_0xf787('0x3d')](handleError(_0x1baad7,null));};exports['addTags']=function(_0x56fd8d,_0x1fd51b,_0x143c3b){return db[_0xf787('0x47')]['find']({'where':{'id':_0x56fd8d[_0xf787('0xbf')]['id']}})[_0xf787('0x31')](handleEntityNotFound(_0x1fd51b,null))['then'](function(_0x170ba6){if(_0x170ba6){return _0x170ba6['setTags'](_0x56fd8d[_0xf787('0xc4')][_0xf787('0xc8')],_[_0xf787('0xce')](_0x56fd8d[_0xf787('0xc4')],[_0xf787('0xc8'),'id'])||{})[_0xf787('0xcf')](function(){return db['Tag']['findAll']({'attributes':['id',_0xf787('0x35'),_0xf787('0x59')],'where':{'id':_0x56fd8d['body'][_0xf787('0xc8')]}});})[_0xf787('0x31')](function(_0x5b0342){socket[_0xf787('0xd0')](_0xf787('0xd1'),{'id':Number(_0x56fd8d[_0xf787('0xbf')]['id']),'tags':_0x5b0342||[]});return{'id':Number(_0x56fd8d[_0xf787('0xbf')]['id']),'tags':_0x5b0342||[]};});}})['then'](respondWithResult(_0x1fd51b,null))[_0xf787('0x3d')](handleError(_0x1fd51b,null));};exports[_0xf787('0xd2')]=function(_0x1c29e7,_0x428009,_0x9bb2e2){return db[_0xf787('0x47')][_0xf787('0x6e')]({'where':{'id':_0x1c29e7[_0xf787('0xbf')]['id']}})[_0xf787('0x31')](handleEntityNotFound(_0x428009,null))[_0xf787('0x31')](function(_0x5c39b1){if(_0x5c39b1){return _0x5c39b1['removeTags'](_0x1c29e7['query'][_0xf787('0xc8')]);}})[_0xf787('0x31')](respondWithStatusCode(_0x428009,null))[_0xf787('0x3d')](handleError(_0x428009,null));};exports[_0xf787('0xd3')]=function(_0x203c8a,_0x425876){var _0x4df37d=moment()[_0xf787('0xd4')]()[_0xf787('0xa5')]();var _0x47b59c=path[_0xf787('0xd5')](config[_0xf787('0xd6')],_0xf787('0xd7'),_0xf787('0xd8'),'tmp');var _0x1afe7a=path[_0xf787('0xd5')](config['root'],_0xf787('0xd7'),'files','attachments');var _0x3279f5=path[_0xf787('0xd5')](_0x47b59c,_0x4df37d);var _0xaa197c=util[_0xf787('0xd9')](_0xf787('0xda'),_0x203c8a[_0xf787('0xbf')]['id'],_0x4df37d);var _0x4d3fcb=path[_0xf787('0xd5')](_0x47b59c,_0xaa197c);var _0xc98d23=[];_0xc98d23[_0xf787('0x3b')]({'model':db[_0xf787('0x7e')],'as':'User','attributes':['id',_0xf787('0x38')],'raw':!![]});_0xc98d23[_0xf787('0x3b')]({'model':db[_0xf787('0xdb')],'as':'Contact','attributes':['id','firstName',_0xf787('0xdc')],'raw':!![]});if(_0x203c8a[_0xf787('0x4c')][_0xf787('0xdd')]){_0xc98d23['push']({'model':db[_0xf787('0xde')],'as':_0xf787('0xde'),'raw':!![]});}var _0x1b1fe7=[{'model':db['OpenchannelMessage'],'as':_0xf787('0xdf'),'attributes':['id',_0xf787('0xc4'),'createdAt',_0xf787('0xe0'),_0xf787('0xe1'),_0xf787('0x89')],'include':_0xc98d23}];_0x1b1fe7[_0xf787('0x3b')]({'model':db['OpenchannelAccount'],'as':'Account','attributes':['id','name']});_0x1b1fe7[_0xf787('0x3b')]({'model':db['User'],'as':_0xf787('0xe2'),'attributes':['id',_0xf787('0x38')]});return db[_0xf787('0x47')][_0xf787('0x6e')]({'where':{'id':_0x203c8a[_0xf787('0xbf')]['id']},'include':_0x1b1fe7})[_0xf787('0x31')](handleEntityNotFound(_0x425876,null))[_0xf787('0x31')](function(_0x30246e){if(_0x30246e){var _0x7ba1a1=_0x30246e[_0xf787('0xe3')]({'plain':!![]});fs[_0xf787('0xe4')](_0x3279f5);var _0x10c541={'channel':_0xf787('0xe5'),'account':_0x7ba1a1[_0xf787('0xe6')][_0xf787('0x35')],'agent':_0x7ba1a1[_0xf787('0xe2')]?_0x7ba1a1[_0xf787('0xe2')][_0xf787('0x38')]:_0xf787('0xe7'),'createdAt':moment(_0x7ba1a1[_0xf787('0xe8')])[_0xf787('0xd9')](_0xf787('0xcd'))['toString'](),'closedAt':_0x7ba1a1[_0xf787('0x42')]?moment(_0x7ba1a1[_0xf787('0xe9')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x7ba1a1[_0xf787('0xea')],'visibility':_0x7ba1a1[_0xf787('0xeb')]?'Public':'Private','messages':_(_0x7ba1a1[_0xf787('0xdf')])[_0xf787('0x8e')]({'secret':![]})[_0xf787('0x46')](function(_0x8f0d0b){if(_0x8f0d0b[_0xf787('0xde')]){var _0x5bdc9e=path[_0xf787('0xd5')](_0x1afe7a,_0x8f0d0b[_0xf787('0xde')][_0xf787('0xec')]);if(fs[_0xf787('0xed')](_0x5bdc9e)){fs[_0xf787('0xee')](_0x5bdc9e)[_0xf787('0xef')](fs[_0xf787('0xf0')](path[_0xf787('0xd5')](_0x3279f5,_0x8f0d0b['Attachment'][_0xf787('0xec')])));}}return{'date':moment(_0x8f0d0b[_0xf787('0xe8')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xf787('0xa5')](),'sender':_0x8f0d0b[_0xf787('0xe0')]===_0xf787('0xf1')?_0x8f0d0b['User']?_0x8f0d0b['User'][_0xf787('0x38')]:_0xf787('0xf2'):_0x8f0d0b[_0xf787('0xf3')][_0xf787('0xf4')]+(_0x8f0d0b['Contact'][_0xf787('0xdc')]?'\x20'+_0x8f0d0b[_0xf787('0xf3')]['lastName']:''),'body':_0x8f0d0b[_0xf787('0xde')]?_0x8f0d0b[_0xf787('0xde')]['basename']:_0x8f0d0b['body'],'direction':_0x8f0d0b['direction']===_0xf787('0xf1')?'A':'C','secret':_0x8f0d0b[_0xf787('0xe1')],'read':_0x8f0d0b['read'],'attachment':_0x8f0d0b['Attachment']};})['value']()};return ejs['renderFile'](path[_0xf787('0xd5')](config[_0xf787('0xd6')],'server','views',_0xf787('0xf5')),{'interaction':_0x10c541})[_0xf787('0x31')](function(_0x45eb71){var _0x14dc31=path[_0xf787('0xd5')](_0x3279f5,_0xf787('0xf6')+_0x7ba1a1['id']+'-'+_0x4df37d+_0xf787('0xf7'));var _0x133c52={'path':_0x14dc31,'channel':_0xf787('0xe5'),'interactionId':_0x7ba1a1['id']};return pdf[_0xf787('0xf8')](_0x45eb71,_0x133c52);})[_0xf787('0x31')](function(){return new BPromise(function(_0x39e0b7,_0x33f47d){zipdir(_0x3279f5,{'saveTo':_0x4d3fcb},function(_0x478ea2,_0x2a38d7){if(_0x478ea2)return _0x33f47d(_0x478ea2);return _0x39e0b7(_0x2a38d7);});})[_0xf787('0x31')](function(){return new BPromise(function(_0x946a76,_0x42c130){rimraf(_0x3279f5,function(_0x3a7800){if(_0x3a7800)_0x42c130(_0x3a7800);return _0x946a76();});});})[_0xf787('0x31')](function(){return _0x425876[_0xf787('0xd3')](_0x4d3fcb,_0xaa197c,function(_0x59b0ba){if(_0x59b0ba){console[_0xf787('0xf9')](_0xf787('0xfa'),_0x59b0ba);}else{fs[_0xf787('0xfb')](_0x4d3fcb);}});});});}else{return _0x425876[_0xf787('0x23')](0xc8);}})[_0xf787('0x3d')](handleError(_0x425876,null));}; \ No newline at end of file +var _0x0479=['CmContact','firstName','lastName','attachments','Attachment','Messages','createdAt','secret','Account','Owner','get','mkdirSync','N.A.','threadId','Public','Private','basename','existsSync','createReadStream','direction','System','out','renderFile','downloadInteraction.ejs','.pdf','Openchannel','createPdfFromHTML','download','err','unlinkSync','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/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','save','then','destroy','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','push','catch','waiting','talking','answered','total','closed','UserId','unmanaged','index','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','nolimit','order','sort','where','filters','select','field','color','from','tools_tags','u.id','user_has_openchannel_interactions','left_join','users','u.id\x20=\x20ui.UserId','openchannel_interactions','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','operator','$substring','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','buildExpression','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','text','body','start','some','compact','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','parse','$gte','null','\x20IS\x20NULL','\x20=\x20?','read','tag','replace','isNumeric','i.id\x20LIKE\x20?','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','merge','OpenchannelInteraction','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','o.fullname','o.internal','ui.OpenchannelInteractionId\x20IN\x20?','OpenchannelInteractionId','all','show','params','includeAll','include','options','create','update','describe','addMessage','ids','getMessages','pick','filter','format','YYYY-MM-DD\x20HH:mm:ss','OpenchannelMessage','findAll','rows','addTags','setTags','omit','spread','emit','removeTags','unix','join','server','files','tmp','root','transcript-%d-%s.zip'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0479,0x10d));var _0x9047=function(_0x405c60,_0xd452e){_0x405c60=_0x405c60-0x0;var _0x2712f2=_0x0479[_0x405c60];return _0x2712f2;};'use strict';var emlformat=require(_0x9047('0x0'));var rimraf=require(_0x9047('0x1'));var zipdir=require(_0x9047('0x2'));var jsonpatch=require(_0x9047('0x3'));var rp=require(_0x9047('0x4'));var moment=require(_0x9047('0x5'));var BPromise=require(_0x9047('0x6'));var Mustache=require(_0x9047('0x7'));var util=require(_0x9047('0x8'));var path=require(_0x9047('0x9'));var sox=require(_0x9047('0xa'));var csv=require(_0x9047('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9047('0xc'));var _=require(_0x9047('0xd'));var squel=require(_0x9047('0xe'));var crypto=require(_0x9047('0xf'));var jsforce=require(_0x9047('0x10'));var deskjs=require(_0x9047('0x11'));var toCsv=require('to-csv');var querystring=require(_0x9047('0x12'));var Papa=require(_0x9047('0x13'));var Redis=require(_0x9047('0x14'));var authService=require(_0x9047('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x9047('0x16'));var pdf=require(_0x9047('0x17'));var hardwareService=require(_0x9047('0x18'));var logger=require('../../config/logger')(_0x9047('0x19'));var utils=require(_0x9047('0x1a'));var config=require(_0x9047('0x1b'));var licenseUtil=require(_0x9047('0x1c'));var db=require(_0x9047('0x1d'))['db'];config[_0x9047('0x1e')]=_[_0x9047('0x1f')](config[_0x9047('0x1e')],{'host':_0x9047('0x20'),'port':0x18eb});var socket=require(_0x9047('0x21'))(new Redis(config[_0x9047('0x1e')]));require(_0x9047('0x22'))['register'](socket);function respondWithStatusCode(_0x1b0b8f,_0x36248c){_0x36248c=_0x36248c||0xcc;return function(_0x92f935){if(_0x92f935){return _0x1b0b8f[_0x9047('0x23')](_0x36248c);}return _0x1b0b8f['status'](_0x36248c)[_0x9047('0x24')]();};}function respondWithResult(_0x3a9cba,_0xf0cc14){_0xf0cc14=_0xf0cc14||0xc8;return function(_0x5ea1d0){if(_0x5ea1d0){return _0x3a9cba[_0x9047('0x25')](_0xf0cc14)['json'](_0x5ea1d0);}};}function respondWithFilteredResult(_0x4b7a13,_0x6df18b){return function(_0x6efc2){if(_0x6efc2){var _0x377b61=typeof _0x6df18b[_0x9047('0x26')]===_0x9047('0x27')&&typeof _0x6df18b[_0x9047('0x28')]===_0x9047('0x27');var _0x2f41f6=_0x6efc2[_0x9047('0x29')];var _0x4963c8=_0x377b61?0x0:_0x6df18b[_0x9047('0x26')];var _0x2e4de9=_0x377b61?_0x6efc2[_0x9047('0x29')]:_0x6df18b[_0x9047('0x26')]+_0x6df18b[_0x9047('0x28')];var _0x47159e;if(_0x2e4de9>=_0x2f41f6){_0x2e4de9=_0x2f41f6;_0x47159e=0xc8;}else{_0x47159e=0xce;}_0x4b7a13[_0x9047('0x25')](_0x47159e);return _0x4b7a13['set'](_0x9047('0x2a'),_0x4963c8+'-'+_0x2e4de9+'/'+_0x2f41f6)[_0x9047('0x2b')](_0x6efc2);}return null;};}function patchUpdates(_0x4ba60c){return function(_0x362ff7){try{jsonpatch['apply'](_0x362ff7,_0x4ba60c,!![]);}catch(_0x54d330){return BPromise['reject'](_0x54d330);}return _0x362ff7[_0x9047('0x2c')]();};}function saveUpdates(_0x269fe3,_0x4d5d0f){return function(_0x1e73e6){if(_0x1e73e6){return _0x1e73e6['update'](_0x269fe3)[_0x9047('0x2d')](function(_0x201cbf){return _0x201cbf;});}return null;};}function removeEntity(_0x4120c9,_0x5877b5){return function(_0x418d0a){if(_0x418d0a){return _0x418d0a[_0x9047('0x2e')]()[_0x9047('0x2d')](function(){_0x4120c9[_0x9047('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4548ab,_0x5a20dd){return function(_0x31c7a4){if(!_0x31c7a4){_0x4548ab[_0x9047('0x23')](0x194);}return _0x31c7a4;};}function handleError(_0x2c48e2,_0x1cb1d3){_0x1cb1d3=_0x1cb1d3||0x1f4;return function(_0x568c94){logger[_0x9047('0x2f')](_0x568c94[_0x9047('0x30')]);if(_0x568c94[_0x9047('0x31')]){delete _0x568c94[_0x9047('0x31')];}_0x2c48e2[_0x9047('0x25')](_0x1cb1d3)[_0x9047('0x32')](_0x568c94);};}function getInteractionUsers(_0x51b1a2,_0x477a90){return new BPromise(function(_0x95c547,_0x603104){try{if(_0x477a90[_0x51b1a2['id']]){_0x51b1a2[_0x9047('0x33')]=_[_0x9047('0x34')](_0x477a90[_0x51b1a2['id']],function(_0x3e1542){return{'id':_0x3e1542['id'],'fullname':_0x3e1542[_0x9047('0x35')]};});}}catch(_0x564387){_0x603104(_0x564387);}_0x95c547(_0x51b1a2);});}function getInteractionTags(_0x5a227c,_0x25534f){return new BPromise(function(_0x5aac87,_0x2aaada){try{if(_0x5a227c[_0x9047('0x36')]){_0x5a227c[_0x9047('0x37')]=[];_0x5a227c[_0x9047('0x36')][_0x9047('0x38')](',')['forEach'](function(_0x4acb39){_0x5a227c[_0x9047('0x37')][_0x9047('0x39')](_0x25534f[_0x4acb39]);});}delete _0x5a227c[_0x9047('0x36')];}catch(_0x491f96){_0x2aaada(_0x491f96);}_0x5aac87(_0x5a227c);});}function updateOpenchannelInteraction(_0x2f7cfc,_0x117808,_0x29cc68){return new BPromise(function(_0x281f11,_0x297397){return getInteractionUsers(_0x2f7cfc,_0x29cc68)[_0x9047('0x2d')](function(_0x1ffa32){return getInteractionTags(_0x1ffa32,_0x117808);})[_0x9047('0x2d')](function(_0x3272fd){return getStateInteraction(_0x3272fd);})[_0x9047('0x2d')](function(_0xa07044){_0x281f11(_0xa07044);})[_0x9047('0x3a')](function(_0x1a28e0){_0x297397(_0x1a28e0);});});}function getStateInteraction(_0x562151){return new BPromise(function(_0x5da3c7){_0x562151[_0x9047('0x3b')]=0x0;_0x562151[_0x9047('0x3c')]=0x0;_0x562151[_0x9047('0x3d')]=0x0;_0x562151['unmanaged']=0x0;_0x562151[_0x9047('0x3e')]=0x0;if(!_0x562151[_0x9047('0x3f')]&&!_0x562151[_0x9047('0x40')]){_0x562151[_0x9047('0x3b')]+=0x1;}if(!_0x562151[_0x9047('0x3f')]&&_0x562151['UserId']){_0x562151[_0x9047('0x3c')]+=0x1;if(_0x562151['waiting']){_0x562151[_0x9047('0x3b')]-=0x1;}}if(_0x562151[_0x9047('0x3f')]&&_0x562151[_0x9047('0x40')]){_0x562151[_0x9047('0x3d')]+=0x1;if(_0x562151['talking']){_0x562151['talking']-=0x1;}}if(_0x562151[_0x9047('0x3f')]&&!_0x562151[_0x9047('0x40')]){_0x562151[_0x9047('0x41')]+=0x1;if(_0x562151[_0x9047('0x3b')]){_0x562151[_0x9047('0x3b')]-=0x1;}}_0x562151[_0x9047('0x3e')]+=0x1;_0x5da3c7(_0x562151);});}exports[_0x9047('0x42')]=function(_0x568cd2,_0x5450a1){var _0x2484af={},_0x2fc864={},_0x4220b4={'count':0x0,'rows':[]};var _0x37fa55=_[_0x9047('0x34')](db['OpenchannelInteraction'][_0x9047('0x43')],function(_0x52bd19){return{'name':_0x52bd19['fieldName'],'type':_0x52bd19[_0x9047('0x44')][_0x9047('0x45')]};});_0x2fc864[_0x9047('0x46')]=_[_0x9047('0x34')](_0x37fa55,'name');_0x2fc864['query']=_[_0x9047('0x47')](_0x568cd2[_0x9047('0x48')]);_0x2fc864['filters']=_[_0x9047('0x49')](_0x2fc864[_0x9047('0x46')],_0x2fc864['query']);_0x2484af[_0x9047('0x4a')]=_[_0x9047('0x49')](_0x2fc864[_0x9047('0x46')],qs[_0x9047('0x4b')](_0x568cd2[_0x9047('0x48')][_0x9047('0x4b')]));_0x2484af['attributes']=_0x2484af['attributes']['length']?_0x2484af[_0x9047('0x4a')]:_0x2fc864[_0x9047('0x46')];if(!_0x568cd2[_0x9047('0x48')]['hasOwnProperty'](_0x9047('0x4c'))){_0x2484af[_0x9047('0x28')]=qs['limit'](_0x568cd2[_0x9047('0x48')]['limit']);_0x2484af['offset']=qs['offset'](_0x568cd2[_0x9047('0x48')]['offset']);}_0x2484af[_0x9047('0x4d')]=qs[_0x9047('0x4e')](_0x568cd2['query'][_0x9047('0x4e')]);_0x2484af[_0x9047('0x4f')]=qs[_0x9047('0x50')](_['pick'](_0x568cd2[_0x9047('0x48')],_0x2fc864[_0x9047('0x50')]),_0x37fa55);var _0x19c522=[];var _0x49bcca=squel[_0x9047('0x51')]()[_0x9047('0x52')]('id')[_0x9047('0x52')]('name')['field'](_0x9047('0x53'))[_0x9047('0x54')](_0x9047('0x55'));var _0x837a60=squel[_0x9047('0x51')]()['field'](_0x9047('0x56'))[_0x9047('0x52')]('u.fullname')[_0x9047('0x52')]('ui.OpenchannelInteractionId')[_0x9047('0x54')](_0x9047('0x57'),'ui')[_0x9047('0x58')](_0x9047('0x59'),'u',_0x9047('0x5a'));var _0x500c04=squel['select']()[_0x9047('0x54')](_0x9047('0x5b'),'i')[_0x9047('0x58')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x9047('0x58')](_0x9047('0x59'),'o',_0x9047('0x5c'))['left_join'](_0x9047('0x5d'),'a',_0x9047('0x5e'))[_0x9047('0x58')](_0x9047('0x5f'),'me',_0x9047('0x60'))[_0x9047('0x58')](_0x9047('0x61'),'it','it.OpenchannelInteractionId\x20=\x20i.id')['left_join'](_0x9047('0x55'),'t',_0x9047('0x62'));var _0x14dd07=squel[_0x9047('0x63')]();var _0x17c4e6=[];var _0x1b978a=squel['expr']();var _0x3f994c;if(_0x568cd2['query'][_0x9047('0x64')]){_0x3f994c=as[_0x9047('0x65')](_0x568cd2['query'][_0x9047('0x64')]);var _0x57a2df=_0x3f994c[_0x9047('0x66')];for(var _0x5c3173=0x0;_0x5c3173<_0x3f994c['conditions']['length'];_0x5c3173++){var _0x177557=_0x3f994c[_0x9047('0x67')][_0x5c3173];var _0x4f6ad4='i';var _0x933863=_['find'](_0x37fa55,['name',_0x177557[_0x9047('0x52')]]);if(!_0x933863){switch(_0x177557[_0x9047('0x52')]){case _0x9047('0x68'):if(_0x177557[_0x9047('0x69')]==0x1){_0x500c04['having']('`'+_0x177557['field']+_0x9047('0x6a'));}else{_0x500c04[_0x9047('0x6b')]('`'+_0x177557[_0x9047('0x52')]+_0x9047('0x6c'));}break;case _0x9047('0x6d'):if(_0x177557[_0x9047('0x6e')]===_0x9047('0x6f')){if(_0x177557[_0x9047('0x69')][_0x9047('0x38')]('\x20')[_0x9047('0x70')]>0x1){_0x14dd07[_0x57a2df](_0x9047('0x71'),qs['getFullTextValue'](_0x177557[_0x9047('0x69')]),null);}else{var _0x2f484b='%'+_0x177557[_0x9047('0x69')]+'%';_0x14dd07[_0x57a2df]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x2f484b,_0x2f484b,_0x2f484b);}}else{_0x933863=_['find'](_0x37fa55,[_0x9047('0x31'),_0x9047('0x72')]);_0x177557[_0x9047('0x52')]=_0x9047('0x72');_0x32a824=as[_0x9047('0x73')](_0x4f6ad4,_0x933863[_0x9047('0x44')],_0x177557);_0x14dd07[_0x57a2df](_0x32a824['text'],_0x32a824[_0x9047('0x69')]['start'],_0x32a824[_0x9047('0x69')]['end']);}break;case'Tag':var _0x1c31ba=_0x177557[_0x9047('0x69')][_0x9047('0x38')](',')[_0x9047('0x34')](function(_0x3c3616){return Number(_0x3c3616);});_0x1c31ba[_0x9047('0x74')](function(_0x50c237){_0x1b978a['or'](_0x9047('0x75'),'%,'+_0x50c237+',%');});_0x17c4e6=_[_0x9047('0x76')](_0x17c4e6,_0x1c31ba);break;case _0x9047('0x77'):if(_0x177557[_0x9047('0x6e')]==='$substring'){_0x14dd07[_0x57a2df](_0x9047('0x78'),'%'+_0x177557[_0x9047('0x69')]+'%',null);}else{_0x933863=_[_0x9047('0x79')](_0x37fa55,[_0x9047('0x31'),_0x9047('0x40')]);_0x177557['field']=_0x9047('0x40');_0x32a824=as[_0x9047('0x73')](_0x4f6ad4,_0x933863['type'],_0x177557);_0x14dd07[_0x57a2df](_0x32a824[_0x9047('0x7a')],_0x32a824[_0x9047('0x69')]['start'],_0x32a824['value'][_0x9047('0x24')]);}break;case _0x9047('0x7b'):_0x32a824=as[_0x9047('0x73')]('me',null,_0x177557);_0x14dd07[_0x57a2df](_0x32a824[_0x9047('0x7a')],_0x32a824[_0x9047('0x69')][_0x9047('0x7c')],_0x32a824['value'][_0x9047('0x24')]);break;}}else{var _0x32a824=as[_0x9047('0x73')](_0x4f6ad4,_0x933863[_0x9047('0x44')],_0x177557);_0x14dd07[_0x57a2df](_0x32a824[_0x9047('0x7a')],_0x32a824[_0x9047('0x69')][_0x9047('0x7c')],_0x32a824[_0x9047('0x69')]['end']);}}}else{var _0x306039=_(_0x568cd2[_0x9047('0x48')])[_0x9047('0x47')]()[_0x9047('0x34')](function(_0x173400){return _[_0x9047('0x7d')](_0x37fa55,[_0x9047('0x31'),_0x173400])?_0x173400:undefined;})[_0x9047('0x7e')]()[_0x9047('0x69')]();if(!_[_0x9047('0x7f')](_0x306039)){_0x306039['forEach'](function(_0x139f0b){if(_0x139f0b===_0x9047('0x80')){_0x500c04[_0x9047('0x4f')](_0x9047('0x81'),[]['concat'](_0x568cd2[_0x9047('0x48')][_0x139f0b]));}else if(_0x139f0b==='createdAt'){var _0x505608=JSON[_0x9047('0x82')](_0x568cd2[_0x9047('0x48')][_0x139f0b])[_0x9047('0x83')];var _0x2e18f7=JSON[_0x9047('0x82')](_0x568cd2['query'][_0x139f0b])['$lte'];_0x500c04[_0x9047('0x4f')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x505608,_0x2e18f7);}else{if(_0x568cd2[_0x9047('0x48')][_0x139f0b]===_0x9047('0x84')){_0x500c04[_0x9047('0x4f')]('i.'+_0x139f0b+_0x9047('0x85'));}else{_0x500c04[_0x9047('0x4f')]('i.'+_0x139f0b+_0x9047('0x86'),_0x568cd2[_0x9047('0x48')][_0x139f0b]);}}});}if(_0x568cd2[_0x9047('0x48')][_0x9047('0x87')]){if(_0x568cd2[_0x9047('0x48')][_0x9047('0x87')]==0x1){_0x500c04[_0x9047('0x6b')]('`unreadMessages`\x20=\x200');}else{_0x500c04[_0x9047('0x6b')]('`unreadMessages`\x20>\x200');}}if(_0x568cd2[_0x9047('0x48')][_0x9047('0x88')]){_0x17c4e6=_['isArray'](_0x568cd2['query']['tag'])?_0x568cd2['query'][_0x9047('0x88')]:new Array(_0x568cd2[_0x9047('0x48')][_0x9047('0x88')]);_0x17c4e6['forEach'](function(_0x554dfc){_0x1b978a['or'](_0x9047('0x75'),'%,'+_0x554dfc+',%');});}if(_0x568cd2['query']['filter']){var _0x1a7571=_0x568cd2[_0x9047('0x48')]['filter'][_0x9047('0x89')]('\x5c','\x5c\x5c')[_0x9047('0x89')](/'/g,'\x27\x27');if(qs[_0x9047('0x8a')](_0x1a7571)){_0x14dd07['or'](_0x9047('0x8b'),_0x1a7571+'%');}else{_0x14dd07['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x1a7571))['or'](_0x9047('0x8c'),_0x1a7571+'%')['or'](_0x9047('0x8d'),_0x1a7571+'%');}}}_0x500c04[_0x9047('0x4f')](_0x14dd07);_0x500c04[_0x9047('0x8e')](_0x9047('0x8f'));var _0x5842cc={'type':db['Sequelize'][_0x9047('0x90')][_0x9047('0x91')],'raw':!![]};var _0xadcb13=_0x500c04[_0x9047('0x92')]();_0xadcb13[_0x9047('0x52')](_0x9047('0x8f'));_0xadcb13[_0x9047('0x52')](_0x9047('0x93'),_0x9047('0x68'));if(_0x2484af[_0x9047('0x4d')]){_0x2484af[_0x9047('0x4d')][_0x9047('0x74')](function(_0x5e94ab){var _0x5a39df=_0x5e94ab[0x0]===_0x9047('0x94')?_0x5e94ab[0x0]:'i.'+_0x5e94ab[0x0];_0x500c04[_0x9047('0x4d')](_0x5a39df,_0x5e94ab[0x1]===_0x9047('0x95')?![]:!![]);});}if(!_[_0x9047('0x7f')](_0x17c4e6)){_0x500c04[_0x9047('0x6b')](_0x1b978a);_0xadcb13[_0x9047('0x4f')](_0x9047('0x96'),_0x17c4e6);}BPromise[_0x9047('0x97')]()[_0x9047('0x2d')](function(){if(!_0x3f994c){if(_0x568cd2[_0x9047('0x48')][_0x9047('0x80')])return;_0xadcb13[_0x9047('0x4f')](_0x9047('0x98'));_0x500c04[_0x9047('0x4f')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x568cd2[_0x9047('0x99')][_0x9047('0x9a')]!==_0x9047('0x9b'))return;return _0x568cd2[_0x9047('0x99')][_0x9047('0x9c')]({'attributes':['id'],'raw':!![]})[_0x9047('0x2d')](function(_0x36e952){if(_[_0x9047('0x7f')](_0x36e952)){_0xadcb13[_0x9047('0x4f')](_0x9047('0x9d'));_0x500c04[_0x9047('0x4f')](_0x9047('0x9d'));}else{_0xadcb13[_0x9047('0x4f')](_0x9047('0x81'),_[_0x9047('0x34')](_0x36e952,'id'));_0x500c04[_0x9047('0x4f')](_0x9047('0x81'),_[_0x9047('0x34')](_0x36e952,'id'));}});})[_0x9047('0x2d')](function(){if(_0x568cd2[_0x9047('0x99')][_0x9047('0x9a')]===_0x9047('0x9b')&&!_0x3f994c&&!_0x568cd2['query']['OpenchannelAccountId'])return[];return db[_0x9047('0x9e')]['query'](_0xadcb13[_0x9047('0x9f')](),_0x5842cc);})[_0x9047('0x2d')](function(_0x545c5a){_0x4220b4[_0x9047('0x29')]=_0x545c5a[_0x9047('0x70')];if(_0x4220b4[_0x9047('0x29')]===0x0)return[];return db[_0x9047('0x9e')][_0x9047('0x48')](_0x49bcca['toString'](),_0x5842cc)[_0x9047('0x2d')](function(_0x2ac71c){_0x19c522=_['keyBy'](_0x2ac71c,'id');_0x5842cc=_[_0x9047('0xa0')](_0x5842cc,{'model':db[_0x9047('0xa1')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x568cd2[_0x9047('0x48')][_0x9047('0x4b')]){_0x2484af['attributes'][_0x9047('0x74')](function(_0x5821f8){_0x500c04[_0x9047('0x52')]('i.'+_0x5821f8);});}else{_0x500c04[_0x9047('0x52')](_0x9047('0x93'),_0x9047('0x68'));_0x500c04['field'](_0x9047('0xa2'),'Account.key');_0x500c04[_0x9047('0x52')](_0x9047('0xa3'),_0x9047('0xa4'));_0x500c04['field']('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',_0x9047('0x94'));_0x500c04['field'](_0x9047('0xa5'));_0x500c04[_0x9047('0x52')](_0x9047('0xa6'),_0x9047('0xa7'));_0x500c04[_0x9047('0x52')]('c.lastName',_0x9047('0xa8'));_0x500c04[_0x9047('0x52')](_0x9047('0xa9'),_0x9047('0xaa'));_0x500c04['field'](_0x9047('0xab'),'Contact.phone');_0x500c04['field'](_0x9047('0xac'),'Contact.mobile');_0x500c04['field']('c.fax','Contact.fax');_0x500c04[_0x9047('0x52')](_0x9047('0xad'),'Owner.fullname');_0x500c04['field'](_0x9047('0xae'),'Owner.internal');_0x500c04['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x9047('0x36'));}if(_0x2484af['limit'])_0x500c04[_0x9047('0x28')](_0x2484af[_0x9047('0x28')]);if(_0x2484af[_0x9047('0x26')])_0x500c04[_0x9047('0x26')](_0x2484af[_0x9047('0x26')]);return db[_0x9047('0x9e')][_0x9047('0x48')](_0x500c04[_0x9047('0x9f')](),_0x5842cc);})[_0x9047('0x2d')](function(_0x540a76){if(_0x540a76[_0x9047('0x70')]>0x0)_0x837a60[_0x9047('0x4f')](_0x9047('0xaf'),_[_0x9047('0x34')](_0x540a76,'id'));return db['sequelize'][_0x9047('0x48')](_0x837a60[_0x9047('0x9f')](),_0x5842cc)[_0x9047('0x2d')](function(_0x84178c){var _0x38c273=_['groupBy'](_0x84178c,_0x9047('0xb0'));var _0x297679=[];_0x540a76[_0x9047('0x74')](function(_0x302f0c){_0x297679[_0x9047('0x39')](updateOpenchannelInteraction(_0x302f0c,_0x19c522,_0x38c273));});return BPromise[_0x9047('0xb1')](_0x297679);});});})[_0x9047('0x2d')](function(_0x3e17cf){_0x4220b4['rows']=_0x3e17cf;return _0x4220b4;})[_0x9047('0x2d')](respondWithFilteredResult(_0x5450a1,_0x2484af))[_0x9047('0x3a')](handleError(_0x5450a1,null));};exports[_0x9047('0xb2')]=function(_0x42c909,_0x46fa35){var _0x300bb5={};if(_0x42c909['query'][_0x9047('0x44')]&&_0x42c909[_0x9047('0x48')][_0x9047('0x44')]==='from'){_0x300bb5[_0x9047('0x54')]=_0x42c909[_0x9047('0xb3')]['id'];}else{_0x300bb5['id']=_0x42c909[_0x9047('0xb3')]['id'];}var _0x2bfe60={'raw':![],'where':_0x300bb5},_0x464302={};_0x464302[_0x9047('0x46')]=_[_0x9047('0x47')](db[_0x9047('0xa1')][_0x9047('0x43')]);_0x464302[_0x9047('0x48')]=_[_0x9047('0x47')](_0x42c909[_0x9047('0x48')]);_0x464302['filters']=_[_0x9047('0x49')](_0x464302['model'],_0x464302[_0x9047('0x48')]);_0x2bfe60['attributes']=_[_0x9047('0x49')](_0x464302['model'],qs[_0x9047('0x4b')](_0x42c909[_0x9047('0x48')][_0x9047('0x4b')]));_0x2bfe60[_0x9047('0x4a')]=_0x2bfe60[_0x9047('0x4a')][_0x9047('0x70')]?_0x2bfe60[_0x9047('0x4a')]:_0x464302[_0x9047('0x46')];if(_0x42c909[_0x9047('0x48')][_0x9047('0xb4')]){_0x2bfe60[_0x9047('0xb5')]=[{'all':!![]}];}_0x2bfe60=_[_0x9047('0xa0')]({},_0x2bfe60,_0x42c909[_0x9047('0xb6')]);return db[_0x9047('0xa1')][_0x9047('0x79')](_0x2bfe60)[_0x9047('0x2d')](handleEntityNotFound(_0x46fa35,null))[_0x9047('0x2d')](respondWithResult(_0x46fa35,null))[_0x9047('0x3a')](handleError(_0x46fa35,null));};exports[_0x9047('0xb7')]=function(_0x4079b3,_0x2e96f7){return db[_0x9047('0xa1')][_0x9047('0xb7')](_0x4079b3['body'],{})[_0x9047('0x2d')](respondWithResult(_0x2e96f7,0xc9))[_0x9047('0x3a')](handleError(_0x2e96f7,null));};exports[_0x9047('0xb8')]=function(_0x53826c,_0x2a4bb0){if(_0x53826c[_0x9047('0x7b')]['id']){delete _0x53826c[_0x9047('0x7b')]['id'];}return db[_0x9047('0xa1')][_0x9047('0x79')]({'where':{'id':_0x53826c[_0x9047('0xb3')]['id']}})['then'](handleEntityNotFound(_0x2a4bb0,null))[_0x9047('0x2d')](saveUpdates(_0x53826c[_0x9047('0x7b')],null))[_0x9047('0x2d')](respondWithResult(_0x2a4bb0,null))[_0x9047('0x3a')](handleError(_0x2a4bb0,null));};exports['destroy']=function(_0x1c5d36,_0x4081f2){return db[_0x9047('0xa1')][_0x9047('0x79')]({'where':{'id':_0x1c5d36[_0x9047('0xb3')]['id']}})[_0x9047('0x2d')](handleEntityNotFound(_0x4081f2,null))[_0x9047('0x2d')](removeEntity(_0x4081f2,null))[_0x9047('0x3a')](handleError(_0x4081f2,null));};exports[_0x9047('0xb9')]=function(_0x3364cc,_0x284dd9){return db[_0x9047('0xa1')]['describe']()[_0x9047('0x2d')](respondWithResult(_0x284dd9,null))['catch'](handleError(_0x284dd9,null));};exports[_0x9047('0xba')]=function(_0x26be74,_0x159f26,_0x56fac6){return db['OpenchannelMessage'][_0x9047('0x79')]({'where':{'id':_0x26be74[_0x9047('0xb3')]['id']}})[_0x9047('0x2d')](handleEntityNotFound(_0x159f26,null))[_0x9047('0x2d')](function(_0x14306d){if(_0x14306d){return _0x14306d['addMessage'](_0x26be74['body']['ids'],_['omit'](_0x26be74[_0x9047('0x7b')],[_0x9047('0xbb'),'id'])||{});}})[_0x9047('0x2d')](respondWithResult(_0x159f26,null))[_0x9047('0x3a')](handleError(_0x159f26,null));};exports[_0x9047('0xbc')]=function(_0x2364d1,_0x5c6355,_0x58425c){var _0x29e789={'raw':![],'where':{}};var _0x54ebc6={};var _0x27972d={'count':0x0,'rows':[]};return db[_0x9047('0xa1')]['findOne']({'where':{'id':_0x2364d1[_0x9047('0xb3')]['id']}})[_0x9047('0x2d')](handleEntityNotFound(_0x5c6355,null))[_0x9047('0x2d')](function(_0x3e68b8){if(_0x3e68b8){_0x54ebc6[_0x9047('0x46')]=_['keys'](db['OpenchannelMessage'][_0x9047('0x43')]);_0x54ebc6[_0x9047('0x48')]=_[_0x9047('0x47')](_0x2364d1[_0x9047('0x48')]);_0x54ebc6[_0x9047('0x50')]=_[_0x9047('0x49')](_0x54ebc6['model'],_0x54ebc6['query']);_0x29e789[_0x9047('0x4a')]=_[_0x9047('0x49')](_0x54ebc6['model'],qs['fields'](_0x2364d1[_0x9047('0x48')]['fields']));_0x29e789[_0x9047('0x4a')]=_0x29e789[_0x9047('0x4a')][_0x9047('0x70')]?_0x29e789[_0x9047('0x4a')]:_0x54ebc6['model'];if(!_0x2364d1[_0x9047('0x48')]['hasOwnProperty'](_0x9047('0x4c'))){_0x29e789['limit']=qs[_0x9047('0x28')](_0x2364d1[_0x9047('0x48')]['limit']);_0x29e789[_0x9047('0x26')]=qs[_0x9047('0x26')](_0x2364d1[_0x9047('0x48')][_0x9047('0x26')]);}_0x29e789[_0x9047('0x4d')]=qs['sort'](_0x2364d1[_0x9047('0x48')][_0x9047('0x4e')]);_0x29e789[_0x9047('0x4f')]=qs[_0x9047('0x50')](_[_0x9047('0xbd')](_0x2364d1[_0x9047('0x48')],_0x54ebc6[_0x9047('0x50')]));_0x29e789[_0x9047('0x4f')][_0x9047('0xb0')]=_0x3e68b8['id'];if(_0x2364d1['query'][_0x9047('0xbe')]){_0x29e789[_0x9047('0x4f')]=_[_0x9047('0xa0')](_0x29e789[_0x9047('0x4f')],{'$or':_[_0x9047('0x34')](_0x29e789[_0x9047('0x4a')],function(_0x76045b){var _0x34f509={};_0x34f509[_0x76045b]={'$like':'%'+_0x2364d1['query'][_0x9047('0xbe')]+'%'};return _0x34f509;})});}if(_0x2364d1[_0x9047('0x48')][_0x9047('0x83')]){var _0x484968=_0x2364d1['query'][_0x9047('0x83')][_0x9047('0x38')](',');var _0x300d08={};_0x300d08[_0x484968[0x0]]={'$gte':moment(_0x484968[0x1])[_0x9047('0xbf')](_0x9047('0xc0'))};_0x29e789[_0x9047('0x4f')]=_[_0x9047('0xa0')](_0x29e789[_0x9047('0x4f')],_0x300d08);}_0x29e789=_['merge']({},_0x29e789,_0x2364d1['options']);return db['OpenchannelMessage'][_0x9047('0x29')]({'where':_0x29e789[_0x9047('0x4f')]})[_0x9047('0x2d')](function(_0x494920){_0x27972d[_0x9047('0x29')]=_0x494920;if(_0x2364d1['query']['includeAll']){_0x29e789[_0x9047('0xb5')]=[{'all':!![]}];}return db[_0x9047('0xc1')][_0x9047('0xc2')](_0x29e789);})[_0x9047('0x2d')](function(_0x3a743d){_0x27972d[_0x9047('0xc3')]=_0x3a743d;return _0x27972d;});}})[_0x9047('0x2d')](respondWithFilteredResult(_0x5c6355,_0x29e789))[_0x9047('0x3a')](handleError(_0x5c6355,null));};exports[_0x9047('0xc4')]=function(_0x2f3bed,_0x11c9c4,_0x308369){return db[_0x9047('0xa1')][_0x9047('0x79')]({'where':{'id':_0x2f3bed['params']['id']}})[_0x9047('0x2d')](handleEntityNotFound(_0x11c9c4,null))[_0x9047('0x2d')](function(_0x389790){if(_0x389790){return _0x389790[_0x9047('0xc5')](_0x2f3bed['body'][_0x9047('0xbb')],_[_0x9047('0xc6')](_0x2f3bed['body'],[_0x9047('0xbb'),'id'])||{})[_0x9047('0xc7')](function(){return db['Tag'][_0x9047('0xc2')]({'attributes':['id',_0x9047('0x31'),'color'],'where':{'id':_0x2f3bed[_0x9047('0x7b')][_0x9047('0xbb')]}});})[_0x9047('0x2d')](function(_0x5a556b){socket[_0x9047('0xc8')]('openchannelInteractionTags:save',{'id':Number(_0x2f3bed[_0x9047('0xb3')]['id']),'tags':_0x5a556b||[]});return{'id':Number(_0x2f3bed[_0x9047('0xb3')]['id']),'tags':_0x5a556b||[]};});}})[_0x9047('0x2d')](respondWithResult(_0x11c9c4,null))[_0x9047('0x3a')](handleError(_0x11c9c4,null));};exports['removeTags']=function(_0x51166f,_0x315086,_0x565c76){return db[_0x9047('0xa1')][_0x9047('0x79')]({'where':{'id':_0x51166f[_0x9047('0xb3')]['id']}})['then'](handleEntityNotFound(_0x315086,null))['then'](function(_0x2831d7){if(_0x2831d7){return _0x2831d7[_0x9047('0xc9')](_0x51166f[_0x9047('0x48')]['ids']);}})[_0x9047('0x2d')](respondWithStatusCode(_0x315086,null))[_0x9047('0x3a')](handleError(_0x315086,null));};exports['download']=function(_0x5c139c,_0x18ec59){var _0x4d0659=moment()[_0x9047('0xca')]()[_0x9047('0x9f')]();var _0x28b31a=path[_0x9047('0xcb')](config['root'],_0x9047('0xcc'),_0x9047('0xcd'),_0x9047('0xce'));var _0x3352c3=path[_0x9047('0xcb')](config[_0x9047('0xcf')],_0x9047('0xcc'),_0x9047('0xcd'),'attachments');var _0x2d3ba6=path[_0x9047('0xcb')](_0x28b31a,_0x4d0659);var _0x2db0cc=util[_0x9047('0xbf')](_0x9047('0xd0'),_0x5c139c[_0x9047('0xb3')]['id'],_0x4d0659);var _0x33b91d=path[_0x9047('0xcb')](_0x28b31a,_0x2db0cc);var _0x4c213e=[];_0x4c213e[_0x9047('0x39')]({'model':db[_0x9047('0x77')],'as':_0x9047('0x77'),'attributes':['id',_0x9047('0x35')],'raw':!![]});_0x4c213e[_0x9047('0x39')]({'model':db[_0x9047('0xd1')],'as':'Contact','attributes':['id',_0x9047('0xd2'),_0x9047('0xd3')],'raw':!![]});if(_0x5c139c[_0x9047('0x48')][_0x9047('0xd4')]){_0x4c213e[_0x9047('0x39')]({'model':db[_0x9047('0xd5')],'as':_0x9047('0xd5'),'raw':!![]});}var _0x47e51b=[{'model':db[_0x9047('0xc1')],'as':_0x9047('0xd6'),'attributes':['id','body',_0x9047('0xd7'),'direction',_0x9047('0xd8'),_0x9047('0x87')],'include':_0x4c213e}];_0x47e51b[_0x9047('0x39')]({'model':db['OpenchannelAccount'],'as':_0x9047('0xd9'),'attributes':['id',_0x9047('0x31')]});_0x47e51b[_0x9047('0x39')]({'model':db['User'],'as':_0x9047('0xda'),'attributes':['id','fullname']});return db[_0x9047('0xa1')][_0x9047('0x79')]({'where':{'id':_0x5c139c[_0x9047('0xb3')]['id']},'include':_0x47e51b})[_0x9047('0x2d')](handleEntityNotFound(_0x18ec59,null))[_0x9047('0x2d')](function(_0x4f3274){if(_0x4f3274){var _0x30e718=_0x4f3274[_0x9047('0xdb')]({'plain':!![]});fs[_0x9047('0xdc')](_0x2d3ba6);var _0x4e45a5={'channel':'Openchannel','account':_0x30e718[_0x9047('0xd9')]['name'],'agent':_0x30e718[_0x9047('0xda')]?_0x30e718['Owner']['fullname']:_0x9047('0xdd'),'createdAt':moment(_0x30e718[_0x9047('0xd7')])[_0x9047('0xbf')](_0x9047('0xc0'))[_0x9047('0x9f')](),'closedAt':_0x30e718[_0x9047('0x3f')]?moment(_0x30e718['closedAt'])[_0x9047('0xbf')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x30e718['disposition'],'visibility':_0x30e718[_0x9047('0xde')]?_0x9047('0xdf'):_0x9047('0xe0'),'messages':_(_0x30e718[_0x9047('0xd6')])[_0x9047('0xbe')]({'secret':![]})[_0x9047('0x34')](function(_0x13a4c9){if(_0x13a4c9['Attachment']){var _0x3653ea=path[_0x9047('0xcb')](_0x3352c3,_0x13a4c9['Attachment'][_0x9047('0xe1')]);if(fs[_0x9047('0xe2')](_0x3653ea)){fs[_0x9047('0xe3')](_0x3653ea)['pipe'](fs['createWriteStream'](path['join'](_0x2d3ba6,_0x13a4c9[_0x9047('0xd5')][_0x9047('0xe1')])));}}return{'date':moment(_0x13a4c9[_0x9047('0xd7')])[_0x9047('0xbf')](_0x9047('0xc0'))[_0x9047('0x9f')](),'sender':_0x13a4c9[_0x9047('0xe4')]==='out'?_0x13a4c9[_0x9047('0x77')]?_0x13a4c9[_0x9047('0x77')]['fullname']:_0x9047('0xe5'):_0x13a4c9[_0x9047('0x6d')]['firstName']+(_0x13a4c9['Contact'][_0x9047('0xd3')]?'\x20'+_0x13a4c9[_0x9047('0x6d')]['lastName']:''),'body':_0x13a4c9[_0x9047('0xd5')]?_0x13a4c9[_0x9047('0xd5')][_0x9047('0xe1')]:_0x13a4c9[_0x9047('0x7b')],'direction':_0x13a4c9[_0x9047('0xe4')]===_0x9047('0xe6')?'A':'C','secret':_0x13a4c9[_0x9047('0xd8')],'read':_0x13a4c9[_0x9047('0x87')],'attachment':_0x13a4c9['Attachment']};})[_0x9047('0x69')]()};return ejs[_0x9047('0xe7')](path[_0x9047('0xcb')](config[_0x9047('0xcf')],_0x9047('0xcc'),'views',_0x9047('0xe8')),{'interaction':_0x4e45a5})[_0x9047('0x2d')](function(_0x200de1){var _0x38c5a6=path[_0x9047('0xcb')](_0x2d3ba6,'transcript-'+_0x30e718['id']+'-'+_0x4d0659+_0x9047('0xe9'));var _0x4fb8fa={'path':_0x38c5a6,'channel':_0x9047('0xea'),'interactionId':_0x30e718['id']};return pdf[_0x9047('0xeb')](_0x200de1,_0x4fb8fa);})[_0x9047('0x2d')](function(){return new BPromise(function(_0x28e197,_0x9efdcf){zipdir(_0x2d3ba6,{'saveTo':_0x33b91d},function(_0x9f587e,_0x5d6c9b){if(_0x9f587e)return _0x9efdcf(_0x9f587e);return _0x28e197(_0x5d6c9b);});})['then'](function(){return new BPromise(function(_0x4d0154,_0xb7bbe7){rimraf(_0x2d3ba6,function(_0x157c8a){if(_0x157c8a)_0xb7bbe7(_0x157c8a);return _0x4d0154();});});})[_0x9047('0x2d')](function(){return _0x18ec59[_0x9047('0xec')](_0x33b91d,_0x2db0cc,function(_0x2287e4){if(_0x2287e4){console['log'](_0x9047('0xed'),_0x2287e4);}else{fs[_0x9047('0xee')](_0x33b91d);}});});});}else{return _0x18ec59[_0x9047('0x23')](0xc8);}})[_0x9047('0x3a')](handleError(_0x18ec59,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index d65c560..59d9694 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 _0xd7ae=['remove','then','Users','map','findAll','setDataValue','catch','hook','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xd7ae,0x10c));var _0xed7a=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xd7ae[_0x413feb];return _0x40ee88;};'use strict';var EventEmitter=require(_0xed7a('0x0'));var OpenchannelInteraction=require(_0xed7a('0x1'))['db'][_0xed7a('0x2')];var OpenchannelMessage=require('../../mysqldb')['db'][_0xed7a('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xed7a('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xed7a('0x5')};function emitEvent(_0x266bc3){return function(_0x20caa2,_0x2fb57b,_0x20d0e1){_0x20caa2['getUsers']({'attributes':['id'],'raw':!![]})[_0xed7a('0x6')](function(_0x4aaea1){_0x20caa2['setDataValue'](_0xed7a('0x7'),_0x4aaea1[_0xed7a('0x8')](function(_0x2fd8bc){return{'id':_0x2fd8bc['id']};}));return OpenchannelMessage[_0xed7a('0x9')]({'where':{'OpenchannelInteractionId':_0x20caa2['id'],'direction':'in','read':![]},'raw':!![]});})[_0xed7a('0x6')](function(_0x492e6f){_0x20caa2[_0xed7a('0xa')]('unreadMessages',_0x492e6f['length']);OpenchannelInteractionEvents['emit'](_0x266bc3+':'+_0x20caa2['id'],_0x20caa2);OpenchannelInteractionEvents['emit'](_0x266bc3,_0x20caa2);_0x20d0e1(null);})[_0xed7a('0xb')](_0x20d0e1(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0xed7a('0xc')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file +var _0x0f7d=['unreadMessages','length','emit','hasOwnProperty','exports','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll'];(function(_0x4c7bd8,_0x3478f7){var _0x52f83f=function(_0x3532e5){while(--_0x3532e5){_0x4c7bd8['push'](_0x4c7bd8['shift']());}};_0x52f83f(++_0x3478f7);}(_0x0f7d,0x1a3));var _0xd0f7=function(_0x56fbb6,_0x570f05){_0x56fbb6=_0x56fbb6-0x0;var _0x4e9a77=_0x0f7d[_0x56fbb6];return _0x4e9a77;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0xd0f7('0x0'))['db'][_0xd0f7('0x1')];var OpenchannelMessage=require(_0xd0f7('0x0'))['db'][_0xd0f7('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xd0f7('0x3')](0x0);var events={'afterCreate':_0xd0f7('0x4'),'afterUpdate':_0xd0f7('0x5'),'afterDestroy':_0xd0f7('0x6')};function emitEvent(_0x2d779c){return function(_0x1fe161,_0x54a056,_0x16ab4f){_0x1fe161[_0xd0f7('0x7')]({'attributes':['id'],'raw':!![]})[_0xd0f7('0x8')](function(_0x1c433e){_0x1fe161[_0xd0f7('0x9')](_0xd0f7('0xa'),_0x1c433e[_0xd0f7('0xb')](function(_0x48ec13){return{'id':_0x48ec13['id']};}));return OpenchannelMessage[_0xd0f7('0xc')]({'where':{'OpenchannelInteractionId':_0x1fe161['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x31c557){_0x1fe161[_0xd0f7('0x9')](_0xd0f7('0xd'),_0x31c557[_0xd0f7('0xe')]);OpenchannelInteractionEvents[_0xd0f7('0xf')](_0x2d779c+':'+_0x1fe161['id'],_0x1fe161);OpenchannelInteractionEvents[_0xd0f7('0xf')](_0x2d779c,_0x1fe161);_0x16ab4f(null);})['catch'](_0x16ab4f(null));};}for(var e in events){if(events[_0xd0f7('0x10')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0xd0f7('0x11')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index fb78d26..f5ccb80 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 _0x3092=['request-promise','path','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','util','api','bluebird'];(function(_0x5e3241,_0x7cb2f9){var _0x45634a=function(_0x266e06){while(--_0x266e06){_0x5e3241['push'](_0x5e3241['shift']());}};_0x45634a(++_0x7cb2f9);}(_0x3092,0x165));var _0x2309=function(_0xae1a83,_0x1980d4){_0xae1a83=_0xae1a83-0x0;var _0xdb9da8=_0x3092[_0xae1a83];return _0xdb9da8;};'use strict';var _=require('lodash');var util=require(_0x2309('0x0'));var logger=require('../../config/logger')(_0x2309('0x1'));var moment=require('moment');var BPromise=require(_0x2309('0x2'));var rp=require(_0x2309('0x3'));var fs=require('fs');var path=require(_0x2309('0x4'));var rimraf=require('rimraf');var config=require(_0x2309('0x5'));var attributes=require(_0x2309('0x6'));module[_0x2309('0x7')]=function(_0x2964c9,_0x5a664c){return _0x2964c9[_0x2309('0x8')](_0x2309('0x9'),attributes,{'tableName':_0x2309('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2309('0xb'),'collate':_0x2309('0xc'),'hooks':{'beforeUpdate':function(_0x551915,_0x52be74,_0x1fc8c3){if(_0x551915[_0x2309('0xd')](_0x2309('0xe'))){_0x551915['closedAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x1fc8c3(null,_0x551915);}}});}; \ No newline at end of file +var _0x8d5d=['utf8mb4','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./openchannelInteraction.attributes','openchannel_interactions'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0x8d5d,0x10e));var _0xd8d5=function(_0x53f32b,_0x38e9fa){_0x53f32b=_0x53f32b-0x0;var _0x2fa755=_0x8d5d[_0x53f32b];return _0x2fa755;};'use strict';var _=require(_0xd8d5('0x0'));var util=require(_0xd8d5('0x1'));var logger=require(_0xd8d5('0x2'))(_0xd8d5('0x3'));var moment=require('moment');var BPromise=require(_0xd8d5('0x4'));var rp=require(_0xd8d5('0x5'));var fs=require('fs');var path=require(_0xd8d5('0x6'));var rimraf=require('rimraf');var config=require(_0xd8d5('0x7'));var attributes=require(_0xd8d5('0x8'));module['exports']=function(_0x3d864e,_0x144466){return _0x3d864e['define']('OpenchannelInteraction',attributes,{'tableName':_0xd8d5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd8d5('0xa'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0xf71cbf,_0x3b1733,_0x161ef0){if(_0xf71cbf['changed'](_0xd8d5('0xb'))){_0xf71cbf['closedAt']=moment()[_0xd8d5('0xc')](_0xd8d5('0xd'));}_0x161ef0(null,_0xf71cbf);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 02f0857..787756a 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 _0xe26c=['socket.io-emitter','request','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','body','options','raw','where','attributes','limit','then','UpdateOpenchannelInteraction','catch','OpenchannelInteraction','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost'];(function(_0x204047,_0x2df7af){var _0x5956d2=function(_0x2d32a8){while(--_0x2d32a8){_0x204047['push'](_0x204047['shift']());}};_0x5956d2(++_0x2df7af);}(_0xe26c,0x162));var _0xce26=function(_0x18b147,_0x50d4d9){_0x18b147=_0x18b147-0x0;var _0x3e5fb2=_0xe26c[_0x18b147];return _0x3e5fb2;};'use strict';var _=require('lodash');var util=require(_0xce26('0x0'));var moment=require(_0xce26('0x1'));var BPromise=require(_0xce26('0x2'));var rs=require(_0xce26('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xce26('0x4'))['db'];var utils=require(_0xce26('0x5'));var logger=require(_0xce26('0x6'))(_0xce26('0x7'));var config=require(_0xce26('0x8'));var jayson=require(_0xce26('0x9'));var client=jayson[_0xce26('0xa')][_0xce26('0xb')]({'port':0x232a});config['redis']=_[_0xce26('0xc')](config[_0xce26('0xd')],{'host':_0xce26('0xe'),'port':0x18eb});var socket=require(_0xce26('0xf'))(new Redis(config[_0xce26('0xd')]));require('./openchannelInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x4ea5b5,_0x206a3e,_0x17cec9){return new BPromise(function(_0x193ab0,_0x149d30){return client[_0xce26('0x10')](_0x4ea5b5,_0x17cec9)['then'](function(_0x372d90){logger[_0xce26('0x11')](_0xce26('0x12'),_0x206a3e,_0xce26('0x13'));logger[_0xce26('0x14')](_0xce26('0x15'),_0x206a3e,_0xce26('0x13'),JSON[_0xce26('0x16')](_0x372d90));if(_0x372d90[_0xce26('0x17')]){if(_0x372d90[_0xce26('0x17')][_0xce26('0x18')]===0x1f4){logger[_0xce26('0x17')](_0xce26('0x12'),_0x206a3e,_0x372d90['error']['message']);return _0x149d30(_0x372d90[_0xce26('0x17')][_0xce26('0x19')]);}logger[_0xce26('0x17')](_0xce26('0x12'),_0x206a3e,_0x372d90[_0xce26('0x17')][_0xce26('0x19')]);return _0x193ab0(_0x372d90[_0xce26('0x17')]['message']);}else{logger[_0xce26('0x11')](_0xce26('0x12'),_0x206a3e,'request\x20sent');_0x193ab0(_0x372d90[_0xce26('0x1a')]['message']);}})['catch'](function(_0x3a74dc){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x206a3e,_0x3a74dc);_0x149d30(_0x3a74dc);});});}exports['UpdateOpenchannelInteraction']=function(_0x2c6da9){var _0x296964=this;return new Promise(function(_0x2dbcd9,_0x141e0f){return db['OpenchannelInteraction']['update'](_0x2c6da9[_0xce26('0x1b')],{'raw':_0x2c6da9[_0xce26('0x1c')]?_0x2c6da9[_0xce26('0x1c')][_0xce26('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c6da9[_0xce26('0x1c')]?_0x2c6da9[_0xce26('0x1c')][_0xce26('0x1e')]||null:null,'attributes':_0x2c6da9[_0xce26('0x1c')]?_0x2c6da9[_0xce26('0x1c')][_0xce26('0x1f')]||null:null,'limit':_0x2c6da9[_0xce26('0x1c')]?_0x2c6da9['options'][_0xce26('0x20')]||null:null})[_0xce26('0x21')](function(_0x11c20b){logger[_0xce26('0x11')](_0xce26('0x22'),_0x2c6da9);logger[_0xce26('0x14')](_0xce26('0x22'),_0x2c6da9,JSON[_0xce26('0x16')](_0x11c20b));_0x2dbcd9(_0x11c20b);})[_0xce26('0x23')](function(_0x934dad){logger[_0xce26('0x17')]('UpdateOpenchannelInteraction',_0x934dad['message'],_0x2c6da9);_0x141e0f(_0x296964[_0xce26('0x17')](0x1f4,_0x934dad[_0xce26('0x19')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x4b7b50){return new Promise(function(_0x777a95,_0x35c4ae){return db[_0xce26('0x24')]['find']({'where':_0x4b7b50[_0xce26('0x1c')]?_0x4b7b50[_0xce26('0x1c')][_0xce26('0x1e')]||null:null})[_0xce26('0x21')](function(_0x1ba60c){if(_0x1ba60c){return _0x1ba60c['addTags'](_0x4b7b50[_0xce26('0x1b')][_0xce26('0x25')],_[_0xce26('0x26')](_0x4b7b50[_0xce26('0x1b')],[_0xce26('0x25'),'id'])||{});}})[_0xce26('0x27')](function(_0x394818){logger['info'](_0xce26('0x28'),_0x4b7b50);logger[_0xce26('0x14')](_0xce26('0x28'),_0x4b7b50,JSON[_0xce26('0x16')](_0x394818));_0x777a95(_0x394818);})[_0xce26('0x23')](function(_0x5b60cb){logger[_0xce26('0x17')](_0xce26('0x28'),_0x5b60cb['message'],_0x4b7b50);_0x35c4ae(_this[_0xce26('0x17')](0x1f4,_0x5b60cb[_0xce26('0x19')]));});});}; \ No newline at end of file +var _0xfdad=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./openchannelInteraction.socket','register','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','where','attributes','limit','AddTagsToOpenchannelInteraction','addTags','ids','omit','spread','AddTags','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x58bcb0,_0x29d554){var _0x13ea13=function(_0x37bc27){while(--_0x37bc27){_0x58bcb0['push'](_0x58bcb0['shift']());}};_0x13ea13(++_0x29d554);}(_0xfdad,0x1b1));var _0xdfda=function(_0x44a466,_0x2ab5ad){_0x44a466=_0x44a466-0x0;var _0x114d21=_0xfdad[_0x44a466];return _0x114d21;};'use strict';var _=require(_0xdfda('0x0'));var util=require(_0xdfda('0x1'));var moment=require('moment');var BPromise=require(_0xdfda('0x2'));var rs=require(_0xdfda('0x3'));var fs=require('fs');var Redis=require(_0xdfda('0x4'));var db=require(_0xdfda('0x5'))['db'];var utils=require(_0xdfda('0x6'));var logger=require(_0xdfda('0x7'))(_0xdfda('0x8'));var config=require(_0xdfda('0x9'));var jayson=require(_0xdfda('0xa'));var client=jayson[_0xdfda('0xb')][_0xdfda('0xc')]({'port':0x232a});config[_0xdfda('0xd')]=_[_0xdfda('0xe')](config['redis'],{'host':_0xdfda('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdfda('0xd')]));require(_0xdfda('0x10'))[_0xdfda('0x11')](socket);function respondWithRpcPromise(_0x3f4925,_0x166a62,_0x52347e){return new BPromise(function(_0x300852,_0x303e5a){return client['request'](_0x3f4925,_0x52347e)[_0xdfda('0x12')](function(_0x3f75b7){logger[_0xdfda('0x13')](_0xdfda('0x14'),_0x166a62,_0xdfda('0x15'));logger[_0xdfda('0x16')](_0xdfda('0x17'),_0x166a62,'request\x20sent',JSON[_0xdfda('0x18')](_0x3f75b7));if(_0x3f75b7['error']){if(_0x3f75b7[_0xdfda('0x19')]['code']===0x1f4){logger[_0xdfda('0x19')](_0xdfda('0x14'),_0x166a62,_0x3f75b7[_0xdfda('0x19')][_0xdfda('0x1a')]);return _0x303e5a(_0x3f75b7[_0xdfda('0x19')]['message']);}logger[_0xdfda('0x19')](_0xdfda('0x14'),_0x166a62,_0x3f75b7['error'][_0xdfda('0x1a')]);return _0x300852(_0x3f75b7[_0xdfda('0x19')][_0xdfda('0x1a')]);}else{logger[_0xdfda('0x13')](_0xdfda('0x14'),_0x166a62,_0xdfda('0x15'));_0x300852(_0x3f75b7[_0xdfda('0x1b')][_0xdfda('0x1a')]);}})['catch'](function(_0x2050f7){logger['error'](_0xdfda('0x14'),_0x166a62,_0x2050f7);_0x303e5a(_0x2050f7);});});}exports[_0xdfda('0x1c')]=function(_0x147020){var _0x4c5825=this;return new Promise(function(_0xc51621,_0x2e1f21){return db[_0xdfda('0x1d')][_0xdfda('0x1e')](_0x147020[_0xdfda('0x1f')],{'raw':_0x147020[_0xdfda('0x20')]?_0x147020[_0xdfda('0x20')][_0xdfda('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x147020['options']?_0x147020[_0xdfda('0x20')][_0xdfda('0x22')]||null:null,'attributes':_0x147020['options']?_0x147020[_0xdfda('0x20')][_0xdfda('0x23')]||null:null,'limit':_0x147020[_0xdfda('0x20')]?_0x147020['options'][_0xdfda('0x24')]||null:null})[_0xdfda('0x12')](function(_0x2e4c56){logger[_0xdfda('0x13')]('UpdateOpenchannelInteraction',_0x147020);logger[_0xdfda('0x16')](_0xdfda('0x1c'),_0x147020,JSON[_0xdfda('0x18')](_0x2e4c56));_0xc51621(_0x2e4c56);})['catch'](function(_0x406448){logger['error'](_0xdfda('0x1c'),_0x406448['message'],_0x147020);_0x2e1f21(_0x4c5825[_0xdfda('0x19')](0x1f4,_0x406448[_0xdfda('0x1a')]));});});};exports[_0xdfda('0x25')]=function(_0x3b754a){return new Promise(function(_0x49ed15,_0x43ad78){return db[_0xdfda('0x1d')]['find']({'where':_0x3b754a[_0xdfda('0x20')]?_0x3b754a[_0xdfda('0x20')]['where']||null:null})[_0xdfda('0x12')](function(_0x1e3ef1){if(_0x1e3ef1){return _0x1e3ef1[_0xdfda('0x26')](_0x3b754a[_0xdfda('0x1f')][_0xdfda('0x27')],_[_0xdfda('0x28')](_0x3b754a[_0xdfda('0x1f')],['ids','id'])||{});}})[_0xdfda('0x29')](function(_0x929e3d){logger[_0xdfda('0x13')]('AddTags',_0x3b754a);logger['debug'](_0xdfda('0x2a'),_0x3b754a,JSON[_0xdfda('0x18')](_0x929e3d));_0x49ed15(_0x929e3d);})[_0xdfda('0x2b')](function(_0xe07cc1){logger[_0xdfda('0x19')](_0xdfda('0x2a'),_0xe07cc1[_0xdfda('0x1a')],_0x3b754a);_0x43ad78(_this['error'](0x1f4,_0xe07cc1[_0xdfda('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index a174b5d..fc4ba57 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 _0x3332=['removeListener','register','length','./openchannelInteraction.events','remove','update'];(function(_0x60878f,_0x1166d3){var _0x1fbefb=function(_0x375d8c){while(--_0x375d8c){_0x60878f['push'](_0x60878f['shift']());}};_0x1fbefb(++_0x1166d3);}(_0x3332,0x19b));var _0x2333=function(_0x2abacb,_0x2887a0){_0x2abacb=_0x2abacb-0x0;var _0x1e0521=_0x3332[_0x2abacb];return _0x1e0521;};'use strict';var OpenchannelInteractionEvents=require(_0x2333('0x0'));var events=['save',_0x2333('0x1'),_0x2333('0x2')];function createListener(_0x2098db,_0x4652f2){return function(_0x17ee56){_0x4652f2['emit'](_0x2098db,_0x17ee56);};}function removeListener(_0x3abbc2,_0x40e541){return function(){OpenchannelInteractionEvents[_0x2333('0x3')](_0x3abbc2,_0x40e541);};}exports[_0x2333('0x4')]=function(_0x83f24){for(var _0x5657a1=0x0,_0x384cb1=events[_0x2333('0x5')];_0x5657a1<_0x384cb1;_0x5657a1++){var _0x1c9f29=events[_0x5657a1];var _0x23f421=createListener('openchannelInteraction:'+_0x1c9f29,_0x83f24);OpenchannelInteractionEvents['on'](_0x1c9f29,_0x23f421);}}; \ No newline at end of file +var _0x89a6=['./openchannelInteraction.events','remove','register','length','openchannelInteraction:'];(function(_0x4c7241,_0x1a26fe){var _0xf6002f=function(_0x1e30d1){while(--_0x1e30d1){_0x4c7241['push'](_0x4c7241['shift']());}};_0xf6002f(++_0x1a26fe);}(_0x89a6,0x15e));var _0x689a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x89a6[_0x122ef9];return _0x42fba0;};'use strict';var OpenchannelInteractionEvents=require(_0x689a('0x0'));var events=['save',_0x689a('0x1'),'update'];function createListener(_0x2a5b0a,_0x36351b){return function(_0x322f24){_0x36351b['emit'](_0x2a5b0a,_0x322f24);};}function removeListener(_0x691679,_0x41351e){return function(){OpenchannelInteractionEvents['removeListener'](_0x691679,_0x41351e);};}exports[_0x689a('0x2')]=function(_0x4bf07d){for(var _0x50ef1f=0x0,_0x1562b4=events[_0x689a('0x3')];_0x50ef1f<_0x1562b4;_0x50ef1f++){var _0x144c06=events[_0x50ef1f];var _0x11faeb=createListener(_0x689a('0x4')+_0x144c06,_0x4bf07d);OpenchannelInteractionEvents['on'](_0x144c06,_0x11faeb);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 74bbe35..0445f00 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 _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','create','update','put','/:id/accept','accept','/:id/reject','exports','multer','util','path','express','Router'];(function(_0x55aa70,_0x376e31){var _0x214bd2=function(_0x581f3a){while(--_0x581f3a){_0x55aa70['push'](_0x55aa70['shift']());}};_0x214bd2(++_0x376e31);}(_0xe706,0xa3));var _0x6e70=function(_0x493df0,_0x3808fe){_0x493df0=_0x493df0-0x0;var _0x4b6a03=_0xe706[_0x493df0];return _0x4b6a03;};'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'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),interaction[_0x6e70('0x12')](_0x6e70('0x13'),_0x6e70('0x14')),controller[_0x6e70('0x15')]);router['put']('/:id',auth[_0x6e70('0xb')](),controller[_0x6e70('0x16')]);router[_0x6e70('0x17')](_0x6e70('0x18'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x19')]);router[_0x6e70('0x17')](_0x6e70('0x1a'),auth['isAuthenticated'](),controller['reject']);router['delete'](_0x6e70('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x6e70('0x1b')]=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(_0x286300,_0x37066c){var _0x1c8aec=function(_0x18e4b2){while(--_0x18e4b2){_0x286300['push'](_0x286300['shift']());}};_0x1c8aec(++_0x37066c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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 ca769da..7a6c6da 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 _0x9c9b=['TEXT','medium','BOOLEAN','out','exports'];(function(_0x1d2064,_0x47aef1){var _0x269138=function(_0xe10ada){while(--_0xe10ada){_0x1d2064['push'](_0x1d2064['shift']());}};_0x269138(++_0x47aef1);}(_0x9c9b,0x194));var _0xb9c9=function(_0x498738,_0x4c0709){_0x498738=_0x498738-0x0;var _0x1cc860=_0x9c9b[_0x498738];return _0x1cc860;};'use strict';var Sequelize=require('sequelize');module[_0xb9c9('0x0')]={'body':{'type':Sequelize[_0xb9c9('0x1')](_0xb9c9('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xb9c9('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xb9c9('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xb9c9('0x4')),'defaultValue':_0xb9c9('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x81a5=['sequelize','exports','TEXT','medium','BOOLEAN','out'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0x81a5,0x1c8));var _0x581a=function(_0x46e04a,_0x53da21){_0x46e04a=_0x46e04a-0x0;var _0x2ec569=_0x81a5[_0x46e04a];return _0x2ec569;};'use strict';var Sequelize=require(_0x581a('0x0'));module[_0x581a('0x1')]={'body':{'type':Sequelize[_0x581a('0x2')](_0x581a('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x581a('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x581a('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x581a('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 1fe5315..2941af8 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 _0xee05=['interaction','user','role','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','openchannel','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','event','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','ejs','fs-extra','squel','crypto','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','redis','defaults','localhost','./openchannelMessage.socket','jayson/promise','client','info','request\x20sent','debug','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','message','result','catch','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','sendStatus','stack','name','OpenchannelMessage','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','includeAll','include','findAll','rows','show','params','options','create','body','find','destroy','describe','openchannel-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xee05,0x9f));var _0x5ee0=function(_0x40167a,_0x45c741){_0x40167a=_0x40167a-0x0;var _0x2eaf80=_0xee05[_0x40167a];return _0x2eaf80;};'use strict';var emlformat=require(_0x5ee0('0x0'));var rimraf=require(_0x5ee0('0x1'));var zipdir=require(_0x5ee0('0x2'));var jsonpatch=require(_0x5ee0('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5ee0('0x4'));var Mustache=require(_0x5ee0('0x5'));var util=require(_0x5ee0('0x6'));var path=require(_0x5ee0('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5ee0('0x8'));var fs=require('fs');var fs_extra=require(_0x5ee0('0x9'));var _=require('lodash');var squel=require(_0x5ee0('0xa'));var crypto=require(_0x5ee0('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5ee0('0xc'));var Papa=require(_0x5ee0('0xd'));var Redis=require(_0x5ee0('0xe'));var authService=require(_0x5ee0('0xf'));var qs=require(_0x5ee0('0x10'));var as=require(_0x5ee0('0x11'));var hardwareService=require(_0x5ee0('0x12'));var logger=require(_0x5ee0('0x13'))('api');var utils=require(_0x5ee0('0x14'));var config=require(_0x5ee0('0x15'));var licenseUtil=require(_0x5ee0('0x16'));var db=require(_0x5ee0('0x17'))['db'];config[_0x5ee0('0x18')]=_[_0x5ee0('0x19')](config[_0x5ee0('0x18')],{'host':_0x5ee0('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5ee0('0x18')]));require(_0x5ee0('0x1b'))['register'](socket);var jayson=require(_0x5ee0('0x1c'));var client=jayson[_0x5ee0('0x1d')]['http']({'port':0x232c});var client9002=jayson[_0x5ee0('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x704214,_0x33ceae,_0x3fb6d3,_0x12c889){return new BPromise(function(_0x523658,_0x213fc0){var _0xea93cc=_0x12c889||client;return _0xea93cc['request'](_0x704214,_0x3fb6d3)['then'](function(_0xf53508){logger[_0x5ee0('0x1e')]('OpenchannelMessage,\x20%s,\x20%s',_0x33ceae,_0x5ee0('0x1f'));logger[_0x5ee0('0x20')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x33ceae,_0x5ee0('0x1f'),JSON[_0x5ee0('0x21')](_0xf53508));if(_0xf53508[_0x5ee0('0x22')]){if(_0xf53508['error'][_0x5ee0('0x23')]===0x1f4){logger[_0x5ee0('0x22')](_0x5ee0('0x24'),_0x33ceae,_0xf53508[_0x5ee0('0x22')][_0x5ee0('0x25')]);return _0x213fc0(_0xf53508[_0x5ee0('0x22')][_0x5ee0('0x25')]);}logger[_0x5ee0('0x22')](_0x5ee0('0x24'),_0x33ceae,_0xf53508[_0x5ee0('0x22')][_0x5ee0('0x25')]);return _0x523658(_0xf53508[_0x5ee0('0x22')]['message']);}else{logger[_0x5ee0('0x1e')](_0x5ee0('0x24'),_0x33ceae,_0x5ee0('0x1f'));_0x523658(_0xf53508[_0x5ee0('0x26')]['message']);}})[_0x5ee0('0x27')](function(_0x2dad98){logger[_0x5ee0('0x22')](_0x5ee0('0x24'),_0x33ceae,_0x2dad98);_0x213fc0(_0x2dad98);});});}function respondWithStatusCode(_0x171cec,_0x253f83){_0x253f83=_0x253f83||0xcc;return function(_0x441173){if(_0x441173){return _0x171cec['sendStatus'](_0x253f83);}return _0x171cec[_0x5ee0('0x28')](_0x253f83)[_0x5ee0('0x29')]();};}function respondWithResult(_0x5b4590,_0x4b8c99){_0x4b8c99=_0x4b8c99||0xc8;return function(_0x4e6a1c){if(_0x4e6a1c){return _0x5b4590[_0x5ee0('0x28')](_0x4b8c99)[_0x5ee0('0x2a')](_0x4e6a1c);}};}function respondWithFilteredResult(_0x4abe7d,_0x17eede){return function(_0x2ce1cf){if(_0x2ce1cf){var _0x250dab=typeof _0x17eede['offset']===_0x5ee0('0x2b')&&typeof _0x17eede[_0x5ee0('0x2c')]===_0x5ee0('0x2b');var _0x179597=_0x2ce1cf[_0x5ee0('0x2d')];var _0x40e077=_0x250dab?0x0:_0x17eede[_0x5ee0('0x2e')];var _0x8f1956=_0x250dab?_0x2ce1cf[_0x5ee0('0x2d')]:_0x17eede[_0x5ee0('0x2e')]+_0x17eede[_0x5ee0('0x2c')];var _0x157d5b;if(_0x8f1956>=_0x179597){_0x8f1956=_0x179597;_0x157d5b=0xc8;}else{_0x157d5b=0xce;}_0x4abe7d[_0x5ee0('0x28')](_0x157d5b);return _0x4abe7d[_0x5ee0('0x2f')](_0x5ee0('0x30'),_0x40e077+'-'+_0x8f1956+'/'+_0x179597)[_0x5ee0('0x2a')](_0x2ce1cf);}return null;};}function patchUpdates(_0x5bba71){return function(_0x25319d){try{jsonpatch['apply'](_0x25319d,_0x5bba71,!![]);}catch(_0x461bd1){return BPromise[_0x5ee0('0x31')](_0x461bd1);}return _0x25319d[_0x5ee0('0x32')]();};}function saveUpdates(_0x2a6e0d,_0x333f30){return function(_0x15b050){if(_0x15b050){return _0x15b050[_0x5ee0('0x33')](_0x2a6e0d)['then'](function(_0x3d0143){return _0x3d0143;});}return null;};}function removeEntity(_0xc5b686,_0x940d1c){return function(_0x17c75d){if(_0x17c75d){return _0x17c75d['destroy']()[_0x5ee0('0x34')](function(){_0xc5b686[_0x5ee0('0x28')](0xcc)[_0x5ee0('0x29')]();});}};}function handleEntityNotFound(_0x2d44cb,_0x1f8e59){return function(_0x35815d){if(!_0x35815d){_0x2d44cb[_0x5ee0('0x35')](0x194);}return _0x35815d;};}function handleError(_0x462869,_0x3fa2d6){_0x3fa2d6=_0x3fa2d6||0x1f4;return function(_0x556fcf){logger[_0x5ee0('0x22')](_0x556fcf[_0x5ee0('0x36')]);if(_0x556fcf[_0x5ee0('0x37')]){delete _0x556fcf['name'];}_0x462869['status'](_0x3fa2d6)['send'](_0x556fcf);};}exports['index']=function(_0x343b08,_0x2ad37b){var _0x27aa11={},_0x82968f={},_0x5dd6c1={'count':0x0,'rows':[]};var _0x17c9a3=_['map'](db[_0x5ee0('0x38')][_0x5ee0('0x39')],function(_0x301517){return{'name':_0x301517[_0x5ee0('0x3a')],'type':_0x301517[_0x5ee0('0x3b')]['key']};});_0x82968f[_0x5ee0('0x3c')]=_['map'](_0x17c9a3,'name');_0x82968f[_0x5ee0('0x3d')]=_[_0x5ee0('0x3e')](_0x343b08[_0x5ee0('0x3d')]);_0x82968f[_0x5ee0('0x3f')]=_[_0x5ee0('0x40')](_0x82968f[_0x5ee0('0x3c')],_0x82968f[_0x5ee0('0x3d')]);_0x27aa11[_0x5ee0('0x41')]=_[_0x5ee0('0x40')](_0x82968f[_0x5ee0('0x3c')],qs['fields'](_0x343b08[_0x5ee0('0x3d')][_0x5ee0('0x42')]));_0x27aa11[_0x5ee0('0x41')]=_0x27aa11[_0x5ee0('0x41')][_0x5ee0('0x43')]?_0x27aa11[_0x5ee0('0x41')]:_0x82968f[_0x5ee0('0x3c')];if(!_0x343b08[_0x5ee0('0x3d')][_0x5ee0('0x44')](_0x5ee0('0x45'))){_0x27aa11[_0x5ee0('0x2c')]=qs[_0x5ee0('0x2c')](_0x343b08[_0x5ee0('0x3d')][_0x5ee0('0x2c')]);_0x27aa11['offset']=qs[_0x5ee0('0x2e')](_0x343b08[_0x5ee0('0x3d')][_0x5ee0('0x2e')]);}_0x27aa11[_0x5ee0('0x46')]=qs[_0x5ee0('0x47')](_0x343b08[_0x5ee0('0x3d')]['sort']);_0x27aa11[_0x5ee0('0x48')]=qs[_0x5ee0('0x3f')](_[_0x5ee0('0x49')](_0x343b08[_0x5ee0('0x3d')],_0x82968f[_0x5ee0('0x3f')]),_0x17c9a3);if(_0x343b08[_0x5ee0('0x3d')][_0x5ee0('0x4a')]){_0x27aa11['where']=_[_0x5ee0('0x4b')](_0x27aa11[_0x5ee0('0x48')],{'$or':_[_0x5ee0('0x4c')](_0x17c9a3,function(_0xe71971){if(_0xe71971[_0x5ee0('0x3b')]!=='VIRTUAL'){var _0x4941e4={};_0x4941e4[_0xe71971[_0x5ee0('0x37')]]={'$like':'%'+_0x343b08[_0x5ee0('0x3d')]['filter']+'%'};return _0x4941e4;}})});}_0x27aa11=_[_0x5ee0('0x4b')]({},_0x27aa11,_0x343b08['options']);var _0x33adeb={'where':_0x27aa11[_0x5ee0('0x48')]};return db[_0x5ee0('0x38')][_0x5ee0('0x2d')](_0x33adeb)[_0x5ee0('0x34')](function(_0x5c3754){_0x5dd6c1[_0x5ee0('0x2d')]=_0x5c3754;if(_0x343b08['query'][_0x5ee0('0x4d')]){_0x27aa11[_0x5ee0('0x4e')]=[{'all':!![]}];}return db[_0x5ee0('0x38')][_0x5ee0('0x4f')](_0x27aa11);})[_0x5ee0('0x34')](function(_0x2f3558){_0x5dd6c1[_0x5ee0('0x50')]=_0x2f3558;return _0x5dd6c1;})[_0x5ee0('0x34')](respondWithFilteredResult(_0x2ad37b,_0x27aa11))[_0x5ee0('0x27')](handleError(_0x2ad37b,null));};exports[_0x5ee0('0x51')]=function(_0x1c2e42,_0x3305f6){var _0x473d0b={'raw':!![],'where':{'id':_0x1c2e42[_0x5ee0('0x52')]['id']}},_0x12fb3b={};_0x12fb3b[_0x5ee0('0x3c')]=_[_0x5ee0('0x3e')](db[_0x5ee0('0x38')][_0x5ee0('0x39')]);_0x12fb3b['query']=_[_0x5ee0('0x3e')](_0x1c2e42[_0x5ee0('0x3d')]);_0x12fb3b['filters']=_['intersection'](_0x12fb3b[_0x5ee0('0x3c')],_0x12fb3b[_0x5ee0('0x3d')]);_0x473d0b[_0x5ee0('0x41')]=_[_0x5ee0('0x40')](_0x12fb3b['model'],qs[_0x5ee0('0x42')](_0x1c2e42[_0x5ee0('0x3d')]['fields']));_0x473d0b['attributes']=_0x473d0b[_0x5ee0('0x41')]['length']?_0x473d0b['attributes']:_0x12fb3b[_0x5ee0('0x3c')];if(_0x1c2e42[_0x5ee0('0x3d')][_0x5ee0('0x4d')]){_0x473d0b[_0x5ee0('0x4e')]=[{'all':!![]}];}_0x473d0b=_[_0x5ee0('0x4b')]({},_0x473d0b,_0x1c2e42[_0x5ee0('0x53')]);return db[_0x5ee0('0x38')]['find'](_0x473d0b)[_0x5ee0('0x34')](handleEntityNotFound(_0x3305f6,null))[_0x5ee0('0x34')](respondWithResult(_0x3305f6,null))[_0x5ee0('0x27')](handleError(_0x3305f6,null));};exports[_0x5ee0('0x54')]=function(_0x26e4bf,_0x4d4081){return db[_0x5ee0('0x38')][_0x5ee0('0x54')](_0x26e4bf[_0x5ee0('0x55')],{})[_0x5ee0('0x34')](respondWithResult(_0x4d4081,0xc9))[_0x5ee0('0x27')](handleError(_0x4d4081,null));};exports[_0x5ee0('0x33')]=function(_0x516c5d,_0x1a6243){if(_0x516c5d[_0x5ee0('0x55')]['id']){delete _0x516c5d[_0x5ee0('0x55')]['id'];}return db['OpenchannelMessage'][_0x5ee0('0x56')]({'where':{'id':_0x516c5d[_0x5ee0('0x52')]['id']}})[_0x5ee0('0x34')](handleEntityNotFound(_0x1a6243,null))[_0x5ee0('0x34')](saveUpdates(_0x516c5d[_0x5ee0('0x55')],null))[_0x5ee0('0x34')](respondWithResult(_0x1a6243,null))[_0x5ee0('0x27')](handleError(_0x1a6243,null));};exports[_0x5ee0('0x57')]=function(_0x14d3fd,_0x7a20eb){return db[_0x5ee0('0x38')][_0x5ee0('0x56')]({'where':{'id':_0x14d3fd[_0x5ee0('0x52')]['id']}})[_0x5ee0('0x34')](handleEntityNotFound(_0x7a20eb,null))['then'](removeEntity(_0x7a20eb,null))[_0x5ee0('0x27')](handleError(_0x7a20eb,null));};exports['describe']=function(_0x499b09,_0xdf0bd6){return db[_0x5ee0('0x38')][_0x5ee0('0x58')]()[_0x5ee0('0x34')](respondWithResult(_0xdf0bd6,null))[_0x5ee0('0x27')](handleError(_0xdf0bd6,null));};var interaction_log=require(_0x5ee0('0x13'))(_0x5ee0('0x59'));exports[_0x5ee0('0x5a')]=function(_0x3cb289,_0x1a3d3b,_0x36215a){var _0x29d9ff={'agent':{},'channel':'openchannel'};if(_0x3cb289['body']['id']){delete _0x3cb289[_0x5ee0('0x55')]['id'];}_0x3cb289[_0x5ee0('0x55')][_0x5ee0('0x5b')]=!![];_0x3cb289[_0x5ee0('0x55')][_0x5ee0('0x5c')]=moment()[_0x5ee0('0x5d')](_0x5ee0('0x5e'));_0x3cb289[_0x5ee0('0x55')][_0x5ee0('0x5f')]=_0x3cb289['body']['UserId']||_0x3cb289['user']['id'];_0x29d9ff['agent']['id']=_0x3cb289[_0x5ee0('0x55')]['UserId'];return db[_0x5ee0('0x38')][_0x5ee0('0x56')]({'where':{'id':_0x3cb289[_0x5ee0('0x52')]['id'],'UserId':null}})[_0x5ee0('0x34')](handleEntityNotFound(_0x1a3d3b,null))['then'](saveUpdates(_0x3cb289[_0x5ee0('0x55')],null))['then'](function(_0x3f1e98){if(_0x3f1e98){_0x29d9ff['message']=_0x3f1e98[_0x5ee0('0x60')]({'plain':!![]});return db[_0x5ee0('0x61')][_0x5ee0('0x56')]({'where':{'id':_0x3f1e98[_0x5ee0('0x62')]}});}return null;})[_0x5ee0('0x34')](handleEntityNotFound(_0x1a3d3b,null))[_0x5ee0('0x34')](function(_0x27b855){if(_0x27b855){return _0x27b855[_0x5ee0('0x33')]({'UserId':_0x3cb289[_0x5ee0('0x55')][_0x5ee0('0x5f')],'read1stAt':_[_0x5ee0('0x63')](_0x27b855[_0x5ee0('0x64')])?moment()[_0x5ee0('0x5d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x5ee0('0x34')](function(_0x3729c9){if(_0x3729c9){_0x29d9ff[_0x5ee0('0x65')]=_0x3729c9[_0x5ee0('0x60')]({'plain':!![]});interaction_log[_0x5ee0('0x1e')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3cb289[_0x5ee0('0x66')]['id'],_0x3cb289[_0x5ee0('0x66')][_0x5ee0('0x37')],_0x3cb289[_0x5ee0('0x66')][_0x5ee0('0x67')],_0x29d9ff[_0x5ee0('0x65')]['id'],_0x3cb289[_0x5ee0('0x55')]?JSON[_0x5ee0('0x21')](_0x3cb289[_0x5ee0('0x55')]):'null');return respondWithRpcPromise(_0x5ee0('0x68'),'acceptMessage',_0x29d9ff);}return null;})[_0x5ee0('0x34')](function(_0x53f60e){var _0x1f8dd0=_0x5ee0('0x69')+_0x53f60e[_0x5ee0('0x25')][_0x5ee0('0x6a')];return db[_0x5ee0('0x6b')][_0x5ee0('0x3d')](_0x1f8dd0,{'type':db[_0x5ee0('0x6c')][_0x5ee0('0x6d')]['SELECT'],'raw':!![]})[_0x5ee0('0x34')](function(_0x30f81c){return _0x30f81c;});})['then'](function(_0x2e05a0){if(_0x2e05a0){_0x29d9ff['message'][_0x5ee0('0x6e')]=_0x2e05a0[0x0];if(!_0x3cb289['body'][_0x5ee0('0x5f')])return;return db[_0x5ee0('0x6f')][_0x5ee0('0x56')]({'where':{'id':_0x3cb289[_0x5ee0('0x55')][_0x5ee0('0x5f')],'role':_0x5ee0('0x70')},'attributes':['id','name',_0x5ee0('0x71'),_0x5ee0('0x72'),_0x5ee0('0x73')],'raw':!![]});}return null;})[_0x5ee0('0x34')](function(_0x4af25f){if(!_0x4af25f)return null;_0x29d9ff[_0x5ee0('0x25')][_0x5ee0('0x70')]=_0x4af25f;return _0x29d9ff;})[_0x5ee0('0x34')](function(_0x4dac41){if(_0x4dac41){if(_0x3cb289[_0x5ee0('0x55')][_0x5ee0('0x74')]){_0x29d9ff[_0x5ee0('0x25')][_0x5ee0('0x75')]=util[_0x5ee0('0x5d')](_0x5ee0('0x76'),_0x3cb289[_0x5ee0('0x66')][_0x5ee0('0x37')]);_0x29d9ff[_0x5ee0('0x25')][_0x5ee0('0x77')]=_0x29d9ff[_0x5ee0('0x77')];_0x29d9ff[_0x5ee0('0x25')][_0x5ee0('0x78')]=_0x29d9ff[_0x5ee0('0x77')];_0x29d9ff[_0x5ee0('0x25')]['event']=_0x5ee0('0x5a');return respondWithRpcPromise(_0x5ee0('0x79'),_0x5ee0('0x79'),{'event':_0x5ee0('0x7a'),'message':_0x29d9ff[_0x5ee0('0x25')]},client9002)[_0x5ee0('0x34')](function(){return _0x29d9ff;});}return _0x29d9ff;}return null;})[_0x5ee0('0x34')](respondWithResult(_0x1a3d3b,null))['catch'](handleError(_0x1a3d3b,null));};var interaction_log=require('../../config/logger')(_0x5ee0('0x59'));exports[_0x5ee0('0x31')]=function(_0x306d2b,_0x454a40,_0x19e3a7){var _0x448074={'agent':{},'channel':_0x5ee0('0x7b')};if(_0x306d2b['body']['id']){delete _0x306d2b['body']['id'];}_0x306d2b[_0x5ee0('0x55')][_0x5ee0('0x5f')]=_0x306d2b[_0x5ee0('0x55')][_0x5ee0('0x5f')]||_0x306d2b[_0x5ee0('0x66')]['id'];_0x448074[_0x5ee0('0x70')]['id']=_0x306d2b[_0x5ee0('0x55')][_0x5ee0('0x5f')];return db[_0x5ee0('0x38')][_0x5ee0('0x56')]({'where':{'id':_0x306d2b[_0x5ee0('0x52')]['id'],'UserId':null}})[_0x5ee0('0x34')](handleEntityNotFound(_0x454a40,null))['then'](function(_0x150986){if(_0x150986){_0x448074[_0x5ee0('0x25')]=_0x150986[_0x5ee0('0x60')]({'plain':!![]});return db[_0x5ee0('0x61')][_0x5ee0('0x56')]({'where':{'id':_0x150986[_0x5ee0('0x62')]}});}return null;})[_0x5ee0('0x34')](handleEntityNotFound(_0x454a40,null))['then'](function(_0x291daa){if(_0x291daa){_0x448074[_0x5ee0('0x65')]=_0x291daa['get']({'plain':!![]});interaction_log[_0x5ee0('0x1e')](_0x5ee0('0x7c'),_0x306d2b[_0x5ee0('0x66')]['id'],_0x306d2b[_0x5ee0('0x66')][_0x5ee0('0x37')],_0x306d2b[_0x5ee0('0x66')][_0x5ee0('0x67')],_0x448074[_0x5ee0('0x65')]['id'],_0x306d2b[_0x5ee0('0x55')]?JSON[_0x5ee0('0x21')](_0x306d2b['body']):_0x5ee0('0x7d'));return respondWithRpcPromise(_0x5ee0('0x7e'),_0x5ee0('0x7f'),_0x448074);}return null;})[_0x5ee0('0x34')](function(_0x1d7256){var _0x373564='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1d7256[_0x5ee0('0x25')][_0x5ee0('0x6a')];return db[_0x5ee0('0x6b')]['query'](_0x373564,{'type':db[_0x5ee0('0x6c')][_0x5ee0('0x6d')]['SELECT'],'raw':!![]})[_0x5ee0('0x34')](function(_0x37198e){return _0x37198e;});})[_0x5ee0('0x34')](function(_0x3ee506){if(_0x3ee506){_0x448074[_0x5ee0('0x25')]['contact']=_0x3ee506[0x0];if(!_0x306d2b['body']['UserId'])return;return db[_0x5ee0('0x6f')][_0x5ee0('0x56')]({'where':{'id':_0x306d2b[_0x5ee0('0x55')][_0x5ee0('0x5f')],'role':'agent'},'attributes':['id',_0x5ee0('0x37'),_0x5ee0('0x71'),_0x5ee0('0x72'),'internal'],'raw':!![]});}return null;})[_0x5ee0('0x34')](function(_0x1d0dbe){if(!_0x1d0dbe)return null;_0x448074['message'][_0x5ee0('0x70')]=_0x1d0dbe;return _0x448074;})[_0x5ee0('0x34')](function(_0xeaedc2){if(_0xeaedc2){_0xeaedc2[_0x5ee0('0x25')][_0x5ee0('0x75')]=util[_0x5ee0('0x5d')](_0x5ee0('0x76'),_0x306d2b[_0x5ee0('0x66')][_0x5ee0('0x37')]);_0xeaedc2[_0x5ee0('0x25')]['channel']=_0x448074['channel'];_0xeaedc2[_0x5ee0('0x25')][_0x5ee0('0x78')]=_0x448074[_0x5ee0('0x77')];_0xeaedc2[_0x5ee0('0x25')][_0x5ee0('0x80')]=_0x5ee0('0x31');respondWithRpcPromise(_0x5ee0('0x79'),'EventManager',{'event':_0x5ee0('0x81'),'message':_0xeaedc2[_0x5ee0('0x25')]},client9002);return _0x448074;}return null;})[_0x5ee0('0x34')](respondWithResult(_0x454a40,null))[_0x5ee0('0x27')](handleError(_0x454a40,null));}; \ No newline at end of file +var _0x4aae=['fs-extra','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','../../mysqldb','defaults','socket.io-emitter','redis','register','http','client','request','then','info','OpenchannelMessage,\x20%s,\x20%s','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','end','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','name','send','index','map','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','OpenchannelMessage','include','rows','show','rawAttributes','includeAll','find','create','body','params','describe','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteractionId','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','contact','User','fullname','email','internal','manual','interface','channel','event','EventManager','acceptmessage','OpenchannelInteraction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','ContactId','Sequelize','QueryTypes','SELECT','SIP/%s','motionChannel','rejectmessage','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs'];(function(_0x2be2aa,_0x520e86){var _0x54dcde=function(_0x499b86){while(--_0x499b86){_0x2be2aa['push'](_0x2be2aa['shift']());}};_0x54dcde(++_0x520e86);}(_0x4aae,0x18b));var _0xe4aa=function(_0x160efd,_0x292196){_0x160efd=_0x160efd-0x0;var _0x14ecb5=_0x4aae[_0x160efd];return _0x14ecb5;};'use strict';var emlformat=require(_0xe4aa('0x0'));var rimraf=require(_0xe4aa('0x1'));var zipdir=require(_0xe4aa('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe4aa('0x3'));var moment=require(_0xe4aa('0x4'));var BPromise=require(_0xe4aa('0x5'));var Mustache=require('mustache');var util=require(_0xe4aa('0x6'));var path=require(_0xe4aa('0x7'));var sox=require(_0xe4aa('0x8'));var csv=require('to-csv');var ejs=require(_0xe4aa('0x9'));var fs=require('fs');var fs_extra=require(_0xe4aa('0xa'));var _=require('lodash');var squel=require(_0xe4aa('0xb'));var crypto=require(_0xe4aa('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe4aa('0xd'));var toCsv=require(_0xe4aa('0xe'));var querystring=require(_0xe4aa('0xf'));var Papa=require('papaparse');var Redis=require(_0xe4aa('0x10'));var authService=require(_0xe4aa('0x11'));var qs=require(_0xe4aa('0x12'));var as=require(_0xe4aa('0x13'));var hardwareService=require(_0xe4aa('0x14'));var logger=require(_0xe4aa('0x15'))(_0xe4aa('0x16'));var utils=require(_0xe4aa('0x17'));var config=require(_0xe4aa('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe4aa('0x19'))['db'];config['redis']=_[_0xe4aa('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe4aa('0x1b'))(new Redis(config[_0xe4aa('0x1c')]));require('./openchannelMessage.socket')[_0xe4aa('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xe4aa('0x1e')]({'port':0x232c});var client9002=jayson[_0xe4aa('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x329648,_0x6aa941,_0x17f235,_0x66c833){return new BPromise(function(_0x519655,_0x582005){var _0x2d82bd=_0x66c833||client;return _0x2d82bd[_0xe4aa('0x20')](_0x329648,_0x17f235)[_0xe4aa('0x21')](function(_0x270507){logger[_0xe4aa('0x22')](_0xe4aa('0x23'),_0x6aa941,'request\x20sent');logger[_0xe4aa('0x24')](_0xe4aa('0x25'),_0x6aa941,_0xe4aa('0x26'),JSON[_0xe4aa('0x27')](_0x270507));if(_0x270507['error']){if(_0x270507[_0xe4aa('0x28')][_0xe4aa('0x29')]===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x6aa941,_0x270507['error'][_0xe4aa('0x2a')]);return _0x582005(_0x270507[_0xe4aa('0x28')][_0xe4aa('0x2a')]);}logger[_0xe4aa('0x28')]('OpenchannelMessage,\x20%s,\x20%s',_0x6aa941,_0x270507['error'][_0xe4aa('0x2a')]);return _0x519655(_0x270507['error']['message']);}else{logger['info'](_0xe4aa('0x23'),_0x6aa941,_0xe4aa('0x26'));_0x519655(_0x270507[_0xe4aa('0x2b')][_0xe4aa('0x2a')]);}})[_0xe4aa('0x2c')](function(_0x478cf5){logger[_0xe4aa('0x28')](_0xe4aa('0x23'),_0x6aa941,_0x478cf5);_0x582005(_0x478cf5);});});}function respondWithStatusCode(_0x17b605,_0x478d21){_0x478d21=_0x478d21||0xcc;return function(_0x81e562){if(_0x81e562){return _0x17b605['sendStatus'](_0x478d21);}return _0x17b605['status'](_0x478d21)[_0xe4aa('0x2d')]();};}function respondWithResult(_0x3f09fc,_0x5e0c60){_0x5e0c60=_0x5e0c60||0xc8;return function(_0x29eb55){if(_0x29eb55){return _0x3f09fc[_0xe4aa('0x2e')](_0x5e0c60)[_0xe4aa('0x2f')](_0x29eb55);}};}function respondWithFilteredResult(_0x322e41,_0x4fbb5d){return function(_0x2fbd66){if(_0x2fbd66){var _0x5271cb=typeof _0x4fbb5d[_0xe4aa('0x30')]==='undefined'&&typeof _0x4fbb5d[_0xe4aa('0x31')]==='undefined';var _0x1745ce=_0x2fbd66[_0xe4aa('0x32')];var _0x1de811=_0x5271cb?0x0:_0x4fbb5d['offset'];var _0x46093c=_0x5271cb?_0x2fbd66[_0xe4aa('0x32')]:_0x4fbb5d[_0xe4aa('0x30')]+_0x4fbb5d['limit'];var _0x28751d;if(_0x46093c>=_0x1745ce){_0x46093c=_0x1745ce;_0x28751d=0xc8;}else{_0x28751d=0xce;}_0x322e41[_0xe4aa('0x2e')](_0x28751d);return _0x322e41[_0xe4aa('0x33')](_0xe4aa('0x34'),_0x1de811+'-'+_0x46093c+'/'+_0x1745ce)[_0xe4aa('0x2f')](_0x2fbd66);}return null;};}function patchUpdates(_0x5530bf){return function(_0x10dc1f){try{jsonpatch[_0xe4aa('0x35')](_0x10dc1f,_0x5530bf,!![]);}catch(_0x4dcc33){return BPromise[_0xe4aa('0x36')](_0x4dcc33);}return _0x10dc1f[_0xe4aa('0x37')]();};}function saveUpdates(_0x5ab10d,_0x31d672){return function(_0x1ce576){if(_0x1ce576){return _0x1ce576[_0xe4aa('0x38')](_0x5ab10d)[_0xe4aa('0x21')](function(_0x4a5de9){return _0x4a5de9;});}return null;};}function removeEntity(_0xcf3f77,_0x32c46f){return function(_0x4f3294){if(_0x4f3294){return _0x4f3294[_0xe4aa('0x39')]()[_0xe4aa('0x21')](function(){_0xcf3f77[_0xe4aa('0x2e')](0xcc)[_0xe4aa('0x2d')]();});}};}function handleEntityNotFound(_0x2b99c3,_0x2a5523){return function(_0x506d32){if(!_0x506d32){_0x2b99c3[_0xe4aa('0x3a')](0x194);}return _0x506d32;};}function handleError(_0x44296c,_0x55d745){_0x55d745=_0x55d745||0x1f4;return function(_0x5df0cf){logger[_0xe4aa('0x28')](_0x5df0cf['stack']);if(_0x5df0cf[_0xe4aa('0x3b')]){delete _0x5df0cf['name'];}_0x44296c[_0xe4aa('0x2e')](_0x55d745)[_0xe4aa('0x3c')](_0x5df0cf);};}exports[_0xe4aa('0x3d')]=function(_0x16b3be,_0x548a71){var _0x572af9={},_0x23b98f={},_0x32dbd2={'count':0x0,'rows':[]};var _0xaa988b=_[_0xe4aa('0x3e')](db['OpenchannelMessage']['rawAttributes'],function(_0x395949){return{'name':_0x395949['fieldName'],'type':_0x395949[_0xe4aa('0x3f')][_0xe4aa('0x40')]};});_0x23b98f['model']=_[_0xe4aa('0x3e')](_0xaa988b,_0xe4aa('0x3b'));_0x23b98f[_0xe4aa('0x41')]=_[_0xe4aa('0x42')](_0x16b3be[_0xe4aa('0x41')]);_0x23b98f[_0xe4aa('0x43')]=_[_0xe4aa('0x44')](_0x23b98f[_0xe4aa('0x45')],_0x23b98f[_0xe4aa('0x41')]);_0x572af9['attributes']=_[_0xe4aa('0x44')](_0x23b98f[_0xe4aa('0x45')],qs[_0xe4aa('0x46')](_0x16b3be[_0xe4aa('0x41')][_0xe4aa('0x46')]));_0x572af9[_0xe4aa('0x47')]=_0x572af9[_0xe4aa('0x47')][_0xe4aa('0x48')]?_0x572af9[_0xe4aa('0x47')]:_0x23b98f[_0xe4aa('0x45')];if(!_0x16b3be['query'][_0xe4aa('0x49')](_0xe4aa('0x4a'))){_0x572af9[_0xe4aa('0x31')]=qs[_0xe4aa('0x31')](_0x16b3be[_0xe4aa('0x41')]['limit']);_0x572af9['offset']=qs['offset'](_0x16b3be[_0xe4aa('0x41')][_0xe4aa('0x30')]);}_0x572af9['order']=qs[_0xe4aa('0x4b')](_0x16b3be[_0xe4aa('0x41')][_0xe4aa('0x4b')]);_0x572af9[_0xe4aa('0x4c')]=qs['filters'](_[_0xe4aa('0x4d')](_0x16b3be[_0xe4aa('0x41')],_0x23b98f['filters']),_0xaa988b);if(_0x16b3be[_0xe4aa('0x41')][_0xe4aa('0x4e')]){_0x572af9[_0xe4aa('0x4c')]=_[_0xe4aa('0x4f')](_0x572af9[_0xe4aa('0x4c')],{'$or':_[_0xe4aa('0x3e')](_0xaa988b,function(_0x3589e6){if(_0x3589e6['type']!==_0xe4aa('0x50')){var _0x1a5755={};_0x1a5755[_0x3589e6[_0xe4aa('0x3b')]]={'$like':'%'+_0x16b3be['query'][_0xe4aa('0x4e')]+'%'};return _0x1a5755;}})});}_0x572af9=_[_0xe4aa('0x4f')]({},_0x572af9,_0x16b3be[_0xe4aa('0x51')]);var _0x16c40f={'where':_0x572af9['where']};return db[_0xe4aa('0x52')][_0xe4aa('0x32')](_0x16c40f)[_0xe4aa('0x21')](function(_0x12b6b6){_0x32dbd2[_0xe4aa('0x32')]=_0x12b6b6;if(_0x16b3be[_0xe4aa('0x41')]['includeAll']){_0x572af9[_0xe4aa('0x53')]=[{'all':!![]}];}return db[_0xe4aa('0x52')]['findAll'](_0x572af9);})[_0xe4aa('0x21')](function(_0x40e7e7){_0x32dbd2[_0xe4aa('0x54')]=_0x40e7e7;return _0x32dbd2;})[_0xe4aa('0x21')](respondWithFilteredResult(_0x548a71,_0x572af9))[_0xe4aa('0x2c')](handleError(_0x548a71,null));};exports[_0xe4aa('0x55')]=function(_0x53bfd9,_0x3f7ac8){var _0x335568={'raw':!![],'where':{'id':_0x53bfd9['params']['id']}},_0x30d43e={};_0x30d43e[_0xe4aa('0x45')]=_[_0xe4aa('0x42')](db[_0xe4aa('0x52')][_0xe4aa('0x56')]);_0x30d43e[_0xe4aa('0x41')]=_['keys'](_0x53bfd9[_0xe4aa('0x41')]);_0x30d43e[_0xe4aa('0x43')]=_[_0xe4aa('0x44')](_0x30d43e['model'],_0x30d43e[_0xe4aa('0x41')]);_0x335568['attributes']=_[_0xe4aa('0x44')](_0x30d43e[_0xe4aa('0x45')],qs[_0xe4aa('0x46')](_0x53bfd9[_0xe4aa('0x41')][_0xe4aa('0x46')]));_0x335568[_0xe4aa('0x47')]=_0x335568['attributes'][_0xe4aa('0x48')]?_0x335568['attributes']:_0x30d43e[_0xe4aa('0x45')];if(_0x53bfd9['query'][_0xe4aa('0x57')]){_0x335568[_0xe4aa('0x53')]=[{'all':!![]}];}_0x335568=_[_0xe4aa('0x4f')]({},_0x335568,_0x53bfd9[_0xe4aa('0x51')]);return db['OpenchannelMessage'][_0xe4aa('0x58')](_0x335568)[_0xe4aa('0x21')](handleEntityNotFound(_0x3f7ac8,null))[_0xe4aa('0x21')](respondWithResult(_0x3f7ac8,null))['catch'](handleError(_0x3f7ac8,null));};exports[_0xe4aa('0x59')]=function(_0x395e8f,_0x268e69){return db[_0xe4aa('0x52')][_0xe4aa('0x59')](_0x395e8f[_0xe4aa('0x5a')],{})[_0xe4aa('0x21')](respondWithResult(_0x268e69,0xc9))[_0xe4aa('0x2c')](handleError(_0x268e69,null));};exports[_0xe4aa('0x38')]=function(_0x4e5535,_0x30befc){if(_0x4e5535['body']['id']){delete _0x4e5535[_0xe4aa('0x5a')]['id'];}return db[_0xe4aa('0x52')][_0xe4aa('0x58')]({'where':{'id':_0x4e5535[_0xe4aa('0x5b')]['id']}})[_0xe4aa('0x21')](handleEntityNotFound(_0x30befc,null))['then'](saveUpdates(_0x4e5535[_0xe4aa('0x5a')],null))['then'](respondWithResult(_0x30befc,null))['catch'](handleError(_0x30befc,null));};exports[_0xe4aa('0x39')]=function(_0x48805e,_0x4a7b04){return db[_0xe4aa('0x52')]['find']({'where':{'id':_0x48805e[_0xe4aa('0x5b')]['id']}})[_0xe4aa('0x21')](handleEntityNotFound(_0x4a7b04,null))[_0xe4aa('0x21')](removeEntity(_0x4a7b04,null))[_0xe4aa('0x2c')](handleError(_0x4a7b04,null));};exports[_0xe4aa('0x5c')]=function(_0x271a52,_0x188cb5){return db[_0xe4aa('0x52')][_0xe4aa('0x5c')]()['then'](respondWithResult(_0x188cb5,null))[_0xe4aa('0x2c')](handleError(_0x188cb5,null));};var interaction_log=require('../../config/logger')('openchannel-interactions');exports[_0xe4aa('0x5d')]=function(_0x2cfcf0,_0x417791,_0x2589e0){var _0x5af1d1={'agent':{},'channel':_0xe4aa('0x5e')};if(_0x2cfcf0[_0xe4aa('0x5a')]['id']){delete _0x2cfcf0[_0xe4aa('0x5a')]['id'];}_0x2cfcf0[_0xe4aa('0x5a')][_0xe4aa('0x5f')]=!![];_0x2cfcf0[_0xe4aa('0x5a')][_0xe4aa('0x60')]=moment()[_0xe4aa('0x61')](_0xe4aa('0x62'));_0x2cfcf0[_0xe4aa('0x5a')][_0xe4aa('0x63')]=_0x2cfcf0[_0xe4aa('0x5a')][_0xe4aa('0x63')]||_0x2cfcf0[_0xe4aa('0x64')]['id'];_0x5af1d1[_0xe4aa('0x65')]['id']=_0x2cfcf0[_0xe4aa('0x5a')][_0xe4aa('0x63')];return db[_0xe4aa('0x52')][_0xe4aa('0x58')]({'where':{'id':_0x2cfcf0[_0xe4aa('0x5b')]['id'],'UserId':null}})[_0xe4aa('0x21')](handleEntityNotFound(_0x417791,null))[_0xe4aa('0x21')](saveUpdates(_0x2cfcf0[_0xe4aa('0x5a')],null))['then'](function(_0x5a82ab){if(_0x5a82ab){_0x5af1d1[_0xe4aa('0x2a')]=_0x5a82ab[_0xe4aa('0x66')]({'plain':!![]});return db['OpenchannelInteraction'][_0xe4aa('0x58')]({'where':{'id':_0x5a82ab[_0xe4aa('0x67')]}});}return null;})[_0xe4aa('0x21')](handleEntityNotFound(_0x417791,null))[_0xe4aa('0x21')](function(_0x201cf4){if(_0x201cf4){return _0x201cf4[_0xe4aa('0x38')]({'UserId':_0x2cfcf0[_0xe4aa('0x5a')]['UserId'],'read1stAt':_[_0xe4aa('0x68')](_0x201cf4[_0xe4aa('0x69')])?moment()[_0xe4aa('0x61')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xe4aa('0x21')](function(_0xeffc01){if(_0xeffc01){_0x5af1d1[_0xe4aa('0x6a')]=_0xeffc01['get']({'plain':!![]});interaction_log[_0xe4aa('0x22')](_0xe4aa('0x6b'),_0x2cfcf0[_0xe4aa('0x64')]['id'],_0x2cfcf0['user'][_0xe4aa('0x3b')],_0x2cfcf0[_0xe4aa('0x64')]['role'],_0x5af1d1[_0xe4aa('0x6a')]['id'],_0x2cfcf0[_0xe4aa('0x5a')]?JSON['stringify'](_0x2cfcf0[_0xe4aa('0x5a')]):_0xe4aa('0x6c'));return respondWithRpcPromise(_0xe4aa('0x6d'),_0xe4aa('0x6e'),_0x5af1d1);}return null;})['then'](function(_0x101cc2){var _0x7bb72f=_0xe4aa('0x6f')+_0x101cc2[_0xe4aa('0x2a')]['ContactId'];return db[_0xe4aa('0x70')][_0xe4aa('0x41')](_0x7bb72f,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0xe4aa('0x21')](function(_0x26b614){return _0x26b614;});})[_0xe4aa('0x21')](function(_0x179a7c){if(_0x179a7c){_0x5af1d1['message'][_0xe4aa('0x71')]=_0x179a7c[0x0];if(!_0x2cfcf0['body'][_0xe4aa('0x63')])return;return db[_0xe4aa('0x72')][_0xe4aa('0x58')]({'where':{'id':_0x2cfcf0[_0xe4aa('0x5a')][_0xe4aa('0x63')],'role':_0xe4aa('0x65')},'attributes':['id',_0xe4aa('0x3b'),_0xe4aa('0x73'),_0xe4aa('0x74'),_0xe4aa('0x75')],'raw':!![]});}return null;})[_0xe4aa('0x21')](function(_0x10e59d){if(!_0x10e59d)return null;_0x5af1d1[_0xe4aa('0x2a')][_0xe4aa('0x65')]=_0x10e59d;return _0x5af1d1;})[_0xe4aa('0x21')](function(_0x15623d){if(_0x15623d){if(_0x2cfcf0[_0xe4aa('0x5a')][_0xe4aa('0x76')]){_0x5af1d1[_0xe4aa('0x2a')][_0xe4aa('0x77')]=util[_0xe4aa('0x61')]('SIP/%s',_0x2cfcf0[_0xe4aa('0x64')][_0xe4aa('0x3b')]);_0x5af1d1['message'][_0xe4aa('0x78')]=_0x5af1d1[_0xe4aa('0x78')];_0x5af1d1[_0xe4aa('0x2a')]['motionChannel']=_0x5af1d1['channel'];_0x5af1d1[_0xe4aa('0x2a')][_0xe4aa('0x79')]=_0xe4aa('0x5d');return respondWithRpcPromise(_0xe4aa('0x7a'),_0xe4aa('0x7a'),{'event':_0xe4aa('0x7b'),'message':_0x5af1d1[_0xe4aa('0x2a')]},client9002)[_0xe4aa('0x21')](function(){return _0x5af1d1;});}return _0x5af1d1;}return null;})[_0xe4aa('0x21')](respondWithResult(_0x417791,null))[_0xe4aa('0x2c')](handleError(_0x417791,null));};var interaction_log=require(_0xe4aa('0x15'))('openchannel-interactions');exports[_0xe4aa('0x36')]=function(_0x3b64d1,_0x5ec84f,_0x26a16c){var _0x3c46fd={'agent':{},'channel':'openchannel'};if(_0x3b64d1[_0xe4aa('0x5a')]['id']){delete _0x3b64d1[_0xe4aa('0x5a')]['id'];}_0x3b64d1[_0xe4aa('0x5a')][_0xe4aa('0x63')]=_0x3b64d1[_0xe4aa('0x5a')][_0xe4aa('0x63')]||_0x3b64d1[_0xe4aa('0x64')]['id'];_0x3c46fd[_0xe4aa('0x65')]['id']=_0x3b64d1['body'][_0xe4aa('0x63')];return db['OpenchannelMessage'][_0xe4aa('0x58')]({'where':{'id':_0x3b64d1[_0xe4aa('0x5b')]['id'],'UserId':null}})[_0xe4aa('0x21')](handleEntityNotFound(_0x5ec84f,null))['then'](function(_0x1777d2){if(_0x1777d2){_0x3c46fd[_0xe4aa('0x2a')]=_0x1777d2[_0xe4aa('0x66')]({'plain':!![]});return db[_0xe4aa('0x7c')]['find']({'where':{'id':_0x1777d2[_0xe4aa('0x67')]}});}return null;})[_0xe4aa('0x21')](handleEntityNotFound(_0x5ec84f,null))[_0xe4aa('0x21')](function(_0x50977c){if(_0x50977c){_0x3c46fd['interaction']=_0x50977c[_0xe4aa('0x66')]({'plain':!![]});interaction_log['info'](_0xe4aa('0x7d'),_0x3b64d1[_0xe4aa('0x64')]['id'],_0x3b64d1['user'][_0xe4aa('0x3b')],_0x3b64d1[_0xe4aa('0x64')][_0xe4aa('0x7e')],_0x3c46fd[_0xe4aa('0x6a')]['id'],_0x3b64d1['body']?JSON[_0xe4aa('0x27')](_0x3b64d1[_0xe4aa('0x5a')]):'null');return respondWithRpcPromise(_0xe4aa('0x7f'),'rejectMessage',_0x3c46fd);}return null;})[_0xe4aa('0x21')](function(_0x3b910d){var _0x55f4fa=_0xe4aa('0x6f')+_0x3b910d['message'][_0xe4aa('0x80')];return db[_0xe4aa('0x70')][_0xe4aa('0x41')](_0x55f4fa,{'type':db[_0xe4aa('0x81')][_0xe4aa('0x82')][_0xe4aa('0x83')],'raw':!![]})[_0xe4aa('0x21')](function(_0x3f33c5){return _0x3f33c5;});})['then'](function(_0x5e8611){if(_0x5e8611){_0x3c46fd['message']['contact']=_0x5e8611[0x0];if(!_0x3b64d1[_0xe4aa('0x5a')][_0xe4aa('0x63')])return;return db[_0xe4aa('0x72')][_0xe4aa('0x58')]({'where':{'id':_0x3b64d1[_0xe4aa('0x5a')][_0xe4aa('0x63')],'role':'agent'},'attributes':['id','name',_0xe4aa('0x73'),_0xe4aa('0x74'),_0xe4aa('0x75')],'raw':!![]});}return null;})[_0xe4aa('0x21')](function(_0x31823f){if(!_0x31823f)return null;_0x3c46fd[_0xe4aa('0x2a')][_0xe4aa('0x65')]=_0x31823f;return _0x3c46fd;})[_0xe4aa('0x21')](function(_0x12a9e7){if(_0x12a9e7){_0x12a9e7[_0xe4aa('0x2a')][_0xe4aa('0x77')]=util[_0xe4aa('0x61')](_0xe4aa('0x84'),_0x3b64d1[_0xe4aa('0x64')][_0xe4aa('0x3b')]);_0x12a9e7[_0xe4aa('0x2a')][_0xe4aa('0x78')]=_0x3c46fd[_0xe4aa('0x78')];_0x12a9e7['message'][_0xe4aa('0x85')]=_0x3c46fd[_0xe4aa('0x78')];_0x12a9e7[_0xe4aa('0x2a')][_0xe4aa('0x79')]=_0xe4aa('0x36');respondWithRpcPromise(_0xe4aa('0x7a'),_0xe4aa('0x7a'),{'event':_0xe4aa('0x86'),'message':_0x12a9e7['message']},client9002);return _0x3c46fd;}return null;})[_0xe4aa('0x21')](respondWithResult(_0x5ec84f,null))['catch'](handleError(_0x5ec84f,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 9e9533f..f5a8b70 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 _0xd0f9=['../../mysqldb','OpenchannelMessage','setMaxListeners','remove','emit','hasOwnProperty','hook','events'];(function(_0x45fa5c,_0x1140e4){var _0x17f167=function(_0x269830){while(--_0x269830){_0x45fa5c['push'](_0x45fa5c['shift']());}};_0x17f167(++_0x1140e4);}(_0xd0f9,0x18f));var _0x9d0f=function(_0x324012,_0x23f45f){_0x324012=_0x324012-0x0;var _0x435cf2=_0xd0f9[_0x324012];return _0x435cf2;};'use strict';var EventEmitter=require(_0x9d0f('0x0'));var OpenchannelMessage=require(_0x9d0f('0x1'))['db'][_0x9d0f('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x9d0f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x9d0f('0x4')};function emitEvent(_0x439e9c){return function(_0x30a995,_0x4dc0f4,_0x4ede9a){OpenchannelMessageEvents[_0x9d0f('0x5')](_0x439e9c+':'+_0x30a995['id'],_0x30a995);OpenchannelMessageEvents['emit'](_0x439e9c,_0x30a995);_0x4ede9a(null);};}for(var e in events){if(events[_0x9d0f('0x6')](e)){var event=events[e];OpenchannelMessage[_0x9d0f('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file +var _0x2491=['hook','events','../../mysqldb','OpenchannelMessage','update','remove','emit'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x2491,0x78));var _0x1249=function(_0x47a57a,_0xb5385b){_0x47a57a=_0x47a57a-0x0;var _0x25ab9d=_0x2491[_0x47a57a];return _0x25ab9d;};'use strict';var EventEmitter=require(_0x1249('0x0'));var OpenchannelMessage=require(_0x1249('0x1'))['db'][_0x1249('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x1249('0x3'),'afterDestroy':_0x1249('0x4')};function emitEvent(_0x5d8461){return function(_0x2b34ff,_0x2793ea,_0x27d22b){OpenchannelMessageEvents[_0x1249('0x5')](_0x5d8461+':'+_0x2b34ff['id'],_0x2b34ff);OpenchannelMessageEvents[_0x1249('0x5')](_0x5d8461,_0x2b34ff);_0x27d22b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0x1249('0x6')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index e305e26..be8de72 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 _0x9ffd=['OpenchannelAccountId','Interactions','Contact','keys','replyUri','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','GET','POST','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','threadId','update','error','inspect','utf8mb4','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./openchannelMessage.attributes','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','createdAt','catch','CmContact','describe','OpenchannelAccount','find'];(function(_0x9de820,_0x122e00){var _0x40b41d=function(_0x3ba222){while(--_0x3ba222){_0x9de820['push'](_0x9de820['shift']());}};_0x40b41d(++_0x122e00);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x11ede0,_0x1b4bbd){_0x11ede0=_0x11ede0-0x0;var _0x4cb820=_0x9ffd[_0x11ede0];return _0x4cb820;};'use strict';var _=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var logger=require(_0xd9ff('0x2'))('api');var moment=require(_0xd9ff('0x3'));var BPromise=require(_0xd9ff('0x4'));var rp=require(_0xd9ff('0x5'));var fs=require('fs');var path=require(_0xd9ff('0x6'));var rimraf=require('rimraf');var config=require(_0xd9ff('0x7'));var attributes=require(_0xd9ff('0x8'));module['exports']=function(_0x3aa26b,_0x2982c3){return _0x3aa26b[_0xd9ff('0x9')](_0xd9ff('0xa'),attributes,{'tableName':_0xd9ff('0xb'),'paranoid':![],'indexes':[{'name':_0xd9ff('0xc'),'fields':[_0xd9ff('0xd')],'type':_0xd9ff('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x977487,_0x58e728,_0x54a555){var _0x567f79=_0x3aa26b['models'];var _0x2355ab=_0x977487[_0xd9ff('0xf')]({'plain':!![]});if(_0x2355ab[_0xd9ff('0x10')][_0xd9ff('0x11')]()==='in'||_0x2355ab[_0xd9ff('0x10')][_0xd9ff('0x11')]()===_0xd9ff('0x12')&&!_0x2355ab[_0xd9ff('0x13')]&&!_['isNil'](_0x2355ab['UserId'])){_0x567f79[_0xd9ff('0x14')][_0xd9ff('0x15')]({'where':{'id':_0x2355ab[_0xd9ff('0x16')]}})[_0xd9ff('0x17')](function(_0x12c39a){if(_0x12c39a){_0x12c39a['update']({'lastMsgAt':_0x2355ab[_0xd9ff('0x18')],'lastMsgDirection':_0x2355ab[_0xd9ff('0x10')]['toLowerCase']()});}})[_0xd9ff('0x19')](function(_0x5db010){console['error'](_0x5db010);});}if(_0x2355ab['direction']==='out'&&!_0x2355ab[_0xd9ff('0x13')]){var _0x4f9d6d;_0x567f79[_0xd9ff('0x1a')][_0xd9ff('0x1b')]()[_0xd9ff('0x17')](function(_0x3afd19){return _0x567f79[_0xd9ff('0x1c')][_0xd9ff('0x1d')]({'where':{'id':_0x2355ab[_0xd9ff('0x1e')]},'include':[{'model':_0x567f79[_0xd9ff('0x14')],'as':_0xd9ff('0x1f'),'where':{'id':_0x2355ab[_0xd9ff('0x16')]},'limit':0x1,'include':[{'model':_0x567f79[_0xd9ff('0x1a')],'as':_0xd9ff('0x20'),'attributes':_[_0xd9ff('0x21')](_0x3afd19)}]}]});})['then'](function(_0x4cf8ec){_0x4f9d6d=_0x4cf8ec[_0xd9ff('0xf')]({'plain':!![]});if(_0x4f9d6d&&_0x4f9d6d[_0xd9ff('0x22')]){logger['info']('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util['format'](_0xd9ff('0x23'),_0x2355ab['id'],_0x4f9d6d['replyUri']));if(_0x4f9d6d[_0xd9ff('0x1f')]&&_0x4f9d6d[_0xd9ff('0x1f')][_0xd9ff('0x24')]){_0x2355ab[_0xd9ff('0x25')]=_[_0xd9ff('0x26')](_0x4f9d6d[_0xd9ff('0x1f')][0x0],'Contact');_0x2355ab['Contact']=_0x4f9d6d[_0xd9ff('0x1f')][0x0]['Contact'];}var _0x58e728={'method':'POST','uri':encodeURI(_0x4f9d6d[_0xd9ff('0x22')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x58e728['method']){case _0xd9ff('0x27'):_0x58e728['qs']=_0x2355ab;break;case _0xd9ff('0x28'):_0x58e728[_0xd9ff('0xd')]=_0x2355ab;break;}return rp(_0x58e728)[_0xd9ff('0x17')](function(_0x5d685e){logger[_0xd9ff('0x29')](_0xd9ff('0x2a'),_0xd9ff('0x2b'),util[_0xd9ff('0x2c')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x2355ab['id'],_0x4f9d6d[_0xd9ff('0x22')]));if(_0x5d685e[_0xd9ff('0xd')][_0xd9ff('0x2d')]&&_0x5d685e[_0xd9ff('0xd')][_0xd9ff('0x2d')]!=_0x2355ab[_0xd9ff('0x25')][_0xd9ff('0x2d')]){return _0x567f79[_0xd9ff('0x14')][_0xd9ff('0x2e')]({'threadId':_0x5d685e['body'][_0xd9ff('0x2d')]},{'logging':!![],'where':{'id':_0x2355ab['Interaction']['id']}});}else{return;}})[_0xd9ff('0x17')](function(){return _0x977487[_0xd9ff('0x2e')]({'read':!![]});})[_0xd9ff('0x19')](function(_0x552d08){logger[_0xd9ff('0x2f')](_0xd9ff('0x2a'),_0xd9ff('0x2b'),util[_0xd9ff('0x30')](_0x552d08,{'showHidden':![],'depth':null}));_0x54a555();});}else{_0x54a555();}})['finally'](function(){_0x54a555();});}else{_0x54a555();}}},'charset':_0xd9ff('0x31'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xf4f4=['Interactions','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','omit','POST','method','Message\x20%d\x20forwarded\x20to\x20%s','Interaction','threadId','error','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','OpenchannelInteractionId','update','createdAt','catch','CmContact','describe','then','OpenchannelAccount','find','OpenchannelAccountId'];(function(_0x240fcb,_0x1a4526){var _0x378dc4=function(_0x462394){while(--_0x462394){_0x240fcb['push'](_0x240fcb['shift']());}};_0x378dc4(++_0x1a4526);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x13741b,_0x1d1e9d){_0x13741b=_0x13741b-0x0;var _0x1aa528=_0xf4f4[_0x13741b];return _0x1aa528;};'use strict';var _=require(_0x4f4f('0x0'));var util=require(_0x4f4f('0x1'));var logger=require('../../config/logger')(_0x4f4f('0x2'));var moment=require(_0x4f4f('0x3'));var BPromise=require(_0x4f4f('0x4'));var rp=require(_0x4f4f('0x5'));var fs=require('fs');var path=require(_0x4f4f('0x6'));var rimraf=require('rimraf');var config=require(_0x4f4f('0x7'));var attributes=require('./openchannelMessage.attributes');module[_0x4f4f('0x8')]=function(_0x132d5c,_0x20ee6e){return _0x132d5c[_0x4f4f('0x9')](_0x4f4f('0xa'),attributes,{'tableName':_0x4f4f('0xb'),'paranoid':![],'indexes':[{'name':_0x4f4f('0xc'),'fields':[_0x4f4f('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0xc066a4,_0x38d110,_0x39e36b){var _0x2d86d1=_0x132d5c[_0x4f4f('0xe')];var _0x11940f=_0xc066a4[_0x4f4f('0xf')]({'plain':!![]});if(_0x11940f[_0x4f4f('0x10')]['toLowerCase']()==='in'||_0x11940f['direction'][_0x4f4f('0x11')]()===_0x4f4f('0x12')&&!_0x11940f[_0x4f4f('0x13')]&&!_[_0x4f4f('0x14')](_0x11940f[_0x4f4f('0x15')])){_0x2d86d1[_0x4f4f('0x16')]['findOne']({'where':{'id':_0x11940f[_0x4f4f('0x17')]}})['then'](function(_0x216ba8){if(_0x216ba8){_0x216ba8[_0x4f4f('0x18')]({'lastMsgAt':_0x11940f[_0x4f4f('0x19')],'lastMsgDirection':_0x11940f[_0x4f4f('0x10')]['toLowerCase']()});}})[_0x4f4f('0x1a')](function(_0x4c68f4){console['error'](_0x4c68f4);});}if(_0x11940f['direction']===_0x4f4f('0x12')&&!_0x11940f[_0x4f4f('0x13')]){var _0x2d21ed;_0x2d86d1[_0x4f4f('0x1b')][_0x4f4f('0x1c')]()[_0x4f4f('0x1d')](function(_0x1245c4){return _0x2d86d1[_0x4f4f('0x1e')][_0x4f4f('0x1f')]({'where':{'id':_0x11940f[_0x4f4f('0x20')]},'include':[{'model':_0x2d86d1[_0x4f4f('0x16')],'as':_0x4f4f('0x21'),'where':{'id':_0x11940f['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x2d86d1[_0x4f4f('0x1b')],'as':_0x4f4f('0x22'),'attributes':_[_0x4f4f('0x23')](_0x1245c4)}]}]});})[_0x4f4f('0x1d')](function(_0x302a79){_0x2d21ed=_0x302a79[_0x4f4f('0xf')]({'plain':!![]});if(_0x2d21ed&&_0x2d21ed[_0x4f4f('0x24')]){logger[_0x4f4f('0x25')](_0x4f4f('0x26'),_0x4f4f('0x27'),util[_0x4f4f('0x28')](_0x4f4f('0x29'),_0x11940f['id'],_0x2d21ed[_0x4f4f('0x24')]));if(_0x2d21ed[_0x4f4f('0x21')]&&_0x2d21ed['Interactions']['length']){_0x11940f['Interaction']=_[_0x4f4f('0x2a')](_0x2d21ed[_0x4f4f('0x21')][0x0],'Contact');_0x11940f[_0x4f4f('0x22')]=_0x2d21ed[_0x4f4f('0x21')][0x0][_0x4f4f('0x22')];}var _0x38d110={'method':_0x4f4f('0x2b'),'uri':encodeURI(_0x2d21ed[_0x4f4f('0x24')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x38d110[_0x4f4f('0x2c')]){case'GET':_0x38d110['qs']=_0x11940f;break;case _0x4f4f('0x2b'):_0x38d110[_0x4f4f('0xd')]=_0x11940f;break;}return rp(_0x38d110)[_0x4f4f('0x1d')](function(_0x15c79c){logger[_0x4f4f('0x25')]('OpenchannelMessage,\x20%s,\x20%s',_0x4f4f('0x27'),util[_0x4f4f('0x28')](_0x4f4f('0x2d'),_0x11940f['id'],_0x2d21ed['replyUri']));if(_0x15c79c['body']['threadId']&&_0x15c79c[_0x4f4f('0xd')]['threadId']!=_0x11940f[_0x4f4f('0x2e')][_0x4f4f('0x2f')]){return _0x2d86d1[_0x4f4f('0x16')]['update']({'threadId':_0x15c79c[_0x4f4f('0xd')][_0x4f4f('0x2f')]},{'logging':!![],'where':{'id':_0x11940f['Interaction']['id']}});}else{return;}})[_0x4f4f('0x1d')](function(){return _0xc066a4[_0x4f4f('0x18')]({'read':!![]});})[_0x4f4f('0x1a')](function(_0x5b937e){logger[_0x4f4f('0x30')](_0x4f4f('0x26'),'afterCreate',util['inspect'](_0x5b937e,{'showHidden':![],'depth':null}));_0x39e36b();});}else{_0x39e36b();}})[_0x4f4f('0x31')](function(){_0x39e36b();});}else{_0x39e36b();}}},'charset':_0x4f4f('0x32'),'collate':_0x4f4f('0x33')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 2664d21..de60909 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 _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(_0x1ab797,_0x3fda53){var _0x4d067b=function(_0x4a1285){while(--_0x4a1285){_0x1ab797['push'](_0x1ab797['shift']());}};_0x4d067b(++_0x3fda53);}(_0x7a54,0x106));var _0x47a5=function(_0x229af9,_0x423484){_0x229af9=_0x229af9-0x0;var _0x193f17=_0x7a54[_0x229af9];return _0x193f17;};'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 +var _0xdb28=['then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateOpenchannelMessage','OpenchannelMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','request'];(function(_0x571c83,_0x4c97dc){var _0x2b8bd2=function(_0x1401a1){while(--_0x1401a1){_0x571c83['push'](_0x571c83['shift']());}};_0x2b8bd2(++_0x4c97dc);}(_0xdb28,0x106));var _0x8db2=function(_0xe39ae8,_0x8b4a63){_0xe39ae8=_0xe39ae8-0x0;var _0x336137=_0xdb28[_0xe39ae8];return _0x336137;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});config['redis']=_[_0x8db2('0xb')](config[_0x8db2('0xc')],{'host':_0x8db2('0xd'),'port':0x18eb});var socket=require(_0x8db2('0xe'))(new Redis(config[_0x8db2('0xc')]));require(_0x8db2('0xf'))[_0x8db2('0x10')](socket);function respondWithRpcPromise(_0x4ba340,_0x30dc90,_0x476216){return new BPromise(function(_0x1f62af,_0x57015f){return client[_0x8db2('0x11')](_0x4ba340,_0x476216)[_0x8db2('0x12')](function(_0x576475){logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));logger[_0x8db2('0x16')](_0x8db2('0x17'),_0x30dc90,'request\x20sent',JSON['stringify'](_0x576475));if(_0x576475[_0x8db2('0x18')]){if(_0x576475[_0x8db2('0x18')][_0x8db2('0x19')]===0x1f4){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x57015f(_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);}logger[_0x8db2('0x18')]('OpenchannelMessage,\x20%s,\x20%s',_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x1f62af(_0x576475['error'][_0x8db2('0x1a')]);}else{logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));_0x1f62af(_0x576475[_0x8db2('0x1b')][_0x8db2('0x1a')]);}})['catch'](function(_0x5df464){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x5df464);_0x57015f(_0x5df464);});});}exports[_0x8db2('0x1c')]=function(_0x1b64e4){var _0x58562e=this;return new Promise(function(_0x431d60,_0x36a9ff){return db[_0x8db2('0x1d')][_0x8db2('0x1e')](_0x1b64e4[_0x8db2('0x1f')],{'raw':_0x1b64e4['options']?_0x1b64e4[_0x8db2('0x20')][_0x8db2('0x21')]===undefined?!![]:![]:!![]})[_0x8db2('0x12')](function(_0x125be2){logger[_0x8db2('0x13')](_0x8db2('0x1c'),_0x1b64e4);logger[_0x8db2('0x16')]('CreateOpenchannelMessage',_0x1b64e4,JSON[_0x8db2('0x22')](_0x125be2));_0x431d60(_0x125be2);})['catch'](function(_0x5725f0){logger['error']('CreateOpenchannelMessage',_0x5725f0[_0x8db2('0x1a')],_0x1b64e4);_0x36a9ff(_0x58562e[_0x8db2('0x18')](0x1f4,_0x5725f0[_0x8db2('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index ce48442..3600f65 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 _0x9aef=['save','remove','update','emit','register','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9aef,0xfc));var _0xf9ae=function(_0xe15934,_0x5439fd){_0xe15934=_0xe15934-0x0;var _0x486c48=_0x9aef[_0xe15934];return _0x486c48;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0xf9ae('0x0'),_0xf9ae('0x1'),_0xf9ae('0x2')];function createListener(_0x3475ea,_0x22fe1c){return function(_0x466ae1){_0x22fe1c[_0xf9ae('0x3')](_0x3475ea,_0x466ae1);};}function removeListener(_0x4f1050,_0x37647f){return function(){OpenchannelMessageEvents['removeListener'](_0x4f1050,_0x37647f);};}exports[_0xf9ae('0x4')]=function(_0x12fee1){for(var _0x57c986=0x0,_0x42e2a9=events[_0xf9ae('0x5')];_0x57c986<_0x42e2a9;_0x57c986++){var _0xc29d03=events[_0x57c986];var _0x56541a=createListener('openchannelMessage:'+_0xc29d03,_0x12fee1);OpenchannelMessageEvents['on'](_0xc29d03,_0x56541a);}}; \ No newline at end of file +var _0x394d=['openchannelMessage:','./openchannelMessage.events','emit'];(function(_0x2a67fe,_0x295c09){var _0x57e726=function(_0x280573){while(--_0x280573){_0x2a67fe['push'](_0x2a67fe['shift']());}};_0x57e726(++_0x295c09);}(_0x394d,0x12a));var _0xd394=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0x394d[_0x1b6186];return _0x186121;};'use strict';var OpenchannelMessageEvents=require(_0xd394('0x0'));var events=['save','remove','update'];function createListener(_0x280787,_0x2d0bf8){return function(_0x55b856){_0x2d0bf8[_0xd394('0x1')](_0x280787,_0x55b856);};}function removeListener(_0x499c7c,_0x278b36){return function(){OpenchannelMessageEvents['removeListener'](_0x499c7c,_0x278b36);};}exports['register']=function(_0x24558b){for(var _0x59a7fd=0x0,_0x1fcbf7=events['length'];_0x59a7fd<_0x1fcbf7;_0x59a7fd++){var _0x3d5c6d=events[_0x59a7fd];var _0x4cd6d4=createListener(_0xd394('0x2')+_0x3d5c6d,_0x24558b);OpenchannelMessageEvents['on'](_0x3d5c6d,_0x4cd6d4);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index baaa2e9..ba55b9f 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 _0x7cc8=['destroy','delete','removeTeams','exports','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./openchannelQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','update'];(function(_0x387777,_0x356171){var _0x3f84c0=function(_0x4d4423){while(--_0x4d4423){_0x387777['push'](_0x387777['shift']());}};_0x3f84c0(++_0x356171);}(_0x7cc8,0x1ea));var _0x87cc=function(_0x53ba72,_0xbf9688){_0x53ba72=_0x53ba72-0x0;var _0x71b17a=_0x7cc8[_0x53ba72];return _0x71b17a;};'use strict';var multer=require('multer');var util=require(_0x87cc('0x0'));var path=require('path');var timeout=require(_0x87cc('0x1'));var express=require(_0x87cc('0x2'));var router=express[_0x87cc('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x87cc('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x87cc('0x5'));var controller=require(_0x87cc('0x6'));router[_0x87cc('0x7')]('/',auth['isAuthenticated'](),controller[_0x87cc('0x8')]);router[_0x87cc('0x7')](_0x87cc('0x9'),auth[_0x87cc('0xa')](),controller[_0x87cc('0xb')]);router[_0x87cc('0x7')](_0x87cc('0xc'),auth[_0x87cc('0xa')](),controller['show']);router['get'](_0x87cc('0xd'),auth[_0x87cc('0xa')](),controller[_0x87cc('0xe')]);router[_0x87cc('0x7')](_0x87cc('0xf'),auth[_0x87cc('0xa')](),controller[_0x87cc('0x10')]);router[_0x87cc('0x7')](_0x87cc('0x11'),auth[_0x87cc('0xa')](),controller[_0x87cc('0x12')]);router['post']('/',auth[_0x87cc('0xa')](),controller[_0x87cc('0x13')]);router[_0x87cc('0x14')]('/:id/teams',auth[_0x87cc('0xa')](),controller[_0x87cc('0x15')]);router['post'](_0x87cc('0x11'),auth[_0x87cc('0xa')](),controller['addAgents']);router['put'](_0x87cc('0xc'),auth[_0x87cc('0xa')](),controller[_0x87cc('0x16')]);router['delete'](_0x87cc('0xc'),auth[_0x87cc('0xa')](),controller[_0x87cc('0x17')]);router[_0x87cc('0x18')](_0x87cc('0xf'),auth[_0x87cc('0xa')](),controller[_0x87cc('0x19')]);router[_0x87cc('0x18')](_0x87cc('0x11'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x87cc('0x1a')]=router; \ No newline at end of file +var _0x4371=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','put','/:id','update','delete','destroy','removeTeams','removeAgents'];(function(_0x305a6e,_0x1f4a40){var _0xd23128=function(_0x230ce6){while(--_0x230ce6){_0x305a6e['push'](_0x305a6e['shift']());}};_0xd23128(++_0x1f4a40);}(_0x4371,0xc1));var _0x1437=function(_0x195e6a,_0x379e1c){_0x195e6a=_0x195e6a-0x0;var _0x4aeab4=_0x4371[_0x195e6a];return _0x4aeab4;};'use strict';var multer=require(_0x1437('0x0'));var util=require(_0x1437('0x1'));var path=require('path');var timeout=require(_0x1437('0x2'));var express=require(_0x1437('0x3'));var router=express[_0x1437('0x4')]();var fs_extra=require(_0x1437('0x5'));var auth=require(_0x1437('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1437('0x7'));var controller=require(_0x1437('0x8'));router[_0x1437('0x9')]('/',auth[_0x1437('0xa')](),controller[_0x1437('0xb')]);router[_0x1437('0x9')](_0x1437('0xc'),auth[_0x1437('0xa')](),controller[_0x1437('0xd')]);router[_0x1437('0x9')]('/:id',auth[_0x1437('0xa')](),controller[_0x1437('0xe')]);router[_0x1437('0x9')](_0x1437('0xf'),auth['isAuthenticated'](),controller[_0x1437('0x10')]);router[_0x1437('0x9')](_0x1437('0x11'),auth['isAuthenticated'](),controller[_0x1437('0x12')]);router[_0x1437('0x9')](_0x1437('0x13'),auth[_0x1437('0xa')](),controller['getAgents']);router[_0x1437('0x14')]('/',auth['isAuthenticated'](),controller[_0x1437('0x15')]);router[_0x1437('0x14')](_0x1437('0x11'),auth[_0x1437('0xa')](),controller[_0x1437('0x16')]);router[_0x1437('0x14')](_0x1437('0x13'),auth[_0x1437('0xa')](),controller[_0x1437('0x17')]);router[_0x1437('0x18')](_0x1437('0x19'),auth['isAuthenticated'](),controller[_0x1437('0x1a')]);router[_0x1437('0x1b')](_0x1437('0x19'),auth[_0x1437('0xa')](),controller[_0x1437('0x1c')]);router[_0x1437('0x1b')](_0x1437('0x11'),auth[_0x1437('0xa')](),controller[_0x1437('0x1d')]);router[_0x1437('0x1b')](_0x1437('0x13'),auth['isAuthenticated'](),controller[_0x1437('0x1e')]);module[_0x1437('0x1f')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index ca650a8..088c2b6 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 _0xcbf5=['STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x9da573,_0xa26320){var _0x2781ad=function(_0x5f21ce){while(--_0x5f21ce){_0x9da573['push'](_0x9da573['shift']());}};_0x2781ad(++_0xa26320);}(_0xcbf5,0xf1));var _0x5cbf=function(_0x11b9fb,_0x30e400){_0x11b9fb=_0x11b9fb-0x0;var _0x51dd1a=_0xcbf5[_0x11b9fb];return _0x51dd1a;};'use strict';var Sequelize=require(_0x5cbf('0x0'));module[_0x5cbf('0x1')]={'name':{'type':Sequelize[_0x5cbf('0x2')],'unique':_0x5cbf('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5cbf('0x2')]},'timeout':{'type':Sequelize[_0x5cbf('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5cbf('0x5')](_0x5cbf('0x6'),_0x5cbf('0x7'),_0x5cbf('0x8'))}}; \ No newline at end of file +var _0x3662=['beepall','sequelize','exports','name','STRING','ENUM'];(function(_0x351ba3,_0x36746f){var _0x18d6f3=function(_0x52744e){while(--_0x52744e){_0x351ba3['push'](_0x351ba3['shift']());}};_0x18d6f3(++_0x36746f);}(_0x3662,0x1db));var _0x2366=function(_0x576162,_0x431de7){_0x576162=_0x576162-0x0;var _0x2208bf=_0x3662[_0x576162];return _0x2208bf;};'use strict';var Sequelize=require(_0x2366('0x0'));module[_0x2366('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x2366('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2366('0x3')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2366('0x4')]('rrmemory',_0x2366('0x5'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 71694cb..fcd5c63 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 _0x390f=['getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','UserOpenchannelQueue','findOrCreate','emit','removeTeams','tq.TeamId','from','team_has_openchannel_queues','join','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','push','toString','QueryTypes','every','TeamId','all','union','compact','transaction','removeAgents','forEach','addAgents','userOpenchannelQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','then','destroy','UserProfileResource','end','error','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','findOne','findAll','User','UserId','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP'];(function(_0x31e5d4,_0x5c8a9e){var _0x3b312e=function(_0x27347f){while(--_0x27347f){_0x31e5d4['push'](_0x31e5d4['shift']());}};_0x3b312e(++_0x5c8a9e);}(_0x390f,0xa9));var _0xf390=function(_0x598b78,_0xf4ee7e){_0x598b78=_0x598b78-0x0;var _0x6392fa=_0x390f[_0x598b78];return _0x6392fa;};'use strict';var emlformat=require(_0xf390('0x0'));var rimraf=require(_0xf390('0x1'));var zipdir=require(_0xf390('0x2'));var jsonpatch=require(_0xf390('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf390('0x4'));var Mustache=require(_0xf390('0x5'));var util=require(_0xf390('0x6'));var path=require(_0xf390('0x7'));var sox=require('sox');var csv=require(_0xf390('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf390('0x9'));var _=require(_0xf390('0xa'));var squel=require(_0xf390('0xb'));var crypto=require(_0xf390('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf390('0x8'));var querystring=require('querystring');var Papa=require(_0xf390('0xd'));var Redis=require(_0xf390('0xe'));var authService=require(_0xf390('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf390('0x10'));var logger=require(_0xf390('0x11'))(_0xf390('0x12'));var utils=require(_0xf390('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf390('0x14'))['db'];config[_0xf390('0x15')]=_[_0xf390('0x16')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf390('0x17'))(new Redis(config[_0xf390('0x15')]));require(_0xf390('0x18'))[_0xf390('0x19')](socket);function respondWithStatusCode(_0x2db990,_0x53e943){_0x53e943=_0x53e943||0xcc;return function(_0x1c4016){if(_0x1c4016){return _0x2db990[_0xf390('0x1a')](_0x53e943);}return _0x2db990['status'](_0x53e943)['end']();};}function respondWithResult(_0x1a58ad,_0x28b3e3){_0x28b3e3=_0x28b3e3||0xc8;return function(_0x5cb1a6){if(_0x5cb1a6){return _0x1a58ad[_0xf390('0x1b')](_0x28b3e3)['json'](_0x5cb1a6);}};}function respondWithFilteredResult(_0x2840e6,_0x13ca01){return function(_0x5d000b){if(_0x5d000b){var _0x2ff5cb=typeof _0x13ca01[_0xf390('0x1c')]===_0xf390('0x1d')&&typeof _0x13ca01[_0xf390('0x1e')]===_0xf390('0x1d');var _0x59b664=_0x5d000b[_0xf390('0x1f')];var _0x19bdd8=_0x2ff5cb?0x0:_0x13ca01[_0xf390('0x1c')];var _0x14a599=_0x2ff5cb?_0x5d000b[_0xf390('0x1f')]:_0x13ca01['offset']+_0x13ca01['limit'];var _0x127425;if(_0x14a599>=_0x59b664){_0x14a599=_0x59b664;_0x127425=0xc8;}else{_0x127425=0xce;}_0x2840e6[_0xf390('0x1b')](_0x127425);return _0x2840e6['set'](_0xf390('0x20'),_0x19bdd8+'-'+_0x14a599+'/'+_0x59b664)[_0xf390('0x21')](_0x5d000b);}return null;};}function patchUpdates(_0x505402){return function(_0x24ca7b){try{jsonpatch[_0xf390('0x22')](_0x24ca7b,_0x505402,!![]);}catch(_0x12e567){return BPromise[_0xf390('0x23')](_0x12e567);}return _0x24ca7b['save']();};}function saveUpdates(_0x36324b,_0x31d595){return function(_0x4da9d3){if(_0x4da9d3){return _0x4da9d3['update'](_0x36324b)[_0xf390('0x24')](function(_0x37af21){return _0x37af21;});}return null;};}function removeEntity(_0x3466a6,_0x4edf5f){return function(_0x5de1ff){if(_0x5de1ff){return _0x5de1ff[_0xf390('0x25')]()[_0xf390('0x24')](function(){var _0x38a79a=_0x5de1ff['get']({'plain':!![]});var _0x26c1bf='OpenchannelQueues';return db[_0xf390('0x26')]['destroy']({'where':{'type':_0x26c1bf,'resourceId':_0x38a79a['id']}})[_0xf390('0x24')](function(){return _0x5de1ff;});})[_0xf390('0x24')](function(){_0x3466a6['status'](0xcc)[_0xf390('0x27')]();});}};}function handleEntityNotFound(_0x131f0e,_0x52e6ee){return function(_0x451241){if(!_0x451241){_0x131f0e[_0xf390('0x1a')](0x194);}return _0x451241;};}function handleError(_0x3a5337,_0x1fb8e5){_0x1fb8e5=_0x1fb8e5||0x1f4;return function(_0x211c67){logger[_0xf390('0x28')](_0x211c67['stack']);if(_0x211c67['name']){delete _0x211c67[_0xf390('0x29')];}_0x3a5337[_0xf390('0x1b')](_0x1fb8e5)[_0xf390('0x2a')](_0x211c67);};}exports[_0xf390('0x2b')]=function(_0x24433e,_0x165baa){var _0x364803={},_0x49ae64={},_0x248dc2={'count':0x0,'rows':[]};var _0x45dc1e=_[_0xf390('0x2c')](db[_0xf390('0x2d')][_0xf390('0x2e')],function(_0x3bb249){return{'name':_0x3bb249[_0xf390('0x2f')],'type':_0x3bb249[_0xf390('0x30')][_0xf390('0x31')]};});_0x49ae64[_0xf390('0x32')]=_['map'](_0x45dc1e,_0xf390('0x29'));_0x49ae64[_0xf390('0x33')]=_[_0xf390('0x34')](_0x24433e[_0xf390('0x33')]);_0x49ae64[_0xf390('0x35')]=_[_0xf390('0x36')](_0x49ae64[_0xf390('0x32')],_0x49ae64[_0xf390('0x33')]);_0x364803[_0xf390('0x37')]=_[_0xf390('0x36')](_0x49ae64['model'],qs[_0xf390('0x38')](_0x24433e[_0xf390('0x33')]['fields']));_0x364803[_0xf390('0x37')]=_0x364803[_0xf390('0x37')][_0xf390('0x39')]?_0x364803[_0xf390('0x37')]:_0x49ae64[_0xf390('0x32')];if(!_0x24433e[_0xf390('0x33')][_0xf390('0x3a')](_0xf390('0x3b'))){_0x364803[_0xf390('0x1e')]=qs[_0xf390('0x1e')](_0x24433e[_0xf390('0x33')][_0xf390('0x1e')]);_0x364803['offset']=qs[_0xf390('0x1c')](_0x24433e[_0xf390('0x33')]['offset']);}_0x364803[_0xf390('0x3c')]=qs[_0xf390('0x3d')](_0x24433e['query'][_0xf390('0x3d')]);_0x364803[_0xf390('0x3e')]=qs[_0xf390('0x35')](_[_0xf390('0x3f')](_0x24433e[_0xf390('0x33')],_0x49ae64['filters']),_0x45dc1e);if(_0x24433e[_0xf390('0x33')][_0xf390('0x40')]){_0x364803['where']=_[_0xf390('0x41')](_0x364803['where'],{'$or':_[_0xf390('0x2c')](_0x45dc1e,function(_0x3c2f8f){if(_0x3c2f8f['type']!==_0xf390('0x42')){var _0x1f0b66={};_0x1f0b66[_0x3c2f8f[_0xf390('0x29')]]={'$like':'%'+_0x24433e[_0xf390('0x33')][_0xf390('0x40')]+'%'};return _0x1f0b66;}})});}_0x364803=_['merge']({},_0x364803,_0x24433e[_0xf390('0x43')]);var _0x2f9705={'where':_0x364803['where']};return db[_0xf390('0x2d')][_0xf390('0x1f')](_0x2f9705)[_0xf390('0x24')](function(_0x4e2a1b){_0x248dc2[_0xf390('0x1f')]=_0x4e2a1b;if(_0x24433e[_0xf390('0x33')][_0xf390('0x44')]){_0x364803[_0xf390('0x45')]=[{'all':!![]}];}return db['OpenchannelQueue']['findAll'](_0x364803);})[_0xf390('0x24')](function(_0x2e2f65){_0x248dc2[_0xf390('0x46')]=_0x2e2f65;return _0x248dc2;})[_0xf390('0x24')](respondWithFilteredResult(_0x165baa,_0x364803))[_0xf390('0x47')](handleError(_0x165baa,null));};exports[_0xf390('0x48')]=function(_0xce290,_0xa6a2ef){var _0x5e124a={'raw':!![],'where':{'id':_0xce290[_0xf390('0x49')]['id']}},_0x3e064c={};_0x3e064c[_0xf390('0x32')]=_[_0xf390('0x34')](db['OpenchannelQueue'][_0xf390('0x2e')]);_0x3e064c[_0xf390('0x33')]=_[_0xf390('0x34')](_0xce290[_0xf390('0x33')]);_0x3e064c[_0xf390('0x35')]=_[_0xf390('0x36')](_0x3e064c[_0xf390('0x32')],_0x3e064c[_0xf390('0x33')]);_0x5e124a[_0xf390('0x37')]=_[_0xf390('0x36')](_0x3e064c[_0xf390('0x32')],qs[_0xf390('0x38')](_0xce290['query'][_0xf390('0x38')]));_0x5e124a['attributes']=_0x5e124a['attributes'][_0xf390('0x39')]?_0x5e124a[_0xf390('0x37')]:_0x3e064c[_0xf390('0x32')];if(_0xce290[_0xf390('0x33')]['includeAll']){_0x5e124a['include']=[{'all':!![]}];}_0x5e124a=_[_0xf390('0x41')]({},_0x5e124a,_0xce290['options']);return db['OpenchannelQueue'][_0xf390('0x4a')](_0x5e124a)[_0xf390('0x24')](handleEntityNotFound(_0xa6a2ef,null))[_0xf390('0x24')](respondWithResult(_0xa6a2ef,null))[_0xf390('0x47')](handleError(_0xa6a2ef,null));};exports[_0xf390('0x4b')]=function(_0x5916f5,_0x50c298){return db[_0xf390('0x2d')][_0xf390('0x4b')](_0x5916f5['body'],{})[_0xf390('0x24')](function(_0x3313dc){var _0x15c37f=_0x5916f5[_0xf390('0x4c')][_0xf390('0x4d')]({'plain':!![]});if(!_0x15c37f)throw new Error(_0xf390('0x4e'));if(_0x15c37f[_0xf390('0x4f')]===_0xf390('0x4c')){var _0x4dc6a7=_0x3313dc[_0xf390('0x4d')]({'plain':!![]});var _0x410873=_0xf390('0x50');return db[_0xf390('0x51')][_0xf390('0x4a')]({'where':{'name':_0x410873,'userProfileId':_0x15c37f[_0xf390('0x52')]},'raw':!![]})[_0xf390('0x24')](function(_0x3c5513){if(_0x3c5513&&_0x3c5513[_0xf390('0x53')]===0x0){return db[_0xf390('0x26')][_0xf390('0x4b')]({'name':_0x4dc6a7[_0xf390('0x29')],'resourceId':_0x4dc6a7['id'],'type':_0x3c5513[_0xf390('0x29')],'sectionId':_0x3c5513['id']},{})[_0xf390('0x24')](function(){return _0x3313dc;});}else{return _0x3313dc;}})[_0xf390('0x47')](function(_0x260843){logger[_0xf390('0x28')](_0xf390('0x54'),_0x260843);throw _0x260843;});}return _0x3313dc;})[_0xf390('0x24')](respondWithResult(_0x50c298,0xc9))['catch'](handleError(_0x50c298,null));};exports[_0xf390('0x55')]=function(_0x269997,_0x370fa8){if(_0x269997[_0xf390('0x56')]['id']){delete _0x269997[_0xf390('0x56')]['id'];}return db[_0xf390('0x2d')]['find']({'where':{'id':_0x269997[_0xf390('0x49')]['id']}})[_0xf390('0x24')](handleEntityNotFound(_0x370fa8,null))[_0xf390('0x24')](saveUpdates(_0x269997[_0xf390('0x56')],null))[_0xf390('0x24')](respondWithResult(_0x370fa8,null))[_0xf390('0x47')](handleError(_0x370fa8,null));};exports[_0xf390('0x25')]=function(_0x2ad3ee,_0x1dc6db){return db[_0xf390('0x2d')]['find']({'where':{'id':_0x2ad3ee[_0xf390('0x49')]['id']}})[_0xf390('0x24')](handleEntityNotFound(_0x1dc6db,null))[_0xf390('0x24')](removeEntity(_0x1dc6db,null))[_0xf390('0x47')](handleError(_0x1dc6db,null));};exports[_0xf390('0x57')]=function(_0x4977c2,_0x3b5ce1){return db[_0xf390('0x2d')][_0xf390('0x57')]()[_0xf390('0x24')](respondWithResult(_0x3b5ce1,null))['catch'](handleError(_0x3b5ce1,null));};exports['getMembers']=function(_0x505cf9,_0x243e8d,_0xdd611a){var _0x5731d0={'raw':!![],'where':{}},_0x1fa438={},_0x259a5f;return db['OpenchannelQueue'][_0xf390('0x58')]({'where':{'id':_0x505cf9['params']['id']}})['then'](handleEntityNotFound(_0x243e8d,null))[_0xf390('0x24')](function(_0x32e818){if(_0x32e818){_0x259a5f=_0x32e818[_0xf390('0x4d')]({'plain':!![]});_0x1fa438[_0xf390('0x32')]=_[_0xf390('0x34')](db['UserOpenchannelQueue']['rawAttributes']);_0x1fa438[_0xf390('0x33')]=_[_0xf390('0x34')](_0x505cf9[_0xf390('0x33')]);_0x1fa438[_0xf390('0x35')]=_[_0xf390('0x36')](_0x1fa438[_0xf390('0x32')],_0x1fa438[_0xf390('0x33')]);_0x5731d0[_0xf390('0x37')]=_[_0xf390('0x36')](_0x1fa438[_0xf390('0x32')],qs[_0xf390('0x38')](_0x505cf9[_0xf390('0x33')][_0xf390('0x38')]));_0x5731d0[_0xf390('0x37')]=_0x5731d0['attributes'][_0xf390('0x39')]?_0x5731d0[_0xf390('0x37')]:_0x1fa438[_0xf390('0x32')];if(!_0x505cf9['query'][_0xf390('0x3a')](_0xf390('0x3b'))){_0x5731d0[_0xf390('0x1e')]=qs[_0xf390('0x1e')](_0x505cf9['query'][_0xf390('0x1e')]);_0x5731d0[_0xf390('0x1c')]=qs[_0xf390('0x1c')](_0x505cf9[_0xf390('0x33')][_0xf390('0x1c')]);}_0x5731d0[_0xf390('0x3c')]=qs['sort'](_0x505cf9['query'][_0xf390('0x3d')]);_0x5731d0[_0xf390('0x3e')]=qs[_0xf390('0x35')](_[_0xf390('0x3f')](_0x505cf9[_0xf390('0x33')],_0x1fa438['filters']));_0x5731d0[_0xf390('0x3e')]['OpenchannelQueueId']=_0x32e818['id'];if(_0x505cf9['query'][_0xf390('0x40')]){_0x5731d0[_0xf390('0x3e')]=_[_0xf390('0x41')](_0x5731d0[_0xf390('0x3e')],{'$or':_[_0xf390('0x2c')](_0x5731d0['attributes'],function(_0x20e6ed){var _0x585c28={};_0x585c28[_0x20e6ed]={'$like':'%'+_0x505cf9[_0xf390('0x33')][_0xf390('0x40')]+'%'};return _0x585c28;})});}_0x5731d0=_[_0xf390('0x41')]({},_0x5731d0,_0x505cf9[_0xf390('0x43')]);return db['UserOpenchannelQueue'][_0xf390('0x59')](_0x5731d0);}})[_0xf390('0x24')](function(_0x470a13){if(_0x470a13){return db[_0xf390('0x5a')]['findAndCountAll']({'where':{'id':_[_0xf390('0x2c')](_0x470a13,_0xf390('0x5b')),'role':_0xf390('0x5c')},'attributes':['id','name',_0xf390('0x5d'),_0xf390('0x5e'),_0xf390('0x5f')]});}})['then'](function(_0x5da058){if(_0x5da058){return{'count':_0x5da058[_0xf390('0x1f')],'rows':_['map'](_0x5da058[_0xf390('0x46')],function(_0x4ad32c){return{'membername':_0x4ad32c[_0xf390('0x29')],'UserId':_0x4ad32c['id'],'queue_name':_0x259a5f[_0xf390('0x29')],'OpenchannelQueueId':_0x259a5f['id'],'interface':util[_0xf390('0x60')](_0xf390('0x61'),_0xf390('0x62'),_0x4ad32c[_0xf390('0x29')]),'penalty':0x0,'paused':_0x4ad32c[_0xf390('0x5d')],'createdAt':_0x4ad32c[_0xf390('0x5f')],'updatedAt':_0x4ad32c[_0xf390('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf390('0x24')](respondWithFilteredResult(_0x243e8d,_0x5731d0))['catch'](handleError(_0x243e8d,null));};exports[_0xf390('0x63')]=function(_0x41793b,_0x230cd1,_0x33c5fa){var _0x13d2dd={};var _0x2b3f50={};var _0x34c5f2;var _0x31b01f;return db[_0xf390('0x2d')][_0xf390('0x58')]({'where':{'id':_0x41793b[_0xf390('0x49')]['id']}})[_0xf390('0x24')](handleEntityNotFound(_0x230cd1,null))[_0xf390('0x24')](function(_0x427fb9){if(_0x427fb9){_0x34c5f2=_0x427fb9;_0x2b3f50[_0xf390('0x32')]=_[_0xf390('0x34')](db[_0xf390('0x64')][_0xf390('0x2e')]);_0x2b3f50[_0xf390('0x33')]=_['keys'](_0x41793b[_0xf390('0x33')]);_0x2b3f50[_0xf390('0x35')]=_[_0xf390('0x36')](_0x2b3f50['model'],_0x2b3f50[_0xf390('0x33')]);_0x13d2dd[_0xf390('0x37')]=_[_0xf390('0x36')](_0x2b3f50[_0xf390('0x32')],qs[_0xf390('0x38')](_0x41793b[_0xf390('0x33')][_0xf390('0x38')]));_0x13d2dd['attributes']=_0x13d2dd[_0xf390('0x37')]['length']?_0x13d2dd[_0xf390('0x37')]:_0x2b3f50['model'];_0x13d2dd[_0xf390('0x3c')]=qs[_0xf390('0x3d')](_0x41793b[_0xf390('0x33')][_0xf390('0x3d')]);_0x13d2dd['where']=qs['filters'](_[_0xf390('0x3f')](_0x41793b[_0xf390('0x33')],_0x2b3f50[_0xf390('0x35')]));if(_0x41793b[_0xf390('0x33')][_0xf390('0x40')]){_0x13d2dd['where']=_[_0xf390('0x41')](_0x13d2dd[_0xf390('0x3e')],{'$or':_[_0xf390('0x2c')](_0x13d2dd[_0xf390('0x37')],function(_0x320150){var _0x2aaece={};_0x2aaece[_0x320150]={'$like':'%'+_0x41793b['query'][_0xf390('0x40')]+'%'};return _0x2aaece;})});}_0x13d2dd=_[_0xf390('0x41')]({},_0x13d2dd,_0x41793b['options']);return _0x34c5f2['getTeams'](_0x13d2dd);}})['then'](function(_0x423bc7){if(_0x423bc7){_0x31b01f=_0x423bc7[_0xf390('0x39')];if(!_0x41793b[_0xf390('0x33')][_0xf390('0x3a')](_0xf390('0x3b'))){_0x13d2dd[_0xf390('0x1e')]=qs[_0xf390('0x1e')](_0x41793b[_0xf390('0x33')]['limit']);_0x13d2dd[_0xf390('0x1c')]=qs[_0xf390('0x1c')](_0x41793b[_0xf390('0x33')][_0xf390('0x1c')]);}return _0x34c5f2[_0xf390('0x63')](_0x13d2dd);}})[_0xf390('0x24')](function(_0x2fffeb){if(_0x2fffeb){return _0x2fffeb?{'count':_0x31b01f,'rows':_0x2fffeb}:null;}})[_0xf390('0x24')](respondWithResult(_0x230cd1,null))[_0xf390('0x47')](handleError(_0x230cd1,null));};exports[_0xf390('0x65')]=function(_0x466634,_0x4bad67,_0x389d55){var _0xd305b4=_0x466634[_0xf390('0x56')][_0xf390('0x66')];return db[_0xf390('0x64')][_0xf390('0x59')]({'where':{'id':_0xd305b4},'attributes':['id'],'include':[{'model':db[_0xf390('0x5a')],'as':_0xf390('0x67'),'attributes':['id',_0xf390('0x29'),_0xf390('0x68'),_0xf390('0x69'),_0xf390('0x6a')],'raw':!![]}]})[_0xf390('0x24')](function(_0x5c94f4){if(_0x5c94f4){var _0x86dd33=_[_0xf390('0x6b')](_0x5c94f4,function(_0x2fd50e){var _0x268fab=_0x2fd50e[_0xf390('0x4d')]({'plain':!![]});return _0x268fab[_0xf390('0x67')];});return db[_0xf390('0x2d')][_0xf390('0x4a')]({'where':{'id':_0x466634[_0xf390('0x49')]['id']}})['then'](function(_0x1499d7){return db[_0xf390('0x6c')]['transaction'](function(_0x1529fc){return _0x1499d7[_0xf390('0x65')](_0xd305b4,{'transaction':_0x1529fc})[_0xf390('0x24')](function(){return BPromise['each'](_0x86dd33,function(_0x52986e){return db[_0xf390('0x6d')][_0xf390('0x6e')]({'where':{'UserId':_0x52986e['id'],'OpenchannelQueueId':_0x466634['params']['id']},'transaction':_0x1529fc});});})[_0xf390('0x24')](function(){_0x86dd33['forEach'](function(_0xc8c7f1){socket[_0xf390('0x6f')]('userOpenchannelQueue:save',{'UserId':_0xc8c7f1['id'],'OpenchannelQueueId':_0x1499d7['id']});});});});});}})[_0xf390('0x24')](respondWithStatusCode(_0x4bad67,null))[_0xf390('0x47')](handleError(_0x4bad67,null));};exports[_0xf390('0x70')]=function(_0x42554c,_0x363337,_0x358b21){return db[_0xf390('0x64')]['findAll']({'where':{'id':_0x42554c[_0xf390('0x33')][_0xf390('0x66')]},'attributes':['id'],'include':[{'model':db[_0xf390('0x5a')],'as':_0xf390('0x67'),'attributes':['id'],'raw':!![]}]})[_0xf390('0x24')](handleEntityNotFound(_0x363337,null))[_0xf390('0x24')](function(_0x57b500){var _0x1486ee=_[_0xf390('0x2c')](_0x57b500,'id');var _0x936f78=[];var _0x10ebe2=[];var _0x1d83d9=squel['select']();_0x1d83d9['field'](_0xf390('0x71'))[_0xf390('0x72')](_0xf390('0x73'),'tq')[_0xf390('0x74')]('user_has_teams','ut',_0xf390('0x75'))[_0xf390('0x3e')](_0xf390('0x76'),_0x42554c[_0xf390('0x49')]['id']);for(var _0x11ca3b=0x0;_0x11ca3b<_0x57b500['length'];_0x11ca3b+=0x1){let _0x6f9090=_0x57b500[_0x11ca3b];for(var _0x10427f=0x0;_0x10427f<_0x6f9090[_0xf390('0x67')][_0xf390('0x39')];_0x10427f+=0x1){let _0x3d4543=_0x6f9090[_0xf390('0x67')][_0x10427f];var _0x3ff318=_0x1d83d9[_0xf390('0x77')]();_0x3ff318['where']('ut.UserId\x20=\x20?',_0x3d4543['id']);_0x10ebe2[_0xf390('0x78')](db[_0xf390('0x6c')][_0xf390('0x33')](_0x3ff318[_0xf390('0x79')](),{'type':db['sequelize'][_0xf390('0x7a')]['SELECT']})[_0xf390('0x24')](function(_0x4a5c32){if(_0x4a5c32[_0xf390('0x39')]===0x1){return _0x3d4543['id'];}else{var _0x6e02ad=_[_0xf390('0x7b')](_[_0xf390('0x2c')](_0x4a5c32,_0xf390('0x7c')),function(_0x2e3e0d){return _['includes'](_0x1486ee,_0x2e3e0d);});if(_0x6e02ad){return _0x3d4543['id'];}}}));}}return BPromise[_0xf390('0x7d')](_0x10ebe2)[_0xf390('0x24')](function(_0x1be252){_0x936f78=_(_0x936f78)[_0xf390('0x7e')](_0x1be252)[_0xf390('0x7f')]()['value']();return db[_0xf390('0x2d')][_0xf390('0x4a')]({'where':{'id':_0x42554c[_0xf390('0x49')]['id']}})[_0xf390('0x24')](function(_0x5236b8){return db['sequelize'][_0xf390('0x80')](function(_0xc40c56){return _0x5236b8['removeTeams'](_0x42554c[_0xf390('0x33')]['ids'],{'transaction':_0xc40c56})[_0xf390('0x24')](function(){if(!_['isEmpty'](_0x936f78)){return _0x5236b8[_0xf390('0x81')](_0x936f78,{'transaction':_0xc40c56});}})['then'](function(){_0x936f78[_0xf390('0x82')](function(_0x14eeab){socket[_0xf390('0x6f')]('userOpenchannelQueue:remove',{'UserId':_0x14eeab,'OpenchannelQueueId':_0x5236b8['id']});});});});});});})[_0xf390('0x24')](respondWithStatusCode(_0x363337,null))['catch'](handleError(_0x363337,null));};exports[_0xf390('0x83')]=function(_0x3ee5a3,_0x2e8a39,_0x587913){return db[_0xf390('0x2d')][_0xf390('0x4a')]({'where':{'id':_0x3ee5a3[_0xf390('0x49')]['id']}})[_0xf390('0x24')](handleEntityNotFound(_0x2e8a39,null))[_0xf390('0x24')](function(_0x3cf51c){if(_0x3cf51c){return _0x3cf51c[_0xf390('0x83')](_0x3ee5a3[_0xf390('0x56')][_0xf390('0x66')],_['omit'](_0x3ee5a3[_0xf390('0x56')],['ids','id'])||{})['spread'](function(_0x4b42d8){for(var _0x359bd6=0x0;_0x359bd6<_0x3ee5a3[_0xf390('0x56')][_0xf390('0x66')]['length'];_0x359bd6+=0x1){socket['emit']('userOpenchannelQueue:save',{'UserId':Number(_0x3ee5a3[_0xf390('0x56')]['ids'][_0x359bd6]),'OpenchannelQueueId':Number(_0x3ee5a3[_0xf390('0x49')]['id'])});}return _0x4b42d8;});}})[_0xf390('0x24')](respondWithResult(_0x2e8a39,null))[_0xf390('0x47')](handleError(_0x2e8a39,null));};exports[_0xf390('0x81')]=function(_0xea710b,_0x81cd85,_0x4c438d){return db[_0xf390('0x2d')][_0xf390('0x4a')]({'where':{'id':_0xea710b[_0xf390('0x49')]['id']}})['then'](handleEntityNotFound(_0x81cd85,null))[_0xf390('0x24')](function(_0x452288){if(_0x452288){return _0x452288['removeAgents'](_0xea710b[_0xf390('0x33')][_0xf390('0x66')])['then'](function(){if(_['isArray'](_0xea710b['query']['ids'])){for(var _0x5b5f14=0x0;_0x5b5f14<_0xea710b[_0xf390('0x33')]['ids'][_0xf390('0x39')];_0x5b5f14+=0x1){socket[_0xf390('0x6f')](_0xf390('0x84'),{'UserId':Number(_0xea710b[_0xf390('0x33')]['ids'][_0x5b5f14]),'OpenchannelQueueId':Number(_0xea710b[_0xf390('0x49')]['id'])});}}else{socket[_0xf390('0x6f')](_0xf390('0x84'),{'UserId':Number(_0xea710b[_0xf390('0x33')][_0xf390('0x66')]),'OpenchannelQueueId':Number(_0xea710b[_0xf390('0x49')]['id'])});}});}})[_0xf390('0x24')](respondWithStatusCode(_0x81cd85,null))[_0xf390('0x47')](handleError(_0x81cd85,null));};exports[_0xf390('0x85')]=function(_0x2e7dc3,_0x381ca6,_0x49665a){var _0xb4a853={};var _0xb07971={};var _0x4c55c4;var _0x28f61f;return db['OpenchannelQueue'][_0xf390('0x58')]({'where':{'id':_0x2e7dc3['params']['id']}})[_0xf390('0x24')](handleEntityNotFound(_0x381ca6,null))[_0xf390('0x24')](function(_0x1fe564){if(_0x1fe564){_0x4c55c4=_0x1fe564;_0xb07971[_0xf390('0x32')]=_[_0xf390('0x34')](db['User'][_0xf390('0x2e')]);_0xb07971['query']=_[_0xf390('0x34')](_0x2e7dc3[_0xf390('0x33')]);_0xb07971['filters']=_['intersection'](_0xb07971[_0xf390('0x32')],_0xb07971[_0xf390('0x33')]);_0xb4a853[_0xf390('0x37')]=_[_0xf390('0x36')](_0xb07971[_0xf390('0x32')],qs['fields'](_0x2e7dc3[_0xf390('0x33')][_0xf390('0x38')]));_0xb4a853[_0xf390('0x37')]=_0xb4a853['attributes'][_0xf390('0x39')]?_0xb4a853[_0xf390('0x37')]:_0xb07971[_0xf390('0x32')];_0xb4a853['order']=qs['sort'](_0x2e7dc3[_0xf390('0x33')][_0xf390('0x3d')]);_0xb4a853[_0xf390('0x3e')]=qs[_0xf390('0x35')](_['pick'](_0x2e7dc3[_0xf390('0x33')],_0xb07971['filters']));if(_0x2e7dc3[_0xf390('0x33')][_0xf390('0x40')]){_0xb4a853[_0xf390('0x3e')]=_[_0xf390('0x41')](_0xb4a853[_0xf390('0x3e')],{'$or':_[_0xf390('0x2c')](_0xb4a853[_0xf390('0x37')],function(_0x1e2066){var _0x12c699={};_0x12c699[_0x1e2066]={'$like':'%'+_0x2e7dc3['query']['filter']+'%'};return _0x12c699;})});}_0xb4a853=_[_0xf390('0x41')]({},_0xb4a853,_0x2e7dc3[_0xf390('0x43')]);return _0x4c55c4['getAgents'](_0xb4a853);}})[_0xf390('0x24')](function(_0x54fb05){if(_0x54fb05){_0x28f61f=_0x54fb05[_0xf390('0x39')];if(!_0x2e7dc3[_0xf390('0x33')][_0xf390('0x3a')]('nolimit')){_0xb4a853['limit']=qs[_0xf390('0x1e')](_0x2e7dc3[_0xf390('0x33')][_0xf390('0x1e')]);_0xb4a853[_0xf390('0x1c')]=qs[_0xf390('0x1c')](_0x2e7dc3[_0xf390('0x33')][_0xf390('0x1c')]);}return _0x4c55c4[_0xf390('0x85')](_0xb4a853);}})[_0xf390('0x24')](function(_0x4601e8){if(_0x4601e8){return _0x4601e8?{'count':_0x28f61f,'rows':_0x4601e8}:null;}})['then'](respondWithResult(_0x381ca6,null))[_0xf390('0x47')](handleError(_0x381ca6,null));}; \ No newline at end of file +var _0x8106=['save','update','then','destroy','get','OpenchannelQueues','error','name','send','index','OpenchannelQueue','rawAttributes','fieldName','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','params','keys','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserOpenchannelQueue','nolimit','options','User','findAndCountAll','UserId','createdAt','format','openchannelPause','getTeams','addTeams','Team','Agents','voicePause','interface','sequelize','transaction','each','findOrCreate','emit','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','clone','ut.UserId\x20=\x20?','push','SELECT','every','TeamId','includes','all','union','value','ids','isEmpty','forEach','userOpenchannelQueue:remove','addAgents','omit','spread','removeAgents','getAgents','order','eml-format','rimraf','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../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','./openchannelQueue.socket','register','sendStatus','end','status','json','offset','limit','count','set','Content-Range','apply'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0x8106,0x16e));var _0x6810=function(_0x265359,_0x25d4ca){_0x265359=_0x265359-0x0;var _0x344bdc=_0x8106[_0x265359];return _0x344bdc;};'use strict';var emlformat=require(_0x6810('0x0'));var rimraf=require(_0x6810('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6810('0x2'));var Mustache=require(_0x6810('0x3'));var util=require('util');var path=require(_0x6810('0x4'));var sox=require(_0x6810('0x5'));var csv=require('to-csv');var ejs=require(_0x6810('0x6'));var fs=require('fs');var fs_extra=require(_0x6810('0x7'));var _=require(_0x6810('0x8'));var squel=require(_0x6810('0x9'));var crypto=require(_0x6810('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6810('0xb'));var Papa=require(_0x6810('0xc'));var Redis=require(_0x6810('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x6810('0xe'));var as=require(_0x6810('0xf'));var hardwareService=require(_0x6810('0x10'));var logger=require(_0x6810('0x11'))(_0x6810('0x12'));var utils=require(_0x6810('0x13'));var config=require(_0x6810('0x14'));var licenseUtil=require(_0x6810('0x15'));var db=require(_0x6810('0x16'))['db'];config[_0x6810('0x17')]=_[_0x6810('0x18')](config[_0x6810('0x17')],{'host':_0x6810('0x19'),'port':0x18eb});var socket=require(_0x6810('0x1a'))(new Redis(config[_0x6810('0x17')]));require(_0x6810('0x1b'))[_0x6810('0x1c')](socket);function respondWithStatusCode(_0x30888a,_0x280a7a){_0x280a7a=_0x280a7a||0xcc;return function(_0x598a0d){if(_0x598a0d){return _0x30888a[_0x6810('0x1d')](_0x280a7a);}return _0x30888a['status'](_0x280a7a)[_0x6810('0x1e')]();};}function respondWithResult(_0x3dca45,_0x2fc076){_0x2fc076=_0x2fc076||0xc8;return function(_0x3f0a25){if(_0x3f0a25){return _0x3dca45[_0x6810('0x1f')](_0x2fc076)[_0x6810('0x20')](_0x3f0a25);}};}function respondWithFilteredResult(_0x4ad408,_0x122406){return function(_0x2fb462){if(_0x2fb462){var _0x5ed6f6=typeof _0x122406[_0x6810('0x21')]==='undefined'&&typeof _0x122406[_0x6810('0x22')]==='undefined';var _0x322d3e=_0x2fb462[_0x6810('0x23')];var _0x40483a=_0x5ed6f6?0x0:_0x122406[_0x6810('0x21')];var _0x3483a6=_0x5ed6f6?_0x2fb462[_0x6810('0x23')]:_0x122406[_0x6810('0x21')]+_0x122406[_0x6810('0x22')];var _0x27f504;if(_0x3483a6>=_0x322d3e){_0x3483a6=_0x322d3e;_0x27f504=0xc8;}else{_0x27f504=0xce;}_0x4ad408[_0x6810('0x1f')](_0x27f504);return _0x4ad408[_0x6810('0x24')](_0x6810('0x25'),_0x40483a+'-'+_0x3483a6+'/'+_0x322d3e)['json'](_0x2fb462);}return null;};}function patchUpdates(_0x6ec493){return function(_0x347d7c){try{jsonpatch[_0x6810('0x26')](_0x347d7c,_0x6ec493,!![]);}catch(_0x5bba27){return BPromise['reject'](_0x5bba27);}return _0x347d7c[_0x6810('0x27')]();};}function saveUpdates(_0x145b0d,_0x1af0e3){return function(_0x4c5877){if(_0x4c5877){return _0x4c5877[_0x6810('0x28')](_0x145b0d)[_0x6810('0x29')](function(_0x24f844){return _0x24f844;});}return null;};}function removeEntity(_0x2d76c7,_0x4984bb){return function(_0x3d45b7){if(_0x3d45b7){return _0x3d45b7[_0x6810('0x2a')]()[_0x6810('0x29')](function(){var _0x4a4384=_0x3d45b7[_0x6810('0x2b')]({'plain':!![]});var _0x46580c=_0x6810('0x2c');return db['UserProfileResource'][_0x6810('0x2a')]({'where':{'type':_0x46580c,'resourceId':_0x4a4384['id']}})[_0x6810('0x29')](function(){return _0x3d45b7;});})['then'](function(){_0x2d76c7['status'](0xcc)[_0x6810('0x1e')]();});}};}function handleEntityNotFound(_0x508a6c,_0x203181){return function(_0x38c3a7){if(!_0x38c3a7){_0x508a6c[_0x6810('0x1d')](0x194);}return _0x38c3a7;};}function handleError(_0x3a14b6,_0x4f5968){_0x4f5968=_0x4f5968||0x1f4;return function(_0x242bb4){logger[_0x6810('0x2d')](_0x242bb4['stack']);if(_0x242bb4[_0x6810('0x2e')]){delete _0x242bb4[_0x6810('0x2e')];}_0x3a14b6[_0x6810('0x1f')](_0x4f5968)[_0x6810('0x2f')](_0x242bb4);};}exports[_0x6810('0x30')]=function(_0x4b8622,_0xb5fc44){var _0x43e102={},_0x448878={},_0x4b44a2={'count':0x0,'rows':[]};var _0x5dacc8=_['map'](db[_0x6810('0x31')][_0x6810('0x32')],function(_0x283ecf){return{'name':_0x283ecf[_0x6810('0x33')],'type':_0x283ecf['type'][_0x6810('0x34')]};});_0x448878[_0x6810('0x35')]=_[_0x6810('0x36')](_0x5dacc8,_0x6810('0x2e'));_0x448878[_0x6810('0x37')]=_['keys'](_0x4b8622[_0x6810('0x37')]);_0x448878[_0x6810('0x38')]=_[_0x6810('0x39')](_0x448878['model'],_0x448878[_0x6810('0x37')]);_0x43e102['attributes']=_['intersection'](_0x448878[_0x6810('0x35')],qs[_0x6810('0x3a')](_0x4b8622[_0x6810('0x37')][_0x6810('0x3a')]));_0x43e102[_0x6810('0x3b')]=_0x43e102[_0x6810('0x3b')][_0x6810('0x3c')]?_0x43e102[_0x6810('0x3b')]:_0x448878[_0x6810('0x35')];if(!_0x4b8622[_0x6810('0x37')][_0x6810('0x3d')]('nolimit')){_0x43e102[_0x6810('0x22')]=qs['limit'](_0x4b8622[_0x6810('0x37')][_0x6810('0x22')]);_0x43e102[_0x6810('0x21')]=qs[_0x6810('0x21')](_0x4b8622['query'][_0x6810('0x21')]);}_0x43e102['order']=qs[_0x6810('0x3e')](_0x4b8622['query'][_0x6810('0x3e')]);_0x43e102[_0x6810('0x3f')]=qs['filters'](_[_0x6810('0x40')](_0x4b8622[_0x6810('0x37')],_0x448878[_0x6810('0x38')]),_0x5dacc8);if(_0x4b8622[_0x6810('0x37')][_0x6810('0x41')]){_0x43e102[_0x6810('0x3f')]=_[_0x6810('0x42')](_0x43e102[_0x6810('0x3f')],{'$or':_[_0x6810('0x36')](_0x5dacc8,function(_0x30c29c){if(_0x30c29c[_0x6810('0x43')]!==_0x6810('0x44')){var _0x43f129={};_0x43f129[_0x30c29c['name']]={'$like':'%'+_0x4b8622[_0x6810('0x37')][_0x6810('0x41')]+'%'};return _0x43f129;}})});}_0x43e102=_[_0x6810('0x42')]({},_0x43e102,_0x4b8622['options']);var _0x4dbd33={'where':_0x43e102[_0x6810('0x3f')]};return db['OpenchannelQueue'][_0x6810('0x23')](_0x4dbd33)[_0x6810('0x29')](function(_0x57e825){_0x4b44a2[_0x6810('0x23')]=_0x57e825;if(_0x4b8622['query'][_0x6810('0x45')]){_0x43e102[_0x6810('0x46')]=[{'all':!![]}];}return db[_0x6810('0x31')][_0x6810('0x47')](_0x43e102);})[_0x6810('0x29')](function(_0x1a02fa){_0x4b44a2[_0x6810('0x48')]=_0x1a02fa;return _0x4b44a2;})[_0x6810('0x29')](respondWithFilteredResult(_0xb5fc44,_0x43e102))[_0x6810('0x49')](handleError(_0xb5fc44,null));};exports['show']=function(_0x4f6086,_0x44301b){var _0x7ca083={'raw':!![],'where':{'id':_0x4f6086[_0x6810('0x4a')]['id']}},_0xd2e500={};_0xd2e500[_0x6810('0x35')]=_[_0x6810('0x4b')](db[_0x6810('0x31')]['rawAttributes']);_0xd2e500[_0x6810('0x37')]=_[_0x6810('0x4b')](_0x4f6086[_0x6810('0x37')]);_0xd2e500[_0x6810('0x38')]=_[_0x6810('0x39')](_0xd2e500['model'],_0xd2e500[_0x6810('0x37')]);_0x7ca083[_0x6810('0x3b')]=_[_0x6810('0x39')](_0xd2e500[_0x6810('0x35')],qs[_0x6810('0x3a')](_0x4f6086[_0x6810('0x37')][_0x6810('0x3a')]));_0x7ca083['attributes']=_0x7ca083[_0x6810('0x3b')][_0x6810('0x3c')]?_0x7ca083[_0x6810('0x3b')]:_0xd2e500['model'];if(_0x4f6086['query'][_0x6810('0x45')]){_0x7ca083['include']=[{'all':!![]}];}_0x7ca083=_[_0x6810('0x42')]({},_0x7ca083,_0x4f6086['options']);return db[_0x6810('0x31')][_0x6810('0x4c')](_0x7ca083)['then'](handleEntityNotFound(_0x44301b,null))[_0x6810('0x29')](respondWithResult(_0x44301b,null))['catch'](handleError(_0x44301b,null));};exports[_0x6810('0x4d')]=function(_0x349819,_0x217fc1){return db[_0x6810('0x31')][_0x6810('0x4d')](_0x349819['body'],{})['then'](function(_0x4312db){var _0x34f7c3=_0x349819['user'][_0x6810('0x2b')]({'plain':!![]});if(!_0x34f7c3)throw new Error(_0x6810('0x4e'));if(_0x34f7c3['role']===_0x6810('0x4f')){var _0x45303d=_0x4312db[_0x6810('0x2b')]({'plain':!![]});var _0x4b01a6='OpenchannelQueues';return db['UserProfileSection'][_0x6810('0x4c')]({'where':{'name':_0x4b01a6,'userProfileId':_0x34f7c3[_0x6810('0x50')]},'raw':!![]})['then'](function(_0x444e5b){if(_0x444e5b&&_0x444e5b['autoAssociation']===0x0){return db['UserProfileResource'][_0x6810('0x4d')]({'name':_0x45303d[_0x6810('0x2e')],'resourceId':_0x45303d['id'],'type':_0x444e5b['name'],'sectionId':_0x444e5b['id']},{})[_0x6810('0x29')](function(){return _0x4312db;});}else{return _0x4312db;}})[_0x6810('0x49')](function(_0x537778){logger[_0x6810('0x2d')](_0x6810('0x51'),_0x537778);throw _0x537778;});}return _0x4312db;})['then'](respondWithResult(_0x217fc1,0xc9))[_0x6810('0x49')](handleError(_0x217fc1,null));};exports[_0x6810('0x28')]=function(_0x5057f9,_0x812dcc){if(_0x5057f9['body']['id']){delete _0x5057f9[_0x6810('0x52')]['id'];}return db[_0x6810('0x31')][_0x6810('0x4c')]({'where':{'id':_0x5057f9[_0x6810('0x4a')]['id']}})['then'](handleEntityNotFound(_0x812dcc,null))[_0x6810('0x29')](saveUpdates(_0x5057f9[_0x6810('0x52')],null))[_0x6810('0x29')](respondWithResult(_0x812dcc,null))[_0x6810('0x49')](handleError(_0x812dcc,null));};exports['destroy']=function(_0x5c18f0,_0x47fd26){return db['OpenchannelQueue']['find']({'where':{'id':_0x5c18f0['params']['id']}})[_0x6810('0x29')](handleEntityNotFound(_0x47fd26,null))[_0x6810('0x29')](removeEntity(_0x47fd26,null))['catch'](handleError(_0x47fd26,null));};exports['describe']=function(_0x494cfa,_0x26ec7d){return db[_0x6810('0x31')][_0x6810('0x53')]()[_0x6810('0x29')](respondWithResult(_0x26ec7d,null))[_0x6810('0x49')](handleError(_0x26ec7d,null));};exports[_0x6810('0x54')]=function(_0x46e21b,_0x4f409c,_0x3fd324){var _0x4a2564={'raw':!![],'where':{}},_0x1ad005={},_0x307dbf;return db[_0x6810('0x31')][_0x6810('0x55')]({'where':{'id':_0x46e21b[_0x6810('0x4a')]['id']}})[_0x6810('0x29')](handleEntityNotFound(_0x4f409c,null))['then'](function(_0x31fa9f){if(_0x31fa9f){_0x307dbf=_0x31fa9f[_0x6810('0x2b')]({'plain':!![]});_0x1ad005['model']=_[_0x6810('0x4b')](db[_0x6810('0x56')]['rawAttributes']);_0x1ad005[_0x6810('0x37')]=_[_0x6810('0x4b')](_0x46e21b[_0x6810('0x37')]);_0x1ad005['filters']=_['intersection'](_0x1ad005['model'],_0x1ad005[_0x6810('0x37')]);_0x4a2564[_0x6810('0x3b')]=_[_0x6810('0x39')](_0x1ad005[_0x6810('0x35')],qs[_0x6810('0x3a')](_0x46e21b['query'][_0x6810('0x3a')]));_0x4a2564[_0x6810('0x3b')]=_0x4a2564['attributes'][_0x6810('0x3c')]?_0x4a2564[_0x6810('0x3b')]:_0x1ad005[_0x6810('0x35')];if(!_0x46e21b['query']['hasOwnProperty'](_0x6810('0x57'))){_0x4a2564['limit']=qs['limit'](_0x46e21b['query'][_0x6810('0x22')]);_0x4a2564[_0x6810('0x21')]=qs[_0x6810('0x21')](_0x46e21b[_0x6810('0x37')][_0x6810('0x21')]);}_0x4a2564['order']=qs[_0x6810('0x3e')](_0x46e21b[_0x6810('0x37')][_0x6810('0x3e')]);_0x4a2564[_0x6810('0x3f')]=qs['filters'](_['pick'](_0x46e21b[_0x6810('0x37')],_0x1ad005['filters']));_0x4a2564['where']['OpenchannelQueueId']=_0x31fa9f['id'];if(_0x46e21b['query']['filter']){_0x4a2564['where']=_[_0x6810('0x42')](_0x4a2564[_0x6810('0x3f')],{'$or':_['map'](_0x4a2564[_0x6810('0x3b')],function(_0x3b258a){var _0x144485={};_0x144485[_0x3b258a]={'$like':'%'+_0x46e21b[_0x6810('0x37')][_0x6810('0x41')]+'%'};return _0x144485;})});}_0x4a2564=_[_0x6810('0x42')]({},_0x4a2564,_0x46e21b[_0x6810('0x58')]);return db[_0x6810('0x56')][_0x6810('0x47')](_0x4a2564);}})[_0x6810('0x29')](function(_0x31a51c){if(_0x31a51c){return db[_0x6810('0x59')][_0x6810('0x5a')]({'where':{'id':_[_0x6810('0x36')](_0x31a51c,_0x6810('0x5b')),'role':'agent'},'attributes':['id',_0x6810('0x2e'),'openchannelPause','updatedAt',_0x6810('0x5c')]});}})[_0x6810('0x29')](function(_0x38fa68){if(_0x38fa68){return{'count':_0x38fa68[_0x6810('0x23')],'rows':_[_0x6810('0x36')](_0x38fa68[_0x6810('0x48')],function(_0x2ff6d8){return{'membername':_0x2ff6d8[_0x6810('0x2e')],'UserId':_0x2ff6d8['id'],'queue_name':_0x307dbf[_0x6810('0x2e')],'OpenchannelQueueId':_0x307dbf['id'],'interface':util[_0x6810('0x5d')]('%s/%s','SIP',_0x2ff6d8[_0x6810('0x2e')]),'penalty':0x0,'paused':_0x2ff6d8[_0x6810('0x5e')],'createdAt':_0x2ff6d8[_0x6810('0x5c')],'updatedAt':_0x2ff6d8['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x4f409c,_0x4a2564))[_0x6810('0x49')](handleError(_0x4f409c,null));};exports[_0x6810('0x5f')]=function(_0x50e115,_0x3de3ea,_0x295181){var _0x279b39={};var _0x469b63={};var _0x1fe82e;var _0x16a152;return db[_0x6810('0x31')]['findOne']({'where':{'id':_0x50e115[_0x6810('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3de3ea,null))[_0x6810('0x29')](function(_0x5cc9c1){if(_0x5cc9c1){_0x1fe82e=_0x5cc9c1;_0x469b63[_0x6810('0x35')]=_['keys'](db['Team'][_0x6810('0x32')]);_0x469b63[_0x6810('0x37')]=_['keys'](_0x50e115[_0x6810('0x37')]);_0x469b63[_0x6810('0x38')]=_[_0x6810('0x39')](_0x469b63['model'],_0x469b63['query']);_0x279b39[_0x6810('0x3b')]=_[_0x6810('0x39')](_0x469b63[_0x6810('0x35')],qs[_0x6810('0x3a')](_0x50e115[_0x6810('0x37')][_0x6810('0x3a')]));_0x279b39[_0x6810('0x3b')]=_0x279b39['attributes'][_0x6810('0x3c')]?_0x279b39[_0x6810('0x3b')]:_0x469b63[_0x6810('0x35')];_0x279b39['order']=qs[_0x6810('0x3e')](_0x50e115['query'][_0x6810('0x3e')]);_0x279b39[_0x6810('0x3f')]=qs['filters'](_[_0x6810('0x40')](_0x50e115[_0x6810('0x37')],_0x469b63[_0x6810('0x38')]));if(_0x50e115[_0x6810('0x37')][_0x6810('0x41')]){_0x279b39[_0x6810('0x3f')]=_[_0x6810('0x42')](_0x279b39[_0x6810('0x3f')],{'$or':_['map'](_0x279b39[_0x6810('0x3b')],function(_0xebc405){var _0x3f4ab5={};_0x3f4ab5[_0xebc405]={'$like':'%'+_0x50e115[_0x6810('0x37')]['filter']+'%'};return _0x3f4ab5;})});}_0x279b39=_['merge']({},_0x279b39,_0x50e115[_0x6810('0x58')]);return _0x1fe82e['getTeams'](_0x279b39);}})[_0x6810('0x29')](function(_0x3172ed){if(_0x3172ed){_0x16a152=_0x3172ed[_0x6810('0x3c')];if(!_0x50e115[_0x6810('0x37')][_0x6810('0x3d')](_0x6810('0x57'))){_0x279b39[_0x6810('0x22')]=qs[_0x6810('0x22')](_0x50e115[_0x6810('0x37')]['limit']);_0x279b39[_0x6810('0x21')]=qs['offset'](_0x50e115[_0x6810('0x37')][_0x6810('0x21')]);}return _0x1fe82e[_0x6810('0x5f')](_0x279b39);}})[_0x6810('0x29')](function(_0x24803b){if(_0x24803b){return _0x24803b?{'count':_0x16a152,'rows':_0x24803b}:null;}})[_0x6810('0x29')](respondWithResult(_0x3de3ea,null))[_0x6810('0x49')](handleError(_0x3de3ea,null));};exports[_0x6810('0x60')]=function(_0x5bfe2b,_0x8af11c,_0x36ecd8){var _0x1a61e7=_0x5bfe2b['body']['ids'];return db[_0x6810('0x61')]['findAll']({'where':{'id':_0x1a61e7},'attributes':['id'],'include':[{'model':db[_0x6810('0x59')],'as':_0x6810('0x62'),'attributes':['id',_0x6810('0x2e'),'online',_0x6810('0x63'),_0x6810('0x64')],'raw':!![]}]})['then'](function(_0x272973){if(_0x272973){var _0x4a674f=_['flatMap'](_0x272973,function(_0x4295d9){var _0x4ee326=_0x4295d9['get']({'plain':!![]});return _0x4ee326[_0x6810('0x62')];});return db['OpenchannelQueue'][_0x6810('0x4c')]({'where':{'id':_0x5bfe2b[_0x6810('0x4a')]['id']}})['then'](function(_0x488204){return db[_0x6810('0x65')][_0x6810('0x66')](function(_0x5f2a87){return _0x488204[_0x6810('0x60')](_0x1a61e7,{'transaction':_0x5f2a87})['then'](function(){return BPromise[_0x6810('0x67')](_0x4a674f,function(_0x61363b){return db['UserOpenchannelQueue'][_0x6810('0x68')]({'where':{'UserId':_0x61363b['id'],'OpenchannelQueueId':_0x5bfe2b[_0x6810('0x4a')]['id']},'transaction':_0x5f2a87});});})['then'](function(){_0x4a674f['forEach'](function(_0x3790b6){socket[_0x6810('0x69')](_0x6810('0x6a'),{'UserId':_0x3790b6['id'],'OpenchannelQueueId':_0x488204['id']});});});});});}})[_0x6810('0x29')](respondWithStatusCode(_0x8af11c,null))[_0x6810('0x49')](handleError(_0x8af11c,null));};exports[_0x6810('0x6b')]=function(_0x13674a,_0x989b9b,_0x3f87f9){return db[_0x6810('0x61')][_0x6810('0x47')]({'where':{'id':_0x13674a[_0x6810('0x37')]['ids']},'attributes':['id'],'include':[{'model':db[_0x6810('0x59')],'as':_0x6810('0x62'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x989b9b,null))[_0x6810('0x29')](function(_0x4b922e){var _0x4b8088=_['map'](_0x4b922e,'id');var _0x3aefbd=[];var _0x56472d=[];var _0x23d21e=squel[_0x6810('0x6c')]();_0x23d21e[_0x6810('0x6d')](_0x6810('0x6e'))[_0x6810('0x6f')](_0x6810('0x70'),'tq')[_0x6810('0x71')](_0x6810('0x72'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x6810('0x3f')]('OpenchannelQueueId\x20=\x20?',_0x13674a[_0x6810('0x4a')]['id']);for(var _0x105fe3=0x0;_0x105fe3<_0x4b922e['length'];_0x105fe3+=0x1){let _0x5519ac=_0x4b922e[_0x105fe3];for(var _0xf5b0a7=0x0;_0xf5b0a7<_0x5519ac[_0x6810('0x62')][_0x6810('0x3c')];_0xf5b0a7+=0x1){let _0x48874e=_0x5519ac[_0x6810('0x62')][_0xf5b0a7];var _0x3d18da=_0x23d21e[_0x6810('0x73')]();_0x3d18da[_0x6810('0x3f')](_0x6810('0x74'),_0x48874e['id']);_0x56472d[_0x6810('0x75')](db['sequelize'][_0x6810('0x37')](_0x3d18da['toString'](),{'type':db[_0x6810('0x65')]['QueryTypes'][_0x6810('0x76')]})[_0x6810('0x29')](function(_0x495e3a){if(_0x495e3a[_0x6810('0x3c')]===0x1){return _0x48874e['id'];}else{var _0x5b425b=_[_0x6810('0x77')](_['map'](_0x495e3a,_0x6810('0x78')),function(_0x5f1fd6){return _[_0x6810('0x79')](_0x4b8088,_0x5f1fd6);});if(_0x5b425b){return _0x48874e['id'];}}}));}}return BPromise[_0x6810('0x7a')](_0x56472d)[_0x6810('0x29')](function(_0x2884d){_0x3aefbd=_(_0x3aefbd)[_0x6810('0x7b')](_0x2884d)['compact']()[_0x6810('0x7c')]();return db[_0x6810('0x31')][_0x6810('0x4c')]({'where':{'id':_0x13674a['params']['id']}})['then'](function(_0xda6478){return db['sequelize']['transaction'](function(_0x4ab7ac){return _0xda6478[_0x6810('0x6b')](_0x13674a['query'][_0x6810('0x7d')],{'transaction':_0x4ab7ac})[_0x6810('0x29')](function(){if(!_[_0x6810('0x7e')](_0x3aefbd)){return _0xda6478['removeAgents'](_0x3aefbd,{'transaction':_0x4ab7ac});}})[_0x6810('0x29')](function(){_0x3aefbd[_0x6810('0x7f')](function(_0x48453a){socket[_0x6810('0x69')](_0x6810('0x80'),{'UserId':_0x48453a,'OpenchannelQueueId':_0xda6478['id']});});});});});});})[_0x6810('0x29')](respondWithStatusCode(_0x989b9b,null))[_0x6810('0x49')](handleError(_0x989b9b,null));};exports['addAgents']=function(_0x4b6418,_0x10b7dd,_0x2afe1b){return db[_0x6810('0x31')][_0x6810('0x4c')]({'where':{'id':_0x4b6418[_0x6810('0x4a')]['id']}})[_0x6810('0x29')](handleEntityNotFound(_0x10b7dd,null))[_0x6810('0x29')](function(_0x50fc17){if(_0x50fc17){return _0x50fc17[_0x6810('0x81')](_0x4b6418[_0x6810('0x52')][_0x6810('0x7d')],_[_0x6810('0x82')](_0x4b6418[_0x6810('0x52')],[_0x6810('0x7d'),'id'])||{})[_0x6810('0x83')](function(_0x35138c){for(var _0x52dd72=0x0;_0x52dd72<_0x4b6418[_0x6810('0x52')][_0x6810('0x7d')]['length'];_0x52dd72+=0x1){socket[_0x6810('0x69')](_0x6810('0x6a'),{'UserId':Number(_0x4b6418['body'][_0x6810('0x7d')][_0x52dd72]),'OpenchannelQueueId':Number(_0x4b6418['params']['id'])});}return _0x35138c;});}})[_0x6810('0x29')](respondWithResult(_0x10b7dd,null))[_0x6810('0x49')](handleError(_0x10b7dd,null));};exports[_0x6810('0x84')]=function(_0x4464f1,_0x206284,_0x44160d){return db[_0x6810('0x31')][_0x6810('0x4c')]({'where':{'id':_0x4464f1[_0x6810('0x4a')]['id']}})[_0x6810('0x29')](handleEntityNotFound(_0x206284,null))[_0x6810('0x29')](function(_0x18aa81){if(_0x18aa81){return _0x18aa81['removeAgents'](_0x4464f1[_0x6810('0x37')]['ids'])[_0x6810('0x29')](function(){if(_['isArray'](_0x4464f1[_0x6810('0x37')][_0x6810('0x7d')])){for(var _0x1e0bc3=0x0;_0x1e0bc3<_0x4464f1[_0x6810('0x37')][_0x6810('0x7d')][_0x6810('0x3c')];_0x1e0bc3+=0x1){socket[_0x6810('0x69')](_0x6810('0x80'),{'UserId':Number(_0x4464f1['query'][_0x6810('0x7d')][_0x1e0bc3]),'OpenchannelQueueId':Number(_0x4464f1[_0x6810('0x4a')]['id'])});}}else{socket[_0x6810('0x69')](_0x6810('0x80'),{'UserId':Number(_0x4464f1['query']['ids']),'OpenchannelQueueId':Number(_0x4464f1[_0x6810('0x4a')]['id'])});}});}})[_0x6810('0x29')](respondWithStatusCode(_0x206284,null))[_0x6810('0x49')](handleError(_0x206284,null));};exports[_0x6810('0x85')]=function(_0x138c8a,_0x4a1e5e,_0x39b6fa){var _0x1a64d3={};var _0x2faee7={};var _0x3c07a9;var _0x9ccae9;return db['OpenchannelQueue'][_0x6810('0x55')]({'where':{'id':_0x138c8a['params']['id']}})[_0x6810('0x29')](handleEntityNotFound(_0x4a1e5e,null))[_0x6810('0x29')](function(_0x4caeb5){if(_0x4caeb5){_0x3c07a9=_0x4caeb5;_0x2faee7[_0x6810('0x35')]=_[_0x6810('0x4b')](db[_0x6810('0x59')]['rawAttributes']);_0x2faee7['query']=_['keys'](_0x138c8a['query']);_0x2faee7[_0x6810('0x38')]=_[_0x6810('0x39')](_0x2faee7[_0x6810('0x35')],_0x2faee7[_0x6810('0x37')]);_0x1a64d3[_0x6810('0x3b')]=_[_0x6810('0x39')](_0x2faee7[_0x6810('0x35')],qs[_0x6810('0x3a')](_0x138c8a['query'][_0x6810('0x3a')]));_0x1a64d3['attributes']=_0x1a64d3[_0x6810('0x3b')][_0x6810('0x3c')]?_0x1a64d3[_0x6810('0x3b')]:_0x2faee7[_0x6810('0x35')];_0x1a64d3[_0x6810('0x86')]=qs['sort'](_0x138c8a['query'][_0x6810('0x3e')]);_0x1a64d3[_0x6810('0x3f')]=qs[_0x6810('0x38')](_[_0x6810('0x40')](_0x138c8a[_0x6810('0x37')],_0x2faee7['filters']));if(_0x138c8a[_0x6810('0x37')][_0x6810('0x41')]){_0x1a64d3[_0x6810('0x3f')]=_[_0x6810('0x42')](_0x1a64d3['where'],{'$or':_['map'](_0x1a64d3[_0x6810('0x3b')],function(_0x4db962){var _0x35c6e6={};_0x35c6e6[_0x4db962]={'$like':'%'+_0x138c8a[_0x6810('0x37')][_0x6810('0x41')]+'%'};return _0x35c6e6;})});}_0x1a64d3=_[_0x6810('0x42')]({},_0x1a64d3,_0x138c8a[_0x6810('0x58')]);return _0x3c07a9[_0x6810('0x85')](_0x1a64d3);}})[_0x6810('0x29')](function(_0x10380d){if(_0x10380d){_0x9ccae9=_0x10380d[_0x6810('0x3c')];if(!_0x138c8a[_0x6810('0x37')][_0x6810('0x3d')](_0x6810('0x57'))){_0x1a64d3[_0x6810('0x22')]=qs['limit'](_0x138c8a['query']['limit']);_0x1a64d3['offset']=qs[_0x6810('0x21')](_0x138c8a[_0x6810('0x37')][_0x6810('0x21')]);}return _0x3c07a9['getAgents'](_0x1a64d3);}})[_0x6810('0x29')](function(_0x5bf8d3){if(_0x5bf8d3){return _0x5bf8d3?{'count':_0x9ccae9,'rows':_0x5bf8d3}:null;}})[_0x6810('0x29')](respondWithResult(_0x4a1e5e,null))['catch'](handleError(_0x4a1e5e,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index c45c59a..97a150b 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 _0x02e0=['events','../../mysqldb','OpenchannelQueue','setMaxListeners','save','update','emit','exports'];(function(_0x2bd0be,_0xf63d47){var _0x3e8e85=function(_0xdc0fbc){while(--_0xdc0fbc){_0x2bd0be['push'](_0x2bd0be['shift']());}};_0x3e8e85(++_0xf63d47);}(_0x02e0,0x188));var _0x002e=function(_0x51f962,_0x4b55cc){_0x51f962=_0x51f962-0x0;var _0x224731=_0x02e0[_0x51f962];return _0x224731;};'use strict';var EventEmitter=require(_0x002e('0x0'));var OpenchannelQueue=require(_0x002e('0x1'))['db'][_0x002e('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x002e('0x3')](0x0);var events={'afterCreate':_0x002e('0x4'),'afterUpdate':_0x002e('0x5'),'afterDestroy':'remove'};function emitEvent(_0x35c45b){return function(_0x31ce8b,_0x16f50e,_0x317860){OpenchannelQueueEvents[_0x002e('0x6')](_0x35c45b+':'+_0x31ce8b['id'],_0x31ce8b);OpenchannelQueueEvents[_0x002e('0x6')](_0x35c45b,_0x31ce8b);_0x317860(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0x002e('0x7')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x6850=['../../mysqldb','OpenchannelQueue','setMaxListeners','save','update','remove','emit','exports','events'];(function(_0x207269,_0x382131){var _0x161832=function(_0x11454d){while(--_0x11454d){_0x207269['push'](_0x207269['shift']());}};_0x161832(++_0x382131);}(_0x6850,0x1a6));var _0x0685=function(_0x1104a5,_0x115653){_0x1104a5=_0x1104a5-0x0;var _0x3b6e74=_0x6850[_0x1104a5];return _0x3b6e74;};'use strict';var EventEmitter=require(_0x0685('0x0'));var OpenchannelQueue=require(_0x0685('0x1'))['db'][_0x0685('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x0685('0x3')](0x0);var events={'afterCreate':_0x0685('0x4'),'afterUpdate':_0x0685('0x5'),'afterDestroy':_0x0685('0x6')};function emitEvent(_0x3573f1){return function(_0x10f217,_0x515cc4,_0x4aaa8e){OpenchannelQueueEvents['emit'](_0x3573f1+':'+_0x10f217['id'],_0x10f217);OpenchannelQueueEvents[_0x0685('0x7')](_0x3573f1,_0x10f217);_0x4aaa8e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0x0685('0x8')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index ebc6f27..a949760 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 _0x48c7=['openchannel_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./openchannelQueue.attributes','exports','define','OpenchannelQueue'];(function(_0x5d49b6,_0x1a5669){var _0x10058e=function(_0x16a76e){while(--_0x16a76e){_0x5d49b6['push'](_0x5d49b6['shift']());}};_0x10058e(++_0x1a5669);}(_0x48c7,0x160));var _0x748c=function(_0x2a5c01,_0x1d4a70){_0x2a5c01=_0x2a5c01-0x0;var _0xa07bf0=_0x48c7[_0x2a5c01];return _0xa07bf0;};'use strict';var _=require(_0x748c('0x0'));var util=require(_0x748c('0x1'));var logger=require(_0x748c('0x2'))(_0x748c('0x3'));var moment=require('moment');var BPromise=require(_0x748c('0x4'));var rp=require(_0x748c('0x5'));var fs=require('fs');var path=require(_0x748c('0x6'));var rimraf=require(_0x748c('0x7'));var config=require('../../config/environment');var attributes=require(_0x748c('0x8'));module[_0x748c('0x9')]=function(_0x26f056,_0x1969c9){return _0x26f056[_0x748c('0xa')](_0x748c('0xb'),attributes,{'tableName':_0x748c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc2f2=['rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x44671c,_0x571fad){var _0x17b588=function(_0x27fb57){while(--_0x27fb57){_0x44671c['push'](_0x44671c['shift']());}};_0x17b588(++_0x571fad);}(_0xc2f2,0x1a6));var _0x2c2f=function(_0x83af7f,_0x49c6fd){_0x83af7f=_0x83af7f-0x0;var _0x32d85c=_0xc2f2[_0x83af7f];return _0x32d85c;};'use strict';var _=require(_0x2c2f('0x0'));var util=require('util');var logger=require(_0x2c2f('0x1'))(_0x2c2f('0x2'));var moment=require(_0x2c2f('0x3'));var BPromise=require(_0x2c2f('0x4'));var rp=require(_0x2c2f('0x5'));var fs=require('fs');var path=require(_0x2c2f('0x6'));var rimraf=require(_0x2c2f('0x7'));var config=require(_0x2c2f('0x8'));var attributes=require(_0x2c2f('0x9'));module[_0x2c2f('0xa')]=function(_0x20c849,_0xb7f265){return _0x20c849[_0x2c2f('0xb')](_0x2c2f('0xc'),attributes,{'tableName':'openchannel_queues','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 352ee66..99d2b46 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 _0x8716=['info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','findAll','raw','where','options','attributes','limit','include','map','model','GetOpenchannelQueue','stringify','find','ShowOpenchannelQueue','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./openchannelQueue.socket','register','request','then'];(function(_0x444e8b,_0x5a4e93){var _0x28d7ae=function(_0xed7e32){while(--_0xed7e32){_0x444e8b['push'](_0x444e8b['shift']());}};_0x28d7ae(++_0x5a4e93);}(_0x8716,0xb7));var _0x6871=function(_0x423894,_0x3f6c3c){_0x423894=_0x423894-0x0;var _0x829415=_0x8716[_0x423894];return _0x829415;};'use strict';var _=require(_0x6871('0x0'));var util=require(_0x6871('0x1'));var moment=require('moment');var BPromise=require(_0x6871('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6871('0x3'))['db'];var utils=require(_0x6871('0x4'));var logger=require(_0x6871('0x5'))(_0x6871('0x6'));var config=require(_0x6871('0x7'));var jayson=require(_0x6871('0x8'));var client=jayson[_0x6871('0x9')][_0x6871('0xa')]({'port':0x232a});config[_0x6871('0xb')]=_['defaults'](config[_0x6871('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x6871('0xc'))(new Redis(config[_0x6871('0xb')]));require(_0x6871('0xd'))[_0x6871('0xe')](socket);function respondWithRpcPromise(_0x325e86,_0x264e0b,_0x15b408){return new BPromise(function(_0x25e9db,_0x14f7c3){return client[_0x6871('0xf')](_0x325e86,_0x15b408)[_0x6871('0x10')](function(_0x1697c2){logger[_0x6871('0x11')](_0x6871('0x12'),_0x264e0b,_0x6871('0x13'));logger[_0x6871('0x14')](_0x6871('0x15'),_0x264e0b,_0x6871('0x13'),JSON['stringify'](_0x1697c2));if(_0x1697c2[_0x6871('0x16')]){if(_0x1697c2[_0x6871('0x16')][_0x6871('0x17')]===0x1f4){logger[_0x6871('0x16')](_0x6871('0x12'),_0x264e0b,_0x1697c2['error'][_0x6871('0x18')]);return _0x14f7c3(_0x1697c2[_0x6871('0x16')][_0x6871('0x18')]);}logger[_0x6871('0x16')](_0x6871('0x12'),_0x264e0b,_0x1697c2[_0x6871('0x16')][_0x6871('0x18')]);return _0x25e9db(_0x1697c2['error'][_0x6871('0x18')]);}else{logger[_0x6871('0x11')](_0x6871('0x12'),_0x264e0b,_0x6871('0x13'));_0x25e9db(_0x1697c2[_0x6871('0x19')][_0x6871('0x18')]);}})[_0x6871('0x1a')](function(_0x15bf2c){logger[_0x6871('0x16')](_0x6871('0x12'),_0x264e0b,_0x15bf2c);_0x14f7c3(_0x15bf2c);});});}exports['GetOpenchannelQueue']=function(_0x236655){var _0x55b184=this;return new Promise(function(_0x2ec651,_0x44f331){return db['OpenchannelQueue'][_0x6871('0x1b')]({'raw':_0x236655['options']?_0x236655['options'][_0x6871('0x1c')]===undefined?!![]:![]:!![],'where':_0x236655['options']?_0x236655['options'][_0x6871('0x1d')]||null:null,'attributes':_0x236655[_0x6871('0x1e')]?_0x236655[_0x6871('0x1e')][_0x6871('0x1f')]||null:null,'limit':_0x236655[_0x6871('0x1e')]?_0x236655[_0x6871('0x1e')][_0x6871('0x20')]||null:null,'include':_0x236655[_0x6871('0x1e')]?_0x236655[_0x6871('0x1e')][_0x6871('0x21')]?_[_0x6871('0x22')](_0x236655[_0x6871('0x1e')]['include'],function(_0x13a8ee){return{'model':db[_0x13a8ee[_0x6871('0x23')]],'as':_0x13a8ee['as'],'attributes':_0x13a8ee[_0x6871('0x1f')],'include':_0x13a8ee['include']?_[_0x6871('0x22')](_0x13a8ee[_0x6871('0x21')],function(_0x47293f){return{'model':db[_0x47293f[_0x6871('0x23')]],'as':_0x47293f['as'],'attributes':_0x47293f[_0x6871('0x1f')],'include':_0x47293f[_0x6871('0x21')]?_['map'](_0x47293f['include'],function(_0xed94bb){return{'model':db[_0xed94bb['model']],'as':_0xed94bb['as'],'attributes':_0xed94bb[_0x6871('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x6871('0x10')](function(_0x803d94){logger[_0x6871('0x11')](_0x6871('0x24'),_0x236655);logger[_0x6871('0x14')](_0x6871('0x24'),_0x236655,JSON[_0x6871('0x25')](_0x803d94));_0x2ec651(_0x803d94);})[_0x6871('0x1a')](function(_0xdb6bf4){logger[_0x6871('0x16')](_0x6871('0x24'),_0xdb6bf4['message'],_0x236655);_0x44f331(_0x55b184[_0x6871('0x16')](0x1f4,_0xdb6bf4[_0x6871('0x18')]));});});};exports['ShowOpenchannelQueue']=function(_0x19ddc8){var _0x3c5061=this;return new Promise(function(_0xddf978,_0x406fb6){return db['OpenchannelQueue'][_0x6871('0x26')]({'raw':_0x19ddc8[_0x6871('0x1e')]?_0x19ddc8[_0x6871('0x1e')][_0x6871('0x1c')]===undefined?!![]:![]:!![],'where':_0x19ddc8[_0x6871('0x1e')]?_0x19ddc8[_0x6871('0x1e')]['where']||null:null,'attributes':_0x19ddc8[_0x6871('0x1e')]?_0x19ddc8[_0x6871('0x1e')][_0x6871('0x1f')]||null:null,'include':_0x19ddc8['options']?_0x19ddc8['options'][_0x6871('0x21')]?_[_0x6871('0x22')](_0x19ddc8['options'][_0x6871('0x21')],function(_0x311af5){return{'model':db[_0x311af5[_0x6871('0x23')]],'as':_0x311af5['as'],'attributes':_0x311af5[_0x6871('0x1f')],'include':_0x311af5[_0x6871('0x21')]?_[_0x6871('0x22')](_0x311af5['include'],function(_0x261624){return{'model':db[_0x261624[_0x6871('0x23')]],'as':_0x261624['as'],'attributes':_0x261624[_0x6871('0x1f')],'include':_0x261624[_0x6871('0x21')]?_[_0x6871('0x22')](_0x261624['include'],function(_0x3e7a29){return{'model':db[_0x3e7a29[_0x6871('0x23')]],'as':_0x3e7a29['as'],'attributes':_0x3e7a29['attributes']};}):[]};}):[]};}):[]:[]})[_0x6871('0x10')](function(_0x41c0ff){logger['info'](_0x6871('0x27'),_0x19ddc8);logger[_0x6871('0x14')]('ShowOpenchannelQueue',_0x19ddc8,JSON['stringify'](_0x41c0ff));_0xddf978(_0x41c0ff);})['catch'](function(_0x516cd7){logger['error'](_0x6871('0x27'),_0x516cd7['message'],_0x19ddc8);_0x406fb6(_0x3c5061[_0x6871('0x16')](0x1f4,_0x516cd7['message']));});});}; \ No newline at end of file +var _0xd25c=['stringify','error','code','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','attributes','include','map','model','ShowOpenchannelQueue','where','then','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s'];(function(_0x2e550a,_0x505749){var _0xa5f803=function(_0x5ae41e){while(--_0x5ae41e){_0x2e550a['push'](_0x2e550a['shift']());}};_0xa5f803(++_0x505749);}(_0xd25c,0x114));var _0xcd25=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xd25c[_0x29b609];return _0x54c952;};'use strict';var _=require(_0xcd25('0x0'));var util=require(_0xcd25('0x1'));var moment=require(_0xcd25('0x2'));var BPromise=require(_0xcd25('0x3'));var rs=require(_0xcd25('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcd25('0x5'))['db'];var utils=require(_0xcd25('0x6'));var logger=require(_0xcd25('0x7'))(_0xcd25('0x8'));var config=require(_0xcd25('0x9'));var jayson=require(_0xcd25('0xa'));var client=jayson[_0xcd25('0xb')][_0xcd25('0xc')]({'port':0x232a});config[_0xcd25('0xd')]=_[_0xcd25('0xe')](config[_0xcd25('0xd')],{'host':_0xcd25('0xf'),'port':0x18eb});var socket=require(_0xcd25('0x10'))(new Redis(config[_0xcd25('0xd')]));require(_0xcd25('0x11'))[_0xcd25('0x12')](socket);function respondWithRpcPromise(_0x37bfa0,_0x51fdf5,_0x1e97b9){return new BPromise(function(_0x395b7a,_0x32d92a){return client[_0xcd25('0x13')](_0x37bfa0,_0x1e97b9)['then'](function(_0x803865){logger[_0xcd25('0x14')](_0xcd25('0x15'),_0x51fdf5,_0xcd25('0x16'));logger[_0xcd25('0x17')](_0xcd25('0x18'),_0x51fdf5,_0xcd25('0x16'),JSON[_0xcd25('0x19')](_0x803865));if(_0x803865[_0xcd25('0x1a')]){if(_0x803865[_0xcd25('0x1a')][_0xcd25('0x1b')]===0x1f4){logger['error'](_0xcd25('0x15'),_0x51fdf5,_0x803865['error'][_0xcd25('0x1c')]);return _0x32d92a(_0x803865[_0xcd25('0x1a')][_0xcd25('0x1c')]);}logger[_0xcd25('0x1a')](_0xcd25('0x15'),_0x51fdf5,_0x803865[_0xcd25('0x1a')][_0xcd25('0x1c')]);return _0x395b7a(_0x803865['error'][_0xcd25('0x1c')]);}else{logger['info'](_0xcd25('0x15'),_0x51fdf5,_0xcd25('0x16'));_0x395b7a(_0x803865[_0xcd25('0x1d')][_0xcd25('0x1c')]);}})[_0xcd25('0x1e')](function(_0x356ef1){logger['error'](_0xcd25('0x15'),_0x51fdf5,_0x356ef1);_0x32d92a(_0x356ef1);});});}exports[_0xcd25('0x1f')]=function(_0x5355bb){var _0x1678f5=this;return new Promise(function(_0x142b28,_0xf6041c){return db[_0xcd25('0x20')][_0xcd25('0x21')]({'raw':_0x5355bb[_0xcd25('0x22')]?_0x5355bb[_0xcd25('0x22')][_0xcd25('0x23')]===undefined?!![]:![]:!![],'where':_0x5355bb[_0xcd25('0x22')]?_0x5355bb[_0xcd25('0x22')]['where']||null:null,'attributes':_0x5355bb['options']?_0x5355bb['options'][_0xcd25('0x24')]||null:null,'limit':_0x5355bb['options']?_0x5355bb[_0xcd25('0x22')]['limit']||null:null,'include':_0x5355bb[_0xcd25('0x22')]?_0x5355bb[_0xcd25('0x22')][_0xcd25('0x25')]?_[_0xcd25('0x26')](_0x5355bb['options'][_0xcd25('0x25')],function(_0x2827bf){return{'model':db[_0x2827bf[_0xcd25('0x27')]],'as':_0x2827bf['as'],'attributes':_0x2827bf[_0xcd25('0x24')],'include':_0x2827bf[_0xcd25('0x25')]?_['map'](_0x2827bf[_0xcd25('0x25')],function(_0x1f536e){return{'model':db[_0x1f536e['model']],'as':_0x1f536e['as'],'attributes':_0x1f536e[_0xcd25('0x24')],'include':_0x1f536e['include']?_[_0xcd25('0x26')](_0x1f536e[_0xcd25('0x25')],function(_0x36f9f7){return{'model':db[_0x36f9f7[_0xcd25('0x27')]],'as':_0x36f9f7['as'],'attributes':_0x36f9f7['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5557f4){logger['info']('GetOpenchannelQueue',_0x5355bb);logger[_0xcd25('0x17')](_0xcd25('0x1f'),_0x5355bb,JSON['stringify'](_0x5557f4));_0x142b28(_0x5557f4);})[_0xcd25('0x1e')](function(_0x5aefe1){logger[_0xcd25('0x1a')](_0xcd25('0x1f'),_0x5aefe1['message'],_0x5355bb);_0xf6041c(_0x1678f5[_0xcd25('0x1a')](0x1f4,_0x5aefe1[_0xcd25('0x1c')]));});});};exports[_0xcd25('0x28')]=function(_0x191769){var _0x1c1a64=this;return new Promise(function(_0x56ce3d,_0x2cd6a9){return db[_0xcd25('0x20')]['find']({'raw':_0x191769['options']?_0x191769[_0xcd25('0x22')][_0xcd25('0x23')]===undefined?!![]:![]:!![],'where':_0x191769['options']?_0x191769[_0xcd25('0x22')][_0xcd25('0x29')]||null:null,'attributes':_0x191769[_0xcd25('0x22')]?_0x191769[_0xcd25('0x22')]['attributes']||null:null,'include':_0x191769[_0xcd25('0x22')]?_0x191769[_0xcd25('0x22')][_0xcd25('0x25')]?_['map'](_0x191769[_0xcd25('0x22')][_0xcd25('0x25')],function(_0x1bbfd9){return{'model':db[_0x1bbfd9[_0xcd25('0x27')]],'as':_0x1bbfd9['as'],'attributes':_0x1bbfd9['attributes'],'include':_0x1bbfd9[_0xcd25('0x25')]?_[_0xcd25('0x26')](_0x1bbfd9[_0xcd25('0x25')],function(_0x2ee832){return{'model':db[_0x2ee832[_0xcd25('0x27')]],'as':_0x2ee832['as'],'attributes':_0x2ee832[_0xcd25('0x24')],'include':_0x2ee832[_0xcd25('0x25')]?_[_0xcd25('0x26')](_0x2ee832[_0xcd25('0x25')],function(_0x20eba9){return{'model':db[_0x20eba9[_0xcd25('0x27')]],'as':_0x20eba9['as'],'attributes':_0x20eba9[_0xcd25('0x24')]};}):[]};}):[]};}):[]:[]})[_0xcd25('0x2a')](function(_0x3efdf3){logger[_0xcd25('0x14')](_0xcd25('0x28'),_0x191769);logger['debug']('ShowOpenchannelQueue',_0x191769,JSON[_0xcd25('0x19')](_0x3efdf3));_0x56ce3d(_0x3efdf3);})[_0xcd25('0x1e')](function(_0x170a45){logger[_0xcd25('0x1a')](_0xcd25('0x28'),_0x170a45[_0xcd25('0x1c')],_0x191769);_0x2cd6a9(_0x1c1a64['error'](0x1f4,_0x170a45[_0xcd25('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index df2ff8c..e4acf5e 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 _0x12f9=['remove','emit','removeListener','length','openchannelQueue:','./openchannelQueue.events','save'];(function(_0xfb0faa,_0x51c8a4){var _0x24fe76=function(_0x4f8d56){while(--_0x4f8d56){_0xfb0faa['push'](_0xfb0faa['shift']());}};_0x24fe76(++_0x51c8a4);}(_0x12f9,0xc2));var _0x912f=function(_0x3dafa2,_0x5e83c9){_0x3dafa2=_0x3dafa2-0x0;var _0x411e05=_0x12f9[_0x3dafa2];return _0x411e05;};'use strict';var OpenchannelQueueEvents=require(_0x912f('0x0'));var events=[_0x912f('0x1'),_0x912f('0x2'),'update'];function createListener(_0x368fb7,_0x4abaf6){return function(_0x509e89){_0x4abaf6[_0x912f('0x3')](_0x368fb7,_0x509e89);};}function removeListener(_0x2cdbd0,_0x451f70){return function(){OpenchannelQueueEvents[_0x912f('0x4')](_0x2cdbd0,_0x451f70);};}exports['register']=function(_0xe5388c){for(var _0x5e9721=0x0,_0x118640=events[_0x912f('0x5')];_0x5e9721<_0x118640;_0x5e9721++){var _0x5df208=events[_0x5e9721];var _0x5a608a=createListener(_0x912f('0x6')+_0x5df208,_0xe5388c);OpenchannelQueueEvents['on'](_0x5df208,_0x5a608a);}}; \ No newline at end of file +var _0x6547=['save','update','removeListener','register','length','./openchannelQueue.events'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x6547,0x18b));var _0x7654=function(_0x458199,_0x2478c3){_0x458199=_0x458199-0x0;var _0x2cc146=_0x6547[_0x458199];return _0x2cc146;};'use strict';var OpenchannelQueueEvents=require(_0x7654('0x0'));var events=[_0x7654('0x1'),'remove',_0x7654('0x2')];function createListener(_0xea8ff8,_0x4f3cb9){return function(_0x449ec2){_0x4f3cb9['emit'](_0xea8ff8,_0x449ec2);};}function removeListener(_0x4d07e6,_0xb13ff8){return function(){OpenchannelQueueEvents[_0x7654('0x3')](_0x4d07e6,_0xb13ff8);};}exports[_0x7654('0x4')]=function(_0x31e494){for(var _0x2fffd0=0x0,_0x23b8c9=events[_0x7654('0x5')];_0x2fffd0<_0x23b8c9;_0x2fffd0++){var _0x265714=events[_0x2fffd0];var _0x354338=createListener('openchannelQueue:'+_0x265714,_0x31e494);OpenchannelQueueEvents['on'](_0x265714,_0x354338);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 978c650..b91bfb2 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 _0xbfda=['put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./openchannelQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','create'];(function(_0x167cc4,_0x1a3676){var _0x508c09=function(_0x49347d){while(--_0x49347d){_0x167cc4['push'](_0x167cc4['shift']());}};_0x508c09(++_0x1a3676);}(_0xbfda,0x90));var _0xabfd=function(_0x22431e,_0x5af0a3){_0x22431e=_0x22431e-0x0;var _0xd978e9=_0xbfda[_0x22431e];return _0xd978e9;};'use strict';var multer=require(_0xabfd('0x0'));var util=require(_0xabfd('0x1'));var path=require(_0xabfd('0x2'));var timeout=require(_0xabfd('0x3'));var express=require('express');var router=express[_0xabfd('0x4')]();var fs_extra=require(_0xabfd('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xabfd('0x6'));var config=require('../../config/environment');var controller=require(_0xabfd('0x7'));router[_0xabfd('0x8')]('/',auth['isAuthenticated'](),controller[_0xabfd('0x9')]);router[_0xabfd('0x8')](_0xabfd('0xa'),auth[_0xabfd('0xb')](),controller[_0xabfd('0xc')]);router[_0xabfd('0x8')](_0xabfd('0xd'),auth[_0xabfd('0xb')](),controller[_0xabfd('0xe')]);router['post']('/',auth[_0xabfd('0xb')](),controller[_0xabfd('0xf')]);router[_0xabfd('0x10')](_0xabfd('0xd'),auth[_0xabfd('0xb')](),controller[_0xabfd('0x11')]);router['delete']('/:id',auth[_0xabfd('0xb')](),controller[_0xabfd('0x12')]);module[_0xabfd('0x13')]=router; \ No newline at end of file +var _0xb29c=['/:id','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./openchannelQueueReport.controller','get','isAuthenticated','/describe','describe','show','post','create','put'];(function(_0x570482,_0x31413e){var _0x18b88a=function(_0x1c3eb4){while(--_0x1c3eb4){_0x570482['push'](_0x570482['shift']());}};_0x18b88a(++_0x31413e);}(_0xb29c,0x157));var _0xcb29=function(_0x5defe5,_0x454030){_0x5defe5=_0x5defe5-0x0;var _0x1a53f2=_0xb29c[_0x5defe5];return _0x1a53f2;};'use strict';var multer=require(_0xcb29('0x0'));var util=require(_0xcb29('0x1'));var path=require(_0xcb29('0x2'));var timeout=require(_0xcb29('0x3'));var express=require(_0xcb29('0x4'));var router=express[_0xcb29('0x5')]();var fs_extra=require(_0xcb29('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xcb29('0x7'));var config=require('../../config/environment');var controller=require(_0xcb29('0x8'));router[_0xcb29('0x9')]('/',auth[_0xcb29('0xa')](),controller['index']);router['get'](_0xcb29('0xb'),auth[_0xcb29('0xa')](),controller[_0xcb29('0xc')]);router[_0xcb29('0x9')]('/:id',auth[_0xcb29('0xa')](),controller[_0xcb29('0xd')]);router[_0xcb29('0xe')]('/',auth[_0xcb29('0xa')](),controller[_0xcb29('0xf')]);router[_0xcb29('0x10')](_0xcb29('0x11'),auth[_0xcb29('0xa')](),controller['update']);router[_0xcb29('0x12')]('/:id',auth[_0xcb29('0xa')](),controller['destroy']);module[_0xcb29('0x13')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 35989ae..e947afa 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 _0xe5f1=['STRING','DATE','moment','sequelize','exports'];(function(_0x34644b,_0x306c24){var _0x5d3491=function(_0x146445){while(--_0x146445){_0x34644b['push'](_0x34644b['shift']());}};_0x5d3491(++_0x306c24);}(_0xe5f1,0x16f));var _0x1e5f=function(_0x161344,_0x4fb00d){_0x161344=_0x161344-0x0;var _0xdb0227=_0xe5f1[_0x161344];return _0xdb0227;};'use strict';var moment=require(_0x1e5f('0x0'));var Sequelize=require(_0x1e5f('0x1'));module[_0x1e5f('0x2')]={'uniqueid':{'type':Sequelize[_0x1e5f('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x1e5f('0x3')]},'joinAt':{'type':Sequelize[_0x1e5f('0x4')]},'leaveAt':{'type':Sequelize[_0x1e5f('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x1e5f('0x3')]}}; \ No newline at end of file +var _0xe9b9=['STRING','DATE','moment','sequelize','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xe9b9,0x19c));var _0x9e9b=function(_0x96b6a,_0x12471d){_0x96b6a=_0x96b6a-0x0;var _0x3e16f3=_0xe9b9[_0x96b6a];return _0x3e16f3;};'use strict';var moment=require(_0x9e9b('0x0'));var Sequelize=require(_0x9e9b('0x1'));module[_0x9e9b('0x2')]={'uniqueid':{'type':Sequelize[_0x9e9b('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x9e9b('0x3')]},'joinAt':{'type':Sequelize[_0x9e9b('0x4')]},'leaveAt':{'type':Sequelize[_0x9e9b('0x4')]},'acceptAt':{'type':Sequelize[_0x9e9b('0x4')]},'exitAt':{'type':Sequelize[_0x9e9b('0x4')]},'reason':{'type':Sequelize[_0x9e9b('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index adbf21b..c2a4f98 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 _0x0256=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','OpenchannelQueueReport','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','rawAttributes','include','find','create','body','params','describe'];(function(_0x16e02b,_0x563643){var _0x5d1d06=function(_0xab29c4){while(--_0xab29c4){_0x16e02b['push'](_0x16e02b['shift']());}};_0x5d1d06(++_0x563643);}(_0x0256,0xe4));var _0x6025=function(_0x332933,_0x3f58df){_0x332933=_0x332933-0x0;var _0x34fb7b=_0x0256[_0x332933];return _0x34fb7b;};'use strict';var emlformat=require(_0x6025('0x0'));var rimraf=require(_0x6025('0x1'));var zipdir=require(_0x6025('0x2'));var jsonpatch=require(_0x6025('0x3'));var rp=require(_0x6025('0x4'));var moment=require(_0x6025('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6025('0x6'));var util=require(_0x6025('0x7'));var path=require(_0x6025('0x8'));var sox=require(_0x6025('0x9'));var csv=require(_0x6025('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6025('0xb'));var _=require('lodash');var squel=require(_0x6025('0xc'));var crypto=require(_0x6025('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6025('0xe'));var toCsv=require('to-csv');var querystring=require(_0x6025('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6025('0x10'));var qs=require(_0x6025('0x11'));var as=require(_0x6025('0x12'));var hardwareService=require(_0x6025('0x13'));var logger=require(_0x6025('0x14'))(_0x6025('0x15'));var utils=require(_0x6025('0x16'));var config=require(_0x6025('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x6025('0x18'))['db'];function respondWithStatusCode(_0x140636,_0x49c5b2){_0x49c5b2=_0x49c5b2||0xcc;return function(_0x2fd1db){if(_0x2fd1db){return _0x140636[_0x6025('0x19')](_0x49c5b2);}return _0x140636['status'](_0x49c5b2)[_0x6025('0x1a')]();};}function respondWithResult(_0x42b8dc,_0x1773cd){_0x1773cd=_0x1773cd||0xc8;return function(_0x596fb3){if(_0x596fb3){return _0x42b8dc[_0x6025('0x1b')](_0x1773cd)[_0x6025('0x1c')](_0x596fb3);}};}function respondWithFilteredResult(_0x30bf2b,_0x27652c){return function(_0x5e6665){if(_0x5e6665){var _0x5affb5=typeof _0x27652c[_0x6025('0x1d')]===_0x6025('0x1e')&&typeof _0x27652c['limit']===_0x6025('0x1e');var _0x29eff3=_0x5e6665[_0x6025('0x1f')];var _0x512d67=_0x5affb5?0x0:_0x27652c[_0x6025('0x1d')];var _0x2069ab=_0x5affb5?_0x5e6665['count']:_0x27652c['offset']+_0x27652c[_0x6025('0x20')];var _0x3728c6;if(_0x2069ab>=_0x29eff3){_0x2069ab=_0x29eff3;_0x3728c6=0xc8;}else{_0x3728c6=0xce;}_0x30bf2b[_0x6025('0x1b')](_0x3728c6);return _0x30bf2b['set'](_0x6025('0x21'),_0x512d67+'-'+_0x2069ab+'/'+_0x29eff3)[_0x6025('0x1c')](_0x5e6665);}return null;};}function patchUpdates(_0x2dcf6d){return function(_0x5b5d7f){try{jsonpatch[_0x6025('0x22')](_0x5b5d7f,_0x2dcf6d,!![]);}catch(_0xe0495e){return BPromise['reject'](_0xe0495e);}return _0x5b5d7f[_0x6025('0x23')]();};}function saveUpdates(_0x4d9e,_0x25e95e){return function(_0x1b5875){if(_0x1b5875){return _0x1b5875[_0x6025('0x24')](_0x4d9e)[_0x6025('0x25')](function(_0x3d8ac0){return _0x3d8ac0;});}return null;};}function removeEntity(_0x1b95c1,_0x7432cf){return function(_0x25ed62){if(_0x25ed62){return _0x25ed62[_0x6025('0x26')]()[_0x6025('0x25')](function(){_0x1b95c1[_0x6025('0x1b')](0xcc)[_0x6025('0x1a')]();});}};}function handleEntityNotFound(_0x8c61a3,_0x3fd4c0){return function(_0x799544){if(!_0x799544){_0x8c61a3[_0x6025('0x19')](0x194);}return _0x799544;};}function handleError(_0x42a832,_0x2b5823){_0x2b5823=_0x2b5823||0x1f4;return function(_0x51aedf){logger[_0x6025('0x27')](_0x51aedf[_0x6025('0x28')]);if(_0x51aedf['name']){delete _0x51aedf[_0x6025('0x29')];}_0x42a832[_0x6025('0x1b')](_0x2b5823)[_0x6025('0x2a')](_0x51aedf);};}exports[_0x6025('0x2b')]=function(_0x21f735,_0x2d5aea){var _0x5d0c9b={},_0x43e96d={},_0x7430cd={'count':0x0,'rows':[]};var _0x542d7c=_[_0x6025('0x2c')](db[_0x6025('0x2d')]['rawAttributes'],function(_0x1f884b){return{'name':_0x1f884b['fieldName'],'type':_0x1f884b[_0x6025('0x2e')][_0x6025('0x2f')]};});_0x43e96d[_0x6025('0x30')]=_[_0x6025('0x2c')](_0x542d7c,_0x6025('0x29'));_0x43e96d[_0x6025('0x31')]=_[_0x6025('0x32')](_0x21f735['query']);_0x43e96d[_0x6025('0x33')]=_[_0x6025('0x34')](_0x43e96d[_0x6025('0x30')],_0x43e96d['query']);_0x5d0c9b[_0x6025('0x35')]=_[_0x6025('0x34')](_0x43e96d[_0x6025('0x30')],qs[_0x6025('0x36')](_0x21f735[_0x6025('0x31')]['fields']));_0x5d0c9b['attributes']=_0x5d0c9b[_0x6025('0x35')][_0x6025('0x37')]?_0x5d0c9b[_0x6025('0x35')]:_0x43e96d[_0x6025('0x30')];if(!_0x21f735[_0x6025('0x31')][_0x6025('0x38')]('nolimit')){_0x5d0c9b[_0x6025('0x20')]=qs[_0x6025('0x20')](_0x21f735['query'][_0x6025('0x20')]);_0x5d0c9b[_0x6025('0x1d')]=qs[_0x6025('0x1d')](_0x21f735[_0x6025('0x31')][_0x6025('0x1d')]);}_0x5d0c9b['order']=qs[_0x6025('0x39')](_0x21f735[_0x6025('0x31')][_0x6025('0x39')]);_0x5d0c9b[_0x6025('0x3a')]=qs['filters'](_[_0x6025('0x3b')](_0x21f735['query'],_0x43e96d[_0x6025('0x33')]),_0x542d7c);if(_0x21f735[_0x6025('0x31')][_0x6025('0x3c')]){_0x5d0c9b[_0x6025('0x3a')]=_[_0x6025('0x3d')](_0x5d0c9b['where'],{'$or':_['map'](_0x542d7c,function(_0x433138){if(_0x433138[_0x6025('0x2e')]!==_0x6025('0x3e')){var _0x2fc168={};_0x2fc168[_0x433138['name']]={'$like':'%'+_0x21f735[_0x6025('0x31')][_0x6025('0x3c')]+'%'};return _0x2fc168;}})});}_0x5d0c9b=_['merge']({},_0x5d0c9b,_0x21f735[_0x6025('0x3f')]);var _0x49b140={'where':_0x5d0c9b[_0x6025('0x3a')]};return db[_0x6025('0x2d')][_0x6025('0x1f')](_0x49b140)[_0x6025('0x25')](function(_0x2827e3){_0x7430cd['count']=_0x2827e3;if(_0x21f735[_0x6025('0x31')][_0x6025('0x40')]){_0x5d0c9b['include']=[{'all':!![]}];}return db[_0x6025('0x2d')][_0x6025('0x41')](_0x5d0c9b);})[_0x6025('0x25')](function(_0x187312){_0x7430cd[_0x6025('0x42')]=_0x187312;return _0x7430cd;})[_0x6025('0x25')](respondWithFilteredResult(_0x2d5aea,_0x5d0c9b))[_0x6025('0x43')](handleError(_0x2d5aea,null));};exports[_0x6025('0x44')]=function(_0x1e1e04,_0x5134d8){var _0x45c30d={'raw':!![],'where':{'id':_0x1e1e04['params']['id']}},_0x23878a={};_0x23878a[_0x6025('0x30')]=_[_0x6025('0x32')](db['OpenchannelQueueReport'][_0x6025('0x45')]);_0x23878a[_0x6025('0x31')]=_[_0x6025('0x32')](_0x1e1e04[_0x6025('0x31')]);_0x23878a[_0x6025('0x33')]=_['intersection'](_0x23878a[_0x6025('0x30')],_0x23878a[_0x6025('0x31')]);_0x45c30d[_0x6025('0x35')]=_[_0x6025('0x34')](_0x23878a[_0x6025('0x30')],qs[_0x6025('0x36')](_0x1e1e04[_0x6025('0x31')][_0x6025('0x36')]));_0x45c30d['attributes']=_0x45c30d[_0x6025('0x35')]['length']?_0x45c30d[_0x6025('0x35')]:_0x23878a[_0x6025('0x30')];if(_0x1e1e04[_0x6025('0x31')]['includeAll']){_0x45c30d[_0x6025('0x46')]=[{'all':!![]}];}_0x45c30d=_[_0x6025('0x3d')]({},_0x45c30d,_0x1e1e04[_0x6025('0x3f')]);return db['OpenchannelQueueReport'][_0x6025('0x47')](_0x45c30d)[_0x6025('0x25')](handleEntityNotFound(_0x5134d8,null))[_0x6025('0x25')](respondWithResult(_0x5134d8,null))['catch'](handleError(_0x5134d8,null));};exports[_0x6025('0x48')]=function(_0x150201,_0x9b6add){return db[_0x6025('0x2d')]['create'](_0x150201[_0x6025('0x49')],{})[_0x6025('0x25')](respondWithResult(_0x9b6add,0xc9))[_0x6025('0x43')](handleError(_0x9b6add,null));};exports['update']=function(_0x415c1e,_0x356e80){if(_0x415c1e[_0x6025('0x49')]['id']){delete _0x415c1e['body']['id'];}return db[_0x6025('0x2d')]['find']({'where':{'id':_0x415c1e['params']['id']}})[_0x6025('0x25')](handleEntityNotFound(_0x356e80,null))[_0x6025('0x25')](saveUpdates(_0x415c1e['body'],null))[_0x6025('0x25')](respondWithResult(_0x356e80,null))[_0x6025('0x43')](handleError(_0x356e80,null));};exports[_0x6025('0x26')]=function(_0x44eaf0,_0x8f8a01){return db['OpenchannelQueueReport'][_0x6025('0x47')]({'where':{'id':_0x44eaf0[_0x6025('0x4a')]['id']}})[_0x6025('0x25')](handleEntityNotFound(_0x8f8a01,null))[_0x6025('0x25')](removeEntity(_0x8f8a01,null))[_0x6025('0x43')](handleError(_0x8f8a01,null));};exports[_0x6025('0x4b')]=function(_0x359204,_0x507378){return db[_0x6025('0x2d')][_0x6025('0x4b')]()[_0x6025('0x25')](respondWithResult(_0x507378,null))[_0x6025('0x43')](handleError(_0x507378,null));}; \ No newline at end of file +var _0x6028=['../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','count','includeAll','catch','show','params','include','find','create','body','describe','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware'];(function(_0x47918c,_0x33c311){var _0x57ebfc=function(_0x138407){while(--_0x138407){_0x47918c['push'](_0x47918c['shift']());}};_0x57ebfc(++_0x33c311);}(_0x6028,0x1b5));var _0x8602=function(_0x376282,_0x436133){_0x376282=_0x376282-0x0;var _0x34a0c8=_0x6028[_0x376282];return _0x34a0c8;};'use strict';var emlformat=require(_0x8602('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8602('0x1'));var rp=require(_0x8602('0x2'));var moment=require(_0x8602('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x8602('0x4'));var util=require(_0x8602('0x5'));var path=require(_0x8602('0x6'));var sox=require(_0x8602('0x7'));var csv=require(_0x8602('0x8'));var ejs=require(_0x8602('0x9'));var fs=require('fs');var fs_extra=require(_0x8602('0xa'));var _=require(_0x8602('0xb'));var squel=require(_0x8602('0xc'));var crypto=require(_0x8602('0xd'));var jsforce=require(_0x8602('0xe'));var deskjs=require(_0x8602('0xf'));var toCsv=require(_0x8602('0x8'));var querystring=require('querystring');var Papa=require(_0x8602('0x10'));var Redis=require('ioredis');var authService=require(_0x8602('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8602('0x12'));var logger=require(_0x8602('0x13'))(_0x8602('0x14'));var utils=require('../../config/utils');var config=require(_0x8602('0x15'));var licenseUtil=require(_0x8602('0x16'));var db=require(_0x8602('0x17'))['db'];function respondWithStatusCode(_0x262d77,_0x567e07){_0x567e07=_0x567e07||0xcc;return function(_0xfe69c8){if(_0xfe69c8){return _0x262d77['sendStatus'](_0x567e07);}return _0x262d77[_0x8602('0x18')](_0x567e07)[_0x8602('0x19')]();};}function respondWithResult(_0x270b03,_0x2b7644){_0x2b7644=_0x2b7644||0xc8;return function(_0x4b35b9){if(_0x4b35b9){return _0x270b03[_0x8602('0x18')](_0x2b7644)[_0x8602('0x1a')](_0x4b35b9);}};}function respondWithFilteredResult(_0x23615e,_0x3cd3c1){return function(_0xdfd481){if(_0xdfd481){var _0x7aa0ac=typeof _0x3cd3c1[_0x8602('0x1b')]===_0x8602('0x1c')&&typeof _0x3cd3c1[_0x8602('0x1d')]===_0x8602('0x1c');var _0xcac91b=_0xdfd481['count'];var _0x62b4be=_0x7aa0ac?0x0:_0x3cd3c1[_0x8602('0x1b')];var _0x44767b=_0x7aa0ac?_0xdfd481['count']:_0x3cd3c1[_0x8602('0x1b')]+_0x3cd3c1[_0x8602('0x1d')];var _0x1680b6;if(_0x44767b>=_0xcac91b){_0x44767b=_0xcac91b;_0x1680b6=0xc8;}else{_0x1680b6=0xce;}_0x23615e[_0x8602('0x18')](_0x1680b6);return _0x23615e[_0x8602('0x1e')](_0x8602('0x1f'),_0x62b4be+'-'+_0x44767b+'/'+_0xcac91b)['json'](_0xdfd481);}return null;};}function patchUpdates(_0x26518f){return function(_0x7b936){try{jsonpatch[_0x8602('0x20')](_0x7b936,_0x26518f,!![]);}catch(_0x4fbbf5){return BPromise[_0x8602('0x21')](_0x4fbbf5);}return _0x7b936[_0x8602('0x22')]();};}function saveUpdates(_0xc44af0,_0x439406){return function(_0x3c9cab){if(_0x3c9cab){return _0x3c9cab[_0x8602('0x23')](_0xc44af0)[_0x8602('0x24')](function(_0x3daf87){return _0x3daf87;});}return null;};}function removeEntity(_0x54ab87,_0x39476d){return function(_0x5660f1){if(_0x5660f1){return _0x5660f1[_0x8602('0x25')]()[_0x8602('0x24')](function(){_0x54ab87['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x9be122,_0x338503){return function(_0x3f409e){if(!_0x3f409e){_0x9be122[_0x8602('0x26')](0x194);}return _0x3f409e;};}function handleError(_0x1dcff7,_0x793413){_0x793413=_0x793413||0x1f4;return function(_0x2cb397){logger[_0x8602('0x27')](_0x2cb397['stack']);if(_0x2cb397[_0x8602('0x28')]){delete _0x2cb397[_0x8602('0x28')];}_0x1dcff7[_0x8602('0x18')](_0x793413)[_0x8602('0x29')](_0x2cb397);};}exports[_0x8602('0x2a')]=function(_0x1888f4,_0x55aa4c){var _0x17ca44={},_0x17f190={},_0x57f7c4={'count':0x0,'rows':[]};var _0x2ee25b=_[_0x8602('0x2b')](db[_0x8602('0x2c')][_0x8602('0x2d')],function(_0x2ddba1){return{'name':_0x2ddba1[_0x8602('0x2e')],'type':_0x2ddba1[_0x8602('0x2f')][_0x8602('0x30')]};});_0x17f190['model']=_[_0x8602('0x2b')](_0x2ee25b,_0x8602('0x28'));_0x17f190[_0x8602('0x31')]=_[_0x8602('0x32')](_0x1888f4[_0x8602('0x31')]);_0x17f190[_0x8602('0x33')]=_[_0x8602('0x34')](_0x17f190['model'],_0x17f190[_0x8602('0x31')]);_0x17ca44[_0x8602('0x35')]=_[_0x8602('0x34')](_0x17f190[_0x8602('0x36')],qs[_0x8602('0x37')](_0x1888f4[_0x8602('0x31')][_0x8602('0x37')]));_0x17ca44[_0x8602('0x35')]=_0x17ca44[_0x8602('0x35')][_0x8602('0x38')]?_0x17ca44[_0x8602('0x35')]:_0x17f190['model'];if(!_0x1888f4[_0x8602('0x31')]['hasOwnProperty'](_0x8602('0x39'))){_0x17ca44[_0x8602('0x1d')]=qs['limit'](_0x1888f4[_0x8602('0x31')][_0x8602('0x1d')]);_0x17ca44[_0x8602('0x1b')]=qs[_0x8602('0x1b')](_0x1888f4[_0x8602('0x31')][_0x8602('0x1b')]);}_0x17ca44[_0x8602('0x3a')]=qs[_0x8602('0x3b')](_0x1888f4[_0x8602('0x31')][_0x8602('0x3b')]);_0x17ca44['where']=qs[_0x8602('0x33')](_[_0x8602('0x3c')](_0x1888f4['query'],_0x17f190[_0x8602('0x33')]),_0x2ee25b);if(_0x1888f4['query'][_0x8602('0x3d')]){_0x17ca44['where']=_[_0x8602('0x3e')](_0x17ca44[_0x8602('0x3f')],{'$or':_['map'](_0x2ee25b,function(_0x62bed2){if(_0x62bed2[_0x8602('0x2f')]!==_0x8602('0x40')){var _0x312ea7={};_0x312ea7[_0x62bed2[_0x8602('0x28')]]={'$like':'%'+_0x1888f4['query']['filter']+'%'};return _0x312ea7;}})});}_0x17ca44=_[_0x8602('0x3e')]({},_0x17ca44,_0x1888f4[_0x8602('0x41')]);var _0x3c4086={'where':_0x17ca44[_0x8602('0x3f')]};return db['OpenchannelQueueReport'][_0x8602('0x42')](_0x3c4086)[_0x8602('0x24')](function(_0x599ef6){_0x57f7c4['count']=_0x599ef6;if(_0x1888f4[_0x8602('0x31')][_0x8602('0x43')]){_0x17ca44['include']=[{'all':!![]}];}return db[_0x8602('0x2c')]['findAll'](_0x17ca44);})['then'](function(_0x9cdc1e){_0x57f7c4['rows']=_0x9cdc1e;return _0x57f7c4;})['then'](respondWithFilteredResult(_0x55aa4c,_0x17ca44))[_0x8602('0x44')](handleError(_0x55aa4c,null));};exports[_0x8602('0x45')]=function(_0x523c78,_0x596b17){var _0x10183f={'raw':!![],'where':{'id':_0x523c78[_0x8602('0x46')]['id']}},_0x259773={};_0x259773[_0x8602('0x36')]=_[_0x8602('0x32')](db[_0x8602('0x2c')]['rawAttributes']);_0x259773['query']=_[_0x8602('0x32')](_0x523c78[_0x8602('0x31')]);_0x259773[_0x8602('0x33')]=_[_0x8602('0x34')](_0x259773[_0x8602('0x36')],_0x259773[_0x8602('0x31')]);_0x10183f[_0x8602('0x35')]=_[_0x8602('0x34')](_0x259773[_0x8602('0x36')],qs[_0x8602('0x37')](_0x523c78[_0x8602('0x31')][_0x8602('0x37')]));_0x10183f[_0x8602('0x35')]=_0x10183f[_0x8602('0x35')][_0x8602('0x38')]?_0x10183f[_0x8602('0x35')]:_0x259773[_0x8602('0x36')];if(_0x523c78[_0x8602('0x31')][_0x8602('0x43')]){_0x10183f[_0x8602('0x47')]=[{'all':!![]}];}_0x10183f=_['merge']({},_0x10183f,_0x523c78[_0x8602('0x41')]);return db[_0x8602('0x2c')][_0x8602('0x48')](_0x10183f)[_0x8602('0x24')](handleEntityNotFound(_0x596b17,null))[_0x8602('0x24')](respondWithResult(_0x596b17,null))[_0x8602('0x44')](handleError(_0x596b17,null));};exports[_0x8602('0x49')]=function(_0x4f01ce,_0x207150){return db[_0x8602('0x2c')]['create'](_0x4f01ce['body'],{})['then'](respondWithResult(_0x207150,0xc9))['catch'](handleError(_0x207150,null));};exports['update']=function(_0x1ac21c,_0x5141f8){if(_0x1ac21c[_0x8602('0x4a')]['id']){delete _0x1ac21c[_0x8602('0x4a')]['id'];}return db[_0x8602('0x2c')][_0x8602('0x48')]({'where':{'id':_0x1ac21c['params']['id']}})[_0x8602('0x24')](handleEntityNotFound(_0x5141f8,null))[_0x8602('0x24')](saveUpdates(_0x1ac21c[_0x8602('0x4a')],null))['then'](respondWithResult(_0x5141f8,null))[_0x8602('0x44')](handleError(_0x5141f8,null));};exports['destroy']=function(_0x364faa,_0x5ab4ce){return db[_0x8602('0x2c')][_0x8602('0x48')]({'where':{'id':_0x364faa[_0x8602('0x46')]['id']}})[_0x8602('0x24')](handleEntityNotFound(_0x5ab4ce,null))[_0x8602('0x24')](removeEntity(_0x5ab4ce,null))['catch'](handleError(_0x5ab4ce,null));};exports[_0x8602('0x4b')]=function(_0x116492,_0x41d81f){return db[_0x8602('0x2c')][_0x8602('0x4b')]()[_0x8602('0x24')](respondWithResult(_0x41d81f,null))[_0x8602('0x44')](handleError(_0x41d81f,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 7b28ddf..52d971f 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 _0x5fc3=['util','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelQueueReport.attributes','exports','define','report_openchannel_queue','uniqueid','lodash'];(function(_0x2c24b8,_0x168e0b){var _0x563ed6=function(_0x7c1aa9){while(--_0x7c1aa9){_0x2c24b8['push'](_0x2c24b8['shift']());}};_0x563ed6(++_0x168e0b);}(_0x5fc3,0xa8));var _0x35fc=function(_0x5b7788,_0x309ae5){_0x5b7788=_0x5b7788-0x0;var _0x573871=_0x5fc3[_0x5b7788];return _0x573871;};'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'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[{'name':_0x35fc('0xc'),'fields':[_0x35fc('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','uniqueid','lodash','util'];(function(_0x3bf925,_0x4dd8e4){var _0x2128a1=function(_0x4d2049){while(--_0x4d2049){_0x3bf925['push'](_0x3bf925['shift']());}};_0x2128a1(++_0x4dd8e4);}(_0x814b,0x1a2));var _0xb814=function(_0x26b80e,_0x5c9333){_0x26b80e=_0x26b80e-0x0;var _0x84a8a8=_0x814b[_0x26b80e];return _0x84a8a8;};'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 diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 6c00203..7e321a7 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 _0xcf2f=['rpc','../../config/environment','jayson/promise','client','http','request','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','options','then','debug','UpdateOpenchannelQueueReport','update','body','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x384dc1,_0x91bd7c){var _0x49a328=function(_0x4c0e3a){while(--_0x4c0e3a){_0x384dc1['push'](_0x384dc1['shift']());}};_0x49a328(++_0x91bd7c);}(_0xcf2f,0xa7));var _0xfcf2=function(_0x601261,_0x2d052f){_0x601261=_0x601261-0x0;var _0x11ee37=_0xcf2f[_0x601261];return _0x11ee37;};'use strict';var _=require(_0xfcf2('0x0'));var util=require(_0xfcf2('0x1'));var moment=require(_0xfcf2('0x2'));var BPromise=require(_0xfcf2('0x3'));var rs=require(_0xfcf2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfcf2('0x5'))['db'];var utils=require(_0xfcf2('0x6'));var logger=require(_0xfcf2('0x7'))(_0xfcf2('0x8'));var config=require(_0xfcf2('0x9'));var jayson=require(_0xfcf2('0xa'));var client=jayson[_0xfcf2('0xb')][_0xfcf2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x41d4bd,_0x157f48,_0x16b6b2){return new BPromise(function(_0x34f444,_0xb4c510){return client[_0xfcf2('0xd')](_0x41d4bd,_0x16b6b2)['then'](function(_0x575f33){logger['info'](_0xfcf2('0xe'),_0x157f48,_0xfcf2('0xf'));logger['debug'](_0xfcf2('0x10'),_0x157f48,_0xfcf2('0xf'),JSON[_0xfcf2('0x11')](_0x575f33));if(_0x575f33[_0xfcf2('0x12')]){if(_0x575f33['error']['code']===0x1f4){logger[_0xfcf2('0x12')](_0xfcf2('0xe'),_0x157f48,_0x575f33[_0xfcf2('0x12')][_0xfcf2('0x13')]);return _0xb4c510(_0x575f33['error'][_0xfcf2('0x13')]);}logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x157f48,_0x575f33['error'][_0xfcf2('0x13')]);return _0x34f444(_0x575f33['error'][_0xfcf2('0x13')]);}else{logger[_0xfcf2('0x14')](_0xfcf2('0xe'),_0x157f48,_0xfcf2('0xf'));_0x34f444(_0x575f33[_0xfcf2('0x15')][_0xfcf2('0x13')]);}})[_0xfcf2('0x16')](function(_0x4d64ce){logger[_0xfcf2('0x12')](_0xfcf2('0xe'),_0x157f48,_0x4d64ce);_0xb4c510(_0x4d64ce);});});}exports[_0xfcf2('0x17')]=function(_0x581d78){var _0xd87472=this;return new Promise(function(_0x1b3c89,_0x33eaa7){return db[_0xfcf2('0x18')][_0xfcf2('0x19')](_0x581d78['body'],{'raw':_0x581d78[_0xfcf2('0x1a')]?_0x581d78[_0xfcf2('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xfcf2('0x1b')](function(_0x23c079){logger[_0xfcf2('0x14')](_0xfcf2('0x17'),_0x581d78);logger[_0xfcf2('0x1c')](_0xfcf2('0x17'),_0x581d78,JSON[_0xfcf2('0x11')](_0x23c079));_0x1b3c89(_0x23c079);})[_0xfcf2('0x16')](function(_0x1eeebd){logger['error'](_0xfcf2('0x17'),_0x1eeebd[_0xfcf2('0x13')],_0x581d78);_0x33eaa7(_0xd87472[_0xfcf2('0x12')](0x1f4,_0x1eeebd['message']));});});};exports[_0xfcf2('0x1d')]=function(_0x151aa8){var _0x5ddea1=this;return new Promise(function(_0x3c3774,_0xbc8722){return db['OpenchannelQueueReport'][_0xfcf2('0x1e')](_0x151aa8[_0xfcf2('0x1f')],{'raw':_0x151aa8[_0xfcf2('0x1a')]?_0x151aa8[_0xfcf2('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x151aa8[_0xfcf2('0x1a')]?_0x151aa8[_0xfcf2('0x1a')][_0xfcf2('0x20')]||null:null,'attributes':_0x151aa8[_0xfcf2('0x1a')]?_0x151aa8[_0xfcf2('0x1a')][_0xfcf2('0x21')]||null:null,'limit':_0x151aa8[_0xfcf2('0x1a')]?_0x151aa8[_0xfcf2('0x1a')][_0xfcf2('0x22')]||null:null})['then'](function(_0x4c2935){logger[_0xfcf2('0x14')](_0xfcf2('0x1d'),_0x151aa8);logger[_0xfcf2('0x1c')]('UpdateOpenchannelQueueReport',_0x151aa8,JSON[_0xfcf2('0x11')](_0x4c2935));_0x3c3774(_0x4c2935);})['catch'](function(_0x3ce9f8){logger[_0xfcf2('0x12')](_0xfcf2('0x1d'),_0x3ce9f8[_0xfcf2('0x13')],_0x151aa8);_0xbc8722(_0x5ddea1[_0xfcf2('0x12')](0x1f4,_0x3ce9f8[_0xfcf2('0x13')]));});});}; \ No newline at end of file +var _0x5464=['info','OpenchannelQueueReport,\x20%s,\x20%s','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','UpdateOpenchannelQueueReport','update','attributes','limit','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then'];(function(_0xe11a61,_0x165dc6){var _0x6f8254=function(_0x3cd5de){while(--_0x3cd5de){_0xe11a61['push'](_0xe11a61['shift']());}};_0x6f8254(++_0x165dc6);}(_0x5464,0x15d));var _0x4546=function(_0x42a5ae,_0x259006){_0x42a5ae=_0x42a5ae-0x0;var _0x129ab7=_0x5464[_0x42a5ae];return _0x129ab7;};'use strict';var _=require(_0x4546('0x0'));var util=require(_0x4546('0x1'));var moment=require(_0x4546('0x2'));var BPromise=require('bluebird');var rs=require(_0x4546('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4546('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4546('0x5'))(_0x4546('0x6'));var config=require(_0x4546('0x7'));var jayson=require(_0x4546('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5c5e09,_0x224c7c,_0x36c875){return new BPromise(function(_0x1a76c1,_0x2e860a){return client[_0x4546('0x9')](_0x5c5e09,_0x36c875)[_0x4546('0xa')](function(_0x11d63e){logger[_0x4546('0xb')](_0x4546('0xc'),_0x224c7c,'request\x20sent');logger[_0x4546('0xd')](_0x4546('0xe'),_0x224c7c,_0x4546('0xf'),JSON['stringify'](_0x11d63e));if(_0x11d63e[_0x4546('0x10')]){if(_0x11d63e[_0x4546('0x10')][_0x4546('0x11')]===0x1f4){logger[_0x4546('0x10')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x224c7c,_0x11d63e['error'][_0x4546('0x12')]);return _0x2e860a(_0x11d63e['error']['message']);}logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x224c7c,_0x11d63e['error']['message']);return _0x1a76c1(_0x11d63e[_0x4546('0x10')]['message']);}else{logger[_0x4546('0xb')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x224c7c,_0x4546('0xf'));_0x1a76c1(_0x11d63e['result'][_0x4546('0x12')]);}})[_0x4546('0x13')](function(_0x24b32a){logger[_0x4546('0x10')](_0x4546('0xc'),_0x224c7c,_0x24b32a);_0x2e860a(_0x24b32a);});});}exports[_0x4546('0x14')]=function(_0x57d8de){var _0x4ffd6b=this;return new Promise(function(_0x5780a7,_0x330235){return db[_0x4546('0x15')][_0x4546('0x16')](_0x57d8de[_0x4546('0x17')],{'raw':_0x57d8de[_0x4546('0x18')]?_0x57d8de[_0x4546('0x18')][_0x4546('0x19')]===undefined?!![]:![]:!![]})[_0x4546('0xa')](function(_0x4034a5){logger[_0x4546('0xb')]('CreateOpenchannelQueueReport',_0x57d8de);logger[_0x4546('0xd')](_0x4546('0x14'),_0x57d8de,JSON['stringify'](_0x4034a5));_0x5780a7(_0x4034a5);})[_0x4546('0x13')](function(_0x437f55){logger[_0x4546('0x10')](_0x4546('0x14'),_0x437f55[_0x4546('0x12')],_0x57d8de);_0x330235(_0x4ffd6b[_0x4546('0x10')](0x1f4,_0x437f55['message']));});});};exports[_0x4546('0x1a')]=function(_0x2cca8b){var _0x4f9fcf=this;return new Promise(function(_0x824698,_0x4618a6){return db[_0x4546('0x15')][_0x4546('0x1b')](_0x2cca8b[_0x4546('0x17')],{'raw':_0x2cca8b['options']?_0x2cca8b[_0x4546('0x18')][_0x4546('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2cca8b[_0x4546('0x18')]?_0x2cca8b['options']['where']||null:null,'attributes':_0x2cca8b[_0x4546('0x18')]?_0x2cca8b[_0x4546('0x18')][_0x4546('0x1c')]||null:null,'limit':_0x2cca8b[_0x4546('0x18')]?_0x2cca8b[_0x4546('0x18')][_0x4546('0x1d')]||null:null})[_0x4546('0xa')](function(_0x586ff1){logger[_0x4546('0xb')]('UpdateOpenchannelQueueReport',_0x2cca8b);logger[_0x4546('0xd')](_0x4546('0x1a'),_0x2cca8b,JSON['stringify'](_0x586ff1));_0x824698(_0x586ff1);})['catch'](function(_0xf7a95b){logger['error'](_0x4546('0x1a'),_0xf7a95b[_0x4546('0x12')],_0x2cca8b);_0x4618a6(_0x4f9fcf['error'](0x1f4,_0xf7a95b['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 61af238..a64c262 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 _0x0ffc=['Router','./openchannelTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id','post','create','delete','exports','multer','util','path','connect-timeout'];(function(_0x4dfa1a,_0x5648bd){var _0x1b9d0c=function(_0x214920){while(--_0x214920){_0x4dfa1a['push'](_0x4dfa1a['shift']());}};_0x1b9d0c(++_0x5648bd);}(_0x0ffc,0x19c));var _0xc0ff=function(_0x558c62,_0x302e28){_0x558c62=_0x558c62-0x0;var _0x4fd5a0=_0x0ffc[_0x558c62];return _0x4fd5a0;};'use strict';var multer=require(_0xc0ff('0x0'));var util=require(_0xc0ff('0x1'));var path=require(_0xc0ff('0x2'));var timeout=require(_0xc0ff('0x3'));var express=require('express');var router=express[_0xc0ff('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc0ff('0x5'));router['get']('/',auth[_0xc0ff('0x6')](),controller[_0xc0ff('0x7')]);router[_0xc0ff('0x8')](_0xc0ff('0x9'),auth['isAuthenticated'](),controller[_0xc0ff('0xa')]);router[_0xc0ff('0x8')](_0xc0ff('0xb'),auth[_0xc0ff('0x6')](),controller['show']);router[_0xc0ff('0xc')]('/',auth[_0xc0ff('0x6')](),controller[_0xc0ff('0xd')]);router['put'](_0xc0ff('0xb'),auth[_0xc0ff('0x6')](),controller['update']);router[_0xc0ff('0xe')](_0xc0ff('0xb'),auth[_0xc0ff('0x6')](),controller['destroy']);module[_0xc0ff('0xf')]=router; \ No newline at end of file +var _0x8c19=['get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','exports','multer','path','connect-timeout','Router','fs-extra'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x8c19,0x14b));var _0x98c1=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x8c19[_0x47e7cb];return _0x2a8874;};'use strict';var multer=require(_0x98c1('0x0'));var util=require('util');var path=require(_0x98c1('0x1'));var timeout=require(_0x98c1('0x2'));var express=require('express');var router=express[_0x98c1('0x3')]();var fs_extra=require(_0x98c1('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./openchannelTransferReport.controller');router[_0x98c1('0x5')]('/',auth[_0x98c1('0x6')](),controller[_0x98c1('0x7')]);router['get'](_0x98c1('0x8'),auth[_0x98c1('0x6')](),controller[_0x98c1('0x9')]);router[_0x98c1('0x5')](_0x98c1('0xa'),auth[_0x98c1('0x6')](),controller[_0x98c1('0xb')]);router[_0x98c1('0xc')]('/',auth[_0x98c1('0x6')](),controller['create']);router[_0x98c1('0xd')](_0x98c1('0xa'),auth[_0x98c1('0x6')](),controller[_0x98c1('0xe')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x98c1('0xf')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 8c88ef7..b3ba3e6 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 _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x4eff4f,_0x4cd440){var _0x46ea1f=function(_0x348c07){while(--_0x348c07){_0x4eff4f['push'](_0x4eff4f['shift']());}};_0x46ea1f(++_0x4cd440);}(_0xaa88,0x137));var _0x8aa8=function(_0x488ca1,_0xf6858e){_0x488ca1=_0x488ca1-0x0;var _0x4dd0a4=_0xaa88[_0x488ca1];return _0x4dd0a4;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file +var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x48552c,_0x486e9b){var _0x7722a2=function(_0x238554){while(--_0x238554){_0x48552c['push'](_0x48552c['shift']());}};_0x7722a2(++_0x486e9b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xf44d98,_0x12a472){_0xf44d98=_0xf44d98-0x0;var _0x5ebb04=_0xcb91[_0xf44d98];return _0x5ebb04;};'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 f9b3cd9..182d16f 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 _0x437b=['filter','includeAll','include','findAll','catch','options','create','body','params','destroy','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','limit','count','set','apply','save','update','then','end','error','name','index','map','OpenchannelTransferReport','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type'];(function(_0x4fa438,_0x1f15a7){var _0x4e3958=function(_0x28f510){while(--_0x28f510){_0x4fa438['push'](_0x4fa438['shift']());}};_0x4e3958(++_0x1f15a7);}(_0x437b,0x98));var _0xb437=function(_0x4fdc46,_0x2a3759){_0x4fdc46=_0x4fdc46-0x0;var _0x2c178a=_0x437b[_0x4fdc46];return _0x2c178a;};'use strict';var emlformat=require(_0xb437('0x0'));var rimraf=require(_0xb437('0x1'));var zipdir=require(_0xb437('0x2'));var jsonpatch=require(_0xb437('0x3'));var rp=require(_0xb437('0x4'));var moment=require(_0xb437('0x5'));var BPromise=require(_0xb437('0x6'));var Mustache=require(_0xb437('0x7'));var util=require(_0xb437('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xb437('0x9'));var ejs=require(_0xb437('0xa'));var fs=require('fs');var fs_extra=require(_0xb437('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb437('0xc'));var deskjs=require(_0xb437('0xd'));var toCsv=require(_0xb437('0x9'));var querystring=require(_0xb437('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb437('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xb437('0x10'));var hardwareService=require(_0xb437('0x11'));var logger=require(_0xb437('0x12'))(_0xb437('0x13'));var utils=require(_0xb437('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xb437('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54ea46,_0x4e1924){_0x4e1924=_0x4e1924||0xcc;return function(_0x479ebb){if(_0x479ebb){return _0x54ea46[_0xb437('0x16')](_0x4e1924);}return _0x54ea46['status'](_0x4e1924)['end']();};}function respondWithResult(_0x2a3dca,_0x280860){_0x280860=_0x280860||0xc8;return function(_0x2d3536){if(_0x2d3536){return _0x2a3dca[_0xb437('0x17')](_0x280860)[_0xb437('0x18')](_0x2d3536);}};}function respondWithFilteredResult(_0x340792,_0x531c0c){return function(_0x26f62f){if(_0x26f62f){var _0x4792b1=typeof _0x531c0c[_0xb437('0x19')]==='undefined'&&typeof _0x531c0c[_0xb437('0x1a')]==='undefined';var _0x2cc5eb=_0x26f62f[_0xb437('0x1b')];var _0x4c3bf0=_0x4792b1?0x0:_0x531c0c['offset'];var _0xa37d32=_0x4792b1?_0x26f62f['count']:_0x531c0c['offset']+_0x531c0c[_0xb437('0x1a')];var _0x190d58;if(_0xa37d32>=_0x2cc5eb){_0xa37d32=_0x2cc5eb;_0x190d58=0xc8;}else{_0x190d58=0xce;}_0x340792[_0xb437('0x17')](_0x190d58);return _0x340792[_0xb437('0x1c')]('Content-Range',_0x4c3bf0+'-'+_0xa37d32+'/'+_0x2cc5eb)[_0xb437('0x18')](_0x26f62f);}return null;};}function patchUpdates(_0x1b9bc9){return function(_0x450b17){try{jsonpatch[_0xb437('0x1d')](_0x450b17,_0x1b9bc9,!![]);}catch(_0x3f3068){return BPromise['reject'](_0x3f3068);}return _0x450b17[_0xb437('0x1e')]();};}function saveUpdates(_0x53c604,_0x3e61f2){return function(_0x18304f){if(_0x18304f){return _0x18304f[_0xb437('0x1f')](_0x53c604)[_0xb437('0x20')](function(_0x474033){return _0x474033;});}return null;};}function removeEntity(_0x5ee6d3,_0x56e9dc){return function(_0xca77f7){if(_0xca77f7){return _0xca77f7['destroy']()[_0xb437('0x20')](function(){_0x5ee6d3[_0xb437('0x17')](0xcc)[_0xb437('0x21')]();});}};}function handleEntityNotFound(_0x1c9a5e,_0x31f9cd){return function(_0x4f0ee6){if(!_0x4f0ee6){_0x1c9a5e['sendStatus'](0x194);}return _0x4f0ee6;};}function handleError(_0x397b1e,_0x411226){_0x411226=_0x411226||0x1f4;return function(_0x4e42b9){logger[_0xb437('0x22')](_0x4e42b9['stack']);if(_0x4e42b9[_0xb437('0x23')]){delete _0x4e42b9[_0xb437('0x23')];}_0x397b1e[_0xb437('0x17')](_0x411226)['send'](_0x4e42b9);};}exports[_0xb437('0x24')]=function(_0x47557a,_0x2fa447){var _0x3ee29a={},_0x4a667e={},_0x5e3788={'count':0x0,'rows':[]};var _0x43f6a4=_[_0xb437('0x25')](db[_0xb437('0x26')][_0xb437('0x27')],function(_0x1416ee){return{'name':_0x1416ee[_0xb437('0x28')],'type':_0x1416ee['type'][_0xb437('0x29')]};});_0x4a667e['model']=_[_0xb437('0x25')](_0x43f6a4,_0xb437('0x23'));_0x4a667e[_0xb437('0x2a')]=_[_0xb437('0x2b')](_0x47557a[_0xb437('0x2a')]);_0x4a667e[_0xb437('0x2c')]=_[_0xb437('0x2d')](_0x4a667e[_0xb437('0x2e')],_0x4a667e['query']);_0x3ee29a[_0xb437('0x2f')]=_[_0xb437('0x2d')](_0x4a667e['model'],qs[_0xb437('0x30')](_0x47557a[_0xb437('0x2a')][_0xb437('0x30')]));_0x3ee29a['attributes']=_0x3ee29a[_0xb437('0x2f')][_0xb437('0x31')]?_0x3ee29a['attributes']:_0x4a667e['model'];if(!_0x47557a[_0xb437('0x2a')][_0xb437('0x32')](_0xb437('0x33'))){_0x3ee29a['limit']=qs[_0xb437('0x1a')](_0x47557a[_0xb437('0x2a')][_0xb437('0x1a')]);_0x3ee29a['offset']=qs[_0xb437('0x19')](_0x47557a[_0xb437('0x2a')]['offset']);}_0x3ee29a[_0xb437('0x34')]=qs['sort'](_0x47557a['query'][_0xb437('0x35')]);_0x3ee29a[_0xb437('0x36')]=qs[_0xb437('0x2c')](_[_0xb437('0x37')](_0x47557a[_0xb437('0x2a')],_0x4a667e[_0xb437('0x2c')]),_0x43f6a4);if(_0x47557a['query']['filter']){_0x3ee29a[_0xb437('0x36')]=_[_0xb437('0x38')](_0x3ee29a[_0xb437('0x36')],{'$or':_[_0xb437('0x25')](_0x43f6a4,function(_0x4656a7){if(_0x4656a7[_0xb437('0x39')]!=='VIRTUAL'){var _0x362684={};_0x362684[_0x4656a7[_0xb437('0x23')]]={'$like':'%'+_0x47557a[_0xb437('0x2a')][_0xb437('0x3a')]+'%'};return _0x362684;}})});}_0x3ee29a=_[_0xb437('0x38')]({},_0x3ee29a,_0x47557a['options']);var _0x5184e3={'where':_0x3ee29a['where']};return db[_0xb437('0x26')]['count'](_0x5184e3)[_0xb437('0x20')](function(_0x5d3aed){_0x5e3788['count']=_0x5d3aed;if(_0x47557a[_0xb437('0x2a')][_0xb437('0x3b')]){_0x3ee29a[_0xb437('0x3c')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0xb437('0x3d')](_0x3ee29a);})[_0xb437('0x20')](function(_0x1eef31){_0x5e3788['rows']=_0x1eef31;return _0x5e3788;})[_0xb437('0x20')](respondWithFilteredResult(_0x2fa447,_0x3ee29a))[_0xb437('0x3e')](handleError(_0x2fa447,null));};exports['show']=function(_0x856649,_0x15352b){var _0x44b43e={'raw':!![],'where':{'id':_0x856649['params']['id']}},_0x5c67dc={};_0x5c67dc[_0xb437('0x2e')]=_[_0xb437('0x2b')](db['OpenchannelTransferReport']['rawAttributes']);_0x5c67dc[_0xb437('0x2a')]=_[_0xb437('0x2b')](_0x856649[_0xb437('0x2a')]);_0x5c67dc[_0xb437('0x2c')]=_[_0xb437('0x2d')](_0x5c67dc[_0xb437('0x2e')],_0x5c67dc['query']);_0x44b43e['attributes']=_[_0xb437('0x2d')](_0x5c67dc[_0xb437('0x2e')],qs['fields'](_0x856649['query'][_0xb437('0x30')]));_0x44b43e[_0xb437('0x2f')]=_0x44b43e[_0xb437('0x2f')][_0xb437('0x31')]?_0x44b43e[_0xb437('0x2f')]:_0x5c67dc[_0xb437('0x2e')];if(_0x856649[_0xb437('0x2a')][_0xb437('0x3b')]){_0x44b43e[_0xb437('0x3c')]=[{'all':!![]}];}_0x44b43e=_[_0xb437('0x38')]({},_0x44b43e,_0x856649[_0xb437('0x3f')]);return db['OpenchannelTransferReport']['find'](_0x44b43e)[_0xb437('0x20')](handleEntityNotFound(_0x15352b,null))['then'](respondWithResult(_0x15352b,null))[_0xb437('0x3e')](handleError(_0x15352b,null));};exports[_0xb437('0x40')]=function(_0x119392,_0x4869dc){return db[_0xb437('0x26')][_0xb437('0x40')](_0x119392[_0xb437('0x41')],{})[_0xb437('0x20')](respondWithResult(_0x4869dc,0xc9))['catch'](handleError(_0x4869dc,null));};exports[_0xb437('0x1f')]=function(_0x5750ac,_0x279305){if(_0x5750ac[_0xb437('0x41')]['id']){delete _0x5750ac[_0xb437('0x41')]['id'];}return db[_0xb437('0x26')]['find']({'where':{'id':_0x5750ac[_0xb437('0x42')]['id']}})['then'](handleEntityNotFound(_0x279305,null))[_0xb437('0x20')](saveUpdates(_0x5750ac['body'],null))[_0xb437('0x20')](respondWithResult(_0x279305,null))[_0xb437('0x3e')](handleError(_0x279305,null));};exports[_0xb437('0x43')]=function(_0x33de80,_0x3df85a){return db[_0xb437('0x26')][_0xb437('0x44')]({'where':{'id':_0x33de80[_0xb437('0x42')]['id']}})[_0xb437('0x20')](handleEntityNotFound(_0x3df85a,null))[_0xb437('0x20')](removeEntity(_0x3df85a,null))[_0xb437('0x3e')](handleError(_0x3df85a,null));};exports[_0xb437('0x45')]=function(_0x7713fe,_0xb8c333){return db[_0xb437('0x26')][_0xb437('0x45')]()[_0xb437('0x20')](respondWithResult(_0xb8c333,null))[_0xb437('0x3e')](handleError(_0xb8c333,null));}; \ No newline at end of file +var _0x2dc7=['options','OpenchannelTransferReport','count','includeAll','include','findAll','catch','show','params','rawAttributes','create','body','find','destroy','describe','eml-format','rimraf','moment','mustache','util','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','set','json','apply','reject','save','update','then','end','error','stack','name','send','map','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge'];(function(_0x16e5b3,_0x30d91d){var _0x4d6874=function(_0x2fffbe){while(--_0x2fffbe){_0x16e5b3['push'](_0x16e5b3['shift']());}};_0x4d6874(++_0x30d91d);}(_0x2dc7,0xe1));var _0x72dc=function(_0x4914e2,_0x48be8f){_0x4914e2=_0x4914e2-0x0;var _0x2dcd07=_0x2dc7[_0x4914e2];return _0x2dcd07;};'use strict';var emlformat=require(_0x72dc('0x0'));var rimraf=require(_0x72dc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x72dc('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x72dc('0x3'));var util=require(_0x72dc('0x4'));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(_0x72dc('0x5'));var _=require('lodash');var squel=require(_0x72dc('0x6'));var crypto=require(_0x72dc('0x7'));var jsforce=require(_0x72dc('0x8'));var deskjs=require(_0x72dc('0x9'));var toCsv=require(_0x72dc('0xa'));var querystring=require(_0x72dc('0xb'));var Papa=require(_0x72dc('0xc'));var Redis=require('ioredis');var authService=require(_0x72dc('0xd'));var qs=require(_0x72dc('0xe'));var as=require(_0x72dc('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x72dc('0x10'));var config=require(_0x72dc('0x11'));var licenseUtil=require(_0x72dc('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x491c0c,_0xc90dd5){_0xc90dd5=_0xc90dd5||0xcc;return function(_0x25cd09){if(_0x25cd09){return _0x491c0c[_0x72dc('0x13')](_0xc90dd5);}return _0x491c0c[_0x72dc('0x14')](_0xc90dd5)['end']();};}function respondWithResult(_0x21f693,_0x13ddd5){_0x13ddd5=_0x13ddd5||0xc8;return function(_0xbc07d9){if(_0xbc07d9){return _0x21f693[_0x72dc('0x14')](_0x13ddd5)['json'](_0xbc07d9);}};}function respondWithFilteredResult(_0x851045,_0x44e638){return function(_0x35c8c9){if(_0x35c8c9){var _0x51dd4f=typeof _0x44e638[_0x72dc('0x15')]===_0x72dc('0x16')&&typeof _0x44e638['limit']===_0x72dc('0x16');var _0x553295=_0x35c8c9['count'];var _0x258b62=_0x51dd4f?0x0:_0x44e638['offset'];var _0x2f37ea=_0x51dd4f?_0x35c8c9['count']:_0x44e638[_0x72dc('0x15')]+_0x44e638['limit'];var _0x642adc;if(_0x2f37ea>=_0x553295){_0x2f37ea=_0x553295;_0x642adc=0xc8;}else{_0x642adc=0xce;}_0x851045[_0x72dc('0x14')](_0x642adc);return _0x851045[_0x72dc('0x17')]('Content-Range',_0x258b62+'-'+_0x2f37ea+'/'+_0x553295)[_0x72dc('0x18')](_0x35c8c9);}return null;};}function patchUpdates(_0x458598){return function(_0x58afa8){try{jsonpatch[_0x72dc('0x19')](_0x58afa8,_0x458598,!![]);}catch(_0x1ba6f6){return BPromise[_0x72dc('0x1a')](_0x1ba6f6);}return _0x58afa8[_0x72dc('0x1b')]();};}function saveUpdates(_0x23ee47,_0x57972a){return function(_0x255f62){if(_0x255f62){return _0x255f62[_0x72dc('0x1c')](_0x23ee47)['then'](function(_0x2d6642){return _0x2d6642;});}return null;};}function removeEntity(_0x101220,_0x4823bf){return function(_0x3522b0){if(_0x3522b0){return _0x3522b0['destroy']()[_0x72dc('0x1d')](function(){_0x101220['status'](0xcc)[_0x72dc('0x1e')]();});}};}function handleEntityNotFound(_0x543cd3,_0x337900){return function(_0x11173c){if(!_0x11173c){_0x543cd3[_0x72dc('0x13')](0x194);}return _0x11173c;};}function handleError(_0x4beade,_0x8dc46f){_0x8dc46f=_0x8dc46f||0x1f4;return function(_0x4ee26b){logger[_0x72dc('0x1f')](_0x4ee26b[_0x72dc('0x20')]);if(_0x4ee26b[_0x72dc('0x21')]){delete _0x4ee26b[_0x72dc('0x21')];}_0x4beade[_0x72dc('0x14')](_0x8dc46f)[_0x72dc('0x22')](_0x4ee26b);};}exports['index']=function(_0x1382b3,_0x447037){var _0x5a5a70={},_0x255146={},_0x4dd7b3={'count':0x0,'rows':[]};var _0x3d7156=_[_0x72dc('0x23')](db['OpenchannelTransferReport']['rawAttributes'],function(_0x58b128){return{'name':_0x58b128['fieldName'],'type':_0x58b128[_0x72dc('0x24')][_0x72dc('0x25')]};});_0x255146[_0x72dc('0x26')]=_[_0x72dc('0x23')](_0x3d7156,_0x72dc('0x21'));_0x255146[_0x72dc('0x27')]=_[_0x72dc('0x28')](_0x1382b3[_0x72dc('0x27')]);_0x255146[_0x72dc('0x29')]=_[_0x72dc('0x2a')](_0x255146[_0x72dc('0x26')],_0x255146[_0x72dc('0x27')]);_0x5a5a70[_0x72dc('0x2b')]=_[_0x72dc('0x2a')](_0x255146[_0x72dc('0x26')],qs[_0x72dc('0x2c')](_0x1382b3['query'][_0x72dc('0x2c')]));_0x5a5a70[_0x72dc('0x2b')]=_0x5a5a70['attributes'][_0x72dc('0x2d')]?_0x5a5a70[_0x72dc('0x2b')]:_0x255146[_0x72dc('0x26')];if(!_0x1382b3[_0x72dc('0x27')]['hasOwnProperty'](_0x72dc('0x2e'))){_0x5a5a70['limit']=qs['limit'](_0x1382b3[_0x72dc('0x27')][_0x72dc('0x2f')]);_0x5a5a70[_0x72dc('0x15')]=qs[_0x72dc('0x15')](_0x1382b3[_0x72dc('0x27')]['offset']);}_0x5a5a70[_0x72dc('0x30')]=qs[_0x72dc('0x31')](_0x1382b3['query'][_0x72dc('0x31')]);_0x5a5a70[_0x72dc('0x32')]=qs[_0x72dc('0x29')](_[_0x72dc('0x33')](_0x1382b3[_0x72dc('0x27')],_0x255146[_0x72dc('0x29')]),_0x3d7156);if(_0x1382b3[_0x72dc('0x27')][_0x72dc('0x34')]){_0x5a5a70[_0x72dc('0x32')]=_['merge'](_0x5a5a70['where'],{'$or':_[_0x72dc('0x23')](_0x3d7156,function(_0x1e8acf){if(_0x1e8acf[_0x72dc('0x24')]!==_0x72dc('0x35')){var _0x3486e6={};_0x3486e6[_0x1e8acf['name']]={'$like':'%'+_0x1382b3[_0x72dc('0x27')][_0x72dc('0x34')]+'%'};return _0x3486e6;}})});}_0x5a5a70=_[_0x72dc('0x36')]({},_0x5a5a70,_0x1382b3[_0x72dc('0x37')]);var _0x57f616={'where':_0x5a5a70[_0x72dc('0x32')]};return db[_0x72dc('0x38')][_0x72dc('0x39')](_0x57f616)[_0x72dc('0x1d')](function(_0x2dbc67){_0x4dd7b3[_0x72dc('0x39')]=_0x2dbc67;if(_0x1382b3['query'][_0x72dc('0x3a')]){_0x5a5a70[_0x72dc('0x3b')]=[{'all':!![]}];}return db[_0x72dc('0x38')][_0x72dc('0x3c')](_0x5a5a70);})[_0x72dc('0x1d')](function(_0x27245c){_0x4dd7b3['rows']=_0x27245c;return _0x4dd7b3;})[_0x72dc('0x1d')](respondWithFilteredResult(_0x447037,_0x5a5a70))[_0x72dc('0x3d')](handleError(_0x447037,null));};exports[_0x72dc('0x3e')]=function(_0xc5ffa3,_0x5544c2){var _0x515492={'raw':!![],'where':{'id':_0xc5ffa3[_0x72dc('0x3f')]['id']}},_0x3d3b51={};_0x3d3b51[_0x72dc('0x26')]=_['keys'](db[_0x72dc('0x38')][_0x72dc('0x40')]);_0x3d3b51['query']=_[_0x72dc('0x28')](_0xc5ffa3[_0x72dc('0x27')]);_0x3d3b51[_0x72dc('0x29')]=_['intersection'](_0x3d3b51[_0x72dc('0x26')],_0x3d3b51[_0x72dc('0x27')]);_0x515492[_0x72dc('0x2b')]=_[_0x72dc('0x2a')](_0x3d3b51[_0x72dc('0x26')],qs[_0x72dc('0x2c')](_0xc5ffa3[_0x72dc('0x27')][_0x72dc('0x2c')]));_0x515492['attributes']=_0x515492[_0x72dc('0x2b')][_0x72dc('0x2d')]?_0x515492['attributes']:_0x3d3b51[_0x72dc('0x26')];if(_0xc5ffa3[_0x72dc('0x27')][_0x72dc('0x3a')]){_0x515492[_0x72dc('0x3b')]=[{'all':!![]}];}_0x515492=_[_0x72dc('0x36')]({},_0x515492,_0xc5ffa3['options']);return db[_0x72dc('0x38')]['find'](_0x515492)[_0x72dc('0x1d')](handleEntityNotFound(_0x5544c2,null))[_0x72dc('0x1d')](respondWithResult(_0x5544c2,null))['catch'](handleError(_0x5544c2,null));};exports[_0x72dc('0x41')]=function(_0x4d49af,_0x2f7863){return db['OpenchannelTransferReport'][_0x72dc('0x41')](_0x4d49af[_0x72dc('0x42')],{})[_0x72dc('0x1d')](respondWithResult(_0x2f7863,0xc9))[_0x72dc('0x3d')](handleError(_0x2f7863,null));};exports['update']=function(_0x3f5c2f,_0x55bbaf){if(_0x3f5c2f[_0x72dc('0x42')]['id']){delete _0x3f5c2f[_0x72dc('0x42')]['id'];}return db[_0x72dc('0x38')][_0x72dc('0x43')]({'where':{'id':_0x3f5c2f[_0x72dc('0x3f')]['id']}})[_0x72dc('0x1d')](handleEntityNotFound(_0x55bbaf,null))[_0x72dc('0x1d')](saveUpdates(_0x3f5c2f[_0x72dc('0x42')],null))[_0x72dc('0x1d')](respondWithResult(_0x55bbaf,null))[_0x72dc('0x3d')](handleError(_0x55bbaf,null));};exports[_0x72dc('0x44')]=function(_0x4ad5e6,_0x2f9d7f){return db[_0x72dc('0x38')][_0x72dc('0x43')]({'where':{'id':_0x4ad5e6['params']['id']}})['then'](handleEntityNotFound(_0x2f9d7f,null))[_0x72dc('0x1d')](removeEntity(_0x2f9d7f,null))['catch'](handleError(_0x2f9d7f,null));};exports[_0x72dc('0x45')]=function(_0x52fad1,_0x605866){return db[_0x72dc('0x38')][_0x72dc('0x45')]()[_0x72dc('0x1d')](respondWithResult(_0x605866,null))[_0x72dc('0x3d')](handleError(_0x605866,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index ce8e0ee..946baf0 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 _0xde16=['util','../../config/logger','moment','bluebird','request-promise','./openchannelTransferReport.attributes','define','uniqueid','lodash'];(function(_0x3c28cd,_0x520218){var _0x9f4f46=function(_0x4a441e){while(--_0x4a441e){_0x3c28cd['push'](_0x3c28cd['shift']());}};_0x9f4f46(++_0x520218);}(_0xde16,0x1a6));var _0x6de1=function(_0x5d5d49,_0x377be7){_0x5d5d49=_0x5d5d49-0x0;var _0x2dea8e=_0xde16[_0x5d5d49];return _0x2dea8e;};'use strict';var _=require(_0x6de1('0x0'));var util=require(_0x6de1('0x1'));var logger=require(_0x6de1('0x2'))('api');var moment=require(_0x6de1('0x3'));var BPromise=require(_0x6de1('0x4'));var rp=require(_0x6de1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6de1('0x6'));module['exports']=function(_0x24fd7c,_0x32529f){return _0x24fd7c[_0x6de1('0x7')]('OpenchannelTransferReport',attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x6de1('0x8'),'fields':[_0x6de1('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb413=['exports','define','report_openchannel_transfer','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4a7c4d,_0x1d7006){var _0x465117=function(_0x113e89){while(--_0x113e89){_0x4a7c4d['push'](_0x4a7c4d['shift']());}};_0x465117(++_0x1d7006);}(_0xb413,0x85));var _0x3b41=function(_0x2d0edf,_0x5e73f8){_0x2d0edf=_0x2d0edf-0x0;var _0x5228b3=_0xb413[_0x2d0edf];return _0x5228b3;};'use strict';var _=require(_0x3b41('0x0'));var util=require(_0x3b41('0x1'));var logger=require(_0x3b41('0x2'))(_0x3b41('0x3'));var moment=require(_0x3b41('0x4'));var BPromise=require(_0x3b41('0x5'));var rp=require(_0x3b41('0x6'));var fs=require('fs');var path=require(_0x3b41('0x7'));var rimraf=require(_0x3b41('0x8'));var config=require(_0x3b41('0x9'));var attributes=require('./openchannelTransferReport.attributes');module[_0x3b41('0xa')]=function(_0x40ba20,_0x70c231){return _0x40ba20[_0x3b41('0xb')]('OpenchannelTransferReport',attributes,{'tableName':_0x3b41('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index ba08b4f..6f3cde4 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 _0x7da7=['../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','ioredis'];(function(_0x1e5689,_0x278527){var _0x3d244f=function(_0x194255){while(--_0x194255){_0x1e5689['push'](_0x1e5689['shift']());}};_0x3d244f(++_0x278527);}(_0x7da7,0x10d));var _0x77da=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x7da7[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var moment=require(_0x77da('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x77da('0x3'));var db=require(_0x77da('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x77da('0x5'))(_0x77da('0x6'));var config=require('../../config/environment');var jayson=require(_0x77da('0x7'));var client=jayson[_0x77da('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30afe0,_0x47cf1d,_0x1191de){return new BPromise(function(_0x13992e,_0x37c5ab){return client[_0x77da('0x9')](_0x30afe0,_0x1191de)[_0x77da('0xa')](function(_0x58f3fe){logger[_0x77da('0xb')](_0x77da('0xc'),_0x47cf1d,_0x77da('0xd'));logger['debug'](_0x77da('0xe'),_0x47cf1d,_0x77da('0xd'),JSON[_0x77da('0xf')](_0x58f3fe));if(_0x58f3fe[_0x77da('0x10')]){if(_0x58f3fe['error'][_0x77da('0x11')]===0x1f4){logger[_0x77da('0x10')](_0x77da('0xc'),_0x47cf1d,_0x58f3fe['error']['message']);return _0x37c5ab(_0x58f3fe[_0x77da('0x10')][_0x77da('0x12')]);}logger['error'](_0x77da('0xc'),_0x47cf1d,_0x58f3fe[_0x77da('0x10')][_0x77da('0x12')]);return _0x13992e(_0x58f3fe[_0x77da('0x10')]['message']);}else{logger[_0x77da('0xb')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x47cf1d,_0x77da('0xd'));_0x13992e(_0x58f3fe[_0x77da('0x13')][_0x77da('0x12')]);}})[_0x77da('0x14')](function(_0x4ecd98){logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x47cf1d,_0x4ecd98);_0x37c5ab(_0x4ecd98);});});} \ No newline at end of file +var _0xe0c3=['code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x4835aa,_0x4a327b){var _0x5fc2a2=function(_0x564a5a){while(--_0x564a5a){_0x4835aa['push'](_0x4835aa['shift']());}};_0x5fc2a2(++_0x4a327b);}(_0xe0c3,0xea));var _0x3e0c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe0c3[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x3e0c('0x0'));var util=require('util');var moment=require(_0x3e0c('0x1'));var BPromise=require(_0x3e0c('0x2'));var rs=require(_0x3e0c('0x3'));var fs=require('fs');var Redis=require(_0x3e0c('0x4'));var db=require(_0x3e0c('0x5'))['db'];var utils=require(_0x3e0c('0x6'));var logger=require(_0x3e0c('0x7'))(_0x3e0c('0x8'));var config=require(_0x3e0c('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3e0c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e339a,_0x3f6607,_0x243b5b){return new BPromise(function(_0x29673d,_0x2d2c39){return client[_0x3e0c('0xb')](_0x1e339a,_0x243b5b)[_0x3e0c('0xc')](function(_0x13ac88){logger[_0x3e0c('0xd')](_0x3e0c('0xe'),_0x3f6607,'request\x20sent');logger['debug'](_0x3e0c('0xf'),_0x3f6607,_0x3e0c('0x10'),JSON[_0x3e0c('0x11')](_0x13ac88));if(_0x13ac88[_0x3e0c('0x12')]){if(_0x13ac88[_0x3e0c('0x12')][_0x3e0c('0x13')]===0x1f4){logger[_0x3e0c('0x12')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x3f6607,_0x13ac88[_0x3e0c('0x12')]['message']);return _0x2d2c39(_0x13ac88[_0x3e0c('0x12')][_0x3e0c('0x14')]);}logger['error'](_0x3e0c('0xe'),_0x3f6607,_0x13ac88[_0x3e0c('0x12')][_0x3e0c('0x14')]);return _0x29673d(_0x13ac88[_0x3e0c('0x12')][_0x3e0c('0x14')]);}else{logger[_0x3e0c('0xd')](_0x3e0c('0xe'),_0x3f6607,_0x3e0c('0x10'));_0x29673d(_0x13ac88[_0x3e0c('0x15')][_0x3e0c('0x14')]);}})[_0x3e0c('0x16')](function(_0x1f8e71){logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x3f6607,_0x1f8e71);_0x2d2c39(_0x1f8e71);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 0862e4d..2a0913e 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 _0x1872=['../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','fs-extra'];(function(_0xab7f84,_0x383958){var _0x705780=function(_0x3f1595){while(--_0x3f1595){_0xab7f84['push'](_0xab7f84['shift']());}};_0x705780(++_0x383958);}(_0x1872,0xa6));var _0x2187=function(_0x5272b2,_0x59f060){_0x5272b2=_0x5272b2-0x0;var _0x2ca6c5=_0x1872[_0x5272b2];return _0x2ca6c5;};'use strict';var multer=require(_0x2187('0x0'));var util=require(_0x2187('0x1'));var path=require(_0x2187('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x2187('0x3'));var auth=require(_0x2187('0x4'));var interaction=require(_0x2187('0x5'));var config=require(_0x2187('0x6'));var controller=require('./pause.controller');router['get']('/',auth[_0x2187('0x7')](),controller[_0x2187('0x8')]);router['get'](_0x2187('0x9'),auth[_0x2187('0x7')](),controller[_0x2187('0xa')]);router[_0x2187('0xb')]('/',auth[_0x2187('0x7')](),controller[_0x2187('0xc')]);router[_0x2187('0xd')](_0x2187('0x9'),auth[_0x2187('0x7')](),controller['update']);router[_0x2187('0xe')](_0x2187('0x9'),auth[_0x2187('0x7')](),controller[_0x2187('0xf')]);module[_0x2187('0x10')]=router; \ No newline at end of file +var _0xbed9=['fs-extra','../../components/auth/service','./pause.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0xbed9,0x7a));var _0x9bed=function(_0x8dcd6,_0x3102ec){_0x8dcd6=_0x8dcd6-0x0;var _0x5a705a=_0xbed9[_0x8dcd6];return _0x5a705a;};'use strict';var multer=require(_0x9bed('0x0'));var util=require(_0x9bed('0x1'));var path=require('path');var timeout=require(_0x9bed('0x2'));var express=require(_0x9bed('0x3'));var router=express['Router']();var fs_extra=require(_0x9bed('0x4'));var auth=require(_0x9bed('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9bed('0x6'));router[_0x9bed('0x7')]('/',auth[_0x9bed('0x8')](),controller['index']);router['get'](_0x9bed('0x9'),auth[_0x9bed('0x8')](),controller[_0x9bed('0xa')]);router[_0x9bed('0xb')]('/',auth['isAuthenticated'](),controller[_0x9bed('0xc')]);router[_0x9bed('0xd')](_0x9bed('0x9'),auth[_0x9bed('0x8')](),controller[_0x9bed('0xe')]);router[_0x9bed('0xf')]('/:id',auth[_0x9bed('0x8')](),controller[_0x9bed('0x10')]);module[_0x9bed('0x11')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index d6440c9..be00506 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 _0x307b=['name','sequelize','exports','STRING'];(function(_0x367862,_0x40888a){var _0x38b713=function(_0x31c3f9){while(--_0x31c3f9){_0x367862['push'](_0x367862['shift']());}};_0x38b713(++_0x40888a);}(_0x307b,0x115));var _0xb307=function(_0x59bf4f,_0x5c99bc){_0x59bf4f=_0x59bf4f-0x0;var _0x488cd6=_0x307b[_0x59bf4f];return _0x488cd6;};'use strict';var Sequelize=require(_0xb307('0x0'));module[_0xb307('0x1')]={'name':{'type':Sequelize[_0xb307('0x2')],'unique':_0xb307('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5a16=['name','sequelize','STRING'];(function(_0x12c6db,_0x18acba){var _0x38b19b=function(_0x8b5b8){while(--_0x8b5b8){_0x12c6db['push'](_0x12c6db['shift']());}};_0x38b19b(++_0x18acba);}(_0x5a16,0x157));var _0x65a1=function(_0x1d04b5,_0x30792c){_0x1d04b5=_0x1d04b5-0x0;var _0x161342=_0x5a16[_0x1d04b5];return _0x161342;};'use strict';var Sequelize=require(_0x65a1('0x0'));module['exports']={'name':{'type':Sequelize[_0x65a1('0x1')],'unique':_0x65a1('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x65a1('0x1')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 9e1af34..75dac30 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 _0xc4f8=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','limit','undefined','count','offset','status','set','Content-Range','apply','reject','save','then','Pauses','UserProfileResource','sendStatus','stack','name','index','map','Pause','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','params','rawAttributes','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','error'];(function(_0x402282,_0x615de3){var _0x4f65af=function(_0x4a20f7){while(--_0x4a20f7){_0x402282['push'](_0x402282['shift']());}};_0x4f65af(++_0x615de3);}(_0xc4f8,0x1dd));var _0x8c4f=function(_0x242659,_0x35ea81){_0x242659=_0x242659-0x0;var _0x1d5a3d=_0xc4f8[_0x242659];return _0x1d5a3d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8c4f('0x0'));var zipdir=require(_0x8c4f('0x1'));var jsonpatch=require(_0x8c4f('0x2'));var rp=require(_0x8c4f('0x3'));var moment=require('moment');var BPromise=require(_0x8c4f('0x4'));var Mustache=require(_0x8c4f('0x5'));var util=require(_0x8c4f('0x6'));var path=require(_0x8c4f('0x7'));var sox=require(_0x8c4f('0x8'));var csv=require(_0x8c4f('0x9'));var ejs=require(_0x8c4f('0xa'));var fs=require('fs');var fs_extra=require(_0x8c4f('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8c4f('0x9'));var querystring=require(_0x8c4f('0xc'));var Papa=require(_0x8c4f('0xd'));var Redis=require(_0x8c4f('0xe'));var authService=require(_0x8c4f('0xf'));var qs=require(_0x8c4f('0x10'));var as=require(_0x8c4f('0x11'));var hardwareService=require(_0x8c4f('0x12'));var logger=require(_0x8c4f('0x13'))(_0x8c4f('0x14'));var utils=require(_0x8c4f('0x15'));var config=require(_0x8c4f('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x8c4f('0x17'))['db'];function respondWithStatusCode(_0x49218b,_0x29243d){_0x29243d=_0x29243d||0xcc;return function(_0x7e9499){if(_0x7e9499){return _0x49218b['sendStatus'](_0x29243d);}return _0x49218b['status'](_0x29243d)[_0x8c4f('0x18')]();};}function respondWithResult(_0x35ac0d,_0x3b850b){_0x3b850b=_0x3b850b||0xc8;return function(_0xa2aba0){if(_0xa2aba0){return _0x35ac0d['status'](_0x3b850b)['json'](_0xa2aba0);}};}function respondWithFilteredResult(_0x512147,_0x1cfed8){return function(_0xf49aed){if(_0xf49aed){var _0xbb51cc=typeof _0x1cfed8['offset']==='undefined'&&typeof _0x1cfed8[_0x8c4f('0x19')]===_0x8c4f('0x1a');var _0x5f2592=_0xf49aed[_0x8c4f('0x1b')];var _0x32a4ae=_0xbb51cc?0x0:_0x1cfed8[_0x8c4f('0x1c')];var _0xbb3b20=_0xbb51cc?_0xf49aed[_0x8c4f('0x1b')]:_0x1cfed8[_0x8c4f('0x1c')]+_0x1cfed8[_0x8c4f('0x19')];var _0x3f2433;if(_0xbb3b20>=_0x5f2592){_0xbb3b20=_0x5f2592;_0x3f2433=0xc8;}else{_0x3f2433=0xce;}_0x512147[_0x8c4f('0x1d')](_0x3f2433);return _0x512147[_0x8c4f('0x1e')](_0x8c4f('0x1f'),_0x32a4ae+'-'+_0xbb3b20+'/'+_0x5f2592)['json'](_0xf49aed);}return null;};}function patchUpdates(_0x16cf66){return function(_0x4ef4cd){try{jsonpatch[_0x8c4f('0x20')](_0x4ef4cd,_0x16cf66,!![]);}catch(_0x508ff6){return BPromise[_0x8c4f('0x21')](_0x508ff6);}return _0x4ef4cd[_0x8c4f('0x22')]();};}function saveUpdates(_0x304ce2,_0x128e88){return function(_0xb828ed){if(_0xb828ed){return _0xb828ed['update'](_0x304ce2)[_0x8c4f('0x23')](function(_0x5c6046){return _0x5c6046;});}return null;};}function removeEntity(_0xabc987,_0x2e956e){return function(_0x4656c8){if(_0x4656c8){return _0x4656c8['destroy']()[_0x8c4f('0x23')](function(){var _0x271604=_0x4656c8['get']({'plain':!![]});var _0x3f3d0f=_0x8c4f('0x24');return db[_0x8c4f('0x25')]['destroy']({'where':{'type':_0x3f3d0f,'resourceId':_0x271604['id']}})[_0x8c4f('0x23')](function(){return _0x4656c8;});})[_0x8c4f('0x23')](function(){_0xabc987[_0x8c4f('0x1d')](0xcc)[_0x8c4f('0x18')]();});}};}function handleEntityNotFound(_0x5181e4,_0x1f7265){return function(_0x5e1d49){if(!_0x5e1d49){_0x5181e4[_0x8c4f('0x26')](0x194);}return _0x5e1d49;};}function handleError(_0x207821,_0x348551){_0x348551=_0x348551||0x1f4;return function(_0x3024cf){logger['error'](_0x3024cf[_0x8c4f('0x27')]);if(_0x3024cf[_0x8c4f('0x28')]){delete _0x3024cf[_0x8c4f('0x28')];}_0x207821['status'](_0x348551)['send'](_0x3024cf);};}exports[_0x8c4f('0x29')]=function(_0x1d0729,_0x19ee3a){var _0x53a168={},_0x2994d8={},_0x3e830e={'count':0x0,'rows':[]};var _0x5039b5=_[_0x8c4f('0x2a')](db[_0x8c4f('0x2b')]['rawAttributes'],function(_0x5692c4){return{'name':_0x5692c4[_0x8c4f('0x2c')],'type':_0x5692c4[_0x8c4f('0x2d')][_0x8c4f('0x2e')]};});_0x2994d8['model']=_[_0x8c4f('0x2a')](_0x5039b5,_0x8c4f('0x28'));_0x2994d8[_0x8c4f('0x2f')]=_[_0x8c4f('0x30')](_0x1d0729[_0x8c4f('0x2f')]);_0x2994d8[_0x8c4f('0x31')]=_[_0x8c4f('0x32')](_0x2994d8[_0x8c4f('0x33')],_0x2994d8[_0x8c4f('0x2f')]);_0x53a168['attributes']=_[_0x8c4f('0x32')](_0x2994d8['model'],qs[_0x8c4f('0x34')](_0x1d0729['query'][_0x8c4f('0x34')]));_0x53a168[_0x8c4f('0x35')]=_0x53a168[_0x8c4f('0x35')]['length']?_0x53a168['attributes']:_0x2994d8[_0x8c4f('0x33')];if(!_0x1d0729[_0x8c4f('0x2f')]['hasOwnProperty'](_0x8c4f('0x36'))){_0x53a168[_0x8c4f('0x19')]=qs[_0x8c4f('0x19')](_0x1d0729[_0x8c4f('0x2f')][_0x8c4f('0x19')]);_0x53a168['offset']=qs[_0x8c4f('0x1c')](_0x1d0729[_0x8c4f('0x2f')][_0x8c4f('0x1c')]);}_0x53a168[_0x8c4f('0x37')]=qs[_0x8c4f('0x38')](_0x1d0729[_0x8c4f('0x2f')][_0x8c4f('0x38')]);_0x53a168[_0x8c4f('0x39')]=qs[_0x8c4f('0x31')](_[_0x8c4f('0x3a')](_0x1d0729[_0x8c4f('0x2f')],_0x2994d8[_0x8c4f('0x31')]),_0x5039b5);if(_0x1d0729[_0x8c4f('0x2f')][_0x8c4f('0x3b')]){_0x53a168[_0x8c4f('0x39')]=_[_0x8c4f('0x3c')](_0x53a168[_0x8c4f('0x39')],{'$or':_[_0x8c4f('0x2a')](_0x5039b5,function(_0x3535f6){if(_0x3535f6[_0x8c4f('0x2d')]!=='VIRTUAL'){var _0x2168e9={};_0x2168e9[_0x3535f6[_0x8c4f('0x28')]]={'$like':'%'+_0x1d0729[_0x8c4f('0x2f')][_0x8c4f('0x3b')]+'%'};return _0x2168e9;}})});}_0x53a168=_[_0x8c4f('0x3c')]({},_0x53a168,_0x1d0729[_0x8c4f('0x3d')]);var _0x2dc324={'where':_0x53a168[_0x8c4f('0x39')]};return db['Pause'][_0x8c4f('0x1b')](_0x2dc324)['then'](function(_0x5d338f){_0x3e830e['count']=_0x5d338f;if(_0x1d0729[_0x8c4f('0x2f')][_0x8c4f('0x3e')]){_0x53a168[_0x8c4f('0x3f')]=[{'all':!![]}];}return db['Pause'][_0x8c4f('0x40')](_0x53a168);})[_0x8c4f('0x23')](function(_0x13f1ab){_0x3e830e['rows']=_0x13f1ab;return _0x3e830e;})[_0x8c4f('0x23')](respondWithFilteredResult(_0x19ee3a,_0x53a168))['catch'](handleError(_0x19ee3a,null));};exports['show']=function(_0x3c9d62,_0x3d362e){var _0x2e9562={'raw':!![],'where':{'id':_0x3c9d62[_0x8c4f('0x41')]['id']}},_0x25e595={};_0x25e595[_0x8c4f('0x33')]=_['keys'](db[_0x8c4f('0x2b')][_0x8c4f('0x42')]);_0x25e595[_0x8c4f('0x2f')]=_[_0x8c4f('0x30')](_0x3c9d62[_0x8c4f('0x2f')]);_0x25e595['filters']=_[_0x8c4f('0x32')](_0x25e595[_0x8c4f('0x33')],_0x25e595['query']);_0x2e9562['attributes']=_[_0x8c4f('0x32')](_0x25e595['model'],qs[_0x8c4f('0x34')](_0x3c9d62['query'][_0x8c4f('0x34')]));_0x2e9562[_0x8c4f('0x35')]=_0x2e9562[_0x8c4f('0x35')]['length']?_0x2e9562['attributes']:_0x25e595['model'];if(_0x3c9d62[_0x8c4f('0x2f')][_0x8c4f('0x3e')]){_0x2e9562[_0x8c4f('0x3f')]=[{'all':!![]}];}_0x2e9562=_[_0x8c4f('0x3c')]({},_0x2e9562,_0x3c9d62[_0x8c4f('0x3d')]);return db[_0x8c4f('0x2b')][_0x8c4f('0x43')](_0x2e9562)['then'](handleEntityNotFound(_0x3d362e,null))['then'](respondWithResult(_0x3d362e,null))[_0x8c4f('0x44')](handleError(_0x3d362e,null));};exports['create']=function(_0x3e4342,_0x5e5784){return db[_0x8c4f('0x2b')][_0x8c4f('0x45')](_0x3e4342[_0x8c4f('0x46')],{})[_0x8c4f('0x23')](function(_0x3e0d24){var _0x13d21f=_0x3e4342[_0x8c4f('0x47')][_0x8c4f('0x48')]({'plain':!![]});if(!_0x13d21f)throw new Error(_0x8c4f('0x49'));if(_0x13d21f['role']===_0x8c4f('0x47')){var _0x3bdd50=_0x3e0d24[_0x8c4f('0x48')]({'plain':!![]});var _0x18326a='Pauses';return db['UserProfileSection'][_0x8c4f('0x43')]({'where':{'name':_0x18326a,'userProfileId':_0x13d21f[_0x8c4f('0x4a')]},'raw':!![]})[_0x8c4f('0x23')](function(_0x2243ab){if(_0x2243ab&&_0x2243ab['autoAssociation']===0x0){return db[_0x8c4f('0x25')][_0x8c4f('0x45')]({'name':_0x3bdd50['name'],'resourceId':_0x3bdd50['id'],'type':_0x2243ab[_0x8c4f('0x28')],'sectionId':_0x2243ab['id']},{})[_0x8c4f('0x23')](function(){return _0x3e0d24;});}else{return _0x3e0d24;}})[_0x8c4f('0x44')](function(_0x535be0){logger[_0x8c4f('0x4b')](_0x8c4f('0x4c'),_0x535be0);throw _0x535be0;});}return _0x3e0d24;})[_0x8c4f('0x23')](respondWithResult(_0x5e5784,0xc9))[_0x8c4f('0x44')](handleError(_0x5e5784,null));};exports[_0x8c4f('0x4d')]=function(_0xe428ab,_0xaed47a){if(_0xe428ab['body']['id']){delete _0xe428ab[_0x8c4f('0x46')]['id'];}return db['Pause'][_0x8c4f('0x43')]({'where':{'id':_0xe428ab[_0x8c4f('0x41')]['id']}})[_0x8c4f('0x23')](handleEntityNotFound(_0xaed47a,null))[_0x8c4f('0x23')](saveUpdates(_0xe428ab[_0x8c4f('0x46')],null))['then'](respondWithResult(_0xaed47a,null))['catch'](handleError(_0xaed47a,null));};exports[_0x8c4f('0x4e')]=function(_0x5cffd2,_0x19bcb1){return db[_0x8c4f('0x2b')][_0x8c4f('0x43')]({'where':{'id':_0x5cffd2[_0x8c4f('0x41')]['id']}})[_0x8c4f('0x23')](handleEntityNotFound(_0x19bcb1,null))[_0x8c4f('0x23')](removeEntity(_0x19bcb1,null))[_0x8c4f('0x44')](handleError(_0x19bcb1,null));}; \ No newline at end of file +var _0x008e=['VIRTUAL','options','Pause','includeAll','include','rows','catch','show','params','keys','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','moment','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/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','Pauses','UserProfileResource','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x008e,0xc5));var _0xe008=function(_0x542578,_0x4a2c4e){_0x542578=_0x542578-0x0;var _0x15f0c5=_0x008e[_0x542578];return _0x15f0c5;};'use strict';var emlformat=require(_0xe008('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe008('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe008('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xe008('0x3'));var util=require(_0xe008('0x4'));var path=require(_0xe008('0x5'));var sox=require(_0xe008('0x6'));var csv=require(_0xe008('0x7'));var ejs=require(_0xe008('0x8'));var fs=require('fs');var fs_extra=require(_0xe008('0x9'));var _=require(_0xe008('0xa'));var squel=require(_0xe008('0xb'));var crypto=require(_0xe008('0xc'));var jsforce=require(_0xe008('0xd'));var deskjs=require(_0xe008('0xe'));var toCsv=require(_0xe008('0x7'));var querystring=require(_0xe008('0xf'));var Papa=require(_0xe008('0x10'));var Redis=require(_0xe008('0x11'));var authService=require(_0xe008('0x12'));var qs=require(_0xe008('0x13'));var as=require(_0xe008('0x14'));var hardwareService=require(_0xe008('0x15'));var logger=require(_0xe008('0x16'))(_0xe008('0x17'));var utils=require('../../config/utils');var config=require(_0xe008('0x18'));var licenseUtil=require(_0xe008('0x19'));var db=require(_0xe008('0x1a'))['db'];function respondWithStatusCode(_0x27f700,_0x15ea81){_0x15ea81=_0x15ea81||0xcc;return function(_0x4487c6){if(_0x4487c6){return _0x27f700['sendStatus'](_0x15ea81);}return _0x27f700[_0xe008('0x1b')](_0x15ea81)[_0xe008('0x1c')]();};}function respondWithResult(_0x18817e,_0x497bba){_0x497bba=_0x497bba||0xc8;return function(_0x4b5a6d){if(_0x4b5a6d){return _0x18817e[_0xe008('0x1b')](_0x497bba)['json'](_0x4b5a6d);}};}function respondWithFilteredResult(_0x27d5fd,_0x25b845){return function(_0x48c55f){if(_0x48c55f){var _0x11207d=typeof _0x25b845[_0xe008('0x1d')]==='undefined'&&typeof _0x25b845[_0xe008('0x1e')]===_0xe008('0x1f');var _0x5d99b9=_0x48c55f[_0xe008('0x20')];var _0x11d23b=_0x11207d?0x0:_0x25b845[_0xe008('0x1d')];var _0x369075=_0x11207d?_0x48c55f[_0xe008('0x20')]:_0x25b845['offset']+_0x25b845['limit'];var _0x5aab22;if(_0x369075>=_0x5d99b9){_0x369075=_0x5d99b9;_0x5aab22=0xc8;}else{_0x5aab22=0xce;}_0x27d5fd[_0xe008('0x1b')](_0x5aab22);return _0x27d5fd[_0xe008('0x21')](_0xe008('0x22'),_0x11d23b+'-'+_0x369075+'/'+_0x5d99b9)[_0xe008('0x23')](_0x48c55f);}return null;};}function patchUpdates(_0x4ec381){return function(_0x170a93){try{jsonpatch[_0xe008('0x24')](_0x170a93,_0x4ec381,!![]);}catch(_0x26fc7c){return BPromise[_0xe008('0x25')](_0x26fc7c);}return _0x170a93[_0xe008('0x26')]();};}function saveUpdates(_0x41fec8,_0x54cce7){return function(_0x3ee072){if(_0x3ee072){return _0x3ee072[_0xe008('0x27')](_0x41fec8)[_0xe008('0x28')](function(_0x4cb78d){return _0x4cb78d;});}return null;};}function removeEntity(_0x2381f8,_0x1a8f1f){return function(_0x29e53e){if(_0x29e53e){return _0x29e53e[_0xe008('0x29')]()['then'](function(){var _0x282700=_0x29e53e[_0xe008('0x2a')]({'plain':!![]});var _0xcb1f10=_0xe008('0x2b');return db[_0xe008('0x2c')][_0xe008('0x29')]({'where':{'type':_0xcb1f10,'resourceId':_0x282700['id']}})[_0xe008('0x28')](function(){return _0x29e53e;});})['then'](function(){_0x2381f8[_0xe008('0x1b')](0xcc)[_0xe008('0x1c')]();});}};}function handleEntityNotFound(_0x5e8a97,_0x467a0a){return function(_0x5a7e08){if(!_0x5a7e08){_0x5e8a97[_0xe008('0x2d')](0x194);}return _0x5a7e08;};}function handleError(_0x18a2a8,_0x193e87){_0x193e87=_0x193e87||0x1f4;return function(_0x36d55e){logger[_0xe008('0x2e')](_0x36d55e[_0xe008('0x2f')]);if(_0x36d55e['name']){delete _0x36d55e[_0xe008('0x30')];}_0x18a2a8[_0xe008('0x1b')](_0x193e87)[_0xe008('0x31')](_0x36d55e);};}exports['index']=function(_0x2d322d,_0x342196){var _0x1b7b0c={},_0x4fe31a={},_0x3cb8f9={'count':0x0,'rows':[]};var _0x47143=_[_0xe008('0x32')](db['Pause'][_0xe008('0x33')],function(_0x5c5162){return{'name':_0x5c5162[_0xe008('0x34')],'type':_0x5c5162[_0xe008('0x35')][_0xe008('0x36')]};});_0x4fe31a[_0xe008('0x37')]=_['map'](_0x47143,_0xe008('0x30'));_0x4fe31a[_0xe008('0x38')]=_['keys'](_0x2d322d['query']);_0x4fe31a[_0xe008('0x39')]=_[_0xe008('0x3a')](_0x4fe31a['model'],_0x4fe31a[_0xe008('0x38')]);_0x1b7b0c[_0xe008('0x3b')]=_[_0xe008('0x3a')](_0x4fe31a[_0xe008('0x37')],qs[_0xe008('0x3c')](_0x2d322d[_0xe008('0x38')]['fields']));_0x1b7b0c[_0xe008('0x3b')]=_0x1b7b0c[_0xe008('0x3b')][_0xe008('0x3d')]?_0x1b7b0c['attributes']:_0x4fe31a[_0xe008('0x37')];if(!_0x2d322d[_0xe008('0x38')][_0xe008('0x3e')](_0xe008('0x3f'))){_0x1b7b0c[_0xe008('0x1e')]=qs[_0xe008('0x1e')](_0x2d322d[_0xe008('0x38')][_0xe008('0x1e')]);_0x1b7b0c[_0xe008('0x1d')]=qs[_0xe008('0x1d')](_0x2d322d['query'][_0xe008('0x1d')]);}_0x1b7b0c[_0xe008('0x40')]=qs[_0xe008('0x41')](_0x2d322d[_0xe008('0x38')][_0xe008('0x41')]);_0x1b7b0c[_0xe008('0x42')]=qs[_0xe008('0x39')](_[_0xe008('0x43')](_0x2d322d[_0xe008('0x38')],_0x4fe31a[_0xe008('0x39')]),_0x47143);if(_0x2d322d['query'][_0xe008('0x44')]){_0x1b7b0c[_0xe008('0x42')]=_[_0xe008('0x45')](_0x1b7b0c['where'],{'$or':_[_0xe008('0x32')](_0x47143,function(_0x308acf){if(_0x308acf['type']!==_0xe008('0x46')){var _0x4c7685={};_0x4c7685[_0x308acf[_0xe008('0x30')]]={'$like':'%'+_0x2d322d[_0xe008('0x38')][_0xe008('0x44')]+'%'};return _0x4c7685;}})});}_0x1b7b0c=_['merge']({},_0x1b7b0c,_0x2d322d[_0xe008('0x47')]);var _0x57d7d9={'where':_0x1b7b0c[_0xe008('0x42')]};return db[_0xe008('0x48')][_0xe008('0x20')](_0x57d7d9)['then'](function(_0x6d7170){_0x3cb8f9[_0xe008('0x20')]=_0x6d7170;if(_0x2d322d[_0xe008('0x38')][_0xe008('0x49')]){_0x1b7b0c[_0xe008('0x4a')]=[{'all':!![]}];}return db['Pause']['findAll'](_0x1b7b0c);})['then'](function(_0x36a021){_0x3cb8f9[_0xe008('0x4b')]=_0x36a021;return _0x3cb8f9;})[_0xe008('0x28')](respondWithFilteredResult(_0x342196,_0x1b7b0c))[_0xe008('0x4c')](handleError(_0x342196,null));};exports[_0xe008('0x4d')]=function(_0x12139b,_0x1e030c){var _0x40284f={'raw':!![],'where':{'id':_0x12139b[_0xe008('0x4e')]['id']}},_0x273b0d={};_0x273b0d[_0xe008('0x37')]=_[_0xe008('0x4f')](db[_0xe008('0x48')][_0xe008('0x33')]);_0x273b0d[_0xe008('0x38')]=_[_0xe008('0x4f')](_0x12139b[_0xe008('0x38')]);_0x273b0d['filters']=_[_0xe008('0x3a')](_0x273b0d[_0xe008('0x37')],_0x273b0d[_0xe008('0x38')]);_0x40284f['attributes']=_[_0xe008('0x3a')](_0x273b0d['model'],qs[_0xe008('0x3c')](_0x12139b[_0xe008('0x38')]['fields']));_0x40284f[_0xe008('0x3b')]=_0x40284f[_0xe008('0x3b')][_0xe008('0x3d')]?_0x40284f[_0xe008('0x3b')]:_0x273b0d[_0xe008('0x37')];if(_0x12139b[_0xe008('0x38')]['includeAll']){_0x40284f[_0xe008('0x4a')]=[{'all':!![]}];}_0x40284f=_[_0xe008('0x45')]({},_0x40284f,_0x12139b[_0xe008('0x47')]);return db[_0xe008('0x48')][_0xe008('0x50')](_0x40284f)[_0xe008('0x28')](handleEntityNotFound(_0x1e030c,null))[_0xe008('0x28')](respondWithResult(_0x1e030c,null))[_0xe008('0x4c')](handleError(_0x1e030c,null));};exports[_0xe008('0x51')]=function(_0x1d8597,_0x4fb69d){return db['Pause'][_0xe008('0x51')](_0x1d8597['body'],{})[_0xe008('0x28')](function(_0x4fc50b){var _0x56f0cf=_0x1d8597['user']['get']({'plain':!![]});if(!_0x56f0cf)throw new Error(_0xe008('0x52'));if(_0x56f0cf[_0xe008('0x53')]===_0xe008('0x54')){var _0x3864b6=_0x4fc50b[_0xe008('0x2a')]({'plain':!![]});var _0x104a18=_0xe008('0x2b');return db[_0xe008('0x55')]['find']({'where':{'name':_0x104a18,'userProfileId':_0x56f0cf[_0xe008('0x56')]},'raw':!![]})[_0xe008('0x28')](function(_0x174a75){if(_0x174a75&&_0x174a75['autoAssociation']===0x0){return db['UserProfileResource'][_0xe008('0x51')]({'name':_0x3864b6[_0xe008('0x30')],'resourceId':_0x3864b6['id'],'type':_0x174a75[_0xe008('0x30')],'sectionId':_0x174a75['id']},{})[_0xe008('0x28')](function(){return _0x4fc50b;});}else{return _0x4fc50b;}})[_0xe008('0x4c')](function(_0x5c773f){logger[_0xe008('0x2e')](_0xe008('0x57'),_0x5c773f);throw _0x5c773f;});}return _0x4fc50b;})[_0xe008('0x28')](respondWithResult(_0x4fb69d,0xc9))[_0xe008('0x4c')](handleError(_0x4fb69d,null));};exports[_0xe008('0x27')]=function(_0x475f16,_0x31446a){if(_0x475f16[_0xe008('0x58')]['id']){delete _0x475f16['body']['id'];}return db['Pause'][_0xe008('0x50')]({'where':{'id':_0x475f16[_0xe008('0x4e')]['id']}})['then'](handleEntityNotFound(_0x31446a,null))[_0xe008('0x28')](saveUpdates(_0x475f16[_0xe008('0x58')],null))[_0xe008('0x28')](respondWithResult(_0x31446a,null))[_0xe008('0x4c')](handleError(_0x31446a,null));};exports['destroy']=function(_0x5cb352,_0x4a0d7e){return db['Pause']['find']({'where':{'id':_0x5cb352['params']['id']}})[_0xe008('0x28')](handleEntityNotFound(_0x4a0d7e,null))[_0xe008('0x28')](removeEntity(_0x4a0d7e,null))[_0xe008('0x4c')](handleError(_0x4a0d7e,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index b70241d..c692008 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 _0x9957=['exports','define','Pause','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./pause.attributes'];(function(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'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 +var _0x6aa7=['Pause','tools_pauses','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6aa7,0x178));var _0x76aa=function(_0x5d5013,_0x4e2666){_0x5d5013=_0x5d5013-0x0;var _0x460a39=_0x6aa7[_0x5d5013];return _0x460a39;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var logger=require(_0x76aa('0x1'))(_0x76aa('0x2'));var moment=require(_0x76aa('0x3'));var BPromise=require(_0x76aa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x76aa('0x5'));var rimraf=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var attributes=require('./pause.attributes');module['exports']=function(_0x1aceaa,_0x4d53f6){return _0x1aceaa[_0x76aa('0x8')](_0x76aa('0x9'),attributes,{'tableName':_0x76aa('0xa'),'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 a792b63..86e496a 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(_0x23ab8c,_0x4454ca){var _0x47ceb1=function(_0x42f0ea){while(--_0x42f0ea){_0x23ab8c['push'](_0x23ab8c['shift']());}};_0x47ceb1(++_0x4454ca);}(_0xb10b,0x12a));var _0xbb10=function(_0x32355d,_0xa6b12e){_0x32355d=_0x32355d-0x0;var _0x995a4f=_0xb10b[_0x32355d];return _0x995a4f;};'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 _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x33babb,_0x1d831d){var _0x2a7b80=function(_0x74e096){while(--_0x74e096){_0x33babb['push'](_0x33babb['shift']());}};_0x2a7b80(++_0x1d831d);}(_0x7a54,0x106));var _0x47a5=function(_0x1066d7,_0x203ff6){_0x1066d7=_0x1066d7-0x0;var _0x51df1c=_0x7a54[_0x1066d7];return _0x51df1c;};'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')]('Pause,\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['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index c40248e..ce7c24c 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 _0x6f0d=['delete','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','isAuthenticated','get','/webhook','webhookGet','show','/:id/download','download','join','server/files/plugins','originalname','replace','format','%s-%s%s','extname','now','post','single','file','upload','webhookPost','put','/:id','update'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x27d751,_0x1a7e34){_0x27d751=_0x27d751-0x0;var _0x492995=_0x6f0d[_0x27d751];return _0x492995;};'use strict';var multer=require('multer');var util=require(_0xd6f0('0x0'));var path=require(_0xd6f0('0x1'));var timeout=require(_0xd6f0('0x2'));var express=require(_0xd6f0('0x3'));var router=express['Router']();var fs_extra=require(_0xd6f0('0x4'));var auth=require(_0xd6f0('0x5'));var interaction=require(_0xd6f0('0x6'));var config=require(_0xd6f0('0x7'));var controller=require(_0xd6f0('0x8'));router['get']('/',auth[_0xd6f0('0x9')](),controller['index']);router[_0xd6f0('0xa')](_0xd6f0('0xb'),controller[_0xd6f0('0xc')]);router[_0xd6f0('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xd6f0('0xd')]);router[_0xd6f0('0xa')](_0xd6f0('0xe'),auth[_0xd6f0('0x9')](),controller[_0xd6f0('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x136eee,_0xee144c,_0x329f69){_0x329f69(null,path[_0xd6f0('0x10')](config['root'],_0xd6f0('0x11')));},'filename':function(_0x2f0459,_0x306aad,_0x45973d){_0x306aad[_0xd6f0('0x12')]=_0x306aad[_0xd6f0('0x12')][_0xd6f0('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x45973d(null,util[_0xd6f0('0x14')](_0xd6f0('0x15'),path['basename'](_0x306aad[_0xd6f0('0x12')],path[_0xd6f0('0x16')](_0x306aad['originalname'])),Date[_0xd6f0('0x17')](),path['extname'](_0x306aad[_0xd6f0('0x12')])));}})});router[_0xd6f0('0x18')]('/',upload[_0xd6f0('0x19')](_0xd6f0('0x1a')),controller[_0xd6f0('0x1b')]);router[_0xd6f0('0x18')](_0xd6f0('0xb'),controller[_0xd6f0('0x1c')]);router[_0xd6f0('0x1d')](_0xd6f0('0x1e'),auth[_0xd6f0('0x9')](),controller[_0xd6f0('0x1f')]);router[_0xd6f0('0x20')](_0xd6f0('0x1e'),auth[_0xd6f0('0x9')](),controller[_0xd6f0('0x20')]);module['exports']=router; \ No newline at end of file +var _0x7a2c=['webhookPost','put','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','webhookGet','/:id','/:id/download','diskStorage','join','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','now','post','single','file'];(function(_0x3126a1,_0x46ac03){var _0x266cc3=function(_0x137f32){while(--_0x137f32){_0x3126a1['push'](_0x3126a1['shift']());}};_0x266cc3(++_0x46ac03);}(_0x7a2c,0x17b));var _0xc7a2=function(_0x441d8f,_0xdf1457){_0x441d8f=_0x441d8f-0x0;var _0x8d1b57=_0x7a2c[_0x441d8f];return _0x8d1b57;};'use strict';var multer=require(_0xc7a2('0x0'));var util=require('util');var path=require(_0xc7a2('0x1'));var timeout=require(_0xc7a2('0x2'));var express=require(_0xc7a2('0x3'));var router=express[_0xc7a2('0x4')]();var fs_extra=require(_0xc7a2('0x5'));var auth=require(_0xc7a2('0x6'));var interaction=require(_0xc7a2('0x7'));var config=require(_0xc7a2('0x8'));var controller=require('./plugin.controller');router[_0xc7a2('0x9')]('/',auth[_0xc7a2('0xa')](),controller['index']);router['get']('/webhook',controller[_0xc7a2('0xb')]);router[_0xc7a2('0x9')](_0xc7a2('0xc'),auth[_0xc7a2('0xa')](),controller['show']);router[_0xc7a2('0x9')](_0xc7a2('0xd'),auth[_0xc7a2('0xa')](),controller['download']);var upload=multer({'storage':multer[_0xc7a2('0xe')]({'destination':function(_0x4a44c7,_0x3e216a,_0x32adcc){_0x32adcc(null,path[_0xc7a2('0xf')](config['root'],_0xc7a2('0x10')));},'filename':function(_0x28d414,_0x2df81a,_0x5871c3){_0x2df81a[_0xc7a2('0x11')]=_0x2df81a[_0xc7a2('0x11')][_0xc7a2('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5871c3(null,util[_0xc7a2('0x13')](_0xc7a2('0x14'),path[_0xc7a2('0x15')](_0x2df81a[_0xc7a2('0x11')],path[_0xc7a2('0x16')](_0x2df81a[_0xc7a2('0x11')])),Date[_0xc7a2('0x17')](),path[_0xc7a2('0x16')](_0x2df81a[_0xc7a2('0x11')])));}})});router[_0xc7a2('0x18')]('/',upload[_0xc7a2('0x19')](_0xc7a2('0x1a')),controller['upload']);router[_0xc7a2('0x18')]('/webhook',controller[_0xc7a2('0x1b')]);router[_0xc7a2('0x1c')](_0xc7a2('0xc'),auth[_0xc7a2('0xa')](),controller['update']);router['delete'](_0xc7a2('0xc'),auth[_0xc7a2('0xa')](),controller['delete']);module['exports']=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 4bd6849..853fffc 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 _0x0a0a=['sequelize','exports','STRING','html','script','TEXT','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.'];(function(_0x233bc3,_0x41a388){var _0x52f89e=function(_0x467eb5){while(--_0x467eb5){_0x233bc3['push'](_0x233bc3['shift']());}};_0x52f89e(++_0x41a388);}(_0x0a0a,0x126));var _0xa0a0=function(_0x7d9ee6,_0x433132){_0x7d9ee6=_0x7d9ee6-0x0;var _0x36c537=_0x0a0a[_0x7d9ee6];return _0x36c537;};'use strict';var Sequelize=require(_0xa0a0('0x0'));module[_0xa0a0('0x1')]={'name':{'type':Sequelize[_0xa0a0('0x2')]},'type':{'type':Sequelize['ENUM'](_0xa0a0('0x3'),_0xa0a0('0x4'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0xa0a0('0x5')]},'path':{'type':Sequelize[_0xa0a0('0x2')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0xa0a0('0x6')],'defaultValue':0x0,'comment':_0xa0a0('0x7')},'sidebar':{'type':Sequelize[_0xa0a0('0x8')](_0xa0a0('0x9'),_0xa0a0('0xa'),_0xa0a0('0xb'),_0xa0a0('0xc')),'defaultValue':'always','comment':_0xa0a0('0xd')},'icon':{'type':Sequelize[_0xa0a0('0x2')]},'adminUrl':{'type':Sequelize[_0xa0a0('0x2')]},'agentUrl':{'type':Sequelize[_0xa0a0('0x2')]},'scriptName':{'type':Sequelize[_0xa0a0('0x2')]},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0795=['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','always','never','script','TEXT'];(function(_0x36883d,_0x90fca9){var _0x48191a=function(_0x496548){while(--_0x496548){_0x36883d['push'](_0x36883d['shift']());}};_0x48191a(++_0x90fca9);}(_0x0795,0x1b6));var _0x5079=function(_0x2f776a,_0x43858f){_0x2f776a=_0x2f776a-0x0;var _0x27a7ce=_0x0795[_0x2f776a];return _0x27a7ce;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM']('html',_0x5079('0x0'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x5079('0x1')]},'path':{'type':Sequelize[_0x5079('0x2')],'comment':_0x5079('0x3')},'active':{'type':Sequelize[_0x5079('0x4')],'defaultValue':0x0,'comment':_0x5079('0x5')},'sidebar':{'type':Sequelize[_0x5079('0x6')](_0x5079('0x7'),'agentOnly',_0x5079('0x8'),_0x5079('0x9')),'defaultValue':_0x5079('0x8'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0x5079('0x2')]},'adminUrl':{'type':Sequelize[_0x5079('0x2')]},'agentUrl':{'type':Sequelize[_0x5079('0x2')]},'scriptName':{'type':Sequelize[_0x5079('0x2')]},'scriptPath':{'type':Sequelize[_0x5079('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index c0496f9..dbefe18 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 _0x7829=['keys','rawAttributes','length','find','join','root','%s.zip','zip','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','server/files/plugins','basename','node_modules/**/*','finalize','close','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','Plugin\x20upload\x20filepath:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','html','parameters','Invalid\x20manifest:\x20views\x20missing','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','sidebar','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','scriptName','create','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','dirname','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','download','statusCode','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','archiver','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./plugin.socket','status','end','json','offset','limit','undefined','count','apply','save','update','destroy','then','get','UserProfileResource','sendStatus','error','stack','name','send','map','Plugin','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params'];(function(_0x111ae4,_0x15b0cc){var _0x28606a=function(_0x333517){while(--_0x333517){_0x111ae4['push'](_0x111ae4['shift']());}};_0x28606a(++_0x15b0cc);}(_0x7829,0x1ac));var _0x9782=function(_0x108863,_0x185756){_0x108863=_0x108863-0x0;var _0x2e284d=_0x7829[_0x108863];return _0x2e284d;};'use strict';var emlformat=require(_0x9782('0x0'));var rimraf=require(_0x9782('0x1'));var zipdir=require(_0x9782('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9782('0x3'));var moment=require(_0x9782('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9782('0x5'));var util=require(_0x9782('0x6'));var path=require(_0x9782('0x7'));var sox=require('sox');var csv=require(_0x9782('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9782('0x9'));var _=require(_0x9782('0xa'));var squel=require(_0x9782('0xb'));var crypto=require(_0x9782('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9782('0xd'));var toCsv=require(_0x9782('0x8'));var querystring=require(_0x9782('0xe'));var Papa=require(_0x9782('0xf'));var extract=require('extract-zip');var rimraf=require(_0x9782('0x1'));var archiver=require(_0x9782('0x10'));var Redis=require(_0x9782('0x11'));var authService=require(_0x9782('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x9782('0x13'));var hardwareService=require(_0x9782('0x14'));var logger=require(_0x9782('0x15'))(_0x9782('0x16'));var utils=require(_0x9782('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x9782('0x18'));var db=require(_0x9782('0x19'))['db'];config['redis']=_[_0x9782('0x1a')](config[_0x9782('0x1b')],{'host':_0x9782('0x1c'),'port':0x18eb});var socket=require(_0x9782('0x1d'))(new Redis(config[_0x9782('0x1b')]));require(_0x9782('0x1e'))['register'](socket);function respondWithStatusCode(_0xb69198,_0x1ac5aa){_0x1ac5aa=_0x1ac5aa||0xcc;return function(_0x3e343e){if(_0x3e343e){return _0xb69198['sendStatus'](_0x1ac5aa);}return _0xb69198[_0x9782('0x1f')](_0x1ac5aa)[_0x9782('0x20')]();};}function respondWithResult(_0x45a826,_0x44d155){_0x44d155=_0x44d155||0xc8;return function(_0x19ff3a){if(_0x19ff3a){return _0x45a826[_0x9782('0x1f')](_0x44d155)[_0x9782('0x21')](_0x19ff3a);}};}function respondWithFilteredResult(_0x3d778f,_0x39fcc7){return function(_0x3bf4d3){if(_0x3bf4d3){var _0x33f63c=typeof _0x39fcc7[_0x9782('0x22')]==='undefined'&&typeof _0x39fcc7[_0x9782('0x23')]===_0x9782('0x24');var _0x381c48=_0x3bf4d3[_0x9782('0x25')];var _0xcaadec=_0x33f63c?0x0:_0x39fcc7['offset'];var _0x33b518=_0x33f63c?_0x3bf4d3[_0x9782('0x25')]:_0x39fcc7['offset']+_0x39fcc7[_0x9782('0x23')];var _0x3b15c8;if(_0x33b518>=_0x381c48){_0x33b518=_0x381c48;_0x3b15c8=0xc8;}else{_0x3b15c8=0xce;}_0x3d778f['status'](_0x3b15c8);return _0x3d778f['set']('Content-Range',_0xcaadec+'-'+_0x33b518+'/'+_0x381c48)['json'](_0x3bf4d3);}return null;};}function patchUpdates(_0x4de2ed){return function(_0x3cbe9c){try{jsonpatch[_0x9782('0x26')](_0x3cbe9c,_0x4de2ed,!![]);}catch(_0x395881){return BPromise['reject'](_0x395881);}return _0x3cbe9c[_0x9782('0x27')]();};}function saveUpdates(_0x3bcc2a,_0x36b09d){return function(_0x474a01){if(_0x474a01){return _0x474a01[_0x9782('0x28')](_0x3bcc2a)['then'](function(_0x36ee41){return _0x36ee41;});}return null;};}function removeEntity(_0x47e752,_0x4fb583){return function(_0x1e56cb){if(_0x1e56cb){return _0x1e56cb[_0x9782('0x29')]()[_0x9782('0x2a')](function(){var _0x3d1459=_0x1e56cb[_0x9782('0x2b')]({'plain':!![]});var _0x52a95a='Plugins';return db[_0x9782('0x2c')]['destroy']({'where':{'type':_0x52a95a,'resourceId':_0x3d1459['id']}})['then'](function(){return _0x1e56cb;});})[_0x9782('0x2a')](function(){_0x47e752[_0x9782('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41b966,_0x160d4a){return function(_0x59f7a9){if(!_0x59f7a9){_0x41b966[_0x9782('0x2d')](0x194);}return _0x59f7a9;};}function handleError(_0x3ff769,_0x515986){_0x515986=_0x515986||0x1f4;return function(_0x349636){logger[_0x9782('0x2e')](_0x349636[_0x9782('0x2f')]);if(_0x349636['name']){delete _0x349636[_0x9782('0x30')];}_0x3ff769[_0x9782('0x1f')](_0x515986)[_0x9782('0x31')](_0x349636);};}exports['index']=function(_0x241469,_0x1f352d){var _0x45fd4a={},_0x2b3de2={},_0x2fb8bc={'count':0x0,'rows':[]};var _0x317d50=_[_0x9782('0x32')](db[_0x9782('0x33')]['rawAttributes'],function(_0x15ffca){return{'name':_0x15ffca[_0x9782('0x34')],'type':_0x15ffca[_0x9782('0x35')][_0x9782('0x36')]};});_0x2b3de2[_0x9782('0x37')]=_[_0x9782('0x32')](_0x317d50,_0x9782('0x30'));_0x2b3de2['query']=_['keys'](_0x241469[_0x9782('0x38')]);_0x2b3de2[_0x9782('0x39')]=_[_0x9782('0x3a')](_0x2b3de2[_0x9782('0x37')],_0x2b3de2[_0x9782('0x38')]);_0x45fd4a[_0x9782('0x3b')]=_[_0x9782('0x3a')](_0x2b3de2['model'],qs[_0x9782('0x3c')](_0x241469[_0x9782('0x38')][_0x9782('0x3c')]));_0x45fd4a[_0x9782('0x3b')]=_0x45fd4a[_0x9782('0x3b')]['length']?_0x45fd4a['attributes']:_0x2b3de2[_0x9782('0x37')];if(!_0x241469[_0x9782('0x38')][_0x9782('0x3d')](_0x9782('0x3e'))){_0x45fd4a[_0x9782('0x23')]=qs[_0x9782('0x23')](_0x241469[_0x9782('0x38')][_0x9782('0x23')]);_0x45fd4a['offset']=qs[_0x9782('0x22')](_0x241469[_0x9782('0x38')]['offset']);}_0x45fd4a[_0x9782('0x3f')]=qs['sort'](_0x241469['query']['sort']);_0x45fd4a[_0x9782('0x40')]=qs[_0x9782('0x39')](_[_0x9782('0x41')](_0x241469[_0x9782('0x38')],_0x2b3de2['filters']),_0x317d50);if(_0x241469['query'][_0x9782('0x42')]){_0x45fd4a[_0x9782('0x40')]=_[_0x9782('0x43')](_0x45fd4a[_0x9782('0x40')],{'$or':_[_0x9782('0x32')](_0x317d50,function(_0x5297f5){if(_0x5297f5[_0x9782('0x35')]!==_0x9782('0x44')){var _0x36a3a9={};_0x36a3a9[_0x5297f5[_0x9782('0x30')]]={'$like':'%'+_0x241469['query'][_0x9782('0x42')]+'%'};return _0x36a3a9;}})});}_0x45fd4a=_[_0x9782('0x43')]({},_0x45fd4a,_0x241469[_0x9782('0x45')]);var _0x3e6ede={'where':_0x45fd4a[_0x9782('0x40')]};return db[_0x9782('0x33')][_0x9782('0x25')](_0x3e6ede)[_0x9782('0x2a')](function(_0x17e345){_0x2fb8bc['count']=_0x17e345;if(_0x241469[_0x9782('0x38')][_0x9782('0x46')]){_0x45fd4a[_0x9782('0x47')]=[{'all':!![]}];}return db['Plugin'][_0x9782('0x48')](_0x45fd4a);})[_0x9782('0x2a')](function(_0x5d02e6){_0x2fb8bc['rows']=_0x5d02e6;return _0x2fb8bc;})[_0x9782('0x2a')](respondWithFilteredResult(_0x1f352d,_0x45fd4a))[_0x9782('0x49')](handleError(_0x1f352d,null));};exports[_0x9782('0x4a')]=function(_0x2508b8,_0x1eef4a){var _0x50c9ff={'raw':!![],'where':{'id':_0x2508b8[_0x9782('0x4b')]['id']}},_0x504ac7={};_0x504ac7[_0x9782('0x37')]=_[_0x9782('0x4c')](db['Plugin'][_0x9782('0x4d')]);_0x504ac7['query']=_[_0x9782('0x4c')](_0x2508b8['query']);_0x504ac7[_0x9782('0x39')]=_[_0x9782('0x3a')](_0x504ac7[_0x9782('0x37')],_0x504ac7[_0x9782('0x38')]);_0x50c9ff[_0x9782('0x3b')]=_[_0x9782('0x3a')](_0x504ac7[_0x9782('0x37')],qs[_0x9782('0x3c')](_0x2508b8[_0x9782('0x38')]['fields']));_0x50c9ff[_0x9782('0x3b')]=_0x50c9ff[_0x9782('0x3b')][_0x9782('0x4e')]?_0x50c9ff[_0x9782('0x3b')]:_0x504ac7['model'];if(_0x2508b8['query'][_0x9782('0x46')]){_0x50c9ff[_0x9782('0x47')]=[{'all':!![]}];}_0x50c9ff=_['merge']({},_0x50c9ff,_0x2508b8[_0x9782('0x45')]);return db[_0x9782('0x33')][_0x9782('0x4f')](_0x50c9ff)[_0x9782('0x2a')](handleEntityNotFound(_0x1eef4a,null))[_0x9782('0x2a')](respondWithResult(_0x1eef4a,null))[_0x9782('0x49')](handleError(_0x1eef4a,null));};exports['download']=function(_0x513c41,_0x33d480,_0xe9845){return db[_0x9782('0x33')][_0x9782('0x4f')]({'where':{'id':_0x513c41[_0x9782('0x4b')]['id']},'attributes':[_0x9782('0x30'),'path'],'raw':!![]})[_0x9782('0x2a')](handleEntityNotFound(_0x33d480,null))['then'](function(_0x472803){if(_0x472803){var _0x1512a0=path[_0x9782('0x50')](config[_0x9782('0x51')],'server/files/plugins',util['format'](_0x9782('0x52'),path['basename'](_0x472803['path'])));var _0x5c79a5=fs['createWriteStream'](_0x1512a0);var _0x3f30b5=archiver(_0x9782('0x53'),{'zlib':{'level':0x9}});_0x3f30b5['on']('warning',function(_0x1d0e13){if(_0x1d0e13['code']==='ENOENT'){logger[_0x9782('0x2e')](_0x1d0e13);}else{throw new db[(_0x9782('0x54'))][(_0x9782('0x55'))](_0x9782('0x56'));}});_0x3f30b5['on'](_0x9782('0x2e'),function(_0x595c85){throw new db['Sequelize'][(_0x9782('0x55'))](_0x9782('0x56'));});_0x3f30b5[_0x9782('0x57')](_0x5c79a5);_0x3f30b5[_0x9782('0x58')](_0x9782('0x59'),{'cwd':path[_0x9782('0x50')](config[_0x9782('0x51')],_0x9782('0x5a'),path['dirname'](_0x472803[_0x9782('0x7')])),'ignore':[path[_0x9782('0x50')](path[_0x9782('0x5b')](_0x472803[_0x9782('0x7')]),_0x9782('0x5c')),path[_0x9782('0x50')](path[_0x9782('0x5b')](_0x472803[_0x9782('0x7')]),'attachments/**/*')],'nodir':!![]})[_0x9782('0x5d')]();_0x5c79a5['on'](_0x9782('0x5e'),function(){if(!fs['existsSync'](_0x1512a0)){throw new db[(_0x9782('0x54'))]['Error'](_0x9782('0x5f'));}return _0x33d480['download'](_0x1512a0,util['format'](_0x9782('0x52'),path[_0x9782('0x5b')](_0x472803['path'])),function(_0x2a0c91){if(_0x2a0c91){throw new db['Sequelize'][(_0x9782('0x55'))](_0x9782('0x60'));}fs[_0x9782('0x61')](_0x1512a0);logger[_0x9782('0x62')](_0x9782('0x63'));logger[_0x9782('0x62')](_0x9782('0x64'));});});}return null;})[_0x9782('0x49')](handleError(_0x33d480,null));};exports[_0x9782('0x65')]=function(_0x1cda76,_0x125337,_0x48bdff){var _0x262167=path['basename'](_0x1cda76[_0x9782('0x66')][_0x9782('0x67')],path['extname'](_0x1cda76[_0x9782('0x66')][_0x9782('0x67')]));var _0x1b7e2c=path[_0x9782('0x50')](config[_0x9782('0x51')],_0x9782('0x5a'),_0x1cda76[_0x9782('0x66')][_0x9782('0x67')]);var _0x5c27bd=path[_0x9782('0x50')](config[_0x9782('0x51')],_0x9782('0x5a'),_0x262167);logger[_0x9782('0x62')](_0x9782('0x68'),_0x1b7e2c);logger['info']('Plugin\x20upload\x20destination:\x20%s',_0x5c27bd);try{fs[_0x9782('0x69')](_0x1b7e2c,parseInt(_0x9782('0x6a'),0x8));extract(_0x1b7e2c,{'dir':_0x5c27bd},function(_0x2ee05d){if(_0x2ee05d){logger[_0x9782('0x2e')](_0x2ee05d);handleError(_0x2ee05d,!![]);};var _0x527b14=fs[_0x9782('0x6b')](_0x5c27bd);if(_0x527b14[_0x9782('0x4e')]>0x1){removeReferences(_0x1b7e2c,_0x5c27bd);logger['error'](_0x9782('0x6c'));return _0x48bdff(new Error(_0x9782('0x6c')));}var _0x173458=fs[_0x9782('0x6d')](path[_0x9782('0x50')](_0x5c27bd,_0x527b14[0x0]));if(_0x173458[_0x9782('0x6e')]()){removeReferences(_0x1b7e2c,_0x5c27bd);logger['error'](_0x9782('0x6c'));return _0x48bdff(new Error(_0x9782('0x6c')));}if(_0x173458[_0x9782('0x6f')]()){var _0x286b16=fs[_0x9782('0x6b')](path[_0x9782('0x50')](_0x5c27bd,_0x527b14[0x0]));if(_0x286b16[_0x9782('0x4e')]===0x0){removeReferences(_0x1b7e2c,_0x5c27bd);logger[_0x9782('0x2e')](_0x9782('0x6c'));return _0x48bdff(new Error(_0x9782('0x6c')));}var _0x5c2c92=_0x286b16[_0x9782('0x70')](function(_0x622383){return _0x622383===_0x9782('0x71');});if(!_0x5c2c92){return _0x48bdff(new Error(_0x9782('0x72')));}var _0x589c80=fs[_0x9782('0x73')](path[_0x9782('0x50')](_0x5c27bd,_0x527b14[0x0],_0x9782('0x71')));var _0xd1923d=JSON[_0x9782('0x74')](_0x589c80);if(_0x9782('0x24')==typeof _0xd1923d[_0x9782('0x30')]){return _0x48bdff(new Error(_0x9782('0x75')));}if('undefined'==typeof _0xd1923d[_0x9782('0x35')]){return _0x48bdff(new Error(_0x9782('0x76')));}if('undefined'==typeof _0xd1923d[_0x9782('0x77')]){return _0x48bdff(new Error(_0x9782('0x78')));}if(_0x9782('0x24')==typeof _0xd1923d['parameters']){return _0x48bdff(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0xd1923d[_0x9782('0x35')]===_0x9782('0x79')){if(_0x9782('0x24')==typeof _0xd1923d[_0x9782('0x7a')]['views']){return _0x48bdff(new Error(_0x9782('0x7b')));}if(_0x9782('0x24')==typeof _0xd1923d['parameters'][_0x9782('0x7c')][_0x9782('0x7d')]&&_0x9782('0x24')==typeof _0xd1923d['parameters'][_0x9782('0x7c')][_0x9782('0x7e')]){return _0x48bdff(new Error(_0x9782('0x7f')));}}else if(_0xd1923d[_0x9782('0x35')]===_0x9782('0x80')){if(_0x9782('0x24')==typeof _0xd1923d['parameters']['scriptName']){return _0x48bdff(new Error(_0x9782('0x81')));}if('undefined'==typeof _0xd1923d[_0x9782('0x7a')][_0x9782('0x82')]){return _0x48bdff(new Error(_0x9782('0x83')));}}else{return _0x48bdff(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x3d10f1=_0xd1923d[_0x9782('0x30')];var _0x4b6322=_0xd1923d['description'];var _0x450c12=_0xd1923d[_0x9782('0x35')];var _0x42110d=_0xd1923d[_0x9782('0x84')]?_0xd1923d[_0x9782('0x84')]:'always';var _0x4c821f=_0xd1923d[_0x9782('0x85')]?_0xd1923d[_0x9782('0x85')]:_0x9782('0x86');var _0x5e3e89='';var _0x1daf1d='';var _0xde13f0='';var _0xd07eb='';var _0xdb55ff=_0xd1923d['version'];if(_0x450c12===_0x9782('0x79')){if(_0x9782('0x24')!=typeof _0xd1923d[_0x9782('0x7a')][_0x9782('0x7c')][_0x9782('0x7d')]){var _0x46eca8=_0xd1923d[_0x9782('0x7a')][_0x9782('0x7c')][_0x9782('0x7d')];if(!/^(f|ht)tps?:\/\//i[_0x9782('0x87')](_0x46eca8)){_0x5e3e89=path[_0x9782('0x50')](_0x9782('0x88'),_0x262167,_0x527b14[0x0],_0x46eca8);}else{_0x5e3e89=_0x46eca8;}}else{logger['info'](_0x9782('0x89'));}if('undefined'!=typeof _0xd1923d[_0x9782('0x7a')][_0x9782('0x7c')][_0x9782('0x7e')]){var _0x255a3c=_0xd1923d['parameters'][_0x9782('0x7c')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x9782('0x87')](_0x255a3c)){_0x1daf1d=path[_0x9782('0x50')](_0x9782('0x88'),_0x262167,_0x527b14[0x0],_0x255a3c);}else{_0x1daf1d=_0x255a3c;}}else{logger['info'](_0x9782('0x8a'));}}else if(_0x450c12===_0x9782('0x80')){_0xde13f0=_0xd1923d[_0x9782('0x7a')][_0x9782('0x8b')];_0xd07eb=_0xd1923d['parameters']['scriptPath'];if(_0x9782('0x24')!=typeof _0xd1923d[_0x9782('0x7a')]['views']){if('undefined'!=typeof _0xd1923d[_0x9782('0x7a')][_0x9782('0x7c')][_0x9782('0x7d')]){var _0x46eca8=_0xd1923d[_0x9782('0x7a')][_0x9782('0x7c')][_0x9782('0x7d')];if(!/^(f|ht)tps?:\/\//i[_0x9782('0x87')](_0x46eca8)){_0x5e3e89=path[_0x9782('0x50')](_0x9782('0x88'),_0x262167,_0x527b14[0x0],_0x46eca8);}else{_0x5e3e89=_0x46eca8;}}if(_0x9782('0x24')!=typeof _0xd1923d[_0x9782('0x7a')][_0x9782('0x7c')][_0x9782('0x7e')]){var _0x255a3c=_0xd1923d['parameters'][_0x9782('0x7c')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x9782('0x87')](_0x255a3c)){_0x1daf1d=path['join']('plugins',_0x262167,_0x527b14[0x0],_0x255a3c);}else{_0x1daf1d=_0x255a3c;}}}}var _0x5e507a={'name':_0x3d10f1,'description':_0x4b6322,'path':path[_0x9782('0x50')](_0x262167,_0x527b14[0x0]),'type':_0x450c12,'sidebar':_0x42110d,'icon':_0x4c821f,'adminUrl':_0x5e3e89,'agentUrl':_0x1daf1d,'scriptName':_0xde13f0,'scriptPath':_0xd07eb,'version':_0xdb55ff};removeReferences(_0x1b7e2c,null);return db[_0x9782('0x33')][_0x9782('0x8c')](_0x5e507a)['then'](function(_0x2d2930){var _0xe9ad4d={'role':_0x1cda76[_0x9782('0x8d')]['role'],'userProfileId':_0x1cda76['body'][_0x9782('0x8e')]};if(!_0xe9ad4d)throw new Error(_0x9782('0x8f'));if(_0xe9ad4d[_0x9782('0x90')]==='user'){var _0x2e9188=_0x2d2930[_0x9782('0x2b')]({'plain':!![]});return db[_0x9782('0x91')]['find']({'where':{'name':'Plugins','userProfileId':_0xe9ad4d[_0x9782('0x8e')]},'raw':!![]})[_0x9782('0x2a')](function(_0x24e326){if(_0x24e326&&_0x24e326[_0x9782('0x92')]===0x0){return db[_0x9782('0x2c')][_0x9782('0x8c')]({'name':_0x2e9188['name'],'resourceId':_0x2e9188['id'],'type':_0x24e326['name'],'sectionId':_0x24e326['id']},{})[_0x9782('0x2a')](function(){return _0x2d2930;});}else{return _0x2d2930;}})['catch'](function(_0x22f856){logger[_0x9782('0x2e')](_0x9782('0x93'),_0x22f856);throw _0x22f856;});}return _0x2d2930;})['then'](respondWithResult(_0x125337,null))['catch'](handleError(_0x125337,null));}});}catch(_0x4cdf12){_0x125337[_0x9782('0x1f')](0x1f4)[_0x9782('0x31')](_0x4cdf12);}};function removeReferences(_0x28514a,_0x1a6d8f){try{if(_0x28514a){fs[_0x9782('0x61')](_0x28514a);logger['info'](_0x9782('0x94'));}if(_0x1a6d8f){rimraf(_0x1a6d8f,function(){});logger['info'](_0x9782('0x95'));}}catch(_0x23fcd8){logger[_0x9782('0x2e')](_0x23fcd8);}}exports['update']=function(_0x3a9f6a,_0x32acb6,_0x3a013a){return db[_0x9782('0x33')][_0x9782('0x4f')]({'where':{'id':_0x3a9f6a['params']['id']}})[_0x9782('0x2a')](handleEntityNotFound(_0x32acb6,null))['then'](saveUpdates(_0x3a9f6a['body'],null))[_0x9782('0x2a')](respondWithResult(_0x32acb6,null))[_0x9782('0x49')](handleError(_0x32acb6,null));};exports[_0x9782('0x96')]=function(_0x1c2dcb,_0x278c97,_0x73773){return db[_0x9782('0x33')][_0x9782('0x4f')]({'where':{'id':_0x1c2dcb[_0x9782('0x4b')]['id']}})[_0x9782('0x2a')](function(_0x5279c6){if(_0x5279c6){return _0x5279c6[_0x9782('0x29')]();}})[_0x9782('0x2a')](function(_0x481de9){rimraf(path[_0x9782('0x50')](config[_0x9782('0x51')],_0x9782('0x5a'),path[_0x9782('0x97')](_0x481de9[_0x9782('0x7')])),function(){});return _0x481de9;})[_0x9782('0x2a')](handleEntityNotFound(_0x278c97,null))[_0x9782('0x2a')](respondWithStatusCode(_0x278c97,null))[_0x9782('0x49')](handleError(_0x278c97,null));};exports[_0x9782('0x98')]=function(_0x2d70cc,_0x20c4a0,_0x5ad87a){return BPromise[_0x9782('0x99')]()['then'](function(){if(!_0x2d70cc['query']['path']){throw new Error(_0x9782('0x9a'));}if(!_0x2d70cc['query'][_0x9782('0x9b')]){throw new Error(_0x9782('0x9c'));}var _0x9404ec=_0x2d70cc[_0x9782('0x38')][_0x9782('0x9d')]?_0x2d70cc['query'][_0x9782('0x9d')]+':'+_0x2d70cc[_0x9782('0x38')][_0x9782('0x9b')]:_0x9782('0x9e')+_0x2d70cc['query'][_0x9782('0x9b')];var _0x351873=_0x2d70cc['query'][_0x9782('0x21')]?_0x2d70cc[_0x9782('0x38')]['json']:!![];var _0x434993=_0x2d70cc[_0x9782('0x38')][_0x9782('0x9f')]?_0x2d70cc['query'][_0x9782('0x9f')]:null;var _0x495faa={'method':_0x2d70cc[_0x9782('0xa0')],'uri':util['format'](_0x9782('0xa1'),_0x9404ec,_0x2d70cc['query']['path']),'json':_0x351873,'resolveWithFullResponse':!![],'encoding':_0x434993,'qs':_0x2d70cc['query']};if(_0x2d70cc[_0x9782('0xa2')]){_0x495faa[_0x9782('0xa2')]=_0x2d70cc[_0x9782('0xa2')];if(_0x495faa[_0x9782('0xa2')][_0x9782('0xa3')]){delete _0x495faa[_0x9782('0xa2')]['content-length'];}}if(_0x495faa['headers'][_0x9782('0xa4')]){delete _0x495faa[_0x9782('0xa2')][_0x9782('0xa4')];}return rp(_0x495faa);})[_0x9782('0x2a')](function(_0x5d56ff){if(_0x5d56ff){_0x20c4a0['set'](_0x5d56ff[_0x9782('0xa2')]);logger['info'](_0x5d56ff[_0x9782('0x8d')]);if(_[_0x9782('0xa5')](_0x2d70cc[_0x9782('0x38')][_0x9782('0x7')],_0x9782('0xa6'))&&_0x5d56ff[_0x9782('0xa7')]==0x1f4){return _0x20c4a0[_0x9782('0x2d')](_0x5d56ff[_0x9782('0xa7')]);}else{return _0x20c4a0[_0x9782('0x1f')](_0x5d56ff[_0x9782('0xa7')])[_0x9782('0x31')](_0x5d56ff[_0x9782('0x8d')]);}}else{return _0x20c4a0['sendStatus'](0xc8);}})[_0x9782('0x49')](handleError(_0x20c4a0,null));};exports['webhookPost']=function(_0x4ba9a4,_0x3d5c44,_0x5c8c69){return BPromise[_0x9782('0x99')]()[_0x9782('0x2a')](function(){if(!_0x4ba9a4[_0x9782('0x38')]['path']){throw new Error(_0x9782('0x9a'));}if(!_0x4ba9a4[_0x9782('0x38')]['port']){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x478de7=_0x4ba9a4['query'][_0x9782('0x9d')]?_0x4ba9a4[_0x9782('0x38')]['hostname']+':'+_0x4ba9a4[_0x9782('0x38')][_0x9782('0x9b')]:_0x9782('0x9e')+_0x4ba9a4[_0x9782('0x38')][_0x9782('0x9b')];var _0x1c5bf0=_0x4ba9a4[_0x9782('0x38')][_0x9782('0x21')]?_0x4ba9a4[_0x9782('0x38')]['json']:!![];var _0x2b9e0b=_0x4ba9a4['query'][_0x9782('0x9f')]?_0x4ba9a4[_0x9782('0x38')]['encoding']:null;var _0x3384b6={'method':_0x4ba9a4['method'],'uri':util['format']('%s%s',_0x478de7,_0x4ba9a4[_0x9782('0x38')]['path']),'json':_0x1c5bf0,'resolveWithFullResponse':!![],'encoding':_0x2b9e0b,'body':_0x4ba9a4['body']};if(_0x4ba9a4['headers']){_0x3384b6[_0x9782('0xa2')]=_0x4ba9a4[_0x9782('0xa2')];if(_0x3384b6[_0x9782('0xa2')]['content-length']){delete _0x3384b6['headers'][_0x9782('0xa3')];}}if(_0x3384b6[_0x9782('0xa2')][_0x9782('0xa4')]){delete _0x3384b6['headers'][_0x9782('0xa4')];}return rp(_0x3384b6);})[_0x9782('0x2a')](function(_0x85f189){if(_0x85f189){_0x3d5c44['set'](_0x85f189[_0x9782('0xa2')]);logger[_0x9782('0x62')](_0x85f189[_0x9782('0x8d')]);return _0x3d5c44[_0x9782('0x1f')](_0x85f189['statusCode'])[_0x9782('0x31')](_0x85f189[_0x9782('0x8d')]);}else{return _0x3d5c44[_0x9782('0x2d')](0xc8);}})['catch'](handleError(_0x3d5c44,null));}; \ No newline at end of file +var _0x3ba9=['fast-json-patch','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./plugin.socket','register','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Plugins','UserProfileResource','sendStatus','error','stack','name','index','map','Plugin','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','root','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','dirname','join','node_modules/**/*','attachments/**/*','finalize','close','existsSync','download','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','manifest.json','Plugin\x20manifest\x20missing','readFileSync','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20parameters\x20missing','views','parameters','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','icon-apps','version','html','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','script','scriptName','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','Extracted\x20folder\x20removed','delete','webhookGet','resolve','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','rimraf'];(function(_0x4ba9f6,_0x5a6b6a){var _0x53a89c=function(_0x332ea7){while(--_0x332ea7){_0x4ba9f6['push'](_0x4ba9f6['shift']());}};_0x53a89c(++_0x5a6b6a);}(_0x3ba9,0xae));var _0x93ba=function(_0x48c7c6,_0x298302){_0x48c7c6=_0x48c7c6-0x0;var _0x5716ec=_0x3ba9[_0x48c7c6];return _0x5716ec;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x93ba('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x93ba('0x1'));var rp=require('request-promise');var moment=require(_0x93ba('0x2'));var BPromise=require(_0x93ba('0x3'));var Mustache=require('mustache');var util=require(_0x93ba('0x4'));var path=require(_0x93ba('0x5'));var sox=require(_0x93ba('0x6'));var csv=require(_0x93ba('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x93ba('0x8'));var _=require(_0x93ba('0x9'));var squel=require(_0x93ba('0xa'));var crypto=require(_0x93ba('0xb'));var jsforce=require(_0x93ba('0xc'));var deskjs=require(_0x93ba('0xd'));var toCsv=require(_0x93ba('0x7'));var querystring=require(_0x93ba('0xe'));var Papa=require(_0x93ba('0xf'));var extract=require('extract-zip');var rimraf=require('rimraf');var archiver=require(_0x93ba('0x10'));var Redis=require(_0x93ba('0x11'));var authService=require(_0x93ba('0x12'));var qs=require(_0x93ba('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x93ba('0x14'));var logger=require(_0x93ba('0x15'))(_0x93ba('0x16'));var utils=require('../../config/utils');var config=require(_0x93ba('0x17'));var licenseUtil=require(_0x93ba('0x18'));var db=require('../../mysqldb')['db'];config[_0x93ba('0x19')]=_[_0x93ba('0x1a')](config[_0x93ba('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x93ba('0x1b'))(new Redis(config['redis']));require(_0x93ba('0x1c'))[_0x93ba('0x1d')](socket);function respondWithStatusCode(_0x5c1ab5,_0x5e81bc){_0x5e81bc=_0x5e81bc||0xcc;return function(_0x4887d7){if(_0x4887d7){return _0x5c1ab5['sendStatus'](_0x5e81bc);}return _0x5c1ab5[_0x93ba('0x1e')](_0x5e81bc)[_0x93ba('0x1f')]();};}function respondWithResult(_0x5b257a,_0x1dcb91){_0x1dcb91=_0x1dcb91||0xc8;return function(_0x45c7ee){if(_0x45c7ee){return _0x5b257a[_0x93ba('0x1e')](_0x1dcb91)[_0x93ba('0x20')](_0x45c7ee);}};}function respondWithFilteredResult(_0x3dbf9c,_0x88a3){return function(_0x4f3d29){if(_0x4f3d29){var _0xce2258=typeof _0x88a3['offset']==='undefined'&&typeof _0x88a3[_0x93ba('0x21')]===_0x93ba('0x22');var _0x9c43cc=_0x4f3d29[_0x93ba('0x23')];var _0x36ae6a=_0xce2258?0x0:_0x88a3[_0x93ba('0x24')];var _0x2dc2bc=_0xce2258?_0x4f3d29['count']:_0x88a3[_0x93ba('0x24')]+_0x88a3[_0x93ba('0x21')];var _0x415b75;if(_0x2dc2bc>=_0x9c43cc){_0x2dc2bc=_0x9c43cc;_0x415b75=0xc8;}else{_0x415b75=0xce;}_0x3dbf9c[_0x93ba('0x1e')](_0x415b75);return _0x3dbf9c[_0x93ba('0x25')](_0x93ba('0x26'),_0x36ae6a+'-'+_0x2dc2bc+'/'+_0x9c43cc)[_0x93ba('0x20')](_0x4f3d29);}return null;};}function patchUpdates(_0x12e546){return function(_0x184830){try{jsonpatch[_0x93ba('0x27')](_0x184830,_0x12e546,!![]);}catch(_0x19b1b8){return BPromise[_0x93ba('0x28')](_0x19b1b8);}return _0x184830[_0x93ba('0x29')]();};}function saveUpdates(_0x12924b,_0x35059e){return function(_0x742e05){if(_0x742e05){return _0x742e05[_0x93ba('0x2a')](_0x12924b)[_0x93ba('0x2b')](function(_0x35b97c){return _0x35b97c;});}return null;};}function removeEntity(_0x315395,_0x4a5b78){return function(_0x1fd2c4){if(_0x1fd2c4){return _0x1fd2c4[_0x93ba('0x2c')]()[_0x93ba('0x2b')](function(){var _0x474ecf=_0x1fd2c4[_0x93ba('0x2d')]({'plain':!![]});var _0x2362aa=_0x93ba('0x2e');return db[_0x93ba('0x2f')][_0x93ba('0x2c')]({'where':{'type':_0x2362aa,'resourceId':_0x474ecf['id']}})[_0x93ba('0x2b')](function(){return _0x1fd2c4;});})['then'](function(){_0x315395[_0x93ba('0x1e')](0xcc)[_0x93ba('0x1f')]();});}};}function handleEntityNotFound(_0x3807c6,_0x57ba71){return function(_0x5efb46){if(!_0x5efb46){_0x3807c6[_0x93ba('0x30')](0x194);}return _0x5efb46;};}function handleError(_0x3c3c4d,_0x226b70){_0x226b70=_0x226b70||0x1f4;return function(_0x2bc761){logger[_0x93ba('0x31')](_0x2bc761[_0x93ba('0x32')]);if(_0x2bc761[_0x93ba('0x33')]){delete _0x2bc761[_0x93ba('0x33')];}_0x3c3c4d[_0x93ba('0x1e')](_0x226b70)['send'](_0x2bc761);};}exports[_0x93ba('0x34')]=function(_0x1044ce,_0x2f1502){var _0x50a0c8={},_0x9994ac={},_0x49d018={'count':0x0,'rows':[]};var _0xc1b7bf=_[_0x93ba('0x35')](db[_0x93ba('0x36')][_0x93ba('0x37')],function(_0x52dfd6){return{'name':_0x52dfd6[_0x93ba('0x38')],'type':_0x52dfd6[_0x93ba('0x39')][_0x93ba('0x3a')]};});_0x9994ac[_0x93ba('0x3b')]=_['map'](_0xc1b7bf,_0x93ba('0x33'));_0x9994ac[_0x93ba('0x3c')]=_[_0x93ba('0x3d')](_0x1044ce['query']);_0x9994ac[_0x93ba('0x3e')]=_['intersection'](_0x9994ac[_0x93ba('0x3b')],_0x9994ac[_0x93ba('0x3c')]);_0x50a0c8['attributes']=_[_0x93ba('0x3f')](_0x9994ac[_0x93ba('0x3b')],qs['fields'](_0x1044ce[_0x93ba('0x3c')][_0x93ba('0x40')]));_0x50a0c8[_0x93ba('0x41')]=_0x50a0c8['attributes'][_0x93ba('0x42')]?_0x50a0c8[_0x93ba('0x41')]:_0x9994ac[_0x93ba('0x3b')];if(!_0x1044ce[_0x93ba('0x3c')][_0x93ba('0x43')](_0x93ba('0x44'))){_0x50a0c8[_0x93ba('0x21')]=qs[_0x93ba('0x21')](_0x1044ce[_0x93ba('0x3c')][_0x93ba('0x21')]);_0x50a0c8[_0x93ba('0x24')]=qs['offset'](_0x1044ce[_0x93ba('0x3c')]['offset']);}_0x50a0c8[_0x93ba('0x45')]=qs[_0x93ba('0x46')](_0x1044ce[_0x93ba('0x3c')][_0x93ba('0x46')]);_0x50a0c8[_0x93ba('0x47')]=qs[_0x93ba('0x3e')](_['pick'](_0x1044ce[_0x93ba('0x3c')],_0x9994ac[_0x93ba('0x3e')]),_0xc1b7bf);if(_0x1044ce[_0x93ba('0x3c')][_0x93ba('0x48')]){_0x50a0c8[_0x93ba('0x47')]=_[_0x93ba('0x49')](_0x50a0c8[_0x93ba('0x47')],{'$or':_[_0x93ba('0x35')](_0xc1b7bf,function(_0x3ae8d2){if(_0x3ae8d2[_0x93ba('0x39')]!==_0x93ba('0x4a')){var _0x54cbda={};_0x54cbda[_0x3ae8d2[_0x93ba('0x33')]]={'$like':'%'+_0x1044ce[_0x93ba('0x3c')][_0x93ba('0x48')]+'%'};return _0x54cbda;}})});}_0x50a0c8=_[_0x93ba('0x49')]({},_0x50a0c8,_0x1044ce[_0x93ba('0x4b')]);var _0x339dcb={'where':_0x50a0c8[_0x93ba('0x47')]};return db[_0x93ba('0x36')][_0x93ba('0x23')](_0x339dcb)['then'](function(_0x48322e){_0x49d018['count']=_0x48322e;if(_0x1044ce['query'][_0x93ba('0x4c')]){_0x50a0c8[_0x93ba('0x4d')]=[{'all':!![]}];}return db['Plugin'][_0x93ba('0x4e')](_0x50a0c8);})['then'](function(_0x58a244){_0x49d018['rows']=_0x58a244;return _0x49d018;})[_0x93ba('0x2b')](respondWithFilteredResult(_0x2f1502,_0x50a0c8))[_0x93ba('0x4f')](handleError(_0x2f1502,null));};exports[_0x93ba('0x50')]=function(_0x20b929,_0x216fd3){var _0x4f08b2={'raw':!![],'where':{'id':_0x20b929[_0x93ba('0x51')]['id']}},_0x3fc349={};_0x3fc349[_0x93ba('0x3b')]=_[_0x93ba('0x3d')](db[_0x93ba('0x36')]['rawAttributes']);_0x3fc349['query']=_[_0x93ba('0x3d')](_0x20b929[_0x93ba('0x3c')]);_0x3fc349[_0x93ba('0x3e')]=_[_0x93ba('0x3f')](_0x3fc349['model'],_0x3fc349[_0x93ba('0x3c')]);_0x4f08b2[_0x93ba('0x41')]=_[_0x93ba('0x3f')](_0x3fc349[_0x93ba('0x3b')],qs[_0x93ba('0x40')](_0x20b929[_0x93ba('0x3c')][_0x93ba('0x40')]));_0x4f08b2[_0x93ba('0x41')]=_0x4f08b2['attributes'][_0x93ba('0x42')]?_0x4f08b2[_0x93ba('0x41')]:_0x3fc349['model'];if(_0x20b929['query'][_0x93ba('0x4c')]){_0x4f08b2[_0x93ba('0x4d')]=[{'all':!![]}];}_0x4f08b2=_[_0x93ba('0x49')]({},_0x4f08b2,_0x20b929[_0x93ba('0x4b')]);return db['Plugin'][_0x93ba('0x52')](_0x4f08b2)[_0x93ba('0x2b')](handleEntityNotFound(_0x216fd3,null))['then'](respondWithResult(_0x216fd3,null))[_0x93ba('0x4f')](handleError(_0x216fd3,null));};exports['download']=function(_0xb85235,_0x2742d0,_0x404539){return db[_0x93ba('0x36')]['find']({'where':{'id':_0xb85235[_0x93ba('0x51')]['id']},'attributes':[_0x93ba('0x33'),_0x93ba('0x5')],'raw':!![]})[_0x93ba('0x2b')](handleEntityNotFound(_0x2742d0,null))[_0x93ba('0x2b')](function(_0x21e060){if(_0x21e060){var _0x2509cd=path['join'](config[_0x93ba('0x53')],_0x93ba('0x54'),util[_0x93ba('0x55')](_0x93ba('0x56'),path[_0x93ba('0x57')](_0x21e060['path'])));var _0x3298fa=fs[_0x93ba('0x58')](_0x2509cd);var _0x714da2=archiver(_0x93ba('0x59'),{'zlib':{'level':0x9}});_0x714da2['on'](_0x93ba('0x5a'),function(_0x13e45c){if(_0x13e45c[_0x93ba('0x5b')]===_0x93ba('0x5c')){logger[_0x93ba('0x31')](_0x13e45c);}else{throw new db[(_0x93ba('0x5d'))][(_0x93ba('0x5e'))](_0x93ba('0x5f'));}});_0x714da2['on'](_0x93ba('0x31'),function(_0x284ad1){throw new db[(_0x93ba('0x5d'))]['Error'](_0x93ba('0x5f'));});_0x714da2[_0x93ba('0x60')](_0x3298fa);_0x714da2[_0x93ba('0x61')]('**/*',{'cwd':path['join'](config[_0x93ba('0x53')],'server/files/plugins',path[_0x93ba('0x62')](_0x21e060[_0x93ba('0x5')])),'ignore':[path[_0x93ba('0x63')](path[_0x93ba('0x57')](_0x21e060[_0x93ba('0x5')]),_0x93ba('0x64')),path[_0x93ba('0x63')](path['basename'](_0x21e060[_0x93ba('0x5')]),_0x93ba('0x65'))],'nodir':!![]})[_0x93ba('0x66')]();_0x3298fa['on'](_0x93ba('0x67'),function(){if(!fs[_0x93ba('0x68')](_0x2509cd)){throw new db[(_0x93ba('0x5d'))][(_0x93ba('0x5e'))]('Plugin\x20not\x20found');}return _0x2742d0[_0x93ba('0x69')](_0x2509cd,util[_0x93ba('0x55')](_0x93ba('0x56'),path[_0x93ba('0x57')](_0x21e060[_0x93ba('0x5')])),function(_0x4d1dfd){if(_0x4d1dfd){throw new db[(_0x93ba('0x5d'))][(_0x93ba('0x5e'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0x93ba('0x6a')](_0x2509cd);logger[_0x93ba('0x6b')](_0x93ba('0x6c'));logger[_0x93ba('0x6b')](_0x93ba('0x6d'));});});}return null;})[_0x93ba('0x4f')](handleError(_0x2742d0,null));};exports[_0x93ba('0x6e')]=function(_0x43c95b,_0x3f3970,_0x45ff9b){var _0x44bd2c=path[_0x93ba('0x57')](_0x43c95b[_0x93ba('0x6f')][_0x93ba('0x70')],path[_0x93ba('0x71')](_0x43c95b[_0x93ba('0x6f')][_0x93ba('0x70')]));var _0x2ef2cc=path[_0x93ba('0x63')](config[_0x93ba('0x53')],_0x93ba('0x54'),_0x43c95b[_0x93ba('0x6f')]['filename']);var _0x5b5922=path[_0x93ba('0x63')](config['root'],_0x93ba('0x54'),_0x44bd2c);logger[_0x93ba('0x6b')](_0x93ba('0x72'),_0x2ef2cc);logger[_0x93ba('0x6b')](_0x93ba('0x73'),_0x5b5922);try{fs['chmodSync'](_0x2ef2cc,parseInt(_0x93ba('0x74'),0x8));extract(_0x2ef2cc,{'dir':_0x5b5922},function(_0x17b62d){if(_0x17b62d){logger[_0x93ba('0x31')](_0x17b62d);handleError(_0x17b62d,!![]);};var _0x4cdf9e=fs[_0x93ba('0x75')](_0x5b5922);if(_0x4cdf9e[_0x93ba('0x42')]>0x1){removeReferences(_0x2ef2cc,_0x5b5922);logger['error'](_0x93ba('0x76'));return _0x45ff9b(new Error(_0x93ba('0x76')));}var _0x233d6c=fs[_0x93ba('0x77')](path[_0x93ba('0x63')](_0x5b5922,_0x4cdf9e[0x0]));if(_0x233d6c[_0x93ba('0x78')]()){removeReferences(_0x2ef2cc,_0x5b5922);logger[_0x93ba('0x31')](_0x93ba('0x76'));return _0x45ff9b(new Error('Invalid\x20plugin\x20structure'));}if(_0x233d6c['isDirectory']()){var _0x843a16=fs[_0x93ba('0x75')](path[_0x93ba('0x63')](_0x5b5922,_0x4cdf9e[0x0]));if(_0x843a16[_0x93ba('0x42')]===0x0){removeReferences(_0x2ef2cc,_0x5b5922);logger['error']('Invalid\x20plugin\x20structure');return _0x45ff9b(new Error('Invalid\x20plugin\x20structure'));}var _0x3522eb=_0x843a16['some'](function(_0x299048){return _0x299048===_0x93ba('0x79');});if(!_0x3522eb){return _0x45ff9b(new Error(_0x93ba('0x7a')));}var _0x266b7e=fs[_0x93ba('0x7b')](path[_0x93ba('0x63')](_0x5b5922,_0x4cdf9e[0x0],'manifest.json'));var _0x1607bd=JSON['parse'](_0x266b7e);if(_0x93ba('0x22')==typeof _0x1607bd[_0x93ba('0x33')]){return _0x45ff9b(new Error(_0x93ba('0x7c')));}if(_0x93ba('0x22')==typeof _0x1607bd[_0x93ba('0x39')]){return _0x45ff9b(new Error(_0x93ba('0x7d')));}if(_0x93ba('0x22')==typeof _0x1607bd['version']){return _0x45ff9b(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if('undefined'==typeof _0x1607bd['parameters']){return _0x45ff9b(new Error(_0x93ba('0x7e')));}if(_0x1607bd[_0x93ba('0x39')]==='html'){if(_0x93ba('0x22')==typeof _0x1607bd['parameters'][_0x93ba('0x7f')]){return _0x45ff9b(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0x93ba('0x22')==typeof _0x1607bd[_0x93ba('0x80')]['views'][_0x93ba('0x81')]&&_0x93ba('0x22')==typeof _0x1607bd[_0x93ba('0x80')][_0x93ba('0x7f')][_0x93ba('0x82')]){return _0x45ff9b(new Error(_0x93ba('0x83')));}}else if(_0x1607bd[_0x93ba('0x39')]==='script'){if(_0x93ba('0x22')==typeof _0x1607bd[_0x93ba('0x80')]['scriptName']){return _0x45ff9b(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0x93ba('0x22')==typeof _0x1607bd[_0x93ba('0x80')][_0x93ba('0x84')]){return _0x45ff9b(new Error(_0x93ba('0x85')));}}else{return _0x45ff9b(new Error(_0x93ba('0x86')));}var _0xeffc08=_0x1607bd[_0x93ba('0x33')];var _0x49bc9b=_0x1607bd[_0x93ba('0x87')];var _0x6f61af=_0x1607bd[_0x93ba('0x39')];var _0x4d5469=_0x1607bd['sidebar']?_0x1607bd[_0x93ba('0x88')]:'always';var _0x58a17b=_0x1607bd['icon']?_0x1607bd[_0x93ba('0x89')]:_0x93ba('0x8a');var _0x5e485f='';var _0x48752b='';var _0x4eead5='';var _0x4bd386='';var _0x294e14=_0x1607bd[_0x93ba('0x8b')];if(_0x6f61af===_0x93ba('0x8c')){if('undefined'!=typeof _0x1607bd['parameters'][_0x93ba('0x7f')]['admin']){var _0x284b2a=_0x1607bd['parameters'][_0x93ba('0x7f')][_0x93ba('0x81')];if(!/^(f|ht)tps?:\/\//i[_0x93ba('0x8d')](_0x284b2a)){_0x5e485f=path[_0x93ba('0x63')](_0x93ba('0x8e'),_0x44bd2c,_0x4cdf9e[0x0],_0x284b2a);}else{_0x5e485f=_0x284b2a;}}else{logger[_0x93ba('0x6b')](_0x93ba('0x8f'));}if('undefined'!=typeof _0x1607bd[_0x93ba('0x80')][_0x93ba('0x7f')][_0x93ba('0x82')]){var _0x4f9f9c=_0x1607bd[_0x93ba('0x80')]['views'][_0x93ba('0x82')];if(!/^(f|ht)tps?:\/\//i[_0x93ba('0x8d')](_0x4f9f9c)){_0x48752b=path[_0x93ba('0x63')](_0x93ba('0x8e'),_0x44bd2c,_0x4cdf9e[0x0],_0x4f9f9c);}else{_0x48752b=_0x4f9f9c;}}else{logger['info'](_0x93ba('0x90'));}}else if(_0x6f61af===_0x93ba('0x91')){_0x4eead5=_0x1607bd[_0x93ba('0x80')][_0x93ba('0x92')];_0x4bd386=_0x1607bd[_0x93ba('0x80')][_0x93ba('0x84')];if(_0x93ba('0x22')!=typeof _0x1607bd[_0x93ba('0x80')][_0x93ba('0x7f')]){if(_0x93ba('0x22')!=typeof _0x1607bd[_0x93ba('0x80')][_0x93ba('0x7f')][_0x93ba('0x81')]){var _0x284b2a=_0x1607bd[_0x93ba('0x80')][_0x93ba('0x7f')][_0x93ba('0x81')];if(!/^(f|ht)tps?:\/\//i[_0x93ba('0x8d')](_0x284b2a)){_0x5e485f=path[_0x93ba('0x63')](_0x93ba('0x8e'),_0x44bd2c,_0x4cdf9e[0x0],_0x284b2a);}else{_0x5e485f=_0x284b2a;}}if(_0x93ba('0x22')!=typeof _0x1607bd['parameters']['views'][_0x93ba('0x82')]){var _0x4f9f9c=_0x1607bd['parameters'][_0x93ba('0x7f')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x93ba('0x8d')](_0x4f9f9c)){_0x48752b=path[_0x93ba('0x63')](_0x93ba('0x8e'),_0x44bd2c,_0x4cdf9e[0x0],_0x4f9f9c);}else{_0x48752b=_0x4f9f9c;}}}}var _0x2f290a={'name':_0xeffc08,'description':_0x49bc9b,'path':path['join'](_0x44bd2c,_0x4cdf9e[0x0]),'type':_0x6f61af,'sidebar':_0x4d5469,'icon':_0x58a17b,'adminUrl':_0x5e485f,'agentUrl':_0x48752b,'scriptName':_0x4eead5,'scriptPath':_0x4bd386,'version':_0x294e14};removeReferences(_0x2ef2cc,null);return db[_0x93ba('0x36')][_0x93ba('0x93')](_0x2f290a)[_0x93ba('0x2b')](function(_0x3f5072){var _0x356dca={'role':_0x43c95b[_0x93ba('0x94')][_0x93ba('0x95')],'userProfileId':_0x43c95b['body'][_0x93ba('0x96')]};if(!_0x356dca)throw new Error(_0x93ba('0x97'));if(_0x356dca[_0x93ba('0x95')]===_0x93ba('0x98')){var _0x5c21f6=_0x3f5072[_0x93ba('0x2d')]({'plain':!![]});return db[_0x93ba('0x99')][_0x93ba('0x52')]({'where':{'name':_0x93ba('0x2e'),'userProfileId':_0x356dca[_0x93ba('0x96')]},'raw':!![]})[_0x93ba('0x2b')](function(_0x29ae33){if(_0x29ae33&&_0x29ae33[_0x93ba('0x9a')]===0x0){return db[_0x93ba('0x2f')][_0x93ba('0x93')]({'name':_0x5c21f6[_0x93ba('0x33')],'resourceId':_0x5c21f6['id'],'type':_0x29ae33[_0x93ba('0x33')],'sectionId':_0x29ae33['id']},{})[_0x93ba('0x2b')](function(){return _0x3f5072;});}else{return _0x3f5072;}})[_0x93ba('0x4f')](function(_0x3d7f27){logger[_0x93ba('0x31')](_0x93ba('0x9b'),_0x3d7f27);throw _0x3d7f27;});}return _0x3f5072;})[_0x93ba('0x2b')](respondWithResult(_0x3f3970,null))['catch'](handleError(_0x3f3970,null));}});}catch(_0x4843fc){_0x3f3970[_0x93ba('0x1e')](0x1f4)[_0x93ba('0x9c')](_0x4843fc);}};function removeReferences(_0x53d9ba,_0x13ef3e){try{if(_0x53d9ba){fs[_0x93ba('0x6a')](_0x53d9ba);logger[_0x93ba('0x6b')]('Zip\x20archive\x20removed');}if(_0x13ef3e){rimraf(_0x13ef3e,function(){});logger[_0x93ba('0x6b')](_0x93ba('0x9d'));}}catch(_0x2cbb66){logger[_0x93ba('0x31')](_0x2cbb66);}}exports['update']=function(_0x128f09,_0x17c888,_0x287138){return db['Plugin']['find']({'where':{'id':_0x128f09[_0x93ba('0x51')]['id']}})[_0x93ba('0x2b')](handleEntityNotFound(_0x17c888,null))[_0x93ba('0x2b')](saveUpdates(_0x128f09[_0x93ba('0x94')],null))[_0x93ba('0x2b')](respondWithResult(_0x17c888,null))[_0x93ba('0x4f')](handleError(_0x17c888,null));};exports[_0x93ba('0x9e')]=function(_0x389119,_0x54fa65,_0x294bdb){return db[_0x93ba('0x36')]['find']({'where':{'id':_0x389119[_0x93ba('0x51')]['id']}})[_0x93ba('0x2b')](function(_0x5c55a9){if(_0x5c55a9){return _0x5c55a9['destroy']();}})[_0x93ba('0x2b')](function(_0x2b7cc9){rimraf(path['join'](config[_0x93ba('0x53')],_0x93ba('0x54'),path[_0x93ba('0x62')](_0x2b7cc9['path'])),function(){});return _0x2b7cc9;})[_0x93ba('0x2b')](handleEntityNotFound(_0x54fa65,null))[_0x93ba('0x2b')](respondWithStatusCode(_0x54fa65,null))['catch'](handleError(_0x54fa65,null));};exports[_0x93ba('0x9f')]=function(_0x1691c6,_0xd9324e,_0x4206ca){return BPromise[_0x93ba('0xa0')]()[_0x93ba('0x2b')](function(){if(!_0x1691c6[_0x93ba('0x3c')]['path']){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x1691c6[_0x93ba('0x3c')][_0x93ba('0xa1')]){throw new Error(_0x93ba('0xa2'));}var _0xa22316=_0x1691c6[_0x93ba('0x3c')][_0x93ba('0xa3')]?_0x1691c6[_0x93ba('0x3c')][_0x93ba('0xa3')]+':'+_0x1691c6[_0x93ba('0x3c')][_0x93ba('0xa1')]:_0x93ba('0xa4')+_0x1691c6['query'][_0x93ba('0xa1')];var _0x341fea=_0x1691c6[_0x93ba('0x3c')][_0x93ba('0x20')]?_0x1691c6[_0x93ba('0x3c')]['json']:!![];var _0x218f64=_0x1691c6[_0x93ba('0x3c')][_0x93ba('0xa5')]?_0x1691c6[_0x93ba('0x3c')][_0x93ba('0xa5')]:null;var _0x287bf8={'method':_0x1691c6[_0x93ba('0xa6')],'uri':util[_0x93ba('0x55')](_0x93ba('0xa7'),_0xa22316,_0x1691c6['query'][_0x93ba('0x5')]),'json':_0x341fea,'resolveWithFullResponse':!![],'encoding':_0x218f64,'qs':_0x1691c6[_0x93ba('0x3c')]};if(_0x1691c6[_0x93ba('0xa8')]){_0x287bf8[_0x93ba('0xa8')]=_0x1691c6[_0x93ba('0xa8')];if(_0x287bf8['headers'][_0x93ba('0xa9')]){delete _0x287bf8[_0x93ba('0xa8')]['content-length'];}}if(_0x287bf8[_0x93ba('0xa8')][_0x93ba('0xaa')]){delete _0x287bf8[_0x93ba('0xa8')][_0x93ba('0xaa')];}return rp(_0x287bf8);})[_0x93ba('0x2b')](function(_0x38f569){if(_0x38f569){_0xd9324e[_0x93ba('0x25')](_0x38f569[_0x93ba('0xa8')]);logger['info'](_0x38f569['body']);if(_[_0x93ba('0xab')](_0x1691c6[_0x93ba('0x3c')][_0x93ba('0x5')],'download')&&_0x38f569[_0x93ba('0xac')]==0x1f4){return _0xd9324e[_0x93ba('0x30')](_0x38f569[_0x93ba('0xac')]);}else{return _0xd9324e[_0x93ba('0x1e')](_0x38f569['statusCode'])[_0x93ba('0x9c')](_0x38f569[_0x93ba('0x94')]);}}else{return _0xd9324e['sendStatus'](0xc8);}})[_0x93ba('0x4f')](handleError(_0xd9324e,null));};exports[_0x93ba('0xad')]=function(_0x5bd10e,_0x67ddd6,_0x480ea2){return BPromise[_0x93ba('0xa0')]()[_0x93ba('0x2b')](function(){if(!_0x5bd10e['query'][_0x93ba('0x5')]){throw new Error(_0x93ba('0xae'));}if(!_0x5bd10e[_0x93ba('0x3c')][_0x93ba('0xa1')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x35c329=_0x5bd10e['query'][_0x93ba('0xa3')]?_0x5bd10e[_0x93ba('0x3c')]['hostname']+':'+_0x5bd10e[_0x93ba('0x3c')][_0x93ba('0xa1')]:'http://localhost:'+_0x5bd10e[_0x93ba('0x3c')]['port'];var _0x4d3a67=_0x5bd10e[_0x93ba('0x3c')]['json']?_0x5bd10e[_0x93ba('0x3c')][_0x93ba('0x20')]:!![];var _0x176950=_0x5bd10e[_0x93ba('0x3c')][_0x93ba('0xa5')]?_0x5bd10e['query'][_0x93ba('0xa5')]:null;var _0x3773dd={'method':_0x5bd10e[_0x93ba('0xa6')],'uri':util[_0x93ba('0x55')](_0x93ba('0xa7'),_0x35c329,_0x5bd10e[_0x93ba('0x3c')][_0x93ba('0x5')]),'json':_0x4d3a67,'resolveWithFullResponse':!![],'encoding':_0x176950,'body':_0x5bd10e['body']};if(_0x5bd10e[_0x93ba('0xa8')]){_0x3773dd[_0x93ba('0xa8')]=_0x5bd10e[_0x93ba('0xa8')];if(_0x3773dd[_0x93ba('0xa8')][_0x93ba('0xa9')]){delete _0x3773dd[_0x93ba('0xa8')][_0x93ba('0xa9')];}}if(_0x3773dd[_0x93ba('0xa8')][_0x93ba('0xaa')]){delete _0x3773dd['headers'][_0x93ba('0xaa')];}return rp(_0x3773dd);})['then'](function(_0xc14ca4){if(_0xc14ca4){_0x67ddd6[_0x93ba('0x25')](_0xc14ca4['headers']);logger['info'](_0xc14ca4[_0x93ba('0x94')]);return _0x67ddd6['status'](_0xc14ca4[_0x93ba('0xac')])[_0x93ba('0x9c')](_0xc14ca4[_0x93ba('0x94')]);}else{return _0x67ddd6[_0x93ba('0x30')](0xc8);}})[_0x93ba('0x4f')](handleError(_0x67ddd6,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index e9af01f..234af66 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 _0x91c6=['hook','events','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x509e19,_0x5b7d8e){var _0x19b9f4=function(_0x3281bc){while(--_0x3281bc){_0x509e19['push'](_0x509e19['shift']());}};_0x19b9f4(++_0x5b7d8e);}(_0x91c6,0xf9));var _0x691c=function(_0xdafe1b,_0x2efcd0){_0xdafe1b=_0xdafe1b-0x0;var _0x1f1697=_0x91c6[_0xdafe1b];return _0x1f1697;};'use strict';var EventEmitter=require(_0x691c('0x0'));var Plugin=require('../../mysqldb')['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0x691c('0x1')](0x0);var events={'afterCreate':_0x691c('0x2'),'afterUpdate':_0x691c('0x3'),'afterDestroy':_0x691c('0x4')};function emitEvent(_0xa7799c){return function(_0x4944ce,_0xa14528,_0x10c5df){PluginEvents[_0x691c('0x5')](_0xa7799c+':'+_0x4944ce['id'],_0x4944ce);PluginEvents[_0x691c('0x5')](_0xa7799c,_0x4944ce);_0x10c5df(null);};}for(var e in events){if(events[_0x691c('0x6')](e)){var event=events[e];Plugin[_0x691c('0x7')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file +var _0x3d49=['emit','../../mysqldb','Plugin','setMaxListeners','save','remove'];(function(_0x48e2eb,_0x2df535){var _0x5eca92=function(_0x170b22){while(--_0x170b22){_0x48e2eb['push'](_0x48e2eb['shift']());}};_0x5eca92(++_0x2df535);}(_0x3d49,0x151));var _0x93d4=function(_0x5e944a,_0x2847b4){_0x5e944a=_0x5e944a-0x0;var _0x38f07b=_0x3d49[_0x5e944a];return _0x38f07b;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x93d4('0x0'))['db'][_0x93d4('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x93d4('0x2')](0x0);var events={'afterCreate':_0x93d4('0x3'),'afterUpdate':'update','afterDestroy':_0x93d4('0x4')};function emitEvent(_0x9846c2){return function(_0xa1de2e,_0x41313a,_0x20e6c7){PluginEvents[_0x93d4('0x5')](_0x9846c2+':'+_0xa1de2e['id'],_0xa1de2e);PluginEvents['emit'](_0x9846c2,_0xa1de2e);_0x20e6c7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index cadd5e9..869eff6 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 _0x73a9=['bluebird','request-promise','path','rimraf','../../config/environment','./plugin.attributes','exports','Plugin','util','moment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x73a9,0xda));var _0x973a=function(_0x2e071a,_0x49802b){_0x2e071a=_0x2e071a-0x0;var _0x53789d=_0x73a9[_0x2e071a];return _0x53789d;};'use strict';var _=require('lodash');var util=require(_0x973a('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x973a('0x1'));var BPromise=require(_0x973a('0x2'));var rp=require(_0x973a('0x3'));var fs=require('fs');var path=require(_0x973a('0x4'));var rimraf=require(_0x973a('0x5'));var config=require(_0x973a('0x6'));var attributes=require(_0x973a('0x7'));module[_0x973a('0x8')]=function(_0x290576,_0x1c888f){return _0x290576['define'](_0x973a('0x9'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe776=['../../config/logger','api','moment','bluebird','request-promise','rimraf','./plugin.attributes','exports','define','lodash','util'];(function(_0x3122fe,_0x356de0){var _0x522c5d=function(_0x18f396){while(--_0x18f396){_0x3122fe['push'](_0x3122fe['shift']());}};_0x522c5d(++_0x356de0);}(_0xe776,0xc4));var _0x6e77=function(_0x38d30e,_0x2c0193){_0x38d30e=_0x38d30e-0x0;var _0x8a03a4=_0xe776[_0x38d30e];return _0x8a03a4;};'use strict';var _=require(_0x6e77('0x0'));var util=require(_0x6e77('0x1'));var logger=require(_0x6e77('0x2'))(_0x6e77('0x3'));var moment=require(_0x6e77('0x4'));var BPromise=require(_0x6e77('0x5'));var rp=require(_0x6e77('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6e77('0x7'));var config=require('../../config/environment');var attributes=require(_0x6e77('0x8'));module[_0x6e77('0x9')]=function(_0x16ecd2,_0x1eac41){return _0x16ecd2[_0x6e77('0xa')]('Plugin',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 8f90be5..5bb8c5d 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 _0xf301=['jayson/promise','client','http','redis','defaults','localhost','register','request','info','Plugin,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','CreatePlugin','Plugin','create','options','raw','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x12ddff,_0x525f29){var _0x2f58e9=function(_0x59710b){while(--_0x59710b){_0x12ddff['push'](_0x12ddff['shift']());}};_0x2f58e9(++_0x525f29);}(_0xf301,0x1d8));var _0x1f30=function(_0x405d70,_0x13e469){_0x405d70=_0x405d70-0x0;var _0x46a722=_0xf301[_0x405d70];return _0x46a722;};'use strict';var _=require('lodash');var util=require(_0x1f30('0x0'));var moment=require(_0x1f30('0x1'));var BPromise=require(_0x1f30('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1f30('0x3'))['db'];var utils=require(_0x1f30('0x4'));var logger=require(_0x1f30('0x5'))(_0x1f30('0x6'));var config=require(_0x1f30('0x7'));var jayson=require(_0x1f30('0x8'));var client=jayson[_0x1f30('0x9')][_0x1f30('0xa')]({'port':0x232a});config[_0x1f30('0xb')]=_[_0x1f30('0xc')](config['redis'],{'host':_0x1f30('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1f30('0xb')]));require('./plugin.socket')[_0x1f30('0xe')](socket);function respondWithRpcPromise(_0xf9ce7,_0xfab698,_0x40b204){return new BPromise(function(_0x280938,_0x14505f){return client[_0x1f30('0xf')](_0xf9ce7,_0x40b204)['then'](function(_0x4027ea){logger[_0x1f30('0x10')](_0x1f30('0x11'),_0xfab698,'request\x20sent');logger[_0x1f30('0x12')]('Plugin,\x20%s,\x20%s,\x20%s',_0xfab698,_0x1f30('0x13'),JSON[_0x1f30('0x14')](_0x4027ea));if(_0x4027ea['error']){if(_0x4027ea[_0x1f30('0x15')][_0x1f30('0x16')]===0x1f4){logger['error'](_0x1f30('0x11'),_0xfab698,_0x4027ea[_0x1f30('0x15')][_0x1f30('0x17')]);return _0x14505f(_0x4027ea['error'][_0x1f30('0x17')]);}logger[_0x1f30('0x15')](_0x1f30('0x11'),_0xfab698,_0x4027ea[_0x1f30('0x15')][_0x1f30('0x17')]);return _0x280938(_0x4027ea[_0x1f30('0x15')][_0x1f30('0x17')]);}else{logger[_0x1f30('0x10')]('Plugin,\x20%s,\x20%s',_0xfab698,'request\x20sent');_0x280938(_0x4027ea['result'][_0x1f30('0x17')]);}})['catch'](function(_0x56cf33){logger[_0x1f30('0x15')](_0x1f30('0x11'),_0xfab698,_0x56cf33);_0x14505f(_0x56cf33);});});}exports[_0x1f30('0x18')]=function(_0x4b0587){var _0x176826=this;return new Promise(function(_0x2e46f0,_0x492b9e){return db[_0x1f30('0x19')][_0x1f30('0x1a')](_0x4b0587['body'],{'raw':_0x4b0587[_0x1f30('0x1b')]?_0x4b0587[_0x1f30('0x1b')][_0x1f30('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x347a6a){logger[_0x1f30('0x10')](_0x1f30('0x18'),_0x4b0587);logger[_0x1f30('0x12')]('CreatePlugin',_0x4b0587,JSON[_0x1f30('0x14')](_0x347a6a));_0x2e46f0(_0x347a6a);})[_0x1f30('0x1d')](function(_0xf6ba87){logger['error'](_0x1f30('0x18'),_0xf6ba87['message'],_0x4b0587);_0x492b9e(_0x176826[_0x1f30('0x15')](0x1f4,_0xf6ba87[_0x1f30('0x17')]));});});}; \ No newline at end of file +var _0x1a86=['moment','bluebird','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','./plugin.socket','request','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','code','error','Plugin,\x20%s,\x20%s','message','info','result','catch','CreatePlugin','create','body','options','raw','lodash'];(function(_0x32af18,_0x3d817d){var _0xc6c5e=function(_0x480bd9){while(--_0x480bd9){_0x32af18['push'](_0x32af18['shift']());}};_0xc6c5e(++_0x3d817d);}(_0x1a86,0x1a3));var _0x61a8=function(_0x1da75c,_0x1bba14){_0x1da75c=_0x1da75c-0x0;var _0x3eb03f=_0x1a86[_0x1da75c];return _0x3eb03f;};'use strict';var _=require(_0x61a8('0x0'));var util=require('util');var moment=require(_0x61a8('0x1'));var BPromise=require(_0x61a8('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(_0x61a8('0x3'))(_0x61a8('0x4'));var config=require(_0x61a8('0x5'));var jayson=require(_0x61a8('0x6'));var client=jayson[_0x61a8('0x7')]['http']({'port':0x232a});config[_0x61a8('0x8')]=_[_0x61a8('0x9')](config[_0x61a8('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x61a8('0x8')]));require(_0x61a8('0xa'))['register'](socket);function respondWithRpcPromise(_0x67c915,_0x216167,_0x2d1092){return new BPromise(function(_0x814454,_0x4683df){return client[_0x61a8('0xb')](_0x67c915,_0x2d1092)['then'](function(_0x4dbebe){logger['info']('Plugin,\x20%s,\x20%s',_0x216167,_0x61a8('0xc'));logger[_0x61a8('0xd')](_0x61a8('0xe'),_0x216167,_0x61a8('0xc'),JSON[_0x61a8('0xf')](_0x4dbebe));if(_0x4dbebe['error']){if(_0x4dbebe['error'][_0x61a8('0x10')]===0x1f4){logger[_0x61a8('0x11')](_0x61a8('0x12'),_0x216167,_0x4dbebe[_0x61a8('0x11')][_0x61a8('0x13')]);return _0x4683df(_0x4dbebe['error']['message']);}logger['error'](_0x61a8('0x12'),_0x216167,_0x4dbebe[_0x61a8('0x11')]['message']);return _0x814454(_0x4dbebe[_0x61a8('0x11')][_0x61a8('0x13')]);}else{logger[_0x61a8('0x14')](_0x61a8('0x12'),_0x216167,'request\x20sent');_0x814454(_0x4dbebe[_0x61a8('0x15')]['message']);}})[_0x61a8('0x16')](function(_0x43c1d3){logger[_0x61a8('0x11')]('Plugin,\x20%s,\x20%s',_0x216167,_0x43c1d3);_0x4683df(_0x43c1d3);});});}exports[_0x61a8('0x17')]=function(_0x370cc9){var _0x5b6c75=this;return new Promise(function(_0x5942c8,_0x2f371e){return db['Plugin'][_0x61a8('0x18')](_0x370cc9[_0x61a8('0x19')],{'raw':_0x370cc9[_0x61a8('0x1a')]?_0x370cc9[_0x61a8('0x1a')][_0x61a8('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x19a007){logger['info'](_0x61a8('0x17'),_0x370cc9);logger[_0x61a8('0xd')](_0x61a8('0x17'),_0x370cc9,JSON[_0x61a8('0xf')](_0x19a007));_0x5942c8(_0x19a007);})[_0x61a8('0x16')](function(_0x2ce2ed){logger[_0x61a8('0x11')]('CreatePlugin',_0x2ce2ed[_0x61a8('0x13')],_0x370cc9);_0x2f371e(_0x5b6c75['error'](0x1f4,_0x2ce2ed['message']));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index a02e7b7..3dd494c 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 _0x9713=['removeListener','register','length','plugin:','./plugin.events','save','remove','update','emit'];(function(_0x48c196,_0x566d72){var _0x5af1c9=function(_0x558f75){while(--_0x558f75){_0x48c196['push'](_0x48c196['shift']());}};_0x5af1c9(++_0x566d72);}(_0x9713,0xdc));var _0x3971=function(_0x126183,_0xe25054){_0x126183=_0x126183-0x0;var _0x27a3f6=_0x9713[_0x126183];return _0x27a3f6;};'use strict';var PluginEvents=require(_0x3971('0x0'));var events=[_0x3971('0x1'),_0x3971('0x2'),_0x3971('0x3')];function createListener(_0x274264,_0x130c57){return function(_0x23a417){_0x130c57[_0x3971('0x4')](_0x274264,_0x23a417);};}function removeListener(_0x1ac9b8,_0x58c5a1){return function(){PluginEvents[_0x3971('0x5')](_0x1ac9b8,_0x58c5a1);};}exports[_0x3971('0x6')]=function(_0x28cdf9){for(var _0x2e1598=0x0,_0x383155=events[_0x3971('0x7')];_0x2e1598<_0x383155;_0x2e1598++){var _0x3b4434=events[_0x2e1598];var _0x3b7abf=createListener(_0x3971('0x8')+_0x3b4434,_0x28cdf9);PluginEvents['on'](_0x3b4434,_0x3b7abf);}}; \ No newline at end of file +var _0xba95=['register','length','plugin:','save','remove','removeListener'];(function(_0x2e35b5,_0x8f37cd){var _0x2db6e2=function(_0x25bddd){while(--_0x25bddd){_0x2e35b5['push'](_0x2e35b5['shift']());}};_0x2db6e2(++_0x8f37cd);}(_0xba95,0x1a1));var _0x5ba9=function(_0x4f47b6,_0x54f2a3){_0x4f47b6=_0x4f47b6-0x0;var _0x63297=_0xba95[_0x4f47b6];return _0x63297;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0x5ba9('0x0'),_0x5ba9('0x1'),'update'];function createListener(_0x89789,_0x5a2552){return function(_0x4cf001){_0x5a2552['emit'](_0x89789,_0x4cf001);};}function removeListener(_0x440313,_0x204cca){return function(){PluginEvents[_0x5ba9('0x2')](_0x440313,_0x204cca);};}exports[_0x5ba9('0x3')]=function(_0x3c16e4){for(var _0x35840f=0x0,_0x257877=events[_0x5ba9('0x4')];_0x35840f<_0x257877;_0x35840f++){var _0x5414fc=events[_0x35840f];var _0x12cdba=createListener(_0x5ba9('0x5')+_0x5414fc,_0x3c16e4);PluginEvents['on'](_0x5414fc,_0x12cdba);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 606f10d..6d83beb 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(_0x1d32b8,_0x324164){var _0x1d1d56=function(_0x4edd69){while(--_0x4edd69){_0x1d32b8['push'](_0x1d32b8['shift']());}};_0x1d1d56(++_0x324164);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'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(_0xb364d4,_0x70819e){var _0x1718be=function(_0x2ca436){while(--_0x2ca436){_0xb364d4['push'](_0xb364d4['shift']());}};_0x1718be(++_0x70819e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'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 cad3fb2..5b00af2 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 _0xd3d1=['Unknown\x20id','lodash','../../config/pm2','path','child_process','exec','bluebird','sendStatus','status','json','error','name','send','npm\x20install','info','index','list','then','reject','express','motion2','length','catch','describe','create','join','../../files/plugins','body','script','cwd','chdir','dirname','start','dump','Missing\x20name\x20and/or\x20path','update','restart','hasOwnProperty','params','destroy','delete'];(function(_0x4a811a,_0x4a43be){var _0x358fde=function(_0x10eb32){while(--_0x10eb32){_0x4a811a['push'](_0x4a811a['shift']());}};_0x358fde(++_0x4a43be);}(_0xd3d1,0x172));var _0x1d3d=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0xd3d1[_0x164eca];return _0x2ce562;};'use strict';var _=require(_0x1d3d('0x0'));var pm2=require(_0x1d3d('0x1'));var logger=require('../../config/logger')('api');var path=require(_0x1d3d('0x2'));var exec=require(_0x1d3d('0x3'))[_0x1d3d('0x4')];var BPromise=require(_0x1d3d('0x5'));function handleEntityNotFound(_0x41a806,_0x328a4e){return function(_0x2445e8){if(!_0x2445e8){_0x41a806[_0x1d3d('0x6')](0x194);;}return _0x2445e8;};}function respondWithResult(_0x1cbe06,_0x449475){_0x449475=_0x449475||0xc8;return function(_0x3831ce){if(_0x3831ce){return _0x1cbe06[_0x1d3d('0x7')](_0x449475)[_0x1d3d('0x8')](_0x3831ce);}return null;};}function handleError(_0x2c377c,_0xbea61e){_0xbea61e=_0xbea61e||0x1f4;return function(_0x2ba122){logger[_0x1d3d('0x9')](_0x2ba122['stack']);if(_0x2ba122[_0x1d3d('0xa')]){delete _0x2ba122[_0x1d3d('0xa')];}_0x2c377c[_0x1d3d('0x7')](_0xbea61e)[_0x1d3d('0xb')](_0x2ba122);};}function execChildProcess(){return new BPromise(function(_0x27d914,_0x372ff2){exec(_0x1d3d('0xc'),function(_0x2fa11e,_0x3b3913,_0x3cffa5){logger[_0x1d3d('0xd')](_0x3b3913);logger['info'](_0x3cffa5);if(_0x2fa11e){logger[_0x1d3d('0x9')](_0x2fa11e);return _0x372ff2(_0x2fa11e);}return _0x27d914(_0x3b3913);});});}exports[_0x1d3d('0xe')]=function(_0x494b82,_0x4dd753){return pm2[_0x1d3d('0xf')]()[_0x1d3d('0x10')](function(_0x1a8035){if(_0x1a8035){var _0x59b907=_[_0x1d3d('0x11')](_0x1a8035,function(_0x4dcc22){return _0x4dcc22[_0x1d3d('0xa')]===_0x1d3d('0x12')||_0x4dcc22[_0x1d3d('0xa')]===_0x1d3d('0x13');});return{'rows':_0x59b907,'count':_0x59b907[_0x1d3d('0x14')]};}return null;})[_0x1d3d('0x10')](respondWithResult(_0x4dd753,null))[_0x1d3d('0x15')](handleError(_0x4dd753,null));};exports['show']=function(_0x5d3ac9,_0x316ab4){return pm2[_0x1d3d('0x16')](_0x5d3ac9['params']['id'])[_0x1d3d('0x10')](respondWithResult(_0x316ab4,null))['then'](handleEntityNotFound(_0x316ab4,null))[_0x1d3d('0x15')](handleError(_0x316ab4,null));};exports[_0x1d3d('0x17')]=function(_0x2cd430,_0x2d6dfb){if(_0x2cd430['body'][_0x1d3d('0xa')]&&_0x2cd430['body']['script']){var _0x108005=path[_0x1d3d('0x18')](__dirname,_0x1d3d('0x19'),_0x2cd430[_0x1d3d('0x1a')][_0x1d3d('0x1b')]);var _0xe4afa2=process[_0x1d3d('0x1c')]();process[_0x1d3d('0x1d')](path[_0x1d3d('0x1e')](_0x108005));return execChildProcess()[_0x1d3d('0x10')](function(_0x1610a6){process['chdir'](_0xe4afa2);return pm2[_0x1d3d('0x1f')]({'name':_0x2cd430[_0x1d3d('0x1a')]['name'],'script':_0x108005});})[_0x1d3d('0x10')](function(_0x5c52da){pm2[_0x1d3d('0x20')]();return _0x5c52da[0x0];})[_0x1d3d('0x10')](respondWithResult(_0x2d6dfb,0xc9))[_0x1d3d('0x15')](handleError(_0x2d6dfb,null));}else{return _0x2d6dfb[_0x1d3d('0x7')](0x1f4)[_0x1d3d('0xb')]({'message':_0x1d3d('0x21')});}};exports[_0x1d3d('0x22')]=function(_0x298fd3,_0x2294ee){if(_0x298fd3[_0x1d3d('0x1a')]['id']){delete _0x298fd3[_0x1d3d('0x1a')]['id'];}var _0x4f0aa7={'online':_0x1d3d('0x23'),'stopped':'stop'};if(_0x4f0aa7[_0x1d3d('0x24')](_0x298fd3[_0x1d3d('0x1a')]['status'])){return pm2[_0x4f0aa7[_0x298fd3[_0x1d3d('0x1a')][_0x1d3d('0x7')]]](_0x298fd3[_0x1d3d('0x25')]['id'])[_0x1d3d('0x10')](respondWithResult(_0x2294ee,0xc8))['catch'](handleError(_0x2294ee,null));}else{return _0x2294ee[_0x1d3d('0x7')](0x1f4)[_0x1d3d('0xb')]({'message':'Unknown\x20status'});}};exports[_0x1d3d('0x26')]=function(_0x4845b7,_0x4c04a8){if(_0x4845b7[_0x1d3d('0x1a')]['id']){delete _0x4845b7['body']['id'];}if(_0x4845b7[_0x1d3d('0x25')]['id']){return pm2[_0x1d3d('0x27')](_0x4845b7[_0x1d3d('0x25')]['id'])[_0x1d3d('0x10')](function(_0x3a4c01){pm2[_0x1d3d('0x20')]();return _0x3a4c01[0x0];})[_0x1d3d('0x10')](respondWithResult(_0x4c04a8,null))[_0x1d3d('0x15')](handleError(_0x4c04a8,null));}else{return _0x4c04a8[_0x1d3d('0x7')](0x1f4)['send']({'message':_0x1d3d('0x28')});}}; \ No newline at end of file +var _0x2f68=['dump','Unknown\x20id','../../config/pm2','../../config/logger','api','path','exec','sendStatus','status','error','name','send','npm\x20install','info','index','list','then','reject','express','motion2','length','catch','show','describe','params','create','body','join','../../files/plugins','chdir','dirname','start','Missing\x20name\x20and/or\x20path','restart','stop','Unknown\x20status','destroy','delete'];(function(_0x42f98c,_0x389786){var _0x4287fa=function(_0x231e8d){while(--_0x231e8d){_0x42f98c['push'](_0x42f98c['shift']());}};_0x4287fa(++_0x389786);}(_0x2f68,0x9a));var _0x82f6=function(_0x16681e,_0x110e0e){_0x16681e=_0x16681e-0x0;var _0x1356eb=_0x2f68[_0x16681e];return _0x1356eb;};'use strict';var _=require('lodash');var pm2=require(_0x82f6('0x0'));var logger=require(_0x82f6('0x1'))(_0x82f6('0x2'));var path=require(_0x82f6('0x3'));var exec=require('child_process')[_0x82f6('0x4')];var BPromise=require('bluebird');function handleEntityNotFound(_0x2a06dc,_0x2ab73d){return function(_0x5dad09){if(!_0x5dad09){_0x2a06dc[_0x82f6('0x5')](0x194);;}return _0x5dad09;};}function respondWithResult(_0x2c4302,_0x542737){_0x542737=_0x542737||0xc8;return function(_0x5a8089){if(_0x5a8089){return _0x2c4302[_0x82f6('0x6')](_0x542737)['json'](_0x5a8089);}return null;};}function handleError(_0x5daa3c,_0x864400){_0x864400=_0x864400||0x1f4;return function(_0xbd30d5){logger[_0x82f6('0x7')](_0xbd30d5['stack']);if(_0xbd30d5[_0x82f6('0x8')]){delete _0xbd30d5[_0x82f6('0x8')];}_0x5daa3c['status'](_0x864400)[_0x82f6('0x9')](_0xbd30d5);};}function execChildProcess(){return new BPromise(function(_0x1eec2f,_0x3f8320){exec(_0x82f6('0xa'),function(_0x1a68c4,_0x34bd7c,_0x4c870e){logger[_0x82f6('0xb')](_0x34bd7c);logger[_0x82f6('0xb')](_0x4c870e);if(_0x1a68c4){logger['error'](_0x1a68c4);return _0x3f8320(_0x1a68c4);}return _0x1eec2f(_0x34bd7c);});});}exports[_0x82f6('0xc')]=function(_0x1f8bf5,_0x397527){return pm2[_0x82f6('0xd')]()[_0x82f6('0xe')](function(_0xa00275){if(_0xa00275){var _0x115c7b=_[_0x82f6('0xf')](_0xa00275,function(_0x1e7cbc){return _0x1e7cbc['name']===_0x82f6('0x10')||_0x1e7cbc['name']===_0x82f6('0x11');});return{'rows':_0x115c7b,'count':_0x115c7b[_0x82f6('0x12')]};}return null;})[_0x82f6('0xe')](respondWithResult(_0x397527,null))[_0x82f6('0x13')](handleError(_0x397527,null));};exports[_0x82f6('0x14')]=function(_0x2326ae,_0x326378){return pm2[_0x82f6('0x15')](_0x2326ae[_0x82f6('0x16')]['id'])[_0x82f6('0xe')](respondWithResult(_0x326378,null))[_0x82f6('0xe')](handleEntityNotFound(_0x326378,null))[_0x82f6('0x13')](handleError(_0x326378,null));};exports[_0x82f6('0x17')]=function(_0x4fe226,_0x3a8269){if(_0x4fe226['body'][_0x82f6('0x8')]&&_0x4fe226[_0x82f6('0x18')]['script']){var _0x2b03ad=path[_0x82f6('0x19')](__dirname,_0x82f6('0x1a'),_0x4fe226[_0x82f6('0x18')]['script']);var _0xdc4dea=process['cwd']();process[_0x82f6('0x1b')](path[_0x82f6('0x1c')](_0x2b03ad));return execChildProcess()['then'](function(_0x516deb){process[_0x82f6('0x1b')](_0xdc4dea);return pm2[_0x82f6('0x1d')]({'name':_0x4fe226['body']['name'],'script':_0x2b03ad});})[_0x82f6('0xe')](function(_0x31face){pm2['dump']();return _0x31face[0x0];})[_0x82f6('0xe')](respondWithResult(_0x3a8269,0xc9))[_0x82f6('0x13')](handleError(_0x3a8269,null));}else{return _0x3a8269['status'](0x1f4)['send']({'message':_0x82f6('0x1e')});}};exports['update']=function(_0x469b6b,_0x5a6d69){if(_0x469b6b['body']['id']){delete _0x469b6b[_0x82f6('0x18')]['id'];}var _0x15c9b7={'online':_0x82f6('0x1f'),'stopped':_0x82f6('0x20')};if(_0x15c9b7['hasOwnProperty'](_0x469b6b[_0x82f6('0x18')][_0x82f6('0x6')])){return pm2[_0x15c9b7[_0x469b6b[_0x82f6('0x18')][_0x82f6('0x6')]]](_0x469b6b[_0x82f6('0x16')]['id'])[_0x82f6('0xe')](respondWithResult(_0x5a6d69,0xc8))[_0x82f6('0x13')](handleError(_0x5a6d69,null));}else{return _0x5a6d69[_0x82f6('0x6')](0x1f4)[_0x82f6('0x9')]({'message':_0x82f6('0x21')});}};exports[_0x82f6('0x22')]=function(_0x20d1c5,_0x6ce179){if(_0x20d1c5[_0x82f6('0x18')]['id']){delete _0x20d1c5['body']['id'];}if(_0x20d1c5[_0x82f6('0x16')]['id']){return pm2[_0x82f6('0x23')](_0x20d1c5[_0x82f6('0x16')]['id'])['then'](function(_0x36f37a){pm2[_0x82f6('0x24')]();return _0x36f37a[0x0];})[_0x82f6('0xe')](respondWithResult(_0x6ce179,null))[_0x82f6('0x13')](handleError(_0x6ce179,null));}else{return _0x6ce179[_0x82f6('0x6')](0x1f4)[_0x82f6('0x9')]({'message':_0x82f6('0x25')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 5ad6def..3c082e0 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 _0x2fe3=['express','../../components/auth/service','./realtime.controller','getAgents','get','/queues','isAuthenticated','getQueues'];(function(_0x1030ce,_0xbe3f74){var _0x3367fd=function(_0x387153){while(--_0x387153){_0x1030ce['push'](_0x1030ce['shift']());}};_0x3367fd(++_0xbe3f74);}(_0x2fe3,0xa8));var _0x32fe=function(_0x3b7570,_0x53c830){_0x3b7570=_0x3b7570-0x0;var _0x14b752=_0x2fe3[_0x3b7570];return _0x14b752;};'use strict';var express=require(_0x32fe('0x0'));var router=express['Router']();var auth=require(_0x32fe('0x1'));var controller=require(_0x32fe('0x2'));router['get']('/agents',auth['isAuthenticated'](),controller[_0x32fe('0x3')]);router[_0x32fe('0x4')](_0x32fe('0x5'),auth[_0x32fe('0x6')](),controller[_0x32fe('0x7')]);module['exports']=router; \ No newline at end of file +var _0x5c54=['./realtime.controller','get','isAuthenticated','getAgents','/queues','getQueues','express','Router','../../components/auth/service'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0x5c54,0xe7));var _0x45c5=function(_0x3f429f,_0x4bf6b0){_0x3f429f=_0x3f429f-0x0;var _0x394631=_0x5c54[_0x3f429f];return _0x394631;};'use strict';var express=require(_0x45c5('0x0'));var router=express[_0x45c5('0x1')]();var auth=require(_0x45c5('0x2'));var controller=require(_0x45c5('0x3'));router[_0x45c5('0x4')]('/agents',auth[_0x45c5('0x5')](),controller[_0x45c5('0x6')]);router[_0x45c5('0x4')](_0x45c5('0x7'),auth[_0x45c5('0x5')](),controller[_0x45c5('0x8')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index b54e729..5ee5a93 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 _0xdf04=['outbound','push','pTalking','originated','message','dialActive','dialMethod','Trunk','startPredictive','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','map','agents','loggedInDb','busy','find','merge','pick','length','some','connectedlinenum','internal','toString','getMembers','UserId','accountcode','voiceStatus','online','startCase','Queue','Pause','findAll','QueueId','idle','unknown','ringing','isNil','chatPause','faxPause','mailPause','openchannelPause','voicePause','pause','every','chatStatus','faxStatus','mailStatus','smsStatus','whatsappStatus','*pause','userpic','lastLoginAt','pauseType','lastPauseAt','address','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','openchannelStatus','chatStatusTime','openchannelStatusTime','smsStatusTime','faxStatusTime','voiceStatusTime','queue','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','smsPause','whatsappPause','query','sort','includes','globalStatus','resolve','User','rawAttributes','fieldName','type','key','role','agent','getOptions','raw','user','Agents','nolimit','filter','UserProfile','findAndCountAll','rows','omit','desc','orderBy','asc','globalStatusFilter','pauseTypeFilter','getQueues','mail','sms','fax','channel','toLowerCase','Invalid\x20channel','userProfileId','QueueCampaigns','all','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','client','http','offset','undefined','limit','count','status','set','Content-Range','json','error','stack','name','send','request','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','result','catch','voice','Queues','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','VoiceQueuesChannels','loggedIn','available','waiting','talking','paused'];(function(_0x1aed80,_0x3ca6f6){var _0x43961e=function(_0x43bf2b){while(--_0x43bf2b){_0x1aed80['push'](_0x1aed80['shift']());}};_0x43961e(++_0x3ca6f6);}(_0xdf04,0x7c));var _0x4df0=function(_0x38ec1d,_0x43d9bc){_0x38ec1d=_0x38ec1d-0x0;var _0x3164ac=_0xdf04[_0x38ec1d];return _0x3164ac;};'use strict';var util=require('util');var _=require(_0x4df0('0x0'));var jayson=require('jayson/promise');var qs=require(_0x4df0('0x1'));var logger=require(_0x4df0('0x2'))(_0x4df0('0x3'));var db=require(_0x4df0('0x4'))['db'];var amiClient=jayson[_0x4df0('0x5')][_0x4df0('0x6')]({'port':0x232a});var routingClient=jayson[_0x4df0('0x5')][_0x4df0('0x6')]({'port':0x232c});function respondWithFilteredResult(_0x57742c,_0x396a7f){return function(_0x579ffd){if(_0x579ffd){var _0x1e9e75=typeof _0x396a7f[_0x4df0('0x7')]===_0x4df0('0x8')&&typeof _0x396a7f[_0x4df0('0x9')]===_0x4df0('0x8');var _0x153529=_0x579ffd['count'];var _0x2bff69=_0x1e9e75?0x0:_0x396a7f[_0x4df0('0x7')];var _0x51923a=_0x1e9e75?_0x579ffd[_0x4df0('0xa')]:_0x396a7f[_0x4df0('0x7')]+_0x396a7f[_0x4df0('0x9')];var _0x500ca9;if(_0x51923a>=_0x153529){_0x51923a=_0x153529;_0x500ca9=0xc8;}else{_0x500ca9=0xce;}_0x57742c[_0x4df0('0xb')](_0x500ca9);return _0x57742c[_0x4df0('0xc')](_0x4df0('0xd'),_0x2bff69+'-'+_0x51923a+'/'+_0x153529)[_0x4df0('0xe')](_0x579ffd);}return null;};}function handleError(_0x5c9577,_0x37cfdb){_0x37cfdb=_0x37cfdb||0x1f4;return function(_0x575a24){logger[_0x4df0('0xf')](_0x575a24[_0x4df0('0x10')]);if(_0x575a24[_0x4df0('0x11')]){delete _0x575a24[_0x4df0('0x11')];}_0x5c9577[_0x4df0('0xb')](_0x37cfdb)[_0x4df0('0x12')](_0x575a24);};}function getRealtimeAgents(){return new Promise(function(_0x46fb37,_0xd266e8){return amiClient[_0x4df0('0x13')]('Agents',{})[_0x4df0('0x14')](function(_0x5aaa1c){if(_0x5aaa1c[_0x4df0('0xf')])throw new Error(_0x4df0('0x15'));var _0x12d1b7=_0x5aaa1c['result'];return routingClient['request']('Agents',{})['then'](function(_0x55e0a0){if(_0x55e0a0[_0x4df0('0xf')])throw new Error(_0x4df0('0x16'));var _0x364e9e=_0x55e0a0[_0x4df0('0x17')];return _0x46fb37(_['merge']({},_0x12d1b7,_0x364e9e));});})[_0x4df0('0x18')](function(_0x2c3d77){_0xd266e8(_0x2c3d77);});});}function getRealtimeQueues(_0x358c9d,_0x10924e){return new Promise(function(_0x302512,_0x4e0e69){var _0x5c3807=_0x10924e===_0x4df0('0x19')?amiClient:routingClient;return _0x5c3807[_0x4df0('0x13')](_['startCase'](_0x10924e)+_0x4df0('0x1a'),_0x358c9d)[_0x4df0('0x14')](function(_0x36d7e9){if(_0x36d7e9[_0x4df0('0xf')])throw new Error(util[_0x4df0('0x1b')](_0x4df0('0x1c'),_0x10924e));return _0x302512(_0x36d7e9[_0x4df0('0x17')]);})[_0x4df0('0x18')](function(_0x25ee5e){_0x4e0e69(_0x25ee5e);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x984bfb,_0x30ba38){return amiClient['request'](_0x4df0('0x1d'),{})[_0x4df0('0x14')](function(_0x4cf5a0){if(_0x4cf5a0[_0x4df0('0xf')])throw new Error('Unable\x20to\x20retrieve\x20voice\x20queues\x20channels');return _0x984bfb(_0x4cf5a0[_0x4df0('0x17')]);})[_0x4df0('0x18')](function(_0x5a947b){_0x30ba38(_0x5a947b);});});}function initializeQueues(_0x3b0177,_0x56f158,_0x3c908d,_0x42073b){var _0x8ed805=[_0x4df0('0x1e'),_0x4df0('0x1f'),_0x4df0('0x20'),_0x4df0('0x21'),_0x4df0('0x22')];if(_0x3c908d==='voice'&&_0x42073b===_0x4df0('0x23')){_0x8ed805[_0x4df0('0x24')](_0x4df0('0x25'),_0x4df0('0x26'),_0x4df0('0x27'),_0x4df0('0x28'),_0x4df0('0x29'),_0x4df0('0x2a'),_0x4df0('0x2b'),'startProgressive','erlangCalls',_0x4df0('0x2c'),_0x4df0('0x2d'),_0x4df0('0x2e'),_0x4df0('0x2f'),_0x4df0('0x30'),_0x4df0('0x31'),_0x4df0('0x32'),'predictiveIntervalTotalCalls',_0x4df0('0x33'),_0x4df0('0x34'),'predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime',_0x4df0('0x35'));}return _0x3b0177[_0x4df0('0x36')](function(_0x1ddfd5){var _0x312638=_0x1ddfd5['get']({'plain':!![]});_0x312638[_0x4df0('0x37')]=[];_0x312638[_0x4df0('0x22')]=0x0;_0x312638[_0x4df0('0x38')]=0x0;_0x312638[_0x4df0('0x1e')]=0x0;_0x312638[_0x4df0('0x1f')]=0x0;_0x312638[_0x4df0('0x20')]=0x0;if(_0x3c908d===_0x4df0('0x19')){_0x312638[_0x4df0('0x21')]=0x0;_0x312638[_0x4df0('0x39')]=0x0;if(_0x42073b===_0x4df0('0x23')){_0x312638[_0x4df0('0x25')]=0x0;_0x312638[_0x4df0('0x26')]=0x0;}}var _0x2245dd=_[_0x4df0('0x3a')](_0x56f158,['id',_0x312638['id']]);if(_0x2245dd)_[_0x4df0('0x3b')](_0x312638,_[_0x4df0('0x3c')](_0x2245dd,_0x8ed805));return _0x312638;});}function updateAgentVoiceStatus(_0x321864,_0x3b8c24,_0x3f66f7){var _0x534881=_['filter'](_0x3f66f7,['queue',_0x3b8c24[_0x4df0('0x11')]]);if(_0x534881[_0x4df0('0x3d')]===0x0)return _0x321864['busy']=!![];if(_[_0x4df0('0x3e')](_0x534881,[_0x4df0('0x3f'),_0x321864[_0x4df0('0x40')][_0x4df0('0x41')]()]))return _0x321864[_0x4df0('0x21')]=!![];if(!_0x321864[_0x4df0('0x21')])return _0x321864[_0x4df0('0x39')]=!![];}function getVoiceQueueAgents(_0x4e5eed,_0xfdc906,_0x51bcbf,_0x2d2bc4){var _0x276dac=_[_0x4df0('0x3a')](_0xfdc906,['id',_0x4e5eed['id']]);if(!_0x276dac)return _0x4e5eed;return _0x276dac[_0x4df0('0x42')]({'raw':!![]})[_0x4df0('0x14')](function(_0x52663a){for(var _0x3495e2=0x0;_0x3495e2<_0x52663a[_0x4df0('0x3d')];_0x3495e2++){var _0x36628e=_[_0x4df0('0x3a')](_0x51bcbf,['id',_0x52663a[_0x3495e2][_0x4df0('0x43')]]);if(!_0x36628e){_0x36628e={'id':_0x52663a[_0x3495e2][_0x4df0('0x43')],'name':_0x52663a[_0x3495e2][_0x4df0('0x43')],'accountcode':'','online':![]};}var _0x29d653={'id':_0x36628e['id'],'name':_0x36628e[_0x4df0('0x11')],'internal':_0x36628e[_0x4df0('0x44')],'online':Boolean(_0x36628e['online']),'paused':Boolean(_0x52663a[_0x3495e2][_0x4df0('0x22')])};if(_0x36628e[_0x4df0('0x45')]===_0x4df0('0x21'))updateAgentVoiceStatus(_0x29d653,_0x4e5eed,_0x2d2bc4);if(_0x29d653[_0x4df0('0x46')])_0x4e5eed[_0x4df0('0x38')]++;if(_0x29d653[_0x4df0('0x39')])_0x4e5eed['busy']++;if(_0x29d653[_0x4df0('0x22')]&&!_0x29d653[_0x4df0('0x39')]&&!_0x29d653[_0x4df0('0x21')])_0x4e5eed[_0x4df0('0x22')]++;_0x4e5eed[_0x4df0('0x37')][_0x4df0('0x24')](_0x29d653);}return _0x4e5eed;});}function getQueueAgents(_0x4114e1,_0x56e675,_0xb1d56a){var _0x7c4b9e='User'+_[_0x4df0('0x47')](_0xb1d56a)+_0x4df0('0x48');var _0x3679bc=_0xb1d56a+_0x4df0('0x49');return db[_0x7c4b9e][_0x4df0('0x4a')]({'where':{[_['startCase'](_0xb1d56a)+_0x4df0('0x4b')]:_0x4114e1['id']},'raw':!![]})[_0x4df0('0x14')](function(_0x249e38){for(var _0x4b0cba=0x0;_0x4b0cba<_0x249e38[_0x4df0('0x3d')];_0x4b0cba++){var _0x4795e4=_[_0x4df0('0x3a')](_0x56e675,['id',_0x249e38[_0x4b0cba]['UserId']]);if(!_0x4795e4){_0x4795e4={'id':_0x249e38[_0x4b0cba]['UserId'],'name':_0x249e38[_0x4b0cba][_0x4df0('0x43')],'online':![],['pauseField']:![]};}var _0x248ff8={'id':_0x4795e4['id'],'name':_0x4795e4[_0x4df0('0x11')],'online':Boolean(_0x4795e4[_0x4df0('0x46')]),'paused':Boolean(_0x4795e4[_0x3679bc])};if(_0x248ff8[_0x4df0('0x46')])_0x4114e1[_0x4df0('0x38')]++;_0x4114e1[_0x4df0('0x37')]['push'](_0x248ff8);}return _0x4114e1;});}function isIdle(_0x3202cf){return _0x3202cf===_0x4df0('0x4c')||_0x3202cf===_0x4df0('0x4d')||_0x3202cf==='unavailable'||_0x3202cf===_0x4df0('0x4e')||_[_0x4df0('0x4f')](_0x3202cf);}function isAgentPaused(_0x211307,_0x249911){var _0x7ad9c0=[_0x211307[_0x4df0('0x50')],_0x211307[_0x4df0('0x51')],_0x211307[_0x4df0('0x52')],_0x211307[_0x4df0('0x53')],_0x211307['smsPause'],_0x211307['voicePause'],_0x211307['whatsappPause']];if(!_0x249911)return _['every'](_0x7ad9c0);var _0x2f4b82=_['filter'](_0x7ad9c0);return _0x2f4b82[_0x4df0('0x3d')]>0x0&&_0x2f4b82['length']<_0x7ad9c0[_0x4df0('0x3d')]?!![]:![];}function isAgentIdle(_0x3cf89b){if(_0x3cf89b[_0x4df0('0x45')]!=='idle'&&_0x3cf89b[_0x4df0('0x54')]){_0x3cf89b['voiceStatus']=_0x4df0('0x55');return![];}return _[_0x4df0('0x56')]([_0x3cf89b[_0x4df0('0x57')],_0x3cf89b[_0x4df0('0x58')],_0x3cf89b[_0x4df0('0x59')],_0x3cf89b['openchannelStatus'],_0x3cf89b[_0x4df0('0x5a')],_0x3cf89b[_0x4df0('0x45')],_0x3cf89b[_0x4df0('0x5b')]],isIdle);}function getAgentStatus(_0xa01467){var _0x2ec73b=_0x4df0('0x4d');if(isAgentPaused(_0xa01467))_0x2ec73b=_0x4df0('0x55');else if(isAgentPaused(_0xa01467,!![]))_0x2ec73b=_0x4df0('0x5c');else if(isAgentIdle(_0xa01467))_0x2ec73b=_0x4df0('0x4c');else _0x2ec73b=_0x4df0('0x39');return _0x2ec73b;}exports['getAgents']=function(_0x47bd7a,_0x116dde){var _0x554283='';var _0x3b8a2a={'count':0x0,'rows':[]},_0xb678ad={},_0x4a8eaa,_0x30595b,_0x180d5e=[_0x4df0('0x5d'),_0x4df0('0x46'),_0x4df0('0x5e'),'lastPauseAt',_0x4df0('0x5f'),_0x4df0('0x60'),_0x4df0('0x40'),_0x4df0('0x61'),'chatPause',_0x4df0('0x53'),'mailPause','smsPause','whatsappPause',_0x4df0('0x51'),_0x4df0('0x54'),_0x4df0('0x62'),_0x4df0('0x63'),_0x4df0('0x64'),_0x4df0('0x65'),_0x4df0('0x66'),'faxCapacity',_0x4df0('0x67'),_0x4df0('0x68'),_0x4df0('0x69'),_0x4df0('0x6a'),_0x4df0('0x6b'),_0x4df0('0x6c'),_0x4df0('0x57'),_0x4df0('0x6d'),_0x4df0('0x59'),_0x4df0('0x5a'),_0x4df0('0x5b'),_0x4df0('0x58'),_0x4df0('0x45'),_0x4df0('0x6e'),_0x4df0('0x6f'),'mailStatusTime',_0x4df0('0x70'),'whatsappStatusTime',_0x4df0('0x71'),_0x4df0('0x72'),_0x4df0('0x73'),'destconnectedlinenum',_0x4df0('0x74'),_0x4df0('0x75'),_0x4df0('0x76'),_0x4df0('0x77')],_0x38b762=[_0x4df0('0x50'),'openchannelPause',_0x4df0('0x52'),_0x4df0('0x78'),_0x4df0('0x79'),_0x4df0('0x51'),'voicePause',_0x4df0('0x46')];if(_0x47bd7a[_0x4df0('0x7a')][_0x4df0('0x7b')]&&_0x47bd7a[_0x4df0('0x7a')][_0x4df0('0x7b')][_0x4df0('0x7c')](_0x4df0('0x7d'))){_0x554283=_0x47bd7a[_0x4df0('0x7a')][_0x4df0('0x7b')];_0x47bd7a[_0x4df0('0x7a')][_0x4df0('0x7b')]='';}Promise[_0x4df0('0x7e')]()[_0x4df0('0x14')](function(){var _0x542332=_[_0x4df0('0x36')](db[_0x4df0('0x7f')][_0x4df0('0x80')],function(_0x293662){return{'name':_0x293662[_0x4df0('0x81')],'type':_0x293662[_0x4df0('0x82')][_0x4df0('0x83')]};});_0x47bd7a['query'][_0x4df0('0x84')]=_0x4df0('0x85');_0x47bd7a[_0x4df0('0x7a')][_0x4df0('0x46')]=!![];_0xb678ad=qs[_0x4df0('0x86')](_0x542332,_0x47bd7a);_0xb678ad[_0x4df0('0x87')]=!![];if(_0x47bd7a['user'][_0x4df0('0x84')]===_0x4df0('0x88')){var _0x49fdf1={'params':{'id':_0x47bd7a[_0x4df0('0x88')]['userProfileId']},'query':{'section':_0x4df0('0x89'),'role':_0x4df0('0x85'),'online':!![],'nolimit':_0x47bd7a[_0x4df0('0x7a')][_0x4df0('0x8a')],'sort':_0x47bd7a[_0x4df0('0x7a')][_0x4df0('0x7b')],'filter':_0x47bd7a[_0x4df0('0x7a')][_0x4df0('0x8b')],'raw':!![]}};return db[_0x4df0('0x8c')]['getResources'](_0x49fdf1);}return db[_0x4df0('0x7f')][_0x4df0('0x8d')](_0xb678ad);})[_0x4df0('0x14')](function(_0x3c32d5){_0x3b8a2a[_0x4df0('0xa')]=_0x3c32d5['count'];_0x4a8eaa=_0x3c32d5[_0x4df0('0x8e')];return getRealtimeAgents();})[_0x4df0('0x14')](function(_0xe05702){_0x30595b=_0xe05702['rows'];return _0x4a8eaa[_0x4df0('0x36')](function(_0x517b5c){var _0x2b3100=_['find'](_0x30595b,['id',_0x517b5c['id']]);if(_0x2b3100)_[_0x4df0('0x3b')](_0x517b5c,_[_0x4df0('0x3c')](_[_0x4df0('0x8f')](_0x2b3100,_0x38b762),_0x180d5e));_0x517b5c['globalStatus']=getAgentStatus(_0x517b5c);return _0x517b5c;});})[_0x4df0('0x14')](function(_0x12d7d6){if(_0x554283['includes'](_0x4df0('0x7d'))){var _0x49c39e;if(_0x554283[_0x4df0('0x7c')]('-'))_0x49c39e=_['orderBy'](_0x12d7d6,'globalStatus',_0x4df0('0x90'));else _0x49c39e=_[_0x4df0('0x91')](_0x12d7d6,_0x4df0('0x7d'),_0x4df0('0x92'));return _0x49c39e;}return _0x12d7d6;})['then'](function(_0x3e344e){if(_0x47bd7a[_0x4df0('0x7a')]['globalStatusFilter']){var _0x30999e=_[_0x4df0('0x8b')](_0x3e344e,[_0x4df0('0x7d'),_0x47bd7a[_0x4df0('0x7a')][_0x4df0('0x93')]]);if(_0x47bd7a[_0x4df0('0x7a')][_0x4df0('0x94')]){_0x30999e=_[_0x4df0('0x8b')](_0x30999e,[_0x4df0('0x5f'),_0x47bd7a[_0x4df0('0x7a')]['pauseTypeFilter']]);}}_0x3b8a2a['rows']=_0x30999e||_0x3e344e;return _0x3b8a2a;})[_0x4df0('0x14')](respondWithFilteredResult(_0x116dde,_0xb678ad))['catch'](handleError(_0x116dde,null));};exports[_0x4df0('0x95')]=function(_0x57d8fd,_0x3cb8c9){var _0x5717e8=[_0x4df0('0x96'),'chat',_0x4df0('0x97'),'openchannel',_0x4df0('0x98'),'whatsapp',_0x4df0('0x19')];var _0x1d7f11={'count':0x0,'rows':[]},_0x1309e3={},_0x4d284b,_0x33d533,_0x1bafc8,_0x501b56,_0x4c8133;Promise[_0x4df0('0x7e')]()[_0x4df0('0x14')](function(){if(_0x57d8fd[_0x4df0('0x7a')][_0x4df0('0x99')]){if(!_[_0x4df0('0x7c')](_0x5717e8,_0x57d8fd['query']['channel'][_0x4df0('0x9a')]()))throw new Error(_0x4df0('0x9b'));_0x4d284b=_0x57d8fd[_0x4df0('0x7a')]['channel'][_0x4df0('0x9a')]();}var _0x4e81f2=_[_0x4df0('0x47')](_0x4d284b)+_0x4df0('0x48');var _0x55c481=_['map'](db[_0x4e81f2][_0x4df0('0x80')],function(_0x26cea2){return{'name':_0x26cea2[_0x4df0('0x81')],'type':_0x26cea2[_0x4df0('0x82')][_0x4df0('0x83')]};});_0x1309e3=qs[_0x4df0('0x86')](_0x55c481,_0x57d8fd);if(_0x57d8fd[_0x4df0('0x88')][_0x4df0('0x84')]===_0x4df0('0x88')){var _0x4e6f74={'params':{'id':_0x57d8fd[_0x4df0('0x88')][_0x4df0('0x9c')]},'query':{'section':_0x4d284b===_0x4df0('0x19')&&_0x57d8fd[_0x4df0('0x7a')][_0x4df0('0x82')]===_0x4df0('0x23')?_0x4df0('0x9d'):_[_0x4df0('0x47')](_0x4d284b)+'Queues','type':_0x57d8fd[_0x4df0('0x7a')]['type'],'nolimit':!![],'sort':_0x4df0('0x11'),'filter':_0x57d8fd[_0x4df0('0x7a')][_0x4df0('0x8b')]}};return db[_0x4df0('0x8c')]['getResources'](_0x4e6f74);}return db[_0x4e81f2]['findAndCountAll'](_0x1309e3);})[_0x4df0('0x14')](function(_0x4c13e5){_0x1d7f11[_0x4df0('0xa')]=_0x4c13e5[_0x4df0('0xa')];_0x33d533=_0x4c13e5[_0x4df0('0x8e')];return getRealtimeQueues(_0x57d8fd,_0x4d284b);})['then'](function(_0x53dadc){_0x501b56=_0x53dadc[_0x4df0('0x8e')];return getRealtimeAgents();})['then'](function(_0x30b4cb){_0x1bafc8=_0x30b4cb['rows'];if(_0x4d284b!=_0x4df0('0x19'))return;return getRealtimeVoiceQueueChannels();})[_0x4df0('0x14')](function(_0x539d9b){_0x4c8133=_0x539d9b?_0x539d9b['rows']:[];return initializeQueues(_0x33d533,_0x501b56,_0x4d284b,_0x57d8fd[_0x4df0('0x7a')]['type']);})[_0x4df0('0x14')](function(_0x34d96a){var _0x24ece2=_0x34d96a[_0x4df0('0x36')](function(_0x5a22ef){if(_0x4d284b==='voice')return getVoiceQueueAgents(_0x5a22ef,_0x33d533,_0x1bafc8,_0x4c8133);else return getQueueAgents(_0x5a22ef,_0x1bafc8,_0x4d284b);});return Promise[_0x4df0('0x9e')](_0x24ece2);})[_0x4df0('0x14')](function(_0x50bfa3){_0x1d7f11['rows']=_0x50bfa3;return _0x1d7f11;})[_0x4df0('0x14')](respondWithFilteredResult(_0x3cb8c9,_0x1309e3))[_0x4df0('0x18')](handleError(_0x3cb8c9,null));}; \ No newline at end of file +var _0xf725=['agents','Queue','Pause','QueueId','push','idle','unknown','unavailable','chatPause','faxPause','openchannelPause','smsPause','voicePause','whatsappPause','filter','pause','every','chatStatus','faxStatus','mailStatus','openchannelStatus','whatsappStatus','*pause','getAgents','userpic','lastLoginAt','lastPauseAt','address','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','faxCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','smsStatus','chatStatusTime','mailStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableAutomaticScreenRecording','routealias','mailPause','sort','globalStatus','query','resolve','fieldName','type','key','role','agent','getOptions','raw','user','nolimit','getResources','findAndCountAll','rows','omit','includes','orderBy','desc','asc','pauseTypeFilter','pauseType','mail','chat','sms','whatsapp','channel','toLowerCase','Invalid\x20channel','rawAttributes','userProfileId','QueueCampaigns','UserProfile','all','jayson/promise','api','../../mysqldb','client','http','offset','undefined','limit','count','status','set','Content-Range','json','error','stack','send','request','Agents','then','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','voice','startCase','Queues','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','available','waiting','paused','pTalking','originated','message','dialActive','dialMethod','Trunk','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','map','get','loggedInDb','loggedIn','talking','busy','outbound','find','queue','name','length','connectedlinenum','internal','toString','UserId','accountcode','online','voiceStatus'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xf725,0x17c));var _0x5f72=function(_0x3db5b9,_0x535012){_0x3db5b9=_0x3db5b9-0x0;var _0x3ebac3=_0xf725[_0x3db5b9];return _0x3ebac3;};'use strict';var util=require('util');var _=require('lodash');var jayson=require(_0x5f72('0x0'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x5f72('0x1'));var db=require(_0x5f72('0x2'))['db'];var amiClient=jayson[_0x5f72('0x3')][_0x5f72('0x4')]({'port':0x232a});var routingClient=jayson[_0x5f72('0x3')]['http']({'port':0x232c});function respondWithFilteredResult(_0x20e05d,_0xe88c34){return function(_0x3eda8d){if(_0x3eda8d){var _0x57ec25=typeof _0xe88c34[_0x5f72('0x5')]===_0x5f72('0x6')&&typeof _0xe88c34[_0x5f72('0x7')]===_0x5f72('0x6');var _0x21e14b=_0x3eda8d['count'];var _0x57b631=_0x57ec25?0x0:_0xe88c34[_0x5f72('0x5')];var _0x189d15=_0x57ec25?_0x3eda8d[_0x5f72('0x8')]:_0xe88c34['offset']+_0xe88c34[_0x5f72('0x7')];var _0x323622;if(_0x189d15>=_0x21e14b){_0x189d15=_0x21e14b;_0x323622=0xc8;}else{_0x323622=0xce;}_0x20e05d[_0x5f72('0x9')](_0x323622);return _0x20e05d[_0x5f72('0xa')](_0x5f72('0xb'),_0x57b631+'-'+_0x189d15+'/'+_0x21e14b)[_0x5f72('0xc')](_0x3eda8d);}return null;};}function handleError(_0x211ca8,_0x54af3f){_0x54af3f=_0x54af3f||0x1f4;return function(_0x2d72bf){logger[_0x5f72('0xd')](_0x2d72bf[_0x5f72('0xe')]);if(_0x2d72bf['name']){delete _0x2d72bf['name'];}_0x211ca8[_0x5f72('0x9')](_0x54af3f)[_0x5f72('0xf')](_0x2d72bf);};}function getRealtimeAgents(){return new Promise(function(_0xefa23e,_0x39717f){return amiClient[_0x5f72('0x10')](_0x5f72('0x11'),{})[_0x5f72('0x12')](function(_0x768913){if(_0x768913[_0x5f72('0xd')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');var _0x1f7f1a=_0x768913[_0x5f72('0x13')];return routingClient['request'](_0x5f72('0x11'),{})[_0x5f72('0x12')](function(_0x4c8e7f){if(_0x4c8e7f[_0x5f72('0xd')])throw new Error(_0x5f72('0x14'));var _0x57b0cb=_0x4c8e7f[_0x5f72('0x13')];return _0xefa23e(_[_0x5f72('0x15')]({},_0x1f7f1a,_0x57b0cb));});})[_0x5f72('0x16')](function(_0x29741f){_0x39717f(_0x29741f);});});}function getRealtimeQueues(_0x57260,_0x5f450b){return new Promise(function(_0x57836d,_0x4c3da2){var _0xeacfe3=_0x5f450b===_0x5f72('0x17')?amiClient:routingClient;return _0xeacfe3[_0x5f72('0x10')](_[_0x5f72('0x18')](_0x5f450b)+_0x5f72('0x19'),_0x57260)[_0x5f72('0x12')](function(_0xa35aa7){if(_0xa35aa7[_0x5f72('0xd')])throw new Error(util[_0x5f72('0x1a')](_0x5f72('0x1b'),_0x5f450b));return _0x57836d(_0xa35aa7[_0x5f72('0x13')]);})['catch'](function(_0xcc5c1a){_0x4c3da2(_0xcc5c1a);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x44c054,_0x2e9f5d){return amiClient[_0x5f72('0x10')]('VoiceQueuesChannels',{})['then'](function(_0x5e306a){if(_0x5e306a['error'])throw new Error(_0x5f72('0x1c'));return _0x44c054(_0x5e306a[_0x5f72('0x13')]);})[_0x5f72('0x16')](function(_0x53a6d3){_0x2e9f5d(_0x53a6d3);});});}function initializeQueues(_0xdcce88,_0x306f8e,_0x1a1b4f,_0xb5d41b){var _0x1da48b=['loggedIn',_0x5f72('0x1d'),_0x5f72('0x1e'),'talking',_0x5f72('0x1f')];if(_0x1a1b4f===_0x5f72('0x17')&&_0xb5d41b==='outbound'){_0x1da48b['push'](_0x5f72('0x20'),_0x5f72('0x21'),_0x5f72('0x22'),_0x5f72('0x23'),_0x5f72('0x24'),_0x5f72('0x25'),'startPredictive',_0x5f72('0x26'),_0x5f72('0x27'),_0x5f72('0x28'),_0x5f72('0x29'),_0x5f72('0x2a'),_0x5f72('0x2b'),_0x5f72('0x2c'),_0x5f72('0x2d'),_0x5f72('0x2e'),'predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls',_0x5f72('0x2f'),_0x5f72('0x30'),'predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime');}return _0xdcce88[_0x5f72('0x31')](function(_0x344ffc){var _0x43244b=_0x344ffc[_0x5f72('0x32')]({'plain':!![]});_0x43244b['agents']=[];_0x43244b['paused']=0x0;_0x43244b[_0x5f72('0x33')]=0x0;_0x43244b[_0x5f72('0x34')]=0x0;_0x43244b[_0x5f72('0x1d')]=0x0;_0x43244b['waiting']=0x0;if(_0x1a1b4f===_0x5f72('0x17')){_0x43244b[_0x5f72('0x35')]=0x0;_0x43244b[_0x5f72('0x36')]=0x0;if(_0xb5d41b===_0x5f72('0x37')){_0x43244b[_0x5f72('0x20')]=0x0;_0x43244b[_0x5f72('0x21')]=0x0;}}var _0x5c4bf7=_[_0x5f72('0x38')](_0x306f8e,['id',_0x43244b['id']]);if(_0x5c4bf7)_['merge'](_0x43244b,_['pick'](_0x5c4bf7,_0x1da48b));return _0x43244b;});}function updateAgentVoiceStatus(_0x563d89,_0x107528,_0x4106a1){var _0x3ac94e=_['filter'](_0x4106a1,[_0x5f72('0x39'),_0x107528[_0x5f72('0x3a')]]);if(_0x3ac94e[_0x5f72('0x3b')]===0x0)return _0x563d89[_0x5f72('0x36')]=!![];if(_['some'](_0x3ac94e,[_0x5f72('0x3c'),_0x563d89[_0x5f72('0x3d')][_0x5f72('0x3e')]()]))return _0x563d89[_0x5f72('0x35')]=!![];if(!_0x563d89[_0x5f72('0x35')])return _0x563d89[_0x5f72('0x36')]=!![];}function getVoiceQueueAgents(_0xc8eb32,_0x5989df,_0x4cb083,_0x66ee6a){var _0x59f190=_['find'](_0x5989df,['id',_0xc8eb32['id']]);if(!_0x59f190)return _0xc8eb32;return _0x59f190['getMembers']({'raw':!![]})[_0x5f72('0x12')](function(_0x29dfd6){for(var _0x44813d=0x0;_0x44813d<_0x29dfd6[_0x5f72('0x3b')];_0x44813d++){var _0x48e939=_[_0x5f72('0x38')](_0x4cb083,['id',_0x29dfd6[_0x44813d]['UserId']]);if(!_0x48e939){_0x48e939={'id':_0x29dfd6[_0x44813d][_0x5f72('0x3f')],'name':_0x29dfd6[_0x44813d]['UserId'],'accountcode':'','online':![]};}var _0x32989c={'id':_0x48e939['id'],'name':_0x48e939['name'],'internal':_0x48e939[_0x5f72('0x40')],'online':Boolean(_0x48e939[_0x5f72('0x41')]),'paused':Boolean(_0x29dfd6[_0x44813d][_0x5f72('0x1f')])};if(_0x48e939[_0x5f72('0x42')]===_0x5f72('0x35'))updateAgentVoiceStatus(_0x32989c,_0xc8eb32,_0x66ee6a);if(_0x32989c[_0x5f72('0x41')])_0xc8eb32[_0x5f72('0x33')]++;if(_0x32989c[_0x5f72('0x36')])_0xc8eb32[_0x5f72('0x36')]++;if(_0x32989c[_0x5f72('0x1f')]&&!_0x32989c[_0x5f72('0x36')]&&!_0x32989c['talking'])_0xc8eb32[_0x5f72('0x1f')]++;_0xc8eb32[_0x5f72('0x43')]['push'](_0x32989c);}return _0xc8eb32;});}function getQueueAgents(_0x261e24,_0x3e0958,_0x17e91c){var _0x11c93c='User'+_[_0x5f72('0x18')](_0x17e91c)+_0x5f72('0x44');var _0x5ac183=_0x17e91c+_0x5f72('0x45');return db[_0x11c93c]['findAll']({'where':{[_[_0x5f72('0x18')](_0x17e91c)+_0x5f72('0x46')]:_0x261e24['id']},'raw':!![]})[_0x5f72('0x12')](function(_0x4e2064){for(var _0x3db60a=0x0;_0x3db60a<_0x4e2064[_0x5f72('0x3b')];_0x3db60a++){var _0xe66c47=_[_0x5f72('0x38')](_0x3e0958,['id',_0x4e2064[_0x3db60a]['UserId']]);if(!_0xe66c47){_0xe66c47={'id':_0x4e2064[_0x3db60a]['UserId'],'name':_0x4e2064[_0x3db60a][_0x5f72('0x3f')],'online':![],['pauseField']:![]};}var _0x124d82={'id':_0xe66c47['id'],'name':_0xe66c47[_0x5f72('0x3a')],'online':Boolean(_0xe66c47['online']),'paused':Boolean(_0xe66c47[_0x5ac183])};if(_0x124d82[_0x5f72('0x41')])_0x261e24['loggedInDb']++;_0x261e24[_0x5f72('0x43')][_0x5f72('0x47')](_0x124d82);}return _0x261e24;});}function isIdle(_0x3d1279){return _0x3d1279===_0x5f72('0x48')||_0x3d1279===_0x5f72('0x49')||_0x3d1279===_0x5f72('0x4a')||_0x3d1279==='ringing'||_['isNil'](_0x3d1279);}function isAgentPaused(_0x263419,_0x42aef8){var _0xc11b5=[_0x263419[_0x5f72('0x4b')],_0x263419[_0x5f72('0x4c')],_0x263419['mailPause'],_0x263419[_0x5f72('0x4d')],_0x263419[_0x5f72('0x4e')],_0x263419[_0x5f72('0x4f')],_0x263419[_0x5f72('0x50')]];if(!_0x42aef8)return _['every'](_0xc11b5);var _0x45c1c9=_[_0x5f72('0x51')](_0xc11b5);return _0x45c1c9['length']>0x0&&_0x45c1c9[_0x5f72('0x3b')]<_0xc11b5[_0x5f72('0x3b')]?!![]:![];}function isAgentIdle(_0x32c2f6){if(_0x32c2f6['voiceStatus']!=='idle'&&_0x32c2f6[_0x5f72('0x4f')]){_0x32c2f6[_0x5f72('0x42')]=_0x5f72('0x52');return![];}return _[_0x5f72('0x53')]([_0x32c2f6[_0x5f72('0x54')],_0x32c2f6[_0x5f72('0x55')],_0x32c2f6[_0x5f72('0x56')],_0x32c2f6[_0x5f72('0x57')],_0x32c2f6['smsStatus'],_0x32c2f6[_0x5f72('0x42')],_0x32c2f6[_0x5f72('0x58')]],isIdle);}function getAgentStatus(_0x257c67){var _0x24d255='unknown';if(isAgentPaused(_0x257c67))_0x24d255=_0x5f72('0x52');else if(isAgentPaused(_0x257c67,!![]))_0x24d255=_0x5f72('0x59');else if(isAgentIdle(_0x257c67))_0x24d255=_0x5f72('0x48');else _0x24d255=_0x5f72('0x36');return _0x24d255;}exports[_0x5f72('0x5a')]=function(_0x1d9fc4,_0x7aff6e){var _0x15e783='';var _0x142dac={'count':0x0,'rows':[]},_0x310bca={},_0x94ae8c,_0x51a0b7,_0x3fe390=[_0x5f72('0x5b'),_0x5f72('0x41'),_0x5f72('0x5c'),'lastPauseAt','pauseType',_0x5f72('0x5d'),_0x5f72('0x3d'),_0x5f72('0x5e'),'chatPause',_0x5f72('0x4d'),'mailPause',_0x5f72('0x4e'),_0x5f72('0x50'),'faxPause',_0x5f72('0x4f'),_0x5f72('0x5f'),_0x5f72('0x60'),_0x5f72('0x61'),_0x5f72('0x62'),'whatsappCapacity',_0x5f72('0x63'),'chatCurrentCapacity','openchannelCurrentCapacity',_0x5f72('0x64'),_0x5f72('0x65'),_0x5f72('0x66'),'faxCurrentCapacity',_0x5f72('0x54'),'openchannelStatus',_0x5f72('0x56'),_0x5f72('0x67'),_0x5f72('0x58'),_0x5f72('0x55'),'voiceStatus',_0x5f72('0x68'),'openchannelStatusTime',_0x5f72('0x69'),'smsStatusTime',_0x5f72('0x6a'),_0x5f72('0x6b'),_0x5f72('0x6c'),'queue',_0x5f72('0x6d'),_0x5f72('0x6e'),'phoneBarEnableScreenRecordingByAgent',_0x5f72('0x6f'),_0x5f72('0x70')],_0x1f5b6a=[_0x5f72('0x4b'),_0x5f72('0x4d'),_0x5f72('0x71'),_0x5f72('0x4e'),_0x5f72('0x50'),'faxPause',_0x5f72('0x4f'),_0x5f72('0x41')];if(_0x1d9fc4['query'][_0x5f72('0x72')]&&_0x1d9fc4['query'][_0x5f72('0x72')]['includes'](_0x5f72('0x73'))){_0x15e783=_0x1d9fc4[_0x5f72('0x74')]['sort'];_0x1d9fc4[_0x5f72('0x74')][_0x5f72('0x72')]='';}Promise[_0x5f72('0x75')]()[_0x5f72('0x12')](function(){var _0x5f3d33=_['map'](db['User']['rawAttributes'],function(_0x234805){return{'name':_0x234805[_0x5f72('0x76')],'type':_0x234805[_0x5f72('0x77')][_0x5f72('0x78')]};});_0x1d9fc4[_0x5f72('0x74')][_0x5f72('0x79')]=_0x5f72('0x7a');_0x1d9fc4['query'][_0x5f72('0x41')]=!![];_0x310bca=qs[_0x5f72('0x7b')](_0x5f3d33,_0x1d9fc4);_0x310bca[_0x5f72('0x7c')]=!![];if(_0x1d9fc4[_0x5f72('0x7d')]['role']===_0x5f72('0x7d')){var _0x1e391f={'params':{'id':_0x1d9fc4[_0x5f72('0x7d')]['userProfileId']},'query':{'section':_0x5f72('0x11'),'role':'agent','online':!![],'nolimit':_0x1d9fc4[_0x5f72('0x74')][_0x5f72('0x7e')],'sort':_0x1d9fc4[_0x5f72('0x74')]['sort'],'filter':_0x1d9fc4[_0x5f72('0x74')]['filter'],'raw':!![]}};return db['UserProfile'][_0x5f72('0x7f')](_0x1e391f);}return db['User'][_0x5f72('0x80')](_0x310bca);})[_0x5f72('0x12')](function(_0x47fcb2){_0x142dac[_0x5f72('0x8')]=_0x47fcb2[_0x5f72('0x8')];_0x94ae8c=_0x47fcb2[_0x5f72('0x81')];return getRealtimeAgents();})[_0x5f72('0x12')](function(_0x3a9d0b){_0x51a0b7=_0x3a9d0b['rows'];return _0x94ae8c[_0x5f72('0x31')](function(_0x5d74a8){var _0x5a80c3=_[_0x5f72('0x38')](_0x51a0b7,['id',_0x5d74a8['id']]);if(_0x5a80c3)_['merge'](_0x5d74a8,_['pick'](_[_0x5f72('0x82')](_0x5a80c3,_0x1f5b6a),_0x3fe390));_0x5d74a8['globalStatus']=getAgentStatus(_0x5d74a8);return _0x5d74a8;});})['then'](function(_0x5a009a){if(_0x15e783[_0x5f72('0x83')]('globalStatus')){var _0x57eec4;if(_0x15e783[_0x5f72('0x83')]('-'))_0x57eec4=_[_0x5f72('0x84')](_0x5a009a,'globalStatus',_0x5f72('0x85'));else _0x57eec4=_['orderBy'](_0x5a009a,'globalStatus',_0x5f72('0x86'));return _0x57eec4;}return _0x5a009a;})[_0x5f72('0x12')](function(_0x2ef73d){if(_0x1d9fc4[_0x5f72('0x74')]['globalStatusFilter']){var _0x2ea78f=_[_0x5f72('0x51')](_0x2ef73d,[_0x5f72('0x73'),_0x1d9fc4[_0x5f72('0x74')]['globalStatusFilter']]);if(_0x1d9fc4[_0x5f72('0x74')][_0x5f72('0x87')]){_0x2ea78f=_['filter'](_0x2ea78f,[_0x5f72('0x88'),_0x1d9fc4[_0x5f72('0x74')]['pauseTypeFilter']]);}}_0x142dac[_0x5f72('0x81')]=_0x2ea78f||_0x2ef73d;return _0x142dac;})[_0x5f72('0x12')](respondWithFilteredResult(_0x7aff6e,_0x310bca))[_0x5f72('0x16')](handleError(_0x7aff6e,null));};exports['getQueues']=function(_0x49d522,_0x5c64f0){var _0x42a59f=[_0x5f72('0x89'),_0x5f72('0x8a'),_0x5f72('0x8b'),'openchannel','fax',_0x5f72('0x8c'),_0x5f72('0x17')];var _0x15dad7={'count':0x0,'rows':[]},_0x2b9eef={},_0x2926b4,_0x504373,_0x260c9f,_0x3c5913,_0x587a31;Promise[_0x5f72('0x75')]()[_0x5f72('0x12')](function(){if(_0x49d522[_0x5f72('0x74')][_0x5f72('0x8d')]){if(!_[_0x5f72('0x83')](_0x42a59f,_0x49d522[_0x5f72('0x74')][_0x5f72('0x8d')][_0x5f72('0x8e')]()))throw new Error(_0x5f72('0x8f'));_0x2926b4=_0x49d522[_0x5f72('0x74')][_0x5f72('0x8d')][_0x5f72('0x8e')]();}var _0x16983a=_[_0x5f72('0x18')](_0x2926b4)+_0x5f72('0x44');var _0x59d8b0=_[_0x5f72('0x31')](db[_0x16983a][_0x5f72('0x90')],function(_0x587f24){return{'name':_0x587f24[_0x5f72('0x76')],'type':_0x587f24['type'][_0x5f72('0x78')]};});_0x2b9eef=qs[_0x5f72('0x7b')](_0x59d8b0,_0x49d522);if(_0x49d522[_0x5f72('0x7d')][_0x5f72('0x79')]==='user'){var _0xc0a463={'params':{'id':_0x49d522['user'][_0x5f72('0x91')]},'query':{'section':_0x2926b4===_0x5f72('0x17')&&_0x49d522[_0x5f72('0x74')][_0x5f72('0x77')]===_0x5f72('0x37')?_0x5f72('0x92'):_['startCase'](_0x2926b4)+_0x5f72('0x19'),'type':_0x49d522[_0x5f72('0x74')][_0x5f72('0x77')],'nolimit':!![],'sort':_0x5f72('0x3a'),'filter':_0x49d522[_0x5f72('0x74')][_0x5f72('0x51')]}};return db[_0x5f72('0x93')][_0x5f72('0x7f')](_0xc0a463);}return db[_0x16983a][_0x5f72('0x80')](_0x2b9eef);})[_0x5f72('0x12')](function(_0x11d01d){_0x15dad7[_0x5f72('0x8')]=_0x11d01d[_0x5f72('0x8')];_0x504373=_0x11d01d['rows'];return getRealtimeQueues(_0x49d522,_0x2926b4);})[_0x5f72('0x12')](function(_0x2e3042){_0x3c5913=_0x2e3042[_0x5f72('0x81')];return getRealtimeAgents();})[_0x5f72('0x12')](function(_0x2ca388){_0x260c9f=_0x2ca388[_0x5f72('0x81')];if(_0x2926b4!=_0x5f72('0x17'))return;return getRealtimeVoiceQueueChannels();})[_0x5f72('0x12')](function(_0x1d76eb){_0x587a31=_0x1d76eb?_0x1d76eb[_0x5f72('0x81')]:[];return initializeQueues(_0x504373,_0x3c5913,_0x2926b4,_0x49d522['query'][_0x5f72('0x77')]);})['then'](function(_0xd25e5c){var _0x104821=_0xd25e5c['map'](function(_0x118237){if(_0x2926b4===_0x5f72('0x17'))return getVoiceQueueAgents(_0x118237,_0x504373,_0x260c9f,_0x587a31);else return getQueueAgents(_0x118237,_0x260c9f,_0x2926b4);});return Promise[_0x5f72('0x94')](_0x104821);})[_0x5f72('0x12')](function(_0x1ae4ea){_0x15dad7['rows']=_0x1ae4ea;return _0x15dad7;})[_0x5f72('0x12')](respondWithFilteredResult(_0x5c64f0,_0x2b9eef))[_0x5f72('0x16')](handleError(_0x5c64f0,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 76119a9..8555877 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x223803,_0x5e49b7){var _0x54ec85=function(_0x4b8326){while(--_0x4b8326){_0x223803['push'](_0x223803['shift']());}};_0x54ec85(++_0x5e49b7);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2c0ded,_0x3de22c){_0x2c0ded=_0x2c0ded-0x0;var _0x4473e5=_0xcb91[_0x2c0ded];return _0x4473e5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=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(_0x874822,_0x2d4dd2){var _0x22e117=function(_0x29ddc4){while(--_0x29ddc4){_0x874822['push'](_0x874822['shift']());}};_0x22e117(++_0x2d4dd2);}(_0xedd9,0xfc));var _0x9edd=function(_0x474e37,_0x524613){_0x474e37=_0x474e37-0x0;var _0x58bae6=_0xedd9[_0x474e37];return _0x58bae6;};'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/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index bd0c8dc..1e2ab21 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 _0x1c75=['STRING','INTEGER','sequelize','DATE'];(function(_0x2b0acf,_0x2432ac){var _0x2c1a0b=function(_0x1cc2f8){while(--_0x1cc2f8){_0x2b0acf['push'](_0x2b0acf['shift']());}};_0x2c1a0b(++_0x2432ac);}(_0x1c75,0xce));var _0x51c7=function(_0x5a965f,_0x22d15f){_0x5a965f=_0x5a965f-0x0;var _0x188f8a=_0x1c75[_0x5a965f];return _0x188f8a;};'use strict';var Sequelize=require(_0x51c7('0x0'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x51c7('0x1')]},'uniqueid':{'type':Sequelize[_0x51c7('0x2')]},'starttime':{'type':Sequelize[_0x51c7('0x1')]},'responsetime':{'type':Sequelize[_0x51c7('0x1')]},'ringtime':{'type':Sequelize[_0x51c7('0x3')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x51c7('0x2')]},'campaigntype':{'type':Sequelize[_0x51c7('0x2')]},'membername':{'type':Sequelize[_0x51c7('0x2')]}}; \ No newline at end of file +var _0x3eea=['STRING','DATE','sequelize','INTEGER'];(function(_0x2eb3db,_0x4a32c0){var _0x358f33=function(_0x1d0588){while(--_0x1d0588){_0x2eb3db['push'](_0x2eb3db['shift']());}};_0x358f33(++_0x4a32c0);}(_0x3eea,0x1ca));var _0xa3ee=function(_0xf15f8e,_0x50f420){_0xf15f8e=_0xf15f8e-0x0;var _0x1c143e=_0x3eea[_0xf15f8e];return _0x1c143e;};'use strict';var Sequelize=require(_0xa3ee('0x0'));module['exports']={'state':{'type':Sequelize[_0xa3ee('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xa3ee('0x2')]},'scheduledat':{'type':Sequelize[_0xa3ee('0x3')]},'uniqueid':{'type':Sequelize[_0xa3ee('0x2')]},'starttime':{'type':Sequelize[_0xa3ee('0x3')]},'responsetime':{'type':Sequelize[_0xa3ee('0x3')]},'ringtime':{'type':Sequelize[_0xa3ee('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xa3ee('0x2')]},'campaigntype':{'type':Sequelize[_0xa3ee('0x2')]},'membername':{'type':Sequelize[_0xa3ee('0x2')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 4e222d0..d8ef6f8 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 _0xee59=['bluebird','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','ReportAgentPreview','report_agent_preview','lodash','../../config/logger','moment'];(function(_0x231b2e,_0x2a33f9){var _0x3feb2a=function(_0x5aa472){while(--_0x5aa472){_0x231b2e['push'](_0x231b2e['shift']());}};_0x3feb2a(++_0x2a33f9);}(_0xee59,0xb8));var _0x9ee5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xee59[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x9ee5('0x0'));var util=require('util');var logger=require(_0x9ee5('0x1'))('api');var moment=require(_0x9ee5('0x2'));var BPromise=require(_0x9ee5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9ee5('0x4'));var rimraf=require(_0x9ee5('0x5'));var config=require(_0x9ee5('0x6'));var attributes=require(_0x9ee5('0x7'));module[_0x9ee5('0x8')]=function(_0x3ef087,_0x5386cc){return _0x3ef087['define'](_0x9ee5('0x9'),attributes,{'tableName':_0x9ee5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb564=['./reportAgentPreview.attributes','define','ReportAgentPreview','report_agent_preview','lodash','util','api','moment','request-promise','path','../../config/environment'];(function(_0x45951a,_0x293c0c){var _0x32f531=function(_0x325744){while(--_0x325744){_0x45951a['push'](_0x45951a['shift']());}};_0x32f531(++_0x293c0c);}(_0xb564,0x67));var _0x4b56=function(_0x753256,_0x2f691f){_0x753256=_0x753256-0x0;var _0x1ed9b5=_0xb564[_0x753256];return _0x1ed9b5;};'use strict';var _=require(_0x4b56('0x0'));var util=require(_0x4b56('0x1'));var logger=require('../../config/logger')(_0x4b56('0x2'));var moment=require(_0x4b56('0x3'));var BPromise=require('bluebird');var rp=require(_0x4b56('0x4'));var fs=require('fs');var path=require(_0x4b56('0x5'));var rimraf=require('rimraf');var config=require(_0x4b56('0x6'));var attributes=require(_0x4b56('0x7'));module['exports']=function(_0x391ff5,_0x4d8261){return _0x391ff5[_0x4b56('0x8')](_0x4b56('0x9'),attributes,{'tableName':_0x4b56('0xa'),'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 8f34afe..c4fd6fd 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 _0xd80e=['then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','body','options','raw','debug','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','client','http','request'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd80e,0x13a));var _0xed80=function(_0x183d66,_0x49e8dc){_0x183d66=_0x183d66-0x0;var _0x29e56e=_0xd80e[_0x183d66];return _0x29e56e;};'use strict';var _=require(_0xed80('0x0'));var util=require(_0xed80('0x1'));var moment=require(_0xed80('0x2'));var BPromise=require(_0xed80('0x3'));var rs=require(_0xed80('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xed80('0x5'))(_0xed80('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xed80('0x7')][_0xed80('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x43741a,_0x2abe4b,_0x1b32cd){return new BPromise(function(_0x4296a9,_0x1312fe){return client[_0xed80('0x9')](_0x43741a,_0x1b32cd)[_0xed80('0xa')](function(_0x33af5b){logger[_0xed80('0xb')](_0xed80('0xc'),_0x2abe4b,_0xed80('0xd'));logger['debug'](_0xed80('0xe'),_0x2abe4b,_0xed80('0xd'),JSON[_0xed80('0xf')](_0x33af5b));if(_0x33af5b[_0xed80('0x10')]){if(_0x33af5b[_0xed80('0x10')][_0xed80('0x11')]===0x1f4){logger[_0xed80('0x10')](_0xed80('0xc'),_0x2abe4b,_0x33af5b[_0xed80('0x10')][_0xed80('0x12')]);return _0x1312fe(_0x33af5b[_0xed80('0x10')][_0xed80('0x12')]);}logger[_0xed80('0x10')](_0xed80('0xc'),_0x2abe4b,_0x33af5b['error'][_0xed80('0x12')]);return _0x4296a9(_0x33af5b[_0xed80('0x10')]['message']);}else{logger[_0xed80('0xb')](_0xed80('0xc'),_0x2abe4b,_0xed80('0xd'));_0x4296a9(_0x33af5b[_0xed80('0x13')][_0xed80('0x12')]);}})[_0xed80('0x14')](function(_0x2ffaaf){logger[_0xed80('0x10')]('ReportAgentPreview,\x20%s,\x20%s',_0x2abe4b,_0x2ffaaf);_0x1312fe(_0x2ffaaf);});});}exports[_0xed80('0x15')]=function(_0x3d3539){var _0x26bf5d=this;return new Promise(function(_0xe5690d,_0xd1fbb6){return db[_0xed80('0x16')]['create'](_0x3d3539[_0xed80('0x17')],{'raw':_0x3d3539[_0xed80('0x18')]?_0x3d3539[_0xed80('0x18')][_0xed80('0x19')]===undefined?!![]:![]:!![]})[_0xed80('0xa')](function(_0x59958d){logger[_0xed80('0xb')]('CreateReportAgentPreview',_0x3d3539);logger[_0xed80('0x1a')](_0xed80('0x15'),_0x3d3539,JSON['stringify'](_0x59958d));_0xe5690d(_0x59958d);})[_0xed80('0x14')](function(_0x2ecded){logger[_0xed80('0x10')](_0xed80('0x15'),_0x2ecded[_0xed80('0x12')],_0x3d3539);_0xd1fbb6(_0x26bf5d[_0xed80('0x10')](0x1f4,_0x2ecded[_0xed80('0x12')]));});});}; \ No newline at end of file +var _0xc0de=['client','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','CreateReportAgentPreview','body','raw','stringify','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x34651f,_0x1b07dd){var _0x2d88fe=function(_0x1bc817){while(--_0x1bc817){_0x34651f['push'](_0x34651f['shift']());}};_0x2d88fe(++_0x1b07dd);}(_0xc0de,0xa8));var _0xec0d=function(_0x1f0049,_0x4bc79b){_0x1f0049=_0x1f0049-0x0;var _0x52d830=_0xc0de[_0x1f0049];return _0x52d830;};'use strict';var _=require('lodash');var util=require(_0xec0d('0x0'));var moment=require(_0xec0d('0x1'));var BPromise=require(_0xec0d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xec0d('0x3'));var db=require(_0xec0d('0x4'))['db'];var utils=require(_0xec0d('0x5'));var logger=require('../../config/logger')(_0xec0d('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xec0d('0x7')][_0xec0d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x522d54,_0x2614e1,_0x2f7e29){return new BPromise(function(_0x5dc8e4,_0x13acaa){return client[_0xec0d('0x9')](_0x522d54,_0x2f7e29)[_0xec0d('0xa')](function(_0x5a2c6e){logger[_0xec0d('0xb')](_0xec0d('0xc'),_0x2614e1,_0xec0d('0xd'));logger[_0xec0d('0xe')](_0xec0d('0xf'),_0x2614e1,_0xec0d('0xd'),JSON['stringify'](_0x5a2c6e));if(_0x5a2c6e['error']){if(_0x5a2c6e['error'][_0xec0d('0x10')]===0x1f4){logger[_0xec0d('0x11')](_0xec0d('0xc'),_0x2614e1,_0x5a2c6e[_0xec0d('0x11')][_0xec0d('0x12')]);return _0x13acaa(_0x5a2c6e[_0xec0d('0x11')][_0xec0d('0x12')]);}logger[_0xec0d('0x11')]('ReportAgentPreview,\x20%s,\x20%s',_0x2614e1,_0x5a2c6e[_0xec0d('0x11')][_0xec0d('0x12')]);return _0x5dc8e4(_0x5a2c6e[_0xec0d('0x11')][_0xec0d('0x12')]);}else{logger[_0xec0d('0xb')]('ReportAgentPreview,\x20%s,\x20%s',_0x2614e1,_0xec0d('0xd'));_0x5dc8e4(_0x5a2c6e[_0xec0d('0x13')][_0xec0d('0x12')]);}})[_0xec0d('0x14')](function(_0x22c341){logger[_0xec0d('0x11')](_0xec0d('0xc'),_0x2614e1,_0x22c341);_0x13acaa(_0x22c341);});});}exports[_0xec0d('0x15')]=function(_0x5c0a99){var _0x523476=this;return new Promise(function(_0x402e32,_0x5ad227){return db['ReportAgentPreview']['create'](_0x5c0a99[_0xec0d('0x16')],{'raw':_0x5c0a99['options']?_0x5c0a99['options'][_0xec0d('0x17')]===undefined?!![]:![]:!![]})[_0xec0d('0xa')](function(_0x26ebec){logger[_0xec0d('0xb')]('CreateReportAgentPreview',_0x5c0a99);logger[_0xec0d('0xe')](_0xec0d('0x15'),_0x5c0a99,JSON[_0xec0d('0x18')](_0x26ebec));_0x402e32(_0x26ebec);})['catch'](function(_0x11857e){logger[_0xec0d('0x11')]('CreateReportAgentPreview',_0x11857e[_0xec0d('0x12')],_0x5c0a99);_0x5ad227(_0x523476[_0xec0d('0x11')](0x1f4,_0x11857e[_0xec0d('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 41e9ffb..56e2d10 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 _0x769d=['path','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceQueues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/voice/queues/channels','voiceQueuesChannels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','/trunks','trunks','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','showMailQueues','chat','/chat/queues/:id','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','/sms/queues/:id','showSmsQueues','showWhatsappQueues','/agents/:id/notify','exports','multer','util'];(function(_0x237815,_0x1ef2b0){var _0x5498ee=function(_0x5d0f6e){while(--_0x5d0f6e){_0x237815['push'](_0x237815['shift']());}};_0x5498ee(++_0x1ef2b0);}(_0x769d,0x132));var _0xd769=function(_0x256eaf,_0x28a849){_0x256eaf=_0x256eaf-0x0;var _0x66e49=_0x769d[_0x256eaf];return _0x66e49;};'use strict';var multer=require(_0xd769('0x0'));var util=require(_0xd769('0x1'));var path=require(_0xd769('0x2'));var express=require(_0xd769('0x3'));var router=express[_0xd769('0x4')]();var auth=require(_0xd769('0x5'));var controller=require(_0xd769('0x6'));router[_0xd769('0x7')](_0xd769('0x8'),auth[_0xd769('0x9')](),controller['voiceChannels']);router[_0xd769('0x7')](_0xd769('0xa'),auth[_0xd769('0x9')](),controller[_0xd769('0xb')]);router[_0xd769('0x7')](_0xd769('0xc'),auth[_0xd769('0x9')](),controller['voiceChannelStopMixMonitor']);router['get']('/voice/queues',auth[_0xd769('0x9')](),controller[_0xd769('0xd')]);router[_0xd769('0x7')]('/chat/queues',auth[_0xd769('0x9')](),controller[_0xd769('0xe')]);router[_0xd769('0x7')](_0xd769('0xf'),auth['isAuthenticated'](),controller[_0xd769('0x10')]);router['get'](_0xd769('0x11'),auth[_0xd769('0x9')](),controller[_0xd769('0x12')]);router[_0xd769('0x7')](_0xd769('0x13'),auth['isAuthenticated'](),controller[_0xd769('0x14')]);router['get'](_0xd769('0x15'),auth[_0xd769('0x9')](),controller[_0xd769('0x16')]);router[_0xd769('0x7')](_0xd769('0x17'),auth[_0xd769('0x9')](),controller[_0xd769('0x18')]);router[_0xd769('0x7')]('/fax/queues',auth['isAuthenticated'](),controller['faxQueues']);router[_0xd769('0x7')]('/voice/queues/preview/:id',auth[_0xd769('0x9')](),controller['voiceQueuesPreview']);router[_0xd769('0x7')](_0xd769('0x19'),auth[_0xd769('0x9')](),controller[_0xd769('0x1a')]);router['get']('/voice/queues/channels/:uniqueid',auth['isAuthenticated'](),controller[_0xd769('0x1b')]);router[_0xd769('0x7')](_0xd769('0x1c'),auth[_0xd769('0x9')](),controller['voiceQueuesChannelHangup']);router[_0xd769('0x7')](_0xd769('0x1d'),auth['isAuthenticated'](),controller[_0xd769('0x1e')]);router[_0xd769('0x7')](_0xd769('0x1f'),auth['isAuthenticated'](),controller[_0xd769('0x20')]);router[_0xd769('0x21')](_0xd769('0x1f'),auth['isAuthenticated'](),controller[_0xd769('0x22')]);router['get']('/outbound',auth[_0xd769('0x9')](),controller[_0xd769('0x23')]);router[_0xd769('0x7')](_0xd769('0x24'),auth[_0xd769('0x9')](),controller[_0xd769('0x25')]);router[_0xd769('0x7')](_0xd769('0x26'),auth[_0xd769('0x9')](),controller[_0xd769('0x27')]);router['put'](_0xd769('0x28'),auth['isAuthenticated'](),controller[_0xd769('0x29')]);router[_0xd769('0x7')](_0xd769('0x2a'),auth['isAuthenticated'](),controller['telephones']);router[_0xd769('0x7')](_0xd769('0x2b'),auth['isAuthenticated'](),controller[_0xd769('0x2c')]);router[_0xd769('0x7')]('/campaigns',auth[_0xd769('0x9')](),controller[_0xd769('0x2d')]);router['get'](_0xd769('0x2e'),auth[_0xd769('0x9')](),controller[_0xd769('0x2f')]);router[_0xd769('0x7')](_0xd769('0x30'),auth[_0xd769('0x9')](),controller[_0xd769('0x31')]);router['get'](_0xd769('0x32'),auth[_0xd769('0x9')](),controller['mailQueuesWaitingInteractions']);router[_0xd769('0x7')]('/openchannel/queues/waitinginteractions',auth[_0xd769('0x9')](),controller['openchannelQueuesWaitingInteractions']);router[_0xd769('0x7')](_0xd769('0x33'),auth[_0xd769('0x9')](),controller[_0xd769('0x34')]);router[_0xd769('0x7')](_0xd769('0x35'),auth[_0xd769('0x9')](),controller['smsQueuesWaitingInteractions']);router[_0xd769('0x7')](_0xd769('0x36'),auth[_0xd769('0x9')](),controller[_0xd769('0x37')]);router[_0xd769('0x7')]('/fax/queues/waitinginteractions',auth['isAuthenticated'](),controller['faxQueuesWaitingInteractions']);router[_0xd769('0x38')](_0xd769('0x39'),auth[_0xd769('0x9')](),controller[_0xd769('0x3a')]('mail'));router[_0xd769('0x7')]('/mail/queues/:id',auth[_0xd769('0x9')](),controller[_0xd769('0x3b')]);router[_0xd769('0x38')]('/chat/queues/:id/notify',auth['isAuthenticated'](),controller['queueNotify'](_0xd769('0x3c')));router[_0xd769('0x7')](_0xd769('0x3d'),auth[_0xd769('0x9')](),controller['showChatQueues']);router['post'](_0xd769('0x3e'),auth[_0xd769('0x9')](),controller[_0xd769('0x3a')](_0xd769('0x3f')));router[_0xd769('0x7')](_0xd769('0x40'),auth[_0xd769('0x9')](),controller[_0xd769('0x41')]);router[_0xd769('0x38')](_0xd769('0x42'),auth[_0xd769('0x9')](),controller[_0xd769('0x3a')]('openchannel'));router['get'](_0xd769('0x43'),auth[_0xd769('0x9')](),controller[_0xd769('0x44')]);router['post'](_0xd769('0x45'),auth['isAuthenticated'](),controller['queueNotify'](_0xd769('0x46')));router[_0xd769('0x38')](_0xd769('0x47'),auth[_0xd769('0x9')](),controller[_0xd769('0x3a')]('whatsapp'));router[_0xd769('0x7')](_0xd769('0x48'),auth[_0xd769('0x9')](),controller[_0xd769('0x49')]);router[_0xd769('0x7')]('/whatsapp/queues/:id',auth[_0xd769('0x9')](),controller[_0xd769('0x4a')]);router[_0xd769('0x38')](_0xd769('0x4b'),auth[_0xd769('0x9')](),controller['agentNotify']);module[_0xd769('0x4c')]=router; \ No newline at end of file +var _0x20df=['/outbound','outboundChannels','/agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','fax','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','/whatsapp/queues/:id/notify','whatsapp','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','path','express','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','/sms/queues','smsQueues','whatsappQueues','/fax/queues','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','updateVoiceQueue'];(function(_0x3aaf0a,_0x450970){var _0x33e6bc=function(_0x1db54d){while(--_0x1db54d){_0x3aaf0a['push'](_0x3aaf0a['shift']());}};_0x33e6bc(++_0x450970);}(_0x20df,0x7c));var _0xf20d=function(_0x1a89a1,_0x56d889){_0x1a89a1=_0x1a89a1-0x0;var _0x3d5b46=_0x20df[_0x1a89a1];return _0x3d5b46;};'use strict';var multer=require(_0xf20d('0x0'));var util=require(_0xf20d('0x1'));var path=require(_0xf20d('0x2'));var express=require(_0xf20d('0x3'));var router=express['Router']();var auth=require(_0xf20d('0x4'));var controller=require(_0xf20d('0x5'));router[_0xf20d('0x6')](_0xf20d('0x7'),auth[_0xf20d('0x8')](),controller['voiceChannels']);router[_0xf20d('0x6')]('/voice/channels/:uniqueid/mixmonitor',auth[_0xf20d('0x8')](),controller[_0xf20d('0x9')]);router['get'](_0xf20d('0xa'),auth['isAuthenticated'](),controller[_0xf20d('0xb')]);router['get'](_0xf20d('0xc'),auth[_0xf20d('0x8')](),controller[_0xf20d('0xd')]);router[_0xf20d('0x6')]('/chat/queues',auth[_0xf20d('0x8')](),controller[_0xf20d('0xe')]);router[_0xf20d('0x6')](_0xf20d('0xf'),auth[_0xf20d('0x8')](),controller[_0xf20d('0x10')]);router[_0xf20d('0x6')](_0xf20d('0x11'),auth['isAuthenticated'](),controller[_0xf20d('0x12')]);router['get'](_0xf20d('0x13'),auth[_0xf20d('0x8')](),controller['openchannelQueues']);router[_0xf20d('0x6')](_0xf20d('0x14'),auth[_0xf20d('0x8')](),controller[_0xf20d('0x15')]);router[_0xf20d('0x6')]('/whatsapp/queues',auth['isAuthenticated'](),controller[_0xf20d('0x16')]);router[_0xf20d('0x6')](_0xf20d('0x17'),auth[_0xf20d('0x8')](),controller['faxQueues']);router[_0xf20d('0x6')]('/voice/queues/preview/:id',auth[_0xf20d('0x8')](),controller['voiceQueuesPreview']);router['get'](_0xf20d('0x18'),auth[_0xf20d('0x8')](),controller[_0xf20d('0x19')]);router[_0xf20d('0x6')](_0xf20d('0x1a'),auth[_0xf20d('0x8')](),controller['voiceQueuesChannel']);router[_0xf20d('0x6')]('/voice/queues/channels/:uniqueid/hangup',auth[_0xf20d('0x8')](),controller['voiceQueuesChannelHangup']);router[_0xf20d('0x6')](_0xf20d('0x1b'),auth['isAuthenticated'](),controller['voiceQueuesChannelRedirect']);router[_0xf20d('0x6')](_0xf20d('0x1c'),auth[_0xf20d('0x8')](),controller['showVoiceQueues']);router['put'](_0xf20d('0x1c'),auth[_0xf20d('0x8')](),controller[_0xf20d('0x1d')]);router[_0xf20d('0x6')](_0xf20d('0x1e'),auth[_0xf20d('0x8')](),controller['outbound']);router[_0xf20d('0x6')]('/outbound/channels',auth['isAuthenticated'](),controller[_0xf20d('0x1f')]);router[_0xf20d('0x6')](_0xf20d('0x20'),auth['isAuthenticated'](),controller['agents']);router['put'](_0xf20d('0x21'),auth[_0xf20d('0x8')](),controller[_0xf20d('0x22')]);router['get'](_0xf20d('0x23'),auth[_0xf20d('0x8')](),controller[_0xf20d('0x24')]);router[_0xf20d('0x6')](_0xf20d('0x25'),auth[_0xf20d('0x8')](),controller[_0xf20d('0x26')]);router['get']('/campaigns',auth[_0xf20d('0x8')](),controller[_0xf20d('0x27')]);router['get'](_0xf20d('0x28'),auth[_0xf20d('0x8')](),controller[_0xf20d('0x29')]);router[_0xf20d('0x6')](_0xf20d('0x2a'),auth['isAuthenticated'](),controller['chatQueuesWaitingInteractions']);router['get'](_0xf20d('0x2b'),auth['isAuthenticated'](),controller[_0xf20d('0x2c')]);router[_0xf20d('0x6')](_0xf20d('0x2d'),auth[_0xf20d('0x8')](),controller['openchannelQueuesWaitingInteractions']);router[_0xf20d('0x6')](_0xf20d('0x2e'),auth[_0xf20d('0x8')](),controller[_0xf20d('0x2f')]);router[_0xf20d('0x6')](_0xf20d('0x30'),auth[_0xf20d('0x8')](),controller[_0xf20d('0x31')]);router[_0xf20d('0x6')]('/whatsapp/queues/waitinginteractions',auth[_0xf20d('0x8')](),controller[_0xf20d('0x32')]);router[_0xf20d('0x6')](_0xf20d('0x33'),auth['isAuthenticated'](),controller[_0xf20d('0x34')]);router[_0xf20d('0x35')](_0xf20d('0x36'),auth[_0xf20d('0x8')](),controller[_0xf20d('0x37')](_0xf20d('0x38')));router[_0xf20d('0x6')](_0xf20d('0x39'),auth[_0xf20d('0x8')](),controller[_0xf20d('0x3a')]);router['post'](_0xf20d('0x3b'),auth['isAuthenticated'](),controller[_0xf20d('0x37')](_0xf20d('0x3c')));router[_0xf20d('0x6')](_0xf20d('0x3d'),auth[_0xf20d('0x8')](),controller[_0xf20d('0x3e')]);router[_0xf20d('0x35')]('/fax/queues/:id/notify',auth['isAuthenticated'](),controller[_0xf20d('0x37')](_0xf20d('0x3f')));router['get']('/fax/queues/:id',auth[_0xf20d('0x8')](),controller[_0xf20d('0x40')]);router['post'](_0xf20d('0x41'),auth['isAuthenticated'](),controller[_0xf20d('0x37')](_0xf20d('0x42')));router['get'](_0xf20d('0x43'),auth[_0xf20d('0x8')](),controller[_0xf20d('0x44')]);router[_0xf20d('0x35')](_0xf20d('0x45'),auth['isAuthenticated'](),controller[_0xf20d('0x37')]('sms'));router['post'](_0xf20d('0x46'),auth[_0xf20d('0x8')](),controller[_0xf20d('0x37')](_0xf20d('0x47')));router[_0xf20d('0x6')]('/sms/queues/:id',auth[_0xf20d('0x8')](),controller['showSmsQueues']);router['get'](_0xf20d('0x48'),auth[_0xf20d('0x8')](),controller[_0xf20d('0x49')]);router[_0xf20d('0x35')](_0xf20d('0x4a'),auth[_0xf20d('0x8')](),controller[_0xf20d('0x4b')]);module[_0xf20d('0x4c')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 4ada520..5cba5ce 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 _0xa41a=['name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','merge','params','catch','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','VoiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','Agents','agentCapacity','interaction','hasOwnProperty','MemberReport','findAll','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','findOrCreate','user','INTERACTION','interface','SIP/%s','agent','AgentCapacity','capacity','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','showMailQueues','MailQueues','mailAccounts','OpenchannelQueues','showOpenchannelQueues','SmsQueues','showSmsQueues','whatsappQueues','showWhatsappQueues','WhatsappQueues','FaxQueues','showFaxQueues','faxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','value','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Queue','findOne','\x20Queue\x20not\x20found','Interaction','update','MessageId','From','Account','QueueId','TransferReport','create','Start','queue','queueTransferTimeout','agentNotify','Channel\x20field\x20is\x20mandatory','channel','User','Agent\x20not\x20found','Message','messageId','\x20Message\x20not\x20found','agentTransferTimeout','*,*,*,*','bluebird','moment','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','then','error','code','message','result','status','json','sendStatus','stack'];(function(_0x31fe63,_0x40e64c){var _0x156ee8=function(_0x2ee3ed){while(--_0x2ee3ed){_0x31fe63['push'](_0x31fe63['shift']());}};_0x156ee8(++_0x40e64c);}(_0xa41a,0x6b));var _0xaa41=function(_0x502513,_0x3f2fe2){_0x502513=_0x502513-0x0;var _0xbf6fb3=_0xa41a[_0x502513];return _0xbf6fb3;};'use strict';var BPromise=require(_0xaa41('0x0'));var moment=require(_0xaa41('0x1'));var _=require('lodash');var util=require(_0xaa41('0x2'));var db=require(_0xaa41('0x3'))['db'];var logger=require(_0xaa41('0x4'))(_0xaa41('0x5'));var jayson=require(_0xaa41('0x6'));var amiClient=jayson[_0xaa41('0x7')][_0xaa41('0x8')]({'port':0x232a});var mailClient=jayson[_0xaa41('0x7')]['http']({'port':0x232b});var routingClient=jayson[_0xaa41('0x7')][_0xaa41('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){var _0x31df43=_0x179545?_0x179545:amiClient;return _0x31df43[_0xaa41('0x9')](_0x54bc5a,_0x5b1fff)[_0xaa41('0xa')](function(_0x1cc344){if(_0x1cc344[_0xaa41('0xb')]){if(_0x1cc344[_0xaa41('0xb')][_0xaa41('0xc')]===0x1f4){return _0x588ab4(_0x1cc344[_0xaa41('0xb')][_0xaa41('0xd')]);}return _0x202cce(_0x1cc344['error'][_0xaa41('0xd')]);}else{_0x202cce(_0x1cc344[_0xaa41('0xe')]);}})['catch'](function(_0x54827c){_0x588ab4(_0x54827c);});});}function respondWithResult(_0x1d0a54,_0x518b5b){_0x518b5b=_0x518b5b||0xc8;return function(_0x19bd69){if(_0x19bd69){return _0x1d0a54[_0xaa41('0xf')](_0x518b5b)[_0xaa41('0x10')](_0x19bd69);}return _0x1d0a54[_0xaa41('0x11')](0x194);};}function handleError(_0x6f9ade,_0x4eaf81){_0x4eaf81=_0x4eaf81||0x1f4;return function(_0x1e9d7f){logger[_0xaa41('0xb')](_0x1e9d7f[_0xaa41('0x12')]);if(_0x1e9d7f[_0xaa41('0x13')]){delete _0x1e9d7f[_0xaa41('0x13')];}_0x6f9ade[_0xaa41('0xf')](_0x4eaf81)[_0xaa41('0x14')](_0x1e9d7f);};}function findById(_0x550ad5){return function(_0x2d868a){if(!_[_0xaa41('0x15')](_0x550ad5)&&!_[_0xaa41('0x15')](_0x2d868a)&&!_[_0xaa41('0x15')](_0x2d868a[_0xaa41('0x16')])){return _[_0xaa41('0x17')](_0x2d868a[_0xaa41('0x16')],function(_0x46e6d3){return _0x46e6d3['id']==_0x550ad5;});}return null;};}exports[_0xaa41('0x18')]=function(_0x4fe1a4,_0x5cd936){return respondWithRpcPromise(_0xaa41('0x19'),_0x4fe1a4[_0xaa41('0x1a')])[_0xaa41('0xa')](respondWithResult(_0x5cd936,null))['catch'](handleError(_0x5cd936,null));};exports[_0xaa41('0x1b')]=function(_0x1f692b,_0x4e768e){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0xaa41('0x1c')](_0x1f692b['query'],_0x1f692b[_0xaa41('0x1d')]))[_0xaa41('0xa')](respondWithResult(_0x4e768e,null))[_0xaa41('0x1e')](handleError(_0x4e768e,null));};exports[_0xaa41('0x1f')]=function(_0x1d623c,_0x4eb01f){return respondWithRpcPromise(_0xaa41('0x20'),_[_0xaa41('0x1c')](_0x1d623c[_0xaa41('0x1a')],_0x1d623c[_0xaa41('0x1d')]))[_0xaa41('0xa')](respondWithResult(_0x4eb01f,null))[_0xaa41('0x1e')](handleError(_0x4eb01f,null));};exports['voiceQueues']=function(_0x5795f4,_0x16aec5){return respondWithRpcPromise('VoiceQueues',_0x5795f4['query'])[_0xaa41('0xa')](respondWithResult(_0x16aec5,null))['catch'](handleError(_0x16aec5,null));};exports['showVoiceQueues']=function(_0x2d0ac0,_0x9c8c21){return respondWithRpcPromise(_0xaa41('0x21'),_0x2d0ac0[_0xaa41('0x1a')])[_0xaa41('0xa')](findById(_0x2d0ac0[_0xaa41('0x1d')]['id']))['then'](respondWithResult(_0x9c8c21,null))[_0xaa41('0x1e')](handleError(_0x9c8c21,null));};exports[_0xaa41('0x22')]=function(_0x63c18c,_0x9a16e3){return respondWithRpcPromise(_0xaa41('0x23'),_[_0xaa41('0x1c')](_0x63c18c[_0xaa41('0x24')],_0x63c18c[_0xaa41('0x1d')]))['then'](respondWithResult(_0x9a16e3,null))[_0xaa41('0x1e')](handleError(_0x9a16e3,null));};exports['voiceQueuesPreview']=function(_0x5dad80,_0x714537){return respondWithRpcPromise(_0xaa41('0x25'),_['merge'](_0x5dad80[_0xaa41('0x1a')],_0x5dad80[_0xaa41('0x1d')]))['then'](respondWithResult(_0x714537,null))['catch'](handleError(_0x714537,null));};exports['voiceQueuesChannels']=function(_0x1cf3da,_0x2f5cc0){return respondWithRpcPromise(_0xaa41('0x26'),_0x1cf3da[_0xaa41('0x1a')])['then'](respondWithResult(_0x2f5cc0,null))[_0xaa41('0x1e')](handleError(_0x2f5cc0,null));};exports[_0xaa41('0x27')]=function(_0x3e0204,_0x4de770){return respondWithRpcPromise(_0xaa41('0x28'),_[_0xaa41('0x1c')](_0x3e0204[_0xaa41('0x1a')],_0x3e0204['params']))[_0xaa41('0xa')](respondWithResult(_0x4de770,null))[_0xaa41('0x1e')](handleError(_0x4de770,null));};exports['voiceQueuesChannelHangup']=function(_0x23eb50,_0x13b6d4){return respondWithRpcPromise(_0xaa41('0x29'),_['merge'](_0x23eb50[_0xaa41('0x1a')],_0x23eb50['params']))[_0xaa41('0xa')](respondWithResult(_0x13b6d4,null))[_0xaa41('0x1e')](handleError(_0x13b6d4,null));};exports[_0xaa41('0x2a')]=function(_0x49b77a,_0x526377){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0xaa41('0x1c')](_0x49b77a[_0xaa41('0x1a')],_0x49b77a[_0xaa41('0x1d')]))[_0xaa41('0xa')](respondWithResult(_0x526377,null))['catch'](handleError(_0x526377,null));};exports['outbound']=function(_0x267999,_0x5673c){return respondWithRpcPromise(_0xaa41('0x2b'),_0x267999[_0xaa41('0x1a')])[_0xaa41('0xa')](respondWithResult(_0x5673c,null))[_0xaa41('0x1e')](handleError(_0x5673c,null));};exports[_0xaa41('0x2c')]=function(_0x5e9879,_0x3adc28){return respondWithRpcPromise(_0xaa41('0x2d'),_0x5e9879[_0xaa41('0x1a')])[_0xaa41('0xa')](respondWithResult(_0x3adc28,null))['catch'](handleError(_0x3adc28,null));};exports['agents']=function(_0x42b759,_0x275fa3){var _0x5eae08;return respondWithRpcPromise(_0xaa41('0x2e'),_0x42b759['query'])[_0xaa41('0xa')](function(_0x25f2df){_0x5eae08=_0x25f2df;return respondWithRpcPromise(_0xaa41('0x2e'),_0x42b759[_0xaa41('0x1a')],routingClient);})[_0xaa41('0xa')](function(_0x12ba1a){return _[_0xaa41('0x1c')]({},_0x12ba1a,_0x5eae08);})[_0xaa41('0xa')](respondWithResult(_0x275fa3,null))['catch'](handleError(_0x275fa3,null));};exports[_0xaa41('0x2f')]=function(_0x2abf39,_0x35c685){if(_0x2abf39[_0xaa41('0x24')]&&_0x2abf39[_0xaa41('0x24')][_0xaa41('0x30')]&&_0x2abf39['user']&&_0x2abf39['user'][_0xaa41('0x13')]){for(var _0x4f9086 in _0x2abf39[_0xaa41('0x24')][_0xaa41('0x30')]){if(_0x2abf39[_0xaa41('0x24')][_0xaa41('0x30')][_0xaa41('0x31')](_0x4f9086)){db[_0xaa41('0x32')][_0xaa41('0x33')]({'where':{'channel':_0x4f9086,'membername':_0x2abf39['user'][_0xaa41('0x13')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x2abf39['body'][_0xaa41('0x30')][_0x4f9086]&&_0x2abf39['body']['interaction'][_0x4f9086]['length']?{'$notIn':_0x2abf39[_0xaa41('0x24')]['interaction'][_0x4f9086]}:{'$ne':null}}})[_0xaa41('0xa')](function(_0x198716){var _0x4a6882=moment()['format'](_0xaa41('0x34'));for(var _0x1b7b97=0x0,_0x1bb973=_0x198716[_0xaa41('0x35')];_0x1b7b97<_0x1bb973;_0x1b7b97+=0x1){_0x198716[_0x1b7b97][_0xaa41('0x36')]({'exitAt':_0x4a6882});}});for(var _0x337993=0x0;_0x337993<_0x2abf39[_0xaa41('0x24')][_0xaa41('0x30')][_0x4f9086][_0xaa41('0x35')];_0x337993+=0x1){db['MemberReport'][_0xaa41('0x37')]({'where':{'channel':_0x4f9086,'membername':_0x2abf39[_0xaa41('0x38')][_0xaa41('0x13')],'type':_0xaa41('0x39'),'uniqueid':_0x2abf39[_0xaa41('0x24')][_0xaa41('0x30')][_0x4f9086][_0x337993],'exitAt':null},'defaults':{'channel':_0x4f9086,'membername':_0x2abf39['user'][_0xaa41('0x13')],'interface':_[_0xaa41('0x15')](_0x2abf39[_0xaa41('0x38')][_0xaa41('0x3a')])?util['format'](_0xaa41('0x3b'),_0x2abf39['user']['name']):_0x2abf39[_0xaa41('0x38')][_0xaa41('0x3a')],'type':_0xaa41('0x39'),'enterAt':moment()['format'](_0xaa41('0x34')),'role':_0xaa41('0x3c'),'internal':_0x2abf39[_0xaa41('0x38')]['internal'],'uniqueid':_0x2abf39[_0xaa41('0x24')][_0xaa41('0x30')][_0x4f9086][_0x337993]}});}}}}return respondWithRpcPromise(_0xaa41('0x3d'),{'id':_0x2abf39[_0xaa41('0x1d')]['id'],'capacity':_0x2abf39[_0xaa41('0x24')][_0xaa41('0x3e')]},routingClient)[_0xaa41('0xa')](respondWithResult(_0x35c685,null))[_0xaa41('0x1e')](handleError(_0x35c685,null));};exports['telephones']=function(_0x9f0a81,_0x5bef5f){return respondWithRpcPromise('Telephones',_0x9f0a81[_0xaa41('0x1a')])[_0xaa41('0xa')](respondWithResult(_0x5bef5f,null))[_0xaa41('0x1e')](handleError(_0x5bef5f,null));};exports[_0xaa41('0x3f')]=function(_0x14aab0,_0x288db3){return respondWithRpcPromise(_0xaa41('0x40'),_0x14aab0[_0xaa41('0x1a')])['then'](respondWithResult(_0x288db3,null))[_0xaa41('0x1e')](handleError(_0x288db3,null));};exports[_0xaa41('0x41')]=function(_0x1d518f,_0x4f9e92){return respondWithRpcPromise(_0xaa41('0x42'),_0x1d518f[_0xaa41('0x1a')])['then'](respondWithResult(_0x4f9e92,null))[_0xaa41('0x1e')](handleError(_0x4f9e92,null));};exports[_0xaa41('0x43')]=function(_0x283b3b,_0x4e5a2e){return respondWithRpcPromise(_0xaa41('0x44'),_0x283b3b[_0xaa41('0x1a')],routingClient)['then'](respondWithResult(_0x4e5a2e,null))['catch'](handleError(_0x4e5a2e,null));};exports[_0xaa41('0x45')]=function(_0x3cd14f,_0x3a29d2){return respondWithRpcPromise('ChatQueues',_0x3cd14f[_0xaa41('0x1a')],routingClient)[_0xaa41('0xa')](findById(_0x3cd14f[_0xaa41('0x1d')]['id']))[_0xaa41('0xa')](respondWithResult(_0x3a29d2,null))[_0xaa41('0x1e')](handleError(_0x3a29d2,null));};exports['mailQueues']=function(_0x2ae70c,_0x57cb70){return respondWithRpcPromise('MailQueues',_0x2ae70c[_0xaa41('0x1a')],routingClient)['then'](respondWithResult(_0x57cb70,null))[_0xaa41('0x1e')](handleError(_0x57cb70,null));};exports[_0xaa41('0x46')]=function(_0x169ddf,_0x5e83e1){return respondWithRpcPromise(_0xaa41('0x47'),_0x169ddf[_0xaa41('0x1a')],routingClient)[_0xaa41('0xa')](findById(_0x169ddf[_0xaa41('0x1d')]['id']))[_0xaa41('0xa')](respondWithResult(_0x5e83e1,null))[_0xaa41('0x1e')](handleError(_0x5e83e1,null));};exports[_0xaa41('0x48')]=function(_0x337059,_0x3f91f3){return respondWithRpcPromise('MailAccounts',_0x337059[_0xaa41('0x1a')],mailClient)[_0xaa41('0xa')](respondWithResult(_0x3f91f3,null))[_0xaa41('0x1e')](handleError(_0x3f91f3,null));};exports['openchannelQueues']=function(_0x3fe47a,_0x2caf5c){return respondWithRpcPromise(_0xaa41('0x49'),_0x3fe47a[_0xaa41('0x1a')],routingClient)[_0xaa41('0xa')](respondWithResult(_0x2caf5c,null))[_0xaa41('0x1e')](handleError(_0x2caf5c,null));};exports[_0xaa41('0x4a')]=function(_0x5ea056,_0x55a85c){return respondWithRpcPromise('OpenchannelQueues',_0x5ea056['query'],routingClient)['then'](findById(_0x5ea056['params']['id']))[_0xaa41('0xa')](respondWithResult(_0x55a85c,null))['catch'](handleError(_0x55a85c,null));};exports['smsQueues']=function(_0x24c6f3,_0x40a524){return respondWithRpcPromise(_0xaa41('0x4b'),_0x24c6f3[_0xaa41('0x1a')],routingClient)['then'](respondWithResult(_0x40a524,null))[_0xaa41('0x1e')](handleError(_0x40a524,null));};exports[_0xaa41('0x4c')]=function(_0x1ddb6c,_0x46822f){return respondWithRpcPromise(_0xaa41('0x4b'),_0x1ddb6c[_0xaa41('0x1a')],routingClient)[_0xaa41('0xa')](findById(_0x1ddb6c[_0xaa41('0x1d')]['id']))[_0xaa41('0xa')](respondWithResult(_0x46822f,null))['catch'](handleError(_0x46822f,null));};exports[_0xaa41('0x4d')]=function(_0x2d2af8,_0x50170f){return respondWithRpcPromise('WhatsappQueues',_0x2d2af8['query'],routingClient)[_0xaa41('0xa')](respondWithResult(_0x50170f,null))['catch'](handleError(_0x50170f,null));};exports[_0xaa41('0x4e')]=function(_0x5c8028,_0x5423b6){return respondWithRpcPromise(_0xaa41('0x4f'),_0x5c8028['query'],routingClient)[_0xaa41('0xa')](findById(_0x5c8028[_0xaa41('0x1d')]['id']))[_0xaa41('0xa')](respondWithResult(_0x5423b6,null))[_0xaa41('0x1e')](handleError(_0x5423b6,null));};exports['faxQueues']=function(_0x5be61b,_0x339db3){return respondWithRpcPromise(_0xaa41('0x50'),_0x5be61b['query'],routingClient)['then'](respondWithResult(_0x339db3,null))[_0xaa41('0x1e')](handleError(_0x339db3,null));};exports[_0xaa41('0x51')]=function(_0x304694,_0xbeafb5){return respondWithRpcPromise(_0xaa41('0x50'),_0x304694['query'],routingClient)[_0xaa41('0xa')](findById(_0x304694['params']['id']))['then'](respondWithResult(_0xbeafb5,null))['catch'](handleError(_0xbeafb5,null));};exports[_0xaa41('0x52')]=function(_0x19ec63,_0x436362){return respondWithRpcPromise('FaxAccounts',_0x19ec63[_0xaa41('0x1a')])[_0xaa41('0xa')](respondWithResult(_0x436362,null))[_0xaa41('0x1e')](handleError(_0x436362,null));};exports[_0xaa41('0x53')]=function(_0x457515,_0x3ffbf8){return respondWithRpcPromise(_0xaa41('0x54'),_0x457515['query'],routingClient)[_0xaa41('0xa')](respondWithResult(_0x3ffbf8,null))[_0xaa41('0x1e')](handleError(_0x3ffbf8,null));};exports[_0xaa41('0x55')]=function(_0x175ca9,_0x51ff61){return respondWithRpcPromise(_0xaa41('0x56'),_0x175ca9['query'],routingClient)[_0xaa41('0xa')](respondWithResult(_0x51ff61,null))[_0xaa41('0x1e')](handleError(_0x51ff61,null));};exports[_0xaa41('0x57')]=function(_0x143ef0,_0x491cad){return respondWithRpcPromise(_0xaa41('0x58'),_0x143ef0[_0xaa41('0x1a')],routingClient)[_0xaa41('0xa')](respondWithResult(_0x491cad,null))[_0xaa41('0x1e')](handleError(_0x491cad,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x140d78,_0x50197b){return respondWithRpcPromise(_0xaa41('0x58'),_0x140d78[_0xaa41('0x1a')],routingClient)['then'](function(_0x1ac05e){if(_0x140d78[_0xaa41('0x1a')][_0xaa41('0x59')]!==undefined){var _0x582d79=_(_0x1ac05e[_0xaa41('0x16')])[_0xaa41('0x5a')]([_0x140d78[_0xaa41('0x1a')][_0xaa41('0x59')],_0x140d78[_0xaa41('0x1d')]['id']])[_0xaa41('0x5b')](_0xaa41('0x5c'))['uniq']()[_0xaa41('0x5d')]();return _0x1ac05e[_0xaa41('0x16')][_0xaa41('0x5a')](function(_0x530982){return _0x582d79['indexOf'](_0x530982[_0xaa41('0x5c')])>-0x1;});}else{return _0x1ac05e[_0xaa41('0x16')]['filter'](function(_0x1ce957){return _0x1ce957[_0xaa41('0x5c')]===parseInt(_0x140d78['params']['id']);});}})[_0xaa41('0xa')](respondWithResult(_0x50197b,null))[_0xaa41('0x1e')](handleError(_0x50197b,null));};exports[_0xaa41('0x5e')]=function(_0xe8731,_0x46feb2){return respondWithRpcPromise(_0xaa41('0x5f'),_0xe8731[_0xaa41('0x1a')],routingClient)[_0xaa41('0xa')](respondWithResult(_0x46feb2,null))['catch'](handleError(_0x46feb2,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x397526,_0x481db9){return respondWithRpcPromise(_0xaa41('0x60'),_0x397526[_0xaa41('0x1a')],routingClient)[_0xaa41('0xa')](respondWithResult(_0x481db9,null))['catch'](handleError(_0x481db9,null));};exports[_0xaa41('0x61')]=function(_0x404c38,_0x2d7493){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x404c38[_0xaa41('0x1a')],routingClient)[_0xaa41('0xa')](respondWithResult(_0x2d7493,null))['catch'](handleError(_0x2d7493,null));};exports[_0xaa41('0x62')]=function(_0x4de25c){return function(_0x53faf4,_0x3f6a2b){var _0x34d0e4,_0x5eded3;var _0x5a8cb0=_[_0xaa41('0x63')](_0x4de25c);var _0x1726ec=_0x4de25c===_0xaa41('0x64')?_0xaa41('0x65'):'Account';return db[_0x5a8cb0+_0xaa41('0x66')][_0xaa41('0x67')]({'raw':!![],'where':{'id':_0x53faf4[_0xaa41('0x1d')]['id']}})['then'](function(_0x1ad3aa){if(_[_0xaa41('0x15')](_0x1ad3aa)){throw new Error(_0x5a8cb0+_0xaa41('0x68'));}_0x34d0e4=_0x1ad3aa;return db[_0x5a8cb0+'Message'][_0xaa41('0x67')]({'where':{'id':_0x53faf4['body']['messageId']},'include':[{'model':db[_0x5a8cb0+_0xaa41('0x69')],'as':_0xaa41('0x69')},{'model':db[_0x5a8cb0+_0x1726ec],'as':'Account'}]});})[_0xaa41('0xa')](function(_0x9e8ebb){if(_[_0xaa41('0x15')](_0x9e8ebb)){throw new Error(_0x5a8cb0+'\x20Message\x20not\x20found');}_0x5eded3=_0x9e8ebb;return _0x9e8ebb[_0xaa41('0x6a')]({'read':0x0,'readAt':null,'UserId':null});})[_0xaa41('0xa')](function(){var _0x1a2deb={'uniqueid':_0x4de25c+'.'+_0x5eded3['id']+'.'+_0x5eded3[_0xaa41('0x69')]['id'],'FromUserId':_0x53faf4[_0xaa41('0x38')]['id'],'type':'queue'};_0x1a2deb[_0x5a8cb0+_0xaa41('0x6b')]=_0x5eded3['id'];_0x1a2deb[_0x5a8cb0+'InteractionId']=_0x5eded3[_0xaa41('0x69')]['id'];_0x1a2deb[_0xaa41('0x6c')+_0x5a8cb0+_0x1726ec+'Id']=_0x5eded3[_0xaa41('0x6d')]['id'];_0x1a2deb['To'+_0x5a8cb0+_0xaa41('0x6e')]=_0x34d0e4['id'];return db[_0x5a8cb0+_0xaa41('0x6f')][_0xaa41('0x70')](_0x1a2deb);})[_0xaa41('0xa')](function(){return respondWithRpcPromise(_0xaa41('0x71'),{'channel':_0x4de25c,'interaction':_0x5eded3[_0xaa41('0x69')],'message':_0x5eded3,'account':_0x5eded3[_0xaa41('0x6d')],'applications':[{'id':0x0,'priority':0x1,'app':_0xaa41('0x72'),'appdata':_0x34d0e4['name']+','+(_0x5eded3[_0xaa41('0x6d')][_0xaa41('0x73')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xaa41('0xa')](respondWithResult(_0x3f6a2b,null))['catch'](handleError(_0x3f6a2b,null));};};exports[_0xaa41('0x74')]=function(_0xb44b1f,_0x472eb3){var _0x38d759,_0x2dc55e;if(_[_0xaa41('0x15')](_0xb44b1f[_0xaa41('0x24')]['channel'])){throw new Error(_0xaa41('0x75'));}var _0x1d50db=_0xb44b1f[_0xaa41('0x24')][_0xaa41('0x76')];var _0x585ce7=_[_0xaa41('0x63')](_0x1d50db);var _0x5c9beb=_0x1d50db===_0xaa41('0x64')?_0xaa41('0x65'):_0xaa41('0x6d');return db[_0xaa41('0x77')][_0xaa41('0x67')]({'raw':!![],'where':{'id':_0xb44b1f['params']['id'],'role':_0xaa41('0x3c')}})[_0xaa41('0xa')](function(_0x5819ac){if(_[_0xaa41('0x15')](_0x5819ac)){throw new Error(_0xaa41('0x78'));}_0x38d759=_0x5819ac;return db[_0x585ce7+_0xaa41('0x79')][_0xaa41('0x67')]({'where':{'id':_0xb44b1f[_0xaa41('0x24')][_0xaa41('0x7a')]},'include':[{'model':db[_0x585ce7+_0xaa41('0x69')],'as':_0xaa41('0x69')},{'model':db[_0x585ce7+_0x5c9beb],'as':'Account'}]});})[_0xaa41('0xa')](function(_0x39d3cc){if(_[_0xaa41('0x15')](_0x39d3cc)){throw new Error(_0x585ce7+_0xaa41('0x7b'));}_0x2dc55e=_0x39d3cc;return _0x39d3cc[_0xaa41('0x6a')]({'read':0x0,'readAt':null,'UserId':null});})[_0xaa41('0xa')](function(){var _0x5489be={'uniqueid':_0x1d50db+'.'+_0x2dc55e['id']+'.'+_0x2dc55e['Interaction']['id'],'FromUserId':_0xb44b1f['user']['id'],'type':_0xaa41('0x72'),'ToUserId':_0x38d759['id']};_0x5489be[_0x585ce7+_0xaa41('0x6b')]=_0x2dc55e['id'];_0x5489be[_0x585ce7+'InteractionId']=_0x2dc55e[_0xaa41('0x69')]['id'];_0x5489be[_0xaa41('0x6c')+_0x585ce7+_0x5c9beb+'Id']=_0x2dc55e['Account']['id'];return db[_0x585ce7+_0xaa41('0x6f')][_0xaa41('0x70')](_0x5489be);})[_0xaa41('0xa')](function(){return respondWithRpcPromise(_0xaa41('0x71'),{'channel':_0x1d50db,'interaction':_0x2dc55e['Interaction'],'message':_0x2dc55e,'account':_0x2dc55e[_0xaa41('0x6d')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x38d759[_0xaa41('0x13')]+','+(_0x2dc55e[_0xaa41('0x6d')][_0xaa41('0x7c')]||0x12c),'interval':_0xaa41('0x7d')}]},routingClient);})[_0xaa41('0xa')](respondWithResult(_0x472eb3,null))[_0xaa41('0x1e')](handleError(_0x472eb3,null));}; \ No newline at end of file +var _0x7dfd=['interface','format','SIP/%s','agent','internal','capacity','Telephones','trunks','Trunks','campaigns','Campaigns','showChatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','showSmsQueues','SmsQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','queue_id','uniq','filter','indexOf','SmsQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','findOne','InteractionId','agentTransferTimeout','bluebird','moment','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','then','error','code','message','result','catch','status','json','sendStatus','stack','name','isNil','rows','voiceChannels','VoiceChannels','query','VoiceChannelMixMonitor','merge','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','params','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','VoiceQueuesChannelHangup','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','body','user','interaction','hasOwnProperty','MemberReport','findAll','INTERACTION','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes'];(function(_0x7fc3bc,_0x32e792){var _0x8134d5=function(_0x21492d){while(--_0x21492d){_0x7fc3bc['push'](_0x7fc3bc['shift']());}};_0x8134d5(++_0x32e792);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0xd7df('0x0'));var moment=require(_0xd7df('0x1'));var _=require(_0xd7df('0x2'));var util=require(_0xd7df('0x3'));var db=require(_0xd7df('0x4'))['db'];var logger=require(_0xd7df('0x5'))(_0xd7df('0x6'));var jayson=require(_0xd7df('0x7'));var amiClient=jayson[_0xd7df('0x8')][_0xd7df('0x9')]({'port':0x232a});var mailClient=jayson[_0xd7df('0x8')][_0xd7df('0x9')]({'port':0x232b});var routingClient=jayson[_0xd7df('0x8')][_0xd7df('0x9')]({'port':0x232c});function respondWithRpcPromise(_0x354ea7,_0x16e50,_0x2c48a4){return new BPromise(function(_0x5c220a,_0xab6742){var _0xb3557a=_0x2c48a4?_0x2c48a4:amiClient;return _0xb3557a[_0xd7df('0xa')](_0x354ea7,_0x16e50)[_0xd7df('0xb')](function(_0x5e59c3){if(_0x5e59c3[_0xd7df('0xc')]){if(_0x5e59c3['error'][_0xd7df('0xd')]===0x1f4){return _0xab6742(_0x5e59c3['error'][_0xd7df('0xe')]);}return _0x5c220a(_0x5e59c3[_0xd7df('0xc')][_0xd7df('0xe')]);}else{_0x5c220a(_0x5e59c3[_0xd7df('0xf')]);}})[_0xd7df('0x10')](function(_0x174c88){_0xab6742(_0x174c88);});});}function respondWithResult(_0x2e8187,_0x3da618){_0x3da618=_0x3da618||0xc8;return function(_0x7ba3c){if(_0x7ba3c){return _0x2e8187[_0xd7df('0x11')](_0x3da618)[_0xd7df('0x12')](_0x7ba3c);}return _0x2e8187[_0xd7df('0x13')](0x194);};}function handleError(_0xe1595f,_0x196632){_0x196632=_0x196632||0x1f4;return function(_0x3b2559){logger[_0xd7df('0xc')](_0x3b2559[_0xd7df('0x14')]);if(_0x3b2559['name']){delete _0x3b2559[_0xd7df('0x15')];}_0xe1595f[_0xd7df('0x11')](_0x196632)['send'](_0x3b2559);};}function findById(_0x18d38f){return function(_0xbe1c5e){if(!_['isNil'](_0x18d38f)&&!_[_0xd7df('0x16')](_0xbe1c5e)&&!_[_0xd7df('0x16')](_0xbe1c5e[_0xd7df('0x17')])){return _['find'](_0xbe1c5e[_0xd7df('0x17')],function(_0x471621){return _0x471621['id']==_0x18d38f;});}return null;};}exports[_0xd7df('0x18')]=function(_0x5ba653,_0x96d86e){return respondWithRpcPromise(_0xd7df('0x19'),_0x5ba653[_0xd7df('0x1a')])['then'](respondWithResult(_0x96d86e,null))[_0xd7df('0x10')](handleError(_0x96d86e,null));};exports['voiceChannelMixMonitor']=function(_0x225e33,_0x5ab737){return respondWithRpcPromise(_0xd7df('0x1b'),_[_0xd7df('0x1c')](_0x225e33[_0xd7df('0x1a')],_0x225e33['params']))[_0xd7df('0xb')](respondWithResult(_0x5ab737,null))['catch'](handleError(_0x5ab737,null));};exports[_0xd7df('0x1d')]=function(_0x379e4a,_0x40e7af){return respondWithRpcPromise(_0xd7df('0x1e'),_[_0xd7df('0x1c')](_0x379e4a[_0xd7df('0x1a')],_0x379e4a[_0xd7df('0x1f')]))['then'](respondWithResult(_0x40e7af,null))['catch'](handleError(_0x40e7af,null));};exports[_0xd7df('0x20')]=function(_0x38db14,_0x26047f){return respondWithRpcPromise(_0xd7df('0x21'),_0x38db14[_0xd7df('0x1a')])[_0xd7df('0xb')](respondWithResult(_0x26047f,null))[_0xd7df('0x10')](handleError(_0x26047f,null));};exports[_0xd7df('0x22')]=function(_0x163904,_0x5c4d17){return respondWithRpcPromise(_0xd7df('0x21'),_0x163904[_0xd7df('0x1a')])[_0xd7df('0xb')](findById(_0x163904[_0xd7df('0x1f')]['id']))[_0xd7df('0xb')](respondWithResult(_0x5c4d17,null))[_0xd7df('0x10')](handleError(_0x5c4d17,null));};exports[_0xd7df('0x23')]=function(_0x36de76,_0x5195cf){return respondWithRpcPromise('UpdateVoiceQueue',_['merge'](_0x36de76['body'],_0x36de76['params']))[_0xd7df('0xb')](respondWithResult(_0x5195cf,null))['catch'](handleError(_0x5195cf,null));};exports[_0xd7df('0x24')]=function(_0x156612,_0x503a90){return respondWithRpcPromise(_0xd7df('0x25'),_[_0xd7df('0x1c')](_0x156612['query'],_0x156612[_0xd7df('0x1f')]))[_0xd7df('0xb')](respondWithResult(_0x503a90,null))[_0xd7df('0x10')](handleError(_0x503a90,null));};exports[_0xd7df('0x26')]=function(_0x40f965,_0x3304c4){return respondWithRpcPromise('VoiceQueuesChannels',_0x40f965[_0xd7df('0x1a')])[_0xd7df('0xb')](respondWithResult(_0x3304c4,null))[_0xd7df('0x10')](handleError(_0x3304c4,null));};exports[_0xd7df('0x27')]=function(_0x363f2d,_0x4cecf2){return respondWithRpcPromise(_0xd7df('0x28'),_[_0xd7df('0x1c')](_0x363f2d[_0xd7df('0x1a')],_0x363f2d[_0xd7df('0x1f')]))[_0xd7df('0xb')](respondWithResult(_0x4cecf2,null))['catch'](handleError(_0x4cecf2,null));};exports['voiceQueuesChannelHangup']=function(_0x4051fb,_0x564562){return respondWithRpcPromise(_0xd7df('0x29'),_[_0xd7df('0x1c')](_0x4051fb[_0xd7df('0x1a')],_0x4051fb[_0xd7df('0x1f')]))['then'](respondWithResult(_0x564562,null))['catch'](handleError(_0x564562,null));};exports['voiceQueuesChannelRedirect']=function(_0x2a96e3,_0x15e682){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0xd7df('0x1c')](_0x2a96e3[_0xd7df('0x1a')],_0x2a96e3[_0xd7df('0x1f')]))[_0xd7df('0xb')](respondWithResult(_0x15e682,null))['catch'](handleError(_0x15e682,null));};exports[_0xd7df('0x2a')]=function(_0x45642c,_0x5f0a6d){return respondWithRpcPromise(_0xd7df('0x2b'),_0x45642c['query'])[_0xd7df('0xb')](respondWithResult(_0x5f0a6d,null))[_0xd7df('0x10')](handleError(_0x5f0a6d,null));};exports[_0xd7df('0x2c')]=function(_0x59c755,_0x138391){return respondWithRpcPromise(_0xd7df('0x2d'),_0x59c755[_0xd7df('0x1a')])[_0xd7df('0xb')](respondWithResult(_0x138391,null))['catch'](handleError(_0x138391,null));};exports[_0xd7df('0x2e')]=function(_0x230857,_0x2314e6){var _0x4f6286;return respondWithRpcPromise(_0xd7df('0x2f'),_0x230857[_0xd7df('0x1a')])[_0xd7df('0xb')](function(_0x517824){_0x4f6286=_0x517824;return respondWithRpcPromise(_0xd7df('0x2f'),_0x230857[_0xd7df('0x1a')],routingClient);})['then'](function(_0x4b2561){return _[_0xd7df('0x1c')]({},_0x4b2561,_0x4f6286);})[_0xd7df('0xb')](respondWithResult(_0x2314e6,null))[_0xd7df('0x10')](handleError(_0x2314e6,null));};exports['agentCapacity']=function(_0x5e8cd0,_0x2c149e){if(_0x5e8cd0['body']&&_0x5e8cd0[_0xd7df('0x30')]['interaction']&&_0x5e8cd0['user']&&_0x5e8cd0[_0xd7df('0x31')]['name']){for(var _0x18ef10 in _0x5e8cd0[_0xd7df('0x30')][_0xd7df('0x32')]){if(_0x5e8cd0[_0xd7df('0x30')][_0xd7df('0x32')][_0xd7df('0x33')](_0x18ef10)){db[_0xd7df('0x34')][_0xd7df('0x35')]({'where':{'channel':_0x18ef10,'membername':_0x5e8cd0[_0xd7df('0x31')]['name'],'type':_0xd7df('0x36'),'exitAt':null,'uniqueid':_0x5e8cd0['body'][_0xd7df('0x32')][_0x18ef10]&&_0x5e8cd0[_0xd7df('0x30')][_0xd7df('0x32')][_0x18ef10][_0xd7df('0x37')]?{'$notIn':_0x5e8cd0[_0xd7df('0x30')][_0xd7df('0x32')][_0x18ef10]}:{'$ne':null}}})[_0xd7df('0xb')](function(_0x38056b){var _0x3a3c1a=moment()['format'](_0xd7df('0x38'));for(var _0x563f90=0x0,_0x49085b=_0x38056b['length'];_0x563f90<_0x49085b;_0x563f90+=0x1){_0x38056b[_0x563f90][_0xd7df('0x39')]({'exitAt':_0x3a3c1a});}});for(var _0x162900=0x0;_0x162900<_0x5e8cd0[_0xd7df('0x30')]['interaction'][_0x18ef10]['length'];_0x162900+=0x1){db[_0xd7df('0x34')]['findOrCreate']({'where':{'channel':_0x18ef10,'membername':_0x5e8cd0[_0xd7df('0x31')][_0xd7df('0x15')],'type':_0xd7df('0x36'),'uniqueid':_0x5e8cd0[_0xd7df('0x30')][_0xd7df('0x32')][_0x18ef10][_0x162900],'exitAt':null},'defaults':{'channel':_0x18ef10,'membername':_0x5e8cd0[_0xd7df('0x31')][_0xd7df('0x15')],'interface':_[_0xd7df('0x16')](_0x5e8cd0[_0xd7df('0x31')][_0xd7df('0x3a')])?util[_0xd7df('0x3b')](_0xd7df('0x3c'),_0x5e8cd0['user'][_0xd7df('0x15')]):_0x5e8cd0[_0xd7df('0x31')][_0xd7df('0x3a')],'type':_0xd7df('0x36'),'enterAt':moment()[_0xd7df('0x3b')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0xd7df('0x3d'),'internal':_0x5e8cd0[_0xd7df('0x31')][_0xd7df('0x3e')],'uniqueid':_0x5e8cd0['body'][_0xd7df('0x32')][_0x18ef10][_0x162900]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x5e8cd0[_0xd7df('0x1f')]['id'],'capacity':_0x5e8cd0[_0xd7df('0x30')][_0xd7df('0x3f')]},routingClient)[_0xd7df('0xb')](respondWithResult(_0x2c149e,null))[_0xd7df('0x10')](handleError(_0x2c149e,null));};exports['telephones']=function(_0x4abe81,_0x53ec02){return respondWithRpcPromise(_0xd7df('0x40'),_0x4abe81['query'])[_0xd7df('0xb')](respondWithResult(_0x53ec02,null))[_0xd7df('0x10')](handleError(_0x53ec02,null));};exports[_0xd7df('0x41')]=function(_0xdf3046,_0x275af9){return respondWithRpcPromise(_0xd7df('0x42'),_0xdf3046[_0xd7df('0x1a')])[_0xd7df('0xb')](respondWithResult(_0x275af9,null))[_0xd7df('0x10')](handleError(_0x275af9,null));};exports[_0xd7df('0x43')]=function(_0x382d11,_0x327365){return respondWithRpcPromise(_0xd7df('0x44'),_0x382d11[_0xd7df('0x1a')])[_0xd7df('0xb')](respondWithResult(_0x327365,null))[_0xd7df('0x10')](handleError(_0x327365,null));};exports['chatQueues']=function(_0x332db5,_0x28c9b7){return respondWithRpcPromise('ChatQueues',_0x332db5['query'],routingClient)[_0xd7df('0xb')](respondWithResult(_0x28c9b7,null))['catch'](handleError(_0x28c9b7,null));};exports[_0xd7df('0x45')]=function(_0x4fb55a,_0x1f34c2){return respondWithRpcPromise(_0xd7df('0x46'),_0x4fb55a[_0xd7df('0x1a')],routingClient)['then'](findById(_0x4fb55a['params']['id']))['then'](respondWithResult(_0x1f34c2,null))[_0xd7df('0x10')](handleError(_0x1f34c2,null));};exports[_0xd7df('0x47')]=function(_0x19c387,_0x527b6f){return respondWithRpcPromise(_0xd7df('0x48'),_0x19c387[_0xd7df('0x1a')],routingClient)['then'](respondWithResult(_0x527b6f,null))[_0xd7df('0x10')](handleError(_0x527b6f,null));};exports[_0xd7df('0x49')]=function(_0x35204f,_0x25d187){return respondWithRpcPromise(_0xd7df('0x48'),_0x35204f[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](findById(_0x35204f[_0xd7df('0x1f')]['id']))[_0xd7df('0xb')](respondWithResult(_0x25d187,null))[_0xd7df('0x10')](handleError(_0x25d187,null));};exports[_0xd7df('0x4a')]=function(_0x398e43,_0x3dba78){return respondWithRpcPromise(_0xd7df('0x4b'),_0x398e43[_0xd7df('0x1a')],mailClient)[_0xd7df('0xb')](respondWithResult(_0x3dba78,null))[_0xd7df('0x10')](handleError(_0x3dba78,null));};exports[_0xd7df('0x4c')]=function(_0x3f2775,_0x1e6277){return respondWithRpcPromise(_0xd7df('0x4d'),_0x3f2775[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](respondWithResult(_0x1e6277,null))[_0xd7df('0x10')](handleError(_0x1e6277,null));};exports[_0xd7df('0x4e')]=function(_0x3912d6,_0x51ae2b){return respondWithRpcPromise('OpenchannelQueues',_0x3912d6[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](findById(_0x3912d6[_0xd7df('0x1f')]['id']))['then'](respondWithResult(_0x51ae2b,null))[_0xd7df('0x10')](handleError(_0x51ae2b,null));};exports[_0xd7df('0x4f')]=function(_0x1e87aa,_0x2786a6){return respondWithRpcPromise('SmsQueues',_0x1e87aa[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](respondWithResult(_0x2786a6,null))[_0xd7df('0x10')](handleError(_0x2786a6,null));};exports[_0xd7df('0x50')]=function(_0x19a25b,_0x2fbc53){return respondWithRpcPromise(_0xd7df('0x51'),_0x19a25b[_0xd7df('0x1a')],routingClient)['then'](findById(_0x19a25b[_0xd7df('0x1f')]['id']))[_0xd7df('0xb')](respondWithResult(_0x2fbc53,null))['catch'](handleError(_0x2fbc53,null));};exports['whatsappQueues']=function(_0x481fa5,_0x264c5b){return respondWithRpcPromise(_0xd7df('0x52'),_0x481fa5[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](respondWithResult(_0x264c5b,null))['catch'](handleError(_0x264c5b,null));};exports[_0xd7df('0x53')]=function(_0x3d45cf,_0x19df03){return respondWithRpcPromise(_0xd7df('0x52'),_0x3d45cf[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](findById(_0x3d45cf[_0xd7df('0x1f')]['id']))['then'](respondWithResult(_0x19df03,null))['catch'](handleError(_0x19df03,null));};exports[_0xd7df('0x54')]=function(_0x5c1e68,_0x588537){return respondWithRpcPromise(_0xd7df('0x55'),_0x5c1e68[_0xd7df('0x1a')],routingClient)['then'](respondWithResult(_0x588537,null))['catch'](handleError(_0x588537,null));};exports[_0xd7df('0x56')]=function(_0x44d824,_0x49bf7e){return respondWithRpcPromise(_0xd7df('0x55'),_0x44d824[_0xd7df('0x1a')],routingClient)['then'](findById(_0x44d824[_0xd7df('0x1f')]['id']))[_0xd7df('0xb')](respondWithResult(_0x49bf7e,null))['catch'](handleError(_0x49bf7e,null));};exports[_0xd7df('0x57')]=function(_0x519f72,_0x56f55d){return respondWithRpcPromise(_0xd7df('0x58'),_0x519f72[_0xd7df('0x1a')])[_0xd7df('0xb')](respondWithResult(_0x56f55d,null))[_0xd7df('0x10')](handleError(_0x56f55d,null));};exports[_0xd7df('0x59')]=function(_0x40b2a1,_0x5831c1){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x40b2a1[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](respondWithResult(_0x5831c1,null))[_0xd7df('0x10')](handleError(_0x5831c1,null));};exports[_0xd7df('0x5a')]=function(_0x19b0e6,_0x31f681){return respondWithRpcPromise(_0xd7df('0x5b'),_0x19b0e6[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](respondWithResult(_0x31f681,null))['catch'](handleError(_0x31f681,null));};exports[_0xd7df('0x5c')]=function(_0x1682ca,_0x4e9806){return respondWithRpcPromise(_0xd7df('0x5d'),_0x1682ca[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](respondWithResult(_0x4e9806,null))[_0xd7df('0x10')](handleError(_0x4e9806,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x4e5363,_0x5628ed){return respondWithRpcPromise(_0xd7df('0x5d'),_0x4e5363['query'],routingClient)[_0xd7df('0xb')](function(_0x2b1b30){if(_0x4e5363[_0xd7df('0x1a')][_0xd7df('0x5e')]!==undefined){var _0x2d8a31=_(_0x2b1b30[_0xd7df('0x17')])['filter']([_0x4e5363[_0xd7df('0x1a')][_0xd7df('0x5e')],_0x4e5363[_0xd7df('0x1f')]['id']])['map'](_0xd7df('0x5f'))[_0xd7df('0x60')]()['value']();return _0x2b1b30[_0xd7df('0x17')][_0xd7df('0x61')](function(_0x157290){return _0x2d8a31[_0xd7df('0x62')](_0x157290[_0xd7df('0x5f')])>-0x1;});}else{return _0x2b1b30[_0xd7df('0x17')][_0xd7df('0x61')](function(_0x5e93cc){return _0x5e93cc[_0xd7df('0x5f')]===parseInt(_0x4e5363[_0xd7df('0x1f')]['id']);});}})[_0xd7df('0xb')](respondWithResult(_0x5628ed,null))[_0xd7df('0x10')](handleError(_0x5628ed,null));};exports['smsQueuesWaitingInteractions']=function(_0x531a07,_0x2e1e96){return respondWithRpcPromise(_0xd7df('0x63'),_0x531a07[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](respondWithResult(_0x2e1e96,null))[_0xd7df('0x10')](handleError(_0x2e1e96,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x2329ce,_0x4f739b){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x2329ce[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](respondWithResult(_0x4f739b,null))[_0xd7df('0x10')](handleError(_0x4f739b,null));};exports[_0xd7df('0x64')]=function(_0x30c401,_0x3ece24){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x30c401['query'],routingClient)[_0xd7df('0xb')](respondWithResult(_0x3ece24,null))[_0xd7df('0x10')](handleError(_0x3ece24,null));};exports[_0xd7df('0x65')]=function(_0x175a36){return function(_0x5cb2b0,_0xac3b73){var _0x5df36d,_0x158bd9;var _0x5b73e5=_[_0xd7df('0x66')](_0x175a36);var _0x1ed032=_0x175a36===_0xd7df('0x67')?_0xd7df('0x68'):_0xd7df('0x69');return db[_0x5b73e5+_0xd7df('0x6a')]['findOne']({'raw':!![],'where':{'id':_0x5cb2b0[_0xd7df('0x1f')]['id']}})['then'](function(_0x1e2355){if(_[_0xd7df('0x16')](_0x1e2355)){throw new Error(_0x5b73e5+_0xd7df('0x6b'));}_0x5df36d=_0x1e2355;return db[_0x5b73e5+_0xd7df('0x6c')]['findOne']({'where':{'id':_0x5cb2b0[_0xd7df('0x30')][_0xd7df('0x6d')]},'include':[{'model':db[_0x5b73e5+_0xd7df('0x6e')],'as':_0xd7df('0x6e')},{'model':db[_0x5b73e5+_0x1ed032],'as':_0xd7df('0x69')}]});})[_0xd7df('0xb')](function(_0x40a665){if(_[_0xd7df('0x16')](_0x40a665)){throw new Error(_0x5b73e5+_0xd7df('0x6f'));}_0x158bd9=_0x40a665;return _0x40a665[_0xd7df('0x70')]({'read':0x0,'readAt':null,'UserId':null});})[_0xd7df('0xb')](function(){var _0x15bd27={'uniqueid':_0x175a36+'.'+_0x158bd9['id']+'.'+_0x158bd9['Interaction']['id'],'FromUserId':_0x5cb2b0[_0xd7df('0x31')]['id'],'type':_0xd7df('0x71')};_0x15bd27[_0x5b73e5+_0xd7df('0x72')]=_0x158bd9['id'];_0x15bd27[_0x5b73e5+'InteractionId']=_0x158bd9['Interaction']['id'];_0x15bd27[_0xd7df('0x73')+_0x5b73e5+_0x1ed032+'Id']=_0x158bd9[_0xd7df('0x69')]['id'];_0x15bd27['To'+_0x5b73e5+_0xd7df('0x74')]=_0x5df36d['id'];return db[_0x5b73e5+_0xd7df('0x75')][_0xd7df('0x76')](_0x15bd27);})[_0xd7df('0xb')](function(){return respondWithRpcPromise(_0xd7df('0x77'),{'channel':_0x175a36,'interaction':_0x158bd9[_0xd7df('0x6e')],'message':_0x158bd9,'account':_0x158bd9[_0xd7df('0x69')],'applications':[{'id':0x0,'priority':0x1,'app':_0xd7df('0x71'),'appdata':_0x5df36d['name']+','+(_0x158bd9[_0xd7df('0x69')][_0xd7df('0x78')]||0x12c),'interval':_0xd7df('0x79')}]},routingClient);})[_0xd7df('0xb')](respondWithResult(_0xac3b73,null))[_0xd7df('0x10')](handleError(_0xac3b73,null));};};exports[_0xd7df('0x7a')]=function(_0x50c5b9,_0x518092){var _0xa3ae43,_0x31b159;if(_[_0xd7df('0x16')](_0x50c5b9[_0xd7df('0x30')][_0xd7df('0x7b')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x1a888c=_0x50c5b9[_0xd7df('0x30')][_0xd7df('0x7b')];var _0x3d9fba=_[_0xd7df('0x66')](_0x1a888c);var _0x2861e3=_0x1a888c===_0xd7df('0x67')?'Website':_0xd7df('0x69');return db['User']['findOne']({'raw':!![],'where':{'id':_0x50c5b9[_0xd7df('0x1f')]['id'],'role':_0xd7df('0x3d')}})[_0xd7df('0xb')](function(_0x5092d2){if(_[_0xd7df('0x16')](_0x5092d2)){throw new Error('Agent\x20not\x20found');}_0xa3ae43=_0x5092d2;return db[_0x3d9fba+'Message'][_0xd7df('0x7c')]({'where':{'id':_0x50c5b9[_0xd7df('0x30')][_0xd7df('0x6d')]},'include':[{'model':db[_0x3d9fba+_0xd7df('0x6e')],'as':_0xd7df('0x6e')},{'model':db[_0x3d9fba+_0x2861e3],'as':'Account'}]});})['then'](function(_0x3f2ecd){if(_[_0xd7df('0x16')](_0x3f2ecd)){throw new Error(_0x3d9fba+_0xd7df('0x6f'));}_0x31b159=_0x3f2ecd;return _0x3f2ecd[_0xd7df('0x70')]({'read':0x0,'readAt':null,'UserId':null});})[_0xd7df('0xb')](function(){var _0xc447e8={'uniqueid':_0x1a888c+'.'+_0x31b159['id']+'.'+_0x31b159[_0xd7df('0x6e')]['id'],'FromUserId':_0x50c5b9[_0xd7df('0x31')]['id'],'type':_0xd7df('0x71'),'ToUserId':_0xa3ae43['id']};_0xc447e8[_0x3d9fba+_0xd7df('0x72')]=_0x31b159['id'];_0xc447e8[_0x3d9fba+_0xd7df('0x7d')]=_0x31b159[_0xd7df('0x6e')]['id'];_0xc447e8[_0xd7df('0x73')+_0x3d9fba+_0x2861e3+'Id']=_0x31b159['Account']['id'];return db[_0x3d9fba+_0xd7df('0x75')][_0xd7df('0x76')](_0xc447e8);})[_0xd7df('0xb')](function(){return respondWithRpcPromise('Start',{'channel':_0x1a888c,'interaction':_0x31b159[_0xd7df('0x6e')],'message':_0x31b159,'account':_0x31b159['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xd7df('0x3d'),'appdata':_0xa3ae43[_0xd7df('0x15')]+','+(_0x31b159['Account'][_0xd7df('0x7e')]||0x12c),'interval':_0xd7df('0x79')}]},routingClient);})[_0xd7df('0xb')](respondWithResult(_0x518092,null))[_0xd7df('0x10')](handleError(_0x518092,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index a3ca1b0..612a9ca 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 _0x8f69=['update','delete','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./schedule.controller','isAuthenticated','index','/:id','/:id/run','run','put'];(function(_0x4677ee,_0x5d58dd){var _0x3dda22=function(_0x16c414){while(--_0x16c414){_0x4677ee['push'](_0x4677ee['shift']());}};_0x3dda22(++_0x5d58dd);}(_0x8f69,0x11a));var _0x98f6=function(_0x48b810,_0x173a5e){_0x48b810=_0x48b810-0x0;var _0x23c17d=_0x8f69[_0x48b810];return _0x23c17d;};'use strict';var multer=require(_0x98f6('0x0'));var util=require('util');var path=require(_0x98f6('0x1'));var timeout=require(_0x98f6('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x98f6('0x3'));var interaction=require(_0x98f6('0x4'));var config=require('../../config/environment');var controller=require(_0x98f6('0x5'));router['get']('/',auth[_0x98f6('0x6')](),controller[_0x98f6('0x7')]);router['get'](_0x98f6('0x8'),auth[_0x98f6('0x6')](),controller['show']);router['get'](_0x98f6('0x9'),auth['isAuthenticated'](),controller[_0x98f6('0xa')]);router['post']('/',auth[_0x98f6('0x6')](),controller['create']);router[_0x98f6('0xb')](_0x98f6('0x8'),auth['isAuthenticated'](),controller[_0x98f6('0xc')]);router[_0x98f6('0xd')]('/:id',auth[_0x98f6('0x6')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xd842=['show','/:id/run','run','post','create','put','update','delete','destroy','exports','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','isAuthenticated','index','get','/:id'];(function(_0x4a15ca,_0x2fef6f){var _0x456a49=function(_0x5110cb){while(--_0x5110cb){_0x4a15ca['push'](_0x4a15ca['shift']());}};_0x456a49(++_0x2fef6f);}(_0xd842,0x73));var _0x2d84=function(_0x3f6248,_0x5e8cb5){_0x3f6248=_0x3f6248-0x0;var _0x29f837=_0xd842[_0x3f6248];return _0x29f837;};'use strict';var multer=require('multer');var util=require(_0x2d84('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2d84('0x1'));var router=express['Router']();var fs_extra=require(_0x2d84('0x2'));var auth=require(_0x2d84('0x3'));var interaction=require(_0x2d84('0x4'));var config=require(_0x2d84('0x5'));var controller=require(_0x2d84('0x6'));router['get']('/',auth[_0x2d84('0x7')](),controller[_0x2d84('0x8')]);router[_0x2d84('0x9')](_0x2d84('0xa'),auth[_0x2d84('0x7')](),controller[_0x2d84('0xb')]);router[_0x2d84('0x9')](_0x2d84('0xc'),auth[_0x2d84('0x7')](),controller[_0x2d84('0xd')]);router[_0x2d84('0xe')]('/',auth[_0x2d84('0x7')](),controller[_0x2d84('0xf')]);router[_0x2d84('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x2d84('0x11')]);router[_0x2d84('0x12')](_0x2d84('0xa'),auth[_0x2d84('0x7')](),controller[_0x2d84('0x13')]);module[_0x2d84('0x14')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 0253f46..834cff2 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 _0xe36e=['TEXT','sequelize','exports','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','months','days','hours','minutes','csv','pdf','xlsx','custom','BOOLEAN'];(function(_0x1a9f27,_0x1f8a6f){var _0x142e50=function(_0x522441){while(--_0x522441){_0x1a9f27['push'](_0x1a9f27['shift']());}};_0x142e50(++_0x1f8a6f);}(_0xe36e,0xe5));var _0xee36=function(_0x4f7ade,_0x29da53){_0x4f7ade=_0x4f7ade-0x0;var _0x588e37=_0xe36e[_0x4f7ade];return _0x588e37;};'use strict';var Sequelize=require(_0xee36('0x0'));module[_0xee36('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xee36('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xee36('0x2')],'allowNull':![],'defaultValue':_0xee36('0x3')},'startAt':{'type':Sequelize[_0xee36('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0xee36('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xee36('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xee36('0x6')](_0xee36('0x7'),_0xee36('0x8'),_0xee36('0x9'),'weeks',_0xee36('0xa'),_0xee36('0xb'),_0xee36('0xc')),'allowNull':![],'defaultValue':_0xee36('0xa')},'output':{'type':Sequelize[_0xee36('0x6')](_0xee36('0xd'),_0xee36('0xe'),_0xee36('0xf')),'allowNull':![],'defaultValue':_0xee36('0xd')},'type':{'type':Sequelize[_0xee36('0x6')](_0xee36('0x10'),'default'),'allowNull':![],'defaultValue':_0xee36('0x10')},'sendMail':{'type':Sequelize[_0xee36('0x11')],'defaultValue':![]},'email':{'type':Sequelize[_0xee36('0x2')]},'cc':{'type':Sequelize[_0xee36('0x12')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x890a=['STRING','0\x200\x20*\x20*\x20*','DATE','ENUM','years','months','weeks','days','csv','pdf','xlsx','custom','default','BOOLEAN','TEXT','sequelize','exports'];(function(_0x2b85f0,_0x1b79d5){var _0x19c09a=function(_0x58d557){while(--_0x58d557){_0x2b85f0['push'](_0x2b85f0['shift']());}};_0x19c09a(++_0x1b79d5);}(_0x890a,0x86));var _0xa890=function(_0x244da7,_0x14e25e){_0x244da7=_0x244da7-0x0;var _0x34db85=_0x890a[_0x244da7];return _0x34db85;};'use strict';var Sequelize=require(_0xa890('0x0'));module[_0xa890('0x1')]={'name':{'type':Sequelize[_0xa890('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa890('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xa890('0x2')],'allowNull':![],'defaultValue':_0xa890('0x3')},'startAt':{'type':Sequelize[_0xa890('0x4')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xa890('0x5')](_0xa890('0x6'),'quarters',_0xa890('0x7'),_0xa890('0x8'),'days','hours','minutes'),'allowNull':![],'defaultValue':_0xa890('0x9')},'output':{'type':Sequelize[_0xa890('0x5')](_0xa890('0xa'),_0xa890('0xb'),_0xa890('0xc')),'allowNull':![],'defaultValue':_0xa890('0xa')},'type':{'type':Sequelize[_0xa890('0x5')](_0xa890('0xd'),_0xa890('0xe')),'allowNull':![],'defaultValue':_0xa890('0xd')},'sendMail':{'type':Sequelize[_0xa890('0xf')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xa890('0x10')]},'bcc':{'type':Sequelize[_0xa890('0x10')]},'sendIfEmpty':{'type':Sequelize[_0xa890('0xf')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 6f4db3b..8e2af12 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 _0x1b96=['apply','save','update','then','error','stack','name','send','index','Schedule','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','options','include','rows','catch','show','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Scheduler','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','destroy','run','../../config/schedule','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x38f34e,_0x287825){var _0x3f3adf=function(_0x40c089){while(--_0x40c089){_0x38f34e['push'](_0x38f34e['shift']());}};_0x3f3adf(++_0x287825);}(_0x1b96,0x182));var _0x61b9=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x1b96[_0x167cc1];return _0x10bc4b;};'use strict';var emlformat=require(_0x61b9('0x0'));var rimraf=require(_0x61b9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x61b9('0x2'));var rp=require(_0x61b9('0x3'));var moment=require(_0x61b9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x61b9('0x5'));var util=require(_0x61b9('0x6'));var path=require(_0x61b9('0x7'));var sox=require(_0x61b9('0x8'));var csv=require(_0x61b9('0x9'));var ejs=require(_0x61b9('0xa'));var fs=require('fs');var fs_extra=require(_0x61b9('0xb'));var _=require(_0x61b9('0xc'));var squel=require('squel');var crypto=require(_0x61b9('0xd'));var jsforce=require(_0x61b9('0xe'));var deskjs=require(_0x61b9('0xf'));var toCsv=require(_0x61b9('0x9'));var querystring=require('querystring');var Papa=require(_0x61b9('0x10'));var Redis=require(_0x61b9('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x61b9('0x12'));var hardwareService=require(_0x61b9('0x13'));var logger=require(_0x61b9('0x14'))(_0x61b9('0x15'));var utils=require(_0x61b9('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x61b9('0x17'));var db=require(_0x61b9('0x18'))['db'];function respondWithStatusCode(_0x211fbb,_0x485f9b){_0x485f9b=_0x485f9b||0xcc;return function(_0x1cc215){if(_0x1cc215){return _0x211fbb[_0x61b9('0x19')](_0x485f9b);}return _0x211fbb[_0x61b9('0x1a')](_0x485f9b)[_0x61b9('0x1b')]();};}function respondWithResult(_0x445af0,_0x3612e3){_0x3612e3=_0x3612e3||0xc8;return function(_0x3bc597){if(_0x3bc597){return _0x445af0[_0x61b9('0x1a')](_0x3612e3)[_0x61b9('0x1c')](_0x3bc597);}};}function respondWithFilteredResult(_0x5c3bba,_0x5a3c89){return function(_0x33bdd3){if(_0x33bdd3){var _0xd4e84b=typeof _0x5a3c89[_0x61b9('0x1d')]===_0x61b9('0x1e')&&typeof _0x5a3c89[_0x61b9('0x1f')]==='undefined';var _0x4d3193=_0x33bdd3[_0x61b9('0x20')];var _0x1a3a22=_0xd4e84b?0x0:_0x5a3c89[_0x61b9('0x1d')];var _0x5f95bd=_0xd4e84b?_0x33bdd3['count']:_0x5a3c89[_0x61b9('0x1d')]+_0x5a3c89['limit'];var _0x3b14d2;if(_0x5f95bd>=_0x4d3193){_0x5f95bd=_0x4d3193;_0x3b14d2=0xc8;}else{_0x3b14d2=0xce;}_0x5c3bba['status'](_0x3b14d2);return _0x5c3bba[_0x61b9('0x21')]('Content-Range',_0x1a3a22+'-'+_0x5f95bd+'/'+_0x4d3193)[_0x61b9('0x1c')](_0x33bdd3);}return null;};}function patchUpdates(_0x146260){return function(_0x388c65){try{jsonpatch[_0x61b9('0x22')](_0x388c65,_0x146260,!![]);}catch(_0x2a67cc){return BPromise['reject'](_0x2a67cc);}return _0x388c65[_0x61b9('0x23')]();};}function saveUpdates(_0x1f17b7,_0x435c37){return function(_0x1f2c90){if(_0x1f2c90){return _0x1f2c90[_0x61b9('0x24')](_0x1f17b7)['then'](function(_0x5a7350){return _0x5a7350;});}return null;};}function removeEntity(_0x197d58,_0x1122c9){return function(_0x91cf4){if(_0x91cf4){return _0x91cf4['destroy']()['then'](function(){var _0xf58937=_0x91cf4['get']({'plain':!![]});var _0x4b4118='Scheduler';return db['UserProfileResource']['destroy']({'where':{'type':_0x4b4118,'resourceId':_0xf58937['id']}})[_0x61b9('0x25')](function(){return _0x91cf4;});})[_0x61b9('0x25')](function(){_0x197d58[_0x61b9('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5671ed,_0xeda591){return function(_0x3ae9d1){if(!_0x3ae9d1){_0x5671ed[_0x61b9('0x19')](0x194);}return _0x3ae9d1;};}function handleError(_0x4c32a0,_0x7296d3){_0x7296d3=_0x7296d3||0x1f4;return function(_0x34bfc5){logger[_0x61b9('0x26')](_0x34bfc5[_0x61b9('0x27')]);if(_0x34bfc5[_0x61b9('0x28')]){delete _0x34bfc5[_0x61b9('0x28')];}_0x4c32a0['status'](_0x7296d3)[_0x61b9('0x29')](_0x34bfc5);};}exports[_0x61b9('0x2a')]=function(_0x2a65e1,_0x268473){var _0x11cc89={},_0x516649={},_0x5ead5e={'count':0x0,'rows':[]};var _0x21b9ae=_['map'](db[_0x61b9('0x2b')][_0x61b9('0x2c')],function(_0x3ee4c2){return{'name':_0x3ee4c2[_0x61b9('0x2d')],'type':_0x3ee4c2[_0x61b9('0x2e')][_0x61b9('0x2f')]};});_0x516649[_0x61b9('0x30')]=_[_0x61b9('0x31')](_0x21b9ae,'name');_0x516649[_0x61b9('0x32')]=_[_0x61b9('0x33')](_0x2a65e1[_0x61b9('0x32')]);_0x516649[_0x61b9('0x34')]=_[_0x61b9('0x35')](_0x516649[_0x61b9('0x30')],_0x516649[_0x61b9('0x32')]);_0x11cc89[_0x61b9('0x36')]=_[_0x61b9('0x35')](_0x516649[_0x61b9('0x30')],qs['fields'](_0x2a65e1['query'][_0x61b9('0x37')]));_0x11cc89['attributes']=_0x11cc89['attributes'][_0x61b9('0x38')]?_0x11cc89[_0x61b9('0x36')]:_0x516649[_0x61b9('0x30')];if(!_0x2a65e1[_0x61b9('0x32')][_0x61b9('0x39')](_0x61b9('0x3a'))){_0x11cc89[_0x61b9('0x1f')]=qs[_0x61b9('0x1f')](_0x2a65e1[_0x61b9('0x32')][_0x61b9('0x1f')]);_0x11cc89[_0x61b9('0x1d')]=qs[_0x61b9('0x1d')](_0x2a65e1[_0x61b9('0x32')][_0x61b9('0x1d')]);}_0x11cc89[_0x61b9('0x3b')]=qs[_0x61b9('0x3c')](_0x2a65e1['query'][_0x61b9('0x3c')]);_0x11cc89['where']=qs[_0x61b9('0x34')](_['pick'](_0x2a65e1[_0x61b9('0x32')],_0x516649[_0x61b9('0x34')]),_0x21b9ae);if(_0x2a65e1[_0x61b9('0x32')]['filter']){_0x11cc89[_0x61b9('0x3d')]=_[_0x61b9('0x3e')](_0x11cc89['where'],{'$or':_[_0x61b9('0x31')](_0x21b9ae,function(_0x1eb43c){if(_0x1eb43c[_0x61b9('0x2e')]!=='VIRTUAL'){var _0x1d976b={};_0x1d976b[_0x1eb43c[_0x61b9('0x28')]]={'$like':'%'+_0x2a65e1[_0x61b9('0x32')][_0x61b9('0x3f')]+'%'};return _0x1d976b;}})});}_0x11cc89=_[_0x61b9('0x3e')]({},_0x11cc89,_0x2a65e1[_0x61b9('0x40')]);var _0x1381b8={'where':_0x11cc89[_0x61b9('0x3d')]};return db[_0x61b9('0x2b')][_0x61b9('0x20')](_0x1381b8)[_0x61b9('0x25')](function(_0x273c31){_0x5ead5e[_0x61b9('0x20')]=_0x273c31;if(_0x2a65e1[_0x61b9('0x32')]['includeAll']){_0x11cc89[_0x61b9('0x41')]=[{'all':!![]}];}return db['Schedule']['findAll'](_0x11cc89);})[_0x61b9('0x25')](function(_0x4c4e8b){_0x5ead5e[_0x61b9('0x42')]=_0x4c4e8b;return _0x5ead5e;})[_0x61b9('0x25')](respondWithFilteredResult(_0x268473,_0x11cc89))[_0x61b9('0x43')](handleError(_0x268473,null));};exports[_0x61b9('0x44')]=function(_0x45b313,_0x3b4aad){var _0x4bb7e7={'raw':![],'where':{'id':_0x45b313['params']['id']}},_0x5a71af={};_0x5a71af[_0x61b9('0x30')]=_[_0x61b9('0x33')](db[_0x61b9('0x2b')]['rawAttributes']);_0x5a71af[_0x61b9('0x32')]=_[_0x61b9('0x33')](_0x45b313[_0x61b9('0x32')]);_0x5a71af[_0x61b9('0x34')]=_[_0x61b9('0x35')](_0x5a71af[_0x61b9('0x30')],_0x5a71af[_0x61b9('0x32')]);_0x4bb7e7[_0x61b9('0x36')]=_[_0x61b9('0x35')](_0x5a71af[_0x61b9('0x30')],qs[_0x61b9('0x37')](_0x45b313[_0x61b9('0x32')][_0x61b9('0x37')]));_0x4bb7e7[_0x61b9('0x36')]=_0x4bb7e7[_0x61b9('0x36')][_0x61b9('0x38')]?_0x4bb7e7['attributes']:_0x5a71af[_0x61b9('0x30')];if(_0x45b313['query'][_0x61b9('0x45')]){_0x4bb7e7[_0x61b9('0x41')]=[{'all':!![]}];}_0x4bb7e7=_[_0x61b9('0x3e')]({},_0x4bb7e7,_0x45b313[_0x61b9('0x40')]);return db[_0x61b9('0x2b')][_0x61b9('0x46')](_0x4bb7e7)['then'](handleEntityNotFound(_0x3b4aad,null))[_0x61b9('0x25')](respondWithResult(_0x3b4aad,null))['catch'](handleError(_0x3b4aad,null));};exports[_0x61b9('0x47')]=function(_0x111d55,_0x463a20){return db['Schedule'][_0x61b9('0x47')](_0x111d55['body'],{})[_0x61b9('0x25')](function(_0x2e61bd){var _0x2879ad=_0x111d55[_0x61b9('0x48')]['get']({'plain':!![]});if(!_0x2879ad)throw new Error(_0x61b9('0x49'));if(_0x2879ad[_0x61b9('0x4a')]===_0x61b9('0x48')){var _0x5bb2c0=_0x2e61bd['get']({'plain':!![]});var _0x3a1523=_0x61b9('0x4b');return db[_0x61b9('0x4c')]['find']({'where':{'name':_0x3a1523,'userProfileId':_0x2879ad[_0x61b9('0x4d')]},'raw':!![]})[_0x61b9('0x25')](function(_0x5dfd60){if(_0x5dfd60&&_0x5dfd60['autoAssociation']===0x0){return db['UserProfileResource'][_0x61b9('0x47')]({'name':_0x5bb2c0['name'],'resourceId':_0x5bb2c0['id'],'type':_0x5dfd60['name'],'sectionId':_0x5dfd60['id']},{})[_0x61b9('0x25')](function(){return _0x2e61bd;});}else{return _0x2e61bd;}})['catch'](function(_0x446561){logger['error'](_0x61b9('0x4e'),_0x446561);throw _0x446561;});}return _0x2e61bd;})[_0x61b9('0x25')](respondWithResult(_0x463a20,0xc9))[_0x61b9('0x43')](handleError(_0x463a20,null));};exports[_0x61b9('0x24')]=function(_0xb4bddf,_0x37ebe4){if(_0xb4bddf[_0x61b9('0x4f')]['id']){delete _0xb4bddf[_0x61b9('0x4f')]['id'];}return db[_0x61b9('0x2b')]['find']({'where':{'id':_0xb4bddf[_0x61b9('0x50')]['id']}})[_0x61b9('0x25')](handleEntityNotFound(_0x37ebe4,null))[_0x61b9('0x25')](saveUpdates(_0xb4bddf[_0x61b9('0x4f')],null))[_0x61b9('0x25')](respondWithResult(_0x37ebe4,null))[_0x61b9('0x43')](handleError(_0x37ebe4,null));};exports[_0x61b9('0x51')]=function(_0x375e3b,_0x4911c4){return db[_0x61b9('0x2b')]['find']({'where':{'id':_0x375e3b['params']['id']}})[_0x61b9('0x25')](handleEntityNotFound(_0x4911c4,null))[_0x61b9('0x25')](removeEntity(_0x4911c4,null))['catch'](handleError(_0x4911c4,null));};exports[_0x61b9('0x52')]=function(_0x446c83,_0x524e98,_0x4ce613){var _0x2f8302=require(_0x61b9('0x53'));return db[_0x61b9('0x2b')][_0x61b9('0x46')]({'where':{'id':_0x446c83[_0x61b9('0x50')]['id']},'raw':!![]})[_0x61b9('0x25')](handleEntityNotFound(_0x524e98,null))['then'](function(){_0x2f8302[_0x61b9('0x52')](_0x446c83[_0x61b9('0x50')]['id']);})['then'](respondWithStatusCode(_0x524e98,null))['catch'](handleError(_0x524e98,null));}; \ No newline at end of file +var _0xa1b4=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','limit','count','set','Content-Range','json','update','destroy','then','Scheduler','UserProfileResource','end','stack','name','send','map','Schedule','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','nolimit','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','error','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','to-csv','ejs','fs-extra','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x4ea9da,_0x13ff33){var _0xf5b77b=function(_0x10de52){while(--_0x10de52){_0x4ea9da['push'](_0x4ea9da['shift']());}};_0xf5b77b(++_0x13ff33);}(_0xa1b4,0x181));var _0x4a1b=function(_0x48cb1f,_0x5ca68d){_0x48cb1f=_0x48cb1f-0x0;var _0x172c4d=_0xa1b4[_0x48cb1f];return _0x172c4d;};'use strict';var emlformat=require(_0x4a1b('0x0'));var rimraf=require(_0x4a1b('0x1'));var zipdir=require(_0x4a1b('0x2'));var jsonpatch=require(_0x4a1b('0x3'));var rp=require('request-promise');var moment=require(_0x4a1b('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4a1b('0x5'));var path=require(_0x4a1b('0x6'));var sox=require('sox');var csv=require(_0x4a1b('0x7'));var ejs=require(_0x4a1b('0x8'));var fs=require('fs');var fs_extra=require(_0x4a1b('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x4a1b('0xa'));var jsforce=require(_0x4a1b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x4a1b('0x7'));var querystring=require('querystring');var Papa=require(_0x4a1b('0xc'));var Redis=require(_0x4a1b('0xd'));var authService=require(_0x4a1b('0xe'));var qs=require(_0x4a1b('0xf'));var as=require(_0x4a1b('0x10'));var hardwareService=require(_0x4a1b('0x11'));var logger=require(_0x4a1b('0x12'))(_0x4a1b('0x13'));var utils=require(_0x4a1b('0x14'));var config=require(_0x4a1b('0x15'));var licenseUtil=require(_0x4a1b('0x16'));var db=require(_0x4a1b('0x17'))['db'];function respondWithStatusCode(_0x1b6f13,_0x5b6214){_0x5b6214=_0x5b6214||0xcc;return function(_0x532e1){if(_0x532e1){return _0x1b6f13['sendStatus'](_0x5b6214);}return _0x1b6f13['status'](_0x5b6214)['end']();};}function respondWithResult(_0x158c42,_0x329129){_0x329129=_0x329129||0xc8;return function(_0x436d7d){if(_0x436d7d){return _0x158c42[_0x4a1b('0x18')](_0x329129)['json'](_0x436d7d);}};}function respondWithFilteredResult(_0x5dc015,_0x14fbd5){return function(_0xe213c1){if(_0xe213c1){var _0x261d07=typeof _0x14fbd5[_0x4a1b('0x19')]==='undefined'&&typeof _0x14fbd5[_0x4a1b('0x1a')]==='undefined';var _0x356328=_0xe213c1[_0x4a1b('0x1b')];var _0x45d7a1=_0x261d07?0x0:_0x14fbd5['offset'];var _0x15f8f4=_0x261d07?_0xe213c1['count']:_0x14fbd5['offset']+_0x14fbd5['limit'];var _0x359a9f;if(_0x15f8f4>=_0x356328){_0x15f8f4=_0x356328;_0x359a9f=0xc8;}else{_0x359a9f=0xce;}_0x5dc015[_0x4a1b('0x18')](_0x359a9f);return _0x5dc015[_0x4a1b('0x1c')](_0x4a1b('0x1d'),_0x45d7a1+'-'+_0x15f8f4+'/'+_0x356328)[_0x4a1b('0x1e')](_0xe213c1);}return null;};}function patchUpdates(_0x298002){return function(_0xa5409a){try{jsonpatch['apply'](_0xa5409a,_0x298002,!![]);}catch(_0x158055){return BPromise['reject'](_0x158055);}return _0xa5409a['save']();};}function saveUpdates(_0x240793,_0x2c4b69){return function(_0x5c9600){if(_0x5c9600){return _0x5c9600[_0x4a1b('0x1f')](_0x240793)['then'](function(_0xc67f6e){return _0xc67f6e;});}return null;};}function removeEntity(_0x45388a,_0x44bb08){return function(_0x7e56c3){if(_0x7e56c3){return _0x7e56c3[_0x4a1b('0x20')]()[_0x4a1b('0x21')](function(){var _0x38afa7=_0x7e56c3['get']({'plain':!![]});var _0x430cb6=_0x4a1b('0x22');return db[_0x4a1b('0x23')]['destroy']({'where':{'type':_0x430cb6,'resourceId':_0x38afa7['id']}})[_0x4a1b('0x21')](function(){return _0x7e56c3;});})[_0x4a1b('0x21')](function(){_0x45388a[_0x4a1b('0x18')](0xcc)[_0x4a1b('0x24')]();});}};}function handleEntityNotFound(_0x5534cb,_0x39db98){return function(_0x3087ef){if(!_0x3087ef){_0x5534cb['sendStatus'](0x194);}return _0x3087ef;};}function handleError(_0x163767,_0x14692f){_0x14692f=_0x14692f||0x1f4;return function(_0x1af8dd){logger['error'](_0x1af8dd[_0x4a1b('0x25')]);if(_0x1af8dd[_0x4a1b('0x26')]){delete _0x1af8dd[_0x4a1b('0x26')];}_0x163767['status'](_0x14692f)[_0x4a1b('0x27')](_0x1af8dd);};}exports['index']=function(_0x5e1a63,_0x3c4822){var _0x38f547={},_0x1d2704={},_0x255912={'count':0x0,'rows':[]};var _0x1ce623=_[_0x4a1b('0x28')](db[_0x4a1b('0x29')][_0x4a1b('0x2a')],function(_0x3a3116){return{'name':_0x3a3116[_0x4a1b('0x2b')],'type':_0x3a3116['type'][_0x4a1b('0x2c')]};});_0x1d2704[_0x4a1b('0x2d')]=_[_0x4a1b('0x28')](_0x1ce623,_0x4a1b('0x26'));_0x1d2704['query']=_[_0x4a1b('0x2e')](_0x5e1a63[_0x4a1b('0x2f')]);_0x1d2704['filters']=_[_0x4a1b('0x30')](_0x1d2704[_0x4a1b('0x2d')],_0x1d2704[_0x4a1b('0x2f')]);_0x38f547[_0x4a1b('0x31')]=_[_0x4a1b('0x30')](_0x1d2704[_0x4a1b('0x2d')],qs[_0x4a1b('0x32')](_0x5e1a63[_0x4a1b('0x2f')][_0x4a1b('0x32')]));_0x38f547[_0x4a1b('0x31')]=_0x38f547[_0x4a1b('0x31')][_0x4a1b('0x33')]?_0x38f547[_0x4a1b('0x31')]:_0x1d2704[_0x4a1b('0x2d')];if(!_0x5e1a63['query']['hasOwnProperty'](_0x4a1b('0x34'))){_0x38f547[_0x4a1b('0x1a')]=qs['limit'](_0x5e1a63[_0x4a1b('0x2f')]['limit']);_0x38f547[_0x4a1b('0x19')]=qs['offset'](_0x5e1a63[_0x4a1b('0x2f')]['offset']);}_0x38f547['order']=qs[_0x4a1b('0x35')](_0x5e1a63[_0x4a1b('0x2f')]['sort']);_0x38f547[_0x4a1b('0x36')]=qs['filters'](_[_0x4a1b('0x37')](_0x5e1a63[_0x4a1b('0x2f')],_0x1d2704[_0x4a1b('0x38')]),_0x1ce623);if(_0x5e1a63['query'][_0x4a1b('0x39')]){_0x38f547[_0x4a1b('0x36')]=_[_0x4a1b('0x3a')](_0x38f547[_0x4a1b('0x36')],{'$or':_[_0x4a1b('0x28')](_0x1ce623,function(_0x2b0642){if(_0x2b0642[_0x4a1b('0x3b')]!==_0x4a1b('0x3c')){var _0x3915bb={};_0x3915bb[_0x2b0642['name']]={'$like':'%'+_0x5e1a63[_0x4a1b('0x2f')]['filter']+'%'};return _0x3915bb;}})});}_0x38f547=_[_0x4a1b('0x3a')]({},_0x38f547,_0x5e1a63[_0x4a1b('0x3d')]);var _0x81cf9d={'where':_0x38f547[_0x4a1b('0x36')]};return db['Schedule']['count'](_0x81cf9d)[_0x4a1b('0x21')](function(_0x40f9de){_0x255912[_0x4a1b('0x1b')]=_0x40f9de;if(_0x5e1a63['query'][_0x4a1b('0x3e')]){_0x38f547[_0x4a1b('0x3f')]=[{'all':!![]}];}return db[_0x4a1b('0x29')][_0x4a1b('0x40')](_0x38f547);})[_0x4a1b('0x21')](function(_0x513462){_0x255912[_0x4a1b('0x41')]=_0x513462;return _0x255912;})['then'](respondWithFilteredResult(_0x3c4822,_0x38f547))[_0x4a1b('0x42')](handleError(_0x3c4822,null));};exports[_0x4a1b('0x43')]=function(_0x41507d,_0x1f19c9){var _0x78da6a={'raw':![],'where':{'id':_0x41507d[_0x4a1b('0x44')]['id']}},_0xd5a946={};_0xd5a946[_0x4a1b('0x2d')]=_[_0x4a1b('0x2e')](db[_0x4a1b('0x29')][_0x4a1b('0x2a')]);_0xd5a946[_0x4a1b('0x2f')]=_[_0x4a1b('0x2e')](_0x41507d[_0x4a1b('0x2f')]);_0xd5a946[_0x4a1b('0x38')]=_['intersection'](_0xd5a946[_0x4a1b('0x2d')],_0xd5a946[_0x4a1b('0x2f')]);_0x78da6a[_0x4a1b('0x31')]=_['intersection'](_0xd5a946[_0x4a1b('0x2d')],qs['fields'](_0x41507d[_0x4a1b('0x2f')][_0x4a1b('0x32')]));_0x78da6a['attributes']=_0x78da6a[_0x4a1b('0x31')]['length']?_0x78da6a['attributes']:_0xd5a946[_0x4a1b('0x2d')];if(_0x41507d[_0x4a1b('0x2f')][_0x4a1b('0x3e')]){_0x78da6a[_0x4a1b('0x3f')]=[{'all':!![]}];}_0x78da6a=_[_0x4a1b('0x3a')]({},_0x78da6a,_0x41507d[_0x4a1b('0x3d')]);return db[_0x4a1b('0x29')][_0x4a1b('0x45')](_0x78da6a)[_0x4a1b('0x21')](handleEntityNotFound(_0x1f19c9,null))['then'](respondWithResult(_0x1f19c9,null))[_0x4a1b('0x42')](handleError(_0x1f19c9,null));};exports[_0x4a1b('0x46')]=function(_0x147595,_0xa28d36){return db[_0x4a1b('0x29')]['create'](_0x147595[_0x4a1b('0x47')],{})[_0x4a1b('0x21')](function(_0x4fd6a7){var _0x23cb0e=_0x147595['user'][_0x4a1b('0x48')]({'plain':!![]});if(!_0x23cb0e)throw new Error(_0x4a1b('0x49'));if(_0x23cb0e['role']===_0x4a1b('0x4a')){var _0x5e9929=_0x4fd6a7[_0x4a1b('0x48')]({'plain':!![]});var _0x596c29='Scheduler';return db[_0x4a1b('0x4b')][_0x4a1b('0x45')]({'where':{'name':_0x596c29,'userProfileId':_0x23cb0e[_0x4a1b('0x4c')]},'raw':!![]})[_0x4a1b('0x21')](function(_0x359189){if(_0x359189&&_0x359189[_0x4a1b('0x4d')]===0x0){return db[_0x4a1b('0x23')][_0x4a1b('0x46')]({'name':_0x5e9929['name'],'resourceId':_0x5e9929['id'],'type':_0x359189[_0x4a1b('0x26')],'sectionId':_0x359189['id']},{})[_0x4a1b('0x21')](function(){return _0x4fd6a7;});}else{return _0x4fd6a7;}})[_0x4a1b('0x42')](function(_0x2742d4){logger[_0x4a1b('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2742d4);throw _0x2742d4;});}return _0x4fd6a7;})[_0x4a1b('0x21')](respondWithResult(_0xa28d36,0xc9))['catch'](handleError(_0xa28d36,null));};exports[_0x4a1b('0x1f')]=function(_0x27519e,_0x149c51){if(_0x27519e['body']['id']){delete _0x27519e[_0x4a1b('0x47')]['id'];}return db['Schedule']['find']({'where':{'id':_0x27519e[_0x4a1b('0x44')]['id']}})[_0x4a1b('0x21')](handleEntityNotFound(_0x149c51,null))[_0x4a1b('0x21')](saveUpdates(_0x27519e[_0x4a1b('0x47')],null))[_0x4a1b('0x21')](respondWithResult(_0x149c51,null))[_0x4a1b('0x42')](handleError(_0x149c51,null));};exports[_0x4a1b('0x20')]=function(_0x3dabfb,_0x12a5cf){return db[_0x4a1b('0x29')]['find']({'where':{'id':_0x3dabfb['params']['id']}})['then'](handleEntityNotFound(_0x12a5cf,null))[_0x4a1b('0x21')](removeEntity(_0x12a5cf,null))[_0x4a1b('0x42')](handleError(_0x12a5cf,null));};exports[_0x4a1b('0x4f')]=function(_0x39c31d,_0x5d27db,_0x4bd33c){var _0x4f5a44=require(_0x4a1b('0x50'));return db[_0x4a1b('0x29')][_0x4a1b('0x45')]({'where':{'id':_0x39c31d[_0x4a1b('0x44')]['id']},'raw':!![]})[_0x4a1b('0x21')](handleEntityNotFound(_0x5d27db,null))[_0x4a1b('0x21')](function(){_0x4f5a44[_0x4a1b('0x4f')](_0x39c31d[_0x4a1b('0x44')]['id']);})[_0x4a1b('0x21')](respondWithStatusCode(_0x5d27db,null))['catch'](handleError(_0x5d27db,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 134ca0c..257c495 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 _0x286c=['api','bluebird','request-promise','../../config/environment','exports','define','Schedule','tools_schedules','lodash','util','../../config/logger'];(function(_0x1e99e1,_0xb7dd2f){var _0xe86a0=function(_0x5bd397){while(--_0x5bd397){_0x1e99e1['push'](_0x1e99e1['shift']());}};_0xe86a0(++_0xb7dd2f);}(_0x286c,0x1e1));var _0xc286=function(_0x6c2b56,_0x10552e){_0x6c2b56=_0x6c2b56-0x0;var _0x2028a8=_0x286c[_0x6c2b56];return _0x2028a8;};'use strict';var _=require(_0xc286('0x0'));var util=require(_0xc286('0x1'));var logger=require(_0xc286('0x2'))(_0xc286('0x3'));var moment=require('moment');var BPromise=require(_0xc286('0x4'));var rp=require(_0xc286('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc286('0x6'));var attributes=require('./schedule.attributes');module[_0xc286('0x7')]=function(_0x30d926,_0x31995e){return _0x30d926[_0xc286('0x8')](_0xc286('0x9'),attributes,{'tableName':_0xc286('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbd09=['exports','define','Schedule','tools_schedules','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./schedule.attributes'];(function(_0x55334a,_0x37bd17){var _0xf5452e=function(_0x40e76b){while(--_0x40e76b){_0x55334a['push'](_0x55334a['shift']());}};_0xf5452e(++_0x37bd17);}(_0xbd09,0x79));var _0x9bd0=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xbd09[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x9bd0('0x0'));var util=require(_0x9bd0('0x1'));var logger=require(_0x9bd0('0x2'))('api');var moment=require(_0x9bd0('0x3'));var BPromise=require(_0x9bd0('0x4'));var rp=require(_0x9bd0('0x5'));var fs=require('fs');var path=require(_0x9bd0('0x6'));var rimraf=require('rimraf');var config=require(_0x9bd0('0x7'));var attributes=require(_0x9bd0('0x8'));module[_0x9bd0('0x9')]=function(_0x34aeec,_0x24e1bb){return _0x34aeec[_0x9bd0('0xa')](_0x9bd0('0xb'),attributes,{'tableName':_0x9bd0('0xc'),'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 49a182d..a8ba44a 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 _0xe92f=['client','http','request','then','Schedule,\x20%s,\x20%s','debug','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xe92f,0x113));var _0xfe92=function(_0xea4b97,_0x136ef5){_0xea4b97=_0xea4b97-0x0;var _0x41b7ce=_0xe92f[_0xea4b97];return _0x41b7ce;};'use strict';var _=require('lodash');var util=require(_0xfe92('0x0'));var moment=require(_0xfe92('0x1'));var BPromise=require(_0xfe92('0x2'));var rs=require(_0xfe92('0x3'));var fs=require('fs');var Redis=require(_0xfe92('0x4'));var db=require(_0xfe92('0x5'))['db'];var utils=require(_0xfe92('0x6'));var logger=require(_0xfe92('0x7'))(_0xfe92('0x8'));var config=require(_0xfe92('0x9'));var jayson=require(_0xfe92('0xa'));var client=jayson[_0xfe92('0xb')][_0xfe92('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4fd475,_0xc86ba9,_0x1bf53b){return new BPromise(function(_0x4a592c,_0x53ad60){return client[_0xfe92('0xd')](_0x4fd475,_0x1bf53b)[_0xfe92('0xe')](function(_0x2c2d1a){logger['info'](_0xfe92('0xf'),_0xc86ba9,'request\x20sent');logger[_0xfe92('0x10')](_0xfe92('0x11'),_0xc86ba9,_0xfe92('0x12'),JSON[_0xfe92('0x13')](_0x2c2d1a));if(_0x2c2d1a[_0xfe92('0x14')]){if(_0x2c2d1a[_0xfe92('0x14')][_0xfe92('0x15')]===0x1f4){logger[_0xfe92('0x14')](_0xfe92('0xf'),_0xc86ba9,_0x2c2d1a['error'][_0xfe92('0x16')]);return _0x53ad60(_0x2c2d1a['error'][_0xfe92('0x16')]);}logger[_0xfe92('0x14')]('Schedule,\x20%s,\x20%s',_0xc86ba9,_0x2c2d1a['error']['message']);return _0x4a592c(_0x2c2d1a[_0xfe92('0x14')][_0xfe92('0x16')]);}else{logger[_0xfe92('0x17')]('Schedule,\x20%s,\x20%s',_0xc86ba9,_0xfe92('0x12'));_0x4a592c(_0x2c2d1a[_0xfe92('0x18')]['message']);}})[_0xfe92('0x19')](function(_0x1f7658){logger[_0xfe92('0x14')](_0xfe92('0xf'),_0xc86ba9,_0x1f7658);_0x53ad60(_0x1f7658);});});} \ No newline at end of file +var _0x12a8=['jayson/promise','http','request','then','info','debug','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','Schedule,\x20%s,\x20%s','result','catch','util','moment','randomstring','ioredis','rpc','../../config/environment'];(function(_0xa2fd6,_0x4e5f7f){var _0x5fa614=function(_0x28f304){while(--_0x28f304){_0xa2fd6['push'](_0xa2fd6['shift']());}};_0x5fa614(++_0x4e5f7f);}(_0x12a8,0x8d));var _0x812a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x12a8[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0x812a('0x0'));var moment=require(_0x812a('0x1'));var BPromise=require('bluebird');var rs=require(_0x812a('0x2'));var fs=require('fs');var Redis=require(_0x812a('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x812a('0x4'));var config=require(_0x812a('0x5'));var jayson=require(_0x812a('0x6'));var client=jayson['client'][_0x812a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x581bb1,_0x5ddb15,_0x454d03){return new BPromise(function(_0x3b9a3f,_0x4a305e){return client[_0x812a('0x8')](_0x581bb1,_0x454d03)[_0x812a('0x9')](function(_0x5ad1ec){logger[_0x812a('0xa')]('Schedule,\x20%s,\x20%s',_0x5ddb15,'request\x20sent');logger[_0x812a('0xb')](_0x812a('0xc'),_0x5ddb15,_0x812a('0xd'),JSON[_0x812a('0xe')](_0x5ad1ec));if(_0x5ad1ec[_0x812a('0xf')]){if(_0x5ad1ec[_0x812a('0xf')][_0x812a('0x10')]===0x1f4){logger[_0x812a('0xf')]('Schedule,\x20%s,\x20%s',_0x5ddb15,_0x5ad1ec['error'][_0x812a('0x11')]);return _0x4a305e(_0x5ad1ec[_0x812a('0xf')][_0x812a('0x11')]);}logger[_0x812a('0xf')]('Schedule,\x20%s,\x20%s',_0x5ddb15,_0x5ad1ec[_0x812a('0xf')][_0x812a('0x11')]);return _0x3b9a3f(_0x5ad1ec['error']['message']);}else{logger[_0x812a('0xa')](_0x812a('0x12'),_0x5ddb15,'request\x20sent');_0x3b9a3f(_0x5ad1ec[_0x812a('0x13')]['message']);}})[_0x812a('0x14')](function(_0x1d82c9){logger[_0x812a('0xf')](_0x812a('0x12'),_0x5ddb15,_0x1d82c9);_0x4a305e(_0x1d82c9);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 89b39bb..a3f7c99 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 _0xb8dd=['util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./screenRecording.controller','get','isAuthenticated','/describe','describe','/:id','download','post','create','put','update','delete','destroy'];(function(_0x12a554,_0x3d7ef8){var _0x244ba0=function(_0x5eb5ff){while(--_0x5eb5ff){_0x12a554['push'](_0x12a554['shift']());}};_0x244ba0(++_0x3d7ef8);}(_0xb8dd,0x1a2));var _0xdb8d=function(_0x85a942,_0x19f6ad){_0x85a942=_0x85a942-0x0;var _0x7f6b1a=_0xb8dd[_0x85a942];return _0x7f6b1a;};'use strict';var multer=require('multer');var util=require(_0xdb8d('0x0'));var path=require(_0xdb8d('0x1'));var timeout=require(_0xdb8d('0x2'));var express=require('express');var router=express[_0xdb8d('0x3')]();var fs_extra=require(_0xdb8d('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xdb8d('0x5'));var config=require('../../config/environment');var controller=require(_0xdb8d('0x6'));router[_0xdb8d('0x7')]('/',auth[_0xdb8d('0x8')](),controller['index']);router['get'](_0xdb8d('0x9'),auth[_0xdb8d('0x8')](),controller[_0xdb8d('0xa')]);router[_0xdb8d('0x7')](_0xdb8d('0xb'),auth[_0xdb8d('0x8')](),controller['show']);router[_0xdb8d('0x7')]('/:id/download',auth[_0xdb8d('0x8')](),controller[_0xdb8d('0xc')]);router[_0xdb8d('0xd')]('/',auth[_0xdb8d('0x8')](),controller[_0xdb8d('0xe')]);router[_0xdb8d('0xf')]('/:id',auth[_0xdb8d('0x8')](),controller[_0xdb8d('0x10')]);router[_0xdb8d('0x11')]('/:id',auth[_0xdb8d('0x8')](),controller[_0xdb8d('0x12')]);module['exports']=router; \ No newline at end of file +var _0x2553=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','isAuthenticated','index','get','/describe','/:id','show','/:id/download','download','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x55b67a,_0x5348ce){var _0x636d97=function(_0x590fcc){while(--_0x590fcc){_0x55b67a['push'](_0x55b67a['shift']());}};_0x636d97(++_0x5348ce);}(_0x2553,0xad));var _0x3255=function(_0x45423e,_0x4cc862){_0x45423e=_0x45423e-0x0;var _0x3157c1=_0x2553[_0x45423e];return _0x3157c1;};'use strict';var multer=require(_0x3255('0x0'));var util=require(_0x3255('0x1'));var path=require(_0x3255('0x2'));var timeout=require(_0x3255('0x3'));var express=require(_0x3255('0x4'));var router=express[_0x3255('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3255('0x6'));var interaction=require(_0x3255('0x7'));var config=require(_0x3255('0x8'));var controller=require(_0x3255('0x9'));router['get']('/',auth[_0x3255('0xa')](),controller[_0x3255('0xb')]);router[_0x3255('0xc')](_0x3255('0xd'),auth[_0x3255('0xa')](),controller['describe']);router[_0x3255('0xc')](_0x3255('0xe'),auth[_0x3255('0xa')](),controller[_0x3255('0xf')]);router[_0x3255('0xc')](_0x3255('0x10'),auth['isAuthenticated'](),controller[_0x3255('0x11')]);router[_0x3255('0x12')]('/',auth[_0x3255('0xa')](),controller[_0x3255('0x13')]);router[_0x3255('0x14')](_0x3255('0xe'),auth[_0x3255('0xa')](),controller[_0x3255('0x15')]);router[_0x3255('0x16')](_0x3255('0xe'),auth['isAuthenticated'](),controller[_0x3255('0x17')]);module[_0x3255('0x18')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 5f97042..e939002 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 _0xfb11=['subtract','closedAt','duration','format','MM-DD-YYYY\x20HH:mm','toString','DATE','createdAt','updatedAt','sequelize','path','../../config/environment','VIRTUAL','value','getDataValue','STRING','replace','setDataValue','INTEGER','startedAt'];(function(_0x7a8be9,_0x1caf02){var _0x4bab19=function(_0x539448){while(--_0x539448){_0x7a8be9['push'](_0x7a8be9['shift']());}};_0x4bab19(++_0x1caf02);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xfb11[_0x1c546c];return _0x2cc384;};'use strict';var Sequelize=require(_0x1fb1('0x0'));var moment=require('moment');var path=require(_0x1fb1('0x1'));var config=require(_0x1fb1('0x2'));module['exports']={'format':{'type':Sequelize[_0x1fb1('0x3')],'get':function(){return this['getDataValue'](_0x1fb1('0x4'))?path['extname'](this[_0x1fb1('0x5')](_0x1fb1('0x4'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x1fb1('0x6')]},'value':{'type':Sequelize[_0x1fb1('0x6')],'set':function(_0x4c098d){var _0x1859da=_0x4c098d[_0x1fb1('0x7')](/\\/g,'/');this[_0x1fb1('0x8')](_0x1fb1('0x4'),_0x1859da);}},'rating':{'type':Sequelize[_0x1fb1('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x1fb1('0x9')],'set':function(_0x438d15){this[_0x1fb1('0x8')](_0x1fb1('0xa'),moment()[_0x1fb1('0xb')](_0x438d15,'ms'));this['setDataValue'](_0x1fb1('0xc'),moment());this['setDataValue'](_0x1fb1('0xd'),_0x438d15);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x1fb1('0x5')](_0x1fb1('0xa')))[_0x1fb1('0xe')](_0x1fb1('0xf'))[_0x1fb1('0x10')]();}},'closedAt':{'type':Sequelize[_0x1fb1('0x11')],'get':function(){return moment(this['getDataValue'](_0x1fb1('0xc')))[_0x1fb1('0xe')](_0x1fb1('0xf'))[_0x1fb1('0x10')]();}},'createdAt':{'type':Sequelize[_0x1fb1('0x11')],'get':function(){return moment(this[_0x1fb1('0x5')](_0x1fb1('0x12')))[_0x1fb1('0xe')](_0x1fb1('0xf'))['toString']();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x1fb1('0x5')](_0x1fb1('0x13')))[_0x1fb1('0xe')]('MM-DD-YYYY\x20HH:mm')[_0x1fb1('0x10')]();}}}; \ No newline at end of file +var _0x1c63=['startedAt','subtract','closedAt','duration','MM-DD-YYYY\x20HH:mm','toString','DATE','format','createdAt','updatedAt','sequelize','moment','path','../../config/environment','VIRTUAL','getDataValue','value','STRING','replace','setDataValue','INTEGER'];(function(_0x2fcf18,_0x10009a){var _0x4c68cc=function(_0x444002){while(--_0x444002){_0x2fcf18['push'](_0x2fcf18['shift']());}};_0x4c68cc(++_0x10009a);}(_0x1c63,0xdc));var _0x31c6=function(_0xc56c46,_0x3fc792){_0xc56c46=_0xc56c46-0x0;var _0x2055d6=_0x1c63[_0xc56c46];return _0x2055d6;};'use strict';var Sequelize=require(_0x31c6('0x0'));var moment=require(_0x31c6('0x1'));var path=require(_0x31c6('0x2'));var config=require(_0x31c6('0x3'));module['exports']={'format':{'type':Sequelize[_0x31c6('0x4')],'get':function(){return this[_0x31c6('0x5')](_0x31c6('0x6'))?path['extname'](this[_0x31c6('0x5')](_0x31c6('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x31c6('0x7')]},'channel':{'type':Sequelize[_0x31c6('0x7')]},'value':{'type':Sequelize[_0x31c6('0x7')],'set':function(_0x4ac1b7){var _0x560053=_0x4ac1b7[_0x31c6('0x8')](/\\/g,'/');this[_0x31c6('0x9')](_0x31c6('0x6'),_0x560053);}},'rating':{'type':Sequelize[_0x31c6('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x31c6('0xa')],'set':function(_0x487e6e){this[_0x31c6('0x9')](_0x31c6('0xb'),moment()[_0x31c6('0xc')](_0x487e6e,'ms'));this[_0x31c6('0x9')](_0x31c6('0xd'),moment());this['setDataValue'](_0x31c6('0xe'),_0x487e6e);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x31c6('0x5')](_0x31c6('0xb')))['format'](_0x31c6('0xf'))[_0x31c6('0x10')]();}},'closedAt':{'type':Sequelize[_0x31c6('0x11')],'get':function(){return moment(this[_0x31c6('0x5')](_0x31c6('0xd')))[_0x31c6('0x12')]('MM-DD-YYYY\x20HH:mm')[_0x31c6('0x10')]();}},'createdAt':{'type':Sequelize[_0x31c6('0x11')],'get':function(){return moment(this[_0x31c6('0x5')](_0x31c6('0x13')))[_0x31c6('0x12')]('MM-DD-YYYY\x20HH:mm')['toString']();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0x31c6('0x14')))['format'](_0x31c6('0xf'))[_0x31c6('0x10')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index d0b9c69..a401c45 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 _0xac31=['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','index','map','ScreenRecording','rawAttributes','type','key','model','differenceBy','format','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','options','then','includeAll','findAll','rows','catch','params','find','create','body','createdAt','closedAt','value','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','%s.cypher','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher'];(function(_0x50f6e5,_0x151ccb){var _0x5988c5=function(_0x490a93){while(--_0x490a93){_0x50f6e5['push'](_0x50f6e5['shift']());}};_0x5988c5(++_0x151ccb);}(_0xac31,0xca));var _0x1ac3=function(_0x4b12c6,_0x5d0427){_0x4b12c6=_0x4b12c6-0x0;var _0x35253e=_0xac31[_0x4b12c6];return _0x35253e;};'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={},_0x2ddd73={},_0x4000b0={'count':0x0,'rows':[]};var _0x440aed=_[_0x1ac3('0x2c')](db[_0x1ac3('0x2d')][_0x1ac3('0x2e')],function(_0x9c17c2){return{'name':_0x9c17c2['fieldName'],'type':_0x9c17c2[_0x1ac3('0x2f')][_0x1ac3('0x30')]};});_0x2ddd73[_0x1ac3('0x31')]=_[_0x1ac3('0x32')](_['map'](_0x440aed,_0x1ac3('0x29')),[_0x1ac3('0x33')]);_0x2ddd73[_0x1ac3('0x34')]=_[_0x1ac3('0x35')](_0x4b3d3c[_0x1ac3('0x34')]);_0x2ddd73['filters']=_[_0x1ac3('0x36')](_0x2ddd73[_0x1ac3('0x31')],_0x2ddd73[_0x1ac3('0x34')]);_0x541da0[_0x1ac3('0x37')]=_[_0x1ac3('0x36')](_0x2ddd73[_0x1ac3('0x31')],qs['fields'](_0x4b3d3c[_0x1ac3('0x34')][_0x1ac3('0x38')]));_0x541da0[_0x1ac3('0x37')]=_0x541da0[_0x1ac3('0x37')]['length']?_0x541da0[_0x1ac3('0x37')]:_0x2ddd73[_0x1ac3('0x31')];if(!_0x4b3d3c[_0x1ac3('0x34')][_0x1ac3('0x39')](_0x1ac3('0x3a'))){_0x541da0[_0x1ac3('0x1f')]=qs[_0x1ac3('0x1f')](_0x4b3d3c[_0x1ac3('0x34')][_0x1ac3('0x1f')]);_0x541da0['offset']=qs[_0x1ac3('0x1d')](_0x4b3d3c[_0x1ac3('0x34')]['offset']);}_0x541da0[_0x1ac3('0x3b')]=qs[_0x1ac3('0x3c')](_0x4b3d3c[_0x1ac3('0x34')][_0x1ac3('0x3c')]);_0x541da0[_0x1ac3('0x3d')]=qs[_0x1ac3('0x3e')](_[_0x1ac3('0x3f')](_0x4b3d3c[_0x1ac3('0x34')],_0x2ddd73['filters']),_0x440aed);if(_0x4b3d3c[_0x1ac3('0x34')]['filter']){_0x541da0[_0x1ac3('0x3d')]=_[_0x1ac3('0x40')](_0x541da0[_0x1ac3('0x3d')],{'$or':_[_0x1ac3('0x2c')](_0x440aed,function(_0x3141ae){if(_0x3141ae[_0x1ac3('0x2f')]!=='VIRTUAL'){var _0x3b5c1c={};_0x3b5c1c[_0x3141ae[_0x1ac3('0x29')]]={'$like':'%'+_0x4b3d3c[_0x1ac3('0x34')]['filter']+'%'};return _0x3b5c1c;}})});}_0x541da0=_[_0x1ac3('0x40')]({},_0x541da0,_0x4b3d3c[_0x1ac3('0x41')]);var _0x5cec6b={'where':_0x541da0[_0x1ac3('0x3d')]};return db[_0x1ac3('0x2d')][_0x1ac3('0x20')](_0x5cec6b)[_0x1ac3('0x42')](function(_0x466a45){_0x4000b0[_0x1ac3('0x20')]=_0x466a45;if(_0x4b3d3c[_0x1ac3('0x34')][_0x1ac3('0x43')]){_0x541da0['include']=[{'all':!![]}];}return db[_0x1ac3('0x2d')][_0x1ac3('0x44')](_0x541da0);})[_0x1ac3('0x42')](function(_0x254a77){_0x4000b0[_0x1ac3('0x45')]=_0x254a77;return _0x4000b0;})[_0x1ac3('0x42')](respondWithFilteredResult(_0x61441d,_0x541da0))[_0x1ac3('0x46')](handleError(_0x61441d,null));};exports['show']=function(_0x4edc4d,_0x2c2099){var _0x3f60ca={'raw':![],'where':{'id':_0x4edc4d[_0x1ac3('0x47')]['id']}},_0x4972d1={};_0x4972d1[_0x1ac3('0x31')]=_['keys'](db[_0x1ac3('0x2d')]['rawAttributes']);_0x4972d1[_0x1ac3('0x34')]=_[_0x1ac3('0x35')](_0x4edc4d[_0x1ac3('0x34')]);_0x4972d1[_0x1ac3('0x3e')]=_['intersection'](_0x4972d1[_0x1ac3('0x31')],_0x4972d1[_0x1ac3('0x34')]);_0x3f60ca[_0x1ac3('0x37')]=_[_0x1ac3('0x36')](_0x4972d1[_0x1ac3('0x31')],qs['fields'](_0x4edc4d[_0x1ac3('0x34')][_0x1ac3('0x38')]));_0x3f60ca[_0x1ac3('0x37')]=_0x3f60ca[_0x1ac3('0x37')]['length']?_0x3f60ca[_0x1ac3('0x37')]:_0x4972d1[_0x1ac3('0x31')];if(_0x4edc4d[_0x1ac3('0x34')][_0x1ac3('0x43')]){_0x3f60ca['include']=[{'all':!![]}];}_0x3f60ca=_[_0x1ac3('0x40')]({},_0x3f60ca,_0x4edc4d[_0x1ac3('0x41')]);return db[_0x1ac3('0x2d')][_0x1ac3('0x48')](_0x3f60ca)['then'](handleEntityNotFound(_0x2c2099,null))[_0x1ac3('0x42')](respondWithResult(_0x2c2099,null))['catch'](handleError(_0x2c2099,null));};exports[_0x1ac3('0x49')]=function(_0x10bcaf,_0x2e3347){return db[_0x1ac3('0x2d')][_0x1ac3('0x49')](_0x10bcaf[_0x1ac3('0x4a')],{})[_0x1ac3('0x42')](respondWithResult(_0x2e3347,0xc9))['catch'](handleError(_0x2e3347,null));};exports['update']=function(_0xe8f33c,_0x249c2d){if(_0xe8f33c[_0x1ac3('0x4a')]['id']){delete _0xe8f33c['body']['id'];}delete _0xe8f33c['body']['duration'];delete _0xe8f33c[_0x1ac3('0x4a')][_0x1ac3('0x4b')];delete _0xe8f33c['body'][_0x1ac3('0x4c')];delete _0xe8f33c[_0x1ac3('0x4a')][_0x1ac3('0x4d')];return db[_0x1ac3('0x2d')]['find']({'where':{'id':_0xe8f33c['params']['id']}})[_0x1ac3('0x42')](handleEntityNotFound(_0x249c2d,null))[_0x1ac3('0x42')](saveUpdates(_0xe8f33c['body'],null))[_0x1ac3('0x42')](respondWithResult(_0x249c2d,null))['catch'](handleError(_0x249c2d,null));};exports['describe']=function(_0x2d628d,_0x220dd0){return db['ScreenRecording'][_0x1ac3('0x4e')]()['then'](respondWithResult(_0x220dd0,null))[_0x1ac3('0x46')](handleError(_0x220dd0,null));};exports[_0x1ac3('0x4f')]=function(_0x3586b9,_0x3a0320,_0x34ad43){var _0x40e9c7=require(_0x1ac3('0x50'));var _0x331374=![];var _0xeb7e49={};if(_0x3586b9[_0x1ac3('0x34')][_0x1ac3('0x2f')]&&_0x3586b9['query']['type']===_0x1ac3('0x51')){_0xeb7e49[_0x1ac3('0x51')]=_0x3586b9[_0x1ac3('0x47')]['id'];}else{_0xeb7e49['id']=_0x3586b9[_0x1ac3('0x47')]['id'];}return db[_0x1ac3('0x2d')][_0x1ac3('0x48')]({'where':_0xeb7e49,'attributes':['id',_0x1ac3('0x4d')],'raw':!![]})[_0x1ac3('0x42')](handleEntityNotFound(_0x3a0320,null))[_0x1ac3('0x42')](function(_0x3149f6){if(_0x3149f6){var _0x541bba=path[_0x1ac3('0x52')](config[_0x1ac3('0x53')],_0x1ac3('0x54'),_0x3149f6[_0x1ac3('0x4d')]);var _0x20c195=util['format'](_0x1ac3('0x55'),_0x541bba);if(fs[_0x1ac3('0x56')](_0x20c195)){_0x331374=!![];return _0x40e9c7['decryptFile'](_0x20c195,_0x541bba,config['secrets']['recording'])[_0x1ac3('0x42')](function(){return _0x3149f6;});}return _0x3149f6;}})[_0x1ac3('0x42')](function(_0x2a1f66){if(_0x2a1f66){var _0x5ad546=path[_0x1ac3('0x52')](config['root'],'server/files/screen_recordings',_0x2a1f66['value']);if(!fs['existsSync'](_0x5ad546)){throw new db[(_0x1ac3('0x57'))][(_0x1ac3('0x58'))](_0x1ac3('0x59'));}if(_0x2a1f66[_0x1ac3('0x5a')]){return _0x3a0320[_0x1ac3('0x4f')](_0x5ad546,_0x2a1f66['filename']+path[_0x1ac3('0x5b')](_0x5ad546),function(){if(_0x331374){fs[_0x1ac3('0x5c')](_0x5ad546);}});}else{return _0x3a0320['download'](_0x5ad546,function(_0x2bcb4b){if(_0x331374){fs[_0x1ac3('0x5c')](_0x5ad546);}});}}})[_0x1ac3('0x46')](function(_0x2e79b2){if(_0x2e79b2[_0x1ac3('0x5d')]==='ScreenRecording\x20not\x20found'){_0x3a0320[_0x1ac3('0x1b')](0x194)[_0x1ac3('0x2a')](_0x1ac3('0x5e'));}else{return handleError(_0x3a0320,null);}});};exports[_0x1ac3('0x27')]=function(_0x4cfa04,_0x19407a){return db[_0x1ac3('0x2d')][_0x1ac3('0x48')]({'where':{'id':_0x4cfa04[_0x1ac3('0x47')]['id']}})[_0x1ac3('0x42')](function(_0x1ac283){if(_['isNil'](_0x1ac283)){throw new ReferenceError('Entity\x20not\x20found');}return _0x1ac283;})['then'](function(_0x582fe2){var _0x3b930b=path['join'](config[_0x1ac3('0x53')],_0x1ac3('0x54'),_0x582fe2[_0x1ac3('0x4d')]);logger[_0x1ac3('0x5f')](_0x1ac3('0x60'),_0x3b930b);if(!_[_0x1ac3('0x61')](_0x582fe2['value'])&&fs[_0x1ac3('0x56')](_0x3b930b)){logger[_0x1ac3('0x5f')](_0x1ac3('0x62')+_0x3b930b+_0x1ac3('0x63'));fs['unlinkSync'](_0x3b930b);}_0x3b930b=_0x3b930b+_0x1ac3('0x64');if(!_[_0x1ac3('0x61')](_0x582fe2[_0x1ac3('0x4d')])&&fs[_0x1ac3('0x56')](_0x3b930b)){logger[_0x1ac3('0x5f')]('File:\x20\x22'+_0x3b930b+_0x1ac3('0x63'));fs['unlinkSync'](_0x3b930b);}return _0x582fe2;})['then'](function(_0x402507){if(!_0x402507)throw new InternalError();return _0x402507[_0x1ac3('0x27')]();})[_0x1ac3('0x42')](function(){_0x19407a[_0x1ac3('0x1b')](0xcc)[_0x1ac3('0x1c')]();})[_0x1ac3('0x46')](handleError(_0x19407a,null));}; \ No newline at end of file +var _0xac9d=['extname','unlink','send','Not\x20found','isNil','Entity\x20not\x20found','root','info','unlinkSync','.cypher','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','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/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','length','find','create','body','closedAt','value','describe','download','../../components/encryptor','uniqueid','params','join','server/files/screen_recordings','%s.cypher','existsSync','recording','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename'];(function(_0x44b703,_0x2f7896){var _0xc07751=function(_0x32d176){while(--_0x32d176){_0x44b703['push'](_0x44b703['shift']());}};_0xc07751(++_0x2f7896);}(_0xac9d,0x14d));var _0xdac9=function(_0x2b1551,_0x1776fe){_0x2b1551=_0x2b1551-0x0;var _0x2fc2a1=_0xac9d[_0x2b1551];return _0x2fc2a1;};'use strict';var emlformat=require(_0xdac9('0x0'));var rimraf=require(_0xdac9('0x1'));var zipdir=require(_0xdac9('0x2'));var jsonpatch=require(_0xdac9('0x3'));var rp=require(_0xdac9('0x4'));var moment=require(_0xdac9('0x5'));var BPromise=require(_0xdac9('0x6'));var Mustache=require(_0xdac9('0x7'));var util=require('util');var path=require(_0xdac9('0x8'));var sox=require('sox');var csv=require(_0xdac9('0x9'));var ejs=require(_0xdac9('0xa'));var fs=require('fs');var fs_extra=require(_0xdac9('0xb'));var _=require(_0xdac9('0xc'));var squel=require(_0xdac9('0xd'));var crypto=require(_0xdac9('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xdac9('0xf'));var toCsv=require('to-csv');var querystring=require(_0xdac9('0x10'));var Papa=require(_0xdac9('0x11'));var Redis=require(_0xdac9('0x12'));var authService=require(_0xdac9('0x13'));var qs=require(_0xdac9('0x14'));var as=require(_0xdac9('0x15'));var hardwareService=require(_0xdac9('0x16'));var logger=require(_0xdac9('0x17'))(_0xdac9('0x18'));var utils=require('../../config/utils');var config=require(_0xdac9('0x19'));var licenseUtil=require(_0xdac9('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d8e97,_0xeddbc1){_0xeddbc1=_0xeddbc1||0xcc;return function(_0xbfe6d8){if(_0xbfe6d8){return _0x3d8e97['sendStatus'](_0xeddbc1);}return _0x3d8e97[_0xdac9('0x1b')](_0xeddbc1)[_0xdac9('0x1c')]();};}function respondWithResult(_0x9e1bf6,_0x5f0bbd){_0x5f0bbd=_0x5f0bbd||0xc8;return function(_0x5dd536){if(_0x5dd536){return _0x9e1bf6[_0xdac9('0x1b')](_0x5f0bbd)[_0xdac9('0x1d')](_0x5dd536);}};}function respondWithFilteredResult(_0x50f9fe,_0x76af7a){return function(_0x36cbe4){if(_0x36cbe4){var _0x152ea5=typeof _0x76af7a[_0xdac9('0x1e')]===_0xdac9('0x1f')&&typeof _0x76af7a[_0xdac9('0x20')]===_0xdac9('0x1f');var _0xec1016=_0x36cbe4['count'];var _0x283343=_0x152ea5?0x0:_0x76af7a[_0xdac9('0x1e')];var _0x571e07=_0x152ea5?_0x36cbe4[_0xdac9('0x21')]:_0x76af7a[_0xdac9('0x1e')]+_0x76af7a[_0xdac9('0x20')];var _0x181d11;if(_0x571e07>=_0xec1016){_0x571e07=_0xec1016;_0x181d11=0xc8;}else{_0x181d11=0xce;}_0x50f9fe['status'](_0x181d11);return _0x50f9fe['set'](_0xdac9('0x22'),_0x283343+'-'+_0x571e07+'/'+_0xec1016)[_0xdac9('0x1d')](_0x36cbe4);}return null;};}function patchUpdates(_0x2b9d91){return function(_0x395ec7){try{jsonpatch['apply'](_0x395ec7,_0x2b9d91,!![]);}catch(_0x23ee5e){return BPromise[_0xdac9('0x23')](_0x23ee5e);}return _0x395ec7[_0xdac9('0x24')]();};}function saveUpdates(_0xae680a,_0xe7bd10){return function(_0x42317c){if(_0x42317c){return _0x42317c[_0xdac9('0x25')](_0xae680a)[_0xdac9('0x26')](function(_0x419f0c){return _0x419f0c;});}return null;};}function removeEntity(_0x33de5c,_0x5a0fa2){return function(_0x2943f5){if(_0x2943f5){return _0x2943f5[_0xdac9('0x27')]()[_0xdac9('0x26')](function(){_0x33de5c[_0xdac9('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e631a,_0x5686db){return function(_0x3ce475){if(!_0x3ce475){_0x1e631a[_0xdac9('0x28')](0x194);}return _0x3ce475;};}function handleError(_0x566d8c,_0x433be9){_0x433be9=_0x433be9||0x1f4;return function(_0x5105f1){logger[_0xdac9('0x29')](_0x5105f1[_0xdac9('0x2a')]);if(_0x5105f1[_0xdac9('0x2b')]){delete _0x5105f1[_0xdac9('0x2b')];}_0x566d8c['status'](_0x433be9)['send'](_0x5105f1);};}exports[_0xdac9('0x2c')]=function(_0x170afd,_0x4fe3bd){var _0x4c4e21={},_0x3eed7a={},_0x3505c5={'count':0x0,'rows':[]};var _0x13efba=_[_0xdac9('0x2d')](db[_0xdac9('0x2e')][_0xdac9('0x2f')],function(_0xed99f9){return{'name':_0xed99f9[_0xdac9('0x30')],'type':_0xed99f9[_0xdac9('0x31')][_0xdac9('0x32')]};});_0x3eed7a[_0xdac9('0x33')]=_[_0xdac9('0x34')](_[_0xdac9('0x2d')](_0x13efba,_0xdac9('0x2b')),[_0xdac9('0x35')]);_0x3eed7a[_0xdac9('0x36')]=_[_0xdac9('0x37')](_0x170afd[_0xdac9('0x36')]);_0x3eed7a[_0xdac9('0x38')]=_[_0xdac9('0x39')](_0x3eed7a[_0xdac9('0x33')],_0x3eed7a['query']);_0x4c4e21['attributes']=_[_0xdac9('0x39')](_0x3eed7a[_0xdac9('0x33')],qs[_0xdac9('0x3a')](_0x170afd[_0xdac9('0x36')][_0xdac9('0x3a')]));_0x4c4e21['attributes']=_0x4c4e21[_0xdac9('0x3b')]['length']?_0x4c4e21[_0xdac9('0x3b')]:_0x3eed7a[_0xdac9('0x33')];if(!_0x170afd['query'][_0xdac9('0x3c')]('nolimit')){_0x4c4e21['limit']=qs[_0xdac9('0x20')](_0x170afd[_0xdac9('0x36')][_0xdac9('0x20')]);_0x4c4e21[_0xdac9('0x1e')]=qs[_0xdac9('0x1e')](_0x170afd[_0xdac9('0x36')]['offset']);}_0x4c4e21[_0xdac9('0x3d')]=qs[_0xdac9('0x3e')](_0x170afd['query'][_0xdac9('0x3e')]);_0x4c4e21[_0xdac9('0x3f')]=qs[_0xdac9('0x38')](_[_0xdac9('0x40')](_0x170afd[_0xdac9('0x36')],_0x3eed7a[_0xdac9('0x38')]),_0x13efba);if(_0x170afd[_0xdac9('0x36')]['filter']){_0x4c4e21[_0xdac9('0x3f')]=_[_0xdac9('0x41')](_0x4c4e21[_0xdac9('0x3f')],{'$or':_['map'](_0x13efba,function(_0x9c732e){if(_0x9c732e[_0xdac9('0x31')]!==_0xdac9('0x42')){var _0x1d6f88={};_0x1d6f88[_0x9c732e['name']]={'$like':'%'+_0x170afd['query'][_0xdac9('0x43')]+'%'};return _0x1d6f88;}})});}_0x4c4e21=_[_0xdac9('0x41')]({},_0x4c4e21,_0x170afd[_0xdac9('0x44')]);var _0x260f0e={'where':_0x4c4e21[_0xdac9('0x3f')]};return db['ScreenRecording'][_0xdac9('0x21')](_0x260f0e)['then'](function(_0xd74baf){_0x3505c5[_0xdac9('0x21')]=_0xd74baf;if(_0x170afd[_0xdac9('0x36')][_0xdac9('0x45')]){_0x4c4e21[_0xdac9('0x46')]=[{'all':!![]}];}return db[_0xdac9('0x2e')][_0xdac9('0x47')](_0x4c4e21);})[_0xdac9('0x26')](function(_0x11362d){_0x3505c5[_0xdac9('0x48')]=_0x11362d;return _0x3505c5;})[_0xdac9('0x26')](respondWithFilteredResult(_0x4fe3bd,_0x4c4e21))[_0xdac9('0x49')](handleError(_0x4fe3bd,null));};exports[_0xdac9('0x4a')]=function(_0x441676,_0x5335ae){var _0x3857cf={'raw':![],'where':{'id':_0x441676['params']['id']}},_0x272b52={};_0x272b52[_0xdac9('0x33')]=_[_0xdac9('0x37')](db[_0xdac9('0x2e')][_0xdac9('0x2f')]);_0x272b52[_0xdac9('0x36')]=_[_0xdac9('0x37')](_0x441676['query']);_0x272b52[_0xdac9('0x38')]=_['intersection'](_0x272b52[_0xdac9('0x33')],_0x272b52[_0xdac9('0x36')]);_0x3857cf[_0xdac9('0x3b')]=_[_0xdac9('0x39')](_0x272b52['model'],qs['fields'](_0x441676['query'][_0xdac9('0x3a')]));_0x3857cf['attributes']=_0x3857cf['attributes'][_0xdac9('0x4b')]?_0x3857cf[_0xdac9('0x3b')]:_0x272b52['model'];if(_0x441676['query'][_0xdac9('0x45')]){_0x3857cf[_0xdac9('0x46')]=[{'all':!![]}];}_0x3857cf=_[_0xdac9('0x41')]({},_0x3857cf,_0x441676[_0xdac9('0x44')]);return db[_0xdac9('0x2e')][_0xdac9('0x4c')](_0x3857cf)[_0xdac9('0x26')](handleEntityNotFound(_0x5335ae,null))[_0xdac9('0x26')](respondWithResult(_0x5335ae,null))['catch'](handleError(_0x5335ae,null));};exports[_0xdac9('0x4d')]=function(_0x3bd946,_0xfa104f){return db[_0xdac9('0x2e')][_0xdac9('0x4d')](_0x3bd946[_0xdac9('0x4e')],{})[_0xdac9('0x26')](respondWithResult(_0xfa104f,0xc9))[_0xdac9('0x49')](handleError(_0xfa104f,null));};exports[_0xdac9('0x25')]=function(_0x242c24,_0x257e48){if(_0x242c24[_0xdac9('0x4e')]['id']){delete _0x242c24[_0xdac9('0x4e')]['id'];}delete _0x242c24[_0xdac9('0x4e')]['duration'];delete _0x242c24['body']['createdAt'];delete _0x242c24[_0xdac9('0x4e')][_0xdac9('0x4f')];delete _0x242c24['body'][_0xdac9('0x50')];return db[_0xdac9('0x2e')][_0xdac9('0x4c')]({'where':{'id':_0x242c24['params']['id']}})[_0xdac9('0x26')](handleEntityNotFound(_0x257e48,null))[_0xdac9('0x26')](saveUpdates(_0x242c24['body'],null))['then'](respondWithResult(_0x257e48,null))[_0xdac9('0x49')](handleError(_0x257e48,null));};exports[_0xdac9('0x51')]=function(_0x222de9,_0x370532){return db[_0xdac9('0x2e')][_0xdac9('0x51')]()[_0xdac9('0x26')](respondWithResult(_0x370532,null))[_0xdac9('0x49')](handleError(_0x370532,null));};exports[_0xdac9('0x52')]=function(_0x41579a,_0x10a2cc,_0x32b5f5){var _0xecb50a=require(_0xdac9('0x53'));var _0x35a378=![];var _0x5d0b43={};if(_0x41579a[_0xdac9('0x36')][_0xdac9('0x31')]&&_0x41579a[_0xdac9('0x36')][_0xdac9('0x31')]===_0xdac9('0x54')){_0x5d0b43[_0xdac9('0x54')]=_0x41579a['params']['id'];}else{_0x5d0b43['id']=_0x41579a[_0xdac9('0x55')]['id'];}return db[_0xdac9('0x2e')][_0xdac9('0x4c')]({'where':_0x5d0b43,'attributes':['id',_0xdac9('0x50')],'raw':!![]})[_0xdac9('0x26')](handleEntityNotFound(_0x10a2cc,null))[_0xdac9('0x26')](function(_0x1eec39){if(_0x1eec39){var _0x243862=path[_0xdac9('0x56')](config['root'],_0xdac9('0x57'),_0x1eec39[_0xdac9('0x50')]);var _0x3cab26=util[_0xdac9('0x35')](_0xdac9('0x58'),_0x243862);if(fs[_0xdac9('0x59')](_0x3cab26)){_0x35a378=!![];return _0xecb50a['decryptFile'](_0x3cab26,_0x243862,config['secrets'][_0xdac9('0x5a')])[_0xdac9('0x26')](function(){return _0x1eec39;});}return _0x1eec39;}})[_0xdac9('0x26')](function(_0x46017d){if(_0x46017d){var _0x1c1f5f=path[_0xdac9('0x56')](config['root'],'server/files/screen_recordings',_0x46017d['value']);if(!fs[_0xdac9('0x59')](_0x1c1f5f)){throw new db[(_0xdac9('0x5b'))][(_0xdac9('0x5c'))](_0xdac9('0x5d'));}if(_0x46017d['filename']){return _0x10a2cc[_0xdac9('0x52')](_0x1c1f5f,_0x46017d[_0xdac9('0x5e')]+path[_0xdac9('0x5f')](_0x1c1f5f),function(){if(_0x35a378){fs[_0xdac9('0x60')](_0x1c1f5f);}});}else{return _0x10a2cc[_0xdac9('0x52')](_0x1c1f5f,function(_0x496d9c){if(_0x35a378){fs[_0xdac9('0x60')](_0x1c1f5f);}});}}})['catch'](function(_0x60b64e){if(_0x60b64e['message']===_0xdac9('0x5d')){_0x10a2cc[_0xdac9('0x1b')](0x194)[_0xdac9('0x61')](_0xdac9('0x62'));}else{return handleError(_0x10a2cc,null);}});};exports[_0xdac9('0x27')]=function(_0x40dec7,_0x232440){return db['ScreenRecording']['find']({'where':{'id':_0x40dec7['params']['id']}})[_0xdac9('0x26')](function(_0x42ba53){if(_[_0xdac9('0x63')](_0x42ba53)){throw new ReferenceError(_0xdac9('0x64'));}return _0x42ba53;})[_0xdac9('0x26')](function(_0x29df1d){var _0x288e7e=path['join'](config[_0xdac9('0x65')],'server/files/screen_recordings',_0x29df1d['value']);logger[_0xdac9('0x66')]('cancellazione\x20fisica\x20documento\x20%s',_0x288e7e);if(!_['isNil'](_0x29df1d[_0xdac9('0x50')])&&fs[_0xdac9('0x59')](_0x288e7e)){logger[_0xdac9('0x66')]('File:\x20\x22'+_0x288e7e+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xdac9('0x67')](_0x288e7e);}_0x288e7e=_0x288e7e+_0xdac9('0x68');if(!_['isNil'](_0x29df1d[_0xdac9('0x50')])&&fs[_0xdac9('0x59')](_0x288e7e)){logger[_0xdac9('0x66')](_0xdac9('0x69')+_0x288e7e+_0xdac9('0x6a'));fs[_0xdac9('0x67')](_0x288e7e);}return _0x29df1d;})[_0xdac9('0x26')](function(_0xef4531){if(!_0xef4531)throw new InternalError();return _0xef4531[_0xdac9('0x27')]();})[_0xdac9('0x26')](function(){_0x232440[_0xdac9('0x1b')](0xcc)[_0xdac9('0x1c')]();})['catch'](handleError(_0x232440,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 947a8bf..2dfa927 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 _0x7258=['ScreenRecording','screen_recordings','interactionid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./screenRecording.attributes','exports','define'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x7258,0xb7));var _0x8725=function(_0x2dc7be,_0xbf934d){_0x2dc7be=_0x2dc7be-0x0;var _0x8751ef=_0x7258[_0x2dc7be];return _0x8751ef;};'use strict';var _=require(_0x8725('0x0'));var util=require(_0x8725('0x1'));var logger=require(_0x8725('0x2'))(_0x8725('0x3'));var moment=require(_0x8725('0x4'));var BPromise=require(_0x8725('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8725('0x6'));var rimraf=require(_0x8725('0x7'));var config=require(_0x8725('0x8'));var attributes=require(_0x8725('0x9'));module[_0x8725('0xa')]=function(_0x352299,_0x5d5f1f){return _0x352299[_0x8725('0xb')](_0x8725('0xc'),attributes,{'tableName':_0x8725('0xd'),'paranoid':![],'indexes':[{'name':_0x8725('0xe'),'fields':[_0x8725('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xaa8c=['interactionid','lodash','../../config/logger','moment','bluebird','request-promise','../../config/environment','./screenRecording.attributes','exports','define','screen_recordings'];(function(_0x448646,_0x1ca29a){var _0x33cbf5=function(_0x226423){while(--_0x226423){_0x448646['push'](_0x448646['shift']());}};_0x33cbf5(++_0x1ca29a);}(_0xaa8c,0x161));var _0xcaa8=function(_0x3a723e,_0x59d99a){_0x3a723e=_0x3a723e-0x0;var _0x3e9c03=_0xaa8c[_0x3a723e];return _0x3e9c03;};'use strict';var _=require(_0xcaa8('0x0'));var util=require('util');var logger=require(_0xcaa8('0x1'))('api');var moment=require(_0xcaa8('0x2'));var BPromise=require(_0xcaa8('0x3'));var rp=require(_0xcaa8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xcaa8('0x5'));var attributes=require(_0xcaa8('0x6'));module[_0xcaa8('0x7')]=function(_0x217fe1,_0x201ffc){return _0x217fe1[_0xcaa8('0x8')]('ScreenRecording',attributes,{'tableName':_0xcaa8('0x9'),'paranoid':![],'indexes':[{'name':_0xcaa8('0xa'),'fields':[_0xcaa8('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 94917cd..ae4da24 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 _0x335c=['info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x335c,0xe7));var _0xc335=function(_0x3b610c,_0x1f0eee){_0x3b610c=_0x3b610c-0x0;var _0x465e46=_0x335c[_0x3b610c];return _0x465e46;};'use strict';var _=require(_0xc335('0x0'));var util=require(_0xc335('0x1'));var moment=require(_0xc335('0x2'));var BPromise=require(_0xc335('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc335('0x4'));var db=require(_0xc335('0x5'))['db'];var utils=require(_0xc335('0x6'));var logger=require('../../config/logger')(_0xc335('0x7'));var config=require(_0xc335('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc335('0x9')][_0xc335('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5219cf,_0x5e2cfd,_0x734dfa){return new BPromise(function(_0x587511,_0x1413be){return client['request'](_0x5219cf,_0x734dfa)['then'](function(_0x24cae6){logger[_0xc335('0xb')](_0xc335('0xc'),_0x5e2cfd,_0xc335('0xd'));logger[_0xc335('0xe')](_0xc335('0xf'),_0x5e2cfd,'request\x20sent',JSON[_0xc335('0x10')](_0x24cae6));if(_0x24cae6[_0xc335('0x11')]){if(_0x24cae6[_0xc335('0x11')][_0xc335('0x12')]===0x1f4){logger[_0xc335('0x11')](_0xc335('0xc'),_0x5e2cfd,_0x24cae6[_0xc335('0x11')][_0xc335('0x13')]);return _0x1413be(_0x24cae6[_0xc335('0x11')][_0xc335('0x13')]);}logger[_0xc335('0x11')](_0xc335('0xc'),_0x5e2cfd,_0x24cae6[_0xc335('0x11')][_0xc335('0x13')]);return _0x587511(_0x24cae6[_0xc335('0x11')][_0xc335('0x13')]);}else{logger[_0xc335('0xb')](_0xc335('0xc'),_0x5e2cfd,'request\x20sent');_0x587511(_0x24cae6[_0xc335('0x14')]['message']);}})[_0xc335('0x15')](function(_0x329434){logger[_0xc335('0x11')](_0xc335('0xc'),_0x5e2cfd,_0x329434);_0x1413be(_0x329434);});});} \ No newline at end of file +var _0x56e7=['info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0x407de4,_0x39b031){var _0x49b3a5=function(_0x10ea52){while(--_0x10ea52){_0x407de4['push'](_0x407de4['shift']());}};_0x49b3a5(++_0x39b031);}(_0x56e7,0x1bf));var _0x756e=function(_0x127796,_0xd2a09b){_0x127796=_0x127796-0x0;var _0x2113eb=_0x56e7[_0x127796];return _0x2113eb;};'use strict';var _=require(_0x756e('0x0'));var util=require(_0x756e('0x1'));var moment=require(_0x756e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x756e('0x3'));var db=require(_0x756e('0x4'))['db'];var utils=require(_0x756e('0x5'));var logger=require(_0x756e('0x6'))(_0x756e('0x7'));var config=require(_0x756e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x756e('0x9')][_0x756e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xfac25a,_0x1ef2ab,_0x7cecad){return new BPromise(function(_0x246ed8,_0xcf3f3f){return client[_0x756e('0xb')](_0xfac25a,_0x7cecad)[_0x756e('0xc')](function(_0x498175){logger[_0x756e('0xd')](_0x756e('0xe'),_0x1ef2ab,_0x756e('0xf'));logger[_0x756e('0x10')](_0x756e('0x11'),_0x1ef2ab,_0x756e('0xf'),JSON['stringify'](_0x498175));if(_0x498175[_0x756e('0x12')]){if(_0x498175[_0x756e('0x12')][_0x756e('0x13')]===0x1f4){logger[_0x756e('0x12')]('ScreenRecording,\x20%s,\x20%s',_0x1ef2ab,_0x498175[_0x756e('0x12')][_0x756e('0x14')]);return _0xcf3f3f(_0x498175[_0x756e('0x12')]['message']);}logger[_0x756e('0x12')]('ScreenRecording,\x20%s,\x20%s',_0x1ef2ab,_0x498175[_0x756e('0x12')][_0x756e('0x14')]);return _0x246ed8(_0x498175[_0x756e('0x12')]['message']);}else{logger['info'](_0x756e('0xe'),_0x1ef2ab,_0x756e('0xf'));_0x246ed8(_0x498175[_0x756e('0x15')][_0x756e('0x14')]);}})[_0x756e('0x16')](function(_0x2cbf37){logger[_0x756e('0x12')](_0x756e('0xe'),_0x1ef2ab,_0x2cbf37);_0xcf3f3f(_0x2cbf37);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index aa591be..83cd2da 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 _0x9850=['util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./setting.controller','index','get','/now','getDate','/:id','show','getLogo','/:id/logo_login','getLogoLogin','gdpr','/:id/preferred','getPreferred','/:id/favicon','diskStorage','join','root','server/files/images/logos/','format','logo','originalname','/:id/logo','single','file','%s%s','logologin','extname','post','addLogoLogin','favicon','isAuthenticated','exports','multer'];(function(_0x5896f3,_0x2ac402){var _0x12aa8d=function(_0x50f2cc){while(--_0x50f2cc){_0x5896f3['push'](_0x5896f3['shift']());}};_0x12aa8d(++_0x2ac402);}(_0x9850,0x167));var _0x0985=function(_0x2639ad,_0xf32550){_0x2639ad=_0x2639ad-0x0;var _0x40c3d1=_0x9850[_0x2639ad];return _0x40c3d1;};'use strict';var multer=require(_0x0985('0x0'));var util=require(_0x0985('0x1'));var path=require('path');var timeout=require(_0x0985('0x2'));var express=require(_0x0985('0x3'));var router=express[_0x0985('0x4')]();var fs_extra=require(_0x0985('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0985('0x6'));var config=require(_0x0985('0x7'));var controller=require(_0x0985('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x0985('0x9')]);router[_0x0985('0xa')](_0x0985('0xb'),controller[_0x0985('0xc')]);router['get'](_0x0985('0xd'),controller[_0x0985('0xe')]);router[_0x0985('0xa')]('/:id/logo',controller[_0x0985('0xf')]);router[_0x0985('0xa')](_0x0985('0x10'),controller[_0x0985('0x11')]);router['get']('/:id/gdpr',controller[_0x0985('0x12')]);router[_0x0985('0xa')](_0x0985('0x13'),controller[_0x0985('0x14')]);router['get'](_0x0985('0x15'),controller['getFavicon']);var upload=multer({'storage':multer[_0x0985('0x16')]({'destination':function(_0x4d40f3,_0xbe943f,_0x350a74){_0x350a74(null,path[_0x0985('0x17')](config[_0x0985('0x18')],_0x0985('0x19')));},'filename':function(_0x85f9bf,_0x4e0907,_0x3916fa){_0x3916fa(null,util[_0x0985('0x1a')]('%s%s',_0x0985('0x1b'),path['extname'](_0x4e0907[_0x0985('0x1c')])));}})});router['post'](_0x0985('0x1d'),upload[_0x0985('0x1e')](_0x0985('0x1f')),controller['addLogo']);var upload=multer({'storage':multer[_0x0985('0x16')]({'destination':function(_0x392f11,_0x2fe9e2,_0x52a558){_0x52a558(null,path[_0x0985('0x17')](config[_0x0985('0x18')],_0x0985('0x19')));},'filename':function(_0x317407,_0x44787f,_0xc66e36){_0xc66e36(null,util[_0x0985('0x1a')](_0x0985('0x20'),_0x0985('0x21'),path[_0x0985('0x22')](_0x44787f[_0x0985('0x1c')])));}})});router[_0x0985('0x23')](_0x0985('0x10'),upload['single'](_0x0985('0x1f')),controller[_0x0985('0x24')]);var upload=multer({'storage':multer[_0x0985('0x16')]({'destination':function(_0x3f1f0b,_0x5d8958,_0x3d7e9c){_0x3d7e9c(null,path[_0x0985('0x17')](config[_0x0985('0x18')],'server/files/images/logos/'));},'filename':function(_0x27491d,_0x1d5dca,_0x560cee){_0x560cee(null,util[_0x0985('0x1a')]('%s%s','preferred',path[_0x0985('0x22')](_0x1d5dca[_0x0985('0x1c')])));}})});router[_0x0985('0x23')](_0x0985('0x13'),upload['single']('file'),controller['addPreferred']);var upload=multer({'storage':multer[_0x0985('0x16')]({'destination':function(_0x2f7bc7,_0x3fce62,_0x39ceff){_0x39ceff(null,path[_0x0985('0x17')](config[_0x0985('0x18')],_0x0985('0x19')));},'filename':function(_0xa8e9b5,_0x3a34bf,_0x52bf13){_0x52bf13(null,util[_0x0985('0x1a')](_0x0985('0x20'),_0x0985('0x25'),path[_0x0985('0x22')](_0x3a34bf[_0x0985('0x1c')])));}})});router[_0x0985('0x23')](_0x0985('0x15'),upload[_0x0985('0x1e')]('file'),controller['addFavicon']);router['put']('/:id',auth[_0x0985('0x26')](),controller['update']);module[_0x0985('0x27')]=router; \ No newline at end of file +var _0x3838=['put','update','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','getDate','/:id','show','/:id/logo','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','server/files/images/logos/','format','%s%s','logo','extname','originalname','post','single','file','addLogo','root','logologin','/:id/logo_login','addLogoLogin','favicon','addFavicon'];(function(_0x356c72,_0x45f9c2){var _0x2bf4cf=function(_0xf4cfed){while(--_0xf4cfed){_0x356c72['push'](_0x356c72['shift']());}};_0x2bf4cf(++_0x45f9c2);}(_0x3838,0x18f));var _0x8383=function(_0x474a1d,_0x12c44c){_0x474a1d=_0x474a1d-0x0;var _0x4071bd=_0x3838[_0x474a1d];return _0x4071bd;};'use strict';var multer=require(_0x8383('0x0'));var util=require('util');var path=require(_0x8383('0x1'));var timeout=require('connect-timeout');var express=require(_0x8383('0x2'));var router=express[_0x8383('0x3')]();var fs_extra=require(_0x8383('0x4'));var auth=require(_0x8383('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8383('0x6'));var controller=require(_0x8383('0x7'));router[_0x8383('0x8')]('/',auth[_0x8383('0x9')](),controller[_0x8383('0xa')]);router['get'](_0x8383('0xb'),controller[_0x8383('0xc')]);router[_0x8383('0x8')](_0x8383('0xd'),controller[_0x8383('0xe')]);router[_0x8383('0x8')](_0x8383('0xf'),controller['getLogo']);router[_0x8383('0x8')]('/:id/logo_login',controller[_0x8383('0x10')]);router['get'](_0x8383('0x11'),controller[_0x8383('0x12')]);router[_0x8383('0x8')](_0x8383('0x13'),controller[_0x8383('0x14')]);router[_0x8383('0x8')](_0x8383('0x15'),controller[_0x8383('0x16')]);var upload=multer({'storage':multer[_0x8383('0x17')]({'destination':function(_0x2831a7,_0x6d763e,_0x3dffc3){_0x3dffc3(null,path[_0x8383('0x18')](config['root'],_0x8383('0x19')));},'filename':function(_0x1da4ab,_0x3b57d8,_0xcd6d08){_0xcd6d08(null,util[_0x8383('0x1a')](_0x8383('0x1b'),_0x8383('0x1c'),path[_0x8383('0x1d')](_0x3b57d8[_0x8383('0x1e')])));}})});router[_0x8383('0x1f')](_0x8383('0xf'),upload[_0x8383('0x20')](_0x8383('0x21')),controller[_0x8383('0x22')]);var upload=multer({'storage':multer[_0x8383('0x17')]({'destination':function(_0x64277e,_0x3e8271,_0x3f19ec){_0x3f19ec(null,path['join'](config[_0x8383('0x23')],_0x8383('0x19')));},'filename':function(_0x372b1b,_0x86ffd0,_0xe9200e){_0xe9200e(null,util[_0x8383('0x1a')]('%s%s',_0x8383('0x24'),path[_0x8383('0x1d')](_0x86ffd0[_0x8383('0x1e')])));}})});router[_0x8383('0x1f')](_0x8383('0x25'),upload[_0x8383('0x20')](_0x8383('0x21')),controller[_0x8383('0x26')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x35cd14,_0x1e4a91,_0xa174c8){_0xa174c8(null,path['join'](config[_0x8383('0x23')],_0x8383('0x19')));},'filename':function(_0x4b209b,_0x5b3fef,_0x349279){_0x349279(null,util['format'](_0x8383('0x1b'),'preferred',path[_0x8383('0x1d')](_0x5b3fef[_0x8383('0x1e')])));}})});router['post']('/:id/preferred',upload['single'](_0x8383('0x21')),controller['addPreferred']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1c76c8,_0x30a608,_0x550914){_0x550914(null,path['join'](config[_0x8383('0x23')],_0x8383('0x19')));},'filename':function(_0x54195f,_0x3b94e9,_0x11fa94){_0x11fa94(null,util['format'](_0x8383('0x1b'),_0x8383('0x27'),path[_0x8383('0x1d')](_0x3b94e9[_0x8383('0x1e')])));}})});router[_0x8383('0x1f')]('/:id/favicon',upload[_0x8383('0x20')]('file'),controller[_0x8383('0x28')]);router[_0x8383('0x29')]('/:id',auth[_0x8383('0x9')](),controller[_0x8383('0x2a')]);module[_0x8383('0x2b')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 8e688f1..b4a721c 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 _0x4efb=['exports','INTEGER','min_internal','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED'];(function(_0x549eee,_0x362edf){var _0x380255=function(_0x394466){while(--_0x394466){_0x549eee['push'](_0x549eee['shift']());}};_0x380255(++_0x362edf);}(_0x4efb,0xfa));var _0xb4ef=function(_0x87cdbd,_0x7a4388){_0x87cdbd=_0x87cdbd-0x0;var _0x4ed873=_0x4efb[_0x87cdbd];return _0x4ed873;};'use strict';var Sequelize=require('sequelize');module[_0xb4ef('0x0')]={'min_internal':{'type':Sequelize[_0xb4ef('0x1')](0xb),'unique':_0xb4ef('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0xb4ef('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xb4ef('0x4')],'defaultValue':_0xb4ef('0x5')},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize[_0xb4ef('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize[_0xb4ef('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xb4ef('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xb4ef('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xb4ef('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0xb4ef('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0xb4ef('0x4')]},'turnusername':{'type':Sequelize[_0xb4ef('0x4')]},'turnpassword':{'type':Sequelize[_0xb4ef('0x4')]},'pageTitle':{'type':Sequelize[_0xb4ef('0x4')]},'defaultPageTitle':{'type':Sequelize[_0xb4ef('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xb4ef('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xb4ef('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0xb4ef('0x7')},'enableEmailPreview':{'type':Sequelize[_0xb4ef('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0xb4ef('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xb4ef('0x1')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xb4ef('0x1')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xb4ef('0x4')],'defaultValue':_0xb4ef('0x8')},'chatTimeout':{'type':Sequelize[_0xb4ef('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xb4ef('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0xb4ef('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xb4ef('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0xb4ef('0x1')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xb4ef('0x1')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0xb4ef('0x4')]},'defaultFavicon':{'type':Sequelize[_0xb4ef('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0xb4ef('0x1')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0xb4ef('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0xb4ef('0x1')]},'transcribeRegion':{'type':Sequelize[_0xb4ef('0x4')]},'sentiment':{'type':Sequelize[_0xb4ef('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xb4ef('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0xb4ef('0x1')]},'sentimentRegion':{'type':Sequelize[_0xb4ef('0x4')]},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0xb4ef('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0xb4ef('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xb4ef('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0xb4ef('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0xb4ef('0x1')](0x2)[_0xb4ef('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0xb4ef('0x1')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0xb4ef('0x1')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0xb4ef('0x1')](0x2)[_0xb4ef('0x9')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0xb4ef('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0xb4ef('0x1')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0xb4ef('0x1')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0xb4ef('0x1')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0xb4ef('0x1')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0xb4ef('0x1')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0xb4ef('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0xb4ef('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0xb4ef('0x1')],'defaultValue':0x5},'disabledCookie':{'type':Sequelize[_0xb4ef('0x6')],'defaultValue':![]},'limitTabs':{'type':Sequelize['INTEGER'],'defaultValue':0x14}}; \ No newline at end of file +var _0xa282=['min_internal','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','INTEGER','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','sequelize'];(function(_0x412818,_0xe8171a){var _0x2d40d1=function(_0xa3099a){while(--_0xa3099a){_0x412818['push'](_0x412818['shift']());}};_0x2d40d1(++_0xe8171a);}(_0xa282,0x1f3));var _0x2a28=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xa282[_0x5c2e3e];return _0x53f64a;};'use strict';var Sequelize=require(_0x2a28('0x0'));module['exports']={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':_0x2a28('0x1'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x2a28('0x2'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x2a28('0x3')],'defaultValue':_0x2a28('0x4')},'logo':{'type':Sequelize[_0x2a28('0x3')]},'defaultLogo':{'type':Sequelize[_0x2a28('0x5')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x2a28('0x3')]},'defaultLoginLogo':{'type':Sequelize[_0x2a28('0x5')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x2a28('0x3')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x2a28('0x5')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x2a28('0x5')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x2a28('0x5')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x2a28('0x3')]},'turnaddr':{'type':Sequelize[_0x2a28('0x3')]},'turnusername':{'type':Sequelize[_0x2a28('0x3')]},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x2a28('0x3')]},'defaultPageTitle':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x2a28('0x5')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x2a28('0x6')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x2a28('0x5')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x2a28('0x3')],'defaultValue':_0x2a28('0x7')},'enableEmailPreview':{'type':Sequelize[_0x2a28('0x5')],'defaultValue':![]},'split':{'type':Sequelize[_0x2a28('0x5')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x2a28('0x6')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x2a28('0x8')},'chatTimeout':{'type':Sequelize[_0x2a28('0x6')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x2a28('0x5')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x2a28('0x3')]},'defaultPreferred':{'type':Sequelize[_0x2a28('0x5')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize[_0x2a28('0x6')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x2a28('0x6')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0x2a28('0x5')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x2a28('0x6')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x2a28('0x6')]},'transcribeRegion':{'type':Sequelize[_0x2a28('0x3')]},'sentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x2a28('0x5')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x2a28('0x6')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x2a28('0x3')]},'bucket':{'type':Sequelize[_0x2a28('0x3')]},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x2a28('0x5')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x2a28('0x6')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x2a28('0x6')](0x2)[_0x2a28('0x9')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x2a28('0x6')](0x2)[_0x2a28('0x9')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x2a28('0x6')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x2a28('0x6')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x2a28('0x6')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x2a28('0x5')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x2a28('0x5')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x2a28('0x5')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x2a28('0x6')],'defaultValue':0x5},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize['INTEGER'],'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 bf13115..81752d7 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 _0x1e19=['end','json','offset','undefined','limit','count','set','apply','reject','update','destroy','stack','name','map','Setting','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filters','merge','VIRTUAL','options','include','findAll','rows','show','params','includeAll','find','body','file','filename','logo','addLogoLogin','../../config/license/util','getLogo','preferred','favicon','defaultLogo','defaultFavicon','existsSync','join','toLower','root','upperFirst','custom','default_logo.svg','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','server/files/images/logos','getLicense','loginLogo','defaultPreferred','default_loginLogo.svg','default','gdpr','securePassword','addPreferred','getPreferred','defaultLoginLogo','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','send','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status'];(function(_0x158608,_0x47cc7f){var _0x250a5e=function(_0x328eea){while(--_0x328eea){_0x158608['push'](_0x158608['shift']());}};_0x250a5e(++_0x47cc7f);}(_0x1e19,0x1c9));var _0x91e1=function(_0x40b0b7,_0xf53ae5){_0x40b0b7=_0x40b0b7-0x0;var _0x5dfb0b=_0x1e19[_0x40b0b7];return _0x5dfb0b;};'use strict';var emlformat=require(_0x91e1('0x0'));var rimraf=require(_0x91e1('0x1'));var zipdir=require(_0x91e1('0x2'));var jsonpatch=require(_0x91e1('0x3'));var rp=require(_0x91e1('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x91e1('0x5'));var sox=require(_0x91e1('0x6'));var csv=require(_0x91e1('0x7'));var ejs=require(_0x91e1('0x8'));var fs=require('fs');var fs_extra=require(_0x91e1('0x9'));var _=require('lodash');var squel=require(_0x91e1('0xa'));var crypto=require('crypto');var jsforce=require(_0x91e1('0xb'));var deskjs=require(_0x91e1('0xc'));var toCsv=require(_0x91e1('0x7'));var querystring=require(_0x91e1('0xd'));var Papa=require(_0x91e1('0xe'));var Redis=require('ioredis');var authService=require(_0x91e1('0xf'));var qs=require(_0x91e1('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x91e1('0x11'));var logger=require(_0x91e1('0x12'))(_0x91e1('0x13'));var utils=require(_0x91e1('0x14'));var config=require(_0x91e1('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require(_0x91e1('0x16'));var client=jayson[_0x91e1('0x17')][_0x91e1('0x18')]({'port':0x232a});function respondWithRpcPromise(_0xc8b555,_0xb0f9e0,_0x8e8cf7,_0x23da39){return new BPromise(function(_0x3fb2e4,_0x511333){var _0x16119d=_0x23da39||client;return _0x16119d[_0x91e1('0x19')](_0xc8b555,_0x8e8cf7)[_0x91e1('0x1a')](function(_0x1d0bca){logger[_0x91e1('0x1b')](_0x91e1('0x1c'),_0xb0f9e0,'request\x20sent');logger[_0x91e1('0x1d')]('Setting,\x20%s,\x20%s,\x20%s',_0xb0f9e0,_0x91e1('0x1e'),JSON[_0x91e1('0x1f')](_0x1d0bca));if(_0x1d0bca['error']){if(_0x1d0bca[_0x91e1('0x20')][_0x91e1('0x21')]===0x1f4){logger[_0x91e1('0x20')]('Setting,\x20%s,\x20%s',_0xb0f9e0,_0x1d0bca['error'][_0x91e1('0x22')]);return _0x511333(_0x1d0bca['error'][_0x91e1('0x22')]);}logger[_0x91e1('0x20')](_0x91e1('0x1c'),_0xb0f9e0,_0x1d0bca[_0x91e1('0x20')][_0x91e1('0x22')]);return _0x3fb2e4(_0x1d0bca[_0x91e1('0x20')][_0x91e1('0x22')]);}else{logger[_0x91e1('0x1b')](_0x91e1('0x1c'),_0xb0f9e0,_0x91e1('0x1e'));_0x3fb2e4(_0x1d0bca[_0x91e1('0x23')]['message']);}})[_0x91e1('0x24')](function(_0x3e39e3){logger[_0x91e1('0x20')]('Setting,\x20%s,\x20%s',_0xb0f9e0,_0x3e39e3);_0x511333(_0x3e39e3);});});}function respondWithStatusCode(_0x477d6c,_0xccc5ad){_0xccc5ad=_0xccc5ad||0xcc;return function(_0x3c7631){if(_0x3c7631){return _0x477d6c[_0x91e1('0x25')](_0xccc5ad);}return _0x477d6c[_0x91e1('0x26')](_0xccc5ad)[_0x91e1('0x27')]();};}function respondWithResult(_0x24a885,_0xe97618){_0xe97618=_0xe97618||0xc8;return function(_0xca52f1){if(_0xca52f1){return _0x24a885[_0x91e1('0x26')](_0xe97618)[_0x91e1('0x28')](_0xca52f1);}};}function respondWithFilteredResult(_0xaacfcd,_0x3dbb13){return function(_0xf3bbb8){if(_0xf3bbb8){var _0x17bebd=typeof _0x3dbb13[_0x91e1('0x29')]===_0x91e1('0x2a')&&typeof _0x3dbb13[_0x91e1('0x2b')]===_0x91e1('0x2a');var _0x178e6b=_0xf3bbb8['count'];var _0x19f84d=_0x17bebd?0x0:_0x3dbb13[_0x91e1('0x29')];var _0x5bae2b=_0x17bebd?_0xf3bbb8[_0x91e1('0x2c')]:_0x3dbb13['offset']+_0x3dbb13['limit'];var _0xb08207;if(_0x5bae2b>=_0x178e6b){_0x5bae2b=_0x178e6b;_0xb08207=0xc8;}else{_0xb08207=0xce;}_0xaacfcd[_0x91e1('0x26')](_0xb08207);return _0xaacfcd[_0x91e1('0x2d')]('Content-Range',_0x19f84d+'-'+_0x5bae2b+'/'+_0x178e6b)[_0x91e1('0x28')](_0xf3bbb8);}return null;};}function patchUpdates(_0xad968d){return function(_0x1237ab){try{jsonpatch[_0x91e1('0x2e')](_0x1237ab,_0xad968d,!![]);}catch(_0x1fe96a){return BPromise[_0x91e1('0x2f')](_0x1fe96a);}return _0x1237ab['save']();};}function saveUpdates(_0x598b6b,_0x8328d6){return function(_0x131a47){if(_0x131a47){return _0x131a47[_0x91e1('0x30')](_0x598b6b)[_0x91e1('0x1a')](function(_0x164312){return _0x164312;});}return null;};}function removeEntity(_0x545c94,_0x12e26f){return function(_0xdf6718){if(_0xdf6718){return _0xdf6718[_0x91e1('0x31')]()[_0x91e1('0x1a')](function(){_0x545c94[_0x91e1('0x26')](0xcc)[_0x91e1('0x27')]();});}};}function handleEntityNotFound(_0x7eb2cc,_0x3f969c){return function(_0x449df1){if(!_0x449df1){_0x7eb2cc[_0x91e1('0x25')](0x194);}return _0x449df1;};}function handleError(_0x10bd07,_0x48a6e0){_0x48a6e0=_0x48a6e0||0x1f4;return function(_0x1247c1){logger[_0x91e1('0x20')](_0x1247c1[_0x91e1('0x32')]);if(_0x1247c1[_0x91e1('0x33')]){delete _0x1247c1[_0x91e1('0x33')];}_0x10bd07['status'](_0x48a6e0)['send'](_0x1247c1);};}exports['index']=function(_0x294016,_0x1905e0){var _0x605a81={},_0x4eaa5c={},_0x5bfa14={'count':0x0,'rows':[]};var _0x2e3335=_[_0x91e1('0x34')](db[_0x91e1('0x35')][_0x91e1('0x36')],function(_0x389def){return{'name':_0x389def[_0x91e1('0x37')],'type':_0x389def[_0x91e1('0x38')][_0x91e1('0x39')]};});_0x4eaa5c[_0x91e1('0x3a')]=_['map'](_0x2e3335,_0x91e1('0x33'));_0x4eaa5c['query']=_[_0x91e1('0x3b')](_0x294016[_0x91e1('0x3c')]);_0x4eaa5c['filters']=_[_0x91e1('0x3d')](_0x4eaa5c[_0x91e1('0x3a')],_0x4eaa5c[_0x91e1('0x3c')]);_0x605a81['attributes']=_['intersection'](_0x4eaa5c[_0x91e1('0x3a')],qs['fields'](_0x294016[_0x91e1('0x3c')][_0x91e1('0x3e')]));_0x605a81[_0x91e1('0x3f')]=_0x605a81[_0x91e1('0x3f')][_0x91e1('0x40')]?_0x605a81[_0x91e1('0x3f')]:_0x4eaa5c['model'];if(!_0x294016[_0x91e1('0x3c')][_0x91e1('0x41')]('nolimit')){_0x605a81[_0x91e1('0x2b')]=qs[_0x91e1('0x2b')](_0x294016[_0x91e1('0x3c')]['limit']);_0x605a81[_0x91e1('0x29')]=qs['offset'](_0x294016[_0x91e1('0x3c')]['offset']);}_0x605a81['order']=qs[_0x91e1('0x42')](_0x294016[_0x91e1('0x3c')][_0x91e1('0x42')]);_0x605a81[_0x91e1('0x43')]=qs['filters'](_[_0x91e1('0x44')](_0x294016[_0x91e1('0x3c')],_0x4eaa5c[_0x91e1('0x45')]),_0x2e3335);if(_0x294016['query']['filter']){_0x605a81[_0x91e1('0x43')]=_[_0x91e1('0x46')](_0x605a81[_0x91e1('0x43')],{'$or':_['map'](_0x2e3335,function(_0x523662){if(_0x523662[_0x91e1('0x38')]!==_0x91e1('0x47')){var _0x3ff621={};_0x3ff621[_0x523662[_0x91e1('0x33')]]={'$like':'%'+_0x294016['query']['filter']+'%'};return _0x3ff621;}})});}_0x605a81=_[_0x91e1('0x46')]({},_0x605a81,_0x294016[_0x91e1('0x48')]);var _0x55eba5={'where':_0x605a81['where']};return db[_0x91e1('0x35')][_0x91e1('0x2c')](_0x55eba5)[_0x91e1('0x1a')](function(_0xcd2870){_0x5bfa14[_0x91e1('0x2c')]=_0xcd2870;if(_0x294016['query']['includeAll']){_0x605a81[_0x91e1('0x49')]=[{'all':!![]}];}return db[_0x91e1('0x35')][_0x91e1('0x4a')](_0x605a81);})[_0x91e1('0x1a')](function(_0x1a928b){_0x5bfa14[_0x91e1('0x4b')]=_0x1a928b;return _0x5bfa14;})[_0x91e1('0x1a')](respondWithFilteredResult(_0x1905e0,_0x605a81))['catch'](handleError(_0x1905e0,null));};exports[_0x91e1('0x4c')]=function(_0x287665,_0x1e252e){var _0x117d9f={'raw':![],'where':{'id':_0x287665[_0x91e1('0x4d')]['id']}},_0x481598={};_0x481598['model']=_[_0x91e1('0x3b')](db['Setting'][_0x91e1('0x36')]);_0x481598[_0x91e1('0x3c')]=_[_0x91e1('0x3b')](_0x287665[_0x91e1('0x3c')]);_0x481598[_0x91e1('0x45')]=_[_0x91e1('0x3d')](_0x481598[_0x91e1('0x3a')],_0x481598[_0x91e1('0x3c')]);_0x117d9f[_0x91e1('0x3f')]=_[_0x91e1('0x3d')](_0x481598[_0x91e1('0x3a')],qs['fields'](_0x287665[_0x91e1('0x3c')]['fields']));_0x117d9f['attributes']=_0x117d9f[_0x91e1('0x3f')][_0x91e1('0x40')]?_0x117d9f[_0x91e1('0x3f')]:_0x481598[_0x91e1('0x3a')];if(_0x287665['query'][_0x91e1('0x4e')]){_0x117d9f[_0x91e1('0x49')]=[{'all':!![]}];}_0x117d9f=_['merge']({},_0x117d9f,_0x287665[_0x91e1('0x48')]);return db[_0x91e1('0x35')][_0x91e1('0x4f')](_0x117d9f)[_0x91e1('0x1a')](handleEntityNotFound(_0x1e252e,null))[_0x91e1('0x1a')](respondWithResult(_0x1e252e,null))[_0x91e1('0x24')](handleError(_0x1e252e,null));};exports['update']=function(_0x60527d,_0x2e9417){if(_0x60527d['body']['id']){delete _0x60527d[_0x91e1('0x50')]['id'];}return db[_0x91e1('0x35')][_0x91e1('0x4f')]({'where':{'id':_0x60527d[_0x91e1('0x4d')]['id']}})[_0x91e1('0x1a')](handleEntityNotFound(_0x2e9417,null))['then'](saveUpdates(_0x60527d[_0x91e1('0x50')],null))['then'](respondWithResult(_0x2e9417,null))[_0x91e1('0x24')](handleError(_0x2e9417,null));};exports['addLogo']=function(_0xf578bb,_0x2eb5fe,_0x394571){if(_0xf578bb[_0x91e1('0x51')]&&_0xf578bb['file'][_0x91e1('0x52')]){_0xf578bb['body'][_0x91e1('0x53')]=_0xf578bb[_0x91e1('0x51')][_0x91e1('0x52')];}return db[_0x91e1('0x35')][_0x91e1('0x4f')]({'where':{'id':_0xf578bb[_0x91e1('0x4d')]['id']}})[_0x91e1('0x1a')](handleEntityNotFound(_0x2eb5fe,null))['then'](saveUpdates(_0xf578bb[_0x91e1('0x50')],null))[_0x91e1('0x1a')](respondWithResult(_0x2eb5fe,null))[_0x91e1('0x24')](handleError(_0x2eb5fe,null));};exports[_0x91e1('0x54')]=function(_0x465909,_0x107cc6,_0x50acbb){if(_0x465909[_0x91e1('0x51')]&&_0x465909[_0x91e1('0x51')][_0x91e1('0x52')]){_0x465909[_0x91e1('0x50')]['loginLogo']=_0x465909[_0x91e1('0x51')]['filename'];}return db[_0x91e1('0x35')]['find']({'where':{'id':_0x465909['params']['id']}})['then'](handleEntityNotFound(_0x107cc6,null))[_0x91e1('0x1a')](saveUpdates(_0x465909[_0x91e1('0x50')],null))[_0x91e1('0x1a')](respondWithResult(_0x107cc6,null))[_0x91e1('0x24')](handleError(_0x107cc6,null));};var utilLicense=require(_0x91e1('0x55'));exports[_0x91e1('0x56')]=function(_0xdead19,_0x212203,_0x59e001){var _0x5b5352='server/files/images/logos';var _0x573bb2={'custom':![]};return utilLicense['getLicense']()[_0x91e1('0x1a')](function(_0xfc923f){if(_0xfc923f){_0x573bb2=_0xfc923f;}return db['Setting'][_0x91e1('0x4f')]({'where':{'id':_0xdead19[_0x91e1('0x4d')]['id']},'attributes':[_0x91e1('0x53'),'loginLogo',_0x91e1('0x57'),_0x91e1('0x58'),_0x91e1('0x59'),'defaultLoginLogo','defaultPreferred',_0x91e1('0x5a')],'raw':!![]});})['then'](handleEntityNotFound(_0x212203,null))['then'](function(_0x2c088c){if(_0x2c088c){var _0x4c93cb=_0x2c088c['logo']&&fs[_0x91e1('0x5b')](path[_0x91e1('0x5c')](config['root'],_0x5b5352,_[_0x91e1('0x5d')](_0x2c088c['logo'])))?path['join'](config[_0x91e1('0x5e')],_0x5b5352,_[_0x91e1('0x5d')](_0x2c088c[_0x91e1('0x53')])):path['join'](config[_0x91e1('0x5e')],_0x5b5352,_[_0x91e1('0x5d')]('default_logo.svg'));var _0xe7ba4f='default'+_[_0x91e1('0x5f')](_0x91e1('0x53'));if(_0x2c088c[_0xe7ba4f]||!_0x573bb2[_0x91e1('0x60')]){_0x4c93cb=path[_0x91e1('0x5c')](config[_0x91e1('0x5e')],_0x5b5352,_[_0x91e1('0x5d')](_0x91e1('0x61')));}if(!fs[_0x91e1('0x5b')](_0x4c93cb)){throw new db[(_0x91e1('0x62'))][(_0x91e1('0x63'))](_['upperFirst'](_0x91e1('0x53'))+_0x91e1('0x64'));}return _0x212203[_0x91e1('0x65')](_0x4c93cb);}})['catch'](handleError(_0x212203,null));};var utilLicense=require(_0x91e1('0x55'));exports[_0x91e1('0x66')]=function(_0x3f0444,_0x15cfea,_0x21b04b){var _0x4d1299=_0x91e1('0x67');var _0x598882={'custom':![]};return utilLicense[_0x91e1('0x68')]()[_0x91e1('0x1a')](function(_0x3e0fc7){if(_0x3e0fc7){_0x598882=_0x3e0fc7;}return db[_0x91e1('0x35')][_0x91e1('0x4f')]({'where':{'id':_0x3f0444['params']['id']},'attributes':[_0x91e1('0x53'),_0x91e1('0x69'),'preferred',_0x91e1('0x58'),'defaultLogo','defaultLoginLogo',_0x91e1('0x6a'),_0x91e1('0x5a')],'raw':!![]});})[_0x91e1('0x1a')](handleEntityNotFound(_0x15cfea,null))[_0x91e1('0x1a')](function(_0x4aadb5){if(_0x4aadb5){var _0x590890=_0x4aadb5['loginLogo']&&fs[_0x91e1('0x5b')](path[_0x91e1('0x5c')](config[_0x91e1('0x5e')],_0x4d1299,_[_0x91e1('0x5d')](_0x4aadb5[_0x91e1('0x69')])))?path[_0x91e1('0x5c')](config[_0x91e1('0x5e')],_0x4d1299,_['toLower'](_0x4aadb5[_0x91e1('0x69')])):path[_0x91e1('0x5c')](config['root'],_0x4d1299,_['toLower'](_0x91e1('0x6b')));var _0x475a89=_0x91e1('0x6c')+_[_0x91e1('0x5f')](_0x91e1('0x69'));if(_0x4aadb5[_0x475a89]||!_0x598882[_0x91e1('0x60')]){_0x590890=path[_0x91e1('0x5c')](config[_0x91e1('0x5e')],_0x4d1299,_[_0x91e1('0x5d')](_0x91e1('0x6b')));}if(!fs[_0x91e1('0x5b')](_0x590890)){throw new db[(_0x91e1('0x62'))][(_0x91e1('0x63'))](_[_0x91e1('0x5f')](_0x91e1('0x69'))+_0x91e1('0x64'));}return _0x15cfea[_0x91e1('0x65')](_0x590890);}})[_0x91e1('0x24')](handleError(_0x15cfea,null));};exports[_0x91e1('0x6d')]=function(_0x1c0080,_0x4802f9){return db[_0x91e1('0x35')][_0x91e1('0x4f')]({'where':{'id':_0x1c0080[_0x91e1('0x4d')]['id']},'attributes':[_0x91e1('0x6e')]})['then'](respondWithResult(_0x4802f9,null))['catch'](handleError(_0x4802f9,null));};exports[_0x91e1('0x6f')]=function(_0x5b29bc,_0x1dcb76,_0x118e4b){if(_0x5b29bc[_0x91e1('0x51')]&&_0x5b29bc[_0x91e1('0x51')][_0x91e1('0x52')]){_0x5b29bc['body'][_0x91e1('0x57')]=_0x5b29bc['file']['filename'];}return db[_0x91e1('0x35')][_0x91e1('0x4f')]({'where':{'id':_0x5b29bc[_0x91e1('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1dcb76,null))['then'](saveUpdates(_0x5b29bc['body'],null))[_0x91e1('0x1a')](respondWithResult(_0x1dcb76,null))[_0x91e1('0x24')](handleError(_0x1dcb76,null));};var utilLicense=require(_0x91e1('0x55'));exports[_0x91e1('0x70')]=function(_0x1317f1,_0x55956a,_0xb1189e){var _0x5a9dc6=_0x91e1('0x67');var _0x17cb45={'custom':![]};return utilLicense[_0x91e1('0x68')]()['then'](function(_0xf84b46){if(_0xf84b46){_0x17cb45=_0xf84b46;}return db[_0x91e1('0x35')]['find']({'where':{'id':_0x1317f1[_0x91e1('0x4d')]['id']},'attributes':[_0x91e1('0x53'),'loginLogo',_0x91e1('0x57'),_0x91e1('0x58'),_0x91e1('0x59'),_0x91e1('0x71'),'defaultPreferred',_0x91e1('0x5a')],'raw':!![]});})[_0x91e1('0x1a')](handleEntityNotFound(_0x55956a,null))['then'](function(_0x330a9c){if(_0x330a9c){var _0x38203c=_0x330a9c[_0x91e1('0x57')]&&fs[_0x91e1('0x5b')](path['join'](config['root'],_0x5a9dc6,_[_0x91e1('0x5d')](_0x330a9c[_0x91e1('0x57')])))?path['join'](config[_0x91e1('0x5e')],_0x5a9dc6,_['toLower'](_0x330a9c[_0x91e1('0x57')])):path[_0x91e1('0x5c')](config['root'],_0x5a9dc6,_['toLower'](_0x91e1('0x72')));var _0x53e133=_0x91e1('0x6c')+_[_0x91e1('0x5f')](_0x91e1('0x57'));if(_0x330a9c[_0x53e133]||!_0x17cb45[_0x91e1('0x60')]||!_0x17cb45['preferred']){_0x38203c=path[_0x91e1('0x5c')](config[_0x91e1('0x5e')],_0x5a9dc6,_[_0x91e1('0x5d')]('default_preferred.png'));}if(!fs['existsSync'](_0x38203c)){throw new db[(_0x91e1('0x62'))][(_0x91e1('0x63'))](_[_0x91e1('0x5f')](_0x91e1('0x57'))+_0x91e1('0x64'));}return _0x55956a[_0x91e1('0x65')](_0x38203c);}})[_0x91e1('0x24')](handleError(_0x55956a,null));};exports[_0x91e1('0x73')]=function(_0x513711,_0x26afbd,_0x1d69ab){if(_0x513711[_0x91e1('0x51')]&&_0x513711[_0x91e1('0x51')][_0x91e1('0x52')]){_0x513711[_0x91e1('0x50')][_0x91e1('0x58')]=_0x513711[_0x91e1('0x51')][_0x91e1('0x52')];}return db[_0x91e1('0x35')][_0x91e1('0x4f')]({'where':{'id':_0x513711['params']['id']}})[_0x91e1('0x1a')](handleEntityNotFound(_0x26afbd,null))[_0x91e1('0x1a')](saveUpdates(_0x513711[_0x91e1('0x50')],null))[_0x91e1('0x1a')](respondWithResult(_0x26afbd,null))[_0x91e1('0x24')](handleError(_0x26afbd,null));};var utilLicense=require(_0x91e1('0x55'));exports[_0x91e1('0x74')]=function(_0x4d15b7,_0x8c6f86,_0x23852a){var _0x1ef985='server/files/images/logos';var _0x256a3b={'custom':![]};return utilLicense['getLicense']()[_0x91e1('0x1a')](function(_0x37578b){if(_0x37578b){_0x256a3b=_0x37578b;}return db[_0x91e1('0x35')][_0x91e1('0x4f')]({'where':{'id':_0x4d15b7[_0x91e1('0x4d')]['id']},'attributes':[_0x91e1('0x53'),_0x91e1('0x69'),_0x91e1('0x57'),'favicon',_0x91e1('0x59'),_0x91e1('0x71'),'defaultPreferred',_0x91e1('0x5a')],'raw':!![]});})[_0x91e1('0x1a')](handleEntityNotFound(_0x8c6f86,null))[_0x91e1('0x1a')](function(_0x130e4a){if(_0x130e4a){var _0x37d0c2=_0x130e4a[_0x91e1('0x58')]&&fs[_0x91e1('0x5b')](path[_0x91e1('0x5c')](config['root'],_0x1ef985,_[_0x91e1('0x5d')](_0x130e4a['favicon'])))?path['join'](config[_0x91e1('0x5e')],_0x1ef985,_['toLower'](_0x130e4a[_0x91e1('0x58')])):path[_0x91e1('0x5c')](config[_0x91e1('0x5e')],_0x1ef985,_[_0x91e1('0x5d')](_0x91e1('0x75')));var _0x18118e='default'+_[_0x91e1('0x5f')](_0x91e1('0x58'));if(_0x130e4a[_0x18118e]||!_0x256a3b[_0x91e1('0x60')]){_0x37d0c2=path[_0x91e1('0x5c')](config[_0x91e1('0x5e')],_0x1ef985,_['toLower'](_0x91e1('0x75')));}if(!fs[_0x91e1('0x5b')](_0x37d0c2)){throw new db['Sequelize'][(_0x91e1('0x63'))](_[_0x91e1('0x5f')](_0x91e1('0x58'))+_0x91e1('0x64'));}return _0x8c6f86[_0x91e1('0x65')](_0x37d0c2);}})['catch'](handleError(_0x8c6f86,null));};exports[_0x91e1('0x76')]=function(_0x2d5d4e,_0x13cf54){var _0xb4cdc4={'offset':moment()[_0x91e1('0x77')]()};_0xb4cdc4[_0x91e1('0x78')]=moment()[_0x91e1('0x77')](_0xb4cdc4[_0x91e1('0x29')])[_0x91e1('0x79')](_0x91e1('0x7a'));return _0x13cf54[_0x91e1('0x26')](0xc8)[_0x91e1('0x7b')](_0xb4cdc4);}; \ No newline at end of file +var _0x1625=['params','keys','rawAttributes','attributes','find','update','body','file','logo','addLogoLogin','../../config/license/util','getLogo','getLicense','loginLogo','preferred','defaultLogo','defaultFavicon','existsSync','join','toLower','root','default_logo.svg','upperFirst','Sequelize','ValidationError','\x20not\x20found','getLogoLogin','server/files/images/logos','defaultPreferred','default_loginLogo.svg','download','gdpr','filename','getPreferred','favicon','defaultLoginLogo','default_preferred.png','default','addFavicon','getFavicon','custom','default_favicon.ico','getDate','utcOffset','now','format','eml-format','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','request','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','message','result','catch','status','end','undefined','limit','count','offset','Content-Range','json','apply','reject','then','destroy','stack','name','send','index','fieldName','key','model','map','query','filters','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','Setting','includeAll','include','findAll','rows'];(function(_0x257f4b,_0x3a7e9c){var _0x159be4=function(_0x30dbac){while(--_0x30dbac){_0x257f4b['push'](_0x257f4b['shift']());}};_0x159be4(++_0x3a7e9c);}(_0x1625,0xa7));var _0x5162=function(_0x55ebc8,_0x4e8361){_0x55ebc8=_0x55ebc8-0x0;var _0x4240bf=_0x1625[_0x55ebc8];return _0x4240bf;};'use strict';var emlformat=require(_0x5162('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5162('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5162('0x2'));var moment=require(_0x5162('0x3'));var BPromise=require(_0x5162('0x4'));var Mustache=require('mustache');var util=require(_0x5162('0x5'));var path=require('path');var sox=require(_0x5162('0x6'));var csv=require(_0x5162('0x7'));var ejs=require(_0x5162('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5162('0x9'));var squel=require(_0x5162('0xa'));var crypto=require(_0x5162('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5162('0xc'));var toCsv=require(_0x5162('0x7'));var querystring=require('querystring');var Papa=require(_0x5162('0xd'));var Redis=require(_0x5162('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x5162('0xf'));var as=require(_0x5162('0x10'));var hardwareService=require(_0x5162('0x11'));var logger=require(_0x5162('0x12'))(_0x5162('0x13'));var utils=require(_0x5162('0x14'));var config=require(_0x5162('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x5162('0x16'))['db'];var jayson=require(_0x5162('0x17'));var client=jayson[_0x5162('0x18')]['http']({'port':0x232a});function respondWithRpcPromise(_0x170a5c,_0x20df09,_0x3ad5ef,_0x166351){return new BPromise(function(_0x59fe59,_0x4a5de1){var _0x52185b=_0x166351||client;return _0x52185b[_0x5162('0x19')](_0x170a5c,_0x3ad5ef)['then'](function(_0x2ec5b){logger[_0x5162('0x1a')](_0x5162('0x1b'),_0x20df09,_0x5162('0x1c'));logger[_0x5162('0x1d')](_0x5162('0x1e'),_0x20df09,_0x5162('0x1c'),JSON['stringify'](_0x2ec5b));if(_0x2ec5b[_0x5162('0x1f')]){if(_0x2ec5b[_0x5162('0x1f')]['code']===0x1f4){logger[_0x5162('0x1f')](_0x5162('0x1b'),_0x20df09,_0x2ec5b['error'][_0x5162('0x20')]);return _0x4a5de1(_0x2ec5b[_0x5162('0x1f')][_0x5162('0x20')]);}logger[_0x5162('0x1f')]('Setting,\x20%s,\x20%s',_0x20df09,_0x2ec5b[_0x5162('0x1f')][_0x5162('0x20')]);return _0x59fe59(_0x2ec5b[_0x5162('0x1f')][_0x5162('0x20')]);}else{logger[_0x5162('0x1a')]('Setting,\x20%s,\x20%s',_0x20df09,_0x5162('0x1c'));_0x59fe59(_0x2ec5b[_0x5162('0x21')][_0x5162('0x20')]);}})[_0x5162('0x22')](function(_0x3dc6f5){logger[_0x5162('0x1f')]('Setting,\x20%s,\x20%s',_0x20df09,_0x3dc6f5);_0x4a5de1(_0x3dc6f5);});});}function respondWithStatusCode(_0x15cf06,_0x15cdb9){_0x15cdb9=_0x15cdb9||0xcc;return function(_0x2e79af){if(_0x2e79af){return _0x15cf06['sendStatus'](_0x15cdb9);}return _0x15cf06[_0x5162('0x23')](_0x15cdb9)[_0x5162('0x24')]();};}function respondWithResult(_0x4add1e,_0x583777){_0x583777=_0x583777||0xc8;return function(_0xbee578){if(_0xbee578){return _0x4add1e[_0x5162('0x23')](_0x583777)['json'](_0xbee578);}};}function respondWithFilteredResult(_0x30baea,_0x32365f){return function(_0x352946){if(_0x352946){var _0x313e69=typeof _0x32365f['offset']===_0x5162('0x25')&&typeof _0x32365f[_0x5162('0x26')]==='undefined';var _0x10f468=_0x352946[_0x5162('0x27')];var _0x149ce9=_0x313e69?0x0:_0x32365f[_0x5162('0x28')];var _0x2b190=_0x313e69?_0x352946[_0x5162('0x27')]:_0x32365f[_0x5162('0x28')]+_0x32365f[_0x5162('0x26')];var _0x47aba3;if(_0x2b190>=_0x10f468){_0x2b190=_0x10f468;_0x47aba3=0xc8;}else{_0x47aba3=0xce;}_0x30baea['status'](_0x47aba3);return _0x30baea['set'](_0x5162('0x29'),_0x149ce9+'-'+_0x2b190+'/'+_0x10f468)[_0x5162('0x2a')](_0x352946);}return null;};}function patchUpdates(_0x36dba6){return function(_0x5a56b4){try{jsonpatch[_0x5162('0x2b')](_0x5a56b4,_0x36dba6,!![]);}catch(_0x274213){return BPromise[_0x5162('0x2c')](_0x274213);}return _0x5a56b4['save']();};}function saveUpdates(_0x388abc,_0x33df42){return function(_0x1ab79b){if(_0x1ab79b){return _0x1ab79b['update'](_0x388abc)[_0x5162('0x2d')](function(_0x56fc82){return _0x56fc82;});}return null;};}function removeEntity(_0x230b4a,_0x2533b1){return function(_0x793ca7){if(_0x793ca7){return _0x793ca7[_0x5162('0x2e')]()[_0x5162('0x2d')](function(){_0x230b4a[_0x5162('0x23')](0xcc)[_0x5162('0x24')]();});}};}function handleEntityNotFound(_0x149c7c,_0x17213d){return function(_0x535689){if(!_0x535689){_0x149c7c['sendStatus'](0x194);}return _0x535689;};}function handleError(_0x22d3ec,_0x5e936f){_0x5e936f=_0x5e936f||0x1f4;return function(_0xdf1217){logger[_0x5162('0x1f')](_0xdf1217[_0x5162('0x2f')]);if(_0xdf1217[_0x5162('0x30')]){delete _0xdf1217[_0x5162('0x30')];}_0x22d3ec[_0x5162('0x23')](_0x5e936f)[_0x5162('0x31')](_0xdf1217);};}exports[_0x5162('0x32')]=function(_0x354da0,_0x7fa237){var _0x353ea4={},_0x3c9a59={},_0x3cb646={'count':0x0,'rows':[]};var _0x34b994=_['map'](db['Setting']['rawAttributes'],function(_0x5ad1be){return{'name':_0x5ad1be[_0x5162('0x33')],'type':_0x5ad1be['type'][_0x5162('0x34')]};});_0x3c9a59[_0x5162('0x35')]=_[_0x5162('0x36')](_0x34b994,_0x5162('0x30'));_0x3c9a59[_0x5162('0x37')]=_['keys'](_0x354da0['query']);_0x3c9a59[_0x5162('0x38')]=_['intersection'](_0x3c9a59[_0x5162('0x35')],_0x3c9a59[_0x5162('0x37')]);_0x353ea4['attributes']=_[_0x5162('0x39')](_0x3c9a59['model'],qs[_0x5162('0x3a')](_0x354da0[_0x5162('0x37')]['fields']));_0x353ea4['attributes']=_0x353ea4['attributes'][_0x5162('0x3b')]?_0x353ea4['attributes']:_0x3c9a59[_0x5162('0x35')];if(!_0x354da0[_0x5162('0x37')][_0x5162('0x3c')](_0x5162('0x3d'))){_0x353ea4['limit']=qs['limit'](_0x354da0[_0x5162('0x37')][_0x5162('0x26')]);_0x353ea4['offset']=qs['offset'](_0x354da0[_0x5162('0x37')]['offset']);}_0x353ea4[_0x5162('0x3e')]=qs[_0x5162('0x3f')](_0x354da0[_0x5162('0x37')][_0x5162('0x3f')]);_0x353ea4['where']=qs['filters'](_[_0x5162('0x40')](_0x354da0['query'],_0x3c9a59[_0x5162('0x38')]),_0x34b994);if(_0x354da0[_0x5162('0x37')][_0x5162('0x41')]){_0x353ea4[_0x5162('0x42')]=_[_0x5162('0x43')](_0x353ea4[_0x5162('0x42')],{'$or':_['map'](_0x34b994,function(_0x3cb466){if(_0x3cb466['type']!==_0x5162('0x44')){var _0x158151={};_0x158151[_0x3cb466[_0x5162('0x30')]]={'$like':'%'+_0x354da0[_0x5162('0x37')][_0x5162('0x41')]+'%'};return _0x158151;}})});}_0x353ea4=_[_0x5162('0x43')]({},_0x353ea4,_0x354da0[_0x5162('0x45')]);var _0x182829={'where':_0x353ea4[_0x5162('0x42')]};return db[_0x5162('0x46')][_0x5162('0x27')](_0x182829)[_0x5162('0x2d')](function(_0x5a8fcb){_0x3cb646['count']=_0x5a8fcb;if(_0x354da0[_0x5162('0x37')][_0x5162('0x47')]){_0x353ea4[_0x5162('0x48')]=[{'all':!![]}];}return db['Setting'][_0x5162('0x49')](_0x353ea4);})[_0x5162('0x2d')](function(_0x387b09){_0x3cb646[_0x5162('0x4a')]=_0x387b09;return _0x3cb646;})[_0x5162('0x2d')](respondWithFilteredResult(_0x7fa237,_0x353ea4))['catch'](handleError(_0x7fa237,null));};exports['show']=function(_0xcb22ad,_0x13efa0){var _0x342698={'raw':![],'where':{'id':_0xcb22ad[_0x5162('0x4b')]['id']}},_0x25a4d0={};_0x25a4d0['model']=_[_0x5162('0x4c')](db['Setting'][_0x5162('0x4d')]);_0x25a4d0[_0x5162('0x37')]=_[_0x5162('0x4c')](_0xcb22ad[_0x5162('0x37')]);_0x25a4d0[_0x5162('0x38')]=_['intersection'](_0x25a4d0['model'],_0x25a4d0[_0x5162('0x37')]);_0x342698[_0x5162('0x4e')]=_[_0x5162('0x39')](_0x25a4d0[_0x5162('0x35')],qs['fields'](_0xcb22ad[_0x5162('0x37')][_0x5162('0x3a')]));_0x342698['attributes']=_0x342698[_0x5162('0x4e')][_0x5162('0x3b')]?_0x342698['attributes']:_0x25a4d0[_0x5162('0x35')];if(_0xcb22ad[_0x5162('0x37')][_0x5162('0x47')]){_0x342698['include']=[{'all':!![]}];}_0x342698=_[_0x5162('0x43')]({},_0x342698,_0xcb22ad['options']);return db[_0x5162('0x46')][_0x5162('0x4f')](_0x342698)[_0x5162('0x2d')](handleEntityNotFound(_0x13efa0,null))[_0x5162('0x2d')](respondWithResult(_0x13efa0,null))[_0x5162('0x22')](handleError(_0x13efa0,null));};exports[_0x5162('0x50')]=function(_0x479d25,_0x9facfe){if(_0x479d25[_0x5162('0x51')]['id']){delete _0x479d25[_0x5162('0x51')]['id'];}return db[_0x5162('0x46')][_0x5162('0x4f')]({'where':{'id':_0x479d25['params']['id']}})[_0x5162('0x2d')](handleEntityNotFound(_0x9facfe,null))[_0x5162('0x2d')](saveUpdates(_0x479d25[_0x5162('0x51')],null))[_0x5162('0x2d')](respondWithResult(_0x9facfe,null))[_0x5162('0x22')](handleError(_0x9facfe,null));};exports['addLogo']=function(_0x253043,_0x3a9a80,_0x1a482d){if(_0x253043[_0x5162('0x52')]&&_0x253043['file']['filename']){_0x253043[_0x5162('0x51')][_0x5162('0x53')]=_0x253043[_0x5162('0x52')]['filename'];}return db[_0x5162('0x46')][_0x5162('0x4f')]({'where':{'id':_0x253043[_0x5162('0x4b')]['id']}})[_0x5162('0x2d')](handleEntityNotFound(_0x3a9a80,null))[_0x5162('0x2d')](saveUpdates(_0x253043[_0x5162('0x51')],null))[_0x5162('0x2d')](respondWithResult(_0x3a9a80,null))[_0x5162('0x22')](handleError(_0x3a9a80,null));};exports[_0x5162('0x54')]=function(_0x22ed9b,_0xe0c3bc,_0x1e11d5){if(_0x22ed9b['file']&&_0x22ed9b[_0x5162('0x52')]['filename']){_0x22ed9b[_0x5162('0x51')]['loginLogo']=_0x22ed9b[_0x5162('0x52')]['filename'];}return db[_0x5162('0x46')][_0x5162('0x4f')]({'where':{'id':_0x22ed9b[_0x5162('0x4b')]['id']}})['then'](handleEntityNotFound(_0xe0c3bc,null))[_0x5162('0x2d')](saveUpdates(_0x22ed9b['body'],null))[_0x5162('0x2d')](respondWithResult(_0xe0c3bc,null))[_0x5162('0x22')](handleError(_0xe0c3bc,null));};var utilLicense=require(_0x5162('0x55'));exports[_0x5162('0x56')]=function(_0x22e4c6,_0x1b5a3d,_0x17e5d3){var _0x75d205='server/files/images/logos';var _0xed7af2={'custom':![]};return utilLicense[_0x5162('0x57')]()[_0x5162('0x2d')](function(_0x48be8d){if(_0x48be8d){_0xed7af2=_0x48be8d;}return db[_0x5162('0x46')][_0x5162('0x4f')]({'where':{'id':_0x22e4c6[_0x5162('0x4b')]['id']},'attributes':[_0x5162('0x53'),_0x5162('0x58'),_0x5162('0x59'),'favicon',_0x5162('0x5a'),'defaultLoginLogo','defaultPreferred',_0x5162('0x5b')],'raw':!![]});})[_0x5162('0x2d')](handleEntityNotFound(_0x1b5a3d,null))[_0x5162('0x2d')](function(_0xed8a2e){if(_0xed8a2e){var _0x150d9d=_0xed8a2e[_0x5162('0x53')]&&fs[_0x5162('0x5c')](path[_0x5162('0x5d')](config['root'],_0x75d205,_[_0x5162('0x5e')](_0xed8a2e[_0x5162('0x53')])))?path[_0x5162('0x5d')](config[_0x5162('0x5f')],_0x75d205,_[_0x5162('0x5e')](_0xed8a2e['logo'])):path['join'](config['root'],_0x75d205,_[_0x5162('0x5e')](_0x5162('0x60')));var _0x177eeb='default'+_[_0x5162('0x61')]('logo');if(_0xed8a2e[_0x177eeb]||!_0xed7af2['custom']){_0x150d9d=path['join'](config[_0x5162('0x5f')],_0x75d205,_['toLower'](_0x5162('0x60')));}if(!fs[_0x5162('0x5c')](_0x150d9d)){throw new db[(_0x5162('0x62'))][(_0x5162('0x63'))](_['upperFirst'](_0x5162('0x53'))+_0x5162('0x64'));}return _0x1b5a3d['download'](_0x150d9d);}})[_0x5162('0x22')](handleError(_0x1b5a3d,null));};var utilLicense=require(_0x5162('0x55'));exports[_0x5162('0x65')]=function(_0x2824c6,_0x559273,_0x2b78a0){var _0x2a7c95=_0x5162('0x66');var _0x14e736={'custom':![]};return utilLicense[_0x5162('0x57')]()[_0x5162('0x2d')](function(_0x5a5f00){if(_0x5a5f00){_0x14e736=_0x5a5f00;}return db[_0x5162('0x46')][_0x5162('0x4f')]({'where':{'id':_0x2824c6[_0x5162('0x4b')]['id']},'attributes':[_0x5162('0x53'),_0x5162('0x58'),_0x5162('0x59'),'favicon','defaultLogo','defaultLoginLogo',_0x5162('0x67'),_0x5162('0x5b')],'raw':!![]});})[_0x5162('0x2d')](handleEntityNotFound(_0x559273,null))[_0x5162('0x2d')](function(_0x17e2a5){if(_0x17e2a5){var _0x3c2529=_0x17e2a5[_0x5162('0x58')]&&fs[_0x5162('0x5c')](path[_0x5162('0x5d')](config[_0x5162('0x5f')],_0x2a7c95,_[_0x5162('0x5e')](_0x17e2a5[_0x5162('0x58')])))?path[_0x5162('0x5d')](config['root'],_0x2a7c95,_[_0x5162('0x5e')](_0x17e2a5['loginLogo'])):path['join'](config[_0x5162('0x5f')],_0x2a7c95,_[_0x5162('0x5e')](_0x5162('0x68')));var _0x506e6c='default'+_[_0x5162('0x61')](_0x5162('0x58'));if(_0x17e2a5[_0x506e6c]||!_0x14e736['custom']){_0x3c2529=path[_0x5162('0x5d')](config['root'],_0x2a7c95,_[_0x5162('0x5e')](_0x5162('0x68')));}if(!fs['existsSync'](_0x3c2529)){throw new db[(_0x5162('0x62'))][(_0x5162('0x63'))](_[_0x5162('0x61')](_0x5162('0x58'))+_0x5162('0x64'));}return _0x559273[_0x5162('0x69')](_0x3c2529);}})['catch'](handleError(_0x559273,null));};exports[_0x5162('0x6a')]=function(_0x3b47b0,_0x4e9c62){return db[_0x5162('0x46')]['find']({'where':{'id':_0x3b47b0['params']['id']},'attributes':['securePassword']})[_0x5162('0x2d')](respondWithResult(_0x4e9c62,null))['catch'](handleError(_0x4e9c62,null));};exports['addPreferred']=function(_0x1436ef,_0x3e232e,_0x58fd4e){if(_0x1436ef[_0x5162('0x52')]&&_0x1436ef[_0x5162('0x52')]['filename']){_0x1436ef[_0x5162('0x51')][_0x5162('0x59')]=_0x1436ef[_0x5162('0x52')][_0x5162('0x6b')];}return db[_0x5162('0x46')][_0x5162('0x4f')]({'where':{'id':_0x1436ef[_0x5162('0x4b')]['id']}})[_0x5162('0x2d')](handleEntityNotFound(_0x3e232e,null))[_0x5162('0x2d')](saveUpdates(_0x1436ef['body'],null))['then'](respondWithResult(_0x3e232e,null))[_0x5162('0x22')](handleError(_0x3e232e,null));};var utilLicense=require(_0x5162('0x55'));exports[_0x5162('0x6c')]=function(_0x159e88,_0x50e1fc,_0x2a5fc5){var _0xc9a074='server/files/images/logos';var _0x314800={'custom':![]};return utilLicense[_0x5162('0x57')]()['then'](function(_0x3fc7cb){if(_0x3fc7cb){_0x314800=_0x3fc7cb;}return db[_0x5162('0x46')][_0x5162('0x4f')]({'where':{'id':_0x159e88[_0x5162('0x4b')]['id']},'attributes':[_0x5162('0x53'),_0x5162('0x58'),_0x5162('0x59'),_0x5162('0x6d'),_0x5162('0x5a'),_0x5162('0x6e'),_0x5162('0x67'),'defaultFavicon'],'raw':!![]});})[_0x5162('0x2d')](handleEntityNotFound(_0x50e1fc,null))[_0x5162('0x2d')](function(_0x5bf2f){if(_0x5bf2f){var _0x514c96=_0x5bf2f[_0x5162('0x59')]&&fs[_0x5162('0x5c')](path[_0x5162('0x5d')](config[_0x5162('0x5f')],_0xc9a074,_[_0x5162('0x5e')](_0x5bf2f[_0x5162('0x59')])))?path[_0x5162('0x5d')](config[_0x5162('0x5f')],_0xc9a074,_['toLower'](_0x5bf2f[_0x5162('0x59')])):path[_0x5162('0x5d')](config[_0x5162('0x5f')],_0xc9a074,_[_0x5162('0x5e')](_0x5162('0x6f')));var _0x3674ef=_0x5162('0x70')+_[_0x5162('0x61')](_0x5162('0x59'));if(_0x5bf2f[_0x3674ef]||!_0x314800['custom']||!_0x314800[_0x5162('0x59')]){_0x514c96=path[_0x5162('0x5d')](config[_0x5162('0x5f')],_0xc9a074,_['toLower']('default_preferred.png'));}if(!fs[_0x5162('0x5c')](_0x514c96)){throw new db[(_0x5162('0x62'))][(_0x5162('0x63'))](_['upperFirst']('preferred')+_0x5162('0x64'));}return _0x50e1fc[_0x5162('0x69')](_0x514c96);}})['catch'](handleError(_0x50e1fc,null));};exports[_0x5162('0x71')]=function(_0x1c9b95,_0x5aa3cc,_0x5bf5d4){if(_0x1c9b95[_0x5162('0x52')]&&_0x1c9b95[_0x5162('0x52')][_0x5162('0x6b')]){_0x1c9b95[_0x5162('0x51')][_0x5162('0x6d')]=_0x1c9b95['file'][_0x5162('0x6b')];}return db[_0x5162('0x46')][_0x5162('0x4f')]({'where':{'id':_0x1c9b95[_0x5162('0x4b')]['id']}})[_0x5162('0x2d')](handleEntityNotFound(_0x5aa3cc,null))[_0x5162('0x2d')](saveUpdates(_0x1c9b95[_0x5162('0x51')],null))[_0x5162('0x2d')](respondWithResult(_0x5aa3cc,null))[_0x5162('0x22')](handleError(_0x5aa3cc,null));};var utilLicense=require(_0x5162('0x55'));exports[_0x5162('0x72')]=function(_0x30a252,_0x1fa37c,_0x4cc2bf){var _0x45e90b=_0x5162('0x66');var _0x5d828f={'custom':![]};return utilLicense[_0x5162('0x57')]()['then'](function(_0x6a352b){if(_0x6a352b){_0x5d828f=_0x6a352b;}return db[_0x5162('0x46')][_0x5162('0x4f')]({'where':{'id':_0x30a252[_0x5162('0x4b')]['id']},'attributes':[_0x5162('0x53'),_0x5162('0x58'),_0x5162('0x59'),_0x5162('0x6d'),_0x5162('0x5a'),'defaultLoginLogo',_0x5162('0x67'),_0x5162('0x5b')],'raw':!![]});})[_0x5162('0x2d')](handleEntityNotFound(_0x1fa37c,null))[_0x5162('0x2d')](function(_0xceca42){if(_0xceca42){var _0x42aaab=_0xceca42[_0x5162('0x6d')]&&fs[_0x5162('0x5c')](path[_0x5162('0x5d')](config[_0x5162('0x5f')],_0x45e90b,_[_0x5162('0x5e')](_0xceca42[_0x5162('0x6d')])))?path[_0x5162('0x5d')](config[_0x5162('0x5f')],_0x45e90b,_['toLower'](_0xceca42[_0x5162('0x6d')])):path['join'](config['root'],_0x45e90b,_['toLower']('default_favicon.ico'));var _0x1223b5='default'+_[_0x5162('0x61')](_0x5162('0x6d'));if(_0xceca42[_0x1223b5]||!_0x5d828f[_0x5162('0x73')]){_0x42aaab=path[_0x5162('0x5d')](config['root'],_0x45e90b,_[_0x5162('0x5e')](_0x5162('0x74')));}if(!fs[_0x5162('0x5c')](_0x42aaab)){throw new db['Sequelize']['ValidationError'](_['upperFirst'](_0x5162('0x6d'))+'\x20not\x20found');}return _0x1fa37c[_0x5162('0x69')](_0x42aaab);}})[_0x5162('0x22')](handleError(_0x1fa37c,null));};exports[_0x5162('0x75')]=function(_0x1101e6,_0x369009){var _0x3b9cb7={'offset':moment()[_0x5162('0x76')]()};_0x3b9cb7[_0x5162('0x77')]=moment()[_0x5162('0x76')](_0x3b9cb7[_0x5162('0x28')])[_0x5162('0x78')]('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x369009[_0x5162('0x23')](0xc8)[_0x5162('0x31')](_0x3b9cb7);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 6c5d7ea..72c904a 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 _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./setting.attributes','exports','Setting','util'];(function(_0x129fc7,_0x496520){var _0x21f28e=function(_0x4363f6){while(--_0x4363f6){_0x129fc7['push'](_0x129fc7['shift']());}};_0x21f28e(++_0x496520);}(_0xedd9,0xfc));var _0x9edd=function(_0x3ac312,_0x5d3903){_0x3ac312=_0x3ac312-0x0;var _0x36b673=_0xedd9[_0x3ac312];return _0x36b673;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Setting','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./setting.attributes'];(function(_0x486f4a,_0x478dc7){var _0x135d99=function(_0x434008){while(--_0x434008){_0x486f4a['push'](_0x486f4a['shift']());}};_0x135d99(++_0x478dc7);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'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':'settings','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 ec58052..2287cb7 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 _0xb5cc=['include','attributes','model','ShowSetting','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','Setting','find','options','raw','where','map'];(function(_0x4989fe,_0x201e34){var _0x4afd24=function(_0x3bb870){while(--_0x3bb870){_0x4989fe['push'](_0x4989fe['shift']());}};_0x4afd24(++_0x201e34);}(_0xb5cc,0x159));var _0xcb5c=function(_0x1f1e1c,_0x2c62ef){_0x1f1e1c=_0x1f1e1c-0x0;var _0x465666=_0xb5cc[_0x1f1e1c];return _0x465666;};'use strict';var _=require(_0xcb5c('0x0'));var util=require('util');var moment=require(_0xcb5c('0x1'));var BPromise=require(_0xcb5c('0x2'));var rs=require(_0xcb5c('0x3'));var fs=require('fs');var Redis=require(_0xcb5c('0x4'));var db=require(_0xcb5c('0x5'))['db'];var utils=require(_0xcb5c('0x6'));var logger=require(_0xcb5c('0x7'))('rpc');var config=require(_0xcb5c('0x8'));var jayson=require(_0xcb5c('0x9'));var client=jayson[_0xcb5c('0xa')][_0xcb5c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xee6657,_0x426520,_0x41d4ad){return new BPromise(function(_0x266406,_0x105691){return client[_0xcb5c('0xc')](_0xee6657,_0x41d4ad)[_0xcb5c('0xd')](function(_0x475b98){logger[_0xcb5c('0xe')](_0xcb5c('0xf'),_0x426520,_0xcb5c('0x10'));logger['debug'](_0xcb5c('0x11'),_0x426520,_0xcb5c('0x10'),JSON[_0xcb5c('0x12')](_0x475b98));if(_0x475b98[_0xcb5c('0x13')]){if(_0x475b98[_0xcb5c('0x13')][_0xcb5c('0x14')]===0x1f4){logger[_0xcb5c('0x13')](_0xcb5c('0xf'),_0x426520,_0x475b98[_0xcb5c('0x13')][_0xcb5c('0x15')]);return _0x105691(_0x475b98[_0xcb5c('0x13')]['message']);}logger[_0xcb5c('0x13')](_0xcb5c('0xf'),_0x426520,_0x475b98[_0xcb5c('0x13')][_0xcb5c('0x15')]);return _0x266406(_0x475b98[_0xcb5c('0x13')][_0xcb5c('0x15')]);}else{logger[_0xcb5c('0xe')](_0xcb5c('0xf'),_0x426520,_0xcb5c('0x10'));_0x266406(_0x475b98['result'][_0xcb5c('0x15')]);}})[_0xcb5c('0x16')](function(_0x4a00db){logger[_0xcb5c('0x13')](_0xcb5c('0xf'),_0x426520,_0x4a00db);_0x105691(_0x4a00db);});});}exports['ShowSetting']=function(_0x4b9be2){var _0x5d1df9=this;return new Promise(function(_0x1098b6,_0x51b34b){return db[_0xcb5c('0x17')][_0xcb5c('0x18')]({'raw':_0x4b9be2[_0xcb5c('0x19')]?_0x4b9be2['options'][_0xcb5c('0x1a')]===undefined?!![]:![]:!![],'where':_0x4b9be2['options']?_0x4b9be2[_0xcb5c('0x19')][_0xcb5c('0x1b')]||null:null,'attributes':_0x4b9be2[_0xcb5c('0x19')]?_0x4b9be2[_0xcb5c('0x19')]['attributes']||null:null,'include':_0x4b9be2[_0xcb5c('0x19')]?_0x4b9be2['options']['include']?_[_0xcb5c('0x1c')](_0x4b9be2[_0xcb5c('0x19')][_0xcb5c('0x1d')],function(_0x448c82){return{'model':db[_0x448c82['model']],'as':_0x448c82['as'],'attributes':_0x448c82[_0xcb5c('0x1e')],'include':_0x448c82[_0xcb5c('0x1d')]?_['map'](_0x448c82[_0xcb5c('0x1d')],function(_0x39e0d7){return{'model':db[_0x39e0d7[_0xcb5c('0x1f')]],'as':_0x39e0d7['as'],'attributes':_0x39e0d7['attributes'],'include':_0x39e0d7['include']?_['map'](_0x39e0d7[_0xcb5c('0x1d')],function(_0x318e99){return{'model':db[_0x318e99['model']],'as':_0x318e99['as'],'attributes':_0x318e99[_0xcb5c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xcb5c('0xd')](function(_0x8bd891){logger[_0xcb5c('0xe')](_0xcb5c('0x20'),_0x4b9be2);logger[_0xcb5c('0x21')](_0xcb5c('0x20'),_0x4b9be2,JSON['stringify'](_0x8bd891));_0x1098b6(_0x8bd891);})[_0xcb5c('0x16')](function(_0x5419a7){logger['error']('ShowSetting',_0x5419a7[_0xcb5c('0x15')],_0x4b9be2);_0x51b34b(_0x5d1df9[_0xcb5c('0x13')](0x1f4,_0x5419a7['message']));});});}; \ No newline at end of file +var _0x6993=['../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','Setting,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','ShowSetting','Setting','find','options','raw','where','map','include','model','attributes','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x50ef1b,_0x2aee09){var _0x5ecb38=function(_0x29d64b){while(--_0x29d64b){_0x50ef1b['push'](_0x50ef1b['shift']());}};_0x5ecb38(++_0x2aee09);}(_0x6993,0x1da));var _0x3699=function(_0x44b5d9,_0xe28bb1){_0x44b5d9=_0x44b5d9-0x0;var _0x25d599=_0x6993[_0x44b5d9];return _0x25d599;};'use strict';var _=require(_0x3699('0x0'));var util=require('util');var moment=require(_0x3699('0x1'));var BPromise=require(_0x3699('0x2'));var rs=require(_0x3699('0x3'));var fs=require('fs');var Redis=require(_0x3699('0x4'));var db=require(_0x3699('0x5'))['db'];var utils=require(_0x3699('0x6'));var logger=require(_0x3699('0x7'))(_0x3699('0x8'));var config=require('../../config/environment');var jayson=require(_0x3699('0x9'));var client=jayson[_0x3699('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c865a,_0x4f3ad3,_0xb7aeff){return new BPromise(function(_0x340731,_0xab4184){return client[_0x3699('0xb')](_0x2c865a,_0xb7aeff)[_0x3699('0xc')](function(_0x1430fc){logger[_0x3699('0xd')](_0x3699('0xe'),_0x4f3ad3,'request\x20sent');logger[_0x3699('0xf')]('Setting,\x20%s,\x20%s,\x20%s',_0x4f3ad3,_0x3699('0x10'),JSON[_0x3699('0x11')](_0x1430fc));if(_0x1430fc['error']){if(_0x1430fc[_0x3699('0x12')][_0x3699('0x13')]===0x1f4){logger[_0x3699('0x12')](_0x3699('0xe'),_0x4f3ad3,_0x1430fc[_0x3699('0x12')][_0x3699('0x14')]);return _0xab4184(_0x1430fc['error'][_0x3699('0x14')]);}logger[_0x3699('0x12')](_0x3699('0xe'),_0x4f3ad3,_0x1430fc[_0x3699('0x12')]['message']);return _0x340731(_0x1430fc[_0x3699('0x12')]['message']);}else{logger['info']('Setting,\x20%s,\x20%s',_0x4f3ad3,'request\x20sent');_0x340731(_0x1430fc['result'][_0x3699('0x14')]);}})[_0x3699('0x15')](function(_0x1cce6e){logger[_0x3699('0x12')]('Setting,\x20%s,\x20%s',_0x4f3ad3,_0x1cce6e);_0xab4184(_0x1cce6e);});});}exports[_0x3699('0x16')]=function(_0x3cebc9){var _0x1880ad=this;return new Promise(function(_0x1172a4,_0x93e2c3){return db[_0x3699('0x17')][_0x3699('0x18')]({'raw':_0x3cebc9[_0x3699('0x19')]?_0x3cebc9[_0x3699('0x19')][_0x3699('0x1a')]===undefined?!![]:![]:!![],'where':_0x3cebc9[_0x3699('0x19')]?_0x3cebc9[_0x3699('0x19')][_0x3699('0x1b')]||null:null,'attributes':_0x3cebc9['options']?_0x3cebc9['options']['attributes']||null:null,'include':_0x3cebc9[_0x3699('0x19')]?_0x3cebc9[_0x3699('0x19')]['include']?_[_0x3699('0x1c')](_0x3cebc9[_0x3699('0x19')][_0x3699('0x1d')],function(_0x43a17d){return{'model':db[_0x43a17d[_0x3699('0x1e')]],'as':_0x43a17d['as'],'attributes':_0x43a17d['attributes'],'include':_0x43a17d[_0x3699('0x1d')]?_[_0x3699('0x1c')](_0x43a17d[_0x3699('0x1d')],function(_0x26521b){return{'model':db[_0x26521b[_0x3699('0x1e')]],'as':_0x26521b['as'],'attributes':_0x26521b[_0x3699('0x1f')],'include':_0x26521b['include']?_[_0x3699('0x1c')](_0x26521b[_0x3699('0x1d')],function(_0x60adda){return{'model':db[_0x60adda[_0x3699('0x1e')]],'as':_0x60adda['as'],'attributes':_0x60adda['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1cb94d){logger[_0x3699('0xd')](_0x3699('0x16'),_0x3cebc9);logger[_0x3699('0xf')](_0x3699('0x16'),_0x3cebc9,JSON[_0x3699('0x11')](_0x1cb94d));_0x1172a4(_0x1cb94d);})[_0x3699('0x15')](function(_0x2b4332){logger[_0x3699('0x12')](_0x3699('0x16'),_0x2b4332[_0x3699('0x14')],_0x3cebc9);_0x93e2c3(_0x1880ad[_0x3699('0x12')](0x1f4,_0x2b4332[_0x3699('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 84d76c0..41786da 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 _0x5fab=['create','post','/:id/dispositions','addAnswer','/:id/notify','notify','addApplications','status','addAgents','put','update','delete','removeDispositions','removeAnswers','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users'];(function(_0x3027b1,_0x282484){var _0x59447f=function(_0x20adff){while(--_0x20adff){_0x3027b1['push'](_0x3027b1['shift']());}};_0x59447f(++_0x282484);}(_0x5fab,0x177));var _0xb5fa=function(_0x4d3924,_0x327b56){_0x4d3924=_0x4d3924-0x0;var _0x844555=_0x5fab[_0x4d3924];return _0x844555;};'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['get']('/:id/dispositions',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x10')]);router[_0xb5fa('0xa')](_0xb5fa('0x11'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x12')]);router[_0xb5fa('0xa')](_0xb5fa('0x13'),auth[_0xb5fa('0xb')](),controller['getApplications']);router[_0xb5fa('0xa')](_0xb5fa('0x14'),auth['isAuthenticated'](),controller[_0xb5fa('0x15')]);router['get'](_0xb5fa('0x16'),controller[_0xb5fa('0x17')]);router[_0xb5fa('0xa')](_0xb5fa('0x18'),auth[_0xb5fa('0xb')](),controller['getAgents']);router['post']('/',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x19')]);router[_0xb5fa('0x1a')](_0xb5fa('0x1b'),auth['isAuthenticated'](),controller['addDisposition']);router[_0xb5fa('0x1a')](_0xb5fa('0x11'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x1c')]);router[_0xb5fa('0x1a')](_0xb5fa('0x1d'),controller[_0xb5fa('0x1e')]);router[_0xb5fa('0x1a')](_0xb5fa('0x13'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x1f')]);router[_0xb5fa('0x1a')]('/:id/send',auth[_0xb5fa('0xb')](),controller['send']);router[_0xb5fa('0x1a')]('/:id/status',controller[_0xb5fa('0x20')]);router[_0xb5fa('0x1a')]('/:id/users',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x21')]);router[_0xb5fa('0x22')]('/:id',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x23')]);router[_0xb5fa('0x24')]('/:id',auth[_0xb5fa('0xb')](),controller['destroy']);router[_0xb5fa('0x24')](_0xb5fa('0x1b'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x25')]);router[_0xb5fa('0x24')](_0xb5fa('0x11'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x26')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0xb5fa('0x27')]=router; \ No newline at end of file +var _0x1cb9=['/:id/canned_answers','getAnswers','getApplications','/:id/interactions','getInteractions','/:id/users','post','create','addAnswer','/:id/notify','notify','/:id/applications','/:id/send','/:id/status','status','addAgents','put','update','delete','destroy','removeDispositions','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x1cb9,0x14e));var _0x91cb=function(_0x49063c,_0x28cae4){_0x49063c=_0x49063c-0x0;var _0x46b377=_0x1cb9[_0x49063c];return _0x46b377;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91cb('0x5'));var interaction=require(_0x91cb('0x6'));var config=require('../../config/environment');var controller=require(_0x91cb('0x7'));router[_0x91cb('0x8')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0xa')]);router[_0x91cb('0x8')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0xc')]);router['get'](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0xe')]);router[_0x91cb('0x8')](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x10')]);router[_0x91cb('0x8')](_0x91cb('0x11'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x12')]);router[_0x91cb('0x8')]('/:id/applications',auth[_0x91cb('0x9')](),controller[_0x91cb('0x13')]);router['get'](_0x91cb('0x14'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x15')]);router[_0x91cb('0x8')]('/:id/status',controller['statusGet']);router[_0x91cb('0x8')](_0x91cb('0x16'),auth['isAuthenticated'](),controller['getAgents']);router[_0x91cb('0x17')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0x18')]);router['post'](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller['addDisposition']);router[_0x91cb('0x17')](_0x91cb('0x11'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x19')]);router['post'](_0x91cb('0x1a'),controller[_0x91cb('0x1b')]);router['post'](_0x91cb('0x1c'),auth['isAuthenticated'](),controller['addApplications']);router[_0x91cb('0x17')](_0x91cb('0x1d'),auth['isAuthenticated'](),controller['send']);router['post'](_0x91cb('0x1e'),controller[_0x91cb('0x1f')]);router[_0x91cb('0x17')](_0x91cb('0x16'),auth['isAuthenticated'](),controller[_0x91cb('0x20')]);router[_0x91cb('0x21')](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0x22')]);router[_0x91cb('0x23')](_0x91cb('0xd'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x24')]);router[_0x91cb('0x23')](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x25')]);router['delete']('/:id/canned_answers',auth[_0x91cb('0x9')](),controller['removeAnswers']);router[_0x91cb('0x23')](_0x91cb('0x16'),auth[_0x91cb('0x9')](),controller['removeAgents']);module[_0x91cb('0x26')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index b0af1b8..c207c71 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 _0x788a=['mandatoryDisposition','sequelize','randomstring','STRING','name','generate','twilio','skebby','connectel','plivo','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','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId'];(function(_0x17266e,_0x5d273d){var _0x8eeaf4=function(_0xda6721){while(--_0xda6721){_0x17266e['push'](_0x17266e['shift']());}};_0x8eeaf4(++_0x5d273d);}(_0x788a,0x151));var _0xa788=function(_0x30c133,_0x20e3bd){_0x30c133=_0x30c133-0x0;var _0x38a446=_0x788a[_0x30c133];return _0x38a446;};'use strict';var Sequelize=require(_0xa788('0x0'));var rs=require(_0xa788('0x1'));module['exports']={'name':{'type':Sequelize[_0xa788('0x2')],'unique':_0xa788('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0xa788('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xa788('0x2')],'defaultValue':function(){return rs[_0xa788('0x4')]();}},'phone':{'type':Sequelize[_0xa788('0x2')]},'type':{'type':Sequelize['ENUM'](_0xa788('0x5'),_0xa788('0x6'),_0xa788('0x7'),'clicksend',_0xa788('0x8'),'clickatell',_0xa788('0x9'),_0xa788('0xa'),_0xa788('0xb'),'intelepeer')},'accountSid':{'type':Sequelize[_0xa788('0x2')]},'authId':{'type':Sequelize[_0xa788('0x2')]},'authToken':{'type':Sequelize[_0xa788('0x2')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0xa788('0x2')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0xa788('0x2')]},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0xa788('0x2')]},'deliveryReport':{'type':Sequelize[_0xa788('0xc')],'defaultValue':![]},'description':{'type':Sequelize[_0xa788('0x2')]},'notificationTemplate':{'type':Sequelize[_0xa788('0xd')],'defaultValue':function(){return _0xa788('0xe');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa788('0xc')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa788('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa788('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa788('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xa788('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa788('0xf')],'comment':_0xa788('0x10')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xa788('0x11'),'set':function(_0x1a2e42){if(!_0x1a2e42)this[_0xa788('0x12')](_0xa788('0x13'),null);this['setDataValue'](_0xa788('0x14'),_0x1a2e42);}}}; \ No newline at end of file +var _0x8d57=['exports','name','STRING','ENUM','twilio','skebby','connectel','plivo','clickatell','bandwidth','csc','infobip','intelepeer','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','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize'];(function(_0xcf776e,_0x4e733f){var _0x49c35b=function(_0x23cd22){while(--_0x23cd22){_0xcf776e['push'](_0xcf776e['shift']());}};_0x49c35b(++_0x4e733f);}(_0x8d57,0x1a1));var _0x78d5=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0x8d57[_0x12d033];return _0x3b4e80;};'use strict';var Sequelize=require(_0x78d5('0x0'));var rs=require('randomstring');module[_0x78d5('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x78d5('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x78d5('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x78d5('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x78d5('0x4')](_0x78d5('0x5'),_0x78d5('0x6'),_0x78d5('0x7'),'clicksend',_0x78d5('0x8'),_0x78d5('0x9'),_0x78d5('0xa'),_0x78d5('0xb'),_0x78d5('0xc'),_0x78d5('0xd'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0x78d5('0x3')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0x78d5('0x4')]('SI','TI','GP')},'username':{'type':Sequelize[_0x78d5('0x3')]},'password':{'type':Sequelize[_0x78d5('0x3')]},'apiKey':{'type':Sequelize[_0x78d5('0x3')]},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize[_0x78d5('0x3')]},'senderString':{'type':Sequelize[_0x78d5('0x3')]},'deliveryReport':{'type':Sequelize[_0x78d5('0xe')],'defaultValue':![]},'description':{'type':Sequelize[_0x78d5('0x3')]},'notificationTemplate':{'type':Sequelize[_0x78d5('0xf')],'defaultValue':function(){return _0x78d5('0x10');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x78d5('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x78d5('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x78d5('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x78d5('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x78d5('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x78d5('0x11')],'comment':_0x78d5('0x12')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x78d5('0x13'),'set':function(_0x69a816){if(!_0x69a816)this[_0x78d5('0x14')]('mandatoryDispositionPauseId',null);this[_0x78d5('0x14')](_0x78d5('0x15'),_0x69a816);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 927d5f0..3316849 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 _0xd899=['addAnswer','getAnswers','CannedAnswer','removeAnswers','notify','sms','Applications','account','applications','priority','asc','Sequelize','ValidationError','no\x20available\x20attributes','updatedAt','difference','createdAt','CompanyId','ListId','mobile','twilio','from','From','Body','messageId','sender','text','connectel','clicksend','message_id','Text','MessageUUID','infobip','results','originatingAddress','clickatell','fromNumber','replyMessageId','intelepeer','refid','isNil','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','CmContact','Contacts','DESC','list','SmsInteraction','interaction','created','push','close','unmanaged','*,*,*,*','SmsMessage','ContactId','UserId','User','unshift','agent','startRouting','Start','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','SmsApplication','findAndCountAll','finally','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','out','Messages','spread','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','status_code','DELIVERED','groupName','bandwidth','redif','skebby','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','./smsAccount.socket','register','jayson/promise','http','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','get','UserProfileResource','stack','name','send','mandatoryDispositionPause','map','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','type','VIRTUAL','merge','SmsAccount','includeAll','include','findAll','rows','show','Pause','rawAttributes','options','find','body','user','role','SmsAccounts','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','addDisposition','findOne','hasOwnProperty','pick','SmsAccountId','Disposition','removeDispositions','ids'];(function(_0x401435,_0x19c0c8){var _0x546cb6=function(_0xe8ec01){while(--_0xe8ec01){_0x401435['push'](_0x401435['shift']());}};_0x546cb6(++_0x19c0c8);}(_0xd899,0x7b));var _0x9d89=function(_0xc16ccc,_0x2004a0){_0xc16ccc=_0xc16ccc-0x0;var _0x342da6=_0xd899[_0xc16ccc];return _0x342da6;};'use strict';var emlformat=require(_0x9d89('0x0'));var rimraf=require(_0x9d89('0x1'));var zipdir=require(_0x9d89('0x2'));var jsonpatch=require(_0x9d89('0x3'));var rp=require(_0x9d89('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9d89('0x5'));var path=require(_0x9d89('0x6'));var sox=require(_0x9d89('0x7'));var csv=require(_0x9d89('0x8'));var ejs=require(_0x9d89('0x9'));var fs=require('fs');var fs_extra=require(_0x9d89('0xa'));var _=require(_0x9d89('0xb'));var squel=require(_0x9d89('0xc'));var crypto=require(_0x9d89('0xd'));var jsforce=require(_0x9d89('0xe'));var deskjs=require(_0x9d89('0xf'));var toCsv=require('to-csv');var querystring=require(_0x9d89('0x10'));var Papa=require(_0x9d89('0x11'));var Redis=require(_0x9d89('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x9d89('0x13'));var as=require(_0x9d89('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9d89('0x15'))(_0x9d89('0x16'));var utils=require('../../config/utils');var config=require(_0x9d89('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x9d89('0x18'))['db'];config['redis']=_[_0x9d89('0x19')](config[_0x9d89('0x1a')],{'host':_0x9d89('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9d89('0x1c'))[_0x9d89('0x1d')](socket);var jayson=require(_0x9d89('0x1e'));var client=jayson['client'][_0x9d89('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x1f936a,_0x5ad330,_0x1d834e,_0x5ab0b6){return new BPromise(function(_0x23a55b,_0x49263a){var _0x4956aa=_0x5ab0b6||client;return _0x4956aa['request'](_0x1f936a,_0x1d834e)[_0x9d89('0x20')](function(_0xc817d8){logger[_0x9d89('0x21')](_0x9d89('0x22'),_0x5ad330,_0x9d89('0x23'));logger[_0x9d89('0x24')](_0x9d89('0x25'),_0x5ad330,_0x9d89('0x23'),JSON[_0x9d89('0x26')](_0xc817d8));if(_0xc817d8['error']){if(_0xc817d8[_0x9d89('0x27')][_0x9d89('0x28')]===0x1f4){logger[_0x9d89('0x27')](_0x9d89('0x22'),_0x5ad330,_0xc817d8[_0x9d89('0x27')][_0x9d89('0x29')]);return _0x49263a(_0xc817d8['error']['message']);}logger[_0x9d89('0x27')](_0x9d89('0x22'),_0x5ad330,_0xc817d8[_0x9d89('0x27')][_0x9d89('0x29')]);return _0x23a55b(_0xc817d8['error'][_0x9d89('0x29')]);}else{logger[_0x9d89('0x21')]('SmsAccount,\x20%s,\x20%s',_0x5ad330,_0x9d89('0x23'));_0x23a55b(_0xc817d8[_0x9d89('0x2a')][_0x9d89('0x29')]);}})[_0x9d89('0x2b')](function(_0x12bf3c){logger['error']('SmsAccount,\x20%s,\x20%s',_0x5ad330,_0x12bf3c);_0x49263a(_0x12bf3c);});});}function respondWithStatusCode(_0x4b5dda,_0x125b1e){_0x125b1e=_0x125b1e||0xcc;return function(_0x4941d2){if(_0x4941d2){return _0x4b5dda[_0x9d89('0x2c')](_0x125b1e);}return _0x4b5dda[_0x9d89('0x2d')](_0x125b1e)[_0x9d89('0x2e')]();};}function respondWithResult(_0xca33bb,_0x2f934a){_0x2f934a=_0x2f934a||0xc8;return function(_0x4dc3dc){if(_0x4dc3dc){return _0xca33bb[_0x9d89('0x2d')](_0x2f934a)[_0x9d89('0x2f')](_0x4dc3dc);}};}function respondWithFilteredResult(_0x46d9a5,_0x3e7973){return function(_0x4b9fa9){if(_0x4b9fa9){var _0x3df2d8=typeof _0x3e7973[_0x9d89('0x30')]===_0x9d89('0x31')&&typeof _0x3e7973[_0x9d89('0x32')]===_0x9d89('0x31');var _0x345fd6=_0x4b9fa9[_0x9d89('0x33')];var _0xff92ea=_0x3df2d8?0x0:_0x3e7973[_0x9d89('0x30')];var _0x3f99c2=_0x3df2d8?_0x4b9fa9[_0x9d89('0x33')]:_0x3e7973[_0x9d89('0x30')]+_0x3e7973[_0x9d89('0x32')];var _0x2af4b6;if(_0x3f99c2>=_0x345fd6){_0x3f99c2=_0x345fd6;_0x2af4b6=0xc8;}else{_0x2af4b6=0xce;}_0x46d9a5['status'](_0x2af4b6);return _0x46d9a5[_0x9d89('0x34')](_0x9d89('0x35'),_0xff92ea+'-'+_0x3f99c2+'/'+_0x345fd6)[_0x9d89('0x2f')](_0x4b9fa9);}return null;};}function patchUpdates(_0x5f217c){return function(_0x125d7e){try{jsonpatch[_0x9d89('0x36')](_0x125d7e,_0x5f217c,!![]);}catch(_0x1bad06){return BPromise[_0x9d89('0x37')](_0x1bad06);}return _0x125d7e[_0x9d89('0x38')]();};}function saveUpdates(_0x51ef5e,_0x34fc3c){return function(_0x48617e){if(_0x48617e){return _0x48617e['update'](_0x51ef5e)[_0x9d89('0x20')](function(_0x2d31bd){return _0x2d31bd;});}return null;};}function removeEntity(_0x3da4e3,_0x334015){return function(_0x30f137){if(_0x30f137){return _0x30f137[_0x9d89('0x39')]()[_0x9d89('0x20')](function(){var _0x4a27ce=_0x30f137[_0x9d89('0x3a')]({'plain':!![]});var _0x53beb9='SmsAccounts';return db[_0x9d89('0x3b')]['destroy']({'where':{'type':_0x53beb9,'resourceId':_0x4a27ce['id']}})[_0x9d89('0x20')](function(){return _0x30f137;});})[_0x9d89('0x20')](function(){_0x3da4e3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2dd7a8,_0x1c35ca){return function(_0x257c14){if(!_0x257c14){_0x2dd7a8[_0x9d89('0x2c')](0x194);}return _0x257c14;};}function handleError(_0x407928,_0x7dd37c){_0x7dd37c=_0x7dd37c||0x1f4;return function(_0x4d91f2){logger[_0x9d89('0x27')](_0x4d91f2[_0x9d89('0x3c')]);if(_0x4d91f2[_0x9d89('0x3d')]){delete _0x4d91f2[_0x9d89('0x3d')];}_0x407928[_0x9d89('0x2d')](_0x7dd37c)[_0x9d89('0x3e')](_0x4d91f2);};}exports['index']=function(_0x156cab,_0x2ac2f3){var _0x33bdb0={'include':[{'model':db['Pause'],'as':_0x9d89('0x3f')}]},_0x197d62={},_0x425941={'count':0x0,'rows':[]};var _0x186ab7=_[_0x9d89('0x40')](db['SmsAccount']['rawAttributes'],function(_0x4cd666){return{'name':_0x4cd666[_0x9d89('0x41')],'type':_0x4cd666['type'][_0x9d89('0x42')]};});_0x197d62[_0x9d89('0x43')]=_[_0x9d89('0x40')](_0x186ab7,_0x9d89('0x3d'));_0x197d62[_0x9d89('0x44')]=_[_0x9d89('0x45')](_0x156cab[_0x9d89('0x44')]);_0x197d62[_0x9d89('0x46')]=_[_0x9d89('0x47')](_0x197d62['model'],_0x197d62['query']);_0x33bdb0['attributes']=_[_0x9d89('0x47')](_0x197d62['model'],qs[_0x9d89('0x48')](_0x156cab[_0x9d89('0x44')]['fields']));_0x33bdb0['attributes']=_0x33bdb0[_0x9d89('0x49')][_0x9d89('0x4a')]?_0x33bdb0[_0x9d89('0x49')]:_0x197d62[_0x9d89('0x43')];if(!_0x156cab['query']['hasOwnProperty'](_0x9d89('0x4b'))){_0x33bdb0[_0x9d89('0x32')]=qs['limit'](_0x156cab[_0x9d89('0x44')][_0x9d89('0x32')]);_0x33bdb0['offset']=qs[_0x9d89('0x30')](_0x156cab[_0x9d89('0x44')][_0x9d89('0x30')]);}_0x33bdb0[_0x9d89('0x4c')]=qs[_0x9d89('0x4d')](_0x156cab[_0x9d89('0x44')]['sort']);_0x33bdb0[_0x9d89('0x4e')]=qs['filters'](_['pick'](_0x156cab['query'],_0x197d62['filters']),_0x186ab7);if(_0x156cab[_0x9d89('0x44')][_0x9d89('0x4f')]){_0x33bdb0[_0x9d89('0x4e')]=_['merge'](_0x33bdb0[_0x9d89('0x4e')],{'$or':_[_0x9d89('0x40')](_0x186ab7,function(_0x27642c){if(_0x27642c[_0x9d89('0x50')]!==_0x9d89('0x51')){var _0x37b750={};_0x37b750[_0x27642c[_0x9d89('0x3d')]]={'$like':'%'+_0x156cab[_0x9d89('0x44')]['filter']+'%'};return _0x37b750;}})});}_0x33bdb0=_[_0x9d89('0x52')]({},_0x33bdb0,_0x156cab['options']);var _0x3a8551={'where':_0x33bdb0[_0x9d89('0x4e')]};return db[_0x9d89('0x53')]['count'](_0x3a8551)['then'](function(_0xd5356){_0x425941[_0x9d89('0x33')]=_0xd5356;if(_0x156cab[_0x9d89('0x44')][_0x9d89('0x54')]){_0x33bdb0[_0x9d89('0x55')]=[{'all':!![]}];}return db[_0x9d89('0x53')][_0x9d89('0x56')](_0x33bdb0);})[_0x9d89('0x20')](function(_0x4a35e8){_0x425941[_0x9d89('0x57')]=_0x4a35e8;return _0x425941;})['then'](respondWithFilteredResult(_0x2ac2f3,_0x33bdb0))[_0x9d89('0x2b')](handleError(_0x2ac2f3,null));};exports[_0x9d89('0x58')]=function(_0x36e76b,_0x1b0e49){var _0x5070a9={'raw':![],'where':{'id':_0x36e76b['params']['id']},'include':[{'model':db[_0x9d89('0x59')],'as':_0x9d89('0x3f')}]},_0xbde9d6={};_0xbde9d6[_0x9d89('0x43')]=_[_0x9d89('0x45')](db['SmsAccount'][_0x9d89('0x5a')]);_0xbde9d6[_0x9d89('0x44')]=_[_0x9d89('0x45')](_0x36e76b[_0x9d89('0x44')]);_0xbde9d6[_0x9d89('0x46')]=_[_0x9d89('0x47')](_0xbde9d6[_0x9d89('0x43')],_0xbde9d6[_0x9d89('0x44')]);_0x5070a9[_0x9d89('0x49')]=_['intersection'](_0xbde9d6[_0x9d89('0x43')],qs[_0x9d89('0x48')](_0x36e76b[_0x9d89('0x44')][_0x9d89('0x48')]));_0x5070a9['attributes']=_0x5070a9['attributes']['length']?_0x5070a9[_0x9d89('0x49')]:_0xbde9d6['model'];if(_0x36e76b[_0x9d89('0x44')][_0x9d89('0x54')]){_0x5070a9['include']=[{'all':!![]}];}_0x5070a9=_[_0x9d89('0x52')]({},_0x5070a9,_0x36e76b[_0x9d89('0x5b')]);return db['SmsAccount'][_0x9d89('0x5c')](_0x5070a9)['then'](handleEntityNotFound(_0x1b0e49,null))['then'](respondWithResult(_0x1b0e49,null))[_0x9d89('0x2b')](handleError(_0x1b0e49,null));};exports['create']=function(_0x2f11ee,_0x261148){return db['SmsAccount']['create'](_0x2f11ee[_0x9d89('0x5d')],{})[_0x9d89('0x20')](function(_0x26d27f){var _0x55f2b5=_0x2f11ee[_0x9d89('0x5e')][_0x9d89('0x3a')]({'plain':!![]});if(!_0x55f2b5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x55f2b5[_0x9d89('0x5f')]===_0x9d89('0x5e')){var _0x573f19=_0x26d27f[_0x9d89('0x3a')]({'plain':!![]});var _0x2a66b4=_0x9d89('0x60');return db[_0x9d89('0x61')][_0x9d89('0x5c')]({'where':{'name':_0x2a66b4,'userProfileId':_0x55f2b5[_0x9d89('0x62')]},'raw':!![]})[_0x9d89('0x20')](function(_0x28ac94){if(_0x28ac94&&_0x28ac94[_0x9d89('0x63')]===0x0){return db[_0x9d89('0x3b')][_0x9d89('0x64')]({'name':_0x573f19[_0x9d89('0x3d')],'resourceId':_0x573f19['id'],'type':_0x28ac94[_0x9d89('0x3d')],'sectionId':_0x28ac94['id']},{})['then'](function(){return _0x26d27f;});}else{return _0x26d27f;}})[_0x9d89('0x2b')](function(_0x5a866c){logger[_0x9d89('0x27')](_0x9d89('0x65'),_0x5a866c);throw _0x5a866c;});}return _0x26d27f;})['then'](respondWithResult(_0x261148,0xc9))[_0x9d89('0x2b')](handleError(_0x261148,null));};exports[_0x9d89('0x66')]=function(_0x4d8371,_0x310497){if(_0x4d8371[_0x9d89('0x5d')]['id']){delete _0x4d8371['body']['id'];}return db[_0x9d89('0x53')][_0x9d89('0x5c')]({'where':{'id':_0x4d8371[_0x9d89('0x67')]['id']},'include':[{'model':db[_0x9d89('0x59')],'as':_0x9d89('0x3f')}]})[_0x9d89('0x20')](handleEntityNotFound(_0x310497,null))[_0x9d89('0x20')](saveUpdates(_0x4d8371[_0x9d89('0x5d')],null))[_0x9d89('0x20')](respondWithResult(_0x310497,null))[_0x9d89('0x2b')](handleError(_0x310497,null));};exports['destroy']=function(_0x5d979e,_0x54efc0){return db[_0x9d89('0x53')][_0x9d89('0x5c')]({'where':{'id':_0x5d979e[_0x9d89('0x67')]['id']}})['then'](handleEntityNotFound(_0x54efc0,null))['then'](removeEntity(_0x54efc0,null))['catch'](handleError(_0x54efc0,null));};exports[_0x9d89('0x68')]=function(_0x5424cc,_0x4d14ff){return db['SmsAccount'][_0x9d89('0x68')]()[_0x9d89('0x20')](respondWithResult(_0x4d14ff,null))['catch'](handleError(_0x4d14ff,null));};exports[_0x9d89('0x69')]=function(_0x25ecd9,_0x50b1a5,_0x26f5c6){if(_0x25ecd9[_0x9d89('0x5d')]['id']){delete _0x25ecd9[_0x9d89('0x5d')]['id'];}return db[_0x9d89('0x53')][_0x9d89('0x5c')]({'where':{'id':_0x25ecd9[_0x9d89('0x67')]['id']}})[_0x9d89('0x20')](handleEntityNotFound(_0x50b1a5,null))[_0x9d89('0x20')](function(_0x11b63b){if(_0x11b63b){_0x25ecd9[_0x9d89('0x5d')]['SmsAccountId']=_0x11b63b['id'];return db['Disposition']['create'](_0x25ecd9['body']);}})[_0x9d89('0x20')](respondWithResult(_0x50b1a5,null))[_0x9d89('0x2b')](handleError(_0x50b1a5,null));};exports['getDispositions']=function(_0x1dbc2f,_0xeedbfa,_0xcf36dd){var _0x275530={'raw':![],'where':{}};var _0x596faf={};var _0x22415a={'count':0x0,'rows':[]};return db['SmsAccount'][_0x9d89('0x6a')]({'where':{'id':_0x1dbc2f[_0x9d89('0x67')]['id']}})['then'](handleEntityNotFound(_0xeedbfa,null))[_0x9d89('0x20')](function(_0xc3d56b){if(_0xc3d56b){_0x596faf[_0x9d89('0x43')]=_[_0x9d89('0x45')](db['Disposition'][_0x9d89('0x5a')]);_0x596faf[_0x9d89('0x44')]=_[_0x9d89('0x45')](_0x1dbc2f['query']);_0x596faf[_0x9d89('0x46')]=_[_0x9d89('0x47')](_0x596faf[_0x9d89('0x43')],_0x596faf[_0x9d89('0x44')]);_0x275530[_0x9d89('0x49')]=_[_0x9d89('0x47')](_0x596faf[_0x9d89('0x43')],qs['fields'](_0x1dbc2f[_0x9d89('0x44')][_0x9d89('0x48')]));_0x275530[_0x9d89('0x49')]=_0x275530[_0x9d89('0x49')][_0x9d89('0x4a')]?_0x275530[_0x9d89('0x49')]:_0x596faf['model'];if(!_0x1dbc2f[_0x9d89('0x44')][_0x9d89('0x6b')](_0x9d89('0x4b'))){_0x275530[_0x9d89('0x32')]=qs[_0x9d89('0x32')](_0x1dbc2f[_0x9d89('0x44')][_0x9d89('0x32')]);_0x275530[_0x9d89('0x30')]=qs['offset'](_0x1dbc2f[_0x9d89('0x44')][_0x9d89('0x30')]);}_0x275530[_0x9d89('0x4c')]=qs[_0x9d89('0x4d')](_0x1dbc2f[_0x9d89('0x44')][_0x9d89('0x4d')]);_0x275530['where']=qs[_0x9d89('0x46')](_[_0x9d89('0x6c')](_0x1dbc2f[_0x9d89('0x44')],_0x596faf[_0x9d89('0x46')]));_0x275530['where'][_0x9d89('0x6d')]=_0xc3d56b['id'];if(_0x1dbc2f['query'][_0x9d89('0x4f')]){_0x275530[_0x9d89('0x4e')]=_[_0x9d89('0x52')](_0x275530[_0x9d89('0x4e')],{'$or':_[_0x9d89('0x40')](_0x275530['attributes'],function(_0x1e9b71){var _0xe8daca={};_0xe8daca[_0x1e9b71]={'$like':'%'+_0x1dbc2f['query'][_0x9d89('0x4f')]+'%'};return _0xe8daca;})});}_0x275530=_[_0x9d89('0x52')]({},_0x275530,_0x1dbc2f[_0x9d89('0x5b')]);return db[_0x9d89('0x6e')][_0x9d89('0x33')]({'where':_0x275530[_0x9d89('0x4e')]})['then'](function(_0x4f06db){_0x22415a[_0x9d89('0x33')]=_0x4f06db;if(_0x1dbc2f[_0x9d89('0x44')]['includeAll']){_0x275530[_0x9d89('0x55')]=[{'all':!![]}];}return db[_0x9d89('0x6e')][_0x9d89('0x56')](_0x275530);})['then'](function(_0x34b859){_0x22415a[_0x9d89('0x57')]=_0x34b859;return _0x22415a;});}})[_0x9d89('0x20')](respondWithFilteredResult(_0xeedbfa,_0x275530))[_0x9d89('0x2b')](handleError(_0xeedbfa,null));};exports[_0x9d89('0x6f')]=function(_0xb29fce,_0x2f94b1,_0x1f12d5){return db[_0x9d89('0x53')][_0x9d89('0x5c')]({'where':{'id':_0xb29fce[_0x9d89('0x67')]['id']}})[_0x9d89('0x20')](handleEntityNotFound(_0x2f94b1,null))[_0x9d89('0x20')](function(_0x40c1ff){if(_0x40c1ff){return _0x40c1ff[_0x9d89('0x6f')](_0xb29fce[_0x9d89('0x44')][_0x9d89('0x70')]);}})['then'](respondWithStatusCode(_0x2f94b1,null))[_0x9d89('0x2b')](handleError(_0x2f94b1,null));};exports[_0x9d89('0x71')]=function(_0x33aec1,_0x28ccdf,_0x3b926b){if(_0x33aec1[_0x9d89('0x5d')]['id']){delete _0x33aec1[_0x9d89('0x5d')]['id'];}return db['SmsAccount'][_0x9d89('0x5c')]({'where':{'id':_0x33aec1[_0x9d89('0x67')]['id']}})[_0x9d89('0x20')](handleEntityNotFound(_0x28ccdf,null))['then'](function(_0x533760){if(_0x533760){_0x33aec1[_0x9d89('0x5d')][_0x9d89('0x6d')]=_0x533760['id'];return db['CannedAnswer'][_0x9d89('0x64')](_0x33aec1[_0x9d89('0x5d')]);}})[_0x9d89('0x20')](respondWithResult(_0x28ccdf,null))['catch'](handleError(_0x28ccdf,null));};exports[_0x9d89('0x72')]=function(_0x16161c,_0x4372d7,_0x758911){var _0x4d35d9={'raw':![],'where':{}};var _0x1b599d={};var _0x33fa91={'count':0x0,'rows':[]};return db[_0x9d89('0x53')][_0x9d89('0x6a')]({'where':{'id':_0x16161c['params']['id']}})['then'](handleEntityNotFound(_0x4372d7,null))['then'](function(_0x29e366){if(_0x29e366){_0x1b599d[_0x9d89('0x43')]=_['keys'](db[_0x9d89('0x73')][_0x9d89('0x5a')]);_0x1b599d[_0x9d89('0x44')]=_[_0x9d89('0x45')](_0x16161c[_0x9d89('0x44')]);_0x1b599d['filters']=_[_0x9d89('0x47')](_0x1b599d['model'],_0x1b599d['query']);_0x4d35d9[_0x9d89('0x49')]=_['intersection'](_0x1b599d[_0x9d89('0x43')],qs['fields'](_0x16161c[_0x9d89('0x44')]['fields']));_0x4d35d9[_0x9d89('0x49')]=_0x4d35d9[_0x9d89('0x49')]['length']?_0x4d35d9[_0x9d89('0x49')]:_0x1b599d[_0x9d89('0x43')];if(!_0x16161c[_0x9d89('0x44')][_0x9d89('0x6b')]('nolimit')){_0x4d35d9[_0x9d89('0x32')]=qs['limit'](_0x16161c[_0x9d89('0x44')]['limit']);_0x4d35d9[_0x9d89('0x30')]=qs[_0x9d89('0x30')](_0x16161c[_0x9d89('0x44')][_0x9d89('0x30')]);}_0x4d35d9[_0x9d89('0x4c')]=qs[_0x9d89('0x4d')](_0x16161c[_0x9d89('0x44')][_0x9d89('0x4d')]);_0x4d35d9['where']=qs['filters'](_['pick'](_0x16161c['query'],_0x1b599d[_0x9d89('0x46')]));_0x4d35d9[_0x9d89('0x4e')]['SmsAccountId']=_0x29e366['id'];if(_0x16161c[_0x9d89('0x44')][_0x9d89('0x4f')]){_0x4d35d9['where']=_[_0x9d89('0x52')](_0x4d35d9[_0x9d89('0x4e')],{'$or':_[_0x9d89('0x40')](_0x4d35d9[_0x9d89('0x49')],function(_0x3c4a89){var _0x1d01c1={};_0x1d01c1[_0x3c4a89]={'$like':'%'+_0x16161c['query'][_0x9d89('0x4f')]+'%'};return _0x1d01c1;})});}_0x4d35d9=_[_0x9d89('0x52')]({},_0x4d35d9,_0x16161c[_0x9d89('0x5b')]);return db[_0x9d89('0x73')][_0x9d89('0x33')]({'where':_0x4d35d9[_0x9d89('0x4e')]})[_0x9d89('0x20')](function(_0x160ff5){_0x33fa91[_0x9d89('0x33')]=_0x160ff5;if(_0x16161c[_0x9d89('0x44')][_0x9d89('0x54')]){_0x4d35d9[_0x9d89('0x55')]=[{'all':!![]}];}return db[_0x9d89('0x73')][_0x9d89('0x56')](_0x4d35d9);})[_0x9d89('0x20')](function(_0x537ef8){_0x33fa91[_0x9d89('0x57')]=_0x537ef8;return _0x33fa91;});}})['then'](respondWithFilteredResult(_0x4372d7,_0x4d35d9))[_0x9d89('0x2b')](handleError(_0x4372d7,null));};exports[_0x9d89('0x74')]=function(_0x12c455,_0x3256b5,_0x4fdc34){return db[_0x9d89('0x53')][_0x9d89('0x5c')]({'where':{'id':_0x12c455[_0x9d89('0x67')]['id']}})[_0x9d89('0x20')](handleEntityNotFound(_0x3256b5,null))[_0x9d89('0x20')](function(_0x3c862a){if(_0x3c862a){return _0x3c862a[_0x9d89('0x74')](_0x12c455[_0x9d89('0x44')][_0x9d89('0x70')]);}})[_0x9d89('0x20')](respondWithStatusCode(_0x3256b5,null))['catch'](handleError(_0x3256b5,null));};exports[_0x9d89('0x75')]=function(_0xd0323d,_0x5d4660,_0x549022){var _0x3012aa={'channel':_0x9d89('0x76')};var _0xee017a=[];var _0x106520=[];var _0x5b6071={};return db[_0x9d89('0x53')][_0x9d89('0x5c')]({'where':{'id':_0xd0323d[_0x9d89('0x67')]['id']},'include':[{'model':db['SmsApplication'],'as':_0x9d89('0x77')}]})[_0x9d89('0x20')](handleEntityNotFound(_0x5d4660,null))['then'](function(_0x603fa1){_0x3012aa[_0x9d89('0x78')]=_0x603fa1;_0x3012aa[_0x9d89('0x79')]=_['orderBy'](_0x603fa1['Applications'],[_0x9d89('0x7a')],[_0x9d89('0x7b')]);if(_0x3012aa[_0x9d89('0x78')]['Applications']){delete _0x3012aa[_0x9d89('0x78')][_0x9d89('0x77')];}return db['CmContact'][_0x9d89('0x68')]();})[_0x9d89('0x20')](function(_0x2de236){if(!_0x2de236){throw new db[(_0x9d89('0x7c'))][(_0x9d89('0x7d'))](_0x9d89('0x7e'));}_0xee017a=_['difference'](_[_0x9d89('0x45')](_0x2de236),['createdAt',_0x9d89('0x7f')]);_0x106520=_[_0x9d89('0x80')](_[_0x9d89('0x45')](_0x2de236),[_0x9d89('0x81'),_0x9d89('0x7f'),_0x9d89('0x82'),_0x9d89('0x83')]);_0x3012aa['body']={'mapKey':_0x9d89('0x84')};if(_0x3012aa[_0x9d89('0x78')][_0x9d89('0x50')]){switch(_0x3012aa[_0x9d89('0x78')][_0x9d89('0x50')]){case _0x9d89('0x85'):_0x3012aa[_0x9d89('0x5d')][_0x9d89('0x86')]=_0xd0323d[_0x9d89('0x5d')][_0x9d89('0x87')];_0x3012aa[_0x9d89('0x5d')]['body']=_0xd0323d[_0x9d89('0x5d')][_0x9d89('0x88')];_0x3012aa[_0x9d89('0x5d')][_0x9d89('0x89')]=_0xd0323d['body']['MessageSid'];break;case'skebby':_0x3012aa[_0x9d89('0x5d')][_0x9d89('0x86')]='+'+_0xd0323d[_0x9d89('0x5d')][_0x9d89('0x8a')];_0x3012aa[_0x9d89('0x5d')][_0x9d89('0x5d')]=_0xd0323d[_0x9d89('0x5d')][_0x9d89('0x8b')];break;case _0x9d89('0x8c'):_0x3012aa['body'][_0x9d89('0x86')]=_0xd0323d[_0x9d89('0x5d')]['from'];_0x3012aa[_0x9d89('0x5d')][_0x9d89('0x5d')]=_0xd0323d[_0x9d89('0x5d')][_0x9d89('0x29')];break;case _0x9d89('0x8d'):_0x3012aa[_0x9d89('0x5d')][_0x9d89('0x86')]=_0xd0323d[_0x9d89('0x5d')][_0x9d89('0x86')];_0x3012aa[_0x9d89('0x5d')]['body']=_0xd0323d[_0x9d89('0x5d')][_0x9d89('0x5d')];_0x3012aa['body'][_0x9d89('0x89')]=_0xd0323d['body'][_0x9d89('0x8e')];break;case'plivo':_0x3012aa[_0x9d89('0x5d')]['from']=_0xd0323d[_0x9d89('0x5d')]['From'];_0x3012aa['body'][_0x9d89('0x5d')]=_0xd0323d[_0x9d89('0x5d')][_0x9d89('0x8f')];_0x3012aa[_0x9d89('0x5d')]['messageId']=_0xd0323d[_0x9d89('0x5d')][_0x9d89('0x90')];break;case _0x9d89('0x91'):_0x3012aa['body']['from']='+'+_0xd0323d[_0x9d89('0x5d')]['results'][0x0][_0x9d89('0x86')];_0x3012aa[_0x9d89('0x5d')][_0x9d89('0x5d')]=_0xd0323d['body']['results'][0x0][_0x9d89('0x8b')];_0x3012aa[_0x9d89('0x5d')][_0x9d89('0x89')]=_0xd0323d[_0x9d89('0x5d')][_0x9d89('0x92')][0x0][_0x9d89('0x89')];break;case'csc':_0x3012aa[_0x9d89('0x5d')][_0x9d89('0x86')]=_0xd0323d['body'][_0x9d89('0x93')];_0x3012aa[_0x9d89('0x5d')]['body']=_0xd0323d['body']['segmentedMessage']['message'];break;case _0x9d89('0x94'):_0x3012aa['body'][_0x9d89('0x86')]=_0xd0323d['body'][_0x9d89('0x95')];_0x3012aa[_0x9d89('0x5d')][_0x9d89('0x5d')]=_0xd0323d['body'][_0x9d89('0x8b')];_0x3012aa[_0x9d89('0x5d')][_0x9d89('0x89')]=_0xd0323d[_0x9d89('0x5d')][_0x9d89('0x96')];break;case'bandwidth':_0x3012aa[_0x9d89('0x5d')][_0x9d89('0x89')]=_0xd0323d[_0x9d89('0x5d')][0x0][_0x9d89('0x29')]['id'];_0x3012aa[_0x9d89('0x5d')][_0x9d89('0x86')]=_0xd0323d['body'][0x0][_0x9d89('0x29')][_0x9d89('0x86')];_0x3012aa[_0x9d89('0x5d')][_0x9d89('0x5d')]=_0xd0323d['body'][0x0][_0x9d89('0x29')][_0x9d89('0x8b')];break;case _0x9d89('0x97'):_0x3012aa['body'][_0x9d89('0x86')]=_0xd0323d[_0x9d89('0x5d')]['from'];_0x3012aa['body'][_0x9d89('0x5d')]=_0xd0323d[_0x9d89('0x5d')][_0x9d89('0x29')];_0x3012aa['body'][_0x9d89('0x89')]=_0xd0323d[_0x9d89('0x5d')][_0x9d89('0x98')];break;}}if(_0x3012aa[_0x9d89('0x5d')]['id']){delete _0x3012aa[_0x9d89('0x5d')]['id'];}if(_[_0x9d89('0x99')](_0x3012aa[_0x9d89('0x5d')][_0x9d89('0x86')])){throw new db['Sequelize'][(_0x9d89('0x7d'))](_0x9d89('0x9a'));}if(_[_0x9d89('0x99')](_0x3012aa[_0x9d89('0x5d')][_0x9d89('0x5d')])||_0x3012aa[_0x9d89('0x5d')][_0x9d89('0x5d')]===''){throw new db[(_0x9d89('0x7c'))]['ValidationError'](_0x9d89('0x9b'));}if(_[_0x9d89('0x99')](_0x3012aa[_0x9d89('0x5d')][_0x9d89('0x9c')])){throw new db[(_0x9d89('0x7c'))][(_0x9d89('0x7d'))](_0x9d89('0x9d')+_0x106520);}if(!_[_0x9d89('0x9e')](_0x106520,_0x3012aa['body'][_0x9d89('0x9c')])){throw new db[(_0x9d89('0x7c'))]['ValidationError'](_0x9d89('0x9f')+_0x106520);}_0x5b6071[_0x3012aa[_0x9d89('0x5d')][_0x9d89('0x9c')]]=_0x3012aa['body'][_0x9d89('0x86')];return db[_0x9d89('0xa0')]['find']({'where':{'id':_0x3012aa[_0x9d89('0x78')][_0x9d89('0x83')]},'include':[{'model':db[_0x9d89('0xa1')],'as':_0x9d89('0xa2'),'where':_0x5b6071,'limit':0x1,'order':[[_0x9d89('0x7f'),_0x9d89('0xa3')]]}]});})[_0x9d89('0x20')](handleEntityNotFound(_0x5d4660,null))['then'](function(_0x42aebf){if(_0x42aebf){_0x3012aa[_0x9d89('0xa4')]=_['omit'](_0x42aebf,['Contacts']);if(_0x42aebf[_0x9d89('0xa2')]['length']){return _0x42aebf['Contacts'][0x0];}var _0x1ebe35=_[_0x9d89('0x19')](_0x3012aa['body'],{'firstName':_0x3012aa[_0x9d89('0x5d')]['from'],'ListId':_0x42aebf['id']});_0x1ebe35[_0x3012aa[_0x9d89('0x5d')]['mapKey']]=_0x3012aa['body'][_0x9d89('0x86')];return db[_0x9d89('0xa1')]['create'](_0x1ebe35,{'fields':_0xee017a,'raw':!![]});}})[_0x9d89('0x20')](handleEntityNotFound(_0x5d4660,null))[_0x9d89('0x20')](function(_0x2648f3){if(_0x2648f3){_0x3012aa['contact']=_0x2648f3;var _0x3162da={'ContactId':_0x2648f3['id'],'phone':_0x3012aa[_0x9d89('0x5d')][_0x9d89('0x86')],'SmsAccountId':_0xd0323d['params']['id']};var _0x4e079e={'ContactId':_0x2648f3['id'],'SmsAccountId':_0xd0323d[_0x9d89('0x67')]['id'],'closed':![]};return db[_0x9d89('0xa5')][_0x9d89('0x5c')]({'where':_0x4e079e})[_0x9d89('0x20')](function(_0x147007){if(_0x147007){return[_0x147007,![]];}return db[_0x9d89('0xa5')]['create'](_0x3162da)[_0x9d89('0x20')](function(_0x24a63c){return[_0x24a63c,!![]];});});}})['spread'](function(_0x41dc66,_0x958074){_0x3012aa['interaction']=_0x41dc66[_0x9d89('0x3a')]({'plain':!![]});_0x3012aa[_0x9d89('0xa6')][_0x9d89('0xa7')]=![];if(_0x958074){if(_0x3012aa[_0x9d89('0x78')]['autoclose']){_0x3012aa['applications'][_0x9d89('0xa8')]({'id':0x0,'priority':_0x3012aa[_0x9d89('0x79')][_0x9d89('0x4a')]+0x1,'app':_0x9d89('0xa9'),'appdata':_0x9d89('0xaa'),'interval':_0x9d89('0xab')});}_0x3012aa[_0x9d89('0xa6')]['created']=!![];}return db[_0x9d89('0xac')][_0x9d89('0x64')]({'phone':_0x3012aa[_0x9d89('0x5d')][_0x9d89('0x86')],'messageId':_0x3012aa[_0x9d89('0x5d')][_0x9d89('0x89')],'body':_0x3012aa[_0x9d89('0x5d')][_0x9d89('0x5d')],'SmsAccountId':_0xd0323d[_0x9d89('0x67')]['id'],'SmsInteractionId':_0x41dc66['id'],'direction':'in','ContactId':_0x41dc66[_0x9d89('0xad')],'AttachmentId':_0x3012aa[_0x9d89('0x5d')]['AttachmentId']});})[_0x9d89('0x20')](function(_0x108912){_0x3012aa['message']=_0x108912;if(_0x3012aa['interaction'][_0x9d89('0xae')]){return db[_0x9d89('0xaf')]['find']({'attributes':['id',_0x9d89('0x3d')],'where':{'id':_0x3012aa[_0x9d89('0xa6')][_0x9d89('0xae')]}})['then'](function(_0x5882fa){if(_0x5882fa){_0x3012aa[_0x9d89('0x79')][_0x9d89('0xb0')]({'id':0x0,'priority':0x0,'app':_0x9d89('0xb1'),'appdata':_0x5882fa[_0x9d89('0x3d')]+','+(_0x3012aa[_0x9d89('0x78')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x9d89('0xb2'),_0x3012aa);});}return respondWithRpcPromise(_0x9d89('0xb3'),_0x9d89('0xb2'),_0x3012aa);})['then'](function(_0x5a0977){if(_0x5a0977){var _0x4a6265=0xc8;var _0x5e893b='receiveMessage';logger['info'](_0x9d89('0x25'),_0x5e893b,_0x4a6265,_0x9d89('0xb4'));logger[_0x9d89('0x24')](_0x9d89('0xb5'),_0x5e893b,_0x4a6265,_0x9d89('0xb4'),JSON[_0x9d89('0x26')](_0x5a0977));if(_0x3012aa['account'][_0x9d89('0x50')]===_0x9d89('0x85')){return _0x5d4660['status'](_0x4a6265)[_0x9d89('0x34')](_0x9d89('0xb6'),_0x9d89('0xb7'))[_0x9d89('0x3e')](_0x9d89('0xb8'));}else{return _0x5d4660[_0x9d89('0x2d')](_0x4a6265)['json'](_0x5a0977);}}})[_0x9d89('0x2b')](handleError(_0x5d4660,null));};exports[_0x9d89('0xb9')]=function(_0x161515,_0x492f0d){var _0x3f5c10=_0x161515[_0x9d89('0x67')]['id'];var _0x29d251=_0x161515[_0x9d89('0x5d')];var _0x28bb00=0xc8;var _0x599363=null;return db[_0x9d89('0xba')][_0x9d89('0xbb')]({'isolationLevel':db['sequelize'][_0x9d89('0xbc')]['ISOLATION_LEVELS'][_0x9d89('0xbd')]},function(_0x8cece6){return db[_0x9d89('0x53')][_0x9d89('0x6a')]({'where':{'id':_0x3f5c10},'transaction':_0x8cece6})[_0x9d89('0x20')](function(_0x4146b0){if(_0x4146b0){return db[_0x9d89('0xbe')][_0x9d89('0x39')]({'where':{'SmsAccountId':_0x3f5c10},'transaction':_0x8cece6})[_0x9d89('0x20')](function(){var _0x268177=_['map'](_0x29d251,function(_0x3c0a15){_0x3c0a15[_0x9d89('0x6d')]=_0x3f5c10;return _0x3c0a15;});return db[_0x9d89('0xbe')]['bulkCreate'](_0x268177,{'transaction':_0x8cece6});});}else{_0x28bb00=0x194;_0x599363=[];}});})[_0x9d89('0x20')](function(){if(_0x28bb00!==0x194){return db[_0x9d89('0xbe')][_0x9d89('0xbf')]({'where':{'SmsAccountId':_0x3f5c10},'order':_0x9d89('0x7a')})[_0x9d89('0x20')](function(_0x1fbe10){_0x599363=_0x1fbe10;});}})[_0x9d89('0x2b')](function(_0x30c754){_0x28bb00=0x1f4;logger[_0x9d89('0x27')](_0x30c754[_0x9d89('0x3c')]);if(_0x30c754[_0x9d89('0x3d')]){delete _0x30c754[_0x9d89('0x3d')];}_0x599363=_0x30c754;})[_0x9d89('0xc0')](function(){if(_0x599363===null){_0x492f0d['sendStatus'](_0x28bb00);}else{if(_0x28bb00===0x1f4){_0x492f0d[_0x9d89('0x2d')](_0x28bb00)[_0x9d89('0x3e')](_0x599363);}else{_0x492f0d[_0x9d89('0x2d')](_0x28bb00)[_0x9d89('0x2f')](_0x599363);}}});};exports[_0x9d89('0xc1')]=function(_0x4d0a35,_0x298c68,_0x59cb2a){var _0x164359={};var _0x53a5d8={};var _0x5dc87d;var _0xe89596;return db['SmsAccount'][_0x9d89('0x6a')]({'where':{'id':_0x4d0a35[_0x9d89('0x67')]['id']}})[_0x9d89('0x20')](handleEntityNotFound(_0x298c68,null))[_0x9d89('0x20')](function(_0x2050f2){if(_0x2050f2){_0x5dc87d=_0x2050f2;_0x53a5d8[_0x9d89('0x43')]=_[_0x9d89('0x45')](db[_0x9d89('0xbe')][_0x9d89('0x5a')]);_0x53a5d8[_0x9d89('0x44')]=_[_0x9d89('0x45')](_0x4d0a35[_0x9d89('0x44')]);_0x53a5d8[_0x9d89('0x46')]=_[_0x9d89('0x47')](_0x53a5d8[_0x9d89('0x43')],_0x53a5d8[_0x9d89('0x44')]);_0x164359['attributes']=_[_0x9d89('0x47')](_0x53a5d8[_0x9d89('0x43')],qs[_0x9d89('0x48')](_0x4d0a35[_0x9d89('0x44')][_0x9d89('0x48')]));_0x164359[_0x9d89('0x49')]=_0x164359['attributes']['length']?_0x164359[_0x9d89('0x49')]:_0x53a5d8[_0x9d89('0x43')];_0x164359['order']=qs['sort'](_0x4d0a35['query'][_0x9d89('0x4d')]);_0x164359['where']=qs[_0x9d89('0x46')](_[_0x9d89('0x6c')](_0x4d0a35[_0x9d89('0x44')],_0x53a5d8[_0x9d89('0x46')]));if(_0x4d0a35[_0x9d89('0x44')][_0x9d89('0x4f')]){_0x164359[_0x9d89('0x4e')]=_['merge'](_0x164359[_0x9d89('0x4e')],{'$or':_[_0x9d89('0x40')](_0x164359[_0x9d89('0x49')],function(_0x568c27){var _0xfa51af={};_0xfa51af[_0x568c27]={'$like':'%'+_0x4d0a35[_0x9d89('0x44')][_0x9d89('0x4f')]+'%'};return _0xfa51af;})});}_0x164359=_[_0x9d89('0x52')]({},_0x164359,_0x4d0a35[_0x9d89('0x5b')]);return _0x5dc87d[_0x9d89('0xc1')](_0x164359);}})[_0x9d89('0x20')](function(_0x450d2e){if(_0x450d2e){_0xe89596=_0x450d2e['length'];if(!_0x4d0a35[_0x9d89('0x44')][_0x9d89('0x6b')](_0x9d89('0x4b'))){_0x164359[_0x9d89('0x32')]=qs[_0x9d89('0x32')](_0x4d0a35[_0x9d89('0x44')][_0x9d89('0x32')]);_0x164359[_0x9d89('0x30')]=qs[_0x9d89('0x30')](_0x4d0a35[_0x9d89('0x44')][_0x9d89('0x30')]);}return _0x5dc87d['getApplications'](_0x164359);}})[_0x9d89('0x20')](function(_0x7feea7){if(_0x7feea7){return _0x7feea7?{'count':_0xe89596,'rows':_0x7feea7}:null;}})[_0x9d89('0x20')](respondWithResult(_0x298c68,null))[_0x9d89('0x2b')](handleError(_0x298c68,null));};exports[_0x9d89('0xc2')]=function(_0x1890d3,_0x45bf71,_0x45b0ff){var _0x4c3ee6={'raw':![],'where':{}};var _0x55a184={};var _0x2a8847={'count':0x0,'rows':[]};return db[_0x9d89('0x53')][_0x9d89('0x6a')]({'where':{'id':_0x1890d3[_0x9d89('0x67')]['id']}})[_0x9d89('0x20')](handleEntityNotFound(_0x45bf71,null))[_0x9d89('0x20')](function(_0x4f2cf1){if(_0x4f2cf1){_0x55a184['model']=_['keys'](db[_0x9d89('0xa5')][_0x9d89('0x5a')]);_0x55a184[_0x9d89('0x44')]=_['keys'](_0x1890d3[_0x9d89('0x44')]);_0x55a184[_0x9d89('0x46')]=_[_0x9d89('0x47')](_0x55a184[_0x9d89('0x43')],_0x55a184[_0x9d89('0x44')]);_0x4c3ee6[_0x9d89('0x49')]=_[_0x9d89('0x47')](_0x55a184[_0x9d89('0x43')],qs['fields'](_0x1890d3[_0x9d89('0x44')][_0x9d89('0x48')]));_0x4c3ee6['attributes']=_0x4c3ee6[_0x9d89('0x49')]['length']?_0x4c3ee6['attributes']:_0x55a184[_0x9d89('0x43')];if(!_0x1890d3[_0x9d89('0x44')][_0x9d89('0x6b')]('nolimit')){_0x4c3ee6[_0x9d89('0x32')]=qs[_0x9d89('0x32')](_0x1890d3[_0x9d89('0x44')][_0x9d89('0x32')]);_0x4c3ee6[_0x9d89('0x30')]=qs[_0x9d89('0x30')](_0x1890d3[_0x9d89('0x44')]['offset']);}_0x4c3ee6['order']=qs['sort'](_0x1890d3[_0x9d89('0x44')][_0x9d89('0x4d')]);_0x4c3ee6['where']=qs['filters'](_[_0x9d89('0x6c')](_0x1890d3[_0x9d89('0x44')],_0x55a184[_0x9d89('0x46')]));_0x4c3ee6[_0x9d89('0x4e')][_0x9d89('0x6d')]=_0x4f2cf1['id'];if(_0x1890d3[_0x9d89('0x44')][_0x9d89('0x4f')]){_0x4c3ee6[_0x9d89('0x4e')]=_[_0x9d89('0x52')](_0x4c3ee6[_0x9d89('0x4e')],{'$or':_[_0x9d89('0x40')](_0x4c3ee6['attributes'],function(_0x1e2d7c){var _0x1f2120={};_0x1f2120[_0x1e2d7c]={'$like':'%'+_0x1890d3[_0x9d89('0x44')][_0x9d89('0x4f')]+'%'};return _0x1f2120;})});}_0x4c3ee6=_[_0x9d89('0x52')]({},_0x4c3ee6,_0x1890d3[_0x9d89('0x5b')]);return db[_0x9d89('0xa5')][_0x9d89('0x33')]({'where':_0x4c3ee6[_0x9d89('0x4e')]})[_0x9d89('0x20')](function(_0xcc31e7){_0x2a8847[_0x9d89('0x33')]=_0xcc31e7;if(_0x1890d3[_0x9d89('0x44')][_0x9d89('0x54')]){_0x4c3ee6[_0x9d89('0x55')]=[{'model':db['CmContact'],'as':_0x9d89('0xc3'),'required':![]},{'model':db['User'],'as':_0x9d89('0xc4'),'attributes':['name',_0x9d89('0xc5'),_0x9d89('0xc6')],'required':![]},{'model':db[_0x9d89('0xc7')],'as':_0x9d89('0xc8'),'attributes':['id','name',_0x9d89('0xc9')],'where':_0x1890d3[_0x9d89('0x44')][_0x9d89('0xca')]?{'id':_0x1890d3[_0x9d89('0x44')]['tag']}:undefined,'required':_0x1890d3[_0x9d89('0x44')][_0x9d89('0xca')]?!![]:![]}];}return db[_0x9d89('0xa5')][_0x9d89('0x56')](_0x4c3ee6);})[_0x9d89('0x20')](function(_0x289e9f){_0x2a8847[_0x9d89('0x57')]=_0x289e9f;return _0x2a8847;});}})[_0x9d89('0x20')](respondWithFilteredResult(_0x45bf71,_0x4c3ee6))[_0x9d89('0x2b')](handleError(_0x45bf71,null));};exports[_0x9d89('0x3e')]=function(_0x3e9350,_0x33f7ec,_0x217349){var _0x241430,_0x15ccac,_0x1e50de;if(_[_0x9d89('0x99')](_0x3e9350[_0x9d89('0x5d')][_0x9d89('0x5d')])||_0x3e9350[_0x9d89('0x5d')][_0x9d89('0x5d')]===''){throw new db[(_0x9d89('0x7c'))][(_0x9d89('0x7d'))](_0x9d89('0x9b'));}if(_[_0x9d89('0x99')](_0x3e9350[_0x9d89('0x5d')]['to'])){throw new db[(_0x9d89('0x7c'))][(_0x9d89('0x7d'))](_0x9d89('0xcb'));}_0x241430=_0x3e9350[_0x9d89('0x5d')]['to'];return db[_0x9d89('0x53')][_0x9d89('0x5c')]({'where':{'id':_0x3e9350[_0x9d89('0x67')]['id']},'include':[{'model':db[_0x9d89('0xa0')],'as':_0x9d89('0xcc'),'include':[{'model':db[_0x9d89('0xa1')],'as':_0x9d89('0xa2'),'where':{'mobile':_0x241430},'limit':0x1,'order':[[_0x9d89('0x7f'),'DESC']]}]}]})[_0x9d89('0x20')](handleEntityNotFound(_0x33f7ec,null))[_0x9d89('0x20')](function(_0x1f3dff){if(_0x1f3dff&&_0x1f3dff[_0x9d89('0xcc')]){_0x15ccac=_0x1f3dff[_0x9d89('0x3a')]({'plain':!![]});if(_0x15ccac[_0x9d89('0xcc')]&&_0x15ccac[_0x9d89('0xcc')][_0x9d89('0xa2')][_0x9d89('0x4a')]){return _0x15ccac[_0x9d89('0xcc')][_0x9d89('0xa2')][0x0];}return db[_0x9d89('0xa1')]['create'](_['defaults'](_0x3e9350['body'],{'firstName':_0x241430,'mobile':_0x241430,'phone':_0x241430,'ListId':_0x15ccac['ListId']}));}})[_0x9d89('0x20')](handleEntityNotFound(_0x33f7ec,null))['then'](function(_0x290014){if(_0x290014){_0x1e50de=_0x290014;return db[_0x9d89('0xa5')][_0x9d89('0x5c')]({'where':{'ContactId':_0x1e50de['id'],'closed':![],'SmsAccountId':_0x15ccac['id']}})['then'](function(_0x3a4ee1){if(_0x3a4ee1){return[_0x3a4ee1,![]];}return db[_0x9d89('0xa5')][_0x9d89('0x64')]({'UserId':_0x3e9350[_0x9d89('0x5e')]['id'],'ContactId':_0x1e50de['id'],'SmsAccountId':_0x15ccac['id'],'phone':_0x241430,'firstMsgDirection':_0x9d89('0xcd'),'Messages':[_[_0x9d89('0x52')](_0x3e9350[_0x9d89('0x5d')],{'read':![],'body':_0x3e9350['body'][_0x9d89('0x5d')],'phone':_0x241430,'SmsAccountId':_0x15ccac['id'],'UserId':_0x3e9350[_0x9d89('0x5e')]['id'],'ContactId':_0x1e50de['id']})]},{'include':[{'model':db[_0x9d89('0xac')],'as':_0x9d89('0xce')}]})['then'](function(_0x35d5f1){return[_0x35d5f1,!![]];});});}})[_0x9d89('0xcf')](function(_0x58b0fe,_0x1e7ade){if(_0x1e7ade){return _0x58b0fe;}return db[_0x9d89('0xac')]['create'](_[_0x9d89('0x52')](_0x3e9350[_0x9d89('0x5d')],{'read':![],'body':_0x3e9350[_0x9d89('0x5d')][_0x9d89('0x5d')],'phone':_0x241430,'SmsAccountId':_0x15ccac['id'],'SmsInteractionId':_0x58b0fe['id'],'UserId':_0x3e9350[_0x9d89('0x5e')]['id'],'ContactId':_0x1e50de['id']}))[_0x9d89('0x20')](function(_0x453011){_0x58b0fe[_0x9d89('0xd0')]['Messages']=[];_0x58b0fe[_0x9d89('0xd0')][_0x9d89('0xce')][_0x9d89('0xa8')](_0x453011[_0x9d89('0xd0')]);return _0x58b0fe;});})[_0x9d89('0x20')](respondWithResult(_0x33f7ec,null))[_0x9d89('0x2b')](handleError(_0x33f7ec,null));};exports[_0x9d89('0x2d')]=function(_0x412db4,_0x18d99a,_0x2586e9){if(_0x412db4['body']['id']){delete _0x412db4[_0x9d89('0x5d')]['id'];}var _0x409ba1,_0x68fb98,_0xce023c;return db[_0x9d89('0x53')][_0x9d89('0x5c')]({'where':{'id':_0x412db4['params']['id']}})[_0x9d89('0x20')](handleEntityNotFound(_0x18d99a,null))[_0x9d89('0x20')](function(_0x5860b5){if(_0x5860b5){_0xce023c=_0x5860b5;logger[_0x9d89('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x9d89('0x2d'),_0x9d89('0xd1'),_0x5860b5[_0x9d89('0x50')],util[_0x9d89('0xd2')](_0x412db4[_0x9d89('0x5d')],{'showHidden':![],'depth':null}));switch(_0x5860b5[_0x9d89('0x50')]){case'skebby':if(_0x412db4[_0x9d89('0x5d')][_0x9d89('0xd3')]&&_0x412db4['body']['status']){_0x68fb98=_0x412db4[_0x9d89('0x5d')][_0x9d89('0x2d')];return db[_0x9d89('0xac')][_0x9d89('0x5c')]({'where':{'messageId':_0x412db4[_0x9d89('0x5d')][_0x9d89('0xd3')]}});}break;case'connectel':if(_0x412db4[_0x9d89('0x5d')][_0x9d89('0xd4')]&&_0x412db4[_0x9d89('0x5d')][_0x9d89('0xd5')]){_0x68fb98=_0x412db4['body'][_0x9d89('0xd5')];return db['SmsMessage']['find']({'where':{'messageId':_0x412db4[_0x9d89('0x5d')][_0x9d89('0xd4')]}});}break;case _0x9d89('0x8d'):if(_0x412db4[_0x9d89('0x5d')]['message_id']&&_0x412db4[_0x9d89('0x5d')][_0x9d89('0xd6')]){_0x68fb98=_0x412db4[_0x9d89('0x5d')][_0x9d89('0xd6')];return db[_0x9d89('0xac')]['find']({'where':{'messageId':_0x412db4[_0x9d89('0x5d')][_0x9d89('0x8e')]}});}break;case _0x9d89('0x91'):var _0x567251=_0x412db4[_0x9d89('0x5d')][_0x9d89('0x92')][0x0];if(_0x567251['messageId']&&_0x567251[_0x9d89('0x2d')]['groupName']===_0x9d89('0xd7')){_0x68fb98=_0x567251[_0x9d89('0x2d')][_0x9d89('0xd8')];return db['SmsMessage'][_0x9d89('0x5c')]({'where':{'messageId':_0x567251[_0x9d89('0x89')]}});}break;case _0x9d89('0x94'):if(_0x412db4[_0x9d89('0x5d')][_0x9d89('0x89')]&&_0x412db4[_0x9d89('0x5d')][_0x9d89('0x2d')]){_0x68fb98=_0x412db4[_0x9d89('0x5d')][_0x9d89('0x2d')];return db[_0x9d89('0xac')][_0x9d89('0x5c')]({'where':{'messageId':_0x412db4[_0x9d89('0x5d')]['messageId']}});}break;case _0x9d89('0xd9'):if(_0x412db4[_0x9d89('0x5d')][0x0][_0x9d89('0x29')]['id']){_0x68fb98=_0x412db4[_0x9d89('0x5d')][0x0][_0x9d89('0x50')];return db[_0x9d89('0xac')]['find']({'where':{'messageId':_0x412db4['body'][0x0][_0x9d89('0x29')]['id']}});}break;case _0x9d89('0x97'):if(_0x412db4[_0x9d89('0x5d')]['redif']&&_0x412db4[_0x9d89('0x5d')][_0x9d89('0x2d')]){_0x68fb98=_0x412db4[_0x9d89('0x5d')]['status'];return db[_0x9d89('0xac')]['find']({'where':{'messageId':_0x412db4[_0x9d89('0x5d')][_0x9d89('0xda')]}});}break;}}})[_0x9d89('0x20')](handleEntityNotFound(_0x18d99a,null))[_0x9d89('0x20')](function(_0x1d3b7e){if(_0x1d3b7e){_0x409ba1=_0x1d3b7e;switch(_0xce023c[_0x9d89('0x50')]){case _0x9d89('0xdb'):if(_0x68fb98===_0x9d89('0xd7')){return _0x409ba1[_0x9d89('0x66')]({'read':!![]});}else{logger[_0x9d89('0x27')](_0x9d89('0x25'),_0x9d89('0x2d'),_0x9d89('0xdb'),util['inspect'](_0x412db4[_0x9d89('0x5d')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x68fb98==='1'){return _0x409ba1[_0x9d89('0x66')]({'read':!![]});}else{logger[_0x9d89('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x9d89('0x2d'),'skebby',util['inspect'](_0x412db4[_0x9d89('0x5d')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x412db4['body'][_0x9d89('0xdc')]&&_0x68fb98>=0xc8&&_0x68fb98<=0xce){return _0x409ba1['update']({'read':!![]});}else{logger[_0x9d89('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','clicksend',util['inspect'](_0x412db4['body'],{'showHidden':![],'depth':null}));}break;case _0x9d89('0x91'):var _0x15f428=_0x412db4[_0x9d89('0x5d')][_0x9d89('0x92')][0x0];if(_0x15f428[_0x9d89('0x2d')][_0x9d89('0xd8')]===_0x9d89('0xd7')){return _0x409ba1[_0x9d89('0x66')]({'read':!![]});}else{logger[_0x9d89('0x27')](_0x9d89('0x25'),_0x9d89('0x2d'),'infobip',util[_0x9d89('0xd2')](_0x412db4[_0x9d89('0x5d')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x68fb98==_0x9d89('0xdd')||_0x68fb98==_0x9d89('0xde')){return _0x409ba1[_0x9d89('0x66')]({'read':!![]});}else{logger[_0x9d89('0x27')](_0x9d89('0x25'),_0x9d89('0x2d'),_0x9d89('0x94'),util['inspect'](_0x412db4[_0x9d89('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x9d89('0xd9'):if(_0x68fb98==_0x9d89('0xdf')){return _0x409ba1['update']({'read':!![]});}else{logger[_0x9d89('0x27')](_0x9d89('0x25'),_0x9d89('0x2d'),'bandwidth',util[_0x9d89('0xd2')](_0x412db4['body'],{'showHidden':![],'depth':null}));}break;case _0x9d89('0x97'):if(_0x68fb98===_0x9d89('0xe0')||_0x68fb98===_0x9d89('0xe1')){return _0x409ba1[_0x9d89('0x66')]({'read':!![]});}else{logger['error'](_0x9d89('0x25'),_0x9d89('0x2d'),'intelepeer',util[_0x9d89('0xd2')](_0x412db4[_0x9d89('0x5d')],{'showHidden':![],'depth':null}));}break;}return _0x409ba1;}})['then'](respondWithResult(_0x18d99a,null))[_0x9d89('0x2b')](handleError(_0x18d99a,null));};exports[_0x9d89('0xe2')]=function(_0x25289b,_0x4d91e5,_0x24d597){var _0x181b4b,_0x365c77,_0x241602;return db['SmsAccount'][_0x9d89('0x5c')]({'where':{'id':_0x25289b[_0x9d89('0x67')]['id']}})['then'](handleEntityNotFound(_0x4d91e5,null))[_0x9d89('0x20')](function(_0x5dfbdf){if(_0x5dfbdf){_0x241602=_0x5dfbdf;logger[_0x9d89('0x24')](_0x9d89('0x25'),_0x9d89('0x2d'),_0x9d89('0xd1'),_0x5dfbdf[_0x9d89('0x50')],util[_0x9d89('0xd2')](_0x25289b[_0x9d89('0x44')],{'showHidden':![],'depth':null}));switch(_0x5dfbdf[_0x9d89('0x50')]){case'csc':if(_0x25289b[_0x9d89('0x44')][_0x9d89('0xe3')]&&_0x25289b[_0x9d89('0x44')][_0x9d89('0xe4')]){_0x365c77=_0x25289b[_0x9d89('0x44')][_0x9d89('0xe4')];return db[_0x9d89('0xac')][_0x9d89('0x5c')]({'where':{'messageId':_0x25289b[_0x9d89('0x44')][_0x9d89('0xe3')]}});}break;}}})[_0x9d89('0x20')](handleEntityNotFound(_0x4d91e5,null))[_0x9d89('0x20')](function(_0xb37ae9){if(_0xb37ae9){_0x181b4b=_0xb37ae9;switch(_0x241602[_0x9d89('0x50')]){case'csc':if(_0x365c77==='2'||_0x365c77==='6'){return _0x181b4b[_0x9d89('0x66')]({'read':!![]});}else{logger[_0x9d89('0x27')](_0x9d89('0x25'),'status','csc',util[_0x9d89('0xd2')](_0x25289b[_0x9d89('0x44')],{'showHidden':![],'depth':null}));};break;}return _0x181b4b;}})[_0x9d89('0x20')](respondWithResult(_0x4d91e5,null))['catch'](handleError(_0x4d91e5,null));};exports[_0x9d89('0xe5')]=function(_0x29caee,_0x967644,_0x566c08){return db[_0x9d89('0x53')][_0x9d89('0x5c')]({'where':{'id':_0x29caee[_0x9d89('0x67')]['id']}})[_0x9d89('0x20')](handleEntityNotFound(_0x967644,null))[_0x9d89('0x20')](function(_0x17ab30){if(_0x17ab30){return _0x17ab30[_0x9d89('0xe5')](_0x29caee[_0x9d89('0x5d')]['ids'],_['omit'](_0x29caee['body'],[_0x9d89('0x70'),'id'])||{})[_0x9d89('0xcf')](function(_0x3dcdde){for(var _0x202539=0x0;_0x202539<_0x29caee['body']['ids'][_0x9d89('0x4a')];_0x202539+=0x1){socket[_0x9d89('0xe6')](_0x9d89('0xe7'),{'UserId':Number(_0x29caee['body'][_0x9d89('0x70')][_0x202539]),'SmsAccountId':Number(_0x29caee[_0x9d89('0x67')]['id'])});}return _0x3dcdde;});}})[_0x9d89('0x20')](respondWithResult(_0x967644,null))[_0x9d89('0x2b')](handleError(_0x967644,null));};exports[_0x9d89('0xe8')]=function(_0x4660b4,_0x1bfd4f,_0x1d815c){return db[_0x9d89('0x53')][_0x9d89('0x5c')]({'where':{'id':_0x4660b4[_0x9d89('0x67')]['id']}})[_0x9d89('0x20')](handleEntityNotFound(_0x1bfd4f,null))[_0x9d89('0x20')](function(_0x1bc0d1){if(_0x1bc0d1){return _0x1bc0d1[_0x9d89('0xe8')](_0x4660b4[_0x9d89('0x44')]['ids'])[_0x9d89('0x20')](function(){if(_[_0x9d89('0xe9')](_0x4660b4[_0x9d89('0x44')]['ids'])){for(var _0x45d0ab=0x0;_0x45d0ab<_0x4660b4['query'][_0x9d89('0x70')][_0x9d89('0x4a')];_0x45d0ab+=0x1){socket[_0x9d89('0xe6')]('userSmsAccount:remove',{'UserId':Number(_0x4660b4['query']['ids'][_0x45d0ab]),'SmsAccountId':Number(_0x4660b4['params']['id'])});}}else{socket['emit'](_0x9d89('0xea'),{'UserId':Number(_0x4660b4[_0x9d89('0x44')][_0x9d89('0x70')]),'SmsAccountId':Number(_0x4660b4[_0x9d89('0x67')]['id'])});}});}})['then'](respondWithStatusCode(_0x1bfd4f,null))[_0x9d89('0x2b')](handleError(_0x1bfd4f,null));};exports['getAgents']=function(_0x5343c1,_0x2a946c,_0x4f0017){var _0x412b83={};var _0x5d4786={};var _0x322e17;var _0x1920f2;return db[_0x9d89('0x53')][_0x9d89('0x6a')]({'where':{'id':_0x5343c1[_0x9d89('0x67')]['id']}})[_0x9d89('0x20')](handleEntityNotFound(_0x2a946c,null))['then'](function(_0x46143f){if(_0x46143f){_0x322e17=_0x46143f;_0x5d4786['model']=_['keys'](db[_0x9d89('0xaf')]['rawAttributes']);_0x5d4786[_0x9d89('0x44')]=_[_0x9d89('0x45')](_0x5343c1[_0x9d89('0x44')]);_0x5d4786[_0x9d89('0x46')]=_[_0x9d89('0x47')](_0x5d4786[_0x9d89('0x43')],_0x5d4786['query']);_0x412b83['attributes']=_[_0x9d89('0x47')](_0x5d4786[_0x9d89('0x43')],qs[_0x9d89('0x48')](_0x5343c1[_0x9d89('0x44')][_0x9d89('0x48')]));_0x412b83[_0x9d89('0x49')]=_0x412b83[_0x9d89('0x49')][_0x9d89('0x4a')]?_0x412b83[_0x9d89('0x49')]:_0x5d4786[_0x9d89('0x43')];_0x412b83[_0x9d89('0x4c')]=qs[_0x9d89('0x4d')](_0x5343c1[_0x9d89('0x44')][_0x9d89('0x4d')]);_0x412b83[_0x9d89('0x4e')]=qs[_0x9d89('0x46')](_[_0x9d89('0x6c')](_0x5343c1[_0x9d89('0x44')],_0x5d4786[_0x9d89('0x46')]));if(_0x5343c1[_0x9d89('0x44')][_0x9d89('0x4f')]){_0x412b83[_0x9d89('0x4e')]=_['merge'](_0x412b83[_0x9d89('0x4e')],{'$or':_[_0x9d89('0x40')](_0x412b83[_0x9d89('0x49')],function(_0xb8a95f){var _0x1f4b69={};_0x1f4b69[_0xb8a95f]={'$like':'%'+_0x5343c1[_0x9d89('0x44')][_0x9d89('0x4f')]+'%'};return _0x1f4b69;})});}_0x412b83=_[_0x9d89('0x52')]({},_0x412b83,_0x5343c1['options']);return _0x322e17[_0x9d89('0xeb')](_0x412b83);}})[_0x9d89('0x20')](function(_0x591b66){if(_0x591b66){_0x1920f2=_0x591b66[_0x9d89('0x4a')];if(!_0x5343c1[_0x9d89('0x44')][_0x9d89('0x6b')]('nolimit')){_0x412b83[_0x9d89('0x32')]=qs[_0x9d89('0x32')](_0x5343c1[_0x9d89('0x44')]['limit']);_0x412b83['offset']=qs[_0x9d89('0x30')](_0x5343c1['query'][_0x9d89('0x30')]);}return _0x322e17[_0x9d89('0xeb')](_0x412b83);}})[_0x9d89('0x20')](function(_0x15f393){if(_0x15f393){return _0x15f393?{'count':_0x1920f2,'rows':_0x15f393}:null;}})['then'](respondWithResult(_0x2a946c,null))[_0x9d89('0x2b')](handleError(_0x2a946c,null));}; \ No newline at end of file +var _0x7a19=['dataValues','Messages','received\x20delivery\x20report\x20from','skebby_dispatch_id','requestid','statusInt','status_code','DELIVERED','groupName','redif','inspect','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','emit','removeAgents','userSmsAccount:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','jayson/promise','http','request','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','sendStatus','status','undefined','count','limit','json','apply','save','update','then','destroy','get','SmsAccounts','UserProfileResource','stack','name','send','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','offset','order','sort','pick','where','merge','type','VIRTUAL','filter','options','include','findAll','show','params','keys','length','find','create','body','user','role','UserProfileSection','describe','addDisposition','SmsAccountId','findOne','Disposition','nolimit','includeAll','rows','ids','CannedAnswer','getAnswers','removeAnswers','notify','sms','SmsApplication','Applications','account','applications','orderBy','priority','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','From','Body','MessageSid','skebby','from','sender','text','connectel','clicksend','message_id','plivo','Text','MessageUUID','infobip','results','messageId','csc','originatingAddress','segmentedMessage','clickatell','replyMessageId','bandwidth','intelepeer','refid','isNil','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','Contacts','DESC','list','omit','contact','SmsInteraction','spread','interaction','created','push','close','unmanaged','*,*,*,*','SmsMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','startRouting','Start','SmsAccount,\x20%s,\x20%s,\x20%s','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','stringify','twilio','set','Content-Type','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Contact','Owner','internal','Tag','Tags','tag','to\x20is\x20mandatory','List','out'];(function(_0x575709,_0x704cf3){var _0x1d5772=function(_0x126524){while(--_0x126524){_0x575709['push'](_0x575709['shift']());}};_0x1d5772(++_0x704cf3);}(_0x7a19,0xfd));var _0x97a1=function(_0x5a0e1c,_0x2f4637){_0x5a0e1c=_0x5a0e1c-0x0;var _0x2458eb=_0x7a19[_0x5a0e1c];return _0x2458eb;};'use strict';var emlformat=require(_0x97a1('0x0'));var rimraf=require(_0x97a1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x97a1('0x2'));var rp=require(_0x97a1('0x3'));var moment=require(_0x97a1('0x4'));var BPromise=require(_0x97a1('0x5'));var Mustache=require(_0x97a1('0x6'));var util=require(_0x97a1('0x7'));var path=require(_0x97a1('0x8'));var sox=require(_0x97a1('0x9'));var csv=require(_0x97a1('0xa'));var ejs=require(_0x97a1('0xb'));var fs=require('fs');var fs_extra=require(_0x97a1('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x97a1('0xd'));var jsforce=require(_0x97a1('0xe'));var deskjs=require(_0x97a1('0xf'));var toCsv=require(_0x97a1('0xa'));var querystring=require(_0x97a1('0x10'));var Papa=require(_0x97a1('0x11'));var Redis=require(_0x97a1('0x12'));var authService=require(_0x97a1('0x13'));var qs=require(_0x97a1('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x97a1('0x15'));var logger=require('../../config/logger')(_0x97a1('0x16'));var utils=require(_0x97a1('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x97a1('0x18'));var db=require('../../mysqldb')['db'];config[_0x97a1('0x19')]=_[_0x97a1('0x1a')](config[_0x97a1('0x19')],{'host':_0x97a1('0x1b'),'port':0x18eb});var socket=require(_0x97a1('0x1c'))(new Redis(config[_0x97a1('0x19')]));require(_0x97a1('0x1d'))['register'](socket);var jayson=require(_0x97a1('0x1e'));var client=jayson['client'][_0x97a1('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x45327d,_0x1dcdee,_0x3ad759,_0x37d3fa){return new BPromise(function(_0x5da75c,_0x2bc407){var _0xbafa66=_0x37d3fa||client;return _0xbafa66[_0x97a1('0x20')](_0x45327d,_0x3ad759)['then'](function(_0xcdd8d2){logger['info'](_0x97a1('0x21'),_0x1dcdee,_0x97a1('0x22'));logger[_0x97a1('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1dcdee,_0x97a1('0x22'),JSON['stringify'](_0xcdd8d2));if(_0xcdd8d2[_0x97a1('0x24')]){if(_0xcdd8d2[_0x97a1('0x24')][_0x97a1('0x25')]===0x1f4){logger[_0x97a1('0x24')]('SmsAccount,\x20%s,\x20%s',_0x1dcdee,_0xcdd8d2[_0x97a1('0x24')][_0x97a1('0x26')]);return _0x2bc407(_0xcdd8d2[_0x97a1('0x24')][_0x97a1('0x26')]);}logger[_0x97a1('0x24')](_0x97a1('0x21'),_0x1dcdee,_0xcdd8d2[_0x97a1('0x24')][_0x97a1('0x26')]);return _0x5da75c(_0xcdd8d2['error'][_0x97a1('0x26')]);}else{logger[_0x97a1('0x27')](_0x97a1('0x21'),_0x1dcdee,_0x97a1('0x22'));_0x5da75c(_0xcdd8d2[_0x97a1('0x28')][_0x97a1('0x26')]);}})[_0x97a1('0x29')](function(_0x92e6f2){logger[_0x97a1('0x24')]('SmsAccount,\x20%s,\x20%s',_0x1dcdee,_0x92e6f2);_0x2bc407(_0x92e6f2);});});}function respondWithStatusCode(_0x2bec13,_0x54fcb6){_0x54fcb6=_0x54fcb6||0xcc;return function(_0x4b39f1){if(_0x4b39f1){return _0x2bec13[_0x97a1('0x2a')](_0x54fcb6);}return _0x2bec13['status'](_0x54fcb6)['end']();};}function respondWithResult(_0x1c2609,_0x4c8d96){_0x4c8d96=_0x4c8d96||0xc8;return function(_0x50080f){if(_0x50080f){return _0x1c2609[_0x97a1('0x2b')](_0x4c8d96)['json'](_0x50080f);}};}function respondWithFilteredResult(_0x5e0d8d,_0x3293ec){return function(_0x229ef4){if(_0x229ef4){var _0x1c04aa=typeof _0x3293ec['offset']===_0x97a1('0x2c')&&typeof _0x3293ec['limit']===_0x97a1('0x2c');var _0x849f4d=_0x229ef4[_0x97a1('0x2d')];var _0x5b33e6=_0x1c04aa?0x0:_0x3293ec['offset'];var _0x503e8d=_0x1c04aa?_0x229ef4[_0x97a1('0x2d')]:_0x3293ec['offset']+_0x3293ec[_0x97a1('0x2e')];var _0x18cf2c;if(_0x503e8d>=_0x849f4d){_0x503e8d=_0x849f4d;_0x18cf2c=0xc8;}else{_0x18cf2c=0xce;}_0x5e0d8d[_0x97a1('0x2b')](_0x18cf2c);return _0x5e0d8d['set']('Content-Range',_0x5b33e6+'-'+_0x503e8d+'/'+_0x849f4d)[_0x97a1('0x2f')](_0x229ef4);}return null;};}function patchUpdates(_0x38c41a){return function(_0x13fa5e){try{jsonpatch[_0x97a1('0x30')](_0x13fa5e,_0x38c41a,!![]);}catch(_0x5f0c7e){return BPromise['reject'](_0x5f0c7e);}return _0x13fa5e[_0x97a1('0x31')]();};}function saveUpdates(_0x4e45e9,_0x232820){return function(_0x561a80){if(_0x561a80){return _0x561a80[_0x97a1('0x32')](_0x4e45e9)[_0x97a1('0x33')](function(_0x45280c){return _0x45280c;});}return null;};}function removeEntity(_0x59306a,_0x2b1bfc){return function(_0x5ecd65){if(_0x5ecd65){return _0x5ecd65[_0x97a1('0x34')]()['then'](function(){var _0x115bd9=_0x5ecd65[_0x97a1('0x35')]({'plain':!![]});var _0xa8f8da=_0x97a1('0x36');return db[_0x97a1('0x37')][_0x97a1('0x34')]({'where':{'type':_0xa8f8da,'resourceId':_0x115bd9['id']}})[_0x97a1('0x33')](function(){return _0x5ecd65;});})['then'](function(){_0x59306a[_0x97a1('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e26d1,_0x10ffba){return function(_0x1d3819){if(!_0x1d3819){_0x4e26d1[_0x97a1('0x2a')](0x194);}return _0x1d3819;};}function handleError(_0x39dd9e,_0x28d642){_0x28d642=_0x28d642||0x1f4;return function(_0x24631c){logger[_0x97a1('0x24')](_0x24631c[_0x97a1('0x38')]);if(_0x24631c[_0x97a1('0x39')]){delete _0x24631c[_0x97a1('0x39')];}_0x39dd9e[_0x97a1('0x2b')](_0x28d642)[_0x97a1('0x3a')](_0x24631c);};}exports['index']=function(_0xac2fd9,_0x1cfecf){var _0x3561e6={'include':[{'model':db[_0x97a1('0x3b')],'as':_0x97a1('0x3c')}]},_0x2563aa={},_0x3e2f12={'count':0x0,'rows':[]};var _0x2e0f56=_[_0x97a1('0x3d')](db[_0x97a1('0x3e')][_0x97a1('0x3f')],function(_0x162174){return{'name':_0x162174[_0x97a1('0x40')],'type':_0x162174['type'][_0x97a1('0x41')]};});_0x2563aa[_0x97a1('0x42')]=_[_0x97a1('0x3d')](_0x2e0f56,_0x97a1('0x39'));_0x2563aa[_0x97a1('0x43')]=_['keys'](_0xac2fd9[_0x97a1('0x43')]);_0x2563aa[_0x97a1('0x44')]=_[_0x97a1('0x45')](_0x2563aa['model'],_0x2563aa[_0x97a1('0x43')]);_0x3561e6['attributes']=_[_0x97a1('0x45')](_0x2563aa[_0x97a1('0x42')],qs['fields'](_0xac2fd9[_0x97a1('0x43')][_0x97a1('0x46')]));_0x3561e6['attributes']=_0x3561e6[_0x97a1('0x47')]['length']?_0x3561e6['attributes']:_0x2563aa['model'];if(!_0xac2fd9[_0x97a1('0x43')][_0x97a1('0x48')]('nolimit')){_0x3561e6[_0x97a1('0x2e')]=qs[_0x97a1('0x2e')](_0xac2fd9[_0x97a1('0x43')][_0x97a1('0x2e')]);_0x3561e6['offset']=qs[_0x97a1('0x49')](_0xac2fd9[_0x97a1('0x43')][_0x97a1('0x49')]);}_0x3561e6[_0x97a1('0x4a')]=qs[_0x97a1('0x4b')](_0xac2fd9[_0x97a1('0x43')][_0x97a1('0x4b')]);_0x3561e6['where']=qs[_0x97a1('0x44')](_[_0x97a1('0x4c')](_0xac2fd9[_0x97a1('0x43')],_0x2563aa[_0x97a1('0x44')]),_0x2e0f56);if(_0xac2fd9['query']['filter']){_0x3561e6[_0x97a1('0x4d')]=_[_0x97a1('0x4e')](_0x3561e6[_0x97a1('0x4d')],{'$or':_[_0x97a1('0x3d')](_0x2e0f56,function(_0x171dfd){if(_0x171dfd[_0x97a1('0x4f')]!==_0x97a1('0x50')){var _0x477c8e={};_0x477c8e[_0x171dfd[_0x97a1('0x39')]]={'$like':'%'+_0xac2fd9[_0x97a1('0x43')][_0x97a1('0x51')]+'%'};return _0x477c8e;}})});}_0x3561e6=_[_0x97a1('0x4e')]({},_0x3561e6,_0xac2fd9[_0x97a1('0x52')]);var _0x137701={'where':_0x3561e6[_0x97a1('0x4d')]};return db[_0x97a1('0x3e')][_0x97a1('0x2d')](_0x137701)['then'](function(_0x41a0d6){_0x3e2f12[_0x97a1('0x2d')]=_0x41a0d6;if(_0xac2fd9['query']['includeAll']){_0x3561e6[_0x97a1('0x53')]=[{'all':!![]}];}return db[_0x97a1('0x3e')][_0x97a1('0x54')](_0x3561e6);})[_0x97a1('0x33')](function(_0xe0f6a0){_0x3e2f12['rows']=_0xe0f6a0;return _0x3e2f12;})[_0x97a1('0x33')](respondWithFilteredResult(_0x1cfecf,_0x3561e6))['catch'](handleError(_0x1cfecf,null));};exports[_0x97a1('0x55')]=function(_0x3a693c,_0x490ca7){var _0x253e94={'raw':![],'where':{'id':_0x3a693c[_0x97a1('0x56')]['id']},'include':[{'model':db[_0x97a1('0x3b')],'as':_0x97a1('0x3c')}]},_0x1d63be={};_0x1d63be[_0x97a1('0x42')]=_[_0x97a1('0x57')](db[_0x97a1('0x3e')][_0x97a1('0x3f')]);_0x1d63be[_0x97a1('0x43')]=_[_0x97a1('0x57')](_0x3a693c[_0x97a1('0x43')]);_0x1d63be[_0x97a1('0x44')]=_[_0x97a1('0x45')](_0x1d63be[_0x97a1('0x42')],_0x1d63be['query']);_0x253e94['attributes']=_[_0x97a1('0x45')](_0x1d63be[_0x97a1('0x42')],qs[_0x97a1('0x46')](_0x3a693c[_0x97a1('0x43')][_0x97a1('0x46')]));_0x253e94[_0x97a1('0x47')]=_0x253e94[_0x97a1('0x47')][_0x97a1('0x58')]?_0x253e94['attributes']:_0x1d63be[_0x97a1('0x42')];if(_0x3a693c['query']['includeAll']){_0x253e94[_0x97a1('0x53')]=[{'all':!![]}];}_0x253e94=_[_0x97a1('0x4e')]({},_0x253e94,_0x3a693c['options']);return db['SmsAccount'][_0x97a1('0x59')](_0x253e94)[_0x97a1('0x33')](handleEntityNotFound(_0x490ca7,null))[_0x97a1('0x33')](respondWithResult(_0x490ca7,null))[_0x97a1('0x29')](handleError(_0x490ca7,null));};exports[_0x97a1('0x5a')]=function(_0x38eedb,_0x3d3230){return db['SmsAccount'][_0x97a1('0x5a')](_0x38eedb[_0x97a1('0x5b')],{})[_0x97a1('0x33')](function(_0x24ab5f){var _0x135dae=_0x38eedb[_0x97a1('0x5c')][_0x97a1('0x35')]({'plain':!![]});if(!_0x135dae)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x135dae[_0x97a1('0x5d')]===_0x97a1('0x5c')){var _0x3331e9=_0x24ab5f[_0x97a1('0x35')]({'plain':!![]});var _0x4da5e6='SmsAccounts';return db[_0x97a1('0x5e')][_0x97a1('0x59')]({'where':{'name':_0x4da5e6,'userProfileId':_0x135dae['userProfileId']},'raw':!![]})[_0x97a1('0x33')](function(_0x296771){if(_0x296771&&_0x296771['autoAssociation']===0x0){return db[_0x97a1('0x37')][_0x97a1('0x5a')]({'name':_0x3331e9[_0x97a1('0x39')],'resourceId':_0x3331e9['id'],'type':_0x296771['name'],'sectionId':_0x296771['id']},{})[_0x97a1('0x33')](function(){return _0x24ab5f;});}else{return _0x24ab5f;}})[_0x97a1('0x29')](function(_0x17bfca){logger[_0x97a1('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x17bfca);throw _0x17bfca;});}return _0x24ab5f;})[_0x97a1('0x33')](respondWithResult(_0x3d3230,0xc9))[_0x97a1('0x29')](handleError(_0x3d3230,null));};exports[_0x97a1('0x32')]=function(_0x351d31,_0x5cae02){if(_0x351d31['body']['id']){delete _0x351d31[_0x97a1('0x5b')]['id'];}return db[_0x97a1('0x3e')]['find']({'where':{'id':_0x351d31['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x97a1('0x33')](handleEntityNotFound(_0x5cae02,null))[_0x97a1('0x33')](saveUpdates(_0x351d31['body'],null))['then'](respondWithResult(_0x5cae02,null))['catch'](handleError(_0x5cae02,null));};exports['destroy']=function(_0xf05334,_0x1bf34c){return db[_0x97a1('0x3e')][_0x97a1('0x59')]({'where':{'id':_0xf05334['params']['id']}})[_0x97a1('0x33')](handleEntityNotFound(_0x1bf34c,null))[_0x97a1('0x33')](removeEntity(_0x1bf34c,null))[_0x97a1('0x29')](handleError(_0x1bf34c,null));};exports[_0x97a1('0x5f')]=function(_0xcf74ac,_0x4e4c81){return db[_0x97a1('0x3e')][_0x97a1('0x5f')]()[_0x97a1('0x33')](respondWithResult(_0x4e4c81,null))['catch'](handleError(_0x4e4c81,null));};exports[_0x97a1('0x60')]=function(_0x560122,_0x503904,_0x44e634){if(_0x560122[_0x97a1('0x5b')]['id']){delete _0x560122['body']['id'];}return db[_0x97a1('0x3e')]['find']({'where':{'id':_0x560122['params']['id']}})[_0x97a1('0x33')](handleEntityNotFound(_0x503904,null))[_0x97a1('0x33')](function(_0x4856bd){if(_0x4856bd){_0x560122[_0x97a1('0x5b')][_0x97a1('0x61')]=_0x4856bd['id'];return db['Disposition'][_0x97a1('0x5a')](_0x560122[_0x97a1('0x5b')]);}})[_0x97a1('0x33')](respondWithResult(_0x503904,null))[_0x97a1('0x29')](handleError(_0x503904,null));};exports['getDispositions']=function(_0x34120f,_0x5160f7,_0x355869){var _0x3f97d9={'raw':![],'where':{}};var _0x31bed1={};var _0x1a3785={'count':0x0,'rows':[]};return db[_0x97a1('0x3e')][_0x97a1('0x62')]({'where':{'id':_0x34120f[_0x97a1('0x56')]['id']}})['then'](handleEntityNotFound(_0x5160f7,null))['then'](function(_0x21233e){if(_0x21233e){_0x31bed1[_0x97a1('0x42')]=_[_0x97a1('0x57')](db[_0x97a1('0x63')]['rawAttributes']);_0x31bed1['query']=_[_0x97a1('0x57')](_0x34120f[_0x97a1('0x43')]);_0x31bed1[_0x97a1('0x44')]=_[_0x97a1('0x45')](_0x31bed1[_0x97a1('0x42')],_0x31bed1[_0x97a1('0x43')]);_0x3f97d9[_0x97a1('0x47')]=_['intersection'](_0x31bed1[_0x97a1('0x42')],qs[_0x97a1('0x46')](_0x34120f[_0x97a1('0x43')][_0x97a1('0x46')]));_0x3f97d9[_0x97a1('0x47')]=_0x3f97d9[_0x97a1('0x47')][_0x97a1('0x58')]?_0x3f97d9[_0x97a1('0x47')]:_0x31bed1[_0x97a1('0x42')];if(!_0x34120f[_0x97a1('0x43')][_0x97a1('0x48')](_0x97a1('0x64'))){_0x3f97d9[_0x97a1('0x2e')]=qs[_0x97a1('0x2e')](_0x34120f[_0x97a1('0x43')][_0x97a1('0x2e')]);_0x3f97d9['offset']=qs[_0x97a1('0x49')](_0x34120f[_0x97a1('0x43')][_0x97a1('0x49')]);}_0x3f97d9[_0x97a1('0x4a')]=qs[_0x97a1('0x4b')](_0x34120f[_0x97a1('0x43')]['sort']);_0x3f97d9['where']=qs[_0x97a1('0x44')](_['pick'](_0x34120f['query'],_0x31bed1[_0x97a1('0x44')]));_0x3f97d9[_0x97a1('0x4d')][_0x97a1('0x61')]=_0x21233e['id'];if(_0x34120f['query'][_0x97a1('0x51')]){_0x3f97d9[_0x97a1('0x4d')]=_[_0x97a1('0x4e')](_0x3f97d9[_0x97a1('0x4d')],{'$or':_[_0x97a1('0x3d')](_0x3f97d9['attributes'],function(_0x513468){var _0x367a2a={};_0x367a2a[_0x513468]={'$like':'%'+_0x34120f[_0x97a1('0x43')]['filter']+'%'};return _0x367a2a;})});}_0x3f97d9=_[_0x97a1('0x4e')]({},_0x3f97d9,_0x34120f[_0x97a1('0x52')]);return db[_0x97a1('0x63')][_0x97a1('0x2d')]({'where':_0x3f97d9[_0x97a1('0x4d')]})['then'](function(_0x5bc0cb){_0x1a3785[_0x97a1('0x2d')]=_0x5bc0cb;if(_0x34120f[_0x97a1('0x43')][_0x97a1('0x65')]){_0x3f97d9[_0x97a1('0x53')]=[{'all':!![]}];}return db[_0x97a1('0x63')][_0x97a1('0x54')](_0x3f97d9);})[_0x97a1('0x33')](function(_0xf851b0){_0x1a3785[_0x97a1('0x66')]=_0xf851b0;return _0x1a3785;});}})[_0x97a1('0x33')](respondWithFilteredResult(_0x5160f7,_0x3f97d9))[_0x97a1('0x29')](handleError(_0x5160f7,null));};exports['removeDispositions']=function(_0x474a77,_0x2b5473,_0x3ca8fe){return db['SmsAccount']['find']({'where':{'id':_0x474a77[_0x97a1('0x56')]['id']}})['then'](handleEntityNotFound(_0x2b5473,null))[_0x97a1('0x33')](function(_0x36a58b){if(_0x36a58b){return _0x36a58b['removeDispositions'](_0x474a77[_0x97a1('0x43')][_0x97a1('0x67')]);}})[_0x97a1('0x33')](respondWithStatusCode(_0x2b5473,null))[_0x97a1('0x29')](handleError(_0x2b5473,null));};exports['addAnswer']=function(_0x11460e,_0x232c93,_0x574dc4){if(_0x11460e[_0x97a1('0x5b')]['id']){delete _0x11460e[_0x97a1('0x5b')]['id'];}return db[_0x97a1('0x3e')][_0x97a1('0x59')]({'where':{'id':_0x11460e[_0x97a1('0x56')]['id']}})[_0x97a1('0x33')](handleEntityNotFound(_0x232c93,null))['then'](function(_0x299ad4){if(_0x299ad4){_0x11460e[_0x97a1('0x5b')][_0x97a1('0x61')]=_0x299ad4['id'];return db[_0x97a1('0x68')]['create'](_0x11460e[_0x97a1('0x5b')]);}})[_0x97a1('0x33')](respondWithResult(_0x232c93,null))[_0x97a1('0x29')](handleError(_0x232c93,null));};exports[_0x97a1('0x69')]=function(_0x89a66e,_0x446ded,_0x707c53){var _0x11e0a5={'raw':![],'where':{}};var _0x33ac81={};var _0x5ce047={'count':0x0,'rows':[]};return db[_0x97a1('0x3e')][_0x97a1('0x62')]({'where':{'id':_0x89a66e['params']['id']}})['then'](handleEntityNotFound(_0x446ded,null))[_0x97a1('0x33')](function(_0x182f5f){if(_0x182f5f){_0x33ac81[_0x97a1('0x42')]=_[_0x97a1('0x57')](db[_0x97a1('0x68')][_0x97a1('0x3f')]);_0x33ac81[_0x97a1('0x43')]=_[_0x97a1('0x57')](_0x89a66e[_0x97a1('0x43')]);_0x33ac81[_0x97a1('0x44')]=_[_0x97a1('0x45')](_0x33ac81[_0x97a1('0x42')],_0x33ac81[_0x97a1('0x43')]);_0x11e0a5[_0x97a1('0x47')]=_[_0x97a1('0x45')](_0x33ac81[_0x97a1('0x42')],qs['fields'](_0x89a66e[_0x97a1('0x43')][_0x97a1('0x46')]));_0x11e0a5[_0x97a1('0x47')]=_0x11e0a5[_0x97a1('0x47')]['length']?_0x11e0a5[_0x97a1('0x47')]:_0x33ac81[_0x97a1('0x42')];if(!_0x89a66e[_0x97a1('0x43')][_0x97a1('0x48')](_0x97a1('0x64'))){_0x11e0a5[_0x97a1('0x2e')]=qs[_0x97a1('0x2e')](_0x89a66e['query']['limit']);_0x11e0a5[_0x97a1('0x49')]=qs[_0x97a1('0x49')](_0x89a66e[_0x97a1('0x43')]['offset']);}_0x11e0a5['order']=qs[_0x97a1('0x4b')](_0x89a66e['query'][_0x97a1('0x4b')]);_0x11e0a5[_0x97a1('0x4d')]=qs[_0x97a1('0x44')](_[_0x97a1('0x4c')](_0x89a66e[_0x97a1('0x43')],_0x33ac81['filters']));_0x11e0a5[_0x97a1('0x4d')]['SmsAccountId']=_0x182f5f['id'];if(_0x89a66e[_0x97a1('0x43')]['filter']){_0x11e0a5[_0x97a1('0x4d')]=_[_0x97a1('0x4e')](_0x11e0a5[_0x97a1('0x4d')],{'$or':_['map'](_0x11e0a5['attributes'],function(_0x47d266){var _0x4d53a0={};_0x4d53a0[_0x47d266]={'$like':'%'+_0x89a66e[_0x97a1('0x43')][_0x97a1('0x51')]+'%'};return _0x4d53a0;})});}_0x11e0a5=_['merge']({},_0x11e0a5,_0x89a66e[_0x97a1('0x52')]);return db[_0x97a1('0x68')][_0x97a1('0x2d')]({'where':_0x11e0a5['where']})[_0x97a1('0x33')](function(_0x39d14f){_0x5ce047[_0x97a1('0x2d')]=_0x39d14f;if(_0x89a66e[_0x97a1('0x43')]['includeAll']){_0x11e0a5[_0x97a1('0x53')]=[{'all':!![]}];}return db[_0x97a1('0x68')]['findAll'](_0x11e0a5);})[_0x97a1('0x33')](function(_0x2a252e){_0x5ce047[_0x97a1('0x66')]=_0x2a252e;return _0x5ce047;});}})['then'](respondWithFilteredResult(_0x446ded,_0x11e0a5))[_0x97a1('0x29')](handleError(_0x446ded,null));};exports[_0x97a1('0x6a')]=function(_0x46f5cc,_0x5e40ba,_0x3266bd){return db[_0x97a1('0x3e')]['find']({'where':{'id':_0x46f5cc['params']['id']}})[_0x97a1('0x33')](handleEntityNotFound(_0x5e40ba,null))[_0x97a1('0x33')](function(_0x1692aa){if(_0x1692aa){return _0x1692aa['removeAnswers'](_0x46f5cc[_0x97a1('0x43')]['ids']);}})['then'](respondWithStatusCode(_0x5e40ba,null))[_0x97a1('0x29')](handleError(_0x5e40ba,null));};exports[_0x97a1('0x6b')]=function(_0x4560fb,_0x2cb585,_0x59039f){var _0x8aa80b={'channel':_0x97a1('0x6c')};var _0x21c2b2=[];var _0x32ef6e=[];var _0x41381b={};return db['SmsAccount'][_0x97a1('0x59')]({'where':{'id':_0x4560fb[_0x97a1('0x56')]['id']},'include':[{'model':db[_0x97a1('0x6d')],'as':_0x97a1('0x6e')}]})[_0x97a1('0x33')](handleEntityNotFound(_0x2cb585,null))[_0x97a1('0x33')](function(_0x41db47){_0x8aa80b[_0x97a1('0x6f')]=_0x41db47;_0x8aa80b[_0x97a1('0x70')]=_[_0x97a1('0x71')](_0x41db47[_0x97a1('0x6e')],[_0x97a1('0x72')],[_0x97a1('0x73')]);if(_0x8aa80b[_0x97a1('0x6f')]['Applications']){delete _0x8aa80b[_0x97a1('0x6f')]['Applications'];}return db[_0x97a1('0x74')]['describe']();})['then'](function(_0x490392){if(!_0x490392){throw new db[(_0x97a1('0x75'))][(_0x97a1('0x76'))](_0x97a1('0x77'));}_0x21c2b2=_[_0x97a1('0x78')](_[_0x97a1('0x57')](_0x490392),['createdAt',_0x97a1('0x79')]);_0x32ef6e=_['difference'](_[_0x97a1('0x57')](_0x490392),[_0x97a1('0x7a'),_0x97a1('0x79'),_0x97a1('0x7b'),_0x97a1('0x7c')]);_0x8aa80b[_0x97a1('0x5b')]={'mapKey':'mobile'};if(_0x8aa80b[_0x97a1('0x6f')][_0x97a1('0x4f')]){switch(_0x8aa80b[_0x97a1('0x6f')][_0x97a1('0x4f')]){case'twilio':_0x8aa80b[_0x97a1('0x5b')]['from']=_0x4560fb[_0x97a1('0x5b')][_0x97a1('0x7d')];_0x8aa80b[_0x97a1('0x5b')]['body']=_0x4560fb[_0x97a1('0x5b')][_0x97a1('0x7e')];_0x8aa80b[_0x97a1('0x5b')]['messageId']=_0x4560fb['body'][_0x97a1('0x7f')];break;case _0x97a1('0x80'):_0x8aa80b['body'][_0x97a1('0x81')]='+'+_0x4560fb[_0x97a1('0x5b')][_0x97a1('0x82')];_0x8aa80b['body'][_0x97a1('0x5b')]=_0x4560fb[_0x97a1('0x5b')][_0x97a1('0x83')];break;case _0x97a1('0x84'):_0x8aa80b[_0x97a1('0x5b')][_0x97a1('0x81')]=_0x4560fb[_0x97a1('0x5b')]['from'];_0x8aa80b['body'][_0x97a1('0x5b')]=_0x4560fb[_0x97a1('0x5b')][_0x97a1('0x26')];break;case _0x97a1('0x85'):_0x8aa80b[_0x97a1('0x5b')]['from']=_0x4560fb['body'][_0x97a1('0x81')];_0x8aa80b[_0x97a1('0x5b')][_0x97a1('0x5b')]=_0x4560fb[_0x97a1('0x5b')][_0x97a1('0x5b')];_0x8aa80b[_0x97a1('0x5b')]['messageId']=_0x4560fb['body'][_0x97a1('0x86')];break;case _0x97a1('0x87'):_0x8aa80b['body'][_0x97a1('0x81')]=_0x4560fb['body']['From'];_0x8aa80b['body'][_0x97a1('0x5b')]=_0x4560fb[_0x97a1('0x5b')][_0x97a1('0x88')];_0x8aa80b[_0x97a1('0x5b')]['messageId']=_0x4560fb[_0x97a1('0x5b')][_0x97a1('0x89')];break;case _0x97a1('0x8a'):_0x8aa80b[_0x97a1('0x5b')][_0x97a1('0x81')]='+'+_0x4560fb[_0x97a1('0x5b')][_0x97a1('0x8b')][0x0][_0x97a1('0x81')];_0x8aa80b[_0x97a1('0x5b')][_0x97a1('0x5b')]=_0x4560fb[_0x97a1('0x5b')][_0x97a1('0x8b')][0x0][_0x97a1('0x83')];_0x8aa80b[_0x97a1('0x5b')][_0x97a1('0x8c')]=_0x4560fb[_0x97a1('0x5b')][_0x97a1('0x8b')][0x0]['messageId'];break;case _0x97a1('0x8d'):_0x8aa80b[_0x97a1('0x5b')][_0x97a1('0x81')]=_0x4560fb[_0x97a1('0x5b')][_0x97a1('0x8e')];_0x8aa80b[_0x97a1('0x5b')]['body']=_0x4560fb['body'][_0x97a1('0x8f')][_0x97a1('0x26')];break;case _0x97a1('0x90'):_0x8aa80b[_0x97a1('0x5b')]['from']=_0x4560fb[_0x97a1('0x5b')]['fromNumber'];_0x8aa80b['body'][_0x97a1('0x5b')]=_0x4560fb[_0x97a1('0x5b')]['text'];_0x8aa80b[_0x97a1('0x5b')]['messageId']=_0x4560fb[_0x97a1('0x5b')][_0x97a1('0x91')];break;case _0x97a1('0x92'):_0x8aa80b['body'][_0x97a1('0x8c')]=_0x4560fb['body'][0x0][_0x97a1('0x26')]['id'];_0x8aa80b[_0x97a1('0x5b')][_0x97a1('0x81')]=_0x4560fb[_0x97a1('0x5b')][0x0][_0x97a1('0x26')][_0x97a1('0x81')];_0x8aa80b['body'][_0x97a1('0x5b')]=_0x4560fb[_0x97a1('0x5b')][0x0][_0x97a1('0x26')][_0x97a1('0x83')];break;case _0x97a1('0x93'):_0x8aa80b[_0x97a1('0x5b')][_0x97a1('0x81')]=_0x4560fb[_0x97a1('0x5b')][_0x97a1('0x81')];_0x8aa80b[_0x97a1('0x5b')]['body']=_0x4560fb['body'][_0x97a1('0x26')];_0x8aa80b[_0x97a1('0x5b')]['messageId']=_0x4560fb[_0x97a1('0x5b')][_0x97a1('0x94')];break;}}if(_0x8aa80b[_0x97a1('0x5b')]['id']){delete _0x8aa80b['body']['id'];}if(_[_0x97a1('0x95')](_0x8aa80b[_0x97a1('0x5b')][_0x97a1('0x81')])){throw new db[(_0x97a1('0x75'))][(_0x97a1('0x76'))](_0x97a1('0x96'));}if(_['isNil'](_0x8aa80b[_0x97a1('0x5b')][_0x97a1('0x5b')])||_0x8aa80b[_0x97a1('0x5b')][_0x97a1('0x5b')]===''){throw new db[(_0x97a1('0x75'))][(_0x97a1('0x76'))](_0x97a1('0x97'));}if(_[_0x97a1('0x95')](_0x8aa80b[_0x97a1('0x5b')][_0x97a1('0x98')])){throw new db[(_0x97a1('0x75'))][(_0x97a1('0x76'))](_0x97a1('0x99')+_0x32ef6e);}if(!_[_0x97a1('0x9a')](_0x32ef6e,_0x8aa80b[_0x97a1('0x5b')]['mapKey'])){throw new db['Sequelize'][(_0x97a1('0x76'))](_0x97a1('0x9b')+_0x32ef6e);}_0x41381b[_0x8aa80b[_0x97a1('0x5b')]['mapKey']]=_0x8aa80b[_0x97a1('0x5b')]['from'];return db[_0x97a1('0x9c')][_0x97a1('0x59')]({'where':{'id':_0x8aa80b[_0x97a1('0x6f')]['ListId']},'include':[{'model':db[_0x97a1('0x74')],'as':_0x97a1('0x9d'),'where':_0x41381b,'limit':0x1,'order':[[_0x97a1('0x79'),_0x97a1('0x9e')]]}]});})[_0x97a1('0x33')](handleEntityNotFound(_0x2cb585,null))[_0x97a1('0x33')](function(_0x63c6f9){if(_0x63c6f9){_0x8aa80b[_0x97a1('0x9f')]=_[_0x97a1('0xa0')](_0x63c6f9,[_0x97a1('0x9d')]);if(_0x63c6f9[_0x97a1('0x9d')][_0x97a1('0x58')]){return _0x63c6f9[_0x97a1('0x9d')][0x0];}var _0x18c6a6=_['defaults'](_0x8aa80b[_0x97a1('0x5b')],{'firstName':_0x8aa80b[_0x97a1('0x5b')]['from'],'ListId':_0x63c6f9['id']});_0x18c6a6[_0x8aa80b['body'][_0x97a1('0x98')]]=_0x8aa80b[_0x97a1('0x5b')][_0x97a1('0x81')];return db[_0x97a1('0x74')][_0x97a1('0x5a')](_0x18c6a6,{'fields':_0x21c2b2,'raw':!![]});}})[_0x97a1('0x33')](handleEntityNotFound(_0x2cb585,null))[_0x97a1('0x33')](function(_0x674434){if(_0x674434){_0x8aa80b[_0x97a1('0xa1')]=_0x674434;var _0x126850={'ContactId':_0x674434['id'],'phone':_0x8aa80b['body'][_0x97a1('0x81')],'SmsAccountId':_0x4560fb['params']['id']};var _0x274582={'ContactId':_0x674434['id'],'SmsAccountId':_0x4560fb[_0x97a1('0x56')]['id'],'closed':![]};return db[_0x97a1('0xa2')][_0x97a1('0x59')]({'where':_0x274582})[_0x97a1('0x33')](function(_0x59a332){if(_0x59a332){return[_0x59a332,![]];}return db[_0x97a1('0xa2')][_0x97a1('0x5a')](_0x126850)[_0x97a1('0x33')](function(_0x2db8ae){return[_0x2db8ae,!![]];});});}})[_0x97a1('0xa3')](function(_0x30189b,_0xdb2beb){_0x8aa80b[_0x97a1('0xa4')]=_0x30189b[_0x97a1('0x35')]({'plain':!![]});_0x8aa80b['interaction'][_0x97a1('0xa5')]=![];if(_0xdb2beb){if(_0x8aa80b[_0x97a1('0x6f')]['autoclose']){_0x8aa80b[_0x97a1('0x70')][_0x97a1('0xa6')]({'id':0x0,'priority':_0x8aa80b[_0x97a1('0x70')][_0x97a1('0x58')]+0x1,'app':_0x97a1('0xa7'),'appdata':_0x97a1('0xa8'),'interval':_0x97a1('0xa9')});}_0x8aa80b[_0x97a1('0xa4')]['created']=!![];}return db[_0x97a1('0xaa')]['create']({'phone':_0x8aa80b[_0x97a1('0x5b')][_0x97a1('0x81')],'messageId':_0x8aa80b[_0x97a1('0x5b')][_0x97a1('0x8c')],'body':_0x8aa80b[_0x97a1('0x5b')][_0x97a1('0x5b')],'SmsAccountId':_0x4560fb[_0x97a1('0x56')]['id'],'SmsInteractionId':_0x30189b['id'],'direction':'in','ContactId':_0x30189b['ContactId'],'AttachmentId':_0x8aa80b[_0x97a1('0x5b')][_0x97a1('0xab')]});})[_0x97a1('0x33')](function(_0x2a926c){_0x8aa80b[_0x97a1('0x26')]=_0x2a926c;if(_0x8aa80b[_0x97a1('0xa4')][_0x97a1('0xac')]){return db[_0x97a1('0xad')]['find']({'attributes':['id',_0x97a1('0x39')],'where':{'id':_0x8aa80b[_0x97a1('0xa4')][_0x97a1('0xac')]}})[_0x97a1('0x33')](function(_0x3679f0){if(_0x3679f0){_0x8aa80b[_0x97a1('0x70')]['unshift']({'id':0x0,'priority':0x0,'app':_0x97a1('0xae'),'appdata':_0x3679f0[_0x97a1('0x39')]+','+(_0x8aa80b[_0x97a1('0x6f')][_0x97a1('0xaf')]||0xa),'interval':_0x97a1('0xa9')});}return respondWithRpcPromise('Start',_0x97a1('0xb0'),_0x8aa80b);});}return respondWithRpcPromise(_0x97a1('0xb1'),_0x97a1('0xb0'),_0x8aa80b);})[_0x97a1('0x33')](function(_0x307731){if(_0x307731){var _0x945608=0xc8;var _0xd27d17='receiveMessage';logger[_0x97a1('0x27')](_0x97a1('0xb2'),_0xd27d17,_0x945608,'entity\x20found');logger[_0x97a1('0x23')](_0x97a1('0xb3'),_0xd27d17,_0x945608,_0x97a1('0xb4'),JSON[_0x97a1('0xb5')](_0x307731));if(_0x8aa80b[_0x97a1('0x6f')][_0x97a1('0x4f')]===_0x97a1('0xb6')){return _0x2cb585[_0x97a1('0x2b')](_0x945608)[_0x97a1('0xb7')](_0x97a1('0xb8'),'text/xml')[_0x97a1('0x3a')]('\x0a');}else{return _0x2cb585[_0x97a1('0x2b')](_0x945608)[_0x97a1('0x2f')](_0x307731);}}})['catch'](handleError(_0x2cb585,null));};exports[_0x97a1('0xb9')]=function(_0x1bc955,_0xfd9e0d){var _0x3dda97=_0x1bc955[_0x97a1('0x56')]['id'];var _0x5b327c=_0x1bc955['body'];var _0x342f41=0xc8;var _0x4bc6e7=null;return db[_0x97a1('0xba')][_0x97a1('0xbb')]({'isolationLevel':db[_0x97a1('0xba')][_0x97a1('0xbc')][_0x97a1('0xbd')][_0x97a1('0xbe')]},function(_0x17ca66){return db[_0x97a1('0x3e')][_0x97a1('0x62')]({'where':{'id':_0x3dda97},'transaction':_0x17ca66})[_0x97a1('0x33')](function(_0xf5b565){if(_0xf5b565){return db[_0x97a1('0x6d')][_0x97a1('0x34')]({'where':{'SmsAccountId':_0x3dda97},'transaction':_0x17ca66})['then'](function(){var _0x4024bb=_[_0x97a1('0x3d')](_0x5b327c,function(_0x168bf4){_0x168bf4[_0x97a1('0x61')]=_0x3dda97;return _0x168bf4;});return db['SmsApplication'][_0x97a1('0xbf')](_0x4024bb,{'transaction':_0x17ca66});});}else{_0x342f41=0x194;_0x4bc6e7=[];}});})[_0x97a1('0x33')](function(){if(_0x342f41!==0x194){return db['SmsApplication'][_0x97a1('0xc0')]({'where':{'SmsAccountId':_0x3dda97},'order':'priority'})['then'](function(_0x1e5811){_0x4bc6e7=_0x1e5811;});}})[_0x97a1('0x29')](function(_0x54f2a1){_0x342f41=0x1f4;logger[_0x97a1('0x24')](_0x54f2a1[_0x97a1('0x38')]);if(_0x54f2a1[_0x97a1('0x39')]){delete _0x54f2a1['name'];}_0x4bc6e7=_0x54f2a1;})[_0x97a1('0xc1')](function(){if(_0x4bc6e7===null){_0xfd9e0d[_0x97a1('0x2a')](_0x342f41);}else{if(_0x342f41===0x1f4){_0xfd9e0d[_0x97a1('0x2b')](_0x342f41)[_0x97a1('0x3a')](_0x4bc6e7);}else{_0xfd9e0d[_0x97a1('0x2b')](_0x342f41)['json'](_0x4bc6e7);}}});};exports['getApplications']=function(_0x2678ac,_0x193c9f,_0x3ed0d){var _0x568bd5={};var _0x3ed55={};var _0x4f517a;var _0x654045;return db['SmsAccount']['findOne']({'where':{'id':_0x2678ac['params']['id']}})[_0x97a1('0x33')](handleEntityNotFound(_0x193c9f,null))[_0x97a1('0x33')](function(_0x5de737){if(_0x5de737){_0x4f517a=_0x5de737;_0x3ed55[_0x97a1('0x42')]=_[_0x97a1('0x57')](db[_0x97a1('0x6d')][_0x97a1('0x3f')]);_0x3ed55[_0x97a1('0x43')]=_['keys'](_0x2678ac['query']);_0x3ed55[_0x97a1('0x44')]=_[_0x97a1('0x45')](_0x3ed55[_0x97a1('0x42')],_0x3ed55[_0x97a1('0x43')]);_0x568bd5['attributes']=_[_0x97a1('0x45')](_0x3ed55[_0x97a1('0x42')],qs['fields'](_0x2678ac['query'][_0x97a1('0x46')]));_0x568bd5[_0x97a1('0x47')]=_0x568bd5[_0x97a1('0x47')]['length']?_0x568bd5[_0x97a1('0x47')]:_0x3ed55['model'];_0x568bd5[_0x97a1('0x4a')]=qs[_0x97a1('0x4b')](_0x2678ac['query']['sort']);_0x568bd5[_0x97a1('0x4d')]=qs[_0x97a1('0x44')](_[_0x97a1('0x4c')](_0x2678ac[_0x97a1('0x43')],_0x3ed55[_0x97a1('0x44')]));if(_0x2678ac[_0x97a1('0x43')][_0x97a1('0x51')]){_0x568bd5[_0x97a1('0x4d')]=_[_0x97a1('0x4e')](_0x568bd5[_0x97a1('0x4d')],{'$or':_[_0x97a1('0x3d')](_0x568bd5[_0x97a1('0x47')],function(_0x5f5ce1){var _0x54ac7a={};_0x54ac7a[_0x5f5ce1]={'$like':'%'+_0x2678ac[_0x97a1('0x43')][_0x97a1('0x51')]+'%'};return _0x54ac7a;})});}_0x568bd5=_[_0x97a1('0x4e')]({},_0x568bd5,_0x2678ac[_0x97a1('0x52')]);return _0x4f517a[_0x97a1('0xc2')](_0x568bd5);}})[_0x97a1('0x33')](function(_0x101026){if(_0x101026){_0x654045=_0x101026[_0x97a1('0x58')];if(!_0x2678ac[_0x97a1('0x43')][_0x97a1('0x48')]('nolimit')){_0x568bd5['limit']=qs[_0x97a1('0x2e')](_0x2678ac[_0x97a1('0x43')][_0x97a1('0x2e')]);_0x568bd5[_0x97a1('0x49')]=qs[_0x97a1('0x49')](_0x2678ac[_0x97a1('0x43')][_0x97a1('0x49')]);}return _0x4f517a['getApplications'](_0x568bd5);}})[_0x97a1('0x33')](function(_0x1baf19){if(_0x1baf19){return _0x1baf19?{'count':_0x654045,'rows':_0x1baf19}:null;}})['then'](respondWithResult(_0x193c9f,null))[_0x97a1('0x29')](handleError(_0x193c9f,null));};exports[_0x97a1('0xc3')]=function(_0x2fc075,_0x26b251,_0x4bced8){var _0x343c3b={'raw':![],'where':{}};var _0x11290f={};var _0x20cec7={'count':0x0,'rows':[]};return db[_0x97a1('0x3e')]['findOne']({'where':{'id':_0x2fc075[_0x97a1('0x56')]['id']}})[_0x97a1('0x33')](handleEntityNotFound(_0x26b251,null))[_0x97a1('0x33')](function(_0x58b075){if(_0x58b075){_0x11290f['model']=_[_0x97a1('0x57')](db[_0x97a1('0xa2')][_0x97a1('0x3f')]);_0x11290f['query']=_['keys'](_0x2fc075[_0x97a1('0x43')]);_0x11290f[_0x97a1('0x44')]=_['intersection'](_0x11290f['model'],_0x11290f[_0x97a1('0x43')]);_0x343c3b['attributes']=_[_0x97a1('0x45')](_0x11290f[_0x97a1('0x42')],qs[_0x97a1('0x46')](_0x2fc075['query']['fields']));_0x343c3b['attributes']=_0x343c3b[_0x97a1('0x47')]['length']?_0x343c3b[_0x97a1('0x47')]:_0x11290f[_0x97a1('0x42')];if(!_0x2fc075['query'][_0x97a1('0x48')](_0x97a1('0x64'))){_0x343c3b[_0x97a1('0x2e')]=qs[_0x97a1('0x2e')](_0x2fc075['query']['limit']);_0x343c3b[_0x97a1('0x49')]=qs[_0x97a1('0x49')](_0x2fc075[_0x97a1('0x43')][_0x97a1('0x49')]);}_0x343c3b[_0x97a1('0x4a')]=qs[_0x97a1('0x4b')](_0x2fc075[_0x97a1('0x43')][_0x97a1('0x4b')]);_0x343c3b[_0x97a1('0x4d')]=qs[_0x97a1('0x44')](_[_0x97a1('0x4c')](_0x2fc075[_0x97a1('0x43')],_0x11290f['filters']));_0x343c3b['where']['SmsAccountId']=_0x58b075['id'];if(_0x2fc075['query'][_0x97a1('0x51')]){_0x343c3b[_0x97a1('0x4d')]=_['merge'](_0x343c3b[_0x97a1('0x4d')],{'$or':_['map'](_0x343c3b[_0x97a1('0x47')],function(_0x45ecc2){var _0x5b03d0={};_0x5b03d0[_0x45ecc2]={'$like':'%'+_0x2fc075[_0x97a1('0x43')][_0x97a1('0x51')]+'%'};return _0x5b03d0;})});}_0x343c3b=_[_0x97a1('0x4e')]({},_0x343c3b,_0x2fc075[_0x97a1('0x52')]);return db[_0x97a1('0xa2')][_0x97a1('0x2d')]({'where':_0x343c3b[_0x97a1('0x4d')]})[_0x97a1('0x33')](function(_0x401197){_0x20cec7[_0x97a1('0x2d')]=_0x401197;if(_0x2fc075['query']['includeAll']){_0x343c3b['include']=[{'model':db['CmContact'],'as':_0x97a1('0xc4'),'required':![]},{'model':db[_0x97a1('0xad')],'as':_0x97a1('0xc5'),'attributes':[_0x97a1('0x39'),'fullname',_0x97a1('0xc6')],'required':![]},{'model':db[_0x97a1('0xc7')],'as':_0x97a1('0xc8'),'attributes':['id','name','color'],'where':_0x2fc075['query'][_0x97a1('0xc9')]?{'id':_0x2fc075[_0x97a1('0x43')][_0x97a1('0xc9')]}:undefined,'required':_0x2fc075['query'][_0x97a1('0xc9')]?!![]:![]}];}return db['SmsInteraction'][_0x97a1('0x54')](_0x343c3b);})[_0x97a1('0x33')](function(_0x273717){_0x20cec7[_0x97a1('0x66')]=_0x273717;return _0x20cec7;});}})[_0x97a1('0x33')](respondWithFilteredResult(_0x26b251,_0x343c3b))['catch'](handleError(_0x26b251,null));};exports['send']=function(_0x5534d2,_0x12a254,_0xbac2e6){var _0x2265a3,_0x87f823,_0x272783;if(_[_0x97a1('0x95')](_0x5534d2[_0x97a1('0x5b')][_0x97a1('0x5b')])||_0x5534d2[_0x97a1('0x5b')][_0x97a1('0x5b')]===''){throw new db[(_0x97a1('0x75'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x97a1('0x95')](_0x5534d2[_0x97a1('0x5b')]['to'])){throw new db[(_0x97a1('0x75'))][(_0x97a1('0x76'))](_0x97a1('0xca'));}_0x2265a3=_0x5534d2[_0x97a1('0x5b')]['to'];return db['SmsAccount'][_0x97a1('0x59')]({'where':{'id':_0x5534d2['params']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x97a1('0x74')],'as':'Contacts','where':{'mobile':_0x2265a3},'limit':0x1,'order':[[_0x97a1('0x79'),_0x97a1('0x9e')]]}]}]})[_0x97a1('0x33')](handleEntityNotFound(_0x12a254,null))[_0x97a1('0x33')](function(_0x31ad3a){if(_0x31ad3a&&_0x31ad3a[_0x97a1('0xcb')]){_0x87f823=_0x31ad3a[_0x97a1('0x35')]({'plain':!![]});if(_0x87f823['List']&&_0x87f823[_0x97a1('0xcb')][_0x97a1('0x9d')][_0x97a1('0x58')]){return _0x87f823[_0x97a1('0xcb')]['Contacts'][0x0];}return db[_0x97a1('0x74')]['create'](_[_0x97a1('0x1a')](_0x5534d2[_0x97a1('0x5b')],{'firstName':_0x2265a3,'mobile':_0x2265a3,'phone':_0x2265a3,'ListId':_0x87f823[_0x97a1('0x7c')]}));}})[_0x97a1('0x33')](handleEntityNotFound(_0x12a254,null))[_0x97a1('0x33')](function(_0x30ae56){if(_0x30ae56){_0x272783=_0x30ae56;return db[_0x97a1('0xa2')]['find']({'where':{'ContactId':_0x272783['id'],'closed':![],'SmsAccountId':_0x87f823['id']}})[_0x97a1('0x33')](function(_0x122b53){if(_0x122b53){return[_0x122b53,![]];}return db[_0x97a1('0xa2')][_0x97a1('0x5a')]({'UserId':_0x5534d2[_0x97a1('0x5c')]['id'],'ContactId':_0x272783['id'],'SmsAccountId':_0x87f823['id'],'phone':_0x2265a3,'firstMsgDirection':_0x97a1('0xcc'),'Messages':[_[_0x97a1('0x4e')](_0x5534d2[_0x97a1('0x5b')],{'read':![],'body':_0x5534d2[_0x97a1('0x5b')][_0x97a1('0x5b')],'phone':_0x2265a3,'SmsAccountId':_0x87f823['id'],'UserId':_0x5534d2[_0x97a1('0x5c')]['id'],'ContactId':_0x272783['id']})]},{'include':[{'model':db[_0x97a1('0xaa')],'as':'Messages'}]})[_0x97a1('0x33')](function(_0x7ec81){return[_0x7ec81,!![]];});});}})[_0x97a1('0xa3')](function(_0x2ada2b,_0x1ad184){if(_0x1ad184){return _0x2ada2b;}return db['SmsMessage'][_0x97a1('0x5a')](_['merge'](_0x5534d2[_0x97a1('0x5b')],{'read':![],'body':_0x5534d2[_0x97a1('0x5b')][_0x97a1('0x5b')],'phone':_0x2265a3,'SmsAccountId':_0x87f823['id'],'SmsInteractionId':_0x2ada2b['id'],'UserId':_0x5534d2['user']['id'],'ContactId':_0x272783['id']}))[_0x97a1('0x33')](function(_0x4a4390){_0x2ada2b[_0x97a1('0xcd')][_0x97a1('0xce')]=[];_0x2ada2b[_0x97a1('0xcd')][_0x97a1('0xce')][_0x97a1('0xa6')](_0x4a4390['dataValues']);return _0x2ada2b;});})[_0x97a1('0x33')](respondWithResult(_0x12a254,null))['catch'](handleError(_0x12a254,null));};exports[_0x97a1('0x2b')]=function(_0x1d9fcf,_0x452a71,_0x148900){if(_0x1d9fcf[_0x97a1('0x5b')]['id']){delete _0x1d9fcf[_0x97a1('0x5b')]['id'];}var _0x1f6a2c,_0x4aae34,_0x4bd5a1;return db[_0x97a1('0x3e')][_0x97a1('0x59')]({'where':{'id':_0x1d9fcf['params']['id']}})[_0x97a1('0x33')](handleEntityNotFound(_0x452a71,null))[_0x97a1('0x33')](function(_0x309095){if(_0x309095){_0x4bd5a1=_0x309095;logger[_0x97a1('0x23')](_0x97a1('0xb2'),_0x97a1('0x2b'),_0x97a1('0xcf'),_0x309095[_0x97a1('0x4f')],util['inspect'](_0x1d9fcf[_0x97a1('0x5b')],{'showHidden':![],'depth':null}));switch(_0x309095[_0x97a1('0x4f')]){case'skebby':if(_0x1d9fcf[_0x97a1('0x5b')][_0x97a1('0xd0')]&&_0x1d9fcf[_0x97a1('0x5b')][_0x97a1('0x2b')]){_0x4aae34=_0x1d9fcf[_0x97a1('0x5b')][_0x97a1('0x2b')];return db['SmsMessage']['find']({'where':{'messageId':_0x1d9fcf['body']['skebby_dispatch_id']}});}break;case _0x97a1('0x84'):if(_0x1d9fcf[_0x97a1('0x5b')][_0x97a1('0xd1')]&&_0x1d9fcf['body']['statusInt']){_0x4aae34=_0x1d9fcf[_0x97a1('0x5b')][_0x97a1('0xd2')];return db[_0x97a1('0xaa')]['find']({'where':{'messageId':_0x1d9fcf['body'][_0x97a1('0xd1')]}});}break;case _0x97a1('0x85'):if(_0x1d9fcf[_0x97a1('0x5b')][_0x97a1('0x86')]&&_0x1d9fcf[_0x97a1('0x5b')]['status_code']){_0x4aae34=_0x1d9fcf[_0x97a1('0x5b')][_0x97a1('0xd3')];return db[_0x97a1('0xaa')][_0x97a1('0x59')]({'where':{'messageId':_0x1d9fcf['body']['message_id']}});}break;case _0x97a1('0x8a'):var _0x3fcee3=_0x1d9fcf[_0x97a1('0x5b')][_0x97a1('0x8b')][0x0];if(_0x3fcee3[_0x97a1('0x8c')]&&_0x3fcee3[_0x97a1('0x2b')]['groupName']===_0x97a1('0xd4')){_0x4aae34=_0x3fcee3[_0x97a1('0x2b')][_0x97a1('0xd5')];return db[_0x97a1('0xaa')][_0x97a1('0x59')]({'where':{'messageId':_0x3fcee3[_0x97a1('0x8c')]}});}break;case _0x97a1('0x90'):if(_0x1d9fcf[_0x97a1('0x5b')][_0x97a1('0x8c')]&&_0x1d9fcf[_0x97a1('0x5b')][_0x97a1('0x2b')]){_0x4aae34=_0x1d9fcf[_0x97a1('0x5b')][_0x97a1('0x2b')];return db[_0x97a1('0xaa')][_0x97a1('0x59')]({'where':{'messageId':_0x1d9fcf['body']['messageId']}});}break;case _0x97a1('0x92'):if(_0x1d9fcf['body'][0x0][_0x97a1('0x26')]['id']){_0x4aae34=_0x1d9fcf[_0x97a1('0x5b')][0x0][_0x97a1('0x4f')];return db[_0x97a1('0xaa')]['find']({'where':{'messageId':_0x1d9fcf[_0x97a1('0x5b')][0x0][_0x97a1('0x26')]['id']}});}break;case _0x97a1('0x93'):if(_0x1d9fcf[_0x97a1('0x5b')][_0x97a1('0xd6')]&&_0x1d9fcf[_0x97a1('0x5b')][_0x97a1('0x2b')]){_0x4aae34=_0x1d9fcf[_0x97a1('0x5b')][_0x97a1('0x2b')];return db[_0x97a1('0xaa')][_0x97a1('0x59')]({'where':{'messageId':_0x1d9fcf['body'][_0x97a1('0xd6')]}});}break;}}})[_0x97a1('0x33')](handleEntityNotFound(_0x452a71,null))['then'](function(_0x28ce9b){if(_0x28ce9b){_0x1f6a2c=_0x28ce9b;switch(_0x4bd5a1[_0x97a1('0x4f')]){case _0x97a1('0x80'):if(_0x4aae34===_0x97a1('0xd4')){return _0x1f6a2c['update']({'read':!![]});}else{logger[_0x97a1('0x24')](_0x97a1('0xb2'),'status',_0x97a1('0x80'),util[_0x97a1('0xd7')](_0x1d9fcf[_0x97a1('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x97a1('0x84'):if(_0x4aae34==='1'){return _0x1f6a2c['update']({'read':!![]});}else{logger[_0x97a1('0x24')](_0x97a1('0xb2'),_0x97a1('0x2b'),'skebby',util[_0x97a1('0xd7')](_0x1d9fcf[_0x97a1('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x97a1('0x85'):if(!_0x1d9fcf[_0x97a1('0x5b')][_0x97a1('0xd8')]&&_0x4aae34>=0xc8&&_0x4aae34<=0xce){return _0x1f6a2c['update']({'read':!![]});}else{logger[_0x97a1('0x24')](_0x97a1('0xb2'),_0x97a1('0x2b'),'clicksend',util[_0x97a1('0xd7')](_0x1d9fcf['body'],{'showHidden':![],'depth':null}));}break;case _0x97a1('0x8a'):var _0x4cc0e1=_0x1d9fcf[_0x97a1('0x5b')][_0x97a1('0x8b')][0x0];if(_0x4cc0e1[_0x97a1('0x2b')][_0x97a1('0xd5')]==='DELIVERED'){return _0x1f6a2c[_0x97a1('0x32')]({'read':!![]});}else{logger['error'](_0x97a1('0xb2'),_0x97a1('0x2b'),'infobip',util[_0x97a1('0xd7')](_0x1d9fcf[_0x97a1('0x5b')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x4aae34==_0x97a1('0xd9')||_0x4aae34==_0x97a1('0xda')){return _0x1f6a2c['update']({'read':!![]});}else{logger[_0x97a1('0x24')](_0x97a1('0xb2'),'status',_0x97a1('0x90'),util['inspect'](_0x1d9fcf['body'],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x4aae34=='message-delivered'){return _0x1f6a2c[_0x97a1('0x32')]({'read':!![]});}else{logger[_0x97a1('0x24')](_0x97a1('0xb2'),_0x97a1('0x2b'),'bandwidth',util[_0x97a1('0xd7')](_0x1d9fcf[_0x97a1('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x97a1('0x93'):if(_0x4aae34===_0x97a1('0xdb')||_0x4aae34===_0x97a1('0xdc')){return _0x1f6a2c[_0x97a1('0x32')]({'read':!![]});}else{logger[_0x97a1('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x97a1('0x2b'),'intelepeer',util[_0x97a1('0xd7')](_0x1d9fcf[_0x97a1('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x1f6a2c;}})[_0x97a1('0x33')](respondWithResult(_0x452a71,null))['catch'](handleError(_0x452a71,null));};exports[_0x97a1('0xdd')]=function(_0xaf8d4,_0x381612,_0x4ce552){var _0x497af6,_0xc62db3,_0x4f3cae;return db[_0x97a1('0x3e')]['find']({'where':{'id':_0xaf8d4[_0x97a1('0x56')]['id']}})[_0x97a1('0x33')](handleEntityNotFound(_0x381612,null))['then'](function(_0xc4a89b){if(_0xc4a89b){_0x4f3cae=_0xc4a89b;logger[_0x97a1('0x23')](_0x97a1('0xb2'),_0x97a1('0x2b'),_0x97a1('0xcf'),_0xc4a89b[_0x97a1('0x4f')],util[_0x97a1('0xd7')](_0xaf8d4[_0x97a1('0x43')],{'showHidden':![],'depth':null}));switch(_0xc4a89b[_0x97a1('0x4f')]){case _0x97a1('0x8d'):if(_0xaf8d4['query'][_0x97a1('0xde')]&&_0xaf8d4[_0x97a1('0x43')][_0x97a1('0xdf')]){_0xc62db3=_0xaf8d4[_0x97a1('0x43')][_0x97a1('0xdf')];return db[_0x97a1('0xaa')][_0x97a1('0x59')]({'where':{'messageId':_0xaf8d4['query'][_0x97a1('0xde')]}});}break;}}})[_0x97a1('0x33')](handleEntityNotFound(_0x381612,null))['then'](function(_0x19e9f2){if(_0x19e9f2){_0x497af6=_0x19e9f2;switch(_0x4f3cae[_0x97a1('0x4f')]){case _0x97a1('0x8d'):if(_0xc62db3==='2'||_0xc62db3==='6'){return _0x497af6[_0x97a1('0x32')]({'read':!![]});}else{logger[_0x97a1('0x24')](_0x97a1('0xb2'),_0x97a1('0x2b'),_0x97a1('0x8d'),util[_0x97a1('0xd7')](_0xaf8d4['query'],{'showHidden':![],'depth':null}));};break;}return _0x497af6;}})[_0x97a1('0x33')](respondWithResult(_0x381612,null))[_0x97a1('0x29')](handleError(_0x381612,null));};exports['addAgents']=function(_0x11efcb,_0x56c9f8,_0x202a12){return db[_0x97a1('0x3e')][_0x97a1('0x59')]({'where':{'id':_0x11efcb[_0x97a1('0x56')]['id']}})[_0x97a1('0x33')](handleEntityNotFound(_0x56c9f8,null))[_0x97a1('0x33')](function(_0x3a8501){if(_0x3a8501){return _0x3a8501[_0x97a1('0xe0')](_0x11efcb['body'][_0x97a1('0x67')],_[_0x97a1('0xa0')](_0x11efcb['body'],[_0x97a1('0x67'),'id'])||{})[_0x97a1('0xa3')](function(_0x4c501a){for(var _0x5091cc=0x0;_0x5091cc<_0x11efcb[_0x97a1('0x5b')][_0x97a1('0x67')][_0x97a1('0x58')];_0x5091cc+=0x1){socket[_0x97a1('0xe1')]('userSmsAccount:save',{'UserId':Number(_0x11efcb[_0x97a1('0x5b')][_0x97a1('0x67')][_0x5091cc]),'SmsAccountId':Number(_0x11efcb[_0x97a1('0x56')]['id'])});}return _0x4c501a;});}})[_0x97a1('0x33')](respondWithResult(_0x56c9f8,null))[_0x97a1('0x29')](handleError(_0x56c9f8,null));};exports[_0x97a1('0xe2')]=function(_0x1edb13,_0x16c0fb,_0x4b8e6a){return db['SmsAccount'][_0x97a1('0x59')]({'where':{'id':_0x1edb13['params']['id']}})['then'](handleEntityNotFound(_0x16c0fb,null))['then'](function(_0x35eee0){if(_0x35eee0){return _0x35eee0[_0x97a1('0xe2')](_0x1edb13[_0x97a1('0x43')]['ids'])[_0x97a1('0x33')](function(){if(_['isArray'](_0x1edb13[_0x97a1('0x43')][_0x97a1('0x67')])){for(var _0x829b7d=0x0;_0x829b7d<_0x1edb13['query']['ids'][_0x97a1('0x58')];_0x829b7d+=0x1){socket[_0x97a1('0xe1')](_0x97a1('0xe3'),{'UserId':Number(_0x1edb13[_0x97a1('0x43')]['ids'][_0x829b7d]),'SmsAccountId':Number(_0x1edb13[_0x97a1('0x56')]['id'])});}}else{socket[_0x97a1('0xe1')](_0x97a1('0xe3'),{'UserId':Number(_0x1edb13['query'][_0x97a1('0x67')]),'SmsAccountId':Number(_0x1edb13[_0x97a1('0x56')]['id'])});}});}})[_0x97a1('0x33')](respondWithStatusCode(_0x16c0fb,null))[_0x97a1('0x29')](handleError(_0x16c0fb,null));};exports['getAgents']=function(_0x268a1d,_0x36264b,_0x2eb026){var _0x10de99={};var _0x5414e={};var _0x51ded1;var _0x43123e;return db['SmsAccount']['findOne']({'where':{'id':_0x268a1d[_0x97a1('0x56')]['id']}})[_0x97a1('0x33')](handleEntityNotFound(_0x36264b,null))[_0x97a1('0x33')](function(_0x3de050){if(_0x3de050){_0x51ded1=_0x3de050;_0x5414e[_0x97a1('0x42')]=_[_0x97a1('0x57')](db[_0x97a1('0xad')][_0x97a1('0x3f')]);_0x5414e[_0x97a1('0x43')]=_[_0x97a1('0x57')](_0x268a1d[_0x97a1('0x43')]);_0x5414e[_0x97a1('0x44')]=_[_0x97a1('0x45')](_0x5414e[_0x97a1('0x42')],_0x5414e['query']);_0x10de99['attributes']=_[_0x97a1('0x45')](_0x5414e[_0x97a1('0x42')],qs[_0x97a1('0x46')](_0x268a1d['query'][_0x97a1('0x46')]));_0x10de99['attributes']=_0x10de99[_0x97a1('0x47')][_0x97a1('0x58')]?_0x10de99[_0x97a1('0x47')]:_0x5414e[_0x97a1('0x42')];_0x10de99[_0x97a1('0x4a')]=qs[_0x97a1('0x4b')](_0x268a1d[_0x97a1('0x43')][_0x97a1('0x4b')]);_0x10de99['where']=qs[_0x97a1('0x44')](_['pick'](_0x268a1d[_0x97a1('0x43')],_0x5414e[_0x97a1('0x44')]));if(_0x268a1d['query'][_0x97a1('0x51')]){_0x10de99[_0x97a1('0x4d')]=_[_0x97a1('0x4e')](_0x10de99[_0x97a1('0x4d')],{'$or':_[_0x97a1('0x3d')](_0x10de99['attributes'],function(_0x551881){var _0x5eb090={};_0x5eb090[_0x551881]={'$like':'%'+_0x268a1d[_0x97a1('0x43')][_0x97a1('0x51')]+'%'};return _0x5eb090;})});}_0x10de99=_[_0x97a1('0x4e')]({},_0x10de99,_0x268a1d[_0x97a1('0x52')]);return _0x51ded1[_0x97a1('0xe4')](_0x10de99);}})[_0x97a1('0x33')](function(_0x188102){if(_0x188102){_0x43123e=_0x188102[_0x97a1('0x58')];if(!_0x268a1d['query'][_0x97a1('0x48')](_0x97a1('0x64'))){_0x10de99['limit']=qs['limit'](_0x268a1d[_0x97a1('0x43')][_0x97a1('0x2e')]);_0x10de99['offset']=qs['offset'](_0x268a1d[_0x97a1('0x43')][_0x97a1('0x49')]);}return _0x51ded1[_0x97a1('0xe4')](_0x10de99);}})['then'](function(_0x416880){if(_0x416880){return _0x416880?{'count':_0x43123e,'rows':_0x416880}:null;}})[_0x97a1('0x33')](respondWithResult(_0x36264b,null))[_0x97a1('0x29')](handleError(_0x36264b,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index ad7a6cb..3d08fa9 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 _0x96fa=['exports','events','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0xbebf50,_0x44ec09){var _0xce1496=function(_0x1bf94d){while(--_0x1bf94d){_0xbebf50['push'](_0xbebf50['shift']());}};_0xce1496(++_0x44ec09);}(_0x96fa,0xf6));var _0xa96f=function(_0x33e5c8,_0x42301a){_0x33e5c8=_0x33e5c8-0x0;var _0x33d358=_0x96fa[_0x33e5c8];return _0x33d358;};'use strict';var EventEmitter=require(_0xa96f('0x0'));var SmsAccount=require('../../mysqldb')['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xa96f('0x1')](0x0);var events={'afterCreate':_0xa96f('0x2'),'afterUpdate':_0xa96f('0x3'),'afterDestroy':'remove'};function emitEvent(_0x5d8f51){return function(_0x40d333,_0x42d86d,_0x136514){SmsAccountEvents[_0xa96f('0x4')](_0x5d8f51+':'+_0x40d333['id'],_0x40d333);SmsAccountEvents['emit'](_0x5d8f51,_0x40d333);_0x136514(null);};}for(var e in events){if(events[_0xa96f('0x5')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0xa96f('0x6')]=SmsAccountEvents; \ No newline at end of file +var _0xa53c=['../../mysqldb','setMaxListeners','save','update','remove','emit','hook','events'];(function(_0x4ad364,_0x34d600){var _0x1ace8f=function(_0x4f4503){while(--_0x4f4503){_0x4ad364['push'](_0x4ad364['shift']());}};_0x1ace8f(++_0x34d600);}(_0xa53c,0x167));var _0xca53=function(_0x32dc5c,_0x1180f2){_0x32dc5c=_0x32dc5c-0x0;var _0x2449df=_0xa53c[_0x32dc5c];return _0x2449df;};'use strict';var EventEmitter=require(_0xca53('0x0'));var SmsAccount=require(_0xca53('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xca53('0x2')](0x0);var events={'afterCreate':_0xca53('0x3'),'afterUpdate':_0xca53('0x4'),'afterDestroy':_0xca53('0x5')};function emitEvent(_0x32073e){return function(_0x15599f,_0x5666b1,_0x1f48af){SmsAccountEvents[_0xca53('0x6')](_0x32073e+':'+_0x15599f['id'],_0x15599f);SmsAccountEvents[_0xca53('0x6')](_0x32073e,_0x15599f);_0x1f48af(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0xca53('0x7')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 4936503..db9e52a 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 _0xe2ab=['../../config/environment','./smsAccount.attributes','define','sms_accounts','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x2ac971,_0x53fbc7){var _0x4f9866=function(_0x3e8a66){while(--_0x3e8a66){_0x2ac971['push'](_0x2ac971['shift']());}};_0x4f9866(++_0x53fbc7);}(_0xe2ab,0xc4));var _0xbe2a=function(_0x3068c8,_0x1f5504){_0x3068c8=_0x3068c8-0x0;var _0x40c6e4=_0xe2ab[_0x3068c8];return _0x40c6e4;};'use strict';var _=require(_0xbe2a('0x0'));var util=require(_0xbe2a('0x1'));var logger=require(_0xbe2a('0x2'))(_0xbe2a('0x3'));var moment=require(_0xbe2a('0x4'));var BPromise=require(_0xbe2a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe2a('0x6'));var rimraf=require(_0xbe2a('0x7'));var config=require(_0xbe2a('0x8'));var attributes=require(_0xbe2a('0x9'));module['exports']=function(_0x2023d3,_0x521365){return _0x2023d3[_0xbe2a('0xa')]('SmsAccount',attributes,{'tableName':_0xbe2a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0123=['sms_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','SmsAccount'];(function(_0x6f9178,_0x569d76){var _0xe4eeb5=function(_0x49389f){while(--_0x49389f){_0x6f9178['push'](_0x6f9178['shift']());}};_0xe4eeb5(++_0x569d76);}(_0x0123,0x175));var _0x3012=function(_0xf986f0,_0x5c157f){_0xf986f0=_0xf986f0-0x0;var _0x2347b5=_0x0123[_0xf986f0];return _0x2347b5;};'use strict';var _=require(_0x3012('0x0'));var util=require('util');var logger=require(_0x3012('0x1'))(_0x3012('0x2'));var moment=require(_0x3012('0x3'));var BPromise=require(_0x3012('0x4'));var rp=require(_0x3012('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3012('0x6'));var config=require(_0x3012('0x7'));var attributes=require('./smsAccount.attributes');module[_0x3012('0x8')]=function(_0x3c4d96,_0xc18be){return _0x3c4d96[_0x3012('0x9')](_0x3012('0xa'),attributes,{'tableName':_0x3012('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 cade12b..5ed821c 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 _0x4e04=['redis','localhost','socket.io-emitter','register','request','then','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','SmsAccount','find','options','raw','where','attributes','include','map','model','ShowSmsAccount','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults'];(function(_0x58c576,_0x3df9c6){var _0x2677c3=function(_0x9a8fca){while(--_0x9a8fca){_0x58c576['push'](_0x58c576['shift']());}};_0x2677c3(++_0x3df9c6);}(_0x4e04,0x123));var _0x44e0=function(_0x368bba,_0x1f625b){_0x368bba=_0x368bba-0x0;var _0x409f8f=_0x4e04[_0x368bba];return _0x409f8f;};'use strict';var _=require(_0x44e0('0x0'));var util=require(_0x44e0('0x1'));var moment=require(_0x44e0('0x2'));var BPromise=require('bluebird');var rs=require(_0x44e0('0x3'));var fs=require('fs');var Redis=require(_0x44e0('0x4'));var db=require(_0x44e0('0x5'))['db'];var utils=require(_0x44e0('0x6'));var logger=require('../../config/logger')(_0x44e0('0x7'));var config=require(_0x44e0('0x8'));var jayson=require(_0x44e0('0x9'));var client=jayson[_0x44e0('0xa')][_0x44e0('0xb')]({'port':0x232a});config['redis']=_[_0x44e0('0xc')](config[_0x44e0('0xd')],{'host':_0x44e0('0xe'),'port':0x18eb});var socket=require(_0x44e0('0xf'))(new Redis(config['redis']));require('./smsAccount.socket')[_0x44e0('0x10')](socket);function respondWithRpcPromise(_0x588336,_0x227228,_0x136703){return new BPromise(function(_0x5c8302,_0x22c046){return client[_0x44e0('0x11')](_0x588336,_0x136703)[_0x44e0('0x12')](function(_0x2d958f){logger['info'](_0x44e0('0x13'),_0x227228,_0x44e0('0x14'));logger[_0x44e0('0x15')](_0x44e0('0x16'),_0x227228,'request\x20sent',JSON[_0x44e0('0x17')](_0x2d958f));if(_0x2d958f[_0x44e0('0x18')]){if(_0x2d958f[_0x44e0('0x18')]['code']===0x1f4){logger[_0x44e0('0x18')](_0x44e0('0x13'),_0x227228,_0x2d958f[_0x44e0('0x18')][_0x44e0('0x19')]);return _0x22c046(_0x2d958f[_0x44e0('0x18')][_0x44e0('0x19')]);}logger['error'](_0x44e0('0x13'),_0x227228,_0x2d958f[_0x44e0('0x18')]['message']);return _0x5c8302(_0x2d958f[_0x44e0('0x18')]['message']);}else{logger[_0x44e0('0x1a')](_0x44e0('0x13'),_0x227228,'request\x20sent');_0x5c8302(_0x2d958f['result']['message']);}})[_0x44e0('0x1b')](function(_0x33ee4f){logger[_0x44e0('0x18')](_0x44e0('0x13'),_0x227228,_0x33ee4f);_0x22c046(_0x33ee4f);});});}exports['ShowSmsAccount']=function(_0x11a76a){var _0x286c3d=this;return new Promise(function(_0x4af8dd,_0xb8a536){return db[_0x44e0('0x1c')][_0x44e0('0x1d')]({'raw':_0x11a76a['options']?_0x11a76a[_0x44e0('0x1e')][_0x44e0('0x1f')]===undefined?!![]:![]:!![],'where':_0x11a76a[_0x44e0('0x1e')]?_0x11a76a[_0x44e0('0x1e')][_0x44e0('0x20')]||null:null,'attributes':_0x11a76a[_0x44e0('0x1e')]?_0x11a76a[_0x44e0('0x1e')][_0x44e0('0x21')]||null:null,'include':_0x11a76a[_0x44e0('0x1e')]?_0x11a76a['options'][_0x44e0('0x22')]?_[_0x44e0('0x23')](_0x11a76a[_0x44e0('0x1e')][_0x44e0('0x22')],function(_0x13f37c){return{'model':db[_0x13f37c[_0x44e0('0x24')]],'as':_0x13f37c['as'],'attributes':_0x13f37c[_0x44e0('0x21')],'include':_0x13f37c['include']?_[_0x44e0('0x23')](_0x13f37c[_0x44e0('0x22')],function(_0x17102e){return{'model':db[_0x17102e[_0x44e0('0x24')]],'as':_0x17102e['as'],'attributes':_0x17102e[_0x44e0('0x21')],'include':_0x17102e[_0x44e0('0x22')]?_[_0x44e0('0x23')](_0x17102e[_0x44e0('0x22')],function(_0x202a48){return{'model':db[_0x202a48['model']],'as':_0x202a48['as'],'attributes':_0x202a48[_0x44e0('0x21')]};}):[]};}):[]};}):[]:[]})[_0x44e0('0x12')](function(_0x25d9e2){logger[_0x44e0('0x1a')]('ShowSmsAccount',_0x11a76a);logger[_0x44e0('0x15')](_0x44e0('0x25'),_0x11a76a,JSON['stringify'](_0x25d9e2));_0x4af8dd(_0x25d9e2);})[_0x44e0('0x1b')](function(_0x195a6c){logger[_0x44e0('0x18')]('ShowSmsAccount',_0x195a6c['message'],_0x11a76a);_0xb8a536(_0x286c3d[_0x44e0('0x18')](0x1f4,_0x195a6c['message']));});});}; \ No newline at end of file +var _0x185e=['ShowSmsAccount','SmsAccount','find','options','where','include','model','map','attributes','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s','debug','request\x20sent','error','message','catch'];(function(_0x7a5a4f,_0x355beb){var _0x39d1e4=function(_0x4391ed){while(--_0x4391ed){_0x7a5a4f['push'](_0x7a5a4f['shift']());}};_0x39d1e4(++_0x355beb);}(_0x185e,0x10d));var _0xe185=function(_0x13bc9b,_0x3df78f){_0x13bc9b=_0x13bc9b-0x0;var _0x592837=_0x185e[_0x13bc9b];return _0x592837;};'use strict';var _=require(_0xe185('0x0'));var util=require(_0xe185('0x1'));var moment=require(_0xe185('0x2'));var BPromise=require(_0xe185('0x3'));var rs=require(_0xe185('0x4'));var fs=require('fs');var Redis=require(_0xe185('0x5'));var db=require(_0xe185('0x6'))['db'];var utils=require(_0xe185('0x7'));var logger=require(_0xe185('0x8'))('rpc');var config=require(_0xe185('0x9'));var jayson=require(_0xe185('0xa'));var client=jayson['client'][_0xe185('0xb')]({'port':0x232a});config[_0xe185('0xc')]=_[_0xe185('0xd')](config[_0xe185('0xc')],{'host':_0xe185('0xe'),'port':0x18eb});var socket=require(_0xe185('0xf'))(new Redis(config['redis']));require(_0xe185('0x10'))[_0xe185('0x11')](socket);function respondWithRpcPromise(_0x7989de,_0x1305f9,_0x47069c){return new BPromise(function(_0x277de3,_0x4636f4){return client[_0xe185('0x12')](_0x7989de,_0x47069c)[_0xe185('0x13')](function(_0x469899){logger[_0xe185('0x14')](_0xe185('0x15'),_0x1305f9,'request\x20sent');logger[_0xe185('0x16')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1305f9,_0xe185('0x17'),JSON['stringify'](_0x469899));if(_0x469899[_0xe185('0x18')]){if(_0x469899[_0xe185('0x18')]['code']===0x1f4){logger[_0xe185('0x18')](_0xe185('0x15'),_0x1305f9,_0x469899[_0xe185('0x18')][_0xe185('0x19')]);return _0x4636f4(_0x469899[_0xe185('0x18')][_0xe185('0x19')]);}logger[_0xe185('0x18')](_0xe185('0x15'),_0x1305f9,_0x469899[_0xe185('0x18')][_0xe185('0x19')]);return _0x277de3(_0x469899['error'][_0xe185('0x19')]);}else{logger['info'](_0xe185('0x15'),_0x1305f9,'request\x20sent');_0x277de3(_0x469899['result']['message']);}})[_0xe185('0x1a')](function(_0x4a9f99){logger[_0xe185('0x18')]('SmsAccount,\x20%s,\x20%s',_0x1305f9,_0x4a9f99);_0x4636f4(_0x4a9f99);});});}exports[_0xe185('0x1b')]=function(_0x4c7df9){var _0x3a3270=this;return new Promise(function(_0x3111a8,_0x4135f9){return db[_0xe185('0x1c')][_0xe185('0x1d')]({'raw':_0x4c7df9[_0xe185('0x1e')]?_0x4c7df9[_0xe185('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x4c7df9[_0xe185('0x1e')]?_0x4c7df9['options'][_0xe185('0x1f')]||null:null,'attributes':_0x4c7df9[_0xe185('0x1e')]?_0x4c7df9['options']['attributes']||null:null,'include':_0x4c7df9['options']?_0x4c7df9[_0xe185('0x1e')][_0xe185('0x20')]?_['map'](_0x4c7df9[_0xe185('0x1e')]['include'],function(_0x516990){return{'model':db[_0x516990[_0xe185('0x21')]],'as':_0x516990['as'],'attributes':_0x516990['attributes'],'include':_0x516990[_0xe185('0x20')]?_[_0xe185('0x22')](_0x516990[_0xe185('0x20')],function(_0x4d97ed){return{'model':db[_0x4d97ed[_0xe185('0x21')]],'as':_0x4d97ed['as'],'attributes':_0x4d97ed['attributes'],'include':_0x4d97ed['include']?_[_0xe185('0x22')](_0x4d97ed[_0xe185('0x20')],function(_0x35d21f){return{'model':db[_0x35d21f[_0xe185('0x21')]],'as':_0x35d21f['as'],'attributes':_0x35d21f[_0xe185('0x23')]};}):[]};}):[]};}):[]:[]})[_0xe185('0x13')](function(_0x2fae63){logger[_0xe185('0x14')](_0xe185('0x1b'),_0x4c7df9);logger['debug'](_0xe185('0x1b'),_0x4c7df9,JSON[_0xe185('0x24')](_0x2fae63));_0x3111a8(_0x2fae63);})[_0xe185('0x1a')](function(_0x383982){logger[_0xe185('0x18')](_0xe185('0x1b'),_0x383982[_0xe185('0x19')],_0x4c7df9);_0x4135f9(_0x3a3270[_0xe185('0x18')](0x1f4,_0x383982[_0xe185('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 7b4e606..fe1435a 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(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_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 +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'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 8c55148..3888b2f 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 _0xe14b=['/:id','create','put','exports','multer','util','express','Router','../../components/auth/service','./smsApplication.controller','get','isAuthenticated','index'];(function(_0x4bc9db,_0x49f19e){var _0x180469=function(_0x425c54){while(--_0x425c54){_0x4bc9db['push'](_0x4bc9db['shift']());}};_0x180469(++_0x49f19e);}(_0xe14b,0x93));var _0xbe14=function(_0x38eff2,_0x3d308f){_0x38eff2=_0x38eff2-0x0;var _0x38f1ea=_0xe14b[_0x38eff2];return _0x38f1ea;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xbe14('0xa')]);router[_0xbe14('0xb')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['update']);router['delete'](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['destroy']);module[_0xbe14('0xc')]=router; \ No newline at end of file +var _0x7217=['Router','fs-extra','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x422a98,_0x3337f6){var _0x2859b4=function(_0x21e865){while(--_0x21e865){_0x422a98['push'](_0x422a98['shift']());}};_0x2859b4(++_0x3337f6);}(_0x7217,0x19e));var _0x7721=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0x7217[_0x2d8fc2];return _0x3a9e53;};'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('0xd')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0xf')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller['update']);router[_0x7721('0x10')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0x11')]);module[_0x7721('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index be91836..233a561 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 _0x8dd2=['INTEGER','STRING','TEXT','*,*,*,*','sequelize','exports'];(function(_0x1479dc,_0x1f3dc1){var _0x29e589=function(_0xd801ef){while(--_0xd801ef){_0x1479dc['push'](_0x1479dc['shift']());}};_0x29e589(++_0x1f3dc1);}(_0x8dd2,0x106));var _0x28dd=function(_0x5cbab1,_0x32afac){_0x5cbab1=_0x5cbab1-0x0;var _0x2637f4=_0x8dd2[_0x5cbab1];return _0x2637f4;};'use strict';var Sequelize=require(_0x28dd('0x0'));module[_0x28dd('0x1')]={'priority':{'type':Sequelize[_0x28dd('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x28dd('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x28dd('0x4')]()},'description':{'type':Sequelize[_0x28dd('0x3')]},'interval':{'type':Sequelize[_0x28dd('0x3')],'defaultValue':_0x28dd('0x5')}}; \ No newline at end of file +var _0x6ef9=['STRING','TEXT','INTEGER'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x6ef9,0xfb));var _0x96ef=function(_0x4ac424,_0x554b5d){_0x4ac424=_0x4ac424-0x0;var _0xe1b890=_0x6ef9[_0x4ac424];return _0xe1b890;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x96ef('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x96ef('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x96ef('0x2')]()},'description':{'type':Sequelize[_0x96ef('0x1')]},'interval':{'type':Sequelize[_0x96ef('0x1')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 7ac6b04..05cd09f 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 _0x6a3f=['mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','sendStatus','status','end','json','limit','offset','count','apply','save','update','then','destroy','error','stack','name','map','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','SmsApplication','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','eml-format','zip-dir','request-promise','moment','bluebird'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x6a3f,0xd6));var _0xf6a3=function(_0x375961,_0x211a76){_0x375961=_0x375961-0x0;var _0x50f35a=_0x6a3f[_0x375961];return _0x50f35a;};'use strict';var emlformat=require(_0xf6a3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf6a3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf6a3('0x2'));var moment=require(_0xf6a3('0x3'));var BPromise=require(_0xf6a3('0x4'));var Mustache=require(_0xf6a3('0x5'));var util=require(_0xf6a3('0x6'));var path=require(_0xf6a3('0x7'));var sox=require(_0xf6a3('0x8'));var csv=require(_0xf6a3('0x9'));var ejs=require(_0xf6a3('0xa'));var fs=require('fs');var fs_extra=require(_0xf6a3('0xb'));var _=require(_0xf6a3('0xc'));var squel=require(_0xf6a3('0xd'));var crypto=require(_0xf6a3('0xe'));var jsforce=require(_0xf6a3('0xf'));var deskjs=require(_0xf6a3('0x10'));var toCsv=require('to-csv');var querystring=require(_0xf6a3('0x11'));var Papa=require(_0xf6a3('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf6a3('0x13'));var as=require(_0xf6a3('0x14'));var hardwareService=require(_0xf6a3('0x15'));var logger=require(_0xf6a3('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf6a3('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x503613,_0x269fde){_0x269fde=_0x269fde||0xcc;return function(_0xf938fd){if(_0xf938fd){return _0x503613[_0xf6a3('0x18')](_0x269fde);}return _0x503613[_0xf6a3('0x19')](_0x269fde)[_0xf6a3('0x1a')]();};}function respondWithResult(_0x28e562,_0x240059){_0x240059=_0x240059||0xc8;return function(_0x27f58e){if(_0x27f58e){return _0x28e562[_0xf6a3('0x19')](_0x240059)[_0xf6a3('0x1b')](_0x27f58e);}};}function respondWithFilteredResult(_0x2571c3,_0x43843d){return function(_0x37d4c4){if(_0x37d4c4){var _0x420eb9=typeof _0x43843d['offset']==='undefined'&&typeof _0x43843d[_0xf6a3('0x1c')]==='undefined';var _0x37760e=_0x37d4c4['count'];var _0x33f7a0=_0x420eb9?0x0:_0x43843d[_0xf6a3('0x1d')];var _0x25ac63=_0x420eb9?_0x37d4c4[_0xf6a3('0x1e')]:_0x43843d[_0xf6a3('0x1d')]+_0x43843d['limit'];var _0x51b95b;if(_0x25ac63>=_0x37760e){_0x25ac63=_0x37760e;_0x51b95b=0xc8;}else{_0x51b95b=0xce;}_0x2571c3[_0xf6a3('0x19')](_0x51b95b);return _0x2571c3['set']('Content-Range',_0x33f7a0+'-'+_0x25ac63+'/'+_0x37760e)[_0xf6a3('0x1b')](_0x37d4c4);}return null;};}function patchUpdates(_0x12ec7f){return function(_0x1c30d5){try{jsonpatch[_0xf6a3('0x1f')](_0x1c30d5,_0x12ec7f,!![]);}catch(_0x249e00){return BPromise['reject'](_0x249e00);}return _0x1c30d5[_0xf6a3('0x20')]();};}function saveUpdates(_0x2d1850,_0xb0be93){return function(_0x35ecab){if(_0x35ecab){return _0x35ecab[_0xf6a3('0x21')](_0x2d1850)[_0xf6a3('0x22')](function(_0x32656d){return _0x32656d;});}return null;};}function removeEntity(_0x4399dc,_0x4fdfdd){return function(_0x233e52){if(_0x233e52){return _0x233e52[_0xf6a3('0x23')]()[_0xf6a3('0x22')](function(){_0x4399dc[_0xf6a3('0x19')](0xcc)[_0xf6a3('0x1a')]();});}};}function handleEntityNotFound(_0xf21463,_0x5d6b89){return function(_0x28bf7b){if(!_0x28bf7b){_0xf21463[_0xf6a3('0x18')](0x194);}return _0x28bf7b;};}function handleError(_0x5276f4,_0x1d5692){_0x1d5692=_0x1d5692||0x1f4;return function(_0x46b578){logger[_0xf6a3('0x24')](_0x46b578[_0xf6a3('0x25')]);if(_0x46b578[_0xf6a3('0x26')]){delete _0x46b578[_0xf6a3('0x26')];}_0x5276f4[_0xf6a3('0x19')](_0x1d5692)['send'](_0x46b578);};}exports['index']=function(_0x468b16,_0x3d03fb){var _0x294c72={},_0x157d22={},_0x134d58={'count':0x0,'rows':[]};var _0xcc5f75=_[_0xf6a3('0x27')](db['SmsApplication']['rawAttributes'],function(_0x488fb5){return{'name':_0x488fb5[_0xf6a3('0x28')],'type':_0x488fb5[_0xf6a3('0x29')][_0xf6a3('0x2a')]};});_0x157d22['model']=_['map'](_0xcc5f75,_0xf6a3('0x26'));_0x157d22[_0xf6a3('0x2b')]=_[_0xf6a3('0x2c')](_0x468b16[_0xf6a3('0x2b')]);_0x157d22[_0xf6a3('0x2d')]=_[_0xf6a3('0x2e')](_0x157d22['model'],_0x157d22[_0xf6a3('0x2b')]);_0x294c72['attributes']=_['intersection'](_0x157d22[_0xf6a3('0x2f')],qs[_0xf6a3('0x30')](_0x468b16[_0xf6a3('0x2b')][_0xf6a3('0x30')]));_0x294c72[_0xf6a3('0x31')]=_0x294c72[_0xf6a3('0x31')][_0xf6a3('0x32')]?_0x294c72[_0xf6a3('0x31')]:_0x157d22[_0xf6a3('0x2f')];if(!_0x468b16[_0xf6a3('0x2b')][_0xf6a3('0x33')](_0xf6a3('0x34'))){_0x294c72[_0xf6a3('0x1c')]=qs[_0xf6a3('0x1c')](_0x468b16[_0xf6a3('0x2b')][_0xf6a3('0x1c')]);_0x294c72[_0xf6a3('0x1d')]=qs[_0xf6a3('0x1d')](_0x468b16[_0xf6a3('0x2b')][_0xf6a3('0x1d')]);}_0x294c72[_0xf6a3('0x35')]=qs[_0xf6a3('0x36')](_0x468b16[_0xf6a3('0x2b')][_0xf6a3('0x36')]);_0x294c72[_0xf6a3('0x37')]=qs[_0xf6a3('0x2d')](_[_0xf6a3('0x38')](_0x468b16[_0xf6a3('0x2b')],_0x157d22[_0xf6a3('0x2d')]),_0xcc5f75);if(_0x468b16[_0xf6a3('0x2b')]['filter']){_0x294c72['where']=_[_0xf6a3('0x39')](_0x294c72[_0xf6a3('0x37')],{'$or':_[_0xf6a3('0x27')](_0xcc5f75,function(_0x3f7f53){if(_0x3f7f53[_0xf6a3('0x29')]!==_0xf6a3('0x3a')){var _0x46ab0b={};_0x46ab0b[_0x3f7f53[_0xf6a3('0x26')]]={'$like':'%'+_0x468b16[_0xf6a3('0x2b')][_0xf6a3('0x3b')]+'%'};return _0x46ab0b;}})});}_0x294c72=_[_0xf6a3('0x39')]({},_0x294c72,_0x468b16[_0xf6a3('0x3c')]);var _0x161b99={'where':_0x294c72[_0xf6a3('0x37')]};return db[_0xf6a3('0x3d')]['count'](_0x161b99)[_0xf6a3('0x22')](function(_0x56e7bc){_0x134d58[_0xf6a3('0x1e')]=_0x56e7bc;if(_0x468b16[_0xf6a3('0x2b')]['includeAll']){_0x294c72[_0xf6a3('0x3e')]=[{'all':!![]}];}return db[_0xf6a3('0x3d')][_0xf6a3('0x3f')](_0x294c72);})[_0xf6a3('0x22')](function(_0x50c28e){_0x134d58[_0xf6a3('0x40')]=_0x50c28e;return _0x134d58;})['then'](respondWithFilteredResult(_0x3d03fb,_0x294c72))[_0xf6a3('0x41')](handleError(_0x3d03fb,null));};exports[_0xf6a3('0x42')]=function(_0x55c8ac,_0x2fb242){var _0x22edac={'raw':!![],'where':{'id':_0x55c8ac[_0xf6a3('0x43')]['id']}},_0x8f578f={};_0x8f578f['model']=_['keys'](db['SmsApplication'][_0xf6a3('0x44')]);_0x8f578f['query']=_[_0xf6a3('0x2c')](_0x55c8ac[_0xf6a3('0x2b')]);_0x8f578f[_0xf6a3('0x2d')]=_['intersection'](_0x8f578f[_0xf6a3('0x2f')],_0x8f578f['query']);_0x22edac[_0xf6a3('0x31')]=_[_0xf6a3('0x2e')](_0x8f578f['model'],qs[_0xf6a3('0x30')](_0x55c8ac['query'][_0xf6a3('0x30')]));_0x22edac[_0xf6a3('0x31')]=_0x22edac[_0xf6a3('0x31')]['length']?_0x22edac[_0xf6a3('0x31')]:_0x8f578f[_0xf6a3('0x2f')];if(_0x55c8ac[_0xf6a3('0x2b')][_0xf6a3('0x45')]){_0x22edac['include']=[{'all':!![]}];}_0x22edac=_[_0xf6a3('0x39')]({},_0x22edac,_0x55c8ac[_0xf6a3('0x3c')]);return db[_0xf6a3('0x3d')][_0xf6a3('0x46')](_0x22edac)['then'](handleEntityNotFound(_0x2fb242,null))[_0xf6a3('0x22')](respondWithResult(_0x2fb242,null))[_0xf6a3('0x41')](handleError(_0x2fb242,null));};exports[_0xf6a3('0x47')]=function(_0x3eb5df,_0x2d84e9){return db[_0xf6a3('0x3d')]['create'](_0x3eb5df[_0xf6a3('0x48')],{})['then'](respondWithResult(_0x2d84e9,0xc9))[_0xf6a3('0x41')](handleError(_0x2d84e9,null));};exports[_0xf6a3('0x21')]=function(_0x2326c4,_0x2e7292){if(_0x2326c4[_0xf6a3('0x48')]['id']){delete _0x2326c4[_0xf6a3('0x48')]['id'];}return db[_0xf6a3('0x3d')]['find']({'where':{'id':_0x2326c4['params']['id']}})[_0xf6a3('0x22')](handleEntityNotFound(_0x2e7292,null))[_0xf6a3('0x22')](saveUpdates(_0x2326c4[_0xf6a3('0x48')],null))[_0xf6a3('0x22')](respondWithResult(_0x2e7292,null))[_0xf6a3('0x41')](handleError(_0x2e7292,null));};exports[_0xf6a3('0x23')]=function(_0x5ebe9e,_0x44da09){return db[_0xf6a3('0x3d')]['find']({'where':{'id':_0x5ebe9e[_0xf6a3('0x43')]['id']}})[_0xf6a3('0x22')](handleEntityNotFound(_0x44da09,null))[_0xf6a3('0x22')](removeEntity(_0x44da09,null))[_0xf6a3('0x41')](handleError(_0x44da09,null));}; \ No newline at end of file +var _0x0936=['bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject','destroy','then','end','error','stack','name','index','map','SmsApplication','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','options','find','create','update','body','params','eml-format','rimraf','request-promise'];(function(_0x463309,_0x5c55c8){var _0x9c8877=function(_0x55e6b2){while(--_0x55e6b2){_0x463309['push'](_0x463309['shift']());}};_0x9c8877(++_0x5c55c8);}(_0x0936,0x16a));var _0x6093=function(_0xf77b43,_0x49f0a4){_0xf77b43=_0xf77b43-0x0;var _0x1f5ec3=_0x0936[_0xf77b43];return _0x1f5ec3;};'use strict';var emlformat=require(_0x6093('0x0'));var rimraf=require(_0x6093('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6093('0x2'));var moment=require('moment');var BPromise=require(_0x6093('0x3'));var Mustache=require(_0x6093('0x4'));var util=require(_0x6093('0x5'));var path=require(_0x6093('0x6'));var sox=require(_0x6093('0x7'));var csv=require(_0x6093('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6093('0x9'));var _=require(_0x6093('0xa'));var squel=require(_0x6093('0xb'));var crypto=require('crypto');var jsforce=require(_0x6093('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6093('0x8'));var querystring=require('querystring');var Papa=require(_0x6093('0xd'));var Redis=require(_0x6093('0xe'));var authService=require(_0x6093('0xf'));var qs=require(_0x6093('0x10'));var as=require(_0x6093('0x11'));var hardwareService=require(_0x6093('0x12'));var logger=require(_0x6093('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x6093('0x14'));var licenseUtil=require(_0x6093('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x36d846,_0x1303d6){_0x1303d6=_0x1303d6||0xcc;return function(_0x3d1b18){if(_0x3d1b18){return _0x36d846[_0x6093('0x16')](_0x1303d6);}return _0x36d846['status'](_0x1303d6)['end']();};}function respondWithResult(_0x22af3e,_0x505f43){_0x505f43=_0x505f43||0xc8;return function(_0x7c7d21){if(_0x7c7d21){return _0x22af3e[_0x6093('0x17')](_0x505f43)[_0x6093('0x18')](_0x7c7d21);}};}function respondWithFilteredResult(_0x5364c6,_0x419381){return function(_0x5dc678){if(_0x5dc678){var _0x238c05=typeof _0x419381['offset']===_0x6093('0x19')&&typeof _0x419381[_0x6093('0x1a')]===_0x6093('0x19');var _0x237f00=_0x5dc678[_0x6093('0x1b')];var _0x2647da=_0x238c05?0x0:_0x419381[_0x6093('0x1c')];var _0x366b28=_0x238c05?_0x5dc678[_0x6093('0x1b')]:_0x419381[_0x6093('0x1c')]+_0x419381[_0x6093('0x1a')];var _0x4528a0;if(_0x366b28>=_0x237f00){_0x366b28=_0x237f00;_0x4528a0=0xc8;}else{_0x4528a0=0xce;}_0x5364c6[_0x6093('0x17')](_0x4528a0);return _0x5364c6['set'](_0x6093('0x1d'),_0x2647da+'-'+_0x366b28+'/'+_0x237f00)[_0x6093('0x18')](_0x5dc678);}return null;};}function patchUpdates(_0x382429){return function(_0x299668){try{jsonpatch[_0x6093('0x1e')](_0x299668,_0x382429,!![]);}catch(_0x297357){return BPromise[_0x6093('0x1f')](_0x297357);}return _0x299668['save']();};}function saveUpdates(_0x3071f8,_0x22bfd0){return function(_0x4d5cb4){if(_0x4d5cb4){return _0x4d5cb4['update'](_0x3071f8)['then'](function(_0xe7eead){return _0xe7eead;});}return null;};}function removeEntity(_0x2d23cd,_0x496bc3){return function(_0x3c627a){if(_0x3c627a){return _0x3c627a[_0x6093('0x20')]()[_0x6093('0x21')](function(){_0x2d23cd[_0x6093('0x17')](0xcc)[_0x6093('0x22')]();});}};}function handleEntityNotFound(_0x343341,_0x296c3a){return function(_0x2a1d24){if(!_0x2a1d24){_0x343341[_0x6093('0x16')](0x194);}return _0x2a1d24;};}function handleError(_0x2e0910,_0x131677){_0x131677=_0x131677||0x1f4;return function(_0x368424){logger[_0x6093('0x23')](_0x368424[_0x6093('0x24')]);if(_0x368424[_0x6093('0x25')]){delete _0x368424['name'];}_0x2e0910[_0x6093('0x17')](_0x131677)['send'](_0x368424);};}exports[_0x6093('0x26')]=function(_0x5ae340,_0x8afb98){var _0x166deb={},_0x61ead={},_0x573a03={'count':0x0,'rows':[]};var _0x38d7dd=_[_0x6093('0x27')](db[_0x6093('0x28')][_0x6093('0x29')],function(_0x1d77b5){return{'name':_0x1d77b5[_0x6093('0x2a')],'type':_0x1d77b5[_0x6093('0x2b')][_0x6093('0x2c')]};});_0x61ead[_0x6093('0x2d')]=_[_0x6093('0x27')](_0x38d7dd,_0x6093('0x25'));_0x61ead[_0x6093('0x2e')]=_[_0x6093('0x2f')](_0x5ae340[_0x6093('0x2e')]);_0x61ead['filters']=_['intersection'](_0x61ead[_0x6093('0x2d')],_0x61ead[_0x6093('0x2e')]);_0x166deb['attributes']=_[_0x6093('0x30')](_0x61ead[_0x6093('0x2d')],qs[_0x6093('0x31')](_0x5ae340[_0x6093('0x2e')][_0x6093('0x31')]));_0x166deb[_0x6093('0x32')]=_0x166deb[_0x6093('0x32')][_0x6093('0x33')]?_0x166deb[_0x6093('0x32')]:_0x61ead[_0x6093('0x2d')];if(!_0x5ae340['query'][_0x6093('0x34')](_0x6093('0x35'))){_0x166deb[_0x6093('0x1a')]=qs['limit'](_0x5ae340['query'][_0x6093('0x1a')]);_0x166deb[_0x6093('0x1c')]=qs[_0x6093('0x1c')](_0x5ae340[_0x6093('0x2e')]['offset']);}_0x166deb[_0x6093('0x36')]=qs[_0x6093('0x37')](_0x5ae340['query'][_0x6093('0x37')]);_0x166deb[_0x6093('0x38')]=qs[_0x6093('0x39')](_[_0x6093('0x3a')](_0x5ae340['query'],_0x61ead[_0x6093('0x39')]),_0x38d7dd);if(_0x5ae340[_0x6093('0x2e')][_0x6093('0x3b')]){_0x166deb[_0x6093('0x38')]=_[_0x6093('0x3c')](_0x166deb[_0x6093('0x38')],{'$or':_[_0x6093('0x27')](_0x38d7dd,function(_0x5371dd){if(_0x5371dd[_0x6093('0x2b')]!==_0x6093('0x3d')){var _0x533a1c={};_0x533a1c[_0x5371dd['name']]={'$like':'%'+_0x5ae340[_0x6093('0x2e')][_0x6093('0x3b')]+'%'};return _0x533a1c;}})});}_0x166deb=_['merge']({},_0x166deb,_0x5ae340['options']);var _0x15d52a={'where':_0x166deb['where']};return db[_0x6093('0x28')]['count'](_0x15d52a)['then'](function(_0x3098df){_0x573a03['count']=_0x3098df;if(_0x5ae340[_0x6093('0x2e')][_0x6093('0x3e')]){_0x166deb[_0x6093('0x3f')]=[{'all':!![]}];}return db[_0x6093('0x28')]['findAll'](_0x166deb);})[_0x6093('0x21')](function(_0x469f1b){_0x573a03[_0x6093('0x40')]=_0x469f1b;return _0x573a03;})[_0x6093('0x21')](respondWithFilteredResult(_0x8afb98,_0x166deb))[_0x6093('0x41')](handleError(_0x8afb98,null));};exports[_0x6093('0x42')]=function(_0x5b1a98,_0x422ec5){var _0x37921e={'raw':!![],'where':{'id':_0x5b1a98['params']['id']}},_0x130035={};_0x130035[_0x6093('0x2d')]=_[_0x6093('0x2f')](db['SmsApplication'][_0x6093('0x29')]);_0x130035[_0x6093('0x2e')]=_[_0x6093('0x2f')](_0x5b1a98[_0x6093('0x2e')]);_0x130035['filters']=_['intersection'](_0x130035[_0x6093('0x2d')],_0x130035[_0x6093('0x2e')]);_0x37921e[_0x6093('0x32')]=_[_0x6093('0x30')](_0x130035[_0x6093('0x2d')],qs['fields'](_0x5b1a98['query']['fields']));_0x37921e[_0x6093('0x32')]=_0x37921e[_0x6093('0x32')][_0x6093('0x33')]?_0x37921e[_0x6093('0x32')]:_0x130035['model'];if(_0x5b1a98['query'][_0x6093('0x3e')]){_0x37921e['include']=[{'all':!![]}];}_0x37921e=_[_0x6093('0x3c')]({},_0x37921e,_0x5b1a98[_0x6093('0x43')]);return db[_0x6093('0x28')][_0x6093('0x44')](_0x37921e)[_0x6093('0x21')](handleEntityNotFound(_0x422ec5,null))[_0x6093('0x21')](respondWithResult(_0x422ec5,null))[_0x6093('0x41')](handleError(_0x422ec5,null));};exports['create']=function(_0x7699f3,_0x141add){return db[_0x6093('0x28')][_0x6093('0x45')](_0x7699f3['body'],{})['then'](respondWithResult(_0x141add,0xc9))[_0x6093('0x41')](handleError(_0x141add,null));};exports[_0x6093('0x46')]=function(_0x451e02,_0x4e4791){if(_0x451e02[_0x6093('0x47')]['id']){delete _0x451e02['body']['id'];}return db[_0x6093('0x28')]['find']({'where':{'id':_0x451e02[_0x6093('0x48')]['id']}})[_0x6093('0x21')](handleEntityNotFound(_0x4e4791,null))[_0x6093('0x21')](saveUpdates(_0x451e02['body'],null))['then'](respondWithResult(_0x4e4791,null))['catch'](handleError(_0x4e4791,null));};exports[_0x6093('0x20')]=function(_0x120556,_0x263a4d){return db['SmsApplication'][_0x6093('0x44')]({'where':{'id':_0x120556['params']['id']}})[_0x6093('0x21')](handleEntityNotFound(_0x263a4d,null))['then'](removeEntity(_0x263a4d,null))[_0x6093('0x41')](handleError(_0x263a4d,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 1dd2a02..d1e3360 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 _0xbdba=['SmsApplication','sms_applications','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','path','rimraf','./smsApplication.attributes','exports','define'];(function(_0x3674cf,_0x32608b){var _0x5071e4=function(_0x399216){while(--_0x399216){_0x3674cf['push'](_0x3674cf['shift']());}};_0x5071e4(++_0x32608b);}(_0xbdba,0x107));var _0xabdb=function(_0x106d91,_0x2fae0c){_0x106d91=_0x106d91-0x0;var _0x37b786=_0xbdba[_0x106d91];return _0x37b786;};'use strict';var _=require(_0xabdb('0x0'));var util=require('util');var logger=require(_0xabdb('0x1'))(_0xabdb('0x2'));var moment=require(_0xabdb('0x3'));var BPromise=require(_0xabdb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xabdb('0x5'));var rimraf=require(_0xabdb('0x6'));var config=require('../../config/environment');var attributes=require(_0xabdb('0x7'));module[_0xabdb('0x8')]=function(_0x235516,_0x5eed78){return _0x235516[_0xabdb('0x9')](_0xabdb('0xa'),attributes,{'tableName':_0xabdb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xabdb('0xc')});}; \ No newline at end of file +var _0xadbf=['util','api','moment','bluebird','request-promise','path','../../config/environment','./smsApplication.attributes','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0xadbf,0x15d));var _0xfadb=function(_0x4fd7d2,_0x4cc453){_0x4fd7d2=_0x4fd7d2-0x0;var _0x52e2a4=_0xadbf[_0x4fd7d2];return _0x52e2a4;};'use strict';var _=require(_0xfadb('0x0'));var util=require(_0xfadb('0x1'));var logger=require('../../config/logger')(_0xfadb('0x2'));var moment=require(_0xfadb('0x3'));var BPromise=require(_0xfadb('0x4'));var rp=require(_0xfadb('0x5'));var fs=require('fs');var path=require(_0xfadb('0x6'));var rimraf=require('rimraf');var config=require(_0xfadb('0x7'));var attributes=require(_0xfadb('0x8'));module['exports']=function(_0x8027a3,_0x565fa4){return _0x8027a3[_0xfadb('0x9')](_0xfadb('0xa'),attributes,{'tableName':_0xfadb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfadb('0xc'),'collate':_0xfadb('0xd')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index e6442ff..da4b4b8 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 _0x16a2=['error','message','info','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','SmsApplication,\x20%s,\x20%s','request\x20sent','SmsApplication,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x281388,_0x2f1d22){var _0x5101b1=function(_0x35ea53){while(--_0x35ea53){_0x281388['push'](_0x281388['shift']());}};_0x5101b1(++_0x2f1d22);}(_0x16a2,0x1d0));var _0x216a=function(_0x470bfb,_0x389787){_0x470bfb=_0x470bfb-0x0;var _0x2f5d97=_0x16a2[_0x470bfb];return _0x2f5d97;};'use strict';var _=require(_0x216a('0x0'));var util=require(_0x216a('0x1'));var moment=require(_0x216a('0x2'));var BPromise=require(_0x216a('0x3'));var rs=require(_0x216a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x216a('0x5'));var logger=require(_0x216a('0x6'))(_0x216a('0x7'));var config=require(_0x216a('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x216a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x6dbac7,_0x2dd88c,_0x55f347){return new BPromise(function(_0xf619f8,_0x20e3f7){return client[_0x216a('0xa')](_0x6dbac7,_0x55f347)[_0x216a('0xb')](function(_0x4ce00d){logger['info'](_0x216a('0xc'),_0x2dd88c,_0x216a('0xd'));logger['debug'](_0x216a('0xe'),_0x2dd88c,_0x216a('0xd'),JSON[_0x216a('0xf')](_0x4ce00d));if(_0x4ce00d[_0x216a('0x10')]){if(_0x4ce00d[_0x216a('0x10')]['code']===0x1f4){logger[_0x216a('0x10')](_0x216a('0xc'),_0x2dd88c,_0x4ce00d['error'][_0x216a('0x11')]);return _0x20e3f7(_0x4ce00d[_0x216a('0x10')]['message']);}logger[_0x216a('0x10')](_0x216a('0xc'),_0x2dd88c,_0x4ce00d['error'][_0x216a('0x11')]);return _0xf619f8(_0x4ce00d['error'][_0x216a('0x11')]);}else{logger[_0x216a('0x12')](_0x216a('0xc'),_0x2dd88c,_0x216a('0xd'));_0xf619f8(_0x4ce00d['result'][_0x216a('0x11')]);}})[_0x216a('0x13')](function(_0x4c1a4d){logger[_0x216a('0x10')]('SmsApplication,\x20%s,\x20%s',_0x2dd88c,_0x4c1a4d);_0x20e3f7(_0x4c1a4d);});});} \ No newline at end of file +var _0xa613=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x3f4796,_0x58ab95){var _0x23308a=function(_0xe28c0f){while(--_0xe28c0f){_0x3f4796['push'](_0x3f4796['shift']());}};_0x23308a(++_0x58ab95);}(_0xa613,0x8a));var _0x3a61=function(_0x3e1415,_0x2ad5ee){_0x3e1415=_0x3e1415-0x0;var _0x2e1ec7=_0xa613[_0x3e1415];return _0x2e1ec7;};'use strict';var _=require(_0x3a61('0x0'));var util=require('util');var moment=require(_0x3a61('0x1'));var BPromise=require(_0x3a61('0x2'));var rs=require(_0x3a61('0x3'));var fs=require('fs');var Redis=require(_0x3a61('0x4'));var db=require(_0x3a61('0x5'))['db'];var utils=require(_0x3a61('0x6'));var logger=require(_0x3a61('0x7'))(_0x3a61('0x8'));var config=require(_0x3a61('0x9'));var jayson=require(_0x3a61('0xa'));var client=jayson['client'][_0x3a61('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x25bb94,_0x5ba604,_0xcb9ceb){return new BPromise(function(_0x255a69,_0x3c7bdd){return client[_0x3a61('0xc')](_0x25bb94,_0xcb9ceb)[_0x3a61('0xd')](function(_0x538238){logger[_0x3a61('0xe')](_0x3a61('0xf'),_0x5ba604,'request\x20sent');logger['debug']('SmsApplication,\x20%s,\x20%s,\x20%s',_0x5ba604,_0x3a61('0x10'),JSON[_0x3a61('0x11')](_0x538238));if(_0x538238['error']){if(_0x538238[_0x3a61('0x12')][_0x3a61('0x13')]===0x1f4){logger[_0x3a61('0x12')](_0x3a61('0xf'),_0x5ba604,_0x538238[_0x3a61('0x12')][_0x3a61('0x14')]);return _0x3c7bdd(_0x538238['error']['message']);}logger[_0x3a61('0x12')](_0x3a61('0xf'),_0x5ba604,_0x538238[_0x3a61('0x12')][_0x3a61('0x14')]);return _0x255a69(_0x538238[_0x3a61('0x12')]['message']);}else{logger['info'](_0x3a61('0xf'),_0x5ba604,'request\x20sent');_0x255a69(_0x538238[_0x3a61('0x15')]['message']);}})[_0x3a61('0x16')](function(_0x29d99a){logger['error'](_0x3a61('0xf'),_0x5ba604,_0x29d99a);_0x3c7bdd(_0x29d99a);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 2d92d31..5431795 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 _0x34b7=['/:id/tags','removeTags','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','getMessages','/:id/download','download','post','create','/:id/messages','addMessage','tracked','sms','smsinteraction:addtags','addTags','put','/:id','smsinteraction:update','delete','destroy'];(function(_0x954b3a,_0x10a7c1){var _0x3a313e=function(_0x1070ad){while(--_0x1070ad){_0x954b3a['push'](_0x954b3a['shift']());}};_0x3a313e(++_0x10a7c1);}(_0x34b7,0x196));var _0x734b=function(_0xb14b26,_0x38cf9f){_0xb14b26=_0xb14b26-0x0;var _0xfdb28a=_0x34b7[_0xb14b26];return _0xfdb28a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x734b('0x0'));var timeout=require(_0x734b('0x1'));var express=require(_0x734b('0x2'));var router=express[_0x734b('0x3')]();var fs_extra=require(_0x734b('0x4'));var auth=require(_0x734b('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x734b('0x6'));router[_0x734b('0x7')]('/',auth[_0x734b('0x8')](),controller[_0x734b('0x9')]);router[_0x734b('0x7')](_0x734b('0xa'),auth['isAuthenticated'](),controller[_0x734b('0xb')]);router[_0x734b('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x734b('0x7')]('/:id/messages',auth[_0x734b('0x8')](),controller[_0x734b('0xc')]);router[_0x734b('0x7')](_0x734b('0xd'),auth[_0x734b('0x8')](),controller[_0x734b('0xe')]);router[_0x734b('0xf')]('/',auth[_0x734b('0x8')](),controller[_0x734b('0x10')]);router[_0x734b('0xf')](_0x734b('0x11'),auth[_0x734b('0x8')](),controller[_0x734b('0x12')]);router[_0x734b('0xf')]('/:id/tags',auth[_0x734b('0x8')](),interaction[_0x734b('0x13')](_0x734b('0x14'),_0x734b('0x15')),controller[_0x734b('0x16')]);router[_0x734b('0x17')](_0x734b('0x18'),auth[_0x734b('0x8')](),interaction[_0x734b('0x13')](_0x734b('0x14'),_0x734b('0x19')),controller['update']);router[_0x734b('0x1a')](_0x734b('0x18'),auth[_0x734b('0x8')](),interaction[_0x734b('0x13')]('sms','smsinteraction:destroy'),controller[_0x734b('0x1b')]);router[_0x734b('0x1a')](_0x734b('0x1c'),auth[_0x734b('0x8')](),controller[_0x734b('0x1d')]);module[_0x734b('0x1e')]=router; \ No newline at end of file +var _0xb7e7=['download','post','create','addMessage','/:id/tags','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','delete','tracked','smsinteraction:destroy','destroy','removeTags','exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./smsInteraction.controller','index','get','/describe','describe','/:id','isAuthenticated','show','/:id/messages','getMessages','/:id/download'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xb7e7,0x121));var _0x7b7e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xb7e7[_0x376b45];return _0x2341b3;};'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('0x8')](_0x7b7e('0xb'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0x8')](_0x7b7e('0xe'),auth['isAuthenticated'](),controller[_0x7b7e('0xf')]);router[_0x7b7e('0x8')](_0x7b7e('0x10'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x11')]);router[_0x7b7e('0x12')]('/',auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x13')]);router[_0x7b7e('0x12')]('/:id/messages',auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x14')]);router['post'](_0x7b7e('0x15'),auth['isAuthenticated'](),interaction['tracked'](_0x7b7e('0x16'),_0x7b7e('0x17')),controller[_0x7b7e('0x18')]);router[_0x7b7e('0x19')](_0x7b7e('0xb'),auth['isAuthenticated'](),interaction['tracked'](_0x7b7e('0x16'),_0x7b7e('0x1a')),controller[_0x7b7e('0x1b')]);router[_0x7b7e('0x1c')](_0x7b7e('0xb'),auth[_0x7b7e('0xc')](),interaction[_0x7b7e('0x1d')](_0x7b7e('0x16'),_0x7b7e('0x1e')),controller[_0x7b7e('0x1f')]);router[_0x7b7e('0x1c')](_0x7b7e('0x15'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x20')]);module[_0x7b7e('0x21')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index ababc30..fe50554 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 _0x8ce1=['STRING','ENUM','out','sequelize','moment','exports','BOOLEAN','DATE'];(function(_0x5c620a,_0x200a52){var _0x5e6424=function(_0x34ae11){while(--_0x34ae11){_0x5c620a['push'](_0x5c620a['shift']());}};_0x5e6424(++_0x200a52);}(_0x8ce1,0x183));var _0x18ce=function(_0x3bc4ec,_0x4da46b){_0x3bc4ec=_0x3bc4ec-0x0;var _0x493aec=_0x8ce1[_0x3bc4ec];return _0x493aec;};'use strict';var Sequelize=require(_0x18ce('0x0'));var moment=require(_0x18ce('0x1'));module[_0x18ce('0x2')]={'closed':{'type':Sequelize[_0x18ce('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x18ce('0x4')]},'disposition':{'type':Sequelize[_0x18ce('0x5')]},'secondDisposition':{'type':Sequelize[_0x18ce('0x5')]},'thirdDisposition':{'type':Sequelize[_0x18ce('0x5')]},'note':{'type':Sequelize[_0x18ce('0x5')]},'phone':{'type':Sequelize[_0x18ce('0x5')]},'read1stAt':{'type':Sequelize[_0x18ce('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x18ce('0x6')]('in',_0x18ce('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x18ce('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x18ce('0x6')]('in',_0x18ce('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x1766=['STRING','ENUM','out','sequelize','BOOLEAN','DATE'];(function(_0x842ffd,_0x4ab9d1){var _0x3dda1a=function(_0x3ff597){while(--_0x3ff597){_0x842ffd['push'](_0x842ffd['shift']());}};_0x3dda1a(++_0x4ab9d1);}(_0x1766,0x17d));var _0x6176=function(_0x49fb34,_0x4c5f52){_0x49fb34=_0x49fb34-0x0;var _0x542132=_0x1766[_0x49fb34];return _0x542132;};'use strict';var Sequelize=require(_0x6176('0x0'));var moment=require('moment');module['exports']={'closed':{'type':Sequelize[_0x6176('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6176('0x2')]},'disposition':{'type':Sequelize[_0x6176('0x3')]},'secondDisposition':{'type':Sequelize[_0x6176('0x3')]},'thirdDisposition':{'type':Sequelize[_0x6176('0x3')]},'note':{'type':Sequelize[_0x6176('0x3')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x6176('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x6176('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x6176('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x6176('0x4')]('in',_0x6176('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x6176('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 0940a84..d30f118 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 _0x2e89=['tmp','join','root','attachments','transcript-%d-%s.zip','fullname','CmContact','firstName','lastName','direction','secret','Account','Owner','get','mkdirSync','Sms','createdAt','closedAt','disposition','Messages','out','renderFile','views','downloadInteraction.ejs','transcript-','log','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','./smsInteraction.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','Users','map','TagIds','Tags','push','catch','waiting','talking','answered','unmanaged','total','closed','UserId','index','SmsInteraction','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','from','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','split','forEach','union','User','body','some','compact','isEmpty','parse','$gte','$lte','null','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','resolve','SmsAccountId','i.SmsAccountId\x20IS\x20NOT\x20NULL','role','agent','user','i.SmsAccountId\x20IS\x20NULL','i.SmsAccountId\x20IN\x20?','toString','keyBy','merge','a.key','Account.key','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','Contact.firstName','Contact.lastName','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','ui.SmsInteractionId\x20IN\x20?','sequelize','SmsInteractionId','all','rows','show','includeAll','include','options','create','params','describe','addMessage','SmsMessage','ids','omit','getMessages','findOne','format','YYYY-MM-DD\x20HH:mm:ss','findAll','setTags','spread','Tag','color','removeTags','download','unix','files'];(function(_0x58679e,_0x167bd0){var _0x3c5703=function(_0x2d7403){while(--_0x2d7403){_0x58679e['push'](_0x58679e['shift']());}};_0x3c5703(++_0x167bd0);}(_0x2e89,0x1e9));var _0x92e8=function(_0x2f9164,_0x212a1a){_0x2f9164=_0x2f9164-0x0;var _0x36327a=_0x2e89[_0x2f9164];return _0x36327a;};'use strict';var emlformat=require(_0x92e8('0x0'));var rimraf=require(_0x92e8('0x1'));var zipdir=require(_0x92e8('0x2'));var jsonpatch=require(_0x92e8('0x3'));var rp=require('request-promise');var moment=require(_0x92e8('0x4'));var BPromise=require(_0x92e8('0x5'));var Mustache=require(_0x92e8('0x6'));var util=require(_0x92e8('0x7'));var path=require('path');var sox=require(_0x92e8('0x8'));var csv=require('to-csv');var ejs=require(_0x92e8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x92e8('0xa'));var squel=require(_0x92e8('0xb'));var crypto=require(_0x92e8('0xc'));var jsforce=require(_0x92e8('0xd'));var deskjs=require(_0x92e8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x92e8('0xf'));var Papa=require('papaparse');var Redis=require(_0x92e8('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x92e8('0x11'));var as=require(_0x92e8('0x12'));var pdf=require(_0x92e8('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x92e8('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x92e8('0x15'));var db=require(_0x92e8('0x16'))['db'];config[_0x92e8('0x17')]=_[_0x92e8('0x18')](config[_0x92e8('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x92e8('0x17')]));require(_0x92e8('0x19'))[_0x92e8('0x1a')](socket);function respondWithStatusCode(_0x475ced,_0x2b4227){_0x2b4227=_0x2b4227||0xcc;return function(_0x2003be){if(_0x2003be){return _0x475ced[_0x92e8('0x1b')](_0x2b4227);}return _0x475ced[_0x92e8('0x1c')](_0x2b4227)[_0x92e8('0x1d')]();};}function respondWithResult(_0x30ba93,_0xbca2d){_0xbca2d=_0xbca2d||0xc8;return function(_0x2f0640){if(_0x2f0640){return _0x30ba93[_0x92e8('0x1c')](_0xbca2d)[_0x92e8('0x1e')](_0x2f0640);}};}function respondWithFilteredResult(_0x2b8428,_0x17cf89){return function(_0x465b45){if(_0x465b45){var _0x45517e=typeof _0x17cf89[_0x92e8('0x1f')]===_0x92e8('0x20')&&typeof _0x17cf89['limit']===_0x92e8('0x20');var _0x533a42=_0x465b45[_0x92e8('0x21')];var _0x164b01=_0x45517e?0x0:_0x17cf89[_0x92e8('0x1f')];var _0x2f4272=_0x45517e?_0x465b45[_0x92e8('0x21')]:_0x17cf89[_0x92e8('0x1f')]+_0x17cf89[_0x92e8('0x22')];var _0x5c4dd5;if(_0x2f4272>=_0x533a42){_0x2f4272=_0x533a42;_0x5c4dd5=0xc8;}else{_0x5c4dd5=0xce;}_0x2b8428[_0x92e8('0x1c')](_0x5c4dd5);return _0x2b8428[_0x92e8('0x23')](_0x92e8('0x24'),_0x164b01+'-'+_0x2f4272+'/'+_0x533a42)[_0x92e8('0x1e')](_0x465b45);}return null;};}function patchUpdates(_0x3282fd){return function(_0x4842fe){try{jsonpatch[_0x92e8('0x25')](_0x4842fe,_0x3282fd,!![]);}catch(_0x395d9b){return BPromise[_0x92e8('0x26')](_0x395d9b);}return _0x4842fe[_0x92e8('0x27')]();};}function saveUpdates(_0x196845,_0xe4d6d3){return function(_0x1fc4d0){if(_0x1fc4d0){return _0x1fc4d0[_0x92e8('0x28')](_0x196845)[_0x92e8('0x29')](function(_0x4c5fe5){return _0x4c5fe5;});}return null;};}function removeEntity(_0x3955cd,_0x114734){return function(_0x51a8b0){if(_0x51a8b0){return _0x51a8b0[_0x92e8('0x2a')]()['then'](function(){_0x3955cd[_0x92e8('0x1c')](0xcc)[_0x92e8('0x1d')]();});}};}function handleEntityNotFound(_0x1efbe8,_0x4a4543){return function(_0x1eab2b){if(!_0x1eab2b){_0x1efbe8[_0x92e8('0x1b')](0x194);}return _0x1eab2b;};}function handleError(_0x14ee94,_0x12449b){_0x12449b=_0x12449b||0x1f4;return function(_0x4235af){logger[_0x92e8('0x2b')](_0x4235af[_0x92e8('0x2c')]);if(_0x4235af[_0x92e8('0x2d')]){delete _0x4235af[_0x92e8('0x2d')];}_0x14ee94[_0x92e8('0x1c')](_0x12449b)[_0x92e8('0x2e')](_0x4235af);};}function getInteractionUsers(_0x46188d,_0x46f8b8){return new BPromise(function(_0x2a6cd6,_0x19d8b8){try{if(_0x46f8b8[_0x46188d['id']]){_0x46188d[_0x92e8('0x2f')]=_[_0x92e8('0x30')](_0x46f8b8[_0x46188d['id']],function(_0x2c3d5e){return{'id':_0x2c3d5e['id'],'fullname':_0x2c3d5e['fullname']};});}}catch(_0x4e9fe7){_0x19d8b8(_0x4e9fe7);}_0x2a6cd6(_0x46188d);});}function getInteractionTags(_0x499577,_0x41f310){return new BPromise(function(_0xebffd3,_0x2994c6){try{if(_0x499577[_0x92e8('0x31')]){_0x499577['Tags']=[];_0x499577[_0x92e8('0x31')]['split'](',')['forEach'](function(_0x2d7386){_0x499577[_0x92e8('0x32')][_0x92e8('0x33')](_0x41f310[_0x2d7386]);});}delete _0x499577[_0x92e8('0x31')];}catch(_0x13409c){_0x2994c6(_0x13409c);}_0xebffd3(_0x499577);});}function updateSmsInteraction(_0x2e6dfa,_0x46da2e,_0x1ec8bf){return new BPromise(function(_0x36d920,_0x19f0a8){return getInteractionUsers(_0x2e6dfa,_0x1ec8bf)[_0x92e8('0x29')](function(_0x20f740){return getInteractionTags(_0x20f740,_0x46da2e);})['then'](function(_0x1694b3){return getStateInteraction(_0x1694b3);})['then'](function(_0x1011b9){_0x36d920(_0x1011b9);})[_0x92e8('0x34')](function(_0x4c1cb2){_0x19f0a8(_0x4c1cb2);});});}function getStateInteraction(_0x43d808){return new BPromise(function(_0x31df59){_0x43d808[_0x92e8('0x35')]=0x0;_0x43d808[_0x92e8('0x36')]=0x0;_0x43d808[_0x92e8('0x37')]=0x0;_0x43d808[_0x92e8('0x38')]=0x0;_0x43d808[_0x92e8('0x39')]=0x0;if(!_0x43d808[_0x92e8('0x3a')]&&!_0x43d808['UserId']){_0x43d808[_0x92e8('0x35')]+=0x1;}if(!_0x43d808[_0x92e8('0x3a')]&&_0x43d808[_0x92e8('0x3b')]){_0x43d808[_0x92e8('0x36')]+=0x1;if(_0x43d808['waiting']){_0x43d808['waiting']-=0x1;}}if(_0x43d808[_0x92e8('0x3a')]&&_0x43d808[_0x92e8('0x3b')]){_0x43d808['answered']+=0x1;if(_0x43d808[_0x92e8('0x36')]){_0x43d808[_0x92e8('0x36')]-=0x1;}}if(_0x43d808[_0x92e8('0x3a')]&&!_0x43d808[_0x92e8('0x3b')]){_0x43d808[_0x92e8('0x38')]+=0x1;if(_0x43d808[_0x92e8('0x35')]){_0x43d808[_0x92e8('0x35')]-=0x1;}}_0x43d808[_0x92e8('0x39')]+=0x1;_0x31df59(_0x43d808);});}exports[_0x92e8('0x3c')]=function(_0x277f9f,_0x1cf47e){var _0x5298fb={},_0xe44157={},_0x4e9016={'count':0x0,'rows':[]};var _0x10e382=_['map'](db[_0x92e8('0x3d')][_0x92e8('0x3e')],function(_0x326441){return{'name':_0x326441[_0x92e8('0x3f')],'type':_0x326441[_0x92e8('0x40')][_0x92e8('0x41')]};});_0xe44157[_0x92e8('0x42')]=_['map'](_0x10e382,_0x92e8('0x2d'));_0xe44157['query']=_[_0x92e8('0x43')](_0x277f9f[_0x92e8('0x44')]);_0xe44157[_0x92e8('0x45')]=_['intersection'](_0xe44157['model'],_0xe44157['query']);_0x5298fb['attributes']=_[_0x92e8('0x46')](_0xe44157[_0x92e8('0x42')],qs[_0x92e8('0x47')](_0x277f9f[_0x92e8('0x44')][_0x92e8('0x47')]));_0x5298fb[_0x92e8('0x48')]=_0x5298fb[_0x92e8('0x48')][_0x92e8('0x49')]?_0x5298fb[_0x92e8('0x48')]:_0xe44157[_0x92e8('0x42')];if(!_0x277f9f[_0x92e8('0x44')][_0x92e8('0x4a')](_0x92e8('0x4b'))){_0x5298fb[_0x92e8('0x22')]=qs[_0x92e8('0x22')](_0x277f9f['query'][_0x92e8('0x22')]);_0x5298fb[_0x92e8('0x1f')]=qs[_0x92e8('0x1f')](_0x277f9f[_0x92e8('0x44')][_0x92e8('0x1f')]);}_0x5298fb[_0x92e8('0x4c')]=qs[_0x92e8('0x4d')](_0x277f9f['query'][_0x92e8('0x4d')]);_0x5298fb[_0x92e8('0x4e')]=qs[_0x92e8('0x45')](_[_0x92e8('0x4f')](_0x277f9f['query'],_0xe44157[_0x92e8('0x45')]),_0x10e382);var _0x5a58d7=[];var _0x3ead6d=squel[_0x92e8('0x50')]()[_0x92e8('0x51')]('id')['field'](_0x92e8('0x2d'))[_0x92e8('0x51')]('color')[_0x92e8('0x52')]('tools_tags');var _0x4a8094=squel['select']()['field']('u.id')[_0x92e8('0x51')](_0x92e8('0x53'))[_0x92e8('0x51')](_0x92e8('0x54'))[_0x92e8('0x52')](_0x92e8('0x55'),'ui')[_0x92e8('0x56')](_0x92e8('0x57'),'u',_0x92e8('0x58'));var _0x4a8788=squel[_0x92e8('0x50')]()[_0x92e8('0x52')]('sms_interactions','i')['left_join'](_0x92e8('0x59'),'c',_0x92e8('0x5a'))[_0x92e8('0x56')](_0x92e8('0x57'),'o',_0x92e8('0x5b'))[_0x92e8('0x56')](_0x92e8('0x5c'),'a',_0x92e8('0x5d'))[_0x92e8('0x56')]('sms_messages','me','me.SmsInteractionId\x20=\x20i.id')[_0x92e8('0x56')](_0x92e8('0x5e'),'it',_0x92e8('0x5f'))[_0x92e8('0x56')](_0x92e8('0x60'),'t',_0x92e8('0x61'));var _0x305330=squel[_0x92e8('0x62')]();var _0x7bc0d8=[];var _0x13d029=squel[_0x92e8('0x62')]();var _0x35183b;if(_0x277f9f[_0x92e8('0x44')][_0x92e8('0x63')]){_0x35183b=as[_0x92e8('0x64')](_0x277f9f[_0x92e8('0x44')][_0x92e8('0x63')]);var _0xfca060=_0x35183b[_0x92e8('0x65')];for(var _0x3489c5=0x0;_0x3489c5<_0x35183b['conditions'][_0x92e8('0x49')];_0x3489c5++){var _0x2858dc=_0x35183b[_0x92e8('0x66')][_0x3489c5];var _0x24651b='i';var _0x2a87df=_['find'](_0x10e382,[_0x92e8('0x2d'),_0x2858dc['field']]);if(!_0x2a87df){switch(_0x2858dc[_0x92e8('0x51')]){case _0x92e8('0x67'):if(_0x2858dc[_0x92e8('0x68')]==0x1){_0x4a8788[_0x92e8('0x69')]('`'+_0x2858dc[_0x92e8('0x51')]+_0x92e8('0x6a'));}else{_0x4a8788[_0x92e8('0x69')]('`'+_0x2858dc['field']+_0x92e8('0x6b'));}break;case _0x92e8('0x6c'):if(_0x2858dc[_0x92e8('0x6d')]===_0x92e8('0x6e')){if(_0x2858dc[_0x92e8('0x68')]['split']('\x20')['length']>0x1){_0x305330[_0xfca060]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x92e8('0x6f')](_0x2858dc['value']),null);}else{var _0x1f8fec='%'+_0x2858dc[_0x92e8('0x68')]+'%';_0x305330[_0xfca060](_0x92e8('0x70'),_0x1f8fec,_0x1f8fec,_0x1f8fec);}}else{_0x2a87df=_[_0x92e8('0x71')](_0x10e382,[_0x92e8('0x2d'),_0x92e8('0x72')]);_0x2858dc['field']=_0x92e8('0x72');_0x465512=as[_0x92e8('0x73')](_0x24651b,_0x2a87df['type'],_0x2858dc);_0x305330[_0xfca060](_0x465512[_0x92e8('0x74')],_0x465512[_0x92e8('0x68')][_0x92e8('0x75')],_0x465512[_0x92e8('0x68')][_0x92e8('0x1d')]);}break;case'Tag':var _0x239b19=_0x2858dc[_0x92e8('0x68')][_0x92e8('0x76')](',')[_0x92e8('0x30')](function(_0x500419){return Number(_0x500419);});_0x239b19[_0x92e8('0x77')](function(_0x49dbcf){_0x13d029['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x49dbcf+',%');});_0x7bc0d8=_[_0x92e8('0x78')](_0x7bc0d8,_0x239b19);break;case _0x92e8('0x79'):if(_0x2858dc[_0x92e8('0x6d')]===_0x92e8('0x6e')){_0x305330[_0xfca060]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x2858dc[_0x92e8('0x68')]+'%',null);}else{_0x2a87df=_['find'](_0x10e382,[_0x92e8('0x2d'),_0x92e8('0x3b')]);_0x2858dc[_0x92e8('0x51')]=_0x92e8('0x3b');_0x465512=as['buildExpression'](_0x24651b,_0x2a87df['type'],_0x2858dc);_0x305330[_0xfca060](_0x465512[_0x92e8('0x74')],_0x465512[_0x92e8('0x68')][_0x92e8('0x75')],_0x465512[_0x92e8('0x68')]['end']);}break;case _0x92e8('0x7a'):_0x465512=as[_0x92e8('0x73')]('me',null,_0x2858dc);_0x305330[_0xfca060](_0x465512[_0x92e8('0x74')],_0x465512[_0x92e8('0x68')][_0x92e8('0x75')],_0x465512[_0x92e8('0x68')][_0x92e8('0x1d')]);break;}}else{var _0x465512=as[_0x92e8('0x73')](_0x24651b,_0x2a87df['type'],_0x2858dc);_0x305330[_0xfca060](_0x465512[_0x92e8('0x74')],_0x465512['value'][_0x92e8('0x75')],_0x465512['value'][_0x92e8('0x1d')]);}}}else{var _0x12f731=_(_0x277f9f[_0x92e8('0x44')])['keys']()[_0x92e8('0x30')](function(_0x12e9b2){return _[_0x92e8('0x7b')](_0x10e382,[_0x92e8('0x2d'),_0x12e9b2])?_0x12e9b2:undefined;})[_0x92e8('0x7c')]()[_0x92e8('0x68')]();if(!_[_0x92e8('0x7d')](_0x12f731)){_0x12f731[_0x92e8('0x77')](function(_0x27d157){if(_0x27d157==='SmsAccountId'){_0x4a8788[_0x92e8('0x4e')]('i.SmsAccountId\x20IN\x20?',[]['concat'](_0x277f9f[_0x92e8('0x44')][_0x27d157]));}else if(_0x27d157==='createdAt'){var _0x1ff88e=JSON[_0x92e8('0x7e')](_0x277f9f[_0x92e8('0x44')][_0x27d157])[_0x92e8('0x7f')];var _0x4fe988=JSON[_0x92e8('0x7e')](_0x277f9f[_0x92e8('0x44')][_0x27d157])[_0x92e8('0x80')];_0x4a8788[_0x92e8('0x4e')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x1ff88e,_0x4fe988);}else{if(_0x277f9f[_0x92e8('0x44')][_0x27d157]===_0x92e8('0x81')){_0x4a8788['where']('i.'+_0x27d157+'\x20IS\x20NULL');}else{_0x4a8788[_0x92e8('0x4e')]('i.'+_0x27d157+'\x20=\x20?',_0x277f9f[_0x92e8('0x44')][_0x27d157]);}}});}if(_0x277f9f[_0x92e8('0x44')]['read']){if(_0x277f9f[_0x92e8('0x44')][_0x92e8('0x82')]==0x1){_0x4a8788[_0x92e8('0x69')](_0x92e8('0x83'));}else{_0x4a8788[_0x92e8('0x69')](_0x92e8('0x84'));}}if(_0x277f9f[_0x92e8('0x44')][_0x92e8('0x85')]){_0x7bc0d8=_[_0x92e8('0x86')](_0x277f9f[_0x92e8('0x44')][_0x92e8('0x85')])?_0x277f9f['query'][_0x92e8('0x85')]:new Array(_0x277f9f[_0x92e8('0x44')][_0x92e8('0x85')]);_0x7bc0d8[_0x92e8('0x77')](function(_0x1e71fa){_0x13d029['or'](_0x92e8('0x87'),'%,'+_0x1e71fa+',%');});}if(_0x277f9f['query'][_0x92e8('0x88')]){var _0x51b408=_0x277f9f[_0x92e8('0x44')]['filter'][_0x92e8('0x89')]('\x5c','\x5c\x5c')[_0x92e8('0x89')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x51b408)){_0x305330['or'](_0x92e8('0x8a'),_0x51b408+'%')['or']('i.phone\x20LIKE\x20?',_0x51b408+'%');}else{_0x305330['or'](_0x92e8('0x8b'),qs[_0x92e8('0x6f')](_0x51b408))['or'](_0x92e8('0x8c'),_0x51b408+'%');}}}_0x4a8788['where'](_0x305330);_0x4a8788[_0x92e8('0x8d')]('i.id');var _0x20aaa2={'type':db[_0x92e8('0x8e')][_0x92e8('0x8f')][_0x92e8('0x90')],'raw':!![]};var _0x159a88=_0x4a8788['clone']();_0x159a88[_0x92e8('0x51')]('i.id');_0x159a88[_0x92e8('0x51')](_0x92e8('0x91'),_0x92e8('0x67'));if(_0x5298fb[_0x92e8('0x4c')]){_0x5298fb[_0x92e8('0x4c')][_0x92e8('0x77')](function(_0x5e12a4){var _0x4238d4=_0x5e12a4[0x0]===_0x92e8('0x92')?_0x5e12a4[0x0]:'i.'+_0x5e12a4[0x0];_0x4a8788['order'](_0x4238d4,_0x5e12a4[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x7bc0d8)){_0x4a8788['having'](_0x13d029);_0x159a88[_0x92e8('0x4e')](_0x92e8('0x93'),_0x7bc0d8);}BPromise[_0x92e8('0x94')]()[_0x92e8('0x29')](function(){if(!_0x35183b){if(_0x277f9f[_0x92e8('0x44')][_0x92e8('0x95')])return;_0x159a88[_0x92e8('0x4e')](_0x92e8('0x96'));_0x4a8788[_0x92e8('0x4e')](_0x92e8('0x96'));return;}if(_0x277f9f['user'][_0x92e8('0x97')]!==_0x92e8('0x98'))return;return _0x277f9f[_0x92e8('0x99')]['getSmsAccounts']({'attributes':['id'],'raw':!![]})[_0x92e8('0x29')](function(_0x42d01f){if(_[_0x92e8('0x7d')](_0x42d01f)){_0x159a88['where'](_0x92e8('0x9a'));_0x4a8788[_0x92e8('0x4e')](_0x92e8('0x9a'));}else{_0x159a88[_0x92e8('0x4e')](_0x92e8('0x9b'),_[_0x92e8('0x30')](_0x42d01f,'id'));_0x4a8788[_0x92e8('0x4e')](_0x92e8('0x9b'),_[_0x92e8('0x30')](_0x42d01f,'id'));}});})[_0x92e8('0x29')](function(){if(_0x277f9f[_0x92e8('0x99')][_0x92e8('0x97')]===_0x92e8('0x98')&&!_0x35183b&&!_0x277f9f[_0x92e8('0x44')][_0x92e8('0x95')])return[];return db['sequelize'][_0x92e8('0x44')](_0x159a88[_0x92e8('0x9c')](),_0x20aaa2);})[_0x92e8('0x29')](function(_0x56dbb0){_0x4e9016['count']=_0x56dbb0[_0x92e8('0x49')];if(_0x4e9016[_0x92e8('0x21')]===0x0)return[];return db['sequelize'][_0x92e8('0x44')](_0x3ead6d[_0x92e8('0x9c')](),_0x20aaa2)['then'](function(_0x3fd386){_0x5a58d7=_[_0x92e8('0x9d')](_0x3fd386,'id');_0x20aaa2=_[_0x92e8('0x9e')](_0x20aaa2,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x277f9f[_0x92e8('0x44')][_0x92e8('0x47')]){_0x5298fb[_0x92e8('0x48')][_0x92e8('0x77')](function(_0xede6b9){_0x4a8788[_0x92e8('0x51')]('i.'+_0xede6b9);});}else{_0x4a8788[_0x92e8('0x51')](_0x92e8('0x91'),_0x92e8('0x67'));_0x4a8788[_0x92e8('0x51')](_0x92e8('0x9f'),_0x92e8('0xa0'));_0x4a8788[_0x92e8('0x51')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x4a8788['field'](_0x92e8('0xa1'),_0x92e8('0x92'));_0x4a8788[_0x92e8('0x51')](_0x92e8('0xa2'));_0x4a8788[_0x92e8('0x51')](_0x92e8('0xa3'),_0x92e8('0xa4'));_0x4a8788[_0x92e8('0x51')]('c.lastName',_0x92e8('0xa5'));_0x4a8788[_0x92e8('0x51')]('c.email',_0x92e8('0xa6'));_0x4a8788['field'](_0x92e8('0xa7'),_0x92e8('0xa8'));_0x4a8788[_0x92e8('0x51')]('c.mobile',_0x92e8('0xa9'));_0x4a8788[_0x92e8('0x51')](_0x92e8('0xaa'),_0x92e8('0xab'));_0x4a8788['field'](_0x92e8('0xac'),'Owner.fullname');_0x4a8788[_0x92e8('0x51')](_0x92e8('0xad'),_0x92e8('0xae'));_0x4a8788['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x92e8('0x31'));}if(_0x5298fb[_0x92e8('0x22')])_0x4a8788[_0x92e8('0x22')](_0x5298fb[_0x92e8('0x22')]);if(_0x5298fb[_0x92e8('0x1f')])_0x4a8788[_0x92e8('0x1f')](_0x5298fb['offset']);return db['sequelize'][_0x92e8('0x44')](_0x4a8788[_0x92e8('0x9c')](),_0x20aaa2);})[_0x92e8('0x29')](function(_0x9e0a7a){if(_0x9e0a7a['length']>0x0)_0x4a8094[_0x92e8('0x4e')](_0x92e8('0xaf'),_[_0x92e8('0x30')](_0x9e0a7a,'id'));return db[_0x92e8('0xb0')]['query'](_0x4a8094[_0x92e8('0x9c')](),_0x20aaa2)[_0x92e8('0x29')](function(_0x1147f5){var _0x3842ab=_['groupBy'](_0x1147f5,_0x92e8('0xb1'));var _0x5d966d=[];_0x9e0a7a[_0x92e8('0x77')](function(_0x38a1ed){_0x5d966d[_0x92e8('0x33')](updateSmsInteraction(_0x38a1ed,_0x5a58d7,_0x3842ab));});return BPromise[_0x92e8('0xb2')](_0x5d966d);});});})[_0x92e8('0x29')](function(_0x502550){_0x4e9016[_0x92e8('0xb3')]=_0x502550;return _0x4e9016;})[_0x92e8('0x29')](respondWithFilteredResult(_0x1cf47e,_0x5298fb))[_0x92e8('0x34')](handleError(_0x1cf47e,null));};exports[_0x92e8('0xb4')]=function(_0x1099ba,_0x33348a){var _0x1f296b={'raw':![],'where':{'id':_0x1099ba['params']['id']}},_0x191e4d={};_0x191e4d['model']=_[_0x92e8('0x43')](db['SmsInteraction']['rawAttributes']);_0x191e4d['query']=_[_0x92e8('0x43')](_0x1099ba[_0x92e8('0x44')]);_0x191e4d[_0x92e8('0x45')]=_[_0x92e8('0x46')](_0x191e4d['model'],_0x191e4d[_0x92e8('0x44')]);_0x1f296b[_0x92e8('0x48')]=_['intersection'](_0x191e4d[_0x92e8('0x42')],qs[_0x92e8('0x47')](_0x1099ba[_0x92e8('0x44')][_0x92e8('0x47')]));_0x1f296b[_0x92e8('0x48')]=_0x1f296b['attributes'][_0x92e8('0x49')]?_0x1f296b[_0x92e8('0x48')]:_0x191e4d[_0x92e8('0x42')];if(_0x1099ba[_0x92e8('0x44')][_0x92e8('0xb5')]){_0x1f296b[_0x92e8('0xb6')]=[{'all':!![]}];}_0x1f296b=_[_0x92e8('0x9e')]({},_0x1f296b,_0x1099ba[_0x92e8('0xb7')]);return db[_0x92e8('0x3d')][_0x92e8('0x71')](_0x1f296b)['then'](handleEntityNotFound(_0x33348a,null))[_0x92e8('0x29')](respondWithResult(_0x33348a,null))[_0x92e8('0x34')](handleError(_0x33348a,null));};exports[_0x92e8('0xb8')]=function(_0x2cff09,_0x39e30a){return db['SmsInteraction']['create'](_0x2cff09[_0x92e8('0x7a')],{})[_0x92e8('0x29')](respondWithResult(_0x39e30a,0xc9))[_0x92e8('0x34')](handleError(_0x39e30a,null));};exports[_0x92e8('0x28')]=function(_0x774468,_0x3d2309){if(_0x774468[_0x92e8('0x7a')]['id']){delete _0x774468[_0x92e8('0x7a')]['id'];}return db[_0x92e8('0x3d')][_0x92e8('0x71')]({'where':{'id':_0x774468['params']['id']}})[_0x92e8('0x29')](handleEntityNotFound(_0x3d2309,null))[_0x92e8('0x29')](saveUpdates(_0x774468['body'],null))[_0x92e8('0x29')](respondWithResult(_0x3d2309,null))[_0x92e8('0x34')](handleError(_0x3d2309,null));};exports[_0x92e8('0x2a')]=function(_0x2aecfb,_0x1b9998){return db[_0x92e8('0x3d')][_0x92e8('0x71')]({'where':{'id':_0x2aecfb[_0x92e8('0xb9')]['id']}})[_0x92e8('0x29')](handleEntityNotFound(_0x1b9998,null))[_0x92e8('0x29')](removeEntity(_0x1b9998,null))[_0x92e8('0x34')](handleError(_0x1b9998,null));};exports[_0x92e8('0xba')]=function(_0x21d89,_0x2ff35f){return db[_0x92e8('0x3d')][_0x92e8('0xba')]()[_0x92e8('0x29')](respondWithResult(_0x2ff35f,null))[_0x92e8('0x34')](handleError(_0x2ff35f,null));};exports[_0x92e8('0xbb')]=function(_0x2e05b8,_0x15846a,_0x22997e){return db[_0x92e8('0xbc')][_0x92e8('0x71')]({'where':{'id':_0x2e05b8[_0x92e8('0xb9')]['id']}})[_0x92e8('0x29')](handleEntityNotFound(_0x15846a,null))[_0x92e8('0x29')](function(_0xc9c41d){if(_0xc9c41d){return _0xc9c41d['addMessage'](_0x2e05b8[_0x92e8('0x7a')][_0x92e8('0xbd')],_[_0x92e8('0xbe')](_0x2e05b8['body'],[_0x92e8('0xbd'),'id'])||{});}})[_0x92e8('0x29')](respondWithResult(_0x15846a,null))[_0x92e8('0x34')](handleError(_0x15846a,null));};exports[_0x92e8('0xbf')]=function(_0x4e14f7,_0x5bf427,_0x5ae167){var _0x2c7cb6={'raw':![],'where':{}};var _0x2f2150={};var _0x24e253={'count':0x0,'rows':[]};return db[_0x92e8('0x3d')][_0x92e8('0xc0')]({'where':{'id':_0x4e14f7['params']['id']}})[_0x92e8('0x29')](handleEntityNotFound(_0x5bf427,null))[_0x92e8('0x29')](function(_0x1d9478){if(_0x1d9478){_0x2f2150[_0x92e8('0x42')]=_[_0x92e8('0x43')](db[_0x92e8('0xbc')]['rawAttributes']);_0x2f2150[_0x92e8('0x44')]=_[_0x92e8('0x43')](_0x4e14f7[_0x92e8('0x44')]);_0x2f2150[_0x92e8('0x45')]=_[_0x92e8('0x46')](_0x2f2150[_0x92e8('0x42')],_0x2f2150[_0x92e8('0x44')]);_0x2c7cb6['attributes']=_['intersection'](_0x2f2150[_0x92e8('0x42')],qs['fields'](_0x4e14f7[_0x92e8('0x44')][_0x92e8('0x47')]));_0x2c7cb6[_0x92e8('0x48')]=_0x2c7cb6[_0x92e8('0x48')][_0x92e8('0x49')]?_0x2c7cb6[_0x92e8('0x48')]:_0x2f2150[_0x92e8('0x42')];if(!_0x4e14f7[_0x92e8('0x44')][_0x92e8('0x4a')](_0x92e8('0x4b'))){_0x2c7cb6[_0x92e8('0x22')]=qs[_0x92e8('0x22')](_0x4e14f7['query'][_0x92e8('0x22')]);_0x2c7cb6[_0x92e8('0x1f')]=qs[_0x92e8('0x1f')](_0x4e14f7[_0x92e8('0x44')][_0x92e8('0x1f')]);}_0x2c7cb6[_0x92e8('0x4c')]=qs[_0x92e8('0x4d')](_0x4e14f7[_0x92e8('0x44')]['sort']);_0x2c7cb6[_0x92e8('0x4e')]=qs[_0x92e8('0x45')](_[_0x92e8('0x4f')](_0x4e14f7['query'],_0x2f2150[_0x92e8('0x45')]));_0x2c7cb6[_0x92e8('0x4e')][_0x92e8('0xb1')]=_0x1d9478['id'];if(_0x4e14f7['query'][_0x92e8('0x88')]){_0x2c7cb6['where']=_[_0x92e8('0x9e')](_0x2c7cb6[_0x92e8('0x4e')],{'$or':_[_0x92e8('0x30')](_0x2c7cb6[_0x92e8('0x48')],function(_0x3afcd0){var _0x11a5bf={};_0x11a5bf[_0x3afcd0]={'$like':'%'+_0x4e14f7[_0x92e8('0x44')][_0x92e8('0x88')]+'%'};return _0x11a5bf;})});}if(_0x4e14f7[_0x92e8('0x44')]['$gte']){var _0x3d6168=_0x4e14f7[_0x92e8('0x44')][_0x92e8('0x7f')][_0x92e8('0x76')](',');var _0xd8b938={};_0xd8b938[_0x3d6168[0x0]]={'$gte':moment(_0x3d6168[0x1])[_0x92e8('0xc1')](_0x92e8('0xc2'))};_0x2c7cb6[_0x92e8('0x4e')]=_['merge'](_0x2c7cb6['where'],_0xd8b938);}_0x2c7cb6=_['merge']({},_0x2c7cb6,_0x4e14f7[_0x92e8('0xb7')]);return db[_0x92e8('0xbc')][_0x92e8('0x21')]({'where':_0x2c7cb6[_0x92e8('0x4e')]})[_0x92e8('0x29')](function(_0x35be6c){_0x24e253[_0x92e8('0x21')]=_0x35be6c;if(_0x4e14f7[_0x92e8('0x44')][_0x92e8('0xb5')]){_0x2c7cb6[_0x92e8('0xb6')]=[{'all':!![]}];}return db[_0x92e8('0xbc')][_0x92e8('0xc3')](_0x2c7cb6);})[_0x92e8('0x29')](function(_0x455552){_0x24e253[_0x92e8('0xb3')]=_0x455552;return _0x24e253;});}})[_0x92e8('0x29')](respondWithFilteredResult(_0x5bf427,_0x2c7cb6))[_0x92e8('0x34')](handleError(_0x5bf427,null));};exports['addTags']=function(_0x2ee573,_0x45b6cf,_0x3c9b32){return db[_0x92e8('0x3d')][_0x92e8('0x71')]({'where':{'id':_0x2ee573[_0x92e8('0xb9')]['id']}})[_0x92e8('0x29')](handleEntityNotFound(_0x45b6cf,null))[_0x92e8('0x29')](function(_0x4a052a){if(_0x4a052a){return _0x4a052a[_0x92e8('0xc4')](_0x2ee573[_0x92e8('0x7a')]['ids'],_[_0x92e8('0xbe')](_0x2ee573[_0x92e8('0x7a')],['ids','id'])||{})[_0x92e8('0xc5')](function(){return db[_0x92e8('0xc6')]['findAll']({'attributes':['id',_0x92e8('0x2d'),_0x92e8('0xc7')],'where':{'id':_0x2ee573[_0x92e8('0x7a')]['ids']}});})['then'](function(_0x8ba3b5){socket['emit']('smsInteractionTags:save',{'id':Number(_0x2ee573['params']['id']),'tags':_0x8ba3b5||[]});return{'id':Number(_0x2ee573[_0x92e8('0xb9')]['id']),'tags':_0x8ba3b5||[]};});}})[_0x92e8('0x29')](respondWithResult(_0x45b6cf,null))[_0x92e8('0x34')](handleError(_0x45b6cf,null));};exports[_0x92e8('0xc8')]=function(_0x202e27,_0x1d8ee3,_0x10e641){return db[_0x92e8('0x3d')]['find']({'where':{'id':_0x202e27[_0x92e8('0xb9')]['id']}})[_0x92e8('0x29')](handleEntityNotFound(_0x1d8ee3,null))['then'](function(_0x53a3d3){if(_0x53a3d3){return _0x53a3d3[_0x92e8('0xc8')](_0x202e27[_0x92e8('0x44')]['ids']);}})['then'](respondWithStatusCode(_0x1d8ee3,null))['catch'](handleError(_0x1d8ee3,null));};exports[_0x92e8('0xc9')]=function(_0x20d967,_0x18d04a){var _0x2172a1=moment()[_0x92e8('0xca')]()['toString']();var _0x4e7a50=path['join'](config['root'],'server',_0x92e8('0xcb'),_0x92e8('0xcc'));var _0x5689b4=path[_0x92e8('0xcd')](config[_0x92e8('0xce')],'server','files',_0x92e8('0xcf'));var _0xbeb75b=path[_0x92e8('0xcd')](_0x4e7a50,_0x2172a1);var _0x17f745=util[_0x92e8('0xc1')](_0x92e8('0xd0'),_0x20d967[_0x92e8('0xb9')]['id'],_0x2172a1);var _0x2a92a0=path[_0x92e8('0xcd')](_0x4e7a50,_0x17f745);var _0x3e4927=[];_0x3e4927['push']({'model':db[_0x92e8('0x79')],'as':'User','attributes':['id',_0x92e8('0xd1')],'raw':!![]});_0x3e4927[_0x92e8('0x33')]({'model':db[_0x92e8('0xd2')],'as':_0x92e8('0x6c'),'attributes':['id',_0x92e8('0xd3'),_0x92e8('0xd4')],'raw':!![]});var _0x5eebaa=[{'model':db[_0x92e8('0xbc')],'as':'Messages','attributes':['id',_0x92e8('0x7a'),'createdAt',_0x92e8('0xd5'),_0x92e8('0xd6'),_0x92e8('0x82')],'include':_0x3e4927}];_0x5eebaa[_0x92e8('0x33')]({'model':db['SmsAccount'],'as':_0x92e8('0xd7'),'attributes':['id',_0x92e8('0x2d')]});_0x5eebaa['push']({'model':db[_0x92e8('0x79')],'as':_0x92e8('0xd8'),'attributes':['id',_0x92e8('0xd1')]});return db['SmsInteraction'][_0x92e8('0x71')]({'where':{'id':_0x20d967['params']['id']},'include':_0x5eebaa})[_0x92e8('0x29')](handleEntityNotFound(_0x18d04a,null))[_0x92e8('0x29')](function(_0x2cba38){if(_0x2cba38){var _0x3201be=_0x2cba38[_0x92e8('0xd9')]({'plain':!![]});fs[_0x92e8('0xda')](_0xbeb75b);var _0x240735={'channel':_0x92e8('0xdb'),'account':_0x3201be[_0x92e8('0xd7')][_0x92e8('0x2d')],'agent':_0x3201be['Owner']?_0x3201be[_0x92e8('0xd8')][_0x92e8('0xd1')]:'N.A.','createdAt':moment(_0x3201be[_0x92e8('0xdc')])['format'](_0x92e8('0xc2'))[_0x92e8('0x9c')](),'closedAt':_0x3201be[_0x92e8('0x3a')]?moment(_0x3201be[_0x92e8('0xdd')])[_0x92e8('0xc1')](_0x92e8('0xc2'))['toString']():'','disposition':_0x3201be[_0x92e8('0xde')],'messages':_(_0x3201be[_0x92e8('0xdf')])[_0x92e8('0x88')]({'secret':![]})[_0x92e8('0x30')](function(_0x190817){return{'date':moment(_0x190817['createdAt'])['format'](_0x92e8('0xc2'))['toString'](),'sender':_0x190817[_0x92e8('0xd5')]===_0x92e8('0xe0')?_0x190817[_0x92e8('0x79')]?_0x190817['User'][_0x92e8('0xd1')]:'System':_0x190817[_0x92e8('0x6c')][_0x92e8('0xd3')]+(_0x190817[_0x92e8('0x6c')][_0x92e8('0xd4')]?'\x20'+_0x190817[_0x92e8('0x6c')][_0x92e8('0xd4')]:''),'body':_0x190817['body'],'direction':_0x190817[_0x92e8('0xd5')]==='out'?'A':'C','secret':_0x190817['secret'],'read':_0x190817[_0x92e8('0x82')]};})[_0x92e8('0x68')]()};return ejs[_0x92e8('0xe1')](path['join'](config[_0x92e8('0xce')],'server',_0x92e8('0xe2'),_0x92e8('0xe3')),{'interaction':_0x240735})['then'](function(_0xa3c3a3){var _0x4d3a42=path['join'](_0xbeb75b,_0x92e8('0xe4')+_0x3201be['id']+'-'+_0x2172a1+'.pdf');var _0x3a34c6={'path':_0x4d3a42,'channel':_0x92e8('0xdb'),'interactionId':_0x3201be['id']};return pdf['createPdfFromHTML'](_0xa3c3a3,_0x3a34c6);})[_0x92e8('0x29')](function(){return new BPromise(function(_0x44fcb0,_0x3912fa){zipdir(_0xbeb75b,{'saveTo':_0x2a92a0},function(_0x5433ac,_0x590973){if(_0x5433ac)return _0x3912fa(_0x5433ac);return _0x44fcb0(_0x590973);});})['then'](function(){return new BPromise(function(_0x5be0c5,_0x589438){rimraf(_0xbeb75b,function(_0x318152){if(_0x318152)_0x589438(_0x318152);return _0x5be0c5();});});})[_0x92e8('0x29')](function(){return _0x18d04a[_0x92e8('0xc9')](_0x2a92a0,_0x17f745,function(_0x590e51){if(_0x590e51){console[_0x92e8('0xe5')]('err',_0x590e51);}else{fs[_0x92e8('0xe6')](_0x2a92a0);}});});});}else{return _0x18d04a[_0x92e8('0x1b')](0xc8);}})[_0x92e8('0x34')](handleError(_0x18d04a,null));}; \ No newline at end of file +var _0x9411=['update','then','destroy','sendStatus','error','stack','name','send','Users','map','TagIds','split','forEach','Tags','catch','waiting','answered','unmanaged','total','closed','UserId','talking','SmsInteraction','rawAttributes','fieldName','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','select','from','tools_tags','field','u.id','user_has_sms_interactions','sms_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','type','body','compact','isEmpty','i.SmsAccountId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','i.SmsAccountId\x20IS\x20NOT\x20NULL','role','agent','i.SmsAccountId\x20IS\x20NULL','user','SmsAccountId','a.key','a.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','sequelize','toString','ui.SmsInteractionId\x20IN\x20?','SmsInteractionId','all','rows','show','params','includeAll','include','merge','create','describe','addMessage','SmsMessage','ids','omit','getMessages','findOne','format','options','findAll','addTags','setTags','spread','color','removeTags','unix','join','root','server','files','tmp','attachments','push','User','CmContact','firstName','Messages','direction','secret','Account','Owner','fullname','Sms','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','disposition','out','System','Contact','lastName','renderFile','views','downloadInteraction.ejs','download','log','err','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','status','end','json','offset','limit','undefined','count','set','Content-Range','apply'];(function(_0x4cf4ff,_0x3024b7){var _0x1154d1=function(_0x5b97c8){while(--_0x5b97c8){_0x4cf4ff['push'](_0x4cf4ff['shift']());}};_0x1154d1(++_0x3024b7);}(_0x9411,0xc7));var _0x1941=function(_0x3f5ba3,_0x4c1bfd){_0x3f5ba3=_0x3f5ba3-0x0;var _0x2eb1d4=_0x9411[_0x3f5ba3];return _0x2eb1d4;};'use strict';var emlformat=require(_0x1941('0x0'));var rimraf=require(_0x1941('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1941('0x2'));var rp=require(_0x1941('0x3'));var moment=require(_0x1941('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1941('0x5'));var util=require(_0x1941('0x6'));var path=require(_0x1941('0x7'));var sox=require(_0x1941('0x8'));var csv=require(_0x1941('0x9'));var ejs=require(_0x1941('0xa'));var fs=require('fs');var fs_extra=require(_0x1941('0xb'));var _=require(_0x1941('0xc'));var squel=require(_0x1941('0xd'));var crypto=require('crypto');var jsforce=require(_0x1941('0xe'));var deskjs=require(_0x1941('0xf'));var toCsv=require(_0x1941('0x9'));var querystring=require('querystring');var Papa=require(_0x1941('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1941('0x11'));var as=require(_0x1941('0x12'));var pdf=require(_0x1941('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1941('0x14'));var utils=require(_0x1941('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1941('0x16'));var db=require(_0x1941('0x17'))['db'];config[_0x1941('0x18')]=_[_0x1941('0x19')](config['redis'],{'host':_0x1941('0x1a'),'port':0x18eb});var socket=require(_0x1941('0x1b'))(new Redis(config[_0x1941('0x18')]));require(_0x1941('0x1c'))[_0x1941('0x1d')](socket);function respondWithStatusCode(_0x381b5b,_0xb002d3){_0xb002d3=_0xb002d3||0xcc;return function(_0x4590e5){if(_0x4590e5){return _0x381b5b['sendStatus'](_0xb002d3);}return _0x381b5b[_0x1941('0x1e')](_0xb002d3)[_0x1941('0x1f')]();};}function respondWithResult(_0x3830f7,_0x24095d){_0x24095d=_0x24095d||0xc8;return function(_0x26f9d5){if(_0x26f9d5){return _0x3830f7[_0x1941('0x1e')](_0x24095d)[_0x1941('0x20')](_0x26f9d5);}};}function respondWithFilteredResult(_0xe75a1a,_0x4fe39a){return function(_0x18c503){if(_0x18c503){var _0x33b5cd=typeof _0x4fe39a[_0x1941('0x21')]==='undefined'&&typeof _0x4fe39a[_0x1941('0x22')]===_0x1941('0x23');var _0x4bd55a=_0x18c503[_0x1941('0x24')];var _0x42f324=_0x33b5cd?0x0:_0x4fe39a['offset'];var _0x1b726d=_0x33b5cd?_0x18c503[_0x1941('0x24')]:_0x4fe39a[_0x1941('0x21')]+_0x4fe39a[_0x1941('0x22')];var _0x212d34;if(_0x1b726d>=_0x4bd55a){_0x1b726d=_0x4bd55a;_0x212d34=0xc8;}else{_0x212d34=0xce;}_0xe75a1a['status'](_0x212d34);return _0xe75a1a[_0x1941('0x25')](_0x1941('0x26'),_0x42f324+'-'+_0x1b726d+'/'+_0x4bd55a)[_0x1941('0x20')](_0x18c503);}return null;};}function patchUpdates(_0x10801c){return function(_0x1a78d4){try{jsonpatch[_0x1941('0x27')](_0x1a78d4,_0x10801c,!![]);}catch(_0x14c153){return BPromise['reject'](_0x14c153);}return _0x1a78d4['save']();};}function saveUpdates(_0xcd76fb,_0x466e7a){return function(_0x51aeb6){if(_0x51aeb6){return _0x51aeb6[_0x1941('0x28')](_0xcd76fb)[_0x1941('0x29')](function(_0x2a5c89){return _0x2a5c89;});}return null;};}function removeEntity(_0x272181,_0x480afa){return function(_0x476934){if(_0x476934){return _0x476934[_0x1941('0x2a')]()[_0x1941('0x29')](function(){_0x272181[_0x1941('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3aa1d1,_0x91e588){return function(_0x1f4712){if(!_0x1f4712){_0x3aa1d1[_0x1941('0x2b')](0x194);}return _0x1f4712;};}function handleError(_0xec4e2f,_0x43257e){_0x43257e=_0x43257e||0x1f4;return function(_0x6d196a){logger[_0x1941('0x2c')](_0x6d196a[_0x1941('0x2d')]);if(_0x6d196a[_0x1941('0x2e')]){delete _0x6d196a[_0x1941('0x2e')];}_0xec4e2f[_0x1941('0x1e')](_0x43257e)[_0x1941('0x2f')](_0x6d196a);};}function getInteractionUsers(_0x3a326a,_0x4775a6){return new BPromise(function(_0x1d7f9,_0x444e59){try{if(_0x4775a6[_0x3a326a['id']]){_0x3a326a[_0x1941('0x30')]=_[_0x1941('0x31')](_0x4775a6[_0x3a326a['id']],function(_0x4ef8c9){return{'id':_0x4ef8c9['id'],'fullname':_0x4ef8c9['fullname']};});}}catch(_0x2e8de0){_0x444e59(_0x2e8de0);}_0x1d7f9(_0x3a326a);});}function getInteractionTags(_0xf5292,_0x575e6c){return new BPromise(function(_0x559f54,_0x3ade52){try{if(_0xf5292['TagIds']){_0xf5292['Tags']=[];_0xf5292[_0x1941('0x32')][_0x1941('0x33')](',')[_0x1941('0x34')](function(_0x28ec34){_0xf5292[_0x1941('0x35')]['push'](_0x575e6c[_0x28ec34]);});}delete _0xf5292[_0x1941('0x32')];}catch(_0x5aad5b){_0x3ade52(_0x5aad5b);}_0x559f54(_0xf5292);});}function updateSmsInteraction(_0x5665a8,_0x3a2b77,_0x25991c){return new BPromise(function(_0x1f4e49,_0x396293){return getInteractionUsers(_0x5665a8,_0x25991c)[_0x1941('0x29')](function(_0xc94469){return getInteractionTags(_0xc94469,_0x3a2b77);})[_0x1941('0x29')](function(_0x10facc){return getStateInteraction(_0x10facc);})[_0x1941('0x29')](function(_0x1ba4fe){_0x1f4e49(_0x1ba4fe);})[_0x1941('0x36')](function(_0x1302fa){_0x396293(_0x1302fa);});});}function getStateInteraction(_0x3ca34d){return new BPromise(function(_0x59a011){_0x3ca34d[_0x1941('0x37')]=0x0;_0x3ca34d['talking']=0x0;_0x3ca34d[_0x1941('0x38')]=0x0;_0x3ca34d[_0x1941('0x39')]=0x0;_0x3ca34d[_0x1941('0x3a')]=0x0;if(!_0x3ca34d[_0x1941('0x3b')]&&!_0x3ca34d[_0x1941('0x3c')]){_0x3ca34d[_0x1941('0x37')]+=0x1;}if(!_0x3ca34d['closed']&&_0x3ca34d[_0x1941('0x3c')]){_0x3ca34d[_0x1941('0x3d')]+=0x1;if(_0x3ca34d[_0x1941('0x37')]){_0x3ca34d['waiting']-=0x1;}}if(_0x3ca34d[_0x1941('0x3b')]&&_0x3ca34d[_0x1941('0x3c')]){_0x3ca34d[_0x1941('0x38')]+=0x1;if(_0x3ca34d['talking']){_0x3ca34d[_0x1941('0x3d')]-=0x1;}}if(_0x3ca34d[_0x1941('0x3b')]&&!_0x3ca34d[_0x1941('0x3c')]){_0x3ca34d[_0x1941('0x39')]+=0x1;if(_0x3ca34d[_0x1941('0x37')]){_0x3ca34d[_0x1941('0x37')]-=0x1;}}_0x3ca34d[_0x1941('0x3a')]+=0x1;_0x59a011(_0x3ca34d);});}exports['index']=function(_0x10089f,_0x348280){var _0x272bcb={},_0x12758c={},_0x465918={'count':0x0,'rows':[]};var _0x427ad4=_['map'](db[_0x1941('0x3e')][_0x1941('0x3f')],function(_0x39e593){return{'name':_0x39e593[_0x1941('0x40')],'type':_0x39e593['type'][_0x1941('0x41')]};});_0x12758c[_0x1941('0x42')]=_[_0x1941('0x31')](_0x427ad4,_0x1941('0x2e'));_0x12758c['query']=_[_0x1941('0x43')](_0x10089f[_0x1941('0x44')]);_0x12758c['filters']=_['intersection'](_0x12758c[_0x1941('0x42')],_0x12758c[_0x1941('0x44')]);_0x272bcb[_0x1941('0x45')]=_[_0x1941('0x46')](_0x12758c[_0x1941('0x42')],qs[_0x1941('0x47')](_0x10089f[_0x1941('0x44')][_0x1941('0x47')]));_0x272bcb[_0x1941('0x45')]=_0x272bcb[_0x1941('0x45')][_0x1941('0x48')]?_0x272bcb[_0x1941('0x45')]:_0x12758c['model'];if(!_0x10089f[_0x1941('0x44')][_0x1941('0x49')](_0x1941('0x4a'))){_0x272bcb[_0x1941('0x22')]=qs[_0x1941('0x22')](_0x10089f[_0x1941('0x44')][_0x1941('0x22')]);_0x272bcb[_0x1941('0x21')]=qs[_0x1941('0x21')](_0x10089f['query']['offset']);}_0x272bcb[_0x1941('0x4b')]=qs['sort'](_0x10089f[_0x1941('0x44')][_0x1941('0x4c')]);_0x272bcb[_0x1941('0x4d')]=qs[_0x1941('0x4e')](_[_0x1941('0x4f')](_0x10089f[_0x1941('0x44')],_0x12758c[_0x1941('0x4e')]),_0x427ad4);var _0x480d92=[];var _0x146561=squel[_0x1941('0x50')]()['field']('id')['field'](_0x1941('0x2e'))['field']('color')[_0x1941('0x51')](_0x1941('0x52'));var _0xc4c54f=squel[_0x1941('0x50')]()[_0x1941('0x53')](_0x1941('0x54'))[_0x1941('0x53')]('u.fullname')['field']('ui.SmsInteractionId')[_0x1941('0x51')](_0x1941('0x55'),'ui')['left_join']('users','u','u.id\x20=\x20ui.UserId');var _0x48c6ab=squel['select']()[_0x1941('0x51')](_0x1941('0x56'),'i')[_0x1941('0x57')](_0x1941('0x58'),'c',_0x1941('0x59'))[_0x1941('0x57')](_0x1941('0x5a'),'o','o.id\x20=\x20i.UserId')['left_join'](_0x1941('0x5b'),'a',_0x1941('0x5c'))[_0x1941('0x57')](_0x1941('0x5d'),'me',_0x1941('0x5e'))[_0x1941('0x57')]('sms_interaction_has_tags','it',_0x1941('0x5f'))[_0x1941('0x57')]('tools_tags','t',_0x1941('0x60'));var _0x1392af=squel[_0x1941('0x61')]();var _0x2619bb=[];var _0xe0fc26=squel[_0x1941('0x61')]();var _0x36d80a;if(_0x10089f[_0x1941('0x44')][_0x1941('0x62')]){_0x36d80a=as[_0x1941('0x63')](_0x10089f['query'][_0x1941('0x62')]);var _0x2fe989=_0x36d80a[_0x1941('0x64')];for(var _0x3ee6ac=0x0;_0x3ee6ac<_0x36d80a[_0x1941('0x65')][_0x1941('0x48')];_0x3ee6ac++){var _0x10ec5c=_0x36d80a['conditions'][_0x3ee6ac];var _0x379a45='i';var _0x59feed=_['find'](_0x427ad4,[_0x1941('0x2e'),_0x10ec5c[_0x1941('0x53')]]);if(!_0x59feed){switch(_0x10ec5c['field']){case _0x1941('0x66'):if(_0x10ec5c[_0x1941('0x67')]==0x1){_0x48c6ab[_0x1941('0x68')]('`'+_0x10ec5c[_0x1941('0x53')]+_0x1941('0x69'));}else{_0x48c6ab[_0x1941('0x68')]('`'+_0x10ec5c[_0x1941('0x53')]+'`\x20>\x200');}break;case'Contact':if(_0x10ec5c['operator']===_0x1941('0x6a')){if(_0x10ec5c['value'][_0x1941('0x33')]('\x20')[_0x1941('0x48')]>0x1){_0x1392af[_0x2fe989](_0x1941('0x6b'),qs['getFullTextValue'](_0x10ec5c[_0x1941('0x67')]),null);}else{var _0x15bbfc='%'+_0x10ec5c[_0x1941('0x67')]+'%';_0x1392af[_0x2fe989](_0x1941('0x6c'),_0x15bbfc,_0x15bbfc,_0x15bbfc);}}else{_0x59feed=_[_0x1941('0x6d')](_0x427ad4,[_0x1941('0x2e'),_0x1941('0x6e')]);_0x10ec5c[_0x1941('0x53')]=_0x1941('0x6e');_0xbcdc5a=as[_0x1941('0x6f')](_0x379a45,_0x59feed['type'],_0x10ec5c);_0x1392af[_0x2fe989](_0xbcdc5a[_0x1941('0x70')],_0xbcdc5a[_0x1941('0x67')][_0x1941('0x71')],_0xbcdc5a[_0x1941('0x67')][_0x1941('0x1f')]);}break;case _0x1941('0x72'):var _0x1297d6=_0x10ec5c[_0x1941('0x67')][_0x1941('0x33')](',')[_0x1941('0x31')](function(_0x408830){return Number(_0x408830);});_0x1297d6[_0x1941('0x34')](function(_0xbaa6a4){_0xe0fc26['or'](_0x1941('0x73'),'%,'+_0xbaa6a4+',%');});_0x2619bb=_[_0x1941('0x74')](_0x2619bb,_0x1297d6);break;case'User':if(_0x10ec5c[_0x1941('0x75')]===_0x1941('0x6a')){_0x1392af[_0x2fe989](_0x1941('0x76'),'%'+_0x10ec5c['value']+'%',null);}else{_0x59feed=_[_0x1941('0x6d')](_0x427ad4,['name',_0x1941('0x3c')]);_0x10ec5c['field']=_0x1941('0x3c');_0xbcdc5a=as[_0x1941('0x6f')](_0x379a45,_0x59feed[_0x1941('0x77')],_0x10ec5c);_0x1392af[_0x2fe989](_0xbcdc5a[_0x1941('0x70')],_0xbcdc5a[_0x1941('0x67')][_0x1941('0x71')],_0xbcdc5a[_0x1941('0x67')][_0x1941('0x1f')]);}break;case _0x1941('0x78'):_0xbcdc5a=as[_0x1941('0x6f')]('me',null,_0x10ec5c);_0x1392af[_0x2fe989](_0xbcdc5a[_0x1941('0x70')],_0xbcdc5a['value']['start'],_0xbcdc5a[_0x1941('0x67')][_0x1941('0x1f')]);break;}}else{var _0xbcdc5a=as[_0x1941('0x6f')](_0x379a45,_0x59feed[_0x1941('0x77')],_0x10ec5c);_0x1392af[_0x2fe989](_0xbcdc5a[_0x1941('0x70')],_0xbcdc5a['value']['start'],_0xbcdc5a['value']['end']);}}}else{var _0x177a4c=_(_0x10089f[_0x1941('0x44')])[_0x1941('0x43')]()[_0x1941('0x31')](function(_0x5dd347){return _['some'](_0x427ad4,[_0x1941('0x2e'),_0x5dd347])?_0x5dd347:undefined;})[_0x1941('0x79')]()[_0x1941('0x67')]();if(!_[_0x1941('0x7a')](_0x177a4c)){_0x177a4c[_0x1941('0x34')](function(_0x4a7f33){if(_0x4a7f33==='SmsAccountId'){_0x48c6ab['where'](_0x1941('0x7b'),[][_0x1941('0x7c')](_0x10089f[_0x1941('0x44')][_0x4a7f33]));}else if(_0x4a7f33===_0x1941('0x7d')){var _0x31c21e=JSON['parse'](_0x10089f['query'][_0x4a7f33])[_0x1941('0x7e')];var _0x46f3c2=JSON[_0x1941('0x7f')](_0x10089f[_0x1941('0x44')][_0x4a7f33])[_0x1941('0x80')];_0x48c6ab[_0x1941('0x4d')](_0x1941('0x81'),_0x31c21e,_0x46f3c2);}else{if(_0x10089f['query'][_0x4a7f33]===_0x1941('0x82')){_0x48c6ab[_0x1941('0x4d')]('i.'+_0x4a7f33+_0x1941('0x83'));}else{_0x48c6ab[_0x1941('0x4d')]('i.'+_0x4a7f33+_0x1941('0x84'),_0x10089f[_0x1941('0x44')][_0x4a7f33]);}}});}if(_0x10089f['query'][_0x1941('0x85')]){if(_0x10089f[_0x1941('0x44')][_0x1941('0x85')]==0x1){_0x48c6ab['having'](_0x1941('0x86'));}else{_0x48c6ab[_0x1941('0x68')](_0x1941('0x87'));}}if(_0x10089f[_0x1941('0x44')][_0x1941('0x88')]){_0x2619bb=_[_0x1941('0x89')](_0x10089f[_0x1941('0x44')][_0x1941('0x88')])?_0x10089f[_0x1941('0x44')][_0x1941('0x88')]:new Array(_0x10089f[_0x1941('0x44')][_0x1941('0x88')]);_0x2619bb['forEach'](function(_0xcf31d5){_0xe0fc26['or'](_0x1941('0x73'),'%,'+_0xcf31d5+',%');});}if(_0x10089f[_0x1941('0x44')][_0x1941('0x8a')]){var _0x4aadf3=_0x10089f[_0x1941('0x44')]['filter'][_0x1941('0x8b')]('\x5c','\x5c\x5c')[_0x1941('0x8b')](/'/g,'\x27\x27');if(qs[_0x1941('0x8c')](_0x4aadf3)){_0x1392af['or'](_0x1941('0x8d'),_0x4aadf3+'%')['or'](_0x1941('0x8e'),_0x4aadf3+'%');}else{_0x1392af['or'](_0x1941('0x8f'),qs[_0x1941('0x90')](_0x4aadf3))['or'](_0x1941('0x91'),_0x4aadf3+'%');}}}_0x48c6ab[_0x1941('0x4d')](_0x1392af);_0x48c6ab[_0x1941('0x92')](_0x1941('0x93'));var _0x25130d={'type':db[_0x1941('0x94')][_0x1941('0x95')]['SELECT'],'raw':!![]};var _0x57e2c2=_0x48c6ab[_0x1941('0x96')]();_0x57e2c2[_0x1941('0x53')](_0x1941('0x93'));_0x57e2c2[_0x1941('0x53')](_0x1941('0x97'),_0x1941('0x66'));if(_0x272bcb[_0x1941('0x4b')]){_0x272bcb[_0x1941('0x4b')][_0x1941('0x34')](function(_0x3f53da){var _0x2d2ab6=_0x3f53da[0x0]===_0x1941('0x98')?_0x3f53da[0x0]:'i.'+_0x3f53da[0x0];_0x48c6ab[_0x1941('0x4b')](_0x2d2ab6,_0x3f53da[0x1]===_0x1941('0x99')?![]:!![]);});}if(!_['isEmpty'](_0x2619bb)){_0x48c6ab[_0x1941('0x68')](_0xe0fc26);_0x57e2c2[_0x1941('0x4d')]('t.id\x20IN\x20?',_0x2619bb);}BPromise['resolve']()['then'](function(){if(!_0x36d80a){if(_0x10089f[_0x1941('0x44')]['SmsAccountId'])return;_0x57e2c2[_0x1941('0x4d')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');_0x48c6ab[_0x1941('0x4d')](_0x1941('0x9a'));return;}if(_0x10089f['user'][_0x1941('0x9b')]!==_0x1941('0x9c'))return;return _0x10089f['user']['getSmsAccounts']({'attributes':['id'],'raw':!![]})['then'](function(_0x4aee40){if(_['isEmpty'](_0x4aee40)){_0x57e2c2[_0x1941('0x4d')](_0x1941('0x9d'));_0x48c6ab[_0x1941('0x4d')](_0x1941('0x9d'));}else{_0x57e2c2[_0x1941('0x4d')]('i.SmsAccountId\x20IN\x20?',_['map'](_0x4aee40,'id'));_0x48c6ab['where'](_0x1941('0x7b'),_[_0x1941('0x31')](_0x4aee40,'id'));}});})['then'](function(){if(_0x10089f[_0x1941('0x9e')][_0x1941('0x9b')]===_0x1941('0x9c')&&!_0x36d80a&&!_0x10089f[_0x1941('0x44')][_0x1941('0x9f')])return[];return db['sequelize'][_0x1941('0x44')](_0x57e2c2['toString'](),_0x25130d);})[_0x1941('0x29')](function(_0x575313){_0x465918['count']=_0x575313['length'];if(_0x465918[_0x1941('0x24')]===0x0)return[];return db['sequelize']['query'](_0x146561['toString'](),_0x25130d)['then'](function(_0x3aff45){_0x480d92=_['keyBy'](_0x3aff45,'id');_0x25130d=_['merge'](_0x25130d,{'model':db[_0x1941('0x3e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x10089f[_0x1941('0x44')][_0x1941('0x47')]){_0x272bcb[_0x1941('0x45')][_0x1941('0x34')](function(_0x3b53){_0x48c6ab[_0x1941('0x53')]('i.'+_0x3b53);});}else{_0x48c6ab['field'](_0x1941('0x97'),_0x1941('0x66'));_0x48c6ab[_0x1941('0x53')](_0x1941('0xa0'),'Account.key');_0x48c6ab['field'](_0x1941('0xa1'),'Account.mandatoryDisposition');_0x48c6ab[_0x1941('0x53')]('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',_0x1941('0x98'));_0x48c6ab[_0x1941('0x53')](_0x1941('0xa2'));_0x48c6ab[_0x1941('0x53')](_0x1941('0xa3'),_0x1941('0xa4'));_0x48c6ab['field'](_0x1941('0xa5'),_0x1941('0xa6'));_0x48c6ab[_0x1941('0x53')]('c.email',_0x1941('0xa7'));_0x48c6ab[_0x1941('0x53')](_0x1941('0xa8'),_0x1941('0xa9'));_0x48c6ab['field'](_0x1941('0xaa'),_0x1941('0xab'));_0x48c6ab[_0x1941('0x53')](_0x1941('0xac'),_0x1941('0xad'));_0x48c6ab[_0x1941('0x53')](_0x1941('0xae'),_0x1941('0xaf'));_0x48c6ab[_0x1941('0x53')](_0x1941('0xb0'),_0x1941('0xb1'));_0x48c6ab[_0x1941('0x53')](_0x1941('0xb2'),_0x1941('0x32'));}if(_0x272bcb[_0x1941('0x22')])_0x48c6ab[_0x1941('0x22')](_0x272bcb[_0x1941('0x22')]);if(_0x272bcb[_0x1941('0x21')])_0x48c6ab[_0x1941('0x21')](_0x272bcb['offset']);return db[_0x1941('0xb3')][_0x1941('0x44')](_0x48c6ab[_0x1941('0xb4')](),_0x25130d);})['then'](function(_0x1452ea){if(_0x1452ea[_0x1941('0x48')]>0x0)_0xc4c54f[_0x1941('0x4d')](_0x1941('0xb5'),_[_0x1941('0x31')](_0x1452ea,'id'));return db[_0x1941('0xb3')][_0x1941('0x44')](_0xc4c54f[_0x1941('0xb4')](),_0x25130d)[_0x1941('0x29')](function(_0xfb351a){var _0x4412e6=_['groupBy'](_0xfb351a,_0x1941('0xb6'));var _0x544908=[];_0x1452ea['forEach'](function(_0x36d849){_0x544908['push'](updateSmsInteraction(_0x36d849,_0x480d92,_0x4412e6));});return BPromise[_0x1941('0xb7')](_0x544908);});});})[_0x1941('0x29')](function(_0x50cb72){_0x465918[_0x1941('0xb8')]=_0x50cb72;return _0x465918;})['then'](respondWithFilteredResult(_0x348280,_0x272bcb))[_0x1941('0x36')](handleError(_0x348280,null));};exports[_0x1941('0xb9')]=function(_0x4054c5,_0x446391){var _0x18e0eb={'raw':![],'where':{'id':_0x4054c5[_0x1941('0xba')]['id']}},_0x508258={};_0x508258['model']=_[_0x1941('0x43')](db[_0x1941('0x3e')][_0x1941('0x3f')]);_0x508258[_0x1941('0x44')]=_[_0x1941('0x43')](_0x4054c5[_0x1941('0x44')]);_0x508258[_0x1941('0x4e')]=_[_0x1941('0x46')](_0x508258['model'],_0x508258[_0x1941('0x44')]);_0x18e0eb['attributes']=_[_0x1941('0x46')](_0x508258['model'],qs[_0x1941('0x47')](_0x4054c5[_0x1941('0x44')][_0x1941('0x47')]));_0x18e0eb[_0x1941('0x45')]=_0x18e0eb[_0x1941('0x45')][_0x1941('0x48')]?_0x18e0eb['attributes']:_0x508258[_0x1941('0x42')];if(_0x4054c5['query'][_0x1941('0xbb')]){_0x18e0eb[_0x1941('0xbc')]=[{'all':!![]}];}_0x18e0eb=_[_0x1941('0xbd')]({},_0x18e0eb,_0x4054c5['options']);return db[_0x1941('0x3e')][_0x1941('0x6d')](_0x18e0eb)[_0x1941('0x29')](handleEntityNotFound(_0x446391,null))[_0x1941('0x29')](respondWithResult(_0x446391,null))[_0x1941('0x36')](handleError(_0x446391,null));};exports[_0x1941('0xbe')]=function(_0xd13b29,_0xbb3588){return db[_0x1941('0x3e')]['create'](_0xd13b29[_0x1941('0x78')],{})['then'](respondWithResult(_0xbb3588,0xc9))[_0x1941('0x36')](handleError(_0xbb3588,null));};exports[_0x1941('0x28')]=function(_0x39a83e,_0x3bb31a){if(_0x39a83e[_0x1941('0x78')]['id']){delete _0x39a83e[_0x1941('0x78')]['id'];}return db[_0x1941('0x3e')][_0x1941('0x6d')]({'where':{'id':_0x39a83e['params']['id']}})[_0x1941('0x29')](handleEntityNotFound(_0x3bb31a,null))['then'](saveUpdates(_0x39a83e[_0x1941('0x78')],null))['then'](respondWithResult(_0x3bb31a,null))['catch'](handleError(_0x3bb31a,null));};exports[_0x1941('0x2a')]=function(_0x6048fe,_0x449ab0){return db[_0x1941('0x3e')][_0x1941('0x6d')]({'where':{'id':_0x6048fe[_0x1941('0xba')]['id']}})[_0x1941('0x29')](handleEntityNotFound(_0x449ab0,null))[_0x1941('0x29')](removeEntity(_0x449ab0,null))[_0x1941('0x36')](handleError(_0x449ab0,null));};exports[_0x1941('0xbf')]=function(_0x5e0db3,_0x79c88f){return db[_0x1941('0x3e')]['describe']()[_0x1941('0x29')](respondWithResult(_0x79c88f,null))[_0x1941('0x36')](handleError(_0x79c88f,null));};exports[_0x1941('0xc0')]=function(_0x45ea8a,_0x39230e,_0x27e0cf){return db[_0x1941('0xc1')][_0x1941('0x6d')]({'where':{'id':_0x45ea8a[_0x1941('0xba')]['id']}})['then'](handleEntityNotFound(_0x39230e,null))[_0x1941('0x29')](function(_0x41f7fc){if(_0x41f7fc){return _0x41f7fc[_0x1941('0xc0')](_0x45ea8a[_0x1941('0x78')][_0x1941('0xc2')],_[_0x1941('0xc3')](_0x45ea8a[_0x1941('0x78')],[_0x1941('0xc2'),'id'])||{});}})['then'](respondWithResult(_0x39230e,null))['catch'](handleError(_0x39230e,null));};exports[_0x1941('0xc4')]=function(_0x1a6963,_0x431d68,_0x493506){var _0x2d2b60={'raw':![],'where':{}};var _0x289b13={};var _0x13224a={'count':0x0,'rows':[]};return db[_0x1941('0x3e')][_0x1941('0xc5')]({'where':{'id':_0x1a6963['params']['id']}})[_0x1941('0x29')](handleEntityNotFound(_0x431d68,null))[_0x1941('0x29')](function(_0x172ac5){if(_0x172ac5){_0x289b13['model']=_['keys'](db[_0x1941('0xc1')]['rawAttributes']);_0x289b13[_0x1941('0x44')]=_[_0x1941('0x43')](_0x1a6963[_0x1941('0x44')]);_0x289b13[_0x1941('0x4e')]=_[_0x1941('0x46')](_0x289b13[_0x1941('0x42')],_0x289b13['query']);_0x2d2b60[_0x1941('0x45')]=_['intersection'](_0x289b13[_0x1941('0x42')],qs[_0x1941('0x47')](_0x1a6963[_0x1941('0x44')][_0x1941('0x47')]));_0x2d2b60[_0x1941('0x45')]=_0x2d2b60[_0x1941('0x45')][_0x1941('0x48')]?_0x2d2b60['attributes']:_0x289b13[_0x1941('0x42')];if(!_0x1a6963[_0x1941('0x44')][_0x1941('0x49')](_0x1941('0x4a'))){_0x2d2b60[_0x1941('0x22')]=qs[_0x1941('0x22')](_0x1a6963['query'][_0x1941('0x22')]);_0x2d2b60['offset']=qs[_0x1941('0x21')](_0x1a6963['query'][_0x1941('0x21')]);}_0x2d2b60[_0x1941('0x4b')]=qs[_0x1941('0x4c')](_0x1a6963['query']['sort']);_0x2d2b60['where']=qs[_0x1941('0x4e')](_[_0x1941('0x4f')](_0x1a6963[_0x1941('0x44')],_0x289b13[_0x1941('0x4e')]));_0x2d2b60[_0x1941('0x4d')]['SmsInteractionId']=_0x172ac5['id'];if(_0x1a6963[_0x1941('0x44')]['filter']){_0x2d2b60['where']=_[_0x1941('0xbd')](_0x2d2b60[_0x1941('0x4d')],{'$or':_['map'](_0x2d2b60[_0x1941('0x45')],function(_0x5180e6){var _0x49776c={};_0x49776c[_0x5180e6]={'$like':'%'+_0x1a6963[_0x1941('0x44')][_0x1941('0x8a')]+'%'};return _0x49776c;})});}if(_0x1a6963['query']['$gte']){var _0x2a8ecb=_0x1a6963[_0x1941('0x44')][_0x1941('0x7e')]['split'](',');var _0x17a741={};_0x17a741[_0x2a8ecb[0x0]]={'$gte':moment(_0x2a8ecb[0x1])[_0x1941('0xc6')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2d2b60[_0x1941('0x4d')]=_['merge'](_0x2d2b60[_0x1941('0x4d')],_0x17a741);}_0x2d2b60=_[_0x1941('0xbd')]({},_0x2d2b60,_0x1a6963[_0x1941('0xc7')]);return db[_0x1941('0xc1')][_0x1941('0x24')]({'where':_0x2d2b60[_0x1941('0x4d')]})[_0x1941('0x29')](function(_0x494080){_0x13224a['count']=_0x494080;if(_0x1a6963[_0x1941('0x44')][_0x1941('0xbb')]){_0x2d2b60[_0x1941('0xbc')]=[{'all':!![]}];}return db[_0x1941('0xc1')][_0x1941('0xc8')](_0x2d2b60);})[_0x1941('0x29')](function(_0x4a31c6){_0x13224a[_0x1941('0xb8')]=_0x4a31c6;return _0x13224a;});}})[_0x1941('0x29')](respondWithFilteredResult(_0x431d68,_0x2d2b60))[_0x1941('0x36')](handleError(_0x431d68,null));};exports[_0x1941('0xc9')]=function(_0x2b375c,_0x1e92b3,_0x287104){return db[_0x1941('0x3e')][_0x1941('0x6d')]({'where':{'id':_0x2b375c[_0x1941('0xba')]['id']}})[_0x1941('0x29')](handleEntityNotFound(_0x1e92b3,null))[_0x1941('0x29')](function(_0x54e6d0){if(_0x54e6d0){return _0x54e6d0[_0x1941('0xca')](_0x2b375c[_0x1941('0x78')][_0x1941('0xc2')],_[_0x1941('0xc3')](_0x2b375c['body'],['ids','id'])||{})[_0x1941('0xcb')](function(){return db[_0x1941('0x72')][_0x1941('0xc8')]({'attributes':['id',_0x1941('0x2e'),_0x1941('0xcc')],'where':{'id':_0x2b375c['body'][_0x1941('0xc2')]}});})[_0x1941('0x29')](function(_0x3db48e){socket['emit']('smsInteractionTags:save',{'id':Number(_0x2b375c[_0x1941('0xba')]['id']),'tags':_0x3db48e||[]});return{'id':Number(_0x2b375c[_0x1941('0xba')]['id']),'tags':_0x3db48e||[]};});}})[_0x1941('0x29')](respondWithResult(_0x1e92b3,null))['catch'](handleError(_0x1e92b3,null));};exports['removeTags']=function(_0x4b3ad7,_0x35e489,_0x477012){return db[_0x1941('0x3e')][_0x1941('0x6d')]({'where':{'id':_0x4b3ad7[_0x1941('0xba')]['id']}})[_0x1941('0x29')](handleEntityNotFound(_0x35e489,null))[_0x1941('0x29')](function(_0xc93b5){if(_0xc93b5){return _0xc93b5[_0x1941('0xcd')](_0x4b3ad7[_0x1941('0x44')]['ids']);}})['then'](respondWithStatusCode(_0x35e489,null))[_0x1941('0x36')](handleError(_0x35e489,null));};exports['download']=function(_0x3fbb21,_0x45ce2b){var _0x1ed0dd=moment()[_0x1941('0xce')]()['toString']();var _0x3fad71=path[_0x1941('0xcf')](config[_0x1941('0xd0')],_0x1941('0xd1'),_0x1941('0xd2'),_0x1941('0xd3'));var _0x5cc703=path[_0x1941('0xcf')](config[_0x1941('0xd0')],_0x1941('0xd1'),_0x1941('0xd2'),_0x1941('0xd4'));var _0xfdbd30=path[_0x1941('0xcf')](_0x3fad71,_0x1ed0dd);var _0x388198=util[_0x1941('0xc6')]('transcript-%d-%s.zip',_0x3fbb21[_0x1941('0xba')]['id'],_0x1ed0dd);var _0x17ac7c=path['join'](_0x3fad71,_0x388198);var _0x44dc7b=[];_0x44dc7b[_0x1941('0xd5')]({'model':db[_0x1941('0xd6')],'as':_0x1941('0xd6'),'attributes':['id','fullname'],'raw':!![]});_0x44dc7b[_0x1941('0xd5')]({'model':db[_0x1941('0xd7')],'as':'Contact','attributes':['id',_0x1941('0xd8'),'lastName'],'raw':!![]});var _0x4ec02b=[{'model':db[_0x1941('0xc1')],'as':_0x1941('0xd9'),'attributes':['id',_0x1941('0x78'),_0x1941('0x7d'),_0x1941('0xda'),_0x1941('0xdb'),'read'],'include':_0x44dc7b}];_0x4ec02b[_0x1941('0xd5')]({'model':db['SmsAccount'],'as':_0x1941('0xdc'),'attributes':['id',_0x1941('0x2e')]});_0x4ec02b[_0x1941('0xd5')]({'model':db['User'],'as':_0x1941('0xdd'),'attributes':['id',_0x1941('0xde')]});return db[_0x1941('0x3e')][_0x1941('0x6d')]({'where':{'id':_0x3fbb21[_0x1941('0xba')]['id']},'include':_0x4ec02b})[_0x1941('0x29')](handleEntityNotFound(_0x45ce2b,null))[_0x1941('0x29')](function(_0x26e145){if(_0x26e145){var _0x4a9d1a=_0x26e145['get']({'plain':!![]});fs['mkdirSync'](_0xfdbd30);var _0x4145fb={'channel':_0x1941('0xdf'),'account':_0x4a9d1a['Account'][_0x1941('0x2e')],'agent':_0x4a9d1a['Owner']?_0x4a9d1a[_0x1941('0xdd')][_0x1941('0xde')]:_0x1941('0xe0'),'createdAt':moment(_0x4a9d1a[_0x1941('0x7d')])['format'](_0x1941('0xe1'))[_0x1941('0xb4')](),'closedAt':_0x4a9d1a[_0x1941('0x3b')]?moment(_0x4a9d1a[_0x1941('0xe2')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x4a9d1a[_0x1941('0xe3')],'messages':_(_0x4a9d1a[_0x1941('0xd9')])[_0x1941('0x8a')]({'secret':![]})[_0x1941('0x31')](function(_0x3846f6){return{'date':moment(_0x3846f6[_0x1941('0x7d')])['format'](_0x1941('0xe1'))[_0x1941('0xb4')](),'sender':_0x3846f6[_0x1941('0xda')]===_0x1941('0xe4')?_0x3846f6[_0x1941('0xd6')]?_0x3846f6['User'][_0x1941('0xde')]:_0x1941('0xe5'):_0x3846f6[_0x1941('0xe6')][_0x1941('0xd8')]+(_0x3846f6['Contact'][_0x1941('0xe7')]?'\x20'+_0x3846f6[_0x1941('0xe6')][_0x1941('0xe7')]:''),'body':_0x3846f6[_0x1941('0x78')],'direction':_0x3846f6[_0x1941('0xda')]===_0x1941('0xe4')?'A':'C','secret':_0x3846f6[_0x1941('0xdb')],'read':_0x3846f6['read']};})[_0x1941('0x67')]()};return ejs[_0x1941('0xe8')](path[_0x1941('0xcf')](config['root'],'server',_0x1941('0xe9'),_0x1941('0xea')),{'interaction':_0x4145fb})['then'](function(_0x4eea2a){var _0x515a84=path[_0x1941('0xcf')](_0xfdbd30,'transcript-'+_0x4a9d1a['id']+'-'+_0x1ed0dd+'.pdf');var _0x1f1d51={'path':_0x515a84,'channel':'Sms','interactionId':_0x4a9d1a['id']};return pdf['createPdfFromHTML'](_0x4eea2a,_0x1f1d51);})['then'](function(){return new BPromise(function(_0x21c416,_0x5972e0){zipdir(_0xfdbd30,{'saveTo':_0x17ac7c},function(_0x44eb68,_0x2f8510){if(_0x44eb68)return _0x5972e0(_0x44eb68);return _0x21c416(_0x2f8510);});})[_0x1941('0x29')](function(){return new BPromise(function(_0x396edc,_0x2ec1fd){rimraf(_0xfdbd30,function(_0x4aa7b4){if(_0x4aa7b4)_0x2ec1fd(_0x4aa7b4);return _0x396edc();});});})[_0x1941('0x29')](function(){return _0x45ce2b[_0x1941('0xeb')](_0x17ac7c,_0x388198,function(_0x381a05){if(_0x381a05){console[_0x1941('0xec')](_0x1941('0xed'),_0x381a05);}else{fs[_0x1941('0xee')](_0x17ac7c);}});});});}else{return _0x45ce2b['sendStatus'](0xc8);}})[_0x1941('0x36')](handleError(_0x45ce2b,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 0870f2c..bee4459 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 _0xc2c7=['setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove','getUsers','Users','map','findAll','then'];(function(_0x569c85,_0x4e61e2){var _0x47731d=function(_0xd0bd42){while(--_0xd0bd42){_0x569c85['push'](_0x569c85['shift']());}};_0x47731d(++_0x4e61e2);}(_0xc2c7,0x134));var _0x7c2c=function(_0x108c0c,_0x1aee92){_0x108c0c=_0x108c0c-0x0;var _0x477dbd=_0xc2c7[_0x108c0c];return _0x477dbd;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0x7c2c('0x0'))['db'][_0x7c2c('0x1')];var SmsMessage=require(_0x7c2c('0x0'))['db'][_0x7c2c('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x7c2c('0x3')](0x0);var events={'afterCreate':_0x7c2c('0x4'),'afterUpdate':_0x7c2c('0x5'),'afterDestroy':_0x7c2c('0x6')};function emitEvent(_0x4bbc14){return function(_0x59f346,_0x31dc4e,_0x42ecc9){_0x59f346[_0x7c2c('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4abe93){_0x59f346['setDataValue'](_0x7c2c('0x8'),_0x4abe93[_0x7c2c('0x9')](function(_0x3e668f){return{'id':_0x3e668f['id']};}));return SmsMessage[_0x7c2c('0xa')]({'where':{'SmsInteractionId':_0x59f346['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7c2c('0xb')](function(_0x57b107){_0x59f346[_0x7c2c('0xc')](_0x7c2c('0xd'),_0x57b107[_0x7c2c('0xe')]);SmsInteractionEvents[_0x7c2c('0xf')](_0x4bbc14+':'+_0x59f346['id'],_0x59f346);SmsInteractionEvents[_0x7c2c('0xf')](_0x4bbc14,_0x59f346);_0x42ecc9(null);})[_0x7c2c('0x10')](_0x42ecc9(null));};}for(var e in events){if(events[_0x7c2c('0x11')](e)){var event=events[e];SmsInteraction[_0x7c2c('0x12')](e,emitEvent(event));}}module[_0x7c2c('0x13')]=SmsInteractionEvents; \ No newline at end of file +var _0xadb5=['update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','emit','catch','hasOwnProperty','exports','../../mysqldb','SmsMessage','setMaxListeners'];(function(_0xa9a8db,_0x3eceb0){var _0x40988e=function(_0x26190e){while(--_0x26190e){_0xa9a8db['push'](_0xa9a8db['shift']());}};_0x40988e(++_0x3eceb0);}(_0xadb5,0xad));var _0x5adb=function(_0x14cb2d,_0x37e5c0){_0x14cb2d=_0x14cb2d-0x0;var _0x14b4a0=_0xadb5[_0x14cb2d];return _0x14b4a0;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0x5adb('0x0'))['db']['SmsInteraction'];var SmsMessage=require(_0x5adb('0x0'))['db'][_0x5adb('0x1')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x5adb('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5adb('0x3'),'afterDestroy':_0x5adb('0x4')};function emitEvent(_0x2e3ef4){return function(_0x4cb1d1,_0x35a5d3,_0x168d89){_0x4cb1d1[_0x5adb('0x5')]({'attributes':['id'],'raw':!![]})[_0x5adb('0x6')](function(_0xdf3776){_0x4cb1d1[_0x5adb('0x7')](_0x5adb('0x8'),_0xdf3776[_0x5adb('0x9')](function(_0x41261c){return{'id':_0x41261c['id']};}));return SmsMessage[_0x5adb('0xa')]({'where':{'SmsInteractionId':_0x4cb1d1['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5adb('0x6')](function(_0x336bad){_0x4cb1d1[_0x5adb('0x7')](_0x5adb('0xb'),_0x336bad['length']);SmsInteractionEvents['emit'](_0x2e3ef4+':'+_0x4cb1d1['id'],_0x4cb1d1);SmsInteractionEvents[_0x5adb('0xc')](_0x2e3ef4,_0x4cb1d1);_0x168d89(null);})[_0x5adb('0xd')](_0x168d89(null));};}for(var e in events){if(events[_0x5adb('0xe')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0x5adb('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 6eabd27..8641a30 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 _0x9ae0=['changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','SmsInteraction','sms_interactions'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9ae0,0x1b7));var _0x09ae=function(_0x84d890,_0x5913ff){_0x84d890=_0x84d890-0x0;var _0x5d41b4=_0x9ae0[_0x84d890];return _0x5d41b4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x09ae('0x0'))(_0x09ae('0x1'));var moment=require(_0x09ae('0x2'));var BPromise=require(_0x09ae('0x3'));var rp=require(_0x09ae('0x4'));var fs=require('fs');var path=require(_0x09ae('0x5'));var rimraf=require(_0x09ae('0x6'));var config=require('../../config/environment');var attributes=require('./smsInteraction.attributes');module[_0x09ae('0x7')]=function(_0x34b0fe,_0xd1c912){return _0x34b0fe[_0x09ae('0x8')](_0x09ae('0x9'),attributes,{'tableName':_0x09ae('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x26bb78,_0x5139b4,_0x3b90be){if(_0x26bb78[_0x09ae('0xb')]('closed')){_0x26bb78[_0x09ae('0xc')]=moment()[_0x09ae('0xd')](_0x09ae('0xe'));}_0x3b90be(null,_0x26bb78);}}});}; \ No newline at end of file +var _0x0fdb=['define','SmsInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./smsInteraction.attributes','exports'];(function(_0x4f8886,_0x9be826){var _0x3c49e4=function(_0x3121e1){while(--_0x3121e1){_0x4f8886['push'](_0x4f8886['shift']());}};_0x3c49e4(++_0x9be826);}(_0x0fdb,0xb1));var _0xb0fd=function(_0xb0c11d,_0x3cefe9){_0xb0c11d=_0xb0c11d-0x0;var _0x7f6999=_0x0fdb[_0xb0c11d];return _0x7f6999;};'use strict';var _=require(_0xb0fd('0x0'));var util=require(_0xb0fd('0x1'));var logger=require(_0xb0fd('0x2'))(_0xb0fd('0x3'));var moment=require(_0xb0fd('0x4'));var BPromise=require(_0xb0fd('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb0fd('0x6'));var rimraf=require(_0xb0fd('0x7'));var config=require('../../config/environment');var attributes=require(_0xb0fd('0x8'));module[_0xb0fd('0x9')]=function(_0x2673aa,_0x4c8198){return _0x2673aa[_0xb0fd('0xa')](_0xb0fd('0xb'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1a4db8,_0x5646ce,_0x8ec7ec){if(_0x1a4db8[_0xb0fd('0xc')](_0xb0fd('0xd'))){_0x1a4db8[_0xb0fd('0xe')]=moment()[_0xb0fd('0xf')](_0xb0fd('0x10'));}_0x8ec7ec(null,_0x1a4db8);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 96bcc86..635ed73 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 _0xdfe7=['AddTags','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SmsInteraction,\x20%s,\x20%s','message','info','result','catch','UpdateSmsInteraction','SmsInteraction','update','options','raw','where','attributes','limit','then','AddTagsToSmsInteraction','find','ids','spread'];(function(_0x19e3e9,_0x159e50){var _0x56519c=function(_0x226db4){while(--_0x226db4){_0x19e3e9['push'](_0x19e3e9['shift']());}};_0x56519c(++_0x159e50);}(_0xdfe7,0x82));var _0x7dfe=function(_0x45af1f,_0x2661f8){_0x45af1f=_0x45af1f-0x0;var _0x2f1c80=_0xdfe7[_0x45af1f];return _0x2f1c80;};'use strict';var _=require('lodash');var util=require(_0x7dfe('0x0'));var moment=require('moment');var BPromise=require(_0x7dfe('0x1'));var rs=require(_0x7dfe('0x2'));var fs=require('fs');var Redis=require(_0x7dfe('0x3'));var db=require(_0x7dfe('0x4'))['db'];var utils=require(_0x7dfe('0x5'));var logger=require(_0x7dfe('0x6'))(_0x7dfe('0x7'));var config=require(_0x7dfe('0x8'));var jayson=require(_0x7dfe('0x9'));var client=jayson[_0x7dfe('0xa')][_0x7dfe('0xb')]({'port':0x232a});config[_0x7dfe('0xc')]=_[_0x7dfe('0xd')](config[_0x7dfe('0xc')],{'host':_0x7dfe('0xe'),'port':0x18eb});var socket=require(_0x7dfe('0xf'))(new Redis(config[_0x7dfe('0xc')]));require('./smsInteraction.socket')[_0x7dfe('0x10')](socket);function respondWithRpcPromise(_0x1bf9a7,_0x2fd9e8,_0x1d968a){return new BPromise(function(_0x5783bd,_0x1d1d8e){return client[_0x7dfe('0x11')](_0x1bf9a7,_0x1d968a)['then'](function(_0x403a30){logger['info']('SmsInteraction,\x20%s,\x20%s',_0x2fd9e8,'request\x20sent');logger[_0x7dfe('0x12')](_0x7dfe('0x13'),_0x2fd9e8,_0x7dfe('0x14'),JSON[_0x7dfe('0x15')](_0x403a30));if(_0x403a30[_0x7dfe('0x16')]){if(_0x403a30[_0x7dfe('0x16')][_0x7dfe('0x17')]===0x1f4){logger[_0x7dfe('0x16')](_0x7dfe('0x18'),_0x2fd9e8,_0x403a30[_0x7dfe('0x16')][_0x7dfe('0x19')]);return _0x1d1d8e(_0x403a30['error']['message']);}logger[_0x7dfe('0x16')](_0x7dfe('0x18'),_0x2fd9e8,_0x403a30[_0x7dfe('0x16')][_0x7dfe('0x19')]);return _0x5783bd(_0x403a30['error'][_0x7dfe('0x19')]);}else{logger[_0x7dfe('0x1a')](_0x7dfe('0x18'),_0x2fd9e8,_0x7dfe('0x14'));_0x5783bd(_0x403a30[_0x7dfe('0x1b')][_0x7dfe('0x19')]);}})[_0x7dfe('0x1c')](function(_0x49f7af){logger[_0x7dfe('0x16')]('SmsInteraction,\x20%s,\x20%s',_0x2fd9e8,_0x49f7af);_0x1d1d8e(_0x49f7af);});});}exports[_0x7dfe('0x1d')]=function(_0x1f4824){var _0x5c3e25=this;return new Promise(function(_0x59fdd5,_0x31e5bc){return db[_0x7dfe('0x1e')][_0x7dfe('0x1f')](_0x1f4824['body'],{'raw':_0x1f4824[_0x7dfe('0x20')]?_0x1f4824[_0x7dfe('0x20')][_0x7dfe('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1f4824['options']?_0x1f4824[_0x7dfe('0x20')][_0x7dfe('0x22')]||null:null,'attributes':_0x1f4824['options']?_0x1f4824['options'][_0x7dfe('0x23')]||null:null,'limit':_0x1f4824[_0x7dfe('0x20')]?_0x1f4824[_0x7dfe('0x20')][_0x7dfe('0x24')]||null:null})[_0x7dfe('0x25')](function(_0x45d101){logger[_0x7dfe('0x1a')](_0x7dfe('0x1d'),_0x1f4824);logger['debug'](_0x7dfe('0x1d'),_0x1f4824,JSON[_0x7dfe('0x15')](_0x45d101));_0x59fdd5(_0x45d101);})[_0x7dfe('0x1c')](function(_0x54c1c3){logger['error']('UpdateSmsInteraction',_0x54c1c3[_0x7dfe('0x19')],_0x1f4824);_0x31e5bc(_0x5c3e25[_0x7dfe('0x16')](0x1f4,_0x54c1c3['message']));});});};exports[_0x7dfe('0x26')]=function(_0x4b9854){return new Promise(function(_0x3dc088,_0x86f439){return db[_0x7dfe('0x1e')][_0x7dfe('0x27')]({'where':_0x4b9854['options']?_0x4b9854[_0x7dfe('0x20')]['where']||null:null})[_0x7dfe('0x25')](function(_0x5ccd27){if(_0x5ccd27){return _0x5ccd27['addTags'](_0x4b9854['body'][_0x7dfe('0x28')],_['omit'](_0x4b9854['body'],[_0x7dfe('0x28'),'id'])||{});}})[_0x7dfe('0x29')](function(_0x40b505){logger[_0x7dfe('0x1a')](_0x7dfe('0x2a'),_0x4b9854);logger[_0x7dfe('0x12')](_0x7dfe('0x2a'),_0x4b9854,JSON[_0x7dfe('0x15')](_0x40b505));_0x3dc088(_0x40b505);})['catch'](function(_0x268ea7){logger[_0x7dfe('0x16')](_0x7dfe('0x2a'),_0x268ea7[_0x7dfe('0x19')],_0x4b9854);_0x86f439(_this[_0x7dfe('0x16')](0x1f4,_0x268ea7[_0x7dfe('0x19')]));});});}; \ No newline at end of file +var _0xd631=['debug','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','SmsInteraction','update','options','raw','attributes','then','UpdateSmsInteraction','stringify','AddTagsToSmsInteraction','addTags','body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','register','request','info','SmsInteraction,\x20%s,\x20%s'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0xd631,0x91));var _0x1d63=function(_0x209fcd,_0x1ecccc){_0x209fcd=_0x209fcd-0x0;var _0x501d5e=_0xd631[_0x209fcd];return _0x501d5e;};'use strict';var _=require(_0x1d63('0x0'));var util=require(_0x1d63('0x1'));var moment=require(_0x1d63('0x2'));var BPromise=require(_0x1d63('0x3'));var rs=require(_0x1d63('0x4'));var fs=require('fs');var Redis=require(_0x1d63('0x5'));var db=require(_0x1d63('0x6'))['db'];var utils=require(_0x1d63('0x7'));var logger=require(_0x1d63('0x8'))(_0x1d63('0x9'));var config=require(_0x1d63('0xa'));var jayson=require(_0x1d63('0xb'));var client=jayson[_0x1d63('0xc')]['http']({'port':0x232a});config[_0x1d63('0xd')]=_['defaults'](config[_0x1d63('0xd')],{'host':_0x1d63('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1d63('0xd')]));require('./smsInteraction.socket')[_0x1d63('0xf')](socket);function respondWithRpcPromise(_0x3ce3c6,_0x5a54cb,_0xfa54e4){return new BPromise(function(_0x58285c,_0x1dfba7){return client[_0x1d63('0x10')](_0x3ce3c6,_0xfa54e4)['then'](function(_0x39eb94){logger[_0x1d63('0x11')](_0x1d63('0x12'),_0x5a54cb,'request\x20sent');logger[_0x1d63('0x13')](_0x1d63('0x14'),_0x5a54cb,_0x1d63('0x15'),JSON['stringify'](_0x39eb94));if(_0x39eb94['error']){if(_0x39eb94['error']['code']===0x1f4){logger[_0x1d63('0x16')](_0x1d63('0x12'),_0x5a54cb,_0x39eb94['error'][_0x1d63('0x17')]);return _0x1dfba7(_0x39eb94[_0x1d63('0x16')]['message']);}logger[_0x1d63('0x16')]('SmsInteraction,\x20%s,\x20%s',_0x5a54cb,_0x39eb94[_0x1d63('0x16')][_0x1d63('0x17')]);return _0x58285c(_0x39eb94[_0x1d63('0x16')][_0x1d63('0x17')]);}else{logger['info'](_0x1d63('0x12'),_0x5a54cb,_0x1d63('0x15'));_0x58285c(_0x39eb94[_0x1d63('0x18')][_0x1d63('0x17')]);}})[_0x1d63('0x19')](function(_0x280f69){logger[_0x1d63('0x16')](_0x1d63('0x12'),_0x5a54cb,_0x280f69);_0x1dfba7(_0x280f69);});});}exports['UpdateSmsInteraction']=function(_0x3ca1f8){var _0x15baad=this;return new Promise(function(_0x43b69b,_0x4aee89){return db[_0x1d63('0x1a')][_0x1d63('0x1b')](_0x3ca1f8['body'],{'raw':_0x3ca1f8[_0x1d63('0x1c')]?_0x3ca1f8[_0x1d63('0x1c')][_0x1d63('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ca1f8[_0x1d63('0x1c')]?_0x3ca1f8[_0x1d63('0x1c')]['where']||null:null,'attributes':_0x3ca1f8[_0x1d63('0x1c')]?_0x3ca1f8[_0x1d63('0x1c')][_0x1d63('0x1e')]||null:null,'limit':_0x3ca1f8[_0x1d63('0x1c')]?_0x3ca1f8['options']['limit']||null:null})[_0x1d63('0x1f')](function(_0x1cdb1f){logger['info'](_0x1d63('0x20'),_0x3ca1f8);logger['debug'](_0x1d63('0x20'),_0x3ca1f8,JSON[_0x1d63('0x21')](_0x1cdb1f));_0x43b69b(_0x1cdb1f);})['catch'](function(_0x1e9fd9){logger[_0x1d63('0x16')]('UpdateSmsInteraction',_0x1e9fd9['message'],_0x3ca1f8);_0x4aee89(_0x15baad[_0x1d63('0x16')](0x1f4,_0x1e9fd9['message']));});});};exports[_0x1d63('0x22')]=function(_0x3cbb9b){return new Promise(function(_0x2019d7,_0x19cd81){return db[_0x1d63('0x1a')]['find']({'where':_0x3cbb9b[_0x1d63('0x1c')]?_0x3cbb9b[_0x1d63('0x1c')]['where']||null:null})[_0x1d63('0x1f')](function(_0x106617){if(_0x106617){return _0x106617[_0x1d63('0x23')](_0x3cbb9b[_0x1d63('0x24')][_0x1d63('0x25')],_[_0x1d63('0x26')](_0x3cbb9b[_0x1d63('0x24')],[_0x1d63('0x25'),'id'])||{});}})[_0x1d63('0x27')](function(_0x172382){logger[_0x1d63('0x11')](_0x1d63('0x28'),_0x3cbb9b);logger['debug'](_0x1d63('0x28'),_0x3cbb9b,JSON[_0x1d63('0x21')](_0x172382));_0x2019d7(_0x172382);})[_0x1d63('0x19')](function(_0xa5ac2b){logger[_0x1d63('0x16')]('AddTags',_0xa5ac2b[_0x1d63('0x17')],_0x3cbb9b);_0x19cd81(_this[_0x1d63('0x16')](0x1f4,_0xa5ac2b['message']));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 98ad833..2d7506e 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 _0x01e6=['update','removeListener','register','length','smsInteraction:','save','remove'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x01e6,0xe5));var _0x601e=function(_0x19b4c6,_0x573cf5){_0x19b4c6=_0x19b4c6-0x0;var _0x331b9c=_0x01e6[_0x19b4c6];return _0x331b9c;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x601e('0x0'),_0x601e('0x1'),_0x601e('0x2')];function createListener(_0x3ce3ae,_0x44ff09){return function(_0x4d2502){_0x44ff09['emit'](_0x3ce3ae,_0x4d2502);};}function removeListener(_0x351f4a,_0x32c01e){return function(){SmsInteractionEvents[_0x601e('0x3')](_0x351f4a,_0x32c01e);};}exports[_0x601e('0x4')]=function(_0x59868c){for(var _0x4a1a7a=0x0,_0x86cb29=events[_0x601e('0x5')];_0x4a1a7a<_0x86cb29;_0x4a1a7a++){var _0x3c10e8=events[_0x4a1a7a];var _0x1d53d7=createListener(_0x601e('0x6')+_0x3c10e8,_0x59868c);SmsInteractionEvents['on'](_0x3c10e8,_0x1d53d7);}}; \ No newline at end of file +var _0x1c13=['save','update','emit','removeListener','register','smsInteraction:','./smsInteraction.events'];(function(_0x2f71f6,_0x3a1f4d){var _0x2b23ea=function(_0x285980){while(--_0x285980){_0x2f71f6['push'](_0x2f71f6['shift']());}};_0x2b23ea(++_0x3a1f4d);}(_0x1c13,0x16b));var _0x31c1=function(_0x34b947,_0x2eab37){_0x34b947=_0x34b947-0x0;var _0x51e3ba=_0x1c13[_0x34b947];return _0x51e3ba;};'use strict';var SmsInteractionEvents=require(_0x31c1('0x0'));var events=[_0x31c1('0x1'),'remove',_0x31c1('0x2')];function createListener(_0xefa86b,_0x42a4ce){return function(_0x4fc333){_0x42a4ce[_0x31c1('0x3')](_0xefa86b,_0x4fc333);};}function removeListener(_0x33345d,_0x37bddf){return function(){SmsInteractionEvents[_0x31c1('0x4')](_0x33345d,_0x37bddf);};}exports[_0x31c1('0x5')]=function(_0x8daaae){for(var _0x5a31a3=0x0,_0x2e6372=events['length'];_0x5a31a3<_0x2e6372;_0x5a31a3++){var _0x4a8196=events[_0x5a31a3];var _0x29e4d0=createListener(_0x31c1('0x6')+_0x4a8196,_0x8daaae);SmsInteractionEvents['on'](_0x4a8196,_0x29e4d0);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index b7337a6..701fe1b 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 _0x78d5=['./smsMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','sms','smsmessage:create','create','update','put','/:id/accept','accept','reject','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x2125f0,_0x2f23b9){var _0x12d6eb=function(_0x7a43ea){while(--_0x7a43ea){_0x2125f0['push'](_0x2125f0['shift']());}};_0x12d6eb(++_0x2f23b9);}(_0x78d5,0x1a8));var _0x578d=function(_0xb84074,_0x2f764a){_0xb84074=_0xb84074-0x0;var _0x2144fb=_0x78d5[_0xb84074];return _0x2144fb;};'use strict';var multer=require(_0x578d('0x0'));var util=require(_0x578d('0x1'));var path=require(_0x578d('0x2'));var timeout=require(_0x578d('0x3'));var express=require(_0x578d('0x4'));var router=express['Router']();var fs_extra=require(_0x578d('0x5'));var auth=require(_0x578d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x578d('0x7'));var controller=require(_0x578d('0x8'));router[_0x578d('0x9')]('/',auth[_0x578d('0xa')](),controller[_0x578d('0xb')]);router[_0x578d('0x9')](_0x578d('0xc'),auth['isAuthenticated'](),controller[_0x578d('0xd')]);router[_0x578d('0x9')](_0x578d('0xe'),auth[_0x578d('0xa')](),controller[_0x578d('0xf')]);router[_0x578d('0x10')]('/',auth[_0x578d('0xa')](),interaction['tracked'](_0x578d('0x11'),_0x578d('0x12')),controller[_0x578d('0x13')]);router[_0x578d('0x10')]('/:id/status',controller['status']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x578d('0x14')]);router[_0x578d('0x15')](_0x578d('0x16'),auth['isAuthenticated'](),controller[_0x578d('0x17')]);router[_0x578d('0x15')]('/:id/reject',auth[_0x578d('0xa')](),controller[_0x578d('0x18')]);router['delete']('/:id',auth[_0x578d('0xa')](),controller[_0x578d('0x19')]);module[_0x578d('0x1a')]=router; \ No newline at end of file +var _0x4cb9=['../../components/interaction/service','./smsMessage.controller','get','isAuthenticated','index','/describe','describe','show','post','sms','smsmessage:create','/:id/status','status','put','update','/:id/accept','accept','/:id/reject','reject','delete','/:id','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x257e65,_0x3f4a68){var _0x3eef2f=function(_0x1c61e2){while(--_0x1c61e2){_0x257e65['push'](_0x257e65['shift']());}};_0x3eef2f(++_0x3f4a68);}(_0x4cb9,0x8f));var _0x94cb=function(_0x137154,_0xa22631){_0x137154=_0x137154-0x0;var _0x36bfbb=_0x4cb9[_0x137154];return _0x36bfbb;};'use strict';var multer=require('multer');var util=require(_0x94cb('0x0'));var path=require(_0x94cb('0x1'));var timeout=require(_0x94cb('0x2'));var express=require(_0x94cb('0x3'));var router=express[_0x94cb('0x4')]();var fs_extra=require(_0x94cb('0x5'));var auth=require(_0x94cb('0x6'));var interaction=require(_0x94cb('0x7'));var config=require('../../config/environment');var controller=require(_0x94cb('0x8'));router[_0x94cb('0x9')]('/',auth[_0x94cb('0xa')](),controller[_0x94cb('0xb')]);router[_0x94cb('0x9')](_0x94cb('0xc'),auth[_0x94cb('0xa')](),controller[_0x94cb('0xd')]);router[_0x94cb('0x9')]('/:id',auth[_0x94cb('0xa')](),controller[_0x94cb('0xe')]);router[_0x94cb('0xf')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x94cb('0x10'),_0x94cb('0x11')),controller['create']);router[_0x94cb('0xf')](_0x94cb('0x12'),controller[_0x94cb('0x13')]);router[_0x94cb('0x14')]('/:id',auth[_0x94cb('0xa')](),controller[_0x94cb('0x15')]);router['put'](_0x94cb('0x16'),auth[_0x94cb('0xa')](),controller[_0x94cb('0x17')]);router[_0x94cb('0x14')](_0x94cb('0x18'),auth['isAuthenticated'](),controller[_0x94cb('0x19')]);router[_0x94cb('0x1a')](_0x94cb('0x1b'),auth['isAuthenticated'](),controller[_0x94cb('0x1c')]);module[_0x94cb('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 fb460e8..f31d52b 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 _0xb97c=['ENUM','STRING','DATE','TEXT','medium','BOOLEAN'];(function(_0x5205a5,_0x2ec97a){var _0x523b9b=function(_0x2ec650){while(--_0x2ec650){_0x5205a5['push'](_0x5205a5['shift']());}};_0x523b9b(++_0x2ec97a);}(_0xb97c,0x19b));var _0xcb97=function(_0x7916eb,_0x52a196){_0x7916eb=_0x7916eb-0x0;var _0x479d0a=_0xb97c[_0x7916eb];return _0x479d0a;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xcb97('0x0')](_0xcb97('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xcb97('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xcb97('0x3')]('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xcb97('0x4')](0xbe)},'phone':{'type':Sequelize[_0xcb97('0x4')]},'readAt':{'type':Sequelize[_0xcb97('0x5')]},'secret':{'type':Sequelize[_0xcb97('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xcb97('0x4')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xcb57=['BOOLEAN','sequelize','exports','medium','ENUM','out','STRING','DATE'];(function(_0xe1c16c,_0xc762b0){var _0x13ed3b=function(_0x2bae9c){while(--_0x2bae9c){_0xe1c16c['push'](_0xe1c16c['shift']());}};_0x13ed3b(++_0xc762b0);}(_0xcb57,0xa1));var _0x7cb5=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xcb57[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require(_0x7cb5('0x0'));module[_0x7cb5('0x1')]={'body':{'type':Sequelize['TEXT'](_0x7cb5('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x7cb5('0x3')]('in','out'),'defaultValue':_0x7cb5('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x7cb5('0x5')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x7cb5('0x6')]},'secret':{'type':Sequelize[_0x7cb5('0x7')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x7cb5('0x5')]},'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 41153b7..70ddff2 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 _0x3dc2=['SELECT','User','internal','rejectmessage','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','messageId','plivo','MessageUUID','indexOf','delivered','SmsAccount,\x20%s,\x20%s,\x20%s','infobip','results','groupName','DELIVERED','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','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/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','apply','reject','save','then','destroy','end','stack','name','index','map','SmsMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','options','includeAll','include','findAll','rows','show','params','find','create','body','describe','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','SmsInteraction','SmsInteractionId','update','read1stAt','interaction','get','role','stringify','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','fullname','email','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','sms-interactions','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','Sequelize'];(function(_0x474c66,_0xbce925){var _0xcbd9bf=function(_0x44019d){while(--_0x44019d){_0x474c66['push'](_0x474c66['shift']());}};_0xcbd9bf(++_0xbce925);}(_0x3dc2,0xa9));var _0x23dc=function(_0x31838b,_0x3e4994){_0x31838b=_0x31838b-0x0;var _0x4e89b9=_0x3dc2[_0x31838b];return _0x4e89b9;};'use strict';var emlformat=require(_0x23dc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x23dc('0x1'));var jsonpatch=require(_0x23dc('0x2'));var rp=require(_0x23dc('0x3'));var moment=require(_0x23dc('0x4'));var BPromise=require(_0x23dc('0x5'));var Mustache=require(_0x23dc('0x6'));var util=require(_0x23dc('0x7'));var path=require(_0x23dc('0x8'));var sox=require('sox');var csv=require(_0x23dc('0x9'));var ejs=require(_0x23dc('0xa'));var fs=require('fs');var fs_extra=require(_0x23dc('0xb'));var _=require(_0x23dc('0xc'));var squel=require(_0x23dc('0xd'));var crypto=require(_0x23dc('0xe'));var jsforce=require(_0x23dc('0xf'));var deskjs=require(_0x23dc('0x10'));var toCsv=require(_0x23dc('0x9'));var querystring=require(_0x23dc('0x11'));var Papa=require(_0x23dc('0x12'));var Redis=require(_0x23dc('0x13'));var authService=require(_0x23dc('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x23dc('0x15'));var hardwareService=require(_0x23dc('0x16'));var logger=require(_0x23dc('0x17'))(_0x23dc('0x18'));var utils=require(_0x23dc('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x23dc('0x1a'));var db=require(_0x23dc('0x1b'))['db'];config[_0x23dc('0x1c')]=_[_0x23dc('0x1d')](config[_0x23dc('0x1c')],{'host':_0x23dc('0x1e'),'port':0x18eb});var socket=require(_0x23dc('0x1f'))(new Redis(config['redis']));require(_0x23dc('0x20'))[_0x23dc('0x21')](socket);var jayson=require(_0x23dc('0x22'));var client=jayson[_0x23dc('0x23')][_0x23dc('0x24')]({'port':0x232c});var client9002=jayson[_0x23dc('0x23')][_0x23dc('0x24')]({'port':0x232a});function respondWithRpcPromise(_0x1a6d7c,_0x2204e2,_0x500b91,_0x5794c8){return new BPromise(function(_0x495558,_0x40bbc4){var _0x5ab2ba=_0x5794c8||client;return _0x5ab2ba[_0x23dc('0x25')](_0x1a6d7c,_0x500b91)['then'](function(_0x1193f6){logger[_0x23dc('0x26')](_0x23dc('0x27'),_0x2204e2,_0x23dc('0x28'));logger[_0x23dc('0x29')](_0x23dc('0x2a'),_0x2204e2,'request\x20sent',JSON['stringify'](_0x1193f6));if(_0x1193f6['error']){if(_0x1193f6[_0x23dc('0x2b')][_0x23dc('0x2c')]===0x1f4){logger[_0x23dc('0x2b')](_0x23dc('0x27'),_0x2204e2,_0x1193f6[_0x23dc('0x2b')]['message']);return _0x40bbc4(_0x1193f6[_0x23dc('0x2b')][_0x23dc('0x2d')]);}logger[_0x23dc('0x2b')]('SmsMessage,\x20%s,\x20%s',_0x2204e2,_0x1193f6[_0x23dc('0x2b')]['message']);return _0x495558(_0x1193f6[_0x23dc('0x2b')]['message']);}else{logger[_0x23dc('0x26')]('SmsMessage,\x20%s,\x20%s',_0x2204e2,_0x23dc('0x28'));_0x495558(_0x1193f6[_0x23dc('0x2e')][_0x23dc('0x2d')]);}})[_0x23dc('0x2f')](function(_0x30412f){logger[_0x23dc('0x2b')](_0x23dc('0x27'),_0x2204e2,_0x30412f);_0x40bbc4(_0x30412f);});});}function respondWithStatusCode(_0x47c289,_0x517265){_0x517265=_0x517265||0xcc;return function(_0x39656f){if(_0x39656f){return _0x47c289[_0x23dc('0x30')](_0x517265);}return _0x47c289['status'](_0x517265)['end']();};}function respondWithResult(_0x29afa5,_0x10dc1c){_0x10dc1c=_0x10dc1c||0xc8;return function(_0x44c022){if(_0x44c022){return _0x29afa5[_0x23dc('0x31')](_0x10dc1c)[_0x23dc('0x32')](_0x44c022);}};}function respondWithFilteredResult(_0x33b442,_0xd0483d){return function(_0x2a5a18){if(_0x2a5a18){var _0x58f190=typeof _0xd0483d[_0x23dc('0x33')]===_0x23dc('0x34')&&typeof _0xd0483d[_0x23dc('0x35')]==='undefined';var _0xfcfccb=_0x2a5a18[_0x23dc('0x36')];var _0x16d990=_0x58f190?0x0:_0xd0483d[_0x23dc('0x33')];var _0x28ef40=_0x58f190?_0x2a5a18[_0x23dc('0x36')]:_0xd0483d[_0x23dc('0x33')]+_0xd0483d[_0x23dc('0x35')];var _0x84fd21;if(_0x28ef40>=_0xfcfccb){_0x28ef40=_0xfcfccb;_0x84fd21=0xc8;}else{_0x84fd21=0xce;}_0x33b442[_0x23dc('0x31')](_0x84fd21);return _0x33b442['set']('Content-Range',_0x16d990+'-'+_0x28ef40+'/'+_0xfcfccb)[_0x23dc('0x32')](_0x2a5a18);}return null;};}function patchUpdates(_0x30ac3e){return function(_0x57c039){try{jsonpatch[_0x23dc('0x37')](_0x57c039,_0x30ac3e,!![]);}catch(_0x468c4c){return BPromise[_0x23dc('0x38')](_0x468c4c);}return _0x57c039[_0x23dc('0x39')]();};}function saveUpdates(_0x4c706a,_0x39560c){return function(_0x4e1b45){if(_0x4e1b45){return _0x4e1b45['update'](_0x4c706a)[_0x23dc('0x3a')](function(_0x50390e){return _0x50390e;});}return null;};}function removeEntity(_0x3cb249,_0x3f3460){return function(_0x15356f){if(_0x15356f){return _0x15356f[_0x23dc('0x3b')]()[_0x23dc('0x3a')](function(){_0x3cb249[_0x23dc('0x31')](0xcc)[_0x23dc('0x3c')]();});}};}function handleEntityNotFound(_0x48557b,_0x3b9cec){return function(_0x2355c2){if(!_0x2355c2){_0x48557b['sendStatus'](0x194);}return _0x2355c2;};}function handleError(_0x268859,_0x7a8e35){_0x7a8e35=_0x7a8e35||0x1f4;return function(_0x4e0ad3){logger[_0x23dc('0x2b')](_0x4e0ad3[_0x23dc('0x3d')]);if(_0x4e0ad3[_0x23dc('0x3e')]){delete _0x4e0ad3[_0x23dc('0x3e')];}_0x268859[_0x23dc('0x31')](_0x7a8e35)['send'](_0x4e0ad3);};}exports[_0x23dc('0x3f')]=function(_0x2f989a,_0x29196d){var _0x45a776={},_0x137d2d={},_0xe71dc1={'count':0x0,'rows':[]};var _0xd12da0=_[_0x23dc('0x40')](db[_0x23dc('0x41')][_0x23dc('0x42')],function(_0xfea4bd){return{'name':_0xfea4bd[_0x23dc('0x43')],'type':_0xfea4bd[_0x23dc('0x44')][_0x23dc('0x45')]};});_0x137d2d[_0x23dc('0x46')]=_[_0x23dc('0x40')](_0xd12da0,_0x23dc('0x3e'));_0x137d2d[_0x23dc('0x47')]=_[_0x23dc('0x48')](_0x2f989a[_0x23dc('0x47')]);_0x137d2d[_0x23dc('0x49')]=_[_0x23dc('0x4a')](_0x137d2d[_0x23dc('0x46')],_0x137d2d[_0x23dc('0x47')]);_0x45a776[_0x23dc('0x4b')]=_[_0x23dc('0x4a')](_0x137d2d[_0x23dc('0x46')],qs[_0x23dc('0x4c')](_0x2f989a[_0x23dc('0x47')][_0x23dc('0x4c')]));_0x45a776[_0x23dc('0x4b')]=_0x45a776[_0x23dc('0x4b')][_0x23dc('0x4d')]?_0x45a776[_0x23dc('0x4b')]:_0x137d2d[_0x23dc('0x46')];if(!_0x2f989a[_0x23dc('0x47')][_0x23dc('0x4e')](_0x23dc('0x4f'))){_0x45a776[_0x23dc('0x35')]=qs[_0x23dc('0x35')](_0x2f989a[_0x23dc('0x47')][_0x23dc('0x35')]);_0x45a776[_0x23dc('0x33')]=qs['offset'](_0x2f989a[_0x23dc('0x47')]['offset']);}_0x45a776[_0x23dc('0x50')]=qs[_0x23dc('0x51')](_0x2f989a[_0x23dc('0x47')][_0x23dc('0x51')]);_0x45a776['where']=qs[_0x23dc('0x49')](_['pick'](_0x2f989a[_0x23dc('0x47')],_0x137d2d['filters']),_0xd12da0);if(_0x2f989a[_0x23dc('0x47')][_0x23dc('0x52')]){_0x45a776['where']=_[_0x23dc('0x53')](_0x45a776[_0x23dc('0x54')],{'$or':_[_0x23dc('0x40')](_0xd12da0,function(_0x4b442c){if(_0x4b442c[_0x23dc('0x44')]!=='VIRTUAL'){var _0x41983b={};_0x41983b[_0x4b442c[_0x23dc('0x3e')]]={'$like':'%'+_0x2f989a[_0x23dc('0x47')][_0x23dc('0x52')]+'%'};return _0x41983b;}})});}_0x45a776=_[_0x23dc('0x53')]({},_0x45a776,_0x2f989a[_0x23dc('0x55')]);var _0x16ab5b={'where':_0x45a776[_0x23dc('0x54')]};return db[_0x23dc('0x41')][_0x23dc('0x36')](_0x16ab5b)[_0x23dc('0x3a')](function(_0x14d44f){_0xe71dc1['count']=_0x14d44f;if(_0x2f989a[_0x23dc('0x47')][_0x23dc('0x56')]){_0x45a776[_0x23dc('0x57')]=[{'all':!![]}];}return db[_0x23dc('0x41')][_0x23dc('0x58')](_0x45a776);})['then'](function(_0x36eba0){_0xe71dc1[_0x23dc('0x59')]=_0x36eba0;return _0xe71dc1;})[_0x23dc('0x3a')](respondWithFilteredResult(_0x29196d,_0x45a776))[_0x23dc('0x2f')](handleError(_0x29196d,null));};exports[_0x23dc('0x5a')]=function(_0x39d95e,_0x5de56a){var _0x245dfa={'raw':!![],'where':{'id':_0x39d95e[_0x23dc('0x5b')]['id']}},_0x5c0ac8={};_0x5c0ac8['model']=_['keys'](db['SmsMessage'][_0x23dc('0x42')]);_0x5c0ac8[_0x23dc('0x47')]=_[_0x23dc('0x48')](_0x39d95e[_0x23dc('0x47')]);_0x5c0ac8[_0x23dc('0x49')]=_[_0x23dc('0x4a')](_0x5c0ac8[_0x23dc('0x46')],_0x5c0ac8['query']);_0x245dfa['attributes']=_[_0x23dc('0x4a')](_0x5c0ac8[_0x23dc('0x46')],qs[_0x23dc('0x4c')](_0x39d95e[_0x23dc('0x47')]['fields']));_0x245dfa[_0x23dc('0x4b')]=_0x245dfa['attributes'][_0x23dc('0x4d')]?_0x245dfa[_0x23dc('0x4b')]:_0x5c0ac8[_0x23dc('0x46')];if(_0x39d95e['query'][_0x23dc('0x56')]){_0x245dfa[_0x23dc('0x57')]=[{'all':!![]}];}_0x245dfa=_['merge']({},_0x245dfa,_0x39d95e[_0x23dc('0x55')]);return db[_0x23dc('0x41')][_0x23dc('0x5c')](_0x245dfa)[_0x23dc('0x3a')](handleEntityNotFound(_0x5de56a,null))[_0x23dc('0x3a')](respondWithResult(_0x5de56a,null))[_0x23dc('0x2f')](handleError(_0x5de56a,null));};exports['create']=function(_0x3ef751,_0x3fc6b4){return db[_0x23dc('0x41')][_0x23dc('0x5d')](_0x3ef751[_0x23dc('0x5e')],{})[_0x23dc('0x3a')](respondWithResult(_0x3fc6b4,0xc9))[_0x23dc('0x2f')](handleError(_0x3fc6b4,null));};exports['update']=function(_0x144f61,_0x29cd35){if(_0x144f61['body']['id']){delete _0x144f61[_0x23dc('0x5e')]['id'];}return db[_0x23dc('0x41')]['find']({'where':{'id':_0x144f61['params']['id']}})['then'](handleEntityNotFound(_0x29cd35,null))[_0x23dc('0x3a')](saveUpdates(_0x144f61[_0x23dc('0x5e')],null))['then'](respondWithResult(_0x29cd35,null))['catch'](handleError(_0x29cd35,null));};exports[_0x23dc('0x3b')]=function(_0x42d966,_0x2ac301){return db[_0x23dc('0x41')]['find']({'where':{'id':_0x42d966[_0x23dc('0x5b')]['id']}})[_0x23dc('0x3a')](handleEntityNotFound(_0x2ac301,null))[_0x23dc('0x3a')](removeEntity(_0x2ac301,null))[_0x23dc('0x2f')](handleError(_0x2ac301,null));};exports[_0x23dc('0x5f')]=function(_0x4a7d25,_0x14f159){return db[_0x23dc('0x41')]['describe']()['then'](respondWithResult(_0x14f159,null))['catch'](handleError(_0x14f159,null));};var interaction_log=require(_0x23dc('0x17'))('sms-interactions');exports['accept']=function(_0x3da80d,_0x340736,_0x20ece8){var _0x23da3a={'agent':{},'channel':_0x23dc('0x60')};if(_0x3da80d[_0x23dc('0x5e')]['id']){delete _0x3da80d[_0x23dc('0x5e')]['id'];}_0x3da80d['body'][_0x23dc('0x61')]=!![];_0x3da80d[_0x23dc('0x5e')][_0x23dc('0x62')]=moment()[_0x23dc('0x63')](_0x23dc('0x64'));_0x3da80d['body'][_0x23dc('0x65')]=_0x3da80d['body'][_0x23dc('0x65')]||_0x3da80d[_0x23dc('0x66')]['id'];_0x23da3a[_0x23dc('0x67')]['id']=_0x3da80d[_0x23dc('0x5e')][_0x23dc('0x65')];return db['SmsMessage'][_0x23dc('0x5c')]({'where':{'id':_0x3da80d[_0x23dc('0x5b')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x340736,null))[_0x23dc('0x3a')](saveUpdates(_0x3da80d[_0x23dc('0x5e')],null))['then'](function(_0x5deda0){if(_0x5deda0){_0x23da3a[_0x23dc('0x2d')]=_0x5deda0['get']({'plain':!![]});return db[_0x23dc('0x68')][_0x23dc('0x5c')]({'where':{'id':_0x5deda0[_0x23dc('0x69')]}});}return null;})[_0x23dc('0x3a')](handleEntityNotFound(_0x340736,null))[_0x23dc('0x3a')](function(_0x119462){if(_0x119462){return _0x119462[_0x23dc('0x6a')]({'UserId':_0x3da80d[_0x23dc('0x5e')][_0x23dc('0x65')],'read1stAt':_['isNil'](_0x119462[_0x23dc('0x6b')])?moment()[_0x23dc('0x63')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x3cc697){if(_0x3cc697){_0x23da3a[_0x23dc('0x6c')]=_0x3cc697[_0x23dc('0x6d')]({'plain':!![]});interaction_log[_0x23dc('0x26')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3da80d[_0x23dc('0x66')]['id'],_0x3da80d[_0x23dc('0x66')][_0x23dc('0x3e')],_0x3da80d['user'][_0x23dc('0x6e')],_0x23da3a[_0x23dc('0x6c')]['id'],_0x3da80d[_0x23dc('0x5e')]?JSON[_0x23dc('0x6f')](_0x3da80d['body']):'null');return respondWithRpcPromise('AcceptMessage',_0x23dc('0x70'),_0x23da3a);}return null;})[_0x23dc('0x3a')](function(_0x5776ce){var _0x252fdc=_0x23dc('0x71')+_0x5776ce[_0x23dc('0x2d')][_0x23dc('0x72')];return db[_0x23dc('0x73')][_0x23dc('0x47')](_0x252fdc,{'type':db['Sequelize'][_0x23dc('0x74')]['SELECT'],'raw':!![]})['then'](function(_0x3a8e90){return _0x3a8e90;});})[_0x23dc('0x3a')](function(_0x1517b5){if(_0x1517b5){_0x23da3a[_0x23dc('0x2d')]['contact']=_0x1517b5[0x0];if(!_0x3da80d[_0x23dc('0x5e')][_0x23dc('0x65')])return;return db['User'][_0x23dc('0x5c')]({'where':{'id':_0x3da80d[_0x23dc('0x5e')]['UserId'],'role':_0x23dc('0x67')},'attributes':['id',_0x23dc('0x3e'),_0x23dc('0x75'),_0x23dc('0x76'),'internal'],'raw':!![]});}return null;})[_0x23dc('0x3a')](function(_0x40d63a){if(!_0x40d63a)return null;_0x23da3a[_0x23dc('0x2d')][_0x23dc('0x67')]=_0x40d63a;return _0x23da3a;})['then'](function(_0x47328a){if(_0x47328a){if(_0x3da80d[_0x23dc('0x5e')]['manual']){_0x23da3a['message'][_0x23dc('0x77')]=util[_0x23dc('0x63')](_0x23dc('0x78'),_0x3da80d[_0x23dc('0x66')]['name']);_0x23da3a[_0x23dc('0x2d')][_0x23dc('0x79')]=_0x23da3a[_0x23dc('0x79')];_0x23da3a['message'][_0x23dc('0x7a')]=_0x23da3a['channel'];_0x23da3a['message'][_0x23dc('0x7b')]=_0x23dc('0x7c');return respondWithRpcPromise('EventManager',_0x23dc('0x7d'),{'event':_0x23dc('0x7e'),'message':_0x23da3a[_0x23dc('0x2d')]},client9002)[_0x23dc('0x3a')](function(){return _0x23da3a;});}return _0x23da3a;}return null;})[_0x23dc('0x3a')](respondWithResult(_0x340736,null))[_0x23dc('0x2f')](handleError(_0x340736,null));};var interaction_log=require('../../config/logger')(_0x23dc('0x7f'));exports[_0x23dc('0x38')]=function(_0x1bc4cc,_0x70c6db,_0x1be496){var _0x11d694={'agent':{},'channel':_0x23dc('0x60')};if(_0x1bc4cc['body']['id']){delete _0x1bc4cc[_0x23dc('0x5e')]['id'];}_0x1bc4cc['body']['UserId']=_0x1bc4cc[_0x23dc('0x5e')][_0x23dc('0x65')]||_0x1bc4cc[_0x23dc('0x66')]['id'];_0x11d694[_0x23dc('0x67')]['id']=_0x1bc4cc['body'][_0x23dc('0x65')];return db[_0x23dc('0x41')][_0x23dc('0x5c')]({'where':{'id':_0x1bc4cc[_0x23dc('0x5b')]['id'],'UserId':null}})[_0x23dc('0x3a')](handleEntityNotFound(_0x70c6db,null))[_0x23dc('0x3a')](function(_0x1dc2d0){if(_0x1dc2d0){_0x11d694[_0x23dc('0x2d')]=_0x1dc2d0[_0x23dc('0x6d')]({'plain':!![]});return db[_0x23dc('0x68')]['find']({'where':{'id':_0x1dc2d0[_0x23dc('0x69')]}});}return null;})['then'](handleEntityNotFound(_0x70c6db,null))['then'](function(_0x5c70c3){if(_0x5c70c3){_0x11d694[_0x23dc('0x6c')]=_0x5c70c3[_0x23dc('0x6d')]({'plain':!![]});interaction_log[_0x23dc('0x26')](_0x23dc('0x80'),_0x1bc4cc[_0x23dc('0x66')]['id'],_0x1bc4cc[_0x23dc('0x66')][_0x23dc('0x3e')],_0x1bc4cc[_0x23dc('0x66')][_0x23dc('0x6e')],_0x11d694[_0x23dc('0x6c')]['id'],_0x1bc4cc[_0x23dc('0x5e')]?JSON[_0x23dc('0x6f')](_0x1bc4cc['body']):_0x23dc('0x81'));return respondWithRpcPromise(_0x23dc('0x82'),_0x23dc('0x83'),_0x11d694);}return null;})['then'](function(_0x291925){var _0x10e139=_0x23dc('0x71')+_0x291925[_0x23dc('0x2d')]['ContactId'];return db[_0x23dc('0x73')][_0x23dc('0x47')](_0x10e139,{'type':db[_0x23dc('0x84')][_0x23dc('0x74')][_0x23dc('0x85')],'raw':!![]})['then'](function(_0xe8a630){return _0xe8a630;});})[_0x23dc('0x3a')](function(_0x4ceeea){if(_0x4ceeea){_0x11d694['message']['contact']=_0x4ceeea[0x0];if(!_0x1bc4cc['body'][_0x23dc('0x65')])return;return db[_0x23dc('0x86')][_0x23dc('0x5c')]({'where':{'id':_0x1bc4cc[_0x23dc('0x5e')]['UserId'],'role':_0x23dc('0x67')},'attributes':['id',_0x23dc('0x3e'),_0x23dc('0x75'),'email',_0x23dc('0x87')],'raw':!![]});}return null;})[_0x23dc('0x3a')](function(_0x3be364){if(!_0x3be364)return null;_0x11d694[_0x23dc('0x2d')]['agent']=_0x3be364;return _0x11d694;})['then'](function(_0x347853){if(_0x347853){_0x347853[_0x23dc('0x2d')][_0x23dc('0x77')]=util[_0x23dc('0x63')](_0x23dc('0x78'),_0x1bc4cc['user']['name']);_0x347853['message'][_0x23dc('0x79')]=_0x11d694[_0x23dc('0x79')];_0x347853['message']['motionChannel']=_0x11d694[_0x23dc('0x79')];_0x347853[_0x23dc('0x2d')][_0x23dc('0x7b')]=_0x23dc('0x38');respondWithRpcPromise(_0x23dc('0x7d'),_0x23dc('0x7d'),{'event':_0x23dc('0x88'),'message':_0x347853[_0x23dc('0x2d')]},client9002);return _0x11d694;}return null;})[_0x23dc('0x3a')](respondWithResult(_0x70c6db,null))['catch'](handleError(_0x70c6db,null));};exports[_0x23dc('0x31')]=function(_0x755b68,_0x1f0ea0,_0x428d25){if(_0x755b68[_0x23dc('0x5e')]['id']){delete _0x755b68['body']['id'];}var _0x3c05dd;return db[_0x23dc('0x41')][_0x23dc('0x5c')]({'where':{'id':_0x755b68[_0x23dc('0x5b')]['id']}})[_0x23dc('0x3a')](handleEntityNotFound(_0x1f0ea0,null))[_0x23dc('0x3a')](function(_0x164aa9){if(_0x164aa9){_0x3c05dd=_0x164aa9;return db['SmsAccount'][_0x23dc('0x5c')]({'where':{'id':_0x164aa9[_0x23dc('0x89')]}});}})[_0x23dc('0x3a')](handleEntityNotFound(_0x1f0ea0,null))[_0x23dc('0x3a')](function(_0x35eefb){if(_0x35eefb){logger[_0x23dc('0x29')]('SmsMessage,\x20%s,\x20%s,\x20%s','status',_0x23dc('0x8a'),_0x35eefb['type'],util[_0x23dc('0x8b')](_0x755b68['body'],{'showHidden':![],'depth':null}));switch(_0x35eefb['type']){case _0x23dc('0x8c'):if(_0x755b68[_0x23dc('0x5e')]['MessageSid']&&_0x755b68[_0x23dc('0x5e')]['MessageSid']===_0x3c05dd[_0x23dc('0x8d')]){return _0x3c05dd[_0x23dc('0x6a')]({'read':!![]});}else{logger[_0x23dc('0x2b')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x23dc('0x31'),_0x23dc('0x8c'),util['inspect'](_0x755b68[_0x23dc('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x23dc('0x8e'):if(_0x755b68[_0x23dc('0x5e')][_0x23dc('0x8f')]&&_0x755b68['body'][_0x23dc('0x8f')]===_0x3c05dd[_0x23dc('0x8d')]&&_[_0x23dc('0x90')](['sent',_0x23dc('0x91')],_0x755b68[_0x23dc('0x5e')]['Status'])>=0x0){return _0x3c05dd[_0x23dc('0x6a')]({'read':!![]});}else{logger[_0x23dc('0x2b')](_0x23dc('0x92'),_0x23dc('0x31'),'plivio',util[_0x23dc('0x8b')](_0x755b68[_0x23dc('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x23dc('0x93'):var _0x38cf4e=_0x755b68[_0x23dc('0x5e')][_0x23dc('0x94')][0x0];if(_0x38cf4e[_0x23dc('0x31')][_0x23dc('0x95')]===_0x23dc('0x96')){return _0x3c05dd[_0x23dc('0x6a')]({'read':!![]});}else{logger[_0x23dc('0x2b')](_0x23dc('0x92'),_0x23dc('0x31'),_0x23dc('0x93'),util['inspect'](_0x755b68['body'],{'showHidden':![],'depth':null}));}break;}return _0x3c05dd;}})[_0x23dc('0x3a')](respondWithResult(_0x1f0ea0,null))['catch'](handleError(_0x1f0ea0,null));}; \ No newline at end of file +var _0x3e9c=['info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','end','stack','name','send','index','SmsMessage','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','params','find','create','body','describe','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','isNil','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','SIP/%s','channel','event','EventManager','sms-interactions','sms','SmsInteractionId','role','RejectMessage','rejectMessage','sequelize','interface','motionChannel','rejectmessage','SmsAccountId','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','MessageUUID','indexOf','sent','delivered','infobip','groupName','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./smsMessage.socket','register','client','http','request','then'];(function(_0x395ed6,_0x1d1d79){var _0x3bc1ea=function(_0x1cb766){while(--_0x1cb766){_0x395ed6['push'](_0x395ed6['shift']());}};_0x3bc1ea(++_0x1d1d79);}(_0x3e9c,0x6f));var _0xc3e9=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3e9c[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xc3e9('0x0'));var rimraf=require(_0xc3e9('0x1'));var zipdir=require(_0xc3e9('0x2'));var jsonpatch=require(_0xc3e9('0x3'));var rp=require(_0xc3e9('0x4'));var moment=require(_0xc3e9('0x5'));var BPromise=require(_0xc3e9('0x6'));var Mustache=require(_0xc3e9('0x7'));var util=require(_0xc3e9('0x8'));var path=require(_0xc3e9('0x9'));var sox=require(_0xc3e9('0xa'));var csv=require(_0xc3e9('0xb'));var ejs=require(_0xc3e9('0xc'));var fs=require('fs');var fs_extra=require(_0xc3e9('0xd'));var _=require(_0xc3e9('0xe'));var squel=require(_0xc3e9('0xf'));var crypto=require(_0xc3e9('0x10'));var jsforce=require(_0xc3e9('0x11'));var deskjs=require('desk.js');var toCsv=require(_0xc3e9('0xb'));var querystring=require(_0xc3e9('0x12'));var Papa=require(_0xc3e9('0x13'));var Redis=require(_0xc3e9('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xc3e9('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc3e9('0x16'));var logger=require(_0xc3e9('0x17'))(_0xc3e9('0x18'));var utils=require(_0xc3e9('0x19'));var config=require(_0xc3e9('0x1a'));var licenseUtil=require(_0xc3e9('0x1b'));var db=require(_0xc3e9('0x1c'))['db'];config[_0xc3e9('0x1d')]=_['defaults'](config[_0xc3e9('0x1d')],{'host':'localhost','port':0x18eb});var socket=require(_0xc3e9('0x1e'))(new Redis(config['redis']));require(_0xc3e9('0x1f'))[_0xc3e9('0x20')](socket);var jayson=require('jayson/promise');var client=jayson[_0xc3e9('0x21')][_0xc3e9('0x22')]({'port':0x232c});var client9002=jayson[_0xc3e9('0x21')][_0xc3e9('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x5559d5,_0x36ecf4,_0x574e77,_0x466e9a){return new BPromise(function(_0x52fea5,_0x2c1e22){var _0x2433b7=_0x466e9a||client;return _0x2433b7[_0xc3e9('0x23')](_0x5559d5,_0x574e77)[_0xc3e9('0x24')](function(_0x117fb2){logger[_0xc3e9('0x25')](_0xc3e9('0x26'),_0x36ecf4,_0xc3e9('0x27'));logger[_0xc3e9('0x28')](_0xc3e9('0x29'),_0x36ecf4,_0xc3e9('0x27'),JSON[_0xc3e9('0x2a')](_0x117fb2));if(_0x117fb2[_0xc3e9('0x2b')]){if(_0x117fb2[_0xc3e9('0x2b')]['code']===0x1f4){logger[_0xc3e9('0x2b')](_0xc3e9('0x26'),_0x36ecf4,_0x117fb2['error'][_0xc3e9('0x2c')]);return _0x2c1e22(_0x117fb2[_0xc3e9('0x2b')][_0xc3e9('0x2c')]);}logger[_0xc3e9('0x2b')](_0xc3e9('0x26'),_0x36ecf4,_0x117fb2[_0xc3e9('0x2b')][_0xc3e9('0x2c')]);return _0x52fea5(_0x117fb2[_0xc3e9('0x2b')][_0xc3e9('0x2c')]);}else{logger['info'](_0xc3e9('0x26'),_0x36ecf4,_0xc3e9('0x27'));_0x52fea5(_0x117fb2['result']['message']);}})[_0xc3e9('0x2d')](function(_0x501f97){logger[_0xc3e9('0x2b')](_0xc3e9('0x26'),_0x36ecf4,_0x501f97);_0x2c1e22(_0x501f97);});});}function respondWithStatusCode(_0x390263,_0x5c16c4){_0x5c16c4=_0x5c16c4||0xcc;return function(_0x1baa93){if(_0x1baa93){return _0x390263[_0xc3e9('0x2e')](_0x5c16c4);}return _0x390263['status'](_0x5c16c4)['end']();};}function respondWithResult(_0x3e10b6,_0x477613){_0x477613=_0x477613||0xc8;return function(_0x5a371f){if(_0x5a371f){return _0x3e10b6[_0xc3e9('0x2f')](_0x477613)[_0xc3e9('0x30')](_0x5a371f);}};}function respondWithFilteredResult(_0x460d6d,_0x1040c9){return function(_0x376128){if(_0x376128){var _0x3f4378=typeof _0x1040c9['offset']===_0xc3e9('0x31')&&typeof _0x1040c9[_0xc3e9('0x32')]==='undefined';var _0x245d90=_0x376128[_0xc3e9('0x33')];var _0x3f44c5=_0x3f4378?0x0:_0x1040c9[_0xc3e9('0x34')];var _0x55b90c=_0x3f4378?_0x376128[_0xc3e9('0x33')]:_0x1040c9[_0xc3e9('0x34')]+_0x1040c9[_0xc3e9('0x32')];var _0x2451b4;if(_0x55b90c>=_0x245d90){_0x55b90c=_0x245d90;_0x2451b4=0xc8;}else{_0x2451b4=0xce;}_0x460d6d[_0xc3e9('0x2f')](_0x2451b4);return _0x460d6d[_0xc3e9('0x35')](_0xc3e9('0x36'),_0x3f44c5+'-'+_0x55b90c+'/'+_0x245d90)[_0xc3e9('0x30')](_0x376128);}return null;};}function patchUpdates(_0x471d27){return function(_0x150977){try{jsonpatch[_0xc3e9('0x37')](_0x150977,_0x471d27,!![]);}catch(_0x46b317){return BPromise[_0xc3e9('0x38')](_0x46b317);}return _0x150977[_0xc3e9('0x39')]();};}function saveUpdates(_0x240e59,_0x3216ca){return function(_0x1dc9ba){if(_0x1dc9ba){return _0x1dc9ba[_0xc3e9('0x3a')](_0x240e59)[_0xc3e9('0x24')](function(_0x5e119a){return _0x5e119a;});}return null;};}function removeEntity(_0x4f1076,_0x4c676d){return function(_0x4c92dd){if(_0x4c92dd){return _0x4c92dd[_0xc3e9('0x3b')]()[_0xc3e9('0x24')](function(){_0x4f1076[_0xc3e9('0x2f')](0xcc)[_0xc3e9('0x3c')]();});}};}function handleEntityNotFound(_0x296b2e,_0x2b7653){return function(_0x18a13d){if(!_0x18a13d){_0x296b2e['sendStatus'](0x194);}return _0x18a13d;};}function handleError(_0x1733fb,_0x297668){_0x297668=_0x297668||0x1f4;return function(_0x5d00e9){logger[_0xc3e9('0x2b')](_0x5d00e9[_0xc3e9('0x3d')]);if(_0x5d00e9['name']){delete _0x5d00e9[_0xc3e9('0x3e')];}_0x1733fb[_0xc3e9('0x2f')](_0x297668)[_0xc3e9('0x3f')](_0x5d00e9);};}exports[_0xc3e9('0x40')]=function(_0x3a00c9,_0x408ee3){var _0x4692b9={},_0x1ffc79={},_0x2e805b={'count':0x0,'rows':[]};var _0x1f7cbd=_['map'](db[_0xc3e9('0x41')][_0xc3e9('0x42')],function(_0xa4208e){return{'name':_0xa4208e[_0xc3e9('0x43')],'type':_0xa4208e[_0xc3e9('0x44')][_0xc3e9('0x45')]};});_0x1ffc79[_0xc3e9('0x46')]=_[_0xc3e9('0x47')](_0x1f7cbd,'name');_0x1ffc79['query']=_[_0xc3e9('0x48')](_0x3a00c9[_0xc3e9('0x49')]);_0x1ffc79[_0xc3e9('0x4a')]=_[_0xc3e9('0x4b')](_0x1ffc79[_0xc3e9('0x46')],_0x1ffc79[_0xc3e9('0x49')]);_0x4692b9['attributes']=_[_0xc3e9('0x4b')](_0x1ffc79[_0xc3e9('0x46')],qs['fields'](_0x3a00c9[_0xc3e9('0x49')][_0xc3e9('0x4c')]));_0x4692b9['attributes']=_0x4692b9[_0xc3e9('0x4d')][_0xc3e9('0x4e')]?_0x4692b9[_0xc3e9('0x4d')]:_0x1ffc79['model'];if(!_0x3a00c9['query']['hasOwnProperty'](_0xc3e9('0x4f'))){_0x4692b9[_0xc3e9('0x32')]=qs[_0xc3e9('0x32')](_0x3a00c9[_0xc3e9('0x49')][_0xc3e9('0x32')]);_0x4692b9[_0xc3e9('0x34')]=qs['offset'](_0x3a00c9[_0xc3e9('0x49')][_0xc3e9('0x34')]);}_0x4692b9['order']=qs['sort'](_0x3a00c9[_0xc3e9('0x49')][_0xc3e9('0x50')]);_0x4692b9['where']=qs[_0xc3e9('0x4a')](_[_0xc3e9('0x51')](_0x3a00c9['query'],_0x1ffc79[_0xc3e9('0x4a')]),_0x1f7cbd);if(_0x3a00c9[_0xc3e9('0x49')][_0xc3e9('0x52')]){_0x4692b9[_0xc3e9('0x53')]=_[_0xc3e9('0x54')](_0x4692b9[_0xc3e9('0x53')],{'$or':_[_0xc3e9('0x47')](_0x1f7cbd,function(_0x85b3cd){if(_0x85b3cd[_0xc3e9('0x44')]!==_0xc3e9('0x55')){var _0x54ac7a={};_0x54ac7a[_0x85b3cd[_0xc3e9('0x3e')]]={'$like':'%'+_0x3a00c9['query'][_0xc3e9('0x52')]+'%'};return _0x54ac7a;}})});}_0x4692b9=_['merge']({},_0x4692b9,_0x3a00c9[_0xc3e9('0x56')]);var _0x2865bb={'where':_0x4692b9[_0xc3e9('0x53')]};return db['SmsMessage'][_0xc3e9('0x33')](_0x2865bb)['then'](function(_0x32a4c6){_0x2e805b[_0xc3e9('0x33')]=_0x32a4c6;if(_0x3a00c9[_0xc3e9('0x49')][_0xc3e9('0x57')]){_0x4692b9[_0xc3e9('0x58')]=[{'all':!![]}];}return db['SmsMessage'][_0xc3e9('0x59')](_0x4692b9);})[_0xc3e9('0x24')](function(_0x1fdccd){_0x2e805b['rows']=_0x1fdccd;return _0x2e805b;})[_0xc3e9('0x24')](respondWithFilteredResult(_0x408ee3,_0x4692b9))[_0xc3e9('0x2d')](handleError(_0x408ee3,null));};exports['show']=function(_0x2a9e50,_0x1aac21){var _0x29045c={'raw':!![],'where':{'id':_0x2a9e50[_0xc3e9('0x5a')]['id']}},_0x3738d5={};_0x3738d5['model']=_['keys'](db[_0xc3e9('0x41')][_0xc3e9('0x42')]);_0x3738d5['query']=_['keys'](_0x2a9e50[_0xc3e9('0x49')]);_0x3738d5[_0xc3e9('0x4a')]=_[_0xc3e9('0x4b')](_0x3738d5[_0xc3e9('0x46')],_0x3738d5[_0xc3e9('0x49')]);_0x29045c[_0xc3e9('0x4d')]=_['intersection'](_0x3738d5[_0xc3e9('0x46')],qs[_0xc3e9('0x4c')](_0x2a9e50[_0xc3e9('0x49')][_0xc3e9('0x4c')]));_0x29045c[_0xc3e9('0x4d')]=_0x29045c[_0xc3e9('0x4d')][_0xc3e9('0x4e')]?_0x29045c[_0xc3e9('0x4d')]:_0x3738d5['model'];if(_0x2a9e50[_0xc3e9('0x49')]['includeAll']){_0x29045c['include']=[{'all':!![]}];}_0x29045c=_['merge']({},_0x29045c,_0x2a9e50[_0xc3e9('0x56')]);return db[_0xc3e9('0x41')][_0xc3e9('0x5b')](_0x29045c)[_0xc3e9('0x24')](handleEntityNotFound(_0x1aac21,null))['then'](respondWithResult(_0x1aac21,null))['catch'](handleError(_0x1aac21,null));};exports['create']=function(_0x410b98,_0x4add01){return db[_0xc3e9('0x41')][_0xc3e9('0x5c')](_0x410b98[_0xc3e9('0x5d')],{})[_0xc3e9('0x24')](respondWithResult(_0x4add01,0xc9))['catch'](handleError(_0x4add01,null));};exports['update']=function(_0x3f8dc5,_0x77ce6e){if(_0x3f8dc5[_0xc3e9('0x5d')]['id']){delete _0x3f8dc5['body']['id'];}return db[_0xc3e9('0x41')][_0xc3e9('0x5b')]({'where':{'id':_0x3f8dc5[_0xc3e9('0x5a')]['id']}})['then'](handleEntityNotFound(_0x77ce6e,null))[_0xc3e9('0x24')](saveUpdates(_0x3f8dc5[_0xc3e9('0x5d')],null))[_0xc3e9('0x24')](respondWithResult(_0x77ce6e,null))[_0xc3e9('0x2d')](handleError(_0x77ce6e,null));};exports[_0xc3e9('0x3b')]=function(_0xfd947e,_0x13b977){return db[_0xc3e9('0x41')]['find']({'where':{'id':_0xfd947e[_0xc3e9('0x5a')]['id']}})[_0xc3e9('0x24')](handleEntityNotFound(_0x13b977,null))['then'](removeEntity(_0x13b977,null))[_0xc3e9('0x2d')](handleError(_0x13b977,null));};exports[_0xc3e9('0x5e')]=function(_0xa2113a,_0x390f8a){return db[_0xc3e9('0x41')]['describe']()[_0xc3e9('0x24')](respondWithResult(_0x390f8a,null))[_0xc3e9('0x2d')](handleError(_0x390f8a,null));};var interaction_log=require(_0xc3e9('0x17'))('sms-interactions');exports[_0xc3e9('0x5f')]=function(_0x234256,_0x2bff07,_0x351cce){var _0x1f0c4a={'agent':{},'channel':'sms'};if(_0x234256[_0xc3e9('0x5d')]['id']){delete _0x234256['body']['id'];}_0x234256[_0xc3e9('0x5d')][_0xc3e9('0x60')]=!![];_0x234256[_0xc3e9('0x5d')][_0xc3e9('0x61')]=moment()[_0xc3e9('0x62')](_0xc3e9('0x63'));_0x234256['body'][_0xc3e9('0x64')]=_0x234256[_0xc3e9('0x5d')][_0xc3e9('0x64')]||_0x234256[_0xc3e9('0x65')]['id'];_0x1f0c4a[_0xc3e9('0x66')]['id']=_0x234256['body']['UserId'];return db[_0xc3e9('0x41')][_0xc3e9('0x5b')]({'where':{'id':_0x234256['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2bff07,null))[_0xc3e9('0x24')](saveUpdates(_0x234256[_0xc3e9('0x5d')],null))[_0xc3e9('0x24')](function(_0x54b1db){if(_0x54b1db){_0x1f0c4a[_0xc3e9('0x2c')]=_0x54b1db[_0xc3e9('0x67')]({'plain':!![]});return db[_0xc3e9('0x68')][_0xc3e9('0x5b')]({'where':{'id':_0x54b1db['SmsInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x2bff07,null))[_0xc3e9('0x24')](function(_0x570534){if(_0x570534){return _0x570534[_0xc3e9('0x3a')]({'UserId':_0x234256['body']['UserId'],'read1stAt':_[_0xc3e9('0x69')](_0x570534['read1stAt'])?moment()[_0xc3e9('0x62')](_0xc3e9('0x63')):undefined});}return null;})[_0xc3e9('0x24')](function(_0x139b90){if(_0x139b90){_0x1f0c4a['interaction']=_0x139b90['get']({'plain':!![]});interaction_log[_0xc3e9('0x25')](_0xc3e9('0x6a'),_0x234256[_0xc3e9('0x65')]['id'],_0x234256['user'][_0xc3e9('0x3e')],_0x234256[_0xc3e9('0x65')]['role'],_0x1f0c4a[_0xc3e9('0x6b')]['id'],_0x234256['body']?JSON[_0xc3e9('0x2a')](_0x234256['body']):_0xc3e9('0x6c'));return respondWithRpcPromise(_0xc3e9('0x6d'),_0xc3e9('0x6e'),_0x1f0c4a);}return null;})[_0xc3e9('0x24')](function(_0x3614d7){var _0x54c5c9=_0xc3e9('0x6f')+_0x3614d7[_0xc3e9('0x2c')][_0xc3e9('0x70')];return db['sequelize'][_0xc3e9('0x49')](_0x54c5c9,{'type':db[_0xc3e9('0x71')][_0xc3e9('0x72')][_0xc3e9('0x73')],'raw':!![]})[_0xc3e9('0x24')](function(_0x157d67){return _0x157d67;});})['then'](function(_0x582df1){if(_0x582df1){_0x1f0c4a[_0xc3e9('0x2c')][_0xc3e9('0x74')]=_0x582df1[0x0];if(!_0x234256[_0xc3e9('0x5d')]['UserId'])return;return db[_0xc3e9('0x75')]['find']({'where':{'id':_0x234256[_0xc3e9('0x5d')]['UserId'],'role':_0xc3e9('0x66')},'attributes':['id','name',_0xc3e9('0x76'),_0xc3e9('0x77'),'internal'],'raw':!![]});}return null;})[_0xc3e9('0x24')](function(_0x209b1b){if(!_0x209b1b)return null;_0x1f0c4a[_0xc3e9('0x2c')][_0xc3e9('0x66')]=_0x209b1b;return _0x1f0c4a;})[_0xc3e9('0x24')](function(_0x2e8bd3){if(_0x2e8bd3){if(_0x234256[_0xc3e9('0x5d')]['manual']){_0x1f0c4a['message']['interface']=util[_0xc3e9('0x62')](_0xc3e9('0x78'),_0x234256[_0xc3e9('0x65')][_0xc3e9('0x3e')]);_0x1f0c4a[_0xc3e9('0x2c')][_0xc3e9('0x79')]=_0x1f0c4a['channel'];_0x1f0c4a['message']['motionChannel']=_0x1f0c4a['channel'];_0x1f0c4a[_0xc3e9('0x2c')][_0xc3e9('0x7a')]=_0xc3e9('0x5f');return respondWithRpcPromise(_0xc3e9('0x7b'),_0xc3e9('0x7b'),{'event':'acceptmessage','message':_0x1f0c4a[_0xc3e9('0x2c')]},client9002)[_0xc3e9('0x24')](function(){return _0x1f0c4a;});}return _0x1f0c4a;}return null;})[_0xc3e9('0x24')](respondWithResult(_0x2bff07,null))[_0xc3e9('0x2d')](handleError(_0x2bff07,null));};var interaction_log=require(_0xc3e9('0x17'))(_0xc3e9('0x7c'));exports[_0xc3e9('0x38')]=function(_0x28acee,_0x23eff8,_0x47cd89){var _0x2ffea2={'agent':{},'channel':_0xc3e9('0x7d')};if(_0x28acee[_0xc3e9('0x5d')]['id']){delete _0x28acee[_0xc3e9('0x5d')]['id'];}_0x28acee[_0xc3e9('0x5d')][_0xc3e9('0x64')]=_0x28acee[_0xc3e9('0x5d')][_0xc3e9('0x64')]||_0x28acee[_0xc3e9('0x65')]['id'];_0x2ffea2[_0xc3e9('0x66')]['id']=_0x28acee['body']['UserId'];return db[_0xc3e9('0x41')]['find']({'where':{'id':_0x28acee[_0xc3e9('0x5a')]['id'],'UserId':null}})[_0xc3e9('0x24')](handleEntityNotFound(_0x23eff8,null))[_0xc3e9('0x24')](function(_0xbb4603){if(_0xbb4603){_0x2ffea2['message']=_0xbb4603[_0xc3e9('0x67')]({'plain':!![]});return db[_0xc3e9('0x68')][_0xc3e9('0x5b')]({'where':{'id':_0xbb4603[_0xc3e9('0x7e')]}});}return null;})[_0xc3e9('0x24')](handleEntityNotFound(_0x23eff8,null))['then'](function(_0x14efa7){if(_0x14efa7){_0x2ffea2[_0xc3e9('0x6b')]=_0x14efa7[_0xc3e9('0x67')]({'plain':!![]});interaction_log[_0xc3e9('0x25')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x28acee['user']['id'],_0x28acee[_0xc3e9('0x65')][_0xc3e9('0x3e')],_0x28acee[_0xc3e9('0x65')][_0xc3e9('0x7f')],_0x2ffea2[_0xc3e9('0x6b')]['id'],_0x28acee[_0xc3e9('0x5d')]?JSON[_0xc3e9('0x2a')](_0x28acee[_0xc3e9('0x5d')]):_0xc3e9('0x6c'));return respondWithRpcPromise(_0xc3e9('0x80'),_0xc3e9('0x81'),_0x2ffea2);}return null;})[_0xc3e9('0x24')](function(_0x4b21ab){var _0x479cd6=_0xc3e9('0x6f')+_0x4b21ab['message'][_0xc3e9('0x70')];return db[_0xc3e9('0x82')][_0xc3e9('0x49')](_0x479cd6,{'type':db[_0xc3e9('0x71')][_0xc3e9('0x72')][_0xc3e9('0x73')],'raw':!![]})[_0xc3e9('0x24')](function(_0x42276a){return _0x42276a;});})['then'](function(_0x48a0e6){if(_0x48a0e6){_0x2ffea2[_0xc3e9('0x2c')][_0xc3e9('0x74')]=_0x48a0e6[0x0];if(!_0x28acee[_0xc3e9('0x5d')][_0xc3e9('0x64')])return;return db['User'][_0xc3e9('0x5b')]({'where':{'id':_0x28acee[_0xc3e9('0x5d')][_0xc3e9('0x64')],'role':_0xc3e9('0x66')},'attributes':['id',_0xc3e9('0x3e'),_0xc3e9('0x76'),'email','internal'],'raw':!![]});}return null;})[_0xc3e9('0x24')](function(_0x587fdb){if(!_0x587fdb)return null;_0x2ffea2[_0xc3e9('0x2c')]['agent']=_0x587fdb;return _0x2ffea2;})[_0xc3e9('0x24')](function(_0x359f26){if(_0x359f26){_0x359f26[_0xc3e9('0x2c')][_0xc3e9('0x83')]=util[_0xc3e9('0x62')](_0xc3e9('0x78'),_0x28acee[_0xc3e9('0x65')][_0xc3e9('0x3e')]);_0x359f26[_0xc3e9('0x2c')]['channel']=_0x2ffea2['channel'];_0x359f26[_0xc3e9('0x2c')][_0xc3e9('0x84')]=_0x2ffea2['channel'];_0x359f26['message'][_0xc3e9('0x7a')]=_0xc3e9('0x38');respondWithRpcPromise('EventManager','EventManager',{'event':_0xc3e9('0x85'),'message':_0x359f26['message']},client9002);return _0x2ffea2;}return null;})[_0xc3e9('0x24')](respondWithResult(_0x23eff8,null))[_0xc3e9('0x2d')](handleError(_0x23eff8,null));};exports[_0xc3e9('0x2f')]=function(_0x49c96c,_0x5df3b0,_0x4a29d5){if(_0x49c96c[_0xc3e9('0x5d')]['id']){delete _0x49c96c[_0xc3e9('0x5d')]['id'];}var _0x2fa1a7;return db[_0xc3e9('0x41')][_0xc3e9('0x5b')]({'where':{'id':_0x49c96c[_0xc3e9('0x5a')]['id']}})[_0xc3e9('0x24')](handleEntityNotFound(_0x5df3b0,null))[_0xc3e9('0x24')](function(_0x52501e){if(_0x52501e){_0x2fa1a7=_0x52501e;return db['SmsAccount'][_0xc3e9('0x5b')]({'where':{'id':_0x52501e[_0xc3e9('0x86')]}});}})[_0xc3e9('0x24')](handleEntityNotFound(_0x5df3b0,null))[_0xc3e9('0x24')](function(_0x1bc955){if(_0x1bc955){logger['debug'](_0xc3e9('0x29'),_0xc3e9('0x2f'),_0xc3e9('0x87'),_0x1bc955['type'],util['inspect'](_0x49c96c[_0xc3e9('0x5d')],{'showHidden':![],'depth':null}));switch(_0x1bc955[_0xc3e9('0x44')]){case _0xc3e9('0x88'):if(_0x49c96c[_0xc3e9('0x5d')][_0xc3e9('0x89')]&&_0x49c96c['body']['MessageSid']===_0x2fa1a7[_0xc3e9('0x8a')]){return _0x2fa1a7[_0xc3e9('0x3a')]({'read':!![]});}else{logger[_0xc3e9('0x2b')](_0xc3e9('0x8b'),'status',_0xc3e9('0x88'),util[_0xc3e9('0x8c')](_0x49c96c['body'],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x49c96c[_0xc3e9('0x5d')][_0xc3e9('0x8d')]&&_0x49c96c[_0xc3e9('0x5d')]['MessageUUID']===_0x2fa1a7[_0xc3e9('0x8a')]&&_[_0xc3e9('0x8e')]([_0xc3e9('0x8f'),_0xc3e9('0x90')],_0x49c96c[_0xc3e9('0x5d')]['Status'])>=0x0){return _0x2fa1a7['update']({'read':!![]});}else{logger['error'](_0xc3e9('0x8b'),'status','plivio',util[_0xc3e9('0x8c')](_0x49c96c[_0xc3e9('0x5d')],{'showHidden':![],'depth':null}));}break;case _0xc3e9('0x91'):var _0x553717=_0x49c96c[_0xc3e9('0x5d')]['results'][0x0];if(_0x553717[_0xc3e9('0x2f')][_0xc3e9('0x92')]===_0xc3e9('0x93')){return _0x2fa1a7[_0xc3e9('0x3a')]({'read':!![]});}else{logger[_0xc3e9('0x2b')](_0xc3e9('0x8b'),_0xc3e9('0x2f'),_0xc3e9('0x91'),util[_0xc3e9('0x8c')](_0x49c96c[_0xc3e9('0x5d')],{'showHidden':![],'depth':null}));}break;}return _0x2fa1a7;}})[_0xc3e9('0x24')](respondWithResult(_0x5df3b0,null))[_0xc3e9('0x2d')](handleError(_0x5df3b0,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 0e4344f..971dbb5 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 _0xb86f=['save','emit','exports','events','../../mysqldb','SmsMessage','setMaxListeners'];(function(_0x26060c,_0x54f8a3){var _0x47eb2b=function(_0x2236ff){while(--_0x2236ff){_0x26060c['push'](_0x26060c['shift']());}};_0x47eb2b(++_0x54f8a3);}(_0xb86f,0x17d));var _0xfb86=function(_0x57368d,_0x3ad214){_0x57368d=_0x57368d-0x0;var _0x705d5b=_0xb86f[_0x57368d];return _0x705d5b;};'use strict';var EventEmitter=require(_0xfb86('0x0'));var SmsMessage=require(_0xfb86('0x1'))['db'][_0xfb86('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xfb86('0x3')](0x0);var events={'afterCreate':_0xfb86('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x193994){return function(_0x221e19,_0x57d6be,_0x14cecc){SmsMessageEvents[_0xfb86('0x5')](_0x193994+':'+_0x221e19['id'],_0x221e19);SmsMessageEvents['emit'](_0x193994,_0x221e19);_0x14cecc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0xfb86('0x6')]=SmsMessageEvents; \ No newline at end of file +var _0xd8ba=['hook','events','../../mysqldb','SmsMessage','update','remove','emit'];(function(_0x436a1c,_0x9ec573){var _0x12e46e=function(_0x705897){while(--_0x705897){_0x436a1c['push'](_0x436a1c['shift']());}};_0x12e46e(++_0x9ec573);}(_0xd8ba,0x104));var _0xad8b=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xd8ba[_0x57b54c];return _0x59cc19;};'use strict';var EventEmitter=require(_0xad8b('0x0'));var SmsMessage=require(_0xad8b('0x1'))['db'][_0xad8b('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xad8b('0x3'),'afterDestroy':_0xad8b('0x4')};function emitEvent(_0x22b3c0){return function(_0x185f6b,_0x1c5063,_0x199d32){SmsMessageEvents[_0xad8b('0x5')](_0x22b3c0+':'+_0x185f6b['id'],_0x185f6b);SmsMessageEvents[_0xad8b('0x5')](_0x22b3c0,_0x185f6b);_0x199d32(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0xad8b('0x6')](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 9f65435..31a6457 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 _0x88cd=['message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','refid','status','Token\x20not\x20received','finally','utf8mb4','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','SmsInteractionId','SmsInteraction','findOne','update','catch','error','SmsAccount','find','type','twilio','accountSid','authToken','phone','messages','create','remote','/status?token=','token','then','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','smsMethod','sender','login?username=','&password=','GET','split','POST','user_key','session_key','total_sent','read','Missing\x20parameters:\x20username,\x20password','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','deliveryReport','connectel','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','password','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','http_code','data','head','clickSend','plivo','authId','/api/sms/messages/','https://api.plivo.com/v1/Account/%s/Message/','toString','base64','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','application/json','Missing\x20parameters:\x20base_url','csc','crypto','text','timestamp','keys','sort','createHash','hex','signature=','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','apiKey','https://platform.clickatell.com/messages','UTF-8','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send'];(function(_0x44de47,_0x31bb85){var _0x4571d4=function(_0x1fa9ad){while(--_0x1fa9ad){_0x44de47['push'](_0x44de47['shift']());}};_0x4571d4(++_0x31bb85);}(_0x88cd,0x83));var _0xd88c=function(_0x3dec26,_0x3faecc){_0x3dec26=_0x3dec26-0x0;var _0x5a0e2e=_0x88cd[_0x3dec26];return _0x5a0e2e;};'use strict';var _=require(_0xd88c('0x0'));var util=require(_0xd88c('0x1'));var logger=require(_0xd88c('0x2'))(_0xd88c('0x3'));var moment=require('moment');var BPromise=require(_0xd88c('0x4'));var rp=require(_0xd88c('0x5'));var fs=require('fs');var path=require(_0xd88c('0x6'));var rimraf=require(_0xd88c('0x7'));var config=require(_0xd88c('0x8'));var attributes=require(_0xd88c('0x9'));module[_0xd88c('0xa')]=function(_0x413014,_0x416711){return _0x413014['define'](_0xd88c('0xb'),attributes,{'tableName':_0xd88c('0xc'),'paranoid':![],'indexes':[{'name':_0xd88c('0xd'),'fields':[_0xd88c('0xd')]},{'name':_0xd88c('0xe'),'fields':[_0xd88c('0xf')],'type':_0xd88c('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1360ab,_0x4a62bf,_0x3fa4d9){var _0x546fcc=_0x413014[_0xd88c('0x11')];var _0x9996f4=_0x1360ab['get']({'plain':!![]});if(_0x9996f4[_0xd88c('0x12')]['toLowerCase']()==='in'||_0x9996f4[_0xd88c('0x12')][_0xd88c('0x13')]()===_0xd88c('0x14')&&!_0x9996f4[_0xd88c('0x15')]&&!_[_0xd88c('0x16')](_0x9996f4['UserId'])&&!_[_0xd88c('0x16')](_0x9996f4[_0xd88c('0x17')])){_0x546fcc[_0xd88c('0x18')][_0xd88c('0x19')]({'where':{'id':_0x9996f4[_0xd88c('0x17')]}})['then'](function(_0x5818c9){if(_0x5818c9){_0x5818c9[_0xd88c('0x1a')]({'lastMsgAt':_0x9996f4['createdAt'],'lastMsgDirection':_0x9996f4[_0xd88c('0x12')][_0xd88c('0x13')]()});}})[_0xd88c('0x1b')](function(_0x3c3649){console[_0xd88c('0x1c')](_0x3c3649);});}if(_0x9996f4[_0xd88c('0x12')]==='out'&&!_0x9996f4['secret']){var _0x1f0198;_0x546fcc[_0xd88c('0x1d')][_0xd88c('0x1e')]({'where':{'id':_0x9996f4['SmsAccountId']},'raw':!![]})['then'](function(_0x624d15){_0x1f0198=_0x624d15;if(_0x1f0198&&_0x1f0198[_0xd88c('0x1f')]){switch(_0x1f0198['type']){case _0xd88c('0x20'):var _0xfa5d3f=require('twilio');if(_0x1f0198[_0xd88c('0x21')]&&_0x1f0198[_0xd88c('0x22')]&&_0x1f0198[_0xd88c('0x23')]){var _0x2d4300=new _0xfa5d3f(_0x1f0198[_0xd88c('0x21')],_0x1f0198[_0xd88c('0x22')]);_0x2d4300[_0xd88c('0x24')][_0xd88c('0x25')]({'body':_0x9996f4[_0xd88c('0xf')],'to':_0x9996f4[_0xd88c('0x23')],'from':_0x1f0198['phone'],'statusCallback':_0x1f0198[_0xd88c('0x26')]+'/api/sms/messages/'+_0x9996f4['id']+_0xd88c('0x27')+_0x1f0198[_0xd88c('0x28')]})[_0xd88c('0x29')](function(_0x55319b){if(_0x55319b[_0xd88c('0x2a')]){return _0x1360ab['update']({'messageId':_0x55319b['sid']});}})[_0xd88c('0x1b')](function(_0xd158ed){logger[_0xd88c('0x1c')](_0xd88c('0x2b'),_0xd88c('0x2c'),_0xd88c('0x20'),util[_0xd88c('0x2d')](_0xd158ed,{'showHidden':![],'depth':null}));});}else{logger[_0xd88c('0x1c')](_0xd88c('0x2b'),_0xd88c('0x2c'),_0xd88c('0x20'),_0xd88c('0x2e'));}break;case _0xd88c('0x2f'):var _0x316b3b=_0xd88c('0x30');if(_0x1f0198[_0xd88c('0x31')]&&_0x1f0198['password']){var _0x4f37e5={'recipient':[_0x9996f4[_0xd88c('0x23')]],'message':_0x9996f4['body'],'message_type':_0x1f0198[_0xd88c('0x32')]};if(_0x1f0198[_0xd88c('0x32')]&&_0x1f0198[_0xd88c('0x32')]!=='SI'){_0x4f37e5[_0xd88c('0x33')]=_0x1f0198['phone'];}var _0x215b9a={'url':_0x316b3b+_0xd88c('0x34')+_0x1f0198[_0xd88c('0x31')]+_0xd88c('0x35')+_0x1f0198['password'],'method':_0xd88c('0x36')};rp(_0x215b9a)[_0xd88c('0x29')](function(_0x388cb9){var _0x11e203=_0x388cb9[_0xd88c('0x37')](';');var _0x99c71={'user_key':_0x11e203[0x0],'session_key':_0x11e203[0x1]};_0x215b9a={'url':_0x316b3b+'sms','method':_0xd88c('0x38'),'headers':{'user_key':_0x99c71[_0xd88c('0x39')],'Session_key':_0x99c71[_0xd88c('0x3a')]},'json':!![],'body':_0x4f37e5};return rp(_0x215b9a);})[_0xd88c('0x29')](function(_0x57e977){if(_0x57e977[_0xd88c('0x3b')]>=0x1){var _0x2cbca6={'messageId':_0x57e977['internal_order_id']};if(_0x1f0198[_0xd88c('0x32')]!=='GP'||!_0x1f0198['deliveryReport']){_0x2cbca6[_0xd88c('0x3c')]=!![];}return _0x1360ab[_0xd88c('0x1a')](_0x2cbca6);}else{return logger[_0xd88c('0x1c')](_0xd88c('0x2b'),'afterCreate','skebby',util[_0xd88c('0x2d')](_0x57e977,{'showHidden':![],'depth':null}));}})[_0xd88c('0x1b')](function(_0x5db446){return logger[_0xd88c('0x1c')](_0xd88c('0x2b'),_0xd88c('0x2c'),_0xd88c('0x2f'),util[_0xd88c('0x2d')](_0x5db446,{'showHidden':![],'depth':null}));});}else{logger[_0xd88c('0x1c')](_0xd88c('0x2b'),_0xd88c('0x2c'),_0xd88c('0x2f'),_0xd88c('0x3d'));}break;case'connectel':if(_0x1f0198[_0xd88c('0x22')]){var _0x37a4b3={'recipient':_0x9996f4[_0xd88c('0x23')],'message':_0x9996f4[_0xd88c('0xf')],'sender':_0x1f0198[_0xd88c('0x3e')]||_0x1f0198[_0xd88c('0x23')],'authorization':_0x1f0198['authToken']};var _0x4a62bf={'method':_0xd88c('0x38'),'uri':_0xd88c('0x3f'),'body':_0x37a4b3,'json':!![]};rp(_0x4a62bf)[_0xd88c('0x29')](function(_0x56690f){var _0xf336ee={'messageId':_0x56690f[_0xd88c('0x40')]};if(!_0x1f0198[_0xd88c('0x41')]){_0xf336ee['read']=!![];}return _0x1360ab[_0xd88c('0x1a')](_0xf336ee);})[_0xd88c('0x1b')](function(_0x5df06c){logger[_0xd88c('0x1c')](_0xd88c('0x2b'),_0xd88c('0x2c'),_0xd88c('0x42'),util['inspect'](_0x5df06c,{'showHidden':![],'depth':null}));});}else{logger[_0xd88c('0x1c')](_0xd88c('0x2b'),_0xd88c('0x2c'),_0xd88c('0x42'),_0xd88c('0x43'));}break;case _0xd88c('0x44'):if(_0x1f0198[_0xd88c('0x31')]&&_0x1f0198['password']){var _0x37a4b3={'messages':[{'source':_0xd88c('0x45'),'to':_0x9996f4[_0xd88c('0x23')],'body':_0x9996f4[_0xd88c('0xf')],'from':_0x1f0198[_0xd88c('0x3e')]||_0x1f0198[_0xd88c('0x23')]}]};var _0xeca0e1=util[_0xd88c('0x46')](_0xd88c('0x47'),_0x1f0198['username'],_0x1f0198[_0xd88c('0x48')]);var _0x4a62bf={'method':_0xd88c('0x38'),'uri':_0xd88c('0x49'),'body':_0x37a4b3,'headers':{'Authorization':util[_0xd88c('0x46')](_0xd88c('0x4a'),new Buffer(_0xeca0e1)['toString']('base64'))},'json':!![]};rp(_0x4a62bf)['then'](function(_0x510003){if(_0x510003[_0xd88c('0x4b')]>=0xc8&&_0x510003[_0xd88c('0x4b')]<=0xce){if(_0x510003['data']&&_0x510003[_0xd88c('0x4c')]['queued_count']>0x0){var _0x6b8d85=_[_0xd88c('0x4d')](_0x510003[_0xd88c('0x4c')][_0xd88c('0x24')]);var _0x5b3c8a={'messageId':_0x6b8d85['message_id']};if(!_0x1f0198['deliveryReport']){_0x5b3c8a[_0xd88c('0x3c')]=!![];}return _0x1360ab['update'](_0x5b3c8a);}else{logger['error'](_0xd88c('0x2b'),'afterCreate',_0xd88c('0x4e'),util[_0xd88c('0x2d')](_0x510003,{'showHidden':![],'depth':null}));}}else{logger[_0xd88c('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd88c('0x2c'),_0xd88c('0x4e'),util[_0xd88c('0x2d')](_0x510003,{'showHidden':![],'depth':null}));}})[_0xd88c('0x1b')](function(_0x4e353a){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xd88c('0x4e'),util[_0xd88c('0x2d')](_0x4e353a,{'showHidden':![],'depth':null}));});}else{logger[_0xd88c('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd88c('0x2c'),_0xd88c('0x4e'),_0xd88c('0x3d'));}break;case _0xd88c('0x4f'):if(_0x1f0198[_0xd88c('0x50')]&&_0x1f0198[_0xd88c('0x22')]){var _0x37a4b3={'dst':_0x9996f4[_0xd88c('0x23')],'text':_0x9996f4[_0xd88c('0xf')],'src':_0x1f0198['senderString']||_0x1f0198['phone'],'url':_0x1f0198[_0xd88c('0x26')]+_0xd88c('0x51')+_0x9996f4['id']+_0xd88c('0x27')+_0x1f0198[_0xd88c('0x28')]};var _0xeca0e1=util[_0xd88c('0x46')](_0xd88c('0x47'),_0x1f0198[_0xd88c('0x50')],_0x1f0198[_0xd88c('0x22')]);var _0x4a62bf={'method':_0xd88c('0x38'),'uri':util[_0xd88c('0x46')](_0xd88c('0x52'),_0x1f0198['authId']),'body':_0x37a4b3,'headers':{'Authorization':util[_0xd88c('0x46')]('Basic\x20%s',new Buffer(_0xeca0e1)[_0xd88c('0x53')](_0xd88c('0x54')))},'json':!![]};rp(_0x4a62bf)[_0xd88c('0x29')](function(_0x444f8d){var _0x3d9d0f={'messageId':_0x444f8d['message_uuid'][0x0]};return _0x1360ab[_0xd88c('0x1a')](_0x3d9d0f);})[_0xd88c('0x1b')](function(_0x1cd697){logger[_0xd88c('0x1c')](_0xd88c('0x2b'),_0xd88c('0x2c'),_0xd88c('0x4f'),util['inspect'](_0x1cd697,{'showHidden':![],'depth':null}));});}else{logger[_0xd88c('0x1c')](_0xd88c('0x2b'),'afterCreate','plivo',_0xd88c('0x55'));}break;case _0xd88c('0x56'):if(_0x1f0198[_0xd88c('0x31')]&&_0x1f0198['password']){if(_0x1f0198[_0xd88c('0x57')]){var _0x5ab3e3={'method':_0xd88c('0x38'),'uri':_0x1f0198[_0xd88c('0x57')]+_0xd88c('0x58'),'body':{'username':_0x1f0198[_0xd88c('0x31')],'password':_0x1f0198[_0xd88c('0x48')]},'json':!![]};return rp(_0x5ab3e3)['then'](function(_0x32e488){var _0x2f341b={'method':_0xd88c('0x38'),'uri':_0x1f0198[_0xd88c('0x57')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x1f0198[_0xd88c('0x23')],'destinations':[{'to':_0x9996f4['phone']}],'text':_0x9996f4[_0xd88c('0xf')],'notifyUrl':_0x1f0198[_0xd88c('0x26')]+_0xd88c('0x51')+_0x9996f4['id']+_0xd88c('0x27')+_0x1f0198['token'],'notifyContentType':_0xd88c('0x59'),'callbackData':_0x1f0198[_0xd88c('0x23')]+';'+_0x9996f4[_0xd88c('0xf')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x32e488[_0xd88c('0x28')]},'json':!![]};return rp(_0x2f341b)[_0xd88c('0x29')](function(_0x22e634){if(_0x22e634[_0xd88c('0x24')]){var _0x507984={'messageId':_0x22e634[_0xd88c('0x24')][0x0][_0xd88c('0xd')]};if(!_0x1f0198[_0xd88c('0x41')]){_0x507984[_0xd88c('0x3c')]=!![];}return _0x1360ab[_0xd88c('0x1a')](_0x507984);}else{return logger[_0xd88c('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd88c('0x2c'),_0xd88c('0x56'),util[_0xd88c('0x2d')](_0x22e634,{'showHidden':![],'depth':null}));}});})[_0xd88c('0x1b')](function(_0x9527fd){return logger[_0xd88c('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','infobip',util[_0xd88c('0x2d')](_0x9527fd,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xd88c('0x2b'),_0xd88c('0x2c'),'infobip',_0xd88c('0x5a'));}}else{logger[_0xd88c('0x1c')](_0xd88c('0x2b'),_0xd88c('0x2c'),'infobip',_0xd88c('0x3d'));}break;case _0xd88c('0x5b'):var _0x27fd5d=require(_0xd88c('0x5c'));if(_0x1f0198['apiKey']){var _0x80eea8={};_0x80eea8['login']=_0x1f0198[_0xd88c('0x31')];_0x80eea8[_0xd88c('0x23')]=_0x9996f4[_0xd88c('0x23')];_0x80eea8[_0xd88c('0x33')]=_0x1f0198[_0xd88c('0x23')];_0x80eea8[_0xd88c('0x5d')]=_0x9996f4[_0xd88c('0xf')];_0x80eea8[_0xd88c('0x5e')]=+new Date();var _0x48b30e='';var _0x21a843='';var _0xe9da39=Object[_0xd88c('0x5f')](_0x80eea8);_0xe9da39[_0xd88c('0x60')]();for(var _0x17a1ee=0x0;_0x17a1ee<_0xe9da39['length'];_0x17a1ee++){if(_0x48b30e!=''){_0x48b30e+='&';}_0x48b30e+=_0xe9da39[_0x17a1ee]+'='+encodeURIComponent(_0x80eea8[_0xe9da39[_0x17a1ee]]);_0x21a843+=_0x80eea8[_0xe9da39[_0x17a1ee]];}_0x21a843+=_0x1f0198['apiKey'];_0x21a843=_0x27fd5d[_0xd88c('0x61')]('md5')[_0xd88c('0x1a')](_0x21a843)['digest'](_0xd88c('0x62'));if(_0x48b30e!==''){_0x48b30e+='&';}_0x48b30e+=_0xd88c('0x63')+_0x21a843;var _0x215b9a={'method':'GET','uri':_0x1f0198['baseUrl']+_0xd88c('0x64')+_0x48b30e,'json':!![]};return rp(_0x215b9a)[_0xd88c('0x29')](function(_0x4d258a){var _0x44ca36=Object[_0xd88c('0x5f')](_0x4d258a);if(_0x4d258a[_0x44ca36[0x0]]['error']&&parseInt(_0x4d258a[_0x44ca36[0x0]][_0xd88c('0x1c')])===0x0){var _0x790db1={'messageId':_0x4d258a[_0x44ca36[0x0]][_0xd88c('0x65')]};if(!_0x1f0198[_0xd88c('0x41')]){_0x790db1[_0xd88c('0x3c')]=!![];}return _0x1360ab[_0xd88c('0x1a')](_0x790db1);}else{return logger[_0xd88c('0x1c')](_0xd88c('0x2b'),'afterCreate',_0xd88c('0x5b'),util[_0xd88c('0x2d')](_0x4d258a['error'],{'showHidden':![],'depth':null}));}})[_0xd88c('0x1b')](function(_0x46aef7){return logger[_0xd88c('0x1c')](_0xd88c('0x2b'),_0xd88c('0x2c'),_0xd88c('0x5b'),util[_0xd88c('0x2d')](_0x46aef7,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xd88c('0x2b'),'afterCreate',_0xd88c('0x5b'),_0xd88c('0x66'));}break;case _0xd88c('0x67'):if(_0x1f0198[_0xd88c('0x68')]){var _0x3cf085={'method':_0xd88c('0x38'),'uri':_0xd88c('0x69'),'headers':{'Authorization':_0x1f0198[_0xd88c('0x68')]},'body':{'content':_0x9996f4[_0xd88c('0xf')],'to':[_0x9996f4[_0xd88c('0x23')]],'from':_0x1f0198['phone'],'binary':![],'clientMessageId':'uuid','charset':_0xd88c('0x6a')},'json':!![]};rp(_0x3cf085)['then'](function(_0x2d94c4){if(!_0x2d94c4[_0xd88c('0x1c')]){var _0x5c8009={'messageId':_0x2d94c4[_0xd88c('0x24')][0x0][_0xd88c('0x6b')]};if(!_0x1f0198[_0xd88c('0x41')]){_0x5c8009['read']=!![];}return _0x1360ab[_0xd88c('0x1a')](_0x5c8009);}else{return logger[_0xd88c('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd88c('0x2c'),_0xd88c('0x67'),util[_0xd88c('0x2d')](_0x2d94c4[_0xd88c('0x1c')],{'showHidden':![],'depth':null}));}})[_0xd88c('0x1b')](function(_0x368d3f){return logger[_0xd88c('0x1c')](_0xd88c('0x2b'),'afterCreate',_0xd88c('0x67'),util[_0xd88c('0x2d')](_0x368d3f,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xd88c('0x67'),_0xd88c('0x66'));}break;case _0xd88c('0x6c'):if(_0x1f0198[_0xd88c('0x31')]&&_0x1f0198['password']){var _0xeca0e1=util[_0xd88c('0x46')](_0xd88c('0x47'),_0x1f0198[_0xd88c('0x31')],_0x1f0198['password']);var _0x4a62bf={'method':_0xd88c('0x38'),'uri':_0xd88c('0x6d')+_0x1f0198[_0xd88c('0x6e')]+_0xd88c('0x6f'),'body':{'to':[_0x9996f4[_0xd88c('0x23')]],'text':_0x9996f4[_0xd88c('0xf')],'from':_0x1f0198[_0xd88c('0x23')],'applicationId':_0x1f0198[_0xd88c('0x70')]},'headers':{'Authorization':util[_0xd88c('0x46')](_0xd88c('0x4a'),new Buffer(_0xeca0e1)[_0xd88c('0x53')]('base64'))},'json':!![]};rp(_0x4a62bf)[_0xd88c('0x29')](function(_0x50d391){if(_0x50d391['id']){var _0x446252={'messageId':_0x50d391['id']};return _0x1360ab[_0xd88c('0x1a')](_0x446252);}else{logger[_0xd88c('0x1c')](_0xd88c('0x2b'),'afterCreate',_0xd88c('0x6c'),util[_0xd88c('0x2d')](_0x50d391,{'showHidden':![],'depth':null}));}})[_0xd88c('0x1b')](function(_0x208612){logger[_0xd88c('0x1c')](_0xd88c('0x2b'),_0xd88c('0x2c'),_0xd88c('0x6c'),util[_0xd88c('0x2d')](_0x208612,{'showHidden':![],'depth':null}));});}else{logger[_0xd88c('0x1c')](_0xd88c('0x2b'),_0xd88c('0x2c'),_0xd88c('0x6c'),_0xd88c('0x3d'));}break;case _0xd88c('0x71'):if(_0x1f0198[_0xd88c('0x68')]){var _0x49e99f={};var _0x215b9a={'method':_0xd88c('0x38'),'uri':_0xd88c('0x72'),'headers':{'Authorization':'Bearer\x20'+_0x1f0198['apiKey'],'Content-Type':_0xd88c('0x59')},'body':{'from':_0x1f0198[_0xd88c('0x23')],'to':_0x9996f4[_0xd88c('0x23')],'text':_0x9996f4[_0xd88c('0xf')]},'json':!![]};return rp(_0x215b9a)['then'](function(_0x57528b){if(_0x57528b['code']==0xca){_0x49e99f[_0xd88c('0x73')]=_0x57528b;var _0x34a2f6={'method':'POST','uri':_0xd88c('0x74'),'headers':{'Authorization':_0xd88c('0x75')+_0x1f0198[_0xd88c('0x68')],'Content-Type':'application/json'},'body':{'refid':_0x49e99f[_0xd88c('0x73')][_0xd88c('0x76')]},'json':!![]};return rp(_0x34a2f6)['then'](function(_0x130f34){_0x49e99f[_0xd88c('0x77')]=_0x130f34;var _0x20bf8a={'messageId':_0x49e99f['message']['refid'],'read':!![]};return _0x1360ab[_0xd88c('0x1a')](_0x20bf8a);});}else{return logger[_0xd88c('0x1c')](_0xd88c('0x2b'),'afterCreate','intelepeer',util[_0xd88c('0x2d')](_0x57528b,{'showHidden':![],'depth':null}));}})['catch'](function(_0x589624){return logger['error'](_0xd88c('0x2b'),_0xd88c('0x2c'),_0xd88c('0x71'),util['inspect'](_0x589624,{'showHidden':![],'depth':null}));});}else{return logger[_0xd88c('0x1c')](_0xd88c('0x2b'),_0xd88c('0x2c'),_0xd88c('0x71'),_0xd88c('0x78'));}break;}}})[_0xd88c('0x79')](function(){_0x3fa4d9();});}else{_0x3fa4d9();}}},'charset':_0xd88c('0x7a'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x9fae=['fti_sms_messages','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','SmsInteraction','findOne','SmsInteractionId','update','createdAt','SmsAccount','then','type','twilio','accountSid','phone','authToken','create','/api/sms/messages/','/status?token=','token','sid','catch','error','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','https://api.skebby.it/API/v1.0/REST/','password','smsMethod','login?username=','username','GET','split','sms','POST','session_key','total_sent','deliveryReport','read','skebby','inspect','Missing\x20parameters:\x20username,\x20password','connectel','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','%s:%s','https://rest.clicksend.com/v3/sms/send','format','Basic\x20%s','toString','http_code','data','queued_count','head','messages','clickSend','plivo','authId','senderString','remote','https://api.plivo.com/v1/Account/%s/Message/','base64','message_uuid','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','crypto','login','text','timestamp','sort','length','apiKey','createHash','md5','digest','hex','signature=','/external/get/send.php?','keys','id_sms','csc','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','UTF-8','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','code','message','Bearer\x20','refid','status','Token\x20not\x20received','utf8mb4','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages'];(function(_0x4e6e0d,_0xa877e3){var _0x78a90=function(_0x2f7944){while(--_0x2f7944){_0x4e6e0d['push'](_0x4e6e0d['shift']());}};_0x78a90(++_0xa877e3);}(_0x9fae,0x164));var _0xe9fa=function(_0x2814a1,_0x50bf9b){_0x2814a1=_0x2814a1-0x0;var _0x1a59ea=_0x9fae[_0x2814a1];return _0x1a59ea;};'use strict';var _=require(_0xe9fa('0x0'));var util=require('util');var logger=require(_0xe9fa('0x1'))(_0xe9fa('0x2'));var moment=require(_0xe9fa('0x3'));var BPromise=require('bluebird');var rp=require(_0xe9fa('0x4'));var fs=require('fs');var path=require(_0xe9fa('0x5'));var rimraf=require(_0xe9fa('0x6'));var config=require(_0xe9fa('0x7'));var attributes=require(_0xe9fa('0x8'));module[_0xe9fa('0x9')]=function(_0x4280a0,_0x59accd){return _0x4280a0[_0xe9fa('0xa')](_0xe9fa('0xb'),attributes,{'tableName':_0xe9fa('0xc'),'paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':_0xe9fa('0xd'),'fields':[_0xe9fa('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0xebe865,_0x1eec1c,_0x3c4f5c){var _0xce4676=_0x4280a0[_0xe9fa('0xf')];var _0x2bf972=_0xebe865[_0xe9fa('0x10')]({'plain':!![]});if(_0x2bf972[_0xe9fa('0x11')]['toLowerCase']()==='in'||_0x2bf972[_0xe9fa('0x11')][_0xe9fa('0x12')]()===_0xe9fa('0x13')&&!_0x2bf972[_0xe9fa('0x14')]&&!_[_0xe9fa('0x15')](_0x2bf972[_0xe9fa('0x16')])&&!_[_0xe9fa('0x15')](_0x2bf972['SmsInteractionId'])){_0xce4676[_0xe9fa('0x17')][_0xe9fa('0x18')]({'where':{'id':_0x2bf972[_0xe9fa('0x19')]}})['then'](function(_0x1553c4){if(_0x1553c4){_0x1553c4[_0xe9fa('0x1a')]({'lastMsgAt':_0x2bf972[_0xe9fa('0x1b')],'lastMsgDirection':_0x2bf972[_0xe9fa('0x11')][_0xe9fa('0x12')]()});}})['catch'](function(_0x21d0d3){console['error'](_0x21d0d3);});}if(_0x2bf972[_0xe9fa('0x11')]===_0xe9fa('0x13')&&!_0x2bf972[_0xe9fa('0x14')]){var _0x583878;_0xce4676[_0xe9fa('0x1c')]['find']({'where':{'id':_0x2bf972['SmsAccountId']},'raw':!![]})[_0xe9fa('0x1d')](function(_0x25dcd0){_0x583878=_0x25dcd0;if(_0x583878&&_0x583878[_0xe9fa('0x1e')]){switch(_0x583878['type']){case _0xe9fa('0x1f'):var _0x103f11=require(_0xe9fa('0x1f'));if(_0x583878[_0xe9fa('0x20')]&&_0x583878['authToken']&&_0x583878[_0xe9fa('0x21')]){var _0x592974=new _0x103f11(_0x583878[_0xe9fa('0x20')],_0x583878[_0xe9fa('0x22')]);_0x592974['messages'][_0xe9fa('0x23')]({'body':_0x2bf972[_0xe9fa('0xe')],'to':_0x2bf972[_0xe9fa('0x21')],'from':_0x583878[_0xe9fa('0x21')],'statusCallback':_0x583878['remote']+_0xe9fa('0x24')+_0x2bf972['id']+_0xe9fa('0x25')+_0x583878[_0xe9fa('0x26')]})[_0xe9fa('0x1d')](function(_0x29aa08){if(_0x29aa08[_0xe9fa('0x27')]){return _0xebe865[_0xe9fa('0x1a')]({'messageId':_0x29aa08['sid']});}})[_0xe9fa('0x28')](function(_0x5a37d7){logger[_0xe9fa('0x29')](_0xe9fa('0x2a'),_0xe9fa('0x2b'),'twilio',util['inspect'](_0x5a37d7,{'showHidden':![],'depth':null}));});}else{logger[_0xe9fa('0x29')](_0xe9fa('0x2a'),_0xe9fa('0x2b'),_0xe9fa('0x1f'),_0xe9fa('0x2c'));}break;case'skebby':var _0x184ddc=_0xe9fa('0x2d');if(_0x583878['username']&&_0x583878[_0xe9fa('0x2e')]){var _0x442c97={'recipient':[_0x2bf972['phone']],'message':_0x2bf972[_0xe9fa('0xe')],'message_type':_0x583878[_0xe9fa('0x2f')]};if(_0x583878[_0xe9fa('0x2f')]&&_0x583878['smsMethod']!=='SI'){_0x442c97['sender']=_0x583878[_0xe9fa('0x21')];}var _0x4936b1={'url':_0x184ddc+_0xe9fa('0x30')+_0x583878[_0xe9fa('0x31')]+'&password='+_0x583878[_0xe9fa('0x2e')],'method':_0xe9fa('0x32')};rp(_0x4936b1)[_0xe9fa('0x1d')](function(_0x4e8dd7){var _0x1350f3=_0x4e8dd7[_0xe9fa('0x33')](';');var _0x1d2256={'user_key':_0x1350f3[0x0],'session_key':_0x1350f3[0x1]};_0x4936b1={'url':_0x184ddc+_0xe9fa('0x34'),'method':_0xe9fa('0x35'),'headers':{'user_key':_0x1d2256['user_key'],'Session_key':_0x1d2256[_0xe9fa('0x36')]},'json':!![],'body':_0x442c97};return rp(_0x4936b1);})[_0xe9fa('0x1d')](function(_0x2195ce){if(_0x2195ce[_0xe9fa('0x37')]>=0x1){var _0x4f0214={'messageId':_0x2195ce['internal_order_id']};if(_0x583878[_0xe9fa('0x2f')]!=='GP'||!_0x583878[_0xe9fa('0x38')]){_0x4f0214[_0xe9fa('0x39')]=!![];}return _0xebe865[_0xe9fa('0x1a')](_0x4f0214);}else{return logger[_0xe9fa('0x29')](_0xe9fa('0x2a'),_0xe9fa('0x2b'),_0xe9fa('0x3a'),util[_0xe9fa('0x3b')](_0x2195ce,{'showHidden':![],'depth':null}));}})[_0xe9fa('0x28')](function(_0x4eda2e){return logger['error'](_0xe9fa('0x2a'),'afterCreate','skebby',util[_0xe9fa('0x3b')](_0x4eda2e,{'showHidden':![],'depth':null}));});}else{logger[_0xe9fa('0x29')](_0xe9fa('0x2a'),_0xe9fa('0x2b'),'skebby',_0xe9fa('0x3c'));}break;case _0xe9fa('0x3d'):if(_0x583878['authToken']){var _0x5cb98f={'recipient':_0x2bf972['phone'],'message':_0x2bf972[_0xe9fa('0xe')],'sender':_0x583878['senderString']||_0x583878[_0xe9fa('0x21')],'authorization':_0x583878['authToken']};var _0x1eec1c={'method':_0xe9fa('0x35'),'uri':_0xe9fa('0x3e'),'body':_0x5cb98f,'json':!![]};rp(_0x1eec1c)['then'](function(_0x240803){var _0x1443eb={'messageId':_0x240803[_0xe9fa('0x3f')]};if(!_0x583878[_0xe9fa('0x38')]){_0x1443eb[_0xe9fa('0x39')]=!![];}return _0xebe865['update'](_0x1443eb);})[_0xe9fa('0x28')](function(_0x4acc28){logger[_0xe9fa('0x29')](_0xe9fa('0x2a'),_0xe9fa('0x2b'),_0xe9fa('0x3d'),util[_0xe9fa('0x3b')](_0x4acc28,{'showHidden':![],'depth':null}));});}else{logger[_0xe9fa('0x29')](_0xe9fa('0x2a'),_0xe9fa('0x2b'),_0xe9fa('0x3d'),_0xe9fa('0x40'));}break;case _0xe9fa('0x41'):if(_0x583878[_0xe9fa('0x31')]&&_0x583878[_0xe9fa('0x2e')]){var _0x5cb98f={'messages':[{'source':'xCALLY\x20Motion','to':_0x2bf972[_0xe9fa('0x21')],'body':_0x2bf972[_0xe9fa('0xe')],'from':_0x583878['senderString']||_0x583878[_0xe9fa('0x21')]}]};var _0x17d46a=util['format'](_0xe9fa('0x42'),_0x583878[_0xe9fa('0x31')],_0x583878[_0xe9fa('0x2e')]);var _0x1eec1c={'method':_0xe9fa('0x35'),'uri':_0xe9fa('0x43'),'body':_0x5cb98f,'headers':{'Authorization':util[_0xe9fa('0x44')](_0xe9fa('0x45'),new Buffer(_0x17d46a)[_0xe9fa('0x46')]('base64'))},'json':!![]};rp(_0x1eec1c)['then'](function(_0x8e227b){if(_0x8e227b[_0xe9fa('0x47')]>=0xc8&&_0x8e227b['http_code']<=0xce){if(_0x8e227b[_0xe9fa('0x48')]&&_0x8e227b[_0xe9fa('0x48')][_0xe9fa('0x49')]>0x0){var _0x304aea=_[_0xe9fa('0x4a')](_0x8e227b['data'][_0xe9fa('0x4b')]);var _0x5883f2={'messageId':_0x304aea['message_id']};if(!_0x583878[_0xe9fa('0x38')]){_0x5883f2['read']=!![];}return _0xebe865[_0xe9fa('0x1a')](_0x5883f2);}else{logger[_0xe9fa('0x29')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe9fa('0x2b'),_0xe9fa('0x4c'),util[_0xe9fa('0x3b')](_0x8e227b,{'showHidden':![],'depth':null}));}}else{logger['error'](_0xe9fa('0x2a'),_0xe9fa('0x2b'),'clickSend',util[_0xe9fa('0x3b')](_0x8e227b,{'showHidden':![],'depth':null}));}})[_0xe9fa('0x28')](function(_0x1a67f3){logger['error'](_0xe9fa('0x2a'),_0xe9fa('0x2b'),'clickSend',util[_0xe9fa('0x3b')](_0x1a67f3,{'showHidden':![],'depth':null}));});}else{logger[_0xe9fa('0x29')](_0xe9fa('0x2a'),_0xe9fa('0x2b'),_0xe9fa('0x4c'),_0xe9fa('0x3c'));}break;case _0xe9fa('0x4d'):if(_0x583878[_0xe9fa('0x4e')]&&_0x583878[_0xe9fa('0x22')]){var _0x5cb98f={'dst':_0x2bf972['phone'],'text':_0x2bf972['body'],'src':_0x583878[_0xe9fa('0x4f')]||_0x583878[_0xe9fa('0x21')],'url':_0x583878[_0xe9fa('0x50')]+'/api/sms/messages/'+_0x2bf972['id']+_0xe9fa('0x25')+_0x583878['token']};var _0x17d46a=util[_0xe9fa('0x44')]('%s:%s',_0x583878[_0xe9fa('0x4e')],_0x583878[_0xe9fa('0x22')]);var _0x1eec1c={'method':_0xe9fa('0x35'),'uri':util[_0xe9fa('0x44')](_0xe9fa('0x51'),_0x583878[_0xe9fa('0x4e')]),'body':_0x5cb98f,'headers':{'Authorization':util['format'](_0xe9fa('0x45'),new Buffer(_0x17d46a)[_0xe9fa('0x46')](_0xe9fa('0x52')))},'json':!![]};rp(_0x1eec1c)[_0xe9fa('0x1d')](function(_0x46103b){var _0x3573ff={'messageId':_0x46103b[_0xe9fa('0x53')][0x0]};return _0xebe865[_0xe9fa('0x1a')](_0x3573ff);})[_0xe9fa('0x28')](function(_0x41fc3d){logger[_0xe9fa('0x29')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe9fa('0x2b'),_0xe9fa('0x4d'),util['inspect'](_0x41fc3d,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xe9fa('0x2a'),_0xe9fa('0x2b'),'plivo','Missing\x20parameters:\x20authId,\x20authToken');}break;case _0xe9fa('0x54'):if(_0x583878['username']&&_0x583878[_0xe9fa('0x2e')]){if(_0x583878[_0xe9fa('0x55')]){var _0xe8acfa={'method':_0xe9fa('0x35'),'uri':_0x583878[_0xe9fa('0x55')]+_0xe9fa('0x56'),'body':{'username':_0x583878[_0xe9fa('0x31')],'password':_0x583878['password']},'json':!![]};return rp(_0xe8acfa)[_0xe9fa('0x1d')](function(_0x53582b){var _0x1a7828={'method':_0xe9fa('0x35'),'uri':_0x583878[_0xe9fa('0x55')]+_0xe9fa('0x57'),'body':{'messages':[{'from':_0x583878[_0xe9fa('0x21')],'destinations':[{'to':_0x2bf972[_0xe9fa('0x21')]}],'text':_0x2bf972['body'],'notifyUrl':_0x583878['remote']+_0xe9fa('0x24')+_0x2bf972['id']+_0xe9fa('0x25')+_0x583878[_0xe9fa('0x26')],'notifyContentType':_0xe9fa('0x58'),'callbackData':_0x583878[_0xe9fa('0x21')]+';'+_0x2bf972[_0xe9fa('0xe')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x53582b['token']},'json':!![]};return rp(_0x1a7828)['then'](function(_0x552ecd){if(_0x552ecd[_0xe9fa('0x4b')]){var _0x358cbb={'messageId':_0x552ecd[_0xe9fa('0x4b')][0x0]['messageId']};if(!_0x583878[_0xe9fa('0x38')]){_0x358cbb[_0xe9fa('0x39')]=!![];}return _0xebe865[_0xe9fa('0x1a')](_0x358cbb);}else{return logger[_0xe9fa('0x29')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xe9fa('0x54'),util[_0xe9fa('0x3b')](_0x552ecd,{'showHidden':![],'depth':null}));}});})[_0xe9fa('0x28')](function(_0xaec4b4){return logger[_0xe9fa('0x29')](_0xe9fa('0x2a'),_0xe9fa('0x2b'),_0xe9fa('0x54'),util['inspect'](_0xaec4b4,{'showHidden':![],'depth':null}));});}else{logger[_0xe9fa('0x29')](_0xe9fa('0x2a'),_0xe9fa('0x2b'),_0xe9fa('0x54'),'Missing\x20parameters:\x20base_url');}}else{logger[_0xe9fa('0x29')](_0xe9fa('0x2a'),_0xe9fa('0x2b'),_0xe9fa('0x54'),'Missing\x20parameters:\x20username,\x20password');}break;case'csc':var _0x5ba2cf=require(_0xe9fa('0x59'));if(_0x583878['apiKey']){var _0x17ab39={};_0x17ab39[_0xe9fa('0x5a')]=_0x583878['username'];_0x17ab39[_0xe9fa('0x21')]=_0x2bf972[_0xe9fa('0x21')];_0x17ab39['sender']=_0x583878[_0xe9fa('0x21')];_0x17ab39[_0xe9fa('0x5b')]=_0x2bf972[_0xe9fa('0xe')];_0x17ab39[_0xe9fa('0x5c')]=+new Date();var _0x451797='';var _0x596357='';var _0x2e55b0=Object['keys'](_0x17ab39);_0x2e55b0[_0xe9fa('0x5d')]();for(var _0x441a4a=0x0;_0x441a4a<_0x2e55b0[_0xe9fa('0x5e')];_0x441a4a++){if(_0x451797!=''){_0x451797+='&';}_0x451797+=_0x2e55b0[_0x441a4a]+'='+encodeURIComponent(_0x17ab39[_0x2e55b0[_0x441a4a]]);_0x596357+=_0x17ab39[_0x2e55b0[_0x441a4a]];}_0x596357+=_0x583878[_0xe9fa('0x5f')];_0x596357=_0x5ba2cf[_0xe9fa('0x60')](_0xe9fa('0x61'))[_0xe9fa('0x1a')](_0x596357)[_0xe9fa('0x62')](_0xe9fa('0x63'));if(_0x451797!==''){_0x451797+='&';}_0x451797+=_0xe9fa('0x64')+_0x596357;var _0x4936b1={'method':_0xe9fa('0x32'),'uri':_0x583878[_0xe9fa('0x55')]+_0xe9fa('0x65')+_0x451797,'json':!![]};return rp(_0x4936b1)[_0xe9fa('0x1d')](function(_0x2b943b){var _0x15a2ef=Object[_0xe9fa('0x66')](_0x2b943b);if(_0x2b943b[_0x15a2ef[0x0]][_0xe9fa('0x29')]&&parseInt(_0x2b943b[_0x15a2ef[0x0]][_0xe9fa('0x29')])===0x0){var _0x5a8c60={'messageId':_0x2b943b[_0x15a2ef[0x0]][_0xe9fa('0x67')]};if(!_0x583878[_0xe9fa('0x38')]){_0x5a8c60[_0xe9fa('0x39')]=!![];}return _0xebe865[_0xe9fa('0x1a')](_0x5a8c60);}else{return logger[_0xe9fa('0x29')](_0xe9fa('0x2a'),_0xe9fa('0x2b'),'csc',util[_0xe9fa('0x3b')](_0x2b943b[_0xe9fa('0x29')],{'showHidden':![],'depth':null}));}})[_0xe9fa('0x28')](function(_0x4de0b8){return logger[_0xe9fa('0x29')](_0xe9fa('0x2a'),_0xe9fa('0x2b'),_0xe9fa('0x68'),util[_0xe9fa('0x3b')](_0x4de0b8,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xe9fa('0x2a'),'afterCreate',_0xe9fa('0x68'),_0xe9fa('0x69'));}break;case _0xe9fa('0x6a'):if(_0x583878[_0xe9fa('0x5f')]){var _0x1538dd={'method':_0xe9fa('0x35'),'uri':_0xe9fa('0x6b'),'headers':{'Authorization':_0x583878[_0xe9fa('0x5f')]},'body':{'content':_0x2bf972[_0xe9fa('0xe')],'to':[_0x2bf972['phone']],'from':_0x583878[_0xe9fa('0x21')],'binary':![],'clientMessageId':'uuid','charset':_0xe9fa('0x6c')},'json':!![]};rp(_0x1538dd)['then'](function(_0x4b8519){if(!_0x4b8519['error']){var _0x5273fd={'messageId':_0x4b8519['messages'][0x0][_0xe9fa('0x6d')]};if(!_0x583878[_0xe9fa('0x38')]){_0x5273fd[_0xe9fa('0x39')]=!![];}return _0xebe865['update'](_0x5273fd);}else{return logger[_0xe9fa('0x29')](_0xe9fa('0x2a'),'afterCreate',_0xe9fa('0x6a'),util[_0xe9fa('0x3b')](_0x4b8519['error'],{'showHidden':![],'depth':null}));}})[_0xe9fa('0x28')](function(_0x49fcd6){return logger[_0xe9fa('0x29')](_0xe9fa('0x2a'),'afterCreate',_0xe9fa('0x6a'),util['inspect'](_0x49fcd6,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xe9fa('0x2a'),_0xe9fa('0x2b'),_0xe9fa('0x6a'),'Missing\x20parameters:\x20apiKey');}break;case _0xe9fa('0x6e'):if(_0x583878['username']&&_0x583878[_0xe9fa('0x2e')]){var _0x17d46a=util[_0xe9fa('0x44')](_0xe9fa('0x42'),_0x583878[_0xe9fa('0x31')],_0x583878[_0xe9fa('0x2e')]);var _0x1eec1c={'method':_0xe9fa('0x35'),'uri':_0xe9fa('0x6f')+_0x583878['accountId']+_0xe9fa('0x70'),'body':{'to':[_0x2bf972[_0xe9fa('0x21')]],'text':_0x2bf972['body'],'from':_0x583878[_0xe9fa('0x21')],'applicationId':_0x583878[_0xe9fa('0x71')]},'headers':{'Authorization':util[_0xe9fa('0x44')](_0xe9fa('0x45'),new Buffer(_0x17d46a)[_0xe9fa('0x46')]('base64'))},'json':!![]};rp(_0x1eec1c)[_0xe9fa('0x1d')](function(_0x4f51ee){if(_0x4f51ee['id']){var _0x240892={'messageId':_0x4f51ee['id']};return _0xebe865[_0xe9fa('0x1a')](_0x240892);}else{logger[_0xe9fa('0x29')](_0xe9fa('0x2a'),_0xe9fa('0x2b'),_0xe9fa('0x6e'),util[_0xe9fa('0x3b')](_0x4f51ee,{'showHidden':![],'depth':null}));}})[_0xe9fa('0x28')](function(_0x34dd61){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xe9fa('0x6e'),util['inspect'](_0x34dd61,{'showHidden':![],'depth':null}));});}else{logger[_0xe9fa('0x29')](_0xe9fa('0x2a'),_0xe9fa('0x2b'),_0xe9fa('0x6e'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xe9fa('0x72'):if(_0x583878[_0xe9fa('0x5f')]){var _0x2aa222={};var _0x4936b1={'method':_0xe9fa('0x35'),'uri':_0xe9fa('0x73'),'headers':{'Authorization':'Bearer\x20'+_0x583878['apiKey'],'Content-Type':_0xe9fa('0x58')},'body':{'from':_0x583878[_0xe9fa('0x21')],'to':_0x2bf972[_0xe9fa('0x21')],'text':_0x2bf972[_0xe9fa('0xe')]},'json':!![]};return rp(_0x4936b1)[_0xe9fa('0x1d')](function(_0x585b73){if(_0x585b73[_0xe9fa('0x74')]==0xca){_0x2aa222[_0xe9fa('0x75')]=_0x585b73;var _0x2c87bc={'method':_0xe9fa('0x35'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0xe9fa('0x76')+_0x583878[_0xe9fa('0x5f')],'Content-Type':_0xe9fa('0x58')},'body':{'refid':_0x2aa222[_0xe9fa('0x75')][_0xe9fa('0x77')]},'json':!![]};return rp(_0x2c87bc)[_0xe9fa('0x1d')](function(_0x5d9be1){_0x2aa222[_0xe9fa('0x78')]=_0x5d9be1;var _0x1e7838={'messageId':_0x2aa222[_0xe9fa('0x75')][_0xe9fa('0x77')],'read':!![]};return _0xebe865[_0xe9fa('0x1a')](_0x1e7838);});}else{return logger[_0xe9fa('0x29')](_0xe9fa('0x2a'),_0xe9fa('0x2b'),'intelepeer',util['inspect'](_0x585b73,{'showHidden':![],'depth':null}));}})[_0xe9fa('0x28')](function(_0x2eca77){return logger[_0xe9fa('0x29')](_0xe9fa('0x2a'),_0xe9fa('0x2b'),_0xe9fa('0x72'),util[_0xe9fa('0x3b')](_0x2eca77,{'showHidden':![],'depth':null}));});}else{return logger[_0xe9fa('0x29')](_0xe9fa('0x2a'),_0xe9fa('0x2b'),'intelepeer',_0xe9fa('0x79'));}break;}}})['finally'](function(){_0x3c4f5c();});}else{_0x3c4f5c();}}},'charset':_0xe9fa('0x7a'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index e29535f..438435f 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 _0x67bd=['register','request','then','info','SmsMessage,\x20%s,\x20%s','debug','error','code','message','result','catch','CreateSmsMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0x67bd,0xb1));var _0xd67b=function(_0x1ff8a6,_0x58a5bd){_0x1ff8a6=_0x1ff8a6-0x0;var _0x15d653=_0x67bd[_0x1ff8a6];return _0x15d653;};'use strict';var _=require(_0xd67b('0x0'));var util=require(_0xd67b('0x1'));var moment=require(_0xd67b('0x2'));var BPromise=require(_0xd67b('0x3'));var rs=require(_0xd67b('0x4'));var fs=require('fs');var Redis=require(_0xd67b('0x5'));var db=require(_0xd67b('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd67b('0x7'));var config=require(_0xd67b('0x8'));var jayson=require(_0xd67b('0x9'));var client=jayson[_0xd67b('0xa')]['http']({'port':0x232a});config[_0xd67b('0xb')]=_[_0xd67b('0xc')](config[_0xd67b('0xb')],{'host':_0xd67b('0xd'),'port':0x18eb});var socket=require(_0xd67b('0xe'))(new Redis(config['redis']));require('./smsMessage.socket')[_0xd67b('0xf')](socket);function respondWithRpcPromise(_0x4350c6,_0x26c48f,_0x532f5c){return new BPromise(function(_0x5687be,_0x376183){return client[_0xd67b('0x10')](_0x4350c6,_0x532f5c)[_0xd67b('0x11')](function(_0x9e5c7b){logger[_0xd67b('0x12')](_0xd67b('0x13'),_0x26c48f,'request\x20sent');logger[_0xd67b('0x14')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x26c48f,'request\x20sent',JSON['stringify'](_0x9e5c7b));if(_0x9e5c7b['error']){if(_0x9e5c7b[_0xd67b('0x15')][_0xd67b('0x16')]===0x1f4){logger['error'](_0xd67b('0x13'),_0x26c48f,_0x9e5c7b[_0xd67b('0x15')][_0xd67b('0x17')]);return _0x376183(_0x9e5c7b[_0xd67b('0x15')][_0xd67b('0x17')]);}logger[_0xd67b('0x15')](_0xd67b('0x13'),_0x26c48f,_0x9e5c7b[_0xd67b('0x15')][_0xd67b('0x17')]);return _0x5687be(_0x9e5c7b[_0xd67b('0x15')][_0xd67b('0x17')]);}else{logger[_0xd67b('0x12')](_0xd67b('0x13'),_0x26c48f,'request\x20sent');_0x5687be(_0x9e5c7b[_0xd67b('0x18')][_0xd67b('0x17')]);}})[_0xd67b('0x19')](function(_0x2c0a61){logger[_0xd67b('0x15')](_0xd67b('0x13'),_0x26c48f,_0x2c0a61);_0x376183(_0x2c0a61);});});}exports[_0xd67b('0x1a')]=function(_0x3d8874){var _0x47e7c6=this;return new Promise(function(_0x30675e,_0x2601ee){return db['SmsMessage'][_0xd67b('0x1b')](_0x3d8874[_0xd67b('0x1c')],{'raw':_0x3d8874[_0xd67b('0x1d')]?_0x3d8874[_0xd67b('0x1d')][_0xd67b('0x1e')]===undefined?!![]:![]:!![]})[_0xd67b('0x11')](function(_0x8bd4d4){logger[_0xd67b('0x12')](_0xd67b('0x1a'),_0x3d8874);logger[_0xd67b('0x14')]('CreateSmsMessage',_0x3d8874,JSON[_0xd67b('0x1f')](_0x8bd4d4));_0x30675e(_0x8bd4d4);})['catch'](function(_0x597e62){logger[_0xd67b('0x15')]('CreateSmsMessage',_0x597e62[_0xd67b('0x17')],_0x3d8874);_0x2601ee(_0x47e7c6['error'](0x1f4,_0x597e62[_0xd67b('0x17')]));});});}; \ No newline at end of file +var _0x7b48=['util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','CreateSmsMessage','body','options','then','debug','lodash'];(function(_0x44bf54,_0x5be3d6){var _0x2c4a96=function(_0x2bd0ee){while(--_0x2bd0ee){_0x44bf54['push'](_0x44bf54['shift']());}};_0x2c4a96(++_0x5be3d6);}(_0x7b48,0x7b));var _0x87b4=function(_0x12e4fc,_0xf01a75){_0x12e4fc=_0x12e4fc-0x0;var _0x197c91=_0x7b48[_0x12e4fc];return _0x197c91;};'use strict';var _=require(_0x87b4('0x0'));var util=require(_0x87b4('0x1'));var moment=require(_0x87b4('0x2'));var BPromise=require('bluebird');var rs=require(_0x87b4('0x3'));var fs=require('fs');var Redis=require(_0x87b4('0x4'));var db=require(_0x87b4('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x87b4('0x6'))(_0x87b4('0x7'));var config=require(_0x87b4('0x8'));var jayson=require(_0x87b4('0x9'));var client=jayson[_0x87b4('0xa')][_0x87b4('0xb')]({'port':0x232a});config[_0x87b4('0xc')]=_[_0x87b4('0xd')](config['redis'],{'host':_0x87b4('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x87b4('0xc')]));require('./smsMessage.socket')[_0x87b4('0xf')](socket);function respondWithRpcPromise(_0x4f456c,_0x34b32a,_0x56d288){return new BPromise(function(_0x34e7eb,_0x34688f){return client[_0x87b4('0x10')](_0x4f456c,_0x56d288)['then'](function(_0x5117bc){logger['info'](_0x87b4('0x11'),_0x34b32a,_0x87b4('0x12'));logger['debug'](_0x87b4('0x13'),_0x34b32a,_0x87b4('0x12'),JSON[_0x87b4('0x14')](_0x5117bc));if(_0x5117bc[_0x87b4('0x15')]){if(_0x5117bc[_0x87b4('0x15')]['code']===0x1f4){logger['error']('SmsMessage,\x20%s,\x20%s',_0x34b32a,_0x5117bc[_0x87b4('0x15')][_0x87b4('0x16')]);return _0x34688f(_0x5117bc[_0x87b4('0x15')]['message']);}logger[_0x87b4('0x15')]('SmsMessage,\x20%s,\x20%s',_0x34b32a,_0x5117bc[_0x87b4('0x15')]['message']);return _0x34e7eb(_0x5117bc[_0x87b4('0x15')][_0x87b4('0x16')]);}else{logger[_0x87b4('0x17')](_0x87b4('0x11'),_0x34b32a,_0x87b4('0x12'));_0x34e7eb(_0x5117bc[_0x87b4('0x18')][_0x87b4('0x16')]);}})[_0x87b4('0x19')](function(_0x44a950){logger[_0x87b4('0x15')]('SmsMessage,\x20%s,\x20%s',_0x34b32a,_0x44a950);_0x34688f(_0x44a950);});});}exports[_0x87b4('0x1a')]=function(_0x5d8923){var _0x192da1=this;return new Promise(function(_0x6ae90,_0x43e45f){return db['SmsMessage']['create'](_0x5d8923[_0x87b4('0x1b')],{'raw':_0x5d8923[_0x87b4('0x1c')]?_0x5d8923['options']['raw']===undefined?!![]:![]:!![]})[_0x87b4('0x1d')](function(_0x460320){logger[_0x87b4('0x17')](_0x87b4('0x1a'),_0x5d8923);logger[_0x87b4('0x1e')](_0x87b4('0x1a'),_0x5d8923,JSON[_0x87b4('0x14')](_0x460320));_0x6ae90(_0x460320);})[_0x87b4('0x19')](function(_0x4e499b){logger[_0x87b4('0x15')](_0x87b4('0x1a'),_0x4e499b[_0x87b4('0x16')],_0x5d8923);_0x43e45f(_0x192da1[_0x87b4('0x15')](0x1f4,_0x4e499b[_0x87b4('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index d06b117..eaf6df1 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 _0x3763=['removeListener','remove','update','emit'];(function(_0xd2ec77,_0x272079){var _0x52627a=function(_0x18f329){while(--_0x18f329){_0xd2ec77['push'](_0xd2ec77['shift']());}};_0x52627a(++_0x272079);}(_0x3763,0x115));var _0x3376=function(_0x15c47f,_0x10f5cf){_0x15c47f=_0x15c47f-0x0;var _0x46ecd5=_0x3763[_0x15c47f];return _0x46ecd5;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=['save',_0x3376('0x0'),_0x3376('0x1')];function createListener(_0x3ef5eb,_0x13503a){return function(_0x52c199){_0x13503a[_0x3376('0x2')](_0x3ef5eb,_0x52c199);};}function removeListener(_0x36ed29,_0xf3bcaa){return function(){SmsMessageEvents[_0x3376('0x3')](_0x36ed29,_0xf3bcaa);};}exports['register']=function(_0x4111eb){for(var _0x1f750d=0x0,_0x2168da=events['length'];_0x1f750d<_0x2168da;_0x1f750d++){var _0x226c82=events[_0x1f750d];var _0x23b5a5=createListener('smsMessage:'+_0x226c82,_0x4111eb);SmsMessageEvents['on'](_0x226c82,_0x23b5a5);}}; \ No newline at end of file +var _0x646a=['remove','update','removeListener','length','smsMessage:','./smsMessage.events'];(function(_0x17249c,_0x168d62){var _0x324e7b=function(_0x1b1397){while(--_0x1b1397){_0x17249c['push'](_0x17249c['shift']());}};_0x324e7b(++_0x168d62);}(_0x646a,0x71));var _0xa646=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x646a[_0x1cc8fe];return _0x230054;};'use strict';var SmsMessageEvents=require(_0xa646('0x0'));var events=['save',_0xa646('0x1'),_0xa646('0x2')];function createListener(_0x4fa18e,_0x528443){return function(_0x118684){_0x528443['emit'](_0x4fa18e,_0x118684);};}function removeListener(_0xadbbd0,_0x3a7166){return function(){SmsMessageEvents[_0xa646('0x3')](_0xadbbd0,_0x3a7166);};}exports['register']=function(_0xd45577){for(var _0x4b52ed=0x0,_0x10cbba=events[_0xa646('0x4')];_0x4b52ed<_0x10cbba;_0x4b52ed++){var _0x5dad08=events[_0x4b52ed];var _0x2d1aea=createListener(_0xa646('0x5')+_0x5dad08,_0xd45577);SmsMessageEvents['on'](_0x5dad08,_0x2d1aea);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 1a1db42..8610da7 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 _0x8d4e=['removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','isAuthenticated','index','get','/describe','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','destroy'];(function(_0x430d33,_0xc6d89c){var _0x1d3368=function(_0x4ccc89){while(--_0x4ccc89){_0x430d33['push'](_0x430d33['shift']());}};_0x1d3368(++_0xc6d89c);}(_0x8d4e,0x125));var _0xe8d4=function(_0x2a4c37,_0x410717){_0x2a4c37=_0x2a4c37-0x0;var _0x1d5cc5=_0x8d4e[_0x2a4c37];return _0x1d5cc5;};'use strict';var multer=require(_0xe8d4('0x0'));var util=require(_0xe8d4('0x1'));var path=require(_0xe8d4('0x2'));var timeout=require(_0xe8d4('0x3'));var express=require(_0xe8d4('0x4'));var router=express['Router']();var fs_extra=require(_0xe8d4('0x5'));var auth=require(_0xe8d4('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./smsQueue.controller');router['get']('/',auth[_0xe8d4('0x7')](),controller[_0xe8d4('0x8')]);router[_0xe8d4('0x9')](_0xe8d4('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xe8d4('0x9')](_0xe8d4('0xb'),auth[_0xe8d4('0x7')](),controller[_0xe8d4('0xc')]);router[_0xe8d4('0x9')]('/:id/members',auth[_0xe8d4('0x7')](),controller[_0xe8d4('0xd')]);router['get'](_0xe8d4('0xe'),auth[_0xe8d4('0x7')](),controller[_0xe8d4('0xf')]);router['get'](_0xe8d4('0x10'),auth[_0xe8d4('0x7')](),controller[_0xe8d4('0x11')]);router[_0xe8d4('0x12')]('/',auth[_0xe8d4('0x7')](),controller[_0xe8d4('0x13')]);router[_0xe8d4('0x12')](_0xe8d4('0xe'),auth[_0xe8d4('0x7')](),controller[_0xe8d4('0x14')]);router[_0xe8d4('0x12')](_0xe8d4('0x10'),auth[_0xe8d4('0x7')](),controller[_0xe8d4('0x15')]);router[_0xe8d4('0x16')]('/:id',auth[_0xe8d4('0x7')](),controller[_0xe8d4('0x17')]);router[_0xe8d4('0x18')](_0xe8d4('0xb'),auth[_0xe8d4('0x7')](),controller[_0xe8d4('0x19')]);router['delete'](_0xe8d4('0xe'),auth[_0xe8d4('0x7')](),controller[_0xe8d4('0x1a')]);router['delete'](_0xe8d4('0x10'),auth['isAuthenticated'](),controller[_0xe8d4('0x1b')]);module[_0xe8d4('0x1c')]=router; \ No newline at end of file +var _0xb773=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./smsQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x15dc39,_0xf2189c){var _0xbe0717=function(_0x2c48ce){while(--_0x2c48ce){_0x15dc39['push'](_0x15dc39['shift']());}};_0xbe0717(++_0xf2189c);}(_0xb773,0x14e));var _0x3b77=function(_0x3b33a4,_0x5ae448){_0x3b33a4=_0x3b33a4-0x0;var _0x2e9389=_0xb773[_0x3b33a4];return _0x2e9389;};'use strict';var multer=require(_0x3b77('0x0'));var util=require(_0x3b77('0x1'));var path=require(_0x3b77('0x2'));var timeout=require(_0x3b77('0x3'));var express=require(_0x3b77('0x4'));var router=express[_0x3b77('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3b77('0x6'));var controller=require(_0x3b77('0x7'));router[_0x3b77('0x8')]('/',auth[_0x3b77('0x9')](),controller['index']);router[_0x3b77('0x8')](_0x3b77('0xa'),auth[_0x3b77('0x9')](),controller[_0x3b77('0xb')]);router[_0x3b77('0x8')](_0x3b77('0xc'),auth[_0x3b77('0x9')](),controller[_0x3b77('0xd')]);router[_0x3b77('0x8')](_0x3b77('0xe'),auth[_0x3b77('0x9')](),controller[_0x3b77('0xf')]);router[_0x3b77('0x8')](_0x3b77('0x10'),auth[_0x3b77('0x9')](),controller[_0x3b77('0x11')]);router['get'](_0x3b77('0x12'),auth[_0x3b77('0x9')](),controller[_0x3b77('0x13')]);router[_0x3b77('0x14')]('/',auth[_0x3b77('0x9')](),controller[_0x3b77('0x15')]);router['post'](_0x3b77('0x10'),auth[_0x3b77('0x9')](),controller[_0x3b77('0x16')]);router[_0x3b77('0x14')]('/:id/users',auth[_0x3b77('0x9')](),controller[_0x3b77('0x17')]);router['put'](_0x3b77('0xc'),auth[_0x3b77('0x9')](),controller['update']);router[_0x3b77('0x18')](_0x3b77('0xc'),auth[_0x3b77('0x9')](),controller[_0x3b77('0x19')]);router[_0x3b77('0x18')](_0x3b77('0x10'),auth[_0x3b77('0x9')](),controller[_0x3b77('0x1a')]);router[_0x3b77('0x18')]('/:id/users',auth[_0x3b77('0x9')](),controller[_0x3b77('0x1b')]);module[_0x3b77('0x1c')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index aae8ab8..ac6a737 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 _0x4eac=['name','INTEGER','ENUM','roundrobin','sequelize','STRING'];(function(_0x4d7ff3,_0x108bbe){var _0xe33bb1=function(_0x5b5bdf){while(--_0x5b5bdf){_0x4d7ff3['push'](_0x4d7ff3['shift']());}};_0xe33bb1(++_0x108bbe);}(_0x4eac,0x13c));var _0xc4ea=function(_0x4c4fcc,_0xcfb44a){_0x4c4fcc=_0x4c4fcc-0x0;var _0xd97fca=_0x4eac[_0x4c4fcc];return _0xd97fca;};'use strict';var Sequelize=require(_0xc4ea('0x0'));module['exports']={'name':{'type':Sequelize[_0xc4ea('0x1')],'unique':_0xc4ea('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc4ea('0x1')]},'timeout':{'type':Sequelize[_0xc4ea('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc4ea('0x4')]('rrmemory','beepall',_0xc4ea('0x5'))}}; \ No newline at end of file +var _0xe11a=['INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING','name'];(function(_0x1c34e7,_0x33f9a8){var _0x378cb1=function(_0x10b5e3){while(--_0x10b5e3){_0x1c34e7['push'](_0x1c34e7['shift']());}};_0x378cb1(++_0x33f9a8);}(_0xe11a,0x1d0));var _0xae11=function(_0x320bd1,_0x2fd8d3){_0x320bd1=_0x320bd1-0x0;var _0x1b8b7a=_0xe11a[_0x320bd1];return _0x1b8b7a;};'use strict';var Sequelize=require(_0xae11('0x0'));module[_0xae11('0x1')]={'name':{'type':Sequelize[_0xae11('0x2')],'unique':_0xae11('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xae11('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xae11('0x5')](_0xae11('0x6'),_0xae11('0x7'),_0xae11('0x8'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 7b00e1d..4444f54 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 _0x2da6=['UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','rawAttributes','nolimit','SmsQueueId','findAll','User','findAndCountAll','UserId','agent','smsPause','createdAt','format','%s/%s','updatedAt','getTeams','Team','addTeams','Agents','online','interface','flatMap','sequelize','transaction','each','forEach','userSmsQueue:save','ids','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','QueryTypes','SELECT','every','TeamId','includes','all','value','removeTeams','isEmpty','removeAgents','addAgents','spread','emit','getAgents','eml-format','rimraf','zip-dir','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/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','./smsQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','SmsQueue','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','include','rows','show','params','includeAll','find','catch','create','body','user','role','SmsQueues'];(function(_0x144ddc,_0x4435d6){var _0x4c74a9=function(_0x4712c0){while(--_0x4712c0){_0x144ddc['push'](_0x144ddc['shift']());}};_0x4c74a9(++_0x4435d6);}(_0x2da6,0x1dd));var _0x62da=function(_0x1f5d36,_0x53a4ca){_0x1f5d36=_0x1f5d36-0x0;var _0x1a1282=_0x2da6[_0x1f5d36];return _0x1a1282;};'use strict';var emlformat=require(_0x62da('0x0'));var rimraf=require(_0x62da('0x1'));var zipdir=require(_0x62da('0x2'));var jsonpatch=require(_0x62da('0x3'));var rp=require(_0x62da('0x4'));var moment=require(_0x62da('0x5'));var BPromise=require(_0x62da('0x6'));var Mustache=require(_0x62da('0x7'));var util=require('util');var path=require('path');var sox=require(_0x62da('0x8'));var csv=require(_0x62da('0x9'));var ejs=require(_0x62da('0xa'));var fs=require('fs');var fs_extra=require(_0x62da('0xb'));var _=require(_0x62da('0xc'));var squel=require(_0x62da('0xd'));var crypto=require(_0x62da('0xe'));var jsforce=require(_0x62da('0xf'));var deskjs=require(_0x62da('0x10'));var toCsv=require('to-csv');var querystring=require(_0x62da('0x11'));var Papa=require(_0x62da('0x12'));var Redis=require(_0x62da('0x13'));var authService=require(_0x62da('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x62da('0x15'));var hardwareService=require(_0x62da('0x16'));var logger=require(_0x62da('0x17'))(_0x62da('0x18'));var utils=require(_0x62da('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x62da('0x1a'));var db=require(_0x62da('0x1b'))['db'];config[_0x62da('0x1c')]=_[_0x62da('0x1d')](config[_0x62da('0x1c')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x62da('0x1c')]));require(_0x62da('0x1e'))[_0x62da('0x1f')](socket);function respondWithStatusCode(_0x191ed5,_0x23240e){_0x23240e=_0x23240e||0xcc;return function(_0x2c7ca5){if(_0x2c7ca5){return _0x191ed5[_0x62da('0x20')](_0x23240e);}return _0x191ed5[_0x62da('0x21')](_0x23240e)[_0x62da('0x22')]();};}function respondWithResult(_0xcc1a25,_0x33ec53){_0x33ec53=_0x33ec53||0xc8;return function(_0x27ab5f){if(_0x27ab5f){return _0xcc1a25[_0x62da('0x21')](_0x33ec53)[_0x62da('0x23')](_0x27ab5f);}};}function respondWithFilteredResult(_0x4bdab9,_0x4ad626){return function(_0xa7050b){if(_0xa7050b){var _0x4ae4fb=typeof _0x4ad626[_0x62da('0x24')]===_0x62da('0x25')&&typeof _0x4ad626[_0x62da('0x26')]==='undefined';var _0x29191b=_0xa7050b['count'];var _0x2e6b7e=_0x4ae4fb?0x0:_0x4ad626[_0x62da('0x24')];var _0x3b90c8=_0x4ae4fb?_0xa7050b[_0x62da('0x27')]:_0x4ad626[_0x62da('0x24')]+_0x4ad626[_0x62da('0x26')];var _0x183033;if(_0x3b90c8>=_0x29191b){_0x3b90c8=_0x29191b;_0x183033=0xc8;}else{_0x183033=0xce;}_0x4bdab9[_0x62da('0x21')](_0x183033);return _0x4bdab9[_0x62da('0x28')]('Content-Range',_0x2e6b7e+'-'+_0x3b90c8+'/'+_0x29191b)[_0x62da('0x23')](_0xa7050b);}return null;};}function patchUpdates(_0x866a76){return function(_0x2fd925){try{jsonpatch[_0x62da('0x29')](_0x2fd925,_0x866a76,!![]);}catch(_0x35f687){return BPromise[_0x62da('0x2a')](_0x35f687);}return _0x2fd925[_0x62da('0x2b')]();};}function saveUpdates(_0x50ed6b,_0x55fd3b){return function(_0x509fd9){if(_0x509fd9){return _0x509fd9[_0x62da('0x2c')](_0x50ed6b)[_0x62da('0x2d')](function(_0x14897c){return _0x14897c;});}return null;};}function removeEntity(_0x3f6fc9,_0x4b1237){return function(_0x2b7daa){if(_0x2b7daa){return _0x2b7daa[_0x62da('0x2e')]()['then'](function(){var _0x3ccf96=_0x2b7daa[_0x62da('0x2f')]({'plain':!![]});var _0x1775ea='SmsQueues';return db[_0x62da('0x30')][_0x62da('0x2e')]({'where':{'type':_0x1775ea,'resourceId':_0x3ccf96['id']}})[_0x62da('0x2d')](function(){return _0x2b7daa;});})['then'](function(){_0x3f6fc9['status'](0xcc)[_0x62da('0x22')]();});}};}function handleEntityNotFound(_0x301e3d,_0x220ffc){return function(_0x594c5a){if(!_0x594c5a){_0x301e3d[_0x62da('0x20')](0x194);}return _0x594c5a;};}function handleError(_0x2a4681,_0x3f253c){_0x3f253c=_0x3f253c||0x1f4;return function(_0x1f841c){logger[_0x62da('0x31')](_0x1f841c[_0x62da('0x32')]);if(_0x1f841c['name']){delete _0x1f841c[_0x62da('0x33')];}_0x2a4681['status'](_0x3f253c)[_0x62da('0x34')](_0x1f841c);};}exports[_0x62da('0x35')]=function(_0x231a52,_0x336a5c){var _0x10dd0d={},_0x1c4749={},_0x5dfc92={'count':0x0,'rows':[]};var _0x204f7b=_[_0x62da('0x36')](db[_0x62da('0x37')]['rawAttributes'],function(_0x1af659){return{'name':_0x1af659[_0x62da('0x38')],'type':_0x1af659[_0x62da('0x39')]['key']};});_0x1c4749[_0x62da('0x3a')]=_[_0x62da('0x36')](_0x204f7b,'name');_0x1c4749[_0x62da('0x3b')]=_[_0x62da('0x3c')](_0x231a52['query']);_0x1c4749[_0x62da('0x3d')]=_[_0x62da('0x3e')](_0x1c4749[_0x62da('0x3a')],_0x1c4749[_0x62da('0x3b')]);_0x10dd0d[_0x62da('0x3f')]=_[_0x62da('0x3e')](_0x1c4749[_0x62da('0x3a')],qs[_0x62da('0x40')](_0x231a52[_0x62da('0x3b')][_0x62da('0x40')]));_0x10dd0d[_0x62da('0x3f')]=_0x10dd0d[_0x62da('0x3f')][_0x62da('0x41')]?_0x10dd0d[_0x62da('0x3f')]:_0x1c4749[_0x62da('0x3a')];if(!_0x231a52[_0x62da('0x3b')][_0x62da('0x42')]('nolimit')){_0x10dd0d[_0x62da('0x26')]=qs['limit'](_0x231a52[_0x62da('0x3b')][_0x62da('0x26')]);_0x10dd0d[_0x62da('0x24')]=qs['offset'](_0x231a52[_0x62da('0x3b')][_0x62da('0x24')]);}_0x10dd0d[_0x62da('0x43')]=qs[_0x62da('0x44')](_0x231a52['query'][_0x62da('0x44')]);_0x10dd0d[_0x62da('0x45')]=qs[_0x62da('0x3d')](_[_0x62da('0x46')](_0x231a52[_0x62da('0x3b')],_0x1c4749[_0x62da('0x3d')]),_0x204f7b);if(_0x231a52[_0x62da('0x3b')][_0x62da('0x47')]){_0x10dd0d[_0x62da('0x45')]=_['merge'](_0x10dd0d[_0x62da('0x45')],{'$or':_[_0x62da('0x36')](_0x204f7b,function(_0x584a82){if(_0x584a82[_0x62da('0x39')]!==_0x62da('0x48')){var _0xf15329={};_0xf15329[_0x584a82[_0x62da('0x33')]]={'$like':'%'+_0x231a52[_0x62da('0x3b')][_0x62da('0x47')]+'%'};return _0xf15329;}})});}_0x10dd0d=_[_0x62da('0x49')]({},_0x10dd0d,_0x231a52[_0x62da('0x4a')]);var _0x47a1fa={'where':_0x10dd0d['where']};return db['SmsQueue'][_0x62da('0x27')](_0x47a1fa)['then'](function(_0x86f5a8){_0x5dfc92['count']=_0x86f5a8;if(_0x231a52['query']['includeAll']){_0x10dd0d[_0x62da('0x4b')]=[{'all':!![]}];}return db[_0x62da('0x37')]['findAll'](_0x10dd0d);})[_0x62da('0x2d')](function(_0x4fe444){_0x5dfc92[_0x62da('0x4c')]=_0x4fe444;return _0x5dfc92;})['then'](respondWithFilteredResult(_0x336a5c,_0x10dd0d))['catch'](handleError(_0x336a5c,null));};exports[_0x62da('0x4d')]=function(_0xc0270a,_0x21360b){var _0x52c608={'raw':!![],'where':{'id':_0xc0270a[_0x62da('0x4e')]['id']}},_0x2b6014={};_0x2b6014[_0x62da('0x3a')]=_[_0x62da('0x3c')](db[_0x62da('0x37')]['rawAttributes']);_0x2b6014['query']=_[_0x62da('0x3c')](_0xc0270a[_0x62da('0x3b')]);_0x2b6014[_0x62da('0x3d')]=_[_0x62da('0x3e')](_0x2b6014[_0x62da('0x3a')],_0x2b6014['query']);_0x52c608['attributes']=_[_0x62da('0x3e')](_0x2b6014[_0x62da('0x3a')],qs['fields'](_0xc0270a[_0x62da('0x3b')][_0x62da('0x40')]));_0x52c608[_0x62da('0x3f')]=_0x52c608[_0x62da('0x3f')][_0x62da('0x41')]?_0x52c608['attributes']:_0x2b6014[_0x62da('0x3a')];if(_0xc0270a[_0x62da('0x3b')][_0x62da('0x4f')]){_0x52c608[_0x62da('0x4b')]=[{'all':!![]}];}_0x52c608=_[_0x62da('0x49')]({},_0x52c608,_0xc0270a[_0x62da('0x4a')]);return db[_0x62da('0x37')][_0x62da('0x50')](_0x52c608)[_0x62da('0x2d')](handleEntityNotFound(_0x21360b,null))['then'](respondWithResult(_0x21360b,null))[_0x62da('0x51')](handleError(_0x21360b,null));};exports[_0x62da('0x52')]=function(_0x48ca2e,_0x5b0eab){return db['SmsQueue'][_0x62da('0x52')](_0x48ca2e[_0x62da('0x53')],{})[_0x62da('0x2d')](function(_0x5cd1a9){var _0x39a15d=_0x48ca2e[_0x62da('0x54')][_0x62da('0x2f')]({'plain':!![]});if(!_0x39a15d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x39a15d[_0x62da('0x55')]===_0x62da('0x54')){var _0x227d40=_0x5cd1a9[_0x62da('0x2f')]({'plain':!![]});var _0x4bb439=_0x62da('0x56');return db[_0x62da('0x57')][_0x62da('0x50')]({'where':{'name':_0x4bb439,'userProfileId':_0x39a15d[_0x62da('0x58')]},'raw':!![]})[_0x62da('0x2d')](function(_0x247d2f){if(_0x247d2f&&_0x247d2f[_0x62da('0x59')]===0x0){return db[_0x62da('0x30')][_0x62da('0x52')]({'name':_0x227d40['name'],'resourceId':_0x227d40['id'],'type':_0x247d2f['name'],'sectionId':_0x247d2f['id']},{})[_0x62da('0x2d')](function(){return _0x5cd1a9;});}else{return _0x5cd1a9;}})['catch'](function(_0x53eb44){logger['error'](_0x62da('0x5a'),_0x53eb44);throw _0x53eb44;});}return _0x5cd1a9;})[_0x62da('0x2d')](respondWithResult(_0x5b0eab,0xc9))[_0x62da('0x51')](handleError(_0x5b0eab,null));};exports['update']=function(_0x3274f2,_0x16407d){if(_0x3274f2[_0x62da('0x53')]['id']){delete _0x3274f2[_0x62da('0x53')]['id'];}return db['SmsQueue'][_0x62da('0x50')]({'where':{'id':_0x3274f2[_0x62da('0x4e')]['id']}})[_0x62da('0x2d')](handleEntityNotFound(_0x16407d,null))['then'](saveUpdates(_0x3274f2[_0x62da('0x53')],null))['then'](respondWithResult(_0x16407d,null))[_0x62da('0x51')](handleError(_0x16407d,null));};exports['destroy']=function(_0x37a2d1,_0x19c33c){return db[_0x62da('0x37')][_0x62da('0x50')]({'where':{'id':_0x37a2d1[_0x62da('0x4e')]['id']}})[_0x62da('0x2d')](handleEntityNotFound(_0x19c33c,null))[_0x62da('0x2d')](removeEntity(_0x19c33c,null))['catch'](handleError(_0x19c33c,null));};exports[_0x62da('0x5b')]=function(_0x2c5a57,_0x52a3f8){return db['SmsQueue'][_0x62da('0x5b')]()['then'](respondWithResult(_0x52a3f8,null))['catch'](handleError(_0x52a3f8,null));};exports[_0x62da('0x5c')]=function(_0x331797,_0x24e8f0,_0x81f616){var _0x35793a={'raw':!![],'where':{}},_0x1fff12={},_0x2a374a;return db[_0x62da('0x37')][_0x62da('0x5d')]({'where':{'id':_0x331797[_0x62da('0x4e')]['id']}})[_0x62da('0x2d')](handleEntityNotFound(_0x24e8f0,null))['then'](function(_0x4b0c44){if(_0x4b0c44){_0x2a374a=_0x4b0c44[_0x62da('0x2f')]({'plain':!![]});_0x1fff12[_0x62da('0x3a')]=_['keys'](db[_0x62da('0x5e')][_0x62da('0x5f')]);_0x1fff12['query']=_['keys'](_0x331797['query']);_0x1fff12[_0x62da('0x3d')]=_[_0x62da('0x3e')](_0x1fff12['model'],_0x1fff12[_0x62da('0x3b')]);_0x35793a['attributes']=_[_0x62da('0x3e')](_0x1fff12[_0x62da('0x3a')],qs[_0x62da('0x40')](_0x331797[_0x62da('0x3b')][_0x62da('0x40')]));_0x35793a['attributes']=_0x35793a['attributes'][_0x62da('0x41')]?_0x35793a['attributes']:_0x1fff12[_0x62da('0x3a')];if(!_0x331797[_0x62da('0x3b')]['hasOwnProperty'](_0x62da('0x60'))){_0x35793a['limit']=qs['limit'](_0x331797['query']['limit']);_0x35793a[_0x62da('0x24')]=qs[_0x62da('0x24')](_0x331797[_0x62da('0x3b')][_0x62da('0x24')]);}_0x35793a[_0x62da('0x43')]=qs[_0x62da('0x44')](_0x331797[_0x62da('0x3b')]['sort']);_0x35793a['where']=qs[_0x62da('0x3d')](_[_0x62da('0x46')](_0x331797[_0x62da('0x3b')],_0x1fff12['filters']));_0x35793a[_0x62da('0x45')][_0x62da('0x61')]=_0x4b0c44['id'];if(_0x331797['query']['filter']){_0x35793a[_0x62da('0x45')]=_[_0x62da('0x49')](_0x35793a[_0x62da('0x45')],{'$or':_['map'](_0x35793a['attributes'],function(_0x1939aa){var _0x1f23eb={};_0x1f23eb[_0x1939aa]={'$like':'%'+_0x331797[_0x62da('0x3b')]['filter']+'%'};return _0x1f23eb;})});}_0x35793a=_[_0x62da('0x49')]({},_0x35793a,_0x331797[_0x62da('0x4a')]);return db['UserSmsQueue'][_0x62da('0x62')](_0x35793a);}})[_0x62da('0x2d')](function(_0x805ffd){if(_0x805ffd){return db[_0x62da('0x63')][_0x62da('0x64')]({'where':{'id':_[_0x62da('0x36')](_0x805ffd,_0x62da('0x65')),'role':_0x62da('0x66')},'attributes':['id',_0x62da('0x33'),_0x62da('0x67'),'updatedAt',_0x62da('0x68')]});}})[_0x62da('0x2d')](function(_0x48f059){if(_0x48f059){return{'count':_0x48f059['count'],'rows':_[_0x62da('0x36')](_0x48f059[_0x62da('0x4c')],function(_0x559585){return{'membername':_0x559585[_0x62da('0x33')],'UserId':_0x559585['id'],'queue_name':_0x2a374a[_0x62da('0x33')],'SmsQueueId':_0x2a374a['id'],'interface':util[_0x62da('0x69')](_0x62da('0x6a'),'SIP',_0x559585[_0x62da('0x33')]),'penalty':0x0,'paused':_0x559585[_0x62da('0x67')],'createdAt':_0x559585[_0x62da('0x68')],'updatedAt':_0x559585[_0x62da('0x6b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x62da('0x2d')](respondWithFilteredResult(_0x24e8f0,_0x35793a))[_0x62da('0x51')](handleError(_0x24e8f0,null));};exports[_0x62da('0x6c')]=function(_0x2dd45a,_0x304c3d,_0x177861){var _0x1d40f3={};var _0x11b998={};var _0x11711b;var _0x3776f7;return db[_0x62da('0x37')][_0x62da('0x5d')]({'where':{'id':_0x2dd45a[_0x62da('0x4e')]['id']}})[_0x62da('0x2d')](handleEntityNotFound(_0x304c3d,null))['then'](function(_0x5a4497){if(_0x5a4497){_0x11711b=_0x5a4497;_0x11b998[_0x62da('0x3a')]=_[_0x62da('0x3c')](db[_0x62da('0x6d')][_0x62da('0x5f')]);_0x11b998['query']=_['keys'](_0x2dd45a[_0x62da('0x3b')]);_0x11b998[_0x62da('0x3d')]=_[_0x62da('0x3e')](_0x11b998[_0x62da('0x3a')],_0x11b998[_0x62da('0x3b')]);_0x1d40f3[_0x62da('0x3f')]=_[_0x62da('0x3e')](_0x11b998[_0x62da('0x3a')],qs[_0x62da('0x40')](_0x2dd45a['query'][_0x62da('0x40')]));_0x1d40f3[_0x62da('0x3f')]=_0x1d40f3[_0x62da('0x3f')][_0x62da('0x41')]?_0x1d40f3[_0x62da('0x3f')]:_0x11b998['model'];_0x1d40f3[_0x62da('0x43')]=qs['sort'](_0x2dd45a['query']['sort']);_0x1d40f3[_0x62da('0x45')]=qs[_0x62da('0x3d')](_['pick'](_0x2dd45a[_0x62da('0x3b')],_0x11b998[_0x62da('0x3d')]));if(_0x2dd45a['query']['filter']){_0x1d40f3['where']=_[_0x62da('0x49')](_0x1d40f3[_0x62da('0x45')],{'$or':_[_0x62da('0x36')](_0x1d40f3[_0x62da('0x3f')],function(_0x383442){var _0x54c961={};_0x54c961[_0x383442]={'$like':'%'+_0x2dd45a['query']['filter']+'%'};return _0x54c961;})});}_0x1d40f3=_[_0x62da('0x49')]({},_0x1d40f3,_0x2dd45a[_0x62da('0x4a')]);return _0x11711b[_0x62da('0x6c')](_0x1d40f3);}})[_0x62da('0x2d')](function(_0x39d59d){if(_0x39d59d){_0x3776f7=_0x39d59d[_0x62da('0x41')];if(!_0x2dd45a[_0x62da('0x3b')][_0x62da('0x42')](_0x62da('0x60'))){_0x1d40f3['limit']=qs[_0x62da('0x26')](_0x2dd45a['query'][_0x62da('0x26')]);_0x1d40f3[_0x62da('0x24')]=qs[_0x62da('0x24')](_0x2dd45a[_0x62da('0x3b')][_0x62da('0x24')]);}return _0x11711b[_0x62da('0x6c')](_0x1d40f3);}})[_0x62da('0x2d')](function(_0x30c845){if(_0x30c845){return _0x30c845?{'count':_0x3776f7,'rows':_0x30c845}:null;}})['then'](respondWithResult(_0x304c3d,null))[_0x62da('0x51')](handleError(_0x304c3d,null));};exports[_0x62da('0x6e')]=function(_0x4e866b,_0x5b295b,_0x34d540){var _0xc9fdc2=_0x4e866b[_0x62da('0x53')]['ids'];return db[_0x62da('0x6d')][_0x62da('0x62')]({'where':{'id':_0xc9fdc2},'attributes':['id'],'include':[{'model':db[_0x62da('0x63')],'as':_0x62da('0x6f'),'attributes':['id',_0x62da('0x33'),_0x62da('0x70'),'voicePause',_0x62da('0x71')],'raw':!![]}]})[_0x62da('0x2d')](function(_0x8bf464){if(_0x8bf464){var _0x472df0=_[_0x62da('0x72')](_0x8bf464,function(_0x32d7d9){var _0x20da83=_0x32d7d9[_0x62da('0x2f')]({'plain':!![]});return _0x20da83['Agents'];});return db[_0x62da('0x37')][_0x62da('0x50')]({'where':{'id':_0x4e866b[_0x62da('0x4e')]['id']}})[_0x62da('0x2d')](function(_0x2e08e6){return db[_0x62da('0x73')][_0x62da('0x74')](function(_0x4dba53){return _0x2e08e6[_0x62da('0x6e')](_0xc9fdc2,{'transaction':_0x4dba53})[_0x62da('0x2d')](function(){return BPromise[_0x62da('0x75')](_0x472df0,function(_0x1a2676){return db[_0x62da('0x5e')]['findOrCreate']({'where':{'UserId':_0x1a2676['id'],'SmsQueueId':_0x4e866b[_0x62da('0x4e')]['id']},'transaction':_0x4dba53});});})[_0x62da('0x2d')](function(){_0x472df0[_0x62da('0x76')](function(_0x58aadc){socket['emit'](_0x62da('0x77'),{'UserId':_0x58aadc['id'],'SmsQueueId':_0x2e08e6['id']});});});});});}})[_0x62da('0x2d')](respondWithStatusCode(_0x5b295b,null))['catch'](handleError(_0x5b295b,null));};exports['removeTeams']=function(_0x2e36be,_0x3fc04e,_0x576c99){return db[_0x62da('0x6d')][_0x62da('0x62')]({'where':{'id':_0x2e36be[_0x62da('0x3b')][_0x62da('0x78')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x62da('0x6f'),'attributes':['id'],'raw':!![]}]})[_0x62da('0x2d')](handleEntityNotFound(_0x3fc04e,null))[_0x62da('0x2d')](function(_0x11b813){var _0x418b55=_[_0x62da('0x36')](_0x11b813,'id');var _0xeb81f4=[];var _0x10e0a3=[];var _0x14c03f=squel['select']();_0x14c03f['field'](_0x62da('0x79'))[_0x62da('0x7a')]('team_has_sms_queues','tq')[_0x62da('0x7b')](_0x62da('0x7c'),'ut',_0x62da('0x7d'))[_0x62da('0x45')]('SmsQueueId\x20=\x20?',_0x2e36be[_0x62da('0x4e')]['id']);for(var _0x233888=0x0;_0x233888<_0x11b813[_0x62da('0x41')];_0x233888+=0x1){let _0x5563a0=_0x11b813[_0x233888];for(var _0x12de2d=0x0;_0x12de2d<_0x5563a0[_0x62da('0x6f')]['length'];_0x12de2d+=0x1){let _0x379657=_0x5563a0[_0x62da('0x6f')][_0x12de2d];var _0x43e71f=_0x14c03f[_0x62da('0x7e')]();_0x43e71f['where']('ut.UserId\x20=\x20?',_0x379657['id']);_0x10e0a3['push'](db['sequelize']['query'](_0x43e71f['toString'](),{'type':db[_0x62da('0x73')][_0x62da('0x7f')][_0x62da('0x80')]})[_0x62da('0x2d')](function(_0x33d3be){if(_0x33d3be[_0x62da('0x41')]===0x1){return _0x379657['id'];}else{var _0x2bbb99=_[_0x62da('0x81')](_[_0x62da('0x36')](_0x33d3be,_0x62da('0x82')),function(_0x335cb5){return _[_0x62da('0x83')](_0x418b55,_0x335cb5);});if(_0x2bbb99){return _0x379657['id'];}}}));}}return BPromise[_0x62da('0x84')](_0x10e0a3)['then'](function(_0x21af37){_0xeb81f4=_(_0xeb81f4)['union'](_0x21af37)['compact']()[_0x62da('0x85')]();return db['SmsQueue'][_0x62da('0x50')]({'where':{'id':_0x2e36be[_0x62da('0x4e')]['id']}})['then'](function(_0x4e1047){return db['sequelize'][_0x62da('0x74')](function(_0x34c380){return _0x4e1047[_0x62da('0x86')](_0x2e36be[_0x62da('0x3b')][_0x62da('0x78')],{'transaction':_0x34c380})['then'](function(){if(!_[_0x62da('0x87')](_0xeb81f4)){return _0x4e1047[_0x62da('0x88')](_0xeb81f4,{'transaction':_0x34c380});}})['then'](function(){_0xeb81f4[_0x62da('0x76')](function(_0x4c1d7b){socket['emit']('userSmsQueue:remove',{'UserId':_0x4c1d7b,'SmsQueueId':_0x4e1047['id']});});});});});});})['then'](respondWithStatusCode(_0x3fc04e,null))['catch'](handleError(_0x3fc04e,null));};exports[_0x62da('0x89')]=function(_0x3a8542,_0x555092,_0x1ac1f5){return db[_0x62da('0x37')]['find']({'where':{'id':_0x3a8542[_0x62da('0x4e')]['id']}})[_0x62da('0x2d')](handleEntityNotFound(_0x555092,null))['then'](function(_0x1f14d5){if(_0x1f14d5){return _0x1f14d5[_0x62da('0x89')](_0x3a8542['body'][_0x62da('0x78')],_['omit'](_0x3a8542[_0x62da('0x53')],[_0x62da('0x78'),'id'])||{})[_0x62da('0x8a')](function(_0xb9ecb5){for(var _0x34cecd=0x0;_0x34cecd<_0x3a8542[_0x62da('0x53')][_0x62da('0x78')]['length'];_0x34cecd+=0x1){socket[_0x62da('0x8b')]('userSmsQueue:save',{'UserId':Number(_0x3a8542[_0x62da('0x53')][_0x62da('0x78')][_0x34cecd]),'SmsQueueId':Number(_0x3a8542[_0x62da('0x4e')]['id'])});}return _0xb9ecb5;});}})[_0x62da('0x2d')](respondWithResult(_0x555092,null))['catch'](handleError(_0x555092,null));};exports['removeAgents']=function(_0x25929f,_0x479619,_0x29e367){return db[_0x62da('0x37')][_0x62da('0x50')]({'where':{'id':_0x25929f['params']['id']}})[_0x62da('0x2d')](handleEntityNotFound(_0x479619,null))[_0x62da('0x2d')](function(_0x25ef2e){if(_0x25ef2e){return _0x25ef2e[_0x62da('0x88')](_0x25929f['query'][_0x62da('0x78')])['then'](function(){if(_['isArray'](_0x25929f[_0x62da('0x3b')]['ids'])){for(var _0x43fd00=0x0;_0x43fd00<_0x25929f[_0x62da('0x3b')]['ids'][_0x62da('0x41')];_0x43fd00+=0x1){socket[_0x62da('0x8b')]('userSmsQueue:remove',{'UserId':Number(_0x25929f[_0x62da('0x3b')][_0x62da('0x78')][_0x43fd00]),'SmsQueueId':Number(_0x25929f[_0x62da('0x4e')]['id'])});}}else{socket[_0x62da('0x8b')]('userSmsQueue:remove',{'UserId':Number(_0x25929f[_0x62da('0x3b')]['ids']),'SmsQueueId':Number(_0x25929f[_0x62da('0x4e')]['id'])});}});}})[_0x62da('0x2d')](respondWithStatusCode(_0x479619,null))[_0x62da('0x51')](handleError(_0x479619,null));};exports[_0x62da('0x8c')]=function(_0x9872c2,_0x9d1fd3,_0x4d6403){var _0x221b01={};var _0x19cdc0={};var _0x427a02;var _0x2ee60d;return db[_0x62da('0x37')][_0x62da('0x5d')]({'where':{'id':_0x9872c2[_0x62da('0x4e')]['id']}})[_0x62da('0x2d')](handleEntityNotFound(_0x9d1fd3,null))[_0x62da('0x2d')](function(_0x59cf70){if(_0x59cf70){_0x427a02=_0x59cf70;_0x19cdc0['model']=_[_0x62da('0x3c')](db[_0x62da('0x63')]['rawAttributes']);_0x19cdc0[_0x62da('0x3b')]=_['keys'](_0x9872c2[_0x62da('0x3b')]);_0x19cdc0[_0x62da('0x3d')]=_[_0x62da('0x3e')](_0x19cdc0[_0x62da('0x3a')],_0x19cdc0['query']);_0x221b01[_0x62da('0x3f')]=_['intersection'](_0x19cdc0[_0x62da('0x3a')],qs[_0x62da('0x40')](_0x9872c2[_0x62da('0x3b')]['fields']));_0x221b01[_0x62da('0x3f')]=_0x221b01['attributes']['length']?_0x221b01[_0x62da('0x3f')]:_0x19cdc0[_0x62da('0x3a')];_0x221b01[_0x62da('0x43')]=qs['sort'](_0x9872c2[_0x62da('0x3b')]['sort']);_0x221b01['where']=qs['filters'](_[_0x62da('0x46')](_0x9872c2[_0x62da('0x3b')],_0x19cdc0[_0x62da('0x3d')]));if(_0x9872c2[_0x62da('0x3b')][_0x62da('0x47')]){_0x221b01[_0x62da('0x45')]=_[_0x62da('0x49')](_0x221b01[_0x62da('0x45')],{'$or':_[_0x62da('0x36')](_0x221b01[_0x62da('0x3f')],function(_0x55f884){var _0x4195d3={};_0x4195d3[_0x55f884]={'$like':'%'+_0x9872c2[_0x62da('0x3b')][_0x62da('0x47')]+'%'};return _0x4195d3;})});}_0x221b01=_['merge']({},_0x221b01,_0x9872c2['options']);return _0x427a02[_0x62da('0x8c')](_0x221b01);}})['then'](function(_0x454b5f){if(_0x454b5f){_0x2ee60d=_0x454b5f[_0x62da('0x41')];if(!_0x9872c2[_0x62da('0x3b')]['hasOwnProperty'](_0x62da('0x60'))){_0x221b01[_0x62da('0x26')]=qs[_0x62da('0x26')](_0x9872c2[_0x62da('0x3b')][_0x62da('0x26')]);_0x221b01[_0x62da('0x24')]=qs['offset'](_0x9872c2['query'][_0x62da('0x24')]);}return _0x427a02[_0x62da('0x8c')](_0x221b01);}})['then'](function(_0xa4f26f){if(_0xa4f26f){return _0xa4f26f?{'count':_0x2ee60d,'rows':_0xa4f26f}:null;}})[_0x62da('0x2d')](respondWithResult(_0x9d1fd3,null))[_0x62da('0x51')](handleError(_0x9d1fd3,null));}; \ No newline at end of file +var _0xcb9c=['to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','limit','count','offset','Content-Range','json','apply','reject','save','update','then','get','SmsQueues','destroy','error','name','send','index','map','SmsQueue','rawAttributes','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','type','VIRTUAL','filter','options','include','findAll','rows','show','params','keys','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','SmsQueueId','UserSmsQueue','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','format','%s/%s','SIP','Team','getTeams','addTeams','ids','Agents','online','voicePause','interface','flatMap','transaction','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','field','tq.TeamId','team_has_sms_queues','join','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','SELECT','every','TeamId','includes','all','union','compact','sequelize','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox'];(function(_0x45cbb9,_0x2b0480){var _0x4bc227=function(_0x3344c){while(--_0x3344c){_0x45cbb9['push'](_0x45cbb9['shift']());}};_0x4bc227(++_0x2b0480);}(_0xcb9c,0x110));var _0xccb9=function(_0x1cd245,_0x2b6a7a){_0x1cd245=_0x1cd245-0x0;var _0x4035cd=_0xcb9c[_0x1cd245];return _0x4035cd;};'use strict';var emlformat=require(_0xccb9('0x0'));var rimraf=require(_0xccb9('0x1'));var zipdir=require(_0xccb9('0x2'));var jsonpatch=require(_0xccb9('0x3'));var rp=require(_0xccb9('0x4'));var moment=require(_0xccb9('0x5'));var BPromise=require(_0xccb9('0x6'));var Mustache=require(_0xccb9('0x7'));var util=require('util');var path=require(_0xccb9('0x8'));var sox=require(_0xccb9('0x9'));var csv=require(_0xccb9('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xccb9('0xb'));var _=require(_0xccb9('0xc'));var squel=require(_0xccb9('0xd'));var crypto=require('crypto');var jsforce=require(_0xccb9('0xe'));var deskjs=require(_0xccb9('0xf'));var toCsv=require(_0xccb9('0xa'));var querystring=require(_0xccb9('0x10'));var Papa=require('papaparse');var Redis=require(_0xccb9('0x11'));var authService=require(_0xccb9('0x12'));var qs=require(_0xccb9('0x13'));var as=require(_0xccb9('0x14'));var hardwareService=require(_0xccb9('0x15'));var logger=require('../../config/logger')(_0xccb9('0x16'));var utils=require(_0xccb9('0x17'));var config=require(_0xccb9('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xccb9('0x19'))['db'];config[_0xccb9('0x1a')]=_[_0xccb9('0x1b')](config[_0xccb9('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xccb9('0x1c'))(new Redis(config[_0xccb9('0x1a')]));require(_0xccb9('0x1d'))[_0xccb9('0x1e')](socket);function respondWithStatusCode(_0x18a535,_0x2e8aed){_0x2e8aed=_0x2e8aed||0xcc;return function(_0x3a369e){if(_0x3a369e){return _0x18a535[_0xccb9('0x1f')](_0x2e8aed);}return _0x18a535[_0xccb9('0x20')](_0x2e8aed)['end']();};}function respondWithResult(_0xbcc64,_0x4359e0){_0x4359e0=_0x4359e0||0xc8;return function(_0x20ff0c){if(_0x20ff0c){return _0xbcc64['status'](_0x4359e0)['json'](_0x20ff0c);}};}function respondWithFilteredResult(_0x2fc874,_0x5a1a87){return function(_0x231b19){if(_0x231b19){var _0x424086=typeof _0x5a1a87['offset']==='undefined'&&typeof _0x5a1a87[_0xccb9('0x21')]==='undefined';var _0x58890f=_0x231b19[_0xccb9('0x22')];var _0x144dc7=_0x424086?0x0:_0x5a1a87[_0xccb9('0x23')];var _0x4574c3=_0x424086?_0x231b19[_0xccb9('0x22')]:_0x5a1a87[_0xccb9('0x23')]+_0x5a1a87[_0xccb9('0x21')];var _0x13f7ec;if(_0x4574c3>=_0x58890f){_0x4574c3=_0x58890f;_0x13f7ec=0xc8;}else{_0x13f7ec=0xce;}_0x2fc874['status'](_0x13f7ec);return _0x2fc874['set'](_0xccb9('0x24'),_0x144dc7+'-'+_0x4574c3+'/'+_0x58890f)[_0xccb9('0x25')](_0x231b19);}return null;};}function patchUpdates(_0x5e3133){return function(_0x3f268f){try{jsonpatch[_0xccb9('0x26')](_0x3f268f,_0x5e3133,!![]);}catch(_0x4c7e71){return BPromise[_0xccb9('0x27')](_0x4c7e71);}return _0x3f268f[_0xccb9('0x28')]();};}function saveUpdates(_0x25d40f,_0x1d52f3){return function(_0x3b89bb){if(_0x3b89bb){return _0x3b89bb[_0xccb9('0x29')](_0x25d40f)[_0xccb9('0x2a')](function(_0x190cd7){return _0x190cd7;});}return null;};}function removeEntity(_0xd8fe42,_0x2e7b82){return function(_0x504eb5){if(_0x504eb5){return _0x504eb5['destroy']()[_0xccb9('0x2a')](function(){var _0x22042f=_0x504eb5[_0xccb9('0x2b')]({'plain':!![]});var _0x1d1011=_0xccb9('0x2c');return db['UserProfileResource'][_0xccb9('0x2d')]({'where':{'type':_0x1d1011,'resourceId':_0x22042f['id']}})[_0xccb9('0x2a')](function(){return _0x504eb5;});})[_0xccb9('0x2a')](function(){_0xd8fe42[_0xccb9('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d9eaf,_0x4fbe14){return function(_0x4bd4f1){if(!_0x4bd4f1){_0x2d9eaf[_0xccb9('0x1f')](0x194);}return _0x4bd4f1;};}function handleError(_0x5a2ef1,_0x358cb8){_0x358cb8=_0x358cb8||0x1f4;return function(_0x289c56){logger[_0xccb9('0x2e')](_0x289c56['stack']);if(_0x289c56['name']){delete _0x289c56[_0xccb9('0x2f')];}_0x5a2ef1[_0xccb9('0x20')](_0x358cb8)[_0xccb9('0x30')](_0x289c56);};}exports[_0xccb9('0x31')]=function(_0x20512d,_0x1d34e2){var _0x35301c={},_0xcdd9a5={},_0x574e27={'count':0x0,'rows':[]};var _0x4dd078=_[_0xccb9('0x32')](db[_0xccb9('0x33')][_0xccb9('0x34')],function(_0x5363cf){return{'name':_0x5363cf['fieldName'],'type':_0x5363cf['type'][_0xccb9('0x35')]};});_0xcdd9a5[_0xccb9('0x36')]=_[_0xccb9('0x32')](_0x4dd078,'name');_0xcdd9a5[_0xccb9('0x37')]=_['keys'](_0x20512d[_0xccb9('0x37')]);_0xcdd9a5['filters']=_[_0xccb9('0x38')](_0xcdd9a5[_0xccb9('0x36')],_0xcdd9a5[_0xccb9('0x37')]);_0x35301c[_0xccb9('0x39')]=_['intersection'](_0xcdd9a5[_0xccb9('0x36')],qs[_0xccb9('0x3a')](_0x20512d['query'][_0xccb9('0x3a')]));_0x35301c['attributes']=_0x35301c[_0xccb9('0x39')][_0xccb9('0x3b')]?_0x35301c[_0xccb9('0x39')]:_0xcdd9a5[_0xccb9('0x36')];if(!_0x20512d[_0xccb9('0x37')][_0xccb9('0x3c')](_0xccb9('0x3d'))){_0x35301c[_0xccb9('0x21')]=qs[_0xccb9('0x21')](_0x20512d[_0xccb9('0x37')][_0xccb9('0x21')]);_0x35301c[_0xccb9('0x23')]=qs[_0xccb9('0x23')](_0x20512d['query'][_0xccb9('0x23')]);}_0x35301c[_0xccb9('0x3e')]=qs[_0xccb9('0x3f')](_0x20512d[_0xccb9('0x37')]['sort']);_0x35301c['where']=qs[_0xccb9('0x40')](_[_0xccb9('0x41')](_0x20512d[_0xccb9('0x37')],_0xcdd9a5['filters']),_0x4dd078);if(_0x20512d[_0xccb9('0x37')]['filter']){_0x35301c[_0xccb9('0x42')]=_[_0xccb9('0x43')](_0x35301c[_0xccb9('0x42')],{'$or':_[_0xccb9('0x32')](_0x4dd078,function(_0x299274){if(_0x299274[_0xccb9('0x44')]!==_0xccb9('0x45')){var _0x5e2855={};_0x5e2855[_0x299274[_0xccb9('0x2f')]]={'$like':'%'+_0x20512d[_0xccb9('0x37')][_0xccb9('0x46')]+'%'};return _0x5e2855;}})});}_0x35301c=_[_0xccb9('0x43')]({},_0x35301c,_0x20512d[_0xccb9('0x47')]);var _0x80422b={'where':_0x35301c[_0xccb9('0x42')]};return db[_0xccb9('0x33')][_0xccb9('0x22')](_0x80422b)[_0xccb9('0x2a')](function(_0x2d626b){_0x574e27[_0xccb9('0x22')]=_0x2d626b;if(_0x20512d[_0xccb9('0x37')]['includeAll']){_0x35301c[_0xccb9('0x48')]=[{'all':!![]}];}return db['SmsQueue'][_0xccb9('0x49')](_0x35301c);})[_0xccb9('0x2a')](function(_0x4a65d8){_0x574e27[_0xccb9('0x4a')]=_0x4a65d8;return _0x574e27;})[_0xccb9('0x2a')](respondWithFilteredResult(_0x1d34e2,_0x35301c))['catch'](handleError(_0x1d34e2,null));};exports[_0xccb9('0x4b')]=function(_0x5f4fc2,_0x553daa){var _0x334839={'raw':!![],'where':{'id':_0x5f4fc2[_0xccb9('0x4c')]['id']}},_0x5069ec={};_0x5069ec[_0xccb9('0x36')]=_['keys'](db[_0xccb9('0x33')][_0xccb9('0x34')]);_0x5069ec['query']=_[_0xccb9('0x4d')](_0x5f4fc2[_0xccb9('0x37')]);_0x5069ec[_0xccb9('0x40')]=_['intersection'](_0x5069ec[_0xccb9('0x36')],_0x5069ec['query']);_0x334839[_0xccb9('0x39')]=_[_0xccb9('0x38')](_0x5069ec[_0xccb9('0x36')],qs[_0xccb9('0x3a')](_0x5f4fc2[_0xccb9('0x37')][_0xccb9('0x3a')]));_0x334839[_0xccb9('0x39')]=_0x334839[_0xccb9('0x39')]['length']?_0x334839[_0xccb9('0x39')]:_0x5069ec[_0xccb9('0x36')];if(_0x5f4fc2[_0xccb9('0x37')]['includeAll']){_0x334839[_0xccb9('0x48')]=[{'all':!![]}];}_0x334839=_[_0xccb9('0x43')]({},_0x334839,_0x5f4fc2[_0xccb9('0x47')]);return db[_0xccb9('0x33')][_0xccb9('0x4e')](_0x334839)[_0xccb9('0x2a')](handleEntityNotFound(_0x553daa,null))[_0xccb9('0x2a')](respondWithResult(_0x553daa,null))[_0xccb9('0x4f')](handleError(_0x553daa,null));};exports[_0xccb9('0x50')]=function(_0x49711c,_0x1d69f9){return db['SmsQueue']['create'](_0x49711c[_0xccb9('0x51')],{})[_0xccb9('0x2a')](function(_0x52286c){var _0xcbc9e3=_0x49711c[_0xccb9('0x52')][_0xccb9('0x2b')]({'plain':!![]});if(!_0xcbc9e3)throw new Error(_0xccb9('0x53'));if(_0xcbc9e3[_0xccb9('0x54')]==='user'){var _0x13280a=_0x52286c[_0xccb9('0x2b')]({'plain':!![]});var _0x1e0e55=_0xccb9('0x2c');return db[_0xccb9('0x55')]['find']({'where':{'name':_0x1e0e55,'userProfileId':_0xcbc9e3['userProfileId']},'raw':!![]})['then'](function(_0x45df4d){if(_0x45df4d&&_0x45df4d[_0xccb9('0x56')]===0x0){return db['UserProfileResource'][_0xccb9('0x50')]({'name':_0x13280a[_0xccb9('0x2f')],'resourceId':_0x13280a['id'],'type':_0x45df4d[_0xccb9('0x2f')],'sectionId':_0x45df4d['id']},{})[_0xccb9('0x2a')](function(){return _0x52286c;});}else{return _0x52286c;}})['catch'](function(_0x42142c){logger[_0xccb9('0x2e')](_0xccb9('0x57'),_0x42142c);throw _0x42142c;});}return _0x52286c;})['then'](respondWithResult(_0x1d69f9,0xc9))[_0xccb9('0x4f')](handleError(_0x1d69f9,null));};exports['update']=function(_0xeb30e3,_0x479258){if(_0xeb30e3[_0xccb9('0x51')]['id']){delete _0xeb30e3[_0xccb9('0x51')]['id'];}return db[_0xccb9('0x33')][_0xccb9('0x4e')]({'where':{'id':_0xeb30e3[_0xccb9('0x4c')]['id']}})[_0xccb9('0x2a')](handleEntityNotFound(_0x479258,null))[_0xccb9('0x2a')](saveUpdates(_0xeb30e3[_0xccb9('0x51')],null))[_0xccb9('0x2a')](respondWithResult(_0x479258,null))[_0xccb9('0x4f')](handleError(_0x479258,null));};exports[_0xccb9('0x2d')]=function(_0x114ae5,_0x5ad6f0){return db['SmsQueue'][_0xccb9('0x4e')]({'where':{'id':_0x114ae5[_0xccb9('0x4c')]['id']}})[_0xccb9('0x2a')](handleEntityNotFound(_0x5ad6f0,null))[_0xccb9('0x2a')](removeEntity(_0x5ad6f0,null))[_0xccb9('0x4f')](handleError(_0x5ad6f0,null));};exports[_0xccb9('0x58')]=function(_0x23f981,_0x2e0643){return db[_0xccb9('0x33')]['describe']()['then'](respondWithResult(_0x2e0643,null))[_0xccb9('0x4f')](handleError(_0x2e0643,null));};exports[_0xccb9('0x59')]=function(_0xcea3b3,_0x2cdbdd,_0x282287){var _0x2387c5={'raw':!![],'where':{}},_0x1f8356={},_0x370589;return db[_0xccb9('0x33')][_0xccb9('0x5a')]({'where':{'id':_0xcea3b3[_0xccb9('0x4c')]['id']}})[_0xccb9('0x2a')](handleEntityNotFound(_0x2cdbdd,null))[_0xccb9('0x2a')](function(_0x3c623b){if(_0x3c623b){_0x370589=_0x3c623b['get']({'plain':!![]});_0x1f8356[_0xccb9('0x36')]=_[_0xccb9('0x4d')](db['UserSmsQueue'][_0xccb9('0x34')]);_0x1f8356[_0xccb9('0x37')]=_[_0xccb9('0x4d')](_0xcea3b3[_0xccb9('0x37')]);_0x1f8356['filters']=_['intersection'](_0x1f8356['model'],_0x1f8356[_0xccb9('0x37')]);_0x2387c5[_0xccb9('0x39')]=_[_0xccb9('0x38')](_0x1f8356[_0xccb9('0x36')],qs[_0xccb9('0x3a')](_0xcea3b3[_0xccb9('0x37')]['fields']));_0x2387c5[_0xccb9('0x39')]=_0x2387c5[_0xccb9('0x39')]['length']?_0x2387c5['attributes']:_0x1f8356[_0xccb9('0x36')];if(!_0xcea3b3[_0xccb9('0x37')][_0xccb9('0x3c')]('nolimit')){_0x2387c5['limit']=qs[_0xccb9('0x21')](_0xcea3b3[_0xccb9('0x37')]['limit']);_0x2387c5[_0xccb9('0x23')]=qs[_0xccb9('0x23')](_0xcea3b3[_0xccb9('0x37')][_0xccb9('0x23')]);}_0x2387c5[_0xccb9('0x3e')]=qs['sort'](_0xcea3b3[_0xccb9('0x37')]['sort']);_0x2387c5[_0xccb9('0x42')]=qs[_0xccb9('0x40')](_['pick'](_0xcea3b3[_0xccb9('0x37')],_0x1f8356[_0xccb9('0x40')]));_0x2387c5['where'][_0xccb9('0x5b')]=_0x3c623b['id'];if(_0xcea3b3['query'][_0xccb9('0x46')]){_0x2387c5[_0xccb9('0x42')]=_[_0xccb9('0x43')](_0x2387c5[_0xccb9('0x42')],{'$or':_['map'](_0x2387c5[_0xccb9('0x39')],function(_0x6a7e72){var _0x4a67b4={};_0x4a67b4[_0x6a7e72]={'$like':'%'+_0xcea3b3['query'][_0xccb9('0x46')]+'%'};return _0x4a67b4;})});}_0x2387c5=_[_0xccb9('0x43')]({},_0x2387c5,_0xcea3b3[_0xccb9('0x47')]);return db[_0xccb9('0x5c')][_0xccb9('0x49')](_0x2387c5);}})[_0xccb9('0x2a')](function(_0x28d04c){if(_0x28d04c){return db[_0xccb9('0x5d')][_0xccb9('0x5e')]({'where':{'id':_[_0xccb9('0x32')](_0x28d04c,_0xccb9('0x5f')),'role':_0xccb9('0x60')},'attributes':['id','name',_0xccb9('0x61'),_0xccb9('0x62'),_0xccb9('0x63')]});}})[_0xccb9('0x2a')](function(_0x2a6ede){if(_0x2a6ede){return{'count':_0x2a6ede['count'],'rows':_[_0xccb9('0x32')](_0x2a6ede[_0xccb9('0x4a')],function(_0x5c0fb3){return{'membername':_0x5c0fb3[_0xccb9('0x2f')],'UserId':_0x5c0fb3['id'],'queue_name':_0x370589['name'],'SmsQueueId':_0x370589['id'],'interface':util[_0xccb9('0x64')](_0xccb9('0x65'),_0xccb9('0x66'),_0x5c0fb3['name']),'penalty':0x0,'paused':_0x5c0fb3[_0xccb9('0x61')],'createdAt':_0x5c0fb3['createdAt'],'updatedAt':_0x5c0fb3[_0xccb9('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x2cdbdd,_0x2387c5))[_0xccb9('0x4f')](handleError(_0x2cdbdd,null));};exports['getTeams']=function(_0x212271,_0x34db93,_0x294034){var _0x410fcb={};var _0x1cf2d6={};var _0x5adb78;var _0x12b96d;return db[_0xccb9('0x33')][_0xccb9('0x5a')]({'where':{'id':_0x212271[_0xccb9('0x4c')]['id']}})[_0xccb9('0x2a')](handleEntityNotFound(_0x34db93,null))[_0xccb9('0x2a')](function(_0xd455b1){if(_0xd455b1){_0x5adb78=_0xd455b1;_0x1cf2d6[_0xccb9('0x36')]=_[_0xccb9('0x4d')](db[_0xccb9('0x67')][_0xccb9('0x34')]);_0x1cf2d6['query']=_[_0xccb9('0x4d')](_0x212271[_0xccb9('0x37')]);_0x1cf2d6[_0xccb9('0x40')]=_[_0xccb9('0x38')](_0x1cf2d6[_0xccb9('0x36')],_0x1cf2d6[_0xccb9('0x37')]);_0x410fcb[_0xccb9('0x39')]=_['intersection'](_0x1cf2d6['model'],qs[_0xccb9('0x3a')](_0x212271['query']['fields']));_0x410fcb[_0xccb9('0x39')]=_0x410fcb[_0xccb9('0x39')][_0xccb9('0x3b')]?_0x410fcb[_0xccb9('0x39')]:_0x1cf2d6[_0xccb9('0x36')];_0x410fcb[_0xccb9('0x3e')]=qs[_0xccb9('0x3f')](_0x212271['query'][_0xccb9('0x3f')]);_0x410fcb[_0xccb9('0x42')]=qs[_0xccb9('0x40')](_[_0xccb9('0x41')](_0x212271[_0xccb9('0x37')],_0x1cf2d6[_0xccb9('0x40')]));if(_0x212271[_0xccb9('0x37')][_0xccb9('0x46')]){_0x410fcb[_0xccb9('0x42')]=_[_0xccb9('0x43')](_0x410fcb[_0xccb9('0x42')],{'$or':_[_0xccb9('0x32')](_0x410fcb['attributes'],function(_0x3d106c){var _0x1fab52={};_0x1fab52[_0x3d106c]={'$like':'%'+_0x212271['query'][_0xccb9('0x46')]+'%'};return _0x1fab52;})});}_0x410fcb=_[_0xccb9('0x43')]({},_0x410fcb,_0x212271['options']);return _0x5adb78[_0xccb9('0x68')](_0x410fcb);}})['then'](function(_0x70c5c9){if(_0x70c5c9){_0x12b96d=_0x70c5c9[_0xccb9('0x3b')];if(!_0x212271[_0xccb9('0x37')][_0xccb9('0x3c')](_0xccb9('0x3d'))){_0x410fcb[_0xccb9('0x21')]=qs[_0xccb9('0x21')](_0x212271['query'][_0xccb9('0x21')]);_0x410fcb[_0xccb9('0x23')]=qs['offset'](_0x212271[_0xccb9('0x37')]['offset']);}return _0x5adb78[_0xccb9('0x68')](_0x410fcb);}})[_0xccb9('0x2a')](function(_0x399e08){if(_0x399e08){return _0x399e08?{'count':_0x12b96d,'rows':_0x399e08}:null;}})[_0xccb9('0x2a')](respondWithResult(_0x34db93,null))[_0xccb9('0x4f')](handleError(_0x34db93,null));};exports[_0xccb9('0x69')]=function(_0x572fa2,_0xcdae81,_0x3ee595){var _0x3f96d9=_0x572fa2[_0xccb9('0x51')][_0xccb9('0x6a')];return db[_0xccb9('0x67')]['findAll']({'where':{'id':_0x3f96d9},'attributes':['id'],'include':[{'model':db[_0xccb9('0x5d')],'as':_0xccb9('0x6b'),'attributes':['id','name',_0xccb9('0x6c'),_0xccb9('0x6d'),_0xccb9('0x6e')],'raw':!![]}]})[_0xccb9('0x2a')](function(_0x6360f6){if(_0x6360f6){var _0x5485eb=_[_0xccb9('0x6f')](_0x6360f6,function(_0x565a52){var _0x2643fd=_0x565a52[_0xccb9('0x2b')]({'plain':!![]});return _0x2643fd[_0xccb9('0x6b')];});return db['SmsQueue'][_0xccb9('0x4e')]({'where':{'id':_0x572fa2[_0xccb9('0x4c')]['id']}})['then'](function(_0x180c6d){return db['sequelize'][_0xccb9('0x70')](function(_0x500be4){return _0x180c6d[_0xccb9('0x69')](_0x3f96d9,{'transaction':_0x500be4})[_0xccb9('0x2a')](function(){return BPromise['each'](_0x5485eb,function(_0x1aa72e){return db[_0xccb9('0x5c')][_0xccb9('0x71')]({'where':{'UserId':_0x1aa72e['id'],'SmsQueueId':_0x572fa2[_0xccb9('0x4c')]['id']},'transaction':_0x500be4});});})[_0xccb9('0x2a')](function(){_0x5485eb[_0xccb9('0x72')](function(_0x473067){socket[_0xccb9('0x73')](_0xccb9('0x74'),{'UserId':_0x473067['id'],'SmsQueueId':_0x180c6d['id']});});});});});}})[_0xccb9('0x2a')](respondWithStatusCode(_0xcdae81,null))[_0xccb9('0x4f')](handleError(_0xcdae81,null));};exports[_0xccb9('0x75')]=function(_0xf29260,_0x4f3b85,_0x586f87){return db[_0xccb9('0x67')][_0xccb9('0x49')]({'where':{'id':_0xf29260['query'][_0xccb9('0x6a')]},'attributes':['id'],'include':[{'model':db[_0xccb9('0x5d')],'as':_0xccb9('0x6b'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4f3b85,null))[_0xccb9('0x2a')](function(_0x221611){var _0x24e631=_[_0xccb9('0x32')](_0x221611,'id');var _0x1da883=[];var _0x50e80a=[];var _0x3392d1=squel['select']();_0x3392d1[_0xccb9('0x76')](_0xccb9('0x77'))['from'](_0xccb9('0x78'),'tq')[_0xccb9('0x79')]('user_has_teams','ut',_0xccb9('0x7a'))['where']('SmsQueueId\x20=\x20?',_0xf29260[_0xccb9('0x4c')]['id']);for(var _0x10e7d5=0x0;_0x10e7d5<_0x221611[_0xccb9('0x3b')];_0x10e7d5+=0x1){let _0x3efb9d=_0x221611[_0x10e7d5];for(var _0xb65668=0x0;_0xb65668<_0x3efb9d[_0xccb9('0x6b')][_0xccb9('0x3b')];_0xb65668+=0x1){let _0x9205ad=_0x3efb9d[_0xccb9('0x6b')][_0xb65668];var _0x341743=_0x3392d1[_0xccb9('0x7b')]();_0x341743[_0xccb9('0x42')](_0xccb9('0x7c'),_0x9205ad['id']);_0x50e80a['push'](db['sequelize'][_0xccb9('0x37')](_0x341743['toString'](),{'type':db['sequelize']['QueryTypes'][_0xccb9('0x7d')]})[_0xccb9('0x2a')](function(_0x5b5449){if(_0x5b5449['length']===0x1){return _0x9205ad['id'];}else{var _0x562bef=_[_0xccb9('0x7e')](_[_0xccb9('0x32')](_0x5b5449,_0xccb9('0x7f')),function(_0x12ddd9){return _[_0xccb9('0x80')](_0x24e631,_0x12ddd9);});if(_0x562bef){return _0x9205ad['id'];}}}));}}return BPromise[_0xccb9('0x81')](_0x50e80a)['then'](function(_0x49eb9c){_0x1da883=_(_0x1da883)[_0xccb9('0x82')](_0x49eb9c)[_0xccb9('0x83')]()['value']();return db[_0xccb9('0x33')]['find']({'where':{'id':_0xf29260['params']['id']}})[_0xccb9('0x2a')](function(_0x341916){return db[_0xccb9('0x84')]['transaction'](function(_0x5e136e){return _0x341916[_0xccb9('0x75')](_0xf29260[_0xccb9('0x37')]['ids'],{'transaction':_0x5e136e})['then'](function(){if(!_[_0xccb9('0x85')](_0x1da883)){return _0x341916[_0xccb9('0x86')](_0x1da883,{'transaction':_0x5e136e});}})['then'](function(){_0x1da883['forEach'](function(_0x4ebf2b){socket[_0xccb9('0x73')](_0xccb9('0x87'),{'UserId':_0x4ebf2b,'SmsQueueId':_0x341916['id']});});});});});});})[_0xccb9('0x2a')](respondWithStatusCode(_0x4f3b85,null))[_0xccb9('0x4f')](handleError(_0x4f3b85,null));};exports['addAgents']=function(_0x58a0f1,_0x2e6ba1,_0x37381b){return db[_0xccb9('0x33')][_0xccb9('0x4e')]({'where':{'id':_0x58a0f1[_0xccb9('0x4c')]['id']}})[_0xccb9('0x2a')](handleEntityNotFound(_0x2e6ba1,null))[_0xccb9('0x2a')](function(_0x3847f2){if(_0x3847f2){return _0x3847f2[_0xccb9('0x88')](_0x58a0f1[_0xccb9('0x51')][_0xccb9('0x6a')],_[_0xccb9('0x89')](_0x58a0f1['body'],[_0xccb9('0x6a'),'id'])||{})[_0xccb9('0x8a')](function(_0x10677d){for(var _0x593632=0x0;_0x593632<_0x58a0f1[_0xccb9('0x51')][_0xccb9('0x6a')][_0xccb9('0x3b')];_0x593632+=0x1){socket[_0xccb9('0x73')](_0xccb9('0x74'),{'UserId':Number(_0x58a0f1[_0xccb9('0x51')][_0xccb9('0x6a')][_0x593632]),'SmsQueueId':Number(_0x58a0f1[_0xccb9('0x4c')]['id'])});}return _0x10677d;});}})['then'](respondWithResult(_0x2e6ba1,null))['catch'](handleError(_0x2e6ba1,null));};exports[_0xccb9('0x86')]=function(_0x51869a,_0x58825b,_0x579823){return db[_0xccb9('0x33')][_0xccb9('0x4e')]({'where':{'id':_0x51869a[_0xccb9('0x4c')]['id']}})[_0xccb9('0x2a')](handleEntityNotFound(_0x58825b,null))[_0xccb9('0x2a')](function(_0x9e5747){if(_0x9e5747){return _0x9e5747[_0xccb9('0x86')](_0x51869a[_0xccb9('0x37')][_0xccb9('0x6a')])[_0xccb9('0x2a')](function(){if(_[_0xccb9('0x8b')](_0x51869a[_0xccb9('0x37')][_0xccb9('0x6a')])){for(var _0x5ec380=0x0;_0x5ec380<_0x51869a[_0xccb9('0x37')][_0xccb9('0x6a')][_0xccb9('0x3b')];_0x5ec380+=0x1){socket['emit'](_0xccb9('0x87'),{'UserId':Number(_0x51869a[_0xccb9('0x37')][_0xccb9('0x6a')][_0x5ec380]),'SmsQueueId':Number(_0x51869a['params']['id'])});}}else{socket[_0xccb9('0x73')](_0xccb9('0x87'),{'UserId':Number(_0x51869a['query'][_0xccb9('0x6a')]),'SmsQueueId':Number(_0x51869a[_0xccb9('0x4c')]['id'])});}});}})[_0xccb9('0x2a')](respondWithStatusCode(_0x58825b,null))['catch'](handleError(_0x58825b,null));};exports[_0xccb9('0x8c')]=function(_0x25f7f1,_0x430b0c,_0x5b1bf9){var _0x1574ae={};var _0x2f19f3={};var _0x48c249;var _0x4de355;return db[_0xccb9('0x33')][_0xccb9('0x5a')]({'where':{'id':_0x25f7f1[_0xccb9('0x4c')]['id']}})[_0xccb9('0x2a')](handleEntityNotFound(_0x430b0c,null))[_0xccb9('0x2a')](function(_0x26eef0){if(_0x26eef0){_0x48c249=_0x26eef0;_0x2f19f3[_0xccb9('0x36')]=_['keys'](db[_0xccb9('0x5d')][_0xccb9('0x34')]);_0x2f19f3[_0xccb9('0x37')]=_[_0xccb9('0x4d')](_0x25f7f1['query']);_0x2f19f3[_0xccb9('0x40')]=_[_0xccb9('0x38')](_0x2f19f3[_0xccb9('0x36')],_0x2f19f3[_0xccb9('0x37')]);_0x1574ae[_0xccb9('0x39')]=_[_0xccb9('0x38')](_0x2f19f3[_0xccb9('0x36')],qs[_0xccb9('0x3a')](_0x25f7f1['query']['fields']));_0x1574ae[_0xccb9('0x39')]=_0x1574ae['attributes'][_0xccb9('0x3b')]?_0x1574ae['attributes']:_0x2f19f3[_0xccb9('0x36')];_0x1574ae[_0xccb9('0x3e')]=qs['sort'](_0x25f7f1[_0xccb9('0x37')][_0xccb9('0x3f')]);_0x1574ae['where']=qs[_0xccb9('0x40')](_['pick'](_0x25f7f1[_0xccb9('0x37')],_0x2f19f3[_0xccb9('0x40')]));if(_0x25f7f1[_0xccb9('0x37')][_0xccb9('0x46')]){_0x1574ae['where']=_['merge'](_0x1574ae[_0xccb9('0x42')],{'$or':_[_0xccb9('0x32')](_0x1574ae[_0xccb9('0x39')],function(_0x3292ce){var _0x5c82be={};_0x5c82be[_0x3292ce]={'$like':'%'+_0x25f7f1[_0xccb9('0x37')][_0xccb9('0x46')]+'%'};return _0x5c82be;})});}_0x1574ae=_[_0xccb9('0x43')]({},_0x1574ae,_0x25f7f1[_0xccb9('0x47')]);return _0x48c249['getAgents'](_0x1574ae);}})[_0xccb9('0x2a')](function(_0x260cd1){if(_0x260cd1){_0x4de355=_0x260cd1['length'];if(!_0x25f7f1[_0xccb9('0x37')]['hasOwnProperty']('nolimit')){_0x1574ae[_0xccb9('0x21')]=qs[_0xccb9('0x21')](_0x25f7f1[_0xccb9('0x37')][_0xccb9('0x21')]);_0x1574ae[_0xccb9('0x23')]=qs[_0xccb9('0x23')](_0x25f7f1[_0xccb9('0x37')][_0xccb9('0x23')]);}return _0x48c249[_0xccb9('0x8c')](_0x1574ae);}})[_0xccb9('0x2a')](function(_0x2d0e2e){if(_0x2d0e2e){return _0x2d0e2e?{'count':_0x4de355,'rows':_0x2d0e2e}:null;}})['then'](respondWithResult(_0x430b0c,null))[_0xccb9('0x4f')](handleError(_0x430b0c,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index fffdf35..3dc22c5 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 _0x27b0=['../../mysqldb','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x50e07,_0x1879a7){var _0x2ac2db=function(_0x17c30c){while(--_0x17c30c){_0x50e07['push'](_0x50e07['shift']());}};_0x2ac2db(++_0x1879a7);}(_0x27b0,0x194));var _0x027b=function(_0x3fd4b3,_0x17d3ef){_0x3fd4b3=_0x3fd4b3-0x0;var _0x2979a3=_0x27b0[_0x3fd4b3];return _0x2979a3;};'use strict';var EventEmitter=require(_0x027b('0x0'));var SmsQueue=require(_0x027b('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x027b('0x2'),'afterUpdate':_0x027b('0x3'),'afterDestroy':_0x027b('0x4')};function emitEvent(_0x2a0f4f){return function(_0xab0822,_0x1ff397,_0x5456e5){SmsQueueEvents[_0x027b('0x5')](_0x2a0f4f+':'+_0xab0822['id'],_0xab0822);SmsQueueEvents[_0x027b('0x5')](_0x2a0f4f,_0xab0822);_0x5456e5(null);};}for(var e in events){if(events[_0x027b('0x6')](e)){var event=events[e];SmsQueue[_0x027b('0x7')](e,emitEvent(event));}}module[_0x027b('0x8')]=SmsQueueEvents; \ No newline at end of file +var _0x46d4=['hook','exports','events','../../mysqldb','SmsQueue','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x42ee5f,_0x4b5dc4){var _0x20fa26=function(_0x2eeb31){while(--_0x2eeb31){_0x42ee5f['push'](_0x42ee5f['shift']());}};_0x20fa26(++_0x4b5dc4);}(_0x46d4,0x1a6));var _0x446d=function(_0x3d1d3a,_0x42a74f){_0x3d1d3a=_0x3d1d3a-0x0;var _0x13151d=_0x46d4[_0x3d1d3a];return _0x13151d;};'use strict';var EventEmitter=require(_0x446d('0x0'));var SmsQueue=require(_0x446d('0x1'))['db'][_0x446d('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x446d('0x3')](0x0);var events={'afterCreate':_0x446d('0x4'),'afterUpdate':_0x446d('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5aa9e5){return function(_0x45dba2,_0x151054,_0x4ae4d3){SmsQueueEvents[_0x446d('0x6')](_0x5aa9e5+':'+_0x45dba2['id'],_0x45dba2);SmsQueueEvents[_0x446d('0x6')](_0x5aa9e5,_0x45dba2);_0x4ae4d3(null);};}for(var e in events){if(events[_0x446d('0x7')](e)){var event=events[e];SmsQueue[_0x446d('0x8')](e,emitEvent(event));}}module[_0x446d('0x9')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 991f141..51ae5a0 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 _0x74cc=['./smsQueue.attributes','define','SmsQueue','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x4af77d,_0x532ba8){var _0x5e49e2=function(_0x194ea4){while(--_0x194ea4){_0x4af77d['push'](_0x4af77d['shift']());}};_0x5e49e2(++_0x532ba8);}(_0x74cc,0x184));var _0xc74c=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x74cc[_0x3ab9ee];return _0x82ee88;};'use strict';var _=require(_0xc74c('0x0'));var util=require(_0xc74c('0x1'));var logger=require(_0xc74c('0x2'))(_0xc74c('0x3'));var moment=require(_0xc74c('0x4'));var BPromise=require('bluebird');var rp=require(_0xc74c('0x5'));var fs=require('fs');var path=require(_0xc74c('0x6'));var rimraf=require(_0xc74c('0x7'));var config=require('../../config/environment');var attributes=require(_0xc74c('0x8'));module['exports']=function(_0x3ce047,_0x1ab770){return _0x3ce047[_0xc74c('0x9')](_0xc74c('0xa'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x325e=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','exports','SmsQueue','lodash','../../config/logger','api'];(function(_0x3d9c00,_0x1f2bc4){var _0x4c9c29=function(_0x171a91){while(--_0x171a91){_0x3d9c00['push'](_0x3d9c00['shift']());}};_0x4c9c29(++_0x1f2bc4);}(_0x325e,0x99));var _0xe325=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x325e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe325('0x0'));var util=require('util');var logger=require(_0xe325('0x1'))(_0xe325('0x2'));var moment=require(_0xe325('0x3'));var BPromise=require(_0xe325('0x4'));var rp=require(_0xe325('0x5'));var fs=require('fs');var path=require(_0xe325('0x6'));var rimraf=require(_0xe325('0x7'));var config=require(_0xe325('0x8'));var attributes=require(_0xe325('0x9'));module[_0xe325('0xa')]=function(_0x118a4e,_0x18d980){return _0x118a4e['define'](_0xe325('0xb'),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 e7e9f98..2084529 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 _0x5cb3=['attributes','include','map','model','catch','ShowSmsQueue','SmsQueue','find','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','GetSmsQueue','findAll','raw','options','where'];(function(_0x4de41b,_0x21861c){var _0x49dc95=function(_0x2cd7da){while(--_0x2cd7da){_0x4de41b['push'](_0x4de41b['shift']());}};_0x49dc95(++_0x21861c);}(_0x5cb3,0x112));var _0x35cb=function(_0x5e3086,_0x5c371a){_0x5e3086=_0x5e3086-0x0;var _0x5595ff=_0x5cb3[_0x5e3086];return _0x5595ff;};'use strict';var _=require('lodash');var util=require(_0x35cb('0x0'));var moment=require(_0x35cb('0x1'));var BPromise=require('bluebird');var rs=require(_0x35cb('0x2'));var fs=require('fs');var Redis=require(_0x35cb('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x35cb('0x4'))(_0x35cb('0x5'));var config=require(_0x35cb('0x6'));var jayson=require(_0x35cb('0x7'));var client=jayson[_0x35cb('0x8')][_0x35cb('0x9')]({'port':0x232a});config[_0x35cb('0xa')]=_['defaults'](config[_0x35cb('0xa')],{'host':_0x35cb('0xb'),'port':0x18eb});var socket=require(_0x35cb('0xc'))(new Redis(config[_0x35cb('0xa')]));require(_0x35cb('0xd'))[_0x35cb('0xe')](socket);function respondWithRpcPromise(_0x5d85e8,_0x5e0a3a,_0xa2e0e2){return new BPromise(function(_0xbb7d32,_0x4623dd){return client[_0x35cb('0xf')](_0x5d85e8,_0xa2e0e2)[_0x35cb('0x10')](function(_0x59f332){logger[_0x35cb('0x11')](_0x35cb('0x12'),_0x5e0a3a,_0x35cb('0x13'));logger[_0x35cb('0x14')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x5e0a3a,'request\x20sent',JSON[_0x35cb('0x15')](_0x59f332));if(_0x59f332[_0x35cb('0x16')]){if(_0x59f332[_0x35cb('0x16')][_0x35cb('0x17')]===0x1f4){logger[_0x35cb('0x16')](_0x35cb('0x12'),_0x5e0a3a,_0x59f332[_0x35cb('0x16')][_0x35cb('0x18')]);return _0x4623dd(_0x59f332['error']['message']);}logger['error'](_0x35cb('0x12'),_0x5e0a3a,_0x59f332['error']['message']);return _0xbb7d32(_0x59f332[_0x35cb('0x16')][_0x35cb('0x18')]);}else{logger[_0x35cb('0x11')](_0x35cb('0x12'),_0x5e0a3a,_0x35cb('0x13'));_0xbb7d32(_0x59f332['result'][_0x35cb('0x18')]);}})['catch'](function(_0x18a922){logger['error']('SmsQueue,\x20%s,\x20%s',_0x5e0a3a,_0x18a922);_0x4623dd(_0x18a922);});});}exports[_0x35cb('0x19')]=function(_0x1e0012){var _0x2d4752=this;return new Promise(function(_0x5cfece,_0x52107a){return db['SmsQueue'][_0x35cb('0x1a')]({'raw':_0x1e0012['options']?_0x1e0012['options'][_0x35cb('0x1b')]===undefined?!![]:![]:!![],'where':_0x1e0012['options']?_0x1e0012[_0x35cb('0x1c')][_0x35cb('0x1d')]||null:null,'attributes':_0x1e0012[_0x35cb('0x1c')]?_0x1e0012[_0x35cb('0x1c')][_0x35cb('0x1e')]||null:null,'limit':_0x1e0012[_0x35cb('0x1c')]?_0x1e0012[_0x35cb('0x1c')]['limit']||null:null,'include':_0x1e0012[_0x35cb('0x1c')]?_0x1e0012['options'][_0x35cb('0x1f')]?_[_0x35cb('0x20')](_0x1e0012[_0x35cb('0x1c')][_0x35cb('0x1f')],function(_0x222594){return{'model':db[_0x222594['model']],'as':_0x222594['as'],'attributes':_0x222594[_0x35cb('0x1e')],'include':_0x222594[_0x35cb('0x1f')]?_[_0x35cb('0x20')](_0x222594[_0x35cb('0x1f')],function(_0x31235b){return{'model':db[_0x31235b[_0x35cb('0x21')]],'as':_0x31235b['as'],'attributes':_0x31235b[_0x35cb('0x1e')],'include':_0x31235b['include']?_[_0x35cb('0x20')](_0x31235b[_0x35cb('0x1f')],function(_0x342508){return{'model':db[_0x342508['model']],'as':_0x342508['as'],'attributes':_0x342508[_0x35cb('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3221cf){logger[_0x35cb('0x11')](_0x35cb('0x19'),_0x1e0012);logger['debug'](_0x35cb('0x19'),_0x1e0012,JSON[_0x35cb('0x15')](_0x3221cf));_0x5cfece(_0x3221cf);})[_0x35cb('0x22')](function(_0x212b33){logger[_0x35cb('0x16')](_0x35cb('0x19'),_0x212b33[_0x35cb('0x18')],_0x1e0012);_0x52107a(_0x2d4752[_0x35cb('0x16')](0x1f4,_0x212b33[_0x35cb('0x18')]));});});};exports[_0x35cb('0x23')]=function(_0xce4b66){var _0x392a4f=this;return new Promise(function(_0xcdc5f2,_0x1f48f5){return db[_0x35cb('0x24')][_0x35cb('0x25')]({'raw':_0xce4b66['options']?_0xce4b66['options']['raw']===undefined?!![]:![]:!![],'where':_0xce4b66[_0x35cb('0x1c')]?_0xce4b66[_0x35cb('0x1c')][_0x35cb('0x1d')]||null:null,'attributes':_0xce4b66[_0x35cb('0x1c')]?_0xce4b66[_0x35cb('0x1c')][_0x35cb('0x1e')]||null:null,'include':_0xce4b66[_0x35cb('0x1c')]?_0xce4b66[_0x35cb('0x1c')][_0x35cb('0x1f')]?_['map'](_0xce4b66[_0x35cb('0x1c')][_0x35cb('0x1f')],function(_0xf2e3cf){return{'model':db[_0xf2e3cf[_0x35cb('0x21')]],'as':_0xf2e3cf['as'],'attributes':_0xf2e3cf[_0x35cb('0x1e')],'include':_0xf2e3cf[_0x35cb('0x1f')]?_[_0x35cb('0x20')](_0xf2e3cf['include'],function(_0x5a1b42){return{'model':db[_0x5a1b42[_0x35cb('0x21')]],'as':_0x5a1b42['as'],'attributes':_0x5a1b42[_0x35cb('0x1e')],'include':_0x5a1b42['include']?_[_0x35cb('0x20')](_0x5a1b42[_0x35cb('0x1f')],function(_0x3a27f3){return{'model':db[_0x3a27f3['model']],'as':_0x3a27f3['as'],'attributes':_0x3a27f3['attributes']};}):[]};}):[]};}):[]:[]})[_0x35cb('0x10')](function(_0x2f6af9){logger[_0x35cb('0x11')](_0x35cb('0x23'),_0xce4b66);logger[_0x35cb('0x14')](_0x35cb('0x23'),_0xce4b66,JSON[_0x35cb('0x15')](_0x2f6af9));_0xcdc5f2(_0x2f6af9);})['catch'](function(_0x4465c0){logger[_0x35cb('0x16')](_0x35cb('0x23'),_0x4465c0[_0x35cb('0x18')],_0xce4b66);_0x1f48f5(_0x392a4f[_0x35cb('0x16')](0x1f4,_0x4465c0[_0x35cb('0x18')]));});});}; \ No newline at end of file +var _0xb13f=['find','where','map','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','http','redis','defaults','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','attributes','limit','model','include','then','ShowSmsQueue'];(function(_0x48b41d,_0x2f433f){var _0x10732e=function(_0x506329){while(--_0x506329){_0x48b41d['push'](_0x48b41d['shift']());}};_0x10732e(++_0x2f433f);}(_0xb13f,0xf3));var _0xfb13=function(_0x39d58b,_0x1248c2){_0x39d58b=_0x39d58b-0x0;var _0x3846fe=_0xb13f[_0x39d58b];return _0x3846fe;};'use strict';var _=require('lodash');var util=require(_0xfb13('0x0'));var moment=require(_0xfb13('0x1'));var BPromise=require(_0xfb13('0x2'));var rs=require(_0xfb13('0x3'));var fs=require('fs');var Redis=require(_0xfb13('0x4'));var db=require(_0xfb13('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xfb13('0x6'));var jayson=require(_0xfb13('0x7'));var client=jayson['client'][_0xfb13('0x8')]({'port':0x232a});config[_0xfb13('0x9')]=_[_0xfb13('0xa')](config[_0xfb13('0x9')],{'host':_0xfb13('0xb'),'port':0x18eb});var socket=require(_0xfb13('0xc'))(new Redis(config[_0xfb13('0x9')]));require(_0xfb13('0xd'))['register'](socket);function respondWithRpcPromise(_0x87b086,_0x3a34b6,_0x2f8c16){return new BPromise(function(_0x305a7a,_0x39289c){return client[_0xfb13('0xe')](_0x87b086,_0x2f8c16)['then'](function(_0x218d12){logger[_0xfb13('0xf')](_0xfb13('0x10'),_0x3a34b6,_0xfb13('0x11'));logger[_0xfb13('0x12')](_0xfb13('0x13'),_0x3a34b6,_0xfb13('0x11'),JSON[_0xfb13('0x14')](_0x218d12));if(_0x218d12[_0xfb13('0x15')]){if(_0x218d12[_0xfb13('0x15')][_0xfb13('0x16')]===0x1f4){logger[_0xfb13('0x15')](_0xfb13('0x10'),_0x3a34b6,_0x218d12['error']['message']);return _0x39289c(_0x218d12[_0xfb13('0x15')][_0xfb13('0x17')]);}logger['error']('SmsQueue,\x20%s,\x20%s',_0x3a34b6,_0x218d12['error'][_0xfb13('0x17')]);return _0x305a7a(_0x218d12[_0xfb13('0x15')][_0xfb13('0x17')]);}else{logger[_0xfb13('0xf')](_0xfb13('0x10'),_0x3a34b6,_0xfb13('0x11'));_0x305a7a(_0x218d12[_0xfb13('0x18')][_0xfb13('0x17')]);}})[_0xfb13('0x19')](function(_0x37acc2){logger['error'](_0xfb13('0x10'),_0x3a34b6,_0x37acc2);_0x39289c(_0x37acc2);});});}exports[_0xfb13('0x1a')]=function(_0x3598d1){var _0x10f507=this;return new Promise(function(_0x599b24,_0x256a17){return db[_0xfb13('0x1b')][_0xfb13('0x1c')]({'raw':_0x3598d1['options']?_0x3598d1[_0xfb13('0x1d')][_0xfb13('0x1e')]===undefined?!![]:![]:!![],'where':_0x3598d1['options']?_0x3598d1[_0xfb13('0x1d')]['where']||null:null,'attributes':_0x3598d1[_0xfb13('0x1d')]?_0x3598d1[_0xfb13('0x1d')][_0xfb13('0x1f')]||null:null,'limit':_0x3598d1[_0xfb13('0x1d')]?_0x3598d1['options'][_0xfb13('0x20')]||null:null,'include':_0x3598d1[_0xfb13('0x1d')]?_0x3598d1[_0xfb13('0x1d')]['include']?_['map'](_0x3598d1[_0xfb13('0x1d')]['include'],function(_0x73e278){return{'model':db[_0x73e278[_0xfb13('0x21')]],'as':_0x73e278['as'],'attributes':_0x73e278[_0xfb13('0x1f')],'include':_0x73e278['include']?_['map'](_0x73e278[_0xfb13('0x22')],function(_0x5cd4bc){return{'model':db[_0x5cd4bc[_0xfb13('0x21')]],'as':_0x5cd4bc['as'],'attributes':_0x5cd4bc['attributes'],'include':_0x5cd4bc[_0xfb13('0x22')]?_['map'](_0x5cd4bc[_0xfb13('0x22')],function(_0x6121f3){return{'model':db[_0x6121f3[_0xfb13('0x21')]],'as':_0x6121f3['as'],'attributes':_0x6121f3[_0xfb13('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xfb13('0x23')](function(_0x5a2387){logger[_0xfb13('0xf')](_0xfb13('0x1a'),_0x3598d1);logger[_0xfb13('0x12')](_0xfb13('0x1a'),_0x3598d1,JSON['stringify'](_0x5a2387));_0x599b24(_0x5a2387);})['catch'](function(_0x12913c){logger['error'](_0xfb13('0x1a'),_0x12913c[_0xfb13('0x17')],_0x3598d1);_0x256a17(_0x10f507[_0xfb13('0x15')](0x1f4,_0x12913c['message']));});});};exports[_0xfb13('0x24')]=function(_0x1afca0){var _0x8fa13d=this;return new Promise(function(_0x3c110f,_0xda4afc){return db[_0xfb13('0x1b')][_0xfb13('0x25')]({'raw':_0x1afca0[_0xfb13('0x1d')]?_0x1afca0[_0xfb13('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x1afca0[_0xfb13('0x1d')]?_0x1afca0[_0xfb13('0x1d')][_0xfb13('0x26')]||null:null,'attributes':_0x1afca0[_0xfb13('0x1d')]?_0x1afca0['options']['attributes']||null:null,'include':_0x1afca0[_0xfb13('0x1d')]?_0x1afca0[_0xfb13('0x1d')][_0xfb13('0x22')]?_[_0xfb13('0x27')](_0x1afca0[_0xfb13('0x1d')][_0xfb13('0x22')],function(_0x252d58){return{'model':db[_0x252d58['model']],'as':_0x252d58['as'],'attributes':_0x252d58[_0xfb13('0x1f')],'include':_0x252d58['include']?_['map'](_0x252d58['include'],function(_0x3d95bf){return{'model':db[_0x3d95bf[_0xfb13('0x21')]],'as':_0x3d95bf['as'],'attributes':_0x3d95bf['attributes'],'include':_0x3d95bf[_0xfb13('0x22')]?_[_0xfb13('0x27')](_0x3d95bf[_0xfb13('0x22')],function(_0x20f532){return{'model':db[_0x20f532[_0xfb13('0x21')]],'as':_0x20f532['as'],'attributes':_0x20f532[_0xfb13('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2a6600){logger[_0xfb13('0xf')](_0xfb13('0x24'),_0x1afca0);logger['debug'](_0xfb13('0x24'),_0x1afca0,JSON[_0xfb13('0x14')](_0x2a6600));_0x3c110f(_0x2a6600);})[_0xfb13('0x19')](function(_0x1085c3){logger[_0xfb13('0x15')](_0xfb13('0x24'),_0x1085c3[_0xfb13('0x17')],_0x1afca0);_0xda4afc(_0x8fa13d[_0xfb13('0x15')](0x1f4,_0x1085c3[_0xfb13('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 88315ae..5606385 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 _0x078f=['save','remove','update','emit','removeListener','register','length','smsQueue:'];(function(_0x2962d5,_0x38deda){var _0x273406=function(_0x3e0775){while(--_0x3e0775){_0x2962d5['push'](_0x2962d5['shift']());}};_0x273406(++_0x38deda);}(_0x078f,0x78));var _0xf078=function(_0x346df0,_0x475c3e){_0x346df0=_0x346df0-0x0;var _0x2b0187=_0x078f[_0x346df0];return _0x2b0187;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0xf078('0x0'),_0xf078('0x1'),_0xf078('0x2')];function createListener(_0x251e42,_0x53df69){return function(_0x3098a5){_0x53df69[_0xf078('0x3')](_0x251e42,_0x3098a5);};}function removeListener(_0x4ab165,_0x56d0df){return function(){SmsQueueEvents[_0xf078('0x4')](_0x4ab165,_0x56d0df);};}exports[_0xf078('0x5')]=function(_0x4bb4c4){for(var _0x3f0afc=0x0,_0x205b81=events[_0xf078('0x6')];_0x3f0afc<_0x205b81;_0x3f0afc++){var _0x376ad6=events[_0x3f0afc];var _0x2d904a=createListener(_0xf078('0x7')+_0x376ad6,_0x4bb4c4);SmsQueueEvents['on'](_0x376ad6,_0x2d904a);}}; \ No newline at end of file +var _0x02b6=['register','smsQueue:','./smsQueue.events','update','emit','removeListener'];(function(_0x2975c8,_0x5efae2){var _0x256a9b=function(_0x1f974a){while(--_0x1f974a){_0x2975c8['push'](_0x2975c8['shift']());}};_0x256a9b(++_0x5efae2);}(_0x02b6,0x1b2));var _0x602b=function(_0xbbad51,_0x1f7330){_0xbbad51=_0xbbad51-0x0;var _0x177006=_0x02b6[_0xbbad51];return _0x177006;};'use strict';var SmsQueueEvents=require(_0x602b('0x0'));var events=['save','remove',_0x602b('0x1')];function createListener(_0x4d029e,_0x207a8b){return function(_0x14e92d){_0x207a8b[_0x602b('0x2')](_0x4d029e,_0x14e92d);};}function removeListener(_0x56bb92,_0x267b70){return function(){SmsQueueEvents[_0x602b('0x3')](_0x56bb92,_0x267b70);};}exports[_0x602b('0x4')]=function(_0x3dfaff){for(var _0x154275=0x0,_0x3441e3=events['length'];_0x154275<_0x3441e3;_0x154275++){var _0x2d019c=events[_0x154275];var _0x4f0287=createListener(_0x602b('0x5')+_0x2d019c,_0x3dfaff);SmsQueueEvents['on'](_0x2d019c,_0x4f0287);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 3f45056..52c3875 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 _0xc92f=['create','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','post'];(function(_0x5aad8b,_0x3096a3){var _0x3ab02b=function(_0x3562f9){while(--_0x3562f9){_0x5aad8b['push'](_0x5aad8b['shift']());}};_0x3ab02b(++_0x3096a3);}(_0xc92f,0xf3));var _0xfc92=function(_0x5ac674,_0x313fb7){_0x5ac674=_0x5ac674-0x0;var _0x1e9144=_0xc92f[_0x5ac674];return _0x1e9144;};'use strict';var multer=require(_0xfc92('0x0'));var util=require(_0xfc92('0x1'));var path=require('path');var timeout=require(_0xfc92('0x2'));var express=require(_0xfc92('0x3'));var router=express[_0xfc92('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xfc92('0x5'));var interaction=require(_0xfc92('0x6'));var config=require(_0xfc92('0x7'));var controller=require('./smsQueueReport.controller');router['get']('/',auth[_0xfc92('0x8')](),controller['index']);router[_0xfc92('0x9')]('/describe',auth[_0xfc92('0x8')](),controller['describe']);router[_0xfc92('0x9')](_0xfc92('0xa'),auth[_0xfc92('0x8')](),controller['show']);router[_0xfc92('0xb')]('/',auth[_0xfc92('0x8')](),controller[_0xfc92('0xc')]);router['put'](_0xfc92('0xa'),auth[_0xfc92('0x8')](),controller[_0xfc92('0xd')]);router[_0xfc92('0xe')](_0xfc92('0xa'),auth[_0xfc92('0x8')](),controller[_0xfc92('0xf')]);module[_0xfc92('0x10')]=router; \ No newline at end of file +var _0xee3c=['show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0xee3c,0x14a));var _0xcee3=function(_0x9b509b,_0x388386){_0x9b509b=_0x9b509b-0x0;var _0x1b600d=_0xee3c[_0x9b509b];return _0x1b600d;};'use strict';var multer=require(_0xcee3('0x0'));var util=require(_0xcee3('0x1'));var path=require(_0xcee3('0x2'));var timeout=require(_0xcee3('0x3'));var express=require(_0xcee3('0x4'));var router=express[_0xcee3('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xcee3('0x6'));var config=require(_0xcee3('0x7'));var controller=require(_0xcee3('0x8'));router[_0xcee3('0x9')]('/',auth[_0xcee3('0xa')](),controller[_0xcee3('0xb')]);router[_0xcee3('0x9')](_0xcee3('0xc'),auth[_0xcee3('0xa')](),controller[_0xcee3('0xd')]);router[_0xcee3('0x9')](_0xcee3('0xe'),auth[_0xcee3('0xa')](),controller[_0xcee3('0xf')]);router[_0xcee3('0x10')]('/',auth['isAuthenticated'](),controller[_0xcee3('0x11')]);router[_0xcee3('0x12')](_0xcee3('0xe'),auth[_0xcee3('0xa')](),controller[_0xcee3('0x13')]);router[_0xcee3('0x14')]('/:id',auth[_0xcee3('0xa')](),controller[_0xcee3('0x15')]);module[_0xcee3('0x16')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index ccb4032..8849ec0 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 _0x055c=['STRING','DATE','sequelize','exports'];(function(_0x4233a2,_0x478e28){var _0x1c420e=function(_0x10b59e){while(--_0x10b59e){_0x4233a2['push'](_0x4233a2['shift']());}};_0x1c420e(++_0x478e28);}(_0x055c,0x1ee));var _0xc055=function(_0x5a5395,_0x5361f6){_0x5a5395=_0x5a5395-0x0;var _0x4da43d=_0x055c[_0x5a5395];return _0x4da43d;};'use strict';var moment=require('moment');var Sequelize=require(_0xc055('0x0'));module[_0xc055('0x1')]={'uniqueid':{'type':Sequelize[_0xc055('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xc055('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xc055('0x3')]},'acceptAt':{'type':Sequelize[_0xc055('0x3')]},'exitAt':{'type':Sequelize[_0xc055('0x3')]},'reason':{'type':Sequelize[_0xc055('0x2')]}}; \ No newline at end of file +var _0x30c6=['moment','sequelize','exports','STRING','DATE'];(function(_0x50f7b4,_0x21a727){var _0x410e70=function(_0x2e3575){while(--_0x2e3575){_0x50f7b4['push'](_0x50f7b4['shift']());}};_0x410e70(++_0x21a727);}(_0x30c6,0x15e));var _0x630c=function(_0x2cc65b,_0x2c9fb4){_0x2cc65b=_0x2cc65b-0x0;var _0x472b34=_0x30c6[_0x2cc65b];return _0x472b34;};'use strict';var moment=require(_0x630c('0x0'));var Sequelize=require(_0x630c('0x1'));module[_0x630c('0x2')]={'uniqueid':{'type':Sequelize[_0x630c('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x630c('0x3')]},'joinAt':{'type':Sequelize[_0x630c('0x4')]},'leaveAt':{'type':Sequelize[_0x630c('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x630c('0x4')]},'reason':{'type':Sequelize[_0x630c('0x3')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index d5924eb..7fe20d1 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 _0x58e4=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','error','stack','index','map','SmsQueueReport','rawAttributes','fieldName','model','name','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','keys','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','lodash','squel','crypto','jsforce'];(function(_0xba2c67,_0x36c80a){var _0x51050b=function(_0x2351fc){while(--_0x2351fc){_0xba2c67['push'](_0xba2c67['shift']());}};_0x51050b(++_0x36c80a);}(_0x58e4,0x11e));var _0x458e=function(_0x474568,_0x231687){_0x474568=_0x474568-0x0;var _0x3b39e0=_0x58e4[_0x474568];return _0x3b39e0;};'use strict';var emlformat=require(_0x458e('0x0'));var rimraf=require(_0x458e('0x1'));var zipdir=require(_0x458e('0x2'));var jsonpatch=require(_0x458e('0x3'));var rp=require(_0x458e('0x4'));var moment=require(_0x458e('0x5'));var BPromise=require(_0x458e('0x6'));var Mustache=require(_0x458e('0x7'));var util=require('util');var path=require('path');var sox=require(_0x458e('0x8'));var csv=require(_0x458e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x458e('0xa'));var squel=require(_0x458e('0xb'));var crypto=require(_0x458e('0xc'));var jsforce=require(_0x458e('0xd'));var deskjs=require(_0x458e('0xe'));var toCsv=require('to-csv');var querystring=require(_0x458e('0xf'));var Papa=require(_0x458e('0x10'));var Redis=require(_0x458e('0x11'));var authService=require(_0x458e('0x12'));var qs=require(_0x458e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x458e('0x14'));var logger=require(_0x458e('0x15'))('api');var utils=require(_0x458e('0x16'));var config=require(_0x458e('0x17'));var licenseUtil=require(_0x458e('0x18'));var db=require(_0x458e('0x19'))['db'];function respondWithStatusCode(_0xfba26c,_0x259cb1){_0x259cb1=_0x259cb1||0xcc;return function(_0xe13e32){if(_0xe13e32){return _0xfba26c[_0x458e('0x1a')](_0x259cb1);}return _0xfba26c[_0x458e('0x1b')](_0x259cb1)[_0x458e('0x1c')]();};}function respondWithResult(_0x1c98f0,_0x5ba407){_0x5ba407=_0x5ba407||0xc8;return function(_0x52cafe){if(_0x52cafe){return _0x1c98f0[_0x458e('0x1b')](_0x5ba407)[_0x458e('0x1d')](_0x52cafe);}};}function respondWithFilteredResult(_0x5ba80b,_0x48c9e8){return function(_0x298291){if(_0x298291){var _0x30c4cc=typeof _0x48c9e8[_0x458e('0x1e')]===_0x458e('0x1f')&&typeof _0x48c9e8[_0x458e('0x20')]===_0x458e('0x1f');var _0x10d1d6=_0x298291[_0x458e('0x21')];var _0x92dfed=_0x30c4cc?0x0:_0x48c9e8['offset'];var _0x162985=_0x30c4cc?_0x298291[_0x458e('0x21')]:_0x48c9e8[_0x458e('0x1e')]+_0x48c9e8[_0x458e('0x20')];var _0x13cd1d;if(_0x162985>=_0x10d1d6){_0x162985=_0x10d1d6;_0x13cd1d=0xc8;}else{_0x13cd1d=0xce;}_0x5ba80b[_0x458e('0x1b')](_0x13cd1d);return _0x5ba80b[_0x458e('0x22')](_0x458e('0x23'),_0x92dfed+'-'+_0x162985+'/'+_0x10d1d6)['json'](_0x298291);}return null;};}function patchUpdates(_0x6fa5d8){return function(_0x98649a){try{jsonpatch['apply'](_0x98649a,_0x6fa5d8,!![]);}catch(_0x2704c9){return BPromise[_0x458e('0x24')](_0x2704c9);}return _0x98649a['save']();};}function saveUpdates(_0x175d84,_0x10a9ce){return function(_0xe54d2f){if(_0xe54d2f){return _0xe54d2f[_0x458e('0x25')](_0x175d84)['then'](function(_0x1225ff){return _0x1225ff;});}return null;};}function removeEntity(_0x35e84e,_0x3056db){return function(_0x154540){if(_0x154540){return _0x154540['destroy']()[_0x458e('0x26')](function(){_0x35e84e[_0x458e('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21fd43,_0x49f2b1){return function(_0x2fb73f){if(!_0x2fb73f){_0x21fd43['sendStatus'](0x194);}return _0x2fb73f;};}function handleError(_0x5a8d8a,_0x2847f7){_0x2847f7=_0x2847f7||0x1f4;return function(_0x59d132){logger[_0x458e('0x27')](_0x59d132[_0x458e('0x28')]);if(_0x59d132['name']){delete _0x59d132['name'];}_0x5a8d8a[_0x458e('0x1b')](_0x2847f7)['send'](_0x59d132);};}exports[_0x458e('0x29')]=function(_0x5502b4,_0x59b09b){var _0x4e4f4c={},_0x4abada={},_0x1711c8={'count':0x0,'rows':[]};var _0x5d3cac=_[_0x458e('0x2a')](db[_0x458e('0x2b')][_0x458e('0x2c')],function(_0x191965){return{'name':_0x191965[_0x458e('0x2d')],'type':_0x191965['type']['key']};});_0x4abada[_0x458e('0x2e')]=_[_0x458e('0x2a')](_0x5d3cac,_0x458e('0x2f'));_0x4abada[_0x458e('0x30')]=_['keys'](_0x5502b4['query']);_0x4abada[_0x458e('0x31')]=_[_0x458e('0x32')](_0x4abada[_0x458e('0x2e')],_0x4abada['query']);_0x4e4f4c['attributes']=_[_0x458e('0x32')](_0x4abada[_0x458e('0x2e')],qs[_0x458e('0x33')](_0x5502b4[_0x458e('0x30')]['fields']));_0x4e4f4c['attributes']=_0x4e4f4c[_0x458e('0x34')][_0x458e('0x35')]?_0x4e4f4c[_0x458e('0x34')]:_0x4abada[_0x458e('0x2e')];if(!_0x5502b4[_0x458e('0x30')][_0x458e('0x36')](_0x458e('0x37'))){_0x4e4f4c['limit']=qs[_0x458e('0x20')](_0x5502b4[_0x458e('0x30')]['limit']);_0x4e4f4c[_0x458e('0x1e')]=qs[_0x458e('0x1e')](_0x5502b4[_0x458e('0x30')][_0x458e('0x1e')]);}_0x4e4f4c[_0x458e('0x38')]=qs[_0x458e('0x39')](_0x5502b4[_0x458e('0x30')][_0x458e('0x39')]);_0x4e4f4c[_0x458e('0x3a')]=qs[_0x458e('0x31')](_['pick'](_0x5502b4[_0x458e('0x30')],_0x4abada['filters']),_0x5d3cac);if(_0x5502b4[_0x458e('0x30')][_0x458e('0x3b')]){_0x4e4f4c[_0x458e('0x3a')]=_['merge'](_0x4e4f4c[_0x458e('0x3a')],{'$or':_[_0x458e('0x2a')](_0x5d3cac,function(_0x122ea0){if(_0x122ea0[_0x458e('0x3c')]!==_0x458e('0x3d')){var _0x576e8b={};_0x576e8b[_0x122ea0['name']]={'$like':'%'+_0x5502b4[_0x458e('0x30')][_0x458e('0x3b')]+'%'};return _0x576e8b;}})});}_0x4e4f4c=_[_0x458e('0x3e')]({},_0x4e4f4c,_0x5502b4[_0x458e('0x3f')]);var _0x21361c={'where':_0x4e4f4c[_0x458e('0x3a')]};return db[_0x458e('0x2b')][_0x458e('0x21')](_0x21361c)[_0x458e('0x26')](function(_0x2d19d6){_0x1711c8[_0x458e('0x21')]=_0x2d19d6;if(_0x5502b4[_0x458e('0x30')][_0x458e('0x40')]){_0x4e4f4c[_0x458e('0x41')]=[{'all':!![]}];}return db[_0x458e('0x2b')]['findAll'](_0x4e4f4c);})[_0x458e('0x26')](function(_0x5c2797){_0x1711c8[_0x458e('0x42')]=_0x5c2797;return _0x1711c8;})[_0x458e('0x26')](respondWithFilteredResult(_0x59b09b,_0x4e4f4c))[_0x458e('0x43')](handleError(_0x59b09b,null));};exports[_0x458e('0x44')]=function(_0x468709,_0x3ec56d){var _0x104085={'raw':!![],'where':{'id':_0x468709[_0x458e('0x45')]['id']}},_0x2449db={};_0x2449db[_0x458e('0x2e')]=_['keys'](db[_0x458e('0x2b')]['rawAttributes']);_0x2449db['query']=_[_0x458e('0x46')](_0x468709[_0x458e('0x30')]);_0x2449db['filters']=_[_0x458e('0x32')](_0x2449db[_0x458e('0x2e')],_0x2449db[_0x458e('0x30')]);_0x104085[_0x458e('0x34')]=_[_0x458e('0x32')](_0x2449db[_0x458e('0x2e')],qs[_0x458e('0x33')](_0x468709[_0x458e('0x30')][_0x458e('0x33')]));_0x104085[_0x458e('0x34')]=_0x104085[_0x458e('0x34')][_0x458e('0x35')]?_0x104085[_0x458e('0x34')]:_0x2449db['model'];if(_0x468709[_0x458e('0x30')][_0x458e('0x40')]){_0x104085[_0x458e('0x41')]=[{'all':!![]}];}_0x104085=_[_0x458e('0x3e')]({},_0x104085,_0x468709[_0x458e('0x3f')]);return db[_0x458e('0x2b')][_0x458e('0x47')](_0x104085)['then'](handleEntityNotFound(_0x3ec56d,null))[_0x458e('0x26')](respondWithResult(_0x3ec56d,null))['catch'](handleError(_0x3ec56d,null));};exports[_0x458e('0x48')]=function(_0x39758e,_0x1cf5a2){return db[_0x458e('0x2b')][_0x458e('0x48')](_0x39758e[_0x458e('0x49')],{})[_0x458e('0x26')](respondWithResult(_0x1cf5a2,0xc9))[_0x458e('0x43')](handleError(_0x1cf5a2,null));};exports[_0x458e('0x25')]=function(_0x4c8f66,_0x417fc7){if(_0x4c8f66['body']['id']){delete _0x4c8f66[_0x458e('0x49')]['id'];}return db[_0x458e('0x2b')][_0x458e('0x47')]({'where':{'id':_0x4c8f66[_0x458e('0x45')]['id']}})[_0x458e('0x26')](handleEntityNotFound(_0x417fc7,null))['then'](saveUpdates(_0x4c8f66[_0x458e('0x49')],null))['then'](respondWithResult(_0x417fc7,null))[_0x458e('0x43')](handleError(_0x417fc7,null));};exports[_0x458e('0x4a')]=function(_0x304e6f,_0x238953){return db[_0x458e('0x2b')][_0x458e('0x47')]({'where':{'id':_0x304e6f[_0x458e('0x45')]['id']}})[_0x458e('0x26')](handleEntityNotFound(_0x238953,null))[_0x458e('0x26')](removeEntity(_0x238953,null))[_0x458e('0x43')](handleError(_0x238953,null));};exports['describe']=function(_0x189dc9,_0x737e21){return db['SmsQueueReport']['describe']()[_0x458e('0x26')](respondWithResult(_0x737e21,null))[_0x458e('0x43')](handleError(_0x737e21,null));}; \ No newline at end of file +var _0x2b1b=['fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','destroy','then','error','name','send','index','map','SmsQueueReport','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','fast-json-patch','moment','mustache','util','sox','to-csv','ejs'];(function(_0x41d2a7,_0x404290){var _0x4f3d6a=function(_0x5e8683){while(--_0x5e8683){_0x41d2a7['push'](_0x41d2a7['shift']());}};_0x4f3d6a(++_0x404290);}(_0x2b1b,0xe4));var _0xb2b1=function(_0x15004c,_0x43f7b1){_0x15004c=_0x15004c-0x0;var _0x3c1da9=_0x2b1b[_0x15004c];return _0x3c1da9;};'use strict';var emlformat=require(_0xb2b1('0x0'));var rimraf=require(_0xb2b1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb2b1('0x2'));var rp=require('request-promise');var moment=require(_0xb2b1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb2b1('0x4'));var util=require(_0xb2b1('0x5'));var path=require('path');var sox=require(_0xb2b1('0x6'));var csv=require(_0xb2b1('0x7'));var ejs=require(_0xb2b1('0x8'));var fs=require('fs');var fs_extra=require(_0xb2b1('0x9'));var _=require(_0xb2b1('0xa'));var squel=require(_0xb2b1('0xb'));var crypto=require(_0xb2b1('0xc'));var jsforce=require(_0xb2b1('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb2b1('0x7'));var querystring=require(_0xb2b1('0xe'));var Papa=require(_0xb2b1('0xf'));var Redis=require(_0xb2b1('0x10'));var authService=require(_0xb2b1('0x11'));var qs=require(_0xb2b1('0x12'));var as=require(_0xb2b1('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb2b1('0x14'))(_0xb2b1('0x15'));var utils=require(_0xb2b1('0x16'));var config=require(_0xb2b1('0x17'));var licenseUtil=require(_0xb2b1('0x18'));var db=require(_0xb2b1('0x19'))['db'];function respondWithStatusCode(_0x1db827,_0x166b46){_0x166b46=_0x166b46||0xcc;return function(_0x55337b){if(_0x55337b){return _0x1db827[_0xb2b1('0x1a')](_0x166b46);}return _0x1db827[_0xb2b1('0x1b')](_0x166b46)[_0xb2b1('0x1c')]();};}function respondWithResult(_0xfdc89a,_0x1bd655){_0x1bd655=_0x1bd655||0xc8;return function(_0x41bfd1){if(_0x41bfd1){return _0xfdc89a[_0xb2b1('0x1b')](_0x1bd655)['json'](_0x41bfd1);}};}function respondWithFilteredResult(_0x4bf594,_0x3543ed){return function(_0x1e728d){if(_0x1e728d){var _0x3746be=typeof _0x3543ed[_0xb2b1('0x1d')]===_0xb2b1('0x1e')&&typeof _0x3543ed[_0xb2b1('0x1f')]===_0xb2b1('0x1e');var _0x126c1=_0x1e728d['count'];var _0x82198e=_0x3746be?0x0:_0x3543ed[_0xb2b1('0x1d')];var _0x50ef60=_0x3746be?_0x1e728d[_0xb2b1('0x20')]:_0x3543ed[_0xb2b1('0x1d')]+_0x3543ed[_0xb2b1('0x1f')];var _0x5784f3;if(_0x50ef60>=_0x126c1){_0x50ef60=_0x126c1;_0x5784f3=0xc8;}else{_0x5784f3=0xce;}_0x4bf594['status'](_0x5784f3);return _0x4bf594[_0xb2b1('0x21')](_0xb2b1('0x22'),_0x82198e+'-'+_0x50ef60+'/'+_0x126c1)[_0xb2b1('0x23')](_0x1e728d);}return null;};}function patchUpdates(_0x3a0a64){return function(_0x12c911){try{jsonpatch[_0xb2b1('0x24')](_0x12c911,_0x3a0a64,!![]);}catch(_0x42ce87){return BPromise['reject'](_0x42ce87);}return _0x12c911[_0xb2b1('0x25')]();};}function saveUpdates(_0x16808e,_0x54ae41){return function(_0x24c838){if(_0x24c838){return _0x24c838[_0xb2b1('0x26')](_0x16808e)['then'](function(_0x30e246){return _0x30e246;});}return null;};}function removeEntity(_0x14288e,_0x363cb5){return function(_0x22936c){if(_0x22936c){return _0x22936c[_0xb2b1('0x27')]()[_0xb2b1('0x28')](function(){_0x14288e[_0xb2b1('0x1b')](0xcc)[_0xb2b1('0x1c')]();});}};}function handleEntityNotFound(_0x5ef640,_0x555469){return function(_0x299d67){if(!_0x299d67){_0x5ef640['sendStatus'](0x194);}return _0x299d67;};}function handleError(_0x56d3f3,_0xac72d9){_0xac72d9=_0xac72d9||0x1f4;return function(_0x518040){logger[_0xb2b1('0x29')](_0x518040['stack']);if(_0x518040[_0xb2b1('0x2a')]){delete _0x518040[_0xb2b1('0x2a')];}_0x56d3f3[_0xb2b1('0x1b')](_0xac72d9)[_0xb2b1('0x2b')](_0x518040);};}exports[_0xb2b1('0x2c')]=function(_0x53f0f4,_0x220397){var _0x45353f={},_0x2cbcf={},_0x5ddce5={'count':0x0,'rows':[]};var _0x5e24a6=_[_0xb2b1('0x2d')](db[_0xb2b1('0x2e')][_0xb2b1('0x2f')],function(_0x5bb9b7){return{'name':_0x5bb9b7['fieldName'],'type':_0x5bb9b7[_0xb2b1('0x30')][_0xb2b1('0x31')]};});_0x2cbcf['model']=_[_0xb2b1('0x2d')](_0x5e24a6,'name');_0x2cbcf[_0xb2b1('0x32')]=_[_0xb2b1('0x33')](_0x53f0f4[_0xb2b1('0x32')]);_0x2cbcf[_0xb2b1('0x34')]=_[_0xb2b1('0x35')](_0x2cbcf[_0xb2b1('0x36')],_0x2cbcf[_0xb2b1('0x32')]);_0x45353f[_0xb2b1('0x37')]=_[_0xb2b1('0x35')](_0x2cbcf[_0xb2b1('0x36')],qs['fields'](_0x53f0f4[_0xb2b1('0x32')][_0xb2b1('0x38')]));_0x45353f['attributes']=_0x45353f[_0xb2b1('0x37')][_0xb2b1('0x39')]?_0x45353f[_0xb2b1('0x37')]:_0x2cbcf['model'];if(!_0x53f0f4[_0xb2b1('0x32')][_0xb2b1('0x3a')](_0xb2b1('0x3b'))){_0x45353f[_0xb2b1('0x1f')]=qs[_0xb2b1('0x1f')](_0x53f0f4[_0xb2b1('0x32')][_0xb2b1('0x1f')]);_0x45353f[_0xb2b1('0x1d')]=qs[_0xb2b1('0x1d')](_0x53f0f4[_0xb2b1('0x32')][_0xb2b1('0x1d')]);}_0x45353f[_0xb2b1('0x3c')]=qs[_0xb2b1('0x3d')](_0x53f0f4['query'][_0xb2b1('0x3d')]);_0x45353f[_0xb2b1('0x3e')]=qs[_0xb2b1('0x34')](_[_0xb2b1('0x3f')](_0x53f0f4[_0xb2b1('0x32')],_0x2cbcf[_0xb2b1('0x34')]),_0x5e24a6);if(_0x53f0f4['query'][_0xb2b1('0x40')]){_0x45353f[_0xb2b1('0x3e')]=_['merge'](_0x45353f['where'],{'$or':_[_0xb2b1('0x2d')](_0x5e24a6,function(_0xd6408c){if(_0xd6408c[_0xb2b1('0x30')]!==_0xb2b1('0x41')){var _0x4235f0={};_0x4235f0[_0xd6408c[_0xb2b1('0x2a')]]={'$like':'%'+_0x53f0f4['query'][_0xb2b1('0x40')]+'%'};return _0x4235f0;}})});}_0x45353f=_[_0xb2b1('0x42')]({},_0x45353f,_0x53f0f4[_0xb2b1('0x43')]);var _0x1fae4a={'where':_0x45353f['where']};return db[_0xb2b1('0x2e')][_0xb2b1('0x20')](_0x1fae4a)[_0xb2b1('0x28')](function(_0x19415e){_0x5ddce5[_0xb2b1('0x20')]=_0x19415e;if(_0x53f0f4[_0xb2b1('0x32')][_0xb2b1('0x44')]){_0x45353f[_0xb2b1('0x45')]=[{'all':!![]}];}return db[_0xb2b1('0x2e')][_0xb2b1('0x46')](_0x45353f);})[_0xb2b1('0x28')](function(_0x1b41a7){_0x5ddce5[_0xb2b1('0x47')]=_0x1b41a7;return _0x5ddce5;})[_0xb2b1('0x28')](respondWithFilteredResult(_0x220397,_0x45353f))[_0xb2b1('0x48')](handleError(_0x220397,null));};exports[_0xb2b1('0x49')]=function(_0x46ab78,_0x55cfe5){var _0x43a902={'raw':!![],'where':{'id':_0x46ab78[_0xb2b1('0x4a')]['id']}},_0x1ac787={};_0x1ac787[_0xb2b1('0x36')]=_[_0xb2b1('0x33')](db[_0xb2b1('0x2e')]['rawAttributes']);_0x1ac787['query']=_[_0xb2b1('0x33')](_0x46ab78[_0xb2b1('0x32')]);_0x1ac787[_0xb2b1('0x34')]=_['intersection'](_0x1ac787[_0xb2b1('0x36')],_0x1ac787[_0xb2b1('0x32')]);_0x43a902[_0xb2b1('0x37')]=_[_0xb2b1('0x35')](_0x1ac787[_0xb2b1('0x36')],qs['fields'](_0x46ab78[_0xb2b1('0x32')][_0xb2b1('0x38')]));_0x43a902[_0xb2b1('0x37')]=_0x43a902[_0xb2b1('0x37')]['length']?_0x43a902[_0xb2b1('0x37')]:_0x1ac787[_0xb2b1('0x36')];if(_0x46ab78[_0xb2b1('0x32')][_0xb2b1('0x44')]){_0x43a902[_0xb2b1('0x45')]=[{'all':!![]}];}_0x43a902=_['merge']({},_0x43a902,_0x46ab78['options']);return db[_0xb2b1('0x2e')][_0xb2b1('0x4b')](_0x43a902)[_0xb2b1('0x28')](handleEntityNotFound(_0x55cfe5,null))[_0xb2b1('0x28')](respondWithResult(_0x55cfe5,null))[_0xb2b1('0x48')](handleError(_0x55cfe5,null));};exports[_0xb2b1('0x4c')]=function(_0x47b3e0,_0x5d77ee){return db[_0xb2b1('0x2e')][_0xb2b1('0x4c')](_0x47b3e0[_0xb2b1('0x4d')],{})[_0xb2b1('0x28')](respondWithResult(_0x5d77ee,0xc9))[_0xb2b1('0x48')](handleError(_0x5d77ee,null));};exports[_0xb2b1('0x26')]=function(_0x27c247,_0x185fd1){if(_0x27c247['body']['id']){delete _0x27c247[_0xb2b1('0x4d')]['id'];}return db[_0xb2b1('0x2e')]['find']({'where':{'id':_0x27c247[_0xb2b1('0x4a')]['id']}})[_0xb2b1('0x28')](handleEntityNotFound(_0x185fd1,null))[_0xb2b1('0x28')](saveUpdates(_0x27c247['body'],null))[_0xb2b1('0x28')](respondWithResult(_0x185fd1,null))[_0xb2b1('0x48')](handleError(_0x185fd1,null));};exports[_0xb2b1('0x27')]=function(_0x1ce1b4,_0x13d985){return db[_0xb2b1('0x2e')][_0xb2b1('0x4b')]({'where':{'id':_0x1ce1b4[_0xb2b1('0x4a')]['id']}})[_0xb2b1('0x28')](handleEntityNotFound(_0x13d985,null))[_0xb2b1('0x28')](removeEntity(_0x13d985,null))[_0xb2b1('0x48')](handleError(_0x13d985,null));};exports[_0xb2b1('0x4e')]=function(_0x11f40c,_0x53a3ea){return db[_0xb2b1('0x2e')][_0xb2b1('0x4e')]()['then'](respondWithResult(_0x53a3ea,null))['catch'](handleError(_0x53a3ea,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 1d68cc1..b1056c5 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 _0xcb91=['path','rimraf','./smsQueueReport.attributes','exports','define','report_sms_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0xbfd7ad,_0x225e35){var _0x3007a7=function(_0x49a3bd){while(--_0x49a3bd){_0xbfd7ad['push'](_0xbfd7ad['shift']());}};_0x3007a7(++_0x225e35);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x33080e,_0x1c600a){_0x33080e=_0x33080e-0x0;var _0x407395=_0xcb91[_0x33080e];return _0x407395;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('SmsQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','define','SmsQueueReport','uniqueid','lodash'];(function(_0xf5634e,_0x18d7f7){var _0x419a65=function(_0x595820){while(--_0x595820){_0xf5634e['push'](_0xf5634e['shift']());}};_0x419a65(++_0x18d7f7);}(_0xb7e7,0x121));var _0x7b7e=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0xb7e7[_0x424a9a];return _0xa7831c;};'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 diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 13ee1b4..f43b467 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 _0x6e45=['message','result','catch','SmsQueueReport','create','body','options','raw','CreateSmsQueueReport','stringify','UpdateSmsQueueReport','where','attributes','limit','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code'];(function(_0x440917,_0x20ea7b){var _0x5e906b=function(_0x27cba5){while(--_0x27cba5){_0x440917['push'](_0x440917['shift']());}};_0x5e906b(++_0x20ea7b);}(_0x6e45,0x106));var _0x56e4=function(_0x181612,_0x2399bb){_0x181612=_0x181612-0x0;var _0xe69874=_0x6e45[_0x181612];return _0xe69874;};'use strict';var _=require('lodash');var util=require(_0x56e4('0x0'));var moment=require(_0x56e4('0x1'));var BPromise=require('bluebird');var rs=require(_0x56e4('0x2'));var fs=require('fs');var Redis=require(_0x56e4('0x3'));var db=require(_0x56e4('0x4'))['db'];var utils=require(_0x56e4('0x5'));var logger=require(_0x56e4('0x6'))(_0x56e4('0x7'));var config=require(_0x56e4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x56e4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc78326,_0xdb948a,_0x3e058b){return new BPromise(function(_0x4be0e1,_0x454955){return client['request'](_0xc78326,_0x3e058b)[_0x56e4('0xa')](function(_0x22cd82){logger[_0x56e4('0xb')](_0x56e4('0xc'),_0xdb948a,_0x56e4('0xd'));logger[_0x56e4('0xe')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0xdb948a,_0x56e4('0xd'),JSON['stringify'](_0x22cd82));if(_0x22cd82[_0x56e4('0xf')]){if(_0x22cd82[_0x56e4('0xf')][_0x56e4('0x10')]===0x1f4){logger[_0x56e4('0xf')]('SmsQueueReport,\x20%s,\x20%s',_0xdb948a,_0x22cd82[_0x56e4('0xf')][_0x56e4('0x11')]);return _0x454955(_0x22cd82[_0x56e4('0xf')][_0x56e4('0x11')]);}logger[_0x56e4('0xf')](_0x56e4('0xc'),_0xdb948a,_0x22cd82[_0x56e4('0xf')][_0x56e4('0x11')]);return _0x4be0e1(_0x22cd82['error'][_0x56e4('0x11')]);}else{logger[_0x56e4('0xb')](_0x56e4('0xc'),_0xdb948a,'request\x20sent');_0x4be0e1(_0x22cd82[_0x56e4('0x12')][_0x56e4('0x11')]);}})[_0x56e4('0x13')](function(_0x5d2de7){logger[_0x56e4('0xf')](_0x56e4('0xc'),_0xdb948a,_0x5d2de7);_0x454955(_0x5d2de7);});});}exports['CreateSmsQueueReport']=function(_0x7b3a9a){var _0x315d3e=this;return new Promise(function(_0x5168b2,_0x50c790){return db[_0x56e4('0x14')][_0x56e4('0x15')](_0x7b3a9a[_0x56e4('0x16')],{'raw':_0x7b3a9a[_0x56e4('0x17')]?_0x7b3a9a['options'][_0x56e4('0x18')]===undefined?!![]:![]:!![]})[_0x56e4('0xa')](function(_0xfc5d10){logger[_0x56e4('0xb')](_0x56e4('0x19'),_0x7b3a9a);logger[_0x56e4('0xe')](_0x56e4('0x19'),_0x7b3a9a,JSON[_0x56e4('0x1a')](_0xfc5d10));_0x5168b2(_0xfc5d10);})[_0x56e4('0x13')](function(_0x536553){logger['error']('CreateSmsQueueReport',_0x536553[_0x56e4('0x11')],_0x7b3a9a);_0x50c790(_0x315d3e[_0x56e4('0xf')](0x1f4,_0x536553[_0x56e4('0x11')]));});});};exports[_0x56e4('0x1b')]=function(_0x4caac2){var _0x1f0ee3=this;return new Promise(function(_0x847b5b,_0x116891){return db[_0x56e4('0x14')]['update'](_0x4caac2[_0x56e4('0x16')],{'raw':_0x4caac2[_0x56e4('0x17')]?_0x4caac2[_0x56e4('0x17')][_0x56e4('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4caac2['options']?_0x4caac2['options'][_0x56e4('0x1c')]||null:null,'attributes':_0x4caac2[_0x56e4('0x17')]?_0x4caac2[_0x56e4('0x17')][_0x56e4('0x1d')]||null:null,'limit':_0x4caac2['options']?_0x4caac2['options'][_0x56e4('0x1e')]||null:null})['then'](function(_0x1b7a77){logger[_0x56e4('0xb')](_0x56e4('0x1b'),_0x4caac2);logger[_0x56e4('0xe')](_0x56e4('0x1b'),_0x4caac2,JSON[_0x56e4('0x1a')](_0x1b7a77));_0x847b5b(_0x1b7a77);})[_0x56e4('0x13')](function(_0x359754){logger[_0x56e4('0xf')](_0x56e4('0x1b'),_0x359754[_0x56e4('0x11')],_0x4caac2);_0x116891(_0x1f0ee3[_0x56e4('0xf')](0x1f4,_0x359754[_0x56e4('0x11')]));});});}; \ No newline at end of file +var _0x662e=['attributes','limit','debug','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','http','request','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','then','catch','UpdateSmsQueueReport','update','where'];(function(_0x33df64,_0x44edf4){var _0x18234e=function(_0x143d47){while(--_0x143d47){_0x33df64['push'](_0x33df64['shift']());}};_0x18234e(++_0x44edf4);}(_0x662e,0x1c3));var _0xe662=function(_0x4e4942,_0x2b32b2){_0x4e4942=_0x4e4942-0x0;var _0x20b963=_0x662e[_0x4e4942];return _0x20b963;};'use strict';var _=require(_0xe662('0x0'));var util=require(_0xe662('0x1'));var moment=require(_0xe662('0x2'));var BPromise=require('bluebird');var rs=require(_0xe662('0x3'));var fs=require('fs');var Redis=require(_0xe662('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe662('0x5'));var logger=require('../../config/logger')(_0xe662('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xe662('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x19b092,_0x587c87,_0xa5c2e5){return new BPromise(function(_0xba56dc,_0x1f9f28){return client[_0xe662('0x8')](_0x19b092,_0xa5c2e5)['then'](function(_0x201c8c){logger[_0xe662('0x9')](_0xe662('0xa'),_0x587c87,_0xe662('0xb'));logger['debug'](_0xe662('0xc'),_0x587c87,_0xe662('0xb'),JSON[_0xe662('0xd')](_0x201c8c));if(_0x201c8c[_0xe662('0xe')]){if(_0x201c8c['error'][_0xe662('0xf')]===0x1f4){logger['error'](_0xe662('0xa'),_0x587c87,_0x201c8c[_0xe662('0xe')][_0xe662('0x10')]);return _0x1f9f28(_0x201c8c[_0xe662('0xe')][_0xe662('0x10')]);}logger[_0xe662('0xe')](_0xe662('0xa'),_0x587c87,_0x201c8c['error']['message']);return _0xba56dc(_0x201c8c['error']['message']);}else{logger[_0xe662('0x9')]('SmsQueueReport,\x20%s,\x20%s',_0x587c87,_0xe662('0xb'));_0xba56dc(_0x201c8c[_0xe662('0x11')]['message']);}})['catch'](function(_0x53362b){logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x587c87,_0x53362b);_0x1f9f28(_0x53362b);});});}exports[_0xe662('0x12')]=function(_0x17fe99){var _0xfe3161=this;return new Promise(function(_0x359e4c,_0x16e9b2){return db[_0xe662('0x13')][_0xe662('0x14')](_0x17fe99[_0xe662('0x15')],{'raw':_0x17fe99[_0xe662('0x16')]?_0x17fe99[_0xe662('0x16')][_0xe662('0x17')]===undefined?!![]:![]:!![]})[_0xe662('0x18')](function(_0x52359e){logger['info'](_0xe662('0x12'),_0x17fe99);logger['debug'](_0xe662('0x12'),_0x17fe99,JSON[_0xe662('0xd')](_0x52359e));_0x359e4c(_0x52359e);})[_0xe662('0x19')](function(_0x352e5c){logger[_0xe662('0xe')](_0xe662('0x12'),_0x352e5c[_0xe662('0x10')],_0x17fe99);_0x16e9b2(_0xfe3161[_0xe662('0xe')](0x1f4,_0x352e5c[_0xe662('0x10')]));});});};exports[_0xe662('0x1a')]=function(_0x4441d0){var _0x4d2177=this;return new Promise(function(_0x293d8d,_0x348090){return db[_0xe662('0x13')][_0xe662('0x1b')](_0x4441d0[_0xe662('0x15')],{'raw':_0x4441d0['options']?_0x4441d0[_0xe662('0x16')][_0xe662('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4441d0[_0xe662('0x16')]?_0x4441d0['options'][_0xe662('0x1c')]||null:null,'attributes':_0x4441d0[_0xe662('0x16')]?_0x4441d0['options'][_0xe662('0x1d')]||null:null,'limit':_0x4441d0[_0xe662('0x16')]?_0x4441d0[_0xe662('0x16')][_0xe662('0x1e')]||null:null})[_0xe662('0x18')](function(_0x1ffaf4){logger['info']('UpdateSmsQueueReport',_0x4441d0);logger[_0xe662('0x1f')]('UpdateSmsQueueReport',_0x4441d0,JSON[_0xe662('0xd')](_0x1ffaf4));_0x293d8d(_0x1ffaf4);})['catch'](function(_0x240d59){logger[_0xe662('0xe')](_0xe662('0x1a'),_0x240d59[_0xe662('0x10')],_0x4441d0);_0x348090(_0x4d2177[_0xe662('0xe')](0x1f4,_0x240d59['message']));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 7727767..e286a9b 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 _0x33c5=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','util'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x33c5,0xe6));var _0x533c=function(_0x5c2e5e,_0x2bc00e){_0x5c2e5e=_0x5c2e5e-0x0;var _0x46a5da=_0x33c5[_0x5c2e5e];return _0x46a5da;};'use strict';var multer=require('multer');var util=require(_0x533c('0x0'));var path=require(_0x533c('0x1'));var timeout=require('connect-timeout');var express=require(_0x533c('0x2'));var router=express[_0x533c('0x3')]();var fs_extra=require(_0x533c('0x4'));var auth=require(_0x533c('0x5'));var interaction=require(_0x533c('0x6'));var config=require('../../config/environment');var controller=require(_0x533c('0x7'));router[_0x533c('0x8')]('/',auth[_0x533c('0x9')](),controller[_0x533c('0xa')]);router[_0x533c('0x8')](_0x533c('0xb'),auth[_0x533c('0x9')](),controller[_0x533c('0xc')]);router[_0x533c('0x8')](_0x533c('0xd'),auth[_0x533c('0x9')](),controller[_0x533c('0xe')]);router[_0x533c('0xf')]('/',auth[_0x533c('0x9')](),controller[_0x533c('0x10')]);router[_0x533c('0x11')]('/:id',auth[_0x533c('0x9')](),controller[_0x533c('0x12')]);router[_0x533c('0x13')](_0x533c('0xd'),auth[_0x533c('0x9')](),controller[_0x533c('0x14')]);module['exports']=router; \ No newline at end of file +var _0x2d17=['destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','index','isAuthenticated','describe','show','post','create','put','/:id','update','delete'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x2d17,0x17e));var _0x72d1=function(_0x466eb8,_0x57a055){_0x466eb8=_0x466eb8-0x0;var _0x2eabcf=_0x2d17[_0x466eb8];return _0x2eabcf;};'use strict';var multer=require(_0x72d1('0x0'));var util=require(_0x72d1('0x1'));var path=require('path');var timeout=require(_0x72d1('0x2'));var express=require(_0x72d1('0x3'));var router=express['Router']();var fs_extra=require(_0x72d1('0x4'));var auth=require(_0x72d1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x72d1('0x6'));var controller=require('./smsTransferReport.controller');router[_0x72d1('0x7')]('/',auth['isAuthenticated'](),controller[_0x72d1('0x8')]);router[_0x72d1('0x7')]('/describe',auth[_0x72d1('0x9')](),controller[_0x72d1('0xa')]);router[_0x72d1('0x7')]('/:id',auth[_0x72d1('0x9')](),controller[_0x72d1('0xb')]);router[_0x72d1('0xc')]('/',auth['isAuthenticated'](),controller[_0x72d1('0xd')]);router[_0x72d1('0xe')](_0x72d1('0xf'),auth[_0x72d1('0x9')](),controller[_0x72d1('0x10')]);router[_0x72d1('0x11')](_0x72d1('0xf'),auth[_0x72d1('0x9')](),controller[_0x72d1('0x12')]);module[_0x72d1('0x13')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 46c269c..f3deaa0 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 _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x5bd883,_0x1d6ea9){var _0xa23d51=function(_0x515f20){while(--_0x515f20){_0x5bd883['push'](_0x5bd883['shift']());}};_0xa23d51(++_0x1d6ea9);}(_0xf4eb,0xec));var _0xbf4e=function(_0x23a367,_0x58408a){_0x23a367=_0x23a367-0x0;var _0x13b56f=_0xf4eb[_0x23a367];return _0x13b56f;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file +var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x505241,_0x54a73d){var _0x1a1fcb=function(_0x264d96){while(--_0x264d96){_0x505241['push'](_0x505241['shift']());}};_0x1a1fcb(++_0x54a73d);}(_0x008c,0x188));var _0xc008=function(_0xbe0d54,_0x5c3362){_0xbe0d54=_0xbe0d54-0x0;var _0x13e619=_0x008c[_0xbe0d54];return _0x13e619;};'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/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 3a91b59..7bb5fda 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 _0x7ddc=['error','name','send','index','SmsTransferReport','rawAttributes','fieldName','type','model','map','query','attributes','intersection','fields','length','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','squel','crypto','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','sendStatus','end','status','json','undefined','limit','count','offset','set','apply','reject','save','update','then'];(function(_0x5f2b46,_0x347085){var _0x31164c=function(_0x30ff8a){while(--_0x30ff8a){_0x5f2b46['push'](_0x5f2b46['shift']());}};_0x31164c(++_0x347085);}(_0x7ddc,0x154));var _0xc7dd=function(_0x2a0fa6,_0x557412){_0x2a0fa6=_0x2a0fa6-0x0;var _0xb3fad4=_0x7ddc[_0x2a0fa6];return _0xb3fad4;};'use strict';var emlformat=require(_0xc7dd('0x0'));var rimraf=require(_0xc7dd('0x1'));var zipdir=require(_0xc7dd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc7dd('0x3'));var moment=require(_0xc7dd('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc7dd('0x5'));var util=require(_0xc7dd('0x6'));var path=require(_0xc7dd('0x7'));var sox=require(_0xc7dd('0x8'));var csv=require('to-csv');var ejs=require(_0xc7dd('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc7dd('0xa'));var crypto=require(_0xc7dd('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xc7dd('0xc'));var toCsv=require(_0xc7dd('0xd'));var querystring=require(_0xc7dd('0xe'));var Papa=require(_0xc7dd('0xf'));var Redis=require(_0xc7dd('0x10'));var authService=require(_0xc7dd('0x11'));var qs=require(_0xc7dd('0x12'));var as=require(_0xc7dd('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc7dd('0x14'))(_0xc7dd('0x15'));var utils=require(_0xc7dd('0x16'));var config=require(_0xc7dd('0x17'));var licenseUtil=require(_0xc7dd('0x18'));var db=require(_0xc7dd('0x19'))['db'];function respondWithStatusCode(_0x260df2,_0x3c7aa6){_0x3c7aa6=_0x3c7aa6||0xcc;return function(_0x2ce4e1){if(_0x2ce4e1){return _0x260df2[_0xc7dd('0x1a')](_0x3c7aa6);}return _0x260df2['status'](_0x3c7aa6)[_0xc7dd('0x1b')]();};}function respondWithResult(_0x220971,_0x555539){_0x555539=_0x555539||0xc8;return function(_0x117f87){if(_0x117f87){return _0x220971[_0xc7dd('0x1c')](_0x555539)[_0xc7dd('0x1d')](_0x117f87);}};}function respondWithFilteredResult(_0x227c65,_0x4dcf44){return function(_0x54c294){if(_0x54c294){var _0x3966a9=typeof _0x4dcf44['offset']===_0xc7dd('0x1e')&&typeof _0x4dcf44[_0xc7dd('0x1f')]===_0xc7dd('0x1e');var _0x129734=_0x54c294[_0xc7dd('0x20')];var _0x51ce6f=_0x3966a9?0x0:_0x4dcf44[_0xc7dd('0x21')];var _0x42ef6d=_0x3966a9?_0x54c294['count']:_0x4dcf44[_0xc7dd('0x21')]+_0x4dcf44['limit'];var _0x5badde;if(_0x42ef6d>=_0x129734){_0x42ef6d=_0x129734;_0x5badde=0xc8;}else{_0x5badde=0xce;}_0x227c65[_0xc7dd('0x1c')](_0x5badde);return _0x227c65[_0xc7dd('0x22')]('Content-Range',_0x51ce6f+'-'+_0x42ef6d+'/'+_0x129734)['json'](_0x54c294);}return null;};}function patchUpdates(_0x4a6c91){return function(_0x3ef19a){try{jsonpatch[_0xc7dd('0x23')](_0x3ef19a,_0x4a6c91,!![]);}catch(_0x2412ab){return BPromise[_0xc7dd('0x24')](_0x2412ab);}return _0x3ef19a[_0xc7dd('0x25')]();};}function saveUpdates(_0x3c6485,_0x58d39b){return function(_0x5291c6){if(_0x5291c6){return _0x5291c6[_0xc7dd('0x26')](_0x3c6485)[_0xc7dd('0x27')](function(_0x181a53){return _0x181a53;});}return null;};}function removeEntity(_0x406915,_0x3d7069){return function(_0xb9265){if(_0xb9265){return _0xb9265['destroy']()[_0xc7dd('0x27')](function(){_0x406915[_0xc7dd('0x1c')](0xcc)[_0xc7dd('0x1b')]();});}};}function handleEntityNotFound(_0x508b00,_0x2157dd){return function(_0x46f31d){if(!_0x46f31d){_0x508b00[_0xc7dd('0x1a')](0x194);}return _0x46f31d;};}function handleError(_0x45609d,_0x5e09ae){_0x5e09ae=_0x5e09ae||0x1f4;return function(_0x515deb){logger[_0xc7dd('0x28')](_0x515deb['stack']);if(_0x515deb[_0xc7dd('0x29')]){delete _0x515deb[_0xc7dd('0x29')];}_0x45609d['status'](_0x5e09ae)[_0xc7dd('0x2a')](_0x515deb);};}exports[_0xc7dd('0x2b')]=function(_0x47b958,_0x4e4e94){var _0x443937={},_0x168227={},_0x53f1c2={'count':0x0,'rows':[]};var _0xc19175=_['map'](db[_0xc7dd('0x2c')][_0xc7dd('0x2d')],function(_0x13c688){return{'name':_0x13c688[_0xc7dd('0x2e')],'type':_0x13c688[_0xc7dd('0x2f')]['key']};});_0x168227[_0xc7dd('0x30')]=_[_0xc7dd('0x31')](_0xc19175,'name');_0x168227[_0xc7dd('0x32')]=_['keys'](_0x47b958[_0xc7dd('0x32')]);_0x168227['filters']=_['intersection'](_0x168227[_0xc7dd('0x30')],_0x168227[_0xc7dd('0x32')]);_0x443937[_0xc7dd('0x33')]=_[_0xc7dd('0x34')](_0x168227['model'],qs[_0xc7dd('0x35')](_0x47b958[_0xc7dd('0x32')][_0xc7dd('0x35')]));_0x443937['attributes']=_0x443937[_0xc7dd('0x33')][_0xc7dd('0x36')]?_0x443937[_0xc7dd('0x33')]:_0x168227['model'];if(!_0x47b958['query']['hasOwnProperty']('nolimit')){_0x443937['limit']=qs[_0xc7dd('0x1f')](_0x47b958[_0xc7dd('0x32')][_0xc7dd('0x1f')]);_0x443937[_0xc7dd('0x21')]=qs[_0xc7dd('0x21')](_0x47b958[_0xc7dd('0x32')][_0xc7dd('0x21')]);}_0x443937[_0xc7dd('0x37')]=qs[_0xc7dd('0x38')](_0x47b958[_0xc7dd('0x32')][_0xc7dd('0x38')]);_0x443937[_0xc7dd('0x39')]=qs[_0xc7dd('0x3a')](_[_0xc7dd('0x3b')](_0x47b958['query'],_0x168227[_0xc7dd('0x3a')]),_0xc19175);if(_0x47b958[_0xc7dd('0x32')][_0xc7dd('0x3c')]){_0x443937[_0xc7dd('0x39')]=_[_0xc7dd('0x3d')](_0x443937[_0xc7dd('0x39')],{'$or':_[_0xc7dd('0x31')](_0xc19175,function(_0x3fc67b){if(_0x3fc67b[_0xc7dd('0x2f')]!==_0xc7dd('0x3e')){var _0x1db902={};_0x1db902[_0x3fc67b[_0xc7dd('0x29')]]={'$like':'%'+_0x47b958[_0xc7dd('0x32')][_0xc7dd('0x3c')]+'%'};return _0x1db902;}})});}_0x443937=_['merge']({},_0x443937,_0x47b958[_0xc7dd('0x3f')]);var _0x3465b0={'where':_0x443937[_0xc7dd('0x39')]};return db[_0xc7dd('0x2c')][_0xc7dd('0x20')](_0x3465b0)[_0xc7dd('0x27')](function(_0x421019){_0x53f1c2[_0xc7dd('0x20')]=_0x421019;if(_0x47b958['query'][_0xc7dd('0x40')]){_0x443937[_0xc7dd('0x41')]=[{'all':!![]}];}return db[_0xc7dd('0x2c')][_0xc7dd('0x42')](_0x443937);})[_0xc7dd('0x27')](function(_0x345a16){_0x53f1c2[_0xc7dd('0x43')]=_0x345a16;return _0x53f1c2;})[_0xc7dd('0x27')](respondWithFilteredResult(_0x4e4e94,_0x443937))[_0xc7dd('0x44')](handleError(_0x4e4e94,null));};exports['show']=function(_0x286343,_0x269d3f){var _0xef368a={'raw':!![],'where':{'id':_0x286343[_0xc7dd('0x45')]['id']}},_0x1fafcc={};_0x1fafcc[_0xc7dd('0x30')]=_[_0xc7dd('0x46')](db[_0xc7dd('0x2c')]['rawAttributes']);_0x1fafcc['query']=_[_0xc7dd('0x46')](_0x286343[_0xc7dd('0x32')]);_0x1fafcc[_0xc7dd('0x3a')]=_['intersection'](_0x1fafcc[_0xc7dd('0x30')],_0x1fafcc[_0xc7dd('0x32')]);_0xef368a[_0xc7dd('0x33')]=_['intersection'](_0x1fafcc['model'],qs[_0xc7dd('0x35')](_0x286343['query'][_0xc7dd('0x35')]));_0xef368a[_0xc7dd('0x33')]=_0xef368a[_0xc7dd('0x33')]['length']?_0xef368a['attributes']:_0x1fafcc[_0xc7dd('0x30')];if(_0x286343[_0xc7dd('0x32')][_0xc7dd('0x40')]){_0xef368a[_0xc7dd('0x41')]=[{'all':!![]}];}_0xef368a=_[_0xc7dd('0x3d')]({},_0xef368a,_0x286343[_0xc7dd('0x3f')]);return db[_0xc7dd('0x2c')][_0xc7dd('0x47')](_0xef368a)[_0xc7dd('0x27')](handleEntityNotFound(_0x269d3f,null))[_0xc7dd('0x27')](respondWithResult(_0x269d3f,null))[_0xc7dd('0x44')](handleError(_0x269d3f,null));};exports[_0xc7dd('0x48')]=function(_0x88fb6a,_0x5c59be){return db[_0xc7dd('0x2c')][_0xc7dd('0x48')](_0x88fb6a['body'],{})['then'](respondWithResult(_0x5c59be,0xc9))['catch'](handleError(_0x5c59be,null));};exports[_0xc7dd('0x26')]=function(_0x1cc36f,_0x1d037b){if(_0x1cc36f[_0xc7dd('0x49')]['id']){delete _0x1cc36f[_0xc7dd('0x49')]['id'];}return db[_0xc7dd('0x2c')][_0xc7dd('0x47')]({'where':{'id':_0x1cc36f[_0xc7dd('0x45')]['id']}})[_0xc7dd('0x27')](handleEntityNotFound(_0x1d037b,null))[_0xc7dd('0x27')](saveUpdates(_0x1cc36f[_0xc7dd('0x49')],null))[_0xc7dd('0x27')](respondWithResult(_0x1d037b,null))['catch'](handleError(_0x1d037b,null));};exports[_0xc7dd('0x4a')]=function(_0x32ec19,_0x186f9e){return db[_0xc7dd('0x2c')][_0xc7dd('0x47')]({'where':{'id':_0x32ec19[_0xc7dd('0x45')]['id']}})[_0xc7dd('0x27')](handleEntityNotFound(_0x186f9e,null))[_0xc7dd('0x27')](removeEntity(_0x186f9e,null))[_0xc7dd('0x44')](handleError(_0x186f9e,null));};exports['describe']=function(_0x402ce0,_0x3924e9){return db['SmsTransferReport'][_0xc7dd('0x4b')]()[_0xc7dd('0x27')](respondWithResult(_0x3924e9,null))[_0xc7dd('0x44')](handleError(_0x3924e9,null));}; \ No newline at end of file +var _0xbdf3=['Content-Range','apply','reject','save','update','then','end','error','stack','name','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','SmsTransferReport','count','include','findAll','rows','catch','show','params','keys','length','includeAll','find','create','body','destroy','describe','rimraf','fast-json-patch','request-promise','moment','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set'];(function(_0x39c753,_0x402c48){var _0x5c274f=function(_0x49e224){while(--_0x49e224){_0x39c753['push'](_0x39c753['shift']());}};_0x5c274f(++_0x402c48);}(_0xbdf3,0xc3));var _0x3bdf=function(_0x152121,_0x120c53){_0x152121=_0x152121-0x0;var _0x592a85=_0xbdf3[_0x152121];return _0x592a85;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3bdf('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3bdf('0x1'));var rp=require(_0x3bdf('0x2'));var moment=require(_0x3bdf('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3bdf('0x4'));var path=require('path');var sox=require(_0x3bdf('0x5'));var csv=require(_0x3bdf('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3bdf('0x7'));var _=require(_0x3bdf('0x8'));var squel=require('squel');var crypto=require(_0x3bdf('0x9'));var jsforce=require(_0x3bdf('0xa'));var deskjs=require(_0x3bdf('0xb'));var toCsv=require(_0x3bdf('0x6'));var querystring=require(_0x3bdf('0xc'));var Papa=require(_0x3bdf('0xd'));var Redis=require(_0x3bdf('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x3bdf('0xf'));var as=require(_0x3bdf('0x10'));var hardwareService=require(_0x3bdf('0x11'));var logger=require(_0x3bdf('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3bdf('0x13'))['db'];function respondWithStatusCode(_0x5f3b5b,_0x2abfc9){_0x2abfc9=_0x2abfc9||0xcc;return function(_0x829597){if(_0x829597){return _0x5f3b5b[_0x3bdf('0x14')](_0x2abfc9);}return _0x5f3b5b[_0x3bdf('0x15')](_0x2abfc9)['end']();};}function respondWithResult(_0x4a2eeb,_0x4df927){_0x4df927=_0x4df927||0xc8;return function(_0x50fbd1){if(_0x50fbd1){return _0x4a2eeb['status'](_0x4df927)[_0x3bdf('0x16')](_0x50fbd1);}};}function respondWithFilteredResult(_0x587547,_0x12c7a6){return function(_0x55832a){if(_0x55832a){var _0x22c689=typeof _0x12c7a6[_0x3bdf('0x17')]===_0x3bdf('0x18')&&typeof _0x12c7a6[_0x3bdf('0x19')]===_0x3bdf('0x18');var _0x173e41=_0x55832a['count'];var _0x4f08ea=_0x22c689?0x0:_0x12c7a6['offset'];var _0x60b16e=_0x22c689?_0x55832a['count']:_0x12c7a6[_0x3bdf('0x17')]+_0x12c7a6[_0x3bdf('0x19')];var _0x356348;if(_0x60b16e>=_0x173e41){_0x60b16e=_0x173e41;_0x356348=0xc8;}else{_0x356348=0xce;}_0x587547[_0x3bdf('0x15')](_0x356348);return _0x587547[_0x3bdf('0x1a')](_0x3bdf('0x1b'),_0x4f08ea+'-'+_0x60b16e+'/'+_0x173e41)['json'](_0x55832a);}return null;};}function patchUpdates(_0x33d860){return function(_0xb793bf){try{jsonpatch[_0x3bdf('0x1c')](_0xb793bf,_0x33d860,!![]);}catch(_0x38ceb4){return BPromise[_0x3bdf('0x1d')](_0x38ceb4);}return _0xb793bf[_0x3bdf('0x1e')]();};}function saveUpdates(_0x3ff20c,_0x39eb65){return function(_0x5e8cdd){if(_0x5e8cdd){return _0x5e8cdd[_0x3bdf('0x1f')](_0x3ff20c)['then'](function(_0x4c8370){return _0x4c8370;});}return null;};}function removeEntity(_0x2e7dfe,_0x1d640c){return function(_0x416f47){if(_0x416f47){return _0x416f47['destroy']()[_0x3bdf('0x20')](function(){_0x2e7dfe[_0x3bdf('0x15')](0xcc)[_0x3bdf('0x21')]();});}};}function handleEntityNotFound(_0x534a0b,_0x6af546){return function(_0x57b9d2){if(!_0x57b9d2){_0x534a0b[_0x3bdf('0x14')](0x194);}return _0x57b9d2;};}function handleError(_0x5a25a0,_0x55388e){_0x55388e=_0x55388e||0x1f4;return function(_0x488abb){logger[_0x3bdf('0x22')](_0x488abb[_0x3bdf('0x23')]);if(_0x488abb[_0x3bdf('0x24')]){delete _0x488abb[_0x3bdf('0x24')];}_0x5a25a0[_0x3bdf('0x15')](_0x55388e)['send'](_0x488abb);};}exports[_0x3bdf('0x25')]=function(_0x495b29,_0x5d6c35){var _0x13b83f={},_0x20d340={},_0x23bfb1={'count':0x0,'rows':[]};var _0x2c6aae=_[_0x3bdf('0x26')](db['SmsTransferReport'][_0x3bdf('0x27')],function(_0x317204){return{'name':_0x317204[_0x3bdf('0x28')],'type':_0x317204['type'][_0x3bdf('0x29')]};});_0x20d340[_0x3bdf('0x2a')]=_['map'](_0x2c6aae,_0x3bdf('0x24'));_0x20d340[_0x3bdf('0x2b')]=_['keys'](_0x495b29[_0x3bdf('0x2b')]);_0x20d340[_0x3bdf('0x2c')]=_[_0x3bdf('0x2d')](_0x20d340['model'],_0x20d340[_0x3bdf('0x2b')]);_0x13b83f['attributes']=_[_0x3bdf('0x2d')](_0x20d340[_0x3bdf('0x2a')],qs[_0x3bdf('0x2e')](_0x495b29['query'][_0x3bdf('0x2e')]));_0x13b83f[_0x3bdf('0x2f')]=_0x13b83f[_0x3bdf('0x2f')]['length']?_0x13b83f['attributes']:_0x20d340[_0x3bdf('0x2a')];if(!_0x495b29[_0x3bdf('0x2b')][_0x3bdf('0x30')](_0x3bdf('0x31'))){_0x13b83f['limit']=qs[_0x3bdf('0x19')](_0x495b29[_0x3bdf('0x2b')][_0x3bdf('0x19')]);_0x13b83f[_0x3bdf('0x17')]=qs[_0x3bdf('0x17')](_0x495b29[_0x3bdf('0x2b')][_0x3bdf('0x17')]);}_0x13b83f[_0x3bdf('0x32')]=qs[_0x3bdf('0x33')](_0x495b29[_0x3bdf('0x2b')]['sort']);_0x13b83f[_0x3bdf('0x34')]=qs['filters'](_[_0x3bdf('0x35')](_0x495b29['query'],_0x20d340['filters']),_0x2c6aae);if(_0x495b29[_0x3bdf('0x2b')][_0x3bdf('0x36')]){_0x13b83f[_0x3bdf('0x34')]=_[_0x3bdf('0x37')](_0x13b83f[_0x3bdf('0x34')],{'$or':_['map'](_0x2c6aae,function(_0x3b987d){if(_0x3b987d['type']!==_0x3bdf('0x38')){var _0x4f7a51={};_0x4f7a51[_0x3b987d[_0x3bdf('0x24')]]={'$like':'%'+_0x495b29[_0x3bdf('0x2b')]['filter']+'%'};return _0x4f7a51;}})});}_0x13b83f=_[_0x3bdf('0x37')]({},_0x13b83f,_0x495b29[_0x3bdf('0x39')]);var _0x2678af={'where':_0x13b83f[_0x3bdf('0x34')]};return db[_0x3bdf('0x3a')][_0x3bdf('0x3b')](_0x2678af)['then'](function(_0x409fd8){_0x23bfb1[_0x3bdf('0x3b')]=_0x409fd8;if(_0x495b29['query']['includeAll']){_0x13b83f[_0x3bdf('0x3c')]=[{'all':!![]}];}return db[_0x3bdf('0x3a')][_0x3bdf('0x3d')](_0x13b83f);})[_0x3bdf('0x20')](function(_0x2f64b9){_0x23bfb1[_0x3bdf('0x3e')]=_0x2f64b9;return _0x23bfb1;})[_0x3bdf('0x20')](respondWithFilteredResult(_0x5d6c35,_0x13b83f))[_0x3bdf('0x3f')](handleError(_0x5d6c35,null));};exports[_0x3bdf('0x40')]=function(_0x5a0a62,_0x21e585){var _0x5a8b4b={'raw':!![],'where':{'id':_0x5a0a62[_0x3bdf('0x41')]['id']}},_0x201802={};_0x201802[_0x3bdf('0x2a')]=_[_0x3bdf('0x42')](db[_0x3bdf('0x3a')][_0x3bdf('0x27')]);_0x201802[_0x3bdf('0x2b')]=_[_0x3bdf('0x42')](_0x5a0a62[_0x3bdf('0x2b')]);_0x201802[_0x3bdf('0x2c')]=_[_0x3bdf('0x2d')](_0x201802[_0x3bdf('0x2a')],_0x201802[_0x3bdf('0x2b')]);_0x5a8b4b[_0x3bdf('0x2f')]=_[_0x3bdf('0x2d')](_0x201802[_0x3bdf('0x2a')],qs[_0x3bdf('0x2e')](_0x5a0a62['query'][_0x3bdf('0x2e')]));_0x5a8b4b[_0x3bdf('0x2f')]=_0x5a8b4b[_0x3bdf('0x2f')][_0x3bdf('0x43')]?_0x5a8b4b['attributes']:_0x201802[_0x3bdf('0x2a')];if(_0x5a0a62[_0x3bdf('0x2b')][_0x3bdf('0x44')]){_0x5a8b4b[_0x3bdf('0x3c')]=[{'all':!![]}];}_0x5a8b4b=_[_0x3bdf('0x37')]({},_0x5a8b4b,_0x5a0a62[_0x3bdf('0x39')]);return db[_0x3bdf('0x3a')][_0x3bdf('0x45')](_0x5a8b4b)[_0x3bdf('0x20')](handleEntityNotFound(_0x21e585,null))[_0x3bdf('0x20')](respondWithResult(_0x21e585,null))[_0x3bdf('0x3f')](handleError(_0x21e585,null));};exports['create']=function(_0xbb9f0,_0x4fd091){return db['SmsTransferReport'][_0x3bdf('0x46')](_0xbb9f0[_0x3bdf('0x47')],{})[_0x3bdf('0x20')](respondWithResult(_0x4fd091,0xc9))['catch'](handleError(_0x4fd091,null));};exports[_0x3bdf('0x1f')]=function(_0x31348d,_0x176397){if(_0x31348d[_0x3bdf('0x47')]['id']){delete _0x31348d['body']['id'];}return db[_0x3bdf('0x3a')]['find']({'where':{'id':_0x31348d[_0x3bdf('0x41')]['id']}})['then'](handleEntityNotFound(_0x176397,null))[_0x3bdf('0x20')](saveUpdates(_0x31348d[_0x3bdf('0x47')],null))['then'](respondWithResult(_0x176397,null))['catch'](handleError(_0x176397,null));};exports[_0x3bdf('0x48')]=function(_0x4cfa5c,_0xaae91c){return db[_0x3bdf('0x3a')][_0x3bdf('0x45')]({'where':{'id':_0x4cfa5c[_0x3bdf('0x41')]['id']}})['then'](handleEntityNotFound(_0xaae91c,null))['then'](removeEntity(_0xaae91c,null))['catch'](handleError(_0xaae91c,null));};exports[_0x3bdf('0x49')]=function(_0x10c7d3,_0x42a93f){return db[_0x3bdf('0x3a')][_0x3bdf('0x49')]()[_0x3bdf('0x20')](respondWithResult(_0x42a93f,null))[_0x3bdf('0x3f')](handleError(_0x42a93f,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 4be0fba..aba3e3d 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 _0xf2ca=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','report_sms_transfer','uniqueid','lodash','util'];(function(_0x1d390a,_0x434895){var _0x430632=function(_0xa3c188){while(--_0xa3c188){_0x1d390a['push'](_0x1d390a['shift']());}};_0x430632(++_0x434895);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x591cfd,_0x501204){_0x591cfd=_0x591cfd-0x0;var _0x4d0100=_0xf2ca[_0x591cfd];return _0x4d0100;};'use strict';var _=require(_0xaf2c('0x0'));var util=require(_0xaf2c('0x1'));var logger=require(_0xaf2c('0x2'))('api');var moment=require(_0xaf2c('0x3'));var BPromise=require(_0xaf2c('0x4'));var rp=require(_0xaf2c('0x5'));var fs=require('fs');var path=require(_0xaf2c('0x6'));var rimraf=require(_0xaf2c('0x7'));var config=require(_0xaf2c('0x8'));var attributes=require('./smsTransferReport.attributes');module[_0xaf2c('0x9')]=function(_0x100d17,_0x297740){return _0x100d17[_0xaf2c('0xa')]('SmsTransferReport',attributes,{'tableName':_0xaf2c('0xb'),'paranoid':![],'indexes':[{'name':_0xaf2c('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xd9a7=['util','../../config/logger','moment','request-promise','path','../../config/environment','define','SmsTransferReport','report_sms_transfer','uniqueid'];(function(_0x246c4f,_0x3e7484){var _0x1b4773=function(_0x4beb54){while(--_0x4beb54){_0x246c4f['push'](_0x246c4f['shift']());}};_0x1b4773(++_0x3e7484);}(_0xd9a7,0x12c));var _0x7d9a=function(_0x583b89,_0x4c698e){_0x583b89=_0x583b89-0x0;var _0x176e84=_0xd9a7[_0x583b89];return _0x176e84;};'use strict';var _=require('lodash');var util=require(_0x7d9a('0x0'));var logger=require(_0x7d9a('0x1'))('api');var moment=require(_0x7d9a('0x2'));var BPromise=require('bluebird');var rp=require(_0x7d9a('0x3'));var fs=require('fs');var path=require(_0x7d9a('0x4'));var rimraf=require('rimraf');var config=require(_0x7d9a('0x5'));var attributes=require('./smsTransferReport.attributes');module['exports']=function(_0x21ab18,_0x213963){return _0x21ab18[_0x7d9a('0x6')](_0x7d9a('0x7'),attributes,{'tableName':_0x7d9a('0x8'),'paranoid':![],'indexes':[{'name':_0x7d9a('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index b52bb78..663248c 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 _0xa0a1=['request\x20sent','error','code','SmsTransferReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x39507b,_0x3efdac){var _0x5e7dd4=function(_0x18527e){while(--_0x18527e){_0x39507b['push'](_0x39507b['shift']());}};_0x5e7dd4(++_0x3efdac);}(_0xa0a1,0x15b));var _0x1a0a=function(_0x510129,_0x3eb9e5){_0x510129=_0x510129-0x0;var _0x330334=_0xa0a1[_0x510129];return _0x330334;};'use strict';var _=require(_0x1a0a('0x0'));var util=require('util');var moment=require(_0x1a0a('0x1'));var BPromise=require(_0x1a0a('0x2'));var rs=require(_0x1a0a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1a0a('0x4'));var logger=require(_0x1a0a('0x5'))('rpc');var config=require(_0x1a0a('0x6'));var jayson=require(_0x1a0a('0x7'));var client=jayson['client'][_0x1a0a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xe59f97,_0x3fe29f,_0x245f3d){return new BPromise(function(_0x9da67c,_0x48d604){return client[_0x1a0a('0x9')](_0xe59f97,_0x245f3d)[_0x1a0a('0xa')](function(_0x8165a1){logger['info']('SmsTransferReport,\x20%s,\x20%s',_0x3fe29f,'request\x20sent');logger[_0x1a0a('0xb')](_0x1a0a('0xc'),_0x3fe29f,_0x1a0a('0xd'),JSON['stringify'](_0x8165a1));if(_0x8165a1[_0x1a0a('0xe')]){if(_0x8165a1['error'][_0x1a0a('0xf')]===0x1f4){logger[_0x1a0a('0xe')](_0x1a0a('0x10'),_0x3fe29f,_0x8165a1[_0x1a0a('0xe')][_0x1a0a('0x11')]);return _0x48d604(_0x8165a1[_0x1a0a('0xe')][_0x1a0a('0x11')]);}logger['error'](_0x1a0a('0x10'),_0x3fe29f,_0x8165a1[_0x1a0a('0xe')][_0x1a0a('0x11')]);return _0x9da67c(_0x8165a1[_0x1a0a('0xe')][_0x1a0a('0x11')]);}else{logger['info'](_0x1a0a('0x10'),_0x3fe29f,_0x1a0a('0xd'));_0x9da67c(_0x8165a1[_0x1a0a('0x12')]['message']);}})[_0x1a0a('0x13')](function(_0x57c942){logger[_0x1a0a('0xe')]('SmsTransferReport,\x20%s,\x20%s',_0x3fe29f,_0x57c942);_0x48d604(_0x57c942);});});} \ No newline at end of file +var _0xc43c=['../../config/logger','../../config/environment','jayson/promise','client','http','request','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x43ceb7,_0x20ed3c){var _0x4bfee7=function(_0x43f666){while(--_0x43f666){_0x43ceb7['push'](_0x43ceb7['shift']());}};_0x4bfee7(++_0x20ed3c);}(_0xc43c,0x152));var _0xcc43=function(_0x202d43,_0x530eb3){_0x202d43=_0x202d43-0x0;var _0x40e5a1=_0xc43c[_0x202d43];return _0x40e5a1;};'use strict';var _=require(_0xcc43('0x0'));var util=require(_0xcc43('0x1'));var moment=require(_0xcc43('0x2'));var BPromise=require(_0xcc43('0x3'));var rs=require(_0xcc43('0x4'));var fs=require('fs');var Redis=require(_0xcc43('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xcc43('0x6'));var logger=require(_0xcc43('0x7'))('rpc');var config=require(_0xcc43('0x8'));var jayson=require(_0xcc43('0x9'));var client=jayson[_0xcc43('0xa')][_0xcc43('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x9140b6,_0x13c316,_0x298aa7){return new BPromise(function(_0x3b8857,_0x1913c6){return client[_0xcc43('0xc')](_0x9140b6,_0x298aa7)['then'](function(_0x3f017e){logger[_0xcc43('0xd')](_0xcc43('0xe'),_0x13c316,_0xcc43('0xf'));logger[_0xcc43('0x10')](_0xcc43('0x11'),_0x13c316,'request\x20sent',JSON[_0xcc43('0x12')](_0x3f017e));if(_0x3f017e[_0xcc43('0x13')]){if(_0x3f017e[_0xcc43('0x13')][_0xcc43('0x14')]===0x1f4){logger[_0xcc43('0x13')](_0xcc43('0xe'),_0x13c316,_0x3f017e['error'][_0xcc43('0x15')]);return _0x1913c6(_0x3f017e['error'][_0xcc43('0x15')]);}logger[_0xcc43('0x13')]('SmsTransferReport,\x20%s,\x20%s',_0x13c316,_0x3f017e['error'][_0xcc43('0x15')]);return _0x3b8857(_0x3f017e[_0xcc43('0x13')][_0xcc43('0x15')]);}else{logger[_0xcc43('0xd')](_0xcc43('0xe'),_0x13c316,_0xcc43('0xf'));_0x3b8857(_0x3f017e['result']['message']);}})[_0xcc43('0x16')](function(_0x9b6dc){logger[_0xcc43('0x13')](_0xcc43('0xe'),_0x13c316,_0x9b6dc);_0x1913c6(_0x9b6dc);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 8136900..a31c809 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 _0x6dc0=['replace','%s-%s%s','basename','extname','now','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','index','/:id','show','/:id/download','download','diskStorage','join','originalname'];(function(_0x54c516,_0x420575){var _0x2583c0=function(_0x4171e4){while(--_0x4171e4){_0x54c516['push'](_0x54c516['shift']());}};_0x2583c0(++_0x420575);}(_0x6dc0,0x178));var _0x06dc=function(_0x77ec,_0x1aa9ab){_0x77ec=_0x77ec-0x0;var _0x4f2ab0=_0x6dc0[_0x77ec];return _0x4f2ab0;};'use strict';var multer=require(_0x06dc('0x0'));var util=require(_0x06dc('0x1'));var path=require(_0x06dc('0x2'));var timeout=require(_0x06dc('0x3'));var express=require(_0x06dc('0x4'));var router=express[_0x06dc('0x5')]();var fs_extra=require(_0x06dc('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x06dc('0x7'));var config=require(_0x06dc('0x8'));var controller=require(_0x06dc('0x9'));router[_0x06dc('0xa')]('/',auth[_0x06dc('0xb')](),controller[_0x06dc('0xc')]);router['get'](_0x06dc('0xd'),auth['isAuthenticated'](),controller[_0x06dc('0xe')]);router[_0x06dc('0xa')](_0x06dc('0xf'),auth[_0x06dc('0xb')](),controller[_0x06dc('0x10')]);var upload=multer({'storage':multer[_0x06dc('0x11')]({'destination':function(_0x2a41e3,_0x5ae69d,_0x3db206){_0x3db206(null,path[_0x06dc('0x12')](config['root'],'server/files/sounds/original/'));},'filename':function(_0x3b7a65,_0xdbc4d9,_0x157280){_0xdbc4d9[_0x06dc('0x13')]=_0xdbc4d9[_0x06dc('0x13')][_0x06dc('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x157280(null,util['format'](_0x06dc('0x15'),path[_0x06dc('0x16')](_0xdbc4d9['originalname'],path[_0x06dc('0x17')](_0xdbc4d9[_0x06dc('0x13')])),Date[_0x06dc('0x18')](),path[_0x06dc('0x17')](_0xdbc4d9[_0x06dc('0x13')])));}})});router[_0x06dc('0x19')]('/',upload[_0x06dc('0x1a')](_0x06dc('0x1b')),controller[_0x06dc('0x1c')]);router[_0x06dc('0x1d')](_0x06dc('0xd'),auth[_0x06dc('0xb')](),controller[_0x06dc('0x1e')]);router['delete'](_0x06dc('0xd'),auth['isAuthenticated'](),controller[_0x06dc('0x1f')]);module[_0x06dc('0x20')]=router; \ No newline at end of file +var _0xd335=['diskStorage','root','server/files/sounds/original/','originalname','replace','format','basename','extname','single','create','update','delete','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','isAuthenticated','index','get','/:id','show'];(function(_0x9e0cb3,_0x9cd497){var _0x5926b7=function(_0x30e82d){while(--_0x30e82d){_0x9e0cb3['push'](_0x9e0cb3['shift']());}};_0x5926b7(++_0x9cd497);}(_0xd335,0x9c));var _0x5d33=function(_0x2a1ee5,_0x5bbd59){_0x2a1ee5=_0x2a1ee5-0x0;var _0x3caf05=_0xd335[_0x2a1ee5];return _0x3caf05;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5d33('0x0'));var timeout=require(_0x5d33('0x1'));var express=require('express');var router=express[_0x5d33('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x5d33('0x3'));var interaction=require(_0x5d33('0x4'));var config=require(_0x5d33('0x5'));var controller=require(_0x5d33('0x6'));router['get']('/',auth[_0x5d33('0x7')](),controller[_0x5d33('0x8')]);router[_0x5d33('0x9')](_0x5d33('0xa'),auth[_0x5d33('0x7')](),controller[_0x5d33('0xb')]);router[_0x5d33('0x9')]('/:id/download',auth[_0x5d33('0x7')](),controller['download']);var upload=multer({'storage':multer[_0x5d33('0xc')]({'destination':function(_0x1efa6c,_0x54f44b,_0x160724){_0x160724(null,path['join'](config[_0x5d33('0xd')],_0x5d33('0xe')));},'filename':function(_0x2f4fd3,_0x18b9dc,_0x54435e){_0x18b9dc[_0x5d33('0xf')]=_0x18b9dc[_0x5d33('0xf')][_0x5d33('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x54435e(null,util[_0x5d33('0x11')]('%s-%s%s',path[_0x5d33('0x12')](_0x18b9dc['originalname'],path[_0x5d33('0x13')](_0x18b9dc[_0x5d33('0xf')])),Date['now'](),path['extname'](_0x18b9dc['originalname'])));}})});router['post']('/',upload[_0x5d33('0x14')]('file'),controller[_0x5d33('0x15')]);router['put'](_0x5d33('0xa'),auth['isAuthenticated'](),controller[_0x5d33('0x16')]);router[_0x5d33('0x17')]('/:id',auth[_0x5d33('0x7')](),controller[_0x5d33('0x17')]);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 cee5fb1..599d079 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 _0x9586=['sequelize','exports','STRING','name','BIGINT','INTEGER'];(function(_0x3bceea,_0x58af75){var _0x30a8d3=function(_0x1550b5){while(--_0x1550b5){_0x3bceea['push'](_0x3bceea['shift']());}};_0x30a8d3(++_0x58af75);}(_0x9586,0xd2));var _0x6958=function(_0x20b98d,_0x44653c){_0x20b98d=_0x20b98d-0x0;var _0xfeb29b=_0x9586[_0x20b98d];return _0xfeb29b;};'use strict';var Sequelize=require(_0x6958('0x0'));module[_0x6958('0x1')]={'name':{'type':Sequelize[_0x6958('0x2')],'unique':_0x6958('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0x6958('0x2')]},'display_name':{'type':Sequelize[_0x6958('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x6958('0x2')]},'original_format':{'type':Sequelize[_0x6958('0x2')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0x6958('0x4')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0x6958('0x4')]},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x6958('0x4')]},'converted_channelCount':{'type':Sequelize[_0x6958('0x5')]},'converted_bitRate':{'type':Sequelize[_0x6958('0x4')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x91dd=['sequelize','STRING','FLOAT','BIGINT','INTEGER'];(function(_0x37468f,_0x3fe01c){var _0x5551b7=function(_0x57b5f1){while(--_0x57b5f1){_0x37468f['push'](_0x37468f['shift']());}};_0x5551b7(++_0x3fe01c);}(_0x91dd,0x73));var _0xd91d=function(_0x1ecffa,_0x32f0b3){_0x1ecffa=_0x1ecffa-0x0;var _0x599a5e=_0x91dd[_0x1ecffa];return _0x599a5e;};'use strict';var Sequelize=require(_0xd91d('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0xd91d('0x1')]},'display_name':{'type':Sequelize[_0xd91d('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0xd91d('0x1')]},'original_format':{'type':Sequelize[_0xd91d('0x1')]},'original_duration':{'type':Sequelize[_0xd91d('0x2')]},'original_sampleCount':{'type':Sequelize[_0xd91d('0x3')]},'original_channelCount':{'type':Sequelize[_0xd91d('0x4')]},'original_bitRate':{'type':Sequelize[_0xd91d('0x3')]},'original_sampleRate':{'type':Sequelize[_0xd91d('0x4')]},'converted_format':{'type':Sequelize[_0xd91d('0x1')]},'converted_duration':{'type':Sequelize[_0xd91d('0x2')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0xd91d('0x4')]},'converted_bitRate':{'type':Sequelize[_0xd91d('0x3')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 39982d1..5f62486 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 _0x9ce6=['../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Sounds','UserProfileResource','sendStatus','stack','name','index','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','Sound','includeAll','include','rows','catch','show','params','find','save_name','existsSync','root','converted_format','Sequelize','Sound\x20not\x20found','download','server/files/sounds/converted','format','originalname','file','basename','filename','extname','substring','wav','join','server/files/sounds/original','%s.%s','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','error','unlinkSync','original_duration','sampleCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','delete','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x2da61b,_0xd52a4c){var _0x3e01fc=function(_0x593e34){while(--_0x593e34){_0x2da61b['push'](_0x2da61b['shift']());}};_0x3e01fc(++_0xd52a4c);}(_0x9ce6,0x1e8));var _0x69ce=function(_0x479e21,_0x385fd9){_0x479e21=_0x479e21-0x0;var _0x422e9c=_0x9ce6[_0x479e21];return _0x422e9c;};'use strict';var emlformat=require(_0x69ce('0x0'));var rimraf=require(_0x69ce('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x69ce('0x2'));var moment=require(_0x69ce('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x69ce('0x4'));var util=require(_0x69ce('0x5'));var path=require(_0x69ce('0x6'));var sox=require(_0x69ce('0x7'));var csv=require(_0x69ce('0x8'));var ejs=require(_0x69ce('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x69ce('0xa'));var crypto=require('crypto');var jsforce=require(_0x69ce('0xb'));var deskjs=require(_0x69ce('0xc'));var toCsv=require(_0x69ce('0x8'));var querystring=require(_0x69ce('0xd'));var Papa=require(_0x69ce('0xe'));var Redis=require('ioredis');var authService=require(_0x69ce('0xf'));var qs=require(_0x69ce('0x10'));var as=require(_0x69ce('0x11'));var hardwareService=require(_0x69ce('0x12'));var logger=require('../../config/logger')(_0x69ce('0x13'));var utils=require('../../config/utils');var config=require(_0x69ce('0x14'));var licenseUtil=require(_0x69ce('0x15'));var db=require(_0x69ce('0x16'))['db'];function respondWithStatusCode(_0x174674,_0x1d9acf){_0x1d9acf=_0x1d9acf||0xcc;return function(_0x56449c){if(_0x56449c){return _0x174674['sendStatus'](_0x1d9acf);}return _0x174674[_0x69ce('0x17')](_0x1d9acf)[_0x69ce('0x18')]();};}function respondWithResult(_0x2e5a76,_0x136541){_0x136541=_0x136541||0xc8;return function(_0x4d5024){if(_0x4d5024){return _0x2e5a76[_0x69ce('0x17')](_0x136541)[_0x69ce('0x19')](_0x4d5024);}};}function respondWithFilteredResult(_0x48a859,_0x791012){return function(_0x537455){if(_0x537455){var _0x1cc27a=typeof _0x791012[_0x69ce('0x1a')]===_0x69ce('0x1b')&&typeof _0x791012['limit']===_0x69ce('0x1b');var _0xc9f106=_0x537455['count'];var _0x1931d3=_0x1cc27a?0x0:_0x791012[_0x69ce('0x1a')];var _0x4f6980=_0x1cc27a?_0x537455[_0x69ce('0x1c')]:_0x791012[_0x69ce('0x1a')]+_0x791012[_0x69ce('0x1d')];var _0xd11314;if(_0x4f6980>=_0xc9f106){_0x4f6980=_0xc9f106;_0xd11314=0xc8;}else{_0xd11314=0xce;}_0x48a859['status'](_0xd11314);return _0x48a859[_0x69ce('0x1e')](_0x69ce('0x1f'),_0x1931d3+'-'+_0x4f6980+'/'+_0xc9f106)[_0x69ce('0x19')](_0x537455);}return null;};}function patchUpdates(_0x4ce40c){return function(_0xb60e2e){try{jsonpatch[_0x69ce('0x20')](_0xb60e2e,_0x4ce40c,!![]);}catch(_0x117953){return BPromise[_0x69ce('0x21')](_0x117953);}return _0xb60e2e[_0x69ce('0x22')]();};}function saveUpdates(_0xcfd658,_0x384a3c){return function(_0x1de2ec){if(_0x1de2ec){return _0x1de2ec[_0x69ce('0x23')](_0xcfd658)[_0x69ce('0x24')](function(_0x158d03){return _0x158d03;});}return null;};}function removeEntity(_0x1e461a,_0x513dd2){return function(_0x1eeb96){if(_0x1eeb96){return _0x1eeb96[_0x69ce('0x25')]()[_0x69ce('0x24')](function(){var _0x552379=_0x1eeb96[_0x69ce('0x26')]({'plain':!![]});var _0x2b3bf7=_0x69ce('0x27');return db[_0x69ce('0x28')]['destroy']({'where':{'type':_0x2b3bf7,'resourceId':_0x552379['id']}})['then'](function(){return _0x1eeb96;});})['then'](function(){_0x1e461a[_0x69ce('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43c0bd,_0x28150f){return function(_0x3bd670){if(!_0x3bd670){_0x43c0bd[_0x69ce('0x29')](0x194);}return _0x3bd670;};}function handleError(_0x352eba,_0x4a5e0c){_0x4a5e0c=_0x4a5e0c||0x1f4;return function(_0x40d5b7){logger['error'](_0x40d5b7[_0x69ce('0x2a')]);if(_0x40d5b7[_0x69ce('0x2b')]){delete _0x40d5b7['name'];}_0x352eba[_0x69ce('0x17')](_0x4a5e0c)['send'](_0x40d5b7);};}exports[_0x69ce('0x2c')]=function(_0x5bcd1d,_0x24eabb){var _0x452111={},_0x1130cd={},_0x108f43={'count':0x0,'rows':[]};var _0x4cd168=_[_0x69ce('0x2d')](db['Sound'][_0x69ce('0x2e')],function(_0x58b593){return{'name':_0x58b593[_0x69ce('0x2f')],'type':_0x58b593[_0x69ce('0x30')][_0x69ce('0x31')]};});_0x1130cd[_0x69ce('0x32')]=_[_0x69ce('0x2d')](_0x4cd168,_0x69ce('0x2b'));_0x1130cd['query']=_[_0x69ce('0x33')](_0x5bcd1d['query']);_0x1130cd[_0x69ce('0x34')]=_[_0x69ce('0x35')](_0x1130cd['model'],_0x1130cd[_0x69ce('0x36')]);_0x452111[_0x69ce('0x37')]=_[_0x69ce('0x35')](_0x1130cd[_0x69ce('0x32')],qs[_0x69ce('0x38')](_0x5bcd1d['query'][_0x69ce('0x38')]));_0x452111[_0x69ce('0x37')]=_0x452111[_0x69ce('0x37')][_0x69ce('0x39')]?_0x452111[_0x69ce('0x37')]:_0x1130cd[_0x69ce('0x32')];if(!_0x5bcd1d['query'][_0x69ce('0x3a')]('nolimit')){_0x452111[_0x69ce('0x1d')]=qs['limit'](_0x5bcd1d[_0x69ce('0x36')][_0x69ce('0x1d')]);_0x452111['offset']=qs[_0x69ce('0x1a')](_0x5bcd1d['query']['offset']);}_0x452111[_0x69ce('0x3b')]=qs[_0x69ce('0x3c')](_0x5bcd1d[_0x69ce('0x36')][_0x69ce('0x3c')]);_0x452111[_0x69ce('0x3d')]=qs[_0x69ce('0x34')](_[_0x69ce('0x3e')](_0x5bcd1d[_0x69ce('0x36')],_0x1130cd[_0x69ce('0x34')]),_0x4cd168);if(_0x5bcd1d[_0x69ce('0x36')][_0x69ce('0x3f')]){_0x452111[_0x69ce('0x3d')]=_[_0x69ce('0x40')](_0x452111[_0x69ce('0x3d')],{'$or':_[_0x69ce('0x2d')](_0x4cd168,function(_0x30f3fb){if(_0x30f3fb[_0x69ce('0x30')]!==_0x69ce('0x41')){var _0x3c4ca6={};_0x3c4ca6[_0x30f3fb[_0x69ce('0x2b')]]={'$like':'%'+_0x5bcd1d[_0x69ce('0x36')][_0x69ce('0x3f')]+'%'};return _0x3c4ca6;}})});}_0x452111=_[_0x69ce('0x40')]({},_0x452111,_0x5bcd1d[_0x69ce('0x42')]);var _0x57e1dd={'where':_0x452111['where']};return db[_0x69ce('0x43')][_0x69ce('0x1c')](_0x57e1dd)[_0x69ce('0x24')](function(_0x395d67){_0x108f43['count']=_0x395d67;if(_0x5bcd1d[_0x69ce('0x36')][_0x69ce('0x44')]){_0x452111[_0x69ce('0x45')]=[{'all':!![]}];}return db[_0x69ce('0x43')]['findAll'](_0x452111);})[_0x69ce('0x24')](function(_0x253df2){_0x108f43[_0x69ce('0x46')]=_0x253df2;return _0x108f43;})[_0x69ce('0x24')](respondWithFilteredResult(_0x24eabb,_0x452111))[_0x69ce('0x47')](handleError(_0x24eabb,null));};exports[_0x69ce('0x48')]=function(_0x1f7656,_0x3d207c){var _0x5dda75={'raw':!![],'where':{'id':_0x1f7656[_0x69ce('0x49')]['id']}},_0x3ae72c={};_0x3ae72c[_0x69ce('0x32')]=_['keys'](db[_0x69ce('0x43')][_0x69ce('0x2e')]);_0x3ae72c[_0x69ce('0x36')]=_[_0x69ce('0x33')](_0x1f7656[_0x69ce('0x36')]);_0x3ae72c[_0x69ce('0x34')]=_[_0x69ce('0x35')](_0x3ae72c[_0x69ce('0x32')],_0x3ae72c[_0x69ce('0x36')]);_0x5dda75[_0x69ce('0x37')]=_['intersection'](_0x3ae72c['model'],qs[_0x69ce('0x38')](_0x1f7656['query'][_0x69ce('0x38')]));_0x5dda75[_0x69ce('0x37')]=_0x5dda75['attributes']['length']?_0x5dda75['attributes']:_0x3ae72c[_0x69ce('0x32')];if(_0x1f7656[_0x69ce('0x36')][_0x69ce('0x44')]){_0x5dda75[_0x69ce('0x45')]=[{'all':!![]}];}_0x5dda75=_[_0x69ce('0x40')]({},_0x5dda75,_0x1f7656[_0x69ce('0x42')]);return db[_0x69ce('0x43')][_0x69ce('0x4a')](_0x5dda75)[_0x69ce('0x24')](handleEntityNotFound(_0x3d207c,null))[_0x69ce('0x24')](respondWithResult(_0x3d207c,null))[_0x69ce('0x47')](handleError(_0x3d207c,null));};exports['download']=function(_0x82e202,_0x416f11,_0x50f2be){return db['Sound']['find']({'where':{'id':_0x82e202[_0x69ce('0x49')]['id']},'attributes':[_0x69ce('0x2b'),_0x69ce('0x4b'),'converted_format'],'raw':!![]})[_0x69ce('0x24')](handleEntityNotFound(_0x416f11,null))[_0x69ce('0x24')](function(_0x28741d){if(_0x28741d){if(!fs[_0x69ce('0x4c')](path['join'](config[_0x69ce('0x4d')],'server/files/sounds/converted',_0x28741d[_0x69ce('0x4b')]+'.'+_0x28741d[_0x69ce('0x4e')]))){throw new db[(_0x69ce('0x4f'))]['ValidationError'](_0x69ce('0x50'));}return _0x416f11[_0x69ce('0x51')](path['join'](config[_0x69ce('0x4d')],_0x69ce('0x52'),util['format']('%s.%s',_0x28741d[_0x69ce('0x4b')],_0x28741d[_0x69ce('0x4e')])),util[_0x69ce('0x53')]('%s.%s',_0x28741d[_0x69ce('0x2b')],_0x28741d[_0x69ce('0x4e')]));}return null;})['catch'](handleError(_0x416f11,null));};exports['create']=function(_0x3a80bc,_0x2882a9,_0x19a86f){var _0x42a721={'name':path['basename'](_0x3a80bc['file'][_0x69ce('0x54')],path['extname'](_0x3a80bc[_0x69ce('0x55')][_0x69ce('0x54')])),'save_name':path[_0x69ce('0x56')](_0x3a80bc[_0x69ce('0x55')][_0x69ce('0x57')],path[_0x69ce('0x58')](_0x3a80bc[_0x69ce('0x55')]['filename'])),'original_format':path[_0x69ce('0x58')](_0x3a80bc[_0x69ce('0x55')]['originalname'])[_0x69ce('0x59')](0x1),'converted_format':_0x69ce('0x5a')};var _0x17f732=path[_0x69ce('0x5b')](config[_0x69ce('0x4d')],_0x69ce('0x5c'),_0x3a80bc[_0x69ce('0x55')][_0x69ce('0x57')]);var _0x25f50c=path[_0x69ce('0x5b')](config[_0x69ce('0x4d')],_0x69ce('0x52'),util[_0x69ce('0x53')](_0x69ce('0x5d'),path['basename'](_0x3a80bc['file'][_0x69ce('0x57')],path[_0x69ce('0x58')](_0x3a80bc[_0x69ce('0x55')]['filename'])),_0x42a721[_0x69ce('0x4e')]));logger[_0x69ce('0x5e')](_0x69ce('0x5f'),_0x17f732);logger['info'](_0x69ce('0x60'),_0x25f50c);try{fs[_0x69ce('0x61')](_0x17f732,parseInt(_0x69ce('0x62'),0x8));var _0x5880e1=sox[_0x69ce('0x63')](_0x17f732,_0x25f50c,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5880e1['on'](_0x69ce('0x64'),function(_0x54d326){fs[_0x69ce('0x65')](_0x17f732);_0x2882a9[_0x69ce('0x17')](0x1f4)['send'](_0x54d326);});_0x5880e1['on']('src',function(_0x43bb7a){_0x42a721[_0x69ce('0x66')]=isNaN(_0x43bb7a['duration'])?null:_0x43bb7a['duration']*0x3e8;_0x42a721['original_sampleCount']=isNaN(_0x43bb7a['sampleCount'])?null:_0x43bb7a[_0x69ce('0x67')];_0x42a721['original_channelCount']=isNaN(_0x43bb7a['channelCount'])?null:_0x43bb7a[_0x69ce('0x68')];_0x42a721[_0x69ce('0x69')]=isNaN(_0x43bb7a[_0x69ce('0x6a')])?null:_0x43bb7a[_0x69ce('0x6a')];_0x42a721[_0x69ce('0x6b')]=isNaN(_0x43bb7a[_0x69ce('0x6c')])?null:_0x43bb7a[_0x69ce('0x6c')];});_0x5880e1['on'](_0x69ce('0x6d'),function(_0x467f35){_0x42a721[_0x69ce('0x6e')]=isNaN(_0x467f35[_0x69ce('0x6f')])?null:_0x467f35['duration']*0x3e8;_0x42a721[_0x69ce('0x70')]=isNaN(_0x467f35[_0x69ce('0x67')])?null:_0x467f35['sampleCount'];_0x42a721[_0x69ce('0x71')]=isNaN(_0x467f35[_0x69ce('0x68')])?null:_0x467f35[_0x69ce('0x68')];_0x42a721[_0x69ce('0x72')]=isNaN(_0x467f35[_0x69ce('0x6a')])?null:_0x467f35[_0x69ce('0x6a')];_0x42a721[_0x69ce('0x73')]=isNaN(_0x467f35[_0x69ce('0x6c')])?null:_0x467f35[_0x69ce('0x6c')];});_0x5880e1['on'](_0x69ce('0x18'),function(){fs['chmodSync'](_0x25f50c,parseInt('0777',0x8));return db[_0x69ce('0x43')][_0x69ce('0x74')](_0x42a721)[_0x69ce('0x24')](function(_0x26d9f1){var _0x43aab3={'role':_0x3a80bc[_0x69ce('0x75')][_0x69ce('0x76')],'userProfileId':_0x3a80bc['body'][_0x69ce('0x77')]};if(!_0x43aab3)throw new Error(_0x69ce('0x78'));if(_0x43aab3[_0x69ce('0x76')]===_0x69ce('0x79')){var _0x35b55e=_0x26d9f1['get']({'plain':!![]});return db[_0x69ce('0x7a')][_0x69ce('0x4a')]({'where':{'name':_0x69ce('0x27'),'userProfileId':_0x43aab3[_0x69ce('0x77')]},'raw':!![]})['then'](function(_0x2a0b15){if(_0x2a0b15&&_0x2a0b15[_0x69ce('0x7b')]===0x0){return db[_0x69ce('0x28')]['create']({'name':_0x35b55e['name'],'resourceId':_0x35b55e['id'],'type':_0x2a0b15[_0x69ce('0x2b')],'sectionId':_0x2a0b15['id']},{})[_0x69ce('0x24')](function(){return _0x26d9f1;});}else{return _0x26d9f1;}})['catch'](function(_0x5a7bb0){logger[_0x69ce('0x64')](_0x69ce('0x7c'),_0x5a7bb0);throw _0x5a7bb0;});}return _0x26d9f1;})[_0x69ce('0x24')](respondWithResult(_0x2882a9,null))[_0x69ce('0x47')](handleError(_0x2882a9,null));});_0x5880e1[_0x69ce('0x7d')]();}catch(_0x4f7b78){_0x2882a9[_0x69ce('0x17')](0x1f4)['send'](_0x4f7b78);}};exports['update']=function(_0xf55e19,_0x7bb69a,_0x157e69){return db[_0x69ce('0x43')][_0x69ce('0x4a')]({'where':{'id':_0xf55e19[_0x69ce('0x49')]['id']}})['then'](handleEntityNotFound(_0x7bb69a,null))[_0x69ce('0x24')](saveUpdates(_[_0x69ce('0x3e')](_0xf55e19[_0x69ce('0x75')],[_0x69ce('0x2b'),'description']),null))[_0x69ce('0x24')](respondWithResult(_0x7bb69a,null))['catch'](handleError(_0x7bb69a,null));};exports[_0x69ce('0x7e')]=function(_0x4da1c8,_0x316c5a,_0x1f2669){return db[_0x69ce('0x43')][_0x69ce('0x4a')]({'where':{'id':_0x4da1c8[_0x69ce('0x49')]['id']}})[_0x69ce('0x24')](function(_0x4ab896){if(_0x4ab896){return _0x4ab896[_0x69ce('0x25')]();}})[_0x69ce('0x24')](function(_0x585f71){var _0x1e1c89=path[_0x69ce('0x5b')](config[_0x69ce('0x4d')],_0x69ce('0x5c'),util['format'](_0x69ce('0x5d'),_0x585f71['save_name'],_0x585f71['original_format']));var _0x4ddf98=path[_0x69ce('0x5b')](config[_0x69ce('0x4d')],'server/files/sounds/converted',util[_0x69ce('0x53')]('%s.%s',_0x585f71['save_name'],_0x585f71[_0x69ce('0x4e')]));fs[_0x69ce('0x65')](_0x1e1c89);fs['unlinkSync'](_0x4ddf98);return _0x585f71;})[_0x69ce('0x24')](function(_0x472411){if(_0x472411){return _0x316c5a[_0x69ce('0x17')](0xcc)['end']();}})[_0x69ce('0x24')](handleEntityNotFound(_0x316c5a,null))['catch'](handleError(_0x316c5a,null));}; \ No newline at end of file +var _0xcf07=['../../config/utils','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','stack','name','send','index','map','Sound','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','length','find','download','params','save_name','converted_format','existsSync','root','server/files/sounds/converted','Sequelize','Sound\x20not\x20found','join','format','%s.%s','create','basename','file','originalname','extname','filename','wav','server/files/sounds/original','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','src','original_duration','duration','sampleCount','original_channelCount','channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_channelCount','converted_bitRate','body','role','user','UserProfileSection','Sounds','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','original_format','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x3eb265,_0x230a06){var _0x4da174=function(_0x59892e){while(--_0x59892e){_0x3eb265['push'](_0x3eb265['shift']());}};_0x4da174(++_0x230a06);}(_0xcf07,0x68));var _0x7cf0=function(_0x22c684,_0x753309){_0x22c684=_0x22c684-0x0;var _0x39fcbb=_0xcf07[_0x22c684];return _0x39fcbb;};'use strict';var emlformat=require(_0x7cf0('0x0'));var rimraf=require(_0x7cf0('0x1'));var zipdir=require(_0x7cf0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7cf0('0x3'));var BPromise=require(_0x7cf0('0x4'));var Mustache=require(_0x7cf0('0x5'));var util=require(_0x7cf0('0x6'));var path=require(_0x7cf0('0x7'));var sox=require(_0x7cf0('0x8'));var csv=require(_0x7cf0('0x9'));var ejs=require(_0x7cf0('0xa'));var fs=require('fs');var fs_extra=require(_0x7cf0('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x7cf0('0xc'));var jsforce=require(_0x7cf0('0xd'));var deskjs=require(_0x7cf0('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7cf0('0xf'));var Papa=require(_0x7cf0('0x10'));var Redis=require(_0x7cf0('0x11'));var authService=require(_0x7cf0('0x12'));var qs=require(_0x7cf0('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7cf0('0x14'));var logger=require(_0x7cf0('0x15'))('api');var utils=require(_0x7cf0('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x7cf0('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x329087,_0x4673f0){_0x4673f0=_0x4673f0||0xcc;return function(_0x9afb5){if(_0x9afb5){return _0x329087[_0x7cf0('0x18')](_0x4673f0);}return _0x329087['status'](_0x4673f0)[_0x7cf0('0x19')]();};}function respondWithResult(_0x13eed2,_0x22914b){_0x22914b=_0x22914b||0xc8;return function(_0xf1712e){if(_0xf1712e){return _0x13eed2[_0x7cf0('0x1a')](_0x22914b)[_0x7cf0('0x1b')](_0xf1712e);}};}function respondWithFilteredResult(_0x6e41f7,_0x441815){return function(_0x58fd04){if(_0x58fd04){var _0x2e3c98=typeof _0x441815[_0x7cf0('0x1c')]===_0x7cf0('0x1d')&&typeof _0x441815[_0x7cf0('0x1e')]===_0x7cf0('0x1d');var _0x337b50=_0x58fd04[_0x7cf0('0x1f')];var _0x3c3bdf=_0x2e3c98?0x0:_0x441815[_0x7cf0('0x1c')];var _0x213d24=_0x2e3c98?_0x58fd04[_0x7cf0('0x1f')]:_0x441815[_0x7cf0('0x1c')]+_0x441815[_0x7cf0('0x1e')];var _0x29d508;if(_0x213d24>=_0x337b50){_0x213d24=_0x337b50;_0x29d508=0xc8;}else{_0x29d508=0xce;}_0x6e41f7[_0x7cf0('0x1a')](_0x29d508);return _0x6e41f7[_0x7cf0('0x20')](_0x7cf0('0x21'),_0x3c3bdf+'-'+_0x213d24+'/'+_0x337b50)['json'](_0x58fd04);}return null;};}function patchUpdates(_0x422de4){return function(_0xf904c0){try{jsonpatch[_0x7cf0('0x22')](_0xf904c0,_0x422de4,!![]);}catch(_0x543221){return BPromise[_0x7cf0('0x23')](_0x543221);}return _0xf904c0[_0x7cf0('0x24')]();};}function saveUpdates(_0x46f077,_0xb66df6){return function(_0x1991d8){if(_0x1991d8){return _0x1991d8[_0x7cf0('0x25')](_0x46f077)[_0x7cf0('0x26')](function(_0x42cd27){return _0x42cd27;});}return null;};}function removeEntity(_0x42659e,_0x36b154){return function(_0x7101b7){if(_0x7101b7){return _0x7101b7[_0x7cf0('0x27')]()[_0x7cf0('0x26')](function(){var _0x2b6dea=_0x7101b7[_0x7cf0('0x28')]({'plain':!![]});var _0x46aff4='Sounds';return db[_0x7cf0('0x29')][_0x7cf0('0x27')]({'where':{'type':_0x46aff4,'resourceId':_0x2b6dea['id']}})[_0x7cf0('0x26')](function(){return _0x7101b7;});})[_0x7cf0('0x26')](function(){_0x42659e[_0x7cf0('0x1a')](0xcc)[_0x7cf0('0x19')]();});}};}function handleEntityNotFound(_0x32377e,_0x57ba4a){return function(_0x220c75){if(!_0x220c75){_0x32377e[_0x7cf0('0x18')](0x194);}return _0x220c75;};}function handleError(_0x46158c,_0x4f20de){_0x4f20de=_0x4f20de||0x1f4;return function(_0x158c2f){logger['error'](_0x158c2f[_0x7cf0('0x2a')]);if(_0x158c2f[_0x7cf0('0x2b')]){delete _0x158c2f[_0x7cf0('0x2b')];}_0x46158c[_0x7cf0('0x1a')](_0x4f20de)[_0x7cf0('0x2c')](_0x158c2f);};}exports[_0x7cf0('0x2d')]=function(_0x3e5ffb,_0x3dedc0){var _0x47a34a={},_0x7a2a1c={},_0x540901={'count':0x0,'rows':[]};var _0x1b89c1=_[_0x7cf0('0x2e')](db[_0x7cf0('0x2f')][_0x7cf0('0x30')],function(_0x45b137){return{'name':_0x45b137[_0x7cf0('0x31')],'type':_0x45b137[_0x7cf0('0x32')][_0x7cf0('0x33')]};});_0x7a2a1c['model']=_[_0x7cf0('0x2e')](_0x1b89c1,_0x7cf0('0x2b'));_0x7a2a1c[_0x7cf0('0x34')]=_[_0x7cf0('0x35')](_0x3e5ffb['query']);_0x7a2a1c[_0x7cf0('0x36')]=_[_0x7cf0('0x37')](_0x7a2a1c[_0x7cf0('0x38')],_0x7a2a1c[_0x7cf0('0x34')]);_0x47a34a[_0x7cf0('0x39')]=_[_0x7cf0('0x37')](_0x7a2a1c['model'],qs[_0x7cf0('0x3a')](_0x3e5ffb[_0x7cf0('0x34')][_0x7cf0('0x3a')]));_0x47a34a[_0x7cf0('0x39')]=_0x47a34a['attributes']['length']?_0x47a34a[_0x7cf0('0x39')]:_0x7a2a1c['model'];if(!_0x3e5ffb[_0x7cf0('0x34')]['hasOwnProperty']('nolimit')){_0x47a34a['limit']=qs[_0x7cf0('0x1e')](_0x3e5ffb[_0x7cf0('0x34')][_0x7cf0('0x1e')]);_0x47a34a[_0x7cf0('0x1c')]=qs['offset'](_0x3e5ffb['query']['offset']);}_0x47a34a[_0x7cf0('0x3b')]=qs['sort'](_0x3e5ffb[_0x7cf0('0x34')][_0x7cf0('0x3c')]);_0x47a34a[_0x7cf0('0x3d')]=qs['filters'](_[_0x7cf0('0x3e')](_0x3e5ffb[_0x7cf0('0x34')],_0x7a2a1c[_0x7cf0('0x36')]),_0x1b89c1);if(_0x3e5ffb[_0x7cf0('0x34')][_0x7cf0('0x3f')]){_0x47a34a['where']=_[_0x7cf0('0x40')](_0x47a34a[_0x7cf0('0x3d')],{'$or':_[_0x7cf0('0x2e')](_0x1b89c1,function(_0x181525){if(_0x181525[_0x7cf0('0x32')]!==_0x7cf0('0x41')){var _0x57db3e={};_0x57db3e[_0x181525['name']]={'$like':'%'+_0x3e5ffb['query'][_0x7cf0('0x3f')]+'%'};return _0x57db3e;}})});}_0x47a34a=_[_0x7cf0('0x40')]({},_0x47a34a,_0x3e5ffb['options']);var _0x7737b9={'where':_0x47a34a[_0x7cf0('0x3d')]};return db['Sound'][_0x7cf0('0x1f')](_0x7737b9)['then'](function(_0x2d2fba){_0x540901[_0x7cf0('0x1f')]=_0x2d2fba;if(_0x3e5ffb['query'][_0x7cf0('0x42')]){_0x47a34a[_0x7cf0('0x43')]=[{'all':!![]}];}return db['Sound'][_0x7cf0('0x44')](_0x47a34a);})[_0x7cf0('0x26')](function(_0x591567){_0x540901[_0x7cf0('0x45')]=_0x591567;return _0x540901;})['then'](respondWithFilteredResult(_0x3dedc0,_0x47a34a))[_0x7cf0('0x46')](handleError(_0x3dedc0,null));};exports[_0x7cf0('0x47')]=function(_0x32f516,_0x3ef087){var _0x240708={'raw':!![],'where':{'id':_0x32f516['params']['id']}},_0x26912d={};_0x26912d[_0x7cf0('0x38')]=_[_0x7cf0('0x35')](db[_0x7cf0('0x2f')]['rawAttributes']);_0x26912d[_0x7cf0('0x34')]=_[_0x7cf0('0x35')](_0x32f516[_0x7cf0('0x34')]);_0x26912d[_0x7cf0('0x36')]=_['intersection'](_0x26912d[_0x7cf0('0x38')],_0x26912d[_0x7cf0('0x34')]);_0x240708[_0x7cf0('0x39')]=_[_0x7cf0('0x37')](_0x26912d[_0x7cf0('0x38')],qs['fields'](_0x32f516[_0x7cf0('0x34')]['fields']));_0x240708[_0x7cf0('0x39')]=_0x240708['attributes'][_0x7cf0('0x48')]?_0x240708['attributes']:_0x26912d[_0x7cf0('0x38')];if(_0x32f516['query'][_0x7cf0('0x42')]){_0x240708[_0x7cf0('0x43')]=[{'all':!![]}];}_0x240708=_[_0x7cf0('0x40')]({},_0x240708,_0x32f516['options']);return db['Sound'][_0x7cf0('0x49')](_0x240708)[_0x7cf0('0x26')](handleEntityNotFound(_0x3ef087,null))[_0x7cf0('0x26')](respondWithResult(_0x3ef087,null))[_0x7cf0('0x46')](handleError(_0x3ef087,null));};exports[_0x7cf0('0x4a')]=function(_0xa8823e,_0x4cac39,_0x1a2124){return db[_0x7cf0('0x2f')]['find']({'where':{'id':_0xa8823e[_0x7cf0('0x4b')]['id']},'attributes':[_0x7cf0('0x2b'),_0x7cf0('0x4c'),_0x7cf0('0x4d')],'raw':!![]})[_0x7cf0('0x26')](handleEntityNotFound(_0x4cac39,null))[_0x7cf0('0x26')](function(_0x522f45){if(_0x522f45){if(!fs[_0x7cf0('0x4e')](path['join'](config[_0x7cf0('0x4f')],_0x7cf0('0x50'),_0x522f45[_0x7cf0('0x4c')]+'.'+_0x522f45['converted_format']))){throw new db[(_0x7cf0('0x51'))]['ValidationError'](_0x7cf0('0x52'));}return _0x4cac39[_0x7cf0('0x4a')](path[_0x7cf0('0x53')](config['root'],_0x7cf0('0x50'),util[_0x7cf0('0x54')](_0x7cf0('0x55'),_0x522f45['save_name'],_0x522f45[_0x7cf0('0x4d')])),util[_0x7cf0('0x54')](_0x7cf0('0x55'),_0x522f45[_0x7cf0('0x2b')],_0x522f45[_0x7cf0('0x4d')]));}return null;})['catch'](handleError(_0x4cac39,null));};exports[_0x7cf0('0x56')]=function(_0x429065,_0x21a2c3,_0x328cbb){var _0x76c013={'name':path[_0x7cf0('0x57')](_0x429065[_0x7cf0('0x58')][_0x7cf0('0x59')],path[_0x7cf0('0x5a')](_0x429065[_0x7cf0('0x58')][_0x7cf0('0x59')])),'save_name':path[_0x7cf0('0x57')](_0x429065['file'][_0x7cf0('0x5b')],path[_0x7cf0('0x5a')](_0x429065[_0x7cf0('0x58')][_0x7cf0('0x5b')])),'original_format':path[_0x7cf0('0x5a')](_0x429065['file'][_0x7cf0('0x59')])['substring'](0x1),'converted_format':_0x7cf0('0x5c')};var _0x1a3c07=path[_0x7cf0('0x53')](config['root'],_0x7cf0('0x5d'),_0x429065[_0x7cf0('0x58')][_0x7cf0('0x5b')]);var _0x26584e=path[_0x7cf0('0x53')](config[_0x7cf0('0x4f')],_0x7cf0('0x50'),util[_0x7cf0('0x54')](_0x7cf0('0x55'),path[_0x7cf0('0x57')](_0x429065['file'][_0x7cf0('0x5b')],path[_0x7cf0('0x5a')](_0x429065[_0x7cf0('0x58')]['filename'])),_0x76c013[_0x7cf0('0x4d')]));logger[_0x7cf0('0x5e')]('Sound\x20upload\x20filepath:\x20%s',_0x1a3c07);logger[_0x7cf0('0x5e')](_0x7cf0('0x5f'),_0x26584e);try{fs[_0x7cf0('0x60')](_0x1a3c07,parseInt(_0x7cf0('0x61'),0x8));var _0x1992a4=sox[_0x7cf0('0x62')](_0x1a3c07,_0x26584e,{'sampleRate':0x1f40,'format':_0x7cf0('0x5c'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1992a4['on']('error',function(_0x55ab0f){fs[_0x7cf0('0x63')](_0x1a3c07);_0x21a2c3[_0x7cf0('0x1a')](0x1f4)[_0x7cf0('0x2c')](_0x55ab0f);});_0x1992a4['on'](_0x7cf0('0x64'),function(_0x1e771f){_0x76c013[_0x7cf0('0x65')]=isNaN(_0x1e771f[_0x7cf0('0x66')])?null:_0x1e771f[_0x7cf0('0x66')]*0x3e8;_0x76c013['original_sampleCount']=isNaN(_0x1e771f['sampleCount'])?null:_0x1e771f[_0x7cf0('0x67')];_0x76c013[_0x7cf0('0x68')]=isNaN(_0x1e771f[_0x7cf0('0x69')])?null:_0x1e771f['channelCount'];_0x76c013['original_bitRate']=isNaN(_0x1e771f[_0x7cf0('0x6a')])?null:_0x1e771f['bitRate'];_0x76c013[_0x7cf0('0x6b')]=isNaN(_0x1e771f[_0x7cf0('0x6c')])?null:_0x1e771f[_0x7cf0('0x6c')];});_0x1992a4['on'](_0x7cf0('0x6d'),function(_0x248ee4){_0x76c013[_0x7cf0('0x6e')]=isNaN(_0x248ee4['duration'])?null:_0x248ee4[_0x7cf0('0x66')]*0x3e8;_0x76c013['converted_sampleCount']=isNaN(_0x248ee4['sampleCount'])?null:_0x248ee4[_0x7cf0('0x67')];_0x76c013[_0x7cf0('0x6f')]=isNaN(_0x248ee4[_0x7cf0('0x69')])?null:_0x248ee4[_0x7cf0('0x69')];_0x76c013[_0x7cf0('0x70')]=isNaN(_0x248ee4[_0x7cf0('0x6a')])?null:_0x248ee4['bitRate'];_0x76c013['converted_sampleRate']=isNaN(_0x248ee4[_0x7cf0('0x6c')])?null:_0x248ee4['sampleRate'];});_0x1992a4['on']('end',function(){fs[_0x7cf0('0x60')](_0x26584e,parseInt(_0x7cf0('0x61'),0x8));return db['Sound']['create'](_0x76c013)[_0x7cf0('0x26')](function(_0xe306a0){var _0x46f73b={'role':_0x429065[_0x7cf0('0x71')][_0x7cf0('0x72')],'userProfileId':_0x429065[_0x7cf0('0x71')]['userProfileId']};if(!_0x46f73b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x46f73b['role']===_0x7cf0('0x73')){var _0x17a245=_0xe306a0[_0x7cf0('0x28')]({'plain':!![]});return db[_0x7cf0('0x74')][_0x7cf0('0x49')]({'where':{'name':_0x7cf0('0x75'),'userProfileId':_0x46f73b[_0x7cf0('0x76')]},'raw':!![]})[_0x7cf0('0x26')](function(_0x50c1af){if(_0x50c1af&&_0x50c1af[_0x7cf0('0x77')]===0x0){return db[_0x7cf0('0x29')][_0x7cf0('0x56')]({'name':_0x17a245[_0x7cf0('0x2b')],'resourceId':_0x17a245['id'],'type':_0x50c1af[_0x7cf0('0x2b')],'sectionId':_0x50c1af['id']},{})[_0x7cf0('0x26')](function(){return _0xe306a0;});}else{return _0xe306a0;}})['catch'](function(_0x5acef9){logger[_0x7cf0('0x78')](_0x7cf0('0x79'),_0x5acef9);throw _0x5acef9;});}return _0xe306a0;})[_0x7cf0('0x26')](respondWithResult(_0x21a2c3,null))['catch'](handleError(_0x21a2c3,null));});_0x1992a4[_0x7cf0('0x7a')]();}catch(_0x23281c){_0x21a2c3['status'](0x1f4)[_0x7cf0('0x2c')](_0x23281c);}};exports['update']=function(_0x543e8a,_0x579519,_0x1a7907){return db[_0x7cf0('0x2f')][_0x7cf0('0x49')]({'where':{'id':_0x543e8a['params']['id']}})[_0x7cf0('0x26')](handleEntityNotFound(_0x579519,null))[_0x7cf0('0x26')](saveUpdates(_[_0x7cf0('0x3e')](_0x543e8a[_0x7cf0('0x71')],['name',_0x7cf0('0x7b')]),null))[_0x7cf0('0x26')](respondWithResult(_0x579519,null))[_0x7cf0('0x46')](handleError(_0x579519,null));};exports[_0x7cf0('0x7c')]=function(_0x2525e6,_0x2dcdd8,_0x163a5b){return db[_0x7cf0('0x2f')]['find']({'where':{'id':_0x2525e6[_0x7cf0('0x4b')]['id']}})[_0x7cf0('0x26')](function(_0x133161){if(_0x133161){return _0x133161[_0x7cf0('0x27')]();}})['then'](function(_0x7a1b7d){var _0x2f2114=path[_0x7cf0('0x53')](config['root'],_0x7cf0('0x5d'),util[_0x7cf0('0x54')](_0x7cf0('0x55'),_0x7a1b7d['save_name'],_0x7a1b7d[_0x7cf0('0x7d')]));var _0xf73f54=path[_0x7cf0('0x53')](config[_0x7cf0('0x4f')],_0x7cf0('0x50'),util[_0x7cf0('0x54')]('%s.%s',_0x7a1b7d[_0x7cf0('0x4c')],_0x7a1b7d[_0x7cf0('0x4d')]));fs[_0x7cf0('0x63')](_0x2f2114);fs[_0x7cf0('0x63')](_0xf73f54);return _0x7a1b7d;})[_0x7cf0('0x26')](function(_0x1f938e){if(_0x1f938e){return _0x2dcdd8[_0x7cf0('0x1a')](0xcc)[_0x7cf0('0x19')]();}})['then'](handleEntityNotFound(_0x2dcdd8,null))[_0x7cf0('0x46')](handleError(_0x2dcdd8,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index b5f2962..3badfc2 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 _0x6aff=['util','../../config/logger','api','moment','request-promise','../../config/environment','./sound.attributes','exports','define','Sound'];(function(_0x533879,_0x2a85d9){var _0x477340=function(_0x68644d){while(--_0x68644d){_0x533879['push'](_0x533879['shift']());}};_0x477340(++_0x2a85d9);}(_0x6aff,0x122));var _0xf6af=function(_0x1ed35f,_0x530420){_0x1ed35f=_0x1ed35f-0x0;var _0x22e5bc=_0x6aff[_0x1ed35f];return _0x22e5bc;};'use strict';var _=require('lodash');var util=require(_0xf6af('0x0'));var logger=require(_0xf6af('0x1'))(_0xf6af('0x2'));var moment=require(_0xf6af('0x3'));var BPromise=require('bluebird');var rp=require(_0xf6af('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf6af('0x5'));var attributes=require(_0xf6af('0x6'));module[_0xf6af('0x7')]=function(_0x35c33b,_0x1ee099){return _0x35c33b[_0xf6af('0x8')](_0xf6af('0x9'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5635=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./sound.attributes','define','Sound','tools_sounds','lodash'];(function(_0x168cf5,_0xfe2e59){var _0x4b816a=function(_0x352f27){while(--_0x352f27){_0x168cf5['push'](_0x168cf5['shift']());}};_0x4b816a(++_0xfe2e59);}(_0x5635,0xe9));var _0x5563=function(_0x582e7d,_0x57f270){_0x582e7d=_0x582e7d-0x0;var _0x517046=_0x5635[_0x582e7d];return _0x517046;};'use strict';var _=require(_0x5563('0x0'));var util=require(_0x5563('0x1'));var logger=require(_0x5563('0x2'))('api');var moment=require(_0x5563('0x3'));var BPromise=require(_0x5563('0x4'));var rp=require(_0x5563('0x5'));var fs=require('fs');var path=require(_0x5563('0x6'));var rimraf=require(_0x5563('0x7'));var config=require(_0x5563('0x8'));var attributes=require(_0x5563('0x9'));module['exports']=function(_0x33e3a3,_0x35082e){return _0x33e3a3[_0x5563('0xa')](_0x5563('0xb'),attributes,{'tableName':_0x5563('0xc'),'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 4189051..9f8938a 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 _0x057d=['jayson/promise','client','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ShowSound','Sound','find','options','raw','where','attributes','include','model','map','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x136003,_0x397108){var _0x8c53b6=function(_0x2e3a6b){while(--_0x2e3a6b){_0x136003['push'](_0x136003['shift']());}};_0x8c53b6(++_0x397108);}(_0x057d,0x19a));var _0xd057=function(_0x479746,_0x574758){_0x479746=_0x479746-0x0;var _0x36d2aa=_0x057d[_0x479746];return _0x36d2aa;};'use strict';var _=require(_0xd057('0x0'));var util=require(_0xd057('0x1'));var moment=require(_0xd057('0x2'));var BPromise=require(_0xd057('0x3'));var rs=require(_0xd057('0x4'));var fs=require('fs');var Redis=require(_0xd057('0x5'));var db=require(_0xd057('0x6'))['db'];var utils=require(_0xd057('0x7'));var logger=require('../../config/logger')(_0xd057('0x8'));var config=require(_0xd057('0x9'));var jayson=require(_0xd057('0xa'));var client=jayson[_0xd057('0xb')][_0xd057('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x318b9b,_0x964645,_0x2dd36e){return new BPromise(function(_0x2effbc,_0x324513){return client[_0xd057('0xd')](_0x318b9b,_0x2dd36e)[_0xd057('0xe')](function(_0x182258){logger[_0xd057('0xf')](_0xd057('0x10'),_0x964645,_0xd057('0x11'));logger[_0xd057('0x12')](_0xd057('0x13'),_0x964645,_0xd057('0x11'),JSON[_0xd057('0x14')](_0x182258));if(_0x182258[_0xd057('0x15')]){if(_0x182258[_0xd057('0x15')][_0xd057('0x16')]===0x1f4){logger['error']('Sound,\x20%s,\x20%s',_0x964645,_0x182258[_0xd057('0x15')][_0xd057('0x17')]);return _0x324513(_0x182258[_0xd057('0x15')][_0xd057('0x17')]);}logger[_0xd057('0x15')](_0xd057('0x10'),_0x964645,_0x182258[_0xd057('0x15')][_0xd057('0x17')]);return _0x2effbc(_0x182258['error'][_0xd057('0x17')]);}else{logger[_0xd057('0xf')]('Sound,\x20%s,\x20%s',_0x964645,_0xd057('0x11'));_0x2effbc(_0x182258['result'][_0xd057('0x17')]);}})[_0xd057('0x18')](function(_0x5dfb88){logger[_0xd057('0x15')](_0xd057('0x10'),_0x964645,_0x5dfb88);_0x324513(_0x5dfb88);});});}exports[_0xd057('0x19')]=function(_0x35685e){var _0x202341=this;return new Promise(function(_0x157949,_0x573fdc){return db[_0xd057('0x1a')][_0xd057('0x1b')]({'raw':_0x35685e[_0xd057('0x1c')]?_0x35685e[_0xd057('0x1c')][_0xd057('0x1d')]===undefined?!![]:![]:!![],'where':_0x35685e[_0xd057('0x1c')]?_0x35685e[_0xd057('0x1c')][_0xd057('0x1e')]||null:null,'attributes':_0x35685e[_0xd057('0x1c')]?_0x35685e[_0xd057('0x1c')][_0xd057('0x1f')]||null:null,'include':_0x35685e[_0xd057('0x1c')]?_0x35685e[_0xd057('0x1c')][_0xd057('0x20')]?_['map'](_0x35685e[_0xd057('0x1c')][_0xd057('0x20')],function(_0x25645c){return{'model':db[_0x25645c['model']],'as':_0x25645c['as'],'attributes':_0x25645c['attributes'],'include':_0x25645c[_0xd057('0x20')]?_['map'](_0x25645c['include'],function(_0xa59884){return{'model':db[_0xa59884[_0xd057('0x21')]],'as':_0xa59884['as'],'attributes':_0xa59884['attributes'],'include':_0xa59884[_0xd057('0x20')]?_[_0xd057('0x22')](_0xa59884[_0xd057('0x20')],function(_0x385e8a){return{'model':db[_0x385e8a[_0xd057('0x21')]],'as':_0x385e8a['as'],'attributes':_0x385e8a['attributes']};}):[]};}):[]};}):[]:[]})[_0xd057('0xe')](function(_0x530578){logger[_0xd057('0xf')](_0xd057('0x19'),_0x35685e);logger[_0xd057('0x12')](_0xd057('0x19'),_0x35685e,JSON[_0xd057('0x14')](_0x530578));_0x157949(_0x530578);})['catch'](function(_0x36d525){logger[_0xd057('0x15')](_0xd057('0x19'),_0x36d525[_0xd057('0x17')],_0x35685e);_0x573fdc(_0x202341[_0xd057('0x15')](0x1f4,_0x36d525[_0xd057('0x17')]));});});}; \ No newline at end of file +var _0x7e80=['Sound,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','ShowSound','Sound','find','options','raw','where','include','attributes','map','model','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x7bc4a8,_0x19022a){var _0x4a13e9=function(_0x43ac34){while(--_0x43ac34){_0x7bc4a8['push'](_0x7bc4a8['shift']());}};_0x4a13e9(++_0x19022a);}(_0x7e80,0x1a0));var _0x07e8=function(_0x5b06fb,_0x1190f4){_0x5b06fb=_0x5b06fb-0x0;var _0x53a53a=_0x7e80[_0x5b06fb];return _0x53a53a;};'use strict';var _=require(_0x07e8('0x0'));var util=require(_0x07e8('0x1'));var moment=require('moment');var BPromise=require(_0x07e8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x07e8('0x3'));var db=require(_0x07e8('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x07e8('0x5'))(_0x07e8('0x6'));var config=require(_0x07e8('0x7'));var jayson=require(_0x07e8('0x8'));var client=jayson[_0x07e8('0x9')][_0x07e8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c63a8,_0x149e0f,_0x141a43){return new BPromise(function(_0x570ccc,_0x3b6498){return client[_0x07e8('0xb')](_0x4c63a8,_0x141a43)[_0x07e8('0xc')](function(_0x31ca47){logger['info'](_0x07e8('0xd'),_0x149e0f,_0x07e8('0xe'));logger[_0x07e8('0xf')]('Sound,\x20%s,\x20%s,\x20%s',_0x149e0f,_0x07e8('0xe'),JSON[_0x07e8('0x10')](_0x31ca47));if(_0x31ca47['error']){if(_0x31ca47[_0x07e8('0x11')][_0x07e8('0x12')]===0x1f4){logger['error'](_0x07e8('0xd'),_0x149e0f,_0x31ca47['error']['message']);return _0x3b6498(_0x31ca47[_0x07e8('0x11')][_0x07e8('0x13')]);}logger['error']('Sound,\x20%s,\x20%s',_0x149e0f,_0x31ca47[_0x07e8('0x11')]['message']);return _0x570ccc(_0x31ca47[_0x07e8('0x11')][_0x07e8('0x13')]);}else{logger[_0x07e8('0x14')](_0x07e8('0xd'),_0x149e0f,_0x07e8('0xe'));_0x570ccc(_0x31ca47[_0x07e8('0x15')]['message']);}})[_0x07e8('0x16')](function(_0x30977b){logger[_0x07e8('0x11')](_0x07e8('0xd'),_0x149e0f,_0x30977b);_0x3b6498(_0x30977b);});});}exports[_0x07e8('0x17')]=function(_0x39b436){var _0x1d40e4=this;return new Promise(function(_0x671df4,_0x29ee17){return db[_0x07e8('0x18')][_0x07e8('0x19')]({'raw':_0x39b436[_0x07e8('0x1a')]?_0x39b436[_0x07e8('0x1a')][_0x07e8('0x1b')]===undefined?!![]:![]:!![],'where':_0x39b436['options']?_0x39b436[_0x07e8('0x1a')][_0x07e8('0x1c')]||null:null,'attributes':_0x39b436[_0x07e8('0x1a')]?_0x39b436[_0x07e8('0x1a')]['attributes']||null:null,'include':_0x39b436[_0x07e8('0x1a')]?_0x39b436[_0x07e8('0x1a')]['include']?_['map'](_0x39b436[_0x07e8('0x1a')][_0x07e8('0x1d')],function(_0x1239d1){return{'model':db[_0x1239d1['model']],'as':_0x1239d1['as'],'attributes':_0x1239d1[_0x07e8('0x1e')],'include':_0x1239d1[_0x07e8('0x1d')]?_[_0x07e8('0x1f')](_0x1239d1['include'],function(_0xb2960d){return{'model':db[_0xb2960d[_0x07e8('0x20')]],'as':_0xb2960d['as'],'attributes':_0xb2960d['attributes'],'include':_0xb2960d[_0x07e8('0x1d')]?_[_0x07e8('0x1f')](_0xb2960d[_0x07e8('0x1d')],function(_0x5b7531){return{'model':db[_0x5b7531[_0x07e8('0x20')]],'as':_0x5b7531['as'],'attributes':_0x5b7531[_0x07e8('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4870b3){logger[_0x07e8('0x14')](_0x07e8('0x17'),_0x39b436);logger[_0x07e8('0xf')](_0x07e8('0x17'),_0x39b436,JSON[_0x07e8('0x10')](_0x4870b3));_0x671df4(_0x4870b3);})['catch'](function(_0x3349e4){logger['error']('ShowSound',_0x3349e4[_0x07e8('0x13')],_0x39b436);_0x29ee17(_0x1d40e4[_0x07e8('0x11')](0x1f4,_0x3349e4[_0x07e8('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 0f8f5b9..edb22ec 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 _0xda2d=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../config/environment','./squareMessage.controller','get'];(function(_0xbe0d54,_0x5c3362){var _0x13e619=function(_0xfa3e7f){while(--_0xfa3e7f){_0xbe0d54['push'](_0xbe0d54['shift']());}};_0x13e619(++_0x5c3362);}(_0xda2d,0x102));var _0xdda2=function(_0x3ffe,_0x3be2dd){_0x3ffe=_0x3ffe-0x0;var _0x35378f=_0xda2d[_0x3ffe];return _0x35378f;};'use strict';var multer=require('multer');var util=require(_0xdda2('0x0'));var path=require(_0xdda2('0x1'));var timeout=require(_0xdda2('0x2'));var express=require(_0xdda2('0x3'));var router=express[_0xdda2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdda2('0x5'));var controller=require(_0xdda2('0x6'));router[_0xdda2('0x7')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x9')]);router[_0xdda2('0x7')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xb')]);router[_0xdda2('0xc')]('/',auth['isAuthenticated'](),controller[_0xdda2('0xd')]);router[_0xdda2('0xe')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xf')]);router[_0xdda2('0x10')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x11')]);module[_0xdda2('0x12')]=router; \ No newline at end of file +var _0xda3f=['../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','util','path','fs-extra','../../components/interaction/service'];(function(_0x29a377,_0x811d72){var _0x65568d=function(_0x525823){while(--_0x525823){_0x29a377['push'](_0x29a377['shift']());}};_0x65568d(++_0x811d72);}(_0xda3f,0xec));var _0xfda3=function(_0x1e057e,_0xe7a750){_0x1e057e=_0x1e057e-0x0;var _0x2ac267=_0xda3f[_0x1e057e];return _0x2ac267;};'use strict';var multer=require('multer');var util=require(_0xfda3('0x0'));var path=require(_0xfda3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xfda3('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xfda3('0x3'));var config=require(_0xfda3('0x4'));var controller=require('./squareMessage.controller');router[_0xfda3('0x5')]('/',auth[_0xfda3('0x6')](),controller['index']);router['get'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x8')]);router[_0xfda3('0x9')]('/',auth[_0xfda3('0x6')](),controller[_0xfda3('0xa')]);router[_0xfda3('0xb')](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xc')]);router[_0xfda3('0xd')](_0xfda3('0x7'),auth['isAuthenticated'](),controller[_0xfda3('0xe')]);module[_0xfda3('0xf')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 15b3bb9..c0853ee 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 _0x03a0=['exports','TEXT','ENUM','STRING'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x03a0,0x140));var _0x003a=function(_0x26fc81,_0x57fc19){_0x26fc81=_0x26fc81-0x0;var _0x9feece=_0x03a0[_0x26fc81];return _0x9feece;};'use strict';var Sequelize=require('sequelize');module[_0x003a('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0x003a('0x1')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x003a('0x2')]('in','out'),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0x003a('0x3')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x4d16=['STRING','TEXT','medium','ENUM','out','sequelize','exports'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x4d16,0x7c));var _0x64d1=function(_0x165630,_0x475cb7){_0x165630=_0x165630-0x0;var _0x593d11=_0x4d16[_0x165630];return _0x593d11;};'use strict';var Sequelize=require(_0x64d1('0x0'));module[_0x64d1('0x1')]={'uniqueid':{'type':Sequelize[_0x64d1('0x2')]},'body':{'type':Sequelize[_0x64d1('0x3')](_0x64d1('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0x64d1('0x5')]('in',_0x64d1('0x6')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0x64d1('0x2')]},'providerResponse':{'type':Sequelize[_0x64d1('0x3')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 8d2a68e..5b81ebb 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 _0xc113=['fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','set','update','then','sendStatus','error','stack','name','send','index','map','SquareMessage','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','include','findAll','catch','show','params','length','includeAll','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xc113,0x1ab));var _0x3c11=function(_0x252e82,_0x147ec0){_0x252e82=_0x252e82-0x0;var _0xeff525=_0xc113[_0x252e82];return _0xeff525;};'use strict';var emlformat=require(_0x3c11('0x0'));var rimraf=require(_0x3c11('0x1'));var zipdir=require(_0x3c11('0x2'));var jsonpatch=require(_0x3c11('0x3'));var rp=require(_0x3c11('0x4'));var moment=require(_0x3c11('0x5'));var BPromise=require(_0x3c11('0x6'));var Mustache=require(_0x3c11('0x7'));var util=require(_0x3c11('0x8'));var path=require('path');var sox=require(_0x3c11('0x9'));var csv=require(_0x3c11('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3c11('0xb'));var _=require(_0x3c11('0xc'));var squel=require(_0x3c11('0xd'));var crypto=require('crypto');var jsforce=require(_0x3c11('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3c11('0xf'));var Redis=require(_0x3c11('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3c11('0x11'));var as=require(_0x3c11('0x12'));var hardwareService=require(_0x3c11('0x13'));var logger=require('../../config/logger')(_0x3c11('0x14'));var utils=require(_0x3c11('0x15'));var config=require(_0x3c11('0x16'));var licenseUtil=require(_0x3c11('0x17'));var db=require(_0x3c11('0x18'))['db'];function respondWithStatusCode(_0x58c7c8,_0x28daef){_0x28daef=_0x28daef||0xcc;return function(_0x2d997c){if(_0x2d997c){return _0x58c7c8['sendStatus'](_0x28daef);}return _0x58c7c8[_0x3c11('0x19')](_0x28daef)[_0x3c11('0x1a')]();};}function respondWithResult(_0x1c0b32,_0x822ef3){_0x822ef3=_0x822ef3||0xc8;return function(_0x30b11b){if(_0x30b11b){return _0x1c0b32['status'](_0x822ef3)[_0x3c11('0x1b')](_0x30b11b);}};}function respondWithFilteredResult(_0x2ba437,_0x2259f7){return function(_0x14c05d){if(_0x14c05d){var _0x1d05f2=typeof _0x2259f7['offset']==='undefined'&&typeof _0x2259f7['limit']===_0x3c11('0x1c');var _0x3a0626=_0x14c05d[_0x3c11('0x1d')];var _0x42db8d=_0x1d05f2?0x0:_0x2259f7[_0x3c11('0x1e')];var _0x35d32f=_0x1d05f2?_0x14c05d[_0x3c11('0x1d')]:_0x2259f7[_0x3c11('0x1e')]+_0x2259f7[_0x3c11('0x1f')];var _0x539ee1;if(_0x35d32f>=_0x3a0626){_0x35d32f=_0x3a0626;_0x539ee1=0xc8;}else{_0x539ee1=0xce;}_0x2ba437['status'](_0x539ee1);return _0x2ba437[_0x3c11('0x20')]('Content-Range',_0x42db8d+'-'+_0x35d32f+'/'+_0x3a0626)[_0x3c11('0x1b')](_0x14c05d);}return null;};}function patchUpdates(_0x5540b7){return function(_0x3ab7af){try{jsonpatch['apply'](_0x3ab7af,_0x5540b7,!![]);}catch(_0xe243c){return BPromise['reject'](_0xe243c);}return _0x3ab7af['save']();};}function saveUpdates(_0x160831,_0x49b827){return function(_0x189ba9){if(_0x189ba9){return _0x189ba9[_0x3c11('0x21')](_0x160831)[_0x3c11('0x22')](function(_0x2a7687){return _0x2a7687;});}return null;};}function removeEntity(_0x1a8fd4,_0x4e456a){return function(_0x36bb91){if(_0x36bb91){return _0x36bb91['destroy']()[_0x3c11('0x22')](function(){_0x1a8fd4[_0x3c11('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29f3cd,_0x20ec9b){return function(_0x2ff8bc){if(!_0x2ff8bc){_0x29f3cd[_0x3c11('0x23')](0x194);}return _0x2ff8bc;};}function handleError(_0xd42228,_0x243659){_0x243659=_0x243659||0x1f4;return function(_0x1af1fb){logger[_0x3c11('0x24')](_0x1af1fb[_0x3c11('0x25')]);if(_0x1af1fb[_0x3c11('0x26')]){delete _0x1af1fb['name'];}_0xd42228[_0x3c11('0x19')](_0x243659)[_0x3c11('0x27')](_0x1af1fb);};}exports[_0x3c11('0x28')]=function(_0x9cc373,_0x50aec6){var _0x25b25d={},_0x21401c={},_0x5151b0={'count':0x0,'rows':[]};var _0x1078b8=_[_0x3c11('0x29')](db[_0x3c11('0x2a')][_0x3c11('0x2b')],function(_0x36a5b4){return{'name':_0x36a5b4[_0x3c11('0x2c')],'type':_0x36a5b4[_0x3c11('0x2d')][_0x3c11('0x2e')]};});_0x21401c['model']=_[_0x3c11('0x29')](_0x1078b8,_0x3c11('0x26'));_0x21401c[_0x3c11('0x2f')]=_[_0x3c11('0x30')](_0x9cc373[_0x3c11('0x2f')]);_0x21401c[_0x3c11('0x31')]=_[_0x3c11('0x32')](_0x21401c['model'],_0x21401c[_0x3c11('0x2f')]);_0x25b25d[_0x3c11('0x33')]=_[_0x3c11('0x32')](_0x21401c[_0x3c11('0x34')],qs[_0x3c11('0x35')](_0x9cc373[_0x3c11('0x2f')]['fields']));_0x25b25d[_0x3c11('0x33')]=_0x25b25d['attributes']['length']?_0x25b25d[_0x3c11('0x33')]:_0x21401c[_0x3c11('0x34')];if(!_0x9cc373['query'][_0x3c11('0x36')](_0x3c11('0x37'))){_0x25b25d[_0x3c11('0x1f')]=qs['limit'](_0x9cc373[_0x3c11('0x2f')][_0x3c11('0x1f')]);_0x25b25d[_0x3c11('0x1e')]=qs[_0x3c11('0x1e')](_0x9cc373['query'][_0x3c11('0x1e')]);}_0x25b25d[_0x3c11('0x38')]=qs['sort'](_0x9cc373[_0x3c11('0x2f')][_0x3c11('0x39')]);_0x25b25d[_0x3c11('0x3a')]=qs['filters'](_[_0x3c11('0x3b')](_0x9cc373['query'],_0x21401c[_0x3c11('0x31')]),_0x1078b8);if(_0x9cc373['query']['filter']){_0x25b25d[_0x3c11('0x3a')]=_['merge'](_0x25b25d[_0x3c11('0x3a')],{'$or':_['map'](_0x1078b8,function(_0x32766e){if(_0x32766e[_0x3c11('0x2d')]!=='VIRTUAL'){var _0x20bf47={};_0x20bf47[_0x32766e['name']]={'$like':'%'+_0x9cc373[_0x3c11('0x2f')][_0x3c11('0x3c')]+'%'};return _0x20bf47;}})});}_0x25b25d=_[_0x3c11('0x3d')]({},_0x25b25d,_0x9cc373['options']);var _0x3e1ec3={'where':_0x25b25d[_0x3c11('0x3a')]};return db[_0x3c11('0x2a')][_0x3c11('0x1d')](_0x3e1ec3)[_0x3c11('0x22')](function(_0x2ccc27){_0x5151b0[_0x3c11('0x1d')]=_0x2ccc27;if(_0x9cc373[_0x3c11('0x2f')]['includeAll']){_0x25b25d[_0x3c11('0x3e')]=[{'all':!![]}];}return db[_0x3c11('0x2a')][_0x3c11('0x3f')](_0x25b25d);})['then'](function(_0x4ed063){_0x5151b0['rows']=_0x4ed063;return _0x5151b0;})[_0x3c11('0x22')](respondWithFilteredResult(_0x50aec6,_0x25b25d))[_0x3c11('0x40')](handleError(_0x50aec6,null));};exports[_0x3c11('0x41')]=function(_0x5eef87,_0x533cb8){var _0x3eea03={'raw':!![],'where':{'id':_0x5eef87[_0x3c11('0x42')]['id']}},_0x39b0ed={};_0x39b0ed[_0x3c11('0x34')]=_[_0x3c11('0x30')](db[_0x3c11('0x2a')][_0x3c11('0x2b')]);_0x39b0ed[_0x3c11('0x2f')]=_[_0x3c11('0x30')](_0x5eef87['query']);_0x39b0ed[_0x3c11('0x31')]=_[_0x3c11('0x32')](_0x39b0ed[_0x3c11('0x34')],_0x39b0ed[_0x3c11('0x2f')]);_0x3eea03[_0x3c11('0x33')]=_[_0x3c11('0x32')](_0x39b0ed[_0x3c11('0x34')],qs[_0x3c11('0x35')](_0x5eef87[_0x3c11('0x2f')][_0x3c11('0x35')]));_0x3eea03['attributes']=_0x3eea03[_0x3c11('0x33')][_0x3c11('0x43')]?_0x3eea03[_0x3c11('0x33')]:_0x39b0ed['model'];if(_0x5eef87[_0x3c11('0x2f')][_0x3c11('0x44')]){_0x3eea03[_0x3c11('0x3e')]=[{'all':!![]}];}_0x3eea03=_[_0x3c11('0x3d')]({},_0x3eea03,_0x5eef87['options']);return db['SquareMessage'][_0x3c11('0x45')](_0x3eea03)[_0x3c11('0x22')](handleEntityNotFound(_0x533cb8,null))['then'](respondWithResult(_0x533cb8,null))[_0x3c11('0x40')](handleError(_0x533cb8,null));};exports[_0x3c11('0x46')]=function(_0x2e2398,_0x2b3224){return db['SquareMessage']['create'](_0x2e2398[_0x3c11('0x47')],{})[_0x3c11('0x22')](respondWithResult(_0x2b3224,0xc9))[_0x3c11('0x40')](handleError(_0x2b3224,null));};exports[_0x3c11('0x21')]=function(_0x4da7b4,_0x1846b2){if(_0x4da7b4[_0x3c11('0x47')]['id']){delete _0x4da7b4[_0x3c11('0x47')]['id'];}return db[_0x3c11('0x2a')][_0x3c11('0x45')]({'where':{'id':_0x4da7b4[_0x3c11('0x42')]['id']}})['then'](handleEntityNotFound(_0x1846b2,null))['then'](saveUpdates(_0x4da7b4['body'],null))['then'](respondWithResult(_0x1846b2,null))['catch'](handleError(_0x1846b2,null));};exports[_0x3c11('0x48')]=function(_0x559f54,_0x5a7efe){return db[_0x3c11('0x2a')][_0x3c11('0x45')]({'where':{'id':_0x559f54['params']['id']}})[_0x3c11('0x22')](handleEntityNotFound(_0x5a7efe,null))['then'](removeEntity(_0x5a7efe,null))[_0x3c11('0x40')](handleError(_0x5a7efe,null));}; \ No newline at end of file +var _0x45c2=['destroy','error','stack','name','send','index','map','SquareMessage','rawAttributes','type','model','query','keys','filters','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','findAll','catch','attributes','find','create','body','params','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/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','json','offset','limit','undefined','count','status','set','Content-Range','reject','save','then'];(function(_0x1e2686,_0x38e982){var _0x43adc4=function(_0x4d87a1){while(--_0x4d87a1){_0x1e2686['push'](_0x1e2686['shift']());}};_0x43adc4(++_0x38e982);}(_0x45c2,0x68));var _0x245c=function(_0x1d432d,_0x401149){_0x1d432d=_0x1d432d-0x0;var _0x338acb=_0x45c2[_0x1d432d];return _0x338acb;};'use strict';var emlformat=require(_0x245c('0x0'));var rimraf=require(_0x245c('0x1'));var zipdir=require(_0x245c('0x2'));var jsonpatch=require(_0x245c('0x3'));var rp=require('request-promise');var moment=require(_0x245c('0x4'));var BPromise=require(_0x245c('0x5'));var Mustache=require(_0x245c('0x6'));var util=require('util');var path=require(_0x245c('0x7'));var sox=require(_0x245c('0x8'));var csv=require(_0x245c('0x9'));var ejs=require(_0x245c('0xa'));var fs=require('fs');var fs_extra=require(_0x245c('0xb'));var _=require(_0x245c('0xc'));var squel=require(_0x245c('0xd'));var crypto=require(_0x245c('0xe'));var jsforce=require(_0x245c('0xf'));var deskjs=require(_0x245c('0x10'));var toCsv=require(_0x245c('0x9'));var querystring=require(_0x245c('0x11'));var Papa=require('papaparse');var Redis=require(_0x245c('0x12'));var authService=require(_0x245c('0x13'));var qs=require(_0x245c('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x245c('0x15'))(_0x245c('0x16'));var utils=require('../../config/utils');var config=require(_0x245c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x245c('0x18'))['db'];function respondWithStatusCode(_0x8a2d8a,_0x151dbc){_0x151dbc=_0x151dbc||0xcc;return function(_0x35db74){if(_0x35db74){return _0x8a2d8a[_0x245c('0x19')](_0x151dbc);}return _0x8a2d8a['status'](_0x151dbc)[_0x245c('0x1a')]();};}function respondWithResult(_0xf1c7cd,_0x37a9bb){_0x37a9bb=_0x37a9bb||0xc8;return function(_0x3c0336){if(_0x3c0336){return _0xf1c7cd['status'](_0x37a9bb)[_0x245c('0x1b')](_0x3c0336);}};}function respondWithFilteredResult(_0x4cb3bf,_0x1e7712){return function(_0xe7cbf2){if(_0xe7cbf2){var _0x3c2ccf=typeof _0x1e7712[_0x245c('0x1c')]==='undefined'&&typeof _0x1e7712[_0x245c('0x1d')]===_0x245c('0x1e');var _0xeb61a6=_0xe7cbf2[_0x245c('0x1f')];var _0xee10c3=_0x3c2ccf?0x0:_0x1e7712[_0x245c('0x1c')];var _0x5686a5=_0x3c2ccf?_0xe7cbf2[_0x245c('0x1f')]:_0x1e7712[_0x245c('0x1c')]+_0x1e7712['limit'];var _0x4579d1;if(_0x5686a5>=_0xeb61a6){_0x5686a5=_0xeb61a6;_0x4579d1=0xc8;}else{_0x4579d1=0xce;}_0x4cb3bf[_0x245c('0x20')](_0x4579d1);return _0x4cb3bf[_0x245c('0x21')](_0x245c('0x22'),_0xee10c3+'-'+_0x5686a5+'/'+_0xeb61a6)['json'](_0xe7cbf2);}return null;};}function patchUpdates(_0x49cb1c){return function(_0x24558f){try{jsonpatch['apply'](_0x24558f,_0x49cb1c,!![]);}catch(_0x41c931){return BPromise[_0x245c('0x23')](_0x41c931);}return _0x24558f[_0x245c('0x24')]();};}function saveUpdates(_0x4b9aaf,_0x425e9){return function(_0x52a0a3){if(_0x52a0a3){return _0x52a0a3['update'](_0x4b9aaf)[_0x245c('0x25')](function(_0x40444d){return _0x40444d;});}return null;};}function removeEntity(_0x1ce173,_0x177bca){return function(_0x327140){if(_0x327140){return _0x327140[_0x245c('0x26')]()['then'](function(){_0x1ce173['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x51d0fc,_0x1c1b84){return function(_0x383df5){if(!_0x383df5){_0x51d0fc[_0x245c('0x19')](0x194);}return _0x383df5;};}function handleError(_0x5e0f01,_0x4fcfb2){_0x4fcfb2=_0x4fcfb2||0x1f4;return function(_0x2d3817){logger[_0x245c('0x27')](_0x2d3817[_0x245c('0x28')]);if(_0x2d3817['name']){delete _0x2d3817[_0x245c('0x29')];}_0x5e0f01[_0x245c('0x20')](_0x4fcfb2)[_0x245c('0x2a')](_0x2d3817);};}exports[_0x245c('0x2b')]=function(_0x5a2a16,_0x11ef1d){var _0x44575b={},_0x49a766={},_0x57b67e={'count':0x0,'rows':[]};var _0x1c573f=_[_0x245c('0x2c')](db[_0x245c('0x2d')][_0x245c('0x2e')],function(_0x264650){return{'name':_0x264650['fieldName'],'type':_0x264650[_0x245c('0x2f')]['key']};});_0x49a766[_0x245c('0x30')]=_['map'](_0x1c573f,_0x245c('0x29'));_0x49a766[_0x245c('0x31')]=_[_0x245c('0x32')](_0x5a2a16['query']);_0x49a766[_0x245c('0x33')]=_[_0x245c('0x34')](_0x49a766[_0x245c('0x30')],_0x49a766[_0x245c('0x31')]);_0x44575b['attributes']=_[_0x245c('0x34')](_0x49a766[_0x245c('0x30')],qs[_0x245c('0x35')](_0x5a2a16[_0x245c('0x31')]['fields']));_0x44575b['attributes']=_0x44575b['attributes'][_0x245c('0x36')]?_0x44575b['attributes']:_0x49a766['model'];if(!_0x5a2a16[_0x245c('0x31')][_0x245c('0x37')]('nolimit')){_0x44575b[_0x245c('0x1d')]=qs[_0x245c('0x1d')](_0x5a2a16[_0x245c('0x31')][_0x245c('0x1d')]);_0x44575b[_0x245c('0x1c')]=qs[_0x245c('0x1c')](_0x5a2a16[_0x245c('0x31')][_0x245c('0x1c')]);}_0x44575b[_0x245c('0x38')]=qs[_0x245c('0x39')](_0x5a2a16['query'][_0x245c('0x39')]);_0x44575b[_0x245c('0x3a')]=qs['filters'](_['pick'](_0x5a2a16[_0x245c('0x31')],_0x49a766['filters']),_0x1c573f);if(_0x5a2a16['query'][_0x245c('0x3b')]){_0x44575b[_0x245c('0x3a')]=_[_0x245c('0x3c')](_0x44575b[_0x245c('0x3a')],{'$or':_[_0x245c('0x2c')](_0x1c573f,function(_0x27e414){if(_0x27e414['type']!=='VIRTUAL'){var _0x43dff8={};_0x43dff8[_0x27e414[_0x245c('0x29')]]={'$like':'%'+_0x5a2a16[_0x245c('0x31')][_0x245c('0x3b')]+'%'};return _0x43dff8;}})});}_0x44575b=_[_0x245c('0x3c')]({},_0x44575b,_0x5a2a16[_0x245c('0x3d')]);var _0x1414fa={'where':_0x44575b[_0x245c('0x3a')]};return db['SquareMessage'][_0x245c('0x1f')](_0x1414fa)[_0x245c('0x25')](function(_0x10e4aa){_0x57b67e[_0x245c('0x1f')]=_0x10e4aa;if(_0x5a2a16[_0x245c('0x31')][_0x245c('0x3e')]){_0x44575b[_0x245c('0x3f')]=[{'all':!![]}];}return db[_0x245c('0x2d')][_0x245c('0x40')](_0x44575b);})[_0x245c('0x25')](function(_0x2a89df){_0x57b67e['rows']=_0x2a89df;return _0x57b67e;})['then'](respondWithFilteredResult(_0x11ef1d,_0x44575b))[_0x245c('0x41')](handleError(_0x11ef1d,null));};exports['show']=function(_0x1e663a,_0x3d3c06){var _0x42f2c0={'raw':!![],'where':{'id':_0x1e663a['params']['id']}},_0x20cfdb={};_0x20cfdb[_0x245c('0x30')]=_['keys'](db['SquareMessage'][_0x245c('0x2e')]);_0x20cfdb['query']=_[_0x245c('0x32')](_0x1e663a['query']);_0x20cfdb[_0x245c('0x33')]=_['intersection'](_0x20cfdb[_0x245c('0x30')],_0x20cfdb[_0x245c('0x31')]);_0x42f2c0[_0x245c('0x42')]=_[_0x245c('0x34')](_0x20cfdb[_0x245c('0x30')],qs[_0x245c('0x35')](_0x1e663a[_0x245c('0x31')]['fields']));_0x42f2c0[_0x245c('0x42')]=_0x42f2c0[_0x245c('0x42')][_0x245c('0x36')]?_0x42f2c0[_0x245c('0x42')]:_0x20cfdb[_0x245c('0x30')];if(_0x1e663a[_0x245c('0x31')][_0x245c('0x3e')]){_0x42f2c0[_0x245c('0x3f')]=[{'all':!![]}];}_0x42f2c0=_[_0x245c('0x3c')]({},_0x42f2c0,_0x1e663a[_0x245c('0x3d')]);return db[_0x245c('0x2d')][_0x245c('0x43')](_0x42f2c0)['then'](handleEntityNotFound(_0x3d3c06,null))[_0x245c('0x25')](respondWithResult(_0x3d3c06,null))[_0x245c('0x41')](handleError(_0x3d3c06,null));};exports['create']=function(_0x2d08e7,_0x4c8174){return db['SquareMessage'][_0x245c('0x44')](_0x2d08e7[_0x245c('0x45')],{})[_0x245c('0x25')](respondWithResult(_0x4c8174,0xc9))[_0x245c('0x41')](handleError(_0x4c8174,null));};exports['update']=function(_0x3b46f4,_0x2442d2){if(_0x3b46f4[_0x245c('0x45')]['id']){delete _0x3b46f4['body']['id'];}return db[_0x245c('0x2d')][_0x245c('0x43')]({'where':{'id':_0x3b46f4[_0x245c('0x46')]['id']}})[_0x245c('0x25')](handleEntityNotFound(_0x2442d2,null))[_0x245c('0x25')](saveUpdates(_0x3b46f4[_0x245c('0x45')],null))[_0x245c('0x25')](respondWithResult(_0x2442d2,null))[_0x245c('0x41')](handleError(_0x2442d2,null));};exports[_0x245c('0x26')]=function(_0x53aa60,_0xcc6a1){return db[_0x245c('0x2d')][_0x245c('0x43')]({'where':{'id':_0x53aa60[_0x245c('0x46')]['id']}})[_0x245c('0x25')](handleEntityNotFound(_0xcc6a1,null))[_0x245c('0x25')](removeEntity(_0xcc6a1,null))[_0x245c('0x41')](handleError(_0xcc6a1,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 0108385..4b28d49 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 _0xe968=['moment','bluebird','rimraf','../../config/environment','./squareMessage.attributes','exports','define','square_messages','lodash','util','../../config/logger','api'];(function(_0x1b0111,_0x2534a8){var _0x5352e6=function(_0x597c9c){while(--_0x597c9c){_0x1b0111['push'](_0x1b0111['shift']());}};_0x5352e6(++_0x2534a8);}(_0xe968,0x110));var _0x8e96=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe968[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x8e96('0x0'));var util=require(_0x8e96('0x1'));var logger=require(_0x8e96('0x2'))(_0x8e96('0x3'));var moment=require(_0x8e96('0x4'));var BPromise=require(_0x8e96('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8e96('0x6'));var config=require(_0x8e96('0x7'));var attributes=require(_0x8e96('0x8'));module[_0x8e96('0x9')]=function(_0x1d613b,_0x169171){return _0x1d613b[_0x8e96('0xa')]('SquareMessage',attributes,{'tableName':_0x8e96('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2d88=['rimraf','./squareMessage.attributes','exports','define','SquareMessage','square_messages','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2c50d4,_0x55bfe8){var _0x15da2b=function(_0x531af7){while(--_0x531af7){_0x2c50d4['push'](_0x2c50d4['shift']());}};_0x15da2b(++_0x55bfe8);}(_0x2d88,0x110));var _0x82d8=function(_0x14a4e5,_0x4f9cb0){_0x14a4e5=_0x14a4e5-0x0;var _0x98860e=_0x2d88[_0x14a4e5];return _0x98860e;};'use strict';var _=require(_0x82d8('0x0'));var util=require(_0x82d8('0x1'));var logger=require(_0x82d8('0x2'))(_0x82d8('0x3'));var moment=require(_0x82d8('0x4'));var BPromise=require(_0x82d8('0x5'));var rp=require(_0x82d8('0x6'));var fs=require('fs');var path=require(_0x82d8('0x7'));var rimraf=require(_0x82d8('0x8'));var config=require('../../config/environment');var attributes=require(_0x82d8('0x9'));module[_0x82d8('0xa')]=function(_0x512e14,_0x2c89a2){return _0x512e14[_0x82d8('0xb')](_0x82d8('0xc'),attributes,{'tableName':_0x82d8('0xd'),'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 149aede..5c72cb3 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 _0x978f=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateSquareMessage','SquareMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird'];(function(_0xce88fb,_0x47ff46){var _0x319a1e=function(_0x293f85){while(--_0x293f85){_0xce88fb['push'](_0xce88fb['shift']());}};_0x319a1e(++_0x47ff46);}(_0x978f,0x113));var _0xf978=function(_0x4ca538,_0xe09873){_0x4ca538=_0x4ca538-0x0;var _0x3c2324=_0x978f[_0x4ca538];return _0x3c2324;};'use strict';var _=require(_0xf978('0x0'));var util=require(_0xf978('0x1'));var moment=require(_0xf978('0x2'));var BPromise=require(_0xf978('0x3'));var rs=require(_0xf978('0x4'));var fs=require('fs');var Redis=require(_0xf978('0x5'));var db=require(_0xf978('0x6'))['db'];var utils=require(_0xf978('0x7'));var logger=require(_0xf978('0x8'))(_0xf978('0x9'));var config=require(_0xf978('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf978('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x35d82d,_0x1148d3,_0x46c27f){return new BPromise(function(_0xfcb7ba,_0x59456b){return client[_0xf978('0xc')](_0x35d82d,_0x46c27f)[_0xf978('0xd')](function(_0x2a83e8){logger[_0xf978('0xe')](_0xf978('0xf'),_0x1148d3,_0xf978('0x10'));logger[_0xf978('0x11')](_0xf978('0x12'),_0x1148d3,_0xf978('0x10'),JSON['stringify'](_0x2a83e8));if(_0x2a83e8[_0xf978('0x13')]){if(_0x2a83e8['error'][_0xf978('0x14')]===0x1f4){logger['error']('SquareMessage,\x20%s,\x20%s',_0x1148d3,_0x2a83e8[_0xf978('0x13')]['message']);return _0x59456b(_0x2a83e8[_0xf978('0x13')]['message']);}logger[_0xf978('0x13')](_0xf978('0xf'),_0x1148d3,_0x2a83e8['error'][_0xf978('0x15')]);return _0xfcb7ba(_0x2a83e8[_0xf978('0x13')][_0xf978('0x15')]);}else{logger['info']('SquareMessage,\x20%s,\x20%s',_0x1148d3,'request\x20sent');_0xfcb7ba(_0x2a83e8[_0xf978('0x16')][_0xf978('0x15')]);}})[_0xf978('0x17')](function(_0x2bc27b){logger['error'](_0xf978('0xf'),_0x1148d3,_0x2bc27b);_0x59456b(_0x2bc27b);});});}exports[_0xf978('0x18')]=function(_0x2dc180){var _0x172363=this;return new Promise(function(_0xdef81f,_0x55837a){return db[_0xf978('0x19')][_0xf978('0x1a')](_0x2dc180[_0xf978('0x1b')],{'raw':_0x2dc180[_0xf978('0x1c')]?_0x2dc180[_0xf978('0x1c')][_0xf978('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x3200e1){logger[_0xf978('0xe')](_0xf978('0x18'),_0x2dc180);logger['debug'](_0xf978('0x18'),_0x2dc180,JSON[_0xf978('0x1e')](_0x3200e1));_0xdef81f(_0x3200e1);})['catch'](function(_0x142374){logger[_0xf978('0x13')]('CreateSquareMessage',_0x142374[_0xf978('0x15')],_0x2dc180);_0x55837a(_0x172363[_0xf978('0x13')](0x1f4,_0x142374[_0xf978('0x15')]));});});}; \ No newline at end of file +var _0x4411=['../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error','message','SquareMessage,\x20%s,\x20%s','catch','CreateSquareMessage','SquareMessage','create','options','raw','util','moment','bluebird','randomstring','ioredis','../../config/logger'];(function(_0x4a28dd,_0x2f0bf0){var _0x1a4c3d=function(_0x4ad53d){while(--_0x4ad53d){_0x4a28dd['push'](_0x4a28dd['shift']());}};_0x1a4c3d(++_0x2f0bf0);}(_0x4411,0x192));var _0x1441=function(_0x56a010,_0x6f9136){_0x56a010=_0x56a010-0x0;var _0x17a9e5=_0x4411[_0x56a010];return _0x17a9e5;};'use strict';var _=require('lodash');var util=require(_0x1441('0x0'));var moment=require(_0x1441('0x1'));var BPromise=require(_0x1441('0x2'));var rs=require(_0x1441('0x3'));var fs=require('fs');var Redis=require(_0x1441('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1441('0x5'))('rpc');var config=require(_0x1441('0x6'));var jayson=require(_0x1441('0x7'));var client=jayson[_0x1441('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x413b68,_0xf6b0c9,_0x3299a7){return new BPromise(function(_0x1b391b,_0x394579){return client[_0x1441('0x9')](_0x413b68,_0x3299a7)[_0x1441('0xa')](function(_0x2eba03){logger[_0x1441('0xb')]('SquareMessage,\x20%s,\x20%s',_0xf6b0c9,_0x1441('0xc'));logger[_0x1441('0xd')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0xf6b0c9,_0x1441('0xc'),JSON[_0x1441('0xe')](_0x2eba03));if(_0x2eba03['error']){if(_0x2eba03[_0x1441('0xf')]['code']===0x1f4){logger['error']('SquareMessage,\x20%s,\x20%s',_0xf6b0c9,_0x2eba03[_0x1441('0xf')][_0x1441('0x10')]);return _0x394579(_0x2eba03['error'][_0x1441('0x10')]);}logger[_0x1441('0xf')](_0x1441('0x11'),_0xf6b0c9,_0x2eba03[_0x1441('0xf')][_0x1441('0x10')]);return _0x1b391b(_0x2eba03[_0x1441('0xf')][_0x1441('0x10')]);}else{logger[_0x1441('0xb')](_0x1441('0x11'),_0xf6b0c9,_0x1441('0xc'));_0x1b391b(_0x2eba03['result'][_0x1441('0x10')]);}})[_0x1441('0x12')](function(_0x5eb35e){logger[_0x1441('0xf')](_0x1441('0x11'),_0xf6b0c9,_0x5eb35e);_0x394579(_0x5eb35e);});});}exports[_0x1441('0x13')]=function(_0x373bb5){var _0x210d1f=this;return new Promise(function(_0x3433a1,_0x3a5fdb){return db[_0x1441('0x14')][_0x1441('0x15')](_0x373bb5['body'],{'raw':_0x373bb5[_0x1441('0x16')]?_0x373bb5[_0x1441('0x16')][_0x1441('0x17')]===undefined?!![]:![]:!![]})[_0x1441('0xa')](function(_0x28f4bc){logger['info']('CreateSquareMessage',_0x373bb5);logger[_0x1441('0xd')](_0x1441('0x13'),_0x373bb5,JSON[_0x1441('0xe')](_0x28f4bc));_0x3433a1(_0x28f4bc);})['catch'](function(_0x1db03f){logger[_0x1441('0xf')](_0x1441('0x13'),_0x1db03f[_0x1441('0x10')],_0x373bb5);_0x3a5fdb(_0x210d1f[_0x1441('0xf')](0x1f4,_0x1db03f[_0x1441('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 35e7add..cceaa15 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 _0x65ef=['create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','test','post'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x65ef,0xe1));var _0xf65e=function(_0x6ca49d,_0x888818){_0x6ca49d=_0x6ca49d-0x0;var _0x4e470f=_0x65ef[_0x6ca49d];return _0x4e470f;};'use strict';var multer=require(_0xf65e('0x0'));var util=require(_0xf65e('0x1'));var path=require('path');var timeout=require(_0xf65e('0x2'));var express=require(_0xf65e('0x3'));var router=express[_0xf65e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf65e('0x5'));var interaction=require(_0xf65e('0x6'));var config=require(_0xf65e('0x7'));var controller=require(_0xf65e('0x8'));router[_0xf65e('0x9')]('/',auth[_0xf65e('0xa')](),controller[_0xf65e('0xb')]);router[_0xf65e('0x9')](_0xf65e('0xc'),auth[_0xf65e('0xa')](),controller['show']);router[_0xf65e('0x9')]('/:id/test',auth[_0xf65e('0xa')](),timeout('15s'),controller[_0xf65e('0xd')]);router[_0xf65e('0xe')]('/',auth['isAuthenticated'](),controller[_0xf65e('0xf')]);router[_0xf65e('0x10')](_0xf65e('0xc'),auth[_0xf65e('0xa')](),controller[_0xf65e('0x11')]);router[_0xf65e('0x12')](_0xf65e('0xc'),auth[_0xf65e('0xa')](),controller[_0xf65e('0x13')]);module['exports']=router; \ No newline at end of file +var _0xfe8d=['post','create','put','delete','destroy','exports','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','/:id','/:id/test','15s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfe8d,0x16e));var _0xdfe8=function(_0xc78798,_0x13ca17){_0xc78798=_0xc78798-0x0;var _0x3a2531=_0xfe8d[_0xc78798];return _0x3a2531;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xdfe8('0x0'));var timeout=require('connect-timeout');var express=require(_0xdfe8('0x1'));var router=express[_0xdfe8('0x2')]();var fs_extra=require(_0xdfe8('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xdfe8('0x4'));var config=require(_0xdfe8('0x5'));var controller=require(_0xdfe8('0x6'));router[_0xdfe8('0x7')]('/',auth[_0xdfe8('0x8')](),controller['index']);router[_0xdfe8('0x7')](_0xdfe8('0x9'),auth[_0xdfe8('0x8')](),controller['show']);router[_0xdfe8('0x7')](_0xdfe8('0xa'),auth[_0xdfe8('0x8')](),timeout(_0xdfe8('0xb')),controller['test']);router[_0xdfe8('0xc')]('/',auth[_0xdfe8('0x8')](),controller[_0xdfe8('0xd')]);router[_0xdfe8('0xe')](_0xdfe8('0x9'),auth[_0xdfe8('0x8')](),controller['update']);router[_0xdfe8('0xf')](_0xdfe8('0x9'),auth[_0xdfe8('0x8')](),controller[_0xdfe8('0x10')]);module[_0xdfe8('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 18bf0a0..b6e4528 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 _0x741c=['exports','STRING','name'];(function(_0x4c87a5,_0x6bafe3){var _0x4b22aa=function(_0x5cca5f){while(--_0x5cca5f){_0x4c87a5['push'](_0x4c87a5['shift']());}};_0x4b22aa(++_0x6bafe3);}(_0x741c,0xea));var _0xc741=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x741c[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require('sequelize');module[_0xc741('0x0')]={'name':{'type':Sequelize[_0xc741('0x1')],'unique':_0xc741('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0xc741('0x1')]},'description':{'type':Sequelize[_0xc741('0x1')]}}; \ No newline at end of file +var _0x6f96=['name','STRING'];(function(_0x39f7c0,_0x2f6971){var _0x1b0764=function(_0x47f27a){while(--_0x47f27a){_0x39f7c0['push'](_0x39f7c0['shift']());}};_0x1b0764(++_0x2f6971);}(_0x6f96,0x15b));var _0x66f9=function(_0x1a9ea7,_0x583d11){_0x1a9ea7=_0x1a9ea7-0x0;var _0x4633cf=_0x6f96[_0x1a9ea7];return _0x4633cf;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x66f9('0x0')],'unique':_0x66f9('0x1'),'allowNull':![]},'dsn':{'type':Sequelize[_0x66f9('0x0')]},'description':{'type':Sequelize[_0x66f9('0x0')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index d5ae1e8..ff527e7 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 _0x6481=['update','get','ODBC','UserProfileResource','destroy','then','error','stack','name','index','map','SquareOdbc','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','includeAll','include','findAll','rows','catch','params','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','odbc','openSync','closeSync','rimraf','zip-dir','moment','bluebird','mustache','util','sox','fs-extra','lodash','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save'];(function(_0x188f38,_0x44e80f){var _0x513d0e=function(_0x59f737){while(--_0x59f737){_0x188f38['push'](_0x188f38['shift']());}};_0x513d0e(++_0x44e80f);}(_0x6481,0x18c));var _0x1648=function(_0x485cbc,_0x59f524){_0x485cbc=_0x485cbc-0x0;var _0x3bae30=_0x6481[_0x485cbc];return _0x3bae30;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1648('0x0'));var zipdir=require(_0x1648('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1648('0x2'));var BPromise=require(_0x1648('0x3'));var Mustache=require(_0x1648('0x4'));var util=require(_0x1648('0x5'));var path=require('path');var sox=require(_0x1648('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1648('0x7'));var _=require(_0x1648('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1648('0x9'));var deskjs=require(_0x1648('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1648('0xb'));var Redis=require('ioredis');var authService=require(_0x1648('0xc'));var qs=require(_0x1648('0xd'));var as=require(_0x1648('0xe'));var hardwareService=require(_0x1648('0xf'));var logger=require(_0x1648('0x10'))(_0x1648('0x11'));var utils=require(_0x1648('0x12'));var config=require(_0x1648('0x13'));var licenseUtil=require(_0x1648('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1777f0,_0x530080){_0x530080=_0x530080||0xcc;return function(_0x55a834){if(_0x55a834){return _0x1777f0[_0x1648('0x15')](_0x530080);}return _0x1777f0['status'](_0x530080)[_0x1648('0x16')]();};}function respondWithResult(_0x3c7754,_0x117397){_0x117397=_0x117397||0xc8;return function(_0x223729){if(_0x223729){return _0x3c7754[_0x1648('0x17')](_0x117397)['json'](_0x223729);}};}function respondWithFilteredResult(_0x596bf6,_0x8372a){return function(_0x1a12f3){if(_0x1a12f3){var _0x11e6b8=typeof _0x8372a['offset']===_0x1648('0x18')&&typeof _0x8372a[_0x1648('0x19')]==='undefined';var _0x3239fc=_0x1a12f3[_0x1648('0x1a')];var _0x20206f=_0x11e6b8?0x0:_0x8372a[_0x1648('0x1b')];var _0x57ce4f=_0x11e6b8?_0x1a12f3[_0x1648('0x1a')]:_0x8372a[_0x1648('0x1b')]+_0x8372a[_0x1648('0x19')];var _0x3e76f2;if(_0x57ce4f>=_0x3239fc){_0x57ce4f=_0x3239fc;_0x3e76f2=0xc8;}else{_0x3e76f2=0xce;}_0x596bf6[_0x1648('0x17')](_0x3e76f2);return _0x596bf6[_0x1648('0x1c')](_0x1648('0x1d'),_0x20206f+'-'+_0x57ce4f+'/'+_0x3239fc)[_0x1648('0x1e')](_0x1a12f3);}return null;};}function patchUpdates(_0x15b6bd){return function(_0x325d1b){try{jsonpatch[_0x1648('0x1f')](_0x325d1b,_0x15b6bd,!![]);}catch(_0x3634cb){return BPromise[_0x1648('0x20')](_0x3634cb);}return _0x325d1b[_0x1648('0x21')]();};}function saveUpdates(_0x104b79,_0x1551b1){return function(_0x3ba077){if(_0x3ba077){return _0x3ba077[_0x1648('0x22')](_0x104b79)['then'](function(_0x5b0125){return _0x5b0125;});}return null;};}function removeEntity(_0x535210,_0x3fbf3c){return function(_0x10f198){if(_0x10f198){return _0x10f198['destroy']()['then'](function(){var _0x3b07ec=_0x10f198[_0x1648('0x23')]({'plain':!![]});var _0x593105=_0x1648('0x24');return db[_0x1648('0x25')][_0x1648('0x26')]({'where':{'type':_0x593105,'resourceId':_0x3b07ec['id']}})[_0x1648('0x27')](function(){return _0x10f198;});})[_0x1648('0x27')](function(){_0x535210['status'](0xcc)[_0x1648('0x16')]();});}};}function handleEntityNotFound(_0x326b22,_0x3b72b0){return function(_0x164f58){if(!_0x164f58){_0x326b22[_0x1648('0x15')](0x194);}return _0x164f58;};}function handleError(_0x313660,_0x5bf4c1){_0x5bf4c1=_0x5bf4c1||0x1f4;return function(_0x75a22){logger[_0x1648('0x28')](_0x75a22[_0x1648('0x29')]);if(_0x75a22['name']){delete _0x75a22[_0x1648('0x2a')];}_0x313660['status'](_0x5bf4c1)['send'](_0x75a22);};}exports[_0x1648('0x2b')]=function(_0x32334a,_0x25c4be){var _0x4a91a1={},_0x134195={},_0x22e894={'count':0x0,'rows':[]};var _0x5552ac=_[_0x1648('0x2c')](db[_0x1648('0x2d')][_0x1648('0x2e')],function(_0x43cb07){return{'name':_0x43cb07['fieldName'],'type':_0x43cb07[_0x1648('0x2f')][_0x1648('0x30')]};});_0x134195['model']=_['map'](_0x5552ac,'name');_0x134195[_0x1648('0x31')]=_[_0x1648('0x32')](_0x32334a[_0x1648('0x31')]);_0x134195['filters']=_[_0x1648('0x33')](_0x134195[_0x1648('0x34')],_0x134195['query']);_0x4a91a1[_0x1648('0x35')]=_['intersection'](_0x134195[_0x1648('0x34')],qs[_0x1648('0x36')](_0x32334a[_0x1648('0x31')][_0x1648('0x36')]));_0x4a91a1[_0x1648('0x35')]=_0x4a91a1[_0x1648('0x35')][_0x1648('0x37')]?_0x4a91a1[_0x1648('0x35')]:_0x134195[_0x1648('0x34')];if(!_0x32334a[_0x1648('0x31')][_0x1648('0x38')](_0x1648('0x39'))){_0x4a91a1[_0x1648('0x19')]=qs[_0x1648('0x19')](_0x32334a['query'][_0x1648('0x19')]);_0x4a91a1[_0x1648('0x1b')]=qs[_0x1648('0x1b')](_0x32334a[_0x1648('0x31')][_0x1648('0x1b')]);}_0x4a91a1[_0x1648('0x3a')]=qs[_0x1648('0x3b')](_0x32334a[_0x1648('0x31')][_0x1648('0x3b')]);_0x4a91a1['where']=qs[_0x1648('0x3c')](_[_0x1648('0x3d')](_0x32334a['query'],_0x134195[_0x1648('0x3c')]),_0x5552ac);if(_0x32334a['query'][_0x1648('0x3e')]){_0x4a91a1[_0x1648('0x3f')]=_['merge'](_0x4a91a1[_0x1648('0x3f')],{'$or':_[_0x1648('0x2c')](_0x5552ac,function(_0xbec231){if(_0xbec231[_0x1648('0x2f')]!=='VIRTUAL'){var _0x14d67e={};_0x14d67e[_0xbec231[_0x1648('0x2a')]]={'$like':'%'+_0x32334a['query'][_0x1648('0x3e')]+'%'};return _0x14d67e;}})});}_0x4a91a1=_[_0x1648('0x40')]({},_0x4a91a1,_0x32334a['options']);var _0x55d092={'where':_0x4a91a1[_0x1648('0x3f')]};return db[_0x1648('0x2d')][_0x1648('0x1a')](_0x55d092)[_0x1648('0x27')](function(_0x2bad9a){_0x22e894[_0x1648('0x1a')]=_0x2bad9a;if(_0x32334a[_0x1648('0x31')][_0x1648('0x41')]){_0x4a91a1[_0x1648('0x42')]=[{'all':!![]}];}return db[_0x1648('0x2d')][_0x1648('0x43')](_0x4a91a1);})[_0x1648('0x27')](function(_0x122266){_0x22e894[_0x1648('0x44')]=_0x122266;return _0x22e894;})[_0x1648('0x27')](respondWithFilteredResult(_0x25c4be,_0x4a91a1))[_0x1648('0x45')](handleError(_0x25c4be,null));};exports['show']=function(_0x5bb51b,_0x1d9d4d){var _0xac95d={'raw':!![],'where':{'id':_0x5bb51b[_0x1648('0x46')]['id']}},_0x4a90c1={};_0x4a90c1['model']=_[_0x1648('0x32')](db[_0x1648('0x2d')]['rawAttributes']);_0x4a90c1[_0x1648('0x31')]=_[_0x1648('0x32')](_0x5bb51b[_0x1648('0x31')]);_0x4a90c1['filters']=_[_0x1648('0x33')](_0x4a90c1[_0x1648('0x34')],_0x4a90c1['query']);_0xac95d[_0x1648('0x35')]=_[_0x1648('0x33')](_0x4a90c1[_0x1648('0x34')],qs[_0x1648('0x36')](_0x5bb51b[_0x1648('0x31')][_0x1648('0x36')]));_0xac95d[_0x1648('0x35')]=_0xac95d[_0x1648('0x35')][_0x1648('0x37')]?_0xac95d[_0x1648('0x35')]:_0x4a90c1[_0x1648('0x34')];if(_0x5bb51b[_0x1648('0x31')][_0x1648('0x41')]){_0xac95d[_0x1648('0x42')]=[{'all':!![]}];}_0xac95d=_['merge']({},_0xac95d,_0x5bb51b[_0x1648('0x47')]);return db[_0x1648('0x2d')][_0x1648('0x48')](_0xac95d)[_0x1648('0x27')](handleEntityNotFound(_0x1d9d4d,null))[_0x1648('0x27')](respondWithResult(_0x1d9d4d,null))[_0x1648('0x45')](handleError(_0x1d9d4d,null));};exports[_0x1648('0x49')]=function(_0x15581e,_0x4b3ce6){return db['SquareOdbc'][_0x1648('0x49')](_0x15581e[_0x1648('0x4a')],{})['then'](function(_0x3673be){var _0x12a6d7=_0x15581e['user'][_0x1648('0x23')]({'plain':!![]});if(!_0x12a6d7)throw new Error(_0x1648('0x4b'));if(_0x12a6d7['role']===_0x1648('0x4c')){var _0xb3d69d=_0x3673be['get']({'plain':!![]});var _0x1d0b23=_0x1648('0x24');return db[_0x1648('0x4d')][_0x1648('0x48')]({'where':{'name':_0x1d0b23,'userProfileId':_0x12a6d7[_0x1648('0x4e')]},'raw':!![]})['then'](function(_0x5e88a0){if(_0x5e88a0&&_0x5e88a0[_0x1648('0x4f')]===0x0){return db[_0x1648('0x25')][_0x1648('0x49')]({'name':_0xb3d69d['name'],'resourceId':_0xb3d69d['id'],'type':_0x5e88a0[_0x1648('0x2a')],'sectionId':_0x5e88a0['id']},{})['then'](function(){return _0x3673be;});}else{return _0x3673be;}})[_0x1648('0x45')](function(_0x5e4f72){logger[_0x1648('0x28')](_0x1648('0x50'),_0x5e4f72);throw _0x5e4f72;});}return _0x3673be;})['then'](respondWithResult(_0x4b3ce6,0xc9))[_0x1648('0x45')](handleError(_0x4b3ce6,null));};exports[_0x1648('0x22')]=function(_0x317acd,_0x737cd3){if(_0x317acd[_0x1648('0x4a')]['id']){delete _0x317acd[_0x1648('0x4a')]['id'];}return db[_0x1648('0x2d')][_0x1648('0x48')]({'where':{'id':_0x317acd['params']['id']}})[_0x1648('0x27')](handleEntityNotFound(_0x737cd3,null))[_0x1648('0x27')](saveUpdates(_0x317acd['body'],null))[_0x1648('0x27')](respondWithResult(_0x737cd3,null))[_0x1648('0x45')](handleError(_0x737cd3,null));};exports['destroy']=function(_0x492856,_0x412503){return db[_0x1648('0x2d')]['find']({'where':{'id':_0x492856[_0x1648('0x46')]['id']}})[_0x1648('0x27')](handleEntityNotFound(_0x412503,null))['then'](removeEntity(_0x412503,null))[_0x1648('0x45')](handleError(_0x412503,null));};exports[_0x1648('0x51')]=function(_0x5668d0,_0x14ff37,_0x16ddc6){var _0x3a0bb8;return db[_0x1648('0x2d')][_0x1648('0x48')]({'where':{'id':_0x5668d0[_0x1648('0x46')]['id']},'attributes':['id',_0x1648('0x52')]})['then'](handleEntityNotFound(_0x14ff37,null))[_0x1648('0x27')](function(_0x36c3c3){if(_0x36c3c3){var _0x115e89=require(_0x1648('0x53'))();_0x115e89[_0x1648('0x54')](_0x36c3c3[_0x1648('0x52')]);_0x115e89[_0x1648('0x55')]();return _0x36c3c3;}})[_0x1648('0x27')](respondWithResult(_0x14ff37,null))[_0x1648('0x45')](handleError(_0x14ff37,null));}; \ No newline at end of file +var _0x32f6=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','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','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','then','destroy','get','UserProfileResource','error','stack','send','index','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','SquareOdbc','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ODBC','UserProfileSection','userProfileId','autoAssociation','dsn','openSync','closeSync'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x32f6,0x150));var _0x632f=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0x32f6[_0x1762b4];return _0x29beda;};'use strict';var emlformat=require(_0x632f('0x0'));var rimraf=require(_0x632f('0x1'));var zipdir=require(_0x632f('0x2'));var jsonpatch=require(_0x632f('0x3'));var rp=require(_0x632f('0x4'));var moment=require('moment');var BPromise=require(_0x632f('0x5'));var Mustache=require(_0x632f('0x6'));var util=require(_0x632f('0x7'));var path=require('path');var sox=require(_0x632f('0x8'));var csv=require(_0x632f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x632f('0xa'));var _=require(_0x632f('0xb'));var squel=require(_0x632f('0xc'));var crypto=require(_0x632f('0xd'));var jsforce=require(_0x632f('0xe'));var deskjs=require(_0x632f('0xf'));var toCsv=require(_0x632f('0x9'));var querystring=require(_0x632f('0x10'));var Papa=require(_0x632f('0x11'));var Redis=require('ioredis');var authService=require(_0x632f('0x12'));var qs=require(_0x632f('0x13'));var as=require(_0x632f('0x14'));var hardwareService=require(_0x632f('0x15'));var logger=require(_0x632f('0x16'))(_0x632f('0x17'));var utils=require(_0x632f('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x632f('0x19'))['db'];function respondWithStatusCode(_0x4d6ecd,_0x8dd1a8){_0x8dd1a8=_0x8dd1a8||0xcc;return function(_0x3df461){if(_0x3df461){return _0x4d6ecd[_0x632f('0x1a')](_0x8dd1a8);}return _0x4d6ecd[_0x632f('0x1b')](_0x8dd1a8)[_0x632f('0x1c')]();};}function respondWithResult(_0x3710b5,_0x67a11b){_0x67a11b=_0x67a11b||0xc8;return function(_0x4415b4){if(_0x4415b4){return _0x3710b5['status'](_0x67a11b)[_0x632f('0x1d')](_0x4415b4);}};}function respondWithFilteredResult(_0x14ea57,_0x2e02d7){return function(_0x141a3){if(_0x141a3){var _0x3535d1=typeof _0x2e02d7['offset']===_0x632f('0x1e')&&typeof _0x2e02d7[_0x632f('0x1f')]==='undefined';var _0x295a29=_0x141a3[_0x632f('0x20')];var _0x473ff6=_0x3535d1?0x0:_0x2e02d7[_0x632f('0x21')];var _0x72b4df=_0x3535d1?_0x141a3[_0x632f('0x20')]:_0x2e02d7[_0x632f('0x21')]+_0x2e02d7[_0x632f('0x1f')];var _0x573f7a;if(_0x72b4df>=_0x295a29){_0x72b4df=_0x295a29;_0x573f7a=0xc8;}else{_0x573f7a=0xce;}_0x14ea57['status'](_0x573f7a);return _0x14ea57[_0x632f('0x22')]('Content-Range',_0x473ff6+'-'+_0x72b4df+'/'+_0x295a29)[_0x632f('0x1d')](_0x141a3);}return null;};}function patchUpdates(_0x188f2f){return function(_0x5abed5){try{jsonpatch[_0x632f('0x23')](_0x5abed5,_0x188f2f,!![]);}catch(_0x3bf8ae){return BPromise['reject'](_0x3bf8ae);}return _0x5abed5['save']();};}function saveUpdates(_0x31339b,_0x2b670a){return function(_0x1028e3){if(_0x1028e3){return _0x1028e3['update'](_0x31339b)[_0x632f('0x24')](function(_0x5d6c37){return _0x5d6c37;});}return null;};}function removeEntity(_0x3b695d,_0x4b3209){return function(_0x650869){if(_0x650869){return _0x650869[_0x632f('0x25')]()['then'](function(){var _0xe8c47c=_0x650869[_0x632f('0x26')]({'plain':!![]});var _0x481886='ODBC';return db[_0x632f('0x27')][_0x632f('0x25')]({'where':{'type':_0x481886,'resourceId':_0xe8c47c['id']}})[_0x632f('0x24')](function(){return _0x650869;});})[_0x632f('0x24')](function(){_0x3b695d[_0x632f('0x1b')](0xcc)[_0x632f('0x1c')]();});}};}function handleEntityNotFound(_0x56574d,_0x512f84){return function(_0x2f0d78){if(!_0x2f0d78){_0x56574d['sendStatus'](0x194);}return _0x2f0d78;};}function handleError(_0x525208,_0x1e8143){_0x1e8143=_0x1e8143||0x1f4;return function(_0x30e777){logger[_0x632f('0x28')](_0x30e777[_0x632f('0x29')]);if(_0x30e777['name']){delete _0x30e777['name'];}_0x525208[_0x632f('0x1b')](_0x1e8143)[_0x632f('0x2a')](_0x30e777);};}exports[_0x632f('0x2b')]=function(_0x4d0b7f,_0x54597b){var _0x16ac9c={},_0x2ddbb1={},_0x2bf697={'count':0x0,'rows':[]};var _0x171a86=_['map'](db['SquareOdbc'][_0x632f('0x2c')],function(_0x3c1d61){return{'name':_0x3c1d61[_0x632f('0x2d')],'type':_0x3c1d61[_0x632f('0x2e')][_0x632f('0x2f')]};});_0x2ddbb1[_0x632f('0x30')]=_['map'](_0x171a86,_0x632f('0x31'));_0x2ddbb1[_0x632f('0x32')]=_['keys'](_0x4d0b7f[_0x632f('0x32')]);_0x2ddbb1[_0x632f('0x33')]=_[_0x632f('0x34')](_0x2ddbb1[_0x632f('0x30')],_0x2ddbb1[_0x632f('0x32')]);_0x16ac9c[_0x632f('0x35')]=_[_0x632f('0x34')](_0x2ddbb1['model'],qs[_0x632f('0x36')](_0x4d0b7f[_0x632f('0x32')][_0x632f('0x36')]));_0x16ac9c[_0x632f('0x35')]=_0x16ac9c[_0x632f('0x35')][_0x632f('0x37')]?_0x16ac9c[_0x632f('0x35')]:_0x2ddbb1['model'];if(!_0x4d0b7f[_0x632f('0x32')][_0x632f('0x38')]('nolimit')){_0x16ac9c[_0x632f('0x1f')]=qs['limit'](_0x4d0b7f[_0x632f('0x32')][_0x632f('0x1f')]);_0x16ac9c['offset']=qs['offset'](_0x4d0b7f[_0x632f('0x32')][_0x632f('0x21')]);}_0x16ac9c['order']=qs[_0x632f('0x39')](_0x4d0b7f[_0x632f('0x32')][_0x632f('0x39')]);_0x16ac9c[_0x632f('0x3a')]=qs[_0x632f('0x33')](_[_0x632f('0x3b')](_0x4d0b7f[_0x632f('0x32')],_0x2ddbb1['filters']),_0x171a86);if(_0x4d0b7f[_0x632f('0x32')][_0x632f('0x3c')]){_0x16ac9c[_0x632f('0x3a')]=_['merge'](_0x16ac9c[_0x632f('0x3a')],{'$or':_['map'](_0x171a86,function(_0x24c303){if(_0x24c303[_0x632f('0x2e')]!=='VIRTUAL'){var _0x9da989={};_0x9da989[_0x24c303[_0x632f('0x31')]]={'$like':'%'+_0x4d0b7f[_0x632f('0x32')][_0x632f('0x3c')]+'%'};return _0x9da989;}})});}_0x16ac9c=_[_0x632f('0x3d')]({},_0x16ac9c,_0x4d0b7f['options']);var _0x189636={'where':_0x16ac9c[_0x632f('0x3a')]};return db[_0x632f('0x3e')][_0x632f('0x20')](_0x189636)[_0x632f('0x24')](function(_0x47232a){_0x2bf697[_0x632f('0x20')]=_0x47232a;if(_0x4d0b7f[_0x632f('0x32')][_0x632f('0x3f')]){_0x16ac9c[_0x632f('0x40')]=[{'all':!![]}];}return db['SquareOdbc'][_0x632f('0x41')](_0x16ac9c);})[_0x632f('0x24')](function(_0x72c4ac){_0x2bf697[_0x632f('0x42')]=_0x72c4ac;return _0x2bf697;})[_0x632f('0x24')](respondWithFilteredResult(_0x54597b,_0x16ac9c))[_0x632f('0x43')](handleError(_0x54597b,null));};exports[_0x632f('0x44')]=function(_0x30f532,_0x1e68cf){var _0x273e1f={'raw':!![],'where':{'id':_0x30f532[_0x632f('0x45')]['id']}},_0x57babd={};_0x57babd['model']=_[_0x632f('0x46')](db[_0x632f('0x3e')][_0x632f('0x2c')]);_0x57babd[_0x632f('0x32')]=_['keys'](_0x30f532[_0x632f('0x32')]);_0x57babd[_0x632f('0x33')]=_[_0x632f('0x34')](_0x57babd['model'],_0x57babd[_0x632f('0x32')]);_0x273e1f['attributes']=_[_0x632f('0x34')](_0x57babd['model'],qs[_0x632f('0x36')](_0x30f532[_0x632f('0x32')][_0x632f('0x36')]));_0x273e1f[_0x632f('0x35')]=_0x273e1f[_0x632f('0x35')][_0x632f('0x37')]?_0x273e1f[_0x632f('0x35')]:_0x57babd[_0x632f('0x30')];if(_0x30f532[_0x632f('0x32')]['includeAll']){_0x273e1f[_0x632f('0x40')]=[{'all':!![]}];}_0x273e1f=_[_0x632f('0x3d')]({},_0x273e1f,_0x30f532['options']);return db[_0x632f('0x3e')][_0x632f('0x47')](_0x273e1f)[_0x632f('0x24')](handleEntityNotFound(_0x1e68cf,null))['then'](respondWithResult(_0x1e68cf,null))[_0x632f('0x43')](handleError(_0x1e68cf,null));};exports[_0x632f('0x48')]=function(_0x5025b9,_0x4d065e){return db['SquareOdbc'][_0x632f('0x48')](_0x5025b9[_0x632f('0x49')],{})[_0x632f('0x24')](function(_0x1e8c91){var _0x53e4cb=_0x5025b9[_0x632f('0x4a')]['get']({'plain':!![]});if(!_0x53e4cb)throw new Error(_0x632f('0x4b'));if(_0x53e4cb[_0x632f('0x4c')]===_0x632f('0x4a')){var _0x2a9797=_0x1e8c91['get']({'plain':!![]});var _0x20cb90=_0x632f('0x4d');return db[_0x632f('0x4e')][_0x632f('0x47')]({'where':{'name':_0x20cb90,'userProfileId':_0x53e4cb[_0x632f('0x4f')]},'raw':!![]})[_0x632f('0x24')](function(_0x9c0987){if(_0x9c0987&&_0x9c0987[_0x632f('0x50')]===0x0){return db[_0x632f('0x27')][_0x632f('0x48')]({'name':_0x2a9797[_0x632f('0x31')],'resourceId':_0x2a9797['id'],'type':_0x9c0987[_0x632f('0x31')],'sectionId':_0x9c0987['id']},{})[_0x632f('0x24')](function(){return _0x1e8c91;});}else{return _0x1e8c91;}})[_0x632f('0x43')](function(_0x4877b3){logger[_0x632f('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4877b3);throw _0x4877b3;});}return _0x1e8c91;})[_0x632f('0x24')](respondWithResult(_0x4d065e,0xc9))[_0x632f('0x43')](handleError(_0x4d065e,null));};exports['update']=function(_0x2c2fcc,_0x5f1bb6){if(_0x2c2fcc['body']['id']){delete _0x2c2fcc['body']['id'];}return db[_0x632f('0x3e')][_0x632f('0x47')]({'where':{'id':_0x2c2fcc[_0x632f('0x45')]['id']}})[_0x632f('0x24')](handleEntityNotFound(_0x5f1bb6,null))[_0x632f('0x24')](saveUpdates(_0x2c2fcc['body'],null))[_0x632f('0x24')](respondWithResult(_0x5f1bb6,null))[_0x632f('0x43')](handleError(_0x5f1bb6,null));};exports[_0x632f('0x25')]=function(_0x389ad2,_0x3b2d3b){return db[_0x632f('0x3e')][_0x632f('0x47')]({'where':{'id':_0x389ad2[_0x632f('0x45')]['id']}})[_0x632f('0x24')](handleEntityNotFound(_0x3b2d3b,null))[_0x632f('0x24')](removeEntity(_0x3b2d3b,null))['catch'](handleError(_0x3b2d3b,null));};exports['test']=function(_0x31b739,_0x369e0f,_0x343169){var _0x55eec4;return db[_0x632f('0x3e')][_0x632f('0x47')]({'where':{'id':_0x31b739[_0x632f('0x45')]['id']},'attributes':['id',_0x632f('0x51')]})[_0x632f('0x24')](handleEntityNotFound(_0x369e0f,null))[_0x632f('0x24')](function(_0x24578c){if(_0x24578c){var _0x1a9980=require('odbc')();_0x1a9980[_0x632f('0x52')](_0x24578c['dsn']);_0x1a9980[_0x632f('0x53')]();return _0x24578c;}})['then'](respondWithResult(_0x369e0f,null))[_0x632f('0x43')](handleError(_0x369e0f,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 5f7c97e..810a19c 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 _0x352c=['util','api','bluebird','request-promise','rimraf','../../config/environment','./squareOdbc.attributes','SquareOdbc','square_odbc','lodash'];(function(_0x3595b4,_0x326af0){var _0x15fa69=function(_0xec398c){while(--_0xec398c){_0x3595b4['push'](_0x3595b4['shift']());}};_0x15fa69(++_0x326af0);}(_0x352c,0x1e9));var _0xc352=function(_0x581feb,_0x475a85){_0x581feb=_0x581feb-0x0;var _0x29fe1a=_0x352c[_0x581feb];return _0x29fe1a;};'use strict';var _=require(_0xc352('0x0'));var util=require(_0xc352('0x1'));var logger=require('../../config/logger')(_0xc352('0x2'));var moment=require('moment');var BPromise=require(_0xc352('0x3'));var rp=require(_0xc352('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc352('0x5'));var config=require(_0xc352('0x6'));var attributes=require(_0xc352('0x7'));module['exports']=function(_0x394c3f,_0x33a220){return _0x394c3f['define'](_0xc352('0x8'),attributes,{'tableName':_0xc352('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf397=['square_odbc','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./squareOdbc.attributes','SquareOdbc'];(function(_0x77b525,_0xd4dc1e){var _0xa83673=function(_0x133b1f){while(--_0x133b1f){_0x77b525['push'](_0x77b525['shift']());}};_0xa83673(++_0xd4dc1e);}(_0xf397,0x7a));var _0x7f39=function(_0x315266,_0x404faa){_0x315266=_0x315266-0x0;var _0x4c4808=_0xf397[_0x315266];return _0x4c4808;};'use strict';var _=require(_0x7f39('0x0'));var util=require(_0x7f39('0x1'));var logger=require(_0x7f39('0x2'))(_0x7f39('0x3'));var moment=require(_0x7f39('0x4'));var BPromise=require('bluebird');var rp=require(_0x7f39('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7f39('0x6'));var config=require(_0x7f39('0x7'));var attributes=require(_0x7f39('0x8'));module['exports']=function(_0x1520fa,_0x3105fa){return _0x1520fa['define'](_0x7f39('0x9'),attributes,{'tableName':_0x7f39('0xa'),'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 390cc28..9971a56 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 _0xc3ac=['SquareOdbc,\x20%s,\x20%s','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','where','include','model','attributes','map','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info'];(function(_0x32ce61,_0x2ba733){var _0x28eded=function(_0x34db11){while(--_0x34db11){_0x32ce61['push'](_0x32ce61['shift']());}};_0x28eded(++_0x2ba733);}(_0xc3ac,0x102));var _0xcc3a=function(_0x25b794,_0x55967a){_0x25b794=_0x25b794-0x0;var _0x16c83b=_0xc3ac[_0x25b794];return _0x16c83b;};'use strict';var _=require(_0xcc3a('0x0'));var util=require(_0xcc3a('0x1'));var moment=require(_0xcc3a('0x2'));var BPromise=require(_0xcc3a('0x3'));var rs=require(_0xcc3a('0x4'));var fs=require('fs');var Redis=require(_0xcc3a('0x5'));var db=require(_0xcc3a('0x6'))['db'];var utils=require(_0xcc3a('0x7'));var logger=require(_0xcc3a('0x8'))('rpc');var config=require(_0xcc3a('0x9'));var jayson=require(_0xcc3a('0xa'));var client=jayson[_0xcc3a('0xb')][_0xcc3a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x59c5fd,_0x12f978,_0x137176){return new BPromise(function(_0x6ecc47,_0x547125){return client['request'](_0x59c5fd,_0x137176)['then'](function(_0x461b1c){logger[_0xcc3a('0xd')](_0xcc3a('0xe'),_0x12f978,'request\x20sent');logger[_0xcc3a('0xf')](_0xcc3a('0x10'),_0x12f978,_0xcc3a('0x11'),JSON[_0xcc3a('0x12')](_0x461b1c));if(_0x461b1c[_0xcc3a('0x13')]){if(_0x461b1c[_0xcc3a('0x13')]['code']===0x1f4){logger['error'](_0xcc3a('0xe'),_0x12f978,_0x461b1c['error']['message']);return _0x547125(_0x461b1c[_0xcc3a('0x13')][_0xcc3a('0x14')]);}logger[_0xcc3a('0x13')](_0xcc3a('0xe'),_0x12f978,_0x461b1c[_0xcc3a('0x13')][_0xcc3a('0x14')]);return _0x6ecc47(_0x461b1c[_0xcc3a('0x13')]['message']);}else{logger['info']('SquareOdbc,\x20%s,\x20%s',_0x12f978,_0xcc3a('0x11'));_0x6ecc47(_0x461b1c[_0xcc3a('0x15')][_0xcc3a('0x14')]);}})[_0xcc3a('0x16')](function(_0xf55b2a){logger['error'](_0xcc3a('0xe'),_0x12f978,_0xf55b2a);_0x547125(_0xf55b2a);});});}exports[_0xcc3a('0x17')]=function(_0x51b275){var _0x9014ee=this;return new Promise(function(_0x27efb0,_0x121589){return db[_0xcc3a('0x18')][_0xcc3a('0x19')]({'raw':_0x51b275[_0xcc3a('0x1a')]?_0x51b275[_0xcc3a('0x1a')][_0xcc3a('0x1b')]===undefined?!![]:![]:!![],'where':_0x51b275[_0xcc3a('0x1a')]?_0x51b275['options'][_0xcc3a('0x1c')]||null:null,'attributes':_0x51b275[_0xcc3a('0x1a')]?_0x51b275[_0xcc3a('0x1a')]['attributes']||null:null,'include':_0x51b275[_0xcc3a('0x1a')]?_0x51b275['options'][_0xcc3a('0x1d')]?_['map'](_0x51b275[_0xcc3a('0x1a')]['include'],function(_0x5106c3){return{'model':db[_0x5106c3[_0xcc3a('0x1e')]],'as':_0x5106c3['as'],'attributes':_0x5106c3[_0xcc3a('0x1f')],'include':_0x5106c3[_0xcc3a('0x1d')]?_[_0xcc3a('0x20')](_0x5106c3['include'],function(_0x78360){return{'model':db[_0x78360[_0xcc3a('0x1e')]],'as':_0x78360['as'],'attributes':_0x78360[_0xcc3a('0x1f')],'include':_0x78360[_0xcc3a('0x1d')]?_[_0xcc3a('0x20')](_0x78360[_0xcc3a('0x1d')],function(_0x52833e){return{'model':db[_0x52833e[_0xcc3a('0x1e')]],'as':_0x52833e['as'],'attributes':_0x52833e[_0xcc3a('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xcc3a('0x21')](function(_0x532f2d){logger[_0xcc3a('0xd')](_0xcc3a('0x17'),_0x51b275);logger['debug']('ShowSquareOdbc',_0x51b275,JSON[_0xcc3a('0x12')](_0x532f2d));_0x27efb0(_0x532f2d);})[_0xcc3a('0x16')](function(_0x4ef307){logger[_0xcc3a('0x13')]('ShowSquareOdbc',_0x4ef307[_0xcc3a('0x14')],_0x51b275);_0x121589(_0x9014ee[_0xcc3a('0x13')](0x1f4,_0x4ef307[_0xcc3a('0x14')]));});});}; \ No newline at end of file +var _0x3f1b=['raw','where','attributes','map','include','model','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','ShowSquareOdbc','find','options'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x3f1b,0xc4));var _0xb3f1=function(_0x1cf854,_0x29919e){_0x1cf854=_0x1cf854-0x0;var _0x484bc8=_0x3f1b[_0x1cf854];return _0x484bc8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb3f1('0x0'));var BPromise=require(_0xb3f1('0x1'));var rs=require(_0xb3f1('0x2'));var fs=require('fs');var Redis=require(_0xb3f1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb3f1('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xb3f1('0x5'));var jayson=require(_0xb3f1('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3548b9,_0x4d4f0e,_0xf523f7){return new BPromise(function(_0x489e63,_0x3f023e){return client[_0xb3f1('0x7')](_0x3548b9,_0xf523f7)[_0xb3f1('0x8')](function(_0x38eca1){logger[_0xb3f1('0x9')](_0xb3f1('0xa'),_0x4d4f0e,_0xb3f1('0xb'));logger[_0xb3f1('0xc')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x4d4f0e,_0xb3f1('0xb'),JSON[_0xb3f1('0xd')](_0x38eca1));if(_0x38eca1['error']){if(_0x38eca1[_0xb3f1('0xe')][_0xb3f1('0xf')]===0x1f4){logger[_0xb3f1('0xe')](_0xb3f1('0xa'),_0x4d4f0e,_0x38eca1['error'][_0xb3f1('0x10')]);return _0x3f023e(_0x38eca1[_0xb3f1('0xe')][_0xb3f1('0x10')]);}logger[_0xb3f1('0xe')]('SquareOdbc,\x20%s,\x20%s',_0x4d4f0e,_0x38eca1[_0xb3f1('0xe')]['message']);return _0x489e63(_0x38eca1['error']['message']);}else{logger[_0xb3f1('0x9')](_0xb3f1('0xa'),_0x4d4f0e,_0xb3f1('0xb'));_0x489e63(_0x38eca1['result'][_0xb3f1('0x10')]);}})['catch'](function(_0xaaafa1){logger[_0xb3f1('0xe')](_0xb3f1('0xa'),_0x4d4f0e,_0xaaafa1);_0x3f023e(_0xaaafa1);});});}exports[_0xb3f1('0x11')]=function(_0x4b9182){var _0x3e1d41=this;return new Promise(function(_0x143f99,_0x2b6351){return db['SquareOdbc'][_0xb3f1('0x12')]({'raw':_0x4b9182[_0xb3f1('0x13')]?_0x4b9182['options'][_0xb3f1('0x14')]===undefined?!![]:![]:!![],'where':_0x4b9182[_0xb3f1('0x13')]?_0x4b9182[_0xb3f1('0x13')][_0xb3f1('0x15')]||null:null,'attributes':_0x4b9182[_0xb3f1('0x13')]?_0x4b9182[_0xb3f1('0x13')][_0xb3f1('0x16')]||null:null,'include':_0x4b9182[_0xb3f1('0x13')]?_0x4b9182[_0xb3f1('0x13')]['include']?_[_0xb3f1('0x17')](_0x4b9182['options'][_0xb3f1('0x18')],function(_0x16f226){return{'model':db[_0x16f226[_0xb3f1('0x19')]],'as':_0x16f226['as'],'attributes':_0x16f226[_0xb3f1('0x16')],'include':_0x16f226[_0xb3f1('0x18')]?_[_0xb3f1('0x17')](_0x16f226[_0xb3f1('0x18')],function(_0x380188){return{'model':db[_0x380188[_0xb3f1('0x19')]],'as':_0x380188['as'],'attributes':_0x380188['attributes'],'include':_0x380188[_0xb3f1('0x18')]?_[_0xb3f1('0x17')](_0x380188['include'],function(_0x4d5fc5){return{'model':db[_0x4d5fc5['model']],'as':_0x4d5fc5['as'],'attributes':_0x4d5fc5[_0xb3f1('0x16')]};}):[]};}):[]};}):[]:[]})[_0xb3f1('0x8')](function(_0x3431c7){logger[_0xb3f1('0x9')](_0xb3f1('0x11'),_0x4b9182);logger[_0xb3f1('0xc')](_0xb3f1('0x11'),_0x4b9182,JSON['stringify'](_0x3431c7));_0x143f99(_0x3431c7);})[_0xb3f1('0x1a')](function(_0x1dbbd9){logger[_0xb3f1('0xe')](_0xb3f1('0x11'),_0x1dbbd9[_0xb3f1('0x10')],_0x4b9182);_0x2b6351(_0x3e1d41[_0xb3f1('0xe')](0x1f4,_0x1dbbd9['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 3fdc684..8b531a7 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 _0x6bdd=['./squareProject.controller','get','index','show','/:id/users','isAuthenticated','getUsers','create','post','addUsers','put','/:id','update','delete','destroy','removeUsers','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x5a16b5,_0x287037){var _0x43e9dd=function(_0x1cc2bd){while(--_0x1cc2bd){_0x5a16b5['push'](_0x5a16b5['shift']());}};_0x43e9dd(++_0x287037);}(_0x6bdd,0xe9));var _0xd6bd=function(_0x26ce0f,_0x5c2378){_0x26ce0f=_0x26ce0f-0x0;var _0x268931=_0x6bdd[_0x26ce0f];return _0x268931;};'use strict';var multer=require('multer');var util=require(_0xd6bd('0x0'));var path=require(_0xd6bd('0x1'));var timeout=require(_0xd6bd('0x2'));var express=require(_0xd6bd('0x3'));var router=express[_0xd6bd('0x4')]();var fs_extra=require(_0xd6bd('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd6bd('0x6'));var config=require('../../config/environment');var controller=require(_0xd6bd('0x7'));router[_0xd6bd('0x8')]('/',auth['isAuthenticated'](),controller[_0xd6bd('0x9')]);router[_0xd6bd('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xd6bd('0xa')]);router[_0xd6bd('0x8')](_0xd6bd('0xb'),auth[_0xd6bd('0xc')](),controller[_0xd6bd('0xd')]);router['post']('/',auth[_0xd6bd('0xc')](),controller[_0xd6bd('0xe')]);router[_0xd6bd('0xf')]('/:id/users',auth['isAuthenticated'](),controller[_0xd6bd('0x10')]);router[_0xd6bd('0x11')](_0xd6bd('0x12'),auth[_0xd6bd('0xc')](),controller[_0xd6bd('0x13')]);router[_0xd6bd('0x14')](_0xd6bd('0x12'),auth[_0xd6bd('0xc')](),controller[_0xd6bd('0x15')]);router[_0xd6bd('0x14')](_0xd6bd('0xb'),auth['isAuthenticated'](),controller[_0xd6bd('0x16')]);module[_0xd6bd('0x17')]=router; \ No newline at end of file +var _0x2d08=['update','delete','removeUsers','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./squareProject.controller','get','/:id','/:id/users','getUsers','post','isAuthenticated','create','addUsers','put'];(function(_0x17f96b,_0x76a64c){var _0x5c90d5=function(_0x141e85){while(--_0x141e85){_0x17f96b['push'](_0x17f96b['shift']());}};_0x5c90d5(++_0x76a64c);}(_0x2d08,0x129));var _0x82d0=function(_0x5aca71,_0x583dfa){_0x5aca71=_0x5aca71-0x0;var _0x375f79=_0x2d08[_0x5aca71];return _0x375f79;};'use strict';var multer=require(_0x82d0('0x0'));var util=require(_0x82d0('0x1'));var path=require(_0x82d0('0x2'));var timeout=require(_0x82d0('0x3'));var express=require(_0x82d0('0x4'));var router=express[_0x82d0('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x82d0('0x6'));var interaction=require(_0x82d0('0x7'));var config=require('../../config/environment');var controller=require(_0x82d0('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x82d0('0x9')](_0x82d0('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x82d0('0x9')](_0x82d0('0xb'),auth['isAuthenticated'](),controller[_0x82d0('0xc')]);router[_0x82d0('0xd')]('/',auth[_0x82d0('0xe')](),controller[_0x82d0('0xf')]);router[_0x82d0('0xd')](_0x82d0('0xb'),auth[_0x82d0('0xe')](),controller[_0x82d0('0x10')]);router[_0x82d0('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x82d0('0x12')]);router['delete'](_0x82d0('0xa'),auth['isAuthenticated'](),controller['destroy']);router[_0x82d0('0x13')](_0x82d0('0xb'),auth[_0x82d0('0xe')](),controller[_0x82d0('0x14')]);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 6071f2e..7773b11 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 _0x0fdc=['utf8','BLOB','production','DATE','exports','name','TEXT','long','getDataValue','preproduction','toString'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x0fdc,0xeb));var _0xc0fd=function(_0x25986b,_0x3a8bc2){_0x25986b=_0x25986b-0x0;var _0xdbcd85=_0x0fdc[_0x25986b];return _0xdbcd85;};'use strict';var Sequelize=require('sequelize');module[_0xc0fd('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xc0fd('0x1'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0xc0fd('0x2')]},'preproduction':{'type':Sequelize['BLOB'](_0xc0fd('0x3')),'get':function(){if(this[_0xc0fd('0x4')]('preproduction')){return this[_0xc0fd('0x4')](_0xc0fd('0x5'))[_0xc0fd('0x6')](_0xc0fd('0x7'));}}},'production':{'type':Sequelize[_0xc0fd('0x8')](_0xc0fd('0x3')),'get':function(){if(this[_0xc0fd('0x4')](_0xc0fd('0x9'))){return this[_0xc0fd('0x4')](_0xc0fd('0x9'))[_0xc0fd('0x6')](_0xc0fd('0x7'));}}},'savedAt':{'type':Sequelize[_0xc0fd('0xa')]},'publishedAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x9bb3=['long','getDataValue','preproduction','toString','utf8','BLOB','production','DATE','sequelize','exports','STRING','name'];(function(_0x45af2c,_0x587524){var _0x24f1f2=function(_0x123ab4){while(--_0x123ab4){_0x45af2c['push'](_0x45af2c['shift']());}};_0x24f1f2(++_0x587524);}(_0x9bb3,0x134));var _0x39bb=function(_0xbbc546,_0x241efa){_0xbbc546=_0xbbc546-0x0;var _0x3e4420=_0x9bb3[_0xbbc546];return _0x3e4420;};'use strict';var Sequelize=require(_0x39bb('0x0'));module[_0x39bb('0x1')]={'name':{'type':Sequelize[_0x39bb('0x2')],'unique':_0x39bb('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x39bb('0x2')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize['BLOB'](_0x39bb('0x4')),'get':function(){if(this[_0x39bb('0x5')](_0x39bb('0x6'))){return this[_0x39bb('0x5')](_0x39bb('0x6'))[_0x39bb('0x7')](_0x39bb('0x8'));}}},'production':{'type':Sequelize[_0x39bb('0x9')](_0x39bb('0x4')),'get':function(){if(this[_0x39bb('0x5')](_0x39bb('0xa'))){return this[_0x39bb('0x5')](_0x39bb('0xa'))['toString']('utf8');}}},'savedAt':{'type':Sequelize[_0x39bb('0xb')]},'publishedAt':{'type':Sequelize[_0x39bb('0xb')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 3c5f02d..bb62062 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 _0x2bec=['sort','pick','filter','merge','where','VIRTUAL','includeAll','include','catch','show','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','stringify','production','addUsers','omit','removeUsers','ids','isArray','emit','userSquareProject:remove','findOne','User','getUsers','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','update','destroy','then','get','SquareProjects','UserProfileResource','error','stack','name','send','net','Socket','connect','agi','port','127.0.0.1','index','map','SquareProject','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x2bec,0x76));var _0xc2be=function(_0x3c1d1e,_0x38cf62){_0x3c1d1e=_0x3c1d1e-0x0;var _0x5f1752=_0x2bec[_0x3c1d1e];return _0x5f1752;};'use strict';var _=require(_0xc2be('0x0'));var Redis=require(_0xc2be('0x1'));var qs=require(_0xc2be('0x2'));var logger=require(_0xc2be('0x3'))(_0xc2be('0x4'));var config=require(_0xc2be('0x5'));var db=require(_0xc2be('0x6'))['db'];config[_0xc2be('0x7')]=_[_0xc2be('0x8')](config[_0xc2be('0x7')],{'host':_0xc2be('0x9'),'port':0x18eb});var socket=require(_0xc2be('0xa'))(new Redis(config[_0xc2be('0x7')]));require('./squareProject.socket')['register'](socket);function respondWithStatusCode(_0x16adc6,_0x5674f0){_0x5674f0=_0x5674f0||0xcc;return function(_0x67cc9a){if(_0x67cc9a){return _0x16adc6[_0xc2be('0xb')](_0x5674f0);}return _0x16adc6['status'](_0x5674f0)[_0xc2be('0xc')]();};}function respondWithResult(_0x1be3fa,_0x15ed72){_0x15ed72=_0x15ed72||0xc8;return function(_0x476854){if(_0x476854){return _0x1be3fa[_0xc2be('0xd')](_0x15ed72)[_0xc2be('0xe')](_0x476854);}};}function respondWithFilteredResult(_0x4d0296,_0x259716){return function(_0x399378){if(_0x399378){var _0x3c53f1=typeof _0x259716[_0xc2be('0xf')]===_0xc2be('0x10')&&typeof _0x259716['limit']===_0xc2be('0x10');var _0x2e56ef=_0x399378['count'];var _0x4c6e41=_0x3c53f1?0x0:_0x259716['offset'];var _0x3e7239=_0x3c53f1?_0x399378[_0xc2be('0x11')]:_0x259716['offset']+_0x259716[_0xc2be('0x12')];var _0xeb02c;if(_0x3e7239>=_0x2e56ef){_0x3e7239=_0x2e56ef;_0xeb02c=0xc8;}else{_0xeb02c=0xce;}_0x4d0296['status'](_0xeb02c);return _0x4d0296[_0xc2be('0x13')](_0xc2be('0x14'),_0x4c6e41+'-'+_0x3e7239+'/'+_0x2e56ef)[_0xc2be('0xe')](_0x399378);}return null;};}function saveUpdates(_0xbe7e76){return function(_0x563154){if(_0x563154){return _0x563154[_0xc2be('0x15')](_0xbe7e76)['then'](function(_0x1ff76f){return _0x1ff76f;});}return null;};}function removeEntity(_0x4ffb93){return function(_0x6acaf0){if(_0x6acaf0){return _0x6acaf0[_0xc2be('0x16')]()[_0xc2be('0x17')](function(){var _0x5522bb=_0x6acaf0[_0xc2be('0x18')]({'plain':!![]});var _0x1ea4ae=_0xc2be('0x19');return db[_0xc2be('0x1a')]['destroy']({'where':{'type':_0x1ea4ae,'resourceId':_0x5522bb['id']}})[_0xc2be('0x17')](function(){return _0x6acaf0;});})[_0xc2be('0x17')](function(){return createAgiSocket();})[_0xc2be('0x17')](function(_0x38a563){_0x38a563[_0xc2be('0xc')](JSON['stringify']({'id':_0x6acaf0['id'],'deleted':!![]}));})[_0xc2be('0x17')](function(){_0x4ffb93[_0xc2be('0xd')](0xcc)[_0xc2be('0xc')]();});}};}function handleEntityNotFound(_0x5268e8){return function(_0x182441){if(!_0x182441){_0x5268e8[_0xc2be('0xb')](0x194);}return _0x182441;};}function handleError(_0x20ae20,_0x5cdf3c){_0x5cdf3c=_0x5cdf3c||0x1f4;return function(_0x2eab1a){logger[_0xc2be('0x1b')](_0x2eab1a[_0xc2be('0x1c')]);if(_0x2eab1a[_0xc2be('0x1d')]){delete _0x2eab1a[_0xc2be('0x1d')];}_0x20ae20['status'](_0x5cdf3c)[_0xc2be('0x1e')](_0x2eab1a);};}function createAgiSocket(){try{var _0x213309=require(_0xc2be('0x1f'));var _0x30cd91=new _0x213309[(_0xc2be('0x20'))]();return _0x30cd91[_0xc2be('0x21')](config[_0xc2be('0x22')][_0xc2be('0x23')]||0x11dd,_0xc2be('0x24'));}catch(_0x6fd8da){throw _0x6fd8da;}}exports[_0xc2be('0x25')]=function(_0x1495dd,_0x1e9715){var _0x4565b4={},_0x1f8c45={},_0x39be4c={'count':0x0,'rows':[]};var _0x9c3a85=_[_0xc2be('0x26')](db[_0xc2be('0x27')]['rawAttributes'],function(_0x48b748){return{'name':_0x48b748[_0xc2be('0x28')],'type':_0x48b748[_0xc2be('0x29')][_0xc2be('0x2a')]};});_0x1f8c45[_0xc2be('0x2b')]=_[_0xc2be('0x26')](_0x9c3a85,_0xc2be('0x1d'));_0x1f8c45[_0xc2be('0x2c')]=_[_0xc2be('0x2d')](_0x1495dd[_0xc2be('0x2c')]);_0x1f8c45[_0xc2be('0x2e')]=_['intersection'](_0x1f8c45['model'],_0x1f8c45[_0xc2be('0x2c')]);_0x4565b4[_0xc2be('0x2f')]=_[_0xc2be('0x30')](_0x1f8c45['model'],qs[_0xc2be('0x31')](_0x1495dd[_0xc2be('0x2c')][_0xc2be('0x31')]));_0x4565b4[_0xc2be('0x2f')]=_0x4565b4['attributes'][_0xc2be('0x32')]?_0x4565b4['attributes']:_0x1f8c45[_0xc2be('0x2b')];if(!_0x1495dd['query'][_0xc2be('0x33')](_0xc2be('0x34'))){_0x4565b4[_0xc2be('0x12')]=qs[_0xc2be('0x12')](_0x1495dd[_0xc2be('0x2c')][_0xc2be('0x12')]);_0x4565b4[_0xc2be('0xf')]=qs['offset'](_0x1495dd[_0xc2be('0x2c')][_0xc2be('0xf')]);}_0x4565b4[_0xc2be('0x35')]=qs['sort'](_0x1495dd[_0xc2be('0x2c')][_0xc2be('0x36')]);_0x4565b4['where']=qs[_0xc2be('0x2e')](_[_0xc2be('0x37')](_0x1495dd['query'],_0x1f8c45[_0xc2be('0x2e')]),_0x9c3a85);if(_0x1495dd[_0xc2be('0x2c')][_0xc2be('0x38')]){_0x4565b4['where']=_[_0xc2be('0x39')](_0x4565b4[_0xc2be('0x3a')],{'$or':_[_0xc2be('0x26')](_0x9c3a85,function(_0x1dbf0b){if(_0x1dbf0b['type']!==_0xc2be('0x3b')){var _0x4f5dd6={};_0x4f5dd6[_0x1dbf0b['name']]={'$like':'%'+_0x1495dd[_0xc2be('0x2c')][_0xc2be('0x38')]+'%'};return _0x4f5dd6;}})});}_0x4565b4=_['merge']({},_0x4565b4,_0x1495dd['options']);var _0xb58b4d={'where':_0x4565b4[_0xc2be('0x3a')]};return db[_0xc2be('0x27')][_0xc2be('0x11')](_0xb58b4d)[_0xc2be('0x17')](function(_0x32c5b8){_0x39be4c[_0xc2be('0x11')]=_0x32c5b8;if(_0x1495dd['query'][_0xc2be('0x3c')]){_0x4565b4[_0xc2be('0x3d')]=[{'all':!![]}];}return db[_0xc2be('0x27')]['findAll'](_0x4565b4);})[_0xc2be('0x17')](function(_0x1411f4){_0x39be4c['rows']=_0x1411f4;return _0x39be4c;})[_0xc2be('0x17')](respondWithFilteredResult(_0x1e9715,_0x4565b4))[_0xc2be('0x3e')](handleError(_0x1e9715,null));};exports[_0xc2be('0x3f')]=function(_0x10540d,_0x57abc0){var _0x4bc6f1={'raw':![],'where':{'id':_0x10540d['params']['id']}},_0x1981cf={};_0x1981cf[_0xc2be('0x2b')]=_[_0xc2be('0x2d')](db['SquareProject']['rawAttributes']);_0x1981cf[_0xc2be('0x2c')]=_[_0xc2be('0x2d')](_0x10540d[_0xc2be('0x2c')]);_0x1981cf['filters']=_[_0xc2be('0x30')](_0x1981cf[_0xc2be('0x2b')],_0x1981cf['query']);_0x4bc6f1[_0xc2be('0x2f')]=_[_0xc2be('0x30')](_0x1981cf['model'],qs[_0xc2be('0x31')](_0x10540d[_0xc2be('0x2c')][_0xc2be('0x31')]));_0x4bc6f1['attributes']=_0x4bc6f1[_0xc2be('0x2f')][_0xc2be('0x32')]?_0x4bc6f1[_0xc2be('0x2f')]:_0x1981cf[_0xc2be('0x2b')];if(_0x10540d[_0xc2be('0x2c')][_0xc2be('0x3c')]){_0x4bc6f1[_0xc2be('0x3d')]=[{'all':!![]}];}_0x4bc6f1=_['merge']({},_0x4bc6f1,_0x10540d[_0xc2be('0x40')]);return db['SquareProject'][_0xc2be('0x41')](_0x4bc6f1)[_0xc2be('0x17')](handleEntityNotFound(_0x57abc0,null))[_0xc2be('0x17')](respondWithResult(_0x57abc0,null))['catch'](handleError(_0x57abc0,null));};exports[_0xc2be('0x42')]=function(_0x4e23df,_0x490c8e){return db[_0xc2be('0x27')][_0xc2be('0x42')](_0x4e23df['body'],{})['then'](function(_0xfc0e6f){var _0x195223=_0x4e23df['user'][_0xc2be('0x18')]({'plain':!![]});if(!_0x195223)throw new Error(_0xc2be('0x43'));if(_0x195223['role']==='user'){var _0x27b1f8=_0xfc0e6f[_0xc2be('0x18')]({'plain':!![]});var _0x1dbeca=_0xc2be('0x19');return db[_0xc2be('0x44')][_0xc2be('0x41')]({'where':{'name':_0x1dbeca,'userProfileId':_0x195223[_0xc2be('0x45')]},'raw':!![]})[_0xc2be('0x17')](function(_0x2fc387){if(_0x2fc387&&_0x2fc387[_0xc2be('0x46')]===0x0){return db['UserProfileResource'][_0xc2be('0x42')]({'name':_0x27b1f8[_0xc2be('0x1d')],'resourceId':_0x27b1f8['id'],'type':_0x2fc387['name'],'sectionId':_0x2fc387['id']},{})[_0xc2be('0x17')](function(){return _0xfc0e6f;});}else{return _0xfc0e6f;}})['catch'](function(_0x30eb24){logger[_0xc2be('0x1b')](_0xc2be('0x47'),_0x30eb24);throw _0x30eb24;});}return _0xfc0e6f;})[_0xc2be('0x17')](respondWithResult(_0x490c8e,0xc9))[_0xc2be('0x3e')](handleError(_0x490c8e,null));};exports[_0xc2be('0x15')]=function(_0x16e5e7,_0x2efe5d){if(_0x16e5e7['body']['id']){delete _0x16e5e7[_0xc2be('0x48')]['id'];}return db[_0xc2be('0x27')]['find']({'where':{'id':_0x16e5e7[_0xc2be('0x49')]['id']}})[_0xc2be('0x17')](handleEntityNotFound(_0x2efe5d,null))[_0xc2be('0x17')](saveUpdates(_0x16e5e7[_0xc2be('0x48')],null))[_0xc2be('0x17')](function(_0x5a7723){if(!_0x5a7723)return;var _0x29d089=_0x5a7723[_0xc2be('0x18')]({'plain':!![]});return[createAgiSocket(),_0x29d089];})['spread'](function(_0x2ac4a1,_0x1eb50d){_0x2ac4a1[_0xc2be('0xc')](JSON[_0xc2be('0x4a')](_['pick'](_0x1eb50d,['id',_0xc2be('0x1d'),_0xc2be('0x4b')])));return _0x1eb50d;})[_0xc2be('0x17')](respondWithResult(_0x2efe5d,null))[_0xc2be('0x3e')](handleError(_0x2efe5d,null));};exports[_0xc2be('0x16')]=function(_0x436ca0,_0x359607){return db[_0xc2be('0x27')][_0xc2be('0x41')]({'where':{'id':_0x436ca0[_0xc2be('0x49')]['id']}})[_0xc2be('0x17')](handleEntityNotFound(_0x359607,null))['then'](removeEntity(_0x359607,null))[_0xc2be('0x3e')](handleError(_0x359607,null));};exports[_0xc2be('0x4c')]=function(_0x35620c,_0x1fd7e3){return db[_0xc2be('0x27')][_0xc2be('0x41')]({'where':{'id':_0x35620c[_0xc2be('0x49')]['id']}})['then'](handleEntityNotFound(_0x1fd7e3,null))[_0xc2be('0x17')](function(_0x2b9cd5){if(_0x2b9cd5){return _0x2b9cd5[_0xc2be('0x4c')](_0x35620c[_0xc2be('0x48')]['ids'],_[_0xc2be('0x4d')](_0x35620c[_0xc2be('0x48')],['ids','id'])||{});}})[_0xc2be('0x17')](respondWithResult(_0x1fd7e3,null))[_0xc2be('0x3e')](handleError(_0x1fd7e3,null));};exports[_0xc2be('0x4e')]=function(_0x4bef41,_0xf48152){return db['SquareProject'][_0xc2be('0x41')]({'where':{'id':_0x4bef41['params']['id']}})[_0xc2be('0x17')](handleEntityNotFound(_0xf48152,null))[_0xc2be('0x17')](function(_0xc7029a){if(_0xc7029a){return _0xc7029a[_0xc2be('0x4e')](_0x4bef41[_0xc2be('0x2c')][_0xc2be('0x4f')])['then'](function(){if(_[_0xc2be('0x50')](_0x4bef41[_0xc2be('0x2c')]['ids'])){for(var _0x59a2f9=0x0;_0x59a2f9<_0x4bef41['query']['ids'][_0xc2be('0x32')];_0x59a2f9+=0x1){socket[_0xc2be('0x51')](_0xc2be('0x52'),{'UserId':Number(_0x4bef41[_0xc2be('0x2c')][_0xc2be('0x4f')][_0x59a2f9]),'SquareProjectId':Number(_0x4bef41[_0xc2be('0x49')]['id'])});}}else{socket['emit']('userSquareProject:remove',{'UserId':Number(_0x4bef41['query'][_0xc2be('0x4f')]),'SquareProjectId':Number(_0x4bef41[_0xc2be('0x49')]['id'])});}});}})['then'](respondWithStatusCode(_0xf48152,null))[_0xc2be('0x3e')](handleError(_0xf48152,null));};exports['getUsers']=function(_0x162c25,_0x4b23ca){var _0x492372={};var _0x2c021d={};var _0x2a62d0;var _0x3232a6;return db[_0xc2be('0x27')][_0xc2be('0x53')]({'where':{'id':_0x162c25['params']['id']}})['then'](handleEntityNotFound(_0x4b23ca,null))[_0xc2be('0x17')](function(_0x520b15){if(_0x520b15){_0x2a62d0=_0x520b15;_0x2c021d[_0xc2be('0x2b')]=_['keys'](db[_0xc2be('0x54')]['rawAttributes']);_0x2c021d[_0xc2be('0x2c')]=_['keys'](_0x162c25[_0xc2be('0x2c')]);_0x2c021d[_0xc2be('0x2e')]=_[_0xc2be('0x30')](_0x2c021d[_0xc2be('0x2b')],_0x2c021d[_0xc2be('0x2c')]);_0x492372['attributes']=_[_0xc2be('0x30')](_0x2c021d[_0xc2be('0x2b')],qs[_0xc2be('0x31')](_0x162c25[_0xc2be('0x2c')][_0xc2be('0x31')]));_0x492372['attributes']=_0x492372[_0xc2be('0x2f')][_0xc2be('0x32')]?_0x492372[_0xc2be('0x2f')]:_0x2c021d['model'];_0x492372[_0xc2be('0x35')]=qs[_0xc2be('0x36')](_0x162c25[_0xc2be('0x2c')][_0xc2be('0x36')]);_0x492372['where']=qs[_0xc2be('0x2e')](_[_0xc2be('0x37')](_0x162c25[_0xc2be('0x2c')],_0x2c021d[_0xc2be('0x2e')]));if(_0x162c25[_0xc2be('0x2c')][_0xc2be('0x38')]){_0x492372['where']=_['merge'](_0x492372['where'],{'$or':_['map'](_0x492372[_0xc2be('0x2f')],function(_0xea490d){var _0x132767={};_0x132767[_0xea490d]={'$like':'%'+_0x162c25[_0xc2be('0x2c')][_0xc2be('0x38')]+'%'};return _0x132767;})});}_0x492372=_['merge']({},_0x492372,_0x162c25[_0xc2be('0x40')]);return _0x2a62d0[_0xc2be('0x55')](_0x492372);}})[_0xc2be('0x17')](function(_0x2603cc){if(_0x2603cc){_0x3232a6=_0x2603cc[_0xc2be('0x32')];if(!_0x162c25[_0xc2be('0x2c')]['hasOwnProperty'](_0xc2be('0x34'))){_0x492372[_0xc2be('0x12')]=qs['limit'](_0x162c25[_0xc2be('0x2c')][_0xc2be('0x12')]);_0x492372[_0xc2be('0xf')]=qs[_0xc2be('0xf')](_0x162c25[_0xc2be('0x2c')][_0xc2be('0xf')]);}return _0x2a62d0[_0xc2be('0x55')](_0x492372);}})[_0xc2be('0x17')](function(_0x15557e){if(_0x15557e){return _0x15557e?{'count':_0x3232a6,'rows':_0x15557e}:null;}})[_0xc2be('0x17')](respondWithResult(_0x4b23ca,null))[_0xc2be('0x3e')](handleError(_0x4b23ca,null));}; \ No newline at end of file +var _0xf4ae=['merge','lodash','../../config/logger','../../mysqldb','redis','socket.io-emitter','./squareProject.socket','register','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','update','destroy','get','SquareProjects','UserProfileResource','then','end','stringify','name','send','net','Socket','agi','127.0.0.1','map','SquareProject','fieldName','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','intersection','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','spread','production','addUsers','ids','omit','removeUsers','isArray','userSquareProject:remove','emit','getUsers','findOne','User','rawAttributes'];(function(_0x2c28f5,_0x2f7e56){var _0x137e10=function(_0x255011){while(--_0x255011){_0x2c28f5['push'](_0x2c28f5['shift']());}};_0x137e10(++_0x2f7e56);}(_0xf4ae,0xa7));var _0xef4a=function(_0x3b53b0,_0x23dc58){_0x3b53b0=_0x3b53b0-0x0;var _0x4eddc6=_0xf4ae[_0x3b53b0];return _0x4eddc6;};'use strict';var _=require(_0xef4a('0x0'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0xef4a('0x1'))('api');var config=require('../../config/environment');var db=require(_0xef4a('0x2'))['db'];config['redis']=_['defaults'](config[_0xef4a('0x3')],{'host':'localhost','port':0x18eb});var socket=require(_0xef4a('0x4'))(new Redis(config[_0xef4a('0x3')]));require(_0xef4a('0x5'))[_0xef4a('0x6')](socket);function respondWithStatusCode(_0x2fed77,_0x3d1dfb){_0x3d1dfb=_0x3d1dfb||0xcc;return function(_0x5067a0){if(_0x5067a0){return _0x2fed77[_0xef4a('0x7')](_0x3d1dfb);}return _0x2fed77[_0xef4a('0x8')](_0x3d1dfb)['end']();};}function respondWithResult(_0x4ac070,_0x1545c9){_0x1545c9=_0x1545c9||0xc8;return function(_0x5882c0){if(_0x5882c0){return _0x4ac070[_0xef4a('0x8')](_0x1545c9)[_0xef4a('0x9')](_0x5882c0);}};}function respondWithFilteredResult(_0x2f98c2,_0x4b47d6){return function(_0x24482e){if(_0x24482e){var _0x5d2455=typeof _0x4b47d6['offset']==='undefined'&&typeof _0x4b47d6[_0xef4a('0xa')]===_0xef4a('0xb');var _0xb7d160=_0x24482e[_0xef4a('0xc')];var _0x226b1b=_0x5d2455?0x0:_0x4b47d6['offset'];var _0x366a55=_0x5d2455?_0x24482e['count']:_0x4b47d6[_0xef4a('0xd')]+_0x4b47d6['limit'];var _0x4d6cb7;if(_0x366a55>=_0xb7d160){_0x366a55=_0xb7d160;_0x4d6cb7=0xc8;}else{_0x4d6cb7=0xce;}_0x2f98c2[_0xef4a('0x8')](_0x4d6cb7);return _0x2f98c2[_0xef4a('0xe')](_0xef4a('0xf'),_0x226b1b+'-'+_0x366a55+'/'+_0xb7d160)[_0xef4a('0x9')](_0x24482e);}return null;};}function saveUpdates(_0x49993c){return function(_0x24388c){if(_0x24388c){return _0x24388c[_0xef4a('0x10')](_0x49993c)['then'](function(_0x19a1ca){return _0x19a1ca;});}return null;};}function removeEntity(_0x4caec5){return function(_0x354a72){if(_0x354a72){return _0x354a72[_0xef4a('0x11')]()['then'](function(){var _0x1e620c=_0x354a72[_0xef4a('0x12')]({'plain':!![]});var _0x10abd0=_0xef4a('0x13');return db[_0xef4a('0x14')][_0xef4a('0x11')]({'where':{'type':_0x10abd0,'resourceId':_0x1e620c['id']}})['then'](function(){return _0x354a72;});})[_0xef4a('0x15')](function(){return createAgiSocket();})[_0xef4a('0x15')](function(_0x523807){_0x523807[_0xef4a('0x16')](JSON[_0xef4a('0x17')]({'id':_0x354a72['id'],'deleted':!![]}));})[_0xef4a('0x15')](function(){_0x4caec5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b6540){return function(_0xd2b479){if(!_0xd2b479){_0x2b6540[_0xef4a('0x7')](0x194);}return _0xd2b479;};}function handleError(_0x5bbb4d,_0x3dcbb0){_0x3dcbb0=_0x3dcbb0||0x1f4;return function(_0x4bee25){logger['error'](_0x4bee25['stack']);if(_0x4bee25[_0xef4a('0x18')]){delete _0x4bee25[_0xef4a('0x18')];}_0x5bbb4d[_0xef4a('0x8')](_0x3dcbb0)[_0xef4a('0x19')](_0x4bee25);};}function createAgiSocket(){try{var _0x1ca6d0=require(_0xef4a('0x1a'));var _0x24e9f5=new _0x1ca6d0[(_0xef4a('0x1b'))]();return _0x24e9f5['connect'](config[_0xef4a('0x1c')]['port']||0x11dd,_0xef4a('0x1d'));}catch(_0x749274){throw _0x749274;}}exports['index']=function(_0x574226,_0xe116a){var _0x32adf4={},_0xd66dd4={},_0x353634={'count':0x0,'rows':[]};var _0x2c1783=_[_0xef4a('0x1e')](db[_0xef4a('0x1f')]['rawAttributes'],function(_0xd1b3cc){return{'name':_0xd1b3cc[_0xef4a('0x20')],'type':_0xd1b3cc['type'][_0xef4a('0x21')]};});_0xd66dd4[_0xef4a('0x22')]=_['map'](_0x2c1783,_0xef4a('0x18'));_0xd66dd4[_0xef4a('0x23')]=_[_0xef4a('0x24')](_0x574226[_0xef4a('0x23')]);_0xd66dd4[_0xef4a('0x25')]=_['intersection'](_0xd66dd4[_0xef4a('0x22')],_0xd66dd4['query']);_0x32adf4[_0xef4a('0x26')]=_['intersection'](_0xd66dd4[_0xef4a('0x22')],qs[_0xef4a('0x27')](_0x574226[_0xef4a('0x23')]['fields']));_0x32adf4[_0xef4a('0x26')]=_0x32adf4[_0xef4a('0x26')][_0xef4a('0x28')]?_0x32adf4[_0xef4a('0x26')]:_0xd66dd4[_0xef4a('0x22')];if(!_0x574226[_0xef4a('0x23')][_0xef4a('0x29')](_0xef4a('0x2a'))){_0x32adf4['limit']=qs[_0xef4a('0xa')](_0x574226['query'][_0xef4a('0xa')]);_0x32adf4['offset']=qs[_0xef4a('0xd')](_0x574226[_0xef4a('0x23')][_0xef4a('0xd')]);}_0x32adf4[_0xef4a('0x2b')]=qs[_0xef4a('0x2c')](_0x574226[_0xef4a('0x23')][_0xef4a('0x2c')]);_0x32adf4[_0xef4a('0x2d')]=qs[_0xef4a('0x25')](_[_0xef4a('0x2e')](_0x574226['query'],_0xd66dd4[_0xef4a('0x25')]),_0x2c1783);if(_0x574226[_0xef4a('0x23')][_0xef4a('0x2f')]){_0x32adf4[_0xef4a('0x2d')]=_['merge'](_0x32adf4['where'],{'$or':_['map'](_0x2c1783,function(_0x46b964){if(_0x46b964[_0xef4a('0x30')]!==_0xef4a('0x31')){var _0x8a5faf={};_0x8a5faf[_0x46b964[_0xef4a('0x18')]]={'$like':'%'+_0x574226['query'][_0xef4a('0x2f')]+'%'};return _0x8a5faf;}})});}_0x32adf4=_['merge']({},_0x32adf4,_0x574226[_0xef4a('0x32')]);var _0x3bdfc6={'where':_0x32adf4[_0xef4a('0x2d')]};return db[_0xef4a('0x1f')][_0xef4a('0xc')](_0x3bdfc6)['then'](function(_0x54b9ff){_0x353634[_0xef4a('0xc')]=_0x54b9ff;if(_0x574226[_0xef4a('0x23')][_0xef4a('0x33')]){_0x32adf4[_0xef4a('0x34')]=[{'all':!![]}];}return db['SquareProject'][_0xef4a('0x35')](_0x32adf4);})[_0xef4a('0x15')](function(_0x4b9cc5){_0x353634[_0xef4a('0x36')]=_0x4b9cc5;return _0x353634;})['then'](respondWithFilteredResult(_0xe116a,_0x32adf4))[_0xef4a('0x37')](handleError(_0xe116a,null));};exports[_0xef4a('0x38')]=function(_0x2aee9d,_0x48bb5f){var _0x4b5ad6={'raw':![],'where':{'id':_0x2aee9d[_0xef4a('0x39')]['id']}},_0x529f35={};_0x529f35[_0xef4a('0x22')]=_[_0xef4a('0x24')](db[_0xef4a('0x1f')]['rawAttributes']);_0x529f35[_0xef4a('0x23')]=_[_0xef4a('0x24')](_0x2aee9d[_0xef4a('0x23')]);_0x529f35[_0xef4a('0x25')]=_[_0xef4a('0x3a')](_0x529f35[_0xef4a('0x22')],_0x529f35[_0xef4a('0x23')]);_0x4b5ad6[_0xef4a('0x26')]=_['intersection'](_0x529f35[_0xef4a('0x22')],qs[_0xef4a('0x27')](_0x2aee9d[_0xef4a('0x23')][_0xef4a('0x27')]));_0x4b5ad6[_0xef4a('0x26')]=_0x4b5ad6[_0xef4a('0x26')][_0xef4a('0x28')]?_0x4b5ad6[_0xef4a('0x26')]:_0x529f35[_0xef4a('0x22')];if(_0x2aee9d['query'][_0xef4a('0x33')]){_0x4b5ad6[_0xef4a('0x34')]=[{'all':!![]}];}_0x4b5ad6=_['merge']({},_0x4b5ad6,_0x2aee9d[_0xef4a('0x32')]);return db[_0xef4a('0x1f')]['find'](_0x4b5ad6)[_0xef4a('0x15')](handleEntityNotFound(_0x48bb5f,null))['then'](respondWithResult(_0x48bb5f,null))[_0xef4a('0x37')](handleError(_0x48bb5f,null));};exports['create']=function(_0x2adfe5,_0x2ba0a7){return db['SquareProject'][_0xef4a('0x3b')](_0x2adfe5[_0xef4a('0x3c')],{})[_0xef4a('0x15')](function(_0x2ec259){var _0x422e4f=_0x2adfe5['user'][_0xef4a('0x12')]({'plain':!![]});if(!_0x422e4f)throw new Error(_0xef4a('0x3d'));if(_0x422e4f[_0xef4a('0x3e')]===_0xef4a('0x3f')){var _0x256de8=_0x2ec259['get']({'plain':!![]});var _0x1d7d9b=_0xef4a('0x13');return db[_0xef4a('0x40')][_0xef4a('0x41')]({'where':{'name':_0x1d7d9b,'userProfileId':_0x422e4f['userProfileId']},'raw':!![]})[_0xef4a('0x15')](function(_0x33fda3){if(_0x33fda3&&_0x33fda3[_0xef4a('0x42')]===0x0){return db[_0xef4a('0x14')]['create']({'name':_0x256de8[_0xef4a('0x18')],'resourceId':_0x256de8['id'],'type':_0x33fda3['name'],'sectionId':_0x33fda3['id']},{})[_0xef4a('0x15')](function(){return _0x2ec259;});}else{return _0x2ec259;}})[_0xef4a('0x37')](function(_0x5a21cc){logger[_0xef4a('0x43')](_0xef4a('0x44'),_0x5a21cc);throw _0x5a21cc;});}return _0x2ec259;})[_0xef4a('0x15')](respondWithResult(_0x2ba0a7,0xc9))['catch'](handleError(_0x2ba0a7,null));};exports[_0xef4a('0x10')]=function(_0x2daf9b,_0xdf6141){if(_0x2daf9b[_0xef4a('0x3c')]['id']){delete _0x2daf9b['body']['id'];}return db['SquareProject'][_0xef4a('0x41')]({'where':{'id':_0x2daf9b[_0xef4a('0x39')]['id']}})[_0xef4a('0x15')](handleEntityNotFound(_0xdf6141,null))['then'](saveUpdates(_0x2daf9b['body'],null))[_0xef4a('0x15')](function(_0x495eef){if(!_0x495eef)return;var _0x4a0931=_0x495eef[_0xef4a('0x12')]({'plain':!![]});return[createAgiSocket(),_0x4a0931];})[_0xef4a('0x45')](function(_0x441009,_0x163ceb){_0x441009[_0xef4a('0x16')](JSON[_0xef4a('0x17')](_[_0xef4a('0x2e')](_0x163ceb,['id',_0xef4a('0x18'),_0xef4a('0x46')])));return _0x163ceb;})[_0xef4a('0x15')](respondWithResult(_0xdf6141,null))[_0xef4a('0x37')](handleError(_0xdf6141,null));};exports['destroy']=function(_0x35b724,_0x1c4f2a){return db[_0xef4a('0x1f')][_0xef4a('0x41')]({'where':{'id':_0x35b724[_0xef4a('0x39')]['id']}})[_0xef4a('0x15')](handleEntityNotFound(_0x1c4f2a,null))[_0xef4a('0x15')](removeEntity(_0x1c4f2a,null))[_0xef4a('0x37')](handleError(_0x1c4f2a,null));};exports[_0xef4a('0x47')]=function(_0x39f56e,_0x1d0661){return db[_0xef4a('0x1f')][_0xef4a('0x41')]({'where':{'id':_0x39f56e['params']['id']}})[_0xef4a('0x15')](handleEntityNotFound(_0x1d0661,null))[_0xef4a('0x15')](function(_0x54cd90){if(_0x54cd90){return _0x54cd90[_0xef4a('0x47')](_0x39f56e['body'][_0xef4a('0x48')],_[_0xef4a('0x49')](_0x39f56e[_0xef4a('0x3c')],['ids','id'])||{});}})[_0xef4a('0x15')](respondWithResult(_0x1d0661,null))[_0xef4a('0x37')](handleError(_0x1d0661,null));};exports[_0xef4a('0x4a')]=function(_0x9eb86a,_0x158e64){return db[_0xef4a('0x1f')][_0xef4a('0x41')]({'where':{'id':_0x9eb86a[_0xef4a('0x39')]['id']}})[_0xef4a('0x15')](handleEntityNotFound(_0x158e64,null))[_0xef4a('0x15')](function(_0x224b2d){if(_0x224b2d){return _0x224b2d[_0xef4a('0x4a')](_0x9eb86a[_0xef4a('0x23')][_0xef4a('0x48')])[_0xef4a('0x15')](function(){if(_[_0xef4a('0x4b')](_0x9eb86a[_0xef4a('0x23')]['ids'])){for(var _0x464275=0x0;_0x464275<_0x9eb86a['query'][_0xef4a('0x48')]['length'];_0x464275+=0x1){socket['emit'](_0xef4a('0x4c'),{'UserId':Number(_0x9eb86a['query'][_0xef4a('0x48')][_0x464275]),'SquareProjectId':Number(_0x9eb86a[_0xef4a('0x39')]['id'])});}}else{socket[_0xef4a('0x4d')](_0xef4a('0x4c'),{'UserId':Number(_0x9eb86a['query'][_0xef4a('0x48')]),'SquareProjectId':Number(_0x9eb86a[_0xef4a('0x39')]['id'])});}});}})[_0xef4a('0x15')](respondWithStatusCode(_0x158e64,null))[_0xef4a('0x37')](handleError(_0x158e64,null));};exports[_0xef4a('0x4e')]=function(_0xca87d3,_0xb15681){var _0x48e3ca={};var _0x4f660d={};var _0x3cebf5;var _0x3ca88c;return db[_0xef4a('0x1f')][_0xef4a('0x4f')]({'where':{'id':_0xca87d3['params']['id']}})[_0xef4a('0x15')](handleEntityNotFound(_0xb15681,null))['then'](function(_0x1e9ef5){if(_0x1e9ef5){_0x3cebf5=_0x1e9ef5;_0x4f660d[_0xef4a('0x22')]=_[_0xef4a('0x24')](db[_0xef4a('0x50')][_0xef4a('0x51')]);_0x4f660d[_0xef4a('0x23')]=_[_0xef4a('0x24')](_0xca87d3[_0xef4a('0x23')]);_0x4f660d[_0xef4a('0x25')]=_['intersection'](_0x4f660d[_0xef4a('0x22')],_0x4f660d[_0xef4a('0x23')]);_0x48e3ca[_0xef4a('0x26')]=_[_0xef4a('0x3a')](_0x4f660d[_0xef4a('0x22')],qs['fields'](_0xca87d3['query'][_0xef4a('0x27')]));_0x48e3ca[_0xef4a('0x26')]=_0x48e3ca[_0xef4a('0x26')][_0xef4a('0x28')]?_0x48e3ca['attributes']:_0x4f660d[_0xef4a('0x22')];_0x48e3ca[_0xef4a('0x2b')]=qs[_0xef4a('0x2c')](_0xca87d3[_0xef4a('0x23')]['sort']);_0x48e3ca[_0xef4a('0x2d')]=qs[_0xef4a('0x25')](_[_0xef4a('0x2e')](_0xca87d3[_0xef4a('0x23')],_0x4f660d[_0xef4a('0x25')]));if(_0xca87d3[_0xef4a('0x23')][_0xef4a('0x2f')]){_0x48e3ca['where']=_[_0xef4a('0x52')](_0x48e3ca[_0xef4a('0x2d')],{'$or':_[_0xef4a('0x1e')](_0x48e3ca[_0xef4a('0x26')],function(_0x1d614d){var _0x22608f={};_0x22608f[_0x1d614d]={'$like':'%'+_0xca87d3[_0xef4a('0x23')]['filter']+'%'};return _0x22608f;})});}_0x48e3ca=_['merge']({},_0x48e3ca,_0xca87d3[_0xef4a('0x32')]);return _0x3cebf5[_0xef4a('0x4e')](_0x48e3ca);}})[_0xef4a('0x15')](function(_0x166f8a){if(_0x166f8a){_0x3ca88c=_0x166f8a[_0xef4a('0x28')];if(!_0xca87d3[_0xef4a('0x23')][_0xef4a('0x29')](_0xef4a('0x2a'))){_0x48e3ca[_0xef4a('0xa')]=qs[_0xef4a('0xa')](_0xca87d3['query'][_0xef4a('0xa')]);_0x48e3ca['offset']=qs['offset'](_0xca87d3[_0xef4a('0x23')][_0xef4a('0xd')]);}return _0x3cebf5['getUsers'](_0x48e3ca);}})[_0xef4a('0x15')](function(_0x3f11df){if(_0x3f11df){return _0x3f11df?{'count':_0x3ca88c,'rows':_0x3f11df}:null;}})['then'](respondWithResult(_0xb15681,null))[_0xef4a('0x37')](handleError(_0xb15681,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 5386263..79ceb01 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 _0x877d=['events','../../mysqldb','SquareProject','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x292600,_0x120a55){var _0x2ef83b=function(_0xe2e801){while(--_0xe2e801){_0x292600['push'](_0x292600['shift']());}};_0x2ef83b(++_0x120a55);}(_0x877d,0xd8));var _0xd877=function(_0x1cdc8d,_0x1e5b71){_0x1cdc8d=_0x1cdc8d-0x0;var _0x267c57=_0x877d[_0x1cdc8d];return _0x267c57;};'use strict';var EventEmitter=require(_0xd877('0x0'));var SquareProject=require(_0xd877('0x1'))['db'][_0xd877('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xd877('0x3'),'afterDestroy':_0xd877('0x4')};function emitEvent(_0x376172){return function(_0x815a94,_0x589e34,_0x223b30){SquareProjectEvents['emit'](_0x376172+':'+_0x815a94['id'],_0x815a94);SquareProjectEvents[_0xd877('0x5')](_0x376172,_0x815a94);_0x223b30(null);};}for(var e in events){if(events[_0xd877('0x6')](e)){var event=events[e];SquareProject[_0xd877('0x7')](e,emitEvent(event));}}module[_0xd877('0x8')]=SquareProjectEvents; \ No newline at end of file +var _0x9f40=['hasOwnProperty','hook','exports','events','../../mysqldb','SquareProject','setMaxListeners','save','update','emit'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x9f40,0x1e3));var _0x09f4=function(_0x2b92e0,_0x27aac1){_0x2b92e0=_0x2b92e0-0x0;var _0x218fba=_0x9f40[_0x2b92e0];return _0x218fba;};'use strict';var EventEmitter=require(_0x09f4('0x0'));var SquareProject=require(_0x09f4('0x1'))['db'][_0x09f4('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x09f4('0x3')](0x0);var events={'afterCreate':_0x09f4('0x4'),'afterUpdate':_0x09f4('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2bb052){return function(_0x2240cd,_0x59dea4,_0x347814){SquareProjectEvents[_0x09f4('0x6')](_0x2bb052+':'+_0x2240cd['id'],_0x2240cd);SquareProjectEvents[_0x09f4('0x6')](_0x2bb052,_0x2240cd);_0x347814(null);};}for(var e in events){if(events[_0x09f4('0x7')](e)){var event=events[e];SquareProject[_0x09f4('0x8')](e,emitEvent(event));}}module[_0x09f4('0x9')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 82854cf..444c5a1 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 _0x0895=['savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./squareProject.attributes','define','SquareProject','square_projects','changed','preproduction'];(function(_0x568e3e,_0x43b741){var _0x4fdc64=function(_0x8cf7cf){while(--_0x8cf7cf){_0x568e3e['push'](_0x568e3e['shift']());}};_0x4fdc64(++_0x43b741);}(_0x0895,0x15b));var _0x5089=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0895[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5089('0x0'));var util=require(_0x5089('0x1'));var logger=require(_0x5089('0x2'))(_0x5089('0x3'));var moment=require(_0x5089('0x4'));var BPromise=require(_0x5089('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5089('0x6'));var rimraf=require(_0x5089('0x7'));var config=require('../../config/environment');var attributes=require(_0x5089('0x8'));module['exports']=function(_0x32e571,_0x298ee1){return _0x32e571[_0x5089('0x9')](_0x5089('0xa'),attributes,{'tableName':_0x5089('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x8104f3,_0x497803,_0x381d50){if(_0x8104f3[_0x5089('0xc')](_0x5089('0xd'))){_0x8104f3[_0x5089('0xe')]=moment()[_0x5089('0xf')](_0x5089('0x10'));}if(_0x8104f3['changed'](_0x5089('0x11'))){_0x8104f3[_0x5089('0x12')]=moment()[_0x5089('0xf')](_0x5089('0x10'));}_0x381d50(null,_0x8104f3);}}});}; \ No newline at end of file +var _0x7edd=['exports','square_projects','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x25b12b,_0x1660a0){var _0x17533f=function(_0x2500f1){while(--_0x2500f1){_0x25b12b['push'](_0x25b12b['shift']());}};_0x17533f(++_0x1660a0);}(_0x7edd,0x107));var _0xd7ed=function(_0x3931d0,_0x2296dc){_0x3931d0=_0x3931d0-0x0;var _0x3f35bb=_0x7edd[_0x3931d0];return _0x3f35bb;};'use strict';var _=require(_0xd7ed('0x0'));var util=require(_0xd7ed('0x1'));var logger=require(_0xd7ed('0x2'))('api');var moment=require(_0xd7ed('0x3'));var BPromise=require('bluebird');var rp=require(_0xd7ed('0x4'));var fs=require('fs');var path=require(_0xd7ed('0x5'));var rimraf=require(_0xd7ed('0x6'));var config=require('../../config/environment');var attributes=require('./squareProject.attributes');module[_0xd7ed('0x7')]=function(_0x4de114,_0x152db8){return _0x4de114['define']('SquareProject',attributes,{'tableName':_0xd7ed('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x51865a,_0x2154f3,_0x2ee556){if(_0x51865a['changed'](_0xd7ed('0x9'))){_0x51865a[_0xd7ed('0xa')]=moment()[_0xd7ed('0xb')](_0xd7ed('0xc'));}if(_0x51865a['changed'](_0xd7ed('0xd'))){_0x51865a[_0xd7ed('0xe')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x2ee556(null,_0x51865a);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 6996d1b..215c9b7 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 _0xabee=['map','info','stringify','catch','error','message','ShowSquareProject','find','then','ioredis','../../config/logger','rpc','redis','localhost','socket.io-emitter','register','GetSquareProjects','SquareProject','options','raw','where','include','model','attributes'];(function(_0x443f90,_0x3d916d){var _0x11c8e5=function(_0x257afa){while(--_0x257afa){_0x443f90['push'](_0x443f90['shift']());}};_0x11c8e5(++_0x3d916d);}(_0xabee,0x111));var _0xeabe=function(_0x1b703f,_0x2fd83a){_0x1b703f=_0x1b703f-0x0;var _0x1a41f3=_0xabee[_0x1b703f];return _0x1a41f3;};'use strict';var _=require('lodash');var Redis=require(_0xeabe('0x0'));var db=require('../../mysqldb')['db'];var logger=require(_0xeabe('0x1'))(_0xeabe('0x2'));var config=require('../../config/environment');config[_0xeabe('0x3')]=_['defaults'](config[_0xeabe('0x3')],{'host':_0xeabe('0x4'),'port':0x18eb});var socket=require(_0xeabe('0x5'))(new Redis(config[_0xeabe('0x3')]));require('./squareProject.socket')[_0xeabe('0x6')](socket);exports[_0xeabe('0x7')]=function(_0x2f9c35){var _0x2bd755=this;return new Promise(function(_0x1edc62,_0x2934dc){return db[_0xeabe('0x8')]['findAll']({'raw':_0x2f9c35[_0xeabe('0x9')]?_0x2f9c35[_0xeabe('0x9')][_0xeabe('0xa')]===undefined?!![]:![]:!![],'where':_0x2f9c35['options']?_0x2f9c35[_0xeabe('0x9')][_0xeabe('0xb')]||null:null,'attributes':_0x2f9c35[_0xeabe('0x9')]?_0x2f9c35['options']['attributes']||null:null,'limit':_0x2f9c35['options']?_0x2f9c35[_0xeabe('0x9')]['limit']||null:null,'include':_0x2f9c35[_0xeabe('0x9')]?_0x2f9c35['options'][_0xeabe('0xc')]?_['map'](_0x2f9c35['options'][_0xeabe('0xc')],function(_0x41e939){return{'model':db[_0x41e939[_0xeabe('0xd')]],'as':_0x41e939['as'],'attributes':_0x41e939[_0xeabe('0xe')],'include':_0x41e939[_0xeabe('0xc')]?_[_0xeabe('0xf')](_0x41e939[_0xeabe('0xc')],function(_0x48168e){return{'model':db[_0x48168e['model']],'as':_0x48168e['as'],'attributes':_0x48168e['attributes'],'include':_0x48168e[_0xeabe('0xc')]?_[_0xeabe('0xf')](_0x48168e[_0xeabe('0xc')],function(_0x5d24b5){return{'model':db[_0x5d24b5['model']],'as':_0x5d24b5['as'],'attributes':_0x5d24b5[_0xeabe('0xe')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4bbadc){logger[_0xeabe('0x10')](_0xeabe('0x7'),_0x2f9c35);logger['debug'](_0xeabe('0x7'),_0x2f9c35,JSON[_0xeabe('0x11')](_0x4bbadc));_0x1edc62(_0x4bbadc);})[_0xeabe('0x12')](function(_0x13af0b){logger[_0xeabe('0x13')]('GetSquareProjects',_0x13af0b[_0xeabe('0x14')],_0x2f9c35);_0x2934dc(_0x2bd755['error'](0x1f4,_0x13af0b['message']));});});};exports[_0xeabe('0x15')]=function(_0x2e767e){var _0x1367dd=this;return new Promise(function(_0x49ea84,_0x3f4a5b){return db['SquareProject'][_0xeabe('0x16')]({'raw':_0x2e767e['options']?_0x2e767e[_0xeabe('0x9')][_0xeabe('0xa')]===undefined?!![]:![]:!![],'where':_0x2e767e[_0xeabe('0x9')]?_0x2e767e['options'][_0xeabe('0xb')]||null:null,'attributes':_0x2e767e[_0xeabe('0x9')]?_0x2e767e[_0xeabe('0x9')][_0xeabe('0xe')]||null:null,'include':_0x2e767e[_0xeabe('0x9')]?_0x2e767e[_0xeabe('0x9')][_0xeabe('0xc')]?_[_0xeabe('0xf')](_0x2e767e[_0xeabe('0x9')][_0xeabe('0xc')],function(_0x515553){return{'model':db[_0x515553[_0xeabe('0xd')]],'as':_0x515553['as'],'attributes':_0x515553[_0xeabe('0xe')],'include':_0x515553['include']?_[_0xeabe('0xf')](_0x515553['include'],function(_0x24364d){return{'model':db[_0x24364d[_0xeabe('0xd')]],'as':_0x24364d['as'],'attributes':_0x24364d[_0xeabe('0xe')],'include':_0x24364d[_0xeabe('0xc')]?_[_0xeabe('0xf')](_0x24364d[_0xeabe('0xc')],function(_0x46175d){return{'model':db[_0x46175d[_0xeabe('0xd')]],'as':_0x46175d['as'],'attributes':_0x46175d[_0xeabe('0xe')]};}):[]};}):[]};}):[]:[]})[_0xeabe('0x17')](function(_0x37e859){logger['info']('ShowSquareProject',_0x2e767e);logger['debug']('ShowSquareProject',_0x2e767e,JSON['stringify'](_0x37e859));_0x49ea84(_0x37e859);})['catch'](function(_0x2e8014){logger[_0xeabe('0x13')]('ShowSquareProject',_0x2e8014['message'],_0x2e767e);_0x3f4a5b(_0x1367dd[_0xeabe('0x13')](0x1f4,_0x2e8014['message']));});});}; \ No newline at end of file +var _0x8634=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','findAll','options','raw','where','attributes','limit','include','map','model','GetSquareProjects','debug','stringify','error','message','then','info','ShowSquareProject','catch','lodash'];(function(_0x3e9c48,_0x420b13){var _0x485046=function(_0x197809){while(--_0x197809){_0x3e9c48['push'](_0x3e9c48['shift']());}};_0x485046(++_0x420b13);}(_0x8634,0x77));var _0x4863=function(_0x51b661,_0x566ef8){_0x51b661=_0x51b661-0x0;var _0x5d1971=_0x8634[_0x51b661];return _0x5d1971;};'use strict';var _=require(_0x4863('0x0'));var Redis=require(_0x4863('0x1'));var db=require(_0x4863('0x2'))['db'];var logger=require(_0x4863('0x3'))(_0x4863('0x4'));var config=require(_0x4863('0x5'));config[_0x4863('0x6')]=_[_0x4863('0x7')](config[_0x4863('0x6')],{'host':_0x4863('0x8'),'port':0x18eb});var socket=require(_0x4863('0x9'))(new Redis(config['redis']));require(_0x4863('0xa'))[_0x4863('0xb')](socket);exports['GetSquareProjects']=function(_0x562080){var _0x5758d5=this;return new Promise(function(_0x2406c2,_0x4a36de){return db['SquareProject'][_0x4863('0xc')]({'raw':_0x562080[_0x4863('0xd')]?_0x562080['options'][_0x4863('0xe')]===undefined?!![]:![]:!![],'where':_0x562080['options']?_0x562080[_0x4863('0xd')][_0x4863('0xf')]||null:null,'attributes':_0x562080['options']?_0x562080[_0x4863('0xd')][_0x4863('0x10')]||null:null,'limit':_0x562080[_0x4863('0xd')]?_0x562080[_0x4863('0xd')][_0x4863('0x11')]||null:null,'include':_0x562080['options']?_0x562080['options'][_0x4863('0x12')]?_[_0x4863('0x13')](_0x562080[_0x4863('0xd')][_0x4863('0x12')],function(_0x15999e){return{'model':db[_0x15999e[_0x4863('0x14')]],'as':_0x15999e['as'],'attributes':_0x15999e[_0x4863('0x10')],'include':_0x15999e['include']?_[_0x4863('0x13')](_0x15999e[_0x4863('0x12')],function(_0x284cfc){return{'model':db[_0x284cfc[_0x4863('0x14')]],'as':_0x284cfc['as'],'attributes':_0x284cfc['attributes'],'include':_0x284cfc['include']?_[_0x4863('0x13')](_0x284cfc[_0x4863('0x12')],function(_0xb500ee){return{'model':db[_0xb500ee[_0x4863('0x14')]],'as':_0xb500ee['as'],'attributes':_0xb500ee[_0x4863('0x10')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x60140e){logger['info'](_0x4863('0x15'),_0x562080);logger[_0x4863('0x16')](_0x4863('0x15'),_0x562080,JSON[_0x4863('0x17')](_0x60140e));_0x2406c2(_0x60140e);})['catch'](function(_0x1d433f){logger[_0x4863('0x18')](_0x4863('0x15'),_0x1d433f['message'],_0x562080);_0x4a36de(_0x5758d5['error'](0x1f4,_0x1d433f[_0x4863('0x19')]));});});};exports['ShowSquareProject']=function(_0x4c4367){var _0x1c0bcc=this;return new Promise(function(_0x169bb4,_0x48908a){return db['SquareProject']['find']({'raw':_0x4c4367['options']?_0x4c4367[_0x4863('0xd')][_0x4863('0xe')]===undefined?!![]:![]:!![],'where':_0x4c4367['options']?_0x4c4367['options'][_0x4863('0xf')]||null:null,'attributes':_0x4c4367['options']?_0x4c4367[_0x4863('0xd')][_0x4863('0x10')]||null:null,'include':_0x4c4367['options']?_0x4c4367[_0x4863('0xd')]['include']?_['map'](_0x4c4367[_0x4863('0xd')][_0x4863('0x12')],function(_0x1f925f){return{'model':db[_0x1f925f['model']],'as':_0x1f925f['as'],'attributes':_0x1f925f[_0x4863('0x10')],'include':_0x1f925f['include']?_[_0x4863('0x13')](_0x1f925f['include'],function(_0x27bf76){return{'model':db[_0x27bf76['model']],'as':_0x27bf76['as'],'attributes':_0x27bf76[_0x4863('0x10')],'include':_0x27bf76[_0x4863('0x12')]?_[_0x4863('0x13')](_0x27bf76[_0x4863('0x12')],function(_0x7f5865){return{'model':db[_0x7f5865['model']],'as':_0x7f5865['as'],'attributes':_0x7f5865[_0x4863('0x10')]};}):[]};}):[]};}):[]:[]})[_0x4863('0x1a')](function(_0x4966f6){logger[_0x4863('0x1b')](_0x4863('0x1c'),_0x4c4367);logger[_0x4863('0x16')](_0x4863('0x1c'),_0x4c4367,JSON[_0x4863('0x17')](_0x4966f6));_0x169bb4(_0x4966f6);})[_0x4863('0x1d')](function(_0x12c878){logger[_0x4863('0x18')]('ShowSquareProject',_0x12c878[_0x4863('0x19')],_0x4c4367);_0x48908a(_0x1c0bcc[_0x4863('0x18')](0x1f4,_0x12c878[_0x4863('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 685c24e..6d12965 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 _0xe774=['register','save','remove','emit','removeListener'];(function(_0x1da6be,_0x5d4e33){var _0x1264cf=function(_0x65beb4){while(--_0x65beb4){_0x1da6be['push'](_0x1da6be['shift']());}};_0x1264cf(++_0x5d4e33);}(_0xe774,0xd3));var _0x4e77=function(_0xd96afa,_0x434d89){_0xd96afa=_0xd96afa-0x0;var _0x3a8f93=_0xe774[_0xd96afa];return _0x3a8f93;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x4e77('0x0'),_0x4e77('0x1'),'update'];function createListener(_0x1d18be,_0x444dc4){return function(_0x523858){_0x444dc4[_0x4e77('0x2')](_0x1d18be,_0x523858);};}function removeListener(_0x5652a2,_0x2ad6d8){return function(){SquareProjectEvents[_0x4e77('0x3')](_0x5652a2,_0x2ad6d8);};}exports[_0x4e77('0x4')]=function(_0x15c689){for(var _0x13c222=0x0,_0x5631a4=events['length'];_0x13c222<_0x5631a4;_0x13c222++){var _0x48a7a6=events[_0x13c222];var _0xd3db49=createListener('squareProject:'+_0x48a7a6,_0x15c689);SquareProjectEvents['on'](_0x48a7a6,_0xd3db49);}}; \ No newline at end of file +var _0xb83f=['register','squareProject:','./squareProject.events','save','remove','emit','removeListener'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xb83f,0x1e5));var _0xfb83=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xb83f[_0xbca1b1];return _0x4e1686;};'use strict';var SquareProjectEvents=require(_0xfb83('0x0'));var events=[_0xfb83('0x1'),_0xfb83('0x2'),'update'];function createListener(_0x54504b,_0xc002f9){return function(_0x56f81b){_0xc002f9[_0xfb83('0x3')](_0x54504b,_0x56f81b);};}function removeListener(_0x169f52,_0x161ffa){return function(){SquareProjectEvents[_0xfb83('0x4')](_0x169f52,_0x161ffa);};}exports[_0xfb83('0x5')]=function(_0x34fbba){for(var _0x2288a5=0x0,_0x1fb2ef=events['length'];_0x2288a5<_0x1fb2ef;_0x2288a5++){var _0x3665c2=events[_0x2288a5];var _0x54e670=createListener(_0xfb83('0x6')+_0x3665c2,_0x34fbba);SquareProjectEvents['on'](_0x3665c2,_0x54e670);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index f6f3cd1..d3cef08 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 _0x5fc3=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','show','/:id/download','download','post','create','put','update','/:id','multer','util','connect-timeout'];(function(_0x438e29,_0x4c6372){var _0x431539=function(_0x46ecec){while(--_0x46ecec){_0x438e29['push'](_0x438e29['shift']());}};_0x431539(++_0x4c6372);}(_0x5fc3,0xa8));var _0x35fc=function(_0x1dc24d,_0x541fa4){_0x1dc24d=_0x1dc24d-0x0;var _0x5d7fb2=_0x5fc3[_0x1dc24d];return _0x5d7fb2;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0xe')]('/',auth['isAuthenticated'](),controller[_0x35fc('0xf')]);router[_0x35fc('0x10')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0x11')]);router['delete'](_0x35fc('0x12'),auth[_0x35fc('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xe14b=['Router','../../components/auth/service','./squareRecording.controller','get','isAuthenticated','index','/:id','download','post','delete','destroy','exports','multer','util','express'];(function(_0x456203,_0x459216){var _0x593a74=function(_0x1d1574){while(--_0x1d1574){_0x456203['push'](_0x456203['shift']());}};_0x593a74(++_0x459216);}(_0xe14b,0x93));var _0xbe14=function(_0x54950d,_0x48b6df){_0x54950d=_0x54950d-0x0;var _0x1a72df=_0xe14b[_0x54950d];return _0x1a72df;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['show']);router['get']('/:id/download',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0xb')]('/',auth[_0xbe14('0x7')](),controller['create']);router['put'](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0xc')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xd')]);module[_0xbe14('0xe')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index a1f3c49..516f165 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 _0x2d17=['VIRTUAL','getDataValue','savePath','lastIndexOf','sequelize','exports','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2d17,0x17e));var _0x72d1=function(_0x8a24ff,_0x2df6c9){_0x8a24ff=_0x8a24ff-0x0;var _0x30e6d2=_0x2d17[_0x8a24ff];return _0x30e6d2;};'use strict';var Sequelize=require(_0x72d1('0x0'));module[_0x72d1('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x72d1('0x2')]},'calleridname':{'type':Sequelize[_0x72d1('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x72d1('0x2')]},'priority':{'type':Sequelize[_0x72d1('0x2')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x72d1('0x2')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize[_0x72d1('0x2')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0x72d1('0x2')]},'format':{'type':Sequelize[_0x72d1('0x3')],'get':function(){var _0x5b40a9='';var _0x477264=this[_0x72d1('0x4')](_0x72d1('0x5'));if(_0x477264){_0x5b40a9=_0x477264['substring'](_0x477264[_0x72d1('0x6')]('.'));}return _0x5b40a9;}}}; \ No newline at end of file +var _0xae24=['VIRTUAL','savePath','sequelize','STRING'];(function(_0x46f033,_0x44b502){var _0xe6d23d=function(_0x606ba7){while(--_0x606ba7){_0x46f033['push'](_0x46f033['shift']());}};_0xe6d23d(++_0x44b502);}(_0xae24,0x182));var _0x4ae2=function(_0x5accb5,_0x18da02){_0x5accb5=_0x5accb5-0x0;var _0x3fbe6a=_0xae24[_0x5accb5];return _0x3fbe6a;};'use strict';var Sequelize=require(_0x4ae2('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x4ae2('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x4ae2('0x1')]},'context':{'type':Sequelize[_0x4ae2('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x4ae2('0x1')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x4ae2('0x1')]},'saveName':{'type':Sequelize[_0x4ae2('0x1')]},'filename':{'type':Sequelize[_0x4ae2('0x1')]},'savePath':{'type':Sequelize[_0x4ae2('0x1')]},'format':{'type':Sequelize[_0x4ae2('0x2')],'get':function(){var _0x307247='';var _0x4f2e84=this['getDataValue'](_0x4ae2('0x3'));if(_0x4f2e84){_0x307247=_0x4f2e84['substring'](_0x4f2e84['lastIndexOf']('.'));}return _0x307247;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 57bf516..8c90850 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 _0xcaa3=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','SquareRecording','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','VIRTUAL','merge','options','where','includeAll','include','findAll','rows','catch','params','find','create','body','download','../../components/encryptor','uniqueid','savePath','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','File:\x20\x22','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x4503df,_0xfec122){var _0x3f1b2b=function(_0x32b1de){while(--_0x32b1de){_0x4503df['push'](_0x4503df['shift']());}};_0x3f1b2b(++_0xfec122);}(_0xcaa3,0xbc));var _0x3caa=function(_0x1d8119,_0xc98f17){_0x1d8119=_0x1d8119-0x0;var _0x3e30f6=_0xcaa3[_0x1d8119];return _0x3e30f6;};'use strict';var emlformat=require(_0x3caa('0x0'));var rimraf=require(_0x3caa('0x1'));var zipdir=require(_0x3caa('0x2'));var jsonpatch=require(_0x3caa('0x3'));var rp=require(_0x3caa('0x4'));var moment=require(_0x3caa('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3caa('0x6'));var util=require(_0x3caa('0x7'));var path=require(_0x3caa('0x8'));var sox=require(_0x3caa('0x9'));var csv=require(_0x3caa('0xa'));var ejs=require(_0x3caa('0xb'));var fs=require('fs');var fs_extra=require(_0x3caa('0xc'));var _=require(_0x3caa('0xd'));var squel=require('squel');var crypto=require(_0x3caa('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x3caa('0xf'));var toCsv=require(_0x3caa('0xa'));var querystring=require('querystring');var Papa=require(_0x3caa('0x10'));var Redis=require(_0x3caa('0x11'));var authService=require(_0x3caa('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x3caa('0x13'));var hardwareService=require(_0x3caa('0x14'));var logger=require(_0x3caa('0x15'))(_0x3caa('0x16'));var utils=require(_0x3caa('0x17'));var config=require(_0x3caa('0x18'));var licenseUtil=require(_0x3caa('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17dd02,_0x517dd4){_0x517dd4=_0x517dd4||0xcc;return function(_0x56f153){if(_0x56f153){return _0x17dd02['sendStatus'](_0x517dd4);}return _0x17dd02[_0x3caa('0x1a')](_0x517dd4)[_0x3caa('0x1b')]();};}function respondWithResult(_0x342833,_0x2e0c3f){_0x2e0c3f=_0x2e0c3f||0xc8;return function(_0x4b12c2){if(_0x4b12c2){return _0x342833['status'](_0x2e0c3f)['json'](_0x4b12c2);}};}function respondWithFilteredResult(_0x17161e,_0xb571c1){return function(_0xe868c2){if(_0xe868c2){var _0x241cc0=typeof _0xb571c1[_0x3caa('0x1c')]===_0x3caa('0x1d')&&typeof _0xb571c1[_0x3caa('0x1e')]===_0x3caa('0x1d');var _0x4aa93b=_0xe868c2[_0x3caa('0x1f')];var _0x3d3546=_0x241cc0?0x0:_0xb571c1['offset'];var _0x1d25f3=_0x241cc0?_0xe868c2['count']:_0xb571c1[_0x3caa('0x1c')]+_0xb571c1[_0x3caa('0x1e')];var _0x3b9157;if(_0x1d25f3>=_0x4aa93b){_0x1d25f3=_0x4aa93b;_0x3b9157=0xc8;}else{_0x3b9157=0xce;}_0x17161e['status'](_0x3b9157);return _0x17161e[_0x3caa('0x20')](_0x3caa('0x21'),_0x3d3546+'-'+_0x1d25f3+'/'+_0x4aa93b)[_0x3caa('0x22')](_0xe868c2);}return null;};}function patchUpdates(_0x9f2dd0){return function(_0x4e38e2){try{jsonpatch[_0x3caa('0x23')](_0x4e38e2,_0x9f2dd0,!![]);}catch(_0x56231f){return BPromise[_0x3caa('0x24')](_0x56231f);}return _0x4e38e2[_0x3caa('0x25')]();};}function saveUpdates(_0x3ec2eb,_0x4df159){return function(_0x27ddce){if(_0x27ddce){return _0x27ddce[_0x3caa('0x26')](_0x3ec2eb)[_0x3caa('0x27')](function(_0x59c920){return _0x59c920;});}return null;};}function removeEntity(_0x417a37,_0x46af6d){return function(_0x33f991){if(_0x33f991){return _0x33f991[_0x3caa('0x28')]()[_0x3caa('0x27')](function(){_0x417a37[_0x3caa('0x1a')](0xcc)[_0x3caa('0x1b')]();});}};}function handleEntityNotFound(_0xc1a5cf,_0x4d198a){return function(_0x574223){if(!_0x574223){_0xc1a5cf[_0x3caa('0x29')](0x194);}return _0x574223;};}function handleError(_0x3a86c2,_0x1643f3){_0x1643f3=_0x1643f3||0x1f4;return function(_0x48005d){logger[_0x3caa('0x2a')](_0x48005d[_0x3caa('0x2b')]);if(_0x48005d[_0x3caa('0x2c')]){delete _0x48005d[_0x3caa('0x2c')];}_0x3a86c2[_0x3caa('0x1a')](_0x1643f3)[_0x3caa('0x2d')](_0x48005d);};}exports[_0x3caa('0x2e')]=function(_0x4af090,_0x4d2f5a){var _0x490165={},_0x43584c={},_0x4e4a70={'count':0x0,'rows':[]};var _0x34302b=_[_0x3caa('0x2f')](db[_0x3caa('0x30')][_0x3caa('0x31')],function(_0x4e2405){return{'name':_0x4e2405['fieldName'],'type':_0x4e2405[_0x3caa('0x32')][_0x3caa('0x33')]};});_0x43584c[_0x3caa('0x34')]=_[_0x3caa('0x2f')](_0x34302b,_0x3caa('0x2c'));_0x43584c['query']=_[_0x3caa('0x35')](_0x4af090[_0x3caa('0x36')]);_0x43584c[_0x3caa('0x37')]=_[_0x3caa('0x38')](_0x43584c[_0x3caa('0x34')],_0x43584c[_0x3caa('0x36')]);_0x490165[_0x3caa('0x39')]=_['intersection'](_0x43584c[_0x3caa('0x34')],qs[_0x3caa('0x3a')](_0x4af090[_0x3caa('0x36')]['fields']));_0x490165[_0x3caa('0x39')]=_0x490165['attributes'][_0x3caa('0x3b')]?_0x490165['attributes']:_0x43584c[_0x3caa('0x34')];if(!_0x4af090[_0x3caa('0x36')][_0x3caa('0x3c')](_0x3caa('0x3d'))){_0x490165[_0x3caa('0x1e')]=qs['limit'](_0x4af090[_0x3caa('0x36')]['limit']);_0x490165[_0x3caa('0x1c')]=qs[_0x3caa('0x1c')](_0x4af090[_0x3caa('0x36')][_0x3caa('0x1c')]);}_0x490165[_0x3caa('0x3e')]=qs[_0x3caa('0x3f')](_0x4af090[_0x3caa('0x36')][_0x3caa('0x3f')]);_0x490165['where']=qs[_0x3caa('0x37')](_['pick'](_0x4af090['query'],_0x43584c[_0x3caa('0x37')]),_0x34302b);if(_0x4af090[_0x3caa('0x36')][_0x3caa('0x40')]){_0x490165['where']=_['merge'](_0x490165['where'],{'$or':_[_0x3caa('0x2f')](_0x34302b,function(_0x36ce88){if(_0x36ce88[_0x3caa('0x32')]!==_0x3caa('0x41')){var _0x21e171={};_0x21e171[_0x36ce88[_0x3caa('0x2c')]]={'$like':'%'+_0x4af090[_0x3caa('0x36')][_0x3caa('0x40')]+'%'};return _0x21e171;}})});}_0x490165=_[_0x3caa('0x42')]({},_0x490165,_0x4af090[_0x3caa('0x43')]);var _0x2513b1={'where':_0x490165[_0x3caa('0x44')]};return db['SquareRecording'][_0x3caa('0x1f')](_0x2513b1)[_0x3caa('0x27')](function(_0x3b06e6){_0x4e4a70[_0x3caa('0x1f')]=_0x3b06e6;if(_0x4af090['query'][_0x3caa('0x45')]){_0x490165[_0x3caa('0x46')]=[{'all':!![]}];}return db[_0x3caa('0x30')][_0x3caa('0x47')](_0x490165);})[_0x3caa('0x27')](function(_0x18b2d7){_0x4e4a70[_0x3caa('0x48')]=_0x18b2d7;return _0x4e4a70;})[_0x3caa('0x27')](respondWithFilteredResult(_0x4d2f5a,_0x490165))[_0x3caa('0x49')](handleError(_0x4d2f5a,null));};exports['show']=function(_0x2f21e6,_0x4b8c5a){var _0x5ce4a1={'raw':!![],'where':{'id':_0x2f21e6[_0x3caa('0x4a')]['id']}},_0x329060={};_0x329060[_0x3caa('0x34')]=_[_0x3caa('0x35')](db[_0x3caa('0x30')]['rawAttributes']);_0x329060['query']=_[_0x3caa('0x35')](_0x2f21e6['query']);_0x329060[_0x3caa('0x37')]=_['intersection'](_0x329060[_0x3caa('0x34')],_0x329060[_0x3caa('0x36')]);_0x5ce4a1[_0x3caa('0x39')]=_[_0x3caa('0x38')](_0x329060[_0x3caa('0x34')],qs[_0x3caa('0x3a')](_0x2f21e6[_0x3caa('0x36')][_0x3caa('0x3a')]));_0x5ce4a1['attributes']=_0x5ce4a1[_0x3caa('0x39')][_0x3caa('0x3b')]?_0x5ce4a1[_0x3caa('0x39')]:_0x329060[_0x3caa('0x34')];if(_0x2f21e6[_0x3caa('0x36')][_0x3caa('0x45')]){_0x5ce4a1['include']=[{'all':!![]}];}_0x5ce4a1=_[_0x3caa('0x42')]({},_0x5ce4a1,_0x2f21e6[_0x3caa('0x43')]);return db[_0x3caa('0x30')][_0x3caa('0x4b')](_0x5ce4a1)[_0x3caa('0x27')](handleEntityNotFound(_0x4b8c5a,null))['then'](respondWithResult(_0x4b8c5a,null))['catch'](handleError(_0x4b8c5a,null));};exports[_0x3caa('0x4c')]=function(_0xeb8d58,_0x5e4ee0){return db[_0x3caa('0x30')][_0x3caa('0x4c')](_0xeb8d58[_0x3caa('0x4d')],{})['then'](respondWithResult(_0x5e4ee0,0xc9))[_0x3caa('0x49')](handleError(_0x5e4ee0,null));};exports[_0x3caa('0x26')]=function(_0x42bcc7,_0x4792b8){if(_0x42bcc7[_0x3caa('0x4d')]['id']){delete _0x42bcc7[_0x3caa('0x4d')]['id'];}return db[_0x3caa('0x30')][_0x3caa('0x4b')]({'where':{'id':_0x42bcc7['params']['id']}})[_0x3caa('0x27')](handleEntityNotFound(_0x4792b8,null))['then'](saveUpdates(_0x42bcc7[_0x3caa('0x4d')],null))['then'](respondWithResult(_0x4792b8,null))[_0x3caa('0x49')](handleError(_0x4792b8,null));};exports[_0x3caa('0x4e')]=function(_0x1e2ad2,_0x222abf,_0x557910){var _0x27ec20=require(_0x3caa('0x4f'));var _0x210241=![];var _0x42538a={};if(_0x1e2ad2['query'][_0x3caa('0x32')]&&_0x1e2ad2[_0x3caa('0x36')]['type']===_0x3caa('0x50')){_0x42538a[_0x3caa('0x50')]=_0x1e2ad2[_0x3caa('0x4a')]['id'];}else{_0x42538a['id']=_0x1e2ad2[_0x3caa('0x4a')]['id'];}return db[_0x3caa('0x30')]['find']({'where':_0x42538a,'attributes':['id',_0x3caa('0x51'),'filename'],'raw':!![]})['then'](handleEntityNotFound(_0x222abf,null))[_0x3caa('0x27')](function(_0x46396b){if(_0x46396b){var _0xf335c5=_0x46396b[_0x3caa('0x51')];var _0x4ba2b3=util[_0x3caa('0x52')](_0x3caa('0x53'),_0xf335c5);if(fs[_0x3caa('0x54')](_0x4ba2b3)){_0x210241=!![];return _0x27ec20[_0x3caa('0x55')](_0x4ba2b3,_0xf335c5,config[_0x3caa('0x56')][_0x3caa('0x57')])['then'](function(){return _0x46396b;});}return _0x46396b;}})[_0x3caa('0x27')](function(_0x5d0b93){if(_0x5d0b93){var _0x430b31=_0x5d0b93[_0x3caa('0x51')];if(!fs[_0x3caa('0x54')](_0x430b31)){throw new db[(_0x3caa('0x58'))][(_0x3caa('0x59'))](_0x3caa('0x5a'));}if(_0x5d0b93[_0x3caa('0x5b')]){return _0x222abf['download'](_0x430b31,_0x5d0b93[_0x3caa('0x5b')]+path[_0x3caa('0x5c')](_0x430b31),function(){if(_0x210241){fs[_0x3caa('0x5d')](_0x430b31);}});}else{return _0x222abf[_0x3caa('0x4e')](_0x430b31,function(_0x655d25){if(_0x210241){fs[_0x3caa('0x5d')](_0x430b31);}});}}})[_0x3caa('0x49')](function(_0x10f069){if(_0x10f069[_0x3caa('0x5e')]==='SquareRecording\x20not\x20found'){_0x222abf[_0x3caa('0x1a')](0x194)[_0x3caa('0x2d')](_0x3caa('0x5f'));}else{return handleError(_0x222abf,null);}});};exports[_0x3caa('0x28')]=function(_0x48c70c,_0x1c38fe){return db[_0x3caa('0x30')][_0x3caa('0x4b')]({'where':{'id':_0x48c70c['params']['id']}})[_0x3caa('0x27')](function(_0x55b860){if(_[_0x3caa('0x60')](_0x55b860)){throw new ReferenceError(_0x3caa('0x61'));}return _0x55b860;})[_0x3caa('0x27')](function(_0x3556bd){var _0x5bd72e=_0x3556bd[_0x3caa('0x51')];logger[_0x3caa('0x62')](_0x3caa('0x63'),_0x5bd72e);if(!_[_0x3caa('0x60')](_0x3556bd[_0x3caa('0x51')])&&fs['existsSync'](_0x5bd72e)){logger[_0x3caa('0x62')]('File:\x20\x22'+_0x5bd72e+_0x3caa('0x64'));fs['unlinkSync'](_0x5bd72e);}_0x5bd72e=_0x5bd72e+_0x3caa('0x65');if(!_[_0x3caa('0x60')](_0x3556bd['savePath'])&&fs[_0x3caa('0x54')](_0x5bd72e)){logger[_0x3caa('0x62')](_0x3caa('0x66')+_0x5bd72e+_0x3caa('0x64'));fs[_0x3caa('0x67')](_0x5bd72e);}return _0x3556bd;})[_0x3caa('0x27')](function(_0x14f39b){if(!_0x14f39b)throw new InternalError();return _0x14f39b[_0x3caa('0x28')]();})['then'](function(){_0x1c38fe[_0x3caa('0x1a')](0xcc)[_0x3caa('0x1b')]();})[_0x3caa('0x49')](handleError(_0x1c38fe,null));}; \ No newline at end of file +var _0x2b26=['desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','error','name','index','map','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','filter','where','VIRTUAL','merge','options','SquareRecording','findAll','rows','catch','show','params','includeAll','include','find','create','body','download','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','existsSync','secrets','recording','Sequelize','unlink','message','SquareRecording\x20not\x20found','send','Not\x20found','Entity\x20not\x20found','info','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2b26,0x10b));var _0x62b2=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x2b26[_0x160c73];return _0xd9302;};'use strict';var emlformat=require(_0x62b2('0x0'));var rimraf=require(_0x62b2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x62b2('0x2'));var BPromise=require(_0x62b2('0x3'));var Mustache=require(_0x62b2('0x4'));var util=require(_0x62b2('0x5'));var path=require('path');var sox=require(_0x62b2('0x6'));var csv=require(_0x62b2('0x7'));var ejs=require(_0x62b2('0x8'));var fs=require('fs');var fs_extra=require(_0x62b2('0x9'));var _=require('lodash');var squel=require(_0x62b2('0xa'));var crypto=require(_0x62b2('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x62b2('0xc'));var toCsv=require(_0x62b2('0x7'));var querystring=require(_0x62b2('0xd'));var Papa=require(_0x62b2('0xe'));var Redis=require(_0x62b2('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x62b2('0x10'));var as=require(_0x62b2('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x62b2('0x12'))('api');var utils=require(_0x62b2('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x62b2('0x14'));var db=require(_0x62b2('0x15'))['db'];function respondWithStatusCode(_0x27cecd,_0x1dce91){_0x1dce91=_0x1dce91||0xcc;return function(_0x37d525){if(_0x37d525){return _0x27cecd[_0x62b2('0x16')](_0x1dce91);}return _0x27cecd[_0x62b2('0x17')](_0x1dce91)[_0x62b2('0x18')]();};}function respondWithResult(_0x3441a8,_0x42867e){_0x42867e=_0x42867e||0xc8;return function(_0x45fa2e){if(_0x45fa2e){return _0x3441a8[_0x62b2('0x17')](_0x42867e)[_0x62b2('0x19')](_0x45fa2e);}};}function respondWithFilteredResult(_0x2cdd23,_0x2f0961){return function(_0x386573){if(_0x386573){var _0x41cbfd=typeof _0x2f0961[_0x62b2('0x1a')]===_0x62b2('0x1b')&&typeof _0x2f0961[_0x62b2('0x1c')]==='undefined';var _0x4715a1=_0x386573[_0x62b2('0x1d')];var _0x40f98c=_0x41cbfd?0x0:_0x2f0961[_0x62b2('0x1a')];var _0x3cdd66=_0x41cbfd?_0x386573[_0x62b2('0x1d')]:_0x2f0961[_0x62b2('0x1a')]+_0x2f0961['limit'];var _0x1cf1bc;if(_0x3cdd66>=_0x4715a1){_0x3cdd66=_0x4715a1;_0x1cf1bc=0xc8;}else{_0x1cf1bc=0xce;}_0x2cdd23[_0x62b2('0x17')](_0x1cf1bc);return _0x2cdd23['set'](_0x62b2('0x1e'),_0x40f98c+'-'+_0x3cdd66+'/'+_0x4715a1)['json'](_0x386573);}return null;};}function patchUpdates(_0x325774){return function(_0x4c58ab){try{jsonpatch[_0x62b2('0x1f')](_0x4c58ab,_0x325774,!![]);}catch(_0x5ba652){return BPromise[_0x62b2('0x20')](_0x5ba652);}return _0x4c58ab[_0x62b2('0x21')]();};}function saveUpdates(_0x5e81ee,_0x3768fc){return function(_0xa9fe3b){if(_0xa9fe3b){return _0xa9fe3b[_0x62b2('0x22')](_0x5e81ee)['then'](function(_0x32a9b8){return _0x32a9b8;});}return null;};}function removeEntity(_0x162f86,_0x2fabc2){return function(_0xe50a93){if(_0xe50a93){return _0xe50a93[_0x62b2('0x23')]()[_0x62b2('0x24')](function(){_0x162f86['status'](0xcc)[_0x62b2('0x18')]();});}};}function handleEntityNotFound(_0xa1d1f,_0x537c84){return function(_0x101bcf){if(!_0x101bcf){_0xa1d1f[_0x62b2('0x16')](0x194);}return _0x101bcf;};}function handleError(_0x6d043d,_0x286d0d){_0x286d0d=_0x286d0d||0x1f4;return function(_0x271886){logger[_0x62b2('0x25')](_0x271886['stack']);if(_0x271886[_0x62b2('0x26')]){delete _0x271886['name'];}_0x6d043d[_0x62b2('0x17')](_0x286d0d)['send'](_0x271886);};}exports[_0x62b2('0x27')]=function(_0x559f9c,_0x34f5ab){var _0xfae9ef={},_0x2d9c8c={},_0x13e611={'count':0x0,'rows':[]};var _0x2ad10a=_[_0x62b2('0x28')](db['SquareRecording'][_0x62b2('0x29')],function(_0x1864da){return{'name':_0x1864da[_0x62b2('0x2a')],'type':_0x1864da[_0x62b2('0x2b')]['key']};});_0x2d9c8c[_0x62b2('0x2c')]=_[_0x62b2('0x28')](_0x2ad10a,_0x62b2('0x26'));_0x2d9c8c[_0x62b2('0x2d')]=_[_0x62b2('0x2e')](_0x559f9c[_0x62b2('0x2d')]);_0x2d9c8c[_0x62b2('0x2f')]=_['intersection'](_0x2d9c8c[_0x62b2('0x2c')],_0x2d9c8c[_0x62b2('0x2d')]);_0xfae9ef[_0x62b2('0x30')]=_[_0x62b2('0x31')](_0x2d9c8c[_0x62b2('0x2c')],qs[_0x62b2('0x32')](_0x559f9c[_0x62b2('0x2d')][_0x62b2('0x32')]));_0xfae9ef[_0x62b2('0x30')]=_0xfae9ef[_0x62b2('0x30')][_0x62b2('0x33')]?_0xfae9ef[_0x62b2('0x30')]:_0x2d9c8c[_0x62b2('0x2c')];if(!_0x559f9c[_0x62b2('0x2d')][_0x62b2('0x34')]('nolimit')){_0xfae9ef['limit']=qs[_0x62b2('0x1c')](_0x559f9c[_0x62b2('0x2d')][_0x62b2('0x1c')]);_0xfae9ef['offset']=qs['offset'](_0x559f9c[_0x62b2('0x2d')][_0x62b2('0x1a')]);}_0xfae9ef[_0x62b2('0x35')]=qs[_0x62b2('0x36')](_0x559f9c[_0x62b2('0x2d')]['sort']);_0xfae9ef['where']=qs[_0x62b2('0x2f')](_['pick'](_0x559f9c['query'],_0x2d9c8c['filters']),_0x2ad10a);if(_0x559f9c['query'][_0x62b2('0x37')]){_0xfae9ef[_0x62b2('0x38')]=_['merge'](_0xfae9ef[_0x62b2('0x38')],{'$or':_['map'](_0x2ad10a,function(_0x40e378){if(_0x40e378[_0x62b2('0x2b')]!==_0x62b2('0x39')){var _0x58850b={};_0x58850b[_0x40e378[_0x62b2('0x26')]]={'$like':'%'+_0x559f9c[_0x62b2('0x2d')][_0x62b2('0x37')]+'%'};return _0x58850b;}})});}_0xfae9ef=_[_0x62b2('0x3a')]({},_0xfae9ef,_0x559f9c[_0x62b2('0x3b')]);var _0x23a2c4={'where':_0xfae9ef['where']};return db[_0x62b2('0x3c')]['count'](_0x23a2c4)[_0x62b2('0x24')](function(_0x261966){_0x13e611[_0x62b2('0x1d')]=_0x261966;if(_0x559f9c[_0x62b2('0x2d')]['includeAll']){_0xfae9ef['include']=[{'all':!![]}];}return db[_0x62b2('0x3c')][_0x62b2('0x3d')](_0xfae9ef);})[_0x62b2('0x24')](function(_0x5a8e15){_0x13e611[_0x62b2('0x3e')]=_0x5a8e15;return _0x13e611;})[_0x62b2('0x24')](respondWithFilteredResult(_0x34f5ab,_0xfae9ef))[_0x62b2('0x3f')](handleError(_0x34f5ab,null));};exports[_0x62b2('0x40')]=function(_0x1571dd,_0xb2934f){var _0x1cab64={'raw':!![],'where':{'id':_0x1571dd[_0x62b2('0x41')]['id']}},_0x4d5ba7={};_0x4d5ba7[_0x62b2('0x2c')]=_[_0x62b2('0x2e')](db[_0x62b2('0x3c')][_0x62b2('0x29')]);_0x4d5ba7[_0x62b2('0x2d')]=_[_0x62b2('0x2e')](_0x1571dd[_0x62b2('0x2d')]);_0x4d5ba7[_0x62b2('0x2f')]=_[_0x62b2('0x31')](_0x4d5ba7[_0x62b2('0x2c')],_0x4d5ba7[_0x62b2('0x2d')]);_0x1cab64[_0x62b2('0x30')]=_[_0x62b2('0x31')](_0x4d5ba7[_0x62b2('0x2c')],qs[_0x62b2('0x32')](_0x1571dd[_0x62b2('0x2d')]['fields']));_0x1cab64[_0x62b2('0x30')]=_0x1cab64[_0x62b2('0x30')][_0x62b2('0x33')]?_0x1cab64[_0x62b2('0x30')]:_0x4d5ba7['model'];if(_0x1571dd[_0x62b2('0x2d')][_0x62b2('0x42')]){_0x1cab64[_0x62b2('0x43')]=[{'all':!![]}];}_0x1cab64=_[_0x62b2('0x3a')]({},_0x1cab64,_0x1571dd['options']);return db['SquareRecording'][_0x62b2('0x44')](_0x1cab64)['then'](handleEntityNotFound(_0xb2934f,null))[_0x62b2('0x24')](respondWithResult(_0xb2934f,null))['catch'](handleError(_0xb2934f,null));};exports[_0x62b2('0x45')]=function(_0x3fa42d,_0x19f95c){return db['SquareRecording'][_0x62b2('0x45')](_0x3fa42d[_0x62b2('0x46')],{})['then'](respondWithResult(_0x19f95c,0xc9))[_0x62b2('0x3f')](handleError(_0x19f95c,null));};exports[_0x62b2('0x22')]=function(_0x5e0db7,_0x5850fe){if(_0x5e0db7[_0x62b2('0x46')]['id']){delete _0x5e0db7[_0x62b2('0x46')]['id'];}return db['SquareRecording']['find']({'where':{'id':_0x5e0db7[_0x62b2('0x41')]['id']}})[_0x62b2('0x24')](handleEntityNotFound(_0x5850fe,null))[_0x62b2('0x24')](saveUpdates(_0x5e0db7[_0x62b2('0x46')],null))[_0x62b2('0x24')](respondWithResult(_0x5850fe,null))[_0x62b2('0x3f')](handleError(_0x5850fe,null));};exports[_0x62b2('0x47')]=function(_0x585ff4,_0x1613e,_0x5cf2f5){var _0x26f323=require(_0x62b2('0x48'));var _0x52f3e1=![];var _0x5c217d={};if(_0x585ff4[_0x62b2('0x2d')][_0x62b2('0x2b')]&&_0x585ff4[_0x62b2('0x2d')][_0x62b2('0x2b')]==='uniqueid'){_0x5c217d[_0x62b2('0x49')]=_0x585ff4['params']['id'];}else{_0x5c217d['id']=_0x585ff4[_0x62b2('0x41')]['id'];}return db[_0x62b2('0x3c')]['find']({'where':_0x5c217d,'attributes':['id',_0x62b2('0x4a'),_0x62b2('0x4b')],'raw':!![]})[_0x62b2('0x24')](handleEntityNotFound(_0x1613e,null))['then'](function(_0x4749cc){if(_0x4749cc){var _0xb4ead8=_0x4749cc[_0x62b2('0x4a')];var _0x1813c6=util[_0x62b2('0x4c')](_0x62b2('0x4d'),_0xb4ead8);if(fs[_0x62b2('0x4e')](_0x1813c6)){_0x52f3e1=!![];return _0x26f323['decryptFile'](_0x1813c6,_0xb4ead8,config[_0x62b2('0x4f')][_0x62b2('0x50')])['then'](function(){return _0x4749cc;});}return _0x4749cc;}})[_0x62b2('0x24')](function(_0x23c851){if(_0x23c851){var _0x3960f5=_0x23c851['savePath'];if(!fs['existsSync'](_0x3960f5)){throw new db[(_0x62b2('0x51'))]['ValidationError']('SquareRecording\x20not\x20found');}if(_0x23c851[_0x62b2('0x4b')]){return _0x1613e[_0x62b2('0x47')](_0x3960f5,_0x23c851[_0x62b2('0x4b')]+path['extname'](_0x3960f5),function(){if(_0x52f3e1){fs[_0x62b2('0x52')](_0x3960f5);}});}else{return _0x1613e[_0x62b2('0x47')](_0x3960f5,function(_0x1606c5){if(_0x52f3e1){fs[_0x62b2('0x52')](_0x3960f5);}});}}})['catch'](function(_0x212bc6){if(_0x212bc6[_0x62b2('0x53')]===_0x62b2('0x54')){_0x1613e['status'](0x194)[_0x62b2('0x55')](_0x62b2('0x56'));}else{return handleError(_0x1613e,null);}});};exports[_0x62b2('0x23')]=function(_0x51a295,_0x48e563){return db[_0x62b2('0x3c')]['find']({'where':{'id':_0x51a295[_0x62b2('0x41')]['id']}})[_0x62b2('0x24')](function(_0xd23fc0){if(_['isNil'](_0xd23fc0)){throw new ReferenceError(_0x62b2('0x57'));}return _0xd23fc0;})[_0x62b2('0x24')](function(_0x5c1156){var _0x40f65b=_0x5c1156['savePath'];logger[_0x62b2('0x58')]('cancellazione\x20fisica\x20documento\x20%s',_0x40f65b);if(!_[_0x62b2('0x59')](_0x5c1156[_0x62b2('0x4a')])&&fs[_0x62b2('0x4e')](_0x40f65b)){logger[_0x62b2('0x58')](_0x62b2('0x5a')+_0x40f65b+_0x62b2('0x5b'));fs[_0x62b2('0x5c')](_0x40f65b);}_0x40f65b=_0x40f65b+'.cypher';if(!_['isNil'](_0x5c1156[_0x62b2('0x4a')])&&fs[_0x62b2('0x4e')](_0x40f65b)){logger[_0x62b2('0x58')]('File:\x20\x22'+_0x40f65b+_0x62b2('0x5b'));fs[_0x62b2('0x5c')](_0x40f65b);}return _0x5c1156;})[_0x62b2('0x24')](function(_0x3bebe9){if(!_0x3bebe9)throw new InternalError();return _0x3bebe9[_0x62b2('0x23')]();})[_0x62b2('0x24')](function(){_0x48e563[_0x62b2('0x17')](0xcc)[_0x62b2('0x18')]();})['catch'](handleError(_0x48e563,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index a6e1bf1..67f510e 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 _0x49fe=['request-promise','path','rimraf','../../config/environment','./squareRecording.attributes','exports','define','SquareRecording','square_recordings','lodash','moment','bluebird'];(function(_0x5e3836,_0x35936a){var _0x2a4f95=function(_0x25e5d7){while(--_0x25e5d7){_0x5e3836['push'](_0x5e3836['shift']());}};_0x2a4f95(++_0x35936a);}(_0x49fe,0x75));var _0xe49f=function(_0x5b0234,_0x130b37){_0x5b0234=_0x5b0234-0x0;var _0x4b7cdc=_0x49fe[_0x5b0234];return _0x4b7cdc;};'use strict';var _=require(_0xe49f('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xe49f('0x1'));var BPromise=require(_0xe49f('0x2'));var rp=require(_0xe49f('0x3'));var fs=require('fs');var path=require(_0xe49f('0x4'));var rimraf=require(_0xe49f('0x5'));var config=require(_0xe49f('0x6'));var attributes=require(_0xe49f('0x7'));module[_0xe49f('0x8')]=function(_0x3e984c,_0x2f3f9f){return _0x3e984c[_0xe49f('0x9')](_0xe49f('0xa'),attributes,{'tableName':_0xe49f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaf11=['exports','SquareRecording','square_recordings','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./squareRecording.attributes'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0xaf11,0x12f));var _0x1af1=function(_0x91531,_0x380933){_0x91531=_0x91531-0x0;var _0x4182fd=_0xaf11[_0x91531];return _0x4182fd;};'use strict';var _=require(_0x1af1('0x0'));var util=require(_0x1af1('0x1'));var logger=require(_0x1af1('0x2'))(_0x1af1('0x3'));var moment=require('moment');var BPromise=require(_0x1af1('0x4'));var rp=require(_0x1af1('0x5'));var fs=require('fs');var path=require(_0x1af1('0x6'));var rimraf=require('rimraf');var config=require(_0x1af1('0x7'));var attributes=require(_0x1af1('0x8'));module[_0x1af1('0x9')]=function(_0x4d3153,_0x36f1a0){return _0x4d3153['define'](_0x1af1('0xa'),attributes,{'tableName':_0x1af1('0xb'),'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 25c5395..89b6cca 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 _0x6961=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateSquareRecording','SquareRecording','create','options','raw','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x44bdfa,_0x37b5d5){var _0x815b1e=function(_0x2d835e){while(--_0x2d835e){_0x44bdfa['push'](_0x44bdfa['shift']());}};_0x815b1e(++_0x37b5d5);}(_0x6961,0x1ac));var _0x1696=function(_0x57ec0d,_0x4ff3ab){_0x57ec0d=_0x57ec0d-0x0;var _0x18546a=_0x6961[_0x57ec0d];return _0x18546a;};'use strict';var _=require(_0x1696('0x0'));var util=require(_0x1696('0x1'));var moment=require('moment');var BPromise=require(_0x1696('0x2'));var rs=require(_0x1696('0x3'));var fs=require('fs');var Redis=require(_0x1696('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1696('0x5'));var logger=require(_0x1696('0x6'))(_0x1696('0x7'));var config=require(_0x1696('0x8'));var jayson=require(_0x1696('0x9'));var client=jayson[_0x1696('0xa')][_0x1696('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2b3379,_0xd38379,_0xda958a){return new BPromise(function(_0x1111be,_0x28694f){return client[_0x1696('0xc')](_0x2b3379,_0xda958a)[_0x1696('0xd')](function(_0x142542){logger[_0x1696('0xe')](_0x1696('0xf'),_0xd38379,_0x1696('0x10'));logger[_0x1696('0x11')](_0x1696('0x12'),_0xd38379,_0x1696('0x10'),JSON[_0x1696('0x13')](_0x142542));if(_0x142542[_0x1696('0x14')]){if(_0x142542['error'][_0x1696('0x15')]===0x1f4){logger[_0x1696('0x14')](_0x1696('0xf'),_0xd38379,_0x142542['error']['message']);return _0x28694f(_0x142542[_0x1696('0x14')][_0x1696('0x16')]);}logger[_0x1696('0x14')](_0x1696('0xf'),_0xd38379,_0x142542['error'][_0x1696('0x16')]);return _0x1111be(_0x142542[_0x1696('0x14')][_0x1696('0x16')]);}else{logger[_0x1696('0xe')](_0x1696('0xf'),_0xd38379,_0x1696('0x10'));_0x1111be(_0x142542['result']['message']);}})[_0x1696('0x17')](function(_0x33fb8a){logger[_0x1696('0x14')](_0x1696('0xf'),_0xd38379,_0x33fb8a);_0x28694f(_0x33fb8a);});});}exports[_0x1696('0x18')]=function(_0xf2c825){var _0x4fd994=this;return new Promise(function(_0x3c88a7,_0x310c70){return db[_0x1696('0x19')][_0x1696('0x1a')](_0xf2c825['body'],{'raw':_0xf2c825[_0x1696('0x1b')]?_0xf2c825[_0x1696('0x1b')][_0x1696('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x401dd5){logger['info'](_0x1696('0x18'),_0xf2c825);logger[_0x1696('0x11')](_0x1696('0x18'),_0xf2c825,JSON['stringify'](_0x401dd5));_0x3c88a7(_0x401dd5);})[_0x1696('0x17')](function(_0x35fd66){logger['error']('CreateSquareRecording',_0x35fd66[_0x1696('0x16')],_0xf2c825);_0x310c70(_0x4fd994[_0x1696('0x14')](0x1f4,_0x35fd66['message']));});});}; \ No newline at end of file +var _0xca41=['SquareRecording','create','options','raw','info','debug','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','SquareRecording,\x20%s,\x20%s','SquareRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','CreateSquareRecording'];(function(_0x51ed8a,_0x5b7e46){var _0x12937e=function(_0x251c05){while(--_0x251c05){_0x51ed8a['push'](_0x51ed8a['shift']());}};_0x12937e(++_0x5b7e46);}(_0xca41,0x16f));var _0x1ca4=function(_0x194928,_0x2aa599){_0x194928=_0x194928-0x0;var _0x130bdd=_0xca41[_0x194928];return _0x130bdd;};'use strict';var _=require(_0x1ca4('0x0'));var util=require(_0x1ca4('0x1'));var moment=require(_0x1ca4('0x2'));var BPromise=require(_0x1ca4('0x3'));var rs=require(_0x1ca4('0x4'));var fs=require('fs');var Redis=require(_0x1ca4('0x5'));var db=require(_0x1ca4('0x6'))['db'];var utils=require(_0x1ca4('0x7'));var logger=require(_0x1ca4('0x8'))(_0x1ca4('0x9'));var config=require(_0x1ca4('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x1ca4('0xb')][_0x1ca4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5233e7,_0x18ca59,_0x3db118){return new BPromise(function(_0x5e26e8,_0x4a4cf0){return client[_0x1ca4('0xd')](_0x5233e7,_0x3db118)[_0x1ca4('0xe')](function(_0x4963bc){logger['info'](_0x1ca4('0xf'),_0x18ca59,'request\x20sent');logger['debug'](_0x1ca4('0x10'),_0x18ca59,_0x1ca4('0x11'),JSON[_0x1ca4('0x12')](_0x4963bc));if(_0x4963bc[_0x1ca4('0x13')]){if(_0x4963bc[_0x1ca4('0x13')][_0x1ca4('0x14')]===0x1f4){logger[_0x1ca4('0x13')](_0x1ca4('0xf'),_0x18ca59,_0x4963bc['error'][_0x1ca4('0x15')]);return _0x4a4cf0(_0x4963bc['error'][_0x1ca4('0x15')]);}logger[_0x1ca4('0x13')](_0x1ca4('0xf'),_0x18ca59,_0x4963bc[_0x1ca4('0x13')]['message']);return _0x5e26e8(_0x4963bc[_0x1ca4('0x13')][_0x1ca4('0x15')]);}else{logger['info']('SquareRecording,\x20%s,\x20%s',_0x18ca59,_0x1ca4('0x11'));_0x5e26e8(_0x4963bc['result'][_0x1ca4('0x15')]);}})['catch'](function(_0x24ecea){logger['error']('SquareRecording,\x20%s,\x20%s',_0x18ca59,_0x24ecea);_0x4a4cf0(_0x24ecea);});});}exports[_0x1ca4('0x16')]=function(_0x2431e6){var _0xbed041=this;return new Promise(function(_0x1aceb4,_0x5d4ac8){return db[_0x1ca4('0x17')][_0x1ca4('0x18')](_0x2431e6['body'],{'raw':_0x2431e6[_0x1ca4('0x19')]?_0x2431e6[_0x1ca4('0x19')][_0x1ca4('0x1a')]===undefined?!![]:![]:!![]})[_0x1ca4('0xe')](function(_0x1b651b){logger[_0x1ca4('0x1b')]('CreateSquareRecording',_0x2431e6);logger[_0x1ca4('0x1c')](_0x1ca4('0x16'),_0x2431e6,JSON[_0x1ca4('0x12')](_0x1b651b));_0x1aceb4(_0x1b651b);})[_0x1ca4('0x1d')](function(_0x107420){logger[_0x1ca4('0x13')]('CreateSquareRecording',_0x107420[_0x1ca4('0x15')],_0x2431e6);_0x5d4ac8(_0xbed041[_0x1ca4('0x13')](0x1f4,_0x107420[_0x1ca4('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index ddade90..16fb5d7 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 _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0xf466fc,_0xe6b550){var _0x1e6330=function(_0x3ccf87){while(--_0x3ccf87){_0xf466fc['push'](_0xf466fc['shift']());}};_0x1e6330(++_0xe6b550);}(_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'));var controller=require('./squareReport.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('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','./squareReport.controller','get','index','/describe','show','post'];(function(_0x2cc569,_0x4e9568){var _0x1bfc2e=function(_0x5b8fcb){while(--_0x5b8fcb){_0x2cc569['push'](_0x2cc569['shift']());}};_0x1bfc2e(++_0x4e9568);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'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/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 1cab6a6..60b552d 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 _0xb56b=['DATE','BOOLEAN','exports','STRING'];(function(_0x2aeceb,_0x37d3d9){var _0x482ee0=function(_0x18f464){while(--_0x18f464){_0x2aeceb['push'](_0x2aeceb['shift']());}};_0x482ee0(++_0x37d3d9);}(_0xb56b,0x162));var _0xbb56=function(_0x11b19b,_0x213234){_0x11b19b=_0x11b19b-0x0;var _0x1daac1=_0xb56b[_0x11b19b];return _0x1daac1;};'use strict';var Sequelize=require('sequelize');module[_0xbb56('0x0')]={'network':{'type':Sequelize[_0xbb56('0x1')]},'network_script':{'type':Sequelize[_0xbb56('0x1')]},'request':{'type':Sequelize[_0xbb56('0x1')]},'channel':{'type':Sequelize[_0xbb56('0x1')]},'language':{'type':Sequelize[_0xbb56('0x1')]},'type':{'type':Sequelize[_0xbb56('0x1')]},'uniqueid':{'type':Sequelize[_0xbb56('0x1')]},'version':{'type':Sequelize[_0xbb56('0x1')]},'callerid':{'type':Sequelize[_0xbb56('0x1')]},'calleridname':{'type':Sequelize[_0xbb56('0x1')]},'callingpres':{'type':Sequelize[_0xbb56('0x1')]},'callingani2':{'type':Sequelize[_0xbb56('0x1')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0xbb56('0x1')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xbb56('0x1')]},'extension':{'type':Sequelize[_0xbb56('0x1')]},'priority':{'type':Sequelize[_0xbb56('0x1')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xbb56('0x1')]},'threadid':{'type':Sequelize[_0xbb56('0x1')]},'project_name':{'type':Sequelize[_0xbb56('0x1')]},'joinAt':{'type':Sequelize[_0xbb56('0x2')]},'leaveAt':{'type':Sequelize[_0xbb56('0x2')]},'bot':{'type':Sequelize[_0xbb56('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x5142=['sequelize','exports','STRING','DATE'];(function(_0x3b84e4,_0x152009){var _0xa33476=function(_0x1cbe1d){while(--_0x1cbe1d){_0x3b84e4['push'](_0x3b84e4['shift']());}};_0xa33476(++_0x152009);}(_0x5142,0xf8));var _0x2514=function(_0x1fa4f3,_0x18916e){_0x1fa4f3=_0x1fa4f3-0x0;var _0x454a18=_0x5142[_0x1fa4f3];return _0x454a18;};'use strict';var Sequelize=require(_0x2514('0x0'));module[_0x2514('0x1')]={'network':{'type':Sequelize[_0x2514('0x2')]},'network_script':{'type':Sequelize[_0x2514('0x2')]},'request':{'type':Sequelize[_0x2514('0x2')]},'channel':{'type':Sequelize[_0x2514('0x2')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x2514('0x2')]},'uniqueid':{'type':Sequelize[_0x2514('0x2')]},'version':{'type':Sequelize[_0x2514('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x2514('0x2')]},'callingpres':{'type':Sequelize[_0x2514('0x2')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0x2514('0x2')]},'dnid':{'type':Sequelize[_0x2514('0x2')]},'rdnis':{'type':Sequelize[_0x2514('0x2')]},'context':{'type':Sequelize[_0x2514('0x2')]},'extension':{'type':Sequelize[_0x2514('0x2')]},'priority':{'type':Sequelize[_0x2514('0x2')]},'enhanced':{'type':Sequelize[_0x2514('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x2514('0x2')]},'project_name':{'type':Sequelize[_0x2514('0x2')]},'joinAt':{'type':Sequelize[_0x2514('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'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 8d8bcd4..9905bf3 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 _0xc952=['error','stack','name','send','index','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','type','VIRTUAL','options','SquareReport','includeAll','include','findAll','catch','show','fields','find','create','body','destroy','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','save','update','then'];(function(_0x3698d7,_0x6cb88f){var _0x206163=function(_0x13e2ec){while(--_0x13e2ec){_0x3698d7['push'](_0x3698d7['shift']());}};_0x206163(++_0x6cb88f);}(_0xc952,0xba));var _0x2c95=function(_0x46ac5a,_0x221114){_0x46ac5a=_0x46ac5a-0x0;var _0xdadc0e=_0xc952[_0x46ac5a];return _0xdadc0e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2c95('0x0'));var zipdir=require(_0x2c95('0x1'));var jsonpatch=require(_0x2c95('0x2'));var rp=require('request-promise');var moment=require(_0x2c95('0x3'));var BPromise=require(_0x2c95('0x4'));var Mustache=require(_0x2c95('0x5'));var util=require(_0x2c95('0x6'));var path=require(_0x2c95('0x7'));var sox=require(_0x2c95('0x8'));var csv=require(_0x2c95('0x9'));var ejs=require(_0x2c95('0xa'));var fs=require('fs');var fs_extra=require(_0x2c95('0xb'));var _=require('lodash');var squel=require(_0x2c95('0xc'));var crypto=require(_0x2c95('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2c95('0xe'));var toCsv=require(_0x2c95('0x9'));var querystring=require(_0x2c95('0xf'));var Papa=require(_0x2c95('0x10'));var Redis=require(_0x2c95('0x11'));var authService=require(_0x2c95('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2c95('0x13'));var hardwareService=require(_0x2c95('0x14'));var logger=require('../../config/logger')(_0x2c95('0x15'));var utils=require(_0x2c95('0x16'));var config=require(_0x2c95('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3f0947,_0x38d907){_0x38d907=_0x38d907||0xcc;return function(_0x16d8e8){if(_0x16d8e8){return _0x3f0947[_0x2c95('0x18')](_0x38d907);}return _0x3f0947['status'](_0x38d907)[_0x2c95('0x19')]();};}function respondWithResult(_0x284398,_0x5c6c7a){_0x5c6c7a=_0x5c6c7a||0xc8;return function(_0x301f24){if(_0x301f24){return _0x284398[_0x2c95('0x1a')](_0x5c6c7a)[_0x2c95('0x1b')](_0x301f24);}};}function respondWithFilteredResult(_0x237b60,_0xccad89){return function(_0x48b074){if(_0x48b074){var _0x119331=typeof _0xccad89[_0x2c95('0x1c')]===_0x2c95('0x1d')&&typeof _0xccad89['limit']===_0x2c95('0x1d');var _0x43be62=_0x48b074[_0x2c95('0x1e')];var _0x359c37=_0x119331?0x0:_0xccad89['offset'];var _0x248829=_0x119331?_0x48b074[_0x2c95('0x1e')]:_0xccad89['offset']+_0xccad89[_0x2c95('0x1f')];var _0x26dd4c;if(_0x248829>=_0x43be62){_0x248829=_0x43be62;_0x26dd4c=0xc8;}else{_0x26dd4c=0xce;}_0x237b60[_0x2c95('0x1a')](_0x26dd4c);return _0x237b60['set'](_0x2c95('0x20'),_0x359c37+'-'+_0x248829+'/'+_0x43be62)[_0x2c95('0x1b')](_0x48b074);}return null;};}function patchUpdates(_0x1ca452){return function(_0x41c1e1){try{jsonpatch['apply'](_0x41c1e1,_0x1ca452,!![]);}catch(_0x5dfe51){return BPromise['reject'](_0x5dfe51);}return _0x41c1e1[_0x2c95('0x21')]();};}function saveUpdates(_0x560ade,_0x8a15e8){return function(_0x48a22c){if(_0x48a22c){return _0x48a22c[_0x2c95('0x22')](_0x560ade)[_0x2c95('0x23')](function(_0x1c581e){return _0x1c581e;});}return null;};}function removeEntity(_0x4639a3,_0x53bfba){return function(_0x16e6cb){if(_0x16e6cb){return _0x16e6cb['destroy']()[_0x2c95('0x23')](function(){_0x4639a3[_0x2c95('0x1a')](0xcc)[_0x2c95('0x19')]();});}};}function handleEntityNotFound(_0x3d6d69,_0x1dec78){return function(_0x40bbda){if(!_0x40bbda){_0x3d6d69[_0x2c95('0x18')](0x194);}return _0x40bbda;};}function handleError(_0x407c07,_0x51d383){_0x51d383=_0x51d383||0x1f4;return function(_0x2f497a){logger[_0x2c95('0x24')](_0x2f497a[_0x2c95('0x25')]);if(_0x2f497a[_0x2c95('0x26')]){delete _0x2f497a[_0x2c95('0x26')];}_0x407c07[_0x2c95('0x1a')](_0x51d383)[_0x2c95('0x27')](_0x2f497a);};}exports[_0x2c95('0x28')]=function(_0x3f96cb,_0x422fb9){var _0x3a9497={},_0x3a9d67={},_0xcb7e97={'count':0x0,'rows':[]};var _0x24468b=_['map'](db['SquareReport'][_0x2c95('0x29')],function(_0xfc071b){return{'name':_0xfc071b[_0x2c95('0x2a')],'type':_0xfc071b['type'][_0x2c95('0x2b')]};});_0x3a9d67[_0x2c95('0x2c')]=_[_0x2c95('0x2d')](_0x24468b,'name');_0x3a9d67[_0x2c95('0x2e')]=_[_0x2c95('0x2f')](_0x3f96cb['query']);_0x3a9d67[_0x2c95('0x30')]=_[_0x2c95('0x31')](_0x3a9d67[_0x2c95('0x2c')],_0x3a9d67[_0x2c95('0x2e')]);_0x3a9497[_0x2c95('0x32')]=_[_0x2c95('0x31')](_0x3a9d67['model'],qs['fields'](_0x3f96cb[_0x2c95('0x2e')]['fields']));_0x3a9497[_0x2c95('0x32')]=_0x3a9497[_0x2c95('0x32')][_0x2c95('0x33')]?_0x3a9497[_0x2c95('0x32')]:_0x3a9d67['model'];if(!_0x3f96cb[_0x2c95('0x2e')][_0x2c95('0x34')](_0x2c95('0x35'))){_0x3a9497[_0x2c95('0x1f')]=qs[_0x2c95('0x1f')](_0x3f96cb[_0x2c95('0x2e')][_0x2c95('0x1f')]);_0x3a9497[_0x2c95('0x1c')]=qs['offset'](_0x3f96cb[_0x2c95('0x2e')][_0x2c95('0x1c')]);}_0x3a9497['order']=qs[_0x2c95('0x36')](_0x3f96cb[_0x2c95('0x2e')][_0x2c95('0x36')]);_0x3a9497['where']=qs[_0x2c95('0x30')](_[_0x2c95('0x37')](_0x3f96cb[_0x2c95('0x2e')],_0x3a9d67[_0x2c95('0x30')]),_0x24468b);if(_0x3f96cb[_0x2c95('0x2e')][_0x2c95('0x38')]){_0x3a9497[_0x2c95('0x39')]=_[_0x2c95('0x3a')](_0x3a9497[_0x2c95('0x39')],{'$or':_[_0x2c95('0x2d')](_0x24468b,function(_0x3f951e){if(_0x3f951e[_0x2c95('0x3b')]!==_0x2c95('0x3c')){var _0x477d3b={};_0x477d3b[_0x3f951e[_0x2c95('0x26')]]={'$like':'%'+_0x3f96cb[_0x2c95('0x2e')][_0x2c95('0x38')]+'%'};return _0x477d3b;}})});}_0x3a9497=_[_0x2c95('0x3a')]({},_0x3a9497,_0x3f96cb[_0x2c95('0x3d')]);var _0x4cc9b4={'where':_0x3a9497[_0x2c95('0x39')]};return db[_0x2c95('0x3e')][_0x2c95('0x1e')](_0x4cc9b4)[_0x2c95('0x23')](function(_0x3eeaf2){_0xcb7e97[_0x2c95('0x1e')]=_0x3eeaf2;if(_0x3f96cb[_0x2c95('0x2e')][_0x2c95('0x3f')]){_0x3a9497[_0x2c95('0x40')]=[{'all':!![]}];}return db[_0x2c95('0x3e')][_0x2c95('0x41')](_0x3a9497);})['then'](function(_0x836d76){_0xcb7e97['rows']=_0x836d76;return _0xcb7e97;})['then'](respondWithFilteredResult(_0x422fb9,_0x3a9497))[_0x2c95('0x42')](handleError(_0x422fb9,null));};exports[_0x2c95('0x43')]=function(_0x3298c0,_0x522147){var _0xa2e1c9={'raw':!![],'where':{'id':_0x3298c0['params']['id']}},_0x39ce38={};_0x39ce38[_0x2c95('0x2c')]=_['keys'](db[_0x2c95('0x3e')][_0x2c95('0x29')]);_0x39ce38['query']=_[_0x2c95('0x2f')](_0x3298c0[_0x2c95('0x2e')]);_0x39ce38[_0x2c95('0x30')]=_[_0x2c95('0x31')](_0x39ce38[_0x2c95('0x2c')],_0x39ce38[_0x2c95('0x2e')]);_0xa2e1c9[_0x2c95('0x32')]=_[_0x2c95('0x31')](_0x39ce38[_0x2c95('0x2c')],qs[_0x2c95('0x44')](_0x3298c0[_0x2c95('0x2e')][_0x2c95('0x44')]));_0xa2e1c9[_0x2c95('0x32')]=_0xa2e1c9[_0x2c95('0x32')][_0x2c95('0x33')]?_0xa2e1c9[_0x2c95('0x32')]:_0x39ce38[_0x2c95('0x2c')];if(_0x3298c0[_0x2c95('0x2e')]['includeAll']){_0xa2e1c9[_0x2c95('0x40')]=[{'all':!![]}];}_0xa2e1c9=_['merge']({},_0xa2e1c9,_0x3298c0[_0x2c95('0x3d')]);return db[_0x2c95('0x3e')][_0x2c95('0x45')](_0xa2e1c9)[_0x2c95('0x23')](handleEntityNotFound(_0x522147,null))[_0x2c95('0x23')](respondWithResult(_0x522147,null))[_0x2c95('0x42')](handleError(_0x522147,null));};exports[_0x2c95('0x46')]=function(_0x5b9724,_0x69c596){return db[_0x2c95('0x3e')][_0x2c95('0x46')](_0x5b9724['body'],{})[_0x2c95('0x23')](respondWithResult(_0x69c596,0xc9))[_0x2c95('0x42')](handleError(_0x69c596,null));};exports[_0x2c95('0x22')]=function(_0x348709,_0x181048){if(_0x348709[_0x2c95('0x47')]['id']){delete _0x348709[_0x2c95('0x47')]['id'];}return db[_0x2c95('0x3e')][_0x2c95('0x45')]({'where':{'id':_0x348709['params']['id']}})[_0x2c95('0x23')](handleEntityNotFound(_0x181048,null))[_0x2c95('0x23')](saveUpdates(_0x348709[_0x2c95('0x47')],null))[_0x2c95('0x23')](respondWithResult(_0x181048,null))[_0x2c95('0x42')](handleError(_0x181048,null));};exports[_0x2c95('0x48')]=function(_0x1843c5,_0x22e12a){return db[_0x2c95('0x3e')][_0x2c95('0x45')]({'where':{'id':_0x1843c5['params']['id']}})[_0x2c95('0x23')](handleEntityNotFound(_0x22e12a,null))['then'](removeEntity(_0x22e12a,null))[_0x2c95('0x42')](handleError(_0x22e12a,null));};exports[_0x2c95('0x49')]=function(_0x452846,_0xb3ec71){return db[_0x2c95('0x3e')][_0x2c95('0x49')]()[_0x2c95('0x23')](respondWithResult(_0xb3ec71,null))[_0x2c95('0x42')](handleError(_0xb3ec71,null));}; \ No newline at end of file +var _0x9bdf=['api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','save','then','error','stack','name','send','key','model','map','keys','query','fields','length','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','SquareReport','includeAll','findAll','rows','catch','show','rawAttributes','intersection','include','find','create','body','update','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x24a26b,_0x49c278){var _0x3ebfd0=function(_0x2f1f9c){while(--_0x2f1f9c){_0x24a26b['push'](_0x24a26b['shift']());}};_0x3ebfd0(++_0x49c278);}(_0x9bdf,0x81));var _0xf9bd=function(_0x296cad,_0x294cf6){_0x296cad=_0x296cad-0x0;var _0x2e6a27=_0x9bdf[_0x296cad];return _0x2e6a27;};'use strict';var emlformat=require(_0xf9bd('0x0'));var rimraf=require(_0xf9bd('0x1'));var zipdir=require(_0xf9bd('0x2'));var jsonpatch=require(_0xf9bd('0x3'));var rp=require(_0xf9bd('0x4'));var moment=require(_0xf9bd('0x5'));var BPromise=require(_0xf9bd('0x6'));var Mustache=require(_0xf9bd('0x7'));var util=require(_0xf9bd('0x8'));var path=require(_0xf9bd('0x9'));var sox=require('sox');var csv=require(_0xf9bd('0xa'));var ejs=require(_0xf9bd('0xb'));var fs=require('fs');var fs_extra=require(_0xf9bd('0xc'));var _=require('lodash');var squel=require(_0xf9bd('0xd'));var crypto=require(_0xf9bd('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xf9bd('0xf'));var toCsv=require('to-csv');var querystring=require(_0xf9bd('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf9bd('0x11'));var qs=require(_0xf9bd('0x12'));var as=require(_0xf9bd('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf9bd('0x14'))(_0xf9bd('0x15'));var utils=require(_0xf9bd('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xf9bd('0x17'));var db=require(_0xf9bd('0x18'))['db'];function respondWithStatusCode(_0x2ab471,_0x120046){_0x120046=_0x120046||0xcc;return function(_0x525fbc){if(_0x525fbc){return _0x2ab471[_0xf9bd('0x19')](_0x120046);}return _0x2ab471[_0xf9bd('0x1a')](_0x120046)['end']();};}function respondWithResult(_0x7cc498,_0x3c1216){_0x3c1216=_0x3c1216||0xc8;return function(_0xb89c2){if(_0xb89c2){return _0x7cc498[_0xf9bd('0x1a')](_0x3c1216)['json'](_0xb89c2);}};}function respondWithFilteredResult(_0x222ced,_0x46ca9f){return function(_0x174fe9){if(_0x174fe9){var _0x12d15b=typeof _0x46ca9f[_0xf9bd('0x1b')]===_0xf9bd('0x1c')&&typeof _0x46ca9f[_0xf9bd('0x1d')]===_0xf9bd('0x1c');var _0x1bd794=_0x174fe9[_0xf9bd('0x1e')];var _0x1de760=_0x12d15b?0x0:_0x46ca9f[_0xf9bd('0x1b')];var _0x2f2ed7=_0x12d15b?_0x174fe9['count']:_0x46ca9f[_0xf9bd('0x1b')]+_0x46ca9f[_0xf9bd('0x1d')];var _0x11a3ba;if(_0x2f2ed7>=_0x1bd794){_0x2f2ed7=_0x1bd794;_0x11a3ba=0xc8;}else{_0x11a3ba=0xce;}_0x222ced[_0xf9bd('0x1a')](_0x11a3ba);return _0x222ced[_0xf9bd('0x1f')](_0xf9bd('0x20'),_0x1de760+'-'+_0x2f2ed7+'/'+_0x1bd794)['json'](_0x174fe9);}return null;};}function patchUpdates(_0x26e46c){return function(_0x271007){try{jsonpatch[_0xf9bd('0x21')](_0x271007,_0x26e46c,!![]);}catch(_0xf45d3b){return BPromise['reject'](_0xf45d3b);}return _0x271007[_0xf9bd('0x22')]();};}function saveUpdates(_0xd0a40f,_0x41e7c8){return function(_0x24a60d){if(_0x24a60d){return _0x24a60d['update'](_0xd0a40f)[_0xf9bd('0x23')](function(_0x4f1ada){return _0x4f1ada;});}return null;};}function removeEntity(_0x1d6c40,_0x351f01){return function(_0x523111){if(_0x523111){return _0x523111['destroy']()[_0xf9bd('0x23')](function(){_0x1d6c40['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x31725c,_0x1baa2c){return function(_0x2773b7){if(!_0x2773b7){_0x31725c[_0xf9bd('0x19')](0x194);}return _0x2773b7;};}function handleError(_0x1c88fb,_0x1bd5e9){_0x1bd5e9=_0x1bd5e9||0x1f4;return function(_0x56b6b0){logger[_0xf9bd('0x24')](_0x56b6b0[_0xf9bd('0x25')]);if(_0x56b6b0[_0xf9bd('0x26')]){delete _0x56b6b0[_0xf9bd('0x26')];}_0x1c88fb['status'](_0x1bd5e9)[_0xf9bd('0x27')](_0x56b6b0);};}exports['index']=function(_0x169f17,_0x191843){var _0x756273={},_0x4437df={},_0x4edea8={'count':0x0,'rows':[]};var _0x513cb4=_['map'](db['SquareReport']['rawAttributes'],function(_0xfba10b){return{'name':_0xfba10b['fieldName'],'type':_0xfba10b['type'][_0xf9bd('0x28')]};});_0x4437df[_0xf9bd('0x29')]=_[_0xf9bd('0x2a')](_0x513cb4,_0xf9bd('0x26'));_0x4437df['query']=_[_0xf9bd('0x2b')](_0x169f17[_0xf9bd('0x2c')]);_0x4437df['filters']=_['intersection'](_0x4437df[_0xf9bd('0x29')],_0x4437df[_0xf9bd('0x2c')]);_0x756273['attributes']=_['intersection'](_0x4437df['model'],qs[_0xf9bd('0x2d')](_0x169f17[_0xf9bd('0x2c')][_0xf9bd('0x2d')]));_0x756273['attributes']=_0x756273['attributes'][_0xf9bd('0x2e')]?_0x756273[_0xf9bd('0x2f')]:_0x4437df[_0xf9bd('0x29')];if(!_0x169f17['query'][_0xf9bd('0x30')](_0xf9bd('0x31'))){_0x756273[_0xf9bd('0x1d')]=qs['limit'](_0x169f17[_0xf9bd('0x2c')][_0xf9bd('0x1d')]);_0x756273[_0xf9bd('0x1b')]=qs['offset'](_0x169f17[_0xf9bd('0x2c')][_0xf9bd('0x1b')]);}_0x756273['order']=qs[_0xf9bd('0x32')](_0x169f17[_0xf9bd('0x2c')][_0xf9bd('0x32')]);_0x756273[_0xf9bd('0x33')]=qs[_0xf9bd('0x34')](_[_0xf9bd('0x35')](_0x169f17[_0xf9bd('0x2c')],_0x4437df[_0xf9bd('0x34')]),_0x513cb4);if(_0x169f17[_0xf9bd('0x2c')][_0xf9bd('0x36')]){_0x756273['where']=_[_0xf9bd('0x37')](_0x756273['where'],{'$or':_[_0xf9bd('0x2a')](_0x513cb4,function(_0x26f9f7){if(_0x26f9f7[_0xf9bd('0x38')]!==_0xf9bd('0x39')){var _0x2cbdd8={};_0x2cbdd8[_0x26f9f7[_0xf9bd('0x26')]]={'$like':'%'+_0x169f17[_0xf9bd('0x2c')][_0xf9bd('0x36')]+'%'};return _0x2cbdd8;}})});}_0x756273=_[_0xf9bd('0x37')]({},_0x756273,_0x169f17[_0xf9bd('0x3a')]);var _0x16a690={'where':_0x756273[_0xf9bd('0x33')]};return db[_0xf9bd('0x3b')][_0xf9bd('0x1e')](_0x16a690)[_0xf9bd('0x23')](function(_0x4bc516){_0x4edea8[_0xf9bd('0x1e')]=_0x4bc516;if(_0x169f17[_0xf9bd('0x2c')][_0xf9bd('0x3c')]){_0x756273['include']=[{'all':!![]}];}return db[_0xf9bd('0x3b')][_0xf9bd('0x3d')](_0x756273);})['then'](function(_0x38f869){_0x4edea8[_0xf9bd('0x3e')]=_0x38f869;return _0x4edea8;})[_0xf9bd('0x23')](respondWithFilteredResult(_0x191843,_0x756273))[_0xf9bd('0x3f')](handleError(_0x191843,null));};exports[_0xf9bd('0x40')]=function(_0x370070,_0x2ada6a){var _0x347cdc={'raw':!![],'where':{'id':_0x370070['params']['id']}},_0x4267d6={};_0x4267d6[_0xf9bd('0x29')]=_['keys'](db[_0xf9bd('0x3b')][_0xf9bd('0x41')]);_0x4267d6[_0xf9bd('0x2c')]=_[_0xf9bd('0x2b')](_0x370070[_0xf9bd('0x2c')]);_0x4267d6['filters']=_['intersection'](_0x4267d6[_0xf9bd('0x29')],_0x4267d6[_0xf9bd('0x2c')]);_0x347cdc[_0xf9bd('0x2f')]=_[_0xf9bd('0x42')](_0x4267d6[_0xf9bd('0x29')],qs['fields'](_0x370070[_0xf9bd('0x2c')][_0xf9bd('0x2d')]));_0x347cdc['attributes']=_0x347cdc[_0xf9bd('0x2f')][_0xf9bd('0x2e')]?_0x347cdc[_0xf9bd('0x2f')]:_0x4267d6['model'];if(_0x370070['query'][_0xf9bd('0x3c')]){_0x347cdc[_0xf9bd('0x43')]=[{'all':!![]}];}_0x347cdc=_['merge']({},_0x347cdc,_0x370070[_0xf9bd('0x3a')]);return db[_0xf9bd('0x3b')][_0xf9bd('0x44')](_0x347cdc)[_0xf9bd('0x23')](handleEntityNotFound(_0x2ada6a,null))[_0xf9bd('0x23')](respondWithResult(_0x2ada6a,null))[_0xf9bd('0x3f')](handleError(_0x2ada6a,null));};exports[_0xf9bd('0x45')]=function(_0x219f3f,_0x12de4b){return db[_0xf9bd('0x3b')][_0xf9bd('0x45')](_0x219f3f[_0xf9bd('0x46')],{})[_0xf9bd('0x23')](respondWithResult(_0x12de4b,0xc9))[_0xf9bd('0x3f')](handleError(_0x12de4b,null));};exports[_0xf9bd('0x47')]=function(_0x4682d8,_0x196164){if(_0x4682d8[_0xf9bd('0x46')]['id']){delete _0x4682d8[_0xf9bd('0x46')]['id'];}return db['SquareReport'][_0xf9bd('0x44')]({'where':{'id':_0x4682d8[_0xf9bd('0x48')]['id']}})['then'](handleEntityNotFound(_0x196164,null))['then'](saveUpdates(_0x4682d8[_0xf9bd('0x46')],null))['then'](respondWithResult(_0x196164,null))[_0xf9bd('0x3f')](handleError(_0x196164,null));};exports[_0xf9bd('0x49')]=function(_0x15060e,_0x2e8f0b){return db[_0xf9bd('0x3b')]['find']({'where':{'id':_0x15060e[_0xf9bd('0x48')]['id']}})[_0xf9bd('0x23')](handleEntityNotFound(_0x2e8f0b,null))[_0xf9bd('0x23')](removeEntity(_0x2e8f0b,null))[_0xf9bd('0x3f')](handleError(_0x2e8f0b,null));};exports[_0xf9bd('0x4a')]=function(_0x1e4341,_0x2a4787){return db[_0xf9bd('0x3b')][_0xf9bd('0x4a')]()[_0xf9bd('0x23')](respondWithResult(_0x2a4787,null))[_0xf9bd('0x3f')](handleError(_0x2a4787,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index ec9a81c..d8af19b 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 _0x884c=['SquareReport','report_square','leaveAt','lodash','util','api','bluebird','path','rimraf','../../config/environment','./squareReport.attributes','exports','define'];(function(_0xb3fe4b,_0x1bde5c){var _0x42027f=function(_0x25edf5){while(--_0x25edf5){_0xb3fe4b['push'](_0xb3fe4b['shift']());}};_0x42027f(++_0x1bde5c);}(_0x884c,0xe0));var _0xc884=function(_0x232a6c,_0x22572e){_0x232a6c=_0x232a6c-0x0;var _0x17cf55=_0x884c[_0x232a6c];return _0x17cf55;};'use strict';var _=require(_0xc884('0x0'));var util=require(_0xc884('0x1'));var logger=require('../../config/logger')(_0xc884('0x2'));var moment=require('moment');var BPromise=require(_0xc884('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc884('0x4'));var rimraf=require(_0xc884('0x5'));var config=require(_0xc884('0x6'));var attributes=require(_0xc884('0x7'));module[_0xc884('0x8')]=function(_0x546b19,_0x5e3971){return _0x546b19[_0xc884('0x9')](_0xc884('0xa'),attributes,{'tableName':_0xc884('0xb'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':['uniqueid','project_name']},{'name':_0xc884('0xc'),'fields':[_0xc884('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x69b3=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports','define','SquareReport','uid_pname','project_name','leaveAt','lodash'];(function(_0x24786b,_0xa2e3f4){var _0x367423=function(_0x4addb2){while(--_0x4addb2){_0x24786b['push'](_0x24786b['shift']());}};_0x367423(++_0xa2e3f4);}(_0x69b3,0xcf));var _0x369b=function(_0x3be16f,_0x388d26){_0x3be16f=_0x3be16f-0x0;var _0xb88ad6=_0x69b3[_0x3be16f];return _0xb88ad6;};'use strict';var _=require(_0x369b('0x0'));var util=require(_0x369b('0x1'));var logger=require('../../config/logger')(_0x369b('0x2'));var moment=require(_0x369b('0x3'));var BPromise=require(_0x369b('0x4'));var rp=require(_0x369b('0x5'));var fs=require('fs');var path=require(_0x369b('0x6'));var rimraf=require(_0x369b('0x7'));var config=require(_0x369b('0x8'));var attributes=require(_0x369b('0x9'));module[_0x369b('0xa')]=function(_0x5e7ff0,_0x5ea912){return _0x5e7ff0[_0x369b('0xb')](_0x369b('0xc'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x369b('0xd'),'fields':['uniqueid',_0x369b('0xe')]},{'name':_0x369b('0xf'),'fields':[_0x369b('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 53701d5..9edfecf 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 _0x8542=['raw','then','CreateSquareReport','UpdateSquareReport','update','where','attributes','stringify','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','code','error','message','catch','SquareReport','create','body','options'];(function(_0x2c753c,_0x3378e7){var _0x23ba20=function(_0xac82d){while(--_0xac82d){_0x2c753c['push'](_0x2c753c['shift']());}};_0x23ba20(++_0x3378e7);}(_0x8542,0x1e4));var _0x2854=function(_0x4d6571,_0x9b8870){_0x4d6571=_0x4d6571-0x0;var _0x848560=_0x8542[_0x4d6571];return _0x848560;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2854('0x0'));var BPromise=require(_0x2854('0x1'));var rs=require(_0x2854('0x2'));var fs=require('fs');var Redis=require(_0x2854('0x3'));var db=require(_0x2854('0x4'))['db'];var utils=require(_0x2854('0x5'));var logger=require(_0x2854('0x6'))(_0x2854('0x7'));var config=require(_0x2854('0x8'));var jayson=require(_0x2854('0x9'));var client=jayson[_0x2854('0xa')][_0x2854('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d5954,_0x7001b0,_0x1a1efb){return new BPromise(function(_0x49239a,_0x3508b2){return client[_0x2854('0xc')](_0x5d5954,_0x1a1efb)['then'](function(_0x8ecc51){logger[_0x2854('0xd')](_0x2854('0xe'),_0x7001b0,_0x2854('0xf'));logger[_0x2854('0x10')](_0x2854('0x11'),_0x7001b0,'request\x20sent',JSON['stringify'](_0x8ecc51));if(_0x8ecc51['error']){if(_0x8ecc51['error'][_0x2854('0x12')]===0x1f4){logger[_0x2854('0x13')]('SquareReport,\x20%s,\x20%s',_0x7001b0,_0x8ecc51['error'][_0x2854('0x14')]);return _0x3508b2(_0x8ecc51[_0x2854('0x13')][_0x2854('0x14')]);}logger[_0x2854('0x13')]('SquareReport,\x20%s,\x20%s',_0x7001b0,_0x8ecc51[_0x2854('0x13')][_0x2854('0x14')]);return _0x49239a(_0x8ecc51['error'][_0x2854('0x14')]);}else{logger[_0x2854('0xd')](_0x2854('0xe'),_0x7001b0,_0x2854('0xf'));_0x49239a(_0x8ecc51['result'][_0x2854('0x14')]);}})[_0x2854('0x15')](function(_0x17bdbc){logger[_0x2854('0x13')]('SquareReport,\x20%s,\x20%s',_0x7001b0,_0x17bdbc);_0x3508b2(_0x17bdbc);});});}exports['CreateSquareReport']=function(_0x1ef8f9){var _0x5f2109=this;return new Promise(function(_0x553fd8,_0x255de8){return db[_0x2854('0x16')][_0x2854('0x17')](_0x1ef8f9[_0x2854('0x18')],{'raw':_0x1ef8f9[_0x2854('0x19')]?_0x1ef8f9[_0x2854('0x19')][_0x2854('0x1a')]===undefined?!![]:![]:!![]})[_0x2854('0x1b')](function(_0x4d3944){logger['info'](_0x2854('0x1c'),_0x1ef8f9);logger[_0x2854('0x10')](_0x2854('0x1c'),_0x1ef8f9,JSON['stringify'](_0x4d3944));_0x553fd8(_0x4d3944);})['catch'](function(_0x566021){logger['error'](_0x2854('0x1c'),_0x566021[_0x2854('0x14')],_0x1ef8f9);_0x255de8(_0x5f2109['error'](0x1f4,_0x566021[_0x2854('0x14')]));});});};exports[_0x2854('0x1d')]=function(_0x1194be){var _0x5ca29e=this;return new Promise(function(_0x374c4d,_0x45d795){return db[_0x2854('0x16')][_0x2854('0x1e')](_0x1194be[_0x2854('0x18')],{'raw':_0x1194be[_0x2854('0x19')]?_0x1194be[_0x2854('0x19')][_0x2854('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1194be['options']?_0x1194be[_0x2854('0x19')][_0x2854('0x1f')]||null:null,'attributes':_0x1194be[_0x2854('0x19')]?_0x1194be[_0x2854('0x19')][_0x2854('0x20')]||null:null,'limit':_0x1194be[_0x2854('0x19')]?_0x1194be['options']['limit']||null:null})[_0x2854('0x1b')](function(_0x49f5a8){logger['info'](_0x2854('0x1d'),_0x1194be);logger[_0x2854('0x10')]('UpdateSquareReport',_0x1194be,JSON[_0x2854('0x21')](_0x49f5a8));_0x374c4d(_0x49f5a8);})[_0x2854('0x15')](function(_0x85b0a8){logger[_0x2854('0x13')](_0x2854('0x1d'),_0x85b0a8[_0x2854('0x14')],_0x1194be);_0x45d795(_0x5ca29e['error'](0x1f4,_0x85b0a8[_0x2854('0x14')]));});});}; \ No newline at end of file +var _0x6f2f=['../../config/environment','client','request','then','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','SquareReport','create','body','options','raw','CreateSquareReport','UpdateSquareReport','update','where','attributes','limit','util','moment','bluebird','rpc'];(function(_0x5b1160,_0x25bd76){var _0xd0fa64=function(_0x21df95){while(--_0x21df95){_0x5b1160['push'](_0x5b1160['shift']());}};_0xd0fa64(++_0x25bd76);}(_0x6f2f,0x164));var _0xf6f2=function(_0x15c421,_0x6366f7){_0x15c421=_0x15c421-0x0;var _0x5e5ed5=_0x6f2f[_0x15c421];return _0x5e5ed5;};'use strict';var _=require('lodash');var util=require(_0xf6f2('0x0'));var moment=require(_0xf6f2('0x1'));var BPromise=require(_0xf6f2('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('../../config/logger')(_0xf6f2('0x3'));var config=require(_0xf6f2('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xf6f2('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x291418,_0xa0027b,_0x39b18f){return new BPromise(function(_0x282a0d,_0x309e17){return client[_0xf6f2('0x6')](_0x291418,_0x39b18f)[_0xf6f2('0x7')](function(_0xea7bda){logger['info'](_0xf6f2('0x8'),_0xa0027b,_0xf6f2('0x9'));logger[_0xf6f2('0xa')](_0xf6f2('0xb'),_0xa0027b,_0xf6f2('0x9'),JSON[_0xf6f2('0xc')](_0xea7bda));if(_0xea7bda[_0xf6f2('0xd')]){if(_0xea7bda[_0xf6f2('0xd')][_0xf6f2('0xe')]===0x1f4){logger[_0xf6f2('0xd')]('SquareReport,\x20%s,\x20%s',_0xa0027b,_0xea7bda[_0xf6f2('0xd')][_0xf6f2('0xf')]);return _0x309e17(_0xea7bda[_0xf6f2('0xd')][_0xf6f2('0xf')]);}logger['error'](_0xf6f2('0x8'),_0xa0027b,_0xea7bda[_0xf6f2('0xd')]['message']);return _0x282a0d(_0xea7bda[_0xf6f2('0xd')]['message']);}else{logger[_0xf6f2('0x10')](_0xf6f2('0x8'),_0xa0027b,_0xf6f2('0x9'));_0x282a0d(_0xea7bda[_0xf6f2('0x11')][_0xf6f2('0xf')]);}})[_0xf6f2('0x12')](function(_0x34cffb){logger[_0xf6f2('0xd')](_0xf6f2('0x8'),_0xa0027b,_0x34cffb);_0x309e17(_0x34cffb);});});}exports['CreateSquareReport']=function(_0x1b514d){var _0x1370ea=this;return new Promise(function(_0xdf9575,_0x11a1e9){return db[_0xf6f2('0x13')][_0xf6f2('0x14')](_0x1b514d[_0xf6f2('0x15')],{'raw':_0x1b514d[_0xf6f2('0x16')]?_0x1b514d['options'][_0xf6f2('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x15fd59){logger[_0xf6f2('0x10')](_0xf6f2('0x18'),_0x1b514d);logger[_0xf6f2('0xa')]('CreateSquareReport',_0x1b514d,JSON[_0xf6f2('0xc')](_0x15fd59));_0xdf9575(_0x15fd59);})[_0xf6f2('0x12')](function(_0x26c8f9){logger[_0xf6f2('0xd')](_0xf6f2('0x18'),_0x26c8f9['message'],_0x1b514d);_0x11a1e9(_0x1370ea[_0xf6f2('0xd')](0x1f4,_0x26c8f9[_0xf6f2('0xf')]));});});};exports[_0xf6f2('0x19')]=function(_0x12c043){var _0x2a0edb=this;return new Promise(function(_0x2a6c7b,_0x284fd8){return db['SquareReport'][_0xf6f2('0x1a')](_0x12c043['body'],{'raw':_0x12c043[_0xf6f2('0x16')]?_0x12c043[_0xf6f2('0x16')][_0xf6f2('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12c043[_0xf6f2('0x16')]?_0x12c043[_0xf6f2('0x16')][_0xf6f2('0x1b')]||null:null,'attributes':_0x12c043[_0xf6f2('0x16')]?_0x12c043[_0xf6f2('0x16')][_0xf6f2('0x1c')]||null:null,'limit':_0x12c043[_0xf6f2('0x16')]?_0x12c043[_0xf6f2('0x16')][_0xf6f2('0x1d')]||null:null})[_0xf6f2('0x7')](function(_0x5ec284){logger[_0xf6f2('0x10')](_0xf6f2('0x19'),_0x12c043);logger[_0xf6f2('0xa')](_0xf6f2('0x19'),_0x12c043,JSON[_0xf6f2('0xc')](_0x5ec284));_0x2a6c7b(_0x5ec284);})['catch'](function(_0x1dde5b){logger[_0xf6f2('0xd')](_0xf6f2('0x19'),_0x1dde5b[_0xf6f2('0xf')],_0x12c043);_0x284fd8(_0x2a0edb[_0xf6f2('0xd')](0x1f4,_0x1dde5b['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index d9626f9..1f8802c 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 _0x0ef1=['./squareReportDetail.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x0ef1,0x114));var _0x10ef=function(_0x5279cb,_0x1601be){_0x5279cb=_0x5279cb-0x0;var _0x55785a=_0x0ef1[_0x5279cb];return _0x55785a;};'use strict';var multer=require(_0x10ef('0x0'));var util=require(_0x10ef('0x1'));var path=require(_0x10ef('0x2'));var timeout=require(_0x10ef('0x3'));var express=require(_0x10ef('0x4'));var router=express[_0x10ef('0x5')]();var fs_extra=require(_0x10ef('0x6'));var auth=require(_0x10ef('0x7'));var interaction=require(_0x10ef('0x8'));var config=require(_0x10ef('0x9'));var controller=require(_0x10ef('0xa'));router[_0x10ef('0xb')]('/',auth[_0x10ef('0xc')](),controller[_0x10ef('0xd')]);router[_0x10ef('0xb')](_0x10ef('0xe'),auth[_0x10ef('0xc')](),controller[_0x10ef('0xf')]);router[_0x10ef('0xb')](_0x10ef('0x10'),auth['isAuthenticated'](),controller[_0x10ef('0x11')]);router[_0x10ef('0x12')]('/',auth[_0x10ef('0xc')](),controller['create']);router['put'](_0x10ef('0x10'),auth[_0x10ef('0xc')](),controller[_0x10ef('0x13')]);router[_0x10ef('0x14')](_0x10ef('0x10'),auth[_0x10ef('0xc')](),controller['destroy']);module[_0x10ef('0x15')]=router; \ No newline at end of file +var _0xfd14=['delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xfd14,0x1a4));var _0x4fd1=function(_0x493ca0,_0x53ec69){_0x493ca0=_0x493ca0-0x0;var _0x379787=_0xfd14[_0x493ca0];return _0x379787;};'use strict';var multer=require(_0x4fd1('0x0'));var util=require('util');var path=require(_0x4fd1('0x1'));var timeout=require(_0x4fd1('0x2'));var express=require(_0x4fd1('0x3'));var router=express[_0x4fd1('0x4')]();var fs_extra=require(_0x4fd1('0x5'));var auth=require(_0x4fd1('0x6'));var interaction=require(_0x4fd1('0x7'));var config=require(_0x4fd1('0x8'));var controller=require(_0x4fd1('0x9'));router[_0x4fd1('0xa')]('/',auth[_0x4fd1('0xb')](),controller['index']);router['get'](_0x4fd1('0xc'),auth['isAuthenticated'](),controller[_0x4fd1('0xd')]);router[_0x4fd1('0xa')](_0x4fd1('0xe'),auth[_0x4fd1('0xb')](),controller[_0x4fd1('0xf')]);router[_0x4fd1('0x10')]('/',auth['isAuthenticated'](),controller[_0x4fd1('0x11')]);router[_0x4fd1('0x12')](_0x4fd1('0xe'),auth[_0x4fd1('0xb')](),controller[_0x4fd1('0x13')]);router[_0x4fd1('0x14')](_0x4fd1('0xe'),auth[_0x4fd1('0xb')](),controller[_0x4fd1('0x15')]);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 e30c64b..bdc465a 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 _0x3d2f=['STRING','TEXT','sequelize'];(function(_0x3dda0f,_0x5b9902){var _0x1b0488=function(_0x267031){while(--_0x267031){_0x3dda0f['push'](_0x3dda0f['shift']());}};_0x1b0488(++_0x5b9902);}(_0x3d2f,0x8c));var _0xf3d2=function(_0x508c97,_0x409158){_0x508c97=_0x508c97-0x0;var _0x463d56=_0x3d2f[_0x508c97];return _0x463d56;};'use strict';var Sequelize=require(_0xf3d2('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xf3d2('0x1')]},'node':{'type':Sequelize[_0xf3d2('0x1')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0xf3d2('0x2')]},'project_name':{'type':Sequelize[_0xf3d2('0x1')]},'callerid':{'type':Sequelize[_0xf3d2('0x1')]}}; \ No newline at end of file +var _0xe33b=['STRING','exports'];(function(_0xbf802e,_0x329296){var _0x19e99b=function(_0x36e374){while(--_0x36e374){_0xbf802e['push'](_0xbf802e['shift']());}};_0x19e99b(++_0x329296);}(_0xe33b,0x197));var _0xbe33=function(_0x49d41c,_0x2bdc35){_0x49d41c=_0x49d41c-0x0;var _0xb64c5f=_0xe33b[_0x49d41c];return _0xb64c5f;};'use strict';var Sequelize=require('sequelize');module[_0xbe33('0x0')]={'uniqueid':{'type':Sequelize[_0xbe33('0x1')]},'node':{'type':Sequelize[_0xbe33('0x1')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0xbe33('0x1')]},'callerid':{'type':Sequelize[_0xbe33('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 7eacf38..c3f77ce 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 _0x5c32=['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','status','end','json','offset','undefined','limit','count','set','Content-Range','save','then','destroy','sendStatus','error','stack','name','send','index','map','SquareDetailsReport','rawAttributes','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','rows','params','keys','intersection','options','find','catch','create','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','fs-extra','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5c32,0xd3));var _0x25c3=function(_0x3b56fd,_0x45fb42){_0x3b56fd=_0x3b56fd-0x0;var _0x5ec0e5=_0x5c32[_0x3b56fd];return _0x5ec0e5;};'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(_0x25c3('0x4'));var Mustache=require(_0x25c3('0x5'));var util=require(_0x25c3('0x6'));var path=require(_0x25c3('0x7'));var sox=require('sox');var csv=require(_0x25c3('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x25c3('0x9'));var _=require(_0x25c3('0xa'));var squel=require(_0x25c3('0xb'));var crypto=require(_0x25c3('0xc'));var jsforce=require(_0x25c3('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x25c3('0xe'));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('../../config/utils');var config=require(_0x25c3('0x16'));var licenseUtil=require(_0x25c3('0x17'));var db=require(_0x25c3('0x18'))['db'];function respondWithStatusCode(_0x23512b,_0xf1e520){_0xf1e520=_0xf1e520||0xcc;return function(_0x5c0c6b){if(_0x5c0c6b){return _0x23512b['sendStatus'](_0xf1e520);}return _0x23512b[_0x25c3('0x19')](_0xf1e520)[_0x25c3('0x1a')]();};}function respondWithResult(_0x212d02,_0x30a339){_0x30a339=_0x30a339||0xc8;return function(_0x3ff60b){if(_0x3ff60b){return _0x212d02['status'](_0x30a339)[_0x25c3('0x1b')](_0x3ff60b);}};}function respondWithFilteredResult(_0x2c7d09,_0x4a037d){return function(_0x2a88fc){if(_0x2a88fc){var _0x57f15a=typeof _0x4a037d[_0x25c3('0x1c')]===_0x25c3('0x1d')&&typeof _0x4a037d[_0x25c3('0x1e')]===_0x25c3('0x1d');var _0x412d8c=_0x2a88fc[_0x25c3('0x1f')];var _0x31dbbd=_0x57f15a?0x0:_0x4a037d['offset'];var _0x4aaab8=_0x57f15a?_0x2a88fc['count']:_0x4a037d[_0x25c3('0x1c')]+_0x4a037d[_0x25c3('0x1e')];var _0x212ed7;if(_0x4aaab8>=_0x412d8c){_0x4aaab8=_0x412d8c;_0x212ed7=0xc8;}else{_0x212ed7=0xce;}_0x2c7d09[_0x25c3('0x19')](_0x212ed7);return _0x2c7d09[_0x25c3('0x20')](_0x25c3('0x21'),_0x31dbbd+'-'+_0x4aaab8+'/'+_0x412d8c)[_0x25c3('0x1b')](_0x2a88fc);}return null;};}function patchUpdates(_0x424394){return function(_0x4d78a){try{jsonpatch['apply'](_0x4d78a,_0x424394,!![]);}catch(_0x329071){return BPromise['reject'](_0x329071);}return _0x4d78a[_0x25c3('0x22')]();};}function saveUpdates(_0xbb3bea,_0x5505e0){return function(_0x5b6ac9){if(_0x5b6ac9){return _0x5b6ac9['update'](_0xbb3bea)[_0x25c3('0x23')](function(_0x6203ca){return _0x6203ca;});}return null;};}function removeEntity(_0x11ec54,_0x201954){return function(_0xd65c92){if(_0xd65c92){return _0xd65c92[_0x25c3('0x24')]()[_0x25c3('0x23')](function(){_0x11ec54[_0x25c3('0x19')](0xcc)[_0x25c3('0x1a')]();});}};}function handleEntityNotFound(_0x34c4ae,_0xc7656c){return function(_0x4163c2){if(!_0x4163c2){_0x34c4ae[_0x25c3('0x25')](0x194);}return _0x4163c2;};}function handleError(_0x4e32b9,_0x26b159){_0x26b159=_0x26b159||0x1f4;return function(_0xd36af1){logger[_0x25c3('0x26')](_0xd36af1[_0x25c3('0x27')]);if(_0xd36af1[_0x25c3('0x28')]){delete _0xd36af1[_0x25c3('0x28')];}_0x4e32b9[_0x25c3('0x19')](_0x26b159)[_0x25c3('0x29')](_0xd36af1);};}exports[_0x25c3('0x2a')]=function(_0x562c0f,_0x10135f){var _0x11270e={},_0x4a072f={},_0x12d974={'count':0x0,'rows':[]};var _0x1fcd61=_[_0x25c3('0x2b')](db[_0x25c3('0x2c')][_0x25c3('0x2d')],function(_0x9326b6){return{'name':_0x9326b6['fieldName'],'type':_0x9326b6[_0x25c3('0x2e')][_0x25c3('0x2f')]};});_0x4a072f[_0x25c3('0x30')]=_[_0x25c3('0x2b')](_0x1fcd61,_0x25c3('0x28'));_0x4a072f['query']=_['keys'](_0x562c0f[_0x25c3('0x31')]);_0x4a072f[_0x25c3('0x32')]=_['intersection'](_0x4a072f['model'],_0x4a072f[_0x25c3('0x31')]);_0x11270e[_0x25c3('0x33')]=_['intersection'](_0x4a072f[_0x25c3('0x30')],qs[_0x25c3('0x34')](_0x562c0f[_0x25c3('0x31')][_0x25c3('0x34')]));_0x11270e[_0x25c3('0x33')]=_0x11270e[_0x25c3('0x33')][_0x25c3('0x35')]?_0x11270e['attributes']:_0x4a072f[_0x25c3('0x30')];if(!_0x562c0f[_0x25c3('0x31')][_0x25c3('0x36')](_0x25c3('0x37'))){_0x11270e['limit']=qs[_0x25c3('0x1e')](_0x562c0f[_0x25c3('0x31')][_0x25c3('0x1e')]);_0x11270e[_0x25c3('0x1c')]=qs['offset'](_0x562c0f[_0x25c3('0x31')][_0x25c3('0x1c')]);}_0x11270e['order']=qs[_0x25c3('0x38')](_0x562c0f[_0x25c3('0x31')][_0x25c3('0x38')]);_0x11270e[_0x25c3('0x39')]=qs['filters'](_[_0x25c3('0x3a')](_0x562c0f[_0x25c3('0x31')],_0x4a072f[_0x25c3('0x32')]),_0x1fcd61);if(_0x562c0f[_0x25c3('0x31')][_0x25c3('0x3b')]){_0x11270e[_0x25c3('0x39')]=_[_0x25c3('0x3c')](_0x11270e[_0x25c3('0x39')],{'$or':_[_0x25c3('0x2b')](_0x1fcd61,function(_0x1a3f46){if(_0x1a3f46[_0x25c3('0x2e')]!=='VIRTUAL'){var _0x37036e={};_0x37036e[_0x1a3f46[_0x25c3('0x28')]]={'$like':'%'+_0x562c0f[_0x25c3('0x31')][_0x25c3('0x3b')]+'%'};return _0x37036e;}})});}_0x11270e=_[_0x25c3('0x3c')]({},_0x11270e,_0x562c0f['options']);var _0x1b31e3={'where':_0x11270e[_0x25c3('0x39')]};return db[_0x25c3('0x2c')]['count'](_0x1b31e3)['then'](function(_0x5d9147){_0x12d974['count']=_0x5d9147;if(_0x562c0f[_0x25c3('0x31')][_0x25c3('0x3d')]){_0x11270e[_0x25c3('0x3e')]=[{'all':!![]}];}return db[_0x25c3('0x2c')]['findAll'](_0x11270e);})['then'](function(_0x4747fa){_0x12d974[_0x25c3('0x3f')]=_0x4747fa;return _0x12d974;})[_0x25c3('0x23')](respondWithFilteredResult(_0x10135f,_0x11270e))['catch'](handleError(_0x10135f,null));};exports['show']=function(_0x3b8a61,_0x50f201){var _0x131134={'raw':!![],'where':{'id':_0x3b8a61[_0x25c3('0x40')]['id']}},_0x38f9eb={};_0x38f9eb[_0x25c3('0x30')]=_[_0x25c3('0x41')](db[_0x25c3('0x2c')][_0x25c3('0x2d')]);_0x38f9eb[_0x25c3('0x31')]=_['keys'](_0x3b8a61[_0x25c3('0x31')]);_0x38f9eb[_0x25c3('0x32')]=_[_0x25c3('0x42')](_0x38f9eb[_0x25c3('0x30')],_0x38f9eb['query']);_0x131134[_0x25c3('0x33')]=_[_0x25c3('0x42')](_0x38f9eb[_0x25c3('0x30')],qs[_0x25c3('0x34')](_0x3b8a61[_0x25c3('0x31')][_0x25c3('0x34')]));_0x131134[_0x25c3('0x33')]=_0x131134[_0x25c3('0x33')]['length']?_0x131134['attributes']:_0x38f9eb[_0x25c3('0x30')];if(_0x3b8a61['query'][_0x25c3('0x3d')]){_0x131134[_0x25c3('0x3e')]=[{'all':!![]}];}_0x131134=_[_0x25c3('0x3c')]({},_0x131134,_0x3b8a61[_0x25c3('0x43')]);return db[_0x25c3('0x2c')][_0x25c3('0x44')](_0x131134)[_0x25c3('0x23')](handleEntityNotFound(_0x50f201,null))[_0x25c3('0x23')](respondWithResult(_0x50f201,null))[_0x25c3('0x45')](handleError(_0x50f201,null));};exports[_0x25c3('0x46')]=function(_0x559ca7,_0x1d6344){return db[_0x25c3('0x2c')][_0x25c3('0x46')](_0x559ca7['body'],{})['then'](respondWithResult(_0x1d6344,0xc9))[_0x25c3('0x45')](handleError(_0x1d6344,null));};exports[_0x25c3('0x47')]=function(_0x225579,_0x355c7d){if(_0x225579[_0x25c3('0x48')]['id']){delete _0x225579['body']['id'];}return db[_0x25c3('0x2c')][_0x25c3('0x44')]({'where':{'id':_0x225579[_0x25c3('0x40')]['id']}})['then'](handleEntityNotFound(_0x355c7d,null))[_0x25c3('0x23')](saveUpdates(_0x225579[_0x25c3('0x48')],null))[_0x25c3('0x23')](respondWithResult(_0x355c7d,null))[_0x25c3('0x45')](handleError(_0x355c7d,null));};exports[_0x25c3('0x24')]=function(_0x1517c6,_0x4cbd23){return db['SquareDetailsReport'][_0x25c3('0x44')]({'where':{'id':_0x1517c6[_0x25c3('0x40')]['id']}})[_0x25c3('0x23')](handleEntityNotFound(_0x4cbd23,null))[_0x25c3('0x23')](removeEntity(_0x4cbd23,null))[_0x25c3('0x45')](handleError(_0x4cbd23,null));};exports[_0x25c3('0x49')]=function(_0x2e0bf4,_0x141336){return db['SquareDetailsReport']['describe']()['then'](respondWithResult(_0x141336,null))[_0x25c3('0x45')](handleError(_0x141336,null));}; \ No newline at end of file +var _0xefb6=['to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','SquareDetailsReport','rawAttributes','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','options','includeAll','findAll','rows','show','params','include','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox'];(function(_0x9b678a,_0x2c797e){var _0x28fca4=function(_0x2abfef){while(--_0x2abfef){_0x9b678a['push'](_0x9b678a['shift']());}};_0x28fca4(++_0x2c797e);}(_0xefb6,0x8f));var _0x6efb=function(_0x354164,_0x4c30de){_0x354164=_0x354164-0x0;var _0x5db9a8=_0xefb6[_0x354164];return _0x5db9a8;};'use strict';var emlformat=require(_0x6efb('0x0'));var rimraf=require(_0x6efb('0x1'));var zipdir=require(_0x6efb('0x2'));var jsonpatch=require(_0x6efb('0x3'));var rp=require('request-promise');var moment=require(_0x6efb('0x4'));var BPromise=require(_0x6efb('0x5'));var Mustache=require(_0x6efb('0x6'));var util=require(_0x6efb('0x7'));var path=require('path');var sox=require(_0x6efb('0x8'));var csv=require(_0x6efb('0x9'));var ejs=require(_0x6efb('0xa'));var fs=require('fs');var fs_extra=require(_0x6efb('0xb'));var _=require(_0x6efb('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6efb('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6efb('0xe'));var Papa=require(_0x6efb('0xf'));var Redis=require(_0x6efb('0x10'));var authService=require(_0x6efb('0x11'));var qs=require(_0x6efb('0x12'));var as=require(_0x6efb('0x13'));var hardwareService=require(_0x6efb('0x14'));var logger=require('../../config/logger')(_0x6efb('0x15'));var utils=require('../../config/utils');var config=require(_0x6efb('0x16'));var licenseUtil=require(_0x6efb('0x17'));var db=require(_0x6efb('0x18'))['db'];function respondWithStatusCode(_0x4bd303,_0x28c389){_0x28c389=_0x28c389||0xcc;return function(_0x4b7f0e){if(_0x4b7f0e){return _0x4bd303[_0x6efb('0x19')](_0x28c389);}return _0x4bd303[_0x6efb('0x1a')](_0x28c389)[_0x6efb('0x1b')]();};}function respondWithResult(_0x76dd29,_0x5986b){_0x5986b=_0x5986b||0xc8;return function(_0xfa93fd){if(_0xfa93fd){return _0x76dd29['status'](_0x5986b)[_0x6efb('0x1c')](_0xfa93fd);}};}function respondWithFilteredResult(_0x13b1b8,_0x2379c2){return function(_0x73739){if(_0x73739){var _0x4a1e85=typeof _0x2379c2[_0x6efb('0x1d')]==='undefined'&&typeof _0x2379c2['limit']===_0x6efb('0x1e');var _0x33e08d=_0x73739[_0x6efb('0x1f')];var _0x521fb8=_0x4a1e85?0x0:_0x2379c2['offset'];var _0x15b4e4=_0x4a1e85?_0x73739[_0x6efb('0x1f')]:_0x2379c2['offset']+_0x2379c2[_0x6efb('0x20')];var _0x554509;if(_0x15b4e4>=_0x33e08d){_0x15b4e4=_0x33e08d;_0x554509=0xc8;}else{_0x554509=0xce;}_0x13b1b8[_0x6efb('0x1a')](_0x554509);return _0x13b1b8[_0x6efb('0x21')](_0x6efb('0x22'),_0x521fb8+'-'+_0x15b4e4+'/'+_0x33e08d)[_0x6efb('0x1c')](_0x73739);}return null;};}function patchUpdates(_0x32d01d){return function(_0x25a4ce){try{jsonpatch[_0x6efb('0x23')](_0x25a4ce,_0x32d01d,!![]);}catch(_0x1e37dd){return BPromise[_0x6efb('0x24')](_0x1e37dd);}return _0x25a4ce[_0x6efb('0x25')]();};}function saveUpdates(_0x57cd69,_0x8360cc){return function(_0x1b73d8){if(_0x1b73d8){return _0x1b73d8[_0x6efb('0x26')](_0x57cd69)[_0x6efb('0x27')](function(_0x15bca9){return _0x15bca9;});}return null;};}function removeEntity(_0x2bb858,_0x11d3bd){return function(_0x1cb831){if(_0x1cb831){return _0x1cb831[_0x6efb('0x28')]()[_0x6efb('0x27')](function(){_0x2bb858[_0x6efb('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24b276,_0x31226b){return function(_0x25d0f7){if(!_0x25d0f7){_0x24b276[_0x6efb('0x19')](0x194);}return _0x25d0f7;};}function handleError(_0x52d322,_0x26e8cf){_0x26e8cf=_0x26e8cf||0x1f4;return function(_0x97661f){logger[_0x6efb('0x29')](_0x97661f['stack']);if(_0x97661f[_0x6efb('0x2a')]){delete _0x97661f[_0x6efb('0x2a')];}_0x52d322['status'](_0x26e8cf)[_0x6efb('0x2b')](_0x97661f);};}exports[_0x6efb('0x2c')]=function(_0x5247cc,_0x30e48f){var _0x581ea6={},_0x582f16={},_0x141745={'count':0x0,'rows':[]};var _0x529a37=_[_0x6efb('0x2d')](db[_0x6efb('0x2e')][_0x6efb('0x2f')],function(_0xa501f6){return{'name':_0xa501f6['fieldName'],'type':_0xa501f6['type'][_0x6efb('0x30')]};});_0x582f16[_0x6efb('0x31')]=_['map'](_0x529a37,_0x6efb('0x2a'));_0x582f16['query']=_[_0x6efb('0x32')](_0x5247cc['query']);_0x582f16['filters']=_[_0x6efb('0x33')](_0x582f16[_0x6efb('0x31')],_0x582f16[_0x6efb('0x34')]);_0x581ea6[_0x6efb('0x35')]=_[_0x6efb('0x33')](_0x582f16['model'],qs['fields'](_0x5247cc['query'][_0x6efb('0x36')]));_0x581ea6['attributes']=_0x581ea6[_0x6efb('0x35')][_0x6efb('0x37')]?_0x581ea6[_0x6efb('0x35')]:_0x582f16['model'];if(!_0x5247cc[_0x6efb('0x34')][_0x6efb('0x38')](_0x6efb('0x39'))){_0x581ea6[_0x6efb('0x20')]=qs['limit'](_0x5247cc[_0x6efb('0x34')]['limit']);_0x581ea6[_0x6efb('0x1d')]=qs[_0x6efb('0x1d')](_0x5247cc['query']['offset']);}_0x581ea6[_0x6efb('0x3a')]=qs['sort'](_0x5247cc['query']['sort']);_0x581ea6[_0x6efb('0x3b')]=qs[_0x6efb('0x3c')](_[_0x6efb('0x3d')](_0x5247cc[_0x6efb('0x34')],_0x582f16[_0x6efb('0x3c')]),_0x529a37);if(_0x5247cc[_0x6efb('0x34')][_0x6efb('0x3e')]){_0x581ea6[_0x6efb('0x3b')]=_[_0x6efb('0x3f')](_0x581ea6[_0x6efb('0x3b')],{'$or':_['map'](_0x529a37,function(_0x210f32){if(_0x210f32['type']!=='VIRTUAL'){var _0x30a538={};_0x30a538[_0x210f32[_0x6efb('0x2a')]]={'$like':'%'+_0x5247cc[_0x6efb('0x34')]['filter']+'%'};return _0x30a538;}})});}_0x581ea6=_[_0x6efb('0x3f')]({},_0x581ea6,_0x5247cc[_0x6efb('0x40')]);var _0x4c01c9={'where':_0x581ea6['where']};return db[_0x6efb('0x2e')][_0x6efb('0x1f')](_0x4c01c9)[_0x6efb('0x27')](function(_0x198e04){_0x141745[_0x6efb('0x1f')]=_0x198e04;if(_0x5247cc[_0x6efb('0x34')][_0x6efb('0x41')]){_0x581ea6['include']=[{'all':!![]}];}return db[_0x6efb('0x2e')][_0x6efb('0x42')](_0x581ea6);})[_0x6efb('0x27')](function(_0x4851b5){_0x141745[_0x6efb('0x43')]=_0x4851b5;return _0x141745;})[_0x6efb('0x27')](respondWithFilteredResult(_0x30e48f,_0x581ea6))['catch'](handleError(_0x30e48f,null));};exports[_0x6efb('0x44')]=function(_0x509711,_0x432918){var _0x481e6c={'raw':!![],'where':{'id':_0x509711[_0x6efb('0x45')]['id']}},_0x36100b={};_0x36100b[_0x6efb('0x31')]=_[_0x6efb('0x32')](db['SquareDetailsReport'][_0x6efb('0x2f')]);_0x36100b[_0x6efb('0x34')]=_[_0x6efb('0x32')](_0x509711[_0x6efb('0x34')]);_0x36100b['filters']=_[_0x6efb('0x33')](_0x36100b[_0x6efb('0x31')],_0x36100b[_0x6efb('0x34')]);_0x481e6c[_0x6efb('0x35')]=_[_0x6efb('0x33')](_0x36100b[_0x6efb('0x31')],qs['fields'](_0x509711[_0x6efb('0x34')][_0x6efb('0x36')]));_0x481e6c[_0x6efb('0x35')]=_0x481e6c[_0x6efb('0x35')][_0x6efb('0x37')]?_0x481e6c['attributes']:_0x36100b[_0x6efb('0x31')];if(_0x509711['query'][_0x6efb('0x41')]){_0x481e6c[_0x6efb('0x46')]=[{'all':!![]}];}_0x481e6c=_[_0x6efb('0x3f')]({},_0x481e6c,_0x509711[_0x6efb('0x40')]);return db['SquareDetailsReport'][_0x6efb('0x47')](_0x481e6c)[_0x6efb('0x27')](handleEntityNotFound(_0x432918,null))[_0x6efb('0x27')](respondWithResult(_0x432918,null))[_0x6efb('0x48')](handleError(_0x432918,null));};exports[_0x6efb('0x49')]=function(_0x9cf684,_0x4e2fd7){return db[_0x6efb('0x2e')]['create'](_0x9cf684[_0x6efb('0x4a')],{})[_0x6efb('0x27')](respondWithResult(_0x4e2fd7,0xc9))[_0x6efb('0x48')](handleError(_0x4e2fd7,null));};exports['update']=function(_0xe6c97f,_0x2673df){if(_0xe6c97f[_0x6efb('0x4a')]['id']){delete _0xe6c97f[_0x6efb('0x4a')]['id'];}return db['SquareDetailsReport']['find']({'where':{'id':_0xe6c97f[_0x6efb('0x45')]['id']}})[_0x6efb('0x27')](handleEntityNotFound(_0x2673df,null))[_0x6efb('0x27')](saveUpdates(_0xe6c97f[_0x6efb('0x4a')],null))[_0x6efb('0x27')](respondWithResult(_0x2673df,null))[_0x6efb('0x48')](handleError(_0x2673df,null));};exports[_0x6efb('0x28')]=function(_0xe693ff,_0x166d12){return db[_0x6efb('0x2e')][_0x6efb('0x47')]({'where':{'id':_0xe693ff[_0x6efb('0x45')]['id']}})['then'](handleEntityNotFound(_0x166d12,null))[_0x6efb('0x27')](removeEntity(_0x166d12,null))[_0x6efb('0x48')](handleError(_0x166d12,null));};exports[_0x6efb('0x4b')]=function(_0x5cd384,_0x464a62){return db[_0x6efb('0x2e')][_0x6efb('0x4b')]()[_0x6efb('0x27')](respondWithResult(_0x464a62,null))[_0x6efb('0x48')](handleError(_0x464a62,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 3143349..b5dcc3c 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 _0xf1fa=['lodash','util','api','bluebird','path','rimraf','./squareReportDetail.attributes','define','SquareDetailsReport','report_square_details'];(function(_0x496333,_0x1c47d6){var _0x44256e=function(_0x58767d){while(--_0x58767d){_0x496333['push'](_0x496333['shift']());}};_0x44256e(++_0x1c47d6);}(_0xf1fa,0x64));var _0xaf1f=function(_0x5be9b4,_0x1450f0){_0x5be9b4=_0x5be9b4-0x0;var _0x1427b8=_0xf1fa[_0x5be9b4];return _0x1427b8;};'use strict';var _=require(_0xaf1f('0x0'));var util=require(_0xaf1f('0x1'));var logger=require('../../config/logger')(_0xaf1f('0x2'));var moment=require('moment');var BPromise=require(_0xaf1f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaf1f('0x4'));var rimraf=require(_0xaf1f('0x5'));var config=require('../../config/environment');var attributes=require(_0xaf1f('0x6'));module['exports']=function(_0xcb5073,_0x4b7b10){return _0xcb5073[_0xaf1f('0x7')](_0xaf1f('0x8'),attributes,{'tableName':_0xaf1f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5ebb=['define','report_square_details','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./squareReportDetail.attributes','exports'];(function(_0x5e80a1,_0x5558fa){var _0x2290fc=function(_0x28f829){while(--_0x28f829){_0x5e80a1['push'](_0x5e80a1['shift']());}};_0x2290fc(++_0x5558fa);}(_0x5ebb,0x1e6));var _0xb5eb=function(_0x4c8958,_0x2c6ed5){_0x4c8958=_0x4c8958-0x0;var _0x4f8af1=_0x5ebb[_0x4c8958];return _0x4f8af1;};'use strict';var _=require('lodash');var util=require(_0xb5eb('0x0'));var logger=require(_0xb5eb('0x1'))(_0xb5eb('0x2'));var moment=require(_0xb5eb('0x3'));var BPromise=require(_0xb5eb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb5eb('0x5'));var rimraf=require('rimraf');var config=require(_0xb5eb('0x6'));var attributes=require(_0xb5eb('0x7'));module[_0xb5eb('0x8')]=function(_0x4ccbd,_0x35a20a){return _0x4ccbd[_0xb5eb('0x9')]('SquareDetailsReport',attributes,{'tableName':_0xb5eb('0xa'),'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 6cc26f4..d8dad49 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 _0xb78e=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateSquareDetailsReport','SquareDetailsReport','body','options','lodash','util'];(function(_0x3ad11e,_0x1f4046){var _0xff650a=function(_0x2728d7){while(--_0x2728d7){_0x3ad11e['push'](_0x3ad11e['shift']());}};_0xff650a(++_0x1f4046);}(_0xb78e,0x1c9));var _0xeb78=function(_0x4c3894,_0x332906){_0x4c3894=_0x4c3894-0x0;var _0x55438f=_0xb78e[_0x4c3894];return _0x55438f;};'use strict';var _=require(_0xeb78('0x0'));var util=require(_0xeb78('0x1'));var moment=require('moment');var BPromise=require(_0xeb78('0x2'));var rs=require(_0xeb78('0x3'));var fs=require('fs');var Redis=require(_0xeb78('0x4'));var db=require(_0xeb78('0x5'))['db'];var utils=require(_0xeb78('0x6'));var logger=require(_0xeb78('0x7'))(_0xeb78('0x8'));var config=require(_0xeb78('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xeb78('0xa')][_0xeb78('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ccc2f,_0x30c884,_0x2b7925){return new BPromise(function(_0x36963f,_0x5259aa){return client['request'](_0x1ccc2f,_0x2b7925)[_0xeb78('0xc')](function(_0x1c941d){logger[_0xeb78('0xd')](_0xeb78('0xe'),_0x30c884,_0xeb78('0xf'));logger[_0xeb78('0x10')](_0xeb78('0x11'),_0x30c884,_0xeb78('0xf'),JSON[_0xeb78('0x12')](_0x1c941d));if(_0x1c941d['error']){if(_0x1c941d[_0xeb78('0x13')][_0xeb78('0x14')]===0x1f4){logger[_0xeb78('0x13')](_0xeb78('0xe'),_0x30c884,_0x1c941d[_0xeb78('0x13')][_0xeb78('0x15')]);return _0x5259aa(_0x1c941d[_0xeb78('0x13')][_0xeb78('0x15')]);}logger[_0xeb78('0x13')](_0xeb78('0xe'),_0x30c884,_0x1c941d['error'][_0xeb78('0x15')]);return _0x36963f(_0x1c941d[_0xeb78('0x13')]['message']);}else{logger['info']('SquareDetailsReport,\x20%s,\x20%s',_0x30c884,_0xeb78('0xf'));_0x36963f(_0x1c941d['result'][_0xeb78('0x15')]);}})[_0xeb78('0x16')](function(_0x49123d){logger[_0xeb78('0x13')]('SquareDetailsReport,\x20%s,\x20%s',_0x30c884,_0x49123d);_0x5259aa(_0x49123d);});});}exports[_0xeb78('0x17')]=function(_0x92e410){var _0x576802=this;return new Promise(function(_0x45176e,_0xb97756){return db[_0xeb78('0x18')]['create'](_0x92e410[_0xeb78('0x19')],{'raw':_0x92e410[_0xeb78('0x1a')]?_0x92e410['options']['raw']===undefined?!![]:![]:!![]})[_0xeb78('0xc')](function(_0x106c5d){logger[_0xeb78('0xd')](_0xeb78('0x17'),_0x92e410);logger[_0xeb78('0x10')](_0xeb78('0x17'),_0x92e410,JSON[_0xeb78('0x12')](_0x106c5d));_0x45176e(_0x106c5d);})[_0xeb78('0x16')](function(_0x18f08d){logger['error']('CreateSquareDetailsReport',_0x18f08d['message'],_0x92e410);_0xb97756(_0x576802['error'](0x1f4,_0x18f08d[_0xeb78('0x15')]));});});}; \ No newline at end of file +var _0x0e56=['body','options','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareDetailsReport'];(function(_0x3d8812,_0x24b648){var _0x3aa4ee=function(_0x1d5e09){while(--_0x1d5e09){_0x3d8812['push'](_0x3d8812['shift']());}};_0x3aa4ee(++_0x24b648);}(_0x0e56,0xf5));var _0x60e5=function(_0x490cd3,_0x97d5ee){_0x490cd3=_0x490cd3-0x0;var _0x3320d7=_0x0e56[_0x490cd3];return _0x3320d7;};'use strict';var _=require(_0x60e5('0x0'));var util=require(_0x60e5('0x1'));var moment=require('moment');var BPromise=require(_0x60e5('0x2'));var rs=require(_0x60e5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x60e5('0x4'))['db'];var utils=require(_0x60e5('0x5'));var logger=require(_0x60e5('0x6'))(_0x60e5('0x7'));var config=require(_0x60e5('0x8'));var jayson=require(_0x60e5('0x9'));var client=jayson[_0x60e5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b44b9,_0x5513f2,_0x31765c){return new BPromise(function(_0x3083a0,_0x59389e){return client[_0x60e5('0xb')](_0x1b44b9,_0x31765c)[_0x60e5('0xc')](function(_0x46d531){logger[_0x60e5('0xd')](_0x60e5('0xe'),_0x5513f2,_0x60e5('0xf'));logger[_0x60e5('0x10')](_0x60e5('0x11'),_0x5513f2,_0x60e5('0xf'),JSON[_0x60e5('0x12')](_0x46d531));if(_0x46d531[_0x60e5('0x13')]){if(_0x46d531[_0x60e5('0x13')][_0x60e5('0x14')]===0x1f4){logger[_0x60e5('0x13')](_0x60e5('0xe'),_0x5513f2,_0x46d531[_0x60e5('0x13')]['message']);return _0x59389e(_0x46d531[_0x60e5('0x13')]['message']);}logger['error'](_0x60e5('0xe'),_0x5513f2,_0x46d531[_0x60e5('0x13')]['message']);return _0x3083a0(_0x46d531[_0x60e5('0x13')][_0x60e5('0x15')]);}else{logger[_0x60e5('0xd')](_0x60e5('0xe'),_0x5513f2,'request\x20sent');_0x3083a0(_0x46d531[_0x60e5('0x16')][_0x60e5('0x15')]);}})[_0x60e5('0x17')](function(_0x1ed08d){logger[_0x60e5('0x13')](_0x60e5('0xe'),_0x5513f2,_0x1ed08d);_0x59389e(_0x1ed08d);});});}exports[_0x60e5('0x18')]=function(_0x12aee7){var _0x3060b6=this;return new Promise(function(_0x51688a,_0x599dc4){return db['SquareDetailsReport']['create'](_0x12aee7[_0x60e5('0x19')],{'raw':_0x12aee7[_0x60e5('0x1a')]?_0x12aee7[_0x60e5('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x60e5('0xc')](function(_0x68c78){logger[_0x60e5('0xd')](_0x60e5('0x18'),_0x12aee7);logger[_0x60e5('0x10')](_0x60e5('0x18'),_0x12aee7,JSON[_0x60e5('0x12')](_0x68c78));_0x51688a(_0x68c78);})[_0x60e5('0x17')](function(_0x443665){logger[_0x60e5('0x13')](_0x60e5('0x18'),_0x443665['message'],_0x12aee7);_0x599dc4(_0x3060b6['error'](0x1f4,_0x443665[_0x60e5('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 69d38cd..dfe5006 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 _0x678f=['killProcess','exports','express','Router','../../components/auth/service','get','isAuthenticated','/process/:pid/kill'];(function(_0x9e82f5,_0x567d67){var _0x17f064=function(_0x44aa14){while(--_0x44aa14){_0x9e82f5['push'](_0x9e82f5['shift']());}};_0x17f064(++_0x567d67);}(_0x678f,0xda));var _0xf678=function(_0x817d9b,_0x3c37e3){_0x817d9b=_0x817d9b-0x0;var _0x2752e1=_0x678f[_0x817d9b];return _0x2752e1;};'use strict';var express=require(_0xf678('0x0'));var router=express[_0xf678('0x1')]();var auth=require(_0xf678('0x2'));var controller=require('./system.controller');router[_0xf678('0x3')]('/',auth[_0xf678('0x4')](),controller['index']);router['get'](_0xf678('0x5'),auth['isAuthenticated'](),controller[_0xf678('0x6')]);module[_0xf678('0x7')]=router; \ No newline at end of file +var _0x3921=['Router','./system.controller','get','/process/:pid/kill','isAuthenticated','express'];(function(_0x509273,_0x13fc9f){var _0x38ef40=function(_0xf8d4c9){while(--_0xf8d4c9){_0x509273['push'](_0x509273['shift']());}};_0x38ef40(++_0x13fc9f);}(_0x3921,0x1af));var _0x1392=function(_0x3feb03,_0x349113){_0x3feb03=_0x3feb03-0x0;var _0x262ab7=_0x3921[_0x3feb03];return _0x262ab7;};'use strict';var express=require(_0x1392('0x0'));var router=express[_0x1392('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x1392('0x2'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x1392('0x3')](_0x1392('0x4'),auth[_0x1392('0x5')](),controller['killProcess']);module['exports']=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 558a37b..06c7ed2 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 _0x737e=['length','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','killProcess','systeminformation','child_process','exec','../../config/logger','api','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','index','getAllData','then','json','catch','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split'];(function(_0x2a8b21,_0x5cd96b){var _0x114314=function(_0xd17a7){while(--_0xd17a7){_0x2a8b21['push'](_0x2a8b21['shift']());}};_0x114314(++_0x5cd96b);}(_0x737e,0x1c6));var _0xe737=function(_0x26c5fe,_0x13c0ac){_0x26c5fe=_0x26c5fe-0x0;var _0x327c2c=_0x737e[_0x26c5fe];return _0x327c2c;};'use strict';var info=require(_0xe737('0x0'));var exec=require(_0xe737('0x1'))[_0xe737('0x2')];var logger=require(_0xe737('0x3'))(_0xe737('0x4'));var util=require('util');var BPromise=require(_0xe737('0x5'));var _=require(_0xe737('0x6'));function handleError(_0x11d6c4,_0xe16128,_0x3a44f7){_0xe16128=_0xe16128||0x1f4;return function(_0x4eb5a9){logger[_0xe737('0x7')](_0xe737('0x8'),_0x3a44f7,_0xe16128,util[_0xe737('0x9')](_0x4eb5a9,{'showHidden':![],'depth':null}));delete _0x4eb5a9[_0xe737('0xa')];_0x11d6c4[_0xe737('0xb')](_0xe16128)['send'](_0x4eb5a9);};}exports[_0xe737('0xc')]=function(_0x408a1f,_0x1c224b){return info[_0xe737('0xd')]()[_0xe737('0xe')](function(_0x407fd3){return _0x1c224b[_0xe737('0xb')](0xc8)[_0xe737('0xf')](_0x407fd3);})[_0xe737('0x10')](function(_0x439bfa){return _0x1c224b[_0xe737('0xb')](0x1f4)[_0xe737('0xf')](_0x439bfa);});};exports['killProcess']=function(_0x512cfd,_0x46d9dd){var _0x25be69=[_0xe737('0x11')];return new BPromise(function(_0x559e1f,_0x41b626){return exec(util['format'](_0xe737('0x12'),_0x512cfd[_0xe737('0x13')][_0xe737('0x14')]),function(_0x2bba61,_0x3fbcf2,_0x5555d2){if(_0x2bba61){return _0x41b626(_0x2bba61);}return _0x559e1f(_0x3fbcf2);});})['then'](function(_0x3f63ec){var _0x353f74=![];var _0x3fdaf8=_0x3f63ec[_0xe737('0x15')](/\n/);for(var _0x4a3457=0x0,_0xfe0006=_0x25be69[_0xe737('0x16')];_0x4a3457<_0xfe0006,_0x353f74===![];_0x4a3457+=0x1){if(_0x3f63ec['indexOf'](_0x25be69[_0x4a3457])>=0x0){_0x353f74=!![];}}if(!_0x353f74){throw new Error(util['format'](_0xe737('0x17'),_0x512cfd[_0xe737('0x13')][_0xe737('0x14')]));}process[_0xe737('0x18')](_0x512cfd[_0xe737('0x13')][_0xe737('0x14')],_0xe737('0x19'));return _0x46d9dd[_0xe737('0xb')](0xc8)[_0xe737('0xf')]({'message':util['format'](_0xe737('0x1a'),_0x512cfd['params'][_0xe737('0x14')])});})[_0xe737('0x10')](handleError(_0x46d9dd,null,_0xe737('0x1b')));}; \ No newline at end of file +var _0x3f42=['length','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','json','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','../../config/logger','api','util','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','send','index','getAllData','then','status','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid'];(function(_0x165c59,_0x578449){var _0x565461=function(_0x33484a){while(--_0x33484a){_0x165c59['push'](_0x165c59['shift']());}};_0x565461(++_0x578449);}(_0x3f42,0x100));var _0x23f4=function(_0x288006,_0x88f7c2){_0x288006=_0x288006-0x0;var _0x576bf3=_0x3f42[_0x288006];return _0x576bf3;};'use strict';var info=require(_0x23f4('0x0'));var exec=require(_0x23f4('0x1'))[_0x23f4('0x2')];var logger=require(_0x23f4('0x3'))(_0x23f4('0x4'));var util=require(_0x23f4('0x5'));var BPromise=require('bluebird');var _=require('lodash');function handleError(_0x119e84,_0x10070d,_0x500ca6){_0x10070d=_0x10070d||0x1f4;return function(_0x38a643){logger['error'](_0x23f4('0x6'),_0x500ca6,_0x10070d,util[_0x23f4('0x7')](_0x38a643,{'showHidden':![],'depth':null}));delete _0x38a643['name'];_0x119e84['status'](_0x10070d)[_0x23f4('0x8')](_0x38a643);};}exports[_0x23f4('0x9')]=function(_0x484c33,_0x23d769){return info[_0x23f4('0xa')]()[_0x23f4('0xb')](function(_0x4d697c){return _0x23d769[_0x23f4('0xc')](0xc8)['json'](_0x4d697c);})['catch'](function(_0x55f840){return _0x23d769['status'](0x1f4)['json'](_0x55f840);});};exports[_0x23f4('0xd')]=function(_0x1f9214,_0x510e3b){var _0x115bcd=[_0x23f4('0xe')];return new BPromise(function(_0x367e21,_0x5ad3be){return exec(util[_0x23f4('0xf')](_0x23f4('0x10'),_0x1f9214[_0x23f4('0x11')][_0x23f4('0x12')]),function(_0x419d92,_0x172260,_0x1564fb){if(_0x419d92){return _0x5ad3be(_0x419d92);}return _0x367e21(_0x172260);});})[_0x23f4('0xb')](function(_0x5d90f5){var _0x2974e0=![];var _0x461b81=_0x5d90f5['split'](/\n/);for(var _0x592b96=0x0,_0x3a51bd=_0x115bcd[_0x23f4('0x13')];_0x592b96<_0x3a51bd,_0x2974e0===![];_0x592b96+=0x1){if(_0x5d90f5['indexOf'](_0x115bcd[_0x592b96])>=0x0){_0x2974e0=!![];}}if(!_0x2974e0){throw new Error(util[_0x23f4('0xf')](_0x23f4('0x14'),_0x1f9214[_0x23f4('0x11')]['pid']));}process[_0x23f4('0x15')](_0x1f9214[_0x23f4('0x11')][_0x23f4('0x12')],_0x23f4('0x16'));return _0x510e3b[_0x23f4('0xc')](0xc8)[_0x23f4('0x17')]({'message':util[_0x23f4('0xf')](_0x23f4('0x18'),_0x1f9214[_0x23f4('0x11')][_0x23f4('0x12')])});})['catch'](handleError(_0x510e3b,null,_0x23f4('0xd')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 7a5150c..ed2b6b5 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 _0x4f31=['show','put','delete','destroy','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./tag.controller','get','/:id','isAuthenticated'];(function(_0x5a636f,_0x3fec2b){var _0x6a8cfb=function(_0x20e6ca){while(--_0x20e6ca){_0x5a636f['push'](_0x5a636f['shift']());}};_0x6a8cfb(++_0x3fec2b);}(_0x4f31,0x13f));var _0x14f3=function(_0x331fe0,_0x54b602){_0x331fe0=_0x331fe0-0x0;var _0xe46c4b=_0x4f31[_0x331fe0];return _0xe46c4b;};'use strict';var multer=require(_0x14f3('0x0'));var util=require(_0x14f3('0x1'));var path=require('path');var timeout=require(_0x14f3('0x2'));var express=require('express');var router=express[_0x14f3('0x3')]();var fs_extra=require(_0x14f3('0x4'));var auth=require(_0x14f3('0x5'));var interaction=require(_0x14f3('0x6'));var config=require('../../config/environment');var controller=require(_0x14f3('0x7'));router[_0x14f3('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x14f3('0x8')](_0x14f3('0x9'),auth[_0x14f3('0xa')](),controller[_0x14f3('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x14f3('0xc')](_0x14f3('0x9'),auth[_0x14f3('0xa')](),controller['update']);router[_0x14f3('0xd')](_0x14f3('0x9'),auth[_0x14f3('0xa')](),controller[_0x14f3('0xe')]);module['exports']=router; \ No newline at end of file +var _0xf19d=['multer','path','express','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy'];(function(_0x54334a,_0x56bcd8){var _0x51cd78=function(_0x4f9df3){while(--_0x4f9df3){_0x54334a['push'](_0x54334a['shift']());}};_0x51cd78(++_0x56bcd8);}(_0xf19d,0x110));var _0xdf19=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xf19d[_0x5c351c];return _0x26f3b3;};'use strict';var multer=require(_0xdf19('0x0'));var util=require('util');var path=require(_0xdf19('0x1'));var timeout=require('connect-timeout');var express=require(_0xdf19('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xdf19('0x3'));var config=require(_0xdf19('0x4'));var controller=require(_0xdf19('0x5'));router[_0xdf19('0x6')]('/',auth[_0xdf19('0x7')](),controller[_0xdf19('0x8')]);router[_0xdf19('0x6')](_0xdf19('0x9'),auth[_0xdf19('0x7')](),controller['show']);router[_0xdf19('0xa')]('/',auth[_0xdf19('0x7')](),controller[_0xdf19('0xb')]);router[_0xdf19('0xc')](_0xdf19('0x9'),auth['isAuthenticated'](),controller[_0xdf19('0xd')]);router[_0xdf19('0xe')](_0xdf19('0x9'),auth[_0xdf19('0x7')](),controller[_0xdf19('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index c7a1f3b..53d7cd1 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 _0x07a2=['sequelize','exports','name','STRING','#0091EA'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x07a2,0x12c));var _0x207a=function(_0x650e11,_0x284f86){_0x650e11=_0x650e11-0x0;var _0x1a9b47=_0x07a2[_0x650e11];return _0x1a9b47;};'use strict';var Sequelize=require(_0x207a('0x0'));module[_0x207a('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x207a('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x207a('0x3')],'defaultValue':_0x207a('0x4')},'description':{'type':Sequelize[_0x207a('0x3')]}}; \ No newline at end of file +var _0xac4a=['exports','STRING','name','#0091EA','sequelize'];(function(_0x3995d6,_0x52ed99){var _0x541c7e=function(_0x3273ac){while(--_0x3273ac){_0x3995d6['push'](_0x3995d6['shift']());}};_0x541c7e(++_0x52ed99);}(_0xac4a,0x13f));var _0xaac4=function(_0x2e3656,_0xff35d){_0x2e3656=_0x2e3656-0x0;var _0xa5b5a=_0xac4a[_0x2e3656];return _0xa5b5a;};'use strict';var Sequelize=require(_0xaac4('0x0'));module[_0xaac4('0x1')]={'name':{'type':Sequelize[_0xaac4('0x2')],'unique':_0xaac4('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xaac4('0x2')],'defaultValue':_0xaac4('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 bc3f41a..19bb995 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 _0xf109=['save','update','destroy','then','Tags','UserProfileResource','sendStatus','error','stack','name','send','map','Tag','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','rawAttributes','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','status','end','undefined','limit','count','offset','set','Content-Range','json','apply'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xf109,0xce));var _0x9f10=function(_0x580647,_0x43d2c3){_0x580647=_0x580647-0x0;var _0x5f0792=_0xf109[_0x580647];return _0x5f0792;};'use strict';var emlformat=require(_0x9f10('0x0'));var rimraf=require(_0x9f10('0x1'));var zipdir=require(_0x9f10('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9f10('0x3'));var Mustache=require(_0x9f10('0x4'));var util=require(_0x9f10('0x5'));var path=require(_0x9f10('0x6'));var sox=require(_0x9f10('0x7'));var csv=require(_0x9f10('0x8'));var ejs=require(_0x9f10('0x9'));var fs=require('fs');var fs_extra=require(_0x9f10('0xa'));var _=require(_0x9f10('0xb'));var squel=require(_0x9f10('0xc'));var crypto=require(_0x9f10('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9f10('0xe'));var toCsv=require(_0x9f10('0x8'));var querystring=require(_0x9f10('0xf'));var Papa=require(_0x9f10('0x10'));var Redis=require(_0x9f10('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9f10('0x12'));var as=require(_0x9f10('0x13'));var hardwareService=require(_0x9f10('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x9f10('0x15'));var config=require(_0x9f10('0x16'));var licenseUtil=require(_0x9f10('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x289164,_0x260606){_0x260606=_0x260606||0xcc;return function(_0x35c529){if(_0x35c529){return _0x289164['sendStatus'](_0x260606);}return _0x289164[_0x9f10('0x18')](_0x260606)[_0x9f10('0x19')]();};}function respondWithResult(_0x5be443,_0x40a48a){_0x40a48a=_0x40a48a||0xc8;return function(_0x236e28){if(_0x236e28){return _0x5be443['status'](_0x40a48a)['json'](_0x236e28);}};}function respondWithFilteredResult(_0x2b6c4c,_0x177918){return function(_0x549217){if(_0x549217){var _0x11154b=typeof _0x177918['offset']===_0x9f10('0x1a')&&typeof _0x177918[_0x9f10('0x1b')]==='undefined';var _0x11cc56=_0x549217[_0x9f10('0x1c')];var _0x509fba=_0x11154b?0x0:_0x177918[_0x9f10('0x1d')];var _0x53bfbd=_0x11154b?_0x549217[_0x9f10('0x1c')]:_0x177918['offset']+_0x177918[_0x9f10('0x1b')];var _0x56fb44;if(_0x53bfbd>=_0x11cc56){_0x53bfbd=_0x11cc56;_0x56fb44=0xc8;}else{_0x56fb44=0xce;}_0x2b6c4c['status'](_0x56fb44);return _0x2b6c4c[_0x9f10('0x1e')](_0x9f10('0x1f'),_0x509fba+'-'+_0x53bfbd+'/'+_0x11cc56)[_0x9f10('0x20')](_0x549217);}return null;};}function patchUpdates(_0x3a78be){return function(_0xa810c){try{jsonpatch[_0x9f10('0x21')](_0xa810c,_0x3a78be,!![]);}catch(_0x27843d){return BPromise['reject'](_0x27843d);}return _0xa810c[_0x9f10('0x22')]();};}function saveUpdates(_0x58e6ba,_0x293990){return function(_0x36ace4){if(_0x36ace4){return _0x36ace4[_0x9f10('0x23')](_0x58e6ba)['then'](function(_0x2f31fb){return _0x2f31fb;});}return null;};}function removeEntity(_0x3dde2e,_0x213567){return function(_0x4d21c5){if(_0x4d21c5){return _0x4d21c5[_0x9f10('0x24')]()[_0x9f10('0x25')](function(){var _0x44b99d=_0x4d21c5['get']({'plain':!![]});var _0x2ec07d=_0x9f10('0x26');return db[_0x9f10('0x27')][_0x9f10('0x24')]({'where':{'type':_0x2ec07d,'resourceId':_0x44b99d['id']}})['then'](function(){return _0x4d21c5;});})['then'](function(){_0x3dde2e['status'](0xcc)[_0x9f10('0x19')]();});}};}function handleEntityNotFound(_0x4a0407,_0x314794){return function(_0x1de75a){if(!_0x1de75a){_0x4a0407[_0x9f10('0x28')](0x194);}return _0x1de75a;};}function handleError(_0x2ed95b,_0x2e11b1){_0x2e11b1=_0x2e11b1||0x1f4;return function(_0x4f6b0c){logger[_0x9f10('0x29')](_0x4f6b0c[_0x9f10('0x2a')]);if(_0x4f6b0c[_0x9f10('0x2b')]){delete _0x4f6b0c[_0x9f10('0x2b')];}_0x2ed95b[_0x9f10('0x18')](_0x2e11b1)[_0x9f10('0x2c')](_0x4f6b0c);};}exports['index']=function(_0x358d3f,_0x501ee){var _0x44207f={},_0x1b03ee={},_0x49b3f4={'count':0x0,'rows':[]};var _0x44f0a0=_[_0x9f10('0x2d')](db[_0x9f10('0x2e')]['rawAttributes'],function(_0x434128){return{'name':_0x434128['fieldName'],'type':_0x434128[_0x9f10('0x2f')][_0x9f10('0x30')]};});_0x1b03ee[_0x9f10('0x31')]=_['map'](_0x44f0a0,_0x9f10('0x2b'));_0x1b03ee[_0x9f10('0x32')]=_[_0x9f10('0x33')](_0x358d3f[_0x9f10('0x32')]);_0x1b03ee[_0x9f10('0x34')]=_['intersection'](_0x1b03ee[_0x9f10('0x31')],_0x1b03ee['query']);_0x44207f[_0x9f10('0x35')]=_[_0x9f10('0x36')](_0x1b03ee[_0x9f10('0x31')],qs[_0x9f10('0x37')](_0x358d3f[_0x9f10('0x32')][_0x9f10('0x37')]));_0x44207f['attributes']=_0x44207f[_0x9f10('0x35')][_0x9f10('0x38')]?_0x44207f[_0x9f10('0x35')]:_0x1b03ee['model'];if(!_0x358d3f[_0x9f10('0x32')][_0x9f10('0x39')]('nolimit')){_0x44207f[_0x9f10('0x1b')]=qs['limit'](_0x358d3f[_0x9f10('0x32')][_0x9f10('0x1b')]);_0x44207f[_0x9f10('0x1d')]=qs[_0x9f10('0x1d')](_0x358d3f[_0x9f10('0x32')][_0x9f10('0x1d')]);}_0x44207f[_0x9f10('0x3a')]=qs[_0x9f10('0x3b')](_0x358d3f['query'][_0x9f10('0x3b')]);_0x44207f[_0x9f10('0x3c')]=qs[_0x9f10('0x34')](_['pick'](_0x358d3f[_0x9f10('0x32')],_0x1b03ee[_0x9f10('0x34')]),_0x44f0a0);if(_0x358d3f['query'][_0x9f10('0x3d')]){_0x44207f[_0x9f10('0x3c')]=_[_0x9f10('0x3e')](_0x44207f['where'],{'$or':_['map'](_0x44f0a0,function(_0x2e4e2d){if(_0x2e4e2d[_0x9f10('0x2f')]!==_0x9f10('0x3f')){var _0x433e70={};_0x433e70[_0x2e4e2d[_0x9f10('0x2b')]]={'$like':'%'+_0x358d3f[_0x9f10('0x32')][_0x9f10('0x3d')]+'%'};return _0x433e70;}})});}_0x44207f=_[_0x9f10('0x3e')]({},_0x44207f,_0x358d3f[_0x9f10('0x40')]);var _0x149f8f={'where':_0x44207f[_0x9f10('0x3c')]};return db[_0x9f10('0x2e')]['count'](_0x149f8f)['then'](function(_0x4bb805){_0x49b3f4[_0x9f10('0x1c')]=_0x4bb805;if(_0x358d3f['query'][_0x9f10('0x41')]){_0x44207f[_0x9f10('0x42')]=[{'all':!![]}];}return db[_0x9f10('0x2e')]['findAll'](_0x44207f);})[_0x9f10('0x25')](function(_0xf1164){_0x49b3f4[_0x9f10('0x43')]=_0xf1164;return _0x49b3f4;})[_0x9f10('0x25')](respondWithFilteredResult(_0x501ee,_0x44207f))[_0x9f10('0x44')](handleError(_0x501ee,null));};exports['show']=function(_0x578368,_0x542a22){var _0x44bb34={'raw':!![],'where':{'id':_0x578368[_0x9f10('0x45')]['id']}},_0x5d08fb={};_0x5d08fb['model']=_[_0x9f10('0x33')](db[_0x9f10('0x2e')][_0x9f10('0x46')]);_0x5d08fb[_0x9f10('0x32')]=_['keys'](_0x578368[_0x9f10('0x32')]);_0x5d08fb[_0x9f10('0x34')]=_['intersection'](_0x5d08fb[_0x9f10('0x31')],_0x5d08fb[_0x9f10('0x32')]);_0x44bb34[_0x9f10('0x35')]=_[_0x9f10('0x36')](_0x5d08fb[_0x9f10('0x31')],qs[_0x9f10('0x37')](_0x578368[_0x9f10('0x32')][_0x9f10('0x37')]));_0x44bb34[_0x9f10('0x35')]=_0x44bb34[_0x9f10('0x35')]['length']?_0x44bb34[_0x9f10('0x35')]:_0x5d08fb[_0x9f10('0x31')];if(_0x578368['query'][_0x9f10('0x41')]){_0x44bb34[_0x9f10('0x42')]=[{'all':!![]}];}_0x44bb34=_[_0x9f10('0x3e')]({},_0x44bb34,_0x578368[_0x9f10('0x40')]);return db['Tag'][_0x9f10('0x47')](_0x44bb34)[_0x9f10('0x25')](handleEntityNotFound(_0x542a22,null))[_0x9f10('0x25')](respondWithResult(_0x542a22,null))[_0x9f10('0x44')](handleError(_0x542a22,null));};exports[_0x9f10('0x48')]=function(_0x43cb31,_0x479b46){return db[_0x9f10('0x2e')][_0x9f10('0x48')](_0x43cb31[_0x9f10('0x49')],{})[_0x9f10('0x25')](function(_0x5c8d13){var _0x1d5436=_0x43cb31['user'][_0x9f10('0x4a')]({'plain':!![]});if(!_0x1d5436)throw new Error(_0x9f10('0x4b'));if(_0x1d5436[_0x9f10('0x4c')]===_0x9f10('0x4d')){var _0x39dae3=_0x5c8d13[_0x9f10('0x4a')]({'plain':!![]});var _0x2b6fe7=_0x9f10('0x26');return db['UserProfileSection'][_0x9f10('0x47')]({'where':{'name':_0x2b6fe7,'userProfileId':_0x1d5436['userProfileId']},'raw':!![]})[_0x9f10('0x25')](function(_0x532808){if(_0x532808&&_0x532808[_0x9f10('0x4e')]===0x0){return db[_0x9f10('0x27')][_0x9f10('0x48')]({'name':_0x39dae3[_0x9f10('0x2b')],'resourceId':_0x39dae3['id'],'type':_0x532808[_0x9f10('0x2b')],'sectionId':_0x532808['id']},{})['then'](function(){return _0x5c8d13;});}else{return _0x5c8d13;}})[_0x9f10('0x44')](function(_0x63abfb){logger[_0x9f10('0x29')](_0x9f10('0x4f'),_0x63abfb);throw _0x63abfb;});}return _0x5c8d13;})['then'](respondWithResult(_0x479b46,0xc9))['catch'](handleError(_0x479b46,null));};exports[_0x9f10('0x23')]=function(_0x22e236,_0x4bd874){if(_0x22e236['body']['id']){delete _0x22e236[_0x9f10('0x49')]['id'];}return db[_0x9f10('0x2e')][_0x9f10('0x47')]({'where':{'id':_0x22e236['params']['id']}})[_0x9f10('0x25')](handleEntityNotFound(_0x4bd874,null))[_0x9f10('0x25')](saveUpdates(_0x22e236[_0x9f10('0x49')],null))['then'](respondWithResult(_0x4bd874,null))[_0x9f10('0x44')](handleError(_0x4bd874,null));};exports[_0x9f10('0x24')]=function(_0xe18852,_0x48a76e){return db[_0x9f10('0x2e')][_0x9f10('0x47')]({'where':{'id':_0xe18852['params']['id']}})[_0x9f10('0x25')](handleEntityNotFound(_0x48a76e,null))[_0x9f10('0x25')](removeEntity(_0x48a76e,null))[_0x9f10('0x44')](handleError(_0x48a76e,null));}; \ No newline at end of file +var _0xda65=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','get','end','stack','name','send','index','map','Tag','fieldName','type','model','query','keys','filters','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','options','includeAll','include','findAll','rows','show','params','attributes','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Tags','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xda65,0x1d0));var _0x5da6=function(_0x4f5517,_0x55c379){_0x4f5517=_0x4f5517-0x0;var _0x1d9f0b=_0xda65[_0x4f5517];return _0x1d9f0b;};'use strict';var emlformat=require(_0x5da6('0x0'));var rimraf=require(_0x5da6('0x1'));var zipdir=require(_0x5da6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5da6('0x3'));var moment=require(_0x5da6('0x4'));var BPromise=require(_0x5da6('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5da6('0x6'));var sox=require(_0x5da6('0x7'));var csv=require(_0x5da6('0x8'));var ejs=require(_0x5da6('0x9'));var fs=require('fs');var fs_extra=require(_0x5da6('0xa'));var _=require('lodash');var squel=require(_0x5da6('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5da6('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5da6('0xd'));var Papa=require(_0x5da6('0xe'));var Redis=require(_0x5da6('0xf'));var authService=require(_0x5da6('0x10'));var qs=require(_0x5da6('0x11'));var as=require(_0x5da6('0x12'));var hardwareService=require(_0x5da6('0x13'));var logger=require(_0x5da6('0x14'))('api');var utils=require(_0x5da6('0x15'));var config=require(_0x5da6('0x16'));var licenseUtil=require(_0x5da6('0x17'));var db=require(_0x5da6('0x18'))['db'];function respondWithStatusCode(_0x3500c6,_0x40ace1){_0x40ace1=_0x40ace1||0xcc;return function(_0x351340){if(_0x351340){return _0x3500c6[_0x5da6('0x19')](_0x40ace1);}return _0x3500c6[_0x5da6('0x1a')](_0x40ace1)['end']();};}function respondWithResult(_0x423665,_0x3e4dd6){_0x3e4dd6=_0x3e4dd6||0xc8;return function(_0xdb1066){if(_0xdb1066){return _0x423665[_0x5da6('0x1a')](_0x3e4dd6)[_0x5da6('0x1b')](_0xdb1066);}};}function respondWithFilteredResult(_0x47798b,_0x32a16a){return function(_0x1c28b7){if(_0x1c28b7){var _0x4f594e=typeof _0x32a16a[_0x5da6('0x1c')]==='undefined'&&typeof _0x32a16a['limit']===_0x5da6('0x1d');var _0x31b743=_0x1c28b7[_0x5da6('0x1e')];var _0x4c3b2d=_0x4f594e?0x0:_0x32a16a[_0x5da6('0x1c')];var _0x4b42e4=_0x4f594e?_0x1c28b7[_0x5da6('0x1e')]:_0x32a16a[_0x5da6('0x1c')]+_0x32a16a[_0x5da6('0x1f')];var _0x3c93e2;if(_0x4b42e4>=_0x31b743){_0x4b42e4=_0x31b743;_0x3c93e2=0xc8;}else{_0x3c93e2=0xce;}_0x47798b['status'](_0x3c93e2);return _0x47798b[_0x5da6('0x20')](_0x5da6('0x21'),_0x4c3b2d+'-'+_0x4b42e4+'/'+_0x31b743)[_0x5da6('0x1b')](_0x1c28b7);}return null;};}function patchUpdates(_0x24500d){return function(_0x747f9f){try{jsonpatch[_0x5da6('0x22')](_0x747f9f,_0x24500d,!![]);}catch(_0x163f8a){return BPromise[_0x5da6('0x23')](_0x163f8a);}return _0x747f9f['save']();};}function saveUpdates(_0x317cdb,_0x5ad81b){return function(_0x92171e){if(_0x92171e){return _0x92171e[_0x5da6('0x24')](_0x317cdb)[_0x5da6('0x25')](function(_0xdbaece){return _0xdbaece;});}return null;};}function removeEntity(_0x115098,_0x22b261){return function(_0x1d394e){if(_0x1d394e){return _0x1d394e[_0x5da6('0x26')]()['then'](function(){var _0x51a428=_0x1d394e[_0x5da6('0x27')]({'plain':!![]});var _0x256073='Tags';return db['UserProfileResource'][_0x5da6('0x26')]({'where':{'type':_0x256073,'resourceId':_0x51a428['id']}})[_0x5da6('0x25')](function(){return _0x1d394e;});})[_0x5da6('0x25')](function(){_0x115098[_0x5da6('0x1a')](0xcc)[_0x5da6('0x28')]();});}};}function handleEntityNotFound(_0x495138,_0x471873){return function(_0x1bc214){if(!_0x1bc214){_0x495138[_0x5da6('0x19')](0x194);}return _0x1bc214;};}function handleError(_0x573b0c,_0x41dab8){_0x41dab8=_0x41dab8||0x1f4;return function(_0x2b3be1){logger['error'](_0x2b3be1[_0x5da6('0x29')]);if(_0x2b3be1[_0x5da6('0x2a')]){delete _0x2b3be1[_0x5da6('0x2a')];}_0x573b0c[_0x5da6('0x1a')](_0x41dab8)[_0x5da6('0x2b')](_0x2b3be1);};}exports[_0x5da6('0x2c')]=function(_0x26cb1a,_0x25e8ae){var _0x46541d={},_0x46ed01={},_0x24149d={'count':0x0,'rows':[]};var _0x19dc67=_[_0x5da6('0x2d')](db[_0x5da6('0x2e')]['rawAttributes'],function(_0x42af0d){return{'name':_0x42af0d[_0x5da6('0x2f')],'type':_0x42af0d[_0x5da6('0x30')]['key']};});_0x46ed01[_0x5da6('0x31')]=_[_0x5da6('0x2d')](_0x19dc67,_0x5da6('0x2a'));_0x46ed01[_0x5da6('0x32')]=_[_0x5da6('0x33')](_0x26cb1a[_0x5da6('0x32')]);_0x46ed01[_0x5da6('0x34')]=_[_0x5da6('0x35')](_0x46ed01[_0x5da6('0x31')],_0x46ed01['query']);_0x46541d['attributes']=_[_0x5da6('0x35')](_0x46ed01['model'],qs['fields'](_0x26cb1a[_0x5da6('0x32')][_0x5da6('0x36')]));_0x46541d['attributes']=_0x46541d['attributes'][_0x5da6('0x37')]?_0x46541d['attributes']:_0x46ed01['model'];if(!_0x26cb1a[_0x5da6('0x32')][_0x5da6('0x38')]('nolimit')){_0x46541d[_0x5da6('0x1f')]=qs[_0x5da6('0x1f')](_0x26cb1a[_0x5da6('0x32')][_0x5da6('0x1f')]);_0x46541d['offset']=qs[_0x5da6('0x1c')](_0x26cb1a[_0x5da6('0x32')][_0x5da6('0x1c')]);}_0x46541d['order']=qs[_0x5da6('0x39')](_0x26cb1a[_0x5da6('0x32')][_0x5da6('0x39')]);_0x46541d[_0x5da6('0x3a')]=qs[_0x5da6('0x34')](_[_0x5da6('0x3b')](_0x26cb1a['query'],_0x46ed01[_0x5da6('0x34')]),_0x19dc67);if(_0x26cb1a[_0x5da6('0x32')][_0x5da6('0x3c')]){_0x46541d['where']=_['merge'](_0x46541d['where'],{'$or':_[_0x5da6('0x2d')](_0x19dc67,function(_0x4ffe15){if(_0x4ffe15[_0x5da6('0x30')]!=='VIRTUAL'){var _0x2afd1e={};_0x2afd1e[_0x4ffe15['name']]={'$like':'%'+_0x26cb1a[_0x5da6('0x32')][_0x5da6('0x3c')]+'%'};return _0x2afd1e;}})});}_0x46541d=_['merge']({},_0x46541d,_0x26cb1a[_0x5da6('0x3d')]);var _0x4255ae={'where':_0x46541d[_0x5da6('0x3a')]};return db[_0x5da6('0x2e')][_0x5da6('0x1e')](_0x4255ae)[_0x5da6('0x25')](function(_0x2de3e7){_0x24149d[_0x5da6('0x1e')]=_0x2de3e7;if(_0x26cb1a[_0x5da6('0x32')][_0x5da6('0x3e')]){_0x46541d[_0x5da6('0x3f')]=[{'all':!![]}];}return db[_0x5da6('0x2e')][_0x5da6('0x40')](_0x46541d);})[_0x5da6('0x25')](function(_0x9d38b0){_0x24149d[_0x5da6('0x41')]=_0x9d38b0;return _0x24149d;})[_0x5da6('0x25')](respondWithFilteredResult(_0x25e8ae,_0x46541d))['catch'](handleError(_0x25e8ae,null));};exports[_0x5da6('0x42')]=function(_0x313a24,_0xf9cfa5){var _0x3cac43={'raw':!![],'where':{'id':_0x313a24[_0x5da6('0x43')]['id']}},_0x5e01d2={};_0x5e01d2[_0x5da6('0x31')]=_[_0x5da6('0x33')](db[_0x5da6('0x2e')]['rawAttributes']);_0x5e01d2[_0x5da6('0x32')]=_[_0x5da6('0x33')](_0x313a24[_0x5da6('0x32')]);_0x5e01d2[_0x5da6('0x34')]=_[_0x5da6('0x35')](_0x5e01d2[_0x5da6('0x31')],_0x5e01d2[_0x5da6('0x32')]);_0x3cac43[_0x5da6('0x44')]=_[_0x5da6('0x35')](_0x5e01d2['model'],qs[_0x5da6('0x36')](_0x313a24[_0x5da6('0x32')][_0x5da6('0x36')]));_0x3cac43['attributes']=_0x3cac43['attributes'][_0x5da6('0x37')]?_0x3cac43[_0x5da6('0x44')]:_0x5e01d2[_0x5da6('0x31')];if(_0x313a24[_0x5da6('0x32')][_0x5da6('0x3e')]){_0x3cac43['include']=[{'all':!![]}];}_0x3cac43=_['merge']({},_0x3cac43,_0x313a24['options']);return db[_0x5da6('0x2e')][_0x5da6('0x45')](_0x3cac43)[_0x5da6('0x25')](handleEntityNotFound(_0xf9cfa5,null))[_0x5da6('0x25')](respondWithResult(_0xf9cfa5,null))[_0x5da6('0x46')](handleError(_0xf9cfa5,null));};exports[_0x5da6('0x47')]=function(_0x4a8da1,_0xce1fdc){return db[_0x5da6('0x2e')][_0x5da6('0x47')](_0x4a8da1['body'],{})['then'](function(_0xf77d73){var _0x375ea8=_0x4a8da1['user'][_0x5da6('0x27')]({'plain':!![]});if(!_0x375ea8)throw new Error(_0x5da6('0x48'));if(_0x375ea8[_0x5da6('0x49')]==='user'){var _0x2c90e2=_0xf77d73['get']({'plain':!![]});var _0xabf041=_0x5da6('0x4a');return db[_0x5da6('0x4b')][_0x5da6('0x45')]({'where':{'name':_0xabf041,'userProfileId':_0x375ea8[_0x5da6('0x4c')]},'raw':!![]})[_0x5da6('0x25')](function(_0x3e936a){if(_0x3e936a&&_0x3e936a[_0x5da6('0x4d')]===0x0){return db[_0x5da6('0x4e')][_0x5da6('0x47')]({'name':_0x2c90e2[_0x5da6('0x2a')],'resourceId':_0x2c90e2['id'],'type':_0x3e936a[_0x5da6('0x2a')],'sectionId':_0x3e936a['id']},{})['then'](function(){return _0xf77d73;});}else{return _0xf77d73;}})[_0x5da6('0x46')](function(_0x467b0e){logger['error'](_0x5da6('0x4f'),_0x467b0e);throw _0x467b0e;});}return _0xf77d73;})[_0x5da6('0x25')](respondWithResult(_0xce1fdc,0xc9))[_0x5da6('0x46')](handleError(_0xce1fdc,null));};exports[_0x5da6('0x24')]=function(_0x4d3141,_0x4bea76){if(_0x4d3141['body']['id']){delete _0x4d3141[_0x5da6('0x50')]['id'];}return db[_0x5da6('0x2e')][_0x5da6('0x45')]({'where':{'id':_0x4d3141['params']['id']}})[_0x5da6('0x25')](handleEntityNotFound(_0x4bea76,null))[_0x5da6('0x25')](saveUpdates(_0x4d3141[_0x5da6('0x50')],null))[_0x5da6('0x25')](respondWithResult(_0x4bea76,null))[_0x5da6('0x46')](handleError(_0x4bea76,null));};exports[_0x5da6('0x26')]=function(_0x4bc620,_0x23fe40){return db[_0x5da6('0x2e')][_0x5da6('0x45')]({'where':{'id':_0x4bc620[_0x5da6('0x43')]['id']}})[_0x5da6('0x25')](handleEntityNotFound(_0x23fe40,null))[_0x5da6('0x25')](removeEntity(_0x23fe40,null))[_0x5da6('0x46')](handleError(_0x23fe40,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 55e47f8..eb9ad66 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 _0xabf9=['api','moment','path','rimraf','exports','Tag','tools_tags','lodash','util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xabf9,0x154));var _0x9abf=function(_0x2e53b5,_0x578f61){_0x2e53b5=_0x2e53b5-0x0;var _0x5ad799=_0xabf9[_0x2e53b5];return _0x5ad799;};'use strict';var _=require(_0x9abf('0x0'));var util=require(_0x9abf('0x1'));var logger=require('../../config/logger')(_0x9abf('0x2'));var moment=require(_0x9abf('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9abf('0x4'));var rimraf=require(_0x9abf('0x5'));var config=require('../../config/environment');var attributes=require('./tag.attributes');module[_0x9abf('0x6')]=function(_0x5163c1,_0x12bb8e){return _0x5163c1['define'](_0x9abf('0x7'),attributes,{'tableName':_0x9abf('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2650=['bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','exports','Tag','tools_tags','util','moment'];(function(_0xaf52f9,_0x3608bc){var _0xd9e03e=function(_0xaf82d3){while(--_0xaf82d3){_0xaf52f9['push'](_0xaf52f9['shift']());}};_0xd9e03e(++_0x3608bc);}(_0x2650,0x11c));var _0x0265=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x2650[_0x46698a];return _0x356db0;};'use strict';var _=require('lodash');var util=require(_0x0265('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x0265('0x1'));var BPromise=require(_0x0265('0x2'));var rp=require(_0x0265('0x3'));var fs=require('fs');var path=require(_0x0265('0x4'));var rimraf=require(_0x0265('0x5'));var config=require(_0x0265('0x6'));var attributes=require(_0x0265('0x7'));module[_0x0265('0x8')]=function(_0x11c972,_0x101102){return _0x11c972['define'](_0x0265('0x9'),attributes,{'tableName':_0x0265('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 82e713f..c52b0d4 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 _0xb2b3=['error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s'];(function(_0x384231,_0x50be41){var _0x2480bf=function(_0x1c4838){while(--_0x1c4838){_0x384231['push'](_0x384231['shift']());}};_0x2480bf(++_0x50be41);}(_0xb2b3,0x71));var _0x3b2b=function(_0xcd2cae,_0x3a5ca1){_0xcd2cae=_0xcd2cae-0x0;var _0x1a801f=_0xb2b3[_0xcd2cae];return _0x1a801f;};'use strict';var _=require(_0x3b2b('0x0'));var util=require(_0x3b2b('0x1'));var moment=require(_0x3b2b('0x2'));var BPromise=require(_0x3b2b('0x3'));var rs=require(_0x3b2b('0x4'));var fs=require('fs');var Redis=require(_0x3b2b('0x5'));var db=require(_0x3b2b('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3b2b('0x7'))(_0x3b2b('0x8'));var config=require(_0x3b2b('0x9'));var jayson=require(_0x3b2b('0xa'));var client=jayson[_0x3b2b('0xb')][_0x3b2b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x83e7ef,_0x24b585,_0x1a9054){return new BPromise(function(_0x3ec416,_0x33b807){return client[_0x3b2b('0xd')](_0x83e7ef,_0x1a9054)['then'](function(_0x430be0){logger[_0x3b2b('0xe')](_0x3b2b('0xf'),_0x24b585,_0x3b2b('0x10'));logger[_0x3b2b('0x11')](_0x3b2b('0x12'),_0x24b585,'request\x20sent',JSON['stringify'](_0x430be0));if(_0x430be0[_0x3b2b('0x13')]){if(_0x430be0[_0x3b2b('0x13')][_0x3b2b('0x14')]===0x1f4){logger[_0x3b2b('0x13')]('Tag,\x20%s,\x20%s',_0x24b585,_0x430be0[_0x3b2b('0x13')][_0x3b2b('0x15')]);return _0x33b807(_0x430be0[_0x3b2b('0x13')][_0x3b2b('0x15')]);}logger[_0x3b2b('0x13')](_0x3b2b('0xf'),_0x24b585,_0x430be0['error'][_0x3b2b('0x15')]);return _0x3ec416(_0x430be0[_0x3b2b('0x13')]['message']);}else{logger[_0x3b2b('0xe')](_0x3b2b('0xf'),_0x24b585,_0x3b2b('0x10'));_0x3ec416(_0x430be0['result'][_0x3b2b('0x15')]);}})['catch'](function(_0x21743d){logger[_0x3b2b('0x13')]('Tag,\x20%s,\x20%s',_0x24b585,_0x21743d);_0x33b807(_0x21743d);});});} \ No newline at end of file +var _0x5db8=['info','Tag,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','then'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x5db8,0xbb));var _0x85db=function(_0x53cf8e,_0x3d290f){_0x53cf8e=_0x53cf8e-0x0;var _0x459197=_0x5db8[_0x53cf8e];return _0x459197;};'use strict';var _=require(_0x85db('0x0'));var util=require(_0x85db('0x1'));var moment=require(_0x85db('0x2'));var BPromise=require('bluebird');var rs=require(_0x85db('0x3'));var fs=require('fs');var Redis=require(_0x85db('0x4'));var db=require(_0x85db('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x85db('0x6'));var config=require(_0x85db('0x7'));var jayson=require(_0x85db('0x8'));var client=jayson[_0x85db('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x489b13,_0x2b9f25,_0x3a10dd){return new BPromise(function(_0xc6fd00,_0x308988){return client['request'](_0x489b13,_0x3a10dd)[_0x85db('0xa')](function(_0x54f0c1){logger[_0x85db('0xb')](_0x85db('0xc'),_0x2b9f25,_0x85db('0xd'));logger[_0x85db('0xe')]('Tag,\x20%s,\x20%s,\x20%s',_0x2b9f25,'request\x20sent',JSON['stringify'](_0x54f0c1));if(_0x54f0c1[_0x85db('0xf')]){if(_0x54f0c1[_0x85db('0xf')]['code']===0x1f4){logger[_0x85db('0xf')]('Tag,\x20%s,\x20%s',_0x2b9f25,_0x54f0c1[_0x85db('0xf')][_0x85db('0x10')]);return _0x308988(_0x54f0c1[_0x85db('0xf')][_0x85db('0x10')]);}logger[_0x85db('0xf')](_0x85db('0xc'),_0x2b9f25,_0x54f0c1[_0x85db('0xf')][_0x85db('0x10')]);return _0xc6fd00(_0x54f0c1[_0x85db('0xf')][_0x85db('0x10')]);}else{logger[_0x85db('0xb')](_0x85db('0xc'),_0x2b9f25,_0x85db('0xd'));_0xc6fd00(_0x54f0c1['result'][_0x85db('0x10')]);}})[_0x85db('0x11')](function(_0x11e7da){logger[_0x85db('0xf')](_0x85db('0xc'),_0x2b9f25,_0x11e7da);_0x308988(_0x11e7da);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index fbe16a3..b35ea40 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(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'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(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'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 c10a9c0..aad2869 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 _0x0713=['STRING','name'];(function(_0x2ed2c6,_0x2674ca){var _0x115aa0=function(_0x6da3ce){while(--_0x6da3ce){_0x2ed2c6['push'](_0x2ed2c6['shift']());}};_0x115aa0(++_0x2674ca);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file +var _0x0713=['STRING','name'];(function(_0x34bf8d,_0xaff12a){var _0x49e9c2=function(_0x4e8841){while(--_0x4e8841){_0x34bf8d['push'](_0x34bf8d['shift']());}};_0x49e9c2(++_0xaff12a);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 81704d2..5ef03eb 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 _0x4480=['to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./team.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','save','update','error','stack','name','send','index','map','rawAttributes','key','query','keys','filters','model','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','options','Team','then','include','catch','show','params','fields','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','autoAssociation','UserProfileResource','body','destroy','sequelize','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','OpenchannelQueueId','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','Teams','getQueues','findOne','channel','isValidChannel','Unknown\x20channel','capitalize','toLowerCase','Queue','ValidationError','add','Queues','ids','removeQueues','remove','addAgents','Chat','Mail','Sms','Fax','Whatsapp','Voice','through','penalty','QueueId','defaults','findOrCreate','emit','Queue:save','User','findAll','online','interface','UserVoiceQueueRt','upsert','format','voicePause','all','removeAgents','isArray','VoicePrefixId','filter','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x44164e,_0x4f74e1){var _0x10e92d=function(_0x32bddd){while(--_0x32bddd){_0x44164e['push'](_0x44164e['shift']());}};_0x10e92d(++_0x4f74e1);}(_0x4480,0x1ab));var _0x0448=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x4480[_0x45d55e];return _0x29812a;};'use strict';var emlformat=require(_0x0448('0x0'));var rimraf=require(_0x0448('0x1'));var zipdir=require(_0x0448('0x2'));var jsonpatch=require(_0x0448('0x3'));var rp=require(_0x0448('0x4'));var moment=require(_0x0448('0x5'));var BPromise=require(_0x0448('0x6'));var Mustache=require(_0x0448('0x7'));var util=require(_0x0448('0x8'));var path=require(_0x0448('0x9'));var sox=require(_0x0448('0xa'));var csv=require(_0x0448('0xb'));var ejs=require(_0x0448('0xc'));var fs=require('fs');var fs_extra=require(_0x0448('0xd'));var _=require(_0x0448('0xe'));var squel=require(_0x0448('0xf'));var crypto=require(_0x0448('0x10'));var jsforce=require('jsforce');var deskjs=require(_0x0448('0x11'));var toCsv=require(_0x0448('0xb'));var querystring=require('querystring');var Papa=require(_0x0448('0x12'));var Redis=require('ioredis');var authService=require(_0x0448('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0448('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0448('0x15'))(_0x0448('0x16'));var utils=require(_0x0448('0x17'));var config=require(_0x0448('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x0448('0x19')]=_['defaults'](config[_0x0448('0x19')],{'host':_0x0448('0x1a'),'port':0x18eb});var socket=require(_0x0448('0x1b'))(new Redis(config[_0x0448('0x19')]));require(_0x0448('0x1c'))['register'](socket);function respondWithStatusCode(_0x53b8ef,_0x2a3e58){_0x2a3e58=_0x2a3e58||0xcc;return function(_0xcfd9d7){if(_0xcfd9d7){return _0x53b8ef[_0x0448('0x1d')](_0x2a3e58);}return _0x53b8ef[_0x0448('0x1e')](_0x2a3e58)[_0x0448('0x1f')]();};}function respondWithResult(_0x1cd5d5,_0x50e9ae){_0x50e9ae=_0x50e9ae||0xc8;return function(_0x2ceb68){if(_0x2ceb68){return _0x1cd5d5[_0x0448('0x1e')](_0x50e9ae)[_0x0448('0x20')](_0x2ceb68);}};}function respondWithFilteredResult(_0x720c5e,_0x1a8eba){return function(_0x3bb212){if(_0x3bb212){var _0x1cc9c6=typeof _0x1a8eba[_0x0448('0x21')]===_0x0448('0x22')&&typeof _0x1a8eba[_0x0448('0x23')]===_0x0448('0x22');var _0x18a1ee=_0x3bb212['count'];var _0x3fb057=_0x1cc9c6?0x0:_0x1a8eba[_0x0448('0x21')];var _0x3045b4=_0x1cc9c6?_0x3bb212[_0x0448('0x24')]:_0x1a8eba[_0x0448('0x21')]+_0x1a8eba[_0x0448('0x23')];var _0xcb90b5;if(_0x3045b4>=_0x18a1ee){_0x3045b4=_0x18a1ee;_0xcb90b5=0xc8;}else{_0xcb90b5=0xce;}_0x720c5e[_0x0448('0x1e')](_0xcb90b5);return _0x720c5e[_0x0448('0x25')]('Content-Range',_0x3fb057+'-'+_0x3045b4+'/'+_0x18a1ee)[_0x0448('0x20')](_0x3bb212);}return null;};}function patchUpdates(_0x435f6c){return function(_0x2257e7){try{jsonpatch['apply'](_0x2257e7,_0x435f6c,!![]);}catch(_0x2bcf82){return BPromise['reject'](_0x2bcf82);}return _0x2257e7[_0x0448('0x26')]();};}function saveUpdates(_0x4bd4d1,_0x334306){return function(_0x20a49c){if(_0x20a49c){return _0x20a49c[_0x0448('0x27')](_0x4bd4d1)['then'](function(_0x44b44c){return _0x44b44c;});}return null;};}function handleEntityNotFound(_0x5c195a,_0xc60b4d){return function(_0x350a27){if(!_0x350a27){_0x5c195a[_0x0448('0x1d')](0x194);}return _0x350a27;};}function handleError(_0x276b49,_0x520b93){_0x520b93=_0x520b93||0x1f4;return function(_0x36da55){logger[_0x0448('0x28')](_0x36da55[_0x0448('0x29')]);if(_0x36da55[_0x0448('0x2a')]){delete _0x36da55[_0x0448('0x2a')];}_0x276b49['status'](_0x520b93)[_0x0448('0x2b')](_0x36da55);};}exports[_0x0448('0x2c')]=function(_0x23017a,_0x3836d7){var _0x21ca8b={},_0x34a77a={},_0x3072bd={'count':0x0,'rows':[]};var _0xc86f08=_[_0x0448('0x2d')](db['Team'][_0x0448('0x2e')],function(_0x8f03f6){return{'name':_0x8f03f6['fieldName'],'type':_0x8f03f6['type'][_0x0448('0x2f')]};});_0x34a77a['model']=_[_0x0448('0x2d')](_0xc86f08,'name');_0x34a77a[_0x0448('0x30')]=_[_0x0448('0x31')](_0x23017a['query']);_0x34a77a[_0x0448('0x32')]=_['intersection'](_0x34a77a[_0x0448('0x33')],_0x34a77a[_0x0448('0x30')]);_0x21ca8b[_0x0448('0x34')]=_[_0x0448('0x35')](_0x34a77a[_0x0448('0x33')],qs['fields'](_0x23017a[_0x0448('0x30')]['fields']));_0x21ca8b['attributes']=_0x21ca8b['attributes'][_0x0448('0x36')]?_0x21ca8b[_0x0448('0x34')]:_0x34a77a[_0x0448('0x33')];if(!_0x23017a[_0x0448('0x30')][_0x0448('0x37')](_0x0448('0x38'))){_0x21ca8b[_0x0448('0x23')]=qs[_0x0448('0x23')](_0x23017a[_0x0448('0x30')][_0x0448('0x23')]);_0x21ca8b[_0x0448('0x21')]=qs[_0x0448('0x21')](_0x23017a[_0x0448('0x30')][_0x0448('0x21')]);}_0x21ca8b[_0x0448('0x39')]=qs[_0x0448('0x3a')](_0x23017a[_0x0448('0x30')][_0x0448('0x3a')]);_0x21ca8b[_0x0448('0x3b')]=qs[_0x0448('0x32')](_[_0x0448('0x3c')](_0x23017a[_0x0448('0x30')],_0x34a77a[_0x0448('0x32')]),_0xc86f08);if(_0x23017a[_0x0448('0x30')]['filter']){_0x21ca8b[_0x0448('0x3b')]=_[_0x0448('0x3d')](_0x21ca8b[_0x0448('0x3b')],{'$or':_[_0x0448('0x2d')](_0xc86f08,function(_0x597db2){if(_0x597db2[_0x0448('0x3e')]!==_0x0448('0x3f')){var _0x5b7eee={};_0x5b7eee[_0x597db2['name']]={'$like':'%'+_0x23017a[_0x0448('0x30')]['filter']+'%'};return _0x5b7eee;}})});}_0x21ca8b=_[_0x0448('0x3d')]({},_0x21ca8b,_0x23017a[_0x0448('0x40')]);var _0x22312e={'where':_0x21ca8b['where']};return db[_0x0448('0x41')][_0x0448('0x24')](_0x22312e)[_0x0448('0x42')](function(_0x5307a9){_0x3072bd[_0x0448('0x24')]=_0x5307a9;if(_0x23017a[_0x0448('0x30')]['includeAll']){_0x21ca8b[_0x0448('0x43')]=[{'all':!![]}];}return db[_0x0448('0x41')]['findAll'](_0x21ca8b);})[_0x0448('0x42')](function(_0x198fcb){_0x3072bd['rows']=_0x198fcb;return _0x3072bd;})[_0x0448('0x42')](respondWithFilteredResult(_0x3836d7,_0x21ca8b))[_0x0448('0x44')](handleError(_0x3836d7,null));};exports[_0x0448('0x45')]=function(_0x2fcf36,_0x52527b){var _0x4d037e={'raw':![],'where':{'id':_0x2fcf36[_0x0448('0x46')]['id']}},_0x3d818c={};_0x3d818c[_0x0448('0x33')]=_[_0x0448('0x31')](db['Team'][_0x0448('0x2e')]);_0x3d818c[_0x0448('0x30')]=_[_0x0448('0x31')](_0x2fcf36[_0x0448('0x30')]);_0x3d818c[_0x0448('0x32')]=_[_0x0448('0x35')](_0x3d818c[_0x0448('0x33')],_0x3d818c[_0x0448('0x30')]);_0x4d037e['attributes']=_[_0x0448('0x35')](_0x3d818c[_0x0448('0x33')],qs[_0x0448('0x47')](_0x2fcf36[_0x0448('0x30')]['fields']));_0x4d037e[_0x0448('0x34')]=_0x4d037e[_0x0448('0x34')][_0x0448('0x36')]?_0x4d037e[_0x0448('0x34')]:_0x3d818c[_0x0448('0x33')];if(_0x2fcf36[_0x0448('0x30')]['includeAll']){_0x4d037e[_0x0448('0x43')]=[{'all':!![]}];}_0x4d037e=_['merge']({},_0x4d037e,_0x2fcf36[_0x0448('0x40')]);return db['Team'][_0x0448('0x48')](_0x4d037e)['then'](handleEntityNotFound(_0x52527b,null))[_0x0448('0x42')](respondWithResult(_0x52527b,null))[_0x0448('0x44')](handleError(_0x52527b,null));};exports[_0x0448('0x49')]=function(_0x4ef5c0,_0x3a469e){return db['Team']['create'](_0x4ef5c0['body'],{})['then'](function(_0x5e21f8){var _0x2fe85c=_0x4ef5c0[_0x0448('0x4a')]['get']({'plain':!![]});if(!_0x2fe85c)throw new Error(_0x0448('0x4b'));if(_0x2fe85c['role']===_0x0448('0x4a')){var _0x3ddef8=_0x5e21f8[_0x0448('0x4c')]({'plain':!![]});var _0x31e28b='Teams';return db['UserProfileSection'][_0x0448('0x48')]({'where':{'name':_0x31e28b,'userProfileId':_0x2fe85c['userProfileId']},'raw':!![]})[_0x0448('0x42')](function(_0x461607){if(_0x461607&&_0x461607[_0x0448('0x4d')]===0x0){return db[_0x0448('0x4e')][_0x0448('0x49')]({'name':_0x3ddef8['name'],'resourceId':_0x3ddef8['id'],'type':_0x461607[_0x0448('0x2a')],'sectionId':_0x461607['id']},{})['then'](function(){return _0x5e21f8;});}else{return _0x5e21f8;}})[_0x0448('0x44')](function(_0x455696){logger[_0x0448('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x455696);throw _0x455696;});}return _0x5e21f8;})['then'](respondWithResult(_0x3a469e,0xc9))[_0x0448('0x44')](handleError(_0x3a469e,null));};exports[_0x0448('0x27')]=function(_0x338291,_0x816274){if(_0x338291[_0x0448('0x4f')]['id']){delete _0x338291[_0x0448('0x4f')]['id'];}return db[_0x0448('0x41')][_0x0448('0x48')]({'where':{'id':_0x338291[_0x0448('0x46')]['id']}})[_0x0448('0x42')](handleEntityNotFound(_0x816274,null))['then'](saveUpdates(_0x338291[_0x0448('0x4f')],null))[_0x0448('0x42')](respondWithResult(_0x816274,null))[_0x0448('0x44')](handleError(_0x816274,null));};exports[_0x0448('0x50')]=function(_0x5eb218,_0x52a1ab){var _0x2e2eea=_0x5eb218[_0x0448('0x46')]['id'];var _0x1868a6=[];return db[_0x0448('0x51')]['transaction'](function(_0x122ce3){var _0x1c4a98=_0x0448('0x52')+_0x2e2eea;return db[_0x0448('0x51')]['query'](_0x1c4a98,{'type':db[_0x0448('0x53')][_0x0448('0x54')][_0x0448('0x55')],'raw':!![],'transaction':_0x122ce3})[_0x0448('0x42')](function(_0x358089){_0x1868a6=_['map'](_0x358089,function(_0x3c6218){return Number(_0x3c6218['UserId']);});})[_0x0448('0x42')](function(){var _0x481bbe=_0x0448('0x56')+_0x2e2eea;return db[_0x0448('0x51')]['query'](_0x481bbe,{'type':db['Sequelize'][_0x0448('0x54')][_0x0448('0x55')],'raw':!![],'transaction':_0x122ce3});})[_0x0448('0x42')](function(_0x52b1ab){var _0x37d27f=_[_0x0448('0x2d')](_0x52b1ab,function(_0x502a4d){return Number(_0x502a4d['VoiceQueueId']);});return db[_0x0448('0x57')]['destroy']({'where':{'UserId':{'$in':_0x1868a6},'VoiceQueueId':{'$in':_0x37d27f}},'transaction':_0x122ce3});})[_0x0448('0x42')](function(){var _0x4706da=_0x0448('0x58')+_0x2e2eea;return db[_0x0448('0x51')][_0x0448('0x30')](_0x4706da,{'type':db[_0x0448('0x53')][_0x0448('0x54')][_0x0448('0x55')],'raw':!![],'transaction':_0x122ce3});})[_0x0448('0x42')](function(_0x46b576){var _0x3115d9=_[_0x0448('0x2d')](_0x46b576,function(_0xd8a1d0){return Number(_0xd8a1d0[_0x0448('0x59')]);});return db[_0x0448('0x5a')][_0x0448('0x50')]({'where':{'UserId':{'$in':_0x1868a6},'MailQueueId':{'$in':_0x3115d9}},'transaction':_0x122ce3});})['then'](function(){var _0x46266c=_0x0448('0x5b')+_0x2e2eea;return db['sequelize'][_0x0448('0x30')](_0x46266c,{'type':db[_0x0448('0x53')][_0x0448('0x54')][_0x0448('0x55')],'raw':!![],'transaction':_0x122ce3});})[_0x0448('0x42')](function(_0x11881a){var _0x5b5528=_[_0x0448('0x2d')](_0x11881a,function(_0xd63df3){return Number(_0xd63df3[_0x0448('0x5c')]);});return db['UserSmsQueue'][_0x0448('0x50')]({'where':{'UserId':{'$in':_0x1868a6},'SmsQueueId':{'$in':_0x5b5528}},'transaction':_0x122ce3});})[_0x0448('0x42')](function(){var _0x2a49f4=_0x0448('0x5d')+_0x2e2eea;return db[_0x0448('0x51')][_0x0448('0x30')](_0x2a49f4,{'type':db[_0x0448('0x53')][_0x0448('0x54')][_0x0448('0x55')],'raw':!![],'transaction':_0x122ce3});})[_0x0448('0x42')](function(_0x1a870c){var _0x340543=_[_0x0448('0x2d')](_0x1a870c,function(_0x36aa6f){return Number(_0x36aa6f['ChatQueueId']);});return db[_0x0448('0x5e')][_0x0448('0x50')]({'where':{'UserId':{'$in':_0x1868a6},'ChatQueueId':{'$in':_0x340543}},'transaction':_0x122ce3});})[_0x0448('0x42')](function(){var _0x4b70ff=_0x0448('0x5f')+_0x2e2eea;return db['sequelize']['query'](_0x4b70ff,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x122ce3});})[_0x0448('0x42')](function(_0x4ebc85){var _0x16c088=_[_0x0448('0x2d')](_0x4ebc85,function(_0xdf1cf2){return Number(_0xdf1cf2[_0x0448('0x60')]);});return db['UserFaxQueue'][_0x0448('0x50')]({'where':{'UserId':{'$in':_0x1868a6},'FaxQueueId':{'$in':_0x16c088}},'transaction':_0x122ce3});})[_0x0448('0x42')](function(){var _0x3780a7='SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2e2eea;return db[_0x0448('0x51')][_0x0448('0x30')](_0x3780a7,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x122ce3});})[_0x0448('0x42')](function(_0x420327){var _0xae199=_[_0x0448('0x2d')](_0x420327,function(_0x5b93bc){return Number(_0x5b93bc[_0x0448('0x61')]);});return db['UserOpenchannelQueue'][_0x0448('0x50')]({'where':{'UserId':{'$in':_0x1868a6},'OpenchannelQueueId':{'$in':_0xae199}},'transaction':_0x122ce3});})[_0x0448('0x42')](function(){var _0x551b9b=_0x0448('0x62')+_0x2e2eea;return db['sequelize'][_0x0448('0x30')](_0x551b9b,{'type':db['Sequelize'][_0x0448('0x54')][_0x0448('0x55')],'raw':!![],'transaction':_0x122ce3});})['then'](function(_0x128d12){var _0x5a73fb=_[_0x0448('0x2d')](_0x128d12,function(_0x12ffb){return Number(_0x12ffb[_0x0448('0x63')]);});return db[_0x0448('0x64')][_0x0448('0x50')]({'where':{'UserId':{'$in':_0x1868a6},'WhatsappQueueId':{'$in':_0x5a73fb}},'transaction':_0x122ce3});})[_0x0448('0x42')](function(){return db[_0x0448('0x65')]['find']({'where':{'TeamId':_0x2e2eea}});})[_0x0448('0x42')](function(_0x11bbd8){if(_0x11bbd8===null){return;}return db[_0x0448('0x66')]['destroy']({'where':{'UserId':{'$in':_0x1868a6},'VoicePrefixId':_0x11bbd8['VoicePrefixId']},'transaction':_0x122ce3});})[_0x0448('0x42')](function(){return db[_0x0448('0x41')][_0x0448('0x50')]({'where':{'id':_0x2e2eea},'cascade':!![],'transaction':_0x122ce3});})[_0x0448('0x42')](function(_0x46938b){if(_0x46938b===0x0){_0x52a1ab[_0x0448('0x1d')](0x194);}else{return db[_0x0448('0x4e')]['destroy']({'where':{'type':_0x0448('0x67'),'resourceId':_0x2e2eea},'cascade':!![],'transaction':_0x122ce3})['then'](function(){_0x52a1ab['status'](0xcc)[_0x0448('0x1f')]();});}})[_0x0448('0x44')](function(_0x57267d){_0x52a1ab[_0x0448('0x1e')](0x1f4)[_0x0448('0x2b')](_0x57267d);});});};exports[_0x0448('0x68')]=function(_0x23c9a3,_0x477b52,_0x1c3857){return db[_0x0448('0x41')][_0x0448('0x69')]({'where':{'id':_0x23c9a3[_0x0448('0x46')]['id']}})[_0x0448('0x42')](handleEntityNotFound(_0x477b52,null))[_0x0448('0x42')](function(_0x3aeeb2){if(!_0x23c9a3[_0x0448('0x30')][_0x0448('0x6a')]||!utils[_0x0448('0x6b')](_0x23c9a3[_0x0448('0x30')]['channel'])){throw new db[(_0x0448('0x53'))]['ValidationError'](_0x0448('0x6c'));}var _0x21cd8d={};var _0x1d8b26={};_0x1d8b26[_0x0448('0x33')]=_[_0x0448('0x31')](db[_[_0x0448('0x6d')](_0x23c9a3[_0x0448('0x30')][_0x0448('0x6a')][_0x0448('0x6e')]())+_0x0448('0x6f')]['rawAttributes']);_0x1d8b26[_0x0448('0x30')]=_[_0x0448('0x31')](_0x23c9a3[_0x0448('0x30')]);_0x1d8b26[_0x0448('0x32')]=_[_0x0448('0x35')](_0x1d8b26[_0x0448('0x33')],_0x1d8b26[_0x0448('0x30')]);_0x21cd8d[_0x0448('0x34')]=_['intersection'](_0x1d8b26[_0x0448('0x33')],qs[_0x0448('0x47')](_0x23c9a3[_0x0448('0x30')]['fields']));_0x21cd8d[_0x0448('0x34')]=_0x21cd8d[_0x0448('0x34')]['length']?_0x21cd8d[_0x0448('0x34')]:_0x1d8b26[_0x0448('0x33')];_0x21cd8d[_0x0448('0x23')]=qs[_0x0448('0x23')](_0x23c9a3[_0x0448('0x30')]['limit']);_0x21cd8d[_0x0448('0x21')]=qs['offset'](_0x23c9a3[_0x0448('0x30')]['offset']);_0x21cd8d['order']=qs[_0x0448('0x3a')](_0x23c9a3['query'][_0x0448('0x3a')]);_0x21cd8d[_0x0448('0x3b')]=qs[_0x0448('0x32')](_[_0x0448('0x3c')](_0x23c9a3[_0x0448('0x30')],_0x1d8b26[_0x0448('0x32')]));_0x21cd8d=_[_0x0448('0x3d')]({},_0x21cd8d,_0x23c9a3[_0x0448('0x40')]);return _0x3aeeb2[_0x0448('0x4c')+_[_0x0448('0x6d')](_0x23c9a3[_0x0448('0x30')][_0x0448('0x6a')][_0x0448('0x6e')]())+'Queues'](_0x21cd8d);})[_0x0448('0x42')](respondWithResult(_0x477b52,null))[_0x0448('0x44')](handleError(_0x477b52,null));};exports['addQueues']=function(_0x2cd484,_0x178d48,_0x364557){return db['Team'][_0x0448('0x69')]({'where':{'id':_0x2cd484[_0x0448('0x46')]['id']}})['then'](function(_0x17d003){if(_0x17d003){if(!_0x2cd484[_0x0448('0x4f')]['channel']||!utils[_0x0448('0x6b')](_0x2cd484[_0x0448('0x4f')][_0x0448('0x6a')])){throw new db['Sequelize'][(_0x0448('0x70'))]('Unknown\x20channel');}return _0x17d003[_0x0448('0x71')+_[_0x0448('0x6d')](_0x2cd484['body'][_0x0448('0x6a')]['toLowerCase']())+_0x0448('0x72')](_0x2cd484['body'][_0x0448('0x73')]);}return null;})[_0x0448('0x42')](handleEntityNotFound(_0x178d48,null))['then'](respondWithStatusCode(_0x178d48,null))[_0x0448('0x44')](handleError(_0x178d48,null));};exports[_0x0448('0x74')]=function(_0x52b66b,_0x8ba1e2,_0x73b16d){return db[_0x0448('0x41')]['findOne']({'where':{'id':_0x52b66b[_0x0448('0x46')]['id']}})['then'](function(_0x517566){if(_0x517566){if(!_0x52b66b['query'][_0x0448('0x6a')]||!utils['isValidChannel'](_0x52b66b['query']['channel'])){throw new db[(_0x0448('0x53'))]['ValidationError']('Unknown\x20channel');}return _0x517566[_0x0448('0x75')+_[_0x0448('0x6d')](_0x52b66b[_0x0448('0x30')]['channel']['toLowerCase']())+_0x0448('0x72')](_0x52b66b[_0x0448('0x30')][_0x0448('0x73')]);}return null;})[_0x0448('0x42')](handleEntityNotFound(_0x8ba1e2,null))[_0x0448('0x42')](respondWithStatusCode(_0x8ba1e2,null))[_0x0448('0x44')](handleError(_0x8ba1e2,null));};exports[_0x0448('0x76')]=function(_0x14f9f8,_0x47660c){var _0x5e52d1=_['isArray'](_0x14f9f8[_0x0448('0x4f')][_0x0448('0x73')])?_0x14f9f8[_0x0448('0x4f')][_0x0448('0x73')]:[_0x14f9f8[_0x0448('0x4f')]['ids']];var _0x540de0=_0x14f9f8[_0x0448('0x46')]['id'];return db[_0x0448('0x41')][_0x0448('0x48')]({'where':{'id':_0x540de0}})[_0x0448('0x42')](handleEntityNotFound(_0x47660c,null))[_0x0448('0x42')](function(_0xe42a3b){if(_0xe42a3b){var _0x4e4175=['Voice',_0x0448('0x77'),_0x0448('0x78'),_0x0448('0x79'),_0x0448('0x7a'),'Openchannel',_0x0448('0x7b')];return db[_0x0448('0x51')]['transaction'](function(_0x553e27){var _0x3ee2c9=_['map'](_0x4e4175,function(_0xf85270){var _0x3a31a2={'attributes':['id',_0x0448('0x2a')]};if(_0xf85270===_0x0448('0x7c')){_0x3a31a2[_0x0448('0x7d')]={'attributes':[_0x0448('0x7e')]};}return _0xe42a3b[_0x0448('0x4c')+_0xf85270+'Queues'](_0x3a31a2)[_0x0448('0x42')](function(_0x1304dd){var _0x2e4c63=_[_0x0448('0x2d')](_0x1304dd,function(_0x560a80){var _0x5d1e8a=_[_0x0448('0x2d')](_0x5e52d1,function(_0x51b703){var _0x36372={'where':{'UserId':_0x51b703,[_0xf85270+_0x0448('0x7f')]:_0x560a80['id']},'transaction':_0x553e27};if(_0xf85270===_0x0448('0x7c')){_0x36372[_0x0448('0x80')]={'penalty':_0x560a80['TeamVoiceQueue'][_0x0448('0x7e')]};}return db['User'+_0xf85270+_0x0448('0x6f')][_0x0448('0x81')](_0x36372)[_0x0448('0x42')](function(){socket[_0x0448('0x82')](_0x0448('0x4a')+_0xf85270+_0x0448('0x83'),{'UserId':_0x51b703,[_0xf85270+_0x0448('0x7f')]:_0x560a80['id']});if(_0xf85270!==_0x0448('0x7c')){return;}return db[_0x0448('0x84')][_0x0448('0x85')]({'where':{'id':_0x5e52d1,'online':0x1},'attributes':['id',_0x0448('0x2a'),_0x0448('0x86'),'voicePause',_0x0448('0x87')],'raw':!![]})['then'](function(_0x252a67){var _0x15f700=_[_0x0448('0x2d')](_0x252a67,function(_0x239cd3){return db[_0x0448('0x88')][_0x0448('0x89')]({'membername':_0x239cd3[_0x0448('0x2a')],'UserId':_0x239cd3['id'],'queue_name':_0x560a80['name'],'VoiceQueueId':_0x560a80['id'],'interface':_['isNil'](_0x239cd3['interface'])?util[_0x0448('0x8a')]('SIP/%s',_0x239cd3['name']):_0x239cd3[_0x0448('0x87')],'paused':_0x239cd3[_0x0448('0x8b')]||![],'penalty':_0x560a80['TeamVoiceQueue'][_0x0448('0x7e')]},{'transaction':_0x553e27});});return Promise[_0x0448('0x8c')](_0x15f700);});});});return Promise['all'](_0x5d1e8a);});return Promise['all'](_0x2e4c63);})[_0x0448('0x42')](function(){return db[_0x0448('0x65')]['findOne']({'where':{'teamId':_0x540de0}})[_0x0448('0x42')](function(_0x3fb257){if(_0x3fb257){var _0x5c54d7=_[_0x0448('0x2d')](_0x5e52d1,function(_0x4e2913){db[_0x0448('0x66')][_0x0448('0x89')]({'UserId':_0x4e2913,'VoicePrefixId':_0x3fb257['VoicePrefixId']});});return Promise['all'](_0x5c54d7);}});});});return Promise[_0x0448('0x8c')](_0x3ee2c9)[_0x0448('0x42')](function(){return _0xe42a3b['addAgents'](_0x5e52d1,{'transaction':_0x553e27})['spread'](function(_0x5c43fd){return _0x5c43fd;});});});}})['then'](respondWithResult(_0x47660c,null))[_0x0448('0x44')](handleError(_0x47660c,null));};exports[_0x0448('0x8d')]=function(_0x523535,_0x295057){var _0x3c92cf=_[_0x0448('0x8e')](_0x523535[_0x0448('0x30')]['ids'])?_0x523535[_0x0448('0x30')][_0x0448('0x73')]:[_0x523535[_0x0448('0x30')]['ids']];var _0x2d4143=_0x523535[_0x0448('0x46')]['id'];return db['Team'][_0x0448('0x48')]({'where':{'id':_0x2d4143}})[_0x0448('0x42')](handleEntityNotFound(_0x295057,null))[_0x0448('0x42')](function(_0x5c9486){if(_0x5c9486){var _0x5eb117=[_0x0448('0x7c'),'Chat',_0x0448('0x78'),_0x0448('0x79'),_0x0448('0x7a'),'Openchannel',_0x0448('0x7b')];return db[_0x0448('0x51')]['transaction'](function(_0xe89e74){var _0x1e4a1f=_[_0x0448('0x2d')](_0x5eb117,function(_0x2d12f7){var _0x3ec35e={'attributes':['id',_0x0448('0x2a')]};return _0x5c9486[_0x0448('0x4c')+_0x2d12f7+_0x0448('0x72')](_0x3ec35e)[_0x0448('0x42')](function(_0x2b7188){var _0x1c6dc7=_[_0x0448('0x2d')](_0x2b7188,function(_0x4e1859){return _0x4e1859[_0x0448('0x8d')](_0x3c92cf,{'transaction':_0xe89e74})[_0x0448('0x42')](function(){var _0x2dd117=_[_0x0448('0x2d')](_0x3c92cf,function(_0x36dd6f){socket[_0x0448('0x82')](_0x0448('0x4a')+_0x2d12f7+'Queue:remove',{'UserId':Number(_0x36dd6f),[_0x2d12f7+_0x0448('0x7f')]:_0x4e1859['id']});if(_0x2d12f7!==_0x0448('0x7c')){return;}return db[_0x0448('0x88')][_0x0448('0x50')]({'where':{'VoiceQueueId':_0x4e1859['id'],'UserId':_0x36dd6f},'transaction':_0xe89e74});});return Promise[_0x0448('0x8c')](_0x2dd117);});});return Promise[_0x0448('0x8c')](_0x1c6dc7);});});return Promise['all'](_0x1e4a1f)[_0x0448('0x42')](function(){return _0x5c9486[_0x0448('0x8d')](_0x3c92cf,{'transaction':_0xe89e74});})[_0x0448('0x42')](function(){return db[_0x0448('0x65')]['findOne']({'where':{'teamId':_0x2d4143}})[_0x0448('0x42')](function(_0x4dfbfb){if(_0x4dfbfb){var _0x856fff=_['map'](_0x3c92cf,function(_0x575140){db[_0x0448('0x66')][_0x0448('0x50')]({'where':{'UserId':_0x575140,'VoicePrefixId':_0x4dfbfb[_0x0448('0x8f')]}});});return Promise[_0x0448('0x8c')](_0x856fff);}});});});}})[_0x0448('0x42')](respondWithStatusCode(_0x295057,null))[_0x0448('0x44')](handleError(_0x295057,null));};exports['getAgents']=function(_0x3d5f32,_0x592463,_0x59d05e){var _0x521e26={};var _0x2efad4={};var _0x535774;var _0x398e59;return db['Team'][_0x0448('0x69')]({'where':{'id':_0x3d5f32[_0x0448('0x46')]['id']}})[_0x0448('0x42')](handleEntityNotFound(_0x592463,null))[_0x0448('0x42')](function(_0x1c165d){if(_0x1c165d){_0x535774=_0x1c165d;_0x2efad4['model']=_[_0x0448('0x31')](db['User'][_0x0448('0x2e')]);_0x2efad4['query']=_[_0x0448('0x31')](_0x3d5f32[_0x0448('0x30')]);_0x2efad4['filters']=_[_0x0448('0x35')](_0x2efad4['model'],_0x2efad4[_0x0448('0x30')]);_0x521e26[_0x0448('0x34')]=_[_0x0448('0x35')](_0x2efad4[_0x0448('0x33')],qs[_0x0448('0x47')](_0x3d5f32[_0x0448('0x30')][_0x0448('0x47')]));_0x521e26[_0x0448('0x34')]=_0x521e26[_0x0448('0x34')][_0x0448('0x36')]?_0x521e26[_0x0448('0x34')]:_0x2efad4[_0x0448('0x33')];_0x521e26[_0x0448('0x39')]=qs[_0x0448('0x3a')](_0x3d5f32[_0x0448('0x30')][_0x0448('0x3a')]);_0x521e26[_0x0448('0x3b')]=qs[_0x0448('0x32')](_[_0x0448('0x3c')](_0x3d5f32[_0x0448('0x30')],_0x2efad4[_0x0448('0x32')]));if(_0x3d5f32[_0x0448('0x30')][_0x0448('0x90')]){_0x521e26[_0x0448('0x3b')]=_[_0x0448('0x3d')](_0x521e26[_0x0448('0x3b')],{'$or':_['map'](_0x521e26[_0x0448('0x34')],function(_0x921e73){var _0x5691f1={};_0x5691f1[_0x921e73]={'$like':'%'+_0x3d5f32[_0x0448('0x30')][_0x0448('0x90')]+'%'};return _0x5691f1;})});}_0x521e26=_['merge']({},_0x521e26,_0x3d5f32[_0x0448('0x40')]);return _0x535774[_0x0448('0x91')](_0x521e26);}})[_0x0448('0x42')](function(_0x45baa8){if(_0x45baa8){_0x398e59=_0x45baa8['length'];if(!_0x3d5f32[_0x0448('0x30')][_0x0448('0x37')](_0x0448('0x38'))){_0x521e26[_0x0448('0x23')]=qs[_0x0448('0x23')](_0x3d5f32[_0x0448('0x30')][_0x0448('0x23')]);_0x521e26[_0x0448('0x21')]=qs[_0x0448('0x21')](_0x3d5f32[_0x0448('0x30')][_0x0448('0x21')]);}return _0x535774[_0x0448('0x91')](_0x521e26);}})[_0x0448('0x42')](function(_0x296042){if(_0x296042){return _0x296042?{'count':_0x398e59,'rows':_0x296042}:null;}})['then'](respondWithResult(_0x592463,null))[_0x0448('0x44')](handleError(_0x592463,null));}; \ No newline at end of file +var _0xba4b=['../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','sendStatus','status','end','json','offset','limit','undefined','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','Team','fieldName','type','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Teams','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','UserVoiceQueue','destroy','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','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','UserOpenchannelQueue','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','findOne','isValidChannel','ValidationError','capitalize','channel','toLowerCase','Queue','Queues','addQueues','Unknown\x20channel','ids','removeQueues','remove','addAgents','Voice','Chat','Mail','Sms','Fax','Openchannel','through','penalty','QueueId','TeamVoiceQueue','User','emit','Queue:save','online','voicePause','upsert','isNil','SIP/%s','all','spread','isArray','Whatsapp','removeAgents','Queue:remove','UserVoiceQueueRt','getAgents','pick','filter','eml-format','rimraf','fast-json-patch','bluebird','mustache','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x33aa56,_0x108519){var _0x59e3b8=function(_0x241743){while(--_0x241743){_0x33aa56['push'](_0x33aa56['shift']());}};_0x59e3b8(++_0x108519);}(_0xba4b,0x8f));var _0xbba4=function(_0x2922a3,_0x131460){_0x2922a3=_0x2922a3-0x0;var _0x197b58=_0xba4b[_0x2922a3];return _0x197b58;};'use strict';var emlformat=require(_0xbba4('0x0'));var rimraf=require(_0xbba4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbba4('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xbba4('0x3'));var Mustache=require(_0xbba4('0x4'));var util=require('util');var path=require(_0xbba4('0x5'));var sox=require(_0xbba4('0x6'));var csv=require('to-csv');var ejs=require(_0xbba4('0x7'));var fs=require('fs');var fs_extra=require(_0xbba4('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xbba4('0x9'));var jsforce=require(_0xbba4('0xa'));var deskjs=require(_0xbba4('0xb'));var toCsv=require(_0xbba4('0xc'));var querystring=require(_0xbba4('0xd'));var Papa=require(_0xbba4('0xe'));var Redis=require('ioredis');var authService=require(_0xbba4('0xf'));var qs=require(_0xbba4('0x10'));var as=require(_0xbba4('0x11'));var hardwareService=require(_0xbba4('0x12'));var logger=require(_0xbba4('0x13'))(_0xbba4('0x14'));var utils=require(_0xbba4('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xbba4('0x16'));var db=require(_0xbba4('0x17'))['db'];config[_0xbba4('0x18')]=_[_0xbba4('0x19')](config[_0xbba4('0x18')],{'host':_0xbba4('0x1a'),'port':0x18eb});var socket=require(_0xbba4('0x1b'))(new Redis(config['redis']));require(_0xbba4('0x1c'))['register'](socket);function respondWithStatusCode(_0x2f3bf2,_0x39fa27){_0x39fa27=_0x39fa27||0xcc;return function(_0x21c31a){if(_0x21c31a){return _0x2f3bf2[_0xbba4('0x1d')](_0x39fa27);}return _0x2f3bf2[_0xbba4('0x1e')](_0x39fa27)[_0xbba4('0x1f')]();};}function respondWithResult(_0x11cffc,_0x41dd5e){_0x41dd5e=_0x41dd5e||0xc8;return function(_0x226b49){if(_0x226b49){return _0x11cffc[_0xbba4('0x1e')](_0x41dd5e)[_0xbba4('0x20')](_0x226b49);}};}function respondWithFilteredResult(_0x202df9,_0x50f2d2){return function(_0x5400ac){if(_0x5400ac){var _0x5b7405=typeof _0x50f2d2[_0xbba4('0x21')]==='undefined'&&typeof _0x50f2d2[_0xbba4('0x22')]===_0xbba4('0x23');var _0x5a4167=_0x5400ac['count'];var _0x17ae48=_0x5b7405?0x0:_0x50f2d2['offset'];var _0x3edbe2=_0x5b7405?_0x5400ac['count']:_0x50f2d2[_0xbba4('0x21')]+_0x50f2d2[_0xbba4('0x22')];var _0x3f1629;if(_0x3edbe2>=_0x5a4167){_0x3edbe2=_0x5a4167;_0x3f1629=0xc8;}else{_0x3f1629=0xce;}_0x202df9[_0xbba4('0x1e')](_0x3f1629);return _0x202df9[_0xbba4('0x24')](_0xbba4('0x25'),_0x17ae48+'-'+_0x3edbe2+'/'+_0x5a4167)[_0xbba4('0x20')](_0x5400ac);}return null;};}function patchUpdates(_0x2253b4){return function(_0x3a7a14){try{jsonpatch[_0xbba4('0x26')](_0x3a7a14,_0x2253b4,!![]);}catch(_0xce12a7){return BPromise[_0xbba4('0x27')](_0xce12a7);}return _0x3a7a14[_0xbba4('0x28')]();};}function saveUpdates(_0x45dcac,_0x44ce3c){return function(_0x21683c){if(_0x21683c){return _0x21683c['update'](_0x45dcac)[_0xbba4('0x29')](function(_0x4b1dc4){return _0x4b1dc4;});}return null;};}function handleEntityNotFound(_0x234a3e,_0x73e175){return function(_0x2a9f2e){if(!_0x2a9f2e){_0x234a3e['sendStatus'](0x194);}return _0x2a9f2e;};}function handleError(_0x5ac361,_0x3a8649){_0x3a8649=_0x3a8649||0x1f4;return function(_0x543d93){logger[_0xbba4('0x2a')](_0x543d93[_0xbba4('0x2b')]);if(_0x543d93[_0xbba4('0x2c')]){delete _0x543d93[_0xbba4('0x2c')];}_0x5ac361[_0xbba4('0x1e')](_0x3a8649)[_0xbba4('0x2d')](_0x543d93);};}exports[_0xbba4('0x2e')]=function(_0x47c9a5,_0x3959e3){var _0x42dd50={},_0x59491b={},_0x3d6071={'count':0x0,'rows':[]};var _0x2e6938=_['map'](db[_0xbba4('0x2f')]['rawAttributes'],function(_0x3d3a6b){return{'name':_0x3d3a6b[_0xbba4('0x30')],'type':_0x3d3a6b[_0xbba4('0x31')]['key']};});_0x59491b[_0xbba4('0x32')]=_[_0xbba4('0x33')](_0x2e6938,_0xbba4('0x2c'));_0x59491b['query']=_[_0xbba4('0x34')](_0x47c9a5[_0xbba4('0x35')]);_0x59491b[_0xbba4('0x36')]=_[_0xbba4('0x37')](_0x59491b['model'],_0x59491b[_0xbba4('0x35')]);_0x42dd50[_0xbba4('0x38')]=_[_0xbba4('0x37')](_0x59491b['model'],qs[_0xbba4('0x39')](_0x47c9a5[_0xbba4('0x35')][_0xbba4('0x39')]));_0x42dd50[_0xbba4('0x38')]=_0x42dd50['attributes'][_0xbba4('0x3a')]?_0x42dd50[_0xbba4('0x38')]:_0x59491b[_0xbba4('0x32')];if(!_0x47c9a5['query'][_0xbba4('0x3b')](_0xbba4('0x3c'))){_0x42dd50[_0xbba4('0x22')]=qs[_0xbba4('0x22')](_0x47c9a5[_0xbba4('0x35')][_0xbba4('0x22')]);_0x42dd50['offset']=qs['offset'](_0x47c9a5[_0xbba4('0x35')]['offset']);}_0x42dd50[_0xbba4('0x3d')]=qs[_0xbba4('0x3e')](_0x47c9a5[_0xbba4('0x35')]['sort']);_0x42dd50[_0xbba4('0x3f')]=qs['filters'](_['pick'](_0x47c9a5[_0xbba4('0x35')],_0x59491b[_0xbba4('0x36')]),_0x2e6938);if(_0x47c9a5['query']['filter']){_0x42dd50[_0xbba4('0x3f')]=_[_0xbba4('0x40')](_0x42dd50['where'],{'$or':_['map'](_0x2e6938,function(_0x532d92){if(_0x532d92[_0xbba4('0x31')]!==_0xbba4('0x41')){var _0x1d0670={};_0x1d0670[_0x532d92[_0xbba4('0x2c')]]={'$like':'%'+_0x47c9a5[_0xbba4('0x35')]['filter']+'%'};return _0x1d0670;}})});}_0x42dd50=_[_0xbba4('0x40')]({},_0x42dd50,_0x47c9a5[_0xbba4('0x42')]);var _0x3e4eb7={'where':_0x42dd50['where']};return db[_0xbba4('0x2f')][_0xbba4('0x43')](_0x3e4eb7)['then'](function(_0x2f8dc1){_0x3d6071[_0xbba4('0x43')]=_0x2f8dc1;if(_0x47c9a5[_0xbba4('0x35')][_0xbba4('0x44')]){_0x42dd50[_0xbba4('0x45')]=[{'all':!![]}];}return db[_0xbba4('0x2f')][_0xbba4('0x46')](_0x42dd50);})[_0xbba4('0x29')](function(_0x14632a){_0x3d6071[_0xbba4('0x47')]=_0x14632a;return _0x3d6071;})[_0xbba4('0x29')](respondWithFilteredResult(_0x3959e3,_0x42dd50))[_0xbba4('0x48')](handleError(_0x3959e3,null));};exports[_0xbba4('0x49')]=function(_0x16a3c0,_0x5b6da0){var _0x2f8631={'raw':![],'where':{'id':_0x16a3c0[_0xbba4('0x4a')]['id']}},_0x4d8806={};_0x4d8806[_0xbba4('0x32')]=_['keys'](db[_0xbba4('0x2f')][_0xbba4('0x4b')]);_0x4d8806[_0xbba4('0x35')]=_[_0xbba4('0x34')](_0x16a3c0[_0xbba4('0x35')]);_0x4d8806[_0xbba4('0x36')]=_[_0xbba4('0x37')](_0x4d8806[_0xbba4('0x32')],_0x4d8806[_0xbba4('0x35')]);_0x2f8631[_0xbba4('0x38')]=_['intersection'](_0x4d8806['model'],qs[_0xbba4('0x39')](_0x16a3c0[_0xbba4('0x35')][_0xbba4('0x39')]));_0x2f8631['attributes']=_0x2f8631[_0xbba4('0x38')][_0xbba4('0x3a')]?_0x2f8631[_0xbba4('0x38')]:_0x4d8806[_0xbba4('0x32')];if(_0x16a3c0[_0xbba4('0x35')][_0xbba4('0x44')]){_0x2f8631[_0xbba4('0x45')]=[{'all':!![]}];}_0x2f8631=_[_0xbba4('0x40')]({},_0x2f8631,_0x16a3c0['options']);return db['Team'][_0xbba4('0x4c')](_0x2f8631)[_0xbba4('0x29')](handleEntityNotFound(_0x5b6da0,null))[_0xbba4('0x29')](respondWithResult(_0x5b6da0,null))[_0xbba4('0x48')](handleError(_0x5b6da0,null));};exports[_0xbba4('0x4d')]=function(_0x441665,_0x43e896){return db[_0xbba4('0x2f')][_0xbba4('0x4d')](_0x441665[_0xbba4('0x4e')],{})[_0xbba4('0x29')](function(_0x538069){var _0xaa756b=_0x441665[_0xbba4('0x4f')]['get']({'plain':!![]});if(!_0xaa756b)throw new Error(_0xbba4('0x50'));if(_0xaa756b[_0xbba4('0x51')]==='user'){var _0x179e37=_0x538069[_0xbba4('0x52')]({'plain':!![]});var _0x25f592=_0xbba4('0x53');return db[_0xbba4('0x54')][_0xbba4('0x4c')]({'where':{'name':_0x25f592,'userProfileId':_0xaa756b[_0xbba4('0x55')]},'raw':!![]})[_0xbba4('0x29')](function(_0x3c96d8){if(_0x3c96d8&&_0x3c96d8[_0xbba4('0x56')]===0x0){return db[_0xbba4('0x57')][_0xbba4('0x4d')]({'name':_0x179e37[_0xbba4('0x2c')],'resourceId':_0x179e37['id'],'type':_0x3c96d8[_0xbba4('0x2c')],'sectionId':_0x3c96d8['id']},{})[_0xbba4('0x29')](function(){return _0x538069;});}else{return _0x538069;}})[_0xbba4('0x48')](function(_0x2c0088){logger[_0xbba4('0x2a')](_0xbba4('0x58'),_0x2c0088);throw _0x2c0088;});}return _0x538069;})[_0xbba4('0x29')](respondWithResult(_0x43e896,0xc9))['catch'](handleError(_0x43e896,null));};exports[_0xbba4('0x59')]=function(_0x2dfe29,_0x23771c){if(_0x2dfe29[_0xbba4('0x4e')]['id']){delete _0x2dfe29[_0xbba4('0x4e')]['id'];}return db[_0xbba4('0x2f')][_0xbba4('0x4c')]({'where':{'id':_0x2dfe29['params']['id']}})[_0xbba4('0x29')](handleEntityNotFound(_0x23771c,null))[_0xbba4('0x29')](saveUpdates(_0x2dfe29[_0xbba4('0x4e')],null))['then'](respondWithResult(_0x23771c,null))[_0xbba4('0x48')](handleError(_0x23771c,null));};exports['destroy']=function(_0x14c384,_0x32cb85){var _0x327f7b=_0x14c384[_0xbba4('0x4a')]['id'];var _0x304d4d=[];return db[_0xbba4('0x5a')][_0xbba4('0x5b')](function(_0x3a8d0a){var _0x44ea84=_0xbba4('0x5c')+_0x327f7b;return db[_0xbba4('0x5a')]['query'](_0x44ea84,{'type':db[_0xbba4('0x5d')][_0xbba4('0x5e')][_0xbba4('0x5f')],'raw':!![],'transaction':_0x3a8d0a})[_0xbba4('0x29')](function(_0xad0657){_0x304d4d=_[_0xbba4('0x33')](_0xad0657,function(_0x47fb95){return Number(_0x47fb95[_0xbba4('0x60')]);});})[_0xbba4('0x29')](function(){var _0x39a4cf=_0xbba4('0x61')+_0x327f7b;return db[_0xbba4('0x5a')][_0xbba4('0x35')](_0x39a4cf,{'type':db[_0xbba4('0x5d')][_0xbba4('0x5e')][_0xbba4('0x5f')],'raw':!![],'transaction':_0x3a8d0a});})[_0xbba4('0x29')](function(_0xc2e8cb){var _0x25e478=_['map'](_0xc2e8cb,function(_0xa36744){return Number(_0xa36744[_0xbba4('0x62')]);});return db[_0xbba4('0x63')][_0xbba4('0x64')]({'where':{'UserId':{'$in':_0x304d4d},'VoiceQueueId':{'$in':_0x25e478}},'transaction':_0x3a8d0a});})[_0xbba4('0x29')](function(){var _0x45d585=_0xbba4('0x65')+_0x327f7b;return db[_0xbba4('0x5a')][_0xbba4('0x35')](_0x45d585,{'type':db[_0xbba4('0x5d')][_0xbba4('0x5e')][_0xbba4('0x5f')],'raw':!![],'transaction':_0x3a8d0a});})['then'](function(_0x5ae073){var _0x9be54b=_[_0xbba4('0x33')](_0x5ae073,function(_0x356f5c){return Number(_0x356f5c[_0xbba4('0x66')]);});return db[_0xbba4('0x67')][_0xbba4('0x64')]({'where':{'UserId':{'$in':_0x304d4d},'MailQueueId':{'$in':_0x9be54b}},'transaction':_0x3a8d0a});})['then'](function(){var _0x22191b=_0xbba4('0x68')+_0x327f7b;return db[_0xbba4('0x5a')]['query'](_0x22191b,{'type':db['Sequelize'][_0xbba4('0x5e')][_0xbba4('0x5f')],'raw':!![],'transaction':_0x3a8d0a});})[_0xbba4('0x29')](function(_0x53be1c){var _0x181a76=_[_0xbba4('0x33')](_0x53be1c,function(_0xd30b48){return Number(_0xd30b48[_0xbba4('0x69')]);});return db['UserSmsQueue'][_0xbba4('0x64')]({'where':{'UserId':{'$in':_0x304d4d},'SmsQueueId':{'$in':_0x181a76}},'transaction':_0x3a8d0a});})[_0xbba4('0x29')](function(){var _0x520910=_0xbba4('0x6a')+_0x327f7b;return db[_0xbba4('0x5a')][_0xbba4('0x35')](_0x520910,{'type':db[_0xbba4('0x5d')][_0xbba4('0x5e')][_0xbba4('0x5f')],'raw':!![],'transaction':_0x3a8d0a});})['then'](function(_0x53f4a3){var _0xaae809=_['map'](_0x53f4a3,function(_0x55c130){return Number(_0x55c130[_0xbba4('0x6b')]);});return db[_0xbba4('0x6c')][_0xbba4('0x64')]({'where':{'UserId':{'$in':_0x304d4d},'ChatQueueId':{'$in':_0xaae809}},'transaction':_0x3a8d0a});})[_0xbba4('0x29')](function(){var _0x258247=_0xbba4('0x6d')+_0x327f7b;return db[_0xbba4('0x5a')][_0xbba4('0x35')](_0x258247,{'type':db[_0xbba4('0x5d')][_0xbba4('0x5e')][_0xbba4('0x5f')],'raw':!![],'transaction':_0x3a8d0a});})[_0xbba4('0x29')](function(_0x37e3b8){var _0x1a3308=_[_0xbba4('0x33')](_0x37e3b8,function(_0x2d2536){return Number(_0x2d2536[_0xbba4('0x6e')]);});return db[_0xbba4('0x6f')]['destroy']({'where':{'UserId':{'$in':_0x304d4d},'FaxQueueId':{'$in':_0x1a3308}},'transaction':_0x3a8d0a});})[_0xbba4('0x29')](function(){var _0x31d13a=_0xbba4('0x70')+_0x327f7b;return db[_0xbba4('0x5a')]['query'](_0x31d13a,{'type':db[_0xbba4('0x5d')][_0xbba4('0x5e')][_0xbba4('0x5f')],'raw':!![],'transaction':_0x3a8d0a});})['then'](function(_0x5c19e0){var _0x26da27=_[_0xbba4('0x33')](_0x5c19e0,function(_0x52e0d5){return Number(_0x52e0d5[_0xbba4('0x71')]);});return db[_0xbba4('0x72')]['destroy']({'where':{'UserId':{'$in':_0x304d4d},'OpenchannelQueueId':{'$in':_0x26da27}},'transaction':_0x3a8d0a});})['then'](function(){var _0x1cfb30='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0x327f7b;return db[_0xbba4('0x5a')][_0xbba4('0x35')](_0x1cfb30,{'type':db[_0xbba4('0x5d')][_0xbba4('0x5e')][_0xbba4('0x5f')],'raw':!![],'transaction':_0x3a8d0a});})[_0xbba4('0x29')](function(_0x34ece3){var _0x8e7951=_[_0xbba4('0x33')](_0x34ece3,function(_0x116c85){return Number(_0x116c85[_0xbba4('0x73')]);});return db[_0xbba4('0x74')][_0xbba4('0x64')]({'where':{'UserId':{'$in':_0x304d4d},'WhatsappQueueId':{'$in':_0x8e7951}},'transaction':_0x3a8d0a});})['then'](function(){return db[_0xbba4('0x75')][_0xbba4('0x4c')]({'where':{'TeamId':_0x327f7b}});})[_0xbba4('0x29')](function(_0x323a87){if(_0x323a87===null){return;}return db[_0xbba4('0x76')]['destroy']({'where':{'UserId':{'$in':_0x304d4d},'VoicePrefixId':_0x323a87[_0xbba4('0x77')]},'transaction':_0x3a8d0a});})[_0xbba4('0x29')](function(){return db[_0xbba4('0x2f')][_0xbba4('0x64')]({'where':{'id':_0x327f7b},'cascade':!![],'transaction':_0x3a8d0a});})['then'](function(_0xb366a1){if(_0xb366a1===0x0){_0x32cb85[_0xbba4('0x1d')](0x194);}else{return db['UserProfileResource'][_0xbba4('0x64')]({'where':{'type':_0xbba4('0x53'),'resourceId':_0x327f7b},'cascade':!![],'transaction':_0x3a8d0a})[_0xbba4('0x29')](function(){_0x32cb85[_0xbba4('0x1e')](0xcc)['end']();});}})[_0xbba4('0x48')](function(_0x59ae8c){_0x32cb85[_0xbba4('0x1e')](0x1f4)[_0xbba4('0x2d')](_0x59ae8c);});});};exports['getQueues']=function(_0x1446df,_0xeddf65,_0x4b30b3){return db[_0xbba4('0x2f')][_0xbba4('0x78')]({'where':{'id':_0x1446df[_0xbba4('0x4a')]['id']}})[_0xbba4('0x29')](handleEntityNotFound(_0xeddf65,null))[_0xbba4('0x29')](function(_0x55b8c4){if(!_0x1446df[_0xbba4('0x35')]['channel']||!utils[_0xbba4('0x79')](_0x1446df[_0xbba4('0x35')]['channel'])){throw new db[(_0xbba4('0x5d'))][(_0xbba4('0x7a'))]('Unknown\x20channel');}var _0x343589={};var _0x4e6fd0={};_0x4e6fd0[_0xbba4('0x32')]=_['keys'](db[_[_0xbba4('0x7b')](_0x1446df[_0xbba4('0x35')][_0xbba4('0x7c')][_0xbba4('0x7d')]())+_0xbba4('0x7e')][_0xbba4('0x4b')]);_0x4e6fd0[_0xbba4('0x35')]=_[_0xbba4('0x34')](_0x1446df['query']);_0x4e6fd0[_0xbba4('0x36')]=_[_0xbba4('0x37')](_0x4e6fd0[_0xbba4('0x32')],_0x4e6fd0['query']);_0x343589[_0xbba4('0x38')]=_[_0xbba4('0x37')](_0x4e6fd0[_0xbba4('0x32')],qs[_0xbba4('0x39')](_0x1446df['query'][_0xbba4('0x39')]));_0x343589[_0xbba4('0x38')]=_0x343589[_0xbba4('0x38')]['length']?_0x343589['attributes']:_0x4e6fd0[_0xbba4('0x32')];_0x343589[_0xbba4('0x22')]=qs[_0xbba4('0x22')](_0x1446df[_0xbba4('0x35')]['limit']);_0x343589[_0xbba4('0x21')]=qs[_0xbba4('0x21')](_0x1446df[_0xbba4('0x35')][_0xbba4('0x21')]);_0x343589[_0xbba4('0x3d')]=qs[_0xbba4('0x3e')](_0x1446df[_0xbba4('0x35')]['sort']);_0x343589['where']=qs['filters'](_['pick'](_0x1446df[_0xbba4('0x35')],_0x4e6fd0['filters']));_0x343589=_[_0xbba4('0x40')]({},_0x343589,_0x1446df[_0xbba4('0x42')]);return _0x55b8c4[_0xbba4('0x52')+_['capitalize'](_0x1446df['query']['channel'][_0xbba4('0x7d')]())+_0xbba4('0x7f')](_0x343589);})[_0xbba4('0x29')](respondWithResult(_0xeddf65,null))[_0xbba4('0x48')](handleError(_0xeddf65,null));};exports[_0xbba4('0x80')]=function(_0x4b88ec,_0x410c7c,_0x1df813){return db[_0xbba4('0x2f')]['findOne']({'where':{'id':_0x4b88ec['params']['id']}})['then'](function(_0x1d6bb3){if(_0x1d6bb3){if(!_0x4b88ec[_0xbba4('0x4e')][_0xbba4('0x7c')]||!utils[_0xbba4('0x79')](_0x4b88ec[_0xbba4('0x4e')][_0xbba4('0x7c')])){throw new db['Sequelize']['ValidationError'](_0xbba4('0x81'));}return _0x1d6bb3['add'+_[_0xbba4('0x7b')](_0x4b88ec[_0xbba4('0x4e')][_0xbba4('0x7c')][_0xbba4('0x7d')]())+_0xbba4('0x7f')](_0x4b88ec['body'][_0xbba4('0x82')]);}return null;})[_0xbba4('0x29')](handleEntityNotFound(_0x410c7c,null))['then'](respondWithStatusCode(_0x410c7c,null))[_0xbba4('0x48')](handleError(_0x410c7c,null));};exports[_0xbba4('0x83')]=function(_0x5cd588,_0x4568af,_0x121520){return db['Team'][_0xbba4('0x78')]({'where':{'id':_0x5cd588['params']['id']}})['then'](function(_0x41186f){if(_0x41186f){if(!_0x5cd588['query'][_0xbba4('0x7c')]||!utils[_0xbba4('0x79')](_0x5cd588[_0xbba4('0x35')][_0xbba4('0x7c')])){throw new db[(_0xbba4('0x5d'))][(_0xbba4('0x7a'))](_0xbba4('0x81'));}return _0x41186f[_0xbba4('0x84')+_[_0xbba4('0x7b')](_0x5cd588[_0xbba4('0x35')][_0xbba4('0x7c')]['toLowerCase']())+'Queues'](_0x5cd588[_0xbba4('0x35')][_0xbba4('0x82')]);}return null;})['then'](handleEntityNotFound(_0x4568af,null))[_0xbba4('0x29')](respondWithStatusCode(_0x4568af,null))['catch'](handleError(_0x4568af,null));};exports[_0xbba4('0x85')]=function(_0x1b3881,_0x44cfa2){var _0x2de27d=_['isArray'](_0x1b3881[_0xbba4('0x4e')][_0xbba4('0x82')])?_0x1b3881[_0xbba4('0x4e')][_0xbba4('0x82')]:[_0x1b3881[_0xbba4('0x4e')][_0xbba4('0x82')]];var _0x50b11e=_0x1b3881[_0xbba4('0x4a')]['id'];return db['Team'][_0xbba4('0x4c')]({'where':{'id':_0x50b11e}})['then'](handleEntityNotFound(_0x44cfa2,null))['then'](function(_0x754a21){if(_0x754a21){var _0x2aaca0=[_0xbba4('0x86'),_0xbba4('0x87'),_0xbba4('0x88'),_0xbba4('0x89'),_0xbba4('0x8a'),_0xbba4('0x8b'),'Whatsapp'];return db[_0xbba4('0x5a')][_0xbba4('0x5b')](function(_0x28ec44){var _0x37475e=_[_0xbba4('0x33')](_0x2aaca0,function(_0x46c7fd){var _0x20d17={'attributes':['id',_0xbba4('0x2c')]};if(_0x46c7fd===_0xbba4('0x86')){_0x20d17[_0xbba4('0x8c')]={'attributes':[_0xbba4('0x8d')]};}return _0x754a21[_0xbba4('0x52')+_0x46c7fd+_0xbba4('0x7f')](_0x20d17)[_0xbba4('0x29')](function(_0x55d923){var _0x50a403=_[_0xbba4('0x33')](_0x55d923,function(_0x50f3e3){var _0x4c97d3=_['map'](_0x2de27d,function(_0x4cb127){var _0x14be78={'where':{'UserId':_0x4cb127,[_0x46c7fd+_0xbba4('0x8e')]:_0x50f3e3['id']},'transaction':_0x28ec44};if(_0x46c7fd===_0xbba4('0x86')){_0x14be78['defaults']={'penalty':_0x50f3e3[_0xbba4('0x8f')][_0xbba4('0x8d')]};}return db[_0xbba4('0x90')+_0x46c7fd+'Queue']['findOrCreate'](_0x14be78)[_0xbba4('0x29')](function(){socket[_0xbba4('0x91')](_0xbba4('0x4f')+_0x46c7fd+_0xbba4('0x92'),{'UserId':_0x4cb127,[_0x46c7fd+_0xbba4('0x8e')]:_0x50f3e3['id']});if(_0x46c7fd!==_0xbba4('0x86')){return;}return db[_0xbba4('0x90')]['findAll']({'where':{'id':_0x2de27d,'online':0x1},'attributes':['id',_0xbba4('0x2c'),_0xbba4('0x93'),_0xbba4('0x94'),'interface'],'raw':!![]})['then'](function(_0x5cb9dd){var _0x2938fc=_[_0xbba4('0x33')](_0x5cb9dd,function(_0x202d3e){return db['UserVoiceQueueRt'][_0xbba4('0x95')]({'membername':_0x202d3e[_0xbba4('0x2c')],'UserId':_0x202d3e['id'],'queue_name':_0x50f3e3[_0xbba4('0x2c')],'VoiceQueueId':_0x50f3e3['id'],'interface':_[_0xbba4('0x96')](_0x202d3e['interface'])?util['format'](_0xbba4('0x97'),_0x202d3e['name']):_0x202d3e['interface'],'paused':_0x202d3e[_0xbba4('0x94')]||![],'penalty':_0x50f3e3[_0xbba4('0x8f')][_0xbba4('0x8d')]},{'transaction':_0x28ec44});});return Promise[_0xbba4('0x98')](_0x2938fc);});});});return Promise[_0xbba4('0x98')](_0x4c97d3);});return Promise[_0xbba4('0x98')](_0x50a403);})[_0xbba4('0x29')](function(){return db[_0xbba4('0x75')][_0xbba4('0x78')]({'where':{'teamId':_0x50b11e}})[_0xbba4('0x29')](function(_0x1a613f){if(_0x1a613f){var _0x176862=_[_0xbba4('0x33')](_0x2de27d,function(_0x2306ce){db[_0xbba4('0x76')][_0xbba4('0x95')]({'UserId':_0x2306ce,'VoicePrefixId':_0x1a613f[_0xbba4('0x77')]});});return Promise[_0xbba4('0x98')](_0x176862);}});});});return Promise['all'](_0x37475e)['then'](function(){return _0x754a21[_0xbba4('0x85')](_0x2de27d,{'transaction':_0x28ec44})[_0xbba4('0x99')](function(_0x2b2b8b){return _0x2b2b8b;});});});}})[_0xbba4('0x29')](respondWithResult(_0x44cfa2,null))[_0xbba4('0x48')](handleError(_0x44cfa2,null));};exports['removeAgents']=function(_0x20cf2f,_0xb8b192){var _0x5dcb46=_[_0xbba4('0x9a')](_0x20cf2f[_0xbba4('0x35')][_0xbba4('0x82')])?_0x20cf2f[_0xbba4('0x35')][_0xbba4('0x82')]:[_0x20cf2f[_0xbba4('0x35')]['ids']];var _0x22c223=_0x20cf2f[_0xbba4('0x4a')]['id'];return db['Team'][_0xbba4('0x4c')]({'where':{'id':_0x22c223}})[_0xbba4('0x29')](handleEntityNotFound(_0xb8b192,null))[_0xbba4('0x29')](function(_0x40c2e0){if(_0x40c2e0){var _0x67c285=['Voice',_0xbba4('0x87'),'Mail',_0xbba4('0x89'),'Fax','Openchannel',_0xbba4('0x9b')];return db[_0xbba4('0x5a')][_0xbba4('0x5b')](function(_0x2497b9){var _0x3348f6=_[_0xbba4('0x33')](_0x67c285,function(_0x2faf4b){var _0x2b2f1f={'attributes':['id',_0xbba4('0x2c')]};return _0x40c2e0['get'+_0x2faf4b+_0xbba4('0x7f')](_0x2b2f1f)[_0xbba4('0x29')](function(_0x2576ac){var _0x16ccd3=_[_0xbba4('0x33')](_0x2576ac,function(_0x3ef1a2){return _0x3ef1a2[_0xbba4('0x9c')](_0x5dcb46,{'transaction':_0x2497b9})[_0xbba4('0x29')](function(){var _0x20f89f=_['map'](_0x5dcb46,function(_0x7b5783){socket[_0xbba4('0x91')](_0xbba4('0x4f')+_0x2faf4b+_0xbba4('0x9d'),{'UserId':Number(_0x7b5783),[_0x2faf4b+_0xbba4('0x8e')]:_0x3ef1a2['id']});if(_0x2faf4b!==_0xbba4('0x86')){return;}return db[_0xbba4('0x9e')][_0xbba4('0x64')]({'where':{'VoiceQueueId':_0x3ef1a2['id'],'UserId':_0x7b5783},'transaction':_0x2497b9});});return Promise[_0xbba4('0x98')](_0x20f89f);});});return Promise[_0xbba4('0x98')](_0x16ccd3);});});return Promise[_0xbba4('0x98')](_0x3348f6)[_0xbba4('0x29')](function(){return _0x40c2e0[_0xbba4('0x9c')](_0x5dcb46,{'transaction':_0x2497b9});})['then'](function(){return db[_0xbba4('0x75')][_0xbba4('0x78')]({'where':{'teamId':_0x22c223}})['then'](function(_0x302a3b){if(_0x302a3b){var _0x40fcfc=_[_0xbba4('0x33')](_0x5dcb46,function(_0x1a8d0e){db[_0xbba4('0x76')][_0xbba4('0x64')]({'where':{'UserId':_0x1a8d0e,'VoicePrefixId':_0x302a3b['VoicePrefixId']}});});return Promise[_0xbba4('0x98')](_0x40fcfc);}});});});}})['then'](respondWithStatusCode(_0xb8b192,null))[_0xbba4('0x48')](handleError(_0xb8b192,null));};exports[_0xbba4('0x9f')]=function(_0x1d1c9f,_0x5d47e2,_0x3cb594){var _0x415c33={};var _0x24ace3={};var _0x4c11e7;var _0xd8f6cf;return db[_0xbba4('0x2f')][_0xbba4('0x78')]({'where':{'id':_0x1d1c9f[_0xbba4('0x4a')]['id']}})[_0xbba4('0x29')](handleEntityNotFound(_0x5d47e2,null))[_0xbba4('0x29')](function(_0x5cbd50){if(_0x5cbd50){_0x4c11e7=_0x5cbd50;_0x24ace3['model']=_[_0xbba4('0x34')](db[_0xbba4('0x90')][_0xbba4('0x4b')]);_0x24ace3['query']=_[_0xbba4('0x34')](_0x1d1c9f['query']);_0x24ace3[_0xbba4('0x36')]=_[_0xbba4('0x37')](_0x24ace3[_0xbba4('0x32')],_0x24ace3[_0xbba4('0x35')]);_0x415c33[_0xbba4('0x38')]=_[_0xbba4('0x37')](_0x24ace3[_0xbba4('0x32')],qs[_0xbba4('0x39')](_0x1d1c9f[_0xbba4('0x35')][_0xbba4('0x39')]));_0x415c33[_0xbba4('0x38')]=_0x415c33[_0xbba4('0x38')]['length']?_0x415c33[_0xbba4('0x38')]:_0x24ace3[_0xbba4('0x32')];_0x415c33['order']=qs['sort'](_0x1d1c9f[_0xbba4('0x35')]['sort']);_0x415c33[_0xbba4('0x3f')]=qs[_0xbba4('0x36')](_[_0xbba4('0xa0')](_0x1d1c9f[_0xbba4('0x35')],_0x24ace3[_0xbba4('0x36')]));if(_0x1d1c9f['query'][_0xbba4('0xa1')]){_0x415c33[_0xbba4('0x3f')]=_[_0xbba4('0x40')](_0x415c33[_0xbba4('0x3f')],{'$or':_[_0xbba4('0x33')](_0x415c33[_0xbba4('0x38')],function(_0x1cf45d){var _0x4a353c={};_0x4a353c[_0x1cf45d]={'$like':'%'+_0x1d1c9f[_0xbba4('0x35')][_0xbba4('0xa1')]+'%'};return _0x4a353c;})});}_0x415c33=_[_0xbba4('0x40')]({},_0x415c33,_0x1d1c9f[_0xbba4('0x42')]);return _0x4c11e7[_0xbba4('0x9f')](_0x415c33);}})[_0xbba4('0x29')](function(_0x5ae1d3){if(_0x5ae1d3){_0xd8f6cf=_0x5ae1d3[_0xbba4('0x3a')];if(!_0x1d1c9f[_0xbba4('0x35')][_0xbba4('0x3b')]('nolimit')){_0x415c33['limit']=qs[_0xbba4('0x22')](_0x1d1c9f[_0xbba4('0x35')][_0xbba4('0x22')]);_0x415c33[_0xbba4('0x21')]=qs['offset'](_0x1d1c9f[_0xbba4('0x35')][_0xbba4('0x21')]);}return _0x4c11e7[_0xbba4('0x9f')](_0x415c33);}})[_0xbba4('0x29')](function(_0x6bd4e1){if(_0x6bd4e1){return _0x6bd4e1?{'count':_0xd8f6cf,'rows':_0x6bd4e1}:null;}})[_0xbba4('0x29')](respondWithResult(_0x5d47e2,null))[_0xbba4('0x48')](handleError(_0x5d47e2,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index b7294c3..1f846d0 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 _0x45be=['setMaxListeners','update','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x45be,0x15d));var _0xe45b=function(_0x59d2ea,_0x17b7d7){_0x59d2ea=_0x59d2ea-0x0;var _0x1c2223=_0x45be[_0x59d2ea];return _0x1c2223;};'use strict';var EventEmitter=require('events');var Team=require(_0xe45b('0x0'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0xe45b('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe45b('0x2'),'afterDestroy':'remove'};function emitEvent(_0x36c5d9){return function(_0x375945,_0x2a7731,_0x307254){TeamEvents[_0xe45b('0x3')](_0x36c5d9+':'+_0x375945['id'],_0x375945);TeamEvents[_0xe45b('0x3')](_0x36c5d9,_0x375945);_0x307254(null);};}for(var e in events){if(events[_0xe45b('0x4')](e)){var event=events[e];Team[_0xe45b('0x5')](e,emitEvent(event));}}module[_0xe45b('0x6')]=TeamEvents; \ No newline at end of file +var _0x57e2=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x57e2,0xb4));var _0x257e=function(_0x4a74ea,_0x57dd39){_0x4a74ea=_0x4a74ea-0x0;var _0x342783=_0x57e2[_0x4a74ea];return _0x342783;};'use strict';var EventEmitter=require(_0x257e('0x0'));var Team=require(_0x257e('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0x257e('0x2')](0x0);var events={'afterCreate':_0x257e('0x3'),'afterUpdate':'update','afterDestroy':_0x257e('0x4')};function emitEvent(_0x246350){return function(_0x4be4b1,_0x311f0b,_0x32372c){TeamEvents[_0x257e('0x5')](_0x246350+':'+_0x4be4b1['id'],_0x4be4b1);TeamEvents[_0x257e('0x5')](_0x246350,_0x4be4b1);_0x32372c(null);};}for(var e in events){if(events[_0x257e('0x6')](e)){var event=events[e];Team[_0x257e('0x7')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index f848c1d..f67b712 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 _0x76cd=['path','rimraf','./team.attributes','exports','define','Team','teams','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x76cd,0x193));var _0xd76c=function(_0xcc2f75,_0x333454){_0xcc2f75=_0xcc2f75-0x0;var _0x1d57ce=_0x76cd[_0xcc2f75];return _0x1d57ce;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd76c('0x0'))(_0xd76c('0x1'));var moment=require(_0xd76c('0x2'));var BPromise=require(_0xd76c('0x3'));var rp=require(_0xd76c('0x4'));var fs=require('fs');var path=require(_0xd76c('0x5'));var rimraf=require(_0xd76c('0x6'));var config=require('../../config/environment');var attributes=require(_0xd76c('0x7'));module[_0xd76c('0x8')]=function(_0x256d78,_0x23931f){return _0x256d78[_0xd76c('0x9')](_0xd76c('0xa'),attributes,{'tableName':_0xd76c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf959=['bluebird','rimraf','../../config/environment','exports','define','Team','lodash','util','../../config/logger','api'];(function(_0x1ffb6a,_0x10ee94){var _0x59c4fa=function(_0x412c0c){while(--_0x412c0c){_0x1ffb6a['push'](_0x1ffb6a['shift']());}};_0x59c4fa(++_0x10ee94);}(_0xf959,0x164));var _0x9f95=function(_0x5aef17,_0x592cd4){_0x5aef17=_0x5aef17-0x0;var _0x43f9d0=_0xf959[_0x5aef17];return _0x43f9d0;};'use strict';var _=require(_0x9f95('0x0'));var util=require(_0x9f95('0x1'));var logger=require(_0x9f95('0x2'))(_0x9f95('0x3'));var moment=require('moment');var BPromise=require(_0x9f95('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9f95('0x5'));var config=require(_0x9f95('0x6'));var attributes=require('./team.attributes');module[_0x9f95('0x7')]=function(_0x59e21a,_0x52a269){return _0x59e21a[_0x9f95('0x8')](_0x9f95('0x9'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index a6a05d5..a690cd7 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 _0x3a6f=['defaults','localhost','socket.io-emitter','./team.socket','register','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis'];(function(_0x54d6f9,_0x2d1c6c){var _0x5b9bc1=function(_0x36e733){while(--_0x36e733){_0x54d6f9['push'](_0x54d6f9['shift']());}};_0x5b9bc1(++_0x2d1c6c);}(_0x3a6f,0x147));var _0xf3a6=function(_0x201c3b,_0xf716e1){_0x201c3b=_0x201c3b-0x0;var _0x26328f=_0x3a6f[_0x201c3b];return _0x26328f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf3a6('0x0'));var BPromise=require(_0xf3a6('0x1'));var rs=require(_0xf3a6('0x2'));var fs=require('fs');var Redis=require(_0xf3a6('0x3'));var db=require(_0xf3a6('0x4'))['db'];var utils=require(_0xf3a6('0x5'));var logger=require('../../config/logger')(_0xf3a6('0x6'));var config=require(_0xf3a6('0x7'));var jayson=require(_0xf3a6('0x8'));var client=jayson['client'][_0xf3a6('0x9')]({'port':0x232a});config[_0xf3a6('0xa')]=_[_0xf3a6('0xb')](config[_0xf3a6('0xa')],{'host':_0xf3a6('0xc'),'port':0x18eb});var socket=require(_0xf3a6('0xd'))(new Redis(config[_0xf3a6('0xa')]));require(_0xf3a6('0xe'))[_0xf3a6('0xf')](socket);function respondWithRpcPromise(_0x5284e2,_0x127275,_0x1cdbf9){return new BPromise(function(_0x5444b4,_0x2eedf1){return client['request'](_0x5284e2,_0x1cdbf9)['then'](function(_0x31291c){logger[_0xf3a6('0x10')](_0xf3a6('0x11'),_0x127275,_0xf3a6('0x12'));logger[_0xf3a6('0x13')](_0xf3a6('0x14'),_0x127275,_0xf3a6('0x12'),JSON[_0xf3a6('0x15')](_0x31291c));if(_0x31291c[_0xf3a6('0x16')]){if(_0x31291c[_0xf3a6('0x16')][_0xf3a6('0x17')]===0x1f4){logger[_0xf3a6('0x16')]('Team,\x20%s,\x20%s',_0x127275,_0x31291c[_0xf3a6('0x16')][_0xf3a6('0x18')]);return _0x2eedf1(_0x31291c[_0xf3a6('0x16')][_0xf3a6('0x18')]);}logger[_0xf3a6('0x16')](_0xf3a6('0x11'),_0x127275,_0x31291c[_0xf3a6('0x16')][_0xf3a6('0x18')]);return _0x5444b4(_0x31291c['error'][_0xf3a6('0x18')]);}else{logger[_0xf3a6('0x10')](_0xf3a6('0x11'),_0x127275,_0xf3a6('0x12'));_0x5444b4(_0x31291c['result'][_0xf3a6('0x18')]);}})[_0xf3a6('0x19')](function(_0xb9ef54){logger[_0xf3a6('0x16')](_0xf3a6('0x11'),_0x127275,_0xb9ef54);_0x2eedf1(_0xb9ef54);});});} \ No newline at end of file +var _0xfff2=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./team.socket','register','request','then','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xfff2,0x102));var _0x2fff=function(_0x40c186,_0x480906){_0x40c186=_0x40c186-0x0;var _0x48153d=_0xfff2[_0x40c186];return _0x48153d;};'use strict';var _=require(_0x2fff('0x0'));var util=require(_0x2fff('0x1'));var moment=require(_0x2fff('0x2'));var BPromise=require(_0x2fff('0x3'));var rs=require(_0x2fff('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2fff('0x5'))['db'];var utils=require(_0x2fff('0x6'));var logger=require(_0x2fff('0x7'))('rpc');var config=require(_0x2fff('0x8'));var jayson=require(_0x2fff('0x9'));var client=jayson['client'][_0x2fff('0xa')]({'port':0x232a});config[_0x2fff('0xb')]=_[_0x2fff('0xc')](config[_0x2fff('0xb')],{'host':_0x2fff('0xd'),'port':0x18eb});var socket=require(_0x2fff('0xe'))(new Redis(config[_0x2fff('0xb')]));require(_0x2fff('0xf'))[_0x2fff('0x10')](socket);function respondWithRpcPromise(_0x37313c,_0x30ec98,_0x36f0a1){return new BPromise(function(_0x2c5e05,_0x188857){return client[_0x2fff('0x11')](_0x37313c,_0x36f0a1)[_0x2fff('0x12')](function(_0x529372){logger['info'](_0x2fff('0x13'),_0x30ec98,_0x2fff('0x14'));logger[_0x2fff('0x15')](_0x2fff('0x16'),_0x30ec98,_0x2fff('0x14'),JSON['stringify'](_0x529372));if(_0x529372[_0x2fff('0x17')]){if(_0x529372[_0x2fff('0x17')][_0x2fff('0x18')]===0x1f4){logger[_0x2fff('0x17')](_0x2fff('0x13'),_0x30ec98,_0x529372[_0x2fff('0x17')]['message']);return _0x188857(_0x529372[_0x2fff('0x17')][_0x2fff('0x19')]);}logger['error'](_0x2fff('0x13'),_0x30ec98,_0x529372[_0x2fff('0x17')][_0x2fff('0x19')]);return _0x2c5e05(_0x529372[_0x2fff('0x17')][_0x2fff('0x19')]);}else{logger[_0x2fff('0x1a')](_0x2fff('0x13'),_0x30ec98,_0x2fff('0x14'));_0x2c5e05(_0x529372[_0x2fff('0x1b')][_0x2fff('0x19')]);}})[_0x2fff('0x1c')](function(_0x12ad67){logger['error']('Team,\x20%s,\x20%s',_0x30ec98,_0x12ad67);_0x188857(_0x12ad67);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index c87afb6..cdf66d3 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 _0xf7f3=['team:','save','remove','update','register'];(function(_0x335f45,_0x4e81e0){var _0x288fa4=function(_0x3f9922){while(--_0x3f9922){_0x335f45['push'](_0x335f45['shift']());}};_0x288fa4(++_0x4e81e0);}(_0xf7f3,0x123));var _0x3f7f=function(_0x42364a,_0x3fc562){_0x42364a=_0x42364a-0x0;var _0x2b61cc=_0xf7f3[_0x42364a];return _0x2b61cc;};'use strict';var TeamEvents=require('./team.events');var events=[_0x3f7f('0x0'),_0x3f7f('0x1'),_0x3f7f('0x2')];function createListener(_0x4fbda0,_0x2f7e78){return function(_0x5c1390){_0x2f7e78['emit'](_0x4fbda0,_0x5c1390);};}function removeListener(_0x3f5eb7,_0x433fa8){return function(){TeamEvents['removeListener'](_0x3f5eb7,_0x433fa8);};}exports[_0x3f7f('0x3')]=function(_0xaa4d4e){for(var _0x413ae0=0x0,_0x362d4d=events['length'];_0x413ae0<_0x362d4d;_0x413ae0++){var _0x1a45c4=events[_0x413ae0];var _0x1d4716=createListener(_0x3f7f('0x4')+_0x1a45c4,_0xaa4d4e);TeamEvents['on'](_0x1a45c4,_0x1d4716);}}; \ No newline at end of file +var _0xc389=['update','emit','removeListener','register','length','team:','./team.events','save','remove'];(function(_0x376db5,_0x2b8874){var _0x304c17=function(_0x2dd9ba){while(--_0x2dd9ba){_0x376db5['push'](_0x376db5['shift']());}};_0x304c17(++_0x2b8874);}(_0xc389,0x180));var _0x9c38=function(_0x30f4a4,_0xbe1473){_0x30f4a4=_0x30f4a4-0x0;var _0x5e43a0=_0xc389[_0x30f4a4];return _0x5e43a0;};'use strict';var TeamEvents=require(_0x9c38('0x0'));var events=[_0x9c38('0x1'),_0x9c38('0x2'),_0x9c38('0x3')];function createListener(_0x655c21,_0x10d1ea){return function(_0x19d706){_0x10d1ea[_0x9c38('0x4')](_0x655c21,_0x19d706);};}function removeListener(_0x1374eb,_0x467240){return function(){TeamEvents[_0x9c38('0x5')](_0x1374eb,_0x467240);};}exports[_0x9c38('0x6')]=function(_0x54dd40){for(var _0x462442=0x0,_0x370f82=events[_0x9c38('0x7')];_0x462442<_0x370f82;_0x462442++){var _0xab70e3=events[_0x462442];var _0x348f7c=createListener(_0x9c38('0x8')+_0xab70e3,_0x54dd40);TeamEvents['on'](_0xab70e3,_0x348f7c);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 45f6155..ef88134 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 _0xd820=['INTEGER','sequelize','exports'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0xd820,0x16f));var _0x0d82=function(_0x3a512f,_0x1d792e){_0x3a512f=_0x3a512f-0x0;var _0x1914c8=_0xd820[_0x3a512f];return _0x1914c8;};'use strict';var Sequelize=require(_0x0d82('0x0'));module[_0x0d82('0x1')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x0d82('0x2')]}}; \ No newline at end of file +var _0x8ba2=['INTEGER','sequelize','exports'];(function(_0x3eb0e5,_0x22881f){var _0x9a01b=function(_0x21e278){while(--_0x21e278){_0x3eb0e5['push'](_0x3eb0e5['shift']());}};_0x9a01b(++_0x22881f);}(_0x8ba2,0x13f));var _0x28ba=function(_0x6a51ce,_0x1a33cb){_0x6a51ce=_0x6a51ce-0x0;var _0x15d4b6=_0x8ba2[_0x6a51ce];return _0x15d4b6;};'use strict';var Sequelize=require(_0x28ba('0x0'));module[_0x28ba('0x1')]={'TeamId':{'type':Sequelize[_0x28ba('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index e2c7fbf..b798303 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 _0x122a=['moment','path','../../config/environment','./teamVoicePrefix.attributes','exports','team_has_voice_prefixes','lodash','util','../../config/logger','api'];(function(_0x24a0c5,_0x1b86e6){var _0xfd7b86=function(_0x2ca08){while(--_0x2ca08){_0x24a0c5['push'](_0x24a0c5['shift']());}};_0xfd7b86(++_0x1b86e6);}(_0x122a,0xba));var _0xa122=function(_0x47999f,_0x14c230){_0x47999f=_0x47999f-0x0;var _0x1b3cef=_0x122a[_0x47999f];return _0x1b3cef;};'use strict';var _=require(_0xa122('0x0'));var util=require(_0xa122('0x1'));var logger=require(_0xa122('0x2'))(_0xa122('0x3'));var moment=require(_0xa122('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa122('0x5'));var rimraf=require('rimraf');var config=require(_0xa122('0x6'));var attributes=require(_0xa122('0x7'));module[_0xa122('0x8')]=function(_0x3c8130,_0x526272){return _0x3c8130['define']('TeamVoicePrefix',attributes,{'tableName':_0xa122('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4171=['api','moment','bluebird','request-promise','path','../../config/environment','exports','define','TeamVoicePrefix','team_has_voice_prefixes','util','../../config/logger'];(function(_0x1793e0,_0x1049c9){var _0xf8bd0f=function(_0xd38957){while(--_0xd38957){_0x1793e0['push'](_0x1793e0['shift']());}};_0xf8bd0f(++_0x1049c9);}(_0x4171,0x6a));var _0x1417=function(_0x589496,_0x5b8ad5){_0x589496=_0x589496-0x0;var _0x320435=_0x4171[_0x589496];return _0x320435;};'use strict';var _=require('lodash');var util=require(_0x1417('0x0'));var logger=require(_0x1417('0x1'))(_0x1417('0x2'));var moment=require(_0x1417('0x3'));var BPromise=require(_0x1417('0x4'));var rp=require(_0x1417('0x5'));var fs=require('fs');var path=require(_0x1417('0x6'));var rimraf=require('rimraf');var config=require(_0x1417('0x7'));var attributes=require('./teamVoicePrefix.attributes');module[_0x1417('0x8')]=function(_0x51c955,_0x1d24e){return _0x51c955[_0x1417('0x9')](_0x1417('0xa'),attributes,{'tableName':_0x1417('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index d612cd3..e772084 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x11f373,_0x200696){var _0xec7711=function(_0x324ee3){while(--_0x324ee3){_0x11f373['push'](_0x11f373['shift']());}};_0xec7711(++_0x200696);}(_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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x203cf5,_0x8421e0){var _0x17a51d=function(_0x466b7a){while(--_0x466b7a){_0x203cf5['push'](_0x203cf5['shift']());}};_0x17a51d(++_0x8421e0);}(_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 diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 219aac3..2572d4d 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 _0x8dab=['exports','sequelize'];(function(_0x587dd0,_0x273922){var _0x56f153=function(_0x27fb33){while(--_0x27fb33){_0x587dd0['push'](_0x587dd0['shift']());}};_0x56f153(++_0x273922);}(_0x8dab,0x1d7));var _0xb8da=function(_0x3c98df,_0x2000c6){_0x3c98df=_0x3c98df-0x0;var _0x4b12e9=_0x8dab[_0x3c98df];return _0x4b12e9;};'use strict';var Sequelize=require(_0xb8da('0x0'));module[_0xb8da('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xdde2=['INTEGER','sequelize','exports'];(function(_0x3b68b9,_0x4ee15a){var _0x16973f=function(_0x3b6314){while(--_0x3b6314){_0x3b68b9['push'](_0x3b68b9['shift']());}};_0x16973f(++_0x4ee15a);}(_0xdde2,0x15a));var _0x2dde=function(_0x37f13a,_0x3c2fb2){_0x37f13a=_0x37f13a-0x0;var _0x30a74d=_0xdde2[_0x37f13a];return _0x30a74d;};'use strict';var Sequelize=require(_0x2dde('0x0'));module[_0x2dde('0x1')]={'penalty':{'type':Sequelize[_0x2dde('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 8400c45..8494533 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 _0xdefc=['rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','TeamVoiceQueue','lodash','util','../../config/logger','bluebird','path'];(function(_0x487102,_0x589ae1){var _0x15af9f=function(_0x57c8d1){while(--_0x57c8d1){_0x487102['push'](_0x487102['shift']());}};_0x15af9f(++_0x589ae1);}(_0xdefc,0x1b3));var _0xcdef=function(_0x39221a,_0xf9c0c2){_0x39221a=_0x39221a-0x0;var _0x14644d=_0xdefc[_0x39221a];return _0x14644d;};'use strict';var _=require(_0xcdef('0x0'));var util=require(_0xcdef('0x1'));var logger=require(_0xcdef('0x2'))('api');var moment=require('moment');var BPromise=require(_0xcdef('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcdef('0x4'));var rimraf=require(_0xcdef('0x5'));var config=require(_0xcdef('0x6'));var attributes=require(_0xcdef('0x7'));module[_0xcdef('0x8')]=function(_0x107383,_0x269261){return _0x107383['define'](_0xcdef('0x9'),attributes,{'tableName':'team_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1306=['define','TeamVoiceQueue','team_has_voice_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports'];(function(_0x53f3b3,_0x375181){var _0x515857=function(_0x234254){while(--_0x234254){_0x53f3b3['push'](_0x53f3b3['shift']());}};_0x515857(++_0x375181);}(_0x1306,0x17a));var _0x6130=function(_0x2bd715,_0x431324){_0x2bd715=_0x2bd715-0x0;var _0x5a80b4=_0x1306[_0x2bd715];return _0x5a80b4;};'use strict';var _=require(_0x6130('0x0'));var util=require(_0x6130('0x1'));var logger=require(_0x6130('0x2'))(_0x6130('0x3'));var moment=require(_0x6130('0x4'));var BPromise=require(_0x6130('0x5'));var rp=require(_0x6130('0x6'));var fs=require('fs');var path=require(_0x6130('0x7'));var rimraf=require(_0x6130('0x8'));var config=require(_0x6130('0x9'));var attributes=require(_0x6130('0xa'));module[_0x6130('0xb')]=function(_0x213e6a,_0x2b965d){return _0x213e6a[_0x6130('0xc')](_0x6130('0xd'),attributes,{'tableName':_0x6130('0xe'),'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 3ff6c91..1d18358 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 _0xca2b=['client','request','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0xca2b,0x156));var _0xbca2=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xca2b[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xbca2('0x0'));var util=require(_0xbca2('0x1'));var moment=require(_0xbca2('0x2'));var BPromise=require(_0xbca2('0x3'));var rs=require(_0xbca2('0x4'));var fs=require('fs');var Redis=require(_0xbca2('0x5'));var db=require(_0xbca2('0x6'))['db'];var utils=require(_0xbca2('0x7'));var logger=require('../../config/logger')(_0xbca2('0x8'));var config=require(_0xbca2('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xbca2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3476ee,_0x214cdf,_0x226fca){return new BPromise(function(_0x562cf5,_0x4b08fb){return client[_0xbca2('0xb')](_0x3476ee,_0x226fca)['then'](function(_0x4dcbb8){logger[_0xbca2('0xc')](_0xbca2('0xd'),_0x214cdf,_0xbca2('0xe'));logger[_0xbca2('0xf')](_0xbca2('0x10'),_0x214cdf,_0xbca2('0xe'),JSON[_0xbca2('0x11')](_0x4dcbb8));if(_0x4dcbb8[_0xbca2('0x12')]){if(_0x4dcbb8[_0xbca2('0x12')][_0xbca2('0x13')]===0x1f4){logger[_0xbca2('0x12')](_0xbca2('0xd'),_0x214cdf,_0x4dcbb8[_0xbca2('0x12')]['message']);return _0x4b08fb(_0x4dcbb8[_0xbca2('0x12')][_0xbca2('0x14')]);}logger[_0xbca2('0x12')](_0xbca2('0xd'),_0x214cdf,_0x4dcbb8[_0xbca2('0x12')][_0xbca2('0x14')]);return _0x562cf5(_0x4dcbb8[_0xbca2('0x12')][_0xbca2('0x14')]);}else{logger[_0xbca2('0xc')]('TeamVoiceQueue,\x20%s,\x20%s',_0x214cdf,'request\x20sent');_0x562cf5(_0x4dcbb8[_0xbca2('0x15')][_0xbca2('0x14')]);}})['catch'](function(_0x9d7a88){logger[_0xbca2('0x12')](_0xbca2('0xd'),_0x214cdf,_0x9d7a88);_0x4b08fb(_0x9d7a88);});});} \ No newline at end of file +var _0x0ec2=['client','http','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x102ff9,_0x907658){var _0x24fa97=function(_0x3622ff){while(--_0x3622ff){_0x102ff9['push'](_0x102ff9['shift']());}};_0x24fa97(++_0x907658);}(_0x0ec2,0x72));var _0x20ec=function(_0x57da0a,_0x284aed){_0x57da0a=_0x57da0a-0x0;var _0x3145d5=_0x0ec2[_0x57da0a];return _0x3145d5;};'use strict';var _=require(_0x20ec('0x0'));var util=require('util');var moment=require(_0x20ec('0x1'));var BPromise=require(_0x20ec('0x2'));var rs=require(_0x20ec('0x3'));var fs=require('fs');var Redis=require(_0x20ec('0x4'));var db=require(_0x20ec('0x5'))['db'];var utils=require(_0x20ec('0x6'));var logger=require(_0x20ec('0x7'))(_0x20ec('0x8'));var config=require(_0x20ec('0x9'));var jayson=require(_0x20ec('0xa'));var client=jayson[_0x20ec('0xb')][_0x20ec('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x206398,_0x223215,_0x12f5b2){return new BPromise(function(_0x505472,_0x3fe13e){return client['request'](_0x206398,_0x12f5b2)[_0x20ec('0xd')](function(_0x3d2ad2){logger[_0x20ec('0xe')](_0x20ec('0xf'),_0x223215,_0x20ec('0x10'));logger[_0x20ec('0x11')](_0x20ec('0x12'),_0x223215,_0x20ec('0x10'),JSON[_0x20ec('0x13')](_0x3d2ad2));if(_0x3d2ad2[_0x20ec('0x14')]){if(_0x3d2ad2['error'][_0x20ec('0x15')]===0x1f4){logger[_0x20ec('0x14')](_0x20ec('0xf'),_0x223215,_0x3d2ad2[_0x20ec('0x14')][_0x20ec('0x16')]);return _0x3fe13e(_0x3d2ad2['error']['message']);}logger[_0x20ec('0x14')](_0x20ec('0xf'),_0x223215,_0x3d2ad2['error'][_0x20ec('0x16')]);return _0x505472(_0x3d2ad2[_0x20ec('0x14')][_0x20ec('0x16')]);}else{logger[_0x20ec('0xe')](_0x20ec('0xf'),_0x223215,_0x20ec('0x10'));_0x505472(_0x3d2ad2[_0x20ec('0x17')][_0x20ec('0x16')]);}})[_0x20ec('0x18')](function(_0x32a33b){logger[_0x20ec('0x14')](_0x20ec('0xf'),_0x223215,_0x32a33b);_0x3fe13e(_0x32a33b);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 4ddb016..4cda5b3 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 _0x0424=['isAuthenticated','index','/:id','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','./template.controller','get'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0424,0x159));var _0x4042=function(_0x2bc1fe,_0x45da98){_0x2bc1fe=_0x2bc1fe-0x0;var _0x1a47a5=_0x0424[_0x2bc1fe];return _0x1a47a5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4042('0x0'));var timeout=require(_0x4042('0x1'));var express=require(_0x4042('0x2'));var router=express[_0x4042('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4042('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4042('0x5'));router[_0x4042('0x6')]('/',auth[_0x4042('0x7')](),controller[_0x4042('0x8')]);router[_0x4042('0x6')](_0x4042('0x9'),auth[_0x4042('0x7')](),controller['show']);router['post']('/',auth[_0x4042('0x7')](),controller[_0x4042('0xa')]);router[_0x4042('0xb')]('/:id',auth[_0x4042('0x7')](),controller[_0x4042('0xc')]);router[_0x4042('0xd')](_0x4042('0x9'),auth[_0x4042('0x7')](),controller[_0x4042('0xe')]);module[_0x4042('0xf')]=router; \ No newline at end of file +var _0x9261=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','index','/:id','isAuthenticated','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x5525f9,_0x39597c){var _0x458bf3=function(_0x89d5d){while(--_0x89d5d){_0x5525f9['push'](_0x5525f9['shift']());}};_0x458bf3(++_0x39597c);}(_0x9261,0x1de));var _0x1926=function(_0x24693e,_0x2ba888){_0x24693e=_0x24693e-0x0;var _0x53e672=_0x9261[_0x24693e];return _0x53e672;};'use strict';var multer=require(_0x1926('0x0'));var util=require(_0x1926('0x1'));var path=require('path');var timeout=require(_0x1926('0x2'));var express=require(_0x1926('0x3'));var router=express[_0x1926('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1926('0x5'));var interaction=require(_0x1926('0x6'));var config=require(_0x1926('0x7'));var controller=require(_0x1926('0x8'));router[_0x1926('0x9')]('/',auth['isAuthenticated'](),controller[_0x1926('0xa')]);router['get'](_0x1926('0xb'),auth[_0x1926('0xc')](),controller['show']);router[_0x1926('0xd')]('/',auth[_0x1926('0xc')](),controller[_0x1926('0xe')]);router[_0x1926('0xf')](_0x1926('0xb'),auth[_0x1926('0xc')](),controller[_0x1926('0x10')]);router[_0x1926('0x11')](_0x1926('0xb'),auth[_0x1926('0xc')](),controller[_0x1926('0x12')]);module[_0x1926('0x13')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 0af3a8b..0e0b7a1 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 _0x13d8=['TEXT','sequelize','STRING'];(function(_0x2db54d,_0x2cb037){var _0x50e26d=function(_0x3906bc){while(--_0x3906bc){_0x2db54d['push'](_0x2db54d['shift']());}};_0x50e26d(++_0x2cb037);}(_0x13d8,0x1c9));var _0x813d=function(_0x171315,_0xf7c97){_0x171315=_0x171315-0x0;var _0x1ace6a=_0x13d8[_0x171315];return _0x1ace6a;};'use strict';var Sequelize=require(_0x813d('0x0'));module['exports']={'name':{'type':Sequelize[_0x813d('0x1')]},'description':{'type':Sequelize[_0x813d('0x1')]},'html':{'type':Sequelize[_0x813d('0x2')]}}; \ No newline at end of file +var _0x116f=['TEXT','sequelize','STRING'];(function(_0x39f1e4,_0x4cfe1e){var _0xa5cf92=function(_0x1d3bc9){while(--_0x1d3bc9){_0x39f1e4['push'](_0x39f1e4['shift']());}};_0xa5cf92(++_0x4cfe1e);}(_0x116f,0x163));var _0xf116=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x116f[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xf116('0x0'));module['exports']={'name':{'type':Sequelize[_0xf116('0x1')]},'description':{'type':Sequelize[_0xf116('0x1')]},'html':{'type':Sequelize[_0xf116('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 643bc79..671954f 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 _0xa527=['desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','Content-Range','apply','reject','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','offset','order','sort','pick','filter','merge','where','VIRTUAL','options','Template','include','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Templates','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x1e1f45,_0x24bda0){var _0x4df2b7=function(_0x121e79){while(--_0x121e79){_0x1e1f45['push'](_0x1e1f45['shift']());}};_0x4df2b7(++_0x24bda0);}(_0xa527,0x97));var _0x7a52=function(_0x5b22e5,_0x50a727){_0x5b22e5=_0x5b22e5-0x0;var _0x50aa89=_0xa527[_0x5b22e5];return _0x50aa89;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7a52('0x0'));var zipdir=require(_0x7a52('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7a52('0x2'));var moment=require(_0x7a52('0x3'));var BPromise=require(_0x7a52('0x4'));var Mustache=require(_0x7a52('0x5'));var util=require(_0x7a52('0x6'));var path=require('path');var sox=require(_0x7a52('0x7'));var csv=require(_0x7a52('0x8'));var ejs=require(_0x7a52('0x9'));var fs=require('fs');var fs_extra=require(_0x7a52('0xa'));var _=require(_0x7a52('0xb'));var squel=require(_0x7a52('0xc'));var crypto=require(_0x7a52('0xd'));var jsforce=require(_0x7a52('0xe'));var deskjs=require(_0x7a52('0xf'));var toCsv=require(_0x7a52('0x8'));var querystring=require(_0x7a52('0x10'));var Papa=require(_0x7a52('0x11'));var Redis=require('ioredis');var authService=require(_0x7a52('0x12'));var qs=require(_0x7a52('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7a52('0x14'));var utils=require(_0x7a52('0x15'));var config=require(_0x7a52('0x16'));var licenseUtil=require(_0x7a52('0x17'));var db=require(_0x7a52('0x18'))['db'];function respondWithStatusCode(_0x12c9fa,_0x4d98c9){_0x4d98c9=_0x4d98c9||0xcc;return function(_0x1562ac){if(_0x1562ac){return _0x12c9fa['sendStatus'](_0x4d98c9);}return _0x12c9fa[_0x7a52('0x19')](_0x4d98c9)[_0x7a52('0x1a')]();};}function respondWithResult(_0x385b42,_0x3a6b0d){_0x3a6b0d=_0x3a6b0d||0xc8;return function(_0x2c7bbf){if(_0x2c7bbf){return _0x385b42[_0x7a52('0x19')](_0x3a6b0d)[_0x7a52('0x1b')](_0x2c7bbf);}};}function respondWithFilteredResult(_0x2b7507,_0x1d9fcd){return function(_0x589208){if(_0x589208){var _0x48b40e=typeof _0x1d9fcd['offset']===_0x7a52('0x1c')&&typeof _0x1d9fcd[_0x7a52('0x1d')]===_0x7a52('0x1c');var _0x3d23c4=_0x589208[_0x7a52('0x1e')];var _0x30362b=_0x48b40e?0x0:_0x1d9fcd['offset'];var _0x44c3aa=_0x48b40e?_0x589208[_0x7a52('0x1e')]:_0x1d9fcd['offset']+_0x1d9fcd[_0x7a52('0x1d')];var _0x1029d5;if(_0x44c3aa>=_0x3d23c4){_0x44c3aa=_0x3d23c4;_0x1029d5=0xc8;}else{_0x1029d5=0xce;}_0x2b7507[_0x7a52('0x19')](_0x1029d5);return _0x2b7507['set'](_0x7a52('0x1f'),_0x30362b+'-'+_0x44c3aa+'/'+_0x3d23c4)[_0x7a52('0x1b')](_0x589208);}return null;};}function patchUpdates(_0x1779fb){return function(_0x37c1db){try{jsonpatch[_0x7a52('0x20')](_0x37c1db,_0x1779fb,!![]);}catch(_0x433f6c){return BPromise[_0x7a52('0x21')](_0x433f6c);}return _0x37c1db['save']();};}function saveUpdates(_0x45b7f8,_0x2f3406){return function(_0x31d1c8){if(_0x31d1c8){return _0x31d1c8['update'](_0x45b7f8)[_0x7a52('0x22')](function(_0x245459){return _0x245459;});}return null;};}function removeEntity(_0x3527c3,_0x1ea268){return function(_0x285ca5){if(_0x285ca5){return _0x285ca5[_0x7a52('0x23')]()['then'](function(){var _0x303d0f=_0x285ca5[_0x7a52('0x24')]({'plain':!![]});var _0x29c49e='Templates';return db[_0x7a52('0x25')][_0x7a52('0x23')]({'where':{'type':_0x29c49e,'resourceId':_0x303d0f['id']}})[_0x7a52('0x22')](function(){return _0x285ca5;});})[_0x7a52('0x22')](function(){_0x3527c3[_0x7a52('0x19')](0xcc)[_0x7a52('0x1a')]();});}};}function handleEntityNotFound(_0x427d5f,_0x543480){return function(_0x5d4960){if(!_0x5d4960){_0x427d5f[_0x7a52('0x26')](0x194);}return _0x5d4960;};}function handleError(_0xb16a0a,_0x4e5f64){_0x4e5f64=_0x4e5f64||0x1f4;return function(_0x30263c){logger[_0x7a52('0x27')](_0x30263c[_0x7a52('0x28')]);if(_0x30263c['name']){delete _0x30263c[_0x7a52('0x29')];}_0xb16a0a['status'](_0x4e5f64)['send'](_0x30263c);};}exports[_0x7a52('0x2a')]=function(_0x13f769,_0x4d0b09){var _0x96486d={},_0xd5f65d={},_0x35d457={'count':0x0,'rows':[]};var _0xc25782=_[_0x7a52('0x2b')](db['Template'][_0x7a52('0x2c')],function(_0x396701){return{'name':_0x396701[_0x7a52('0x2d')],'type':_0x396701[_0x7a52('0x2e')][_0x7a52('0x2f')]};});_0xd5f65d[_0x7a52('0x30')]=_['map'](_0xc25782,_0x7a52('0x29'));_0xd5f65d[_0x7a52('0x31')]=_[_0x7a52('0x32')](_0x13f769[_0x7a52('0x31')]);_0xd5f65d[_0x7a52('0x33')]=_['intersection'](_0xd5f65d[_0x7a52('0x30')],_0xd5f65d[_0x7a52('0x31')]);_0x96486d['attributes']=_[_0x7a52('0x34')](_0xd5f65d[_0x7a52('0x30')],qs[_0x7a52('0x35')](_0x13f769[_0x7a52('0x31')][_0x7a52('0x35')]));_0x96486d['attributes']=_0x96486d['attributes']['length']?_0x96486d[_0x7a52('0x36')]:_0xd5f65d[_0x7a52('0x30')];if(!_0x13f769['query']['hasOwnProperty'](_0x7a52('0x37'))){_0x96486d[_0x7a52('0x1d')]=qs['limit'](_0x13f769['query'][_0x7a52('0x1d')]);_0x96486d[_0x7a52('0x38')]=qs[_0x7a52('0x38')](_0x13f769[_0x7a52('0x31')][_0x7a52('0x38')]);}_0x96486d[_0x7a52('0x39')]=qs[_0x7a52('0x3a')](_0x13f769[_0x7a52('0x31')][_0x7a52('0x3a')]);_0x96486d['where']=qs[_0x7a52('0x33')](_[_0x7a52('0x3b')](_0x13f769['query'],_0xd5f65d[_0x7a52('0x33')]),_0xc25782);if(_0x13f769[_0x7a52('0x31')][_0x7a52('0x3c')]){_0x96486d['where']=_[_0x7a52('0x3d')](_0x96486d[_0x7a52('0x3e')],{'$or':_[_0x7a52('0x2b')](_0xc25782,function(_0x3568ed){if(_0x3568ed[_0x7a52('0x2e')]!==_0x7a52('0x3f')){var _0x103e2f={};_0x103e2f[_0x3568ed[_0x7a52('0x29')]]={'$like':'%'+_0x13f769[_0x7a52('0x31')][_0x7a52('0x3c')]+'%'};return _0x103e2f;}})});}_0x96486d=_[_0x7a52('0x3d')]({},_0x96486d,_0x13f769[_0x7a52('0x40')]);var _0x4523b0={'where':_0x96486d[_0x7a52('0x3e')]};return db[_0x7a52('0x41')][_0x7a52('0x1e')](_0x4523b0)[_0x7a52('0x22')](function(_0x247196){_0x35d457[_0x7a52('0x1e')]=_0x247196;if(_0x13f769[_0x7a52('0x31')]['includeAll']){_0x96486d[_0x7a52('0x42')]=[{'all':!![]}];}return db['Template']['findAll'](_0x96486d);})[_0x7a52('0x22')](function(_0x2382f0){_0x35d457[_0x7a52('0x43')]=_0x2382f0;return _0x35d457;})[_0x7a52('0x22')](respondWithFilteredResult(_0x4d0b09,_0x96486d))[_0x7a52('0x44')](handleError(_0x4d0b09,null));};exports[_0x7a52('0x45')]=function(_0x2f890b,_0x245b2b){var _0x325867={'raw':!![],'where':{'id':_0x2f890b[_0x7a52('0x46')]['id']}},_0x394640={};_0x394640[_0x7a52('0x30')]=_['keys'](db[_0x7a52('0x41')][_0x7a52('0x2c')]);_0x394640[_0x7a52('0x31')]=_[_0x7a52('0x32')](_0x2f890b[_0x7a52('0x31')]);_0x394640[_0x7a52('0x33')]=_[_0x7a52('0x34')](_0x394640['model'],_0x394640['query']);_0x325867[_0x7a52('0x36')]=_['intersection'](_0x394640[_0x7a52('0x30')],qs[_0x7a52('0x35')](_0x2f890b[_0x7a52('0x31')][_0x7a52('0x35')]));_0x325867[_0x7a52('0x36')]=_0x325867[_0x7a52('0x36')]['length']?_0x325867[_0x7a52('0x36')]:_0x394640[_0x7a52('0x30')];if(_0x2f890b['query'][_0x7a52('0x47')]){_0x325867['include']=[{'all':!![]}];}_0x325867=_['merge']({},_0x325867,_0x2f890b['options']);return db[_0x7a52('0x41')][_0x7a52('0x48')](_0x325867)[_0x7a52('0x22')](handleEntityNotFound(_0x245b2b,null))[_0x7a52('0x22')](respondWithResult(_0x245b2b,null))[_0x7a52('0x44')](handleError(_0x245b2b,null));};exports[_0x7a52('0x49')]=function(_0x6027c2,_0xb9b064){return db['Template'][_0x7a52('0x49')](_0x6027c2[_0x7a52('0x4a')],{})[_0x7a52('0x22')](function(_0x4a082b){var _0x2c0374=_0x6027c2[_0x7a52('0x4b')][_0x7a52('0x24')]({'plain':!![]});if(!_0x2c0374)throw new Error(_0x7a52('0x4c'));if(_0x2c0374[_0x7a52('0x4d')]==='user'){var _0x1ff68b=_0x4a082b['get']({'plain':!![]});var _0x299d29=_0x7a52('0x4e');return db['UserProfileSection'][_0x7a52('0x48')]({'where':{'name':_0x299d29,'userProfileId':_0x2c0374[_0x7a52('0x4f')]},'raw':!![]})['then'](function(_0x4b3e11){if(_0x4b3e11&&_0x4b3e11[_0x7a52('0x50')]===0x0){return db[_0x7a52('0x25')][_0x7a52('0x49')]({'name':_0x1ff68b['name'],'resourceId':_0x1ff68b['id'],'type':_0x4b3e11[_0x7a52('0x29')],'sectionId':_0x4b3e11['id']},{})[_0x7a52('0x22')](function(){return _0x4a082b;});}else{return _0x4a082b;}})[_0x7a52('0x44')](function(_0x31d69f){logger[_0x7a52('0x27')](_0x7a52('0x51'),_0x31d69f);throw _0x31d69f;});}return _0x4a082b;})[_0x7a52('0x22')](respondWithResult(_0xb9b064,0xc9))['catch'](handleError(_0xb9b064,null));};exports[_0x7a52('0x52')]=function(_0x2f5c63,_0x237873){if(_0x2f5c63['body']['id']){delete _0x2f5c63['body']['id'];}return db[_0x7a52('0x41')][_0x7a52('0x48')]({'where':{'id':_0x2f5c63[_0x7a52('0x46')]['id']}})[_0x7a52('0x22')](handleEntityNotFound(_0x237873,null))['then'](saveUpdates(_0x2f5c63[_0x7a52('0x4a')],null))[_0x7a52('0x22')](respondWithResult(_0x237873,null))['catch'](handleError(_0x237873,null));};exports[_0x7a52('0x23')]=function(_0x5acbcd,_0x51d6f6){return db['Template']['find']({'where':{'id':_0x5acbcd[_0x7a52('0x46')]['id']}})['then'](handleEntityNotFound(_0x51d6f6,null))[_0x7a52('0x22')](removeEntity(_0x51d6f6,null))[_0x7a52('0x44')](handleError(_0x51d6f6,null));}; \ No newline at end of file +var _0xe7c6=['status','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','get','Templates','UserProfileResource','end','error','stack','send','map','Template','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','length','body','user','find','userProfileId','autoAssociation','create','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','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','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x1d775a,_0x16b18f){var _0x671c78=function(_0x4f30f0){while(--_0x4f30f0){_0x1d775a['push'](_0x1d775a['shift']());}};_0x671c78(++_0x16b18f);}(_0xe7c6,0x137));var _0x6e7c=function(_0x415a9f,_0x381892){_0x415a9f=_0x415a9f-0x0;var _0x263a2e=_0xe7c6[_0x415a9f];return _0x263a2e;};'use strict';var emlformat=require(_0x6e7c('0x0'));var rimraf=require(_0x6e7c('0x1'));var zipdir=require(_0x6e7c('0x2'));var jsonpatch=require(_0x6e7c('0x3'));var rp=require('request-promise');var moment=require(_0x6e7c('0x4'));var BPromise=require(_0x6e7c('0x5'));var Mustache=require('mustache');var util=require(_0x6e7c('0x6'));var path=require(_0x6e7c('0x7'));var sox=require(_0x6e7c('0x8'));var csv=require('to-csv');var ejs=require(_0x6e7c('0x9'));var fs=require('fs');var fs_extra=require(_0x6e7c('0xa'));var _=require(_0x6e7c('0xb'));var squel=require(_0x6e7c('0xc'));var crypto=require(_0x6e7c('0xd'));var jsforce=require(_0x6e7c('0xe'));var deskjs=require(_0x6e7c('0xf'));var toCsv=require(_0x6e7c('0x10'));var querystring=require('querystring');var Papa=require(_0x6e7c('0x11'));var Redis=require(_0x6e7c('0x12'));var authService=require(_0x6e7c('0x13'));var qs=require(_0x6e7c('0x14'));var as=require(_0x6e7c('0x15'));var hardwareService=require(_0x6e7c('0x16'));var logger=require(_0x6e7c('0x17'))('api');var utils=require(_0x6e7c('0x18'));var config=require(_0x6e7c('0x19'));var licenseUtil=require(_0x6e7c('0x1a'));var db=require(_0x6e7c('0x1b'))['db'];function respondWithStatusCode(_0x228e3c,_0xd39e5){_0xd39e5=_0xd39e5||0xcc;return function(_0x18832b){if(_0x18832b){return _0x228e3c[_0x6e7c('0x1c')](_0xd39e5);}return _0x228e3c[_0x6e7c('0x1d')](_0xd39e5)['end']();};}function respondWithResult(_0x4d06c3,_0x22b887){_0x22b887=_0x22b887||0xc8;return function(_0x67a613){if(_0x67a613){return _0x4d06c3[_0x6e7c('0x1d')](_0x22b887)[_0x6e7c('0x1e')](_0x67a613);}};}function respondWithFilteredResult(_0x3473fe,_0x31e8f7){return function(_0x327ddb){if(_0x327ddb){var _0x496e17=typeof _0x31e8f7[_0x6e7c('0x1f')]===_0x6e7c('0x20')&&typeof _0x31e8f7[_0x6e7c('0x21')]==='undefined';var _0x53f0b2=_0x327ddb[_0x6e7c('0x22')];var _0x2f37ea=_0x496e17?0x0:_0x31e8f7['offset'];var _0x4304cc=_0x496e17?_0x327ddb['count']:_0x31e8f7[_0x6e7c('0x1f')]+_0x31e8f7[_0x6e7c('0x21')];var _0x775990;if(_0x4304cc>=_0x53f0b2){_0x4304cc=_0x53f0b2;_0x775990=0xc8;}else{_0x775990=0xce;}_0x3473fe['status'](_0x775990);return _0x3473fe['set'](_0x6e7c('0x23'),_0x2f37ea+'-'+_0x4304cc+'/'+_0x53f0b2)[_0x6e7c('0x1e')](_0x327ddb);}return null;};}function patchUpdates(_0x2eed85){return function(_0x5f5ad0){try{jsonpatch['apply'](_0x5f5ad0,_0x2eed85,!![]);}catch(_0x488fbf){return BPromise[_0x6e7c('0x24')](_0x488fbf);}return _0x5f5ad0[_0x6e7c('0x25')]();};}function saveUpdates(_0x132f04,_0x2f5288){return function(_0x3589a0){if(_0x3589a0){return _0x3589a0[_0x6e7c('0x26')](_0x132f04)[_0x6e7c('0x27')](function(_0x130901){return _0x130901;});}return null;};}function removeEntity(_0xbec1ff,_0x51ef1a){return function(_0x1f75c6){if(_0x1f75c6){return _0x1f75c6[_0x6e7c('0x28')]()[_0x6e7c('0x27')](function(){var _0x13f7c8=_0x1f75c6[_0x6e7c('0x29')]({'plain':!![]});var _0x4088ef=_0x6e7c('0x2a');return db[_0x6e7c('0x2b')][_0x6e7c('0x28')]({'where':{'type':_0x4088ef,'resourceId':_0x13f7c8['id']}})['then'](function(){return _0x1f75c6;});})[_0x6e7c('0x27')](function(){_0xbec1ff['status'](0xcc)[_0x6e7c('0x2c')]();});}};}function handleEntityNotFound(_0x2db6d2,_0x102e4b){return function(_0x3e79b8){if(!_0x3e79b8){_0x2db6d2[_0x6e7c('0x1c')](0x194);}return _0x3e79b8;};}function handleError(_0x5211e6,_0xc94777){_0xc94777=_0xc94777||0x1f4;return function(_0x438e41){logger[_0x6e7c('0x2d')](_0x438e41[_0x6e7c('0x2e')]);if(_0x438e41['name']){delete _0x438e41['name'];}_0x5211e6[_0x6e7c('0x1d')](_0xc94777)[_0x6e7c('0x2f')](_0x438e41);};}exports['index']=function(_0x74416a,_0x5ca70a){var _0x2d1127={},_0x24f396={},_0x560c94={'count':0x0,'rows':[]};var _0x354feb=_[_0x6e7c('0x30')](db[_0x6e7c('0x31')][_0x6e7c('0x32')],function(_0x1f4fe8){return{'name':_0x1f4fe8[_0x6e7c('0x33')],'type':_0x1f4fe8[_0x6e7c('0x34')][_0x6e7c('0x35')]};});_0x24f396[_0x6e7c('0x36')]=_[_0x6e7c('0x30')](_0x354feb,'name');_0x24f396[_0x6e7c('0x37')]=_[_0x6e7c('0x38')](_0x74416a[_0x6e7c('0x37')]);_0x24f396[_0x6e7c('0x39')]=_[_0x6e7c('0x3a')](_0x24f396[_0x6e7c('0x36')],_0x24f396[_0x6e7c('0x37')]);_0x2d1127[_0x6e7c('0x3b')]=_['intersection'](_0x24f396['model'],qs[_0x6e7c('0x3c')](_0x74416a[_0x6e7c('0x37')]['fields']));_0x2d1127[_0x6e7c('0x3b')]=_0x2d1127[_0x6e7c('0x3b')]['length']?_0x2d1127[_0x6e7c('0x3b')]:_0x24f396[_0x6e7c('0x36')];if(!_0x74416a[_0x6e7c('0x37')][_0x6e7c('0x3d')](_0x6e7c('0x3e'))){_0x2d1127['limit']=qs[_0x6e7c('0x21')](_0x74416a[_0x6e7c('0x37')]['limit']);_0x2d1127['offset']=qs[_0x6e7c('0x1f')](_0x74416a['query'][_0x6e7c('0x1f')]);}_0x2d1127[_0x6e7c('0x3f')]=qs[_0x6e7c('0x40')](_0x74416a[_0x6e7c('0x37')][_0x6e7c('0x40')]);_0x2d1127['where']=qs['filters'](_['pick'](_0x74416a['query'],_0x24f396[_0x6e7c('0x39')]),_0x354feb);if(_0x74416a['query']['filter']){_0x2d1127[_0x6e7c('0x41')]=_[_0x6e7c('0x42')](_0x2d1127['where'],{'$or':_['map'](_0x354feb,function(_0x4473c2){if(_0x4473c2['type']!==_0x6e7c('0x43')){var _0x56791b={};_0x56791b[_0x4473c2['name']]={'$like':'%'+_0x74416a['query'][_0x6e7c('0x44')]+'%'};return _0x56791b;}})});}_0x2d1127=_['merge']({},_0x2d1127,_0x74416a[_0x6e7c('0x45')]);var _0x3148aa={'where':_0x2d1127['where']};return db[_0x6e7c('0x31')]['count'](_0x3148aa)['then'](function(_0x5f0263){_0x560c94['count']=_0x5f0263;if(_0x74416a['query'][_0x6e7c('0x46')]){_0x2d1127['include']=[{'all':!![]}];}return db[_0x6e7c('0x31')][_0x6e7c('0x47')](_0x2d1127);})['then'](function(_0x572b01){_0x560c94[_0x6e7c('0x48')]=_0x572b01;return _0x560c94;})[_0x6e7c('0x27')](respondWithFilteredResult(_0x5ca70a,_0x2d1127))[_0x6e7c('0x49')](handleError(_0x5ca70a,null));};exports[_0x6e7c('0x4a')]=function(_0x47f930,_0x193673){var _0x3a1632={'raw':!![],'where':{'id':_0x47f930[_0x6e7c('0x4b')]['id']}},_0x1fed6f={};_0x1fed6f[_0x6e7c('0x36')]=_['keys'](db['Template'][_0x6e7c('0x32')]);_0x1fed6f['query']=_[_0x6e7c('0x38')](_0x47f930[_0x6e7c('0x37')]);_0x1fed6f[_0x6e7c('0x39')]=_[_0x6e7c('0x3a')](_0x1fed6f['model'],_0x1fed6f[_0x6e7c('0x37')]);_0x3a1632[_0x6e7c('0x3b')]=_[_0x6e7c('0x3a')](_0x1fed6f['model'],qs[_0x6e7c('0x3c')](_0x47f930[_0x6e7c('0x37')][_0x6e7c('0x3c')]));_0x3a1632[_0x6e7c('0x3b')]=_0x3a1632[_0x6e7c('0x3b')][_0x6e7c('0x4c')]?_0x3a1632[_0x6e7c('0x3b')]:_0x1fed6f[_0x6e7c('0x36')];if(_0x47f930[_0x6e7c('0x37')][_0x6e7c('0x46')]){_0x3a1632['include']=[{'all':!![]}];}_0x3a1632=_['merge']({},_0x3a1632,_0x47f930[_0x6e7c('0x45')]);return db[_0x6e7c('0x31')]['find'](_0x3a1632)[_0x6e7c('0x27')](handleEntityNotFound(_0x193673,null))[_0x6e7c('0x27')](respondWithResult(_0x193673,null))['catch'](handleError(_0x193673,null));};exports['create']=function(_0x5aed77,_0x10bfde){return db[_0x6e7c('0x31')]['create'](_0x5aed77[_0x6e7c('0x4d')],{})['then'](function(_0x3dccea){var _0x2cabe4=_0x5aed77[_0x6e7c('0x4e')][_0x6e7c('0x29')]({'plain':!![]});if(!_0x2cabe4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2cabe4['role']===_0x6e7c('0x4e')){var _0x585f6b=_0x3dccea[_0x6e7c('0x29')]({'plain':!![]});var _0x1d65c8=_0x6e7c('0x2a');return db['UserProfileSection'][_0x6e7c('0x4f')]({'where':{'name':_0x1d65c8,'userProfileId':_0x2cabe4[_0x6e7c('0x50')]},'raw':!![]})[_0x6e7c('0x27')](function(_0x304866){if(_0x304866&&_0x304866[_0x6e7c('0x51')]===0x0){return db[_0x6e7c('0x2b')][_0x6e7c('0x52')]({'name':_0x585f6b[_0x6e7c('0x53')],'resourceId':_0x585f6b['id'],'type':_0x304866['name'],'sectionId':_0x304866['id']},{})[_0x6e7c('0x27')](function(){return _0x3dccea;});}else{return _0x3dccea;}})[_0x6e7c('0x49')](function(_0x570345){logger[_0x6e7c('0x2d')](_0x6e7c('0x54'),_0x570345);throw _0x570345;});}return _0x3dccea;})[_0x6e7c('0x27')](respondWithResult(_0x10bfde,0xc9))[_0x6e7c('0x49')](handleError(_0x10bfde,null));};exports['update']=function(_0x5af1de,_0x8d0974){if(_0x5af1de[_0x6e7c('0x4d')]['id']){delete _0x5af1de[_0x6e7c('0x4d')]['id'];}return db[_0x6e7c('0x31')][_0x6e7c('0x4f')]({'where':{'id':_0x5af1de[_0x6e7c('0x4b')]['id']}})[_0x6e7c('0x27')](handleEntityNotFound(_0x8d0974,null))[_0x6e7c('0x27')](saveUpdates(_0x5af1de[_0x6e7c('0x4d')],null))[_0x6e7c('0x27')](respondWithResult(_0x8d0974,null))[_0x6e7c('0x49')](handleError(_0x8d0974,null));};exports[_0x6e7c('0x28')]=function(_0x5804e0,_0x29fba2){return db[_0x6e7c('0x31')][_0x6e7c('0x4f')]({'where':{'id':_0x5804e0[_0x6e7c('0x4b')]['id']}})[_0x6e7c('0x27')](handleEntityNotFound(_0x29fba2,null))[_0x6e7c('0x27')](removeEntity(_0x29fba2,null))[_0x6e7c('0x49')](handleError(_0x29fba2,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 0f9202d..6a247b4 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 _0x0787=['define','tools_templates','lodash','util','api','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x406eac,_0x3b30a2){var _0x2392f7=function(_0x38120c){while(--_0x38120c){_0x406eac['push'](_0x406eac['shift']());}};_0x2392f7(++_0x3b30a2);}(_0x0787,0x142));var _0x7078=function(_0x10852d,_0x4cdcc6){_0x10852d=_0x10852d-0x0;var _0x13a8d6=_0x0787[_0x10852d];return _0x13a8d6;};'use strict';var _=require(_0x7078('0x0'));var util=require(_0x7078('0x1'));var logger=require('../../config/logger')(_0x7078('0x2'));var moment=require('moment');var BPromise=require(_0x7078('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7078('0x4'));var rimraf=require(_0x7078('0x5'));var config=require(_0x7078('0x6'));var attributes=require('./template.attributes');module[_0x7078('0x7')]=function(_0x2b4f3a,_0x472050){return _0x2b4f3a[_0x7078('0x8')]('Template',attributes,{'tableName':_0x7078('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd7ed=['request-promise','path','rimraf','../../config/environment','./template.attributes','exports','util','api','moment'];(function(_0x23de72,_0x527729){var _0x1dabb4=function(_0x58f42b){while(--_0x58f42b){_0x23de72['push'](_0x23de72['shift']());}};_0x1dabb4(++_0x527729);}(_0xd7ed,0xa8));var _0xdd7e=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xd7ed[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var util=require(_0xdd7e('0x0'));var logger=require('../../config/logger')(_0xdd7e('0x1'));var moment=require(_0xdd7e('0x2'));var BPromise=require('bluebird');var rp=require(_0xdd7e('0x3'));var fs=require('fs');var path=require(_0xdd7e('0x4'));var rimraf=require(_0xdd7e('0x5'));var config=require(_0xdd7e('0x6'));var attributes=require(_0xdd7e('0x7'));module[_0xdd7e('0x8')]=function(_0x36b588,_0x1896b8){return _0x36b588['define']('Template',attributes,{'tableName':'tools_templates','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 78aa2dc..cfebce2 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 _0xd02d=['rpc','../../config/environment','jayson/promise','client','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetTemplate','Template','options','raw','where','attributes','limit','include','map','model','bluebird','randomstring','ioredis','../../config/logger'];(function(_0x1da46b,_0x109ac4){var _0x3a94ef=function(_0x31a2b4){while(--_0x31a2b4){_0x1da46b['push'](_0x1da46b['shift']());}};_0x3a94ef(++_0x109ac4);}(_0xd02d,0x1dc));var _0xdd02=function(_0x8b9e62,_0x173b44){_0x8b9e62=_0x8b9e62-0x0;var _0x31a9a0=_0xd02d[_0x8b9e62];return _0x31a9a0;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xdd02('0x0'));var rs=require(_0xdd02('0x1'));var fs=require('fs');var Redis=require(_0xdd02('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xdd02('0x3'))(_0xdd02('0x4'));var config=require(_0xdd02('0x5'));var jayson=require(_0xdd02('0x6'));var client=jayson[_0xdd02('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5018c8,_0x494f42,_0x5200fa){return new BPromise(function(_0x89d1a2,_0x4863ef){return client[_0xdd02('0x8')](_0x5018c8,_0x5200fa)[_0xdd02('0x9')](function(_0x5ef940){logger[_0xdd02('0xa')](_0xdd02('0xb'),_0x494f42,_0xdd02('0xc'));logger[_0xdd02('0xd')](_0xdd02('0xe'),_0x494f42,_0xdd02('0xc'),JSON[_0xdd02('0xf')](_0x5ef940));if(_0x5ef940['error']){if(_0x5ef940[_0xdd02('0x10')]['code']===0x1f4){logger[_0xdd02('0x10')](_0xdd02('0xb'),_0x494f42,_0x5ef940[_0xdd02('0x10')][_0xdd02('0x11')]);return _0x4863ef(_0x5ef940[_0xdd02('0x10')][_0xdd02('0x11')]);}logger[_0xdd02('0x10')](_0xdd02('0xb'),_0x494f42,_0x5ef940[_0xdd02('0x10')][_0xdd02('0x11')]);return _0x89d1a2(_0x5ef940['error'][_0xdd02('0x11')]);}else{logger[_0xdd02('0xa')]('Template,\x20%s,\x20%s',_0x494f42,_0xdd02('0xc'));_0x89d1a2(_0x5ef940[_0xdd02('0x12')][_0xdd02('0x11')]);}})[_0xdd02('0x13')](function(_0x39d875){logger[_0xdd02('0x10')](_0xdd02('0xb'),_0x494f42,_0x39d875);_0x4863ef(_0x39d875);});});}exports[_0xdd02('0x14')]=function(_0x56fe46){var _0x3537eb=this;return new Promise(function(_0x4b9b02,_0x14a780){return db[_0xdd02('0x15')]['findAll']({'raw':_0x56fe46[_0xdd02('0x16')]?_0x56fe46['options'][_0xdd02('0x17')]===undefined?!![]:![]:!![],'where':_0x56fe46[_0xdd02('0x16')]?_0x56fe46['options'][_0xdd02('0x18')]||null:null,'attributes':_0x56fe46[_0xdd02('0x16')]?_0x56fe46[_0xdd02('0x16')][_0xdd02('0x19')]||null:null,'limit':_0x56fe46[_0xdd02('0x16')]?_0x56fe46[_0xdd02('0x16')][_0xdd02('0x1a')]||null:null,'include':_0x56fe46[_0xdd02('0x16')]?_0x56fe46[_0xdd02('0x16')][_0xdd02('0x1b')]?_[_0xdd02('0x1c')](_0x56fe46[_0xdd02('0x16')][_0xdd02('0x1b')],function(_0x29e1de){return{'model':db[_0x29e1de['model']],'as':_0x29e1de['as'],'attributes':_0x29e1de[_0xdd02('0x19')],'include':_0x29e1de['include']?_[_0xdd02('0x1c')](_0x29e1de['include'],function(_0x1149cc){return{'model':db[_0x1149cc[_0xdd02('0x1d')]],'as':_0x1149cc['as'],'attributes':_0x1149cc[_0xdd02('0x19')],'include':_0x1149cc[_0xdd02('0x1b')]?_[_0xdd02('0x1c')](_0x1149cc['include'],function(_0x1acee1){return{'model':db[_0x1acee1[_0xdd02('0x1d')]],'as':_0x1acee1['as'],'attributes':_0x1acee1[_0xdd02('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x16821c){logger[_0xdd02('0xa')](_0xdd02('0x14'),_0x56fe46);logger['debug']('GetTemplate',_0x56fe46,JSON[_0xdd02('0xf')](_0x16821c));_0x4b9b02(_0x16821c);})['catch'](function(_0x4dbccf){logger['error'](_0xdd02('0x14'),_0x4dbccf['message'],_0x56fe46);_0x14a780(_0x3537eb[_0xdd02('0x10')](0x1f4,_0x4dbccf[_0xdd02('0x11')]));});});}; \ No newline at end of file +var _0x0d3d=['moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Template','findAll','options','raw','where','limit','include','map','model','attributes','GetTemplate','lodash','util'];(function(_0x36cde4,_0x1a338c){var _0x7584be=function(_0x387d24){while(--_0x387d24){_0x36cde4['push'](_0x36cde4['shift']());}};_0x7584be(++_0x1a338c);}(_0x0d3d,0x1ab));var _0xd0d3=function(_0x488b8f,_0x3bf06e){_0x488b8f=_0x488b8f-0x0;var _0x3c6165=_0x0d3d[_0x488b8f];return _0x3c6165;};'use strict';var _=require(_0xd0d3('0x0'));var util=require(_0xd0d3('0x1'));var moment=require(_0xd0d3('0x2'));var BPromise=require(_0xd0d3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd0d3('0x4'))['db'];var utils=require(_0xd0d3('0x5'));var logger=require(_0xd0d3('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd0d3('0x7'));var client=jayson[_0xd0d3('0x8')][_0xd0d3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x6a346f,_0x50f157,_0x2a2338){return new BPromise(function(_0x30910a,_0x533075){return client['request'](_0x6a346f,_0x2a2338)[_0xd0d3('0xa')](function(_0xb92367){logger[_0xd0d3('0xb')](_0xd0d3('0xc'),_0x50f157,_0xd0d3('0xd'));logger[_0xd0d3('0xe')](_0xd0d3('0xf'),_0x50f157,_0xd0d3('0xd'),JSON[_0xd0d3('0x10')](_0xb92367));if(_0xb92367[_0xd0d3('0x11')]){if(_0xb92367['error'][_0xd0d3('0x12')]===0x1f4){logger[_0xd0d3('0x11')](_0xd0d3('0xc'),_0x50f157,_0xb92367[_0xd0d3('0x11')][_0xd0d3('0x13')]);return _0x533075(_0xb92367[_0xd0d3('0x11')][_0xd0d3('0x13')]);}logger[_0xd0d3('0x11')](_0xd0d3('0xc'),_0x50f157,_0xb92367[_0xd0d3('0x11')][_0xd0d3('0x13')]);return _0x30910a(_0xb92367[_0xd0d3('0x11')][_0xd0d3('0x13')]);}else{logger[_0xd0d3('0xb')]('Template,\x20%s,\x20%s',_0x50f157,'request\x20sent');_0x30910a(_0xb92367[_0xd0d3('0x14')]['message']);}})[_0xd0d3('0x15')](function(_0x4d8d33){logger[_0xd0d3('0x11')]('Template,\x20%s,\x20%s',_0x50f157,_0x4d8d33);_0x533075(_0x4d8d33);});});}exports['GetTemplate']=function(_0x187554){var _0xb7dbb7=this;return new Promise(function(_0x369fdd,_0x2a8095){return db[_0xd0d3('0x16')][_0xd0d3('0x17')]({'raw':_0x187554['options']?_0x187554[_0xd0d3('0x18')][_0xd0d3('0x19')]===undefined?!![]:![]:!![],'where':_0x187554['options']?_0x187554[_0xd0d3('0x18')][_0xd0d3('0x1a')]||null:null,'attributes':_0x187554[_0xd0d3('0x18')]?_0x187554['options']['attributes']||null:null,'limit':_0x187554['options']?_0x187554[_0xd0d3('0x18')][_0xd0d3('0x1b')]||null:null,'include':_0x187554[_0xd0d3('0x18')]?_0x187554[_0xd0d3('0x18')][_0xd0d3('0x1c')]?_[_0xd0d3('0x1d')](_0x187554[_0xd0d3('0x18')]['include'],function(_0x151066){return{'model':db[_0x151066[_0xd0d3('0x1e')]],'as':_0x151066['as'],'attributes':_0x151066[_0xd0d3('0x1f')],'include':_0x151066[_0xd0d3('0x1c')]?_[_0xd0d3('0x1d')](_0x151066[_0xd0d3('0x1c')],function(_0x263c1f){return{'model':db[_0x263c1f[_0xd0d3('0x1e')]],'as':_0x263c1f['as'],'attributes':_0x263c1f[_0xd0d3('0x1f')],'include':_0x263c1f[_0xd0d3('0x1c')]?_[_0xd0d3('0x1d')](_0x263c1f[_0xd0d3('0x1c')],function(_0x182231){return{'model':db[_0x182231[_0xd0d3('0x1e')]],'as':_0x182231['as'],'attributes':_0x182231['attributes']};}):[]};}):[]};}):[]:[]})[_0xd0d3('0xa')](function(_0xbe17d6){logger[_0xd0d3('0xb')](_0xd0d3('0x20'),_0x187554);logger['debug'](_0xd0d3('0x20'),_0x187554,JSON['stringify'](_0xbe17d6));_0x369fdd(_0xbe17d6);})[_0xd0d3('0x15')](function(_0x421551){logger[_0xd0d3('0x11')]('GetTemplate',_0x421551[_0xd0d3('0x13')],_0x187554);_0x2a8095(_0xb7dbb7['error'](0x1f4,_0x421551[_0xd0d3('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 3e6b5d6..67a44de 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 _0x61c0=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','show','/:id/all_conditions','getAllConditions','isAuthenticated','post','create','/:id/any_conditions','addAnyCondition','/:id/actions','addAction','put','/:id'];(function(_0x31eb58,_0x186966){var _0x2b3285=function(_0x185f17){while(--_0x185f17){_0x31eb58['push'](_0x31eb58['shift']());}};_0x2b3285(++_0x186966);}(_0x61c0,0x1b1));var _0x061c=function(_0x20daf4,_0x239f24){_0x20daf4=_0x20daf4-0x0;var _0x103fa6=_0x61c0[_0x20daf4];return _0x103fa6;};'use strict';var multer=require(_0x061c('0x0'));var util=require('util');var path=require(_0x061c('0x1'));var timeout=require(_0x061c('0x2'));var express=require(_0x061c('0x3'));var router=express[_0x061c('0x4')]();var fs_extra=require(_0x061c('0x5'));var auth=require(_0x061c('0x6'));var interaction=require(_0x061c('0x7'));var config=require(_0x061c('0x8'));var controller=require('./trigger.controller');router[_0x061c('0x9')]('/',auth['isAuthenticated'](),controller[_0x061c('0xa')]);router[_0x061c('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x061c('0xb')]);router[_0x061c('0x9')](_0x061c('0xc'),auth['isAuthenticated'](),controller[_0x061c('0xd')]);router[_0x061c('0x9')]('/:id/any_conditions',auth[_0x061c('0xe')](),controller['getAnyConditions']);router['get']('/:id/actions',auth[_0x061c('0xe')](),controller['getActions']);router[_0x061c('0xf')]('/',auth[_0x061c('0xe')](),controller[_0x061c('0x10')]);router[_0x061c('0xf')](_0x061c('0xc'),auth[_0x061c('0xe')](),controller['addAllCondition']);router[_0x061c('0xf')](_0x061c('0x11'),auth['isAuthenticated'](),controller[_0x061c('0x12')]);router[_0x061c('0xf')](_0x061c('0x13'),auth['isAuthenticated'](),controller[_0x061c('0x14')]);router[_0x061c('0x15')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x061c('0x16'),auth[_0x061c('0xe')](),controller['destroy']);module[_0x061c('0x17')]=router; \ No newline at end of file +var _0xb0dc=['/:id/any_conditions','/:id/actions','post','create','addAllCondition','addAnyCondition','addAction','put','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./trigger.controller','get','index','/:id','isAuthenticated','show','/:id/all_conditions'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0xb0dc,0x150));var _0xcb0d=function(_0xde5d89,_0x2f5fd5){_0xde5d89=_0xde5d89-0x0;var _0x4636db=_0xb0dc[_0xde5d89];return _0x4636db;};'use strict';var multer=require(_0xcb0d('0x0'));var util=require(_0xcb0d('0x1'));var path=require(_0xcb0d('0x2'));var timeout=require('connect-timeout');var express=require(_0xcb0d('0x3'));var router=express['Router']();var fs_extra=require(_0xcb0d('0x4'));var auth=require(_0xcb0d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xcb0d('0x6'));var controller=require(_0xcb0d('0x7'));router[_0xcb0d('0x8')]('/',auth['isAuthenticated'](),controller[_0xcb0d('0x9')]);router[_0xcb0d('0x8')](_0xcb0d('0xa'),auth[_0xcb0d('0xb')](),controller[_0xcb0d('0xc')]);router[_0xcb0d('0x8')](_0xcb0d('0xd'),auth['isAuthenticated'](),controller['getAllConditions']);router[_0xcb0d('0x8')](_0xcb0d('0xe'),auth[_0xcb0d('0xb')](),controller['getAnyConditions']);router[_0xcb0d('0x8')](_0xcb0d('0xf'),auth[_0xcb0d('0xb')](),controller['getActions']);router[_0xcb0d('0x10')]('/',auth[_0xcb0d('0xb')](),controller[_0xcb0d('0x11')]);router['post'](_0xcb0d('0xd'),auth[_0xcb0d('0xb')](),controller[_0xcb0d('0x12')]);router[_0xcb0d('0x10')]('/:id/any_conditions',auth[_0xcb0d('0xb')](),controller[_0xcb0d('0x13')]);router['post'](_0xcb0d('0xf'),auth[_0xcb0d('0xb')](),controller[_0xcb0d('0x14')]);router[_0xcb0d('0x15')](_0xcb0d('0xa'),auth[_0xcb0d('0xb')](),controller['update']);router[_0xcb0d('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xcb0d('0x17')]);module[_0xcb0d('0x18')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index aeb06ec..b8124e8 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 _0xedc2=['BOOLEAN','exports','STRING'];(function(_0x5e7321,_0x23689b){var _0xd93a73=function(_0xec3806){while(--_0xec3806){_0x5e7321['push'](_0x5e7321['shift']());}};_0xd93a73(++_0x23689b);}(_0xedc2,0xbe));var _0x2edc=function(_0x1ce39b,_0x454d68){_0x1ce39b=_0x1ce39b-0x0;var _0x11a92=_0xedc2[_0x1ce39b];return _0x11a92;};'use strict';var Sequelize=require('sequelize');module[_0x2edc('0x0')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x2edc('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x2edc('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x2192=['sequelize','exports','STRING','BOOLEAN'];(function(_0x198344,_0xe08e99){var _0x582b54=function(_0x218f50){while(--_0x218f50){_0x198344['push'](_0x198344['shift']());}};_0x582b54(++_0xe08e99);}(_0x2192,0x1a0));var _0x2219=function(_0x4aea8e,_0x507f5d){_0x4aea8e=_0x4aea8e-0x0;var _0x40320b=_0x2192[_0x4aea8e];return _0x40320b;};'use strict';var Sequelize=require(_0x2219('0x0'));module[_0x2219('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x2219('0x2')]},'description':{'type':Sequelize[_0x2219('0x2')]},'status':{'type':Sequelize[_0x2219('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 336a6b6..97601bf 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 _0xa0d4=['rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','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','json','offset','limit','undefined','count','set','reject','save','update','then','destroy','get','Triggers','end','error','stack','name','index','Trigger','rawAttributes','fieldName','type','key','map','query','intersection','model','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','keys','fields','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','catch','addAllCondition','TriggerAllId','Condition','TriggerAnyId','getAllConditions','findOne','hasOwnProperty','getAnyConditions','addAction','Action','getActions','eml-format'];(function(_0x2d7d1b,_0x440fcc){var _0x29460b=function(_0x2ef164){while(--_0x2ef164){_0x2d7d1b['push'](_0x2d7d1b['shift']());}};_0x29460b(++_0x440fcc);}(_0xa0d4,0x183));var _0x4a0d=function(_0xc04f5b,_0x3b98e1){_0xc04f5b=_0xc04f5b-0x0;var _0x58d378=_0xa0d4[_0xc04f5b];return _0x58d378;};'use strict';var emlformat=require(_0x4a0d('0x0'));var rimraf=require(_0x4a0d('0x1'));var zipdir=require(_0x4a0d('0x2'));var jsonpatch=require(_0x4a0d('0x3'));var rp=require(_0x4a0d('0x4'));var moment=require('moment');var BPromise=require(_0x4a0d('0x5'));var Mustache=require(_0x4a0d('0x6'));var util=require(_0x4a0d('0x7'));var path=require(_0x4a0d('0x8'));var sox=require(_0x4a0d('0x9'));var csv=require(_0x4a0d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4a0d('0xb'));var _=require(_0x4a0d('0xc'));var squel=require(_0x4a0d('0xd'));var crypto=require(_0x4a0d('0xe'));var jsforce=require(_0x4a0d('0xf'));var deskjs=require(_0x4a0d('0x10'));var toCsv=require(_0x4a0d('0xa'));var querystring=require(_0x4a0d('0x11'));var Papa=require(_0x4a0d('0x12'));var Redis=require('ioredis');var authService=require(_0x4a0d('0x13'));var qs=require(_0x4a0d('0x14'));var as=require(_0x4a0d('0x15'));var hardwareService=require(_0x4a0d('0x16'));var logger=require('../../config/logger')(_0x4a0d('0x17'));var utils=require(_0x4a0d('0x18'));var config=require(_0x4a0d('0x19'));var licenseUtil=require(_0x4a0d('0x1a'));var db=require(_0x4a0d('0x1b'))['db'];function respondWithStatusCode(_0x354925,_0x4a96a7){_0x4a96a7=_0x4a96a7||0xcc;return function(_0x42d42b){if(_0x42d42b){return _0x354925[_0x4a0d('0x1c')](_0x4a96a7);}return _0x354925[_0x4a0d('0x1d')](_0x4a96a7)['end']();};}function respondWithResult(_0x2d7587,_0x5ee901){_0x5ee901=_0x5ee901||0xc8;return function(_0x5c9a1f){if(_0x5c9a1f){return _0x2d7587[_0x4a0d('0x1d')](_0x5ee901)[_0x4a0d('0x1e')](_0x5c9a1f);}};}function respondWithFilteredResult(_0x5d7cee,_0x189998){return function(_0x1f2898){if(_0x1f2898){var _0x4ec1ae=typeof _0x189998[_0x4a0d('0x1f')]==='undefined'&&typeof _0x189998[_0x4a0d('0x20')]===_0x4a0d('0x21');var _0x1167ca=_0x1f2898[_0x4a0d('0x22')];var _0x4d2385=_0x4ec1ae?0x0:_0x189998['offset'];var _0x4267fc=_0x4ec1ae?_0x1f2898['count']:_0x189998[_0x4a0d('0x1f')]+_0x189998['limit'];var _0x5a0c6d;if(_0x4267fc>=_0x1167ca){_0x4267fc=_0x1167ca;_0x5a0c6d=0xc8;}else{_0x5a0c6d=0xce;}_0x5d7cee[_0x4a0d('0x1d')](_0x5a0c6d);return _0x5d7cee[_0x4a0d('0x23')]('Content-Range',_0x4d2385+'-'+_0x4267fc+'/'+_0x1167ca)[_0x4a0d('0x1e')](_0x1f2898);}return null;};}function patchUpdates(_0x3d1f51){return function(_0x155c26){try{jsonpatch['apply'](_0x155c26,_0x3d1f51,!![]);}catch(_0x1305d8){return BPromise[_0x4a0d('0x24')](_0x1305d8);}return _0x155c26[_0x4a0d('0x25')]();};}function saveUpdates(_0x427c0c,_0x5d67ee){return function(_0x5ac530){if(_0x5ac530){return _0x5ac530[_0x4a0d('0x26')](_0x427c0c)[_0x4a0d('0x27')](function(_0x14349b){return _0x14349b;});}return null;};}function removeEntity(_0x4bcecd,_0x31cd54){return function(_0x37b536){if(_0x37b536){return _0x37b536[_0x4a0d('0x28')]()['then'](function(){var _0x32fa46=_0x37b536[_0x4a0d('0x29')]({'plain':!![]});var _0x393525=_0x4a0d('0x2a');return db['UserProfileResource'][_0x4a0d('0x28')]({'where':{'type':_0x393525,'resourceId':_0x32fa46['id']}})[_0x4a0d('0x27')](function(){return _0x37b536;});})[_0x4a0d('0x27')](function(){_0x4bcecd['status'](0xcc)[_0x4a0d('0x2b')]();});}};}function handleEntityNotFound(_0x110db1,_0x470537){return function(_0x1ba4e0){if(!_0x1ba4e0){_0x110db1['sendStatus'](0x194);}return _0x1ba4e0;};}function handleError(_0x520975,_0x48fcfe){_0x48fcfe=_0x48fcfe||0x1f4;return function(_0x3c66bc){logger[_0x4a0d('0x2c')](_0x3c66bc[_0x4a0d('0x2d')]);if(_0x3c66bc[_0x4a0d('0x2e')]){delete _0x3c66bc[_0x4a0d('0x2e')];}_0x520975[_0x4a0d('0x1d')](_0x48fcfe)['send'](_0x3c66bc);};}exports[_0x4a0d('0x2f')]=function(_0x148c16,_0x30064e){var _0x440079={},_0x1c971b={},_0x5df125={'count':0x0,'rows':[]};var _0xf100dd=_['map'](db[_0x4a0d('0x30')][_0x4a0d('0x31')],function(_0x3532c9){return{'name':_0x3532c9[_0x4a0d('0x32')],'type':_0x3532c9[_0x4a0d('0x33')][_0x4a0d('0x34')]};});_0x1c971b['model']=_[_0x4a0d('0x35')](_0xf100dd,_0x4a0d('0x2e'));_0x1c971b['query']=_['keys'](_0x148c16[_0x4a0d('0x36')]);_0x1c971b['filters']=_[_0x4a0d('0x37')](_0x1c971b[_0x4a0d('0x38')],_0x1c971b[_0x4a0d('0x36')]);_0x440079[_0x4a0d('0x39')]=_[_0x4a0d('0x37')](_0x1c971b[_0x4a0d('0x38')],qs['fields'](_0x148c16[_0x4a0d('0x36')]['fields']));_0x440079[_0x4a0d('0x39')]=_0x440079[_0x4a0d('0x39')][_0x4a0d('0x3a')]?_0x440079[_0x4a0d('0x39')]:_0x1c971b[_0x4a0d('0x38')];if(!_0x148c16[_0x4a0d('0x36')]['hasOwnProperty'](_0x4a0d('0x3b'))){_0x440079[_0x4a0d('0x20')]=qs['limit'](_0x148c16[_0x4a0d('0x36')][_0x4a0d('0x20')]);_0x440079['offset']=qs[_0x4a0d('0x1f')](_0x148c16[_0x4a0d('0x36')][_0x4a0d('0x1f')]);}_0x440079[_0x4a0d('0x3c')]=qs[_0x4a0d('0x3d')](_0x148c16[_0x4a0d('0x36')][_0x4a0d('0x3d')]);_0x440079[_0x4a0d('0x3e')]=qs[_0x4a0d('0x3f')](_[_0x4a0d('0x40')](_0x148c16[_0x4a0d('0x36')],_0x1c971b['filters']),_0xf100dd);if(_0x148c16['query'][_0x4a0d('0x41')]){_0x440079['where']=_[_0x4a0d('0x42')](_0x440079[_0x4a0d('0x3e')],{'$or':_[_0x4a0d('0x35')](_0xf100dd,function(_0x29301f){if(_0x29301f['type']!==_0x4a0d('0x43')){var _0xba559={};_0xba559[_0x29301f[_0x4a0d('0x2e')]]={'$like':'%'+_0x148c16[_0x4a0d('0x36')]['filter']+'%'};return _0xba559;}})});}_0x440079=_[_0x4a0d('0x42')]({},_0x440079,_0x148c16[_0x4a0d('0x44')]);var _0x58e67f={'where':_0x440079['where']};return db[_0x4a0d('0x30')][_0x4a0d('0x22')](_0x58e67f)['then'](function(_0x10d40e){_0x5df125['count']=_0x10d40e;if(_0x148c16['query']['includeAll']){_0x440079[_0x4a0d('0x45')]=[{'all':!![]}];}return db[_0x4a0d('0x30')][_0x4a0d('0x46')](_0x440079);})['then'](function(_0x3ce17a){_0x5df125[_0x4a0d('0x47')]=_0x3ce17a;return _0x5df125;})[_0x4a0d('0x27')](respondWithFilteredResult(_0x30064e,_0x440079))['catch'](handleError(_0x30064e,null));};exports[_0x4a0d('0x48')]=function(_0x1e1cb4,_0x5a2900){var _0x438a0e={'raw':![],'where':{'id':_0x1e1cb4[_0x4a0d('0x49')]['id']}},_0x46ebef={};_0x46ebef[_0x4a0d('0x38')]=_[_0x4a0d('0x4a')](db[_0x4a0d('0x30')][_0x4a0d('0x31')]);_0x46ebef[_0x4a0d('0x36')]=_[_0x4a0d('0x4a')](_0x1e1cb4[_0x4a0d('0x36')]);_0x46ebef[_0x4a0d('0x3f')]=_[_0x4a0d('0x37')](_0x46ebef[_0x4a0d('0x38')],_0x46ebef[_0x4a0d('0x36')]);_0x438a0e['attributes']=_['intersection'](_0x46ebef[_0x4a0d('0x38')],qs[_0x4a0d('0x4b')](_0x1e1cb4['query']['fields']));_0x438a0e[_0x4a0d('0x39')]=_0x438a0e[_0x4a0d('0x39')][_0x4a0d('0x3a')]?_0x438a0e[_0x4a0d('0x39')]:_0x46ebef[_0x4a0d('0x38')];if(_0x1e1cb4[_0x4a0d('0x36')][_0x4a0d('0x4c')]){_0x438a0e[_0x4a0d('0x45')]=[{'all':!![]}];}_0x438a0e=_[_0x4a0d('0x42')]({},_0x438a0e,_0x1e1cb4[_0x4a0d('0x44')]);return db[_0x4a0d('0x30')][_0x4a0d('0x4d')](_0x438a0e)[_0x4a0d('0x27')](handleEntityNotFound(_0x5a2900,null))[_0x4a0d('0x27')](respondWithResult(_0x5a2900,null))['catch'](handleError(_0x5a2900,null));};exports[_0x4a0d('0x4e')]=function(_0x1b892c,_0x2bdb58){return db[_0x4a0d('0x30')][_0x4a0d('0x4e')](_0x1b892c[_0x4a0d('0x4f')],{})[_0x4a0d('0x27')](function(_0x368f49){var _0x2becb0=_0x1b892c[_0x4a0d('0x50')][_0x4a0d('0x29')]({'plain':!![]});if(!_0x2becb0)throw new Error(_0x4a0d('0x51'));if(_0x2becb0['role']===_0x4a0d('0x50')){var _0x56ca2b=_0x368f49[_0x4a0d('0x29')]({'plain':!![]});var _0x556a6f=_0x4a0d('0x2a');return db[_0x4a0d('0x52')][_0x4a0d('0x4d')]({'where':{'name':_0x556a6f,'userProfileId':_0x2becb0[_0x4a0d('0x53')]},'raw':!![]})[_0x4a0d('0x27')](function(_0x3da88c){if(_0x3da88c&&_0x3da88c[_0x4a0d('0x54')]===0x0){return db['UserProfileResource'][_0x4a0d('0x4e')]({'name':_0x56ca2b[_0x4a0d('0x2e')],'resourceId':_0x56ca2b['id'],'type':_0x3da88c['name'],'sectionId':_0x3da88c['id']},{})['then'](function(){return _0x368f49;});}else{return _0x368f49;}})[_0x4a0d('0x55')](function(_0x329df1){logger[_0x4a0d('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x329df1);throw _0x329df1;});}return _0x368f49;})[_0x4a0d('0x27')](respondWithResult(_0x2bdb58,0xc9))[_0x4a0d('0x55')](handleError(_0x2bdb58,null));};exports[_0x4a0d('0x26')]=function(_0x1bbfd2,_0x2bf027){if(_0x1bbfd2[_0x4a0d('0x4f')]['id']){delete _0x1bbfd2[_0x4a0d('0x4f')]['id'];}return db[_0x4a0d('0x30')][_0x4a0d('0x4d')]({'where':{'id':_0x1bbfd2['params']['id']}})[_0x4a0d('0x27')](handleEntityNotFound(_0x2bf027,null))[_0x4a0d('0x27')](saveUpdates(_0x1bbfd2[_0x4a0d('0x4f')],null))[_0x4a0d('0x27')](respondWithResult(_0x2bf027,null))[_0x4a0d('0x55')](handleError(_0x2bf027,null));};exports[_0x4a0d('0x28')]=function(_0x4411a9,_0x56c323){return db['Trigger']['find']({'where':{'id':_0x4411a9[_0x4a0d('0x49')]['id']}})['then'](handleEntityNotFound(_0x56c323,null))['then'](removeEntity(_0x56c323,null))[_0x4a0d('0x55')](handleError(_0x56c323,null));};exports[_0x4a0d('0x56')]=function(_0x2b85f3,_0x3a5e9b,_0x2d392c){if(_0x2b85f3[_0x4a0d('0x4f')]['id']){delete _0x2b85f3[_0x4a0d('0x4f')]['id'];}return db[_0x4a0d('0x30')][_0x4a0d('0x4d')]({'where':{'id':_0x2b85f3[_0x4a0d('0x49')]['id']}})[_0x4a0d('0x27')](handleEntityNotFound(_0x3a5e9b,null))[_0x4a0d('0x27')](function(_0x10e93c){if(_0x10e93c){_0x2b85f3[_0x4a0d('0x4f')][_0x4a0d('0x57')]=_0x10e93c['id'];return db[_0x4a0d('0x58')][_0x4a0d('0x4e')](_0x2b85f3[_0x4a0d('0x4f')]);}})[_0x4a0d('0x27')](respondWithResult(_0x3a5e9b,null))[_0x4a0d('0x55')](handleError(_0x3a5e9b,null));};exports['addAnyCondition']=function(_0x286299,_0x14b444,_0xceb769){if(_0x286299[_0x4a0d('0x4f')]['id']){delete _0x286299[_0x4a0d('0x4f')]['id'];}return db['Trigger'][_0x4a0d('0x4d')]({'where':{'id':_0x286299[_0x4a0d('0x49')]['id']}})[_0x4a0d('0x27')](handleEntityNotFound(_0x14b444,null))['then'](function(_0x4dc55b){if(_0x4dc55b){_0x286299[_0x4a0d('0x4f')][_0x4a0d('0x59')]=_0x4dc55b['id'];return db['Condition'][_0x4a0d('0x4e')](_0x286299[_0x4a0d('0x4f')]);}})[_0x4a0d('0x27')](respondWithResult(_0x14b444,null))[_0x4a0d('0x55')](handleError(_0x14b444,null));};exports[_0x4a0d('0x5a')]=function(_0x3aced4,_0x1d0f54,_0x214204){var _0x2fa723={};var _0x423e83={};var _0x228a9f;var _0x124d2e;return db['Trigger'][_0x4a0d('0x5b')]({'where':{'id':_0x3aced4[_0x4a0d('0x49')]['id']}})[_0x4a0d('0x27')](handleEntityNotFound(_0x1d0f54,null))[_0x4a0d('0x27')](function(_0x3b8bdb){if(_0x3b8bdb){_0x228a9f=_0x3b8bdb;_0x423e83[_0x4a0d('0x38')]=_['keys'](db[_0x4a0d('0x58')][_0x4a0d('0x31')]);_0x423e83[_0x4a0d('0x36')]=_[_0x4a0d('0x4a')](_0x3aced4['query']);_0x423e83['filters']=_[_0x4a0d('0x37')](_0x423e83[_0x4a0d('0x38')],_0x423e83[_0x4a0d('0x36')]);_0x2fa723[_0x4a0d('0x39')]=_[_0x4a0d('0x37')](_0x423e83[_0x4a0d('0x38')],qs[_0x4a0d('0x4b')](_0x3aced4[_0x4a0d('0x36')][_0x4a0d('0x4b')]));_0x2fa723[_0x4a0d('0x39')]=_0x2fa723[_0x4a0d('0x39')][_0x4a0d('0x3a')]?_0x2fa723[_0x4a0d('0x39')]:_0x423e83['model'];_0x2fa723['order']=qs['sort'](_0x3aced4[_0x4a0d('0x36')][_0x4a0d('0x3d')]);_0x2fa723['where']=qs['filters'](_[_0x4a0d('0x40')](_0x3aced4[_0x4a0d('0x36')],_0x423e83[_0x4a0d('0x3f')]));if(_0x3aced4[_0x4a0d('0x36')][_0x4a0d('0x41')]){_0x2fa723[_0x4a0d('0x3e')]=_[_0x4a0d('0x42')](_0x2fa723['where'],{'$or':_[_0x4a0d('0x35')](_0x2fa723['attributes'],function(_0x92cbf6){var _0x5a6ff0={};_0x5a6ff0[_0x92cbf6]={'$like':'%'+_0x3aced4[_0x4a0d('0x36')][_0x4a0d('0x41')]+'%'};return _0x5a6ff0;})});}_0x2fa723=_['merge']({},_0x2fa723,_0x3aced4['options']);return _0x228a9f['getAllConditions'](_0x2fa723);}})[_0x4a0d('0x27')](function(_0x30a4cb){if(_0x30a4cb){_0x124d2e=_0x30a4cb[_0x4a0d('0x3a')];if(!_0x3aced4[_0x4a0d('0x36')][_0x4a0d('0x5c')](_0x4a0d('0x3b'))){_0x2fa723['limit']=qs[_0x4a0d('0x20')](_0x3aced4[_0x4a0d('0x36')][_0x4a0d('0x20')]);_0x2fa723[_0x4a0d('0x1f')]=qs[_0x4a0d('0x1f')](_0x3aced4[_0x4a0d('0x36')][_0x4a0d('0x1f')]);}return _0x228a9f[_0x4a0d('0x5a')](_0x2fa723);}})[_0x4a0d('0x27')](function(_0x1c669b){if(_0x1c669b){return _0x1c669b?{'count':_0x124d2e,'rows':_0x1c669b}:null;}})[_0x4a0d('0x27')](respondWithResult(_0x1d0f54,null))[_0x4a0d('0x55')](handleError(_0x1d0f54,null));};exports[_0x4a0d('0x5d')]=function(_0x1c23a0,_0x4afcd7,_0x5cc9bd){var _0xede209={};var _0x364b9b={};var _0x30e157;var _0x55b5a6;return db[_0x4a0d('0x30')][_0x4a0d('0x5b')]({'where':{'id':_0x1c23a0['params']['id']}})[_0x4a0d('0x27')](handleEntityNotFound(_0x4afcd7,null))['then'](function(_0x207e18){if(_0x207e18){_0x30e157=_0x207e18;_0x364b9b[_0x4a0d('0x38')]=_['keys'](db[_0x4a0d('0x58')][_0x4a0d('0x31')]);_0x364b9b[_0x4a0d('0x36')]=_[_0x4a0d('0x4a')](_0x1c23a0[_0x4a0d('0x36')]);_0x364b9b[_0x4a0d('0x3f')]=_[_0x4a0d('0x37')](_0x364b9b[_0x4a0d('0x38')],_0x364b9b['query']);_0xede209[_0x4a0d('0x39')]=_[_0x4a0d('0x37')](_0x364b9b['model'],qs['fields'](_0x1c23a0[_0x4a0d('0x36')]['fields']));_0xede209['attributes']=_0xede209['attributes'][_0x4a0d('0x3a')]?_0xede209[_0x4a0d('0x39')]:_0x364b9b[_0x4a0d('0x38')];_0xede209[_0x4a0d('0x3c')]=qs[_0x4a0d('0x3d')](_0x1c23a0['query'][_0x4a0d('0x3d')]);_0xede209[_0x4a0d('0x3e')]=qs[_0x4a0d('0x3f')](_[_0x4a0d('0x40')](_0x1c23a0[_0x4a0d('0x36')],_0x364b9b[_0x4a0d('0x3f')]));if(_0x1c23a0['query'][_0x4a0d('0x41')]){_0xede209[_0x4a0d('0x3e')]=_['merge'](_0xede209['where'],{'$or':_[_0x4a0d('0x35')](_0xede209[_0x4a0d('0x39')],function(_0x1da102){var _0x502486={};_0x502486[_0x1da102]={'$like':'%'+_0x1c23a0[_0x4a0d('0x36')]['filter']+'%'};return _0x502486;})});}_0xede209=_[_0x4a0d('0x42')]({},_0xede209,_0x1c23a0[_0x4a0d('0x44')]);return _0x30e157[_0x4a0d('0x5d')](_0xede209);}})[_0x4a0d('0x27')](function(_0x3ad1a5){if(_0x3ad1a5){_0x55b5a6=_0x3ad1a5['length'];if(!_0x1c23a0['query']['hasOwnProperty']('nolimit')){_0xede209['limit']=qs[_0x4a0d('0x20')](_0x1c23a0['query'][_0x4a0d('0x20')]);_0xede209['offset']=qs[_0x4a0d('0x1f')](_0x1c23a0[_0x4a0d('0x36')][_0x4a0d('0x1f')]);}return _0x30e157[_0x4a0d('0x5d')](_0xede209);}})['then'](function(_0x3ed799){if(_0x3ed799){return _0x3ed799?{'count':_0x55b5a6,'rows':_0x3ed799}:null;}})[_0x4a0d('0x27')](respondWithResult(_0x4afcd7,null))[_0x4a0d('0x55')](handleError(_0x4afcd7,null));};exports[_0x4a0d('0x5e')]=function(_0x43e366,_0x56754b,_0x7ea924){if(_0x43e366[_0x4a0d('0x4f')]['id']){delete _0x43e366[_0x4a0d('0x4f')]['id'];}return db[_0x4a0d('0x30')][_0x4a0d('0x4d')]({'where':{'id':_0x43e366['params']['id']}})[_0x4a0d('0x27')](handleEntityNotFound(_0x56754b,null))[_0x4a0d('0x27')](function(_0x5d4d74){if(_0x5d4d74){_0x43e366[_0x4a0d('0x4f')]['TriggerId']=_0x5d4d74['id'];return db[_0x4a0d('0x5f')][_0x4a0d('0x4e')](_0x43e366[_0x4a0d('0x4f')]);}})[_0x4a0d('0x27')](respondWithResult(_0x56754b,null))[_0x4a0d('0x55')](handleError(_0x56754b,null));};exports[_0x4a0d('0x60')]=function(_0x313c46,_0x1fdf72,_0x291689){var _0x286b21={};var _0x226ffc={};var _0x444725;var _0x37a17e;return db[_0x4a0d('0x30')][_0x4a0d('0x5b')]({'where':{'id':_0x313c46[_0x4a0d('0x49')]['id']}})[_0x4a0d('0x27')](handleEntityNotFound(_0x1fdf72,null))[_0x4a0d('0x27')](function(_0x1f23c5){if(_0x1f23c5){_0x444725=_0x1f23c5;_0x226ffc['model']=_['keys'](db[_0x4a0d('0x5f')]['rawAttributes']);_0x226ffc[_0x4a0d('0x36')]=_[_0x4a0d('0x4a')](_0x313c46[_0x4a0d('0x36')]);_0x226ffc[_0x4a0d('0x3f')]=_[_0x4a0d('0x37')](_0x226ffc[_0x4a0d('0x38')],_0x226ffc[_0x4a0d('0x36')]);_0x286b21[_0x4a0d('0x39')]=_[_0x4a0d('0x37')](_0x226ffc['model'],qs[_0x4a0d('0x4b')](_0x313c46[_0x4a0d('0x36')][_0x4a0d('0x4b')]));_0x286b21['attributes']=_0x286b21['attributes'][_0x4a0d('0x3a')]?_0x286b21[_0x4a0d('0x39')]:_0x226ffc[_0x4a0d('0x38')];_0x286b21[_0x4a0d('0x3c')]=qs[_0x4a0d('0x3d')](_0x313c46[_0x4a0d('0x36')]['sort']);_0x286b21[_0x4a0d('0x3e')]=qs[_0x4a0d('0x3f')](_['pick'](_0x313c46[_0x4a0d('0x36')],_0x226ffc['filters']));if(_0x313c46[_0x4a0d('0x36')][_0x4a0d('0x41')]){_0x286b21[_0x4a0d('0x3e')]=_['merge'](_0x286b21[_0x4a0d('0x3e')],{'$or':_['map'](_0x286b21[_0x4a0d('0x39')],function(_0x160173){var _0x311627={};_0x311627[_0x160173]={'$like':'%'+_0x313c46[_0x4a0d('0x36')]['filter']+'%'};return _0x311627;})});}_0x286b21=_['merge']({},_0x286b21,_0x313c46[_0x4a0d('0x44')]);return _0x444725[_0x4a0d('0x60')](_0x286b21);}})[_0x4a0d('0x27')](function(_0x2a67bd){if(_0x2a67bd){_0x37a17e=_0x2a67bd[_0x4a0d('0x3a')];if(!_0x313c46['query'][_0x4a0d('0x5c')](_0x4a0d('0x3b'))){_0x286b21[_0x4a0d('0x20')]=qs[_0x4a0d('0x20')](_0x313c46[_0x4a0d('0x36')]['limit']);_0x286b21[_0x4a0d('0x1f')]=qs[_0x4a0d('0x1f')](_0x313c46[_0x4a0d('0x36')][_0x4a0d('0x1f')]);}return _0x444725['getActions'](_0x286b21);}})[_0x4a0d('0x27')](function(_0x39d173){if(_0x39d173){return _0x39d173?{'count':_0x37a17e,'rows':_0x39d173}:null;}})[_0x4a0d('0x27')](respondWithResult(_0x1fdf72,null))[_0x4a0d('0x55')](handleError(_0x1fdf72,null));}; \ No newline at end of file +var _0x5748=['UserProfileResource','error','stack','name','send','index','map','Trigger','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','params','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Triggers','UserProfileSection','userProfileId','autoAssociation','addAllCondition','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','getAnyConditions','TriggerId','Action','getActions','rimraf','zip-dir','request-promise','moment','mustache','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','set','Content-Range','apply','update','then','destroy'];(function(_0x5ba435,_0x332bf8){var _0x433047=function(_0x48a970){while(--_0x48a970){_0x5ba435['push'](_0x5ba435['shift']());}};_0x433047(++_0x332bf8);}(_0x5748,0x158));var _0x8574=function(_0x2cbd29,_0x39130e){_0x2cbd29=_0x2cbd29-0x0;var _0x20766d=_0x5748[_0x2cbd29];return _0x20766d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8574('0x0'));var zipdir=require(_0x8574('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8574('0x2'));var moment=require(_0x8574('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x8574('0x4'));var util=require('util');var path=require(_0x8574('0x5'));var sox=require(_0x8574('0x6'));var csv=require(_0x8574('0x7'));var ejs=require(_0x8574('0x8'));var fs=require('fs');var fs_extra=require(_0x8574('0x9'));var _=require(_0x8574('0xa'));var squel=require(_0x8574('0xb'));var crypto=require(_0x8574('0xc'));var jsforce=require(_0x8574('0xd'));var deskjs=require(_0x8574('0xe'));var toCsv=require(_0x8574('0x7'));var querystring=require(_0x8574('0xf'));var Papa=require(_0x8574('0x10'));var Redis=require('ioredis');var authService=require(_0x8574('0x11'));var qs=require(_0x8574('0x12'));var as=require(_0x8574('0x13'));var hardwareService=require(_0x8574('0x14'));var logger=require(_0x8574('0x15'))(_0x8574('0x16'));var utils=require(_0x8574('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x8574('0x18'));var db=require(_0x8574('0x19'))['db'];function respondWithStatusCode(_0x274963,_0x3f4716){_0x3f4716=_0x3f4716||0xcc;return function(_0x3c659f){if(_0x3c659f){return _0x274963[_0x8574('0x1a')](_0x3f4716);}return _0x274963[_0x8574('0x1b')](_0x3f4716)[_0x8574('0x1c')]();};}function respondWithResult(_0x370312,_0x368a39){_0x368a39=_0x368a39||0xc8;return function(_0x1692e2){if(_0x1692e2){return _0x370312[_0x8574('0x1b')](_0x368a39)[_0x8574('0x1d')](_0x1692e2);}};}function respondWithFilteredResult(_0xc23e5,_0x36af3d){return function(_0x14dfc2){if(_0x14dfc2){var _0xf53f27=typeof _0x36af3d[_0x8574('0x1e')]===_0x8574('0x1f')&&typeof _0x36af3d[_0x8574('0x20')]===_0x8574('0x1f');var _0x2991fe=_0x14dfc2[_0x8574('0x21')];var _0x16b7eb=_0xf53f27?0x0:_0x36af3d[_0x8574('0x1e')];var _0x185917=_0xf53f27?_0x14dfc2['count']:_0x36af3d[_0x8574('0x1e')]+_0x36af3d[_0x8574('0x20')];var _0x361073;if(_0x185917>=_0x2991fe){_0x185917=_0x2991fe;_0x361073=0xc8;}else{_0x361073=0xce;}_0xc23e5['status'](_0x361073);return _0xc23e5[_0x8574('0x22')](_0x8574('0x23'),_0x16b7eb+'-'+_0x185917+'/'+_0x2991fe)[_0x8574('0x1d')](_0x14dfc2);}return null;};}function patchUpdates(_0x1823c7){return function(_0x378c48){try{jsonpatch[_0x8574('0x24')](_0x378c48,_0x1823c7,!![]);}catch(_0x422b62){return BPromise['reject'](_0x422b62);}return _0x378c48['save']();};}function saveUpdates(_0x222d16,_0x3a595c){return function(_0x280db7){if(_0x280db7){return _0x280db7[_0x8574('0x25')](_0x222d16)[_0x8574('0x26')](function(_0x43fcab){return _0x43fcab;});}return null;};}function removeEntity(_0x4f91f0,_0x3e2bb1){return function(_0x5924f4){if(_0x5924f4){return _0x5924f4[_0x8574('0x27')]()[_0x8574('0x26')](function(){var _0x22b121=_0x5924f4['get']({'plain':!![]});var _0x2204a4='Triggers';return db[_0x8574('0x28')][_0x8574('0x27')]({'where':{'type':_0x2204a4,'resourceId':_0x22b121['id']}})[_0x8574('0x26')](function(){return _0x5924f4;});})[_0x8574('0x26')](function(){_0x4f91f0[_0x8574('0x1b')](0xcc)[_0x8574('0x1c')]();});}};}function handleEntityNotFound(_0x2fe23d,_0x3af659){return function(_0x3490b3){if(!_0x3490b3){_0x2fe23d[_0x8574('0x1a')](0x194);}return _0x3490b3;};}function handleError(_0x5ac267,_0x145c6c){_0x145c6c=_0x145c6c||0x1f4;return function(_0x41714a){logger[_0x8574('0x29')](_0x41714a[_0x8574('0x2a')]);if(_0x41714a['name']){delete _0x41714a[_0x8574('0x2b')];}_0x5ac267[_0x8574('0x1b')](_0x145c6c)[_0x8574('0x2c')](_0x41714a);};}exports[_0x8574('0x2d')]=function(_0x1aaa01,_0x334660){var _0x1c9692={},_0x23e98f={},_0x348a89={'count':0x0,'rows':[]};var _0x2bf7ee=_[_0x8574('0x2e')](db[_0x8574('0x2f')][_0x8574('0x30')],function(_0x38f119){return{'name':_0x38f119[_0x8574('0x31')],'type':_0x38f119[_0x8574('0x32')][_0x8574('0x33')]};});_0x23e98f['model']=_[_0x8574('0x2e')](_0x2bf7ee,'name');_0x23e98f[_0x8574('0x34')]=_[_0x8574('0x35')](_0x1aaa01[_0x8574('0x34')]);_0x23e98f['filters']=_[_0x8574('0x36')](_0x23e98f[_0x8574('0x37')],_0x23e98f[_0x8574('0x34')]);_0x1c9692[_0x8574('0x38')]=_[_0x8574('0x36')](_0x23e98f[_0x8574('0x37')],qs[_0x8574('0x39')](_0x1aaa01['query'][_0x8574('0x39')]));_0x1c9692['attributes']=_0x1c9692[_0x8574('0x38')][_0x8574('0x3a')]?_0x1c9692[_0x8574('0x38')]:_0x23e98f[_0x8574('0x37')];if(!_0x1aaa01[_0x8574('0x34')][_0x8574('0x3b')](_0x8574('0x3c'))){_0x1c9692['limit']=qs['limit'](_0x1aaa01[_0x8574('0x34')]['limit']);_0x1c9692[_0x8574('0x1e')]=qs['offset'](_0x1aaa01[_0x8574('0x34')][_0x8574('0x1e')]);}_0x1c9692[_0x8574('0x3d')]=qs[_0x8574('0x3e')](_0x1aaa01[_0x8574('0x34')][_0x8574('0x3e')]);_0x1c9692[_0x8574('0x3f')]=qs[_0x8574('0x40')](_[_0x8574('0x41')](_0x1aaa01[_0x8574('0x34')],_0x23e98f[_0x8574('0x40')]),_0x2bf7ee);if(_0x1aaa01['query'][_0x8574('0x42')]){_0x1c9692[_0x8574('0x3f')]=_[_0x8574('0x43')](_0x1c9692[_0x8574('0x3f')],{'$or':_['map'](_0x2bf7ee,function(_0x4c9642){if(_0x4c9642[_0x8574('0x32')]!==_0x8574('0x44')){var _0x26f537={};_0x26f537[_0x4c9642['name']]={'$like':'%'+_0x1aaa01[_0x8574('0x34')][_0x8574('0x42')]+'%'};return _0x26f537;}})});}_0x1c9692=_[_0x8574('0x43')]({},_0x1c9692,_0x1aaa01[_0x8574('0x45')]);var _0xbf61b5={'where':_0x1c9692[_0x8574('0x3f')]};return db[_0x8574('0x2f')][_0x8574('0x21')](_0xbf61b5)[_0x8574('0x26')](function(_0xcedc5c){_0x348a89[_0x8574('0x21')]=_0xcedc5c;if(_0x1aaa01['query']['includeAll']){_0x1c9692['include']=[{'all':!![]}];}return db[_0x8574('0x2f')][_0x8574('0x46')](_0x1c9692);})[_0x8574('0x26')](function(_0x237662){_0x348a89[_0x8574('0x47')]=_0x237662;return _0x348a89;})[_0x8574('0x26')](respondWithFilteredResult(_0x334660,_0x1c9692))[_0x8574('0x48')](handleError(_0x334660,null));};exports['show']=function(_0x13861e,_0x28c94c){var _0x4afcb2={'raw':![],'where':{'id':_0x13861e[_0x8574('0x49')]['id']}},_0xa939fa={};_0xa939fa[_0x8574('0x37')]=_['keys'](db['Trigger']['rawAttributes']);_0xa939fa['query']=_[_0x8574('0x35')](_0x13861e[_0x8574('0x34')]);_0xa939fa[_0x8574('0x40')]=_[_0x8574('0x36')](_0xa939fa[_0x8574('0x37')],_0xa939fa[_0x8574('0x34')]);_0x4afcb2[_0x8574('0x38')]=_[_0x8574('0x36')](_0xa939fa[_0x8574('0x37')],qs[_0x8574('0x39')](_0x13861e['query']['fields']));_0x4afcb2[_0x8574('0x38')]=_0x4afcb2[_0x8574('0x38')][_0x8574('0x3a')]?_0x4afcb2[_0x8574('0x38')]:_0xa939fa[_0x8574('0x37')];if(_0x13861e['query']['includeAll']){_0x4afcb2[_0x8574('0x4a')]=[{'all':!![]}];}_0x4afcb2=_[_0x8574('0x43')]({},_0x4afcb2,_0x13861e[_0x8574('0x45')]);return db[_0x8574('0x2f')][_0x8574('0x4b')](_0x4afcb2)[_0x8574('0x26')](handleEntityNotFound(_0x28c94c,null))[_0x8574('0x26')](respondWithResult(_0x28c94c,null))[_0x8574('0x48')](handleError(_0x28c94c,null));};exports[_0x8574('0x4c')]=function(_0x5820e9,_0x3ff34f){return db[_0x8574('0x2f')][_0x8574('0x4c')](_0x5820e9[_0x8574('0x4d')],{})[_0x8574('0x26')](function(_0x283eef){var _0x1c56c0=_0x5820e9[_0x8574('0x4e')][_0x8574('0x4f')]({'plain':!![]});if(!_0x1c56c0)throw new Error(_0x8574('0x50'));if(_0x1c56c0[_0x8574('0x51')]==='user'){var _0x220b68=_0x283eef['get']({'plain':!![]});var _0x52a82c=_0x8574('0x52');return db[_0x8574('0x53')][_0x8574('0x4b')]({'where':{'name':_0x52a82c,'userProfileId':_0x1c56c0[_0x8574('0x54')]},'raw':!![]})[_0x8574('0x26')](function(_0x21510f){if(_0x21510f&&_0x21510f[_0x8574('0x55')]===0x0){return db[_0x8574('0x28')]['create']({'name':_0x220b68[_0x8574('0x2b')],'resourceId':_0x220b68['id'],'type':_0x21510f[_0x8574('0x2b')],'sectionId':_0x21510f['id']},{})[_0x8574('0x26')](function(){return _0x283eef;});}else{return _0x283eef;}})[_0x8574('0x48')](function(_0x544988){logger[_0x8574('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x544988);throw _0x544988;});}return _0x283eef;})[_0x8574('0x26')](respondWithResult(_0x3ff34f,0xc9))['catch'](handleError(_0x3ff34f,null));};exports[_0x8574('0x25')]=function(_0x4f13dc,_0x504a9b){if(_0x4f13dc[_0x8574('0x4d')]['id']){delete _0x4f13dc[_0x8574('0x4d')]['id'];}return db['Trigger'][_0x8574('0x4b')]({'where':{'id':_0x4f13dc[_0x8574('0x49')]['id']}})[_0x8574('0x26')](handleEntityNotFound(_0x504a9b,null))[_0x8574('0x26')](saveUpdates(_0x4f13dc[_0x8574('0x4d')],null))['then'](respondWithResult(_0x504a9b,null))[_0x8574('0x48')](handleError(_0x504a9b,null));};exports['destroy']=function(_0x357d7e,_0x5c9d61){return db['Trigger']['find']({'where':{'id':_0x357d7e[_0x8574('0x49')]['id']}})[_0x8574('0x26')](handleEntityNotFound(_0x5c9d61,null))['then'](removeEntity(_0x5c9d61,null))[_0x8574('0x48')](handleError(_0x5c9d61,null));};exports[_0x8574('0x56')]=function(_0x41aa8,_0x396b30,_0x37fec4){if(_0x41aa8['body']['id']){delete _0x41aa8[_0x8574('0x4d')]['id'];}return db[_0x8574('0x2f')][_0x8574('0x4b')]({'where':{'id':_0x41aa8['params']['id']}})[_0x8574('0x26')](handleEntityNotFound(_0x396b30,null))[_0x8574('0x26')](function(_0x415435){if(_0x415435){_0x41aa8[_0x8574('0x4d')]['TriggerAllId']=_0x415435['id'];return db[_0x8574('0x57')][_0x8574('0x4c')](_0x41aa8[_0x8574('0x4d')]);}})[_0x8574('0x26')](respondWithResult(_0x396b30,null))['catch'](handleError(_0x396b30,null));};exports[_0x8574('0x58')]=function(_0x3fd2c5,_0x257d27,_0x356a13){if(_0x3fd2c5[_0x8574('0x4d')]['id']){delete _0x3fd2c5[_0x8574('0x4d')]['id'];}return db[_0x8574('0x2f')][_0x8574('0x4b')]({'where':{'id':_0x3fd2c5['params']['id']}})['then'](handleEntityNotFound(_0x257d27,null))[_0x8574('0x26')](function(_0x250b05){if(_0x250b05){_0x3fd2c5[_0x8574('0x4d')][_0x8574('0x59')]=_0x250b05['id'];return db[_0x8574('0x57')][_0x8574('0x4c')](_0x3fd2c5[_0x8574('0x4d')]);}})[_0x8574('0x26')](respondWithResult(_0x257d27,null))[_0x8574('0x48')](handleError(_0x257d27,null));};exports[_0x8574('0x5a')]=function(_0x16850d,_0x187f18,_0x24bfc1){var _0x8f940c={};var _0x47ea7b={};var _0x429082;var _0x1fdcfb;return db[_0x8574('0x2f')][_0x8574('0x5b')]({'where':{'id':_0x16850d[_0x8574('0x49')]['id']}})[_0x8574('0x26')](handleEntityNotFound(_0x187f18,null))[_0x8574('0x26')](function(_0x3e320c){if(_0x3e320c){_0x429082=_0x3e320c;_0x47ea7b['model']=_[_0x8574('0x35')](db[_0x8574('0x57')][_0x8574('0x30')]);_0x47ea7b[_0x8574('0x34')]=_[_0x8574('0x35')](_0x16850d[_0x8574('0x34')]);_0x47ea7b[_0x8574('0x40')]=_[_0x8574('0x36')](_0x47ea7b[_0x8574('0x37')],_0x47ea7b[_0x8574('0x34')]);_0x8f940c[_0x8574('0x38')]=_[_0x8574('0x36')](_0x47ea7b['model'],qs['fields'](_0x16850d[_0x8574('0x34')][_0x8574('0x39')]));_0x8f940c[_0x8574('0x38')]=_0x8f940c[_0x8574('0x38')][_0x8574('0x3a')]?_0x8f940c[_0x8574('0x38')]:_0x47ea7b[_0x8574('0x37')];_0x8f940c[_0x8574('0x3d')]=qs[_0x8574('0x3e')](_0x16850d[_0x8574('0x34')][_0x8574('0x3e')]);_0x8f940c[_0x8574('0x3f')]=qs[_0x8574('0x40')](_[_0x8574('0x41')](_0x16850d[_0x8574('0x34')],_0x47ea7b['filters']));if(_0x16850d[_0x8574('0x34')][_0x8574('0x42')]){_0x8f940c[_0x8574('0x3f')]=_['merge'](_0x8f940c[_0x8574('0x3f')],{'$or':_[_0x8574('0x2e')](_0x8f940c[_0x8574('0x38')],function(_0x6dcf07){var _0x17d4cf={};_0x17d4cf[_0x6dcf07]={'$like':'%'+_0x16850d[_0x8574('0x34')][_0x8574('0x42')]+'%'};return _0x17d4cf;})});}_0x8f940c=_[_0x8574('0x43')]({},_0x8f940c,_0x16850d['options']);return _0x429082['getAllConditions'](_0x8f940c);}})[_0x8574('0x26')](function(_0x353aa6){if(_0x353aa6){_0x1fdcfb=_0x353aa6[_0x8574('0x3a')];if(!_0x16850d[_0x8574('0x34')]['hasOwnProperty'](_0x8574('0x3c'))){_0x8f940c[_0x8574('0x20')]=qs[_0x8574('0x20')](_0x16850d['query'][_0x8574('0x20')]);_0x8f940c[_0x8574('0x1e')]=qs[_0x8574('0x1e')](_0x16850d[_0x8574('0x34')][_0x8574('0x1e')]);}return _0x429082[_0x8574('0x5a')](_0x8f940c);}})[_0x8574('0x26')](function(_0x4e1efa){if(_0x4e1efa){return _0x4e1efa?{'count':_0x1fdcfb,'rows':_0x4e1efa}:null;}})['then'](respondWithResult(_0x187f18,null))[_0x8574('0x48')](handleError(_0x187f18,null));};exports[_0x8574('0x5c')]=function(_0x459051,_0x6fc610,_0x3a60f8){var _0xb07f40={};var _0x3b0c64={};var _0x2eb77d;var _0x3f9af7;return db[_0x8574('0x2f')][_0x8574('0x5b')]({'where':{'id':_0x459051[_0x8574('0x49')]['id']}})[_0x8574('0x26')](handleEntityNotFound(_0x6fc610,null))['then'](function(_0x231f7e){if(_0x231f7e){_0x2eb77d=_0x231f7e;_0x3b0c64[_0x8574('0x37')]=_[_0x8574('0x35')](db['Condition']['rawAttributes']);_0x3b0c64['query']=_[_0x8574('0x35')](_0x459051[_0x8574('0x34')]);_0x3b0c64[_0x8574('0x40')]=_[_0x8574('0x36')](_0x3b0c64[_0x8574('0x37')],_0x3b0c64['query']);_0xb07f40['attributes']=_['intersection'](_0x3b0c64['model'],qs[_0x8574('0x39')](_0x459051[_0x8574('0x34')]['fields']));_0xb07f40['attributes']=_0xb07f40['attributes']['length']?_0xb07f40['attributes']:_0x3b0c64['model'];_0xb07f40[_0x8574('0x3d')]=qs[_0x8574('0x3e')](_0x459051[_0x8574('0x34')][_0x8574('0x3e')]);_0xb07f40['where']=qs['filters'](_['pick'](_0x459051['query'],_0x3b0c64[_0x8574('0x40')]));if(_0x459051[_0x8574('0x34')][_0x8574('0x42')]){_0xb07f40[_0x8574('0x3f')]=_[_0x8574('0x43')](_0xb07f40[_0x8574('0x3f')],{'$or':_[_0x8574('0x2e')](_0xb07f40[_0x8574('0x38')],function(_0xbc804b){var _0x7e7b22={};_0x7e7b22[_0xbc804b]={'$like':'%'+_0x459051['query'][_0x8574('0x42')]+'%'};return _0x7e7b22;})});}_0xb07f40=_[_0x8574('0x43')]({},_0xb07f40,_0x459051[_0x8574('0x45')]);return _0x2eb77d[_0x8574('0x5c')](_0xb07f40);}})['then'](function(_0x305e34){if(_0x305e34){_0x3f9af7=_0x305e34['length'];if(!_0x459051['query'][_0x8574('0x3b')]('nolimit')){_0xb07f40[_0x8574('0x20')]=qs[_0x8574('0x20')](_0x459051[_0x8574('0x34')][_0x8574('0x20')]);_0xb07f40[_0x8574('0x1e')]=qs[_0x8574('0x1e')](_0x459051['query']['offset']);}return _0x2eb77d[_0x8574('0x5c')](_0xb07f40);}})[_0x8574('0x26')](function(_0x1dc176){if(_0x1dc176){return _0x1dc176?{'count':_0x3f9af7,'rows':_0x1dc176}:null;}})[_0x8574('0x26')](respondWithResult(_0x6fc610,null))[_0x8574('0x48')](handleError(_0x6fc610,null));};exports['addAction']=function(_0x1f4522,_0x25da1b,_0x115492){if(_0x1f4522['body']['id']){delete _0x1f4522['body']['id'];}return db['Trigger'][_0x8574('0x4b')]({'where':{'id':_0x1f4522[_0x8574('0x49')]['id']}})[_0x8574('0x26')](handleEntityNotFound(_0x25da1b,null))[_0x8574('0x26')](function(_0x5b7c06){if(_0x5b7c06){_0x1f4522[_0x8574('0x4d')][_0x8574('0x5d')]=_0x5b7c06['id'];return db[_0x8574('0x5e')][_0x8574('0x4c')](_0x1f4522['body']);}})['then'](respondWithResult(_0x25da1b,null))[_0x8574('0x48')](handleError(_0x25da1b,null));};exports[_0x8574('0x5f')]=function(_0x1c0406,_0x276a45,_0x2e8698){var _0x29cf8d={};var _0x36f466={};var _0x1ceb51;var _0xd08652;return db['Trigger'][_0x8574('0x5b')]({'where':{'id':_0x1c0406[_0x8574('0x49')]['id']}})[_0x8574('0x26')](handleEntityNotFound(_0x276a45,null))[_0x8574('0x26')](function(_0x426ba1){if(_0x426ba1){_0x1ceb51=_0x426ba1;_0x36f466[_0x8574('0x37')]=_[_0x8574('0x35')](db[_0x8574('0x5e')][_0x8574('0x30')]);_0x36f466[_0x8574('0x34')]=_[_0x8574('0x35')](_0x1c0406['query']);_0x36f466['filters']=_[_0x8574('0x36')](_0x36f466[_0x8574('0x37')],_0x36f466[_0x8574('0x34')]);_0x29cf8d['attributes']=_[_0x8574('0x36')](_0x36f466[_0x8574('0x37')],qs[_0x8574('0x39')](_0x1c0406[_0x8574('0x34')]['fields']));_0x29cf8d[_0x8574('0x38')]=_0x29cf8d['attributes'][_0x8574('0x3a')]?_0x29cf8d['attributes']:_0x36f466['model'];_0x29cf8d[_0x8574('0x3d')]=qs['sort'](_0x1c0406[_0x8574('0x34')]['sort']);_0x29cf8d['where']=qs[_0x8574('0x40')](_['pick'](_0x1c0406[_0x8574('0x34')],_0x36f466[_0x8574('0x40')]));if(_0x1c0406[_0x8574('0x34')][_0x8574('0x42')]){_0x29cf8d[_0x8574('0x3f')]=_[_0x8574('0x43')](_0x29cf8d['where'],{'$or':_[_0x8574('0x2e')](_0x29cf8d[_0x8574('0x38')],function(_0x11f771){var _0x7b80fb={};_0x7b80fb[_0x11f771]={'$like':'%'+_0x1c0406['query'][_0x8574('0x42')]+'%'};return _0x7b80fb;})});}_0x29cf8d=_['merge']({},_0x29cf8d,_0x1c0406[_0x8574('0x45')]);return _0x1ceb51['getActions'](_0x29cf8d);}})[_0x8574('0x26')](function(_0x473678){if(_0x473678){_0xd08652=_0x473678['length'];if(!_0x1c0406['query'][_0x8574('0x3b')](_0x8574('0x3c'))){_0x29cf8d['limit']=qs[_0x8574('0x20')](_0x1c0406[_0x8574('0x34')]['limit']);_0x29cf8d[_0x8574('0x1e')]=qs[_0x8574('0x1e')](_0x1c0406[_0x8574('0x34')][_0x8574('0x1e')]);}return _0x1ceb51[_0x8574('0x5f')](_0x29cf8d);}})[_0x8574('0x26')](function(_0xf5c5b1){if(_0xf5c5b1){return _0xf5c5b1?{'count':_0xd08652,'rows':_0xf5c5b1}:null;}})[_0x8574('0x26')](respondWithResult(_0x276a45,null))['catch'](handleError(_0x276a45,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index b0461a2..0923277 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 _0x279d=['util','../../config/logger','api','request-promise','path','../../config/environment','./trigger.attributes','exports','define','Trigger','lodash'];(function(_0x384447,_0x41669a){var _0x3810db=function(_0x3f1288){while(--_0x3f1288){_0x384447['push'](_0x384447['shift']());}};_0x3810db(++_0x41669a);}(_0x279d,0x1d8));var _0xd279=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0x279d[_0x166d93];return _0xba708;};'use strict';var _=require(_0xd279('0x0'));var util=require(_0xd279('0x1'));var logger=require(_0xd279('0x2'))(_0xd279('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd279('0x4'));var fs=require('fs');var path=require(_0xd279('0x5'));var rimraf=require('rimraf');var config=require(_0xd279('0x6'));var attributes=require(_0xd279('0x7'));module[_0xd279('0x8')]=function(_0x87b2a5,_0x1d340c){return _0x87b2a5[_0xd279('0x9')](_0xd279('0xa'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2821=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./trigger.attributes','exports','define','Trigger','tools_triggers'];(function(_0x3a881e,_0x2272de){var _0x42bd9e=function(_0x3b76d9){while(--_0x3b76d9){_0x3a881e['push'](_0x3a881e['shift']());}};_0x42bd9e(++_0x2272de);}(_0x2821,0xc3));var _0x1282=function(_0x1c69c8,_0x5f3526){_0x1c69c8=_0x1c69c8-0x0;var _0x37aae8=_0x2821[_0x1c69c8];return _0x37aae8;};'use strict';var _=require(_0x1282('0x0'));var util=require(_0x1282('0x1'));var logger=require(_0x1282('0x2'))(_0x1282('0x3'));var moment=require(_0x1282('0x4'));var BPromise=require(_0x1282('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1282('0x6'));var rimraf=require(_0x1282('0x7'));var config=require('../../config/environment');var attributes=require(_0x1282('0x8'));module[_0x1282('0x9')]=function(_0x384b8b,_0xe7525f){return _0x384b8b[_0x1282('0xa')](_0x1282('0xb'),attributes,{'tableName':_0x1282('0xc'),'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 3307063..7fc7b5b 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 _0xe7c7=['stringify','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Trigger,\x20%s,\x20%s,\x20%s','request\x20sent','error','Trigger,\x20%s,\x20%s','message','catch','Trigger','options','where','attributes','limit','map','include','model','then','GetTrigger','debug','ShowTrigger','find','raw'];(function(_0xe5268d,_0x27410a){var _0x4ecdb7=function(_0xea0f3c){while(--_0xea0f3c){_0xe5268d['push'](_0xe5268d['shift']());}};_0x4ecdb7(++_0x27410a);}(_0xe7c7,0x1c8));var _0x7e7c=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xe7c7[_0x11005e];return _0x29338f;};'use strict';var _=require(_0x7e7c('0x0'));var util=require(_0x7e7c('0x1'));var moment=require(_0x7e7c('0x2'));var BPromise=require(_0x7e7c('0x3'));var rs=require(_0x7e7c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7e7c('0x5'));var logger=require(_0x7e7c('0x6'))(_0x7e7c('0x7'));var config=require(_0x7e7c('0x8'));var jayson=require(_0x7e7c('0x9'));var client=jayson[_0x7e7c('0xa')][_0x7e7c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xc19b0d,_0x55b65e,_0x2b856c){return new BPromise(function(_0x16db60,_0x573c48){return client[_0x7e7c('0xc')](_0xc19b0d,_0x2b856c)['then'](function(_0x14f829){logger[_0x7e7c('0xd')]('Trigger,\x20%s,\x20%s',_0x55b65e,'request\x20sent');logger['debug'](_0x7e7c('0xe'),_0x55b65e,_0x7e7c('0xf'),JSON['stringify'](_0x14f829));if(_0x14f829[_0x7e7c('0x10')]){if(_0x14f829[_0x7e7c('0x10')]['code']===0x1f4){logger['error'](_0x7e7c('0x11'),_0x55b65e,_0x14f829[_0x7e7c('0x10')][_0x7e7c('0x12')]);return _0x573c48(_0x14f829[_0x7e7c('0x10')][_0x7e7c('0x12')]);}logger[_0x7e7c('0x10')](_0x7e7c('0x11'),_0x55b65e,_0x14f829[_0x7e7c('0x10')][_0x7e7c('0x12')]);return _0x16db60(_0x14f829[_0x7e7c('0x10')]['message']);}else{logger[_0x7e7c('0xd')]('Trigger,\x20%s,\x20%s',_0x55b65e,_0x7e7c('0xf'));_0x16db60(_0x14f829['result']['message']);}})[_0x7e7c('0x13')](function(_0x1a3c60){logger[_0x7e7c('0x10')](_0x7e7c('0x11'),_0x55b65e,_0x1a3c60);_0x573c48(_0x1a3c60);});});}exports['GetTrigger']=function(_0x3504f3){var _0xd001cb=this;return new Promise(function(_0x361b79,_0x5de502){return db[_0x7e7c('0x14')]['findAll']({'raw':_0x3504f3[_0x7e7c('0x15')]?_0x3504f3[_0x7e7c('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x3504f3[_0x7e7c('0x15')]?_0x3504f3[_0x7e7c('0x15')][_0x7e7c('0x16')]||null:null,'attributes':_0x3504f3['options']?_0x3504f3[_0x7e7c('0x15')][_0x7e7c('0x17')]||null:null,'limit':_0x3504f3[_0x7e7c('0x15')]?_0x3504f3[_0x7e7c('0x15')][_0x7e7c('0x18')]||null:null,'include':_0x3504f3[_0x7e7c('0x15')]?_0x3504f3[_0x7e7c('0x15')]['include']?_[_0x7e7c('0x19')](_0x3504f3[_0x7e7c('0x15')][_0x7e7c('0x1a')],function(_0x1f93a4){return{'model':db[_0x1f93a4[_0x7e7c('0x1b')]],'as':_0x1f93a4['as'],'attributes':_0x1f93a4[_0x7e7c('0x17')],'include':_0x1f93a4[_0x7e7c('0x1a')]?_[_0x7e7c('0x19')](_0x1f93a4['include'],function(_0x11b3ef){return{'model':db[_0x11b3ef[_0x7e7c('0x1b')]],'as':_0x11b3ef['as'],'attributes':_0x11b3ef[_0x7e7c('0x17')],'include':_0x11b3ef['include']?_[_0x7e7c('0x19')](_0x11b3ef[_0x7e7c('0x1a')],function(_0x566f5d){return{'model':db[_0x566f5d[_0x7e7c('0x1b')]],'as':_0x566f5d['as'],'attributes':_0x566f5d[_0x7e7c('0x17')]};}):[]};}):[]};}):[]:[]})[_0x7e7c('0x1c')](function(_0x1b1626){logger[_0x7e7c('0xd')](_0x7e7c('0x1d'),_0x3504f3);logger[_0x7e7c('0x1e')](_0x7e7c('0x1d'),_0x3504f3,JSON['stringify'](_0x1b1626));_0x361b79(_0x1b1626);})[_0x7e7c('0x13')](function(_0x34aebd){logger[_0x7e7c('0x10')](_0x7e7c('0x1d'),_0x34aebd[_0x7e7c('0x12')],_0x3504f3);_0x5de502(_0xd001cb[_0x7e7c('0x10')](0x1f4,_0x34aebd[_0x7e7c('0x12')]));});});};exports[_0x7e7c('0x1f')]=function(_0x2e0dec){var _0x545402=this;return new Promise(function(_0x3561f5,_0x1d5320){return db[_0x7e7c('0x14')][_0x7e7c('0x20')]({'raw':_0x2e0dec['options']?_0x2e0dec[_0x7e7c('0x15')][_0x7e7c('0x21')]===undefined?!![]:![]:!![],'where':_0x2e0dec[_0x7e7c('0x15')]?_0x2e0dec[_0x7e7c('0x15')][_0x7e7c('0x16')]||null:null,'attributes':_0x2e0dec['options']?_0x2e0dec['options'][_0x7e7c('0x17')]||null:null,'include':_0x2e0dec[_0x7e7c('0x15')]?_0x2e0dec[_0x7e7c('0x15')][_0x7e7c('0x1a')]?_[_0x7e7c('0x19')](_0x2e0dec[_0x7e7c('0x15')][_0x7e7c('0x1a')],function(_0x3b08c9){return{'model':db[_0x3b08c9['model']],'as':_0x3b08c9['as'],'attributes':_0x3b08c9[_0x7e7c('0x17')],'include':_0x3b08c9['include']?_[_0x7e7c('0x19')](_0x3b08c9[_0x7e7c('0x1a')],function(_0xa364a9){return{'model':db[_0xa364a9[_0x7e7c('0x1b')]],'as':_0xa364a9['as'],'attributes':_0xa364a9[_0x7e7c('0x17')],'include':_0xa364a9[_0x7e7c('0x1a')]?_[_0x7e7c('0x19')](_0xa364a9[_0x7e7c('0x1a')],function(_0x19ca64){return{'model':db[_0x19ca64['model']],'as':_0x19ca64['as'],'attributes':_0x19ca64['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5480a3){logger[_0x7e7c('0xd')](_0x7e7c('0x1f'),_0x2e0dec);logger[_0x7e7c('0x1e')]('ShowTrigger',_0x2e0dec,JSON[_0x7e7c('0x22')](_0x5480a3));_0x3561f5(_0x5480a3);})[_0x7e7c('0x13')](function(_0x1d6b07){logger['error'](_0x7e7c('0x1f'),_0x1d6b07['message'],_0x2e0dec);_0x1d5320(_0x545402['error'](0x1f4,_0x1d6b07[_0x7e7c('0x12')]));});});}; \ No newline at end of file +var _0x54ff=['findAll','options','raw','where','attributes','limit','include','map','model','GetTrigger','ShowTrigger','find','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Trigger,\x20%s,\x20%s','debug','Trigger,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','Trigger'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x54ff,0x159));var _0xf54f=function(_0x4055c7,_0x27df07){_0x4055c7=_0x4055c7-0x0;var _0x4f616e=_0x54ff[_0x4055c7];return _0x4f616e;};'use strict';var _=require('lodash');var util=require(_0xf54f('0x0'));var moment=require(_0xf54f('0x1'));var BPromise=require(_0xf54f('0x2'));var rs=require(_0xf54f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf54f('0x4'))['db'];var utils=require(_0xf54f('0x5'));var logger=require(_0xf54f('0x6'))(_0xf54f('0x7'));var config=require(_0xf54f('0x8'));var jayson=require(_0xf54f('0x9'));var client=jayson[_0xf54f('0xa')][_0xf54f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x378156,_0xcc3d04,_0x2bd46a){return new BPromise(function(_0x4cbd33,_0x448803){return client[_0xf54f('0xc')](_0x378156,_0x2bd46a)[_0xf54f('0xd')](function(_0x176ac7){logger[_0xf54f('0xe')](_0xf54f('0xf'),_0xcc3d04,'request\x20sent');logger[_0xf54f('0x10')](_0xf54f('0x11'),_0xcc3d04,_0xf54f('0x12'),JSON[_0xf54f('0x13')](_0x176ac7));if(_0x176ac7[_0xf54f('0x14')]){if(_0x176ac7[_0xf54f('0x14')][_0xf54f('0x15')]===0x1f4){logger[_0xf54f('0x14')](_0xf54f('0xf'),_0xcc3d04,_0x176ac7[_0xf54f('0x14')][_0xf54f('0x16')]);return _0x448803(_0x176ac7['error'][_0xf54f('0x16')]);}logger[_0xf54f('0x14')](_0xf54f('0xf'),_0xcc3d04,_0x176ac7[_0xf54f('0x14')][_0xf54f('0x16')]);return _0x4cbd33(_0x176ac7[_0xf54f('0x14')]['message']);}else{logger[_0xf54f('0xe')](_0xf54f('0xf'),_0xcc3d04,'request\x20sent');_0x4cbd33(_0x176ac7['result'][_0xf54f('0x16')]);}})[_0xf54f('0x17')](function(_0x1b021d){logger[_0xf54f('0x14')]('Trigger,\x20%s,\x20%s',_0xcc3d04,_0x1b021d);_0x448803(_0x1b021d);});});}exports['GetTrigger']=function(_0x33a846){var _0x1b55ce=this;return new Promise(function(_0x34bf6c,_0x56f8c4){return db[_0xf54f('0x18')][_0xf54f('0x19')]({'raw':_0x33a846['options']?_0x33a846[_0xf54f('0x1a')][_0xf54f('0x1b')]===undefined?!![]:![]:!![],'where':_0x33a846['options']?_0x33a846[_0xf54f('0x1a')][_0xf54f('0x1c')]||null:null,'attributes':_0x33a846[_0xf54f('0x1a')]?_0x33a846[_0xf54f('0x1a')][_0xf54f('0x1d')]||null:null,'limit':_0x33a846[_0xf54f('0x1a')]?_0x33a846[_0xf54f('0x1a')][_0xf54f('0x1e')]||null:null,'include':_0x33a846[_0xf54f('0x1a')]?_0x33a846[_0xf54f('0x1a')][_0xf54f('0x1f')]?_[_0xf54f('0x20')](_0x33a846[_0xf54f('0x1a')][_0xf54f('0x1f')],function(_0x443322){return{'model':db[_0x443322['model']],'as':_0x443322['as'],'attributes':_0x443322['attributes'],'include':_0x443322[_0xf54f('0x1f')]?_[_0xf54f('0x20')](_0x443322[_0xf54f('0x1f')],function(_0x178f0c){return{'model':db[_0x178f0c['model']],'as':_0x178f0c['as'],'attributes':_0x178f0c['attributes'],'include':_0x178f0c['include']?_[_0xf54f('0x20')](_0x178f0c[_0xf54f('0x1f')],function(_0x5e77ce){return{'model':db[_0x5e77ce[_0xf54f('0x21')]],'as':_0x5e77ce['as'],'attributes':_0x5e77ce[_0xf54f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xf54f('0xd')](function(_0x54b7c0){logger['info'](_0xf54f('0x22'),_0x33a846);logger[_0xf54f('0x10')](_0xf54f('0x22'),_0x33a846,JSON[_0xf54f('0x13')](_0x54b7c0));_0x34bf6c(_0x54b7c0);})[_0xf54f('0x17')](function(_0x1f85f5){logger['error'](_0xf54f('0x22'),_0x1f85f5[_0xf54f('0x16')],_0x33a846);_0x56f8c4(_0x1b55ce[_0xf54f('0x14')](0x1f4,_0x1f85f5['message']));});});};exports[_0xf54f('0x23')]=function(_0x2775d7){var _0x182ef5=this;return new Promise(function(_0x2c3f06,_0x4f2d28){return db[_0xf54f('0x18')][_0xf54f('0x24')]({'raw':_0x2775d7[_0xf54f('0x1a')]?_0x2775d7['options']['raw']===undefined?!![]:![]:!![],'where':_0x2775d7[_0xf54f('0x1a')]?_0x2775d7[_0xf54f('0x1a')][_0xf54f('0x1c')]||null:null,'attributes':_0x2775d7[_0xf54f('0x1a')]?_0x2775d7[_0xf54f('0x1a')][_0xf54f('0x1d')]||null:null,'include':_0x2775d7[_0xf54f('0x1a')]?_0x2775d7[_0xf54f('0x1a')]['include']?_['map'](_0x2775d7['options']['include'],function(_0x4a122d){return{'model':db[_0x4a122d['model']],'as':_0x4a122d['as'],'attributes':_0x4a122d['attributes'],'include':_0x4a122d[_0xf54f('0x1f')]?_[_0xf54f('0x20')](_0x4a122d[_0xf54f('0x1f')],function(_0x5f7adf){return{'model':db[_0x5f7adf[_0xf54f('0x21')]],'as':_0x5f7adf['as'],'attributes':_0x5f7adf[_0xf54f('0x1d')],'include':_0x5f7adf[_0xf54f('0x1f')]?_[_0xf54f('0x20')](_0x5f7adf['include'],function(_0x332d0b){return{'model':db[_0x332d0b[_0xf54f('0x21')]],'as':_0x332d0b['as'],'attributes':_0x332d0b['attributes']};}):[]};}):[]};}):[]:[]})[_0xf54f('0xd')](function(_0x3b8486){logger[_0xf54f('0xe')](_0xf54f('0x23'),_0x2775d7);logger[_0xf54f('0x10')]('ShowTrigger',_0x2775d7,JSON[_0xf54f('0x13')](_0x3b8486));_0x2c3f06(_0x3b8486);})[_0xf54f('0x17')](function(_0x47386d){logger['error']('ShowTrigger',_0x47386d[_0xf54f('0x16')],_0x2775d7);_0x4f2d28(_0x182ef5[_0xf54f('0x14')](0x1f4,_0x47386d['message']));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index be38bf9..5043ca6 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 _0xef21=['clone','create','delete','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./trunk.controller','get','index','/:id','isAuthenticated','show','post','/:id/clone'];(function(_0x110522,_0x4b6716){var _0x3b8130=function(_0x1e9115){while(--_0x1e9115){_0x110522['push'](_0x110522['shift']());}};_0x3b8130(++_0x4b6716);}(_0xef21,0x193));var _0x1ef2=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xef21[_0x4a53d];return _0x27410e;};'use strict';var multer=require(_0x1ef2('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1ef2('0x1'));var express=require(_0x1ef2('0x2'));var router=express[_0x1ef2('0x3')]();var fs_extra=require(_0x1ef2('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1ef2('0x5'));var config=require(_0x1ef2('0x6'));var controller=require(_0x1ef2('0x7'));router[_0x1ef2('0x8')]('/',auth['isAuthenticated'](),controller[_0x1ef2('0x9')]);router[_0x1ef2('0x8')](_0x1ef2('0xa'),auth[_0x1ef2('0xb')](),controller[_0x1ef2('0xc')]);router[_0x1ef2('0xd')](_0x1ef2('0xe'),auth['isAuthenticated'](),controller[_0x1ef2('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1ef2('0x10')]);router['put']('/:id',auth[_0x1ef2('0xb')](),controller['update']);router[_0x1ef2('0x11')](_0x1ef2('0xa'),auth[_0x1ef2('0xb')](),controller['destroy']);module[_0x1ef2('0x12')]=router; \ No newline at end of file +var _0x8415=['put','update','destroy','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','index','get','/:id','isAuthenticated','show','post','/:id/clone','clone','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8415,0xf1));var _0x5841=function(_0xfc959c,_0x4660c){_0xfc959c=_0xfc959c-0x0;var _0xa12959=_0x8415[_0xfc959c];return _0xa12959;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x5841('0x0'));var express=require('express');var router=express[_0x5841('0x1')]();var fs_extra=require(_0x5841('0x2'));var auth=require(_0x5841('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x5841('0x4'));var controller=require('./trunk.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x5841('0x5')]);router[_0x5841('0x6')](_0x5841('0x7'),auth[_0x5841('0x8')](),controller[_0x5841('0x9')]);router[_0x5841('0xa')](_0x5841('0xb'),auth[_0x5841('0x8')](),controller[_0x5841('0xc')]);router[_0x5841('0xa')]('/',auth['isAuthenticated'](),controller[_0x5841('0xd')]);router[_0x5841('0xe')](_0x5841('0x7'),auth[_0x5841('0x8')](),controller[_0x5841('0xf')]);router['delete'](_0x5841('0x7'),auth['isAuthenticated'](),controller[_0x5841('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 52bef61..ffa5830 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 _0x460e=['ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','STRING','udp','join','getDataValue','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','update','outgoing','yes','force_rport,comedia','setDataValue','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\x22alaw\x22]','port,invite','insecure','never','INTEGER','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','pai','fingerprint','certificate','passive','actpass','nonat','update,nonat','sequelize','name','ENUM','user','peer','friend','from-voip-provider'];(function(_0x43365,_0x1b0d0c){var _0x4132a5=function(_0xe18243){while(--_0xe18243){_0x43365['push'](_0x43365['shift']());}};_0x4132a5(++_0x1b0d0c);}(_0x460e,0x98));var _0xe460=function(_0x44268d,_0xad8443){_0x44268d=_0x44268d-0x0;var _0x4be92d=_0x460e[_0x44268d];return _0x4be92d;};'use strict';var Sequelize=require(_0xe460('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xe460('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xe460('0x2')]('friend',_0xe460('0x3'),_0xe460('0x4')),'allowNull':![],'defaultValue':_0xe460('0x5')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xe460('0x6')},'callingpres':{'type':Sequelize[_0xe460('0x2')](_0xe460('0x7'),_0xe460('0x8'),_0xe460('0x9'),_0xe460('0xa'),_0xe460('0xb'),'PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB')},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0xe460('0xc')]},'md5secret':{'type':Sequelize[_0xe460('0xc')]},'remotesecret':{'type':Sequelize[_0xe460('0xc')]},'transport':{'type':Sequelize[_0xe460('0xc')],'defaultValue':_0xe460('0xd'),'set':function(_0x5aa992){this['setDataValue']('transport',_0x5aa992?_0x5aa992[_0xe460('0xe')](','):null);},'get':function(){return this[_0xe460('0xf')](_0xe460('0x10'))?this['getDataValue']('transport')[_0xe460('0x11')](','):null;},'comment':_0xe460('0x12')},'dtmfmode':{'type':Sequelize['ENUM'](_0xe460('0x13'),_0xe460('0x14'),_0xe460('0x15'),_0xe460('0x16'),_0xe460('0x17')),'defaultValue':_0xe460('0x13')},'directmedia':{'type':Sequelize[_0xe460('0x2')]('yes','no','nonat',_0xe460('0x18'),_0xe460('0x19')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xe460('0x1a'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xe460('0xc')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0xe460('0xc')],'defaultValue':_0xe460('0x1b'),'set':function(_0x24d83d){this[_0xe460('0x1c')](_0xe460('0x1d'),_0x24d83d?_0x24d83d[_0xe460('0xe')](','):null);},'get':function(){return this['getDataValue']('nat')?this[_0xe460('0xf')](_0xe460('0x1d'))[_0xe460('0x11')](','):null;},'comment':_0xe460('0x1e')},'callgroup':{'type':Sequelize[_0xe460('0xc')]},'namedcallgroup':{'type':Sequelize[_0xe460('0xc')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xe460('0xc')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0xe460('0xc')],'defaultValue':_0xe460('0x1f')},'allow':{'type':Sequelize[_0xe460('0xc')],'allowNull':![],'defaultValue':_0xe460('0x20'),'set':function(_0x1e65c2){this['setDataValue'](_0xe460('0x21'),_0x1e65c2?_0x1e65c2[_0xe460('0xe')](';'):_0xe460('0x20'));},'get':function(){return this[_0xe460('0xf')](_0xe460('0x21'))?this[_0xe460('0xf')]('allow')['split'](';'):null;},'comment':_0xe460('0x22')},'autoframing':{'type':Sequelize[_0xe460('0x2')](_0xe460('0x1a'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0xe460('0x23'),'set':function(_0x22e595){this['setDataValue'](_0xe460('0x24'),_0x22e595?_0x22e595[_0xe460('0xe')](','):null);},'get':function(){return this[_0xe460('0xf')]('insecure')?this[_0xe460('0xf')](_0xe460('0x24'))[_0xe460('0x11')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0xe460('0x1a'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0xe460('0x1a'),'no',_0xe460('0x25'))},'promiscredir':{'type':Sequelize[_0xe460('0x2')](_0xe460('0x1a'),'no')},'useclientcode':{'type':Sequelize[_0xe460('0x2')]('yes','no')},'accountcode':{'type':Sequelize[_0xe460('0x26')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xe460('0xc')],'defaultValue':_0xe460('0x27')},'amaflags':{'type':Sequelize[_0xe460('0xc')]},'callcounter':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xe460('0x1a')},'busylevel':{'type':Sequelize[_0xe460('0x26')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0xe460('0x1a'),'no')},'allowsubscribe':{'type':Sequelize[_0xe460('0x2')](_0xe460('0x1a'),'no')},'allowtransfer':{'type':Sequelize['ENUM'](_0xe460('0x1a'),'no')},'ignoresdpversion':{'type':Sequelize[_0xe460('0x2')](_0xe460('0x1a'),'no')},'subscribecontext':{'type':Sequelize[_0xe460('0xc')]},'template':{'type':Sequelize[_0xe460('0xc')]},'videosupport':{'type':Sequelize[_0xe460('0x2')]('yes','no',_0xe460('0x28')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0xe460('0x2')](_0xe460('0x1a'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize['ENUM'](_0xe460('0x29'),_0xe460('0x2a'),_0xe460('0x2b'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0xe460('0x26')](0xb)},'session_refresher':{'type':Sequelize[_0xe460('0x2')](_0xe460('0x2c'),_0xe460('0x2d')),'defaultValue':_0xe460('0x2d')},'t38pt_usertpsource':{'type':Sequelize[_0xe460('0xc')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0xe460('0xc')]},'fromuser':{'type':Sequelize[_0xe460('0xc')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize['ENUM'](_0xe460('0x1a'),'no'),'defaultValue':_0xe460('0x1a')},'keepalive':{'type':Sequelize[_0xe460('0x26')](0xb)},'defaultip':{'type':Sequelize[_0xe460('0xc')]},'defaultuser':{'type':Sequelize[_0xe460('0xc')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0xe460('0x26')](0xb)},'sendrpid':{'type':Sequelize[_0xe460('0x2')](_0xe460('0x1a'),'no',_0xe460('0x2e')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xe460('0xc')]},'callbackextension':{'type':Sequelize[_0xe460('0xc')]},'timert1':{'type':Sequelize[_0xe460('0x26')](0xb)},'timerb':{'type':Sequelize[_0xe460('0x26')](0xb)},'qualifyfreq':{'type':Sequelize[_0xe460('0x26')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0xe460('0xc')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0xe460('0xc')]},'maxforwards':{'type':Sequelize[_0xe460('0x26')](0xb)},'encryption':{'type':Sequelize[_0xe460('0x2')](_0xe460('0x1a'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xe460('0x2')](_0xe460('0x1a'),'no')},'force_avp':{'type':Sequelize[_0xe460('0x2')]('yes','no')},'icesupport':{'type':Sequelize['ENUM']('yes','no')},'dtlsenable':{'type':Sequelize[_0xe460('0x2')](_0xe460('0x1a'),'no')},'dtlsverify':{'type':Sequelize[_0xe460('0x2')]('yes','no',_0xe460('0x2f'),_0xe460('0x30'))},'dtlsrekey':{'type':Sequelize[_0xe460('0x26')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0xe460('0xc')]},'dtlscipher':{'type':Sequelize[_0xe460('0xc')]},'dtlscafile':{'type':Sequelize[_0xe460('0xc')]},'dtlscapath':{'type':Sequelize[_0xe460('0xc')]},'dtlssetup':{'type':Sequelize['ENUM']('active',_0xe460('0x31'),_0xe460('0x32')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0xe460('0x2')](_0xe460('0x1a'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xe460('0xc')]},'recordofffeature':{'type':Sequelize[_0xe460('0xc')]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xe460('0x2')](_0xe460('0x1a'),'no')},'subscribemwi':{'type':Sequelize['ENUM'](_0xe460('0x1a'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0xe460('0xc')]},'parkinglot':{'type':Sequelize[_0xe460('0xc')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING'],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize['ENUM'](_0xe460('0x1a'),'no',_0xe460('0x33'),_0xe460('0x18'),_0xe460('0x34')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xe460('0xc')]},'otherFields':{'type':Sequelize[_0xe460('0xc')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xe460('0xc')],'defaultValue':'no'}}; \ No newline at end of file +var _0xcf07=['originate','uac','pai','fingerprint','certificate','active','passive','actpass','dynamic','update,nonat','BOOLEAN','exports','name','friend','peer','from-voip-provider','ENUM','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','STRING','udp','setDataValue','transport','join','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','inband','auto','yes','nonat','update','outgoing','nat','split','all','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','\x22\x22\x20<>','INTEGER','accept'];(function(_0x370476,_0x414fe4){var _0x2059fe=function(_0x3f04a1){while(--_0x3f04a1){_0x370476['push'](_0x370476['shift']());}};_0x2059fe(++_0x414fe4);}(_0xcf07,0x193));var _0x7cf0=function(_0x328b1c,_0xec0b4f){_0x328b1c=_0x328b1c-0x0;var _0x4dbeaa=_0xcf07[_0x328b1c];return _0x4dbeaa;};'use strict';var Sequelize=require('sequelize');module[_0x7cf0('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x7cf0('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x7cf0('0x2'),'user',_0x7cf0('0x3')),'allowNull':![],'defaultValue':_0x7cf0('0x2')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7cf0('0x4')},'callingpres':{'type':Sequelize[_0x7cf0('0x5')](_0x7cf0('0x6'),_0x7cf0('0x7'),_0x7cf0('0x8'),_0x7cf0('0x9'),'PROHIB_NOT_SCREENED',_0x7cf0('0xa'),_0x7cf0('0xb'),_0x7cf0('0xc'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0x7cf0('0xd')]},'secret':{'type':Sequelize[_0x7cf0('0xd')]},'md5secret':{'type':Sequelize[_0x7cf0('0xd')]},'remotesecret':{'type':Sequelize[_0x7cf0('0xd')]},'transport':{'type':Sequelize[_0x7cf0('0xd')],'defaultValue':_0x7cf0('0xe'),'set':function(_0x262f78){this[_0x7cf0('0xf')](_0x7cf0('0x10'),_0x262f78?_0x262f78[_0x7cf0('0x11')](','):null);},'get':function(){return this['getDataValue']('transport')?this[_0x7cf0('0x12')](_0x7cf0('0x10'))['split'](','):null;},'comment':_0x7cf0('0x13')},'dtmfmode':{'type':Sequelize[_0x7cf0('0x5')](_0x7cf0('0x14'),'info',_0x7cf0('0x15'),_0x7cf0('0x16'),_0x7cf0('0x17')),'defaultValue':_0x7cf0('0x14')},'directmedia':{'type':Sequelize[_0x7cf0('0x5')](_0x7cf0('0x18'),'no',_0x7cf0('0x19'),_0x7cf0('0x1a'),_0x7cf0('0x1b')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x7cf0('0x5')](_0x7cf0('0x18'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x7cf0('0xd')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize['STRING'],'defaultValue':'force_rport,comedia','set':function(_0x38a033){this[_0x7cf0('0xf')](_0x7cf0('0x1c'),_0x38a033?_0x38a033['join'](','):null);},'get':function(){return this[_0x7cf0('0x12')](_0x7cf0('0x1c'))?this[_0x7cf0('0x12')](_0x7cf0('0x1c'))[_0x7cf0('0x1d')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x7cf0('0xd')]},'namedcallgroup':{'type':Sequelize[_0x7cf0('0xd')]},'pickupgroup':{'type':Sequelize[_0x7cf0('0xd')]},'namedpickupgroup':{'type':Sequelize[_0x7cf0('0xd')]},'language':{'type':Sequelize[_0x7cf0('0xd')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x7cf0('0xd')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x7cf0('0xd')],'defaultValue':_0x7cf0('0x1e')},'allow':{'type':Sequelize[_0x7cf0('0xd')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x5cc2a0){this[_0x7cf0('0xf')](_0x7cf0('0x1f'),_0x5cc2a0?_0x5cc2a0[_0x7cf0('0x11')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x7cf0('0x12')]('allow')?this[_0x7cf0('0x12')](_0x7cf0('0x1f'))[_0x7cf0('0x1d')](';'):null;},'comment':_0x7cf0('0x20')},'autoframing':{'type':Sequelize[_0x7cf0('0x5')](_0x7cf0('0x18'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':'port,invite','set':function(_0x353349){this['setDataValue'](_0x7cf0('0x21'),_0x353349?_0x353349[_0x7cf0('0x11')](','):null);},'get':function(){return this[_0x7cf0('0x12')](_0x7cf0('0x21'))?this[_0x7cf0('0x12')]('insecure')[_0x7cf0('0x1d')](','):null;},'comment':_0x7cf0('0x22')},'trustrpid':{'type':Sequelize['ENUM'](_0x7cf0('0x18'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x7cf0('0x5')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x7cf0('0x5')](_0x7cf0('0x18'),'no','never')},'promiscredir':{'type':Sequelize[_0x7cf0('0x5')](_0x7cf0('0x18'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0x7cf0('0x18'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x7cf0('0xd')]},'callerid':{'type':Sequelize[_0x7cf0('0xd')],'defaultValue':_0x7cf0('0x23')},'amaflags':{'type':Sequelize[_0x7cf0('0xd')]},'callcounter':{'type':Sequelize[_0x7cf0('0x5')](_0x7cf0('0x18'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0x7cf0('0x5')](_0x7cf0('0x18'),'no')},'allowsubscribe':{'type':Sequelize[_0x7cf0('0x5')](_0x7cf0('0x18'),'no')},'allowtransfer':{'type':Sequelize[_0x7cf0('0x5')]('yes','no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x7cf0('0x18'),'no')},'subscribecontext':{'type':Sequelize[_0x7cf0('0xd')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0x7cf0('0x5')](_0x7cf0('0x18'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x7cf0('0x24')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM']('yes','no')},'mailbox':{'type':Sequelize[_0x7cf0('0xd')]},'session_timers':{'type':Sequelize['ENUM'](_0x7cf0('0x25'),'refuse',_0x7cf0('0x26'))},'session_expires':{'type':Sequelize[_0x7cf0('0x24')](0xb)},'session_minse':{'type':Sequelize[_0x7cf0('0x24')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0x7cf0('0x27'),'uas'),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x7cf0('0xd')]},'regexten':{'type':Sequelize[_0x7cf0('0xd')]},'fromdomain':{'type':Sequelize[_0x7cf0('0xd')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0x7cf0('0x5')](_0x7cf0('0x18'),'no'),'defaultValue':_0x7cf0('0x18')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0x7cf0('0xd')]},'defaultuser':{'type':Sequelize[_0x7cf0('0xd')]},'rtptimeout':{'type':Sequelize[_0x7cf0('0x24')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x7cf0('0x24')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x7cf0('0x24')](0xb)},'sendrpid':{'type':Sequelize[_0x7cf0('0x5')](_0x7cf0('0x18'),'no',_0x7cf0('0x28')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x7cf0('0xd')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x7cf0('0x24')](0xb)},'timerb':{'type':Sequelize[_0x7cf0('0x24')](0xb)},'qualifyfreq':{'type':Sequelize[_0x7cf0('0x24')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0x7cf0('0xd')]},'use_q850_reason':{'type':Sequelize[_0x7cf0('0xd')]},'maxforwards':{'type':Sequelize[_0x7cf0('0x24')](0xb)},'encryption':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x7cf0('0x18'),'no')},'force_avp':{'type':Sequelize[_0x7cf0('0x5')](_0x7cf0('0x18'),'no')},'icesupport':{'type':Sequelize[_0x7cf0('0x5')]('yes','no')},'dtlsenable':{'type':Sequelize[_0x7cf0('0x5')](_0x7cf0('0x18'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0x7cf0('0x18'),'no',_0x7cf0('0x29'),_0x7cf0('0x2a'))},'dtlsrekey':{'type':Sequelize[_0x7cf0('0x24')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0x7cf0('0xd')]},'dtlscipher':{'type':Sequelize[_0x7cf0('0xd')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0x7cf0('0xd')]},'dtlssetup':{'type':Sequelize['ENUM'](_0x7cf0('0x2b'),_0x7cf0('0x2c'),_0x7cf0('0x2d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x7cf0('0xd')]},'usereqphone':{'type':Sequelize[_0x7cf0('0x5')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x7cf0('0xd')]},'recordofffeature':{'type':Sequelize[_0x7cf0('0xd')]},'call_limit':{'type':Sequelize[_0x7cf0('0x24')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0x7cf0('0x18'),'no')},'subscribemwi':{'type':Sequelize[_0x7cf0('0x5')](_0x7cf0('0x18'),'no')},'vmexten':{'type':Sequelize[_0x7cf0('0xd')]},'mohinterpret':{'type':Sequelize[_0x7cf0('0xd')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0x7cf0('0xd')]},'description':{'type':Sequelize[_0x7cf0('0xd')]},'host':{'type':Sequelize[_0x7cf0('0xd')],'defaultValue':_0x7cf0('0x2e')},'canreinvite':{'type':Sequelize[_0x7cf0('0x5')](_0x7cf0('0x18'),'no',_0x7cf0('0x19'),'update',_0x7cf0('0x2f')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0x7cf0('0xd')]},'active':{'type':Sequelize[_0x7cf0('0x30')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'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 d23bf48..034f263 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 _0x008c=['update','destroy','get','Trunks','UserProfileResource','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','Trunk','findAll','show','params','includeAll','include','options','clone','find','omit','createdAt','updatedAt','body','create','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','root','utf8','server/files/templates/registry.ejs','render','/etc/asterisk/sip_xcally_trunks.conf','registry','writeFileSync','Reload','chan_sip.so','server/files/templates/trunk.ejs','join','/etc/asterisk/sip_xcally_registers.conf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','Trunk,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save'];(function(_0x497826,_0x164921){var _0x4b3ae6=function(_0x1c18e1){while(--_0x1c18e1){_0x497826['push'](_0x497826['shift']());}};_0x4b3ae6(++_0x164921);}(_0x008c,0x188));var _0xc008=function(_0x3a5fdd,_0x410065){_0x3a5fdd=_0x3a5fdd-0x0;var _0x46fcd6=_0x008c[_0x3a5fdd];return _0x46fcd6;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];var jayson=require(_0xc008('0x18'));var client=jayson[_0xc008('0x19')][_0xc008('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x593f7a,_0x560e28,_0x33f44c,_0x50c1ab){return new BPromise(function(_0x25e13f,_0x4584e1){var _0x2073ef=_0x50c1ab||client;return _0x2073ef[_0xc008('0x1b')](_0x593f7a,_0x33f44c)[_0xc008('0x1c')](function(_0x5ee00b){logger['info']('Trunk,\x20%s,\x20%s',_0x560e28,_0xc008('0x1d'));logger[_0xc008('0x1e')](_0xc008('0x1f'),_0x560e28,_0xc008('0x1d'),JSON['stringify'](_0x5ee00b));if(_0x5ee00b['error']){if(_0x5ee00b['error']['code']===0x1f4){logger[_0xc008('0x20')](_0xc008('0x21'),_0x560e28,_0x5ee00b['error'][_0xc008('0x22')]);return _0x4584e1(_0x5ee00b['error']['message']);}logger['error']('Trunk,\x20%s,\x20%s',_0x560e28,_0x5ee00b[_0xc008('0x20')]['message']);return _0x25e13f(_0x5ee00b['error']['message']);}else{logger['info']('Trunk,\x20%s,\x20%s',_0x560e28,_0xc008('0x1d'));_0x25e13f(_0x5ee00b[_0xc008('0x23')][_0xc008('0x22')]);}})[_0xc008('0x24')](function(_0x11cc75){logger[_0xc008('0x20')]('Trunk,\x20%s,\x20%s',_0x560e28,_0x11cc75);_0x4584e1(_0x11cc75);});});}function respondWithStatusCode(_0x459fd9,_0x5c85f2){_0x5c85f2=_0x5c85f2||0xcc;return function(_0x58a6ea){if(_0x58a6ea){return _0x459fd9[_0xc008('0x25')](_0x5c85f2);}return _0x459fd9[_0xc008('0x26')](_0x5c85f2)[_0xc008('0x27')]();};}function respondWithResult(_0x3cb28c,_0x5410f5){_0x5410f5=_0x5410f5||0xc8;return function(_0x48582b){if(_0x48582b){return _0x3cb28c['status'](_0x5410f5)[_0xc008('0x28')](_0x48582b);}};}function respondWithFilteredResult(_0x15dade,_0x92c582){return function(_0x2e31c2){if(_0x2e31c2){var _0x5bebd9=typeof _0x92c582['offset']==='undefined'&&typeof _0x92c582['limit']==='undefined';var _0x3865c0=_0x2e31c2[_0xc008('0x29')];var _0x25eae4=_0x5bebd9?0x0:_0x92c582['offset'];var _0x24c14c=_0x5bebd9?_0x2e31c2[_0xc008('0x29')]:_0x92c582[_0xc008('0x2a')]+_0x92c582[_0xc008('0x2b')];var _0x4c5dec;if(_0x24c14c>=_0x3865c0){_0x24c14c=_0x3865c0;_0x4c5dec=0xc8;}else{_0x4c5dec=0xce;}_0x15dade[_0xc008('0x26')](_0x4c5dec);return _0x15dade[_0xc008('0x2c')]('Content-Range',_0x25eae4+'-'+_0x24c14c+'/'+_0x3865c0)['json'](_0x2e31c2);}return null;};}function patchUpdates(_0x539766){return function(_0x1032b2){try{jsonpatch[_0xc008('0x2d')](_0x1032b2,_0x539766,!![]);}catch(_0xf831f2){return BPromise[_0xc008('0x2e')](_0xf831f2);}return _0x1032b2[_0xc008('0x2f')]();};}function saveUpdates(_0xceebc3,_0x294f97){return function(_0x22d8e8){if(_0x22d8e8){return _0x22d8e8[_0xc008('0x30')](_0xceebc3)[_0xc008('0x1c')](function(_0x2f4b6b){return _0x2f4b6b;});}return null;};}function removeEntity(_0x1ac7c8,_0x596ee8){return function(_0x334a09){if(_0x334a09){return _0x334a09[_0xc008('0x31')]()['then'](function(){var _0xaf4b84=_0x334a09[_0xc008('0x32')]({'plain':!![]});var _0x383be7=_0xc008('0x33');return db[_0xc008('0x34')][_0xc008('0x31')]({'where':{'type':_0x383be7,'resourceId':_0xaf4b84['id']}})[_0xc008('0x1c')](function(){return _0x334a09;});})[_0xc008('0x1c')](function(){_0x1ac7c8[_0xc008('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x415b87,_0x389a40){return function(_0x459df4){if(!_0x459df4){_0x415b87[_0xc008('0x25')](0x194);}return _0x459df4;};}function handleError(_0x40002f,_0x315562){_0x315562=_0x315562||0x1f4;return function(_0x1667a0){logger['error'](_0x1667a0[_0xc008('0x35')]);if(_0x1667a0[_0xc008('0x36')]){delete _0x1667a0['name'];}_0x40002f[_0xc008('0x26')](_0x315562)[_0xc008('0x37')](_0x1667a0);};}exports['index']=function(_0x263473,_0x2e4ae1){var _0x280e9b={},_0x55ff48={},_0x53b353={'count':0x0,'rows':[]};var _0x478810=_[_0xc008('0x38')](db['Trunk'][_0xc008('0x39')],function(_0x3884dd){return{'name':_0x3884dd[_0xc008('0x3a')],'type':_0x3884dd[_0xc008('0x3b')][_0xc008('0x3c')]};});_0x55ff48[_0xc008('0x3d')]=_[_0xc008('0x38')](_0x478810,_0xc008('0x36'));_0x55ff48[_0xc008('0x3e')]=_[_0xc008('0x3f')](_0x263473[_0xc008('0x3e')]);_0x55ff48[_0xc008('0x40')]=_[_0xc008('0x41')](_0x55ff48[_0xc008('0x3d')],_0x55ff48['query']);_0x280e9b[_0xc008('0x42')]=_[_0xc008('0x41')](_0x55ff48[_0xc008('0x3d')],qs[_0xc008('0x43')](_0x263473['query'][_0xc008('0x43')]));_0x280e9b[_0xc008('0x42')]=_0x280e9b[_0xc008('0x42')][_0xc008('0x44')]?_0x280e9b[_0xc008('0x42')]:_0x55ff48['model'];if(!_0x263473[_0xc008('0x3e')][_0xc008('0x45')](_0xc008('0x46'))){_0x280e9b[_0xc008('0x2b')]=qs[_0xc008('0x2b')](_0x263473['query'][_0xc008('0x2b')]);_0x280e9b[_0xc008('0x2a')]=qs[_0xc008('0x2a')](_0x263473[_0xc008('0x3e')]['offset']);}_0x280e9b[_0xc008('0x47')]=qs[_0xc008('0x48')](_0x263473[_0xc008('0x3e')]['sort']);_0x280e9b[_0xc008('0x49')]=qs['filters'](_[_0xc008('0x4a')](_0x263473['query'],_0x55ff48[_0xc008('0x40')]),_0x478810);if(_0x263473[_0xc008('0x3e')]['filter']){_0x280e9b[_0xc008('0x49')]=_[_0xc008('0x4b')](_0x280e9b[_0xc008('0x49')],{'$or':_['map'](_0x478810,function(_0x1cec64){if(_0x1cec64[_0xc008('0x3b')]!==_0xc008('0x4c')){var _0x44fc5d={};_0x44fc5d[_0x1cec64[_0xc008('0x36')]]={'$like':'%'+_0x263473[_0xc008('0x3e')]['filter']+'%'};return _0x44fc5d;}})});}_0x280e9b=_['merge']({},_0x280e9b,_0x263473['options']);var _0x4552ed={'where':_0x280e9b[_0xc008('0x49')]};return db[_0xc008('0x4d')][_0xc008('0x29')](_0x4552ed)[_0xc008('0x1c')](function(_0x24f6a4){_0x53b353[_0xc008('0x29')]=_0x24f6a4;if(_0x263473[_0xc008('0x3e')]['includeAll']){_0x280e9b['include']=[{'all':!![]}];}return db['Trunk'][_0xc008('0x4e')](_0x280e9b);})[_0xc008('0x1c')](function(_0x158eae){_0x53b353['rows']=_0x158eae;return _0x53b353;})[_0xc008('0x1c')](respondWithFilteredResult(_0x2e4ae1,_0x280e9b))[_0xc008('0x24')](handleError(_0x2e4ae1,null));};exports[_0xc008('0x4f')]=function(_0x1c2c50,_0x4981b4){var _0x56e4ac={'raw':![],'where':{'id':_0x1c2c50[_0xc008('0x50')]['id']}},_0x17ec90={};_0x17ec90[_0xc008('0x3d')]=_[_0xc008('0x3f')](db['Trunk']['rawAttributes']);_0x17ec90[_0xc008('0x3e')]=_['keys'](_0x1c2c50[_0xc008('0x3e')]);_0x17ec90[_0xc008('0x40')]=_[_0xc008('0x41')](_0x17ec90['model'],_0x17ec90[_0xc008('0x3e')]);_0x56e4ac[_0xc008('0x42')]=_[_0xc008('0x41')](_0x17ec90[_0xc008('0x3d')],qs[_0xc008('0x43')](_0x1c2c50['query'][_0xc008('0x43')]));_0x56e4ac[_0xc008('0x42')]=_0x56e4ac['attributes'][_0xc008('0x44')]?_0x56e4ac[_0xc008('0x42')]:_0x17ec90['model'];if(_0x1c2c50['query'][_0xc008('0x51')]){_0x56e4ac[_0xc008('0x52')]=[{'all':!![]}];}_0x56e4ac=_[_0xc008('0x4b')]({},_0x56e4ac,_0x1c2c50[_0xc008('0x53')]);return db[_0xc008('0x4d')]['find'](_0x56e4ac)['then'](handleEntityNotFound(_0x4981b4,null))[_0xc008('0x1c')](respondWithResult(_0x4981b4,null))['catch'](handleError(_0x4981b4,null));};exports[_0xc008('0x54')]=function(_0x25d351,_0xf94fcb){var _0x2f1105={'where':{'id':_0x25d351[_0xc008('0x50')]['id']}},_0x44f42d={};_0x44f42d['model']=_[_0xc008('0x3f')](db[_0xc008('0x4d')][_0xc008('0x39')]);_0x2f1105[_0xc008('0x42')]=_[_0xc008('0x41')](_0x44f42d['model'],qs[_0xc008('0x43')](_0x25d351['query']['fields']));_0x2f1105['attributes']=_0x2f1105[_0xc008('0x42')][_0xc008('0x44')]?_0x2f1105[_0xc008('0x42')]:_0x44f42d['model'];if(_0x25d351[_0xc008('0x3e')][_0xc008('0x51')]){_0x2f1105[_0xc008('0x52')]=[{'all':!![]}];}_0x2f1105=_['merge']({},_0x2f1105,_0x25d351[_0xc008('0x53')]);return db[_0xc008('0x4d')][_0xc008('0x55')](_0x2f1105)[_0xc008('0x1c')](handleEntityNotFound(_0xf94fcb,null))['then'](function(_0x4022dd){if(_0x4022dd){var _0x4eaa6d=_0x4022dd[_0xc008('0x32')]({'plain':!![]});_0x4eaa6d=qs[_0xc008('0x56')](_0x4eaa6d,['id',_0xc008('0x57'),_0xc008('0x58')]);_0x25d351[_0xc008('0x59')]=_[_0xc008('0x56')](_0x25d351['body'],['id',_0xc008('0x57'),'updatedAt']);return db['Trunk'][_0xc008('0x5a')](_[_0xc008('0x4b')](_0x4eaa6d,_0x25d351['body']),{'include':_0x25d351[_0xc008('0x3e')][_0xc008('0x51')]?[{'all':!![]}]:undefined})[_0xc008('0x1c')](function(_0x4517c0){var _0x21ee6d=_0x25d351[_0xc008('0x5b')][_0xc008('0x32')]({'plain':!![]});if(!_0x21ee6d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x21ee6d[_0xc008('0x5c')]===_0xc008('0x5b')){var _0x3bfb15=_0x4517c0[_0xc008('0x32')]({'plain':!![]});var _0xb3ca0f=_0xc008('0x33');return db[_0xc008('0x5d')][_0xc008('0x55')]({'where':{'name':_0xb3ca0f,'userProfileId':_0x21ee6d[_0xc008('0x5e')]},'raw':!![]})[_0xc008('0x1c')](function(_0x1bef66){if(_0x1bef66&&_0x1bef66[_0xc008('0x5f')]===0x0){return db[_0xc008('0x34')][_0xc008('0x5a')]({'name':_0x3bfb15['name'],'resourceId':_0x3bfb15['id'],'type':_0x1bef66[_0xc008('0x36')],'sectionId':_0x1bef66['id']},{})[_0xc008('0x1c')](function(){return _0x4517c0;});}else{return _0x4517c0;}})[_0xc008('0x24')](function(_0x566dea){logger[_0xc008('0x20')](_0xc008('0x60'),_0x566dea);throw _0x566dea;});}return _0x4517c0;});}})['then'](respondWithResult(_0xf94fcb,0xc9))['catch'](handleError(_0xf94fcb,null));};exports[_0xc008('0x5a')]=function(_0x2a4c2b,_0x7bad14,_0x39083c){var _0x1a2ce7;return db[_0xc008('0x4d')][_0xc008('0x5a')](_0x2a4c2b[_0xc008('0x59')],{'raw':!![]})[_0xc008('0x1c')](function(_0x1b059b){_0x1a2ce7=_0x1b059b;return db[_0xc008('0x4d')]['findAll']({'raw':!![]});})[_0xc008('0x1c')](function(_0x25a52b){var _0xfdb5e3=fs[_0xc008('0x61')](path['join'](config[_0xc008('0x62')],'server/files/templates/trunk.ejs'),_0xc008('0x63'));var _0x46fa7b=fs[_0xc008('0x61')](path['join'](config[_0xc008('0x62')],_0xc008('0x64')),_0xc008('0x63'));var _0x553f5c=ejs[_0xc008('0x65')](_0xfdb5e3,{'trunks':_0x25a52b||[]});fs['writeFileSync'](_0xc008('0x66'),_0x553f5c);if(_0x1a2ce7[_0xc008('0x67')]){var _0x23012c=ejs[_0xc008('0x65')](_0x46fa7b,{'trunks':_0x25a52b||[]});fs[_0xc008('0x68')]('/etc/asterisk/sip_xcally_registers.conf',_0x23012c);}})[_0xc008('0x1c')](function(){return respondWithRpcPromise(_0xc008('0x69'),'create',{'module':_0xc008('0x6a')});})['then'](function(){var _0x278cbe=_0x2a4c2b['user'][_0xc008('0x32')]({'plain':!![]});if(!_0x278cbe)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x278cbe[_0xc008('0x5c')]===_0xc008('0x5b')){var _0x33d8e4=_0x1a2ce7[_0xc008('0x32')]({'plain':!![]});return db['UserProfileSection'][_0xc008('0x55')]({'where':{'name':_0xc008('0x33'),'userProfileId':_0x278cbe[_0xc008('0x5e')]},'raw':!![]})[_0xc008('0x1c')](function(_0x321500){if(_0x321500&&_0x321500[_0xc008('0x5f')]===0x0){return db[_0xc008('0x34')][_0xc008('0x5a')]({'name':_0x33d8e4['name'],'resourceId':_0x33d8e4['id'],'type':_0x321500[_0xc008('0x36')],'sectionId':_0x321500['id']},{})['then'](function(){return _0x1a2ce7;});}else{return _0x1a2ce7;}})['catch'](function(_0x4c84da){logger[_0xc008('0x20')](_0xc008('0x60'),_0x4c84da);throw _0x4c84da;});}return _0x1a2ce7;})[_0xc008('0x1c')](respondWithResult(_0x7bad14,0xc9))[_0xc008('0x24')](handleError(_0x7bad14,null));};exports[_0xc008('0x30')]=function(_0x2e9646,_0x23ef42,_0x519328){var _0x127bdf;return db['Trunk'][_0xc008('0x55')]({'where':{'id':_0x2e9646[_0xc008('0x50')]['id']}})[_0xc008('0x1c')](handleEntityNotFound(_0x23ef42,null))[_0xc008('0x1c')](saveUpdates(_0x2e9646[_0xc008('0x59')],null))[_0xc008('0x1c')](function(_0x23d4ff){if(_0x23d4ff){_0x127bdf=_0x23d4ff;return db[_0xc008('0x4d')][_0xc008('0x4e')]({'raw':!![]});}})[_0xc008('0x1c')](function(_0x334ed8){if(_0x334ed8){var _0x1dd9fe=fs['readFileSync'](path['join'](config[_0xc008('0x62')],_0xc008('0x6b')),_0xc008('0x63'));var _0x572d93=fs[_0xc008('0x61')](path[_0xc008('0x6c')](config['root'],'server/files/templates/registry.ejs'),'utf8');var _0x3fc44f=ejs[_0xc008('0x65')](_0x1dd9fe,{'trunks':_0x334ed8||[]});fs[_0xc008('0x68')](_0xc008('0x66'),_0x3fc44f);var _0x1101b8=ejs[_0xc008('0x65')](_0x572d93,{'trunks':_0x334ed8||[]});fs[_0xc008('0x68')](_0xc008('0x6d'),_0x1101b8);return respondWithRpcPromise(_0xc008('0x69'),_0xc008('0x30'),{'module':'chan_sip.so'});}return null;})['then'](function(_0xc644fe){if(_0xc644fe){return _0x127bdf;}})[_0xc008('0x1c')](respondWithResult(_0x23ef42,null))[_0xc008('0x24')](handleError(_0x23ef42,null));};exports[_0xc008('0x31')]=function(_0x2b94b2,_0x37fc2c,_0x4b434f){var _0x5794fe;return db[_0xc008('0x4d')][_0xc008('0x55')]({'where':{'id':_0x2b94b2[_0xc008('0x50')]['id']}})['then'](handleEntityNotFound(_0x37fc2c,null))['then'](removeEntity(_0x37fc2c,null))['then'](function(){return db['Trunk']['findAll']({'raw':!![]});})['then'](function(_0x276de2){var _0x52bf60=fs[_0xc008('0x61')](path['join'](config[_0xc008('0x62')],_0xc008('0x6b')),_0xc008('0x63'));var _0x5bc8b0=fs['readFileSync'](path[_0xc008('0x6c')](config['root'],_0xc008('0x64')),_0xc008('0x63'));var _0x544519=ejs[_0xc008('0x65')](_0x52bf60,{'trunks':_0x276de2});var _0x4db90b=ejs['render'](_0x5bc8b0,{'trunks':_0x276de2});fs[_0xc008('0x68')](_0xc008('0x66'),_0x544519);fs['writeFileSync'](_0xc008('0x6d'),_0x4db90b);return respondWithRpcPromise(_0xc008('0x69'),_0xc008('0x31'),{'module':'chan_sip.so'});})[_0xc008('0x24')](handleError(_0x37fc2c,null));}; \ No newline at end of file +var _0x24ca=['lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','info','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','get','Trunks','UserProfileResource','destroy','then','end','name','send','map','Trunk','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','params','rawAttributes','keys','find','clone','length','omit','createdAt','updatedAt','create','user','role','userProfileId','autoAssociation','body','join','root','server/files/templates/trunk.ejs','readFileSync','server/files/templates/registry.ejs','utf8','writeFileSync','registry','render','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','/etc/asterisk/sip_xcally_trunks.conf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x4fffbe,_0x56aff7){var _0x478fab=function(_0x56c9da){while(--_0x56c9da){_0x4fffbe['push'](_0x4fffbe['shift']());}};_0x478fab(++_0x56aff7);}(_0x24ca,0x1bc));var _0xa24c=function(_0x65c0bb,_0x82e7b8){_0x65c0bb=_0x65c0bb-0x0;var _0x320bd5=_0x24ca[_0x65c0bb];return _0x320bd5;};'use strict';var emlformat=require(_0xa24c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa24c('0x1'));var jsonpatch=require(_0xa24c('0x2'));var rp=require(_0xa24c('0x3'));var moment=require('moment');var BPromise=require(_0xa24c('0x4'));var Mustache=require(_0xa24c('0x5'));var util=require(_0xa24c('0x6'));var path=require(_0xa24c('0x7'));var sox=require(_0xa24c('0x8'));var csv=require(_0xa24c('0x9'));var ejs=require(_0xa24c('0xa'));var fs=require('fs');var fs_extra=require(_0xa24c('0xb'));var _=require(_0xa24c('0xc'));var squel=require(_0xa24c('0xd'));var crypto=require(_0xa24c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa24c('0xf'));var toCsv=require(_0xa24c('0x9'));var querystring=require(_0xa24c('0x10'));var Papa=require('papaparse');var Redis=require(_0xa24c('0x11'));var authService=require(_0xa24c('0x12'));var qs=require(_0xa24c('0x13'));var as=require(_0xa24c('0x14'));var hardwareService=require(_0xa24c('0x15'));var logger=require(_0xa24c('0x16'))(_0xa24c('0x17'));var utils=require(_0xa24c('0x18'));var config=require(_0xa24c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa24c('0x1a'))['db'];var jayson=require(_0xa24c('0x1b'));var client=jayson[_0xa24c('0x1c')][_0xa24c('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x5a9486,_0x3ad0bf,_0x3c23fc,_0x26ff28){return new BPromise(function(_0x2fcd8b,_0x1cb08e){var _0x2d185c=_0x26ff28||client;return _0x2d185c[_0xa24c('0x1e')](_0x5a9486,_0x3c23fc)['then'](function(_0x47a063){logger[_0xa24c('0x1f')](_0xa24c('0x20'),_0x3ad0bf,'request\x20sent');logger['debug'](_0xa24c('0x21'),_0x3ad0bf,_0xa24c('0x22'),JSON['stringify'](_0x47a063));if(_0x47a063[_0xa24c('0x23')]){if(_0x47a063['error'][_0xa24c('0x24')]===0x1f4){logger[_0xa24c('0x23')](_0xa24c('0x20'),_0x3ad0bf,_0x47a063[_0xa24c('0x23')]['message']);return _0x1cb08e(_0x47a063[_0xa24c('0x23')][_0xa24c('0x25')]);}logger[_0xa24c('0x23')]('Trunk,\x20%s,\x20%s',_0x3ad0bf,_0x47a063['error']['message']);return _0x2fcd8b(_0x47a063['error'][_0xa24c('0x25')]);}else{logger[_0xa24c('0x1f')](_0xa24c('0x20'),_0x3ad0bf,_0xa24c('0x22'));_0x2fcd8b(_0x47a063['result'][_0xa24c('0x25')]);}})['catch'](function(_0x224bca){logger[_0xa24c('0x23')]('Trunk,\x20%s,\x20%s',_0x3ad0bf,_0x224bca);_0x1cb08e(_0x224bca);});});}function respondWithStatusCode(_0x346ee8,_0x363d52){_0x363d52=_0x363d52||0xcc;return function(_0x43a0c0){if(_0x43a0c0){return _0x346ee8[_0xa24c('0x26')](_0x363d52);}return _0x346ee8[_0xa24c('0x27')](_0x363d52)['end']();};}function respondWithResult(_0xec9167,_0x5cc9cb){_0x5cc9cb=_0x5cc9cb||0xc8;return function(_0x2365f9){if(_0x2365f9){return _0xec9167[_0xa24c('0x27')](_0x5cc9cb)[_0xa24c('0x28')](_0x2365f9);}};}function respondWithFilteredResult(_0x51dc3f,_0x1beb55){return function(_0x31c4d9){if(_0x31c4d9){var _0x14fd5a=typeof _0x1beb55[_0xa24c('0x29')]===_0xa24c('0x2a')&&typeof _0x1beb55[_0xa24c('0x2b')]===_0xa24c('0x2a');var _0x5b23f4=_0x31c4d9[_0xa24c('0x2c')];var _0x28675f=_0x14fd5a?0x0:_0x1beb55[_0xa24c('0x29')];var _0x12dbdc=_0x14fd5a?_0x31c4d9['count']:_0x1beb55[_0xa24c('0x29')]+_0x1beb55[_0xa24c('0x2b')];var _0x97c08;if(_0x12dbdc>=_0x5b23f4){_0x12dbdc=_0x5b23f4;_0x97c08=0xc8;}else{_0x97c08=0xce;}_0x51dc3f['status'](_0x97c08);return _0x51dc3f[_0xa24c('0x2d')](_0xa24c('0x2e'),_0x28675f+'-'+_0x12dbdc+'/'+_0x5b23f4)[_0xa24c('0x28')](_0x31c4d9);}return null;};}function patchUpdates(_0x4ae35c){return function(_0x245fb2){try{jsonpatch['apply'](_0x245fb2,_0x4ae35c,!![]);}catch(_0x1102ab){return BPromise[_0xa24c('0x2f')](_0x1102ab);}return _0x245fb2[_0xa24c('0x30')]();};}function saveUpdates(_0x5d025a,_0x1f52f8){return function(_0x53f90){if(_0x53f90){return _0x53f90[_0xa24c('0x31')](_0x5d025a)['then'](function(_0x1c1ed3){return _0x1c1ed3;});}return null;};}function removeEntity(_0x57c340,_0xa20091){return function(_0x42ba21){if(_0x42ba21){return _0x42ba21['destroy']()['then'](function(){var _0x20a276=_0x42ba21[_0xa24c('0x32')]({'plain':!![]});var _0x182e86=_0xa24c('0x33');return db[_0xa24c('0x34')][_0xa24c('0x35')]({'where':{'type':_0x182e86,'resourceId':_0x20a276['id']}})[_0xa24c('0x36')](function(){return _0x42ba21;});})['then'](function(){_0x57c340[_0xa24c('0x27')](0xcc)[_0xa24c('0x37')]();});}};}function handleEntityNotFound(_0x12825d,_0xbd24c0){return function(_0xc6337b){if(!_0xc6337b){_0x12825d[_0xa24c('0x26')](0x194);}return _0xc6337b;};}function handleError(_0x86902f,_0x81d471){_0x81d471=_0x81d471||0x1f4;return function(_0x1ea166){logger[_0xa24c('0x23')](_0x1ea166['stack']);if(_0x1ea166[_0xa24c('0x38')]){delete _0x1ea166[_0xa24c('0x38')];}_0x86902f[_0xa24c('0x27')](_0x81d471)[_0xa24c('0x39')](_0x1ea166);};}exports['index']=function(_0x56a485,_0x19a65f){var _0x56ef4d={},_0xb690b5={},_0x13f272={'count':0x0,'rows':[]};var _0x22a316=_[_0xa24c('0x3a')](db[_0xa24c('0x3b')]['rawAttributes'],function(_0x532875){return{'name':_0x532875[_0xa24c('0x3c')],'type':_0x532875[_0xa24c('0x3d')][_0xa24c('0x3e')]};});_0xb690b5[_0xa24c('0x3f')]=_[_0xa24c('0x3a')](_0x22a316,_0xa24c('0x38'));_0xb690b5['query']=_['keys'](_0x56a485[_0xa24c('0x40')]);_0xb690b5[_0xa24c('0x41')]=_[_0xa24c('0x42')](_0xb690b5[_0xa24c('0x3f')],_0xb690b5[_0xa24c('0x40')]);_0x56ef4d['attributes']=_[_0xa24c('0x42')](_0xb690b5[_0xa24c('0x3f')],qs['fields'](_0x56a485['query'][_0xa24c('0x43')]));_0x56ef4d[_0xa24c('0x44')]=_0x56ef4d[_0xa24c('0x44')]['length']?_0x56ef4d['attributes']:_0xb690b5[_0xa24c('0x3f')];if(!_0x56a485[_0xa24c('0x40')][_0xa24c('0x45')](_0xa24c('0x46'))){_0x56ef4d[_0xa24c('0x2b')]=qs[_0xa24c('0x2b')](_0x56a485[_0xa24c('0x40')][_0xa24c('0x2b')]);_0x56ef4d['offset']=qs['offset'](_0x56a485[_0xa24c('0x40')][_0xa24c('0x29')]);}_0x56ef4d[_0xa24c('0x47')]=qs['sort'](_0x56a485[_0xa24c('0x40')][_0xa24c('0x48')]);_0x56ef4d[_0xa24c('0x49')]=qs[_0xa24c('0x41')](_[_0xa24c('0x4a')](_0x56a485[_0xa24c('0x40')],_0xb690b5[_0xa24c('0x41')]),_0x22a316);if(_0x56a485[_0xa24c('0x40')][_0xa24c('0x4b')]){_0x56ef4d[_0xa24c('0x49')]=_['merge'](_0x56ef4d[_0xa24c('0x49')],{'$or':_[_0xa24c('0x3a')](_0x22a316,function(_0x39a6cd){if(_0x39a6cd['type']!==_0xa24c('0x4c')){var _0x247d2c={};_0x247d2c[_0x39a6cd[_0xa24c('0x38')]]={'$like':'%'+_0x56a485[_0xa24c('0x40')][_0xa24c('0x4b')]+'%'};return _0x247d2c;}})});}_0x56ef4d=_[_0xa24c('0x4d')]({},_0x56ef4d,_0x56a485[_0xa24c('0x4e')]);var _0x46f725={'where':_0x56ef4d[_0xa24c('0x49')]};return db[_0xa24c('0x3b')][_0xa24c('0x2c')](_0x46f725)['then'](function(_0x29a84d){_0x13f272[_0xa24c('0x2c')]=_0x29a84d;if(_0x56a485[_0xa24c('0x40')][_0xa24c('0x4f')]){_0x56ef4d[_0xa24c('0x50')]=[{'all':!![]}];}return db[_0xa24c('0x3b')][_0xa24c('0x51')](_0x56ef4d);})[_0xa24c('0x36')](function(_0x184179){_0x13f272['rows']=_0x184179;return _0x13f272;})['then'](respondWithFilteredResult(_0x19a65f,_0x56ef4d))[_0xa24c('0x52')](handleError(_0x19a65f,null));};exports['show']=function(_0xc078ef,_0x1f436c){var _0x4ec677={'raw':![],'where':{'id':_0xc078ef[_0xa24c('0x53')]['id']}},_0x24b3df={};_0x24b3df[_0xa24c('0x3f')]=_['keys'](db['Trunk'][_0xa24c('0x54')]);_0x24b3df['query']=_[_0xa24c('0x55')](_0xc078ef[_0xa24c('0x40')]);_0x24b3df[_0xa24c('0x41')]=_[_0xa24c('0x42')](_0x24b3df[_0xa24c('0x3f')],_0x24b3df[_0xa24c('0x40')]);_0x4ec677[_0xa24c('0x44')]=_[_0xa24c('0x42')](_0x24b3df[_0xa24c('0x3f')],qs[_0xa24c('0x43')](_0xc078ef['query'][_0xa24c('0x43')]));_0x4ec677[_0xa24c('0x44')]=_0x4ec677[_0xa24c('0x44')]['length']?_0x4ec677['attributes']:_0x24b3df['model'];if(_0xc078ef[_0xa24c('0x40')]['includeAll']){_0x4ec677[_0xa24c('0x50')]=[{'all':!![]}];}_0x4ec677=_[_0xa24c('0x4d')]({},_0x4ec677,_0xc078ef['options']);return db[_0xa24c('0x3b')][_0xa24c('0x56')](_0x4ec677)[_0xa24c('0x36')](handleEntityNotFound(_0x1f436c,null))[_0xa24c('0x36')](respondWithResult(_0x1f436c,null))[_0xa24c('0x52')](handleError(_0x1f436c,null));};exports[_0xa24c('0x57')]=function(_0x3816f7,_0xbeab78){var _0x518c2a={'where':{'id':_0x3816f7['params']['id']}},_0x172645={};_0x172645['model']=_['keys'](db['Trunk']['rawAttributes']);_0x518c2a[_0xa24c('0x44')]=_['intersection'](_0x172645[_0xa24c('0x3f')],qs[_0xa24c('0x43')](_0x3816f7[_0xa24c('0x40')][_0xa24c('0x43')]));_0x518c2a[_0xa24c('0x44')]=_0x518c2a[_0xa24c('0x44')][_0xa24c('0x58')]?_0x518c2a[_0xa24c('0x44')]:_0x172645[_0xa24c('0x3f')];if(_0x3816f7[_0xa24c('0x40')][_0xa24c('0x4f')]){_0x518c2a[_0xa24c('0x50')]=[{'all':!![]}];}_0x518c2a=_[_0xa24c('0x4d')]({},_0x518c2a,_0x3816f7[_0xa24c('0x4e')]);return db[_0xa24c('0x3b')]['find'](_0x518c2a)[_0xa24c('0x36')](handleEntityNotFound(_0xbeab78,null))[_0xa24c('0x36')](function(_0x5264a7){if(_0x5264a7){var _0x1e08bb=_0x5264a7[_0xa24c('0x32')]({'plain':!![]});_0x1e08bb=qs[_0xa24c('0x59')](_0x1e08bb,['id',_0xa24c('0x5a'),'updatedAt']);_0x3816f7['body']=_[_0xa24c('0x59')](_0x3816f7['body'],['id','createdAt',_0xa24c('0x5b')]);return db[_0xa24c('0x3b')][_0xa24c('0x5c')](_[_0xa24c('0x4d')](_0x1e08bb,_0x3816f7['body']),{'include':_0x3816f7['query'][_0xa24c('0x4f')]?[{'all':!![]}]:undefined})['then'](function(_0x52a895){var _0xfcc193=_0x3816f7[_0xa24c('0x5d')][_0xa24c('0x32')]({'plain':!![]});if(!_0xfcc193)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xfcc193[_0xa24c('0x5e')]===_0xa24c('0x5d')){var _0x5c3285=_0x52a895[_0xa24c('0x32')]({'plain':!![]});var _0x3f306d=_0xa24c('0x33');return db['UserProfileSection'][_0xa24c('0x56')]({'where':{'name':_0x3f306d,'userProfileId':_0xfcc193[_0xa24c('0x5f')]},'raw':!![]})[_0xa24c('0x36')](function(_0x7aab6e){if(_0x7aab6e&&_0x7aab6e[_0xa24c('0x60')]===0x0){return db['UserProfileResource'][_0xa24c('0x5c')]({'name':_0x5c3285[_0xa24c('0x38')],'resourceId':_0x5c3285['id'],'type':_0x7aab6e[_0xa24c('0x38')],'sectionId':_0x7aab6e['id']},{})[_0xa24c('0x36')](function(){return _0x52a895;});}else{return _0x52a895;}})[_0xa24c('0x52')](function(_0x2ca3fa){logger[_0xa24c('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ca3fa);throw _0x2ca3fa;});}return _0x52a895;});}})[_0xa24c('0x36')](respondWithResult(_0xbeab78,0xc9))[_0xa24c('0x52')](handleError(_0xbeab78,null));};exports['create']=function(_0xb1048a,_0x3e455b,_0x14da5e){var _0xb460b4;return db[_0xa24c('0x3b')][_0xa24c('0x5c')](_0xb1048a[_0xa24c('0x61')],{'raw':!![]})[_0xa24c('0x36')](function(_0x38cc30){_0xb460b4=_0x38cc30;return db[_0xa24c('0x3b')]['findAll']({'raw':!![]});})[_0xa24c('0x36')](function(_0x3a4abd){var _0x3b894f=fs['readFileSync'](path[_0xa24c('0x62')](config[_0xa24c('0x63')],_0xa24c('0x64')),'utf8');var _0x3ac3a0=fs[_0xa24c('0x65')](path[_0xa24c('0x62')](config[_0xa24c('0x63')],_0xa24c('0x66')),_0xa24c('0x67'));var _0x4f9b56=ejs['render'](_0x3b894f,{'trunks':_0x3a4abd||[]});fs[_0xa24c('0x68')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4f9b56);if(_0xb460b4[_0xa24c('0x69')]){var _0x1879ae=ejs[_0xa24c('0x6a')](_0x3ac3a0,{'trunks':_0x3a4abd||[]});fs[_0xa24c('0x68')](_0xa24c('0x6b'),_0x1879ae);}})['then'](function(){return respondWithRpcPromise(_0xa24c('0x6c'),_0xa24c('0x5c'),{'module':_0xa24c('0x6d')});})[_0xa24c('0x36')](function(){var _0x987aca=_0xb1048a[_0xa24c('0x5d')]['get']({'plain':!![]});if(!_0x987aca)throw new Error(_0xa24c('0x6e'));if(_0x987aca[_0xa24c('0x5e')]===_0xa24c('0x5d')){var _0x5b9ad7=_0xb460b4['get']({'plain':!![]});return db[_0xa24c('0x6f')]['find']({'where':{'name':_0xa24c('0x33'),'userProfileId':_0x987aca[_0xa24c('0x5f')]},'raw':!![]})[_0xa24c('0x36')](function(_0x180da2){if(_0x180da2&&_0x180da2['autoAssociation']===0x0){return db[_0xa24c('0x34')][_0xa24c('0x5c')]({'name':_0x5b9ad7['name'],'resourceId':_0x5b9ad7['id'],'type':_0x180da2[_0xa24c('0x38')],'sectionId':_0x180da2['id']},{})[_0xa24c('0x36')](function(){return _0xb460b4;});}else{return _0xb460b4;}})[_0xa24c('0x52')](function(_0x3e0c08){logger[_0xa24c('0x23')](_0xa24c('0x70'),_0x3e0c08);throw _0x3e0c08;});}return _0xb460b4;})[_0xa24c('0x36')](respondWithResult(_0x3e455b,0xc9))[_0xa24c('0x52')](handleError(_0x3e455b,null));};exports['update']=function(_0x12508e,_0x3c2726,_0x2cae90){var _0x28c3ff;return db[_0xa24c('0x3b')][_0xa24c('0x56')]({'where':{'id':_0x12508e[_0xa24c('0x53')]['id']}})[_0xa24c('0x36')](handleEntityNotFound(_0x3c2726,null))[_0xa24c('0x36')](saveUpdates(_0x12508e[_0xa24c('0x61')],null))[_0xa24c('0x36')](function(_0x5b0127){if(_0x5b0127){_0x28c3ff=_0x5b0127;return db[_0xa24c('0x3b')][_0xa24c('0x51')]({'raw':!![]});}})['then'](function(_0x141ccf){if(_0x141ccf){var _0x3f212f=fs[_0xa24c('0x65')](path['join'](config['root'],_0xa24c('0x64')),_0xa24c('0x67'));var _0x53928f=fs[_0xa24c('0x65')](path[_0xa24c('0x62')](config[_0xa24c('0x63')],_0xa24c('0x66')),_0xa24c('0x67'));var _0x336898=ejs['render'](_0x3f212f,{'trunks':_0x141ccf||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0x336898);var _0x263dab=ejs['render'](_0x53928f,{'trunks':_0x141ccf||[]});fs['writeFileSync'](_0xa24c('0x6b'),_0x263dab);return respondWithRpcPromise(_0xa24c('0x6c'),_0xa24c('0x31'),{'module':_0xa24c('0x6d')});}return null;})[_0xa24c('0x36')](function(_0x45b2fe){if(_0x45b2fe){return _0x28c3ff;}})[_0xa24c('0x36')](respondWithResult(_0x3c2726,null))[_0xa24c('0x52')](handleError(_0x3c2726,null));};exports[_0xa24c('0x35')]=function(_0x4ee10d,_0x3897ca,_0xa077c8){var _0x16e1db;return db[_0xa24c('0x3b')][_0xa24c('0x56')]({'where':{'id':_0x4ee10d[_0xa24c('0x53')]['id']}})[_0xa24c('0x36')](handleEntityNotFound(_0x3897ca,null))[_0xa24c('0x36')](removeEntity(_0x3897ca,null))[_0xa24c('0x36')](function(){return db[_0xa24c('0x3b')][_0xa24c('0x51')]({'raw':!![]});})[_0xa24c('0x36')](function(_0x4ecbe9){var _0x1fe0f3=fs[_0xa24c('0x65')](path['join'](config[_0xa24c('0x63')],_0xa24c('0x64')),_0xa24c('0x67'));var _0x4af78f=fs[_0xa24c('0x65')](path[_0xa24c('0x62')](config['root'],_0xa24c('0x66')),_0xa24c('0x67'));var _0x4c108f=ejs['render'](_0x1fe0f3,{'trunks':_0x4ecbe9});var _0x124d52=ejs[_0xa24c('0x6a')](_0x4af78f,{'trunks':_0x4ecbe9});fs[_0xa24c('0x68')](_0xa24c('0x71'),_0x4c108f);fs['writeFileSync'](_0xa24c('0x6b'),_0x124d52);return respondWithRpcPromise(_0xa24c('0x6c'),_0xa24c('0x35'),{'module':'chan_sip.so'});})['catch'](handleError(_0x3897ca,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 97b6cf3..0c62133 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 _0x7ebc=['moment','bluebird','request-promise','rimraf','./trunk.attributes','exports','define','lodash','util','../../config/logger','api'];(function(_0x7488c6,_0x1b2889){var _0x50fafa=function(_0x5dbf64){while(--_0x5dbf64){_0x7488c6['push'](_0x7488c6['shift']());}};_0x50fafa(++_0x1b2889);}(_0x7ebc,0x13b));var _0xc7eb=function(_0x5cc8b9,_0x20e3c3){_0x5cc8b9=_0x5cc8b9-0x0;var _0x58892e=_0x7ebc[_0x5cc8b9];return _0x58892e;};'use strict';var _=require(_0xc7eb('0x0'));var util=require(_0xc7eb('0x1'));var logger=require(_0xc7eb('0x2'))(_0xc7eb('0x3'));var moment=require(_0xc7eb('0x4'));var BPromise=require(_0xc7eb('0x5'));var rp=require(_0xc7eb('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc7eb('0x7'));var config=require('../../config/environment');var attributes=require(_0xc7eb('0x8'));module[_0xc7eb('0x9')]=function(_0x35349b,_0x266853){return _0x35349b[_0xc7eb('0xa')]('Trunk',attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x651c=['tools_trunks','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','Trunk'];(function(_0x46bb4f,_0x221da5){var _0x24be0b=function(_0x41b697){while(--_0x41b697){_0x46bb4f['push'](_0x46bb4f['shift']());}};_0x24be0b(++_0x221da5);}(_0x651c,0x1bb));var _0xc651=function(_0x5538d5,_0x190032){_0x5538d5=_0x5538d5-0x0;var _0x323b1a=_0x651c[_0x5538d5];return _0x323b1a;};'use strict';var _=require(_0xc651('0x0'));var util=require(_0xc651('0x1'));var logger=require(_0xc651('0x2'))(_0xc651('0x3'));var moment=require(_0xc651('0x4'));var BPromise=require(_0xc651('0x5'));var rp=require(_0xc651('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc651('0x7'));var config=require(_0xc651('0x8'));var attributes=require('./trunk.attributes');module[_0xc651('0x9')]=function(_0xd53eb2,_0x2deda7){return _0xd53eb2[_0xc651('0xa')](_0xc651('0xb'),attributes,{'tableName':_0xc651('0xc'),'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 8c086fa..c9d5490 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 _0xa65a=['find','ShowTrunk','lodash','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','GetTrunk','Trunk','findAll','options','raw','attributes','include','model','map'];(function(_0x898605,_0x150cd6){var _0x3f394d=function(_0x5c379f){while(--_0x5c379f){_0x898605['push'](_0x898605['shift']());}};_0x3f394d(++_0x150cd6);}(_0xa65a,0x176));var _0xaa65=function(_0x5017cd,_0xa7c658){_0x5017cd=_0x5017cd-0x0;var _0x73f683=_0xa65a[_0x5017cd];return _0x73f683;};'use strict';var _=require(_0xaa65('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xaa65('0x1'));var fs=require('fs');var Redis=require(_0xaa65('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaa65('0x3'))('rpc');var config=require(_0xaa65('0x4'));var jayson=require(_0xaa65('0x5'));var client=jayson[_0xaa65('0x6')][_0xaa65('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x34ee95,_0x49e339,_0x4ec702){return new BPromise(function(_0x22c839,_0x5b01c3){return client[_0xaa65('0x8')](_0x34ee95,_0x4ec702)[_0xaa65('0x9')](function(_0xf090de){logger[_0xaa65('0xa')](_0xaa65('0xb'),_0x49e339,_0xaa65('0xc'));logger[_0xaa65('0xd')]('Trunk,\x20%s,\x20%s,\x20%s',_0x49e339,_0xaa65('0xc'),JSON[_0xaa65('0xe')](_0xf090de));if(_0xf090de['error']){if(_0xf090de['error'][_0xaa65('0xf')]===0x1f4){logger['error'](_0xaa65('0xb'),_0x49e339,_0xf090de[_0xaa65('0x10')][_0xaa65('0x11')]);return _0x5b01c3(_0xf090de['error']['message']);}logger[_0xaa65('0x10')](_0xaa65('0xb'),_0x49e339,_0xf090de[_0xaa65('0x10')][_0xaa65('0x11')]);return _0x22c839(_0xf090de['error'][_0xaa65('0x11')]);}else{logger[_0xaa65('0xa')]('Trunk,\x20%s,\x20%s',_0x49e339,_0xaa65('0xc'));_0x22c839(_0xf090de[_0xaa65('0x12')][_0xaa65('0x11')]);}})[_0xaa65('0x13')](function(_0x13879f){logger['error'](_0xaa65('0xb'),_0x49e339,_0x13879f);_0x5b01c3(_0x13879f);});});}exports[_0xaa65('0x14')]=function(_0x2957d3){var _0x31e75c=this;return new Promise(function(_0x2bce70,_0x2029eb){return db[_0xaa65('0x15')][_0xaa65('0x16')]({'raw':_0x2957d3[_0xaa65('0x17')]?_0x2957d3[_0xaa65('0x17')][_0xaa65('0x18')]===undefined?!![]:![]:!![],'where':_0x2957d3['options']?_0x2957d3[_0xaa65('0x17')]['where']||null:null,'attributes':_0x2957d3[_0xaa65('0x17')]?_0x2957d3[_0xaa65('0x17')][_0xaa65('0x19')]||null:null,'limit':_0x2957d3['options']?_0x2957d3[_0xaa65('0x17')]['limit']||null:null,'include':_0x2957d3['options']?_0x2957d3[_0xaa65('0x17')][_0xaa65('0x1a')]?_['map'](_0x2957d3[_0xaa65('0x17')]['include'],function(_0x5be3f6){return{'model':db[_0x5be3f6[_0xaa65('0x1b')]],'as':_0x5be3f6['as'],'attributes':_0x5be3f6[_0xaa65('0x19')],'include':_0x5be3f6[_0xaa65('0x1a')]?_[_0xaa65('0x1c')](_0x5be3f6[_0xaa65('0x1a')],function(_0x17910d){return{'model':db[_0x17910d['model']],'as':_0x17910d['as'],'attributes':_0x17910d[_0xaa65('0x19')],'include':_0x17910d[_0xaa65('0x1a')]?_['map'](_0x17910d[_0xaa65('0x1a')],function(_0x518733){return{'model':db[_0x518733[_0xaa65('0x1b')]],'as':_0x518733['as'],'attributes':_0x518733['attributes']};}):[]};}):[]};}):[]:[]})[_0xaa65('0x9')](function(_0x200f33){logger[_0xaa65('0xa')]('GetTrunk',_0x2957d3);logger[_0xaa65('0xd')](_0xaa65('0x14'),_0x2957d3,JSON['stringify'](_0x200f33));_0x2bce70(_0x200f33);})[_0xaa65('0x13')](function(_0x35b359){logger[_0xaa65('0x10')](_0xaa65('0x14'),_0x35b359[_0xaa65('0x11')],_0x2957d3);_0x2029eb(_0x31e75c[_0xaa65('0x10')](0x1f4,_0x35b359[_0xaa65('0x11')]));});});};exports['ShowTrunk']=function(_0x5d4090){var _0x381d58=this;return new Promise(function(_0x16955d,_0x32a436){return db['Trunk'][_0xaa65('0x1d')]({'raw':_0x5d4090[_0xaa65('0x17')]?_0x5d4090[_0xaa65('0x17')][_0xaa65('0x18')]===undefined?!![]:![]:!![],'where':_0x5d4090[_0xaa65('0x17')]?_0x5d4090[_0xaa65('0x17')]['where']||null:null,'attributes':_0x5d4090[_0xaa65('0x17')]?_0x5d4090[_0xaa65('0x17')][_0xaa65('0x19')]||null:null,'include':_0x5d4090['options']?_0x5d4090['options'][_0xaa65('0x1a')]?_[_0xaa65('0x1c')](_0x5d4090['options'][_0xaa65('0x1a')],function(_0x286f3f){return{'model':db[_0x286f3f[_0xaa65('0x1b')]],'as':_0x286f3f['as'],'attributes':_0x286f3f[_0xaa65('0x19')],'include':_0x286f3f[_0xaa65('0x1a')]?_[_0xaa65('0x1c')](_0x286f3f[_0xaa65('0x1a')],function(_0x4c968b){return{'model':db[_0x4c968b[_0xaa65('0x1b')]],'as':_0x4c968b['as'],'attributes':_0x4c968b['attributes'],'include':_0x4c968b['include']?_[_0xaa65('0x1c')](_0x4c968b['include'],function(_0x152a6c){return{'model':db[_0x152a6c[_0xaa65('0x1b')]],'as':_0x152a6c['as'],'attributes':_0x152a6c[_0xaa65('0x19')]};}):[]};}):[]};}):[]:[]})[_0xaa65('0x9')](function(_0x3b6967){logger['info'](_0xaa65('0x1e'),_0x5d4090);logger[_0xaa65('0xd')](_0xaa65('0x1e'),_0x5d4090,JSON[_0xaa65('0xe')](_0x3b6967));_0x16955d(_0x3b6967);})[_0xaa65('0x13')](function(_0x590099){logger[_0xaa65('0x10')](_0xaa65('0x1e'),_0x590099[_0xaa65('0x11')],_0x5d4090);_0x32a436(_0x381d58[_0xaa65('0x10')](0x1f4,_0x590099['message']));});});}; \ No newline at end of file +var _0x127c=['ShowTrunk','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','findAll','options','raw','where','attributes','limit','include','map','model','debug','stringify','GetTrunk'];(function(_0x1f7be7,_0x47b92c){var _0x336609=function(_0x32ca2c){while(--_0x32ca2c){_0x1f7be7['push'](_0x1f7be7['shift']());}};_0x336609(++_0x47b92c);}(_0x127c,0x6e));var _0xc127=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x127c[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xc127('0x0'));var util=require(_0xc127('0x1'));var moment=require(_0xc127('0x2'));var BPromise=require(_0xc127('0x3'));var rs=require(_0xc127('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc127('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc127('0x6'))(_0xc127('0x7'));var config=require(_0xc127('0x8'));var jayson=require(_0xc127('0x9'));var client=jayson[_0xc127('0xa')][_0xc127('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a989a,_0x53f9c6,_0x70869){return new BPromise(function(_0x14a7dc,_0x2cff24){return client[_0xc127('0xc')](_0x2a989a,_0x70869)['then'](function(_0x286e9e){logger[_0xc127('0xd')](_0xc127('0xe'),_0x53f9c6,'request\x20sent');logger['debug'](_0xc127('0xf'),_0x53f9c6,_0xc127('0x10'),JSON['stringify'](_0x286e9e));if(_0x286e9e[_0xc127('0x11')]){if(_0x286e9e[_0xc127('0x11')][_0xc127('0x12')]===0x1f4){logger[_0xc127('0x11')]('Trunk,\x20%s,\x20%s',_0x53f9c6,_0x286e9e[_0xc127('0x11')]['message']);return _0x2cff24(_0x286e9e[_0xc127('0x11')]['message']);}logger['error'](_0xc127('0xe'),_0x53f9c6,_0x286e9e[_0xc127('0x11')][_0xc127('0x13')]);return _0x14a7dc(_0x286e9e[_0xc127('0x11')][_0xc127('0x13')]);}else{logger['info'](_0xc127('0xe'),_0x53f9c6,'request\x20sent');_0x14a7dc(_0x286e9e[_0xc127('0x14')][_0xc127('0x13')]);}})[_0xc127('0x15')](function(_0x415198){logger['error'](_0xc127('0xe'),_0x53f9c6,_0x415198);_0x2cff24(_0x415198);});});}exports['GetTrunk']=function(_0x504720){var _0x59df4d=this;return new Promise(function(_0x2e8711,_0x2d033c){return db['Trunk'][_0xc127('0x16')]({'raw':_0x504720[_0xc127('0x17')]?_0x504720['options'][_0xc127('0x18')]===undefined?!![]:![]:!![],'where':_0x504720[_0xc127('0x17')]?_0x504720[_0xc127('0x17')][_0xc127('0x19')]||null:null,'attributes':_0x504720['options']?_0x504720[_0xc127('0x17')][_0xc127('0x1a')]||null:null,'limit':_0x504720[_0xc127('0x17')]?_0x504720[_0xc127('0x17')][_0xc127('0x1b')]||null:null,'include':_0x504720[_0xc127('0x17')]?_0x504720['options'][_0xc127('0x1c')]?_[_0xc127('0x1d')](_0x504720[_0xc127('0x17')][_0xc127('0x1c')],function(_0x1bb19f){return{'model':db[_0x1bb19f[_0xc127('0x1e')]],'as':_0x1bb19f['as'],'attributes':_0x1bb19f[_0xc127('0x1a')],'include':_0x1bb19f[_0xc127('0x1c')]?_['map'](_0x1bb19f[_0xc127('0x1c')],function(_0x197793){return{'model':db[_0x197793['model']],'as':_0x197793['as'],'attributes':_0x197793['attributes'],'include':_0x197793[_0xc127('0x1c')]?_[_0xc127('0x1d')](_0x197793[_0xc127('0x1c')],function(_0x37f726){return{'model':db[_0x37f726['model']],'as':_0x37f726['as'],'attributes':_0x37f726[_0xc127('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2c7bb9){logger[_0xc127('0xd')]('GetTrunk',_0x504720);logger[_0xc127('0x1f')]('GetTrunk',_0x504720,JSON[_0xc127('0x20')](_0x2c7bb9));_0x2e8711(_0x2c7bb9);})[_0xc127('0x15')](function(_0x1e1e17){logger[_0xc127('0x11')](_0xc127('0x21'),_0x1e1e17['message'],_0x504720);_0x2d033c(_0x59df4d[_0xc127('0x11')](0x1f4,_0x1e1e17[_0xc127('0x13')]));});});};exports[_0xc127('0x22')]=function(_0x4304f6){var _0x572afc=this;return new Promise(function(_0x3e1773,_0xd22a27){return db['Trunk'][_0xc127('0x23')]({'raw':_0x4304f6[_0xc127('0x17')]?_0x4304f6[_0xc127('0x17')][_0xc127('0x18')]===undefined?!![]:![]:!![],'where':_0x4304f6[_0xc127('0x17')]?_0x4304f6[_0xc127('0x17')][_0xc127('0x19')]||null:null,'attributes':_0x4304f6[_0xc127('0x17')]?_0x4304f6[_0xc127('0x17')]['attributes']||null:null,'include':_0x4304f6[_0xc127('0x17')]?_0x4304f6[_0xc127('0x17')][_0xc127('0x1c')]?_[_0xc127('0x1d')](_0x4304f6[_0xc127('0x17')][_0xc127('0x1c')],function(_0x318a49){return{'model':db[_0x318a49['model']],'as':_0x318a49['as'],'attributes':_0x318a49[_0xc127('0x1a')],'include':_0x318a49['include']?_[_0xc127('0x1d')](_0x318a49[_0xc127('0x1c')],function(_0x23cb4c){return{'model':db[_0x23cb4c[_0xc127('0x1e')]],'as':_0x23cb4c['as'],'attributes':_0x23cb4c['attributes'],'include':_0x23cb4c[_0xc127('0x1c')]?_[_0xc127('0x1d')](_0x23cb4c[_0xc127('0x1c')],function(_0x3a1ccc){return{'model':db[_0x3a1ccc['model']],'as':_0x3a1ccc['as'],'attributes':_0x3a1ccc[_0xc127('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2affbb){logger[_0xc127('0xd')](_0xc127('0x22'),_0x4304f6);logger['debug'](_0xc127('0x22'),_0x4304f6,JSON[_0xc127('0x20')](_0x2affbb));_0x3e1773(_0x2affbb);})['catch'](function(_0x5c7d50){logger[_0xc127('0x11')](_0xc127('0x22'),_0x5c7d50[_0xc127('0x13')],_0x4304f6);_0xd22a27(_0x572afc[_0xc127('0x11')](0x1f4,_0x5c7d50[_0xc127('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 57bcc65..d8a77a4 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 _0xac2c=['Router','./user-setting.controller','put','/:id','isAuthenticated','update','express'];(function(_0x5ef582,_0x4d6bdd){var _0x40377e=function(_0x1d2b15){while(--_0x1d2b15){_0x5ef582['push'](_0x5ef582['shift']());}};_0x40377e(++_0x4d6bdd);}(_0xac2c,0x1bf));var _0xcac2=function(_0x51ab33,_0x71a8a8){_0x51ab33=_0x51ab33-0x0;var _0x5e1298=_0xac2c[_0x51ab33];return _0x5e1298;};'use strict';var express=require(_0xcac2('0x0'));var router=express[_0xcac2('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xcac2('0x2'));router[_0xcac2('0x3')](_0xcac2('0x4'),auth[_0xcac2('0x5')](),controller[_0xcac2('0x6')]);module['exports']=router; \ No newline at end of file +var _0x6b67=['./user-setting.controller','put','/:id','isAuthenticated','update','exports','Router'];(function(_0x39e164,_0x2cb93b){var _0x13fa6b=function(_0x511cb2){while(--_0x511cb2){_0x39e164['push'](_0x39e164['shift']());}};_0x13fa6b(++_0x2cb93b);}(_0x6b67,0xf4));var _0x76b6=function(_0x14eb15,_0x5df0a8){_0x14eb15=_0x14eb15-0x0;var _0x460dab=_0x6b67[_0x14eb15];return _0x460dab;};'use strict';var express=require('express');var router=express[_0x76b6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x76b6('0x1'));router[_0x76b6('0x2')](_0x76b6('0x3'),auth[_0x76b6('0x4')](),controller[_0x76b6('0x5')]);module[_0x76b6('0x6')]=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 620a1c0..395e1d6 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 _0x22de=['sequelize','info','debug','exports','ENUM','error','BOOLEAN','TEXT','DATE','INTEGER','UserId'];(function(_0xc67528,_0x24e2fb){var _0x38e26d=function(_0x1b0efe){while(--_0x1b0efe){_0xc67528['push'](_0xc67528['shift']());}};_0x38e26d(++_0x24e2fb);}(_0x22de,0x129));var _0xe22d=function(_0x44a0fe,_0x499b6b){_0x44a0fe=_0x44a0fe-0x0;var _0x5d367d=_0x22de[_0x44a0fe];return _0x5d367d;};'use strict';var Sequelize=require(_0xe22d('0x0'));const CLIENT_SIDE_LOG_LEVELS=['error','warning',_0xe22d('0x1'),_0xe22d('0x2')];module[_0xe22d('0x3')]={'clientSideLoggingLevel':{'type':Sequelize[_0xe22d('0x4')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xe22d('0x5'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xe22d('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xe22d('0x7')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xe22d('0x8')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xe22d('0x9')],'unique':_0xe22d('0xa')}}; \ No newline at end of file +var _0x37e5=['UserId','sequelize','debug','ENUM','TEXT','DATE'];(function(_0x15a88d,_0x4692d9){var _0x1c6e58=function(_0x3915ce){while(--_0x3915ce){_0x15a88d['push'](_0x15a88d['shift']());}};_0x1c6e58(++_0x4692d9);}(_0x37e5,0x11b));var _0x537e=function(_0x3fb030,_0x12aebe){_0x3fb030=_0x3fb030-0x0;var _0xd6899b=_0x37e5[_0x3fb030];return _0xd6899b;};'use strict';var Sequelize=require(_0x537e('0x0'));const CLIENT_SIDE_LOG_LEVELS=['error','warning','info',_0x537e('0x1')];module['exports']={'clientSideLoggingLevel':{'type':Sequelize[_0x537e('0x2')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':'error','validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x537e('0x3')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x537e('0x4')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize['INTEGER'],'unique':_0x537e('0x5')}}; \ 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 9712aa9..28a77f4 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 _0xa3e6=['localhost','status','error','stack','name','send','update','user','role','Unauthorized','params','Invalid\x20user\x20setting\x20id','UserSetting','then','lodash','../../config/logger','../../config/environment','../../mysqldb','socket.io-emitter','./user-setting.socket','redis','defaults'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa3e6,0xbe));var _0x6a3e=function(_0x4c9b4c,_0x5efd04){_0x4c9b4c=_0x4c9b4c-0x0;var _0x388623=_0xa3e6[_0x4c9b4c];return _0x388623;};'use strict';var _=require(_0x6a3e('0x0'));var Redis=require('ioredis');var logger=require(_0x6a3e('0x1'))('api');var config=require(_0x6a3e('0x2'));var db=require(_0x6a3e('0x3'))['db'];var socket=require(_0x6a3e('0x4'))(new Redis(config['redis']));require(_0x6a3e('0x5'))['register'](socket);config[_0x6a3e('0x6')]=_[_0x6a3e('0x7')](config[_0x6a3e('0x6')],{'host':_0x6a3e('0x8'),'port':0x18eb});function respondWithResult(_0x19dd88,_0x52a2f8){_0x52a2f8=_0x52a2f8||0xc8;return function(_0x3d7fbe){if(_0x3d7fbe){return _0x19dd88[_0x6a3e('0x9')](_0x52a2f8)['json'](_0x3d7fbe);}};}function saveUpdates(_0x4891ba){return function(_0x2d2477){if(_0x2d2477){return _0x2d2477['update'](_0x4891ba)['then'](function(_0xef2185){return _0xef2185;});}return null;};}function handleEntityNotFound(_0x4f5a4a){return function(_0x39f8ca){if(!_0x39f8ca){_0x4f5a4a['sendStatus'](0x194);}return _0x39f8ca;};}function handleError(_0xd21a09,_0x3159db){_0x3159db=_0x3159db||0x1f4;return function(_0x14fc9e){logger[_0x6a3e('0xa')](_0x14fc9e[_0x6a3e('0xb')]);if(_0x14fc9e[_0x6a3e('0xc')]){delete _0x14fc9e['name'];}_0xd21a09[_0x6a3e('0x9')](_0x3159db)[_0x6a3e('0xd')](_0x14fc9e);};}exports[_0x6a3e('0xe')]=function(_0x336c5d,_0x1364be){if(_0x336c5d[_0x6a3e('0xf')][_0x6a3e('0x10')]!=='admin')throw new Error(_0x6a3e('0x11'));if(isNaN(Number(_0x336c5d[_0x6a3e('0x12')]['id'])))throw new Error(_0x6a3e('0x13'));return db[_0x6a3e('0x14')]['find']({'where':{'id':_0x336c5d[_0x6a3e('0x12')]['id']}})[_0x6a3e('0x15')](handleEntityNotFound(_0x1364be,null))['then'](saveUpdates(_0x336c5d['body'],null))['then'](respondWithResult(_0x1364be,null))['catch'](handleError(_0x1364be,null));}; \ No newline at end of file +var _0x684d=['Invalid\x20user\x20setting\x20id','find','body','catch','ioredis','../../config/logger','api','../../mysqldb','redis','./user-setting.socket','register','defaults','localhost','status','update','then','name','send','user','role','admin','Unauthorized','params'];(function(_0x22c74a,_0x5c651c){var _0x531b56=function(_0x248d2d){while(--_0x248d2d){_0x22c74a['push'](_0x22c74a['shift']());}};_0x531b56(++_0x5c651c);}(_0x684d,0x174));var _0xd684=function(_0x368092,_0x1afdac){_0x368092=_0x368092-0x0;var _0x5aaeed=_0x684d[_0x368092];return _0x5aaeed;};'use strict';var _=require('lodash');var Redis=require(_0xd684('0x0'));var logger=require(_0xd684('0x1'))(_0xd684('0x2'));var config=require('../../config/environment');var db=require(_0xd684('0x3'))['db'];var socket=require('socket.io-emitter')(new Redis(config[_0xd684('0x4')]));require(_0xd684('0x5'))[_0xd684('0x6')](socket);config['redis']=_[_0xd684('0x7')](config['redis'],{'host':_0xd684('0x8'),'port':0x18eb});function respondWithResult(_0x51350a,_0x157c6d){_0x157c6d=_0x157c6d||0xc8;return function(_0x422bd2){if(_0x422bd2){return _0x51350a[_0xd684('0x9')](_0x157c6d)['json'](_0x422bd2);}};}function saveUpdates(_0x323e1a){return function(_0x53beaf){if(_0x53beaf){return _0x53beaf[_0xd684('0xa')](_0x323e1a)[_0xd684('0xb')](function(_0x253ed1){return _0x253ed1;});}return null;};}function handleEntityNotFound(_0x2e5609){return function(_0x217e44){if(!_0x217e44){_0x2e5609['sendStatus'](0x194);}return _0x217e44;};}function handleError(_0x4c118f,_0x37b5d3){_0x37b5d3=_0x37b5d3||0x1f4;return function(_0x1cc228){logger['error'](_0x1cc228['stack']);if(_0x1cc228[_0xd684('0xc')]){delete _0x1cc228[_0xd684('0xc')];}_0x4c118f['status'](_0x37b5d3)[_0xd684('0xd')](_0x1cc228);};}exports[_0xd684('0xa')]=function(_0x235270,_0x33b105){if(_0x235270[_0xd684('0xe')][_0xd684('0xf')]!==_0xd684('0x10'))throw new Error(_0xd684('0x11'));if(isNaN(Number(_0x235270[_0xd684('0x12')]['id'])))throw new Error(_0xd684('0x13'));return db['UserSetting'][_0xd684('0x14')]({'where':{'id':_0x235270['params']['id']}})[_0xd684('0xb')](handleEntityNotFound(_0x33b105,null))['then'](saveUpdates(_0x235270[_0xd684('0x15')],null))[_0xd684('0xb')](respondWithResult(_0x33b105,null))[_0xd684('0x16')](handleError(_0x33b105,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 cde2c50..5afda5c 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 _0xe239=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserSetting','setMaxListeners','save','update'];(function(_0x1c4305,_0x5859e9){var _0x4d5f11=function(_0x15c88e){while(--_0x15c88e){_0x1c4305['push'](_0x1c4305['shift']());}};_0x4d5f11(++_0x5859e9);}(_0xe239,0xb5));var _0x9e23=function(_0x293e3f,_0x360146){_0x293e3f=_0x293e3f-0x0;var _0x430645=_0xe239[_0x293e3f];return _0x430645;};'use strict';var EventEmitter=require(_0x9e23('0x0'));var UserSetting=require(_0x9e23('0x1'))['db'][_0x9e23('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x9e23('0x3')](0x0);var events={'afterCreate':_0x9e23('0x4'),'afterUpdate':_0x9e23('0x5'),'afterDestroy':_0x9e23('0x6')};function emitEvent(_0x350454){return function(_0x4d0372,_0x5208ac,_0x35628e){UserSettingEvents['emit'](_0x350454+':'+_0x4d0372['id'],_0x4d0372);UserSettingEvents[_0x9e23('0x7')](_0x350454,_0x4d0372);_0x35628e(null);};}for(var e in events){if(events[_0x9e23('0x8')](e)){var event=events[e];UserSetting[_0x9e23('0x9')](e,emitEvent(event));}}module[_0x9e23('0xa')]=UserSettingEvents; \ No newline at end of file +var _0xa3fa=['emit','hasOwnProperty','exports','../../mysqldb','UserSetting','remove'];(function(_0x455150,_0x274121){var _0x12ca9c=function(_0x47eb22){while(--_0x47eb22){_0x455150['push'](_0x455150['shift']());}};_0x12ca9c(++_0x274121);}(_0xa3fa,0x69));var _0xaa3f=function(_0x147268,_0x431953){_0x147268=_0x147268-0x0;var _0x202d86=_0xa3fa[_0x147268];return _0x202d86;};'use strict';var EventEmitter=require('events');var UserSetting=require(_0xaa3f('0x0'))['db'][_0xaa3f('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xaa3f('0x2')};function emitEvent(_0x3dbff9){return function(_0x36612a,_0x521656,_0x10cef4){UserSettingEvents[_0xaa3f('0x3')](_0x3dbff9+':'+_0x36612a['id'],_0x36612a);UserSettingEvents[_0xaa3f('0x3')](_0x3dbff9,_0x36612a);_0x10cef4(null);};}for(var e in events){if(events[_0xaa3f('0x4')](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module[_0xaa3f('0x5')]=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 59dc936..8f0756c 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 _0x20df=['define','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','exports'];(function(_0x3fc1db,_0x3a7f71){var _0x11ad86=function(_0xc6136d){while(--_0xc6136d){_0x3fc1db['push'](_0x3fc1db['shift']());}};_0x11ad86(++_0x3a7f71);}(_0x20df,0x7c));var _0xf20d=function(_0x4653f7,_0x3d3ae3){_0x4653f7=_0x4653f7-0x0;var _0x5454da=_0x20df[_0x4653f7];return _0x5454da;};'use strict';var attributes=require(_0xf20d('0x0'));module[_0xf20d('0x1')]=function(_0x44f997){return _0x44f997[_0xf20d('0x2')]('UserSetting',attributes,{'tableName':_0xf20d('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xd2e60b){if(!_0xd2e60b[_0xf20d('0x4')])_0xd2e60b[_0xf20d('0x5')]=null;else if(_0xd2e60b[_0xf20d('0x5')]===null)_0xd2e60b['clientSideLoggingEnabledSince']=new Date();}}});}; \ No newline at end of file +var _0x4dd2=['clientSideLoggingEnabledSince','exports','define','user_settings','clientSideLoggingEnabled'];(function(_0x613b83,_0x54d9e8){var _0x595586=function(_0x13f7d0){while(--_0x13f7d0){_0x613b83['push'](_0x613b83['shift']());}};_0x595586(++_0x54d9e8);}(_0x4dd2,0xf1));var _0x24dd=function(_0x2c2390,_0x37ef1c){_0x2c2390=_0x2c2390-0x0;var _0x478b7e=_0x4dd2[_0x2c2390];return _0x478b7e;};'use strict';var attributes=require('./user-setting.attributes');module[_0x24dd('0x0')]=function(_0x2ee27b){return _0x2ee27b[_0x24dd('0x1')]('UserSetting',attributes,{'tableName':_0x24dd('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5c459c){if(!_0x5c459c[_0x24dd('0x3')])_0x5c459c['clientSideLoggingEnabledSince']=null;else if(_0x5c459c[_0x24dd('0x4')]===null)_0x5c459c[_0x24dd('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 7d99299..417fdda 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 _0xbafa=['remove','update','emit','user-setting:update:user-','UserId','register','length','user-setting:','./user-setting.events'];(function(_0x3b135b,_0xb18610){var _0x2eb1be=function(_0xb5549b){while(--_0xb5549b){_0x3b135b['push'](_0x3b135b['shift']());}};_0x2eb1be(++_0xb18610);}(_0xbafa,0x131));var _0xabaf=function(_0x21a139,_0x293c79){_0x21a139=_0x21a139-0x0;var _0x59e57e=_0xbafa[_0x21a139];return _0x59e57e;};'use strict';var UserSettingEvents=require(_0xabaf('0x0'));var events=['save',_0xabaf('0x1'),_0xabaf('0x2')];function createListener(_0x404696,_0x5e23c1){return function(_0x3a12a2){_0x5e23c1[_0xabaf('0x3')](_0x404696,_0x3a12a2);if(_0x404696==='user-setting:update'){_0x5e23c1[_0xabaf('0x3')](_0xabaf('0x4')+_0x3a12a2[_0xabaf('0x5')],_0x3a12a2);}};}exports[_0xabaf('0x6')]=function(_0xa07303){for(var _0x448bbf=0x0,_0x3b7ca3=events[_0xabaf('0x7')];_0x448bbf<_0x3b7ca3;_0x448bbf++){var _0x153a58=events[_0x448bbf];var _0x1c55a8=createListener(_0xabaf('0x8')+_0x153a58,_0xa07303);UserSettingEvents['on'](_0x153a58,_0x1c55a8);}}; \ No newline at end of file +var _0x7e9e=['user-setting:update','register','./user-setting.events','save','remove','update','emit'];(function(_0x16f124,_0x49a016){var _0x38cb04=function(_0x126397){while(--_0x126397){_0x16f124['push'](_0x16f124['shift']());}};_0x38cb04(++_0x49a016);}(_0x7e9e,0x159));var _0xe7e9=function(_0x53e3fa,_0x50c5f2){_0x53e3fa=_0x53e3fa-0x0;var _0xe8584a=_0x7e9e[_0x53e3fa];return _0xe8584a;};'use strict';var UserSettingEvents=require(_0xe7e9('0x0'));var events=[_0xe7e9('0x1'),_0xe7e9('0x2'),_0xe7e9('0x3')];function createListener(_0x152d33,_0x5b9836){return function(_0x526278){_0x5b9836[_0xe7e9('0x4')](_0x152d33,_0x526278);if(_0x152d33===_0xe7e9('0x5')){_0x5b9836[_0xe7e9('0x4')]('user-setting:update:user-'+_0x526278['UserId'],_0x526278);}};}exports[_0xe7e9('0x6')]=function(_0x50d12f){for(var _0x990b00=0x0,_0x29d606=events['length'];_0x990b00<_0x29d606;_0x990b00++){var _0x3b0f33=events[_0x990b00];var _0x417b09=createListener('user-setting:'+_0x3b0f33,_0x50d12f);UserSettingEvents['on'](_0x3b0f33,_0x417b09);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index c01a9ed..6b34a14 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 _0xa97a=['getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','getOpenchannelInteractions','/:id/mail/interactions','/:id/sms/interactions','/:id/fax/interactions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/lists','getLists','/:id/agents','getAgents','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','addContacts','post','create','bulkCreate','addQueues','diskStorage','join','root','format','%s-%s','now','originalname','/:id/avatar','single','file','addAvatar','login','/:id/pause','unpause','/:id/teams','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','/:id/whatsapp_accounts','addWhatsappAccounts','addSquareProjects','createApiKey','update','changePassword','delete','removeQueues','removeTeams','/:id/chat_interactions','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','/:id/whatsapp_interactions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeApiKey','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','/describe','describe','whoami','/presence','getPresence','/:id'];(function(_0x33a7b9,_0x21efd5){var _0x177aea=function(_0x3c0c8f){while(--_0x3c0c8f){_0x33a7b9['push'](_0x33a7b9['shift']());}};_0x177aea(++_0x21efd5);}(_0xa97a,0x1af));var _0xaa97=function(_0x2126c7,_0x5cd37f){_0x2126c7=_0x2126c7-0x0;var _0x2d91f4=_0xa97a[_0x2126c7];return _0x2d91f4;};'use strict';var multer=require(_0xaa97('0x0'));var util=require(_0xaa97('0x1'));var path=require(_0xaa97('0x2'));var timeout=require(_0xaa97('0x3'));var express=require('express');var router=express[_0xaa97('0x4')]();var fs_extra=require(_0xaa97('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xaa97('0x6'));var config=require(_0xaa97('0x7'));var controller=require(_0xaa97('0x8'));router[_0xaa97('0x9')]('/',auth[_0xaa97('0xa')](),controller['index']);router[_0xaa97('0x9')](_0xaa97('0xb'),auth[_0xaa97('0xa')](),controller[_0xaa97('0xc')]);router[_0xaa97('0x9')]('/whoami',auth[_0xaa97('0xa')](),controller[_0xaa97('0xd')]);router[_0xaa97('0x9')](_0xaa97('0xe'),auth[_0xaa97('0xa')](),controller[_0xaa97('0xf')]);router['get'](_0xaa97('0x10'),auth[_0xaa97('0xa')](),controller['show']);router[_0xaa97('0x9')]('/:id/avatar',controller['getAvatar']);router[_0xaa97('0x9')]('/:id/open_tabs',auth['isAuthenticated'](),controller[_0xaa97('0x11')]);router[_0xaa97('0x9')](_0xaa97('0x12'),auth[_0xaa97('0xa')](),controller[_0xaa97('0x13')]);router[_0xaa97('0x9')](_0xaa97('0x14'),auth[_0xaa97('0xa')](),controller[_0xaa97('0x15')]);router['get'](_0xaa97('0x16'),auth[_0xaa97('0xa')](),controller[_0xaa97('0x17')]);router[_0xaa97('0x9')](_0xaa97('0x18'),auth[_0xaa97('0xa')](),controller[_0xaa97('0x19')]);router['get']('/:id/recordings',auth[_0xaa97('0xa')](),controller[_0xaa97('0x1a')]);router[_0xaa97('0x9')](_0xaa97('0x1b'),auth['isAuthenticated'](),controller[_0xaa97('0x1c')]);router[_0xaa97('0x9')](_0xaa97('0x1d'),auth[_0xaa97('0xa')](),controller[_0xaa97('0x1e')]);router[_0xaa97('0x9')]('/:id/openchannel/interactions',auth[_0xaa97('0xa')](),controller[_0xaa97('0x1f')]);router[_0xaa97('0x9')](_0xaa97('0x20'),auth[_0xaa97('0xa')](),controller['getMailInteractions']);router[_0xaa97('0x9')](_0xaa97('0x21'),auth[_0xaa97('0xa')](),controller['getSmsInteractions']);router[_0xaa97('0x9')](_0xaa97('0x22'),auth[_0xaa97('0xa')](),controller['getFaxInteractions']);router[_0xaa97('0x9')](_0xaa97('0x23'),auth['isAuthenticated'](),controller[_0xaa97('0x24')]);router[_0xaa97('0x9')]('/:id/teams',auth['isAuthenticated'](),controller['getTeams']);router['get'](_0xaa97('0x25'),auth[_0xaa97('0xa')](),controller[_0xaa97('0x26')]);router[_0xaa97('0x9')](_0xaa97('0x27'),auth[_0xaa97('0xa')](),controller[_0xaa97('0x28')]);router[_0xaa97('0x9')]('/:id/prefixes',auth[_0xaa97('0xa')](),controller['getVoicePrefixes']);router[_0xaa97('0x9')](_0xaa97('0x29'),auth[_0xaa97('0xa')](),controller[_0xaa97('0x2a')]);router['get'](_0xaa97('0x2b'),auth[_0xaa97('0xa')](),controller[_0xaa97('0x2c')]);router[_0xaa97('0x9')](_0xaa97('0x2d'),auth['isAuthenticated'](),controller[_0xaa97('0x2e')]);router[_0xaa97('0x9')](_0xaa97('0x2f'),auth[_0xaa97('0xa')](),controller[_0xaa97('0x30')]);router['get'](_0xaa97('0x31'),auth['isAuthenticated'](),controller[_0xaa97('0x32')]);router[_0xaa97('0x9')]('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller['getWhatsappAccounts']);router['get'](_0xaa97('0x33'),auth[_0xaa97('0xa')](),controller[_0xaa97('0x34')]);router['get'](_0xaa97('0x35'),auth[_0xaa97('0xa')](),controller[_0xaa97('0x36')]);router[_0xaa97('0x9')](_0xaa97('0x37'),auth[_0xaa97('0xa')](),controller['getApiKey']);router['post']('/:id/contacts',auth['isAuthenticated'](),controller[_0xaa97('0x38')]);router[_0xaa97('0x39')]('/',auth['isAuthenticated'](),controller[_0xaa97('0x3a')]);router[_0xaa97('0x39')]('/create_many',auth[_0xaa97('0xa')](),controller[_0xaa97('0x3b')]);router[_0xaa97('0x39')](_0xaa97('0x14'),auth['isAuthenticated'](),controller[_0xaa97('0x3c')]);var upload=multer({'storage':multer[_0xaa97('0x3d')]({'destination':function(_0xf5fcbf,_0x4f31de,_0x311ec2){_0x311ec2(null,path[_0xaa97('0x3e')](config[_0xaa97('0x3f')],'server/files/images/'));},'filename':function(_0x4f06e7,_0x16eda4,_0x287965){_0x287965(null,util[_0xaa97('0x40')](_0xaa97('0x41'),Date[_0xaa97('0x42')](),_0x16eda4[_0xaa97('0x43')]));}})});router[_0xaa97('0x39')](_0xaa97('0x44'),upload[_0xaa97('0x45')](_0xaa97('0x46')),controller[_0xaa97('0x47')]);router[_0xaa97('0x39')]('/:id/login',auth[_0xaa97('0xa')](),controller[_0xaa97('0x48')]);router['post']('/:id/logout',auth[_0xaa97('0xa')](),controller['logout']);router['post'](_0xaa97('0x49'),auth[_0xaa97('0xa')](),controller['pause']);router[_0xaa97('0x39')]('/:id/unpause',auth['isAuthenticated'](),controller[_0xaa97('0x4a')]);router[_0xaa97('0x39')](_0xaa97('0x4b'),auth[_0xaa97('0xa')](),controller['addTeams']);router['post']('/:id/chat_interactions',auth[_0xaa97('0xa')](),controller['addChatInteractions']);router[_0xaa97('0x39')](_0xaa97('0x4c'),auth[_0xaa97('0xa')](),controller[_0xaa97('0x4d')]);router[_0xaa97('0x39')](_0xaa97('0x4e'),auth[_0xaa97('0xa')](),controller[_0xaa97('0x4f')]);router[_0xaa97('0x39')](_0xaa97('0x50'),auth[_0xaa97('0xa')](),controller[_0xaa97('0x51')]);router[_0xaa97('0x39')](_0xaa97('0x52'),auth[_0xaa97('0xa')](),controller[_0xaa97('0x53')]);router['post']('/:id/whatsapp_interactions',auth[_0xaa97('0xa')](),controller['addWhatsappInteractions']);router['post'](_0xaa97('0x29'),auth[_0xaa97('0xa')](),controller[_0xaa97('0x54')]);router[_0xaa97('0x39')](_0xaa97('0x2b'),auth['isAuthenticated'](),controller[_0xaa97('0x55')]);router[_0xaa97('0x39')](_0xaa97('0x2d'),auth[_0xaa97('0xa')](),controller[_0xaa97('0x56')]);router[_0xaa97('0x39')](_0xaa97('0x2f'),auth[_0xaa97('0xa')](),controller[_0xaa97('0x57')]);router[_0xaa97('0x39')](_0xaa97('0x31'),auth[_0xaa97('0xa')](),controller[_0xaa97('0x58')]);router[_0xaa97('0x39')](_0xaa97('0x59'),auth[_0xaa97('0xa')](),controller[_0xaa97('0x5a')]);router[_0xaa97('0x39')]('/:id/square_projects',auth['isAuthenticated'](),controller[_0xaa97('0x5b')]);router[_0xaa97('0x39')]('/:id/api_key',auth[_0xaa97('0xa')](),controller[_0xaa97('0x5c')]);router['put'](_0xaa97('0x10'),auth['isAuthenticated'](),controller[_0xaa97('0x5d')]);router['put']('/:id/password',auth['isAuthenticated'](),controller[_0xaa97('0x5e')]);router[_0xaa97('0x5f')](_0xaa97('0x14'),auth[_0xaa97('0xa')](),controller[_0xaa97('0x60')]);router[_0xaa97('0x5f')](_0xaa97('0x4b'),auth[_0xaa97('0xa')](),controller[_0xaa97('0x61')]);router[_0xaa97('0x5f')](_0xaa97('0x10'),auth[_0xaa97('0xa')](),controller['destroy']);router[_0xaa97('0x5f')](_0xaa97('0x62'),auth[_0xaa97('0xa')](),controller[_0xaa97('0x63')]);router[_0xaa97('0x5f')](_0xaa97('0x4c'),auth[_0xaa97('0xa')](),controller[_0xaa97('0x64')]);router['delete'](_0xaa97('0x4e'),auth['isAuthenticated'](),controller[_0xaa97('0x65')]);router[_0xaa97('0x5f')](_0xaa97('0x50'),auth[_0xaa97('0xa')](),controller[_0xaa97('0x66')]);router[_0xaa97('0x5f')](_0xaa97('0x52'),auth[_0xaa97('0xa')](),controller[_0xaa97('0x67')]);router[_0xaa97('0x5f')](_0xaa97('0x68'),auth[_0xaa97('0xa')](),controller[_0xaa97('0x69')]);router[_0xaa97('0x5f')](_0xaa97('0x29'),auth[_0xaa97('0xa')](),controller[_0xaa97('0x6a')]);router['delete'](_0xaa97('0x2b'),auth[_0xaa97('0xa')](),controller[_0xaa97('0x6b')]);router[_0xaa97('0x5f')]('/:id/openchannel_accounts',auth[_0xaa97('0xa')](),controller[_0xaa97('0x6c')]);router['delete'](_0xaa97('0x2f'),auth[_0xaa97('0xa')](),controller[_0xaa97('0x6d')]);router[_0xaa97('0x5f')](_0xaa97('0x31'),auth[_0xaa97('0xa')](),controller[_0xaa97('0x6e')]);router['delete'](_0xaa97('0x59'),auth[_0xaa97('0xa')](),controller['removeWhatsappAccounts']);router['delete'](_0xaa97('0x33'),auth[_0xaa97('0xa')](),controller['removeSquareProjects']);router['delete'](_0xaa97('0x37'),auth['isAuthenticated'](),controller[_0xaa97('0x6f')]);module['exports']=router; \ No newline at end of file +var _0x21f0=['post','addContacts','create','/create_many','bulkCreate','addQueues','diskStorage','join','root','server/files/images/','format','%s-%s','now','originalname','addAvatar','/:id/logout','logout','/:id/pause','pause','unpause','/:id/teams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','addFaxInteractions','addSmsInteractions','/:id/openchannel_interactions','/:id/whatsapp_interactions','addWhatsappInteractions','/:id/mail_accounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','addSquareProjects','createApiKey','put','update','/:id/password','changePassword','delete','removeTeams','destroy','removeChatInteractions','removeMailInteractions','/:id/fax_interactions','removeFaxInteractions','/:id/sms_interactions','removeSmsInteractions','removeWhatsappInteractions','removeFaxAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeWhatsappAccounts','removeSquareProjects','removeApiKey','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./user.controller','get','isAuthenticated','/describe','describe','/whoami','/presence','/:id','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','getRecordings','/:id/screen_recordings','getScreenRecordings','getChatInteractions','/:id/openchannel/interactions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','getTeams','/:id/lists','/:id/agents','getAgents','getVoicePrefixes','/:id/fax_accounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x21f0,0x197));var _0x021f=function(_0x294f1b,_0x3542fc){_0x294f1b=_0x294f1b-0x0;var _0x12a3e1=_0x21f0[_0x294f1b];return _0x12a3e1;};'use strict';var multer=require('multer');var util=require(_0x021f('0x0'));var path=require(_0x021f('0x1'));var timeout=require('connect-timeout');var express=require(_0x021f('0x2'));var router=express['Router']();var fs_extra=require(_0x021f('0x3'));var auth=require(_0x021f('0x4'));var interaction=require(_0x021f('0x5'));var config=require('../../config/environment');var controller=require(_0x021f('0x6'));router[_0x021f('0x7')]('/',auth[_0x021f('0x8')](),controller['index']);router[_0x021f('0x7')](_0x021f('0x9'),auth['isAuthenticated'](),controller[_0x021f('0xa')]);router[_0x021f('0x7')](_0x021f('0xb'),auth[_0x021f('0x8')](),controller['whoami']);router[_0x021f('0x7')](_0x021f('0xc'),auth[_0x021f('0x8')](),controller['getPresence']);router['get'](_0x021f('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x021f('0x7')](_0x021f('0xe'),controller[_0x021f('0xf')]);router[_0x021f('0x7')](_0x021f('0x10'),auth[_0x021f('0x8')](),controller[_0x021f('0x11')]);router['get'](_0x021f('0x12'),auth[_0x021f('0x8')](),controller['getContacts']);router[_0x021f('0x7')](_0x021f('0x13'),auth[_0x021f('0x8')](),controller[_0x021f('0x14')]);router[_0x021f('0x7')](_0x021f('0x15'),auth[_0x021f('0x8')](),controller[_0x021f('0x16')]);router['get'](_0x021f('0x17'),auth[_0x021f('0x8')](),controller[_0x021f('0x18')]);router[_0x021f('0x7')]('/:id/recordings',auth[_0x021f('0x8')](),controller[_0x021f('0x19')]);router['get'](_0x021f('0x1a'),auth[_0x021f('0x8')](),controller[_0x021f('0x1b')]);router[_0x021f('0x7')]('/:id/chat/interactions',auth[_0x021f('0x8')](),controller[_0x021f('0x1c')]);router[_0x021f('0x7')](_0x021f('0x1d'),auth[_0x021f('0x8')](),controller['getOpenchannelInteractions']);router[_0x021f('0x7')](_0x021f('0x1e'),auth[_0x021f('0x8')](),controller[_0x021f('0x1f')]);router[_0x021f('0x7')](_0x021f('0x20'),auth['isAuthenticated'](),controller[_0x021f('0x21')]);router[_0x021f('0x7')](_0x021f('0x22'),auth['isAuthenticated'](),controller[_0x021f('0x23')]);router[_0x021f('0x7')](_0x021f('0x24'),auth['isAuthenticated'](),controller[_0x021f('0x25')]);router['get']('/:id/teams',auth[_0x021f('0x8')](),controller[_0x021f('0x26')]);router[_0x021f('0x7')](_0x021f('0x27'),auth['isAuthenticated'](),controller['getLists']);router[_0x021f('0x7')](_0x021f('0x28'),auth['isAuthenticated'](),controller[_0x021f('0x29')]);router['get']('/:id/prefixes',auth[_0x021f('0x8')](),controller[_0x021f('0x2a')]);router[_0x021f('0x7')](_0x021f('0x2b'),auth[_0x021f('0x8')](),controller['getFaxAccounts']);router[_0x021f('0x7')]('/:id/mail_accounts',auth[_0x021f('0x8')](),controller['getMailAccounts']);router[_0x021f('0x7')](_0x021f('0x2c'),auth[_0x021f('0x8')](),controller[_0x021f('0x2d')]);router['get'](_0x021f('0x2e'),auth[_0x021f('0x8')](),controller[_0x021f('0x2f')]);router[_0x021f('0x7')](_0x021f('0x30'),auth[_0x021f('0x8')](),controller[_0x021f('0x31')]);router[_0x021f('0x7')](_0x021f('0x32'),auth[_0x021f('0x8')](),controller[_0x021f('0x33')]);router[_0x021f('0x7')](_0x021f('0x34'),auth[_0x021f('0x8')](),controller[_0x021f('0x35')]);router[_0x021f('0x7')](_0x021f('0x36'),auth[_0x021f('0x8')](),controller[_0x021f('0x37')]);router['get'](_0x021f('0x38'),auth[_0x021f('0x8')](),controller['getApiKey']);router[_0x021f('0x39')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x021f('0x3a')]);router['post']('/',auth[_0x021f('0x8')](),controller[_0x021f('0x3b')]);router[_0x021f('0x39')](_0x021f('0x3c'),auth['isAuthenticated'](),controller[_0x021f('0x3d')]);router[_0x021f('0x39')](_0x021f('0x13'),auth[_0x021f('0x8')](),controller[_0x021f('0x3e')]);var upload=multer({'storage':multer[_0x021f('0x3f')]({'destination':function(_0x470a18,_0x4dbe62,_0x44eae6){_0x44eae6(null,path[_0x021f('0x40')](config[_0x021f('0x41')],_0x021f('0x42')));},'filename':function(_0x45a171,_0x565ea8,_0x37d16b){_0x37d16b(null,util[_0x021f('0x43')](_0x021f('0x44'),Date[_0x021f('0x45')](),_0x565ea8[_0x021f('0x46')]));}})});router[_0x021f('0x39')](_0x021f('0xe'),upload['single']('file'),controller[_0x021f('0x47')]);router[_0x021f('0x39')]('/:id/login',auth[_0x021f('0x8')](),controller['login']);router[_0x021f('0x39')](_0x021f('0x48'),auth[_0x021f('0x8')](),controller[_0x021f('0x49')]);router[_0x021f('0x39')](_0x021f('0x4a'),auth[_0x021f('0x8')](),controller[_0x021f('0x4b')]);router[_0x021f('0x39')]('/:id/unpause',auth[_0x021f('0x8')](),controller[_0x021f('0x4c')]);router[_0x021f('0x39')](_0x021f('0x4d'),auth[_0x021f('0x8')](),controller['addTeams']);router[_0x021f('0x39')](_0x021f('0x4e'),auth[_0x021f('0x8')](),controller[_0x021f('0x4f')]);router[_0x021f('0x39')](_0x021f('0x50'),auth['isAuthenticated'](),controller[_0x021f('0x51')]);router['post']('/:id/fax_interactions',auth[_0x021f('0x8')](),controller[_0x021f('0x52')]);router[_0x021f('0x39')]('/:id/sms_interactions',auth[_0x021f('0x8')](),controller[_0x021f('0x53')]);router[_0x021f('0x39')](_0x021f('0x54'),auth[_0x021f('0x8')](),controller['addOpenchannelInteractions']);router[_0x021f('0x39')](_0x021f('0x55'),auth[_0x021f('0x8')](),controller[_0x021f('0x56')]);router[_0x021f('0x39')](_0x021f('0x2b'),auth['isAuthenticated'](),controller['addFaxAccounts']);router[_0x021f('0x39')](_0x021f('0x57'),auth[_0x021f('0x8')](),controller[_0x021f('0x58')]);router[_0x021f('0x39')]('/:id/openchannel_accounts',auth[_0x021f('0x8')](),controller[_0x021f('0x59')]);router[_0x021f('0x39')](_0x021f('0x2e'),auth[_0x021f('0x8')](),controller[_0x021f('0x5a')]);router[_0x021f('0x39')]('/:id/chat_websites',auth[_0x021f('0x8')](),controller[_0x021f('0x5b')]);router[_0x021f('0x39')](_0x021f('0x32'),auth[_0x021f('0x8')](),controller[_0x021f('0x5c')]);router[_0x021f('0x39')]('/:id/square_projects',auth[_0x021f('0x8')](),controller[_0x021f('0x5d')]);router['post']('/:id/api_key',auth[_0x021f('0x8')](),controller[_0x021f('0x5e')]);router[_0x021f('0x5f')](_0x021f('0xd'),auth[_0x021f('0x8')](),controller[_0x021f('0x60')]);router[_0x021f('0x5f')](_0x021f('0x61'),auth['isAuthenticated'](),controller[_0x021f('0x62')]);router['delete'](_0x021f('0x13'),auth[_0x021f('0x8')](),controller['removeQueues']);router[_0x021f('0x63')](_0x021f('0x4d'),auth[_0x021f('0x8')](),controller[_0x021f('0x64')]);router['delete'](_0x021f('0xd'),auth['isAuthenticated'](),controller[_0x021f('0x65')]);router[_0x021f('0x63')](_0x021f('0x4e'),auth['isAuthenticated'](),controller[_0x021f('0x66')]);router[_0x021f('0x63')](_0x021f('0x50'),auth[_0x021f('0x8')](),controller[_0x021f('0x67')]);router[_0x021f('0x63')](_0x021f('0x68'),auth[_0x021f('0x8')](),controller[_0x021f('0x69')]);router[_0x021f('0x63')](_0x021f('0x6a'),auth[_0x021f('0x8')](),controller[_0x021f('0x6b')]);router['delete'](_0x021f('0x54'),auth['isAuthenticated'](),controller['removeOpenchannelInteractions']);router[_0x021f('0x63')](_0x021f('0x55'),auth[_0x021f('0x8')](),controller[_0x021f('0x6c')]);router['delete'](_0x021f('0x2b'),auth[_0x021f('0x8')](),controller[_0x021f('0x6d')]);router[_0x021f('0x63')](_0x021f('0x57'),auth['isAuthenticated'](),controller['removeMailAccounts']);router[_0x021f('0x63')](_0x021f('0x2c'),auth[_0x021f('0x8')](),controller[_0x021f('0x6e')]);router['delete'](_0x021f('0x2e'),auth[_0x021f('0x8')](),controller[_0x021f('0x6f')]);router[_0x021f('0x63')]('/:id/chat_websites',auth[_0x021f('0x8')](),controller['removeChatWebsites']);router['delete'](_0x021f('0x32'),auth['isAuthenticated'](),controller[_0x021f('0x70')]);router[_0x021f('0x63')](_0x021f('0x34'),auth[_0x021f('0x8')](),controller[_0x021f('0x71')]);router[_0x021f('0x63')]('/:id/api_key',auth[_0x021f('0x8')](),controller[_0x021f('0x72')]);module[_0x021f('0x73')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 47012ff..e22d909 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 _0x4358=['PROHIB_FAILED_SCREEN','transport','join','split','rfc2833','info','shortinfo','auto','yes','nonat','update','outgoing','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]','insecure','never','\x22\x22\x20<>','always','refuse','originate','uas','fingerprint','certificate','passive','actpass','update,nonat','TEXT','showWebBar','get','isArray','udp','wss','encryption','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','avpf','force_avp','dtlscertfile','/etc/pki/tls/certs/motion.crt','rtcp_mux','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','true','false','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','sequelize','moment','util','lodash','exports','STRING','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','user','agent','telephone','local','accountcode','callerid','BOOLEAN','DATE','INTEGER','ENUM','friend','from-sip','ALLOWED_PASSED_SCREEN','PROHIB_NOT_SCREENED'];(function(_0x3769f8,_0x9b1a17){var _0x307c56=function(_0x320bb1){while(--_0x320bb1){_0x3769f8['push'](_0x3769f8['shift']());}};_0x307c56(++_0x9b1a17);}(_0x4358,0x19a));var _0x8435=function(_0x1c156e,_0x3263a6){_0x1c156e=_0x1c156e-0x0;var _0x58fc22=_0x4358[_0x1c156e];return _0x58fc22;};'use strict';var Sequelize=require(_0x8435('0x0'));var moment=require(_0x8435('0x1'));var util=require(_0x8435('0x2'));var _=require(_0x8435('0x3'));module[_0x8435('0x4')]={'name':{'type':Sequelize[_0x8435('0x5')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x43e742){this[_0x8435('0x6')]('name',_0x43e742);this[_0x8435('0x6')](_0x8435('0x7'),_0x43e742);},'comment':_0x8435('0x8')},'fullname':{'type':Sequelize[_0x8435('0x5')],'allowNull':![],'set':function(_0x1707f1){this[_0x8435('0x6')](_0x8435('0x9'),_0x1707f1);this['setDataValue']('callerid',util[_0x8435('0xa')](_0x8435('0xb'),_0x1707f1,this[_0x8435('0xc')](_0x8435('0xd'))));}},'alias':{'type':Sequelize[_0x8435('0x5')]},'email':{'type':Sequelize[_0x8435('0x5')],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x51088d){if(_0x51088d){this['setDataValue'](_0x8435('0xe'),_0x51088d[_0x8435('0xf')]());}}},'role':{'type':Sequelize['ENUM']('admin',_0x8435('0x10'),_0x8435('0x11'),_0x8435('0x12')),'allowNull':![]},'password':{'type':Sequelize[_0x8435('0x5')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x8435('0x5')],'defaultValue':_0x8435('0x13')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0x8435('0xd'),'set':function(_0x4060c4){this[_0x8435('0x6')](_0x8435('0xd'),_0x4060c4);this[_0x8435('0x6')](_0x8435('0x14'),_0x4060c4);this[_0x8435('0x6')](_0x8435('0x15'),util[_0x8435('0xa')](_0x8435('0xb'),this[_0x8435('0xc')](_0x8435('0x9')),_0x4060c4));}},'salt':{'type':Sequelize[_0x8435('0x5')]},'phone':{'type':Sequelize[_0x8435('0x5')]},'mobile':{'type':Sequelize[_0x8435('0x5')]},'address':{'type':Sequelize[_0x8435('0x5')]},'zipcode':{'type':Sequelize[_0x8435('0x5')]},'userpic':{'type':Sequelize[_0x8435('0x5')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x8435('0x5')]},'online':{'type':Sequelize[_0x8435('0x16')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x8435('0x17')]},'voicePause':{'type':Sequelize[_0x8435('0x16')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x8435('0x16')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x8435('0x16')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x8435('0x16')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x8435('0x16')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x8435('0x16')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x8435('0x5')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x8435('0x18')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x8435('0x18')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x8435('0x18')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x8435('0x16')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x8435('0x16')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x8435('0x18')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x8435('0x18')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x8435('0x16')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0x8435('0x5')],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x8435('0x5')],'allowNull':!![]},'port':{'type':Sequelize[_0x8435('0x18')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x8435('0x18')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x8435('0x5')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x8435('0x5')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x8435('0x5')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x8435('0x18')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x8435('0x19')](_0x8435('0x1a'),_0x8435('0x10'),'peer'),'allowNull':!![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x8435('0x5')],'allowNull':!![],'defaultValue':_0x8435('0x1b')},'callingpres':{'type':Sequelize[_0x8435('0x19')]('ALLOWED_NOT_SCREENED',_0x8435('0x1c'),'ALLOWED_FAILED_SCREEN','ALLOWED',_0x8435('0x1d'),'PROHIB_PASSED_SCREEN',_0x8435('0x1e'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x8435('0x5')],'allowNull':!![]},'permit':{'type':Sequelize[_0x8435('0x5')],'allowNull':!![]},'secret':{'type':Sequelize[_0x8435('0x5')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x8435('0x5')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x8435('0x5')],'allowNull':!![]},'transport':{'type':Sequelize[_0x8435('0x5')],'allowNull':!![],'defaultValue':'udp','set':function(_0x1cd75a){this[_0x8435('0x6')](_0x8435('0x1f'),_0x1cd75a?_0x1cd75a[_0x8435('0x20')](','):null);},'get':function(){return this[_0x8435('0xc')]('transport')?this[_0x8435('0xc')](_0x8435('0x1f'))[_0x8435('0x21')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x8435('0x19')](_0x8435('0x22'),_0x8435('0x23'),_0x8435('0x24'),'inband',_0x8435('0x25')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x8435('0x19')](_0x8435('0x26'),'no',_0x8435('0x27'),_0x8435('0x28'),_0x8435('0x29')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x8435('0x19')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x8435('0x5')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x12fbb2){this[_0x8435('0x6')](_0x8435('0x2a'),_0x12fbb2?_0x12fbb2['join'](','):null);},'get':function(){return this['getDataValue'](_0x8435('0x2a'))?this['getDataValue'](_0x8435('0x2a'))[_0x8435('0x21')](','):null;},'comment':_0x8435('0x2b')},'callgroup':{'type':Sequelize[_0x8435('0x5')]},'namedcallgroup':{'type':Sequelize[_0x8435('0x5')]},'pickupgroup':{'type':Sequelize[_0x8435('0x5')]},'namedpickupgroup':{'type':Sequelize[_0x8435('0x5')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x8435('0x5')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8435('0x2c')},'allow':{'type':Sequelize[_0x8435('0x5')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x107215){this[_0x8435('0x6')]('allow',_0x107215?_0x107215[_0x8435('0x20')](';'):_0x8435('0x2d'));},'get':function(){return this[_0x8435('0xc')]('allow')?this['getDataValue'](_0x8435('0x2e'))[_0x8435('0x21')](';'):null;},'comment':_0x8435('0x2f')},'autoframing':{'type':Sequelize[_0x8435('0x19')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x8435('0x5')],'allowNull':!![],'set':function(_0x5b519a){this[_0x8435('0x6')](_0x8435('0x30'),_0x5b519a?_0x5b519a[_0x8435('0x20')](','):null);},'get':function(){return this[_0x8435('0xc')](_0x8435('0x30'))?this[_0x8435('0xc')](_0x8435('0x30'))[_0x8435('0x21')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM'](_0x8435('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x8435('0x19')](_0x8435('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM']('yes','no',_0x8435('0x31')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x8435('0x19')](_0x8435('0x26'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x8435('0x19')](_0x8435('0x26'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x8435('0x18')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x8435('0x5')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x8435('0x5')],'allowNull':!![],'defaultValue':_0x8435('0x32')},'amaflags':{'type':Sequelize[_0x8435('0x5')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x8435('0x19')]('yes','no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x8435('0x18')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x8435('0x19')](_0x8435('0x26'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x8435('0x19')]('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x8435('0x19')](_0x8435('0x26'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x8435('0x19')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x8435('0x5')],'allowNull':!![]},'template':{'type':Sequelize[_0x8435('0x5')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x8435('0x26'),'no',_0x8435('0x33')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x8435('0x18')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x8435('0x19')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x8435('0x5')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x8435('0x19')]('accept',_0x8435('0x34'),_0x8435('0x35')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x8435('0x18')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x8435('0x18')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x8435('0x19')]('uac',_0x8435('0x36')),'allowNull':!![],'defaultValue':_0x8435('0x36')},'t38pt_usertpsource':{'type':Sequelize[_0x8435('0x5')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x8435('0x5')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x8435('0x5')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x8435('0x5')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x8435('0x19')](_0x8435('0x26'),'no'),'allowNull':!![],'defaultValue':_0x8435('0x26')},'keepalive':{'type':Sequelize[_0x8435('0x18')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x8435('0x5')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x8435('0x5')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x8435('0x18')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x8435('0x18')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x8435('0x18')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x8435('0x19')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x8435('0x5')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x8435('0x5')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x8435('0x18')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x8435('0x18')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x8435('0x5')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x8435('0x5')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x8435('0x5')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x8435('0x18')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x8435('0x19')](_0x8435('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x8435('0x26'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x8435('0x19')](_0x8435('0x26'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x8435('0x19')](_0x8435('0x26'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x8435('0x19')](_0x8435('0x26'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x8435('0x19')]('yes','no',_0x8435('0x37'),_0x8435('0x38')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x8435('0x5')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x8435('0x5')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x8435('0x5')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x8435('0x5')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x8435('0x5')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x8435('0x19')]('active',_0x8435('0x39'),_0x8435('0x3a')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x8435('0x5')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x8435('0x19')](_0x8435('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x8435('0x5')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x8435('0x5')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x8435('0x18')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x8435('0x19')](_0x8435('0x26'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x8435('0x19')](_0x8435('0x26'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x8435('0x5')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x8435('0x5')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x8435('0x5')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x8435('0x5')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x8435('0x19')](_0x8435('0x26'),'no',_0x8435('0x27'),_0x8435('0x28'),_0x8435('0x3b')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x8435('0x16')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x8435('0x5')]},'resetPasswordExpires':{'type':Sequelize[_0x8435('0x17')]},'passwordResetAt':{'type':Sequelize[_0x8435('0x17')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x8435('0x3c')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x176ff3){this[_0x8435('0x6')](_0x8435('0x3d'),_0x176ff3);var _0x1253bc=this[_0x8435('0x3e')]({'plain':!![]});switch(_0x176ff3){case 0x0:case 0x1:var _0x4420d8=_0x1253bc['transport']?_[_0x8435('0x3f')](_0x1253bc['transport'])?_0x1253bc[_0x8435('0x1f')]['join']():_0x1253bc[_0x8435('0x1f')]:_0x8435('0x40');if(_0x4420d8===_0x8435('0x41')){_0x4420d8=_0x8435('0x40');}this[_0x8435('0x6')](_0x8435('0x1f'),_0x4420d8);this[_0x8435('0x6')](_0x8435('0x42'),'no');this[_0x8435('0x6')]('avpf',null);this[_0x8435('0x6')]('force_avp',null);this['setDataValue'](_0x8435('0x43'),null);this[_0x8435('0x6')](_0x8435('0x44'),null);this[_0x8435('0x6')](_0x8435('0x45'),null);this[_0x8435('0x6')](_0x8435('0x46'),null);this['setDataValue']('dtlscertfile',null);this[_0x8435('0x6')](_0x8435('0x47'),null);this[_0x8435('0x6')]('rtcp_mux','no');break;case 0x2:this[_0x8435('0x6')]('transport','wss');this[_0x8435('0x6')](_0x8435('0x42'),_0x8435('0x26'));this['setDataValue'](_0x8435('0x48'),_0x8435('0x26'));this['setDataValue'](_0x8435('0x49'),_0x8435('0x26'));this[_0x8435('0x6')](_0x8435('0x43'),_0x8435('0x26'));this['setDataValue']('dtlsenable',_0x8435('0x26'));this['setDataValue'](_0x8435('0x45'),'no');this['setDataValue'](_0x8435('0x46'),_0x8435('0x3a'));this[_0x8435('0x6')](_0x8435('0x4a'),_0x1253bc[_0x8435('0x4a')]||_0x8435('0x4b'));this[_0x8435('0x6')]('dtlsprivatekey',_0x1253bc[_0x8435('0x47')]||'/etc/pki/tls/private/motion.key');this[_0x8435('0x6')](_0x8435('0x4c'),_0x8435('0x26'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x499633){this['setDataValue'](_0x8435('0x4d'),_0x499633?_0x499633[_0x8435('0x20')](','):[]);},'get':function(){return this[_0x8435('0xc')]('permissions')?_[_0x8435('0x4e')](this[_0x8435('0xc')](_0x8435('0x4d'))['split'](','),function(_0x268f2a){return parseInt(_0x268f2a,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x8435('0x5')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x8435('0x5')]},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0x8435('0x16')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x8435('0x16')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x8435('0x16')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x8435('0x5')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x8435('0x18')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x8435('0x19')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x8435('0x16')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x8435('0x5')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x8435('0x16')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x8435('0x4f')],'get':function(){return this[_0x8435('0xc')](_0x8435('0x50'))?this[_0x8435('0xc')]('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x8435('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x8435('0x16')],'defaultValue':![]},'interface':{'type':Sequelize[_0x8435('0x5')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x8435('0x16')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x8435('0x5')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x8435('0x5')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x4ea52e){if(typeof _0x4ea52e==='string'){var _0x1faff4=_0x4ea52e==='1'?!![]:_0x4ea52e==='0'?![]:_0x4ea52e===_0x8435('0x51')?!![]:_0x4ea52e===_0x8435('0x52')?![]:![];this[_0x8435('0x6')]('screenrecording',_0x1faff4);}else{this['setDataValue'](_0x8435('0x53'),_0x4ea52e);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x3414d2){this[_0x8435('0x6')](_0x8435('0x54'),_0x3414d2);if(_0x3414d2===!![]){this[_0x8435('0x6')](_0x8435('0x55'),moment());this[_0x8435('0x6')](_0x8435('0x56'),0x0);}else{this['setDataValue'](_0x8435('0x55'),null);}}},'blockedAt':{'type':Sequelize[_0x8435('0x17')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x8435('0x18')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize['INTEGER'](0x5)[_0x8435('0x57')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x8435('0x16')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x8435('0x16')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x8435('0x16')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x8435('0x16')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x8435('0x16')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x8435('0x16')],'defaultValue':![]}}; \ No newline at end of file +var _0x1f6f=['active','passive','actpass','update,nonat','TEXT','isArray','udp','avpf','force_avp','dtlsenable','dtlsverify','dtlsprivatekey','wss','encryption','icesupport','dtlssetup','dtlscertfile','/etc/pki/tls/private/motion.key','rtcp_mux','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','loginAttempts','sequelize','moment','lodash','exports','name','setDataValue','defaultuser','fullname','callerid','\x22%s\x22\x20<%s>','getDataValue','internal','STRING','email','toLowerCase','ENUM','user','agent','telephone','local','INTEGER','format','BOOLEAN','DEFAULT\x20PAUSE','DATE','dynamic','friend','peer','from-sip','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','join','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','inband','yes','nonat','update','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]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','originate','uac','uas','certificate'];(function(_0x9f1156,_0x208884){var _0x3f18df=function(_0x2b6661){while(--_0x2b6661){_0x9f1156['push'](_0x9f1156['shift']());}};_0x3f18df(++_0x208884);}(_0x1f6f,0x122));var _0xf1f6=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x1f6f[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0xf1f6('0x0'));var moment=require(_0xf1f6('0x1'));var util=require('util');var _=require(_0xf1f6('0x2'));module[_0xf1f6('0x3')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xf1f6('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x10002c){this[_0xf1f6('0x5')](_0xf1f6('0x4'),_0x10002c);this['setDataValue'](_0xf1f6('0x6'),_0x10002c);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x4273b3){this[_0xf1f6('0x5')](_0xf1f6('0x7'),_0x4273b3);this['setDataValue'](_0xf1f6('0x8'),util['format'](_0xf1f6('0x9'),_0x4273b3,this[_0xf1f6('0xa')](_0xf1f6('0xb'))));}},'alias':{'type':Sequelize[_0xf1f6('0xc')]},'email':{'type':Sequelize[_0xf1f6('0xc')],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x51bc7a){if(_0x51bc7a){this['setDataValue'](_0xf1f6('0xd'),_0x51bc7a[_0xf1f6('0xe')]());}}},'role':{'type':Sequelize[_0xf1f6('0xf')]('admin',_0xf1f6('0x10'),_0xf1f6('0x11'),_0xf1f6('0x12')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xf1f6('0xc')],'defaultValue':_0xf1f6('0x13')},'internal':{'type':Sequelize[_0xf1f6('0x14')](0xb),'allowNull':![],'unique':_0xf1f6('0xb'),'set':function(_0x17bdac){this[_0xf1f6('0x5')](_0xf1f6('0xb'),_0x17bdac);this['setDataValue']('accountcode',_0x17bdac);this[_0xf1f6('0x5')]('callerid',util[_0xf1f6('0x15')]('\x22%s\x22\x20<%s>',this['getDataValue'](_0xf1f6('0x7')),_0x17bdac));}},'salt':{'type':Sequelize[_0xf1f6('0xc')]},'phone':{'type':Sequelize[_0xf1f6('0xc')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0xf1f6('0xc')]},'zipcode':{'type':Sequelize[_0xf1f6('0xc')]},'userpic':{'type':Sequelize[_0xf1f6('0xc')]},'city':{'type':Sequelize[_0xf1f6('0xc')]},'country':{'type':Sequelize[_0xf1f6('0xc')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0xf1f6('0x16')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xf1f6('0x16')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xf1f6('0x16')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xf1f6('0x16')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xf1f6('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xf1f6('0x16')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xf1f6('0xc')],'defaultValue':_0xf1f6('0x17')},'lastPauseAt':{'type':Sequelize[_0xf1f6('0x18')]},'chatCapacity':{'type':Sequelize[_0xf1f6('0x14')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xf1f6('0x14')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xf1f6('0x14')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xf1f6('0x14')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xf1f6('0x14')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xf1f6('0x16')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xf1f6('0x14')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xf1f6('0x16')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xf1f6('0x16')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xf1f6('0x19')},'ipaddr':{'type':Sequelize[_0xf1f6('0xc')],'allowNull':!![]},'port':{'type':Sequelize[_0xf1f6('0x14')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xf1f6('0x14')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0xf1f6('0xc')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xf1f6('0x14')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xf1f6('0xf')](_0xf1f6('0x1a'),_0xf1f6('0x10'),_0xf1f6('0x1b')),'allowNull':!![],'defaultValue':_0xf1f6('0x1a')},'context':{'type':Sequelize[_0xf1f6('0xc')],'allowNull':!![],'defaultValue':_0xf1f6('0x1c')},'callingpres':{'type':Sequelize['ENUM']('ALLOWED_NOT_SCREENED',_0xf1f6('0x1d'),_0xf1f6('0x1e'),_0xf1f6('0x1f'),'PROHIB_NOT_SCREENED',_0xf1f6('0x20'),_0xf1f6('0x21'),_0xf1f6('0x22')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0xf1f6('0xc')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xf1f6('0xc')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xf1f6('0xc')],'allowNull':!![]},'transport':{'type':Sequelize[_0xf1f6('0xc')],'allowNull':!![],'defaultValue':'udp','set':function(_0x353144){this[_0xf1f6('0x5')]('transport',_0x353144?_0x353144[_0xf1f6('0x23')](','):null);},'get':function(){return this[_0xf1f6('0xa')](_0xf1f6('0x24'))?this['getDataValue'](_0xf1f6('0x24'))[_0xf1f6('0x25')](','):null;},'comment':_0xf1f6('0x26')},'dtmfmode':{'type':Sequelize['ENUM'](_0xf1f6('0x27'),'info',_0xf1f6('0x28'),_0xf1f6('0x29'),'auto'),'allowNull':!![],'defaultValue':_0xf1f6('0x27')},'directmedia':{'type':Sequelize[_0xf1f6('0xf')](_0xf1f6('0x2a'),'no',_0xf1f6('0x2b'),_0xf1f6('0x2c'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xf1f6('0xc')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0xf1f6('0xc')],'allowNull':!![],'defaultValue':_0xf1f6('0x2d'),'set':function(_0x237501){this[_0xf1f6('0x5')]('nat',_0x237501?_0x237501[_0xf1f6('0x23')](','):null);},'get':function(){return this[_0xf1f6('0xa')](_0xf1f6('0x2e'))?this['getDataValue'](_0xf1f6('0x2e'))['split'](','):null;},'comment':_0xf1f6('0x2f')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xf1f6('0xc')]},'pickupgroup':{'type':Sequelize[_0xf1f6('0xc')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xf1f6('0xc')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf1f6('0x30')},'allow':{'type':Sequelize[_0xf1f6('0xc')],'allowNull':![],'defaultValue':_0xf1f6('0x31'),'set':function(_0x38743b){this[_0xf1f6('0x5')](_0xf1f6('0x32'),_0x38743b?_0x38743b[_0xf1f6('0x23')](';'):_0xf1f6('0x31'));},'get':function(){return this[_0xf1f6('0xa')]('allow')?this['getDataValue'](_0xf1f6('0x32'))[_0xf1f6('0x25')](';'):null;},'comment':_0xf1f6('0x33')},'autoframing':{'type':Sequelize[_0xf1f6('0xf')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xf1f6('0xc')],'allowNull':!![],'set':function(_0x3009c9){this[_0xf1f6('0x5')](_0xf1f6('0x34'),_0x3009c9?_0x3009c9[_0xf1f6('0x23')](','):null);},'get':function(){return this[_0xf1f6('0xa')]('insecure')?this[_0xf1f6('0xa')](_0xf1f6('0x34'))[_0xf1f6('0x25')](','):null;},'comment':_0xf1f6('0x35')},'trustrpid':{'type':Sequelize[_0xf1f6('0xf')](_0xf1f6('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xf1f6('0xf')](_0xf1f6('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xf1f6('0xf')]('yes','no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xf1f6('0xf')](_0xf1f6('0x2a'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xf1f6('0xf')](_0xf1f6('0x2a'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xf1f6('0x14')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xf1f6('0xc')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xf1f6('0xc')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xf1f6('0xf')](_0xf1f6('0x2a'),'no'),'allowNull':!![],'defaultValue':_0xf1f6('0x2a')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xf1f6('0xf')](_0xf1f6('0x2a'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xf1f6('0xf')](_0xf1f6('0x2a'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xf1f6('0xf')](_0xf1f6('0x2a'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xf1f6('0xf')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xf1f6('0xc')],'allowNull':!![]},'template':{'type':Sequelize[_0xf1f6('0xc')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xf1f6('0xf')](_0xf1f6('0x2a'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xf1f6('0xf')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xf1f6('0xc')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xf1f6('0xf')]('accept','refuse',_0xf1f6('0x36')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xf1f6('0x14')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xf1f6('0x14')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xf1f6('0xf')](_0xf1f6('0x37'),_0xf1f6('0x38')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0xf1f6('0xc')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xf1f6('0xc')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xf1f6('0xc')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xf1f6('0xc')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0xf1f6('0x2a'),'no'),'allowNull':!![],'defaultValue':_0xf1f6('0x2a')},'keepalive':{'type':Sequelize[_0xf1f6('0x14')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xf1f6('0xc')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xf1f6('0xc')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xf1f6('0x14')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xf1f6('0x14')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xf1f6('0x14')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xf1f6('0xf')](_0xf1f6('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xf1f6('0xc')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xf1f6('0xc')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xf1f6('0x14')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xf1f6('0x14')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xf1f6('0x14')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xf1f6('0xc')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xf1f6('0xc')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xf1f6('0xc')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xf1f6('0xc')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xf1f6('0xc')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xf1f6('0x14')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xf1f6('0xf')](_0xf1f6('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xf1f6('0xf')](_0xf1f6('0x2a'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xf1f6('0xf')](_0xf1f6('0x2a'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xf1f6('0xf')](_0xf1f6('0x2a'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xf1f6('0xf')](_0xf1f6('0x2a'),'no','fingerprint',_0xf1f6('0x39')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xf1f6('0x14')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xf1f6('0xc')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xf1f6('0xc')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xf1f6('0xc')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xf1f6('0xc')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xf1f6('0xc')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xf1f6('0xf')](_0xf1f6('0x3a'),_0xf1f6('0x3b'),_0xf1f6('0x3c')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xf1f6('0xc')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xf1f6('0xf')](_0xf1f6('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xf1f6('0xc')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xf1f6('0x14')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xf1f6('0xf')](_0xf1f6('0x2a'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xf1f6('0xf')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xf1f6('0xc')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xf1f6('0xc')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xf1f6('0xc')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xf1f6('0xf')]('yes','no',_0xf1f6('0x2b'),'update',_0xf1f6('0x3d')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xf1f6('0x16')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xf1f6('0xc')]},'resetPasswordExpires':{'type':Sequelize[_0xf1f6('0x18')]},'passwordResetAt':{'type':Sequelize[_0xf1f6('0x18')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xf1f6('0x3e')]},'showWebBar':{'type':Sequelize[_0xf1f6('0x14')],'defaultValue':0x0,'set':function(_0x3fbcb3){this[_0xf1f6('0x5')]('showWebBar',_0x3fbcb3);var _0x481999=this['get']({'plain':!![]});switch(_0x3fbcb3){case 0x0:case 0x1:var _0x46b33a=_0x481999['transport']?_[_0xf1f6('0x3f')](_0x481999[_0xf1f6('0x24')])?_0x481999['transport'][_0xf1f6('0x23')]():_0x481999[_0xf1f6('0x24')]:_0xf1f6('0x40');if(_0x46b33a==='wss'){_0x46b33a='udp';}this[_0xf1f6('0x5')]('transport',_0x46b33a);this[_0xf1f6('0x5')]('encryption','no');this['setDataValue'](_0xf1f6('0x41'),null);this[_0xf1f6('0x5')](_0xf1f6('0x42'),null);this['setDataValue']('icesupport',null);this[_0xf1f6('0x5')](_0xf1f6('0x43'),null);this['setDataValue'](_0xf1f6('0x44'),null);this[_0xf1f6('0x5')]('dtlssetup',null);this[_0xf1f6('0x5')]('dtlscertfile',null);this['setDataValue'](_0xf1f6('0x45'),null);this[_0xf1f6('0x5')]('rtcp_mux','no');break;case 0x2:this[_0xf1f6('0x5')]('transport',_0xf1f6('0x46'));this[_0xf1f6('0x5')](_0xf1f6('0x47'),_0xf1f6('0x2a'));this[_0xf1f6('0x5')](_0xf1f6('0x41'),_0xf1f6('0x2a'));this[_0xf1f6('0x5')]('force_avp',_0xf1f6('0x2a'));this[_0xf1f6('0x5')](_0xf1f6('0x48'),_0xf1f6('0x2a'));this[_0xf1f6('0x5')]('dtlsenable','yes');this[_0xf1f6('0x5')](_0xf1f6('0x44'),'no');this[_0xf1f6('0x5')](_0xf1f6('0x49'),_0xf1f6('0x3c'));this[_0xf1f6('0x5')](_0xf1f6('0x4a'),_0x481999[_0xf1f6('0x4a')]||'/etc/pki/tls/certs/motion.crt');this[_0xf1f6('0x5')](_0xf1f6('0x45'),_0x481999[_0xf1f6('0x45')]||_0xf1f6('0x4b'));this['setDataValue'](_0xf1f6('0x4c'),_0xf1f6('0x2a'));break;default:}}},'permissions':{'type':Sequelize[_0xf1f6('0x3e')],'set':function(_0x58235d){this['setDataValue'](_0xf1f6('0x4d'),_0x58235d?_0x58235d['join'](','):[]);},'get':function(){return this[_0xf1f6('0xa')]('permissions')?_[_0xf1f6('0x4e')](this['getDataValue'](_0xf1f6('0x4d'))[_0xf1f6('0x25')](','),function(_0x8417c2){return parseInt(_0x8417c2,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xf1f6('0xc')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xf1f6('0xc')]},'phoneBarBusyNumber':{'type':Sequelize[_0xf1f6('0xc')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xf1f6('0x16')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xf1f6('0x16')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xf1f6('0x14')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xf1f6('0xc')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xf1f6('0x14')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xf1f6('0xf')](_0xf1f6('0x2a'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xf1f6('0x16')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize[_0xf1f6('0x16')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xf1f6('0x16')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xf1f6('0x4f')],'get':function(){return this['getDataValue'](_0xf1f6('0x50'))?this['getDataValue']('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xf1f6('0x16')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xf1f6('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xf1f6('0x16')],'defaultValue':![]},'interface':{'type':Sequelize[_0xf1f6('0xc')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xf1f6('0x16')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xf1f6('0xc')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xf1f6('0x16')],'defaultValue':![],'set':function(_0x4985d5){if(typeof _0x4985d5===_0xf1f6('0x51')){var _0x2e288f=_0x4985d5==='1'?!![]:_0x4985d5==='0'?![]:_0x4985d5===_0xf1f6('0x52')?!![]:_0x4985d5===_0xf1f6('0x53')?![]:![];this[_0xf1f6('0x5')](_0xf1f6('0x54'),_0x2e288f);}else{this[_0xf1f6('0x5')](_0xf1f6('0x54'),_0x4985d5);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x3a7b14){this[_0xf1f6('0x5')]('blocked',_0x3a7b14);if(_0x3a7b14===!![]){this['setDataValue'](_0xf1f6('0x55'),moment());this[_0xf1f6('0x5')](_0xf1f6('0x56'),0x0);}else{this[_0xf1f6('0x5')](_0xf1f6('0x55'),null);}}},'blockedAt':{'type':Sequelize[_0xf1f6('0x18')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xf1f6('0x16')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xf1f6('0x14')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xf1f6('0x16')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xf1f6('0x16')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0xf1f6('0x16')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xf1f6('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 4ea7e1c..d6d830d 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 _0xa556=['ui.createdAt','user_has_','ui.UserId\x20=\x20?','toString','OpenTabs','moment','bluebird','path','lodash','squel','ioredis','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','socket.io-emitter','./user.socket','register','redis','defaults','client','then','info','debug','User,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','User,\x20%s,\x20%s','message','result','catch','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','destroy','get','role','Agents','Telephones','telephone','filter','ignore','map','value','includes','find','name','UserProfileResource','end','stack','send','index','User','rawAttributes','fieldName','key','password','salt','includeAll','include','query','userSetting','true','UserSetting','attributes','push','rows','openTabs','length','chat','sms','dataValues','fax','mail','openchannel','whatsapp','all','show','model','keys','filters','intersection','fields','merge','options','update','body','params','describe','addContacts','ids','omit','Setting','findById','securePassword','internal','min_internal','isNil','sequelize','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)','QueryTypes','SELECT','from','voicemail','VoiceMail','fullname','email','permissions','103','110','104','106','107','108','109','100','111','114','create','user','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','admin','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','settingsEnabled','UserProfileSection','agent','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','some','checkUserLimits','findAll','isEmpty','autoAssociation','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','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','validatePasswordHistory','previousPasswords','addQueues','channel','online','voicePause','Unknown\x20channel','capitalize','toLowerCase','Queues','penalty','spread','QueueId','emit','voice','interface','format','UserVoiceQueueRt','upsert','removeQueues','isValidChannel','remove','isArray','Queue:remove','file','filename','getAvatar','join','root','userpic','download','server/files/images/','getOpenTabs','CHAT','FaxOpenTabs','FAX','createdAt','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WHATSAPP','getContacts','findOne','CmContact','order','sort','where','pick','CmList','List','tag','hasOwnProperty','nolimit','getQueues','Queue','Unknown\x20role','getVoiceQueuesRt','getGroups','getRecordings','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','getWhatsappInteractions','WhatsappInteraction','phone','mobile','loginInPause','intrf','SIP/%s','user:forcelogout','headers','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','each','MemberReport','YYYY-MM-DD\x20HH:mm:ss','forEach','LOGIN','device','PAUSE','LOGININPAUSE','bulkCreate','concat','resolve','logout','pause','QueuePause','updateAttributes','getChannels','DEFAULT\x20PAUSE','unpause','mailPause','pauseType','manual','%s%s','Pause','getTeams','Team','addTeams','Voice','getChatQueues','setDataValue','Chat','Mail','getSmsQueues','Sms','Whatsapp','getFaxQueues','getOpenchannelQueues','Openchannel','transaction','addAgent','getDataValue','TeamVoicePrefix','removeTeams','getMailQueues','getWhatsappQueues','Fax','UserVoicePrefix','VoicePrefixId','getLists','getAgents','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','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','VoicePrefix','getVoicePrefixes','getFaxAccounts','addFaxAccounts','removeFaxAccounts','MailAccount','getMailAccounts','addMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','ChatWebsite','getChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','removeSquareProjects','CmHopper','$and','$gt','$gte','$lt','$ne','$eq','$not','$notBetween','$in','$notIn','$like','$iLike','$notILike','$contains','$contained','firstName','lastName','Contact','dialActive','VoiceQueue','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','iat','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','getPresence','teams','queues','inbound','flatten','lower','asc','desc','substring','uniqBy','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','http','offline','idle','slice','charAt','toUpperCase','ui.','InteractionId','field'];(function(_0x169428,_0x12537a){var _0x3a164a=function(_0x563534){while(--_0x563534){_0x169428['push'](_0x169428['shift']());}};_0x3a164a(++_0x12537a);}(_0xa556,0x192));var _0x6a55=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0xa556[_0x346737];return _0x1ade2e;};'use strict';var moment=require(_0x6a55('0x0'));var BPromise=require(_0x6a55('0x1'));var util=require('util');var path=require(_0x6a55('0x2'));var fs=require('fs');var _=require(_0x6a55('0x3'));var squel=require(_0x6a55('0x4'));var jayson=require('jayson/promise');var Redis=require(_0x6a55('0x5'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var logger=require(_0x6a55('0x6'))('api');var utils=require(_0x6a55('0x7'));var config=require(_0x6a55('0x8'));var licenseUtil=require(_0x6a55('0x9'));var db=require(_0x6a55('0xa'))['db'];var socket=require(_0x6a55('0xb'))(new Redis(config['redis']));require(_0x6a55('0xc'))[_0x6a55('0xd')](socket);config[_0x6a55('0xe')]=_[_0x6a55('0xf')](config['redis'],{'host':'localhost','port':0x18eb});var client=jayson[_0x6a55('0x10')]['http']({'port':0x232a});var values;function respondWithRpcPromise(_0x226d98,_0x42e32e,_0x4dfff6,_0x7e8a04){return new BPromise(function(_0x5ba1a2,_0x4d9378){var _0x541026=_0x7e8a04||client;return _0x541026['request'](_0x226d98,_0x4dfff6)[_0x6a55('0x11')](function(_0x21b88d){logger[_0x6a55('0x12')]('User,\x20%s,\x20%s',_0x42e32e,'request\x20sent');logger[_0x6a55('0x13')](_0x6a55('0x14'),_0x42e32e,_0x6a55('0x15'),JSON['stringify'](_0x21b88d));if(_0x21b88d[_0x6a55('0x16')]){if(_0x21b88d[_0x6a55('0x16')][_0x6a55('0x17')]===0x1f4){logger['error'](_0x6a55('0x18'),_0x42e32e,_0x21b88d[_0x6a55('0x16')][_0x6a55('0x19')]);return _0x4d9378(_0x21b88d[_0x6a55('0x16')]['message']);}logger['error'](_0x6a55('0x18'),_0x42e32e,_0x21b88d[_0x6a55('0x16')]['message']);return _0x5ba1a2(_0x21b88d['error'][_0x6a55('0x19')]);}else{logger['info'](_0x6a55('0x18'),_0x42e32e,_0x6a55('0x15'));_0x5ba1a2(_0x21b88d[_0x6a55('0x1a')][_0x6a55('0x19')]);}})[_0x6a55('0x1b')](function(_0x182c3d){logger['error'](_0x6a55('0x18'),_0x42e32e,_0x182c3d);_0x4d9378(_0x182c3d);});});}function respondWithStatusCode(_0x4dfd89,_0x20748a){_0x20748a=_0x20748a||0xcc;return function(_0x22fe31){if(_0x22fe31){return _0x4dfd89[_0x6a55('0x1c')](_0x20748a);}return _0x4dfd89[_0x6a55('0x1d')](_0x20748a)['end']();};}function respondWithResult(_0x53f0bc,_0x163096){_0x163096=_0x163096||0xc8;return function(_0x6e52c5){if(_0x6e52c5){return _0x53f0bc[_0x6a55('0x1d')](_0x163096)['json'](_0x6e52c5);}};}function respondWithFilteredResult(_0x52211c,_0x206cfc){return function(_0x1f84e9){if(_0x1f84e9){var _0x58f2f1=typeof _0x206cfc[_0x6a55('0x1e')]===_0x6a55('0x1f')&&typeof _0x206cfc[_0x6a55('0x20')]===_0x6a55('0x1f');var _0x451554=_0x1f84e9[_0x6a55('0x21')];var _0x57a037=_0x58f2f1?0x0:_0x206cfc[_0x6a55('0x1e')];var _0x21d952=_0x58f2f1?_0x1f84e9[_0x6a55('0x21')]:_0x206cfc[_0x6a55('0x1e')]+_0x206cfc[_0x6a55('0x20')];var _0x6383ea;if(_0x21d952>=_0x451554){_0x21d952=_0x451554;_0x6383ea=0xc8;}else{_0x6383ea=0xce;}_0x52211c[_0x6a55('0x1d')](_0x6383ea);return _0x52211c[_0x6a55('0x22')](_0x6a55('0x23'),_0x57a037+'-'+_0x21d952+'/'+_0x451554)[_0x6a55('0x24')](_0x1f84e9);}return null;};}function saveUpdates(_0x17d8a0){return function(_0x3b1355){if(_0x3b1355){return _0x3b1355['update'](_0x17d8a0)[_0x6a55('0x11')](function(_0x3fde6a){return _0x3fde6a;});}return null;};}function removeEntity(_0x266601){return function(_0xa0a15b){if(_0xa0a15b){return _0xa0a15b[_0x6a55('0x25')]()[_0x6a55('0x11')](function(){var _0x3bd190=_0xa0a15b[_0x6a55('0x26')]({'plain':!![]});if(_0x3bd190[_0x6a55('0x27')]==='admin')return;var _0x2b2fae=[{'name':'Users','value':'user','ignore':!![]},{'name':_0x6a55('0x28'),'value':'agent','ignore':![]},{'name':_0x6a55('0x29'),'value':_0x6a55('0x2a'),'ignore':![]}];var _0x42862f=_(_0x2b2fae)[_0x6a55('0x2b')](_0x6a55('0x2c'))[_0x6a55('0x2d')](_0x6a55('0x2e'))[_0x6a55('0x2e')]();if(_[_0x6a55('0x2f')](_0x42862f,_0x3bd190['role'])){return;}var _0x37e794=_[_0x6a55('0x30')](_0x2b2fae,['value',_0x3bd190[_0x6a55('0x27')]])[_0x6a55('0x31')];return db[_0x6a55('0x32')][_0x6a55('0x25')]({'where':{'type':_0x37e794,'resourceId':_0x3bd190['id']}})[_0x6a55('0x11')](function(){return _0xa0a15b;});})[_0x6a55('0x11')](function(){_0x266601['status'](0xcc)[_0x6a55('0x33')]();});}};}function handleEntityNotFound(_0x1b76d9){return function(_0x4ce055){if(!_0x4ce055){_0x1b76d9[_0x6a55('0x1c')](0x194);}return _0x4ce055;};}function handleError(_0x10e9ec,_0x95478){_0x95478=_0x95478||0x1f4;return function(_0x4ce45d){logger[_0x6a55('0x16')](_0x4ce45d[_0x6a55('0x34')]);if(_0x4ce45d['name']){delete _0x4ce45d['name'];}_0x10e9ec['status'](_0x95478)[_0x6a55('0x35')](_0x4ce45d);};}exports[_0x6a55('0x36')]=function(_0x52e622,_0xb3680d){var _0x76d71b={},_0x488e72={'count':0x0,'rows':[]};var _0x4add3c=_(db[_0x6a55('0x37')][_0x6a55('0x38')])[_0x6a55('0x2d')](function(_0x37941b){return{'name':_0x37941b[_0x6a55('0x39')],'type':_0x37941b['type'][_0x6a55('0x3a')]};})[_0x6a55('0x2b')](function(_0x3e0e37){return!_['includes']([_0x6a55('0x3b'),_0x6a55('0x3c')],_0x3e0e37['name']);})[_0x6a55('0x2e')]();_0x76d71b=qs['getOptions'](_0x4add3c,_0x52e622);var _0x2357db={'where':_0x76d71b['where']};return db[_0x6a55('0x37')][_0x6a55('0x21')](_0x2357db)[_0x6a55('0x11')](function(_0x52cc6b){_0x488e72[_0x6a55('0x21')]=_0x52cc6b;if(_0x52e622['query'][_0x6a55('0x3d')]){_0x76d71b[_0x6a55('0x3e')]=[{'all':!![]}];}if(_0x52e622[_0x6a55('0x3f')][_0x6a55('0x40')]===_0x6a55('0x41')){_0x76d71b[_0x6a55('0x3e')]=[{'model':db[_0x6a55('0x42')],'as':_0x6a55('0x40')}];}if(!_['includes'](_0x76d71b[_0x6a55('0x43')],'id')){_0x76d71b['attributes'][_0x6a55('0x44')]('id');}return db[_0x6a55('0x37')]['findAll'](_0x76d71b);})[_0x6a55('0x11')](function(_0x48efd3){_0x488e72[_0x6a55('0x45')]=_0x48efd3;if(_0x52e622[_0x6a55('0x3f')][_0x6a55('0x46')]===_0x6a55('0x41')){var _0x18994b=[];for(var _0x719e30=0x0;_0x719e30<_0x488e72['rows'][_0x6a55('0x47')];_0x719e30++){_0x18994b[_0x6a55('0x44')](get_open_tabs(_0x6a55('0x48'),_0x488e72[_0x6a55('0x45')][_0x719e30]['dataValues']));_0x18994b[_0x6a55('0x44')](get_open_tabs(_0x6a55('0x49'),_0x488e72[_0x6a55('0x45')][_0x719e30][_0x6a55('0x4a')]));_0x18994b['push'](get_open_tabs(_0x6a55('0x4b'),_0x488e72['rows'][_0x719e30][_0x6a55('0x4a')]));_0x18994b[_0x6a55('0x44')](get_open_tabs(_0x6a55('0x4c'),_0x488e72[_0x6a55('0x45')][_0x719e30][_0x6a55('0x4a')]));_0x18994b[_0x6a55('0x44')](get_open_tabs(_0x6a55('0x4d'),_0x488e72['rows'][_0x719e30]['dataValues']));_0x18994b[_0x6a55('0x44')](get_open_tabs(_0x6a55('0x4e'),_0x488e72['rows'][_0x719e30][_0x6a55('0x4a')]));}return BPromise[_0x6a55('0x4f')](_0x18994b)[_0x6a55('0x11')](function(){return _0x488e72;});}else{return _0x488e72;}})[_0x6a55('0x11')](respondWithFilteredResult(_0xb3680d,_0x76d71b))[_0x6a55('0x1b')](handleError(_0xb3680d,null));};exports[_0x6a55('0x50')]=function(_0x2999e6,_0xcb4870){var _0x45c5e5={'raw':![],'where':{'id':_0x2999e6['params']['id']}},_0x4fc656={};_0x4fc656[_0x6a55('0x51')]=_['differenceBy'](_[_0x6a55('0x52')](db[_0x6a55('0x37')][_0x6a55('0x38')]),['password',_0x6a55('0x3c')]);_0x4fc656[_0x6a55('0x3f')]=_[_0x6a55('0x52')](_0x2999e6[_0x6a55('0x3f')]);_0x4fc656[_0x6a55('0x53')]=_[_0x6a55('0x54')](_0x4fc656[_0x6a55('0x51')],_0x4fc656[_0x6a55('0x3f')]);_0x45c5e5[_0x6a55('0x43')]=_['intersection'](_0x4fc656['model'],qs['fields'](_0x2999e6['query'][_0x6a55('0x55')]));_0x45c5e5['attributes']=_0x45c5e5[_0x6a55('0x43')][_0x6a55('0x47')]?_0x45c5e5[_0x6a55('0x43')]:_0x4fc656[_0x6a55('0x51')];if(_0x2999e6[_0x6a55('0x3f')][_0x6a55('0x3d')]){_0x45c5e5['include']=[{'all':!![]}];}if(_0x2999e6[_0x6a55('0x3f')][_0x6a55('0x40')]==='true'){_0x45c5e5['include']=[{'model':db[_0x6a55('0x42')],'as':_0x6a55('0x40')}];}_0x45c5e5=_[_0x6a55('0x56')]({},_0x45c5e5,_0x2999e6[_0x6a55('0x57')]);if(!_[_0x6a55('0x2f')](_0x45c5e5[_0x6a55('0x43')],'id')){_0x45c5e5[_0x6a55('0x43')][_0x6a55('0x44')]('id');}return db[_0x6a55('0x37')][_0x6a55('0x30')](_0x45c5e5)[_0x6a55('0x11')](handleEntityNotFound(_0xcb4870,null))[_0x6a55('0x11')](function(_0x484187){var _0x2cc546=[];values=_0x484187;if(_0x2999e6[_0x6a55('0x3f')]['openTabs']===_0x6a55('0x41')){_0x2cc546[_0x6a55('0x44')](get_open_tabs(_0x6a55('0x48'),_0x484187['dataValues']));_0x2cc546[_0x6a55('0x44')](get_open_tabs('sms',_0x484187[_0x6a55('0x4a')]));_0x2cc546[_0x6a55('0x44')](get_open_tabs('openchannel',_0x484187[_0x6a55('0x4a')]));_0x2cc546['push'](get_open_tabs(_0x6a55('0x4e'),_0x484187[_0x6a55('0x4a')]));_0x2cc546[_0x6a55('0x44')](get_open_tabs(_0x6a55('0x4b'),_0x484187[_0x6a55('0x4a')]));_0x2cc546['push'](get_open_tabs(_0x6a55('0x4c'),_0x484187[_0x6a55('0x4a')]));return BPromise['all'](_0x2cc546);}else{return values;}})[_0x6a55('0x11')](function(){return values;})['then'](respondWithResult(_0xcb4870,null))[_0x6a55('0x1b')](handleError(_0xcb4870,null));};exports[_0x6a55('0x58')]=function(_0x24c641,_0x77966b){if(_0x24c641['body']['id']){delete _0x24c641[_0x6a55('0x59')]['id'];}delete _0x24c641[_0x6a55('0x59')][_0x6a55('0x27')];return db[_0x6a55('0x37')][_0x6a55('0x30')]({'where':{'id':_0x24c641[_0x6a55('0x5a')]['id']}})[_0x6a55('0x11')](handleEntityNotFound(_0x77966b,null))['then'](saveUpdates(_0x24c641[_0x6a55('0x59')],null))[_0x6a55('0x11')](respondWithResult(_0x77966b,null))[_0x6a55('0x1b')](handleError(_0x77966b,null));};exports[_0x6a55('0x5b')]=function(_0x26977e,_0x2cdc3c){return db[_0x6a55('0x37')][_0x6a55('0x5b')]()[_0x6a55('0x11')](respondWithResult(_0x2cdc3c,null))[_0x6a55('0x1b')](handleError(_0x2cdc3c,null));};exports[_0x6a55('0x5c')]=function(_0x941871,_0x46d998){return db[_0x6a55('0x37')]['find']({'where':{'id':_0x941871[_0x6a55('0x5a')]['id']}})[_0x6a55('0x11')](handleEntityNotFound(_0x46d998,null))[_0x6a55('0x11')](function(_0x361fc9){if(_0x361fc9){return _0x361fc9['addContacts'](_0x941871[_0x6a55('0x59')][_0x6a55('0x5d')],_[_0x6a55('0x5e')](_0x941871[_0x6a55('0x59')],[_0x6a55('0x5d'),'id'])||{});}})[_0x6a55('0x11')](respondWithResult(_0x46d998,null))[_0x6a55('0x1b')](handleError(_0x46d998,null));};function validateUser(_0x478ac6){return new BPromise(function(_0x5c3823,_0x382d93){if(_0x478ac6['internal'])return _0x5c3823(_0x478ac6);return db[_0x6a55('0x5f')][_0x6a55('0x60')](0x1)[_0x6a55('0x11')](function(_0x6b3987){if(_0x6b3987[_0x6a55('0x61')])authService['validatePasswordPattern'](_0x478ac6[_0x6a55('0x3b')]);db[_0x6a55('0x37')]['max'](_0x6a55('0x62'))['then'](function(_0x33f569){if(_['isNil'](_0x33f569)){_0x478ac6['internal']=_0x6b3987[_0x6a55('0x63')]||0x1;return;}if(_[_0x6a55('0x64')](_0x6b3987[_0x6a55('0x63')])||_0x6b3987[_0x6a55('0x63')]===_0x33f569){_0x478ac6[_0x6a55('0x62')]=_0x33f569+0x1;return;}if(_0x6b3987[_0x6a55('0x63')]>_0x33f569){_0x478ac6[_0x6a55('0x62')]=_0x6b3987[_0x6a55('0x63')];return;}return db[_0x6a55('0x65')][_0x6a55('0x3f')](_0x6a55('0x66'),{'type':db[_0x6a55('0x65')][_0x6a55('0x67')][_0x6a55('0x68')]})[_0x6a55('0x11')](function(_0x13939b){if(_0x13939b&&_0x13939b['length']){for(var _0x2398c8=0x0,_0x1368b6=_0x13939b['length'];_0x2398c8<_0x1368b6&&_[_0x6a55('0x64')](_0x478ac6['internal']);_0x2398c8++){if(_0x6b3987[_0x6a55('0x63')]<=_0x13939b[_0x2398c8][_0x6a55('0x69')]){_0x478ac6['internal']=_0x13939b[_0x2398c8][_0x6a55('0x69')];}else if(_0x6b3987[_0x6a55('0x63')]>_0x13939b[_0x2398c8][_0x6a55('0x69')]&&_0x6b3987[_0x6a55('0x63')]<=_0x13939b[_0x2398c8]['to']){_0x478ac6[_0x6a55('0x62')]=_0x6b3987[_0x6a55('0x63')];}}}if(_[_0x6a55('0x64')](_0x478ac6[_0x6a55('0x62')])){_0x478ac6['internal']=_0x33f569+0x1;}return _0x5c3823(_0x478ac6);});});})['catch'](function(_0x530484){_0x382d93(_0x530484);});});}function updateUser(_0xacafeb){return new BPromise(function(_0x3f937e,_0x38e38e){try{if(_0xacafeb[_0x6a55('0x6a')]){_0xacafeb['mailbox']=_0xacafeb[_0x6a55('0x62')];_0xacafeb[_0x6a55('0x6b')]={'mailbox':_0xacafeb[_0x6a55('0x62')],'password':_0xacafeb['password'],'fullname':_0xacafeb[_0x6a55('0x6c')],'email':_0xacafeb[_0x6a55('0x6d')]};}if(_0xacafeb['role']==='agent'){if(!_0xacafeb[_0x6a55('0x6e')])_0xacafeb[_0x6a55('0x6e')]=['101','102',_0x6a55('0x6f'),'113',_0x6a55('0x70'),_0x6a55('0x71'),'105',_0x6a55('0x72'),_0x6a55('0x73'),_0x6a55('0x74'),_0x6a55('0x75'),_0x6a55('0x76'),_0x6a55('0x77'),_0x6a55('0x78'),'115'];}_0x3f937e(_0xacafeb);}catch(_0x49b792){_0x38e38e(_0x49b792);}});}exports[_0x6a55('0x79')]=function(_0x52da8e,_0x4615c0){if(_0x52da8e[_0x6a55('0x7a')][_0x6a55('0x27')]==='agent')throw new Error(_0x6a55('0x7b'));if(_0x52da8e[_0x6a55('0x59')]['role']===_0x6a55('0x7a')&&_0x52da8e[_0x6a55('0x7a')]['role']!=='admin'){throw new Error(_0x6a55('0x7c'));}if(_0x52da8e[_0x6a55('0x59')]['role']==='admin'&&_0x52da8e[_0x6a55('0x7a')][_0x6a55('0x27')]!==_0x6a55('0x7d')){throw new Error(_0x6a55('0x7e'));}return licenseUtil['checkUserLimits']([_0x52da8e[_0x6a55('0x59')]])[_0x6a55('0x11')](function(){return validateUser(_0x52da8e[_0x6a55('0x59')]);})['then'](function(_0x336db9){return updateUser(_0x336db9)[_0x6a55('0x11')](function(_0x4ab305){if(_0x4ab305[_0x6a55('0x27')]==='admin'){_0x4ab305[_0x6a55('0x7f')]=_0x52da8e['user'][_0x6a55('0x7f')];delete _0x4ab305['userProfileId'];}return _0x4ab305;});})['then'](function(_0x536e04){return db['User'][_0x6a55('0x79')](_0x536e04,{'include':[{'model':db[_0x6a55('0x6b')],'as':_0x6a55('0x6b')}]});})['then'](function(_0x5d19b1){if(_0x52da8e[_0x6a55('0x59')][_0x6a55('0x27')]===_0x6a55('0x7a'))return _0x5d19b1;if(_0x52da8e[_0x6a55('0x7a')][_0x6a55('0x27')]!==_0x6a55('0x7a'))return _0x5d19b1;return db[_0x6a55('0x80')][_0x6a55('0x30')]({'where':{'name':_0x5d19b1[_0x6a55('0x27')]===_0x6a55('0x81')?_0x6a55('0x28'):'Telephones','userProfileId':_0x52da8e[_0x6a55('0x7a')][_0x6a55('0x82')]},'raw':!![]})[_0x6a55('0x11')](function(_0x1b0c22){if(!_0x1b0c22||_0x1b0c22['autoAssociation']!=0x0)return _0x5d19b1;return db['UserProfileResource']['create']({'name':_0x5d19b1[_0x6a55('0x31')],'resourceId':_0x5d19b1['id'],'type':_0x1b0c22[_0x6a55('0x31')],'sectionId':_0x1b0c22['id']},{})[_0x6a55('0x11')](function(){return _0x5d19b1;});})[_0x6a55('0x1b')](function(_0x56b1b3){logger[_0x6a55('0x16')](_0x6a55('0x83'),_0x56b1b3);throw _0x56b1b3;});})[_0x6a55('0x11')](respondWithResult(_0x4615c0,0xc9))[_0x6a55('0x1b')](handleError(_0x4615c0,null));};exports['bulkCreate']=function(_0x976689,_0x150d43){var _0x3924c2=_0x976689[_0x6a55('0x59')];var _0x52e200=[];if(_0x976689[_0x6a55('0x7a')][_0x6a55('0x27')]==='agent')throw new Error(_0x6a55('0x7b'));if(_[_0x6a55('0x84')](_0x3924c2,['role',_0x6a55('0x7a')])&&_0x976689[_0x6a55('0x7a')]['role']!==_0x6a55('0x7d')){throw new Error(_0x6a55('0x7c'));}if(_[_0x6a55('0x84')](_0x3924c2,[_0x6a55('0x27'),_0x6a55('0x7d')])&&_0x976689['user']['role']!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil[_0x6a55('0x85')](_0x3924c2)[_0x6a55('0x11')](function(){return validateUser(_0x3924c2[0x0]);})[_0x6a55('0x11')](function(){for(var _0x2db80d=0x1;_0x2db80d<_0x3924c2[_0x6a55('0x47')];_0x2db80d++){var _0x4eca1b=_0x3924c2[_0x2db80d-0x1]['internal'];if(!_0x3924c2[_0x2db80d][_0x6a55('0x62')])_0x3924c2[_0x2db80d][_0x6a55('0x62')]=_0x4eca1b+0x1;_0x52e200['push'](validateUser(_0x3924c2[_0x2db80d]));}return BPromise[_0x6a55('0x4f')](_0x52e200);})[_0x6a55('0x11')](function(){_0x52e200=[];for(var _0x485444=0x0;_0x485444<_0x3924c2['length'];_0x485444++){_0x52e200[_0x6a55('0x44')](updateUser(_0x3924c2[_0x485444]));}return BPromise[_0x6a55('0x4f')](_0x52e200);})[_0x6a55('0x11')](function(){return BPromise['each'](_0x3924c2,function(_0x6bbf76){return db[_0x6a55('0x37')][_0x6a55('0x79')](_0x6bbf76,{'include':[{'model':db['VoiceMail'],'as':_0x6a55('0x6b')}]})[_0x6a55('0x11')](function(_0xec662b){_0x6bbf76['id']=_0xec662b['id'];return _0x6bbf76;});});})[_0x6a55('0x11')](function(_0xaa6a56){if(_0x976689['body'][_0x6a55('0x27')]==='user')return _0xaa6a56;if(_0x976689[_0x6a55('0x7a')][_0x6a55('0x27')]!==_0x6a55('0x7a'))return _0xaa6a56;var _0x16db5c=_['some'](_0xaa6a56,function(_0x48709d){return _0x48709d['role']==='agent'||_0x48709d[_0x6a55('0x27')]===_0x6a55('0x2a');});if(!_0x16db5c)return _0xaa6a56;return db['UserProfileSection'][_0x6a55('0x86')]({'where':{'name':{'$or':['Agents',_0x6a55('0x29')]},'userProfileId':_0x976689[_0x6a55('0x7a')][_0x6a55('0x82')]},'raw':!![]})[_0x6a55('0x11')](function(_0x134935){if(_[_0x6a55('0x87')](_0x134935)||!_[_0x6a55('0x84')](_0x134935,[_0x6a55('0x88'),0x0]))return _0xaa6a56;_0x52e200=[];var _0x2d0d67=_(_0x134935)[_0x6a55('0x2d')](function(_0x549880){if(_0x549880[_0x6a55('0x88')]===0x1)return;return _0x549880[_0x6a55('0x31')]===_0x6a55('0x28')?_0x6a55('0x81'):_0x6a55('0x2a');})[_0x6a55('0x89')]()['value']();for(var _0x42530d=0x0;_0x42530d<_0xaa6a56[_0x6a55('0x47')];_0x42530d++){if(!_[_0x6a55('0x2f')](_0x2d0d67,_0xaa6a56[_0x42530d][_0x6a55('0x27')]))return;var _0x33fa35=_0xaa6a56[_0x42530d][_0x6a55('0x27')]===_0x6a55('0x81')?_0x6a55('0x28'):_0x6a55('0x29');_0x52e200['push'](db[_0x6a55('0x32')]['create']({'name':_0xaa6a56[_0x42530d][_0x6a55('0x31')],'resourceId':_0xaa6a56[_0x42530d]['id'],'type':_0x33fa35,'sectionId':_[_0x6a55('0x30')](_0x134935,[_0x6a55('0x31'),_0x33fa35])['id']},{}));}return BPromise[_0x6a55('0x4f')](_0x52e200);});})['then'](respondWithResult(_0x150d43,0xc9))[_0x6a55('0x1b')](handleError(_0x150d43,null));};exports['changePassword']=function(_0x356596,_0x561f9d){if(_0x356596['body']['id']){delete _0x356596[_0x6a55('0x59')]['id'];}return db['User'][_0x6a55('0x30')]({'where':{'id':_0x356596[_0x6a55('0x5a')]['id']}})[_0x6a55('0x11')](function(_0x44e36a){if(!_0x44e36a)return null;if(_0x44e36a['id']===_0x356596[_0x6a55('0x7a')]['id']){if(!_0x356596[_0x6a55('0x59')][_0x6a55('0x8a')]||!_0x356596[_0x6a55('0x59')][_0x6a55('0x8b')]){throw new db['Sequelize'][(_0x6a55('0x8c'))](_0x6a55('0x8d'));}if(!_0x44e36a[_0x6a55('0x8e')](_0x356596[_0x6a55('0x59')][_0x6a55('0x8a')])){throw new db[(_0x6a55('0x8f'))]['ValidationError'](_0x6a55('0x90'));}if(_0x356596[_0x6a55('0x59')][_0x6a55('0x8a')]===_0x356596[_0x6a55('0x59')][_0x6a55('0x8b')]){throw new db[(_0x6a55('0x8f'))][(_0x6a55('0x8c'))](_0x6a55('0x91'));}}else if(_0x356596[_0x6a55('0x7a')][_0x6a55('0x27')]===_0x6a55('0x7d')){if(!_0x356596[_0x6a55('0x59')][_0x6a55('0x8b')]){throw new db[(_0x6a55('0x8f'))]['ValidationError']('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x356596[_0x6a55('0x7a')]['role']===_0x6a55('0x7a')){if(!_0x356596[_0x6a55('0x59')][_0x6a55('0x8b')]){throw new db[(_0x6a55('0x8f'))][(_0x6a55('0x8c'))](_0x6a55('0x92'));}if(_0x44e36a[_0x6a55('0x27')]!==_0x6a55('0x81')){throw new db[(_0x6a55('0x8f'))][(_0x6a55('0x8c'))](_0x6a55('0x7b'));}}else{throw new db['Sequelize'][(_0x6a55('0x8c'))](_0x6a55('0x7b'));}return _0x44e36a;})[_0x6a55('0x11')](handleEntityNotFound(_0x561f9d,null))[_0x6a55('0x11')](function(_0x436d30){return db[_0x6a55('0x5f')]['findOne']({'attributes':['id',_0x6a55('0x61'),_0x6a55('0x93'),_0x6a55('0x94')]})[_0x6a55('0x11')](function(_0x2241cb){if(_0x2241cb[_0x6a55('0x61')])authService[_0x6a55('0x95')](_0x356596['body']['newPassword']);if(!_0x2241cb[_0x6a55('0x93')]||!_0x436d30['previousPasswords'])return _0x436d30;authService[_0x6a55('0x96')](_0x356596[_0x6a55('0x59')][_0x6a55('0x8b')],_0x436d30[_0x6a55('0x97')],_0x2241cb[_0x6a55('0x94')]);return _0x436d30;})[_0x6a55('0x11')](saveUpdates({'password':_0x356596[_0x6a55('0x59')][_0x6a55('0x8b')],'passwordResetAt':_0x356596[_0x6a55('0x7a')]['id']==_0x356596[_0x6a55('0x5a')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x356596[_0x6a55('0x59')]['newPassword'],_0x436d30[_0x6a55('0x97')])},null));})['then'](respondWithResult(_0x561f9d,null))['catch'](handleError(_0x561f9d,null));};exports[_0x6a55('0x98')]=function(_0xaa1b13,_0x255801){var _0x2ec17e=_0xaa1b13['body'][_0x6a55('0x99')];return db[_0x6a55('0x37')][_0x6a55('0x30')]({'where':{'id':_0xaa1b13[_0x6a55('0x5a')]['id']},'attributes':['id',_0x6a55('0x31'),_0x6a55('0x27'),_0x6a55('0x9a'),'loginInPause',_0x6a55('0x9b'),'interface']})[_0x6a55('0x11')](handleEntityNotFound(_0x255801,null))['then'](function(_0x523f9a){if(_0x523f9a){if(!utils['isValidChannel'](_0x2ec17e)){throw new db['Sequelize'][(_0x6a55('0x8c'))](_0x6a55('0x9c'));}return _0x523f9a['add'+_[_0x6a55('0x9d')](_0x2ec17e[_0x6a55('0x9e')]())+_0x6a55('0x9f')](_0xaa1b13['body'][_0x6a55('0x5d')],{'penalty':_0xaa1b13[_0x6a55('0x59')][_0x6a55('0xa0')]||0x0})[_0x6a55('0xa1')](function(_0x405057){for(var _0x5b24ef=0x0;_0x5b24ef<_0xaa1b13[_0x6a55('0x59')][_0x6a55('0x5d')]['length'];_0x5b24ef+=0x1){var _0x20b410={'UserId':Number(_0xaa1b13[_0x6a55('0x5a')]['id'])};_0x20b410[_[_0x6a55('0x9d')](_0x2ec17e['toLowerCase']())+_0x6a55('0xa2')]=Number(_0xaa1b13[_0x6a55('0x59')][_0x6a55('0x5d')][_0x5b24ef]);socket[_0x6a55('0xa3')](_0x6a55('0x7a')+_[_0x6a55('0x9d')](_0x2ec17e['toLowerCase']())+'Queue:save',_0x20b410);}return _0x405057;})[_0x6a55('0x11')](function(){if(_0x2ec17e===_0x6a55('0xa4')){return db['VoiceQueue'][_0x6a55('0x86')]({'where':{'id':_0xaa1b13[_0x6a55('0x59')]['ids']||[]},'raw':!![],'attributes':['id',_0x6a55('0x31')]});}})['then'](function(_0x16d236){var _0x4ea1e0=_0x523f9a['get']({'plain':!![]});var _0x4e2603=[];if(_0x2ec17e===_0x6a55('0xa4')&&_0x4ea1e0['role']===_0x6a55('0x81')&&_0x4ea1e0[_0x6a55('0x9a')]){for(var _0x14fe59=0x0;_0x14fe59<_0x16d236[_0x6a55('0x47')];_0x14fe59+=0x1){_0x4e2603['push']({'membername':_0x4ea1e0[_0x6a55('0x31')],'UserId':_0x4ea1e0['id'],'queue_name':_0x16d236[_0x14fe59]['name'],'VoiceQueueId':_0x16d236[_0x14fe59]['id'],'interface':_[_0x6a55('0x64')](_0x4ea1e0[_0x6a55('0xa5')])?util[_0x6a55('0xa6')]('SIP/%s',_0x4ea1e0[_0x6a55('0x31')]):_0x4ea1e0[_0x6a55('0xa5')],'paused':_0x4ea1e0[_0x6a55('0x9b')]||![],'penalty':_0xaa1b13[_0x6a55('0x59')]['penalty']||0x0});}return BPromise['each'](_0x4e2603,function(_0x2baf93){return db[_0x6a55('0xa7')][_0x6a55('0xa8')](_0x2baf93);});}return _0x523f9a;});}})[_0x6a55('0x11')](respondWithStatusCode(_0x255801,null))[_0x6a55('0x1b')](handleError(_0x255801,null));};exports[_0x6a55('0xa9')]=function(_0x2f6863,_0x68bb01){var _0x1919ec,_0x582086;return db[_0x6a55('0x37')]['find']({'where':{'id':_0x2f6863[_0x6a55('0x5a')]['id']},'attributes':['id','name','role']})['then'](handleEntityNotFound(_0x68bb01,null))[_0x6a55('0x11')](function(_0x51655a){if(_0x51655a){_0x1919ec=_0x51655a;if(!_0x2f6863[_0x6a55('0x3f')][_0x6a55('0x99')]||!utils[_0x6a55('0xaa')](_0x2f6863[_0x6a55('0x3f')]['channel'])){throw new db[(_0x6a55('0x8f'))]['ValidationError']('Unknown\x20channel');}return _0x51655a[_0x6a55('0xab')+_['capitalize'](_0x2f6863[_0x6a55('0x3f')][_0x6a55('0x99')][_0x6a55('0x9e')]())+_0x6a55('0x9f')](_0x2f6863[_0x6a55('0x3f')][_0x6a55('0x5d')]);}})[_0x6a55('0x11')](function(_0x1a516c){if(_[_0x6a55('0xac')](_0x2f6863[_0x6a55('0x3f')][_0x6a55('0x5d')])){for(var _0x5ab89e=0x0;_0x5ab89e<_0x2f6863[_0x6a55('0x3f')][_0x6a55('0x5d')]['length'];_0x5ab89e+=0x1){_0x582086={'UserId':Number(_0x2f6863[_0x6a55('0x5a')]['id'])};_0x582086[_['capitalize'](_0x2f6863[_0x6a55('0x3f')][_0x6a55('0x99')][_0x6a55('0x9e')]())+_0x6a55('0xa2')]=Number(_0x2f6863['query'][_0x6a55('0x5d')][_0x5ab89e]);socket[_0x6a55('0xa3')]('user'+_[_0x6a55('0x9d')](_0x2f6863[_0x6a55('0x3f')][_0x6a55('0x99')][_0x6a55('0x9e')]())+'Queue:remove',_0x582086);}}else{_0x582086={'UserId':Number(_0x2f6863['params']['id'])};_0x582086[_['capitalize'](_0x2f6863['query'][_0x6a55('0x99')][_0x6a55('0x9e')]())+_0x6a55('0xa2')]=Number(_0x2f6863[_0x6a55('0x3f')][_0x6a55('0x5d')]);socket[_0x6a55('0xa3')](_0x6a55('0x7a')+_[_0x6a55('0x9d')](_0x2f6863[_0x6a55('0x3f')][_0x6a55('0x99')][_0x6a55('0x9e')]())+_0x6a55('0xad'),_0x582086);}return _0x1a516c;})[_0x6a55('0x11')](function(){if(_0x2f6863[_0x6a55('0x3f')][_0x6a55('0x99')]===_0x6a55('0xa4')){return db[_0x6a55('0xa7')][_0x6a55('0x25')]({'where':{'UserId':_0x2f6863[_0x6a55('0x5a')]['id'],'VoiceQueueId':_0x2f6863[_0x6a55('0x3f')][_0x6a55('0x5d')]},'individualHooks':!![]})[_0x6a55('0x11')](function(){return _0x1919ec;});}return _0x1919ec;})[_0x6a55('0x11')](respondWithStatusCode(_0x68bb01,null))[_0x6a55('0x1b')](handleError(_0x68bb01,null));};exports['addAvatar']=function(_0x22c957,_0x580cf5){_0x22c957[_0x6a55('0x59')]['userpic']=_0x22c957[_0x6a55('0xae')][_0x6a55('0xaf')];return db['User'][_0x6a55('0x30')]({'where':{'id':_0x22c957[_0x6a55('0x5a')]['id']}})['then'](handleEntityNotFound(_0x580cf5,null))[_0x6a55('0x11')](saveUpdates(_0x22c957[_0x6a55('0x59')],null))[_0x6a55('0x11')](respondWithResult(_0x580cf5,null))[_0x6a55('0x1b')](handleError(_0x580cf5,null));};exports[_0x6a55('0xb0')]=function(_0xbc9a33,_0x7f5f5e){var _0x4bb527=path[_0x6a55('0xb1')](config[_0x6a55('0xb2')],'server/files/images/logos/default_profile.png');return db[_0x6a55('0x37')]['find']({'where':{'id':_0xbc9a33[_0x6a55('0x5a')]['id']},'attributes':['id',_0x6a55('0xb3')],'raw':!![]})['then'](handleEntityNotFound(_0x7f5f5e,null))[_0x6a55('0x11')](function(_0x49ef83){if(_0x49ef83){if(_[_0x6a55('0x64')](_0x49ef83[_0x6a55('0xb3')])){return _0x7f5f5e[_0x6a55('0xb4')](_0x4bb527);}else{if(!fs['existsSync'](path[_0x6a55('0xb1')](config[_0x6a55('0xb2')],_0x6a55('0xb5'),_0x49ef83['userpic']))){return _0x7f5f5e['download'](_0x4bb527);}return _0x7f5f5e['download'](path[_0x6a55('0xb1')](config[_0x6a55('0xb2')],_0x6a55('0xb5'),_0x49ef83[_0x6a55('0xb3')]));}}})['catch'](handleError(_0x7f5f5e,null));};exports[_0x6a55('0xb6')]=function(_0x377091,_0x5838b9){return db[_0x6a55('0x37')][_0x6a55('0x30')]({'where':{'id':_0x377091[_0x6a55('0x5a')]['id']},'attributes':['id']})[_0x6a55('0x11')](handleEntityNotFound(_0x5838b9,null))[_0x6a55('0x11')](function(_0x13d02c){var _0xcc7c5a=[];values=_0x13d02c['dataValues'];_0xcc7c5a['push'](get_open_tabs(_0x6a55('0x48'),_0x13d02c[_0x6a55('0x4a')]));_0xcc7c5a['push'](get_open_tabs(_0x6a55('0x49'),_0x13d02c['dataValues']));_0xcc7c5a['push'](get_open_tabs(_0x6a55('0x4d'),_0x13d02c[_0x6a55('0x4a')]));_0xcc7c5a[_0x6a55('0x44')](get_open_tabs(_0x6a55('0x4e'),_0x13d02c[_0x6a55('0x4a')]));_0xcc7c5a['push'](get_open_tabs('fax',_0x13d02c[_0x6a55('0x4a')]));_0xcc7c5a[_0x6a55('0x44')](get_open_tabs(_0x6a55('0x4c'),_0x13d02c[_0x6a55('0x4a')]));return BPromise[_0x6a55('0x4f')](_0xcc7c5a);})['then'](function(_0x31f3e2){if(_0x31f3e2){var _0x36dfd7=_['map'](values['ChatOpenTabs'],function(_0x378828){return{'channel':_0x6a55('0xb7'),'id':_0x378828['id'],'createdAt':_0x378828['createdAt']};});var _0x29f513=_[_0x6a55('0x2d')](values[_0x6a55('0xb8')],function(_0x200335){return{'channel':_0x6a55('0xb9'),'id':_0x200335['id'],'createdAt':_0x200335[_0x6a55('0xba')]};});var _0x209d09=_[_0x6a55('0x2d')](values[_0x6a55('0xbb')],function(_0x257066){return{'channel':_0x6a55('0xbc'),'id':_0x257066['id'],'createdAt':_0x257066[_0x6a55('0xba')]};});var _0x3e37d5=_[_0x6a55('0x2d')](values[_0x6a55('0xbd')],function(_0x2a0517){return{'channel':_0x6a55('0xbe'),'id':_0x2a0517['id'],'createdAt':_0x2a0517[_0x6a55('0xba')]};});var _0x5a63e6=_[_0x6a55('0x2d')](values[_0x6a55('0xbf')],function(_0x510a1c){return{'channel':_0x6a55('0xc0'),'id':_0x510a1c['id'],'createdAt':_0x510a1c['createdAt']};});var _0x706afb=_[_0x6a55('0x2d')](values['WhatsappOpenTabs'],function(_0x4425c9){return{'channel':_0x6a55('0xc1'),'id':_0x4425c9['id'],'createdAt':_0x4425c9[_0x6a55('0xba')]};});var _0x589e61=_['concat'](_0x36dfd7,_0x29f513,_0x209d09,_0x3e37d5,_0x5a63e6,_0x706afb);var _0x5d0821={'count':_0x589e61[_0x6a55('0x47')],'rows':_0x589e61};return _0x5d0821;}else return null;})[_0x6a55('0x11')](respondWithResult(_0x5838b9,null))[_0x6a55('0x1b')](handleError(_0x5838b9,null));};exports[_0x6a55('0xc2')]=function(_0x5f52c4,_0x149f3f){var _0x478ca5={};var _0x17447c={};var _0x5e71c8;var _0x10f028;return db[_0x6a55('0x37')][_0x6a55('0xc3')]({'where':{'id':_0x5f52c4[_0x6a55('0x5a')]['id']}})[_0x6a55('0x11')](handleEntityNotFound(_0x149f3f,null))[_0x6a55('0x11')](function(_0x14922d){if(_0x14922d){_0x5e71c8=_0x14922d;_0x17447c[_0x6a55('0x51')]=_[_0x6a55('0x52')](db[_0x6a55('0xc4')][_0x6a55('0x38')]);_0x17447c[_0x6a55('0x3f')]=_[_0x6a55('0x52')](_0x5f52c4[_0x6a55('0x3f')]);_0x17447c[_0x6a55('0x53')]=_[_0x6a55('0x54')](_0x17447c[_0x6a55('0x51')],_0x17447c[_0x6a55('0x3f')]);_0x478ca5[_0x6a55('0x43')]=_[_0x6a55('0x54')](_0x17447c[_0x6a55('0x51')],qs[_0x6a55('0x55')](_0x5f52c4[_0x6a55('0x3f')]['fields']));_0x478ca5[_0x6a55('0x43')]=_0x478ca5[_0x6a55('0x43')][_0x6a55('0x47')]?_0x478ca5[_0x6a55('0x43')]:_0x17447c[_0x6a55('0x51')];_0x478ca5[_0x6a55('0xc5')]=qs[_0x6a55('0xc6')](_0x5f52c4[_0x6a55('0x3f')][_0x6a55('0xc6')]);_0x478ca5[_0x6a55('0xc7')]=qs[_0x6a55('0x53')](_[_0x6a55('0xc8')](_0x5f52c4[_0x6a55('0x3f')],_0x17447c[_0x6a55('0x53')]));if(_0x5f52c4[_0x6a55('0x3f')][_0x6a55('0x2b')]){_0x478ca5[_0x6a55('0xc7')]=_[_0x6a55('0x56')](_0x478ca5[_0x6a55('0xc7')],{'$or':_[_0x6a55('0x2d')](_0x478ca5['attributes'],function(_0x509627){var _0x305d79={};_0x305d79[_0x509627]={'$like':'%'+_0x5f52c4[_0x6a55('0x3f')][_0x6a55('0x2b')]+'%'};return _0x305d79;})});}_0x478ca5=_[_0x6a55('0x56')]({},_0x478ca5,_0x5f52c4[_0x6a55('0x57')]);return _0x5e71c8[_0x6a55('0xc2')](_0x478ca5);}})[_0x6a55('0x11')](function(_0x452c79){if(_0x452c79){_0x10f028=_0x452c79['length'];if(_0x5f52c4[_0x6a55('0x3f')]['hasOwnProperty'](_0x6a55('0x3d'))){_0x478ca5[_0x6a55('0x3e')]=[{'model':db[_0x6a55('0xc9')],'as':_0x6a55('0xca'),'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x6a55('0x31'),'color'],'where':_0x5f52c4[_0x6a55('0x3f')][_0x6a55('0xcb')]?{'id':_0x5f52c4[_0x6a55('0x3f')][_0x6a55('0xcb')]}:undefined,'required':_0x5f52c4['query']['tag']?!![]:![]}];}if(!_0x5f52c4['query'][_0x6a55('0xcc')](_0x6a55('0xcd'))){_0x478ca5['limit']=qs[_0x6a55('0x20')](_0x5f52c4['query'][_0x6a55('0x20')]);_0x478ca5[_0x6a55('0x1e')]=qs[_0x6a55('0x1e')](_0x5f52c4[_0x6a55('0x3f')]['offset']);}return _0x5e71c8[_0x6a55('0xc2')](_0x478ca5);}})[_0x6a55('0x11')](function(_0x3a7179){if(_0x3a7179){return _0x3a7179?{'count':_0x10f028,'rows':_0x3a7179}:null;}})['then'](respondWithResult(_0x149f3f,null))['catch'](handleError(_0x149f3f,null));};exports[_0x6a55('0xce')]=function(_0x2fa720,_0x436d81){var _0x4ab2d4;var _0x3bfc5d={};var _0x47fd95;return db[_0x6a55('0x37')]['findOne']({'where':{'id':_0x2fa720[_0x6a55('0x5a')]['id']},'attributes':['id',_0x6a55('0x31'),'role']})['then'](handleEntityNotFound(_0x436d81,null))[_0x6a55('0x11')](function(_0x20a5e8){if(!utils[_0x6a55('0xaa')](_0x2fa720[_0x6a55('0x3f')][_0x6a55('0x99')])){throw new db['Sequelize'][(_0x6a55('0x8c'))](_0x6a55('0x9c'));}_0x4ab2d4=_0x20a5e8;var _0x323562={};_0x323562[_0x6a55('0x51')]=_[_0x6a55('0x52')](db[_[_0x6a55('0x9d')](_0x2fa720['query']['channel'])+_0x6a55('0xcf')][_0x6a55('0x38')]);_0x323562[_0x6a55('0x3f')]=_[_0x6a55('0x52')](_0x2fa720[_0x6a55('0x3f')]);_0x323562[_0x6a55('0x53')]=_[_0x6a55('0x54')](_0x323562[_0x6a55('0x51')],_0x323562[_0x6a55('0x3f')]);_0x3bfc5d[_0x6a55('0x43')]=_[_0x6a55('0x54')](_0x323562[_0x6a55('0x51')],qs[_0x6a55('0x55')](_0x2fa720[_0x6a55('0x3f')][_0x6a55('0x55')]));_0x3bfc5d[_0x6a55('0x43')]=_0x3bfc5d[_0x6a55('0x43')][_0x6a55('0x47')]?_0x3bfc5d[_0x6a55('0x43')]:_0x323562['model'];_0x3bfc5d[_0x6a55('0xc5')]=qs[_0x6a55('0xc6')](_0x2fa720[_0x6a55('0x3f')][_0x6a55('0xc6')]);_0x3bfc5d[_0x6a55('0xc7')]=qs['filters'](_[_0x6a55('0xc8')](_0x2fa720['query'],_0x323562[_0x6a55('0x53')]));if(_0x2fa720[_0x6a55('0x3f')]['filter']){_0x3bfc5d[_0x6a55('0xc7')]=_[_0x6a55('0x56')](_0x3bfc5d[_0x6a55('0xc7')],{'$or':_[_0x6a55('0x2d')](_0x3bfc5d[_0x6a55('0x43')],function(_0xabae72){var _0x324664={};_0x324664[_0xabae72]={'$like':'%'+_0x2fa720[_0x6a55('0x3f')]['filter']+'%'};return _0x324664;})});}_0x3bfc5d=_[_0x6a55('0x56')]({},_0x3bfc5d,_0x2fa720[_0x6a55('0x57')]);switch(_0x4ab2d4[_0x6a55('0x27')]){case'admin':return db[_[_0x6a55('0x9d')](_0x2fa720[_0x6a55('0x3f')][_0x6a55('0x99')])+_0x6a55('0xcf')][_0x6a55('0x86')](_0x3bfc5d);case'user':case _0x6a55('0x81'):return _0x4ab2d4[_0x6a55('0x26')+_['capitalize'](_0x2fa720[_0x6a55('0x3f')]['channel'])+_0x6a55('0x9f')](_0x3bfc5d);default:throw new db[(_0x6a55('0x8f'))][(_0x6a55('0x8c'))](_0x6a55('0xd0'));}})[_0x6a55('0x11')](function(_0x412435){_0x47fd95=_0x412435['length'];if(!_0x2fa720[_0x6a55('0x3f')][_0x6a55('0xcc')]('nolimit')){_0x3bfc5d[_0x6a55('0x20')]=qs['limit'](_0x2fa720[_0x6a55('0x3f')][_0x6a55('0x20')]);_0x3bfc5d['offset']=qs[_0x6a55('0x1e')](_0x2fa720['query'][_0x6a55('0x1e')]);}switch(_0x4ab2d4['role']){case _0x6a55('0x7d'):return db[_[_0x6a55('0x9d')](_0x2fa720[_0x6a55('0x3f')][_0x6a55('0x99')])+_0x6a55('0xcf')][_0x6a55('0x86')](_0x3bfc5d);case'user':case _0x6a55('0x81'):return _0x4ab2d4[_0x6a55('0x26')+_[_0x6a55('0x9d')](_0x2fa720['query'][_0x6a55('0x99')])+_0x6a55('0x9f')](_0x3bfc5d);}})[_0x6a55('0x11')](function(_0xb5e22d){return{'count':_0x47fd95,'rows':_0xb5e22d};})[_0x6a55('0x11')](respondWithResult(_0x436d81,null))[_0x6a55('0x1b')](handleError(_0x436d81,null));};exports[_0x6a55('0xd1')]=function(_0x57e6e,_0x3b7bbb){var _0x4a9140={};var _0x2883a8={};var _0x396dd2;var _0x5b21e0;return db[_0x6a55('0x37')][_0x6a55('0xc3')]({'where':{'id':_0x57e6e['params']['id']}})[_0x6a55('0x11')](handleEntityNotFound(_0x3b7bbb,null))[_0x6a55('0x11')](function(_0x5642d4){if(_0x5642d4){_0x396dd2=_0x5642d4;_0x2883a8[_0x6a55('0x51')]=_[_0x6a55('0x52')](db['UserVoiceQueueRt'][_0x6a55('0x38')]);_0x2883a8[_0x6a55('0x3f')]=_[_0x6a55('0x52')](_0x57e6e['query']);_0x2883a8['filters']=_[_0x6a55('0x54')](_0x2883a8[_0x6a55('0x51')],_0x2883a8[_0x6a55('0x3f')]);_0x4a9140['attributes']=_['intersection'](_0x2883a8[_0x6a55('0x51')],qs['fields'](_0x57e6e[_0x6a55('0x3f')][_0x6a55('0x55')]));_0x4a9140[_0x6a55('0x43')]=_0x4a9140[_0x6a55('0x43')][_0x6a55('0x47')]?_0x4a9140[_0x6a55('0x43')]:_0x2883a8[_0x6a55('0x51')];_0x4a9140[_0x6a55('0xc5')]=qs[_0x6a55('0xc6')](_0x57e6e[_0x6a55('0x3f')][_0x6a55('0xc6')]);_0x4a9140[_0x6a55('0xc7')]=qs[_0x6a55('0x53')](_[_0x6a55('0xc8')](_0x57e6e[_0x6a55('0x3f')],_0x2883a8[_0x6a55('0x53')]));if(_0x57e6e[_0x6a55('0x3f')][_0x6a55('0x2b')]){_0x4a9140[_0x6a55('0xc7')]=_[_0x6a55('0x56')](_0x4a9140[_0x6a55('0xc7')],{'$or':_['map'](_0x4a9140[_0x6a55('0x43')],function(_0x3be485){var _0x5cd85e={};_0x5cd85e[_0x3be485]={'$like':'%'+_0x57e6e[_0x6a55('0x3f')][_0x6a55('0x2b')]+'%'};return _0x5cd85e;})});}_0x4a9140=_[_0x6a55('0x56')]({},_0x4a9140,_0x57e6e[_0x6a55('0x57')]);return _0x396dd2[_0x6a55('0xd1')](_0x4a9140);}})[_0x6a55('0x11')](function(_0x4be63b){if(_0x4be63b){_0x5b21e0=_0x4be63b[_0x6a55('0x47')];if(!_0x57e6e[_0x6a55('0x3f')]['hasOwnProperty'](_0x6a55('0xcd'))){_0x4a9140[_0x6a55('0x20')]=qs[_0x6a55('0x20')](_0x57e6e[_0x6a55('0x3f')][_0x6a55('0x20')]);_0x4a9140['offset']=qs[_0x6a55('0x1e')](_0x57e6e[_0x6a55('0x3f')]['offset']);}return _0x396dd2['getVoiceQueuesRt'](_0x4a9140);}})[_0x6a55('0x11')](function(_0x570378){if(_0x570378){return _0x570378?{'count':_0x5b21e0,'rows':_0x570378}:null;}})[_0x6a55('0x11')](respondWithResult(_0x3b7bbb,null))[_0x6a55('0x1b')](handleError(_0x3b7bbb,null));};exports[_0x6a55('0xd2')]=function(_0x54cd02,_0x4c4c37){var _0x10767c={};var _0x1ab9ef={};var _0x2fdf20;var _0x4727b2;return db[_0x6a55('0x37')][_0x6a55('0xc3')]({'where':{'id':_0x54cd02['params']['id']}})['then'](handleEntityNotFound(_0x4c4c37,null))[_0x6a55('0x11')](function(_0x20a2b6){if(_0x20a2b6){_0x2fdf20=_0x20a2b6;_0x1ab9ef[_0x6a55('0x51')]=_[_0x6a55('0x52')](db['ChatGroup'][_0x6a55('0x38')]);_0x1ab9ef[_0x6a55('0x3f')]=_['keys'](_0x54cd02['query']);_0x1ab9ef[_0x6a55('0x53')]=_['intersection'](_0x1ab9ef[_0x6a55('0x51')],_0x1ab9ef[_0x6a55('0x3f')]);_0x10767c[_0x6a55('0x43')]=_[_0x6a55('0x54')](_0x1ab9ef[_0x6a55('0x51')],qs[_0x6a55('0x55')](_0x54cd02[_0x6a55('0x3f')][_0x6a55('0x55')]));_0x10767c[_0x6a55('0x43')]=_0x10767c[_0x6a55('0x43')][_0x6a55('0x47')]?_0x10767c[_0x6a55('0x43')]:_0x1ab9ef['model'];_0x10767c[_0x6a55('0xc5')]=qs['sort'](_0x54cd02[_0x6a55('0x3f')][_0x6a55('0xc6')]);_0x10767c['where']=qs[_0x6a55('0x53')](_[_0x6a55('0xc8')](_0x54cd02[_0x6a55('0x3f')],_0x1ab9ef[_0x6a55('0x53')]));if(_0x54cd02[_0x6a55('0x3f')][_0x6a55('0x2b')]){_0x10767c[_0x6a55('0xc7')]=_['merge'](_0x10767c[_0x6a55('0xc7')],{'$or':_[_0x6a55('0x2d')](_0x10767c['attributes'],function(_0xbc4387){var _0x1e47d0={};_0x1e47d0[_0xbc4387]={'$like':'%'+_0x54cd02[_0x6a55('0x3f')]['filter']+'%'};return _0x1e47d0;})});}_0x10767c=_[_0x6a55('0x56')]({},_0x10767c,_0x54cd02[_0x6a55('0x57')]);return _0x2fdf20[_0x6a55('0xd2')](_0x10767c);}})['then'](function(_0x5a4e2c){if(_0x5a4e2c){_0x4727b2=_0x5a4e2c[_0x6a55('0x47')];if(!_0x54cd02['query']['hasOwnProperty'](_0x6a55('0xcd'))){_0x10767c['limit']=qs[_0x6a55('0x20')](_0x54cd02[_0x6a55('0x3f')][_0x6a55('0x20')]);_0x10767c['offset']=qs[_0x6a55('0x1e')](_0x54cd02[_0x6a55('0x3f')]['offset']);}return _0x2fdf20[_0x6a55('0xd2')](_0x10767c);}})[_0x6a55('0x11')](function(_0x5cf7a6){if(_0x5cf7a6){return _0x5cf7a6?{'count':_0x4727b2,'rows':_0x5cf7a6}:null;}})[_0x6a55('0x11')](respondWithResult(_0x4c4c37,null))['catch'](handleError(_0x4c4c37,null));};exports[_0x6a55('0xd3')]=function(_0x5acbf9,_0x2baa40){var _0x421d03={'raw':!![],'where':{}};var _0x5d33b6={};var _0x39aa04={'count':0x0,'rows':[]};return db[_0x6a55('0x37')][_0x6a55('0xc3')]({'where':{'id':_0x5acbf9['params']['id']}})[_0x6a55('0x11')](handleEntityNotFound(_0x2baa40,null))[_0x6a55('0x11')](function(_0x61e1d4){if(_0x61e1d4){_0x5d33b6[_0x6a55('0x51')]=_['keys'](db[_0x6a55('0xd4')][_0x6a55('0x38')]);_0x5d33b6[_0x6a55('0x3f')]=_['keys'](_0x5acbf9['query']);_0x5d33b6['filters']=_[_0x6a55('0x54')](_0x5d33b6[_0x6a55('0x51')],_0x5d33b6[_0x6a55('0x3f')]);_0x421d03[_0x6a55('0x43')]=_[_0x6a55('0x54')](_0x5d33b6[_0x6a55('0x51')],qs[_0x6a55('0x55')](_0x5acbf9[_0x6a55('0x3f')][_0x6a55('0x55')]));_0x421d03[_0x6a55('0x43')]=_0x421d03['attributes'][_0x6a55('0x47')]?_0x421d03[_0x6a55('0x43')]:_0x5d33b6['model'];if(!_0x5acbf9[_0x6a55('0x3f')][_0x6a55('0xcc')](_0x6a55('0xcd'))){_0x421d03['limit']=qs[_0x6a55('0x20')](_0x5acbf9[_0x6a55('0x3f')]['limit']);_0x421d03[_0x6a55('0x1e')]=qs[_0x6a55('0x1e')](_0x5acbf9[_0x6a55('0x3f')][_0x6a55('0x1e')]);}_0x421d03[_0x6a55('0xc5')]=qs[_0x6a55('0xc6')](_0x5acbf9[_0x6a55('0x3f')][_0x6a55('0xc6')]);_0x421d03['where']=qs[_0x6a55('0x53')](_[_0x6a55('0xc8')](_0x5acbf9[_0x6a55('0x3f')],_0x5d33b6[_0x6a55('0x53')]));_0x421d03['where'][_0x6a55('0xd5')]=_0x61e1d4['id'];if(_0x5acbf9['query']['filter']){_0x421d03[_0x6a55('0xc7')]=_[_0x6a55('0x56')](_0x421d03['where'],{'$or':_[_0x6a55('0x2d')](_0x421d03[_0x6a55('0x43')],function(_0x226fac){var _0xc37680={};_0xc37680[_0x226fac]={'$like':'%'+_0x5acbf9['query'][_0x6a55('0x2b')]+'%'};return _0xc37680;})});}_0x421d03=_[_0x6a55('0x56')]({},_0x421d03,_0x5acbf9[_0x6a55('0x57')]);return db['VoiceRecording'][_0x6a55('0x21')]({'where':_0x421d03['where']})[_0x6a55('0x11')](function(_0x2f5497){_0x39aa04[_0x6a55('0x21')]=_0x2f5497;if(_0x5acbf9['query'][_0x6a55('0x3d')]){_0x421d03[_0x6a55('0x3e')]=[{'all':!![]}];}return db['VoiceRecording'][_0x6a55('0x86')](_0x421d03);})[_0x6a55('0x11')](function(_0x135713){_0x39aa04[_0x6a55('0x45')]=_0x135713;return _0x39aa04;});}})[_0x6a55('0x11')](respondWithFilteredResult(_0x2baa40,_0x421d03))[_0x6a55('0x1b')](handleError(_0x2baa40,null));};exports[_0x6a55('0xd6')]=function(_0x7018d2,_0x346c45){var _0x36225f={'raw':!![],'where':{}};var _0x464d85={};var _0x2f8e3a={'count':0x0,'rows':[]};return db[_0x6a55('0x37')][_0x6a55('0xc3')]({'where':{'id':_0x7018d2[_0x6a55('0x5a')]['id']}})[_0x6a55('0x11')](handleEntityNotFound(_0x346c45,null))[_0x6a55('0x11')](function(_0x9888b4){if(_0x9888b4){_0x464d85['model']=_[_0x6a55('0x52')](db[_0x6a55('0xd7')][_0x6a55('0x38')]);_0x464d85[_0x6a55('0x3f')]=_[_0x6a55('0x52')](_0x7018d2[_0x6a55('0x3f')]);_0x464d85['filters']=_['intersection'](_0x464d85[_0x6a55('0x51')],_0x464d85[_0x6a55('0x3f')]);_0x36225f[_0x6a55('0x43')]=_[_0x6a55('0x54')](_0x464d85[_0x6a55('0x51')],qs['fields'](_0x7018d2[_0x6a55('0x3f')][_0x6a55('0x55')]));_0x36225f[_0x6a55('0x43')]=_0x36225f[_0x6a55('0x43')]['length']?_0x36225f[_0x6a55('0x43')]:_0x464d85['model'];if(!_0x7018d2[_0x6a55('0x3f')][_0x6a55('0xcc')](_0x6a55('0xcd'))){_0x36225f[_0x6a55('0x20')]=qs[_0x6a55('0x20')](_0x7018d2['query'][_0x6a55('0x20')]);_0x36225f[_0x6a55('0x1e')]=qs['offset'](_0x7018d2[_0x6a55('0x3f')]['offset']);}_0x36225f[_0x6a55('0xc5')]=qs[_0x6a55('0xc6')](_0x7018d2['query'][_0x6a55('0xc6')]);_0x36225f['where']=qs[_0x6a55('0x53')](_[_0x6a55('0xc8')](_0x7018d2[_0x6a55('0x3f')],_0x464d85['filters']));_0x36225f[_0x6a55('0xc7')][_0x6a55('0xd5')]=_0x9888b4['id'];if(_0x7018d2['query'][_0x6a55('0x2b')]){_0x36225f[_0x6a55('0xc7')]=_[_0x6a55('0x56')](_0x36225f['where'],{'$or':_['map'](_0x36225f[_0x6a55('0x43')],function(_0x21fa7a){var _0x43d6da={};_0x43d6da[_0x21fa7a]={'$like':'%'+_0x7018d2[_0x6a55('0x3f')][_0x6a55('0x2b')]+'%'};return _0x43d6da;})});}_0x36225f=_[_0x6a55('0x56')]({},_0x36225f,_0x7018d2[_0x6a55('0x57')]);return db[_0x6a55('0xd7')]['count']({'where':_0x36225f[_0x6a55('0xc7')]})['then'](function(_0x521664){_0x2f8e3a[_0x6a55('0x21')]=_0x521664;if(_0x7018d2[_0x6a55('0x3f')][_0x6a55('0x3d')]){_0x36225f[_0x6a55('0x3e')]=[{'all':!![]}];}return db[_0x6a55('0xd7')][_0x6a55('0x86')](_0x36225f);})[_0x6a55('0x11')](function(_0x18f1fb){_0x2f8e3a[_0x6a55('0x45')]=_0x18f1fb;return _0x2f8e3a;});}})[_0x6a55('0x11')](respondWithFilteredResult(_0x346c45,_0x36225f))[_0x6a55('0x1b')](handleError(_0x346c45,null));};exports[_0x6a55('0xd8')]=function(_0x23618f,_0x345974){var _0x53b856={};var _0x8be024={};var _0x4cc9f7;var _0x184743;return db[_0x6a55('0x37')][_0x6a55('0xc3')]({'where':{'id':_0x23618f[_0x6a55('0x5a')]['id']}})[_0x6a55('0x11')](handleEntityNotFound(_0x345974,null))[_0x6a55('0x11')](function(_0x56e4ab){if(_0x56e4ab){_0x4cc9f7=_0x56e4ab;_0x8be024['model']=_[_0x6a55('0x52')](db[_0x6a55('0xd9')]['rawAttributes']);_0x8be024[_0x6a55('0x3f')]=_[_0x6a55('0x52')](_0x23618f[_0x6a55('0x3f')]);_0x8be024[_0x6a55('0x53')]=_['intersection'](_0x8be024[_0x6a55('0x51')],_0x8be024[_0x6a55('0x3f')]);_0x53b856[_0x6a55('0x43')]=_['intersection'](_0x8be024[_0x6a55('0x51')],qs['fields'](_0x23618f['query']['fields']));_0x53b856[_0x6a55('0x43')]=_0x53b856[_0x6a55('0x43')][_0x6a55('0x47')]?_0x53b856['attributes']:_0x8be024['model'];_0x53b856[_0x6a55('0xc5')]=qs['sort'](_0x23618f[_0x6a55('0x3f')]['sort']);_0x53b856[_0x6a55('0xc7')]=qs['filters'](_[_0x6a55('0xc8')](_0x23618f['query'],_0x8be024[_0x6a55('0x53')]));if(_0x23618f[_0x6a55('0x3f')][_0x6a55('0x2b')]){_0x53b856[_0x6a55('0xc7')]=_[_0x6a55('0x56')](_0x53b856[_0x6a55('0xc7')],{'$or':_[_0x6a55('0x2d')](_0x53b856[_0x6a55('0x43')],function(_0x363c81){var _0x116e78={};_0x116e78[_0x363c81]={'$like':'%'+_0x23618f[_0x6a55('0x3f')][_0x6a55('0x2b')]+'%'};return _0x116e78;})});}_0x53b856=_[_0x6a55('0x56')]({},_0x53b856,_0x23618f[_0x6a55('0x57')]);return _0x4cc9f7['getChatInteractions'](_0x53b856);}})[_0x6a55('0x11')](function(_0x157ac3){if(_0x157ac3){_0x184743=_0x157ac3[_0x6a55('0x47')];if(!_0x23618f[_0x6a55('0x3f')][_0x6a55('0xcc')]('nolimit')){_0x53b856[_0x6a55('0x20')]=qs[_0x6a55('0x20')](_0x23618f[_0x6a55('0x3f')][_0x6a55('0x20')]);_0x53b856[_0x6a55('0x1e')]=qs[_0x6a55('0x1e')](_0x23618f[_0x6a55('0x3f')]['offset']);}return _0x4cc9f7[_0x6a55('0xd8')](_0x53b856);}})[_0x6a55('0x11')](function(_0x25c4a2){if(_0x25c4a2){return _0x25c4a2?{'count':_0x184743,'rows':_0x25c4a2}:null;}})[_0x6a55('0x11')](respondWithResult(_0x345974,null))['catch'](handleError(_0x345974,null));};exports[_0x6a55('0xda')]=function(_0x182329,_0x50674d){var _0x5756c0={};var _0x30f746={};var _0x22ada4;var _0x2917e5;return db[_0x6a55('0x37')][_0x6a55('0xc3')]({'where':{'id':_0x182329[_0x6a55('0x5a')]['id']}})['then'](handleEntityNotFound(_0x50674d,null))['then'](function(_0xc61498){if(_0xc61498){_0x22ada4=_0xc61498;_0x30f746['model']=_['keys'](db[_0x6a55('0xdb')][_0x6a55('0x38')]);_0x30f746[_0x6a55('0x3f')]=_['keys'](_0x182329['query']);_0x30f746[_0x6a55('0x53')]=_[_0x6a55('0x54')](_0x30f746['model'],_0x30f746[_0x6a55('0x3f')]);_0x5756c0[_0x6a55('0x43')]=_['intersection'](_0x30f746[_0x6a55('0x51')],qs[_0x6a55('0x55')](_0x182329[_0x6a55('0x3f')][_0x6a55('0x55')]));_0x5756c0[_0x6a55('0x43')]=_0x5756c0[_0x6a55('0x43')][_0x6a55('0x47')]?_0x5756c0[_0x6a55('0x43')]:_0x30f746['model'];_0x5756c0[_0x6a55('0xc5')]=qs[_0x6a55('0xc6')](_0x182329[_0x6a55('0x3f')]['sort']);_0x5756c0[_0x6a55('0xc7')]=qs[_0x6a55('0x53')](_[_0x6a55('0xc8')](_0x182329[_0x6a55('0x3f')],_0x30f746[_0x6a55('0x53')]));if(_0x182329[_0x6a55('0x3f')]['filter']){_0x5756c0[_0x6a55('0xc7')]=_[_0x6a55('0x56')](_0x5756c0[_0x6a55('0xc7')],{'$or':_[_0x6a55('0x2d')](_0x5756c0[_0x6a55('0x43')],function(_0x25051e){var _0x1e7e33={};_0x1e7e33[_0x25051e]={'$like':'%'+_0x182329[_0x6a55('0x3f')][_0x6a55('0x2b')]+'%'};return _0x1e7e33;})});}_0x5756c0=_[_0x6a55('0x56')]({},_0x5756c0,_0x182329['options']);return _0x22ada4[_0x6a55('0xda')](_0x5756c0);}})[_0x6a55('0x11')](function(_0x4e0b6d){if(_0x4e0b6d){_0x2917e5=_0x4e0b6d[_0x6a55('0x47')];if(!_0x182329[_0x6a55('0x3f')][_0x6a55('0xcc')]('nolimit')){_0x5756c0[_0x6a55('0x20')]=qs[_0x6a55('0x20')](_0x182329['query'][_0x6a55('0x20')]);_0x5756c0[_0x6a55('0x1e')]=qs[_0x6a55('0x1e')](_0x182329[_0x6a55('0x3f')]['offset']);}return _0x22ada4[_0x6a55('0xda')](_0x5756c0);}})[_0x6a55('0x11')](function(_0xa37614){if(_0xa37614){return _0xa37614?{'count':_0x2917e5,'rows':_0xa37614}:null;}})['then'](respondWithResult(_0x50674d,null))[_0x6a55('0x1b')](handleError(_0x50674d,null));};exports['getMailInteractions']=function(_0x3016cc,_0x2fa42b){var _0x5063a0={'raw':!![],'where':{}};var _0x1ba576={};var _0x53b89e={'count':0x0,'rows':[]};return db['User']['findOne']({'where':{'id':_0x3016cc[_0x6a55('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2fa42b,null))[_0x6a55('0x11')](function(_0x1f7d55){if(_0x1f7d55){_0x1ba576['model']=_[_0x6a55('0x52')](db[_0x6a55('0xdc')]['rawAttributes']);_0x1ba576[_0x6a55('0x3f')]=_[_0x6a55('0x52')](_0x3016cc[_0x6a55('0x3f')]);_0x1ba576['filters']=_['intersection'](_0x1ba576[_0x6a55('0x51')],_0x1ba576['query']);_0x5063a0[_0x6a55('0x43')]=_[_0x6a55('0x54')](_0x1ba576[_0x6a55('0x51')],qs[_0x6a55('0x55')](_0x3016cc['query']['fields']));_0x5063a0['attributes']=_0x5063a0['attributes'][_0x6a55('0x47')]?_0x5063a0[_0x6a55('0x43')]:_0x1ba576['model'];if(!_0x3016cc[_0x6a55('0x3f')][_0x6a55('0xcc')](_0x6a55('0xcd'))){_0x5063a0[_0x6a55('0x20')]=qs[_0x6a55('0x20')](_0x3016cc[_0x6a55('0x3f')]['limit']);_0x5063a0['offset']=qs[_0x6a55('0x1e')](_0x3016cc[_0x6a55('0x3f')][_0x6a55('0x1e')]);}_0x5063a0['order']=qs[_0x6a55('0xc6')](_0x3016cc[_0x6a55('0x3f')][_0x6a55('0xc6')]);_0x5063a0[_0x6a55('0xc7')]=qs['filters'](_[_0x6a55('0xc8')](_0x3016cc[_0x6a55('0x3f')],_0x1ba576[_0x6a55('0x53')]));_0x5063a0[_0x6a55('0xc7')][_0x6a55('0xd5')]=_0x1f7d55['id'];if(_0x3016cc[_0x6a55('0x3f')][_0x6a55('0x2b')]){_0x5063a0[_0x6a55('0xc7')]=_[_0x6a55('0x56')](_0x5063a0[_0x6a55('0xc7')],{'$or':_[_0x6a55('0x2d')](_0x5063a0[_0x6a55('0x43')],function(_0x379a1e){var _0x3b0ba1={};_0x3b0ba1[_0x379a1e]={'$like':'%'+_0x3016cc['query']['filter']+'%'};return _0x3b0ba1;})});}_0x5063a0=_['merge']({},_0x5063a0,_0x3016cc['options']);return db[_0x6a55('0xdc')][_0x6a55('0x21')]({'where':_0x5063a0[_0x6a55('0xc7')]})[_0x6a55('0x11')](function(_0x4384d1){_0x53b89e[_0x6a55('0x21')]=_0x4384d1;if(_0x3016cc['query'][_0x6a55('0x3d')]){_0x5063a0[_0x6a55('0x3e')]=[{'all':!![]}];}return db[_0x6a55('0xdc')][_0x6a55('0x86')](_0x5063a0);})['then'](function(_0x4e8da8){_0x53b89e[_0x6a55('0x45')]=_0x4e8da8;return _0x53b89e;});}})['then'](respondWithFilteredResult(_0x2fa42b,_0x5063a0))[_0x6a55('0x1b')](handleError(_0x2fa42b,null));};exports[_0x6a55('0xdd')]=function(_0x227b26,_0x420533){var _0x332b87={};var _0x358d1e={};var _0x50d83f;var _0x17c1bd;return db[_0x6a55('0x37')][_0x6a55('0xc3')]({'where':{'id':_0x227b26[_0x6a55('0x5a')]['id']}})[_0x6a55('0x11')](handleEntityNotFound(_0x420533,null))[_0x6a55('0x11')](function(_0x4f7dde){if(_0x4f7dde){_0x50d83f=_0x4f7dde;_0x358d1e['model']=_['keys'](db[_0x6a55('0xde')][_0x6a55('0x38')]);_0x358d1e[_0x6a55('0x3f')]=_[_0x6a55('0x52')](_0x227b26[_0x6a55('0x3f')]);_0x358d1e[_0x6a55('0x53')]=_[_0x6a55('0x54')](_0x358d1e[_0x6a55('0x51')],_0x358d1e[_0x6a55('0x3f')]);_0x332b87['attributes']=_['intersection'](_0x358d1e[_0x6a55('0x51')],qs[_0x6a55('0x55')](_0x227b26[_0x6a55('0x3f')][_0x6a55('0x55')]));_0x332b87[_0x6a55('0x43')]=_0x332b87['attributes'][_0x6a55('0x47')]?_0x332b87['attributes']:_0x358d1e['model'];_0x332b87[_0x6a55('0xc5')]=qs['sort'](_0x227b26['query'][_0x6a55('0xc6')]);_0x332b87[_0x6a55('0xc7')]=qs[_0x6a55('0x53')](_[_0x6a55('0xc8')](_0x227b26['query'],_0x358d1e[_0x6a55('0x53')]));if(_0x227b26['query'][_0x6a55('0x2b')]){_0x332b87[_0x6a55('0xc7')]=_['merge'](_0x332b87['where'],{'$or':_[_0x6a55('0x2d')](_0x332b87[_0x6a55('0x43')],function(_0x3d8a20){var _0x402312={};_0x402312[_0x3d8a20]={'$like':'%'+_0x227b26[_0x6a55('0x3f')][_0x6a55('0x2b')]+'%'};return _0x402312;})});}_0x332b87=_[_0x6a55('0x56')]({},_0x332b87,_0x227b26['options']);return _0x50d83f[_0x6a55('0xdd')](_0x332b87);}})[_0x6a55('0x11')](function(_0xdad5db){if(_0xdad5db){_0x17c1bd=_0xdad5db[_0x6a55('0x47')];if(!_0x227b26[_0x6a55('0x3f')][_0x6a55('0xcc')]('nolimit')){_0x332b87[_0x6a55('0x20')]=qs[_0x6a55('0x20')](_0x227b26['query'][_0x6a55('0x20')]);_0x332b87[_0x6a55('0x1e')]=qs['offset'](_0x227b26['query'][_0x6a55('0x1e')]);}return _0x50d83f[_0x6a55('0xdd')](_0x332b87);}})[_0x6a55('0x11')](function(_0x54ba31){if(_0x54ba31){return _0x54ba31?{'count':_0x17c1bd,'rows':_0x54ba31}:null;}})[_0x6a55('0x11')](respondWithResult(_0x420533,null))['catch'](handleError(_0x420533,null));};exports[_0x6a55('0xdf')]=function(_0x4bed72,_0x348e56){var _0x43f4cb={};var _0x201bde={};var _0x3837a6;var _0x4ba34b;return db['User'][_0x6a55('0xc3')]({'where':{'id':_0x4bed72['params']['id']}})[_0x6a55('0x11')](handleEntityNotFound(_0x348e56,null))[_0x6a55('0x11')](function(_0x31d8e0){if(_0x31d8e0){_0x3837a6=_0x31d8e0;_0x201bde['model']=_[_0x6a55('0x52')](db['FaxInteraction'][_0x6a55('0x38')]);_0x201bde[_0x6a55('0x3f')]=_[_0x6a55('0x52')](_0x4bed72[_0x6a55('0x3f')]);_0x201bde[_0x6a55('0x53')]=_[_0x6a55('0x54')](_0x201bde[_0x6a55('0x51')],_0x201bde[_0x6a55('0x3f')]);_0x43f4cb[_0x6a55('0x43')]=_[_0x6a55('0x54')](_0x201bde[_0x6a55('0x51')],qs['fields'](_0x4bed72['query'][_0x6a55('0x55')]));_0x43f4cb['attributes']=_0x43f4cb[_0x6a55('0x43')][_0x6a55('0x47')]?_0x43f4cb[_0x6a55('0x43')]:_0x201bde[_0x6a55('0x51')];_0x43f4cb[_0x6a55('0xc5')]=qs[_0x6a55('0xc6')](_0x4bed72['query']['sort']);_0x43f4cb[_0x6a55('0xc7')]=qs[_0x6a55('0x53')](_[_0x6a55('0xc8')](_0x4bed72[_0x6a55('0x3f')],_0x201bde['filters']));if(_0x4bed72[_0x6a55('0x3f')][_0x6a55('0x2b')]){_0x43f4cb['where']=_[_0x6a55('0x56')](_0x43f4cb[_0x6a55('0xc7')],{'$or':_['map'](_0x43f4cb[_0x6a55('0x43')],function(_0x3f25c8){var _0x55498c={};_0x55498c[_0x3f25c8]={'$like':'%'+_0x4bed72[_0x6a55('0x3f')][_0x6a55('0x2b')]+'%'};return _0x55498c;})});}_0x43f4cb=_[_0x6a55('0x56')]({},_0x43f4cb,_0x4bed72[_0x6a55('0x57')]);return _0x3837a6['getFaxInteractions'](_0x43f4cb);}})[_0x6a55('0x11')](function(_0x3b47e9){if(_0x3b47e9){_0x4ba34b=_0x3b47e9['length'];if(!_0x4bed72[_0x6a55('0x3f')][_0x6a55('0xcc')](_0x6a55('0xcd'))){_0x43f4cb['limit']=qs[_0x6a55('0x20')](_0x4bed72[_0x6a55('0x3f')][_0x6a55('0x20')]);_0x43f4cb[_0x6a55('0x1e')]=qs[_0x6a55('0x1e')](_0x4bed72[_0x6a55('0x3f')][_0x6a55('0x1e')]);}return _0x3837a6['getFaxInteractions'](_0x43f4cb);}})[_0x6a55('0x11')](function(_0x1b6a36){if(_0x1b6a36){return _0x1b6a36?{'count':_0x4ba34b,'rows':_0x1b6a36}:null;}})[_0x6a55('0x11')](respondWithResult(_0x348e56,null))[_0x6a55('0x1b')](handleError(_0x348e56,null));};exports[_0x6a55('0xe0')]=function(_0x20745f,_0x3c8e27){var _0x11a9ed={};var _0x43ccd2={};var _0x1fcffa;var _0x27a97f;return db['User']['findOne']({'where':{'id':_0x20745f[_0x6a55('0x5a')]['id']}})[_0x6a55('0x11')](handleEntityNotFound(_0x3c8e27,null))[_0x6a55('0x11')](function(_0x2fdaae){if(_0x2fdaae){_0x1fcffa=_0x2fdaae;_0x43ccd2['model']=_[_0x6a55('0x52')](db[_0x6a55('0xe1')][_0x6a55('0x38')]);_0x43ccd2['query']=_[_0x6a55('0x52')](_0x20745f['query']);_0x43ccd2[_0x6a55('0x53')]=_[_0x6a55('0x54')](_0x43ccd2[_0x6a55('0x51')],_0x43ccd2['query']);_0x11a9ed[_0x6a55('0x43')]=_[_0x6a55('0x54')](_0x43ccd2[_0x6a55('0x51')],qs[_0x6a55('0x55')](_0x20745f[_0x6a55('0x3f')]['fields']));_0x11a9ed[_0x6a55('0x43')]=_0x11a9ed[_0x6a55('0x43')][_0x6a55('0x47')]?_0x11a9ed['attributes']:_0x43ccd2[_0x6a55('0x51')];_0x11a9ed[_0x6a55('0xc5')]=qs['sort'](_0x20745f['query'][_0x6a55('0xc6')]);_0x11a9ed['where']=qs[_0x6a55('0x53')](_[_0x6a55('0xc8')](_0x20745f[_0x6a55('0x3f')],_0x43ccd2[_0x6a55('0x53')]));if(_0x20745f['query'][_0x6a55('0x2b')]){_0x11a9ed['where']=_[_0x6a55('0x56')](_0x11a9ed[_0x6a55('0xc7')],{'$or':_[_0x6a55('0x2d')](_0x11a9ed['attributes'],function(_0x48c289){var _0x2a5e13={};_0x2a5e13[_0x48c289]={'$like':'%'+_0x20745f[_0x6a55('0x3f')][_0x6a55('0x2b')]+'%'};return _0x2a5e13;})});}_0x11a9ed=_[_0x6a55('0x56')]({},_0x11a9ed,_0x20745f[_0x6a55('0x57')]);return _0x1fcffa[_0x6a55('0xe0')](_0x11a9ed);}})[_0x6a55('0x11')](function(_0x1580cc){if(_0x1580cc){_0x27a97f=_0x1580cc[_0x6a55('0x47')];if(!_0x20745f[_0x6a55('0x3f')][_0x6a55('0xcc')](_0x6a55('0xcd'))){_0x11a9ed['limit']=qs['limit'](_0x20745f[_0x6a55('0x3f')]['limit']);_0x11a9ed[_0x6a55('0x1e')]=qs[_0x6a55('0x1e')](_0x20745f[_0x6a55('0x3f')][_0x6a55('0x1e')]);}return _0x1fcffa[_0x6a55('0xe0')](_0x11a9ed);}})['then'](function(_0x2b88e5){if(_0x2b88e5){return _0x2b88e5?{'count':_0x27a97f,'rows':_0x2b88e5}:null;}})[_0x6a55('0x11')](respondWithResult(_0x3c8e27,null))[_0x6a55('0x1b')](handleError(_0x3c8e27,null));};exports['login']=function(_0x183b97,_0x36144c,_0x6707de){var _0x32dd48;var _0x2ca332;var _0x369052;var _0x588ce0=!_[_0x6a55('0x64')](_0x183b97[_0x6a55('0x5a')]['id'])?_0x183b97['params']['id']:!_['isNil'](_0x183b97['user']['id'])?_0x183b97[_0x6a55('0x7a')]['id']:null;return db[_0x6a55('0x37')][_0x6a55('0x30')]({'where':{'id':_0x588ce0,'role':{'$or':[_0x6a55('0x7d'),_0x6a55('0x7a'),_0x6a55('0x81')]}},'attributes':['id',_0x6a55('0x31'),_0x6a55('0xe2'),_0x6a55('0xe3'),'role',_0x6a55('0x62'),_0x6a55('0xe4')]})[_0x6a55('0x11')](function(_0x5e8bfc){if(_0x5e8bfc){if(_0x5e8bfc[_0x6a55('0x27')]===_0x6a55('0x81')){_0x32dd48=_0x5e8bfc;if(_0x183b97[_0x6a55('0x59')][_0x6a55('0xa5')]){_0x369052=util[_0x6a55('0xa6')]('LOCAL/%s@from-sip/n',_0x32dd48[_0x183b97[_0x6a55('0x59')]['interface']]);}else if(_0x183b97[_0x6a55('0x59')][_0x6a55('0xe5')]){_0x369052=util[_0x6a55('0xa6')]('SIP/%s',_0x183b97['body'][_0x6a55('0xe5')]);}else{_0x369052=util[_0x6a55('0xa6')](_0x6a55('0xe6'),_0x32dd48[_0x6a55('0x31')]);}socket['to'](util[_0x6a55('0xa6')]('user:%s',_0x32dd48[_0x6a55('0x31')]))[_0x6a55('0xa3')](_0x6a55('0xe7'),{'user':{'id':_0x32dd48['id'],'name':_0x32dd48['name']},'ip':_0x183b97[_0x6a55('0xe8')]['x-forwarded-for']||_0x183b97[_0x6a55('0xe9')][_0x6a55('0xea')]||_0x183b97[_0x6a55('0xeb')]['remoteAddress']||_0x183b97[_0x6a55('0xe9')]['socket'][_0x6a55('0xea')]});return db[_0x6a55('0xa7')][_0x6a55('0x25')]({'where':{'membername':_0x32dd48['name']},'individualHooks':!![]});}}else{throw new db[(_0x6a55('0x8f'))]['ValidationError'](_0x6a55('0xec'));}})['then'](function(){if(_0x32dd48){return _0x32dd48[_0x6a55('0xed')]({'raw':!![]});}})['then'](function(_0x5f56df){if(_0x32dd48){var _0xf3c49a=[];if(_0x5f56df){_0x2ca332=_0x5f56df;if(_0x2ca332[_0x6a55('0x47')]){for(var _0x35ca3c=0x0;_0x35ca3c<_0x2ca332[_0x6a55('0x47')];_0x35ca3c++){_0xf3c49a[_0x6a55('0x44')]({'membername':_0x32dd48[_0x6a55('0x31')],'UserId':_0x32dd48['id'],'queue_name':_0x2ca332[_0x35ca3c][_0x6a55('0x31')],'VoiceQueueId':_0x2ca332[_0x35ca3c]['id'],'interface':_0x369052,'paused':_0x32dd48[_0x6a55('0xe4')]||![],'penalty':_0x2ca332[_0x35ca3c][_0x6a55('0xee')]||0x0});}return BPromise[_0x6a55('0xef')](_0xf3c49a,function(_0x4c5dbd){return db[_0x6a55('0xa7')][_0x6a55('0xa8')](_0x4c5dbd);});}}}})[_0x6a55('0x11')](function(){if(_0x32dd48){return db[_0x6a55('0xf0')]['findAll']({'where':{'membername':_0x32dd48[_0x6a55('0x31')],'exitAt':null}});}})['then'](function(_0x3f5cf0){if(_0x32dd48){var _0x361218=[];_0x3f5cf0['forEach'](function(_0x3d62f6){_0x361218[_0x6a55('0x44')](_0x3d62f6[_0x6a55('0x58')]({'exitAt':moment()[_0x6a55('0xa6')](_0x6a55('0xf1'))}));});return BPromise[_0x6a55('0x4f')](_0x361218);}})[_0x6a55('0x11')](function(){if(_0x32dd48){var _0x3d8c62=[];var _0x4a62db=[];var _0x42ae8b=utils['getChannels']();var _0x2d392f={'membername':_0x32dd48['name'],'interface':_0x369052,'enterAt':moment()[_0x6a55('0xa6')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x32dd48['role'],'internal':_0x32dd48[_0x6a55('0x62')]};_0x42ae8b[_0x6a55('0xf2')](function(_0x2cc9f2){_0x3d8c62[_0x6a55('0x44')](_[_0x6a55('0x56')]({'channel':_0x2cc9f2,'type':_0x6a55('0xf3'),'data1':_0x183b97[_0x6a55('0x59')][_0x6a55('0xf4')],'data2':_0x369052},_0x2d392f));if(_0x32dd48[_0x6a55('0xe4')]){_0x4a62db[_0x6a55('0x44')](_[_0x6a55('0x56')]({'channel':_0x2cc9f2,'type':_0x6a55('0xf5'),'data1':_0x6a55('0xf6')},_0x2d392f));}});return db['MemberReport'][_0x6a55('0xf7')](_0x3d8c62[_0x6a55('0xf8')](_0x4a62db),{'individualHooks':!![]});}})['then'](function(){if(_0x32dd48){return _0x32dd48['update']({'online':!![],'lastLoginAt':moment()[_0x6a55('0xa6')](_0x6a55('0xf1')),'voicePause':_0x32dd48['loginInPause']||![],'mailPause':_0x32dd48[_0x6a55('0xe4')]||![],'chatPause':_0x32dd48[_0x6a55('0xe4')]||![],'faxPause':_0x32dd48[_0x6a55('0xe4')]||![],'smsPause':_0x32dd48[_0x6a55('0xe4')]||![],'openchannelPause':_0x32dd48[_0x6a55('0xe4')]||![],'whatsappPause':_0x32dd48[_0x6a55('0xe4')]||![],'pauseType':_0x32dd48[_0x6a55('0xe4')]?_0x6a55('0xf6'):null,'interface':_0x369052,'lastPauseAt':moment()[_0x6a55('0xa6')](_0x6a55('0xf1'))});}})[_0x6a55('0x11')](function(_0x287256){if(_0x183b97['isMiddleware']){return _0x6707de();}else{return BPromise[_0x6a55('0xf9')](_0x287256)[_0x6a55('0x11')](respondWithResult(_0x36144c,null));}})[_0x6a55('0x1b')](handleError(_0x36144c,null));};exports[_0x6a55('0xfa')]=function(_0x18eadf,_0x680f4){var _0xa21986;return db[_0x6a55('0x37')][_0x6a55('0x30')]({'where':{'id':_0x18eadf[_0x6a55('0x5a')]['id'],'role':_0x6a55('0x81')},'attributes':['id',_0x6a55('0x31'),_0x6a55('0x27')]})['then'](handleEntityNotFound(_0x680f4,null))[_0x6a55('0x11')](function(_0x35cb8f){if(_0x35cb8f){_0xa21986=_0x35cb8f;return db['UserVoiceQueueRt'][_0x6a55('0x25')]({'where':{'membername':_0xa21986['name']},'individualHooks':!![]});}})[_0x6a55('0x11')](function(){return db[_0x6a55('0xf0')][_0x6a55('0x86')]({'where':{'membername':_0xa21986[_0x6a55('0x31')],'exitAt':null}});})[_0x6a55('0x11')](function(_0x2b827e){var _0x1d0cb1=[];_0x2b827e[_0x6a55('0xf2')](function(_0x5e5729){_0x1d0cb1[_0x6a55('0x44')](_0x5e5729['update']({'exitAt':moment()[_0x6a55('0xa6')](_0x6a55('0xf1'))}));});return BPromise[_0x6a55('0x4f')](_0x1d0cb1);})['then'](function(){return _0xa21986[_0x6a55('0x58')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x6a55('0x11')](respondWithResult(_0x680f4,null))[_0x6a55('0x1b')](handleError(_0x680f4,null));};exports[_0x6a55('0xfb')]=function(_0x421c36,_0x1e1ad7){var _0x5004bb;return db['UserVoiceQueueRt'][_0x6a55('0x58')]({'paused':0x1},{'where':{'UserId':_0x421c36[_0x6a55('0x5a')]['id']},'individualHooks':!![]})[_0x6a55('0x11')](function(){return db[_0x6a55('0x37')][_0x6a55('0x30')]({'where':{'id':_0x421c36['params']['id'],'role':'agent'},'attributes':['id',_0x6a55('0x31'),_0x6a55('0x27'),_0x6a55('0x62'),_0x6a55('0xa5')]});})[_0x6a55('0x11')](handleEntityNotFound(_0x1e1ad7,null))[_0x6a55('0x11')](function(_0x4565cf){if(_0x4565cf){_0x5004bb=_0x4565cf;return respondWithRpcPromise(_0x6a55('0xfc'),_0x6a55('0xfb'),{'id':_0x5004bb['id'],'name':_0x5004bb[_0x6a55('0x31')],'pause':!![]});}})[_0x6a55('0x11')](function(){if(_0x5004bb){return db['MemberReport'][_0x6a55('0x86')]({'where':{'membername':_0x5004bb[_0x6a55('0x31')],'type':'PAUSE','exitAt':null}});}})['then'](function(_0x4dc11d){if(_0x4dc11d['length']){var _0x3f875d=moment()[_0x6a55('0xa6')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x2dde3a=0x0,_0xb638aa=_0x4dc11d[_0x6a55('0x47')];_0x2dde3a<_0xb638aa;_0x2dde3a++){_0x4dc11d[_0x2dde3a][_0x6a55('0xfd')]({'exitAt':_0x3f875d});}}})[_0x6a55('0x11')](function(){var _0x27c448=[];var _0x666518=utils[_0x6a55('0xfe')]();_0x666518[_0x6a55('0xf2')](function(_0x4c36ae){_0x27c448[_0x6a55('0x44')]({'channel':_0x4c36ae,'membername':_0x5004bb[_0x6a55('0x31')],'interface':_[_0x6a55('0x64')](_0x5004bb[_0x6a55('0xa5')])?util[_0x6a55('0xa6')]('SIP/%s',_0x5004bb[_0x6a55('0x31')]):_0x5004bb[_0x6a55('0xa5')],'type':_0x6a55('0xf5'),'enterAt':moment()[_0x6a55('0xa6')](_0x6a55('0xf1')),'data1':_0x421c36[_0x6a55('0x59')]['type']||_0x6a55('0xff'),'role':_0x5004bb[_0x6a55('0x27')],'internal':_0x5004bb[_0x6a55('0x62')]});});return db[_0x6a55('0xf0')][_0x6a55('0xf7')](_0x27c448,{'individualHooks':!![]});})[_0x6a55('0x11')](function(){return _0x5004bb[_0x6a55('0x58')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x421c36[_0x6a55('0x59')]['type']||_0x6a55('0xff'),'lastPauseAt':moment()[_0x6a55('0xa6')](_0x6a55('0xf1'))});})[_0x6a55('0x11')](respondWithResult(_0x1e1ad7,null))['catch'](handleError(_0x1e1ad7,null));};exports[_0x6a55('0x100')]=function(_0x6c9e0f,_0x4f19f2){var _0x29b151;return db['User'][_0x6a55('0x30')]({'where':{'id':_0x6c9e0f[_0x6a55('0x5a')]['id']},'attributes':['id',_0x6a55('0x31'),_0x6a55('0x27'),_0x6a55('0x9b'),_0x6a55('0x101'),'chatPause','faxPause','openchannelPause','smsPause','whatsapppause',_0x6a55('0x102'),'lastPauseAt']})[_0x6a55('0x11')](handleEntityNotFound(_0x4f19f2,null))[_0x6a55('0x11')](function(_0x11eb81){if(_0x11eb81){_0x29b151=_0x11eb81;if(_0x6c9e0f['body'][_0x6a55('0x99')]&&!utils[_0x6a55('0xaa')](_0x6c9e0f[_0x6a55('0x59')]['channel'])){throw new db[(_0x6a55('0x8f'))][(_0x6a55('0x8c'))](_0x6a55('0x9c'));}switch(_0x6c9e0f['body'][_0x6a55('0x99')]){case _0x6a55('0xa4'):return respondWithRpcPromise(_0x6a55('0xfc'),'unpause',{'id':_0x29b151['id'],'name':_0x29b151[_0x6a55('0x31')],'pause':![]})['then'](function(){return db[_0x6a55('0xa7')][_0x6a55('0x58')]({'paused':0x0},{'where':{'UserId':_0x29b151['id']},'individualHooks':!![]});})[_0x6a55('0x11')](function(){return db['MemberReport'][_0x6a55('0x30')]({'where':{'channel':_0x6c9e0f['body'][_0x6a55('0x99')],'membername':_0x29b151[_0x6a55('0x31')],'type':_0x6a55('0xf5'),'exitAt':null}});})['then'](function(_0x5d6316){if(_0x5d6316){return _0x5d6316[_0x6a55('0x58')]({'exitAt':moment()[_0x6a55('0xa6')](_0x6a55('0xf1')),'data2':_0x6a55('0x103')},{'individualHooks':!![]});}return null;})[_0x6a55('0x11')](function(){return _0x29b151['update']({'voicePause':![]});});case _0x6a55('0x4c'):case _0x6a55('0x48'):case _0x6a55('0x4b'):case'sms':case _0x6a55('0x4e'):case _0x6a55('0x4d'):return db[_0x6a55('0xf0')][_0x6a55('0x30')]({'where':{'channel':_0x6c9e0f[_0x6a55('0x59')]['channel'],'membername':_0x29b151[_0x6a55('0x31')],'type':'PAUSE','exitAt':null}})[_0x6a55('0x11')](function(_0x1d84fe){if(_0x1d84fe){return _0x1d84fe[_0x6a55('0x58')]({'exitAt':moment()[_0x6a55('0xa6')](_0x6a55('0xf1')),'data2':_0x6a55('0x103')},{'individualHooks':!![]});}return null;})[_0x6a55('0x11')](function(){var _0x1feb5c={};_[_0x6a55('0x22')](_0x1feb5c,util[_0x6a55('0xa6')](_0x6a55('0x104'),_0x6c9e0f[_0x6a55('0x59')][_0x6a55('0x99')],_0x6a55('0x105')),![]);return _0x29b151[_0x6a55('0x58')](_0x1feb5c);});default:return respondWithRpcPromise(_0x6a55('0xfc'),_0x6a55('0x100'),{'id':_0x29b151['id'],'name':_0x29b151[_0x6a55('0x31')],'pause':![]})['then'](function(){return db['UserVoiceQueueRt'][_0x6a55('0x58')]({'paused':0x0},{'where':{'UserId':_0x29b151['id']}});})['then'](function(){return db[_0x6a55('0xf0')][_0x6a55('0x86')]({'where':{'membername':_0x29b151[_0x6a55('0x31')],'type':_0x6a55('0xf5'),'exitAt':null}});})[_0x6a55('0x11')](function(_0x1ca208){var _0x6e592c=[];_0x1ca208['forEach'](function(_0x2c964a){_0x6e592c[_0x6a55('0x44')](_0x2c964a[_0x6a55('0x58')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x6a55('0x103')}));});return BPromise[_0x6a55('0x4f')](_0x6e592c);})[_0x6a55('0x11')](function(){return _0x29b151[_0x6a55('0x58')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x6a55('0x11')](respondWithResult(_0x4f19f2,null))[_0x6a55('0x1b')](handleError(_0x4f19f2,null));};exports[_0x6a55('0x106')]=function(_0x5e9335,_0x39478f){var _0x2e524c={};var _0x1f124a={};var _0x36351e;var _0x1e25dd;return db[_0x6a55('0x37')][_0x6a55('0xc3')]({'where':{'id':_0x5e9335[_0x6a55('0x5a')]['id']}})[_0x6a55('0x11')](handleEntityNotFound(_0x39478f,null))[_0x6a55('0x11')](function(_0x2dbf0d){if(_0x2dbf0d){_0x36351e=_0x2dbf0d;_0x1f124a['model']=_['keys'](db[_0x6a55('0x107')][_0x6a55('0x38')]);_0x1f124a['query']=_[_0x6a55('0x52')](_0x5e9335[_0x6a55('0x3f')]);_0x1f124a['filters']=_[_0x6a55('0x54')](_0x1f124a[_0x6a55('0x51')],_0x1f124a[_0x6a55('0x3f')]);_0x2e524c[_0x6a55('0x43')]=_[_0x6a55('0x54')](_0x1f124a[_0x6a55('0x51')],qs[_0x6a55('0x55')](_0x5e9335[_0x6a55('0x3f')]['fields']));_0x2e524c[_0x6a55('0x43')]=_0x2e524c[_0x6a55('0x43')][_0x6a55('0x47')]?_0x2e524c['attributes']:_0x1f124a[_0x6a55('0x51')];_0x2e524c[_0x6a55('0xc5')]=qs[_0x6a55('0xc6')](_0x5e9335[_0x6a55('0x3f')][_0x6a55('0xc6')]);_0x2e524c[_0x6a55('0xc7')]=qs[_0x6a55('0x53')](_[_0x6a55('0xc8')](_0x5e9335[_0x6a55('0x3f')],_0x1f124a[_0x6a55('0x53')]));if(_0x5e9335[_0x6a55('0x3f')][_0x6a55('0x2b')]){_0x2e524c[_0x6a55('0xc7')]=_[_0x6a55('0x56')](_0x2e524c[_0x6a55('0xc7')],{'$or':_[_0x6a55('0x2d')](_0x2e524c[_0x6a55('0x43')],function(_0x413e51){var _0x3c51eb={};_0x3c51eb[_0x413e51]={'$like':'%'+_0x5e9335[_0x6a55('0x3f')]['filter']+'%'};return _0x3c51eb;})});}_0x2e524c=_[_0x6a55('0x56')]({},_0x2e524c,_0x5e9335[_0x6a55('0x57')]);return _0x36351e[_0x6a55('0x106')](_0x2e524c);}})[_0x6a55('0x11')](function(_0x27d147){if(_0x27d147){_0x1e25dd=_0x27d147['length'];if(!_0x5e9335[_0x6a55('0x3f')]['hasOwnProperty'](_0x6a55('0xcd'))){_0x2e524c[_0x6a55('0x20')]=qs['limit'](_0x5e9335[_0x6a55('0x3f')][_0x6a55('0x20')]);_0x2e524c[_0x6a55('0x1e')]=qs[_0x6a55('0x1e')](_0x5e9335['query'][_0x6a55('0x1e')]);}return _0x36351e[_0x6a55('0x106')](_0x2e524c);}})[_0x6a55('0x11')](function(_0x14024b){if(_0x14024b){return _0x14024b?{'count':_0x1e25dd,'rows':_0x14024b}:null;}})[_0x6a55('0x11')](respondWithResult(_0x39478f,null))[_0x6a55('0x1b')](handleError(_0x39478f,null));};exports['addTeams']=function(_0x5cefb6,_0x4b2b8e){return db[_0x6a55('0x37')]['find']({'where':{'id':_0x5cefb6[_0x6a55('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4b2b8e,null))[_0x6a55('0x11')](function(_0x4bcbea){if(_0x4bcbea){var _0x471e08=_0x4bcbea[_0x6a55('0x26')]({'plain':!![]});return _0x4bcbea[_0x6a55('0x108')](_0x5cefb6[_0x6a55('0x59')][_0x6a55('0x5d')],_['omit'](_0x5cefb6[_0x6a55('0x59')],[_0x6a55('0x5d'),'id'])||{})[_0x6a55('0x11')](function(){for(var _0x6309dd=0x0;_0x6309dd<_0x5cefb6['body'][_0x6a55('0x5d')][_0x6a55('0x47')];_0x6309dd++){var _0x1686a9=[];var _0x44b191={};db[_0x6a55('0x107')][_0x6a55('0xc3')]({'where':{'id':_0x5cefb6['body'][_0x6a55('0x5d')][_0x6309dd]}})['then'](function(_0x46dca1){_0x44b191=_0x46dca1[_0x6a55('0x4a')];_0x1686a9[_0x6a55('0x44')](_0x46dca1[_0x6a55('0xed')]()[_0x6a55('0x11')](function(_0x59f219){for(var _0x1d251e=0x0;_0x1d251e<_0x59f219[_0x6a55('0x47')];_0x1d251e++){_0x59f219[_0x1d251e]['setDataValue']('channel',_0x6a55('0x109'));}return _0x59f219;}));_0x1686a9[_0x6a55('0x44')](_0x46dca1[_0x6a55('0x10a')]()[_0x6a55('0x11')](function(_0x1289a9){for(var _0x4352bf=0x0;_0x4352bf<_0x1289a9['length'];_0x4352bf++){_0x1289a9[_0x4352bf][_0x6a55('0x10b')](_0x6a55('0x99'),_0x6a55('0x10c'));}return _0x1289a9;}));_0x1686a9[_0x6a55('0x44')](_0x46dca1['getMailQueues']()[_0x6a55('0x11')](function(_0x1b1802){for(var _0x29fa03=0x0;_0x29fa03<_0x1b1802['length'];_0x29fa03++){_0x1b1802[_0x29fa03]['setDataValue'](_0x6a55('0x99'),_0x6a55('0x10d'));}return _0x1b1802;}));_0x1686a9[_0x6a55('0x44')](_0x46dca1[_0x6a55('0x10e')]()[_0x6a55('0x11')](function(_0x233b7a){for(var _0x366b1f=0x0;_0x366b1f<_0x233b7a['length'];_0x366b1f++){_0x233b7a[_0x366b1f][_0x6a55('0x10b')](_0x6a55('0x99'),_0x6a55('0x10f'));}return _0x233b7a;}));_0x1686a9['push'](_0x46dca1['getWhatsappQueues']()[_0x6a55('0x11')](function(_0x1c8634){for(var _0x51f8bd=0x0;_0x51f8bd<_0x1c8634[_0x6a55('0x47')];_0x51f8bd++){_0x1c8634[_0x51f8bd][_0x6a55('0x10b')](_0x6a55('0x99'),_0x6a55('0x110'));}return _0x1c8634;}));_0x1686a9['push'](_0x46dca1[_0x6a55('0x111')]()[_0x6a55('0x11')](function(_0x2fa5ea){for(var _0x369adf=0x0;_0x369adf<_0x2fa5ea[_0x6a55('0x47')];_0x369adf++){_0x2fa5ea[_0x369adf][_0x6a55('0x10b')](_0x6a55('0x99'),'Fax');}return _0x2fa5ea;}));_0x1686a9['push'](_0x46dca1[_0x6a55('0x112')]()[_0x6a55('0x11')](function(_0x4e0e73){for(var _0x31ae5d=0x0;_0x31ae5d<_0x4e0e73[_0x6a55('0x47')];_0x31ae5d++){_0x4e0e73[_0x31ae5d][_0x6a55('0x10b')](_0x6a55('0x99'),_0x6a55('0x113'));}return _0x4e0e73;}));return BPromise[_0x6a55('0x4f')](_0x1686a9);})[_0x6a55('0x11')](function(_0x226cac){var _0x517cb1=_['flatten'](_0x226cac);_0x1686a9=[];return db['sequelize'][_0x6a55('0x114')](function(_0x50f96e){for(var _0x453be8=0x0;_0x453be8<_0x517cb1['length'];_0x453be8++){_0x1686a9[_0x6a55('0x44')](_0x517cb1[_0x453be8][_0x6a55('0x115')](_0x471e08['id']),{'transaction':_0x50f96e});}return BPromise[_0x6a55('0x4f')](_0x1686a9)[_0x6a55('0x11')](function(){if(_0x471e08['online']){return BPromise['each'](_[_0x6a55('0x2b')](_0x517cb1,function(_0x2460fd){return _0x2460fd[_0x6a55('0x116')](_0x6a55('0x99'))===_0x6a55('0x109');}),function(_0x46f53c){return db[_0x6a55('0xa7')][_0x6a55('0xa8')]({'membername':_0x471e08[_0x6a55('0x31')],'UserId':_0x471e08['id'],'queue_name':_0x46f53c[_0x6a55('0x31')],'VoiceQueueId':_0x46f53c['id'],'interface':_[_0x6a55('0x64')](_0x471e08[_0x6a55('0xa5')])?util[_0x6a55('0xa6')](_0x6a55('0xe6'),_0x471e08[_0x6a55('0x31')]):_0x471e08[_0x6a55('0xa5')],'paused':_0x471e08['voicePause']||![],'penalty':_0x471e08['penalty']},{'transaction':_0x50f96e});});}else{return;}})[_0x6a55('0x11')](function(){for(var _0x49576d=0x0;_0x49576d<_0x517cb1[_0x6a55('0x47')];_0x49576d++){var _0x4490ae=_0x517cb1[_0x49576d][_0x6a55('0x116')]('channel');var _0x2f62af=_0x4490ae+_0x6a55('0xa2');socket['emit'](_0x6a55('0x7a')+_0x4490ae+'Queue:save',{'UserId':_0x471e08['id'],['queueField']:_0x517cb1[_0x49576d]['id']});}});});})['then'](function(){db[_0x6a55('0x117')][_0x6a55('0xc3')]({'where':{'teamId':_0x44b191['id']}})[_0x6a55('0x11')](function(_0x160e7c){if(_0x160e7c){db['UserVoicePrefix'][_0x6a55('0x79')]({'UserId':_0x5cefb6['params']['id'],'VoicePrefixId':_0x160e7c['VoicePrefixId']});}});});}});}})['then'](respondWithStatusCode(_0x4b2b8e,null))[_0x6a55('0x1b')](handleError(_0x4b2b8e,null));};exports[_0x6a55('0x118')]=function(_0x4a5d2f,_0x2d97df){return db[_0x6a55('0x37')][_0x6a55('0xc3')]({'where':{'id':_0x4a5d2f[_0x6a55('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2d97df,null))[_0x6a55('0x11')](function(_0x78b34c){if(_0x78b34c){var _0x302568=_0x78b34c[_0x6a55('0x26')]({'plain':!![]});var _0x5a2f13=_0x4a5d2f[_0x6a55('0x3f')][_0x6a55('0x5d')];return _0x78b34c[_0x6a55('0x118')](_0x5a2f13)[_0x6a55('0x11')](function(){for(var _0x4cc7e6=0x0;_0x4cc7e6<_0x5a2f13[_0x6a55('0x47')];_0x4cc7e6++){var _0x4d20be=[];var _0x2c94e2={};db['Team'][_0x6a55('0xc3')]({'where':{'id':_0x5a2f13[_0x4cc7e6]}})['then'](function(_0x47cbe7){_0x2c94e2=_0x47cbe7[_0x6a55('0x4a')];_0x4d20be[_0x6a55('0x44')](_0x47cbe7[_0x6a55('0xed')]()[_0x6a55('0x11')](function(_0x15741a){for(var _0x5b6442=0x0;_0x5b6442<_0x15741a[_0x6a55('0x47')];_0x5b6442++){_0x15741a[_0x5b6442][_0x6a55('0x10b')](_0x6a55('0x99'),_0x6a55('0x109'));}return _0x15741a;}));_0x4d20be['push'](_0x47cbe7['getChatQueues']()[_0x6a55('0x11')](function(_0xca1f86){for(var _0xa309bc=0x0;_0xa309bc<_0xca1f86['length'];_0xa309bc++){_0xca1f86[_0xa309bc][_0x6a55('0x10b')](_0x6a55('0x99'),_0x6a55('0x10c'));}return _0xca1f86;}));_0x4d20be['push'](_0x47cbe7[_0x6a55('0x119')]()['then'](function(_0xd08d0a){for(var _0x1e48c2=0x0;_0x1e48c2<_0xd08d0a[_0x6a55('0x47')];_0x1e48c2++){_0xd08d0a[_0x1e48c2][_0x6a55('0x10b')](_0x6a55('0x99'),_0x6a55('0x10d'));}return _0xd08d0a;}));_0x4d20be[_0x6a55('0x44')](_0x47cbe7[_0x6a55('0x10e')]()['then'](function(_0xdd992d){for(var _0x5c3cc5=0x0;_0x5c3cc5<_0xdd992d['length'];_0x5c3cc5++){_0xdd992d[_0x5c3cc5][_0x6a55('0x10b')](_0x6a55('0x99'),_0x6a55('0x10f'));}return _0xdd992d;}));_0x4d20be['push'](_0x47cbe7[_0x6a55('0x11a')]()[_0x6a55('0x11')](function(_0x2636b2){for(var _0x53e8b6=0x0;_0x53e8b6<_0x2636b2[_0x6a55('0x47')];_0x53e8b6++){_0x2636b2[_0x53e8b6][_0x6a55('0x10b')]('channel','Whatsapp');}return _0x2636b2;}));_0x4d20be['push'](_0x47cbe7[_0x6a55('0x111')]()['then'](function(_0x5d4fab){for(var _0x15f3f0=0x0;_0x15f3f0<_0x5d4fab['length'];_0x15f3f0++){_0x5d4fab[_0x15f3f0]['setDataValue'](_0x6a55('0x99'),_0x6a55('0x11b'));}return _0x5d4fab;}));_0x4d20be[_0x6a55('0x44')](_0x47cbe7[_0x6a55('0x112')]()[_0x6a55('0x11')](function(_0x5bfc6c){for(var _0xd8e739=0x0;_0xd8e739<_0x5bfc6c[_0x6a55('0x47')];_0xd8e739++){_0x5bfc6c[_0xd8e739][_0x6a55('0x10b')]('channel','Openchannel');}return _0x5bfc6c;}));return BPromise['all'](_0x4d20be);})[_0x6a55('0x11')](function(_0x39a020){var _0xd5bfad=_['flatten'](_0x39a020);_0x4d20be=[];return db[_0x6a55('0x65')][_0x6a55('0x114')](function(_0x4bdea4){for(var _0x421656=0x0;_0x421656<_0xd5bfad['length'];_0x421656++){_0x4d20be['push'](_0xd5bfad[_0x421656]['removeAgent'](_0x302568['id']),{'transaction':_0x4bdea4});}return BPromise[_0x6a55('0x4f')](_0x4d20be)[_0x6a55('0x11')](function(){if(_0x302568['online']){return BPromise[_0x6a55('0xef')](_[_0x6a55('0x2b')](_0xd5bfad,function(_0x5079c1){return _0x5079c1['getDataValue'](_0x6a55('0x99'))===_0x6a55('0x109');}),function(_0x4d3ccf){return db[_0x6a55('0xa7')][_0x6a55('0x25')]({'where':{'VoiceQueueId':_0x4d3ccf['id'],'UserId':_0x302568['id']},'transaction':_0x4bdea4});});}else{return;}})[_0x6a55('0x11')](function(){db[_0x6a55('0x117')][_0x6a55('0xc3')]({'where':{'teamId':_0x2c94e2['id']}})[_0x6a55('0x11')](function(_0x4cfd88){if(_0x4cfd88){return db[_0x6a55('0x11c')][_0x6a55('0x25')]({'where':{'UserId':_0x302568['id'],'VoicePrefixId':_0x4cfd88[_0x6a55('0x4a')][_0x6a55('0x11d')]}});}});})['then'](function(){for(var _0x1e45c2=0x0;_0x1e45c2<_0xd5bfad[_0x6a55('0x47')];_0x1e45c2++){var _0x1c5e85=_0xd5bfad[_0x1e45c2][_0x6a55('0x116')](_0x6a55('0x99'));var _0x339053=_0x1c5e85+_0x6a55('0xa2');socket[_0x6a55('0xa3')](_0x6a55('0x7a')+_0x1c5e85+_0x6a55('0xad'),{'UserId':_0x302568['id'],['queueField']:_0xd5bfad[_0x1e45c2]['id']});}});});});}});}})[_0x6a55('0x11')](respondWithStatusCode(_0x2d97df,null))['catch'](handleError(_0x2d97df,null));};exports['getLists']=function(_0x516e29,_0xf5cb1b){var _0x4c8798={};var _0x3b8c49={};var _0x1abaee;var _0x257d9e;return db[_0x6a55('0x37')][_0x6a55('0xc3')]({'where':{'id':_0x516e29['params']['id']}})[_0x6a55('0x11')](handleEntityNotFound(_0xf5cb1b,null))[_0x6a55('0x11')](function(_0x366a33){if(_0x366a33){_0x1abaee=_0x366a33;_0x3b8c49[_0x6a55('0x51')]=_[_0x6a55('0x52')](db[_0x6a55('0xc9')][_0x6a55('0x38')]);_0x3b8c49[_0x6a55('0x3f')]=_[_0x6a55('0x52')](_0x516e29[_0x6a55('0x3f')]);_0x3b8c49[_0x6a55('0x53')]=_['intersection'](_0x3b8c49[_0x6a55('0x51')],_0x3b8c49[_0x6a55('0x3f')]);_0x4c8798['attributes']=_[_0x6a55('0x54')](_0x3b8c49[_0x6a55('0x51')],qs[_0x6a55('0x55')](_0x516e29[_0x6a55('0x3f')][_0x6a55('0x55')]));_0x4c8798['attributes']=_0x4c8798['attributes'][_0x6a55('0x47')]?_0x4c8798[_0x6a55('0x43')]:_0x3b8c49[_0x6a55('0x51')];_0x4c8798[_0x6a55('0xc5')]=qs[_0x6a55('0xc6')](_0x516e29[_0x6a55('0x3f')]['sort']);_0x4c8798[_0x6a55('0xc7')]=qs[_0x6a55('0x53')](_['pick'](_0x516e29[_0x6a55('0x3f')],_0x3b8c49[_0x6a55('0x53')]));if(_0x516e29[_0x6a55('0x3f')][_0x6a55('0x2b')]){_0x4c8798['where']=_['merge'](_0x4c8798[_0x6a55('0xc7')],{'$or':_[_0x6a55('0x2d')](_0x4c8798['attributes'],function(_0x12d6c6){var _0x419a8e={};_0x419a8e[_0x12d6c6]={'$like':'%'+_0x516e29['query'][_0x6a55('0x2b')]+'%'};return _0x419a8e;})});}_0x4c8798=_['merge']({},_0x4c8798,_0x516e29[_0x6a55('0x57')]);return _0x1abaee['getLists'](_0x4c8798);}})[_0x6a55('0x11')](function(_0x1b240b){if(_0x1b240b){_0x257d9e=_0x1b240b['length'];if(!_0x516e29['query']['hasOwnProperty'](_0x6a55('0xcd'))){_0x4c8798['limit']=qs[_0x6a55('0x20')](_0x516e29[_0x6a55('0x3f')][_0x6a55('0x20')]);_0x4c8798[_0x6a55('0x1e')]=qs[_0x6a55('0x1e')](_0x516e29['query']['offset']);}return _0x1abaee[_0x6a55('0x11e')](_0x4c8798);}})[_0x6a55('0x11')](function(_0x40880c){if(_0x40880c){return _0x40880c?{'count':_0x257d9e,'rows':_0x40880c}:null;}})[_0x6a55('0x11')](respondWithResult(_0xf5cb1b,null))['catch'](handleError(_0xf5cb1b,null));};exports[_0x6a55('0x11f')]=function(_0x306b07,_0xc945bf){var _0x33eb09={};var _0x44406b={};var _0x7dca00;return db[_0x6a55('0x37')][_0x6a55('0xc3')]({'where':{'id':_0x306b07[_0x6a55('0x5a')]['id']}})['then'](handleEntityNotFound(_0xc945bf,null))[_0x6a55('0x11')](function(_0x421bc9){if(_0x421bc9){_0x7dca00=_0x421bc9;_0x44406b[_0x6a55('0x51')]=_['keys'](db[_0x6a55('0x37')][_0x6a55('0x38')]);_0x44406b['query']=_[_0x6a55('0x52')](_0x306b07[_0x6a55('0x3f')]);_0x44406b[_0x6a55('0x53')]=_[_0x6a55('0x54')](_0x44406b['model'],_0x44406b[_0x6a55('0x3f')]);_0x33eb09[_0x6a55('0x43')]=_[_0x6a55('0x54')](_0x44406b['model'],qs['fields'](_0x306b07['query'][_0x6a55('0x55')]));_0x33eb09[_0x6a55('0x43')]=_0x33eb09[_0x6a55('0x43')]['length']?_0x33eb09[_0x6a55('0x43')]:_0x44406b[_0x6a55('0x51')];_0x33eb09['order']=qs[_0x6a55('0xc6')](_0x306b07[_0x6a55('0x3f')][_0x6a55('0xc6')]);_0x33eb09[_0x6a55('0xc7')]=qs[_0x6a55('0x53')](_[_0x6a55('0xc8')](_0x306b07['query'],_0x44406b[_0x6a55('0x53')]));if(_0x306b07['query']['filter']){_0x33eb09[_0x6a55('0xc7')]=_[_0x6a55('0x56')](_0x33eb09[_0x6a55('0xc7')],{'$or':_[_0x6a55('0x2d')](_0x33eb09[_0x6a55('0x43')],function(_0x567dc2){var _0x1cece3={};_0x1cece3[_0x567dc2]={'$like':'%'+_0x306b07[_0x6a55('0x3f')][_0x6a55('0x2b')]+'%'};return _0x1cece3;})});}_0x33eb09[_0x6a55('0x51')]=db[_0x6a55('0x37')];_0x33eb09['as']='Agents';_0x33eb09=_[_0x6a55('0x56')]({},_0x33eb09,_0x306b07[_0x6a55('0x57')]);return _0x7dca00['getVoiceQueues']({'include':[_0x33eb09]});}})[_0x6a55('0x11')](function(_0x268ddf){if(_0x268ddf){var _0x463ef0={},_0x240466=[];for(var _0xe2ecbf=0x0;_0xe2ecbf<_0x268ddf['length'];_0xe2ecbf+=0x1){for(var _0x4be824=0x0,_0x3c94f1;_0x4be824<_0x268ddf[_0xe2ecbf][_0x6a55('0x28')][_0x6a55('0x47')];_0x4be824+=0x1){_0x3c94f1=_0x268ddf[_0xe2ecbf]['Agents'][_0x4be824][_0x6a55('0x26')]({'plain':!![]});_0x463ef0[_0x3c94f1['id']]=_0x3c94f1;}}_0x463ef0=_[_0x6a55('0x120')](_0x463ef0);for(var _0x5ed585=qs[_0x6a55('0x1e')](_0x306b07[_0x6a55('0x3f')][_0x6a55('0x1e')]);_0x5ed585<_0x463ef0[_0x6a55('0x47')]&&_0x240466['length']=_0x2acf62){_0x4b515d=_0x2acf62;_0x3971e8=0xc8;}else{_0x3971e8=0xce;}_0x420694[_0x9b39('0x1c')](_0x3971e8);return _0x420694['set'](_0x9b39('0x22'),_0x460838+'-'+_0x4b515d+'/'+_0x2acf62)[_0x9b39('0x1d')](_0x522503);}return null;};}function saveUpdates(_0x28a1e3){return function(_0xfeba3){if(_0xfeba3){return _0xfeba3[_0x9b39('0x23')](_0x28a1e3)[_0x9b39('0x24')](function(_0x3cf8b6){return _0x3cf8b6;});}return null;};}function removeEntity(_0x277db8){return function(_0x1bb7c4){if(_0x1bb7c4){return _0x1bb7c4['destroy']()[_0x9b39('0x24')](function(){var _0x4ca875=_0x1bb7c4['get']({'plain':!![]});if(_0x4ca875['role']===_0x9b39('0x25'))return;var _0x33be12=[{'name':_0x9b39('0x26'),'value':_0x9b39('0x27'),'ignore':!![]},{'name':'Agents','value':_0x9b39('0x28'),'ignore':![]},{'name':_0x9b39('0x29'),'value':_0x9b39('0x2a'),'ignore':![]}];var _0x153287=_(_0x33be12)[_0x9b39('0x2b')]('ignore')['map']('value')[_0x9b39('0x2c')]();if(_[_0x9b39('0x2d')](_0x153287,_0x4ca875[_0x9b39('0x2e')])){return;}var _0x2d1292=_[_0x9b39('0x2f')](_0x33be12,[_0x9b39('0x2c'),_0x4ca875[_0x9b39('0x2e')]])[_0x9b39('0x30')];return db[_0x9b39('0x31')][_0x9b39('0x32')]({'where':{'type':_0x2d1292,'resourceId':_0x4ca875['id']}})[_0x9b39('0x24')](function(){return _0x1bb7c4;});})['then'](function(){_0x277db8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x6f9f61){return function(_0x3db586){if(!_0x3db586){_0x6f9f61[_0x9b39('0x1b')](0x194);}return _0x3db586;};}function handleError(_0x41152a,_0x59cd11){_0x59cd11=_0x59cd11||0x1f4;return function(_0x1e8669){logger[_0x9b39('0x17')](_0x1e8669[_0x9b39('0x33')]);if(_0x1e8669[_0x9b39('0x30')]){delete _0x1e8669[_0x9b39('0x30')];}_0x41152a[_0x9b39('0x1c')](_0x59cd11)[_0x9b39('0x34')](_0x1e8669);};}exports[_0x9b39('0x35')]=function(_0xf32f49,_0x30726b){var _0x4b676e={},_0x19942c={'count':0x0,'rows':[]};var _0x1a3cfe=_(db[_0x9b39('0x36')][_0x9b39('0x37')])['map'](function(_0x5a29ae){return{'name':_0x5a29ae[_0x9b39('0x38')],'type':_0x5a29ae['type']['key']};})['filter'](function(_0x364345){return!_[_0x9b39('0x2d')](['password',_0x9b39('0x39')],_0x364345[_0x9b39('0x30')]);})[_0x9b39('0x2c')]();_0x4b676e=qs[_0x9b39('0x3a')](_0x1a3cfe,_0xf32f49);var _0x495734={'where':_0x4b676e[_0x9b39('0x3b')]};return db['User'][_0x9b39('0x21')](_0x495734)[_0x9b39('0x24')](function(_0x2d0318){_0x19942c['count']=_0x2d0318;if(_0xf32f49[_0x9b39('0x3c')][_0x9b39('0x3d')]){_0x4b676e[_0x9b39('0x3e')]=[{'all':!![]}];}if(_0xf32f49['query']['userSetting']==='true'){_0x4b676e['include']=[{'model':db[_0x9b39('0x3f')],'as':_0x9b39('0x40')}];}if(!_['includes'](_0x4b676e[_0x9b39('0x41')],'id')){_0x4b676e[_0x9b39('0x41')][_0x9b39('0x42')]('id');}return db[_0x9b39('0x36')][_0x9b39('0x43')](_0x4b676e);})[_0x9b39('0x24')](function(_0x445f40){_0x19942c[_0x9b39('0x44')]=_0x445f40;if(_0xf32f49[_0x9b39('0x3c')][_0x9b39('0x45')]===_0x9b39('0x46')){var _0x48e261=[];for(var _0x5eabd3=0x0;_0x5eabd3<_0x19942c[_0x9b39('0x44')][_0x9b39('0x47')];_0x5eabd3++){_0x48e261[_0x9b39('0x42')](get_open_tabs(_0x9b39('0x48'),_0x19942c[_0x9b39('0x44')][_0x5eabd3]['dataValues']));_0x48e261[_0x9b39('0x42')](get_open_tabs(_0x9b39('0x49'),_0x19942c[_0x9b39('0x44')][_0x5eabd3]['dataValues']));_0x48e261[_0x9b39('0x42')](get_open_tabs(_0x9b39('0x4a'),_0x19942c[_0x9b39('0x44')][_0x5eabd3]['dataValues']));_0x48e261[_0x9b39('0x42')](get_open_tabs(_0x9b39('0x4b'),_0x19942c[_0x9b39('0x44')][_0x5eabd3][_0x9b39('0x4c')]));_0x48e261['push'](get_open_tabs(_0x9b39('0x4d'),_0x19942c[_0x9b39('0x44')][_0x5eabd3][_0x9b39('0x4c')]));_0x48e261[_0x9b39('0x42')](get_open_tabs('whatsapp',_0x19942c['rows'][_0x5eabd3][_0x9b39('0x4c')]));}return BPromise[_0x9b39('0x4e')](_0x48e261)[_0x9b39('0x24')](function(){return _0x19942c;});}else{return _0x19942c;}})['then'](respondWithFilteredResult(_0x30726b,_0x4b676e))[_0x9b39('0x4f')](handleError(_0x30726b,null));};exports[_0x9b39('0x50')]=function(_0x44f28d,_0x4c42c){var _0x2f174b={'raw':![],'where':{'id':_0x44f28d['params']['id']}},_0x1404cb={};_0x1404cb['model']=_[_0x9b39('0x51')](_[_0x9b39('0x52')](db[_0x9b39('0x36')][_0x9b39('0x37')]),[_0x9b39('0x53'),'salt']);_0x1404cb[_0x9b39('0x3c')]=_['keys'](_0x44f28d[_0x9b39('0x3c')]);_0x1404cb['filters']=_[_0x9b39('0x54')](_0x1404cb['model'],_0x1404cb[_0x9b39('0x3c')]);_0x2f174b[_0x9b39('0x41')]=_['intersection'](_0x1404cb[_0x9b39('0x55')],qs['fields'](_0x44f28d[_0x9b39('0x3c')][_0x9b39('0x56')]));_0x2f174b['attributes']=_0x2f174b[_0x9b39('0x41')]['length']?_0x2f174b['attributes']:_0x1404cb[_0x9b39('0x55')];if(_0x44f28d['query'][_0x9b39('0x3d')]){_0x2f174b[_0x9b39('0x3e')]=[{'all':!![]}];}if(_0x44f28d[_0x9b39('0x3c')][_0x9b39('0x40')]===_0x9b39('0x46')){_0x2f174b[_0x9b39('0x3e')]=[{'model':db[_0x9b39('0x3f')],'as':_0x9b39('0x40')}];}_0x2f174b=_[_0x9b39('0x57')]({},_0x2f174b,_0x44f28d[_0x9b39('0x58')]);if(!_[_0x9b39('0x2d')](_0x2f174b[_0x9b39('0x41')],'id')){_0x2f174b[_0x9b39('0x41')][_0x9b39('0x42')]('id');}return db[_0x9b39('0x36')]['find'](_0x2f174b)['then'](handleEntityNotFound(_0x4c42c,null))[_0x9b39('0x24')](function(_0x1f643c){var _0x2e7cf0=[];values=_0x1f643c;if(_0x44f28d['query'][_0x9b39('0x45')]==='true'){_0x2e7cf0[_0x9b39('0x42')](get_open_tabs(_0x9b39('0x48'),_0x1f643c[_0x9b39('0x4c')]));_0x2e7cf0['push'](get_open_tabs('sms',_0x1f643c[_0x9b39('0x4c')]));_0x2e7cf0[_0x9b39('0x42')](get_open_tabs('openchannel',_0x1f643c[_0x9b39('0x4c')]));_0x2e7cf0['push'](get_open_tabs(_0x9b39('0x59'),_0x1f643c[_0x9b39('0x4c')]));_0x2e7cf0[_0x9b39('0x42')](get_open_tabs(_0x9b39('0x4a'),_0x1f643c[_0x9b39('0x4c')]));_0x2e7cf0['push'](get_open_tabs('mail',_0x1f643c[_0x9b39('0x4c')]));return BPromise[_0x9b39('0x4e')](_0x2e7cf0);}else{return values;}})[_0x9b39('0x24')](function(){return values;})[_0x9b39('0x24')](respondWithResult(_0x4c42c,null))[_0x9b39('0x4f')](handleError(_0x4c42c,null));};exports[_0x9b39('0x23')]=function(_0x221c20,_0x3417f6){if(_0x221c20[_0x9b39('0x5a')]['id']){delete _0x221c20[_0x9b39('0x5a')]['id'];}delete _0x221c20[_0x9b39('0x5a')][_0x9b39('0x2e')];return db['User'][_0x9b39('0x2f')]({'where':{'id':_0x221c20[_0x9b39('0x5b')]['id']}})[_0x9b39('0x24')](handleEntityNotFound(_0x3417f6,null))[_0x9b39('0x24')](saveUpdates(_0x221c20[_0x9b39('0x5a')],null))[_0x9b39('0x24')](respondWithResult(_0x3417f6,null))[_0x9b39('0x4f')](handleError(_0x3417f6,null));};exports[_0x9b39('0x5c')]=function(_0x5108ae,_0x3958c8){return db['User'][_0x9b39('0x5c')]()[_0x9b39('0x24')](respondWithResult(_0x3958c8,null))['catch'](handleError(_0x3958c8,null));};exports[_0x9b39('0x5d')]=function(_0x27debe,_0x560714){return db['User'][_0x9b39('0x2f')]({'where':{'id':_0x27debe[_0x9b39('0x5b')]['id']}})[_0x9b39('0x24')](handleEntityNotFound(_0x560714,null))[_0x9b39('0x24')](function(_0x43b20c){if(_0x43b20c){return _0x43b20c[_0x9b39('0x5d')](_0x27debe['body'][_0x9b39('0x5e')],_['omit'](_0x27debe[_0x9b39('0x5a')],[_0x9b39('0x5e'),'id'])||{});}})['then'](respondWithResult(_0x560714,null))['catch'](handleError(_0x560714,null));};function validateUser(_0x18a692){return new BPromise(function(_0x45eb9b,_0x4103d6){if(_0x18a692[_0x9b39('0x5f')])return _0x45eb9b(_0x18a692);return db['Setting'][_0x9b39('0x60')](0x1)[_0x9b39('0x24')](function(_0x56fef4){if(_0x56fef4[_0x9b39('0x61')])authService[_0x9b39('0x62')](_0x18a692['password']);db['User'][_0x9b39('0x63')](_0x9b39('0x5f'))[_0x9b39('0x24')](function(_0x5e0227){if(_[_0x9b39('0x64')](_0x5e0227)){_0x18a692['internal']=_0x56fef4[_0x9b39('0x65')]||0x1;return;}if(_[_0x9b39('0x64')](_0x56fef4[_0x9b39('0x65')])||_0x56fef4[_0x9b39('0x65')]===_0x5e0227){_0x18a692[_0x9b39('0x5f')]=_0x5e0227+0x1;return;}if(_0x56fef4[_0x9b39('0x65')]>_0x5e0227){_0x18a692[_0x9b39('0x5f')]=_0x56fef4['min_internal'];return;}return db[_0x9b39('0x66')]['query'](_0x9b39('0x67'),{'type':db[_0x9b39('0x66')][_0x9b39('0x68')]['SELECT']})[_0x9b39('0x24')](function(_0x4fda8f){if(_0x4fda8f&&_0x4fda8f['length']){for(var _0x2dee77=0x0,_0x32e481=_0x4fda8f['length'];_0x2dee77<_0x32e481&&_['isNil'](_0x18a692[_0x9b39('0x5f')]);_0x2dee77++){if(_0x56fef4[_0x9b39('0x65')]<=_0x4fda8f[_0x2dee77][_0x9b39('0x69')]){_0x18a692['internal']=_0x4fda8f[_0x2dee77][_0x9b39('0x69')];}else if(_0x56fef4[_0x9b39('0x65')]>_0x4fda8f[_0x2dee77]['from']&&_0x56fef4[_0x9b39('0x65')]<=_0x4fda8f[_0x2dee77]['to']){_0x18a692[_0x9b39('0x5f')]=_0x56fef4['min_internal'];}}}if(_[_0x9b39('0x64')](_0x18a692[_0x9b39('0x5f')])){_0x18a692[_0x9b39('0x5f')]=_0x5e0227+0x1;}return _0x45eb9b(_0x18a692);});});})['catch'](function(_0x4b25bd){_0x4103d6(_0x4b25bd);});});}function updateUser(_0x16085a){return new BPromise(function(_0x5c7007,_0x13d64d){try{if(_0x16085a[_0x9b39('0x6a')]){_0x16085a['mailbox']=_0x16085a['internal'];_0x16085a[_0x9b39('0x6b')]={'mailbox':_0x16085a[_0x9b39('0x5f')],'password':_0x16085a[_0x9b39('0x53')],'fullname':_0x16085a[_0x9b39('0x6c')],'email':_0x16085a[_0x9b39('0x6d')]};}if(_0x16085a['role']==='agent'){if(!_0x16085a['permissions'])_0x16085a[_0x9b39('0x6e')]=[_0x9b39('0x6f'),_0x9b39('0x70'),_0x9b39('0x71'),'113',_0x9b39('0x72'),_0x9b39('0x73'),_0x9b39('0x74'),_0x9b39('0x75'),'107','108',_0x9b39('0x76'),'100',_0x9b39('0x77'),_0x9b39('0x78'),_0x9b39('0x79')];}_0x5c7007(_0x16085a);}catch(_0xba9ef2){_0x13d64d(_0xba9ef2);}});}exports[_0x9b39('0x7a')]=function(_0x3b0ac2,_0x2133cb){if(_0x3b0ac2[_0x9b39('0x27')]['role']===_0x9b39('0x28'))throw new Error(_0x9b39('0x7b'));if(_0x3b0ac2[_0x9b39('0x5a')][_0x9b39('0x2e')]===_0x9b39('0x27')&&_0x3b0ac2[_0x9b39('0x27')]['role']!==_0x9b39('0x25')){throw new Error(_0x9b39('0x7c'));}if(_0x3b0ac2[_0x9b39('0x5a')][_0x9b39('0x2e')]===_0x9b39('0x25')&&_0x3b0ac2['user']['role']!=='admin'){throw new Error(_0x9b39('0x7d'));}return licenseUtil[_0x9b39('0x7e')]([_0x3b0ac2['body']])[_0x9b39('0x24')](function(){return validateUser(_0x3b0ac2[_0x9b39('0x5a')]);})['then'](function(_0x578c6c){return updateUser(_0x578c6c)['then'](function(_0x20f495){if(_0x20f495[_0x9b39('0x2e')]===_0x9b39('0x25')){_0x20f495[_0x9b39('0x7f')]=_0x3b0ac2[_0x9b39('0x27')]['settingsEnabled'];delete _0x20f495[_0x9b39('0x80')];}return _0x20f495;});})[_0x9b39('0x24')](function(_0x41184a){return db[_0x9b39('0x36')][_0x9b39('0x7a')](_0x41184a,{'include':[{'model':db[_0x9b39('0x6b')],'as':_0x9b39('0x6b')}]});})[_0x9b39('0x24')](function(_0x33f7aa){if(_0x3b0ac2[_0x9b39('0x5a')][_0x9b39('0x2e')]===_0x9b39('0x27'))return _0x33f7aa;if(_0x3b0ac2[_0x9b39('0x27')][_0x9b39('0x2e')]!==_0x9b39('0x27'))return _0x33f7aa;return db[_0x9b39('0x81')][_0x9b39('0x2f')]({'where':{'name':_0x33f7aa[_0x9b39('0x2e')]==='agent'?_0x9b39('0x82'):_0x9b39('0x29'),'userProfileId':_0x3b0ac2[_0x9b39('0x27')][_0x9b39('0x80')]},'raw':!![]})['then'](function(_0x4ef59f){if(!_0x4ef59f||_0x4ef59f[_0x9b39('0x83')]!=0x0)return _0x33f7aa;return db['UserProfileResource']['create']({'name':_0x33f7aa['name'],'resourceId':_0x33f7aa['id'],'type':_0x4ef59f['name'],'sectionId':_0x4ef59f['id']},{})[_0x9b39('0x24')](function(){return _0x33f7aa;});})['catch'](function(_0x5dbcd1){logger[_0x9b39('0x17')](_0x9b39('0x84'),_0x5dbcd1);throw _0x5dbcd1;});})[_0x9b39('0x24')](respondWithResult(_0x2133cb,0xc9))[_0x9b39('0x4f')](handleError(_0x2133cb,null));};exports['bulkCreate']=function(_0x1f1c82,_0x3dae81){var _0x5e75c6=_0x1f1c82[_0x9b39('0x5a')];var _0x14ec94=[];if(_0x1f1c82[_0x9b39('0x27')][_0x9b39('0x2e')]==='agent')throw new Error(_0x9b39('0x7b'));if(_[_0x9b39('0x85')](_0x5e75c6,[_0x9b39('0x2e'),'user'])&&_0x1f1c82[_0x9b39('0x27')][_0x9b39('0x2e')]!==_0x9b39('0x25')){throw new Error(_0x9b39('0x7c'));}if(_[_0x9b39('0x85')](_0x5e75c6,[_0x9b39('0x2e'),_0x9b39('0x25')])&&_0x1f1c82[_0x9b39('0x27')][_0x9b39('0x2e')]!==_0x9b39('0x25')){throw new Error(_0x9b39('0x86'));}return licenseUtil[_0x9b39('0x7e')](_0x5e75c6)[_0x9b39('0x24')](function(){return validateUser(_0x5e75c6[0x0]);})['then'](function(){for(var _0x4b27f0=0x1;_0x4b27f0<_0x5e75c6['length'];_0x4b27f0++){var _0x30f46b=_0x5e75c6[_0x4b27f0-0x1][_0x9b39('0x5f')];if(!_0x5e75c6[_0x4b27f0][_0x9b39('0x5f')])_0x5e75c6[_0x4b27f0]['internal']=_0x30f46b+0x1;_0x14ec94['push'](validateUser(_0x5e75c6[_0x4b27f0]));}return BPromise[_0x9b39('0x4e')](_0x14ec94);})[_0x9b39('0x24')](function(){_0x14ec94=[];for(var _0x31131a=0x0;_0x31131a<_0x5e75c6[_0x9b39('0x47')];_0x31131a++){_0x14ec94[_0x9b39('0x42')](updateUser(_0x5e75c6[_0x31131a]));}return BPromise[_0x9b39('0x4e')](_0x14ec94);})[_0x9b39('0x24')](function(){return BPromise['each'](_0x5e75c6,function(_0x5bc69a){return db[_0x9b39('0x36')][_0x9b39('0x7a')](_0x5bc69a,{'include':[{'model':db[_0x9b39('0x6b')],'as':'VoiceMail'}]})[_0x9b39('0x24')](function(_0x3b4079){_0x5bc69a['id']=_0x3b4079['id'];return _0x5bc69a;});});})[_0x9b39('0x24')](function(_0xbeda87){if(_0x1f1c82['body'][_0x9b39('0x2e')]===_0x9b39('0x27'))return _0xbeda87;if(_0x1f1c82[_0x9b39('0x27')][_0x9b39('0x2e')]!=='user')return _0xbeda87;var _0x2823c6=_[_0x9b39('0x85')](_0xbeda87,function(_0x4a2b23){return _0x4a2b23[_0x9b39('0x2e')]==='agent'||_0x4a2b23[_0x9b39('0x2e')]===_0x9b39('0x2a');});if(!_0x2823c6)return _0xbeda87;return db[_0x9b39('0x81')][_0x9b39('0x43')]({'where':{'name':{'$or':[_0x9b39('0x82'),_0x9b39('0x29')]},'userProfileId':_0x1f1c82[_0x9b39('0x27')][_0x9b39('0x80')]},'raw':!![]})[_0x9b39('0x24')](function(_0x1d824e){if(_[_0x9b39('0x87')](_0x1d824e)||!_[_0x9b39('0x85')](_0x1d824e,[_0x9b39('0x83'),0x0]))return _0xbeda87;_0x14ec94=[];var _0x5d47eb=_(_0x1d824e)['map'](function(_0x124fc2){if(_0x124fc2[_0x9b39('0x83')]===0x1)return;return _0x124fc2[_0x9b39('0x30')]===_0x9b39('0x82')?'agent':'telephone';})[_0x9b39('0x88')]()['value']();for(var _0x53fedc=0x0;_0x53fedc<_0xbeda87[_0x9b39('0x47')];_0x53fedc++){if(!_[_0x9b39('0x2d')](_0x5d47eb,_0xbeda87[_0x53fedc]['role']))return;var _0x1cd7a4=_0xbeda87[_0x53fedc][_0x9b39('0x2e')]===_0x9b39('0x28')?_0x9b39('0x82'):_0x9b39('0x29');_0x14ec94['push'](db[_0x9b39('0x31')][_0x9b39('0x7a')]({'name':_0xbeda87[_0x53fedc][_0x9b39('0x30')],'resourceId':_0xbeda87[_0x53fedc]['id'],'type':_0x1cd7a4,'sectionId':_[_0x9b39('0x2f')](_0x1d824e,[_0x9b39('0x30'),_0x1cd7a4])['id']},{}));}return BPromise[_0x9b39('0x4e')](_0x14ec94);});})[_0x9b39('0x24')](respondWithResult(_0x3dae81,0xc9))[_0x9b39('0x4f')](handleError(_0x3dae81,null));};exports[_0x9b39('0x89')]=function(_0x10d16a,_0x2cf882){if(_0x10d16a[_0x9b39('0x5a')]['id']){delete _0x10d16a[_0x9b39('0x5a')]['id'];}return db[_0x9b39('0x36')][_0x9b39('0x2f')]({'where':{'id':_0x10d16a[_0x9b39('0x5b')]['id']}})[_0x9b39('0x24')](function(_0x5015cf){if(!_0x5015cf)return null;if(_0x5015cf['id']===_0x10d16a[_0x9b39('0x27')]['id']){if(!_0x10d16a[_0x9b39('0x5a')][_0x9b39('0x8a')]||!_0x10d16a[_0x9b39('0x5a')][_0x9b39('0x8b')]){throw new db['Sequelize'][(_0x9b39('0x8c'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x5015cf['authenticate'](_0x10d16a[_0x9b39('0x5a')][_0x9b39('0x8a')])){throw new db[(_0x9b39('0x8d'))][(_0x9b39('0x8c'))](_0x9b39('0x8e'));}if(_0x10d16a['body']['oldPassword']===_0x10d16a[_0x9b39('0x5a')]['newPassword']){throw new db[(_0x9b39('0x8d'))][(_0x9b39('0x8c'))](_0x9b39('0x8f'));}}else if(_0x10d16a[_0x9b39('0x27')][_0x9b39('0x2e')]===_0x9b39('0x25')){if(!_0x10d16a['body'][_0x9b39('0x8b')]){throw new db[(_0x9b39('0x8d'))]['ValidationError'](_0x9b39('0x90'));}}else if(_0x10d16a[_0x9b39('0x27')][_0x9b39('0x2e')]===_0x9b39('0x27')){if(!_0x10d16a[_0x9b39('0x5a')][_0x9b39('0x8b')]){throw new db['Sequelize']['ValidationError'](_0x9b39('0x90'));}if(_0x5015cf[_0x9b39('0x2e')]!==_0x9b39('0x28')){throw new db[(_0x9b39('0x8d'))][(_0x9b39('0x8c'))](_0x9b39('0x7b'));}}else{throw new db[(_0x9b39('0x8d'))][(_0x9b39('0x8c'))](_0x9b39('0x7b'));}return _0x5015cf;})[_0x9b39('0x24')](handleEntityNotFound(_0x2cf882,null))['then'](function(_0x418e13){return db[_0x9b39('0x91')][_0x9b39('0x92')]({'attributes':['id',_0x9b39('0x61'),'enforcePasswordHistory','passwordHistoryLimit']})['then'](function(_0x929988){if(_0x929988[_0x9b39('0x61')])authService[_0x9b39('0x62')](_0x10d16a[_0x9b39('0x5a')][_0x9b39('0x8b')]);if(!_0x929988[_0x9b39('0x93')]||!_0x418e13[_0x9b39('0x94')])return _0x418e13;authService[_0x9b39('0x95')](_0x10d16a[_0x9b39('0x5a')][_0x9b39('0x8b')],_0x418e13[_0x9b39('0x94')],_0x929988[_0x9b39('0x96')]);return _0x418e13;})[_0x9b39('0x24')](saveUpdates({'password':_0x10d16a[_0x9b39('0x5a')][_0x9b39('0x8b')],'passwordResetAt':_0x10d16a[_0x9b39('0x27')]['id']==_0x10d16a[_0x9b39('0x5b')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x10d16a['body'][_0x9b39('0x8b')],_0x418e13[_0x9b39('0x94')])},null));})[_0x9b39('0x24')](respondWithResult(_0x2cf882,null))[_0x9b39('0x4f')](handleError(_0x2cf882,null));};exports[_0x9b39('0x97')]=function(_0x35efbc,_0x58bb9c){var _0x518613=_0x35efbc['body'][_0x9b39('0x98')];return db['User'][_0x9b39('0x2f')]({'where':{'id':_0x35efbc[_0x9b39('0x5b')]['id']},'attributes':['id',_0x9b39('0x30'),_0x9b39('0x2e'),_0x9b39('0x99'),'loginInPause',_0x9b39('0x9a'),_0x9b39('0x9b')]})[_0x9b39('0x24')](handleEntityNotFound(_0x58bb9c,null))[_0x9b39('0x24')](function(_0x42e0c8){if(_0x42e0c8){if(!utils[_0x9b39('0x9c')](_0x518613)){throw new db[(_0x9b39('0x8d'))][(_0x9b39('0x8c'))](_0x9b39('0x9d'));}return _0x42e0c8['add'+_[_0x9b39('0x9e')](_0x518613['toLowerCase']())+_0x9b39('0x9f')](_0x35efbc[_0x9b39('0x5a')]['ids'],{'penalty':_0x35efbc['body'][_0x9b39('0xa0')]||0x0})['spread'](function(_0x404846){for(var _0x14669e=0x0;_0x14669e<_0x35efbc[_0x9b39('0x5a')][_0x9b39('0x5e')][_0x9b39('0x47')];_0x14669e+=0x1){var _0x8d7fb0={'UserId':Number(_0x35efbc[_0x9b39('0x5b')]['id'])};_0x8d7fb0[_['capitalize'](_0x518613[_0x9b39('0xa1')]())+_0x9b39('0xa2')]=Number(_0x35efbc['body'][_0x9b39('0x5e')][_0x14669e]);socket[_0x9b39('0xa3')](_0x9b39('0x27')+_[_0x9b39('0x9e')](_0x518613[_0x9b39('0xa1')]())+'Queue:save',_0x8d7fb0);}return _0x404846;})[_0x9b39('0x24')](function(){if(_0x518613==='voice'){return db[_0x9b39('0xa4')]['findAll']({'where':{'id':_0x35efbc['body'][_0x9b39('0x5e')]||[]},'raw':!![],'attributes':['id',_0x9b39('0x30')]});}})[_0x9b39('0x24')](function(_0x598322){var _0x4c236e=_0x42e0c8[_0x9b39('0xa5')]({'plain':!![]});var _0x308d50=[];if(_0x518613===_0x9b39('0xa6')&&_0x4c236e[_0x9b39('0x2e')]===_0x9b39('0x28')&&_0x4c236e[_0x9b39('0x99')]){for(var _0x116207=0x0;_0x116207<_0x598322[_0x9b39('0x47')];_0x116207+=0x1){_0x308d50[_0x9b39('0x42')]({'membername':_0x4c236e['name'],'UserId':_0x4c236e['id'],'queue_name':_0x598322[_0x116207]['name'],'VoiceQueueId':_0x598322[_0x116207]['id'],'interface':_[_0x9b39('0x64')](_0x4c236e[_0x9b39('0x9b')])?util['format'](_0x9b39('0xa7'),_0x4c236e[_0x9b39('0x30')]):_0x4c236e[_0x9b39('0x9b')],'paused':_0x4c236e['voicePause']||![],'penalty':_0x35efbc['body'][_0x9b39('0xa0')]||0x0});}return BPromise[_0x9b39('0xa8')](_0x308d50,function(_0xd0ceb5){return db[_0x9b39('0xa9')]['upsert'](_0xd0ceb5);});}return _0x42e0c8;});}})[_0x9b39('0x24')](respondWithStatusCode(_0x58bb9c,null))[_0x9b39('0x4f')](handleError(_0x58bb9c,null));};exports[_0x9b39('0xaa')]=function(_0x1703e6,_0x190f7d){var _0x3dc482,_0x2408a8;return db[_0x9b39('0x36')][_0x9b39('0x2f')]({'where':{'id':_0x1703e6['params']['id']},'attributes':['id','name',_0x9b39('0x2e')]})['then'](handleEntityNotFound(_0x190f7d,null))['then'](function(_0xc0dc85){if(_0xc0dc85){_0x3dc482=_0xc0dc85;if(!_0x1703e6['query'][_0x9b39('0x98')]||!utils[_0x9b39('0x9c')](_0x1703e6[_0x9b39('0x3c')][_0x9b39('0x98')])){throw new db[(_0x9b39('0x8d'))][(_0x9b39('0x8c'))]('Unknown\x20channel');}return _0xc0dc85['remove'+_[_0x9b39('0x9e')](_0x1703e6[_0x9b39('0x3c')][_0x9b39('0x98')][_0x9b39('0xa1')]())+_0x9b39('0x9f')](_0x1703e6[_0x9b39('0x3c')][_0x9b39('0x5e')]);}})[_0x9b39('0x24')](function(_0x406221){if(_['isArray'](_0x1703e6[_0x9b39('0x3c')]['ids'])){for(var _0x6faad8=0x0;_0x6faad8<_0x1703e6[_0x9b39('0x3c')][_0x9b39('0x5e')]['length'];_0x6faad8+=0x1){_0x2408a8={'UserId':Number(_0x1703e6['params']['id'])};_0x2408a8[_[_0x9b39('0x9e')](_0x1703e6['query']['channel'][_0x9b39('0xa1')]())+_0x9b39('0xa2')]=Number(_0x1703e6[_0x9b39('0x3c')][_0x9b39('0x5e')][_0x6faad8]);socket[_0x9b39('0xa3')](_0x9b39('0x27')+_[_0x9b39('0x9e')](_0x1703e6[_0x9b39('0x3c')]['channel'][_0x9b39('0xa1')]())+_0x9b39('0xab'),_0x2408a8);}}else{_0x2408a8={'UserId':Number(_0x1703e6[_0x9b39('0x5b')]['id'])};_0x2408a8[_[_0x9b39('0x9e')](_0x1703e6[_0x9b39('0x3c')]['channel'][_0x9b39('0xa1')]())+_0x9b39('0xa2')]=Number(_0x1703e6['query'][_0x9b39('0x5e')]);socket[_0x9b39('0xa3')]('user'+_['capitalize'](_0x1703e6[_0x9b39('0x3c')]['channel'][_0x9b39('0xa1')]())+_0x9b39('0xab'),_0x2408a8);}return _0x406221;})[_0x9b39('0x24')](function(){if(_0x1703e6[_0x9b39('0x3c')]['channel']==='voice'){return db[_0x9b39('0xa9')]['destroy']({'where':{'UserId':_0x1703e6['params']['id'],'VoiceQueueId':_0x1703e6[_0x9b39('0x3c')][_0x9b39('0x5e')]},'individualHooks':!![]})[_0x9b39('0x24')](function(){return _0x3dc482;});}return _0x3dc482;})[_0x9b39('0x24')](respondWithStatusCode(_0x190f7d,null))[_0x9b39('0x4f')](handleError(_0x190f7d,null));};exports['addAvatar']=function(_0x3de477,_0x4018cc){_0x3de477[_0x9b39('0x5a')][_0x9b39('0xac')]=_0x3de477[_0x9b39('0xad')][_0x9b39('0xae')];return db[_0x9b39('0x36')][_0x9b39('0x2f')]({'where':{'id':_0x3de477[_0x9b39('0x5b')]['id']}})[_0x9b39('0x24')](handleEntityNotFound(_0x4018cc,null))['then'](saveUpdates(_0x3de477[_0x9b39('0x5a')],null))[_0x9b39('0x24')](respondWithResult(_0x4018cc,null))['catch'](handleError(_0x4018cc,null));};exports[_0x9b39('0xaf')]=function(_0x238ca5,_0x27df25){var _0x21fee3=path[_0x9b39('0xb0')](config[_0x9b39('0xb1')],_0x9b39('0xb2'));return db[_0x9b39('0x36')]['find']({'where':{'id':_0x238ca5[_0x9b39('0x5b')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0x9b39('0x24')](handleEntityNotFound(_0x27df25,null))['then'](function(_0x852856){if(_0x852856){if(_['isNil'](_0x852856[_0x9b39('0xac')])){return _0x27df25[_0x9b39('0xb3')](_0x21fee3);}else{if(!fs['existsSync'](path[_0x9b39('0xb0')](config[_0x9b39('0xb1')],_0x9b39('0xb4'),_0x852856[_0x9b39('0xac')]))){return _0x27df25[_0x9b39('0xb3')](_0x21fee3);}return _0x27df25[_0x9b39('0xb3')](path[_0x9b39('0xb0')](config[_0x9b39('0xb1')],_0x9b39('0xb4'),_0x852856[_0x9b39('0xac')]));}}})['catch'](handleError(_0x27df25,null));};exports['getOpenTabs']=function(_0x3c1f24,_0x175051){return db[_0x9b39('0x36')][_0x9b39('0x2f')]({'where':{'id':_0x3c1f24['params']['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x175051,null))[_0x9b39('0x24')](function(_0x121213){var _0x400e00=[];values=_0x121213[_0x9b39('0x4c')];_0x400e00[_0x9b39('0x42')](get_open_tabs(_0x9b39('0x48'),_0x121213[_0x9b39('0x4c')]));_0x400e00[_0x9b39('0x42')](get_open_tabs(_0x9b39('0x49'),_0x121213[_0x9b39('0x4c')]));_0x400e00[_0x9b39('0x42')](get_open_tabs(_0x9b39('0x4d'),_0x121213[_0x9b39('0x4c')]));_0x400e00[_0x9b39('0x42')](get_open_tabs(_0x9b39('0x59'),_0x121213[_0x9b39('0x4c')]));_0x400e00['push'](get_open_tabs(_0x9b39('0x4a'),_0x121213[_0x9b39('0x4c')]));_0x400e00['push'](get_open_tabs(_0x9b39('0x4b'),_0x121213['dataValues']));return BPromise[_0x9b39('0x4e')](_0x400e00);})['then'](function(_0x21951f){if(_0x21951f){var _0x50cbf1=_[_0x9b39('0xb5')](values[_0x9b39('0xb6')],function(_0x321d90){return{'channel':_0x9b39('0xb7'),'id':_0x321d90['id'],'createdAt':_0x321d90[_0x9b39('0xb8')]};});var _0x58207d=_['map'](values[_0x9b39('0xb9')],function(_0x28ceee){return{'channel':'FAX','id':_0x28ceee['id'],'createdAt':_0x28ceee[_0x9b39('0xb8')]};});var _0x2e3fc3=_[_0x9b39('0xb5')](values[_0x9b39('0xba')],function(_0x28809b){return{'channel':'OPENCHANNEL','id':_0x28809b['id'],'createdAt':_0x28809b[_0x9b39('0xb8')]};});var _0x4ad8e3=_[_0x9b39('0xb5')](values[_0x9b39('0xbb')],function(_0x5ef47e){return{'channel':_0x9b39('0xbc'),'id':_0x5ef47e['id'],'createdAt':_0x5ef47e[_0x9b39('0xb8')]};});var _0x235bd8=_[_0x9b39('0xb5')](values['SmsOpenTabs'],function(_0x505eff){return{'channel':'SMS','id':_0x505eff['id'],'createdAt':_0x505eff['createdAt']};});var _0x386fb5=_[_0x9b39('0xb5')](values[_0x9b39('0xbd')],function(_0x2d1423){return{'channel':_0x9b39('0xbe'),'id':_0x2d1423['id'],'createdAt':_0x2d1423[_0x9b39('0xb8')]};});var _0x4fc548=_[_0x9b39('0xbf')](_0x50cbf1,_0x58207d,_0x2e3fc3,_0x4ad8e3,_0x235bd8,_0x386fb5);var _0x54e3c5={'count':_0x4fc548[_0x9b39('0x47')],'rows':_0x4fc548};return _0x54e3c5;}else return null;})[_0x9b39('0x24')](respondWithResult(_0x175051,null))[_0x9b39('0x4f')](handleError(_0x175051,null));};exports[_0x9b39('0xc0')]=function(_0x17f200,_0x24002c){var _0x1e3400={};var _0x2d67e2={};var _0x16c85d;var _0x3cdd8f;return db[_0x9b39('0x36')]['findOne']({'where':{'id':_0x17f200[_0x9b39('0x5b')]['id']}})[_0x9b39('0x24')](handleEntityNotFound(_0x24002c,null))[_0x9b39('0x24')](function(_0xec08e3){if(_0xec08e3){_0x16c85d=_0xec08e3;_0x2d67e2['model']=_[_0x9b39('0x52')](db[_0x9b39('0xc1')][_0x9b39('0x37')]);_0x2d67e2['query']=_[_0x9b39('0x52')](_0x17f200['query']);_0x2d67e2['filters']=_[_0x9b39('0x54')](_0x2d67e2['model'],_0x2d67e2['query']);_0x1e3400['attributes']=_[_0x9b39('0x54')](_0x2d67e2[_0x9b39('0x55')],qs[_0x9b39('0x56')](_0x17f200[_0x9b39('0x3c')][_0x9b39('0x56')]));_0x1e3400['attributes']=_0x1e3400[_0x9b39('0x41')][_0x9b39('0x47')]?_0x1e3400[_0x9b39('0x41')]:_0x2d67e2[_0x9b39('0x55')];_0x1e3400[_0x9b39('0xc2')]=qs[_0x9b39('0xc3')](_0x17f200[_0x9b39('0x3c')][_0x9b39('0xc3')]);_0x1e3400[_0x9b39('0x3b')]=qs[_0x9b39('0xc4')](_[_0x9b39('0xc5')](_0x17f200[_0x9b39('0x3c')],_0x2d67e2[_0x9b39('0xc4')]));if(_0x17f200['query'][_0x9b39('0x2b')]){_0x1e3400[_0x9b39('0x3b')]=_[_0x9b39('0x57')](_0x1e3400[_0x9b39('0x3b')],{'$or':_[_0x9b39('0xb5')](_0x1e3400[_0x9b39('0x41')],function(_0x64c5b4){var _0x580cfd={};_0x580cfd[_0x64c5b4]={'$like':'%'+_0x17f200[_0x9b39('0x3c')][_0x9b39('0x2b')]+'%'};return _0x580cfd;})});}_0x1e3400=_['merge']({},_0x1e3400,_0x17f200[_0x9b39('0x58')]);return _0x16c85d[_0x9b39('0xc0')](_0x1e3400);}})[_0x9b39('0x24')](function(_0x278fc5){if(_0x278fc5){_0x3cdd8f=_0x278fc5[_0x9b39('0x47')];if(_0x17f200[_0x9b39('0x3c')]['hasOwnProperty'](_0x9b39('0x3d'))){_0x1e3400[_0x9b39('0x3e')]=[{'model':db[_0x9b39('0xc6')],'as':_0x9b39('0xc7'),'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id','name',_0x9b39('0xc8')],'where':_0x17f200[_0x9b39('0x3c')]['tag']?{'id':_0x17f200[_0x9b39('0x3c')][_0x9b39('0xc9')]}:undefined,'required':_0x17f200[_0x9b39('0x3c')]['tag']?!![]:![]}];}if(!_0x17f200[_0x9b39('0x3c')][_0x9b39('0xca')](_0x9b39('0xcb'))){_0x1e3400['limit']=qs[_0x9b39('0x20')](_0x17f200[_0x9b39('0x3c')][_0x9b39('0x20')]);_0x1e3400[_0x9b39('0x1e')]=qs[_0x9b39('0x1e')](_0x17f200[_0x9b39('0x3c')][_0x9b39('0x1e')]);}return _0x16c85d['getContacts'](_0x1e3400);}})[_0x9b39('0x24')](function(_0x19031d){if(_0x19031d){return _0x19031d?{'count':_0x3cdd8f,'rows':_0x19031d}:null;}})['then'](respondWithResult(_0x24002c,null))[_0x9b39('0x4f')](handleError(_0x24002c,null));};exports['getQueues']=function(_0x10801c,_0x540f72){var _0x1b7be7;var _0x49e5a1={};var _0xe7df10;return db['User']['findOne']({'where':{'id':_0x10801c[_0x9b39('0x5b')]['id']},'attributes':['id',_0x9b39('0x30'),_0x9b39('0x2e')]})[_0x9b39('0x24')](handleEntityNotFound(_0x540f72,null))['then'](function(_0x55d67c){if(!utils[_0x9b39('0x9c')](_0x10801c[_0x9b39('0x3c')][_0x9b39('0x98')])){throw new db[(_0x9b39('0x8d'))][(_0x9b39('0x8c'))](_0x9b39('0x9d'));}_0x1b7be7=_0x55d67c;var _0x24152c={};_0x24152c[_0x9b39('0x55')]=_[_0x9b39('0x52')](db[_[_0x9b39('0x9e')](_0x10801c[_0x9b39('0x3c')]['channel'])+'Queue'][_0x9b39('0x37')]);_0x24152c[_0x9b39('0x3c')]=_[_0x9b39('0x52')](_0x10801c[_0x9b39('0x3c')]);_0x24152c['filters']=_[_0x9b39('0x54')](_0x24152c[_0x9b39('0x55')],_0x24152c[_0x9b39('0x3c')]);_0x49e5a1['attributes']=_[_0x9b39('0x54')](_0x24152c[_0x9b39('0x55')],qs[_0x9b39('0x56')](_0x10801c['query'][_0x9b39('0x56')]));_0x49e5a1[_0x9b39('0x41')]=_0x49e5a1[_0x9b39('0x41')]['length']?_0x49e5a1[_0x9b39('0x41')]:_0x24152c[_0x9b39('0x55')];_0x49e5a1[_0x9b39('0xc2')]=qs[_0x9b39('0xc3')](_0x10801c[_0x9b39('0x3c')]['sort']);_0x49e5a1['where']=qs[_0x9b39('0xc4')](_[_0x9b39('0xc5')](_0x10801c['query'],_0x24152c[_0x9b39('0xc4')]));if(_0x10801c[_0x9b39('0x3c')][_0x9b39('0x2b')]){_0x49e5a1[_0x9b39('0x3b')]=_['merge'](_0x49e5a1[_0x9b39('0x3b')],{'$or':_[_0x9b39('0xb5')](_0x49e5a1[_0x9b39('0x41')],function(_0x42403a){var _0x129c99={};_0x129c99[_0x42403a]={'$like':'%'+_0x10801c[_0x9b39('0x3c')]['filter']+'%'};return _0x129c99;})});}_0x49e5a1=_[_0x9b39('0x57')]({},_0x49e5a1,_0x10801c[_0x9b39('0x58')]);switch(_0x1b7be7[_0x9b39('0x2e')]){case _0x9b39('0x25'):return db[_[_0x9b39('0x9e')](_0x10801c[_0x9b39('0x3c')][_0x9b39('0x98')])+'Queue'][_0x9b39('0x43')](_0x49e5a1);case _0x9b39('0x27'):case _0x9b39('0x28'):return _0x1b7be7['get'+_['capitalize'](_0x10801c[_0x9b39('0x3c')][_0x9b39('0x98')])+_0x9b39('0x9f')](_0x49e5a1);default:throw new db['Sequelize'][(_0x9b39('0x8c'))]('Unknown\x20role');}})[_0x9b39('0x24')](function(_0xd60679){_0xe7df10=_0xd60679[_0x9b39('0x47')];if(!_0x10801c['query'][_0x9b39('0xca')]('nolimit')){_0x49e5a1[_0x9b39('0x20')]=qs['limit'](_0x10801c[_0x9b39('0x3c')][_0x9b39('0x20')]);_0x49e5a1['offset']=qs[_0x9b39('0x1e')](_0x10801c[_0x9b39('0x3c')][_0x9b39('0x1e')]);}switch(_0x1b7be7['role']){case _0x9b39('0x25'):return db[_[_0x9b39('0x9e')](_0x10801c[_0x9b39('0x3c')]['channel'])+_0x9b39('0xcc')][_0x9b39('0x43')](_0x49e5a1);case _0x9b39('0x27'):case _0x9b39('0x28'):return _0x1b7be7[_0x9b39('0xa5')+_[_0x9b39('0x9e')](_0x10801c['query'][_0x9b39('0x98')])+'Queues'](_0x49e5a1);}})[_0x9b39('0x24')](function(_0x47e03a){return{'count':_0xe7df10,'rows':_0x47e03a};})['then'](respondWithResult(_0x540f72,null))[_0x9b39('0x4f')](handleError(_0x540f72,null));};exports[_0x9b39('0xcd')]=function(_0x469197,_0x596bb1){var _0x389656={};var _0xe5683d={};var _0x35963d;var _0xaa67ab;return db[_0x9b39('0x36')]['findOne']({'where':{'id':_0x469197[_0x9b39('0x5b')]['id']}})[_0x9b39('0x24')](handleEntityNotFound(_0x596bb1,null))['then'](function(_0x973929){if(_0x973929){_0x35963d=_0x973929;_0xe5683d[_0x9b39('0x55')]=_[_0x9b39('0x52')](db[_0x9b39('0xa9')][_0x9b39('0x37')]);_0xe5683d['query']=_['keys'](_0x469197[_0x9b39('0x3c')]);_0xe5683d[_0x9b39('0xc4')]=_[_0x9b39('0x54')](_0xe5683d[_0x9b39('0x55')],_0xe5683d['query']);_0x389656[_0x9b39('0x41')]=_[_0x9b39('0x54')](_0xe5683d[_0x9b39('0x55')],qs[_0x9b39('0x56')](_0x469197['query']['fields']));_0x389656[_0x9b39('0x41')]=_0x389656[_0x9b39('0x41')][_0x9b39('0x47')]?_0x389656[_0x9b39('0x41')]:_0xe5683d[_0x9b39('0x55')];_0x389656[_0x9b39('0xc2')]=qs[_0x9b39('0xc3')](_0x469197['query']['sort']);_0x389656[_0x9b39('0x3b')]=qs[_0x9b39('0xc4')](_['pick'](_0x469197[_0x9b39('0x3c')],_0xe5683d[_0x9b39('0xc4')]));if(_0x469197[_0x9b39('0x3c')]['filter']){_0x389656[_0x9b39('0x3b')]=_['merge'](_0x389656[_0x9b39('0x3b')],{'$or':_[_0x9b39('0xb5')](_0x389656[_0x9b39('0x41')],function(_0x56a74b){var _0x29fd49={};_0x29fd49[_0x56a74b]={'$like':'%'+_0x469197['query']['filter']+'%'};return _0x29fd49;})});}_0x389656=_[_0x9b39('0x57')]({},_0x389656,_0x469197[_0x9b39('0x58')]);return _0x35963d[_0x9b39('0xcd')](_0x389656);}})['then'](function(_0x57904d){if(_0x57904d){_0xaa67ab=_0x57904d[_0x9b39('0x47')];if(!_0x469197[_0x9b39('0x3c')][_0x9b39('0xca')](_0x9b39('0xcb'))){_0x389656[_0x9b39('0x20')]=qs['limit'](_0x469197[_0x9b39('0x3c')]['limit']);_0x389656['offset']=qs[_0x9b39('0x1e')](_0x469197[_0x9b39('0x3c')][_0x9b39('0x1e')]);}return _0x35963d['getVoiceQueuesRt'](_0x389656);}})[_0x9b39('0x24')](function(_0x429c89){if(_0x429c89){return _0x429c89?{'count':_0xaa67ab,'rows':_0x429c89}:null;}})[_0x9b39('0x24')](respondWithResult(_0x596bb1,null))[_0x9b39('0x4f')](handleError(_0x596bb1,null));};exports[_0x9b39('0xce')]=function(_0xc2eaaa,_0x55afe5){var _0x229e80={};var _0xe1453c={};var _0x29309e;var _0x1dcc6d;return db['User']['findOne']({'where':{'id':_0xc2eaaa[_0x9b39('0x5b')]['id']}})[_0x9b39('0x24')](handleEntityNotFound(_0x55afe5,null))['then'](function(_0xac47d5){if(_0xac47d5){_0x29309e=_0xac47d5;_0xe1453c['model']=_[_0x9b39('0x52')](db['ChatGroup'][_0x9b39('0x37')]);_0xe1453c[_0x9b39('0x3c')]=_[_0x9b39('0x52')](_0xc2eaaa[_0x9b39('0x3c')]);_0xe1453c['filters']=_[_0x9b39('0x54')](_0xe1453c[_0x9b39('0x55')],_0xe1453c[_0x9b39('0x3c')]);_0x229e80[_0x9b39('0x41')]=_[_0x9b39('0x54')](_0xe1453c[_0x9b39('0x55')],qs[_0x9b39('0x56')](_0xc2eaaa[_0x9b39('0x3c')][_0x9b39('0x56')]));_0x229e80[_0x9b39('0x41')]=_0x229e80[_0x9b39('0x41')][_0x9b39('0x47')]?_0x229e80[_0x9b39('0x41')]:_0xe1453c['model'];_0x229e80[_0x9b39('0xc2')]=qs[_0x9b39('0xc3')](_0xc2eaaa[_0x9b39('0x3c')]['sort']);_0x229e80[_0x9b39('0x3b')]=qs['filters'](_[_0x9b39('0xc5')](_0xc2eaaa[_0x9b39('0x3c')],_0xe1453c[_0x9b39('0xc4')]));if(_0xc2eaaa[_0x9b39('0x3c')][_0x9b39('0x2b')]){_0x229e80['where']=_[_0x9b39('0x57')](_0x229e80['where'],{'$or':_[_0x9b39('0xb5')](_0x229e80[_0x9b39('0x41')],function(_0x4aac9b){var _0x52ef37={};_0x52ef37[_0x4aac9b]={'$like':'%'+_0xc2eaaa[_0x9b39('0x3c')][_0x9b39('0x2b')]+'%'};return _0x52ef37;})});}_0x229e80=_[_0x9b39('0x57')]({},_0x229e80,_0xc2eaaa[_0x9b39('0x58')]);return _0x29309e[_0x9b39('0xce')](_0x229e80);}})[_0x9b39('0x24')](function(_0x57e60b){if(_0x57e60b){_0x1dcc6d=_0x57e60b['length'];if(!_0xc2eaaa['query'][_0x9b39('0xca')]('nolimit')){_0x229e80[_0x9b39('0x20')]=qs[_0x9b39('0x20')](_0xc2eaaa[_0x9b39('0x3c')][_0x9b39('0x20')]);_0x229e80[_0x9b39('0x1e')]=qs[_0x9b39('0x1e')](_0xc2eaaa[_0x9b39('0x3c')]['offset']);}return _0x29309e[_0x9b39('0xce')](_0x229e80);}})['then'](function(_0x579a3a){if(_0x579a3a){return _0x579a3a?{'count':_0x1dcc6d,'rows':_0x579a3a}:null;}})[_0x9b39('0x24')](respondWithResult(_0x55afe5,null))[_0x9b39('0x4f')](handleError(_0x55afe5,null));};exports[_0x9b39('0xcf')]=function(_0x11e436,_0x37ace2){var _0x234dc7={'raw':!![],'where':{}};var _0x35a76f={};var _0x370e23={'count':0x0,'rows':[]};return db[_0x9b39('0x36')]['findOne']({'where':{'id':_0x11e436['params']['id']}})[_0x9b39('0x24')](handleEntityNotFound(_0x37ace2,null))[_0x9b39('0x24')](function(_0x3aa133){if(_0x3aa133){_0x35a76f[_0x9b39('0x55')]=_[_0x9b39('0x52')](db['VoiceRecording'][_0x9b39('0x37')]);_0x35a76f[_0x9b39('0x3c')]=_['keys'](_0x11e436[_0x9b39('0x3c')]);_0x35a76f[_0x9b39('0xc4')]=_['intersection'](_0x35a76f[_0x9b39('0x55')],_0x35a76f[_0x9b39('0x3c')]);_0x234dc7[_0x9b39('0x41')]=_[_0x9b39('0x54')](_0x35a76f[_0x9b39('0x55')],qs[_0x9b39('0x56')](_0x11e436[_0x9b39('0x3c')][_0x9b39('0x56')]));_0x234dc7[_0x9b39('0x41')]=_0x234dc7[_0x9b39('0x41')][_0x9b39('0x47')]?_0x234dc7[_0x9b39('0x41')]:_0x35a76f['model'];if(!_0x11e436[_0x9b39('0x3c')][_0x9b39('0xca')](_0x9b39('0xcb'))){_0x234dc7[_0x9b39('0x20')]=qs['limit'](_0x11e436[_0x9b39('0x3c')][_0x9b39('0x20')]);_0x234dc7['offset']=qs[_0x9b39('0x1e')](_0x11e436[_0x9b39('0x3c')][_0x9b39('0x1e')]);}_0x234dc7['order']=qs[_0x9b39('0xc3')](_0x11e436[_0x9b39('0x3c')][_0x9b39('0xc3')]);_0x234dc7[_0x9b39('0x3b')]=qs['filters'](_[_0x9b39('0xc5')](_0x11e436['query'],_0x35a76f[_0x9b39('0xc4')]));_0x234dc7[_0x9b39('0x3b')][_0x9b39('0xd0')]=_0x3aa133['id'];if(_0x11e436[_0x9b39('0x3c')]['filter']){_0x234dc7['where']=_[_0x9b39('0x57')](_0x234dc7[_0x9b39('0x3b')],{'$or':_[_0x9b39('0xb5')](_0x234dc7[_0x9b39('0x41')],function(_0x31be28){var _0x1adc3b={};_0x1adc3b[_0x31be28]={'$like':'%'+_0x11e436[_0x9b39('0x3c')][_0x9b39('0x2b')]+'%'};return _0x1adc3b;})});}_0x234dc7=_[_0x9b39('0x57')]({},_0x234dc7,_0x11e436[_0x9b39('0x58')]);return db['VoiceRecording'][_0x9b39('0x21')]({'where':_0x234dc7['where']})[_0x9b39('0x24')](function(_0x36b138){_0x370e23[_0x9b39('0x21')]=_0x36b138;if(_0x11e436['query'][_0x9b39('0x3d')]){_0x234dc7[_0x9b39('0x3e')]=[{'all':!![]}];}return db[_0x9b39('0xd1')]['findAll'](_0x234dc7);})[_0x9b39('0x24')](function(_0x5c91f5){_0x370e23[_0x9b39('0x44')]=_0x5c91f5;return _0x370e23;});}})[_0x9b39('0x24')](respondWithFilteredResult(_0x37ace2,_0x234dc7))[_0x9b39('0x4f')](handleError(_0x37ace2,null));};exports[_0x9b39('0xd2')]=function(_0x302f62,_0x67b6a2){var _0x394390={'raw':!![],'where':{}};var _0x325f8c={};var _0xdea5f2={'count':0x0,'rows':[]};return db[_0x9b39('0x36')][_0x9b39('0x92')]({'where':{'id':_0x302f62[_0x9b39('0x5b')]['id']}})[_0x9b39('0x24')](handleEntityNotFound(_0x67b6a2,null))[_0x9b39('0x24')](function(_0x3ef812){if(_0x3ef812){_0x325f8c['model']=_[_0x9b39('0x52')](db[_0x9b39('0xd3')][_0x9b39('0x37')]);_0x325f8c[_0x9b39('0x3c')]=_['keys'](_0x302f62[_0x9b39('0x3c')]);_0x325f8c[_0x9b39('0xc4')]=_[_0x9b39('0x54')](_0x325f8c[_0x9b39('0x55')],_0x325f8c[_0x9b39('0x3c')]);_0x394390[_0x9b39('0x41')]=_[_0x9b39('0x54')](_0x325f8c['model'],qs[_0x9b39('0x56')](_0x302f62['query'][_0x9b39('0x56')]));_0x394390[_0x9b39('0x41')]=_0x394390[_0x9b39('0x41')][_0x9b39('0x47')]?_0x394390['attributes']:_0x325f8c[_0x9b39('0x55')];if(!_0x302f62[_0x9b39('0x3c')][_0x9b39('0xca')]('nolimit')){_0x394390[_0x9b39('0x20')]=qs[_0x9b39('0x20')](_0x302f62[_0x9b39('0x3c')][_0x9b39('0x20')]);_0x394390[_0x9b39('0x1e')]=qs[_0x9b39('0x1e')](_0x302f62[_0x9b39('0x3c')][_0x9b39('0x1e')]);}_0x394390['order']=qs[_0x9b39('0xc3')](_0x302f62['query'][_0x9b39('0xc3')]);_0x394390['where']=qs[_0x9b39('0xc4')](_['pick'](_0x302f62[_0x9b39('0x3c')],_0x325f8c[_0x9b39('0xc4')]));_0x394390[_0x9b39('0x3b')][_0x9b39('0xd0')]=_0x3ef812['id'];if(_0x302f62[_0x9b39('0x3c')][_0x9b39('0x2b')]){_0x394390['where']=_[_0x9b39('0x57')](_0x394390['where'],{'$or':_[_0x9b39('0xb5')](_0x394390[_0x9b39('0x41')],function(_0x37e119){var _0x48b3b1={};_0x48b3b1[_0x37e119]={'$like':'%'+_0x302f62[_0x9b39('0x3c')]['filter']+'%'};return _0x48b3b1;})});}_0x394390=_[_0x9b39('0x57')]({},_0x394390,_0x302f62[_0x9b39('0x58')]);return db[_0x9b39('0xd3')][_0x9b39('0x21')]({'where':_0x394390[_0x9b39('0x3b')]})[_0x9b39('0x24')](function(_0x34f705){_0xdea5f2[_0x9b39('0x21')]=_0x34f705;if(_0x302f62[_0x9b39('0x3c')]['includeAll']){_0x394390[_0x9b39('0x3e')]=[{'all':!![]}];}return db['ScreenRecording'][_0x9b39('0x43')](_0x394390);})[_0x9b39('0x24')](function(_0x543233){_0xdea5f2[_0x9b39('0x44')]=_0x543233;return _0xdea5f2;});}})[_0x9b39('0x24')](respondWithFilteredResult(_0x67b6a2,_0x394390))['catch'](handleError(_0x67b6a2,null));};exports[_0x9b39('0xd4')]=function(_0x2eace1,_0x25c929){var _0x5c3668={};var _0x4d9ac8={};var _0x297c94;var _0x2b4640;return db[_0x9b39('0x36')][_0x9b39('0x92')]({'where':{'id':_0x2eace1[_0x9b39('0x5b')]['id']}})['then'](handleEntityNotFound(_0x25c929,null))['then'](function(_0x16d2d5){if(_0x16d2d5){_0x297c94=_0x16d2d5;_0x4d9ac8['model']=_[_0x9b39('0x52')](db[_0x9b39('0xd5')][_0x9b39('0x37')]);_0x4d9ac8[_0x9b39('0x3c')]=_['keys'](_0x2eace1[_0x9b39('0x3c')]);_0x4d9ac8[_0x9b39('0xc4')]=_[_0x9b39('0x54')](_0x4d9ac8[_0x9b39('0x55')],_0x4d9ac8[_0x9b39('0x3c')]);_0x5c3668['attributes']=_[_0x9b39('0x54')](_0x4d9ac8[_0x9b39('0x55')],qs['fields'](_0x2eace1[_0x9b39('0x3c')][_0x9b39('0x56')]));_0x5c3668[_0x9b39('0x41')]=_0x5c3668[_0x9b39('0x41')][_0x9b39('0x47')]?_0x5c3668['attributes']:_0x4d9ac8['model'];_0x5c3668['order']=qs[_0x9b39('0xc3')](_0x2eace1[_0x9b39('0x3c')][_0x9b39('0xc3')]);_0x5c3668[_0x9b39('0x3b')]=qs[_0x9b39('0xc4')](_[_0x9b39('0xc5')](_0x2eace1[_0x9b39('0x3c')],_0x4d9ac8[_0x9b39('0xc4')]));if(_0x2eace1['query'][_0x9b39('0x2b')]){_0x5c3668[_0x9b39('0x3b')]=_['merge'](_0x5c3668['where'],{'$or':_[_0x9b39('0xb5')](_0x5c3668[_0x9b39('0x41')],function(_0x43d6d5){var _0x54795c={};_0x54795c[_0x43d6d5]={'$like':'%'+_0x2eace1[_0x9b39('0x3c')]['filter']+'%'};return _0x54795c;})});}_0x5c3668=_[_0x9b39('0x57')]({},_0x5c3668,_0x2eace1[_0x9b39('0x58')]);return _0x297c94[_0x9b39('0xd4')](_0x5c3668);}})[_0x9b39('0x24')](function(_0x5a87e3){if(_0x5a87e3){_0x2b4640=_0x5a87e3['length'];if(!_0x2eace1[_0x9b39('0x3c')][_0x9b39('0xca')](_0x9b39('0xcb'))){_0x5c3668[_0x9b39('0x20')]=qs[_0x9b39('0x20')](_0x2eace1[_0x9b39('0x3c')]['limit']);_0x5c3668['offset']=qs[_0x9b39('0x1e')](_0x2eace1[_0x9b39('0x3c')][_0x9b39('0x1e')]);}return _0x297c94[_0x9b39('0xd4')](_0x5c3668);}})['then'](function(_0x4b7c20){if(_0x4b7c20){return _0x4b7c20?{'count':_0x2b4640,'rows':_0x4b7c20}:null;}})[_0x9b39('0x24')](respondWithResult(_0x25c929,null))[_0x9b39('0x4f')](handleError(_0x25c929,null));};exports['getOpenchannelInteractions']=function(_0x226da7,_0x40bf30){var _0x526232={};var _0x1bd42b={};var _0xdd489b;var _0x28869c;return db[_0x9b39('0x36')][_0x9b39('0x92')]({'where':{'id':_0x226da7[_0x9b39('0x5b')]['id']}})[_0x9b39('0x24')](handleEntityNotFound(_0x40bf30,null))[_0x9b39('0x24')](function(_0x42c25d){if(_0x42c25d){_0xdd489b=_0x42c25d;_0x1bd42b[_0x9b39('0x55')]=_[_0x9b39('0x52')](db['OpenchannelInteraction'][_0x9b39('0x37')]);_0x1bd42b[_0x9b39('0x3c')]=_['keys'](_0x226da7[_0x9b39('0x3c')]);_0x1bd42b[_0x9b39('0xc4')]=_[_0x9b39('0x54')](_0x1bd42b[_0x9b39('0x55')],_0x1bd42b[_0x9b39('0x3c')]);_0x526232[_0x9b39('0x41')]=_[_0x9b39('0x54')](_0x1bd42b[_0x9b39('0x55')],qs[_0x9b39('0x56')](_0x226da7['query']['fields']));_0x526232[_0x9b39('0x41')]=_0x526232[_0x9b39('0x41')][_0x9b39('0x47')]?_0x526232[_0x9b39('0x41')]:_0x1bd42b[_0x9b39('0x55')];_0x526232[_0x9b39('0xc2')]=qs[_0x9b39('0xc3')](_0x226da7['query']['sort']);_0x526232[_0x9b39('0x3b')]=qs[_0x9b39('0xc4')](_[_0x9b39('0xc5')](_0x226da7['query'],_0x1bd42b[_0x9b39('0xc4')]));if(_0x226da7['query'][_0x9b39('0x2b')]){_0x526232[_0x9b39('0x3b')]=_['merge'](_0x526232[_0x9b39('0x3b')],{'$or':_[_0x9b39('0xb5')](_0x526232[_0x9b39('0x41')],function(_0x1c0f46){var _0x467d0d={};_0x467d0d[_0x1c0f46]={'$like':'%'+_0x226da7[_0x9b39('0x3c')][_0x9b39('0x2b')]+'%'};return _0x467d0d;})});}_0x526232=_[_0x9b39('0x57')]({},_0x526232,_0x226da7[_0x9b39('0x58')]);return _0xdd489b[_0x9b39('0xd6')](_0x526232);}})[_0x9b39('0x24')](function(_0x20940f){if(_0x20940f){_0x28869c=_0x20940f[_0x9b39('0x47')];if(!_0x226da7[_0x9b39('0x3c')][_0x9b39('0xca')]('nolimit')){_0x526232[_0x9b39('0x20')]=qs[_0x9b39('0x20')](_0x226da7[_0x9b39('0x3c')]['limit']);_0x526232[_0x9b39('0x1e')]=qs[_0x9b39('0x1e')](_0x226da7[_0x9b39('0x3c')][_0x9b39('0x1e')]);}return _0xdd489b['getOpenchannelInteractions'](_0x526232);}})[_0x9b39('0x24')](function(_0x4fb587){if(_0x4fb587){return _0x4fb587?{'count':_0x28869c,'rows':_0x4fb587}:null;}})['then'](respondWithResult(_0x40bf30,null))[_0x9b39('0x4f')](handleError(_0x40bf30,null));};exports[_0x9b39('0xd7')]=function(_0x184921,_0xbdfba1){var _0x2e5d55={'raw':!![],'where':{}};var _0x102fe4={};var _0x465404={'count':0x0,'rows':[]};return db[_0x9b39('0x36')][_0x9b39('0x92')]({'where':{'id':_0x184921[_0x9b39('0x5b')]['id']}})[_0x9b39('0x24')](handleEntityNotFound(_0xbdfba1,null))[_0x9b39('0x24')](function(_0x332953){if(_0x332953){_0x102fe4['model']=_[_0x9b39('0x52')](db[_0x9b39('0xd8')][_0x9b39('0x37')]);_0x102fe4['query']=_[_0x9b39('0x52')](_0x184921[_0x9b39('0x3c')]);_0x102fe4['filters']=_[_0x9b39('0x54')](_0x102fe4[_0x9b39('0x55')],_0x102fe4[_0x9b39('0x3c')]);_0x2e5d55[_0x9b39('0x41')]=_[_0x9b39('0x54')](_0x102fe4[_0x9b39('0x55')],qs[_0x9b39('0x56')](_0x184921[_0x9b39('0x3c')][_0x9b39('0x56')]));_0x2e5d55[_0x9b39('0x41')]=_0x2e5d55[_0x9b39('0x41')][_0x9b39('0x47')]?_0x2e5d55[_0x9b39('0x41')]:_0x102fe4['model'];if(!_0x184921[_0x9b39('0x3c')][_0x9b39('0xca')]('nolimit')){_0x2e5d55[_0x9b39('0x20')]=qs[_0x9b39('0x20')](_0x184921[_0x9b39('0x3c')][_0x9b39('0x20')]);_0x2e5d55['offset']=qs[_0x9b39('0x1e')](_0x184921[_0x9b39('0x3c')][_0x9b39('0x1e')]);}_0x2e5d55['order']=qs[_0x9b39('0xc3')](_0x184921[_0x9b39('0x3c')][_0x9b39('0xc3')]);_0x2e5d55[_0x9b39('0x3b')]=qs[_0x9b39('0xc4')](_[_0x9b39('0xc5')](_0x184921[_0x9b39('0x3c')],_0x102fe4[_0x9b39('0xc4')]));_0x2e5d55['where'][_0x9b39('0xd0')]=_0x332953['id'];if(_0x184921[_0x9b39('0x3c')][_0x9b39('0x2b')]){_0x2e5d55[_0x9b39('0x3b')]=_[_0x9b39('0x57')](_0x2e5d55[_0x9b39('0x3b')],{'$or':_['map'](_0x2e5d55[_0x9b39('0x41')],function(_0x467eb4){var _0x1422fb={};_0x1422fb[_0x467eb4]={'$like':'%'+_0x184921[_0x9b39('0x3c')]['filter']+'%'};return _0x1422fb;})});}_0x2e5d55=_[_0x9b39('0x57')]({},_0x2e5d55,_0x184921[_0x9b39('0x58')]);return db['MailInteraction'][_0x9b39('0x21')]({'where':_0x2e5d55['where']})[_0x9b39('0x24')](function(_0x4e38ee){_0x465404[_0x9b39('0x21')]=_0x4e38ee;if(_0x184921[_0x9b39('0x3c')]['includeAll']){_0x2e5d55[_0x9b39('0x3e')]=[{'all':!![]}];}return db['MailInteraction'][_0x9b39('0x43')](_0x2e5d55);})['then'](function(_0x10ac1e){_0x465404[_0x9b39('0x44')]=_0x10ac1e;return _0x465404;});}})[_0x9b39('0x24')](respondWithFilteredResult(_0xbdfba1,_0x2e5d55))[_0x9b39('0x4f')](handleError(_0xbdfba1,null));};exports[_0x9b39('0xd9')]=function(_0x4c93c7,_0x205a60){var _0x28e82f={};var _0x4bf2c3={};var _0x93e133;var _0x342b1b;return db[_0x9b39('0x36')][_0x9b39('0x92')]({'where':{'id':_0x4c93c7[_0x9b39('0x5b')]['id']}})[_0x9b39('0x24')](handleEntityNotFound(_0x205a60,null))['then'](function(_0x52cc60){if(_0x52cc60){_0x93e133=_0x52cc60;_0x4bf2c3[_0x9b39('0x55')]=_[_0x9b39('0x52')](db[_0x9b39('0xda')][_0x9b39('0x37')]);_0x4bf2c3[_0x9b39('0x3c')]=_['keys'](_0x4c93c7['query']);_0x4bf2c3[_0x9b39('0xc4')]=_['intersection'](_0x4bf2c3['model'],_0x4bf2c3[_0x9b39('0x3c')]);_0x28e82f['attributes']=_['intersection'](_0x4bf2c3[_0x9b39('0x55')],qs['fields'](_0x4c93c7[_0x9b39('0x3c')]['fields']));_0x28e82f['attributes']=_0x28e82f[_0x9b39('0x41')][_0x9b39('0x47')]?_0x28e82f[_0x9b39('0x41')]:_0x4bf2c3[_0x9b39('0x55')];_0x28e82f[_0x9b39('0xc2')]=qs['sort'](_0x4c93c7['query']['sort']);_0x28e82f[_0x9b39('0x3b')]=qs[_0x9b39('0xc4')](_[_0x9b39('0xc5')](_0x4c93c7[_0x9b39('0x3c')],_0x4bf2c3['filters']));if(_0x4c93c7[_0x9b39('0x3c')][_0x9b39('0x2b')]){_0x28e82f[_0x9b39('0x3b')]=_[_0x9b39('0x57')](_0x28e82f[_0x9b39('0x3b')],{'$or':_[_0x9b39('0xb5')](_0x28e82f[_0x9b39('0x41')],function(_0x4b9e60){var _0x2bd8eb={};_0x2bd8eb[_0x4b9e60]={'$like':'%'+_0x4c93c7[_0x9b39('0x3c')]['filter']+'%'};return _0x2bd8eb;})});}_0x28e82f=_[_0x9b39('0x57')]({},_0x28e82f,_0x4c93c7[_0x9b39('0x58')]);return _0x93e133[_0x9b39('0xd9')](_0x28e82f);}})[_0x9b39('0x24')](function(_0x4b1215){if(_0x4b1215){_0x342b1b=_0x4b1215['length'];if(!_0x4c93c7[_0x9b39('0x3c')][_0x9b39('0xca')](_0x9b39('0xcb'))){_0x28e82f[_0x9b39('0x20')]=qs['limit'](_0x4c93c7['query'][_0x9b39('0x20')]);_0x28e82f[_0x9b39('0x1e')]=qs[_0x9b39('0x1e')](_0x4c93c7[_0x9b39('0x3c')][_0x9b39('0x1e')]);}return _0x93e133[_0x9b39('0xd9')](_0x28e82f);}})[_0x9b39('0x24')](function(_0x2cdba6){if(_0x2cdba6){return _0x2cdba6?{'count':_0x342b1b,'rows':_0x2cdba6}:null;}})[_0x9b39('0x24')](respondWithResult(_0x205a60,null))[_0x9b39('0x4f')](handleError(_0x205a60,null));};exports[_0x9b39('0xdb')]=function(_0x4beba7,_0x3cafa1){var _0x5bd3f6={};var _0x1f2d5a={};var _0x2a1f50;var _0x2911df;return db[_0x9b39('0x36')][_0x9b39('0x92')]({'where':{'id':_0x4beba7[_0x9b39('0x5b')]['id']}})[_0x9b39('0x24')](handleEntityNotFound(_0x3cafa1,null))[_0x9b39('0x24')](function(_0x534076){if(_0x534076){_0x2a1f50=_0x534076;_0x1f2d5a[_0x9b39('0x55')]=_[_0x9b39('0x52')](db[_0x9b39('0xdc')][_0x9b39('0x37')]);_0x1f2d5a[_0x9b39('0x3c')]=_[_0x9b39('0x52')](_0x4beba7[_0x9b39('0x3c')]);_0x1f2d5a[_0x9b39('0xc4')]=_[_0x9b39('0x54')](_0x1f2d5a[_0x9b39('0x55')],_0x1f2d5a[_0x9b39('0x3c')]);_0x5bd3f6[_0x9b39('0x41')]=_[_0x9b39('0x54')](_0x1f2d5a['model'],qs[_0x9b39('0x56')](_0x4beba7[_0x9b39('0x3c')]['fields']));_0x5bd3f6[_0x9b39('0x41')]=_0x5bd3f6[_0x9b39('0x41')][_0x9b39('0x47')]?_0x5bd3f6['attributes']:_0x1f2d5a[_0x9b39('0x55')];_0x5bd3f6[_0x9b39('0xc2')]=qs['sort'](_0x4beba7[_0x9b39('0x3c')][_0x9b39('0xc3')]);_0x5bd3f6['where']=qs[_0x9b39('0xc4')](_[_0x9b39('0xc5')](_0x4beba7['query'],_0x1f2d5a['filters']));if(_0x4beba7['query'][_0x9b39('0x2b')]){_0x5bd3f6[_0x9b39('0x3b')]=_[_0x9b39('0x57')](_0x5bd3f6[_0x9b39('0x3b')],{'$or':_[_0x9b39('0xb5')](_0x5bd3f6['attributes'],function(_0x55a575){var _0xba74b7={};_0xba74b7[_0x55a575]={'$like':'%'+_0x4beba7[_0x9b39('0x3c')][_0x9b39('0x2b')]+'%'};return _0xba74b7;})});}_0x5bd3f6=_[_0x9b39('0x57')]({},_0x5bd3f6,_0x4beba7[_0x9b39('0x58')]);return _0x2a1f50['getFaxInteractions'](_0x5bd3f6);}})['then'](function(_0xf2c5f){if(_0xf2c5f){_0x2911df=_0xf2c5f['length'];if(!_0x4beba7[_0x9b39('0x3c')][_0x9b39('0xca')]('nolimit')){_0x5bd3f6[_0x9b39('0x20')]=qs[_0x9b39('0x20')](_0x4beba7[_0x9b39('0x3c')][_0x9b39('0x20')]);_0x5bd3f6['offset']=qs[_0x9b39('0x1e')](_0x4beba7[_0x9b39('0x3c')]['offset']);}return _0x2a1f50['getFaxInteractions'](_0x5bd3f6);}})['then'](function(_0x111ef4){if(_0x111ef4){return _0x111ef4?{'count':_0x2911df,'rows':_0x111ef4}:null;}})[_0x9b39('0x24')](respondWithResult(_0x3cafa1,null))[_0x9b39('0x4f')](handleError(_0x3cafa1,null));};exports[_0x9b39('0xdd')]=function(_0x323b35,_0x3bb28d){var _0x43b708={};var _0x5383fa={};var _0x35c445;var _0x4ea12e;return db['User'][_0x9b39('0x92')]({'where':{'id':_0x323b35['params']['id']}})[_0x9b39('0x24')](handleEntityNotFound(_0x3bb28d,null))[_0x9b39('0x24')](function(_0x862ab1){if(_0x862ab1){_0x35c445=_0x862ab1;_0x5383fa[_0x9b39('0x55')]=_['keys'](db[_0x9b39('0xde')][_0x9b39('0x37')]);_0x5383fa['query']=_[_0x9b39('0x52')](_0x323b35[_0x9b39('0x3c')]);_0x5383fa['filters']=_[_0x9b39('0x54')](_0x5383fa[_0x9b39('0x55')],_0x5383fa[_0x9b39('0x3c')]);_0x43b708['attributes']=_[_0x9b39('0x54')](_0x5383fa[_0x9b39('0x55')],qs[_0x9b39('0x56')](_0x323b35[_0x9b39('0x3c')]['fields']));_0x43b708[_0x9b39('0x41')]=_0x43b708[_0x9b39('0x41')]['length']?_0x43b708[_0x9b39('0x41')]:_0x5383fa[_0x9b39('0x55')];_0x43b708[_0x9b39('0xc2')]=qs[_0x9b39('0xc3')](_0x323b35['query'][_0x9b39('0xc3')]);_0x43b708[_0x9b39('0x3b')]=qs[_0x9b39('0xc4')](_['pick'](_0x323b35['query'],_0x5383fa[_0x9b39('0xc4')]));if(_0x323b35[_0x9b39('0x3c')]['filter']){_0x43b708[_0x9b39('0x3b')]=_[_0x9b39('0x57')](_0x43b708[_0x9b39('0x3b')],{'$or':_['map'](_0x43b708[_0x9b39('0x41')],function(_0x3c0634){var _0x4dbc52={};_0x4dbc52[_0x3c0634]={'$like':'%'+_0x323b35[_0x9b39('0x3c')][_0x9b39('0x2b')]+'%'};return _0x4dbc52;})});}_0x43b708=_['merge']({},_0x43b708,_0x323b35['options']);return _0x35c445[_0x9b39('0xdd')](_0x43b708);}})['then'](function(_0x124ef7){if(_0x124ef7){_0x4ea12e=_0x124ef7[_0x9b39('0x47')];if(!_0x323b35['query'][_0x9b39('0xca')]('nolimit')){_0x43b708[_0x9b39('0x20')]=qs[_0x9b39('0x20')](_0x323b35[_0x9b39('0x3c')][_0x9b39('0x20')]);_0x43b708['offset']=qs[_0x9b39('0x1e')](_0x323b35[_0x9b39('0x3c')]['offset']);}return _0x35c445[_0x9b39('0xdd')](_0x43b708);}})[_0x9b39('0x24')](function(_0x4688e4){if(_0x4688e4){return _0x4688e4?{'count':_0x4ea12e,'rows':_0x4688e4}:null;}})[_0x9b39('0x24')](respondWithResult(_0x3bb28d,null))[_0x9b39('0x4f')](handleError(_0x3bb28d,null));};exports[_0x9b39('0xdf')]=function(_0x3cfc81,_0x1ccd66,_0x151600){var _0x398789;var _0x99b1d9;var _0xd93553;var _0x33cb9b=!_[_0x9b39('0x64')](_0x3cfc81[_0x9b39('0x5b')]['id'])?_0x3cfc81[_0x9b39('0x5b')]['id']:!_[_0x9b39('0x64')](_0x3cfc81[_0x9b39('0x27')]['id'])?_0x3cfc81[_0x9b39('0x27')]['id']:null;return db[_0x9b39('0x36')][_0x9b39('0x2f')]({'where':{'id':_0x33cb9b,'role':{'$or':['admin','user',_0x9b39('0x28')]}},'attributes':['id',_0x9b39('0x30'),'phone',_0x9b39('0xe0'),_0x9b39('0x2e'),_0x9b39('0x5f'),_0x9b39('0xe1')]})[_0x9b39('0x24')](function(_0x5d2b58){if(_0x5d2b58){if(_0x5d2b58[_0x9b39('0x2e')]===_0x9b39('0x28')){_0x398789=_0x5d2b58;if(_0x3cfc81[_0x9b39('0x5a')]['interface']){_0xd93553=util[_0x9b39('0xe2')](_0x9b39('0xe3'),_0x398789[_0x3cfc81[_0x9b39('0x5a')][_0x9b39('0x9b')]]);}else if(_0x3cfc81['body'][_0x9b39('0xe4')]){_0xd93553=util['format'](_0x9b39('0xa7'),_0x3cfc81[_0x9b39('0x5a')][_0x9b39('0xe4')]);}else{_0xd93553=util[_0x9b39('0xe2')](_0x9b39('0xa7'),_0x398789[_0x9b39('0x30')]);}socket['to'](util[_0x9b39('0xe2')](_0x9b39('0xe5'),_0x398789[_0x9b39('0x30')]))[_0x9b39('0xa3')](_0x9b39('0xe6'),{'user':{'id':_0x398789['id'],'name':_0x398789['name']},'ip':_0x3cfc81[_0x9b39('0xe7')][_0x9b39('0xe8')]||_0x3cfc81[_0x9b39('0xe9')][_0x9b39('0xea')]||_0x3cfc81['socket'][_0x9b39('0xea')]||_0x3cfc81['connection'][_0x9b39('0xeb')]['remoteAddress']});return db[_0x9b39('0xa9')][_0x9b39('0x32')]({'where':{'membername':_0x398789['name']},'individualHooks':!![]});}}else{throw new db[(_0x9b39('0x8d'))]['ValidationError']('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})[_0x9b39('0x24')](function(){if(_0x398789){return _0x398789['getVoiceQueues']({'raw':!![]});}})[_0x9b39('0x24')](function(_0x224b78){if(_0x398789){var _0x27c883=[];if(_0x224b78){_0x99b1d9=_0x224b78;if(_0x99b1d9[_0x9b39('0x47')]){for(var _0x50490f=0x0;_0x50490f<_0x99b1d9[_0x9b39('0x47')];_0x50490f++){_0x27c883[_0x9b39('0x42')]({'membername':_0x398789[_0x9b39('0x30')],'UserId':_0x398789['id'],'queue_name':_0x99b1d9[_0x50490f][_0x9b39('0x30')],'VoiceQueueId':_0x99b1d9[_0x50490f]['id'],'interface':_0xd93553,'paused':_0x398789[_0x9b39('0xe1')]||![],'penalty':_0x99b1d9[_0x50490f][_0x9b39('0xec')]||0x0});}return BPromise[_0x9b39('0xa8')](_0x27c883,function(_0x4cf7bf){return db[_0x9b39('0xa9')]['upsert'](_0x4cf7bf);});}}}})['then'](function(){if(_0x398789){return db[_0x9b39('0xed')][_0x9b39('0x43')]({'where':{'membername':_0x398789[_0x9b39('0x30')],'exitAt':null}});}})[_0x9b39('0x24')](function(_0x5aeef6){if(_0x398789){var _0x5eb0b4=[];_0x5aeef6[_0x9b39('0xee')](function(_0x41f9b5){_0x5eb0b4['push'](_0x41f9b5[_0x9b39('0x23')]({'exitAt':moment()[_0x9b39('0xe2')](_0x9b39('0xef'))}));});return BPromise[_0x9b39('0x4e')](_0x5eb0b4);}})[_0x9b39('0x24')](function(){if(_0x398789){var _0x38a481=[];var _0x157a7b=[];var _0x1dc460=utils['getChannels']();var _0x5be3d5={'membername':_0x398789[_0x9b39('0x30')],'interface':_0xd93553,'enterAt':moment()[_0x9b39('0xe2')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x398789[_0x9b39('0x2e')],'internal':_0x398789[_0x9b39('0x5f')]};_0x1dc460[_0x9b39('0xee')](function(_0x3be259){_0x38a481[_0x9b39('0x42')](_[_0x9b39('0x57')]({'channel':_0x3be259,'type':_0x9b39('0xf0'),'data1':_0x3cfc81[_0x9b39('0x5a')][_0x9b39('0xf1')],'data2':_0xd93553},_0x5be3d5));if(_0x398789[_0x9b39('0xe1')]){_0x157a7b[_0x9b39('0x42')](_[_0x9b39('0x57')]({'channel':_0x3be259,'type':_0x9b39('0xf2'),'data1':_0x9b39('0xf3')},_0x5be3d5));}});return db[_0x9b39('0xed')]['bulkCreate'](_0x38a481[_0x9b39('0xbf')](_0x157a7b),{'individualHooks':!![]});}})[_0x9b39('0x24')](function(){if(_0x398789){return _0x398789[_0x9b39('0x23')]({'online':!![],'lastLoginAt':moment()[_0x9b39('0xe2')](_0x9b39('0xef')),'voicePause':_0x398789[_0x9b39('0xe1')]||![],'mailPause':_0x398789[_0x9b39('0xe1')]||![],'chatPause':_0x398789[_0x9b39('0xe1')]||![],'faxPause':_0x398789[_0x9b39('0xe1')]||![],'smsPause':_0x398789[_0x9b39('0xe1')]||![],'openchannelPause':_0x398789[_0x9b39('0xe1')]||![],'whatsappPause':_0x398789[_0x9b39('0xe1')]||![],'pauseType':_0x398789[_0x9b39('0xe1')]?'LOGININPAUSE':null,'interface':_0xd93553,'lastPauseAt':moment()[_0x9b39('0xe2')](_0x9b39('0xef'))});}})[_0x9b39('0x24')](function(_0x548a35){if(_0x3cfc81[_0x9b39('0xf4')]){return _0x151600();}else{return BPromise[_0x9b39('0xf5')](_0x548a35)[_0x9b39('0x24')](respondWithResult(_0x1ccd66,null));}})['catch'](handleError(_0x1ccd66,null));};exports['logout']=function(_0x326154,_0x1b11f8){var _0x17766e;return db[_0x9b39('0x36')]['find']({'where':{'id':_0x326154[_0x9b39('0x5b')]['id'],'role':_0x9b39('0x28')},'attributes':['id',_0x9b39('0x30'),_0x9b39('0x2e')]})[_0x9b39('0x24')](handleEntityNotFound(_0x1b11f8,null))[_0x9b39('0x24')](function(_0x4c06fb){if(_0x4c06fb){_0x17766e=_0x4c06fb;return db[_0x9b39('0xa9')]['destroy']({'where':{'membername':_0x17766e['name']},'individualHooks':!![]});}})[_0x9b39('0x24')](function(){return db[_0x9b39('0xed')]['findAll']({'where':{'membername':_0x17766e['name'],'exitAt':null}});})[_0x9b39('0x24')](function(_0x412a60){var _0x6c7331=[];_0x412a60[_0x9b39('0xee')](function(_0x2b840e){_0x6c7331['push'](_0x2b840e[_0x9b39('0x23')]({'exitAt':moment()['format'](_0x9b39('0xef'))}));});return BPromise['all'](_0x6c7331);})['then'](function(){return _0x17766e[_0x9b39('0x23')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x9b39('0x24')](respondWithResult(_0x1b11f8,null))[_0x9b39('0x4f')](handleError(_0x1b11f8,null));};exports[_0x9b39('0xf6')]=function(_0x370895,_0x508932){var _0x56a4b5;return db['UserVoiceQueueRt']['update']({'paused':0x1},{'where':{'UserId':_0x370895[_0x9b39('0x5b')]['id']},'individualHooks':!![]})['then'](function(){return db[_0x9b39('0x36')]['find']({'where':{'id':_0x370895['params']['id'],'role':_0x9b39('0x28')},'attributes':['id','name',_0x9b39('0x2e'),_0x9b39('0x5f'),_0x9b39('0x9b')]});})[_0x9b39('0x24')](handleEntityNotFound(_0x508932,null))[_0x9b39('0x24')](function(_0x4bb26e){if(_0x4bb26e){_0x56a4b5=_0x4bb26e;return respondWithRpcPromise(_0x9b39('0xf7'),_0x9b39('0xf6'),{'id':_0x56a4b5['id'],'name':_0x56a4b5[_0x9b39('0x30')],'pause':!![]});}})[_0x9b39('0x24')](function(){if(_0x56a4b5){return db[_0x9b39('0xed')][_0x9b39('0x43')]({'where':{'membername':_0x56a4b5[_0x9b39('0x30')],'type':'PAUSE','exitAt':null}});}})[_0x9b39('0x24')](function(_0x5b0384){if(_0x5b0384['length']){var _0x27bc8e=moment()[_0x9b39('0xe2')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x5f2994=0x0,_0x3df2c7=_0x5b0384[_0x9b39('0x47')];_0x5f2994<_0x3df2c7;_0x5f2994++){_0x5b0384[_0x5f2994][_0x9b39('0xf8')]({'exitAt':_0x27bc8e});}}})[_0x9b39('0x24')](function(){var _0x27d53b=[];var _0x60a521=utils[_0x9b39('0xf9')]();_0x60a521[_0x9b39('0xee')](function(_0x549c47){_0x27d53b[_0x9b39('0x42')]({'channel':_0x549c47,'membername':_0x56a4b5[_0x9b39('0x30')],'interface':_[_0x9b39('0x64')](_0x56a4b5[_0x9b39('0x9b')])?util[_0x9b39('0xe2')]('SIP/%s',_0x56a4b5[_0x9b39('0x30')]):_0x56a4b5[_0x9b39('0x9b')],'type':_0x9b39('0xf2'),'enterAt':moment()['format'](_0x9b39('0xef')),'data1':_0x370895[_0x9b39('0x5a')][_0x9b39('0xfa')]||'DEFAULT\x20PAUSE','role':_0x56a4b5[_0x9b39('0x2e')],'internal':_0x56a4b5[_0x9b39('0x5f')]});});return db['MemberReport'][_0x9b39('0xfb')](_0x27d53b,{'individualHooks':!![]});})[_0x9b39('0x24')](function(){return _0x56a4b5[_0x9b39('0x23')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x370895['body'][_0x9b39('0xfa')]||_0x9b39('0xfc'),'lastPauseAt':moment()['format'](_0x9b39('0xef'))});})[_0x9b39('0x24')](respondWithResult(_0x508932,null))[_0x9b39('0x4f')](handleError(_0x508932,null));};exports[_0x9b39('0xfd')]=function(_0x182ab9,_0x514dd8){var _0x48c5c1;return db[_0x9b39('0x36')][_0x9b39('0x2f')]({'where':{'id':_0x182ab9[_0x9b39('0x5b')]['id']},'attributes':['id',_0x9b39('0x30'),'role',_0x9b39('0x9a'),'mailPause',_0x9b39('0xfe'),_0x9b39('0xff'),_0x9b39('0x100'),_0x9b39('0x101'),_0x9b39('0x102'),'pauseType','lastPauseAt']})['then'](handleEntityNotFound(_0x514dd8,null))['then'](function(_0x103b9b){if(_0x103b9b){_0x48c5c1=_0x103b9b;if(_0x182ab9['body'][_0x9b39('0x98')]&&!utils[_0x9b39('0x9c')](_0x182ab9[_0x9b39('0x5a')][_0x9b39('0x98')])){throw new db[(_0x9b39('0x8d'))][(_0x9b39('0x8c'))]('Unknown\x20channel');}switch(_0x182ab9['body'][_0x9b39('0x98')]){case'voice':return respondWithRpcPromise('QueuePause','unpause',{'id':_0x48c5c1['id'],'name':_0x48c5c1[_0x9b39('0x30')],'pause':![]})[_0x9b39('0x24')](function(){return db['UserVoiceQueueRt'][_0x9b39('0x23')]({'paused':0x0},{'where':{'UserId':_0x48c5c1['id']},'individualHooks':!![]});})[_0x9b39('0x24')](function(){return db[_0x9b39('0xed')][_0x9b39('0x2f')]({'where':{'channel':_0x182ab9[_0x9b39('0x5a')][_0x9b39('0x98')],'membername':_0x48c5c1[_0x9b39('0x30')],'type':_0x9b39('0xf2'),'exitAt':null}});})[_0x9b39('0x24')](function(_0x372447){if(_0x372447){return _0x372447[_0x9b39('0x23')]({'exitAt':moment()[_0x9b39('0xe2')](_0x9b39('0xef')),'data2':_0x9b39('0x103')},{'individualHooks':!![]});}return null;})[_0x9b39('0x24')](function(){return _0x48c5c1[_0x9b39('0x23')]({'voicePause':![]});});case _0x9b39('0x4b'):case'chat':case _0x9b39('0x4a'):case'sms':case'whatsapp':case'openchannel':return db['MemberReport'][_0x9b39('0x2f')]({'where':{'channel':_0x182ab9['body'][_0x9b39('0x98')],'membername':_0x48c5c1['name'],'type':'PAUSE','exitAt':null}})['then'](function(_0x116c4a){if(_0x116c4a){return _0x116c4a[_0x9b39('0x23')]({'exitAt':moment()['format'](_0x9b39('0xef')),'data2':_0x9b39('0x103')},{'individualHooks':!![]});}return null;})[_0x9b39('0x24')](function(){var _0x15e471={};_[_0x9b39('0x104')](_0x15e471,util[_0x9b39('0xe2')]('%s%s',_0x182ab9['body']['channel'],'Pause'),![]);return _0x48c5c1['update'](_0x15e471);});default:return respondWithRpcPromise('QueuePause','unpause',{'id':_0x48c5c1['id'],'name':_0x48c5c1[_0x9b39('0x30')],'pause':![]})[_0x9b39('0x24')](function(){return db[_0x9b39('0xa9')][_0x9b39('0x23')]({'paused':0x0},{'where':{'UserId':_0x48c5c1['id']}});})[_0x9b39('0x24')](function(){return db[_0x9b39('0xed')]['findAll']({'where':{'membername':_0x48c5c1[_0x9b39('0x30')],'type':_0x9b39('0xf2'),'exitAt':null}});})[_0x9b39('0x24')](function(_0x141261){var _0x4ce7b6=[];_0x141261[_0x9b39('0xee')](function(_0x77b15f){_0x4ce7b6[_0x9b39('0x42')](_0x77b15f[_0x9b39('0x23')]({'exitAt':moment()['format'](_0x9b39('0xef')),'data2':_0x9b39('0x103')}));});return BPromise[_0x9b39('0x4e')](_0x4ce7b6);})['then'](function(){return _0x48c5c1[_0x9b39('0x23')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x9b39('0x24')](respondWithResult(_0x514dd8,null))[_0x9b39('0x4f')](handleError(_0x514dd8,null));};exports[_0x9b39('0x105')]=function(_0x239ef1,_0x1615d3){var _0xf96ba9={};var _0x1a50e8={};var _0x57f3e7;var _0x496881;return db[_0x9b39('0x36')][_0x9b39('0x92')]({'where':{'id':_0x239ef1[_0x9b39('0x5b')]['id']}})['then'](handleEntityNotFound(_0x1615d3,null))[_0x9b39('0x24')](function(_0x8d7aee){if(_0x8d7aee){_0x57f3e7=_0x8d7aee;_0x1a50e8[_0x9b39('0x55')]=_[_0x9b39('0x52')](db['Team'][_0x9b39('0x37')]);_0x1a50e8['query']=_[_0x9b39('0x52')](_0x239ef1[_0x9b39('0x3c')]);_0x1a50e8['filters']=_[_0x9b39('0x54')](_0x1a50e8[_0x9b39('0x55')],_0x1a50e8[_0x9b39('0x3c')]);_0xf96ba9[_0x9b39('0x41')]=_[_0x9b39('0x54')](_0x1a50e8['model'],qs[_0x9b39('0x56')](_0x239ef1['query'][_0x9b39('0x56')]));_0xf96ba9['attributes']=_0xf96ba9[_0x9b39('0x41')][_0x9b39('0x47')]?_0xf96ba9[_0x9b39('0x41')]:_0x1a50e8[_0x9b39('0x55')];_0xf96ba9['order']=qs[_0x9b39('0xc3')](_0x239ef1[_0x9b39('0x3c')][_0x9b39('0xc3')]);_0xf96ba9['where']=qs[_0x9b39('0xc4')](_['pick'](_0x239ef1[_0x9b39('0x3c')],_0x1a50e8['filters']));if(_0x239ef1[_0x9b39('0x3c')][_0x9b39('0x2b')]){_0xf96ba9[_0x9b39('0x3b')]=_[_0x9b39('0x57')](_0xf96ba9[_0x9b39('0x3b')],{'$or':_['map'](_0xf96ba9[_0x9b39('0x41')],function(_0x359be9){var _0x3ba486={};_0x3ba486[_0x359be9]={'$like':'%'+_0x239ef1['query'][_0x9b39('0x2b')]+'%'};return _0x3ba486;})});}_0xf96ba9=_[_0x9b39('0x57')]({},_0xf96ba9,_0x239ef1[_0x9b39('0x58')]);return _0x57f3e7['getTeams'](_0xf96ba9);}})[_0x9b39('0x24')](function(_0x3025b7){if(_0x3025b7){_0x496881=_0x3025b7[_0x9b39('0x47')];if(!_0x239ef1[_0x9b39('0x3c')][_0x9b39('0xca')](_0x9b39('0xcb'))){_0xf96ba9[_0x9b39('0x20')]=qs['limit'](_0x239ef1[_0x9b39('0x3c')][_0x9b39('0x20')]);_0xf96ba9[_0x9b39('0x1e')]=qs['offset'](_0x239ef1[_0x9b39('0x3c')][_0x9b39('0x1e')]);}return _0x57f3e7[_0x9b39('0x105')](_0xf96ba9);}})[_0x9b39('0x24')](function(_0x4a27fc){if(_0x4a27fc){return _0x4a27fc?{'count':_0x496881,'rows':_0x4a27fc}:null;}})['then'](respondWithResult(_0x1615d3,null))[_0x9b39('0x4f')](handleError(_0x1615d3,null));};exports[_0x9b39('0x106')]=function(_0x39c85c,_0x3f1456){return db[_0x9b39('0x36')][_0x9b39('0x2f')]({'where':{'id':_0x39c85c[_0x9b39('0x5b')]['id']}})[_0x9b39('0x24')](handleEntityNotFound(_0x3f1456,null))[_0x9b39('0x24')](function(_0x217462){if(_0x217462){var _0x3080ed=_0x217462[_0x9b39('0xa5')]({'plain':!![]});return _0x217462[_0x9b39('0x106')](_0x39c85c[_0x9b39('0x5a')][_0x9b39('0x5e')],_[_0x9b39('0x107')](_0x39c85c[_0x9b39('0x5a')],[_0x9b39('0x5e'),'id'])||{})['then'](function(){for(var _0x17798c=0x0;_0x17798c<_0x39c85c[_0x9b39('0x5a')]['ids'][_0x9b39('0x47')];_0x17798c++){var _0x2deb30=[];var _0x2a246d={};db[_0x9b39('0x108')][_0x9b39('0x92')]({'where':{'id':_0x39c85c[_0x9b39('0x5a')][_0x9b39('0x5e')][_0x17798c]}})[_0x9b39('0x24')](function(_0x7b932d){_0x2a246d=_0x7b932d[_0x9b39('0x4c')];_0x2deb30[_0x9b39('0x42')](_0x7b932d['getVoiceQueues']()[_0x9b39('0x24')](function(_0x46ba2d){for(var _0x38c1af=0x0;_0x38c1af<_0x46ba2d[_0x9b39('0x47')];_0x38c1af++){_0x46ba2d[_0x38c1af]['setDataValue'](_0x9b39('0x98'),'Voice');}return _0x46ba2d;}));_0x2deb30[_0x9b39('0x42')](_0x7b932d['getChatQueues']()[_0x9b39('0x24')](function(_0x1fa79b){for(var _0xdcfc9e=0x0;_0xdcfc9e<_0x1fa79b[_0x9b39('0x47')];_0xdcfc9e++){_0x1fa79b[_0xdcfc9e][_0x9b39('0x109')](_0x9b39('0x98'),_0x9b39('0x10a'));}return _0x1fa79b;}));_0x2deb30['push'](_0x7b932d[_0x9b39('0x10b')]()[_0x9b39('0x24')](function(_0x181250){for(var _0xa40b0b=0x0;_0xa40b0b<_0x181250['length'];_0xa40b0b++){_0x181250[_0xa40b0b]['setDataValue'](_0x9b39('0x98'),'Mail');}return _0x181250;}));_0x2deb30[_0x9b39('0x42')](_0x7b932d[_0x9b39('0x10c')]()['then'](function(_0x2078a6){for(var _0x36cc2e=0x0;_0x36cc2e<_0x2078a6[_0x9b39('0x47')];_0x36cc2e++){_0x2078a6[_0x36cc2e][_0x9b39('0x109')](_0x9b39('0x98'),'Sms');}return _0x2078a6;}));_0x2deb30[_0x9b39('0x42')](_0x7b932d['getWhatsappQueues']()[_0x9b39('0x24')](function(_0x152660){for(var _0x382702=0x0;_0x382702<_0x152660['length'];_0x382702++){_0x152660[_0x382702][_0x9b39('0x109')]('channel',_0x9b39('0x10d'));}return _0x152660;}));_0x2deb30[_0x9b39('0x42')](_0x7b932d[_0x9b39('0x10e')]()[_0x9b39('0x24')](function(_0x39ece7){for(var _0x13d7de=0x0;_0x13d7de<_0x39ece7[_0x9b39('0x47')];_0x13d7de++){_0x39ece7[_0x13d7de][_0x9b39('0x109')](_0x9b39('0x98'),'Fax');}return _0x39ece7;}));_0x2deb30[_0x9b39('0x42')](_0x7b932d[_0x9b39('0x10f')]()[_0x9b39('0x24')](function(_0x45b898){for(var _0x3ddf48=0x0;_0x3ddf48<_0x45b898[_0x9b39('0x47')];_0x3ddf48++){_0x45b898[_0x3ddf48][_0x9b39('0x109')](_0x9b39('0x98'),_0x9b39('0x110'));}return _0x45b898;}));return BPromise[_0x9b39('0x4e')](_0x2deb30);})[_0x9b39('0x24')](function(_0x2d69ee){var _0x28c5ab=_[_0x9b39('0x111')](_0x2d69ee);_0x2deb30=[];return db[_0x9b39('0x66')][_0x9b39('0x112')](function(_0x19a341){for(var _0x10252f=0x0;_0x10252f<_0x28c5ab[_0x9b39('0x47')];_0x10252f++){_0x2deb30['push'](_0x28c5ab[_0x10252f][_0x9b39('0x113')](_0x3080ed['id']),{'transaction':_0x19a341});}return BPromise[_0x9b39('0x4e')](_0x2deb30)['then'](function(){if(_0x3080ed[_0x9b39('0x99')]){return BPromise[_0x9b39('0xa8')](_[_0x9b39('0x2b')](_0x28c5ab,function(_0xcfa838){return _0xcfa838[_0x9b39('0x114')](_0x9b39('0x98'))===_0x9b39('0x115');}),function(_0x490c1a){return db[_0x9b39('0xa9')][_0x9b39('0x116')]({'membername':_0x3080ed[_0x9b39('0x30')],'UserId':_0x3080ed['id'],'queue_name':_0x490c1a['name'],'VoiceQueueId':_0x490c1a['id'],'interface':_[_0x9b39('0x64')](_0x3080ed[_0x9b39('0x9b')])?util['format'](_0x9b39('0xa7'),_0x3080ed[_0x9b39('0x30')]):_0x3080ed[_0x9b39('0x9b')],'paused':_0x3080ed[_0x9b39('0x9a')]||![],'penalty':_0x3080ed[_0x9b39('0xa0')]},{'transaction':_0x19a341});});}else{return;}})['then'](function(){for(var _0x3877b1=0x0;_0x3877b1<_0x28c5ab[_0x9b39('0x47')];_0x3877b1++){var _0x4edd27=_0x28c5ab[_0x3877b1]['getDataValue'](_0x9b39('0x98'));var _0x525422=_0x4edd27+_0x9b39('0xa2');socket[_0x9b39('0xa3')](_0x9b39('0x27')+_0x4edd27+_0x9b39('0x117'),{'UserId':_0x3080ed['id'],['queueField']:_0x28c5ab[_0x3877b1]['id']});}});});})[_0x9b39('0x24')](function(){db[_0x9b39('0x118')]['findOne']({'where':{'teamId':_0x2a246d['id']}})[_0x9b39('0x24')](function(_0x2d949e){if(_0x2d949e){db[_0x9b39('0x119')][_0x9b39('0x7a')]({'UserId':_0x39c85c['params']['id'],'VoicePrefixId':_0x2d949e['VoicePrefixId']});}});});}});}})[_0x9b39('0x24')](respondWithStatusCode(_0x3f1456,null))[_0x9b39('0x4f')](handleError(_0x3f1456,null));};exports['removeTeams']=function(_0x4d7604,_0x3becc7){return db[_0x9b39('0x36')]['findOne']({'where':{'id':_0x4d7604['params']['id']}})['then'](handleEntityNotFound(_0x3becc7,null))[_0x9b39('0x24')](function(_0x3257ee){if(_0x3257ee){var _0xd361ed=_0x3257ee[_0x9b39('0xa5')]({'plain':!![]});var _0xba92d6=_0x4d7604[_0x9b39('0x3c')][_0x9b39('0x5e')];return _0x3257ee[_0x9b39('0x11a')](_0xba92d6)[_0x9b39('0x24')](function(){for(var _0x1f586e=0x0;_0x1f586e<_0xba92d6[_0x9b39('0x47')];_0x1f586e++){var _0x220234=[];var _0x2c040a={};db[_0x9b39('0x108')][_0x9b39('0x92')]({'where':{'id':_0xba92d6[_0x1f586e]}})['then'](function(_0x3360db){_0x2c040a=_0x3360db[_0x9b39('0x4c')];_0x220234[_0x9b39('0x42')](_0x3360db[_0x9b39('0x11b')]()[_0x9b39('0x24')](function(_0x6f37cb){for(var _0x3241f9=0x0;_0x3241f9<_0x6f37cb[_0x9b39('0x47')];_0x3241f9++){_0x6f37cb[_0x3241f9]['setDataValue']('channel','Voice');}return _0x6f37cb;}));_0x220234[_0x9b39('0x42')](_0x3360db[_0x9b39('0x11c')]()[_0x9b39('0x24')](function(_0x3b8b7a){for(var _0x4193cb=0x0;_0x4193cb<_0x3b8b7a[_0x9b39('0x47')];_0x4193cb++){_0x3b8b7a[_0x4193cb][_0x9b39('0x109')](_0x9b39('0x98'),_0x9b39('0x10a'));}return _0x3b8b7a;}));_0x220234[_0x9b39('0x42')](_0x3360db[_0x9b39('0x10b')]()[_0x9b39('0x24')](function(_0x475ab6){for(var _0x438603=0x0;_0x438603<_0x475ab6[_0x9b39('0x47')];_0x438603++){_0x475ab6[_0x438603][_0x9b39('0x109')](_0x9b39('0x98'),_0x9b39('0x11d'));}return _0x475ab6;}));_0x220234['push'](_0x3360db[_0x9b39('0x10c')]()[_0x9b39('0x24')](function(_0x3b3031){for(var _0x4fe81f=0x0;_0x4fe81f<_0x3b3031[_0x9b39('0x47')];_0x4fe81f++){_0x3b3031[_0x4fe81f][_0x9b39('0x109')](_0x9b39('0x98'),_0x9b39('0x11e'));}return _0x3b3031;}));_0x220234[_0x9b39('0x42')](_0x3360db[_0x9b39('0x11f')]()[_0x9b39('0x24')](function(_0x307152){for(var _0x2a9f90=0x0;_0x2a9f90<_0x307152[_0x9b39('0x47')];_0x2a9f90++){_0x307152[_0x2a9f90]['setDataValue']('channel',_0x9b39('0x10d'));}return _0x307152;}));_0x220234[_0x9b39('0x42')](_0x3360db[_0x9b39('0x10e')]()[_0x9b39('0x24')](function(_0x50e6df){for(var _0x2bdfbe=0x0;_0x2bdfbe<_0x50e6df[_0x9b39('0x47')];_0x2bdfbe++){_0x50e6df[_0x2bdfbe][_0x9b39('0x109')](_0x9b39('0x98'),_0x9b39('0x120'));}return _0x50e6df;}));_0x220234[_0x9b39('0x42')](_0x3360db[_0x9b39('0x10f')]()[_0x9b39('0x24')](function(_0x202309){for(var _0xdf9096=0x0;_0xdf9096<_0x202309[_0x9b39('0x47')];_0xdf9096++){_0x202309[_0xdf9096][_0x9b39('0x109')](_0x9b39('0x98'),'Openchannel');}return _0x202309;}));return BPromise[_0x9b39('0x4e')](_0x220234);})['then'](function(_0x50c6f5){var _0x2b2775=_['flatten'](_0x50c6f5);_0x220234=[];return db[_0x9b39('0x66')]['transaction'](function(_0x3ec1ab){for(var _0x57f43d=0x0;_0x57f43d<_0x2b2775[_0x9b39('0x47')];_0x57f43d++){_0x220234[_0x9b39('0x42')](_0x2b2775[_0x57f43d][_0x9b39('0x121')](_0xd361ed['id']),{'transaction':_0x3ec1ab});}return BPromise[_0x9b39('0x4e')](_0x220234)[_0x9b39('0x24')](function(){if(_0xd361ed[_0x9b39('0x99')]){return BPromise[_0x9b39('0xa8')](_[_0x9b39('0x2b')](_0x2b2775,function(_0x5c081b){return _0x5c081b[_0x9b39('0x114')](_0x9b39('0x98'))===_0x9b39('0x115');}),function(_0x5a419b){return db[_0x9b39('0xa9')][_0x9b39('0x32')]({'where':{'VoiceQueueId':_0x5a419b['id'],'UserId':_0xd361ed['id']},'transaction':_0x3ec1ab});});}else{return;}})[_0x9b39('0x24')](function(){db[_0x9b39('0x118')][_0x9b39('0x92')]({'where':{'teamId':_0x2c040a['id']}})[_0x9b39('0x24')](function(_0x151432){if(_0x151432){return db['UserVoicePrefix'][_0x9b39('0x32')]({'where':{'UserId':_0xd361ed['id'],'VoicePrefixId':_0x151432[_0x9b39('0x4c')][_0x9b39('0x122')]}});}});})[_0x9b39('0x24')](function(){for(var _0x7ab93e=0x0;_0x7ab93e<_0x2b2775[_0x9b39('0x47')];_0x7ab93e++){var _0x52466f=_0x2b2775[_0x7ab93e][_0x9b39('0x114')](_0x9b39('0x98'));var _0x4c979=_0x52466f+'QueueId';socket[_0x9b39('0xa3')](_0x9b39('0x27')+_0x52466f+_0x9b39('0xab'),{'UserId':_0xd361ed['id'],['queueField']:_0x2b2775[_0x7ab93e]['id']});}});});});}});}})['then'](respondWithStatusCode(_0x3becc7,null))[_0x9b39('0x4f')](handleError(_0x3becc7,null));};exports[_0x9b39('0x123')]=function(_0x506735,_0x5ca1e8){var _0x299301={};var _0x39d19e={};var _0x4962bc;var _0xee09bb;return db[_0x9b39('0x36')][_0x9b39('0x92')]({'where':{'id':_0x506735[_0x9b39('0x5b')]['id']}})[_0x9b39('0x24')](handleEntityNotFound(_0x5ca1e8,null))['then'](function(_0x5a9498){if(_0x5a9498){_0x4962bc=_0x5a9498;_0x39d19e[_0x9b39('0x55')]=_['keys'](db['CmList'][_0x9b39('0x37')]);_0x39d19e[_0x9b39('0x3c')]=_['keys'](_0x506735[_0x9b39('0x3c')]);_0x39d19e[_0x9b39('0xc4')]=_['intersection'](_0x39d19e[_0x9b39('0x55')],_0x39d19e['query']);_0x299301[_0x9b39('0x41')]=_['intersection'](_0x39d19e[_0x9b39('0x55')],qs[_0x9b39('0x56')](_0x506735[_0x9b39('0x3c')]['fields']));_0x299301[_0x9b39('0x41')]=_0x299301['attributes']['length']?_0x299301['attributes']:_0x39d19e[_0x9b39('0x55')];_0x299301[_0x9b39('0xc2')]=qs['sort'](_0x506735['query'][_0x9b39('0xc3')]);_0x299301[_0x9b39('0x3b')]=qs[_0x9b39('0xc4')](_[_0x9b39('0xc5')](_0x506735['query'],_0x39d19e['filters']));if(_0x506735[_0x9b39('0x3c')][_0x9b39('0x2b')]){_0x299301['where']=_['merge'](_0x299301[_0x9b39('0x3b')],{'$or':_[_0x9b39('0xb5')](_0x299301[_0x9b39('0x41')],function(_0x26ba78){var _0x57e9b5={};_0x57e9b5[_0x26ba78]={'$like':'%'+_0x506735['query'][_0x9b39('0x2b')]+'%'};return _0x57e9b5;})});}_0x299301=_[_0x9b39('0x57')]({},_0x299301,_0x506735[_0x9b39('0x58')]);return _0x4962bc[_0x9b39('0x123')](_0x299301);}})['then'](function(_0x75550d){if(_0x75550d){_0xee09bb=_0x75550d[_0x9b39('0x47')];if(!_0x506735[_0x9b39('0x3c')][_0x9b39('0xca')](_0x9b39('0xcb'))){_0x299301['limit']=qs[_0x9b39('0x20')](_0x506735[_0x9b39('0x3c')][_0x9b39('0x20')]);_0x299301['offset']=qs[_0x9b39('0x1e')](_0x506735[_0x9b39('0x3c')][_0x9b39('0x1e')]);}return _0x4962bc[_0x9b39('0x123')](_0x299301);}})[_0x9b39('0x24')](function(_0x4c562f){if(_0x4c562f){return _0x4c562f?{'count':_0xee09bb,'rows':_0x4c562f}:null;}})[_0x9b39('0x24')](respondWithResult(_0x5ca1e8,null))['catch'](handleError(_0x5ca1e8,null));};exports[_0x9b39('0x124')]=function(_0x34f37d,_0x27ad40){var _0x5edc4a={};var _0x4c6de8={};var _0x2542e3;return db[_0x9b39('0x36')]['findOne']({'where':{'id':_0x34f37d[_0x9b39('0x5b')]['id']}})[_0x9b39('0x24')](handleEntityNotFound(_0x27ad40,null))[_0x9b39('0x24')](function(_0x553a93){if(_0x553a93){_0x2542e3=_0x553a93;_0x4c6de8[_0x9b39('0x55')]=_[_0x9b39('0x52')](db[_0x9b39('0x36')][_0x9b39('0x37')]);_0x4c6de8[_0x9b39('0x3c')]=_[_0x9b39('0x52')](_0x34f37d[_0x9b39('0x3c')]);_0x4c6de8[_0x9b39('0xc4')]=_[_0x9b39('0x54')](_0x4c6de8['model'],_0x4c6de8[_0x9b39('0x3c')]);_0x5edc4a[_0x9b39('0x41')]=_[_0x9b39('0x54')](_0x4c6de8[_0x9b39('0x55')],qs[_0x9b39('0x56')](_0x34f37d['query']['fields']));_0x5edc4a[_0x9b39('0x41')]=_0x5edc4a[_0x9b39('0x41')][_0x9b39('0x47')]?_0x5edc4a[_0x9b39('0x41')]:_0x4c6de8[_0x9b39('0x55')];_0x5edc4a[_0x9b39('0xc2')]=qs[_0x9b39('0xc3')](_0x34f37d[_0x9b39('0x3c')][_0x9b39('0xc3')]);_0x5edc4a[_0x9b39('0x3b')]=qs['filters'](_[_0x9b39('0xc5')](_0x34f37d[_0x9b39('0x3c')],_0x4c6de8[_0x9b39('0xc4')]));if(_0x34f37d[_0x9b39('0x3c')][_0x9b39('0x2b')]){_0x5edc4a[_0x9b39('0x3b')]=_[_0x9b39('0x57')](_0x5edc4a[_0x9b39('0x3b')],{'$or':_[_0x9b39('0xb5')](_0x5edc4a[_0x9b39('0x41')],function(_0x5ab804){var _0x3bf3b6={};_0x3bf3b6[_0x5ab804]={'$like':'%'+_0x34f37d['query'][_0x9b39('0x2b')]+'%'};return _0x3bf3b6;})});}_0x5edc4a[_0x9b39('0x55')]=db['User'];_0x5edc4a['as']=_0x9b39('0x82');_0x5edc4a=_['merge']({},_0x5edc4a,_0x34f37d[_0x9b39('0x58')]);return _0x2542e3[_0x9b39('0x11b')]({'include':[_0x5edc4a]});}})[_0x9b39('0x24')](function(_0x523bcc){if(_0x523bcc){var _0x53e16a={},_0x3bf5e4=[];for(var _0x5246fd=0x0;_0x5246fd<_0x523bcc[_0x9b39('0x47')];_0x5246fd+=0x1){for(var _0x2d6676=0x0,_0x1943f8;_0x2d6676<_0x523bcc[_0x5246fd][_0x9b39('0x82')][_0x9b39('0x47')];_0x2d6676+=0x1){_0x1943f8=_0x523bcc[_0x5246fd][_0x9b39('0x82')][_0x2d6676]['get']({'plain':!![]});_0x53e16a[_0x1943f8['id']]=_0x1943f8;}}_0x53e16a=_[_0x9b39('0x125')](_0x53e16a);for(var _0x5855e6=qs[_0x9b39('0x1e')](_0x34f37d[_0x9b39('0x3c')]['offset']);_0x5855e6<_0x53e16a[_0x9b39('0x47')]&&_0x3bf5e4[_0x9b39('0x47')]=_0x239752[_0x08d9('0x51')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0x08d9('0x10')](function(){if(_0x478de6){return db[_0x08d9('0x2c')][_0x08d9('0x48')]({'where':{'membername':_0x478de6[_0x08d9('0x28')]},'individualHooks':!![]});}})['then'](function(){if(_0x478de6){return _0x478de6[_0x08d9('0x52')]({'raw':!![]});}})[_0x08d9('0x10')](function(_0x3ca9c3){if(_0x478de6){if(_0x3ca9c3){var _0xcb902d=[];_0x50d5d5=_0x3ca9c3;if(_0x50d5d5[_0x08d9('0x2e')]){for(var _0x589962=0x0;_0x589962<_0x50d5d5[_0x08d9('0x2e')];_0x589962++){_0xcb902d[_0x08d9('0x53')](db['UserVoiceQueueRt'][_0x08d9('0x54')]({'membername':_0x478de6['name'],'UserId':_0x478de6['id'],'queue_name':_0x50d5d5[_0x589962]['name'],'VoiceQueueId':_0x50d5d5[_0x589962]['id'],'interface':_0x46c305,'paused':_0x478de6['loginInPause']||![],'penalty':_0x50d5d5[_0x589962][_0x08d9('0x55')]||0x0}));}return BPromise[_0x08d9('0x49')](_0xcb902d);}}}})[_0x08d9('0x10')](function(){if(_0x478de6){return db[_0x08d9('0x2d')][_0x08d9('0x1b')]({'where':{'membername':_0x478de6[_0x08d9('0x28')],'exitAt':null}});}})[_0x08d9('0x10')](function(_0x442484){if(_0x478de6){if(_0x442484&&_0x442484[_0x08d9('0x2e')]){var _0x1df227=[];_0x442484[_0x08d9('0x32')](function(_0x3ba27e){_0x1df227['push'](_0x3ba27e[_0x08d9('0x39')]({'exitAt':moment()[_0x08d9('0x2f')](_0x08d9('0x34'))}));});return BPromise[_0x08d9('0x49')](_0x1df227);}}})[_0x08d9('0x10')](function(_0x41310c){if(_0x478de6){var _0x510808=[];var _0x21427b=[];var _0x2545aa=utils[_0x08d9('0x31')]();var _0x42f1c6={'membername':_0x478de6[_0x08d9('0x28')],'interface':_0x46c305,'enterAt':moment()[_0x08d9('0x2f')](_0x08d9('0x34')),'role':_0x478de6[_0x08d9('0x29')],'internal':_0x478de6[_0x08d9('0x2a')]};_0x2545aa[_0x08d9('0x32')](function(_0x5873f5){_0x510808['push'](_[_0x08d9('0x56')]({'channel':_0x5873f5,'type':_0x08d9('0x57'),'data1':_0x08d9('0x58'),'data2':_0x46c305},_0x42f1c6));if(_0x478de6['loginInPause']){_0x21427b[_0x08d9('0x53')](_[_0x08d9('0x56')]({'channel':_0x5873f5,'type':_0x08d9('0x33'),'data1':_0x08d9('0x59')},_0x42f1c6));}});return db[_0x08d9('0x2d')][_0x08d9('0x38')](_0x510808[_0x08d9('0x5a')](_0x21427b),{'individualHooks':!![]});}})[_0x08d9('0x10')](function(){if(_0x478de6){return _0x478de6[_0x08d9('0x39')]({'online':!![],'lastLoginAt':moment()[_0x08d9('0x2f')](_0x08d9('0x34')),'voicePause':_0x478de6[_0x08d9('0x4d')]||![],'mailPause':_0x478de6[_0x08d9('0x4d')]||![],'chatPause':_0x478de6[_0x08d9('0x4d')]||![],'faxPause':_0x478de6[_0x08d9('0x4d')]||![],'smsPause':_0x478de6[_0x08d9('0x4d')]||![],'openchannelPause':_0x478de6[_0x08d9('0x4d')]||![],'pauseType':_0x478de6['loginInPause']?_0x08d9('0x59'):null,'lastPauseAt':moment()[_0x08d9('0x2f')](_0x08d9('0x34')),'interface':_0x46c305});}})['then'](function(_0x24940e){_0x31d8e7(_0x24940e);})[_0x08d9('0x19')](function(_0x5ce55c){_0x340f38(_0x1e8c2e['error'](0x1f4,_0x5ce55c[_0x08d9('0x16')]));});});}; \ No newline at end of file +var _0x3123=['error','code','message','info','catch','GetUser','User','findAll','options','raw','attributes','limit','map','model','include','find','where','ShowUser','name','role','internal','interface','UserVoiceQueueRt','update','MemberReport','format','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','getChannels','forEach','push','isNil','PAUSE','body','type','DEFAULT\x20PAUSE','bulkCreate','UnpauseUser','findOne','channel','isValidChannel','Unknown\x20channel','voice','system','mail','chat','sms','openchannel','whatsapp','set','%s%s','Pause','all','LogoutUser','destroy','LoginUser','mobile','phone','loginInPause','count','agent','../../config/license/util','agents','Maximum\x20login\x20has\x20been\x20reached','UserVoiceQueue.penalty','merge','LOGININPAUSE','concat','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','register','request','then','User,\x20%s,\x20%s','debug','request\x20sent','stringify'];(function(_0x4ecd00,_0x5dde26){var _0x43eae3=function(_0x59eb72){while(--_0x59eb72){_0x4ecd00['push'](_0x4ecd00['shift']());}};_0x43eae3(++_0x5dde26);}(_0x3123,0x9d));var _0x3312=function(_0x478fdb,_0x302093){_0x478fdb=_0x478fdb-0x0;var _0x1ffde2=_0x3123[_0x478fdb];return _0x1ffde2;};'use strict';var _=require('lodash');var util=require(_0x3312('0x0'));var moment=require('moment');var BPromise=require(_0x3312('0x1'));var rs=require(_0x3312('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3312('0x3'))['db'];var utils=require(_0x3312('0x4'));var logger=require(_0x3312('0x5'))(_0x3312('0x6'));var config=require(_0x3312('0x7'));var jayson=require(_0x3312('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x3312('0x9')]=_['defaults'](config['redis'],{'host':_0x3312('0xa'),'port':0x18eb});var socket=require(_0x3312('0xb'))(new Redis(config[_0x3312('0x9')]));require('./user.socket')[_0x3312('0xc')](socket);function respondWithRpcPromise(_0x8a738d,_0x17584b,_0x481da8){return new BPromise(function(_0x5467de,_0x4fdd74){return client[_0x3312('0xd')](_0x8a738d,_0x481da8)[_0x3312('0xe')](function(_0xf0cf17){logger['info'](_0x3312('0xf'),_0x17584b,'request\x20sent');logger[_0x3312('0x10')]('User,\x20%s,\x20%s,\x20%s',_0x17584b,_0x3312('0x11'),JSON[_0x3312('0x12')](_0xf0cf17));if(_0xf0cf17[_0x3312('0x13')]){if(_0xf0cf17[_0x3312('0x13')][_0x3312('0x14')]===0x1f4){logger[_0x3312('0x13')](_0x3312('0xf'),_0x17584b,_0xf0cf17['error']['message']);return _0x4fdd74(_0xf0cf17[_0x3312('0x13')][_0x3312('0x15')]);}logger[_0x3312('0x13')](_0x3312('0xf'),_0x17584b,_0xf0cf17['error'][_0x3312('0x15')]);return _0x5467de(_0xf0cf17[_0x3312('0x13')][_0x3312('0x15')]);}else{logger[_0x3312('0x16')](_0x3312('0xf'),_0x17584b,_0x3312('0x11'));_0x5467de(_0xf0cf17['result'][_0x3312('0x15')]);}})[_0x3312('0x17')](function(_0x568b1f){logger[_0x3312('0x13')]('User,\x20%s,\x20%s',_0x17584b,_0x568b1f);_0x4fdd74(_0x568b1f);});});}exports[_0x3312('0x18')]=function(_0x39a783){var _0x4459a4=this;return new Promise(function(_0x4c2c30,_0x53e236){return db[_0x3312('0x19')][_0x3312('0x1a')]({'raw':_0x39a783[_0x3312('0x1b')]?_0x39a783[_0x3312('0x1b')][_0x3312('0x1c')]===undefined?!![]:![]:!![],'where':_0x39a783[_0x3312('0x1b')]?_0x39a783[_0x3312('0x1b')]['where']||null:null,'attributes':_0x39a783[_0x3312('0x1b')]?_0x39a783[_0x3312('0x1b')][_0x3312('0x1d')]||null:null,'limit':_0x39a783[_0x3312('0x1b')]?_0x39a783[_0x3312('0x1b')][_0x3312('0x1e')]||null:null,'include':_0x39a783[_0x3312('0x1b')]?_0x39a783[_0x3312('0x1b')]['include']?_[_0x3312('0x1f')](_0x39a783[_0x3312('0x1b')]['include'],function(_0x2db040){return{'model':db[_0x2db040[_0x3312('0x20')]],'as':_0x2db040['as'],'attributes':_0x2db040[_0x3312('0x1d')],'include':_0x2db040[_0x3312('0x21')]?_['map'](_0x2db040[_0x3312('0x21')],function(_0x8842d0){return{'model':db[_0x8842d0[_0x3312('0x20')]],'as':_0x8842d0['as'],'attributes':_0x8842d0[_0x3312('0x1d')],'include':_0x8842d0[_0x3312('0x21')]?_[_0x3312('0x1f')](_0x8842d0[_0x3312('0x21')],function(_0x3138c9){return{'model':db[_0x3138c9[_0x3312('0x20')]],'as':_0x3138c9['as'],'attributes':_0x3138c9[_0x3312('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3312('0xe')](function(_0x1e234f){logger['info'](_0x3312('0x18'),_0x39a783);logger[_0x3312('0x10')](_0x3312('0x18'),_0x39a783,JSON[_0x3312('0x12')](_0x1e234f));_0x4c2c30(_0x1e234f);})[_0x3312('0x17')](function(_0x2d3ccd){logger[_0x3312('0x13')](_0x3312('0x18'),_0x2d3ccd[_0x3312('0x15')],_0x39a783);_0x53e236(_0x4459a4[_0x3312('0x13')](0x1f4,_0x2d3ccd[_0x3312('0x15')]));});});};exports['ShowUser']=function(_0x303864){var _0x42376a=this;return new Promise(function(_0x2f3774,_0x29ca0c){return db[_0x3312('0x19')][_0x3312('0x22')]({'raw':_0x303864[_0x3312('0x1b')]?_0x303864[_0x3312('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x303864[_0x3312('0x1b')]?_0x303864[_0x3312('0x1b')][_0x3312('0x23')]||null:null,'attributes':_0x303864[_0x3312('0x1b')]?_0x303864[_0x3312('0x1b')][_0x3312('0x1d')]||null:null,'include':_0x303864[_0x3312('0x1b')]?_0x303864[_0x3312('0x1b')]['include']?_[_0x3312('0x1f')](_0x303864[_0x3312('0x1b')]['include'],function(_0x53eecc){return{'model':db[_0x53eecc['model']],'as':_0x53eecc['as'],'attributes':_0x53eecc[_0x3312('0x1d')],'include':_0x53eecc[_0x3312('0x21')]?_[_0x3312('0x1f')](_0x53eecc[_0x3312('0x21')],function(_0x3147ff){return{'model':db[_0x3147ff[_0x3312('0x20')]],'as':_0x3147ff['as'],'attributes':_0x3147ff[_0x3312('0x1d')],'include':_0x3147ff['include']?_[_0x3312('0x1f')](_0x3147ff[_0x3312('0x21')],function(_0x43acec){return{'model':db[_0x43acec['model']],'as':_0x43acec['as'],'attributes':_0x43acec[_0x3312('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2438b5){logger[_0x3312('0x16')]('ShowUser',_0x303864);logger[_0x3312('0x10')](_0x3312('0x24'),_0x303864,JSON['stringify'](_0x2438b5));_0x2f3774(_0x2438b5);})['catch'](function(_0x1d8aac){logger[_0x3312('0x13')](_0x3312('0x24'),_0x1d8aac[_0x3312('0x15')],_0x303864);_0x29ca0c(_0x42376a[_0x3312('0x13')](0x1f4,_0x1d8aac[_0x3312('0x15')]));});});};exports['PauseUser']=function(_0x4cbf9d){var _0x118aff=this;return new Promise(function(_0x393d64,_0x3de951){var _0x106fe7;return db[_0x3312('0x19')][_0x3312('0x22')]({'where':_0x4cbf9d[_0x3312('0x1b')][_0x3312('0x23')]||{},'attributes':['id',_0x3312('0x25'),_0x3312('0x26'),_0x3312('0x27'),_0x3312('0x28')]})['then'](function(_0x6781d6){if(_0x6781d6){_0x106fe7=_0x6781d6;return db[_0x3312('0x29')][_0x3312('0x2a')]({'paused':0x1},{'where':{'UserId':_0x106fe7['id']},'individualHooks':!![]});}})[_0x3312('0xe')](function(){if(_0x106fe7){return db[_0x3312('0x2b')][_0x3312('0x1a')]({'where':{'membername':_0x106fe7[_0x3312('0x25')],'type':'PAUSE','exitAt':null}});}})[_0x3312('0xe')](function(_0x3095bd){if(_0x106fe7){if(_0x3095bd&&_0x3095bd['length']){var _0x3bf2f4=moment()[_0x3312('0x2c')](_0x3312('0x2d'));for(var _0x316b88=0x0,_0x2871ac=_0x3095bd[_0x3312('0x2e')];_0x316b88<_0x2871ac;_0x316b88++){_0x3095bd[_0x316b88][_0x3312('0x2f')]({'exitAt':_0x3bf2f4});}}}})[_0x3312('0xe')](function(){if(_0x106fe7){var _0xfff697=[];var _0x5bf51e=utils[_0x3312('0x30')]();_0x5bf51e[_0x3312('0x31')](function(_0x3f16ac){_0xfff697[_0x3312('0x32')]({'channel':_0x3f16ac,'membername':_0x106fe7[_0x3312('0x25')],'interface':_[_0x3312('0x33')](_0x106fe7[_0x3312('0x28')])?util['format']('SIP/%s',_0x106fe7[_0x3312('0x25')]):_0x106fe7[_0x3312('0x28')],'type':_0x3312('0x34'),'enterAt':moment()['format'](_0x3312('0x2d')),'data1':_0x4cbf9d[_0x3312('0x35')][_0x3312('0x36')]||_0x3312('0x37'),'role':_0x106fe7['role'],'internal':_0x106fe7[_0x3312('0x27')],'uniqueid':_0x4cbf9d[_0x3312('0x35')]['uniqueid']||null});});return db['MemberReport'][_0x3312('0x38')](_0xfff697,{'individualHooks':!![]});}})[_0x3312('0xe')](function(){if(_0x106fe7){return _0x106fe7[_0x3312('0x2a')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x4cbf9d['body'][_0x3312('0x36')]||_0x3312('0x37'),'lastPauseAt':moment()[_0x3312('0x2c')](_0x3312('0x2d'))});}})[_0x3312('0xe')](function(_0x45e068){_0x393d64(_0x45e068);})[_0x3312('0x17')](function(_0xc50210){_0x3de951(_0x118aff[_0x3312('0x13')](0x1f4,_0xc50210['message']));});});};exports[_0x3312('0x39')]=function(_0x21710f){var _0x394f7f=this;return new Promise(function(_0x1a0060,_0x538222){var _0x1da6b6;return db[_0x3312('0x19')][_0x3312('0x3a')]({'where':_0x21710f[_0x3312('0x1b')]['where']||{},'attributes':['id',_0x3312('0x25')]})[_0x3312('0xe')](function(_0x2cec97){if(_0x2cec97){_0x1da6b6=_0x2cec97;if(_0x21710f[_0x3312('0x35')][_0x3312('0x3b')]&&!utils[_0x3312('0x3c')](_0x21710f[_0x3312('0x35')][_0x3312('0x3b')])){throw new Error(_0x3312('0x3d'));}switch(_0x21710f[_0x3312('0x35')][_0x3312('0x3b')]){case _0x3312('0x3e'):return db[_0x3312('0x29')][_0x3312('0x2a')]({'paused':0x0},{'where':{'UserId':_0x1da6b6['id']}})[_0x3312('0xe')](function(){return db[_0x3312('0x2b')][_0x3312('0x22')]({'where':{'channel':_0x21710f['body'][_0x3312('0x3b')],'membername':_0x1da6b6[_0x3312('0x25')],'type':_0x3312('0x34'),'exitAt':null}});})[_0x3312('0xe')](function(_0x464a90){if(_0x464a90){return _0x464a90['update']({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x3312('0x3f')},{'individualHooks':!![]});}return null;})[_0x3312('0xe')](function(){return _0x1da6b6[_0x3312('0x2a')]({'voicePause':![]});});case _0x3312('0x40'):case _0x3312('0x41'):case'fax':case _0x3312('0x42'):case _0x3312('0x43'):case _0x3312('0x44'):return db['MemberReport']['find']({'where':{'channel':_0x21710f[_0x3312('0x35')]['channel'],'membername':_0x1da6b6['name'],'type':'PAUSE','exitAt':null}})[_0x3312('0xe')](function(_0x5e157c){return _0x5e157c[_0x3312('0x2a')]({'exitAt':moment()[_0x3312('0x2c')](_0x3312('0x2d')),'data2':_0x3312('0x3f')},{'individualHooks':!![]});})[_0x3312('0xe')](function(){var _0x3d0524={};_[_0x3312('0x45')](_0x3d0524,util['format'](_0x3312('0x46'),_0x21710f[_0x3312('0x35')][_0x3312('0x3b')],_0x3312('0x47')),![]);return _0x1da6b6[_0x3312('0x2a')](_0x3d0524);});default:return db[_0x3312('0x29')][_0x3312('0x2a')]({'paused':0x0},{'where':{'UserId':_0x1da6b6['id']}})[_0x3312('0xe')](function(){return db[_0x3312('0x2b')][_0x3312('0x1a')]({'where':{'membername':_0x1da6b6[_0x3312('0x25')],'type':_0x3312('0x34'),'exitAt':null}});})[_0x3312('0xe')](function(_0x3f9836){var _0x558998=[];_0x3f9836[_0x3312('0x31')](function(_0x39668e){_0x558998[_0x3312('0x32')](_0x39668e[_0x3312('0x2a')]({'exitAt':moment()[_0x3312('0x2c')](_0x3312('0x2d')),'data2':_0x3312('0x3f')}));});return BPromise[_0x3312('0x48')](_0x558998);})[_0x3312('0xe')](function(){return _0x1da6b6['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})['then'](function(_0xe73b77){_0x1a0060(_0xe73b77);})[_0x3312('0x17')](function(_0x272a1f){_0x538222(_0x394f7f['error'](0x1f4,_0x272a1f[_0x3312('0x15')]));});});};exports[_0x3312('0x49')]=function(_0x59be6d){var _0x3bf86c=this;return new Promise(function(_0x2dada0,_0x3cfcf8){var _0x11ca58;return db[_0x3312('0x19')][_0x3312('0x3a')]({'where':_0x59be6d[_0x3312('0x1b')]['where']||{},'attributes':['id',_0x3312('0x25')]})['then'](function(_0x4eafe2){if(_0x4eafe2){_0x11ca58=_0x4eafe2;return db[_0x3312('0x29')][_0x3312('0x4a')]({'where':{'membername':_0x11ca58['name']},'individualHooks':!![]});}})['then'](function(){if(_0x11ca58){return db[_0x3312('0x2b')][_0x3312('0x1a')]({'where':{'membername':_0x11ca58[_0x3312('0x25')],'exitAt':null}});}})[_0x3312('0xe')](function(_0x184b66){if(_0x11ca58){if(_0x184b66&&_0x184b66[_0x3312('0x2e')]){var _0x5e80b4=[];_0x184b66[_0x3312('0x31')](function(_0x28283d){_0x5e80b4['push'](_0x28283d['update']({'exitAt':moment()[_0x3312('0x2c')](_0x3312('0x2d'))}));});return BPromise[_0x3312('0x48')](_0x5e80b4);}}})[_0x3312('0xe')](function(){if(_0x11ca58){return _0x11ca58[_0x3312('0x2a')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x3312('0xe')](function(_0x2e21b6){_0x2dada0(_0x2e21b6);})[_0x3312('0x17')](function(_0x3214cf){_0x3cfcf8(_0x3bf86c[_0x3312('0x13')](0x1f4,_0x3214cf['message']));});});};exports[_0x3312('0x4b')]=function(_0x4c1b40){var _0x5b389e=this;return new Promise(function(_0x1190a9,_0x418a06){var _0x484906;var _0x39c956;var _0x351a23;var _0x589ac5;return db[_0x3312('0x19')][_0x3312('0x3a')]({'where':_0x4c1b40[_0x3312('0x1b')][_0x3312('0x23')]||{},'attributes':['id',_0x3312('0x25'),_0x3312('0x26'),_0x3312('0x4c'),_0x3312('0x4d'),_0x3312('0x27'),_0x3312('0x4e'),_0x3312('0x28')]})[_0x3312('0xe')](function(_0x35c3a7){if(_0x35c3a7){_0x484906=_0x35c3a7;_0x589ac5=_0x4c1b40[_0x3312('0x35')][_0x3312('0x28')]?_0x4c1b40[_0x3312('0x35')][_0x3312('0x28')]:util[_0x3312('0x2c')]('SIP/%s',_0x484906[_0x3312('0x25')]);return db['User'][_0x3312('0x4f')]({'where':{'role':_0x3312('0x50'),'online':!![],'id':{'$ne':_0x484906['id']}}});}})[_0x3312('0xe')](function(_0x34765c){if(_0x34765c){_0x351a23=_0x34765c;return require(_0x3312('0x51'))['getLicense']();}})[_0x3312('0xe')](function(_0x2c81e0){if(_0x2c81e0&&_0x2c81e0['agents']&&_0x351a23>=_0x2c81e0[_0x3312('0x52')]){throw new Error(_0x3312('0x53'));}})[_0x3312('0xe')](function(){if(_0x484906){return db[_0x3312('0x29')]['destroy']({'where':{'membername':_0x484906[_0x3312('0x25')]},'individualHooks':!![]});}})[_0x3312('0xe')](function(){if(_0x484906){return _0x484906['getVoiceQueues']({'raw':!![]});}})[_0x3312('0xe')](function(_0xbeae1f){if(_0x484906){if(_0xbeae1f){var _0x30d976=[];_0x39c956=_0xbeae1f;if(_0x39c956['length']){for(var _0x139e14=0x0;_0x139e14<_0x39c956[_0x3312('0x2e')];_0x139e14++){_0x30d976[_0x3312('0x32')](db[_0x3312('0x29')]['upsert']({'membername':_0x484906[_0x3312('0x25')],'UserId':_0x484906['id'],'queue_name':_0x39c956[_0x139e14][_0x3312('0x25')],'VoiceQueueId':_0x39c956[_0x139e14]['id'],'interface':_0x589ac5,'paused':_0x484906['loginInPause']||![],'penalty':_0x39c956[_0x139e14][_0x3312('0x54')]||0x0}));}return BPromise[_0x3312('0x48')](_0x30d976);}}}})[_0x3312('0xe')](function(){if(_0x484906){return db[_0x3312('0x2b')][_0x3312('0x1a')]({'where':{'membername':_0x484906[_0x3312('0x25')],'exitAt':null}});}})[_0x3312('0xe')](function(_0x36dd9a){if(_0x484906){if(_0x36dd9a&&_0x36dd9a[_0x3312('0x2e')]){var _0x1cd968=[];_0x36dd9a[_0x3312('0x31')](function(_0x59bf81){_0x1cd968[_0x3312('0x32')](_0x59bf81[_0x3312('0x2a')]({'exitAt':moment()[_0x3312('0x2c')](_0x3312('0x2d'))}));});return BPromise['all'](_0x1cd968);}}})[_0x3312('0xe')](function(_0x2cdf45){if(_0x484906){var _0x12dcaf=[];var _0x45d6c7=[];var _0x717b20=utils['getChannels']();var _0x2f2ad8={'membername':_0x484906[_0x3312('0x25')],'interface':_0x589ac5,'enterAt':moment()[_0x3312('0x2c')](_0x3312('0x2d')),'role':_0x484906[_0x3312('0x26')],'internal':_0x484906['internal']};_0x717b20[_0x3312('0x31')](function(_0x6bf946){_0x12dcaf[_0x3312('0x32')](_[_0x3312('0x55')]({'channel':_0x6bf946,'type':'LOGIN','data1':'callysquare','data2':_0x589ac5},_0x2f2ad8));if(_0x484906[_0x3312('0x4e')]){_0x45d6c7[_0x3312('0x32')](_[_0x3312('0x55')]({'channel':_0x6bf946,'type':_0x3312('0x34'),'data1':_0x3312('0x56')},_0x2f2ad8));}});return db[_0x3312('0x2b')]['bulkCreate'](_0x12dcaf[_0x3312('0x57')](_0x45d6c7),{'individualHooks':!![]});}})[_0x3312('0xe')](function(){if(_0x484906){return _0x484906[_0x3312('0x2a')]({'online':!![],'lastLoginAt':moment()[_0x3312('0x2c')](_0x3312('0x2d')),'voicePause':_0x484906[_0x3312('0x4e')]||![],'mailPause':_0x484906[_0x3312('0x4e')]||![],'chatPause':_0x484906[_0x3312('0x4e')]||![],'faxPause':_0x484906['loginInPause']||![],'smsPause':_0x484906[_0x3312('0x4e')]||![],'openchannelPause':_0x484906['loginInPause']||![],'pauseType':_0x484906[_0x3312('0x4e')]?_0x3312('0x56'):null,'lastPauseAt':moment()[_0x3312('0x2c')](_0x3312('0x2d')),'interface':_0x589ac5});}})['then'](function(_0x401720){_0x1190a9(_0x401720);})[_0x3312('0x17')](function(_0x276d35){_0x418a06(_0x5b389e['error'](0x1f4,_0x276d35[_0x3312('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index c50c708..f8bde93 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 _0x9f53=['save','update','removeListener','register','length','user:','./user.events'];(function(_0x37bf5a,_0x4ab4c2){var _0x2ee2ba=function(_0x1ff5fe){while(--_0x1ff5fe){_0x37bf5a['push'](_0x37bf5a['shift']());}};_0x2ee2ba(++_0x4ab4c2);}(_0x9f53,0x1b8));var _0x39f5=function(_0x85c5e5,_0x4ea514){_0x85c5e5=_0x85c5e5-0x0;var _0x140aca=_0x9f53[_0x85c5e5];return _0x140aca;};'use strict';var UserEvents=require(_0x39f5('0x0'));var events=[_0x39f5('0x1'),'remove',_0x39f5('0x2')];function createListener(_0x1e88a0,_0x105b85){return function(_0x41a7cc){_0x105b85['emit'](_0x1e88a0,_0x41a7cc);};}function removeListener(_0xf69a8f,_0x54b372){return function(){UserEvents[_0x39f5('0x3')](_0xf69a8f,_0x54b372);};}exports[_0x39f5('0x4')]=function(_0x46b7b3){for(var _0x51e187=0x0,_0x4930cf=events[_0x39f5('0x5')];_0x51e187<_0x4930cf;_0x51e187++){var _0x31b51e=events[_0x51e187];var _0x32b096=createListener(_0x39f5('0x6')+_0x31b51e,_0x46b7b3);UserEvents['on'](_0x31b51e,_0x32b096);}}; \ No newline at end of file +var _0x4a40=['save','remove','removeListener','register','length','user:','./user.events'];(function(_0x59dc64,_0xd7dbdf){var _0xdcbf81=function(_0x4f8b55){while(--_0x4f8b55){_0x59dc64['push'](_0x59dc64['shift']());}};_0xdcbf81(++_0xd7dbdf);}(_0x4a40,0xdf));var _0x04a4=function(_0x148aa9,_0x421ae3){_0x148aa9=_0x148aa9-0x0;var _0x530a22=_0x4a40[_0x148aa9];return _0x530a22;};'use strict';var UserEvents=require(_0x04a4('0x0'));var events=[_0x04a4('0x1'),_0x04a4('0x2'),'update'];function createListener(_0x482db0,_0x1d4dba){return function(_0x2bba60){_0x1d4dba['emit'](_0x482db0,_0x2bba60);};}function removeListener(_0x1f0023,_0x7986c3){return function(){UserEvents[_0x04a4('0x3')](_0x1f0023,_0x7986c3);};}exports[_0x04a4('0x4')]=function(_0x56ebcc){for(var _0x1b9838=0x0,_0x46200a=events[_0x04a4('0x5')];_0x1b9838<_0x46200a;_0x1b9838++){var _0x119725=events[_0x1b9838];var _0x3bb10b=createListener(_0x04a4('0x6')+_0x119725,_0x56ebcc);UserEvents['on'](_0x119725,_0x3bb10b);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 50d0d13..5c75a4b 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(_0x14e220,_0x57056){var _0x746d60=function(_0x376042){while(--_0x376042){_0x14e220['push'](_0x14e220['shift']());}};_0x746d60(++_0x57056);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0xb04cb1,_0x13b8e3){var _0x309445=function(_0x21422b){while(--_0x21422b){_0xb04cb1['push'](_0xb04cb1['shift']());}};_0x309445(++_0x13b8e3);}(_0x9c44,0x178));var _0x49c4=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x9c44[_0x1694f5];return _0x5b4321;};'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/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index c5647a2..c03de63 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 _0x068a=['INTEGER','sequelize','exports'];(function(_0x1018e5,_0x2075d7){var _0x21ae83=function(_0x2bfb53){while(--_0x2bfb53){_0x1018e5['push'](_0x1018e5['shift']());}};_0x21ae83(++_0x2075d7);}(_0x068a,0x130));var _0xa068=function(_0x1203ca,_0x5934af){_0x1203ca=_0x1203ca-0x0;var _0x177dd3=_0x068a[_0x1203ca];return _0x177dd3;};'use strict';var Sequelize=require(_0xa068('0x0'));module[_0xa068('0x1')]={'penalty':{'type':Sequelize[_0xa068('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xaa48=['INTEGER','sequelize','exports'];(function(_0x1e74ee,_0x48ec03){var _0x104097=function(_0x237bfb){while(--_0x237bfb){_0x1e74ee['push'](_0x1e74ee['shift']());}};_0x104097(++_0x48ec03);}(_0xaa48,0x15a));var _0x8aa4=function(_0x28d920,_0x2b4d07){_0x28d920=_0x28d920-0x0;var _0x120a83=_0xaa48[_0x28d920];return _0x120a83;};'use strict';var Sequelize=require(_0x8aa4('0x0'));module[_0x8aa4('0x1')]={'penalty':{'type':Sequelize[_0x8aa4('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 329aed5..558e464 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 _0x6491=['moment','path','../../config/environment','exports','define','user_has_chat_queues','lodash','util','../../config/logger'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x6491,0xba));var _0x1649=function(_0x5a0d24,_0x346094){_0x5a0d24=_0x5a0d24-0x0;var _0x589f2a=_0x6491[_0x5a0d24];return _0x589f2a;};'use strict';var _=require(_0x1649('0x0'));var util=require(_0x1649('0x1'));var logger=require(_0x1649('0x2'))('api');var moment=require(_0x1649('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1649('0x4'));var rimraf=require('rimraf');var config=require(_0x1649('0x5'));var attributes=require('./userChatQueue.attributes');module[_0x1649('0x6')]=function(_0x3e98ee,_0x3e3533){return _0x3e98ee[_0x1649('0x7')]('UserChatQueue',attributes,{'tableName':_0x1649('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x00d9=['../../config/logger','api','moment','request-promise','rimraf','./userChatQueue.attributes','exports','define','UserChatQueue','util'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x00d9,0x1d5));var _0x900d=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x00d9[_0xefd519];return _0x4bb882;};'use strict';var _=require('lodash');var util=require(_0x900d('0x0'));var logger=require(_0x900d('0x1'))(_0x900d('0x2'));var moment=require(_0x900d('0x3'));var BPromise=require('bluebird');var rp=require(_0x900d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x900d('0x5'));var config=require('../../config/environment');var attributes=require(_0x900d('0x6'));module[_0x900d('0x7')]=function(_0x249e63,_0x49bea8){return _0x249e63[_0x900d('0x8')](_0x900d('0x9'),attributes,{'tableName':'user_has_chat_queues','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 cb72164..ae0f6ec 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 _0x0fe1=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x0fe1,0xcd));var _0x10fe=function(_0x54eab6,_0x5e262f){_0x54eab6=_0x54eab6-0x0;var _0x1e7435=_0x0fe1[_0x54eab6];return _0x1e7435;};'use strict';var _=require(_0x10fe('0x0'));var util=require(_0x10fe('0x1'));var moment=require('moment');var BPromise=require(_0x10fe('0x2'));var rs=require(_0x10fe('0x3'));var fs=require('fs');var Redis=require(_0x10fe('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x10fe('0x5'));var logger=require(_0x10fe('0x6'))(_0x10fe('0x7'));var config=require('../../config/environment');var jayson=require(_0x10fe('0x8'));var client=jayson['client'][_0x10fe('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2d2d4c,_0x41f162,_0x433994){return new BPromise(function(_0x879983,_0x44d3ff){return client[_0x10fe('0xa')](_0x2d2d4c,_0x433994)[_0x10fe('0xb')](function(_0x3dfa71){logger[_0x10fe('0xc')](_0x10fe('0xd'),_0x41f162,_0x10fe('0xe'));logger[_0x10fe('0xf')](_0x10fe('0x10'),_0x41f162,'request\x20sent',JSON[_0x10fe('0x11')](_0x3dfa71));if(_0x3dfa71[_0x10fe('0x12')]){if(_0x3dfa71['error'][_0x10fe('0x13')]===0x1f4){logger['error'](_0x10fe('0xd'),_0x41f162,_0x3dfa71[_0x10fe('0x12')][_0x10fe('0x14')]);return _0x44d3ff(_0x3dfa71[_0x10fe('0x12')][_0x10fe('0x14')]);}logger['error'](_0x10fe('0xd'),_0x41f162,_0x3dfa71['error'][_0x10fe('0x14')]);return _0x879983(_0x3dfa71[_0x10fe('0x12')][_0x10fe('0x14')]);}else{logger['info'](_0x10fe('0xd'),_0x41f162,_0x10fe('0xe'));_0x879983(_0x3dfa71[_0x10fe('0x15')][_0x10fe('0x14')]);}})[_0x10fe('0x16')](function(_0x36bdbb){logger[_0x10fe('0x12')]('UserChatQueue,\x20%s,\x20%s',_0x41f162,_0x36bdbb);_0x44d3ff(_0x36bdbb);});});} \ No newline at end of file +var _0x90fa=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','UserChatQueue,\x20%s,\x20%s','request\x20sent','UserChatQueue,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','lodash','util','moment','randomstring','../../mysqldb'];(function(_0x58cfde,_0x537ac8){var _0x2b4e6e=function(_0x218ccb){while(--_0x218ccb){_0x58cfde['push'](_0x58cfde['shift']());}};_0x2b4e6e(++_0x537ac8);}(_0x90fa,0xb8));var _0xa90f=function(_0x5f49b8,_0x417cc8){_0x5f49b8=_0x5f49b8-0x0;var _0x1570ab=_0x90fa[_0x5f49b8];return _0x1570ab;};'use strict';var _=require(_0xa90f('0x0'));var util=require(_0xa90f('0x1'));var moment=require(_0xa90f('0x2'));var BPromise=require('bluebird');var rs=require(_0xa90f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa90f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa90f('0x5'))(_0xa90f('0x6'));var config=require(_0xa90f('0x7'));var jayson=require(_0xa90f('0x8'));var client=jayson[_0xa90f('0x9')][_0xa90f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57fab2,_0x1a9d2c,_0x1a85f0){return new BPromise(function(_0x237ff4,_0x5ca0ab){return client[_0xa90f('0xb')](_0x57fab2,_0x1a85f0)[_0xa90f('0xc')](function(_0x174993){logger['info'](_0xa90f('0xd'),_0x1a9d2c,_0xa90f('0xe'));logger['debug'](_0xa90f('0xf'),_0x1a9d2c,'request\x20sent',JSON['stringify'](_0x174993));if(_0x174993[_0xa90f('0x10')]){if(_0x174993[_0xa90f('0x10')]['code']===0x1f4){logger[_0xa90f('0x10')](_0xa90f('0xd'),_0x1a9d2c,_0x174993[_0xa90f('0x10')][_0xa90f('0x11')]);return _0x5ca0ab(_0x174993[_0xa90f('0x10')][_0xa90f('0x11')]);}logger['error'](_0xa90f('0xd'),_0x1a9d2c,_0x174993[_0xa90f('0x10')][_0xa90f('0x11')]);return _0x237ff4(_0x174993['error'][_0xa90f('0x11')]);}else{logger[_0xa90f('0x12')](_0xa90f('0xd'),_0x1a9d2c,_0xa90f('0xe'));_0x237ff4(_0x174993[_0xa90f('0x13')][_0xa90f('0x11')]);}})[_0xa90f('0x14')](function(_0x1df81c){logger[_0xa90f('0x10')](_0xa90f('0xd'),_0x1a9d2c,_0x1df81c);_0x5ca0ab(_0x1df81c);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 2d8a1e3..1ef00cb 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x56cccd,_0x2a9444){var _0x3e8cda=function(_0x370de0){while(--_0x370de0){_0x56cccd['push'](_0x56cccd['shift']());}};_0x3e8cda(++_0x2a9444);}(_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(_0x51e136,_0x4eecfd){var _0x52b4f3=function(_0x2d0029){while(--_0x2d0029){_0x51e136['push'](_0x51e136['shift']());}};_0x52b4f3(++_0x4eecfd);}(_0x9c44,0x178));var _0x49c4=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x9c44[_0x50a0c2];return _0x5ebadd;};'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/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 3ff70ea..edd34c2 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 _0x7d25=['STRING','INTEGER'];(function(_0x4fd777,_0x333e48){var _0x3a4a47=function(_0x4ae23d){while(--_0x4ae23d){_0x4fd777['push'](_0x4fd777['shift']());}};_0x3a4a47(++_0x333e48);}(_0x7d25,0x1e7));var _0x57d2=function(_0x2f45ea,_0x15c656){_0x2f45ea=_0x2f45ea-0x0;var _0x485a84=_0x7d25[_0x2f45ea];return _0x485a84;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x57d2('0x0')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0x57d2('0x1')]}}; \ No newline at end of file +var _0x327a=['sequelize','exports','INTEGER','STRING'];(function(_0xa58dcc,_0xecc2cf){var _0x387969=function(_0x1c5c5d){while(--_0x1c5c5d){_0xa58dcc['push'](_0xa58dcc['shift']());}};_0x387969(++_0xecc2cf);}(_0x327a,0x17c));var _0xa327=function(_0x4bd7db,_0x2664f2){_0x4bd7db=_0x4bd7db-0x0;var _0x9a900=_0x327a[_0x4bd7db];return _0x9a900;};'use strict';var Sequelize=require(_0xa327('0x0'));module[_0xa327('0x1')]={'penalty':{'type':Sequelize[_0xa327('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xa327('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xa327('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 10c8a60..e0ad7a7 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 _0x1915=['UserFaxQueue','user_has_fax_queues','util','api','moment','path','rimraf','exports','define'];(function(_0x4241c6,_0x21977d){var _0xca4395=function(_0x21eef7){while(--_0x21eef7){_0x4241c6['push'](_0x4241c6['shift']());}};_0xca4395(++_0x21977d);}(_0x1915,0x146));var _0x5191=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x1915[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var util=require(_0x5191('0x0'));var logger=require('../../config/logger')(_0x5191('0x1'));var moment=require(_0x5191('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5191('0x3'));var rimraf=require(_0x5191('0x4'));var config=require('../../config/environment');var attributes=require('./userFaxQueue.attributes');module[_0x5191('0x5')]=function(_0x4b1f43,_0x32b828){return _0x4b1f43[_0x5191('0x6')](_0x5191('0x7'),attributes,{'tableName':_0x5191('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x62f9=['api','moment','bluebird','path','../../config/environment','exports','lodash','util','../../config/logger'];(function(_0x44f0c7,_0x4541a8){var _0x477bd7=function(_0x47e532){while(--_0x47e532){_0x44f0c7['push'](_0x44f0c7['shift']());}};_0x477bd7(++_0x4541a8);}(_0x62f9,0x1da));var _0x962f=function(_0x55ff3e,_0x41077f){_0x55ff3e=_0x55ff3e-0x0;var _0x2709eb=_0x62f9[_0x55ff3e];return _0x2709eb;};'use strict';var _=require(_0x962f('0x0'));var util=require(_0x962f('0x1'));var logger=require(_0x962f('0x2'))(_0x962f('0x3'));var moment=require(_0x962f('0x4'));var BPromise=require(_0x962f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x962f('0x6'));var rimraf=require('rimraf');var config=require(_0x962f('0x7'));var attributes=require('./userFaxQueue.attributes');module[_0x962f('0x8')]=function(_0x1f56dc,_0x361d3d){return _0x1f56dc['define']('UserFaxQueue',attributes,{'tableName':'user_has_fax_queues','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 b7e1337..b8d6481 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 _0xce2e=['../../config/logger','rpc','../../config/environment','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x2670a5,_0x516d93){var _0x1bdc44=function(_0x2d7a3c){while(--_0x2d7a3c){_0x2670a5['push'](_0x2670a5['shift']());}};_0x1bdc44(++_0x516d93);}(_0xce2e,0xe1));var _0xece2=function(_0x340aa5,_0x2d5553){_0x340aa5=_0x340aa5-0x0;var _0x3a5b7f=_0xce2e[_0x340aa5];return _0x3a5b7f;};'use strict';var _=require(_0xece2('0x0'));var util=require('util');var moment=require(_0xece2('0x1'));var BPromise=require(_0xece2('0x2'));var rs=require(_0xece2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xece2('0x4'))['db'];var utils=require(_0xece2('0x5'));var logger=require(_0xece2('0x6'))(_0xece2('0x7'));var config=require(_0xece2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xece2('0x9')][_0xece2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e5e0a,_0x428a0f,_0x2ba26c){return new BPromise(function(_0x212d8,_0x47ab33){return client[_0xece2('0xb')](_0x1e5e0a,_0x2ba26c)[_0xece2('0xc')](function(_0x27b35a){logger[_0xece2('0xd')](_0xece2('0xe'),_0x428a0f,_0xece2('0xf'));logger['debug']('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x428a0f,_0xece2('0xf'),JSON[_0xece2('0x10')](_0x27b35a));if(_0x27b35a[_0xece2('0x11')]){if(_0x27b35a[_0xece2('0x11')]['code']===0x1f4){logger[_0xece2('0x11')]('UserFaxQueue,\x20%s,\x20%s',_0x428a0f,_0x27b35a['error']['message']);return _0x47ab33(_0x27b35a[_0xece2('0x11')][_0xece2('0x12')]);}logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x428a0f,_0x27b35a[_0xece2('0x11')]['message']);return _0x212d8(_0x27b35a[_0xece2('0x11')][_0xece2('0x12')]);}else{logger['info'](_0xece2('0xe'),_0x428a0f,_0xece2('0xf'));_0x212d8(_0x27b35a[_0xece2('0x13')][_0xece2('0x12')]);}})[_0xece2('0x14')](function(_0x26a412){logger[_0xece2('0x11')]('UserFaxQueue,\x20%s,\x20%s',_0x428a0f,_0x26a412);_0x47ab33(_0x26a412);});});} \ No newline at end of file +var _0xebae=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash'];(function(_0x1e45d0,_0x32825b){var _0xf70621=function(_0x2d7356){while(--_0x2d7356){_0x1e45d0['push'](_0x1e45d0['shift']());}};_0xf70621(++_0x32825b);}(_0xebae,0xa7));var _0xeeba=function(_0x1aa368,_0x56c31d){_0x1aa368=_0x1aa368-0x0;var _0x3d9e29=_0xebae[_0x1aa368];return _0x3d9e29;};'use strict';var _=require(_0xeeba('0x0'));var util=require(_0xeeba('0x1'));var moment=require('moment');var BPromise=require(_0xeeba('0x2'));var rs=require(_0xeeba('0x3'));var fs=require('fs');var Redis=require(_0xeeba('0x4'));var db=require(_0xeeba('0x5'))['db'];var utils=require(_0xeeba('0x6'));var logger=require(_0xeeba('0x7'))(_0xeeba('0x8'));var config=require('../../config/environment');var jayson=require(_0xeeba('0x9'));var client=jayson[_0xeeba('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ef41a,_0xcc7057,_0x204efa){return new BPromise(function(_0x52f420,_0x45a607){return client['request'](_0x3ef41a,_0x204efa)[_0xeeba('0xb')](function(_0x330895){logger[_0xeeba('0xc')](_0xeeba('0xd'),_0xcc7057,_0xeeba('0xe'));logger[_0xeeba('0xf')](_0xeeba('0x10'),_0xcc7057,_0xeeba('0xe'),JSON[_0xeeba('0x11')](_0x330895));if(_0x330895[_0xeeba('0x12')]){if(_0x330895['error'][_0xeeba('0x13')]===0x1f4){logger['error'](_0xeeba('0xd'),_0xcc7057,_0x330895[_0xeeba('0x12')][_0xeeba('0x14')]);return _0x45a607(_0x330895[_0xeeba('0x12')][_0xeeba('0x14')]);}logger[_0xeeba('0x12')](_0xeeba('0xd'),_0xcc7057,_0x330895[_0xeeba('0x12')][_0xeeba('0x14')]);return _0x52f420(_0x330895[_0xeeba('0x12')][_0xeeba('0x14')]);}else{logger[_0xeeba('0xc')](_0xeeba('0xd'),_0xcc7057,'request\x20sent');_0x52f420(_0x330895['result'][_0xeeba('0x14')]);}})['catch'](function(_0x5e0274){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0xcc7057,_0x5e0274);_0x45a607(_0x5e0274);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index c9a2adb..0c81321 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(_0x18dbc1,_0x2ca96c){var _0x44731c=function(_0x375e96){while(--_0x375e96){_0x18dbc1['push'](_0x18dbc1['shift']());}};_0x44731c(++_0x2ca96c);}(_0xedd9,0xfc));var _0x9edd=function(_0x18e684,_0x2ec7ff){_0x18e684=_0x18e684-0x0;var _0xbac9f9=_0xedd9[_0x18e684];return _0xbac9f9;};'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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x41deff,_0xbf4844){var _0xcf1976=function(_0x8e0cc5){while(--_0x8e0cc5){_0x41deff['push'](_0x41deff['shift']());}};_0xcf1976(++_0xbf4844);}(_0xe706,0xa3));var _0x6e70=function(_0x399bd4,_0x3c84ab){_0x399bd4=_0x399bd4-0x0;var _0x12d41b=_0xe706[_0x399bd4];return _0x12d41b;};'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/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 6ce47a8..776933a 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 _0xdebb=['INTEGER','exports'];(function(_0x184f36,_0x1f86e8){var _0x4c03a9=function(_0x44b53b){while(--_0x44b53b){_0x184f36['push'](_0x184f36['shift']());}};_0x4c03a9(++_0x1f86e8);}(_0xdebb,0x13f));var _0xbdeb=function(_0x36a236,_0x3cc5fc){_0x36a236=_0x36a236-0x0;var _0xa4ab27=_0xdebb[_0x36a236];return _0xa4ab27;};'use strict';var Sequelize=require('sequelize');module[_0xbdeb('0x0')]={'penalty':{'type':Sequelize[_0xbdeb('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc2b1=['INTEGER'];(function(_0x37c29d,_0x3b2513){var _0x2e6d34=function(_0x827d11){while(--_0x827d11){_0x37c29d['push'](_0x37c29d['shift']());}};_0x2e6d34(++_0x3b2513);}(_0xc2b1,0x1a1));var _0x1c2b=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0xc2b1[_0x25e7cb];return _0x375d92;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x1c2b('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 5ae30b2..d720dea 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 _0x61ee=['../../config/logger','bluebird','request-promise','path','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x61ee,0x13b));var _0xe61e=function(_0x5beda8,_0x1e8554){_0x5beda8=_0x5beda8-0x0;var _0x2aa042=_0x61ee[_0x5beda8];return _0x2aa042;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe61e('0x0'))('api');var moment=require('moment');var BPromise=require(_0xe61e('0x1'));var rp=require(_0xe61e('0x2'));var fs=require('fs');var path=require(_0xe61e('0x3'));var rimraf=require('rimraf');var config=require(_0xe61e('0x4'));var attributes=require(_0xe61e('0x5'));module[_0xe61e('0x6')]=function(_0xb99b42,_0x29efcb){return _0xb99b42[_0xe61e('0x7')](_0xe61e('0x8'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x645a=['user_has_mail_queues','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue'];(function(_0x3dde2d,_0x4c7292){var _0x15e1a4=function(_0x5b5e13){while(--_0x5b5e13){_0x3dde2d['push'](_0x3dde2d['shift']());}};_0x15e1a4(++_0x4c7292);}(_0x645a,0x187));var _0xa645=function(_0x2a5160,_0x5f068d){_0x2a5160=_0x2a5160-0x0;var _0x2b42c5=_0x645a[_0x2a5160];return _0x2b42c5;};'use strict';var _=require(_0xa645('0x0'));var util=require('util');var logger=require(_0xa645('0x1'))(_0xa645('0x2'));var moment=require('moment');var BPromise=require(_0xa645('0x3'));var rp=require(_0xa645('0x4'));var fs=require('fs');var path=require(_0xa645('0x5'));var rimraf=require(_0xa645('0x6'));var config=require(_0xa645('0x7'));var attributes=require(_0xa645('0x8'));module[_0xa645('0x9')]=function(_0x4a4e6e,_0x344e87){return _0x4a4e6e[_0xa645('0xa')](_0xa645('0xb'),attributes,{'tableName':_0xa645('0xc'),'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 63a5484..3420a32 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 _0x3e74=['rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','UserMailQueue,\x20%s,\x20%s','message','info','catch','lodash','moment','bluebird','randomstring','../../config/utils'];(function(_0x2ee62e,_0x281e85){var _0x198c9a=function(_0x1559f0){while(--_0x1559f0){_0x2ee62e['push'](_0x2ee62e['shift']());}};_0x198c9a(++_0x281e85);}(_0x3e74,0x175));var _0x43e7=function(_0x1fe72b,_0x16dc05){_0x1fe72b=_0x1fe72b-0x0;var _0x237081=_0x3e74[_0x1fe72b];return _0x237081;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var moment=require(_0x43e7('0x1'));var BPromise=require(_0x43e7('0x2'));var rs=require(_0x43e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43e7('0x4'));var logger=require('../../config/logger')(_0x43e7('0x5'));var config=require(_0x43e7('0x6'));var jayson=require(_0x43e7('0x7'));var client=jayson[_0x43e7('0x8')][_0x43e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x503698,_0x45a0d1,_0x3491d6){return new BPromise(function(_0x2ede2d,_0x8528fc){return client[_0x43e7('0xa')](_0x503698,_0x3491d6)['then'](function(_0x212c6c){logger['info']('UserMailQueue,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('UserMailQueue,\x20%s,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'),JSON['stringify'](_0x212c6c));if(_0x212c6c[_0x43e7('0xd')]){if(_0x212c6c[_0x43e7('0xd')]['code']===0x1f4){logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')][_0x43e7('0xf')]);return _0x8528fc(_0x212c6c['error']['message']);}logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')]['message']);return _0x2ede2d(_0x212c6c['error'][_0x43e7('0xf')]);}else{logger[_0x43e7('0x10')](_0x43e7('0xe'),_0x45a0d1,_0x43e7('0xb'));_0x2ede2d(_0x212c6c['result']['message']);}})[_0x43e7('0x11')](function(_0x264575){logger[_0x43e7('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});} \ No newline at end of file +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(_0x418b2b,_0xe25672){var _0x374ea6=function(_0x1b31b6){while(--_0x1b31b6){_0x418b2b['push'](_0x418b2b['shift']());}};_0x374ea6(++_0xe25672);}(_0xe14b,0x93));var _0xbe14=function(_0x5102cf,_0x41bf80){_0x5102cf=_0x5102cf-0x0;var _0x1fe6d3=_0xe14b[_0x5102cf];return _0x1fe6d3;};'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 diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index af4e320..21b20d5 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 _0xa2c9=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','path','connect-timeout','express','Router'];(function(_0x32700e,_0x287b6b){var _0x5d7f81=function(_0x15cbb5){while(--_0x15cbb5){_0x32700e['push'](_0x32700e['shift']());}};_0x5d7f81(++_0x287b6b);}(_0xa2c9,0x130));var _0x9a2c=function(_0x1c2270,_0xbe76cc){_0x1c2270=_0x1c2270-0x0;var _0x5adfea=_0xa2c9[_0x1c2270];return _0x5adfea;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9a2c('0x0'));var timeout=require(_0x9a2c('0x1'));var express=require(_0x9a2c('0x2'));var router=express[_0x9a2c('0x3')]();var fs_extra=require(_0x9a2c('0x4'));var auth=require(_0x9a2c('0x5'));var interaction=require(_0x9a2c('0x6'));var config=require(_0x9a2c('0x7'));var controller=require(_0x9a2c('0x8'));router[_0x9a2c('0x9')]('/',auth[_0x9a2c('0xa')](),controller['sendUserNotification']);module['exports']=router; \ No newline at end of file +var _0x7985=['post','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller'];(function(_0xec6802,_0x3ce2ff){var _0x2b5bea=function(_0x3dc76a){while(--_0x3dc76a){_0xec6802['push'](_0xec6802['shift']());}};_0x2b5bea(++_0x3ce2ff);}(_0x7985,0xb6));var _0x5798=function(_0x42b3aa,_0x223f53){_0x42b3aa=_0x42b3aa-0x0;var _0x319157=_0x7985[_0x42b3aa];return _0x319157;};'use strict';var multer=require('multer');var util=require(_0x5798('0x0'));var path=require(_0x5798('0x1'));var timeout=require(_0x5798('0x2'));var express=require('express');var router=express[_0x5798('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5798('0x4'));var interaction=require(_0x5798('0x5'));var config=require(_0x5798('0x6'));var controller=require(_0x5798('0x7'));router[_0x5798('0x8')]('/',auth['isAuthenticated'](),controller['sendUserNotification']);module[_0x5798('0x9')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 44a9793..0682ca8 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 _0x4d41=['TEXT','STRING','sequelize','exports'];(function(_0x182ec6,_0x40a166){var _0x3b0408=function(_0x863d0){while(--_0x863d0){_0x182ec6['push'](_0x182ec6['shift']());}};_0x3b0408(++_0x40a166);}(_0x4d41,0x15e));var _0x14d4=function(_0xd336fa,_0x39d1b2){_0xd336fa=_0xd336fa-0x0;var _0x3370b1=_0x4d41[_0xd336fa];return _0x3370b1;};'use strict';var Sequelize=require(_0x14d4('0x0'));module[_0x14d4('0x1')]={'body':{'type':Sequelize[_0x14d4('0x2')]},'senderName':{'type':Sequelize[_0x14d4('0x3')]},'recipientsId':{'type':Sequelize[_0x14d4('0x2')]},'recipientsDescription':{'type':Sequelize[_0x14d4('0x3')]},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file +var _0x3ba3=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x3d81c1,_0x525fc1){var _0x73e475=function(_0x4f73fa){while(--_0x4f73fa){_0x3d81c1['push'](_0x3d81c1['shift']());}};_0x73e475(++_0x525fc1);}(_0x3ba3,0xe9));var _0x33ba=function(_0x56a75e,_0x42a2ef){_0x56a75e=_0x56a75e-0x0;var _0x315005=_0x3ba3[_0x56a75e];return _0x315005;};'use strict';var Sequelize=require(_0x33ba('0x0'));module[_0x33ba('0x1')]={'body':{'type':Sequelize[_0x33ba('0x2')]},'senderName':{'type':Sequelize[_0x33ba('0x3')]},'recipientsId':{'type':Sequelize[_0x33ba('0x2')]},'recipientsDescription':{'type':Sequelize[_0x33ba('0x3')]},'beep':{'type':Sequelize[_0x33ba('0x4')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 4ee3870..5cdfd4f 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 _0x9b90=['ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','sendUserNotification','body','hasOwnProperty','text','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','TemplateId','view','Missing\x20\x27view\x27\x20parameter','Missing\x20\x27recipients\x27\x20parameter','parse','recipients','Invalid\x20\x27recipients\x27\x20object','chatqueue','mailqueue','voicequeue','whatsappqueue','team','user','some','includes','model','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','SenderId','recipientsId','sortBy','UserNotification','create','beep','forEach','recipient','emit','catch','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','User','union','ids','Queue','push','flatten','getAgents','eml-format','zip-dir','request-promise','bluebird','util','path','sox','to-csv'];(function(_0x5c1345,_0x40116e){var _0x1c070d=function(_0x1e862f){while(--_0x1e862f){_0x5c1345['push'](_0x5c1345['shift']());}};_0x1c070d(++_0x40116e);}(_0x9b90,0x16c));var _0x09b9=function(_0x24b032,_0x458109){_0x24b032=_0x24b032-0x0;var _0x36a8a7=_0x9b90[_0x24b032];return _0x36a8a7;};'use strict';var emlformat=require(_0x09b9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x09b9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x09b9('0x2'));var moment=require('moment');var BPromise=require(_0x09b9('0x3'));var Mustache=require('mustache');var util=require(_0x09b9('0x4'));var path=require(_0x09b9('0x5'));var sox=require(_0x09b9('0x6'));var csv=require(_0x09b9('0x7'));var ejs=require(_0x09b9('0x8'));var fs=require('fs');var fs_extra=require(_0x09b9('0x9'));var _=require(_0x09b9('0xa'));var squel=require('squel');var crypto=require(_0x09b9('0xb'));var jsforce=require(_0x09b9('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x09b9('0x7'));var querystring=require('querystring');var Papa=require(_0x09b9('0xd'));var Redis=require(_0x09b9('0xe'));var authService=require(_0x09b9('0xf'));var qs=require(_0x09b9('0x10'));var as=require(_0x09b9('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x09b9('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x09b9('0x13'))['db'];config[_0x09b9('0x14')]=_[_0x09b9('0x15')](config[_0x09b9('0x14')],{'host':_0x09b9('0x16'),'port':0x18eb});var socket=require(_0x09b9('0x17'))(new Redis(config[_0x09b9('0x14')]));require(_0x09b9('0x18'))[_0x09b9('0x19')](socket);function respondWithStatusCode(_0x4de013,_0x4db7a0){_0x4db7a0=_0x4db7a0||0xcc;return function(_0x5443d4){if(_0x5443d4){return _0x4de013[_0x09b9('0x1a')](_0x4db7a0);}return _0x4de013[_0x09b9('0x1b')](_0x4db7a0)[_0x09b9('0x1c')]();};}function respondWithResult(_0x3ceb70,_0x5a4248){_0x5a4248=_0x5a4248||0xc8;return function(_0x4106f7){if(_0x4106f7){return _0x3ceb70['status'](_0x5a4248)['json'](_0x4106f7);}};}function respondWithFilteredResult(_0xe4237a,_0x308516){return function(_0x327ee6){if(_0x327ee6){var _0x286726=typeof _0x308516['offset']===_0x09b9('0x1d')&&typeof _0x308516[_0x09b9('0x1e')]===_0x09b9('0x1d');var _0x55e2b4=_0x327ee6[_0x09b9('0x1f')];var _0x25adab=_0x286726?0x0:_0x308516['offset'];var _0x815b1d=_0x286726?_0x327ee6['count']:_0x308516[_0x09b9('0x20')]+_0x308516['limit'];var _0x2b9f36;if(_0x815b1d>=_0x55e2b4){_0x815b1d=_0x55e2b4;_0x2b9f36=0xc8;}else{_0x2b9f36=0xce;}_0xe4237a[_0x09b9('0x1b')](_0x2b9f36);return _0xe4237a[_0x09b9('0x21')](_0x09b9('0x22'),_0x25adab+'-'+_0x815b1d+'/'+_0x55e2b4)[_0x09b9('0x23')](_0x327ee6);}return null;};}function patchUpdates(_0x1c2736){return function(_0x34dde1){try{jsonpatch[_0x09b9('0x24')](_0x34dde1,_0x1c2736,!![]);}catch(_0x145048){return BPromise[_0x09b9('0x25')](_0x145048);}return _0x34dde1['save']();};}function saveUpdates(_0x2a9484,_0x27d8e6){return function(_0xe1a3a9){if(_0xe1a3a9){return _0xe1a3a9[_0x09b9('0x26')](_0x2a9484)[_0x09b9('0x27')](function(_0x20b8c8){return _0x20b8c8;});}return null;};}function removeEntity(_0x12199d,_0x2ec0bb){return function(_0xfef784){if(_0xfef784){return _0xfef784[_0x09b9('0x28')]()[_0x09b9('0x27')](function(){_0x12199d[_0x09b9('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d6751,_0x4c3354){return function(_0x3599ab){if(!_0x3599ab){_0x4d6751[_0x09b9('0x1a')](0x194);}return _0x3599ab;};}function handleError(_0x3ea899,_0x511351){_0x511351=_0x511351||0x1f4;return function(_0x1bad0c){logger[_0x09b9('0x29')](_0x1bad0c[_0x09b9('0x2a')]);if(_0x1bad0c[_0x09b9('0x2b')]){delete _0x1bad0c[_0x09b9('0x2b')];}_0x3ea899[_0x09b9('0x1b')](_0x511351)['send'](_0x1bad0c);};}exports[_0x09b9('0x2c')]=function(_0x4270be,_0x2bca62,_0x571482){if(!_0x4270be[_0x09b9('0x2d')][_0x09b9('0x2e')](_0x09b9('0x2f'))&&!_0x4270be[_0x09b9('0x2d')][_0x09b9('0x2e')]('TemplateId')){throw new db[(_0x09b9('0x30'))][(_0x09b9('0x31'))](_0x09b9('0x32'));}else{if(_0x4270be[_0x09b9('0x2d')][_0x09b9('0x2e')](_0x09b9('0x33'))&&!_0x4270be[_0x09b9('0x2d')][_0x09b9('0x2e')](_0x09b9('0x34'))){throw new db[(_0x09b9('0x30'))]['ValidationError'](_0x09b9('0x35'));}if(!_0x4270be[_0x09b9('0x2d')][_0x09b9('0x2e')]('recipients')){throw new db[(_0x09b9('0x30'))]['ValidationError'](_0x09b9('0x36'));}else{try{var _0x2861d8=JSON[_0x09b9('0x37')](_0x4270be['body'][_0x09b9('0x38')]);}catch(_0x43f5c4){logger[_0x09b9('0x29')](_0x43f5c4);throw new db[(_0x09b9('0x30'))][(_0x09b9('0x31'))](_0x09b9('0x39'));}var _0x3539ae=[_0x09b9('0x3a'),'faxqueue',_0x09b9('0x3b'),'openchannelqueue','smsqueue',_0x09b9('0x3c'),_0x09b9('0x3d'),_0x09b9('0x3e'),_0x09b9('0x3f')];if(_[_0x09b9('0x40')](_0x2861d8,function(_0x297e25){return!_[_0x09b9('0x41')](_0x3539ae,_0x297e25[_0x09b9('0x42')]['toLowerCase']());})){throw new db[(_0x09b9('0x30'))][(_0x09b9('0x31'))](_0x09b9('0x43'));}}}var _0x5a119d={};_0x5a119d['senderName']=_0x4270be[_0x09b9('0x2d')]['hasOwnProperty'](_0x09b9('0x44'))?_0x4270be[_0x09b9('0x2d')][_0x09b9('0x44')]:_0x4270be[_0x09b9('0x3f')][_0x09b9('0x45')];_0x5a119d[_0x09b9('0x46')]=_[_0x09b9('0x47')](_0x4270be['body'][_0x09b9('0x46')])?null:_0x4270be[_0x09b9('0x2d')][_0x09b9('0x46')];_0x5a119d['beep']=_0x4270be[_0x09b9('0x2d')]['beep']||![];_0x5a119d[_0x09b9('0x48')]=_0x4270be[_0x09b9('0x3f')]['id'];return getContent(_0x4270be['body'])[_0x09b9('0x27')](function(_0x4a377c){_0x5a119d[_0x09b9('0x2d')]=_0x4a377c;return getRecipients(_0x2861d8);})[_0x09b9('0x27')](function(_0x128f17){_0x5a119d[_0x09b9('0x49')]=_[_0x09b9('0x4a')](_0x128f17)['join'](',');return db['sequelize']['transaction'](function(_0xbedcfe){return db[_0x09b9('0x4b')][_0x09b9('0x4c')](_0x5a119d,{'raw':!![],'transaction':_0xbedcfe})['then'](function(_0x2f3359){var _0x1a053e={'sender':_0x5a119d['senderName'],'description':_0x5a119d[_0x09b9('0x46')],'content':_0x5a119d['body'],'beep':_0x5a119d[_0x09b9('0x4d')]};_0x128f17[_0x09b9('0x4e')](function(_0x1821f8){_0x1a053e[_0x09b9('0x4f')]=_0x1821f8;socket[_0x09b9('0x50')]('userNotification:send',_0x1a053e);});return _0x2f3359;});});})['then'](respondWithResult(_0x2bca62,0xc9))[_0x09b9('0x51')](handleError(_0x2bca62,null));};function getContent(_0x5e0a50){return new BPromise(function(_0x54d216,_0x4065d3){if(_0x5e0a50[_0x09b9('0x2f')]){_0x54d216(_0x5e0a50[_0x09b9('0x2f')]);return;}return db[_0x09b9('0x52')][_0x09b9('0x53')]({'attributes':[_0x09b9('0x54')],'where':{'id':_0x5e0a50[_0x09b9('0x33')]},'raw':!![]})[_0x09b9('0x27')](function(_0x4795af){if(!_0x4795af)throw new db[(_0x09b9('0x30'))][(_0x09b9('0x31'))](_0x09b9('0x55'));var _0x1b0539=Mustache['render'](_0x4795af[_0x09b9('0x54')],_0x5e0a50[_0x09b9('0x34')]);_0x54d216(_0x1b0539);})[_0x09b9('0x51')](function(_0x49008f){_0x4065d3(_0x49008f);});});}function getRecipients(_0x5a3287){return new BPromise(function(_0x298bca,_0x2d83a4){var _0x12efbe=[];var _0x287fda=[];_0x5a3287[_0x09b9('0x4e')](function(_0x260dde){var _0x1cb5b2=_['startCase'](_0x260dde[_0x09b9('0x42')]['toLowerCase']());if(_0x1cb5b2===_0x09b9('0x56')){_0x12efbe=_[_0x09b9('0x57')](_0x12efbe,_0x260dde[_0x09b9('0x58')]);}else{if(_[_0x09b9('0x41')](_0x1cb5b2,'queue'))_0x1cb5b2=_0x1cb5b2['replace']('queue',_0x09b9('0x59'));_0x260dde['ids'][_0x09b9('0x4e')](function(_0x168c42){_0x287fda[_0x09b9('0x5a')](getAgents(_0x1cb5b2,_0x168c42));});}});return BPromise['all'](_0x287fda)[_0x09b9('0x27')](function(_0x46c29b){_0x12efbe=_[_0x09b9('0x57')](_0x12efbe,_[_0x09b9('0x5b')](_0x46c29b));_0x298bca(_0x12efbe);})['catch'](function(_0x4bd27c){_0x2d83a4(_0x4bd27c);});});}function getAgents(_0x27a037,_0xf7f0d5){return new BPromise(function(_0x565c2e,_0x867239){return db[_0x27a037][_0x09b9('0x53')]({'where':{'id':_0xf7f0d5}})[_0x09b9('0x27')](function(_0x12b778){return _0x12b778[_0x09b9('0x5c')]({'attributes':['id'],'raw':!![]})[_0x09b9('0x27')](function(_0x21caba){var _0x4c56e5=_['map'](_0x21caba,'id');_0x565c2e(_0x4c56e5);});})[_0x09b9('0x51')](function(_0x542da3){_0x867239(_0x542da3);});});} \ No newline at end of file +var _0xeb6a=['view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','error','Invalid\x20\x27recipients\x27\x20object','mailqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','includes','model','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','sortBy','join','sequelize','create','forEach','emit','userNotification:send','catch','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','union','ids','queue','replace','all','getAgents','map','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','then','destroy','name','send','sendUserNotification','body','hasOwnProperty','text','Sequelize','ValidationError','TemplateId'];(function(_0x14f3cf,_0x308714){var _0x2b5e3b=function(_0x16692c){while(--_0x16692c){_0x14f3cf['push'](_0x14f3cf['shift']());}};_0x2b5e3b(++_0x308714);}(_0xeb6a,0xe5));var _0xaeb6=function(_0x301ba9,_0x31ddab){_0x301ba9=_0x301ba9-0x0;var _0x52130a=_0xeb6a[_0x301ba9];return _0x52130a;};'use strict';var emlformat=require(_0xaeb6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xaeb6('0x1'));var rp=require(_0xaeb6('0x2'));var moment=require('moment');var BPromise=require(_0xaeb6('0x3'));var Mustache=require(_0xaeb6('0x4'));var util=require(_0xaeb6('0x5'));var path=require(_0xaeb6('0x6'));var sox=require('sox');var csv=require(_0xaeb6('0x7'));var ejs=require(_0xaeb6('0x8'));var fs=require('fs');var fs_extra=require(_0xaeb6('0x9'));var _=require(_0xaeb6('0xa'));var squel=require(_0xaeb6('0xb'));var crypto=require('crypto');var jsforce=require(_0xaeb6('0xc'));var deskjs=require(_0xaeb6('0xd'));var toCsv=require(_0xaeb6('0x7'));var querystring=require(_0xaeb6('0xe'));var Papa=require(_0xaeb6('0xf'));var Redis=require('ioredis');var authService=require(_0xaeb6('0x10'));var qs=require(_0xaeb6('0x11'));var as=require(_0xaeb6('0x12'));var hardwareService=require(_0xaeb6('0x13'));var logger=require(_0xaeb6('0x14'))('api');var utils=require(_0xaeb6('0x15'));var config=require(_0xaeb6('0x16'));var licenseUtil=require(_0xaeb6('0x17'));var db=require('../../mysqldb')['db'];config[_0xaeb6('0x18')]=_[_0xaeb6('0x19')](config[_0xaeb6('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaeb6('0x18')]));require('./userNotification.socket')['register'](socket);function respondWithStatusCode(_0x1051c2,_0x4b3427){_0x4b3427=_0x4b3427||0xcc;return function(_0x543ed8){if(_0x543ed8){return _0x1051c2[_0xaeb6('0x1a')](_0x4b3427);}return _0x1051c2[_0xaeb6('0x1b')](_0x4b3427)[_0xaeb6('0x1c')]();};}function respondWithResult(_0x5a99a3,_0x1d30d6){_0x1d30d6=_0x1d30d6||0xc8;return function(_0x50de4d){if(_0x50de4d){return _0x5a99a3[_0xaeb6('0x1b')](_0x1d30d6)[_0xaeb6('0x1d')](_0x50de4d);}};}function respondWithFilteredResult(_0x4b3dbe,_0x1f94b2){return function(_0x66b861){if(_0x66b861){var _0x169478=typeof _0x1f94b2['offset']==='undefined'&&typeof _0x1f94b2[_0xaeb6('0x1e')]===_0xaeb6('0x1f');var _0x29b2c4=_0x66b861[_0xaeb6('0x20')];var _0x2c7115=_0x169478?0x0:_0x1f94b2[_0xaeb6('0x21')];var _0x29ffb5=_0x169478?_0x66b861[_0xaeb6('0x20')]:_0x1f94b2[_0xaeb6('0x21')]+_0x1f94b2[_0xaeb6('0x1e')];var _0x20d950;if(_0x29ffb5>=_0x29b2c4){_0x29ffb5=_0x29b2c4;_0x20d950=0xc8;}else{_0x20d950=0xce;}_0x4b3dbe[_0xaeb6('0x1b')](_0x20d950);return _0x4b3dbe[_0xaeb6('0x22')](_0xaeb6('0x23'),_0x2c7115+'-'+_0x29ffb5+'/'+_0x29b2c4)['json'](_0x66b861);}return null;};}function patchUpdates(_0x6a79e9){return function(_0x18d59c){try{jsonpatch[_0xaeb6('0x24')](_0x18d59c,_0x6a79e9,!![]);}catch(_0x1e5944){return BPromise['reject'](_0x1e5944);}return _0x18d59c[_0xaeb6('0x25')]();};}function saveUpdates(_0xbfae2a,_0x241f5e){return function(_0x189652){if(_0x189652){return _0x189652[_0xaeb6('0x26')](_0xbfae2a)[_0xaeb6('0x27')](function(_0x2eb30d){return _0x2eb30d;});}return null;};}function removeEntity(_0xaadade,_0x54466a){return function(_0x3511ea){if(_0x3511ea){return _0x3511ea[_0xaeb6('0x28')]()['then'](function(){_0xaadade[_0xaeb6('0x1b')](0xcc)[_0xaeb6('0x1c')]();});}};}function handleEntityNotFound(_0x2823f,_0x308577){return function(_0x6e9d78){if(!_0x6e9d78){_0x2823f['sendStatus'](0x194);}return _0x6e9d78;};}function handleError(_0x3db4e4,_0x273d06){_0x273d06=_0x273d06||0x1f4;return function(_0x184cfc){logger['error'](_0x184cfc['stack']);if(_0x184cfc[_0xaeb6('0x29')]){delete _0x184cfc['name'];}_0x3db4e4[_0xaeb6('0x1b')](_0x273d06)[_0xaeb6('0x2a')](_0x184cfc);};}exports[_0xaeb6('0x2b')]=function(_0x23cd58,_0x43a30c,_0x48ba06){if(!_0x23cd58[_0xaeb6('0x2c')][_0xaeb6('0x2d')](_0xaeb6('0x2e'))&&!_0x23cd58[_0xaeb6('0x2c')][_0xaeb6('0x2d')]('TemplateId')){throw new db[(_0xaeb6('0x2f'))][(_0xaeb6('0x30'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x23cd58[_0xaeb6('0x2c')][_0xaeb6('0x2d')](_0xaeb6('0x31'))&&!_0x23cd58['body'][_0xaeb6('0x2d')](_0xaeb6('0x32'))){throw new db[(_0xaeb6('0x2f'))][(_0xaeb6('0x30'))](_0xaeb6('0x33'));}if(!_0x23cd58[_0xaeb6('0x2c')][_0xaeb6('0x2d')](_0xaeb6('0x34'))){throw new db['Sequelize'][(_0xaeb6('0x30'))](_0xaeb6('0x35'));}else{try{var _0x3b7b66=JSON[_0xaeb6('0x36')](_0x23cd58['body'][_0xaeb6('0x34')]);}catch(_0x4f1560){logger[_0xaeb6('0x37')](_0x4f1560);throw new db[(_0xaeb6('0x2f'))][(_0xaeb6('0x30'))](_0xaeb6('0x38'));}var _0x2f8708=['chatqueue','faxqueue',_0xaeb6('0x39'),'openchannelqueue',_0xaeb6('0x3a'),_0xaeb6('0x3b'),_0xaeb6('0x3c'),_0xaeb6('0x3d'),_0xaeb6('0x3e')];if(_[_0xaeb6('0x3f')](_0x3b7b66,function(_0x4f22ce){return!_[_0xaeb6('0x40')](_0x2f8708,_0x4f22ce[_0xaeb6('0x41')]['toLowerCase']());})){throw new db['Sequelize'][(_0xaeb6('0x30'))](_0xaeb6('0x42'));}}}var _0x7e18e6={};_0x7e18e6[_0xaeb6('0x43')]=_0x23cd58[_0xaeb6('0x2c')]['hasOwnProperty'](_0xaeb6('0x43'))?_0x23cd58[_0xaeb6('0x2c')][_0xaeb6('0x43')]:_0x23cd58[_0xaeb6('0x3e')][_0xaeb6('0x44')];_0x7e18e6[_0xaeb6('0x45')]=_[_0xaeb6('0x46')](_0x23cd58['body'][_0xaeb6('0x45')])?null:_0x23cd58[_0xaeb6('0x2c')][_0xaeb6('0x45')];_0x7e18e6[_0xaeb6('0x47')]=_0x23cd58[_0xaeb6('0x2c')][_0xaeb6('0x47')]||![];_0x7e18e6['SenderId']=_0x23cd58[_0xaeb6('0x3e')]['id'];return getContent(_0x23cd58['body'])[_0xaeb6('0x27')](function(_0x2f4912){_0x7e18e6['body']=_0x2f4912;return getRecipients(_0x3b7b66);})[_0xaeb6('0x27')](function(_0x516aa8){_0x7e18e6['recipientsId']=_[_0xaeb6('0x48')](_0x516aa8)[_0xaeb6('0x49')](',');return db[_0xaeb6('0x4a')]['transaction'](function(_0x3627dc){return db['UserNotification'][_0xaeb6('0x4b')](_0x7e18e6,{'raw':!![],'transaction':_0x3627dc})[_0xaeb6('0x27')](function(_0x4fffdf){var _0x4bf378={'sender':_0x7e18e6[_0xaeb6('0x43')],'description':_0x7e18e6['recipientsDescription'],'content':_0x7e18e6[_0xaeb6('0x2c')],'beep':_0x7e18e6[_0xaeb6('0x47')]};_0x516aa8[_0xaeb6('0x4c')](function(_0x1ed7b9){_0x4bf378['recipient']=_0x1ed7b9;socket[_0xaeb6('0x4d')](_0xaeb6('0x4e'),_0x4bf378);});return _0x4fffdf;});});})[_0xaeb6('0x27')](respondWithResult(_0x43a30c,0xc9))[_0xaeb6('0x4f')](handleError(_0x43a30c,null));};function getContent(_0x1507c1){return new BPromise(function(_0xdc8133,_0x43cba4){if(_0x1507c1[_0xaeb6('0x2e')]){_0xdc8133(_0x1507c1[_0xaeb6('0x2e')]);return;}return db[_0xaeb6('0x50')][_0xaeb6('0x51')]({'attributes':[_0xaeb6('0x52')],'where':{'id':_0x1507c1[_0xaeb6('0x31')]},'raw':!![]})[_0xaeb6('0x27')](function(_0x3ec9c7){if(!_0x3ec9c7)throw new db[(_0xaeb6('0x2f'))][(_0xaeb6('0x30'))](_0xaeb6('0x53'));var _0x215e6e=Mustache[_0xaeb6('0x54')](_0x3ec9c7[_0xaeb6('0x52')],_0x1507c1['view']);_0xdc8133(_0x215e6e);})[_0xaeb6('0x4f')](function(_0x553617){_0x43cba4(_0x553617);});});}function getRecipients(_0x4475ad){return new BPromise(function(_0x48ab0e,_0x2fe48c){var _0x2175c3=[];var _0xe8330c=[];_0x4475ad[_0xaeb6('0x4c')](function(_0x1362d9){var _0x12d637=_[_0xaeb6('0x55')](_0x1362d9[_0xaeb6('0x41')]['toLowerCase']());if(_0x12d637==='User'){_0x2175c3=_[_0xaeb6('0x56')](_0x2175c3,_0x1362d9[_0xaeb6('0x57')]);}else{if(_[_0xaeb6('0x40')](_0x12d637,_0xaeb6('0x58')))_0x12d637=_0x12d637[_0xaeb6('0x59')](_0xaeb6('0x58'),'Queue');_0x1362d9[_0xaeb6('0x57')][_0xaeb6('0x4c')](function(_0x3bccaa){_0xe8330c['push'](getAgents(_0x12d637,_0x3bccaa));});}});return BPromise[_0xaeb6('0x5a')](_0xe8330c)[_0xaeb6('0x27')](function(_0x57a55b){_0x2175c3=_[_0xaeb6('0x56')](_0x2175c3,_['flatten'](_0x57a55b));_0x48ab0e(_0x2175c3);})['catch'](function(_0x2b5077){_0x2fe48c(_0x2b5077);});});}function getAgents(_0x579d07,_0x3159dd){return new BPromise(function(_0x121d31,_0x37a3c0){return db[_0x579d07][_0xaeb6('0x51')]({'where':{'id':_0x3159dd}})[_0xaeb6('0x27')](function(_0x3572f8){return _0x3572f8[_0xaeb6('0x5b')]({'attributes':['id'],'raw':!![]})['then'](function(_0x29525b){var _0x31cf1d=_[_0xaeb6('0x5c')](_0x29525b,'id');_0x121d31(_0x31cf1d);});})[_0xaeb6('0x4f')](function(_0x2bb75b){_0x37a3c0(_0x2bb75b);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 0cd1a67..4b7c325 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 _0x4ba0=['UserNotification','setMaxListeners','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x3bbac7,_0x49ed36){var _0x2379f1=function(_0x4e685e){while(--_0x4e685e){_0x3bbac7['push'](_0x3bbac7['shift']());}};_0x2379f1(++_0x49ed36);}(_0x4ba0,0x181));var _0x04ba=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x4ba0[_0x5f309e];return _0x487b5e;};'use strict';var EventEmitter=require(_0x04ba('0x0'));var UserNotification=require(_0x04ba('0x1'))['db'][_0x04ba('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x04ba('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x04ba('0x4'),'afterDestroy':'remove'};function emitEvent(_0x56331a){return function(_0x54deba,_0x392d5c,_0x12bcb2){UserNotificationEvents['emit'](_0x56331a+':'+_0x54deba['id'],_0x54deba);UserNotificationEvents[_0x04ba('0x5')](_0x56331a,_0x54deba);_0x12bcb2(null);};}for(var e in events){if(events[_0x04ba('0x6')](e)){var event=events[e];UserNotification[_0x04ba('0x7')](e,emitEvent(event));}}module[_0x04ba('0x8')]=UserNotificationEvents; \ No newline at end of file +var _0xe0ab=['save','update','emit','hasOwnProperty','hook','exports','UserNotification'];(function(_0x71c0e8,_0x696b93){var _0x1d5cfc=function(_0x322d6b){while(--_0x322d6b){_0x71c0e8['push'](_0x71c0e8['shift']());}};_0x1d5cfc(++_0x696b93);}(_0xe0ab,0xbc));var _0xbe0a=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xe0ab[_0x2763f2];return _0x3ef471;};'use strict';var EventEmitter=require('events');var UserNotification=require('../../mysqldb')['db'][_0xbe0a('0x0')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbe0a('0x1'),'afterUpdate':_0xbe0a('0x2'),'afterDestroy':'remove'};function emitEvent(_0x1e09a3){return function(_0x471f66,_0x18a072,_0x15d401){UserNotificationEvents[_0xbe0a('0x3')](_0x1e09a3+':'+_0x471f66['id'],_0x471f66);UserNotificationEvents[_0xbe0a('0x3')](_0x1e09a3,_0x471f66);_0x15d401(null);};}for(var e in events){if(events[_0xbe0a('0x4')](e)){var event=events[e];UserNotification[_0xbe0a('0x5')](e,emitEvent(event));}}module[_0xbe0a('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 7e96903..379a9ac 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 _0xb793=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','exports','define','lodash','util'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xb793,0x1d2));var _0x3b79=function(_0x2211e3,_0x13fa27){_0x2211e3=_0x2211e3-0x0;var _0x5d2527=_0xb793[_0x2211e3];return _0x5d2527;};'use strict';var _=require(_0x3b79('0x0'));var util=require(_0x3b79('0x1'));var logger=require(_0x3b79('0x2'))(_0x3b79('0x3'));var moment=require(_0x3b79('0x4'));var BPromise=require(_0x3b79('0x5'));var rp=require(_0x3b79('0x6'));var fs=require('fs');var path=require(_0x3b79('0x7'));var rimraf=require(_0x3b79('0x8'));var config=require(_0x3b79('0x9'));var attributes=require(_0x3b79('0xa'));module[_0x3b79('0xb')]=function(_0x292bb4,_0x37680c){return _0x292bb4[_0x3b79('0xc')]('UserNotification',attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x4a1d=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','exports','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x889412,_0x30e9b8){var _0x44f0a3=function(_0x407677){while(--_0x407677){_0x889412['push'](_0x889412['shift']());}};_0x44f0a3(++_0x30e9b8);}(_0x4a1d,0x77));var _0xd4a1=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x4a1d[_0x173441];return _0x2423a8;};'use strict';var _=require(_0xd4a1('0x0'));var util=require(_0xd4a1('0x1'));var logger=require(_0xd4a1('0x2'))(_0xd4a1('0x3'));var moment=require(_0xd4a1('0x4'));var BPromise=require('bluebird');var rp=require(_0xd4a1('0x5'));var fs=require('fs');var path=require(_0xd4a1('0x6'));var rimraf=require(_0xd4a1('0x7'));var config=require(_0xd4a1('0x8'));var attributes=require(_0xd4a1('0x9'));module[_0xd4a1('0xa')]=function(_0x11fa5c,_0x1855b7){return _0x11fa5c['define'](_0xd4a1('0xb'),attributes,{'tableName':_0xd4a1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd4a1('0xd'),'collate':_0xd4a1('0xe')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 0e0fcf0..255406e 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 _0xa3eb=['request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','request','then','UserNotification,\x20%s,\x20%s','UserNotification,\x20%s,\x20%s,\x20%s'];(function(_0x3c911b,_0x1af14a){var _0x3283f8=function(_0x35f51f){while(--_0x35f51f){_0x3c911b['push'](_0x3c911b['shift']());}};_0x3283f8(++_0x1af14a);}(_0xa3eb,0x9d));var _0xba3e=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0xa3eb[_0x15bc81];return _0x59440e;};'use strict';var _=require(_0xba3e('0x0'));var util=require(_0xba3e('0x1'));var moment=require(_0xba3e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xba3e('0x3'));var db=require(_0xba3e('0x4'))['db'];var utils=require(_0xba3e('0x5'));var logger=require('../../config/logger')(_0xba3e('0x6'));var config=require(_0xba3e('0x7'));var jayson=require(_0xba3e('0x8'));var client=jayson[_0xba3e('0x9')][_0xba3e('0xa')]({'port':0x232a});config[_0xba3e('0xb')]=_[_0xba3e('0xc')](config['redis'],{'host':_0xba3e('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xba3e('0xb')]));require('./userNotification.socket')['register'](socket);function respondWithRpcPromise(_0x5d2a84,_0x327306,_0x364acb){return new BPromise(function(_0x38430d,_0x3a2aeb){return client[_0xba3e('0xe')](_0x5d2a84,_0x364acb)[_0xba3e('0xf')](function(_0xb20616){logger['info'](_0xba3e('0x10'),_0x327306,'request\x20sent');logger['debug'](_0xba3e('0x11'),_0x327306,_0xba3e('0x12'),JSON[_0xba3e('0x13')](_0xb20616));if(_0xb20616['error']){if(_0xb20616[_0xba3e('0x14')][_0xba3e('0x15')]===0x1f4){logger[_0xba3e('0x14')](_0xba3e('0x10'),_0x327306,_0xb20616['error'][_0xba3e('0x16')]);return _0x3a2aeb(_0xb20616[_0xba3e('0x14')]['message']);}logger[_0xba3e('0x14')](_0xba3e('0x10'),_0x327306,_0xb20616[_0xba3e('0x14')][_0xba3e('0x16')]);return _0x38430d(_0xb20616[_0xba3e('0x14')][_0xba3e('0x16')]);}else{logger['info'](_0xba3e('0x10'),_0x327306,_0xba3e('0x12'));_0x38430d(_0xb20616[_0xba3e('0x17')][_0xba3e('0x16')]);}})[_0xba3e('0x18')](function(_0x1cfbe7){logger[_0xba3e('0x14')](_0xba3e('0x10'),_0x327306,_0x1cfbe7);_0x3a2aeb(_0x1cfbe7);});});} \ No newline at end of file +var _0x515a=['result','catch','lodash','util','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./userNotification.socket','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','UserNotification,\x20%s,\x20%s,\x20%s','stringify','code','error','message'];(function(_0x4f1544,_0x1b1bb3){var _0x4e6399=function(_0x3df5a3){while(--_0x3df5a3){_0x4f1544['push'](_0x4f1544['shift']());}};_0x4e6399(++_0x1b1bb3);}(_0x515a,0x12e));var _0xa515=function(_0x215511,_0xcd5937){_0x215511=_0x215511-0x0;var _0x1d39a7=_0x515a[_0x215511];return _0x1d39a7;};'use strict';var _=require(_0xa515('0x0'));var util=require(_0xa515('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa515('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xa515('0x3'));var logger=require(_0xa515('0x4'))('rpc');var config=require(_0xa515('0x5'));var jayson=require(_0xa515('0x6'));var client=jayson[_0xa515('0x7')][_0xa515('0x8')]({'port':0x232a});config['redis']=_[_0xa515('0x9')](config[_0xa515('0xa')],{'host':_0xa515('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa515('0xa')]));require(_0xa515('0xc'))['register'](socket);function respondWithRpcPromise(_0x4d76bc,_0x100614,_0x4d1143){return new BPromise(function(_0x441689,_0x5ce5c6){return client[_0xa515('0xd')](_0x4d76bc,_0x4d1143)[_0xa515('0xe')](function(_0x55e179){logger[_0xa515('0xf')](_0xa515('0x10'),_0x100614,_0xa515('0x11'));logger['debug'](_0xa515('0x12'),_0x100614,_0xa515('0x11'),JSON[_0xa515('0x13')](_0x55e179));if(_0x55e179['error']){if(_0x55e179['error'][_0xa515('0x14')]===0x1f4){logger[_0xa515('0x15')](_0xa515('0x10'),_0x100614,_0x55e179['error'][_0xa515('0x16')]);return _0x5ce5c6(_0x55e179['error'][_0xa515('0x16')]);}logger[_0xa515('0x15')](_0xa515('0x10'),_0x100614,_0x55e179[_0xa515('0x15')][_0xa515('0x16')]);return _0x441689(_0x55e179[_0xa515('0x15')][_0xa515('0x16')]);}else{logger[_0xa515('0xf')](_0xa515('0x10'),_0x100614,_0xa515('0x11'));_0x441689(_0x55e179[_0xa515('0x17')]['message']);}})[_0xa515('0x18')](function(_0x178cab){logger[_0xa515('0x15')]('UserNotification,\x20%s,\x20%s',_0x100614,_0x178cab);_0x5ce5c6(_0x178cab);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 1239607..4a01643 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 _0x7746=['emit','removeListener','register','save','remove','update'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x7746,0x19b));var _0x6774=function(_0x3fdf35,_0x55a901){_0x3fdf35=_0x3fdf35-0x0;var _0x5a1de0=_0x7746[_0x3fdf35];return _0x5a1de0;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0x6774('0x0'),_0x6774('0x1'),_0x6774('0x2')];function createListener(_0x56036a,_0x545bd6){return function(_0x3f8a87){_0x545bd6[_0x6774('0x3')](_0x56036a,_0x3f8a87);};}function removeListener(_0x1a3a5e,_0x4f167a){return function(){UserNotificationEvents[_0x6774('0x4')](_0x1a3a5e,_0x4f167a);};}exports[_0x6774('0x5')]=function(_0x3ed891){for(var _0x45188f=0x0,_0x1d86e6=events['length'];_0x45188f<_0x1d86e6;_0x45188f++){var _0x146d70=events[_0x45188f];var _0x4dad92=createListener('userNotification:'+_0x146d70,_0x3ed891);UserNotificationEvents['on'](_0x146d70,_0x4dad92);}}; \ No newline at end of file +var _0xc006=['emit','removeListener','register','userNotification:','./userNotification.events','save','update'];(function(_0x360199,_0x2b130e){var _0x27802a=function(_0x362d8d){while(--_0x362d8d){_0x360199['push'](_0x360199['shift']());}};_0x27802a(++_0x2b130e);}(_0xc006,0x146));var _0x6c00=function(_0x1c8c07,_0x2579af){_0x1c8c07=_0x1c8c07-0x0;var _0x4aa88f=_0xc006[_0x1c8c07];return _0x4aa88f;};'use strict';var UserNotificationEvents=require(_0x6c00('0x0'));var events=[_0x6c00('0x1'),'remove',_0x6c00('0x2')];function createListener(_0x54d1a8,_0x5dbecd){return function(_0x213a7a){_0x5dbecd[_0x6c00('0x3')](_0x54d1a8,_0x213a7a);};}function removeListener(_0x42ebb7,_0x9906ad){return function(){UserNotificationEvents[_0x6c00('0x4')](_0x42ebb7,_0x9906ad);};}exports[_0x6c00('0x5')]=function(_0x309d50){for(var _0x18a585=0x0,_0x1e2667=events['length'];_0x18a585<_0x1e2667;_0x18a585++){var _0x15c480=events[_0x18a585];var _0x481bb3=createListener(_0x6c00('0x6')+_0x15c480,_0x309d50);UserNotificationEvents['on'](_0x15c480,_0x481bb3);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 68101f3..6b11660 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x44874b,_0x2cd063){var _0xbea081=function(_0x14182a){while(--_0x14182a){_0x44874b['push'](_0x44874b['shift']());}};_0xbea081(++_0x2cd063);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xe6e78c,_0x582369){_0xe6e78c=_0xe6e78c-0x0;var _0x2a09c8=_0xcb91[_0xe6e78c];return _0x2a09c8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=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(_0x3f315e,_0x497c99){var _0x4faa85=function(_0xe6f43c){while(--_0xe6f43c){_0x3f315e['push'](_0x3f315e['shift']());}};_0x4faa85(++_0x497c99);}(_0xe706,0xa3));var _0x6e70=function(_0x5da730,_0x27c81c){_0x5da730=_0x5da730-0x0;var _0x459c62=_0xe706[_0x5da730];return _0x459c62;};'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/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index a7aa5d4..25f58d3 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 _0x8208=['exports','INTEGER','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8208,0x16d));var _0x8820=function(_0xff5e3e,_0x4d1eef){_0xff5e3e=_0xff5e3e-0x0;var _0x50a9a4=_0x8208[_0xff5e3e];return _0x50a9a4;};'use strict';var Sequelize=require(_0x8820('0x0'));module[_0x8820('0x1')]={'penalty':{'type':Sequelize[_0x8820('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xfb78=['sequelize','exports','INTEGER'];(function(_0x572d4a,_0x11e2a4){var _0x13df28=function(_0x4975c5){while(--_0x4975c5){_0x572d4a['push'](_0x572d4a['shift']());}};_0x13df28(++_0x11e2a4);}(_0xfb78,0x141));var _0x8fb7=function(_0x9bca53,_0x59b4f8){_0x9bca53=_0x9bca53-0x0;var _0x3894bc=_0xfb78[_0x9bca53];return _0x3894bc;};'use strict';var Sequelize=require(_0x8fb7('0x0'));module[_0x8fb7('0x1')]={'penalty':{'type':Sequelize[_0x8fb7('0x2')],'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 fde95f0..3b6e7ae 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 _0xa23a=['rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','user_has_openchannel_queues','../../config/logger','api','bluebird','path'];(function(_0x4bb145,_0x3e7d33){var _0x4db596=function(_0x144489){while(--_0x144489){_0x4bb145['push'](_0x4bb145['shift']());}};_0x4db596(++_0x3e7d33);}(_0xa23a,0x125));var _0xaa23=function(_0x538406,_0x25c40b){_0x538406=_0x538406-0x0;var _0x18f8fd=_0xa23a[_0x538406];return _0x18f8fd;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xaa23('0x0'))(_0xaa23('0x1'));var moment=require('moment');var BPromise=require(_0xaa23('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaa23('0x3'));var rimraf=require(_0xaa23('0x4'));var config=require(_0xaa23('0x5'));var attributes=require(_0xaa23('0x6'));module[_0xaa23('0x7')]=function(_0x3baeb1,_0x2b234e){return _0x3baeb1['define']('UserOpenchannelQueue',attributes,{'tableName':_0xaa23('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2f15=['UserOpenchannelQueue','user_has_openchannel_queues','util','moment','bluebird','request-promise','path','rimraf','./userOpenchannelQueue.attributes','exports','define'];(function(_0x33c133,_0x322970){var _0x1524a7=function(_0x5f1941){while(--_0x5f1941){_0x33c133['push'](_0x33c133['shift']());}};_0x1524a7(++_0x322970);}(_0x2f15,0x178));var _0x52f1=function(_0x330ff0,_0x146528){_0x330ff0=_0x330ff0-0x0;var _0x215472=_0x2f15[_0x330ff0];return _0x215472;};'use strict';var _=require('lodash');var util=require(_0x52f1('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x52f1('0x1'));var BPromise=require(_0x52f1('0x2'));var rp=require(_0x52f1('0x3'));var fs=require('fs');var path=require(_0x52f1('0x4'));var rimraf=require(_0x52f1('0x5'));var config=require('../../config/environment');var attributes=require(_0x52f1('0x6'));module[_0x52f1('0x7')]=function(_0xdeec23,_0x142e61){return _0xdeec23[_0x52f1('0x8')](_0x52f1('0x9'),attributes,{'tableName':_0x52f1('0xa'),'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 c4ab074..218745e 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 _0x9d2d=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x68e9b0,_0x21a2ae){var _0xb9361=function(_0x3221e5){while(--_0x3221e5){_0x68e9b0['push'](_0x68e9b0['shift']());}};_0xb9361(++_0x21a2ae);}(_0x9d2d,0xb4));var _0xd9d2=function(_0x2cfc82,_0x1560a5){_0x2cfc82=_0x2cfc82-0x0;var _0x1d6c9f=_0x9d2d[_0x2cfc82];return _0x1d6c9f;};'use strict';var _=require(_0xd9d2('0x0'));var util=require(_0xd9d2('0x1'));var moment=require(_0xd9d2('0x2'));var BPromise=require(_0xd9d2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd9d2('0x4'));var db=require(_0xd9d2('0x5'))['db'];var utils=require(_0xd9d2('0x6'));var logger=require(_0xd9d2('0x7'))(_0xd9d2('0x8'));var config=require(_0xd9d2('0x9'));var jayson=require(_0xd9d2('0xa'));var client=jayson['client'][_0xd9d2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xe168ce,_0x57b026,_0x486d03){return new BPromise(function(_0x301050,_0x413eb7){return client['request'](_0xe168ce,_0x486d03)[_0xd9d2('0xc')](function(_0x185053){logger[_0xd9d2('0xd')](_0xd9d2('0xe'),_0x57b026,_0xd9d2('0xf'));logger[_0xd9d2('0x10')](_0xd9d2('0x11'),_0x57b026,_0xd9d2('0xf'),JSON[_0xd9d2('0x12')](_0x185053));if(_0x185053[_0xd9d2('0x13')]){if(_0x185053['error']['code']===0x1f4){logger[_0xd9d2('0x13')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x57b026,_0x185053[_0xd9d2('0x13')]['message']);return _0x413eb7(_0x185053[_0xd9d2('0x13')][_0xd9d2('0x14')]);}logger[_0xd9d2('0x13')](_0xd9d2('0xe'),_0x57b026,_0x185053['error'][_0xd9d2('0x14')]);return _0x301050(_0x185053[_0xd9d2('0x13')]['message']);}else{logger[_0xd9d2('0xd')](_0xd9d2('0xe'),_0x57b026,_0xd9d2('0xf'));_0x301050(_0x185053[_0xd9d2('0x15')][_0xd9d2('0x14')]);}})[_0xd9d2('0x16')](function(_0x18b5b8){logger['error'](_0xd9d2('0xe'),_0x57b026,_0x18b5b8);_0x413eb7(_0x18b5b8);});});} \ No newline at end of file +var _0x3fcb=['randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x57c2e8,_0x4c5038){var _0x5c971f=function(_0x327c50){while(--_0x327c50){_0x57c2e8['push'](_0x57c2e8['shift']());}};_0x5c971f(++_0x4c5038);}(_0x3fcb,0x1dd));var _0xb3fc=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3fcb[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xb3fc('0x0'));var util=require(_0xb3fc('0x1'));var moment=require(_0xb3fc('0x2'));var BPromise=require('bluebird');var rs=require(_0xb3fc('0x3'));var fs=require('fs');var Redis=require(_0xb3fc('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb3fc('0x5'))(_0xb3fc('0x6'));var config=require(_0xb3fc('0x7'));var jayson=require(_0xb3fc('0x8'));var client=jayson[_0xb3fc('0x9')][_0xb3fc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x58d8a5,_0x2e04a9,_0x5b7f5c){return new BPromise(function(_0x14d5b9,_0x4ef7cc){return client[_0xb3fc('0xb')](_0x58d8a5,_0x5b7f5c)[_0xb3fc('0xc')](function(_0x53a3bc){logger[_0xb3fc('0xd')](_0xb3fc('0xe'),_0x2e04a9,_0xb3fc('0xf'));logger[_0xb3fc('0x10')](_0xb3fc('0x11'),_0x2e04a9,'request\x20sent',JSON[_0xb3fc('0x12')](_0x53a3bc));if(_0x53a3bc[_0xb3fc('0x13')]){if(_0x53a3bc[_0xb3fc('0x13')][_0xb3fc('0x14')]===0x1f4){logger[_0xb3fc('0x13')](_0xb3fc('0xe'),_0x2e04a9,_0x53a3bc[_0xb3fc('0x13')][_0xb3fc('0x15')]);return _0x4ef7cc(_0x53a3bc[_0xb3fc('0x13')][_0xb3fc('0x15')]);}logger[_0xb3fc('0x13')](_0xb3fc('0xe'),_0x2e04a9,_0x53a3bc[_0xb3fc('0x13')][_0xb3fc('0x15')]);return _0x14d5b9(_0x53a3bc[_0xb3fc('0x13')][_0xb3fc('0x15')]);}else{logger[_0xb3fc('0xd')](_0xb3fc('0xe'),_0x2e04a9,_0xb3fc('0xf'));_0x14d5b9(_0x53a3bc[_0xb3fc('0x16')]['message']);}})[_0xb3fc('0x17')](function(_0x5ed7f1){logger[_0xb3fc('0x13')](_0xb3fc('0xe'),_0x2e04a9,_0x5ed7f1);_0x4ef7cc(_0x5ed7f1);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 9abf3de..a14f583 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 _0x56b7=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','isAuthenticated','index','get','describe','/:id','show','/:id/sections','getSections','post','clone','addSections','/:id/resources','addResources','update','delete','removeResources','exports','multer','util','path','connect-timeout'];(function(_0x4e774a,_0x5ab4b7){var _0x397474=function(_0x4b8311){while(--_0x4b8311){_0x4e774a['push'](_0x4e774a['shift']());}};_0x397474(++_0x5ab4b7);}(_0x56b7,0x184));var _0x756b=function(_0x5a0c3e,_0x5f3780){_0x5a0c3e=_0x5a0c3e-0x0;var _0x318886=_0x56b7[_0x5a0c3e];return _0x318886;};'use strict';var multer=require(_0x756b('0x0'));var util=require(_0x756b('0x1'));var path=require(_0x756b('0x2'));var timeout=require(_0x756b('0x3'));var express=require(_0x756b('0x4'));var router=express[_0x756b('0x5')]();var fs_extra=require(_0x756b('0x6'));var auth=require(_0x756b('0x7'));var interaction=require(_0x756b('0x8'));var config=require(_0x756b('0x9'));var controller=require(_0x756b('0xa'));router['get']('/',auth[_0x756b('0xb')](),controller[_0x756b('0xc')]);router[_0x756b('0xd')]('/describe',auth['isAuthenticated'](),controller[_0x756b('0xe')]);router[_0x756b('0xd')](_0x756b('0xf'),auth[_0x756b('0xb')](),controller[_0x756b('0x10')]);router['get'](_0x756b('0x11'),auth[_0x756b('0xb')](),controller[_0x756b('0x12')]);router[_0x756b('0xd')]('/:id/resources',auth[_0x756b('0xb')](),controller['getResources']);router[_0x756b('0x13')]('/',auth[_0x756b('0xb')](),controller['create']);router[_0x756b('0x13')]('/:id/clone',auth[_0x756b('0xb')](),controller[_0x756b('0x14')]);router[_0x756b('0x13')](_0x756b('0x11'),auth[_0x756b('0xb')](),controller[_0x756b('0x15')]);router[_0x756b('0x13')](_0x756b('0x16'),auth[_0x756b('0xb')](),controller[_0x756b('0x17')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x756b('0x18')]);router[_0x756b('0x19')](_0x756b('0xf'),auth[_0x756b('0xb')](),controller['destroy']);router[_0x756b('0x19')]('/:id/sections',auth['isAuthenticated'](),controller['removeSections']);router[_0x756b('0x19')](_0x756b('0x16'),auth[_0x756b('0xb')](),controller[_0x756b('0x1a')]);module[_0x756b('0x1b')]=router; \ No newline at end of file +var _0xba98=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','isAuthenticated','get','/describe','show','/:id/sections','getSections','/:id/resources','getResources','create','post','/:id/clone','clone','addSections','addResources','put','/:id','update','delete','destroy','removeSections','removeResources','exports','multer','util','connect-timeout'];(function(_0x2d78c6,_0x1b5010){var _0x43b12a=function(_0x50cccc){while(--_0x50cccc){_0x2d78c6['push'](_0x2d78c6['shift']());}};_0x43b12a(++_0x1b5010);}(_0xba98,0xdd));var _0x8ba9=function(_0x11d3cc,_0x1222f8){_0x11d3cc=_0x11d3cc-0x0;var _0x2752d8=_0xba98[_0x11d3cc];return _0x2752d8;};'use strict';var multer=require(_0x8ba9('0x0'));var util=require(_0x8ba9('0x1'));var path=require('path');var timeout=require(_0x8ba9('0x2'));var express=require(_0x8ba9('0x3'));var router=express[_0x8ba9('0x4')]();var fs_extra=require(_0x8ba9('0x5'));var auth=require(_0x8ba9('0x6'));var interaction=require(_0x8ba9('0x7'));var config=require(_0x8ba9('0x8'));var controller=require(_0x8ba9('0x9'));router['get']('/',auth[_0x8ba9('0xa')](),controller['index']);router[_0x8ba9('0xb')](_0x8ba9('0xc'),auth[_0x8ba9('0xa')](),controller['describe']);router[_0x8ba9('0xb')]('/:id',auth[_0x8ba9('0xa')](),controller[_0x8ba9('0xd')]);router[_0x8ba9('0xb')](_0x8ba9('0xe'),auth['isAuthenticated'](),controller[_0x8ba9('0xf')]);router[_0x8ba9('0xb')](_0x8ba9('0x10'),auth['isAuthenticated'](),controller[_0x8ba9('0x11')]);router['post']('/',auth[_0x8ba9('0xa')](),controller[_0x8ba9('0x12')]);router[_0x8ba9('0x13')](_0x8ba9('0x14'),auth[_0x8ba9('0xa')](),controller[_0x8ba9('0x15')]);router[_0x8ba9('0x13')](_0x8ba9('0xe'),auth[_0x8ba9('0xa')](),controller[_0x8ba9('0x16')]);router[_0x8ba9('0x13')](_0x8ba9('0x10'),auth[_0x8ba9('0xa')](),controller[_0x8ba9('0x17')]);router[_0x8ba9('0x18')](_0x8ba9('0x19'),auth[_0x8ba9('0xa')](),controller[_0x8ba9('0x1a')]);router[_0x8ba9('0x1b')]('/:id',auth[_0x8ba9('0xa')](),controller[_0x8ba9('0x1c')]);router[_0x8ba9('0x1b')](_0x8ba9('0xe'),auth['isAuthenticated'](),controller[_0x8ba9('0x1d')]);router[_0x8ba9('0x1b')](_0x8ba9('0x10'),auth[_0x8ba9('0xa')](),controller[_0x8ba9('0x1e')]);module[_0x8ba9('0x1f')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index ed06da2..f5b9446 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 _0x9b1a=['split','BOOLEAN','sequelize','exports','name','STRING','crudPermissions','join'];(function(_0xee1510,_0x42b1de){var _0x36481a=function(_0x2eb624){while(--_0x2eb624){_0xee1510['push'](_0xee1510['shift']());}};_0x36481a(++_0x42b1de);}(_0x9b1a,0x112));var _0xa9b1=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0x9b1a[_0x20ef64];return _0x3707d8;};'use strict';var Sequelize=require(_0xa9b1('0x0'));module[_0xa9b1('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xa9b1('0x2')},'crudPermissions':{'type':Sequelize[_0xa9b1('0x3')],'set':function(_0x2a11a5){this['setDataValue'](_0xa9b1('0x4'),_0x2a11a5?_0x2a11a5[_0xa9b1('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0xa9b1('0x4'))?this['getDataValue'](_0xa9b1('0x4'))[_0xa9b1('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xa9b1('0x3')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xa9b1('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xa9b1('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xa9b1('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xa9b1('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xa9b1('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xa9b1('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xa9b1('0x7')],'defaultValue':!![]}}; \ No newline at end of file +var _0xaac8=['split','BOOLEAN','sequelize','exports','name','STRING','setDataValue','crudPermissions','getDataValue'];(function(_0xdbe2de,_0x3bdc5a){var _0x2facd7=function(_0x50df58){while(--_0x50df58){_0xdbe2de['push'](_0xdbe2de['shift']());}};_0x2facd7(++_0x3bdc5a);}(_0xaac8,0xad));var _0x8aac=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0xaac8[_0x25e7cb];return _0x375d92;};'use strict';var Sequelize=require(_0x8aac('0x0'));module[_0x8aac('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x8aac('0x2')},'crudPermissions':{'type':Sequelize[_0x8aac('0x3')],'set':function(_0x703694){this[_0x8aac('0x4')](_0x8aac('0x5'),_0x703694?_0x703694['join'](''):[]);},'get':function(){return this[_0x8aac('0x6')](_0x8aac('0x5'))?this['getDataValue']('crudPermissions')[_0x8aac('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x8aac('0x3')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x8aac('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x8aac('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x8aac('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x8aac('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x8aac('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x8aac('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 6fe3016..9c9150e 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 _0x65cb=['keys','length','includeAll','options','find','create','body','params','get','createdAt','updatedAt','omit','sequelize','transaction','UserProfileSection','each','sectionId','Resources','UserProfileResource','describe','addSections','destroy','userProfileId','push','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','autoAssociation','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','Missing\x20section\x20parameter','nolimit','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','map','UserProfile','rawAttributes','fieldName','type','key','query','filters','model','attributes','intersection','fields','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','include','findAll','rows','catch','show'];(function(_0x2e9d2c,_0x2e97ad){var _0x233caa=function(_0x44a814){while(--_0x44a814){_0x2e9d2c['push'](_0x2e9d2c['shift']());}};_0x233caa(++_0x2e97ad);}(_0x65cb,0xa4));var _0xb65c=function(_0x269f58,_0x54c545){_0x269f58=_0x269f58-0x0;var _0x491139=_0x65cb[_0x269f58];return _0x491139;};'use strict';var emlformat=require(_0xb65c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb65c('0x1'));var jsonpatch=require(_0xb65c('0x2'));var rp=require(_0xb65c('0x3'));var moment=require('moment');var BPromise=require(_0xb65c('0x4'));var Mustache=require(_0xb65c('0x5'));var util=require(_0xb65c('0x6'));var path=require(_0xb65c('0x7'));var sox=require(_0xb65c('0x8'));var csv=require('to-csv');var ejs=require(_0xb65c('0x9'));var fs=require('fs');var fs_extra=require(_0xb65c('0xa'));var _=require(_0xb65c('0xb'));var squel=require(_0xb65c('0xc'));var crypto=require(_0xb65c('0xd'));var jsforce=require(_0xb65c('0xe'));var deskjs=require(_0xb65c('0xf'));var toCsv=require(_0xb65c('0x10'));var querystring=require('querystring');var Papa=require(_0xb65c('0x11'));var Redis=require(_0xb65c('0x12'));var authService=require(_0xb65c('0x13'));var qs=require(_0xb65c('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb65c('0x15'));var logger=require('../../config/logger')(_0xb65c('0x16'));var utils=require(_0xb65c('0x17'));var config=require(_0xb65c('0x18'));var licenseUtil=require(_0xb65c('0x19'));var db=require(_0xb65c('0x1a'))['db'];config[_0xb65c('0x1b')]=_['defaults'](config[_0xb65c('0x1b')],{'host':_0xb65c('0x1c'),'port':0x18eb});var socket=require(_0xb65c('0x1d'))(new Redis(config[_0xb65c('0x1b')]));require(_0xb65c('0x1e'))[_0xb65c('0x1f')](socket);function respondWithStatusCode(_0x2821e2,_0x48c337){_0x48c337=_0x48c337||0xcc;return function(_0x3bd91d){if(_0x3bd91d){return _0x2821e2[_0xb65c('0x20')](_0x48c337);}return _0x2821e2['status'](_0x48c337)[_0xb65c('0x21')]();};}function respondWithResult(_0x5c6d66,_0x32f4b5){_0x32f4b5=_0x32f4b5||0xc8;return function(_0x20b28e){if(_0x20b28e){return _0x5c6d66[_0xb65c('0x22')](_0x32f4b5)[_0xb65c('0x23')](_0x20b28e);}};}function respondWithFilteredResult(_0x24c1e2,_0x396eb2){return function(_0x1bca9d){if(_0x1bca9d){var _0x203c7b=typeof _0x396eb2[_0xb65c('0x24')]===_0xb65c('0x25')&&typeof _0x396eb2[_0xb65c('0x26')]===_0xb65c('0x25');var _0x2fe603=_0x1bca9d[_0xb65c('0x27')];var _0x1d36f9=_0x203c7b?0x0:_0x396eb2['offset'];var _0x2d54fc=_0x203c7b?_0x1bca9d[_0xb65c('0x27')]:_0x396eb2[_0xb65c('0x24')]+_0x396eb2[_0xb65c('0x26')];var _0x37b944;if(_0x2d54fc>=_0x2fe603){_0x2d54fc=_0x2fe603;_0x37b944=0xc8;}else{_0x37b944=0xce;}_0x24c1e2[_0xb65c('0x22')](_0x37b944);return _0x24c1e2[_0xb65c('0x28')](_0xb65c('0x29'),_0x1d36f9+'-'+_0x2d54fc+'/'+_0x2fe603)[_0xb65c('0x23')](_0x1bca9d);}return null;};}function patchUpdates(_0x33fa4c){return function(_0x1730ad){try{jsonpatch[_0xb65c('0x2a')](_0x1730ad,_0x33fa4c,!![]);}catch(_0xd04d5){return BPromise[_0xb65c('0x2b')](_0xd04d5);}return _0x1730ad[_0xb65c('0x2c')]();};}function saveUpdates(_0x5ed03,_0x108eb9){return function(_0x4ad9e4){if(_0x4ad9e4){return _0x4ad9e4[_0xb65c('0x2d')](_0x5ed03)[_0xb65c('0x2e')](function(_0x29c0c0){return _0x29c0c0;});}return null;};}function removeEntity(_0x585f93,_0x1b7e00){return function(_0x4c5627){if(_0x4c5627){return _0x4c5627['destroy']()['then'](function(){_0x585f93[_0xb65c('0x22')](0xcc)[_0xb65c('0x21')]();});}};}function handleEntityNotFound(_0xeb8e29,_0xc65b5a){return function(_0x4a9b0c){if(!_0x4a9b0c){_0xeb8e29[_0xb65c('0x20')](0x194);}return _0x4a9b0c;};}function handleError(_0x186f32,_0x3e372d){_0x3e372d=_0x3e372d||0x1f4;return function(_0x21cb9c){logger[_0xb65c('0x2f')](_0x21cb9c[_0xb65c('0x30')]);if(_0x21cb9c['name']){delete _0x21cb9c[_0xb65c('0x31')];}_0x186f32[_0xb65c('0x22')](_0x3e372d)[_0xb65c('0x32')](_0x21cb9c);};}exports['index']=function(_0x44fe3b,_0x5f5ca7){var _0x393320={},_0x1284cd={},_0x48eb26={'count':0x0,'rows':[]};var _0x123cf4=_[_0xb65c('0x33')](db[_0xb65c('0x34')][_0xb65c('0x35')],function(_0x1b3240){return{'name':_0x1b3240[_0xb65c('0x36')],'type':_0x1b3240[_0xb65c('0x37')][_0xb65c('0x38')]};});_0x1284cd['model']=_[_0xb65c('0x33')](_0x123cf4,_0xb65c('0x31'));_0x1284cd[_0xb65c('0x39')]=_['keys'](_0x44fe3b['query']);_0x1284cd[_0xb65c('0x3a')]=_['intersection'](_0x1284cd[_0xb65c('0x3b')],_0x1284cd['query']);_0x393320[_0xb65c('0x3c')]=_[_0xb65c('0x3d')](_0x1284cd[_0xb65c('0x3b')],qs[_0xb65c('0x3e')](_0x44fe3b['query'][_0xb65c('0x3e')]));_0x393320['attributes']=_0x393320[_0xb65c('0x3c')]['length']?_0x393320[_0xb65c('0x3c')]:_0x1284cd[_0xb65c('0x3b')];if(!_0x44fe3b[_0xb65c('0x39')][_0xb65c('0x3f')]('nolimit')){_0x393320[_0xb65c('0x26')]=qs[_0xb65c('0x26')](_0x44fe3b[_0xb65c('0x39')]['limit']);_0x393320[_0xb65c('0x24')]=qs[_0xb65c('0x24')](_0x44fe3b['query']['offset']);}_0x393320[_0xb65c('0x40')]=qs[_0xb65c('0x41')](_0x44fe3b[_0xb65c('0x39')][_0xb65c('0x41')]);_0x393320['where']=qs[_0xb65c('0x3a')](_[_0xb65c('0x42')](_0x44fe3b[_0xb65c('0x39')],_0x1284cd[_0xb65c('0x3a')]),_0x123cf4);if(_0x44fe3b['query'][_0xb65c('0x43')]){_0x393320[_0xb65c('0x44')]=_[_0xb65c('0x45')](_0x393320[_0xb65c('0x44')],{'$or':_[_0xb65c('0x33')](_0x123cf4,function(_0x12a8c0){if(_0x12a8c0[_0xb65c('0x37')]!==_0xb65c('0x46')){var _0xc83cb3={};_0xc83cb3[_0x12a8c0[_0xb65c('0x31')]]={'$like':'%'+_0x44fe3b[_0xb65c('0x39')][_0xb65c('0x43')]+'%'};return _0xc83cb3;}})});}_0x393320=_[_0xb65c('0x45')]({},_0x393320,_0x44fe3b['options']);var _0x4c9bd9={'where':_0x393320[_0xb65c('0x44')]};return db[_0xb65c('0x34')][_0xb65c('0x27')](_0x4c9bd9)['then'](function(_0x42acd6){_0x48eb26[_0xb65c('0x27')]=_0x42acd6;if(_0x44fe3b['query']['includeAll']){_0x393320[_0xb65c('0x47')]=[{'all':!![]}];}return db[_0xb65c('0x34')][_0xb65c('0x48')](_0x393320);})[_0xb65c('0x2e')](function(_0x199625){_0x48eb26[_0xb65c('0x49')]=_0x199625;return _0x48eb26;})['then'](respondWithFilteredResult(_0x5f5ca7,_0x393320))[_0xb65c('0x4a')](handleError(_0x5f5ca7,null));};exports[_0xb65c('0x4b')]=function(_0x2a384d,_0x8300c2){var _0x3851fa={'raw':![],'where':{'id':_0x2a384d['params']['id']}},_0x169b7f={};_0x169b7f[_0xb65c('0x3b')]=_[_0xb65c('0x4c')](db[_0xb65c('0x34')][_0xb65c('0x35')]);_0x169b7f[_0xb65c('0x39')]=_['keys'](_0x2a384d[_0xb65c('0x39')]);_0x169b7f[_0xb65c('0x3a')]=_[_0xb65c('0x3d')](_0x169b7f[_0xb65c('0x3b')],_0x169b7f[_0xb65c('0x39')]);_0x3851fa['attributes']=_['intersection'](_0x169b7f[_0xb65c('0x3b')],qs[_0xb65c('0x3e')](_0x2a384d[_0xb65c('0x39')][_0xb65c('0x3e')]));_0x3851fa['attributes']=_0x3851fa[_0xb65c('0x3c')][_0xb65c('0x4d')]?_0x3851fa['attributes']:_0x169b7f[_0xb65c('0x3b')];if(_0x2a384d['query'][_0xb65c('0x4e')]){_0x3851fa[_0xb65c('0x47')]=[{'all':!![]}];}_0x3851fa=_[_0xb65c('0x45')]({},_0x3851fa,_0x2a384d[_0xb65c('0x4f')]);return db['UserProfile'][_0xb65c('0x50')](_0x3851fa)[_0xb65c('0x2e')](handleEntityNotFound(_0x8300c2,null))[_0xb65c('0x2e')](respondWithResult(_0x8300c2,null))[_0xb65c('0x4a')](handleError(_0x8300c2,null));};exports[_0xb65c('0x51')]=function(_0x5e81e2,_0x481d4d){return db[_0xb65c('0x34')][_0xb65c('0x51')](_0x5e81e2[_0xb65c('0x52')],{})['then'](respondWithResult(_0x481d4d,0xc9))[_0xb65c('0x4a')](handleError(_0x481d4d,null));};exports['clone']=function(_0x2ca61f,_0x488f34){var _0x489eb3={'where':{'id':_0x2ca61f[_0xb65c('0x53')]['id']}},_0x50f16d={};_0x50f16d['model']=_['keys'](db[_0xb65c('0x34')][_0xb65c('0x35')]);_0x489eb3[_0xb65c('0x3c')]=_[_0xb65c('0x3d')](_0x50f16d[_0xb65c('0x3b')],qs[_0xb65c('0x3e')](_0x2ca61f['query']['fields']));_0x489eb3[_0xb65c('0x3c')]=_0x489eb3[_0xb65c('0x3c')]['length']?_0x489eb3[_0xb65c('0x3c')]:_0x50f16d[_0xb65c('0x3b')];if(_0x2ca61f[_0xb65c('0x39')]['includeAll']){_0x489eb3[_0xb65c('0x47')]=[{'all':!![]}];}_0x489eb3=_['merge']({},_0x489eb3,_0x2ca61f[_0xb65c('0x4f')]);return db[_0xb65c('0x34')][_0xb65c('0x50')](_0x489eb3)['then'](handleEntityNotFound(_0x488f34,null))['then'](function(_0x852886){if(_0x852886){var _0x1d3664=_0x852886[_0xb65c('0x54')]({'plain':!![]});_0x1d3664=qs['omit'](_0x1d3664,['id',_0xb65c('0x55'),_0xb65c('0x56'),'crudPermissions']);_0x2ca61f[_0xb65c('0x52')]=_[_0xb65c('0x57')](_0x2ca61f['body'],['id',_0xb65c('0x55'),_0xb65c('0x56')]);return db[_0xb65c('0x58')][_0xb65c('0x59')](function(_0x4f3af4){return db[_0xb65c('0x34')]['create'](_['merge'](_0x1d3664,_0x2ca61f[_0xb65c('0x52')]),{'include':_0x2ca61f[_0xb65c('0x39')][_0xb65c('0x4e')]?[{'all':!![]}]:undefined,'transaction':_0x4f3af4})[_0xb65c('0x2e')](function(_0x2677ad){var _0x3585d7=_0x2677ad[_0xb65c('0x54')]({'plain':!![]});return db[_0xb65c('0x5a')][_0xb65c('0x48')]({'where':{'userProfileId':_0x2ca61f['params']['id']},'raw':!![]})[_0xb65c('0x2e')](function(_0x584c2c){if(_0x584c2c){return BPromise[_0xb65c('0x5b')](_0x584c2c,function(_0x39fa16){return new BPromise(function(_0x866214,_0x76a3bd){if(_0x39fa16['autoAssociation']===null||_0x39fa16['autoAssociation']===0x1)_0x866214(null);return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x39fa16['id']},'raw':!![]})[_0xb65c('0x2e')](function(_0x53605d){var _0x56727b=_['map'](_0x53605d,function(_0x3843de){return qs[_0xb65c('0x57')](_0x3843de,['id','createdAt',_0xb65c('0x56'),_0xb65c('0x5c')]);});_0x866214(_0x56727b);})['catch'](function(_0x48004c){_0x76a3bd(_0x48004c);});})[_0xb65c('0x2e')](function(_0x2634ab){var _0x4214ce=qs[_0xb65c('0x57')](_0x39fa16,['id','createdAt',_0xb65c('0x56')]);_0x4214ce['userProfileId']=_0x3585d7['id'];if(_0x2634ab)_0x4214ce[_0xb65c('0x5d')]=_0x2634ab;return _0x4214ce;})['then'](function(_0x359162){return db['UserProfileSection'][_0xb65c('0x51')](_0x359162,{'include':[{'model':db[_0xb65c('0x5e')],'as':_0xb65c('0x5d')}],'raw':!![],'transaction':_0x4f3af4});});})[_0xb65c('0x2e')](function(){return _0x3585d7;});}});});});}})[_0xb65c('0x2e')](respondWithResult(_0x488f34,0xc9))[_0xb65c('0x4a')](handleError(_0x488f34,null));};exports[_0xb65c('0x2d')]=function(_0x51e8f8,_0x4e17b2){if(_0x51e8f8[_0xb65c('0x52')]['id']){delete _0x51e8f8[_0xb65c('0x52')]['id'];}return db['UserProfile'][_0xb65c('0x50')]({'where':{'id':_0x51e8f8[_0xb65c('0x53')]['id']}})[_0xb65c('0x2e')](handleEntityNotFound(_0x4e17b2,null))['then'](saveUpdates(_0x51e8f8[_0xb65c('0x52')],null))[_0xb65c('0x2e')](respondWithResult(_0x4e17b2,null))[_0xb65c('0x4a')](handleError(_0x4e17b2,null));};exports['destroy']=function(_0x56fdee,_0x12616a){return db[_0xb65c('0x34')][_0xb65c('0x50')]({'where':{'id':_0x56fdee['params']['id']}})['then'](handleEntityNotFound(_0x12616a,null))[_0xb65c('0x2e')](removeEntity(_0x12616a,null))['catch'](handleError(_0x12616a,null));};exports[_0xb65c('0x5f')]=function(_0x619b13,_0x3dcc4b){return db[_0xb65c('0x34')][_0xb65c('0x5f')]()[_0xb65c('0x2e')](respondWithResult(_0x3dcc4b,null))[_0xb65c('0x4a')](handleError(_0x3dcc4b,null));};exports[_0xb65c('0x60')]=function(_0x5c5e55,_0x24f043){var _0x593af0=_0x5c5e55[_0xb65c('0x52')];return db[_0xb65c('0x34')][_0xb65c('0x50')]({'where':{'id':_0x5c5e55['params']['id']}})[_0xb65c('0x2e')](handleEntityNotFound(_0x24f043,null))[_0xb65c('0x2e')](function(_0x128a4e){if(_0x128a4e){return db[_0xb65c('0x58')][_0xb65c('0x59')](function(_0x683a98){return db[_0xb65c('0x5a')][_0xb65c('0x61')]({'where':{'userProfileId':_0x5c5e55[_0xb65c('0x53')]['id'],'sectionId':_['map'](_0x593af0,function(_0x3017fc){return _0x3017fc[_0xb65c('0x5c')];})},'transaction':_0x683a98})[_0xb65c('0x2e')](function(){var _0x10eaff=_[_0xb65c('0x33')](_0x593af0,function(_0x4611c5){_0x4611c5[_0xb65c('0x62')]=_0x5c5e55['params']['id'];return _0x4611c5;});var _0x4807ab=[];return BPromise[_0xb65c('0x5b')](_0x10eaff,function(_0x1c4ecf){return db['UserProfileSection'][_0xb65c('0x51')](_0x1c4ecf,{'include':[{'model':db[_0xb65c('0x5e')],'as':_0xb65c('0x5d')}],'raw':!![],'transaction':_0x683a98})[_0xb65c('0x2e')](function(_0xa78dd7){_0x4807ab[_0xb65c('0x63')](_0xa78dd7[_0xb65c('0x54')]({'plain':!![]}));});})[_0xb65c('0x2e')](function(){return _0x4807ab;});});});}})[_0xb65c('0x2e')](function(_0x4da99a){return _0x4da99a;})[_0xb65c('0x2e')](respondWithResult(_0x24f043,null))[_0xb65c('0x4a')](handleError(_0x24f043,null));};exports[_0xb65c('0x64')]=function(_0x3231c8,_0x1b7ff6){var _0x886490;return db[_0xb65c('0x34')][_0xb65c('0x50')]({'where':{'id':_0x3231c8[_0xb65c('0x53')]['id']},'attributes':['id',_0xb65c('0x31')]})['then'](handleEntityNotFound(_0x1b7ff6,null))[_0xb65c('0x2e')](function(_0x289919){if(_0x289919){_0x886490=_0x289919;return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x3231c8[_0xb65c('0x53')]['id'],'sectionId':_0x3231c8[_0xb65c('0x39')][_0xb65c('0x65')]}});}})[_0xb65c('0x2e')](function(){return _0x886490;})[_0xb65c('0x2e')](respondWithStatusCode(_0x1b7ff6,null))[_0xb65c('0x4a')](handleError(_0x1b7ff6,null));};exports[_0xb65c('0x66')]=function(_0x48fcdb,_0x1228d9){var _0x158d91=[];var _0x5779ba=[];return db[_0xb65c('0x5a')][_0xb65c('0x48')]({'where':{'userProfileId':_0x48fcdb[_0xb65c('0x53')]['id']},'raw':!![]})['then'](function(_0x134248){_0x158d91=_['filter'](_0x134248,function(_0x5ee546){return _0x5ee546[_0xb65c('0x67')]===0x1||_[_0xb65c('0x68')]([0x3eb,0x709],_0x5ee546[_0xb65c('0x5c')]);});if(!_[_0xb65c('0x69')](_0x158d91)){return _[_0xb65c('0x33')](_0x158d91,function(_0x44cb52){return _0x44cb52[_0xb65c('0x5c')];});}else{return;}})['then'](function(_0x3c3b18){if(_0x3c3b18)_0x5779ba=_0x3c3b18;if(_['includes'](_0x5779ba,0x64)){var _0x306999=_[_0xb65c('0x50')](_0x158d91,{'sectionId':0x64});return hasDefaultDashboard(_0x306999)[_0xb65c('0x2e')](function(_0x997f9a){return _['map'](_0x158d91,function(_0x59f5f6){if(_0x59f5f6['sectionId']===0x64){_0x59f5f6[_0xb65c('0x6a')]=_0x997f9a;}return _0x59f5f6;});});}else{return;}})['then'](function(_0xf4eb64){if(_0xf4eb64)_0x158d91=_0xf4eb64;if(_[_0xb65c('0x68')](_0x5779ba,0x3eb)){var _0x2f8b7=_[_0xb65c('0x50')](_0x158d91,{'sectionId':0x3eb});return getCustomDashboards(_0x2f8b7)[_0xb65c('0x2e')](function(_0x1bbe90){return _[_0xb65c('0x33')](_0x158d91,function(_0x3bbfe7){if(_0x2f8b7[_0xb65c('0x67')]){if(_0x3bbfe7[_0xb65c('0x5c')]===0x3eb){_0x3bbfe7['subsections']=_0x1bbe90;}}else{if(_0x3bbfe7[_0xb65c('0x5c')]===0x64){_0x3bbfe7[_0xb65c('0x6a')]=_0x1bbe90;}}return _0x3bbfe7;});});}else{return;}})[_0xb65c('0x2e')](function(_0x398702){if(_0x398702)_0x158d91=_0x398702;if(_['includes'](_0x5779ba,0x709)){var _0x298722=_[_0xb65c('0x50')](_0x158d91,{'sectionId':0x709});return getPlugins(_0x298722)[_0xb65c('0x2e')](function(_0x318edf){if(_0x298722[_0xb65c('0x67')]){return _[_0xb65c('0x33')](_0x158d91,function(_0x14370b){if(_0x14370b[_0xb65c('0x5c')]===0x709){_0x14370b[_0xb65c('0x6a')]=_0x318edf;}return _0x14370b;});}else{var _0x113002={'sectionId':0x76c,'enabled':0x1,'subsections':_0x318edf};var _0x5b9e8d=_[_0xb65c('0x33')](_0x158d91);_0x5b9e8d[_0xb65c('0x63')](_0x113002);return _0x5b9e8d;}});}else{return;}})[_0xb65c('0x2e')](function(_0x4da2c0){if(_0x4da2c0)_0x158d91=_0x4da2c0;return _[_0xb65c('0x43')](_0x158d91,[_0xb65c('0x67'),0x1]);})[_0xb65c('0x2e')](respondWithResult(_0x1228d9,null))[_0xb65c('0x4a')](handleError(_0x1228d9,null));};function hasDefaultDashboard(_0x48f783){var _0x36be93=[0x65];return new BPromise(function(_0x128d17,_0x2e4f95){try{if(_0x48f783[_0xb65c('0x6b')]){_0x128d17(_0x36be93);}else{return db[_0xb65c('0x5e')][_0xb65c('0x6c')]({'where':{'sectionId':_0x48f783['id']},'raw':!![]})[_0xb65c('0x2e')](function(_0x3ab9c5){_0x3ab9c5?_0x128d17(_0x36be93):_0x128d17();});}}catch(_0x246a8b){_0x2e4f95(_0x246a8b);}});}function getCustomDashboards(_0x4afbb9){var _0xebb714=[];return new BPromise(function(_0xb31b06,_0x3a26e6){try{if(_0x4afbb9['autoAssociation']){return db[_0xb65c('0x6d')][_0xb65c('0x48')]({'raw':!![]})['then'](function(_0x1bca4b){_0x1bca4b[_0xb65c('0x6e')](function(_0x297efe){_0xebb714['push'](_0x297efe['id']+0x1869f);});_0xb31b06(_0xebb714);});}else{return db[_0xb65c('0x5e')]['findAll']({'where':{'sectionId':_0x4afbb9['id']},'raw':!![]})[_0xb65c('0x2e')](function(_0x1a9a26){_0x1a9a26[_0xb65c('0x6e')](function(_0x16c1f6){_0xebb714[_0xb65c('0x63')](_0x16c1f6[_0xb65c('0x6f')]+0x1869f);});_0xb31b06(_0xebb714);});}}catch(_0x37e121){_0x3a26e6(_0x37e121);}});}function getPlugins(_0x2cfc0b){var _0x33635c=[];return new BPromise(function(_0x56317c,_0x1fae00){try{if(_0x2cfc0b[_0xb65c('0x6b')]){return db[_0xb65c('0x70')][_0xb65c('0x48')]({'raw':!![]})['then'](function(_0x3f916f){_0x3f916f[_0xb65c('0x6e')](function(_0x35ef01){_0x33635c[_0xb65c('0x63')](_0x35ef01['id']+0x15b38);});_0x56317c(_0x33635c);});}else{return db['UserProfileResource'][_0xb65c('0x48')]({'where':{'sectionId':_0x2cfc0b['id']},'raw':!![]})[_0xb65c('0x2e')](function(_0x13afb6){_0x13afb6[_0xb65c('0x6e')](function(_0x560eac){_0x33635c[_0xb65c('0x63')](_0x560eac[_0xb65c('0x6f')]+0x15b38);});_0x56317c(_0x33635c);});}}catch(_0x51f2c6){_0x1fae00(_0x51f2c6);}});}exports[_0xb65c('0x71')]=function(_0x3c35ce,_0x1fc361){return db[_0xb65c('0x34')]['find']({'where':{'id':_0x3c35ce[_0xb65c('0x53')]['id']}})[_0xb65c('0x2e')](handleEntityNotFound(_0x1fc361,null))[_0xb65c('0x2e')](function(_0x1e79f5){if(_0x1e79f5){return db[_0xb65c('0x58')]['transaction'](function(_0x2c098c){return db[_0xb65c('0x5a')][_0xb65c('0x48')]({'where':{'userProfileId':_0x3c35ce[_0xb65c('0x53')]['id']},'attributes':['id'],'raw':!![]})[_0xb65c('0x2e')](function(_0x5e0970){if(_0x5e0970){return db[_0xb65c('0x5a')]['destroy']({'where':{'userProfileId':_0x3c35ce[_0xb65c('0x53')]['id'],'id':_['map'](_0x5e0970,function(_0x273495){return _0x273495['id'];})},'transaction':_0x2c098c});}})['then'](function(_0x5d506f){var _0xee82a3=_[_0xb65c('0x33')](_0x3c35ce[_0xb65c('0x52')],function(_0x164aed){_0x164aed[_0xb65c('0x62')]=_0x3c35ce[_0xb65c('0x53')]['id'];return _0x164aed;});return db[_0xb65c('0x5a')]['bulkCreate'](_0xee82a3,{'raw':!![],'transaction':_0x2c098c});})['then'](function(_0x3c63de){var _0x1f693d=_['filter'](_['map'](_0x3c63de,function(_0x53396c){return _0x53396c[_0xb65c('0x54')]({'plain':!![]});}),{'includeAll':![]});if(_0x1f693d){return db[_0xb65c('0x5a')][_0xb65c('0x48')]({'where':{'userProfileId':_0x3c35ce[_0xb65c('0x53')]['id'],'sectionId':_['map'](_0x1f693d,function(_0x42b1cb){return _0x42b1cb[_0xb65c('0x5c')];})},'attributes':['id',_0xb65c('0x5c')],'raw':!![]})[_0xb65c('0x2e')](function(_0x8a1a1b){var _0x223515=_[_0xb65c('0x33')](_0x3c35ce[_0xb65c('0x52')],function(_0x2f8049){_0x2f8049[_0xb65c('0x62')]=_0x3c35ce[_0xb65c('0x53')]['id'];return _0x2f8049;});return db[_0xb65c('0x5e')][_0xb65c('0x72')](_0x223515,{'raw':!![],'transaction':_0x2c098c});});}})['catch'](handleError(_0x1fc361,null));});}})[_0xb65c('0x2e')](function(_0x2ca2a7){var _0x36726e=_[_0xb65c('0x33')](_0x2ca2a7,function(_0x2baef2){return _0x2baef2['get']({'plain':!![]});});})['then'](respondWithResult(_0x1fc361,null))[_0xb65c('0x4a')](handleError(_0x1fc361,null));};exports[_0xb65c('0x73')]=function(_0x1ddbb6,_0x179a2f,_0x47bc88){return db[_0xb65c('0x34')]['find']({'where':{'id':_0x1ddbb6[_0xb65c('0x53')]['id']}})[_0xb65c('0x2e')](handleEntityNotFound(_0x179a2f,null))['then'](function(_0xde12a8){if(_0xde12a8){return _0xde12a8['removeResources'](_0x1ddbb6[_0xb65c('0x39')]['ids']);}})[_0xb65c('0x2e')](respondWithStatusCode(_0x179a2f,null))['catch'](handleError(_0x179a2f,null));};exports[_0xb65c('0x74')]=function(_0x49a0bc,_0x3f6c2b){var _0x4ddaa5={};if(!_0x49a0bc[_0xb65c('0x39')]['section'])throw new Error(_0xb65c('0x75'));if(!_0x49a0bc[_0xb65c('0x39')][_0xb65c('0x3f')](_0xb65c('0x76'))){_0x4ddaa5[_0xb65c('0x26')]=qs[_0xb65c('0x26')](_0x49a0bc[_0xb65c('0x39')]['limit']);_0x4ddaa5[_0xb65c('0x24')]=qs[_0xb65c('0x24')](_0x49a0bc[_0xb65c('0x39')]['offset']);}return db[_0xb65c('0x34')][_0xb65c('0x50')]({'where':{'id':_0x49a0bc[_0xb65c('0x53')]['id']}})['then'](function(_0x574d34){if(!_0x574d34)throw new Error(_0xb65c('0x77')+_0x49a0bc[_0xb65c('0x53')]['id']);return db[_0xb65c('0x34')]['getResources'](_0x49a0bc);})[_0xb65c('0x2e')](respondWithFilteredResult(_0x3f6c2b,_0x4ddaa5))['catch'](handleError(_0x3f6c2b,null));}; \ No newline at end of file +var _0x56c8=['save','update','destroy','error','name','UserProfile','rawAttributes','fieldName','type','key','map','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','then','rows','show','params','keys','includeAll','include','options','find','catch','create','body','clone','get','createdAt','updatedAt','crudPermissions','omit','sequelize','transaction','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','UserProfileSection','describe','addSections','removeSections','getSections','findAll','enabled','includes','isEmpty','subsections','push','Dashboard','forEach','Plugin','resourceId','addResources','bulkCreate','removeResources','ids','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x56c8,0x12f));var _0x856c=function(_0x572caa,_0x3209a6){_0x572caa=_0x572caa-0x0;var _0x4efc1d=_0x56c8[_0x572caa];return _0x4efc1d;};'use strict';var emlformat=require(_0x856c('0x0'));var rimraf=require(_0x856c('0x1'));var zipdir=require(_0x856c('0x2'));var jsonpatch=require(_0x856c('0x3'));var rp=require('request-promise');var moment=require(_0x856c('0x4'));var BPromise=require(_0x856c('0x5'));var Mustache=require(_0x856c('0x6'));var util=require(_0x856c('0x7'));var path=require(_0x856c('0x8'));var sox=require('sox');var csv=require(_0x856c('0x9'));var ejs=require(_0x856c('0xa'));var fs=require('fs');var fs_extra=require(_0x856c('0xb'));var _=require(_0x856c('0xc'));var squel=require(_0x856c('0xd'));var crypto=require(_0x856c('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x856c('0x9'));var querystring=require(_0x856c('0xf'));var Papa=require(_0x856c('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x856c('0x11'));var hardwareService=require(_0x856c('0x12'));var logger=require(_0x856c('0x13'))('api');var utils=require(_0x856c('0x14'));var config=require(_0x856c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x856c('0x16'))['db'];config[_0x856c('0x17')]=_[_0x856c('0x18')](config[_0x856c('0x17')],{'host':_0x856c('0x19'),'port':0x18eb});var socket=require(_0x856c('0x1a'))(new Redis(config[_0x856c('0x17')]));require(_0x856c('0x1b'))['register'](socket);function respondWithStatusCode(_0x45213f,_0x5307b7){_0x5307b7=_0x5307b7||0xcc;return function(_0x3d5d09){if(_0x3d5d09){return _0x45213f[_0x856c('0x1c')](_0x5307b7);}return _0x45213f[_0x856c('0x1d')](_0x5307b7)[_0x856c('0x1e')]();};}function respondWithResult(_0x6856e5,_0x13f1ae){_0x13f1ae=_0x13f1ae||0xc8;return function(_0x26aba6){if(_0x26aba6){return _0x6856e5[_0x856c('0x1d')](_0x13f1ae)[_0x856c('0x1f')](_0x26aba6);}};}function respondWithFilteredResult(_0x1dd26e,_0x1f9094){return function(_0xf24755){if(_0xf24755){var _0x44cb08=typeof _0x1f9094[_0x856c('0x20')]===_0x856c('0x21')&&typeof _0x1f9094[_0x856c('0x22')]===_0x856c('0x21');var _0x4183ab=_0xf24755[_0x856c('0x23')];var _0x1a262a=_0x44cb08?0x0:_0x1f9094[_0x856c('0x20')];var _0x1dd835=_0x44cb08?_0xf24755['count']:_0x1f9094['offset']+_0x1f9094[_0x856c('0x22')];var _0x277518;if(_0x1dd835>=_0x4183ab){_0x1dd835=_0x4183ab;_0x277518=0xc8;}else{_0x277518=0xce;}_0x1dd26e[_0x856c('0x1d')](_0x277518);return _0x1dd26e['set'](_0x856c('0x24'),_0x1a262a+'-'+_0x1dd835+'/'+_0x4183ab)['json'](_0xf24755);}return null;};}function patchUpdates(_0x202357){return function(_0x372f60){try{jsonpatch[_0x856c('0x25')](_0x372f60,_0x202357,!![]);}catch(_0x5c5a3e){return BPromise[_0x856c('0x26')](_0x5c5a3e);}return _0x372f60[_0x856c('0x27')]();};}function saveUpdates(_0x3984a7,_0x106e38){return function(_0x901a0c){if(_0x901a0c){return _0x901a0c[_0x856c('0x28')](_0x3984a7)['then'](function(_0x3a048d){return _0x3a048d;});}return null;};}function removeEntity(_0x16678d,_0x4150ec){return function(_0x47e45c){if(_0x47e45c){return _0x47e45c[_0x856c('0x29')]()['then'](function(){_0x16678d[_0x856c('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d38d4,_0x23f53d){return function(_0x4a8107){if(!_0x4a8107){_0x3d38d4[_0x856c('0x1c')](0x194);}return _0x4a8107;};}function handleError(_0x514d6c,_0x1a0a48){_0x1a0a48=_0x1a0a48||0x1f4;return function(_0x384f5f){logger[_0x856c('0x2a')](_0x384f5f['stack']);if(_0x384f5f[_0x856c('0x2b')]){delete _0x384f5f[_0x856c('0x2b')];}_0x514d6c[_0x856c('0x1d')](_0x1a0a48)['send'](_0x384f5f);};}exports['index']=function(_0x3eaced,_0x2a809d){var _0x21a868={},_0x25cbab={},_0x39ab90={'count':0x0,'rows':[]};var _0x2e1e91=_['map'](db[_0x856c('0x2c')][_0x856c('0x2d')],function(_0x1dc382){return{'name':_0x1dc382[_0x856c('0x2e')],'type':_0x1dc382[_0x856c('0x2f')][_0x856c('0x30')]};});_0x25cbab['model']=_[_0x856c('0x31')](_0x2e1e91,_0x856c('0x2b'));_0x25cbab[_0x856c('0x32')]=_['keys'](_0x3eaced[_0x856c('0x32')]);_0x25cbab[_0x856c('0x33')]=_['intersection'](_0x25cbab[_0x856c('0x34')],_0x25cbab[_0x856c('0x32')]);_0x21a868[_0x856c('0x35')]=_[_0x856c('0x36')](_0x25cbab[_0x856c('0x34')],qs['fields'](_0x3eaced[_0x856c('0x32')][_0x856c('0x37')]));_0x21a868[_0x856c('0x35')]=_0x21a868[_0x856c('0x35')][_0x856c('0x38')]?_0x21a868[_0x856c('0x35')]:_0x25cbab[_0x856c('0x34')];if(!_0x3eaced[_0x856c('0x32')][_0x856c('0x39')](_0x856c('0x3a'))){_0x21a868[_0x856c('0x22')]=qs[_0x856c('0x22')](_0x3eaced['query']['limit']);_0x21a868[_0x856c('0x20')]=qs['offset'](_0x3eaced[_0x856c('0x32')][_0x856c('0x20')]);}_0x21a868[_0x856c('0x3b')]=qs[_0x856c('0x3c')](_0x3eaced[_0x856c('0x32')]['sort']);_0x21a868[_0x856c('0x3d')]=qs[_0x856c('0x33')](_[_0x856c('0x3e')](_0x3eaced[_0x856c('0x32')],_0x25cbab[_0x856c('0x33')]),_0x2e1e91);if(_0x3eaced['query'][_0x856c('0x3f')]){_0x21a868[_0x856c('0x3d')]=_[_0x856c('0x40')](_0x21a868[_0x856c('0x3d')],{'$or':_[_0x856c('0x31')](_0x2e1e91,function(_0x54460e){if(_0x54460e['type']!==_0x856c('0x41')){var _0x1a235f={};_0x1a235f[_0x54460e[_0x856c('0x2b')]]={'$like':'%'+_0x3eaced['query'][_0x856c('0x3f')]+'%'};return _0x1a235f;}})});}_0x21a868=_[_0x856c('0x40')]({},_0x21a868,_0x3eaced['options']);var _0x5be7c2={'where':_0x21a868[_0x856c('0x3d')]};return db[_0x856c('0x2c')][_0x856c('0x23')](_0x5be7c2)[_0x856c('0x42')](function(_0x1fe404){_0x39ab90[_0x856c('0x23')]=_0x1fe404;if(_0x3eaced[_0x856c('0x32')]['includeAll']){_0x21a868['include']=[{'all':!![]}];}return db[_0x856c('0x2c')]['findAll'](_0x21a868);})[_0x856c('0x42')](function(_0x29234d){_0x39ab90[_0x856c('0x43')]=_0x29234d;return _0x39ab90;})[_0x856c('0x42')](respondWithFilteredResult(_0x2a809d,_0x21a868))['catch'](handleError(_0x2a809d,null));};exports[_0x856c('0x44')]=function(_0x3af263,_0x4424c4){var _0x35380e={'raw':![],'where':{'id':_0x3af263[_0x856c('0x45')]['id']}},_0xef88f2={};_0xef88f2[_0x856c('0x34')]=_[_0x856c('0x46')](db['UserProfile'][_0x856c('0x2d')]);_0xef88f2[_0x856c('0x32')]=_[_0x856c('0x46')](_0x3af263['query']);_0xef88f2[_0x856c('0x33')]=_[_0x856c('0x36')](_0xef88f2[_0x856c('0x34')],_0xef88f2['query']);_0x35380e[_0x856c('0x35')]=_[_0x856c('0x36')](_0xef88f2['model'],qs[_0x856c('0x37')](_0x3af263[_0x856c('0x32')][_0x856c('0x37')]));_0x35380e[_0x856c('0x35')]=_0x35380e[_0x856c('0x35')][_0x856c('0x38')]?_0x35380e[_0x856c('0x35')]:_0xef88f2[_0x856c('0x34')];if(_0x3af263[_0x856c('0x32')][_0x856c('0x47')]){_0x35380e[_0x856c('0x48')]=[{'all':!![]}];}_0x35380e=_[_0x856c('0x40')]({},_0x35380e,_0x3af263[_0x856c('0x49')]);return db['UserProfile'][_0x856c('0x4a')](_0x35380e)[_0x856c('0x42')](handleEntityNotFound(_0x4424c4,null))[_0x856c('0x42')](respondWithResult(_0x4424c4,null))[_0x856c('0x4b')](handleError(_0x4424c4,null));};exports[_0x856c('0x4c')]=function(_0x24d009,_0x4d51de){return db[_0x856c('0x2c')][_0x856c('0x4c')](_0x24d009[_0x856c('0x4d')],{})[_0x856c('0x42')](respondWithResult(_0x4d51de,0xc9))['catch'](handleError(_0x4d51de,null));};exports[_0x856c('0x4e')]=function(_0x564e1f,_0x3bb58e){var _0x17de4f={'where':{'id':_0x564e1f['params']['id']}},_0x49d19b={};_0x49d19b[_0x856c('0x34')]=_['keys'](db['UserProfile'][_0x856c('0x2d')]);_0x17de4f[_0x856c('0x35')]=_[_0x856c('0x36')](_0x49d19b[_0x856c('0x34')],qs[_0x856c('0x37')](_0x564e1f[_0x856c('0x32')][_0x856c('0x37')]));_0x17de4f[_0x856c('0x35')]=_0x17de4f[_0x856c('0x35')][_0x856c('0x38')]?_0x17de4f['attributes']:_0x49d19b[_0x856c('0x34')];if(_0x564e1f[_0x856c('0x32')]['includeAll']){_0x17de4f[_0x856c('0x48')]=[{'all':!![]}];}_0x17de4f=_['merge']({},_0x17de4f,_0x564e1f[_0x856c('0x49')]);return db['UserProfile'][_0x856c('0x4a')](_0x17de4f)[_0x856c('0x42')](handleEntityNotFound(_0x3bb58e,null))[_0x856c('0x42')](function(_0x36d7f8){if(_0x36d7f8){var _0xb4e351=_0x36d7f8[_0x856c('0x4f')]({'plain':!![]});_0xb4e351=qs['omit'](_0xb4e351,['id',_0x856c('0x50'),_0x856c('0x51'),_0x856c('0x52')]);_0x564e1f[_0x856c('0x4d')]=_[_0x856c('0x53')](_0x564e1f[_0x856c('0x4d')],['id',_0x856c('0x50'),_0x856c('0x51')]);return db[_0x856c('0x54')][_0x856c('0x55')](function(_0x1ee27b){return db[_0x856c('0x2c')][_0x856c('0x4c')](_['merge'](_0xb4e351,_0x564e1f[_0x856c('0x4d')]),{'include':_0x564e1f['query'][_0x856c('0x47')]?[{'all':!![]}]:undefined,'transaction':_0x1ee27b})[_0x856c('0x42')](function(_0x18eff2){var _0x5c3df1=_0x18eff2[_0x856c('0x4f')]({'plain':!![]});return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x564e1f['params']['id']},'raw':!![]})[_0x856c('0x42')](function(_0x1dfa54){if(_0x1dfa54){return BPromise['each'](_0x1dfa54,function(_0xcbec5b){return new BPromise(function(_0x19d463,_0x23cce7){if(_0xcbec5b[_0x856c('0x56')]===null||_0xcbec5b[_0x856c('0x56')]===0x1)_0x19d463(null);return db[_0x856c('0x57')]['findAll']({'where':{'sectionId':_0xcbec5b['id']},'raw':!![]})[_0x856c('0x42')](function(_0x37df56){var _0x19bf62=_[_0x856c('0x31')](_0x37df56,function(_0x95ea96){return qs[_0x856c('0x53')](_0x95ea96,['id',_0x856c('0x50'),'updatedAt',_0x856c('0x58')]);});_0x19d463(_0x19bf62);})['catch'](function(_0x3f1d1c){_0x23cce7(_0x3f1d1c);});})['then'](function(_0x22c8f0){var _0x3f6bfb=qs['omit'](_0xcbec5b,['id',_0x856c('0x50'),_0x856c('0x51')]);_0x3f6bfb[_0x856c('0x59')]=_0x5c3df1['id'];if(_0x22c8f0)_0x3f6bfb[_0x856c('0x5a')]=_0x22c8f0;return _0x3f6bfb;})[_0x856c('0x42')](function(_0x177f59){return db[_0x856c('0x5b')][_0x856c('0x4c')](_0x177f59,{'include':[{'model':db['UserProfileResource'],'as':_0x856c('0x5a')}],'raw':!![],'transaction':_0x1ee27b});});})[_0x856c('0x42')](function(){return _0x5c3df1;});}});});});}})[_0x856c('0x42')](respondWithResult(_0x3bb58e,0xc9))[_0x856c('0x4b')](handleError(_0x3bb58e,null));};exports['update']=function(_0x2b73ac,_0x58c600){if(_0x2b73ac[_0x856c('0x4d')]['id']){delete _0x2b73ac[_0x856c('0x4d')]['id'];}return db[_0x856c('0x2c')]['find']({'where':{'id':_0x2b73ac[_0x856c('0x45')]['id']}})[_0x856c('0x42')](handleEntityNotFound(_0x58c600,null))[_0x856c('0x42')](saveUpdates(_0x2b73ac[_0x856c('0x4d')],null))[_0x856c('0x42')](respondWithResult(_0x58c600,null))[_0x856c('0x4b')](handleError(_0x58c600,null));};exports[_0x856c('0x29')]=function(_0x297922,_0x18f234){return db[_0x856c('0x2c')][_0x856c('0x4a')]({'where':{'id':_0x297922[_0x856c('0x45')]['id']}})['then'](handleEntityNotFound(_0x18f234,null))[_0x856c('0x42')](removeEntity(_0x18f234,null))[_0x856c('0x4b')](handleError(_0x18f234,null));};exports[_0x856c('0x5c')]=function(_0x219a6a,_0x24a9bc){return db[_0x856c('0x2c')]['describe']()[_0x856c('0x42')](respondWithResult(_0x24a9bc,null))[_0x856c('0x4b')](handleError(_0x24a9bc,null));};exports[_0x856c('0x5d')]=function(_0x3bf8f9,_0x40eacb){var _0x1b5231=_0x3bf8f9[_0x856c('0x4d')];return db['UserProfile']['find']({'where':{'id':_0x3bf8f9[_0x856c('0x45')]['id']}})[_0x856c('0x42')](handleEntityNotFound(_0x40eacb,null))[_0x856c('0x42')](function(_0x4afc3f){if(_0x4afc3f){return db[_0x856c('0x54')][_0x856c('0x55')](function(_0x4c4ca8){return db['UserProfileSection'][_0x856c('0x29')]({'where':{'userProfileId':_0x3bf8f9[_0x856c('0x45')]['id'],'sectionId':_['map'](_0x1b5231,function(_0x1cee76){return _0x1cee76[_0x856c('0x58')];})},'transaction':_0x4c4ca8})[_0x856c('0x42')](function(){var _0x3855a6=_[_0x856c('0x31')](_0x1b5231,function(_0x22281d){_0x22281d[_0x856c('0x59')]=_0x3bf8f9[_0x856c('0x45')]['id'];return _0x22281d;});var _0x2e8111=[];return BPromise['each'](_0x3855a6,function(_0x36977e){return db['UserProfileSection'][_0x856c('0x4c')](_0x36977e,{'include':[{'model':db[_0x856c('0x57')],'as':_0x856c('0x5a')}],'raw':!![],'transaction':_0x4c4ca8})[_0x856c('0x42')](function(_0x1f4ff8){_0x2e8111['push'](_0x1f4ff8[_0x856c('0x4f')]({'plain':!![]}));});})['then'](function(){return _0x2e8111;});});});}})['then'](function(_0xebe7c){return _0xebe7c;})[_0x856c('0x42')](respondWithResult(_0x40eacb,null))['catch'](handleError(_0x40eacb,null));};exports[_0x856c('0x5e')]=function(_0xfbdbf8,_0x5bda9a){var _0x435225;return db[_0x856c('0x2c')][_0x856c('0x4a')]({'where':{'id':_0xfbdbf8[_0x856c('0x45')]['id']},'attributes':['id',_0x856c('0x2b')]})['then'](handleEntityNotFound(_0x5bda9a,null))['then'](function(_0x94105c){if(_0x94105c){_0x435225=_0x94105c;return db['UserProfileSection'][_0x856c('0x29')]({'where':{'userProfileId':_0xfbdbf8[_0x856c('0x45')]['id'],'sectionId':_0xfbdbf8[_0x856c('0x32')]['ids']}});}})[_0x856c('0x42')](function(){return _0x435225;})[_0x856c('0x42')](respondWithStatusCode(_0x5bda9a,null))[_0x856c('0x4b')](handleError(_0x5bda9a,null));};exports[_0x856c('0x5f')]=function(_0x5aa6a,_0x71a19c){var _0x10e328=[];var _0x557016=[];return db[_0x856c('0x5b')][_0x856c('0x60')]({'where':{'userProfileId':_0x5aa6a[_0x856c('0x45')]['id']},'raw':!![]})[_0x856c('0x42')](function(_0x46d04f){_0x10e328=_['filter'](_0x46d04f,function(_0x2153f7){return _0x2153f7[_0x856c('0x61')]===0x1||_[_0x856c('0x62')]([0x3eb,0x709],_0x2153f7[_0x856c('0x58')]);});if(!_[_0x856c('0x63')](_0x10e328)){return _['map'](_0x10e328,function(_0x3f33dd){return _0x3f33dd[_0x856c('0x58')];});}else{return;}})[_0x856c('0x42')](function(_0x42207a){if(_0x42207a)_0x557016=_0x42207a;if(_[_0x856c('0x62')](_0x557016,0x64)){var _0x2d6255=_[_0x856c('0x4a')](_0x10e328,{'sectionId':0x64});return hasDefaultDashboard(_0x2d6255)[_0x856c('0x42')](function(_0x358417){return _['map'](_0x10e328,function(_0x199cca){if(_0x199cca[_0x856c('0x58')]===0x64){_0x199cca['subsections']=_0x358417;}return _0x199cca;});});}else{return;}})[_0x856c('0x42')](function(_0x2c771b){if(_0x2c771b)_0x10e328=_0x2c771b;if(_[_0x856c('0x62')](_0x557016,0x3eb)){var _0x577ebc=_['find'](_0x10e328,{'sectionId':0x3eb});return getCustomDashboards(_0x577ebc)['then'](function(_0x355fe2){return _[_0x856c('0x31')](_0x10e328,function(_0x1d0300){if(_0x577ebc[_0x856c('0x61')]){if(_0x1d0300[_0x856c('0x58')]===0x3eb){_0x1d0300[_0x856c('0x64')]=_0x355fe2;}}else{if(_0x1d0300['sectionId']===0x64){_0x1d0300[_0x856c('0x64')]=_0x355fe2;}}return _0x1d0300;});});}else{return;}})[_0x856c('0x42')](function(_0xa2e94e){if(_0xa2e94e)_0x10e328=_0xa2e94e;if(_[_0x856c('0x62')](_0x557016,0x709)){var _0x347912=_[_0x856c('0x4a')](_0x10e328,{'sectionId':0x709});return getPlugins(_0x347912)[_0x856c('0x42')](function(_0x1cd814){if(_0x347912[_0x856c('0x61')]){return _[_0x856c('0x31')](_0x10e328,function(_0xa62279){if(_0xa62279[_0x856c('0x58')]===0x709){_0xa62279[_0x856c('0x64')]=_0x1cd814;}return _0xa62279;});}else{var _0x146980={'sectionId':0x76c,'enabled':0x1,'subsections':_0x1cd814};var _0x492fe6=_['map'](_0x10e328);_0x492fe6[_0x856c('0x65')](_0x146980);return _0x492fe6;}});}else{return;}})['then'](function(_0x5e6a76){if(_0x5e6a76)_0x10e328=_0x5e6a76;return _[_0x856c('0x3f')](_0x10e328,[_0x856c('0x61'),0x1]);})[_0x856c('0x42')](respondWithResult(_0x71a19c,null))[_0x856c('0x4b')](handleError(_0x71a19c,null));};function hasDefaultDashboard(_0x32c141){var _0x1224f8=[0x65];return new BPromise(function(_0x7d894a,_0x143694){try{if(_0x32c141[_0x856c('0x56')]){_0x7d894a(_0x1224f8);}else{return db[_0x856c('0x57')]['findOne']({'where':{'sectionId':_0x32c141['id']},'raw':!![]})[_0x856c('0x42')](function(_0xaf6060){_0xaf6060?_0x7d894a(_0x1224f8):_0x7d894a();});}}catch(_0x1502c5){_0x143694(_0x1502c5);}});}function getCustomDashboards(_0x118dfc){var _0x255cdc=[];return new BPromise(function(_0x2a8ff6,_0x4e0086){try{if(_0x118dfc[_0x856c('0x56')]){return db[_0x856c('0x66')][_0x856c('0x60')]({'raw':!![]})['then'](function(_0x182e90){_0x182e90['forEach'](function(_0x961d39){_0x255cdc[_0x856c('0x65')](_0x961d39['id']+0x1869f);});_0x2a8ff6(_0x255cdc);});}else{return db[_0x856c('0x57')]['findAll']({'where':{'sectionId':_0x118dfc['id']},'raw':!![]})[_0x856c('0x42')](function(_0x21795b){_0x21795b[_0x856c('0x67')](function(_0x114cae){_0x255cdc[_0x856c('0x65')](_0x114cae['resourceId']+0x1869f);});_0x2a8ff6(_0x255cdc);});}}catch(_0x2dc947){_0x4e0086(_0x2dc947);}});}function getPlugins(_0x44510b){var _0x3eb0c7=[];return new BPromise(function(_0x5e6220,_0x48dfaa){try{if(_0x44510b[_0x856c('0x56')]){return db[_0x856c('0x68')]['findAll']({'raw':!![]})[_0x856c('0x42')](function(_0x5e786e){_0x5e786e[_0x856c('0x67')](function(_0x17019d){_0x3eb0c7['push'](_0x17019d['id']+0x15b38);});_0x5e6220(_0x3eb0c7);});}else{return db['UserProfileResource'][_0x856c('0x60')]({'where':{'sectionId':_0x44510b['id']},'raw':!![]})[_0x856c('0x42')](function(_0x3b5241){_0x3b5241[_0x856c('0x67')](function(_0x6d4bba){_0x3eb0c7[_0x856c('0x65')](_0x6d4bba[_0x856c('0x69')]+0x15b38);});_0x5e6220(_0x3eb0c7);});}}catch(_0x576945){_0x48dfaa(_0x576945);}});}exports[_0x856c('0x6a')]=function(_0xc204d4,_0x448141){return db[_0x856c('0x2c')][_0x856c('0x4a')]({'where':{'id':_0xc204d4[_0x856c('0x45')]['id']}})[_0x856c('0x42')](handleEntityNotFound(_0x448141,null))[_0x856c('0x42')](function(_0x42ded0){if(_0x42ded0){return db[_0x856c('0x54')][_0x856c('0x55')](function(_0x29b0be){return db[_0x856c('0x5b')]['findAll']({'where':{'userProfileId':_0xc204d4[_0x856c('0x45')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x288c25){if(_0x288c25){return db[_0x856c('0x5b')][_0x856c('0x29')]({'where':{'userProfileId':_0xc204d4[_0x856c('0x45')]['id'],'id':_['map'](_0x288c25,function(_0x4e1c89){return _0x4e1c89['id'];})},'transaction':_0x29b0be});}})[_0x856c('0x42')](function(_0x30b082){var _0x5ff3d5=_[_0x856c('0x31')](_0xc204d4[_0x856c('0x4d')],function(_0x57d09d){_0x57d09d[_0x856c('0x59')]=_0xc204d4[_0x856c('0x45')]['id'];return _0x57d09d;});return db[_0x856c('0x5b')][_0x856c('0x6b')](_0x5ff3d5,{'raw':!![],'transaction':_0x29b0be});})[_0x856c('0x42')](function(_0x4dfb62){var _0x2903fd=_[_0x856c('0x3f')](_['map'](_0x4dfb62,function(_0x3b9d03){return _0x3b9d03['get']({'plain':!![]});}),{'includeAll':![]});if(_0x2903fd){return db[_0x856c('0x5b')][_0x856c('0x60')]({'where':{'userProfileId':_0xc204d4[_0x856c('0x45')]['id'],'sectionId':_['map'](_0x2903fd,function(_0xae1965){return _0xae1965[_0x856c('0x58')];})},'attributes':['id',_0x856c('0x58')],'raw':!![]})[_0x856c('0x42')](function(_0x155336){var _0x15a79d=_[_0x856c('0x31')](_0xc204d4[_0x856c('0x4d')],function(_0x36d40e){_0x36d40e[_0x856c('0x59')]=_0xc204d4['params']['id'];return _0x36d40e;});return db[_0x856c('0x57')]['bulkCreate'](_0x15a79d,{'raw':!![],'transaction':_0x29b0be});});}})[_0x856c('0x4b')](handleError(_0x448141,null));});}})[_0x856c('0x42')](function(_0x446abc){var _0x28800c=_[_0x856c('0x31')](_0x446abc,function(_0x3486a4){return _0x3486a4[_0x856c('0x4f')]({'plain':!![]});});})[_0x856c('0x42')](respondWithResult(_0x448141,null))[_0x856c('0x4b')](handleError(_0x448141,null));};exports[_0x856c('0x6c')]=function(_0x20677a,_0x3bc1fb,_0x4aad5e){return db['UserProfile'][_0x856c('0x4a')]({'where':{'id':_0x20677a[_0x856c('0x45')]['id']}})[_0x856c('0x42')](handleEntityNotFound(_0x3bc1fb,null))['then'](function(_0x2669ac){if(_0x2669ac){return _0x2669ac[_0x856c('0x6c')](_0x20677a[_0x856c('0x32')][_0x856c('0x6d')]);}})[_0x856c('0x42')](respondWithStatusCode(_0x3bc1fb,null))[_0x856c('0x4b')](handleError(_0x3bc1fb,null));};exports[_0x856c('0x6e')]=function(_0x336d32,_0x389cac){var _0x42b153={};if(!_0x336d32['query'][_0x856c('0x6f')])throw new Error(_0x856c('0x70'));if(!_0x336d32[_0x856c('0x32')][_0x856c('0x39')](_0x856c('0x3a'))){_0x42b153[_0x856c('0x22')]=qs[_0x856c('0x22')](_0x336d32['query'][_0x856c('0x22')]);_0x42b153[_0x856c('0x20')]=qs['offset'](_0x336d32[_0x856c('0x32')][_0x856c('0x20')]);}return db['UserProfile'][_0x856c('0x4a')]({'where':{'id':_0x336d32[_0x856c('0x45')]['id']}})[_0x856c('0x42')](function(_0x5cec12){if(!_0x5cec12)throw new Error(_0x856c('0x71')+_0x336d32[_0x856c('0x45')]['id']);return db[_0x856c('0x2c')]['getResources'](_0x336d32);})[_0x856c('0x42')](respondWithFilteredResult(_0x389cac,_0x42b153))['catch'](handleError(_0x389cac,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index cfdafe5..4b379bb 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 _0x0ef4=['hasOwnProperty','hook','exports','../../mysqldb','UserProfile','setMaxListeners','remove'];(function(_0x154192,_0x2d360f){var _0x3c2792=function(_0x2e257b){while(--_0x2e257b){_0x154192['push'](_0x154192['shift']());}};_0x3c2792(++_0x2d360f);}(_0x0ef4,0xc7));var _0x40ef=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0x0ef4[_0x4b73a2];return _0x383c66;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0x40ef('0x0'))['db'][_0x40ef('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x40ef('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x40ef('0x3')};function emitEvent(_0xf78dc1){return function(_0x85ee1d,_0x4a5798,_0x16fef9){UserProfileEvents['emit'](_0xf78dc1+':'+_0x85ee1d['id'],_0x85ee1d);UserProfileEvents['emit'](_0xf78dc1,_0x85ee1d);_0x16fef9(null);};}for(var e in events){if(events[_0x40ef('0x4')](e)){var event=events[e];UserProfile[_0x40ef('0x5')](e,emitEvent(event));}}module[_0x40ef('0x6')]=UserProfileEvents; \ No newline at end of file +var _0x9e69=['hasOwnProperty','hook','exports','../../mysqldb','UserProfile','setMaxListeners','save','remove','emit'];(function(_0x24e0c9,_0x284109){var _0x4448f0=function(_0x576980){while(--_0x576980){_0x24e0c9['push'](_0x24e0c9['shift']());}};_0x4448f0(++_0x284109);}(_0x9e69,0x150));var _0x99e6=function(_0x482f8a,_0x5d62b0){_0x482f8a=_0x482f8a-0x0;var _0x2aca1e=_0x9e69[_0x482f8a];return _0x2aca1e;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0x99e6('0x0'))['db'][_0x99e6('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x99e6('0x2')](0x0);var events={'afterCreate':_0x99e6('0x3'),'afterUpdate':'update','afterDestroy':_0x99e6('0x4')};function emitEvent(_0x3b02ff){return function(_0x5f3985,_0x8a6c5c,_0x1a7b0a){UserProfileEvents[_0x99e6('0x5')](_0x3b02ff+':'+_0x5f3985['id'],_0x5f3985);UserProfileEvents['emit'](_0x3b02ff,_0x5f3985);_0x1a7b0a(null);};}for(var e in events){if(events[_0x99e6('0x6')](e)){var event=events[e];UserProfile[_0x99e6('0x7')](e,emitEvent(event));}}module[_0x99e6('0x8')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 456e4e2..e32104a 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 _0xe1a5=['UserProfileSection','params','all','ignore','find','autoAssociation','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','pick','merge','VIRTUAL','foreignKey','forEach','includeAll','include','reportType','default','custom','reportId','CustomReports','count','Tags','color','tag','ThroughTags','rows','openTabs','chat','sms','fax','dataValues','mail','openchannel','whatsapp','../../components/parsers/qs','squel','models','filter','field','value','findAll','then','associatedResources','catch','model','name','resolve','map','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','CmContact','Lists','ListId','lists','CmList','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','faxqueues','FaxQueue','faxaccounts','FaxAccount','internalroutes','outboundroutes','VoiceExtension','VoiceContext','voicemails','Agents','User','role','agent','Telephones','membername','telephone','queue','VoiceQueue','inbound','outbound','VoiceMusicOnHold','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','MailAccount','mailsubstatuses','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','teams','Team','voicequeues','VoiceQueues','QueueCampaigns','agents','telephones','Users','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','pauses','Schedule','sounds','Sound','tags','Tag','templates','triggers','Trigger','trunks','Trunk','Variable','plugins','Plugin','extractedreports','Reports','metrics','AnalyticMetric','charAt','slice','Sequelize','QueryTypes','select','ui.','InteractionId','ui.createdAt','from','_interactions','where','ui.UserId\x20=\x20?','sequelize','OpenTabs','define','UserProfile','query','raw','section','mergeResources','isEmpty','length','push'];(function(_0x46ad74,_0x15f814){var _0x4b6a72=function(_0x4dce85){while(--_0x4dce85){_0x46ad74['push'](_0x46ad74['shift']());}};_0x4b6a72(++_0x15f814);}(_0xe1a5,0x1ae));var _0x5e1a=function(_0x16e0f7,_0x41057f){_0x16e0f7=_0x16e0f7-0x0;var _0xb3faa3=_0xe1a5[_0x16e0f7];return _0xb3faa3;};'use strict';var _=require('lodash');var attributes=require('./userProfile.attributes');var qs=require(_0x5e1a('0x0'));var squel=require(_0x5e1a('0x1'));module['exports']=function(_0x45da8e){var _0x12f0c2=_0x45da8e[_0x5e1a('0x2')];function _0x4f2431(_0x35e80a,_0x4510c7){return new Promise(function(_0x16f351,_0x418836){if(!_0x4510c7)return _0x16f351(null);var _0x4be9b6=_0x4510c7[_0x5e1a('0x3')]?{[_0x4510c7[_0x5e1a('0x3')][_0x5e1a('0x4')]]:_0x4510c7[_0x5e1a('0x3')][_0x5e1a('0x5')]}:undefined;return _0x12f0c2[_0x35e80a][_0x5e1a('0x6')]({'where':_0x4be9b6,'raw':!![]})[_0x5e1a('0x7')](function(_0x57c2fd){_0x4510c7[_0x5e1a('0x8')]=_['map'](_0x57c2fd,'id');_0x16f351(_0x4510c7);})[_0x5e1a('0x9')](function(_0x3ad156){_0x418836(_0x3ad156);});});}function _0x5da243(_0x269891,_0x5055cc){return new Promise(function(_0x1863ca,_0x3634f7){var _0x278ea3=_0x269891[_0x5e1a('0x3')]?{[_0x269891[_0x5e1a('0x3')][_0x5e1a('0x4')]]:_0x269891[_0x5e1a('0x3')]['value']}:undefined;return _0x12f0c2[_0x269891[_0x5e1a('0xa')]][_0x5e1a('0x6')]({'where':_0x278ea3,'raw':!![]})[_0x5e1a('0x7')](function(_0x4001e6){_0x5055cc['associatedResources']=_['map'](_0x4001e6,function(_0x5766dd){return _0x5766dd[_0x5e1a('0xb')];});_0x1863ca(_0x5055cc);})[_0x5e1a('0x9')](function(_0x248f4d){_0x3634f7(_0x248f4d);});});}function _0x846d0d(_0x49e0a4,_0x27e736,_0x55c4eb){if(!_0x27e736)return Promise[_0x5e1a('0xc')](null);return new Promise(function(_0x39d17,_0xae94af){return _0x12f0c2['UserProfileResource'][_0x5e1a('0x6')]({'where':{'sectionId':_0x27e736['id']},'raw':!![]})[_0x5e1a('0x7')](function(_0x50cb95){if(_0x49e0a4[_0x5e1a('0x4')]&&_0x49e0a4[_0x5e1a('0x4')]!=='id'){_0x27e736[_0x5e1a('0x8')]=_[_0x5e1a('0xd')](_0x50cb95,function(_0x408861){return _0x408861[_0x49e0a4[_0x5e1a('0x4')]];});}else{if(_0x55c4eb===_0x5e1a('0xe')){_0x27e736[_0x5e1a('0x8')]=_[_0x5e1a('0xd')](_0x50cb95,function(_0x382e29){return{'id':_0x382e29[_0x5e1a('0xf')],'type':_0x382e29[_0x5e1a('0x10')]};});}else{_0x27e736[_0x5e1a('0x8')]=_[_0x5e1a('0xd')](_0x50cb95,function(_0x451688){return _0x451688[_0x5e1a('0xf')];});}}_0x39d17(_0x27e736);})[_0x5e1a('0x9')](function(_0x55e55f){_0xae94af(_0x55e55f);});});}function _0x95ca3b(_0x3db905,_0x280066){var _0x39c9f2={'parentSections':[]};switch(_0x3db905[_0x5e1a('0x11')]()){case _0x5e1a('0x12'):_0x39c9f2[_0x5e1a('0x13')]=_0x5e1a('0x14');break;case _0x5e1a('0x15'):_0x39c9f2[_0x5e1a('0x13')]=_0x5e1a('0x16');break;case _0x5e1a('0x17'):_0x39c9f2['childModel']='SquareRecording';_0x39c9f2[_0x5e1a('0x18')]=[{'name':_0x5e1a('0x19'),'field':'name','foreignKey':_0x5e1a('0x1a')}];break;case _0x5e1a('0x1b'):_0x39c9f2['childModel']=_0x5e1a('0x1c');break;case _0x5e1a('0x1d'):_0x39c9f2[_0x5e1a('0x13')]=_0x5e1a('0x1e');_0x39c9f2[_0x5e1a('0x18')]=[{'name':_0x5e1a('0x1f'),'field':'id','foreignKey':_0x5e1a('0x20')}];break;case _0x5e1a('0x21'):_0x39c9f2[_0x5e1a('0x13')]=_0x5e1a('0x22');break;case'companies':_0x39c9f2[_0x5e1a('0x13')]=_0x5e1a('0x23');break;case _0x5e1a('0x24'):_0x39c9f2[_0x5e1a('0x13')]=_0x5e1a('0x25');break;case _0x5e1a('0x26'):_0x39c9f2['childModel']=_0x5e1a('0x27');break;case _0x5e1a('0x28'):_0x39c9f2[_0x5e1a('0x13')]='ChatWebsite';break;case _0x5e1a('0x29'):_0x39c9f2['childModel']=_0x5e1a('0x2a');break;case _0x5e1a('0x2b'):_0x39c9f2[_0x5e1a('0x13')]=_0x5e1a('0x2c');break;case'inboundroutes':case _0x5e1a('0x2d'):case _0x5e1a('0x2e'):_0x39c9f2[_0x5e1a('0x13')]=_0x5e1a('0x2f');break;case'contexts':_0x39c9f2['childModel']=_0x5e1a('0x30');break;case _0x5e1a('0x31'):_0x39c9f2[_0x5e1a('0x13')]='VoiceMail';break;case'voicerecordings':_0x39c9f2[_0x5e1a('0x13')]='VoiceRecording';_0x39c9f2['parentSections']=[{'name':_0x5e1a('0x32'),'field':_0x5e1a('0xb'),'foreignKey':'membername','model':_0x5e1a('0x33'),'filter':{'field':_0x5e1a('0x34'),'value':[_0x5e1a('0x35')]}},{'name':_0x5e1a('0x36'),'field':'name','foreignKey':_0x5e1a('0x37'),'model':_0x5e1a('0x33'),'filter':{'field':_0x5e1a('0x34'),'value':[_0x5e1a('0x38')]}},{'name':'VoiceQueues','field':_0x5e1a('0xb'),'foreignKey':_0x5e1a('0x39'),'model':_0x5e1a('0x3a'),'filter':{'field':_0x5e1a('0x10'),'value':[_0x5e1a('0x3b')]}},{'name':'QueueCampaigns','field':'name','foreignKey':_0x5e1a('0x39'),'model':_0x5e1a('0x3a'),'filter':{'field':_0x5e1a('0x10'),'value':[_0x5e1a('0x3c')]}}];break;case'musiconholds':_0x39c9f2[_0x5e1a('0x13')]=_0x5e1a('0x3d');break;case'chanspies':_0x39c9f2[_0x5e1a('0x13')]=_0x5e1a('0x3e');break;case _0x5e1a('0x3f'):_0x39c9f2[_0x5e1a('0x13')]=_0x5e1a('0x40');break;case _0x5e1a('0x41'):_0x39c9f2[_0x5e1a('0x13')]=_0x5e1a('0x42');break;case _0x5e1a('0x43'):_0x39c9f2[_0x5e1a('0x13')]=_0x5e1a('0x44');break;case'mailaccounts':_0x39c9f2['childModel']=_0x5e1a('0x45');break;case _0x5e1a('0x46'):_0x39c9f2[_0x5e1a('0x13')]='MailSubstatus';break;case _0x5e1a('0x47'):_0x39c9f2[_0x5e1a('0x13')]=_0x5e1a('0x48');break;case _0x5e1a('0x49'):_0x39c9f2[_0x5e1a('0x13')]=_0x5e1a('0x4a');break;case'smsqueues':_0x39c9f2[_0x5e1a('0x13')]=_0x5e1a('0x4b');break;case _0x5e1a('0x4c'):_0x39c9f2[_0x5e1a('0x13')]=_0x5e1a('0x4d');break;case _0x5e1a('0x4e'):_0x39c9f2[_0x5e1a('0x13')]=_0x5e1a('0x4f');break;case'whatsappaccounts':_0x39c9f2[_0x5e1a('0x13')]='WhatsappAccount';break;case _0x5e1a('0x50'):_0x39c9f2['childModel']=_0x5e1a('0x51');break;case _0x5e1a('0x52'):case'queuecampaigns':_0x39c9f2['childModel']=_0x5e1a('0x3a');if(_0x280066){_0x39c9f2[_0x5e1a('0x18')]=[{'name':_0x5e1a('0x53')},{'name':_0x5e1a('0x54')}];}break;case'users':case _0x5e1a('0x55'):case _0x5e1a('0x56'):_0x39c9f2[_0x5e1a('0x13')]='User';if(_0x280066){_0x39c9f2[_0x5e1a('0x18')]=[{'name':_0x5e1a('0x57'),'filter':{'field':'role','value':[_0x5e1a('0x58'),_0x5e1a('0x59')]},'ignore':!![]},{'name':'Agents'},{'name':_0x5e1a('0x36')}];}break;case _0x5e1a('0x5a'):_0x39c9f2['childModel']=_0x5e1a('0x5b');break;case _0x5e1a('0x5c'):_0x39c9f2[_0x5e1a('0x13')]=_0x5e1a('0x5d');break;case _0x5e1a('0x5e'):_0x39c9f2[_0x5e1a('0x13')]='FreshdeskAccount';break;case _0x5e1a('0x5f'):_0x39c9f2[_0x5e1a('0x13')]=_0x5e1a('0x60');break;case _0x5e1a('0x61'):_0x39c9f2[_0x5e1a('0x13')]=_0x5e1a('0x62');break;case _0x5e1a('0x63'):_0x39c9f2[_0x5e1a('0x13')]=_0x5e1a('0x64');break;case _0x5e1a('0x65'):_0x39c9f2['childModel']=_0x5e1a('0x33');break;case'cannedanswers':_0x39c9f2['childModel']=_0x5e1a('0x66');break;case _0x5e1a('0x67'):_0x39c9f2['childModel']=_0x5e1a('0x68');break;case _0x5e1a('0x69'):_0x39c9f2[_0x5e1a('0x13')]=_0x5e1a('0x6a');break;case _0x5e1a('0x6b'):_0x39c9f2['childModel']='Interval';break;case _0x5e1a('0x6c'):_0x39c9f2[_0x5e1a('0x13')]='Pause';break;case'scheduler':_0x39c9f2[_0x5e1a('0x13')]=_0x5e1a('0x6d');break;case _0x5e1a('0x6e'):_0x39c9f2[_0x5e1a('0x13')]=_0x5e1a('0x6f');break;case _0x5e1a('0x70'):_0x39c9f2[_0x5e1a('0x13')]=_0x5e1a('0x71');break;case _0x5e1a('0x72'):_0x39c9f2[_0x5e1a('0x13')]='Template';break;case _0x5e1a('0x73'):_0x39c9f2[_0x5e1a('0x13')]=_0x5e1a('0x74');break;case _0x5e1a('0x75'):_0x39c9f2['childModel']=_0x5e1a('0x76');break;case'variables':_0x39c9f2[_0x5e1a('0x13')]=_0x5e1a('0x77');break;case _0x5e1a('0x78'):_0x39c9f2['childModel']=_0x5e1a('0x79');break;case _0x5e1a('0x7a'):_0x39c9f2[_0x5e1a('0x13')]=_0x5e1a('0xe');_0x39c9f2[_0x5e1a('0x18')]=[{'name':_0x5e1a('0x7b'),'field':'id','foreignKey':'reportId'}];break;case _0x5e1a('0x7c'):_0x39c9f2[_0x5e1a('0x13')]=_0x5e1a('0x7d');break;}return _0x39c9f2;}function _0x1a79b9(_0x2d022b,_0x2f8de1){var _0x52f986=_0x2d022b[_0x5e1a('0x7e')](0x0)['toUpperCase']()+_0x2d022b[_0x5e1a('0x7f')](0x1);var _0x3fd41c={'type':_0x12f0c2[_0x5e1a('0x80')][_0x5e1a('0x81')]['SELECT'],'raw':!![]};return new Promise(function(_0x2a1949,_0x236d4f){var _0x1b7427=squel[_0x5e1a('0x82')]()[_0x5e1a('0x4')](_0x5e1a('0x83')+_0x52f986+_0x5e1a('0x84'),'id')[_0x5e1a('0x4')](_0x5e1a('0x85'))[_0x5e1a('0x86')]('user_has_'+_0x2d022b+_0x5e1a('0x87'),'ui')[_0x5e1a('0x88')](_0x5e1a('0x89'),_0x2f8de1['id']);return _0x12f0c2[_0x5e1a('0x8a')]['query'](_0x1b7427['toString'](),_0x3fd41c)[_0x5e1a('0x7')](function(_0x304d43){_0x2f8de1[_0x52f986+_0x5e1a('0x8b')]=_0x304d43;_0x2a1949(_0x304d43);})[_0x5e1a('0x9')](function(_0x5150bc){_0x236d4f(_0x5150bc);});});}return _0x45da8e[_0x5e1a('0x8c')](_0x5e1a('0x8d'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x50bf66){var _0x413bfc={'raw':_0x50bf66[_0x5e1a('0x8e')][_0x5e1a('0x8f')],'where':{}};var _0x94b8cb={};var _0x85971a={'count':0x0,'rows':[]};var _0x2e4b18=_0x50bf66['query'][_0x5e1a('0x90')];var _0x1d266e=_0x50bf66[_0x5e1a('0x8e')][_0x5e1a('0x91')]||![];var _0x311386=_0x95ca3b(_0x2e4b18,_0x1d266e);if(!_0x311386[_0x5e1a('0x13')])throw new Error('Invalid\x20section\x20\x27'+_0x2e4b18+'\x27');var _0x80b93e=[{'name':_0x2e4b18}];if(!_[_0x5e1a('0x92')](_0x311386[_0x5e1a('0x18')]))_0x80b93e=_0x311386[_0x5e1a('0x18')];var _0x2d90c3=[];for(var _0x2c3ab0=0x0;_0x2c3ab0<_0x80b93e[_0x5e1a('0x93')];_0x2c3ab0++){_0x2d90c3[_0x5e1a('0x94')](_0x12f0c2[_0x5e1a('0x95')]['find']({'where':{'userProfileId':_0x50bf66[_0x5e1a('0x96')]['id'],'name':_0x80b93e[_0x2c3ab0][_0x5e1a('0xb')]},'raw':!![]}));}return Promise[_0x5e1a('0x97')](_0x2d90c3)[_0x5e1a('0x7')](function(_0x4dbcc2){var _0x329f9a=_[_0x5e1a('0x3')](_0x4dbcc2,function(_0x505b7a){return _0x505b7a?_0x505b7a:undefined;});var _0xad779c=_[_0x5e1a('0x3')](_0x80b93e,[_0x5e1a('0x98'),!![]]);var _0x534686=_[_0x5e1a('0x92')](_0x329f9a)&&_[_0x5e1a('0x92')](_0xad779c)?null:_['union'](_0xad779c,_0x329f9a);if(!_0x534686)return null;var _0x1924d8=[];for(var _0x335a36=0x0;_0x335a36<_0x534686[_0x5e1a('0x93')];_0x335a36++){var _0x1ef2c3=_[_0x5e1a('0x99')](_0x80b93e,function(_0x42a1dd){return _0x534686[_0x335a36]?_0x42a1dd[_0x5e1a('0xb')]===_0x534686[_0x335a36][_0x5e1a('0xb')]:null;});if(_0x1ef2c3){if(_0x534686[_0x335a36][_0x5e1a('0x98')]){_0x1924d8[_0x5e1a('0x94')](_0x4f2431(_0x311386[_0x5e1a('0x13')],_0x534686[_0x335a36]));}else{if(!_0x534686[_0x335a36][_0x5e1a('0x9a')]){_0x1924d8[_0x5e1a('0x94')](_0x846d0d(_0x1ef2c3,_0x534686[_0x335a36],_0x311386['childModel']));}else{if(_0x1ef2c3[_0x5e1a('0xa')]){_0x1924d8[_0x5e1a('0x94')](_0x5da243(_0x1ef2c3,_0x534686[_0x335a36]));}}}}}return Promise[_0x5e1a('0x97')](_0x1924d8);})['then'](function(_0x2af67d){var _0x294e45=_0x2af67d;var _0x435fa6=null;if(_0x294e45){_0x435fa6=_0x294e45[_0x5e1a('0x93')]===0x1?_0x294e45[0x0]:null;}if(!_0x435fa6&&!_0x294e45)return _0x85971a;var _0x3aa929=_0x12f0c2[_0x311386[_0x5e1a('0x13')]][_0x5e1a('0x9b')];_0x94b8cb['model']=_[_0x5e1a('0x9c')](_0x3aa929);_0x94b8cb['query']=_[_0x5e1a('0x9c')](_0x50bf66['query']);_0x94b8cb[_0x5e1a('0x9d')]=_[_0x5e1a('0x9e')](_0x94b8cb[_0x5e1a('0xa')],_0x94b8cb[_0x5e1a('0x8e')]);_0x413bfc[_0x5e1a('0x9f')]=_['intersection'](_0x94b8cb[_0x5e1a('0xa')],qs[_0x5e1a('0xa0')](_0x50bf66['query'][_0x5e1a('0xa0')]));_0x413bfc[_0x5e1a('0x9f')]=_0x413bfc[_0x5e1a('0x9f')][_0x5e1a('0x93')]?_0x413bfc[_0x5e1a('0x9f')]:_0x94b8cb[_0x5e1a('0xa')];if(!_0x50bf66[_0x5e1a('0x8e')][_0x5e1a('0xa1')](_0x5e1a('0xa2'))){_0x413bfc[_0x5e1a('0xa3')]=qs['limit'](_0x50bf66[_0x5e1a('0x8e')][_0x5e1a('0xa3')]);_0x413bfc[_0x5e1a('0xa4')]=qs[_0x5e1a('0xa4')](_0x50bf66[_0x5e1a('0x8e')][_0x5e1a('0xa4')]);}_0x413bfc[_0x5e1a('0xa5')]=qs[_0x5e1a('0xa6')](_0x50bf66[_0x5e1a('0x8e')][_0x5e1a('0xa6')]);_0x413bfc[_0x5e1a('0x88')]=qs['filters'](_[_0x5e1a('0xa7')](_0x50bf66[_0x5e1a('0x8e')],_0x94b8cb[_0x5e1a('0x9d')]));if(_0x50bf66[_0x5e1a('0x8e')][_0x5e1a('0x3')]){_0x413bfc[_0x5e1a('0x88')]=_[_0x5e1a('0xa8')](_0x413bfc[_0x5e1a('0x88')],{'$or':_[_0x5e1a('0xd')](_0x3aa929,function(_0x558231){if(_0x558231['type']['key']!==_0x5e1a('0xa9')){var _0x1bc518={};_0x1bc518[_0x558231[_0x5e1a('0x4')]]={'$like':'%'+_0x50bf66[_0x5e1a('0x8e')]['filter']+'%'};return _0x1bc518;}})});}var _0x19144c=[];var _0x2aa445=null;var _0x3b7fbd={};if(_0x435fa6){_0x2aa445=_[_0x5e1a('0x99')](_0x80b93e,[_0x5e1a('0xb'),_0x435fa6[_0x5e1a('0xb')]]);if(_0x2aa445[_0x5e1a('0x4')]){_0x3b7fbd={};if(_0x311386[_0x5e1a('0x13')]===_0x5e1a('0xe')){_0x3b7fbd[_0x2aa445[_0x5e1a('0xaa')]]=_[_0x5e1a('0xd')](_0x435fa6['associatedResources'],'id');}else{_0x3b7fbd[_0x2aa445[_0x5e1a('0xaa')]]=_0x435fa6[_0x5e1a('0x8')];}_0x19144c['push'](_0x3b7fbd);}else{_0x413bfc[_0x5e1a('0x88')]['id']=_0x435fa6['associatedResources'];}}else{for(var _0x2cb327=0x0;_0x2cb327<_0x294e45[_0x5e1a('0x93')];_0x2cb327++){_0x2aa445=_['find'](_0x80b93e,[_0x5e1a('0xb'),_0x294e45[_0x2cb327][_0x5e1a('0xb')]]);if(_0x2aa445[_0x5e1a('0x4')]){_0x3b7fbd={};_0x3b7fbd[_0x2aa445[_0x5e1a('0xaa')]]=_0x294e45[_0x2cb327][_0x5e1a('0x8')];_0x19144c['push'](_0x3b7fbd);}else{if(!_0x413bfc[_0x5e1a('0x88')]['id'])_0x413bfc['where']['id']=[];_0x294e45[_0x2cb327][_0x5e1a('0x8')][_0x5e1a('0xab')](function(_0x1d3d0d){_0x413bfc[_0x5e1a('0x88')]['id'][_0x5e1a('0x94')](_0x1d3d0d);});}}}if(!_['isEmpty'](_0x19144c)){_0x413bfc['where']=_[_0x5e1a('0xa8')](_0x413bfc[_0x5e1a('0x88')],{'$and':{'$or':_0x19144c}});}_0x413bfc=_[_0x5e1a('0xa8')]({},_0x413bfc,_0x50bf66['options']);if(_0x435fa6&&!_0x435fa6[_0x5e1a('0x9a')]&&_0x311386[_0x5e1a('0x13')]===_0x5e1a('0xe')){if(_0x50bf66[_0x5e1a('0x8e')][_0x5e1a('0xac')]){_0x413bfc[_0x5e1a('0xad')]=[{'all':!![]}];}return _0x12f0c2[_0x311386[_0x5e1a('0x13')]][_0x5e1a('0x6')](_0x413bfc)[_0x5e1a('0x7')](function(_0x59c68c){var _0x179d1f=[];_0x59c68c[_0x5e1a('0xab')](function(_0xfef2e7){var _0x66a11f;switch(_0xfef2e7[_0x5e1a('0xae')]){case _0x5e1a('0xaf'):_0x66a11f=_[_0x5e1a('0x99')](_0x435fa6['associatedResources'],function(_0x1f08e3){return _0x1f08e3['id']===_0xfef2e7['reportId']&&_0x1f08e3['type']==='DefaultReports';});break;case _0x5e1a('0xb0'):_0x66a11f=_[_0x5e1a('0x99')](_0x435fa6[_0x5e1a('0x8')],function(_0x17dc56){return _0x17dc56['id']===_0xfef2e7[_0x5e1a('0xb1')]&&_0x17dc56['type']===_0x5e1a('0xb2');});break;}if(_0x66a11f)_0x179d1f[_0x5e1a('0x94')](_0xfef2e7);});_0x85971a['count']=_0x179d1f[_0x5e1a('0x93')];_0x85971a['rows']=_0x179d1f;return _0x85971a;});}else{return _0x12f0c2[_0x311386[_0x5e1a('0x13')]][_0x5e1a('0xb3')]({'where':_0x413bfc[_0x5e1a('0x88')]})[_0x5e1a('0x7')](function(_0x125fef){_0x85971a[_0x5e1a('0xb3')]=_0x125fef;if(_0x50bf66['query'][_0x5e1a('0xac')]){if(_0x311386[_0x5e1a('0x13')]===_0x5e1a('0x1e')){_0x413bfc[_0x5e1a('0xad')]=[{'model':_0x12f0c2[_0x5e1a('0x71')],'as':_0x5e1a('0xb4'),'attributes':['id','name',_0x5e1a('0xb5')],'required':_0x50bf66['query'][_0x5e1a('0xb6')]?!![]:![]},{'model':_0x12f0c2[_0x5e1a('0x71')],'as':_0x5e1a('0xb7'),'attributes':['id',_0x5e1a('0xb'),_0x5e1a('0xb5')],'through':_0x50bf66[_0x5e1a('0x8e')]['tag']?{'attributes':[],'where':{'TagId':_0x50bf66[_0x5e1a('0x8e')][_0x5e1a('0xb6')]||undefined}}:{},'required':_0x50bf66['query']['tag']?!![]:![]}];}else{_0x413bfc[_0x5e1a('0xad')]=[{'all':!![]}];}}return _0x12f0c2[_0x311386['childModel']][_0x5e1a('0x6')](_0x413bfc);})[_0x5e1a('0x7')](function(_0x51ef1d){_0x85971a[_0x5e1a('0xb8')]=_0x51ef1d;if(_0x2e4b18==='Agents'&&_0x50bf66[_0x5e1a('0x8e')][_0x5e1a('0xb9')]==='true'){var _0x4f4996=[];for(var _0x58fd7d=0x0;_0x58fd7d<_0x85971a[_0x5e1a('0xb8')][_0x5e1a('0x93')];_0x58fd7d++){_0x4f4996[_0x5e1a('0x94')](_0x1a79b9(_0x5e1a('0xba'),_0x85971a[_0x5e1a('0xb8')][_0x58fd7d]['dataValues']));_0x4f4996[_0x5e1a('0x94')](_0x1a79b9(_0x5e1a('0xbb'),_0x85971a[_0x5e1a('0xb8')][_0x58fd7d]['dataValues']));_0x4f4996[_0x5e1a('0x94')](_0x1a79b9(_0x5e1a('0xbc'),_0x85971a[_0x5e1a('0xb8')][_0x58fd7d][_0x5e1a('0xbd')]));_0x4f4996[_0x5e1a('0x94')](_0x1a79b9(_0x5e1a('0xbe'),_0x85971a[_0x5e1a('0xb8')][_0x58fd7d][_0x5e1a('0xbd')]));_0x4f4996[_0x5e1a('0x94')](_0x1a79b9(_0x5e1a('0xbf'),_0x85971a[_0x5e1a('0xb8')][_0x58fd7d][_0x5e1a('0xbd')]));_0x4f4996[_0x5e1a('0x94')](_0x1a79b9(_0x5e1a('0xc0'),_0x85971a['rows'][_0x58fd7d]['dataValues']));}return Promise[_0x5e1a('0x97')](_0x4f4996)['then'](function(){return _0x85971a;});}return _0x85971a;});}});}}});}; \ No newline at end of file +var _0x12a2=['telephones','admin','user','Agents','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','vtigeraccounts','cannedanswers','CannedAnswer','Disposition','customdashboards','Dashboard','Pause','scheduler','Schedule','sounds','Sound','tags','Tag','templates','Template','triggers','Trigger','trunks','Trunk','variables','plugins','Plugin','extractedreports','AnalyticExtractedReport','Reports','reportId','metrics','AnalyticMetric','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','from','_interactions','where','query','toString','define','UserProfile','user_profiles','raw','section','mergeResources','length','push','UserProfileSection','find','params','all','ignore','isEmpty','union','autoAssociation','rawAttributes','keys','filters','intersection','attributes','fields','limit','offset','order','sort','key','VIRTUAL','foreignKey','forEach','merge','options','includeAll','include','reportType','default','DefaultReports','CustomReports','count','Tags','tag','ThroughTags','color','rows','openTabs','chat','dataValues','sms','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','exports','filter','field','value','findAll','then','associatedResources','map','catch','model','name','resolve','UserProfileResource','resourceId','type','SquareProject','odbc','childModel','parentSections','SquareProjects','projectName','projects','contacts','CmContact','Lists','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatwebsites','ChatWebsite','faxqueues','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','voicerecordings','VoiceRecording','membername','User','role','Telephones','telephone','VoiceQueues','queue','inbound','QueueCampaigns','VoiceQueue','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','OpenchannelQueue','openchannelaccounts','smsqueues','SmsQueue','smsaccounts','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','users'];(function(_0x13afbf,_0x415269){var _0x44141e=function(_0x2245f2){while(--_0x2245f2){_0x13afbf['push'](_0x13afbf['shift']());}};_0x44141e(++_0x415269);}(_0x12a2,0x6a));var _0x212a=function(_0xa55c11,_0x14d15a){_0xa55c11=_0xa55c11-0x0;var _0x4bf177=_0x12a2[_0xa55c11];return _0x4bf177;};'use strict';var _=require(_0x212a('0x0'));var attributes=require(_0x212a('0x1'));var qs=require('../../components/parsers/qs');var squel=require('squel');module[_0x212a('0x2')]=function(_0x16434d){var _0x1ed46b=_0x16434d['models'];function _0x3ace86(_0x3e7c0f,_0x49802c){return new Promise(function(_0x2f42b0,_0x488147){if(!_0x49802c)return _0x2f42b0(null);var _0x49e756=_0x49802c[_0x212a('0x3')]?{[_0x49802c[_0x212a('0x3')][_0x212a('0x4')]]:_0x49802c['filter'][_0x212a('0x5')]}:undefined;return _0x1ed46b[_0x3e7c0f][_0x212a('0x6')]({'where':_0x49e756,'raw':!![]})[_0x212a('0x7')](function(_0x370705){_0x49802c[_0x212a('0x8')]=_[_0x212a('0x9')](_0x370705,'id');_0x2f42b0(_0x49802c);})[_0x212a('0xa')](function(_0x1b35e0){_0x488147(_0x1b35e0);});});}function _0x3958cf(_0x5dbcf6,_0x1a04a9){return new Promise(function(_0xfeebbd,_0x994880){var _0x767856=_0x5dbcf6[_0x212a('0x3')]?{[_0x5dbcf6[_0x212a('0x3')][_0x212a('0x4')]]:_0x5dbcf6[_0x212a('0x3')][_0x212a('0x5')]}:undefined;return _0x1ed46b[_0x5dbcf6[_0x212a('0xb')]][_0x212a('0x6')]({'where':_0x767856,'raw':!![]})[_0x212a('0x7')](function(_0x48fc36){_0x1a04a9[_0x212a('0x8')]=_['map'](_0x48fc36,function(_0x146d57){return _0x146d57[_0x212a('0xc')];});_0xfeebbd(_0x1a04a9);})['catch'](function(_0x32ce87){_0x994880(_0x32ce87);});});}function _0x551eee(_0xafdb0b,_0x10fe1a,_0x77a018){if(!_0x10fe1a)return Promise[_0x212a('0xd')](null);return new Promise(function(_0x265295,_0x5d59ee){return _0x1ed46b[_0x212a('0xe')]['findAll']({'where':{'sectionId':_0x10fe1a['id']},'raw':!![]})[_0x212a('0x7')](function(_0x533e84){if(_0xafdb0b['field']&&_0xafdb0b[_0x212a('0x4')]!=='id'){_0x10fe1a[_0x212a('0x8')]=_[_0x212a('0x9')](_0x533e84,function(_0x49a695){return _0x49a695[_0xafdb0b[_0x212a('0x4')]];});}else{if(_0x77a018==='AnalyticExtractedReport'){_0x10fe1a['associatedResources']=_[_0x212a('0x9')](_0x533e84,function(_0x89d6ed){return{'id':_0x89d6ed[_0x212a('0xf')],'type':_0x89d6ed[_0x212a('0x10')]};});}else{_0x10fe1a[_0x212a('0x8')]=_[_0x212a('0x9')](_0x533e84,function(_0x506023){return _0x506023[_0x212a('0xf')];});}}_0x265295(_0x10fe1a);})[_0x212a('0xa')](function(_0x4e3f98){_0x5d59ee(_0x4e3f98);});});}function _0x379520(_0x4a77dd,_0x4eb130){var _0xb22dfb={'parentSections':[]};switch(_0x4a77dd['toLowerCase']()){case'squareprojects':_0xb22dfb['childModel']=_0x212a('0x11');break;case _0x212a('0x12'):_0xb22dfb[_0x212a('0x13')]='SquareOdbc';break;case'squarerecordings':_0xb22dfb['childModel']='SquareRecording';_0xb22dfb[_0x212a('0x14')]=[{'name':_0x212a('0x15'),'field':'name','foreignKey':_0x212a('0x16')}];break;case _0x212a('0x17'):_0xb22dfb[_0x212a('0x13')]='JscriptyProject';break;case _0x212a('0x18'):_0xb22dfb[_0x212a('0x13')]=_0x212a('0x19');_0xb22dfb[_0x212a('0x14')]=[{'name':_0x212a('0x1a'),'field':'id','foreignKey':'ListId'}];break;case _0x212a('0x1b'):_0xb22dfb['childModel']=_0x212a('0x1c');break;case _0x212a('0x1d'):_0xb22dfb[_0x212a('0x13')]=_0x212a('0x1e');break;case _0x212a('0x1f'):_0xb22dfb[_0x212a('0x13')]=_0x212a('0x20');break;case'chatqueues':_0xb22dfb[_0x212a('0x13')]='ChatQueue';break;case _0x212a('0x21'):_0xb22dfb['childModel']=_0x212a('0x22');break;case _0x212a('0x23'):_0xb22dfb[_0x212a('0x13')]='FaxQueue';break;case'faxaccounts':_0xb22dfb[_0x212a('0x13')]='FaxAccount';break;case'inboundroutes':case'internalroutes':case _0x212a('0x24'):_0xb22dfb[_0x212a('0x13')]=_0x212a('0x25');break;case _0x212a('0x26'):_0xb22dfb[_0x212a('0x13')]=_0x212a('0x27');break;case _0x212a('0x28'):_0xb22dfb[_0x212a('0x13')]='VoiceMail';break;case _0x212a('0x29'):_0xb22dfb['childModel']=_0x212a('0x2a');_0xb22dfb['parentSections']=[{'name':'Agents','field':'name','foreignKey':_0x212a('0x2b'),'model':_0x212a('0x2c'),'filter':{'field':_0x212a('0x2d'),'value':['agent']}},{'name':_0x212a('0x2e'),'field':_0x212a('0xc'),'foreignKey':_0x212a('0x2b'),'model':'User','filter':{'field':_0x212a('0x2d'),'value':[_0x212a('0x2f')]}},{'name':_0x212a('0x30'),'field':'name','foreignKey':_0x212a('0x31'),'model':'VoiceQueue','filter':{'field':_0x212a('0x10'),'value':[_0x212a('0x32')]}},{'name':_0x212a('0x33'),'field':_0x212a('0xc'),'foreignKey':_0x212a('0x31'),'model':_0x212a('0x34'),'filter':{'field':'type','value':[_0x212a('0x35')]}}];break;case _0x212a('0x36'):_0xb22dfb[_0x212a('0x13')]=_0x212a('0x37');break;case _0x212a('0x38'):_0xb22dfb[_0x212a('0x13')]=_0x212a('0x39');break;case _0x212a('0x3a'):_0xb22dfb[_0x212a('0x13')]=_0x212a('0x3b');break;case'ivrcampaigns':_0xb22dfb[_0x212a('0x13')]=_0x212a('0x3c');break;case _0x212a('0x3d'):_0xb22dfb['childModel']=_0x212a('0x3e');break;case _0x212a('0x3f'):_0xb22dfb[_0x212a('0x13')]=_0x212a('0x40');break;case _0x212a('0x41'):_0xb22dfb['childModel']=_0x212a('0x42');break;case'openchannelqueues':_0xb22dfb[_0x212a('0x13')]=_0x212a('0x43');break;case _0x212a('0x44'):_0xb22dfb[_0x212a('0x13')]='OpenchannelAccount';break;case _0x212a('0x45'):_0xb22dfb['childModel']=_0x212a('0x46');break;case _0x212a('0x47'):_0xb22dfb[_0x212a('0x13')]='SmsAccount';break;case _0x212a('0x48'):_0xb22dfb[_0x212a('0x13')]=_0x212a('0x49');break;case _0x212a('0x4a'):_0xb22dfb['childModel']=_0x212a('0x4b');break;case _0x212a('0x4c'):_0xb22dfb[_0x212a('0x13')]=_0x212a('0x4d');break;case _0x212a('0x4e'):case _0x212a('0x4f'):_0xb22dfb['childModel']='VoiceQueue';if(_0x4eb130){_0xb22dfb['parentSections']=[{'name':_0x212a('0x30')},{'name':_0x212a('0x33')}];}break;case _0x212a('0x50'):case'agents':case _0x212a('0x51'):_0xb22dfb['childModel']='User';if(_0x4eb130){_0xb22dfb['parentSections']=[{'name':'Users','filter':{'field':'role','value':[_0x212a('0x52'),_0x212a('0x53')]},'ignore':!![]},{'name':_0x212a('0x54')},{'name':_0x212a('0x2e')}];}break;case'zendeskaccounts':_0xb22dfb[_0x212a('0x13')]=_0x212a('0x55');break;case _0x212a('0x56'):_0xb22dfb[_0x212a('0x13')]=_0x212a('0x57');break;case _0x212a('0x58'):_0xb22dfb[_0x212a('0x13')]=_0x212a('0x59');break;case _0x212a('0x5a'):_0xb22dfb[_0x212a('0x13')]=_0x212a('0x5b');break;case _0x212a('0x5c'):_0xb22dfb['childModel']='DeskAccount';break;case'zohoaccounts':_0xb22dfb[_0x212a('0x13')]='ZohoAccount';break;case _0x212a('0x5d'):_0xb22dfb['childModel']=_0x212a('0x2c');break;case _0x212a('0x5e'):_0xb22dfb['childModel']=_0x212a('0x5f');break;case'dispositions':_0xb22dfb['childModel']=_0x212a('0x60');break;case _0x212a('0x61'):_0xb22dfb[_0x212a('0x13')]=_0x212a('0x62');break;case'intervals':_0xb22dfb[_0x212a('0x13')]='Interval';break;case'pauses':_0xb22dfb['childModel']=_0x212a('0x63');break;case _0x212a('0x64'):_0xb22dfb[_0x212a('0x13')]=_0x212a('0x65');break;case _0x212a('0x66'):_0xb22dfb[_0x212a('0x13')]=_0x212a('0x67');break;case _0x212a('0x68'):_0xb22dfb[_0x212a('0x13')]=_0x212a('0x69');break;case _0x212a('0x6a'):_0xb22dfb[_0x212a('0x13')]=_0x212a('0x6b');break;case _0x212a('0x6c'):_0xb22dfb['childModel']=_0x212a('0x6d');break;case _0x212a('0x6e'):_0xb22dfb[_0x212a('0x13')]=_0x212a('0x6f');break;case _0x212a('0x70'):_0xb22dfb[_0x212a('0x13')]='Variable';break;case _0x212a('0x71'):_0xb22dfb[_0x212a('0x13')]=_0x212a('0x72');break;case _0x212a('0x73'):_0xb22dfb[_0x212a('0x13')]=_0x212a('0x74');_0xb22dfb[_0x212a('0x14')]=[{'name':_0x212a('0x75'),'field':'id','foreignKey':_0x212a('0x76')}];break;case _0x212a('0x77'):_0xb22dfb[_0x212a('0x13')]=_0x212a('0x78');break;}return _0xb22dfb;}function _0x2df423(_0x35eed3,_0x296ef7){var _0x237dd6=_0x35eed3['charAt'](0x0)[_0x212a('0x79')]()+_0x35eed3[_0x212a('0x7a')](0x1);var _0x36ad5d={'type':_0x1ed46b[_0x212a('0x7b')][_0x212a('0x7c')][_0x212a('0x7d')],'raw':!![]};return new Promise(function(_0x21f4b5,_0x3086b9){var _0x3515c7=squel[_0x212a('0x7e')]()[_0x212a('0x4')](_0x212a('0x7f')+_0x237dd6+_0x212a('0x80'),'id')['field'](_0x212a('0x81'))[_0x212a('0x82')]('user_has_'+_0x35eed3+_0x212a('0x83'),'ui')[_0x212a('0x84')]('ui.UserId\x20=\x20?',_0x296ef7['id']);return _0x1ed46b['sequelize'][_0x212a('0x85')](_0x3515c7[_0x212a('0x86')](),_0x36ad5d)[_0x212a('0x7')](function(_0x3069e0){_0x296ef7[_0x237dd6+'OpenTabs']=_0x3069e0;_0x21f4b5(_0x3069e0);})[_0x212a('0xa')](function(_0x21fc07){_0x3086b9(_0x21fc07);});});}return _0x16434d[_0x212a('0x87')](_0x212a('0x88'),attributes,{'tableName':_0x212a('0x89'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0xacf3f8){var _0x49b077={'raw':_0xacf3f8[_0x212a('0x85')][_0x212a('0x8a')],'where':{}};var _0x1ca6f2={};var _0xe3de87={'count':0x0,'rows':[]};var _0x5dadad=_0xacf3f8[_0x212a('0x85')][_0x212a('0x8b')];var _0x17e6a9=_0xacf3f8['query'][_0x212a('0x8c')]||![];var _0x501d03=_0x379520(_0x5dadad,_0x17e6a9);if(!_0x501d03[_0x212a('0x13')])throw new Error('Invalid\x20section\x20\x27'+_0x5dadad+'\x27');var _0x157b16=[{'name':_0x5dadad}];if(!_['isEmpty'](_0x501d03['parentSections']))_0x157b16=_0x501d03['parentSections'];var _0x17f595=[];for(var _0x97f6eb=0x0;_0x97f6eb<_0x157b16[_0x212a('0x8d')];_0x97f6eb++){_0x17f595[_0x212a('0x8e')](_0x1ed46b[_0x212a('0x8f')][_0x212a('0x90')]({'where':{'userProfileId':_0xacf3f8[_0x212a('0x91')]['id'],'name':_0x157b16[_0x97f6eb]['name']},'raw':!![]}));}return Promise[_0x212a('0x92')](_0x17f595)['then'](function(_0x45bc03){var _0x2cfbd6=_[_0x212a('0x3')](_0x45bc03,function(_0xecaa7){return _0xecaa7?_0xecaa7:undefined;});var _0x3d2012=_[_0x212a('0x3')](_0x157b16,[_0x212a('0x93'),!![]]);var _0x30c157=_['isEmpty'](_0x2cfbd6)&&_[_0x212a('0x94')](_0x3d2012)?null:_[_0x212a('0x95')](_0x3d2012,_0x2cfbd6);if(!_0x30c157)return null;var _0x3cfc78=[];for(var _0x458b2b=0x0;_0x458b2b<_0x30c157['length'];_0x458b2b++){var _0xd7c73b=_[_0x212a('0x90')](_0x157b16,function(_0xed6526){return _0x30c157[_0x458b2b]?_0xed6526['name']===_0x30c157[_0x458b2b][_0x212a('0xc')]:null;});if(_0xd7c73b){if(_0x30c157[_0x458b2b][_0x212a('0x93')]){_0x3cfc78['push'](_0x3ace86(_0x501d03[_0x212a('0x13')],_0x30c157[_0x458b2b]));}else{if(!_0x30c157[_0x458b2b][_0x212a('0x96')]){_0x3cfc78['push'](_0x551eee(_0xd7c73b,_0x30c157[_0x458b2b],_0x501d03[_0x212a('0x13')]));}else{if(_0xd7c73b[_0x212a('0xb')]){_0x3cfc78[_0x212a('0x8e')](_0x3958cf(_0xd7c73b,_0x30c157[_0x458b2b]));}}}}}return Promise[_0x212a('0x92')](_0x3cfc78);})[_0x212a('0x7')](function(_0x12806d){var _0x34200c=_0x12806d;var _0x9fed9f=null;if(_0x34200c){_0x9fed9f=_0x34200c[_0x212a('0x8d')]===0x1?_0x34200c[0x0]:null;}if(!_0x9fed9f&&!_0x34200c)return _0xe3de87;var _0x4289b3=_0x1ed46b[_0x501d03['childModel']][_0x212a('0x97')];_0x1ca6f2['model']=_['keys'](_0x4289b3);_0x1ca6f2['query']=_[_0x212a('0x98')](_0xacf3f8[_0x212a('0x85')]);_0x1ca6f2[_0x212a('0x99')]=_[_0x212a('0x9a')](_0x1ca6f2[_0x212a('0xb')],_0x1ca6f2['query']);_0x49b077[_0x212a('0x9b')]=_[_0x212a('0x9a')](_0x1ca6f2[_0x212a('0xb')],qs['fields'](_0xacf3f8[_0x212a('0x85')][_0x212a('0x9c')]));_0x49b077['attributes']=_0x49b077[_0x212a('0x9b')]['length']?_0x49b077[_0x212a('0x9b')]:_0x1ca6f2['model'];if(!_0xacf3f8[_0x212a('0x85')]['hasOwnProperty']('nolimit')){_0x49b077['limit']=qs[_0x212a('0x9d')](_0xacf3f8[_0x212a('0x85')][_0x212a('0x9d')]);_0x49b077[_0x212a('0x9e')]=qs[_0x212a('0x9e')](_0xacf3f8['query'][_0x212a('0x9e')]);}_0x49b077[_0x212a('0x9f')]=qs[_0x212a('0xa0')](_0xacf3f8[_0x212a('0x85')][_0x212a('0xa0')]);_0x49b077[_0x212a('0x84')]=qs[_0x212a('0x99')](_['pick'](_0xacf3f8[_0x212a('0x85')],_0x1ca6f2[_0x212a('0x99')]));if(_0xacf3f8[_0x212a('0x85')][_0x212a('0x3')]){_0x49b077['where']=_['merge'](_0x49b077[_0x212a('0x84')],{'$or':_[_0x212a('0x9')](_0x4289b3,function(_0x5b26c8){if(_0x5b26c8[_0x212a('0x10')][_0x212a('0xa1')]!==_0x212a('0xa2')){var _0x53c54d={};_0x53c54d[_0x5b26c8[_0x212a('0x4')]]={'$like':'%'+_0xacf3f8[_0x212a('0x85')]['filter']+'%'};return _0x53c54d;}})});}var _0x357de0=[];var _0x3cfd70=null;var _0x394f01={};if(_0x9fed9f){_0x3cfd70=_['find'](_0x157b16,['name',_0x9fed9f[_0x212a('0xc')]]);if(_0x3cfd70[_0x212a('0x4')]){_0x394f01={};if(_0x501d03[_0x212a('0x13')]===_0x212a('0x74')){_0x394f01[_0x3cfd70[_0x212a('0xa3')]]=_[_0x212a('0x9')](_0x9fed9f[_0x212a('0x8')],'id');}else{_0x394f01[_0x3cfd70[_0x212a('0xa3')]]=_0x9fed9f[_0x212a('0x8')];}_0x357de0[_0x212a('0x8e')](_0x394f01);}else{_0x49b077[_0x212a('0x84')]['id']=_0x9fed9f[_0x212a('0x8')];}}else{for(var _0x298ec8=0x0;_0x298ec8<_0x34200c[_0x212a('0x8d')];_0x298ec8++){_0x3cfd70=_[_0x212a('0x90')](_0x157b16,['name',_0x34200c[_0x298ec8][_0x212a('0xc')]]);if(_0x3cfd70[_0x212a('0x4')]){_0x394f01={};_0x394f01[_0x3cfd70[_0x212a('0xa3')]]=_0x34200c[_0x298ec8][_0x212a('0x8')];_0x357de0['push'](_0x394f01);}else{if(!_0x49b077[_0x212a('0x84')]['id'])_0x49b077[_0x212a('0x84')]['id']=[];_0x34200c[_0x298ec8][_0x212a('0x8')][_0x212a('0xa4')](function(_0x53a131){_0x49b077[_0x212a('0x84')]['id'][_0x212a('0x8e')](_0x53a131);});}}}if(!_[_0x212a('0x94')](_0x357de0)){_0x49b077[_0x212a('0x84')]=_['merge'](_0x49b077['where'],{'$and':{'$or':_0x357de0}});}_0x49b077=_[_0x212a('0xa5')]({},_0x49b077,_0xacf3f8[_0x212a('0xa6')]);if(_0x9fed9f&&!_0x9fed9f[_0x212a('0x96')]&&_0x501d03[_0x212a('0x13')]===_0x212a('0x74')){if(_0xacf3f8['query'][_0x212a('0xa7')]){_0x49b077[_0x212a('0xa8')]=[{'all':!![]}];}return _0x1ed46b[_0x501d03['childModel']][_0x212a('0x6')](_0x49b077)[_0x212a('0x7')](function(_0x3ffc55){var _0x35d1fc=[];_0x3ffc55[_0x212a('0xa4')](function(_0x2e042a){var _0x181250;switch(_0x2e042a[_0x212a('0xa9')]){case _0x212a('0xaa'):_0x181250=_[_0x212a('0x90')](_0x9fed9f['associatedResources'],function(_0x2dd320){return _0x2dd320['id']===_0x2e042a[_0x212a('0x76')]&&_0x2dd320[_0x212a('0x10')]===_0x212a('0xab');});break;case'custom':_0x181250=_[_0x212a('0x90')](_0x9fed9f[_0x212a('0x8')],function(_0x105601){return _0x105601['id']===_0x2e042a[_0x212a('0x76')]&&_0x105601['type']===_0x212a('0xac');});break;}if(_0x181250)_0x35d1fc['push'](_0x2e042a);});_0xe3de87[_0x212a('0xad')]=_0x35d1fc[_0x212a('0x8d')];_0xe3de87['rows']=_0x35d1fc;return _0xe3de87;});}else{return _0x1ed46b[_0x501d03[_0x212a('0x13')]][_0x212a('0xad')]({'where':_0x49b077[_0x212a('0x84')]})[_0x212a('0x7')](function(_0x488a0a){_0xe3de87['count']=_0x488a0a;if(_0xacf3f8[_0x212a('0x85')][_0x212a('0xa7')]){if(_0x501d03[_0x212a('0x13')]===_0x212a('0x19')){_0x49b077[_0x212a('0xa8')]=[{'model':_0x1ed46b['Tag'],'as':_0x212a('0xae'),'attributes':['id','name','color'],'required':_0xacf3f8[_0x212a('0x85')][_0x212a('0xaf')]?!![]:![]},{'model':_0x1ed46b[_0x212a('0x69')],'as':_0x212a('0xb0'),'attributes':['id',_0x212a('0xc'),_0x212a('0xb1')],'through':_0xacf3f8[_0x212a('0x85')]['tag']?{'attributes':[],'where':{'TagId':_0xacf3f8[_0x212a('0x85')][_0x212a('0xaf')]||undefined}}:{},'required':_0xacf3f8['query']['tag']?!![]:![]}];}else{_0x49b077[_0x212a('0xa8')]=[{'all':!![]}];}}return _0x1ed46b[_0x501d03[_0x212a('0x13')]]['findAll'](_0x49b077);})[_0x212a('0x7')](function(_0x69da9d){_0xe3de87[_0x212a('0xb2')]=_0x69da9d;if(_0x5dadad===_0x212a('0x54')&&_0xacf3f8[_0x212a('0x85')][_0x212a('0xb3')]==='true'){var _0x4306eb=[];for(var _0x2bbb0e=0x0;_0x2bbb0e<_0xe3de87[_0x212a('0xb2')][_0x212a('0x8d')];_0x2bbb0e++){_0x4306eb['push'](_0x2df423(_0x212a('0xb4'),_0xe3de87['rows'][_0x2bbb0e][_0x212a('0xb5')]));_0x4306eb[_0x212a('0x8e')](_0x2df423(_0x212a('0xb6'),_0xe3de87[_0x212a('0xb2')][_0x2bbb0e]['dataValues']));_0x4306eb['push'](_0x2df423(_0x212a('0xb7'),_0xe3de87[_0x212a('0xb2')][_0x2bbb0e][_0x212a('0xb5')]));_0x4306eb[_0x212a('0x8e')](_0x2df423(_0x212a('0xb8'),_0xe3de87[_0x212a('0xb2')][_0x2bbb0e][_0x212a('0xb5')]));_0x4306eb['push'](_0x2df423(_0x212a('0xb9'),_0xe3de87[_0x212a('0xb2')][_0x2bbb0e]['dataValues']));_0x4306eb[_0x212a('0x8e')](_0x2df423(_0x212a('0xba'),_0xe3de87[_0x212a('0xb2')][_0x2bbb0e][_0x212a('0xb5')]));}return Promise['all'](_0x4306eb)[_0x212a('0x7')](function(){return _0xe3de87;});}return _0xe3de87;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 5b82332..86a1b08 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 _0x0e4b=['./userProfile.socket','register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','randomstring','rpc','../../config/environment','client','http','redis','defaults'];(function(_0x22c2ba,_0x31fa0a){var _0x5a55a9=function(_0x10e80b){while(--_0x10e80b){_0x22c2ba['push'](_0x22c2ba['shift']());}};_0x5a55a9(++_0x31fa0a);}(_0x0e4b,0xdc));var _0xb0e4=function(_0x4326cd,_0x3cf265){_0x4326cd=_0x4326cd-0x0;var _0x5b4678=_0x0e4b[_0x4326cd];return _0x5b4678;};'use strict';var _=require(_0xb0e4('0x0'));var util=require(_0xb0e4('0x1'));var moment=require(_0xb0e4('0x2'));var BPromise=require('bluebird');var rs=require(_0xb0e4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb0e4('0x4'));var config=require(_0xb0e4('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xb0e4('0x6')][_0xb0e4('0x7')]({'port':0x232a});config[_0xb0e4('0x8')]=_[_0xb0e4('0x9')](config[_0xb0e4('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb0e4('0x8')]));require(_0xb0e4('0xa'))[_0xb0e4('0xb')](socket);function respondWithRpcPromise(_0x23555b,_0x12a36a,_0x140b7e){return new BPromise(function(_0x16940b,_0x232133){return client[_0xb0e4('0xc')](_0x23555b,_0x140b7e)[_0xb0e4('0xd')](function(_0x598c20){logger[_0xb0e4('0xe')](_0xb0e4('0xf'),_0x12a36a,_0xb0e4('0x10'));logger[_0xb0e4('0x11')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x12a36a,_0xb0e4('0x10'),JSON[_0xb0e4('0x12')](_0x598c20));if(_0x598c20['error']){if(_0x598c20[_0xb0e4('0x13')][_0xb0e4('0x14')]===0x1f4){logger[_0xb0e4('0x13')](_0xb0e4('0xf'),_0x12a36a,_0x598c20[_0xb0e4('0x13')]['message']);return _0x232133(_0x598c20['error'][_0xb0e4('0x15')]);}logger[_0xb0e4('0x13')]('UserProfile,\x20%s,\x20%s',_0x12a36a,_0x598c20[_0xb0e4('0x13')][_0xb0e4('0x15')]);return _0x16940b(_0x598c20[_0xb0e4('0x13')][_0xb0e4('0x15')]);}else{logger[_0xb0e4('0xe')](_0xb0e4('0xf'),_0x12a36a,'request\x20sent');_0x16940b(_0x598c20['result']['message']);}})[_0xb0e4('0x16')](function(_0x41b3c1){logger[_0xb0e4('0x13')](_0xb0e4('0xf'),_0x12a36a,_0x41b3c1);_0x232133(_0x41b3c1);});});} \ No newline at end of file +var _0xb145=['http','defaults','redis','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfile,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x19e448,_0x86b898){var _0x67e5d2=function(_0xe3043){while(--_0xe3043){_0x19e448['push'](_0x19e448['shift']());}};_0x67e5d2(++_0x86b898);}(_0xb145,0xa3));var _0x5b14=function(_0x1aa7e7,_0x49885f){_0x1aa7e7=_0x1aa7e7-0x0;var _0x331f0b=_0xb145[_0x1aa7e7];return _0x331f0b;};'use strict';var _=require('lodash');var util=require(_0x5b14('0x0'));var moment=require(_0x5b14('0x1'));var BPromise=require(_0x5b14('0x2'));var rs=require(_0x5b14('0x3'));var fs=require('fs');var Redis=require(_0x5b14('0x4'));var db=require(_0x5b14('0x5'))['db'];var utils=require(_0x5b14('0x6'));var logger=require(_0x5b14('0x7'))('rpc');var config=require(_0x5b14('0x8'));var jayson=require(_0x5b14('0x9'));var client=jayson[_0x5b14('0xa')][_0x5b14('0xb')]({'port':0x232a});config['redis']=_[_0x5b14('0xc')](config[_0x5b14('0xd')],{'host':_0x5b14('0xe'),'port':0x18eb});var socket=require(_0x5b14('0xf'))(new Redis(config[_0x5b14('0xd')]));require('./userProfile.socket')[_0x5b14('0x10')](socket);function respondWithRpcPromise(_0x3bdb54,_0x4a4557,_0x1d8b5f){return new BPromise(function(_0x17047f,_0x1ecffb){return client[_0x5b14('0x11')](_0x3bdb54,_0x1d8b5f)[_0x5b14('0x12')](function(_0x4fb6da){logger[_0x5b14('0x13')]('UserProfile,\x20%s,\x20%s',_0x4a4557,_0x5b14('0x14'));logger[_0x5b14('0x15')](_0x5b14('0x16'),_0x4a4557,_0x5b14('0x14'),JSON[_0x5b14('0x17')](_0x4fb6da));if(_0x4fb6da[_0x5b14('0x18')]){if(_0x4fb6da['error'][_0x5b14('0x19')]===0x1f4){logger[_0x5b14('0x18')](_0x5b14('0x1a'),_0x4a4557,_0x4fb6da[_0x5b14('0x18')][_0x5b14('0x1b')]);return _0x1ecffb(_0x4fb6da[_0x5b14('0x18')][_0x5b14('0x1b')]);}logger[_0x5b14('0x18')](_0x5b14('0x1a'),_0x4a4557,_0x4fb6da[_0x5b14('0x18')][_0x5b14('0x1b')]);return _0x17047f(_0x4fb6da[_0x5b14('0x18')]['message']);}else{logger[_0x5b14('0x13')]('UserProfile,\x20%s,\x20%s',_0x4a4557,'request\x20sent');_0x17047f(_0x4fb6da['result'][_0x5b14('0x1b')]);}})[_0x5b14('0x1c')](function(_0x3662a7){logger[_0x5b14('0x18')](_0x5b14('0x1a'),_0x4a4557,_0x3662a7);_0x1ecffb(_0x3662a7);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index b754085..b1ad354 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 _0x49be=['removeListener','register','length','./userProfile.events','save','remove','update','emit'];(function(_0x4b5283,_0x308cfd){var _0x48d190=function(_0x56d6ea){while(--_0x56d6ea){_0x4b5283['push'](_0x4b5283['shift']());}};_0x48d190(++_0x308cfd);}(_0x49be,0x6b));var _0xe49b=function(_0x284a61,_0x231686){_0x284a61=_0x284a61-0x0;var _0x220e3c=_0x49be[_0x284a61];return _0x220e3c;};'use strict';var UserProfileEvents=require(_0xe49b('0x0'));var events=[_0xe49b('0x1'),_0xe49b('0x2'),_0xe49b('0x3')];function createListener(_0xef9c0f,_0x3386d2){return function(_0x2f56fb){_0x3386d2[_0xe49b('0x4')](_0xef9c0f,_0x2f56fb);};}function removeListener(_0x5d353f,_0x827ebc){return function(){UserProfileEvents[_0xe49b('0x5')](_0x5d353f,_0x827ebc);};}exports[_0xe49b('0x6')]=function(_0x2fe32d){for(var _0x579016=0x0,_0x407732=events[_0xe49b('0x7')];_0x579016<_0x407732;_0x579016++){var _0x50f3fb=events[_0x579016];var _0x27d0cd=createListener('userProfile:'+_0x50f3fb,_0x2fe32d);UserProfileEvents['on'](_0x50f3fb,_0x27d0cd);}}; \ No newline at end of file +var _0x9c09=['update','userProfile:','./userProfile.events','remove'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x9c09,0x1ca));var _0x99c0=function(_0x21f3ab,_0x345c5e){_0x21f3ab=_0x21f3ab-0x0;var _0x5e1f0b=_0x9c09[_0x21f3ab];return _0x5e1f0b;};'use strict';var UserProfileEvents=require(_0x99c0('0x0'));var events=['save',_0x99c0('0x1'),_0x99c0('0x2')];function createListener(_0x14719c,_0x5e4d99){return function(_0x9f7ac8){_0x5e4d99['emit'](_0x14719c,_0x9f7ac8);};}function removeListener(_0x1ff603,_0x48b035){return function(){UserProfileEvents['removeListener'](_0x1ff603,_0x48b035);};}exports['register']=function(_0x2d5872){for(var _0x4d333d=0x0,_0x4bb363=events['length'];_0x4d333d<_0x4bb363;_0x4d333d++){var _0x46c5ea=events[_0x4d333d];var _0x46d79e=createListener(_0x99c0('0x3')+_0x46c5ea,_0x2d5872);UserProfileEvents['on'](_0x46c5ea,_0x46d79e);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index debeb34..5e45755 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 _0x4615=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','index','describe','show','create','update','delete','/:id','destroy','multer','util'];(function(_0x334f9a,_0x542f01){var _0x2b219d=function(_0x25bb3e){while(--_0x25bb3e){_0x334f9a['push'](_0x334f9a['shift']());}};_0x2b219d(++_0x542f01);}(_0x4615,0xe2));var _0x5461=function(_0x5ce608,_0x1aca8e){_0x5ce608=_0x5ce608-0x0;var _0x582fdf=_0x4615[_0x5ce608];return _0x582fdf;};'use strict';var multer=require(_0x5461('0x0'));var util=require(_0x5461('0x1'));var path=require('path');var timeout=require(_0x5461('0x2'));var express=require(_0x5461('0x3'));var router=express['Router']();var fs_extra=require(_0x5461('0x4'));var auth=require(_0x5461('0x5'));var interaction=require(_0x5461('0x6'));var config=require(_0x5461('0x7'));var controller=require(_0x5461('0x8'));router[_0x5461('0x9')]('/',auth[_0x5461('0xa')](),controller[_0x5461('0xb')]);router[_0x5461('0x9')]('/describe',auth[_0x5461('0xa')](),controller[_0x5461('0xc')]);router[_0x5461('0x9')]('/:id',auth[_0x5461('0xa')](),controller[_0x5461('0xd')]);router['post']('/',auth[_0x5461('0xa')](),controller[_0x5461('0xe')]);router['put']('/:id',auth[_0x5461('0xa')](),controller[_0x5461('0xf')]);router[_0x5461('0x10')](_0x5461('0x11'),auth[_0x5461('0xa')](),controller[_0x5461('0x12')]);module['exports']=router; \ No newline at end of file +var _0xf8ff=['../../config/environment','./userProfileResource.controller','get','isAuthenticated','describe','/:id','post','create','put','update','delete','exports','multer','util','path','Router','fs-extra','../../components/interaction/service'];(function(_0x352c13,_0x1a91cb){var _0x5b48e8=function(_0x1afcc2){while(--_0x1afcc2){_0x352c13['push'](_0x352c13['shift']());}};_0x5b48e8(++_0x1a91cb);}(_0xf8ff,0x11a));var _0xff8f=function(_0x577519,_0x346daf){_0x577519=_0x577519-0x0;var _0x5b12f7=_0xf8ff[_0x577519];return _0x5b12f7;};'use strict';var multer=require(_0xff8f('0x0'));var util=require(_0xff8f('0x1'));var path=require(_0xff8f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xff8f('0x3')]();var fs_extra=require(_0xff8f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xff8f('0x5'));var config=require(_0xff8f('0x6'));var controller=require(_0xff8f('0x7'));router[_0xff8f('0x8')]('/',auth[_0xff8f('0x9')](),controller['index']);router[_0xff8f('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xff8f('0xa')]);router[_0xff8f('0x8')](_0xff8f('0xb'),auth[_0xff8f('0x9')](),controller['show']);router[_0xff8f('0xc')]('/',auth[_0xff8f('0x9')](),controller[_0xff8f('0xd')]);router[_0xff8f('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xff8f('0xf')]);router[_0xff8f('0x10')](_0xff8f('0xb'),auth[_0xff8f('0x9')](),controller['destroy']);module[_0xff8f('0x11')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 50a77a3..f81a6dd 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 _0xdd75=['INTEGER','sequelize','exports','STRING'];(function(_0x5cbc9c,_0x53c58c){var _0x4dd94a=function(_0x1e18be){while(--_0x1e18be){_0x5cbc9c['push'](_0x5cbc9c['shift']());}};_0x4dd94a(++_0x53c58c);}(_0xdd75,0x101));var _0x5dd7=function(_0x2e0bed,_0x24b28d){_0x2e0bed=_0x2e0bed-0x0;var _0x45e74e=_0xdd75[_0x2e0bed];return _0x45e74e;};'use strict';var Sequelize=require(_0x5dd7('0x0'));module[_0x5dd7('0x1')]={'name':{'type':Sequelize[_0x5dd7('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x5dd7('0x3')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xc6f0=['INTEGER','STRING','sequelize','exports'];(function(_0x6916e5,_0x2799bd){var _0x151ee0=function(_0x10482d){while(--_0x10482d){_0x6916e5['push'](_0x6916e5['shift']());}};_0x151ee0(++_0x2799bd);}(_0xc6f0,0x16a));var _0x0c6f=function(_0x250f68,_0x42e772){_0x250f68=_0x250f68-0x0;var _0x49b71e=_0xc6f0[_0x250f68];return _0x49b71e;};'use strict';var Sequelize=require(_0x0c6f('0x0'));module[_0x0c6f('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0x0c6f('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x0c6f('0x3')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 714b307..9479a76 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 _0x90b1=['intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','merge','where','type','options','UserProfileResource','includeAll','rows','include','find','catch','body','params','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','then','destroy','error','name','send','index','map','rawAttributes','fieldName','key','keys','query','filters'];(function(_0x19eb81,_0x209f79){var _0xb0e98e=function(_0x4fd2d9){while(--_0x4fd2d9){_0x19eb81['push'](_0x19eb81['shift']());}};_0xb0e98e(++_0x209f79);}(_0x90b1,0x1bb));var _0x190b=function(_0x649a3b,_0x2b1cf5){_0x649a3b=_0x649a3b-0x0;var _0x8ec5a5=_0x90b1[_0x649a3b];return _0x8ec5a5;};'use strict';var emlformat=require(_0x190b('0x0'));var rimraf=require(_0x190b('0x1'));var zipdir=require(_0x190b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x190b('0x3'));var BPromise=require(_0x190b('0x4'));var Mustache=require(_0x190b('0x5'));var util=require(_0x190b('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(_0x190b('0x7'));var _=require(_0x190b('0x8'));var squel=require(_0x190b('0x9'));var crypto=require(_0x190b('0xa'));var jsforce=require(_0x190b('0xb'));var deskjs=require(_0x190b('0xc'));var toCsv=require(_0x190b('0xd'));var querystring=require('querystring');var Papa=require(_0x190b('0xe'));var Redis=require(_0x190b('0xf'));var authService=require(_0x190b('0x10'));var qs=require(_0x190b('0x11'));var as=require(_0x190b('0x12'));var hardwareService=require(_0x190b('0x13'));var logger=require(_0x190b('0x14'))(_0x190b('0x15'));var utils=require('../../config/utils');var config=require(_0x190b('0x16'));var licenseUtil=require(_0x190b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d63ac,_0x596c48){_0x596c48=_0x596c48||0xcc;return function(_0x286c81){if(_0x286c81){return _0x4d63ac[_0x190b('0x18')](_0x596c48);}return _0x4d63ac[_0x190b('0x19')](_0x596c48)[_0x190b('0x1a')]();};}function respondWithResult(_0x2e12d4,_0x13544c){_0x13544c=_0x13544c||0xc8;return function(_0x1ff180){if(_0x1ff180){return _0x2e12d4[_0x190b('0x19')](_0x13544c)[_0x190b('0x1b')](_0x1ff180);}};}function respondWithFilteredResult(_0x1a046f,_0xab346){return function(_0x3e8781){if(_0x3e8781){var _0x3fbfc3=typeof _0xab346[_0x190b('0x1c')]===_0x190b('0x1d')&&typeof _0xab346['limit']===_0x190b('0x1d');var _0x5efbed=_0x3e8781[_0x190b('0x1e')];var _0x21e458=_0x3fbfc3?0x0:_0xab346[_0x190b('0x1c')];var _0x16c009=_0x3fbfc3?_0x3e8781['count']:_0xab346[_0x190b('0x1c')]+_0xab346[_0x190b('0x1f')];var _0x441a2b;if(_0x16c009>=_0x5efbed){_0x16c009=_0x5efbed;_0x441a2b=0xc8;}else{_0x441a2b=0xce;}_0x1a046f[_0x190b('0x19')](_0x441a2b);return _0x1a046f[_0x190b('0x20')](_0x190b('0x21'),_0x21e458+'-'+_0x16c009+'/'+_0x5efbed)['json'](_0x3e8781);}return null;};}function patchUpdates(_0x3ed24c){return function(_0x14f0a5){try{jsonpatch['apply'](_0x14f0a5,_0x3ed24c,!![]);}catch(_0xb4c32b){return BPromise['reject'](_0xb4c32b);}return _0x14f0a5['save']();};}function saveUpdates(_0xcd15e5,_0x42e7f2){return function(_0x332006){if(_0x332006){return _0x332006['update'](_0xcd15e5)[_0x190b('0x22')](function(_0x2e633e){return _0x2e633e;});}return null;};}function removeEntity(_0x16e989,_0x292ce3){return function(_0x3b8c74){if(_0x3b8c74){return _0x3b8c74[_0x190b('0x23')]()[_0x190b('0x22')](function(){_0x16e989['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x262a63,_0x1a5f86){return function(_0x50605b){if(!_0x50605b){_0x262a63['sendStatus'](0x194);}return _0x50605b;};}function handleError(_0x3260d5,_0x4e2a93){_0x4e2a93=_0x4e2a93||0x1f4;return function(_0x328e5e){logger[_0x190b('0x24')](_0x328e5e['stack']);if(_0x328e5e[_0x190b('0x25')]){delete _0x328e5e[_0x190b('0x25')];}_0x3260d5['status'](_0x4e2a93)[_0x190b('0x26')](_0x328e5e);};}exports[_0x190b('0x27')]=function(_0x359b4a,_0x494f3f){var _0x536d7b={},_0x3730cc={},_0x4d5f3f={'count':0x0,'rows':[]};var _0x14be2c=_[_0x190b('0x28')](db['UserProfileResource'][_0x190b('0x29')],function(_0x580b92){return{'name':_0x580b92[_0x190b('0x2a')],'type':_0x580b92['type'][_0x190b('0x2b')]};});_0x3730cc['model']=_[_0x190b('0x28')](_0x14be2c,_0x190b('0x25'));_0x3730cc['query']=_[_0x190b('0x2c')](_0x359b4a[_0x190b('0x2d')]);_0x3730cc[_0x190b('0x2e')]=_[_0x190b('0x2f')](_0x3730cc[_0x190b('0x30')],_0x3730cc[_0x190b('0x2d')]);_0x536d7b[_0x190b('0x31')]=_[_0x190b('0x2f')](_0x3730cc['model'],qs['fields'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x32')]));_0x536d7b['attributes']=_0x536d7b[_0x190b('0x31')][_0x190b('0x33')]?_0x536d7b[_0x190b('0x31')]:_0x3730cc[_0x190b('0x30')];if(!_0x359b4a[_0x190b('0x2d')][_0x190b('0x34')](_0x190b('0x35'))){_0x536d7b['limit']=qs['limit'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x1f')]);_0x536d7b[_0x190b('0x1c')]=qs['offset'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x1c')]);}_0x536d7b[_0x190b('0x36')]=qs['sort'](_0x359b4a[_0x190b('0x2d')]['sort']);_0x536d7b['where']=qs[_0x190b('0x2e')](_[_0x190b('0x37')](_0x359b4a['query'],_0x3730cc[_0x190b('0x2e')]),_0x14be2c);if(_0x359b4a[_0x190b('0x2d')][_0x190b('0x38')]){_0x536d7b['where']=_[_0x190b('0x39')](_0x536d7b[_0x190b('0x3a')],{'$or':_['map'](_0x14be2c,function(_0x5d006d){if(_0x5d006d[_0x190b('0x3b')]!=='VIRTUAL'){var _0x46bdba={};_0x46bdba[_0x5d006d[_0x190b('0x25')]]={'$like':'%'+_0x359b4a[_0x190b('0x2d')][_0x190b('0x38')]+'%'};return _0x46bdba;}})});}_0x536d7b=_['merge']({},_0x536d7b,_0x359b4a[_0x190b('0x3c')]);var _0x5f118c={'where':_0x536d7b[_0x190b('0x3a')]};return db[_0x190b('0x3d')]['count'](_0x5f118c)[_0x190b('0x22')](function(_0x2a75d2){_0x4d5f3f[_0x190b('0x1e')]=_0x2a75d2;if(_0x359b4a['query'][_0x190b('0x3e')]){_0x536d7b['include']=[{'all':!![]}];}return db['UserProfileResource']['findAll'](_0x536d7b);})[_0x190b('0x22')](function(_0x3aef1d){_0x4d5f3f[_0x190b('0x3f')]=_0x3aef1d;return _0x4d5f3f;})[_0x190b('0x22')](respondWithFilteredResult(_0x494f3f,_0x536d7b))['catch'](handleError(_0x494f3f,null));};exports['show']=function(_0x4045b7,_0x492240){var _0x110891={'raw':![],'where':{'id':_0x4045b7['params']['id']}},_0x3d67f0={};_0x3d67f0[_0x190b('0x30')]=_[_0x190b('0x2c')](db[_0x190b('0x3d')]['rawAttributes']);_0x3d67f0[_0x190b('0x2d')]=_[_0x190b('0x2c')](_0x4045b7['query']);_0x3d67f0[_0x190b('0x2e')]=_['intersection'](_0x3d67f0[_0x190b('0x30')],_0x3d67f0[_0x190b('0x2d')]);_0x110891[_0x190b('0x31')]=_['intersection'](_0x3d67f0[_0x190b('0x30')],qs['fields'](_0x4045b7[_0x190b('0x2d')][_0x190b('0x32')]));_0x110891[_0x190b('0x31')]=_0x110891[_0x190b('0x31')][_0x190b('0x33')]?_0x110891[_0x190b('0x31')]:_0x3d67f0[_0x190b('0x30')];if(_0x4045b7['query'][_0x190b('0x3e')]){_0x110891[_0x190b('0x40')]=[{'all':!![]}];}_0x110891=_[_0x190b('0x39')]({},_0x110891,_0x4045b7['options']);return db[_0x190b('0x3d')][_0x190b('0x41')](_0x110891)[_0x190b('0x22')](handleEntityNotFound(_0x492240,null))[_0x190b('0x22')](respondWithResult(_0x492240,null))[_0x190b('0x42')](handleError(_0x492240,null));};exports['create']=function(_0x1f2262,_0xadc789){return db[_0x190b('0x3d')]['create'](_0x1f2262[_0x190b('0x43')],{})[_0x190b('0x22')](respondWithResult(_0xadc789,0xc9))[_0x190b('0x42')](handleError(_0xadc789,null));};exports['update']=function(_0x4cb561,_0x14958e){if(_0x4cb561[_0x190b('0x43')]['id']){delete _0x4cb561[_0x190b('0x43')]['id'];}return db[_0x190b('0x3d')][_0x190b('0x41')]({'where':{'id':_0x4cb561[_0x190b('0x44')]['id']}})['then'](handleEntityNotFound(_0x14958e,null))[_0x190b('0x22')](saveUpdates(_0x4cb561[_0x190b('0x43')],null))[_0x190b('0x22')](respondWithResult(_0x14958e,null))['catch'](handleError(_0x14958e,null));};exports[_0x190b('0x23')]=function(_0x38c135,_0x215ab6){return db['UserProfileResource'][_0x190b('0x41')]({'where':{'id':_0x38c135[_0x190b('0x44')]['id']}})[_0x190b('0x22')](handleEntityNotFound(_0x215ab6,null))[_0x190b('0x22')](removeEntity(_0x215ab6,null))[_0x190b('0x42')](handleError(_0x215ab6,null));};exports[_0x190b('0x45')]=function(_0x33cc78,_0x2ea1c8){return db[_0x190b('0x3d')][_0x190b('0x45')]()[_0x190b('0x22')](respondWithResult(_0x2ea1c8,null))['catch'](handleError(_0x2ea1c8,null));}; \ No newline at end of file +var _0x896e=['hasOwnProperty','nolimit','order','sort','where','merge','filter','UserProfileResource','includeAll','include','findAll','rows','catch','keys','length','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','destroy','then','end','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x896e,0x1e9));var _0xe896=function(_0x4baa0d,_0x522410){_0x4baa0d=_0x4baa0d-0x0;var _0x140c20=_0x896e[_0x4baa0d];return _0x140c20;};'use strict';var emlformat=require(_0xe896('0x0'));var rimraf=require(_0xe896('0x1'));var zipdir=require(_0xe896('0x2'));var jsonpatch=require(_0xe896('0x3'));var rp=require(_0xe896('0x4'));var moment=require(_0xe896('0x5'));var BPromise=require(_0xe896('0x6'));var Mustache=require(_0xe896('0x7'));var util=require(_0xe896('0x8'));var path=require(_0xe896('0x9'));var sox=require(_0xe896('0xa'));var csv=require(_0xe896('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe896('0xc'));var _=require(_0xe896('0xd'));var squel=require(_0xe896('0xe'));var crypto=require(_0xe896('0xf'));var jsforce=require(_0xe896('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xe896('0xb'));var querystring=require(_0xe896('0x11'));var Papa=require(_0xe896('0x12'));var Redis=require('ioredis');var authService=require(_0xe896('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe896('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe896('0x15'))(_0xe896('0x16'));var utils=require(_0xe896('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xe896('0x18'));var db=require(_0xe896('0x19'))['db'];function respondWithStatusCode(_0x3e8ac9,_0x580aac){_0x580aac=_0x580aac||0xcc;return function(_0x2aa522){if(_0x2aa522){return _0x3e8ac9[_0xe896('0x1a')](_0x580aac);}return _0x3e8ac9[_0xe896('0x1b')](_0x580aac)['end']();};}function respondWithResult(_0x2d0e46,_0x7dcf8a){_0x7dcf8a=_0x7dcf8a||0xc8;return function(_0x1e7ef8){if(_0x1e7ef8){return _0x2d0e46['status'](_0x7dcf8a)['json'](_0x1e7ef8);}};}function respondWithFilteredResult(_0x446ce2,_0x25606b){return function(_0x51e7b7){if(_0x51e7b7){var _0x5e78d6=typeof _0x25606b[_0xe896('0x1c')]===_0xe896('0x1d')&&typeof _0x25606b['limit']===_0xe896('0x1d');var _0x4e062a=_0x51e7b7[_0xe896('0x1e')];var _0x32f86d=_0x5e78d6?0x0:_0x25606b[_0xe896('0x1c')];var _0x5dc89d=_0x5e78d6?_0x51e7b7[_0xe896('0x1e')]:_0x25606b[_0xe896('0x1c')]+_0x25606b[_0xe896('0x1f')];var _0xbebbe1;if(_0x5dc89d>=_0x4e062a){_0x5dc89d=_0x4e062a;_0xbebbe1=0xc8;}else{_0xbebbe1=0xce;}_0x446ce2[_0xe896('0x1b')](_0xbebbe1);return _0x446ce2[_0xe896('0x20')](_0xe896('0x21'),_0x32f86d+'-'+_0x5dc89d+'/'+_0x4e062a)[_0xe896('0x22')](_0x51e7b7);}return null;};}function patchUpdates(_0x49547b){return function(_0x180d46){try{jsonpatch['apply'](_0x180d46,_0x49547b,!![]);}catch(_0x5d2c8d){return BPromise[_0xe896('0x23')](_0x5d2c8d);}return _0x180d46[_0xe896('0x24')]();};}function saveUpdates(_0x40502b,_0xeeec7c){return function(_0x498469){if(_0x498469){return _0x498469[_0xe896('0x25')](_0x40502b)['then'](function(_0x5001f7){return _0x5001f7;});}return null;};}function removeEntity(_0x45dd49,_0x41e689){return function(_0x1e952a){if(_0x1e952a){return _0x1e952a[_0xe896('0x26')]()[_0xe896('0x27')](function(){_0x45dd49[_0xe896('0x1b')](0xcc)[_0xe896('0x28')]();});}};}function handleEntityNotFound(_0x4b71cc,_0x390128){return function(_0x163a75){if(!_0x163a75){_0x4b71cc[_0xe896('0x1a')](0x194);}return _0x163a75;};}function handleError(_0x569d5f,_0x26635e){_0x26635e=_0x26635e||0x1f4;return function(_0xd50fe2){logger[_0xe896('0x29')](_0xd50fe2[_0xe896('0x2a')]);if(_0xd50fe2[_0xe896('0x2b')]){delete _0xd50fe2[_0xe896('0x2b')];}_0x569d5f['status'](_0x26635e)[_0xe896('0x2c')](_0xd50fe2);};}exports[_0xe896('0x2d')]=function(_0x201653,_0xbfb15b){var _0xace03f={},_0x5e0d9b={},_0x47c268={'count':0x0,'rows':[]};var _0x5c7dae=_['map'](db['UserProfileResource'][_0xe896('0x2e')],function(_0x29a18e){return{'name':_0x29a18e[_0xe896('0x2f')],'type':_0x29a18e[_0xe896('0x30')][_0xe896('0x31')]};});_0x5e0d9b[_0xe896('0x32')]=_[_0xe896('0x33')](_0x5c7dae,_0xe896('0x2b'));_0x5e0d9b['query']=_['keys'](_0x201653[_0xe896('0x34')]);_0x5e0d9b[_0xe896('0x35')]=_[_0xe896('0x36')](_0x5e0d9b[_0xe896('0x32')],_0x5e0d9b['query']);_0xace03f[_0xe896('0x37')]=_['intersection'](_0x5e0d9b['model'],qs[_0xe896('0x38')](_0x201653[_0xe896('0x34')][_0xe896('0x38')]));_0xace03f['attributes']=_0xace03f['attributes']['length']?_0xace03f[_0xe896('0x37')]:_0x5e0d9b[_0xe896('0x32')];if(!_0x201653[_0xe896('0x34')][_0xe896('0x39')](_0xe896('0x3a'))){_0xace03f['limit']=qs[_0xe896('0x1f')](_0x201653[_0xe896('0x34')][_0xe896('0x1f')]);_0xace03f[_0xe896('0x1c')]=qs[_0xe896('0x1c')](_0x201653[_0xe896('0x34')][_0xe896('0x1c')]);}_0xace03f[_0xe896('0x3b')]=qs['sort'](_0x201653[_0xe896('0x34')][_0xe896('0x3c')]);_0xace03f['where']=qs[_0xe896('0x35')](_['pick'](_0x201653[_0xe896('0x34')],_0x5e0d9b['filters']),_0x5c7dae);if(_0x201653[_0xe896('0x34')]['filter']){_0xace03f[_0xe896('0x3d')]=_[_0xe896('0x3e')](_0xace03f[_0xe896('0x3d')],{'$or':_[_0xe896('0x33')](_0x5c7dae,function(_0xeb9bbf){if(_0xeb9bbf['type']!=='VIRTUAL'){var _0x203aea={};_0x203aea[_0xeb9bbf[_0xe896('0x2b')]]={'$like':'%'+_0x201653[_0xe896('0x34')][_0xe896('0x3f')]+'%'};return _0x203aea;}})});}_0xace03f=_[_0xe896('0x3e')]({},_0xace03f,_0x201653['options']);var _0x5b8131={'where':_0xace03f[_0xe896('0x3d')]};return db[_0xe896('0x40')]['count'](_0x5b8131)['then'](function(_0x19d2fd){_0x47c268[_0xe896('0x1e')]=_0x19d2fd;if(_0x201653[_0xe896('0x34')][_0xe896('0x41')]){_0xace03f[_0xe896('0x42')]=[{'all':!![]}];}return db[_0xe896('0x40')][_0xe896('0x43')](_0xace03f);})[_0xe896('0x27')](function(_0x372c71){_0x47c268[_0xe896('0x44')]=_0x372c71;return _0x47c268;})[_0xe896('0x27')](respondWithFilteredResult(_0xbfb15b,_0xace03f))[_0xe896('0x45')](handleError(_0xbfb15b,null));};exports['show']=function(_0x1e5434,_0x143ad4){var _0x59b97f={'raw':![],'where':{'id':_0x1e5434['params']['id']}},_0x57366b={};_0x57366b[_0xe896('0x32')]=_[_0xe896('0x46')](db[_0xe896('0x40')]['rawAttributes']);_0x57366b[_0xe896('0x34')]=_[_0xe896('0x46')](_0x1e5434['query']);_0x57366b['filters']=_['intersection'](_0x57366b[_0xe896('0x32')],_0x57366b[_0xe896('0x34')]);_0x59b97f[_0xe896('0x37')]=_[_0xe896('0x36')](_0x57366b[_0xe896('0x32')],qs[_0xe896('0x38')](_0x1e5434['query'][_0xe896('0x38')]));_0x59b97f[_0xe896('0x37')]=_0x59b97f['attributes'][_0xe896('0x47')]?_0x59b97f[_0xe896('0x37')]:_0x57366b[_0xe896('0x32')];if(_0x1e5434[_0xe896('0x34')]['includeAll']){_0x59b97f[_0xe896('0x42')]=[{'all':!![]}];}_0x59b97f=_[_0xe896('0x3e')]({},_0x59b97f,_0x1e5434[_0xe896('0x48')]);return db[_0xe896('0x40')][_0xe896('0x49')](_0x59b97f)[_0xe896('0x27')](handleEntityNotFound(_0x143ad4,null))['then'](respondWithResult(_0x143ad4,null))[_0xe896('0x45')](handleError(_0x143ad4,null));};exports['create']=function(_0x234a22,_0x1c6ae1){return db[_0xe896('0x40')][_0xe896('0x4a')](_0x234a22[_0xe896('0x4b')],{})[_0xe896('0x27')](respondWithResult(_0x1c6ae1,0xc9))['catch'](handleError(_0x1c6ae1,null));};exports[_0xe896('0x25')]=function(_0x206ad3,_0x4818cd){if(_0x206ad3[_0xe896('0x4b')]['id']){delete _0x206ad3[_0xe896('0x4b')]['id'];}return db['UserProfileResource'][_0xe896('0x49')]({'where':{'id':_0x206ad3['params']['id']}})[_0xe896('0x27')](handleEntityNotFound(_0x4818cd,null))[_0xe896('0x27')](saveUpdates(_0x206ad3[_0xe896('0x4b')],null))[_0xe896('0x27')](respondWithResult(_0x4818cd,null))[_0xe896('0x45')](handleError(_0x4818cd,null));};exports['destroy']=function(_0x1fa3fd,_0x819c8a){return db[_0xe896('0x40')]['find']({'where':{'id':_0x1fa3fd[_0xe896('0x4c')]['id']}})['then'](handleEntityNotFound(_0x819c8a,null))['then'](removeEntity(_0x819c8a,null))[_0xe896('0x45')](handleError(_0x819c8a,null));};exports[_0xe896('0x4d')]=function(_0x57aed3,_0x343adb){return db[_0xe896('0x40')]['describe']()['then'](respondWithResult(_0x343adb,null))[_0xe896('0x45')](handleError(_0x343adb,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 82302b1..a3f514c 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 _0x75bd=['request-promise','path','rimraf','./userProfileResource.attributes','exports','define','user_profile_has_resources','compositeIndex','resourceId','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x75bd,0xdb));var _0xd75b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x75bd[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xd75b('0x0'));var util=require(_0xd75b('0x1'));var logger=require(_0xd75b('0x2'))(_0xd75b('0x3'));var moment=require(_0xd75b('0x4'));var BPromise=require(_0xd75b('0x5'));var rp=require(_0xd75b('0x6'));var fs=require('fs');var path=require(_0xd75b('0x7'));var rimraf=require(_0xd75b('0x8'));var config=require('../../config/environment');var attributes=require(_0xd75b('0x9'));module[_0xd75b('0xa')]=function(_0x2556e8,_0x133bf2){return _0x2556e8[_0xd75b('0xb')]('UserProfileResource',attributes,{'tableName':_0xd75b('0xc'),'paranoid':![],'indexes':[{'name':_0xd75b('0xd'),'fields':[_0xd75b('0xe'),'sectionId']}],'timestamps':!![]});}; \ No newline at end of file +var _0xac2f=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash'];(function(_0x3aabf5,_0x600efd){var _0x303a3c=function(_0x4a9f4a){while(--_0x4a9f4a){_0x3aabf5['push'](_0x3aabf5['shift']());}};_0x303a3c(++_0x600efd);}(_0xac2f,0x1a8));var _0xfac2=function(_0x173c9d,_0x5ae438){_0x173c9d=_0x173c9d-0x0;var _0x6c6961=_0xac2f[_0x173c9d];return _0x6c6961;};'use strict';var _=require(_0xfac2('0x0'));var util=require(_0xfac2('0x1'));var logger=require(_0xfac2('0x2'))(_0xfac2('0x3'));var moment=require(_0xfac2('0x4'));var BPromise=require(_0xfac2('0x5'));var rp=require(_0xfac2('0x6'));var fs=require('fs');var path=require(_0xfac2('0x7'));var rimraf=require(_0xfac2('0x8'));var config=require('../../config/environment');var attributes=require(_0xfac2('0x9'));module[_0xfac2('0xa')]=function(_0x52c362,_0x2b0c92){return _0x52c362[_0xfac2('0xb')](_0xfac2('0xc'),attributes,{'tableName':_0xfac2('0xd'),'paranoid':![],'indexes':[{'name':_0xfac2('0xe'),'fields':[_0xfac2('0xf'),_0xfac2('0x10')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 9e39692..41ed622 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 _0xdb21=['error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xeb26d1,_0x301de1){var _0x4a4e2e=function(_0xa3dad1){while(--_0xa3dad1){_0xeb26d1['push'](_0xeb26d1['shift']());}};_0x4a4e2e(++_0x301de1);}(_0xdb21,0xcd));var _0x1db2=function(_0x23733d,_0x56f0a1){_0x23733d=_0x23733d-0x0;var _0x4a9cc4=_0xdb21[_0x23733d];return _0x4a9cc4;};'use strict';var _=require(_0x1db2('0x0'));var util=require(_0x1db2('0x1'));var moment=require('moment');var BPromise=require(_0x1db2('0x2'));var rs=require(_0x1db2('0x3'));var fs=require('fs');var Redis=require(_0x1db2('0x4'));var db=require(_0x1db2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1db2('0x6'))(_0x1db2('0x7'));var config=require(_0x1db2('0x8'));var jayson=require(_0x1db2('0x9'));var client=jayson[_0x1db2('0xa')][_0x1db2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2091b4,_0x1d210b,_0x6285ab){return new BPromise(function(_0x55af3a,_0x32d875){return client[_0x1db2('0xc')](_0x2091b4,_0x6285ab)[_0x1db2('0xd')](function(_0x4c4834){logger[_0x1db2('0xe')](_0x1db2('0xf'),_0x1d210b,_0x1db2('0x10'));logger[_0x1db2('0x11')](_0x1db2('0x12'),_0x1d210b,_0x1db2('0x10'),JSON[_0x1db2('0x13')](_0x4c4834));if(_0x4c4834[_0x1db2('0x14')]){if(_0x4c4834['error'][_0x1db2('0x15')]===0x1f4){logger[_0x1db2('0x14')](_0x1db2('0xf'),_0x1d210b,_0x4c4834[_0x1db2('0x14')][_0x1db2('0x16')]);return _0x32d875(_0x4c4834[_0x1db2('0x14')][_0x1db2('0x16')]);}logger['error'](_0x1db2('0xf'),_0x1d210b,_0x4c4834[_0x1db2('0x14')][_0x1db2('0x16')]);return _0x55af3a(_0x4c4834[_0x1db2('0x14')][_0x1db2('0x16')]);}else{logger[_0x1db2('0xe')](_0x1db2('0xf'),_0x1d210b,_0x1db2('0x10'));_0x55af3a(_0x4c4834[_0x1db2('0x17')][_0x1db2('0x16')]);}})[_0x1db2('0x18')](function(_0xf3aec0){logger['error'](_0x1db2('0xf'),_0x1d210b,_0xf3aec0);_0x32d875(_0xf3aec0);});});} \ No newline at end of file +var _0x2229=['stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent'];(function(_0x30c87d,_0x52c8f5){var _0x2f5649=function(_0xfa768b){while(--_0xfa768b){_0x30c87d['push'](_0x30c87d['shift']());}};_0x2f5649(++_0x52c8f5);}(_0x2229,0xb5));var _0x9222=function(_0x2cdb4b,_0x4722de){_0x2cdb4b=_0x2cdb4b-0x0;var _0x3da57b=_0x2229[_0x2cdb4b];return _0x3da57b;};'use strict';var _=require(_0x9222('0x0'));var util=require('util');var moment=require(_0x9222('0x1'));var BPromise=require(_0x9222('0x2'));var rs=require(_0x9222('0x3'));var fs=require('fs');var Redis=require(_0x9222('0x4'));var db=require(_0x9222('0x5'))['db'];var utils=require(_0x9222('0x6'));var logger=require(_0x9222('0x7'))(_0x9222('0x8'));var config=require('../../config/environment');var jayson=require(_0x9222('0x9'));var client=jayson[_0x9222('0xa')][_0x9222('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54f9c0,_0x352120,_0x33dcf9){return new BPromise(function(_0xafef0,_0x536dee){return client[_0x9222('0xc')](_0x54f9c0,_0x33dcf9)[_0x9222('0xd')](function(_0x123b64){logger[_0x9222('0xe')](_0x9222('0xf'),_0x352120,_0x9222('0x10'));logger['debug']('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x352120,'request\x20sent',JSON[_0x9222('0x11')](_0x123b64));if(_0x123b64['error']){if(_0x123b64[_0x9222('0x12')][_0x9222('0x13')]===0x1f4){logger[_0x9222('0x12')]('UserProfileResource,\x20%s,\x20%s',_0x352120,_0x123b64['error'][_0x9222('0x14')]);return _0x536dee(_0x123b64[_0x9222('0x12')]['message']);}logger['error'](_0x9222('0xf'),_0x352120,_0x123b64[_0x9222('0x12')]['message']);return _0xafef0(_0x123b64[_0x9222('0x12')][_0x9222('0x14')]);}else{logger[_0x9222('0xe')]('UserProfileResource,\x20%s,\x20%s',_0x352120,_0x9222('0x10'));_0xafef0(_0x123b64['result'][_0x9222('0x14')]);}})[_0x9222('0x15')](function(_0x24b0ad){logger[_0x9222('0x12')](_0x9222('0xf'),_0x352120,_0x24b0ad);_0x536dee(_0x24b0ad);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 12b1a38..45b54dc 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 _0x7ec2=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfileSection.controller','get','isAuthenticated','/describe','describe','show','post','create','/:id','update'];(function(_0x2431d6,_0x25189a){var _0x4d0f9b=function(_0x52cd84){while(--_0x52cd84){_0x2431d6['push'](_0x2431d6['shift']());}};_0x4d0f9b(++_0x25189a);}(_0x7ec2,0x144));var _0x27ec=function(_0x430bfe,_0x4f8445){_0x430bfe=_0x430bfe-0x0;var _0x369244=_0x7ec2[_0x430bfe];return _0x369244;};'use strict';var multer=require(_0x27ec('0x0'));var util=require(_0x27ec('0x1'));var path=require(_0x27ec('0x2'));var timeout=require(_0x27ec('0x3'));var express=require(_0x27ec('0x4'));var router=express['Router']();var fs_extra=require(_0x27ec('0x5'));var auth=require(_0x27ec('0x6'));var interaction=require(_0x27ec('0x7'));var config=require('../../config/environment');var controller=require(_0x27ec('0x8'));router[_0x27ec('0x9')]('/',auth[_0x27ec('0xa')](),controller['index']);router[_0x27ec('0x9')](_0x27ec('0xb'),auth[_0x27ec('0xa')](),controller[_0x27ec('0xc')]);router[_0x27ec('0x9')]('/:id',auth[_0x27ec('0xa')](),controller[_0x27ec('0xd')]);router[_0x27ec('0xe')]('/',auth[_0x27ec('0xa')](),controller[_0x27ec('0xf')]);router['put'](_0x27ec('0x10'),auth['isAuthenticated'](),controller[_0x27ec('0x11')]);router['delete']('/:id',auth[_0x27ec('0xa')](),controller['destroy']);module[_0x27ec('0x12')]=router; \ No newline at end of file +var _0xbd66=['update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','show','post','create','put','/:id'];(function(_0xd2811e,_0x168a67){var _0x9a2a53=function(_0x14d24b){while(--_0x14d24b){_0xd2811e['push'](_0xd2811e['shift']());}};_0x9a2a53(++_0x168a67);}(_0xbd66,0x153));var _0x6bd6=function(_0x5faff0,_0x411206){_0x5faff0=_0x5faff0-0x0;var _0x2d535b=_0xbd66[_0x5faff0];return _0x2d535b;};'use strict';var multer=require(_0x6bd6('0x0'));var util=require(_0x6bd6('0x1'));var path=require(_0x6bd6('0x2'));var timeout=require(_0x6bd6('0x3'));var express=require(_0x6bd6('0x4'));var router=express['Router']();var fs_extra=require(_0x6bd6('0x5'));var auth=require(_0x6bd6('0x6'));var interaction=require(_0x6bd6('0x7'));var config=require(_0x6bd6('0x8'));var controller=require('./userProfileSection.controller');router['get']('/',auth[_0x6bd6('0x9')](),controller[_0x6bd6('0xa')]);router[_0x6bd6('0xb')](_0x6bd6('0xc'),auth[_0x6bd6('0x9')](),controller['describe']);router[_0x6bd6('0xb')]('/:id',auth[_0x6bd6('0x9')](),controller[_0x6bd6('0xd')]);router[_0x6bd6('0xe')]('/',auth[_0x6bd6('0x9')](),controller[_0x6bd6('0xf')]);router[_0x6bd6('0x10')](_0x6bd6('0x11'),auth[_0x6bd6('0x9')](),controller[_0x6bd6('0x12')]);router[_0x6bd6('0x13')](_0x6bd6('0x11'),auth[_0x6bd6('0x9')](),controller['destroy']);module[_0x6bd6('0x14')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index a13dba2..525049e 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 _0xe1e3=['getDataValue','split','sequelize','exports','STRING','BOOLEAN','setDataValue','crudPermissions','join'];(function(_0x4a84bb,_0x385d0c){var _0x57857d=function(_0x2318c4){while(--_0x2318c4){_0x4a84bb['push'](_0x4a84bb['shift']());}};_0x57857d(++_0x385d0c);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x32f86f,_0x4c2fba){_0x32f86f=_0x32f86f-0x0;var _0x55c80d=_0xe1e3[_0x32f86f];return _0x55c80d;};'use strict';var Sequelize=require(_0x3e1e('0x0'));module[_0x3e1e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x3e1e('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x3e1e('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x3bacc){this[_0x3e1e('0x4')](_0x3e1e('0x5'),_0x3bacc?_0x3bacc[_0x3e1e('0x6')](''):[]);},'get':function(){return this[_0x3e1e('0x7')](_0x3e1e('0x5'))?this['getDataValue'](_0x3e1e('0x5'))[_0x3e1e('0x8')](''):[];}}}; \ No newline at end of file +var _0x7d25=['INTEGER','BOOLEAN','getDataValue','crudPermissions','split','exports','STRING'];(function(_0x52a2be,_0x4bd252){var _0x246f1d=function(_0x410395){while(--_0x410395){_0x52a2be['push'](_0x52a2be['shift']());}};_0x246f1d(++_0x4bd252);}(_0x7d25,0x8a));var _0x57d2=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x7d25[_0x599f41];return _0x2e4d58;};'use strict';var Sequelize=require('sequelize');module[_0x57d2('0x0')]={'name':{'type':Sequelize[_0x57d2('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x57d2('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x57d2('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0x57d2('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x57d2('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x57d2('0x1')],'set':function(_0x5c1baa){this['setDataValue']('crudPermissions',_0x5c1baa?_0x5c1baa['join'](''):[]);},'get':function(){return this[_0x57d2('0x4')]('crudPermissions')?this[_0x57d2('0x4')](_0x57d2('0x5'))[_0x57d2('0x6')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 344eb14..9ce83d4 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 _0x116f=['fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','end','sendStatus','error','stack','name','send','index','map','UserProfileSection','rawAttributes','type','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','length','find','create','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path'];(function(_0x21f3b2,_0xfb90ae){var _0x45f021=function(_0x56e6ff){while(--_0x56e6ff){_0x21f3b2['push'](_0x21f3b2['shift']());}};_0x45f021(++_0xfb90ae);}(_0x116f,0xdc));var _0xf116=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x116f[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xf116('0x0'));var rimraf=require(_0xf116('0x1'));var zipdir=require(_0xf116('0x2'));var jsonpatch=require(_0xf116('0x3'));var rp=require(_0xf116('0x4'));var moment=require(_0xf116('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf116('0x6'));var path=require(_0xf116('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf116('0x8'));var _=require(_0xf116('0x9'));var squel=require('squel');var crypto=require(_0xf116('0xa'));var jsforce=require(_0xf116('0xb'));var deskjs=require(_0xf116('0xc'));var toCsv=require(_0xf116('0xd'));var querystring=require(_0xf116('0xe'));var Papa=require(_0xf116('0xf'));var Redis=require('ioredis');var authService=require(_0xf116('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf116('0x11'));var logger=require(_0xf116('0x12'))(_0xf116('0x13'));var utils=require(_0xf116('0x14'));var config=require(_0xf116('0x15'));var licenseUtil=require(_0xf116('0x16'));var db=require(_0xf116('0x17'))['db'];function respondWithStatusCode(_0xa1e4ac,_0x69e33){_0x69e33=_0x69e33||0xcc;return function(_0x3ced25){if(_0x3ced25){return _0xa1e4ac['sendStatus'](_0x69e33);}return _0xa1e4ac[_0xf116('0x18')](_0x69e33)['end']();};}function respondWithResult(_0x14d46e,_0x53721f){_0x53721f=_0x53721f||0xc8;return function(_0x2f5f30){if(_0x2f5f30){return _0x14d46e['status'](_0x53721f)[_0xf116('0x19')](_0x2f5f30);}};}function respondWithFilteredResult(_0x2fca79,_0x150c51){return function(_0x39b9b5){if(_0x39b9b5){var _0x5b504e=typeof _0x150c51[_0xf116('0x1a')]===_0xf116('0x1b')&&typeof _0x150c51[_0xf116('0x1c')]===_0xf116('0x1b');var _0x1cb0d7=_0x39b9b5[_0xf116('0x1d')];var _0x4e4d6a=_0x5b504e?0x0:_0x150c51[_0xf116('0x1a')];var _0x54125d=_0x5b504e?_0x39b9b5[_0xf116('0x1d')]:_0x150c51[_0xf116('0x1a')]+_0x150c51['limit'];var _0x41e925;if(_0x54125d>=_0x1cb0d7){_0x54125d=_0x1cb0d7;_0x41e925=0xc8;}else{_0x41e925=0xce;}_0x2fca79[_0xf116('0x18')](_0x41e925);return _0x2fca79[_0xf116('0x1e')](_0xf116('0x1f'),_0x4e4d6a+'-'+_0x54125d+'/'+_0x1cb0d7)[_0xf116('0x19')](_0x39b9b5);}return null;};}function patchUpdates(_0x241853){return function(_0x4a1029){try{jsonpatch[_0xf116('0x20')](_0x4a1029,_0x241853,!![]);}catch(_0x3d42e9){return BPromise['reject'](_0x3d42e9);}return _0x4a1029[_0xf116('0x21')]();};}function saveUpdates(_0x29299d,_0x362410){return function(_0x69f9da){if(_0x69f9da){return _0x69f9da['update'](_0x29299d)[_0xf116('0x22')](function(_0x2714a6){return _0x2714a6;});}return null;};}function removeEntity(_0x44f320,_0x295354){return function(_0x433e9b){if(_0x433e9b){return _0x433e9b[_0xf116('0x23')]()[_0xf116('0x22')](function(){_0x44f320[_0xf116('0x18')](0xcc)[_0xf116('0x24')]();});}};}function handleEntityNotFound(_0x4cb34a,_0x5b188d){return function(_0x5435ce){if(!_0x5435ce){_0x4cb34a[_0xf116('0x25')](0x194);}return _0x5435ce;};}function handleError(_0x1d53a4,_0x37332d){_0x37332d=_0x37332d||0x1f4;return function(_0x3805a0){logger[_0xf116('0x26')](_0x3805a0[_0xf116('0x27')]);if(_0x3805a0['name']){delete _0x3805a0[_0xf116('0x28')];}_0x1d53a4[_0xf116('0x18')](_0x37332d)[_0xf116('0x29')](_0x3805a0);};}exports[_0xf116('0x2a')]=function(_0x2d8540,_0x15d33d){var _0x32c4a2={},_0x401364={},_0x5ebab6={'count':0x0,'rows':[]};var _0x55e92d=_[_0xf116('0x2b')](db[_0xf116('0x2c')][_0xf116('0x2d')],function(_0x39dcbc){return{'name':_0x39dcbc['fieldName'],'type':_0x39dcbc[_0xf116('0x2e')]['key']};});_0x401364[_0xf116('0x2f')]=_['map'](_0x55e92d,_0xf116('0x28'));_0x401364[_0xf116('0x30')]=_['keys'](_0x2d8540['query']);_0x401364[_0xf116('0x31')]=_['intersection'](_0x401364[_0xf116('0x2f')],_0x401364[_0xf116('0x30')]);_0x32c4a2['attributes']=_[_0xf116('0x32')](_0x401364[_0xf116('0x2f')],qs[_0xf116('0x33')](_0x2d8540[_0xf116('0x30')][_0xf116('0x33')]));_0x32c4a2[_0xf116('0x34')]=_0x32c4a2['attributes']['length']?_0x32c4a2[_0xf116('0x34')]:_0x401364['model'];if(!_0x2d8540[_0xf116('0x30')][_0xf116('0x35')](_0xf116('0x36'))){_0x32c4a2[_0xf116('0x1c')]=qs['limit'](_0x2d8540[_0xf116('0x30')][_0xf116('0x1c')]);_0x32c4a2[_0xf116('0x1a')]=qs[_0xf116('0x1a')](_0x2d8540[_0xf116('0x30')][_0xf116('0x1a')]);}_0x32c4a2[_0xf116('0x37')]=qs['sort'](_0x2d8540[_0xf116('0x30')][_0xf116('0x38')]);_0x32c4a2[_0xf116('0x39')]=qs[_0xf116('0x31')](_[_0xf116('0x3a')](_0x2d8540[_0xf116('0x30')],_0x401364[_0xf116('0x31')]),_0x55e92d);if(_0x2d8540[_0xf116('0x30')][_0xf116('0x3b')]){_0x32c4a2[_0xf116('0x39')]=_[_0xf116('0x3c')](_0x32c4a2['where'],{'$or':_['map'](_0x55e92d,function(_0x317882){if(_0x317882[_0xf116('0x2e')]!==_0xf116('0x3d')){var _0x161d36={};_0x161d36[_0x317882[_0xf116('0x28')]]={'$like':'%'+_0x2d8540[_0xf116('0x30')][_0xf116('0x3b')]+'%'};return _0x161d36;}})});}_0x32c4a2=_['merge']({},_0x32c4a2,_0x2d8540[_0xf116('0x3e')]);var _0x6d40c7={'where':_0x32c4a2[_0xf116('0x39')]};return db[_0xf116('0x2c')][_0xf116('0x1d')](_0x6d40c7)[_0xf116('0x22')](function(_0x177393){_0x5ebab6[_0xf116('0x1d')]=_0x177393;if(_0x2d8540[_0xf116('0x30')][_0xf116('0x3f')]){_0x32c4a2[_0xf116('0x40')]=[{'all':!![]}];}return db[_0xf116('0x2c')][_0xf116('0x41')](_0x32c4a2);})[_0xf116('0x22')](function(_0x2b11fc){_0x5ebab6['rows']=_0x2b11fc;return _0x5ebab6;})['then'](respondWithFilteredResult(_0x15d33d,_0x32c4a2))[_0xf116('0x42')](handleError(_0x15d33d,null));};exports[_0xf116('0x43')]=function(_0xed50be,_0x4b98bf){var _0x1b1c50={'raw':![],'where':{'id':_0xed50be[_0xf116('0x44')]['id']}},_0x434375={};_0x434375['model']=_[_0xf116('0x45')](db[_0xf116('0x2c')][_0xf116('0x2d')]);_0x434375['query']=_[_0xf116('0x45')](_0xed50be[_0xf116('0x30')]);_0x434375[_0xf116('0x31')]=_[_0xf116('0x32')](_0x434375['model'],_0x434375['query']);_0x1b1c50[_0xf116('0x34')]=_['intersection'](_0x434375[_0xf116('0x2f')],qs[_0xf116('0x33')](_0xed50be[_0xf116('0x30')]['fields']));_0x1b1c50['attributes']=_0x1b1c50[_0xf116('0x34')][_0xf116('0x46')]?_0x1b1c50['attributes']:_0x434375['model'];if(_0xed50be[_0xf116('0x30')][_0xf116('0x3f')]){_0x1b1c50[_0xf116('0x40')]=[{'all':!![]}];}_0x1b1c50=_[_0xf116('0x3c')]({},_0x1b1c50,_0xed50be[_0xf116('0x3e')]);return db[_0xf116('0x2c')][_0xf116('0x47')](_0x1b1c50)[_0xf116('0x22')](handleEntityNotFound(_0x4b98bf,null))[_0xf116('0x22')](respondWithResult(_0x4b98bf,null))[_0xf116('0x42')](handleError(_0x4b98bf,null));};exports[_0xf116('0x48')]=function(_0x5ea71d,_0x4be6eb){return db[_0xf116('0x2c')][_0xf116('0x48')](_0x5ea71d['body'],{})[_0xf116('0x22')](respondWithResult(_0x4be6eb,0xc9))[_0xf116('0x42')](handleError(_0x4be6eb,null));};exports[_0xf116('0x49')]=function(_0x58553d,_0x289bc1){if(_0x58553d[_0xf116('0x4a')]['id']){delete _0x58553d[_0xf116('0x4a')]['id'];}return db['UserProfileSection'][_0xf116('0x47')]({'where':{'id':_0x58553d[_0xf116('0x44')]['id']}})['then'](handleEntityNotFound(_0x289bc1,null))[_0xf116('0x22')](saveUpdates(_0x58553d[_0xf116('0x4a')],null))[_0xf116('0x22')](respondWithResult(_0x289bc1,null))['catch'](handleError(_0x289bc1,null));};exports[_0xf116('0x23')]=function(_0x293a15,_0x1131bd){return db['UserProfileSection'][_0xf116('0x47')]({'where':{'id':_0x293a15[_0xf116('0x44')]['id']}})[_0xf116('0x22')](handleEntityNotFound(_0x1131bd,null))[_0xf116('0x22')](removeEntity(_0x1131bd,null))[_0xf116('0x42')](handleError(_0x1131bd,null));};exports[_0xf116('0x4b')]=function(_0x28e458,_0x4f8b9e){return db['UserProfileSection'][_0xf116('0x4b')]()['then'](respondWithResult(_0x4f8b9e,null))[_0xf116('0x42')](handleError(_0x4f8b9e,null));}; \ No newline at end of file +var _0x5b83=['json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','sendStatus','stack','name','send','map','UserProfileSection','rawAttributes','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','type','VIRTUAL','filter','includeAll','include','catch','show','params','options','find','body','update','describe','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','status','end'];(function(_0x358b2d,_0x2fa564){var _0x480999=function(_0x50cd10){while(--_0x50cd10){_0x358b2d['push'](_0x358b2d['shift']());}};_0x480999(++_0x2fa564);}(_0x5b83,0x19c));var _0x35b8=function(_0x513fbd,_0x37f007){_0x513fbd=_0x513fbd-0x0;var _0x54579d=_0x5b83[_0x513fbd];return _0x54579d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x35b8('0x0'));var jsonpatch=require(_0x35b8('0x1'));var rp=require(_0x35b8('0x2'));var moment=require(_0x35b8('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x35b8('0x4'));var path=require(_0x35b8('0x5'));var sox=require(_0x35b8('0x6'));var csv=require(_0x35b8('0x7'));var ejs=require(_0x35b8('0x8'));var fs=require('fs');var fs_extra=require(_0x35b8('0x9'));var _=require(_0x35b8('0xa'));var squel=require('squel');var crypto=require(_0x35b8('0xb'));var jsforce=require(_0x35b8('0xc'));var deskjs=require(_0x35b8('0xd'));var toCsv=require(_0x35b8('0x7'));var querystring=require(_0x35b8('0xe'));var Papa=require(_0x35b8('0xf'));var Redis=require(_0x35b8('0x10'));var authService=require(_0x35b8('0x11'));var qs=require(_0x35b8('0x12'));var as=require(_0x35b8('0x13'));var hardwareService=require(_0x35b8('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x35b8('0x15'));var config=require(_0x35b8('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x35b8('0x17'))['db'];function respondWithStatusCode(_0x2eb551,_0x29dba9){_0x29dba9=_0x29dba9||0xcc;return function(_0x84d33f){if(_0x84d33f){return _0x2eb551['sendStatus'](_0x29dba9);}return _0x2eb551[_0x35b8('0x18')](_0x29dba9)[_0x35b8('0x19')]();};}function respondWithResult(_0x5d4894,_0x102762){_0x102762=_0x102762||0xc8;return function(_0x4f8e9d){if(_0x4f8e9d){return _0x5d4894[_0x35b8('0x18')](_0x102762)[_0x35b8('0x1a')](_0x4f8e9d);}};}function respondWithFilteredResult(_0x73ac86,_0x2b7d1f){return function(_0xc5975f){if(_0xc5975f){var _0x421da9=typeof _0x2b7d1f[_0x35b8('0x1b')]===_0x35b8('0x1c')&&typeof _0x2b7d1f[_0x35b8('0x1d')]===_0x35b8('0x1c');var _0x50ee44=_0xc5975f['count'];var _0x3833ac=_0x421da9?0x0:_0x2b7d1f[_0x35b8('0x1b')];var _0x13d5ef=_0x421da9?_0xc5975f[_0x35b8('0x1e')]:_0x2b7d1f[_0x35b8('0x1b')]+_0x2b7d1f[_0x35b8('0x1d')];var _0x1075cd;if(_0x13d5ef>=_0x50ee44){_0x13d5ef=_0x50ee44;_0x1075cd=0xc8;}else{_0x1075cd=0xce;}_0x73ac86[_0x35b8('0x18')](_0x1075cd);return _0x73ac86[_0x35b8('0x1f')](_0x35b8('0x20'),_0x3833ac+'-'+_0x13d5ef+'/'+_0x50ee44)[_0x35b8('0x1a')](_0xc5975f);}return null;};}function patchUpdates(_0x586769){return function(_0x3c790f){try{jsonpatch[_0x35b8('0x21')](_0x3c790f,_0x586769,!![]);}catch(_0x30530f){return BPromise[_0x35b8('0x22')](_0x30530f);}return _0x3c790f[_0x35b8('0x23')]();};}function saveUpdates(_0x32ee70,_0x4074d0){return function(_0x38cd94){if(_0x38cd94){return _0x38cd94['update'](_0x32ee70)[_0x35b8('0x24')](function(_0x253f44){return _0x253f44;});}return null;};}function removeEntity(_0x451519,_0x374b40){return function(_0x437388){if(_0x437388){return _0x437388[_0x35b8('0x25')]()[_0x35b8('0x24')](function(){_0x451519[_0x35b8('0x18')](0xcc)[_0x35b8('0x19')]();});}};}function handleEntityNotFound(_0x376c4e,_0x6af2c8){return function(_0x5787ce){if(!_0x5787ce){_0x376c4e[_0x35b8('0x26')](0x194);}return _0x5787ce;};}function handleError(_0x3d5fc4,_0x540ef7){_0x540ef7=_0x540ef7||0x1f4;return function(_0x231dcd){logger['error'](_0x231dcd[_0x35b8('0x27')]);if(_0x231dcd[_0x35b8('0x28')]){delete _0x231dcd['name'];}_0x3d5fc4[_0x35b8('0x18')](_0x540ef7)[_0x35b8('0x29')](_0x231dcd);};}exports['index']=function(_0x30e973,_0x57d9ec){var _0x1e1ca7={},_0x1ca782={},_0xff5e8c={'count':0x0,'rows':[]};var _0x4b588c=_[_0x35b8('0x2a')](db[_0x35b8('0x2b')][_0x35b8('0x2c')],function(_0x527399){return{'name':_0x527399['fieldName'],'type':_0x527399['type'][_0x35b8('0x2d')]};});_0x1ca782['model']=_['map'](_0x4b588c,_0x35b8('0x28'));_0x1ca782[_0x35b8('0x2e')]=_[_0x35b8('0x2f')](_0x30e973[_0x35b8('0x2e')]);_0x1ca782['filters']=_[_0x35b8('0x30')](_0x1ca782[_0x35b8('0x31')],_0x1ca782[_0x35b8('0x2e')]);_0x1e1ca7[_0x35b8('0x32')]=_[_0x35b8('0x30')](_0x1ca782[_0x35b8('0x31')],qs['fields'](_0x30e973[_0x35b8('0x2e')][_0x35b8('0x33')]));_0x1e1ca7['attributes']=_0x1e1ca7['attributes'][_0x35b8('0x34')]?_0x1e1ca7[_0x35b8('0x32')]:_0x1ca782['model'];if(!_0x30e973['query'][_0x35b8('0x35')](_0x35b8('0x36'))){_0x1e1ca7[_0x35b8('0x1d')]=qs[_0x35b8('0x1d')](_0x30e973['query']['limit']);_0x1e1ca7['offset']=qs[_0x35b8('0x1b')](_0x30e973[_0x35b8('0x2e')]['offset']);}_0x1e1ca7['order']=qs[_0x35b8('0x37')](_0x30e973[_0x35b8('0x2e')][_0x35b8('0x37')]);_0x1e1ca7[_0x35b8('0x38')]=qs[_0x35b8('0x39')](_[_0x35b8('0x3a')](_0x30e973['query'],_0x1ca782['filters']),_0x4b588c);if(_0x30e973['query']['filter']){_0x1e1ca7[_0x35b8('0x38')]=_[_0x35b8('0x3b')](_0x1e1ca7[_0x35b8('0x38')],{'$or':_[_0x35b8('0x2a')](_0x4b588c,function(_0x15c2a3){if(_0x15c2a3[_0x35b8('0x3c')]!==_0x35b8('0x3d')){var _0x390c9e={};_0x390c9e[_0x15c2a3[_0x35b8('0x28')]]={'$like':'%'+_0x30e973[_0x35b8('0x2e')][_0x35b8('0x3e')]+'%'};return _0x390c9e;}})});}_0x1e1ca7=_['merge']({},_0x1e1ca7,_0x30e973['options']);var _0x80c0df={'where':_0x1e1ca7['where']};return db[_0x35b8('0x2b')][_0x35b8('0x1e')](_0x80c0df)['then'](function(_0x1704f1){_0xff5e8c[_0x35b8('0x1e')]=_0x1704f1;if(_0x30e973[_0x35b8('0x2e')][_0x35b8('0x3f')]){_0x1e1ca7[_0x35b8('0x40')]=[{'all':!![]}];}return db[_0x35b8('0x2b')]['findAll'](_0x1e1ca7);})['then'](function(_0x23ff78){_0xff5e8c['rows']=_0x23ff78;return _0xff5e8c;})[_0x35b8('0x24')](respondWithFilteredResult(_0x57d9ec,_0x1e1ca7))[_0x35b8('0x41')](handleError(_0x57d9ec,null));};exports[_0x35b8('0x42')]=function(_0x5a4801,_0x5dd364){var _0xb17170={'raw':![],'where':{'id':_0x5a4801[_0x35b8('0x43')]['id']}},_0x10b9ed={};_0x10b9ed[_0x35b8('0x31')]=_[_0x35b8('0x2f')](db['UserProfileSection']['rawAttributes']);_0x10b9ed[_0x35b8('0x2e')]=_[_0x35b8('0x2f')](_0x5a4801['query']);_0x10b9ed[_0x35b8('0x39')]=_[_0x35b8('0x30')](_0x10b9ed[_0x35b8('0x31')],_0x10b9ed[_0x35b8('0x2e')]);_0xb17170['attributes']=_['intersection'](_0x10b9ed[_0x35b8('0x31')],qs[_0x35b8('0x33')](_0x5a4801[_0x35b8('0x2e')][_0x35b8('0x33')]));_0xb17170['attributes']=_0xb17170['attributes'][_0x35b8('0x34')]?_0xb17170[_0x35b8('0x32')]:_0x10b9ed[_0x35b8('0x31')];if(_0x5a4801[_0x35b8('0x2e')][_0x35b8('0x3f')]){_0xb17170[_0x35b8('0x40')]=[{'all':!![]}];}_0xb17170=_[_0x35b8('0x3b')]({},_0xb17170,_0x5a4801[_0x35b8('0x44')]);return db[_0x35b8('0x2b')][_0x35b8('0x45')](_0xb17170)['then'](handleEntityNotFound(_0x5dd364,null))[_0x35b8('0x24')](respondWithResult(_0x5dd364,null))[_0x35b8('0x41')](handleError(_0x5dd364,null));};exports['create']=function(_0x367dcf,_0x182f5b){return db[_0x35b8('0x2b')]['create'](_0x367dcf[_0x35b8('0x46')],{})[_0x35b8('0x24')](respondWithResult(_0x182f5b,0xc9))[_0x35b8('0x41')](handleError(_0x182f5b,null));};exports[_0x35b8('0x47')]=function(_0x20c7b7,_0x2c60e8){if(_0x20c7b7[_0x35b8('0x46')]['id']){delete _0x20c7b7[_0x35b8('0x46')]['id'];}return db[_0x35b8('0x2b')][_0x35b8('0x45')]({'where':{'id':_0x20c7b7[_0x35b8('0x43')]['id']}})[_0x35b8('0x24')](handleEntityNotFound(_0x2c60e8,null))[_0x35b8('0x24')](saveUpdates(_0x20c7b7['body'],null))[_0x35b8('0x24')](respondWithResult(_0x2c60e8,null))[_0x35b8('0x41')](handleError(_0x2c60e8,null));};exports[_0x35b8('0x25')]=function(_0x2c2525,_0x52542f){return db[_0x35b8('0x2b')][_0x35b8('0x45')]({'where':{'id':_0x2c2525['params']['id']}})[_0x35b8('0x24')](handleEntityNotFound(_0x52542f,null))[_0x35b8('0x24')](removeEntity(_0x52542f,null))['catch'](handleError(_0x52542f,null));};exports['describe']=function(_0x4cb245,_0xe10023){return db[_0x35b8('0x2b')][_0x35b8('0x48')]()['then'](respondWithResult(_0xe10023,null))[_0x35b8('0x41')](handleError(_0xe10023,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index a7c0a45..73efa43 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 _0x6aba=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','util'];(function(_0x2870f9,_0x306749){var _0x4c1855=function(_0x5b9741){while(--_0x5b9741){_0x2870f9['push'](_0x2870f9['shift']());}};_0x4c1855(++_0x306749);}(_0x6aba,0x83));var _0xa6ab=function(_0x17a82e,_0xb3d733){_0x17a82e=_0x17a82e-0x0;var _0x81a59a=_0x6aba[_0x17a82e];return _0x81a59a;};'use strict';var _=require('lodash');var util=require(_0xa6ab('0x0'));var logger=require(_0xa6ab('0x1'))(_0xa6ab('0x2'));var moment=require(_0xa6ab('0x3'));var BPromise=require('bluebird');var rp=require(_0xa6ab('0x4'));var fs=require('fs');var path=require(_0xa6ab('0x5'));var rimraf=require(_0xa6ab('0x6'));var config=require(_0xa6ab('0x7'));var attributes=require(_0xa6ab('0x8'));module[_0xa6ab('0x9')]=function(_0x333959,_0xc328d4){return _0x333959[_0xa6ab('0xa')](_0xa6ab('0xb'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':'compositeIndex','fields':['sectionId','userProfileId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x4c71=['bluebird','rimraf','../../config/environment','define','user_profile_has_sections','compositeIndex','lodash','util','../../config/logger'];(function(_0x4cffd8,_0x3db38e){var _0x3caec7=function(_0x2703c8){while(--_0x2703c8){_0x4cffd8['push'](_0x4cffd8['shift']());}};_0x3caec7(++_0x3db38e);}(_0x4c71,0x1d1));var _0x14c7=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x4c71[_0x5f1391];return _0x50ebe3;};'use strict';var _=require(_0x14c7('0x0'));var util=require(_0x14c7('0x1'));var logger=require(_0x14c7('0x2'))('api');var moment=require('moment');var BPromise=require(_0x14c7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x14c7('0x4'));var config=require(_0x14c7('0x5'));var attributes=require('./userProfileSection.attributes');module['exports']=function(_0x2d422e,_0x39505d){return _0x2d422e[_0x14c7('0x6')]('UserProfileSection',attributes,{'tableName':_0x14c7('0x7'),'paranoid':![],'indexes':[{'name':_0x14c7('0x8'),'fields':['sectionId','userProfileId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 0ddcc1b..c1b66b1 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 _0x46cf=['code','message','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','request','then','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x223975,_0x105a5a){var _0x2fda57=function(_0x429c6d){while(--_0x429c6d){_0x223975['push'](_0x223975['shift']());}};_0x2fda57(++_0x105a5a);}(_0x46cf,0x17e));var _0xf46c=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x46cf[_0x2070da];return _0x4f9fe1;};'use strict';var _=require(_0xf46c('0x0'));var util=require(_0xf46c('0x1'));var moment=require(_0xf46c('0x2'));var BPromise=require('bluebird');var rs=require(_0xf46c('0x3'));var fs=require('fs');var Redis=require(_0xf46c('0x4'));var db=require(_0xf46c('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xf46c('0x6'));var jayson=require(_0xf46c('0x7'));var client=jayson[_0xf46c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4128a6,_0x40ce97,_0x31c975){return new BPromise(function(_0x4afb4f,_0x33e480){return client[_0xf46c('0x9')](_0x4128a6,_0x31c975)[_0xf46c('0xa')](function(_0x22b804){logger['info'](_0xf46c('0xb'),_0x40ce97,_0xf46c('0xc'));logger[_0xf46c('0xd')](_0xf46c('0xe'),_0x40ce97,_0xf46c('0xc'),JSON[_0xf46c('0xf')](_0x22b804));if(_0x22b804['error']){if(_0x22b804[_0xf46c('0x10')][_0xf46c('0x11')]===0x1f4){logger[_0xf46c('0x10')](_0xf46c('0xb'),_0x40ce97,_0x22b804['error'][_0xf46c('0x12')]);return _0x33e480(_0x22b804[_0xf46c('0x10')][_0xf46c('0x12')]);}logger[_0xf46c('0x10')](_0xf46c('0xb'),_0x40ce97,_0x22b804[_0xf46c('0x10')][_0xf46c('0x12')]);return _0x4afb4f(_0x22b804[_0xf46c('0x10')]['message']);}else{logger[_0xf46c('0x13')](_0xf46c('0xb'),_0x40ce97,_0xf46c('0xc'));_0x4afb4f(_0x22b804['result']['message']);}})[_0xf46c('0x14')](function(_0x2fc2ac){logger['error'](_0xf46c('0xb'),_0x40ce97,_0x2fc2ac);_0x33e480(_0x2fc2ac);});});} \ No newline at end of file +var _0x1c45=['request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','UserProfileSection,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x1c45,0x8c));var _0x51c4=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x1c45[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x51c4('0x0'));var util=require(_0x51c4('0x1'));var moment=require(_0x51c4('0x2'));var BPromise=require(_0x51c4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x51c4('0x4'));var logger=require(_0x51c4('0x5'))(_0x51c4('0x6'));var config=require(_0x51c4('0x7'));var jayson=require(_0x51c4('0x8'));var client=jayson[_0x51c4('0x9')][_0x51c4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x45a92e,_0x338827,_0x252081){return new BPromise(function(_0x10ad60,_0x4dc8bd){return client[_0x51c4('0xb')](_0x45a92e,_0x252081)[_0x51c4('0xc')](function(_0x292a80){logger[_0x51c4('0xd')]('UserProfileSection,\x20%s,\x20%s',_0x338827,_0x51c4('0xe'));logger['debug'](_0x51c4('0xf'),_0x338827,'request\x20sent',JSON[_0x51c4('0x10')](_0x292a80));if(_0x292a80['error']){if(_0x292a80[_0x51c4('0x11')]['code']===0x1f4){logger['error'](_0x51c4('0x12'),_0x338827,_0x292a80[_0x51c4('0x11')][_0x51c4('0x13')]);return _0x4dc8bd(_0x292a80[_0x51c4('0x11')][_0x51c4('0x13')]);}logger[_0x51c4('0x11')](_0x51c4('0x12'),_0x338827,_0x292a80[_0x51c4('0x11')]['message']);return _0x10ad60(_0x292a80[_0x51c4('0x11')][_0x51c4('0x13')]);}else{logger[_0x51c4('0xd')](_0x51c4('0x12'),_0x338827,'request\x20sent');_0x10ad60(_0x292a80[_0x51c4('0x14')][_0x51c4('0x13')]);}})[_0x51c4('0x15')](function(_0x4ef4bd){logger['error'](_0x51c4('0x12'),_0x338827,_0x4ef4bd);_0x4dc8bd(_0x4ef4bd);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 310cc15..a5ccc7b 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x316618,_0x4c074a){var _0x4e4390=function(_0x3603b7){while(--_0x3603b7){_0x316618['push'](_0x316618['shift']());}};_0x4e4390(++_0x4c074a);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x13594e,_0x6f0ed0){_0x13594e=_0x13594e-0x0;var _0x1a4f42=_0xcb91[_0x13594e];return _0x1a4f42;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x373b4b,_0x50d091){var _0x2d85e2=function(_0x5d8c7e){while(--_0x5d8c7e){_0x373b4b['push'](_0x373b4b['shift']());}};_0x2d85e2(++_0x50d091);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4c4037,_0x15054b){_0x4c4037=_0x4c4037-0x0;var _0x357862=_0xcb91[_0x4c4037];return _0x357862;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index ae1e841..874f508 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 _0x1784=['sequelize','INTEGER'];(function(_0x310eb9,_0x1aed15){var _0x28915c=function(_0x457fd6){while(--_0x457fd6){_0x310eb9['push'](_0x310eb9['shift']());}};_0x28915c(++_0x1aed15);}(_0x1784,0x1ec));var _0x4178=function(_0x296d93,_0x27ee37){_0x296d93=_0x296d93-0x0;var _0xba3f66=_0x1784[_0x296d93];return _0xba3f66;};'use strict';var Sequelize=require(_0x4178('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x4178('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1d1e=['INTEGER','exports'];(function(_0x4d4d08,_0x18530b){var _0x508e32=function(_0x4626f4){while(--_0x4626f4){_0x4d4d08['push'](_0x4d4d08['shift']());}};_0x508e32(++_0x18530b);}(_0x1d1e,0x1e5));var _0xe1d1=function(_0x53d17e,_0xf979c9){_0x53d17e=_0x53d17e-0x0;var _0x35b0cc=_0x1d1e[_0x53d17e];return _0x35b0cc;};'use strict';var Sequelize=require('sequelize');module[_0xe1d1('0x0')]={'penalty':{'type':Sequelize[_0xe1d1('0x1')],'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 18d7342..91ab684 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 _0x126e=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','user_has_sms_queues'];(function(_0x581c44,_0x2bf0e0){var _0x3f606d=function(_0x45dc2c){while(--_0x45dc2c){_0x581c44['push'](_0x581c44['shift']());}};_0x3f606d(++_0x2bf0e0);}(_0x126e,0x108));var _0xe126=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x126e[_0x422905];return _0x33dc6c;};'use strict';var _=require('lodash');var util=require(_0xe126('0x0'));var logger=require(_0xe126('0x1'))(_0xe126('0x2'));var moment=require(_0xe126('0x3'));var BPromise=require(_0xe126('0x4'));var rp=require(_0xe126('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe126('0x6'));var config=require(_0xe126('0x7'));var attributes=require(_0xe126('0x8'));module[_0xe126('0x9')]=function(_0x2f75a4,_0x2162bd){return _0x2f75a4[_0xe126('0xa')]('UserSmsQueue',attributes,{'tableName':_0xe126('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x126e=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','user_has_sms_queues'];(function(_0x2abe5a,_0x348b80){var _0x24e2c4=function(_0x1d1ac2){while(--_0x1d1ac2){_0x2abe5a['push'](_0x2abe5a['shift']());}};_0x24e2c4(++_0x348b80);}(_0x126e,0x108));var _0xe126=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x126e[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require(_0xe126('0x0'));var logger=require(_0xe126('0x1'))(_0xe126('0x2'));var moment=require(_0xe126('0x3'));var BPromise=require(_0xe126('0x4'));var rp=require(_0xe126('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe126('0x6'));var config=require(_0xe126('0x7'));var attributes=require(_0xe126('0x8'));module[_0xe126('0x9')]=function(_0x2f75a4,_0x2162bd){return _0x2f75a4[_0xe126('0xa')]('UserSmsQueue',attributes,{'tableName':_0xe126('0xb'),'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 ab8f568..50f30c5 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 _0x9b13=['UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info'];(function(_0x49840b,_0x4df4aa){var _0x1a7ecc=function(_0x86eb28){while(--_0x86eb28){_0x49840b['push'](_0x49840b['shift']());}};_0x1a7ecc(++_0x4df4aa);}(_0x9b13,0x126));var _0x39b1=function(_0x3274bc,_0x31f3af){_0x3274bc=_0x3274bc-0x0;var _0x59cc5c=_0x9b13[_0x3274bc];return _0x59cc5c;};'use strict';var _=require(_0x39b1('0x0'));var util=require(_0x39b1('0x1'));var moment=require('moment');var BPromise=require(_0x39b1('0x2'));var rs=require(_0x39b1('0x3'));var fs=require('fs');var Redis=require(_0x39b1('0x4'));var db=require(_0x39b1('0x5'))['db'];var utils=require(_0x39b1('0x6'));var logger=require(_0x39b1('0x7'))(_0x39b1('0x8'));var config=require('../../config/environment');var jayson=require(_0x39b1('0x9'));var client=jayson['client'][_0x39b1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e71f4,_0x245802,_0x177eb4){return new BPromise(function(_0x373104,_0x356a87){return client[_0x39b1('0xb')](_0x5e71f4,_0x177eb4)[_0x39b1('0xc')](function(_0x575885){logger[_0x39b1('0xd')](_0x39b1('0xe'),_0x245802,_0x39b1('0xf'));logger[_0x39b1('0x10')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x245802,_0x39b1('0xf'),JSON['stringify'](_0x575885));if(_0x575885[_0x39b1('0x11')]){if(_0x575885[_0x39b1('0x11')][_0x39b1('0x12')]===0x1f4){logger[_0x39b1('0x11')](_0x39b1('0xe'),_0x245802,_0x575885[_0x39b1('0x11')][_0x39b1('0x13')]);return _0x356a87(_0x575885['error']['message']);}logger[_0x39b1('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x245802,_0x575885['error']['message']);return _0x373104(_0x575885[_0x39b1('0x11')]['message']);}else{logger[_0x39b1('0xd')](_0x39b1('0xe'),_0x245802,_0x39b1('0xf'));_0x373104(_0x575885[_0x39b1('0x14')][_0x39b1('0x13')]);}})[_0x39b1('0x15')](function(_0x5b316c){logger[_0x39b1('0x11')](_0x39b1('0xe'),_0x245802,_0x5b316c);_0x356a87(_0x5b316c);});});} \ No newline at end of file +var _0x3a88=['../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','debug','request\x20sent','stringify','error','code','UserSmsQueue,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x5046bf,_0x449985){var _0x3a79ba=function(_0x455a52){while(--_0x455a52){_0x5046bf['push'](_0x5046bf['shift']());}};_0x3a79ba(++_0x449985);}(_0x3a88,0x118));var _0x83a8=function(_0x120376,_0x571898){_0x120376=_0x120376-0x0;var _0x28c529=_0x3a88[_0x120376];return _0x28c529;};'use strict';var _=require(_0x83a8('0x0'));var util=require(_0x83a8('0x1'));var moment=require('moment');var BPromise=require(_0x83a8('0x2'));var rs=require(_0x83a8('0x3'));var fs=require('fs');var Redis=require(_0x83a8('0x4'));var db=require(_0x83a8('0x5'))['db'];var utils=require(_0x83a8('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x83a8('0x7'));var jayson=require(_0x83a8('0x8'));var client=jayson[_0x83a8('0x9')][_0x83a8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2c045a,_0x440df3,_0x4e2f43){return new BPromise(function(_0x3a5503,_0x533c59){return client[_0x83a8('0xb')](_0x2c045a,_0x4e2f43)[_0x83a8('0xc')](function(_0x173e6f){logger[_0x83a8('0xd')]('UserSmsQueue,\x20%s,\x20%s',_0x440df3,'request\x20sent');logger[_0x83a8('0xe')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x440df3,_0x83a8('0xf'),JSON[_0x83a8('0x10')](_0x173e6f));if(_0x173e6f[_0x83a8('0x11')]){if(_0x173e6f[_0x83a8('0x11')][_0x83a8('0x12')]===0x1f4){logger[_0x83a8('0x11')](_0x83a8('0x13'),_0x440df3,_0x173e6f['error'][_0x83a8('0x14')]);return _0x533c59(_0x173e6f[_0x83a8('0x11')][_0x83a8('0x14')]);}logger[_0x83a8('0x11')](_0x83a8('0x13'),_0x440df3,_0x173e6f[_0x83a8('0x11')]['message']);return _0x3a5503(_0x173e6f[_0x83a8('0x11')][_0x83a8('0x14')]);}else{logger[_0x83a8('0xd')]('UserSmsQueue,\x20%s,\x20%s',_0x440df3,_0x83a8('0xf'));_0x3a5503(_0x173e6f['result'][_0x83a8('0x14')]);}})[_0x83a8('0x15')](function(_0x20864b){logger[_0x83a8('0x11')](_0x83a8('0x13'),_0x440df3,_0x20864b);_0x533c59(_0x20864b);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 4905751..d35ac24 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 _0x36ed=['sequelize','exports','INTEGER'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x36ed,0xab));var _0xd36e=function(_0x44b534,_0x15ef72){_0x44b534=_0x44b534-0x0;var _0x1f7ebf=_0x36ed[_0x44b534];return _0x1f7ebf;};'use strict';var Sequelize=require(_0xd36e('0x0'));module[_0xd36e('0x1')]={'UserId':{'type':Sequelize[_0xd36e('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xd36e('0x2')]}}; \ No newline at end of file +var _0xd6e9=['INTEGER','sequelize','exports'];(function(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0xd6e9,0xa0));var _0x9d6e=function(_0x3ca3f0,_0x38a4aa){_0x3ca3f0=_0x3ca3f0-0x0;var _0x479dcf=_0xd6e9[_0x3ca3f0];return _0x479dcf;};'use strict';var Sequelize=require(_0x9d6e('0x0'));module[_0x9d6e('0x1')]={'UserId':{'type':Sequelize[_0x9d6e('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x9d6e('0x2')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index c99428c..f010dbc 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(_0x4333d3,_0x88d5c8){var _0x19d365=function(_0x4e01f2){while(--_0x4e01f2){_0x4333d3['push'](_0x4333d3['shift']());}};_0x19d365(++_0x88d5c8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'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(_0x4656a4,_0x197a4d){var _0x571594=function(_0xb5f6da){while(--_0xb5f6da){_0x4656a4['push'](_0x4656a4['shift']());}};_0x571594(++_0x197a4d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'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 9e4fad0..592d0d4 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x202667,_0x2f2300){var _0x21b671=function(_0x236aab){while(--_0x236aab){_0x202667['push'](_0x202667['shift']());}};_0x21b671(++_0x2f2300);}(_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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x1dfd22,_0x414bb7){var _0x46877c=function(_0x27d2d7){while(--_0x27d2d7){_0x1dfd22['push'](_0x1dfd22['shift']());}};_0x46877c(++_0x414bb7);}(_0xedd9,0xfc));var _0x9edd=function(_0x2ac0da,_0x2d2ac6){_0x2ac0da=_0x2ac0da-0x0;var _0x14a6f5=_0xedd9[_0x2ac0da];return _0x14a6f5;};'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/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index e1bac95..da256b7 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 _0x314c=['exports','sequelize'];(function(_0x22f3a1,_0x6fafe6){var _0xd1154c=function(_0x54a591){while(--_0x54a591){_0x22f3a1['push'](_0x22f3a1['shift']());}};_0xd1154c(++_0x6fafe6);}(_0x314c,0x17f));var _0xc314=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x314c[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0xc314('0x0'));module[_0xc314('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x1f89=['exports','INTEGER','sequelize'];(function(_0x364f7f,_0x4cf262){var _0x2039e8=function(_0x55b264){while(--_0x55b264){_0x364f7f['push'](_0x364f7f['shift']());}};_0x2039e8(++_0x4cf262);}(_0x1f89,0x14c));var _0x91f8=function(_0x542fc5,_0x2dadb9){_0x542fc5=_0x542fc5-0x0;var _0x424bd8=_0x1f89[_0x542fc5];return _0x424bd8;};'use strict';var Sequelize=require(_0x91f8('0x0'));module[_0x91f8('0x1')]={'penalty':{'type':Sequelize[_0x91f8('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 2cbf6a7..bfd73f9 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 _0x1604=['lodash','../../config/logger','moment','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue'];(function(_0x4dc0c1,_0x2351d8){var _0x1e6b4b=function(_0x4b8d35){while(--_0x4b8d35){_0x4dc0c1['push'](_0x4dc0c1['shift']());}};_0x1e6b4b(++_0x2351d8);}(_0x1604,0xd2));var _0x4160=function(_0x506b9d,_0x4f996b){_0x506b9d=_0x506b9d-0x0;var _0x3d2918=_0x1604[_0x506b9d];return _0x3d2918;};'use strict';var _=require(_0x4160('0x0'));var util=require('util');var logger=require(_0x4160('0x1'))('api');var moment=require(_0x4160('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4160('0x3'));var rimraf=require(_0x4160('0x4'));var config=require(_0x4160('0x5'));var attributes=require(_0x4160('0x6'));module[_0x4160('0x7')]=function(_0x489a65,_0x51b3d1){return _0x489a65[_0x4160('0x8')](_0x4160('0x9'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd35b=['moment','bluebird','request-promise','rimraf','./userVoiceQueue.attributes','define','user_has_voice_queues','lodash','../../config/logger','api'];(function(_0x231bf2,_0x41bc52){var _0x3b99cf=function(_0x421814){while(--_0x421814){_0x231bf2['push'](_0x231bf2['shift']());}};_0x3b99cf(++_0x41bc52);}(_0xd35b,0x18d));var _0xbd35=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0xd35b[_0x2b5eae];return _0x5f3ac9;};'use strict';var _=require(_0xbd35('0x0'));var util=require('util');var logger=require(_0xbd35('0x1'))(_0xbd35('0x2'));var moment=require(_0xbd35('0x3'));var BPromise=require(_0xbd35('0x4'));var rp=require(_0xbd35('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbd35('0x6'));var config=require('../../config/environment');var attributes=require(_0xbd35('0x7'));module['exports']=function(_0x41b23b,_0x149111){return _0x41b23b[_0xbd35('0x8')]('UserVoiceQueue',attributes,{'tableName':_0xbd35('0x9'),'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 d55eed7..31f6913 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 _0x79f0=['UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserVoiceQueue,\x20%s,\x20%s','message','result','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0x79f0,0x181));var _0x079f=function(_0x5d80de,_0x2cf15d){_0x5d80de=_0x5d80de-0x0;var _0x1c7556=_0x79f0[_0x5d80de];return _0x1c7556;};'use strict';var _=require(_0x079f('0x0'));var util=require('util');var moment=require(_0x079f('0x1'));var BPromise=require(_0x079f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x079f('0x3'))['db'];var utils=require(_0x079f('0x4'));var logger=require(_0x079f('0x5'))(_0x079f('0x6'));var config=require(_0x079f('0x7'));var jayson=require(_0x079f('0x8'));var client=jayson['client'][_0x079f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x53fe77,_0x272b9f,_0x4f4939){return new BPromise(function(_0x44c199,_0x309e6c){return client['request'](_0x53fe77,_0x4f4939)[_0x079f('0xa')](function(_0x349037){logger[_0x079f('0xb')]('UserVoiceQueue,\x20%s,\x20%s',_0x272b9f,_0x079f('0xc'));logger[_0x079f('0xd')](_0x079f('0xe'),_0x272b9f,_0x079f('0xc'),JSON[_0x079f('0xf')](_0x349037));if(_0x349037[_0x079f('0x10')]){if(_0x349037[_0x079f('0x10')][_0x079f('0x11')]===0x1f4){logger[_0x079f('0x10')](_0x079f('0x12'),_0x272b9f,_0x349037[_0x079f('0x10')]['message']);return _0x309e6c(_0x349037[_0x079f('0x10')][_0x079f('0x13')]);}logger[_0x079f('0x10')](_0x079f('0x12'),_0x272b9f,_0x349037['error'][_0x079f('0x13')]);return _0x44c199(_0x349037[_0x079f('0x10')][_0x079f('0x13')]);}else{logger[_0x079f('0xb')](_0x079f('0x12'),_0x272b9f,_0x079f('0xc'));_0x44c199(_0x349037[_0x079f('0x14')][_0x079f('0x13')]);}})['catch'](function(_0x2b5e1f){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x272b9f,_0x2b5e1f);_0x309e6c(_0x2b5e1f);});});} \ No newline at end of file +var _0x4ef9=['client','http','request','then','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0x1c8c28,_0x3ee093){var _0x1f59b4=function(_0x29bcc0){while(--_0x29bcc0){_0x1c8c28['push'](_0x1c8c28['shift']());}};_0x1f59b4(++_0x3ee093);}(_0x4ef9,0xd7));var _0x94ef=function(_0x4291dd,_0x95d82){_0x4291dd=_0x4291dd-0x0;var _0x152462=_0x4ef9[_0x4291dd];return _0x152462;};'use strict';var _=require(_0x94ef('0x0'));var util=require(_0x94ef('0x1'));var moment=require(_0x94ef('0x2'));var BPromise=require(_0x94ef('0x3'));var rs=require(_0x94ef('0x4'));var fs=require('fs');var Redis=require(_0x94ef('0x5'));var db=require(_0x94ef('0x6'))['db'];var utils=require(_0x94ef('0x7'));var logger=require(_0x94ef('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x94ef('0x9'));var client=jayson[_0x94ef('0xa')][_0x94ef('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x41a2d2,_0x19e026,_0x1dd6f2){return new BPromise(function(_0x509324,_0x574a2f){return client[_0x94ef('0xc')](_0x41a2d2,_0x1dd6f2)[_0x94ef('0xd')](function(_0x2fc51e){logger['info'](_0x94ef('0xe'),_0x19e026,_0x94ef('0xf'));logger[_0x94ef('0x10')](_0x94ef('0x11'),_0x19e026,_0x94ef('0xf'),JSON[_0x94ef('0x12')](_0x2fc51e));if(_0x2fc51e['error']){if(_0x2fc51e[_0x94ef('0x13')][_0x94ef('0x14')]===0x1f4){logger[_0x94ef('0x13')](_0x94ef('0xe'),_0x19e026,_0x2fc51e[_0x94ef('0x13')]['message']);return _0x574a2f(_0x2fc51e[_0x94ef('0x13')][_0x94ef('0x15')]);}logger[_0x94ef('0x13')](_0x94ef('0xe'),_0x19e026,_0x2fc51e[_0x94ef('0x13')][_0x94ef('0x15')]);return _0x509324(_0x2fc51e[_0x94ef('0x13')][_0x94ef('0x15')]);}else{logger[_0x94ef('0x16')](_0x94ef('0xe'),_0x19e026,_0x94ef('0xf'));_0x509324(_0x2fc51e[_0x94ef('0x17')][_0x94ef('0x15')]);}})[_0x94ef('0x18')](function(_0xa5e942){logger[_0x94ef('0x13')](_0x94ef('0xe'),_0x19e026,_0xa5e942);_0x574a2f(_0xa5e942);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 1a5c3eb..c8850a6 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x515f9a,_0x3d9476){var _0x5052f0=function(_0x123a8c){while(--_0x123a8c){_0x515f9a['push'](_0x515f9a['shift']());}};_0x5052f0(++_0x3d9476);}(_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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x3d4a1b,_0x198962){var _0x2ed213=function(_0x37d3eb){while(--_0x37d3eb){_0x3d4a1b['push'](_0x3d4a1b['shift']());}};_0x2ed213(++_0x198962);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'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 diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 60f3c38..380ab33 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 _0xdd03=['INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x168cc7,_0x4c25f5){var _0x19cc5f=function(_0x3711d4){while(--_0x3711d4){_0x168cc7['push'](_0x168cc7['shift']());}};_0x19cc5f(++_0x4c25f5);}(_0xdd03,0xe5));var _0x3dd0=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xdd03[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0x3dd0('0x0')},'membername':{'type':Sequelize[_0x3dd0('0x1')],'allowNull':![],'comment':_0x3dd0('0x0')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0x3dd0('0x1')],'allowNull':![],'unique':_0x3dd0('0x2'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0x3dd0('0x3')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x3dd0('0x2'),'comment':_0x3dd0('0x0')},'penalty':{'type':Sequelize[_0x3dd0('0x3')](0xb),'defaultValue':0x0,'comment':_0x3dd0('0x0')},'paused':{'type':Sequelize[_0x3dd0('0x3')](0xb),'defaultValue':0x0,'comment':_0x3dd0('0x0')}}; \ No newline at end of file +var _0xff5e=['exports','Required\x20by\x20Asterisk','STRING','queue_interface','INTEGER','sequelize'];(function(_0x9bc089,_0x35e935){var _0x301012=function(_0x5eac53){while(--_0x5eac53){_0x9bc089['push'](_0x9bc089['shift']());}};_0x301012(++_0x35e935);}(_0xff5e,0x9b));var _0xeff5=function(_0x332509,_0x1fb702){_0x332509=_0x332509-0x0;var _0x19815e=_0xff5e[_0x332509];return _0x19815e;};'use strict';var Sequelize=require(_0xeff5('0x0'));module[_0xeff5('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0xeff5('0x2')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0xeff5('0x2')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0xeff5('0x3')],'allowNull':![],'unique':_0xeff5('0x4'),'comment':_0xeff5('0x2')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0xeff5('0x3')],'allowNull':![],'unique':'queue_interface','comment':_0xeff5('0x2')},'penalty':{'type':Sequelize[_0xeff5('0x5')](0xb),'defaultValue':0x0,'comment':_0xeff5('0x2')},'paused':{'type':Sequelize[_0xeff5('0x5')](0xb),'defaultValue':0x0,'comment':_0xeff5('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 66b0238..db64018 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 _0x249e=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','update'];(function(_0x540dcb,_0x4eacb6){var _0x49353c=function(_0x449bb1){while(--_0x449bb1){_0x540dcb['push'](_0x540dcb['shift']());}};_0x49353c(++_0x4eacb6);}(_0x249e,0x1e2));var _0xe249=function(_0x335b60,_0x50bdf8){_0x335b60=_0x335b60-0x0;var _0x930d32=_0x249e[_0x335b60];return _0x930d32;};'use strict';var EventEmitter=require(_0xe249('0x0'));var UserVoiceQueueRt=require(_0xe249('0x1'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xe249('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe249('0x3'),'afterDestroy':_0xe249('0x4')};function emitEvent(_0x210c79){return function(_0x14d81f,_0xe3aa11,_0x11b1b3){UserVoiceQueueRtEvents[_0xe249('0x5')](_0x210c79+':'+_0x14d81f['id'],_0x14d81f);UserVoiceQueueRtEvents[_0xe249('0x5')](_0x210c79,_0x14d81f);_0x11b1b3(null);};}for(var e in events){if(events[_0xe249('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0xe249('0x7')](e,emitEvent(event));}}module[_0xe249('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xccb7=['hook','exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','update','remove','emit'];(function(_0x4d9114,_0x5bb6da){var _0x4989bd=function(_0x59c01a){while(--_0x59c01a){_0x4d9114['push'](_0x4d9114['shift']());}};_0x4989bd(++_0x5bb6da);}(_0xccb7,0xf2));var _0x7ccb=function(_0x45200d,_0x4e023c){_0x45200d=_0x45200d-0x0;var _0x37b003=_0xccb7[_0x45200d];return _0x37b003;};'use strict';var EventEmitter=require(_0x7ccb('0x0'));var UserVoiceQueueRt=require(_0x7ccb('0x1'))['db'][_0x7ccb('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x7ccb('0x3')](0x0);var events={'afterCreate':_0x7ccb('0x4'),'afterUpdate':_0x7ccb('0x5'),'afterDestroy':_0x7ccb('0x6')};function emitEvent(_0x3ffbfb){return function(_0x19045c,_0x32d14a,_0x195daa){UserVoiceQueueRtEvents['emit'](_0x3ffbfb+':'+_0x19045c['id'],_0x19045c);UserVoiceQueueRtEvents[_0x7ccb('0x7')](_0x3ffbfb,_0x19045c);_0x195daa(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x7ccb('0x8')](e,emitEvent(event));}}module[_0x7ccb('0x9')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 672bf47..3c424b2 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 _0x1b0b=['util','../../config/logger','moment','request-promise','path','rimraf','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt'];(function(_0x2272b5,_0x362458){var _0x110156=function(_0x5c2e32){while(--_0x5c2e32){_0x2272b5['push'](_0x2272b5['shift']());}};_0x110156(++_0x362458);}(_0x1b0b,0x79));var _0xb1b0=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x1b0b[_0x11005e];return _0x29338f;};'use strict';var _=require('lodash');var util=require(_0xb1b0('0x0'));var logger=require(_0xb1b0('0x1'))('api');var moment=require(_0xb1b0('0x2'));var BPromise=require('bluebird');var rp=require(_0xb1b0('0x3'));var fs=require('fs');var path=require(_0xb1b0('0x4'));var rimraf=require(_0xb1b0('0x5'));var config=require('../../config/environment');var attributes=require(_0xb1b0('0x6'));module[_0xb1b0('0x7')]=function(_0x380193,_0xd2aeb8){return _0x380193[_0xb1b0('0x8')](_0xb1b0('0x9'),attributes,{'tableName':_0xb1b0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcf1e=['UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./userVoiceQueueRt.attributes','exports','define'];(function(_0x171fc4,_0x7ec171){var _0x3aee00=function(_0x3ec0c9){while(--_0x3ec0c9){_0x171fc4['push'](_0x171fc4['shift']());}};_0x3aee00(++_0x7ec171);}(_0xcf1e,0xc6));var _0xecf1=function(_0xc29f5d,_0x1cb0cb){_0xc29f5d=_0xc29f5d-0x0;var _0x2a0a75=_0xcf1e[_0xc29f5d];return _0x2a0a75;};'use strict';var _=require(_0xecf1('0x0'));var util=require(_0xecf1('0x1'));var logger=require(_0xecf1('0x2'))(_0xecf1('0x3'));var moment=require(_0xecf1('0x4'));var BPromise=require(_0xecf1('0x5'));var rp=require(_0xecf1('0x6'));var fs=require('fs');var path=require(_0xecf1('0x7'));var rimraf=require('rimraf');var config=require(_0xecf1('0x8'));var attributes=require(_0xecf1('0x9'));module[_0xecf1('0xa')]=function(_0x1d6763,_0xbf717e){return _0x1d6763[_0xecf1('0xb')](_0xecf1('0xc'),attributes,{'tableName':_0xecf1('0xd'),'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 bf32163..8ac11a3 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 _0xe663=['../../config/logger','rpc','jayson/promise','client','redis','defaults','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetVoiceQueueRtPauses','options','raw','where','COUNT','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x382a62,_0x1baa5e){var _0x490a25=function(_0x1b3427){while(--_0x1b3427){_0x382a62['push'](_0x382a62['shift']());}};_0x490a25(++_0x1baa5e);}(_0xe663,0x8a));var _0x3e66=function(_0x5781ca,_0x2e68f7){_0x5781ca=_0x5781ca-0x0;var _0x446669=_0xe663[_0x5781ca];return _0x446669;};'use strict';var _=require(_0x3e66('0x0'));var util=require(_0x3e66('0x1'));var moment=require('moment');var BPromise=require(_0x3e66('0x2'));var rs=require(_0x3e66('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3e66('0x4'))['db'];var utils=require(_0x3e66('0x5'));var logger=require(_0x3e66('0x6'))(_0x3e66('0x7'));var config=require('../../config/environment');var jayson=require(_0x3e66('0x8'));var client=jayson[_0x3e66('0x9')]['http']({'port':0x232a});config[_0x3e66('0xa')]=_[_0x3e66('0xb')](config[_0x3e66('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x3e66('0xc'))(new Redis(config[_0x3e66('0xa')]));require(_0x3e66('0xd'))[_0x3e66('0xe')](socket);function respondWithRpcPromise(_0x79b533,_0x36a64a,_0x159f6b){return new BPromise(function(_0x1c9a8b,_0x5e2d71){return client[_0x3e66('0xf')](_0x79b533,_0x159f6b)[_0x3e66('0x10')](function(_0x594f35){logger[_0x3e66('0x11')](_0x3e66('0x12'),_0x36a64a,_0x3e66('0x13'));logger[_0x3e66('0x14')](_0x3e66('0x15'),_0x36a64a,'request\x20sent',JSON[_0x3e66('0x16')](_0x594f35));if(_0x594f35[_0x3e66('0x17')]){if(_0x594f35[_0x3e66('0x17')][_0x3e66('0x18')]===0x1f4){logger[_0x3e66('0x17')](_0x3e66('0x12'),_0x36a64a,_0x594f35['error']['message']);return _0x5e2d71(_0x594f35[_0x3e66('0x17')][_0x3e66('0x19')]);}logger[_0x3e66('0x17')](_0x3e66('0x12'),_0x36a64a,_0x594f35[_0x3e66('0x17')][_0x3e66('0x19')]);return _0x1c9a8b(_0x594f35[_0x3e66('0x17')]['message']);}else{logger[_0x3e66('0x11')](_0x3e66('0x12'),_0x36a64a,'request\x20sent');_0x1c9a8b(_0x594f35[_0x3e66('0x1a')][_0x3e66('0x19')]);}})['catch'](function(_0x17963d){logger[_0x3e66('0x17')](_0x3e66('0x12'),_0x36a64a,_0x17963d);_0x5e2d71(_0x17963d);});});}exports[_0x3e66('0x1b')]=function(_0x37d02f){var _0x1fcffe=this;return new Promise(function(_0x50f042,_0x402758){return db['UserVoiceQueueRt']['findAll']({'raw':_0x37d02f['options']?_0x37d02f[_0x3e66('0x1c')][_0x3e66('0x1d')]===undefined?!![]:![]:!![],'where':_0x37d02f[_0x3e66('0x1c')]?_0x37d02f['options'][_0x3e66('0x1e')]||null:null,'attributes':[[db['sequelize']['fn'](_0x3e66('0x1f'),db[_0x3e66('0x20')]['fn']('IF',db[_0x3e66('0x20')][_0x3e66('0x21')](_0x3e66('0x22')))),_0x3e66('0x23')]]})[_0x3e66('0x10')](function(_0x573ea1){logger[_0x3e66('0x11')]('GetVoiceQueueRtPauses',_0x37d02f);logger['debug'](_0x3e66('0x1b'),_0x37d02f,JSON[_0x3e66('0x16')](_0x573ea1));_0x50f042(_0x573ea1);})['catch'](function(_0x228f50){logger[_0x3e66('0x17')](_0x3e66('0x1b'),_0x228f50[_0x3e66('0x19')],_0x37d02f);_0x402758(_0x1fcffe[_0x3e66('0x17')](0x1f4,_0x228f50['message']));});});}; \ No newline at end of file +var _0x789d=['defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','request','then','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetVoiceQueueRtPauses','options','COUNT','sequelize','literal','outboundQueuePauses','info','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis'];(function(_0x5d9ceb,_0x1a49f5){var _0x33ce82=function(_0x583915){while(--_0x583915){_0x5d9ceb['push'](_0x5d9ceb['shift']());}};_0x33ce82(++_0x1a49f5);}(_0x789d,0x17e));var _0xd789=function(_0x2fb282,_0x419bcb){_0x2fb282=_0x2fb282-0x0;var _0x14b48f=_0x789d[_0x2fb282];return _0x14b48f;};'use strict';var _=require(_0xd789('0x0'));var util=require(_0xd789('0x1'));var moment=require(_0xd789('0x2'));var BPromise=require(_0xd789('0x3'));var rs=require(_0xd789('0x4'));var fs=require('fs');var Redis=require(_0xd789('0x5'));var db=require(_0xd789('0x6'))['db'];var utils=require(_0xd789('0x7'));var logger=require(_0xd789('0x8'))('rpc');var config=require(_0xd789('0x9'));var jayson=require(_0xd789('0xa'));var client=jayson[_0xd789('0xb')][_0xd789('0xc')]({'port':0x232a});config[_0xd789('0xd')]=_[_0xd789('0xe')](config[_0xd789('0xd')],{'host':_0xd789('0xf'),'port':0x18eb});var socket=require(_0xd789('0x10'))(new Redis(config[_0xd789('0xd')]));require(_0xd789('0x11'))['register'](socket);function respondWithRpcPromise(_0x3aab4f,_0x4631db,_0x4fdd3f){return new BPromise(function(_0x419978,_0x580ddc){return client[_0xd789('0x12')](_0x3aab4f,_0x4fdd3f)[_0xd789('0x13')](function(_0x460001){logger['info'](_0xd789('0x14'),_0x4631db,_0xd789('0x15'));logger[_0xd789('0x16')](_0xd789('0x17'),_0x4631db,_0xd789('0x15'),JSON[_0xd789('0x18')](_0x460001));if(_0x460001[_0xd789('0x19')]){if(_0x460001[_0xd789('0x19')]['code']===0x1f4){logger[_0xd789('0x19')](_0xd789('0x14'),_0x4631db,_0x460001['error'][_0xd789('0x1a')]);return _0x580ddc(_0x460001[_0xd789('0x19')][_0xd789('0x1a')]);}logger[_0xd789('0x19')](_0xd789('0x14'),_0x4631db,_0x460001[_0xd789('0x19')][_0xd789('0x1a')]);return _0x419978(_0x460001[_0xd789('0x19')]['message']);}else{logger['info'](_0xd789('0x14'),_0x4631db,_0xd789('0x15'));_0x419978(_0x460001[_0xd789('0x1b')][_0xd789('0x1a')]);}})[_0xd789('0x1c')](function(_0x149de9){logger[_0xd789('0x19')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x4631db,_0x149de9);_0x580ddc(_0x149de9);});});}exports[_0xd789('0x1d')]=function(_0x37b0f0){var _0x24d45b=this;return new Promise(function(_0x28633d,_0x1a92b7){return db['UserVoiceQueueRt']['findAll']({'raw':_0x37b0f0['options']?_0x37b0f0[_0xd789('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x37b0f0[_0xd789('0x1e')]?_0x37b0f0[_0xd789('0x1e')]['where']||null:null,'attributes':[[db['sequelize']['fn'](_0xd789('0x1f'),db[_0xd789('0x20')]['fn']('IF',db[_0xd789('0x20')][_0xd789('0x21')]('`paused`\x20=\x201,\x201,\x20null'))),_0xd789('0x22')]]})['then'](function(_0x364045){logger[_0xd789('0x23')](_0xd789('0x1d'),_0x37b0f0);logger[_0xd789('0x16')](_0xd789('0x1d'),_0x37b0f0,JSON[_0xd789('0x18')](_0x364045));_0x28633d(_0x364045);})['catch'](function(_0x4883f9){logger[_0xd789('0x19')](_0xd789('0x1d'),_0x4883f9[_0xd789('0x1a')],_0x37b0f0);_0x1a92b7(_0x24d45b['error'](0x1f4,_0x4883f9[_0xd789('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 7f40cef..75ca887 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 _0x8a8b=['update','removeListener','register','userVoiceQueueRt:','./userVoiceQueueRt.events'];(function(_0x3585e2,_0x4cf6fd){var _0x115393=function(_0x42f360){while(--_0x42f360){_0x3585e2['push'](_0x3585e2['shift']());}};_0x115393(++_0x4cf6fd);}(_0x8a8b,0xae));var _0xb8a8=function(_0x30d91c,_0x2c1a9d){_0x30d91c=_0x30d91c-0x0;var _0x59bfc5=_0x8a8b[_0x30d91c];return _0x59bfc5;};'use strict';var UserVoiceQueueRtEvents=require(_0xb8a8('0x0'));var events=['save','remove',_0xb8a8('0x1')];function createListener(_0x308da3,_0x4f56d4){return function(_0x13bc8b){_0x4f56d4['emit'](_0x308da3,_0x13bc8b);};}function removeListener(_0xca9854,_0x4fe301){return function(){UserVoiceQueueRtEvents[_0xb8a8('0x2')](_0xca9854,_0x4fe301);};}exports[_0xb8a8('0x3')]=function(_0xcca5ca){for(var _0x578e1b=0x0,_0x37e48d=events['length'];_0x578e1b<_0x37e48d;_0x578e1b++){var _0x32d542=events[_0x578e1b];var _0x4c46e9=createListener(_0xb8a8('0x4')+_0x32d542,_0xcca5ca);UserVoiceQueueRtEvents['on'](_0x32d542,_0x4c46e9);}}; \ No newline at end of file +var _0x38e4=['emit','removeListener','register','length','./userVoiceQueueRt.events','save','update'];(function(_0x1539bf,_0x2a71c9){var _0x2c457f=function(_0x2b0a60){while(--_0x2b0a60){_0x1539bf['push'](_0x1539bf['shift']());}};_0x2c457f(++_0x2a71c9);}(_0x38e4,0x9e));var _0x438e=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x38e4[_0x53ccf2];return _0x5a2964;};'use strict';var UserVoiceQueueRtEvents=require(_0x438e('0x0'));var events=[_0x438e('0x1'),'remove',_0x438e('0x2')];function createListener(_0x74ca77,_0x4d9a10){return function(_0x2842fb){_0x4d9a10[_0x438e('0x3')](_0x74ca77,_0x2842fb);};}function removeListener(_0x387d68,_0x5ec55c){return function(){UserVoiceQueueRtEvents[_0x438e('0x4')](_0x387d68,_0x5ec55c);};}exports[_0x438e('0x5')]=function(_0x381b4c){for(var _0x2c2a62=0x0,_0x4765fb=events[_0x438e('0x6')];_0x2c2a62<_0x4765fb;_0x2c2a62++){var _0x58d120=events[_0x2c2a62];var _0x53da29=createListener('userVoiceQueueRt:'+_0x58d120,_0x381b4c);UserVoiceQueueRtEvents['on'](_0x58d120,_0x53da29);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 7bf6465..086575c 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x23f440,_0x371d39){var _0x24d675=function(_0x316491){while(--_0x316491){_0x23f440['push'](_0x23f440['shift']());}};_0x24d675(++_0x371d39);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4b4d43,_0x1590f7){_0x4b4d43=_0x4b4d43-0x0;var _0x5706ba=_0xcb91[_0x4b4d43];return _0x5706ba;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=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(_0x364295,_0x2d4430){var _0x519a63=function(_0x19a15e){while(--_0x19a15e){_0x364295['push'](_0x364295['shift']());}};_0x519a63(++_0x2d4430);}(_0xedd9,0xfc));var _0x9edd=function(_0xdff97c,_0x3ab6e3){_0xdff97c=_0xdff97c-0x0;var _0x4006da=_0xedd9[_0xdff97c];return _0x4006da;};'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/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index ff41d9c..97848da 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 _0xb926=['exports','INTEGER','sequelize'];(function(_0x34e6e7,_0x8213c7){var _0x2456a2=function(_0x452bad){while(--_0x452bad){_0x34e6e7['push'](_0x34e6e7['shift']());}};_0x2456a2(++_0x8213c7);}(_0xb926,0x83));var _0x6b92=function(_0x7d3462,_0x510bb2){_0x7d3462=_0x7d3462-0x0;var _0x35d6aa=_0xb926[_0x7d3462];return _0x35d6aa;};'use strict';var Sequelize=require(_0x6b92('0x0'));module[_0x6b92('0x1')]={'penalty':{'type':Sequelize[_0x6b92('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x010a=['exports'];(function(_0x4b4ed6,_0x4f7b0a){var _0x25879e=function(_0x4063bd){while(--_0x4063bd){_0x4b4ed6['push'](_0x4b4ed6['shift']());}};_0x25879e(++_0x4f7b0a);}(_0x010a,0x1f4));var _0xa010=function(_0x58397a,_0x5cbbc7){_0x58397a=_0x58397a-0x0;var _0x4453a=_0x010a[_0x58397a];return _0x4453a;};'use strict';var Sequelize=require('sequelize');module[_0xa010('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'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 3dc5e09..130c663 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 _0x9eb2=['rimraf','../../config/environment','exports','UserWhatsappQueue','user_has_whatsapp_queues','api','moment','bluebird','path'];(function(_0x3bcf9e,_0x148a5d){var _0x1bb37c=function(_0xcaf5da){while(--_0xcaf5da){_0x3bcf9e['push'](_0x3bcf9e['shift']());}};_0x1bb37c(++_0x148a5d);}(_0x9eb2,0x1a3));var _0x29eb=function(_0x12d32d,_0x2a6566){_0x12d32d=_0x12d32d-0x0;var _0x202c18=_0x9eb2[_0x12d32d];return _0x202c18;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x29eb('0x0'));var moment=require(_0x29eb('0x1'));var BPromise=require(_0x29eb('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x29eb('0x3'));var rimraf=require(_0x29eb('0x4'));var config=require(_0x29eb('0x5'));var attributes=require('./userWhatsappQueue.attributes');module[_0x29eb('0x6')]=function(_0x344218,_0x33b88b){return _0x344218['define'](_0x29eb('0x7'),attributes,{'tableName':_0x29eb('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2013=['bluebird','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','../../config/logger','api','moment'];(function(_0x586af5,_0x246f14){var _0x5edde3=function(_0x1d06af){while(--_0x1d06af){_0x586af5['push'](_0x586af5['shift']());}};_0x5edde3(++_0x246f14);}(_0x2013,0xe5));var _0x3201=function(_0x1ad50d,_0x3e8ee9){_0x1ad50d=_0x1ad50d-0x0;var _0x2034dc=_0x2013[_0x1ad50d];return _0x2034dc;};'use strict';var _=require(_0x3201('0x0'));var util=require(_0x3201('0x1'));var logger=require(_0x3201('0x2'))(_0x3201('0x3'));var moment=require(_0x3201('0x4'));var BPromise=require(_0x3201('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3201('0x6'));var rimraf=require(_0x3201('0x7'));var config=require(_0x3201('0x8'));var attributes=require(_0x3201('0x9'));module[_0x3201('0xa')]=function(_0x373f71,_0x199535){return _0x373f71['define'](_0x3201('0xb'),attributes,{'tableName':_0x3201('0xc'),'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 605b7f1..2e06aaa 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 _0xfefb=['client','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x1ce266,_0xf99ee4){var _0x2d08a6=function(_0x3a8be2){while(--_0x3a8be2){_0x1ce266['push'](_0x1ce266['shift']());}};_0x2d08a6(++_0xf99ee4);}(_0xfefb,0x1d7));var _0xbfef=function(_0xdcd9cf,_0x8bb69c){_0xdcd9cf=_0xdcd9cf-0x0;var _0x26954d=_0xfefb[_0xdcd9cf];return _0x26954d;};'use strict';var _=require('lodash');var util=require(_0xbfef('0x0'));var moment=require(_0xbfef('0x1'));var BPromise=require(_0xbfef('0x2'));var rs=require(_0xbfef('0x3'));var fs=require('fs');var Redis=require(_0xbfef('0x4'));var db=require(_0xbfef('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbfef('0x6'))(_0xbfef('0x7'));var config=require(_0xbfef('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbfef('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x64763b,_0xdfe568,_0x4a5a6f){return new BPromise(function(_0x17561e,_0x3a3b96){return client['request'](_0x64763b,_0x4a5a6f)[_0xbfef('0xa')](function(_0x4114e3){logger[_0xbfef('0xb')](_0xbfef('0xc'),_0xdfe568,_0xbfef('0xd'));logger[_0xbfef('0xe')](_0xbfef('0xf'),_0xdfe568,_0xbfef('0xd'),JSON[_0xbfef('0x10')](_0x4114e3));if(_0x4114e3['error']){if(_0x4114e3['error']['code']===0x1f4){logger[_0xbfef('0x11')](_0xbfef('0xc'),_0xdfe568,_0x4114e3[_0xbfef('0x11')][_0xbfef('0x12')]);return _0x3a3b96(_0x4114e3['error']['message']);}logger[_0xbfef('0x11')](_0xbfef('0xc'),_0xdfe568,_0x4114e3[_0xbfef('0x11')][_0xbfef('0x12')]);return _0x17561e(_0x4114e3[_0xbfef('0x11')]['message']);}else{logger[_0xbfef('0xb')]('UserWhatsappQueue,\x20%s,\x20%s',_0xdfe568,'request\x20sent');_0x17561e(_0x4114e3['result'][_0xbfef('0x12')]);}})[_0xbfef('0x13')](function(_0x1309bc){logger[_0xbfef('0x11')](_0xbfef('0xc'),_0xdfe568,_0x1309bc);_0x3a3b96(_0x1309bc);});});} \ No newline at end of file +var _0xf4e8=['moment','ioredis','../../config/logger','rpc','../../config/environment','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util'];(function(_0x2026c5,_0x21259e){var _0x251dcc=function(_0x5f06fd){while(--_0x5f06fd){_0x2026c5['push'](_0x2026c5['shift']());}};_0x251dcc(++_0x21259e);}(_0xf4e8,0x11e));var _0x8f4e=function(_0x4cb9e8,_0x43ac2c){_0x4cb9e8=_0x4cb9e8-0x0;var _0x398212=_0xf4e8[_0x4cb9e8];return _0x398212;};'use strict';var _=require(_0x8f4e('0x0'));var util=require(_0x8f4e('0x1'));var moment=require(_0x8f4e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8f4e('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8f4e('0x4'))(_0x8f4e('0x5'));var config=require(_0x8f4e('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x390aca,_0x22e4b6,_0x55de80){return new BPromise(function(_0x1326ec,_0x44bbec){return client[_0x8f4e('0x7')](_0x390aca,_0x55de80)[_0x8f4e('0x8')](function(_0x16387d){logger[_0x8f4e('0x9')](_0x8f4e('0xa'),_0x22e4b6,_0x8f4e('0xb'));logger['debug'](_0x8f4e('0xc'),_0x22e4b6,'request\x20sent',JSON[_0x8f4e('0xd')](_0x16387d));if(_0x16387d[_0x8f4e('0xe')]){if(_0x16387d[_0x8f4e('0xe')][_0x8f4e('0xf')]===0x1f4){logger['error'](_0x8f4e('0xa'),_0x22e4b6,_0x16387d[_0x8f4e('0xe')][_0x8f4e('0x10')]);return _0x44bbec(_0x16387d[_0x8f4e('0xe')][_0x8f4e('0x10')]);}logger[_0x8f4e('0xe')](_0x8f4e('0xa'),_0x22e4b6,_0x16387d[_0x8f4e('0xe')]['message']);return _0x1326ec(_0x16387d[_0x8f4e('0xe')][_0x8f4e('0x10')]);}else{logger['info'](_0x8f4e('0xa'),_0x22e4b6,'request\x20sent');_0x1326ec(_0x16387d['result']['message']);}})[_0x8f4e('0x11')](function(_0x29be92){logger['error'](_0x8f4e('0xa'),_0x22e4b6,_0x29be92);_0x44bbec(_0x29be92);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 9008854..14b7736 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 _0xfd28=['express','fs-extra','../../components/auth/service','../../components/interaction/service','./variable.controller','get','isAuthenticated','index','show','post','put','delete','exports','util','path'];(function(_0x586697,_0xc89ae1){var _0x4bc510=function(_0x563d59){while(--_0x563d59){_0x586697['push'](_0x586697['shift']());}};_0x4bc510(++_0xc89ae1);}(_0xfd28,0x148));var _0x8fd2=function(_0x1c34e7,_0x33f9a8){_0x1c34e7=_0x1c34e7-0x0;var _0x378cb1=_0xfd28[_0x1c34e7];return _0x378cb1;};'use strict';var multer=require('multer');var util=require(_0x8fd2('0x0'));var path=require(_0x8fd2('0x1'));var timeout=require('connect-timeout');var express=require(_0x8fd2('0x2'));var router=express['Router']();var fs_extra=require(_0x8fd2('0x3'));var auth=require(_0x8fd2('0x4'));var interaction=require(_0x8fd2('0x5'));var config=require('../../config/environment');var controller=require(_0x8fd2('0x6'));router[_0x8fd2('0x7')]('/',auth[_0x8fd2('0x8')](),controller[_0x8fd2('0x9')]);router[_0x8fd2('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x8fd2('0xa')]);router[_0x8fd2('0xb')]('/',auth[_0x8fd2('0x8')](),controller['create']);router[_0x8fd2('0xc')]('/:id',auth[_0x8fd2('0x8')](),controller['update']);router[_0x8fd2('0xd')]('/:id',auth[_0x8fd2('0x8')](),controller['destroy']);module[_0x8fd2('0xe')]=router; \ No newline at end of file +var _0xe13e=['destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','/:id','show','create','put','delete'];(function(_0x4135c9,_0x31554e){var _0x4f3b72=function(_0x4d9917){while(--_0x4d9917){_0x4135c9['push'](_0x4135c9['shift']());}};_0x4f3b72(++_0x31554e);}(_0xe13e,0xde));var _0xee13=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe13e[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xee13('0x0'));var timeout=require(_0xee13('0x1'));var express=require(_0xee13('0x2'));var router=express[_0xee13('0x3')]();var fs_extra=require(_0xee13('0x4'));var auth=require(_0xee13('0x5'));var interaction=require(_0xee13('0x6'));var config=require(_0xee13('0x7'));var controller=require(_0xee13('0x8'));router[_0xee13('0x9')]('/',auth[_0xee13('0xa')](),controller['index']);router[_0xee13('0x9')](_0xee13('0xb'),auth[_0xee13('0xa')](),controller[_0xee13('0xc')]);router['post']('/',auth[_0xee13('0xa')](),controller[_0xee13('0xd')]);router[_0xee13('0xe')](_0xee13('0xb'),auth[_0xee13('0xa')](),controller['update']);router[_0xee13('0xf')](_0xee13('0xb'),auth['isAuthenticated'](),controller[_0xee13('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 55696f6..2cd3b0d 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 _0xe083=['STRING','name','sequelize','exports'];(function(_0xdf3d71,_0x1c3a2c){var _0x40c74e=function(_0x340937){while(--_0x340937){_0xdf3d71['push'](_0xdf3d71['shift']());}};_0x40c74e(++_0x1c3a2c);}(_0xe083,0x1a6));var _0x3e08=function(_0x44af1f,_0x4c79a4){_0x44af1f=_0x44af1f-0x0;var _0x50ecff=_0xe083[_0x44af1f];return _0x50ecff;};'use strict';var Sequelize=require(_0x3e08('0x0'));module[_0x3e08('0x1')]={'name':{'type':Sequelize[_0x3e08('0x2')],'unique':_0x3e08('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5089=['exports','name','STRING','sequelize'];(function(_0xaab2f5,_0x58463f){var _0x3b28ea=function(_0xcbc73c){while(--_0xcbc73c){_0xaab2f5['push'](_0xaab2f5['shift']());}};_0x3b28ea(++_0x58463f);}(_0x5089,0x1bb));var _0x9508=function(_0x1a8f86,_0x5ed9c4){_0x1a8f86=_0x1a8f86-0x0;var _0x20d876=_0x5089[_0x1a8f86];return _0x20d876;};'use strict';var Sequelize=require(_0x9508('0x0'));module[_0x9508('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x9508('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x9508('0x3')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index bb915a9..f864ab7 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 _0xbf34=['filter','merge','includeAll','include','findAll','rows','catch','params','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','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','json','offset','undefined','limit','count','status','reject','save','update','then','get','Variables','UserProfileResource','destroy','error','stack','send','index','Variable','rawAttributes','fieldName','type','key','model','map','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL'];(function(_0x3b2e19,_0x53e08f){var _0x21525f=function(_0x5c75dd){while(--_0x5c75dd){_0x3b2e19['push'](_0x3b2e19['shift']());}};_0x21525f(++_0x53e08f);}(_0xbf34,0x11e));var _0x4bf3=function(_0x4d7120,_0x2ab618){_0x4d7120=_0x4d7120-0x0;var _0x3d76f3=_0xbf34[_0x4d7120];return _0x3d76f3;};'use strict';var emlformat=require(_0x4bf3('0x0'));var rimraf=require(_0x4bf3('0x1'));var zipdir=require(_0x4bf3('0x2'));var jsonpatch=require(_0x4bf3('0x3'));var rp=require(_0x4bf3('0x4'));var moment=require(_0x4bf3('0x5'));var BPromise=require(_0x4bf3('0x6'));var Mustache=require(_0x4bf3('0x7'));var util=require(_0x4bf3('0x8'));var path=require(_0x4bf3('0x9'));var sox=require(_0x4bf3('0xa'));var csv=require(_0x4bf3('0xb'));var ejs=require(_0x4bf3('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4bf3('0xd'));var crypto=require(_0x4bf3('0xe'));var jsforce=require(_0x4bf3('0xf'));var deskjs=require(_0x4bf3('0x10'));var toCsv=require('to-csv');var querystring=require(_0x4bf3('0x11'));var Papa=require(_0x4bf3('0x12'));var Redis=require(_0x4bf3('0x13'));var authService=require(_0x4bf3('0x14'));var qs=require(_0x4bf3('0x15'));var as=require(_0x4bf3('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4bf3('0x17'));var utils=require(_0x4bf3('0x18'));var config=require(_0x4bf3('0x19'));var licenseUtil=require(_0x4bf3('0x1a'));var db=require(_0x4bf3('0x1b'))['db'];function respondWithStatusCode(_0x58e651,_0x4e7358){_0x4e7358=_0x4e7358||0xcc;return function(_0x42f416){if(_0x42f416){return _0x58e651[_0x4bf3('0x1c')](_0x4e7358);}return _0x58e651['status'](_0x4e7358)[_0x4bf3('0x1d')]();};}function respondWithResult(_0xe9a674,_0x2255d7){_0x2255d7=_0x2255d7||0xc8;return function(_0x1de995){if(_0x1de995){return _0xe9a674['status'](_0x2255d7)[_0x4bf3('0x1e')](_0x1de995);}};}function respondWithFilteredResult(_0x46ed2d,_0x1fbf38){return function(_0x54aa14){if(_0x54aa14){var _0x10ae40=typeof _0x1fbf38[_0x4bf3('0x1f')]===_0x4bf3('0x20')&&typeof _0x1fbf38[_0x4bf3('0x21')]===_0x4bf3('0x20');var _0x238002=_0x54aa14[_0x4bf3('0x22')];var _0x3c517c=_0x10ae40?0x0:_0x1fbf38['offset'];var _0x4f4e63=_0x10ae40?_0x54aa14['count']:_0x1fbf38['offset']+_0x1fbf38[_0x4bf3('0x21')];var _0x39f04f;if(_0x4f4e63>=_0x238002){_0x4f4e63=_0x238002;_0x39f04f=0xc8;}else{_0x39f04f=0xce;}_0x46ed2d[_0x4bf3('0x23')](_0x39f04f);return _0x46ed2d['set']('Content-Range',_0x3c517c+'-'+_0x4f4e63+'/'+_0x238002)[_0x4bf3('0x1e')](_0x54aa14);}return null;};}function patchUpdates(_0x7d3aec){return function(_0x31747c){try{jsonpatch['apply'](_0x31747c,_0x7d3aec,!![]);}catch(_0x24ddd2){return BPromise[_0x4bf3('0x24')](_0x24ddd2);}return _0x31747c[_0x4bf3('0x25')]();};}function saveUpdates(_0x5585a1,_0x35105d){return function(_0x419c66){if(_0x419c66){return _0x419c66[_0x4bf3('0x26')](_0x5585a1)['then'](function(_0x38095b){return _0x38095b;});}return null;};}function removeEntity(_0x52bd68,_0x4b6cb9){return function(_0x5b5167){if(_0x5b5167){return _0x5b5167['destroy']()[_0x4bf3('0x27')](function(){var _0x3921e0=_0x5b5167[_0x4bf3('0x28')]({'plain':!![]});var _0x4e4a62=_0x4bf3('0x29');return db[_0x4bf3('0x2a')][_0x4bf3('0x2b')]({'where':{'type':_0x4e4a62,'resourceId':_0x3921e0['id']}})[_0x4bf3('0x27')](function(){return _0x5b5167;});})[_0x4bf3('0x27')](function(){_0x52bd68[_0x4bf3('0x23')](0xcc)[_0x4bf3('0x1d')]();});}};}function handleEntityNotFound(_0x99c48e,_0x16de55){return function(_0x1992db){if(!_0x1992db){_0x99c48e['sendStatus'](0x194);}return _0x1992db;};}function handleError(_0x54a0ce,_0x1b56b5){_0x1b56b5=_0x1b56b5||0x1f4;return function(_0x2462a1){logger[_0x4bf3('0x2c')](_0x2462a1[_0x4bf3('0x2d')]);if(_0x2462a1['name']){delete _0x2462a1['name'];}_0x54a0ce[_0x4bf3('0x23')](_0x1b56b5)[_0x4bf3('0x2e')](_0x2462a1);};}exports[_0x4bf3('0x2f')]=function(_0x44273e,_0x27f560){var _0x534312={},_0xa06081={},_0x1cffc5={'count':0x0,'rows':[]};var _0x9b4d59=_['map'](db[_0x4bf3('0x30')][_0x4bf3('0x31')],function(_0x531e19){return{'name':_0x531e19[_0x4bf3('0x32')],'type':_0x531e19[_0x4bf3('0x33')][_0x4bf3('0x34')]};});_0xa06081[_0x4bf3('0x35')]=_[_0x4bf3('0x36')](_0x9b4d59,_0x4bf3('0x37'));_0xa06081[_0x4bf3('0x38')]=_[_0x4bf3('0x39')](_0x44273e[_0x4bf3('0x38')]);_0xa06081[_0x4bf3('0x3a')]=_[_0x4bf3('0x3b')](_0xa06081[_0x4bf3('0x35')],_0xa06081['query']);_0x534312['attributes']=_[_0x4bf3('0x3b')](_0xa06081[_0x4bf3('0x35')],qs[_0x4bf3('0x3c')](_0x44273e['query'][_0x4bf3('0x3c')]));_0x534312[_0x4bf3('0x3d')]=_0x534312[_0x4bf3('0x3d')][_0x4bf3('0x3e')]?_0x534312['attributes']:_0xa06081[_0x4bf3('0x35')];if(!_0x44273e[_0x4bf3('0x38')][_0x4bf3('0x3f')](_0x4bf3('0x40'))){_0x534312[_0x4bf3('0x21')]=qs[_0x4bf3('0x21')](_0x44273e['query'][_0x4bf3('0x21')]);_0x534312[_0x4bf3('0x1f')]=qs[_0x4bf3('0x1f')](_0x44273e[_0x4bf3('0x38')][_0x4bf3('0x1f')]);}_0x534312[_0x4bf3('0x41')]=qs['sort'](_0x44273e[_0x4bf3('0x38')][_0x4bf3('0x42')]);_0x534312[_0x4bf3('0x43')]=qs['filters'](_[_0x4bf3('0x44')](_0x44273e[_0x4bf3('0x38')],_0xa06081[_0x4bf3('0x3a')]),_0x9b4d59);if(_0x44273e['query']['filter']){_0x534312[_0x4bf3('0x43')]=_['merge'](_0x534312['where'],{'$or':_[_0x4bf3('0x36')](_0x9b4d59,function(_0x46d34){if(_0x46d34['type']!==_0x4bf3('0x45')){var _0x4601f1={};_0x4601f1[_0x46d34[_0x4bf3('0x37')]]={'$like':'%'+_0x44273e[_0x4bf3('0x38')][_0x4bf3('0x46')]+'%'};return _0x4601f1;}})});}_0x534312=_[_0x4bf3('0x47')]({},_0x534312,_0x44273e['options']);var _0x412b5c={'where':_0x534312[_0x4bf3('0x43')]};return db['Variable']['count'](_0x412b5c)[_0x4bf3('0x27')](function(_0x868519){_0x1cffc5[_0x4bf3('0x22')]=_0x868519;if(_0x44273e[_0x4bf3('0x38')][_0x4bf3('0x48')]){_0x534312[_0x4bf3('0x49')]=[{'all':!![]}];}return db[_0x4bf3('0x30')][_0x4bf3('0x4a')](_0x534312);})[_0x4bf3('0x27')](function(_0xebd480){_0x1cffc5[_0x4bf3('0x4b')]=_0xebd480;return _0x1cffc5;})[_0x4bf3('0x27')](respondWithFilteredResult(_0x27f560,_0x534312))[_0x4bf3('0x4c')](handleError(_0x27f560,null));};exports['show']=function(_0x3d969f,_0x1cc835){var _0x27ecd7={'raw':!![],'where':{'id':_0x3d969f[_0x4bf3('0x4d')]['id']}},_0x296c6f={};_0x296c6f[_0x4bf3('0x35')]=_[_0x4bf3('0x39')](db[_0x4bf3('0x30')][_0x4bf3('0x31')]);_0x296c6f[_0x4bf3('0x38')]=_[_0x4bf3('0x39')](_0x3d969f[_0x4bf3('0x38')]);_0x296c6f[_0x4bf3('0x3a')]=_[_0x4bf3('0x3b')](_0x296c6f[_0x4bf3('0x35')],_0x296c6f[_0x4bf3('0x38')]);_0x27ecd7[_0x4bf3('0x3d')]=_[_0x4bf3('0x3b')](_0x296c6f[_0x4bf3('0x35')],qs['fields'](_0x3d969f['query'][_0x4bf3('0x3c')]));_0x27ecd7['attributes']=_0x27ecd7[_0x4bf3('0x3d')][_0x4bf3('0x3e')]?_0x27ecd7[_0x4bf3('0x3d')]:_0x296c6f[_0x4bf3('0x35')];if(_0x3d969f['query']['includeAll']){_0x27ecd7[_0x4bf3('0x49')]=[{'all':!![]}];}_0x27ecd7=_[_0x4bf3('0x47')]({},_0x27ecd7,_0x3d969f[_0x4bf3('0x4e')]);return db['Variable'][_0x4bf3('0x4f')](_0x27ecd7)[_0x4bf3('0x27')](handleEntityNotFound(_0x1cc835,null))['then'](respondWithResult(_0x1cc835,null))['catch'](handleError(_0x1cc835,null));};exports[_0x4bf3('0x50')]=function(_0x5f5937,_0x3fb8dd){return db[_0x4bf3('0x30')]['create'](_0x5f5937['body'],{})[_0x4bf3('0x27')](function(_0x2ae7fe){var _0xf532bd=_0x5f5937[_0x4bf3('0x51')]['get']({'plain':!![]});if(!_0xf532bd)throw new Error(_0x4bf3('0x52'));if(_0xf532bd[_0x4bf3('0x53')]===_0x4bf3('0x51')){var _0x4d9f14=_0x2ae7fe[_0x4bf3('0x28')]({'plain':!![]});var _0x4e13bb=_0x4bf3('0x29');return db[_0x4bf3('0x54')][_0x4bf3('0x4f')]({'where':{'name':_0x4e13bb,'userProfileId':_0xf532bd[_0x4bf3('0x55')]},'raw':!![]})[_0x4bf3('0x27')](function(_0x2cfb11){if(_0x2cfb11&&_0x2cfb11[_0x4bf3('0x56')]===0x0){return db['UserProfileResource'][_0x4bf3('0x50')]({'name':_0x4d9f14[_0x4bf3('0x37')],'resourceId':_0x4d9f14['id'],'type':_0x2cfb11[_0x4bf3('0x37')],'sectionId':_0x2cfb11['id']},{})[_0x4bf3('0x27')](function(){return _0x2ae7fe;});}else{return _0x2ae7fe;}})[_0x4bf3('0x4c')](function(_0x24eca6){logger['error'](_0x4bf3('0x57'),_0x24eca6);throw _0x24eca6;});}return _0x2ae7fe;})[_0x4bf3('0x27')](respondWithResult(_0x3fb8dd,0xc9))[_0x4bf3('0x4c')](handleError(_0x3fb8dd,null));};exports['update']=function(_0x3647a3,_0x1ae6ea){if(_0x3647a3[_0x4bf3('0x58')]['id']){delete _0x3647a3[_0x4bf3('0x58')]['id'];}return db[_0x4bf3('0x30')]['find']({'where':{'id':_0x3647a3[_0x4bf3('0x4d')]['id']}})[_0x4bf3('0x27')](handleEntityNotFound(_0x1ae6ea,null))[_0x4bf3('0x27')](saveUpdates(_0x3647a3[_0x4bf3('0x58')],null))[_0x4bf3('0x27')](respondWithResult(_0x1ae6ea,null))[_0x4bf3('0x4c')](handleError(_0x1ae6ea,null));};exports[_0x4bf3('0x2b')]=function(_0x176f12,_0x7cd0a3){return db[_0x4bf3('0x30')]['find']({'where':{'id':_0x176f12['params']['id']}})[_0x4bf3('0x27')](handleEntityNotFound(_0x7cd0a3,null))['then'](removeEntity(_0x7cd0a3,null))[_0x4bf3('0x4c')](handleError(_0x7cd0a3,null));}; \ No newline at end of file +var _0x3698=['path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','get','Variables','UserProfileResource','error','stack','name','send','Variable','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','moment','bluebird','mustache','util'];(function(_0x36d860,_0x39a7a8){var _0x2f556a=function(_0x4808f8){while(--_0x4808f8){_0x36d860['push'](_0x36d860['shift']());}};_0x2f556a(++_0x39a7a8);}(_0x3698,0x185));var _0x8369=function(_0x45e389,_0x1b0766){_0x45e389=_0x45e389-0x0;var _0x49bae5=_0x3698[_0x45e389];return _0x49bae5;};'use strict';var emlformat=require(_0x8369('0x0'));var rimraf=require(_0x8369('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8369('0x2'));var BPromise=require(_0x8369('0x3'));var Mustache=require(_0x8369('0x4'));var util=require(_0x8369('0x5'));var path=require(_0x8369('0x6'));var sox=require(_0x8369('0x7'));var csv=require(_0x8369('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8369('0x9'));var _=require('lodash');var squel=require(_0x8369('0xa'));var crypto=require(_0x8369('0xb'));var jsforce=require(_0x8369('0xc'));var deskjs=require(_0x8369('0xd'));var toCsv=require(_0x8369('0x8'));var querystring=require('querystring');var Papa=require(_0x8369('0xe'));var Redis=require(_0x8369('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8369('0x10'));var logger=require('../../config/logger')(_0x8369('0x11'));var utils=require(_0x8369('0x12'));var config=require(_0x8369('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x8369('0x14'))['db'];function respondWithStatusCode(_0x2d2553,_0xa36240){_0xa36240=_0xa36240||0xcc;return function(_0x271943){if(_0x271943){return _0x2d2553[_0x8369('0x15')](_0xa36240);}return _0x2d2553['status'](_0xa36240)[_0x8369('0x16')]();};}function respondWithResult(_0x560d20,_0x156a0b){_0x156a0b=_0x156a0b||0xc8;return function(_0x49e7f2){if(_0x49e7f2){return _0x560d20[_0x8369('0x17')](_0x156a0b)[_0x8369('0x18')](_0x49e7f2);}};}function respondWithFilteredResult(_0x1cda65,_0x3c9fce){return function(_0x27776e){if(_0x27776e){var _0x568fb7=typeof _0x3c9fce[_0x8369('0x19')]===_0x8369('0x1a')&&typeof _0x3c9fce['limit']===_0x8369('0x1a');var _0x394f31=_0x27776e['count'];var _0x803f1f=_0x568fb7?0x0:_0x3c9fce[_0x8369('0x19')];var _0x3c4a26=_0x568fb7?_0x27776e[_0x8369('0x1b')]:_0x3c9fce['offset']+_0x3c9fce[_0x8369('0x1c')];var _0x5de0c9;if(_0x3c4a26>=_0x394f31){_0x3c4a26=_0x394f31;_0x5de0c9=0xc8;}else{_0x5de0c9=0xce;}_0x1cda65[_0x8369('0x17')](_0x5de0c9);return _0x1cda65['set'](_0x8369('0x1d'),_0x803f1f+'-'+_0x3c4a26+'/'+_0x394f31)[_0x8369('0x18')](_0x27776e);}return null;};}function patchUpdates(_0xacfbb2){return function(_0x333981){try{jsonpatch[_0x8369('0x1e')](_0x333981,_0xacfbb2,!![]);}catch(_0x4238de){return BPromise[_0x8369('0x1f')](_0x4238de);}return _0x333981[_0x8369('0x20')]();};}function saveUpdates(_0x6486d,_0x12dba4){return function(_0x4fb438){if(_0x4fb438){return _0x4fb438[_0x8369('0x21')](_0x6486d)[_0x8369('0x22')](function(_0x2cd6ec){return _0x2cd6ec;});}return null;};}function removeEntity(_0x2da184,_0x2c849d){return function(_0x445577){if(_0x445577){return _0x445577[_0x8369('0x23')]()[_0x8369('0x22')](function(){var _0x5bb4be=_0x445577[_0x8369('0x24')]({'plain':!![]});var _0x3ed699=_0x8369('0x25');return db[_0x8369('0x26')][_0x8369('0x23')]({'where':{'type':_0x3ed699,'resourceId':_0x5bb4be['id']}})[_0x8369('0x22')](function(){return _0x445577;});})[_0x8369('0x22')](function(){_0x2da184[_0x8369('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6bb698,_0x2f010){return function(_0xe58ecd){if(!_0xe58ecd){_0x6bb698['sendStatus'](0x194);}return _0xe58ecd;};}function handleError(_0x3354f4,_0x1037bf){_0x1037bf=_0x1037bf||0x1f4;return function(_0x2429b5){logger[_0x8369('0x27')](_0x2429b5[_0x8369('0x28')]);if(_0x2429b5[_0x8369('0x29')]){delete _0x2429b5['name'];}_0x3354f4['status'](_0x1037bf)[_0x8369('0x2a')](_0x2429b5);};}exports['index']=function(_0x33d9fe,_0x3b23b4){var _0x202542={},_0x6fae56={},_0x4fc2e3={'count':0x0,'rows':[]};var _0x56bf4d=_['map'](db[_0x8369('0x2b')][_0x8369('0x2c')],function(_0x5be813){return{'name':_0x5be813[_0x8369('0x2d')],'type':_0x5be813[_0x8369('0x2e')][_0x8369('0x2f')]};});_0x6fae56[_0x8369('0x30')]=_[_0x8369('0x31')](_0x56bf4d,_0x8369('0x29'));_0x6fae56[_0x8369('0x32')]=_[_0x8369('0x33')](_0x33d9fe[_0x8369('0x32')]);_0x6fae56[_0x8369('0x34')]=_[_0x8369('0x35')](_0x6fae56[_0x8369('0x30')],_0x6fae56[_0x8369('0x32')]);_0x202542[_0x8369('0x36')]=_['intersection'](_0x6fae56[_0x8369('0x30')],qs[_0x8369('0x37')](_0x33d9fe[_0x8369('0x32')][_0x8369('0x37')]));_0x202542['attributes']=_0x202542[_0x8369('0x36')][_0x8369('0x38')]?_0x202542[_0x8369('0x36')]:_0x6fae56[_0x8369('0x30')];if(!_0x33d9fe['query']['hasOwnProperty']('nolimit')){_0x202542['limit']=qs[_0x8369('0x1c')](_0x33d9fe[_0x8369('0x32')][_0x8369('0x1c')]);_0x202542[_0x8369('0x19')]=qs[_0x8369('0x19')](_0x33d9fe['query'][_0x8369('0x19')]);}_0x202542[_0x8369('0x39')]=qs[_0x8369('0x3a')](_0x33d9fe[_0x8369('0x32')][_0x8369('0x3a')]);_0x202542[_0x8369('0x3b')]=qs[_0x8369('0x34')](_['pick'](_0x33d9fe['query'],_0x6fae56[_0x8369('0x34')]),_0x56bf4d);if(_0x33d9fe[_0x8369('0x32')][_0x8369('0x3c')]){_0x202542[_0x8369('0x3b')]=_[_0x8369('0x3d')](_0x202542[_0x8369('0x3b')],{'$or':_[_0x8369('0x31')](_0x56bf4d,function(_0x2652c9){if(_0x2652c9['type']!==_0x8369('0x3e')){var _0x42bd0e={};_0x42bd0e[_0x2652c9['name']]={'$like':'%'+_0x33d9fe[_0x8369('0x32')][_0x8369('0x3c')]+'%'};return _0x42bd0e;}})});}_0x202542=_[_0x8369('0x3d')]({},_0x202542,_0x33d9fe['options']);var _0x4c2609={'where':_0x202542[_0x8369('0x3b')]};return db[_0x8369('0x2b')][_0x8369('0x1b')](_0x4c2609)[_0x8369('0x22')](function(_0x110719){_0x4fc2e3[_0x8369('0x1b')]=_0x110719;if(_0x33d9fe['query'][_0x8369('0x3f')]){_0x202542[_0x8369('0x40')]=[{'all':!![]}];}return db[_0x8369('0x2b')][_0x8369('0x41')](_0x202542);})[_0x8369('0x22')](function(_0x4fede1){_0x4fc2e3[_0x8369('0x42')]=_0x4fede1;return _0x4fc2e3;})[_0x8369('0x22')](respondWithFilteredResult(_0x3b23b4,_0x202542))[_0x8369('0x43')](handleError(_0x3b23b4,null));};exports['show']=function(_0x1b7c17,_0x3232ba){var _0x119408={'raw':!![],'where':{'id':_0x1b7c17[_0x8369('0x44')]['id']}},_0x135c73={};_0x135c73[_0x8369('0x30')]=_[_0x8369('0x33')](db['Variable'][_0x8369('0x2c')]);_0x135c73['query']=_[_0x8369('0x33')](_0x1b7c17[_0x8369('0x32')]);_0x135c73['filters']=_[_0x8369('0x35')](_0x135c73['model'],_0x135c73[_0x8369('0x32')]);_0x119408[_0x8369('0x36')]=_['intersection'](_0x135c73[_0x8369('0x30')],qs[_0x8369('0x37')](_0x1b7c17[_0x8369('0x32')]['fields']));_0x119408['attributes']=_0x119408[_0x8369('0x36')][_0x8369('0x38')]?_0x119408['attributes']:_0x135c73[_0x8369('0x30')];if(_0x1b7c17['query']['includeAll']){_0x119408[_0x8369('0x40')]=[{'all':!![]}];}_0x119408=_[_0x8369('0x3d')]({},_0x119408,_0x1b7c17[_0x8369('0x45')]);return db[_0x8369('0x2b')][_0x8369('0x46')](_0x119408)[_0x8369('0x22')](handleEntityNotFound(_0x3232ba,null))['then'](respondWithResult(_0x3232ba,null))[_0x8369('0x43')](handleError(_0x3232ba,null));};exports[_0x8369('0x47')]=function(_0x52444f,_0x5e4fb9){return db[_0x8369('0x2b')]['create'](_0x52444f[_0x8369('0x48')],{})[_0x8369('0x22')](function(_0x56d1f4){var _0x14f64a=_0x52444f[_0x8369('0x49')]['get']({'plain':!![]});if(!_0x14f64a)throw new Error(_0x8369('0x4a'));if(_0x14f64a[_0x8369('0x4b')]===_0x8369('0x49')){var _0xafbaec=_0x56d1f4[_0x8369('0x24')]({'plain':!![]});var _0x37a737='Variables';return db['UserProfileSection'][_0x8369('0x46')]({'where':{'name':_0x37a737,'userProfileId':_0x14f64a[_0x8369('0x4c')]},'raw':!![]})[_0x8369('0x22')](function(_0x401882){if(_0x401882&&_0x401882[_0x8369('0x4d')]===0x0){return db[_0x8369('0x26')][_0x8369('0x47')]({'name':_0xafbaec[_0x8369('0x29')],'resourceId':_0xafbaec['id'],'type':_0x401882[_0x8369('0x29')],'sectionId':_0x401882['id']},{})[_0x8369('0x22')](function(){return _0x56d1f4;});}else{return _0x56d1f4;}})['catch'](function(_0x3ced11){logger['error'](_0x8369('0x4e'),_0x3ced11);throw _0x3ced11;});}return _0x56d1f4;})[_0x8369('0x22')](respondWithResult(_0x5e4fb9,0xc9))[_0x8369('0x43')](handleError(_0x5e4fb9,null));};exports[_0x8369('0x21')]=function(_0x511ec7,_0x1c05b0){if(_0x511ec7[_0x8369('0x48')]['id']){delete _0x511ec7[_0x8369('0x48')]['id'];}return db['Variable'][_0x8369('0x46')]({'where':{'id':_0x511ec7[_0x8369('0x44')]['id']}})[_0x8369('0x22')](handleEntityNotFound(_0x1c05b0,null))[_0x8369('0x22')](saveUpdates(_0x511ec7[_0x8369('0x48')],null))[_0x8369('0x22')](respondWithResult(_0x1c05b0,null))[_0x8369('0x43')](handleError(_0x1c05b0,null));};exports[_0x8369('0x23')]=function(_0x1e5728,_0x24ac27){return db[_0x8369('0x2b')][_0x8369('0x46')]({'where':{'id':_0x1e5728['params']['id']}})[_0x8369('0x22')](handleEntityNotFound(_0x24ac27,null))[_0x8369('0x22')](removeEntity(_0x24ac27,null))[_0x8369('0x43')](handleError(_0x24ac27,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 7e68780..ba48629 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 _0x7e7b=['api','moment','request-promise','path','rimraf','../../config/environment','exports','define','Variable','tools_variables','lodash','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7e7b,0x17e));var _0xb7e7=function(_0x216a2f,_0x4e135f){_0x216a2f=_0x216a2f-0x0;var _0x5c5c5b=_0x7e7b[_0x216a2f];return _0x5c5c5b;};'use strict';var _=require(_0xb7e7('0x0'));var util=require(_0xb7e7('0x1'));var logger=require('../../config/logger')(_0xb7e7('0x2'));var moment=require(_0xb7e7('0x3'));var BPromise=require('bluebird');var rp=require(_0xb7e7('0x4'));var fs=require('fs');var path=require(_0xb7e7('0x5'));var rimraf=require(_0xb7e7('0x6'));var config=require(_0xb7e7('0x7'));var attributes=require('./variable.attributes');module[_0xb7e7('0x8')]=function(_0x92397a,_0x3868e1){return _0x92397a[_0xb7e7('0x9')](_0xb7e7('0xa'),attributes,{'tableName':_0xb7e7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5a1c=['Variable','tools_variables','lodash','../../config/logger','./variable.attributes','exports','define'];(function(_0x563f56,_0x1ba1c4){var _0x12f17e=function(_0x1e8cfd){while(--_0x1e8cfd){_0x563f56['push'](_0x563f56['shift']());}};_0x12f17e(++_0x1ba1c4);}(_0x5a1c,0x8e));var _0xc5a1=function(_0x3de662,_0x5de27a){_0x3de662=_0x3de662-0x0;var _0x24a5b8=_0x5a1c[_0x3de662];return _0x24a5b8;};'use strict';var _=require(_0xc5a1('0x0'));var util=require('util');var logger=require(_0xc5a1('0x1'))('api');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('../../config/environment');var attributes=require(_0xc5a1('0x2'));module[_0xc5a1('0x3')]=function(_0x4ed3e5,_0x314289){return _0x4ed3e5[_0xc5a1('0x4')](_0xc5a1('0x5'),attributes,{'tableName':_0xc5a1('0x6'),'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 e041987..79f9310 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(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x326f,0xd1));var _0xf326=function(_0x1cdd00,_0x1e2ec0){_0x1cdd00=_0x1cdd00-0x0;var _0x15df3b=_0x326f[_0x1cdd00];return _0x15df3b;};'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 _0x6aa7=['include','model','attributes','map','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowVariable','find','options','raw','where'];(function(_0x49e6e2,_0x52fb1a){var _0x1ebe9c=function(_0x5259e6){while(--_0x5259e6){_0x49e6e2['push'](_0x49e6e2['shift']());}};_0x1ebe9c(++_0x52fb1a);}(_0x6aa7,0x178));var _0x76aa=function(_0x4b9eda,_0x477245){_0x4b9eda=_0x4b9eda-0x0;var _0x4d0e65=_0x6aa7[_0x4b9eda];return _0x4d0e65;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32dee5,_0x36d12b,_0xa9b695){return new BPromise(function(_0x56d6bc,_0x3dae33){return client[_0x76aa('0x9')](_0x32dee5,_0xa9b695)[_0x76aa('0xa')](function(_0x557d69){logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,_0x76aa('0xd'));logger[_0x76aa('0xe')](_0x76aa('0xf'),_0x36d12b,_0x76aa('0xd'),JSON[_0x76aa('0x10')](_0x557d69));if(_0x557d69[_0x76aa('0x11')]){if(_0x557d69[_0x76aa('0x11')][_0x76aa('0x12')]===0x1f4){logger['error'](_0x76aa('0xc'),_0x36d12b,_0x557d69['error'][_0x76aa('0x13')]);return _0x3dae33(_0x557d69[_0x76aa('0x11')][_0x76aa('0x13')]);}logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x557d69['error']['message']);return _0x56d6bc(_0x557d69[_0x76aa('0x11')]['message']);}else{logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,'request\x20sent');_0x56d6bc(_0x557d69[_0x76aa('0x14')]['message']);}})[_0x76aa('0x15')](function(_0x5181d2){logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x5181d2);_0x3dae33(_0x5181d2);});});}exports[_0x76aa('0x16')]=function(_0x21c16d){var _0xa1bc7=this;return new Promise(function(_0x3ead3f,_0x496902){return db['Variable'][_0x76aa('0x17')]({'raw':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x19')]===undefined?!![]:![]:!![],'where':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1a')]||null:null,'attributes':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')]['attributes']||null:null,'include':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1b')]?_['map'](_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1b')],function(_0x31252f){return{'model':db[_0x31252f[_0x76aa('0x1c')]],'as':_0x31252f['as'],'attributes':_0x31252f[_0x76aa('0x1d')],'include':_0x31252f[_0x76aa('0x1b')]?_[_0x76aa('0x1e')](_0x31252f[_0x76aa('0x1b')],function(_0x32bf9f){return{'model':db[_0x32bf9f[_0x76aa('0x1c')]],'as':_0x32bf9f['as'],'attributes':_0x32bf9f[_0x76aa('0x1d')],'include':_0x32bf9f[_0x76aa('0x1b')]?_[_0x76aa('0x1e')](_0x32bf9f['include'],function(_0xb5e8a9){return{'model':db[_0xb5e8a9[_0x76aa('0x1c')]],'as':_0xb5e8a9['as'],'attributes':_0xb5e8a9[_0x76aa('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x76aa('0xa')](function(_0xa1e6){logger[_0x76aa('0xb')](_0x76aa('0x16'),_0x21c16d);logger[_0x76aa('0xe')](_0x76aa('0x16'),_0x21c16d,JSON[_0x76aa('0x10')](_0xa1e6));_0x3ead3f(_0xa1e6);})['catch'](function(_0x3fcb7f){logger['error'](_0x76aa('0x16'),_0x3fcb7f[_0x76aa('0x13')],_0x21c16d);_0x496902(_0xa1bc7[_0x76aa('0x11')](0x1f4,_0x3fcb7f[_0x76aa('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index fa60669..27b7f33 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 _0xda82=['/fetch','isAuthenticated','canUpdate','fetch','/reset','/pull','pull','/restart','restart','/migrations','migrations','express','Router','../../components/auth/service','./version.controller','get','index'];(function(_0x542604,_0x3a014d){var _0x405228=function(_0x29cf28){while(--_0x29cf28){_0x542604['push'](_0x542604['shift']());}};_0x405228(++_0x3a014d);}(_0xda82,0x10a));var _0x2da8=function(_0x523594,_0x138b9a){_0x523594=_0x523594-0x0;var _0x415838=_0xda82[_0x523594];return _0x415838;};'use strict';var express=require(_0x2da8('0x0'));var router=express[_0x2da8('0x1')]();var auth=require(_0x2da8('0x2'));var controller=require(_0x2da8('0x3'));router[_0x2da8('0x4')]('/',controller[_0x2da8('0x5')]);router['get'](_0x2da8('0x6'),auth[_0x2da8('0x7')](),auth[_0x2da8('0x8')](),controller[_0x2da8('0x9')]);router[_0x2da8('0x4')](_0x2da8('0xa'),auth[_0x2da8('0x7')](),auth[_0x2da8('0x8')](),controller['reset']);router[_0x2da8('0x4')](_0x2da8('0xb'),auth[_0x2da8('0x7')](),auth[_0x2da8('0x8')](),controller[_0x2da8('0xc')]);router[_0x2da8('0x4')](_0x2da8('0xd'),auth[_0x2da8('0x7')](),controller[_0x2da8('0xe')]);router['get'](_0x2da8('0xf'),controller[_0x2da8('0x10')]);module['exports']=router; \ No newline at end of file +var _0x360a=['pull','restart','/migrations','exports','express','Router','./version.controller','get','index','isAuthenticated','canUpdate','fetch','/reset','reset','/pull'];(function(_0x4b4e87,_0x1c89a9){var _0x548db6=function(_0x576cac){while(--_0x576cac){_0x4b4e87['push'](_0x4b4e87['shift']());}};_0x548db6(++_0x1c89a9);}(_0x360a,0x16c));var _0xa360=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x360a[_0x2be8c2];return _0x97f531;};'use strict';var express=require(_0xa360('0x0'));var router=express[_0xa360('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xa360('0x2'));router[_0xa360('0x3')]('/',controller[_0xa360('0x4')]);router['get']('/fetch',auth[_0xa360('0x5')](),auth[_0xa360('0x6')](),controller[_0xa360('0x7')]);router[_0xa360('0x3')](_0xa360('0x8'),auth[_0xa360('0x5')](),auth[_0xa360('0x6')](),controller[_0xa360('0x9')]);router[_0xa360('0x3')](_0xa360('0xa'),auth[_0xa360('0x5')](),auth['canUpdate'](),controller[_0xa360('0xb')]);router[_0xa360('0x3')]('/restart',auth[_0xa360('0x5')](),controller[_0xa360('0xc')]);router[_0xa360('0x3')](_0xa360('0xd'),controller['migrations']);module[_0xa360('0xe')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 8d461ae..f4c3eac 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 _0x8294=['query','latest','fetch','tags','2.0.0','status','json','origin','error','info','git\x20fetch','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','server','length','replace','.js','sequelize','Migration','getQueryInterface','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','map','Database\x20migrated\x20successfully\x20from\x20version\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','child_process','exec','../../mysqldb','../../config/pm2','../../config/logger','simple-git','root','exports','version'];(function(_0x55ab69,_0x575f0a){var _0x4b0aa7=function(_0x390e8b){while(--_0x390e8b){_0x55ab69['push'](_0x55ab69['shift']());}};_0x4b0aa7(++_0x575f0a);}(_0x8294,0xbf));var _0x4829=function(_0x38dea7,_0x9c5786){_0x38dea7=_0x38dea7-0x0;var _0xe0a471=_0x8294[_0x38dea7];return _0xe0a471;};'use strict';var Umzug=require(_0x4829('0x0'));var path=require(_0x4829('0x1'));var fs=require('fs');var _=require(_0x4829('0x2'));var pkginfo=require(_0x4829('0x3'))(module,'version');var compareVersions=require('compare-versions');var exec=require(_0x4829('0x4'))[_0x4829('0x5')];var db=require(_0x4829('0x6'))['db'];var config=require('../../config/environment');var pm2=require(_0x4829('0x7'));var logger=require(_0x4829('0x8'))('update');var git=require(_0x4829('0x9'))(config[_0x4829('0xa')]);exports['index']=function(_0x568c2f,_0x1e7a95){var _0x438aa9={'current':module[_0x4829('0xb')][_0x4829('0xc')],'phonebar':0x2};if(_0x568c2f['query']&&_0x568c2f[_0x4829('0xd')][_0x4829('0xe')]){return git[_0x4829('0xf')]()[_0x4829('0x10')](function(_0x13cb19,_0x2dbc65){_0x438aa9[_0x4829('0xe')]=(_0x13cb19?module['exports'][_0x4829('0xc')]:_0x2dbc65[_0x4829('0xe')])||_0x4829('0x11');return _0x1e7a95[_0x4829('0x12')](0xc8)[_0x4829('0x13')](_0x438aa9);});}else{return _0x1e7a95[_0x4829('0x12')](0xc8)[_0x4829('0x13')](_0x438aa9);}};exports['fetch']=function(_0x1fba2a,_0x5d002e){return git[_0x4829('0xf')]([_0x4829('0x14'),'master'],function(_0x34f181){if(_0x34f181){logger[_0x4829('0x15')](_0x34f181);return _0x5d002e[_0x4829('0x12')](0x1f4)[_0x4829('0x13')](_0x34f181);}logger[_0x4829('0x16')](_0x4829('0x17'));return _0x5d002e[_0x4829('0x12')](0xc8)[_0x4829('0x13')]({'output':'git\x20fetch\x20origin\x20master'});});};exports['reset']=function(_0x23ecdb,_0x3b5f66){return git[_0x4829('0x18')]([_0x4829('0x19'),_0x4829('0x1a')],function(_0x2297dc){if(_0x2297dc){logger[_0x4829('0x15')](_0x2297dc);return _0x3b5f66[_0x4829('0x12')](0x1f4)[_0x4829('0x13')](_0x2297dc);}logger[_0x4829('0x16')](_0x4829('0x1b'));return _0x3b5f66[_0x4829('0x12')](0xc8)[_0x4829('0x13')]({'output':_0x4829('0x1c')});});};exports[_0x4829('0x1d')]=function(_0x4e9ccd,_0x175bc1){exec(_0x4829('0x1e'),function(_0x298cd7,_0x21439f,_0x4ee98b){logger['info'](_0x21439f);logger['info'](_0x4ee98b);if(_0x298cd7){logger[_0x4829('0x15')](_0x298cd7);return _0x175bc1['status'](0x1f4)[_0x4829('0x13')](_0x298cd7);}return _0x175bc1[_0x4829('0x12')](0xc8)[_0x4829('0x13')]({'output':_0x21439f});});};exports['restart']=function(_0xa39de2,_0x41a0f2){return pm2['restart'](_0x4829('0x1f'))[_0x4829('0x20')](function(_0x1e3a94){logger[_0x4829('0x16')](_0x4829('0x21'),_0x1e3a94);return _0x41a0f2['status'](0xc8)['json']({'output':_0x4829('0x22')});})[_0x4829('0x23')](function(_0x827baa){logger[_0x4829('0x15')](_0x827baa);return _0x41a0f2[_0x4829('0x12')](0x1f4)[_0x4829('0x13')](_0x827baa);});};exports[_0x4829('0x24')]=function(_0x14b1ce,_0x34eac0){var _0x2fe05a=fs['readdirSync'](path['join'](config['root'],_0x4829('0x25'),_0x4829('0x24')));var _0x4f4aec=[];for(var _0x386da5=0x0;_0x386da5<_0x2fe05a[_0x4829('0x26')];_0x386da5++){var _0x49f5f3=_0x2fe05a[_0x386da5][_0x4829('0x27')](_0x4829('0x28'),'');if(compareVersions(module['exports']['version'],_0x49f5f3)===-0x1){_0x4f4aec['push'](_0x49f5f3);}}if(_0x4f4aec[_0x4829('0x26')]){var _0xd024bd=_0x4f4aec['sort'](compareVersions);var _0x3b4f84=new Umzug({'storage':_0x4829('0x29'),'storageOptions':{'model':db[_0x4829('0x2a')],'modelName':_0x4829('0x2a'),'columnName':'version'},'migrations':{'params':[db['sequelize'][_0x4829('0x2b')](),db[_0x4829('0x29')]['constructor'],function(){throw new Error(_0x4829('0x2c'));}],'path':path[_0x4829('0x2d')](config[_0x4829('0xa')],_0x4829('0x25'),_0x4829('0x24')),'pattern':/\.js$/}});_0x3b4f84['up']({'migrations':_[_0x4829('0x2e')](_0xd024bd,function(_0x20e59d){return _0x20e59d+_0x4829('0x28');})})[_0x4829('0x20')](function(){return _0x34eac0[_0x4829('0x12')](0xc8)[_0x4829('0x13')]({'output':_0x4829('0x2f')+module[_0x4829('0xb')]['version']+'\x20to\x20'+_[_0x4829('0x30')](_0xd024bd),'migrations':_['join'](_0xd024bd)});})[_0x4829('0x23')](function(_0x3ca575){if(_0x3ca575 instanceof db[_0x4829('0x29')][_0x4829('0x31')]){return _0x34eac0[_0x4829('0x12')](0xc8)[_0x4829('0x13')]({'output':_0x4829('0x32')});}else{return _0x34eac0[_0x4829('0x12')](0x1f4)[_0x4829('0x13')](_0x3ca575);}});}else{return _0x34eac0['status'](0xc8)[_0x4829('0x13')]({'output':_0x4829('0x32')});}}; \ No newline at end of file +var _0xf2a1=['replace','.js','push','sort','Migration','sequelize','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','Database\x20migrated\x20successfully\x20from\x20version\x20','last','umzug','compare-versions','exec','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','root','index','exports','version','query','latest','tags','2.0.0','status','json','fetch','origin','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','npm\x20install\x20--production','restart','then','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync','join','length'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xf2a1,0x1c4));var _0x1f2a=function(_0x216c7e,_0x1d36dc){_0x216c7e=_0x216c7e-0x0;var _0x286dc3=_0xf2a1[_0x216c7e];return _0x286dc3;};'use strict';var Umzug=require(_0x1f2a('0x0'));var path=require('path');var fs=require('fs');var _=require('lodash');var pkginfo=require('pkginfo')(module,'version');var compareVersions=require(_0x1f2a('0x1'));var exec=require('child_process')[_0x1f2a('0x2')];var db=require('../../mysqldb')['db'];var config=require(_0x1f2a('0x3'));var pm2=require(_0x1f2a('0x4'));var logger=require(_0x1f2a('0x5'))(_0x1f2a('0x6'));var git=require(_0x1f2a('0x7'))(config[_0x1f2a('0x8')]);exports[_0x1f2a('0x9')]=function(_0x28ef6f,_0x1f5982){var _0x535ecb={'current':module[_0x1f2a('0xa')][_0x1f2a('0xb')],'phonebar':0x2};if(_0x28ef6f[_0x1f2a('0xc')]&&_0x28ef6f[_0x1f2a('0xc')][_0x1f2a('0xd')]){return git['fetch']()[_0x1f2a('0xe')](function(_0x4047de,_0x293c58){_0x535ecb[_0x1f2a('0xd')]=(_0x4047de?module[_0x1f2a('0xa')][_0x1f2a('0xb')]:_0x293c58[_0x1f2a('0xd')])||_0x1f2a('0xf');return _0x1f5982[_0x1f2a('0x10')](0xc8)[_0x1f2a('0x11')](_0x535ecb);});}else{return _0x1f5982[_0x1f2a('0x10')](0xc8)[_0x1f2a('0x11')](_0x535ecb);}};exports['fetch']=function(_0x5882da,_0x3b907c){return git[_0x1f2a('0x12')]([_0x1f2a('0x13'),_0x1f2a('0x14')],function(_0x5975a4){if(_0x5975a4){logger[_0x1f2a('0x15')](_0x5975a4);return _0x3b907c[_0x1f2a('0x10')](0x1f4)['json'](_0x5975a4);}logger[_0x1f2a('0x16')](_0x1f2a('0x17'));return _0x3b907c[_0x1f2a('0x10')](0xc8)[_0x1f2a('0x11')]({'output':_0x1f2a('0x18')});});};exports[_0x1f2a('0x19')]=function(_0x13bd50,_0x575339){return git[_0x1f2a('0x19')]([_0x1f2a('0x1a'),_0x1f2a('0x1b')],function(_0x25851c){if(_0x25851c){logger[_0x1f2a('0x15')](_0x25851c);return _0x575339[_0x1f2a('0x10')](0x1f4)[_0x1f2a('0x11')](_0x25851c);}logger[_0x1f2a('0x16')](_0x1f2a('0x1c'));return _0x575339[_0x1f2a('0x10')](0xc8)[_0x1f2a('0x11')]({'output':_0x1f2a('0x1d')});});};exports['pull']=function(_0x5caa81,_0x6ed11d){exec(_0x1f2a('0x1e'),function(_0x3eea61,_0x354cdf,_0x437a94){logger[_0x1f2a('0x16')](_0x354cdf);logger['info'](_0x437a94);if(_0x3eea61){logger['error'](_0x3eea61);return _0x6ed11d['status'](0x1f4)[_0x1f2a('0x11')](_0x3eea61);}return _0x6ed11d[_0x1f2a('0x10')](0xc8)[_0x1f2a('0x11')]({'output':_0x354cdf});});};exports['restart']=function(_0x2c1720,_0x360d0b){return pm2[_0x1f2a('0x1f')]('motion2')[_0x1f2a('0x20')](function(_0x313b5a){logger[_0x1f2a('0x16')]('pm2\x20restart\x20motion\x20%s',_0x313b5a);return _0x360d0b[_0x1f2a('0x10')](0xc8)[_0x1f2a('0x11')]({'output':_0x1f2a('0x21')});})['catch'](function(_0x36fda5){logger['error'](_0x36fda5);return _0x360d0b[_0x1f2a('0x10')](0x1f4)[_0x1f2a('0x11')](_0x36fda5);});};exports[_0x1f2a('0x22')]=function(_0x1237f8,_0x4d6b41){var _0x17cdaf=fs[_0x1f2a('0x23')](path[_0x1f2a('0x24')](config[_0x1f2a('0x8')],'server',_0x1f2a('0x22')));var _0x313c6a=[];for(var _0x17c39f=0x0;_0x17c39f<_0x17cdaf[_0x1f2a('0x25')];_0x17c39f++){var _0xd5048d=_0x17cdaf[_0x17c39f][_0x1f2a('0x26')](_0x1f2a('0x27'),'');if(compareVersions(module[_0x1f2a('0xa')][_0x1f2a('0xb')],_0xd5048d)===-0x1){_0x313c6a[_0x1f2a('0x28')](_0xd5048d);}}if(_0x313c6a['length']){var _0x3e84f0=_0x313c6a[_0x1f2a('0x29')](compareVersions);var _0x1fe303=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0x1f2a('0x2a')],'modelName':_0x1f2a('0x2a'),'columnName':'version'},'migrations':{'params':[db[_0x1f2a('0x2b')]['getQueryInterface'](),db[_0x1f2a('0x2b')][_0x1f2a('0x2c')],function(){throw new Error(_0x1f2a('0x2d'));}],'path':path[_0x1f2a('0x24')](config[_0x1f2a('0x8')],'server',_0x1f2a('0x22')),'pattern':/\.js$/}});_0x1fe303['up']({'migrations':_[_0x1f2a('0x2e')](_0x3e84f0,function(_0x2b31d8){return _0x2b31d8+_0x1f2a('0x27');})})['then'](function(){return _0x4d6b41[_0x1f2a('0x10')](0xc8)[_0x1f2a('0x11')]({'output':_0x1f2a('0x2f')+module[_0x1f2a('0xa')]['version']+'\x20to\x20'+_[_0x1f2a('0x30')](_0x3e84f0),'migrations':_[_0x1f2a('0x24')](_0x3e84f0)});})['catch'](function(_0x54599e){if(_0x54599e instanceof db[_0x1f2a('0x2b')]['UniqueConstraintError']){return _0x4d6b41[_0x1f2a('0x10')](0xc8)[_0x1f2a('0x11')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x4d6b41[_0x1f2a('0x10')](0x1f4)[_0x1f2a('0x11')](_0x54599e);}});}else{return _0x4d6b41[_0x1f2a('0x10')](0xc8)[_0x1f2a('0x11')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 5c9b6d1..d98600c 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 _0x13cb=['./voiceAgentReport.controller','isAuthenticated','get','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x4ff4bc,_0x557e38){var _0x3e6a6a=function(_0x436dbe){while(--_0x436dbe){_0x4ff4bc['push'](_0x4ff4bc['shift']());}};_0x3e6a6a(++_0x557e38);}(_0x13cb,0x19c));var _0xb13c=function(_0x5baed9,_0x409757){_0x5baed9=_0x5baed9-0x0;var _0x43aad3=_0x13cb[_0x5baed9];return _0x43aad3;};'use strict';var multer=require(_0xb13c('0x0'));var util=require(_0xb13c('0x1'));var path=require(_0xb13c('0x2'));var timeout=require(_0xb13c('0x3'));var express=require(_0xb13c('0x4'));var router=express['Router']();var fs_extra=require(_0xb13c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb13c('0x6'));var config=require(_0xb13c('0x7'));var controller=require(_0xb13c('0x8'));router['get']('/',auth[_0xb13c('0x9')](),controller['index']);router[_0xb13c('0xa')](_0xb13c('0xb'),auth[_0xb13c('0x9')](),controller[_0xb13c('0xc')]);router['get'](_0xb13c('0xd'),auth['isAuthenticated'](),controller[_0xb13c('0xe')]);router[_0xb13c('0xf')]('/',auth[_0xb13c('0x9')](),controller[_0xb13c('0x10')]);router[_0xb13c('0x11')](_0xb13c('0xd'),auth[_0xb13c('0x9')](),controller['update']);router[_0xb13c('0x12')](_0xb13c('0xd'),auth[_0xb13c('0x9')](),controller[_0xb13c('0x13')]);module[_0xb13c('0x14')]=router; \ No newline at end of file +var _0xe370=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','index','get','/describe','describe','show','post','isAuthenticated','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x5dc173,_0x4c838f){var _0x30077e=function(_0xb6ca73){while(--_0xb6ca73){_0x5dc173['push'](_0x5dc173['shift']());}};_0x30077e(++_0x4c838f);}(_0xe370,0xba));var _0x0e37=function(_0x47d5ca,_0x341796){_0x47d5ca=_0x47d5ca-0x0;var _0xd9de9a=_0xe370[_0x47d5ca];return _0xd9de9a;};'use strict';var multer=require(_0x0e37('0x0'));var util=require(_0x0e37('0x1'));var path=require(_0x0e37('0x2'));var timeout=require(_0x0e37('0x3'));var express=require(_0x0e37('0x4'));var router=express[_0x0e37('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0e37('0x6'));var interaction=require(_0x0e37('0x7'));var config=require(_0x0e37('0x8'));var controller=require(_0x0e37('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x0e37('0xa')]);router[_0x0e37('0xb')](_0x0e37('0xc'),auth['isAuthenticated'](),controller[_0x0e37('0xd')]);router[_0x0e37('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x0e37('0xe')]);router[_0x0e37('0xf')]('/',auth[_0x0e37('0x10')](),controller[_0x0e37('0x11')]);router[_0x0e37('0x12')](_0x0e37('0x13'),auth[_0x0e37('0x10')](),controller[_0x0e37('0x14')]);router[_0x0e37('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x0e37('0x16')]);module[_0x0e37('0x17')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 77802a9..be90a6c 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 _0xc224=['DATE','BOOLEAN','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc224,0x1af));var _0x4c22=function(_0x4680d8,_0x3957f8){_0x4680d8=_0x4680d8-0x0;var _0x3faae2=_0xc224[_0x4680d8];return _0x3faae2;};'use strict';var Sequelize=require(_0x4c22('0x0'));module[_0x4c22('0x1')]={'type':{'type':Sequelize[_0x4c22('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x4c22('0x2')]},'calleridname':{'type':Sequelize[_0x4c22('0x2')]},'queue':{'type':Sequelize[_0x4c22('0x2')]},'interface':{'type':Sequelize[_0x4c22('0x2')]},'membername':{'type':Sequelize[_0x4c22('0x2')]},'agentcalledAt':{'type':Sequelize[_0x4c22('0x3')]},'agentconnectAt':{'type':Sequelize[_0x4c22('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x4c22('0x3')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x4c22('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x4c22('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x4c22('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x4c22('0x5')]},'agentacw':{'type':Sequelize[_0x4c22('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x4c22('0x5')]},'reason':{'type':Sequelize[_0x4c22('0x2')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x4c22('0x2')]},'channelstate':{'type':Sequelize[_0x4c22('0x5')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x4c22('0x2')]},'language':{'type':Sequelize[_0x4c22('0x2')]},'accountcode':{'type':Sequelize[_0x4c22('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x4c22('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x4c22('0x2')]},'destcalleridnum':{'type':Sequelize[_0x4c22('0x2')]},'destcalleridname':{'type':Sequelize[_0x4c22('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x4c22('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x4c22('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x4c22('0x2')]},'destcontext':{'type':Sequelize[_0x4c22('0x2')]},'destexten':{'type':Sequelize[_0x4c22('0x2')]},'destpriority':{'type':Sequelize[_0x4c22('0x2')]},'destuniqueid':{'type':Sequelize[_0x4c22('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x4c22('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x4c22('0x2')],'comment':_0x4c22('0x6')},'transferexten':{'type':Sequelize[_0x4c22('0x2')]},'transferuniqueid':{'type':Sequelize[_0x4c22('0x2')]},'agententerreason':{'type':Sequelize[_0x4c22('0x5')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa064=['BOOLEAN','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE'];(function(_0x5463a8,_0x421b10){var _0x1e5bc0=function(_0x476eef){while(--_0x476eef){_0x5463a8['push'](_0x5463a8['shift']());}};_0x1e5bc0(++_0x421b10);}(_0xa064,0x192));var _0x4a06=function(_0x49f72d,_0x315dc6){_0x49f72d=_0x49f72d-0x0;var _0x4e1123=_0xa064[_0x49f72d];return _0x4e1123;};'use strict';var Sequelize=require(_0x4a06('0x0'));module[_0x4a06('0x1')]={'type':{'type':Sequelize[_0x4a06('0x2')]},'uniqueid':{'type':Sequelize[_0x4a06('0x2')]},'calleridnum':{'type':Sequelize[_0x4a06('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x4a06('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x4a06('0x3')]},'agentconnectAt':{'type':Sequelize[_0x4a06('0x3')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x4a06('0x3')]},'agentdumpAt':{'type':Sequelize[_0x4a06('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x4a06('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x4a06('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x4a06('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x4a06('0x5')]},'reason':{'type':Sequelize[_0x4a06('0x2')]},'lastevent':{'type':Sequelize[_0x4a06('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x4a06('0x5')]},'channelstatedesc':{'type':Sequelize[_0x4a06('0x2')]},'connectedlinenum':{'type':Sequelize[_0x4a06('0x2')]},'connectedlinename':{'type':Sequelize[_0x4a06('0x2')]},'language':{'type':Sequelize[_0x4a06('0x2')]},'accountcode':{'type':Sequelize[_0x4a06('0x2')]},'context':{'type':Sequelize[_0x4a06('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x4a06('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x4a06('0x5')]},'destchannelstatedesc':{'type':Sequelize[_0x4a06('0x2')]},'destcalleridnum':{'type':Sequelize[_0x4a06('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x4a06('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x4a06('0x2')]},'destlanguage':{'type':Sequelize[_0x4a06('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x4a06('0x2')]},'destexten':{'type':Sequelize[_0x4a06('0x2')]},'destpriority':{'type':Sequelize[_0x4a06('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x4a06('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x4a06('0x2')]},'transfer':{'type':Sequelize[_0x4a06('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x4a06('0x2')],'comment':_0x4a06('0x6')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x4a06('0x2')]},'agententerreason':{'type':Sequelize['INTEGER'],'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 353a36e..ab5b5fb 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(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'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 c8ffe1f..a875729 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 _0x078c=['../../config/logger','api','bluebird','request-promise','path','rimraf','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid','lodash'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x078c,0x19f));var _0xc078=function(_0x279368,_0x41c002){_0x279368=_0x279368-0x0;var _0x40b6d0=_0x078c[_0x279368];return _0x40b6d0;};'use strict';var _=require(_0xc078('0x0'));var util=require('util');var logger=require(_0xc078('0x1'))(_0xc078('0x2'));var moment=require('moment');var BPromise=require(_0xc078('0x3'));var rp=require(_0xc078('0x4'));var fs=require('fs');var path=require(_0xc078('0x5'));var rimraf=require(_0xc078('0x6'));var config=require('../../config/environment');var attributes=require(_0xc078('0x7'));module[_0xc078('0x8')]=function(_0x394068,_0x24b241){return _0x394068[_0xc078('0x9')](_0xc078('0xa'),attributes,{'tableName':_0xc078('0xb'),'paranoid':![],'indexes':[{'fields':[_0xc078('0xc'),'destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x1dcc=['path','rimraf','../../config/environment','define','report_agent','uniqueid','lodash','util','../../config/logger','api','bluebird'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x1dcc,0x1ea));var _0xc1dc=function(_0xa701b6,_0x1115e0){_0xa701b6=_0xa701b6-0x0;var _0x35c2fa=_0x1dcc[_0xa701b6];return _0x35c2fa;};'use strict';var _=require(_0xc1dc('0x0'));var util=require(_0xc1dc('0x1'));var logger=require(_0xc1dc('0x2'))(_0xc1dc('0x3'));var moment=require('moment');var BPromise=require(_0xc1dc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc1dc('0x5'));var rimraf=require(_0xc1dc('0x6'));var config=require(_0xc1dc('0x7'));var attributes=require('./voiceAgentReport.attributes');module['exports']=function(_0x1e57ba,_0x381ab6){return _0x1e57ba[_0xc1dc('0x8')]('VoiceAgentReport',attributes,{'tableName':_0xc1dc('0x9'),'paranoid':![],'indexes':[{'fields':[_0xc1dc('0xa'),'destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 1f29fd1..7412252 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 _0xd41a=['debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceAgentReport,\x20%s,\x20%s','message','result','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','catch','UpdateVoiceAgentReport','update','where','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0xd41a,0xa4));var _0xad41=function(_0x21b1e0,_0x59d6e4){_0x21b1e0=_0x21b1e0-0x0;var _0x18e44c=_0xd41a[_0x21b1e0];return _0x18e44c;};'use strict';var _=require(_0xad41('0x0'));var util=require(_0xad41('0x1'));var moment=require('moment');var BPromise=require(_0xad41('0x2'));var rs=require(_0xad41('0x3'));var fs=require('fs');var Redis=require(_0xad41('0x4'));var db=require(_0xad41('0x5'))['db'];var utils=require(_0xad41('0x6'));var logger=require(_0xad41('0x7'))(_0xad41('0x8'));var config=require(_0xad41('0x9'));var jayson=require(_0xad41('0xa'));var client=jayson['client'][_0xad41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x164c24,_0x429a3b,_0x2da9ae){return new BPromise(function(_0x5977f4,_0xf0e090){return client[_0xad41('0xc')](_0x164c24,_0x2da9ae)[_0xad41('0xd')](function(_0x1afba7){logger[_0xad41('0xe')]('VoiceAgentReport,\x20%s,\x20%s',_0x429a3b,_0xad41('0xf'));logger[_0xad41('0x10')](_0xad41('0x11'),_0x429a3b,_0xad41('0xf'),JSON[_0xad41('0x12')](_0x1afba7));if(_0x1afba7[_0xad41('0x13')]){if(_0x1afba7['error'][_0xad41('0x14')]===0x1f4){logger[_0xad41('0x13')](_0xad41('0x15'),_0x429a3b,_0x1afba7[_0xad41('0x13')][_0xad41('0x16')]);return _0xf0e090(_0x1afba7[_0xad41('0x13')][_0xad41('0x16')]);}logger[_0xad41('0x13')]('VoiceAgentReport,\x20%s,\x20%s',_0x429a3b,_0x1afba7[_0xad41('0x13')][_0xad41('0x16')]);return _0x5977f4(_0x1afba7['error'][_0xad41('0x16')]);}else{logger[_0xad41('0xe')]('VoiceAgentReport,\x20%s,\x20%s',_0x429a3b,'request\x20sent');_0x5977f4(_0x1afba7[_0xad41('0x17')][_0xad41('0x16')]);}})['catch'](function(_0x231736){logger[_0xad41('0x13')](_0xad41('0x15'),_0x429a3b,_0x231736);_0xf0e090(_0x231736);});});}exports[_0xad41('0x18')]=function(_0xcf9f91){var _0x26e740=this;return new Promise(function(_0x1c8199,_0x1a2e3a){return db[_0xad41('0x19')][_0xad41('0x1a')](_0xcf9f91[_0xad41('0x1b')],{'raw':_0xcf9f91['options']?_0xcf9f91[_0xad41('0x1c')][_0xad41('0x1d')]===undefined?!![]:![]:!![]})[_0xad41('0xd')](function(_0x5b3836){logger[_0xad41('0xe')](_0xad41('0x18'),_0xcf9f91);logger[_0xad41('0x10')](_0xad41('0x18'),_0xcf9f91,JSON[_0xad41('0x12')](_0x5b3836));_0x1c8199(_0x5b3836);})[_0xad41('0x1e')](function(_0x18e6ab){logger[_0xad41('0x13')](_0xad41('0x18'),_0x18e6ab[_0xad41('0x16')],_0xcf9f91);_0x1a2e3a(_0x26e740[_0xad41('0x13')](0x1f4,_0x18e6ab['message']));});});};exports[_0xad41('0x1f')]=function(_0x1bb973){var _0x4fedb7=this;return new Promise(function(_0x39139e,_0x1ff767){return db['VoiceAgentReport'][_0xad41('0x20')](_0x1bb973['body'],{'raw':_0x1bb973[_0xad41('0x1c')]?_0x1bb973[_0xad41('0x1c')][_0xad41('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1bb973[_0xad41('0x1c')]?_0x1bb973[_0xad41('0x1c')][_0xad41('0x21')]||null:null,'attributes':_0x1bb973[_0xad41('0x1c')]?_0x1bb973[_0xad41('0x1c')][_0xad41('0x22')]||null:null,'limit':_0x1bb973[_0xad41('0x1c')]?_0x1bb973['options'][_0xad41('0x23')]||null:null})['then'](function(_0x59750f){logger[_0xad41('0xe')](_0xad41('0x1f'),_0x1bb973);logger[_0xad41('0x10')](_0xad41('0x1f'),_0x1bb973,JSON['stringify'](_0x59750f));_0x39139e(_0x59750f);})[_0xad41('0x1e')](function(_0x4902f3){logger[_0xad41('0x13')](_0xad41('0x1f'),_0x4902f3[_0xad41('0x16')],_0x1bb973);_0x1ff767(_0x4fedb7['error'](0x1f4,_0x4902f3[_0xad41('0x16')]));});});}; \ No newline at end of file +var _0x3e1c=['info','update','where','attributes','limit','UpdateVoiceAgentReport','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','body','options','raw'];(function(_0x263c9e,_0x82bfc8){var _0x550b47=function(_0x9caca8){while(--_0x9caca8){_0x263c9e['push'](_0x263c9e['shift']());}};_0x550b47(++_0x82bfc8);}(_0x3e1c,0x1e2));var _0xc3e1=function(_0x270de8,_0x48b12a){_0x270de8=_0x270de8-0x0;var _0x275e68=_0x3e1c[_0x270de8];return _0x275e68;};'use strict';var _=require(_0xc3e1('0x0'));var util=require(_0xc3e1('0x1'));var moment=require('moment');var BPromise=require(_0xc3e1('0x2'));var rs=require(_0xc3e1('0x3'));var fs=require('fs');var Redis=require(_0xc3e1('0x4'));var db=require(_0xc3e1('0x5'))['db'];var utils=require(_0xc3e1('0x6'));var logger=require('../../config/logger')(_0xc3e1('0x7'));var config=require(_0xc3e1('0x8'));var jayson=require(_0xc3e1('0x9'));var client=jayson[_0xc3e1('0xa')][_0xc3e1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x20e517,_0x5c2755,_0x580662){return new BPromise(function(_0x9d3c62,_0x3a99a8){return client[_0xc3e1('0xc')](_0x20e517,_0x580662)[_0xc3e1('0xd')](function(_0x1a2cd9){logger['info'](_0xc3e1('0xe'),_0x5c2755,_0xc3e1('0xf'));logger[_0xc3e1('0x10')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x5c2755,_0xc3e1('0xf'),JSON[_0xc3e1('0x11')](_0x1a2cd9));if(_0x1a2cd9[_0xc3e1('0x12')]){if(_0x1a2cd9[_0xc3e1('0x12')][_0xc3e1('0x13')]===0x1f4){logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x5c2755,_0x1a2cd9['error']['message']);return _0x3a99a8(_0x1a2cd9[_0xc3e1('0x12')][_0xc3e1('0x14')]);}logger[_0xc3e1('0x12')](_0xc3e1('0xe'),_0x5c2755,_0x1a2cd9[_0xc3e1('0x12')]['message']);return _0x9d3c62(_0x1a2cd9[_0xc3e1('0x12')][_0xc3e1('0x14')]);}else{logger['info']('VoiceAgentReport,\x20%s,\x20%s',_0x5c2755,'request\x20sent');_0x9d3c62(_0x1a2cd9[_0xc3e1('0x15')][_0xc3e1('0x14')]);}})[_0xc3e1('0x16')](function(_0x482e27){logger['error'](_0xc3e1('0xe'),_0x5c2755,_0x482e27);_0x3a99a8(_0x482e27);});});}exports[_0xc3e1('0x17')]=function(_0x35a950){var _0x598d4a=this;return new Promise(function(_0x5682c6,_0x1d2310){return db[_0xc3e1('0x18')]['create'](_0x35a950[_0xc3e1('0x19')],{'raw':_0x35a950[_0xc3e1('0x1a')]?_0x35a950[_0xc3e1('0x1a')][_0xc3e1('0x1b')]===undefined?!![]:![]:!![]})[_0xc3e1('0xd')](function(_0x1f9e3f){logger[_0xc3e1('0x1c')]('CreateVoiceAgentReport',_0x35a950);logger['debug'](_0xc3e1('0x17'),_0x35a950,JSON[_0xc3e1('0x11')](_0x1f9e3f));_0x5682c6(_0x1f9e3f);})['catch'](function(_0x10ed32){logger[_0xc3e1('0x12')](_0xc3e1('0x17'),_0x10ed32['message'],_0x35a950);_0x1d2310(_0x598d4a[_0xc3e1('0x12')](0x1f4,_0x10ed32[_0xc3e1('0x14')]));});});};exports['UpdateVoiceAgentReport']=function(_0x41a4ba){var _0x2e988a=this;return new Promise(function(_0x42d50f,_0x3d4d78){return db[_0xc3e1('0x18')][_0xc3e1('0x1d')](_0x41a4ba['body'],{'raw':_0x41a4ba[_0xc3e1('0x1a')]?_0x41a4ba['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x41a4ba[_0xc3e1('0x1a')]?_0x41a4ba['options'][_0xc3e1('0x1e')]||null:null,'attributes':_0x41a4ba[_0xc3e1('0x1a')]?_0x41a4ba[_0xc3e1('0x1a')][_0xc3e1('0x1f')]||null:null,'limit':_0x41a4ba['options']?_0x41a4ba['options'][_0xc3e1('0x20')]||null:null})[_0xc3e1('0xd')](function(_0x1cf900){logger[_0xc3e1('0x1c')](_0xc3e1('0x21'),_0x41a4ba);logger[_0xc3e1('0x10')]('UpdateVoiceAgentReport',_0x41a4ba,JSON[_0xc3e1('0x11')](_0x1cf900));_0x42d50f(_0x1cf900);})[_0xc3e1('0x16')](function(_0x22fd66){logger[_0xc3e1('0x12')](_0xc3e1('0x21'),_0x22fd66[_0xc3e1('0x14')],_0x41a4ba);_0x3d4d78(_0x2e988a[_0xc3e1('0x12')](0x1f4,_0x22fd66['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 4afc6aa..fed111f 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 _0xcd59=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','delete'];(function(_0x50288d,_0x4669bb){var _0x2ae62d=function(_0x1d0668){while(--_0x1d0668){_0x50288d['push'](_0x50288d['shift']());}};_0x2ae62d(++_0x4669bb);}(_0xcd59,0x14b));var _0x9cd5=function(_0x537bcd,_0x13bae1){_0x537bcd=_0x537bcd-0x0;var _0x6cc881=_0xcd59[_0x537bcd];return _0x6cc881;};'use strict';var multer=require(_0x9cd5('0x0'));var util=require(_0x9cd5('0x1'));var path=require(_0x9cd5('0x2'));var timeout=require(_0x9cd5('0x3'));var express=require(_0x9cd5('0x4'));var router=express[_0x9cd5('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9cd5('0x6'));var interaction=require(_0x9cd5('0x7'));var config=require(_0x9cd5('0x8'));var controller=require(_0x9cd5('0x9'));router[_0x9cd5('0xa')]('/',auth[_0x9cd5('0xb')](),controller[_0x9cd5('0xc')]);router[_0x9cd5('0xa')](_0x9cd5('0xd'),auth[_0x9cd5('0xb')](),controller['describe']);router[_0x9cd5('0xa')](_0x9cd5('0xe'),auth[_0x9cd5('0xb')](),controller[_0x9cd5('0xf')]);router[_0x9cd5('0x10')]('/',auth[_0x9cd5('0xb')](),controller[_0x9cd5('0x11')]);router[_0x9cd5('0x12')]('/:id',auth[_0x9cd5('0xb')](),controller[_0x9cd5('0x13')]);router[_0x9cd5('0x14')](_0x9cd5('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x9cd5('0x15')]=router; \ No newline at end of file +var _0x5636=['isAuthenticated','index','/describe','describe','/:id','show','create','put','delete','destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceCallReport.controller','get'];(function(_0x1897e5,_0x25adf3){var _0x162391=function(_0x1ce82f){while(--_0x1ce82f){_0x1897e5['push'](_0x1897e5['shift']());}};_0x162391(++_0x25adf3);}(_0x5636,0x102));var _0x6563=function(_0x232a93,_0x141401){_0x232a93=_0x232a93-0x0;var _0x5daddb=_0x5636[_0x232a93];return _0x5daddb;};'use strict';var multer=require(_0x6563('0x0'));var util=require(_0x6563('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6563('0x2')]();var fs_extra=require(_0x6563('0x3'));var auth=require(_0x6563('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6563('0x5'));var controller=require(_0x6563('0x6'));router[_0x6563('0x7')]('/',auth[_0x6563('0x8')](),controller[_0x6563('0x9')]);router[_0x6563('0x7')](_0x6563('0xa'),auth[_0x6563('0x8')](),controller[_0x6563('0xb')]);router[_0x6563('0x7')](_0x6563('0xc'),auth[_0x6563('0x8')](),controller[_0x6563('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6563('0xe')]);router[_0x6563('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x6563('0x10')](_0x6563('0xc'),auth[_0x6563('0x8')](),controller[_0x6563('0x11')]);module[_0x6563('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index f23b33a..fb01301 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 _0x1d21=['TEXT','DATE','INTEGER','sequelize','exports','STRING','ENUM','internal','outbound','inbound-fax','outbound-fax'];(function(_0x2da33a,_0x21cf38){var _0xdbb35=function(_0x4d401f){while(--_0x4d401f){_0x2da33a['push'](_0x2da33a['shift']());}};_0xdbb35(++_0x21cf38);}(_0x1d21,0x158));var _0x11d2=function(_0x3d73ba,_0x356e23){_0x3d73ba=_0x3d73ba-0x0;var _0x47e406=_0x1d21[_0x3d73ba];return _0x47e406;};'use strict';var Sequelize=require(_0x11d2('0x0'));module[_0x11d2('0x1')]={'uniqueid':{'type':Sequelize[_0x11d2('0x2')]},'type':{'type':Sequelize[_0x11d2('0x3')]('inbound',_0x11d2('0x4'),_0x11d2('0x5'),_0x11d2('0x6'),_0x11d2('0x7'),'dialer')},'tag':{'type':Sequelize[_0x11d2('0x2')]},'accountcode':{'type':Sequelize[_0x11d2('0x2')]},'source':{'type':Sequelize[_0x11d2('0x2')]},'destination':{'type':Sequelize[_0x11d2('0x2')]},'destinationcontext':{'type':Sequelize[_0x11d2('0x2')]},'callerid':{'type':Sequelize[_0x11d2('0x2')]},'channel':{'type':Sequelize[_0x11d2('0x2')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x11d2('0x2')]},'lastdata':{'type':Sequelize[_0x11d2('0x8')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x11d2('0x9')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x11d2('0x9')]},'duration':{'type':Sequelize[_0x11d2('0xa')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x11d2('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x11d2('0x2')]},'amaflags':{'type':Sequelize[_0x11d2('0x2')]},'userfield':{'type':Sequelize[_0x11d2('0x2')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize[_0x11d2('0x2')]},'note':{'type':Sequelize[_0x11d2('0x2')]},'prefix':{'type':Sequelize[_0x11d2('0x2')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0x11d2('0x2')]}}; \ No newline at end of file +var _0x72bc=['internal','outbound','inbound-fax','outbound-fax','dialer','TEXT','DATE','INTEGER','exports','STRING','ENUM'];(function(_0x4b1032,_0x36952e){var _0x5a1d55=function(_0x282e9b){while(--_0x282e9b){_0x4b1032['push'](_0x4b1032['shift']());}};_0x5a1d55(++_0x36952e);}(_0x72bc,0x1d6));var _0xc72b=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x72bc[_0x311c35];return _0x5cc50c;};'use strict';var Sequelize=require('sequelize');module[_0xc72b('0x0')]={'uniqueid':{'type':Sequelize[_0xc72b('0x1')]},'type':{'type':Sequelize[_0xc72b('0x2')]('inbound',_0xc72b('0x3'),_0xc72b('0x4'),_0xc72b('0x5'),_0xc72b('0x6'),_0xc72b('0x7'))},'tag':{'type':Sequelize[_0xc72b('0x1')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0xc72b('0x1')]},'destination':{'type':Sequelize[_0xc72b('0x1')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xc72b('0x1')]},'channel':{'type':Sequelize[_0xc72b('0x1')]},'destinationchannel':{'type':Sequelize[_0xc72b('0x1')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xc72b('0x8')]},'starttime':{'type':Sequelize[_0xc72b('0x9')]},'systemanswertime':{'type':Sequelize[_0xc72b('0x9')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xc72b('0x9')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0xc72b('0xa')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xc72b('0x1')]},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0xc72b('0x1')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xc72b('0x1')]},'prefix':{'type':Sequelize[_0xc72b('0x1')]},'routeid':{'type':Sequelize[_0xc72b('0xa')]},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index e3ba9ff..9c69737 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 _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(_0x122e9b,_0x391bf4){var _0x22c247=function(_0x1b2c65){while(--_0x1b2c65){_0x122e9b['push'](_0x122e9b['shift']());}};_0x22c247(++_0x391bf4);}(_0x5f2f,0x73));var _0xf5f2=function(_0x175a10,_0x4085ba){_0x175a10=_0x175a10-0x0;var _0x4a9571=_0x5f2f[_0x175a10];return _0x4a9571;};'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 +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(_0x72c11f,_0xc2f446){var _0x55ac38=function(_0x3127f5){while(--_0x3127f5){_0x72c11f['push'](_0x72c11f['shift']());}};_0x55ac38(++_0xc2f446);}(_0x0b0e,0x187));var _0xe0b0=function(_0x3b0d98,_0x346f06){_0x3b0d98=_0x3b0d98-0x0;var _0x296885=_0x0b0e[_0x3b0d98];return _0x296885;};'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 diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index d1ac4df..6580cfc 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 _0x6282=['../../config/logger','api','request-promise','path','../../config/environment','./voiceCallReport.attributes','exports','VoiceCallReport','report_call','uniqueid','lodash','util'];(function(_0xebf731,_0x159e09){var _0x42971b=function(_0x220a68){while(--_0x220a68){_0xebf731['push'](_0xebf731['shift']());}};_0x42971b(++_0x159e09);}(_0x6282,0x76));var _0x2628=function(_0x5c6991,_0xf69c0a){_0x5c6991=_0x5c6991-0x0;var _0x197be3=_0x6282[_0x5c6991];return _0x197be3;};'use strict';var _=require(_0x2628('0x0'));var util=require(_0x2628('0x1'));var logger=require(_0x2628('0x2'))(_0x2628('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2628('0x4'));var fs=require('fs');var path=require(_0x2628('0x5'));var rimraf=require('rimraf');var config=require(_0x2628('0x6'));var attributes=require(_0x2628('0x7'));module[_0x2628('0x8')]=function(_0x47102a,_0x128d3a){return _0x47102a['define'](_0x2628('0x9'),attributes,{'tableName':_0x2628('0xa'),'paranoid':![],'indexes':[{'fields':[_0x2628('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb126=['api','moment','bluebird','rimraf','./voiceCallReport.attributes','define','VoiceCallReport','uniqueid','lodash','util','../../config/logger'];(function(_0x332264,_0x15ad59){var _0x214cd2=function(_0xfd3d65){while(--_0xfd3d65){_0x332264['push'](_0x332264['shift']());}};_0x214cd2(++_0x15ad59);}(_0xb126,0x76));var _0x6b12=function(_0x3ea794,_0x14feb6){_0x3ea794=_0x3ea794-0x0;var _0x48e914=_0xb126[_0x3ea794];return _0x48e914;};'use strict';var _=require(_0x6b12('0x0'));var util=require(_0x6b12('0x1'));var logger=require(_0x6b12('0x2'))(_0x6b12('0x3'));var moment=require(_0x6b12('0x4'));var BPromise=require(_0x6b12('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6b12('0x6'));var config=require('../../config/environment');var attributes=require(_0x6b12('0x7'));module['exports']=function(_0x24431e,_0x479260){return _0x24431e[_0x6b12('0x8')](_0x6b12('0x9'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0x6b12('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 03810ce..122bb30 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 _0xd9b0=['message','result','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','attributes','limit','include','map','model','CreateVoiceCallReport','create','catch','UpdateVoiceCallReport','update','body','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x46ff0d,_0xb1ee20){var _0x37ea4a=function(_0x31c4a6){while(--_0x31c4a6){_0x46ff0d['push'](_0x46ff0d['shift']());}};_0x37ea4a(++_0xb1ee20);}(_0xd9b0,0xd6));var _0x0d9b=function(_0xd413ea,_0x415137){_0xd413ea=_0xd413ea-0x0;var _0x2c6908=_0xd9b0[_0xd413ea];return _0x2c6908;};'use strict';var _=require(_0x0d9b('0x0'));var util=require(_0x0d9b('0x1'));var moment=require(_0x0d9b('0x2'));var BPromise=require(_0x0d9b('0x3'));var rs=require(_0x0d9b('0x4'));var fs=require('fs');var Redis=require(_0x0d9b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0d9b('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x0d9b('0x7'));var jayson=require(_0x0d9b('0x8'));var client=jayson['client'][_0x0d9b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x564f94,_0x412abe,_0x123afe){return new BPromise(function(_0x3e3f04,_0x2b280a){return client[_0x0d9b('0xa')](_0x564f94,_0x123afe)[_0x0d9b('0xb')](function(_0x5ef92b){logger[_0x0d9b('0xc')](_0x0d9b('0xd'),_0x412abe,_0x0d9b('0xe'));logger[_0x0d9b('0xf')](_0x0d9b('0x10'),_0x412abe,_0x0d9b('0xe'),JSON[_0x0d9b('0x11')](_0x5ef92b));if(_0x5ef92b[_0x0d9b('0x12')]){if(_0x5ef92b[_0x0d9b('0x12')][_0x0d9b('0x13')]===0x1f4){logger[_0x0d9b('0x12')](_0x0d9b('0xd'),_0x412abe,_0x5ef92b[_0x0d9b('0x12')][_0x0d9b('0x14')]);return _0x2b280a(_0x5ef92b[_0x0d9b('0x12')]['message']);}logger[_0x0d9b('0x12')](_0x0d9b('0xd'),_0x412abe,_0x5ef92b[_0x0d9b('0x12')][_0x0d9b('0x14')]);return _0x3e3f04(_0x5ef92b[_0x0d9b('0x12')][_0x0d9b('0x14')]);}else{logger[_0x0d9b('0xc')](_0x0d9b('0xd'),_0x412abe,'request\x20sent');_0x3e3f04(_0x5ef92b[_0x0d9b('0x15')][_0x0d9b('0x14')]);}})['catch'](function(_0x6c1908){logger[_0x0d9b('0x12')](_0x0d9b('0xd'),_0x412abe,_0x6c1908);_0x2b280a(_0x6c1908);});});}exports[_0x0d9b('0x16')]=function(_0x45143a){var _0x4ddbce=this;return new Promise(function(_0x550166,_0x19341e){return db[_0x0d9b('0x17')][_0x0d9b('0x18')]({'raw':_0x45143a[_0x0d9b('0x19')]?_0x45143a[_0x0d9b('0x19')][_0x0d9b('0x1a')]===undefined?!![]:![]:!![],'where':_0x45143a[_0x0d9b('0x19')]?_0x45143a[_0x0d9b('0x19')][_0x0d9b('0x1b')]||null:null,'attributes':_0x45143a[_0x0d9b('0x19')]?_0x45143a[_0x0d9b('0x19')][_0x0d9b('0x1c')]||null:null,'limit':_0x45143a[_0x0d9b('0x19')]?_0x45143a[_0x0d9b('0x19')][_0x0d9b('0x1d')]||null:null,'include':_0x45143a['options']?_0x45143a['options'][_0x0d9b('0x1e')]?_[_0x0d9b('0x1f')](_0x45143a[_0x0d9b('0x19')][_0x0d9b('0x1e')],function(_0x207f18){return{'model':db[_0x207f18[_0x0d9b('0x20')]],'as':_0x207f18['as'],'attributes':_0x207f18[_0x0d9b('0x1c')],'include':_0x207f18[_0x0d9b('0x1e')]?_[_0x0d9b('0x1f')](_0x207f18[_0x0d9b('0x1e')],function(_0x349303){return{'model':db[_0x349303[_0x0d9b('0x20')]],'as':_0x349303['as'],'attributes':_0x349303[_0x0d9b('0x1c')],'include':_0x349303[_0x0d9b('0x1e')]?_['map'](_0x349303[_0x0d9b('0x1e')],function(_0x2fb58f){return{'model':db[_0x2fb58f[_0x0d9b('0x20')]],'as':_0x2fb58f['as'],'attributes':_0x2fb58f[_0x0d9b('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0d9b('0xb')](function(_0x40cd4f){logger[_0x0d9b('0xc')]('GetVoiceCallReport',_0x45143a);logger[_0x0d9b('0xf')](_0x0d9b('0x16'),_0x45143a,JSON['stringify'](_0x40cd4f));_0x550166(_0x40cd4f);})['catch'](function(_0x4cd572){logger[_0x0d9b('0x12')](_0x0d9b('0x16'),_0x4cd572['message'],_0x45143a);_0x19341e(_0x4ddbce['error'](0x1f4,_0x4cd572[_0x0d9b('0x14')]));});});};exports[_0x0d9b('0x21')]=function(_0x4a7211){var _0x5246b5=this;return new Promise(function(_0x129202,_0xc6c994){return db['VoiceCallReport'][_0x0d9b('0x22')](_0x4a7211['body'],{'raw':_0x4a7211[_0x0d9b('0x19')]?_0x4a7211[_0x0d9b('0x19')][_0x0d9b('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x26eed0){logger['info'](_0x0d9b('0x21'),_0x4a7211);logger[_0x0d9b('0xf')](_0x0d9b('0x21'),_0x4a7211,JSON[_0x0d9b('0x11')](_0x26eed0));_0x129202(_0x26eed0);})[_0x0d9b('0x23')](function(_0x354bea){logger[_0x0d9b('0x12')](_0x0d9b('0x21'),_0x354bea[_0x0d9b('0x14')],_0x4a7211);_0xc6c994(_0x5246b5[_0x0d9b('0x12')](0x1f4,_0x354bea[_0x0d9b('0x14')]));});});};exports[_0x0d9b('0x24')]=function(_0x3182c0){var _0x51d43e=this;return new Promise(function(_0x33b69a,_0x22bc35){return db[_0x0d9b('0x17')][_0x0d9b('0x25')](_0x3182c0[_0x0d9b('0x26')],{'raw':_0x3182c0[_0x0d9b('0x19')]?_0x3182c0['options'][_0x0d9b('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3182c0['options']?_0x3182c0[_0x0d9b('0x19')][_0x0d9b('0x1b')]||null:null,'attributes':_0x3182c0['options']?_0x3182c0[_0x0d9b('0x19')]['attributes']||null:null,'limit':_0x3182c0[_0x0d9b('0x19')]?_0x3182c0[_0x0d9b('0x19')][_0x0d9b('0x1d')]||null:null})[_0x0d9b('0xb')](function(_0x27cb9d){logger[_0x0d9b('0xc')](_0x0d9b('0x24'),_0x3182c0);logger[_0x0d9b('0xf')](_0x0d9b('0x24'),_0x3182c0,JSON[_0x0d9b('0x11')](_0x27cb9d));_0x33b69a(_0x27cb9d);})[_0x0d9b('0x23')](function(_0x2a7e84){logger['error']('UpdateVoiceCallReport',_0x2a7e84[_0x0d9b('0x14')],_0x3182c0);_0x22bc35(_0x51d43e[_0x0d9b('0x12')](0x1f4,_0x2a7e84[_0x0d9b('0x14')]));});});}; \ No newline at end of file +var _0x06fa=['map','model','catch','VoiceCallReport','body','CreateVoiceCallReport','UpdateVoiceCallReport','lodash','util','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceCallReport,\x20%s,\x20%s','message','GetVoiceCallReport','findAll','options','raw','where','attributes','limit','include'];(function(_0x5f0eef,_0x5223d9){var _0x41ea30=function(_0x390924){while(--_0x390924){_0x5f0eef['push'](_0x5f0eef['shift']());}};_0x41ea30(++_0x5223d9);}(_0x06fa,0x193));var _0xa06f=function(_0x1affbc,_0x1bfdae){_0x1affbc=_0x1affbc-0x0;var _0xdb7d2f=_0x06fa[_0x1affbc];return _0xdb7d2f;};'use strict';var _=require(_0xa06f('0x0'));var util=require(_0xa06f('0x1'));var moment=require('moment');var BPromise=require(_0xa06f('0x2'));var rs=require(_0xa06f('0x3'));var fs=require('fs');var Redis=require(_0xa06f('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa06f('0x5'))('rpc');var config=require(_0xa06f('0x6'));var jayson=require(_0xa06f('0x7'));var client=jayson[_0xa06f('0x8')][_0xa06f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2250f7,_0x1ea572,_0x446465){return new BPromise(function(_0x2b51ac,_0x568438){return client[_0xa06f('0xa')](_0x2250f7,_0x446465)[_0xa06f('0xb')](function(_0x558d5b){logger[_0xa06f('0xc')]('VoiceCallReport,\x20%s,\x20%s',_0x1ea572,_0xa06f('0xd'));logger[_0xa06f('0xe')](_0xa06f('0xf'),_0x1ea572,_0xa06f('0xd'),JSON[_0xa06f('0x10')](_0x558d5b));if(_0x558d5b[_0xa06f('0x11')]){if(_0x558d5b[_0xa06f('0x11')][_0xa06f('0x12')]===0x1f4){logger['error'](_0xa06f('0x13'),_0x1ea572,_0x558d5b[_0xa06f('0x11')][_0xa06f('0x14')]);return _0x568438(_0x558d5b[_0xa06f('0x11')][_0xa06f('0x14')]);}logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x1ea572,_0x558d5b['error'][_0xa06f('0x14')]);return _0x2b51ac(_0x558d5b[_0xa06f('0x11')]['message']);}else{logger[_0xa06f('0xc')]('VoiceCallReport,\x20%s,\x20%s',_0x1ea572,_0xa06f('0xd'));_0x2b51ac(_0x558d5b['result']['message']);}})['catch'](function(_0x2b89ea){logger[_0xa06f('0x11')](_0xa06f('0x13'),_0x1ea572,_0x2b89ea);_0x568438(_0x2b89ea);});});}exports[_0xa06f('0x15')]=function(_0xf76882){var _0x2b9887=this;return new Promise(function(_0x14e902,_0x64d772){return db['VoiceCallReport'][_0xa06f('0x16')]({'raw':_0xf76882[_0xa06f('0x17')]?_0xf76882['options'][_0xa06f('0x18')]===undefined?!![]:![]:!![],'where':_0xf76882[_0xa06f('0x17')]?_0xf76882['options'][_0xa06f('0x19')]||null:null,'attributes':_0xf76882[_0xa06f('0x17')]?_0xf76882[_0xa06f('0x17')][_0xa06f('0x1a')]||null:null,'limit':_0xf76882['options']?_0xf76882[_0xa06f('0x17')][_0xa06f('0x1b')]||null:null,'include':_0xf76882[_0xa06f('0x17')]?_0xf76882['options'][_0xa06f('0x1c')]?_[_0xa06f('0x1d')](_0xf76882[_0xa06f('0x17')]['include'],function(_0x3cfa01){return{'model':db[_0x3cfa01['model']],'as':_0x3cfa01['as'],'attributes':_0x3cfa01[_0xa06f('0x1a')],'include':_0x3cfa01['include']?_[_0xa06f('0x1d')](_0x3cfa01['include'],function(_0x5b1cea){return{'model':db[_0x5b1cea[_0xa06f('0x1e')]],'as':_0x5b1cea['as'],'attributes':_0x5b1cea['attributes'],'include':_0x5b1cea[_0xa06f('0x1c')]?_['map'](_0x5b1cea['include'],function(_0x4b5ae5){return{'model':db[_0x4b5ae5['model']],'as':_0x4b5ae5['as'],'attributes':_0x4b5ae5[_0xa06f('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa06f('0xb')](function(_0x58a583){logger[_0xa06f('0xc')](_0xa06f('0x15'),_0xf76882);logger[_0xa06f('0xe')](_0xa06f('0x15'),_0xf76882,JSON['stringify'](_0x58a583));_0x14e902(_0x58a583);})[_0xa06f('0x1f')](function(_0x414661){logger[_0xa06f('0x11')](_0xa06f('0x15'),_0x414661[_0xa06f('0x14')],_0xf76882);_0x64d772(_0x2b9887[_0xa06f('0x11')](0x1f4,_0x414661[_0xa06f('0x14')]));});});};exports['CreateVoiceCallReport']=function(_0x3b6ef8){var _0xad5293=this;return new Promise(function(_0xf6fed6,_0x50146f){return db[_0xa06f('0x20')]['create'](_0x3b6ef8[_0xa06f('0x21')],{'raw':_0x3b6ef8[_0xa06f('0x17')]?_0x3b6ef8[_0xa06f('0x17')][_0xa06f('0x18')]===undefined?!![]:![]:!![]})[_0xa06f('0xb')](function(_0x51d900){logger[_0xa06f('0xc')](_0xa06f('0x22'),_0x3b6ef8);logger[_0xa06f('0xe')]('CreateVoiceCallReport',_0x3b6ef8,JSON[_0xa06f('0x10')](_0x51d900));_0xf6fed6(_0x51d900);})[_0xa06f('0x1f')](function(_0x25ba7f){logger[_0xa06f('0x11')]('CreateVoiceCallReport',_0x25ba7f[_0xa06f('0x14')],_0x3b6ef8);_0x50146f(_0xad5293[_0xa06f('0x11')](0x1f4,_0x25ba7f[_0xa06f('0x14')]));});});};exports[_0xa06f('0x23')]=function(_0x527d3a){var _0x409744=this;return new Promise(function(_0x567f74,_0x2e838e){return db['VoiceCallReport']['update'](_0x527d3a[_0xa06f('0x21')],{'raw':_0x527d3a[_0xa06f('0x17')]?_0x527d3a['options'][_0xa06f('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x527d3a['options']?_0x527d3a[_0xa06f('0x17')][_0xa06f('0x19')]||null:null,'attributes':_0x527d3a[_0xa06f('0x17')]?_0x527d3a[_0xa06f('0x17')][_0xa06f('0x1a')]||null:null,'limit':_0x527d3a[_0xa06f('0x17')]?_0x527d3a[_0xa06f('0x17')][_0xa06f('0x1b')]||null:null})[_0xa06f('0xb')](function(_0x5e5481){logger[_0xa06f('0xc')]('UpdateVoiceCallReport',_0x527d3a);logger[_0xa06f('0xe')](_0xa06f('0x23'),_0x527d3a,JSON[_0xa06f('0x10')](_0x5e5481));_0x567f74(_0x5e5481);})[_0xa06f('0x1f')](function(_0x466940){logger[_0xa06f('0x11')](_0xa06f('0x23'),_0x466940[_0xa06f('0x14')],_0x527d3a);_0x2e838e(_0x409744[_0xa06f('0x11')](0x1f4,_0x466940['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 70142e7..914d8f5 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 _0x1e70=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','put','/:id','destroy','multer','util','path','connect-timeout','fs-extra'];(function(_0x3438cf,_0x73b174){var _0x278698=function(_0xbba932){while(--_0xbba932){_0x3438cf['push'](_0x3438cf['shift']());}};_0x278698(++_0x73b174);}(_0x1e70,0x1bb));var _0x01e7=function(_0x2e0330,_0x3ba6a9){_0x2e0330=_0x2e0330-0x0;var _0x3d706e=_0x1e70[_0x2e0330];return _0x3d706e;};'use strict';var multer=require(_0x01e7('0x0'));var util=require(_0x01e7('0x1'));var path=require(_0x01e7('0x2'));var timeout=require(_0x01e7('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x01e7('0x4'));var auth=require(_0x01e7('0x5'));var interaction=require(_0x01e7('0x6'));var config=require(_0x01e7('0x7'));var controller=require('./voiceChanSpy.controller');router[_0x01e7('0x8')]('/',auth[_0x01e7('0x9')](),controller[_0x01e7('0xa')]);router[_0x01e7('0x8')]('/:id',auth[_0x01e7('0x9')](),controller[_0x01e7('0xb')]);router[_0x01e7('0xc')]('/',auth[_0x01e7('0x9')](),controller['create']);router[_0x01e7('0xd')](_0x01e7('0xe'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x01e7('0xe'),auth['isAuthenticated'](),controller[_0x01e7('0xf')]);module['exports']=router; \ No newline at end of file +var _0x2a97=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceChanSpy.controller','isAuthenticated','index','/:id','create','put','update','delete','exports','util','path'];(function(_0x12d033,_0x25fa2f){var _0x3b4e80=function(_0x46c1f4){while(--_0x46c1f4){_0x12d033['push'](_0x12d033['shift']());}};_0x3b4e80(++_0x25fa2f);}(_0x2a97,0x7e));var _0x72a9=function(_0x4fe04f,_0x313123){_0x4fe04f=_0x4fe04f-0x0;var _0x4b8d5d=_0x2a97[_0x4fe04f];return _0x4b8d5d;};'use strict';var multer=require('multer');var util=require(_0x72a9('0x0'));var path=require(_0x72a9('0x1'));var timeout=require(_0x72a9('0x2'));var express=require(_0x72a9('0x3'));var router=express[_0x72a9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x72a9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x72a9('0x6'));var controller=require(_0x72a9('0x7'));router['get']('/',auth[_0x72a9('0x8')](),controller[_0x72a9('0x9')]);router['get'](_0x72a9('0xa'),auth[_0x72a9('0x8')](),controller['show']);router['post']('/',auth[_0x72a9('0x8')](),controller[_0x72a9('0xb')]);router[_0x72a9('0xc')](_0x72a9('0xa'),auth['isAuthenticated'](),controller[_0x72a9('0xd')]);router[_0x72a9('0xe')](_0x72a9('0xa'),auth[_0x72a9('0x8')](),controller['destroy']);module[_0x72a9('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 995d6c8..fd7b2e0 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 _0x64f7=['STRING','name','setDataValue','options','join','getDataValue','split','BOOLEAN','exports'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x64f7,0x167));var _0x764f=function(_0x5872b2,_0x449453){_0x5872b2=_0x5872b2-0x0;var _0xcf80cd=_0x64f7[_0x5872b2];return _0xcf80cd;};'use strict';var Sequelize=require('sequelize');module[_0x764f('0x0')]={'name':{'type':Sequelize[_0x764f('0x1')]},'prefix':{'type':Sequelize[_0x764f('0x1')],'unique':_0x764f('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x764f('0x1')],'set':function(_0x401474){this[_0x764f('0x3')](_0x764f('0x4'),_0x401474?_0x401474[_0x764f('0x5')](''):[]);},'get':function(){return this[_0x764f('0x6')](_0x764f('0x4'))?this[_0x764f('0x6')]('options')[_0x764f('0x7')](''):[];}},'auth':{'type':Sequelize[_0x764f('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0x764f('0x1')]},'record':{'type':Sequelize[_0x764f('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x764f('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xbc2b=['join','getDataValue','sequelize','exports','STRING','name','setDataValue','options'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0xbc2b,0x152));var _0xbbc2=function(_0xf458be,_0x1cf158){_0xf458be=_0xf458be-0x0;var _0x52b318=_0xbc2b[_0xf458be];return _0x52b318;};'use strict';var Sequelize=require(_0xbbc2('0x0'));module[_0xbbc2('0x1')]={'name':{'type':Sequelize[_0xbbc2('0x2')]},'prefix':{'type':Sequelize['STRING'],'unique':_0xbbc2('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0xbbc2('0x2')],'set':function(_0x2d21ef){this[_0xbbc2('0x4')](_0xbbc2('0x5'),_0x2d21ef?_0x2d21ef[_0xbbc2('0x6')](''):[]);},'get':function(){return this[_0xbbc2('0x7')](_0xbbc2('0x5'))?this[_0xbbc2('0x7')](_0xbbc2('0x5'))['split'](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0xbbc2('0x2')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xbbc2('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 5267f95..338f7b5 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 _0x0565=['request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','then','destroy','ChanSpies','sendStatus','stack','name','map','VoiceChanSpy','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','show','params','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','catch','error','update','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x100e63,_0x582612){var _0x5c4ca0=function(_0x1e0f36){while(--_0x1e0f36){_0x100e63['push'](_0x100e63['shift']());}};_0x5c4ca0(++_0x582612);}(_0x0565,0xf2));var _0x5056=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x0565[_0x1cc8fe];return _0x230054;};'use strict';var emlformat=require(_0x5056('0x0'));var rimraf=require(_0x5056('0x1'));var zipdir=require(_0x5056('0x2'));var jsonpatch=require(_0x5056('0x3'));var rp=require(_0x5056('0x4'));var moment=require(_0x5056('0x5'));var BPromise=require(_0x5056('0x6'));var Mustache=require(_0x5056('0x7'));var util=require(_0x5056('0x8'));var path=require(_0x5056('0x9'));var sox=require('sox');var csv=require(_0x5056('0xa'));var ejs=require(_0x5056('0xb'));var fs=require('fs');var fs_extra=require(_0x5056('0xc'));var _=require(_0x5056('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5056('0xe'));var deskjs=require(_0x5056('0xf'));var toCsv=require(_0x5056('0xa'));var querystring=require(_0x5056('0x10'));var Papa=require(_0x5056('0x11'));var Redis=require(_0x5056('0x12'));var authService=require(_0x5056('0x13'));var qs=require(_0x5056('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5056('0x15'));var logger=require(_0x5056('0x16'))(_0x5056('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5056('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x548bcf,_0x53e98a){_0x53e98a=_0x53e98a||0xcc;return function(_0x2d44fb){if(_0x2d44fb){return _0x548bcf['sendStatus'](_0x53e98a);}return _0x548bcf[_0x5056('0x19')](_0x53e98a)[_0x5056('0x1a')]();};}function respondWithResult(_0x7af76b,_0x543cee){_0x543cee=_0x543cee||0xc8;return function(_0x1e8b64){if(_0x1e8b64){return _0x7af76b[_0x5056('0x19')](_0x543cee)[_0x5056('0x1b')](_0x1e8b64);}};}function respondWithFilteredResult(_0x56c3ef,_0x21561d){return function(_0x6a044a){if(_0x6a044a){var _0x4ac332=typeof _0x21561d[_0x5056('0x1c')]==='undefined'&&typeof _0x21561d[_0x5056('0x1d')]===_0x5056('0x1e');var _0x1c0ee9=_0x6a044a[_0x5056('0x1f')];var _0x4056ce=_0x4ac332?0x0:_0x21561d['offset'];var _0x9ea88=_0x4ac332?_0x6a044a[_0x5056('0x1f')]:_0x21561d['offset']+_0x21561d['limit'];var _0x20776c;if(_0x9ea88>=_0x1c0ee9){_0x9ea88=_0x1c0ee9;_0x20776c=0xc8;}else{_0x20776c=0xce;}_0x56c3ef[_0x5056('0x19')](_0x20776c);return _0x56c3ef[_0x5056('0x20')](_0x5056('0x21'),_0x4056ce+'-'+_0x9ea88+'/'+_0x1c0ee9)[_0x5056('0x1b')](_0x6a044a);}return null;};}function patchUpdates(_0xf04e08){return function(_0x33035c){try{jsonpatch['apply'](_0x33035c,_0xf04e08,!![]);}catch(_0x13b363){return BPromise[_0x5056('0x22')](_0x13b363);}return _0x33035c['save']();};}function saveUpdates(_0x271efc,_0x1bccef){return function(_0x2564d0){if(_0x2564d0){return _0x2564d0['update'](_0x271efc)[_0x5056('0x23')](function(_0x26a3c2){return _0x26a3c2;});}return null;};}function removeEntity(_0x5afbfe,_0x4a64be){return function(_0x29e166){if(_0x29e166){return _0x29e166[_0x5056('0x24')]()[_0x5056('0x23')](function(){var _0x37f7b5=_0x29e166['get']({'plain':!![]});var _0x267048=_0x5056('0x25');return db['UserProfileResource'][_0x5056('0x24')]({'where':{'type':_0x267048,'resourceId':_0x37f7b5['id']}})['then'](function(){return _0x29e166;});})[_0x5056('0x23')](function(){_0x5afbfe[_0x5056('0x19')](0xcc)[_0x5056('0x1a')]();});}};}function handleEntityNotFound(_0x2b8fab,_0x45f600){return function(_0x50f2a8){if(!_0x50f2a8){_0x2b8fab[_0x5056('0x26')](0x194);}return _0x50f2a8;};}function handleError(_0x346e9e,_0x14cb84){_0x14cb84=_0x14cb84||0x1f4;return function(_0x2ac79a){logger['error'](_0x2ac79a[_0x5056('0x27')]);if(_0x2ac79a['name']){delete _0x2ac79a[_0x5056('0x28')];}_0x346e9e['status'](_0x14cb84)['send'](_0x2ac79a);};}exports['index']=function(_0x113be0,_0x252f75){var _0x482939={},_0x27f4be={},_0x2c5728={'count':0x0,'rows':[]};var _0x9e2986=_[_0x5056('0x29')](db[_0x5056('0x2a')][_0x5056('0x2b')],function(_0x173fac){return{'name':_0x173fac[_0x5056('0x2c')],'type':_0x173fac[_0x5056('0x2d')][_0x5056('0x2e')]};});_0x27f4be[_0x5056('0x2f')]=_['map'](_0x9e2986,'name');_0x27f4be[_0x5056('0x30')]=_[_0x5056('0x31')](_0x113be0['query']);_0x27f4be[_0x5056('0x32')]=_[_0x5056('0x33')](_0x27f4be['model'],_0x27f4be[_0x5056('0x30')]);_0x482939[_0x5056('0x34')]=_[_0x5056('0x33')](_0x27f4be[_0x5056('0x2f')],qs[_0x5056('0x35')](_0x113be0[_0x5056('0x30')][_0x5056('0x35')]));_0x482939[_0x5056('0x34')]=_0x482939[_0x5056('0x34')][_0x5056('0x36')]?_0x482939[_0x5056('0x34')]:_0x27f4be[_0x5056('0x2f')];if(!_0x113be0[_0x5056('0x30')][_0x5056('0x37')](_0x5056('0x38'))){_0x482939['limit']=qs[_0x5056('0x1d')](_0x113be0['query'][_0x5056('0x1d')]);_0x482939[_0x5056('0x1c')]=qs[_0x5056('0x1c')](_0x113be0[_0x5056('0x30')]['offset']);}_0x482939[_0x5056('0x39')]=qs[_0x5056('0x3a')](_0x113be0['query'][_0x5056('0x3a')]);_0x482939['where']=qs[_0x5056('0x32')](_[_0x5056('0x3b')](_0x113be0[_0x5056('0x30')],_0x27f4be['filters']),_0x9e2986);if(_0x113be0[_0x5056('0x30')][_0x5056('0x3c')]){_0x482939[_0x5056('0x3d')]=_[_0x5056('0x3e')](_0x482939[_0x5056('0x3d')],{'$or':_[_0x5056('0x29')](_0x9e2986,function(_0x1aa311){if(_0x1aa311[_0x5056('0x2d')]!==_0x5056('0x3f')){var _0x430db0={};_0x430db0[_0x1aa311[_0x5056('0x28')]]={'$like':'%'+_0x113be0[_0x5056('0x30')][_0x5056('0x3c')]+'%'};return _0x430db0;}})});}_0x482939=_[_0x5056('0x3e')]({},_0x482939,_0x113be0[_0x5056('0x40')]);var _0x351ebd={'where':_0x482939['where']};return db['VoiceChanSpy'][_0x5056('0x1f')](_0x351ebd)[_0x5056('0x23')](function(_0x6946b4){_0x2c5728[_0x5056('0x1f')]=_0x6946b4;if(_0x113be0[_0x5056('0x30')][_0x5056('0x41')]){_0x482939[_0x5056('0x42')]=[{'all':!![]}];}return db[_0x5056('0x2a')]['findAll'](_0x482939);})['then'](function(_0x68a385){_0x2c5728[_0x5056('0x43')]=_0x68a385;return _0x2c5728;})[_0x5056('0x23')](respondWithFilteredResult(_0x252f75,_0x482939))['catch'](handleError(_0x252f75,null));};exports[_0x5056('0x44')]=function(_0x5b99e9,_0x285fee){var _0x40375b={'raw':![],'where':{'id':_0x5b99e9[_0x5056('0x45')]['id']}},_0x2ef93e={};_0x2ef93e[_0x5056('0x2f')]=_[_0x5056('0x31')](db['VoiceChanSpy'][_0x5056('0x2b')]);_0x2ef93e[_0x5056('0x30')]=_[_0x5056('0x31')](_0x5b99e9['query']);_0x2ef93e['filters']=_['intersection'](_0x2ef93e['model'],_0x2ef93e[_0x5056('0x30')]);_0x40375b[_0x5056('0x34')]=_[_0x5056('0x33')](_0x2ef93e[_0x5056('0x2f')],qs[_0x5056('0x35')](_0x5b99e9['query']['fields']));_0x40375b[_0x5056('0x34')]=_0x40375b[_0x5056('0x34')][_0x5056('0x36')]?_0x40375b[_0x5056('0x34')]:_0x2ef93e[_0x5056('0x2f')];if(_0x5b99e9[_0x5056('0x30')][_0x5056('0x41')]){_0x40375b['include']=[{'all':!![]}];}_0x40375b=_['merge']({},_0x40375b,_0x5b99e9[_0x5056('0x40')]);return db[_0x5056('0x2a')]['find'](_0x40375b)[_0x5056('0x23')](handleEntityNotFound(_0x285fee,null))[_0x5056('0x23')](respondWithResult(_0x285fee,null))['catch'](handleError(_0x285fee,null));};exports['create']=function(_0x83d8e4,_0x1ab1a9){return db['VoiceChanSpy']['create'](_0x83d8e4[_0x5056('0x46')],{})[_0x5056('0x23')](function(_0x528575){var _0x5c3f73=_0x83d8e4[_0x5056('0x47')][_0x5056('0x48')]({'plain':!![]});if(!_0x5c3f73)throw new Error(_0x5056('0x49'));if(_0x5c3f73[_0x5056('0x4a')]===_0x5056('0x47')){var _0xdf427c=_0x528575[_0x5056('0x48')]({'plain':!![]});var _0x366ba2=_0x5056('0x25');return db[_0x5056('0x4b')][_0x5056('0x4c')]({'where':{'name':_0x366ba2,'userProfileId':_0x5c3f73[_0x5056('0x4d')]},'raw':!![]})[_0x5056('0x23')](function(_0x327821){if(_0x327821&&_0x327821[_0x5056('0x4e')]===0x0){return db['UserProfileResource']['create']({'name':_0xdf427c[_0x5056('0x28')],'resourceId':_0xdf427c['id'],'type':_0x327821[_0x5056('0x28')],'sectionId':_0x327821['id']},{})[_0x5056('0x23')](function(){return _0x528575;});}else{return _0x528575;}})[_0x5056('0x4f')](function(_0x35776b){logger[_0x5056('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x35776b);throw _0x35776b;});}return _0x528575;})[_0x5056('0x23')](respondWithResult(_0x1ab1a9,0xc9))[_0x5056('0x4f')](handleError(_0x1ab1a9,null));};exports[_0x5056('0x51')]=function(_0x3d22cc,_0x1ff74a){if(_0x3d22cc[_0x5056('0x46')]['id']){delete _0x3d22cc[_0x5056('0x46')]['id'];}return db[_0x5056('0x2a')][_0x5056('0x4c')]({'where':{'id':_0x3d22cc[_0x5056('0x45')]['id']}})[_0x5056('0x23')](handleEntityNotFound(_0x1ff74a,null))[_0x5056('0x23')](saveUpdates(_0x3d22cc[_0x5056('0x46')],null))['then'](respondWithResult(_0x1ff74a,null))[_0x5056('0x4f')](handleError(_0x1ff74a,null));};exports[_0x5056('0x24')]=function(_0x2df8e8,_0x5363fd){return db[_0x5056('0x2a')][_0x5056('0x4c')]({'where':{'id':_0x2df8e8[_0x5056('0x45')]['id']}})[_0x5056('0x23')](handleEntityNotFound(_0x5363fd,null))['then'](removeEntity(_0x5363fd,null))['catch'](handleError(_0x5363fd,null));}; \ No newline at end of file +var _0x4ded=['name','index','map','VoiceChanSpy','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','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','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','reject','save','update','then','destroy','get','ChanSpies','UserProfileResource','error'];(function(_0x4252bf,_0xc977d7){var _0x32a218=function(_0x5e278a){while(--_0x5e278a){_0x4252bf['push'](_0x4252bf['shift']());}};_0x32a218(++_0xc977d7);}(_0x4ded,0x116));var _0xd4de=function(_0xb46398,_0x261997){_0xb46398=_0xb46398-0x0;var _0x2a1825=_0x4ded[_0xb46398];return _0x2a1825;};'use strict';var emlformat=require(_0xd4de('0x0'));var rimraf=require(_0xd4de('0x1'));var zipdir=require(_0xd4de('0x2'));var jsonpatch=require(_0xd4de('0x3'));var rp=require(_0xd4de('0x4'));var moment=require(_0xd4de('0x5'));var BPromise=require(_0xd4de('0x6'));var Mustache=require(_0xd4de('0x7'));var util=require(_0xd4de('0x8'));var path=require(_0xd4de('0x9'));var sox=require(_0xd4de('0xa'));var csv=require(_0xd4de('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd4de('0xc'));var _=require(_0xd4de('0xd'));var squel=require(_0xd4de('0xe'));var crypto=require(_0xd4de('0xf'));var jsforce=require(_0xd4de('0x10'));var deskjs=require(_0xd4de('0x11'));var toCsv=require('to-csv');var querystring=require(_0xd4de('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd4de('0x13'));var as=require(_0xd4de('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xd4de('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd4de('0x16'));var db=require(_0xd4de('0x17'))['db'];function respondWithStatusCode(_0x104dad,_0x2aa09d){_0x2aa09d=_0x2aa09d||0xcc;return function(_0x3ffc72){if(_0x3ffc72){return _0x104dad[_0xd4de('0x18')](_0x2aa09d);}return _0x104dad[_0xd4de('0x19')](_0x2aa09d)[_0xd4de('0x1a')]();};}function respondWithResult(_0x3e3735,_0x37cb9f){_0x37cb9f=_0x37cb9f||0xc8;return function(_0x691ba9){if(_0x691ba9){return _0x3e3735[_0xd4de('0x19')](_0x37cb9f)[_0xd4de('0x1b')](_0x691ba9);}};}function respondWithFilteredResult(_0xbb4f7e,_0x102e5b){return function(_0xa7c18b){if(_0xa7c18b){var _0x325fba=typeof _0x102e5b['offset']==='undefined'&&typeof _0x102e5b[_0xd4de('0x1c')]===_0xd4de('0x1d');var _0x17b377=_0xa7c18b[_0xd4de('0x1e')];var _0x5b1d1c=_0x325fba?0x0:_0x102e5b['offset'];var _0x1e91d5=_0x325fba?_0xa7c18b['count']:_0x102e5b[_0xd4de('0x1f')]+_0x102e5b[_0xd4de('0x1c')];var _0x50b9e3;if(_0x1e91d5>=_0x17b377){_0x1e91d5=_0x17b377;_0x50b9e3=0xc8;}else{_0x50b9e3=0xce;}_0xbb4f7e[_0xd4de('0x19')](_0x50b9e3);return _0xbb4f7e['set'](_0xd4de('0x20'),_0x5b1d1c+'-'+_0x1e91d5+'/'+_0x17b377)[_0xd4de('0x1b')](_0xa7c18b);}return null;};}function patchUpdates(_0x2bad14){return function(_0x8e8712){try{jsonpatch['apply'](_0x8e8712,_0x2bad14,!![]);}catch(_0x318658){return BPromise[_0xd4de('0x21')](_0x318658);}return _0x8e8712[_0xd4de('0x22')]();};}function saveUpdates(_0xdb3fc,_0x1c631a){return function(_0x2d092a){if(_0x2d092a){return _0x2d092a[_0xd4de('0x23')](_0xdb3fc)[_0xd4de('0x24')](function(_0x2f9de6){return _0x2f9de6;});}return null;};}function removeEntity(_0x413f68,_0x534b37){return function(_0xad333f){if(_0xad333f){return _0xad333f[_0xd4de('0x25')]()[_0xd4de('0x24')](function(){var _0x22970c=_0xad333f[_0xd4de('0x26')]({'plain':!![]});var _0x984904=_0xd4de('0x27');return db[_0xd4de('0x28')][_0xd4de('0x25')]({'where':{'type':_0x984904,'resourceId':_0x22970c['id']}})[_0xd4de('0x24')](function(){return _0xad333f;});})[_0xd4de('0x24')](function(){_0x413f68[_0xd4de('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe64e4e,_0x35e2fc){return function(_0x5005b0){if(!_0x5005b0){_0xe64e4e[_0xd4de('0x18')](0x194);}return _0x5005b0;};}function handleError(_0x59b3c5,_0x44b710){_0x44b710=_0x44b710||0x1f4;return function(_0x32e407){logger[_0xd4de('0x29')](_0x32e407['stack']);if(_0x32e407[_0xd4de('0x2a')]){delete _0x32e407[_0xd4de('0x2a')];}_0x59b3c5[_0xd4de('0x19')](_0x44b710)['send'](_0x32e407);};}exports[_0xd4de('0x2b')]=function(_0x1804c7,_0x55f9f9){var _0x5103b5={},_0x5706fe={},_0x3f6491={'count':0x0,'rows':[]};var _0x496795=_[_0xd4de('0x2c')](db[_0xd4de('0x2d')][_0xd4de('0x2e')],function(_0x2e08eb){return{'name':_0x2e08eb['fieldName'],'type':_0x2e08eb[_0xd4de('0x2f')][_0xd4de('0x30')]};});_0x5706fe['model']=_[_0xd4de('0x2c')](_0x496795,_0xd4de('0x2a'));_0x5706fe['query']=_['keys'](_0x1804c7[_0xd4de('0x31')]);_0x5706fe[_0xd4de('0x32')]=_[_0xd4de('0x33')](_0x5706fe[_0xd4de('0x34')],_0x5706fe['query']);_0x5103b5[_0xd4de('0x35')]=_[_0xd4de('0x33')](_0x5706fe['model'],qs[_0xd4de('0x36')](_0x1804c7[_0xd4de('0x31')][_0xd4de('0x36')]));_0x5103b5[_0xd4de('0x35')]=_0x5103b5[_0xd4de('0x35')][_0xd4de('0x37')]?_0x5103b5['attributes']:_0x5706fe['model'];if(!_0x1804c7[_0xd4de('0x31')][_0xd4de('0x38')](_0xd4de('0x39'))){_0x5103b5['limit']=qs[_0xd4de('0x1c')](_0x1804c7[_0xd4de('0x31')]['limit']);_0x5103b5[_0xd4de('0x1f')]=qs[_0xd4de('0x1f')](_0x1804c7[_0xd4de('0x31')][_0xd4de('0x1f')]);}_0x5103b5['order']=qs['sort'](_0x1804c7[_0xd4de('0x31')]['sort']);_0x5103b5[_0xd4de('0x3a')]=qs['filters'](_[_0xd4de('0x3b')](_0x1804c7[_0xd4de('0x31')],_0x5706fe[_0xd4de('0x32')]),_0x496795);if(_0x1804c7[_0xd4de('0x31')]['filter']){_0x5103b5[_0xd4de('0x3a')]=_['merge'](_0x5103b5[_0xd4de('0x3a')],{'$or':_[_0xd4de('0x2c')](_0x496795,function(_0x7f17b9){if(_0x7f17b9[_0xd4de('0x2f')]!==_0xd4de('0x3c')){var _0x13c256={};_0x13c256[_0x7f17b9[_0xd4de('0x2a')]]={'$like':'%'+_0x1804c7['query'][_0xd4de('0x3d')]+'%'};return _0x13c256;}})});}_0x5103b5=_[_0xd4de('0x3e')]({},_0x5103b5,_0x1804c7[_0xd4de('0x3f')]);var _0x2ec1fa={'where':_0x5103b5[_0xd4de('0x3a')]};return db['VoiceChanSpy'][_0xd4de('0x1e')](_0x2ec1fa)[_0xd4de('0x24')](function(_0x2294e2){_0x3f6491['count']=_0x2294e2;if(_0x1804c7[_0xd4de('0x31')][_0xd4de('0x40')]){_0x5103b5[_0xd4de('0x41')]=[{'all':!![]}];}return db['VoiceChanSpy'][_0xd4de('0x42')](_0x5103b5);})[_0xd4de('0x24')](function(_0x419c49){_0x3f6491[_0xd4de('0x43')]=_0x419c49;return _0x3f6491;})[_0xd4de('0x24')](respondWithFilteredResult(_0x55f9f9,_0x5103b5))[_0xd4de('0x44')](handleError(_0x55f9f9,null));};exports[_0xd4de('0x45')]=function(_0x5ecbbd,_0x43b542){var _0x164bde={'raw':![],'where':{'id':_0x5ecbbd['params']['id']}},_0x58082a={};_0x58082a[_0xd4de('0x34')]=_[_0xd4de('0x46')](db[_0xd4de('0x2d')]['rawAttributes']);_0x58082a['query']=_[_0xd4de('0x46')](_0x5ecbbd[_0xd4de('0x31')]);_0x58082a['filters']=_[_0xd4de('0x33')](_0x58082a[_0xd4de('0x34')],_0x58082a[_0xd4de('0x31')]);_0x164bde[_0xd4de('0x35')]=_['intersection'](_0x58082a[_0xd4de('0x34')],qs[_0xd4de('0x36')](_0x5ecbbd[_0xd4de('0x31')][_0xd4de('0x36')]));_0x164bde[_0xd4de('0x35')]=_0x164bde[_0xd4de('0x35')]['length']?_0x164bde[_0xd4de('0x35')]:_0x58082a[_0xd4de('0x34')];if(_0x5ecbbd[_0xd4de('0x31')][_0xd4de('0x40')]){_0x164bde[_0xd4de('0x41')]=[{'all':!![]}];}_0x164bde=_[_0xd4de('0x3e')]({},_0x164bde,_0x5ecbbd[_0xd4de('0x3f')]);return db[_0xd4de('0x2d')][_0xd4de('0x47')](_0x164bde)[_0xd4de('0x24')](handleEntityNotFound(_0x43b542,null))['then'](respondWithResult(_0x43b542,null))[_0xd4de('0x44')](handleError(_0x43b542,null));};exports[_0xd4de('0x48')]=function(_0x178daf,_0x518bfe){return db[_0xd4de('0x2d')][_0xd4de('0x48')](_0x178daf[_0xd4de('0x49')],{})[_0xd4de('0x24')](function(_0x42e58e){var _0xa24bb7=_0x178daf[_0xd4de('0x4a')][_0xd4de('0x26')]({'plain':!![]});if(!_0xa24bb7)throw new Error(_0xd4de('0x4b'));if(_0xa24bb7[_0xd4de('0x4c')]==='user'){var _0x3e4c7f=_0x42e58e[_0xd4de('0x26')]({'plain':!![]});var _0x215f85=_0xd4de('0x27');return db[_0xd4de('0x4d')]['find']({'where':{'name':_0x215f85,'userProfileId':_0xa24bb7['userProfileId']},'raw':!![]})[_0xd4de('0x24')](function(_0x2deedb){if(_0x2deedb&&_0x2deedb['autoAssociation']===0x0){return db['UserProfileResource'][_0xd4de('0x48')]({'name':_0x3e4c7f[_0xd4de('0x2a')],'resourceId':_0x3e4c7f['id'],'type':_0x2deedb[_0xd4de('0x2a')],'sectionId':_0x2deedb['id']},{})[_0xd4de('0x24')](function(){return _0x42e58e;});}else{return _0x42e58e;}})[_0xd4de('0x44')](function(_0x15c8cd){logger[_0xd4de('0x29')](_0xd4de('0x4e'),_0x15c8cd);throw _0x15c8cd;});}return _0x42e58e;})[_0xd4de('0x24')](respondWithResult(_0x518bfe,0xc9))[_0xd4de('0x44')](handleError(_0x518bfe,null));};exports[_0xd4de('0x23')]=function(_0x2e1780,_0x56c13e){if(_0x2e1780[_0xd4de('0x49')]['id']){delete _0x2e1780[_0xd4de('0x49')]['id'];}return db[_0xd4de('0x2d')][_0xd4de('0x47')]({'where':{'id':_0x2e1780[_0xd4de('0x4f')]['id']}})[_0xd4de('0x24')](handleEntityNotFound(_0x56c13e,null))['then'](saveUpdates(_0x2e1780[_0xd4de('0x49')],null))['then'](respondWithResult(_0x56c13e,null))['catch'](handleError(_0x56c13e,null));};exports[_0xd4de('0x25')]=function(_0xd79781,_0x2d1e45){return db[_0xd4de('0x2d')]['find']({'where':{'id':_0xd79781[_0xd4de('0x4f')]['id']}})[_0xd4de('0x24')](handleEntityNotFound(_0x2d1e45,null))[_0xd4de('0x24')](removeEntity(_0x2d1e45,null))[_0xd4de('0x44')](handleError(_0x2d1e45,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index dae8c51..7693642 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 _0xd8e1=['catch','define','VoiceChanSpy','voice_chanspy','bulkCreate','VoiceExtension','destroy','util','bluebird','./voiceChanSpy.attributes','from-sip','%s%s','prefix','system','push','merge','Set','format','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','internal','User','findAll','agent','then'];(function(_0x4737a0,_0x36520e){var _0x4d558b=function(_0xaa9825){while(--_0xaa9825){_0x4737a0['push'](_0x4737a0['shift']());}};_0x4d558b(++_0x36520e);}(_0xd8e1,0x166));var _0x1d8e=function(_0x54f4f1,_0x2e603b){_0x54f4f1=_0x54f4f1-0x0;var _0x14b71f=_0xd8e1[_0x54f4f1];return _0x14b71f;};'use strict';var _=require('lodash');var util=require(_0x1d8e('0x0'));var BPromise=require(_0x1d8e('0x1'));var attributes=require(_0x1d8e('0x2'));var getUserApplications=function(_0xaf4408,_0x4af434,_0x515e72){var _0x557a5e=0x1;var _0x54acc7=[];var _0x564afb={'context':_0x4af434['context']||_0x1d8e('0x3'),'exten':util['format'](_0x1d8e('0x4'),_0xaf4408[_0x1d8e('0x5')],_0x515e72),'type':_0x1d8e('0x6'),'isApp':![],'ChanSpyId':_0xaf4408['id'],'UserId':_0x4af434['id']};_0x54acc7[_0x1d8e('0x7')](_[_0x1d8e('0x8')]({'app':_0x1d8e('0x9'),'appdata':util[_0x1d8e('0xa')](_0x1d8e('0xb'),_0x1d8e('0xc')),'priority':_0x557a5e++},_0x564afb));if(_0xaf4408[_0x1d8e('0xd')]){_0x54acc7[_0x1d8e('0x7')](_[_0x1d8e('0x8')]({'app':_0x1d8e('0xe'),'appdata':util[_0x1d8e('0xa')](_0x1d8e('0xf'),_0xaf4408[_0x1d8e('0x10')]),'priority':_0x557a5e++},_0x564afb));}if(_0xaf4408[_0x1d8e('0x11')]){_0x54acc7['push'](_[_0x1d8e('0x8')]({'app':_0x1d8e('0x12'),'appdata':_0xaf4408['password'],'priority':_0x557a5e++},_0x564afb));}_0x54acc7[_0x1d8e('0x7')](_['merge']({'app':_0x1d8e('0x13'),'appdata':util[_0x1d8e('0xa')](_0x1d8e('0x14'),_0x4af434[_0x1d8e('0x15')],_0xaf4408['options']?_0xaf4408[_0x1d8e('0x16')][_0x1d8e('0x17')](''):''),'priority':_0x557a5e++},_0x564afb));if(_0xaf4408[_0x1d8e('0xd')]){_0x54acc7[_0x1d8e('0x7')](_[_0x1d8e('0x8')]({'app':_0x1d8e('0x18'),'priority':_0x557a5e++},_0x564afb));}return _0x54acc7;};var getChanSpyApplications=function(_0x2587ff,_0x2853f9){var _0x30db0d=[];for(var _0x2037ee=0x0,_0x1e11e0=0x1;_0x2037ee<_0x2853f9[_0x1d8e('0x19')];_0x2037ee++,_0x1e11e0=0x1){_0x30db0d=_0x30db0d[_0x1d8e('0x1a')](getUserApplications(_0x2587ff,_0x2853f9[_0x2037ee],_0x2853f9[_0x2037ee]['internal']));if(_0x2853f9[_0x2037ee][_0x1d8e('0x1b')]!=_0x2853f9[_0x2037ee][_0x1d8e('0x15')]){_0x30db0d=_0x30db0d['concat'](getUserApplications(_0x2587ff,_0x2853f9[_0x2037ee],_0x2853f9[_0x2037ee][_0x1d8e('0x15')]));}}return _0x30db0d;};var getChanSpyPromise=function(_0x50632e,_0x169b56){return new BPromise(function(_0x32b36d,_0x1dc1e1){return _0x50632e[_0x1d8e('0x1c')][_0x1d8e('0x1d')]({'attributes':['id',_0x1d8e('0x15'),'internal'],'where':{'role':_0x1d8e('0x1e'),'chanspy':!![]},'raw':!![]})[_0x1d8e('0x1f')](function(_0x49adcd){if(_0x49adcd){return _0x32b36d(getChanSpyApplications(_0x169b56,_0x49adcd));}return _0x32b36d([]);})[_0x1d8e('0x20')](function(_0x531832){_0x1dc1e1(_0x531832);});});};module['exports']=function(_0x4821af,_0x13b7b3){var _0x593e64=_0x4821af['models'];return _0x4821af[_0x1d8e('0x21')](_0x1d8e('0x22'),attributes,{'tableName':_0x1d8e('0x23'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x143229,_0x6a005c,_0x27d9a9){return getChanSpyPromise(_0x593e64,_0x143229)[_0x1d8e('0x1f')](function(_0x2d3902){if(_0x2d3902&&_0x2d3902['length']){return _0x593e64['VoiceExtension'][_0x1d8e('0x24')](_0x2d3902);}})['then'](function(){_0x27d9a9();})[_0x1d8e('0x20')](function(_0x3371b0){_0x27d9a9(_0x3371b0);});},'afterUpdate':function(_0x814b36,_0x71ceb9,_0x5e94e6){return _0x593e64[_0x1d8e('0x25')][_0x1d8e('0x26')]({'where':{'ChanSpyId':_0x814b36['id']}})['then'](function(){return getChanSpyPromise(_0x593e64,_0x814b36);})[_0x1d8e('0x1f')](function(_0x24fd83){if(_0x24fd83&&_0x24fd83['length']){return _0x593e64[_0x1d8e('0x25')]['bulkCreate'](_0x24fd83);}})[_0x1d8e('0x1f')](function(){_0x5e94e6();})[_0x1d8e('0x20')](function(_0x488c8d){_0x5e94e6(_0x488c8d);});},'afterDestroy':function(_0x3055ff,_0x2431f9,_0x321504){return _0x593e64[_0x1d8e('0x25')][_0x1d8e('0x26')]({'where':{'ChanSpyId':_0x3055ff['id']}})[_0x1d8e('0x1f')](function(){_0x321504();})[_0x1d8e('0x20')](function(_0x5bd1d6){_0x321504(_0x5bd1d6);});}}});}; \ No newline at end of file +var _0x8bcb=['agent','then','catch','define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','lodash','util','bluebird','./voiceChanSpy.attributes','context','format','prefix','system','Set','chanspy','push','merge','MixMonitor','recordingFormat','Authenticate','password','join','record','StopMixMonitor','length','concat','internal','name'];(function(_0xd0015e,_0x57faf2){var _0x272f6a=function(_0xd8e035){while(--_0xd8e035){_0xd0015e['push'](_0xd0015e['shift']());}};_0x272f6a(++_0x57faf2);}(_0x8bcb,0x17c));var _0xb8bc=function(_0x33deb7,_0x25181a){_0x33deb7=_0x33deb7-0x0;var _0x3dfeeb=_0x8bcb[_0x33deb7];return _0x3dfeeb;};'use strict';var _=require(_0xb8bc('0x0'));var util=require(_0xb8bc('0x1'));var BPromise=require(_0xb8bc('0x2'));var attributes=require(_0xb8bc('0x3'));var getUserApplications=function(_0x2a502d,_0x4359d2,_0x97a700){var _0x7a1419=0x1;var _0xdcf02d=[];var _0x5bfc78={'context':_0x4359d2[_0xb8bc('0x4')]||'from-sip','exten':util[_0xb8bc('0x5')]('%s%s',_0x2a502d[_0xb8bc('0x6')],_0x97a700),'type':_0xb8bc('0x7'),'isApp':![],'ChanSpyId':_0x2a502d['id'],'UserId':_0x4359d2['id']};_0xdcf02d['push'](_['merge']({'app':_0xb8bc('0x8'),'appdata':util[_0xb8bc('0x5')]('CDR(type)=%s',_0xb8bc('0x9')),'priority':_0x7a1419++},_0x5bfc78));if(_0x2a502d['record']){_0xdcf02d[_0xb8bc('0xa')](_[_0xb8bc('0xb')]({'app':_0xb8bc('0xc'),'appdata':util[_0xb8bc('0x5')]('${UNIQUEID}.%s,a',_0x2a502d[_0xb8bc('0xd')]),'priority':_0x7a1419++},_0x5bfc78));}if(_0x2a502d['auth']){_0xdcf02d[_0xb8bc('0xa')](_[_0xb8bc('0xb')]({'app':_0xb8bc('0xe'),'appdata':_0x2a502d[_0xb8bc('0xf')],'priority':_0x7a1419++},_0x5bfc78));}_0xdcf02d[_0xb8bc('0xa')](_[_0xb8bc('0xb')]({'app':'ChanSpy','appdata':util[_0xb8bc('0x5')]('SIP/%s,%s',_0x4359d2['name'],_0x2a502d['options']?_0x2a502d['options'][_0xb8bc('0x10')](''):''),'priority':_0x7a1419++},_0x5bfc78));if(_0x2a502d[_0xb8bc('0x11')]){_0xdcf02d[_0xb8bc('0xa')](_[_0xb8bc('0xb')]({'app':_0xb8bc('0x12'),'priority':_0x7a1419++},_0x5bfc78));}return _0xdcf02d;};var getChanSpyApplications=function(_0x56e69f,_0x11bd3b){var _0x434243=[];for(var _0x2f2831=0x0,_0x1a0ff0=0x1;_0x2f2831<_0x11bd3b[_0xb8bc('0x13')];_0x2f2831++,_0x1a0ff0=0x1){_0x434243=_0x434243[_0xb8bc('0x14')](getUserApplications(_0x56e69f,_0x11bd3b[_0x2f2831],_0x11bd3b[_0x2f2831][_0xb8bc('0x15')]));if(_0x11bd3b[_0x2f2831][_0xb8bc('0x15')]!=_0x11bd3b[_0x2f2831][_0xb8bc('0x16')]){_0x434243=_0x434243['concat'](getUserApplications(_0x56e69f,_0x11bd3b[_0x2f2831],_0x11bd3b[_0x2f2831][_0xb8bc('0x16')]));}}return _0x434243;};var getChanSpyPromise=function(_0x474be7,_0xac9a45){return new BPromise(function(_0xbead2a,_0x18d333){return _0x474be7['User']['findAll']({'attributes':['id',_0xb8bc('0x16'),_0xb8bc('0x15')],'where':{'role':_0xb8bc('0x17'),'chanspy':!![]},'raw':!![]})[_0xb8bc('0x18')](function(_0x1a8219){if(_0x1a8219){return _0xbead2a(getChanSpyApplications(_0xac9a45,_0x1a8219));}return _0xbead2a([]);})[_0xb8bc('0x19')](function(_0x1cc7cf){_0x18d333(_0x1cc7cf);});});};module['exports']=function(_0x50ec95,_0x32374e){var _0x128ae3=_0x50ec95['models'];return _0x50ec95[_0xb8bc('0x1a')](_0xb8bc('0x1b'),attributes,{'tableName':_0xb8bc('0x1c'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3e13ee,_0x137324,_0x3902e6){return getChanSpyPromise(_0x128ae3,_0x3e13ee)[_0xb8bc('0x18')](function(_0x1591c6){if(_0x1591c6&&_0x1591c6[_0xb8bc('0x13')]){return _0x128ae3[_0xb8bc('0x1d')][_0xb8bc('0x1e')](_0x1591c6);}})['then'](function(){_0x3902e6();})['catch'](function(_0x119161){_0x3902e6(_0x119161);});},'afterUpdate':function(_0x5ed56c,_0x182841,_0xc85888){return _0x128ae3['VoiceExtension']['destroy']({'where':{'ChanSpyId':_0x5ed56c['id']}})['then'](function(){return getChanSpyPromise(_0x128ae3,_0x5ed56c);})['then'](function(_0x5cdf24){if(_0x5cdf24&&_0x5cdf24[_0xb8bc('0x13')]){return _0x128ae3['VoiceExtension'][_0xb8bc('0x1e')](_0x5cdf24);}})[_0xb8bc('0x18')](function(){_0xc85888();})[_0xb8bc('0x19')](function(_0x27fd18){_0xc85888(_0x27fd18);});},'afterDestroy':function(_0x4ca201,_0x4adcc1,_0xfd5e84){return _0x128ae3[_0xb8bc('0x1d')]['destroy']({'where':{'ChanSpyId':_0x4ca201['id']}})[_0xb8bc('0x18')](function(){_0xfd5e84();})[_0xb8bc('0x19')](function(_0x38b3a8){_0xfd5e84(_0x38b3a8);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 31c3423..d617c5d 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 _0x1ba2=['message','info','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x1ba2,0xb4));var _0x21ba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1ba2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x21ba('0x0'));var util=require('util');var moment=require(_0x21ba('0x1'));var BPromise=require('bluebird');var rs=require(_0x21ba('0x2'));var fs=require('fs');var Redis=require(_0x21ba('0x3'));var db=require(_0x21ba('0x4'))['db'];var utils=require(_0x21ba('0x5'));var logger=require(_0x21ba('0x6'))('rpc');var config=require(_0x21ba('0x7'));var jayson=require(_0x21ba('0x8'));var client=jayson['client'][_0x21ba('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x53b3e0,_0x44eb71,_0x23c3b7){return new BPromise(function(_0x5c50aa,_0x17755a){return client['request'](_0x53b3e0,_0x23c3b7)[_0x21ba('0xa')](function(_0x261a15){logger['info'](_0x21ba('0xb'),_0x44eb71,_0x21ba('0xc'));logger[_0x21ba('0xd')](_0x21ba('0xe'),_0x44eb71,_0x21ba('0xc'),JSON[_0x21ba('0xf')](_0x261a15));if(_0x261a15[_0x21ba('0x10')]){if(_0x261a15[_0x21ba('0x10')][_0x21ba('0x11')]===0x1f4){logger[_0x21ba('0x10')](_0x21ba('0xb'),_0x44eb71,_0x261a15[_0x21ba('0x10')]['message']);return _0x17755a(_0x261a15['error'][_0x21ba('0x12')]);}logger[_0x21ba('0x10')](_0x21ba('0xb'),_0x44eb71,_0x261a15['error']['message']);return _0x5c50aa(_0x261a15[_0x21ba('0x10')]['message']);}else{logger[_0x21ba('0x13')]('VoiceChanSpy,\x20%s,\x20%s',_0x44eb71,_0x21ba('0xc'));_0x5c50aa(_0x261a15[_0x21ba('0x14')][_0x21ba('0x12')]);}})[_0x21ba('0x15')](function(_0x10b9e6){logger['error'](_0x21ba('0xb'),_0x44eb71,_0x10b9e6);_0x17755a(_0x10b9e6);});});} \ No newline at end of file +var _0x9f4d=['debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent'];(function(_0x267d29,_0x27f1fe){var _0x4cd7c9=function(_0x4526d4){while(--_0x4526d4){_0x267d29['push'](_0x267d29['shift']());}};_0x4cd7c9(++_0x27f1fe);}(_0x9f4d,0xb0));var _0xd9f4=function(_0x929c7e,_0x38c4cc){_0x929c7e=_0x929c7e-0x0;var _0x5de099=_0x9f4d[_0x929c7e];return _0x5de099;};'use strict';var _=require(_0xd9f4('0x0'));var util=require(_0xd9f4('0x1'));var moment=require(_0xd9f4('0x2'));var BPromise=require(_0xd9f4('0x3'));var rs=require(_0xd9f4('0x4'));var fs=require('fs');var Redis=require(_0xd9f4('0x5'));var db=require(_0xd9f4('0x6'))['db'];var utils=require(_0xd9f4('0x7'));var logger=require(_0xd9f4('0x8'))('rpc');var config=require(_0xd9f4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd9f4('0xa')][_0xd9f4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2cc036,_0x366b9d,_0x5cf448){return new BPromise(function(_0x6b13b5,_0x18305f){return client['request'](_0x2cc036,_0x5cf448)[_0xd9f4('0xc')](function(_0x47d52f){logger[_0xd9f4('0xd')](_0xd9f4('0xe'),_0x366b9d,_0xd9f4('0xf'));logger[_0xd9f4('0x10')](_0xd9f4('0x11'),_0x366b9d,'request\x20sent',JSON[_0xd9f4('0x12')](_0x47d52f));if(_0x47d52f[_0xd9f4('0x13')]){if(_0x47d52f[_0xd9f4('0x13')][_0xd9f4('0x14')]===0x1f4){logger[_0xd9f4('0x13')](_0xd9f4('0xe'),_0x366b9d,_0x47d52f[_0xd9f4('0x13')][_0xd9f4('0x15')]);return _0x18305f(_0x47d52f['error'][_0xd9f4('0x15')]);}logger[_0xd9f4('0x13')](_0xd9f4('0xe'),_0x366b9d,_0x47d52f[_0xd9f4('0x13')][_0xd9f4('0x15')]);return _0x6b13b5(_0x47d52f[_0xd9f4('0x13')][_0xd9f4('0x15')]);}else{logger[_0xd9f4('0xd')](_0xd9f4('0xe'),_0x366b9d,_0xd9f4('0xf'));_0x6b13b5(_0x47d52f[_0xd9f4('0x16')][_0xd9f4('0x15')]);}})[_0xd9f4('0x17')](function(_0x5e7da1){logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0x366b9d,_0x5e7da1);_0x18305f(_0x5e7da1);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index ba44214..6faa6ea 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 _0x138f=['connect-timeout','express','../../components/interaction/service','./voiceContext.controller','isAuthenticated','index','get','/:id','show','put','update','delete','destroy','exports','multer','util','path'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x138f,0x140));var _0xf138=function(_0x151553,_0x295f9c){_0x151553=_0x151553-0x0;var _0x1a0ad6=_0x138f[_0x151553];return _0x1a0ad6;};'use strict';var multer=require(_0xf138('0x0'));var util=require(_0xf138('0x1'));var path=require(_0xf138('0x2'));var timeout=require(_0xf138('0x3'));var express=require(_0xf138('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf138('0x5'));var config=require('../../config/environment');var controller=require(_0xf138('0x6'));router['get']('/',auth[_0xf138('0x7')](),controller[_0xf138('0x8')]);router[_0xf138('0x9')](_0xf138('0xa'),auth['isAuthenticated'](),controller[_0xf138('0xb')]);router['post']('/',auth[_0xf138('0x7')](),controller['create']);router[_0xf138('0xc')]('/:id',auth[_0xf138('0x7')](),controller[_0xf138('0xd')]);router[_0xf138('0xe')](_0xf138('0xa'),auth[_0xf138('0x7')](),controller[_0xf138('0xf')]);module[_0xf138('0x10')]=router; \ No newline at end of file +var _0x0a2e=['post','create','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x13342f,_0x3d6303){var _0x2fc1fc=function(_0x2d991f){while(--_0x2d991f){_0x13342f['push'](_0x13342f['shift']());}};_0x2fc1fc(++_0x3d6303);}(_0x0a2e,0x1f4));var _0xe0a2=function(_0x8a30cf,_0x40f19b){_0x8a30cf=_0x8a30cf-0x0;var _0x20f439=_0x0a2e[_0x8a30cf];return _0x20f439;};'use strict';var multer=require(_0xe0a2('0x0'));var util=require(_0xe0a2('0x1'));var path=require('path');var timeout=require(_0xe0a2('0x2'));var express=require(_0xe0a2('0x3'));var router=express[_0xe0a2('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe0a2('0x5'));var interaction=require(_0xe0a2('0x6'));var config=require(_0xe0a2('0x7'));var controller=require('./voiceContext.controller');router[_0xe0a2('0x8')]('/',auth[_0xe0a2('0x9')](),controller[_0xe0a2('0xa')]);router[_0xe0a2('0x8')](_0xe0a2('0xb'),auth[_0xe0a2('0x9')](),controller[_0xe0a2('0xc')]);router[_0xe0a2('0xd')]('/',auth['isAuthenticated'](),controller[_0xe0a2('0xe')]);router['put'](_0xe0a2('0xb'),auth[_0xe0a2('0x9')](),controller[_0xe0a2('0xf')]);router[_0xe0a2('0x10')](_0xe0a2('0xb'),auth[_0xe0a2('0x9')](),controller[_0xe0a2('0x11')]);module[_0xe0a2('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 7e8e17b..a7ebf01 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 _0x89e7=['STRING','name','BOOLEAN','sequelize','exports'];(function(_0x116424,_0x24ef7e){var _0x4abca5=function(_0x4f6ad3){while(--_0x4f6ad3){_0x116424['push'](_0x116424['shift']());}};_0x4abca5(++_0x24ef7e);}(_0x89e7,0x175));var _0x789e=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0x89e7[_0x5c2e3e];return _0x53f64a;};'use strict';var Sequelize=require(_0x789e('0x0'));module[_0x789e('0x1')]={'name':{'type':Sequelize[_0x789e('0x2')],'unique':_0x789e('0x3')},'description':{'type':Sequelize[_0x789e('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x789e('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x954d=['exports','STRING','name','BOOLEAN','sequelize'];(function(_0x59f0dc,_0x1e2497){var _0x5b5445=function(_0x57ca91){while(--_0x57ca91){_0x59f0dc['push'](_0x59f0dc['shift']());}};_0x5b5445(++_0x1e2497);}(_0x954d,0xdb));var _0xd954=function(_0x2d0cdd,_0x5b25b4){_0x2d0cdd=_0x2d0cdd-0x0;var _0x30ba3a=_0x954d[_0x2d0cdd];return _0x30ba3a;};'use strict';var Sequelize=require(_0xd954('0x0'));module[_0xd954('0x1')]={'name':{'type':Sequelize[_0xd954('0x2')],'unique':_0xd954('0x3')},'description':{'type':Sequelize[_0xd954('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xd954('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 0fc15fd..80f926f 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 _0xcd9e=['chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Contexts','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/environment','jayson/promise','client','http','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','get','sendStatus','stack','name','send','map','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','VIRTUAL','filter','VoiceContext','includeAll','params','rawAttributes','include','merge','options','find','create','body','findAll','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload'];(function(_0x3312a5,_0x3c1d4e){var _0x2a0713=function(_0xfcac15){while(--_0xfcac15){_0x3312a5['push'](_0x3312a5['shift']());}};_0x2a0713(++_0x3c1d4e);}(_0xcd9e,0x6e));var _0xecd9=function(_0x41fa5a,_0x135547){_0x41fa5a=_0x41fa5a-0x0;var _0x3f0aad=_0xcd9e[_0x41fa5a];return _0x3f0aad;};'use strict';var emlformat=require(_0xecd9('0x0'));var rimraf=require(_0xecd9('0x1'));var zipdir=require(_0xecd9('0x2'));var jsonpatch=require(_0xecd9('0x3'));var rp=require(_0xecd9('0x4'));var moment=require(_0xecd9('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xecd9('0x6'));var util=require(_0xecd9('0x7'));var path=require('path');var sox=require(_0xecd9('0x8'));var csv=require(_0xecd9('0x9'));var ejs=require(_0xecd9('0xa'));var fs=require('fs');var fs_extra=require(_0xecd9('0xb'));var _=require(_0xecd9('0xc'));var squel=require(_0xecd9('0xd'));var crypto=require(_0xecd9('0xe'));var jsforce=require(_0xecd9('0xf'));var deskjs=require(_0xecd9('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xecd9('0x11'));var Redis=require(_0xecd9('0x12'));var authService=require(_0xecd9('0x13'));var qs=require(_0xecd9('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xecd9('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require(_0xecd9('0x16'));var client=jayson[_0xecd9('0x17')][_0xecd9('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x48a9b5,_0x3d6ba1,_0x56019a,_0x4d5a02){return new BPromise(function(_0x15ac94,_0x179b86){var _0x163653=_0x4d5a02||client;return _0x163653['request'](_0x48a9b5,_0x56019a)['then'](function(_0x570742){logger[_0xecd9('0x19')](_0xecd9('0x1a'),_0x3d6ba1,_0xecd9('0x1b'));logger['debug'](_0xecd9('0x1c'),_0x3d6ba1,_0xecd9('0x1b'),JSON[_0xecd9('0x1d')](_0x570742));if(_0x570742['error']){if(_0x570742[_0xecd9('0x1e')][_0xecd9('0x1f')]===0x1f4){logger[_0xecd9('0x1e')]('VoiceContext,\x20%s,\x20%s',_0x3d6ba1,_0x570742[_0xecd9('0x1e')][_0xecd9('0x20')]);return _0x179b86(_0x570742['error']['message']);}logger[_0xecd9('0x1e')](_0xecd9('0x1a'),_0x3d6ba1,_0x570742[_0xecd9('0x1e')][_0xecd9('0x20')]);return _0x15ac94(_0x570742[_0xecd9('0x1e')][_0xecd9('0x20')]);}else{logger[_0xecd9('0x19')](_0xecd9('0x1a'),_0x3d6ba1,_0xecd9('0x1b'));_0x15ac94(_0x570742[_0xecd9('0x21')][_0xecd9('0x20')]);}})[_0xecd9('0x22')](function(_0x18e776){logger[_0xecd9('0x1e')](_0xecd9('0x1a'),_0x3d6ba1,_0x18e776);_0x179b86(_0x18e776);});});}function respondWithStatusCode(_0x3f940b,_0x174cf0){_0x174cf0=_0x174cf0||0xcc;return function(_0x2dae62){if(_0x2dae62){return _0x3f940b['sendStatus'](_0x174cf0);}return _0x3f940b[_0xecd9('0x23')](_0x174cf0)[_0xecd9('0x24')]();};}function respondWithResult(_0x47eafe,_0x1c9c99){_0x1c9c99=_0x1c9c99||0xc8;return function(_0x503789){if(_0x503789){return _0x47eafe[_0xecd9('0x23')](_0x1c9c99)[_0xecd9('0x25')](_0x503789);}};}function respondWithFilteredResult(_0x3a0e41,_0x422346){return function(_0x526dda){if(_0x526dda){var _0x53e114=typeof _0x422346[_0xecd9('0x26')]===_0xecd9('0x27')&&typeof _0x422346['limit']===_0xecd9('0x27');var _0xd5536d=_0x526dda[_0xecd9('0x28')];var _0xa97ea5=_0x53e114?0x0:_0x422346[_0xecd9('0x26')];var _0x1ad6cf=_0x53e114?_0x526dda[_0xecd9('0x28')]:_0x422346[_0xecd9('0x26')]+_0x422346[_0xecd9('0x29')];var _0xe46755;if(_0x1ad6cf>=_0xd5536d){_0x1ad6cf=_0xd5536d;_0xe46755=0xc8;}else{_0xe46755=0xce;}_0x3a0e41[_0xecd9('0x23')](_0xe46755);return _0x3a0e41['set'](_0xecd9('0x2a'),_0xa97ea5+'-'+_0x1ad6cf+'/'+_0xd5536d)['json'](_0x526dda);}return null;};}function patchUpdates(_0x2eca76){return function(_0x3fa9e8){try{jsonpatch[_0xecd9('0x2b')](_0x3fa9e8,_0x2eca76,!![]);}catch(_0x574166){return BPromise[_0xecd9('0x2c')](_0x574166);}return _0x3fa9e8['save']();};}function saveUpdates(_0xf6d8ef,_0x355d23){return function(_0x2065b6){if(_0x2065b6){return _0x2065b6[_0xecd9('0x2d')](_0xf6d8ef)[_0xecd9('0x2e')](function(_0x4bdc3f){return _0x4bdc3f;});}return null;};}function removeEntity(_0x24a5cc,_0x1e1d5d){return function(_0x2af917){if(_0x2af917){return _0x2af917['destroy']()[_0xecd9('0x2e')](function(){var _0x1311f7=_0x2af917[_0xecd9('0x2f')]({'plain':!![]});var _0x44c19e='Contexts';return db['UserProfileResource']['destroy']({'where':{'type':_0x44c19e,'resourceId':_0x1311f7['id']}})['then'](function(){return _0x2af917;});})['then'](function(){_0x24a5cc['status'](0xcc)[_0xecd9('0x24')]();});}};}function handleEntityNotFound(_0x253b30,_0x12ac23){return function(_0x576a5e){if(!_0x576a5e){_0x253b30[_0xecd9('0x30')](0x194);}return _0x576a5e;};}function handleError(_0x57bd74,_0x4c5d9c){_0x4c5d9c=_0x4c5d9c||0x1f4;return function(_0x460c68){logger[_0xecd9('0x1e')](_0x460c68[_0xecd9('0x31')]);if(_0x460c68[_0xecd9('0x32')]){delete _0x460c68[_0xecd9('0x32')];}_0x57bd74['status'](_0x4c5d9c)[_0xecd9('0x33')](_0x460c68);};}exports['index']=function(_0x2f8c59,_0x1ae89d){var _0x3b120c={},_0x57dd79={},_0x32827f={'count':0x0,'rows':[]};var _0x30e11a=_[_0xecd9('0x34')](db['VoiceContext']['rawAttributes'],function(_0x2e0683){return{'name':_0x2e0683[_0xecd9('0x35')],'type':_0x2e0683[_0xecd9('0x36')][_0xecd9('0x37')]};});_0x57dd79['model']=_[_0xecd9('0x34')](_0x30e11a,_0xecd9('0x32'));_0x57dd79[_0xecd9('0x38')]=_[_0xecd9('0x39')](_0x2f8c59['query']);_0x57dd79['filters']=_[_0xecd9('0x3a')](_0x57dd79[_0xecd9('0x3b')],_0x57dd79[_0xecd9('0x38')]);_0x3b120c[_0xecd9('0x3c')]=_['intersection'](_0x57dd79[_0xecd9('0x3b')],qs[_0xecd9('0x3d')](_0x2f8c59[_0xecd9('0x38')][_0xecd9('0x3d')]));_0x3b120c[_0xecd9('0x3c')]=_0x3b120c[_0xecd9('0x3c')][_0xecd9('0x3e')]?_0x3b120c[_0xecd9('0x3c')]:_0x57dd79[_0xecd9('0x3b')];if(!_0x2f8c59['query']['hasOwnProperty'](_0xecd9('0x3f'))){_0x3b120c[_0xecd9('0x29')]=qs[_0xecd9('0x29')](_0x2f8c59[_0xecd9('0x38')][_0xecd9('0x29')]);_0x3b120c['offset']=qs[_0xecd9('0x26')](_0x2f8c59['query'][_0xecd9('0x26')]);}_0x3b120c[_0xecd9('0x40')]=qs[_0xecd9('0x41')](_0x2f8c59[_0xecd9('0x38')][_0xecd9('0x41')]);_0x3b120c[_0xecd9('0x42')]=qs[_0xecd9('0x43')](_['pick'](_0x2f8c59[_0xecd9('0x38')],_0x57dd79['filters']),_0x30e11a);if(_0x2f8c59[_0xecd9('0x38')]['filter']){_0x3b120c[_0xecd9('0x42')]=_['merge'](_0x3b120c[_0xecd9('0x42')],{'$or':_[_0xecd9('0x34')](_0x30e11a,function(_0x2d2e19){if(_0x2d2e19[_0xecd9('0x36')]!==_0xecd9('0x44')){var _0x165b1a={};_0x165b1a[_0x2d2e19[_0xecd9('0x32')]]={'$like':'%'+_0x2f8c59['query'][_0xecd9('0x45')]+'%'};return _0x165b1a;}})});}_0x3b120c=_['merge']({},_0x3b120c,_0x2f8c59['options']);var _0x356ad5={'where':_0x3b120c[_0xecd9('0x42')]};return db[_0xecd9('0x46')][_0xecd9('0x28')](_0x356ad5)['then'](function(_0x214163){_0x32827f[_0xecd9('0x28')]=_0x214163;if(_0x2f8c59['query'][_0xecd9('0x47')]){_0x3b120c['include']=[{'all':!![]}];}return db['VoiceContext']['findAll'](_0x3b120c);})[_0xecd9('0x2e')](function(_0x12ab3d){_0x32827f['rows']=_0x12ab3d;return _0x32827f;})[_0xecd9('0x2e')](respondWithFilteredResult(_0x1ae89d,_0x3b120c))[_0xecd9('0x22')](handleError(_0x1ae89d,null));};exports['show']=function(_0x13f405,_0x5b6cd7){var _0x2c5729={'raw':![],'where':{'id':_0x13f405[_0xecd9('0x48')]['id']}},_0x2917d0={};_0x2917d0[_0xecd9('0x3b')]=_[_0xecd9('0x39')](db['VoiceContext'][_0xecd9('0x49')]);_0x2917d0['query']=_['keys'](_0x13f405[_0xecd9('0x38')]);_0x2917d0[_0xecd9('0x43')]=_[_0xecd9('0x3a')](_0x2917d0[_0xecd9('0x3b')],_0x2917d0[_0xecd9('0x38')]);_0x2c5729[_0xecd9('0x3c')]=_[_0xecd9('0x3a')](_0x2917d0[_0xecd9('0x3b')],qs['fields'](_0x13f405['query'][_0xecd9('0x3d')]));_0x2c5729[_0xecd9('0x3c')]=_0x2c5729[_0xecd9('0x3c')][_0xecd9('0x3e')]?_0x2c5729[_0xecd9('0x3c')]:_0x2917d0[_0xecd9('0x3b')];if(_0x13f405[_0xecd9('0x38')][_0xecd9('0x47')]){_0x2c5729[_0xecd9('0x4a')]=[{'all':!![]}];}_0x2c5729=_[_0xecd9('0x4b')]({},_0x2c5729,_0x13f405[_0xecd9('0x4c')]);return db['VoiceContext'][_0xecd9('0x4d')](_0x2c5729)[_0xecd9('0x2e')](handleEntityNotFound(_0x5b6cd7,null))[_0xecd9('0x2e')](respondWithResult(_0x5b6cd7,null))[_0xecd9('0x22')](handleError(_0x5b6cd7,null));};exports[_0xecd9('0x4e')]=function(_0x1f7e70,_0x57049f,_0x675bf9){var _0x322898;return db[_0xecd9('0x46')][_0xecd9('0x4e')](_0x1f7e70[_0xecd9('0x4f')],{'raw':!![]})[_0xecd9('0x2e')](function(_0x741cc1){_0x322898=_0x741cc1;return db['VoiceContext'][_0xecd9('0x50')]({'raw':!![]});})[_0xecd9('0x2e')](function(_0x236af0){var _0x296a70=fs['readFileSync'](path['join'](config[_0xecd9('0x51')],_0xecd9('0x52')),_0xecd9('0x53'));var _0xac1135=ejs[_0xecd9('0x54')](_0x296a70,{'contexts':_0x236af0||[]});fs[_0xecd9('0x55')](_0xecd9('0x56'),_0xac1135);})[_0xecd9('0x2e')](function(){return respondWithRpcPromise(_0xecd9('0x57'),_0xecd9('0x4e'),{'module':_0xecd9('0x58')});})[_0xecd9('0x2e')](function(){var _0xd8bb7f=_0x1f7e70[_0xecd9('0x59')]['get']({'plain':!![]});if(!_0xd8bb7f)throw new Error(_0xecd9('0x5a'));if(_0xd8bb7f[_0xecd9('0x5b')]==='user'){var _0x628f3b=_0x322898[_0xecd9('0x2f')]({'plain':!![]});return db[_0xecd9('0x5c')][_0xecd9('0x4d')]({'where':{'name':_0xecd9('0x5d'),'userProfileId':_0xd8bb7f['userProfileId']},'raw':!![]})['then'](function(_0x44d112){if(_0x44d112&&_0x44d112[_0xecd9('0x5e')]===0x0){return db['UserProfileResource']['create']({'name':_0x628f3b[_0xecd9('0x32')],'resourceId':_0x628f3b['id'],'type':_0x44d112[_0xecd9('0x32')],'sectionId':_0x44d112['id']},{})['then'](function(){return _0x322898;});}else{return _0x322898;}})['catch'](function(_0x95b55b){logger[_0xecd9('0x1e')](_0xecd9('0x5f'),_0x95b55b);throw _0x95b55b;});}return _0x322898;})[_0xecd9('0x2e')](respondWithResult(_0x57049f,0xc9))[_0xecd9('0x22')](handleError(_0x57049f,null));};exports['update']=function(_0x289d05,_0xca1ba9,_0xade2e5){var _0x18a1c5;return db['VoiceContext']['find']({'where':{'id':_0x289d05[_0xecd9('0x48')]['id']}})[_0xecd9('0x2e')](handleEntityNotFound(_0xca1ba9,null))['then'](saveUpdates(_0x289d05[_0xecd9('0x4f')],null))[_0xecd9('0x2e')](function(_0x19bed6){if(_0x19bed6){_0x18a1c5=_0x19bed6;return db[_0xecd9('0x46')]['findAll']({'raw':!![]});}})['then'](function(_0x2f3531){var _0x10acdc=fs[_0xecd9('0x60')](path[_0xecd9('0x61')](config['root'],_0xecd9('0x52')),'utf8');var _0x582aea=ejs[_0xecd9('0x54')](_0x10acdc,{'contexts':_0x2f3531||[]});fs['writeFileSync'](_0xecd9('0x56'),_0x582aea);})[_0xecd9('0x2e')](function(){return respondWithRpcPromise('Reload','update',{'module':_0xecd9('0x58')});})[_0xecd9('0x2e')](function(){return _0x18a1c5;})[_0xecd9('0x2e')](respondWithResult(_0xca1ba9,null))[_0xecd9('0x22')](handleError(_0xca1ba9,null));};exports[_0xecd9('0x62')]=function(_0x1ce991,_0x2ad7e2,_0x3ccb4b){var _0x3d7cff;return db['VoiceContext'][_0xecd9('0x4d')]({'where':{'id':_0x1ce991[_0xecd9('0x48')]['id']}})['then'](handleEntityNotFound(_0x2ad7e2,null))[_0xecd9('0x2e')](removeEntity(_0x2ad7e2,null))[_0xecd9('0x2e')](function(){return db[_0xecd9('0x46')][_0xecd9('0x50')]({'raw':!![]});})['then'](function(_0x2e6f0d){var _0xcc81e3=fs['readFileSync'](path[_0xecd9('0x61')](config[_0xecd9('0x51')],_0xecd9('0x52')),_0xecd9('0x53'));var _0x4931c7=ejs['render'](_0xcc81e3,{'contexts':_0x2e6f0d});fs[_0xecd9('0x55')](_0xecd9('0x56'),_0x4931c7);return respondWithRpcPromise(_0xecd9('0x57'),'destroy',{'module':_0xecd9('0x58')});})['catch'](handleError(_0x2ad7e2,null));}; \ No newline at end of file +var _0x4329=['pick','filter','merge','type','VIRTUAL','options','VoiceContext','count','findAll','rows','show','params','keys','include','create','body','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','writeFileSync','Reload','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','lodash','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','set','Content-Range','apply','reject','save','update','get','Contexts','UserProfileResource','destroy','end','name','send','index','map','rawAttributes','fieldName','key','model','filters','intersection','attributes','fields','query','length','nolimit','limit','sort','where'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4329,0x88));var _0x9432=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x4329[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require(_0x9432('0x0'));var rimraf=require(_0x9432('0x1'));var zipdir=require(_0x9432('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9432('0x3'));var moment=require(_0x9432('0x4'));var BPromise=require(_0x9432('0x5'));var Mustache=require('mustache');var util=require(_0x9432('0x6'));var path=require(_0x9432('0x7'));var sox=require(_0x9432('0x8'));var csv=require('to-csv');var ejs=require(_0x9432('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9432('0xa'));var squel=require('squel');var crypto=require(_0x9432('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9432('0xc'));var toCsv=require(_0x9432('0xd'));var querystring=require('querystring');var Papa=require(_0x9432('0xe'));var Redis=require(_0x9432('0xf'));var authService=require(_0x9432('0x10'));var qs=require(_0x9432('0x11'));var as=require(_0x9432('0x12'));var hardwareService=require(_0x9432('0x13'));var logger=require('../../config/logger')(_0x9432('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9432('0x15'));var db=require(_0x9432('0x16'))['db'];var jayson=require(_0x9432('0x17'));var client=jayson[_0x9432('0x18')][_0x9432('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x8d8f6a,_0x3eacf3,_0x3dee03,_0xc6463e){return new BPromise(function(_0x13fb9d,_0x23b033){var _0x7e8c9=_0xc6463e||client;return _0x7e8c9[_0x9432('0x1a')](_0x8d8f6a,_0x3dee03)[_0x9432('0x1b')](function(_0x291dab){logger[_0x9432('0x1c')]('VoiceContext,\x20%s,\x20%s',_0x3eacf3,_0x9432('0x1d'));logger[_0x9432('0x1e')](_0x9432('0x1f'),_0x3eacf3,'request\x20sent',JSON[_0x9432('0x20')](_0x291dab));if(_0x291dab[_0x9432('0x21')]){if(_0x291dab[_0x9432('0x21')][_0x9432('0x22')]===0x1f4){logger[_0x9432('0x21')](_0x9432('0x23'),_0x3eacf3,_0x291dab[_0x9432('0x21')][_0x9432('0x24')]);return _0x23b033(_0x291dab[_0x9432('0x21')][_0x9432('0x24')]);}logger[_0x9432('0x21')]('VoiceContext,\x20%s,\x20%s',_0x3eacf3,_0x291dab[_0x9432('0x21')]['message']);return _0x13fb9d(_0x291dab[_0x9432('0x21')][_0x9432('0x24')]);}else{logger[_0x9432('0x1c')](_0x9432('0x23'),_0x3eacf3,'request\x20sent');_0x13fb9d(_0x291dab[_0x9432('0x25')][_0x9432('0x24')]);}})[_0x9432('0x26')](function(_0xbf28f1){logger[_0x9432('0x21')](_0x9432('0x23'),_0x3eacf3,_0xbf28f1);_0x23b033(_0xbf28f1);});});}function respondWithStatusCode(_0x25ae83,_0x3120db){_0x3120db=_0x3120db||0xcc;return function(_0x1b8fd4){if(_0x1b8fd4){return _0x25ae83[_0x9432('0x27')](_0x3120db);}return _0x25ae83[_0x9432('0x28')](_0x3120db)['end']();};}function respondWithResult(_0x245501,_0x51ce23){_0x51ce23=_0x51ce23||0xc8;return function(_0x2fb373){if(_0x2fb373){return _0x245501[_0x9432('0x28')](_0x51ce23)[_0x9432('0x29')](_0x2fb373);}};}function respondWithFilteredResult(_0x1c6c45,_0x1d1d99){return function(_0x249007){if(_0x249007){var _0x5499d8=typeof _0x1d1d99[_0x9432('0x2a')]==='undefined'&&typeof _0x1d1d99['limit']==='undefined';var _0x461e1c=_0x249007['count'];var _0x135322=_0x5499d8?0x0:_0x1d1d99['offset'];var _0x1ff8fe=_0x5499d8?_0x249007['count']:_0x1d1d99[_0x9432('0x2a')]+_0x1d1d99['limit'];var _0x395d92;if(_0x1ff8fe>=_0x461e1c){_0x1ff8fe=_0x461e1c;_0x395d92=0xc8;}else{_0x395d92=0xce;}_0x1c6c45[_0x9432('0x28')](_0x395d92);return _0x1c6c45[_0x9432('0x2b')](_0x9432('0x2c'),_0x135322+'-'+_0x1ff8fe+'/'+_0x461e1c)['json'](_0x249007);}return null;};}function patchUpdates(_0x2c0d63){return function(_0x43dbc3){try{jsonpatch[_0x9432('0x2d')](_0x43dbc3,_0x2c0d63,!![]);}catch(_0x1571e1){return BPromise[_0x9432('0x2e')](_0x1571e1);}return _0x43dbc3[_0x9432('0x2f')]();};}function saveUpdates(_0x12cf70,_0x4f18ba){return function(_0x2ae0fe){if(_0x2ae0fe){return _0x2ae0fe[_0x9432('0x30')](_0x12cf70)[_0x9432('0x1b')](function(_0x3aa6dd){return _0x3aa6dd;});}return null;};}function removeEntity(_0x30f6e6,_0xecafe5){return function(_0x1046db){if(_0x1046db){return _0x1046db['destroy']()[_0x9432('0x1b')](function(){var _0x26e7d0=_0x1046db[_0x9432('0x31')]({'plain':!![]});var _0x3848fd=_0x9432('0x32');return db[_0x9432('0x33')][_0x9432('0x34')]({'where':{'type':_0x3848fd,'resourceId':_0x26e7d0['id']}})[_0x9432('0x1b')](function(){return _0x1046db;});})[_0x9432('0x1b')](function(){_0x30f6e6[_0x9432('0x28')](0xcc)[_0x9432('0x35')]();});}};}function handleEntityNotFound(_0x3403ec,_0x3f2906){return function(_0x11c04a){if(!_0x11c04a){_0x3403ec[_0x9432('0x27')](0x194);}return _0x11c04a;};}function handleError(_0x522aff,_0x4453f3){_0x4453f3=_0x4453f3||0x1f4;return function(_0x1faf0b){logger['error'](_0x1faf0b['stack']);if(_0x1faf0b[_0x9432('0x36')]){delete _0x1faf0b[_0x9432('0x36')];}_0x522aff['status'](_0x4453f3)[_0x9432('0x37')](_0x1faf0b);};}exports[_0x9432('0x38')]=function(_0xcc4061,_0x3beb33){var _0x257f7a={},_0x453d44={},_0x1c7efe={'count':0x0,'rows':[]};var _0x18f4bf=_[_0x9432('0x39')](db['VoiceContext'][_0x9432('0x3a')],function(_0x176686){return{'name':_0x176686[_0x9432('0x3b')],'type':_0x176686['type'][_0x9432('0x3c')]};});_0x453d44[_0x9432('0x3d')]=_[_0x9432('0x39')](_0x18f4bf,'name');_0x453d44['query']=_['keys'](_0xcc4061['query']);_0x453d44[_0x9432('0x3e')]=_[_0x9432('0x3f')](_0x453d44['model'],_0x453d44['query']);_0x257f7a[_0x9432('0x40')]=_['intersection'](_0x453d44[_0x9432('0x3d')],qs[_0x9432('0x41')](_0xcc4061[_0x9432('0x42')][_0x9432('0x41')]));_0x257f7a[_0x9432('0x40')]=_0x257f7a[_0x9432('0x40')][_0x9432('0x43')]?_0x257f7a[_0x9432('0x40')]:_0x453d44['model'];if(!_0xcc4061[_0x9432('0x42')]['hasOwnProperty'](_0x9432('0x44'))){_0x257f7a[_0x9432('0x45')]=qs[_0x9432('0x45')](_0xcc4061[_0x9432('0x42')]['limit']);_0x257f7a['offset']=qs[_0x9432('0x2a')](_0xcc4061[_0x9432('0x42')][_0x9432('0x2a')]);}_0x257f7a['order']=qs[_0x9432('0x46')](_0xcc4061['query'][_0x9432('0x46')]);_0x257f7a[_0x9432('0x47')]=qs[_0x9432('0x3e')](_[_0x9432('0x48')](_0xcc4061[_0x9432('0x42')],_0x453d44[_0x9432('0x3e')]),_0x18f4bf);if(_0xcc4061[_0x9432('0x42')][_0x9432('0x49')]){_0x257f7a[_0x9432('0x47')]=_[_0x9432('0x4a')](_0x257f7a[_0x9432('0x47')],{'$or':_[_0x9432('0x39')](_0x18f4bf,function(_0x83cfd3){if(_0x83cfd3[_0x9432('0x4b')]!==_0x9432('0x4c')){var _0x3e8624={};_0x3e8624[_0x83cfd3[_0x9432('0x36')]]={'$like':'%'+_0xcc4061[_0x9432('0x42')][_0x9432('0x49')]+'%'};return _0x3e8624;}})});}_0x257f7a=_[_0x9432('0x4a')]({},_0x257f7a,_0xcc4061[_0x9432('0x4d')]);var _0xa4965b={'where':_0x257f7a[_0x9432('0x47')]};return db[_0x9432('0x4e')][_0x9432('0x4f')](_0xa4965b)[_0x9432('0x1b')](function(_0x436db2){_0x1c7efe[_0x9432('0x4f')]=_0x436db2;if(_0xcc4061['query']['includeAll']){_0x257f7a['include']=[{'all':!![]}];}return db[_0x9432('0x4e')][_0x9432('0x50')](_0x257f7a);})['then'](function(_0x45fd26){_0x1c7efe[_0x9432('0x51')]=_0x45fd26;return _0x1c7efe;})[_0x9432('0x1b')](respondWithFilteredResult(_0x3beb33,_0x257f7a))[_0x9432('0x26')](handleError(_0x3beb33,null));};exports[_0x9432('0x52')]=function(_0x3ee606,_0x4dad25){var _0x3d368={'raw':![],'where':{'id':_0x3ee606[_0x9432('0x53')]['id']}},_0x30ffcf={};_0x30ffcf[_0x9432('0x3d')]=_[_0x9432('0x54')](db[_0x9432('0x4e')][_0x9432('0x3a')]);_0x30ffcf[_0x9432('0x42')]=_[_0x9432('0x54')](_0x3ee606[_0x9432('0x42')]);_0x30ffcf[_0x9432('0x3e')]=_['intersection'](_0x30ffcf[_0x9432('0x3d')],_0x30ffcf['query']);_0x3d368[_0x9432('0x40')]=_[_0x9432('0x3f')](_0x30ffcf['model'],qs[_0x9432('0x41')](_0x3ee606[_0x9432('0x42')][_0x9432('0x41')]));_0x3d368[_0x9432('0x40')]=_0x3d368[_0x9432('0x40')][_0x9432('0x43')]?_0x3d368['attributes']:_0x30ffcf[_0x9432('0x3d')];if(_0x3ee606['query']['includeAll']){_0x3d368[_0x9432('0x55')]=[{'all':!![]}];}_0x3d368=_[_0x9432('0x4a')]({},_0x3d368,_0x3ee606[_0x9432('0x4d')]);return db['VoiceContext']['find'](_0x3d368)['then'](handleEntityNotFound(_0x4dad25,null))[_0x9432('0x1b')](respondWithResult(_0x4dad25,null))[_0x9432('0x26')](handleError(_0x4dad25,null));};exports[_0x9432('0x56')]=function(_0x915244,_0x5e5021,_0x2a6530){var _0x270606;return db['VoiceContext'][_0x9432('0x56')](_0x915244[_0x9432('0x57')],{'raw':!![]})[_0x9432('0x1b')](function(_0x249b6b){_0x270606=_0x249b6b;return db[_0x9432('0x4e')][_0x9432('0x50')]({'raw':!![]});})['then'](function(_0x425ec5){var _0x42d334=fs[_0x9432('0x58')](path[_0x9432('0x59')](config[_0x9432('0x5a')],_0x9432('0x5b')),_0x9432('0x5c'));var _0x1771b9=ejs[_0x9432('0x5d')](_0x42d334,{'contexts':_0x425ec5||[]});fs['writeFileSync'](_0x9432('0x5e'),_0x1771b9);})[_0x9432('0x1b')](function(){return respondWithRpcPromise('Reload',_0x9432('0x56'),{'module':_0x9432('0x5f')});})[_0x9432('0x1b')](function(){var _0x1757c6=_0x915244['user']['get']({'plain':!![]});if(!_0x1757c6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1757c6['role']===_0x9432('0x60')){var _0x4c0d4d=_0x270606[_0x9432('0x31')]({'plain':!![]});return db[_0x9432('0x61')][_0x9432('0x62')]({'where':{'name':_0x9432('0x32'),'userProfileId':_0x1757c6[_0x9432('0x63')]},'raw':!![]})[_0x9432('0x1b')](function(_0x12ec85){if(_0x12ec85&&_0x12ec85[_0x9432('0x64')]===0x0){return db['UserProfileResource'][_0x9432('0x56')]({'name':_0x4c0d4d[_0x9432('0x36')],'resourceId':_0x4c0d4d['id'],'type':_0x12ec85[_0x9432('0x36')],'sectionId':_0x12ec85['id']},{})[_0x9432('0x1b')](function(){return _0x270606;});}else{return _0x270606;}})[_0x9432('0x26')](function(_0x49245f){logger[_0x9432('0x21')](_0x9432('0x65'),_0x49245f);throw _0x49245f;});}return _0x270606;})[_0x9432('0x1b')](respondWithResult(_0x5e5021,0xc9))['catch'](handleError(_0x5e5021,null));};exports[_0x9432('0x30')]=function(_0x116411,_0x55778c,_0x253034){var _0xbcb4bc;return db['VoiceContext'][_0x9432('0x62')]({'where':{'id':_0x116411[_0x9432('0x53')]['id']}})[_0x9432('0x1b')](handleEntityNotFound(_0x55778c,null))[_0x9432('0x1b')](saveUpdates(_0x116411[_0x9432('0x57')],null))[_0x9432('0x1b')](function(_0x1aa882){if(_0x1aa882){_0xbcb4bc=_0x1aa882;return db[_0x9432('0x4e')][_0x9432('0x50')]({'raw':!![]});}})[_0x9432('0x1b')](function(_0x4ccf29){var _0x21900c=fs[_0x9432('0x58')](path[_0x9432('0x59')](config[_0x9432('0x5a')],_0x9432('0x5b')),_0x9432('0x5c'));var _0x4f164e=ejs[_0x9432('0x5d')](_0x21900c,{'contexts':_0x4ccf29||[]});fs[_0x9432('0x66')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x4f164e);})[_0x9432('0x1b')](function(){return respondWithRpcPromise(_0x9432('0x67'),'update',{'module':_0x9432('0x5f')});})[_0x9432('0x1b')](function(){return _0xbcb4bc;})[_0x9432('0x1b')](respondWithResult(_0x55778c,null))[_0x9432('0x26')](handleError(_0x55778c,null));};exports[_0x9432('0x34')]=function(_0x2ac1f2,_0x394457,_0x23ae1d){var _0xf013c7;return db[_0x9432('0x4e')]['find']({'where':{'id':_0x2ac1f2[_0x9432('0x53')]['id']}})['then'](handleEntityNotFound(_0x394457,null))[_0x9432('0x1b')](removeEntity(_0x394457,null))[_0x9432('0x1b')](function(){return db['VoiceContext']['findAll']({'raw':!![]});})[_0x9432('0x1b')](function(_0x277b64){var _0x5f2241=fs[_0x9432('0x58')](path[_0x9432('0x59')](config['root'],_0x9432('0x5b')),_0x9432('0x5c'));var _0x40fc26=ejs['render'](_0x5f2241,{'contexts':_0x277b64});fs[_0x9432('0x66')](_0x9432('0x5e'),_0x40fc26);return respondWithRpcPromise(_0x9432('0x67'),_0x9432('0x34'),{'module':_0x9432('0x5f')});})[_0x9432('0x26')](handleError(_0x394457,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 3edf5ab..c3df370 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 _0xf5ff=['lodash','../../config/logger','api','moment','rimraf','../../config/environment','./voiceContext.attributes','exports','VoiceContext','voice_contexts'];(function(_0x13b48f,_0x1a7d1b){var _0x5281a6=function(_0x2465ba){while(--_0x2465ba){_0x13b48f['push'](_0x13b48f['shift']());}};_0x5281a6(++_0x1a7d1b);}(_0xf5ff,0xbe));var _0xff5f=function(_0x212679,_0x3f7b9a){_0x212679=_0x212679-0x0;var _0x1309ec=_0xf5ff[_0x212679];return _0x1309ec;};'use strict';var _=require(_0xff5f('0x0'));var util=require('util');var logger=require(_0xff5f('0x1'))(_0xff5f('0x2'));var moment=require(_0xff5f('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xff5f('0x4'));var config=require(_0xff5f('0x5'));var attributes=require(_0xff5f('0x6'));module[_0xff5f('0x7')]=function(_0x4119e5,_0x4cceef){return _0x4119e5['define'](_0xff5f('0x8'),attributes,{'tableName':_0xff5f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8294=['rimraf','./voiceContext.attributes','define','voice_contexts','lodash','util','api','request-promise','path'];(function(_0x4c80e6,_0x311da5){var _0x45d302=function(_0x4cc232){while(--_0x4cc232){_0x4c80e6['push'](_0x4c80e6['shift']());}};_0x45d302(++_0x311da5);}(_0x8294,0x1c6));var _0x4829=function(_0x23c463,_0x535439){_0x23c463=_0x23c463-0x0;var _0x4276ea=_0x8294[_0x23c463];return _0x4276ea;};'use strict';var _=require(_0x4829('0x0'));var util=require(_0x4829('0x1'));var logger=require('../../config/logger')(_0x4829('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4829('0x3'));var fs=require('fs');var path=require(_0x4829('0x4'));var rimraf=require(_0x4829('0x5'));var config=require('../../config/environment');var attributes=require(_0x4829('0x6'));module['exports']=function(_0x1028d4,_0x211bd9){return _0x1028d4[_0x4829('0x7')]('VoiceContext',attributes,{'tableName':_0x4829('0x8'),'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 9ada773..6ee89ec 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 _0xbb59=['VoiceContext,\x20%s,\x20%s,\x20%s','error','code','message','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbb59,0x1d2));var _0x9bb5=function(_0x509e41,_0x4c9b76){_0x509e41=_0x509e41-0x0;var _0x48223c=_0xbb59[_0x509e41];return _0x48223c;};'use strict';var _=require(_0x9bb5('0x0'));var util=require('util');var moment=require(_0x9bb5('0x1'));var BPromise=require(_0x9bb5('0x2'));var rs=require(_0x9bb5('0x3'));var fs=require('fs');var Redis=require(_0x9bb5('0x4'));var db=require(_0x9bb5('0x5'))['db'];var utils=require(_0x9bb5('0x6'));var logger=require(_0x9bb5('0x7'))(_0x9bb5('0x8'));var config=require(_0x9bb5('0x9'));var jayson=require(_0x9bb5('0xa'));var client=jayson[_0x9bb5('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5930df,_0x2a195e,_0x107b28){return new BPromise(function(_0x327a6a,_0xe176c1){return client['request'](_0x5930df,_0x107b28)[_0x9bb5('0xc')](function(_0x1e3a64){logger[_0x9bb5('0xd')](_0x9bb5('0xe'),_0x2a195e,_0x9bb5('0xf'));logger[_0x9bb5('0x10')](_0x9bb5('0x11'),_0x2a195e,'request\x20sent',JSON['stringify'](_0x1e3a64));if(_0x1e3a64[_0x9bb5('0x12')]){if(_0x1e3a64['error'][_0x9bb5('0x13')]===0x1f4){logger[_0x9bb5('0x12')]('VoiceContext,\x20%s,\x20%s',_0x2a195e,_0x1e3a64[_0x9bb5('0x12')]['message']);return _0xe176c1(_0x1e3a64[_0x9bb5('0x12')][_0x9bb5('0x14')]);}logger['error']('VoiceContext,\x20%s,\x20%s',_0x2a195e,_0x1e3a64[_0x9bb5('0x12')]['message']);return _0x327a6a(_0x1e3a64[_0x9bb5('0x12')][_0x9bb5('0x14')]);}else{logger[_0x9bb5('0xd')]('VoiceContext,\x20%s,\x20%s',_0x2a195e,_0x9bb5('0xf'));_0x327a6a(_0x1e3a64['result'][_0x9bb5('0x14')]);}})['catch'](function(_0x472eda){logger['error'](_0x9bb5('0xe'),_0x2a195e,_0x472eda);_0xe176c1(_0x472eda);});});} \ No newline at end of file +var _0xc902=['../../config/environment','jayson/promise','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x2da357,_0x1f9b2f){var _0x138fdd=function(_0xe3077d){while(--_0xe3077d){_0x2da357['push'](_0x2da357['shift']());}};_0x138fdd(++_0x1f9b2f);}(_0xc902,0x15c));var _0x2c90=function(_0x475513,_0x386366){_0x475513=_0x475513-0x0;var _0x31d360=_0xc902[_0x475513];return _0x31d360;};'use strict';var _=require(_0x2c90('0x0'));var util=require(_0x2c90('0x1'));var moment=require(_0x2c90('0x2'));var BPromise=require(_0x2c90('0x3'));var rs=require(_0x2c90('0x4'));var fs=require('fs');var Redis=require(_0x2c90('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2c90('0x6'));var logger=require(_0x2c90('0x7'))(_0x2c90('0x8'));var config=require(_0x2c90('0x9'));var jayson=require(_0x2c90('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x73546a,_0x2b16eb,_0x2a9ed9){return new BPromise(function(_0x5edd0d,_0xfb5e40){return client['request'](_0x73546a,_0x2a9ed9)['then'](function(_0x1ee22a){logger['info'](_0x2c90('0xb'),_0x2b16eb,_0x2c90('0xc'));logger[_0x2c90('0xd')](_0x2c90('0xe'),_0x2b16eb,_0x2c90('0xc'),JSON[_0x2c90('0xf')](_0x1ee22a));if(_0x1ee22a[_0x2c90('0x10')]){if(_0x1ee22a[_0x2c90('0x10')]['code']===0x1f4){logger[_0x2c90('0x10')](_0x2c90('0xb'),_0x2b16eb,_0x1ee22a['error'][_0x2c90('0x11')]);return _0xfb5e40(_0x1ee22a['error'][_0x2c90('0x11')]);}logger[_0x2c90('0x10')](_0x2c90('0xb'),_0x2b16eb,_0x1ee22a[_0x2c90('0x10')][_0x2c90('0x11')]);return _0x5edd0d(_0x1ee22a[_0x2c90('0x10')]['message']);}else{logger[_0x2c90('0x12')](_0x2c90('0xb'),_0x2b16eb,_0x2c90('0xc'));_0x5edd0d(_0x1ee22a[_0x2c90('0x13')][_0x2c90('0x11')]);}})[_0x2c90('0x14')](function(_0x16be42){logger[_0x2c90('0x10')](_0x2c90('0xb'),_0x2b16eb,_0x16be42);_0xfb5e40(_0x16be42);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 01e4c16..ced8dff 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 _0xb0c5=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','/describe','isAuthenticated','show','create','update','delete','/:id','destroy','exports','multer','express'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xb0c5,0xfa));var _0x5b0c=function(_0x5b03e5,_0xc77aa8){_0x5b03e5=_0x5b03e5-0x0;var _0x51f1a5=_0xb0c5[_0x5b03e5];return _0x51f1a5;};'use strict';var multer=require(_0x5b0c('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5b0c('0x1'));var router=express[_0x5b0c('0x2')]();var fs_extra=require(_0x5b0c('0x3'));var auth=require(_0x5b0c('0x4'));var interaction=require(_0x5b0c('0x5'));var config=require(_0x5b0c('0x6'));var controller=require(_0x5b0c('0x7'));router[_0x5b0c('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x5b0c('0x9'),auth[_0x5b0c('0xa')](),controller['describe']);router[_0x5b0c('0x8')]('/:id',auth[_0x5b0c('0xa')](),controller[_0x5b0c('0xb')]);router['post']('/',auth[_0x5b0c('0xa')](),controller[_0x5b0c('0xc')]);router['put']('/:id',auth[_0x5b0c('0xa')](),controller[_0x5b0c('0xd')]);router[_0x5b0c('0xe')](_0x5b0c('0xf'),auth[_0x5b0c('0xa')](),controller[_0x5b0c('0x10')]);module[_0x5b0c('0x11')]=router; \ No newline at end of file +var _0x7d32=['isAuthenticated','describe','/:id','put','delete','exports','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','index','/describe'];(function(_0x3cbb23,_0x361871){var _0x2602b9=function(_0x4e0098){while(--_0x4e0098){_0x3cbb23['push'](_0x3cbb23['shift']());}};_0x2602b9(++_0x361871);}(_0x7d32,0x1c0));var _0x27d3=function(_0x5f0f32,_0xbdc0a){_0x5f0f32=_0x5f0f32-0x0;var _0x30981a=_0x7d32[_0x5f0f32];return _0x30981a;};'use strict';var multer=require(_0x27d3('0x0'));var util=require('util');var path=require(_0x27d3('0x1'));var timeout=require(_0x27d3('0x2'));var express=require('express');var router=express[_0x27d3('0x3')]();var fs_extra=require(_0x27d3('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x27d3('0x5'));var config=require(_0x27d3('0x6'));var controller=require(_0x27d3('0x7'));router[_0x27d3('0x8')]('/',auth['isAuthenticated'](),controller[_0x27d3('0x9')]);router[_0x27d3('0x8')](_0x27d3('0xa'),auth[_0x27d3('0xb')](),controller[_0x27d3('0xc')]);router[_0x27d3('0x8')](_0x27d3('0xd'),auth[_0x27d3('0xb')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x27d3('0xe')](_0x27d3('0xd'),auth[_0x27d3('0xb')](),controller['update']);router[_0x27d3('0xf')]('/:id',auth[_0x27d3('0xb')](),controller['destroy']);module[_0x27d3('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index deef386..6c2d4c2 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 _0xa41a=['exports','STRING','INTEGER','DATE','called,connect,complete','sequelize'];(function(_0x5c93e5,_0x4585b0){var _0x49b58f=function(_0x3ac9f4){while(--_0x3ac9f4){_0x5c93e5['push'](_0x5c93e5['shift']());}};_0x49b58f(++_0x4585b0);}(_0xa41a,0x6b));var _0xaa41=function(_0x1c4597,_0x1eb997){_0x1c4597=_0x1c4597-0x0;var _0x2c0aa9=_0xa41a[_0x1c4597];return _0x2c0aa9;};'use strict';var Sequelize=require(_0xaa41('0x0'));module[_0xaa41('0x1')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xaa41('0x2')]},'channelstate':{'type':Sequelize[_0xaa41('0x3')]},'channelstatedesc':{'type':Sequelize[_0xaa41('0x2')]},'calleridnum':{'type':Sequelize[_0xaa41('0x2')]},'calleridname':{'type':Sequelize[_0xaa41('0x2')]},'connectedlinenum':{'type':Sequelize[_0xaa41('0x2')]},'connectedlinename':{'type':Sequelize[_0xaa41('0x2')]},'language':{'type':Sequelize[_0xaa41('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xaa41('0x2')]},'exten':{'type':Sequelize[_0xaa41('0x2')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xaa41('0x2')]},'destchannel':{'type':Sequelize[_0xaa41('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xaa41('0x2')]},'destcalleridnum':{'type':Sequelize[_0xaa41('0x2')]},'destcalleridname':{'type':Sequelize[_0xaa41('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xaa41('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xaa41('0x2')]},'destlanguage':{'type':Sequelize[_0xaa41('0x2')]},'destaccountcode':{'type':Sequelize[_0xaa41('0x2')]},'destcontext':{'type':Sequelize[_0xaa41('0x2')]},'destexten':{'type':Sequelize[_0xaa41('0x2')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0xaa41('0x2')]},'destlinkedid':{'type':Sequelize[_0xaa41('0x2')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xaa41('0x4')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xaa41('0x4')]},'lastevent':{'type':Sequelize[_0xaa41('0x2')],'comment':_0xaa41('0x5')},'routeId':{'type':Sequelize[_0xaa41('0x3')]},'duration':{'type':Sequelize[_0xaa41('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0xaa41('0x3')]}}; \ No newline at end of file +var _0xb821=['DATE','called,connect,complete','exports','STRING','INTEGER'];(function(_0xbaf699,_0x4aa945){var _0x55a131=function(_0x219dd7){while(--_0x219dd7){_0xbaf699['push'](_0xbaf699['shift']());}};_0x55a131(++_0x4aa945);}(_0xb821,0xa7));var _0x1b82=function(_0x518ce3,_0x1387b2){_0x518ce3=_0x518ce3-0x0;var _0x137c5c=_0xb821[_0x518ce3];return _0x137c5c;};'use strict';var Sequelize=require('sequelize');module[_0x1b82('0x0')]={'privilege':{'type':Sequelize[_0x1b82('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x1b82('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x1b82('0x1')]},'connectedlinename':{'type':Sequelize[_0x1b82('0x1')]},'language':{'type':Sequelize[_0x1b82('0x1')]},'accountcode':{'type':Sequelize[_0x1b82('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x1b82('0x1')]},'priority':{'type':Sequelize[_0x1b82('0x2')]},'uniqueid':{'type':Sequelize[_0x1b82('0x1')]},'linkedid':{'type':Sequelize[_0x1b82('0x1')]},'destchannel':{'type':Sequelize[_0x1b82('0x1')]},'destchannelstate':{'type':Sequelize[_0x1b82('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x1b82('0x1')]},'destcalleridnum':{'type':Sequelize[_0x1b82('0x1')]},'destcalleridname':{'type':Sequelize[_0x1b82('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x1b82('0x1')]},'destlanguage':{'type':Sequelize[_0x1b82('0x1')]},'destaccountcode':{'type':Sequelize[_0x1b82('0x1')]},'destcontext':{'type':Sequelize[_0x1b82('0x1')]},'destexten':{'type':Sequelize[_0x1b82('0x1')]},'destpriority':{'type':Sequelize[_0x1b82('0x2')]},'destuniqueid':{'type':Sequelize[_0x1b82('0x1')]},'destlinkedid':{'type':Sequelize[_0x1b82('0x1')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x1b82('0x1')]},'starttime':{'type':Sequelize[_0x1b82('0x3')]},'answertime':{'type':Sequelize[_0x1b82('0x3')]},'endtime':{'type':Sequelize[_0x1b82('0x3')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0x1b82('0x4')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0x1b82('0x2')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 93eb35b..652b846 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 _0x23d6=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','reject','save','update','then','destroy','end','stack','index','VoiceDialReport','rawAttributes','fieldName','type','key','model','map','name','filters','intersection','attributes','fields','query','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','params','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','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','../../config/logger','api'];(function(_0x57dc85,_0x3a6d51){var _0x563a2e=function(_0x5713b2){while(--_0x5713b2){_0x57dc85['push'](_0x57dc85['shift']());}};_0x563a2e(++_0x3a6d51);}(_0x23d6,0x1b5));var _0x623d=function(_0x5a704d,_0x4082d8){_0x5a704d=_0x5a704d-0x0;var _0x1f76e1=_0x23d6[_0x5a704d];return _0x1f76e1;};'use strict';var emlformat=require(_0x623d('0x0'));var rimraf=require(_0x623d('0x1'));var zipdir=require(_0x623d('0x2'));var jsonpatch=require(_0x623d('0x3'));var rp=require(_0x623d('0x4'));var moment=require(_0x623d('0x5'));var BPromise=require(_0x623d('0x6'));var Mustache=require(_0x623d('0x7'));var util=require(_0x623d('0x8'));var path=require('path');var sox=require(_0x623d('0x9'));var csv=require(_0x623d('0xa'));var ejs=require(_0x623d('0xb'));var fs=require('fs');var fs_extra=require(_0x623d('0xc'));var _=require(_0x623d('0xd'));var squel=require(_0x623d('0xe'));var crypto=require(_0x623d('0xf'));var jsforce=require(_0x623d('0x10'));var deskjs=require(_0x623d('0x11'));var toCsv=require(_0x623d('0xa'));var querystring=require(_0x623d('0x12'));var Papa=require(_0x623d('0x13'));var Redis=require(_0x623d('0x14'));var authService=require(_0x623d('0x15'));var qs=require(_0x623d('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x623d('0x17'))(_0x623d('0x18'));var utils=require('../../config/utils');var config=require(_0x623d('0x19'));var licenseUtil=require(_0x623d('0x1a'));var db=require(_0x623d('0x1b'))['db'];function respondWithStatusCode(_0x5f1918,_0x4f923f){_0x4f923f=_0x4f923f||0xcc;return function(_0xc86dc1){if(_0xc86dc1){return _0x5f1918[_0x623d('0x1c')](_0x4f923f);}return _0x5f1918[_0x623d('0x1d')](_0x4f923f)['end']();};}function respondWithResult(_0x1ec260,_0x3c9e72){_0x3c9e72=_0x3c9e72||0xc8;return function(_0x12f1eb){if(_0x12f1eb){return _0x1ec260[_0x623d('0x1d')](_0x3c9e72)[_0x623d('0x1e')](_0x12f1eb);}};}function respondWithFilteredResult(_0x3170fd,_0x45e256){return function(_0x2e30d7){if(_0x2e30d7){var _0x3cb283=typeof _0x45e256[_0x623d('0x1f')]==='undefined'&&typeof _0x45e256[_0x623d('0x20')]===_0x623d('0x21');var _0x497064=_0x2e30d7[_0x623d('0x22')];var _0x2b75d7=_0x3cb283?0x0:_0x45e256[_0x623d('0x1f')];var _0x30826c=_0x3cb283?_0x2e30d7[_0x623d('0x22')]:_0x45e256['offset']+_0x45e256['limit'];var _0x37cae3;if(_0x30826c>=_0x497064){_0x30826c=_0x497064;_0x37cae3=0xc8;}else{_0x37cae3=0xce;}_0x3170fd[_0x623d('0x1d')](_0x37cae3);return _0x3170fd[_0x623d('0x23')]('Content-Range',_0x2b75d7+'-'+_0x30826c+'/'+_0x497064)[_0x623d('0x1e')](_0x2e30d7);}return null;};}function patchUpdates(_0x20afa3){return function(_0x4a6b6d){try{jsonpatch['apply'](_0x4a6b6d,_0x20afa3,!![]);}catch(_0x1d2fe3){return BPromise[_0x623d('0x24')](_0x1d2fe3);}return _0x4a6b6d[_0x623d('0x25')]();};}function saveUpdates(_0x4104b8,_0x5038c8){return function(_0x5e1855){if(_0x5e1855){return _0x5e1855[_0x623d('0x26')](_0x4104b8)[_0x623d('0x27')](function(_0x1c77ec){return _0x1c77ec;});}return null;};}function removeEntity(_0xa8e2c9,_0xb40ef7){return function(_0x17c093){if(_0x17c093){return _0x17c093[_0x623d('0x28')]()[_0x623d('0x27')](function(){_0xa8e2c9[_0x623d('0x1d')](0xcc)[_0x623d('0x29')]();});}};}function handleEntityNotFound(_0x316cdf,_0x33b034){return function(_0x352d8f){if(!_0x352d8f){_0x316cdf['sendStatus'](0x194);}return _0x352d8f;};}function handleError(_0x5a1b3f,_0xc9233b){_0xc9233b=_0xc9233b||0x1f4;return function(_0xb9efc8){logger['error'](_0xb9efc8[_0x623d('0x2a')]);if(_0xb9efc8['name']){delete _0xb9efc8['name'];}_0x5a1b3f[_0x623d('0x1d')](_0xc9233b)['send'](_0xb9efc8);};}exports[_0x623d('0x2b')]=function(_0x4429c9,_0x388d4f){var _0x32dc50={},_0x131f84={},_0x377359={'count':0x0,'rows':[]};var _0x4a3d3e=_['map'](db[_0x623d('0x2c')][_0x623d('0x2d')],function(_0x352d8c){return{'name':_0x352d8c[_0x623d('0x2e')],'type':_0x352d8c[_0x623d('0x2f')][_0x623d('0x30')]};});_0x131f84[_0x623d('0x31')]=_[_0x623d('0x32')](_0x4a3d3e,_0x623d('0x33'));_0x131f84['query']=_['keys'](_0x4429c9['query']);_0x131f84[_0x623d('0x34')]=_[_0x623d('0x35')](_0x131f84[_0x623d('0x31')],_0x131f84['query']);_0x32dc50[_0x623d('0x36')]=_[_0x623d('0x35')](_0x131f84[_0x623d('0x31')],qs[_0x623d('0x37')](_0x4429c9[_0x623d('0x38')][_0x623d('0x37')]));_0x32dc50[_0x623d('0x36')]=_0x32dc50[_0x623d('0x36')]['length']?_0x32dc50[_0x623d('0x36')]:_0x131f84[_0x623d('0x31')];if(!_0x4429c9['query'][_0x623d('0x39')](_0x623d('0x3a'))){_0x32dc50['limit']=qs[_0x623d('0x20')](_0x4429c9[_0x623d('0x38')][_0x623d('0x20')]);_0x32dc50[_0x623d('0x1f')]=qs[_0x623d('0x1f')](_0x4429c9[_0x623d('0x38')][_0x623d('0x1f')]);}_0x32dc50[_0x623d('0x3b')]=qs[_0x623d('0x3c')](_0x4429c9[_0x623d('0x38')]['sort']);_0x32dc50['where']=qs[_0x623d('0x34')](_[_0x623d('0x3d')](_0x4429c9['query'],_0x131f84[_0x623d('0x34')]),_0x4a3d3e);if(_0x4429c9[_0x623d('0x38')]['filter']){_0x32dc50[_0x623d('0x3e')]=_[_0x623d('0x3f')](_0x32dc50['where'],{'$or':_[_0x623d('0x32')](_0x4a3d3e,function(_0x2e0cf7){if(_0x2e0cf7['type']!==_0x623d('0x40')){var _0x44fcb7={};_0x44fcb7[_0x2e0cf7['name']]={'$like':'%'+_0x4429c9[_0x623d('0x38')][_0x623d('0x41')]+'%'};return _0x44fcb7;}})});}_0x32dc50=_[_0x623d('0x3f')]({},_0x32dc50,_0x4429c9[_0x623d('0x42')]);var _0x14b688={'where':_0x32dc50[_0x623d('0x3e')]};return db['VoiceDialReport'][_0x623d('0x22')](_0x14b688)[_0x623d('0x27')](function(_0x36635e){_0x377359[_0x623d('0x22')]=_0x36635e;if(_0x4429c9[_0x623d('0x38')][_0x623d('0x43')]){_0x32dc50[_0x623d('0x44')]=[{'all':!![]}];}return db[_0x623d('0x2c')]['findAll'](_0x32dc50);})['then'](function(_0xec7fc7){_0x377359[_0x623d('0x45')]=_0xec7fc7;return _0x377359;})[_0x623d('0x27')](respondWithFilteredResult(_0x388d4f,_0x32dc50))[_0x623d('0x46')](handleError(_0x388d4f,null));};exports['show']=function(_0x118f9d,_0x43a6f1){var _0x413cdd={'raw':!![],'where':{'id':_0x118f9d[_0x623d('0x47')]['id']}},_0x22e310={};_0x22e310[_0x623d('0x31')]=_['keys'](db[_0x623d('0x2c')]['rawAttributes']);_0x22e310[_0x623d('0x38')]=_['keys'](_0x118f9d['query']);_0x22e310[_0x623d('0x34')]=_[_0x623d('0x35')](_0x22e310[_0x623d('0x31')],_0x22e310[_0x623d('0x38')]);_0x413cdd[_0x623d('0x36')]=_[_0x623d('0x35')](_0x22e310[_0x623d('0x31')],qs['fields'](_0x118f9d['query'][_0x623d('0x37')]));_0x413cdd[_0x623d('0x36')]=_0x413cdd[_0x623d('0x36')][_0x623d('0x48')]?_0x413cdd[_0x623d('0x36')]:_0x22e310[_0x623d('0x31')];if(_0x118f9d['query'][_0x623d('0x43')]){_0x413cdd[_0x623d('0x44')]=[{'all':!![]}];}_0x413cdd=_[_0x623d('0x3f')]({},_0x413cdd,_0x118f9d['options']);return db['VoiceDialReport'][_0x623d('0x49')](_0x413cdd)[_0x623d('0x27')](handleEntityNotFound(_0x43a6f1,null))[_0x623d('0x27')](respondWithResult(_0x43a6f1,null))[_0x623d('0x46')](handleError(_0x43a6f1,null));};exports[_0x623d('0x4a')]=function(_0x5f3faf,_0x2f6299){return db[_0x623d('0x2c')]['create'](_0x5f3faf[_0x623d('0x4b')],{})[_0x623d('0x27')](respondWithResult(_0x2f6299,0xc9))[_0x623d('0x46')](handleError(_0x2f6299,null));};exports['update']=function(_0x3c458c,_0x10399e){if(_0x3c458c[_0x623d('0x4b')]['id']){delete _0x3c458c[_0x623d('0x4b')]['id'];}return db['VoiceDialReport']['find']({'where':{'id':_0x3c458c[_0x623d('0x47')]['id']}})[_0x623d('0x27')](handleEntityNotFound(_0x10399e,null))[_0x623d('0x27')](saveUpdates(_0x3c458c[_0x623d('0x4b')],null))['then'](respondWithResult(_0x10399e,null))[_0x623d('0x46')](handleError(_0x10399e,null));};exports['destroy']=function(_0x441af0,_0xff9474){return db['VoiceDialReport'][_0x623d('0x49')]({'where':{'id':_0x441af0['params']['id']}})[_0x623d('0x27')](handleEntityNotFound(_0xff9474,null))[_0x623d('0x27')](removeEntity(_0xff9474,null))[_0x623d('0x46')](handleError(_0xff9474,null));};exports['describe']=function(_0x325ebf,_0x1e12cd){return db['VoiceDialReport'][_0x623d('0x4c')]()[_0x623d('0x27')](respondWithResult(_0x1e12cd,null))[_0x623d('0x46')](handleError(_0x1e12cd,null));}; \ No newline at end of file +var _0x159b=['status','end','json','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','VoiceDialReport','fieldName','type','key','model','filters','intersection','query','fields','attributes','hasOwnProperty','nolimit','limit','order','where','filter','VIRTUAL','merge','options','include','findAll','rows','show','params','keys','rawAttributes','includeAll','catch','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus'];(function(_0xbe4883,_0x2182c){var _0x2d1f79=function(_0x45353c){while(--_0x45353c){_0xbe4883['push'](_0xbe4883['shift']());}};_0x2d1f79(++_0x2182c);}(_0x159b,0x7c));var _0xb159=function(_0x439d1a,_0x42e11d){_0x439d1a=_0x439d1a-0x0;var _0x1f79f8=_0x159b[_0x439d1a];return _0x1f79f8;};'use strict';var emlformat=require(_0xb159('0x0'));var rimraf=require(_0xb159('0x1'));var zipdir=require(_0xb159('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb159('0x3'));var moment=require(_0xb159('0x4'));var BPromise=require(_0xb159('0x5'));var Mustache=require(_0xb159('0x6'));var util=require(_0xb159('0x7'));var path=require('path');var sox=require(_0xb159('0x8'));var csv=require(_0xb159('0x9'));var ejs=require(_0xb159('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb159('0xb'));var crypto=require(_0xb159('0xc'));var jsforce=require(_0xb159('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb159('0xe'));var Papa=require(_0xb159('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb159('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb159('0x11'));var logger=require('../../config/logger')(_0xb159('0x12'));var utils=require('../../config/utils');var config=require(_0xb159('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xb159('0x14'))['db'];function respondWithStatusCode(_0x10b49d,_0x1ebbc5){_0x1ebbc5=_0x1ebbc5||0xcc;return function(_0x38671b){if(_0x38671b){return _0x10b49d[_0xb159('0x15')](_0x1ebbc5);}return _0x10b49d[_0xb159('0x16')](_0x1ebbc5)[_0xb159('0x17')]();};}function respondWithResult(_0x4a8b0a,_0x4560f6){_0x4560f6=_0x4560f6||0xc8;return function(_0x161d80){if(_0x161d80){return _0x4a8b0a[_0xb159('0x16')](_0x4560f6)[_0xb159('0x18')](_0x161d80);}};}function respondWithFilteredResult(_0x539e73,_0x30913c){return function(_0x1b6d23){if(_0x1b6d23){var _0x36d4ea=typeof _0x30913c['offset']===_0xb159('0x19')&&typeof _0x30913c['limit']===_0xb159('0x19');var _0x1eee09=_0x1b6d23[_0xb159('0x1a')];var _0x372ec1=_0x36d4ea?0x0:_0x30913c[_0xb159('0x1b')];var _0x343a94=_0x36d4ea?_0x1b6d23[_0xb159('0x1a')]:_0x30913c[_0xb159('0x1b')]+_0x30913c['limit'];var _0x2913c4;if(_0x343a94>=_0x1eee09){_0x343a94=_0x1eee09;_0x2913c4=0xc8;}else{_0x2913c4=0xce;}_0x539e73[_0xb159('0x16')](_0x2913c4);return _0x539e73['set'](_0xb159('0x1c'),_0x372ec1+'-'+_0x343a94+'/'+_0x1eee09)[_0xb159('0x18')](_0x1b6d23);}return null;};}function patchUpdates(_0xa743ca){return function(_0xabc4db){try{jsonpatch[_0xb159('0x1d')](_0xabc4db,_0xa743ca,!![]);}catch(_0x55cfbb){return BPromise[_0xb159('0x1e')](_0x55cfbb);}return _0xabc4db[_0xb159('0x1f')]();};}function saveUpdates(_0x5c75b7,_0x56dea0){return function(_0x3b06c6){if(_0x3b06c6){return _0x3b06c6[_0xb159('0x20')](_0x5c75b7)[_0xb159('0x21')](function(_0x1d87da){return _0x1d87da;});}return null;};}function removeEntity(_0x1924a8,_0xc251f6){return function(_0x22bba5){if(_0x22bba5){return _0x22bba5[_0xb159('0x22')]()[_0xb159('0x21')](function(){_0x1924a8[_0xb159('0x16')](0xcc)[_0xb159('0x17')]();});}};}function handleEntityNotFound(_0x296770,_0x5ac6cc){return function(_0xdae1e3){if(!_0xdae1e3){_0x296770[_0xb159('0x15')](0x194);}return _0xdae1e3;};}function handleError(_0xf9455a,_0x12b97c){_0x12b97c=_0x12b97c||0x1f4;return function(_0x5a8805){logger[_0xb159('0x23')](_0x5a8805[_0xb159('0x24')]);if(_0x5a8805['name']){delete _0x5a8805[_0xb159('0x25')];}_0xf9455a[_0xb159('0x16')](_0x12b97c)[_0xb159('0x26')](_0x5a8805);};}exports[_0xb159('0x27')]=function(_0x52de71,_0x3b4f30){var _0xab9a5c={},_0xafd072={},_0x312adb={'count':0x0,'rows':[]};var _0x263c0d=_[_0xb159('0x28')](db[_0xb159('0x29')]['rawAttributes'],function(_0x54c6a2){return{'name':_0x54c6a2[_0xb159('0x2a')],'type':_0x54c6a2[_0xb159('0x2b')][_0xb159('0x2c')]};});_0xafd072[_0xb159('0x2d')]=_[_0xb159('0x28')](_0x263c0d,_0xb159('0x25'));_0xafd072['query']=_['keys'](_0x52de71['query']);_0xafd072[_0xb159('0x2e')]=_[_0xb159('0x2f')](_0xafd072[_0xb159('0x2d')],_0xafd072[_0xb159('0x30')]);_0xab9a5c['attributes']=_[_0xb159('0x2f')](_0xafd072[_0xb159('0x2d')],qs[_0xb159('0x31')](_0x52de71[_0xb159('0x30')][_0xb159('0x31')]));_0xab9a5c['attributes']=_0xab9a5c['attributes']['length']?_0xab9a5c[_0xb159('0x32')]:_0xafd072[_0xb159('0x2d')];if(!_0x52de71['query'][_0xb159('0x33')](_0xb159('0x34'))){_0xab9a5c[_0xb159('0x35')]=qs['limit'](_0x52de71['query'][_0xb159('0x35')]);_0xab9a5c[_0xb159('0x1b')]=qs[_0xb159('0x1b')](_0x52de71[_0xb159('0x30')][_0xb159('0x1b')]);}_0xab9a5c[_0xb159('0x36')]=qs['sort'](_0x52de71[_0xb159('0x30')]['sort']);_0xab9a5c[_0xb159('0x37')]=qs[_0xb159('0x2e')](_['pick'](_0x52de71['query'],_0xafd072[_0xb159('0x2e')]),_0x263c0d);if(_0x52de71['query'][_0xb159('0x38')]){_0xab9a5c[_0xb159('0x37')]=_['merge'](_0xab9a5c[_0xb159('0x37')],{'$or':_[_0xb159('0x28')](_0x263c0d,function(_0x51be42){if(_0x51be42[_0xb159('0x2b')]!==_0xb159('0x39')){var _0x226be1={};_0x226be1[_0x51be42['name']]={'$like':'%'+_0x52de71[_0xb159('0x30')]['filter']+'%'};return _0x226be1;}})});}_0xab9a5c=_[_0xb159('0x3a')]({},_0xab9a5c,_0x52de71[_0xb159('0x3b')]);var _0x490acd={'where':_0xab9a5c['where']};return db[_0xb159('0x29')][_0xb159('0x1a')](_0x490acd)[_0xb159('0x21')](function(_0x80e90c){_0x312adb[_0xb159('0x1a')]=_0x80e90c;if(_0x52de71[_0xb159('0x30')]['includeAll']){_0xab9a5c[_0xb159('0x3c')]=[{'all':!![]}];}return db['VoiceDialReport'][_0xb159('0x3d')](_0xab9a5c);})[_0xb159('0x21')](function(_0x595cac){_0x312adb[_0xb159('0x3e')]=_0x595cac;return _0x312adb;})['then'](respondWithFilteredResult(_0x3b4f30,_0xab9a5c))['catch'](handleError(_0x3b4f30,null));};exports[_0xb159('0x3f')]=function(_0x3898ee,_0x1e9ddd){var _0x86bc0={'raw':!![],'where':{'id':_0x3898ee[_0xb159('0x40')]['id']}},_0x255d9a={};_0x255d9a[_0xb159('0x2d')]=_[_0xb159('0x41')](db[_0xb159('0x29')][_0xb159('0x42')]);_0x255d9a['query']=_[_0xb159('0x41')](_0x3898ee[_0xb159('0x30')]);_0x255d9a['filters']=_[_0xb159('0x2f')](_0x255d9a[_0xb159('0x2d')],_0x255d9a[_0xb159('0x30')]);_0x86bc0[_0xb159('0x32')]=_[_0xb159('0x2f')](_0x255d9a['model'],qs['fields'](_0x3898ee['query']['fields']));_0x86bc0[_0xb159('0x32')]=_0x86bc0['attributes']['length']?_0x86bc0['attributes']:_0x255d9a[_0xb159('0x2d')];if(_0x3898ee[_0xb159('0x30')][_0xb159('0x43')]){_0x86bc0[_0xb159('0x3c')]=[{'all':!![]}];}_0x86bc0=_['merge']({},_0x86bc0,_0x3898ee['options']);return db[_0xb159('0x29')]['find'](_0x86bc0)['then'](handleEntityNotFound(_0x1e9ddd,null))[_0xb159('0x21')](respondWithResult(_0x1e9ddd,null))[_0xb159('0x44')](handleError(_0x1e9ddd,null));};exports[_0xb159('0x45')]=function(_0x3d4448,_0x31ea68){return db['VoiceDialReport']['create'](_0x3d4448[_0xb159('0x46')],{})[_0xb159('0x21')](respondWithResult(_0x31ea68,0xc9))[_0xb159('0x44')](handleError(_0x31ea68,null));};exports['update']=function(_0x82af6,_0x428292){if(_0x82af6[_0xb159('0x46')]['id']){delete _0x82af6[_0xb159('0x46')]['id'];}return db['VoiceDialReport'][_0xb159('0x47')]({'where':{'id':_0x82af6[_0xb159('0x40')]['id']}})['then'](handleEntityNotFound(_0x428292,null))[_0xb159('0x21')](saveUpdates(_0x82af6[_0xb159('0x46')],null))[_0xb159('0x21')](respondWithResult(_0x428292,null))[_0xb159('0x44')](handleError(_0x428292,null));};exports[_0xb159('0x22')]=function(_0x1b9703,_0x280384){return db['VoiceDialReport'][_0xb159('0x47')]({'where':{'id':_0x1b9703['params']['id']}})[_0xb159('0x21')](handleEntityNotFound(_0x280384,null))['then'](removeEntity(_0x280384,null))[_0xb159('0x44')](handleError(_0x280384,null));};exports[_0xb159('0x48')]=function(_0x1d4129,_0x41b0c9){return db[_0xb159('0x29')][_0xb159('0x48')]()[_0xb159('0x21')](respondWithResult(_0x41b0c9,null))[_0xb159('0x44')](handleError(_0x41b0c9,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index c84531a..1878466 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 _0xf6ca=['exports','define','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','moment','../../config/environment','./voiceDialReport.attributes'];(function(_0x47c882,_0x8a92aa){var _0x205ede=function(_0x2bf8ae){while(--_0x2bf8ae){_0x47c882['push'](_0x47c882['shift']());}};_0x205ede(++_0x8a92aa);}(_0xf6ca,0x15a));var _0xaf6c=function(_0x54703f,_0x1a198e){_0x54703f=_0x54703f-0x0;var _0xe8e2e6=_0xf6ca[_0x54703f];return _0xe8e2e6;};'use strict';var _=require(_0xaf6c('0x0'));var util=require(_0xaf6c('0x1'));var logger=require(_0xaf6c('0x2'))('api');var moment=require(_0xaf6c('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xaf6c('0x4'));var attributes=require(_0xaf6c('0x5'));module[_0xaf6c('0x6')]=function(_0x4014b1,_0x5cda4b){return _0x4014b1[_0xaf6c('0x7')](_0xaf6c('0x8'),attributes,{'tableName':_0xaf6c('0x9'),'paranoid':![],'indexes':[{'fields':[_0xaf6c('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe676=['moment','request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes','define','VoiceDialReport','report_dial','uniqueid','lodash','../../config/logger','api'];(function(_0x2300fa,_0x41c382){var _0x11fef0=function(_0x597ffb){while(--_0x597ffb){_0x2300fa['push'](_0x2300fa['shift']());}};_0x11fef0(++_0x41c382);}(_0xe676,0x14f));var _0x6e67=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0xe676[_0x5cb1af];return _0x8d7940;};'use strict';var _=require(_0x6e67('0x0'));var util=require('util');var logger=require(_0x6e67('0x1'))(_0x6e67('0x2'));var moment=require(_0x6e67('0x3'));var BPromise=require('bluebird');var rp=require(_0x6e67('0x4'));var fs=require('fs');var path=require(_0x6e67('0x5'));var rimraf=require(_0x6e67('0x6'));var config=require(_0x6e67('0x7'));var attributes=require(_0x6e67('0x8'));module['exports']=function(_0x226490,_0xf1aae6){return _0x226490[_0x6e67('0x9')](_0x6e67('0xa'),attributes,{'tableName':_0x6e67('0xb'),'paranoid':![],'indexes':[{'fields':[_0x6e67('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 211d1a6..f10fd9e 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 _0x46c0=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceDialReport','create','body','options','then','CreateVoiceDialReport','debug','UpdateVoiceDialReport','update','raw','attributes'];(function(_0x260560,_0x45c268){var _0x52ed67=function(_0x3bd1a2){while(--_0x3bd1a2){_0x260560['push'](_0x260560['shift']());}};_0x52ed67(++_0x45c268);}(_0x46c0,0x1ba));var _0x046c=function(_0x3102ab,_0x481c69){_0x3102ab=_0x3102ab-0x0;var _0x232720=_0x46c0[_0x3102ab];return _0x232720;};'use strict';var _=require(_0x046c('0x0'));var util=require(_0x046c('0x1'));var moment=require(_0x046c('0x2'));var BPromise=require('bluebird');var rs=require(_0x046c('0x3'));var fs=require('fs');var Redis=require(_0x046c('0x4'));var db=require(_0x046c('0x5'))['db'];var utils=require(_0x046c('0x6'));var logger=require(_0x046c('0x7'))(_0x046c('0x8'));var config=require(_0x046c('0x9'));var jayson=require(_0x046c('0xa'));var client=jayson[_0x046c('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e95d4,_0x550f7b,_0x1a9315){return new BPromise(function(_0x50d6f6,_0x19b116){return client[_0x046c('0xc')](_0x2e95d4,_0x1a9315)['then'](function(_0x2cb10a){logger[_0x046c('0xd')](_0x046c('0xe'),_0x550f7b,_0x046c('0xf'));logger['debug'](_0x046c('0x10'),_0x550f7b,'request\x20sent',JSON[_0x046c('0x11')](_0x2cb10a));if(_0x2cb10a[_0x046c('0x12')]){if(_0x2cb10a[_0x046c('0x12')][_0x046c('0x13')]===0x1f4){logger[_0x046c('0x12')](_0x046c('0xe'),_0x550f7b,_0x2cb10a[_0x046c('0x12')][_0x046c('0x14')]);return _0x19b116(_0x2cb10a[_0x046c('0x12')][_0x046c('0x14')]);}logger[_0x046c('0x12')]('VoiceDialReport,\x20%s,\x20%s',_0x550f7b,_0x2cb10a[_0x046c('0x12')][_0x046c('0x14')]);return _0x50d6f6(_0x2cb10a[_0x046c('0x12')][_0x046c('0x14')]);}else{logger[_0x046c('0xd')](_0x046c('0xe'),_0x550f7b,_0x046c('0xf'));_0x50d6f6(_0x2cb10a[_0x046c('0x15')][_0x046c('0x14')]);}})[_0x046c('0x16')](function(_0x1c41f8){logger[_0x046c('0x12')](_0x046c('0xe'),_0x550f7b,_0x1c41f8);_0x19b116(_0x1c41f8);});});}exports['CreateVoiceDialReport']=function(_0x395991){var _0x1175ac=this;return new Promise(function(_0x495b8b,_0x4e5a4c){return db[_0x046c('0x17')][_0x046c('0x18')](_0x395991[_0x046c('0x19')],{'raw':_0x395991[_0x046c('0x1a')]?_0x395991[_0x046c('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x046c('0x1b')](function(_0xa2c4e2){logger[_0x046c('0xd')](_0x046c('0x1c'),_0x395991);logger[_0x046c('0x1d')](_0x046c('0x1c'),_0x395991,JSON['stringify'](_0xa2c4e2));_0x495b8b(_0xa2c4e2);})[_0x046c('0x16')](function(_0x3415b4){logger['error'](_0x046c('0x1c'),_0x3415b4['message'],_0x395991);_0x4e5a4c(_0x1175ac['error'](0x1f4,_0x3415b4[_0x046c('0x14')]));});});};exports[_0x046c('0x1e')]=function(_0x19e99a){var _0x4ea90b=this;return new Promise(function(_0x3bce8c,_0x3827ce){return db['VoiceDialReport'][_0x046c('0x1f')](_0x19e99a[_0x046c('0x19')],{'raw':_0x19e99a[_0x046c('0x1a')]?_0x19e99a[_0x046c('0x1a')][_0x046c('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19e99a[_0x046c('0x1a')]?_0x19e99a['options']['where']||null:null,'attributes':_0x19e99a[_0x046c('0x1a')]?_0x19e99a[_0x046c('0x1a')][_0x046c('0x21')]||null:null,'limit':_0x19e99a['options']?_0x19e99a[_0x046c('0x1a')]['limit']||null:null})[_0x046c('0x1b')](function(_0x3b1900){logger['info'](_0x046c('0x1e'),_0x19e99a);logger[_0x046c('0x1d')](_0x046c('0x1e'),_0x19e99a,JSON['stringify'](_0x3b1900));_0x3bce8c(_0x3b1900);})[_0x046c('0x16')](function(_0x22fa05){logger[_0x046c('0x12')](_0x046c('0x1e'),_0x22fa05[_0x046c('0x14')],_0x19e99a);_0x3827ce(_0x4ea90b[_0x046c('0x12')](0x1f4,_0x22fa05['message']));});});}; \ No newline at end of file +var _0xac9a=['request\x20sent','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceDialReport,\x20%s,\x20%s','message','result','catch','CreateVoiceDialReport','VoiceDialReport','create','options','debug','update','body','raw','UpdateVoiceDialReport','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','http','request','then','info'];(function(_0x2c1ac1,_0x3dfb07){var _0x240e2d=function(_0x5e6afd){while(--_0x5e6afd){_0x2c1ac1['push'](_0x2c1ac1['shift']());}};_0x240e2d(++_0x3dfb07);}(_0xac9a,0x117));var _0xaac9=function(_0xae9ef4,_0x31188d){_0xae9ef4=_0xae9ef4-0x0;var _0x2259cc=_0xac9a[_0xae9ef4];return _0x2259cc;};'use strict';var _=require(_0xaac9('0x0'));var util=require('util');var moment=require(_0xaac9('0x1'));var BPromise=require(_0xaac9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaac9('0x3'));var db=require(_0xaac9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xaac9('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xaac9('0x6'));var client=jayson['client'][_0xaac9('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1db720,_0x1a330c,_0x3602b4){return new BPromise(function(_0x3bd542,_0x54a0cf){return client[_0xaac9('0x8')](_0x1db720,_0x3602b4)[_0xaac9('0x9')](function(_0x4d854e){logger[_0xaac9('0xa')]('VoiceDialReport,\x20%s,\x20%s',_0x1a330c,_0xaac9('0xb'));logger['debug'](_0xaac9('0xc'),_0x1a330c,_0xaac9('0xb'),JSON[_0xaac9('0xd')](_0x4d854e));if(_0x4d854e[_0xaac9('0xe')]){if(_0x4d854e[_0xaac9('0xe')][_0xaac9('0xf')]===0x1f4){logger['error'](_0xaac9('0x10'),_0x1a330c,_0x4d854e[_0xaac9('0xe')][_0xaac9('0x11')]);return _0x54a0cf(_0x4d854e[_0xaac9('0xe')][_0xaac9('0x11')]);}logger[_0xaac9('0xe')]('VoiceDialReport,\x20%s,\x20%s',_0x1a330c,_0x4d854e[_0xaac9('0xe')][_0xaac9('0x11')]);return _0x3bd542(_0x4d854e[_0xaac9('0xe')][_0xaac9('0x11')]);}else{logger['info'](_0xaac9('0x10'),_0x1a330c,_0xaac9('0xb'));_0x3bd542(_0x4d854e[_0xaac9('0x12')][_0xaac9('0x11')]);}})[_0xaac9('0x13')](function(_0x2bd740){logger[_0xaac9('0xe')]('VoiceDialReport,\x20%s,\x20%s',_0x1a330c,_0x2bd740);_0x54a0cf(_0x2bd740);});});}exports[_0xaac9('0x14')]=function(_0xdd825){var _0x558e6f=this;return new Promise(function(_0x37c6e9,_0x5f555f){return db[_0xaac9('0x15')][_0xaac9('0x16')](_0xdd825['body'],{'raw':_0xdd825['options']?_0xdd825[_0xaac9('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xaac9('0x9')](function(_0x3c9cbe){logger[_0xaac9('0xa')](_0xaac9('0x14'),_0xdd825);logger[_0xaac9('0x18')]('CreateVoiceDialReport',_0xdd825,JSON['stringify'](_0x3c9cbe));_0x37c6e9(_0x3c9cbe);})[_0xaac9('0x13')](function(_0x393c0f){logger[_0xaac9('0xe')]('CreateVoiceDialReport',_0x393c0f['message'],_0xdd825);_0x5f555f(_0x558e6f[_0xaac9('0xe')](0x1f4,_0x393c0f[_0xaac9('0x11')]));});});};exports['UpdateVoiceDialReport']=function(_0x3a67f8){var _0x175506=this;return new Promise(function(_0x4dfba4,_0x5641db){return db[_0xaac9('0x15')][_0xaac9('0x19')](_0x3a67f8[_0xaac9('0x1a')],{'raw':_0x3a67f8[_0xaac9('0x17')]?_0x3a67f8[_0xaac9('0x17')][_0xaac9('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a67f8['options']?_0x3a67f8['options']['where']||null:null,'attributes':_0x3a67f8[_0xaac9('0x17')]?_0x3a67f8[_0xaac9('0x17')]['attributes']||null:null,'limit':_0x3a67f8['options']?_0x3a67f8[_0xaac9('0x17')]['limit']||null:null})['then'](function(_0x37bab4){logger[_0xaac9('0xa')](_0xaac9('0x1c'),_0x3a67f8);logger['debug'](_0xaac9('0x1c'),_0x3a67f8,JSON[_0xaac9('0xd')](_0x37bab4));_0x4dfba4(_0x37bab4);})[_0xaac9('0x13')](function(_0x52ae59){logger[_0xaac9('0xe')](_0xaac9('0x1c'),_0x52ae59[_0xaac9('0x11')],_0x3a67f8);_0x5641db(_0x175506['error'](0x1f4,_0x52ae59[_0xaac9('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index ef84450..84f92d3 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 _0x3f94=['addApplications','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3f94,0xb4));var _0x43f9=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0x3f94[_0x38537f];return _0x141e23;};'use strict';var multer=require(_0x43f9('0x0'));var util=require(_0x43f9('0x1'));var path=require(_0x43f9('0x2'));var timeout=require(_0x43f9('0x3'));var express=require(_0x43f9('0x4'));var router=express[_0x43f9('0x5')]();var fs_extra=require(_0x43f9('0x6'));var auth=require(_0x43f9('0x7'));var interaction=require(_0x43f9('0x8'));var config=require(_0x43f9('0x9'));var controller=require(_0x43f9('0xa'));router[_0x43f9('0xb')]('/',auth[_0x43f9('0xc')](),controller[_0x43f9('0xd')]);router[_0x43f9('0xb')](_0x43f9('0xe'),auth[_0x43f9('0xc')](),controller[_0x43f9('0xf')]);router[_0x43f9('0x10')]('/',auth['isAuthenticated'](),controller[_0x43f9('0x11')]);router['post']('/:id/applications',auth[_0x43f9('0xc')](),controller[_0x43f9('0x12')]);router[_0x43f9('0x13')](_0x43f9('0xe'),auth[_0x43f9('0xc')](),controller['update']);router['delete'](_0x43f9('0xe'),auth[_0x43f9('0xc')](),controller[_0x43f9('0x14')]);module[_0x43f9('0x15')]=router; \ No newline at end of file +var _0x4212=['post','create','/:id/applications','addApplications','put','update','delete','/:id','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x4212,0x15a));var _0x2421=function(_0x2c9b79,_0x7cf58b){_0x2c9b79=_0x2c9b79-0x0;var _0x265032=_0x4212[_0x2c9b79];return _0x265032;};'use strict';var multer=require(_0x2421('0x0'));var util=require('util');var path=require(_0x2421('0x1'));var timeout=require(_0x2421('0x2'));var express=require(_0x2421('0x3'));var router=express[_0x2421('0x4')]();var fs_extra=require(_0x2421('0x5'));var auth=require(_0x2421('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2421('0x7'));var controller=require(_0x2421('0x8'));router[_0x2421('0x9')]('/',auth[_0x2421('0xa')](),controller['index']);router[_0x2421('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x2421('0xb')]('/',auth['isAuthenticated'](),controller[_0x2421('0xc')]);router[_0x2421('0xb')](_0x2421('0xd'),auth[_0x2421('0xa')](),controller[_0x2421('0xe')]);router[_0x2421('0xf')]('/:id',auth[_0x2421('0xa')](),controller[_0x2421('0x10')]);router[_0x2421('0x11')](_0x2421('0x12'),auth['isAuthenticated'](),controller[_0x2421('0x13')]);module[_0x2421('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 1aca002..7e0fafd 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 _0xbe59=['ENUM','inbound','outbound','inbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','wav','getDataValue','sequelize','exports','STRING','compositeIndex'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0xbe59,0x10a));var _0x9be5=function(_0x4e7aa2,_0x5ea9ab){_0x4e7aa2=_0x4e7aa2-0x0;var _0x5a875f=_0xbe59[_0x4e7aa2];return _0x5a875f;};'use strict';var Sequelize=require(_0x9be5('0x0'));module[_0x9be5('0x1')]={'context':{'type':Sequelize[_0x9be5('0x2')],'allowNull':![],'unique':_0x9be5('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0x9be5('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x9be5('0x3')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x9be5('0x4')](_0x9be5('0x5'),_0x9be5('0x6'),'internal',_0x9be5('0x7'),'outbound-fax',_0x9be5('0x8'),_0x9be5('0x9')),'allowNull':![]},'description':{'type':Sequelize[_0x9be5('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9be5('0xa')},'IntervalId':{'type':Sequelize[_0x9be5('0xb')]},'isApp':{'type':Sequelize[_0x9be5('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x9be5('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x9be5('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x9be5('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x9be5('0xb')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0x9be5('0xd')},'answer':{'type':Sequelize[_0x9be5('0xc')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x1fa7b2){return this[_0x9be5('0xe')]('exten');}},'alias':{'type':Sequelize[_0x9be5('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xe62f=['getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','outbound','internal','inbound-fax','system','INTEGER','BOOLEAN','wav','VIRTUAL'];(function(_0x1802c9,_0x4f75c3){var _0x2e76d2=function(_0x47b42d){while(--_0x47b42d){_0x1802c9['push'](_0x1802c9['shift']());}};_0x2e76d2(++_0x4f75c3);}(_0xe62f,0x179));var _0xfe62=function(_0x13015f,_0x479377){_0x13015f=_0x13015f-0x0;var _0x369343=_0xe62f[_0x13015f];return _0x369343;};'use strict';var Sequelize=require(_0xfe62('0x0'));module[_0xfe62('0x1')]={'context':{'type':Sequelize[_0xfe62('0x2')],'allowNull':![],'unique':_0xfe62('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xfe62('0x2')],'allowNull':![],'unique':_0xfe62('0x3')},'priority':{'type':Sequelize[_0xfe62('0x2')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0xfe62('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xfe62('0x2')],'allowNull':![],'defaultValue':_0xfe62('0x4')},'appdata':{'type':Sequelize[_0xfe62('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM']('inbound',_0xfe62('0x5'),_0xfe62('0x6'),_0xfe62('0x7'),'outbound-fax',_0xfe62('0x8'),'any'),'allowNull':![]},'description':{'type':Sequelize[_0xfe62('0x2')]},'interval':{'type':Sequelize[_0xfe62('0x2')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0xfe62('0x9')]},'isApp':{'type':Sequelize[_0xfe62('0xa')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0xfe62('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0xfe62('0xa')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xfe62('0x9')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0xfe62('0xb')},'answer':{'type':Sequelize[_0xfe62('0xa')],'defaultValue':!![]},'name':{'type':Sequelize[_0xfe62('0xc')],'get':function(_0x3c446b){return this[_0xfe62('0xd')](_0xfe62('0xe'));}},'alias':{'type':Sequelize[_0xfe62('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 a646d9d..153ada2 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 _0x423e=['exten','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OutboundRoutes','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','mandatoryDisposition','addApplications','sequelize','Transaction','ISOLATION_LEVELS','findOne','isApp','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','offset','limit','undefined','count','set','destroy','get','InboundRoutes','outbound','internal','ignore','value','includes','type','name','then','error','stack','send','index','map','VoiceExtension','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','include','findAll','rows','catch','show','params','length','options','find','create','startsWith','body'];(function(_0x3b8f2e,_0x5a99a8){var _0x1433d5=function(_0x5e0353){while(--_0x5e0353){_0x3b8f2e['push'](_0x3b8f2e['shift']());}};_0x1433d5(++_0x5a99a8);}(_0x423e,0xc7));var _0xe423=function(_0x4628c6,_0x212c5e){_0x4628c6=_0x4628c6-0x0;var _0x181ddc=_0x423e[_0x4628c6];return _0x181ddc;};'use strict';var _=require(_0xe423('0x0'));var Redis=require(_0xe423('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0xe423('0x2'))(_0xe423('0x3'));var config=require(_0xe423('0x4'));var db=require(_0xe423('0x5'))['db'];config[_0xe423('0x6')]=_[_0xe423('0x7')](config['redis'],{'host':_0xe423('0x8'),'port':0x18eb});var socket=require(_0xe423('0x9'))(new Redis(config[_0xe423('0x6')]));require('./voiceExtension.socket')[_0xe423('0xa')](socket);function respondWithStatusCode(_0x289b96,_0x25f7ec){_0x25f7ec=_0x25f7ec||0xcc;return function(_0x5b40c3){if(_0x5b40c3){return _0x289b96[_0xe423('0xb')](_0x25f7ec);}return _0x289b96['status'](_0x25f7ec)[_0xe423('0xc')]();};}function respondWithResult(_0x3a8c5d,_0x3d6459){_0x3d6459=_0x3d6459||0xc8;return function(_0x3e35a9){if(_0x3e35a9){return _0x3a8c5d[_0xe423('0xd')](_0x3d6459)['json'](_0x3e35a9);}};}function respondWithFilteredResult(_0x263953,_0x1ee6f1){return function(_0x163fef){if(_0x163fef){var _0x3c7d47=typeof _0x1ee6f1[_0xe423('0xe')]==='undefined'&&typeof _0x1ee6f1[_0xe423('0xf')]===_0xe423('0x10');var _0xc5eaf7=_0x163fef[_0xe423('0x11')];var _0x1908c8=_0x3c7d47?0x0:_0x1ee6f1[_0xe423('0xe')];var _0x54eefa=_0x3c7d47?_0x163fef[_0xe423('0x11')]:_0x1ee6f1[_0xe423('0xe')]+_0x1ee6f1['limit'];var _0x5e4727;if(_0x54eefa>=_0xc5eaf7){_0x54eefa=_0xc5eaf7;_0x5e4727=0xc8;}else{_0x5e4727=0xce;}_0x263953[_0xe423('0xd')](_0x5e4727);return _0x263953[_0xe423('0x12')]('Content-Range',_0x1908c8+'-'+_0x54eefa+'/'+_0xc5eaf7)['json'](_0x163fef);}return null;};}function removeEntity(_0x5dc00a){return function(_0x29ee8e){if(_0x29ee8e){return _0x29ee8e[_0xe423('0x13')]()['then'](function(){var _0x2618cb=_0x29ee8e[_0xe423('0x14')]({'plain':!![]});var _0x4a6e6f=[{'name':_0xe423('0x15'),'value':'inbound','ignore':![]},{'name':'OutboundRoutes','value':_0xe423('0x16'),'ignore':![]},{'name':'InternalRoutes','value':_0xe423('0x17'),'ignore':![]}];var _0xeca66e=_(_0x4a6e6f)['filter'](_0xe423('0x18'))['map'](_0xe423('0x19'))[_0xe423('0x19')]();if(_[_0xe423('0x1a')](_0xeca66e,_0x2618cb[_0xe423('0x1b')])){return;}var _0x5947c3=_['find'](_0x4a6e6f,[_0xe423('0x19'),_0x2618cb[_0xe423('0x1b')]])[_0xe423('0x1c')];return db['UserProfileResource'][_0xe423('0x13')]({'where':{'type':_0x5947c3,'resourceId':_0x2618cb['id']}})[_0xe423('0x1d')](function(){return _0x29ee8e;});})[_0xe423('0x1d')](function(){_0x5dc00a[_0xe423('0xd')](0xcc)[_0xe423('0xc')]();});}};}function handleEntityNotFound(_0x3aa2ac){return function(_0x487c45){if(!_0x487c45){_0x3aa2ac['sendStatus'](0x194);}return _0x487c45;};}function handleError(_0xb4561e,_0x308692){_0x308692=_0x308692||0x1f4;return function(_0x1f773f){logger[_0xe423('0x1e')](_0x1f773f[_0xe423('0x1f')]);if(_0x1f773f[_0xe423('0x1c')]){delete _0x1f773f['name'];}_0xb4561e[_0xe423('0xd')](_0x308692)[_0xe423('0x20')](_0x1f773f);};}exports[_0xe423('0x21')]=function(_0x11bbac,_0x520f9e){var _0x286dc2={},_0x236869={},_0x776e69={'count':0x0,'rows':[]};var _0x6642fb=_[_0xe423('0x22')](db[_0xe423('0x23')][_0xe423('0x24')],function(_0x15c80b){return{'name':_0x15c80b['fieldName'],'type':_0x15c80b[_0xe423('0x1b')][_0xe423('0x25')]};});_0x236869[_0xe423('0x26')]=_[_0xe423('0x22')](_0x6642fb,'name');_0x236869[_0xe423('0x27')]=_[_0xe423('0x28')](_0x11bbac[_0xe423('0x27')]);_0x236869[_0xe423('0x29')]=_[_0xe423('0x2a')](_0x236869['model'],_0x236869[_0xe423('0x27')]);_0x286dc2[_0xe423('0x2b')]=_[_0xe423('0x2a')](_0x236869[_0xe423('0x26')],qs[_0xe423('0x2c')](_0x11bbac['query'][_0xe423('0x2c')]));_0x286dc2[_0xe423('0x2b')]=_0x286dc2[_0xe423('0x2b')]['length']?_0x286dc2[_0xe423('0x2b')]:_0x236869[_0xe423('0x26')];if(!_0x11bbac[_0xe423('0x27')][_0xe423('0x2d')](_0xe423('0x2e'))){_0x286dc2[_0xe423('0xf')]=qs[_0xe423('0xf')](_0x11bbac[_0xe423('0x27')][_0xe423('0xf')]);_0x286dc2[_0xe423('0xe')]=qs[_0xe423('0xe')](_0x11bbac[_0xe423('0x27')][_0xe423('0xe')]);}_0x286dc2[_0xe423('0x2f')]=qs[_0xe423('0x30')](_0x11bbac[_0xe423('0x27')][_0xe423('0x30')]);_0x286dc2[_0xe423('0x31')]=qs[_0xe423('0x29')](_[_0xe423('0x32')](_0x11bbac[_0xe423('0x27')],_0x236869[_0xe423('0x29')]),_0x6642fb);if(_0x11bbac['query'][_0xe423('0x33')]){_0x286dc2[_0xe423('0x31')]=_[_0xe423('0x34')](_0x286dc2[_0xe423('0x31')],{'$or':_[_0xe423('0x22')](_0x6642fb,function(_0x29097a){if(_0x29097a[_0xe423('0x1b')]!=='VIRTUAL'){var _0x12cfe3={};_0x12cfe3[_0x29097a[_0xe423('0x1c')]]={'$like':'%'+_0x11bbac[_0xe423('0x27')]['filter']+'%'};return _0x12cfe3;}})});}_0x286dc2=_[_0xe423('0x34')]({},_0x286dc2,_0x11bbac['options']);var _0x377561={'where':_0x286dc2['where']};return db[_0xe423('0x23')][_0xe423('0x11')](_0x377561)[_0xe423('0x1d')](function(_0x326582){_0x776e69['count']=_0x326582;if(_0x11bbac[_0xe423('0x27')]['includeAll']){_0x286dc2[_0xe423('0x35')]=[{'all':!![]}];}return db[_0xe423('0x23')][_0xe423('0x36')](_0x286dc2);})['then'](function(_0x2d0f14){_0x776e69[_0xe423('0x37')]=_0x2d0f14;return _0x776e69;})['then'](respondWithFilteredResult(_0x520f9e,_0x286dc2))[_0xe423('0x38')](handleError(_0x520f9e,null));};exports[_0xe423('0x39')]=function(_0x591937,_0x3308e0){var _0x5966e9={'raw':![],'where':{'id':_0x591937[_0xe423('0x3a')]['id']}},_0x26e98d={};_0x26e98d[_0xe423('0x26')]=_[_0xe423('0x28')](db['VoiceExtension'][_0xe423('0x24')]);_0x26e98d[_0xe423('0x27')]=_[_0xe423('0x28')](_0x591937[_0xe423('0x27')]);_0x26e98d[_0xe423('0x29')]=_['intersection'](_0x26e98d[_0xe423('0x26')],_0x26e98d[_0xe423('0x27')]);_0x5966e9['attributes']=_[_0xe423('0x2a')](_0x26e98d['model'],qs[_0xe423('0x2c')](_0x591937['query']['fields']));_0x5966e9['attributes']=_0x5966e9[_0xe423('0x2b')][_0xe423('0x3b')]?_0x5966e9[_0xe423('0x2b')]:_0x26e98d[_0xe423('0x26')];if(_0x591937['query']['includeAll']){_0x5966e9[_0xe423('0x35')]=[{'all':!![]}];}_0x5966e9=_[_0xe423('0x34')]({},_0x5966e9,_0x591937[_0xe423('0x3c')]);return db[_0xe423('0x23')][_0xe423('0x3d')](_0x5966e9)[_0xe423('0x1d')](handleEntityNotFound(_0x3308e0,null))[_0xe423('0x1d')](respondWithResult(_0x3308e0,null))[_0xe423('0x38')](handleError(_0x3308e0,null));};exports[_0xe423('0x13')]=function(_0x39e34f,_0x5f1225){return db[_0xe423('0x23')][_0xe423('0x3d')]({'where':{'id':_0x39e34f[_0xe423('0x3a')]['id']}})[_0xe423('0x1d')](handleEntityNotFound(_0x5f1225,null))[_0xe423('0x1d')](removeEntity(_0x5f1225,null))[_0xe423('0x38')](handleError(_0x5f1225,null));};exports[_0xe423('0x3e')]=function(_0x5da22a,_0x40d1cb){if(_0x5da22a['body']['type']==='outbound'&&!_[_0xe423('0x3f')](_0x5da22a[_0xe423('0x40')][_0xe423('0x41')],'_')){_0x5da22a[_0xe423('0x40')][_0xe423('0x41')]='_'['concat'](_0x5da22a['body'][_0xe423('0x41')]);}return db[_0xe423('0x23')][_0xe423('0x3e')](_0x5da22a[_0xe423('0x40')],{'raw':![]})[_0xe423('0x1d')](function(_0x599470){var _0x23f9df=_0x5da22a['user'][_0xe423('0x14')]({'plain':!![]});if(!_0x23f9df)throw new Error(_0xe423('0x42'));if(_0x23f9df[_0xe423('0x43')]==='user'){var _0x58c458=_0x599470[_0xe423('0x14')]({'plain':!![]});var _0x2cfd4c=[{'name':_0xe423('0x15'),'value':'inbound'},{'name':_0xe423('0x44'),'value':_0xe423('0x16')},{'name':'InternalRoutes','value':'internal'}];var _0x2eaf6c=_['find'](_0x2cfd4c,[_0xe423('0x19'),_0x58c458[_0xe423('0x1b')]])['name'];return db['UserProfileSection'][_0xe423('0x3d')]({'where':{'name':_0x2eaf6c,'userProfileId':_0x23f9df[_0xe423('0x45')]},'raw':!![]})[_0xe423('0x1d')](function(_0x23d6d2){if(_0x23d6d2&&_0x23d6d2[_0xe423('0x46')]===0x0){return db[_0xe423('0x47')][_0xe423('0x3e')]({'name':_0x58c458[_0xe423('0x1c')],'resourceId':_0x58c458['id'],'type':_0x23d6d2[_0xe423('0x1c')],'sectionId':_0x23d6d2['id']},{})['then'](function(){return _0x599470;});}else{return _0x599470;}})[_0xe423('0x38')](function(_0x15ac4c){logger['error'](_0xe423('0x48'),_0x15ac4c);throw _0x15ac4c;});}return _0x599470;})[_0xe423('0x1d')](respondWithResult(_0x40d1cb,0xc9))[_0xe423('0x38')](handleError(_0x40d1cb,null));};exports[_0xe423('0x49')]=function(_0x90cf32,_0x38e65c){if(_0x90cf32[_0xe423('0x40')]['id']){delete _0x90cf32[_0xe423('0x40')]['id'];}return db[_0xe423('0x23')][_0xe423('0x3d')]({'where':{'id':_0x90cf32[_0xe423('0x3a')]['id']}})['then'](handleEntityNotFound(_0x38e65c,null))[_0xe423('0x1d')](function(_0x29761b){if(_0x29761b){return db[_0xe423('0x23')]['update'](_[_0xe423('0x32')](_0x90cf32['body'],[_0xe423('0x41'),_0xe423('0x4a'),_0xe423('0x4b'),_0xe423('0x4c'),'cutdigits',_0xe423('0x4d'),'alias']),{'where':{'context':_0x29761b[_0xe423('0x4a')],'exten':_0x29761b[_0xe423('0x41')]},'individualHooks':!![]})['then'](function(_0x128dd1){return _0x128dd1;});}return null;})['then'](respondWithStatusCode(_0x38e65c,null))[_0xe423('0x38')](handleError(_0x38e65c,null));};exports[_0xe423('0x4e')]=function(_0x14d8a4,_0x28cf89){var _0x5c1bf3=_0x14d8a4['params']['id'];var _0x29fad7=_0x14d8a4[_0xe423('0x40')];var _0x5b06a0=0xc8;var _0x3eb036=null;return db[_0xe423('0x4f')]['transaction']({'isolationLevel':db['sequelize'][_0xe423('0x50')][_0xe423('0x51')]['READ_COMMITTED']},function(_0x1e0a58){return db[_0xe423('0x23')][_0xe423('0x52')]({'where':{'id':_0x5c1bf3},'transaction':_0x1e0a58})['then'](function(_0x52cf09){if(_0x52cf09){return db['VoiceExtension'][_0xe423('0x13')]({'where':{'VoiceExtensionId':_0x5c1bf3},'transaction':_0x1e0a58})[_0xe423('0x1d')](function(){var _0x56cece=_['map'](_0x29fad7,function(_0x382f15){_0x382f15['VoiceExtensionId']=_0x5c1bf3;_0x382f15[_0xe423('0x53')]=!![];return _0x382f15;});return _0x52cf09['createRouting'](_0x56cece);})['then'](function(_0xf86d50){return db[_0xe423('0x23')][_0xe423('0x54')](_0xf86d50,{'transaction':_0x1e0a58});});}else{_0x5b06a0=0x194;_0x3eb036=[];}});})[_0xe423('0x1d')](function(){if(_0x5b06a0!==0x194){return db[_0xe423('0x23')][_0xe423('0x55')]({'where':{'isApp':!![],'VoiceExtensionId':_0x5c1bf3},'order':_0xe423('0x56')})[_0xe423('0x1d')](function(_0x4e0e2e){_0x3eb036=_0x4e0e2e;});}})[_0xe423('0x38')](function(_0x3f4c12){_0x5b06a0=0x1f4;logger[_0xe423('0x1e')](_0x3f4c12['stack']);if(_0x3f4c12['name']){delete _0x3f4c12['name'];}_0x3eb036=_0x3f4c12;})[_0xe423('0x57')](function(){if(_0x3eb036===null){_0x28cf89[_0xe423('0xb')](_0x5b06a0);}else{if(_0x5b06a0===0x1f4){_0x28cf89['status'](_0x5b06a0)['send'](_0x3eb036);}else{_0x28cf89['status'](_0x5b06a0)['json'](_0x3eb036);}}});}; \ No newline at end of file +var _0x0ce5=['cast(priority\x20as\x20unsigned)','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','destroy','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','internal','filter','ignore','value','includes','type','name','UserProfileResource','error','stack','send','index','map','VoiceExtension','key','model','query','keys','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','merge','VIRTUAL','options','includeAll','rows','catch','show','params','rawAttributes','filters','attributes','include','find','create','body','startsWith','exten','concat','user','InternalRoutes','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','recordingFormat','cutdigits','mandatoryDisposition','alias','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','bulkCreate'];(function(_0xe45118,_0x5dffbc){var _0x15e15d=function(_0x17eaec){while(--_0x17eaec){_0xe45118['push'](_0xe45118['shift']());}};_0x15e15d(++_0x5dffbc);}(_0x0ce5,0x11e));var _0x50ce=function(_0x1fbde3,_0x59da39){_0x1fbde3=_0x1fbde3-0x0;var _0x2b092f=_0x0ce5[_0x1fbde3];return _0x2b092f;};'use strict';var _=require(_0x50ce('0x0'));var Redis=require(_0x50ce('0x1'));var qs=require(_0x50ce('0x2'));var logger=require(_0x50ce('0x3'))(_0x50ce('0x4'));var config=require(_0x50ce('0x5'));var db=require(_0x50ce('0x6'))['db'];config[_0x50ce('0x7')]=_[_0x50ce('0x8')](config['redis'],{'host':_0x50ce('0x9'),'port':0x18eb});var socket=require(_0x50ce('0xa'))(new Redis(config['redis']));require(_0x50ce('0xb'))['register'](socket);function respondWithStatusCode(_0x5aa4da,_0x2c1344){_0x2c1344=_0x2c1344||0xcc;return function(_0x718996){if(_0x718996){return _0x5aa4da[_0x50ce('0xc')](_0x2c1344);}return _0x5aa4da[_0x50ce('0xd')](_0x2c1344)[_0x50ce('0xe')]();};}function respondWithResult(_0x90d8ae,_0x413ed0){_0x413ed0=_0x413ed0||0xc8;return function(_0x345aea){if(_0x345aea){return _0x90d8ae[_0x50ce('0xd')](_0x413ed0)[_0x50ce('0xf')](_0x345aea);}};}function respondWithFilteredResult(_0x5367e5,_0x2f819a){return function(_0x42cf76){if(_0x42cf76){var _0x2f159d=typeof _0x2f819a[_0x50ce('0x10')]==='undefined'&&typeof _0x2f819a[_0x50ce('0x11')]===_0x50ce('0x12');var _0x3c0ebf=_0x42cf76[_0x50ce('0x13')];var _0x1afc7c=_0x2f159d?0x0:_0x2f819a[_0x50ce('0x10')];var _0x46086d=_0x2f159d?_0x42cf76['count']:_0x2f819a['offset']+_0x2f819a['limit'];var _0x519779;if(_0x46086d>=_0x3c0ebf){_0x46086d=_0x3c0ebf;_0x519779=0xc8;}else{_0x519779=0xce;}_0x5367e5[_0x50ce('0xd')](_0x519779);return _0x5367e5['set'](_0x50ce('0x14'),_0x1afc7c+'-'+_0x46086d+'/'+_0x3c0ebf)[_0x50ce('0xf')](_0x42cf76);}return null;};}function removeEntity(_0x20e273){return function(_0x1e346a){if(_0x1e346a){return _0x1e346a[_0x50ce('0x15')]()[_0x50ce('0x16')](function(){var _0x1011c6=_0x1e346a[_0x50ce('0x17')]({'plain':!![]});var _0x472465=[{'name':_0x50ce('0x18'),'value':_0x50ce('0x19'),'ignore':![]},{'name':_0x50ce('0x1a'),'value':_0x50ce('0x1b'),'ignore':![]},{'name':'InternalRoutes','value':_0x50ce('0x1c'),'ignore':![]}];var _0x381e78=_(_0x472465)[_0x50ce('0x1d')](_0x50ce('0x1e'))['map'](_0x50ce('0x1f'))[_0x50ce('0x1f')]();if(_[_0x50ce('0x20')](_0x381e78,_0x1011c6[_0x50ce('0x21')])){return;}var _0x40e42f=_['find'](_0x472465,[_0x50ce('0x1f'),_0x1011c6['type']])[_0x50ce('0x22')];return db[_0x50ce('0x23')][_0x50ce('0x15')]({'where':{'type':_0x40e42f,'resourceId':_0x1011c6['id']}})[_0x50ce('0x16')](function(){return _0x1e346a;});})[_0x50ce('0x16')](function(){_0x20e273[_0x50ce('0xd')](0xcc)[_0x50ce('0xe')]();});}};}function handleEntityNotFound(_0xb78493){return function(_0x35b4d1){if(!_0x35b4d1){_0xb78493[_0x50ce('0xc')](0x194);}return _0x35b4d1;};}function handleError(_0x1fdc76,_0x8e782e){_0x8e782e=_0x8e782e||0x1f4;return function(_0x33a823){logger[_0x50ce('0x24')](_0x33a823[_0x50ce('0x25')]);if(_0x33a823[_0x50ce('0x22')]){delete _0x33a823['name'];}_0x1fdc76[_0x50ce('0xd')](_0x8e782e)[_0x50ce('0x26')](_0x33a823);};}exports[_0x50ce('0x27')]=function(_0x11d34f,_0x5270d9){var _0x561036={},_0x1d4c1c={},_0x79ce77={'count':0x0,'rows':[]};var _0x156782=_[_0x50ce('0x28')](db[_0x50ce('0x29')]['rawAttributes'],function(_0x1c3a03){return{'name':_0x1c3a03['fieldName'],'type':_0x1c3a03[_0x50ce('0x21')][_0x50ce('0x2a')]};});_0x1d4c1c[_0x50ce('0x2b')]=_[_0x50ce('0x28')](_0x156782,_0x50ce('0x22'));_0x1d4c1c[_0x50ce('0x2c')]=_[_0x50ce('0x2d')](_0x11d34f[_0x50ce('0x2c')]);_0x1d4c1c['filters']=_[_0x50ce('0x2e')](_0x1d4c1c[_0x50ce('0x2b')],_0x1d4c1c[_0x50ce('0x2c')]);_0x561036['attributes']=_[_0x50ce('0x2e')](_0x1d4c1c[_0x50ce('0x2b')],qs['fields'](_0x11d34f['query'][_0x50ce('0x2f')]));_0x561036['attributes']=_0x561036['attributes'][_0x50ce('0x30')]?_0x561036['attributes']:_0x1d4c1c[_0x50ce('0x2b')];if(!_0x11d34f[_0x50ce('0x2c')][_0x50ce('0x31')](_0x50ce('0x32'))){_0x561036[_0x50ce('0x11')]=qs[_0x50ce('0x11')](_0x11d34f[_0x50ce('0x2c')][_0x50ce('0x11')]);_0x561036[_0x50ce('0x10')]=qs[_0x50ce('0x10')](_0x11d34f['query']['offset']);}_0x561036[_0x50ce('0x33')]=qs[_0x50ce('0x34')](_0x11d34f[_0x50ce('0x2c')][_0x50ce('0x34')]);_0x561036['where']=qs['filters'](_[_0x50ce('0x35')](_0x11d34f[_0x50ce('0x2c')],_0x1d4c1c['filters']),_0x156782);if(_0x11d34f[_0x50ce('0x2c')]['filter']){_0x561036['where']=_[_0x50ce('0x36')](_0x561036['where'],{'$or':_['map'](_0x156782,function(_0x4abc51){if(_0x4abc51[_0x50ce('0x21')]!==_0x50ce('0x37')){var _0x3d0932={};_0x3d0932[_0x4abc51[_0x50ce('0x22')]]={'$like':'%'+_0x11d34f[_0x50ce('0x2c')][_0x50ce('0x1d')]+'%'};return _0x3d0932;}})});}_0x561036=_[_0x50ce('0x36')]({},_0x561036,_0x11d34f[_0x50ce('0x38')]);var _0x41cd37={'where':_0x561036['where']};return db[_0x50ce('0x29')][_0x50ce('0x13')](_0x41cd37)[_0x50ce('0x16')](function(_0x18f85b){_0x79ce77['count']=_0x18f85b;if(_0x11d34f[_0x50ce('0x2c')][_0x50ce('0x39')]){_0x561036['include']=[{'all':!![]}];}return db[_0x50ce('0x29')]['findAll'](_0x561036);})[_0x50ce('0x16')](function(_0xfbe08d){_0x79ce77[_0x50ce('0x3a')]=_0xfbe08d;return _0x79ce77;})[_0x50ce('0x16')](respondWithFilteredResult(_0x5270d9,_0x561036))[_0x50ce('0x3b')](handleError(_0x5270d9,null));};exports[_0x50ce('0x3c')]=function(_0xdd2f7,_0x2afa0a){var _0x2d7415={'raw':![],'where':{'id':_0xdd2f7[_0x50ce('0x3d')]['id']}},_0x327f03={};_0x327f03[_0x50ce('0x2b')]=_[_0x50ce('0x2d')](db[_0x50ce('0x29')][_0x50ce('0x3e')]);_0x327f03['query']=_['keys'](_0xdd2f7[_0x50ce('0x2c')]);_0x327f03[_0x50ce('0x3f')]=_[_0x50ce('0x2e')](_0x327f03[_0x50ce('0x2b')],_0x327f03[_0x50ce('0x2c')]);_0x2d7415[_0x50ce('0x40')]=_[_0x50ce('0x2e')](_0x327f03[_0x50ce('0x2b')],qs[_0x50ce('0x2f')](_0xdd2f7[_0x50ce('0x2c')][_0x50ce('0x2f')]));_0x2d7415['attributes']=_0x2d7415['attributes'][_0x50ce('0x30')]?_0x2d7415[_0x50ce('0x40')]:_0x327f03[_0x50ce('0x2b')];if(_0xdd2f7[_0x50ce('0x2c')][_0x50ce('0x39')]){_0x2d7415[_0x50ce('0x41')]=[{'all':!![]}];}_0x2d7415=_[_0x50ce('0x36')]({},_0x2d7415,_0xdd2f7[_0x50ce('0x38')]);return db[_0x50ce('0x29')][_0x50ce('0x42')](_0x2d7415)[_0x50ce('0x16')](handleEntityNotFound(_0x2afa0a,null))[_0x50ce('0x16')](respondWithResult(_0x2afa0a,null))[_0x50ce('0x3b')](handleError(_0x2afa0a,null));};exports[_0x50ce('0x15')]=function(_0x5c3da3,_0x3df79a){return db[_0x50ce('0x29')]['find']({'where':{'id':_0x5c3da3[_0x50ce('0x3d')]['id']}})[_0x50ce('0x16')](handleEntityNotFound(_0x3df79a,null))[_0x50ce('0x16')](removeEntity(_0x3df79a,null))[_0x50ce('0x3b')](handleError(_0x3df79a,null));};exports[_0x50ce('0x43')]=function(_0x267421,_0x5e117d){if(_0x267421[_0x50ce('0x44')][_0x50ce('0x21')]===_0x50ce('0x1b')&&!_[_0x50ce('0x45')](_0x267421[_0x50ce('0x44')][_0x50ce('0x46')],'_')){_0x267421['body'][_0x50ce('0x46')]='_'[_0x50ce('0x47')](_0x267421[_0x50ce('0x44')][_0x50ce('0x46')]);}return db[_0x50ce('0x29')]['create'](_0x267421[_0x50ce('0x44')],{'raw':![]})[_0x50ce('0x16')](function(_0x1614d2){var _0x443c52=_0x267421[_0x50ce('0x48')][_0x50ce('0x17')]({'plain':!![]});if(!_0x443c52)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x443c52['role']===_0x50ce('0x48')){var _0x41c7aa=_0x1614d2[_0x50ce('0x17')]({'plain':!![]});var _0x1274d0=[{'name':_0x50ce('0x18'),'value':_0x50ce('0x19')},{'name':'OutboundRoutes','value':'outbound'},{'name':_0x50ce('0x49'),'value':_0x50ce('0x1c')}];var _0x3e6887=_[_0x50ce('0x42')](_0x1274d0,[_0x50ce('0x1f'),_0x41c7aa[_0x50ce('0x21')]])[_0x50ce('0x22')];return db[_0x50ce('0x4a')][_0x50ce('0x42')]({'where':{'name':_0x3e6887,'userProfileId':_0x443c52[_0x50ce('0x4b')]},'raw':!![]})[_0x50ce('0x16')](function(_0x5dbac9){if(_0x5dbac9&&_0x5dbac9[_0x50ce('0x4c')]===0x0){return db[_0x50ce('0x23')][_0x50ce('0x43')]({'name':_0x41c7aa[_0x50ce('0x22')],'resourceId':_0x41c7aa['id'],'type':_0x5dbac9['name'],'sectionId':_0x5dbac9['id']},{})[_0x50ce('0x16')](function(){return _0x1614d2;});}else{return _0x1614d2;}})[_0x50ce('0x3b')](function(_0x3c521e){logger[_0x50ce('0x24')](_0x50ce('0x4d'),_0x3c521e);throw _0x3c521e;});}return _0x1614d2;})['then'](respondWithResult(_0x5e117d,0xc9))['catch'](handleError(_0x5e117d,null));};exports[_0x50ce('0x4e')]=function(_0x558594,_0x2217a2){if(_0x558594[_0x50ce('0x44')]['id']){delete _0x558594['body']['id'];}return db[_0x50ce('0x29')]['find']({'where':{'id':_0x558594[_0x50ce('0x3d')]['id']}})[_0x50ce('0x16')](handleEntityNotFound(_0x2217a2,null))['then'](function(_0x235d40){if(_0x235d40){return db[_0x50ce('0x29')][_0x50ce('0x4e')](_[_0x50ce('0x35')](_0x558594['body'],[_0x50ce('0x46'),_0x50ce('0x4f'),'description',_0x50ce('0x50'),_0x50ce('0x51'),_0x50ce('0x52'),_0x50ce('0x53')]),{'where':{'context':_0x235d40[_0x50ce('0x4f')],'exten':_0x235d40['exten']},'individualHooks':!![]})[_0x50ce('0x16')](function(_0x44b78f){return _0x44b78f;});}return null;})[_0x50ce('0x16')](respondWithStatusCode(_0x2217a2,null))['catch'](handleError(_0x2217a2,null));};exports[_0x50ce('0x54')]=function(_0x3fedaf,_0x21be67){var _0x8dc5a=_0x3fedaf[_0x50ce('0x3d')]['id'];var _0x5ccca4=_0x3fedaf[_0x50ce('0x44')];var _0x280174=0xc8;var _0x39ed1b=null;return db[_0x50ce('0x55')]['transaction']({'isolationLevel':db['sequelize'][_0x50ce('0x56')][_0x50ce('0x57')][_0x50ce('0x58')]},function(_0x54429b){return db['VoiceExtension'][_0x50ce('0x59')]({'where':{'id':_0x8dc5a},'transaction':_0x54429b})['then'](function(_0x54e9c7){if(_0x54e9c7){return db[_0x50ce('0x29')][_0x50ce('0x15')]({'where':{'VoiceExtensionId':_0x8dc5a},'transaction':_0x54429b})['then'](function(){var _0x401d35=_[_0x50ce('0x28')](_0x5ccca4,function(_0xd71b5){_0xd71b5[_0x50ce('0x5a')]=_0x8dc5a;_0xd71b5[_0x50ce('0x5b')]=!![];return _0xd71b5;});return _0x54e9c7[_0x50ce('0x5c')](_0x401d35);})[_0x50ce('0x16')](function(_0x404861){return db['VoiceExtension'][_0x50ce('0x5d')](_0x404861,{'transaction':_0x54429b});});}else{_0x280174=0x194;_0x39ed1b=[];}});})[_0x50ce('0x16')](function(){if(_0x280174!==0x194){return db[_0x50ce('0x29')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x8dc5a},'order':_0x50ce('0x5e')})[_0x50ce('0x16')](function(_0x36a0fe){_0x39ed1b=_0x36a0fe;});}})[_0x50ce('0x3b')](function(_0x5dfbcb){_0x280174=0x1f4;logger[_0x50ce('0x24')](_0x5dfbcb[_0x50ce('0x25')]);if(_0x5dfbcb[_0x50ce('0x22')]){delete _0x5dfbcb[_0x50ce('0x22')];}_0x39ed1b=_0x5dfbcb;})['finally'](function(){if(_0x39ed1b===null){_0x21be67[_0x50ce('0xc')](_0x280174);}else{if(_0x280174===0x1f4){_0x21be67['status'](_0x280174)['send'](_0x39ed1b);}else{_0x21be67[_0x50ce('0xd')](_0x280174)[_0x50ce('0xf')](_0x39ed1b);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index bb05aa2..b29bdf6 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 _0x2eb9=['save','update','remove','emit','hook','exports','events','../../mysqldb','VoiceExtension','setMaxListeners'];(function(_0x481ce2,_0x5f38bf){var _0x1c62ca=function(_0x737cbb){while(--_0x737cbb){_0x481ce2['push'](_0x481ce2['shift']());}};_0x1c62ca(++_0x5f38bf);}(_0x2eb9,0x1c8));var _0x92eb=function(_0x38ecb1,_0x20031f){_0x38ecb1=_0x38ecb1-0x0;var _0x2bf9c7=_0x2eb9[_0x38ecb1];return _0x2bf9c7;};'use strict';var EventEmitter=require(_0x92eb('0x0'));var VoiceExtension=require(_0x92eb('0x1'))['db'][_0x92eb('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x92eb('0x3')](0x0);var events={'afterCreate':_0x92eb('0x4'),'afterUpdate':_0x92eb('0x5'),'afterDestroy':_0x92eb('0x6')};function emitEvent(_0x2ad6c2){return function(_0x2b0c1b,_0x340e86,_0x52f836){VoiceExtensionEvents[_0x92eb('0x7')](_0x2ad6c2+':'+_0x2b0c1b['id'],_0x2b0c1b);VoiceExtensionEvents[_0x92eb('0x7')](_0x2ad6c2,_0x2b0c1b);_0x52f836(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0x92eb('0x8')](e,emitEvent(event));}}module[_0x92eb('0x9')]=VoiceExtensionEvents; \ No newline at end of file +var _0x278a=['update','remove','emit','hook','exports','events','VoiceExtension','setMaxListeners'];(function(_0x3de061,_0x9e4bbf){var _0x1daaea=function(_0x287999){while(--_0x287999){_0x3de061['push'](_0x3de061['shift']());}};_0x1daaea(++_0x9e4bbf);}(_0x278a,0xed));var _0xa278=function(_0x2fbd01,_0xa298d){_0x2fbd01=_0x2fbd01-0x0;var _0x3b6171=_0x278a[_0x2fbd01];return _0x3b6171;};'use strict';var EventEmitter=require(_0xa278('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0xa278('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xa278('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa278('0x3'),'afterDestroy':_0xa278('0x4')};function emitEvent(_0x44d3cd){return function(_0x51fe26,_0x26568e,_0xebb22a){VoiceExtensionEvents[_0xa278('0x5')](_0x44d3cd+':'+_0x51fe26['id'],_0x51fe26);VoiceExtensionEvents[_0xa278('0x5')](_0x44d3cd,_0x51fe26);_0xebb22a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0xa278('0x6')](e,emitEvent(event));}}module[_0xa278('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 60e34e1..74f68ee 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 _0x7380=['interval','IntervalId','then','*,*,*,*','intervals','map','filter','toLowerCase','tag','CDR(tag)=','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','Set(CALLERID(all)=','callerID','NoOp(No\x20number\x20available)','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','priority','last','concat','catch','define','VoiceExtension','get','Hangup','./voiceExtension.attributes','exports','models','type','context','alias','Set','NoOp','No\x20alias\x20set','exten','inbound','CDR(routeid)=','push','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(routeAlias)=','CDR(destination)=','${EXTEN:','cutdigits','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','timeout','options','split','length','name','trunk','param','prefix','phone','SIP','join','U(xcally-mixmonitor-context)','findAll'];(function(_0x339129,_0x86dcc6){var _0x1570df=function(_0x3b537e){while(--_0x3b537e){_0x339129['push'](_0x339129['shift']());}};_0x1570df(++_0x86dcc6);}(_0x7380,0x172));var _0x0738=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x7380[_0xc4001c];return _0x49f7bc;};'use strict';var _=require('lodash');var attributes=require(_0x0738('0x0'));module[_0x0738('0x1')]=function(_0x4eeea9){var _0x48479a=_0x4eeea9[_0x0738('0x2')];function _0xdb7ed1(_0x51c93f){var _0x235e91=0x2;var _0x2ed2be=[{'type':_0x51c93f[_0x0738('0x3')],'app':'Set','appdata':'CDR(type)='+_0x51c93f[_0x0738('0x3')],'context':_0x51c93f[_0x0738('0x4')],'exten':_0x51c93f['exten'],'priority':_0x235e91++,'VoiceExtensionId':_0x51c93f['id']},{'type':_0x51c93f['type'],'app':_0x51c93f[_0x0738('0x5')]?_0x0738('0x6'):_0x0738('0x7'),'appdata':_0x51c93f[_0x0738('0x5')]?'CDR(routeAlias)='+_0x51c93f['alias']:_0x0738('0x8'),'context':_0x51c93f['context'],'exten':_0x51c93f[_0x0738('0x9')],'priority':_0x235e91++,'VoiceExtensionId':_0x51c93f['id']}];if(_0x51c93f[_0x0738('0x3')]===_0x0738('0xa')){_0x2ed2be['push']({'type':_0x0738('0xa'),'app':'Set','appdata':_0x0738('0xb')+_0x51c93f['id'],'context':_0x51c93f[_0x0738('0x4')],'exten':_0x51c93f[_0x0738('0x9')],'priority':_0x235e91++,'VoiceExtensionId':_0x51c93f['id']});}_0x2ed2be[_0x0738('0xc')]({'type':_0x51c93f[_0x0738('0x3')],'app':_0x0738('0x6'),'appdata':_0x0738('0xd'),'context':_0x51c93f[_0x0738('0x4')],'exten':_0x51c93f[_0x0738('0x9')],'priority':_0x235e91++,'VoiceExtensionId':_0x51c93f['id']},{'type':_0x51c93f['type'],'app':_0x0738('0x6'),'appdata':_0x0738('0xe'),'context':_0x51c93f[_0x0738('0x4')],'exten':_0x51c93f['exten'],'priority':_0x235e91++,'VoiceExtensionId':_0x51c93f['id']},{'type':_0x51c93f[_0x0738('0x3')],'app':_0x0738('0x6'),'appdata':_0x0738('0xf'),'context':_0x51c93f[_0x0738('0x4')],'exten':_0x51c93f[_0x0738('0x9')],'priority':_0x235e91++,'VoiceExtensionId':_0x51c93f['id']});return _0x2ed2be;}function _0x36bd81(_0x1e4dd0){var _0x14f259=0x2;var _0x8b333f=[{'type':_0x0738('0x10'),'app':_0x0738('0x6'),'appdata':'CDR(type)=outbound','context':_0x1e4dd0['context'],'exten':_0x1e4dd0[_0x0738('0x9')],'priority':_0x14f259++,'VoiceExtensionId':_0x1e4dd0['id']},{'type':_0x0738('0x10'),'app':_0x1e4dd0[_0x0738('0x5')]?'Set':'NoOp','appdata':_0x1e4dd0[_0x0738('0x5')]?_0x0738('0x11')+_0x1e4dd0[_0x0738('0x5')]:_0x0738('0x8'),'context':_0x1e4dd0[_0x0738('0x4')],'exten':_0x1e4dd0[_0x0738('0x9')],'priority':_0x14f259++,'VoiceExtensionId':_0x1e4dd0['id']},{'type':_0x0738('0x10'),'app':_0x0738('0x6'),'appdata':_0x0738('0x12')+(_0x1e4dd0['cutdigits']?_0x0738('0x13')+_0x1e4dd0[_0x0738('0x14')]+'}':_0x0738('0x15')),'context':_0x1e4dd0[_0x0738('0x4')],'exten':_0x1e4dd0[_0x0738('0x9')],'priority':_0x14f259++,'VoiceExtensionId':_0x1e4dd0['id']},{'type':_0x0738('0x10'),'app':_0x0738('0x6'),'appdata':_0x0738('0xb')+_0x1e4dd0['id'],'context':_0x1e4dd0[_0x0738('0x4')],'exten':_0x1e4dd0[_0x0738('0x9')],'priority':_0x14f259++,'VoiceExtensionId':_0x1e4dd0['id']},{'type':_0x0738('0x10'),'app':'ExecIf','appdata':_0x0738('0x16')+(_0x14f259+0x2)+'):Goto('+(_0x14f259+0x1)+')','context':_0x1e4dd0[_0x0738('0x4')],'exten':_0x1e4dd0[_0x0738('0x9')],'priority':_0x14f259++,'VoiceExtensionId':_0x1e4dd0['id']},{'type':_0x0738('0x10'),'app':_0x0738('0x6'),'appdata':_0x1e4dd0[_0x0738('0x14')]?_0x0738('0x17')+_0x1e4dd0[_0x0738('0x14')]+'}':_0x0738('0x18'),'context':_0x1e4dd0[_0x0738('0x4')],'exten':_0x1e4dd0[_0x0738('0x9')],'priority':_0x14f259++,'VoiceExtensionId':_0x1e4dd0['id']},{'type':_0x0738('0x10'),'app':'Set','appdata':_0x0738('0xd'),'context':_0x1e4dd0['context'],'exten':_0x1e4dd0[_0x0738('0x9')],'priority':_0x14f259++,'VoiceExtensionId':_0x1e4dd0['id']},{'type':_0x0738('0x10'),'app':_0x0738('0x6'),'appdata':_0x0738('0xe'),'context':_0x1e4dd0[_0x0738('0x4')],'exten':_0x1e4dd0[_0x0738('0x9')],'priority':_0x14f259++,'VoiceExtensionId':_0x1e4dd0['id']},{'type':_0x0738('0x10'),'app':_0x0738('0x6'),'appdata':_0x0738('0xf'),'context':_0x1e4dd0[_0x0738('0x4')],'exten':_0x1e4dd0[_0x0738('0x9')],'priority':_0x14f259++,'VoiceExtensionId':_0x1e4dd0['id']},{'type':'outbound','app':_0x0738('0x6'),'appdata':_0x0738('0x19')+_0x1e4dd0['id'],'context':_0x1e4dd0[_0x0738('0x4')],'exten':_0x1e4dd0['exten'],'priority':_0x14f259++,'VoiceExtensionId':_0x1e4dd0['id']}];if(_0x1e4dd0[_0x0738('0x1a')](_0x0738('0x1b'))&&_0x1e4dd0['recordingFormat']!==_0x0738('0x1c')){_0x8b333f['push']({'type':_0x0738('0x10'),'app':'Set','appdata':_0x0738('0x1d'),'context':_0x1e4dd0[_0x0738('0x4')],'exten':_0x1e4dd0[_0x0738('0x9')],'priority':_0x14f259++,'VoiceExtensionId':_0x1e4dd0['id']},{'type':_0x0738('0x10'),'app':_0x0738('0x6'),'appdata':_0x0738('0x1e')+_0x1e4dd0[_0x0738('0x1b')]||_0x0738('0x1f'),'context':_0x1e4dd0[_0x0738('0x4')],'exten':_0x1e4dd0[_0x0738('0x9')],'priority':_0x14f259++,'VoiceExtensionId':_0x1e4dd0['id']});}return _0x8b333f;}function _0x335b8d(_0x547d53,_0x46d373){var _0x3df84e=[{'name':'trunk','param':0x0},{'name':_0x0738('0x20'),'param':0x1},{'name':_0x0738('0x21'),'param':0x2},{'name':'url','param':0x3}];var _0xd4f4ca={};var _0x2073fa=_0x46d373[_0x0738('0x22')](',');var _0x104237=[];for(var _0x25323a=0x0;_0x25323a<_0x3df84e[_0x0738('0x23')];_0x25323a++){switch(_0x3df84e[_0x25323a][_0x0738('0x24')]){case'trunk':_0xd4f4ca[_0x0738('0x25')]=_0x2073fa[_0x3df84e[_0x25323a][_0x0738('0x26')]][_0x0738('0x22')]('/')[0x1];_0xd4f4ca['phone']=_0x2073fa[_0x3df84e[_0x25323a][_0x0738('0x26')]][_0x0738('0x22')]('/')[0x2];_0xd4f4ca[_0x0738('0x27')]=_0xd4f4ca['phone']?_0xd4f4ca[_0x0738('0x28')]['split']('$')[0x0]:undefined;_0xd4f4ca[_0x0738('0x28')]=_0x547d53[_0x0738('0x14')]?(_0xd4f4ca[_0x0738('0x27')]||'')+'${EXTEN:'+_0x547d53[_0x0738('0x14')]+'}':(_0xd4f4ca['prefix']||'')+'${EXTEN}';_0x104237[_0x3df84e[_0x25323a][_0x0738('0x26')]]=[_0x0738('0x29'),_0xd4f4ca['trunk'],_0xd4f4ca['phone']][_0x0738('0x2a')]('/');break;case'options':_0xd4f4ca[_0x0738('0x21')]=_0x2073fa[_0x3df84e[_0x25323a][_0x0738('0x26')]];if(_0x547d53[_0x0738('0x1b')]!==_0x0738('0x1c')){if(_0xd4f4ca['options']['indexOf'](_0x0738('0x2b'))<0x0){_0xd4f4ca[_0x0738('0x21')]+='U(xcally-mixmonitor-context)';}}else{_0xd4f4ca[_0x0738('0x21')]=_0xd4f4ca[_0x0738('0x21')]['replace'](_0x0738('0x2b'),'');}_0x104237[_0x3df84e[_0x25323a][_0x0738('0x26')]]=_0xd4f4ca[_0x0738('0x21')];break;default:_0x104237[_0x3df84e[_0x25323a][_0x0738('0x26')]]=_0x2073fa[_0x3df84e[_0x25323a][_0x0738('0x26')]];}}return _0x104237['join'](',');}function _0xf55150(_0x567479,_0x5564b9,_0x17e7bf){return new Promise(function(_0x315139,_0x300a72){var _0x595e34=[];if(_['isEmpty'](_0x5564b9))return _0x315139(_0x595e34);_0x48479a['Interval'][_0x0738('0x2c')]({'attributes':['id',_0x0738('0x2d'),_0x0738('0x2e')],'raw':!![]})[_0x0738('0x2f')](function(_0x2aae84){for(var _0x54873f=0x0,_0x2d99ba=0x0;_0x54873f<_0x5564b9[_0x0738('0x23')];_0x54873f++,_0x2d99ba=0x0){var _0x321082=_0x5564b9[_0x54873f];var _0x5ad8eb=[];var _0x13d458=[];delete _0x321082['id'];if(_0x321082[_0x0738('0x2d')]!==_0x0738('0x30')){_0x321082[_0x0738('0x31')]=[_0x321082[_0x0738('0x2d')]];}else{_0x321082[_0x0738('0x31')]=_0x321082[_0x0738('0x2e')]?_[_0x0738('0x32')](_[_0x0738('0x33')](_0x2aae84,{'IntervalId':_0x321082[_0x0738('0x2e')]}),_0x0738('0x2d')):[];}_0x321082[_0x0738('0x4')]=_0x567479[_0x0738('0x4')];_0x321082[_0x0738('0x9')]=_0x567479['exten'];if(_0x321082[_0x0738('0x3')])_0x321082[_0x0738('0x3')]=_0x321082[_0x0738('0x3')][_0x0738('0x34')]();if(_0x567479[_0x0738('0x3')]===_0x0738('0x10')){if(_0x321082[_0x0738('0x1a')](_0x0738('0x35'))&&_0x321082[_0x0738('0x35')]&&_0x321082[_0x0738('0x35')]!=='--'){_0x5ad8eb[_0x0738('0xc')]({'type':_0x321082[_0x0738('0x3')][_0x0738('0x34')](),'app':_0x0738('0x6'),'appdata':_0x0738('0x36')+_0x321082[_0x0738('0x35')],'context':_0x567479[_0x0738('0x4')],'exten':_0x567479[_0x0738('0x9')],'priority':_0x321082[_0x0738('0x31')][_0x0738('0x23')]+_0x17e7bf+_0x2d99ba++,'VoiceExtensionId':_0x567479['id']});}_0x5ad8eb['push']({'type':_0x321082[_0x0738('0x3')]['toLowerCase'](),'app':_0x0738('0x37'),'appdata':_0x0738('0x38')+(_0x321082['callerID']?_0x0738('0x39')+_0x321082[_0x0738('0x3a')]+')':_0x0738('0x3b')),'context':_0x567479[_0x0738('0x4')],'exten':_0x567479[_0x0738('0x9')],'priority':_0x321082[_0x0738('0x31')]['length']+_0x17e7bf+_0x2d99ba++,'VoiceExtensionId':_0x567479['id']});}else{if(_0x321082[_0x0738('0x1a')](_0x0738('0x3c'))){if([_0x0738('0x3d'),_0x0738('0x3e')][_0x0738('0x3f')](_0x321082[_0x0738('0x40')]['toLowerCase']())&&_0x321082[_0x0738('0x41')]!==_0x0738('0x42')){if(_0x321082[_0x0738('0x3c')]){_0x5ad8eb[_0x0738('0xc')]({'type':_0x321082['type'][_0x0738('0x34')](),'app':_0x0738('0x37'),'appdata':_0x0738('0x43'),'context':_0x567479[_0x0738('0x4')],'exten':_0x567479[_0x0738('0x9')],'priority':_0x321082['intervals'][_0x0738('0x23')]+_0x17e7bf+_0x2d99ba++,'VoiceExtensionId':_0x567479['id']});_0x5ad8eb[_0x0738('0xc')]({'type':_0x321082[_0x0738('0x3')]['toLowerCase'](),'app':_0x0738('0x6'),'appdata':_0x0738('0x44'),'context':_0x567479[_0x0738('0x4')],'exten':_0x567479['exten'],'priority':_0x321082[_0x0738('0x31')][_0x0738('0x23')]+_0x17e7bf+_0x2d99ba++,'VoiceExtensionId':_0x567479['id']});}else{_0x5ad8eb[_0x0738('0xc')]({'type':_0x321082['type'][_0x0738('0x34')](),'app':_0x0738('0x37'),'appdata':_0x0738('0x45'),'context':_0x567479['context'],'exten':_0x567479[_0x0738('0x9')],'priority':_0x321082[_0x0738('0x31')][_0x0738('0x23')]+_0x17e7bf+_0x2d99ba++,'VoiceExtensionId':_0x567479['id']});_0x5ad8eb[_0x0738('0xc')]({'type':_0x321082['type'][_0x0738('0x34')](),'app':_0x0738('0x6'),'appdata':_0x0738('0x46'),'context':_0x567479[_0x0738('0x4')],'exten':_0x567479[_0x0738('0x9')],'priority':_0x321082[_0x0738('0x31')][_0x0738('0x23')]+_0x17e7bf+_0x2d99ba++,'VoiceExtensionId':_0x567479['id']});}}}}for(var _0x6f2a5a=0x0;_0x6f2a5a<_0x321082['intervals'][_0x0738('0x23')];_0x6f2a5a++){var _0x2e214e=_0x17e7bf+_0x321082[_0x0738('0x31')]['length'];var _0x12a31f=_0x6f2a5a===_0x321082[_0x0738('0x31')][_0x0738('0x23')]-0x1?_0x17e7bf+_0x5ad8eb[_0x0738('0x23')]+_0x13d458[_0x0738('0x23')]+0x2:_0x17e7bf+_0x6f2a5a+0x1;_0x5ad8eb['splice'](_0x6f2a5a,0x0,{'type':_0x567479[_0x0738('0x3')],'app':_0x0738('0x47'),'appdata':_0x321082[_0x0738('0x31')][_0x6f2a5a]+'?'+_0x567479[_0x0738('0x4')]+_0x0738('0x48')+_0x2e214e+':'+_0x567479[_0x0738('0x4')]+_0x0738('0x48')+_0x12a31f,'exten':_0x567479[_0x0738('0x9')],'context':_0x567479[_0x0738('0x4')],'priority':_0x17e7bf+_0x6f2a5a,'VoiceExtensionId':_0x567479['id']});}if(_0x321082['appType']===_0x0738('0x49'))_0x321082[_0x0738('0x4a')]=_0x335b8d(_0x567479,_0x321082[_0x0738('0x4a')]);_0x321082[_0x0738('0x4b')]=_0x5ad8eb[_0x0738('0x23')]?_[_0x0738('0x4c')](_0x5ad8eb)[_0x0738('0x4b')]+0x1:_0x17e7bf;_0x595e34=_[_0x0738('0x4d')](_0x595e34,_0x5ad8eb,[_0x321082],_0x13d458);_0x17e7bf=_[_0x0738('0x4c')](_0x595e34)[_0x0738('0x4b')]+0x1;}return _0x315139(_0x595e34);})[_0x0738('0x4e')](function(_0x5564f6){_0x300a72(_0x5564f6);});});}return _0x4eeea9[_0x0738('0x4f')](_0x0738('0x50'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x169736){var _0x3e172e=this[_0x0738('0x51')]({'plain':!![]});var _0x2f0757=_0x3e172e['type']===_0x0738('0x10')?_0x36bd81(_0x3e172e):_0xdb7ed1(_0x3e172e);return _0xf55150(_0x3e172e,_0x169736,_[_0x0738('0x4c')](_0x2f0757)['priority']+0x1)[_0x0738('0x2f')](function(_0x420377){var _0x1630b8=_[_0x0738('0x4d')](_0x2f0757,_0x420377);_0x1630b8[_0x0738('0xc')]({'type':_0x3e172e[_0x0738('0x3')],'app':_0x0738('0x52'),'exten':_0x3e172e[_0x0738('0x9')],'context':_0x3e172e[_0x0738('0x4')],'priority':_[_0x0738('0x4c')](_0x1630b8)[_0x0738('0x4b')]+0x1,'VoiceExtensionId':_0x3e172e['id']});return _0x1630b8;});}}});}; \ No newline at end of file +var _0x26d1=['outbound','ExecIf','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','MONITOR_OPTIONS=ab','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','split','length','param','phone','prefix','${EXTEN:','SIP','join','indexOf','U(xcally-mixmonitor-context)','replace','Interval','findAll','IntervalId','then','interval','*,*,*,*','intervals','map','filter','toLowerCase','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','playback','includes','appType','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','appdata','priority','last','concat','catch','define','VoiceExtension','get','lodash','exports','models','type','Set','CDR(type)=','context','alias','NoOp','CDR(routeAlias)=','exten','inbound','push','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','No\x20alias\x20set','CDR(destination)=','cutdigits','${EXTEN}','CDR(routeid)='];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x26d1,0x8e));var _0x126d=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x26d1[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x126d('0x0'));var attributes=require('./voiceExtension.attributes');module[_0x126d('0x1')]=function(_0x2ea1cd){var _0x37ff4c=_0x2ea1cd[_0x126d('0x2')];function _0x59d0a0(_0x5a847a){var _0x3a3fb4=0x2;var _0x48016e=[{'type':_0x5a847a[_0x126d('0x3')],'app':_0x126d('0x4'),'appdata':_0x126d('0x5')+_0x5a847a[_0x126d('0x3')],'context':_0x5a847a[_0x126d('0x6')],'exten':_0x5a847a['exten'],'priority':_0x3a3fb4++,'VoiceExtensionId':_0x5a847a['id']},{'type':_0x5a847a[_0x126d('0x3')],'app':_0x5a847a[_0x126d('0x7')]?_0x126d('0x4'):_0x126d('0x8'),'appdata':_0x5a847a[_0x126d('0x7')]?_0x126d('0x9')+_0x5a847a[_0x126d('0x7')]:'No\x20alias\x20set','context':_0x5a847a[_0x126d('0x6')],'exten':_0x5a847a[_0x126d('0xa')],'priority':_0x3a3fb4++,'VoiceExtensionId':_0x5a847a['id']}];if(_0x5a847a[_0x126d('0x3')]===_0x126d('0xb')){_0x48016e[_0x126d('0xc')]({'type':'inbound','app':_0x126d('0x4'),'appdata':'CDR(routeid)='+_0x5a847a['id'],'context':_0x5a847a[_0x126d('0x6')],'exten':_0x5a847a[_0x126d('0xa')],'priority':_0x3a3fb4++,'VoiceExtensionId':_0x5a847a['id']});}_0x48016e[_0x126d('0xc')]({'type':_0x5a847a['type'],'app':_0x126d('0x4'),'appdata':_0x126d('0xd'),'context':_0x5a847a[_0x126d('0x6')],'exten':_0x5a847a['exten'],'priority':_0x3a3fb4++,'VoiceExtensionId':_0x5a847a['id']},{'type':_0x5a847a['type'],'app':_0x126d('0x4'),'appdata':_0x126d('0xe'),'context':_0x5a847a[_0x126d('0x6')],'exten':_0x5a847a[_0x126d('0xa')],'priority':_0x3a3fb4++,'VoiceExtensionId':_0x5a847a['id']},{'type':_0x5a847a[_0x126d('0x3')],'app':_0x126d('0x4'),'appdata':'MONITOR_OPTIONS=ab','context':_0x5a847a[_0x126d('0x6')],'exten':_0x5a847a['exten'],'priority':_0x3a3fb4++,'VoiceExtensionId':_0x5a847a['id']});return _0x48016e;}function _0x352d72(_0x4f195a){var _0x2915a4=0x2;var _0x1be025=[{'type':'outbound','app':_0x126d('0x4'),'appdata':'CDR(type)=outbound','context':_0x4f195a[_0x126d('0x6')],'exten':_0x4f195a['exten'],'priority':_0x2915a4++,'VoiceExtensionId':_0x4f195a['id']},{'type':'outbound','app':_0x4f195a['alias']?_0x126d('0x4'):_0x126d('0x8'),'appdata':_0x4f195a[_0x126d('0x7')]?_0x126d('0x9')+_0x4f195a['alias']:_0x126d('0xf'),'context':_0x4f195a[_0x126d('0x6')],'exten':_0x4f195a[_0x126d('0xa')],'priority':_0x2915a4++,'VoiceExtensionId':_0x4f195a['id']},{'type':'outbound','app':'Set','appdata':_0x126d('0x10')+(_0x4f195a[_0x126d('0x11')]?'${EXTEN:'+_0x4f195a[_0x126d('0x11')]+'}':_0x126d('0x12')),'context':_0x4f195a[_0x126d('0x6')],'exten':_0x4f195a[_0x126d('0xa')],'priority':_0x2915a4++,'VoiceExtensionId':_0x4f195a['id']},{'type':'outbound','app':_0x126d('0x4'),'appdata':_0x126d('0x13')+_0x4f195a['id'],'context':_0x4f195a[_0x126d('0x6')],'exten':_0x4f195a[_0x126d('0xa')],'priority':_0x2915a4++,'VoiceExtensionId':_0x4f195a['id']},{'type':_0x126d('0x14'),'app':_0x126d('0x15'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x2915a4+0x2)+'):Goto('+(_0x2915a4+0x1)+')','context':_0x4f195a[_0x126d('0x6')],'exten':_0x4f195a['exten'],'priority':_0x2915a4++,'VoiceExtensionId':_0x4f195a['id']},{'type':'outbound','app':_0x126d('0x4'),'appdata':_0x4f195a[_0x126d('0x11')]?_0x126d('0x16')+_0x4f195a[_0x126d('0x11')]+'}':_0x126d('0x17'),'context':_0x4f195a[_0x126d('0x6')],'exten':_0x4f195a[_0x126d('0xa')],'priority':_0x2915a4++,'VoiceExtensionId':_0x4f195a['id']},{'type':_0x126d('0x14'),'app':_0x126d('0x4'),'appdata':_0x126d('0xd'),'context':_0x4f195a[_0x126d('0x6')],'exten':_0x4f195a[_0x126d('0xa')],'priority':_0x2915a4++,'VoiceExtensionId':_0x4f195a['id']},{'type':'outbound','app':_0x126d('0x4'),'appdata':_0x126d('0xe'),'context':_0x4f195a[_0x126d('0x6')],'exten':_0x4f195a[_0x126d('0xa')],'priority':_0x2915a4++,'VoiceExtensionId':_0x4f195a['id']},{'type':_0x126d('0x14'),'app':_0x126d('0x4'),'appdata':_0x126d('0x18'),'context':_0x4f195a[_0x126d('0x6')],'exten':_0x4f195a['exten'],'priority':_0x2915a4++,'VoiceExtensionId':_0x4f195a['id']},{'type':_0x126d('0x14'),'app':_0x126d('0x4'),'appdata':_0x126d('0x19')+_0x4f195a['id'],'context':_0x4f195a[_0x126d('0x6')],'exten':_0x4f195a[_0x126d('0xa')],'priority':_0x2915a4++,'VoiceExtensionId':_0x4f195a['id']}];if(_0x4f195a[_0x126d('0x1a')]('recordingFormat')&&_0x4f195a[_0x126d('0x1b')]!==_0x126d('0x1c')){_0x1be025[_0x126d('0xc')]({'type':_0x126d('0x14'),'app':_0x126d('0x4'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x4f195a[_0x126d('0x6')],'exten':_0x4f195a[_0x126d('0xa')],'priority':_0x2915a4++,'VoiceExtensionId':_0x4f195a['id']},{'type':'outbound','app':_0x126d('0x4'),'appdata':_0x126d('0x1d')+_0x4f195a[_0x126d('0x1b')]||_0x126d('0x1e'),'context':_0x4f195a[_0x126d('0x6')],'exten':_0x4f195a[_0x126d('0xa')],'priority':_0x2915a4++,'VoiceExtensionId':_0x4f195a['id']});}return _0x1be025;}function _0x2cf5e9(_0x4f32ac,_0x4e19ee){var _0x322c91=[{'name':_0x126d('0x1f'),'param':0x0},{'name':_0x126d('0x20'),'param':0x1},{'name':_0x126d('0x21'),'param':0x2},{'name':'url','param':0x3}];var _0x33d9fb={};var _0x11a998=_0x4e19ee[_0x126d('0x22')](',');var _0x10ee01=[];for(var _0x2ef5d1=0x0;_0x2ef5d1<_0x322c91[_0x126d('0x23')];_0x2ef5d1++){switch(_0x322c91[_0x2ef5d1]['name']){case _0x126d('0x1f'):_0x33d9fb[_0x126d('0x1f')]=_0x11a998[_0x322c91[_0x2ef5d1][_0x126d('0x24')]][_0x126d('0x22')]('/')[0x1];_0x33d9fb[_0x126d('0x25')]=_0x11a998[_0x322c91[_0x2ef5d1][_0x126d('0x24')]]['split']('/')[0x2];_0x33d9fb[_0x126d('0x26')]=_0x33d9fb[_0x126d('0x25')]?_0x33d9fb[_0x126d('0x25')][_0x126d('0x22')]('$')[0x0]:undefined;_0x33d9fb[_0x126d('0x25')]=_0x4f32ac['cutdigits']?(_0x33d9fb[_0x126d('0x26')]||'')+_0x126d('0x27')+_0x4f32ac['cutdigits']+'}':(_0x33d9fb[_0x126d('0x26')]||'')+_0x126d('0x12');_0x10ee01[_0x322c91[_0x2ef5d1][_0x126d('0x24')]]=[_0x126d('0x28'),_0x33d9fb[_0x126d('0x1f')],_0x33d9fb[_0x126d('0x25')]][_0x126d('0x29')]('/');break;case'options':_0x33d9fb['options']=_0x11a998[_0x322c91[_0x2ef5d1][_0x126d('0x24')]];if(_0x4f32ac[_0x126d('0x1b')]!==_0x126d('0x1c')){if(_0x33d9fb[_0x126d('0x21')][_0x126d('0x2a')](_0x126d('0x2b'))<0x0){_0x33d9fb[_0x126d('0x21')]+=_0x126d('0x2b');}}else{_0x33d9fb[_0x126d('0x21')]=_0x33d9fb['options'][_0x126d('0x2c')](_0x126d('0x2b'),'');}_0x10ee01[_0x322c91[_0x2ef5d1][_0x126d('0x24')]]=_0x33d9fb[_0x126d('0x21')];break;default:_0x10ee01[_0x322c91[_0x2ef5d1][_0x126d('0x24')]]=_0x11a998[_0x322c91[_0x2ef5d1][_0x126d('0x24')]];}}return _0x10ee01[_0x126d('0x29')](',');}function _0x72908f(_0x10ec0a,_0x3a82ff,_0xa877b9){return new Promise(function(_0x203238,_0x194ecc){var _0x132d81=[];if(_['isEmpty'](_0x3a82ff))return _0x203238(_0x132d81);_0x37ff4c[_0x126d('0x2d')][_0x126d('0x2e')]({'attributes':['id','interval',_0x126d('0x2f')],'raw':!![]})[_0x126d('0x30')](function(_0x1052d1){for(var _0x12d817=0x0,_0xbd2d18=0x0;_0x12d817<_0x3a82ff['length'];_0x12d817++,_0xbd2d18=0x0){var _0x1c8950=_0x3a82ff[_0x12d817];var _0x404f01=[];var _0x3e8c48=[];delete _0x1c8950['id'];if(_0x1c8950[_0x126d('0x31')]!==_0x126d('0x32')){_0x1c8950[_0x126d('0x33')]=[_0x1c8950['interval']];}else{_0x1c8950[_0x126d('0x33')]=_0x1c8950['IntervalId']?_[_0x126d('0x34')](_[_0x126d('0x35')](_0x1052d1,{'IntervalId':_0x1c8950[_0x126d('0x2f')]}),_0x126d('0x31')):[];}_0x1c8950[_0x126d('0x6')]=_0x10ec0a['context'];_0x1c8950[_0x126d('0xa')]=_0x10ec0a[_0x126d('0xa')];if(_0x1c8950[_0x126d('0x3')])_0x1c8950[_0x126d('0x3')]=_0x1c8950[_0x126d('0x3')][_0x126d('0x36')]();if(_0x10ec0a[_0x126d('0x3')]==='outbound'){if(_0x1c8950[_0x126d('0x1a')](_0x126d('0x37'))&&_0x1c8950[_0x126d('0x37')]&&_0x1c8950[_0x126d('0x37')]!=='--'){_0x404f01[_0x126d('0xc')]({'type':_0x1c8950[_0x126d('0x3')][_0x126d('0x36')](),'app':_0x126d('0x4'),'appdata':_0x126d('0x38')+_0x1c8950[_0x126d('0x37')],'context':_0x10ec0a[_0x126d('0x6')],'exten':_0x10ec0a['exten'],'priority':_0x1c8950[_0x126d('0x33')]['length']+_0xa877b9+_0xbd2d18++,'VoiceExtensionId':_0x10ec0a['id']});}_0x404f01[_0x126d('0xc')]({'type':_0x1c8950[_0x126d('0x3')][_0x126d('0x36')](),'app':_0x126d('0x15'),'appdata':_0x126d('0x39')+(_0x1c8950[_0x126d('0x3a')]?_0x126d('0x3b')+_0x1c8950[_0x126d('0x3a')]+')':_0x126d('0x3c')),'context':_0x10ec0a[_0x126d('0x6')],'exten':_0x10ec0a[_0x126d('0xa')],'priority':_0x1c8950['intervals'][_0x126d('0x23')]+_0xa877b9+_0xbd2d18++,'VoiceExtensionId':_0x10ec0a['id']});}else{if(_0x1c8950[_0x126d('0x1a')](_0x126d('0x3d'))){if([_0x126d('0x3e'),_0x126d('0x3f')][_0x126d('0x40')](_0x1c8950['app'][_0x126d('0x36')]())&&_0x1c8950[_0x126d('0x41')]!==_0x126d('0x42')){if(_0x1c8950['answer']){_0x404f01[_0x126d('0xc')]({'type':_0x1c8950[_0x126d('0x3')][_0x126d('0x36')](),'app':_0x126d('0x15'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x10ec0a[_0x126d('0x6')],'exten':_0x10ec0a[_0x126d('0xa')],'priority':_0x1c8950[_0x126d('0x33')][_0x126d('0x23')]+_0xa877b9+_0xbd2d18++,'VoiceExtensionId':_0x10ec0a['id']});_0x404f01[_0x126d('0xc')]({'type':_0x1c8950[_0x126d('0x3')][_0x126d('0x36')](),'app':_0x126d('0x4'),'appdata':_0x126d('0x43'),'context':_0x10ec0a['context'],'exten':_0x10ec0a[_0x126d('0xa')],'priority':_0x1c8950['intervals']['length']+_0xa877b9+_0xbd2d18++,'VoiceExtensionId':_0x10ec0a['id']});}else{_0x404f01[_0x126d('0xc')]({'type':_0x1c8950[_0x126d('0x3')]['toLowerCase'](),'app':_0x126d('0x15'),'appdata':_0x126d('0x44'),'context':_0x10ec0a[_0x126d('0x6')],'exten':_0x10ec0a[_0x126d('0xa')],'priority':_0x1c8950[_0x126d('0x33')][_0x126d('0x23')]+_0xa877b9+_0xbd2d18++,'VoiceExtensionId':_0x10ec0a['id']});_0x404f01[_0x126d('0xc')]({'type':_0x1c8950['type']['toLowerCase'](),'app':_0x126d('0x4'),'appdata':_0x126d('0x45'),'context':_0x10ec0a[_0x126d('0x6')],'exten':_0x10ec0a[_0x126d('0xa')],'priority':_0x1c8950[_0x126d('0x33')][_0x126d('0x23')]+_0xa877b9+_0xbd2d18++,'VoiceExtensionId':_0x10ec0a['id']});}}}}for(var _0x203b7c=0x0;_0x203b7c<_0x1c8950['intervals']['length'];_0x203b7c++){var _0x5c9434=_0xa877b9+_0x1c8950['intervals'][_0x126d('0x23')];var _0x135506=_0x203b7c===_0x1c8950[_0x126d('0x33')][_0x126d('0x23')]-0x1?_0xa877b9+_0x404f01['length']+_0x3e8c48[_0x126d('0x23')]+0x2:_0xa877b9+_0x203b7c+0x1;_0x404f01[_0x126d('0x46')](_0x203b7c,0x0,{'type':_0x10ec0a[_0x126d('0x3')],'app':_0x126d('0x47'),'appdata':_0x1c8950['intervals'][_0x203b7c]+'?'+_0x10ec0a['context']+_0x126d('0x48')+_0x5c9434+':'+_0x10ec0a[_0x126d('0x6')]+_0x126d('0x48')+_0x135506,'exten':_0x10ec0a['exten'],'context':_0x10ec0a[_0x126d('0x6')],'priority':_0xa877b9+_0x203b7c,'VoiceExtensionId':_0x10ec0a['id']});}if(_0x1c8950[_0x126d('0x41')]==='outboundDial')_0x1c8950[_0x126d('0x49')]=_0x2cf5e9(_0x10ec0a,_0x1c8950['appdata']);_0x1c8950[_0x126d('0x4a')]=_0x404f01[_0x126d('0x23')]?_[_0x126d('0x4b')](_0x404f01)['priority']+0x1:_0xa877b9;_0x132d81=_[_0x126d('0x4c')](_0x132d81,_0x404f01,[_0x1c8950],_0x3e8c48);_0xa877b9=_[_0x126d('0x4b')](_0x132d81)[_0x126d('0x4a')]+0x1;}return _0x203238(_0x132d81);})[_0x126d('0x4d')](function(_0x51546d){_0x194ecc(_0x51546d);});});}return _0x2ea1cd[_0x126d('0x4e')](_0x126d('0x4f'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x4a2a20){var _0x3405e0=this[_0x126d('0x50')]({'plain':!![]});var _0x5d83a9=_0x3405e0['type']==='outbound'?_0x352d72(_0x3405e0):_0x59d0a0(_0x3405e0);return _0x72908f(_0x3405e0,_0x4a2a20,_[_0x126d('0x4b')](_0x5d83a9)[_0x126d('0x4a')]+0x1)['then'](function(_0x23b895){var _0x10455f=_[_0x126d('0x4c')](_0x5d83a9,_0x23b895);_0x10455f[_0x126d('0xc')]({'type':_0x3405e0['type'],'app':'Hangup','exten':_0x3405e0['exten'],'context':_0x3405e0[_0x126d('0x6')],'priority':_[_0x126d('0x4b')](_0x10455f)[_0x126d('0x4a')]+0x1,'VoiceExtensionId':_0x3405e0['id']});return _0x10455f;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index fe78ed5..fef45b7 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 _0x2484=['options','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./voiceExtension.socket','register','then','info','debug','request\x20sent','stringify','error','code','VoiceExtension,\x20%s,\x20%s','message','result','catch','GetVoiceExtension','VoiceExtension','findAll'];(function(_0x384503,_0x57b63d){var _0x5ae505=function(_0x50c51d){while(--_0x50c51d){_0x384503['push'](_0x384503['shift']());}};_0x5ae505(++_0x57b63d);}(_0x2484,0x178));var _0x4248=function(_0x327040,_0x6f7206){_0x327040=_0x327040-0x0;var _0x201070=_0x2484[_0x327040];return _0x201070;};'use strict';var _=require(_0x4248('0x0'));var util=require(_0x4248('0x1'));var moment=require('moment');var BPromise=require(_0x4248('0x2'));var rs=require(_0x4248('0x3'));var fs=require('fs');var Redis=require(_0x4248('0x4'));var db=require(_0x4248('0x5'))['db'];var utils=require(_0x4248('0x6'));var logger=require(_0x4248('0x7'))(_0x4248('0x8'));var config=require('../../config/environment');var jayson=require(_0x4248('0x9'));var client=jayson[_0x4248('0xa')][_0x4248('0xb')]({'port':0x232a});config[_0x4248('0xc')]=_[_0x4248('0xd')](config[_0x4248('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x4248('0xe'))(new Redis(config[_0x4248('0xc')]));require(_0x4248('0xf'))[_0x4248('0x10')](socket);function respondWithRpcPromise(_0x19b893,_0x2efb7c,_0x13cb06){return new BPromise(function(_0x4a88f4,_0x188337){return client['request'](_0x19b893,_0x13cb06)[_0x4248('0x11')](function(_0x2471b9){logger[_0x4248('0x12')]('VoiceExtension,\x20%s,\x20%s',_0x2efb7c,'request\x20sent');logger[_0x4248('0x13')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x2efb7c,_0x4248('0x14'),JSON[_0x4248('0x15')](_0x2471b9));if(_0x2471b9[_0x4248('0x16')]){if(_0x2471b9[_0x4248('0x16')][_0x4248('0x17')]===0x1f4){logger['error'](_0x4248('0x18'),_0x2efb7c,_0x2471b9[_0x4248('0x16')][_0x4248('0x19')]);return _0x188337(_0x2471b9[_0x4248('0x16')][_0x4248('0x19')]);}logger['error'](_0x4248('0x18'),_0x2efb7c,_0x2471b9[_0x4248('0x16')][_0x4248('0x19')]);return _0x4a88f4(_0x2471b9[_0x4248('0x16')][_0x4248('0x19')]);}else{logger[_0x4248('0x12')](_0x4248('0x18'),_0x2efb7c,_0x4248('0x14'));_0x4a88f4(_0x2471b9[_0x4248('0x1a')][_0x4248('0x19')]);}})[_0x4248('0x1b')](function(_0x2f7547){logger[_0x4248('0x16')](_0x4248('0x18'),_0x2efb7c,_0x2f7547);_0x188337(_0x2f7547);});});}exports[_0x4248('0x1c')]=function(_0x33df7b){var _0x200542=this;return new Promise(function(_0x396fc8,_0x5ab53e){return db[_0x4248('0x1d')][_0x4248('0x1e')]({'raw':_0x33df7b[_0x4248('0x1f')]?_0x33df7b[_0x4248('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x33df7b[_0x4248('0x1f')]?_0x33df7b[_0x4248('0x1f')][_0x4248('0x20')]||null:null,'attributes':_0x33df7b['options']?_0x33df7b[_0x4248('0x1f')][_0x4248('0x21')]||null:null,'limit':_0x33df7b['options']?_0x33df7b[_0x4248('0x1f')]['limit']||null:null,'include':_0x33df7b[_0x4248('0x1f')]?_0x33df7b[_0x4248('0x1f')][_0x4248('0x22')]?_[_0x4248('0x23')](_0x33df7b['options'][_0x4248('0x22')],function(_0x205382){return{'model':db[_0x205382[_0x4248('0x24')]],'as':_0x205382['as'],'attributes':_0x205382[_0x4248('0x21')],'include':_0x205382[_0x4248('0x22')]?_[_0x4248('0x23')](_0x205382[_0x4248('0x22')],function(_0x302308){return{'model':db[_0x302308[_0x4248('0x24')]],'as':_0x302308['as'],'attributes':_0x302308[_0x4248('0x21')],'include':_0x302308[_0x4248('0x22')]?_[_0x4248('0x23')](_0x302308[_0x4248('0x22')],function(_0xf72ecc){return{'model':db[_0xf72ecc[_0x4248('0x24')]],'as':_0xf72ecc['as'],'attributes':_0xf72ecc[_0x4248('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x346d91){logger[_0x4248('0x12')](_0x4248('0x1c'),_0x33df7b);logger['debug'](_0x4248('0x1c'),_0x33df7b,JSON[_0x4248('0x15')](_0x346d91));_0x396fc8(_0x346d91);})[_0x4248('0x1b')](function(_0x45dd44){logger[_0x4248('0x16')](_0x4248('0x1c'),_0x45dd44[_0x4248('0x19')],_0x33df7b);_0x5ab53e(_0x200542['error'](0x1f4,_0x45dd44['message']));});});}; \ No newline at end of file +var _0xfc91=['message','result','catch','GetVoiceExtension','VoiceExtension','options','raw','map','model','attributes','include','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','error'];(function(_0x210e3b,_0xf61f4e){var _0x2706c0=function(_0x15bcff){while(--_0x15bcff){_0x210e3b['push'](_0x210e3b['shift']());}};_0x2706c0(++_0xf61f4e);}(_0xfc91,0xb5));var _0x1fc9=function(_0x1ad1a8,_0x3aa47d){_0x1ad1a8=_0x1ad1a8-0x0;var _0x32339b=_0xfc91[_0x1ad1a8];return _0x32339b;};'use strict';var _=require('lodash');var util=require(_0x1fc9('0x0'));var moment=require('moment');var BPromise=require(_0x1fc9('0x1'));var rs=require(_0x1fc9('0x2'));var fs=require('fs');var Redis=require(_0x1fc9('0x3'));var db=require(_0x1fc9('0x4'))['db'];var utils=require(_0x1fc9('0x5'));var logger=require(_0x1fc9('0x6'))(_0x1fc9('0x7'));var config=require(_0x1fc9('0x8'));var jayson=require(_0x1fc9('0x9'));var client=jayson[_0x1fc9('0xa')][_0x1fc9('0xb')]({'port':0x232a});config[_0x1fc9('0xc')]=_['defaults'](config[_0x1fc9('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1fc9('0xc')]));require(_0x1fc9('0xd'))[_0x1fc9('0xe')](socket);function respondWithRpcPromise(_0x1b122f,_0x215926,_0x3fc4f4){return new BPromise(function(_0x43e0f0,_0x2761df){return client[_0x1fc9('0xf')](_0x1b122f,_0x3fc4f4)[_0x1fc9('0x10')](function(_0x1fb8cc){logger[_0x1fc9('0x11')](_0x1fc9('0x12'),_0x215926,_0x1fc9('0x13'));logger[_0x1fc9('0x14')](_0x1fc9('0x15'),_0x215926,_0x1fc9('0x13'),JSON['stringify'](_0x1fb8cc));if(_0x1fb8cc[_0x1fc9('0x16')]){if(_0x1fb8cc[_0x1fc9('0x16')]['code']===0x1f4){logger[_0x1fc9('0x16')](_0x1fc9('0x12'),_0x215926,_0x1fb8cc[_0x1fc9('0x16')][_0x1fc9('0x17')]);return _0x2761df(_0x1fb8cc[_0x1fc9('0x16')][_0x1fc9('0x17')]);}logger['error']('VoiceExtension,\x20%s,\x20%s',_0x215926,_0x1fb8cc[_0x1fc9('0x16')]['message']);return _0x43e0f0(_0x1fb8cc[_0x1fc9('0x16')]['message']);}else{logger['info'](_0x1fc9('0x12'),_0x215926,_0x1fc9('0x13'));_0x43e0f0(_0x1fb8cc[_0x1fc9('0x18')][_0x1fc9('0x17')]);}})[_0x1fc9('0x19')](function(_0x29afc3){logger[_0x1fc9('0x16')](_0x1fc9('0x12'),_0x215926,_0x29afc3);_0x2761df(_0x29afc3);});});}exports[_0x1fc9('0x1a')]=function(_0x2dabf2){var _0x487098=this;return new Promise(function(_0x41384a,_0x1ddde2){return db[_0x1fc9('0x1b')]['findAll']({'raw':_0x2dabf2['options']?_0x2dabf2[_0x1fc9('0x1c')][_0x1fc9('0x1d')]===undefined?!![]:![]:!![],'where':_0x2dabf2[_0x1fc9('0x1c')]?_0x2dabf2['options']['where']||null:null,'attributes':_0x2dabf2[_0x1fc9('0x1c')]?_0x2dabf2['options']['attributes']||null:null,'limit':_0x2dabf2['options']?_0x2dabf2[_0x1fc9('0x1c')]['limit']||null:null,'include':_0x2dabf2[_0x1fc9('0x1c')]?_0x2dabf2[_0x1fc9('0x1c')]['include']?_[_0x1fc9('0x1e')](_0x2dabf2['options']['include'],function(_0x24cb50){return{'model':db[_0x24cb50[_0x1fc9('0x1f')]],'as':_0x24cb50['as'],'attributes':_0x24cb50[_0x1fc9('0x20')],'include':_0x24cb50[_0x1fc9('0x21')]?_[_0x1fc9('0x1e')](_0x24cb50['include'],function(_0x15d548){return{'model':db[_0x15d548[_0x1fc9('0x1f')]],'as':_0x15d548['as'],'attributes':_0x15d548['attributes'],'include':_0x15d548[_0x1fc9('0x21')]?_[_0x1fc9('0x1e')](_0x15d548[_0x1fc9('0x21')],function(_0x538d5f){return{'model':db[_0x538d5f[_0x1fc9('0x1f')]],'as':_0x538d5f['as'],'attributes':_0x538d5f[_0x1fc9('0x20')]};}):[]};}):[]};}):[]:[]})[_0x1fc9('0x10')](function(_0x31ba25){logger[_0x1fc9('0x11')](_0x1fc9('0x1a'),_0x2dabf2);logger[_0x1fc9('0x14')](_0x1fc9('0x1a'),_0x2dabf2,JSON['stringify'](_0x31ba25));_0x41384a(_0x31ba25);})[_0x1fc9('0x19')](function(_0x5a9097){logger['error'](_0x1fc9('0x1a'),_0x5a9097[_0x1fc9('0x17')],_0x2dabf2);_0x1ddde2(_0x487098[_0x1fc9('0x16')](0x1f4,_0x5a9097[_0x1fc9('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 291fbf2..267fca1 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 _0xabce=['voiceExtension:','./voiceExtension.events','save','remove','update','emit'];(function(_0x163c46,_0x3f02af){var _0x39ef99=function(_0x5625c1){while(--_0x5625c1){_0x163c46['push'](_0x163c46['shift']());}};_0x39ef99(++_0x3f02af);}(_0xabce,0x103));var _0xeabc=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xabce[_0x4c7fb5];return _0x2e10ac;};'use strict';var VoiceExtensionEvents=require(_0xeabc('0x0'));var events=[_0xeabc('0x1'),_0xeabc('0x2'),_0xeabc('0x3')];function createListener(_0x49dbcc,_0x5bd1a4){return function(_0x5ebc95){_0x5bd1a4[_0xeabc('0x4')](_0x49dbcc,_0x5ebc95);};}function removeListener(_0x1d9f37,_0x1a88a7){return function(){VoiceExtensionEvents['removeListener'](_0x1d9f37,_0x1a88a7);};}exports['register']=function(_0x1b07a8){for(var _0x52a4d7=0x0,_0x229ba4=events['length'];_0x52a4d7<_0x229ba4;_0x52a4d7++){var _0x3bdc29=events[_0x52a4d7];var _0x9417af=createListener(_0xeabc('0x5')+_0x3bdc29,_0x1b07a8);VoiceExtensionEvents['on'](_0x3bdc29,_0x9417af);}}; \ No newline at end of file +var _0x7fbe=['length','voiceExtension:','remove','update','emit','removeListener','register'];(function(_0x4ffa5b,_0x206c39){var _0x21d2f6=function(_0x5a444c){while(--_0x5a444c){_0x4ffa5b['push'](_0x4ffa5b['shift']());}};_0x21d2f6(++_0x206c39);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x4c3593,_0x4ea381){_0x4c3593=_0x4c3593-0x0;var _0x1172d1=_0x7fbe[_0x4c3593];return _0x1172d1;};'use strict';var VoiceExtensionEvents=require('./voiceExtension.events');var events=['save',_0xe7fb('0x0'),_0xe7fb('0x1')];function createListener(_0x294c21,_0x1703d5){return function(_0x517d3a){_0x1703d5[_0xe7fb('0x2')](_0x294c21,_0x517d3a);};}function removeListener(_0x11d2c4,_0x4524ff){return function(){VoiceExtensionEvents[_0xe7fb('0x3')](_0x11d2c4,_0x4524ff);};}exports[_0xe7fb('0x4')]=function(_0x290172){for(var _0x12d1b0=0x0,_0x24cd67=events[_0xe7fb('0x5')];_0x12d1b0<_0x24cd67;_0x12d1b0++){var _0x5ad75b=events[_0x12d1b0];var _0x213ebc=createListener(_0xe7fb('0x6')+_0x5ad75b,_0x290172);VoiceExtensionEvents['on'](_0x5ad75b,_0x213ebc);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index ff9bdee..4253d35 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(_0x2136d5,_0x4b0479){var _0x3bee2e=function(_0x119e88){while(--_0x119e88){_0x2136d5['push'](_0x2136d5['shift']());}};_0x3bee2e(++_0x4b0479);}(_0x1883,0xab));var _0x3188=function(_0x3fd026,_0x47f743){_0x3fd026=_0x3fd026-0x0;var _0x1894b4=_0x1883[_0x3fd026];return _0x1894b4;};'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 _0xfdbd=['get','getMessages','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMail.controller','isAuthenticated','index','show'];(function(_0x331db5,_0x2cefd4){var _0x5b6d8f=function(_0x364fee){while(--_0x364fee){_0x331db5['push'](_0x331db5['shift']());}};_0x5b6d8f(++_0x2cefd4);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x11f249,_0x4ca4a8){_0x11f249=_0x11f249-0x0;var _0x5c3656=_0xfdbd[_0x11f249];return _0x5c3656;};'use strict';var multer=require(_0xdfdb('0x0'));var util=require(_0xdfdb('0x1'));var path=require(_0xdfdb('0x2'));var timeout=require(_0xdfdb('0x3'));var express=require(_0xdfdb('0x4'));var router=express[_0xdfdb('0x5')]();var fs_extra=require(_0xdfdb('0x6'));var auth=require(_0xdfdb('0x7'));var interaction=require(_0xdfdb('0x8'));var config=require('../../config/environment');var controller=require(_0xdfdb('0x9'));router['get']('/',auth[_0xdfdb('0xa')](),controller[_0xdfdb('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xdfdb('0xc')]);router[_0xdfdb('0xd')]('/:id/messages',auth[_0xdfdb('0xa')](),controller[_0xdfdb('0xe')]);router[_0xdfdb('0xf')]('/',auth[_0xdfdb('0xa')](),controller[_0xdfdb('0x10')]);router[_0xdfdb('0x11')](_0xdfdb('0x12'),auth['isAuthenticated'](),controller[_0xdfdb('0x13')]);router[_0xdfdb('0x14')]('/:id',auth[_0xdfdb('0xa')](),controller[_0xdfdb('0x15')]);module[_0xdfdb('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index de245f4..0e8a881 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 _0x1c67=['central','ENUM','yes','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','exports','STRING','from-voicemail','contest_mailbox','setDataValue','trim'];(function(_0x375e01,_0x3f2306){var _0xb1123f=function(_0x3768c8){while(--_0x3768c8){_0x375e01['push'](_0x375e01['shift']());}};_0xb1123f(++_0x3f2306);}(_0x1c67,0x1ba));var _0x71c6=function(_0x2f5ed9,_0x551bd4){_0x2f5ed9=_0x2f5ed9-0x0;var _0x1f6716=_0x1c67[_0x2f5ed9];return _0x1f6716;};'use strict';var Sequelize=require('sequelize');module[_0x71c6('0x0')]={'customer_id':{'type':Sequelize[_0x71c6('0x1')]},'context':{'type':Sequelize[_0x71c6('0x1')],'defaultValue':_0x71c6('0x2'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0x71c6('0x1')],'defaultValue':'','allowNull':![],'unique':_0x71c6('0x3')},'password':{'type':Sequelize[_0x71c6('0x1')]},'fullname':{'type':Sequelize[_0x71c6('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x32457a){this[_0x71c6('0x4')]('email',typeof _0x32457a==='string'&&_0x32457a[_0x71c6('0x5')]()?_0x32457a[_0x71c6('0x5')]():null);}},'pager':{'type':Sequelize[_0x71c6('0x1')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0x71c6('0x6')},'attach':{'type':Sequelize[_0x71c6('0x7')](_0x71c6('0x8'),'no'),'defaultValue':_0x71c6('0x8'),'allowNull':![]},'saycid':{'type':Sequelize[_0x71c6('0x7')]('yes','no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0x71c6('0x1')]},'review':{'type':Sequelize[_0x71c6('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x71c6('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x71c6('0x7')](_0x71c6('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x71c6('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x71c6('0x7')](_0x71c6('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x71c6('0x7')](_0x71c6('0x8'),'no'),'defaultValue':_0x71c6('0x8'),'allowNull':![]},'forcename':{'type':Sequelize[_0x71c6('0x7')](_0x71c6('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x71c6('0x7')](_0x71c6('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x71c6('0x7')]('yes','no'),'defaultValue':_0x71c6('0x8'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0x71c6('0x1')]},'emailbody':{'type':Sequelize[_0x71c6('0x1')]},'maxsecs':{'type':Sequelize[_0x71c6('0x9')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x71c6('0xa')],'get':function(){return this[_0x71c6('0xb')](_0x71c6('0xc'))+_0x71c6('0xd')+this[_0x71c6('0xb')]('mailbox');}}}; \ No newline at end of file +var _0x17ff=['ENUM','yes','TINYINT(4)','INTEGER','getDataValue','fullname','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','email','string','trim'];(function(_0x4d743c,_0x1d2a0b){var _0x16031d=function(_0x26b28f){while(--_0x26b28f){_0x4d743c['push'](_0x4d743c['shift']());}};_0x16031d(++_0x1d2a0b);}(_0x17ff,0x142));var _0xf17f=function(_0x2e6a62,_0x33da4b){_0x2e6a62=_0x2e6a62-0x0;var _0x5b14b5=_0x17ff[_0x2e6a62];return _0x5b14b5;};'use strict';var Sequelize=require(_0xf17f('0x0'));module[_0xf17f('0x1')]={'customer_id':{'type':Sequelize[_0xf17f('0x2')]},'context':{'type':Sequelize['STRING'],'defaultValue':_0xf17f('0x3'),'unique':_0xf17f('0x4')},'mailbox':{'type':Sequelize[_0xf17f('0x2')],'defaultValue':'','allowNull':![],'unique':_0xf17f('0x4')},'password':{'type':Sequelize[_0xf17f('0x2')]},'fullname':{'type':Sequelize[_0xf17f('0x2')]},'email':{'type':Sequelize[_0xf17f('0x2')],'validate':{'isEmail':!![]},'set':function(_0x596586){this['setDataValue'](_0xf17f('0x5'),typeof _0x596586===_0xf17f('0x6')&&_0x596586[_0xf17f('0x7')]()?_0x596586[_0xf17f('0x7')]():null);}},'pager':{'type':Sequelize[_0xf17f('0x2')]},'tz':{'type':Sequelize[_0xf17f('0x2')],'defaultValue':'central'},'attach':{'type':Sequelize[_0xf17f('0x8')](_0xf17f('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0xf17f('0x8')](_0xf17f('0x9'),'no'),'defaultValue':_0xf17f('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0xf17f('0x2')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0xf17f('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xf17f('0x8')](_0xf17f('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0xf17f('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xf17f('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xf17f('0x8')](_0xf17f('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xf17f('0x8')](_0xf17f('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xf17f('0x8')](_0xf17f('0x9'),'no'),'defaultValue':_0xf17f('0x9'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0xf17f('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xf17f('0x8')](_0xf17f('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xf17f('0x8')]('yes','no'),'defaultValue':_0xf17f('0x9'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0xf17f('0x2')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0xf17f('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xf17f('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xf17f('0xc')](_0xf17f('0xd'))+'\x20-\x20'+this[_0xf17f('0xc')](_0xf17f('0xe'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index d632d0f..81fc3e7 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 _0x7af2=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','getMessages','findOne','VoiceMailMessage','rawAttributes','mailbox','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','get','Voicemails','UserProfileResource','error','stack','name','send','index','map','VoiceMail','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','include','find','create'];(function(_0x159037,_0x37cfc2){var _0x18cd00=function(_0x399497){while(--_0x399497){_0x159037['push'](_0x159037['shift']());}};_0x18cd00(++_0x37cfc2);}(_0x7af2,0x119));var _0x27af=function(_0x3de6aa,_0x44a0dd){_0x3de6aa=_0x3de6aa-0x0;var _0x1ac9d2=_0x7af2[_0x3de6aa];return _0x1ac9d2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x27af('0x0'));var zipdir=require(_0x27af('0x1'));var jsonpatch=require(_0x27af('0x2'));var rp=require(_0x27af('0x3'));var moment=require('moment');var BPromise=require(_0x27af('0x4'));var Mustache=require(_0x27af('0x5'));var util=require(_0x27af('0x6'));var path=require(_0x27af('0x7'));var sox=require(_0x27af('0x8'));var csv=require(_0x27af('0x9'));var ejs=require(_0x27af('0xa'));var fs=require('fs');var fs_extra=require(_0x27af('0xb'));var _=require(_0x27af('0xc'));var squel=require('squel');var crypto=require(_0x27af('0xd'));var jsforce=require(_0x27af('0xe'));var deskjs=require(_0x27af('0xf'));var toCsv=require('to-csv');var querystring=require(_0x27af('0x10'));var Papa=require(_0x27af('0x11'));var Redis=require(_0x27af('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x27af('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x27af('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x27af('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x27af('0x16'))['db'];function respondWithStatusCode(_0x49a883,_0x406340){_0x406340=_0x406340||0xcc;return function(_0x203501){if(_0x203501){return _0x49a883[_0x27af('0x17')](_0x406340);}return _0x49a883[_0x27af('0x18')](_0x406340)[_0x27af('0x19')]();};}function respondWithResult(_0x1edb50,_0x234825){_0x234825=_0x234825||0xc8;return function(_0x3da435){if(_0x3da435){return _0x1edb50[_0x27af('0x18')](_0x234825)[_0x27af('0x1a')](_0x3da435);}};}function respondWithFilteredResult(_0x30f675,_0x9c2d4b){return function(_0x2d7800){if(_0x2d7800){var _0x3102c4=typeof _0x9c2d4b[_0x27af('0x1b')]===_0x27af('0x1c')&&typeof _0x9c2d4b[_0x27af('0x1d')]===_0x27af('0x1c');var _0x58583a=_0x2d7800[_0x27af('0x1e')];var _0x31d702=_0x3102c4?0x0:_0x9c2d4b['offset'];var _0x4e6e2f=_0x3102c4?_0x2d7800[_0x27af('0x1e')]:_0x9c2d4b[_0x27af('0x1b')]+_0x9c2d4b[_0x27af('0x1d')];var _0x31573a;if(_0x4e6e2f>=_0x58583a){_0x4e6e2f=_0x58583a;_0x31573a=0xc8;}else{_0x31573a=0xce;}_0x30f675[_0x27af('0x18')](_0x31573a);return _0x30f675['set'](_0x27af('0x1f'),_0x31d702+'-'+_0x4e6e2f+'/'+_0x58583a)[_0x27af('0x1a')](_0x2d7800);}return null;};}function patchUpdates(_0xcb4b90){return function(_0x5e7c19){try{jsonpatch[_0x27af('0x20')](_0x5e7c19,_0xcb4b90,!![]);}catch(_0x2eec5f){return BPromise[_0x27af('0x21')](_0x2eec5f);}return _0x5e7c19['save']();};}function saveUpdates(_0x2dce2b,_0x2460f4){return function(_0x30720b){if(_0x30720b){return _0x30720b[_0x27af('0x22')](_0x2dce2b)[_0x27af('0x23')](function(_0x396156){return _0x396156;});}return null;};}function removeEntity(_0x43dd9e,_0x35b36d){return function(_0x2e1bb0){if(_0x2e1bb0){return _0x2e1bb0['destroy']()['then'](function(){var _0x4b8fe6=_0x2e1bb0[_0x27af('0x24')]({'plain':!![]});var _0x4feaf1=_0x27af('0x25');return db[_0x27af('0x26')]['destroy']({'where':{'type':_0x4feaf1,'resourceId':_0x4b8fe6['id']}})[_0x27af('0x23')](function(){return _0x2e1bb0;});})[_0x27af('0x23')](function(){_0x43dd9e[_0x27af('0x18')](0xcc)[_0x27af('0x19')]();});}};}function handleEntityNotFound(_0x39b8ee,_0x3ca40e){return function(_0x775d4e){if(!_0x775d4e){_0x39b8ee['sendStatus'](0x194);}return _0x775d4e;};}function handleError(_0x14d5fc,_0x250d5b){_0x250d5b=_0x250d5b||0x1f4;return function(_0xadd38e){logger[_0x27af('0x27')](_0xadd38e[_0x27af('0x28')]);if(_0xadd38e[_0x27af('0x29')]){delete _0xadd38e[_0x27af('0x29')];}_0x14d5fc[_0x27af('0x18')](_0x250d5b)[_0x27af('0x2a')](_0xadd38e);};}exports[_0x27af('0x2b')]=function(_0x205e41,_0x4f4955){var _0x15e867={},_0x14b2e7={},_0x3800a1={'count':0x0,'rows':[]};var _0x575887=_[_0x27af('0x2c')](db[_0x27af('0x2d')]['rawAttributes'],function(_0x51bc97){return{'name':_0x51bc97[_0x27af('0x2e')],'type':_0x51bc97[_0x27af('0x2f')]['key']};});_0x14b2e7[_0x27af('0x30')]=_[_0x27af('0x2c')](_0x575887,_0x27af('0x29'));_0x14b2e7[_0x27af('0x31')]=_[_0x27af('0x32')](_0x205e41[_0x27af('0x31')]);_0x14b2e7[_0x27af('0x33')]=_[_0x27af('0x34')](_0x14b2e7[_0x27af('0x30')],_0x14b2e7[_0x27af('0x31')]);_0x15e867[_0x27af('0x35')]=_['intersection'](_0x14b2e7['model'],qs[_0x27af('0x36')](_0x205e41[_0x27af('0x31')]['fields']));_0x15e867[_0x27af('0x35')]=_0x15e867[_0x27af('0x35')]['length']?_0x15e867[_0x27af('0x35')]:_0x14b2e7[_0x27af('0x30')];if(!_0x205e41[_0x27af('0x31')][_0x27af('0x37')](_0x27af('0x38'))){_0x15e867['limit']=qs[_0x27af('0x1d')](_0x205e41[_0x27af('0x31')]['limit']);_0x15e867['offset']=qs[_0x27af('0x1b')](_0x205e41[_0x27af('0x31')][_0x27af('0x1b')]);}_0x15e867[_0x27af('0x39')]=qs[_0x27af('0x3a')](_0x205e41[_0x27af('0x31')]['sort']);_0x15e867[_0x27af('0x3b')]=qs['filters'](_[_0x27af('0x3c')](_0x205e41[_0x27af('0x31')],_0x14b2e7[_0x27af('0x33')]),_0x575887);if(_0x205e41[_0x27af('0x31')][_0x27af('0x3d')]){_0x15e867['where']=_[_0x27af('0x3e')](_0x15e867[_0x27af('0x3b')],{'$or':_[_0x27af('0x2c')](_0x575887,function(_0x3faebd){if(_0x3faebd[_0x27af('0x2f')]!==_0x27af('0x3f')){var _0x415d9f={};_0x415d9f[_0x3faebd[_0x27af('0x29')]]={'$like':'%'+_0x205e41[_0x27af('0x31')][_0x27af('0x3d')]+'%'};return _0x415d9f;}})});}_0x15e867=_[_0x27af('0x3e')]({},_0x15e867,_0x205e41[_0x27af('0x40')]);var _0x24ee9b={'where':_0x15e867[_0x27af('0x3b')]};return db['VoiceMail'][_0x27af('0x1e')](_0x24ee9b)[_0x27af('0x23')](function(_0x44534b){_0x3800a1[_0x27af('0x1e')]=_0x44534b;if(_0x205e41['query'][_0x27af('0x41')]){_0x15e867['include']=[{'all':!![]}];}return db['VoiceMail'][_0x27af('0x42')](_0x15e867);})[_0x27af('0x23')](function(_0x279f99){_0x3800a1[_0x27af('0x43')]=_0x279f99;return _0x3800a1;})[_0x27af('0x23')](respondWithFilteredResult(_0x4f4955,_0x15e867))[_0x27af('0x44')](handleError(_0x4f4955,null));};exports[_0x27af('0x45')]=function(_0x26eb28,_0x2269e8){var _0x100fcb={'raw':!![],'where':{'id':_0x26eb28[_0x27af('0x46')]['id']}},_0x1e3c35={};_0x1e3c35['model']=_[_0x27af('0x32')](db[_0x27af('0x2d')]['rawAttributes']);_0x1e3c35['query']=_[_0x27af('0x32')](_0x26eb28[_0x27af('0x31')]);_0x1e3c35[_0x27af('0x33')]=_[_0x27af('0x34')](_0x1e3c35[_0x27af('0x30')],_0x1e3c35['query']);_0x100fcb[_0x27af('0x35')]=_['intersection'](_0x1e3c35[_0x27af('0x30')],qs[_0x27af('0x36')](_0x26eb28[_0x27af('0x31')][_0x27af('0x36')]));_0x100fcb[_0x27af('0x35')]=_0x100fcb[_0x27af('0x35')][_0x27af('0x47')]?_0x100fcb['attributes']:_0x1e3c35['model'];if(_0x26eb28[_0x27af('0x31')]['includeAll']){_0x100fcb[_0x27af('0x48')]=[{'all':!![]}];}_0x100fcb=_[_0x27af('0x3e')]({},_0x100fcb,_0x26eb28[_0x27af('0x40')]);return db[_0x27af('0x2d')][_0x27af('0x49')](_0x100fcb)[_0x27af('0x23')](handleEntityNotFound(_0x2269e8,null))[_0x27af('0x23')](respondWithResult(_0x2269e8,null))['catch'](handleError(_0x2269e8,null));};exports[_0x27af('0x4a')]=function(_0xc7e2a8,_0x20e180){return db[_0x27af('0x2d')][_0x27af('0x4a')](_0xc7e2a8['body'],{})[_0x27af('0x23')](function(_0x25f960){var _0x28ba64=_0xc7e2a8['user']['get']({'plain':!![]});if(!_0x28ba64)throw new Error(_0x27af('0x4b'));if(_0x28ba64[_0x27af('0x4c')]===_0x27af('0x4d')){var _0x5be44f=_0x25f960['get']({'plain':!![]});var _0x2fad23='Voicemails';return db[_0x27af('0x4e')][_0x27af('0x49')]({'where':{'name':_0x2fad23,'userProfileId':_0x28ba64[_0x27af('0x4f')]},'raw':!![]})[_0x27af('0x23')](function(_0x38aa14){if(_0x38aa14&&_0x38aa14[_0x27af('0x50')]===0x0){return db[_0x27af('0x26')][_0x27af('0x4a')]({'name':_0x5be44f[_0x27af('0x29')],'resourceId':_0x5be44f['id'],'type':_0x38aa14[_0x27af('0x29')],'sectionId':_0x38aa14['id']},{})[_0x27af('0x23')](function(){return _0x25f960;});}else{return _0x25f960;}})['catch'](function(_0x76ed78){logger[_0x27af('0x27')](_0x27af('0x51'),_0x76ed78);throw _0x76ed78;});}return _0x25f960;})[_0x27af('0x23')](respondWithResult(_0x20e180,0xc9))[_0x27af('0x44')](handleError(_0x20e180,null));};exports[_0x27af('0x22')]=function(_0x20c155,_0x31eaa9){if(_0x20c155['body']['id']){delete _0x20c155[_0x27af('0x52')]['id'];}return db['VoiceMail'][_0x27af('0x49')]({'where':{'id':_0x20c155[_0x27af('0x46')]['id']}})[_0x27af('0x23')](handleEntityNotFound(_0x31eaa9,null))['then'](saveUpdates(_0x20c155[_0x27af('0x52')],null))['then'](respondWithResult(_0x31eaa9,null))[_0x27af('0x44')](handleError(_0x31eaa9,null));};exports[_0x27af('0x53')]=function(_0x4769ff,_0x5bf8b0){return db[_0x27af('0x2d')]['find']({'where':{'id':_0x4769ff[_0x27af('0x46')]['id']}})['then'](handleEntityNotFound(_0x5bf8b0,null))[_0x27af('0x23')](removeEntity(_0x5bf8b0,null))[_0x27af('0x44')](handleError(_0x5bf8b0,null));};exports[_0x27af('0x54')]=function(_0x571064,_0x4bc851,_0x5eab7d){return db[_0x27af('0x2d')][_0x27af('0x55')]({'where':{'id':_0x571064[_0x27af('0x46')]['id']}})['then'](handleEntityNotFound(_0x4bc851,null))[_0x27af('0x23')](function(_0x306c56){var _0x6761d4;var _0x34c855={},_0x299f63={};_0x299f63[_0x27af('0x30')]=_['keys'](db[_0x27af('0x56')][_0x27af('0x57')]);_0x299f63[_0x27af('0x31')]=_[_0x27af('0x32')](_0x571064['query']);_0x299f63[_0x27af('0x33')]=_['intersection'](_0x299f63[_0x27af('0x30')],_0x299f63[_0x27af('0x31')]);_0x34c855['attributes']=_[_0x27af('0x34')](_0x299f63[_0x27af('0x30')],qs['fields'](_0x571064['query'][_0x27af('0x36')]));_0x34c855[_0x27af('0x35')]=_0x34c855[_0x27af('0x35')]['length']?_0x34c855[_0x27af('0x35')]:_0x299f63[_0x27af('0x30')];if(!_0x571064['query'][_0x27af('0x37')](_0x27af('0x38'))){_0x34c855['limit']=qs['limit'](_0x571064[_0x27af('0x31')][_0x27af('0x1d')]);_0x34c855['offset']=qs['offset'](_0x571064[_0x27af('0x31')][_0x27af('0x1b')]);}_0x34c855[_0x27af('0x39')]=qs[_0x27af('0x3a')](_0x571064[_0x27af('0x31')][_0x27af('0x3a')]);_0x34c855[_0x27af('0x3b')]=qs['filters'](_['pick'](_0x571064[_0x27af('0x31')],_0x299f63[_0x27af('0x33')]));if(_0x571064[_0x27af('0x31')][_0x27af('0x3d')]){_0x34c855[_0x27af('0x3b')]=_[_0x27af('0x3e')](_0x34c855[_0x27af('0x3b')],{'$or':_[_0x27af('0x2c')](_0x34c855[_0x27af('0x35')],function(_0x13c9ff){var _0x444f21={};_0x444f21[_0x13c9ff]={'$like':'%'+_0x571064[_0x27af('0x31')][_0x27af('0x3d')]+'%'};return _0x444f21;})});}_0x34c855[_0x27af('0x3b')]=_[_0x27af('0x3e')](_0x34c855[_0x27af('0x3b')],{'mailboxuser':_0x306c56[_0x27af('0x58')]});_0x34c855=_['merge']({},_0x34c855,_0x571064[_0x27af('0x40')]);return db[_0x27af('0x56')]['findAndCountAll'](_0x34c855)[_0x27af('0x23')](respondWithFilteredResult(_0x4bc851,_0x34c855));})[_0x27af('0x44')](handleError(_0x4bc851,null));}; \ No newline at end of file +var _0xbee3=['map','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','options','VoiceMail','includeAll','include','findAll','rows','catch','rawAttributes','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','findOne','nolimit','order','mailbox','findAndCountAll','rimraf','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','end','error','stack','name','send','index'];(function(_0x152b8e,_0x1e8cc3){var _0x57f4b6=function(_0x155bba){while(--_0x155bba){_0x152b8e['push'](_0x152b8e['shift']());}};_0x57f4b6(++_0x1e8cc3);}(_0xbee3,0xd5));var _0x3bee=function(_0x5bd50e,_0x4dee56){_0x5bd50e=_0x5bd50e-0x0;var _0x42f9e5=_0xbee3[_0x5bd50e];return _0x42f9e5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3bee('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3bee('0x1'));var moment=require(_0x3bee('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x3bee('0x3'));var util=require(_0x3bee('0x4'));var path=require(_0x3bee('0x5'));var sox=require('sox');var csv=require(_0x3bee('0x6'));var ejs=require(_0x3bee('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3bee('0x8'));var squel=require(_0x3bee('0x9'));var crypto=require(_0x3bee('0xa'));var jsforce=require(_0x3bee('0xb'));var deskjs=require(_0x3bee('0xc'));var toCsv=require(_0x3bee('0x6'));var querystring=require(_0x3bee('0xd'));var Papa=require('papaparse');var Redis=require(_0x3bee('0xe'));var authService=require(_0x3bee('0xf'));var qs=require(_0x3bee('0x10'));var as=require(_0x3bee('0x11'));var hardwareService=require(_0x3bee('0x12'));var logger=require(_0x3bee('0x13'))('api');var utils=require(_0x3bee('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x3bee('0x15'));var db=require(_0x3bee('0x16'))['db'];function respondWithStatusCode(_0x407526,_0x6950d0){_0x6950d0=_0x6950d0||0xcc;return function(_0x410124){if(_0x410124){return _0x407526[_0x3bee('0x17')](_0x6950d0);}return _0x407526[_0x3bee('0x18')](_0x6950d0)['end']();};}function respondWithResult(_0xad01f9,_0x33504d){_0x33504d=_0x33504d||0xc8;return function(_0x31ac52){if(_0x31ac52){return _0xad01f9[_0x3bee('0x18')](_0x33504d)[_0x3bee('0x19')](_0x31ac52);}};}function respondWithFilteredResult(_0x5b9473,_0x558436){return function(_0x346767){if(_0x346767){var _0x515397=typeof _0x558436[_0x3bee('0x1a')]===_0x3bee('0x1b')&&typeof _0x558436['limit']==='undefined';var _0x1582a4=_0x346767[_0x3bee('0x1c')];var _0xfdba3b=_0x515397?0x0:_0x558436[_0x3bee('0x1a')];var _0x49095a=_0x515397?_0x346767[_0x3bee('0x1c')]:_0x558436[_0x3bee('0x1a')]+_0x558436[_0x3bee('0x1d')];var _0x49b32d;if(_0x49095a>=_0x1582a4){_0x49095a=_0x1582a4;_0x49b32d=0xc8;}else{_0x49b32d=0xce;}_0x5b9473[_0x3bee('0x18')](_0x49b32d);return _0x5b9473[_0x3bee('0x1e')](_0x3bee('0x1f'),_0xfdba3b+'-'+_0x49095a+'/'+_0x1582a4)['json'](_0x346767);}return null;};}function patchUpdates(_0x4f36af){return function(_0x1afd0f){try{jsonpatch[_0x3bee('0x20')](_0x1afd0f,_0x4f36af,!![]);}catch(_0x57aba4){return BPromise[_0x3bee('0x21')](_0x57aba4);}return _0x1afd0f[_0x3bee('0x22')]();};}function saveUpdates(_0x2eea75,_0x179e62){return function(_0x28c248){if(_0x28c248){return _0x28c248[_0x3bee('0x23')](_0x2eea75)[_0x3bee('0x24')](function(_0x582fa9){return _0x582fa9;});}return null;};}function removeEntity(_0x8ae4ca,_0x1ed0c1){return function(_0x1fed5a){if(_0x1fed5a){return _0x1fed5a[_0x3bee('0x25')]()['then'](function(){var _0x45249c=_0x1fed5a[_0x3bee('0x26')]({'plain':!![]});var _0x1e0111='Voicemails';return db['UserProfileResource'][_0x3bee('0x25')]({'where':{'type':_0x1e0111,'resourceId':_0x45249c['id']}})[_0x3bee('0x24')](function(){return _0x1fed5a;});})['then'](function(){_0x8ae4ca[_0x3bee('0x18')](0xcc)[_0x3bee('0x27')]();});}};}function handleEntityNotFound(_0x2e666a,_0x5b1eec){return function(_0x1984c4){if(!_0x1984c4){_0x2e666a[_0x3bee('0x17')](0x194);}return _0x1984c4;};}function handleError(_0x150766,_0x4f2066){_0x4f2066=_0x4f2066||0x1f4;return function(_0x239fa4){logger[_0x3bee('0x28')](_0x239fa4[_0x3bee('0x29')]);if(_0x239fa4['name']){delete _0x239fa4[_0x3bee('0x2a')];}_0x150766[_0x3bee('0x18')](_0x4f2066)[_0x3bee('0x2b')](_0x239fa4);};}exports[_0x3bee('0x2c')]=function(_0x3433aa,_0x559c2b){var _0x564e45={},_0x3fbc8c={},_0x1e1529={'count':0x0,'rows':[]};var _0x10bae0=_[_0x3bee('0x2d')](db['VoiceMail']['rawAttributes'],function(_0x38f93c){return{'name':_0x38f93c[_0x3bee('0x2e')],'type':_0x38f93c['type']['key']};});_0x3fbc8c[_0x3bee('0x2f')]=_[_0x3bee('0x2d')](_0x10bae0,_0x3bee('0x2a'));_0x3fbc8c[_0x3bee('0x30')]=_[_0x3bee('0x31')](_0x3433aa[_0x3bee('0x30')]);_0x3fbc8c[_0x3bee('0x32')]=_[_0x3bee('0x33')](_0x3fbc8c[_0x3bee('0x2f')],_0x3fbc8c[_0x3bee('0x30')]);_0x564e45['attributes']=_['intersection'](_0x3fbc8c[_0x3bee('0x2f')],qs['fields'](_0x3433aa['query'][_0x3bee('0x34')]));_0x564e45[_0x3bee('0x35')]=_0x564e45[_0x3bee('0x35')][_0x3bee('0x36')]?_0x564e45[_0x3bee('0x35')]:_0x3fbc8c[_0x3bee('0x2f')];if(!_0x3433aa[_0x3bee('0x30')][_0x3bee('0x37')]('nolimit')){_0x564e45[_0x3bee('0x1d')]=qs[_0x3bee('0x1d')](_0x3433aa['query'][_0x3bee('0x1d')]);_0x564e45[_0x3bee('0x1a')]=qs[_0x3bee('0x1a')](_0x3433aa[_0x3bee('0x30')][_0x3bee('0x1a')]);}_0x564e45['order']=qs['sort'](_0x3433aa[_0x3bee('0x30')][_0x3bee('0x38')]);_0x564e45[_0x3bee('0x39')]=qs[_0x3bee('0x32')](_[_0x3bee('0x3a')](_0x3433aa[_0x3bee('0x30')],_0x3fbc8c[_0x3bee('0x32')]),_0x10bae0);if(_0x3433aa[_0x3bee('0x30')][_0x3bee('0x3b')]){_0x564e45[_0x3bee('0x39')]=_[_0x3bee('0x3c')](_0x564e45[_0x3bee('0x39')],{'$or':_['map'](_0x10bae0,function(_0xaceed4){if(_0xaceed4[_0x3bee('0x3d')]!==_0x3bee('0x3e')){var _0x45cf81={};_0x45cf81[_0xaceed4[_0x3bee('0x2a')]]={'$like':'%'+_0x3433aa[_0x3bee('0x30')][_0x3bee('0x3b')]+'%'};return _0x45cf81;}})});}_0x564e45=_[_0x3bee('0x3c')]({},_0x564e45,_0x3433aa[_0x3bee('0x3f')]);var _0x12ba6f={'where':_0x564e45[_0x3bee('0x39')]};return db[_0x3bee('0x40')][_0x3bee('0x1c')](_0x12ba6f)['then'](function(_0x2b773d){_0x1e1529[_0x3bee('0x1c')]=_0x2b773d;if(_0x3433aa[_0x3bee('0x30')][_0x3bee('0x41')]){_0x564e45[_0x3bee('0x42')]=[{'all':!![]}];}return db[_0x3bee('0x40')][_0x3bee('0x43')](_0x564e45);})[_0x3bee('0x24')](function(_0x5d9e1b){_0x1e1529[_0x3bee('0x44')]=_0x5d9e1b;return _0x1e1529;})[_0x3bee('0x24')](respondWithFilteredResult(_0x559c2b,_0x564e45))[_0x3bee('0x45')](handleError(_0x559c2b,null));};exports['show']=function(_0x4567f2,_0x57113b){var _0x2b1677={'raw':!![],'where':{'id':_0x4567f2['params']['id']}},_0x48325e={};_0x48325e[_0x3bee('0x2f')]=_[_0x3bee('0x31')](db[_0x3bee('0x40')][_0x3bee('0x46')]);_0x48325e[_0x3bee('0x30')]=_['keys'](_0x4567f2['query']);_0x48325e[_0x3bee('0x32')]=_['intersection'](_0x48325e[_0x3bee('0x2f')],_0x48325e['query']);_0x2b1677[_0x3bee('0x35')]=_['intersection'](_0x48325e[_0x3bee('0x2f')],qs[_0x3bee('0x34')](_0x4567f2[_0x3bee('0x30')][_0x3bee('0x34')]));_0x2b1677['attributes']=_0x2b1677['attributes'][_0x3bee('0x36')]?_0x2b1677['attributes']:_0x48325e['model'];if(_0x4567f2['query'][_0x3bee('0x41')]){_0x2b1677['include']=[{'all':!![]}];}_0x2b1677=_[_0x3bee('0x3c')]({},_0x2b1677,_0x4567f2[_0x3bee('0x3f')]);return db[_0x3bee('0x40')]['find'](_0x2b1677)[_0x3bee('0x24')](handleEntityNotFound(_0x57113b,null))['then'](respondWithResult(_0x57113b,null))[_0x3bee('0x45')](handleError(_0x57113b,null));};exports['create']=function(_0x26ccd7,_0x16b096){return db[_0x3bee('0x40')]['create'](_0x26ccd7[_0x3bee('0x47')],{})[_0x3bee('0x24')](function(_0x477de2){var _0x504382=_0x26ccd7['user'][_0x3bee('0x26')]({'plain':!![]});if(!_0x504382)throw new Error(_0x3bee('0x48'));if(_0x504382[_0x3bee('0x49')]===_0x3bee('0x4a')){var _0x3b5d7a=_0x477de2[_0x3bee('0x26')]({'plain':!![]});var _0x4005a3='Voicemails';return db[_0x3bee('0x4b')][_0x3bee('0x4c')]({'where':{'name':_0x4005a3,'userProfileId':_0x504382['userProfileId']},'raw':!![]})['then'](function(_0x3730c5){if(_0x3730c5&&_0x3730c5['autoAssociation']===0x0){return db[_0x3bee('0x4d')][_0x3bee('0x4e')]({'name':_0x3b5d7a[_0x3bee('0x2a')],'resourceId':_0x3b5d7a['id'],'type':_0x3730c5['name'],'sectionId':_0x3730c5['id']},{})[_0x3bee('0x24')](function(){return _0x477de2;});}else{return _0x477de2;}})[_0x3bee('0x45')](function(_0x127cb8){logger['error'](_0x3bee('0x4f'),_0x127cb8);throw _0x127cb8;});}return _0x477de2;})[_0x3bee('0x24')](respondWithResult(_0x16b096,0xc9))['catch'](handleError(_0x16b096,null));};exports[_0x3bee('0x23')]=function(_0x14940e,_0x53c881){if(_0x14940e[_0x3bee('0x47')]['id']){delete _0x14940e[_0x3bee('0x47')]['id'];}return db[_0x3bee('0x40')][_0x3bee('0x4c')]({'where':{'id':_0x14940e[_0x3bee('0x50')]['id']}})[_0x3bee('0x24')](handleEntityNotFound(_0x53c881,null))[_0x3bee('0x24')](saveUpdates(_0x14940e[_0x3bee('0x47')],null))['then'](respondWithResult(_0x53c881,null))['catch'](handleError(_0x53c881,null));};exports[_0x3bee('0x25')]=function(_0x5e13e8,_0x38b82a){return db[_0x3bee('0x40')][_0x3bee('0x4c')]({'where':{'id':_0x5e13e8['params']['id']}})[_0x3bee('0x24')](handleEntityNotFound(_0x38b82a,null))[_0x3bee('0x24')](removeEntity(_0x38b82a,null))[_0x3bee('0x45')](handleError(_0x38b82a,null));};exports['getMessages']=function(_0x19cbb8,_0x52a327,_0x3cb900){return db[_0x3bee('0x40')][_0x3bee('0x51')]({'where':{'id':_0x19cbb8['params']['id']}})[_0x3bee('0x24')](handleEntityNotFound(_0x52a327,null))[_0x3bee('0x24')](function(_0x282300){var _0x526551;var _0x5d95a7={},_0xb9f53e={};_0xb9f53e[_0x3bee('0x2f')]=_[_0x3bee('0x31')](db['VoiceMailMessage']['rawAttributes']);_0xb9f53e[_0x3bee('0x30')]=_['keys'](_0x19cbb8['query']);_0xb9f53e[_0x3bee('0x32')]=_[_0x3bee('0x33')](_0xb9f53e[_0x3bee('0x2f')],_0xb9f53e['query']);_0x5d95a7['attributes']=_[_0x3bee('0x33')](_0xb9f53e[_0x3bee('0x2f')],qs['fields'](_0x19cbb8[_0x3bee('0x30')]['fields']));_0x5d95a7[_0x3bee('0x35')]=_0x5d95a7[_0x3bee('0x35')][_0x3bee('0x36')]?_0x5d95a7[_0x3bee('0x35')]:_0xb9f53e[_0x3bee('0x2f')];if(!_0x19cbb8[_0x3bee('0x30')][_0x3bee('0x37')](_0x3bee('0x52'))){_0x5d95a7[_0x3bee('0x1d')]=qs[_0x3bee('0x1d')](_0x19cbb8[_0x3bee('0x30')]['limit']);_0x5d95a7['offset']=qs['offset'](_0x19cbb8[_0x3bee('0x30')][_0x3bee('0x1a')]);}_0x5d95a7[_0x3bee('0x53')]=qs[_0x3bee('0x38')](_0x19cbb8['query'][_0x3bee('0x38')]);_0x5d95a7[_0x3bee('0x39')]=qs['filters'](_['pick'](_0x19cbb8[_0x3bee('0x30')],_0xb9f53e[_0x3bee('0x32')]));if(_0x19cbb8[_0x3bee('0x30')]['filter']){_0x5d95a7[_0x3bee('0x39')]=_[_0x3bee('0x3c')](_0x5d95a7[_0x3bee('0x39')],{'$or':_['map'](_0x5d95a7[_0x3bee('0x35')],function(_0x412e0d){var _0x1bfb3a={};_0x1bfb3a[_0x412e0d]={'$like':'%'+_0x19cbb8[_0x3bee('0x30')]['filter']+'%'};return _0x1bfb3a;})});}_0x5d95a7['where']=_[_0x3bee('0x3c')](_0x5d95a7[_0x3bee('0x39')],{'mailboxuser':_0x282300[_0x3bee('0x54')]});_0x5d95a7=_[_0x3bee('0x3c')]({},_0x5d95a7,_0x19cbb8[_0x3bee('0x3f')]);return db['VoiceMailMessage'][_0x3bee('0x55')](_0x5d95a7)['then'](respondWithFilteredResult(_0x52a327,_0x5d95a7));})[_0x3bee('0x45')](handleError(_0x52a327,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 1a52b31..022ba55 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 _0x0d92=['util','api','moment','bluebird','path','rimraf','exports','VoiceMail','mailbox_context','context'];(function(_0x568496,_0x565afd){var _0x26c5c1=function(_0x4d251e){while(--_0x4d251e){_0x568496['push'](_0x568496['shift']());}};_0x26c5c1(++_0x565afd);}(_0x0d92,0x82));var _0x20d9=function(_0x537f68,_0x129b46){_0x537f68=_0x537f68-0x0;var _0x3eff7c=_0x0d92[_0x537f68];return _0x3eff7c;};'use strict';var _=require('lodash');var util=require(_0x20d9('0x0'));var logger=require('../../config/logger')(_0x20d9('0x1'));var moment=require(_0x20d9('0x2'));var BPromise=require(_0x20d9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x20d9('0x4'));var rimraf=require(_0x20d9('0x5'));var config=require('../../config/environment');var attributes=require('./voiceMail.attributes');module[_0x20d9('0x6')]=function(_0x5f597a,_0x554b0){return _0x5f597a['define'](_0x20d9('0x7'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0x20d9('0x8'),'fields':['mailbox',_0x20d9('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x075d=['../../config/environment','VoiceMail','mailbox_context','mailbox','context','util','bluebird','request-promise','path'];(function(_0x25b4a4,_0x2e081b){var _0x707267=function(_0x440123){while(--_0x440123){_0x25b4a4['push'](_0x25b4a4['shift']());}};_0x707267(++_0x2e081b);}(_0x075d,0x1c7));var _0xd075=function(_0x16a6ff,_0x562297){_0x16a6ff=_0x16a6ff-0x0;var _0x2dfd14=_0x075d[_0x16a6ff];return _0x2dfd14;};'use strict';var _=require('lodash');var util=require(_0xd075('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xd075('0x1'));var rp=require(_0xd075('0x2'));var fs=require('fs');var path=require(_0xd075('0x3'));var rimraf=require('rimraf');var config=require(_0xd075('0x4'));var attributes=require('./voiceMail.attributes');module['exports']=function(_0x4f5aaf,_0x46bfb1){return _0x4f5aaf['define'](_0xd075('0x5'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0xd075('0x6'),'fields':[_0xd075('0x7'),_0xd075('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 1fabd35..6af8d5e 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 _0xad08=['request','then','info','VoiceMail,\x20%s,\x20%s','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x568949,_0x817b82){var _0x193b47=function(_0x35d108){while(--_0x35d108){_0x568949['push'](_0x568949['shift']());}};_0x193b47(++_0x817b82);}(_0xad08,0x15b));var _0x8ad0=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xad08[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x8ad0('0x0'));var util=require(_0x8ad0('0x1'));var moment=require(_0x8ad0('0x2'));var BPromise=require(_0x8ad0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8ad0('0x4'))['db'];var utils=require(_0x8ad0('0x5'));var logger=require(_0x8ad0('0x6'))('rpc');var config=require(_0x8ad0('0x7'));var jayson=require(_0x8ad0('0x8'));var client=jayson[_0x8ad0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d462b,_0x5ac45c,_0x1eca2a){return new BPromise(function(_0x3372e9,_0x556120){return client[_0x8ad0('0xa')](_0x3d462b,_0x1eca2a)[_0x8ad0('0xb')](function(_0x1c7532){logger[_0x8ad0('0xc')](_0x8ad0('0xd'),_0x5ac45c,'request\x20sent');logger['debug'](_0x8ad0('0xe'),_0x5ac45c,_0x8ad0('0xf'),JSON[_0x8ad0('0x10')](_0x1c7532));if(_0x1c7532['error']){if(_0x1c7532[_0x8ad0('0x11')]['code']===0x1f4){logger[_0x8ad0('0x11')]('VoiceMail,\x20%s,\x20%s',_0x5ac45c,_0x1c7532[_0x8ad0('0x11')][_0x8ad0('0x12')]);return _0x556120(_0x1c7532[_0x8ad0('0x11')][_0x8ad0('0x12')]);}logger[_0x8ad0('0x11')](_0x8ad0('0xd'),_0x5ac45c,_0x1c7532[_0x8ad0('0x11')][_0x8ad0('0x12')]);return _0x3372e9(_0x1c7532[_0x8ad0('0x11')][_0x8ad0('0x12')]);}else{logger[_0x8ad0('0xc')](_0x8ad0('0xd'),_0x5ac45c,_0x8ad0('0xf'));_0x3372e9(_0x1c7532[_0x8ad0('0x13')]['message']);}})[_0x8ad0('0x14')](function(_0x1ee8df){logger[_0x8ad0('0x11')](_0x8ad0('0xd'),_0x5ac45c,_0x1ee8df);_0x556120(_0x1ee8df);});});} \ No newline at end of file +var _0x1851=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','VoiceMail,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0xfd183f,_0x21bbde){var _0x40b42e=function(_0x5dfbf3){while(--_0x5dfbf3){_0xfd183f['push'](_0xfd183f['shift']());}};_0x40b42e(++_0x21bbde);}(_0x1851,0x11b));var _0x1185=function(_0x20cff8,_0x1bfdf3){_0x20cff8=_0x20cff8-0x0;var _0x3f963a=_0x1851[_0x20cff8];return _0x3f963a;};'use strict';var _=require(_0x1185('0x0'));var util=require(_0x1185('0x1'));var moment=require(_0x1185('0x2'));var BPromise=require(_0x1185('0x3'));var rs=require(_0x1185('0x4'));var fs=require('fs');var Redis=require(_0x1185('0x5'));var db=require(_0x1185('0x6'))['db'];var utils=require(_0x1185('0x7'));var logger=require(_0x1185('0x8'))('rpc');var config=require(_0x1185('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1185('0xa')][_0x1185('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2ed147,_0xdef99a,_0x55af48){return new BPromise(function(_0x53aa56,_0x5787eb){return client[_0x1185('0xc')](_0x2ed147,_0x55af48)['then'](function(_0x139c29){logger[_0x1185('0xd')](_0x1185('0xe'),_0xdef99a,_0x1185('0xf'));logger['debug']('VoiceMail,\x20%s,\x20%s,\x20%s',_0xdef99a,_0x1185('0xf'),JSON[_0x1185('0x10')](_0x139c29));if(_0x139c29[_0x1185('0x11')]){if(_0x139c29['error'][_0x1185('0x12')]===0x1f4){logger['error']('VoiceMail,\x20%s,\x20%s',_0xdef99a,_0x139c29['error'][_0x1185('0x13')]);return _0x5787eb(_0x139c29[_0x1185('0x11')][_0x1185('0x13')]);}logger['error'](_0x1185('0xe'),_0xdef99a,_0x139c29['error'][_0x1185('0x13')]);return _0x53aa56(_0x139c29[_0x1185('0x11')][_0x1185('0x13')]);}else{logger['info'](_0x1185('0xe'),_0xdef99a,'request\x20sent');_0x53aa56(_0x139c29[_0x1185('0x14')][_0x1185('0x13')]);}})[_0x1185('0x15')](function(_0x5016f9){logger[_0x1185('0x11')](_0x1185('0xe'),_0xdef99a,_0x5016f9);_0x5787eb(_0x5016f9);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 89e2b27..22b889f 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 _0xb935=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','isAuthenticated','index','get','/:id','show','/:id/download','post','create','put','update','delete','destroy','exports','multer','util','express'];(function(_0xb22b23,_0x3d42b1){var _0x1e696f=function(_0x31a9da){while(--_0x31a9da){_0xb22b23['push'](_0xb22b23['shift']());}};_0x1e696f(++_0x3d42b1);}(_0xb935,0x6b));var _0x5b93=function(_0x4dff8e,_0x31da93){_0x4dff8e=_0x4dff8e-0x0;var _0x53075c=_0xb935[_0x4dff8e];return _0x53075c;};'use strict';var multer=require(_0x5b93('0x0'));var util=require(_0x5b93('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5b93('0x2'));var router=express[_0x5b93('0x3')]();var fs_extra=require(_0x5b93('0x4'));var auth=require(_0x5b93('0x5'));var interaction=require(_0x5b93('0x6'));var config=require(_0x5b93('0x7'));var controller=require(_0x5b93('0x8'));router['get']('/',auth[_0x5b93('0x9')](),controller[_0x5b93('0xa')]);router[_0x5b93('0xb')](_0x5b93('0xc'),auth['isAuthenticated'](),controller[_0x5b93('0xd')]);router['get'](_0x5b93('0xe'),auth[_0x5b93('0x9')](),controller['download']);router[_0x5b93('0xf')]('/',auth[_0x5b93('0x9')](),controller[_0x5b93('0x10')]);router[_0x5b93('0x11')](_0x5b93('0xc'),auth[_0x5b93('0x9')](),controller[_0x5b93('0x12')]);router[_0x5b93('0x13')](_0x5b93('0xc'),auth[_0x5b93('0x9')](),controller[_0x5b93('0x14')]);module[_0x5b93('0x15')]=router; \ No newline at end of file +var _0x1aa8=['get','isAuthenticated','index','/:id','show','/:id/download','download','put','update','delete','destroy','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4aa4e6,_0x278c45){var _0x322588=function(_0x19279d){while(--_0x19279d){_0x4aa4e6['push'](_0x4aa4e6['shift']());}};_0x322588(++_0x278c45);}(_0x1aa8,0x82));var _0x81aa=function(_0x42e1ec,_0x19aacc){_0x42e1ec=_0x42e1ec-0x0;var _0xe8c124=_0x1aa8[_0x42e1ec];return _0xe8c124;};'use strict';var multer=require(_0x81aa('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x81aa('0x1'));var express=require(_0x81aa('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x81aa('0x3'));var interaction=require(_0x81aa('0x4'));var config=require(_0x81aa('0x5'));var controller=require('./voiceMailMessage.controller');router[_0x81aa('0x6')]('/',auth[_0x81aa('0x7')](),controller[_0x81aa('0x8')]);router['get'](_0x81aa('0x9'),auth['isAuthenticated'](),controller[_0x81aa('0xa')]);router[_0x81aa('0x6')](_0x81aa('0xb'),auth[_0x81aa('0x7')](),controller[_0x81aa('0xc')]);router['post']('/',auth[_0x81aa('0x7')](),controller['create']);router[_0x81aa('0xd')](_0x81aa('0x9'),auth['isAuthenticated'](),controller[_0x81aa('0xe')]);router[_0x81aa('0xf')](_0x81aa('0x9'),auth[_0x81aa('0x7')](),controller[_0x81aa('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index e78fae8..1af0fae 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 _0xc14d=['STRING','BLOB','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc14d,0x175));var _0xdc14=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xc14d[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0xdc14('0x0'));module[_0xdc14('0x1')]={'name':{'type':Sequelize[_0xdc14('0x2')],'get':function(_0x5d46d3){return this[_0xdc14('0x3')]('id');}},'msgnum':{'type':Sequelize[_0xdc14('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xdc14('0x5')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0xdc14('0x5')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0xdc14('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xdc14('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xdc14('0x5')],'defaultValue':''},'recording':{'type':Sequelize[_0xdc14('0x6')]('long'),'defaultValue':null},'flag':{'type':Sequelize[_0xdc14('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xdc14('0x5')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0xdc14('0x7')](_0xdc14('0x8'))}}; \ No newline at end of file +var _0xdbe2=['sequelize','exports','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP'];(function(_0x7afa9a,_0x1c61a1){var _0xc81e5f=function(_0x4891c5){while(--_0x4891c5){_0x7afa9a['push'](_0x7afa9a['shift']());}};_0xc81e5f(++_0x1c61a1);}(_0xdbe2,0xbb));var _0x2dbe=function(_0x218419,_0x57f42c){_0x218419=_0x218419-0x0;var _0xe4f396=_0xdbe2[_0x218419];return _0xe4f396;};'use strict';var Sequelize=require(_0x2dbe('0x0'));module[_0x2dbe('0x1')]={'name':{'type':Sequelize[_0x2dbe('0x2')],'get':function(_0x36750e){return this[_0x2dbe('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x2dbe('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0x2dbe('0x5')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x2dbe('0x5')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0x2dbe('0x5')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x2dbe('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x2dbe('0x5')],'defaultValue':''},'recording':{'type':Sequelize[_0x2dbe('0x6')](_0x2dbe('0x7')),'defaultValue':null},'flag':{'type':Sequelize[_0x2dbe('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x2dbe('0x5')],'defaultValue':''},'stamp':{'type':_0x2dbe('0x8'),'defaultValue':Sequelize[_0x2dbe('0x9')](_0x2dbe('0xa'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 8d7329c..65b8f34 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 _0xd744=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','status','error','name','send','index','VoiceMailMessage','rawAttributes','fieldName','key','differenceBy','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','pick','where','map','type','VIRTUAL','filter','merge','options','include','catch','show','params','includeAll','find','create','body','download','msg_id','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto'];(function(_0x39345,_0x2201ba){var _0xa00d28=function(_0x43c2d9){while(--_0x43c2d9){_0x39345['push'](_0x39345['shift']());}};_0xa00d28(++_0x2201ba);}(_0xd744,0xfa));var _0x4d74=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xd744[_0x2c91e9];return _0x13f0ff;};'use strict';var emlformat=require(_0x4d74('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4d74('0x1'));var jsonpatch=require(_0x4d74('0x2'));var rp=require(_0x4d74('0x3'));var moment=require(_0x4d74('0x4'));var BPromise=require(_0x4d74('0x5'));var Mustache=require(_0x4d74('0x6'));var util=require(_0x4d74('0x7'));var path=require(_0x4d74('0x8'));var sox=require('sox');var csv=require(_0x4d74('0x9'));var ejs=require(_0x4d74('0xa'));var fs=require('fs');var fs_extra=require(_0x4d74('0xb'));var _=require('lodash');var squel=require(_0x4d74('0xc'));var crypto=require(_0x4d74('0xd'));var jsforce=require(_0x4d74('0xe'));var deskjs=require(_0x4d74('0xf'));var toCsv=require(_0x4d74('0x9'));var querystring=require(_0x4d74('0x10'));var Papa=require(_0x4d74('0x11'));var Redis=require(_0x4d74('0x12'));var authService=require(_0x4d74('0x13'));var qs=require(_0x4d74('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4d74('0x15'));var logger=require(_0x4d74('0x16'))('api');var utils=require(_0x4d74('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4d74('0x18'));var db=require(_0x4d74('0x19'))['db'];function respondWithStatusCode(_0x1d916a,_0x4fd007){_0x4fd007=_0x4fd007||0xcc;return function(_0x5c3fca){if(_0x5c3fca){return _0x1d916a[_0x4d74('0x1a')](_0x4fd007);}return _0x1d916a['status'](_0x4fd007)[_0x4d74('0x1b')]();};}function respondWithResult(_0x1ec785,_0x43ad65){_0x43ad65=_0x43ad65||0xc8;return function(_0x367196){if(_0x367196){return _0x1ec785['status'](_0x43ad65)['json'](_0x367196);}};}function respondWithFilteredResult(_0x1d39e9,_0x4a0895){return function(_0x20f024){if(_0x20f024){var _0x7fe580=typeof _0x4a0895['offset']===_0x4d74('0x1c')&&typeof _0x4a0895['limit']==='undefined';var _0x2ee3f7=_0x20f024[_0x4d74('0x1d')];var _0x54c91e=_0x7fe580?0x0:_0x4a0895[_0x4d74('0x1e')];var _0x2d6f82=_0x7fe580?_0x20f024[_0x4d74('0x1d')]:_0x4a0895['offset']+_0x4a0895[_0x4d74('0x1f')];var _0x4b7b41;if(_0x2d6f82>=_0x2ee3f7){_0x2d6f82=_0x2ee3f7;_0x4b7b41=0xc8;}else{_0x4b7b41=0xce;}_0x1d39e9['status'](_0x4b7b41);return _0x1d39e9[_0x4d74('0x20')](_0x4d74('0x21'),_0x54c91e+'-'+_0x2d6f82+'/'+_0x2ee3f7)[_0x4d74('0x22')](_0x20f024);}return null;};}function patchUpdates(_0x17e6c1){return function(_0xf0a5ec){try{jsonpatch[_0x4d74('0x23')](_0xf0a5ec,_0x17e6c1,!![]);}catch(_0x5d5728){return BPromise[_0x4d74('0x24')](_0x5d5728);}return _0xf0a5ec[_0x4d74('0x25')]();};}function saveUpdates(_0x5297fc,_0x2a765b){return function(_0x551312){if(_0x551312){return _0x551312[_0x4d74('0x26')](_0x5297fc)[_0x4d74('0x27')](function(_0x42291c){return _0x42291c;});}return null;};}function removeEntity(_0xd19c22,_0x46e19b){return function(_0x56b510){if(_0x56b510){return _0x56b510[_0x4d74('0x28')]()[_0x4d74('0x27')](function(){_0xd19c22[_0x4d74('0x29')](0xcc)[_0x4d74('0x1b')]();});}};}function handleEntityNotFound(_0x325645,_0xd4bca){return function(_0x532b0b){if(!_0x532b0b){_0x325645['sendStatus'](0x194);}return _0x532b0b;};}function handleError(_0x2d5305,_0x477961){_0x477961=_0x477961||0x1f4;return function(_0xe9de36){logger[_0x4d74('0x2a')](_0xe9de36['stack']);if(_0xe9de36[_0x4d74('0x2b')]){delete _0xe9de36[_0x4d74('0x2b')];}_0x2d5305[_0x4d74('0x29')](_0x477961)[_0x4d74('0x2c')](_0xe9de36);};}exports[_0x4d74('0x2d')]=function(_0x24c30e,_0x1901f2){var _0x12d5dd={},_0x3c1090={},_0x349578={'count':0x0,'rows':[]};var _0x1a85f8=_['map'](db[_0x4d74('0x2e')][_0x4d74('0x2f')],function(_0x29e67e){return{'name':_0x29e67e[_0x4d74('0x30')],'type':_0x29e67e['type'][_0x4d74('0x31')]};});_0x3c1090['model']=_[_0x4d74('0x32')](_['map'](_0x1a85f8,'name'),['name']);_0x3c1090['query']=_[_0x4d74('0x33')](_0x24c30e[_0x4d74('0x34')]);_0x3c1090[_0x4d74('0x35')]=_[_0x4d74('0x36')](_0x3c1090[_0x4d74('0x37')],_0x3c1090[_0x4d74('0x34')]);_0x12d5dd['attributes']=_['intersection'](_0x3c1090[_0x4d74('0x37')],qs[_0x4d74('0x38')](_0x24c30e['query'][_0x4d74('0x38')]));_0x12d5dd[_0x4d74('0x39')]=_0x12d5dd[_0x4d74('0x39')][_0x4d74('0x3a')]?_0x12d5dd[_0x4d74('0x39')]:_0x3c1090['model'];if(!_0x24c30e[_0x4d74('0x34')][_0x4d74('0x3b')]('nolimit')){_0x12d5dd[_0x4d74('0x1f')]=qs[_0x4d74('0x1f')](_0x24c30e['query'][_0x4d74('0x1f')]);_0x12d5dd[_0x4d74('0x1e')]=qs[_0x4d74('0x1e')](_0x24c30e[_0x4d74('0x34')][_0x4d74('0x1e')]);}_0x12d5dd[_0x4d74('0x3c')]=qs[_0x4d74('0x3d')](_0x24c30e['query'][_0x4d74('0x3d')]);_0x12d5dd['where']=qs[_0x4d74('0x35')](_[_0x4d74('0x3e')](_0x24c30e['query'],_0x3c1090[_0x4d74('0x35')]),_0x1a85f8);if(_0x24c30e[_0x4d74('0x34')]['filter']){_0x12d5dd[_0x4d74('0x3f')]=_['merge'](_0x12d5dd[_0x4d74('0x3f')],{'$or':_[_0x4d74('0x40')](_0x1a85f8,function(_0x2060e0){if(_0x2060e0[_0x4d74('0x41')]!==_0x4d74('0x42')){var _0x535544={};_0x535544[_0x2060e0[_0x4d74('0x2b')]]={'$like':'%'+_0x24c30e[_0x4d74('0x34')][_0x4d74('0x43')]+'%'};return _0x535544;}})});}_0x12d5dd=_[_0x4d74('0x44')]({},_0x12d5dd,_0x24c30e[_0x4d74('0x45')]);var _0x14f77e={'where':_0x12d5dd[_0x4d74('0x3f')]};return db[_0x4d74('0x2e')]['count'](_0x14f77e)[_0x4d74('0x27')](function(_0x3e1874){_0x349578[_0x4d74('0x1d')]=_0x3e1874;if(_0x24c30e[_0x4d74('0x34')]['includeAll']){_0x12d5dd[_0x4d74('0x46')]=[{'all':!![]}];}return db[_0x4d74('0x2e')]['findAll'](_0x12d5dd);})[_0x4d74('0x27')](function(_0x5258ed){_0x349578['rows']=_0x5258ed;return _0x349578;})['then'](respondWithFilteredResult(_0x1901f2,_0x12d5dd))[_0x4d74('0x47')](handleError(_0x1901f2,null));};exports[_0x4d74('0x48')]=function(_0x30f8b3,_0x46d9aa){var _0x2f1431={'raw':!![],'where':{'id':_0x30f8b3[_0x4d74('0x49')]['id']}},_0x2419b3={};_0x2419b3[_0x4d74('0x37')]=_[_0x4d74('0x33')](db['VoiceMailMessage'][_0x4d74('0x2f')]);_0x2419b3[_0x4d74('0x34')]=_['keys'](_0x30f8b3[_0x4d74('0x34')]);_0x2419b3[_0x4d74('0x35')]=_['intersection'](_0x2419b3[_0x4d74('0x37')],_0x2419b3[_0x4d74('0x34')]);_0x2f1431[_0x4d74('0x39')]=_[_0x4d74('0x36')](_0x2419b3['model'],qs[_0x4d74('0x38')](_0x30f8b3[_0x4d74('0x34')][_0x4d74('0x38')]));_0x2f1431[_0x4d74('0x39')]=_0x2f1431['attributes']['length']?_0x2f1431[_0x4d74('0x39')]:_0x2419b3[_0x4d74('0x37')];if(_0x30f8b3[_0x4d74('0x34')][_0x4d74('0x4a')]){_0x2f1431[_0x4d74('0x46')]=[{'all':!![]}];}_0x2f1431=_[_0x4d74('0x44')]({},_0x2f1431,_0x30f8b3[_0x4d74('0x45')]);return db[_0x4d74('0x2e')][_0x4d74('0x4b')](_0x2f1431)[_0x4d74('0x27')](handleEntityNotFound(_0x46d9aa,null))[_0x4d74('0x27')](respondWithResult(_0x46d9aa,null))[_0x4d74('0x47')](handleError(_0x46d9aa,null));};exports[_0x4d74('0x4c')]=function(_0x1769be,_0x5ceef6){return db[_0x4d74('0x2e')][_0x4d74('0x4c')](_0x1769be[_0x4d74('0x4d')],{})[_0x4d74('0x27')](respondWithResult(_0x5ceef6,0xc9))[_0x4d74('0x47')](handleError(_0x5ceef6,null));};exports['update']=function(_0x1c5264,_0xd3715b){if(_0x1c5264[_0x4d74('0x4d')]['id']){delete _0x1c5264[_0x4d74('0x4d')]['id'];}return db[_0x4d74('0x2e')][_0x4d74('0x4b')]({'where':{'id':_0x1c5264['params']['id']}})[_0x4d74('0x27')](handleEntityNotFound(_0xd3715b,null))[_0x4d74('0x27')](saveUpdates(_0x1c5264[_0x4d74('0x4d')],null))[_0x4d74('0x27')](respondWithResult(_0xd3715b,null))[_0x4d74('0x47')](handleError(_0xd3715b,null));};exports['destroy']=function(_0xb375d8,_0x30dfa4){return db[_0x4d74('0x2e')][_0x4d74('0x4b')]({'where':{'id':_0xb375d8[_0x4d74('0x49')]['id']}})['then'](handleEntityNotFound(_0x30dfa4,null))[_0x4d74('0x27')](removeEntity(_0x30dfa4,null))['catch'](handleError(_0x30dfa4,null));};exports[_0x4d74('0x4e')]=function(_0x22bcf5,_0x38a85b,_0x5b8854){return db['VoiceMailMessage'][_0x4d74('0x4b')]({'where':{'id':_0x22bcf5[_0x4d74('0x49')]['id']},'attributes':['id','recording',_0x4d74('0x4f')]})['then'](handleEntityNotFound(_0x38a85b,null))[_0x4d74('0x27')](function(_0x372abc){if(_0x372abc){if(!_0x372abc[_0x4d74('0x50')]){throw new db[(_0x4d74('0x51'))][(_0x4d74('0x52'))](_0x4d74('0x53'));}var _0x5a89f1={'Content-Type':_0x4d74('0x54'),'Content-Disposition':'attachment'};if(_0x372abc[_0x4d74('0x4f')]){_0x5a89f1[_0x4d74('0x55')]=_0x4d74('0x56')+_0x372abc[_0x4d74('0x4f')]+_0x4d74('0x57');}_0x38a85b[_0x4d74('0x20')](_0x5a89f1);return _0x38a85b['send'](new Buffer(_0x372abc['recording']));}})['catch'](handleError(_0x38a85b,null));}; \ No newline at end of file +var _0x4d2c=['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/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','end','error','stack','name','send','VoiceMailMessage','rawAttributes','fieldName','type','key','differenceBy','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','include','findAll','rows','catch','show','params','includeAll','find','create','body','update','destroy','download','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','Content-Disposition','attachment;\x20filename=\x22','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox'];(function(_0x27c4a0,_0x4c0d19){var _0x41f630=function(_0x3a0445){while(--_0x3a0445){_0x27c4a0['push'](_0x27c4a0['shift']());}};_0x41f630(++_0x4c0d19);}(_0x4d2c,0x1a6));var _0xc4d2=function(_0x280527,_0x55e080){_0x280527=_0x280527-0x0;var _0x148371=_0x4d2c[_0x280527];return _0x148371;};'use strict';var emlformat=require(_0xc4d2('0x0'));var rimraf=require(_0xc4d2('0x1'));var zipdir=require(_0xc4d2('0x2'));var jsonpatch=require(_0xc4d2('0x3'));var rp=require('request-promise');var moment=require(_0xc4d2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc4d2('0x5'));var util=require(_0xc4d2('0x6'));var path=require('path');var sox=require(_0xc4d2('0x7'));var csv=require(_0xc4d2('0x8'));var ejs=require(_0xc4d2('0x9'));var fs=require('fs');var fs_extra=require(_0xc4d2('0xa'));var _=require(_0xc4d2('0xb'));var squel=require(_0xc4d2('0xc'));var crypto=require(_0xc4d2('0xd'));var jsforce=require(_0xc4d2('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc4d2('0x8'));var querystring=require('querystring');var Papa=require(_0xc4d2('0xf'));var Redis=require(_0xc4d2('0x10'));var authService=require(_0xc4d2('0x11'));var qs=require(_0xc4d2('0x12'));var as=require(_0xc4d2('0x13'));var hardwareService=require(_0xc4d2('0x14'));var logger=require(_0xc4d2('0x15'))(_0xc4d2('0x16'));var utils=require(_0xc4d2('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xc4d2('0x18'));var db=require(_0xc4d2('0x19'))['db'];function respondWithStatusCode(_0x3627b7,_0xdd6595){_0xdd6595=_0xdd6595||0xcc;return function(_0x123eb2){if(_0x123eb2){return _0x3627b7[_0xc4d2('0x1a')](_0xdd6595);}return _0x3627b7['status'](_0xdd6595)['end']();};}function respondWithResult(_0x39ab47,_0x5ef34f){_0x5ef34f=_0x5ef34f||0xc8;return function(_0x1c60cc){if(_0x1c60cc){return _0x39ab47[_0xc4d2('0x1b')](_0x5ef34f)[_0xc4d2('0x1c')](_0x1c60cc);}};}function respondWithFilteredResult(_0x49fe3f,_0x1faf64){return function(_0x5bdb2f){if(_0x5bdb2f){var _0x57cdb7=typeof _0x1faf64[_0xc4d2('0x1d')]===_0xc4d2('0x1e')&&typeof _0x1faf64[_0xc4d2('0x1f')]===_0xc4d2('0x1e');var _0xbca93b=_0x5bdb2f['count'];var _0x304e31=_0x57cdb7?0x0:_0x1faf64[_0xc4d2('0x1d')];var _0x4bfbfb=_0x57cdb7?_0x5bdb2f[_0xc4d2('0x20')]:_0x1faf64[_0xc4d2('0x1d')]+_0x1faf64[_0xc4d2('0x1f')];var _0xd453dd;if(_0x4bfbfb>=_0xbca93b){_0x4bfbfb=_0xbca93b;_0xd453dd=0xc8;}else{_0xd453dd=0xce;}_0x49fe3f[_0xc4d2('0x1b')](_0xd453dd);return _0x49fe3f[_0xc4d2('0x21')](_0xc4d2('0x22'),_0x304e31+'-'+_0x4bfbfb+'/'+_0xbca93b)[_0xc4d2('0x1c')](_0x5bdb2f);}return null;};}function patchUpdates(_0x5ac595){return function(_0x5e07d0){try{jsonpatch[_0xc4d2('0x23')](_0x5e07d0,_0x5ac595,!![]);}catch(_0x321120){return BPromise['reject'](_0x321120);}return _0x5e07d0[_0xc4d2('0x24')]();};}function saveUpdates(_0x4a032d,_0x503822){return function(_0x35bfb3){if(_0x35bfb3){return _0x35bfb3['update'](_0x4a032d)[_0xc4d2('0x25')](function(_0x57c638){return _0x57c638;});}return null;};}function removeEntity(_0x4f76a5,_0x5be6ff){return function(_0xdf003e){if(_0xdf003e){return _0xdf003e['destroy']()[_0xc4d2('0x25')](function(){_0x4f76a5[_0xc4d2('0x1b')](0xcc)[_0xc4d2('0x26')]();});}};}function handleEntityNotFound(_0x34cdff,_0x36adf4){return function(_0x2626b6){if(!_0x2626b6){_0x34cdff[_0xc4d2('0x1a')](0x194);}return _0x2626b6;};}function handleError(_0x4e284f,_0x1c2ce1){_0x1c2ce1=_0x1c2ce1||0x1f4;return function(_0x4da96f){logger[_0xc4d2('0x27')](_0x4da96f[_0xc4d2('0x28')]);if(_0x4da96f[_0xc4d2('0x29')]){delete _0x4da96f['name'];}_0x4e284f['status'](_0x1c2ce1)[_0xc4d2('0x2a')](_0x4da96f);};}exports['index']=function(_0x1dbb55,_0x34fd99){var _0x347ad0={},_0x18a070={},_0x51d1f5={'count':0x0,'rows':[]};var _0x29e118=_['map'](db[_0xc4d2('0x2b')][_0xc4d2('0x2c')],function(_0x456719){return{'name':_0x456719[_0xc4d2('0x2d')],'type':_0x456719[_0xc4d2('0x2e')][_0xc4d2('0x2f')]};});_0x18a070['model']=_[_0xc4d2('0x30')](_[_0xc4d2('0x31')](_0x29e118,'name'),['name']);_0x18a070[_0xc4d2('0x32')]=_[_0xc4d2('0x33')](_0x1dbb55[_0xc4d2('0x32')]);_0x18a070[_0xc4d2('0x34')]=_[_0xc4d2('0x35')](_0x18a070[_0xc4d2('0x36')],_0x18a070[_0xc4d2('0x32')]);_0x347ad0[_0xc4d2('0x37')]=_['intersection'](_0x18a070['model'],qs[_0xc4d2('0x38')](_0x1dbb55[_0xc4d2('0x32')][_0xc4d2('0x38')]));_0x347ad0[_0xc4d2('0x37')]=_0x347ad0[_0xc4d2('0x37')][_0xc4d2('0x39')]?_0x347ad0[_0xc4d2('0x37')]:_0x18a070[_0xc4d2('0x36')];if(!_0x1dbb55['query'][_0xc4d2('0x3a')]('nolimit')){_0x347ad0['limit']=qs['limit'](_0x1dbb55['query'][_0xc4d2('0x1f')]);_0x347ad0['offset']=qs[_0xc4d2('0x1d')](_0x1dbb55[_0xc4d2('0x32')][_0xc4d2('0x1d')]);}_0x347ad0[_0xc4d2('0x3b')]=qs[_0xc4d2('0x3c')](_0x1dbb55[_0xc4d2('0x32')][_0xc4d2('0x3c')]);_0x347ad0[_0xc4d2('0x3d')]=qs[_0xc4d2('0x34')](_[_0xc4d2('0x3e')](_0x1dbb55[_0xc4d2('0x32')],_0x18a070[_0xc4d2('0x34')]),_0x29e118);if(_0x1dbb55[_0xc4d2('0x32')][_0xc4d2('0x3f')]){_0x347ad0['where']=_[_0xc4d2('0x40')](_0x347ad0[_0xc4d2('0x3d')],{'$or':_[_0xc4d2('0x31')](_0x29e118,function(_0x42100d){if(_0x42100d[_0xc4d2('0x2e')]!=='VIRTUAL'){var _0xd1521d={};_0xd1521d[_0x42100d[_0xc4d2('0x29')]]={'$like':'%'+_0x1dbb55[_0xc4d2('0x32')][_0xc4d2('0x3f')]+'%'};return _0xd1521d;}})});}_0x347ad0=_[_0xc4d2('0x40')]({},_0x347ad0,_0x1dbb55['options']);var _0x3aa7e8={'where':_0x347ad0[_0xc4d2('0x3d')]};return db['VoiceMailMessage'][_0xc4d2('0x20')](_0x3aa7e8)[_0xc4d2('0x25')](function(_0x407aa0){_0x51d1f5[_0xc4d2('0x20')]=_0x407aa0;if(_0x1dbb55[_0xc4d2('0x32')]['includeAll']){_0x347ad0[_0xc4d2('0x41')]=[{'all':!![]}];}return db[_0xc4d2('0x2b')][_0xc4d2('0x42')](_0x347ad0);})['then'](function(_0x24c714){_0x51d1f5[_0xc4d2('0x43')]=_0x24c714;return _0x51d1f5;})[_0xc4d2('0x25')](respondWithFilteredResult(_0x34fd99,_0x347ad0))[_0xc4d2('0x44')](handleError(_0x34fd99,null));};exports[_0xc4d2('0x45')]=function(_0x17a413,_0x1e7c03){var _0x4eb76f={'raw':!![],'where':{'id':_0x17a413[_0xc4d2('0x46')]['id']}},_0x48cc9a={};_0x48cc9a[_0xc4d2('0x36')]=_['keys'](db[_0xc4d2('0x2b')][_0xc4d2('0x2c')]);_0x48cc9a[_0xc4d2('0x32')]=_[_0xc4d2('0x33')](_0x17a413[_0xc4d2('0x32')]);_0x48cc9a[_0xc4d2('0x34')]=_[_0xc4d2('0x35')](_0x48cc9a[_0xc4d2('0x36')],_0x48cc9a[_0xc4d2('0x32')]);_0x4eb76f[_0xc4d2('0x37')]=_['intersection'](_0x48cc9a[_0xc4d2('0x36')],qs['fields'](_0x17a413[_0xc4d2('0x32')]['fields']));_0x4eb76f[_0xc4d2('0x37')]=_0x4eb76f['attributes'][_0xc4d2('0x39')]?_0x4eb76f['attributes']:_0x48cc9a[_0xc4d2('0x36')];if(_0x17a413[_0xc4d2('0x32')][_0xc4d2('0x47')]){_0x4eb76f[_0xc4d2('0x41')]=[{'all':!![]}];}_0x4eb76f=_[_0xc4d2('0x40')]({},_0x4eb76f,_0x17a413['options']);return db[_0xc4d2('0x2b')][_0xc4d2('0x48')](_0x4eb76f)['then'](handleEntityNotFound(_0x1e7c03,null))[_0xc4d2('0x25')](respondWithResult(_0x1e7c03,null))[_0xc4d2('0x44')](handleError(_0x1e7c03,null));};exports['create']=function(_0x271350,_0x89df62){return db[_0xc4d2('0x2b')][_0xc4d2('0x49')](_0x271350[_0xc4d2('0x4a')],{})[_0xc4d2('0x25')](respondWithResult(_0x89df62,0xc9))[_0xc4d2('0x44')](handleError(_0x89df62,null));};exports[_0xc4d2('0x4b')]=function(_0x2f3c5d,_0x46f564){if(_0x2f3c5d[_0xc4d2('0x4a')]['id']){delete _0x2f3c5d[_0xc4d2('0x4a')]['id'];}return db[_0xc4d2('0x2b')][_0xc4d2('0x48')]({'where':{'id':_0x2f3c5d[_0xc4d2('0x46')]['id']}})[_0xc4d2('0x25')](handleEntityNotFound(_0x46f564,null))[_0xc4d2('0x25')](saveUpdates(_0x2f3c5d[_0xc4d2('0x4a')],null))['then'](respondWithResult(_0x46f564,null))[_0xc4d2('0x44')](handleError(_0x46f564,null));};exports[_0xc4d2('0x4c')]=function(_0x401000,_0x4bc0aa){return db[_0xc4d2('0x2b')][_0xc4d2('0x48')]({'where':{'id':_0x401000['params']['id']}})[_0xc4d2('0x25')](handleEntityNotFound(_0x4bc0aa,null))['then'](removeEntity(_0x4bc0aa,null))[_0xc4d2('0x44')](handleError(_0x4bc0aa,null));};exports[_0xc4d2('0x4d')]=function(_0x2fa017,_0x5558c7,_0x32c86b){return db['VoiceMailMessage'][_0xc4d2('0x48')]({'where':{'id':_0x2fa017[_0xc4d2('0x46')]['id']},'attributes':['id',_0xc4d2('0x4e'),_0xc4d2('0x4f')]})[_0xc4d2('0x25')](handleEntityNotFound(_0x5558c7,null))[_0xc4d2('0x25')](function(_0x3895ee){if(_0x3895ee){if(!_0x3895ee[_0xc4d2('0x4e')]){throw new db[(_0xc4d2('0x50'))][(_0xc4d2('0x51'))](_0xc4d2('0x52'));}var _0x46764d={'Content-Type':_0xc4d2('0x53'),'Content-Disposition':'attachment'};if(_0x3895ee[_0xc4d2('0x4f')]){_0x46764d[_0xc4d2('0x54')]=_0xc4d2('0x55')+_0x3895ee['msg_id']+'.wav\x22';}_0x5558c7[_0xc4d2('0x21')](_0x46764d);return _0x5558c7[_0xc4d2('0x2a')](new Buffer(_0x3895ee[_0xc4d2('0x4e')]));}})['catch'](handleError(_0x5558c7,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 09dbf2b..c2f01d0 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 _0xa018=['../../config/environment','./voiceMailMessage.attributes','exports','define','voice_voicemail_messages','dir','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x2f7cc2,_0x23f401){var _0x456e23=function(_0xf47957){while(--_0xf47957){_0x2f7cc2['push'](_0x2f7cc2['shift']());}};_0x456e23(++_0x23f401);}(_0xa018,0x117));var _0x8a01=function(_0x36164e,_0xc96465){_0x36164e=_0x36164e-0x0;var _0x183256=_0xa018[_0x36164e];return _0x183256;};'use strict';var _=require(_0x8a01('0x0'));var util=require(_0x8a01('0x1'));var logger=require(_0x8a01('0x2'))('api');var moment=require(_0x8a01('0x3'));var BPromise=require(_0x8a01('0x4'));var rp=require(_0x8a01('0x5'));var fs=require('fs');var path=require(_0x8a01('0x6'));var rimraf=require('rimraf');var config=require(_0x8a01('0x7'));var attributes=require(_0x8a01('0x8'));module[_0x8a01('0x9')]=function(_0x1fa2c3,_0x3657ac){return _0x1fa2c3[_0x8a01('0xa')]('VoiceMailMessage',attributes,{'tableName':_0x8a01('0xb'),'paranoid':![],'indexes':[{'name':_0x8a01('0xc'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file +var _0x9e72=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','voice_voicemail_messages','dir','lodash','util'];(function(_0x560a6d,_0x34a36f){var _0xcd45da=function(_0x3f06b4){while(--_0x3f06b4){_0x560a6d['push'](_0x560a6d['shift']());}};_0xcd45da(++_0x34a36f);}(_0x9e72,0x11c));var _0x29e7=function(_0xae5502,_0x732c65){_0xae5502=_0xae5502-0x0;var _0x215464=_0x9e72[_0xae5502];return _0x215464;};'use strict';var _=require(_0x29e7('0x0'));var util=require(_0x29e7('0x1'));var logger=require('../../config/logger')(_0x29e7('0x2'));var moment=require(_0x29e7('0x3'));var BPromise=require(_0x29e7('0x4'));var rp=require(_0x29e7('0x5'));var fs=require('fs');var path=require(_0x29e7('0x6'));var rimraf=require(_0x29e7('0x7'));var config=require(_0x29e7('0x8'));var attributes=require(_0x29e7('0x9'));module[_0x29e7('0xa')]=function(_0x39aaa0,_0x48748c){return _0x39aaa0['define']('VoiceMailMessage',attributes,{'tableName':_0x29e7('0xb'),'paranoid':![],'indexes':[{'name':_0x29e7('0xc'),'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 048ba78..e7d588f 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 _0x8606=['then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x531c31,_0x158a98){var _0x39d76c=function(_0x8f365a){while(--_0x8f365a){_0x531c31['push'](_0x531c31['shift']());}};_0x39d76c(++_0x158a98);}(_0x8606,0x180));var _0x6860=function(_0x1e02a7,_0x4d8558){_0x1e02a7=_0x1e02a7-0x0;var _0x5db9f6=_0x8606[_0x1e02a7];return _0x5db9f6;};'use strict';var _=require(_0x6860('0x0'));var util=require('util');var moment=require(_0x6860('0x1'));var BPromise=require(_0x6860('0x2'));var rs=require(_0x6860('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6860('0x4'))['db'];var utils=require(_0x6860('0x5'));var logger=require(_0x6860('0x6'))(_0x6860('0x7'));var config=require('../../config/environment');var jayson=require(_0x6860('0x8'));var client=jayson[_0x6860('0x9')][_0x6860('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f1d6a,_0x54adaa,_0x1dd1a4){return new BPromise(function(_0x5e6f48,_0x29ecb8){return client[_0x6860('0xb')](_0x1f1d6a,_0x1dd1a4)[_0x6860('0xc')](function(_0x5da8ca){logger[_0x6860('0xd')](_0x6860('0xe'),_0x54adaa,_0x6860('0xf'));logger[_0x6860('0x10')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x54adaa,_0x6860('0xf'),JSON[_0x6860('0x11')](_0x5da8ca));if(_0x5da8ca[_0x6860('0x12')]){if(_0x5da8ca[_0x6860('0x12')][_0x6860('0x13')]===0x1f4){logger[_0x6860('0x12')](_0x6860('0xe'),_0x54adaa,_0x5da8ca['error'][_0x6860('0x14')]);return _0x29ecb8(_0x5da8ca['error'][_0x6860('0x14')]);}logger['error'](_0x6860('0xe'),_0x54adaa,_0x5da8ca['error'][_0x6860('0x14')]);return _0x5e6f48(_0x5da8ca[_0x6860('0x12')][_0x6860('0x14')]);}else{logger['info'](_0x6860('0xe'),_0x54adaa,'request\x20sent');_0x5e6f48(_0x5da8ca[_0x6860('0x15')][_0x6860('0x14')]);}})['catch'](function(_0x3f3334){logger[_0x6860('0x12')]('VoiceMailMessage,\x20%s,\x20%s',_0x54adaa,_0x3f3334);_0x29ecb8(_0x3f3334);});});} \ No newline at end of file +var _0xce35=['jayson/promise','client','http','then','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0xce35,0x161));var _0x5ce3=function(_0x135859,_0x49498e){_0x135859=_0x135859-0x0;var _0x1f2706=_0xce35[_0x135859];return _0x1f2706;};'use strict';var _=require(_0x5ce3('0x0'));var util=require(_0x5ce3('0x1'));var moment=require('moment');var BPromise=require(_0x5ce3('0x2'));var rs=require(_0x5ce3('0x3'));var fs=require('fs');var Redis=require(_0x5ce3('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5ce3('0x5'))(_0x5ce3('0x6'));var config=require(_0x5ce3('0x7'));var jayson=require(_0x5ce3('0x8'));var client=jayson[_0x5ce3('0x9')][_0x5ce3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5561e9,_0x11f75c,_0x4982b1){return new BPromise(function(_0xe5acda,_0x3f482d){return client['request'](_0x5561e9,_0x4982b1)[_0x5ce3('0xb')](function(_0x3646e7){logger['info'](_0x5ce3('0xc'),_0x11f75c,_0x5ce3('0xd'));logger['debug'](_0x5ce3('0xe'),_0x11f75c,_0x5ce3('0xd'),JSON['stringify'](_0x3646e7));if(_0x3646e7[_0x5ce3('0xf')]){if(_0x3646e7[_0x5ce3('0xf')][_0x5ce3('0x10')]===0x1f4){logger['error'](_0x5ce3('0xc'),_0x11f75c,_0x3646e7[_0x5ce3('0xf')][_0x5ce3('0x11')]);return _0x3f482d(_0x3646e7[_0x5ce3('0xf')][_0x5ce3('0x11')]);}logger[_0x5ce3('0xf')](_0x5ce3('0xc'),_0x11f75c,_0x3646e7['error'][_0x5ce3('0x11')]);return _0xe5acda(_0x3646e7[_0x5ce3('0xf')][_0x5ce3('0x11')]);}else{logger['info'](_0x5ce3('0xc'),_0x11f75c,_0x5ce3('0xd'));_0xe5acda(_0x3646e7['result']['message']);}})[_0x5ce3('0x12')](function(_0x4d9e8d){logger['error'](_0x5ce3('0xc'),_0x11f75c,_0x4d9e8d);_0x3f482d(_0x4d9e8d);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 23a9ab5..97b4651 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 _0x9ea8=['/:id/sounds','put','update','destroy','delete','/:id/sounds/:id2','removeSound','exports','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','getSounds','post'];(function(_0x2eb9aa,_0x46ba41){var _0xcac029=function(_0x478045){while(--_0x478045){_0x2eb9aa['push'](_0x2eb9aa['shift']());}};_0xcac029(++_0x46ba41);}(_0x9ea8,0x148));var _0x89ea=function(_0x3a3eac,_0x250f74){_0x3a3eac=_0x3a3eac-0x0;var _0x4585e3=_0x9ea8[_0x3a3eac];return _0x4585e3;};'use strict';var multer=require('multer');var util=require(_0x89ea('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x89ea('0x1'));var router=express[_0x89ea('0x2')]();var fs_extra=require(_0x89ea('0x3'));var auth=require(_0x89ea('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x89ea('0x5'));var controller=require('./voiceMusicOnHold.controller');router[_0x89ea('0x6')]('/',auth[_0x89ea('0x7')](),controller[_0x89ea('0x8')]);router[_0x89ea('0x6')](_0x89ea('0x9'),auth[_0x89ea('0x7')](),controller['show']);router[_0x89ea('0x6')]('/:id/sounds',auth['isAuthenticated'](),controller[_0x89ea('0xa')]);router[_0x89ea('0xb')]('/',auth[_0x89ea('0x7')](),controller['create']);router[_0x89ea('0xb')](_0x89ea('0xc'),auth[_0x89ea('0x7')](),controller['addSound']);router[_0x89ea('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x89ea('0xe')]);router['delete'](_0x89ea('0x9'),auth[_0x89ea('0x7')](),controller[_0x89ea('0xf')]);router[_0x89ea('0x10')](_0x89ea('0x11'),auth[_0x89ea('0x7')](),controller[_0x89ea('0x12')]);module[_0x89ea('0x13')]=router; \ No newline at end of file +var _0x9c00=['./voiceMusicOnHold.controller','isAuthenticated','index','get','/:id','show','/:id/sounds','getSounds','post','create','addSound','put','update','delete','destroy','/:id/sounds/:id2','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x9c00,0x115));var _0x09c0=function(_0x1833dc,_0x121d9d){_0x1833dc=_0x1833dc-0x0;var _0x77da96=_0x9c00[_0x1833dc];return _0x77da96;};'use strict';var multer=require(_0x09c0('0x0'));var util=require(_0x09c0('0x1'));var path=require(_0x09c0('0x2'));var timeout=require('connect-timeout');var express=require(_0x09c0('0x3'));var router=express[_0x09c0('0x4')]();var fs_extra=require(_0x09c0('0x5'));var auth=require(_0x09c0('0x6'));var interaction=require(_0x09c0('0x7'));var config=require(_0x09c0('0x8'));var controller=require(_0x09c0('0x9'));router['get']('/',auth[_0x09c0('0xa')](),controller[_0x09c0('0xb')]);router[_0x09c0('0xc')](_0x09c0('0xd'),auth[_0x09c0('0xa')](),controller[_0x09c0('0xe')]);router[_0x09c0('0xc')](_0x09c0('0xf'),auth['isAuthenticated'](),controller[_0x09c0('0x10')]);router[_0x09c0('0x11')]('/',auth['isAuthenticated'](),controller[_0x09c0('0x12')]);router[_0x09c0('0x11')]('/:id/sounds',auth[_0x09c0('0xa')](),controller[_0x09c0('0x13')]);router[_0x09c0('0x14')](_0x09c0('0xd'),auth[_0x09c0('0xa')](),controller[_0x09c0('0x15')]);router[_0x09c0('0x16')]('/:id',auth[_0x09c0('0xa')](),controller[_0x09c0('0x17')]);router[_0x09c0('0x16')](_0x09c0('0x18'),auth[_0x09c0('0xa')](),controller['removeSound']);module[_0x09c0('0x19')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index f77ffa8..ab1c442 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 _0xa556=['STRING','TIMESTAMP','BOOLEAN','exports','name','ENUM','custom','files','mp3nb','quietmp3nb','quietmp3','mp3'];(function(_0x2bf844,_0x15c52c){var _0x44fba0=function(_0x287b37){while(--_0x287b37){_0x2bf844['push'](_0x2bf844['shift']());}};_0x44fba0(++_0x15c52c);}(_0xa556,0x1cb));var _0x6a55=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xa556[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require('sequelize');module[_0x6a55('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6a55('0x1')},'mode':{'type':Sequelize[_0x6a55('0x2')](_0x6a55('0x3'),_0x6a55('0x4'),_0x6a55('0x5'),_0x6a55('0x6'),_0x6a55('0x7'),_0x6a55('0x8')),'allowNull':!![],'defaultValue':_0x6a55('0x4')},'directory':{'type':Sequelize[_0x6a55('0x9')],'allowNull':!![]},'application':{'type':Sequelize[_0x6a55('0x9')],'allowNull':!![]},'digit':{'type':Sequelize[_0x6a55('0x9')],'allowNull':!![]},'sort':{'type':Sequelize[_0x6a55('0x9')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0x6a55('0x9')],'allowNull':!![]},'stamp':{'type':_0x6a55('0xa')},'defaultEntry':{'type':Sequelize[_0x6a55('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0xeab9=['mp3nb','quietmp3nb','quietmp3','mp3','files','alpha','TIMESTAMP','BOOLEAN','STRING','name'];(function(_0x21d2a6,_0x44c6cc){var _0x3a5b9f=function(_0x49353f){while(--_0x49353f){_0x21d2a6['push'](_0x21d2a6['shift']());}};_0x3a5b9f(++_0x44c6cc);}(_0xeab9,0xda));var _0x9eab=function(_0x17b98b,_0x382995){_0x17b98b=_0x17b98b-0x0;var _0x59513f=_0xeab9[_0x17b98b];return _0x59513f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9eab('0x0')],'allowNull':![],'unique':_0x9eab('0x1')},'mode':{'type':Sequelize['ENUM']('custom','files',_0x9eab('0x2'),_0x9eab('0x3'),_0x9eab('0x4'),_0x9eab('0x5')),'allowNull':!![],'defaultValue':_0x9eab('0x6')},'directory':{'type':Sequelize[_0x9eab('0x0')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0x9eab('0x0')],'allowNull':!![]},'sort':{'type':Sequelize[_0x9eab('0x0')],'allowNull':!![],'defaultValue':_0x9eab('0x7')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0x9eab('0x8')},'defaultEntry':{'type':Sequelize[_0x9eab('0x9')],'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 172e1c5..c49d135 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 _0xefd2=['model','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','find','params','body','transaction','mode','directory','root','files','0777','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','readdirSync','unlinkSync','join','ValidationError','addSound','Sound','save_name','converted_format','server/files/sounds/converted','%s.%s','basename','extname','server/files/moh','symlinkSync','Sequelize','message','findOne','removeSound','id2','createdAt','format','getSounds','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','MusicOnHolds','UserProfileResource','end','error','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','type','key','query','keys','filters','intersection','attributes'];(function(_0x4fcf14,_0x37352d){var _0x5483b3=function(_0x2f529d){while(--_0x2f529d){_0x4fcf14['push'](_0x4fcf14['shift']());}};_0x5483b3(++_0x37352d);}(_0xefd2,0x115));var _0x2efd=function(_0x44bcb0,_0x235aa9){_0x44bcb0=_0x44bcb0-0x0;var _0xfaf881=_0xefd2[_0x44bcb0];return _0xfaf881;};'use strict';var emlformat=require(_0x2efd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2efd('0x1'));var jsonpatch=require(_0x2efd('0x2'));var rp=require(_0x2efd('0x3'));var moment=require('moment');var BPromise=require(_0x2efd('0x4'));var Mustache=require('mustache');var util=require(_0x2efd('0x5'));var path=require('path');var sox=require(_0x2efd('0x6'));var csv=require(_0x2efd('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2efd('0x8'));var _=require(_0x2efd('0x9'));var squel=require(_0x2efd('0xa'));var crypto=require('crypto');var jsforce=require(_0x2efd('0xb'));var deskjs=require(_0x2efd('0xc'));var toCsv=require(_0x2efd('0x7'));var querystring=require(_0x2efd('0xd'));var Papa=require(_0x2efd('0xe'));var Redis=require('ioredis');var authService=require(_0x2efd('0xf'));var qs=require(_0x2efd('0x10'));var as=require(_0x2efd('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2efd('0x12'))('api');var utils=require(_0x2efd('0x13'));var config=require(_0x2efd('0x14'));var licenseUtil=require(_0x2efd('0x15'));var db=require(_0x2efd('0x16'))['db'];function respondWithStatusCode(_0x70dbd,_0x18de16){_0x18de16=_0x18de16||0xcc;return function(_0x230aba){if(_0x230aba){return _0x70dbd[_0x2efd('0x17')](_0x18de16);}return _0x70dbd['status'](_0x18de16)['end']();};}function respondWithResult(_0x566422,_0x33e9d7){_0x33e9d7=_0x33e9d7||0xc8;return function(_0x3679d1){if(_0x3679d1){return _0x566422[_0x2efd('0x18')](_0x33e9d7)['json'](_0x3679d1);}};}function respondWithFilteredResult(_0x5578b9,_0x28f47c){return function(_0x17821d){if(_0x17821d){var _0x57b172=typeof _0x28f47c['offset']===_0x2efd('0x19')&&typeof _0x28f47c[_0x2efd('0x1a')]===_0x2efd('0x19');var _0x4e71b3=_0x17821d[_0x2efd('0x1b')];var _0x280485=_0x57b172?0x0:_0x28f47c['offset'];var _0x548afd=_0x57b172?_0x17821d[_0x2efd('0x1b')]:_0x28f47c['offset']+_0x28f47c[_0x2efd('0x1a')];var _0x2102b2;if(_0x548afd>=_0x4e71b3){_0x548afd=_0x4e71b3;_0x2102b2=0xc8;}else{_0x2102b2=0xce;}_0x5578b9['status'](_0x2102b2);return _0x5578b9[_0x2efd('0x1c')](_0x2efd('0x1d'),_0x280485+'-'+_0x548afd+'/'+_0x4e71b3)[_0x2efd('0x1e')](_0x17821d);}return null;};}function patchUpdates(_0x2d49a1){return function(_0x4f227b){try{jsonpatch[_0x2efd('0x1f')](_0x4f227b,_0x2d49a1,!![]);}catch(_0x268eeb){return BPromise[_0x2efd('0x20')](_0x268eeb);}return _0x4f227b[_0x2efd('0x21')]();};}function saveUpdates(_0x52d30a,_0x1573cd){return function(_0x85deb){if(_0x85deb){return _0x85deb[_0x2efd('0x22')](_0x52d30a)[_0x2efd('0x23')](function(_0x5a5b15){return _0x5a5b15;});}return null;};}function removeEntity(_0x5760f1,_0x310b2c){return function(_0x2e833a){if(_0x2e833a){return _0x2e833a[_0x2efd('0x24')]()[_0x2efd('0x23')](function(){var _0x44c909=_0x2e833a[_0x2efd('0x25')]({'plain':!![]});var _0x5067ba=_0x2efd('0x26');return db[_0x2efd('0x27')][_0x2efd('0x24')]({'where':{'type':_0x5067ba,'resourceId':_0x44c909['id']}})[_0x2efd('0x23')](function(){return _0x2e833a;});})[_0x2efd('0x23')](function(){_0x5760f1[_0x2efd('0x18')](0xcc)[_0x2efd('0x28')]();});}};}function handleEntityNotFound(_0x1a78f9,_0x37a9bb){return function(_0x30005e){if(!_0x30005e){_0x1a78f9[_0x2efd('0x17')](0x194);}return _0x30005e;};}function handleError(_0x5b0f79,_0x358ba7){_0x358ba7=_0x358ba7||0x1f4;return function(_0x226c41){logger[_0x2efd('0x29')](_0x226c41[_0x2efd('0x2a')]);if(_0x226c41[_0x2efd('0x2b')]){delete _0x226c41[_0x2efd('0x2b')];}_0x5b0f79[_0x2efd('0x18')](_0x358ba7)[_0x2efd('0x2c')](_0x226c41);};}exports[_0x2efd('0x2d')]=function(_0x137403,_0x2f0944){var _0x7278d5={},_0x3925e3={},_0x4d5f05={'count':0x0,'rows':[]};var _0x528c24=_[_0x2efd('0x2e')](db[_0x2efd('0x2f')][_0x2efd('0x30')],function(_0xc77211){return{'name':_0xc77211['fieldName'],'type':_0xc77211[_0x2efd('0x31')][_0x2efd('0x32')]};});_0x3925e3['model']=_[_0x2efd('0x2e')](_0x528c24,_0x2efd('0x2b'));_0x3925e3[_0x2efd('0x33')]=_[_0x2efd('0x34')](_0x137403['query']);_0x3925e3[_0x2efd('0x35')]=_[_0x2efd('0x36')](_0x3925e3['model'],_0x3925e3[_0x2efd('0x33')]);_0x7278d5[_0x2efd('0x37')]=_[_0x2efd('0x36')](_0x3925e3[_0x2efd('0x38')],qs[_0x2efd('0x39')](_0x137403[_0x2efd('0x33')]['fields']));_0x7278d5[_0x2efd('0x37')]=_0x7278d5[_0x2efd('0x37')][_0x2efd('0x3a')]?_0x7278d5[_0x2efd('0x37')]:_0x3925e3[_0x2efd('0x38')];if(!_0x137403[_0x2efd('0x33')][_0x2efd('0x3b')](_0x2efd('0x3c'))){_0x7278d5[_0x2efd('0x1a')]=qs[_0x2efd('0x1a')](_0x137403['query'][_0x2efd('0x1a')]);_0x7278d5[_0x2efd('0x3d')]=qs['offset'](_0x137403[_0x2efd('0x33')][_0x2efd('0x3d')]);}_0x7278d5[_0x2efd('0x3e')]=qs[_0x2efd('0x3f')](_0x137403['query'][_0x2efd('0x3f')]);delete _0x137403[_0x2efd('0x33')][_0x2efd('0x3f')];_0x7278d5[_0x2efd('0x40')]=qs[_0x2efd('0x35')](_[_0x2efd('0x41')](_0x137403[_0x2efd('0x33')],_0x3925e3[_0x2efd('0x35')]),_0x528c24);if(_0x137403[_0x2efd('0x33')]['filter']){_0x7278d5['where']=_[_0x2efd('0x42')](_0x7278d5[_0x2efd('0x40')],{'$or':_[_0x2efd('0x2e')](_0x528c24,function(_0x4f7062){if(_0x4f7062['type']!==_0x2efd('0x43')){var _0xd441c9={};_0xd441c9[_0x4f7062[_0x2efd('0x2b')]]={'$like':'%'+_0x137403[_0x2efd('0x33')][_0x2efd('0x44')]+'%'};return _0xd441c9;}})});}_0x7278d5=_[_0x2efd('0x42')]({},_0x7278d5,_0x137403[_0x2efd('0x45')]);var _0x2c6ae9={'where':_0x7278d5[_0x2efd('0x40')]};return db[_0x2efd('0x2f')][_0x2efd('0x1b')](_0x2c6ae9)['then'](function(_0x69c8ec){_0x4d5f05[_0x2efd('0x1b')]=_0x69c8ec;if(_0x137403[_0x2efd('0x33')]['includeAll']){_0x7278d5[_0x2efd('0x46')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x2efd('0x47')](_0x7278d5);})[_0x2efd('0x23')](function(_0x539480){_0x4d5f05[_0x2efd('0x48')]=_0x539480;return _0x4d5f05;})[_0x2efd('0x23')](respondWithFilteredResult(_0x2f0944,_0x7278d5))[_0x2efd('0x49')](handleError(_0x2f0944,null));};exports['show']=function(_0x42cdc8,_0x3921aa){var _0x373037={'raw':![],'where':{'id':_0x42cdc8['params']['id']}},_0xd0cbe1={};_0xd0cbe1[_0x2efd('0x38')]=_[_0x2efd('0x34')](db[_0x2efd('0x2f')][_0x2efd('0x30')]);_0xd0cbe1[_0x2efd('0x33')]=_[_0x2efd('0x34')](_0x42cdc8[_0x2efd('0x33')]);_0xd0cbe1[_0x2efd('0x35')]=_[_0x2efd('0x36')](_0xd0cbe1[_0x2efd('0x38')],_0xd0cbe1[_0x2efd('0x33')]);_0x373037[_0x2efd('0x37')]=_['intersection'](_0xd0cbe1[_0x2efd('0x38')],qs[_0x2efd('0x39')](_0x42cdc8['query'][_0x2efd('0x39')]));_0x373037[_0x2efd('0x37')]=_0x373037[_0x2efd('0x37')]['length']?_0x373037[_0x2efd('0x37')]:_0xd0cbe1[_0x2efd('0x38')];if(_0x42cdc8[_0x2efd('0x33')]['includeAll']){_0x373037[_0x2efd('0x46')]=[{'all':!![]}];}_0x373037=_[_0x2efd('0x42')]({},_0x373037,_0x42cdc8[_0x2efd('0x45')]);return db[_0x2efd('0x2f')][_0x2efd('0x4a')](_0x373037)[_0x2efd('0x23')](handleEntityNotFound(_0x3921aa,null))[_0x2efd('0x23')](respondWithResult(_0x3921aa,null))[_0x2efd('0x49')](handleError(_0x3921aa,null));};exports[_0x2efd('0x22')]=function(_0x295cbb,_0x412610){if(_0x295cbb['body']['id']){delete _0x295cbb['body']['id'];}return db[_0x2efd('0x2f')][_0x2efd('0x4a')]({'where':{'id':_0x295cbb[_0x2efd('0x4b')]['id']}})[_0x2efd('0x23')](handleEntityNotFound(_0x412610,null))[_0x2efd('0x23')](saveUpdates(_0x295cbb[_0x2efd('0x4c')],null))['then'](respondWithResult(_0x412610,null))['catch'](handleError(_0x412610,null));};exports['create']=function(_0x479524,_0x20ebe0,_0x3a337f){return db['sequelize'][_0x2efd('0x4d')](function(_0x3a0b4b){if(_0x479524[_0x2efd('0x4c')][_0x2efd('0x4e')]==='files'){_0x479524[_0x2efd('0x4c')][_0x2efd('0x4f')]=path['join'](config[_0x2efd('0x50')],'server/files/moh',_0x479524[_0x2efd('0x4c')][_0x2efd('0x2b')]);}return db['VoiceMusicOnHold']['create'](_0x479524[_0x2efd('0x4c')],{'transaction':_0x3a0b4b})[_0x2efd('0x23')](function(_0x287bd1){if(_0x479524[_0x2efd('0x4c')][_0x2efd('0x4e')]===_0x2efd('0x51')){fs['mkdirSync'](_0x287bd1['directory'],parseInt(_0x2efd('0x52'),0x8));}var _0x9febe3=_0x479524['user'][_0x2efd('0x25')]({'plain':!![]});if(!_0x9febe3)throw new Error(_0x2efd('0x53'));if(_0x9febe3[_0x2efd('0x54')]==='user'){var _0x64c781=_0x287bd1['get']({'plain':!![]});return db[_0x2efd('0x55')][_0x2efd('0x4a')]({'where':{'name':'MusicOnHolds','userProfileId':_0x9febe3['userProfileId']},'raw':!![]})[_0x2efd('0x23')](function(_0x4de14f){if(_0x4de14f&&_0x4de14f['autoAssociation']===0x0){return db[_0x2efd('0x27')][_0x2efd('0x56')]({'name':_0x64c781[_0x2efd('0x2b')],'resourceId':_0x64c781['id'],'type':_0x4de14f['name'],'sectionId':_0x4de14f['id']},{})[_0x2efd('0x23')](function(){return _0x287bd1;});}else{return _0x287bd1;}})[_0x2efd('0x49')](function(_0x4a98ef){logger['error'](_0x2efd('0x57'),_0x4a98ef);});}return _0x287bd1;});})[_0x2efd('0x23')](respondWithResult(_0x20ebe0,0xc9))['catch'](handleError(_0x20ebe0,null));};exports[_0x2efd('0x24')]=function(_0x54b3da,_0x118f87,_0x311946){var _0x1a570c;return db[_0x2efd('0x2f')][_0x2efd('0x4a')]({'where':{'id':_0x54b3da[_0x2efd('0x4b')]['id']}})[_0x2efd('0x23')](function(_0x49887a){if(_0x49887a){return db[_0x2efd('0x58')][_0x2efd('0x4d')](function(_0x3d0836){return _0x49887a[_0x2efd('0x24')]({'transaction':_0x3d0836,'raw':!![]})[_0x2efd('0x23')](function(_0x142c4e){if(_0x142c4e[_0x2efd('0x4f')]){fs[_0x2efd('0x59')](_0x142c4e[_0x2efd('0x4f')])['forEach'](function(_0xa2301e){fs[_0x2efd('0x5a')](path[_0x2efd('0x5b')](_0x142c4e['directory'],_0xa2301e));});fs['rmdirSync'](_0x142c4e['directory']);}return _0x142c4e;});})[_0x2efd('0x49')](function(_0x90a28d){throw new db['Sequelize'][(_0x2efd('0x5c'))](_0x90a28d['message']);});}})[_0x2efd('0x23')](handleEntityNotFound(_0x118f87,null))[_0x2efd('0x23')](removeEntity(_0x118f87,null))[_0x2efd('0x49')](handleError(_0x118f87,null));};exports[_0x2efd('0x5d')]=function(_0x159423,_0x49b458,_0x2335de){return db['sequelize'][_0x2efd('0x4d')](function(_0x864ee6){var _0x5e448d;return db[_0x2efd('0x2f')][_0x2efd('0x4a')]({'where':{'id':_0x159423[_0x2efd('0x4b')]['id']}})[_0x2efd('0x23')](function(_0x5500f2){if(_0x5500f2){_0x5e448d=_0x5500f2;return _0x5500f2[_0x2efd('0x5d')](_0x159423[_0x2efd('0x4c')]['id'],{'transaction':_0x864ee6});}})[_0x2efd('0x23')](function(_0x430797){if(_0x430797){return db[_0x2efd('0x5e')]['findOne']({'where':{'id':_0x159423['body']['id']},'attributes':['id',_0x2efd('0x2b'),_0x2efd('0x5f'),_0x2efd('0x60'),'createdAt'],'raw':!![]});}})[_0x2efd('0x23')](function(_0x5de291){if(_0x5de291){var _0x1a0528=path[_0x2efd('0x5b')](config[_0x2efd('0x50')],_0x2efd('0x61'),util['format'](_0x2efd('0x62'),path[_0x2efd('0x63')](_0x5de291[_0x2efd('0x5f')],path[_0x2efd('0x64')](_0x5de291[_0x2efd('0x5f')])),_0x5de291[_0x2efd('0x60')]));var _0x3e2a0b=path['join'](config['root'],_0x2efd('0x65'),_0x5e448d[_0x2efd('0x2b')],util['format'](_0x2efd('0x62'),_0x5de291[_0x2efd('0x2b')],_0x5de291[_0x2efd('0x60')]));fs[_0x2efd('0x66')](_0x1a0528,_0x3e2a0b);return _0x5de291;}})[_0x2efd('0x49')](function(_0x3534a4){throw new db[(_0x2efd('0x67'))][(_0x2efd('0x5c'))](_0x3534a4[_0x2efd('0x68')]);});})['then'](handleEntityNotFound(_0x49b458,null))['then'](respondWithResult(_0x49b458,0xc9))['catch'](handleError(_0x49b458,null));};exports['removeSound']=function(_0x4f1190,_0x166de8,_0x1644f2){return db[_0x2efd('0x58')][_0x2efd('0x4d')](function(_0x58bfdf){var _0x1e007d;return db[_0x2efd('0x2f')][_0x2efd('0x69')]({'where':{'id':_0x4f1190['params']['id']}})[_0x2efd('0x23')](handleEntityNotFound(_0x166de8,null))[_0x2efd('0x23')](function(_0xc06196){if(_0xc06196){_0x1e007d=_0xc06196;return _0xc06196[_0x2efd('0x6a')](_0x4f1190[_0x2efd('0x4b')][_0x2efd('0x6b')]);}})[_0x2efd('0x23')](function(_0x481895){if(_0x481895){return db[_0x2efd('0x5e')][_0x2efd('0x69')]({'where':{'id':_0x4f1190[_0x2efd('0x4b')][_0x2efd('0x6b')]},'attributes':['id',_0x2efd('0x2b'),'save_name',_0x2efd('0x60'),_0x2efd('0x6c')],'raw':!![]});}})['then'](function(_0xac7e1d){if(_0xac7e1d){fs['unlinkSync'](path[_0x2efd('0x5b')](_0x1e007d[_0x2efd('0x4f')],util[_0x2efd('0x6d')](_0x2efd('0x62'),_0xac7e1d[_0x2efd('0x2b')],_0xac7e1d[_0x2efd('0x60')])));return _0xac7e1d;}})[_0x2efd('0x49')](function(_0x309e56){throw new db[(_0x2efd('0x67'))][(_0x2efd('0x5c'))](_0x309e56[_0x2efd('0x68')]);});})[_0x2efd('0x23')](handleEntityNotFound(_0x166de8,null))[_0x2efd('0x23')](respondWithStatusCode(_0x166de8,0xcc))[_0x2efd('0x49')](handleError(_0x166de8,null));};exports['getSounds']=function(_0x5b36a4,_0x11f828,_0x524f50){var _0x333b90={};var _0x479f4d={};var _0x200200;var _0x14e2e7;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x5b36a4['params']['id']}})[_0x2efd('0x23')](handleEntityNotFound(_0x11f828,null))[_0x2efd('0x23')](function(_0x17c5fd){if(_0x17c5fd){_0x200200=_0x17c5fd;_0x479f4d[_0x2efd('0x38')]=_[_0x2efd('0x34')](db[_0x2efd('0x5e')][_0x2efd('0x30')]);_0x479f4d[_0x2efd('0x33')]=_[_0x2efd('0x34')](_0x5b36a4[_0x2efd('0x33')]);_0x479f4d[_0x2efd('0x35')]=_[_0x2efd('0x36')](_0x479f4d[_0x2efd('0x38')],_0x479f4d[_0x2efd('0x33')]);_0x333b90[_0x2efd('0x37')]=_['intersection'](_0x479f4d[_0x2efd('0x38')],qs[_0x2efd('0x39')](_0x5b36a4[_0x2efd('0x33')][_0x2efd('0x39')]));_0x333b90['attributes']=_0x333b90[_0x2efd('0x37')]['length']?_0x333b90['attributes']:_0x479f4d[_0x2efd('0x38')];_0x333b90['order']=qs[_0x2efd('0x3f')](_0x5b36a4['query'][_0x2efd('0x3f')]);_0x333b90[_0x2efd('0x40')]=qs[_0x2efd('0x35')](_[_0x2efd('0x41')](_0x5b36a4[_0x2efd('0x33')],_0x479f4d[_0x2efd('0x35')]));if(_0x5b36a4[_0x2efd('0x33')][_0x2efd('0x44')]){_0x333b90[_0x2efd('0x40')]=_['merge'](_0x333b90[_0x2efd('0x40')],{'$or':_[_0x2efd('0x2e')](_0x333b90['attributes'],function(_0x364ebd){var _0x3e20b7={};_0x3e20b7[_0x364ebd]={'$like':'%'+_0x5b36a4[_0x2efd('0x33')][_0x2efd('0x44')]+'%'};return _0x3e20b7;})});}_0x333b90=_[_0x2efd('0x42')]({},_0x333b90,_0x5b36a4[_0x2efd('0x45')]);return _0x200200[_0x2efd('0x6e')](_0x333b90);}})[_0x2efd('0x23')](function(_0x18da67){if(_0x18da67){_0x14e2e7=_0x18da67[_0x2efd('0x3a')];if(!_0x5b36a4['query']['hasOwnProperty'](_0x2efd('0x3c'))){_0x333b90[_0x2efd('0x1a')]=qs[_0x2efd('0x1a')](_0x5b36a4[_0x2efd('0x33')]['limit']);_0x333b90['offset']=qs['offset'](_0x5b36a4['query'][_0x2efd('0x3d')]);}return _0x200200[_0x2efd('0x6e')](_0x333b90);}})['then'](function(_0x34b7ce){if(_0x34b7ce){return _0x34b7ce?{'count':_0x14e2e7,'rows':_0x34b7ce}:null;}})[_0x2efd('0x23')](respondWithResult(_0x11f828,null))[_0x2efd('0x49')](handleError(_0x11f828,null));}; \ No newline at end of file +var _0x8a3f=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','Content-Range','reject','update','then','destroy','get','MusicOnHolds','UserProfileResource','end','error','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','include','catch','show','params','includeAll','body','find','create','sequelize','mode','files','join','root','server/files/moh','mkdirSync','directory','0777','user','role','UserProfileSection','transaction','readdirSync','forEach','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','extname','format','symlinkSync','removeSound','id2','unlinkSync','getSounds','length','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis'];(function(_0x15279d,_0x3dcbdf){var _0x1e0a67=function(_0x38fb24){while(--_0x38fb24){_0x15279d['push'](_0x15279d['shift']());}};_0x1e0a67(++_0x3dcbdf);}(_0x8a3f,0x19a));var _0xf8a3=function(_0x145694,_0x5df469){_0x145694=_0x145694-0x0;var _0x1e0d17=_0x8a3f[_0x145694];return _0x1e0d17;};'use strict';var emlformat=require(_0xf8a3('0x0'));var rimraf=require(_0xf8a3('0x1'));var zipdir=require(_0xf8a3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf8a3('0x3'));var moment=require(_0xf8a3('0x4'));var BPromise=require(_0xf8a3('0x5'));var Mustache=require(_0xf8a3('0x6'));var util=require('util');var path=require(_0xf8a3('0x7'));var sox=require(_0xf8a3('0x8'));var csv=require(_0xf8a3('0x9'));var ejs=require(_0xf8a3('0xa'));var fs=require('fs');var fs_extra=require(_0xf8a3('0xb'));var _=require(_0xf8a3('0xc'));var squel=require('squel');var crypto=require(_0xf8a3('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf8a3('0xe'));var toCsv=require(_0xf8a3('0x9'));var querystring=require(_0xf8a3('0xf'));var Papa=require(_0xf8a3('0x10'));var Redis=require(_0xf8a3('0x11'));var authService=require(_0xf8a3('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf8a3('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf8a3('0x14'))(_0xf8a3('0x15'));var utils=require(_0xf8a3('0x16'));var config=require(_0xf8a3('0x17'));var licenseUtil=require(_0xf8a3('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24b297,_0x4d6097){_0x4d6097=_0x4d6097||0xcc;return function(_0x47a9aa){if(_0x47a9aa){return _0x24b297[_0xf8a3('0x19')](_0x4d6097);}return _0x24b297[_0xf8a3('0x1a')](_0x4d6097)['end']();};}function respondWithResult(_0x14eac4,_0xbf90a0){_0xbf90a0=_0xbf90a0||0xc8;return function(_0x3ad784){if(_0x3ad784){return _0x14eac4[_0xf8a3('0x1a')](_0xbf90a0)[_0xf8a3('0x1b')](_0x3ad784);}};}function respondWithFilteredResult(_0x59ef39,_0x56f1f9){return function(_0x5bf70e){if(_0x5bf70e){var _0x508f22=typeof _0x56f1f9[_0xf8a3('0x1c')]==='undefined'&&typeof _0x56f1f9['limit']===_0xf8a3('0x1d');var _0xf03673=_0x5bf70e[_0xf8a3('0x1e')];var _0xc5d519=_0x508f22?0x0:_0x56f1f9[_0xf8a3('0x1c')];var _0x14606d=_0x508f22?_0x5bf70e[_0xf8a3('0x1e')]:_0x56f1f9[_0xf8a3('0x1c')]+_0x56f1f9[_0xf8a3('0x1f')];var _0x2e8a17;if(_0x14606d>=_0xf03673){_0x14606d=_0xf03673;_0x2e8a17=0xc8;}else{_0x2e8a17=0xce;}_0x59ef39[_0xf8a3('0x1a')](_0x2e8a17);return _0x59ef39['set'](_0xf8a3('0x20'),_0xc5d519+'-'+_0x14606d+'/'+_0xf03673)[_0xf8a3('0x1b')](_0x5bf70e);}return null;};}function patchUpdates(_0x389748){return function(_0x38db14){try{jsonpatch['apply'](_0x38db14,_0x389748,!![]);}catch(_0x552baf){return BPromise[_0xf8a3('0x21')](_0x552baf);}return _0x38db14['save']();};}function saveUpdates(_0x3a8704,_0xf41a88){return function(_0x44f509){if(_0x44f509){return _0x44f509[_0xf8a3('0x22')](_0x3a8704)[_0xf8a3('0x23')](function(_0x57226d){return _0x57226d;});}return null;};}function removeEntity(_0x139d68,_0x46532e){return function(_0x34609b){if(_0x34609b){return _0x34609b[_0xf8a3('0x24')]()[_0xf8a3('0x23')](function(){var _0x4162b3=_0x34609b[_0xf8a3('0x25')]({'plain':!![]});var _0x12a0d5=_0xf8a3('0x26');return db[_0xf8a3('0x27')][_0xf8a3('0x24')]({'where':{'type':_0x12a0d5,'resourceId':_0x4162b3['id']}})[_0xf8a3('0x23')](function(){return _0x34609b;});})[_0xf8a3('0x23')](function(){_0x139d68[_0xf8a3('0x1a')](0xcc)[_0xf8a3('0x28')]();});}};}function handleEntityNotFound(_0x3d61d3,_0x585132){return function(_0x5c1b99){if(!_0x5c1b99){_0x3d61d3[_0xf8a3('0x19')](0x194);}return _0x5c1b99;};}function handleError(_0x59ad33,_0x197e70){_0x197e70=_0x197e70||0x1f4;return function(_0x27b5ca){logger[_0xf8a3('0x29')](_0x27b5ca['stack']);if(_0x27b5ca['name']){delete _0x27b5ca[_0xf8a3('0x2a')];}_0x59ad33['status'](_0x197e70)[_0xf8a3('0x2b')](_0x27b5ca);};}exports[_0xf8a3('0x2c')]=function(_0x5a6a35,_0x59b9c7){var _0x1210c7={},_0x26c125={},_0x5e8dd3={'count':0x0,'rows':[]};var _0x4689f0=_[_0xf8a3('0x2d')](db[_0xf8a3('0x2e')][_0xf8a3('0x2f')],function(_0x457aa5){return{'name':_0x457aa5[_0xf8a3('0x30')],'type':_0x457aa5['type']['key']};});_0x26c125['model']=_[_0xf8a3('0x2d')](_0x4689f0,_0xf8a3('0x2a'));_0x26c125[_0xf8a3('0x31')]=_[_0xf8a3('0x32')](_0x5a6a35[_0xf8a3('0x31')]);_0x26c125[_0xf8a3('0x33')]=_['intersection'](_0x26c125[_0xf8a3('0x34')],_0x26c125[_0xf8a3('0x31')]);_0x1210c7[_0xf8a3('0x35')]=_[_0xf8a3('0x36')](_0x26c125[_0xf8a3('0x34')],qs['fields'](_0x5a6a35['query'][_0xf8a3('0x37')]));_0x1210c7[_0xf8a3('0x35')]=_0x1210c7['attributes']['length']?_0x1210c7[_0xf8a3('0x35')]:_0x26c125['model'];if(!_0x5a6a35[_0xf8a3('0x31')][_0xf8a3('0x38')](_0xf8a3('0x39'))){_0x1210c7[_0xf8a3('0x1f')]=qs['limit'](_0x5a6a35[_0xf8a3('0x31')]['limit']);_0x1210c7[_0xf8a3('0x1c')]=qs[_0xf8a3('0x1c')](_0x5a6a35['query']['offset']);}_0x1210c7[_0xf8a3('0x3a')]=qs[_0xf8a3('0x3b')](_0x5a6a35[_0xf8a3('0x31')][_0xf8a3('0x3b')]);delete _0x5a6a35[_0xf8a3('0x31')]['sort'];_0x1210c7[_0xf8a3('0x3c')]=qs[_0xf8a3('0x33')](_['pick'](_0x5a6a35['query'],_0x26c125[_0xf8a3('0x33')]),_0x4689f0);if(_0x5a6a35[_0xf8a3('0x31')][_0xf8a3('0x3d')]){_0x1210c7[_0xf8a3('0x3c')]=_[_0xf8a3('0x3e')](_0x1210c7[_0xf8a3('0x3c')],{'$or':_[_0xf8a3('0x2d')](_0x4689f0,function(_0x3b9d64){if(_0x3b9d64[_0xf8a3('0x3f')]!==_0xf8a3('0x40')){var _0x1f18f2={};_0x1f18f2[_0x3b9d64[_0xf8a3('0x2a')]]={'$like':'%'+_0x5a6a35[_0xf8a3('0x31')][_0xf8a3('0x3d')]+'%'};return _0x1f18f2;}})});}_0x1210c7=_[_0xf8a3('0x3e')]({},_0x1210c7,_0x5a6a35[_0xf8a3('0x41')]);var _0x2807f7={'where':_0x1210c7[_0xf8a3('0x3c')]};return db[_0xf8a3('0x2e')][_0xf8a3('0x1e')](_0x2807f7)['then'](function(_0x3d7782){_0x5e8dd3[_0xf8a3('0x1e')]=_0x3d7782;if(_0x5a6a35['query']['includeAll']){_0x1210c7[_0xf8a3('0x42')]=[{'all':!![]}];}return db[_0xf8a3('0x2e')]['findAll'](_0x1210c7);})[_0xf8a3('0x23')](function(_0x1c63c4){_0x5e8dd3['rows']=_0x1c63c4;return _0x5e8dd3;})[_0xf8a3('0x23')](respondWithFilteredResult(_0x59b9c7,_0x1210c7))[_0xf8a3('0x43')](handleError(_0x59b9c7,null));};exports[_0xf8a3('0x44')]=function(_0x5bbe73,_0xc88b64){var _0xbfeec6={'raw':![],'where':{'id':_0x5bbe73[_0xf8a3('0x45')]['id']}},_0x28d34c={};_0x28d34c[_0xf8a3('0x34')]=_['keys'](db[_0xf8a3('0x2e')][_0xf8a3('0x2f')]);_0x28d34c[_0xf8a3('0x31')]=_['keys'](_0x5bbe73['query']);_0x28d34c[_0xf8a3('0x33')]=_[_0xf8a3('0x36')](_0x28d34c['model'],_0x28d34c[_0xf8a3('0x31')]);_0xbfeec6[_0xf8a3('0x35')]=_[_0xf8a3('0x36')](_0x28d34c[_0xf8a3('0x34')],qs['fields'](_0x5bbe73[_0xf8a3('0x31')][_0xf8a3('0x37')]));_0xbfeec6['attributes']=_0xbfeec6[_0xf8a3('0x35')]['length']?_0xbfeec6[_0xf8a3('0x35')]:_0x28d34c[_0xf8a3('0x34')];if(_0x5bbe73['query'][_0xf8a3('0x46')]){_0xbfeec6[_0xf8a3('0x42')]=[{'all':!![]}];}_0xbfeec6=_['merge']({},_0xbfeec6,_0x5bbe73['options']);return db[_0xf8a3('0x2e')]['find'](_0xbfeec6)[_0xf8a3('0x23')](handleEntityNotFound(_0xc88b64,null))[_0xf8a3('0x23')](respondWithResult(_0xc88b64,null))[_0xf8a3('0x43')](handleError(_0xc88b64,null));};exports[_0xf8a3('0x22')]=function(_0x1eb5ff,_0x44d9eb){if(_0x1eb5ff[_0xf8a3('0x47')]['id']){delete _0x1eb5ff[_0xf8a3('0x47')]['id'];}return db[_0xf8a3('0x2e')][_0xf8a3('0x48')]({'where':{'id':_0x1eb5ff[_0xf8a3('0x45')]['id']}})[_0xf8a3('0x23')](handleEntityNotFound(_0x44d9eb,null))[_0xf8a3('0x23')](saveUpdates(_0x1eb5ff[_0xf8a3('0x47')],null))[_0xf8a3('0x23')](respondWithResult(_0x44d9eb,null))[_0xf8a3('0x43')](handleError(_0x44d9eb,null));};exports[_0xf8a3('0x49')]=function(_0x422a02,_0x4926f6,_0x44e6e0){return db[_0xf8a3('0x4a')]['transaction'](function(_0x97d21b){if(_0x422a02[_0xf8a3('0x47')][_0xf8a3('0x4b')]===_0xf8a3('0x4c')){_0x422a02['body']['directory']=path[_0xf8a3('0x4d')](config[_0xf8a3('0x4e')],_0xf8a3('0x4f'),_0x422a02[_0xf8a3('0x47')][_0xf8a3('0x2a')]);}return db[_0xf8a3('0x2e')][_0xf8a3('0x49')](_0x422a02['body'],{'transaction':_0x97d21b})[_0xf8a3('0x23')](function(_0x5ae4bd){if(_0x422a02[_0xf8a3('0x47')][_0xf8a3('0x4b')]===_0xf8a3('0x4c')){fs[_0xf8a3('0x50')](_0x5ae4bd[_0xf8a3('0x51')],parseInt(_0xf8a3('0x52'),0x8));}var _0x1e7f49=_0x422a02[_0xf8a3('0x53')][_0xf8a3('0x25')]({'plain':!![]});if(!_0x1e7f49)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1e7f49[_0xf8a3('0x54')]===_0xf8a3('0x53')){var _0x154bfb=_0x5ae4bd[_0xf8a3('0x25')]({'plain':!![]});return db[_0xf8a3('0x55')]['find']({'where':{'name':_0xf8a3('0x26'),'userProfileId':_0x1e7f49['userProfileId']},'raw':!![]})[_0xf8a3('0x23')](function(_0x5efd90){if(_0x5efd90&&_0x5efd90['autoAssociation']===0x0){return db['UserProfileResource'][_0xf8a3('0x49')]({'name':_0x154bfb[_0xf8a3('0x2a')],'resourceId':_0x154bfb['id'],'type':_0x5efd90[_0xf8a3('0x2a')],'sectionId':_0x5efd90['id']},{})[_0xf8a3('0x23')](function(){return _0x5ae4bd;});}else{return _0x5ae4bd;}})[_0xf8a3('0x43')](function(_0x3d9657){logger[_0xf8a3('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3d9657);});}return _0x5ae4bd;});})[_0xf8a3('0x23')](respondWithResult(_0x4926f6,0xc9))[_0xf8a3('0x43')](handleError(_0x4926f6,null));};exports['destroy']=function(_0x3a9224,_0x5ab5e8,_0x22e08f){var _0x9e5cb9;return db[_0xf8a3('0x2e')][_0xf8a3('0x48')]({'where':{'id':_0x3a9224[_0xf8a3('0x45')]['id']}})[_0xf8a3('0x23')](function(_0x379b9b){if(_0x379b9b){return db['sequelize'][_0xf8a3('0x56')](function(_0x693923){return _0x379b9b[_0xf8a3('0x24')]({'transaction':_0x693923,'raw':!![]})[_0xf8a3('0x23')](function(_0x2c99dd){if(_0x2c99dd[_0xf8a3('0x51')]){fs[_0xf8a3('0x57')](_0x2c99dd['directory'])[_0xf8a3('0x58')](function(_0x26a384){fs['unlinkSync'](path[_0xf8a3('0x4d')](_0x2c99dd[_0xf8a3('0x51')],_0x26a384));});fs['rmdirSync'](_0x2c99dd[_0xf8a3('0x51')]);}return _0x2c99dd;});})[_0xf8a3('0x43')](function(_0x53137b){throw new db[(_0xf8a3('0x59'))][(_0xf8a3('0x5a'))](_0x53137b[_0xf8a3('0x5b')]);});}})[_0xf8a3('0x23')](handleEntityNotFound(_0x5ab5e8,null))['then'](removeEntity(_0x5ab5e8,null))[_0xf8a3('0x43')](handleError(_0x5ab5e8,null));};exports[_0xf8a3('0x5c')]=function(_0x2a20d6,_0xfd14d9,_0x482219){return db[_0xf8a3('0x4a')][_0xf8a3('0x56')](function(_0x1cb9dc){var _0x5b996e;return db[_0xf8a3('0x2e')]['find']({'where':{'id':_0x2a20d6['params']['id']}})[_0xf8a3('0x23')](function(_0x5ba642){if(_0x5ba642){_0x5b996e=_0x5ba642;return _0x5ba642[_0xf8a3('0x5c')](_0x2a20d6[_0xf8a3('0x47')]['id'],{'transaction':_0x1cb9dc});}})[_0xf8a3('0x23')](function(_0x3d13ee){if(_0x3d13ee){return db[_0xf8a3('0x5d')][_0xf8a3('0x5e')]({'where':{'id':_0x2a20d6['body']['id']},'attributes':['id',_0xf8a3('0x2a'),_0xf8a3('0x5f'),_0xf8a3('0x60'),_0xf8a3('0x61')],'raw':!![]});}})['then'](function(_0x1d72a4){if(_0x1d72a4){var _0x1c7f62=path[_0xf8a3('0x4d')](config[_0xf8a3('0x4e')],_0xf8a3('0x62'),util['format']('%s.%s',path['basename'](_0x1d72a4[_0xf8a3('0x5f')],path[_0xf8a3('0x63')](_0x1d72a4[_0xf8a3('0x5f')])),_0x1d72a4[_0xf8a3('0x60')]));var _0xc7d94d=path['join'](config[_0xf8a3('0x4e')],_0xf8a3('0x4f'),_0x5b996e[_0xf8a3('0x2a')],util[_0xf8a3('0x64')]('%s.%s',_0x1d72a4[_0xf8a3('0x2a')],_0x1d72a4[_0xf8a3('0x60')]));fs[_0xf8a3('0x65')](_0x1c7f62,_0xc7d94d);return _0x1d72a4;}})['catch'](function(_0xcfbc1b){throw new db[(_0xf8a3('0x59'))][(_0xf8a3('0x5a'))](_0xcfbc1b[_0xf8a3('0x5b')]);});})[_0xf8a3('0x23')](handleEntityNotFound(_0xfd14d9,null))['then'](respondWithResult(_0xfd14d9,0xc9))[_0xf8a3('0x43')](handleError(_0xfd14d9,null));};exports[_0xf8a3('0x66')]=function(_0x1129e7,_0x19a8e5,_0x391369){return db[_0xf8a3('0x4a')][_0xf8a3('0x56')](function(_0x37a69a){var _0x5bae7d;return db[_0xf8a3('0x2e')][_0xf8a3('0x5e')]({'where':{'id':_0x1129e7[_0xf8a3('0x45')]['id']}})[_0xf8a3('0x23')](handleEntityNotFound(_0x19a8e5,null))['then'](function(_0x4938e0){if(_0x4938e0){_0x5bae7d=_0x4938e0;return _0x4938e0[_0xf8a3('0x66')](_0x1129e7[_0xf8a3('0x45')][_0xf8a3('0x67')]);}})[_0xf8a3('0x23')](function(_0x4c257f){if(_0x4c257f){return db['Sound'][_0xf8a3('0x5e')]({'where':{'id':_0x1129e7['params'][_0xf8a3('0x67')]},'attributes':['id',_0xf8a3('0x2a'),_0xf8a3('0x5f'),_0xf8a3('0x60'),_0xf8a3('0x61')],'raw':!![]});}})['then'](function(_0x3c5927){if(_0x3c5927){fs[_0xf8a3('0x68')](path[_0xf8a3('0x4d')](_0x5bae7d[_0xf8a3('0x51')],util['format']('%s.%s',_0x3c5927[_0xf8a3('0x2a')],_0x3c5927[_0xf8a3('0x60')])));return _0x3c5927;}})['catch'](function(_0x13f905){throw new db[(_0xf8a3('0x59'))]['ValidationError'](_0x13f905[_0xf8a3('0x5b')]);});})[_0xf8a3('0x23')](handleEntityNotFound(_0x19a8e5,null))['then'](respondWithStatusCode(_0x19a8e5,0xcc))[_0xf8a3('0x43')](handleError(_0x19a8e5,null));};exports[_0xf8a3('0x69')]=function(_0x542a27,_0x44e7e9,_0x22cc93){var _0x16f039={};var _0x471667={};var _0x41edbd;var _0x14fbf7;return db[_0xf8a3('0x2e')][_0xf8a3('0x5e')]({'where':{'id':_0x542a27['params']['id']}})['then'](handleEntityNotFound(_0x44e7e9,null))['then'](function(_0x1e6379){if(_0x1e6379){_0x41edbd=_0x1e6379;_0x471667[_0xf8a3('0x34')]=_['keys'](db['Sound'][_0xf8a3('0x2f')]);_0x471667['query']=_['keys'](_0x542a27[_0xf8a3('0x31')]);_0x471667[_0xf8a3('0x33')]=_['intersection'](_0x471667['model'],_0x471667[_0xf8a3('0x31')]);_0x16f039['attributes']=_['intersection'](_0x471667[_0xf8a3('0x34')],qs[_0xf8a3('0x37')](_0x542a27[_0xf8a3('0x31')][_0xf8a3('0x37')]));_0x16f039[_0xf8a3('0x35')]=_0x16f039[_0xf8a3('0x35')][_0xf8a3('0x6a')]?_0x16f039[_0xf8a3('0x35')]:_0x471667['model'];_0x16f039[_0xf8a3('0x3a')]=qs['sort'](_0x542a27[_0xf8a3('0x31')][_0xf8a3('0x3b')]);_0x16f039['where']=qs[_0xf8a3('0x33')](_['pick'](_0x542a27[_0xf8a3('0x31')],_0x471667['filters']));if(_0x542a27['query']['filter']){_0x16f039[_0xf8a3('0x3c')]=_[_0xf8a3('0x3e')](_0x16f039['where'],{'$or':_['map'](_0x16f039['attributes'],function(_0x2efd97){var _0x3e849={};_0x3e849[_0x2efd97]={'$like':'%'+_0x542a27[_0xf8a3('0x31')][_0xf8a3('0x3d')]+'%'};return _0x3e849;})});}_0x16f039=_[_0xf8a3('0x3e')]({},_0x16f039,_0x542a27['options']);return _0x41edbd[_0xf8a3('0x69')](_0x16f039);}})[_0xf8a3('0x23')](function(_0x426b19){if(_0x426b19){_0x14fbf7=_0x426b19[_0xf8a3('0x6a')];if(!_0x542a27[_0xf8a3('0x31')]['hasOwnProperty'](_0xf8a3('0x39'))){_0x16f039[_0xf8a3('0x1f')]=qs['limit'](_0x542a27[_0xf8a3('0x31')][_0xf8a3('0x1f')]);_0x16f039[_0xf8a3('0x1c')]=qs[_0xf8a3('0x1c')](_0x542a27['query'][_0xf8a3('0x1c')]);}return _0x41edbd[_0xf8a3('0x69')](_0x16f039);}})['then'](function(_0x3b6fa3){if(_0x3b6fa3){return _0x3b6fa3?{'count':_0x14fbf7,'rows':_0x3b6fa3}:null;}})['then'](respondWithResult(_0x44e7e9,null))['catch'](handleError(_0x44e7e9,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index fce67a6..fea452c 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 _0x1016=['rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','voice_musiconhold','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x8842a,_0x507a61){var _0x5f275d=function(_0x4133b0){while(--_0x4133b0){_0x8842a['push'](_0x8842a['shift']());}};_0x5f275d(++_0x507a61);}(_0x1016,0x124));var _0x6101=function(_0x4b0cf3,_0x20ff92){_0x4b0cf3=_0x4b0cf3-0x0;var _0x1196ef=_0x1016[_0x4b0cf3];return _0x1196ef;};'use strict';var _=require(_0x6101('0x0'));var util=require(_0x6101('0x1'));var logger=require(_0x6101('0x2'))('api');var moment=require(_0x6101('0x3'));var BPromise=require(_0x6101('0x4'));var rp=require(_0x6101('0x5'));var fs=require('fs');var path=require(_0x6101('0x6'));var rimraf=require(_0x6101('0x7'));var config=require(_0x6101('0x8'));var attributes=require(_0x6101('0x9'));module[_0x6101('0xa')]=function(_0x49bf64,_0x3bd613){return _0x49bf64[_0x6101('0xb')]('VoiceMusicOnHold',attributes,{'tableName':_0x6101('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd803=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger','api'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xd803,0x114));var _0x3d80=function(_0x53b282,_0x1125a9){_0x53b282=_0x53b282-0x0;var _0x12c1da=_0xd803[_0x53b282];return _0x12c1da;};'use strict';var _=require(_0x3d80('0x0'));var util=require(_0x3d80('0x1'));var logger=require(_0x3d80('0x2'))(_0x3d80('0x3'));var moment=require(_0x3d80('0x4'));var BPromise=require(_0x3d80('0x5'));var rp=require(_0x3d80('0x6'));var fs=require('fs');var path=require(_0x3d80('0x7'));var rimraf=require(_0x3d80('0x8'));var config=require(_0x3d80('0x9'));var attributes=require('./voiceMusicOnHold.attributes');module[_0x3d80('0xa')]=function(_0x25cb5e,_0x334f19){return _0x25cb5e[_0x3d80('0xb')](_0x3d80('0xc'),attributes,{'tableName':_0x3d80('0xd'),'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 b338b12..42f5ac1 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 _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(_0x194d02,_0x2fdaff){var _0x524af2=function(_0x292496){while(--_0x292496){_0x194d02['push'](_0x194d02['shift']());}};_0x524af2(++_0x2fdaff);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'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 _0xe706=['http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x559431,_0x106ad3){var _0x43192b=function(_0x2107e5){while(--_0x2107e5){_0x559431['push'](_0x559431['shift']());}};_0x43192b(++_0x106ad3);}(_0xe706,0xa3));var _0x6e70=function(_0x5d0818,_0x188411){_0x5d0818=_0x5d0818-0x0;var _0x37fcdb=_0xe706[_0x5d0818];return _0x37fcdb;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index a419deb..b11d0ac 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 _0xdcf6=['/:id','show','getAgents','get','/:id/teams','getTeams','post','create','/:id/users','addAgents','addTeams','put','update','delete','destroy','removeAgents','removeTeams','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voicePrefix.controller','isAuthenticated','index','describe'];(function(_0x1eccef,_0x1181d4){var _0x51c6f2=function(_0x151fba){while(--_0x151fba){_0x1eccef['push'](_0x1eccef['shift']());}};_0x51c6f2(++_0x1181d4);}(_0xdcf6,0x1b6));var _0x6dcf=function(_0x19ac6e,_0x435862){_0x19ac6e=_0x19ac6e-0x0;var _0x1cdcf3=_0xdcf6[_0x19ac6e];return _0x1cdcf3;};'use strict';var multer=require('multer');var util=require(_0x6dcf('0x0'));var path=require(_0x6dcf('0x1'));var timeout=require(_0x6dcf('0x2'));var express=require(_0x6dcf('0x3'));var router=express[_0x6dcf('0x4')]();var fs_extra=require(_0x6dcf('0x5'));var auth=require(_0x6dcf('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6dcf('0x7'));var controller=require(_0x6dcf('0x8'));router['get']('/',auth[_0x6dcf('0x9')](),controller[_0x6dcf('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x6dcf('0xb')]);router['get'](_0x6dcf('0xc'),auth[_0x6dcf('0x9')](),controller[_0x6dcf('0xd')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0x6dcf('0xe')]);router[_0x6dcf('0xf')](_0x6dcf('0x10'),auth['isAuthenticated'](),controller[_0x6dcf('0x11')]);router[_0x6dcf('0x12')]('/',auth[_0x6dcf('0x9')](),controller[_0x6dcf('0x13')]);router[_0x6dcf('0x12')](_0x6dcf('0x14'),auth[_0x6dcf('0x9')](),controller[_0x6dcf('0x15')]);router[_0x6dcf('0x12')](_0x6dcf('0x10'),auth[_0x6dcf('0x9')](),controller[_0x6dcf('0x16')]);router[_0x6dcf('0x17')](_0x6dcf('0xc'),auth[_0x6dcf('0x9')](),controller[_0x6dcf('0x18')]);router[_0x6dcf('0x19')]('/:id',auth[_0x6dcf('0x9')](),controller[_0x6dcf('0x1a')]);router[_0x6dcf('0x19')]('/:id/users',auth[_0x6dcf('0x9')](),controller[_0x6dcf('0x1b')]);router[_0x6dcf('0x19')](_0x6dcf('0x10'),auth[_0x6dcf('0x9')](),controller[_0x6dcf('0x1c')]);module[_0x6dcf('0x1d')]=router; \ No newline at end of file +var _0xac8d=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voicePrefix.controller','get','isAuthenticated','index','/describe','describe','/:id/users','getAgents','post','create','addTeams','put','/:id','delete','destroy','removeAgents','/:id/teams','removeTeams','exports','multer','util','path','connect-timeout'];(function(_0x14e7a7,_0x41b984){var _0x56e97a=function(_0x5ab889){while(--_0x5ab889){_0x14e7a7['push'](_0x14e7a7['shift']());}};_0x56e97a(++_0x41b984);}(_0xac8d,0x1d8));var _0xdac8=function(_0x267a87,_0x4fa360){_0x267a87=_0x267a87-0x0;var _0x13d547=_0xac8d[_0x267a87];return _0x13d547;};'use strict';var multer=require(_0xdac8('0x0'));var util=require(_0xdac8('0x1'));var path=require(_0xdac8('0x2'));var timeout=require(_0xdac8('0x3'));var express=require(_0xdac8('0x4'));var router=express[_0xdac8('0x5')]();var fs_extra=require(_0xdac8('0x6'));var auth=require(_0xdac8('0x7'));var interaction=require(_0xdac8('0x8'));var config=require('../../config/environment');var controller=require(_0xdac8('0x9'));router[_0xdac8('0xa')]('/',auth[_0xdac8('0xb')](),controller[_0xdac8('0xc')]);router[_0xdac8('0xa')](_0xdac8('0xd'),auth[_0xdac8('0xb')](),controller[_0xdac8('0xe')]);router[_0xdac8('0xa')]('/:id',auth[_0xdac8('0xb')](),controller['show']);router[_0xdac8('0xa')](_0xdac8('0xf'),auth[_0xdac8('0xb')](),controller[_0xdac8('0x10')]);router[_0xdac8('0xa')]('/:id/teams',auth[_0xdac8('0xb')](),controller['getTeams']);router[_0xdac8('0x11')]('/',auth[_0xdac8('0xb')](),controller[_0xdac8('0x12')]);router['post'](_0xdac8('0xf'),auth['isAuthenticated'](),controller['addAgents']);router[_0xdac8('0x11')]('/:id/teams',auth[_0xdac8('0xb')](),controller[_0xdac8('0x13')]);router[_0xdac8('0x14')](_0xdac8('0x15'),auth[_0xdac8('0xb')](),controller['update']);router[_0xdac8('0x16')](_0xdac8('0x15'),auth[_0xdac8('0xb')](),controller[_0xdac8('0x17')]);router['delete'](_0xdac8('0xf'),auth[_0xdac8('0xb')](),controller[_0xdac8('0x18')]);router[_0xdac8('0x16')](_0xdac8('0x19'),auth[_0xdac8('0xb')](),controller[_0xdac8('0x1a')]);module[_0xdac8('0x1b')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 10aad96..7eaa7f4 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 _0x5bb1=['system-','INTEGER','exports','STRING','name'];(function(_0x3c27db,_0x40c0f5){var _0x35d0ad=function(_0x49f1c0){while(--_0x49f1c0){_0x3c27db['push'](_0x3c27db['shift']());}};_0x35d0ad(++_0x40c0f5);}(_0x5bb1,0x156));var _0x15bb=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0x5bb1[_0x38ced4];return _0x547c07;};'use strict';var Sequelize=require('sequelize');module[_0x15bb('0x0')]={'name':{'type':Sequelize[_0x15bb('0x1')],'allowNull':![],'unique':_0x15bb('0x2')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x2a07af){return _0x15bb('0x3')+this['getDataValue'](_0x15bb('0x2'))+'-';}},'description':{'type':Sequelize[_0x15bb('0x1')]},'callerIdAll':{'type':Sequelize[_0x15bb('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0x15bb('0x4')]}}; \ No newline at end of file +var _0xb375=['STRING','getDataValue','INTEGER','exports'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xb375,0x1bf));var _0x5b37=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xb375[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require('sequelize');module[_0x5b37('0x0')]={'name':{'type':Sequelize[_0x5b37('0x1')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x251419){return'system-'+this[_0x5b37('0x2')]('name')+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0x5b37('0x3')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 82d62cc..5a5d63f 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 _0x0b0e=['length','sort','where','pick','filter','merge','options','count','includeAll','findAll','rows','params','find','describe','sequelize','transaction','body','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','create','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','system','description','Voice\x20Prefix\x20Extension','priority','appdata','NoOp','Voice\x20Prefix','VoicePrefixId','VoiceExtension','prefix','push','Set','CDR(prefix)=','callerIdAll','goto','charAt','findById','addAgents','omit','ids','spread','emit','isArray','userVoicePrefix:remove','findOne','User','order','getAgents','nolimit','Team','getTeams','addTeams','Agents','online','voicePause','interface','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','userVoicePrefix:save','tq.TeamId','from','team_has_voice_prefixes','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','TeamId','includes','all','compact','value','isEmpty','removeAgents','eml-format','zip-dir','request-promise','moment','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','redis','defaults','localhost','./voicePrefix.socket','register','sendStatus','end','json','undefined','offset','limit','status','set','apply','save','update','destroy','get','VoicePrefixes','UserProfileResource','then','stack','name','send','index','map','VoicePrefix','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x344ca1,_0x20edbb){var _0xceee76=function(_0x3c71ce){while(--_0x3c71ce){_0x344ca1['push'](_0x344ca1['shift']());}};_0xceee76(++_0x20edbb);}(_0x0b0e,0x187));var _0xe0b0=function(_0x1945a5,_0x50de54){_0x1945a5=_0x1945a5-0x0;var _0x5817a5=_0x0b0e[_0x1945a5];return _0x5817a5;};'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'];config[_0xe0b0('0x18')]=_[_0xe0b0('0x19')](config[_0xe0b0('0x18')],{'host':_0xe0b0('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe0b0('0x18')]));require(_0xe0b0('0x1b'))[_0xe0b0('0x1c')](socket);function respondWithStatusCode(_0x24babd,_0x177c24){_0x177c24=_0x177c24||0xcc;return function(_0x55d884){if(_0x55d884){return _0x24babd[_0xe0b0('0x1d')](_0x177c24);}return _0x24babd['status'](_0x177c24)[_0xe0b0('0x1e')]();};}function respondWithResult(_0xadee6e,_0x519ae8){_0x519ae8=_0x519ae8||0xc8;return function(_0x11fdca){if(_0x11fdca){return _0xadee6e['status'](_0x519ae8)[_0xe0b0('0x1f')](_0x11fdca);}};}function respondWithFilteredResult(_0x100204,_0x56bcc7){return function(_0x54a3eb){if(_0x54a3eb){var _0x46bb44=typeof _0x56bcc7['offset']==='undefined'&&typeof _0x56bcc7['limit']===_0xe0b0('0x20');var _0x50fa4a=_0x54a3eb['count'];var _0x10cde1=_0x46bb44?0x0:_0x56bcc7['offset'];var _0x472286=_0x46bb44?_0x54a3eb['count']:_0x56bcc7[_0xe0b0('0x21')]+_0x56bcc7[_0xe0b0('0x22')];var _0x3e10b3;if(_0x472286>=_0x50fa4a){_0x472286=_0x50fa4a;_0x3e10b3=0xc8;}else{_0x3e10b3=0xce;}_0x100204[_0xe0b0('0x23')](_0x3e10b3);return _0x100204[_0xe0b0('0x24')]('Content-Range',_0x10cde1+'-'+_0x472286+'/'+_0x50fa4a)['json'](_0x54a3eb);}return null;};}function patchUpdates(_0x2fa820){return function(_0x5512bb){try{jsonpatch[_0xe0b0('0x25')](_0x5512bb,_0x2fa820,!![]);}catch(_0x31b5f8){return BPromise['reject'](_0x31b5f8);}return _0x5512bb[_0xe0b0('0x26')]();};}function saveUpdates(_0x503883,_0x2208d0){return function(_0x49a727){if(_0x49a727){return _0x49a727[_0xe0b0('0x27')](_0x503883)['then'](function(_0x3e5c88){return _0x3e5c88;});}return null;};}function removeEntity(_0x4de537,_0x4700cc){return function(_0x4aafbe){if(_0x4aafbe){return _0x4aafbe[_0xe0b0('0x28')]()['then'](function(){var _0x362aba=_0x4aafbe[_0xe0b0('0x29')]({'plain':!![]});var _0x1f1ebd=_0xe0b0('0x2a');return db[_0xe0b0('0x2b')][_0xe0b0('0x28')]({'where':{'type':_0x1f1ebd,'resourceId':_0x362aba['id']}})['then'](function(){return _0x4aafbe;});})[_0xe0b0('0x2c')](function(){_0x4de537[_0xe0b0('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15e13b,_0x419b1f){return function(_0x36d137){if(!_0x36d137){_0x15e13b[_0xe0b0('0x1d')](0x194);}return _0x36d137;};}function handleError(_0x3cdbd5,_0x254cad){_0x254cad=_0x254cad||0x1f4;return function(_0x136bd4){logger['error'](_0x136bd4[_0xe0b0('0x2d')]);if(_0x136bd4[_0xe0b0('0x2e')]){delete _0x136bd4['name'];}_0x3cdbd5['status'](_0x254cad)[_0xe0b0('0x2f')](_0x136bd4);};}exports[_0xe0b0('0x30')]=function(_0x422575,_0x3f81d5){var _0x2ab1b1={},_0x5866e5={},_0x32acfe={'count':0x0,'rows':[]};var _0x3231fc=_[_0xe0b0('0x31')](db[_0xe0b0('0x32')][_0xe0b0('0x33')],function(_0x4fe835){return{'name':_0x4fe835[_0xe0b0('0x34')],'type':_0x4fe835[_0xe0b0('0x35')][_0xe0b0('0x36')]};});_0x5866e5[_0xe0b0('0x37')]=_[_0xe0b0('0x31')](_0x3231fc,_0xe0b0('0x2e'));_0x5866e5[_0xe0b0('0x38')]=_[_0xe0b0('0x39')](_0x422575[_0xe0b0('0x38')]);_0x5866e5[_0xe0b0('0x3a')]=_[_0xe0b0('0x3b')](_0x5866e5[_0xe0b0('0x37')],_0x5866e5[_0xe0b0('0x38')]);_0x2ab1b1[_0xe0b0('0x3c')]=_[_0xe0b0('0x3b')](_0x5866e5['model'],qs[_0xe0b0('0x3d')](_0x422575[_0xe0b0('0x38')][_0xe0b0('0x3d')]));_0x2ab1b1[_0xe0b0('0x3c')]=_0x2ab1b1[_0xe0b0('0x3c')][_0xe0b0('0x3e')]?_0x2ab1b1[_0xe0b0('0x3c')]:_0x5866e5['model'];if(!_0x422575['query']['hasOwnProperty']('nolimit')){_0x2ab1b1[_0xe0b0('0x22')]=qs[_0xe0b0('0x22')](_0x422575[_0xe0b0('0x38')]['limit']);_0x2ab1b1[_0xe0b0('0x21')]=qs[_0xe0b0('0x21')](_0x422575[_0xe0b0('0x38')][_0xe0b0('0x21')]);}_0x2ab1b1['order']=qs[_0xe0b0('0x3f')](_0x422575[_0xe0b0('0x38')][_0xe0b0('0x3f')]);_0x2ab1b1[_0xe0b0('0x40')]=qs[_0xe0b0('0x3a')](_[_0xe0b0('0x41')](_0x422575[_0xe0b0('0x38')],_0x5866e5[_0xe0b0('0x3a')]),_0x3231fc);if(_0x422575[_0xe0b0('0x38')]['filter']){_0x2ab1b1[_0xe0b0('0x40')]=_['merge'](_0x2ab1b1[_0xe0b0('0x40')],{'$or':_[_0xe0b0('0x31')](_0x3231fc,function(_0x46c4ea){if(_0x46c4ea[_0xe0b0('0x35')]!=='VIRTUAL'){var _0x3e1b6b={};_0x3e1b6b[_0x46c4ea[_0xe0b0('0x2e')]]={'$like':'%'+_0x422575[_0xe0b0('0x38')][_0xe0b0('0x42')]+'%'};return _0x3e1b6b;}})});}_0x2ab1b1=_[_0xe0b0('0x43')]({},_0x2ab1b1,_0x422575[_0xe0b0('0x44')]);var _0x3ad564={'where':_0x2ab1b1[_0xe0b0('0x40')]};return db['VoicePrefix'][_0xe0b0('0x45')](_0x3ad564)[_0xe0b0('0x2c')](function(_0x528818){_0x32acfe['count']=_0x528818;if(_0x422575[_0xe0b0('0x38')][_0xe0b0('0x46')]){_0x2ab1b1['include']=[{'all':!![]}];}return db[_0xe0b0('0x32')][_0xe0b0('0x47')](_0x2ab1b1);})[_0xe0b0('0x2c')](function(_0x1c869d){_0x32acfe[_0xe0b0('0x48')]=_0x1c869d;return _0x32acfe;})['then'](respondWithFilteredResult(_0x3f81d5,_0x2ab1b1))['catch'](handleError(_0x3f81d5,null));};exports['show']=function(_0xc3235b,_0x38e715){var _0x5c2f3b={'raw':![],'where':{'id':_0xc3235b[_0xe0b0('0x49')]['id']}},_0x9f7459={};_0x9f7459[_0xe0b0('0x37')]=_[_0xe0b0('0x39')](db[_0xe0b0('0x32')]['rawAttributes']);_0x9f7459['query']=_[_0xe0b0('0x39')](_0xc3235b[_0xe0b0('0x38')]);_0x9f7459[_0xe0b0('0x3a')]=_[_0xe0b0('0x3b')](_0x9f7459[_0xe0b0('0x37')],_0x9f7459['query']);_0x5c2f3b[_0xe0b0('0x3c')]=_[_0xe0b0('0x3b')](_0x9f7459['model'],qs['fields'](_0xc3235b['query'][_0xe0b0('0x3d')]));_0x5c2f3b[_0xe0b0('0x3c')]=_0x5c2f3b[_0xe0b0('0x3c')][_0xe0b0('0x3e')]?_0x5c2f3b['attributes']:_0x9f7459[_0xe0b0('0x37')];if(_0xc3235b[_0xe0b0('0x38')]['includeAll']){_0x5c2f3b['include']=[{'all':!![]}];}_0x5c2f3b=_[_0xe0b0('0x43')]({},_0x5c2f3b,_0xc3235b[_0xe0b0('0x44')]);return db['VoicePrefix'][_0xe0b0('0x4a')](_0x5c2f3b)[_0xe0b0('0x2c')](handleEntityNotFound(_0x38e715,null))['then'](respondWithResult(_0x38e715,null))['catch'](handleError(_0x38e715,null));};exports[_0xe0b0('0x28')]=function(_0x511679,_0x165dc8){return db[_0xe0b0('0x32')][_0xe0b0('0x4a')]({'where':{'id':_0x511679[_0xe0b0('0x49')]['id']}})[_0xe0b0('0x2c')](handleEntityNotFound(_0x165dc8,null))[_0xe0b0('0x2c')](removeEntity(_0x165dc8,null))['catch'](handleError(_0x165dc8,null));};exports['describe']=function(_0x2ef908,_0x5d380a){return db['VoicePrefix'][_0xe0b0('0x4b')]()[_0xe0b0('0x2c')](respondWithResult(_0x5d380a,null))['catch'](handleError(_0x5d380a,null));};exports['create']=function(_0x13adfb,_0x10b5a6){var _0x17b09f;return db[_0xe0b0('0x4c')][_0xe0b0('0x4d')](function(_0x24115f){return db[_0xe0b0('0x32')]['create'](_0x13adfb[_0xe0b0('0x4e')],{'transaction':_0x24115f})['then'](function(_0x17b3d4){_0x17b09f=_0x17b3d4['get']({'plain':!![]});return db['VoiceExtension'][_0xe0b0('0x4a')]({'where':{'id':_0x17b09f[_0xe0b0('0x4f')]},'raw':!![]})[_0xe0b0('0x2c')](function(_0x2f1712){return createVoicePrefixExtensions(_0x17b09f,_0x2f1712,_0x24115f);});});})[_0xe0b0('0x2c')](function(){var _0x2a588d=_0x13adfb[_0xe0b0('0x50')][_0xe0b0('0x29')]({'plain':!![]});if(!_0x2a588d)throw new Error(_0xe0b0('0x51'));if(_0x2a588d['role']===_0xe0b0('0x50')){var _0x57ccc9=_0x17b09f;return db[_0xe0b0('0x52')][_0xe0b0('0x4a')]({'where':{'name':_0xe0b0('0x2a'),'userProfileId':_0x2a588d[_0xe0b0('0x53')]},'raw':!![]})[_0xe0b0('0x2c')](function(_0x3bdb25){if(_0x3bdb25&&_0x3bdb25['autoAssociation']===0x0){return db[_0xe0b0('0x2b')][_0xe0b0('0x54')]({'name':_0x57ccc9[_0xe0b0('0x2e')],'resourceId':_0x57ccc9['id'],'type':_0x3bdb25[_0xe0b0('0x2e')],'sectionId':_0x3bdb25['id']},{})[_0xe0b0('0x2c')](function(){return _0x17b09f;});}else{return _0x17b09f;}})[_0xe0b0('0x55')](function(_0x234cb7){logger[_0xe0b0('0x56')](_0xe0b0('0x57'),_0x234cb7);throw _0x234cb7;});}return _0x17b09f;})[_0xe0b0('0x2c')](respondWithResult(_0x10b5a6,null))[_0xe0b0('0x55')](handleError(_0x10b5a6,null));};function Extension(_0x18ab99,_0xc719d2,_0x10eb99,_0xcdf97){this[_0xe0b0('0x58')]=_0xe0b0('0x59');this[_0xe0b0('0x5a')]=_0x18ab99;this['app']=_0x10eb99;this[_0xe0b0('0x35')]=_0xe0b0('0x5b');this[_0xe0b0('0x5c')]=_0xe0b0('0x5d');this[_0xe0b0('0x5e')]=_0xc719d2;this[_0xe0b0('0x5f')]=_0xcdf97;}function createVoicePrefixExtensions(_0x2bdb59,_0x4f818b,_0x47dcc4){return new BPromise(function(_0x139014,_0x2a0415){var _0x157556=new Extension(formatPrefixName(_0x2bdb59['prefix']),0x1,_0xe0b0('0x60'),_0xe0b0('0x61'));_0x157556[_0xe0b0('0x62')]=_0x2bdb59['id'];return db[_0xe0b0('0x63')][_0xe0b0('0x54')](_0x157556,{'transaction':_0x47dcc4})['then'](function(_0x370f8c){var _0x242120=_0x370f8c[_0xe0b0('0x29')]({'plain':!![]});var _0x54b5d6=_[_0xe0b0('0x31')](addVoicePrefixExtensions(_0x2bdb59,_0x4f818b),function(_0x30b3ae){_0x30b3ae['VoiceExtensionId']=_0x242120['id'];_0x30b3ae[_0xe0b0('0x62')]=_0x2bdb59['id'];return _0x30b3ae;});return db['VoiceExtension']['bulkCreate'](_0x54b5d6,{'transaction':_0x47dcc4})[_0xe0b0('0x2c')](function(_0x57b51e){if(!_0x57b51e){return _0x2a0415('Extensions\x20creation\x20failed');}else{return _0x139014(_0x57b51e);}})[_0xe0b0('0x55')](function(_0xd750b4){return _0x2a0415(_0xd750b4);});});;});};function addVoicePrefixExtensions(_0x2d91f1,_0x1a4fad){var _0x5a7913=[];var _0x3679e0=formatPrefixName(_0x2d91f1[_0xe0b0('0x64')]);_0x5a7913[_0xe0b0('0x65')](new Extension(_0x3679e0,0x2,_0xe0b0('0x66'),_0xe0b0('0x67')+_0x2d91f1[_0xe0b0('0x2e')]));if(_0x2d91f1[_0xe0b0('0x68')]){_0x5a7913[_0xe0b0('0x65')](new Extension(_0x3679e0,0x3,'Set','PREFIX-CALLERIDALL='+_0x2d91f1[_0xe0b0('0x68')]));}else{_0x5a7913[_0xe0b0('0x65')](new Extension(_0x3679e0,0x3,_0xe0b0('0x60'),'No\x20callerid\x20available'));}_0x5a7913['push'](new Extension(_0x3679e0,0x4,_0xe0b0('0x69'),_0x1a4fad[_0xe0b0('0x58')]+','+'${EXTEN:'+(0x8+_0x2d91f1['name'][_0xe0b0('0x3e')])+'}'+','+0x1));return _0x5a7913;}function formatPrefixName(_0x42b2d3){var _0x38eb8e='_';for(var _0x29175a=0x0;_0x29175a<_0x42b2d3[_0xe0b0('0x3e')];_0x29175a++){if(_0x42b2d3[_0xe0b0('0x6a')](_0x29175a)=='-'){_0x38eb8e+=_0x42b2d3[_0xe0b0('0x6a')](_0x29175a);}else{_0x38eb8e+='['+_0x42b2d3[_0xe0b0('0x6a')](_0x29175a)+']';}}_0x38eb8e+='.';return _0x38eb8e;}exports['update']=function(_0x1daff7,_0x12e245,_0x1673bc){var _0x494420=_0x1daff7['body'];_0x494420['prefix']='system-'+_0x494420['name']+'-';return db['sequelize'][_0xe0b0('0x4d')](function(_0x51b492){return db['VoicePrefix'][_0xe0b0('0x27')](_0x494420,{'where':{'id':_0x494420['id']},'transaction':_0x51b492})[_0xe0b0('0x2c')](function(){return db[_0xe0b0('0x63')][_0xe0b0('0x28')]({'where':{'VoicePrefixId':_0x494420['id']},'transaction':_0x51b492})[_0xe0b0('0x2c')](function(){return db[_0xe0b0('0x63')][_0xe0b0('0x4a')]({'where':{'id':_0x494420[_0xe0b0('0x4f')]},'raw':!![]})['then'](function(_0x3097fb){return createVoicePrefixExtensions(_0x494420,_0x3097fb,_0x51b492);});});});})[_0xe0b0('0x2c')](function(){return db[_0xe0b0('0x32')][_0xe0b0('0x6b')](_0x494420['id']);})[_0xe0b0('0x2c')](respondWithResult(_0x12e245,null))[_0xe0b0('0x55')](handleError(_0x12e245,null));};exports[_0xe0b0('0x6c')]=function(_0x5e3e28,_0xaf2607,_0x5981a3){return db[_0xe0b0('0x32')][_0xe0b0('0x4a')]({'where':{'id':_0x5e3e28[_0xe0b0('0x49')]['id']}})[_0xe0b0('0x2c')](handleEntityNotFound(_0xaf2607,null))['then'](function(_0x311f79){if(_0x311f79){return _0x311f79[_0xe0b0('0x6c')](_0x5e3e28['body']['ids'],_[_0xe0b0('0x6d')](_0x5e3e28[_0xe0b0('0x4e')],[_0xe0b0('0x6e'),'id'])||{})[_0xe0b0('0x6f')](function(_0x8b1390){for(var _0x31dd21=0x0;_0x31dd21<_0x5e3e28[_0xe0b0('0x4e')][_0xe0b0('0x6e')][_0xe0b0('0x3e')];_0x31dd21+=0x1){socket[_0xe0b0('0x70')]('userVoicePrefix:save',{'UserId':Number(_0x5e3e28['body'][_0xe0b0('0x6e')][_0x31dd21]),'VoicePrefixId':Number(_0x5e3e28['params']['id'])});}return _0x8b1390;});}})['then'](respondWithResult(_0xaf2607,null))['catch'](handleError(_0xaf2607,null));};exports['removeAgents']=function(_0x55f064,_0x584350,_0x654d2b){return db[_0xe0b0('0x32')][_0xe0b0('0x4a')]({'where':{'id':_0x55f064[_0xe0b0('0x49')]['id']}})['then'](handleEntityNotFound(_0x584350,null))[_0xe0b0('0x2c')](function(_0x948708){if(_0x948708){return _0x948708['removeAgents'](_0x55f064[_0xe0b0('0x38')][_0xe0b0('0x6e')])[_0xe0b0('0x2c')](function(){if(_[_0xe0b0('0x71')](_0x55f064[_0xe0b0('0x38')]['ids'])){for(var _0x55d3f8=0x0;_0x55d3f8<_0x55f064['query']['ids']['length'];_0x55d3f8+=0x1){socket[_0xe0b0('0x70')]('userVoicePrefix:remove',{'UserId':Number(_0x55f064[_0xe0b0('0x38')]['ids'][_0x55d3f8]),'VoicePrefixId':Number(_0x55f064[_0xe0b0('0x49')]['id'])});}}else{socket[_0xe0b0('0x70')](_0xe0b0('0x72'),{'UserId':Number(_0x55f064[_0xe0b0('0x38')][_0xe0b0('0x6e')]),'VoicePrefixId':Number(_0x55f064[_0xe0b0('0x49')]['id'])});}});}})['then'](respondWithStatusCode(_0x584350,null))['catch'](handleError(_0x584350,null));};exports['getAgents']=function(_0x58e0e3,_0xc1919f,_0x261381){var _0x264363={};var _0x4377f7={};var _0x2c1149;var _0x534881;return db[_0xe0b0('0x32')][_0xe0b0('0x73')]({'where':{'id':_0x58e0e3[_0xe0b0('0x49')]['id']}})[_0xe0b0('0x2c')](handleEntityNotFound(_0xc1919f,null))[_0xe0b0('0x2c')](function(_0x2a5082){if(_0x2a5082){_0x2c1149=_0x2a5082;_0x4377f7[_0xe0b0('0x37')]=_[_0xe0b0('0x39')](db[_0xe0b0('0x74')]['rawAttributes']);_0x4377f7['query']=_[_0xe0b0('0x39')](_0x58e0e3[_0xe0b0('0x38')]);_0x4377f7['filters']=_[_0xe0b0('0x3b')](_0x4377f7[_0xe0b0('0x37')],_0x4377f7[_0xe0b0('0x38')]);_0x264363[_0xe0b0('0x3c')]=_[_0xe0b0('0x3b')](_0x4377f7[_0xe0b0('0x37')],qs[_0xe0b0('0x3d')](_0x58e0e3[_0xe0b0('0x38')]['fields']));_0x264363['attributes']=_0x264363['attributes'][_0xe0b0('0x3e')]?_0x264363[_0xe0b0('0x3c')]:_0x4377f7['model'];_0x264363[_0xe0b0('0x75')]=qs[_0xe0b0('0x3f')](_0x58e0e3[_0xe0b0('0x38')][_0xe0b0('0x3f')]);_0x264363['where']=qs['filters'](_['pick'](_0x58e0e3[_0xe0b0('0x38')],_0x4377f7[_0xe0b0('0x3a')]));if(_0x58e0e3['query'][_0xe0b0('0x42')]){_0x264363[_0xe0b0('0x40')]=_['merge'](_0x264363['where'],{'$or':_[_0xe0b0('0x31')](_0x264363['attributes'],function(_0x251195){var _0x5f06c0={};_0x5f06c0[_0x251195]={'$like':'%'+_0x58e0e3[_0xe0b0('0x38')][_0xe0b0('0x42')]+'%'};return _0x5f06c0;})});}_0x264363=_[_0xe0b0('0x43')]({},_0x264363,_0x58e0e3[_0xe0b0('0x44')]);return _0x2c1149[_0xe0b0('0x76')](_0x264363);}})[_0xe0b0('0x2c')](function(_0x434dfa){if(_0x434dfa){_0x534881=_0x434dfa[_0xe0b0('0x3e')];if(!_0x58e0e3[_0xe0b0('0x38')]['hasOwnProperty'](_0xe0b0('0x77'))){_0x264363[_0xe0b0('0x22')]=qs[_0xe0b0('0x22')](_0x58e0e3['query'][_0xe0b0('0x22')]);_0x264363['offset']=qs[_0xe0b0('0x21')](_0x58e0e3[_0xe0b0('0x38')]['offset']);}return _0x2c1149[_0xe0b0('0x76')](_0x264363);}})['then'](function(_0x528932){if(_0x528932){return _0x528932?{'count':_0x534881,'rows':_0x528932}:null;}})[_0xe0b0('0x2c')](respondWithResult(_0xc1919f,null))['catch'](handleError(_0xc1919f,null));};exports['getTeams']=function(_0x4f027c,_0x1e4bfb,_0x238979){var _0x9e8b9c={};var _0x42b591={};var _0x3da0ce;var _0x4e0429;return db[_0xe0b0('0x32')][_0xe0b0('0x73')]({'where':{'id':_0x4f027c[_0xe0b0('0x49')]['id']}})['then'](handleEntityNotFound(_0x1e4bfb,null))[_0xe0b0('0x2c')](function(_0x447641){if(_0x447641){_0x3da0ce=_0x447641;_0x42b591['model']=_['keys'](db[_0xe0b0('0x78')]['rawAttributes']);_0x42b591[_0xe0b0('0x38')]=_[_0xe0b0('0x39')](_0x4f027c[_0xe0b0('0x38')]);_0x42b591[_0xe0b0('0x3a')]=_[_0xe0b0('0x3b')](_0x42b591[_0xe0b0('0x37')],_0x42b591[_0xe0b0('0x38')]);_0x9e8b9c['attributes']=_[_0xe0b0('0x3b')](_0x42b591[_0xe0b0('0x37')],qs[_0xe0b0('0x3d')](_0x4f027c[_0xe0b0('0x38')][_0xe0b0('0x3d')]));_0x9e8b9c['attributes']=_0x9e8b9c['attributes'][_0xe0b0('0x3e')]?_0x9e8b9c[_0xe0b0('0x3c')]:_0x42b591[_0xe0b0('0x37')];_0x9e8b9c[_0xe0b0('0x75')]=qs[_0xe0b0('0x3f')](_0x4f027c[_0xe0b0('0x38')][_0xe0b0('0x3f')]);_0x9e8b9c[_0xe0b0('0x40')]=qs[_0xe0b0('0x3a')](_[_0xe0b0('0x41')](_0x4f027c['query'],_0x42b591[_0xe0b0('0x3a')]));if(_0x4f027c[_0xe0b0('0x38')][_0xe0b0('0x42')]){_0x9e8b9c[_0xe0b0('0x40')]=_['merge'](_0x9e8b9c[_0xe0b0('0x40')],{'$or':_[_0xe0b0('0x31')](_0x9e8b9c[_0xe0b0('0x3c')],function(_0x116c16){var _0x476763={};_0x476763[_0x116c16]={'$like':'%'+_0x4f027c['query'][_0xe0b0('0x42')]+'%'};return _0x476763;})});}_0x9e8b9c=_['merge']({},_0x9e8b9c,_0x4f027c[_0xe0b0('0x44')]);return _0x3da0ce[_0xe0b0('0x79')](_0x9e8b9c);}})[_0xe0b0('0x2c')](function(_0x23c448){if(_0x23c448){_0x4e0429=_0x23c448[_0xe0b0('0x3e')];if(!_0x4f027c['query']['hasOwnProperty'](_0xe0b0('0x77'))){_0x9e8b9c['limit']=qs[_0xe0b0('0x22')](_0x4f027c['query'][_0xe0b0('0x22')]);_0x9e8b9c[_0xe0b0('0x21')]=qs[_0xe0b0('0x21')](_0x4f027c[_0xe0b0('0x38')][_0xe0b0('0x21')]);}return _0x3da0ce[_0xe0b0('0x79')](_0x9e8b9c);}})[_0xe0b0('0x2c')](function(_0x5d7cee){if(_0x5d7cee){return _0x5d7cee?{'count':_0x4e0429,'rows':_0x5d7cee}:null;}})['then'](respondWithResult(_0x1e4bfb,null))[_0xe0b0('0x55')](handleError(_0x1e4bfb,null));};exports[_0xe0b0('0x7a')]=function(_0x184938,_0x20d6bd,_0xd83992){var _0x2b4d49=_0x184938[_0xe0b0('0x4e')][_0xe0b0('0x6e')];var _0x1bbb0d;return db[_0xe0b0('0x78')]['findAll']({'where':{'id':_0x2b4d49},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe0b0('0x7b'),'attributes':['id',_0xe0b0('0x2e'),_0xe0b0('0x7c'),_0xe0b0('0x7d'),_0xe0b0('0x7e')],'raw':!![]}]})[_0xe0b0('0x2c')](function(_0x33b67a){if(_0x33b67a){_0x1bbb0d=_0x33b67a;var _0x51995b=_['flatMap'](_0x33b67a,function(_0x302f9f){var _0x1ea4d5=_0x302f9f[_0xe0b0('0x29')]({'plain':!![]});return _0x1ea4d5[_0xe0b0('0x7b')];});return db[_0xe0b0('0x32')][_0xe0b0('0x4a')]({'where':{'id':_0x184938[_0xe0b0('0x49')]['id']}})[_0xe0b0('0x2c')](function(_0x6ef3b2){return db[_0xe0b0('0x4c')]['transaction'](function(_0x46b247){return _0x6ef3b2[_0xe0b0('0x7a')](_0x2b4d49,{'transaction':_0x46b247})['then'](function(){return BPromise[_0xe0b0('0x7f')](_0x1bbb0d,function(_0x4250f4){return db[_0xe0b0('0x80')][_0xe0b0('0x81')]({'TeamId':_0x4250f4['id'],'VoicePrefixId':_0x184938[_0xe0b0('0x49')]['id']},{'transaction':_0x46b247});});})['then'](function(){return BPromise[_0xe0b0('0x7f')](_0x51995b,function(_0x38f9af){return db[_0xe0b0('0x82')][_0xe0b0('0x83')]({'where':{'UserId':_0x38f9af['id'],'VoicePrefixId':_0x184938[_0xe0b0('0x49')]['id']},'transaction':_0x46b247});});})['then'](function(){_0x51995b[_0xe0b0('0x84')](function(_0x58d61b){socket[_0xe0b0('0x70')](_0xe0b0('0x85'),{'UserId':_0x58d61b['id'],'VoicePrefixId':_0x6ef3b2['id']});});});});});}})[_0xe0b0('0x2c')](respondWithStatusCode(_0x20d6bd,null))['catch'](handleError(_0x20d6bd,null));};exports['removeTeams']=function(_0x45ae1a,_0x2349df,_0x619226){return db['Team']['findAll']({'where':{'id':_0x45ae1a['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xe0b0('0x2c')](handleEntityNotFound(_0x2349df,null))[_0xe0b0('0x2c')](function(_0x5ac132){var _0x121257=_[_0xe0b0('0x31')](_0x5ac132,'id');var _0xfd746a=[];var _0xd73b8a=[];var _0x437588=squel['select']();_0x437588['field'](_0xe0b0('0x86'))[_0xe0b0('0x87')](_0xe0b0('0x88'),'tq')['join'](_0xe0b0('0x89'),'ut',_0xe0b0('0x8a'))[_0xe0b0('0x40')](_0xe0b0('0x8b'),_0x45ae1a[_0xe0b0('0x49')]['id']);for(var _0x1b8d4a=0x0;_0x1b8d4a<_0x5ac132['length'];_0x1b8d4a+=0x1){let _0x581848=_0x5ac132[_0x1b8d4a];for(var _0x495635=0x0;_0x495635<_0x581848[_0xe0b0('0x7b')][_0xe0b0('0x3e')];_0x495635+=0x1){let _0x9f9d8d=_0x581848[_0xe0b0('0x7b')][_0x495635];var _0x266cb5=_0x437588[_0xe0b0('0x8c')]();_0x266cb5[_0xe0b0('0x40')](_0xe0b0('0x8d'),_0x9f9d8d['id']);_0xd73b8a['push'](db['sequelize'][_0xe0b0('0x38')](_0x266cb5[_0xe0b0('0x8e')](),{'type':db[_0xe0b0('0x4c')]['QueryTypes'][_0xe0b0('0x8f')]})[_0xe0b0('0x2c')](function(_0x9f1fb){if(_0x9f1fb['length']===0x1){return _0x9f9d8d['id'];}else{var _0x36fa1f=_['every'](_[_0xe0b0('0x31')](_0x9f1fb,_0xe0b0('0x90')),function(_0x1e74a0){return _[_0xe0b0('0x91')](_0x121257,_0x1e74a0);});if(_0x36fa1f){return _0x9f9d8d['id'];}}}));}}return BPromise[_0xe0b0('0x92')](_0xd73b8a)[_0xe0b0('0x2c')](function(_0x12e46f){_0xfd746a=_(_0xfd746a)['union'](_0x12e46f)[_0xe0b0('0x93')]()[_0xe0b0('0x94')]();return db['VoicePrefix'][_0xe0b0('0x4a')]({'where':{'id':_0x45ae1a[_0xe0b0('0x49')]['id']}})[_0xe0b0('0x2c')](function(_0x4dbb7b){return db[_0xe0b0('0x4c')][_0xe0b0('0x4d')](function(_0x221e96){return _0x4dbb7b['removeTeams'](_0x45ae1a[_0xe0b0('0x38')][_0xe0b0('0x6e')],{'transaction':_0x221e96})[_0xe0b0('0x2c')](function(){if(!_[_0xe0b0('0x95')](_0xfd746a)){return _0x4dbb7b[_0xe0b0('0x96')](_0xfd746a,{'transaction':_0x221e96});}})[_0xe0b0('0x2c')](function(){_0xfd746a['forEach'](function(_0x44da91){socket[_0xe0b0('0x70')](_0xe0b0('0x72'),{'UserId':_0x44da91,'VoicePrefixId':_0x4dbb7b['id']});});});});});});})[_0xe0b0('0x2c')](respondWithStatusCode(_0x2349df,null))[_0xe0b0('0x55')](handleError(_0x2349df,null));}; \ No newline at end of file +var _0xbbbc=['filters','filter','merge','options','VoicePrefix','includeAll','include','findAll','rows','catch','show','params','find','describe','create','sequelize','transaction','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','VoicePrefixes','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','system','priority','NoOp','Voice\x20Prefix','VoicePrefixId','Extensions\x20creation\x20failed','prefix','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','context','${EXTEN:','charAt','system-','update','findById','addAgents','ids','omit','body','emit','userVoicePrefix:save','removeAgents','isArray','findOne','pick','getAgents','Team','getTeams','hasOwnProperty','addTeams','Agents','online','interface','flatMap','each','TeamVoicePrefix','findOrCreate','forEach','removeTeams','field','from','join','user_has_teams','VoicePrefixId\x20=\x20?','clone','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','userVoicePrefix:remove','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','register','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','then','get','UserProfileResource','destroy','status','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','where'];(function(_0x27fd65,_0x8f281b){var _0x26e08f=function(_0x3308d3){while(--_0x3308d3){_0x27fd65['push'](_0x27fd65['shift']());}};_0x26e08f(++_0x8f281b);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x21bf0d,_0x91bf98){_0x21bf0d=_0x21bf0d-0x0;var _0x561491=_0xbbbc[_0x21bf0d];return _0x561491;};'use strict';var emlformat=require(_0xcbbb('0x0'));var rimraf=require(_0xcbbb('0x1'));var zipdir=require(_0xcbbb('0x2'));var jsonpatch=require(_0xcbbb('0x3'));var rp=require(_0xcbbb('0x4'));var moment=require(_0xcbbb('0x5'));var BPromise=require(_0xcbbb('0x6'));var Mustache=require('mustache');var util=require(_0xcbbb('0x7'));var path=require(_0xcbbb('0x8'));var sox=require(_0xcbbb('0x9'));var csv=require(_0xcbbb('0xa'));var ejs=require(_0xcbbb('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcbbb('0xc'));var squel=require(_0xcbbb('0xd'));var crypto=require(_0xcbbb('0xe'));var jsforce=require(_0xcbbb('0xf'));var deskjs=require(_0xcbbb('0x10'));var toCsv=require(_0xcbbb('0xa'));var querystring=require(_0xcbbb('0x11'));var Papa=require('papaparse');var Redis=require(_0xcbbb('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xcbbb('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcbbb('0x14'))('api');var utils=require(_0xcbbb('0x15'));var config=require(_0xcbbb('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xcbbb('0x17'))['db'];config['redis']=_[_0xcbbb('0x18')](config['redis'],{'host':_0xcbbb('0x19'),'port':0x18eb});var socket=require(_0xcbbb('0x1a'))(new Redis(config[_0xcbbb('0x1b')]));require('./voicePrefix.socket')[_0xcbbb('0x1c')](socket);function respondWithStatusCode(_0x3ff767,_0x8a325c){_0x8a325c=_0x8a325c||0xcc;return function(_0x273e13){if(_0x273e13){return _0x3ff767['sendStatus'](_0x8a325c);}return _0x3ff767['status'](_0x8a325c)[_0xcbbb('0x1d')]();};}function respondWithResult(_0x30297d,_0xf76038){_0xf76038=_0xf76038||0xc8;return function(_0x188698){if(_0x188698){return _0x30297d['status'](_0xf76038)[_0xcbbb('0x1e')](_0x188698);}};}function respondWithFilteredResult(_0x4ff973,_0x1fbfb1){return function(_0x3436af){if(_0x3436af){var _0x3572bb=typeof _0x1fbfb1['offset']==='undefined'&&typeof _0x1fbfb1['limit']===_0xcbbb('0x1f');var _0x3ae91b=_0x3436af[_0xcbbb('0x20')];var _0x25e92f=_0x3572bb?0x0:_0x1fbfb1[_0xcbbb('0x21')];var _0x1cca90=_0x3572bb?_0x3436af[_0xcbbb('0x20')]:_0x1fbfb1[_0xcbbb('0x21')]+_0x1fbfb1[_0xcbbb('0x22')];var _0x2d4335;if(_0x1cca90>=_0x3ae91b){_0x1cca90=_0x3ae91b;_0x2d4335=0xc8;}else{_0x2d4335=0xce;}_0x4ff973['status'](_0x2d4335);return _0x4ff973[_0xcbbb('0x23')](_0xcbbb('0x24'),_0x25e92f+'-'+_0x1cca90+'/'+_0x3ae91b)[_0xcbbb('0x1e')](_0x3436af);}return null;};}function patchUpdates(_0x42aaf1){return function(_0x258d1f){try{jsonpatch[_0xcbbb('0x25')](_0x258d1f,_0x42aaf1,!![]);}catch(_0x297eae){return BPromise[_0xcbbb('0x26')](_0x297eae);}return _0x258d1f[_0xcbbb('0x27')]();};}function saveUpdates(_0x5e3970,_0xf39ddd){return function(_0x4490c1){if(_0x4490c1){return _0x4490c1['update'](_0x5e3970)[_0xcbbb('0x28')](function(_0x4ffa80){return _0x4ffa80;});}return null;};}function removeEntity(_0x48dfc4,_0x575d56){return function(_0x32e070){if(_0x32e070){return _0x32e070['destroy']()['then'](function(){var _0x5499a1=_0x32e070[_0xcbbb('0x29')]({'plain':!![]});var _0x55e1d8='VoicePrefixes';return db[_0xcbbb('0x2a')][_0xcbbb('0x2b')]({'where':{'type':_0x55e1d8,'resourceId':_0x5499a1['id']}})[_0xcbbb('0x28')](function(){return _0x32e070;});})[_0xcbbb('0x28')](function(){_0x48dfc4[_0xcbbb('0x2c')](0xcc)[_0xcbbb('0x1d')]();});}};}function handleEntityNotFound(_0x3d4c0d,_0x1c986d){return function(_0x2a023f){if(!_0x2a023f){_0x3d4c0d[_0xcbbb('0x2d')](0x194);}return _0x2a023f;};}function handleError(_0x1c2ac9,_0xeb8cd8){_0xeb8cd8=_0xeb8cd8||0x1f4;return function(_0xfa973b){logger[_0xcbbb('0x2e')](_0xfa973b[_0xcbbb('0x2f')]);if(_0xfa973b[_0xcbbb('0x30')]){delete _0xfa973b[_0xcbbb('0x30')];}_0x1c2ac9[_0xcbbb('0x2c')](_0xeb8cd8)['send'](_0xfa973b);};}exports[_0xcbbb('0x31')]=function(_0x203a34,_0x5332f9){var _0xec2761={},_0x539dcf={},_0x2d37d3={'count':0x0,'rows':[]};var _0x1fb05e=_[_0xcbbb('0x32')](db['VoicePrefix'][_0xcbbb('0x33')],function(_0xa4743b){return{'name':_0xa4743b[_0xcbbb('0x34')],'type':_0xa4743b[_0xcbbb('0x35')][_0xcbbb('0x36')]};});_0x539dcf[_0xcbbb('0x37')]=_[_0xcbbb('0x32')](_0x1fb05e,_0xcbbb('0x30'));_0x539dcf[_0xcbbb('0x38')]=_[_0xcbbb('0x39')](_0x203a34['query']);_0x539dcf['filters']=_['intersection'](_0x539dcf['model'],_0x539dcf[_0xcbbb('0x38')]);_0xec2761[_0xcbbb('0x3a')]=_[_0xcbbb('0x3b')](_0x539dcf[_0xcbbb('0x37')],qs[_0xcbbb('0x3c')](_0x203a34[_0xcbbb('0x38')][_0xcbbb('0x3c')]));_0xec2761[_0xcbbb('0x3a')]=_0xec2761[_0xcbbb('0x3a')][_0xcbbb('0x3d')]?_0xec2761[_0xcbbb('0x3a')]:_0x539dcf[_0xcbbb('0x37')];if(!_0x203a34['query']['hasOwnProperty'](_0xcbbb('0x3e'))){_0xec2761['limit']=qs['limit'](_0x203a34['query'][_0xcbbb('0x22')]);_0xec2761[_0xcbbb('0x21')]=qs[_0xcbbb('0x21')](_0x203a34[_0xcbbb('0x38')][_0xcbbb('0x21')]);}_0xec2761[_0xcbbb('0x3f')]=qs[_0xcbbb('0x40')](_0x203a34[_0xcbbb('0x38')][_0xcbbb('0x40')]);_0xec2761[_0xcbbb('0x41')]=qs[_0xcbbb('0x42')](_['pick'](_0x203a34[_0xcbbb('0x38')],_0x539dcf['filters']),_0x1fb05e);if(_0x203a34[_0xcbbb('0x38')][_0xcbbb('0x43')]){_0xec2761[_0xcbbb('0x41')]=_[_0xcbbb('0x44')](_0xec2761[_0xcbbb('0x41')],{'$or':_[_0xcbbb('0x32')](_0x1fb05e,function(_0x5651fd){if(_0x5651fd['type']!=='VIRTUAL'){var _0xda1973={};_0xda1973[_0x5651fd[_0xcbbb('0x30')]]={'$like':'%'+_0x203a34[_0xcbbb('0x38')][_0xcbbb('0x43')]+'%'};return _0xda1973;}})});}_0xec2761=_[_0xcbbb('0x44')]({},_0xec2761,_0x203a34[_0xcbbb('0x45')]);var _0x2b45ee={'where':_0xec2761['where']};return db[_0xcbbb('0x46')][_0xcbbb('0x20')](_0x2b45ee)['then'](function(_0x15b3bc){_0x2d37d3[_0xcbbb('0x20')]=_0x15b3bc;if(_0x203a34[_0xcbbb('0x38')][_0xcbbb('0x47')]){_0xec2761[_0xcbbb('0x48')]=[{'all':!![]}];}return db['VoicePrefix'][_0xcbbb('0x49')](_0xec2761);})['then'](function(_0x520448){_0x2d37d3[_0xcbbb('0x4a')]=_0x520448;return _0x2d37d3;})[_0xcbbb('0x28')](respondWithFilteredResult(_0x5332f9,_0xec2761))[_0xcbbb('0x4b')](handleError(_0x5332f9,null));};exports[_0xcbbb('0x4c')]=function(_0xb5391d,_0x406e1c){var _0x2040bf={'raw':![],'where':{'id':_0xb5391d[_0xcbbb('0x4d')]['id']}},_0x3ba75e={};_0x3ba75e[_0xcbbb('0x37')]=_[_0xcbbb('0x39')](db[_0xcbbb('0x46')][_0xcbbb('0x33')]);_0x3ba75e[_0xcbbb('0x38')]=_['keys'](_0xb5391d[_0xcbbb('0x38')]);_0x3ba75e[_0xcbbb('0x42')]=_[_0xcbbb('0x3b')](_0x3ba75e[_0xcbbb('0x37')],_0x3ba75e['query']);_0x2040bf['attributes']=_['intersection'](_0x3ba75e[_0xcbbb('0x37')],qs[_0xcbbb('0x3c')](_0xb5391d[_0xcbbb('0x38')][_0xcbbb('0x3c')]));_0x2040bf[_0xcbbb('0x3a')]=_0x2040bf[_0xcbbb('0x3a')][_0xcbbb('0x3d')]?_0x2040bf['attributes']:_0x3ba75e[_0xcbbb('0x37')];if(_0xb5391d[_0xcbbb('0x38')][_0xcbbb('0x47')]){_0x2040bf[_0xcbbb('0x48')]=[{'all':!![]}];}_0x2040bf=_['merge']({},_0x2040bf,_0xb5391d[_0xcbbb('0x45')]);return db[_0xcbbb('0x46')][_0xcbbb('0x4e')](_0x2040bf)[_0xcbbb('0x28')](handleEntityNotFound(_0x406e1c,null))['then'](respondWithResult(_0x406e1c,null))['catch'](handleError(_0x406e1c,null));};exports[_0xcbbb('0x2b')]=function(_0x421137,_0x3dc052){return db['VoicePrefix']['find']({'where':{'id':_0x421137['params']['id']}})[_0xcbbb('0x28')](handleEntityNotFound(_0x3dc052,null))[_0xcbbb('0x28')](removeEntity(_0x3dc052,null))['catch'](handleError(_0x3dc052,null));};exports[_0xcbbb('0x4f')]=function(_0x35bb94,_0x2dc313){return db[_0xcbbb('0x46')]['describe']()[_0xcbbb('0x28')](respondWithResult(_0x2dc313,null))[_0xcbbb('0x4b')](handleError(_0x2dc313,null));};exports[_0xcbbb('0x50')]=function(_0x3526f5,_0xb267da){var _0x3679f4;return db[_0xcbbb('0x51')][_0xcbbb('0x52')](function(_0x2d3990){return db[_0xcbbb('0x46')][_0xcbbb('0x50')](_0x3526f5['body'],{'transaction':_0x2d3990})['then'](function(_0x3fb0bd){_0x3679f4=_0x3fb0bd[_0xcbbb('0x29')]({'plain':!![]});return db[_0xcbbb('0x53')]['find']({'where':{'id':_0x3679f4[_0xcbbb('0x54')]},'raw':!![]})['then'](function(_0x2a9958){return createVoicePrefixExtensions(_0x3679f4,_0x2a9958,_0x2d3990);});});})[_0xcbbb('0x28')](function(){var _0x317633=_0x3526f5[_0xcbbb('0x55')][_0xcbbb('0x29')]({'plain':!![]});if(!_0x317633)throw new Error(_0xcbbb('0x56'));if(_0x317633['role']==='user'){var _0x4cc098=_0x3679f4;return db[_0xcbbb('0x57')][_0xcbbb('0x4e')]({'where':{'name':_0xcbbb('0x58'),'userProfileId':_0x317633[_0xcbbb('0x59')]},'raw':!![]})[_0xcbbb('0x28')](function(_0x30bc24){if(_0x30bc24&&_0x30bc24[_0xcbbb('0x5a')]===0x0){return db[_0xcbbb('0x2a')][_0xcbbb('0x50')]({'name':_0x4cc098[_0xcbbb('0x30')],'resourceId':_0x4cc098['id'],'type':_0x30bc24[_0xcbbb('0x30')],'sectionId':_0x30bc24['id']},{})[_0xcbbb('0x28')](function(){return _0x3679f4;});}else{return _0x3679f4;}})[_0xcbbb('0x4b')](function(_0x48d295){logger[_0xcbbb('0x2e')](_0xcbbb('0x5b'),_0x48d295);throw _0x48d295;});}return _0x3679f4;})[_0xcbbb('0x28')](respondWithResult(_0xb267da,null))['catch'](handleError(_0xb267da,null));};function Extension(_0x17d714,_0x1dbf9b,_0x5501d5,_0x26f0e6){this['context']=_0xcbbb('0x5c');this[_0xcbbb('0x5d')]=_0x17d714;this['app']=_0x5501d5;this[_0xcbbb('0x35')]=_0xcbbb('0x5e');this['description']='Voice\x20Prefix\x20Extension';this[_0xcbbb('0x5f')]=_0x1dbf9b;this['appdata']=_0x26f0e6;}function createVoicePrefixExtensions(_0x411bc6,_0x4c56fe,_0xb68922){return new BPromise(function(_0x3849d8,_0x20aaa9){var _0x4b4bb7=new Extension(formatPrefixName(_0x411bc6['prefix']),0x1,_0xcbbb('0x60'),_0xcbbb('0x61'));_0x4b4bb7['VoicePrefixId']=_0x411bc6['id'];return db[_0xcbbb('0x53')][_0xcbbb('0x50')](_0x4b4bb7,{'transaction':_0xb68922})[_0xcbbb('0x28')](function(_0x556e48){var _0xe347c6=_0x556e48[_0xcbbb('0x29')]({'plain':!![]});var _0x12ef00=_[_0xcbbb('0x32')](addVoicePrefixExtensions(_0x411bc6,_0x4c56fe),function(_0xf13e52){_0xf13e52[_0xcbbb('0x54')]=_0xe347c6['id'];_0xf13e52[_0xcbbb('0x62')]=_0x411bc6['id'];return _0xf13e52;});return db['VoiceExtension']['bulkCreate'](_0x12ef00,{'transaction':_0xb68922})[_0xcbbb('0x28')](function(_0x2469e5){if(!_0x2469e5){return _0x20aaa9(_0xcbbb('0x63'));}else{return _0x3849d8(_0x2469e5);}})[_0xcbbb('0x4b')](function(_0x4bc7cc){return _0x20aaa9(_0x4bc7cc);});});;});};function addVoicePrefixExtensions(_0x5c6bf7,_0x3781df){var _0x4f6529=[];var _0x5ea915=formatPrefixName(_0x5c6bf7[_0xcbbb('0x64')]);_0x4f6529[_0xcbbb('0x65')](new Extension(_0x5ea915,0x2,_0xcbbb('0x66'),_0xcbbb('0x67')+_0x5c6bf7[_0xcbbb('0x30')]));if(_0x5c6bf7[_0xcbbb('0x68')]){_0x4f6529[_0xcbbb('0x65')](new Extension(_0x5ea915,0x3,'Set',_0xcbbb('0x69')+_0x5c6bf7['callerIdAll']));}else{_0x4f6529[_0xcbbb('0x65')](new Extension(_0x5ea915,0x3,'NoOp',_0xcbbb('0x6a')));}_0x4f6529[_0xcbbb('0x65')](new Extension(_0x5ea915,0x4,_0xcbbb('0x6b'),_0x3781df[_0xcbbb('0x6c')]+','+_0xcbbb('0x6d')+(0x8+_0x5c6bf7[_0xcbbb('0x30')][_0xcbbb('0x3d')])+'}'+','+0x1));return _0x4f6529;}function formatPrefixName(_0x619340){var _0x4ff7db='_';for(var _0x57d776=0x0;_0x57d776<_0x619340[_0xcbbb('0x3d')];_0x57d776++){if(_0x619340[_0xcbbb('0x6e')](_0x57d776)=='-'){_0x4ff7db+=_0x619340[_0xcbbb('0x6e')](_0x57d776);}else{_0x4ff7db+='['+_0x619340[_0xcbbb('0x6e')](_0x57d776)+']';}}_0x4ff7db+='.';return _0x4ff7db;}exports['update']=function(_0x583c33,_0x590fc6,_0x6060d){var _0x2f0db8=_0x583c33['body'];_0x2f0db8[_0xcbbb('0x64')]=_0xcbbb('0x6f')+_0x2f0db8['name']+'-';return db[_0xcbbb('0x51')][_0xcbbb('0x52')](function(_0x4e2198){return db[_0xcbbb('0x46')][_0xcbbb('0x70')](_0x2f0db8,{'where':{'id':_0x2f0db8['id']},'transaction':_0x4e2198})[_0xcbbb('0x28')](function(){return db['VoiceExtension']['destroy']({'where':{'VoicePrefixId':_0x2f0db8['id']},'transaction':_0x4e2198})[_0xcbbb('0x28')](function(){return db[_0xcbbb('0x53')][_0xcbbb('0x4e')]({'where':{'id':_0x2f0db8['VoiceExtensionId']},'raw':!![]})['then'](function(_0x128d79){return createVoicePrefixExtensions(_0x2f0db8,_0x128d79,_0x4e2198);});});});})[_0xcbbb('0x28')](function(){return db[_0xcbbb('0x46')][_0xcbbb('0x71')](_0x2f0db8['id']);})[_0xcbbb('0x28')](respondWithResult(_0x590fc6,null))[_0xcbbb('0x4b')](handleError(_0x590fc6,null));};exports[_0xcbbb('0x72')]=function(_0x194b4b,_0x3e401d,_0x305344){return db[_0xcbbb('0x46')]['find']({'where':{'id':_0x194b4b[_0xcbbb('0x4d')]['id']}})[_0xcbbb('0x28')](handleEntityNotFound(_0x3e401d,null))[_0xcbbb('0x28')](function(_0x3ad059){if(_0x3ad059){return _0x3ad059[_0xcbbb('0x72')](_0x194b4b['body'][_0xcbbb('0x73')],_[_0xcbbb('0x74')](_0x194b4b[_0xcbbb('0x75')],[_0xcbbb('0x73'),'id'])||{})['spread'](function(_0x264c34){for(var _0x22de60=0x0;_0x22de60<_0x194b4b[_0xcbbb('0x75')]['ids']['length'];_0x22de60+=0x1){socket[_0xcbbb('0x76')](_0xcbbb('0x77'),{'UserId':Number(_0x194b4b[_0xcbbb('0x75')][_0xcbbb('0x73')][_0x22de60]),'VoicePrefixId':Number(_0x194b4b['params']['id'])});}return _0x264c34;});}})[_0xcbbb('0x28')](respondWithResult(_0x3e401d,null))[_0xcbbb('0x4b')](handleError(_0x3e401d,null));};exports[_0xcbbb('0x78')]=function(_0x349674,_0x42a9d3,_0x5706e6){return db['VoicePrefix'][_0xcbbb('0x4e')]({'where':{'id':_0x349674[_0xcbbb('0x4d')]['id']}})[_0xcbbb('0x28')](handleEntityNotFound(_0x42a9d3,null))[_0xcbbb('0x28')](function(_0x14eaec){if(_0x14eaec){return _0x14eaec[_0xcbbb('0x78')](_0x349674['query'][_0xcbbb('0x73')])[_0xcbbb('0x28')](function(){if(_[_0xcbbb('0x79')](_0x349674[_0xcbbb('0x38')][_0xcbbb('0x73')])){for(var _0x2b1277=0x0;_0x2b1277<_0x349674[_0xcbbb('0x38')]['ids']['length'];_0x2b1277+=0x1){socket[_0xcbbb('0x76')]('userVoicePrefix:remove',{'UserId':Number(_0x349674['query'][_0xcbbb('0x73')][_0x2b1277]),'VoicePrefixId':Number(_0x349674['params']['id'])});}}else{socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x349674[_0xcbbb('0x38')]['ids']),'VoicePrefixId':Number(_0x349674[_0xcbbb('0x4d')]['id'])});}});}})['then'](respondWithStatusCode(_0x42a9d3,null))['catch'](handleError(_0x42a9d3,null));};exports['getAgents']=function(_0x4de2dd,_0x1c9dd2,_0x14c60b){var _0x56b09b={};var _0x4bb903={};var _0x130f91;var _0x1bffe9;return db['VoicePrefix'][_0xcbbb('0x7a')]({'where':{'id':_0x4de2dd[_0xcbbb('0x4d')]['id']}})[_0xcbbb('0x28')](handleEntityNotFound(_0x1c9dd2,null))[_0xcbbb('0x28')](function(_0x24b949){if(_0x24b949){_0x130f91=_0x24b949;_0x4bb903[_0xcbbb('0x37')]=_[_0xcbbb('0x39')](db['User'][_0xcbbb('0x33')]);_0x4bb903[_0xcbbb('0x38')]=_['keys'](_0x4de2dd[_0xcbbb('0x38')]);_0x4bb903[_0xcbbb('0x42')]=_[_0xcbbb('0x3b')](_0x4bb903[_0xcbbb('0x37')],_0x4bb903[_0xcbbb('0x38')]);_0x56b09b[_0xcbbb('0x3a')]=_['intersection'](_0x4bb903['model'],qs[_0xcbbb('0x3c')](_0x4de2dd[_0xcbbb('0x38')][_0xcbbb('0x3c')]));_0x56b09b[_0xcbbb('0x3a')]=_0x56b09b[_0xcbbb('0x3a')]['length']?_0x56b09b[_0xcbbb('0x3a')]:_0x4bb903[_0xcbbb('0x37')];_0x56b09b[_0xcbbb('0x3f')]=qs[_0xcbbb('0x40')](_0x4de2dd[_0xcbbb('0x38')][_0xcbbb('0x40')]);_0x56b09b[_0xcbbb('0x41')]=qs[_0xcbbb('0x42')](_[_0xcbbb('0x7b')](_0x4de2dd[_0xcbbb('0x38')],_0x4bb903[_0xcbbb('0x42')]));if(_0x4de2dd['query']['filter']){_0x56b09b[_0xcbbb('0x41')]=_[_0xcbbb('0x44')](_0x56b09b[_0xcbbb('0x41')],{'$or':_[_0xcbbb('0x32')](_0x56b09b[_0xcbbb('0x3a')],function(_0x4a964b){var _0x1d7b6b={};_0x1d7b6b[_0x4a964b]={'$like':'%'+_0x4de2dd[_0xcbbb('0x38')]['filter']+'%'};return _0x1d7b6b;})});}_0x56b09b=_['merge']({},_0x56b09b,_0x4de2dd[_0xcbbb('0x45')]);return _0x130f91['getAgents'](_0x56b09b);}})[_0xcbbb('0x28')](function(_0x1a5dd3){if(_0x1a5dd3){_0x1bffe9=_0x1a5dd3[_0xcbbb('0x3d')];if(!_0x4de2dd[_0xcbbb('0x38')]['hasOwnProperty']('nolimit')){_0x56b09b[_0xcbbb('0x22')]=qs[_0xcbbb('0x22')](_0x4de2dd['query'][_0xcbbb('0x22')]);_0x56b09b[_0xcbbb('0x21')]=qs[_0xcbbb('0x21')](_0x4de2dd[_0xcbbb('0x38')][_0xcbbb('0x21')]);}return _0x130f91[_0xcbbb('0x7c')](_0x56b09b);}})[_0xcbbb('0x28')](function(_0x49f482){if(_0x49f482){return _0x49f482?{'count':_0x1bffe9,'rows':_0x49f482}:null;}})[_0xcbbb('0x28')](respondWithResult(_0x1c9dd2,null))[_0xcbbb('0x4b')](handleError(_0x1c9dd2,null));};exports['getTeams']=function(_0x10667e,_0x549d6c,_0x7a604f){var _0x10f932={};var _0x736484={};var _0x369b6f;var _0x4dc485;return db[_0xcbbb('0x46')][_0xcbbb('0x7a')]({'where':{'id':_0x10667e[_0xcbbb('0x4d')]['id']}})[_0xcbbb('0x28')](handleEntityNotFound(_0x549d6c,null))[_0xcbbb('0x28')](function(_0x4a5a59){if(_0x4a5a59){_0x369b6f=_0x4a5a59;_0x736484['model']=_[_0xcbbb('0x39')](db[_0xcbbb('0x7d')][_0xcbbb('0x33')]);_0x736484[_0xcbbb('0x38')]=_[_0xcbbb('0x39')](_0x10667e['query']);_0x736484['filters']=_[_0xcbbb('0x3b')](_0x736484[_0xcbbb('0x37')],_0x736484[_0xcbbb('0x38')]);_0x10f932[_0xcbbb('0x3a')]=_[_0xcbbb('0x3b')](_0x736484['model'],qs[_0xcbbb('0x3c')](_0x10667e[_0xcbbb('0x38')][_0xcbbb('0x3c')]));_0x10f932['attributes']=_0x10f932[_0xcbbb('0x3a')][_0xcbbb('0x3d')]?_0x10f932[_0xcbbb('0x3a')]:_0x736484[_0xcbbb('0x37')];_0x10f932[_0xcbbb('0x3f')]=qs[_0xcbbb('0x40')](_0x10667e[_0xcbbb('0x38')][_0xcbbb('0x40')]);_0x10f932['where']=qs[_0xcbbb('0x42')](_['pick'](_0x10667e['query'],_0x736484['filters']));if(_0x10667e[_0xcbbb('0x38')]['filter']){_0x10f932[_0xcbbb('0x41')]=_[_0xcbbb('0x44')](_0x10f932['where'],{'$or':_[_0xcbbb('0x32')](_0x10f932[_0xcbbb('0x3a')],function(_0x4bf0b3){var _0x4314d3={};_0x4314d3[_0x4bf0b3]={'$like':'%'+_0x10667e[_0xcbbb('0x38')][_0xcbbb('0x43')]+'%'};return _0x4314d3;})});}_0x10f932=_['merge']({},_0x10f932,_0x10667e[_0xcbbb('0x45')]);return _0x369b6f[_0xcbbb('0x7e')](_0x10f932);}})[_0xcbbb('0x28')](function(_0x2da472){if(_0x2da472){_0x4dc485=_0x2da472[_0xcbbb('0x3d')];if(!_0x10667e[_0xcbbb('0x38')][_0xcbbb('0x7f')](_0xcbbb('0x3e'))){_0x10f932[_0xcbbb('0x22')]=qs['limit'](_0x10667e[_0xcbbb('0x38')][_0xcbbb('0x22')]);_0x10f932[_0xcbbb('0x21')]=qs['offset'](_0x10667e['query'][_0xcbbb('0x21')]);}return _0x369b6f['getTeams'](_0x10f932);}})[_0xcbbb('0x28')](function(_0x198899){if(_0x198899){return _0x198899?{'count':_0x4dc485,'rows':_0x198899}:null;}})['then'](respondWithResult(_0x549d6c,null))[_0xcbbb('0x4b')](handleError(_0x549d6c,null));};exports[_0xcbbb('0x80')]=function(_0x59d833,_0x39951f,_0x283bc8){var _0x2754d1=_0x59d833[_0xcbbb('0x75')][_0xcbbb('0x73')];var _0x458b66;return db['Team'][_0xcbbb('0x49')]({'where':{'id':_0x2754d1},'attributes':['id'],'include':[{'model':db['User'],'as':_0xcbbb('0x81'),'attributes':['id',_0xcbbb('0x30'),_0xcbbb('0x82'),'voicePause',_0xcbbb('0x83')],'raw':!![]}]})['then'](function(_0x32993d){if(_0x32993d){_0x458b66=_0x32993d;var _0x962f3f=_[_0xcbbb('0x84')](_0x32993d,function(_0x55ca6b){var _0x287b25=_0x55ca6b['get']({'plain':!![]});return _0x287b25[_0xcbbb('0x81')];});return db[_0xcbbb('0x46')][_0xcbbb('0x4e')]({'where':{'id':_0x59d833[_0xcbbb('0x4d')]['id']}})['then'](function(_0x16991b){return db['sequelize'][_0xcbbb('0x52')](function(_0xd01dff){return _0x16991b[_0xcbbb('0x80')](_0x2754d1,{'transaction':_0xd01dff})[_0xcbbb('0x28')](function(){return BPromise[_0xcbbb('0x85')](_0x458b66,function(_0x3ab011){return db[_0xcbbb('0x86')]['upsert']({'TeamId':_0x3ab011['id'],'VoicePrefixId':_0x59d833[_0xcbbb('0x4d')]['id']},{'transaction':_0xd01dff});});})[_0xcbbb('0x28')](function(){return BPromise[_0xcbbb('0x85')](_0x962f3f,function(_0x354314){return db['UserVoicePrefix'][_0xcbbb('0x87')]({'where':{'UserId':_0x354314['id'],'VoicePrefixId':_0x59d833[_0xcbbb('0x4d')]['id']},'transaction':_0xd01dff});});})[_0xcbbb('0x28')](function(){_0x962f3f[_0xcbbb('0x88')](function(_0x3fc8da){socket[_0xcbbb('0x76')]('userVoicePrefix:save',{'UserId':_0x3fc8da['id'],'VoicePrefixId':_0x16991b['id']});});});});});}})[_0xcbbb('0x28')](respondWithStatusCode(_0x39951f,null))[_0xcbbb('0x4b')](handleError(_0x39951f,null));};exports[_0xcbbb('0x89')]=function(_0x23bda8,_0x233c44,_0x26545e){return db[_0xcbbb('0x7d')][_0xcbbb('0x49')]({'where':{'id':_0x23bda8['query'][_0xcbbb('0x73')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xcbbb('0x81'),'attributes':['id'],'raw':!![]}]})[_0xcbbb('0x28')](handleEntityNotFound(_0x233c44,null))[_0xcbbb('0x28')](function(_0x510bc9){var _0x1ce1c4=_[_0xcbbb('0x32')](_0x510bc9,'id');var _0x7fc4ea=[];var _0xde4f2b=[];var _0xabe61=squel['select']();_0xabe61[_0xcbbb('0x8a')]('tq.TeamId')[_0xcbbb('0x8b')]('team_has_voice_prefixes','tq')[_0xcbbb('0x8c')](_0xcbbb('0x8d'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xcbbb('0x41')](_0xcbbb('0x8e'),_0x23bda8[_0xcbbb('0x4d')]['id']);for(var _0x3a3e73=0x0;_0x3a3e73<_0x510bc9[_0xcbbb('0x3d')];_0x3a3e73+=0x1){let _0x517af0=_0x510bc9[_0x3a3e73];for(var _0x4312c3=0x0;_0x4312c3<_0x517af0[_0xcbbb('0x81')][_0xcbbb('0x3d')];_0x4312c3+=0x1){let _0x1b34ac=_0x517af0[_0xcbbb('0x81')][_0x4312c3];var _0x402d10=_0xabe61[_0xcbbb('0x8f')]();_0x402d10[_0xcbbb('0x41')]('ut.UserId\x20=\x20?',_0x1b34ac['id']);_0xde4f2b['push'](db[_0xcbbb('0x51')]['query'](_0x402d10[_0xcbbb('0x90')](),{'type':db[_0xcbbb('0x51')][_0xcbbb('0x91')][_0xcbbb('0x92')]})[_0xcbbb('0x28')](function(_0x2129d8){if(_0x2129d8[_0xcbbb('0x3d')]===0x1){return _0x1b34ac['id'];}else{var _0x274e33=_[_0xcbbb('0x93')](_[_0xcbbb('0x32')](_0x2129d8,_0xcbbb('0x94')),function(_0x1c8981){return _[_0xcbbb('0x95')](_0x1ce1c4,_0x1c8981);});if(_0x274e33){return _0x1b34ac['id'];}}}));}}return BPromise[_0xcbbb('0x96')](_0xde4f2b)[_0xcbbb('0x28')](function(_0x4bcb5d){_0x7fc4ea=_(_0x7fc4ea)[_0xcbbb('0x97')](_0x4bcb5d)[_0xcbbb('0x98')]()[_0xcbbb('0x99')]();return db[_0xcbbb('0x46')]['find']({'where':{'id':_0x23bda8[_0xcbbb('0x4d')]['id']}})[_0xcbbb('0x28')](function(_0x40fc06){return db[_0xcbbb('0x51')][_0xcbbb('0x52')](function(_0x357810){return _0x40fc06['removeTeams'](_0x23bda8[_0xcbbb('0x38')][_0xcbbb('0x73')],{'transaction':_0x357810})['then'](function(){if(!_[_0xcbbb('0x9a')](_0x7fc4ea)){return _0x40fc06[_0xcbbb('0x78')](_0x7fc4ea,{'transaction':_0x357810});}})[_0xcbbb('0x28')](function(){_0x7fc4ea[_0xcbbb('0x88')](function(_0x49e6e1){socket['emit'](_0xcbbb('0x9b'),{'UserId':_0x49e6e1,'VoicePrefixId':_0x40fc06['id']});});});});});});})[_0xcbbb('0x28')](respondWithStatusCode(_0x233c44,null))[_0xcbbb('0x4b')](handleError(_0x233c44,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 62d8ad1..1ef7f12 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 _0xc7e7=['exports','events','../../mysqldb','VoicePrefix','setMaxListeners','update','remove','hook'];(function(_0x52f074,_0x33a2cf){var _0x4f057d=function(_0x3d6d61){while(--_0x3d6d61){_0x52f074['push'](_0x52f074['shift']());}};_0x4f057d(++_0x33a2cf);}(_0xc7e7,0x1e9));var _0x7c7e=function(_0x263e34,_0x221b58){_0x263e34=_0x263e34-0x0;var _0x202887=_0xc7e7[_0x263e34];return _0x202887;};'use strict';var EventEmitter=require(_0x7c7e('0x0'));var VoicePrefix=require(_0x7c7e('0x1'))['db'][_0x7c7e('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x7c7e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7c7e('0x4'),'afterDestroy':_0x7c7e('0x5')};function emitEvent(_0x15d975){return function(_0x5c624b,_0x11c456,_0x5dd4d1){VoicePrefixEvents['emit'](_0x15d975+':'+_0x5c624b['id'],_0x5c624b);VoicePrefixEvents['emit'](_0x15d975,_0x5c624b);_0x5dd4d1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0x7c7e('0x6')](e,emitEvent(event));}}module[_0x7c7e('0x7')]=VoicePrefixEvents; \ No newline at end of file +var _0x36e9=['hook','exports','events','../../mysqldb','VoicePrefix','setMaxListeners','update','remove','emit'];(function(_0x38b14f,_0xd08fa8){var _0x22a324=function(_0x4bbb05){while(--_0x4bbb05){_0x38b14f['push'](_0x38b14f['shift']());}};_0x22a324(++_0xd08fa8);}(_0x36e9,0x1d6));var _0x936e=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x36e9[_0x122096];return _0x3d1966;};'use strict';var EventEmitter=require(_0x936e('0x0'));var VoicePrefix=require(_0x936e('0x1'))['db'][_0x936e('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x936e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x936e('0x4'),'afterDestroy':_0x936e('0x5')};function emitEvent(_0x2c9f26){return function(_0x30ce39,_0x3bba50,_0x4c547f){VoicePrefixEvents[_0x936e('0x6')](_0x2c9f26+':'+_0x30ce39['id'],_0x30ce39);VoicePrefixEvents[_0x936e('0x6')](_0x2c9f26,_0x30ce39);_0x4c547f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0x936e('0x7')](e,emitEvent(event));}}module[_0x936e('0x8')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 9825893..4ccb580 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 _0x2c4e=['path','rimraf','../../config/environment','exports','define','VoicePrefix','lodash','../../config/logger','api','moment','request-promise'];(function(_0x9d1e6b,_0x3bdc22){var _0x2b3070=function(_0x4c4ced){while(--_0x4c4ced){_0x9d1e6b['push'](_0x9d1e6b['shift']());}};_0x2b3070(++_0x3bdc22);}(_0x2c4e,0x95));var _0xe2c4=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x2c4e[_0x2b7764];return _0x848dcb;};'use strict';var _=require(_0xe2c4('0x0'));var util=require('util');var logger=require(_0xe2c4('0x1'))(_0xe2c4('0x2'));var moment=require(_0xe2c4('0x3'));var BPromise=require('bluebird');var rp=require(_0xe2c4('0x4'));var fs=require('fs');var path=require(_0xe2c4('0x5'));var rimraf=require(_0xe2c4('0x6'));var config=require(_0xe2c4('0x7'));var attributes=require('./voicePrefix.attributes');module[_0xe2c4('0x8')]=function(_0x10e0c8,_0x3588f7){return _0x10e0c8[_0xe2c4('0x9')](_0xe2c4('0xa'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x64ef=['../../config/environment','./voicePrefix.attributes','exports','VoicePrefix','../../config/logger','api','moment','request-promise'];(function(_0x41573d,_0x5b6a7a){var _0x566b3e=function(_0xa6b3b3){while(--_0xa6b3b3){_0x41573d['push'](_0x41573d['shift']());}};_0x566b3e(++_0x5b6a7a);}(_0x64ef,0x8c));var _0xf64e=function(_0x25e450,_0x4044ed){_0x25e450=_0x25e450-0x0;var _0x4dfc35=_0x64ef[_0x25e450];return _0x4dfc35;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf64e('0x0'))(_0xf64e('0x1'));var moment=require(_0xf64e('0x2'));var BPromise=require('bluebird');var rp=require(_0xf64e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf64e('0x4'));var attributes=require(_0xf64e('0x5'));module[_0xf64e('0x6')]=function(_0x1c331d,_0x2aa2a6){return _0x1c331d['define'](_0xf64e('0x7'),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 deeee3b..227d146 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 _0xf0f4=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./voicePrefix.socket','register','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','randomstring','ioredis','../../config/utils'];(function(_0x1af3e4,_0x4bb7ef){var _0x5a7ba4=function(_0x7af0cc){while(--_0x7af0cc){_0x1af3e4['push'](_0x1af3e4['shift']());}};_0x5a7ba4(++_0x4bb7ef);}(_0xf0f4,0x182));var _0x4f0f=function(_0x292d5b,_0x74b0b4){_0x292d5b=_0x292d5b-0x0;var _0x4f1872=_0xf0f4[_0x292d5b];return _0x4f1872;};'use strict';var _=require('lodash');var util=require(_0x4f0f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4f0f('0x1'));var fs=require('fs');var Redis=require(_0x4f0f('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x4f0f('0x3'));var logger=require(_0x4f0f('0x4'))(_0x4f0f('0x5'));var config=require(_0x4f0f('0x6'));var jayson=require(_0x4f0f('0x7'));var client=jayson[_0x4f0f('0x8')][_0x4f0f('0x9')]({'port':0x232a});config['redis']=_[_0x4f0f('0xa')](config[_0x4f0f('0xb')],{'host':_0x4f0f('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4f0f('0xb')]));require(_0x4f0f('0xd'))[_0x4f0f('0xe')](socket);function respondWithRpcPromise(_0x3754fc,_0x343c30,_0xb41508){return new BPromise(function(_0x9533a3,_0x2b2e49){return client['request'](_0x3754fc,_0xb41508)[_0x4f0f('0xf')](function(_0x315d01){logger[_0x4f0f('0x10')](_0x4f0f('0x11'),_0x343c30,_0x4f0f('0x12'));logger[_0x4f0f('0x13')](_0x4f0f('0x14'),_0x343c30,_0x4f0f('0x12'),JSON[_0x4f0f('0x15')](_0x315d01));if(_0x315d01[_0x4f0f('0x16')]){if(_0x315d01[_0x4f0f('0x16')]['code']===0x1f4){logger[_0x4f0f('0x16')](_0x4f0f('0x11'),_0x343c30,_0x315d01[_0x4f0f('0x16')][_0x4f0f('0x17')]);return _0x2b2e49(_0x315d01['error'][_0x4f0f('0x17')]);}logger[_0x4f0f('0x16')](_0x4f0f('0x11'),_0x343c30,_0x315d01[_0x4f0f('0x16')][_0x4f0f('0x17')]);return _0x9533a3(_0x315d01['error'][_0x4f0f('0x17')]);}else{logger[_0x4f0f('0x10')](_0x4f0f('0x11'),_0x343c30,'request\x20sent');_0x9533a3(_0x315d01[_0x4f0f('0x18')][_0x4f0f('0x17')]);}})[_0x4f0f('0x19')](function(_0x5f5363){logger[_0x4f0f('0x16')](_0x4f0f('0x11'),_0x343c30,_0x5f5363);_0x2b2e49(_0x5f5363);});});} \ No newline at end of file +var _0x9264=['info','VoicePrefix,\x20%s,\x20%s','request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','../../mysqldb','rpc','http','redis','localhost','./voicePrefix.socket','register','request'];(function(_0x254081,_0x20731a){var _0x5d1e2a=function(_0x597854){while(--_0x597854){_0x254081['push'](_0x254081['shift']());}};_0x5d1e2a(++_0x20731a);}(_0x9264,0xb1));var _0x4926=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9264[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x4926('0x0'));var util=require(_0x4926('0x1'));var moment=require(_0x4926('0x2'));var BPromise=require(_0x4926('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4926('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4926('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x4926('0x6')]({'port':0x232a});config[_0x4926('0x7')]=_['defaults'](config[_0x4926('0x7')],{'host':_0x4926('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4926('0x7')]));require(_0x4926('0x9'))[_0x4926('0xa')](socket);function respondWithRpcPromise(_0x54de94,_0x839d94,_0x15cf99){return new BPromise(function(_0x2affdd,_0x494846){return client[_0x4926('0xb')](_0x54de94,_0x15cf99)['then'](function(_0x5f27dd){logger[_0x4926('0xc')](_0x4926('0xd'),_0x839d94,_0x4926('0xe'));logger['debug'](_0x4926('0xf'),_0x839d94,_0x4926('0xe'),JSON[_0x4926('0x10')](_0x5f27dd));if(_0x5f27dd[_0x4926('0x11')]){if(_0x5f27dd[_0x4926('0x11')][_0x4926('0x12')]===0x1f4){logger[_0x4926('0x11')](_0x4926('0xd'),_0x839d94,_0x5f27dd[_0x4926('0x11')][_0x4926('0x13')]);return _0x494846(_0x5f27dd[_0x4926('0x11')][_0x4926('0x13')]);}logger[_0x4926('0x11')](_0x4926('0xd'),_0x839d94,_0x5f27dd['error'][_0x4926('0x13')]);return _0x2affdd(_0x5f27dd[_0x4926('0x11')][_0x4926('0x13')]);}else{logger['info']('VoicePrefix,\x20%s,\x20%s',_0x839d94,_0x4926('0xe'));_0x2affdd(_0x5f27dd['result'][_0x4926('0x13')]);}})[_0x4926('0x14')](function(_0x59c0c8){logger[_0x4926('0x11')]('VoicePrefix,\x20%s,\x20%s',_0x839d94,_0x59c0c8);_0x494846(_0x59c0c8);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 47d79e0..c0aa4c4 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 _0x40ca=['length','voicePrefix:','./voicePrefix.events','update','removeListener'];(function(_0x2724e5,_0x229d74){var _0x4b6621=function(_0x787046){while(--_0x787046){_0x2724e5['push'](_0x2724e5['shift']());}};_0x4b6621(++_0x229d74);}(_0x40ca,0x1a1));var _0xa40c=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x40ca[_0x3947c9];return _0x2e7871;};'use strict';var VoicePrefixEvents=require(_0xa40c('0x0'));var events=['save','remove',_0xa40c('0x1')];function createListener(_0x80a747,_0x2c7760){return function(_0x1f2731){_0x2c7760['emit'](_0x80a747,_0x1f2731);};}function removeListener(_0x11f66d,_0x4b3c47){return function(){VoicePrefixEvents[_0xa40c('0x2')](_0x11f66d,_0x4b3c47);};}exports['register']=function(_0x46eff2){for(var _0x4e1eb2=0x0,_0xee3296=events[_0xa40c('0x3')];_0x4e1eb2<_0xee3296;_0x4e1eb2++){var _0x6fadf3=events[_0x4e1eb2];var _0x444497=createListener(_0xa40c('0x4')+_0x6fadf3,_0x46eff2);VoicePrefixEvents['on'](_0x6fadf3,_0x444497);}}; \ No newline at end of file +var _0xca2b=['save','remove','update','emit','removeListener','length','./voicePrefix.events'];(function(_0x385dd4,_0x3e8dc0){var _0x2fafb3=function(_0x48fba5){while(--_0x48fba5){_0x385dd4['push'](_0x385dd4['shift']());}};_0x2fafb3(++_0x3e8dc0);}(_0xca2b,0x156));var _0xbca2=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xca2b[_0x2c91e9];return _0x13f0ff;};'use strict';var VoicePrefixEvents=require(_0xbca2('0x0'));var events=[_0xbca2('0x1'),_0xbca2('0x2'),_0xbca2('0x3')];function createListener(_0x121ed5,_0x34a0ea){return function(_0x438250){_0x34a0ea[_0xbca2('0x4')](_0x121ed5,_0x438250);};}function removeListener(_0x48a06a,_0x24af48){return function(){VoicePrefixEvents[_0xbca2('0x5')](_0x48a06a,_0x24af48);};}exports['register']=function(_0x17439f){for(var _0x56d486=0x0,_0x3476ee=events[_0xbca2('0x6')];_0x56d486<_0x3476ee;_0x56d486++){var _0x226fca=events[_0x56d486];var _0x562cf5=createListener('voicePrefix:'+_0x226fca,_0x17439f);VoicePrefixEvents['on'](_0x226fca,_0x562cf5);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 7a8b1f4..4fb11ea 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(_0x4d67b8,_0x565134){var _0x55af3b=function(_0x145904){while(--_0x145904){_0x4d67b8['push'](_0x4d67b8['shift']());}};_0x55af3b(++_0x565134);}(_0xb10b,0x12a));var _0xbb10=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xb10b[_0x82129b];return _0x2ae5dc;};'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 _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(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xb10b,0x12a));var _0xbb10=function(_0x4fbc20,_0x33bbc4){_0x4fbc20=_0x4fbc20-0x0;var _0x419740=_0xb10b[_0x4fbc20];return _0x419740;};'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 diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 862743b..3457651 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 _0x712c=['#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','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#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','sequelize','exports','STRING','name','ENUM','inbound','outbound','ringall','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','rrordered','setDataValue','strategy','getDataValue','type','dialMethod','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','leavewhenempty','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','preview','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).','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','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\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)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length'];(function(_0x4de858,_0x3a9f62){var _0x29e747=function(_0x4c8638){while(--_0x4c8638){_0x4de858['push'](_0x4de858['shift']());}};_0x29e747(++_0x3a9f62);}(_0x712c,0x1c9));var _0xc712=function(_0x2357ce,_0x17f3c6){_0x2357ce=_0x2357ce-0x0;var _0x115437=_0x712c[_0x2357ce];return _0x115437;};'use strict';var Sequelize=require(_0xc712('0x0'));module[_0xc712('0x1')]={'name':{'type':Sequelize[_0xc712('0x2')],'allowNull':![],'unique':_0xc712('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xc712('0x4')](_0xc712('0x5'),_0xc712('0x6')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0xc712('0x2')],'defaultValue':'default'},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0xc712('0x4')]('rr',_0xc712('0x7'),_0xc712('0x8'),_0xc712('0x9'),_0xc712('0xa'),_0xc712('0xb'),_0xc712('0xc'),_0xc712('0xd'),_0xc712('0xe')),'allowNull':![],'defaultValue':'ringall','set':function(_0x53a82f){this[_0xc712('0xf')](_0xc712('0x10'),_0x53a82f?_0x53a82f:'rrmemory');},'get':function(){var _0x4daf5e=this[_0xc712('0x11')](_0xc712('0x12'));var _0x1f94c7=this[_0xc712('0x11')](_0xc712('0x13'));var _0x2b80c1=this['getDataValue'](_0xc712('0x10'));if(_0x4daf5e===_0xc712('0x5')){return _0x2b80c1;}if(_0x1f94c7==='booked'&&_0x2b80c1==='rrmemory'||_0x1f94c7===_0xc712('0x14')&&_0x2b80c1===_0xc712('0x15')){return _0x2b80c1;}if(_0x1f94c7===_0xc712('0x16')||_0x1f94c7===_0xc712('0x17')||_0x1f94c7===_0xc712('0x18')){return _0x2b80c1;}return null;}},'servicelevel':{'type':Sequelize[_0xc712('0x19')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xc712('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xc712('0x19')](0xb)},'timeout':{'type':Sequelize[_0xc712('0x19')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xc712('0x2')]},'weight':{'type':Sequelize[_0xc712('0x19')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xc712('0x19')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xc712('0x4')]('yes','no'),'defaultValue':_0xc712('0x1a')},'autopause':{'type':Sequelize[_0xc712('0x4')](_0xc712('0x1a'),'no',_0xc712('0x1b')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0xc712('0x4')](_0xc712('0x1a'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xc712('0x4')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xc712('0x19')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xc712('0x4')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xc712('0x4')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xc712('0x4')](_0xc712('0x1a'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xc712('0x4')](_0xc712('0x1a'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xc712('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xc712('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xc712('0x19')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xc712('0x19')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xc712('0x19')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xc712('0x4')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xc712('0x4')](_0xc712('0x1a'),'no'),'defaultValue':_0xc712('0x1a')},'announce_holdtime':{'type':Sequelize[_0xc712('0x4')](_0xc712('0x1a'),'no',_0xc712('0x1c')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xc712('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xc712('0x4')](_0xc712('0x1a'),'no')},'announce_position_limit':{'type':Sequelize[_0xc712('0x19')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xc712('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xc712('0x2')]},'queue_youarenext':{'type':Sequelize[_0xc712('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xc712('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xc712('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xc712('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xc712('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xc712('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xc712('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xc712('0x2')]},'queue_quantity1':{'type':Sequelize[_0xc712('0x2')]},'queue_quantity2':{'type':Sequelize[_0xc712('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0xc712('0x2')]},'queue_less_than':{'type':Sequelize[_0xc712('0x2')]},'periodic_announce':{'type':Sequelize[_0xc712('0x1d')],'set':function(_0x36a9c2){this['setDataValue'](_0xc712('0x1e'),_0x36a9c2?_0x36a9c2[_0xc712('0x1f')](','):[]);},'get':function(){return this[_0xc712('0x11')]('periodic_announce')?this[_0xc712('0x11')]('periodic_announce')[_0xc712('0x20')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0xc712('0x1a'),'set':function(_0xc79212){this['setDataValue']('joinempty',_0xc79212?_0xc79212[_0xc712('0x1f')](','):undefined);},'get':function(){return this[_0xc712('0x11')]('joinempty')?this[_0xc712('0x11')]('joinempty')['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x5a6d99){this[_0xc712('0xf')](_0xc712('0x21'),_0x5a6d99?_0x5a6d99['join'](','):undefined);},'get':function(){return this[_0xc712('0x11')](_0xc712('0x21'))?this[_0xc712('0x11')]('leavewhenempty')[_0xc712('0x20')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xc712('0x4')](_0xc712('0x1a'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xc712('0x4')](_0xc712('0x1a'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xc712('0x4')](_0xc712('0x1a'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xc712('0x2')]},'description':{'type':Sequelize[_0xc712('0x2')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x4435cb){this['setDataValue']('acw',_0x4435cb);if(_0x4435cb){if(this['getDataValue']('wrapuptime')<0x2){this['setDataValue'](_0xc712('0x22'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xc712('0x19')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xc712('0x23')],'defaultValue':0x0,'comment':_0xc712('0x24')},'dialMethod':{'type':Sequelize[_0xc712('0x4')](_0xc712('0x25'),'progressive',_0xc712('0x18'),'predictive','booked'),'defaultValue':_0xc712('0x16'),'comment':_0xc712('0x26')},'dialLimitChannel':{'type':Sequelize[_0xc712('0x19')](0x4)[_0xc712('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xc712('0x28')},'dialLimitQueue':{'type':Sequelize[_0xc712('0x19')](0x4)[_0xc712('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xc712('0x29')},'dialPowerLevel':{'type':Sequelize[_0xc712('0x2a')](0x2)[_0xc712('0x27')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xc712('0x2b')},'dialPredictiveOptimization':{'type':Sequelize[_0xc712('0x4')]('agentBusyFactor','dropRate'),'defaultValue':_0xc712('0x2c'),'comment':_0xc712('0x2d')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xc712('0x2e')},'dialPredictiveInterval':{'type':Sequelize[_0xc712('0x19')](0x3)[_0xc712('0x27')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xc712('0x2f')},'dialOriginateCallerIdName':{'type':Sequelize[_0xc712('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xc712('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xc712('0x19')](0x3)[_0xc712('0x27')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0xc712('0x2')],'defaultValue':_0xc712('0x30'),'comment':_0xc712('0x31')},'dialQueueTimeout':{'type':Sequelize[_0xc712('0x19')](0x3)[_0xc712('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc712('0x32')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0xc712('0x33')},'dialCongestionMaxRetry':{'type':Sequelize[_0xc712('0x19')](0x3)[_0xc712('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc712('0x34')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xc712('0x19')](0x5)[_0xc712('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xc712('0x19')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc712('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc712('0x35')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc712('0x27')],'defaultValue':0x3,'comment':_0xc712('0x36')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc712('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc712('0x37')},'dialGlobalMaxRetry':{'type':Sequelize[_0xc712('0x19')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xc712('0x38')},'dialTimezone':{'type':Sequelize[_0xc712('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xc712('0x2')],'defaultValue':_0xc712('0x39')},'dialPrefix':{'type':Sequelize[_0xc712('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xc712('0x4')](_0xc712('0x3a'),'never',_0xc712('0x3b')),'defaultValue':_0xc712('0x3a')},'dialAMDActive':{'type':Sequelize[_0xc712('0x23')],'defaultValue':0x0,'comment':_0xc712('0x3c')},'dialAMDInitialSilence':{'type':Sequelize[_0xc712('0x19')](0x9)[_0xc712('0x27')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xc712('0x3d')},'dialAMDGreeting':{'type':Sequelize[_0xc712('0x19')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xc712('0x3e')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xc712('0x19')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xc712('0x3f')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xc712('0x19')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xc712('0x19')](0x9)[_0xc712('0x27')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xc712('0x40')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xc712('0x19')](0x9)[_0xc712('0x27')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xc712('0x41')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xc712('0x19')](0x9)[_0xc712('0x27')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xc712('0x42')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xc712('0x19')](0x5)[_0xc712('0x27')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xc712('0x43')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xc712('0x19')](0x9)[_0xc712('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc712('0x44')},'dialRecallMeTimeout':{'type':Sequelize[_0xc712('0x19')](0x5)[_0xc712('0x27')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xc712('0x45')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xc712('0x46')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xc712('0x47'),_0xc712('0x48')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0xc712('0x2')],'comment':_0xc712('0x33')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xc712('0x23')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xc712('0x23')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xc712('0x19')](0x3)[_0xc712('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc712('0x49')},'dialCutDigit':{'type':Sequelize[_0xc712('0x19')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc712('0x4a')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xc712('0x19')](0x3)[_0xc712('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xc712('0x19')](0x3)[_0xc712('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc712('0x4b')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc712('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc712('0x4c')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xc712('0x19')](0x3)[_0xc712('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc712('0x4d')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xc712('0x19')](0x5)[_0xc712('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc712('0x4e')},'dialMachineMaxRetry':{'type':Sequelize[_0xc712('0x19')](0x3)[_0xc712('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc712('0x4f')},'dialMachineRetryFrequency':{'type':Sequelize[_0xc712('0x19')](0x5)[_0xc712('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc712('0x50')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xc712('0x19')](0x3)[_0xc712('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc712('0x51')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc712('0x52')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc712('0x19')],'allowNull':!![],'comment':_0xc712('0x53')},'mandatoryDisposition':{'type':Sequelize[_0xc712('0x23')],'defaultValue':![],'comment':_0xc712('0x54'),'set':function(_0x317813){if(!_0x317813)this[_0xc712('0xf')](_0xc712('0x55'),null);this[_0xc712('0xf')](_0xc712('0x56'),_0x317813);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xc712('0x19')](0x3)[_0xc712('0x27')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xc712('0x19')](0x3)[_0xc712('0x27')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'dialPreviewRecallmeReminder':{'type':Sequelize[_0xc712('0x23')],'defaultValue':![]}}; \ No newline at end of file +var _0xfdad=['never','onlyIfOpen','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','#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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#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','mandatoryDispositionPauseId','sequelize','exports','name','ENUM','outbound','inbound','STRING','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','rrordered','ringall','setDataValue','strategy','getDataValue','type','dialMethod','progressive','predictive','power','INTEGER','yes','once','periodic_announce','joinempty','join','split','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','booked','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','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\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always'];(function(_0x2aaab3,_0x19c7bb){var _0x31927b=function(_0x4f6725){while(--_0x4f6725){_0x2aaab3['push'](_0x2aaab3['shift']());}};_0x31927b(++_0x19c7bb);}(_0xfdad,0x164));var _0xdfda=function(_0x43a68a,_0x5d5640){_0x43a68a=_0x43a68a-0x0;var _0x4a8aeb=_0xfdad[_0x43a68a];return _0x4a8aeb;};'use strict';var Sequelize=require(_0xdfda('0x0'));module[_0xdfda('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xdfda('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xdfda('0x3')]('inbound',_0xdfda('0x4')),'allowNull':![],'defaultValue':_0xdfda('0x5')},'musiconhold':{'type':Sequelize[_0xdfda('0x6')],'defaultValue':'default'},'announce':{'type':Sequelize[_0xdfda('0x6')],'defaultValue':''},'strategy':{'type':Sequelize[_0xdfda('0x3')]('rr','ringall',_0xdfda('0x7'),_0xdfda('0x8'),_0xdfda('0x9'),_0xdfda('0xa'),_0xdfda('0xb'),_0xdfda('0xc'),_0xdfda('0xd')),'allowNull':![],'defaultValue':_0xdfda('0xe'),'set':function(_0x3048fa){this[_0xdfda('0xf')](_0xdfda('0x10'),_0x3048fa?_0x3048fa:_0xdfda('0xa'));},'get':function(){var _0x2bb59c=this[_0xdfda('0x11')](_0xdfda('0x12'));var _0x272ae6=this['getDataValue'](_0xdfda('0x13'));var _0xef8810=this[_0xdfda('0x11')](_0xdfda('0x10'));if(_0x2bb59c===_0xdfda('0x5')){return _0xef8810;}if(_0x272ae6==='booked'&&_0xef8810===_0xdfda('0xa')||_0x272ae6==='booked'&&_0xef8810==='roundrobin'){return _0xef8810;}if(_0x272ae6===_0xdfda('0x14')||_0x272ae6===_0xdfda('0x15')||_0x272ae6===_0xdfda('0x16')){return _0xef8810;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xdfda('0x6')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0xdfda('0x17')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xdfda('0x17')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xdfda('0x6')]},'weight':{'type':Sequelize[_0xdfda('0x17')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0xdfda('0x18'),'no'),'defaultValue':_0xdfda('0x18')},'autopause':{'type':Sequelize[_0xdfda('0x3')](_0xdfda('0x18'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xdfda('0x17')](0xb)},'autopausebusy':{'type':Sequelize[_0xdfda('0x3')](_0xdfda('0x18'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xdfda('0x3')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xdfda('0x17')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xdfda('0x3')](_0xdfda('0x18'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM']('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0xdfda('0x18'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0xdfda('0x18'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xdfda('0x6')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xdfda('0x6')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xdfda('0x17')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xdfda('0x17')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xdfda('0x3')](_0xdfda('0x18'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0xdfda('0x18'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize['ENUM']('yes','no',_0xdfda('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xdfda('0x6')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xdfda('0x3')]('yes','no')},'announce_position_limit':{'type':Sequelize[_0xdfda('0x17')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xdfda('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xdfda('0x6')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xdfda('0x6')]},'queue_youarenext':{'type':Sequelize[_0xdfda('0x6')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xdfda('0x6')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xdfda('0x6')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xdfda('0x6')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xdfda('0x6')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xdfda('0x6')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xdfda('0x6')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0xdfda('0x6')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0xdfda('0x6')]},'queue_less_than':{'type':Sequelize[_0xdfda('0x6')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x313228){this[_0xdfda('0xf')](_0xdfda('0x1a'),_0x313228?_0x313228['join'](','):[]);},'get':function(){return this[_0xdfda('0x11')](_0xdfda('0x1a'))?this['getDataValue'](_0xdfda('0x1a'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0xdfda('0x6')],'defaultValue':_0xdfda('0x18'),'set':function(_0x241713){this[_0xdfda('0xf')](_0xdfda('0x1b'),_0x241713?_0x241713[_0xdfda('0x1c')](','):undefined);},'get':function(){return this['getDataValue'](_0xdfda('0x1b'))?this['getDataValue']('joinempty')[_0xdfda('0x1d')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xdfda('0x6')],'defaultValue':'no','set':function(_0x137031){this['setDataValue']('leavewhenempty',_0x137031?_0x137031[_0xdfda('0x1c')](','):undefined);},'get':function(){return this['getDataValue'](_0xdfda('0x1e'))?this[_0xdfda('0x11')](_0xdfda('0x1e'))[_0xdfda('0x1d')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xdfda('0x3')](_0xdfda('0x18'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xdfda('0x3')](_0xdfda('0x18'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xdfda('0x17')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xdfda('0x3')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xdfda('0x6')]},'description':{'type':Sequelize[_0xdfda('0x6')]},'acw':{'type':Sequelize[_0xdfda('0x1f')],'defaultValue':0x0,'set':function(_0x189523){this[_0xdfda('0xf')](_0xdfda('0x20'),_0x189523);if(_0x189523){if(this[_0xdfda('0x11')](_0xdfda('0x21'))<0x2){this['setDataValue']('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0xdfda('0x17')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xdfda('0x1f')],'defaultValue':0x0,'comment':_0xdfda('0x22')},'dialMethod':{'type':Sequelize[_0xdfda('0x3')](_0xdfda('0x23'),_0xdfda('0x14'),_0xdfda('0x16'),_0xdfda('0x15'),_0xdfda('0x24')),'defaultValue':_0xdfda('0x14'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0xdfda('0x17')](0x4)[_0xdfda('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xdfda('0x26')},'dialLimitQueue':{'type':Sequelize[_0xdfda('0x17')](0x4)[_0xdfda('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xdfda('0x27')},'dialPowerLevel':{'type':Sequelize[_0xdfda('0x28')](0x2)[_0xdfda('0x25')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xdfda('0x29')},'dialPredictiveOptimization':{'type':Sequelize[_0xdfda('0x3')](_0xdfda('0x2a'),_0xdfda('0x2b')),'defaultValue':_0xdfda('0x2b'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xdfda('0x28')](0x2)[_0xdfda('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xdfda('0x2c')},'dialPredictiveInterval':{'type':Sequelize[_0xdfda('0x17')](0x3)[_0xdfda('0x25')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xdfda('0x2d')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xdfda('0x6')]},'dialOriginateTimeout':{'type':Sequelize[_0xdfda('0x17')](0x3)[_0xdfda('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdfda('0x2e')},'dialQueueOptions':{'type':Sequelize[_0xdfda('0x6')],'defaultValue':_0xdfda('0x2f'),'comment':_0xdfda('0x30')},'dialQueueTimeout':{'type':Sequelize[_0xdfda('0x17')](0x3)[_0xdfda('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdfda('0x31')},'dialQueueProject':{'type':Sequelize[_0xdfda('0x6')],'comment':_0xdfda('0x32')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xdfda('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdfda('0x33')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xdfda('0x17')](0x5)[_0xdfda('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdfda('0x34')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdfda('0x35')},'dialBusyRetryFrequency':{'type':Sequelize[_0xdfda('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xdfda('0x17')](0x3)[_0xdfda('0x25')],'defaultValue':0x3,'comment':_0xdfda('0x36')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xdfda('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdfda('0x37')},'dialGlobalMaxRetry':{'type':Sequelize[_0xdfda('0x17')](0x3)[_0xdfda('0x25')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xdfda('0x38')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xdfda('0x39')},'dialPrefix':{'type':Sequelize[_0xdfda('0x6')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xdfda('0x3')](_0xdfda('0x3a'),_0xdfda('0x3b'),_0xdfda('0x3c')),'defaultValue':_0xdfda('0x3a')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xdfda('0x3d')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xdfda('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xdfda('0x3e')},'dialAMDGreeting':{'type':Sequelize[_0xdfda('0x17')](0x9)[_0xdfda('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xdfda('0x3f')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xdfda('0x25')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xdfda('0x40')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xdfda('0x17')](0x9)[_0xdfda('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xdfda('0x17')](0x9)[_0xdfda('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xdfda('0x41')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xdfda('0x25')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xdfda('0x42')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xdfda('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xdfda('0x43')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xdfda('0x17')](0x5)[_0xdfda('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xdfda('0x17')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0xdfda('0x17')](0x5)[_0xdfda('0x25')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xdfda('0x44')},'dialRecallInQueue':{'type':Sequelize[_0xdfda('0x1f')],'defaultValue':0x0,'comment':_0xdfda('0x45')},'dialOrderByScheduledAt':{'type':Sequelize[_0xdfda('0x3')]('DESC','ASC'),'defaultValue':_0xdfda('0x46')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0xdfda('0x32')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xdfda('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xdfda('0x17')](0x3)[_0xdfda('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xdfda('0x47')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xdfda('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xdfda('0x48')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xdfda('0x17')](0x3)[_0xdfda('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdfda('0x49')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xdfda('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdfda('0x4a')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xdfda('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xdfda('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdfda('0x4b')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xdfda('0x17')](0x3)[_0xdfda('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdfda('0x4c')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xdfda('0x17')](0x5)[_0xdfda('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xdfda('0x17')](0x3)[_0xdfda('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdfda('0x4d')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xdfda('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdfda('0x4e')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xdfda('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdfda('0x4f')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xdfda('0x17')](0x5)[_0xdfda('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdfda('0x50')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xdfda('0x17')],'allowNull':!![],'comment':_0xdfda('0x51')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x40ebf2){if(!_0x40ebf2)this['setDataValue'](_0xdfda('0x52'),null);this['setDataValue']('mandatoryDisposition',_0x40ebf2);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xdfda('0x17')](0x3)[_0xdfda('0x25')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'dialPreviewRecallmeReminder':{'type':Sequelize[_0xdfda('0x1f')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 0b81c47..37b281c 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 _0x7489=['CmList','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','NOW()','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','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','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','set','apply','save','update','destroy','then','get','VoiceQueues','QueueCampaigns','outbound','filter','ignore','map','value','includes','find','type','name','UserProfileResource','error','stack','index','VoiceQueue','fieldName','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','VIRTUAL','merge','count','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','inbound','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','updatedAt','createdAt','autoAssociation','getHoppers','findOne','CmHopper','hasOwnProperty','VoiceQueueId','getHopperHistories','order','CmHopperHistory','getHopperFinals','getHopperBlacks','CmHopperBlack','getTeams','Team','online','voicePause','interface','Agents','forEach','penalty','sequelize','transaction','each','UserVoiceQueue','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','emit','userVoiceQueue:save','ids','select','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','TeamId','union','compact','removeTeams','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','all','getAgents','User','getMembers','getLists'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7489,0xd5));var _0x9748=function(_0x21d2f1,_0x5147c2){_0x21d2f1=_0x21d2f1-0x0;var _0x8881a=_0x7489[_0x21d2f1];return _0x8881a;};'use strict';var emlformat=require(_0x9748('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9748('0x1'));var jsonpatch=require(_0x9748('0x2'));var rp=require(_0x9748('0x3'));var moment=require(_0x9748('0x4'));var BPromise=require(_0x9748('0x5'));var Mustache=require('mustache');var util=require(_0x9748('0x6'));var path=require(_0x9748('0x7'));var sox=require('sox');var csv=require(_0x9748('0x8'));var ejs=require(_0x9748('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9748('0xa'));var squel=require(_0x9748('0xb'));var crypto=require(_0x9748('0xc'));var jsforce=require(_0x9748('0xd'));var deskjs=require(_0x9748('0xe'));var toCsv=require(_0x9748('0x8'));var querystring=require(_0x9748('0xf'));var Papa=require(_0x9748('0x10'));var Redis=require(_0x9748('0x11'));var authService=require(_0x9748('0x12'));var qs=require(_0x9748('0x13'));var as=require(_0x9748('0x14'));var hardwareService=require(_0x9748('0x15'));var logger=require(_0x9748('0x16'))('api');var utils=require(_0x9748('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x9748('0x18'));var db=require(_0x9748('0x19'))['db'];config[_0x9748('0x1a')]=_['defaults'](config['redis'],{'host':_0x9748('0x1b'),'port':0x18eb});var socket=require(_0x9748('0x1c'))(new Redis(config[_0x9748('0x1a')]));require(_0x9748('0x1d'))[_0x9748('0x1e')](socket);function respondWithStatusCode(_0x556c38,_0x371f96){_0x371f96=_0x371f96||0xcc;return function(_0x34a25f){if(_0x34a25f){return _0x556c38[_0x9748('0x1f')](_0x371f96);}return _0x556c38[_0x9748('0x20')](_0x371f96)[_0x9748('0x21')]();};}function respondWithResult(_0x51ab65,_0x3db25d){_0x3db25d=_0x3db25d||0xc8;return function(_0x4fa0b1){if(_0x4fa0b1){return _0x51ab65[_0x9748('0x20')](_0x3db25d)[_0x9748('0x22')](_0x4fa0b1);}};}function respondWithFilteredResult(_0x53aead,_0x182bf0){return function(_0x513bfa){if(_0x513bfa){var _0x23dbba=typeof _0x182bf0[_0x9748('0x23')]===_0x9748('0x24')&&typeof _0x182bf0[_0x9748('0x25')]==='undefined';var _0x1b145d=_0x513bfa['count'];var _0x462085=_0x23dbba?0x0:_0x182bf0[_0x9748('0x23')];var _0x31806e=_0x23dbba?_0x513bfa['count']:_0x182bf0[_0x9748('0x23')]+_0x182bf0[_0x9748('0x25')];var _0x5b4101;if(_0x31806e>=_0x1b145d){_0x31806e=_0x1b145d;_0x5b4101=0xc8;}else{_0x5b4101=0xce;}_0x53aead[_0x9748('0x20')](_0x5b4101);return _0x53aead[_0x9748('0x26')]('Content-Range',_0x462085+'-'+_0x31806e+'/'+_0x1b145d)[_0x9748('0x22')](_0x513bfa);}return null;};}function patchUpdates(_0x2a8ff0){return function(_0x56c65e){try{jsonpatch[_0x9748('0x27')](_0x56c65e,_0x2a8ff0,!![]);}catch(_0xae72b7){return BPromise['reject'](_0xae72b7);}return _0x56c65e[_0x9748('0x28')]();};}function saveUpdates(_0x1c51a4,_0x496ec4){return function(_0xf59115){if(_0xf59115){return _0xf59115[_0x9748('0x29')](_0x1c51a4)['then'](function(_0x507989){return _0x507989;});}return null;};}function removeEntity(_0x134e0b,_0x36c228){return function(_0x706e94){if(_0x706e94){return _0x706e94[_0x9748('0x2a')]()[_0x9748('0x2b')](function(){var _0x30ff83=_0x706e94[_0x9748('0x2c')]({'plain':!![]});var _0x552b61=[{'name':_0x9748('0x2d'),'value':'inbound','ignore':![]},{'name':_0x9748('0x2e'),'value':_0x9748('0x2f'),'ignore':![]}];var _0x11ff61=_(_0x552b61)[_0x9748('0x30')](_0x9748('0x31'))[_0x9748('0x32')]('value')[_0x9748('0x33')]();if(_[_0x9748('0x34')](_0x11ff61,_0x30ff83['type'])){return;}var _0x113729=_[_0x9748('0x35')](_0x552b61,['value',_0x30ff83[_0x9748('0x36')]])[_0x9748('0x37')];return db[_0x9748('0x38')]['destroy']({'where':{'type':_0x113729,'resourceId':_0x30ff83['id']}})[_0x9748('0x2b')](function(){return _0x706e94;});})[_0x9748('0x2b')](function(){_0x134e0b[_0x9748('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9ea736,_0x599f54){return function(_0x5119b1){if(!_0x5119b1){_0x9ea736[_0x9748('0x1f')](0x194);}return _0x5119b1;};}function handleError(_0x2d94fb,_0x46648c){_0x46648c=_0x46648c||0x1f4;return function(_0x48be01){logger[_0x9748('0x39')](_0x48be01[_0x9748('0x3a')]);if(_0x48be01['name']){delete _0x48be01[_0x9748('0x37')];}_0x2d94fb[_0x9748('0x20')](_0x46648c)['send'](_0x48be01);};}exports[_0x9748('0x3b')]=function(_0x141b49,_0x53c997){var _0x783955={},_0x4ac581={},_0x830716={'count':0x0,'rows':[]};var _0x52db1d=_[_0x9748('0x32')](db[_0x9748('0x3c')]['rawAttributes'],function(_0x3fd68b){return{'name':_0x3fd68b[_0x9748('0x3d')],'type':_0x3fd68b[_0x9748('0x36')][_0x9748('0x3e')]};});_0x4ac581[_0x9748('0x3f')]=_[_0x9748('0x32')](_0x52db1d,'name');_0x4ac581[_0x9748('0x40')]=_['keys'](_0x141b49[_0x9748('0x40')]);_0x4ac581[_0x9748('0x41')]=_[_0x9748('0x42')](_0x4ac581[_0x9748('0x3f')],_0x4ac581[_0x9748('0x40')]);_0x783955[_0x9748('0x43')]=_[_0x9748('0x42')](_0x4ac581['model'],qs[_0x9748('0x44')](_0x141b49['query'][_0x9748('0x44')]));_0x783955[_0x9748('0x43')]=_0x783955[_0x9748('0x43')][_0x9748('0x45')]?_0x783955[_0x9748('0x43')]:_0x4ac581[_0x9748('0x3f')];if(!_0x141b49[_0x9748('0x40')]['hasOwnProperty'](_0x9748('0x46'))){_0x783955['limit']=qs[_0x9748('0x25')](_0x141b49[_0x9748('0x40')][_0x9748('0x25')]);_0x783955[_0x9748('0x23')]=qs[_0x9748('0x23')](_0x141b49[_0x9748('0x40')]['offset']);}_0x783955['order']=qs[_0x9748('0x47')](_0x141b49[_0x9748('0x40')]['sort']);_0x783955[_0x9748('0x48')]=qs[_0x9748('0x41')](_[_0x9748('0x49')](_0x141b49[_0x9748('0x40')],_0x4ac581[_0x9748('0x41')]),_0x52db1d);if(_0x141b49[_0x9748('0x40')]['filter']){_0x783955[_0x9748('0x48')]=_['merge'](_0x783955[_0x9748('0x48')],{'$or':_[_0x9748('0x32')](_0x52db1d,function(_0x5bb2fb){if(_0x5bb2fb['type']!==_0x9748('0x4a')){var _0x33395b={};_0x33395b[_0x5bb2fb[_0x9748('0x37')]]={'$like':'%'+_0x141b49[_0x9748('0x40')]['filter']+'%'};return _0x33395b;}})});}_0x783955=_[_0x9748('0x4b')]({},_0x783955,_0x141b49['options']);var _0x56f5d2={'where':_0x783955['where']};return db[_0x9748('0x3c')][_0x9748('0x4c')](_0x56f5d2)[_0x9748('0x2b')](function(_0x4a7443){_0x830716['count']=_0x4a7443;if(_0x141b49[_0x9748('0x40')][_0x9748('0x4d')]){_0x783955[_0x9748('0x4e')]=[{'all':!![]}];}return db[_0x9748('0x3c')][_0x9748('0x4f')](_0x783955);})[_0x9748('0x2b')](function(_0x49977e){_0x830716[_0x9748('0x50')]=_0x49977e;return _0x830716;})[_0x9748('0x2b')](respondWithFilteredResult(_0x53c997,_0x783955))[_0x9748('0x51')](handleError(_0x53c997,null));};exports[_0x9748('0x52')]=function(_0x47cd09,_0x298120){var _0x25f74d={'raw':![],'where':{'id':_0x47cd09['params']['id']}},_0x59ae4e={};_0x59ae4e[_0x9748('0x3f')]=_[_0x9748('0x53')](db[_0x9748('0x3c')][_0x9748('0x54')]);_0x59ae4e['query']=_[_0x9748('0x53')](_0x47cd09[_0x9748('0x40')]);_0x59ae4e[_0x9748('0x41')]=_[_0x9748('0x42')](_0x59ae4e[_0x9748('0x3f')],_0x59ae4e['query']);_0x25f74d[_0x9748('0x43')]=_['intersection'](_0x59ae4e[_0x9748('0x3f')],qs['fields'](_0x47cd09[_0x9748('0x40')][_0x9748('0x44')]));_0x25f74d['attributes']=_0x25f74d[_0x9748('0x43')]['length']?_0x25f74d[_0x9748('0x43')]:_0x59ae4e['model'];if(_0x47cd09[_0x9748('0x40')]['includeAll']){_0x25f74d['include']=[{'all':!![]}];}_0x25f74d=_[_0x9748('0x4b')]({},_0x25f74d,_0x47cd09[_0x9748('0x55')]);return db[_0x9748('0x3c')]['find'](_0x25f74d)['then'](handleEntityNotFound(_0x298120,null))[_0x9748('0x2b')](respondWithResult(_0x298120,null))[_0x9748('0x51')](handleError(_0x298120,null));};exports[_0x9748('0x56')]=function(_0x5a1aeb,_0x1ae636){return db[_0x9748('0x3c')][_0x9748('0x56')](_0x5a1aeb[_0x9748('0x57')],{})[_0x9748('0x2b')](function(_0x47b23c){var _0x3ffdde=_0x5a1aeb[_0x9748('0x58')][_0x9748('0x2c')]({'plain':!![]});if(!_0x3ffdde)throw new Error(_0x9748('0x59'));if(_0x3ffdde[_0x9748('0x5a')]===_0x9748('0x58')){var _0x22ec25=_0x47b23c[_0x9748('0x2c')]({'plain':!![]});var _0x423ec1=[{'name':'VoiceQueues','value':_0x9748('0x5b')},{'name':_0x9748('0x2e'),'value':'outbound'}];var _0xd925bc=_['find'](_0x423ec1,[_0x9748('0x33'),_0x22ec25[_0x9748('0x36')]])['name'];return db[_0x9748('0x5c')]['find']({'where':{'name':_0xd925bc,'userProfileId':_0x3ffdde[_0x9748('0x5d')]},'raw':!![]})[_0x9748('0x2b')](function(_0xe1194c){if(_0xe1194c&&_0xe1194c['autoAssociation']===0x0){return db[_0x9748('0x38')][_0x9748('0x56')]({'name':_0x22ec25[_0x9748('0x37')],'resourceId':_0x22ec25['id'],'type':_0xe1194c[_0x9748('0x37')],'sectionId':_0xe1194c['id']},{})[_0x9748('0x2b')](function(){return _0x47b23c;});}else{return _0x47b23c;}})['catch'](function(_0x572ce6){logger[_0x9748('0x39')](_0x9748('0x5e'),_0x572ce6);throw _0x572ce6;});}return _0x47b23c;})[_0x9748('0x2b')](respondWithResult(_0x1ae636,0xc9))[_0x9748('0x51')](handleError(_0x1ae636,null));};exports[_0x9748('0x5f')]=function(_0x54b69f,_0x3a165f){var _0x340bfb={'where':{'id':_0x54b69f[_0x9748('0x60')]['id']}},_0x5e549b={};_0x5e549b[_0x9748('0x3f')]=_[_0x9748('0x53')](db[_0x9748('0x3c')]['rawAttributes']);_0x340bfb[_0x9748('0x43')]=_[_0x9748('0x42')](_0x5e549b[_0x9748('0x3f')],qs[_0x9748('0x44')](_0x54b69f[_0x9748('0x40')][_0x9748('0x44')]));_0x340bfb['attributes']=_0x340bfb[_0x9748('0x43')]['length']?_0x340bfb[_0x9748('0x43')]:_0x5e549b['model'];if(_0x54b69f[_0x9748('0x40')]['includeAll']){_0x340bfb['include']=[{'all':!![]}];}_0x340bfb=_['merge']({},_0x340bfb,_0x54b69f[_0x9748('0x55')]);return db[_0x9748('0x3c')][_0x9748('0x35')](_0x340bfb)['then'](handleEntityNotFound(_0x3a165f,null))['then'](function(_0x1ba728){if(_0x1ba728){var _0x322bb0=_0x1ba728[_0x9748('0x2c')]({'plain':!![]});_0x322bb0=qs[_0x9748('0x61')](_0x322bb0,['id','createdAt',_0x9748('0x62')]);_0x54b69f[_0x9748('0x57')]=_[_0x9748('0x61')](_0x54b69f[_0x9748('0x57')],['id',_0x9748('0x63'),_0x9748('0x62')]);return db[_0x9748('0x3c')][_0x9748('0x56')](_['merge'](_0x322bb0,_0x54b69f[_0x9748('0x57')]),{'include':_0x54b69f['query'][_0x9748('0x4d')]?[{'all':!![]}]:undefined})['then'](function(_0x31a6ab){var _0x26314d=_0x54b69f[_0x9748('0x58')]['get']({'plain':!![]});if(!_0x26314d)throw new Error(_0x9748('0x59'));if(_0x26314d[_0x9748('0x5a')]===_0x9748('0x58')){var _0x1e4003=_0x31a6ab[_0x9748('0x2c')]({'plain':!![]});var _0x25f423=[{'name':_0x9748('0x2d'),'value':_0x9748('0x5b')},{'name':_0x9748('0x2e'),'value':_0x9748('0x2f')}];var _0x3fe86c=_[_0x9748('0x35')](_0x25f423,[_0x9748('0x33'),_0x1e4003[_0x9748('0x36')]])[_0x9748('0x37')];return db[_0x9748('0x5c')]['find']({'where':{'name':_0x3fe86c,'userProfileId':_0x26314d['userProfileId']},'raw':!![]})[_0x9748('0x2b')](function(_0x5d2b69){if(_0x5d2b69&&_0x5d2b69[_0x9748('0x64')]===0x0){return db[_0x9748('0x38')][_0x9748('0x56')]({'name':_0x1e4003[_0x9748('0x37')],'resourceId':_0x1e4003['id'],'type':_0x5d2b69[_0x9748('0x37')],'sectionId':_0x5d2b69['id']},{})[_0x9748('0x2b')](function(){return _0x31a6ab;});}else{return _0x31a6ab;}})['catch'](function(_0x662a06){logger[_0x9748('0x39')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x662a06);throw _0x662a06;});}return _0x31a6ab;});}})['then'](respondWithResult(_0x3a165f,0xc9))[_0x9748('0x51')](handleError(_0x3a165f,null));};exports[_0x9748('0x29')]=function(_0x23c5a5,_0x3396b3){if(_0x23c5a5[_0x9748('0x57')]['id']){delete _0x23c5a5['body']['id'];}return db[_0x9748('0x3c')][_0x9748('0x35')]({'where':{'id':_0x23c5a5['params']['id']}})[_0x9748('0x2b')](handleEntityNotFound(_0x3396b3,null))[_0x9748('0x2b')](saveUpdates(_0x23c5a5[_0x9748('0x57')],null))['then'](respondWithResult(_0x3396b3,null))[_0x9748('0x51')](handleError(_0x3396b3,null));};exports['destroy']=function(_0x34827b,_0x489a23){return db['VoiceQueue']['find']({'where':{'id':_0x34827b['params']['id']}})[_0x9748('0x2b')](handleEntityNotFound(_0x489a23,null))[_0x9748('0x2b')](removeEntity(_0x489a23,null))[_0x9748('0x51')](handleError(_0x489a23,null));};exports[_0x9748('0x65')]=function(_0x565bd7,_0x4aec2f,_0x52bf6d){var _0x223047={'raw':![],'where':{}};var _0x343570={};var _0x35aa2a={'count':0x0,'rows':[]};return db[_0x9748('0x3c')][_0x9748('0x66')]({'where':{'id':_0x565bd7[_0x9748('0x60')]['id']}})[_0x9748('0x2b')](handleEntityNotFound(_0x4aec2f,null))[_0x9748('0x2b')](function(_0x1c0dd3){if(_0x1c0dd3){_0x343570[_0x9748('0x3f')]=_[_0x9748('0x53')](db[_0x9748('0x67')]['rawAttributes']);_0x343570[_0x9748('0x40')]=_[_0x9748('0x53')](_0x565bd7['query']);_0x343570[_0x9748('0x41')]=_[_0x9748('0x42')](_0x343570['model'],_0x343570[_0x9748('0x40')]);_0x223047['attributes']=_['intersection'](_0x343570[_0x9748('0x3f')],qs[_0x9748('0x44')](_0x565bd7['query'][_0x9748('0x44')]));_0x223047[_0x9748('0x43')]=_0x223047[_0x9748('0x43')][_0x9748('0x45')]?_0x223047[_0x9748('0x43')]:_0x343570[_0x9748('0x3f')];if(!_0x565bd7[_0x9748('0x40')][_0x9748('0x68')](_0x9748('0x46'))){_0x223047[_0x9748('0x25')]=qs['limit'](_0x565bd7[_0x9748('0x40')][_0x9748('0x25')]);_0x223047[_0x9748('0x23')]=qs[_0x9748('0x23')](_0x565bd7[_0x9748('0x40')][_0x9748('0x23')]);}_0x223047['order']=qs[_0x9748('0x47')](_0x565bd7[_0x9748('0x40')][_0x9748('0x47')]);_0x223047[_0x9748('0x48')]=qs[_0x9748('0x41')](_[_0x9748('0x49')](_0x565bd7['query'],_0x343570[_0x9748('0x41')]));_0x223047[_0x9748('0x48')][_0x9748('0x69')]=_0x1c0dd3['id'];if(_0x565bd7[_0x9748('0x40')]['filter']){_0x223047['where']=_['merge'](_0x223047['where'],{'$or':_[_0x9748('0x32')](_0x223047[_0x9748('0x43')],function(_0x2ac43b){var _0x1d592c={};_0x1d592c[_0x2ac43b]={'$like':'%'+_0x565bd7[_0x9748('0x40')][_0x9748('0x30')]+'%'};return _0x1d592c;})});}_0x223047=_[_0x9748('0x4b')]({},_0x223047,_0x565bd7[_0x9748('0x55')]);return db[_0x9748('0x67')][_0x9748('0x4c')]({'where':_0x223047[_0x9748('0x48')]})[_0x9748('0x2b')](function(_0x49549){_0x35aa2a['count']=_0x49549;if(_0x565bd7[_0x9748('0x40')][_0x9748('0x4d')]){_0x223047[_0x9748('0x4e')]=[{'all':!![]}];}return db[_0x9748('0x67')][_0x9748('0x4f')](_0x223047);})[_0x9748('0x2b')](function(_0x5bff7d){_0x35aa2a[_0x9748('0x50')]=_0x5bff7d;return _0x35aa2a;});}})[_0x9748('0x2b')](respondWithFilteredResult(_0x4aec2f,_0x223047))['catch'](handleError(_0x4aec2f,null));};exports[_0x9748('0x6a')]=function(_0x5ac1b6,_0x24bd3b,_0x1dd46b){var _0x6b93c={'raw':!![],'where':{}};var _0x62e390={};var _0x3fc47f={'count':0x0,'rows':[]};return db[_0x9748('0x3c')][_0x9748('0x66')]({'where':{'id':_0x5ac1b6[_0x9748('0x60')]['id']}})[_0x9748('0x2b')](handleEntityNotFound(_0x24bd3b,null))[_0x9748('0x2b')](function(_0x13305d){if(_0x13305d){_0x62e390[_0x9748('0x3f')]=_[_0x9748('0x53')](db['CmHopperHistory'][_0x9748('0x54')]);_0x62e390[_0x9748('0x40')]=_[_0x9748('0x53')](_0x5ac1b6[_0x9748('0x40')]);_0x62e390[_0x9748('0x41')]=_['intersection'](_0x62e390['model'],_0x62e390[_0x9748('0x40')]);_0x6b93c['attributes']=_[_0x9748('0x42')](_0x62e390[_0x9748('0x3f')],qs['fields'](_0x5ac1b6['query']['fields']));_0x6b93c[_0x9748('0x43')]=_0x6b93c['attributes'][_0x9748('0x45')]?_0x6b93c[_0x9748('0x43')]:_0x62e390[_0x9748('0x3f')];if(!_0x5ac1b6[_0x9748('0x40')][_0x9748('0x68')](_0x9748('0x46'))){_0x6b93c[_0x9748('0x25')]=qs[_0x9748('0x25')](_0x5ac1b6[_0x9748('0x40')][_0x9748('0x25')]);_0x6b93c[_0x9748('0x23')]=qs[_0x9748('0x23')](_0x5ac1b6[_0x9748('0x40')][_0x9748('0x23')]);}_0x6b93c[_0x9748('0x6b')]=qs['sort'](_0x5ac1b6[_0x9748('0x40')][_0x9748('0x47')]);_0x6b93c[_0x9748('0x48')]=qs[_0x9748('0x41')](_['pick'](_0x5ac1b6[_0x9748('0x40')],_0x62e390[_0x9748('0x41')]));_0x6b93c['where'][_0x9748('0x69')]=_0x13305d['id'];if(_0x5ac1b6['query'][_0x9748('0x30')]){_0x6b93c[_0x9748('0x48')]=_[_0x9748('0x4b')](_0x6b93c[_0x9748('0x48')],{'$or':_[_0x9748('0x32')](_0x6b93c[_0x9748('0x43')],function(_0x2fc8de){var _0x211f3c={};_0x211f3c[_0x2fc8de]={'$like':'%'+_0x5ac1b6[_0x9748('0x40')][_0x9748('0x30')]+'%'};return _0x211f3c;})});}_0x6b93c=_[_0x9748('0x4b')]({},_0x6b93c,_0x5ac1b6[_0x9748('0x55')]);return db[_0x9748('0x6c')]['count']({'where':_0x6b93c[_0x9748('0x48')]})[_0x9748('0x2b')](function(_0x1eb4f9){_0x3fc47f[_0x9748('0x4c')]=_0x1eb4f9;if(_0x5ac1b6[_0x9748('0x40')][_0x9748('0x4d')]){_0x6b93c[_0x9748('0x4e')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x6b93c);})[_0x9748('0x2b')](function(_0x3d0a6f){_0x3fc47f[_0x9748('0x50')]=_0x3d0a6f;return _0x3fc47f;});}})[_0x9748('0x2b')](respondWithFilteredResult(_0x24bd3b,_0x6b93c))[_0x9748('0x51')](handleError(_0x24bd3b,null));};exports[_0x9748('0x6d')]=function(_0x170cc7,_0x17d7a1,_0x5e6cfd){var _0x5ae747={'raw':!![],'where':{}};var _0x43e441={};var _0x31e80d={'count':0x0,'rows':[]};return db[_0x9748('0x3c')][_0x9748('0x66')]({'where':{'id':_0x170cc7[_0x9748('0x60')]['id']}})[_0x9748('0x2b')](handleEntityNotFound(_0x17d7a1,null))['then'](function(_0x128917){if(_0x128917){_0x43e441[_0x9748('0x3f')]=_['keys'](db['CmHopperFinal'][_0x9748('0x54')]);_0x43e441[_0x9748('0x40')]=_[_0x9748('0x53')](_0x170cc7['query']);_0x43e441[_0x9748('0x41')]=_[_0x9748('0x42')](_0x43e441[_0x9748('0x3f')],_0x43e441[_0x9748('0x40')]);_0x5ae747[_0x9748('0x43')]=_[_0x9748('0x42')](_0x43e441[_0x9748('0x3f')],qs[_0x9748('0x44')](_0x170cc7['query'][_0x9748('0x44')]));_0x5ae747[_0x9748('0x43')]=_0x5ae747[_0x9748('0x43')][_0x9748('0x45')]?_0x5ae747['attributes']:_0x43e441[_0x9748('0x3f')];if(!_0x170cc7[_0x9748('0x40')]['hasOwnProperty'](_0x9748('0x46'))){_0x5ae747[_0x9748('0x25')]=qs[_0x9748('0x25')](_0x170cc7[_0x9748('0x40')][_0x9748('0x25')]);_0x5ae747[_0x9748('0x23')]=qs[_0x9748('0x23')](_0x170cc7[_0x9748('0x40')][_0x9748('0x23')]);}_0x5ae747[_0x9748('0x6b')]=qs[_0x9748('0x47')](_0x170cc7[_0x9748('0x40')][_0x9748('0x47')]);_0x5ae747['where']=qs[_0x9748('0x41')](_[_0x9748('0x49')](_0x170cc7[_0x9748('0x40')],_0x43e441[_0x9748('0x41')]));_0x5ae747[_0x9748('0x48')][_0x9748('0x69')]=_0x128917['id'];if(_0x170cc7[_0x9748('0x40')][_0x9748('0x30')]){_0x5ae747[_0x9748('0x48')]=_[_0x9748('0x4b')](_0x5ae747[_0x9748('0x48')],{'$or':_[_0x9748('0x32')](_0x5ae747[_0x9748('0x43')],function(_0xd43c85){var _0x514f75={};_0x514f75[_0xd43c85]={'$like':'%'+_0x170cc7[_0x9748('0x40')][_0x9748('0x30')]+'%'};return _0x514f75;})});}_0x5ae747=_['merge']({},_0x5ae747,_0x170cc7[_0x9748('0x55')]);return db['CmHopperFinal'][_0x9748('0x4c')]({'where':_0x5ae747['where']})[_0x9748('0x2b')](function(_0x4218a9){_0x31e80d['count']=_0x4218a9;if(_0x170cc7[_0x9748('0x40')][_0x9748('0x4d')]){_0x5ae747['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0x9748('0x4f')](_0x5ae747);})['then'](function(_0x50f475){_0x31e80d['rows']=_0x50f475;return _0x31e80d;});}})[_0x9748('0x2b')](respondWithFilteredResult(_0x17d7a1,_0x5ae747))[_0x9748('0x51')](handleError(_0x17d7a1,null));};exports[_0x9748('0x6e')]=function(_0x59f7be,_0x519741,_0x1fde80){var _0x3d3017={'raw':!![],'where':{}};var _0x3681e7={};var _0x2dec38={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x9748('0x66')]({'where':{'id':_0x59f7be['params']['id']}})[_0x9748('0x2b')](handleEntityNotFound(_0x519741,null))[_0x9748('0x2b')](function(_0x4f908c){if(_0x4f908c){_0x3681e7[_0x9748('0x3f')]=_[_0x9748('0x53')](db[_0x9748('0x6f')][_0x9748('0x54')]);_0x3681e7[_0x9748('0x40')]=_[_0x9748('0x53')](_0x59f7be[_0x9748('0x40')]);_0x3681e7[_0x9748('0x41')]=_[_0x9748('0x42')](_0x3681e7['model'],_0x3681e7['query']);_0x3d3017['attributes']=_[_0x9748('0x42')](_0x3681e7[_0x9748('0x3f')],qs[_0x9748('0x44')](_0x59f7be[_0x9748('0x40')][_0x9748('0x44')]));_0x3d3017[_0x9748('0x43')]=_0x3d3017[_0x9748('0x43')][_0x9748('0x45')]?_0x3d3017[_0x9748('0x43')]:_0x3681e7[_0x9748('0x3f')];if(!_0x59f7be[_0x9748('0x40')][_0x9748('0x68')]('nolimit')){_0x3d3017[_0x9748('0x25')]=qs['limit'](_0x59f7be[_0x9748('0x40')]['limit']);_0x3d3017['offset']=qs[_0x9748('0x23')](_0x59f7be[_0x9748('0x40')][_0x9748('0x23')]);}_0x3d3017['order']=qs[_0x9748('0x47')](_0x59f7be[_0x9748('0x40')][_0x9748('0x47')]);_0x3d3017[_0x9748('0x48')]=qs[_0x9748('0x41')](_[_0x9748('0x49')](_0x59f7be[_0x9748('0x40')],_0x3681e7[_0x9748('0x41')]));_0x3d3017[_0x9748('0x48')][_0x9748('0x69')]=_0x4f908c['id'];if(_0x59f7be[_0x9748('0x40')][_0x9748('0x30')]){_0x3d3017[_0x9748('0x48')]=_[_0x9748('0x4b')](_0x3d3017['where'],{'$or':_[_0x9748('0x32')](_0x3d3017[_0x9748('0x43')],function(_0x3749c8){var _0x9d5a2a={};_0x9d5a2a[_0x3749c8]={'$like':'%'+_0x59f7be[_0x9748('0x40')][_0x9748('0x30')]+'%'};return _0x9d5a2a;})});}_0x3d3017=_['merge']({},_0x3d3017,_0x59f7be[_0x9748('0x55')]);return db[_0x9748('0x6f')][_0x9748('0x4c')]({'where':_0x3d3017['where']})[_0x9748('0x2b')](function(_0x1b3e50){_0x2dec38['count']=_0x1b3e50;if(_0x59f7be[_0x9748('0x40')][_0x9748('0x4d')]){_0x3d3017[_0x9748('0x4e')]=[{'all':!![]}];}return db[_0x9748('0x6f')]['findAll'](_0x3d3017);})[_0x9748('0x2b')](function(_0x375868){_0x2dec38['rows']=_0x375868;return _0x2dec38;});}})[_0x9748('0x2b')](respondWithFilteredResult(_0x519741,_0x3d3017))[_0x9748('0x51')](handleError(_0x519741,null));};exports[_0x9748('0x70')]=function(_0x1bcc5f,_0x6bc563,_0x330871){var _0x509186={};var _0x4510fb={};var _0x1f10c5;var _0x95ad3d;return db[_0x9748('0x3c')]['findOne']({'where':{'id':_0x1bcc5f[_0x9748('0x60')]['id']}})['then'](handleEntityNotFound(_0x6bc563,null))['then'](function(_0x25cd43){if(_0x25cd43){_0x1f10c5=_0x25cd43;_0x4510fb[_0x9748('0x3f')]=_[_0x9748('0x53')](db[_0x9748('0x71')][_0x9748('0x54')]);_0x4510fb[_0x9748('0x40')]=_[_0x9748('0x53')](_0x1bcc5f['query']);_0x4510fb[_0x9748('0x41')]=_[_0x9748('0x42')](_0x4510fb['model'],_0x4510fb['query']);_0x509186[_0x9748('0x43')]=_[_0x9748('0x42')](_0x4510fb['model'],qs[_0x9748('0x44')](_0x1bcc5f[_0x9748('0x40')][_0x9748('0x44')]));_0x509186[_0x9748('0x43')]=_0x509186['attributes'][_0x9748('0x45')]?_0x509186[_0x9748('0x43')]:_0x4510fb[_0x9748('0x3f')];_0x509186[_0x9748('0x6b')]=qs['sort'](_0x1bcc5f[_0x9748('0x40')]['sort']);_0x509186[_0x9748('0x48')]=qs['filters'](_['pick'](_0x1bcc5f[_0x9748('0x40')],_0x4510fb[_0x9748('0x41')]));if(_0x1bcc5f[_0x9748('0x40')][_0x9748('0x30')]){_0x509186[_0x9748('0x48')]=_[_0x9748('0x4b')](_0x509186[_0x9748('0x48')],{'$or':_[_0x9748('0x32')](_0x509186[_0x9748('0x43')],function(_0x43472d){var _0x55470b={};_0x55470b[_0x43472d]={'$like':'%'+_0x1bcc5f[_0x9748('0x40')][_0x9748('0x30')]+'%'};return _0x55470b;})});}_0x509186=_[_0x9748('0x4b')]({},_0x509186,_0x1bcc5f[_0x9748('0x55')]);return _0x1f10c5[_0x9748('0x70')](_0x509186);}})[_0x9748('0x2b')](function(_0x3b7f9c){if(_0x3b7f9c){_0x95ad3d=_0x3b7f9c[_0x9748('0x45')];if(!_0x1bcc5f[_0x9748('0x40')][_0x9748('0x68')](_0x9748('0x46'))){_0x509186[_0x9748('0x25')]=qs[_0x9748('0x25')](_0x1bcc5f[_0x9748('0x40')][_0x9748('0x25')]);_0x509186['offset']=qs[_0x9748('0x23')](_0x1bcc5f[_0x9748('0x40')]['offset']);}return _0x1f10c5['getTeams'](_0x509186);}})[_0x9748('0x2b')](function(_0x13ee50){if(_0x13ee50){return _0x13ee50?{'count':_0x95ad3d,'rows':_0x13ee50}:null;}})[_0x9748('0x2b')](respondWithResult(_0x6bc563,null))[_0x9748('0x51')](handleError(_0x6bc563,null));};exports['addTeams']=function(_0x5782d7,_0x29d932,_0x5a1f28){var _0x4078c8=_0x5782d7[_0x9748('0x57')]['teams'];var _0x3788f6=_[_0x9748('0x32')](_0x4078c8,'id');return db['Team'][_0x9748('0x4f')]({'where':{'id':_0x3788f6},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x9748('0x37'),_0x9748('0x72'),_0x9748('0x73'),_0x9748('0x74')],'raw':!![]}]})[_0x9748('0x2b')](function(_0x45a158){if(_0x45a158){var _0x5ccd21=_['flatMap'](_0x45a158,function(_0x386d79){var _0x3628f8=_0x386d79['get']({'plain':!![]});_0x3628f8[_0x9748('0x75')][_0x9748('0x76')](function(_0x209bdf){_0x209bdf[_0x9748('0x77')]=_[_0x9748('0x35')](_0x4078c8,{'id':_0x3628f8['id']})[_0x9748('0x77')];});return _0x3628f8[_0x9748('0x75')];});return db[_0x9748('0x3c')]['find']({'where':{'id':_0x5782d7[_0x9748('0x60')]['id']}})[_0x9748('0x2b')](function(_0x2e99f3){return db[_0x9748('0x78')][_0x9748('0x79')](function(_0x363025){return _0x2e99f3['addTeams'](_0x3788f6,{'transaction':_0x363025})[_0x9748('0x2b')](function(){return BPromise['each'](_0x4078c8,function(_0x4786d2){return db['TeamVoiceQueue']['upsert']({'TeamId':_0x4786d2['id'],'VoiceQueueId':_0x5782d7[_0x9748('0x60')]['id'],'penalty':_0x4786d2[_0x9748('0x77')]},{'transaction':_0x363025});});})[_0x9748('0x2b')](function(){return BPromise[_0x9748('0x7a')](_0x5ccd21,function(_0x4d0cdb){return db[_0x9748('0x7b')]['findOrCreate']({'where':{'UserId':_0x4d0cdb['id'],'VoiceQueueId':_0x5782d7[_0x9748('0x60')]['id']},'defaults':{'penalty':_0x4d0cdb[_0x9748('0x77')]},'transaction':_0x363025});});})[_0x9748('0x2b')](function(){return BPromise[_0x9748('0x7a')](_[_0x9748('0x30')](_0x5ccd21,{'online':!![]}),function(_0x143ad8){return db[_0x9748('0x7c')][_0x9748('0x7d')]({'membername':_0x143ad8[_0x9748('0x37')],'UserId':_0x143ad8['id'],'queue_name':_0x2e99f3[_0x9748('0x37')],'VoiceQueueId':_0x2e99f3['id'],'interface':_[_0x9748('0x7e')](_0x143ad8[_0x9748('0x74')])?util[_0x9748('0x7f')](_0x9748('0x80'),_0x143ad8[_0x9748('0x37')]):_0x143ad8[_0x9748('0x74')],'paused':_0x143ad8[_0x9748('0x73')]||![],'penalty':_0x143ad8['penalty']},{'transaction':_0x363025});});})[_0x9748('0x2b')](function(){_0x5ccd21[_0x9748('0x76')](function(_0x185862){socket[_0x9748('0x81')](_0x9748('0x82'),{'UserId':_0x185862['id'],'VoiceQueueId':_0x2e99f3['id']});});});});});}})[_0x9748('0x2b')](respondWithStatusCode(_0x29d932,null))[_0x9748('0x51')](handleError(_0x29d932,null));};exports['removeTeams']=function(_0x3d9e7a,_0x23ea99,_0xfb2191){return db[_0x9748('0x71')][_0x9748('0x4f')]({'where':{'id':_0x3d9e7a[_0x9748('0x40')][_0x9748('0x83')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x9748('0x75'),'attributes':['id'],'raw':!![]}]})[_0x9748('0x2b')](handleEntityNotFound(_0x23ea99,null))[_0x9748('0x2b')](function(_0x1f4d15){var _0x4f75d8=_[_0x9748('0x32')](_0x1f4d15,'id');var _0x1844c8=[];var _0x5158a5=[];var _0x2d6708=squel[_0x9748('0x84')]();_0x2d6708[_0x9748('0x85')](_0x9748('0x86'))[_0x9748('0x87')](_0x9748('0x88'),'tq')[_0x9748('0x89')](_0x9748('0x8a'),'ut',_0x9748('0x8b'))[_0x9748('0x48')](_0x9748('0x8c'),_0x3d9e7a[_0x9748('0x60')]['id']);for(var _0x35c376=0x0;_0x35c376<_0x1f4d15[_0x9748('0x45')];_0x35c376+=0x1){let _0x2f05d6=_0x1f4d15[_0x35c376];for(var _0x1dee9b=0x0;_0x1dee9b<_0x2f05d6['Agents'][_0x9748('0x45')];_0x1dee9b+=0x1){let _0x332a4d=_0x2f05d6['Agents'][_0x1dee9b];var _0xcf320e=_0x2d6708[_0x9748('0x5f')]();_0xcf320e['where'](_0x9748('0x8d'),_0x332a4d['id']);_0x5158a5[_0x9748('0x8e')](db[_0x9748('0x78')][_0x9748('0x40')](_0xcf320e['toString'](),{'type':db[_0x9748('0x78')]['QueryTypes']['SELECT']})[_0x9748('0x2b')](function(_0x1e4a7b){if(_0x1e4a7b['length']===0x1){return _0x332a4d['id'];}else{var _0x4137fe=_['every'](_[_0x9748('0x32')](_0x1e4a7b,_0x9748('0x8f')),function(_0x5773ac){return _[_0x9748('0x34')](_0x4f75d8,_0x5773ac);});if(_0x4137fe){return _0x332a4d['id'];}}}));}}return BPromise['all'](_0x5158a5)['then'](function(_0x156f3d){_0x1844c8=_(_0x1844c8)[_0x9748('0x90')](_0x156f3d)[_0x9748('0x91')]()[_0x9748('0x33')]();return db[_0x9748('0x3c')][_0x9748('0x35')]({'where':{'id':_0x3d9e7a[_0x9748('0x60')]['id']}})[_0x9748('0x2b')](function(_0x853d8){return db[_0x9748('0x78')][_0x9748('0x79')](function(_0x49adb9){return _0x853d8[_0x9748('0x92')](_0x3d9e7a[_0x9748('0x40')][_0x9748('0x83')],{'transaction':_0x49adb9})['then'](function(){if(!_[_0x9748('0x93')](_0x1844c8)){return _0x853d8[_0x9748('0x94')](_0x1844c8,{'transaction':_0x49adb9})[_0x9748('0x2b')](function(){return db[_0x9748('0x7c')][_0x9748('0x2a')]({'where':{'VoiceQueueId':_0x3d9e7a['params']['id'],'UserId':_0x1844c8},'transaction':_0x49adb9});});}})['then'](function(){_0x1844c8['forEach'](function(_0x76591){socket[_0x9748('0x81')](_0x9748('0x95'),{'UserId':_0x76591,'VoiceQueueId':_0x853d8['id']});});});});});});})[_0x9748('0x2b')](respondWithStatusCode(_0x23ea99,null))[_0x9748('0x51')](handleError(_0x23ea99,null));};exports[_0x9748('0x96')]=function(_0x413c7c,_0x187c8c,_0x2b3a84){var _0x59215f,_0x3dc85c;return db[_0x9748('0x3c')][_0x9748('0x35')]({'where':{'id':_0x413c7c['params']['id']}})[_0x9748('0x2b')](handleEntityNotFound(_0x187c8c,null))[_0x9748('0x2b')](function(_0x2e4f3f){if(_0x2e4f3f){_0x3dc85c=_0x2e4f3f;return _0x2e4f3f[_0x9748('0x96')](_0x413c7c['body'][_0x9748('0x83')],_[_0x9748('0x61')](_0x413c7c[_0x9748('0x57')],[_0x9748('0x83'),'id'])||{})[_0x9748('0x97')](function(_0x70bb1b){for(var _0x8c8cf9=0x0;_0x8c8cf9<_0x413c7c[_0x9748('0x57')][_0x9748('0x83')][_0x9748('0x45')];_0x8c8cf9+=0x1){socket[_0x9748('0x81')](_0x9748('0x82'),{'UserId':Number(_0x413c7c['body'][_0x9748('0x83')][_0x8c8cf9]),'VoiceQueueId':Number(_0x413c7c[_0x9748('0x60')]['id'])});}return _0x70bb1b;});}})[_0x9748('0x2b')](function(_0x213019){_0x59215f=_0x213019||[];if(_0x3dc85c){return db['User'][_0x9748('0x4f')]({'where':{'id':_0x413c7c[_0x9748('0x57')][_0x9748('0x83')]},'attributes':['id','name',_0x9748('0x72'),_0x9748('0x73'),'interface'],'raw':!![]});}})[_0x9748('0x2b')](function(_0x3aa555){if(!_['isEmpty'](_0x3aa555)){var _0x1df33c=[];for(var _0x1ca7b3=0x0;_0x1ca7b3<_0x3aa555[_0x9748('0x45')];_0x1ca7b3++){if(_0x3aa555[_0x1ca7b3][_0x9748('0x72')]){_0x1df33c[_0x9748('0x8e')](db[_0x9748('0x7c')]['upsert']({'membername':_0x3aa555[_0x1ca7b3][_0x9748('0x37')],'UserId':_0x3aa555[_0x1ca7b3]['id'],'queue_name':_0x3dc85c[_0x9748('0x37')],'VoiceQueueId':_0x3dc85c['id'],'interface':_[_0x9748('0x7e')](_0x3aa555[_0x1ca7b3][_0x9748('0x74')])?util[_0x9748('0x7f')](_0x9748('0x80'),_0x3aa555[_0x1ca7b3][_0x9748('0x37')]):_0x3aa555[_0x1ca7b3][_0x9748('0x74')],'paused':_0x3aa555[_0x1ca7b3][_0x9748('0x73')]||![],'penalty':_0x413c7c[_0x9748('0x57')]['penalty']||0x0}));}}return BPromise[_0x9748('0x98')](_0x1df33c);}})[_0x9748('0x2b')](function(){return _0x59215f;})['then'](respondWithResult(_0x187c8c,null))[_0x9748('0x51')](handleError(_0x187c8c,null));};exports[_0x9748('0x94')]=function(_0x39e6f7,_0x59f4c4,_0x459bf1){return db['VoiceQueue'][_0x9748('0x35')]({'where':{'id':_0x39e6f7[_0x9748('0x60')]['id']}})[_0x9748('0x2b')](handleEntityNotFound(_0x59f4c4,null))[_0x9748('0x2b')](function(_0x329963){if(_0x329963){return _0x329963[_0x9748('0x94')](_0x39e6f7[_0x9748('0x40')][_0x9748('0x83')])[_0x9748('0x2b')](function(){if(_['isArray'](_0x39e6f7[_0x9748('0x40')][_0x9748('0x83')])){for(var _0x8c62e2=0x0;_0x8c62e2<_0x39e6f7[_0x9748('0x40')][_0x9748('0x83')][_0x9748('0x45')];_0x8c62e2+=0x1){socket[_0x9748('0x81')]('userVoiceQueue:remove',{'UserId':Number(_0x39e6f7['query'][_0x9748('0x83')][_0x8c62e2]),'VoiceQueueId':Number(_0x39e6f7[_0x9748('0x60')]['id'])});}}else{socket[_0x9748('0x81')](_0x9748('0x95'),{'UserId':Number(_0x39e6f7[_0x9748('0x40')][_0x9748('0x83')]),'VoiceQueueId':Number(_0x39e6f7['params']['id'])});}});}})['then'](function(_0x2b16af){return db[_0x9748('0x7c')][_0x9748('0x2a')]({'where':{'VoiceQueueId':_0x39e6f7['params']['id'],'UserId':_0x39e6f7[_0x9748('0x40')][_0x9748('0x83')]}})['then'](function(){return _0x2b16af;});})[_0x9748('0x2b')](respondWithStatusCode(_0x59f4c4,null))[_0x9748('0x51')](handleError(_0x59f4c4,null));};exports[_0x9748('0x99')]=function(_0x793688,_0x377f05,_0x381ae1){var _0x2e61c4={};var _0x1d33f2={};var _0xde5cc2;var _0x2a67c0;return db[_0x9748('0x3c')][_0x9748('0x66')]({'where':{'id':_0x793688['params']['id']}})[_0x9748('0x2b')](handleEntityNotFound(_0x377f05,null))['then'](function(_0x57cf0c){if(_0x57cf0c){_0xde5cc2=_0x57cf0c;_0x1d33f2[_0x9748('0x3f')]=_[_0x9748('0x53')](db[_0x9748('0x9a')]['rawAttributes']);_0x1d33f2[_0x9748('0x40')]=_[_0x9748('0x53')](_0x793688[_0x9748('0x40')]);_0x1d33f2['filters']=_[_0x9748('0x42')](_0x1d33f2[_0x9748('0x3f')],_0x1d33f2[_0x9748('0x40')]);_0x2e61c4[_0x9748('0x43')]=_[_0x9748('0x42')](_0x1d33f2[_0x9748('0x3f')],qs[_0x9748('0x44')](_0x793688[_0x9748('0x40')][_0x9748('0x44')]));_0x2e61c4[_0x9748('0x43')]=_0x2e61c4[_0x9748('0x43')][_0x9748('0x45')]?_0x2e61c4[_0x9748('0x43')]:_0x1d33f2[_0x9748('0x3f')];_0x2e61c4[_0x9748('0x6b')]=qs['sort'](_0x793688[_0x9748('0x40')][_0x9748('0x47')]);_0x2e61c4['where']=qs[_0x9748('0x41')](_[_0x9748('0x49')](_0x793688[_0x9748('0x40')],_0x1d33f2[_0x9748('0x41')]));if(_0x793688[_0x9748('0x40')]['filter']){_0x2e61c4['where']=_[_0x9748('0x4b')](_0x2e61c4[_0x9748('0x48')],{'$or':_[_0x9748('0x32')](_0x2e61c4['attributes'],function(_0x191950){var _0x4cce84={};_0x4cce84[_0x191950]={'$like':'%'+_0x793688[_0x9748('0x40')][_0x9748('0x30')]+'%'};return _0x4cce84;})});}_0x2e61c4=_[_0x9748('0x4b')]({},_0x2e61c4,_0x793688[_0x9748('0x55')]);return _0xde5cc2['getAgents'](_0x2e61c4);}})[_0x9748('0x2b')](function(_0x3a51d8){if(_0x3a51d8){_0x2a67c0=_0x3a51d8[_0x9748('0x45')];if(!_0x793688['query'][_0x9748('0x68')](_0x9748('0x46'))){_0x2e61c4['limit']=qs[_0x9748('0x25')](_0x793688['query']['limit']);_0x2e61c4[_0x9748('0x23')]=qs['offset'](_0x793688['query'][_0x9748('0x23')]);}return _0xde5cc2[_0x9748('0x99')](_0x2e61c4);}})['then'](function(_0x35a7b3){if(_0x35a7b3){return _0x35a7b3?{'count':_0x2a67c0,'rows':_0x35a7b3}:null;}})[_0x9748('0x2b')](respondWithResult(_0x377f05,null))[_0x9748('0x51')](handleError(_0x377f05,null));};exports[_0x9748('0x9b')]=function(_0x4b1d0a,_0x40da0a,_0x212559){var _0x245683={};var _0x3e417e={};var _0x4c70e4;var _0x5c0278;return db[_0x9748('0x3c')]['findOne']({'where':{'id':_0x4b1d0a[_0x9748('0x60')]['id']}})[_0x9748('0x2b')](handleEntityNotFound(_0x40da0a,null))[_0x9748('0x2b')](function(_0x293b93){if(_0x293b93){_0x4c70e4=_0x293b93;_0x3e417e[_0x9748('0x3f')]=_[_0x9748('0x53')](db[_0x9748('0x7c')][_0x9748('0x54')]);_0x3e417e[_0x9748('0x40')]=_[_0x9748('0x53')](_0x4b1d0a['query']);_0x3e417e[_0x9748('0x41')]=_['intersection'](_0x3e417e[_0x9748('0x3f')],_0x3e417e[_0x9748('0x40')]);_0x245683[_0x9748('0x43')]=_['intersection'](_0x3e417e[_0x9748('0x3f')],qs[_0x9748('0x44')](_0x4b1d0a[_0x9748('0x40')][_0x9748('0x44')]));_0x245683['attributes']=_0x245683[_0x9748('0x43')][_0x9748('0x45')]?_0x245683[_0x9748('0x43')]:_0x3e417e[_0x9748('0x3f')];_0x245683[_0x9748('0x6b')]=qs['sort'](_0x4b1d0a[_0x9748('0x40')][_0x9748('0x47')]);_0x245683[_0x9748('0x48')]=qs[_0x9748('0x41')](_[_0x9748('0x49')](_0x4b1d0a[_0x9748('0x40')],_0x3e417e['filters']));if(_0x4b1d0a[_0x9748('0x40')][_0x9748('0x30')]){_0x245683[_0x9748('0x48')]=_[_0x9748('0x4b')](_0x245683[_0x9748('0x48')],{'$or':_['map'](_0x245683[_0x9748('0x43')],function(_0x3862ba){var _0x5e2264={};_0x5e2264[_0x3862ba]={'$like':'%'+_0x4b1d0a[_0x9748('0x40')][_0x9748('0x30')]+'%'};return _0x5e2264;})});}_0x245683=_[_0x9748('0x4b')]({},_0x245683,_0x4b1d0a[_0x9748('0x55')]);return _0x4c70e4['getMembers'](_0x245683);}})[_0x9748('0x2b')](function(_0x4e102c){if(_0x4e102c){_0x5c0278=_0x4e102c[_0x9748('0x45')];if(!_0x4b1d0a[_0x9748('0x40')]['hasOwnProperty']('nolimit')){_0x245683[_0x9748('0x25')]=qs['limit'](_0x4b1d0a[_0x9748('0x40')][_0x9748('0x25')]);_0x245683[_0x9748('0x23')]=qs[_0x9748('0x23')](_0x4b1d0a[_0x9748('0x40')]['offset']);}return _0x4c70e4[_0x9748('0x9b')](_0x245683);}})[_0x9748('0x2b')](function(_0x317b89){return _0x317b89?{'count':_0x5c0278,'rows':_0x317b89}:null;})[_0x9748('0x2b')](respondWithResult(_0x40da0a,null))[_0x9748('0x51')](handleError(_0x40da0a,null));};exports[_0x9748('0x9c')]=function(_0x1174d0,_0x8e436a,_0x1cd1f4){var _0x143515={};var _0x564c1a={};var _0x4e0472;var _0x43dee5;return db[_0x9748('0x3c')]['findOne']({'where':{'id':_0x1174d0[_0x9748('0x60')]['id']}})[_0x9748('0x2b')](handleEntityNotFound(_0x8e436a,null))[_0x9748('0x2b')](function(_0x2d73ae){if(_0x2d73ae){_0x4e0472=_0x2d73ae;_0x564c1a[_0x9748('0x3f')]=_[_0x9748('0x53')](db[_0x9748('0x9d')][_0x9748('0x54')]);_0x564c1a[_0x9748('0x40')]=_['keys'](_0x1174d0[_0x9748('0x40')]);_0x564c1a[_0x9748('0x41')]=_[_0x9748('0x42')](_0x564c1a[_0x9748('0x3f')],_0x564c1a[_0x9748('0x40')]);_0x143515[_0x9748('0x43')]=_[_0x9748('0x42')](_0x564c1a[_0x9748('0x3f')],qs[_0x9748('0x44')](_0x1174d0[_0x9748('0x40')][_0x9748('0x44')]));_0x143515[_0x9748('0x43')]=_0x143515['attributes']['length']?_0x143515[_0x9748('0x43')]:_0x564c1a[_0x9748('0x3f')];_0x143515[_0x9748('0x6b')]=qs[_0x9748('0x47')](_0x1174d0['query'][_0x9748('0x47')]);_0x143515[_0x9748('0x48')]=qs[_0x9748('0x41')](_[_0x9748('0x49')](_0x1174d0[_0x9748('0x40')],_0x564c1a['filters']));if(_0x1174d0[_0x9748('0x40')][_0x9748('0x30')]){_0x143515[_0x9748('0x48')]=_[_0x9748('0x4b')](_0x143515[_0x9748('0x48')],{'$or':_[_0x9748('0x32')](_0x143515[_0x9748('0x43')],function(_0x2873f5){var _0x2107de={};_0x2107de[_0x2873f5]={'$like':'%'+_0x1174d0[_0x9748('0x40')][_0x9748('0x30')]+'%'};return _0x2107de;})});}_0x143515=_[_0x9748('0x4b')]({},_0x143515,_0x1174d0[_0x9748('0x55')]);return _0x4e0472['getLists'](_0x143515);}})[_0x9748('0x2b')](function(_0x144e4e){if(_0x144e4e){_0x43dee5=_0x144e4e[_0x9748('0x45')];if(!_0x1174d0[_0x9748('0x40')][_0x9748('0x68')]('nolimit')){_0x143515[_0x9748('0x25')]=qs['limit'](_0x1174d0[_0x9748('0x40')][_0x9748('0x25')]);_0x143515[_0x9748('0x23')]=qs[_0x9748('0x23')](_0x1174d0[_0x9748('0x40')]['offset']);}return _0x4e0472[_0x9748('0x9c')](_0x143515);}})[_0x9748('0x2b')](function(_0x4acdd9){if(_0x4acdd9){return _0x4acdd9?{'count':_0x43dee5,'rows':_0x4acdd9}:null;}})[_0x9748('0x2b')](respondWithResult(_0x8e436a,null))['catch'](handleError(_0x8e436a,null));};exports['addLists']=function(_0x53ee11,_0x40b475,_0x595c4e){var _0xcf5288,_0x15f46f;return db[_0x9748('0x3c')][_0x9748('0x35')]({'where':{'id':_0x53ee11[_0x9748('0x60')]['id']}})['then'](handleEntityNotFound(_0x40b475,null))['then'](function(_0xb5085){if(_0xb5085){_0x15f46f=_0xb5085;return _0xb5085[_0x9748('0x9e')](_0x53ee11[_0x9748('0x57')][_0x9748('0x83')],_[_0x9748('0x61')](_0x53ee11['body'],[_0x9748('0x83'),'id'])||{});}return null;})[_0x9748('0x97')](function(_0xa733f5){var _0x5598fb;_0xcf5288=_0xa733f5||[];var _0x41df72=[];if(_0xa733f5){for(var _0xac038e=0x0;_0xac038e<_0xa733f5['length'];_0xac038e+=0x1){var _0x2b594d=_0xa733f5[_0xac038e][_0x9748('0x2c')]({'plain':!![]});_0x15f46f[_0x9748('0x9f')]=_0x53ee11[_0x9748('0x57')][_0x9748('0x9f')]?_0x53ee11[_0x9748('0x57')]['dialCheckDuplicateType']:_0x15f46f[_0x9748('0x9f')];switch(_0x15f46f[_0x9748('0x9f')]){case _0x9748('0xa0'):_0x5598fb=squel[_0x9748('0xa1')]()[_0x9748('0xa2')](_0x9748('0xa3'))[_0x9748('0xa4')]([_0x9748('0xa5'),_0x9748('0xa6'),_0x9748('0xa7'),_0x9748('0xa8'),_0x9748('0x69'),'createdAt',_0x9748('0x62')],squel['select']()[_0x9748('0x85')](_0x9748('0xa5'),_0x9748('0xa5'))[_0x9748('0x85')](_0x9748('0xa9'),_0x9748('0xa6'))[_0x9748('0x85')]('id',_0x9748('0xa7'))['field'](_0x2b594d['CmListId'][_0x9748('0xaa')](),_0x9748('0xa8'))[_0x9748('0x85')](_0x53ee11[_0x9748('0x60')]['id'][_0x9748('0xaa')](),_0x9748('0x69'))['field']('NOW()',_0x9748('0x63'))[_0x9748('0x85')](_0x9748('0xa9'),_0x9748('0x62'))[_0x9748('0x87')](_0x9748('0xab'))['where'](_0x9748('0xac'))['where'](_0x9748('0xad'),_0x2b594d[_0x9748('0xae')][_0x9748('0xaa')]())['where'](_0x9748('0xaf'))[_0x9748('0x48')](_0x9748('0xb0'),squel['select']()[_0x9748('0x85')]('COALESCE(calleridnum,\x27\x27)')[_0x9748('0x87')](_0x9748('0xb1'))[_0x9748('0x48')]('VoiceQueueId\x20=\x20?',_0x53ee11[_0x9748('0x60')]['id'][_0x9748('0xaa')]()))[_0x9748('0x48')]('phone\x20NOT\x20IN\x20(?)',squel[_0x9748('0x84')]()[_0x9748('0x85')](_0x9748('0xb2'))['from'](_0x9748('0xa3'))['where']('VoiceQueueId\x20=\x20?',_0x53ee11['params']['id'][_0x9748('0xaa')]())))[_0x9748('0xaa')]();break;case _0x9748('0xb3'):_0x5598fb=squel[_0x9748('0xa1')]()['into'](_0x9748('0xa3'))[_0x9748('0xa4')]([_0x9748('0xa5'),'scheduledAt',_0x9748('0xa7'),'ListId',_0x9748('0x69'),'createdAt',_0x9748('0x62')],squel[_0x9748('0x84')]()[_0x9748('0x85')]('phone',_0x9748('0xa5'))[_0x9748('0x85')](_0x9748('0xa9'),_0x9748('0xa6'))[_0x9748('0x85')]('id',_0x9748('0xa7'))[_0x9748('0x85')](_0x2b594d[_0x9748('0xae')][_0x9748('0xaa')](),_0x9748('0xa8'))['field'](_0x53ee11[_0x9748('0x60')]['id'][_0x9748('0xaa')](),_0x9748('0x69'))[_0x9748('0x85')](_0x9748('0xa9'),_0x9748('0x63'))[_0x9748('0x85')](_0x9748('0xa9'),'updatedAt')['from']('cm_contacts')[_0x9748('0x48')](_0x9748('0xac'))['where']('ListId\x20=\x20?',_0x2b594d[_0x9748('0xae')][_0x9748('0xaa')]())[_0x9748('0x48')]('phone\x20IS\x20NOT\x20NULL')['where'](_0x9748('0xb0'),squel[_0x9748('0x84')]()[_0x9748('0x85')](_0x9748('0xb2'))[_0x9748('0x87')](_0x9748('0xa3'))[_0x9748('0x48')](_0x9748('0x8c'),_0x53ee11['params']['id'][_0x9748('0xaa')]())))[_0x9748('0xaa')]();break;default:_0x5598fb=squel['insert']()['into'](_0x9748('0xa3'))[_0x9748('0xa4')]([_0x9748('0xa5'),'scheduledAt','ContactId',_0x9748('0xa8'),_0x9748('0x69'),_0x9748('0x63'),_0x9748('0x62')],squel[_0x9748('0x84')]()[_0x9748('0x85')]('phone',_0x9748('0xa5'))[_0x9748('0x85')]('NOW()',_0x9748('0xa6'))[_0x9748('0x85')]('id','ContactId')[_0x9748('0x85')](_0x2b594d[_0x9748('0xae')]['toString'](),'ListId')[_0x9748('0x85')](_0x53ee11[_0x9748('0x60')]['id']['toString'](),_0x9748('0x69'))[_0x9748('0x85')](_0x9748('0xa9'),_0x9748('0x63'))[_0x9748('0x85')](_0x9748('0xa9'),_0x9748('0x62'))[_0x9748('0x87')](_0x9748('0xab'))[_0x9748('0x48')](_0x9748('0xac'))[_0x9748('0x48')]('ListId\x20=\x20?',_0x2b594d[_0x9748('0xae')][_0x9748('0xaa')]())[_0x9748('0x48')](_0x9748('0xaf')))[_0x9748('0xaa')]();}_0x41df72[_0x9748('0x8e')](db[_0x9748('0x78')][_0x9748('0x40')](_0x5598fb));}return BPromise['all'](_0x41df72);}})[_0x9748('0x2b')](function(){return _0xcf5288;})[_0x9748('0x2b')](respondWithResult(_0x40b475,null))[_0x9748('0x51')](handleError(_0x40b475,null));};exports[_0x9748('0xb4')]=function(_0x28cf5e,_0x5ca10,_0x44a529){return db[_0x9748('0x3c')][_0x9748('0x35')]({'where':{'id':_0x28cf5e[_0x9748('0x60')]['id']}})[_0x9748('0x2b')](handleEntityNotFound(_0x5ca10,null))[_0x9748('0x2b')](function(_0x284eda){if(_0x284eda){return _0x284eda[_0x9748('0xb4')](_0x28cf5e[_0x9748('0x40')][_0x9748('0x83')]);}})[_0x9748('0x2b')](function(_0x24bf04){if(_0x24bf04){return db[_0x9748('0x67')][_0x9748('0x2a')]({'where':{'ListId':_0x28cf5e[_0x9748('0x40')][_0x9748('0x83')],'VoiceQueueId':_0x28cf5e['params']['id']}})[_0x9748('0x2b')](function(){return _0x24bf04;});}})[_0x9748('0x2b')](respondWithStatusCode(_0x5ca10,null))[_0x9748('0x51')](handleError(_0x5ca10,null));};exports['getBlackLists']=function(_0x2d33af,_0x2e60dd,_0xb13566){var _0x1bbf29={};var _0x3e398e={};var _0x1ecf39;var _0x16bf56;return db[_0x9748('0x3c')]['findOne']({'where':{'id':_0x2d33af[_0x9748('0x60')]['id']}})[_0x9748('0x2b')](handleEntityNotFound(_0x2e60dd,null))[_0x9748('0x2b')](function(_0x210c61){if(_0x210c61){_0x1ecf39=_0x210c61;_0x3e398e[_0x9748('0x3f')]=_[_0x9748('0x53')](db['CmList']['rawAttributes']);_0x3e398e[_0x9748('0x40')]=_[_0x9748('0x53')](_0x2d33af[_0x9748('0x40')]);_0x3e398e['filters']=_[_0x9748('0x42')](_0x3e398e[_0x9748('0x3f')],_0x3e398e[_0x9748('0x40')]);_0x1bbf29['attributes']=_[_0x9748('0x42')](_0x3e398e['model'],qs[_0x9748('0x44')](_0x2d33af[_0x9748('0x40')]['fields']));_0x1bbf29[_0x9748('0x43')]=_0x1bbf29['attributes'][_0x9748('0x45')]?_0x1bbf29[_0x9748('0x43')]:_0x3e398e[_0x9748('0x3f')];_0x1bbf29[_0x9748('0x6b')]=qs[_0x9748('0x47')](_0x2d33af['query'][_0x9748('0x47')]);_0x1bbf29[_0x9748('0x48')]=qs['filters'](_[_0x9748('0x49')](_0x2d33af[_0x9748('0x40')],_0x3e398e['filters']));if(_0x2d33af[_0x9748('0x40')][_0x9748('0x30')]){_0x1bbf29['where']=_[_0x9748('0x4b')](_0x1bbf29['where'],{'$or':_[_0x9748('0x32')](_0x1bbf29[_0x9748('0x43')],function(_0x27f9ed){var _0x870d8c={};_0x870d8c[_0x27f9ed]={'$like':'%'+_0x2d33af[_0x9748('0x40')]['filter']+'%'};return _0x870d8c;})});}_0x1bbf29=_[_0x9748('0x4b')]({},_0x1bbf29,_0x2d33af[_0x9748('0x55')]);return _0x1ecf39[_0x9748('0xb5')](_0x1bbf29);}})[_0x9748('0x2b')](function(_0x148b03){if(_0x148b03){_0x16bf56=_0x148b03['length'];if(!_0x2d33af['query'][_0x9748('0x68')](_0x9748('0x46'))){_0x1bbf29[_0x9748('0x25')]=qs['limit'](_0x2d33af[_0x9748('0x40')]['limit']);_0x1bbf29['offset']=qs[_0x9748('0x23')](_0x2d33af[_0x9748('0x40')][_0x9748('0x23')]);}return _0x1ecf39['getBlackLists'](_0x1bbf29);}})[_0x9748('0x2b')](function(_0xd54e8){if(_0xd54e8){return _0xd54e8?{'count':_0x16bf56,'rows':_0xd54e8}:null;}})[_0x9748('0x2b')](respondWithResult(_0x2e60dd,null))[_0x9748('0x51')](handleError(_0x2e60dd,null));};exports[_0x9748('0xb6')]=function(_0x2a91c6,_0x22baec,_0x380c41){var _0x528e9a,_0x1617e2;return db[_0x9748('0x3c')]['find']({'where':{'id':_0x2a91c6[_0x9748('0x60')]['id']}})['then'](handleEntityNotFound(_0x22baec,null))[_0x9748('0x2b')](function(_0x286a96){if(_0x286a96){_0x1617e2=_0x286a96;return _0x286a96[_0x9748('0xb6')](_0x2a91c6[_0x9748('0x57')]['ids'],_['omit'](_0x2a91c6[_0x9748('0x57')],[_0x9748('0x83'),'id'])||{});}return null;})['spread'](function(_0x5ce7cd){var _0x271ea8;_0x528e9a=_0x5ce7cd||[];var _0x2d7764=[];if(_0x5ce7cd){for(var _0x4385c2=0x0;_0x4385c2<_0x5ce7cd[_0x9748('0x45')];_0x4385c2+=0x1){var _0x59d4eb=_0x5ce7cd[_0x4385c2]['get']({'plain':!![]});_0x271ea8=squel[_0x9748('0xa1')]()['into'](_0x9748('0xb7'))[_0x9748('0xa4')]([_0x9748('0xa5'),_0x9748('0xa7'),_0x9748('0xa8'),'VoiceQueueId',_0x9748('0x63'),_0x9748('0x62')],squel[_0x9748('0x84')]()['field'](_0x9748('0xa5'),_0x9748('0xa5'))['field']('id',_0x9748('0xa7'))[_0x9748('0x85')](_0x59d4eb['CmListId'][_0x9748('0xaa')](),_0x9748('0xa8'))[_0x9748('0x85')](_0x2a91c6[_0x9748('0x60')]['id'][_0x9748('0xaa')](),_0x9748('0x69'))[_0x9748('0x85')]('NOW()',_0x9748('0x63'))[_0x9748('0x85')](_0x9748('0xa9'),_0x9748('0x62'))[_0x9748('0x87')](_0x9748('0xab'))['where'](_0x9748('0xac'))['where']('ListId\x20=\x20?',_0x59d4eb[_0x9748('0xae')][_0x9748('0xaa')]())[_0x9748('0x48')](_0x9748('0xaf')))['toString']();_0x2d7764[_0x9748('0x8e')](db[_0x9748('0x78')][_0x9748('0x40')](_0x271ea8));}return BPromise[_0x9748('0x98')](_0x2d7764);}})[_0x9748('0x2b')](function(){return _0x528e9a;})[_0x9748('0x2b')](respondWithResult(_0x22baec,null))['catch'](handleError(_0x22baec,null));};exports[_0x9748('0xb8')]=function(_0x5c20b2,_0x4a895b,_0x23ad10){return db[_0x9748('0x3c')][_0x9748('0x35')]({'where':{'id':_0x5c20b2[_0x9748('0x60')]['id']}})[_0x9748('0x2b')](handleEntityNotFound(_0x4a895b,null))[_0x9748('0x2b')](function(_0x28034b){if(_0x28034b){return _0x28034b[_0x9748('0xb8')](_0x5c20b2[_0x9748('0x40')][_0x9748('0x83')]);}})['then'](function(_0x5a3f69){if(_0x5a3f69){return db[_0x9748('0x6f')]['destroy']({'where':{'ListId':_0x5c20b2['query'][_0x9748('0x83')],'VoiceQueueId':_0x5c20b2[_0x9748('0x60')]['id']}})[_0x9748('0x2b')](function(){return _0x5a3f69;});}})[_0x9748('0x2b')](respondWithStatusCode(_0x4a895b,null))[_0x9748('0x51')](handleError(_0x4a895b,null));}; \ No newline at end of file +var _0x1772=['UserVoiceQueueRt','isNil','format','SIP/%s','interface','emit','removeTeams','ids','select','tq.TeamId','team_has_voice_queues','join','user_has_teams','VoiceQueueId\x20=\x20?','toString','every','TeamId','compact','isEmpty','forEach','addAgents','spread','removeAgents','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','field','phone','CmListId','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','push','all','removeLists','getBlackLists','addBlackLists','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','reject','save','update','then','destroy','VoiceQueues','QueueCampaigns','outbound','filter','map','value','includes','type','find','name','UserProfileResource','error','stack','send','index','VoiceQueue','rawAttributes','fieldName','model','query','intersection','attributes','fields','length','nolimit','order','sort','pick','filters','where','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','keys','include','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','get','omit','createdAt','updatedAt','findOne','CmHopper','VoiceQueueId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','hasOwnProperty','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','User','Agents','online','voicePause','flatMap','penalty','sequelize','each','upsert','UserVoiceQueue','findOrCreate'];(function(_0x46642f,_0x1b1d3f){var _0x5a7bdd=function(_0x3b825b){while(--_0x3b825b){_0x46642f['push'](_0x46642f['shift']());}};_0x5a7bdd(++_0x1b1d3f);}(_0x1772,0xeb));var _0x2177=function(_0x6afba2,_0x365bed){_0x6afba2=_0x6afba2-0x0;var _0x22c014=_0x1772[_0x6afba2];return _0x22c014;};'use strict';var emlformat=require(_0x2177('0x0'));var rimraf=require(_0x2177('0x1'));var zipdir=require(_0x2177('0x2'));var jsonpatch=require(_0x2177('0x3'));var rp=require(_0x2177('0x4'));var moment=require('moment');var BPromise=require(_0x2177('0x5'));var Mustache=require(_0x2177('0x6'));var util=require(_0x2177('0x7'));var path=require(_0x2177('0x8'));var sox=require('sox');var csv=require(_0x2177('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2177('0xa'));var _=require(_0x2177('0xb'));var squel=require(_0x2177('0xc'));var crypto=require(_0x2177('0xd'));var jsforce=require(_0x2177('0xe'));var deskjs=require(_0x2177('0xf'));var toCsv=require(_0x2177('0x9'));var querystring=require(_0x2177('0x10'));var Papa=require(_0x2177('0x11'));var Redis=require(_0x2177('0x12'));var authService=require(_0x2177('0x13'));var qs=require(_0x2177('0x14'));var as=require(_0x2177('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2177('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2177('0x17'));var db=require(_0x2177('0x18'))['db'];config[_0x2177('0x19')]=_['defaults'](config[_0x2177('0x19')],{'host':_0x2177('0x1a'),'port':0x18eb});var socket=require(_0x2177('0x1b'))(new Redis(config[_0x2177('0x19')]));require('./voiceQueue.socket')['register'](socket);function respondWithStatusCode(_0x22aeed,_0x3153a1){_0x3153a1=_0x3153a1||0xcc;return function(_0x5c376b){if(_0x5c376b){return _0x22aeed[_0x2177('0x1c')](_0x3153a1);}return _0x22aeed[_0x2177('0x1d')](_0x3153a1)[_0x2177('0x1e')]();};}function respondWithResult(_0x1fd660,_0x15d8c0){_0x15d8c0=_0x15d8c0||0xc8;return function(_0x1991d0){if(_0x1991d0){return _0x1fd660['status'](_0x15d8c0)[_0x2177('0x1f')](_0x1991d0);}};}function respondWithFilteredResult(_0xeaca35,_0x346849){return function(_0x284e9e){if(_0x284e9e){var _0x52420a=typeof _0x346849['offset']===_0x2177('0x20')&&typeof _0x346849[_0x2177('0x21')]===_0x2177('0x20');var _0x3bc04d=_0x284e9e[_0x2177('0x22')];var _0x19c888=_0x52420a?0x0:_0x346849[_0x2177('0x23')];var _0x50b7e5=_0x52420a?_0x284e9e['count']:_0x346849['offset']+_0x346849[_0x2177('0x21')];var _0x333c18;if(_0x50b7e5>=_0x3bc04d){_0x50b7e5=_0x3bc04d;_0x333c18=0xc8;}else{_0x333c18=0xce;}_0xeaca35[_0x2177('0x1d')](_0x333c18);return _0xeaca35['set'](_0x2177('0x24'),_0x19c888+'-'+_0x50b7e5+'/'+_0x3bc04d)[_0x2177('0x1f')](_0x284e9e);}return null;};}function patchUpdates(_0x4b01af){return function(_0x8fa319){try{jsonpatch['apply'](_0x8fa319,_0x4b01af,!![]);}catch(_0x2ce352){return BPromise[_0x2177('0x25')](_0x2ce352);}return _0x8fa319[_0x2177('0x26')]();};}function saveUpdates(_0x83791c,_0x3ee1c9){return function(_0x2da22e){if(_0x2da22e){return _0x2da22e[_0x2177('0x27')](_0x83791c)[_0x2177('0x28')](function(_0x17caaf){return _0x17caaf;});}return null;};}function removeEntity(_0x3b626a,_0x100cfa){return function(_0x301281){if(_0x301281){return _0x301281[_0x2177('0x29')]()[_0x2177('0x28')](function(){var _0x4dea64=_0x301281['get']({'plain':!![]});var _0x564ab8=[{'name':_0x2177('0x2a'),'value':'inbound','ignore':![]},{'name':_0x2177('0x2b'),'value':_0x2177('0x2c'),'ignore':![]}];var _0x15cfa5=_(_0x564ab8)[_0x2177('0x2d')]('ignore')[_0x2177('0x2e')](_0x2177('0x2f'))['value']();if(_[_0x2177('0x30')](_0x15cfa5,_0x4dea64[_0x2177('0x31')])){return;}var _0x1e9d80=_[_0x2177('0x32')](_0x564ab8,[_0x2177('0x2f'),_0x4dea64[_0x2177('0x31')]])[_0x2177('0x33')];return db[_0x2177('0x34')][_0x2177('0x29')]({'where':{'type':_0x1e9d80,'resourceId':_0x4dea64['id']}})[_0x2177('0x28')](function(){return _0x301281;});})[_0x2177('0x28')](function(){_0x3b626a[_0x2177('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x78c900,_0x1845c3){return function(_0x5cf515){if(!_0x5cf515){_0x78c900['sendStatus'](0x194);}return _0x5cf515;};}function handleError(_0x46423c,_0x2df8bb){_0x2df8bb=_0x2df8bb||0x1f4;return function(_0x3b0b93){logger[_0x2177('0x35')](_0x3b0b93[_0x2177('0x36')]);if(_0x3b0b93[_0x2177('0x33')]){delete _0x3b0b93[_0x2177('0x33')];}_0x46423c[_0x2177('0x1d')](_0x2df8bb)[_0x2177('0x37')](_0x3b0b93);};}exports[_0x2177('0x38')]=function(_0x1ff93b,_0xad110b){var _0x55281e={},_0x50768c={},_0x51c5d7={'count':0x0,'rows':[]};var _0x1386cc=_['map'](db[_0x2177('0x39')][_0x2177('0x3a')],function(_0x2e4934){return{'name':_0x2e4934[_0x2177('0x3b')],'type':_0x2e4934[_0x2177('0x31')]['key']};});_0x50768c[_0x2177('0x3c')]=_['map'](_0x1386cc,_0x2177('0x33'));_0x50768c[_0x2177('0x3d')]=_['keys'](_0x1ff93b[_0x2177('0x3d')]);_0x50768c['filters']=_[_0x2177('0x3e')](_0x50768c['model'],_0x50768c['query']);_0x55281e[_0x2177('0x3f')]=_['intersection'](_0x50768c[_0x2177('0x3c')],qs[_0x2177('0x40')](_0x1ff93b[_0x2177('0x3d')][_0x2177('0x40')]));_0x55281e[_0x2177('0x3f')]=_0x55281e[_0x2177('0x3f')][_0x2177('0x41')]?_0x55281e[_0x2177('0x3f')]:_0x50768c[_0x2177('0x3c')];if(!_0x1ff93b[_0x2177('0x3d')]['hasOwnProperty'](_0x2177('0x42'))){_0x55281e['limit']=qs[_0x2177('0x21')](_0x1ff93b[_0x2177('0x3d')][_0x2177('0x21')]);_0x55281e['offset']=qs[_0x2177('0x23')](_0x1ff93b['query']['offset']);}_0x55281e[_0x2177('0x43')]=qs[_0x2177('0x44')](_0x1ff93b[_0x2177('0x3d')]['sort']);_0x55281e['where']=qs['filters'](_[_0x2177('0x45')](_0x1ff93b[_0x2177('0x3d')],_0x50768c[_0x2177('0x46')]),_0x1386cc);if(_0x1ff93b['query'][_0x2177('0x2d')]){_0x55281e[_0x2177('0x47')]=_['merge'](_0x55281e[_0x2177('0x47')],{'$or':_[_0x2177('0x2e')](_0x1386cc,function(_0x316858){if(_0x316858[_0x2177('0x31')]!==_0x2177('0x48')){var _0x53e199={};_0x53e199[_0x316858[_0x2177('0x33')]]={'$like':'%'+_0x1ff93b['query'][_0x2177('0x2d')]+'%'};return _0x53e199;}})});}_0x55281e=_[_0x2177('0x49')]({},_0x55281e,_0x1ff93b[_0x2177('0x4a')]);var _0x35861a={'where':_0x55281e[_0x2177('0x47')]};return db[_0x2177('0x39')][_0x2177('0x22')](_0x35861a)[_0x2177('0x28')](function(_0x47eafc){_0x51c5d7[_0x2177('0x22')]=_0x47eafc;if(_0x1ff93b[_0x2177('0x3d')][_0x2177('0x4b')]){_0x55281e['include']=[{'all':!![]}];}return db[_0x2177('0x39')][_0x2177('0x4c')](_0x55281e);})['then'](function(_0x47e02f){_0x51c5d7[_0x2177('0x4d')]=_0x47e02f;return _0x51c5d7;})[_0x2177('0x28')](respondWithFilteredResult(_0xad110b,_0x55281e))['catch'](handleError(_0xad110b,null));};exports[_0x2177('0x4e')]=function(_0x359713,_0x2d1573){var _0x1d8d57={'raw':![],'where':{'id':_0x359713[_0x2177('0x4f')]['id']}},_0x3d56c0={};_0x3d56c0['model']=_[_0x2177('0x50')](db[_0x2177('0x39')][_0x2177('0x3a')]);_0x3d56c0[_0x2177('0x3d')]=_[_0x2177('0x50')](_0x359713['query']);_0x3d56c0[_0x2177('0x46')]=_['intersection'](_0x3d56c0[_0x2177('0x3c')],_0x3d56c0[_0x2177('0x3d')]);_0x1d8d57[_0x2177('0x3f')]=_['intersection'](_0x3d56c0[_0x2177('0x3c')],qs['fields'](_0x359713[_0x2177('0x3d')]['fields']));_0x1d8d57[_0x2177('0x3f')]=_0x1d8d57[_0x2177('0x3f')]['length']?_0x1d8d57['attributes']:_0x3d56c0[_0x2177('0x3c')];if(_0x359713[_0x2177('0x3d')]['includeAll']){_0x1d8d57[_0x2177('0x51')]=[{'all':!![]}];}_0x1d8d57=_['merge']({},_0x1d8d57,_0x359713['options']);return db['VoiceQueue'][_0x2177('0x32')](_0x1d8d57)[_0x2177('0x28')](handleEntityNotFound(_0x2d1573,null))[_0x2177('0x28')](respondWithResult(_0x2d1573,null))[_0x2177('0x52')](handleError(_0x2d1573,null));};exports[_0x2177('0x53')]=function(_0x2b33d5,_0x48943b){return db[_0x2177('0x39')][_0x2177('0x53')](_0x2b33d5[_0x2177('0x54')],{})[_0x2177('0x28')](function(_0x549b78){var _0x4f18ea=_0x2b33d5[_0x2177('0x55')]['get']({'plain':!![]});if(!_0x4f18ea)throw new Error(_0x2177('0x56'));if(_0x4f18ea[_0x2177('0x57')]==='user'){var _0x15fd8f=_0x549b78['get']({'plain':!![]});var _0x4cc414=[{'name':_0x2177('0x2a'),'value':'inbound'},{'name':_0x2177('0x2b'),'value':_0x2177('0x2c')}];var _0xfc9e23=_[_0x2177('0x32')](_0x4cc414,[_0x2177('0x2f'),_0x15fd8f['type']])[_0x2177('0x33')];return db[_0x2177('0x58')][_0x2177('0x32')]({'where':{'name':_0xfc9e23,'userProfileId':_0x4f18ea[_0x2177('0x59')]},'raw':!![]})[_0x2177('0x28')](function(_0x53f271){if(_0x53f271&&_0x53f271[_0x2177('0x5a')]===0x0){return db['UserProfileResource'][_0x2177('0x53')]({'name':_0x15fd8f[_0x2177('0x33')],'resourceId':_0x15fd8f['id'],'type':_0x53f271[_0x2177('0x33')],'sectionId':_0x53f271['id']},{})[_0x2177('0x28')](function(){return _0x549b78;});}else{return _0x549b78;}})[_0x2177('0x52')](function(_0x5564f0){logger['error'](_0x2177('0x5b'),_0x5564f0);throw _0x5564f0;});}return _0x549b78;})[_0x2177('0x28')](respondWithResult(_0x48943b,0xc9))[_0x2177('0x52')](handleError(_0x48943b,null));};exports[_0x2177('0x5c')]=function(_0x276cee,_0x5cd014){var _0x52f7d2={'where':{'id':_0x276cee[_0x2177('0x4f')]['id']}},_0x2739b2={};_0x2739b2[_0x2177('0x3c')]=_[_0x2177('0x50')](db[_0x2177('0x39')][_0x2177('0x3a')]);_0x52f7d2['attributes']=_[_0x2177('0x3e')](_0x2739b2[_0x2177('0x3c')],qs['fields'](_0x276cee[_0x2177('0x3d')][_0x2177('0x40')]));_0x52f7d2[_0x2177('0x3f')]=_0x52f7d2[_0x2177('0x3f')][_0x2177('0x41')]?_0x52f7d2[_0x2177('0x3f')]:_0x2739b2[_0x2177('0x3c')];if(_0x276cee[_0x2177('0x3d')][_0x2177('0x4b')]){_0x52f7d2[_0x2177('0x51')]=[{'all':!![]}];}_0x52f7d2=_[_0x2177('0x49')]({},_0x52f7d2,_0x276cee['options']);return db[_0x2177('0x39')][_0x2177('0x32')](_0x52f7d2)[_0x2177('0x28')](handleEntityNotFound(_0x5cd014,null))[_0x2177('0x28')](function(_0xabdeab){if(_0xabdeab){var _0x572b6c=_0xabdeab[_0x2177('0x5d')]({'plain':!![]});_0x572b6c=qs[_0x2177('0x5e')](_0x572b6c,['id',_0x2177('0x5f'),_0x2177('0x60')]);_0x276cee[_0x2177('0x54')]=_[_0x2177('0x5e')](_0x276cee[_0x2177('0x54')],['id',_0x2177('0x5f'),'updatedAt']);return db['VoiceQueue'][_0x2177('0x53')](_[_0x2177('0x49')](_0x572b6c,_0x276cee['body']),{'include':_0x276cee[_0x2177('0x3d')][_0x2177('0x4b')]?[{'all':!![]}]:undefined})['then'](function(_0x5efadf){var _0x5dc5fd=_0x276cee[_0x2177('0x55')][_0x2177('0x5d')]({'plain':!![]});if(!_0x5dc5fd)throw new Error(_0x2177('0x56'));if(_0x5dc5fd[_0x2177('0x57')]==='user'){var _0x354f0f=_0x5efadf[_0x2177('0x5d')]({'plain':!![]});var _0x2f1d66=[{'name':_0x2177('0x2a'),'value':'inbound'},{'name':'QueueCampaigns','value':_0x2177('0x2c')}];var _0x536c06=_[_0x2177('0x32')](_0x2f1d66,[_0x2177('0x2f'),_0x354f0f[_0x2177('0x31')]])[_0x2177('0x33')];return db[_0x2177('0x58')][_0x2177('0x32')]({'where':{'name':_0x536c06,'userProfileId':_0x5dc5fd[_0x2177('0x59')]},'raw':!![]})[_0x2177('0x28')](function(_0x4150c7){if(_0x4150c7&&_0x4150c7['autoAssociation']===0x0){return db['UserProfileResource'][_0x2177('0x53')]({'name':_0x354f0f[_0x2177('0x33')],'resourceId':_0x354f0f['id'],'type':_0x4150c7['name'],'sectionId':_0x4150c7['id']},{})[_0x2177('0x28')](function(){return _0x5efadf;});}else{return _0x5efadf;}})['catch'](function(_0x3b14a5){logger[_0x2177('0x35')](_0x2177('0x5b'),_0x3b14a5);throw _0x3b14a5;});}return _0x5efadf;});}})[_0x2177('0x28')](respondWithResult(_0x5cd014,0xc9))[_0x2177('0x52')](handleError(_0x5cd014,null));};exports['update']=function(_0x2ab428,_0x43eb62){if(_0x2ab428[_0x2177('0x54')]['id']){delete _0x2ab428[_0x2177('0x54')]['id'];}return db[_0x2177('0x39')][_0x2177('0x32')]({'where':{'id':_0x2ab428[_0x2177('0x4f')]['id']}})[_0x2177('0x28')](handleEntityNotFound(_0x43eb62,null))[_0x2177('0x28')](saveUpdates(_0x2ab428[_0x2177('0x54')],null))['then'](respondWithResult(_0x43eb62,null))[_0x2177('0x52')](handleError(_0x43eb62,null));};exports['destroy']=function(_0x31b9d7,_0x551d66){return db[_0x2177('0x39')][_0x2177('0x32')]({'where':{'id':_0x31b9d7[_0x2177('0x4f')]['id']}})[_0x2177('0x28')](handleEntityNotFound(_0x551d66,null))[_0x2177('0x28')](removeEntity(_0x551d66,null))['catch'](handleError(_0x551d66,null));};exports['getHoppers']=function(_0xa9e45a,_0xd9436e,_0xc516aa){var _0x35c9d8={'raw':![],'where':{}};var _0x13a38a={};var _0x315d49={'count':0x0,'rows':[]};return db[_0x2177('0x39')][_0x2177('0x61')]({'where':{'id':_0xa9e45a[_0x2177('0x4f')]['id']}})[_0x2177('0x28')](handleEntityNotFound(_0xd9436e,null))[_0x2177('0x28')](function(_0x2c154c){if(_0x2c154c){_0x13a38a[_0x2177('0x3c')]=_[_0x2177('0x50')](db[_0x2177('0x62')]['rawAttributes']);_0x13a38a[_0x2177('0x3d')]=_[_0x2177('0x50')](_0xa9e45a[_0x2177('0x3d')]);_0x13a38a[_0x2177('0x46')]=_[_0x2177('0x3e')](_0x13a38a[_0x2177('0x3c')],_0x13a38a[_0x2177('0x3d')]);_0x35c9d8[_0x2177('0x3f')]=_[_0x2177('0x3e')](_0x13a38a[_0x2177('0x3c')],qs[_0x2177('0x40')](_0xa9e45a[_0x2177('0x3d')][_0x2177('0x40')]));_0x35c9d8[_0x2177('0x3f')]=_0x35c9d8[_0x2177('0x3f')]['length']?_0x35c9d8['attributes']:_0x13a38a[_0x2177('0x3c')];if(!_0xa9e45a['query']['hasOwnProperty']('nolimit')){_0x35c9d8['limit']=qs[_0x2177('0x21')](_0xa9e45a[_0x2177('0x3d')][_0x2177('0x21')]);_0x35c9d8[_0x2177('0x23')]=qs[_0x2177('0x23')](_0xa9e45a['query'][_0x2177('0x23')]);}_0x35c9d8[_0x2177('0x43')]=qs[_0x2177('0x44')](_0xa9e45a['query'][_0x2177('0x44')]);_0x35c9d8[_0x2177('0x47')]=qs[_0x2177('0x46')](_[_0x2177('0x45')](_0xa9e45a['query'],_0x13a38a[_0x2177('0x46')]));_0x35c9d8['where'][_0x2177('0x63')]=_0x2c154c['id'];if(_0xa9e45a[_0x2177('0x3d')]['filter']){_0x35c9d8['where']=_[_0x2177('0x49')](_0x35c9d8[_0x2177('0x47')],{'$or':_['map'](_0x35c9d8[_0x2177('0x3f')],function(_0x360b05){var _0x3600b9={};_0x3600b9[_0x360b05]={'$like':'%'+_0xa9e45a[_0x2177('0x3d')][_0x2177('0x2d')]+'%'};return _0x3600b9;})});}_0x35c9d8=_[_0x2177('0x49')]({},_0x35c9d8,_0xa9e45a[_0x2177('0x4a')]);return db[_0x2177('0x62')]['count']({'where':_0x35c9d8[_0x2177('0x47')]})['then'](function(_0x2346df){_0x315d49['count']=_0x2346df;if(_0xa9e45a[_0x2177('0x3d')]['includeAll']){_0x35c9d8[_0x2177('0x51')]=[{'all':!![]}];}return db[_0x2177('0x62')][_0x2177('0x4c')](_0x35c9d8);})[_0x2177('0x28')](function(_0xc111e3){_0x315d49[_0x2177('0x4d')]=_0xc111e3;return _0x315d49;});}})['then'](respondWithFilteredResult(_0xd9436e,_0x35c9d8))[_0x2177('0x52')](handleError(_0xd9436e,null));};exports[_0x2177('0x64')]=function(_0x4c946e,_0x4b62e2,_0x455f39){var _0x3ad384={'raw':!![],'where':{}};var _0x33467d={};var _0x3d3516={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x2177('0x61')]({'where':{'id':_0x4c946e[_0x2177('0x4f')]['id']}})[_0x2177('0x28')](handleEntityNotFound(_0x4b62e2,null))[_0x2177('0x28')](function(_0x5928ba){if(_0x5928ba){_0x33467d[_0x2177('0x3c')]=_[_0x2177('0x50')](db['CmHopperHistory'][_0x2177('0x3a')]);_0x33467d[_0x2177('0x3d')]=_[_0x2177('0x50')](_0x4c946e[_0x2177('0x3d')]);_0x33467d[_0x2177('0x46')]=_[_0x2177('0x3e')](_0x33467d[_0x2177('0x3c')],_0x33467d[_0x2177('0x3d')]);_0x3ad384[_0x2177('0x3f')]=_[_0x2177('0x3e')](_0x33467d[_0x2177('0x3c')],qs[_0x2177('0x40')](_0x4c946e[_0x2177('0x3d')][_0x2177('0x40')]));_0x3ad384[_0x2177('0x3f')]=_0x3ad384[_0x2177('0x3f')][_0x2177('0x41')]?_0x3ad384['attributes']:_0x33467d[_0x2177('0x3c')];if(!_0x4c946e[_0x2177('0x3d')]['hasOwnProperty'](_0x2177('0x42'))){_0x3ad384[_0x2177('0x21')]=qs[_0x2177('0x21')](_0x4c946e['query'][_0x2177('0x21')]);_0x3ad384[_0x2177('0x23')]=qs[_0x2177('0x23')](_0x4c946e[_0x2177('0x3d')][_0x2177('0x23')]);}_0x3ad384['order']=qs[_0x2177('0x44')](_0x4c946e[_0x2177('0x3d')][_0x2177('0x44')]);_0x3ad384[_0x2177('0x47')]=qs[_0x2177('0x46')](_[_0x2177('0x45')](_0x4c946e[_0x2177('0x3d')],_0x33467d['filters']));_0x3ad384[_0x2177('0x47')][_0x2177('0x63')]=_0x5928ba['id'];if(_0x4c946e[_0x2177('0x3d')]['filter']){_0x3ad384[_0x2177('0x47')]=_[_0x2177('0x49')](_0x3ad384[_0x2177('0x47')],{'$or':_[_0x2177('0x2e')](_0x3ad384[_0x2177('0x3f')],function(_0x450973){var _0x3d9dfb={};_0x3d9dfb[_0x450973]={'$like':'%'+_0x4c946e['query'][_0x2177('0x2d')]+'%'};return _0x3d9dfb;})});}_0x3ad384=_['merge']({},_0x3ad384,_0x4c946e[_0x2177('0x4a')]);return db[_0x2177('0x65')]['count']({'where':_0x3ad384[_0x2177('0x47')]})[_0x2177('0x28')](function(_0x35f9f8){_0x3d3516[_0x2177('0x22')]=_0x35f9f8;if(_0x4c946e[_0x2177('0x3d')][_0x2177('0x4b')]){_0x3ad384['include']=[{'all':!![]}];}return db[_0x2177('0x65')][_0x2177('0x4c')](_0x3ad384);})[_0x2177('0x28')](function(_0x160185){_0x3d3516[_0x2177('0x4d')]=_0x160185;return _0x3d3516;});}})[_0x2177('0x28')](respondWithFilteredResult(_0x4b62e2,_0x3ad384))[_0x2177('0x52')](handleError(_0x4b62e2,null));};exports[_0x2177('0x66')]=function(_0x39ec30,_0x2c4c84,_0x4f84ff){var _0x28d354={'raw':!![],'where':{}};var _0x3f7a5c={};var _0x4be293={'count':0x0,'rows':[]};return db[_0x2177('0x39')]['findOne']({'where':{'id':_0x39ec30[_0x2177('0x4f')]['id']}})[_0x2177('0x28')](handleEntityNotFound(_0x2c4c84,null))[_0x2177('0x28')](function(_0x26c279){if(_0x26c279){_0x3f7a5c[_0x2177('0x3c')]=_['keys'](db[_0x2177('0x67')][_0x2177('0x3a')]);_0x3f7a5c[_0x2177('0x3d')]=_['keys'](_0x39ec30[_0x2177('0x3d')]);_0x3f7a5c[_0x2177('0x46')]=_[_0x2177('0x3e')](_0x3f7a5c[_0x2177('0x3c')],_0x3f7a5c['query']);_0x28d354[_0x2177('0x3f')]=_[_0x2177('0x3e')](_0x3f7a5c[_0x2177('0x3c')],qs['fields'](_0x39ec30[_0x2177('0x3d')][_0x2177('0x40')]));_0x28d354[_0x2177('0x3f')]=_0x28d354[_0x2177('0x3f')][_0x2177('0x41')]?_0x28d354[_0x2177('0x3f')]:_0x3f7a5c[_0x2177('0x3c')];if(!_0x39ec30['query'][_0x2177('0x68')]('nolimit')){_0x28d354['limit']=qs[_0x2177('0x21')](_0x39ec30[_0x2177('0x3d')][_0x2177('0x21')]);_0x28d354[_0x2177('0x23')]=qs[_0x2177('0x23')](_0x39ec30[_0x2177('0x3d')][_0x2177('0x23')]);}_0x28d354[_0x2177('0x43')]=qs['sort'](_0x39ec30[_0x2177('0x3d')]['sort']);_0x28d354[_0x2177('0x47')]=qs[_0x2177('0x46')](_['pick'](_0x39ec30[_0x2177('0x3d')],_0x3f7a5c[_0x2177('0x46')]));_0x28d354[_0x2177('0x47')][_0x2177('0x63')]=_0x26c279['id'];if(_0x39ec30[_0x2177('0x3d')][_0x2177('0x2d')]){_0x28d354[_0x2177('0x47')]=_[_0x2177('0x49')](_0x28d354['where'],{'$or':_[_0x2177('0x2e')](_0x28d354['attributes'],function(_0x150230){var _0xddb1c3={};_0xddb1c3[_0x150230]={'$like':'%'+_0x39ec30[_0x2177('0x3d')][_0x2177('0x2d')]+'%'};return _0xddb1c3;})});}_0x28d354=_[_0x2177('0x49')]({},_0x28d354,_0x39ec30[_0x2177('0x4a')]);return db[_0x2177('0x67')][_0x2177('0x22')]({'where':_0x28d354[_0x2177('0x47')]})[_0x2177('0x28')](function(_0x420cab){_0x4be293[_0x2177('0x22')]=_0x420cab;if(_0x39ec30['query'][_0x2177('0x4b')]){_0x28d354[_0x2177('0x51')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x2177('0x4c')](_0x28d354);})[_0x2177('0x28')](function(_0x5ad63e){_0x4be293[_0x2177('0x4d')]=_0x5ad63e;return _0x4be293;});}})[_0x2177('0x28')](respondWithFilteredResult(_0x2c4c84,_0x28d354))['catch'](handleError(_0x2c4c84,null));};exports[_0x2177('0x69')]=function(_0x34dc4e,_0x2855bd,_0x4c559b){var _0x55ccce={'raw':!![],'where':{}};var _0x3bd1c9={};var _0x1b811d={'count':0x0,'rows':[]};return db[_0x2177('0x39')]['findOne']({'where':{'id':_0x34dc4e[_0x2177('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2855bd,null))['then'](function(_0x2c5d8a){if(_0x2c5d8a){_0x3bd1c9[_0x2177('0x3c')]=_['keys'](db['CmHopperBlack'][_0x2177('0x3a')]);_0x3bd1c9[_0x2177('0x3d')]=_[_0x2177('0x50')](_0x34dc4e[_0x2177('0x3d')]);_0x3bd1c9[_0x2177('0x46')]=_[_0x2177('0x3e')](_0x3bd1c9[_0x2177('0x3c')],_0x3bd1c9[_0x2177('0x3d')]);_0x55ccce[_0x2177('0x3f')]=_[_0x2177('0x3e')](_0x3bd1c9[_0x2177('0x3c')],qs[_0x2177('0x40')](_0x34dc4e[_0x2177('0x3d')][_0x2177('0x40')]));_0x55ccce['attributes']=_0x55ccce[_0x2177('0x3f')][_0x2177('0x41')]?_0x55ccce[_0x2177('0x3f')]:_0x3bd1c9[_0x2177('0x3c')];if(!_0x34dc4e[_0x2177('0x3d')][_0x2177('0x68')](_0x2177('0x42'))){_0x55ccce['limit']=qs[_0x2177('0x21')](_0x34dc4e['query'][_0x2177('0x21')]);_0x55ccce['offset']=qs[_0x2177('0x23')](_0x34dc4e['query'][_0x2177('0x23')]);}_0x55ccce[_0x2177('0x43')]=qs['sort'](_0x34dc4e[_0x2177('0x3d')][_0x2177('0x44')]);_0x55ccce[_0x2177('0x47')]=qs[_0x2177('0x46')](_[_0x2177('0x45')](_0x34dc4e[_0x2177('0x3d')],_0x3bd1c9[_0x2177('0x46')]));_0x55ccce[_0x2177('0x47')][_0x2177('0x63')]=_0x2c5d8a['id'];if(_0x34dc4e[_0x2177('0x3d')][_0x2177('0x2d')]){_0x55ccce[_0x2177('0x47')]=_['merge'](_0x55ccce[_0x2177('0x47')],{'$or':_['map'](_0x55ccce[_0x2177('0x3f')],function(_0x2b1317){var _0x51a909={};_0x51a909[_0x2b1317]={'$like':'%'+_0x34dc4e[_0x2177('0x3d')][_0x2177('0x2d')]+'%'};return _0x51a909;})});}_0x55ccce=_[_0x2177('0x49')]({},_0x55ccce,_0x34dc4e[_0x2177('0x4a')]);return db[_0x2177('0x6a')][_0x2177('0x22')]({'where':_0x55ccce[_0x2177('0x47')]})[_0x2177('0x28')](function(_0x201ec2){_0x1b811d['count']=_0x201ec2;if(_0x34dc4e['query']['includeAll']){_0x55ccce[_0x2177('0x51')]=[{'all':!![]}];}return db[_0x2177('0x6a')][_0x2177('0x4c')](_0x55ccce);})['then'](function(_0xcc5b47){_0x1b811d[_0x2177('0x4d')]=_0xcc5b47;return _0x1b811d;});}})[_0x2177('0x28')](respondWithFilteredResult(_0x2855bd,_0x55ccce))[_0x2177('0x52')](handleError(_0x2855bd,null));};exports[_0x2177('0x6b')]=function(_0x432123,_0x3d14ed,_0x502cca){var _0x16ed21={};var _0x4a3728={};var _0x3556e1;var _0x950d4;return db[_0x2177('0x39')][_0x2177('0x61')]({'where':{'id':_0x432123[_0x2177('0x4f')]['id']}})[_0x2177('0x28')](handleEntityNotFound(_0x3d14ed,null))[_0x2177('0x28')](function(_0x943d0b){if(_0x943d0b){_0x3556e1=_0x943d0b;_0x4a3728[_0x2177('0x3c')]=_['keys'](db[_0x2177('0x6c')][_0x2177('0x3a')]);_0x4a3728['query']=_[_0x2177('0x50')](_0x432123['query']);_0x4a3728[_0x2177('0x46')]=_['intersection'](_0x4a3728['model'],_0x4a3728[_0x2177('0x3d')]);_0x16ed21[_0x2177('0x3f')]=_['intersection'](_0x4a3728[_0x2177('0x3c')],qs['fields'](_0x432123['query'][_0x2177('0x40')]));_0x16ed21['attributes']=_0x16ed21[_0x2177('0x3f')][_0x2177('0x41')]?_0x16ed21[_0x2177('0x3f')]:_0x4a3728[_0x2177('0x3c')];_0x16ed21[_0x2177('0x43')]=qs[_0x2177('0x44')](_0x432123[_0x2177('0x3d')][_0x2177('0x44')]);_0x16ed21['where']=qs[_0x2177('0x46')](_[_0x2177('0x45')](_0x432123[_0x2177('0x3d')],_0x4a3728[_0x2177('0x46')]));if(_0x432123['query'][_0x2177('0x2d')]){_0x16ed21[_0x2177('0x47')]=_[_0x2177('0x49')](_0x16ed21['where'],{'$or':_['map'](_0x16ed21[_0x2177('0x3f')],function(_0x58a765){var _0x5279cf={};_0x5279cf[_0x58a765]={'$like':'%'+_0x432123['query'][_0x2177('0x2d')]+'%'};return _0x5279cf;})});}_0x16ed21=_[_0x2177('0x49')]({},_0x16ed21,_0x432123[_0x2177('0x4a')]);return _0x3556e1[_0x2177('0x6b')](_0x16ed21);}})['then'](function(_0x2fd33b){if(_0x2fd33b){_0x950d4=_0x2fd33b[_0x2177('0x41')];if(!_0x432123[_0x2177('0x3d')]['hasOwnProperty']('nolimit')){_0x16ed21['limit']=qs[_0x2177('0x21')](_0x432123['query'][_0x2177('0x21')]);_0x16ed21[_0x2177('0x23')]=qs[_0x2177('0x23')](_0x432123[_0x2177('0x3d')][_0x2177('0x23')]);}return _0x3556e1[_0x2177('0x6b')](_0x16ed21);}})[_0x2177('0x28')](function(_0x6ed502){if(_0x6ed502){return _0x6ed502?{'count':_0x950d4,'rows':_0x6ed502}:null;}})['then'](respondWithResult(_0x3d14ed,null))[_0x2177('0x52')](handleError(_0x3d14ed,null));};exports[_0x2177('0x6d')]=function(_0x4b6bd4,_0x4c0cd3,_0x22ac9d){var _0x67201e=_0x4b6bd4[_0x2177('0x54')]['teams'];var _0x5e28ea=_['map'](_0x67201e,'id');return db[_0x2177('0x6c')]['findAll']({'where':{'id':_0x5e28ea},'attributes':['id'],'include':[{'model':db[_0x2177('0x6e')],'as':_0x2177('0x6f'),'attributes':['id',_0x2177('0x33'),_0x2177('0x70'),_0x2177('0x71'),'interface'],'raw':!![]}]})[_0x2177('0x28')](function(_0x46d953){if(_0x46d953){var _0x3c2be6=_[_0x2177('0x72')](_0x46d953,function(_0x529bf9){var _0x309871=_0x529bf9[_0x2177('0x5d')]({'plain':!![]});_0x309871['Agents']['forEach'](function(_0x7456ca){_0x7456ca[_0x2177('0x73')]=_[_0x2177('0x32')](_0x67201e,{'id':_0x309871['id']})[_0x2177('0x73')];});return _0x309871[_0x2177('0x6f')];});return db[_0x2177('0x39')][_0x2177('0x32')]({'where':{'id':_0x4b6bd4['params']['id']}})[_0x2177('0x28')](function(_0x240e4d){return db[_0x2177('0x74')]['transaction'](function(_0x204871){return _0x240e4d[_0x2177('0x6d')](_0x5e28ea,{'transaction':_0x204871})['then'](function(){return BPromise[_0x2177('0x75')](_0x67201e,function(_0x380929){return db['TeamVoiceQueue'][_0x2177('0x76')]({'TeamId':_0x380929['id'],'VoiceQueueId':_0x4b6bd4['params']['id'],'penalty':_0x380929[_0x2177('0x73')]},{'transaction':_0x204871});});})[_0x2177('0x28')](function(){return BPromise[_0x2177('0x75')](_0x3c2be6,function(_0x269314){return db[_0x2177('0x77')][_0x2177('0x78')]({'where':{'UserId':_0x269314['id'],'VoiceQueueId':_0x4b6bd4[_0x2177('0x4f')]['id']},'defaults':{'penalty':_0x269314[_0x2177('0x73')]},'transaction':_0x204871});});})['then'](function(){return BPromise['each'](_[_0x2177('0x2d')](_0x3c2be6,{'online':!![]}),function(_0x35d378){return db[_0x2177('0x79')][_0x2177('0x76')]({'membername':_0x35d378['name'],'UserId':_0x35d378['id'],'queue_name':_0x240e4d['name'],'VoiceQueueId':_0x240e4d['id'],'interface':_[_0x2177('0x7a')](_0x35d378['interface'])?util[_0x2177('0x7b')](_0x2177('0x7c'),_0x35d378['name']):_0x35d378[_0x2177('0x7d')],'paused':_0x35d378[_0x2177('0x71')]||![],'penalty':_0x35d378[_0x2177('0x73')]},{'transaction':_0x204871});});})['then'](function(){_0x3c2be6['forEach'](function(_0x491921){socket[_0x2177('0x7e')]('userVoiceQueue:save',{'UserId':_0x491921['id'],'VoiceQueueId':_0x240e4d['id']});});});});});}})[_0x2177('0x28')](respondWithStatusCode(_0x4c0cd3,null))[_0x2177('0x52')](handleError(_0x4c0cd3,null));};exports[_0x2177('0x7f')]=function(_0x14d0dd,_0x4a24e5,_0x429563){return db[_0x2177('0x6c')]['findAll']({'where':{'id':_0x14d0dd[_0x2177('0x3d')][_0x2177('0x80')]},'attributes':['id'],'include':[{'model':db[_0x2177('0x6e')],'as':_0x2177('0x6f'),'attributes':['id'],'raw':!![]}]})[_0x2177('0x28')](handleEntityNotFound(_0x4a24e5,null))[_0x2177('0x28')](function(_0x132fde){var _0x53112b=_[_0x2177('0x2e')](_0x132fde,'id');var _0x279a0c=[];var _0x1c12a9=[];var _0x30bb0b=squel[_0x2177('0x81')]();_0x30bb0b['field'](_0x2177('0x82'))['from'](_0x2177('0x83'),'tq')[_0x2177('0x84')](_0x2177('0x85'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x2177('0x47')](_0x2177('0x86'),_0x14d0dd[_0x2177('0x4f')]['id']);for(var _0x3bb28d=0x0;_0x3bb28d<_0x132fde[_0x2177('0x41')];_0x3bb28d+=0x1){let _0x317bf3=_0x132fde[_0x3bb28d];for(var _0x1da3a0=0x0;_0x1da3a0<_0x317bf3[_0x2177('0x6f')][_0x2177('0x41')];_0x1da3a0+=0x1){let _0x8d5f0c=_0x317bf3['Agents'][_0x1da3a0];var _0x1d6d0c=_0x30bb0b[_0x2177('0x5c')]();_0x1d6d0c[_0x2177('0x47')]('ut.UserId\x20=\x20?',_0x8d5f0c['id']);_0x1c12a9['push'](db['sequelize'][_0x2177('0x3d')](_0x1d6d0c[_0x2177('0x87')](),{'type':db[_0x2177('0x74')]['QueryTypes']['SELECT']})[_0x2177('0x28')](function(_0x1c4a4d){if(_0x1c4a4d[_0x2177('0x41')]===0x1){return _0x8d5f0c['id'];}else{var _0x36f6a1=_[_0x2177('0x88')](_[_0x2177('0x2e')](_0x1c4a4d,_0x2177('0x89')),function(_0x576ebf){return _['includes'](_0x53112b,_0x576ebf);});if(_0x36f6a1){return _0x8d5f0c['id'];}}}));}}return BPromise['all'](_0x1c12a9)[_0x2177('0x28')](function(_0x439b84){_0x279a0c=_(_0x279a0c)['union'](_0x439b84)[_0x2177('0x8a')]()[_0x2177('0x2f')]();return db[_0x2177('0x39')][_0x2177('0x32')]({'where':{'id':_0x14d0dd[_0x2177('0x4f')]['id']}})[_0x2177('0x28')](function(_0x49a186){return db[_0x2177('0x74')]['transaction'](function(_0x224965){return _0x49a186[_0x2177('0x7f')](_0x14d0dd['query'][_0x2177('0x80')],{'transaction':_0x224965})[_0x2177('0x28')](function(){if(!_[_0x2177('0x8b')](_0x279a0c)){return _0x49a186['removeAgents'](_0x279a0c,{'transaction':_0x224965})[_0x2177('0x28')](function(){return db[_0x2177('0x79')]['destroy']({'where':{'VoiceQueueId':_0x14d0dd['params']['id'],'UserId':_0x279a0c},'transaction':_0x224965});});}})[_0x2177('0x28')](function(){_0x279a0c[_0x2177('0x8c')](function(_0x38be99){socket[_0x2177('0x7e')]('userVoiceQueue:remove',{'UserId':_0x38be99,'VoiceQueueId':_0x49a186['id']});});});});});});})[_0x2177('0x28')](respondWithStatusCode(_0x4a24e5,null))[_0x2177('0x52')](handleError(_0x4a24e5,null));};exports[_0x2177('0x8d')]=function(_0x57e05a,_0x2ff22f,_0x5e1539){var _0x5a095b,_0x32d84d;return db[_0x2177('0x39')][_0x2177('0x32')]({'where':{'id':_0x57e05a[_0x2177('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2ff22f,null))[_0x2177('0x28')](function(_0x1b3d3a){if(_0x1b3d3a){_0x32d84d=_0x1b3d3a;return _0x1b3d3a[_0x2177('0x8d')](_0x57e05a[_0x2177('0x54')][_0x2177('0x80')],_[_0x2177('0x5e')](_0x57e05a[_0x2177('0x54')],['ids','id'])||{})[_0x2177('0x8e')](function(_0x12c09d){for(var _0xe9ed7f=0x0;_0xe9ed7f<_0x57e05a[_0x2177('0x54')][_0x2177('0x80')]['length'];_0xe9ed7f+=0x1){socket[_0x2177('0x7e')]('userVoiceQueue:save',{'UserId':Number(_0x57e05a[_0x2177('0x54')][_0x2177('0x80')][_0xe9ed7f]),'VoiceQueueId':Number(_0x57e05a['params']['id'])});}return _0x12c09d;});}})['then'](function(_0x2a8c7d){_0x5a095b=_0x2a8c7d||[];if(_0x32d84d){return db['User'][_0x2177('0x4c')]({'where':{'id':_0x57e05a[_0x2177('0x54')]['ids']},'attributes':['id',_0x2177('0x33'),'online',_0x2177('0x71'),'interface'],'raw':!![]});}})[_0x2177('0x28')](function(_0x261b78){if(!_[_0x2177('0x8b')](_0x261b78)){var _0x340b33=[];for(var _0x1a1d15=0x0;_0x1a1d15<_0x261b78[_0x2177('0x41')];_0x1a1d15++){if(_0x261b78[_0x1a1d15][_0x2177('0x70')]){_0x340b33['push'](db[_0x2177('0x79')][_0x2177('0x76')]({'membername':_0x261b78[_0x1a1d15][_0x2177('0x33')],'UserId':_0x261b78[_0x1a1d15]['id'],'queue_name':_0x32d84d['name'],'VoiceQueueId':_0x32d84d['id'],'interface':_[_0x2177('0x7a')](_0x261b78[_0x1a1d15][_0x2177('0x7d')])?util[_0x2177('0x7b')](_0x2177('0x7c'),_0x261b78[_0x1a1d15][_0x2177('0x33')]):_0x261b78[_0x1a1d15]['interface'],'paused':_0x261b78[_0x1a1d15][_0x2177('0x71')]||![],'penalty':_0x57e05a['body'][_0x2177('0x73')]||0x0}));}}return BPromise['all'](_0x340b33);}})[_0x2177('0x28')](function(){return _0x5a095b;})[_0x2177('0x28')](respondWithResult(_0x2ff22f,null))[_0x2177('0x52')](handleError(_0x2ff22f,null));};exports['removeAgents']=function(_0x1c696a,_0x42ad44,_0x86291a){return db['VoiceQueue'][_0x2177('0x32')]({'where':{'id':_0x1c696a[_0x2177('0x4f')]['id']}})[_0x2177('0x28')](handleEntityNotFound(_0x42ad44,null))[_0x2177('0x28')](function(_0x130cad){if(_0x130cad){return _0x130cad[_0x2177('0x8f')](_0x1c696a[_0x2177('0x3d')][_0x2177('0x80')])['then'](function(){if(_[_0x2177('0x90')](_0x1c696a[_0x2177('0x3d')]['ids'])){for(var _0x45d8d8=0x0;_0x45d8d8<_0x1c696a[_0x2177('0x3d')][_0x2177('0x80')][_0x2177('0x41')];_0x45d8d8+=0x1){socket[_0x2177('0x7e')](_0x2177('0x91'),{'UserId':Number(_0x1c696a[_0x2177('0x3d')]['ids'][_0x45d8d8]),'VoiceQueueId':Number(_0x1c696a[_0x2177('0x4f')]['id'])});}}else{socket[_0x2177('0x7e')]('userVoiceQueue:remove',{'UserId':Number(_0x1c696a[_0x2177('0x3d')][_0x2177('0x80')]),'VoiceQueueId':Number(_0x1c696a['params']['id'])});}});}})[_0x2177('0x28')](function(_0x53a78b){return db[_0x2177('0x79')][_0x2177('0x29')]({'where':{'VoiceQueueId':_0x1c696a[_0x2177('0x4f')]['id'],'UserId':_0x1c696a[_0x2177('0x3d')][_0x2177('0x80')]}})[_0x2177('0x28')](function(){return _0x53a78b;});})[_0x2177('0x28')](respondWithStatusCode(_0x42ad44,null))[_0x2177('0x52')](handleError(_0x42ad44,null));};exports[_0x2177('0x92')]=function(_0x31ea8d,_0x15c7eb,_0x5cc489){var _0x38ed57={};var _0x585710={};var _0xce7fe9;var _0x1a103a;return db[_0x2177('0x39')][_0x2177('0x61')]({'where':{'id':_0x31ea8d[_0x2177('0x4f')]['id']}})[_0x2177('0x28')](handleEntityNotFound(_0x15c7eb,null))['then'](function(_0x393963){if(_0x393963){_0xce7fe9=_0x393963;_0x585710[_0x2177('0x3c')]=_[_0x2177('0x50')](db[_0x2177('0x6e')][_0x2177('0x3a')]);_0x585710[_0x2177('0x3d')]=_[_0x2177('0x50')](_0x31ea8d[_0x2177('0x3d')]);_0x585710[_0x2177('0x46')]=_[_0x2177('0x3e')](_0x585710[_0x2177('0x3c')],_0x585710['query']);_0x38ed57[_0x2177('0x3f')]=_['intersection'](_0x585710[_0x2177('0x3c')],qs[_0x2177('0x40')](_0x31ea8d[_0x2177('0x3d')]['fields']));_0x38ed57['attributes']=_0x38ed57[_0x2177('0x3f')]['length']?_0x38ed57[_0x2177('0x3f')]:_0x585710['model'];_0x38ed57[_0x2177('0x43')]=qs['sort'](_0x31ea8d[_0x2177('0x3d')][_0x2177('0x44')]);_0x38ed57['where']=qs['filters'](_[_0x2177('0x45')](_0x31ea8d[_0x2177('0x3d')],_0x585710[_0x2177('0x46')]));if(_0x31ea8d[_0x2177('0x3d')][_0x2177('0x2d')]){_0x38ed57[_0x2177('0x47')]=_[_0x2177('0x49')](_0x38ed57['where'],{'$or':_[_0x2177('0x2e')](_0x38ed57[_0x2177('0x3f')],function(_0x542729){var _0x35023c={};_0x35023c[_0x542729]={'$like':'%'+_0x31ea8d[_0x2177('0x3d')][_0x2177('0x2d')]+'%'};return _0x35023c;})});}_0x38ed57=_[_0x2177('0x49')]({},_0x38ed57,_0x31ea8d[_0x2177('0x4a')]);return _0xce7fe9[_0x2177('0x92')](_0x38ed57);}})['then'](function(_0x4e9903){if(_0x4e9903){_0x1a103a=_0x4e9903[_0x2177('0x41')];if(!_0x31ea8d[_0x2177('0x3d')][_0x2177('0x68')](_0x2177('0x42'))){_0x38ed57[_0x2177('0x21')]=qs[_0x2177('0x21')](_0x31ea8d[_0x2177('0x3d')][_0x2177('0x21')]);_0x38ed57[_0x2177('0x23')]=qs['offset'](_0x31ea8d['query']['offset']);}return _0xce7fe9[_0x2177('0x92')](_0x38ed57);}})[_0x2177('0x28')](function(_0x18f78d){if(_0x18f78d){return _0x18f78d?{'count':_0x1a103a,'rows':_0x18f78d}:null;}})[_0x2177('0x28')](respondWithResult(_0x15c7eb,null))[_0x2177('0x52')](handleError(_0x15c7eb,null));};exports['getMembers']=function(_0x5b16b8,_0x5b61b7,_0x10cddf){var _0x4fcb76={};var _0x5e8a92={};var _0x2177b9;var _0x4b39a0;return db['VoiceQueue'][_0x2177('0x61')]({'where':{'id':_0x5b16b8[_0x2177('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5b61b7,null))[_0x2177('0x28')](function(_0x107f1b){if(_0x107f1b){_0x2177b9=_0x107f1b;_0x5e8a92['model']=_[_0x2177('0x50')](db[_0x2177('0x79')][_0x2177('0x3a')]);_0x5e8a92[_0x2177('0x3d')]=_[_0x2177('0x50')](_0x5b16b8[_0x2177('0x3d')]);_0x5e8a92['filters']=_[_0x2177('0x3e')](_0x5e8a92[_0x2177('0x3c')],_0x5e8a92[_0x2177('0x3d')]);_0x4fcb76[_0x2177('0x3f')]=_['intersection'](_0x5e8a92['model'],qs[_0x2177('0x40')](_0x5b16b8['query'][_0x2177('0x40')]));_0x4fcb76[_0x2177('0x3f')]=_0x4fcb76[_0x2177('0x3f')][_0x2177('0x41')]?_0x4fcb76[_0x2177('0x3f')]:_0x5e8a92['model'];_0x4fcb76['order']=qs[_0x2177('0x44')](_0x5b16b8[_0x2177('0x3d')]['sort']);_0x4fcb76[_0x2177('0x47')]=qs[_0x2177('0x46')](_[_0x2177('0x45')](_0x5b16b8[_0x2177('0x3d')],_0x5e8a92[_0x2177('0x46')]));if(_0x5b16b8[_0x2177('0x3d')][_0x2177('0x2d')]){_0x4fcb76[_0x2177('0x47')]=_['merge'](_0x4fcb76[_0x2177('0x47')],{'$or':_[_0x2177('0x2e')](_0x4fcb76['attributes'],function(_0x2b22e2){var _0x902291={};_0x902291[_0x2b22e2]={'$like':'%'+_0x5b16b8[_0x2177('0x3d')]['filter']+'%'};return _0x902291;})});}_0x4fcb76=_[_0x2177('0x49')]({},_0x4fcb76,_0x5b16b8[_0x2177('0x4a')]);return _0x2177b9[_0x2177('0x93')](_0x4fcb76);}})[_0x2177('0x28')](function(_0x579ea4){if(_0x579ea4){_0x4b39a0=_0x579ea4[_0x2177('0x41')];if(!_0x5b16b8['query'][_0x2177('0x68')](_0x2177('0x42'))){_0x4fcb76[_0x2177('0x21')]=qs[_0x2177('0x21')](_0x5b16b8['query'][_0x2177('0x21')]);_0x4fcb76[_0x2177('0x23')]=qs['offset'](_0x5b16b8[_0x2177('0x3d')][_0x2177('0x23')]);}return _0x2177b9[_0x2177('0x93')](_0x4fcb76);}})[_0x2177('0x28')](function(_0xc17c18){return _0xc17c18?{'count':_0x4b39a0,'rows':_0xc17c18}:null;})[_0x2177('0x28')](respondWithResult(_0x5b61b7,null))[_0x2177('0x52')](handleError(_0x5b61b7,null));};exports[_0x2177('0x94')]=function(_0xc14368,_0x4ca910,_0x554994){var _0x5bce88={};var _0xb58049={};var _0x20607a;var _0x1e4ad3;return db[_0x2177('0x39')][_0x2177('0x61')]({'where':{'id':_0xc14368[_0x2177('0x4f')]['id']}})[_0x2177('0x28')](handleEntityNotFound(_0x4ca910,null))[_0x2177('0x28')](function(_0x34dded){if(_0x34dded){_0x20607a=_0x34dded;_0xb58049['model']=_[_0x2177('0x50')](db[_0x2177('0x95')][_0x2177('0x3a')]);_0xb58049['query']=_[_0x2177('0x50')](_0xc14368[_0x2177('0x3d')]);_0xb58049[_0x2177('0x46')]=_[_0x2177('0x3e')](_0xb58049['model'],_0xb58049['query']);_0x5bce88[_0x2177('0x3f')]=_[_0x2177('0x3e')](_0xb58049[_0x2177('0x3c')],qs[_0x2177('0x40')](_0xc14368['query'][_0x2177('0x40')]));_0x5bce88['attributes']=_0x5bce88[_0x2177('0x3f')][_0x2177('0x41')]?_0x5bce88[_0x2177('0x3f')]:_0xb58049[_0x2177('0x3c')];_0x5bce88['order']=qs[_0x2177('0x44')](_0xc14368[_0x2177('0x3d')][_0x2177('0x44')]);_0x5bce88[_0x2177('0x47')]=qs[_0x2177('0x46')](_[_0x2177('0x45')](_0xc14368[_0x2177('0x3d')],_0xb58049[_0x2177('0x46')]));if(_0xc14368[_0x2177('0x3d')][_0x2177('0x2d')]){_0x5bce88[_0x2177('0x47')]=_['merge'](_0x5bce88['where'],{'$or':_[_0x2177('0x2e')](_0x5bce88[_0x2177('0x3f')],function(_0x477f95){var _0x517a1e={};_0x517a1e[_0x477f95]={'$like':'%'+_0xc14368['query'][_0x2177('0x2d')]+'%'};return _0x517a1e;})});}_0x5bce88=_[_0x2177('0x49')]({},_0x5bce88,_0xc14368[_0x2177('0x4a')]);return _0x20607a[_0x2177('0x94')](_0x5bce88);}})['then'](function(_0x245d94){if(_0x245d94){_0x1e4ad3=_0x245d94['length'];if(!_0xc14368[_0x2177('0x3d')]['hasOwnProperty'](_0x2177('0x42'))){_0x5bce88[_0x2177('0x21')]=qs[_0x2177('0x21')](_0xc14368[_0x2177('0x3d')][_0x2177('0x21')]);_0x5bce88[_0x2177('0x23')]=qs['offset'](_0xc14368[_0x2177('0x3d')][_0x2177('0x23')]);}return _0x20607a[_0x2177('0x94')](_0x5bce88);}})[_0x2177('0x28')](function(_0x12fc17){if(_0x12fc17){return _0x12fc17?{'count':_0x1e4ad3,'rows':_0x12fc17}:null;}})[_0x2177('0x28')](respondWithResult(_0x4ca910,null))[_0x2177('0x52')](handleError(_0x4ca910,null));};exports[_0x2177('0x96')]=function(_0x21998b,_0x334fd8,_0x187b09){var _0x3e014d,_0x25c42e;return db[_0x2177('0x39')]['find']({'where':{'id':_0x21998b[_0x2177('0x4f')]['id']}})[_0x2177('0x28')](handleEntityNotFound(_0x334fd8,null))['then'](function(_0x4380ee){if(_0x4380ee){_0x25c42e=_0x4380ee;return _0x4380ee['addLists'](_0x21998b[_0x2177('0x54')][_0x2177('0x80')],_['omit'](_0x21998b['body'],[_0x2177('0x80'),'id'])||{});}return null;})[_0x2177('0x8e')](function(_0x2d62e0){var _0x51754f;_0x3e014d=_0x2d62e0||[];var _0x26da78=[];if(_0x2d62e0){for(var _0x4cfba0=0x0;_0x4cfba0<_0x2d62e0[_0x2177('0x41')];_0x4cfba0+=0x1){var _0x5b0dd0=_0x2d62e0[_0x4cfba0][_0x2177('0x5d')]({'plain':!![]});_0x25c42e['dialCheckDuplicateType']=_0x21998b['body'][_0x2177('0x97')]?_0x21998b['body'][_0x2177('0x97')]:_0x25c42e[_0x2177('0x97')];switch(_0x25c42e['dialCheckDuplicateType']){case _0x2177('0x98'):_0x51754f=squel[_0x2177('0x99')]()[_0x2177('0x9a')](_0x2177('0x9b'))[_0x2177('0x9c')](['phone',_0x2177('0x9d'),_0x2177('0x9e'),_0x2177('0x9f'),'VoiceQueueId',_0x2177('0x5f'),_0x2177('0x60')],squel[_0x2177('0x81')]()[_0x2177('0xa0')]('phone',_0x2177('0xa1'))['field']('NOW()',_0x2177('0x9d'))[_0x2177('0xa0')]('id',_0x2177('0x9e'))[_0x2177('0xa0')](_0x5b0dd0[_0x2177('0xa2')][_0x2177('0x87')](),_0x2177('0x9f'))[_0x2177('0xa0')](_0x21998b['params']['id'][_0x2177('0x87')](),_0x2177('0x63'))[_0x2177('0xa0')](_0x2177('0xa3'),_0x2177('0x5f'))['field'](_0x2177('0xa3'),_0x2177('0x60'))[_0x2177('0xa4')](_0x2177('0xa5'))['where'](_0x2177('0xa6'))[_0x2177('0x47')](_0x2177('0xa7'),_0x5b0dd0[_0x2177('0xa2')][_0x2177('0x87')]())[_0x2177('0x47')](_0x2177('0xa8'))[_0x2177('0x47')](_0x2177('0xa9'),squel[_0x2177('0x81')]()[_0x2177('0xa0')]('COALESCE(calleridnum,\x27\x27)')['from']('cm_hopper_final')['where'](_0x2177('0x86'),_0x21998b[_0x2177('0x4f')]['id'][_0x2177('0x87')]()))[_0x2177('0x47')](_0x2177('0xa9'),squel['select']()[_0x2177('0xa0')](_0x2177('0xaa'))[_0x2177('0xa4')](_0x2177('0x9b'))[_0x2177('0x47')](_0x2177('0x86'),_0x21998b['params']['id']['toString']())))[_0x2177('0x87')]();break;case _0x2177('0xab'):_0x51754f=squel[_0x2177('0x99')]()[_0x2177('0x9a')](_0x2177('0x9b'))[_0x2177('0x9c')](['phone',_0x2177('0x9d'),_0x2177('0x9e'),_0x2177('0x9f'),_0x2177('0x63'),_0x2177('0x5f'),_0x2177('0x60')],squel['select']()['field']('phone',_0x2177('0xa1'))[_0x2177('0xa0')]('NOW()',_0x2177('0x9d'))[_0x2177('0xa0')]('id',_0x2177('0x9e'))['field'](_0x5b0dd0[_0x2177('0xa2')][_0x2177('0x87')](),_0x2177('0x9f'))[_0x2177('0xa0')](_0x21998b[_0x2177('0x4f')]['id']['toString'](),_0x2177('0x63'))['field'](_0x2177('0xa3'),_0x2177('0x5f'))[_0x2177('0xa0')](_0x2177('0xa3'),'updatedAt')['from']('cm_contacts')[_0x2177('0x47')](_0x2177('0xa6'))[_0x2177('0x47')](_0x2177('0xa7'),_0x5b0dd0[_0x2177('0xa2')][_0x2177('0x87')]())[_0x2177('0x47')](_0x2177('0xa8'))[_0x2177('0x47')](_0x2177('0xa9'),squel['select']()[_0x2177('0xa0')](_0x2177('0xaa'))[_0x2177('0xa4')]('cm_hopper')['where'](_0x2177('0x86'),_0x21998b[_0x2177('0x4f')]['id'][_0x2177('0x87')]())))[_0x2177('0x87')]();break;default:_0x51754f=squel['insert']()[_0x2177('0x9a')](_0x2177('0x9b'))[_0x2177('0x9c')]([_0x2177('0xa1'),'scheduledAt','ContactId',_0x2177('0x9f'),_0x2177('0x63'),_0x2177('0x5f'),_0x2177('0x60')],squel[_0x2177('0x81')]()['field'](_0x2177('0xa1'),'phone')['field'](_0x2177('0xa3'),'scheduledAt')['field']('id','ContactId')['field'](_0x5b0dd0[_0x2177('0xa2')][_0x2177('0x87')](),_0x2177('0x9f'))['field'](_0x21998b[_0x2177('0x4f')]['id'][_0x2177('0x87')](),_0x2177('0x63'))['field'](_0x2177('0xa3'),_0x2177('0x5f'))[_0x2177('0xa0')](_0x2177('0xa3'),_0x2177('0x60'))[_0x2177('0xa4')](_0x2177('0xa5'))[_0x2177('0x47')](_0x2177('0xa6'))['where'](_0x2177('0xa7'),_0x5b0dd0[_0x2177('0xa2')][_0x2177('0x87')]())[_0x2177('0x47')](_0x2177('0xa8')))['toString']();}_0x26da78[_0x2177('0xac')](db['sequelize'][_0x2177('0x3d')](_0x51754f));}return BPromise[_0x2177('0xad')](_0x26da78);}})['then'](function(){return _0x3e014d;})[_0x2177('0x28')](respondWithResult(_0x334fd8,null))['catch'](handleError(_0x334fd8,null));};exports[_0x2177('0xae')]=function(_0x3d9dcd,_0x2833ca,_0x1c2afa){return db['VoiceQueue'][_0x2177('0x32')]({'where':{'id':_0x3d9dcd[_0x2177('0x4f')]['id']}})[_0x2177('0x28')](handleEntityNotFound(_0x2833ca,null))[_0x2177('0x28')](function(_0x110f03){if(_0x110f03){return _0x110f03[_0x2177('0xae')](_0x3d9dcd[_0x2177('0x3d')][_0x2177('0x80')]);}})[_0x2177('0x28')](function(_0x277780){if(_0x277780){return db[_0x2177('0x62')][_0x2177('0x29')]({'where':{'ListId':_0x3d9dcd[_0x2177('0x3d')][_0x2177('0x80')],'VoiceQueueId':_0x3d9dcd[_0x2177('0x4f')]['id']}})[_0x2177('0x28')](function(){return _0x277780;});}})[_0x2177('0x28')](respondWithStatusCode(_0x2833ca,null))['catch'](handleError(_0x2833ca,null));};exports[_0x2177('0xaf')]=function(_0x33b2e2,_0x21b92a,_0x10ba67){var _0x54d100={};var _0x2497a6={};var _0x1c55b6;var _0x1431f9;return db['VoiceQueue'][_0x2177('0x61')]({'where':{'id':_0x33b2e2[_0x2177('0x4f')]['id']}})[_0x2177('0x28')](handleEntityNotFound(_0x21b92a,null))[_0x2177('0x28')](function(_0x5bdc94){if(_0x5bdc94){_0x1c55b6=_0x5bdc94;_0x2497a6[_0x2177('0x3c')]=_[_0x2177('0x50')](db[_0x2177('0x95')]['rawAttributes']);_0x2497a6[_0x2177('0x3d')]=_[_0x2177('0x50')](_0x33b2e2[_0x2177('0x3d')]);_0x2497a6[_0x2177('0x46')]=_['intersection'](_0x2497a6[_0x2177('0x3c')],_0x2497a6[_0x2177('0x3d')]);_0x54d100[_0x2177('0x3f')]=_['intersection'](_0x2497a6['model'],qs[_0x2177('0x40')](_0x33b2e2[_0x2177('0x3d')]['fields']));_0x54d100['attributes']=_0x54d100['attributes'][_0x2177('0x41')]?_0x54d100[_0x2177('0x3f')]:_0x2497a6[_0x2177('0x3c')];_0x54d100[_0x2177('0x43')]=qs['sort'](_0x33b2e2[_0x2177('0x3d')][_0x2177('0x44')]);_0x54d100[_0x2177('0x47')]=qs[_0x2177('0x46')](_[_0x2177('0x45')](_0x33b2e2[_0x2177('0x3d')],_0x2497a6[_0x2177('0x46')]));if(_0x33b2e2[_0x2177('0x3d')]['filter']){_0x54d100[_0x2177('0x47')]=_[_0x2177('0x49')](_0x54d100['where'],{'$or':_[_0x2177('0x2e')](_0x54d100[_0x2177('0x3f')],function(_0x4cb1de){var _0x270224={};_0x270224[_0x4cb1de]={'$like':'%'+_0x33b2e2[_0x2177('0x3d')][_0x2177('0x2d')]+'%'};return _0x270224;})});}_0x54d100=_['merge']({},_0x54d100,_0x33b2e2[_0x2177('0x4a')]);return _0x1c55b6[_0x2177('0xaf')](_0x54d100);}})['then'](function(_0x3fc8e5){if(_0x3fc8e5){_0x1431f9=_0x3fc8e5[_0x2177('0x41')];if(!_0x33b2e2[_0x2177('0x3d')][_0x2177('0x68')](_0x2177('0x42'))){_0x54d100['limit']=qs[_0x2177('0x21')](_0x33b2e2[_0x2177('0x3d')][_0x2177('0x21')]);_0x54d100[_0x2177('0x23')]=qs[_0x2177('0x23')](_0x33b2e2[_0x2177('0x3d')]['offset']);}return _0x1c55b6[_0x2177('0xaf')](_0x54d100);}})['then'](function(_0x522e8b){if(_0x522e8b){return _0x522e8b?{'count':_0x1431f9,'rows':_0x522e8b}:null;}})[_0x2177('0x28')](respondWithResult(_0x21b92a,null))[_0x2177('0x52')](handleError(_0x21b92a,null));};exports['addBlackLists']=function(_0x3c55ca,_0x225cbf,_0x12562a){var _0x3e1942,_0x105401;return db[_0x2177('0x39')]['find']({'where':{'id':_0x3c55ca['params']['id']}})['then'](handleEntityNotFound(_0x225cbf,null))[_0x2177('0x28')](function(_0x8cd8b0){if(_0x8cd8b0){_0x105401=_0x8cd8b0;return _0x8cd8b0[_0x2177('0xb0')](_0x3c55ca['body'][_0x2177('0x80')],_['omit'](_0x3c55ca[_0x2177('0x54')],[_0x2177('0x80'),'id'])||{});}return null;})[_0x2177('0x8e')](function(_0x453132){var _0x12e57a;_0x3e1942=_0x453132||[];var _0x25ff2c=[];if(_0x453132){for(var _0x2db505=0x0;_0x2db505<_0x453132[_0x2177('0x41')];_0x2db505+=0x1){var _0x41c130=_0x453132[_0x2db505][_0x2177('0x5d')]({'plain':!![]});_0x12e57a=squel[_0x2177('0x99')]()[_0x2177('0x9a')]('cm_hopper_black')[_0x2177('0x9c')]([_0x2177('0xa1'),_0x2177('0x9e'),_0x2177('0x9f'),'VoiceQueueId',_0x2177('0x5f'),_0x2177('0x60')],squel[_0x2177('0x81')]()[_0x2177('0xa0')](_0x2177('0xa1'),'phone')[_0x2177('0xa0')]('id',_0x2177('0x9e'))[_0x2177('0xa0')](_0x41c130[_0x2177('0xa2')]['toString'](),_0x2177('0x9f'))[_0x2177('0xa0')](_0x3c55ca['params']['id'][_0x2177('0x87')](),_0x2177('0x63'))['field'](_0x2177('0xa3'),_0x2177('0x5f'))[_0x2177('0xa0')](_0x2177('0xa3'),_0x2177('0x60'))[_0x2177('0xa4')](_0x2177('0xa5'))['where'](_0x2177('0xa6'))[_0x2177('0x47')](_0x2177('0xa7'),_0x41c130[_0x2177('0xa2')][_0x2177('0x87')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x2177('0x87')]();_0x25ff2c['push'](db[_0x2177('0x74')]['query'](_0x12e57a));}return BPromise[_0x2177('0xad')](_0x25ff2c);}})[_0x2177('0x28')](function(){return _0x3e1942;})[_0x2177('0x28')](respondWithResult(_0x225cbf,null))[_0x2177('0x52')](handleError(_0x225cbf,null));};exports[_0x2177('0xb1')]=function(_0x45bbf9,_0x3d9bc2,_0x554051){return db[_0x2177('0x39')][_0x2177('0x32')]({'where':{'id':_0x45bbf9['params']['id']}})[_0x2177('0x28')](handleEntityNotFound(_0x3d9bc2,null))['then'](function(_0x3a2da0){if(_0x3a2da0){return _0x3a2da0[_0x2177('0xb1')](_0x45bbf9['query'][_0x2177('0x80')]);}})['then'](function(_0x30ac35){if(_0x30ac35){return db[_0x2177('0x6a')][_0x2177('0x29')]({'where':{'ListId':_0x45bbf9['query'][_0x2177('0x80')],'VoiceQueueId':_0x45bbf9[_0x2177('0x4f')]['id']}})['then'](function(){return _0x30ac35;});}})[_0x2177('0x28')](respondWithStatusCode(_0x3d9bc2,null))[_0x2177('0x52')](handleError(_0x3d9bc2,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index f663eb8..a44e589 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 _0x016e=['hook','events','../../mysqldb','VoiceQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x454db7,_0x19898f){var _0x520d54=function(_0x5c5195){while(--_0x5c5195){_0x454db7['push'](_0x454db7['shift']());}};_0x520d54(++_0x19898f);}(_0x016e,0x1a5));var _0xe016=function(_0x24dc3f,_0x368a6f){_0x24dc3f=_0x24dc3f-0x0;var _0x95c744=_0x016e[_0x24dc3f];return _0x95c744;};'use strict';var EventEmitter=require(_0xe016('0x0'));var VoiceQueue=require(_0xe016('0x1'))['db'][_0xe016('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xe016('0x3')](0x0);var events={'afterCreate':_0xe016('0x4'),'afterUpdate':_0xe016('0x5'),'afterDestroy':_0xe016('0x6')};function emitEvent(_0x4f515b){return function(_0x31269c,_0x156f88,_0x48628e){VoiceQueueEvents['emit'](_0x4f515b+':'+_0x31269c['id'],_0x31269c);VoiceQueueEvents[_0xe016('0x7')](_0x4f515b,_0x31269c);_0x48628e(null);};}for(var e in events){if(events[_0xe016('0x8')](e)){var event=events[e];VoiceQueue[_0xe016('0x9')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file +var _0x6c4a=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','emit'];(function(_0x1c1992,_0x9e3cc5){var _0x358b69=function(_0x1ee17e){while(--_0x1ee17e){_0x1c1992['push'](_0x1c1992['shift']());}};_0x358b69(++_0x9e3cc5);}(_0x6c4a,0x135));var _0xa6c4=function(_0x117973,_0xe17e9d){_0x117973=_0x117973-0x0;var _0x154ec1=_0x6c4a[_0x117973];return _0x154ec1;};'use strict';var EventEmitter=require(_0xa6c4('0x0'));var VoiceQueue=require(_0xa6c4('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xa6c4('0x2')](0x0);var events={'afterCreate':_0xa6c4('0x3'),'afterUpdate':_0xa6c4('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2e3939){return function(_0x146953,_0x1fa57b,_0x40aea9){VoiceQueueEvents[_0xa6c4('0x5')](_0x2e3939+':'+_0x146953['id'],_0x146953);VoiceQueueEvents['emit'](_0x2e3939,_0x146953);_0x40aea9(null);};}for(var e in events){if(events[_0xa6c4('0x6')](e)){var event=events[e];VoiceQueue[_0xa6c4('0x7')](e,emitEvent(event));}}module[_0xa6c4('0x8')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index b8dc1b9..7b4e531 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 _0xa9e0=['../../config/environment','./voiceQueue.attributes','exports','define','VoiceQueue','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x3f6c6f,_0x5b18d2){var _0x3ab562=function(_0x13b3b9){while(--_0x13b3b9){_0x3f6c6f['push'](_0x3f6c6f['shift']());}};_0x3ab562(++_0x5b18d2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'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':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x70e0=['voice_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./voiceQueue.attributes'];(function(_0x135bd7,_0x46774f){var _0x6ca3ae=function(_0x11a893){while(--_0x11a893){_0x135bd7['push'](_0x135bd7['shift']());}};_0x6ca3ae(++_0x46774f);}(_0x70e0,0x17b));var _0x070e=function(_0x1175cc,_0x235150){_0x1175cc=_0x1175cc-0x0;var _0x8d4c58=_0x70e0[_0x1175cc];return _0x8d4c58;};'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 diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 763b321..3fe27e9 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 _0x7b15=['GetVoiceQueue','findAll','options','raw','where','attributes','include','map','model','ShowVoiceQueue','VoiceQueue','find','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','request','then','VoiceQueue,\x20%s,\x20%s','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','result','catch'];(function(_0x261931,_0x5b654a){var _0x11083a=function(_0x4b17af){while(--_0x4b17af){_0x261931['push'](_0x261931['shift']());}};_0x11083a(++_0x5b654a);}(_0x7b15,0x144));var _0x57b1=function(_0x54ffb0,_0x4fae1d){_0x54ffb0=_0x54ffb0-0x0;var _0x369339=_0x7b15[_0x54ffb0];return _0x369339;};'use strict';var _=require(_0x57b1('0x0'));var util=require(_0x57b1('0x1'));var moment=require('moment');var BPromise=require(_0x57b1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x57b1('0x3'));var db=require(_0x57b1('0x4'))['db'];var utils=require(_0x57b1('0x5'));var logger=require(_0x57b1('0x6'))(_0x57b1('0x7'));var config=require(_0x57b1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x57b1('0x9')][_0x57b1('0xa')]({'port':0x232a});config[_0x57b1('0xb')]=_[_0x57b1('0xc')](config[_0x57b1('0xb')],{'host':_0x57b1('0xd'),'port':0x18eb});var socket=require(_0x57b1('0xe'))(new Redis(config[_0x57b1('0xb')]));require('./voiceQueue.socket')['register'](socket);function respondWithRpcPromise(_0x1b8de4,_0x2abc77,_0xebba6e){return new BPromise(function(_0x68d27b,_0x1f85c9){return client[_0x57b1('0xf')](_0x1b8de4,_0xebba6e)[_0x57b1('0x10')](function(_0x1f007d){logger['info'](_0x57b1('0x11'),_0x2abc77,'request\x20sent');logger[_0x57b1('0x12')](_0x57b1('0x13'),_0x2abc77,'request\x20sent',JSON[_0x57b1('0x14')](_0x1f007d));if(_0x1f007d[_0x57b1('0x15')]){if(_0x1f007d[_0x57b1('0x15')]['code']===0x1f4){logger['error'](_0x57b1('0x11'),_0x2abc77,_0x1f007d[_0x57b1('0x15')]['message']);return _0x1f85c9(_0x1f007d[_0x57b1('0x15')][_0x57b1('0x16')]);}logger[_0x57b1('0x15')](_0x57b1('0x11'),_0x2abc77,_0x1f007d[_0x57b1('0x15')][_0x57b1('0x16')]);return _0x68d27b(_0x1f007d[_0x57b1('0x15')][_0x57b1('0x16')]);}else{logger[_0x57b1('0x17')](_0x57b1('0x11'),_0x2abc77,_0x57b1('0x18'));_0x68d27b(_0x1f007d[_0x57b1('0x19')][_0x57b1('0x16')]);}})[_0x57b1('0x1a')](function(_0x350d89){logger[_0x57b1('0x15')](_0x57b1('0x11'),_0x2abc77,_0x350d89);_0x1f85c9(_0x350d89);});});}exports[_0x57b1('0x1b')]=function(_0x167562){var _0x1d25ac=this;return new Promise(function(_0x39c5d5,_0x4350d2){return db['VoiceQueue'][_0x57b1('0x1c')]({'raw':_0x167562[_0x57b1('0x1d')]?_0x167562['options'][_0x57b1('0x1e')]===undefined?!![]:![]:!![],'where':_0x167562['options']?_0x167562[_0x57b1('0x1d')][_0x57b1('0x1f')]||null:null,'attributes':_0x167562[_0x57b1('0x1d')]?_0x167562[_0x57b1('0x1d')][_0x57b1('0x20')]||null:null,'limit':_0x167562[_0x57b1('0x1d')]?_0x167562[_0x57b1('0x1d')]['limit']||null:null,'include':_0x167562['options']?_0x167562[_0x57b1('0x1d')][_0x57b1('0x21')]?_[_0x57b1('0x22')](_0x167562[_0x57b1('0x1d')][_0x57b1('0x21')],function(_0x1d8a47){return{'model':db[_0x1d8a47[_0x57b1('0x23')]],'as':_0x1d8a47['as'],'attributes':_0x1d8a47[_0x57b1('0x20')],'include':_0x1d8a47['include']?_['map'](_0x1d8a47['include'],function(_0xde2f5d){return{'model':db[_0xde2f5d[_0x57b1('0x23')]],'as':_0xde2f5d['as'],'attributes':_0xde2f5d[_0x57b1('0x20')],'include':_0xde2f5d[_0x57b1('0x21')]?_[_0x57b1('0x22')](_0xde2f5d[_0x57b1('0x21')],function(_0x89d5e8){return{'model':db[_0x89d5e8[_0x57b1('0x23')]],'as':_0x89d5e8['as'],'attributes':_0x89d5e8[_0x57b1('0x20')]};}):[]};}):[]};}):[]:[]})[_0x57b1('0x10')](function(_0x394105){logger['info'](_0x57b1('0x1b'),_0x167562);logger[_0x57b1('0x12')]('GetVoiceQueue',_0x167562,JSON[_0x57b1('0x14')](_0x394105));_0x39c5d5(_0x394105);})[_0x57b1('0x1a')](function(_0x3604da){logger[_0x57b1('0x15')](_0x57b1('0x1b'),_0x3604da['message'],_0x167562);_0x4350d2(_0x1d25ac['error'](0x1f4,_0x3604da['message']));});});};exports[_0x57b1('0x24')]=function(_0x12655d){var _0x388925=this;return new Promise(function(_0x40690d,_0x48d513){return db[_0x57b1('0x25')][_0x57b1('0x26')]({'raw':_0x12655d['options']?_0x12655d[_0x57b1('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x12655d['options']?_0x12655d[_0x57b1('0x1d')][_0x57b1('0x1f')]||null:null,'attributes':_0x12655d['options']?_0x12655d[_0x57b1('0x1d')]['attributes']||null:null,'include':_0x12655d[_0x57b1('0x1d')]?_0x12655d[_0x57b1('0x1d')][_0x57b1('0x21')]?_[_0x57b1('0x22')](_0x12655d[_0x57b1('0x1d')]['include'],function(_0x37fcd7){return{'model':db[_0x37fcd7['model']],'as':_0x37fcd7['as'],'attributes':_0x37fcd7[_0x57b1('0x20')],'include':_0x37fcd7['include']?_[_0x57b1('0x22')](_0x37fcd7['include'],function(_0x266988){return{'model':db[_0x266988[_0x57b1('0x23')]],'as':_0x266988['as'],'attributes':_0x266988[_0x57b1('0x20')],'include':_0x266988['include']?_[_0x57b1('0x22')](_0x266988['include'],function(_0x50d664){return{'model':db[_0x50d664[_0x57b1('0x23')]],'as':_0x50d664['as'],'attributes':_0x50d664[_0x57b1('0x20')]};}):[]};}):[]};}):[]:[]})[_0x57b1('0x10')](function(_0xac5d3c){logger['info'](_0x57b1('0x24'),_0x12655d);logger[_0x57b1('0x12')](_0x57b1('0x24'),_0x12655d,JSON[_0x57b1('0x14')](_0xac5d3c));_0x40690d(_0xac5d3c);})[_0x57b1('0x1a')](function(_0x226ff3){logger[_0x57b1('0x15')](_0x57b1('0x24'),_0x226ff3[_0x57b1('0x16')],_0x12655d);_0x48d513(_0x388925['error'](0x1f4,_0x226ff3['message']));});});}; \ No newline at end of file +var _0x04fd=['redis','socket.io-emitter','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetVoiceQueue','findAll','options','raw','where','attributes','limit','include','model','map','ShowVoiceQueue','VoiceQueue','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x04fd,0x6c));var _0xd04f=function(_0x4f4c00,_0x3fad4a){_0x4f4c00=_0x4f4c00-0x0;var _0x3c27b4=_0x04fd[_0x4f4c00];return _0x3c27b4;};'use strict';var _=require(_0xd04f('0x0'));var util=require(_0xd04f('0x1'));var moment=require('moment');var BPromise=require(_0xd04f('0x2'));var rs=require(_0xd04f('0x3'));var fs=require('fs');var Redis=require(_0xd04f('0x4'));var db=require(_0xd04f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd04f('0x6'))(_0xd04f('0x7'));var config=require(_0xd04f('0x8'));var jayson=require(_0xd04f('0x9'));var client=jayson['client'][_0xd04f('0xa')]({'port':0x232a});config['redis']=_[_0xd04f('0xb')](config[_0xd04f('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xd04f('0xd'))(new Redis(config['redis']));require(_0xd04f('0xe'))[_0xd04f('0xf')](socket);function respondWithRpcPromise(_0x2ce811,_0x36c95d,_0x3040de){return new BPromise(function(_0x2ea0f8,_0x2156bd){return client[_0xd04f('0x10')](_0x2ce811,_0x3040de)[_0xd04f('0x11')](function(_0x857937){logger[_0xd04f('0x12')](_0xd04f('0x13'),_0x36c95d,'request\x20sent');logger[_0xd04f('0x14')](_0xd04f('0x15'),_0x36c95d,_0xd04f('0x16'),JSON[_0xd04f('0x17')](_0x857937));if(_0x857937[_0xd04f('0x18')]){if(_0x857937[_0xd04f('0x18')][_0xd04f('0x19')]===0x1f4){logger[_0xd04f('0x18')](_0xd04f('0x13'),_0x36c95d,_0x857937['error'][_0xd04f('0x1a')]);return _0x2156bd(_0x857937['error'][_0xd04f('0x1a')]);}logger[_0xd04f('0x18')](_0xd04f('0x13'),_0x36c95d,_0x857937[_0xd04f('0x18')][_0xd04f('0x1a')]);return _0x2ea0f8(_0x857937['error'][_0xd04f('0x1a')]);}else{logger[_0xd04f('0x12')](_0xd04f('0x13'),_0x36c95d,'request\x20sent');_0x2ea0f8(_0x857937['result'][_0xd04f('0x1a')]);}})[_0xd04f('0x1b')](function(_0x221c7b){logger['error'](_0xd04f('0x13'),_0x36c95d,_0x221c7b);_0x2156bd(_0x221c7b);});});}exports[_0xd04f('0x1c')]=function(_0x5b81de){var _0x4e1430=this;return new Promise(function(_0xb06c16,_0x395461){return db['VoiceQueue'][_0xd04f('0x1d')]({'raw':_0x5b81de[_0xd04f('0x1e')]?_0x5b81de[_0xd04f('0x1e')][_0xd04f('0x1f')]===undefined?!![]:![]:!![],'where':_0x5b81de[_0xd04f('0x1e')]?_0x5b81de[_0xd04f('0x1e')][_0xd04f('0x20')]||null:null,'attributes':_0x5b81de[_0xd04f('0x1e')]?_0x5b81de['options'][_0xd04f('0x21')]||null:null,'limit':_0x5b81de['options']?_0x5b81de[_0xd04f('0x1e')][_0xd04f('0x22')]||null:null,'include':_0x5b81de[_0xd04f('0x1e')]?_0x5b81de[_0xd04f('0x1e')][_0xd04f('0x23')]?_['map'](_0x5b81de['options'][_0xd04f('0x23')],function(_0x13ff8c){return{'model':db[_0x13ff8c[_0xd04f('0x24')]],'as':_0x13ff8c['as'],'attributes':_0x13ff8c['attributes'],'include':_0x13ff8c[_0xd04f('0x23')]?_[_0xd04f('0x25')](_0x13ff8c[_0xd04f('0x23')],function(_0x3c7776){return{'model':db[_0x3c7776[_0xd04f('0x24')]],'as':_0x3c7776['as'],'attributes':_0x3c7776[_0xd04f('0x21')],'include':_0x3c7776['include']?_[_0xd04f('0x25')](_0x3c7776['include'],function(_0x50a89a){return{'model':db[_0x50a89a[_0xd04f('0x24')]],'as':_0x50a89a['as'],'attributes':_0x50a89a[_0xd04f('0x21')]};}):[]};}):[]};}):[]:[]})[_0xd04f('0x11')](function(_0x4477cc){logger[_0xd04f('0x12')](_0xd04f('0x1c'),_0x5b81de);logger[_0xd04f('0x14')](_0xd04f('0x1c'),_0x5b81de,JSON[_0xd04f('0x17')](_0x4477cc));_0xb06c16(_0x4477cc);})[_0xd04f('0x1b')](function(_0x586549){logger[_0xd04f('0x18')](_0xd04f('0x1c'),_0x586549[_0xd04f('0x1a')],_0x5b81de);_0x395461(_0x4e1430[_0xd04f('0x18')](0x1f4,_0x586549[_0xd04f('0x1a')]));});});};exports[_0xd04f('0x26')]=function(_0x2d9aff){var _0x493066=this;return new Promise(function(_0x5034be,_0x3df17f){return db[_0xd04f('0x27')]['find']({'raw':_0x2d9aff[_0xd04f('0x1e')]?_0x2d9aff[_0xd04f('0x1e')][_0xd04f('0x1f')]===undefined?!![]:![]:!![],'where':_0x2d9aff[_0xd04f('0x1e')]?_0x2d9aff[_0xd04f('0x1e')][_0xd04f('0x20')]||null:null,'attributes':_0x2d9aff[_0xd04f('0x1e')]?_0x2d9aff['options']['attributes']||null:null,'include':_0x2d9aff[_0xd04f('0x1e')]?_0x2d9aff['options'][_0xd04f('0x23')]?_[_0xd04f('0x25')](_0x2d9aff[_0xd04f('0x1e')][_0xd04f('0x23')],function(_0x2b9829){return{'model':db[_0x2b9829[_0xd04f('0x24')]],'as':_0x2b9829['as'],'attributes':_0x2b9829[_0xd04f('0x21')],'include':_0x2b9829[_0xd04f('0x23')]?_[_0xd04f('0x25')](_0x2b9829[_0xd04f('0x23')],function(_0x182483){return{'model':db[_0x182483['model']],'as':_0x182483['as'],'attributes':_0x182483['attributes'],'include':_0x182483['include']?_['map'](_0x182483['include'],function(_0x2df011){return{'model':db[_0x2df011[_0xd04f('0x24')]],'as':_0x2df011['as'],'attributes':_0x2df011[_0xd04f('0x21')]};}):[]};}):[]};}):[]:[]})[_0xd04f('0x11')](function(_0x379b6b){logger[_0xd04f('0x12')](_0xd04f('0x26'),_0x2d9aff);logger[_0xd04f('0x14')](_0xd04f('0x26'),_0x2d9aff,JSON[_0xd04f('0x17')](_0x379b6b));_0x5034be(_0x379b6b);})[_0xd04f('0x1b')](function(_0x8a3ede){logger[_0xd04f('0x18')](_0xd04f('0x26'),_0x8a3ede[_0xd04f('0x1a')],_0x2d9aff);_0x3df17f(_0x493066['error'](0x1f4,_0x8a3ede['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index dc83fb6..d05488d 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 _0xb18c=['emit','register','length','voiceQueue:','save','remove','update'];(function(_0x25aa05,_0x23c5a6){var _0x2c88d3=function(_0x41360a){while(--_0x41360a){_0x25aa05['push'](_0x25aa05['shift']());}};_0x2c88d3(++_0x23c5a6);}(_0xb18c,0x10e));var _0xcb18=function(_0xea1177,_0xd410dc){_0xea1177=_0xea1177-0x0;var _0x2cc68d=_0xb18c[_0xea1177];return _0x2cc68d;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0xcb18('0x0'),_0xcb18('0x1'),_0xcb18('0x2')];function createListener(_0x36f553,_0x100cae){return function(_0x42ac27){_0x100cae[_0xcb18('0x3')](_0x36f553,_0x42ac27);};}function removeListener(_0xe6ce81,_0x3dc182){return function(){VoiceQueueEvents['removeListener'](_0xe6ce81,_0x3dc182);};}exports[_0xcb18('0x4')]=function(_0x192410){for(var _0x110508=0x0,_0x2e28e7=events[_0xcb18('0x5')];_0x110508<_0x2e28e7;_0x110508++){var _0x12c466=events[_0x110508];var _0x3ed484=createListener(_0xcb18('0x6')+_0x12c466,_0x192410);VoiceQueueEvents['on'](_0x12c466,_0x3ed484);}}; \ No newline at end of file +var _0x3308=['save','remove','update','emit','removeListener','register','length','voiceQueue:','./voiceQueue.events'];(function(_0x139a4f,_0x5c6d66){var _0x46ed1c=function(_0x1190e4){while(--_0x1190e4){_0x139a4f['push'](_0x139a4f['shift']());}};_0x46ed1c(++_0x5c6d66);}(_0x3308,0x194));var _0x8330=function(_0x5c28bb,_0x20e790){_0x5c28bb=_0x5c28bb-0x0;var _0x22717c=_0x3308[_0x5c28bb];return _0x22717c;};'use strict';var VoiceQueueEvents=require(_0x8330('0x0'));var events=[_0x8330('0x1'),_0x8330('0x2'),_0x8330('0x3')];function createListener(_0x234aa3,_0x234301){return function(_0x158e5){_0x234301[_0x8330('0x4')](_0x234aa3,_0x158e5);};}function removeListener(_0x2a38e0,_0x1db45b){return function(){VoiceQueueEvents[_0x8330('0x5')](_0x2a38e0,_0x1db45b);};}exports[_0x8330('0x6')]=function(_0x2f44ef){for(var _0x24316c=0x0,_0x5c750c=events[_0x8330('0x7')];_0x24316c<_0x5c750c;_0x24316c++){var _0x219b1b=events[_0x24316c];var _0x4220f1=createListener(_0x8330('0x8')+_0x219b1b,_0x2f44ef);VoiceQueueEvents['on'](_0x219b1b,_0x4220f1);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 99ebc35..56231cc 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 _0xc381=['destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','describe','/index','/:id','show','post','create','put','update','delete'];(function(_0x1a8472,_0x28eb63){var _0x2b5240=function(_0x171d81){while(--_0x171d81){_0x1a8472['push'](_0x1a8472['shift']());}};_0x2b5240(++_0x28eb63);}(_0xc381,0x112));var _0x1c38=function(_0x58e976,_0x53e99f){_0x58e976=_0x58e976-0x0;var _0x27d743=_0xc381[_0x58e976];return _0x27d743;};'use strict';var multer=require(_0x1c38('0x0'));var util=require('util');var path=require(_0x1c38('0x1'));var timeout=require(_0x1c38('0x2'));var express=require(_0x1c38('0x3'));var router=express['Router']();var fs_extra=require(_0x1c38('0x4'));var auth=require(_0x1c38('0x5'));var interaction=require(_0x1c38('0x6'));var config=require(_0x1c38('0x7'));var controller=require(_0x1c38('0x8'));router[_0x1c38('0x9')]('/',auth[_0x1c38('0xa')](),controller['index']);router[_0x1c38('0x9')]('/describe',auth[_0x1c38('0xa')](),controller[_0x1c38('0xb')]);router['get'](_0x1c38('0xc'),auth[_0x1c38('0xa')](),controller['getVoiceQueuesReport']);router[_0x1c38('0x9')](_0x1c38('0xd'),auth[_0x1c38('0xa')](),controller[_0x1c38('0xe')]);router[_0x1c38('0xf')]('/',auth[_0x1c38('0xa')](),controller[_0x1c38('0x10')]);router[_0x1c38('0x11')](_0x1c38('0xd'),auth['isAuthenticated'](),controller[_0x1c38('0x12')]);router[_0x1c38('0x13')](_0x1c38('0xd'),auth[_0x1c38('0xa')](),controller[_0x1c38('0x14')]);module['exports']=router; \ No newline at end of file +var _0xfa52=['post','create','put','/:id','update','delete','destroy','exports','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe','/index','show'];(function(_0x321df4,_0x3efec5){var _0x50d06c=function(_0x3ac0f4){while(--_0x3ac0f4){_0x321df4['push'](_0x321df4['shift']());}};_0x50d06c(++_0x3efec5);}(_0xfa52,0x197));var _0x2fa5=function(_0x2fdf82,_0x322e7c){_0x2fdf82=_0x2fdf82-0x0;var _0x2382f5=_0xfa52[_0x2fdf82];return _0x2382f5;};'use strict';var multer=require('multer');var util=require(_0x2fa5('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2fa5('0x1')]();var fs_extra=require(_0x2fa5('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x2fa5('0x3'));var config=require(_0x2fa5('0x4'));var controller=require(_0x2fa5('0x5'));router[_0x2fa5('0x6')]('/',auth[_0x2fa5('0x7')](),controller[_0x2fa5('0x8')]);router[_0x2fa5('0x6')](_0x2fa5('0x9'),auth['isAuthenticated'](),controller[_0x2fa5('0xa')]);router[_0x2fa5('0x6')](_0x2fa5('0xb'),auth[_0x2fa5('0x7')](),controller['getVoiceQueuesReport']);router[_0x2fa5('0x6')]('/:id',auth[_0x2fa5('0x7')](),controller[_0x2fa5('0xc')]);router[_0x2fa5('0xd')]('/',auth['isAuthenticated'](),controller[_0x2fa5('0xe')]);router[_0x2fa5('0xf')](_0x2fa5('0x10'),auth[_0x2fa5('0x7')](),controller[_0x2fa5('0x11')]);router[_0x2fa5('0x12')](_0x2fa5('0x10'),auth[_0x2fa5('0x7')](),controller[_0x2fa5('0x13')]);module[_0x2fa5('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index cf8a57d..e6e62ce 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 _0xea1c=['setDataValue','INTEGER','BOOLEAN','sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','queuecallerleaveAt'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0xea1c,0x199));var _0xcea1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xea1c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xcea1('0x0'));var moment=require(_0xcea1('0x1'));module[_0xcea1('0x2')]={'type':{'type':Sequelize[_0xcea1('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xcea1('0x3')]},'calleridname':{'type':Sequelize[_0xcea1('0x3')]},'queue':{'type':Sequelize[_0xcea1('0x3')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0xcea1('0x4')],'set':function(_0x5e61f1){var _0x242a8b=moment(_0x5e61f1);var _0x3da50b=moment(this[_0xcea1('0x5')](_0xcea1('0x6')))[_0xcea1('0x7')](_0xcea1('0x8'));var _0x139004=_0x242a8b[_0xcea1('0x9')](_0x3da50b,'seconds');this['setDataValue'](_0xcea1('0xa'),_0x5e61f1);this[_0xcea1('0xb')]('holdtime',_0x139004||null);}},'position':{'type':Sequelize[_0xcea1('0xc')]},'count':{'type':Sequelize[_0xcea1('0xc')]},'queuecallerabandon':{'type':Sequelize[_0xcea1('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0xcea1('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0xcea1('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xcea1('0x4')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0xcea1('0xc')]},'channel':{'type':Sequelize[_0xcea1('0x3')]},'connectedlinenum':{'type':Sequelize[_0xcea1('0x3')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xcea1('0x3')]},'exten':{'type':Sequelize[_0xcea1('0x3')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0xcea1('0xc')]},'mohtime':{'type':Sequelize[_0xcea1('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xcea1('0x3')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xcea1('0x3')]},'transferuniqueid':{'type':Sequelize[_0xcea1('0x3')]},'disposition':{'type':Sequelize[_0xcea1('0x3')]},'secondDisposition':{'type':Sequelize[_0xcea1('0x3')]},'thirdDisposition':{'type':Sequelize[_0xcea1('0x3')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x9430=['queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','moment','exports','STRING','DATE','getDataValue','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue'];(function(_0x4e8887,_0x2ccd4e){var _0xdb8481=function(_0x3e5bb6){while(--_0x3e5bb6){_0x4e8887['push'](_0x4e8887['shift']());}};_0xdb8481(++_0x2ccd4e);}(_0x9430,0xf6));var _0x0943=function(_0x59756b,_0x477b9c){_0x59756b=_0x59756b-0x0;var _0xf7648b=_0x9430[_0x59756b];return _0xf7648b;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x0943('0x0'));module[_0x0943('0x1')]={'type':{'type':Sequelize[_0x0943('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x0943('0x2')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0x0943('0x3')],'set':function(_0x43b722){var _0x5eccbb=moment(_0x43b722);var _0x2b9830=moment(this[_0x0943('0x4')]('queuecallerjoinAt'))[_0x0943('0x5')](_0x0943('0x6'));var _0x386dbc=_0x5eccbb[_0x0943('0x7')](_0x2b9830,_0x0943('0x8'));this[_0x0943('0x9')](_0x0943('0xa'),_0x43b722);this['setDataValue'](_0x0943('0xb'),_0x386dbc||null);}},'position':{'type':Sequelize[_0x0943('0xc')]},'count':{'type':Sequelize[_0x0943('0xc')]},'queuecallerabandon':{'type':Sequelize[_0x0943('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x0943('0x3')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x0943('0x3')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x0943('0x3')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0x0943('0xe')},'originalposition':{'type':Sequelize[_0x0943('0xc')]},'channel':{'type':Sequelize[_0x0943('0x2')]},'connectedlinenum':{'type':Sequelize[_0x0943('0x2')]},'connectedlinename':{'type':Sequelize[_0x0943('0x2')]},'accountcode':{'type':Sequelize[_0x0943('0x2')]},'context':{'type':Sequelize[_0x0943('0x2')]},'exten':{'type':Sequelize[_0x0943('0x2')]},'priority':{'type':Sequelize[_0x0943('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x0943('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x0943('0x2')]},'transfer':{'type':Sequelize[_0x0943('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x0943('0x2')],'comment':_0x0943('0xf')},'transferexten':{'type':Sequelize[_0x0943('0x2')]},'transferuniqueid':{'type':Sequelize[_0x0943('0x2')]},'disposition':{'type':Sequelize[_0x0943('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x0943('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0x0943('0xc')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 720adad..d7d43d4 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 _0x8b6b=['socket.io-emitter','./voiceQueueReport.socket','register','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','sendStatus','name','send','index','map','VoiceQueueReport','fieldName','type','key','query','keys','filters','intersection','attributes','fields','length','model','nolimit','order','sort','where','filter','VIRTUAL','merge','includeAll','include','rows','catch','show','params','options','find','create','body','describe','getVoiceQueuesReport','rawAttributes','hasOwnProperty','pick','findAll','eml-format','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','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','localhost'];(function(_0x222fb7,_0x4622da){var _0x126372=function(_0x59a410){while(--_0x59a410){_0x222fb7['push'](_0x222fb7['shift']());}};_0x126372(++_0x4622da);}(_0x8b6b,0x1d7));var _0xb8b6=function(_0x474111,_0x3d142c){_0x474111=_0x474111-0x0;var _0xdae982=_0x8b6b[_0x474111];return _0xdae982;};'use strict';var emlformat=require(_0xb8b6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb8b6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb8b6('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xb8b6('0x3'));var util=require(_0xb8b6('0x4'));var path=require(_0xb8b6('0x5'));var sox=require(_0xb8b6('0x6'));var csv=require(_0xb8b6('0x7'));var ejs=require(_0xb8b6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb8b6('0x9'));var squel=require(_0xb8b6('0xa'));var crypto=require(_0xb8b6('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb8b6('0x7'));var querystring=require(_0xb8b6('0xc'));var Papa=require(_0xb8b6('0xd'));var Redis=require(_0xb8b6('0xe'));var authService=require(_0xb8b6('0xf'));var qs=require(_0xb8b6('0x10'));var as=require(_0xb8b6('0x11'));var hardwareService=require(_0xb8b6('0x12'));var logger=require(_0xb8b6('0x13'))(_0xb8b6('0x14'));var utils=require(_0xb8b6('0x15'));var config=require(_0xb8b6('0x16'));var licenseUtil=require(_0xb8b6('0x17'));var db=require('../../mysqldb')['db'];config[_0xb8b6('0x18')]=_[_0xb8b6('0x19')](config['redis'],{'host':_0xb8b6('0x1a'),'port':0x18eb});var socket=require(_0xb8b6('0x1b'))(new Redis(config[_0xb8b6('0x18')]));require(_0xb8b6('0x1c'))[_0xb8b6('0x1d')](socket);function respondWithStatusCode(_0x1ac6fe,_0x191ff6){_0x191ff6=_0x191ff6||0xcc;return function(_0x2e0b51){if(_0x2e0b51){return _0x1ac6fe['sendStatus'](_0x191ff6);}return _0x1ac6fe[_0xb8b6('0x1e')](_0x191ff6)[_0xb8b6('0x1f')]();};}function respondWithResult(_0x507149,_0x569e41){_0x569e41=_0x569e41||0xc8;return function(_0x572c7f){if(_0x572c7f){return _0x507149[_0xb8b6('0x1e')](_0x569e41)[_0xb8b6('0x20')](_0x572c7f);}};}function respondWithFilteredResult(_0x541522,_0x4c7b1f){return function(_0x5e37d7){if(_0x5e37d7){var _0xbd1772=typeof _0x4c7b1f[_0xb8b6('0x21')]===_0xb8b6('0x22')&&typeof _0x4c7b1f[_0xb8b6('0x23')]===_0xb8b6('0x22');var _0x3f8652=_0x5e37d7[_0xb8b6('0x24')];var _0x49b98b=_0xbd1772?0x0:_0x4c7b1f[_0xb8b6('0x21')];var _0x33da86=_0xbd1772?_0x5e37d7[_0xb8b6('0x24')]:_0x4c7b1f[_0xb8b6('0x21')]+_0x4c7b1f[_0xb8b6('0x23')];var _0x56f23d;if(_0x33da86>=_0x3f8652){_0x33da86=_0x3f8652;_0x56f23d=0xc8;}else{_0x56f23d=0xce;}_0x541522[_0xb8b6('0x1e')](_0x56f23d);return _0x541522['set'](_0xb8b6('0x25'),_0x49b98b+'-'+_0x33da86+'/'+_0x3f8652)[_0xb8b6('0x20')](_0x5e37d7);}return null;};}function patchUpdates(_0xa69854){return function(_0x2afd75){try{jsonpatch['apply'](_0x2afd75,_0xa69854,!![]);}catch(_0x200bc5){return BPromise[_0xb8b6('0x26')](_0x200bc5);}return _0x2afd75[_0xb8b6('0x27')]();};}function saveUpdates(_0x3cd822,_0x327773){return function(_0x6e4706){if(_0x6e4706){return _0x6e4706[_0xb8b6('0x28')](_0x3cd822)[_0xb8b6('0x29')](function(_0x53ff7a){return _0x53ff7a;});}return null;};}function removeEntity(_0x52515d,_0x150f9d){return function(_0x16c711){if(_0x16c711){return _0x16c711[_0xb8b6('0x2a')]()[_0xb8b6('0x29')](function(){_0x52515d['status'](0xcc)[_0xb8b6('0x1f')]();});}};}function handleEntityNotFound(_0x459618,_0x247f1a){return function(_0x562628){if(!_0x562628){_0x459618[_0xb8b6('0x2b')](0x194);}return _0x562628;};}function handleError(_0x45488f,_0x250f29){_0x250f29=_0x250f29||0x1f4;return function(_0x574fde){logger['error'](_0x574fde['stack']);if(_0x574fde[_0xb8b6('0x2c')]){delete _0x574fde[_0xb8b6('0x2c')];}_0x45488f[_0xb8b6('0x1e')](_0x250f29)[_0xb8b6('0x2d')](_0x574fde);};}exports[_0xb8b6('0x2e')]=function(_0x341c5c,_0x2ed3ba){var _0x24c7d2={},_0x1e1ec={},_0x368825={'count':0x0,'rows':[]};var _0x550d6e=_[_0xb8b6('0x2f')](db[_0xb8b6('0x30')]['rawAttributes'],function(_0xd00166){return{'name':_0xd00166[_0xb8b6('0x31')],'type':_0xd00166[_0xb8b6('0x32')][_0xb8b6('0x33')]};});_0x1e1ec['model']=_['map'](_0x550d6e,_0xb8b6('0x2c'));_0x1e1ec[_0xb8b6('0x34')]=_[_0xb8b6('0x35')](_0x341c5c[_0xb8b6('0x34')]);_0x1e1ec[_0xb8b6('0x36')]=_[_0xb8b6('0x37')](_0x1e1ec['model'],_0x1e1ec[_0xb8b6('0x34')]);_0x24c7d2[_0xb8b6('0x38')]=_[_0xb8b6('0x37')](_0x1e1ec['model'],qs[_0xb8b6('0x39')](_0x341c5c['query'][_0xb8b6('0x39')]));_0x24c7d2[_0xb8b6('0x38')]=_0x24c7d2[_0xb8b6('0x38')][_0xb8b6('0x3a')]?_0x24c7d2[_0xb8b6('0x38')]:_0x1e1ec[_0xb8b6('0x3b')];if(!_0x341c5c[_0xb8b6('0x34')]['hasOwnProperty'](_0xb8b6('0x3c'))){_0x24c7d2[_0xb8b6('0x23')]=qs[_0xb8b6('0x23')](_0x341c5c['query'][_0xb8b6('0x23')]);_0x24c7d2[_0xb8b6('0x21')]=qs[_0xb8b6('0x21')](_0x341c5c[_0xb8b6('0x34')]['offset']);}_0x24c7d2[_0xb8b6('0x3d')]=qs[_0xb8b6('0x3e')](_0x341c5c['query'][_0xb8b6('0x3e')]);_0x24c7d2[_0xb8b6('0x3f')]=qs[_0xb8b6('0x36')](_['pick'](_0x341c5c[_0xb8b6('0x34')],_0x1e1ec[_0xb8b6('0x36')]),_0x550d6e);if(_0x341c5c[_0xb8b6('0x34')][_0xb8b6('0x40')]){_0x24c7d2[_0xb8b6('0x3f')]=_['merge'](_0x24c7d2[_0xb8b6('0x3f')],{'$or':_[_0xb8b6('0x2f')](_0x550d6e,function(_0x3eeb78){if(_0x3eeb78[_0xb8b6('0x32')]!==_0xb8b6('0x41')){var _0x48a78e={};_0x48a78e[_0x3eeb78[_0xb8b6('0x2c')]]={'$like':'%'+_0x341c5c[_0xb8b6('0x34')][_0xb8b6('0x40')]+'%'};return _0x48a78e;}})});}_0x24c7d2=_[_0xb8b6('0x42')]({},_0x24c7d2,_0x341c5c['options']);var _0x5cdfa6={'where':_0x24c7d2['where']};return db['VoiceQueueReport']['count'](_0x5cdfa6)['then'](function(_0x1927cb){_0x368825[_0xb8b6('0x24')]=_0x1927cb;if(_0x341c5c[_0xb8b6('0x34')][_0xb8b6('0x43')]){_0x24c7d2[_0xb8b6('0x44')]=[{'all':!![]}];}return db[_0xb8b6('0x30')]['findAll'](_0x24c7d2);})[_0xb8b6('0x29')](function(_0x91aa84){_0x368825[_0xb8b6('0x45')]=_0x91aa84;return _0x368825;})[_0xb8b6('0x29')](respondWithFilteredResult(_0x2ed3ba,_0x24c7d2))[_0xb8b6('0x46')](handleError(_0x2ed3ba,null));};exports[_0xb8b6('0x47')]=function(_0x2e6990,_0x35b3ef){var _0x4dfc93={'raw':![],'where':{'id':_0x2e6990[_0xb8b6('0x48')]['id']}},_0x569a0f={};_0x569a0f[_0xb8b6('0x3b')]=_[_0xb8b6('0x35')](db[_0xb8b6('0x30')]['rawAttributes']);_0x569a0f[_0xb8b6('0x34')]=_[_0xb8b6('0x35')](_0x2e6990['query']);_0x569a0f[_0xb8b6('0x36')]=_[_0xb8b6('0x37')](_0x569a0f[_0xb8b6('0x3b')],_0x569a0f[_0xb8b6('0x34')]);_0x4dfc93[_0xb8b6('0x38')]=_['intersection'](_0x569a0f[_0xb8b6('0x3b')],qs['fields'](_0x2e6990[_0xb8b6('0x34')][_0xb8b6('0x39')]));_0x4dfc93[_0xb8b6('0x38')]=_0x4dfc93['attributes'][_0xb8b6('0x3a')]?_0x4dfc93[_0xb8b6('0x38')]:_0x569a0f[_0xb8b6('0x3b')];if(_0x2e6990[_0xb8b6('0x34')]['includeAll']){_0x4dfc93[_0xb8b6('0x44')]=[{'all':!![]}];}_0x4dfc93=_[_0xb8b6('0x42')]({},_0x4dfc93,_0x2e6990[_0xb8b6('0x49')]);return db[_0xb8b6('0x30')][_0xb8b6('0x4a')](_0x4dfc93)['then'](handleEntityNotFound(_0x35b3ef,null))[_0xb8b6('0x29')](respondWithResult(_0x35b3ef,null))[_0xb8b6('0x46')](handleError(_0x35b3ef,null));};exports[_0xb8b6('0x4b')]=function(_0x3f71c4,_0x3c5d72){return db[_0xb8b6('0x30')]['create'](_0x3f71c4[_0xb8b6('0x4c')],{})[_0xb8b6('0x29')](respondWithResult(_0x3c5d72,0xc9))[_0xb8b6('0x46')](handleError(_0x3c5d72,null));};exports[_0xb8b6('0x28')]=function(_0x5b9a77,_0x28cbb6){if(_0x5b9a77[_0xb8b6('0x4c')]['id']){delete _0x5b9a77['body']['id'];}return db[_0xb8b6('0x30')][_0xb8b6('0x4a')]({'where':{'id':_0x5b9a77[_0xb8b6('0x48')]['id']}})[_0xb8b6('0x29')](handleEntityNotFound(_0x28cbb6,null))['then'](saveUpdates(_0x5b9a77[_0xb8b6('0x4c')],null))['then'](respondWithResult(_0x28cbb6,null))[_0xb8b6('0x46')](handleError(_0x28cbb6,null));};exports[_0xb8b6('0x2a')]=function(_0xc9b2d8,_0x47d9ef){return db['VoiceQueueReport'][_0xb8b6('0x4a')]({'where':{'id':_0xc9b2d8[_0xb8b6('0x48')]['id']}})[_0xb8b6('0x29')](handleEntityNotFound(_0x47d9ef,null))[_0xb8b6('0x29')](removeEntity(_0x47d9ef,null))[_0xb8b6('0x46')](handleError(_0x47d9ef,null));};exports[_0xb8b6('0x4d')]=function(_0x3c0155,_0x22fe56){return db[_0xb8b6('0x30')][_0xb8b6('0x4d')]()['then'](respondWithResult(_0x22fe56,null))[_0xb8b6('0x46')](handleError(_0x22fe56,null));};exports[_0xb8b6('0x4e')]=function(_0x5b9cca,_0x3209fd){var _0x38f992={},_0x318359={},_0xa2b3fd={'count':0x0,'rows':[]};_0x318359[_0xb8b6('0x3b')]=_[_0xb8b6('0x35')](db['VoiceQueueReport'][_0xb8b6('0x4f')]);_0x318359[_0xb8b6('0x34')]=_[_0xb8b6('0x35')](_0x5b9cca[_0xb8b6('0x34')]);_0x318359['filters']=_[_0xb8b6('0x37')](_0x318359['model'],_0x318359['query']);_0x38f992[_0xb8b6('0x38')]=_[_0xb8b6('0x37')](_0x318359[_0xb8b6('0x3b')],qs[_0xb8b6('0x39')](_0x5b9cca[_0xb8b6('0x34')][_0xb8b6('0x39')]));_0x38f992[_0xb8b6('0x38')]=_0x38f992[_0xb8b6('0x38')][_0xb8b6('0x3a')]?_0x38f992[_0xb8b6('0x38')]:_0x318359[_0xb8b6('0x3b')];if(!_0x5b9cca[_0xb8b6('0x34')][_0xb8b6('0x50')](_0xb8b6('0x3c'))){_0x38f992['limit']=qs[_0xb8b6('0x23')](_0x5b9cca[_0xb8b6('0x34')][_0xb8b6('0x23')]);_0x38f992[_0xb8b6('0x21')]=qs['offset'](_0x5b9cca[_0xb8b6('0x34')][_0xb8b6('0x21')]);}_0x38f992[_0xb8b6('0x3d')]=qs[_0xb8b6('0x3e')](_0x5b9cca[_0xb8b6('0x34')][_0xb8b6('0x3e')]);_0x38f992['where']=qs[_0xb8b6('0x36')](_[_0xb8b6('0x51')](_0x5b9cca[_0xb8b6('0x34')],_0x318359['filters']));if(_0x5b9cca['query'][_0xb8b6('0x40')]){_0x38f992['where']=_['merge'](_0x38f992[_0xb8b6('0x3f')],{'$or':_[_0xb8b6('0x2f')](_0x38f992['attributes'],function(_0x1c583d){var _0x441404={};_0x441404[_0x1c583d]={'$like':'%'+_0x5b9cca[_0xb8b6('0x34')][_0xb8b6('0x40')]+'%'};return _0x441404;})});}_0x38f992=_['merge']({},_0x38f992,_0x5b9cca[_0xb8b6('0x49')]);var _0x50d5b1={'where':_0x38f992[_0xb8b6('0x3f')]};return db[_0xb8b6('0x30')][_0xb8b6('0x24')](_0x50d5b1)[_0xb8b6('0x29')](function(_0x139ef4){_0xa2b3fd[_0xb8b6('0x24')]=_0x139ef4;if(_0x5b9cca['query']['includeAll']){_0x38f992[_0xb8b6('0x44')]=[{'all':!![]}];}return db[_0xb8b6('0x30')][_0xb8b6('0x52')](_0x38f992);})[_0xb8b6('0x29')](function(_0xfc48d){_0xa2b3fd[_0xb8b6('0x45')]=_0xfc48d;return _0xa2b3fd;})[_0xb8b6('0x29')](respondWithFilteredResult(_0x3209fd,_0x38f992,_0xb8b6('0x4e')))[_0xb8b6('0x46')](handleError(_0x3209fd,null,'getVoiceQueuesReport'));}; \ No newline at end of file +var _0x16b6=['count','set','Content-Range','apply','reject','save','destroy','name','send','VoiceQueueReport','rawAttributes','fieldName','type','model','map','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','merge','filter','then','include','findAll','rows','catch','show','params','includeAll','options','find','create','body','update','hasOwnProperty','getVoiceQueuesReport','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','defaults','localhost','redis','./voiceQueueReport.socket','register','sendStatus','status','end','json','offset','limit'];(function(_0x527c39,_0x3ea2a6){var _0x3f4dd6=function(_0x1ec265){while(--_0x1ec265){_0x527c39['push'](_0x527c39['shift']());}};_0x3f4dd6(++_0x3ea2a6);}(_0x16b6,0xc3));var _0x616b=function(_0x25dc63,_0x2d45e8){_0x25dc63=_0x25dc63-0x0;var _0x7857c8=_0x16b6[_0x25dc63];return _0x7857c8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x616b('0x0'));var zipdir=require(_0x616b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x616b('0x2'));var moment=require(_0x616b('0x3'));var BPromise=require(_0x616b('0x4'));var Mustache=require(_0x616b('0x5'));var util=require('util');var path=require(_0x616b('0x6'));var sox=require('sox');var csv=require(_0x616b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x616b('0x8'));var _=require(_0x616b('0x9'));var squel=require(_0x616b('0xa'));var crypto=require(_0x616b('0xb'));var jsforce=require(_0x616b('0xc'));var deskjs=require(_0x616b('0xd'));var toCsv=require(_0x616b('0x7'));var querystring=require(_0x616b('0xe'));var Papa=require('papaparse');var Redis=require(_0x616b('0xf'));var authService=require(_0x616b('0x10'));var qs=require(_0x616b('0x11'));var as=require(_0x616b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x616b('0x13'))('api');var utils=require(_0x616b('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x616b('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x616b('0x16')](config['redis'],{'host':_0x616b('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x616b('0x18')]));require(_0x616b('0x19'))[_0x616b('0x1a')](socket);function respondWithStatusCode(_0x2e31ee,_0x2dc5eb){_0x2dc5eb=_0x2dc5eb||0xcc;return function(_0x4472e5){if(_0x4472e5){return _0x2e31ee[_0x616b('0x1b')](_0x2dc5eb);}return _0x2e31ee[_0x616b('0x1c')](_0x2dc5eb)[_0x616b('0x1d')]();};}function respondWithResult(_0xe8af2c,_0x372106){_0x372106=_0x372106||0xc8;return function(_0x53ec00){if(_0x53ec00){return _0xe8af2c['status'](_0x372106)[_0x616b('0x1e')](_0x53ec00);}};}function respondWithFilteredResult(_0xbb74fb,_0x139898){return function(_0x28306d){if(_0x28306d){var _0x5c82c6=typeof _0x139898[_0x616b('0x1f')]==='undefined'&&typeof _0x139898[_0x616b('0x20')]==='undefined';var _0x2c0cea=_0x28306d['count'];var _0x1df346=_0x5c82c6?0x0:_0x139898[_0x616b('0x1f')];var _0x1ca2e3=_0x5c82c6?_0x28306d[_0x616b('0x21')]:_0x139898[_0x616b('0x1f')]+_0x139898[_0x616b('0x20')];var _0x2a5d66;if(_0x1ca2e3>=_0x2c0cea){_0x1ca2e3=_0x2c0cea;_0x2a5d66=0xc8;}else{_0x2a5d66=0xce;}_0xbb74fb[_0x616b('0x1c')](_0x2a5d66);return _0xbb74fb[_0x616b('0x22')](_0x616b('0x23'),_0x1df346+'-'+_0x1ca2e3+'/'+_0x2c0cea)['json'](_0x28306d);}return null;};}function patchUpdates(_0x5b16d5){return function(_0x5af22f){try{jsonpatch[_0x616b('0x24')](_0x5af22f,_0x5b16d5,!![]);}catch(_0x43b55b){return BPromise[_0x616b('0x25')](_0x43b55b);}return _0x5af22f[_0x616b('0x26')]();};}function saveUpdates(_0x4fb95b,_0x3d78be){return function(_0x7d0591){if(_0x7d0591){return _0x7d0591['update'](_0x4fb95b)['then'](function(_0xb7530e){return _0xb7530e;});}return null;};}function removeEntity(_0x96cceb,_0x2a75f0){return function(_0x92db0d){if(_0x92db0d){return _0x92db0d[_0x616b('0x27')]()['then'](function(){_0x96cceb[_0x616b('0x1c')](0xcc)[_0x616b('0x1d')]();});}};}function handleEntityNotFound(_0x295797,_0x5b3341){return function(_0x29acd2){if(!_0x29acd2){_0x295797[_0x616b('0x1b')](0x194);}return _0x29acd2;};}function handleError(_0x40f4df,_0x9e4f31){_0x9e4f31=_0x9e4f31||0x1f4;return function(_0x49f555){logger['error'](_0x49f555['stack']);if(_0x49f555[_0x616b('0x28')]){delete _0x49f555[_0x616b('0x28')];}_0x40f4df[_0x616b('0x1c')](_0x9e4f31)[_0x616b('0x29')](_0x49f555);};}exports['index']=function(_0x14fd0e,_0x2f025c){var _0x193789={},_0x4f741e={},_0x2cee11={'count':0x0,'rows':[]};var _0x4a0407=_['map'](db[_0x616b('0x2a')][_0x616b('0x2b')],function(_0x4186e1){return{'name':_0x4186e1[_0x616b('0x2c')],'type':_0x4186e1[_0x616b('0x2d')]['key']};});_0x4f741e[_0x616b('0x2e')]=_[_0x616b('0x2f')](_0x4a0407,_0x616b('0x28'));_0x4f741e[_0x616b('0x30')]=_[_0x616b('0x31')](_0x14fd0e[_0x616b('0x30')]);_0x4f741e['filters']=_[_0x616b('0x32')](_0x4f741e[_0x616b('0x2e')],_0x4f741e['query']);_0x193789['attributes']=_[_0x616b('0x32')](_0x4f741e['model'],qs[_0x616b('0x33')](_0x14fd0e[_0x616b('0x30')][_0x616b('0x33')]));_0x193789[_0x616b('0x34')]=_0x193789[_0x616b('0x34')][_0x616b('0x35')]?_0x193789[_0x616b('0x34')]:_0x4f741e['model'];if(!_0x14fd0e[_0x616b('0x30')]['hasOwnProperty'](_0x616b('0x36'))){_0x193789[_0x616b('0x20')]=qs['limit'](_0x14fd0e[_0x616b('0x30')][_0x616b('0x20')]);_0x193789['offset']=qs[_0x616b('0x1f')](_0x14fd0e[_0x616b('0x30')]['offset']);}_0x193789[_0x616b('0x37')]=qs[_0x616b('0x38')](_0x14fd0e[_0x616b('0x30')]['sort']);_0x193789[_0x616b('0x39')]=qs[_0x616b('0x3a')](_['pick'](_0x14fd0e['query'],_0x4f741e[_0x616b('0x3a')]),_0x4a0407);if(_0x14fd0e[_0x616b('0x30')]['filter']){_0x193789[_0x616b('0x39')]=_[_0x616b('0x3b')](_0x193789['where'],{'$or':_[_0x616b('0x2f')](_0x4a0407,function(_0x11a7b1){if(_0x11a7b1[_0x616b('0x2d')]!=='VIRTUAL'){var _0x30a762={};_0x30a762[_0x11a7b1[_0x616b('0x28')]]={'$like':'%'+_0x14fd0e[_0x616b('0x30')][_0x616b('0x3c')]+'%'};return _0x30a762;}})});}_0x193789=_['merge']({},_0x193789,_0x14fd0e['options']);var _0x512a24={'where':_0x193789[_0x616b('0x39')]};return db[_0x616b('0x2a')]['count'](_0x512a24)[_0x616b('0x3d')](function(_0x458256){_0x2cee11[_0x616b('0x21')]=_0x458256;if(_0x14fd0e[_0x616b('0x30')]['includeAll']){_0x193789[_0x616b('0x3e')]=[{'all':!![]}];}return db[_0x616b('0x2a')][_0x616b('0x3f')](_0x193789);})['then'](function(_0x5f0115){_0x2cee11[_0x616b('0x40')]=_0x5f0115;return _0x2cee11;})[_0x616b('0x3d')](respondWithFilteredResult(_0x2f025c,_0x193789))[_0x616b('0x41')](handleError(_0x2f025c,null));};exports[_0x616b('0x42')]=function(_0xfe2275,_0x4c6301){var _0x4a157a={'raw':![],'where':{'id':_0xfe2275[_0x616b('0x43')]['id']}},_0x338120={};_0x338120['model']=_[_0x616b('0x31')](db[_0x616b('0x2a')]['rawAttributes']);_0x338120['query']=_[_0x616b('0x31')](_0xfe2275[_0x616b('0x30')]);_0x338120[_0x616b('0x3a')]=_['intersection'](_0x338120['model'],_0x338120[_0x616b('0x30')]);_0x4a157a['attributes']=_['intersection'](_0x338120['model'],qs[_0x616b('0x33')](_0xfe2275['query'][_0x616b('0x33')]));_0x4a157a[_0x616b('0x34')]=_0x4a157a[_0x616b('0x34')]['length']?_0x4a157a['attributes']:_0x338120['model'];if(_0xfe2275[_0x616b('0x30')][_0x616b('0x44')]){_0x4a157a[_0x616b('0x3e')]=[{'all':!![]}];}_0x4a157a=_[_0x616b('0x3b')]({},_0x4a157a,_0xfe2275[_0x616b('0x45')]);return db[_0x616b('0x2a')][_0x616b('0x46')](_0x4a157a)[_0x616b('0x3d')](handleEntityNotFound(_0x4c6301,null))[_0x616b('0x3d')](respondWithResult(_0x4c6301,null))['catch'](handleError(_0x4c6301,null));};exports[_0x616b('0x47')]=function(_0x54a628,_0x2de85c){return db[_0x616b('0x2a')][_0x616b('0x47')](_0x54a628[_0x616b('0x48')],{})[_0x616b('0x3d')](respondWithResult(_0x2de85c,0xc9))[_0x616b('0x41')](handleError(_0x2de85c,null));};exports[_0x616b('0x49')]=function(_0x5e4285,_0x27eca3){if(_0x5e4285['body']['id']){delete _0x5e4285[_0x616b('0x48')]['id'];}return db[_0x616b('0x2a')][_0x616b('0x46')]({'where':{'id':_0x5e4285['params']['id']}})['then'](handleEntityNotFound(_0x27eca3,null))[_0x616b('0x3d')](saveUpdates(_0x5e4285[_0x616b('0x48')],null))[_0x616b('0x3d')](respondWithResult(_0x27eca3,null))[_0x616b('0x41')](handleError(_0x27eca3,null));};exports[_0x616b('0x27')]=function(_0x2611de,_0x448ed2){return db[_0x616b('0x2a')][_0x616b('0x46')]({'where':{'id':_0x2611de[_0x616b('0x43')]['id']}})[_0x616b('0x3d')](handleEntityNotFound(_0x448ed2,null))['then'](removeEntity(_0x448ed2,null))[_0x616b('0x41')](handleError(_0x448ed2,null));};exports['describe']=function(_0x2a7bc3,_0x479cad){return db[_0x616b('0x2a')]['describe']()[_0x616b('0x3d')](respondWithResult(_0x479cad,null))[_0x616b('0x41')](handleError(_0x479cad,null));};exports['getVoiceQueuesReport']=function(_0x1c3187,_0x3dd50f){var _0x1b33d5={},_0x1c9c71={},_0x507d3e={'count':0x0,'rows':[]};_0x1c9c71[_0x616b('0x2e')]=_[_0x616b('0x31')](db['VoiceQueueReport'][_0x616b('0x2b')]);_0x1c9c71[_0x616b('0x30')]=_[_0x616b('0x31')](_0x1c3187[_0x616b('0x30')]);_0x1c9c71['filters']=_[_0x616b('0x32')](_0x1c9c71[_0x616b('0x2e')],_0x1c9c71[_0x616b('0x30')]);_0x1b33d5[_0x616b('0x34')]=_[_0x616b('0x32')](_0x1c9c71['model'],qs['fields'](_0x1c3187[_0x616b('0x30')][_0x616b('0x33')]));_0x1b33d5[_0x616b('0x34')]=_0x1b33d5[_0x616b('0x34')][_0x616b('0x35')]?_0x1b33d5[_0x616b('0x34')]:_0x1c9c71[_0x616b('0x2e')];if(!_0x1c3187[_0x616b('0x30')][_0x616b('0x4a')](_0x616b('0x36'))){_0x1b33d5[_0x616b('0x20')]=qs[_0x616b('0x20')](_0x1c3187[_0x616b('0x30')][_0x616b('0x20')]);_0x1b33d5[_0x616b('0x1f')]=qs[_0x616b('0x1f')](_0x1c3187[_0x616b('0x30')]['offset']);}_0x1b33d5[_0x616b('0x37')]=qs[_0x616b('0x38')](_0x1c3187[_0x616b('0x30')][_0x616b('0x38')]);_0x1b33d5['where']=qs[_0x616b('0x3a')](_['pick'](_0x1c3187[_0x616b('0x30')],_0x1c9c71[_0x616b('0x3a')]));if(_0x1c3187[_0x616b('0x30')][_0x616b('0x3c')]){_0x1b33d5['where']=_[_0x616b('0x3b')](_0x1b33d5['where'],{'$or':_[_0x616b('0x2f')](_0x1b33d5[_0x616b('0x34')],function(_0x3d98c2){var _0x84021f={};_0x84021f[_0x3d98c2]={'$like':'%'+_0x1c3187[_0x616b('0x30')][_0x616b('0x3c')]+'%'};return _0x84021f;})});}_0x1b33d5=_[_0x616b('0x3b')]({},_0x1b33d5,_0x1c3187['options']);var _0x4d369f={'where':_0x1b33d5[_0x616b('0x39')]};return db[_0x616b('0x2a')][_0x616b('0x21')](_0x4d369f)['then'](function(_0x51af27){_0x507d3e[_0x616b('0x21')]=_0x51af27;if(_0x1c3187[_0x616b('0x30')][_0x616b('0x44')]){_0x1b33d5[_0x616b('0x3e')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x616b('0x3f')](_0x1b33d5);})[_0x616b('0x3d')](function(_0x1a4b9f){_0x507d3e[_0x616b('0x40')]=_0x1a4b9f;return _0x507d3e;})[_0x616b('0x3d')](respondWithFilteredResult(_0x3dd50f,_0x1b33d5,_0x616b('0x4b')))[_0x616b('0x41')](handleError(_0x3dd50f,null,_0x616b('0x4b')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index f8b5f00..04e9d75 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 _0x4b0c=['VoiceQueueReport','save','update','remove','emit','hasOwnProperty','../../mysqldb'];(function(_0x486130,_0x5e6517){var _0x108422=function(_0xdad595){while(--_0xdad595){_0x486130['push'](_0x486130['shift']());}};_0x108422(++_0x5e6517);}(_0x4b0c,0x109));var _0xc4b0=function(_0x33f56b,_0x4f4d65){_0x33f56b=_0x33f56b-0x0;var _0x581bbd=_0x4b0c[_0x33f56b];return _0x581bbd;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0xc4b0('0x0'))['db'][_0xc4b0('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc4b0('0x2'),'afterUpdate':_0xc4b0('0x3'),'afterDestroy':_0xc4b0('0x4')};function emitEvent(_0x216257){return function(_0x592d57,_0x2f531b,_0x295408){VoiceQueueReportEvents[_0xc4b0('0x5')](_0x216257+':'+_0x592d57['id'],_0x592d57);VoiceQueueReportEvents[_0xc4b0('0x5')](_0x216257,_0x592d57);_0x295408(null);};}for(var e in events){if(events[_0xc4b0('0x6')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file +var _0x0547=['hook','exports','events','VoiceQueueReport','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x342700,_0x569f75){var _0x53406f=function(_0x3b3c32){while(--_0x3b3c32){_0x342700['push'](_0x342700['shift']());}};_0x53406f(++_0x569f75);}(_0x0547,0x89));var _0x7054=function(_0x25175e,_0x4e153d){_0x25175e=_0x25175e-0x0;var _0x2ed062=_0x0547[_0x25175e];return _0x2ed062;};'use strict';var EventEmitter=require(_0x7054('0x0'));var VoiceQueueReport=require('../../mysqldb')['db'][_0x7054('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x7054('0x2')](0x0);var events={'afterCreate':_0x7054('0x3'),'afterUpdate':_0x7054('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2334c5){return function(_0x5c31cf,_0x3da791,_0x372114){VoiceQueueReportEvents[_0x7054('0x5')](_0x2334c5+':'+_0x5c31cf['id'],_0x5c31cf);VoiceQueueReportEvents[_0x7054('0x5')](_0x2334c5,_0x5c31cf);_0x372114(null);};}for(var e in events){if(events[_0x7054('0x6')](e)){var event=events[e];VoiceQueueReport[_0x7054('0x7')](e,emitEvent(event));}}module[_0x7054('0x8')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 885a52b..3615094 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 _0x494a=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceQueueReport.attributes','define','VoiceQueueReport','calleridnum','lodash','util'];(function(_0x52de74,_0x152687){var _0x33113e=function(_0x182424){while(--_0x182424){_0x52de74['push'](_0x52de74['shift']());}};_0x33113e(++_0x152687);}(_0x494a,0x11c));var _0xa494=function(_0x461e64,_0x37c32c){_0x461e64=_0x461e64-0x0;var _0x2c5629=_0x494a[_0x461e64];return _0x2c5629;};'use strict';var _=require(_0xa494('0x0'));var util=require(_0xa494('0x1'));var logger=require(_0xa494('0x2'))(_0xa494('0x3'));var moment=require(_0xa494('0x4'));var BPromise=require(_0xa494('0x5'));var rp=require(_0xa494('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa494('0x7'));var config=require(_0xa494('0x8'));var attributes=require(_0xa494('0x9'));module['exports']=function(_0x266133,_0x1a912e){return _0x266133[_0xa494('0xa')](_0xa494('0xb'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0xa494('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfef0=['exports','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes'];(function(_0x898c45,_0x53db2e){var _0x18f0f5=function(_0x3d5e13){while(--_0x3d5e13){_0x898c45['push'](_0x898c45['shift']());}};_0x18f0f5(++_0x53db2e);}(_0xfef0,0x17c));var _0x0fef=function(_0x25eb80,_0x3b5efd){_0x25eb80=_0x25eb80-0x0;var _0x1821ea=_0xfef0[_0x25eb80];return _0x1821ea;};'use strict';var _=require(_0x0fef('0x0'));var util=require(_0x0fef('0x1'));var logger=require(_0x0fef('0x2'))(_0x0fef('0x3'));var moment=require('moment');var BPromise=require(_0x0fef('0x4'));var rp=require(_0x0fef('0x5'));var fs=require('fs');var path=require(_0x0fef('0x6'));var rimraf=require(_0x0fef('0x7'));var config=require(_0x0fef('0x8'));var attributes=require(_0x0fef('0x9'));module[_0x0fef('0xa')]=function(_0x133d1b,_0xde7e82){return _0x133d1b['define'](_0x0fef('0xb'),attributes,{'tableName':_0x0fef('0xc'),'paranoid':![],'indexes':[{'fields':[_0x0fef('0xd')]},{'fields':[_0x0fef('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index ff64a59..c3a5a3a 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 _0x4bf0=['./voiceQueueReport.socket','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueReport','findAll','options','where','attributes','limit','include','map','model','VoiceQueueReport','create','body','raw','CreateVoiceQueueReport','UpdateVoiceQueueReport','update','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost'];(function(_0xa4bd0f,_0x156845){var _0x59f553=function(_0x1a59fd){while(--_0x1a59fd){_0xa4bd0f['push'](_0xa4bd0f['shift']());}};_0x59f553(++_0x156845);}(_0x4bf0,0x76));var _0x04bf=function(_0x540204,_0x2f1332){_0x540204=_0x540204-0x0;var _0x47479f=_0x4bf0[_0x540204];return _0x47479f;};'use strict';var _=require(_0x04bf('0x0'));var util=require(_0x04bf('0x1'));var moment=require(_0x04bf('0x2'));var BPromise=require('bluebird');var rs=require(_0x04bf('0x3'));var fs=require('fs');var Redis=require(_0x04bf('0x4'));var db=require(_0x04bf('0x5'))['db'];var utils=require(_0x04bf('0x6'));var logger=require(_0x04bf('0x7'))(_0x04bf('0x8'));var config=require(_0x04bf('0x9'));var jayson=require(_0x04bf('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0x04bf('0xb')]=_[_0x04bf('0xc')](config[_0x04bf('0xb')],{'host':_0x04bf('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x04bf('0xb')]));require(_0x04bf('0xe'))['register'](socket);function respondWithRpcPromise(_0x1adf6f,_0x4786d7,_0x5c4038){return new BPromise(function(_0x206fd5,_0x1c5591){return client[_0x04bf('0xf')](_0x1adf6f,_0x5c4038)[_0x04bf('0x10')](function(_0x57bf8b){logger[_0x04bf('0x11')](_0x04bf('0x12'),_0x4786d7,_0x04bf('0x13'));logger[_0x04bf('0x14')](_0x04bf('0x15'),_0x4786d7,_0x04bf('0x13'),JSON[_0x04bf('0x16')](_0x57bf8b));if(_0x57bf8b['error']){if(_0x57bf8b[_0x04bf('0x17')][_0x04bf('0x18')]===0x1f4){logger[_0x04bf('0x17')](_0x04bf('0x12'),_0x4786d7,_0x57bf8b[_0x04bf('0x17')]['message']);return _0x1c5591(_0x57bf8b['error'][_0x04bf('0x19')]);}logger[_0x04bf('0x17')](_0x04bf('0x12'),_0x4786d7,_0x57bf8b[_0x04bf('0x17')][_0x04bf('0x19')]);return _0x206fd5(_0x57bf8b[_0x04bf('0x17')][_0x04bf('0x19')]);}else{logger[_0x04bf('0x11')](_0x04bf('0x12'),_0x4786d7,'request\x20sent');_0x206fd5(_0x57bf8b[_0x04bf('0x1a')][_0x04bf('0x19')]);}})[_0x04bf('0x1b')](function(_0x4d0e28){logger[_0x04bf('0x17')](_0x04bf('0x12'),_0x4786d7,_0x4d0e28);_0x1c5591(_0x4d0e28);});});}exports[_0x04bf('0x1c')]=function(_0x1fe553){var _0x238220=this;return new Promise(function(_0x27401d,_0x50441d){return db['VoiceQueueReport'][_0x04bf('0x1d')]({'raw':_0x1fe553[_0x04bf('0x1e')]?_0x1fe553[_0x04bf('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x1fe553[_0x04bf('0x1e')]?_0x1fe553['options'][_0x04bf('0x1f')]||null:null,'attributes':_0x1fe553[_0x04bf('0x1e')]?_0x1fe553[_0x04bf('0x1e')][_0x04bf('0x20')]||null:null,'limit':_0x1fe553[_0x04bf('0x1e')]?_0x1fe553[_0x04bf('0x1e')][_0x04bf('0x21')]||null:null,'include':_0x1fe553[_0x04bf('0x1e')]?_0x1fe553[_0x04bf('0x1e')][_0x04bf('0x22')]?_[_0x04bf('0x23')](_0x1fe553['options'][_0x04bf('0x22')],function(_0x47e6b6){return{'model':db[_0x47e6b6[_0x04bf('0x24')]],'as':_0x47e6b6['as'],'attributes':_0x47e6b6[_0x04bf('0x20')],'include':_0x47e6b6[_0x04bf('0x22')]?_[_0x04bf('0x23')](_0x47e6b6[_0x04bf('0x22')],function(_0x2d32bb){return{'model':db[_0x2d32bb['model']],'as':_0x2d32bb['as'],'attributes':_0x2d32bb[_0x04bf('0x20')],'include':_0x2d32bb[_0x04bf('0x22')]?_[_0x04bf('0x23')](_0x2d32bb[_0x04bf('0x22')],function(_0x1952ff){return{'model':db[_0x1952ff['model']],'as':_0x1952ff['as'],'attributes':_0x1952ff[_0x04bf('0x20')]};}):[]};}):[]};}):[]:[]})[_0x04bf('0x10')](function(_0x4ffa21){logger['info'](_0x04bf('0x1c'),_0x1fe553);logger[_0x04bf('0x14')](_0x04bf('0x1c'),_0x1fe553,JSON['stringify'](_0x4ffa21));_0x27401d(_0x4ffa21);})['catch'](function(_0x372e00){logger[_0x04bf('0x17')](_0x04bf('0x1c'),_0x372e00[_0x04bf('0x19')],_0x1fe553);_0x50441d(_0x238220[_0x04bf('0x17')](0x1f4,_0x372e00[_0x04bf('0x19')]));});});};exports['CreateVoiceQueueReport']=function(_0x248041){var _0x5a5131=this;return new Promise(function(_0x24a792,_0x37a259){return db[_0x04bf('0x25')][_0x04bf('0x26')](_0x248041[_0x04bf('0x27')],{'raw':_0x248041[_0x04bf('0x1e')]?_0x248041[_0x04bf('0x1e')][_0x04bf('0x28')]===undefined?!![]:![]:!![]})['then'](function(_0x5d2cb6){logger[_0x04bf('0x11')]('CreateVoiceQueueReport',_0x248041);logger[_0x04bf('0x14')]('CreateVoiceQueueReport',_0x248041,JSON['stringify'](_0x5d2cb6));_0x24a792(_0x5d2cb6);})[_0x04bf('0x1b')](function(_0x5937a2){logger[_0x04bf('0x17')](_0x04bf('0x29'),_0x5937a2[_0x04bf('0x19')],_0x248041);_0x37a259(_0x5a5131[_0x04bf('0x17')](0x1f4,_0x5937a2[_0x04bf('0x19')]));});});};exports[_0x04bf('0x2a')]=function(_0x3bc4a3){var _0x5439f4=this;return new Promise(function(_0x3d7de9,_0x3cf867){return db[_0x04bf('0x25')][_0x04bf('0x2b')](_0x3bc4a3[_0x04bf('0x27')],{'raw':_0x3bc4a3['options']?_0x3bc4a3[_0x04bf('0x1e')][_0x04bf('0x28')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3bc4a3['options']?_0x3bc4a3['options']['where']||null:null,'attributes':_0x3bc4a3[_0x04bf('0x1e')]?_0x3bc4a3[_0x04bf('0x1e')][_0x04bf('0x20')]||null:null,'limit':_0x3bc4a3['options']?_0x3bc4a3[_0x04bf('0x1e')][_0x04bf('0x21')]||null:null})[_0x04bf('0x10')](function(_0x5a453f){logger[_0x04bf('0x11')](_0x04bf('0x2a'),_0x3bc4a3);logger['debug'](_0x04bf('0x2a'),_0x3bc4a3,JSON[_0x04bf('0x16')](_0x5a453f));_0x3d7de9(_0x5a453f);})[_0x04bf('0x1b')](function(_0xaab33f){logger[_0x04bf('0x17')](_0x04bf('0x2a'),_0xaab33f[_0x04bf('0x19')],_0x3bc4a3);_0x3cf867(_0x5439f4[_0x04bf('0x17')](0x1f4,_0xaab33f[_0x04bf('0x19')]));});});}; \ No newline at end of file +var _0x20c5=['create','CreateVoiceQueueReport','UpdateVoiceQueueReport','body','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','findAll','options','raw','where','attributes','limit','map','include','model','then','GetVoiceQueueReport','VoiceQueueReport'];(function(_0x485907,_0x47224d){var _0x3ed143=function(_0x12e968){while(--_0x12e968){_0x485907['push'](_0x485907['shift']());}};_0x3ed143(++_0x47224d);}(_0x20c5,0xa4));var _0x520c=function(_0x1b0cc8,_0x6e3392){_0x1b0cc8=_0x1b0cc8-0x0;var _0x441d1a=_0x20c5[_0x1b0cc8];return _0x441d1a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x520c('0x0'));var BPromise=require(_0x520c('0x1'));var rs=require(_0x520c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x520c('0x3'))['db'];var utils=require(_0x520c('0x4'));var logger=require(_0x520c('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x520c('0x6'));var client=jayson['client'][_0x520c('0x7')]({'port':0x232a});config[_0x520c('0x8')]=_['defaults'](config[_0x520c('0x8')],{'host':_0x520c('0x9'),'port':0x18eb});var socket=require(_0x520c('0xa'))(new Redis(config['redis']));require(_0x520c('0xb'))[_0x520c('0xc')](socket);function respondWithRpcPromise(_0x25d839,_0x5ebd8f,_0x296c7b){return new BPromise(function(_0x130baa,_0x10d595){return client[_0x520c('0xd')](_0x25d839,_0x296c7b)['then'](function(_0x3be250){logger[_0x520c('0xe')](_0x520c('0xf'),_0x5ebd8f,_0x520c('0x10'));logger[_0x520c('0x11')](_0x520c('0x12'),_0x5ebd8f,'request\x20sent',JSON[_0x520c('0x13')](_0x3be250));if(_0x3be250[_0x520c('0x14')]){if(_0x3be250[_0x520c('0x14')]['code']===0x1f4){logger['error'](_0x520c('0xf'),_0x5ebd8f,_0x3be250[_0x520c('0x14')][_0x520c('0x15')]);return _0x10d595(_0x3be250[_0x520c('0x14')][_0x520c('0x15')]);}logger[_0x520c('0x14')](_0x520c('0xf'),_0x5ebd8f,_0x3be250[_0x520c('0x14')]['message']);return _0x130baa(_0x3be250[_0x520c('0x14')][_0x520c('0x15')]);}else{logger[_0x520c('0xe')]('VoiceQueueReport,\x20%s,\x20%s',_0x5ebd8f,_0x520c('0x10'));_0x130baa(_0x3be250[_0x520c('0x16')]['message']);}})[_0x520c('0x17')](function(_0x13c67a){logger['error'](_0x520c('0xf'),_0x5ebd8f,_0x13c67a);_0x10d595(_0x13c67a);});});}exports['GetVoiceQueueReport']=function(_0xd87790){var _0x3e1051=this;return new Promise(function(_0xda18ff,_0x38f49c){return db['VoiceQueueReport'][_0x520c('0x18')]({'raw':_0xd87790[_0x520c('0x19')]?_0xd87790[_0x520c('0x19')][_0x520c('0x1a')]===undefined?!![]:![]:!![],'where':_0xd87790[_0x520c('0x19')]?_0xd87790[_0x520c('0x19')][_0x520c('0x1b')]||null:null,'attributes':_0xd87790[_0x520c('0x19')]?_0xd87790[_0x520c('0x19')][_0x520c('0x1c')]||null:null,'limit':_0xd87790['options']?_0xd87790[_0x520c('0x19')][_0x520c('0x1d')]||null:null,'include':_0xd87790[_0x520c('0x19')]?_0xd87790[_0x520c('0x19')]['include']?_[_0x520c('0x1e')](_0xd87790['options'][_0x520c('0x1f')],function(_0x5cab48){return{'model':db[_0x5cab48[_0x520c('0x20')]],'as':_0x5cab48['as'],'attributes':_0x5cab48['attributes'],'include':_0x5cab48[_0x520c('0x1f')]?_[_0x520c('0x1e')](_0x5cab48[_0x520c('0x1f')],function(_0x3a7f5f){return{'model':db[_0x3a7f5f[_0x520c('0x20')]],'as':_0x3a7f5f['as'],'attributes':_0x3a7f5f[_0x520c('0x1c')],'include':_0x3a7f5f['include']?_['map'](_0x3a7f5f[_0x520c('0x1f')],function(_0xc874b){return{'model':db[_0xc874b['model']],'as':_0xc874b['as'],'attributes':_0xc874b['attributes']};}):[]};}):[]};}):[]:[]})[_0x520c('0x21')](function(_0x5d96d9){logger['info']('GetVoiceQueueReport',_0xd87790);logger[_0x520c('0x11')](_0x520c('0x22'),_0xd87790,JSON[_0x520c('0x13')](_0x5d96d9));_0xda18ff(_0x5d96d9);})[_0x520c('0x17')](function(_0x1f8a26){logger[_0x520c('0x14')](_0x520c('0x22'),_0x1f8a26[_0x520c('0x15')],_0xd87790);_0x38f49c(_0x3e1051[_0x520c('0x14')](0x1f4,_0x1f8a26[_0x520c('0x15')]));});});};exports['CreateVoiceQueueReport']=function(_0x145f72){var _0x46feb5=this;return new Promise(function(_0x60d669,_0xf8df49){return db[_0x520c('0x23')][_0x520c('0x24')](_0x145f72['body'],{'raw':_0x145f72[_0x520c('0x19')]?_0x145f72['options'][_0x520c('0x1a')]===undefined?!![]:![]:!![]})[_0x520c('0x21')](function(_0x4db7c0){logger[_0x520c('0xe')](_0x520c('0x25'),_0x145f72);logger[_0x520c('0x11')]('CreateVoiceQueueReport',_0x145f72,JSON[_0x520c('0x13')](_0x4db7c0));_0x60d669(_0x4db7c0);})[_0x520c('0x17')](function(_0x3abadb){logger[_0x520c('0x14')](_0x520c('0x25'),_0x3abadb[_0x520c('0x15')],_0x145f72);_0xf8df49(_0x46feb5[_0x520c('0x14')](0x1f4,_0x3abadb[_0x520c('0x15')]));});});};exports[_0x520c('0x26')]=function(_0x598d0b){var _0x4b9d97=this;return new Promise(function(_0x4faba6,_0xe59fc7){return db[_0x520c('0x23')]['update'](_0x598d0b[_0x520c('0x27')],{'raw':_0x598d0b['options']?_0x598d0b[_0x520c('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x598d0b[_0x520c('0x19')]?_0x598d0b[_0x520c('0x19')]['where']||null:null,'attributes':_0x598d0b[_0x520c('0x19')]?_0x598d0b['options'][_0x520c('0x1c')]||null:null,'limit':_0x598d0b[_0x520c('0x19')]?_0x598d0b[_0x520c('0x19')][_0x520c('0x1d')]||null:null})[_0x520c('0x21')](function(_0x257b8a){logger[_0x520c('0xe')](_0x520c('0x26'),_0x598d0b);logger['debug'](_0x520c('0x26'),_0x598d0b,JSON[_0x520c('0x13')](_0x257b8a));_0x4faba6(_0x257b8a);})[_0x520c('0x17')](function(_0x949ba0){logger['error'](_0x520c('0x26'),_0x949ba0['message'],_0x598d0b);_0xe59fc7(_0x4b9d97[_0x520c('0x14')](0x1f4,_0x949ba0[_0x520c('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index f30be2d..e1a5710 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 _0xd67b=['voiceQueueReport:','save','update','emit','register','length'];(function(_0x35d21f,_0x47346b){var _0x30d3d3=function(_0x285762){while(--_0x285762){_0x35d21f['push'](_0x35d21f['shift']());}};_0x30d3d3(++_0x47346b);}(_0xd67b,0x133));var _0xbd67=function(_0x37b0f1,_0x10e550){_0x37b0f1=_0x37b0f1-0x0;var _0x40f5e1=_0xd67b[_0x37b0f1];return _0x40f5e1;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0xbd67('0x0'),'remove',_0xbd67('0x1')];function createListener(_0x280954,_0x317e33){return function(_0x5e967b){_0x317e33[_0xbd67('0x2')](_0x280954,_0x5e967b);};}function removeListener(_0x50da5a,_0x1bf96){return function(){VoiceQueueReportEvents['removeListener'](_0x50da5a,_0x1bf96);};}exports[_0xbd67('0x3')]=function(_0xa5c384){for(var _0x2ad142=0x0,_0x27b016=events[_0xbd67('0x4')];_0x2ad142<_0x27b016;_0x2ad142++){var _0x72f9ac=events[_0x2ad142];var _0x2d4af6=createListener(_0xbd67('0x5')+_0x72f9ac,_0xa5c384);VoiceQueueReportEvents['on'](_0x72f9ac,_0x2d4af6);}}; \ No newline at end of file +var _0xdedc=['remove','update','removeListener','register','./voiceQueueReport.events','save'];(function(_0x418ec7,_0x55d496){var _0x5bf638=function(_0x2b8fad){while(--_0x2b8fad){_0x418ec7['push'](_0x418ec7['shift']());}};_0x5bf638(++_0x55d496);}(_0xdedc,0xb8));var _0xcded=function(_0x4c2623,_0x4838bb){_0x4c2623=_0x4c2623-0x0;var _0x2be431=_0xdedc[_0x4c2623];return _0x2be431;};'use strict';var VoiceQueueReportEvents=require(_0xcded('0x0'));var events=[_0xcded('0x1'),_0xcded('0x2'),_0xcded('0x3')];function createListener(_0x31919f,_0x58406f){return function(_0x9f649a){_0x58406f['emit'](_0x31919f,_0x9f649a);};}function removeListener(_0x46ff39,_0x438e1d){return function(){VoiceQueueReportEvents[_0xcded('0x4')](_0x46ff39,_0x438e1d);};}exports[_0xcded('0x5')]=function(_0x4cbe1b){for(var _0x410b90=0x0,_0x333e61=events['length'];_0x410b90<_0x333e61;_0x410b90++){var _0x21f513=events[_0x410b90];var _0x488df8=createListener('voiceQueueReport:'+_0x21f513,_0x4cbe1b);VoiceQueueReportEvents['on'](_0x21f513,_0x488df8);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 6c2c55b..e9ee994 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 _0xe79a=['path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceQueuesLog.controller','get','index','show','post','create','/:id','delete','isAuthenticated','exports'];(function(_0x17904f,_0x48cfe2){var _0x1b505e=function(_0x42ea3b){while(--_0x42ea3b){_0x17904f['push'](_0x17904f['shift']());}};_0x1b505e(++_0x48cfe2);}(_0xe79a,0x70));var _0xae79=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xe79a[_0x31e29a];return _0x32d892;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xae79('0x0'));var timeout=require('connect-timeout');var express=require(_0xae79('0x1'));var router=express[_0xae79('0x2')]();var fs_extra=require(_0xae79('0x3'));var auth=require(_0xae79('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xae79('0x5'));var controller=require(_0xae79('0x6'));router[_0xae79('0x7')]('/',auth['isAuthenticated'](),controller[_0xae79('0x8')]);router[_0xae79('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xae79('0x9')]);router[_0xae79('0xa')]('/',auth['isAuthenticated'](),controller[_0xae79('0xb')]);router['put'](_0xae79('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xae79('0xd')](_0xae79('0xc'),auth[_0xae79('0xe')](),controller['destroy']);module[_0xae79('0xf')]=router; \ No newline at end of file +var _0x6d26=['fs-extra','../../components/auth/service','./voiceQueuesLog.controller','get','index','/:id','post','create','put','update','isAuthenticated','destroy','exports','multer','util','path','express','Router'];(function(_0x57f100,_0xa53aca){var _0x4cac01=function(_0x447061){while(--_0x447061){_0x57f100['push'](_0x57f100['shift']());}};_0x4cac01(++_0xa53aca);}(_0x6d26,0x1e1));var _0x66d2=function(_0x144fc6,_0x5b97dc){_0x144fc6=_0x144fc6-0x0;var _0x3afb45=_0x6d26[_0x144fc6];return _0x3afb45;};'use strict';var multer=require(_0x66d2('0x0'));var util=require(_0x66d2('0x1'));var path=require(_0x66d2('0x2'));var timeout=require('connect-timeout');var express=require(_0x66d2('0x3'));var router=express[_0x66d2('0x4')]();var fs_extra=require(_0x66d2('0x5'));var auth=require(_0x66d2('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x66d2('0x7'));router[_0x66d2('0x8')]('/',auth['isAuthenticated'](),controller[_0x66d2('0x9')]);router[_0x66d2('0x8')](_0x66d2('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x66d2('0xb')]('/',auth['isAuthenticated'](),controller[_0x66d2('0xc')]);router[_0x66d2('0xd')](_0x66d2('0xa'),auth['isAuthenticated'](),controller[_0x66d2('0xe')]);router['delete'](_0x66d2('0xa'),auth[_0x66d2('0xf')](),controller[_0x66d2('0x10')]);module[_0x66d2('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index b8763ce..488c04c 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 _0x5c09=['moment','exports','STRING','DATE'];(function(_0x54e6f5,_0x4f4e99){var _0x5e8794=function(_0x27512b){while(--_0x27512b){_0x54e6f5['push'](_0x54e6f5['shift']());}};_0x5e8794(++_0x4f4e99);}(_0x5c09,0x1f0));var _0x95c0=function(_0x62264a,_0x506551){_0x62264a=_0x62264a-0x0;var _0x4ac02f=_0x5c09[_0x62264a];return _0x4ac02f;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x95c0('0x0'));module[_0x95c0('0x1')]={'time':{'type':Sequelize[_0x95c0('0x2')]},'callid':{'type':Sequelize[_0x95c0('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x95c0('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x95c0('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x95c0('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x95c0('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x95c0('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x95c0('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x95c0('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x95c0('0x3')],'allowNull':![],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}}; \ No newline at end of file +var _0xc69e=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','exports','STRING'];(function(_0x25e4f5,_0x2c3741){var _0x317b50=function(_0x45c873){while(--_0x45c873){_0x25e4f5['push'](_0x25e4f5['shift']());}};_0x317b50(++_0x2c3741);}(_0xc69e,0x1a7));var _0xec69=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xc69e[_0x46698a];return _0x356db0;};'use strict';var Sequelize=require(_0xec69('0x0'));var moment=require(_0xec69('0x1'));module[_0xec69('0x2')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0xec69('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xec69('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xec69('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xec69('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xec69('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xec69('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xec69('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xec69('0x4')],'allowNull':![],'defaultValue':moment()[_0xec69('0x5')](_0xec69('0x6'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 3d46129..9e650a8 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 _0xf49d=['send','map','VoiceQueuesLog','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','VIRTUAL','merge','options','includeAll','include','findAll','rows','params','length','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','name'];(function(_0x2d2a58,_0x1f8f4b){var _0x451dfb=function(_0x4a1780){while(--_0x4a1780){_0x2d2a58['push'](_0x2d2a58['shift']());}};_0x451dfb(++_0x1f8f4b);}(_0xf49d,0x191));var _0xdf49=function(_0x345169,_0x4a7211){_0x345169=_0x345169-0x0;var _0x2032e1=_0xf49d[_0x345169];return _0x2032e1;};'use strict';var emlformat=require(_0xdf49('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdf49('0x1'));var jsonpatch=require(_0xdf49('0x2'));var rp=require(_0xdf49('0x3'));var moment=require(_0xdf49('0x4'));var BPromise=require(_0xdf49('0x5'));var Mustache=require(_0xdf49('0x6'));var util=require(_0xdf49('0x7'));var path=require('path');var sox=require(_0xdf49('0x8'));var csv=require(_0xdf49('0x9'));var ejs=require(_0xdf49('0xa'));var fs=require('fs');var fs_extra=require(_0xdf49('0xb'));var _=require(_0xdf49('0xc'));var squel=require(_0xdf49('0xd'));var crypto=require('crypto');var jsforce=require(_0xdf49('0xe'));var deskjs=require(_0xdf49('0xf'));var toCsv=require('to-csv');var querystring=require(_0xdf49('0x10'));var Papa=require(_0xdf49('0x11'));var Redis=require(_0xdf49('0x12'));var authService=require(_0xdf49('0x13'));var qs=require(_0xdf49('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xdf49('0x15'))('api');var utils=require(_0xdf49('0x16'));var config=require(_0xdf49('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xdf49('0x18'))['db'];function respondWithStatusCode(_0xcef395,_0x5d02b4){_0x5d02b4=_0x5d02b4||0xcc;return function(_0x42131b){if(_0x42131b){return _0xcef395[_0xdf49('0x19')](_0x5d02b4);}return _0xcef395[_0xdf49('0x1a')](_0x5d02b4)[_0xdf49('0x1b')]();};}function respondWithResult(_0x5ee6b3,_0x10b38e){_0x10b38e=_0x10b38e||0xc8;return function(_0x1ea78f){if(_0x1ea78f){return _0x5ee6b3['status'](_0x10b38e)[_0xdf49('0x1c')](_0x1ea78f);}};}function respondWithFilteredResult(_0x48a532,_0x43647b){return function(_0x4b736c){if(_0x4b736c){var _0x20ee04=typeof _0x43647b[_0xdf49('0x1d')]===_0xdf49('0x1e')&&typeof _0x43647b[_0xdf49('0x1f')]===_0xdf49('0x1e');var _0x44aa09=_0x4b736c['count'];var _0x3194b2=_0x20ee04?0x0:_0x43647b[_0xdf49('0x1d')];var _0xd41daa=_0x20ee04?_0x4b736c[_0xdf49('0x20')]:_0x43647b[_0xdf49('0x1d')]+_0x43647b['limit'];var _0xd5dfa1;if(_0xd41daa>=_0x44aa09){_0xd41daa=_0x44aa09;_0xd5dfa1=0xc8;}else{_0xd5dfa1=0xce;}_0x48a532[_0xdf49('0x1a')](_0xd5dfa1);return _0x48a532[_0xdf49('0x21')](_0xdf49('0x22'),_0x3194b2+'-'+_0xd41daa+'/'+_0x44aa09)[_0xdf49('0x1c')](_0x4b736c);}return null;};}function patchUpdates(_0x14e39a){return function(_0x1bf8a6){try{jsonpatch[_0xdf49('0x23')](_0x1bf8a6,_0x14e39a,!![]);}catch(_0x375f84){return BPromise[_0xdf49('0x24')](_0x375f84);}return _0x1bf8a6[_0xdf49('0x25')]();};}function saveUpdates(_0x5c32a8,_0x1c656d){return function(_0x4f3483){if(_0x4f3483){return _0x4f3483[_0xdf49('0x26')](_0x5c32a8)['then'](function(_0x580e04){return _0x580e04;});}return null;};}function removeEntity(_0x34a92e,_0x70a8f1){return function(_0x4ac0b3){if(_0x4ac0b3){return _0x4ac0b3[_0xdf49('0x27')]()[_0xdf49('0x28')](function(){_0x34a92e['status'](0xcc)[_0xdf49('0x1b')]();});}};}function handleEntityNotFound(_0xda8571,_0x1cf2ac){return function(_0x1826d5){if(!_0x1826d5){_0xda8571['sendStatus'](0x194);}return _0x1826d5;};}function handleError(_0x2a685c,_0x56e7e2){_0x56e7e2=_0x56e7e2||0x1f4;return function(_0x22d817){logger[_0xdf49('0x29')](_0x22d817['stack']);if(_0x22d817['name']){delete _0x22d817[_0xdf49('0x2a')];}_0x2a685c[_0xdf49('0x1a')](_0x56e7e2)[_0xdf49('0x2b')](_0x22d817);};}exports['index']=function(_0x37e1f5,_0x398483){var _0x5657e7={},_0xe73195={},_0x1a879d={'count':0x0,'rows':[]};var _0x2611e7=_[_0xdf49('0x2c')](db[_0xdf49('0x2d')][_0xdf49('0x2e')],function(_0x2ef7dd){return{'name':_0x2ef7dd[_0xdf49('0x2f')],'type':_0x2ef7dd[_0xdf49('0x30')]['key']};});_0xe73195[_0xdf49('0x31')]=_[_0xdf49('0x2c')](_0x2611e7,_0xdf49('0x2a'));_0xe73195['query']=_[_0xdf49('0x32')](_0x37e1f5[_0xdf49('0x33')]);_0xe73195[_0xdf49('0x34')]=_[_0xdf49('0x35')](_0xe73195[_0xdf49('0x31')],_0xe73195['query']);_0x5657e7[_0xdf49('0x36')]=_['intersection'](_0xe73195[_0xdf49('0x31')],qs[_0xdf49('0x37')](_0x37e1f5['query'][_0xdf49('0x37')]));_0x5657e7[_0xdf49('0x36')]=_0x5657e7['attributes']['length']?_0x5657e7[_0xdf49('0x36')]:_0xe73195['model'];if(!_0x37e1f5[_0xdf49('0x33')]['hasOwnProperty'](_0xdf49('0x38'))){_0x5657e7[_0xdf49('0x1f')]=qs[_0xdf49('0x1f')](_0x37e1f5[_0xdf49('0x33')][_0xdf49('0x1f')]);_0x5657e7[_0xdf49('0x1d')]=qs[_0xdf49('0x1d')](_0x37e1f5[_0xdf49('0x33')][_0xdf49('0x1d')]);}_0x5657e7[_0xdf49('0x39')]=qs[_0xdf49('0x3a')](_0x37e1f5[_0xdf49('0x33')]['sort']);_0x5657e7[_0xdf49('0x3b')]=qs[_0xdf49('0x34')](_[_0xdf49('0x3c')](_0x37e1f5[_0xdf49('0x33')],_0xe73195[_0xdf49('0x34')]),_0x2611e7);if(_0x37e1f5[_0xdf49('0x33')]['filter']){_0x5657e7[_0xdf49('0x3b')]=_['merge'](_0x5657e7[_0xdf49('0x3b')],{'$or':_[_0xdf49('0x2c')](_0x2611e7,function(_0x7cd163){if(_0x7cd163[_0xdf49('0x30')]!==_0xdf49('0x3d')){var _0x25815c={};_0x25815c[_0x7cd163['name']]={'$like':'%'+_0x37e1f5[_0xdf49('0x33')]['filter']+'%'};return _0x25815c;}})});}_0x5657e7=_[_0xdf49('0x3e')]({},_0x5657e7,_0x37e1f5[_0xdf49('0x3f')]);var _0x1a9e6e={'where':_0x5657e7[_0xdf49('0x3b')]};return db['VoiceQueuesLog'][_0xdf49('0x20')](_0x1a9e6e)[_0xdf49('0x28')](function(_0x1c30a7){_0x1a879d[_0xdf49('0x20')]=_0x1c30a7;if(_0x37e1f5['query'][_0xdf49('0x40')]){_0x5657e7[_0xdf49('0x41')]=[{'all':!![]}];}return db['VoiceQueuesLog'][_0xdf49('0x42')](_0x5657e7);})[_0xdf49('0x28')](function(_0x59f9a4){_0x1a879d[_0xdf49('0x43')]=_0x59f9a4;return _0x1a879d;})[_0xdf49('0x28')](respondWithFilteredResult(_0x398483,_0x5657e7))['catch'](handleError(_0x398483,null));};exports['show']=function(_0x634c5b,_0x343540){var _0x2b3487={'raw':!![],'where':{'id':_0x634c5b[_0xdf49('0x44')]['id']}},_0x2a90f4={};_0x2a90f4[_0xdf49('0x31')]=_[_0xdf49('0x32')](db[_0xdf49('0x2d')][_0xdf49('0x2e')]);_0x2a90f4[_0xdf49('0x33')]=_[_0xdf49('0x32')](_0x634c5b[_0xdf49('0x33')]);_0x2a90f4['filters']=_[_0xdf49('0x35')](_0x2a90f4['model'],_0x2a90f4['query']);_0x2b3487[_0xdf49('0x36')]=_[_0xdf49('0x35')](_0x2a90f4['model'],qs[_0xdf49('0x37')](_0x634c5b['query'][_0xdf49('0x37')]));_0x2b3487[_0xdf49('0x36')]=_0x2b3487[_0xdf49('0x36')][_0xdf49('0x45')]?_0x2b3487[_0xdf49('0x36')]:_0x2a90f4[_0xdf49('0x31')];if(_0x634c5b[_0xdf49('0x33')][_0xdf49('0x40')]){_0x2b3487[_0xdf49('0x41')]=[{'all':!![]}];}_0x2b3487=_['merge']({},_0x2b3487,_0x634c5b[_0xdf49('0x3f')]);return db['VoiceQueuesLog'][_0xdf49('0x46')](_0x2b3487)[_0xdf49('0x28')](handleEntityNotFound(_0x343540,null))[_0xdf49('0x28')](respondWithResult(_0x343540,null))[_0xdf49('0x47')](handleError(_0x343540,null));};exports[_0xdf49('0x48')]=function(_0x1b9063,_0x54e9f1){return db[_0xdf49('0x2d')][_0xdf49('0x48')](_0x1b9063[_0xdf49('0x49')],{})['then'](respondWithResult(_0x54e9f1,0xc9))[_0xdf49('0x47')](handleError(_0x54e9f1,null));};exports['update']=function(_0x46a5b9,_0x10e8a9){if(_0x46a5b9[_0xdf49('0x49')]['id']){delete _0x46a5b9['body']['id'];}return db['VoiceQueuesLog'][_0xdf49('0x46')]({'where':{'id':_0x46a5b9['params']['id']}})['then'](handleEntityNotFound(_0x10e8a9,null))['then'](saveUpdates(_0x46a5b9['body'],null))[_0xdf49('0x28')](respondWithResult(_0x10e8a9,null))[_0xdf49('0x47')](handleError(_0x10e8a9,null));};exports['destroy']=function(_0x11130e,_0x3401b2){return db[_0xdf49('0x2d')]['find']({'where':{'id':_0x11130e[_0xdf49('0x44')]['id']}})[_0xdf49('0x28')](handleEntityNotFound(_0x3401b2,null))['then'](removeEntity(_0x3401b2,null))['catch'](handleError(_0x3401b2,null));}; \ No newline at end of file +var _0xc685=['hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','send','map','VoiceQueuesLog','rawAttributes','fieldName','model','name','query','keys','filters','intersection','attributes','fields','length'];(function(_0xf50bf,_0x4e1001){var _0x5282ea=function(_0x53288e){while(--_0x53288e){_0xf50bf['push'](_0xf50bf['shift']());}};_0x5282ea(++_0x4e1001);}(_0xc685,0x182));var _0x5c68=function(_0x1a56ca,_0x2e46b1){_0x1a56ca=_0x1a56ca-0x0;var _0x2b0daf=_0xc685[_0x1a56ca];return _0x2b0daf;};'use strict';var emlformat=require(_0x5c68('0x0'));var rimraf=require(_0x5c68('0x1'));var zipdir=require(_0x5c68('0x2'));var jsonpatch=require(_0x5c68('0x3'));var rp=require(_0x5c68('0x4'));var moment=require(_0x5c68('0x5'));var BPromise=require(_0x5c68('0x6'));var Mustache=require(_0x5c68('0x7'));var util=require(_0x5c68('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x5c68('0x9'));var ejs=require(_0x5c68('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5c68('0xb'));var crypto=require('crypto');var jsforce=require(_0x5c68('0xc'));var deskjs=require(_0x5c68('0xd'));var toCsv=require(_0x5c68('0x9'));var querystring=require(_0x5c68('0xe'));var Papa=require(_0x5c68('0xf'));var Redis=require('ioredis');var authService=require(_0x5c68('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5c68('0x11'));var hardwareService=require(_0x5c68('0x12'));var logger=require('../../config/logger')(_0x5c68('0x13'));var utils=require(_0x5c68('0x14'));var config=require(_0x5c68('0x15'));var licenseUtil=require(_0x5c68('0x16'));var db=require(_0x5c68('0x17'))['db'];function respondWithStatusCode(_0x28a454,_0x39ac8f){_0x39ac8f=_0x39ac8f||0xcc;return function(_0x5e9ab0){if(_0x5e9ab0){return _0x28a454[_0x5c68('0x18')](_0x39ac8f);}return _0x28a454[_0x5c68('0x19')](_0x39ac8f)[_0x5c68('0x1a')]();};}function respondWithResult(_0x2c6a35,_0x2cd1c8){_0x2cd1c8=_0x2cd1c8||0xc8;return function(_0x2b5167){if(_0x2b5167){return _0x2c6a35[_0x5c68('0x19')](_0x2cd1c8)[_0x5c68('0x1b')](_0x2b5167);}};}function respondWithFilteredResult(_0x2aa0f1,_0x2d9c21){return function(_0x157041){if(_0x157041){var _0x442ad9=typeof _0x2d9c21[_0x5c68('0x1c')]===_0x5c68('0x1d')&&typeof _0x2d9c21['limit']===_0x5c68('0x1d');var _0x41e17c=_0x157041['count'];var _0x99c067=_0x442ad9?0x0:_0x2d9c21[_0x5c68('0x1c')];var _0x2c7a0a=_0x442ad9?_0x157041[_0x5c68('0x1e')]:_0x2d9c21['offset']+_0x2d9c21['limit'];var _0x35623c;if(_0x2c7a0a>=_0x41e17c){_0x2c7a0a=_0x41e17c;_0x35623c=0xc8;}else{_0x35623c=0xce;}_0x2aa0f1[_0x5c68('0x19')](_0x35623c);return _0x2aa0f1[_0x5c68('0x1f')](_0x5c68('0x20'),_0x99c067+'-'+_0x2c7a0a+'/'+_0x41e17c)[_0x5c68('0x1b')](_0x157041);}return null;};}function patchUpdates(_0x54c216){return function(_0x4e50de){try{jsonpatch[_0x5c68('0x21')](_0x4e50de,_0x54c216,!![]);}catch(_0x236b4f){return BPromise['reject'](_0x236b4f);}return _0x4e50de[_0x5c68('0x22')]();};}function saveUpdates(_0x41c0f1,_0xefa65){return function(_0x101330){if(_0x101330){return _0x101330[_0x5c68('0x23')](_0x41c0f1)[_0x5c68('0x24')](function(_0x3fd36d){return _0x3fd36d;});}return null;};}function removeEntity(_0x5f0d14,_0x2839dd){return function(_0x158468){if(_0x158468){return _0x158468[_0x5c68('0x25')]()[_0x5c68('0x24')](function(){_0x5f0d14[_0x5c68('0x19')](0xcc)[_0x5c68('0x1a')]();});}};}function handleEntityNotFound(_0x36800d,_0x34773f){return function(_0x1fced7){if(!_0x1fced7){_0x36800d[_0x5c68('0x18')](0x194);}return _0x1fced7;};}function handleError(_0x26da1,_0x29014d){_0x29014d=_0x29014d||0x1f4;return function(_0x1b77f8){logger['error'](_0x1b77f8['stack']);if(_0x1b77f8['name']){delete _0x1b77f8['name'];}_0x26da1[_0x5c68('0x19')](_0x29014d)[_0x5c68('0x26')](_0x1b77f8);};}exports['index']=function(_0xe46bc3,_0x550bbc){var _0x5c0b56={},_0x5a14f0={},_0x4831a6={'count':0x0,'rows':[]};var _0x21c4cf=_[_0x5c68('0x27')](db[_0x5c68('0x28')][_0x5c68('0x29')],function(_0x3262fc){return{'name':_0x3262fc[_0x5c68('0x2a')],'type':_0x3262fc['type']['key']};});_0x5a14f0[_0x5c68('0x2b')]=_[_0x5c68('0x27')](_0x21c4cf,_0x5c68('0x2c'));_0x5a14f0[_0x5c68('0x2d')]=_[_0x5c68('0x2e')](_0xe46bc3[_0x5c68('0x2d')]);_0x5a14f0[_0x5c68('0x2f')]=_[_0x5c68('0x30')](_0x5a14f0['model'],_0x5a14f0[_0x5c68('0x2d')]);_0x5c0b56[_0x5c68('0x31')]=_[_0x5c68('0x30')](_0x5a14f0[_0x5c68('0x2b')],qs[_0x5c68('0x32')](_0xe46bc3[_0x5c68('0x2d')][_0x5c68('0x32')]));_0x5c0b56[_0x5c68('0x31')]=_0x5c0b56[_0x5c68('0x31')][_0x5c68('0x33')]?_0x5c0b56['attributes']:_0x5a14f0[_0x5c68('0x2b')];if(!_0xe46bc3['query'][_0x5c68('0x34')](_0x5c68('0x35'))){_0x5c0b56[_0x5c68('0x36')]=qs[_0x5c68('0x36')](_0xe46bc3[_0x5c68('0x2d')][_0x5c68('0x36')]);_0x5c0b56['offset']=qs[_0x5c68('0x1c')](_0xe46bc3[_0x5c68('0x2d')]['offset']);}_0x5c0b56[_0x5c68('0x37')]=qs[_0x5c68('0x38')](_0xe46bc3[_0x5c68('0x2d')][_0x5c68('0x38')]);_0x5c0b56['where']=qs['filters'](_[_0x5c68('0x39')](_0xe46bc3[_0x5c68('0x2d')],_0x5a14f0[_0x5c68('0x2f')]),_0x21c4cf);if(_0xe46bc3[_0x5c68('0x2d')][_0x5c68('0x3a')]){_0x5c0b56[_0x5c68('0x3b')]=_[_0x5c68('0x3c')](_0x5c0b56['where'],{'$or':_[_0x5c68('0x27')](_0x21c4cf,function(_0x415ea7){if(_0x415ea7[_0x5c68('0x3d')]!==_0x5c68('0x3e')){var _0x2d45de={};_0x2d45de[_0x415ea7[_0x5c68('0x2c')]]={'$like':'%'+_0xe46bc3[_0x5c68('0x2d')][_0x5c68('0x3a')]+'%'};return _0x2d45de;}})});}_0x5c0b56=_[_0x5c68('0x3c')]({},_0x5c0b56,_0xe46bc3[_0x5c68('0x3f')]);var _0x13cd1f={'where':_0x5c0b56[_0x5c68('0x3b')]};return db[_0x5c68('0x28')][_0x5c68('0x1e')](_0x13cd1f)[_0x5c68('0x24')](function(_0x140e31){_0x4831a6[_0x5c68('0x1e')]=_0x140e31;if(_0xe46bc3['query'][_0x5c68('0x40')]){_0x5c0b56[_0x5c68('0x41')]=[{'all':!![]}];}return db[_0x5c68('0x28')][_0x5c68('0x42')](_0x5c0b56);})[_0x5c68('0x24')](function(_0x44bc05){_0x4831a6[_0x5c68('0x43')]=_0x44bc05;return _0x4831a6;})[_0x5c68('0x24')](respondWithFilteredResult(_0x550bbc,_0x5c0b56))['catch'](handleError(_0x550bbc,null));};exports[_0x5c68('0x44')]=function(_0x34a651,_0xb83897){var _0x59b32f={'raw':!![],'where':{'id':_0x34a651[_0x5c68('0x45')]['id']}},_0x5b7a24={};_0x5b7a24['model']=_[_0x5c68('0x2e')](db['VoiceQueuesLog']['rawAttributes']);_0x5b7a24[_0x5c68('0x2d')]=_['keys'](_0x34a651[_0x5c68('0x2d')]);_0x5b7a24['filters']=_[_0x5c68('0x30')](_0x5b7a24[_0x5c68('0x2b')],_0x5b7a24[_0x5c68('0x2d')]);_0x59b32f['attributes']=_['intersection'](_0x5b7a24[_0x5c68('0x2b')],qs[_0x5c68('0x32')](_0x34a651[_0x5c68('0x2d')][_0x5c68('0x32')]));_0x59b32f['attributes']=_0x59b32f[_0x5c68('0x31')][_0x5c68('0x33')]?_0x59b32f['attributes']:_0x5b7a24[_0x5c68('0x2b')];if(_0x34a651[_0x5c68('0x2d')][_0x5c68('0x40')]){_0x59b32f[_0x5c68('0x41')]=[{'all':!![]}];}_0x59b32f=_[_0x5c68('0x3c')]({},_0x59b32f,_0x34a651[_0x5c68('0x3f')]);return db[_0x5c68('0x28')]['find'](_0x59b32f)[_0x5c68('0x24')](handleEntityNotFound(_0xb83897,null))[_0x5c68('0x24')](respondWithResult(_0xb83897,null))[_0x5c68('0x46')](handleError(_0xb83897,null));};exports[_0x5c68('0x47')]=function(_0x2fd207,_0x53ac3f){return db[_0x5c68('0x28')][_0x5c68('0x47')](_0x2fd207['body'],{})[_0x5c68('0x24')](respondWithResult(_0x53ac3f,0xc9))[_0x5c68('0x46')](handleError(_0x53ac3f,null));};exports[_0x5c68('0x23')]=function(_0x3cc095,_0x54213f){if(_0x3cc095[_0x5c68('0x48')]['id']){delete _0x3cc095[_0x5c68('0x48')]['id'];}return db[_0x5c68('0x28')]['find']({'where':{'id':_0x3cc095[_0x5c68('0x45')]['id']}})[_0x5c68('0x24')](handleEntityNotFound(_0x54213f,null))['then'](saveUpdates(_0x3cc095[_0x5c68('0x48')],null))[_0x5c68('0x24')](respondWithResult(_0x54213f,null))[_0x5c68('0x46')](handleError(_0x54213f,null));};exports[_0x5c68('0x25')]=function(_0x252951,_0xb9ec7f){return db[_0x5c68('0x28')]['find']({'where':{'id':_0x252951['params']['id']}})[_0x5c68('0x24')](handleEntityNotFound(_0xb9ec7f,null))[_0x5c68('0x24')](removeEntity(_0xb9ec7f,null))[_0x5c68('0x46')](handleError(_0xb9ec7f,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 4ab096e..7ef9923 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 _0x3669=['request-promise','path','rimraf','./voiceQueuesLog.attributes','exports','define','dtm','lodash','util'];(function(_0x2dd7e9,_0x334905){var _0x54c502=function(_0x3b90e8){while(--_0x3b90e8){_0x2dd7e9['push'](_0x2dd7e9['shift']());}};_0x54c502(++_0x334905);}(_0x3669,0x166));var _0x9366=function(_0x3877ab,_0x443f6a){_0x3877ab=_0x3877ab-0x0;var _0x2fc0ac=_0x3669[_0x3877ab];return _0x2fc0ac;};'use strict';var _=require(_0x9366('0x0'));var util=require(_0x9366('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9366('0x2'));var fs=require('fs');var path=require(_0x9366('0x3'));var rimraf=require(_0x9366('0x4'));var config=require('../../config/environment');var attributes=require(_0x9366('0x5'));module[_0x9366('0x6')]=function(_0x4abc52,_0x1acb9d){return _0x4abc52[_0x9366('0x7')]('VoiceQueuesLog',attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':'event_dtm','fields':['event',_0x9366('0x8')]}],'timestamps':![]});}; \ No newline at end of file +var _0xe735=['lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event','dtm'];(function(_0x4c18f2,_0x1c4824){var _0x17cec7=function(_0x2c23f4){while(--_0x2c23f4){_0x4c18f2['push'](_0x4c18f2['shift']());}};_0x17cec7(++_0x1c4824);}(_0xe735,0xc4));var _0x5e73=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0xe735[_0x35885a];return _0xe86249;};'use strict';var _=require(_0x5e73('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5e73('0x1'));var moment=require(_0x5e73('0x2'));var BPromise=require(_0x5e73('0x3'));var rp=require(_0x5e73('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5e73('0x5'));var config=require(_0x5e73('0x6'));var attributes=require(_0x5e73('0x7'));module[_0x5e73('0x8')]=function(_0x2f0157,_0x5833da){return _0x2f0157[_0x5e73('0x9')](_0x5e73('0xa'),attributes,{'tableName':_0x5e73('0xb'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0x5e73('0xc'),_0x5e73('0xd')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 368ff6d..791c5c3 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 _0x0eec=['jayson/promise','http','request','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4f5163,_0x34cd1e){var _0x47cc8a=function(_0x3bb03d){while(--_0x3bb03d){_0x4f5163['push'](_0x4f5163['shift']());}};_0x47cc8a(++_0x34cd1e);}(_0x0eec,0xac));var _0xc0ee=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0eec[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xc0ee('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc0ee('0x1'));var rs=require(_0xc0ee('0x2'));var fs=require('fs');var Redis=require(_0xc0ee('0x3'));var db=require(_0xc0ee('0x4'))['db'];var utils=require(_0xc0ee('0x5'));var logger=require(_0xc0ee('0x6'))(_0xc0ee('0x7'));var config=require('../../config/environment');var jayson=require(_0xc0ee('0x8'));var client=jayson['client'][_0xc0ee('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x39022a,_0x2d364d,_0x3aaca5){return new BPromise(function(_0x38b387,_0x1d9dca){return client[_0xc0ee('0xa')](_0x39022a,_0x3aaca5)['then'](function(_0x141f4a){logger[_0xc0ee('0xb')](_0xc0ee('0xc'),_0x2d364d,_0xc0ee('0xd'));logger[_0xc0ee('0xe')](_0xc0ee('0xf'),_0x2d364d,_0xc0ee('0xd'),JSON['stringify'](_0x141f4a));if(_0x141f4a[_0xc0ee('0x10')]){if(_0x141f4a[_0xc0ee('0x10')][_0xc0ee('0x11')]===0x1f4){logger[_0xc0ee('0x10')](_0xc0ee('0xc'),_0x2d364d,_0x141f4a[_0xc0ee('0x10')][_0xc0ee('0x12')]);return _0x1d9dca(_0x141f4a[_0xc0ee('0x10')][_0xc0ee('0x12')]);}logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x2d364d,_0x141f4a[_0xc0ee('0x10')][_0xc0ee('0x12')]);return _0x38b387(_0x141f4a[_0xc0ee('0x10')]['message']);}else{logger[_0xc0ee('0xb')](_0xc0ee('0xc'),_0x2d364d,_0xc0ee('0xd'));_0x38b387(_0x141f4a['result']['message']);}})[_0xc0ee('0x13')](function(_0x4dc6de){logger[_0xc0ee('0x10')](_0xc0ee('0xc'),_0x2d364d,_0x4dc6de);_0x1d9dca(_0x4dc6de);});});} \ No newline at end of file +var _0x2f38=['message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x547653,_0x90f3be){var _0x3b79b0=function(_0x22e12f){while(--_0x22e12f){_0x547653['push'](_0x547653['shift']());}};_0x3b79b0(++_0x90f3be);}(_0x2f38,0x1a7));var _0x82f3=function(_0x4d6411,_0x3be254){_0x4d6411=_0x4d6411-0x0;var _0x1c0869=_0x2f38[_0x4d6411];return _0x1c0869;};'use strict';var _=require('lodash');var util=require(_0x82f3('0x0'));var moment=require('moment');var BPromise=require(_0x82f3('0x1'));var rs=require(_0x82f3('0x2'));var fs=require('fs');var Redis=require(_0x82f3('0x3'));var db=require(_0x82f3('0x4'))['db'];var utils=require(_0x82f3('0x5'));var logger=require(_0x82f3('0x6'))('rpc');var config=require(_0x82f3('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x82f3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1c09a0,_0x28c7f0,_0x2c69d2){return new BPromise(function(_0x659a85,_0x427ef6){return client[_0x82f3('0x9')](_0x1c09a0,_0x2c69d2)[_0x82f3('0xa')](function(_0xb445a3){logger[_0x82f3('0xb')](_0x82f3('0xc'),_0x28c7f0,_0x82f3('0xd'));logger[_0x82f3('0xe')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x28c7f0,_0x82f3('0xd'),JSON[_0x82f3('0xf')](_0xb445a3));if(_0xb445a3[_0x82f3('0x10')]){if(_0xb445a3[_0x82f3('0x10')][_0x82f3('0x11')]===0x1f4){logger[_0x82f3('0x10')](_0x82f3('0xc'),_0x28c7f0,_0xb445a3['error']['message']);return _0x427ef6(_0xb445a3[_0x82f3('0x10')][_0x82f3('0x12')]);}logger['error'](_0x82f3('0xc'),_0x28c7f0,_0xb445a3[_0x82f3('0x10')][_0x82f3('0x12')]);return _0x659a85(_0xb445a3[_0x82f3('0x10')][_0x82f3('0x12')]);}else{logger[_0x82f3('0xb')]('VoiceQueuesLog,\x20%s,\x20%s',_0x28c7f0,_0x82f3('0xd'));_0x659a85(_0xb445a3[_0x82f3('0x13')][_0x82f3('0x12')]);}})[_0x82f3('0x14')](function(_0x4d1a2d){logger[_0x82f3('0x10')]('VoiceQueuesLog,\x20%s,\x20%s',_0x28c7f0,_0x4d1a2d);_0x427ef6(_0x4d1a2d);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 5363d54..e11f1c6 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 _0x6926=['create','runTranscribe','update','destroy','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','index','isAuthenticated','describe','/:id','show','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post'];(function(_0x5311e8,_0x57c5bb){var _0x582ad8=function(_0x1909af){while(--_0x1909af){_0x5311e8['push'](_0x5311e8['shift']());}};_0x582ad8(++_0x57c5bb);}(_0x6926,0x124));var _0x6692=function(_0x28dc26,_0x111437){_0x28dc26=_0x28dc26-0x0;var _0x4bdf26=_0x6926[_0x28dc26];return _0x4bdf26;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6692('0x0'));var timeout=require(_0x6692('0x1'));var express=require(_0x6692('0x2'));var router=express[_0x6692('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6692('0x4'));var config=require(_0x6692('0x5'));var controller=require(_0x6692('0x6'));router[_0x6692('0x7')]('/',auth['isAuthenticated'](),controller[_0x6692('0x8')]);router[_0x6692('0x7')]('/describe',auth[_0x6692('0x9')](),controller[_0x6692('0xa')]);router[_0x6692('0x7')](_0x6692('0xb'),auth[_0x6692('0x9')](),controller[_0x6692('0xc')]);router[_0x6692('0x7')](_0x6692('0xd'),auth[_0x6692('0x9')](),controller[_0x6692('0xe')]);router[_0x6692('0x7')](_0x6692('0xf'),controller[_0x6692('0x10')]);router[_0x6692('0x7')](_0x6692('0x11'),auth[_0x6692('0x9')](),controller[_0x6692('0x12')]);router[_0x6692('0x13')]('/',auth['isAuthenticated'](),controller[_0x6692('0x14')]);router[_0x6692('0x13')](_0x6692('0x11'),auth['isAuthenticated'](),controller[_0x6692('0x15')]);router['put'](_0x6692('0xb'),auth[_0x6692('0x9')](),controller[_0x6692('0x16')]);router['delete'](_0x6692('0xb'),auth[_0x6692('0x9')](),controller[_0x6692('0x17')]);module['exports']=router; \ No newline at end of file +var _0x7650=['../../config/environment','./voiceRecording.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/download','/:id/downloads','downloads','/:id/transcribe','post','create','runTranscribe','put','update','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x5a6de3,_0x37fa19){var _0x5c65d4=function(_0x29944e){while(--_0x29944e){_0x5a6de3['push'](_0x5a6de3['shift']());}};_0x5c65d4(++_0x37fa19);}(_0x7650,0x117));var _0x0765=function(_0x2b59f5,_0x55c323){_0x2b59f5=_0x2b59f5-0x0;var _0x3d0d12=_0x7650[_0x2b59f5];return _0x3d0d12;};'use strict';var multer=require(_0x0765('0x0'));var util=require(_0x0765('0x1'));var path=require(_0x0765('0x2'));var timeout=require(_0x0765('0x3'));var express=require(_0x0765('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0765('0x5'));var interaction=require(_0x0765('0x6'));var config=require(_0x0765('0x7'));var controller=require(_0x0765('0x8'));router[_0x0765('0x9')]('/',auth[_0x0765('0xa')](),controller['index']);router[_0x0765('0x9')](_0x0765('0xb'),auth['isAuthenticated'](),controller[_0x0765('0xc')]);router[_0x0765('0x9')](_0x0765('0xd'),auth['isAuthenticated'](),controller[_0x0765('0xe')]);router[_0x0765('0x9')](_0x0765('0xf'),auth['isAuthenticated'](),controller['download']);router[_0x0765('0x9')](_0x0765('0x10'),controller[_0x0765('0x11')]);router[_0x0765('0x9')](_0x0765('0x12'),auth[_0x0765('0xa')](),controller['downloadTranscribe']);router[_0x0765('0x13')]('/',auth['isAuthenticated'](),controller[_0x0765('0x14')]);router['post'](_0x0765('0x12'),auth[_0x0765('0xa')](),controller[_0x0765('0x15')]);router[_0x0765('0x16')]('/:id',auth[_0x0765('0xa')](),controller[_0x0765('0x17')]);router[_0x0765('0x18')](_0x0765('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x0765('0x19')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 20beaa4..75b93cf 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(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'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(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'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 35d01b4..ed8df20 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 _0x072d=['readFileSync','Location','bucket','Bucket','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobStatus','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribeRegion','language','runSentiment','sentimentRegion','transcribeAccountId','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','transcribeStatus','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','aws-sdk','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','json','apply','save','update','then','destroy','error','index','map','rawAttributes','fieldName','type','key','differenceBy','name','format','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','VoiceRecording','includeAll','include','findAll','rows','show','params','find','body','catch','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','decryptFile','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','send','Not\x20found','sequelize','MD5','col','token','$and','push','existsSync','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','listBuckets','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x072d,0x1ce));var _0xd072=function(_0x14b5a5,_0x231b3a){_0x14b5a5=_0x14b5a5-0x0;var _0x2a7706=_0x072d[_0x14b5a5];return _0x2a7706;};'use strict';var emlformat=require(_0xd072('0x0'));var rimraf=require(_0xd072('0x1'));var zipdir=require(_0xd072('0x2'));var jsonpatch=require(_0xd072('0x3'));var rp=require(_0xd072('0x4'));var moment=require('moment');var BPromise=require(_0xd072('0x5'));var Mustache=require(_0xd072('0x6'));var util=require(_0xd072('0x7'));var path=require(_0xd072('0x8'));var sox=require(_0xd072('0x9'));var csv=require(_0xd072('0xa'));var ejs=require(_0xd072('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd072('0xc'));var squel=require(_0xd072('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd072('0xe'));var toCsv=require(_0xd072('0xa'));var querystring=require(_0xd072('0xf'));var Papa=require('papaparse');var AWS=require(_0xd072('0x10'));var uuidv4=require('uuid/v4');var Redis=require('ioredis');var authService=require(_0xd072('0x11'));var qs=require(_0xd072('0x12'));var as=require(_0xd072('0x13'));var hardwareService=require(_0xd072('0x14'));var logger=require('../../config/logger')(_0xd072('0x15'));var utils=require('../../config/utils');var config=require(_0xd072('0x16'));var licenseUtil=require(_0xd072('0x17'));var db=require(_0xd072('0x18'))['db'];function respondWithStatusCode(_0x448247,_0x42fe2c){_0x42fe2c=_0x42fe2c||0xcc;return function(_0xf0d648){if(_0xf0d648){return _0x448247[_0xd072('0x19')](_0x42fe2c);}return _0x448247[_0xd072('0x1a')](_0x42fe2c)[_0xd072('0x1b')]();};}function respondWithResult(_0x5044e0,_0x1678f3){_0x1678f3=_0x1678f3||0xc8;return function(_0x4dd7c6){if(_0x4dd7c6){return _0x5044e0[_0xd072('0x1a')](_0x1678f3)['json'](_0x4dd7c6);}};}function respondWithFilteredResult(_0x5e1232,_0x4cdc27){return function(_0x3fec94){if(_0x3fec94){var _0x2f855a=typeof _0x4cdc27[_0xd072('0x1c')]===_0xd072('0x1d')&&typeof _0x4cdc27[_0xd072('0x1e')]==='undefined';var _0x398f81=_0x3fec94[_0xd072('0x1f')];var _0x11888e=_0x2f855a?0x0:_0x4cdc27[_0xd072('0x1c')];var _0x49c8ff=_0x2f855a?_0x3fec94['count']:_0x4cdc27['offset']+_0x4cdc27[_0xd072('0x1e')];var _0x1a586d;if(_0x49c8ff>=_0x398f81){_0x49c8ff=_0x398f81;_0x1a586d=0xc8;}else{_0x1a586d=0xce;}_0x5e1232['status'](_0x1a586d);return _0x5e1232['set']('Content-Range',_0x11888e+'-'+_0x49c8ff+'/'+_0x398f81)[_0xd072('0x20')](_0x3fec94);}return null;};}function patchUpdates(_0x4413e1){return function(_0x53a080){try{jsonpatch[_0xd072('0x21')](_0x53a080,_0x4413e1,!![]);}catch(_0xe0e05d){return BPromise['reject'](_0xe0e05d);}return _0x53a080[_0xd072('0x22')]();};}function saveUpdates(_0x5de8ad,_0x12d469){return function(_0xeb8bc7){if(_0xeb8bc7){return _0xeb8bc7[_0xd072('0x23')](_0x5de8ad)[_0xd072('0x24')](function(_0x3e6866){return _0x3e6866;});}return null;};}function removeEntity(_0xd71fa,_0x3934bb){return function(_0x35cdd8){if(_0x35cdd8){return _0x35cdd8[_0xd072('0x25')]()[_0xd072('0x24')](function(){_0xd71fa[_0xd072('0x1a')](0xcc)[_0xd072('0x1b')]();});}};}function handleEntityNotFound(_0x3795ed,_0x220785){return function(_0xdad7e2){if(!_0xdad7e2){_0x3795ed[_0xd072('0x19')](0x194);}return _0xdad7e2;};}function handleError(_0x3d5c06,_0x6310b9){_0x6310b9=_0x6310b9||0x1f4;return function(_0x1b6203){logger[_0xd072('0x26')](_0x1b6203['stack']);if(_0x1b6203['name']){delete _0x1b6203['name'];}_0x3d5c06[_0xd072('0x1a')](_0x6310b9)['send'](_0x1b6203);};}exports[_0xd072('0x27')]=function(_0xd39fcc,_0x23968a){var _0x45ca3e={},_0x32d599={},_0x101b20={'count':0x0,'rows':[]};var _0x18ed29=_[_0xd072('0x28')](db['VoiceRecording'][_0xd072('0x29')],function(_0x27d12e){return{'name':_0x27d12e[_0xd072('0x2a')],'type':_0x27d12e[_0xd072('0x2b')][_0xd072('0x2c')]};});_0x32d599['model']=_[_0xd072('0x2d')](_[_0xd072('0x28')](_0x18ed29,_0xd072('0x2e')),[_0xd072('0x2f')]);_0x32d599[_0xd072('0x30')]=_['keys'](_0xd39fcc[_0xd072('0x30')]);_0x32d599[_0xd072('0x31')]=_[_0xd072('0x32')](_0x32d599['model'],_0x32d599['query']);_0x45ca3e[_0xd072('0x33')]=_['intersection'](_0x32d599[_0xd072('0x34')],qs['fields'](_0xd39fcc[_0xd072('0x30')][_0xd072('0x35')]));_0x45ca3e[_0xd072('0x33')]=_0x45ca3e[_0xd072('0x33')][_0xd072('0x36')]?_0x45ca3e[_0xd072('0x33')]:_0x32d599[_0xd072('0x34')];if(!_0xd39fcc['query'][_0xd072('0x37')](_0xd072('0x38'))){_0x45ca3e[_0xd072('0x1e')]=qs[_0xd072('0x1e')](_0xd39fcc[_0xd072('0x30')]['limit']);_0x45ca3e[_0xd072('0x1c')]=qs[_0xd072('0x1c')](_0xd39fcc['query'][_0xd072('0x1c')]);}_0x45ca3e[_0xd072('0x39')]=qs[_0xd072('0x3a')](_0xd39fcc['query'][_0xd072('0x3a')]);_0x45ca3e[_0xd072('0x3b')]=qs[_0xd072('0x31')](_[_0xd072('0x3c')](_0xd39fcc[_0xd072('0x30')],_0x32d599[_0xd072('0x31')]),_0x18ed29);if(_0xd39fcc[_0xd072('0x30')][_0xd072('0x3d')]){_0x45ca3e['where']=_[_0xd072('0x3e')](_0x45ca3e[_0xd072('0x3b')],{'$or':_[_0xd072('0x28')](_0x18ed29,function(_0x53c7e0){if(_0x53c7e0[_0xd072('0x2b')]!==_0xd072('0x3f')){var _0x23bb10={};_0x23bb10[_0x53c7e0['name']]={'$like':'%'+_0xd39fcc[_0xd072('0x30')][_0xd072('0x3d')]+'%'};return _0x23bb10;}})});}_0x45ca3e=_['merge']({},_0x45ca3e,_0xd39fcc['options']);var _0x27dd3d={'where':_0x45ca3e[_0xd072('0x3b')]};return db[_0xd072('0x40')][_0xd072('0x1f')](_0x27dd3d)[_0xd072('0x24')](function(_0x4bc72c){_0x101b20[_0xd072('0x1f')]=_0x4bc72c;if(_0xd39fcc[_0xd072('0x30')][_0xd072('0x41')]){_0x45ca3e[_0xd072('0x42')]=[{'all':!![]}];}return db[_0xd072('0x40')][_0xd072('0x43')](_0x45ca3e);})[_0xd072('0x24')](function(_0x6ff2a8){_0x101b20[_0xd072('0x44')]=_0x6ff2a8;return _0x101b20;})[_0xd072('0x24')](respondWithFilteredResult(_0x23968a,_0x45ca3e))['catch'](handleError(_0x23968a,null));};exports[_0xd072('0x45')]=function(_0x316855,_0x3839ab){var _0x2c3cc9={'raw':![],'where':{'id':_0x316855[_0xd072('0x46')]['id']}},_0x503811={};_0x503811[_0xd072('0x34')]=_['keys'](db[_0xd072('0x40')][_0xd072('0x29')]);_0x503811[_0xd072('0x30')]=_['keys'](_0x316855[_0xd072('0x30')]);_0x503811[_0xd072('0x31')]=_['intersection'](_0x503811[_0xd072('0x34')],_0x503811[_0xd072('0x30')]);_0x2c3cc9['attributes']=_[_0xd072('0x32')](_0x503811[_0xd072('0x34')],qs[_0xd072('0x35')](_0x316855['query']['fields']));_0x2c3cc9[_0xd072('0x33')]=_0x2c3cc9[_0xd072('0x33')][_0xd072('0x36')]?_0x2c3cc9[_0xd072('0x33')]:_0x503811[_0xd072('0x34')];if(_0x316855['query'][_0xd072('0x41')]){_0x2c3cc9['include']=[{'all':!![]}];}_0x2c3cc9=_[_0xd072('0x3e')]({},_0x2c3cc9,_0x316855['options']);return db[_0xd072('0x40')][_0xd072('0x47')](_0x2c3cc9)[_0xd072('0x24')](handleEntityNotFound(_0x3839ab,null))['then'](respondWithResult(_0x3839ab,null))['catch'](handleError(_0x3839ab,null));};exports['create']=function(_0x50f912,_0x1f5fab){return db['VoiceRecording']['create'](_0x50f912[_0xd072('0x48')],{})['then'](respondWithResult(_0x1f5fab,0xc9))[_0xd072('0x49')](handleError(_0x1f5fab,null));};exports[_0xd072('0x23')]=function(_0x37f0bf,_0x451624){if(_0x37f0bf['body']['id']){delete _0x37f0bf['body']['id'];}return db[_0xd072('0x40')][_0xd072('0x47')]({'where':{'id':_0x37f0bf['params']['id']}})['then'](handleEntityNotFound(_0x451624,null))['then'](saveUpdates(_0x37f0bf['body'],null))[_0xd072('0x24')](respondWithResult(_0x451624,null))[_0xd072('0x49')](handleError(_0x451624,null));};exports[_0xd072('0x4a')]=function(_0x15c394,_0x3782c7){return db[_0xd072('0x40')][_0xd072('0x4a')]()['then'](respondWithResult(_0x3782c7,null))[_0xd072('0x49')](handleError(_0x3782c7,null));};exports[_0xd072('0x4b')]=function(_0x5bb0c1,_0x24d75e,_0x1fcb51){var _0x1a8499=require(_0xd072('0x4c'));var _0x2fbb06=![];var _0x1570c9={};if(_0x5bb0c1[_0xd072('0x30')]['type']&&_0x5bb0c1['query'][_0xd072('0x2b')]===_0xd072('0x4d')){_0x1570c9[_0xd072('0x4d')]=_0x5bb0c1[_0xd072('0x46')]['id'];}else{_0x1570c9['id']=_0x5bb0c1['params']['id'];}return db[_0xd072('0x40')][_0xd072('0x47')]({'where':_0x1570c9,'attributes':['id',_0xd072('0x4e')],'raw':!![]})[_0xd072('0x24')](handleEntityNotFound(_0x24d75e,null))[_0xd072('0x24')](function(_0x559e36){if(_0x559e36){var _0x556c69=_0x559e36['value'];var _0x24b51a=util['format'](_0xd072('0x4f'),_0x556c69);if(fs['existsSync'](_0x24b51a)){_0x2fbb06=!![];return _0x1a8499[_0xd072('0x50')](_0x24b51a,_0x556c69,config[_0xd072('0x51')][_0xd072('0x52')])[_0xd072('0x24')](function(){return _0x559e36;});}return _0x559e36;}})[_0xd072('0x24')](function(_0x29c067){if(_0x29c067){var _0x1dfc12=_0x29c067[_0xd072('0x4e')];if(!fs['existsSync'](_0x1dfc12)){throw new db[(_0xd072('0x53'))][(_0xd072('0x54'))](_0xd072('0x55'));}if(_0x29c067['filename']){return _0x24d75e[_0xd072('0x4b')](_0x1dfc12,_0x29c067[_0xd072('0x56')]+path[_0xd072('0x57')](_0x1dfc12),function(){if(_0x2fbb06){fs['unlink'](_0x1dfc12);}});}else{return _0x24d75e[_0xd072('0x4b')](_0x1dfc12,function(_0x4f90eb){if(_0x2fbb06){fs['unlink'](_0x1dfc12);}});}}})['catch'](function(_0x47dc07){if(_0x47dc07['message']==='VoiceRecording\x20not\x20found'){_0x24d75e[_0xd072('0x1a')](0x194)[_0xd072('0x58')](_0xd072('0x59'));}else{return handleError(_0x24d75e,null);}});};exports['downloads']=function(_0x224636,_0x2ebe41,_0x1815e0){var _0x3b43f9=require(_0xd072('0x4c'));var _0x164b50=![];var _0x4c82f8={'$and':[db[_0xd072('0x5a')][_0xd072('0x3b')](db[_0xd072('0x5a')]['fn'](_0xd072('0x5b'),db[_0xd072('0x5a')][_0xd072('0x5c')]('uniqueid')),_0x224636[_0xd072('0x30')][_0xd072('0x5d')])]};if(_0x224636[_0xd072('0x30')][_0xd072('0x2b')]&&_0x224636['query'][_0xd072('0x2b')]===_0xd072('0x4d')){_0x4c82f8[_0xd072('0x5e')][_0xd072('0x5f')]({'uniqueid':_0x224636[_0xd072('0x46')]['id']});}else{_0x4c82f8[_0xd072('0x5e')][_0xd072('0x5f')]({'id':_0x224636[_0xd072('0x46')]['id']});}return db[_0xd072('0x40')]['find']({'where':_0x4c82f8,'attributes':['id',_0xd072('0x4e')],'raw':!![]})[_0xd072('0x24')](handleEntityNotFound(_0x2ebe41,null))[_0xd072('0x24')](function(_0x3ee6f5){if(_0x3ee6f5){var _0x5c98ce=util[_0xd072('0x2f')](_0xd072('0x4f'),_0x3ee6f5[_0xd072('0x4e')]);if(fs['existsSync'](_0x5c98ce)){_0x164b50=!![];return _0x3b43f9['decryptFile'](_0x5c98ce,_0x3ee6f5[_0xd072('0x4e')],config['secrets'][_0xd072('0x52')])[_0xd072('0x24')](function(){return _0x3ee6f5;});}return _0x3ee6f5;}})[_0xd072('0x24')](function(_0x990aff){if(_0x990aff){if(!fs[_0xd072('0x60')](_0x990aff['value'])){throw new db[(_0xd072('0x53'))][(_0xd072('0x54'))](_0xd072('0x55'));}if(_0x990aff[_0xd072('0x56')]){return _0x2ebe41[_0xd072('0x4b')](_0x990aff[_0xd072('0x4e')],_0x990aff['filename']+path[_0xd072('0x57')](_0x990aff[_0xd072('0x4e')]),function(){if(_0x164b50){fs['unlink'](_0x990aff[_0xd072('0x4e')]);}});}else{return _0x2ebe41[_0xd072('0x4b')](_0x990aff[_0xd072('0x4e')],function(_0x34b4c8){if(_0x164b50){fs['unlink'](_0x990aff[_0xd072('0x4e')]);}});}}})[_0xd072('0x49')](handleError(_0x2ebe41,null));};exports[_0xd072('0x25')]=function(_0x170a4d,_0x4f43f5){return db['VoiceRecording'][_0xd072('0x47')]({'where':{'id':_0x170a4d[_0xd072('0x46')]['id']}})[_0xd072('0x24')](function(_0x18209f){if(_[_0xd072('0x61')](_0x18209f)){throw new ReferenceError(_0xd072('0x62'));}return _0x18209f;})[_0xd072('0x24')](function(_0x19d601){var _0x1c0bf4=_0x19d601['value'];logger['info'](_0xd072('0x63'),_0x1c0bf4);if(!_['isNil'](_0x19d601[_0xd072('0x4e')])&&fs[_0xd072('0x60')](_0x1c0bf4)){logger[_0xd072('0x64')](_0xd072('0x65')+_0x1c0bf4+_0xd072('0x66'));fs[_0xd072('0x67')](_0x1c0bf4);}_0x1c0bf4=_0x1c0bf4+'.cypher';if(!_['isNil'](_0x19d601[_0xd072('0x4e')])&&fs[_0xd072('0x60')](_0x1c0bf4)){logger[_0xd072('0x64')](_0xd072('0x65')+_0x1c0bf4+_0xd072('0x66'));fs[_0xd072('0x67')](_0x1c0bf4);}return _0x19d601;})['then'](function(_0x5711f7){if(!_0x5711f7)throw new InternalError();return _0x5711f7[_0xd072('0x25')]();})[_0xd072('0x24')](function(){_0x4f43f5[_0xd072('0x1a')](0xcc)[_0xd072('0x1b')]();})[_0xd072('0x49')](handleError(_0x4f43f5,null));};function getBucketslist(_0x22828b,_0x69eafa,_0x2d65f5){return new Promise(function(_0x312608,_0x3976f3){var _0x329864=new AWS['S3']({'accessKeyId':_0x69eafa,'secretAccessKey':_0x22828b,'region':_0x2d65f5});_0x329864[_0xd072('0x68')]({},function(_0x472884,_0x22249b){if(_0x472884){return _0x3976f3(_0x472884);}else{return _0x312608(_0x22249b);}});});}function createBucket(_0x42e832,_0x157650,_0x3a6877,_0x217eb4){return new Promise(function(_0x5ebdc8,_0x59be34){var _0x313a42=new AWS['S3']({'accessKeyId':_0x157650,'secretAccessKey':_0x42e832,'region':_0x3a6877});_0x313a42['createBucket']({'Bucket':_0x217eb4},function(_0x3298b9,_0x1fa5fa){if(_0x3298b9){return _0x59be34(_0x3298b9);}else{return _0x5ebdc8(_0x1fa5fa);}});});}function uploadFile(_0x37bb73,_0x4090b5,_0x582f02,_0x23ba52,_0xad6e4f,_0x50a467){return new Promise(function(_0x4912f7,_0x21ac9b){var _0x3286d0=new AWS['S3']({'accessKeyId':_0x4090b5,'secretAccessKey':_0x37bb73,'region':_0x582f02});_0x3286d0[_0xd072('0x69')]({'Bucket':_0x23ba52,'Key':_0xad6e4f,'Body':_0x50a467},function(_0x5a4e12,_0x44590b){if(_0x5a4e12){return _0x21ac9b(_0x5a4e12);}else{return _0x4912f7(_0x44590b);}});});}function startTranscribe(_0x2eb166,_0x6add2e,_0x43bf80,_0x5e3657,_0x47e632,_0x52107d){return new Promise(function(_0x1cd572,_0x1f301e){var _0xb181cb=new AWS[(_0xd072('0x6a'))]({'accessKeyId':_0x6add2e,'secretAccessKey':_0x2eb166,'region':_0x43bf80});_0xb181cb[_0xd072('0x6b')]({'TranscriptionJobName':_0x5e3657,'LanguageCode':_0x47e632,'Media':{'MediaFileUri':_0x52107d}},function(_0x5b472b,_0x3011ce){if(_0x5b472b){return _0x1f301e(_0x5b472b);}else{return _0x1cd572(_0x3011ce);}});});}function transcribe(_0x9424bd,_0x3112bc,_0x32f888,_0x1c8afa,_0x50c330,_0x2d617c,_0x40859f){return new Promise(function(_0x5f6ac2,_0x2d0baf){var _0x35fde9={};logger[_0xd072('0x64')](util[_0xd072('0x2f')](_0xd072('0x6c'),_0x9424bd,_0x50c330));return uploadFile(_0x3112bc,_0x32f888,_0x1c8afa,_0x50c330,path[_0xd072('0x6d')](_0x2d617c),fs[_0xd072('0x6e')](_0x2d617c))[_0xd072('0x24')](function(_0x48ad48){logger[_0xd072('0x64')](util[_0xd072('0x2f')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x9424bd,_0x50c330,_0x48ad48[_0xd072('0x6f')]));_0x35fde9[_0xd072('0x70')]=_0x48ad48[_0xd072('0x71')];_0x35fde9['location']=_0x48ad48[_0xd072('0x6f')];logger[_0xd072('0x64')](util[_0xd072('0x2f')](_0xd072('0x72'),_0x9424bd));return startTranscribe(_0x3112bc,_0x32f888,_0x1c8afa,uuidv4(),_0x40859f,_0x48ad48['Location']);})[_0xd072('0x24')](function(_0x47ac5f){logger[_0xd072('0x64')](util['format'](_0xd072('0x73'),_0x9424bd,_0x47ac5f['TranscriptionJob']['TranscriptionJobName']));_0x35fde9['transcribeName']=_0x47ac5f[_0xd072('0x74')]['TranscriptionJobName'];_0x35fde9['transcribeStatus']=_0x47ac5f[_0xd072('0x74')][_0xd072('0x75')];return _0x5f6ac2(_0x35fde9);})[_0xd072('0x49')](function(_0x1ac6ba){return _0x2d0baf(_0x1ac6ba);});});}exports['runTranscribe']=function(_0x544991,_0x1de42f,_0x41dc20){var _0x1fc441;var _0x5103a8;var _0x1953b1;var _0xa68f4d=require(_0xd072('0x4c'));return db[_0xd072('0x40')][_0xd072('0x76')]({'where':{'id':_0x544991['params']['id']}})['then'](function(_0xd87023){if(_0xd87023){var _0x3b5f36=util['format']('%s.cypher',_0xd87023['value']);if(fs[_0xd072('0x60')](_0x3b5f36)){cypher=!![];return _0xa68f4d[_0xd072('0x50')](_0x3b5f36,_0xd87023[_0xd072('0x4e')],config[_0xd072('0x51')][_0xd072('0x52')])[_0xd072('0x24')](function(){return _0xd87023;});}return _0xd87023;}})[_0xd072('0x24')](function(_0x4b6eca){if(!_0x4b6eca){throw new db[(_0xd072('0x53'))][(_0xd072('0x54'))](_0xd072('0x77'));}_0x5103a8=_0x4b6eca;return db[_0xd072('0x78')][_0xd072('0x76')]({'where':{'id':0x1}});})[_0xd072('0x24')](handleEntityNotFound(_0x1de42f,null))[_0xd072('0x24')](function(_0x1e3530){if(_0x1e3530){_0x1fc441=_0x1e3530;if(!_0x1fc441['transcribe']||!_0x1fc441['transcribeAccountId']||!_0x1fc441[_0xd072('0x79')]||!_0x1fc441[_0xd072('0x7a')]||!_0x1fc441[_0xd072('0x70')]){throw new db[(_0xd072('0x53'))][(_0xd072('0x54'))]('Transcribe\x20not\x20configured');}if(_0x544991[_0xd072('0x48')][_0xd072('0x7b')]&&(!_0x1fc441['sentiment']||!_0x1fc441['sentimentAccountId']||!_0x1fc441[_0xd072('0x7c')]||!_0x1fc441['language']||!_0x1fc441['bucket'])){throw new db[(_0xd072('0x53'))][(_0xd072('0x54'))]('Sentiment\x20Analysis\x20not\x20configured');}return db['CloudProvider'][_0xd072('0x76')]({'where':{'id':_0x1fc441[_0xd072('0x7d')]}});}})[_0xd072('0x24')](function(_0x14ad14){if(!_0x14ad14){throw new db['Sequelize'][(_0xd072('0x54'))](_0xd072('0x7e'));}if(!_0x14ad14[_0xd072('0x7f')]||!_0x14ad14[_0xd072('0x80')]){throw new db[(_0xd072('0x53'))]['ValidationError'](_0xd072('0x81'));}_0x1953b1=_0x14ad14;return getBucketslist(_0x1953b1[_0xd072('0x7f')],_0x1953b1[_0xd072('0x80')],_0x1fc441['transcribeRegion']);})[_0xd072('0x24')](function(_0x580962){if(_0x580962&&_0x580962[_0xd072('0x82')]){var _0x2f59c4=_[_0xd072('0x47')](_0x580962['Buckets'],function(_0x27ebde){return _0x27ebde[_0xd072('0x83')]===_0x1fc441[_0xd072('0x70')];});if(!_0x2f59c4){logger[_0xd072('0x64')](util[_0xd072('0x2f')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x544991['params']['id'],_0x1fc441[_0xd072('0x70')]));return createBucket(_0x1953b1['data1'],_0x1953b1[_0xd072('0x80')],_0x1fc441['transcribeRegion'],_0x1fc441['bucket']);}logger[_0xd072('0x64')](util['format'](_0xd072('0x84'),_0x544991[_0xd072('0x46')]['id'],_0x1fc441[_0xd072('0x70')]));return;}})[_0xd072('0x24')](function(_0x1ce354){if(_0x5103a8[_0xd072('0x85')]==='NEW'){return transcribe(_0x544991[_0xd072('0x46')]['id'],_0x1953b1['data1'],_0x1953b1[_0xd072('0x80')],_0x1fc441['transcribeRegion'],_0x1fc441[_0xd072('0x70')],_0x5103a8[_0xd072('0x4e')],_0x1fc441[_0xd072('0x7a')]);}else{logger[_0xd072('0x64')](util[_0xd072('0x2f')](_0xd072('0x86'),_0x544991[_0xd072('0x46')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0xd072('0x24')](function(_0x191584){if(_0x191584){_0x191584[_0xd072('0x87')]=_0x544991[_0xd072('0x48')][_0xd072('0x7b')];return _0x5103a8[_0xd072('0x88')](_0x191584);}})[_0xd072('0x24')](respondWithResult(_0x1de42f,null))[_0xd072('0x49')](handleError(_0x1de42f,null));};function writeFile(_0x2e0522,_0x200ed2){return new Promise(function(_0x23f92e,_0x1484c9){fs[_0xd072('0x89')](_0x200ed2,_0x2e0522,function(_0xfacd7b,_0x335ea4){if(_0xfacd7b){return _0x1484c9(_0xfacd7b);}else{return _0x23f92e(_0x335ea4);}});});}exports[_0xd072('0x8a')]=function(_0x389a70,_0x591026,_0x56b9a1){return db[_0xd072('0x40')][_0xd072('0x76')]({'where':{'id':_0x389a70['params']['id']}})[_0xd072('0x24')](handleEntityNotFound(_0x591026))[_0xd072('0x24')](function(_0xd726cd){if(_0xd726cd&&_0xd726cd[_0xd072('0x8b')]){var _0x57320d=_0xd726cd[_0xd072('0x8b')];var _0x390d4b=config[_0xd072('0x8c')]+_0xd072('0x8d')+_0xd726cd['id']+'.txt';if(fs[_0xd072('0x60')](_0x390d4b)){return _0x390d4b;}return writeFile(_0x57320d,_0x390d4b)['then'](function(){return _0x390d4b;});}else{throw new db[(_0xd072('0x53'))][(_0xd072('0x54'))](_0xd072('0x8e'));}})[_0xd072('0x24')](function(_0x5bb828){return _0x591026[_0xd072('0x4b')](_0x5bb828);})[_0xd072('0x49')](handleError(_0x591026));}; \ No newline at end of file +var _0x07a3=['VIRTUAL','filter','options','VoiceRecording','count','include','findAll','rows','show','params','keys','length','find','catch','create','body','describe','download','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','filename','unlink','message','VoiceRecording\x20not\x20found','send','Not\x20found','../../components/encryptor','sequelize','MD5','col','$and','push','ValidationError','extname','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','listBuckets','createBucket','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','findOne','Setting','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','.txt','Transcript\x20not\x20available','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','aws-sdk','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','set','Content-Range','apply','reject','update','then','destroy','stack','name','index','map','rawAttributes','fieldName','type','model','differenceBy','format','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge'];(function(_0x538ece,_0x449fcf){var _0x361a0e=function(_0x392c23){while(--_0x392c23){_0x538ece['push'](_0x538ece['shift']());}};_0x361a0e(++_0x449fcf);}(_0x07a3,0xf7));var _0x307a=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0x07a3[_0x3de8a4];return _0x4635cf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x307a('0x0'));var zipdir=require(_0x307a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x307a('0x2'));var moment=require('moment');var BPromise=require(_0x307a('0x3'));var Mustache=require(_0x307a('0x4'));var util=require('util');var path=require(_0x307a('0x5'));var sox=require(_0x307a('0x6'));var csv=require(_0x307a('0x7'));var ejs=require(_0x307a('0x8'));var fs=require('fs');var fs_extra=require(_0x307a('0x9'));var _=require(_0x307a('0xa'));var squel=require(_0x307a('0xb'));var crypto=require(_0x307a('0xc'));var jsforce=require(_0x307a('0xd'));var deskjs=require(_0x307a('0xe'));var toCsv=require(_0x307a('0x7'));var querystring=require(_0x307a('0xf'));var Papa=require(_0x307a('0x10'));var AWS=require(_0x307a('0x11'));var uuidv4=require('uuid/v4');var Redis=require(_0x307a('0x12'));var authService=require(_0x307a('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x307a('0x14'));var hardwareService=require(_0x307a('0x15'));var logger=require(_0x307a('0x16'))(_0x307a('0x17'));var utils=require(_0x307a('0x18'));var config=require(_0x307a('0x19'));var licenseUtil=require(_0x307a('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x53d410,_0xa6121e){_0xa6121e=_0xa6121e||0xcc;return function(_0x12a0ea){if(_0x12a0ea){return _0x53d410[_0x307a('0x1b')](_0xa6121e);}return _0x53d410[_0x307a('0x1c')](_0xa6121e)[_0x307a('0x1d')]();};}function respondWithResult(_0x3ace6a,_0x4d692c){_0x4d692c=_0x4d692c||0xc8;return function(_0x4125ca){if(_0x4125ca){return _0x3ace6a[_0x307a('0x1c')](_0x4d692c)[_0x307a('0x1e')](_0x4125ca);}};}function respondWithFilteredResult(_0x4211b5,_0x39a62d){return function(_0x40cf90){if(_0x40cf90){var _0x2e01b5=typeof _0x39a62d[_0x307a('0x1f')]==='undefined'&&typeof _0x39a62d[_0x307a('0x20')]===_0x307a('0x21');var _0xd36519=_0x40cf90['count'];var _0x413879=_0x2e01b5?0x0:_0x39a62d[_0x307a('0x1f')];var _0x219399=_0x2e01b5?_0x40cf90['count']:_0x39a62d[_0x307a('0x1f')]+_0x39a62d[_0x307a('0x20')];var _0x94cd07;if(_0x219399>=_0xd36519){_0x219399=_0xd36519;_0x94cd07=0xc8;}else{_0x94cd07=0xce;}_0x4211b5[_0x307a('0x1c')](_0x94cd07);return _0x4211b5[_0x307a('0x22')](_0x307a('0x23'),_0x413879+'-'+_0x219399+'/'+_0xd36519)[_0x307a('0x1e')](_0x40cf90);}return null;};}function patchUpdates(_0x392a8b){return function(_0x1b22ea){try{jsonpatch[_0x307a('0x24')](_0x1b22ea,_0x392a8b,!![]);}catch(_0x521110){return BPromise[_0x307a('0x25')](_0x521110);}return _0x1b22ea['save']();};}function saveUpdates(_0xc4fdc7,_0x4f06ca){return function(_0x54ce1b){if(_0x54ce1b){return _0x54ce1b[_0x307a('0x26')](_0xc4fdc7)[_0x307a('0x27')](function(_0x558f68){return _0x558f68;});}return null;};}function removeEntity(_0x2ebb75,_0x25f92c){return function(_0xc271dc){if(_0xc271dc){return _0xc271dc[_0x307a('0x28')]()[_0x307a('0x27')](function(){_0x2ebb75[_0x307a('0x1c')](0xcc)[_0x307a('0x1d')]();});}};}function handleEntityNotFound(_0xe9cd8e,_0x19560f){return function(_0x3bbd25){if(!_0x3bbd25){_0xe9cd8e[_0x307a('0x1b')](0x194);}return _0x3bbd25;};}function handleError(_0x3411a0,_0x3785af){_0x3785af=_0x3785af||0x1f4;return function(_0x1521f0){logger['error'](_0x1521f0[_0x307a('0x29')]);if(_0x1521f0[_0x307a('0x2a')]){delete _0x1521f0[_0x307a('0x2a')];}_0x3411a0[_0x307a('0x1c')](_0x3785af)['send'](_0x1521f0);};}exports[_0x307a('0x2b')]=function(_0x5fd35d,_0x287fa0){var _0x3571c9={},_0x686565={},_0x3d5531={'count':0x0,'rows':[]};var _0xa1cd0d=_[_0x307a('0x2c')](db['VoiceRecording'][_0x307a('0x2d')],function(_0x3f8a09){return{'name':_0x3f8a09[_0x307a('0x2e')],'type':_0x3f8a09[_0x307a('0x2f')]['key']};});_0x686565[_0x307a('0x30')]=_[_0x307a('0x31')](_[_0x307a('0x2c')](_0xa1cd0d,_0x307a('0x2a')),[_0x307a('0x32')]);_0x686565[_0x307a('0x33')]=_['keys'](_0x5fd35d['query']);_0x686565[_0x307a('0x34')]=_[_0x307a('0x35')](_0x686565[_0x307a('0x30')],_0x686565[_0x307a('0x33')]);_0x3571c9[_0x307a('0x36')]=_[_0x307a('0x35')](_0x686565[_0x307a('0x30')],qs['fields'](_0x5fd35d[_0x307a('0x33')][_0x307a('0x37')]));_0x3571c9[_0x307a('0x36')]=_0x3571c9[_0x307a('0x36')]['length']?_0x3571c9[_0x307a('0x36')]:_0x686565[_0x307a('0x30')];if(!_0x5fd35d[_0x307a('0x33')][_0x307a('0x38')](_0x307a('0x39'))){_0x3571c9[_0x307a('0x20')]=qs[_0x307a('0x20')](_0x5fd35d[_0x307a('0x33')][_0x307a('0x20')]);_0x3571c9[_0x307a('0x1f')]=qs[_0x307a('0x1f')](_0x5fd35d['query']['offset']);}_0x3571c9[_0x307a('0x3a')]=qs[_0x307a('0x3b')](_0x5fd35d[_0x307a('0x33')][_0x307a('0x3b')]);_0x3571c9[_0x307a('0x3c')]=qs[_0x307a('0x34')](_[_0x307a('0x3d')](_0x5fd35d[_0x307a('0x33')],_0x686565['filters']),_0xa1cd0d);if(_0x5fd35d[_0x307a('0x33')]['filter']){_0x3571c9['where']=_[_0x307a('0x3e')](_0x3571c9[_0x307a('0x3c')],{'$or':_['map'](_0xa1cd0d,function(_0x14e6ef){if(_0x14e6ef[_0x307a('0x2f')]!==_0x307a('0x3f')){var _0x3c76e0={};_0x3c76e0[_0x14e6ef[_0x307a('0x2a')]]={'$like':'%'+_0x5fd35d['query'][_0x307a('0x40')]+'%'};return _0x3c76e0;}})});}_0x3571c9=_['merge']({},_0x3571c9,_0x5fd35d[_0x307a('0x41')]);var _0x542386={'where':_0x3571c9[_0x307a('0x3c')]};return db[_0x307a('0x42')][_0x307a('0x43')](_0x542386)['then'](function(_0x512c88){_0x3d5531[_0x307a('0x43')]=_0x512c88;if(_0x5fd35d[_0x307a('0x33')]['includeAll']){_0x3571c9[_0x307a('0x44')]=[{'all':!![]}];}return db['VoiceRecording'][_0x307a('0x45')](_0x3571c9);})[_0x307a('0x27')](function(_0x249093){_0x3d5531[_0x307a('0x46')]=_0x249093;return _0x3d5531;})['then'](respondWithFilteredResult(_0x287fa0,_0x3571c9))['catch'](handleError(_0x287fa0,null));};exports[_0x307a('0x47')]=function(_0xc20154,_0x3db6db){var _0x36cf6e={'raw':![],'where':{'id':_0xc20154[_0x307a('0x48')]['id']}},_0x519336={};_0x519336['model']=_[_0x307a('0x49')](db['VoiceRecording'][_0x307a('0x2d')]);_0x519336[_0x307a('0x33')]=_[_0x307a('0x49')](_0xc20154[_0x307a('0x33')]);_0x519336['filters']=_[_0x307a('0x35')](_0x519336[_0x307a('0x30')],_0x519336[_0x307a('0x33')]);_0x36cf6e[_0x307a('0x36')]=_[_0x307a('0x35')](_0x519336[_0x307a('0x30')],qs[_0x307a('0x37')](_0xc20154[_0x307a('0x33')][_0x307a('0x37')]));_0x36cf6e[_0x307a('0x36')]=_0x36cf6e['attributes'][_0x307a('0x4a')]?_0x36cf6e[_0x307a('0x36')]:_0x519336[_0x307a('0x30')];if(_0xc20154[_0x307a('0x33')]['includeAll']){_0x36cf6e[_0x307a('0x44')]=[{'all':!![]}];}_0x36cf6e=_[_0x307a('0x3e')]({},_0x36cf6e,_0xc20154[_0x307a('0x41')]);return db[_0x307a('0x42')][_0x307a('0x4b')](_0x36cf6e)['then'](handleEntityNotFound(_0x3db6db,null))[_0x307a('0x27')](respondWithResult(_0x3db6db,null))[_0x307a('0x4c')](handleError(_0x3db6db,null));};exports['create']=function(_0x4cdeb4,_0x5dceb3){return db['VoiceRecording'][_0x307a('0x4d')](_0x4cdeb4['body'],{})[_0x307a('0x27')](respondWithResult(_0x5dceb3,0xc9))['catch'](handleError(_0x5dceb3,null));};exports[_0x307a('0x26')]=function(_0x42a292,_0x371e56){if(_0x42a292[_0x307a('0x4e')]['id']){delete _0x42a292[_0x307a('0x4e')]['id'];}return db[_0x307a('0x42')][_0x307a('0x4b')]({'where':{'id':_0x42a292['params']['id']}})['then'](handleEntityNotFound(_0x371e56,null))[_0x307a('0x27')](saveUpdates(_0x42a292[_0x307a('0x4e')],null))['then'](respondWithResult(_0x371e56,null))[_0x307a('0x4c')](handleError(_0x371e56,null));};exports[_0x307a('0x4f')]=function(_0xd5b3bd,_0x1d107b){return db[_0x307a('0x42')][_0x307a('0x4f')]()[_0x307a('0x27')](respondWithResult(_0x1d107b,null))[_0x307a('0x4c')](handleError(_0x1d107b,null));};exports[_0x307a('0x50')]=function(_0x54efcd,_0x3815da,_0x281c9a){var _0x39816a=require('../../components/encryptor');var _0x12bbf7=![];var _0x2e3d74={};if(_0x54efcd[_0x307a('0x33')][_0x307a('0x2f')]&&_0x54efcd[_0x307a('0x33')]['type']===_0x307a('0x51')){_0x2e3d74['uniqueid']=_0x54efcd[_0x307a('0x48')]['id'];}else{_0x2e3d74['id']=_0x54efcd[_0x307a('0x48')]['id'];}return db[_0x307a('0x42')]['find']({'where':_0x2e3d74,'attributes':['id','value'],'raw':!![]})[_0x307a('0x27')](handleEntityNotFound(_0x3815da,null))[_0x307a('0x27')](function(_0x30720e){if(_0x30720e){var _0x22770c=_0x30720e[_0x307a('0x52')];var _0x380f4a=util[_0x307a('0x32')](_0x307a('0x53'),_0x22770c);if(fs[_0x307a('0x54')](_0x380f4a)){_0x12bbf7=!![];return _0x39816a[_0x307a('0x55')](_0x380f4a,_0x22770c,config[_0x307a('0x56')][_0x307a('0x57')])['then'](function(){return _0x30720e;});}return _0x30720e;}})[_0x307a('0x27')](function(_0x46594f){if(_0x46594f){var _0x2e803b=_0x46594f[_0x307a('0x52')];if(!fs['existsSync'](_0x2e803b)){throw new db[(_0x307a('0x58'))]['ValidationError']('VoiceRecording\x20not\x20found');}if(_0x46594f[_0x307a('0x59')]){return _0x3815da['download'](_0x2e803b,_0x46594f['filename']+path['extname'](_0x2e803b),function(){if(_0x12bbf7){fs[_0x307a('0x5a')](_0x2e803b);}});}else{return _0x3815da['download'](_0x2e803b,function(_0x3072e0){if(_0x12bbf7){fs['unlink'](_0x2e803b);}});}}})['catch'](function(_0x25f833){if(_0x25f833[_0x307a('0x5b')]===_0x307a('0x5c')){_0x3815da[_0x307a('0x1c')](0x194)[_0x307a('0x5d')](_0x307a('0x5e'));}else{return handleError(_0x3815da,null);}});};exports['downloads']=function(_0x4e066c,_0x1d4010,_0x28a79a){var _0x3f3a9c=require(_0x307a('0x5f'));var _0xe4e50b=![];var _0x2991d7={'$and':[db['sequelize'][_0x307a('0x3c')](db[_0x307a('0x60')]['fn'](_0x307a('0x61'),db[_0x307a('0x60')][_0x307a('0x62')](_0x307a('0x51'))),_0x4e066c[_0x307a('0x33')]['token'])]};if(_0x4e066c[_0x307a('0x33')]['type']&&_0x4e066c[_0x307a('0x33')][_0x307a('0x2f')]===_0x307a('0x51')){_0x2991d7[_0x307a('0x63')][_0x307a('0x64')]({'uniqueid':_0x4e066c['params']['id']});}else{_0x2991d7['$and'][_0x307a('0x64')]({'id':_0x4e066c['params']['id']});}return db[_0x307a('0x42')][_0x307a('0x4b')]({'where':_0x2991d7,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x1d4010,null))['then'](function(_0x176875){if(_0x176875){var _0x204cea=util[_0x307a('0x32')](_0x307a('0x53'),_0x176875[_0x307a('0x52')]);if(fs['existsSync'](_0x204cea)){_0xe4e50b=!![];return _0x3f3a9c[_0x307a('0x55')](_0x204cea,_0x176875[_0x307a('0x52')],config[_0x307a('0x56')]['recording'])[_0x307a('0x27')](function(){return _0x176875;});}return _0x176875;}})[_0x307a('0x27')](function(_0x55d8ba){if(_0x55d8ba){if(!fs[_0x307a('0x54')](_0x55d8ba[_0x307a('0x52')])){throw new db[(_0x307a('0x58'))][(_0x307a('0x65'))]('VoiceRecording\x20not\x20found');}if(_0x55d8ba[_0x307a('0x59')]){return _0x1d4010[_0x307a('0x50')](_0x55d8ba[_0x307a('0x52')],_0x55d8ba['filename']+path[_0x307a('0x66')](_0x55d8ba['value']),function(){if(_0xe4e50b){fs[_0x307a('0x5a')](_0x55d8ba[_0x307a('0x52')]);}});}else{return _0x1d4010[_0x307a('0x50')](_0x55d8ba['value'],function(_0x101166){if(_0xe4e50b){fs['unlink'](_0x55d8ba[_0x307a('0x52')]);}});}}})[_0x307a('0x4c')](handleError(_0x1d4010,null));};exports[_0x307a('0x28')]=function(_0x8d11cb,_0x274048){return db['VoiceRecording']['find']({'where':{'id':_0x8d11cb[_0x307a('0x48')]['id']}})[_0x307a('0x27')](function(_0x39215a){if(_[_0x307a('0x67')](_0x39215a)){throw new ReferenceError(_0x307a('0x68'));}return _0x39215a;})[_0x307a('0x27')](function(_0x287ec8){var _0x37cb5c=_0x287ec8[_0x307a('0x52')];logger[_0x307a('0x69')](_0x307a('0x6a'),_0x37cb5c);if(!_[_0x307a('0x67')](_0x287ec8[_0x307a('0x52')])&&fs[_0x307a('0x54')](_0x37cb5c)){logger[_0x307a('0x69')]('File:\x20\x22'+_0x37cb5c+_0x307a('0x6b'));fs[_0x307a('0x6c')](_0x37cb5c);}_0x37cb5c=_0x37cb5c+_0x307a('0x6d');if(!_[_0x307a('0x67')](_0x287ec8[_0x307a('0x52')])&&fs[_0x307a('0x54')](_0x37cb5c)){logger[_0x307a('0x69')](_0x307a('0x6e')+_0x37cb5c+_0x307a('0x6b'));fs[_0x307a('0x6c')](_0x37cb5c);}return _0x287ec8;})[_0x307a('0x27')](function(_0x388d5f){if(!_0x388d5f)throw new InternalError();return _0x388d5f[_0x307a('0x28')]();})[_0x307a('0x27')](function(){_0x274048[_0x307a('0x1c')](0xcc)[_0x307a('0x1d')]();})['catch'](handleError(_0x274048,null));};function getBucketslist(_0x26d72a,_0x22088b,_0x441879){return new Promise(function(_0x521827,_0x8e0df0){var _0x56b6e3=new AWS['S3']({'accessKeyId':_0x22088b,'secretAccessKey':_0x26d72a,'region':_0x441879});_0x56b6e3[_0x307a('0x6f')]({},function(_0x1f8272,_0x3c8b21){if(_0x1f8272){return _0x8e0df0(_0x1f8272);}else{return _0x521827(_0x3c8b21);}});});}function createBucket(_0x4f2315,_0x42edaa,_0x397382,_0x5d01e8){return new Promise(function(_0x206e05,_0xc6395c){var _0x46f5ba=new AWS['S3']({'accessKeyId':_0x42edaa,'secretAccessKey':_0x4f2315,'region':_0x397382});_0x46f5ba[_0x307a('0x70')]({'Bucket':_0x5d01e8},function(_0x20385e,_0x16e4dc){if(_0x20385e){return _0xc6395c(_0x20385e);}else{return _0x206e05(_0x16e4dc);}});});}function uploadFile(_0x599f8d,_0x4d4b61,_0x333154,_0x500332,_0x173a69,_0x383aba){return new Promise(function(_0x2cb88b,_0xce2197){var _0x2b309e=new AWS['S3']({'accessKeyId':_0x4d4b61,'secretAccessKey':_0x599f8d,'region':_0x333154});_0x2b309e['upload']({'Bucket':_0x500332,'Key':_0x173a69,'Body':_0x383aba},function(_0x12456d,_0x4ee68a){if(_0x12456d){return _0xce2197(_0x12456d);}else{return _0x2cb88b(_0x4ee68a);}});});}function startTranscribe(_0x16ce44,_0x565f8d,_0x22337f,_0x5d5d48,_0x3f2163,_0x5dbbd2){return new Promise(function(_0x280b05,_0x46f510){var _0x43d652=new AWS[(_0x307a('0x71'))]({'accessKeyId':_0x565f8d,'secretAccessKey':_0x16ce44,'region':_0x22337f});_0x43d652[_0x307a('0x72')]({'TranscriptionJobName':_0x5d5d48,'LanguageCode':_0x3f2163,'Media':{'MediaFileUri':_0x5dbbd2}},function(_0x721357,_0x1992ad){if(_0x721357){return _0x46f510(_0x721357);}else{return _0x280b05(_0x1992ad);}});});}function transcribe(_0x3a9974,_0x1f44dd,_0x150cbc,_0x207282,_0xf0eb90,_0x2e1574,_0x8111a6){return new Promise(function(_0x4bcdcf,_0x1def9f){var _0x48a543={};logger[_0x307a('0x69')](util['format'](_0x307a('0x73'),_0x3a9974,_0xf0eb90));return uploadFile(_0x1f44dd,_0x150cbc,_0x207282,_0xf0eb90,path[_0x307a('0x74')](_0x2e1574),fs['readFileSync'](_0x2e1574))[_0x307a('0x27')](function(_0x5c8954){logger[_0x307a('0x69')](util[_0x307a('0x32')](_0x307a('0x75'),_0x3a9974,_0xf0eb90,_0x5c8954[_0x307a('0x76')]));_0x48a543[_0x307a('0x77')]=_0x5c8954['Bucket'];_0x48a543[_0x307a('0x78')]=_0x5c8954[_0x307a('0x76')];logger['info'](util[_0x307a('0x32')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x3a9974));return startTranscribe(_0x1f44dd,_0x150cbc,_0x207282,uuidv4(),_0x8111a6,_0x5c8954[_0x307a('0x76')]);})[_0x307a('0x27')](function(_0x153271){logger['info'](util[_0x307a('0x32')](_0x307a('0x79'),_0x3a9974,_0x153271['TranscriptionJob'][_0x307a('0x7a')]));_0x48a543[_0x307a('0x7b')]=_0x153271['TranscriptionJob']['TranscriptionJobName'];_0x48a543[_0x307a('0x7c')]=_0x153271['TranscriptionJob'][_0x307a('0x7d')];return _0x4bcdcf(_0x48a543);})[_0x307a('0x4c')](function(_0x52a4a2){return _0x1def9f(_0x52a4a2);});});}exports['runTranscribe']=function(_0x434b90,_0x15b488,_0x5575d2){var _0x1f04f3;var _0x3b2a34;var _0x5d8164;var _0x472ef6=require(_0x307a('0x5f'));return db[_0x307a('0x42')][_0x307a('0x7e')]({'where':{'id':_0x434b90[_0x307a('0x48')]['id']}})[_0x307a('0x27')](function(_0x17be5f){if(_0x17be5f){var _0x17692f=util[_0x307a('0x32')](_0x307a('0x53'),_0x17be5f['value']);if(fs[_0x307a('0x54')](_0x17692f)){cypher=!![];return _0x472ef6[_0x307a('0x55')](_0x17692f,_0x17be5f[_0x307a('0x52')],config[_0x307a('0x56')][_0x307a('0x57')])[_0x307a('0x27')](function(){return _0x17be5f;});}return _0x17be5f;}})[_0x307a('0x27')](function(_0x9fbff1){if(!_0x9fbff1){throw new db[(_0x307a('0x58'))]['ValidationError']('Voice\x20Recording\x20not\x20found');}_0x3b2a34=_0x9fbff1;return db[_0x307a('0x7f')][_0x307a('0x7e')]({'where':{'id':0x1}});})[_0x307a('0x27')](handleEntityNotFound(_0x15b488,null))[_0x307a('0x27')](function(_0x348c92){if(_0x348c92){_0x1f04f3=_0x348c92;if(!_0x1f04f3['transcribe']||!_0x1f04f3[_0x307a('0x80')]||!_0x1f04f3[_0x307a('0x81')]||!_0x1f04f3[_0x307a('0x82')]||!_0x1f04f3[_0x307a('0x77')]){throw new db[(_0x307a('0x58'))]['ValidationError'](_0x307a('0x83'));}if(_0x434b90['body'][_0x307a('0x84')]&&(!_0x1f04f3[_0x307a('0x85')]||!_0x1f04f3[_0x307a('0x86')]||!_0x1f04f3[_0x307a('0x87')]||!_0x1f04f3['language']||!_0x1f04f3[_0x307a('0x77')])){throw new db[(_0x307a('0x58'))][(_0x307a('0x65'))](_0x307a('0x88'));}return db[_0x307a('0x89')]['findOne']({'where':{'id':_0x1f04f3[_0x307a('0x80')]}});}})[_0x307a('0x27')](function(_0x46cf0f){if(!_0x46cf0f){throw new db[(_0x307a('0x58'))]['ValidationError'](_0x307a('0x8a'));}if(!_0x46cf0f[_0x307a('0x8b')]||!_0x46cf0f[_0x307a('0x8c')]){throw new db[(_0x307a('0x58'))]['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x5d8164=_0x46cf0f;return getBucketslist(_0x5d8164['data1'],_0x5d8164[_0x307a('0x8c')],_0x1f04f3['transcribeRegion']);})[_0x307a('0x27')](function(_0xb0f73e){if(_0xb0f73e&&_0xb0f73e[_0x307a('0x8d')]){var _0x375610=_[_0x307a('0x4b')](_0xb0f73e['Buckets'],function(_0x2323ba){return _0x2323ba[_0x307a('0x8e')]===_0x1f04f3[_0x307a('0x77')];});if(!_0x375610){logger[_0x307a('0x69')](util[_0x307a('0x32')](_0x307a('0x8f'),_0x434b90[_0x307a('0x48')]['id'],_0x1f04f3[_0x307a('0x77')]));return createBucket(_0x5d8164[_0x307a('0x8b')],_0x5d8164['data2'],_0x1f04f3[_0x307a('0x81')],_0x1f04f3[_0x307a('0x77')]);}logger['info'](util[_0x307a('0x32')](_0x307a('0x90'),_0x434b90[_0x307a('0x48')]['id'],_0x1f04f3[_0x307a('0x77')]));return;}})['then'](function(_0x2cff3e){if(_0x3b2a34[_0x307a('0x7c')]===_0x307a('0x91')){return transcribe(_0x434b90['params']['id'],_0x5d8164[_0x307a('0x8b')],_0x5d8164['data2'],_0x1f04f3[_0x307a('0x81')],_0x1f04f3[_0x307a('0x77')],_0x3b2a34[_0x307a('0x52')],_0x1f04f3[_0x307a('0x82')]);}else{logger['info'](util[_0x307a('0x32')](_0x307a('0x92'),_0x434b90[_0x307a('0x48')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0x307a('0x27')](function(_0x50bb54){if(_0x50bb54){_0x50bb54[_0x307a('0x93')]=_0x434b90[_0x307a('0x4e')][_0x307a('0x84')];return _0x3b2a34[_0x307a('0x94')](_0x50bb54);}})['then'](respondWithResult(_0x15b488,null))['catch'](handleError(_0x15b488,null));};function writeFile(_0x409d77,_0x315302){return new Promise(function(_0x52bdf8,_0x2a8223){fs[_0x307a('0x95')](_0x315302,_0x409d77,function(_0x27302d,_0x13c3e9){if(_0x27302d){return _0x2a8223(_0x27302d);}else{return _0x52bdf8(_0x13c3e9);}});});}exports[_0x307a('0x96')]=function(_0x1dc111,_0x125753,_0x13fd3d){return db[_0x307a('0x42')][_0x307a('0x7e')]({'where':{'id':_0x1dc111['params']['id']}})['then'](handleEntityNotFound(_0x125753))['then'](function(_0x5d7a9b){if(_0x5d7a9b&&_0x5d7a9b['fileText']){var _0x595d80=_0x5d7a9b[_0x307a('0x97')];var _0x5a69ac=config[_0x307a('0x98')]+'/server/files/transcribes/transcribe_'+_0x5d7a9b['id']+_0x307a('0x99');if(fs[_0x307a('0x54')](_0x5a69ac)){return _0x5a69ac;}return writeFile(_0x595d80,_0x5a69ac)[_0x307a('0x27')](function(){return _0x5a69ac;});}else{throw new db[(_0x307a('0x58'))][(_0x307a('0x65'))](_0x307a('0x9a'));}})['then'](function(_0x15738b){return _0x125753['download'](_0x15738b);})['catch'](handleError(_0x125753));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 6e5a4e5..ab5cd6d 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 _0x184d=['exports','VoiceRecording','voice_recordings','uniqueid','util','request-promise','path','rimraf','../../config/environment','./voiceRecording.attributes'];(function(_0x3b2095,_0x386cf8){var _0x322e1f=function(_0x3c1e72){while(--_0x3c1e72){_0x3b2095['push'](_0x3b2095['shift']());}};_0x322e1f(++_0x386cf8);}(_0x184d,0x1d0));var _0xd184=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0x184d[_0x556927];return _0x5f1235;};'use strict';var _=require('lodash');var util=require(_0xd184('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd184('0x1'));var fs=require('fs');var path=require(_0xd184('0x2'));var rimraf=require(_0xd184('0x3'));var config=require(_0xd184('0x4'));var attributes=require(_0xd184('0x5'));module[_0xd184('0x6')]=function(_0x4b6af0,_0x497342){return _0x4b6af0['define'](_0xd184('0x7'),attributes,{'tableName':_0xd184('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xd184('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8970=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./voiceRecording.attributes','uniqueid','util'];(function(_0x5e5c64,_0x19b9fb){var _0x1bf287=function(_0x19fb98){while(--_0x19fb98){_0x5e5c64['push'](_0x5e5c64['shift']());}};_0x1bf287(++_0x19b9fb);}(_0x8970,0xb3));var _0x0897=function(_0xa293f7,_0x87809f){_0xa293f7=_0xa293f7-0x0;var _0xea92cf=_0x8970[_0xa293f7];return _0xea92cf;};'use strict';var _=require('lodash');var util=require(_0x0897('0x0'));var logger=require(_0x0897('0x1'))(_0x0897('0x2'));var moment=require(_0x0897('0x3'));var BPromise=require(_0x0897('0x4'));var rp=require(_0x0897('0x5'));var fs=require('fs');var path=require(_0x0897('0x6'));var rimraf=require('rimraf');var config=require(_0x0897('0x7'));var attributes=require(_0x0897('0x8'));module['exports']=function(_0xd8c9ef,_0x19a74a){return _0xd8c9ef['define']('VoiceRecording',attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0x0897('0x9'),'fields':[_0x0897('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 57a9094..ac1599b 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 _0xfcf0=['request\x20sent','stringify','error','message','result','UpdateVoiceRecording','update','body','options','attributes','limit','then','catch','../../components/encryptor','findOne','callRecordingEncryption','existsSync','format','%s.cypher','value','encryptFile','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceRecording,\x20%s,\x20%s','debug'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xfcf0,0x138));var _0x0fcf=function(_0x11ba83,_0xd5611a){_0x11ba83=_0x11ba83-0x0;var _0x3f3925=_0xfcf0[_0x11ba83];return _0x3f3925;};'use strict';var _=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var moment=require('moment');var BPromise=require(_0x0fcf('0x2'));var rs=require(_0x0fcf('0x3'));var fs=require('fs');var Redis=require(_0x0fcf('0x4'));var db=require(_0x0fcf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0fcf('0x6'))(_0x0fcf('0x7'));var config=require(_0x0fcf('0x8'));var jayson=require(_0x0fcf('0x9'));var client=jayson[_0x0fcf('0xa')][_0x0fcf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x61bbb9,_0x2dfdf8,_0x50c575){return new BPromise(function(_0x1388d1,_0x6ced94){return client[_0x0fcf('0xc')](_0x61bbb9,_0x50c575)['then'](function(_0x69a840){logger[_0x0fcf('0xd')](_0x0fcf('0xe'),_0x2dfdf8,'request\x20sent');logger[_0x0fcf('0xf')]('VoiceRecording,\x20%s,\x20%s,\x20%s',_0x2dfdf8,_0x0fcf('0x10'),JSON[_0x0fcf('0x11')](_0x69a840));if(_0x69a840[_0x0fcf('0x12')]){if(_0x69a840['error']['code']===0x1f4){logger[_0x0fcf('0x12')](_0x0fcf('0xe'),_0x2dfdf8,_0x69a840['error'][_0x0fcf('0x13')]);return _0x6ced94(_0x69a840[_0x0fcf('0x12')][_0x0fcf('0x13')]);}logger[_0x0fcf('0x12')](_0x0fcf('0xe'),_0x2dfdf8,_0x69a840['error'][_0x0fcf('0x13')]);return _0x1388d1(_0x69a840[_0x0fcf('0x12')][_0x0fcf('0x13')]);}else{logger['info'](_0x0fcf('0xe'),_0x2dfdf8,_0x0fcf('0x10'));_0x1388d1(_0x69a840[_0x0fcf('0x14')][_0x0fcf('0x13')]);}})['catch'](function(_0x3e78d0){logger[_0x0fcf('0x12')](_0x0fcf('0xe'),_0x2dfdf8,_0x3e78d0);_0x6ced94(_0x3e78d0);});});}exports[_0x0fcf('0x15')]=function(_0x19cfbd){var _0x567320=this;return new Promise(function(_0x18ea32,_0x1a8f58){return db['VoiceRecording'][_0x0fcf('0x16')](_0x19cfbd[_0x0fcf('0x17')],{'raw':_0x19cfbd['options']?_0x19cfbd[_0x0fcf('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19cfbd[_0x0fcf('0x18')]?_0x19cfbd[_0x0fcf('0x18')]['where']||null:null,'attributes':_0x19cfbd[_0x0fcf('0x18')]?_0x19cfbd[_0x0fcf('0x18')][_0x0fcf('0x19')]||null:null,'limit':_0x19cfbd['options']?_0x19cfbd[_0x0fcf('0x18')][_0x0fcf('0x1a')]||null:null})[_0x0fcf('0x1b')](function(_0x41b20b){logger[_0x0fcf('0xd')](_0x0fcf('0x15'),_0x19cfbd);logger['debug'](_0x0fcf('0x15'),_0x19cfbd,JSON[_0x0fcf('0x11')](_0x41b20b));_0x18ea32(_0x41b20b);})[_0x0fcf('0x1c')](function(_0xd6f8b5){logger[_0x0fcf('0x12')](_0x0fcf('0x15'),_0xd6f8b5[_0x0fcf('0x13')],_0x19cfbd);_0x1a8f58(_0x567320[_0x0fcf('0x12')](0x1f4,_0xd6f8b5[_0x0fcf('0x13')]));});});};exports['CreateVoiceRecording']=function(_0x18965e){var _0xc107a=this;return new Promise(function(_0x41b7a2,_0x2f198b){var _0x3876ed=require(_0x0fcf('0x1d'));var _0x2730b0;return db['Setting'][_0x0fcf('0x1e')]({'attributes':['id',_0x0fcf('0x1f')],'where':{'id':0x1},'raw':!![]})[_0x0fcf('0x1b')](function(_0x35180d){_0x2730b0=_0x35180d;return db['VoiceRecording']['create'](_0x18965e['body']);})[_0x0fcf('0x1b')](function(_0x50b7df){if(_0x2730b0[_0x0fcf('0x1f')]&&fs[_0x0fcf('0x20')](_0x50b7df['value'])){var _0xdfd3ec=util[_0x0fcf('0x21')](_0x0fcf('0x22'),_0x50b7df[_0x0fcf('0x23')]);return _0x3876ed[_0x0fcf('0x24')](_0x50b7df[_0x0fcf('0x23')],_0xdfd3ec,config['secrets'][_0x0fcf('0x25')])[_0x0fcf('0x1b')](function(){fs[_0x0fcf('0x26')](_0x50b7df[_0x0fcf('0x23')]);logger[_0x0fcf('0xd')](_0x0fcf('0x27'));return _0x50b7df;});}return _0x50b7df;})['then'](function(_0x208433){logger[_0x0fcf('0xd')](_0x0fcf('0x28'),_0x18965e);logger[_0x0fcf('0xf')](_0x0fcf('0x28'),_0x18965e,JSON[_0x0fcf('0x11')](_0x208433));_0x41b7a2(_0x208433);})[_0x0fcf('0x1c')](function(_0x344957){logger[_0x0fcf('0x12')](_0x0fcf('0x28'),_0x344957[_0x0fcf('0x13')],_0x18965e);_0x2f198b(_0xc107a[_0x0fcf('0x12')](0x1f4,_0x344957[_0x0fcf('0x13')]));});});}; \ No newline at end of file +var _0x1a37=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateVoiceRecording','update','body','options','raw','where','attributes','then','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','VoiceRecording','create','existsSync','value','format','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted'];(function(_0x1b7b90,_0x6a0e6b){var _0x34a9fd=function(_0x556dc4){while(--_0x556dc4){_0x1b7b90['push'](_0x1b7b90['shift']());}};_0x34a9fd(++_0x6a0e6b);}(_0x1a37,0xb4));var _0x71a3=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x1a37[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require(_0x71a3('0x0'));var util=require(_0x71a3('0x1'));var moment=require(_0x71a3('0x2'));var BPromise=require(_0x71a3('0x3'));var rs=require(_0x71a3('0x4'));var fs=require('fs');var Redis=require(_0x71a3('0x5'));var db=require(_0x71a3('0x6'))['db'];var utils=require(_0x71a3('0x7'));var logger=require(_0x71a3('0x8'))(_0x71a3('0x9'));var config=require('../../config/environment');var jayson=require(_0x71a3('0xa'));var client=jayson['client'][_0x71a3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45050a,_0x231ea7,_0x2bb6a2){return new BPromise(function(_0x4a9ab2,_0x53b893){return client['request'](_0x45050a,_0x2bb6a2)['then'](function(_0x89da86){logger[_0x71a3('0xc')](_0x71a3('0xd'),_0x231ea7,_0x71a3('0xe'));logger[_0x71a3('0xf')](_0x71a3('0x10'),_0x231ea7,_0x71a3('0xe'),JSON[_0x71a3('0x11')](_0x89da86));if(_0x89da86['error']){if(_0x89da86['error']['code']===0x1f4){logger[_0x71a3('0x12')](_0x71a3('0xd'),_0x231ea7,_0x89da86[_0x71a3('0x12')][_0x71a3('0x13')]);return _0x53b893(_0x89da86[_0x71a3('0x12')][_0x71a3('0x13')]);}logger[_0x71a3('0x12')](_0x71a3('0xd'),_0x231ea7,_0x89da86[_0x71a3('0x12')][_0x71a3('0x13')]);return _0x4a9ab2(_0x89da86[_0x71a3('0x12')]['message']);}else{logger[_0x71a3('0xc')](_0x71a3('0xd'),_0x231ea7,'request\x20sent');_0x4a9ab2(_0x89da86['result'][_0x71a3('0x13')]);}})[_0x71a3('0x14')](function(_0xee797f){logger[_0x71a3('0x12')](_0x71a3('0xd'),_0x231ea7,_0xee797f);_0x53b893(_0xee797f);});});}exports[_0x71a3('0x15')]=function(_0x5d4dee){var _0x656cd2=this;return new Promise(function(_0x27bfb4,_0x5b955a){return db['VoiceRecording'][_0x71a3('0x16')](_0x5d4dee[_0x71a3('0x17')],{'raw':_0x5d4dee[_0x71a3('0x18')]?_0x5d4dee[_0x71a3('0x18')][_0x71a3('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d4dee['options']?_0x5d4dee[_0x71a3('0x18')][_0x71a3('0x1a')]||null:null,'attributes':_0x5d4dee[_0x71a3('0x18')]?_0x5d4dee[_0x71a3('0x18')][_0x71a3('0x1b')]||null:null,'limit':_0x5d4dee['options']?_0x5d4dee[_0x71a3('0x18')]['limit']||null:null})[_0x71a3('0x1c')](function(_0x35d1d4){logger[_0x71a3('0xc')](_0x71a3('0x15'),_0x5d4dee);logger[_0x71a3('0xf')](_0x71a3('0x15'),_0x5d4dee,JSON['stringify'](_0x35d1d4));_0x27bfb4(_0x35d1d4);})[_0x71a3('0x14')](function(_0x299d1d){logger[_0x71a3('0x12')](_0x71a3('0x15'),_0x299d1d[_0x71a3('0x13')],_0x5d4dee);_0x5b955a(_0x656cd2['error'](0x1f4,_0x299d1d[_0x71a3('0x13')]));});});};exports[_0x71a3('0x1d')]=function(_0x4c1a3d){var _0x412746=this;return new Promise(function(_0x515519,_0x46f1ff){var _0x2fd3b6=require(_0x71a3('0x1e'));var _0x35b5c7;return db[_0x71a3('0x1f')][_0x71a3('0x20')]({'attributes':['id',_0x71a3('0x21')],'where':{'id':0x1},'raw':!![]})[_0x71a3('0x1c')](function(_0x305eb1){_0x35b5c7=_0x305eb1;return db[_0x71a3('0x22')][_0x71a3('0x23')](_0x4c1a3d[_0x71a3('0x17')]);})['then'](function(_0x26fd9f){if(_0x35b5c7[_0x71a3('0x21')]&&fs[_0x71a3('0x24')](_0x26fd9f[_0x71a3('0x25')])){var _0x4a750c=util[_0x71a3('0x26')](_0x71a3('0x27'),_0x26fd9f[_0x71a3('0x25')]);return _0x2fd3b6[_0x71a3('0x28')](_0x26fd9f[_0x71a3('0x25')],_0x4a750c,config[_0x71a3('0x29')][_0x71a3('0x2a')])['then'](function(){fs[_0x71a3('0x2b')](_0x26fd9f[_0x71a3('0x25')]);logger[_0x71a3('0xc')](_0x71a3('0x2c'));return _0x26fd9f;});}return _0x26fd9f;})[_0x71a3('0x1c')](function(_0x73c8e7){logger[_0x71a3('0xc')](_0x71a3('0x1d'),_0x4c1a3d);logger[_0x71a3('0xf')](_0x71a3('0x1d'),_0x4c1a3d,JSON[_0x71a3('0x11')](_0x73c8e7));_0x515519(_0x73c8e7);})[_0x71a3('0x14')](function(_0x447b14){logger['error']('CreateVoiceRecording',_0x447b14[_0x71a3('0x13')],_0x4c1a3d);_0x46f1ff(_0x412746[_0x71a3('0x12')](0x1f4,_0x447b14['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index c65e58d..7263558 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 _0xcb72=['../../components/auth/service','../../config/environment','./voiceTransferReport.controller','index','get','/describe','describe','/:id','post','create','put','update','delete','destroy','exports','multer','path','Router','fs-extra'];(function(_0x2e319f,_0x3371c2){var _0x210ea7=function(_0x12c8c6){while(--_0x12c8c6){_0x2e319f['push'](_0x2e319f['shift']());}};_0x210ea7(++_0x3371c2);}(_0xcb72,0x81));var _0x2cb7=function(_0x4fd7c1,_0x4b91e2){_0x4fd7c1=_0x4fd7c1-0x0;var _0x35f083=_0xcb72[_0x4fd7c1];return _0x35f083;};'use strict';var multer=require(_0x2cb7('0x0'));var util=require('util');var path=require(_0x2cb7('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2cb7('0x2')]();var fs_extra=require(_0x2cb7('0x3'));var auth=require(_0x2cb7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2cb7('0x5'));var controller=require(_0x2cb7('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x2cb7('0x7')]);router[_0x2cb7('0x8')](_0x2cb7('0x9'),auth['isAuthenticated'](),controller[_0x2cb7('0xa')]);router[_0x2cb7('0x8')](_0x2cb7('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x2cb7('0xc')]('/',auth['isAuthenticated'](),controller[_0x2cb7('0xd')]);router[_0x2cb7('0xe')](_0x2cb7('0xb'),auth['isAuthenticated'](),controller[_0x2cb7('0xf')]);router[_0x2cb7('0x10')](_0x2cb7('0xb'),auth['isAuthenticated'](),controller[_0x2cb7('0x11')]);module[_0x2cb7('0x12')]=router; \ No newline at end of file +var _0xa6f9=['isAuthenticated','index','/describe','describe','show','create','put','/:id','update','delete','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get'];(function(_0x5ab8b2,_0xa5eccb){var _0x2ca668=function(_0x5ca6f2){while(--_0x5ca6f2){_0x5ab8b2['push'](_0x5ab8b2['shift']());}};_0x2ca668(++_0xa5eccb);}(_0xa6f9,0x123));var _0x9a6f=function(_0x736a6d,_0x1201d9){_0x736a6d=_0x736a6d-0x0;var _0x4dc15e=_0xa6f9[_0x736a6d];return _0x4dc15e;};'use strict';var multer=require(_0x9a6f('0x0'));var util=require(_0x9a6f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9a6f('0x2'));var router=express[_0x9a6f('0x3')]();var fs_extra=require(_0x9a6f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9a6f('0x5'));var config=require(_0x9a6f('0x6'));var controller=require(_0x9a6f('0x7'));router[_0x9a6f('0x8')]('/',auth[_0x9a6f('0x9')](),controller[_0x9a6f('0xa')]);router[_0x9a6f('0x8')](_0x9a6f('0xb'),auth[_0x9a6f('0x9')](),controller[_0x9a6f('0xc')]);router[_0x9a6f('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x9a6f('0xd')]);router['post']('/',auth[_0x9a6f('0x9')](),controller[_0x9a6f('0xe')]);router[_0x9a6f('0xf')](_0x9a6f('0x10'),auth[_0x9a6f('0x9')](),controller[_0x9a6f('0x11')]);router[_0x9a6f('0x12')](_0x9a6f('0x10'),auth[_0x9a6f('0x9')](),controller['destroy']);module[_0x9a6f('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index ef740eb..98093f5 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 _0xc379=['ENUM','blind','attended','STRING','Yes','sequelize','exports'];(function(_0x26703a,_0x21bf59){var _0x48cca3=function(_0x1b8fd4){while(--_0x1b8fd4){_0x26703a['push'](_0x26703a['shift']());}};_0x48cca3(++_0x21bf59);}(_0xc379,0x1a9));var _0x9c37=function(_0x2094ff,_0x39ee6a){_0x2094ff=_0x2094ff-0x0;var _0x58528e=_0xc379[_0x2094ff];return _0x58528e;};'use strict';var Sequelize=require(_0x9c37('0x0'));var moment=require('moment');module[_0x9c37('0x1')]={'type':{'type':Sequelize[_0x9c37('0x2')](_0x9c37('0x3'),_0x9c37('0x4'))},'result':{'type':Sequelize[_0x9c37('0x5')]},'transfererchannel':{'type':Sequelize[_0x9c37('0x5')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0x9c37('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0x9c37('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0x9c37('0x5')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0x9c37('0x5')]},'transfererexten':{'type':Sequelize[_0x9c37('0x5')]},'transfererlinkedid':{'type':Sequelize[_0x9c37('0x5')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0x9c37('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x9c37('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0x9c37('0x5')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0x9c37('0x5')]},'transfereeexten':{'type':Sequelize[_0x9c37('0x5')]},'transfereelinkedid':{'type':Sequelize[_0x9c37('0x5')]},'isexternal':{'type':Sequelize[_0x9c37('0x2')](_0x9c37('0x6'),'No')},'context':{'type':Sequelize[_0x9c37('0x5')]},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x42d7=['sequelize','exports','ENUM','blind','attended','STRING','Yes'];(function(_0x52c9b5,_0x2922f8){var _0xa10bbe=function(_0x550330){while(--_0x550330){_0x52c9b5['push'](_0x52c9b5['shift']());}};_0xa10bbe(++_0x2922f8);}(_0x42d7,0xa8));var _0x742d=function(_0x18b344,_0x271f68){_0x18b344=_0x18b344-0x0;var _0x5ef6bb=_0x42d7[_0x18b344];return _0x5ef6bb;};'use strict';var Sequelize=require(_0x742d('0x0'));var moment=require('moment');module[_0x742d('0x1')]={'type':{'type':Sequelize[_0x742d('0x2')](_0x742d('0x3'),_0x742d('0x4'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0x742d('0x5')]},'transferercalleridnum':{'type':Sequelize[_0x742d('0x5')]},'transferercalleridname':{'type':Sequelize[_0x742d('0x5')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0x742d('0x5')]},'transferercontext':{'type':Sequelize[_0x742d('0x5')]},'transfererexten':{'type':Sequelize[_0x742d('0x5')]},'transfererlinkedid':{'type':Sequelize[_0x742d('0x5')]},'transfereechannel':{'type':Sequelize[_0x742d('0x5')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0x742d('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0x742d('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0x742d('0x5')]},'transfereecontext':{'type':Sequelize[_0x742d('0x5')]},'transfereeexten':{'type':Sequelize[_0x742d('0x5')]},'transfereelinkedid':{'type':Sequelize[_0x742d('0x5')]},'isexternal':{'type':Sequelize[_0x742d('0x2')](_0x742d('0x6'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x742d('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index e71d70b..000e938 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 _0x4cc6=['map','VoiceTransferReport','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','includeAll','include','rows','catch','show','params','options','find','create','body','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','destroy','then','error','stack','name','send','index'];(function(_0x31bd5f,_0xfc786a){var _0x3329a2=function(_0x163869){while(--_0x163869){_0x31bd5f['push'](_0x31bd5f['shift']());}};_0x3329a2(++_0xfc786a);}(_0x4cc6,0xb9));var _0x64cc=function(_0x1196bd,_0xba4aea){_0x1196bd=_0x1196bd-0x0;var _0x26014f=_0x4cc6[_0x1196bd];return _0x26014f;};'use strict';var emlformat=require(_0x64cc('0x0'));var rimraf=require(_0x64cc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x64cc('0x2'));var moment=require(_0x64cc('0x3'));var BPromise=require(_0x64cc('0x4'));var Mustache=require(_0x64cc('0x5'));var util=require(_0x64cc('0x6'));var path=require(_0x64cc('0x7'));var sox=require(_0x64cc('0x8'));var csv=require('to-csv');var ejs=require(_0x64cc('0x9'));var fs=require('fs');var fs_extra=require(_0x64cc('0xa'));var _=require(_0x64cc('0xb'));var squel=require(_0x64cc('0xc'));var crypto=require(_0x64cc('0xd'));var jsforce=require(_0x64cc('0xe'));var deskjs=require(_0x64cc('0xf'));var toCsv=require(_0x64cc('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x64cc('0x11'));var authService=require(_0x64cc('0x12'));var qs=require(_0x64cc('0x13'));var as=require(_0x64cc('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x64cc('0x15'));var utils=require(_0x64cc('0x16'));var config=require(_0x64cc('0x17'));var licenseUtil=require(_0x64cc('0x18'));var db=require(_0x64cc('0x19'))['db'];function respondWithStatusCode(_0x48a8aa,_0x40bbfb){_0x40bbfb=_0x40bbfb||0xcc;return function(_0x236831){if(_0x236831){return _0x48a8aa[_0x64cc('0x1a')](_0x40bbfb);}return _0x48a8aa[_0x64cc('0x1b')](_0x40bbfb)[_0x64cc('0x1c')]();};}function respondWithResult(_0x1c90c5,_0xe7225b){_0xe7225b=_0xe7225b||0xc8;return function(_0x416f04){if(_0x416f04){return _0x1c90c5['status'](_0xe7225b)['json'](_0x416f04);}};}function respondWithFilteredResult(_0x4b7b5a,_0x508069){return function(_0x5f0f11){if(_0x5f0f11){var _0x5400ed=typeof _0x508069[_0x64cc('0x1d')]==='undefined'&&typeof _0x508069['limit']===_0x64cc('0x1e');var _0x3dce9a=_0x5f0f11['count'];var _0xfbabae=_0x5400ed?0x0:_0x508069[_0x64cc('0x1d')];var _0x530ebc=_0x5400ed?_0x5f0f11[_0x64cc('0x1f')]:_0x508069[_0x64cc('0x1d')]+_0x508069[_0x64cc('0x20')];var _0x4e5a18;if(_0x530ebc>=_0x3dce9a){_0x530ebc=_0x3dce9a;_0x4e5a18=0xc8;}else{_0x4e5a18=0xce;}_0x4b7b5a['status'](_0x4e5a18);return _0x4b7b5a[_0x64cc('0x21')](_0x64cc('0x22'),_0xfbabae+'-'+_0x530ebc+'/'+_0x3dce9a)[_0x64cc('0x23')](_0x5f0f11);}return null;};}function patchUpdates(_0x1c1883){return function(_0x2770b8){try{jsonpatch['apply'](_0x2770b8,_0x1c1883,!![]);}catch(_0x31a483){return BPromise[_0x64cc('0x24')](_0x31a483);}return _0x2770b8[_0x64cc('0x25')]();};}function saveUpdates(_0x9b1983,_0x1feaf5){return function(_0x35154f){if(_0x35154f){return _0x35154f[_0x64cc('0x26')](_0x9b1983)['then'](function(_0x35a834){return _0x35a834;});}return null;};}function removeEntity(_0x13287d,_0x13fbcf){return function(_0xcfafeb){if(_0xcfafeb){return _0xcfafeb[_0x64cc('0x27')]()[_0x64cc('0x28')](function(){_0x13287d[_0x64cc('0x1b')](0xcc)[_0x64cc('0x1c')]();});}};}function handleEntityNotFound(_0x295811,_0x50ea78){return function(_0x5ab776){if(!_0x5ab776){_0x295811[_0x64cc('0x1a')](0x194);}return _0x5ab776;};}function handleError(_0x27be26,_0x207799){_0x207799=_0x207799||0x1f4;return function(_0x320966){logger[_0x64cc('0x29')](_0x320966[_0x64cc('0x2a')]);if(_0x320966['name']){delete _0x320966[_0x64cc('0x2b')];}_0x27be26['status'](_0x207799)[_0x64cc('0x2c')](_0x320966);};}exports[_0x64cc('0x2d')]=function(_0xedbcae,_0x2c68fd){var _0x340fae={},_0x419dfe={},_0x4d5588={'count':0x0,'rows':[]};var _0x2d6abf=_[_0x64cc('0x2e')](db[_0x64cc('0x2f')][_0x64cc('0x30')],function(_0x39805e){return{'name':_0x39805e['fieldName'],'type':_0x39805e[_0x64cc('0x31')][_0x64cc('0x32')]};});_0x419dfe[_0x64cc('0x33')]=_[_0x64cc('0x2e')](_0x2d6abf,_0x64cc('0x2b'));_0x419dfe[_0x64cc('0x34')]=_[_0x64cc('0x35')](_0xedbcae[_0x64cc('0x34')]);_0x419dfe['filters']=_[_0x64cc('0x36')](_0x419dfe['model'],_0x419dfe[_0x64cc('0x34')]);_0x340fae[_0x64cc('0x37')]=_[_0x64cc('0x36')](_0x419dfe['model'],qs[_0x64cc('0x38')](_0xedbcae[_0x64cc('0x34')]['fields']));_0x340fae[_0x64cc('0x37')]=_0x340fae[_0x64cc('0x37')][_0x64cc('0x39')]?_0x340fae[_0x64cc('0x37')]:_0x419dfe['model'];if(!_0xedbcae[_0x64cc('0x34')][_0x64cc('0x3a')](_0x64cc('0x3b'))){_0x340fae[_0x64cc('0x20')]=qs[_0x64cc('0x20')](_0xedbcae[_0x64cc('0x34')][_0x64cc('0x20')]);_0x340fae[_0x64cc('0x1d')]=qs['offset'](_0xedbcae['query'][_0x64cc('0x1d')]);}_0x340fae[_0x64cc('0x3c')]=qs[_0x64cc('0x3d')](_0xedbcae[_0x64cc('0x34')]['sort']);_0x340fae['where']=qs[_0x64cc('0x3e')](_['pick'](_0xedbcae[_0x64cc('0x34')],_0x419dfe[_0x64cc('0x3e')]),_0x2d6abf);if(_0xedbcae['query'][_0x64cc('0x3f')]){_0x340fae[_0x64cc('0x40')]=_['merge'](_0x340fae[_0x64cc('0x40')],{'$or':_[_0x64cc('0x2e')](_0x2d6abf,function(_0xa25f0d){if(_0xa25f0d[_0x64cc('0x31')]!=='VIRTUAL'){var _0x935d1c={};_0x935d1c[_0xa25f0d[_0x64cc('0x2b')]]={'$like':'%'+_0xedbcae[_0x64cc('0x34')][_0x64cc('0x3f')]+'%'};return _0x935d1c;}})});}_0x340fae=_[_0x64cc('0x41')]({},_0x340fae,_0xedbcae['options']);var _0x52f40d={'where':_0x340fae[_0x64cc('0x40')]};return db[_0x64cc('0x2f')][_0x64cc('0x1f')](_0x52f40d)[_0x64cc('0x28')](function(_0x15cb55){_0x4d5588[_0x64cc('0x1f')]=_0x15cb55;if(_0xedbcae[_0x64cc('0x34')][_0x64cc('0x42')]){_0x340fae[_0x64cc('0x43')]=[{'all':!![]}];}return db['VoiceTransferReport']['findAll'](_0x340fae);})[_0x64cc('0x28')](function(_0x440a8d){_0x4d5588[_0x64cc('0x44')]=_0x440a8d;return _0x4d5588;})[_0x64cc('0x28')](respondWithFilteredResult(_0x2c68fd,_0x340fae))[_0x64cc('0x45')](handleError(_0x2c68fd,null));};exports[_0x64cc('0x46')]=function(_0x319942,_0x4e7f7a){var _0x5ac60a={'raw':!![],'where':{'id':_0x319942[_0x64cc('0x47')]['id']}},_0x51cf13={};_0x51cf13[_0x64cc('0x33')]=_[_0x64cc('0x35')](db[_0x64cc('0x2f')][_0x64cc('0x30')]);_0x51cf13['query']=_[_0x64cc('0x35')](_0x319942[_0x64cc('0x34')]);_0x51cf13[_0x64cc('0x3e')]=_[_0x64cc('0x36')](_0x51cf13[_0x64cc('0x33')],_0x51cf13[_0x64cc('0x34')]);_0x5ac60a[_0x64cc('0x37')]=_[_0x64cc('0x36')](_0x51cf13[_0x64cc('0x33')],qs[_0x64cc('0x38')](_0x319942[_0x64cc('0x34')][_0x64cc('0x38')]));_0x5ac60a['attributes']=_0x5ac60a['attributes'][_0x64cc('0x39')]?_0x5ac60a[_0x64cc('0x37')]:_0x51cf13[_0x64cc('0x33')];if(_0x319942[_0x64cc('0x34')][_0x64cc('0x42')]){_0x5ac60a[_0x64cc('0x43')]=[{'all':!![]}];}_0x5ac60a=_['merge']({},_0x5ac60a,_0x319942[_0x64cc('0x48')]);return db[_0x64cc('0x2f')][_0x64cc('0x49')](_0x5ac60a)[_0x64cc('0x28')](handleEntityNotFound(_0x4e7f7a,null))['then'](respondWithResult(_0x4e7f7a,null))[_0x64cc('0x45')](handleError(_0x4e7f7a,null));};exports['create']=function(_0xbe923c,_0x53c0de){return db[_0x64cc('0x2f')][_0x64cc('0x4a')](_0xbe923c[_0x64cc('0x4b')],{})[_0x64cc('0x28')](respondWithResult(_0x53c0de,0xc9))[_0x64cc('0x45')](handleError(_0x53c0de,null));};exports[_0x64cc('0x26')]=function(_0x161c11,_0x3b2cff){if(_0x161c11[_0x64cc('0x4b')]['id']){delete _0x161c11[_0x64cc('0x4b')]['id'];}return db['VoiceTransferReport'][_0x64cc('0x49')]({'where':{'id':_0x161c11['params']['id']}})['then'](handleEntityNotFound(_0x3b2cff,null))['then'](saveUpdates(_0x161c11[_0x64cc('0x4b')],null))[_0x64cc('0x28')](respondWithResult(_0x3b2cff,null))['catch'](handleError(_0x3b2cff,null));};exports[_0x64cc('0x27')]=function(_0x9405e6,_0x56bca8){return db['VoiceTransferReport']['find']({'where':{'id':_0x9405e6['params']['id']}})[_0x64cc('0x28')](handleEntityNotFound(_0x56bca8,null))[_0x64cc('0x28')](removeEntity(_0x56bca8,null))[_0x64cc('0x45')](handleError(_0x56bca8,null));};exports['describe']=function(_0x21e338,_0x4e1aaf){return db[_0x64cc('0x2f')][_0x64cc('0x4c')]()[_0x64cc('0x28')](respondWithResult(_0x4e1aaf,null))[_0x64cc('0x45')](handleError(_0x4e1aaf,null));}; \ No newline at end of file +var _0x8207=['merge','VIRTUAL','options','includeAll','include','VoiceTransferReport','findAll','rows','catch','show','fields','length','create','body','find','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','name','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','hasOwnProperty','sort','where','filter'];(function(_0x460a9e,_0x502bec){var _0x5a1555=function(_0x17db3e){while(--_0x17db3e){_0x460a9e['push'](_0x460a9e['shift']());}};_0x5a1555(++_0x502bec);}(_0x8207,0x12d));var _0x7820=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x8207[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7820('0x0'));var zipdir=require(_0x7820('0x1'));var jsonpatch=require(_0x7820('0x2'));var rp=require(_0x7820('0x3'));var moment=require(_0x7820('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7820('0x5'));var util=require(_0x7820('0x6'));var path=require('path');var sox=require(_0x7820('0x7'));var csv=require(_0x7820('0x8'));var ejs=require(_0x7820('0x9'));var fs=require('fs');var fs_extra=require(_0x7820('0xa'));var _=require(_0x7820('0xb'));var squel=require('squel');var crypto=require(_0x7820('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7820('0xd'));var Papa=require(_0x7820('0xe'));var Redis=require('ioredis');var authService=require(_0x7820('0xf'));var qs=require(_0x7820('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7820('0x11'))(_0x7820('0x12'));var utils=require(_0x7820('0x13'));var config=require(_0x7820('0x14'));var licenseUtil=require(_0x7820('0x15'));var db=require(_0x7820('0x16'))['db'];function respondWithStatusCode(_0x131b9e,_0x19a177){_0x19a177=_0x19a177||0xcc;return function(_0x2dfb39){if(_0x2dfb39){return _0x131b9e[_0x7820('0x17')](_0x19a177);}return _0x131b9e['status'](_0x19a177)[_0x7820('0x18')]();};}function respondWithResult(_0x329fa8,_0x24a48b){_0x24a48b=_0x24a48b||0xc8;return function(_0x7714a4){if(_0x7714a4){return _0x329fa8[_0x7820('0x19')](_0x24a48b)[_0x7820('0x1a')](_0x7714a4);}};}function respondWithFilteredResult(_0x375bca,_0x1e2e03){return function(_0x372485){if(_0x372485){var _0x15162f=typeof _0x1e2e03[_0x7820('0x1b')]===_0x7820('0x1c')&&typeof _0x1e2e03[_0x7820('0x1d')]===_0x7820('0x1c');var _0x3909e4=_0x372485[_0x7820('0x1e')];var _0x19d928=_0x15162f?0x0:_0x1e2e03[_0x7820('0x1b')];var _0x55d6e9=_0x15162f?_0x372485[_0x7820('0x1e')]:_0x1e2e03[_0x7820('0x1b')]+_0x1e2e03[_0x7820('0x1d')];var _0xbe1d36;if(_0x55d6e9>=_0x3909e4){_0x55d6e9=_0x3909e4;_0xbe1d36=0xc8;}else{_0xbe1d36=0xce;}_0x375bca['status'](_0xbe1d36);return _0x375bca[_0x7820('0x1f')](_0x7820('0x20'),_0x19d928+'-'+_0x55d6e9+'/'+_0x3909e4)[_0x7820('0x1a')](_0x372485);}return null;};}function patchUpdates(_0x7d1c07){return function(_0x4626d4){try{jsonpatch[_0x7820('0x21')](_0x4626d4,_0x7d1c07,!![]);}catch(_0x53639e){return BPromise[_0x7820('0x22')](_0x53639e);}return _0x4626d4[_0x7820('0x23')]();};}function saveUpdates(_0x367a5f,_0x12b86d){return function(_0x372ef8){if(_0x372ef8){return _0x372ef8[_0x7820('0x24')](_0x367a5f)['then'](function(_0xa876d5){return _0xa876d5;});}return null;};}function removeEntity(_0x15c7d0,_0x18f8a8){return function(_0x4a0bcc){if(_0x4a0bcc){return _0x4a0bcc['destroy']()[_0x7820('0x25')](function(){_0x15c7d0[_0x7820('0x19')](0xcc)[_0x7820('0x18')]();});}};}function handleEntityNotFound(_0x58a77a,_0x35d45f){return function(_0x46ef79){if(!_0x46ef79){_0x58a77a[_0x7820('0x17')](0x194);}return _0x46ef79;};}function handleError(_0x375155,_0x43f14f){_0x43f14f=_0x43f14f||0x1f4;return function(_0x511c9a){logger[_0x7820('0x26')](_0x511c9a['stack']);if(_0x511c9a[_0x7820('0x27')]){delete _0x511c9a[_0x7820('0x27')];}_0x375155[_0x7820('0x19')](_0x43f14f)['send'](_0x511c9a);};}exports['index']=function(_0x18b3fb,_0x1021af){var _0x431f04={},_0x165c64={},_0x41ee2e={'count':0x0,'rows':[]};var _0x9d74d7=_['map'](db['VoiceTransferReport'][_0x7820('0x28')],function(_0x14836a){return{'name':_0x14836a['fieldName'],'type':_0x14836a[_0x7820('0x29')][_0x7820('0x2a')]};});_0x165c64[_0x7820('0x2b')]=_[_0x7820('0x2c')](_0x9d74d7,'name');_0x165c64[_0x7820('0x2d')]=_[_0x7820('0x2e')](_0x18b3fb[_0x7820('0x2d')]);_0x165c64[_0x7820('0x2f')]=_[_0x7820('0x30')](_0x165c64[_0x7820('0x2b')],_0x165c64[_0x7820('0x2d')]);_0x431f04[_0x7820('0x31')]=_[_0x7820('0x30')](_0x165c64[_0x7820('0x2b')],qs['fields'](_0x18b3fb['query']['fields']));_0x431f04['attributes']=_0x431f04[_0x7820('0x31')]['length']?_0x431f04[_0x7820('0x31')]:_0x165c64[_0x7820('0x2b')];if(!_0x18b3fb[_0x7820('0x2d')][_0x7820('0x32')]('nolimit')){_0x431f04[_0x7820('0x1d')]=qs['limit'](_0x18b3fb[_0x7820('0x2d')]['limit']);_0x431f04[_0x7820('0x1b')]=qs[_0x7820('0x1b')](_0x18b3fb[_0x7820('0x2d')]['offset']);}_0x431f04['order']=qs[_0x7820('0x33')](_0x18b3fb[_0x7820('0x2d')]['sort']);_0x431f04[_0x7820('0x34')]=qs[_0x7820('0x2f')](_['pick'](_0x18b3fb[_0x7820('0x2d')],_0x165c64[_0x7820('0x2f')]),_0x9d74d7);if(_0x18b3fb[_0x7820('0x2d')][_0x7820('0x35')]){_0x431f04[_0x7820('0x34')]=_[_0x7820('0x36')](_0x431f04['where'],{'$or':_[_0x7820('0x2c')](_0x9d74d7,function(_0x34b033){if(_0x34b033['type']!==_0x7820('0x37')){var _0x169cae={};_0x169cae[_0x34b033[_0x7820('0x27')]]={'$like':'%'+_0x18b3fb[_0x7820('0x2d')][_0x7820('0x35')]+'%'};return _0x169cae;}})});}_0x431f04=_[_0x7820('0x36')]({},_0x431f04,_0x18b3fb[_0x7820('0x38')]);var _0x5d3cac={'where':_0x431f04[_0x7820('0x34')]};return db['VoiceTransferReport'][_0x7820('0x1e')](_0x5d3cac)[_0x7820('0x25')](function(_0x47e6a6){_0x41ee2e['count']=_0x47e6a6;if(_0x18b3fb['query'][_0x7820('0x39')]){_0x431f04[_0x7820('0x3a')]=[{'all':!![]}];}return db[_0x7820('0x3b')][_0x7820('0x3c')](_0x431f04);})[_0x7820('0x25')](function(_0x19cfb1){_0x41ee2e[_0x7820('0x3d')]=_0x19cfb1;return _0x41ee2e;})[_0x7820('0x25')](respondWithFilteredResult(_0x1021af,_0x431f04))[_0x7820('0x3e')](handleError(_0x1021af,null));};exports[_0x7820('0x3f')]=function(_0x55ba6a,_0x3ccd94){var _0x4708ee={'raw':!![],'where':{'id':_0x55ba6a['params']['id']}},_0x4bc736={};_0x4bc736['model']=_[_0x7820('0x2e')](db[_0x7820('0x3b')][_0x7820('0x28')]);_0x4bc736[_0x7820('0x2d')]=_[_0x7820('0x2e')](_0x55ba6a[_0x7820('0x2d')]);_0x4bc736[_0x7820('0x2f')]=_[_0x7820('0x30')](_0x4bc736['model'],_0x4bc736[_0x7820('0x2d')]);_0x4708ee['attributes']=_[_0x7820('0x30')](_0x4bc736[_0x7820('0x2b')],qs[_0x7820('0x40')](_0x55ba6a[_0x7820('0x2d')][_0x7820('0x40')]));_0x4708ee[_0x7820('0x31')]=_0x4708ee['attributes'][_0x7820('0x41')]?_0x4708ee[_0x7820('0x31')]:_0x4bc736['model'];if(_0x55ba6a[_0x7820('0x2d')][_0x7820('0x39')]){_0x4708ee[_0x7820('0x3a')]=[{'all':!![]}];}_0x4708ee=_[_0x7820('0x36')]({},_0x4708ee,_0x55ba6a[_0x7820('0x38')]);return db[_0x7820('0x3b')]['find'](_0x4708ee)[_0x7820('0x25')](handleEntityNotFound(_0x3ccd94,null))[_0x7820('0x25')](respondWithResult(_0x3ccd94,null))[_0x7820('0x3e')](handleError(_0x3ccd94,null));};exports[_0x7820('0x42')]=function(_0x9f52f9,_0x2f8d3b){return db[_0x7820('0x3b')]['create'](_0x9f52f9[_0x7820('0x43')],{})[_0x7820('0x25')](respondWithResult(_0x2f8d3b,0xc9))[_0x7820('0x3e')](handleError(_0x2f8d3b,null));};exports[_0x7820('0x24')]=function(_0x2f564a,_0x41abd7){if(_0x2f564a[_0x7820('0x43')]['id']){delete _0x2f564a[_0x7820('0x43')]['id'];}return db[_0x7820('0x3b')][_0x7820('0x44')]({'where':{'id':_0x2f564a[_0x7820('0x45')]['id']}})[_0x7820('0x25')](handleEntityNotFound(_0x41abd7,null))[_0x7820('0x25')](saveUpdates(_0x2f564a[_0x7820('0x43')],null))[_0x7820('0x25')](respondWithResult(_0x41abd7,null))[_0x7820('0x3e')](handleError(_0x41abd7,null));};exports['destroy']=function(_0x14fb1d,_0x914cfd){return db['VoiceTransferReport'][_0x7820('0x44')]({'where':{'id':_0x14fb1d['params']['id']}})[_0x7820('0x25')](handleEntityNotFound(_0x914cfd,null))[_0x7820('0x25')](removeEntity(_0x914cfd,null))[_0x7820('0x3e')](handleError(_0x914cfd,null));};exports[_0x7820('0x46')]=function(_0x2dd138,_0x112c0d){return db[_0x7820('0x3b')][_0x7820('0x46')]()[_0x7820('0x25')](respondWithResult(_0x112c0d,null))[_0x7820('0x3e')](handleError(_0x112c0d,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 6e10e15..fdc0fa3 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 _0x4422=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes','define','VoiceTransferReport','report_call_transfer'];(function(_0x3972c0,_0x4b49ea){var _0x1c7018=function(_0x336c8e){while(--_0x336c8e){_0x3972c0['push'](_0x3972c0['shift']());}};_0x1c7018(++_0x4b49ea);}(_0x4422,0x1ce));var _0x2442=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x4422[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x2442('0x0'));var util=require(_0x2442('0x1'));var logger=require(_0x2442('0x2'))(_0x2442('0x3'));var moment=require(_0x2442('0x4'));var BPromise=require(_0x2442('0x5'));var rp=require(_0x2442('0x6'));var fs=require('fs');var path=require(_0x2442('0x7'));var rimraf=require(_0x2442('0x8'));var config=require(_0x2442('0x9'));var attributes=require(_0x2442('0xa'));module['exports']=function(_0x5edb57,_0x511b18){return _0x5edb57[_0x2442('0xb')](_0x2442('0xc'),attributes,{'tableName':_0x2442('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x435e=['api','moment','bluebird','request-promise','define','VoiceTransferReport','lodash','util'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x435e,0x17e));var _0xe435=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0x435e[_0x36884e];return _0x1cc367;};'use strict';var _=require(_0xe435('0x0'));var util=require(_0xe435('0x1'));var logger=require('../../config/logger')(_0xe435('0x2'));var moment=require(_0xe435('0x3'));var BPromise=require(_0xe435('0x4'));var rp=require(_0xe435('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceTransferReport.attributes');module['exports']=function(_0x1d84c0,_0x5d6cdf){return _0x1d84c0[_0xe435('0x6')](_0xe435('0x7'),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 a6b655e..eb85d22 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 _0x4b03=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','catch','lodash','util','moment','bluebird'];(function(_0x4ca6ab,_0x29bc6c){var _0x516678=function(_0x108d0e){while(--_0x108d0e){_0x4ca6ab['push'](_0x4ca6ab['shift']());}};_0x516678(++_0x29bc6c);}(_0x4b03,0x9c));var _0x34b0=function(_0x38dbc4,_0x4e28d9){_0x38dbc4=_0x38dbc4-0x0;var _0x1d0f0f=_0x4b03[_0x38dbc4];return _0x1d0f0f;};'use strict';var _=require(_0x34b0('0x0'));var util=require(_0x34b0('0x1'));var moment=require(_0x34b0('0x2'));var BPromise=require(_0x34b0('0x3'));var rs=require(_0x34b0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x34b0('0x5'))['db'];var utils=require(_0x34b0('0x6'));var logger=require(_0x34b0('0x7'))(_0x34b0('0x8'));var config=require(_0x34b0('0x9'));var jayson=require(_0x34b0('0xa'));var client=jayson[_0x34b0('0xb')][_0x34b0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xd68ec3,_0x37266f,_0x3a2479){return new BPromise(function(_0x1408dc,_0xc6cc48){return client[_0x34b0('0xd')](_0xd68ec3,_0x3a2479)[_0x34b0('0xe')](function(_0x1565e0){logger[_0x34b0('0xf')](_0x34b0('0x10'),_0x37266f,_0x34b0('0x11'));logger[_0x34b0('0x12')](_0x34b0('0x13'),_0x37266f,_0x34b0('0x11'),JSON[_0x34b0('0x14')](_0x1565e0));if(_0x1565e0[_0x34b0('0x15')]){if(_0x1565e0[_0x34b0('0x15')][_0x34b0('0x16')]===0x1f4){logger[_0x34b0('0x15')](_0x34b0('0x10'),_0x37266f,_0x1565e0[_0x34b0('0x15')][_0x34b0('0x17')]);return _0xc6cc48(_0x1565e0['error'][_0x34b0('0x17')]);}logger[_0x34b0('0x15')](_0x34b0('0x10'),_0x37266f,_0x1565e0[_0x34b0('0x15')][_0x34b0('0x17')]);return _0x1408dc(_0x1565e0[_0x34b0('0x15')][_0x34b0('0x17')]);}else{logger[_0x34b0('0xf')](_0x34b0('0x10'),_0x37266f,'request\x20sent');_0x1408dc(_0x1565e0[_0x34b0('0x18')][_0x34b0('0x17')]);}})['catch'](function(_0x4a2b04){logger[_0x34b0('0x15')]('VoiceTransferReport,\x20%s,\x20%s',_0x37266f,_0x4a2b04);_0xc6cc48(_0x4a2b04);});});}exports[_0x34b0('0x19')]=function(_0x5775f3){var _0x2aa40a=this;return new Promise(function(_0x41714b,_0x16fa96){return db[_0x34b0('0x1a')][_0x34b0('0x1b')](_0x5775f3[_0x34b0('0x1c')],{'raw':_0x5775f3[_0x34b0('0x1d')]?_0x5775f3[_0x34b0('0x1d')][_0x34b0('0x1e')]===undefined?!![]:![]:!![]})[_0x34b0('0xe')](function(_0x1d5a96){logger[_0x34b0('0xf')](_0x34b0('0x19'),_0x5775f3);logger[_0x34b0('0x12')]('CreateVoiceTransferReport',_0x5775f3,JSON[_0x34b0('0x14')](_0x1d5a96));_0x41714b(_0x1d5a96);})[_0x34b0('0x1f')](function(_0x15c6de){logger[_0x34b0('0x15')](_0x34b0('0x19'),_0x15c6de[_0x34b0('0x17')],_0x5775f3);_0x16fa96(_0x2aa40a[_0x34b0('0x15')](0x1f4,_0x15c6de['message']));});});}; \ No newline at end of file +var _0xe08a=['error','code','message','result','catch','VoiceTransferReport','create','body','options','raw','CreateVoiceTransferReport','debug','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x5c1b6f,_0x1bf230){var _0x572584=function(_0x58778e){while(--_0x58778e){_0x5c1b6f['push'](_0x5c1b6f['shift']());}};_0x572584(++_0x1bf230);}(_0xe08a,0x1de));var _0xae08=function(_0xc9005a,_0x17285d){_0xc9005a=_0xc9005a-0x0;var _0x5aba9d=_0xe08a[_0xc9005a];return _0x5aba9d;};'use strict';var _=require(_0xae08('0x0'));var util=require(_0xae08('0x1'));var moment=require(_0xae08('0x2'));var BPromise=require(_0xae08('0x3'));var rs=require(_0xae08('0x4'));var fs=require('fs');var Redis=require(_0xae08('0x5'));var db=require(_0xae08('0x6'))['db'];var utils=require(_0xae08('0x7'));var logger=require(_0xae08('0x8'))('rpc');var config=require(_0xae08('0x9'));var jayson=require(_0xae08('0xa'));var client=jayson[_0xae08('0xb')][_0xae08('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x21f9fc,_0x1b7349,_0x4a7d7d){return new BPromise(function(_0x4b6af0,_0x39d610){return client[_0xae08('0xd')](_0x21f9fc,_0x4a7d7d)[_0xae08('0xe')](function(_0x4f8888){logger[_0xae08('0xf')](_0xae08('0x10'),_0x1b7349,_0xae08('0x11'));logger['debug']('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x1b7349,_0xae08('0x11'),JSON['stringify'](_0x4f8888));if(_0x4f8888[_0xae08('0x12')]){if(_0x4f8888[_0xae08('0x12')][_0xae08('0x13')]===0x1f4){logger[_0xae08('0x12')](_0xae08('0x10'),_0x1b7349,_0x4f8888[_0xae08('0x12')]['message']);return _0x39d610(_0x4f8888[_0xae08('0x12')][_0xae08('0x14')]);}logger[_0xae08('0x12')](_0xae08('0x10'),_0x1b7349,_0x4f8888[_0xae08('0x12')][_0xae08('0x14')]);return _0x4b6af0(_0x4f8888[_0xae08('0x12')]['message']);}else{logger[_0xae08('0xf')](_0xae08('0x10'),_0x1b7349,'request\x20sent');_0x4b6af0(_0x4f8888[_0xae08('0x15')][_0xae08('0x14')]);}})[_0xae08('0x16')](function(_0x1a0ff7){logger[_0xae08('0x12')](_0xae08('0x10'),_0x1b7349,_0x1a0ff7);_0x39d610(_0x1a0ff7);});});}exports['CreateVoiceTransferReport']=function(_0x58812f){var _0x4463dd=this;return new Promise(function(_0x1435ca,_0x5618ee){return db[_0xae08('0x17')][_0xae08('0x18')](_0x58812f[_0xae08('0x19')],{'raw':_0x58812f['options']?_0x58812f[_0xae08('0x1a')][_0xae08('0x1b')]===undefined?!![]:![]:!![]})[_0xae08('0xe')](function(_0x38d36a){logger[_0xae08('0xf')](_0xae08('0x1c'),_0x58812f);logger[_0xae08('0x1d')](_0xae08('0x1c'),_0x58812f,JSON[_0xae08('0x1e')](_0x38d36a));_0x1435ca(_0x38d36a);})[_0xae08('0x16')](function(_0x4ce567){logger[_0xae08('0x12')](_0xae08('0x1c'),_0x4ce567[_0xae08('0x14')],_0x58812f);_0x5618ee(_0x4463dd[_0xae08('0x12')](0x1f4,_0x4ce567[_0xae08('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index c6e7647..9952582 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 _0xedd9=['unhold','/calls','calls','/transfer','exports','Router','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','hangup','/answer','answer','/hold','/unhold'];(function(_0x27c3e7,_0x5da5b3){var _0x6b8980=function(_0x5ab889){while(--_0x5ab889){_0x27c3e7['push'](_0x27c3e7['shift']());}};_0x6b8980(++_0x5da5b3);}(_0xedd9,0xfc));var _0x9edd=function(_0x458829,_0x5dae88){_0x458829=_0x458829-0x0;var _0xc0a3c=_0xedd9[_0x458829];return _0xc0a3c;};'use strict';var express=require('express');var router=express[_0x9edd('0x0')]();var auth=require(_0x9edd('0x1'));var controller=require(_0x9edd('0x2'));router[_0x9edd('0x3')](_0x9edd('0x4'),auth[_0x9edd('0x5')](),auth[_0x9edd('0x6')](),controller[_0x9edd('0x7')]);router['post'](_0x9edd('0x8'),auth[_0x9edd('0x5')](),auth[_0x9edd('0x6')](),controller[_0x9edd('0x9')]);router['post'](_0x9edd('0xa'),auth['isAuthenticated'](),auth[_0x9edd('0x6')](),controller[_0x9edd('0xb')]);router[_0x9edd('0x3')](_0x9edd('0xc'),auth['isAuthenticated'](),auth[_0x9edd('0x6')](),controller['hold']);router[_0x9edd('0x3')](_0x9edd('0xd'),auth['isAuthenticated'](),auth[_0x9edd('0x6')](),controller[_0x9edd('0xe')]);router['post'](_0x9edd('0xf'),auth[_0x9edd('0x5')](),auth[_0x9edd('0x6')](),controller[_0x9edd('0x10')]);router[_0x9edd('0x3')](_0x9edd('0x11'),auth[_0x9edd('0x5')](),auth[_0x9edd('0x6')](),controller['transfer']);module[_0x9edd('0x12')]=router; \ No newline at end of file +var _0xe14d=['hangup','answer','/hold','hold','/unhold','unhold','/calls','calls','/transfer','transfer','exports','express','Router','../../components/auth/service','./webbar.controller','/originate','isAuthenticated','originate','post','/hangup','isWebrtcLicence'];(function(_0x25981f,_0x392e24){var _0x2aacbf=function(_0x81d4d5){while(--_0x81d4d5){_0x25981f['push'](_0x25981f['shift']());}};_0x2aacbf(++_0x392e24);}(_0xe14d,0x1ee));var _0xde14=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0xe14d[_0x5e36d1];return _0x950b9e;};'use strict';var express=require(_0xde14('0x0'));var router=express[_0xde14('0x1')]();var auth=require(_0xde14('0x2'));var controller=require(_0xde14('0x3'));router['post'](_0xde14('0x4'),auth[_0xde14('0x5')](),auth['isWebrtcLicence'](),controller[_0xde14('0x6')]);router[_0xde14('0x7')](_0xde14('0x8'),auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0xa')]);router['post']('/answer',auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0xb')]);router[_0xde14('0x7')](_0xde14('0xc'),auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0xd')]);router['post'](_0xde14('0xe'),auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0xf')]);router[_0xde14('0x7')](_0xde14('0x10'),auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0x11')]);router[_0xde14('0x7')](_0xde14('0x12'),auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0x13')]);module[_0xde14('0x14')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 1d92cd5..7e59577 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 _0x1306=['name','status','send','code','catch','User','agent','VoiceChannels','all','then','filter','rows','UserId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','json','userId','callNumber','callbackUrl','entityFound:','user:%s','originate\x20executed!','hangup','hangup\x20fired:','sessionId','format','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','string','callNumber\x20is\x20required','transferNumber\x20is\x20required','info','log','handleError:','error','stack'];(function(_0x5b2fc8,_0x38785c){var _0x244ae0=function(_0xc9331e){while(--_0xc9331e){_0x5b2fc8['push'](_0x5b2fc8['shift']());}};_0x244ae0(++_0x38785c);}(_0x1306,0x17a));var _0x6130=function(_0x44d8a3,_0x2c2663){_0x44d8a3=_0x44d8a3-0x0;var _0x4a9371=_0x1306[_0x44d8a3];return _0x4a9371;};'use strict';var path=require(_0x6130('0x0'));var fs=require('fs');var _=require(_0x6130('0x1'));var db=require(_0x6130('0x2'))['db'];var config=require(_0x6130('0x3'));var util=require(_0x6130('0x4'));var BPromise=require(_0x6130('0x5'));var jayson=require(_0x6130('0x6'));var amiClient=jayson[_0x6130('0x7')][_0x6130('0x8')]({'port':0x232a});var logger=require(_0x6130('0x9'))(_0x6130('0xa'));var Redis=require(_0x6130('0xb'));config[_0x6130('0xc')]=_[_0x6130('0xd')](config[_0x6130('0xc')],{'host':_0x6130('0xe'),'port':0x18eb});var io=require(_0x6130('0xf'))(new Redis(config[_0x6130('0xc')]));var Schema=require(_0x6130('0x10'));var originateValidation=new Schema({'userId':{'type':_0x6130('0x11'),'required':[!![],_0x6130('0x12')]},'callNumber':{'type':_0x6130('0x13'),'required':[!![],_0x6130('0x14')]},'callerId':{'type':_0x6130('0x13')},'callbackUrl':{'type':_0x6130('0x13')}});var hangupValidation=new Schema({'userId':{'type':_0x6130('0x11'),'required':[!![],_0x6130('0x12')]},'sessionId':{'type':_0x6130('0x13'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x6130('0x11'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x6130('0x13'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0x6130('0x12')]},'sessionId':{'type':_0x6130('0x13'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0x6130('0x13'),'required':[!![],_0x6130('0x15')]}});var holdValidation=new Schema({'userId':{'type':_0x6130('0x11'),'required':[!![],_0x6130('0x12')]},'sessionId':{'type':_0x6130('0x13'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x6130('0x11'),'required':[!![],_0x6130('0x12')]},'sessionId':{'type':_0x6130('0x13'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x6130('0x11'),'required':[!![],_0x6130('0x12')]}});var conferenceValidation=new Schema({'userId':{'type':_0x6130('0x11'),'required':[!![],_0x6130('0x12')]}});function emit(_0x39b444,_0x274659,_0x3298f0){logger[_0x6130('0x16')](_0x39b444,_0x274659,JSON['stringify'](_0x3298f0));io['to'](_0x39b444)['emit'](_0x274659,_0x3298f0);}function handleError(_0x1f80e0){return function(_0x49803e){console[_0x6130('0x17')](_0x6130('0x18'),_0x49803e,_0x49803e instanceof RangeError);logger[_0x6130('0x19')](_0x49803e[_0x6130('0x1a')]);if(_0x49803e instanceof RangeError){if(_0x49803e[_0x6130('0x1b')]){delete _0x49803e['name'];}_0x1f80e0[_0x6130('0x1c')](0x194)['send'](_0x49803e);}else{if(_0x49803e[_0x6130('0x1b')]){delete _0x49803e[_0x6130('0x1b')];}_0x1f80e0[_0x6130('0x1c')](0x1f4)[_0x6130('0x1d')](_0x49803e);}};}function checkError(){return function(_0x42f498){if(!_0x42f498){throw new RangeError('NotFound');}return _0x42f498;};}function respondWithRpcPromise(_0x5be413,_0x2c01cd){return new BPromise(function(_0x534390,_0x30b4f2){var _0x289c7b=amiClient;return _0x289c7b['request'](_0x5be413,_0x2c01cd)['then'](function(_0x54fc67){if(_0x54fc67[_0x6130('0x19')]){if(_0x54fc67['error'][_0x6130('0x1e')]===0x1f4){return _0x30b4f2(_0x54fc67['error']['message']);}return _0x534390(_0x54fc67['error']['message']);}else{_0x534390(_0x54fc67['result']);}})[_0x6130('0x1f')](function(_0x1ba07d){_0x30b4f2(_0x1ba07d);});});}function getAgent(_0x4d7442){return db[_0x6130('0x20')]['findOne']({'where':{'id':_0x4d7442,'role':_0x6130('0x21')}})['then'](checkError());}function getAgentCheckSession(_0x5787a6,_0x9196d1){return new BPromise(function(_0x456231,_0x401a31){var _0x2997fd=respondWithRpcPromise(_0x6130('0x22'));var _0x392386=getAgent(_0x5787a6);Promise[_0x6130('0x23')]([_0x2997fd,_0x392386])[_0x6130('0x24')](function(_0x14dff0){var _0x5809e4=_0x14dff0[0x0];var _0x5363cc=_0x14dff0[0x1];var _0x383c56=_[_0x6130('0x25')](_0x5809e4[_0x6130('0x26')],function(_0x4345ac){return _0x4345ac[_0x6130('0x27')]==_0x5363cc['id']&&_0x4345ac['sessionId']==_0x9196d1;});if(_0x383c56[_0x6130('0x28')]==0x1){_0x456231(_0x5363cc);}else{_0x401a31(new RangeError(_0x6130('0x29')+_0x9196d1+_0x6130('0x2a')));}});});}exports[_0x6130('0x2b')]=function(_0x76dfa6,_0x4cf1d3){logger[_0x6130('0x16')](_0x6130('0x2c'),_0x76dfa6[_0x6130('0x2d')]);var _0x4b0c9c=originateValidation[_0x6130('0x10')](_0x76dfa6[_0x6130('0x2d')]);if(_0x4b0c9c[_0x6130('0x28')]>0x0){return _0x4cf1d3[_0x6130('0x1c')](0x190)[_0x6130('0x2e')](_0x4b0c9c);}var _0x6389a3=_0x76dfa6[_0x6130('0x2d')][_0x6130('0x2f')];var _0x25fabf=_0x76dfa6['body'][_0x6130('0x30')];var _0x4df5ed=_0x76dfa6['body']['callerId'];var _0x1ffc85=_0x76dfa6[_0x6130('0x2d')][_0x6130('0x31')];return getAgent(_0x6389a3)[_0x6130('0x24')](function(_0x438cde){logger[_0x6130('0x16')](_0x6130('0x32'),_0x438cde[_0x6130('0x1b')]);emit(util['format'](_0x6130('0x33'),_0x438cde[_0x6130('0x1b')]),'webbar:originate',{'callNumber':_0x25fabf,'callerId':_0x4df5ed,'callbackUrl':_0x1ffc85});return _0x4cf1d3[_0x6130('0x1c')](0xc8)[_0x6130('0x2e')]({'error':![],'message':_0x6130('0x34')});})['catch'](handleError(_0x4cf1d3));};exports[_0x6130('0x35')]=function(_0x147663,_0x501630){logger['info'](_0x6130('0x36'),_0x147663[_0x6130('0x2d')]);var _0x3b1f14=hangupValidation['validate'](_0x147663['body']);if(_0x3b1f14[_0x6130('0x28')]>0x0){return _0x501630[_0x6130('0x1c')](0x190)[_0x6130('0x2e')](_0x3b1f14);}var _0x7d3014=_0x147663[_0x6130('0x2d')][_0x6130('0x2f')];var _0x167b31=_0x147663['body'][_0x6130('0x37')];return getAgent(_0x7d3014)[_0x6130('0x24')](function(_0x101aab){logger[_0x6130('0x16')](_0x6130('0x32'),_0x101aab[_0x6130('0x1b')]);emit(util[_0x6130('0x38')]('user:%s',_0x101aab[_0x6130('0x1b')]),_0x6130('0x39'),{'sessionId':_0x167b31});return _0x501630[_0x6130('0x1c')](0xc8)[_0x6130('0x2e')]({'error':![],'message':_0x6130('0x3a')});})[_0x6130('0x1f')](handleError(_0x501630));};exports[_0x6130('0x3b')]=function(_0x7e02ef,_0x566e43){logger[_0x6130('0x16')](_0x6130('0x3c'),_0x7e02ef[_0x6130('0x2d')]);var _0x4c727b=answerValidation[_0x6130('0x10')](_0x7e02ef[_0x6130('0x2d')]);if(_0x4c727b[_0x6130('0x28')]>0x0){return _0x566e43['status'](0x190)['json'](_0x4c727b);}var _0x3ee3f8=_0x7e02ef[_0x6130('0x2d')][_0x6130('0x2f')];var _0xd87943=_0x7e02ef[_0x6130('0x2d')]['sessionId'];return getAgent(_0x3ee3f8)[_0x6130('0x24')](function(_0xef11b5){logger['info'](_0x6130('0x32'),_0xef11b5[_0x6130('0x1b')]);emit(util[_0x6130('0x38')](_0x6130('0x33'),_0xef11b5[_0x6130('0x1b')]),_0x6130('0x3d'),{'sessionId':_0xd87943});return _0x566e43[_0x6130('0x1c')](0xc8)[_0x6130('0x2e')]({'error':![],'message':'answer\x20executed!'});})['catch'](handleError(_0x566e43));};exports[_0x6130('0x3e')]=function(_0x534a67,_0x28fb1f){logger[_0x6130('0x16')](_0x6130('0x3f'),_0x534a67[_0x6130('0x2d')]);var _0x15adfd=holdValidation[_0x6130('0x10')](_0x534a67[_0x6130('0x2d')]);if(_0x15adfd[_0x6130('0x28')]>0x0){return _0x28fb1f[_0x6130('0x1c')](0x190)[_0x6130('0x2e')](_0x15adfd);}var _0x3936a8=_0x534a67['body'][_0x6130('0x2f')];var _0x134198=_0x534a67[_0x6130('0x2d')][_0x6130('0x37')];return getAgent(_0x3936a8)[_0x6130('0x24')](function(_0x13f591){logger[_0x6130('0x16')](_0x6130('0x32'),_0x13f591[_0x6130('0x1b')]);emit(util[_0x6130('0x38')]('user:%s',_0x13f591[_0x6130('0x1b')]),_0x6130('0x40'),{'sessionId':_0x134198});return _0x28fb1f[_0x6130('0x1c')](0xc8)[_0x6130('0x2e')]({'error':![],'message':_0x6130('0x41')});})[_0x6130('0x1f')](handleError(_0x28fb1f));};exports[_0x6130('0x42')]=function(_0x37ee0c,_0x3a64ef){logger['info'](_0x6130('0x43'),_0x37ee0c[_0x6130('0x2d')]);var _0x1d0240=unholdValidation[_0x6130('0x10')](_0x37ee0c[_0x6130('0x2d')]);if(_0x1d0240[_0x6130('0x28')]>0x0){return _0x3a64ef['status'](0x190)[_0x6130('0x2e')](_0x1d0240);}var _0x1cbd0e=_0x37ee0c[_0x6130('0x2d')]['userId'];var _0x4f5207=_0x37ee0c['body']['sessionId'];return getAgent(_0x1cbd0e)[_0x6130('0x24')](function(_0xa9b10a){logger[_0x6130('0x16')]('entityFound:',_0xa9b10a['name']);emit(util['format']('user:%s',_0xa9b10a[_0x6130('0x1b')]),_0x6130('0x44'),{'sessionId':_0x4f5207});return _0x3a64ef[_0x6130('0x1c')](0xc8)[_0x6130('0x2e')]({'error':![],'message':_0x6130('0x45')});})['catch'](handleError(_0x3a64ef));};exports[_0x6130('0x46')]=function(_0x305d99,_0x49e3cf){logger[_0x6130('0x16')](_0x6130('0x47'),_0x49e3cf[_0x6130('0x2d')]);var _0x32bf20=callsValidation[_0x6130('0x10')](_0x305d99[_0x6130('0x2d')]);if(_0x32bf20[_0x6130('0x28')]>0x0){return _0x49e3cf[_0x6130('0x1c')](0x190)['json'](_0x32bf20);}var _0x159ff8=_0x305d99[_0x6130('0x2d')][_0x6130('0x2f')];var _0x4934ca=respondWithRpcPromise('VoiceChannels');var _0x1b4f82=getAgent(_0x159ff8);return Promise[_0x6130('0x23')]([_0x4934ca,_0x1b4f82])[_0x6130('0x24')](function(_0xc253f){var _0x37b89b=_0xc253f[0x0];var _0x519a0c=_0xc253f[0x1];var _0x29630a=_[_0x6130('0x25')](_0x37b89b[_0x6130('0x26')],function(_0x372c53){return _0x372c53[_0x6130('0x27')]==_0x519a0c['id'];});return _0x49e3cf[_0x6130('0x1c')](0xc8)['json']({'count':_0x29630a['length'],'rows':_0x29630a});})[_0x6130('0x1f')](handleError(_0x49e3cf));};exports[_0x6130('0x48')]=function(_0x5c55cf,_0x442fee){logger[_0x6130('0x16')](_0x6130('0x49'),_0x5c55cf[_0x6130('0x2d')]);var _0x54c565=conferenceValidation[_0x6130('0x10')](_0x5c55cf[_0x6130('0x2d')]);if(_0x54c565[_0x6130('0x28')]>0x0){return _0x442fee[_0x6130('0x1c')](0x190)[_0x6130('0x2e')](_0x54c565);}var _0x198da8=_0x5c55cf[_0x6130('0x2d')][_0x6130('0x2f')];return getAgent(_0x198da8)['then'](function(_0x46f586){logger[_0x6130('0x16')](_0x6130('0x32'),_0x46f586[_0x6130('0x1b')]);emit(util[_0x6130('0x38')](_0x6130('0x33'),_0x46f586['name']),_0x6130('0x4a'));return _0x442fee[_0x6130('0x1c')](0xc8)[_0x6130('0x2e')]({'error':![],'message':_0x6130('0x4b')});})[_0x6130('0x1f')](handleError(_0x442fee));};exports[_0x6130('0x4c')]=function(_0x2d27e6,_0x31d20d){logger[_0x6130('0x16')](_0x6130('0x4d'),_0x2d27e6[_0x6130('0x2d')]);var _0x3a5876=transferValidation['validate'](_0x2d27e6['body']);if(_0x3a5876['length']>0x0){return _0x31d20d['status'](0x190)['json'](_0x3a5876);}var _0x101894=_0x2d27e6[_0x6130('0x2d')]['userId'];var _0x1d8286=_0x2d27e6['body'][_0x6130('0x37')];var _0xf82ecf=_0x2d27e6[_0x6130('0x2d')][_0x6130('0x4e')];return getAgent(_0x101894)[_0x6130('0x24')](function(_0x35f2df){logger[_0x6130('0x16')](_0x6130('0x32'),_0x35f2df['name']);emit(util[_0x6130('0x38')](_0x6130('0x33'),_0x35f2df['name']),_0x6130('0x4f'),{'sessionId':_0x1d8286,'transferNumber':_0xf82ecf});return _0x31d20d[_0x6130('0x1c')](0xc8)[_0x6130('0x2e')]({'error':![],'message':_0x6130('0x50')});})['catch'](handleError(_0x31d20d));}; \ No newline at end of file +var _0x26c2=['../../config/environment','util','bluebird','jayson/promise','http','../../config/logger','ioredis','redis','defaults','localhost','validate','number','userId\x20is\x20required','string','transferNumber\x20is\x20required','info','stringify','log','handleError:','error','stack','name','status','send','NotFound','then','code','message','result','User','findOne','agent','all','filter','rows','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','userId','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','json','originate\x20executed!','catch','hangup','hangup\x20fired:','webbar:hangup','hangup\x20executed!','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','webbar:transfer','transfer\x20executed!'];(function(_0x40236e,_0x2b5c76){var _0x3d61d1=function(_0x369469){while(--_0x369469){_0x40236e['push'](_0x40236e['shift']());}};_0x3d61d1(++_0x2b5c76);}(_0x26c2,0x130));var _0x226c=function(_0x5b096e,_0x18075e){_0x5b096e=_0x5b096e-0x0;var _0x5362c8=_0x26c2[_0x5b096e];return _0x5362c8;};'use strict';var path=require('path');var fs=require('fs');var _=require('lodash');var db=require('../../mysqldb')['db'];var config=require(_0x226c('0x0'));var util=require(_0x226c('0x1'));var BPromise=require(_0x226c('0x2'));var jayson=require(_0x226c('0x3'));var amiClient=jayson['client'][_0x226c('0x4')]({'port':0x232a});var logger=require(_0x226c('0x5'))('webbarapi');var Redis=require(_0x226c('0x6'));config[_0x226c('0x7')]=_[_0x226c('0x8')](config[_0x226c('0x7')],{'host':_0x226c('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x226c('0x7')]));var Schema=require(_0x226c('0xa'));var originateValidation=new Schema({'userId':{'type':_0x226c('0xb'),'required':[!![],_0x226c('0xc')]},'callNumber':{'type':_0x226c('0xd'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0x226c('0xd')},'callbackUrl':{'type':_0x226c('0xd')}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x226c('0xd'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x226c('0xb'),'required':[!![],_0x226c('0xc')]},'sessionId':{'type':_0x226c('0xd'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x226c('0xb'),'required':[!![],_0x226c('0xc')]},'sessionId':{'type':_0x226c('0xd'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':'string','required':[!![],_0x226c('0xe')]}});var holdValidation=new Schema({'userId':{'type':_0x226c('0xb'),'required':[!![],_0x226c('0xc')]},'sessionId':{'type':_0x226c('0xd'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x226c('0xd'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x226c('0xb'),'required':[!![],_0x226c('0xc')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']}});function emit(_0x694eef,_0x2e4a51,_0x30755){logger[_0x226c('0xf')](_0x694eef,_0x2e4a51,JSON[_0x226c('0x10')](_0x30755));io['to'](_0x694eef)['emit'](_0x2e4a51,_0x30755);}function handleError(_0x557ca6){return function(_0x5989e0){console[_0x226c('0x11')](_0x226c('0x12'),_0x5989e0,_0x5989e0 instanceof RangeError);logger[_0x226c('0x13')](_0x5989e0[_0x226c('0x14')]);if(_0x5989e0 instanceof RangeError){if(_0x5989e0['name']){delete _0x5989e0[_0x226c('0x15')];}_0x557ca6[_0x226c('0x16')](0x194)[_0x226c('0x17')](_0x5989e0);}else{if(_0x5989e0[_0x226c('0x15')]){delete _0x5989e0[_0x226c('0x15')];}_0x557ca6[_0x226c('0x16')](0x1f4)['send'](_0x5989e0);}};}function checkError(){return function(_0x13bb6b){if(!_0x13bb6b){throw new RangeError(_0x226c('0x18'));}return _0x13bb6b;};}function respondWithRpcPromise(_0x3e5d1b,_0x269a8f){return new BPromise(function(_0x272f26,_0x57eb9f){var _0x575c7a=amiClient;return _0x575c7a['request'](_0x3e5d1b,_0x269a8f)[_0x226c('0x19')](function(_0x52985c){if(_0x52985c['error']){if(_0x52985c[_0x226c('0x13')][_0x226c('0x1a')]===0x1f4){return _0x57eb9f(_0x52985c[_0x226c('0x13')][_0x226c('0x1b')]);}return _0x272f26(_0x52985c[_0x226c('0x13')]['message']);}else{_0x272f26(_0x52985c[_0x226c('0x1c')]);}})['catch'](function(_0x14d6ec){_0x57eb9f(_0x14d6ec);});});}function getAgent(_0x522431){return db[_0x226c('0x1d')][_0x226c('0x1e')]({'where':{'id':_0x522431,'role':_0x226c('0x1f')}})['then'](checkError());}function getAgentCheckSession(_0x14c49b,_0x4a0b38){return new BPromise(function(_0xbe7c35,_0x4f1b85){var _0x431875=respondWithRpcPromise('VoiceChannels');var _0x40a095=getAgent(_0x14c49b);Promise[_0x226c('0x20')]([_0x431875,_0x40a095])['then'](function(_0x54f175){var _0x3b1e93=_0x54f175[0x0];var _0x3f4c2b=_0x54f175[0x1];var _0x10b66b=_[_0x226c('0x21')](_0x3b1e93[_0x226c('0x22')],function(_0x253aeb){return _0x253aeb[_0x226c('0x23')]==_0x3f4c2b['id']&&_0x253aeb[_0x226c('0x24')]==_0x4a0b38;});if(_0x10b66b[_0x226c('0x25')]==0x1){_0xbe7c35(_0x3f4c2b);}else{_0x4f1b85(new RangeError(_0x226c('0x26')+_0x4a0b38+_0x226c('0x27')));}});});}exports[_0x226c('0x28')]=function(_0x49e901,_0xabaf14){logger[_0x226c('0xf')](_0x226c('0x29'),_0x49e901[_0x226c('0x2a')]);var _0x2399a7=originateValidation['validate'](_0x49e901[_0x226c('0x2a')]);if(_0x2399a7[_0x226c('0x25')]>0x0){return _0xabaf14[_0x226c('0x16')](0x190)['json'](_0x2399a7);}var _0x29a196=_0x49e901['body'][_0x226c('0x2b')];var _0x2f1763=_0x49e901[_0x226c('0x2a')][_0x226c('0x2c')];var _0x3b8868=_0x49e901[_0x226c('0x2a')][_0x226c('0x2d')];var _0x39e942=_0x49e901[_0x226c('0x2a')][_0x226c('0x2e')];return getAgent(_0x29a196)[_0x226c('0x19')](function(_0x3062d7){logger[_0x226c('0xf')](_0x226c('0x2f'),_0x3062d7['name']);emit(util[_0x226c('0x30')](_0x226c('0x31'),_0x3062d7[_0x226c('0x15')]),_0x226c('0x32'),{'callNumber':_0x2f1763,'callerId':_0x3b8868,'callbackUrl':_0x39e942});return _0xabaf14[_0x226c('0x16')](0xc8)[_0x226c('0x33')]({'error':![],'message':_0x226c('0x34')});})[_0x226c('0x35')](handleError(_0xabaf14));};exports[_0x226c('0x36')]=function(_0x4fddb7,_0x5f517e){logger[_0x226c('0xf')](_0x226c('0x37'),_0x4fddb7[_0x226c('0x2a')]);var _0x3cc80c=hangupValidation[_0x226c('0xa')](_0x4fddb7[_0x226c('0x2a')]);if(_0x3cc80c[_0x226c('0x25')]>0x0){return _0x5f517e[_0x226c('0x16')](0x190)[_0x226c('0x33')](_0x3cc80c);}var _0x5f0e95=_0x4fddb7[_0x226c('0x2a')]['userId'];var _0x3927b9=_0x4fddb7[_0x226c('0x2a')][_0x226c('0x24')];return getAgent(_0x5f0e95)['then'](function(_0x507aa8){logger[_0x226c('0xf')](_0x226c('0x2f'),_0x507aa8['name']);emit(util[_0x226c('0x30')](_0x226c('0x31'),_0x507aa8[_0x226c('0x15')]),_0x226c('0x38'),{'sessionId':_0x3927b9});return _0x5f517e['status'](0xc8)[_0x226c('0x33')]({'error':![],'message':_0x226c('0x39')});})[_0x226c('0x35')](handleError(_0x5f517e));};exports['answer']=function(_0x33e851,_0x3a4ba1){logger[_0x226c('0xf')](_0x226c('0x3a'),_0x33e851[_0x226c('0x2a')]);var _0x5bff01=answerValidation['validate'](_0x33e851['body']);if(_0x5bff01[_0x226c('0x25')]>0x0){return _0x3a4ba1[_0x226c('0x16')](0x190)[_0x226c('0x33')](_0x5bff01);}var _0x17e1a8=_0x33e851[_0x226c('0x2a')][_0x226c('0x2b')];var _0x16ae23=_0x33e851[_0x226c('0x2a')][_0x226c('0x24')];return getAgent(_0x17e1a8)['then'](function(_0x51fc2c){logger[_0x226c('0xf')](_0x226c('0x2f'),_0x51fc2c['name']);emit(util[_0x226c('0x30')]('user:%s',_0x51fc2c['name']),_0x226c('0x3b'),{'sessionId':_0x16ae23});return _0x3a4ba1['status'](0xc8)[_0x226c('0x33')]({'error':![],'message':_0x226c('0x3c')});})[_0x226c('0x35')](handleError(_0x3a4ba1));};exports[_0x226c('0x3d')]=function(_0x89b599,_0x1e3cda){logger['info'](_0x226c('0x3e'),_0x89b599['body']);var _0x269d5a=holdValidation[_0x226c('0xa')](_0x89b599[_0x226c('0x2a')]);if(_0x269d5a[_0x226c('0x25')]>0x0){return _0x1e3cda['status'](0x190)[_0x226c('0x33')](_0x269d5a);}var _0x524088=_0x89b599[_0x226c('0x2a')][_0x226c('0x2b')];var _0x2be228=_0x89b599[_0x226c('0x2a')][_0x226c('0x24')];return getAgent(_0x524088)[_0x226c('0x19')](function(_0x4f99f5){logger[_0x226c('0xf')](_0x226c('0x2f'),_0x4f99f5[_0x226c('0x15')]);emit(util[_0x226c('0x30')](_0x226c('0x31'),_0x4f99f5[_0x226c('0x15')]),_0x226c('0x3f'),{'sessionId':_0x2be228});return _0x1e3cda[_0x226c('0x16')](0xc8)[_0x226c('0x33')]({'error':![],'message':_0x226c('0x40')});})[_0x226c('0x35')](handleError(_0x1e3cda));};exports[_0x226c('0x41')]=function(_0x5f3434,_0x552580){logger['info'](_0x226c('0x42'),_0x5f3434[_0x226c('0x2a')]);var _0x1cbf5d=unholdValidation['validate'](_0x5f3434[_0x226c('0x2a')]);if(_0x1cbf5d[_0x226c('0x25')]>0x0){return _0x552580['status'](0x190)[_0x226c('0x33')](_0x1cbf5d);}var _0x10ef6f=_0x5f3434[_0x226c('0x2a')][_0x226c('0x2b')];var _0x2a1d64=_0x5f3434[_0x226c('0x2a')][_0x226c('0x24')];return getAgent(_0x10ef6f)[_0x226c('0x19')](function(_0x4efa3f){logger[_0x226c('0xf')](_0x226c('0x2f'),_0x4efa3f['name']);emit(util[_0x226c('0x30')](_0x226c('0x31'),_0x4efa3f[_0x226c('0x15')]),_0x226c('0x43'),{'sessionId':_0x2a1d64});return _0x552580[_0x226c('0x16')](0xc8)[_0x226c('0x33')]({'error':![],'message':'unhold\x20executed!'});})[_0x226c('0x35')](handleError(_0x552580));};exports['calls']=function(_0x48ace0,_0x11021c){logger[_0x226c('0xf')]('calls\x20fired:',_0x11021c[_0x226c('0x2a')]);var _0x17cfc1=callsValidation[_0x226c('0xa')](_0x48ace0['body']);if(_0x17cfc1[_0x226c('0x25')]>0x0){return _0x11021c[_0x226c('0x16')](0x190)[_0x226c('0x33')](_0x17cfc1);}var _0x24096f=_0x48ace0[_0x226c('0x2a')]['userId'];var _0x147edd=respondWithRpcPromise('VoiceChannels');var _0x4d7c1a=getAgent(_0x24096f);return Promise[_0x226c('0x20')]([_0x147edd,_0x4d7c1a])[_0x226c('0x19')](function(_0x1cc6b3){var _0x503d45=_0x1cc6b3[0x0];var _0xb225d3=_0x1cc6b3[0x1];var _0x121c1b=_['filter'](_0x503d45[_0x226c('0x22')],function(_0x1ccbf4){return _0x1ccbf4[_0x226c('0x23')]==_0xb225d3['id'];});return _0x11021c['status'](0xc8)['json']({'count':_0x121c1b[_0x226c('0x25')],'rows':_0x121c1b});})['catch'](handleError(_0x11021c));};exports[_0x226c('0x44')]=function(_0xfb8c4b,_0x54ba0c){logger['info'](_0x226c('0x45'),_0xfb8c4b[_0x226c('0x2a')]);var _0x3fffaa=conferenceValidation[_0x226c('0xa')](_0xfb8c4b['body']);if(_0x3fffaa[_0x226c('0x25')]>0x0){return _0x54ba0c[_0x226c('0x16')](0x190)[_0x226c('0x33')](_0x3fffaa);}var _0x4cab57=_0xfb8c4b[_0x226c('0x2a')]['userId'];return getAgent(_0x4cab57)[_0x226c('0x19')](function(_0x42adfe){logger[_0x226c('0xf')](_0x226c('0x2f'),_0x42adfe[_0x226c('0x15')]);emit(util[_0x226c('0x30')](_0x226c('0x31'),_0x42adfe[_0x226c('0x15')]),_0x226c('0x46'));return _0x54ba0c[_0x226c('0x16')](0xc8)[_0x226c('0x33')]({'error':![],'message':_0x226c('0x47')});})['catch'](handleError(_0x54ba0c));};exports[_0x226c('0x48')]=function(_0x3d128d,_0x1c3973){logger[_0x226c('0xf')](_0x226c('0x49'),_0x3d128d[_0x226c('0x2a')]);var _0x29ff98=transferValidation['validate'](_0x3d128d[_0x226c('0x2a')]);if(_0x29ff98['length']>0x0){return _0x1c3973[_0x226c('0x16')](0x190)['json'](_0x29ff98);}var _0x20b130=_0x3d128d[_0x226c('0x2a')][_0x226c('0x2b')];var _0x132ac8=_0x3d128d[_0x226c('0x2a')][_0x226c('0x24')];var _0x2d447d=_0x3d128d[_0x226c('0x2a')]['transferNumber'];return getAgent(_0x20b130)[_0x226c('0x19')](function(_0x793d58){logger[_0x226c('0xf')](_0x226c('0x2f'),_0x793d58[_0x226c('0x15')]);emit(util['format'](_0x226c('0x31'),_0x793d58['name']),_0x226c('0x4a'),{'sessionId':_0x132ac8,'transferNumber':_0x2d447d});return _0x1c3973[_0x226c('0x16')](0xc8)[_0x226c('0x33')]({'error':![],'message':_0x226c('0x4b')});})['catch'](handleError(_0x1c3973));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index b1e57aa..6d58454 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 _0x0b0e=['exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','describe','/:id','/:id/dispositions','getDispositions','getAnswers','getAgents','/:id/applications','post','create','addDisposition','/:id/canned_answers','addAgents','notify','put','update','delete','removeDispositions'];(function(_0x198372,_0x137bbf){var _0x161a97=function(_0x461828){while(--_0x461828){_0x198372['push'](_0x198372['shift']());}};_0x161a97(++_0x137bbf);}(_0x0b0e,0x187));var _0xe0b0=function(_0x54b0f3,_0x1fe2f7){_0x54b0f3=_0x54b0f3-0x0;var _0x5ae957=_0x0b0e[_0x54b0f3];return _0x5ae957;};'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')]('/describe',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['show']);router[_0xe0b0('0x9')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0xf')]);router[_0xe0b0('0x9')]('/:id/canned_answers',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x9')]('/:id/users',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x11')]);router[_0xe0b0('0x9')](_0xe0b0('0x12'),auth[_0xe0b0('0xa')](),controller['getApplications']);router[_0xe0b0('0x13')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x14')]);router[_0xe0b0('0x13')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0x15')]);router['post'](_0xe0b0('0x16'),auth[_0xe0b0('0xa')](),controller['addAnswer']);router[_0xe0b0('0x13')]('/:id/users',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x17')]);router['post']('/:id/applications',auth[_0xe0b0('0xa')](),controller['addApplications']);router['post']('/:id/notify',controller[_0xe0b0('0x18')]);router['post']('/:id/send',auth[_0xe0b0('0xa')](),controller['send']);router[_0xe0b0('0x19')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1a')]);router[_0xe0b0('0x1b')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['destroy']);router['delete'](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0x1c')]);router[_0xe0b0('0x1b')]('/:id/canned_answers',auth[_0xe0b0('0xa')](),controller['removeAnswers']);router[_0xe0b0('0x1b')]('/:id/users',auth[_0xe0b0('0xa')](),controller['removeAgents']);module[_0xe0b0('0x1d')]=router; \ No newline at end of file +var _0x9f0e=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','/describe','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','post','/:id/canned_answers','/:id/users','addAgents','/:id/notify','notify','/:id/send','send','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util'];(function(_0x77c228,_0x222bcb){var _0x28a9f=function(_0x490ad3){while(--_0x490ad3){_0x77c228['push'](_0x77c228['shift']());}};_0x28a9f(++_0x222bcb);}(_0x9f0e,0x116));var _0xe9f0=function(_0x22d767,_0x3e1b26){_0x22d767=_0x22d767-0x0;var _0x5ebeec=_0x9f0e[_0x22d767];return _0x5ebeec;};'use strict';var multer=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var path=require(_0xe9f0('0x2'));var timeout=require(_0xe9f0('0x3'));var express=require(_0xe9f0('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe9f0('0x5'));var interaction=require(_0xe9f0('0x6'));var config=require(_0xe9f0('0x7'));var controller=require(_0xe9f0('0x8'));router[_0xe9f0('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe9f0('0x9')](_0xe9f0('0xa'),auth[_0xe9f0('0xb')](),controller['describe']);router[_0xe9f0('0x9')](_0xe9f0('0xc'),auth[_0xe9f0('0xb')](),controller[_0xe9f0('0xd')]);router[_0xe9f0('0x9')](_0xe9f0('0xe'),auth[_0xe9f0('0xb')](),controller[_0xe9f0('0xf')]);router[_0xe9f0('0x9')]('/:id/canned_answers',auth[_0xe9f0('0xb')](),controller[_0xe9f0('0x10')]);router[_0xe9f0('0x9')]('/:id/users',auth[_0xe9f0('0xb')](),controller['getAgents']);router[_0xe9f0('0x9')](_0xe9f0('0x11'),auth[_0xe9f0('0xb')](),controller[_0xe9f0('0x12')]);router['post']('/',auth[_0xe9f0('0xb')](),controller['create']);router[_0xe9f0('0x13')](_0xe9f0('0xe'),auth[_0xe9f0('0xb')](),controller['addDisposition']);router[_0xe9f0('0x13')](_0xe9f0('0x14'),auth[_0xe9f0('0xb')](),controller['addAnswer']);router[_0xe9f0('0x13')](_0xe9f0('0x15'),auth[_0xe9f0('0xb')](),controller[_0xe9f0('0x16')]);router[_0xe9f0('0x13')](_0xe9f0('0x11'),auth[_0xe9f0('0xb')](),controller['addApplications']);router[_0xe9f0('0x13')](_0xe9f0('0x17'),controller[_0xe9f0('0x18')]);router['post'](_0xe9f0('0x19'),auth[_0xe9f0('0xb')](),controller[_0xe9f0('0x1a')]);router[_0xe9f0('0x1b')]('/:id',auth[_0xe9f0('0xb')](),controller[_0xe9f0('0x1c')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xe9f0('0x1d')]);router[_0xe9f0('0x1e')](_0xe9f0('0xe'),auth[_0xe9f0('0xb')](),controller[_0xe9f0('0x1f')]);router['delete'](_0xe9f0('0x14'),auth[_0xe9f0('0xb')](),controller[_0xe9f0('0x20')]);router[_0xe9f0('0x1e')](_0xe9f0('0x15'),auth[_0xe9f0('0xb')](),controller[_0xe9f0('0x21')]);module[_0xe9f0('0x22')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 539d3ab..c3050ec 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 _0x9f8b=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','STRING','name','generate','ENUM','sinch','TEXT','BOOLEAN','INTEGER'];(function(_0x47bcee,_0x5c0311){var _0x4b88a8=function(_0x170762){while(--_0x170762){_0x47bcee['push'](_0x47bcee['shift']());}};_0x4b88a8(++_0x5c0311);}(_0x9f8b,0x82));var _0xb9f8=function(_0x48c784,_0x52b6fc){_0x48c784=_0x48c784-0x0;var _0x4634d9=_0x9f8b[_0x48c784];return _0x4634d9;};'use strict';var Sequelize=require(_0xb9f8('0x0'));var rs=require(_0xb9f8('0x1'));module['exports']={'name':{'type':Sequelize[_0xb9f8('0x2')],'unique':_0xb9f8('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xb9f8('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xb9f8('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xb9f8('0x2')],'defaultValue':function(){return rs[_0xb9f8('0x4')]();}},'phone':{'type':Sequelize[_0xb9f8('0x2')]},'type':{'type':Sequelize[_0xb9f8('0x5')]('twilio',_0xb9f8('0x6'))},'accountSid':{'type':Sequelize[_0xb9f8('0x2')]},'baseUrl':{'type':Sequelize[_0xb9f8('0x2')]},'authToken':{'type':Sequelize[_0xb9f8('0x2')]},'notificationTemplate':{'type':Sequelize[_0xb9f8('0x7')],'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[_0xb9f8('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb9f8('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xb9f8('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb9f8('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb9f8('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb9f8('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb9f8('0x9')],'comment':_0xb9f8('0xa')},'mandatoryDisposition':{'type':Sequelize[_0xb9f8('0x8')],'defaultValue':![],'comment':_0xb9f8('0xb'),'set':function(_0x2aab74){if(!_0x2aab74){this[_0xb9f8('0xc')](_0xb9f8('0xd'),null);}this[_0xb9f8('0xc')]('mandatoryDisposition',_0x2aab74);}},'description':{'type':Sequelize[_0xb9f8('0x2')]}}; \ No newline at end of file +var _0x8e4c=['BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','name','STRING','generate','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x1cdf2a,_0x53e82b){var _0x301f47=function(_0x1b7d72){while(--_0x1b7d72){_0x1cdf2a['push'](_0x1cdf2a['shift']());}};_0x301f47(++_0x53e82b);}(_0x8e4c,0x15f));var _0xc8e4=function(_0x308374,_0x550e85){_0x308374=_0x308374-0x0;var _0x1f71e0=_0x8e4c[_0x308374];return _0x1f71e0;};'use strict';var Sequelize=require(_0xc8e4('0x0'));var rs=require(_0xc8e4('0x1'));module[_0xc8e4('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0xc8e4('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xc8e4('0x4')],'allowNull':![]},'remote':{'type':Sequelize[_0xc8e4('0x4')],'allowNull':![]},'token':{'type':Sequelize[_0xc8e4('0x4')],'defaultValue':function(){return rs[_0xc8e4('0x5')]();}},'phone':{'type':Sequelize[_0xc8e4('0x4')]},'type':{'type':Sequelize['ENUM']('twilio',_0xc8e4('0x6'))},'accountSid':{'type':Sequelize[_0xc8e4('0x4')]},'baseUrl':{'type':Sequelize[_0xc8e4('0x4')]},'authToken':{'type':Sequelize[_0xc8e4('0x4')]},'notificationTemplate':{'type':Sequelize[_0xc8e4('0x7')],'defaultValue':function(){return _0xc8e4('0x8');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xc8e4('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc8e4('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xc8e4('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc8e4('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc8e4('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc8e4('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc8e4('0xa')],'comment':_0xc8e4('0xb')},'mandatoryDisposition':{'type':Sequelize[_0xc8e4('0x9')],'defaultValue':![],'comment':_0xc8e4('0xc'),'set':function(_0x417806){if(!_0x417806){this[_0xc8e4('0xd')]('mandatoryDispositionPauseId',null);}this[_0xc8e4('0xd')](_0xc8e4('0xe'),_0x417806);}},'description':{'type':Sequelize[_0xc8e4('0x4')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 50bcab2..7ab8f59 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 _0x3b63=['fields','attributes','length','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','Disposition','getDispositions','findOne','rawAttributes','hasOwnProperty','pick','WhatsappAccountId','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','Transaction','WhatsappApplication','bulkCreate','findAndCountAll','finally','send','getApplications','notify','whatsapp','Applications','account','statuses','state','read','WhatsappMessage','timestamp','message_id','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','replace','whatsapp:','Body','messageId','MessageSid','sinch','notifications','Sequelize','ValidationError','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','list','mapKey','contact','WhatsappInteraction','interaction','created','autoclose','applications','push','close','unmanaged','*,*,*,*','ContactId','AttachmentId','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','Content-Type','text/xml','\x0a','DESC','List','out','Messages','dataValues','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./whatsappAccount.socket','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','WhatsappAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','get','WhatsappAccounts','stack','name','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','type','key','model','query','keys','filters','intersection'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3b63,0x146));var _0x33b6=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x3b63[_0x484e36];return _0xafc85d;};'use strict';var emlformat=require(_0x33b6('0x0'));var rimraf=require(_0x33b6('0x1'));var zipdir=require(_0x33b6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x33b6('0x3'));var moment=require(_0x33b6('0x4'));var BPromise=require(_0x33b6('0x5'));var Mustache=require(_0x33b6('0x6'));var util=require('util');var path=require('path');var sox=require(_0x33b6('0x7'));var csv=require(_0x33b6('0x8'));var ejs=require(_0x33b6('0x9'));var fs=require('fs');var fs_extra=require(_0x33b6('0xa'));var _=require(_0x33b6('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x33b6('0xc'));var deskjs=require(_0x33b6('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x33b6('0xe'));var Redis=require(_0x33b6('0xf'));var authService=require(_0x33b6('0x10'));var qs=require(_0x33b6('0x11'));var as=require(_0x33b6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x33b6('0x13'))(_0x33b6('0x14'));var utils=require(_0x33b6('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x33b6('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x33b6('0x17')](config[_0x33b6('0x18')],{'host':_0x33b6('0x19'),'port':0x18eb});var socket=require(_0x33b6('0x1a'))(new Redis(config['redis']));require(_0x33b6('0x1b'))['register'](socket);var jayson=require(_0x33b6('0x1c'));var client=jayson[_0x33b6('0x1d')][_0x33b6('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x4e158c,_0x1fef6e,_0x404d17,_0x6c8f55){return new BPromise(function(_0x3e9896,_0x54392f){var _0x47f09a=_0x6c8f55||client;return _0x47f09a[_0x33b6('0x1f')](_0x4e158c,_0x404d17)['then'](function(_0x53c92a){logger[_0x33b6('0x20')]('WhatsappAccount,\x20%s,\x20%s',_0x1fef6e,_0x33b6('0x21'));logger[_0x33b6('0x22')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x1fef6e,_0x33b6('0x21'),JSON[_0x33b6('0x23')](_0x53c92a));if(_0x53c92a[_0x33b6('0x24')]){if(_0x53c92a[_0x33b6('0x24')]['code']===0x1f4){logger['error'](_0x33b6('0x25'),_0x1fef6e,_0x53c92a[_0x33b6('0x24')][_0x33b6('0x26')]);return _0x54392f(_0x53c92a[_0x33b6('0x24')][_0x33b6('0x26')]);}logger[_0x33b6('0x24')](_0x33b6('0x25'),_0x1fef6e,_0x53c92a[_0x33b6('0x24')][_0x33b6('0x26')]);return _0x3e9896(_0x53c92a['error']['message']);}else{logger[_0x33b6('0x20')]('WhatsappAccount,\x20%s,\x20%s',_0x1fef6e,_0x33b6('0x21'));_0x3e9896(_0x53c92a[_0x33b6('0x27')][_0x33b6('0x26')]);}})[_0x33b6('0x28')](function(_0x389737){logger[_0x33b6('0x24')](_0x33b6('0x25'),_0x1fef6e,_0x389737);_0x54392f(_0x389737);});});}function respondWithStatusCode(_0x18e870,_0x3ad086){_0x3ad086=_0x3ad086||0xcc;return function(_0x4372a7){if(_0x4372a7){return _0x18e870[_0x33b6('0x29')](_0x3ad086);}return _0x18e870[_0x33b6('0x2a')](_0x3ad086)[_0x33b6('0x2b')]();};}function respondWithResult(_0x386196,_0x8f9a89){_0x8f9a89=_0x8f9a89||0xc8;return function(_0x241b62){if(_0x241b62){return _0x386196['status'](_0x8f9a89)[_0x33b6('0x2c')](_0x241b62);}};}function respondWithFilteredResult(_0x37023b,_0x30c842){return function(_0xfb45f3){if(_0xfb45f3){var _0x59e062=typeof _0x30c842[_0x33b6('0x2d')]===_0x33b6('0x2e')&&typeof _0x30c842[_0x33b6('0x2f')]===_0x33b6('0x2e');var _0x371c86=_0xfb45f3[_0x33b6('0x30')];var _0x24a765=_0x59e062?0x0:_0x30c842[_0x33b6('0x2d')];var _0x366769=_0x59e062?_0xfb45f3[_0x33b6('0x30')]:_0x30c842[_0x33b6('0x2d')]+_0x30c842[_0x33b6('0x2f')];var _0x5ce06b;if(_0x366769>=_0x371c86){_0x366769=_0x371c86;_0x5ce06b=0xc8;}else{_0x5ce06b=0xce;}_0x37023b[_0x33b6('0x2a')](_0x5ce06b);return _0x37023b[_0x33b6('0x31')](_0x33b6('0x32'),_0x24a765+'-'+_0x366769+'/'+_0x371c86)['json'](_0xfb45f3);}return null;};}function patchUpdates(_0x57fe73){return function(_0x2f6fc7){try{jsonpatch[_0x33b6('0x33')](_0x2f6fc7,_0x57fe73,!![]);}catch(_0x54503c){return BPromise['reject'](_0x54503c);}return _0x2f6fc7[_0x33b6('0x34')]();};}function saveUpdates(_0x140060,_0x4e6095){return function(_0x2ac999){if(_0x2ac999){return _0x2ac999[_0x33b6('0x35')](_0x140060)['then'](function(_0x56d162){return _0x56d162;});}return null;};}function removeEntity(_0x4c24a2,_0x40576d){return function(_0x119a2b){if(_0x119a2b){return _0x119a2b[_0x33b6('0x36')]()[_0x33b6('0x37')](function(){var _0x234408=_0x119a2b[_0x33b6('0x38')]({'plain':!![]});var _0x312e59=_0x33b6('0x39');return db['UserProfileResource']['destroy']({'where':{'type':_0x312e59,'resourceId':_0x234408['id']}})['then'](function(){return _0x119a2b;});})['then'](function(){_0x4c24a2['status'](0xcc)[_0x33b6('0x2b')]();});}};}function handleEntityNotFound(_0xdb2f0d,_0x3e6947){return function(_0x3797d6){if(!_0x3797d6){_0xdb2f0d['sendStatus'](0x194);}return _0x3797d6;};}function handleError(_0x5c7ce1,_0x2fd002){_0x2fd002=_0x2fd002||0x1f4;return function(_0x3a34d2){logger[_0x33b6('0x24')](_0x3a34d2[_0x33b6('0x3a')]);if(_0x3a34d2[_0x33b6('0x3b')]){delete _0x3a34d2[_0x33b6('0x3b')];}_0x5c7ce1[_0x33b6('0x2a')](_0x2fd002)['send'](_0x3a34d2);};}exports[_0x33b6('0x3c')]=function(_0x58392d,_0x51c86f){var _0x1545c9={'include':[{'model':db[_0x33b6('0x3d')],'as':_0x33b6('0x3e')}]},_0x3f0083={},_0x6fe00c={'count':0x0,'rows':[]};var _0x23af55=_[_0x33b6('0x3f')](db[_0x33b6('0x40')]['rawAttributes'],function(_0x11ffef){return{'name':_0x11ffef['fieldName'],'type':_0x11ffef[_0x33b6('0x41')][_0x33b6('0x42')]};});_0x3f0083[_0x33b6('0x43')]=_[_0x33b6('0x3f')](_0x23af55,'name');_0x3f0083[_0x33b6('0x44')]=_[_0x33b6('0x45')](_0x58392d['query']);_0x3f0083[_0x33b6('0x46')]=_['intersection'](_0x3f0083[_0x33b6('0x43')],_0x3f0083['query']);_0x1545c9['attributes']=_[_0x33b6('0x47')](_0x3f0083[_0x33b6('0x43')],qs[_0x33b6('0x48')](_0x58392d['query'][_0x33b6('0x48')]));_0x1545c9[_0x33b6('0x49')]=_0x1545c9[_0x33b6('0x49')][_0x33b6('0x4a')]?_0x1545c9[_0x33b6('0x49')]:_0x3f0083['model'];if(!_0x58392d[_0x33b6('0x44')]['hasOwnProperty'](_0x33b6('0x4b'))){_0x1545c9[_0x33b6('0x2f')]=qs[_0x33b6('0x2f')](_0x58392d[_0x33b6('0x44')][_0x33b6('0x2f')]);_0x1545c9['offset']=qs['offset'](_0x58392d[_0x33b6('0x44')]['offset']);}_0x1545c9[_0x33b6('0x4c')]=qs[_0x33b6('0x4d')](_0x58392d[_0x33b6('0x44')][_0x33b6('0x4d')]);_0x1545c9[_0x33b6('0x4e')]=qs[_0x33b6('0x46')](_['pick'](_0x58392d[_0x33b6('0x44')],_0x3f0083['filters']),_0x23af55);if(_0x58392d[_0x33b6('0x44')][_0x33b6('0x4f')]){_0x1545c9['where']=_['merge'](_0x1545c9['where'],{'$or':_[_0x33b6('0x3f')](_0x23af55,function(_0x4567a1){if(_0x4567a1[_0x33b6('0x41')]!==_0x33b6('0x50')){var _0x55d658={};_0x55d658[_0x4567a1['name']]={'$like':'%'+_0x58392d[_0x33b6('0x44')][_0x33b6('0x4f')]+'%'};return _0x55d658;}})});}_0x1545c9=_[_0x33b6('0x51')]({},_0x1545c9,_0x58392d[_0x33b6('0x52')]);var _0x11c381={'where':_0x1545c9[_0x33b6('0x4e')]};return db[_0x33b6('0x40')][_0x33b6('0x30')](_0x11c381)['then'](function(_0x591757){_0x6fe00c[_0x33b6('0x30')]=_0x591757;if(_0x58392d[_0x33b6('0x44')][_0x33b6('0x53')]){_0x1545c9[_0x33b6('0x54')]=[{'all':!![]}];}return db[_0x33b6('0x40')][_0x33b6('0x55')](_0x1545c9);})[_0x33b6('0x37')](function(_0xa884c6){_0x6fe00c[_0x33b6('0x56')]=_0xa884c6;return _0x6fe00c;})[_0x33b6('0x37')](respondWithFilteredResult(_0x51c86f,_0x1545c9))['catch'](handleError(_0x51c86f,null));};exports['show']=function(_0xd04223,_0x313df3){var _0x448b6e={'raw':![],'where':{'id':_0xd04223['params']['id']},'include':[{'model':db[_0x33b6('0x3d')],'as':'mandatoryDispositionPause'}]},_0x49fa60={};_0x49fa60[_0x33b6('0x43')]=_[_0x33b6('0x45')](db[_0x33b6('0x40')]['rawAttributes']);_0x49fa60['query']=_[_0x33b6('0x45')](_0xd04223['query']);_0x49fa60['filters']=_[_0x33b6('0x47')](_0x49fa60[_0x33b6('0x43')],_0x49fa60[_0x33b6('0x44')]);_0x448b6e[_0x33b6('0x49')]=_[_0x33b6('0x47')](_0x49fa60[_0x33b6('0x43')],qs['fields'](_0xd04223['query'][_0x33b6('0x48')]));_0x448b6e[_0x33b6('0x49')]=_0x448b6e[_0x33b6('0x49')][_0x33b6('0x4a')]?_0x448b6e['attributes']:_0x49fa60[_0x33b6('0x43')];if(_0xd04223['query'][_0x33b6('0x53')]){_0x448b6e['include']=[{'all':!![]}];}_0x448b6e=_[_0x33b6('0x51')]({},_0x448b6e,_0xd04223[_0x33b6('0x52')]);return db[_0x33b6('0x40')][_0x33b6('0x57')](_0x448b6e)['then'](handleEntityNotFound(_0x313df3,null))['then'](respondWithResult(_0x313df3,null))['catch'](handleError(_0x313df3,null));};exports['create']=function(_0x56648a,_0x14beec){return db[_0x33b6('0x40')][_0x33b6('0x58')](_0x56648a['body'],{})[_0x33b6('0x37')](function(_0x40dec8){var _0x5cfc26=_0x56648a[_0x33b6('0x59')]['get']({'plain':!![]});if(!_0x5cfc26)throw new Error(_0x33b6('0x5a'));if(_0x5cfc26[_0x33b6('0x5b')]==='user'){var _0x35a8c5=_0x40dec8['get']({'plain':!![]});var _0x463345=_0x33b6('0x39');return db[_0x33b6('0x5c')][_0x33b6('0x57')]({'where':{'name':_0x463345,'userProfileId':_0x5cfc26[_0x33b6('0x5d')]},'raw':!![]})[_0x33b6('0x37')](function(_0x3c9215){if(_0x3c9215&&_0x3c9215[_0x33b6('0x5e')]===0x0){return db[_0x33b6('0x5f')]['create']({'name':_0x35a8c5[_0x33b6('0x3b')],'resourceId':_0x35a8c5['id'],'type':_0x3c9215[_0x33b6('0x3b')],'sectionId':_0x3c9215['id']},{})[_0x33b6('0x37')](function(){return _0x40dec8;});}else{return _0x40dec8;}})[_0x33b6('0x28')](function(_0x113460){logger[_0x33b6('0x24')](_0x33b6('0x60'),_0x113460);throw _0x113460;});}return _0x40dec8;})[_0x33b6('0x37')](respondWithResult(_0x14beec,0xc9))[_0x33b6('0x28')](handleError(_0x14beec,null));};exports[_0x33b6('0x35')]=function(_0x576781,_0x3f0620){if(_0x576781[_0x33b6('0x61')]['id']){delete _0x576781[_0x33b6('0x61')]['id'];}return db[_0x33b6('0x40')]['find']({'where':{'id':_0x576781[_0x33b6('0x62')]['id']},'include':[{'model':db[_0x33b6('0x3d')],'as':_0x33b6('0x3e')}]})[_0x33b6('0x37')](handleEntityNotFound(_0x3f0620,null))[_0x33b6('0x37')](saveUpdates(_0x576781[_0x33b6('0x61')],null))['then'](respondWithResult(_0x3f0620,null))[_0x33b6('0x28')](handleError(_0x3f0620,null));};exports[_0x33b6('0x36')]=function(_0x5c0657,_0xb81829){return db[_0x33b6('0x40')][_0x33b6('0x57')]({'where':{'id':_0x5c0657['params']['id']}})[_0x33b6('0x37')](handleEntityNotFound(_0xb81829,null))[_0x33b6('0x37')](removeEntity(_0xb81829,null))[_0x33b6('0x28')](handleError(_0xb81829,null));};exports[_0x33b6('0x63')]=function(_0x11072f,_0x1b6866){return db['WhatsappAccount'][_0x33b6('0x63')]()[_0x33b6('0x37')](respondWithResult(_0x1b6866,null))[_0x33b6('0x28')](handleError(_0x1b6866,null));};exports['addDisposition']=function(_0x5a670b,_0x5de48b,_0x1e7ba5){if(_0x5a670b[_0x33b6('0x61')]['id']){delete _0x5a670b[_0x33b6('0x61')]['id'];}return db[_0x33b6('0x40')][_0x33b6('0x57')]({'where':{'id':_0x5a670b['params']['id']}})[_0x33b6('0x37')](handleEntityNotFound(_0x5de48b,null))[_0x33b6('0x37')](function(_0x13af23){if(_0x13af23){_0x5a670b[_0x33b6('0x61')]['WhatsappAccountId']=_0x13af23['id'];return db[_0x33b6('0x64')][_0x33b6('0x58')](_0x5a670b[_0x33b6('0x61')]);}})[_0x33b6('0x37')](respondWithResult(_0x5de48b,null))['catch'](handleError(_0x5de48b,null));};exports[_0x33b6('0x65')]=function(_0xa7c19c,_0x48c057,_0x47d787){var _0x53f53b={'raw':![],'where':{}};var _0x16df5d={};var _0x4cddf2={'count':0x0,'rows':[]};return db[_0x33b6('0x40')][_0x33b6('0x66')]({'where':{'id':_0xa7c19c['params']['id']}})[_0x33b6('0x37')](handleEntityNotFound(_0x48c057,null))[_0x33b6('0x37')](function(_0x34074e){if(_0x34074e){_0x16df5d[_0x33b6('0x43')]=_[_0x33b6('0x45')](db[_0x33b6('0x64')][_0x33b6('0x67')]);_0x16df5d['query']=_['keys'](_0xa7c19c[_0x33b6('0x44')]);_0x16df5d[_0x33b6('0x46')]=_['intersection'](_0x16df5d[_0x33b6('0x43')],_0x16df5d['query']);_0x53f53b['attributes']=_[_0x33b6('0x47')](_0x16df5d[_0x33b6('0x43')],qs[_0x33b6('0x48')](_0xa7c19c[_0x33b6('0x44')][_0x33b6('0x48')]));_0x53f53b[_0x33b6('0x49')]=_0x53f53b['attributes'][_0x33b6('0x4a')]?_0x53f53b['attributes']:_0x16df5d[_0x33b6('0x43')];if(!_0xa7c19c[_0x33b6('0x44')][_0x33b6('0x68')](_0x33b6('0x4b'))){_0x53f53b[_0x33b6('0x2f')]=qs[_0x33b6('0x2f')](_0xa7c19c['query'][_0x33b6('0x2f')]);_0x53f53b[_0x33b6('0x2d')]=qs[_0x33b6('0x2d')](_0xa7c19c[_0x33b6('0x44')][_0x33b6('0x2d')]);}_0x53f53b[_0x33b6('0x4c')]=qs['sort'](_0xa7c19c[_0x33b6('0x44')][_0x33b6('0x4d')]);_0x53f53b[_0x33b6('0x4e')]=qs['filters'](_[_0x33b6('0x69')](_0xa7c19c[_0x33b6('0x44')],_0x16df5d[_0x33b6('0x46')]));_0x53f53b[_0x33b6('0x4e')][_0x33b6('0x6a')]=_0x34074e['id'];if(_0xa7c19c['query']['filter']){_0x53f53b[_0x33b6('0x4e')]=_[_0x33b6('0x51')](_0x53f53b[_0x33b6('0x4e')],{'$or':_[_0x33b6('0x3f')](_0x53f53b[_0x33b6('0x49')],function(_0x21ccaa){var _0x1d2c14={};_0x1d2c14[_0x21ccaa]={'$like':'%'+_0xa7c19c[_0x33b6('0x44')][_0x33b6('0x4f')]+'%'};return _0x1d2c14;})});}_0x53f53b=_[_0x33b6('0x51')]({},_0x53f53b,_0xa7c19c[_0x33b6('0x52')]);return db[_0x33b6('0x64')]['count']({'where':_0x53f53b[_0x33b6('0x4e')]})['then'](function(_0x4180c5){_0x4cddf2[_0x33b6('0x30')]=_0x4180c5;if(_0xa7c19c[_0x33b6('0x44')][_0x33b6('0x53')]){_0x53f53b[_0x33b6('0x54')]=[{'all':!![]}];}return db[_0x33b6('0x64')]['findAll'](_0x53f53b);})[_0x33b6('0x37')](function(_0x244a4f){_0x4cddf2[_0x33b6('0x56')]=_0x244a4f;return _0x4cddf2;});}})['then'](respondWithFilteredResult(_0x48c057,_0x53f53b))[_0x33b6('0x28')](handleError(_0x48c057,null));};exports['removeDispositions']=function(_0x1e7b3e,_0x10cd0d,_0x2186c0){return db['WhatsappAccount'][_0x33b6('0x57')]({'where':{'id':_0x1e7b3e['params']['id']}})[_0x33b6('0x37')](handleEntityNotFound(_0x10cd0d,null))[_0x33b6('0x37')](function(_0x2f1eb7){if(_0x2f1eb7){return _0x2f1eb7[_0x33b6('0x6b')](_0x1e7b3e[_0x33b6('0x44')][_0x33b6('0x6c')]);}})[_0x33b6('0x37')](respondWithStatusCode(_0x10cd0d,null))['catch'](handleError(_0x10cd0d,null));};exports[_0x33b6('0x6d')]=function(_0x4bc6fc,_0x1a6850,_0x310882){if(_0x4bc6fc[_0x33b6('0x61')]['id']){delete _0x4bc6fc[_0x33b6('0x61')]['id'];}return db[_0x33b6('0x40')][_0x33b6('0x57')]({'where':{'id':_0x4bc6fc[_0x33b6('0x62')]['id']}})['then'](handleEntityNotFound(_0x1a6850,null))[_0x33b6('0x37')](function(_0x11c609){if(_0x11c609){_0x4bc6fc[_0x33b6('0x61')][_0x33b6('0x6a')]=_0x11c609['id'];return db[_0x33b6('0x6e')][_0x33b6('0x58')](_0x4bc6fc[_0x33b6('0x61')]);}})['then'](respondWithResult(_0x1a6850,null))[_0x33b6('0x28')](handleError(_0x1a6850,null));};exports['getAnswers']=function(_0x3379ec,_0x118cbe,_0x3c2764){var _0x5793ed={'raw':![],'where':{}};var _0x2be6ef={};var _0x1774f1={'count':0x0,'rows':[]};return db[_0x33b6('0x40')][_0x33b6('0x66')]({'where':{'id':_0x3379ec[_0x33b6('0x62')]['id']}})['then'](handleEntityNotFound(_0x118cbe,null))[_0x33b6('0x37')](function(_0x3da361){if(_0x3da361){_0x2be6ef[_0x33b6('0x43')]=_[_0x33b6('0x45')](db[_0x33b6('0x6e')][_0x33b6('0x67')]);_0x2be6ef[_0x33b6('0x44')]=_['keys'](_0x3379ec[_0x33b6('0x44')]);_0x2be6ef[_0x33b6('0x46')]=_[_0x33b6('0x47')](_0x2be6ef['model'],_0x2be6ef[_0x33b6('0x44')]);_0x5793ed[_0x33b6('0x49')]=_[_0x33b6('0x47')](_0x2be6ef['model'],qs[_0x33b6('0x48')](_0x3379ec['query'][_0x33b6('0x48')]));_0x5793ed['attributes']=_0x5793ed[_0x33b6('0x49')][_0x33b6('0x4a')]?_0x5793ed[_0x33b6('0x49')]:_0x2be6ef[_0x33b6('0x43')];if(!_0x3379ec['query']['hasOwnProperty'](_0x33b6('0x4b'))){_0x5793ed[_0x33b6('0x2f')]=qs[_0x33b6('0x2f')](_0x3379ec[_0x33b6('0x44')][_0x33b6('0x2f')]);_0x5793ed['offset']=qs[_0x33b6('0x2d')](_0x3379ec[_0x33b6('0x44')][_0x33b6('0x2d')]);}_0x5793ed[_0x33b6('0x4c')]=qs['sort'](_0x3379ec[_0x33b6('0x44')]['sort']);_0x5793ed[_0x33b6('0x4e')]=qs[_0x33b6('0x46')](_[_0x33b6('0x69')](_0x3379ec[_0x33b6('0x44')],_0x2be6ef[_0x33b6('0x46')]));_0x5793ed[_0x33b6('0x4e')][_0x33b6('0x6a')]=_0x3da361['id'];if(_0x3379ec[_0x33b6('0x44')]['filter']){_0x5793ed[_0x33b6('0x4e')]=_[_0x33b6('0x51')](_0x5793ed[_0x33b6('0x4e')],{'$or':_[_0x33b6('0x3f')](_0x5793ed[_0x33b6('0x49')],function(_0x5de1bf){var _0x334a30={};_0x334a30[_0x5de1bf]={'$like':'%'+_0x3379ec[_0x33b6('0x44')][_0x33b6('0x4f')]+'%'};return _0x334a30;})});}_0x5793ed=_[_0x33b6('0x51')]({},_0x5793ed,_0x3379ec[_0x33b6('0x52')]);return db['CannedAnswer']['count']({'where':_0x5793ed[_0x33b6('0x4e')]})['then'](function(_0xa88048){_0x1774f1[_0x33b6('0x30')]=_0xa88048;if(_0x3379ec[_0x33b6('0x44')]['includeAll']){_0x5793ed[_0x33b6('0x54')]=[{'all':!![]}];}return db['CannedAnswer'][_0x33b6('0x55')](_0x5793ed);})['then'](function(_0x3746b1){_0x1774f1['rows']=_0x3746b1;return _0x1774f1;});}})[_0x33b6('0x37')](respondWithFilteredResult(_0x118cbe,_0x5793ed))[_0x33b6('0x28')](handleError(_0x118cbe,null));};exports[_0x33b6('0x6f')]=function(_0x4e230b,_0x122e3f,_0x3ca9c9){return db[_0x33b6('0x40')][_0x33b6('0x57')]({'where':{'id':_0x4e230b[_0x33b6('0x62')]['id']}})[_0x33b6('0x37')](handleEntityNotFound(_0x122e3f,null))[_0x33b6('0x37')](function(_0x73bcca){if(_0x73bcca){return _0x73bcca['removeAnswers'](_0x4e230b['query']['ids']);}})[_0x33b6('0x37')](respondWithStatusCode(_0x122e3f,null))['catch'](handleError(_0x122e3f,null));};exports[_0x33b6('0x70')]=function(_0x256f80,_0x3259b3,_0x38dcc5){return db[_0x33b6('0x40')]['find']({'where':{'id':_0x256f80[_0x33b6('0x62')]['id']}})[_0x33b6('0x37')](handleEntityNotFound(_0x3259b3,null))[_0x33b6('0x37')](function(_0x1b3f8a){if(_0x1b3f8a){return _0x1b3f8a[_0x33b6('0x70')](_0x256f80[_0x33b6('0x61')]['ids'],_[_0x33b6('0x71')](_0x256f80['body'],['ids','id'])||{})[_0x33b6('0x72')](function(_0x18dc52){for(var _0x1a7f01=0x0;_0x1a7f01<_0x256f80[_0x33b6('0x61')][_0x33b6('0x6c')][_0x33b6('0x4a')];_0x1a7f01+=0x1){socket[_0x33b6('0x73')](_0x33b6('0x74'),{'UserId':Number(_0x256f80[_0x33b6('0x61')]['ids'][_0x1a7f01]),'WhatsappAccountId':Number(_0x256f80['params']['id'])});}return _0x18dc52;});}})[_0x33b6('0x37')](respondWithResult(_0x3259b3,null))[_0x33b6('0x28')](handleError(_0x3259b3,null));};exports[_0x33b6('0x75')]=function(_0xd69205,_0x668a24,_0x119d17){return db[_0x33b6('0x40')]['find']({'where':{'id':_0xd69205[_0x33b6('0x62')]['id']}})[_0x33b6('0x37')](handleEntityNotFound(_0x668a24,null))[_0x33b6('0x37')](function(_0x151317){if(_0x151317){return _0x151317[_0x33b6('0x75')](_0xd69205['query']['ids'])[_0x33b6('0x37')](function(){if(_[_0x33b6('0x76')](_0xd69205[_0x33b6('0x44')][_0x33b6('0x6c')])){for(var _0x3bac9b=0x0;_0x3bac9b<_0xd69205[_0x33b6('0x44')][_0x33b6('0x6c')][_0x33b6('0x4a')];_0x3bac9b+=0x1){socket[_0x33b6('0x73')](_0x33b6('0x77'),{'UserId':Number(_0xd69205[_0x33b6('0x44')]['ids'][_0x3bac9b]),'WhatsappAccountId':Number(_0xd69205[_0x33b6('0x62')]['id'])});}}else{socket[_0x33b6('0x73')](_0x33b6('0x77'),{'UserId':Number(_0xd69205['query'][_0x33b6('0x6c')]),'WhatsappAccountId':Number(_0xd69205['params']['id'])});}});}})['then'](respondWithStatusCode(_0x668a24,null))['catch'](handleError(_0x668a24,null));};exports[_0x33b6('0x78')]=function(_0x3cb0e9,_0x1f1a14,_0xb5f7e2){var _0xcc8cfb={};var _0x20967c={};var _0x54781;var _0x2e550f;return db[_0x33b6('0x40')]['findOne']({'where':{'id':_0x3cb0e9[_0x33b6('0x62')]['id']}})[_0x33b6('0x37')](handleEntityNotFound(_0x1f1a14,null))[_0x33b6('0x37')](function(_0x37d795){if(_0x37d795){_0x54781=_0x37d795;_0x20967c['model']=_['keys'](db[_0x33b6('0x79')][_0x33b6('0x67')]);_0x20967c[_0x33b6('0x44')]=_[_0x33b6('0x45')](_0x3cb0e9[_0x33b6('0x44')]);_0x20967c[_0x33b6('0x46')]=_[_0x33b6('0x47')](_0x20967c[_0x33b6('0x43')],_0x20967c[_0x33b6('0x44')]);_0xcc8cfb['attributes']=_['intersection'](_0x20967c[_0x33b6('0x43')],qs[_0x33b6('0x48')](_0x3cb0e9['query'][_0x33b6('0x48')]));_0xcc8cfb[_0x33b6('0x49')]=_0xcc8cfb[_0x33b6('0x49')]['length']?_0xcc8cfb['attributes']:_0x20967c['model'];_0xcc8cfb[_0x33b6('0x4c')]=qs['sort'](_0x3cb0e9[_0x33b6('0x44')][_0x33b6('0x4d')]);_0xcc8cfb['where']=qs[_0x33b6('0x46')](_[_0x33b6('0x69')](_0x3cb0e9[_0x33b6('0x44')],_0x20967c[_0x33b6('0x46')]));if(_0x3cb0e9['query'][_0x33b6('0x4f')]){_0xcc8cfb['where']=_['merge'](_0xcc8cfb[_0x33b6('0x4e')],{'$or':_['map'](_0xcc8cfb[_0x33b6('0x49')],function(_0x5ec6fc){var _0xb72f5={};_0xb72f5[_0x5ec6fc]={'$like':'%'+_0x3cb0e9[_0x33b6('0x44')]['filter']+'%'};return _0xb72f5;})});}_0xcc8cfb=_[_0x33b6('0x51')]({},_0xcc8cfb,_0x3cb0e9[_0x33b6('0x52')]);return _0x54781[_0x33b6('0x78')](_0xcc8cfb);}})[_0x33b6('0x37')](function(_0x2708f6){if(_0x2708f6){_0x2e550f=_0x2708f6[_0x33b6('0x4a')];if(!_0x3cb0e9[_0x33b6('0x44')]['hasOwnProperty'](_0x33b6('0x4b'))){_0xcc8cfb[_0x33b6('0x2f')]=qs[_0x33b6('0x2f')](_0x3cb0e9['query'][_0x33b6('0x2f')]);_0xcc8cfb[_0x33b6('0x2d')]=qs[_0x33b6('0x2d')](_0x3cb0e9[_0x33b6('0x44')][_0x33b6('0x2d')]);}return _0x54781[_0x33b6('0x78')](_0xcc8cfb);}})[_0x33b6('0x37')](function(_0x5138e6){if(_0x5138e6){return _0x5138e6?{'count':_0x2e550f,'rows':_0x5138e6}:null;}})[_0x33b6('0x37')](respondWithResult(_0x1f1a14,null))[_0x33b6('0x28')](handleError(_0x1f1a14,null));};exports[_0x33b6('0x7a')]=function(_0x2d6d99,_0x2bd92e){var _0x493a8c=_0x2d6d99[_0x33b6('0x62')]['id'];var _0x593482=_0x2d6d99[_0x33b6('0x61')];var _0x5c0ae2=0xc8;var _0x3c6909=null;return db[_0x33b6('0x7b')][_0x33b6('0x7c')]({'isolationLevel':db[_0x33b6('0x7b')][_0x33b6('0x7d')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x143614){return db['WhatsappAccount'][_0x33b6('0x66')]({'where':{'id':_0x493a8c},'transaction':_0x143614})[_0x33b6('0x37')](function(_0x2ce5e1){if(_0x2ce5e1){return db[_0x33b6('0x7e')][_0x33b6('0x36')]({'where':{'WhatsappAccountId':_0x493a8c},'transaction':_0x143614})[_0x33b6('0x37')](function(){var _0x10ebb9=_[_0x33b6('0x3f')](_0x593482,function(_0x21da74){_0x21da74[_0x33b6('0x6a')]=_0x493a8c;return _0x21da74;});return db[_0x33b6('0x7e')][_0x33b6('0x7f')](_0x10ebb9,{'transaction':_0x143614});});}else{_0x5c0ae2=0x194;_0x3c6909=[];}});})[_0x33b6('0x37')](function(){if(_0x5c0ae2!==0x194){return db['WhatsappApplication'][_0x33b6('0x80')]({'where':{'WhatsappAccountId':_0x493a8c},'order':'priority'})[_0x33b6('0x37')](function(_0x2c79a3){_0x3c6909=_0x2c79a3;});}})[_0x33b6('0x28')](function(_0x378c37){_0x5c0ae2=0x1f4;logger['error'](_0x378c37['stack']);if(_0x378c37[_0x33b6('0x3b')]){delete _0x378c37[_0x33b6('0x3b')];}_0x3c6909=_0x378c37;})[_0x33b6('0x81')](function(){if(_0x3c6909===null){_0x2bd92e[_0x33b6('0x29')](_0x5c0ae2);}else{if(_0x5c0ae2===0x1f4){_0x2bd92e[_0x33b6('0x2a')](_0x5c0ae2)[_0x33b6('0x82')](_0x3c6909);}else{_0x2bd92e[_0x33b6('0x2a')](_0x5c0ae2)[_0x33b6('0x2c')](_0x3c6909);}}});};exports[_0x33b6('0x83')]=function(_0x48e234,_0x238831,_0x43547e){var _0x33000b={};var _0x2a80a9={};var _0xcd1064;var _0x3645a2;return db[_0x33b6('0x40')]['findOne']({'where':{'id':_0x48e234[_0x33b6('0x62')]['id']}})[_0x33b6('0x37')](handleEntityNotFound(_0x238831,null))[_0x33b6('0x37')](function(_0x2d1d7c){if(_0x2d1d7c){_0xcd1064=_0x2d1d7c;_0x2a80a9[_0x33b6('0x43')]=_[_0x33b6('0x45')](db[_0x33b6('0x7e')]['rawAttributes']);_0x2a80a9[_0x33b6('0x44')]=_['keys'](_0x48e234[_0x33b6('0x44')]);_0x2a80a9[_0x33b6('0x46')]=_['intersection'](_0x2a80a9[_0x33b6('0x43')],_0x2a80a9[_0x33b6('0x44')]);_0x33000b[_0x33b6('0x49')]=_['intersection'](_0x2a80a9[_0x33b6('0x43')],qs[_0x33b6('0x48')](_0x48e234[_0x33b6('0x44')][_0x33b6('0x48')]));_0x33000b[_0x33b6('0x49')]=_0x33000b[_0x33b6('0x49')][_0x33b6('0x4a')]?_0x33000b[_0x33b6('0x49')]:_0x2a80a9['model'];_0x33000b[_0x33b6('0x4c')]=qs['sort'](_0x48e234['query'][_0x33b6('0x4d')]);_0x33000b[_0x33b6('0x4e')]=qs[_0x33b6('0x46')](_['pick'](_0x48e234[_0x33b6('0x44')],_0x2a80a9[_0x33b6('0x46')]));if(_0x48e234[_0x33b6('0x44')][_0x33b6('0x4f')]){_0x33000b[_0x33b6('0x4e')]=_[_0x33b6('0x51')](_0x33000b[_0x33b6('0x4e')],{'$or':_[_0x33b6('0x3f')](_0x33000b[_0x33b6('0x49')],function(_0x2c259d){var _0x344de3={};_0x344de3[_0x2c259d]={'$like':'%'+_0x48e234['query']['filter']+'%'};return _0x344de3;})});}_0x33000b=_[_0x33b6('0x51')]({},_0x33000b,_0x48e234[_0x33b6('0x52')]);return _0xcd1064[_0x33b6('0x83')](_0x33000b);}})[_0x33b6('0x37')](function(_0x42fee0){if(_0x42fee0){_0x3645a2=_0x42fee0[_0x33b6('0x4a')];if(!_0x48e234[_0x33b6('0x44')][_0x33b6('0x68')]('nolimit')){_0x33000b[_0x33b6('0x2f')]=qs[_0x33b6('0x2f')](_0x48e234[_0x33b6('0x44')][_0x33b6('0x2f')]);_0x33000b[_0x33b6('0x2d')]=qs[_0x33b6('0x2d')](_0x48e234[_0x33b6('0x44')][_0x33b6('0x2d')]);}return _0xcd1064[_0x33b6('0x83')](_0x33000b);}})[_0x33b6('0x37')](function(_0x19212d){if(_0x19212d){return _0x19212d?{'count':_0x3645a2,'rows':_0x19212d}:null;}})[_0x33b6('0x37')](respondWithResult(_0x238831,null))[_0x33b6('0x28')](handleError(_0x238831,null));};exports[_0x33b6('0x84')]=function(_0x14bc7f,_0x5515a0,_0x5571f5){var _0x1b03ff={'channel':_0x33b6('0x85')};var _0x6d9106=[];var _0x211b63=[];var _0x2330a9={};return db[_0x33b6('0x40')][_0x33b6('0x57')]({'where':{'id':_0x14bc7f[_0x33b6('0x62')]['id']},'include':[{'model':db[_0x33b6('0x7e')],'as':_0x33b6('0x86')}]})[_0x33b6('0x37')](handleEntityNotFound(_0x5515a0,null))[_0x33b6('0x37')](function(_0x5291e1){_0x1b03ff[_0x33b6('0x87')]=_0x5291e1;if(_0x1b03ff[_0x33b6('0x87')]&&_0x1b03ff[_0x33b6('0x87')][_0x33b6('0x41')]==='sinch'&&_0x14bc7f[_0x33b6('0x61')]['statuses']){if(_0x14bc7f[_0x33b6('0x61')][_0x33b6('0x88')][_0x33b6('0x4a')]===0x0)return;if(_0x14bc7f[_0x33b6('0x61')]['statuses'][0x0][_0x33b6('0x89')]!==_0x33b6('0x8a'))return;return db[_0x33b6('0x8b')][_0x33b6('0x35')]({'read':!![],'readAt':_0x14bc7f['body']['statuses'][0x0][_0x33b6('0x8c')]},{'where':{'messageId':_0x14bc7f['body'][_0x33b6('0x88')][0x0][_0x33b6('0x8d')]},'individualHooks':!![]})['then'](function(_0x34db95){return _0x5515a0[_0x33b6('0x2a')](0xc8)[_0x33b6('0x2c')](_0x34db95);});}_0x1b03ff['applications']=_['orderBy'](_0x5291e1[_0x33b6('0x86')],['priority'],['asc']);if(_0x1b03ff[_0x33b6('0x87')][_0x33b6('0x86')]){delete _0x1b03ff[_0x33b6('0x87')]['Applications'];}return db[_0x33b6('0x8e')][_0x33b6('0x63')]()['then'](function(_0x378b67){if(!_0x378b67){throw new db['Sequelize']['ValidationError'](_0x33b6('0x8f'));}_0x6d9106=_[_0x33b6('0x90')](_[_0x33b6('0x45')](_0x378b67),[_0x33b6('0x91'),_0x33b6('0x92')]);_0x211b63=_['difference'](_['keys'](_0x378b67),[_0x33b6('0x91'),_0x33b6('0x92'),_0x33b6('0x93'),_0x33b6('0x94')]);_0x1b03ff['body']={'mapKey':_0x33b6('0x95')};if(_0x1b03ff[_0x33b6('0x87')]&&_0x1b03ff[_0x33b6('0x87')][_0x33b6('0x41')]===_0x33b6('0x96')){_0x1b03ff[_0x33b6('0x61')][_0x33b6('0x97')]=_0x14bc7f[_0x33b6('0x61')][_0x33b6('0x98')][_0x33b6('0x99')](_0x33b6('0x9a'),'');_0x1b03ff[_0x33b6('0x61')][_0x33b6('0x61')]=_0x14bc7f['body'][_0x33b6('0x9b')];_0x1b03ff[_0x33b6('0x61')][_0x33b6('0x9c')]=_0x14bc7f[_0x33b6('0x61')][_0x33b6('0x9d')];}if(_0x1b03ff[_0x33b6('0x87')]&&_0x1b03ff[_0x33b6('0x87')][_0x33b6('0x41')]===_0x33b6('0x9e')){_0x1b03ff['body']['from']=_0x14bc7f[_0x33b6('0x61')][_0x33b6('0x9f')][0x0][_0x33b6('0x97')];_0x1b03ff[_0x33b6('0x61')][_0x33b6('0x61')]=_0x14bc7f['body'][_0x33b6('0x9f')][0x0][_0x33b6('0x26')][_0x33b6('0x61')];_0x1b03ff[_0x33b6('0x61')]['messageId']=_0x14bc7f[_0x33b6('0x61')]['notifications'][0x0][_0x33b6('0x8d')];}if(_0x1b03ff[_0x33b6('0x61')]['id']){delete _0x1b03ff['body']['id'];}if(_['isNil'](_0x1b03ff['body'][_0x33b6('0x97')])){throw new db[(_0x33b6('0xa0'))][(_0x33b6('0xa1'))](_0x33b6('0xa2'));}if(_[_0x33b6('0xa3')](_0x1b03ff[_0x33b6('0x61')][_0x33b6('0x61')])||_0x1b03ff['body'][_0x33b6('0x61')]===''){throw new db[(_0x33b6('0xa0'))][(_0x33b6('0xa1'))](_0x33b6('0xa4'));}if(_[_0x33b6('0xa3')](_0x1b03ff['body']['mapKey'])){throw new db['Sequelize']['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x211b63);}if(!_[_0x33b6('0xa5')](_0x211b63,_0x1b03ff['body']['mapKey'])){throw new db['Sequelize'][(_0x33b6('0xa1'))](_0x33b6('0xa6')+_0x211b63);}_0x2330a9[_0x1b03ff[_0x33b6('0x61')]['mapKey']]=_0x1b03ff['body']['from'];return db[_0x33b6('0xa7')][_0x33b6('0x57')]({'where':{'id':_0x1b03ff[_0x33b6('0x87')][_0x33b6('0x94')]},'include':[{'model':db[_0x33b6('0x8e')],'as':_0x33b6('0xa8'),'where':_0x2330a9,'limit':0x1,'order':[[_0x33b6('0x92'),'DESC']]}]});})['then'](handleEntityNotFound(_0x5515a0,null))['then'](function(_0x272165){if(_0x272165){_0x1b03ff[_0x33b6('0xa9')]=_[_0x33b6('0x71')](_0x272165,[_0x33b6('0xa8')]);if(_0x272165['Contacts'][_0x33b6('0x4a')]){return _0x272165['Contacts'][0x0];}var _0x518fb5=_[_0x33b6('0x17')](_0x1b03ff[_0x33b6('0x61')],{'firstName':_0x1b03ff[_0x33b6('0x61')][_0x33b6('0x97')],'ListId':_0x272165['id']});_0x518fb5[_0x1b03ff['body'][_0x33b6('0xaa')]]=_0x1b03ff[_0x33b6('0x61')][_0x33b6('0x97')];return db[_0x33b6('0x8e')][_0x33b6('0x58')](_0x518fb5,{'fields':_0x6d9106,'raw':!![]});}})[_0x33b6('0x37')](handleEntityNotFound(_0x5515a0,null))[_0x33b6('0x37')](function(_0x41566d){if(_0x41566d){_0x1b03ff[_0x33b6('0xab')]=_0x41566d;var _0x2686b7={'ContactId':_0x41566d['id'],'phone':_0x1b03ff['body']['from'],'WhatsappAccountId':_0x14bc7f['params']['id']};var _0x28ca94={'ContactId':_0x41566d['id'],'WhatsappAccountId':_0x14bc7f['params']['id'],'closed':![]};return db[_0x33b6('0xac')][_0x33b6('0x57')]({'where':_0x28ca94})[_0x33b6('0x37')](function(_0x1b0469){if(_0x1b0469){return[_0x1b0469,![]];}return db['WhatsappInteraction'][_0x33b6('0x58')](_0x2686b7)[_0x33b6('0x37')](function(_0x1b001c){return[_0x1b001c,!![]];});});}})[_0x33b6('0x72')](function(_0x3b7e8c,_0x5652e3){_0x1b03ff[_0x33b6('0xad')]=_0x3b7e8c[_0x33b6('0x38')]({'plain':!![]});_0x1b03ff[_0x33b6('0xad')][_0x33b6('0xae')]=![];if(_0x5652e3){if(_0x1b03ff['account'][_0x33b6('0xaf')]){_0x1b03ff[_0x33b6('0xb0')][_0x33b6('0xb1')]({'id':0x0,'priority':_0x1b03ff['applications']['length']+0x1,'app':_0x33b6('0xb2'),'appdata':_0x33b6('0xb3'),'interval':_0x33b6('0xb4')});}_0x1b03ff[_0x33b6('0xad')][_0x33b6('0xae')]=!![];}return db[_0x33b6('0x8b')][_0x33b6('0x58')]({'phone':_0x1b03ff[_0x33b6('0x61')]['from'],'messageId':_0x1b03ff[_0x33b6('0x61')][_0x33b6('0x9c')],'body':_0x1b03ff[_0x33b6('0x61')][_0x33b6('0x61')],'WhatsappAccountId':_0x14bc7f[_0x33b6('0x62')]['id'],'WhatsappInteractionId':_0x3b7e8c['id'],'direction':'in','ContactId':_0x3b7e8c[_0x33b6('0xb5')],'AttachmentId':_0x1b03ff[_0x33b6('0x61')][_0x33b6('0xb6')]});})['then'](function(_0x3865d6){_0x1b03ff['message']=_0x3865d6;if(_0x1b03ff[_0x33b6('0xad')]['UserId']){return db[_0x33b6('0x79')][_0x33b6('0x57')]({'attributes':['id','name'],'where':{'id':_0x1b03ff[_0x33b6('0xad')]['UserId']}})[_0x33b6('0x37')](function(_0x35b2b1){if(_0x35b2b1){_0x1b03ff['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x33b6('0xb7'),'appdata':_0x35b2b1[_0x33b6('0x3b')]+','+(_0x1b03ff['account'][_0x33b6('0xb8')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x33b6('0xb9'),_0x33b6('0xba'),_0x1b03ff);});}return respondWithRpcPromise(_0x33b6('0xb9'),_0x33b6('0xba'),_0x1b03ff);})['then'](function(_0x2ea246){if(_0x2ea246){var _0x3d9c89=0xc8;var _0x14b6cf=_0x33b6('0xbb');logger[_0x33b6('0x20')](_0x33b6('0xbc'),_0x14b6cf,_0x3d9c89,'entity\x20found');logger[_0x33b6('0x22')](_0x33b6('0xbd'),_0x14b6cf,_0x3d9c89,_0x33b6('0xbe'),JSON['stringify'](_0x2ea246));if(_0x1b03ff[_0x33b6('0x87')][_0x33b6('0x41')]==='twilio'){return _0x5515a0['status'](_0x3d9c89)[_0x33b6('0x31')](_0x33b6('0xbf'),_0x33b6('0xc0'))[_0x33b6('0x82')](_0x33b6('0xc1'));}else{return _0x5515a0[_0x33b6('0x2a')](_0x3d9c89)[_0x33b6('0x2c')](_0x2ea246);}}});})[_0x33b6('0x28')](handleError(_0x5515a0,null));};exports['send']=function(_0x3790c1,_0x3d2825,_0x522a1f){var _0x262d1c,_0x4bfc1e,_0x44a826;if(_[_0x33b6('0xa3')](_0x3790c1[_0x33b6('0x61')][_0x33b6('0x61')])||_0x3790c1[_0x33b6('0x61')][_0x33b6('0x61')]===''){throw new db['Sequelize'][(_0x33b6('0xa1'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x3790c1['body']['to'])){throw new db['Sequelize'][(_0x33b6('0xa1'))]('to\x20is\x20mandatory');}_0x262d1c=_0x3790c1[_0x33b6('0x61')]['to'];return db[_0x33b6('0x40')][_0x33b6('0x57')]({'where':{'id':_0x3790c1[_0x33b6('0x62')]['id']},'include':[{'model':db[_0x33b6('0xa7')],'as':'List','include':[{'model':db['CmContact'],'as':_0x33b6('0xa8'),'where':{'mobile':_0x262d1c},'limit':0x1,'order':[[_0x33b6('0x92'),_0x33b6('0xc2')]]}]}]})[_0x33b6('0x37')](handleEntityNotFound(_0x3d2825,null))[_0x33b6('0x37')](function(_0x1645ed){if(_0x1645ed&&_0x1645ed[_0x33b6('0xc3')]){_0x4bfc1e=_0x1645ed[_0x33b6('0x38')]({'plain':!![]});if(_0x4bfc1e[_0x33b6('0xc3')]&&_0x4bfc1e[_0x33b6('0xc3')][_0x33b6('0xa8')][_0x33b6('0x4a')]){return _0x4bfc1e[_0x33b6('0xc3')]['Contacts'][0x0];}return db[_0x33b6('0x8e')]['create'](_[_0x33b6('0x17')](_0x3790c1[_0x33b6('0x61')],{'firstName':_0x262d1c,'mobile':_0x262d1c,'phone':_0x262d1c,'ListId':_0x4bfc1e[_0x33b6('0x94')]}));}})[_0x33b6('0x37')](handleEntityNotFound(_0x3d2825,null))[_0x33b6('0x37')](function(_0x2efe87){if(_0x2efe87){_0x44a826=_0x2efe87;return db[_0x33b6('0xac')]['find']({'where':{'ContactId':_0x44a826['id'],'closed':![],'WhatsappAccountId':_0x4bfc1e['id']}})['then'](function(_0x20403c){if(_0x20403c){return[_0x20403c,![]];}return db[_0x33b6('0xac')]['create']({'UserId':_0x3790c1['user']['id'],'ContactId':_0x44a826['id'],'WhatsappAccountId':_0x4bfc1e['id'],'phone':_0x262d1c,'firstMsgDirection':_0x33b6('0xc4'),'Messages':[_[_0x33b6('0x51')](_0x3790c1[_0x33b6('0x61')],{'read':![],'body':_0x3790c1[_0x33b6('0x61')][_0x33b6('0x61')],'phone':_0x262d1c,'WhatsappAccountId':_0x4bfc1e['id'],'UserId':_0x3790c1['user']['id'],'ContactId':_0x44a826['id']})]},{'include':[{'model':db[_0x33b6('0x8b')],'as':_0x33b6('0xc5')}]})['then'](function(_0x3d0ea6){return[_0x3d0ea6,!![]];});});}})[_0x33b6('0x72')](function(_0xe7e02e,_0x1b63b6){if(_0x1b63b6){return _0xe7e02e;}return db[_0x33b6('0x8b')][_0x33b6('0x58')](_[_0x33b6('0x51')](_0x3790c1[_0x33b6('0x61')],{'read':![],'body':_0x3790c1[_0x33b6('0x61')][_0x33b6('0x61')],'phone':_0x262d1c,'WhatsappAccountId':_0x4bfc1e['id'],'WhatsappInteractionId':_0xe7e02e['id'],'UserId':_0x3790c1['user']['id'],'ContactId':_0x44a826['id']}))['then'](function(_0x376803){_0xe7e02e[_0x33b6('0xc6')][_0x33b6('0xc5')]=[];_0xe7e02e[_0x33b6('0xc6')][_0x33b6('0xc5')]['push'](_0x376803[_0x33b6('0xc6')]);return _0xe7e02e;});})[_0x33b6('0x37')](respondWithResult(_0x3d2825,null))[_0x33b6('0x28')](handleError(_0x3d2825,null));}; \ No newline at end of file +var _0x4ee9=['startRouting','receiveMessage','entity\x20found','set','Content-Type','text/xml','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','out','Messages','dataValues','rimraf','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','client','request','then','info','WhatsappAccount,\x20%s,\x20%s','debug','request\x20sent','error','code','message','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','WhatsappAccounts','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','rows','show','params','keys','include','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','hasOwnProperty','nolimit','findAll','removeDispositions','ids','CannedAnswer','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','notify','Applications','account','sinch','statuses','state','read','WhatsappMessage','message_id','applications','orderBy','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','mobile','twilio','from','From','replace','whatsapp:','Body','messageId','MessageSid','notifications','isNil','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','ListId','DESC','list','Contacts','WhatsappInteraction','interaction','created','push','unmanaged','*,*,*,*','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start'];(function(_0x5ca1f4,_0x536015){var _0x438707=function(_0x173956){while(--_0x173956){_0x5ca1f4['push'](_0x5ca1f4['shift']());}};_0x438707(++_0x536015);}(_0x4ee9,0x18e));var _0x94ee=function(_0x27aa3f,_0x1b1abf){_0x27aa3f=_0x27aa3f-0x0;var _0x4e4b48=_0x4ee9[_0x27aa3f];return _0x4e4b48;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x94ee('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x94ee('0x1'));var rp=require(_0x94ee('0x2'));var moment=require('moment');var BPromise=require(_0x94ee('0x3'));var Mustache=require('mustache');var util=require(_0x94ee('0x4'));var path=require('path');var sox=require(_0x94ee('0x5'));var csv=require(_0x94ee('0x6'));var ejs=require(_0x94ee('0x7'));var fs=require('fs');var fs_extra=require(_0x94ee('0x8'));var _=require(_0x94ee('0x9'));var squel=require(_0x94ee('0xa'));var crypto=require(_0x94ee('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x94ee('0xc'));var toCsv=require(_0x94ee('0x6'));var querystring=require('querystring');var Papa=require(_0x94ee('0xd'));var Redis=require(_0x94ee('0xe'));var authService=require(_0x94ee('0xf'));var qs=require(_0x94ee('0x10'));var as=require(_0x94ee('0x11'));var hardwareService=require(_0x94ee('0x12'));var logger=require('../../config/logger')(_0x94ee('0x13'));var utils=require(_0x94ee('0x14'));var config=require(_0x94ee('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x94ee('0x16')]=_[_0x94ee('0x17')](config['redis'],{'host':_0x94ee('0x18'),'port':0x18eb});var socket=require(_0x94ee('0x19'))(new Redis(config['redis']));require('./whatsappAccount.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x94ee('0x1a')]['http']({'port':0x232c});function respondWithRpcPromise(_0x3b9ffd,_0x5e6ded,_0x4a6387,_0x3c31df){return new BPromise(function(_0x18fe82,_0x58f991){var _0x3dd59b=_0x3c31df||client;return _0x3dd59b[_0x94ee('0x1b')](_0x3b9ffd,_0x4a6387)[_0x94ee('0x1c')](function(_0x28d595){logger[_0x94ee('0x1d')](_0x94ee('0x1e'),_0x5e6ded,'request\x20sent');logger[_0x94ee('0x1f')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x5e6ded,_0x94ee('0x20'),JSON['stringify'](_0x28d595));if(_0x28d595[_0x94ee('0x21')]){if(_0x28d595[_0x94ee('0x21')][_0x94ee('0x22')]===0x1f4){logger[_0x94ee('0x21')](_0x94ee('0x1e'),_0x5e6ded,_0x28d595[_0x94ee('0x21')][_0x94ee('0x23')]);return _0x58f991(_0x28d595[_0x94ee('0x21')][_0x94ee('0x23')]);}logger[_0x94ee('0x21')]('WhatsappAccount,\x20%s,\x20%s',_0x5e6ded,_0x28d595[_0x94ee('0x21')][_0x94ee('0x23')]);return _0x18fe82(_0x28d595[_0x94ee('0x21')][_0x94ee('0x23')]);}else{logger[_0x94ee('0x1d')]('WhatsappAccount,\x20%s,\x20%s',_0x5e6ded,_0x94ee('0x20'));_0x18fe82(_0x28d595['result'][_0x94ee('0x23')]);}})['catch'](function(_0x342433){logger[_0x94ee('0x21')](_0x94ee('0x1e'),_0x5e6ded,_0x342433);_0x58f991(_0x342433);});});}function respondWithStatusCode(_0x481ee7,_0x2c1ea9){_0x2c1ea9=_0x2c1ea9||0xcc;return function(_0x53260f){if(_0x53260f){return _0x481ee7[_0x94ee('0x24')](_0x2c1ea9);}return _0x481ee7['status'](_0x2c1ea9)[_0x94ee('0x25')]();};}function respondWithResult(_0x31aa9d,_0x25f38f){_0x25f38f=_0x25f38f||0xc8;return function(_0x53a860){if(_0x53a860){return _0x31aa9d[_0x94ee('0x26')](_0x25f38f)[_0x94ee('0x27')](_0x53a860);}};}function respondWithFilteredResult(_0x16c287,_0x548076){return function(_0x7aeb4a){if(_0x7aeb4a){var _0xa3db91=typeof _0x548076[_0x94ee('0x28')]===_0x94ee('0x29')&&typeof _0x548076[_0x94ee('0x2a')]==='undefined';var _0x9621d1=_0x7aeb4a[_0x94ee('0x2b')];var _0x355b49=_0xa3db91?0x0:_0x548076[_0x94ee('0x28')];var _0x1cf250=_0xa3db91?_0x7aeb4a[_0x94ee('0x2b')]:_0x548076[_0x94ee('0x28')]+_0x548076['limit'];var _0x5c5031;if(_0x1cf250>=_0x9621d1){_0x1cf250=_0x9621d1;_0x5c5031=0xc8;}else{_0x5c5031=0xce;}_0x16c287[_0x94ee('0x26')](_0x5c5031);return _0x16c287['set'](_0x94ee('0x2c'),_0x355b49+'-'+_0x1cf250+'/'+_0x9621d1)[_0x94ee('0x27')](_0x7aeb4a);}return null;};}function patchUpdates(_0x4d4cba){return function(_0x548789){try{jsonpatch[_0x94ee('0x2d')](_0x548789,_0x4d4cba,!![]);}catch(_0x2c2217){return BPromise[_0x94ee('0x2e')](_0x2c2217);}return _0x548789[_0x94ee('0x2f')]();};}function saveUpdates(_0x3f16a5,_0x1e622f){return function(_0x25761a){if(_0x25761a){return _0x25761a[_0x94ee('0x30')](_0x3f16a5)[_0x94ee('0x1c')](function(_0xb7e735){return _0xb7e735;});}return null;};}function removeEntity(_0x4875f0,_0xef2514){return function(_0x44aacd){if(_0x44aacd){return _0x44aacd[_0x94ee('0x31')]()[_0x94ee('0x1c')](function(){var _0xd03322=_0x44aacd['get']({'plain':!![]});var _0x1df30d=_0x94ee('0x32');return db[_0x94ee('0x33')][_0x94ee('0x31')]({'where':{'type':_0x1df30d,'resourceId':_0xd03322['id']}})[_0x94ee('0x1c')](function(){return _0x44aacd;});})[_0x94ee('0x1c')](function(){_0x4875f0[_0x94ee('0x26')](0xcc)[_0x94ee('0x25')]();});}};}function handleEntityNotFound(_0x5bfbe7,_0x258395){return function(_0x192fe8){if(!_0x192fe8){_0x5bfbe7[_0x94ee('0x24')](0x194);}return _0x192fe8;};}function handleError(_0x3a0ed2,_0x2bb387){_0x2bb387=_0x2bb387||0x1f4;return function(_0x3ceccb){logger[_0x94ee('0x21')](_0x3ceccb['stack']);if(_0x3ceccb[_0x94ee('0x34')]){delete _0x3ceccb['name'];}_0x3a0ed2[_0x94ee('0x26')](_0x2bb387)[_0x94ee('0x35')](_0x3ceccb);};}exports[_0x94ee('0x36')]=function(_0x27902e,_0x2bdda){var _0x15fb5e={'include':[{'model':db[_0x94ee('0x37')],'as':_0x94ee('0x38')}]},_0x39f0f8={},_0x348816={'count':0x0,'rows':[]};var _0xa0f4c1=_[_0x94ee('0x39')](db[_0x94ee('0x3a')][_0x94ee('0x3b')],function(_0xca2f07){return{'name':_0xca2f07[_0x94ee('0x3c')],'type':_0xca2f07[_0x94ee('0x3d')][_0x94ee('0x3e')]};});_0x39f0f8[_0x94ee('0x3f')]=_[_0x94ee('0x39')](_0xa0f4c1,'name');_0x39f0f8['query']=_['keys'](_0x27902e[_0x94ee('0x40')]);_0x39f0f8['filters']=_[_0x94ee('0x41')](_0x39f0f8[_0x94ee('0x3f')],_0x39f0f8[_0x94ee('0x40')]);_0x15fb5e[_0x94ee('0x42')]=_[_0x94ee('0x41')](_0x39f0f8['model'],qs[_0x94ee('0x43')](_0x27902e[_0x94ee('0x40')][_0x94ee('0x43')]));_0x15fb5e[_0x94ee('0x42')]=_0x15fb5e[_0x94ee('0x42')][_0x94ee('0x44')]?_0x15fb5e[_0x94ee('0x42')]:_0x39f0f8[_0x94ee('0x3f')];if(!_0x27902e[_0x94ee('0x40')]['hasOwnProperty']('nolimit')){_0x15fb5e[_0x94ee('0x2a')]=qs[_0x94ee('0x2a')](_0x27902e['query'][_0x94ee('0x2a')]);_0x15fb5e[_0x94ee('0x28')]=qs[_0x94ee('0x28')](_0x27902e['query'][_0x94ee('0x28')]);}_0x15fb5e[_0x94ee('0x45')]=qs[_0x94ee('0x46')](_0x27902e[_0x94ee('0x40')][_0x94ee('0x46')]);_0x15fb5e[_0x94ee('0x47')]=qs['filters'](_[_0x94ee('0x48')](_0x27902e[_0x94ee('0x40')],_0x39f0f8[_0x94ee('0x49')]),_0xa0f4c1);if(_0x27902e['query'][_0x94ee('0x4a')]){_0x15fb5e[_0x94ee('0x47')]=_[_0x94ee('0x4b')](_0x15fb5e[_0x94ee('0x47')],{'$or':_[_0x94ee('0x39')](_0xa0f4c1,function(_0x1e9891){if(_0x1e9891[_0x94ee('0x3d')]!==_0x94ee('0x4c')){var _0xdf4f8f={};_0xdf4f8f[_0x1e9891['name']]={'$like':'%'+_0x27902e['query'][_0x94ee('0x4a')]+'%'};return _0xdf4f8f;}})});}_0x15fb5e=_['merge']({},_0x15fb5e,_0x27902e[_0x94ee('0x4d')]);var _0x24fbb9={'where':_0x15fb5e[_0x94ee('0x47')]};return db['WhatsappAccount'][_0x94ee('0x2b')](_0x24fbb9)['then'](function(_0x1d8b1a){_0x348816[_0x94ee('0x2b')]=_0x1d8b1a;if(_0x27902e['query'][_0x94ee('0x4e')]){_0x15fb5e['include']=[{'all':!![]}];}return db[_0x94ee('0x3a')]['findAll'](_0x15fb5e);})[_0x94ee('0x1c')](function(_0x4b70e0){_0x348816[_0x94ee('0x4f')]=_0x4b70e0;return _0x348816;})[_0x94ee('0x1c')](respondWithFilteredResult(_0x2bdda,_0x15fb5e))['catch'](handleError(_0x2bdda,null));};exports[_0x94ee('0x50')]=function(_0x57e51d,_0x578579){var _0x27a91={'raw':![],'where':{'id':_0x57e51d[_0x94ee('0x51')]['id']},'include':[{'model':db[_0x94ee('0x37')],'as':_0x94ee('0x38')}]},_0x4855c3={};_0x4855c3[_0x94ee('0x3f')]=_['keys'](db[_0x94ee('0x3a')]['rawAttributes']);_0x4855c3[_0x94ee('0x40')]=_[_0x94ee('0x52')](_0x57e51d[_0x94ee('0x40')]);_0x4855c3['filters']=_[_0x94ee('0x41')](_0x4855c3[_0x94ee('0x3f')],_0x4855c3[_0x94ee('0x40')]);_0x27a91['attributes']=_[_0x94ee('0x41')](_0x4855c3['model'],qs[_0x94ee('0x43')](_0x57e51d[_0x94ee('0x40')][_0x94ee('0x43')]));_0x27a91[_0x94ee('0x42')]=_0x27a91[_0x94ee('0x42')][_0x94ee('0x44')]?_0x27a91['attributes']:_0x4855c3['model'];if(_0x57e51d[_0x94ee('0x40')][_0x94ee('0x4e')]){_0x27a91[_0x94ee('0x53')]=[{'all':!![]}];}_0x27a91=_['merge']({},_0x27a91,_0x57e51d[_0x94ee('0x4d')]);return db[_0x94ee('0x3a')][_0x94ee('0x54')](_0x27a91)[_0x94ee('0x1c')](handleEntityNotFound(_0x578579,null))[_0x94ee('0x1c')](respondWithResult(_0x578579,null))[_0x94ee('0x55')](handleError(_0x578579,null));};exports[_0x94ee('0x56')]=function(_0x2fd1ab,_0x2defef){return db[_0x94ee('0x3a')][_0x94ee('0x56')](_0x2fd1ab[_0x94ee('0x57')],{})[_0x94ee('0x1c')](function(_0x2282f7){var _0x17d395=_0x2fd1ab[_0x94ee('0x58')][_0x94ee('0x59')]({'plain':!![]});if(!_0x17d395)throw new Error(_0x94ee('0x5a'));if(_0x17d395[_0x94ee('0x5b')]===_0x94ee('0x58')){var _0x5218fa=_0x2282f7[_0x94ee('0x59')]({'plain':!![]});var _0x501d2c=_0x94ee('0x32');return db['UserProfileSection']['find']({'where':{'name':_0x501d2c,'userProfileId':_0x17d395[_0x94ee('0x5c')]},'raw':!![]})[_0x94ee('0x1c')](function(_0x1f2e30){if(_0x1f2e30&&_0x1f2e30['autoAssociation']===0x0){return db[_0x94ee('0x33')][_0x94ee('0x56')]({'name':_0x5218fa[_0x94ee('0x34')],'resourceId':_0x5218fa['id'],'type':_0x1f2e30[_0x94ee('0x34')],'sectionId':_0x1f2e30['id']},{})[_0x94ee('0x1c')](function(){return _0x2282f7;});}else{return _0x2282f7;}})[_0x94ee('0x55')](function(_0xa1f3f0){logger['error'](_0x94ee('0x5d'),_0xa1f3f0);throw _0xa1f3f0;});}return _0x2282f7;})[_0x94ee('0x1c')](respondWithResult(_0x2defef,0xc9))[_0x94ee('0x55')](handleError(_0x2defef,null));};exports['update']=function(_0x1c6c68,_0x5b37f3){if(_0x1c6c68['body']['id']){delete _0x1c6c68['body']['id'];}return db[_0x94ee('0x3a')][_0x94ee('0x54')]({'where':{'id':_0x1c6c68['params']['id']},'include':[{'model':db[_0x94ee('0x37')],'as':_0x94ee('0x38')}]})[_0x94ee('0x1c')](handleEntityNotFound(_0x5b37f3,null))['then'](saveUpdates(_0x1c6c68[_0x94ee('0x57')],null))[_0x94ee('0x1c')](respondWithResult(_0x5b37f3,null))[_0x94ee('0x55')](handleError(_0x5b37f3,null));};exports[_0x94ee('0x31')]=function(_0x29e0aa,_0x4faf19){return db[_0x94ee('0x3a')][_0x94ee('0x54')]({'where':{'id':_0x29e0aa[_0x94ee('0x51')]['id']}})['then'](handleEntityNotFound(_0x4faf19,null))['then'](removeEntity(_0x4faf19,null))[_0x94ee('0x55')](handleError(_0x4faf19,null));};exports[_0x94ee('0x5e')]=function(_0x304900,_0x170227){return db['WhatsappAccount']['describe']()[_0x94ee('0x1c')](respondWithResult(_0x170227,null))['catch'](handleError(_0x170227,null));};exports[_0x94ee('0x5f')]=function(_0x193b56,_0x4706de,_0x44a713){if(_0x193b56[_0x94ee('0x57')]['id']){delete _0x193b56[_0x94ee('0x57')]['id'];}return db[_0x94ee('0x3a')][_0x94ee('0x54')]({'where':{'id':_0x193b56[_0x94ee('0x51')]['id']}})[_0x94ee('0x1c')](handleEntityNotFound(_0x4706de,null))[_0x94ee('0x1c')](function(_0xb45179){if(_0xb45179){_0x193b56['body'][_0x94ee('0x60')]=_0xb45179['id'];return db[_0x94ee('0x61')][_0x94ee('0x56')](_0x193b56[_0x94ee('0x57')]);}})['then'](respondWithResult(_0x4706de,null))[_0x94ee('0x55')](handleError(_0x4706de,null));};exports[_0x94ee('0x62')]=function(_0x3eeb1d,_0x8de57a,_0x5099ae){var _0x367ea8={'raw':![],'where':{}};var _0x52e244={};var _0x562ceb={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x94ee('0x63')]({'where':{'id':_0x3eeb1d['params']['id']}})['then'](handleEntityNotFound(_0x8de57a,null))[_0x94ee('0x1c')](function(_0x3af952){if(_0x3af952){_0x52e244[_0x94ee('0x3f')]=_['keys'](db[_0x94ee('0x61')][_0x94ee('0x3b')]);_0x52e244[_0x94ee('0x40')]=_[_0x94ee('0x52')](_0x3eeb1d[_0x94ee('0x40')]);_0x52e244[_0x94ee('0x49')]=_[_0x94ee('0x41')](_0x52e244['model'],_0x52e244[_0x94ee('0x40')]);_0x367ea8[_0x94ee('0x42')]=_[_0x94ee('0x41')](_0x52e244[_0x94ee('0x3f')],qs[_0x94ee('0x43')](_0x3eeb1d[_0x94ee('0x40')][_0x94ee('0x43')]));_0x367ea8[_0x94ee('0x42')]=_0x367ea8[_0x94ee('0x42')]['length']?_0x367ea8['attributes']:_0x52e244['model'];if(!_0x3eeb1d[_0x94ee('0x40')][_0x94ee('0x64')](_0x94ee('0x65'))){_0x367ea8[_0x94ee('0x2a')]=qs[_0x94ee('0x2a')](_0x3eeb1d['query'][_0x94ee('0x2a')]);_0x367ea8[_0x94ee('0x28')]=qs[_0x94ee('0x28')](_0x3eeb1d['query']['offset']);}_0x367ea8[_0x94ee('0x45')]=qs[_0x94ee('0x46')](_0x3eeb1d[_0x94ee('0x40')][_0x94ee('0x46')]);_0x367ea8['where']=qs[_0x94ee('0x49')](_[_0x94ee('0x48')](_0x3eeb1d['query'],_0x52e244[_0x94ee('0x49')]));_0x367ea8[_0x94ee('0x47')][_0x94ee('0x60')]=_0x3af952['id'];if(_0x3eeb1d['query']['filter']){_0x367ea8['where']=_[_0x94ee('0x4b')](_0x367ea8[_0x94ee('0x47')],{'$or':_[_0x94ee('0x39')](_0x367ea8['attributes'],function(_0x18498c){var _0x5f1029={};_0x5f1029[_0x18498c]={'$like':'%'+_0x3eeb1d['query'][_0x94ee('0x4a')]+'%'};return _0x5f1029;})});}_0x367ea8=_[_0x94ee('0x4b')]({},_0x367ea8,_0x3eeb1d[_0x94ee('0x4d')]);return db[_0x94ee('0x61')]['count']({'where':_0x367ea8[_0x94ee('0x47')]})['then'](function(_0x1f69e2){_0x562ceb[_0x94ee('0x2b')]=_0x1f69e2;if(_0x3eeb1d[_0x94ee('0x40')][_0x94ee('0x4e')]){_0x367ea8[_0x94ee('0x53')]=[{'all':!![]}];}return db[_0x94ee('0x61')][_0x94ee('0x66')](_0x367ea8);})[_0x94ee('0x1c')](function(_0x4d51c0){_0x562ceb['rows']=_0x4d51c0;return _0x562ceb;});}})['then'](respondWithFilteredResult(_0x8de57a,_0x367ea8))['catch'](handleError(_0x8de57a,null));};exports[_0x94ee('0x67')]=function(_0x35c786,_0x49d363,_0x4b1626){return db[_0x94ee('0x3a')][_0x94ee('0x54')]({'where':{'id':_0x35c786['params']['id']}})[_0x94ee('0x1c')](handleEntityNotFound(_0x49d363,null))[_0x94ee('0x1c')](function(_0x4e0889){if(_0x4e0889){return _0x4e0889[_0x94ee('0x67')](_0x35c786['query'][_0x94ee('0x68')]);}})['then'](respondWithStatusCode(_0x49d363,null))[_0x94ee('0x55')](handleError(_0x49d363,null));};exports['addAnswer']=function(_0x26fc9d,_0x3167ba,_0x5ed3d7){if(_0x26fc9d[_0x94ee('0x57')]['id']){delete _0x26fc9d['body']['id'];}return db[_0x94ee('0x3a')][_0x94ee('0x54')]({'where':{'id':_0x26fc9d[_0x94ee('0x51')]['id']}})[_0x94ee('0x1c')](handleEntityNotFound(_0x3167ba,null))[_0x94ee('0x1c')](function(_0x44ab2d){if(_0x44ab2d){_0x26fc9d['body']['WhatsappAccountId']=_0x44ab2d['id'];return db[_0x94ee('0x69')]['create'](_0x26fc9d['body']);}})[_0x94ee('0x1c')](respondWithResult(_0x3167ba,null))['catch'](handleError(_0x3167ba,null));};exports['getAnswers']=function(_0x568340,_0xc43afe,_0x350ce7){var _0x1c4732={'raw':![],'where':{}};var _0x528920={};var _0xca72ff={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x94ee('0x63')]({'where':{'id':_0x568340[_0x94ee('0x51')]['id']}})['then'](handleEntityNotFound(_0xc43afe,null))[_0x94ee('0x1c')](function(_0x4571db){if(_0x4571db){_0x528920[_0x94ee('0x3f')]=_[_0x94ee('0x52')](db[_0x94ee('0x69')][_0x94ee('0x3b')]);_0x528920[_0x94ee('0x40')]=_[_0x94ee('0x52')](_0x568340['query']);_0x528920['filters']=_[_0x94ee('0x41')](_0x528920[_0x94ee('0x3f')],_0x528920[_0x94ee('0x40')]);_0x1c4732[_0x94ee('0x42')]=_[_0x94ee('0x41')](_0x528920[_0x94ee('0x3f')],qs[_0x94ee('0x43')](_0x568340['query'][_0x94ee('0x43')]));_0x1c4732[_0x94ee('0x42')]=_0x1c4732[_0x94ee('0x42')]['length']?_0x1c4732[_0x94ee('0x42')]:_0x528920[_0x94ee('0x3f')];if(!_0x568340[_0x94ee('0x40')][_0x94ee('0x64')](_0x94ee('0x65'))){_0x1c4732[_0x94ee('0x2a')]=qs[_0x94ee('0x2a')](_0x568340[_0x94ee('0x40')][_0x94ee('0x2a')]);_0x1c4732['offset']=qs['offset'](_0x568340[_0x94ee('0x40')][_0x94ee('0x28')]);}_0x1c4732[_0x94ee('0x45')]=qs['sort'](_0x568340[_0x94ee('0x40')][_0x94ee('0x46')]);_0x1c4732[_0x94ee('0x47')]=qs['filters'](_[_0x94ee('0x48')](_0x568340[_0x94ee('0x40')],_0x528920[_0x94ee('0x49')]));_0x1c4732[_0x94ee('0x47')][_0x94ee('0x60')]=_0x4571db['id'];if(_0x568340[_0x94ee('0x40')]['filter']){_0x1c4732[_0x94ee('0x47')]=_[_0x94ee('0x4b')](_0x1c4732[_0x94ee('0x47')],{'$or':_[_0x94ee('0x39')](_0x1c4732['attributes'],function(_0x125249){var _0x2907d4={};_0x2907d4[_0x125249]={'$like':'%'+_0x568340[_0x94ee('0x40')][_0x94ee('0x4a')]+'%'};return _0x2907d4;})});}_0x1c4732=_[_0x94ee('0x4b')]({},_0x1c4732,_0x568340[_0x94ee('0x4d')]);return db['CannedAnswer'][_0x94ee('0x2b')]({'where':_0x1c4732[_0x94ee('0x47')]})[_0x94ee('0x1c')](function(_0x10f415){_0xca72ff[_0x94ee('0x2b')]=_0x10f415;if(_0x568340[_0x94ee('0x40')][_0x94ee('0x4e')]){_0x1c4732['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x94ee('0x66')](_0x1c4732);})['then'](function(_0x4a6605){_0xca72ff['rows']=_0x4a6605;return _0xca72ff;});}})['then'](respondWithFilteredResult(_0xc43afe,_0x1c4732))[_0x94ee('0x55')](handleError(_0xc43afe,null));};exports['removeAnswers']=function(_0x136953,_0x1568f9,_0x2d8e9b){return db[_0x94ee('0x3a')][_0x94ee('0x54')]({'where':{'id':_0x136953[_0x94ee('0x51')]['id']}})[_0x94ee('0x1c')](handleEntityNotFound(_0x1568f9,null))[_0x94ee('0x1c')](function(_0x595dc7){if(_0x595dc7){return _0x595dc7[_0x94ee('0x6a')](_0x136953[_0x94ee('0x40')][_0x94ee('0x68')]);}})[_0x94ee('0x1c')](respondWithStatusCode(_0x1568f9,null))[_0x94ee('0x55')](handleError(_0x1568f9,null));};exports[_0x94ee('0x6b')]=function(_0x44fdfd,_0x1fe2f7,_0x114c46){return db['WhatsappAccount'][_0x94ee('0x54')]({'where':{'id':_0x44fdfd[_0x94ee('0x51')]['id']}})[_0x94ee('0x1c')](handleEntityNotFound(_0x1fe2f7,null))[_0x94ee('0x1c')](function(_0xa396c3){if(_0xa396c3){return _0xa396c3[_0x94ee('0x6b')](_0x44fdfd[_0x94ee('0x57')][_0x94ee('0x68')],_[_0x94ee('0x6c')](_0x44fdfd[_0x94ee('0x57')],[_0x94ee('0x68'),'id'])||{})[_0x94ee('0x6d')](function(_0x4f661c){for(var _0x2de59a=0x0;_0x2de59a<_0x44fdfd[_0x94ee('0x57')][_0x94ee('0x68')][_0x94ee('0x44')];_0x2de59a+=0x1){socket[_0x94ee('0x6e')](_0x94ee('0x6f'),{'UserId':Number(_0x44fdfd[_0x94ee('0x57')][_0x94ee('0x68')][_0x2de59a]),'WhatsappAccountId':Number(_0x44fdfd['params']['id'])});}return _0x4f661c;});}})[_0x94ee('0x1c')](respondWithResult(_0x1fe2f7,null))[_0x94ee('0x55')](handleError(_0x1fe2f7,null));};exports[_0x94ee('0x70')]=function(_0x171124,_0x312e13,_0x196658){return db[_0x94ee('0x3a')][_0x94ee('0x54')]({'where':{'id':_0x171124[_0x94ee('0x51')]['id']}})['then'](handleEntityNotFound(_0x312e13,null))[_0x94ee('0x1c')](function(_0x1664e1){if(_0x1664e1){return _0x1664e1[_0x94ee('0x70')](_0x171124[_0x94ee('0x40')][_0x94ee('0x68')])[_0x94ee('0x1c')](function(){if(_[_0x94ee('0x71')](_0x171124[_0x94ee('0x40')]['ids'])){for(var _0x3a5f79=0x0;_0x3a5f79<_0x171124[_0x94ee('0x40')]['ids'][_0x94ee('0x44')];_0x3a5f79+=0x1){socket['emit'](_0x94ee('0x72'),{'UserId':Number(_0x171124['query']['ids'][_0x3a5f79]),'WhatsappAccountId':Number(_0x171124[_0x94ee('0x51')]['id'])});}}else{socket[_0x94ee('0x6e')](_0x94ee('0x72'),{'UserId':Number(_0x171124[_0x94ee('0x40')][_0x94ee('0x68')]),'WhatsappAccountId':Number(_0x171124[_0x94ee('0x51')]['id'])});}});}})[_0x94ee('0x1c')](respondWithStatusCode(_0x312e13,null))[_0x94ee('0x55')](handleError(_0x312e13,null));};exports['getAgents']=function(_0x34f77c,_0xf48ccf,_0x27dc9e){var _0x6b1f11={};var _0x54f3be={};var _0x26987b;var _0x49544a;return db[_0x94ee('0x3a')][_0x94ee('0x63')]({'where':{'id':_0x34f77c[_0x94ee('0x51')]['id']}})[_0x94ee('0x1c')](handleEntityNotFound(_0xf48ccf,null))[_0x94ee('0x1c')](function(_0x1358f5){if(_0x1358f5){_0x26987b=_0x1358f5;_0x54f3be['model']=_[_0x94ee('0x52')](db['User'][_0x94ee('0x3b')]);_0x54f3be[_0x94ee('0x40')]=_[_0x94ee('0x52')](_0x34f77c[_0x94ee('0x40')]);_0x54f3be[_0x94ee('0x49')]=_[_0x94ee('0x41')](_0x54f3be[_0x94ee('0x3f')],_0x54f3be['query']);_0x6b1f11[_0x94ee('0x42')]=_[_0x94ee('0x41')](_0x54f3be[_0x94ee('0x3f')],qs[_0x94ee('0x43')](_0x34f77c[_0x94ee('0x40')][_0x94ee('0x43')]));_0x6b1f11[_0x94ee('0x42')]=_0x6b1f11[_0x94ee('0x42')][_0x94ee('0x44')]?_0x6b1f11['attributes']:_0x54f3be[_0x94ee('0x3f')];_0x6b1f11[_0x94ee('0x45')]=qs[_0x94ee('0x46')](_0x34f77c[_0x94ee('0x40')][_0x94ee('0x46')]);_0x6b1f11[_0x94ee('0x47')]=qs['filters'](_[_0x94ee('0x48')](_0x34f77c[_0x94ee('0x40')],_0x54f3be['filters']));if(_0x34f77c[_0x94ee('0x40')][_0x94ee('0x4a')]){_0x6b1f11[_0x94ee('0x47')]=_[_0x94ee('0x4b')](_0x6b1f11[_0x94ee('0x47')],{'$or':_[_0x94ee('0x39')](_0x6b1f11[_0x94ee('0x42')],function(_0x5b7d48){var _0x573cb4={};_0x573cb4[_0x5b7d48]={'$like':'%'+_0x34f77c[_0x94ee('0x40')][_0x94ee('0x4a')]+'%'};return _0x573cb4;})});}_0x6b1f11=_[_0x94ee('0x4b')]({},_0x6b1f11,_0x34f77c[_0x94ee('0x4d')]);return _0x26987b[_0x94ee('0x73')](_0x6b1f11);}})['then'](function(_0x4017b6){if(_0x4017b6){_0x49544a=_0x4017b6[_0x94ee('0x44')];if(!_0x34f77c[_0x94ee('0x40')][_0x94ee('0x64')]('nolimit')){_0x6b1f11[_0x94ee('0x2a')]=qs[_0x94ee('0x2a')](_0x34f77c[_0x94ee('0x40')]['limit']);_0x6b1f11[_0x94ee('0x28')]=qs[_0x94ee('0x28')](_0x34f77c[_0x94ee('0x40')]['offset']);}return _0x26987b[_0x94ee('0x73')](_0x6b1f11);}})[_0x94ee('0x1c')](function(_0x365dc7){if(_0x365dc7){return _0x365dc7?{'count':_0x49544a,'rows':_0x365dc7}:null;}})['then'](respondWithResult(_0xf48ccf,null))[_0x94ee('0x55')](handleError(_0xf48ccf,null));};exports[_0x94ee('0x74')]=function(_0x2564e9,_0x1f57f3){var _0x421374=_0x2564e9[_0x94ee('0x51')]['id'];var _0x158e73=_0x2564e9[_0x94ee('0x57')];var _0x1f160d=0xc8;var _0x56e16c=null;return db[_0x94ee('0x75')][_0x94ee('0x76')]({'isolationLevel':db['sequelize'][_0x94ee('0x77')][_0x94ee('0x78')][_0x94ee('0x79')]},function(_0xaff5f2){return db[_0x94ee('0x3a')]['findOne']({'where':{'id':_0x421374},'transaction':_0xaff5f2})[_0x94ee('0x1c')](function(_0x3a1f42){if(_0x3a1f42){return db[_0x94ee('0x7a')][_0x94ee('0x31')]({'where':{'WhatsappAccountId':_0x421374},'transaction':_0xaff5f2})[_0x94ee('0x1c')](function(){var _0x14d893=_[_0x94ee('0x39')](_0x158e73,function(_0x41d21e){_0x41d21e['WhatsappAccountId']=_0x421374;return _0x41d21e;});return db[_0x94ee('0x7a')][_0x94ee('0x7b')](_0x14d893,{'transaction':_0xaff5f2});});}else{_0x1f160d=0x194;_0x56e16c=[];}});})[_0x94ee('0x1c')](function(){if(_0x1f160d!==0x194){return db['WhatsappApplication'][_0x94ee('0x7c')]({'where':{'WhatsappAccountId':_0x421374},'order':_0x94ee('0x7d')})[_0x94ee('0x1c')](function(_0x2ba5d0){_0x56e16c=_0x2ba5d0;});}})['catch'](function(_0x5c7feb){_0x1f160d=0x1f4;logger[_0x94ee('0x21')](_0x5c7feb['stack']);if(_0x5c7feb['name']){delete _0x5c7feb[_0x94ee('0x34')];}_0x56e16c=_0x5c7feb;})[_0x94ee('0x7e')](function(){if(_0x56e16c===null){_0x1f57f3[_0x94ee('0x24')](_0x1f160d);}else{if(_0x1f160d===0x1f4){_0x1f57f3['status'](_0x1f160d)[_0x94ee('0x35')](_0x56e16c);}else{_0x1f57f3['status'](_0x1f160d)[_0x94ee('0x27')](_0x56e16c);}}});};exports['getApplications']=function(_0x571df5,_0x2e95a4,_0x2709fc){var _0x24fac4={};var _0x536646={};var _0x30180e;var _0x1f552f;return db['WhatsappAccount'][_0x94ee('0x63')]({'where':{'id':_0x571df5[_0x94ee('0x51')]['id']}})[_0x94ee('0x1c')](handleEntityNotFound(_0x2e95a4,null))['then'](function(_0x38cee9){if(_0x38cee9){_0x30180e=_0x38cee9;_0x536646['model']=_[_0x94ee('0x52')](db[_0x94ee('0x7a')][_0x94ee('0x3b')]);_0x536646[_0x94ee('0x40')]=_['keys'](_0x571df5[_0x94ee('0x40')]);_0x536646['filters']=_[_0x94ee('0x41')](_0x536646['model'],_0x536646[_0x94ee('0x40')]);_0x24fac4['attributes']=_['intersection'](_0x536646[_0x94ee('0x3f')],qs[_0x94ee('0x43')](_0x571df5[_0x94ee('0x40')]['fields']));_0x24fac4[_0x94ee('0x42')]=_0x24fac4['attributes'][_0x94ee('0x44')]?_0x24fac4['attributes']:_0x536646[_0x94ee('0x3f')];_0x24fac4[_0x94ee('0x45')]=qs[_0x94ee('0x46')](_0x571df5[_0x94ee('0x40')][_0x94ee('0x46')]);_0x24fac4[_0x94ee('0x47')]=qs['filters'](_[_0x94ee('0x48')](_0x571df5['query'],_0x536646[_0x94ee('0x49')]));if(_0x571df5[_0x94ee('0x40')][_0x94ee('0x4a')]){_0x24fac4['where']=_[_0x94ee('0x4b')](_0x24fac4[_0x94ee('0x47')],{'$or':_[_0x94ee('0x39')](_0x24fac4[_0x94ee('0x42')],function(_0x2b4e07){var _0x197b80={};_0x197b80[_0x2b4e07]={'$like':'%'+_0x571df5['query'][_0x94ee('0x4a')]+'%'};return _0x197b80;})});}_0x24fac4=_[_0x94ee('0x4b')]({},_0x24fac4,_0x571df5[_0x94ee('0x4d')]);return _0x30180e[_0x94ee('0x7f')](_0x24fac4);}})[_0x94ee('0x1c')](function(_0x44ff44){if(_0x44ff44){_0x1f552f=_0x44ff44[_0x94ee('0x44')];if(!_0x571df5[_0x94ee('0x40')]['hasOwnProperty'](_0x94ee('0x65'))){_0x24fac4[_0x94ee('0x2a')]=qs[_0x94ee('0x2a')](_0x571df5[_0x94ee('0x40')]['limit']);_0x24fac4[_0x94ee('0x28')]=qs[_0x94ee('0x28')](_0x571df5[_0x94ee('0x40')][_0x94ee('0x28')]);}return _0x30180e['getApplications'](_0x24fac4);}})[_0x94ee('0x1c')](function(_0x2685b8){if(_0x2685b8){return _0x2685b8?{'count':_0x1f552f,'rows':_0x2685b8}:null;}})[_0x94ee('0x1c')](respondWithResult(_0x2e95a4,null))[_0x94ee('0x55')](handleError(_0x2e95a4,null));};exports[_0x94ee('0x80')]=function(_0x11bf66,_0x1c3960,_0x4f91ec){var _0x26e058={'channel':'whatsapp'};var _0x3e3c71=[];var _0x14cc1c=[];var _0x16591f={};return db['WhatsappAccount']['find']({'where':{'id':_0x11bf66['params']['id']},'include':[{'model':db[_0x94ee('0x7a')],'as':_0x94ee('0x81')}]})[_0x94ee('0x1c')](handleEntityNotFound(_0x1c3960,null))['then'](function(_0x230ef7){_0x26e058[_0x94ee('0x82')]=_0x230ef7;if(_0x26e058[_0x94ee('0x82')]&&_0x26e058[_0x94ee('0x82')][_0x94ee('0x3d')]===_0x94ee('0x83')&&_0x11bf66[_0x94ee('0x57')][_0x94ee('0x84')]){if(_0x11bf66[_0x94ee('0x57')][_0x94ee('0x84')][_0x94ee('0x44')]===0x0)return;if(_0x11bf66[_0x94ee('0x57')][_0x94ee('0x84')][0x0][_0x94ee('0x85')]!==_0x94ee('0x86'))return;return db[_0x94ee('0x87')][_0x94ee('0x30')]({'read':!![],'readAt':_0x11bf66[_0x94ee('0x57')][_0x94ee('0x84')][0x0]['timestamp']},{'where':{'messageId':_0x11bf66['body'][_0x94ee('0x84')][0x0][_0x94ee('0x88')]},'individualHooks':!![]})[_0x94ee('0x1c')](function(_0x59e396){return _0x1c3960[_0x94ee('0x26')](0xc8)[_0x94ee('0x27')](_0x59e396);});}_0x26e058[_0x94ee('0x89')]=_[_0x94ee('0x8a')](_0x230ef7[_0x94ee('0x81')],[_0x94ee('0x7d')],['asc']);if(_0x26e058[_0x94ee('0x82')][_0x94ee('0x81')]){delete _0x26e058['account'][_0x94ee('0x81')];}return db[_0x94ee('0x8b')][_0x94ee('0x5e')]()[_0x94ee('0x1c')](function(_0x1706bd){if(!_0x1706bd){throw new db[(_0x94ee('0x8c'))][(_0x94ee('0x8d'))](_0x94ee('0x8e'));}_0x3e3c71=_['difference'](_[_0x94ee('0x52')](_0x1706bd),[_0x94ee('0x8f'),_0x94ee('0x90')]);_0x14cc1c=_[_0x94ee('0x91')](_[_0x94ee('0x52')](_0x1706bd),[_0x94ee('0x8f'),_0x94ee('0x90'),_0x94ee('0x92'),'ListId']);_0x26e058[_0x94ee('0x57')]={'mapKey':_0x94ee('0x93')};if(_0x26e058[_0x94ee('0x82')]&&_0x26e058[_0x94ee('0x82')][_0x94ee('0x3d')]===_0x94ee('0x94')){_0x26e058['body'][_0x94ee('0x95')]=_0x11bf66['body'][_0x94ee('0x96')][_0x94ee('0x97')](_0x94ee('0x98'),'');_0x26e058[_0x94ee('0x57')]['body']=_0x11bf66[_0x94ee('0x57')][_0x94ee('0x99')];_0x26e058[_0x94ee('0x57')][_0x94ee('0x9a')]=_0x11bf66[_0x94ee('0x57')][_0x94ee('0x9b')];}if(_0x26e058[_0x94ee('0x82')]&&_0x26e058[_0x94ee('0x82')][_0x94ee('0x3d')]===_0x94ee('0x83')){_0x26e058[_0x94ee('0x57')][_0x94ee('0x95')]=_0x11bf66[_0x94ee('0x57')]['notifications'][0x0][_0x94ee('0x95')];_0x26e058[_0x94ee('0x57')]['body']=_0x11bf66[_0x94ee('0x57')][_0x94ee('0x9c')][0x0]['message'][_0x94ee('0x57')];_0x26e058[_0x94ee('0x57')][_0x94ee('0x9a')]=_0x11bf66[_0x94ee('0x57')][_0x94ee('0x9c')][0x0][_0x94ee('0x88')];}if(_0x26e058[_0x94ee('0x57')]['id']){delete _0x26e058[_0x94ee('0x57')]['id'];}if(_[_0x94ee('0x9d')](_0x26e058[_0x94ee('0x57')][_0x94ee('0x95')])){throw new db[(_0x94ee('0x8c'))]['ValidationError'](_0x94ee('0x9e'));}if(_['isNil'](_0x26e058[_0x94ee('0x57')][_0x94ee('0x57')])||_0x26e058[_0x94ee('0x57')][_0x94ee('0x57')]===''){throw new db[(_0x94ee('0x8c'))][(_0x94ee('0x8d'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x94ee('0x9d')](_0x26e058[_0x94ee('0x57')][_0x94ee('0x9f')])){throw new db[(_0x94ee('0x8c'))][(_0x94ee('0x8d'))](_0x94ee('0xa0')+_0x14cc1c);}if(!_[_0x94ee('0xa1')](_0x14cc1c,_0x26e058[_0x94ee('0x57')][_0x94ee('0x9f')])){throw new db[(_0x94ee('0x8c'))][(_0x94ee('0x8d'))](_0x94ee('0xa2')+_0x14cc1c);}_0x16591f[_0x26e058[_0x94ee('0x57')][_0x94ee('0x9f')]]=_0x26e058[_0x94ee('0x57')][_0x94ee('0x95')];return db[_0x94ee('0xa3')][_0x94ee('0x54')]({'where':{'id':_0x26e058[_0x94ee('0x82')][_0x94ee('0xa4')]},'include':[{'model':db[_0x94ee('0x8b')],'as':'Contacts','where':_0x16591f,'limit':0x1,'order':[['updatedAt',_0x94ee('0xa5')]]}]});})['then'](handleEntityNotFound(_0x1c3960,null))[_0x94ee('0x1c')](function(_0x216c94){if(_0x216c94){_0x26e058[_0x94ee('0xa6')]=_[_0x94ee('0x6c')](_0x216c94,[_0x94ee('0xa7')]);if(_0x216c94[_0x94ee('0xa7')][_0x94ee('0x44')]){return _0x216c94[_0x94ee('0xa7')][0x0];}var _0x44bcab=_[_0x94ee('0x17')](_0x26e058[_0x94ee('0x57')],{'firstName':_0x26e058[_0x94ee('0x57')][_0x94ee('0x95')],'ListId':_0x216c94['id']});_0x44bcab[_0x26e058[_0x94ee('0x57')][_0x94ee('0x9f')]]=_0x26e058['body'][_0x94ee('0x95')];return db[_0x94ee('0x8b')][_0x94ee('0x56')](_0x44bcab,{'fields':_0x3e3c71,'raw':!![]});}})[_0x94ee('0x1c')](handleEntityNotFound(_0x1c3960,null))[_0x94ee('0x1c')](function(_0x418188){if(_0x418188){_0x26e058['contact']=_0x418188;var _0x4f836d={'ContactId':_0x418188['id'],'phone':_0x26e058[_0x94ee('0x57')][_0x94ee('0x95')],'WhatsappAccountId':_0x11bf66[_0x94ee('0x51')]['id']};var _0x3ffc80={'ContactId':_0x418188['id'],'WhatsappAccountId':_0x11bf66[_0x94ee('0x51')]['id'],'closed':![]};return db[_0x94ee('0xa8')][_0x94ee('0x54')]({'where':_0x3ffc80})[_0x94ee('0x1c')](function(_0x5b0a33){if(_0x5b0a33){return[_0x5b0a33,![]];}return db[_0x94ee('0xa8')][_0x94ee('0x56')](_0x4f836d)[_0x94ee('0x1c')](function(_0x39f040){return[_0x39f040,!![]];});});}})['spread'](function(_0x35c76f,_0x3ddb6c){_0x26e058[_0x94ee('0xa9')]=_0x35c76f['get']({'plain':!![]});_0x26e058[_0x94ee('0xa9')][_0x94ee('0xaa')]=![];if(_0x3ddb6c){if(_0x26e058[_0x94ee('0x82')]['autoclose']){_0x26e058[_0x94ee('0x89')][_0x94ee('0xab')]({'id':0x0,'priority':_0x26e058['applications'][_0x94ee('0x44')]+0x1,'app':'close','appdata':_0x94ee('0xac'),'interval':_0x94ee('0xad')});}_0x26e058[_0x94ee('0xa9')][_0x94ee('0xaa')]=!![];}return db[_0x94ee('0x87')][_0x94ee('0x56')]({'phone':_0x26e058[_0x94ee('0x57')][_0x94ee('0x95')],'messageId':_0x26e058[_0x94ee('0x57')][_0x94ee('0x9a')],'body':_0x26e058[_0x94ee('0x57')][_0x94ee('0x57')],'WhatsappAccountId':_0x11bf66[_0x94ee('0x51')]['id'],'WhatsappInteractionId':_0x35c76f['id'],'direction':'in','ContactId':_0x35c76f[_0x94ee('0xae')],'AttachmentId':_0x26e058[_0x94ee('0x57')][_0x94ee('0xaf')]});})[_0x94ee('0x1c')](function(_0x33fd0c){_0x26e058[_0x94ee('0x23')]=_0x33fd0c;if(_0x26e058[_0x94ee('0xa9')]['UserId']){return db['User']['find']({'attributes':['id',_0x94ee('0x34')],'where':{'id':_0x26e058['interaction'][_0x94ee('0xb0')]}})[_0x94ee('0x1c')](function(_0x483773){if(_0x483773){_0x26e058[_0x94ee('0x89')][_0x94ee('0xb1')]({'id':0x0,'priority':0x0,'app':_0x94ee('0xb2'),'appdata':_0x483773[_0x94ee('0x34')]+','+(_0x26e058[_0x94ee('0x82')][_0x94ee('0xb3')]||0xa),'interval':_0x94ee('0xad')});}return respondWithRpcPromise(_0x94ee('0xb4'),'startRouting',_0x26e058);});}return respondWithRpcPromise('Start',_0x94ee('0xb5'),_0x26e058);})[_0x94ee('0x1c')](function(_0x387558){if(_0x387558){var _0x55b106=0xc8;var _0x3d9f48=_0x94ee('0xb6');logger[_0x94ee('0x1d')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x3d9f48,_0x55b106,_0x94ee('0xb7'));logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x3d9f48,_0x55b106,_0x94ee('0xb7'),JSON['stringify'](_0x387558));if(_0x26e058[_0x94ee('0x82')]['type']===_0x94ee('0x94')){return _0x1c3960['status'](_0x55b106)[_0x94ee('0xb8')](_0x94ee('0xb9'),_0x94ee('0xba'))[_0x94ee('0x35')]('\x0a');}else{return _0x1c3960[_0x94ee('0x26')](_0x55b106)[_0x94ee('0x27')](_0x387558);}}});})[_0x94ee('0x55')](handleError(_0x1c3960,null));};exports[_0x94ee('0x35')]=function(_0x4f141b,_0x576759,_0x35c455){var _0x583d53,_0x2d6656,_0x171cdd;if(_['isNil'](_0x4f141b[_0x94ee('0x57')][_0x94ee('0x57')])||_0x4f141b[_0x94ee('0x57')][_0x94ee('0x57')]===''){throw new db[(_0x94ee('0x8c'))][(_0x94ee('0x8d'))](_0x94ee('0xbb'));}if(_[_0x94ee('0x9d')](_0x4f141b[_0x94ee('0x57')]['to'])){throw new db[(_0x94ee('0x8c'))]['ValidationError'](_0x94ee('0xbc'));}_0x583d53=_0x4f141b[_0x94ee('0x57')]['to'];return db['WhatsappAccount']['find']({'where':{'id':_0x4f141b['params']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':_0x94ee('0xa7'),'where':{'mobile':_0x583d53},'limit':0x1,'order':[[_0x94ee('0x90'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x576759,null))[_0x94ee('0x1c')](function(_0x294dd3){if(_0x294dd3&&_0x294dd3[_0x94ee('0xbd')]){_0x2d6656=_0x294dd3[_0x94ee('0x59')]({'plain':!![]});if(_0x2d6656[_0x94ee('0xbd')]&&_0x2d6656[_0x94ee('0xbd')][_0x94ee('0xa7')]['length']){return _0x2d6656[_0x94ee('0xbd')][_0x94ee('0xa7')][0x0];}return db['CmContact']['create'](_[_0x94ee('0x17')](_0x4f141b[_0x94ee('0x57')],{'firstName':_0x583d53,'mobile':_0x583d53,'phone':_0x583d53,'ListId':_0x2d6656['ListId']}));}})['then'](handleEntityNotFound(_0x576759,null))['then'](function(_0x1b4808){if(_0x1b4808){_0x171cdd=_0x1b4808;return db['WhatsappInteraction'][_0x94ee('0x54')]({'where':{'ContactId':_0x171cdd['id'],'closed':![],'WhatsappAccountId':_0x2d6656['id']}})[_0x94ee('0x1c')](function(_0x1cf447){if(_0x1cf447){return[_0x1cf447,![]];}return db['WhatsappInteraction'][_0x94ee('0x56')]({'UserId':_0x4f141b['user']['id'],'ContactId':_0x171cdd['id'],'WhatsappAccountId':_0x2d6656['id'],'phone':_0x583d53,'firstMsgDirection':_0x94ee('0xbe'),'Messages':[_[_0x94ee('0x4b')](_0x4f141b['body'],{'read':![],'body':_0x4f141b[_0x94ee('0x57')][_0x94ee('0x57')],'phone':_0x583d53,'WhatsappAccountId':_0x2d6656['id'],'UserId':_0x4f141b[_0x94ee('0x58')]['id'],'ContactId':_0x171cdd['id']})]},{'include':[{'model':db[_0x94ee('0x87')],'as':_0x94ee('0xbf')}]})[_0x94ee('0x1c')](function(_0x55c053){return[_0x55c053,!![]];});});}})['spread'](function(_0x424a8c,_0x1bc66d){if(_0x1bc66d){return _0x424a8c;}return db[_0x94ee('0x87')][_0x94ee('0x56')](_[_0x94ee('0x4b')](_0x4f141b[_0x94ee('0x57')],{'read':![],'body':_0x4f141b[_0x94ee('0x57')][_0x94ee('0x57')],'phone':_0x583d53,'WhatsappAccountId':_0x2d6656['id'],'WhatsappInteractionId':_0x424a8c['id'],'UserId':_0x4f141b['user']['id'],'ContactId':_0x171cdd['id']}))['then'](function(_0x120f97){_0x424a8c[_0x94ee('0xc0')][_0x94ee('0xbf')]=[];_0x424a8c[_0x94ee('0xc0')]['Messages'][_0x94ee('0xab')](_0x120f97[_0x94ee('0xc0')]);return _0x424a8c;});})['then'](respondWithResult(_0x576759,null))['catch'](handleError(_0x576759,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 7269ed9..19b50e2 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 _0x3860=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x2a1e7a,_0x257e4a){var _0x229c1b=function(_0x574a5e){while(--_0x574a5e){_0x2a1e7a['push'](_0x2a1e7a['shift']());}};_0x229c1b(++_0x257e4a);}(_0x3860,0x6a));var _0x0386=function(_0x150d02,_0x5ded3a){_0x150d02=_0x150d02-0x0;var _0x2e41b9=_0x3860[_0x150d02];return _0x2e41b9;};'use strict';var EventEmitter=require(_0x0386('0x0'));var WhatsappAccount=require(_0x0386('0x1'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x0386('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0386('0x3'),'afterDestroy':_0x0386('0x4')};function emitEvent(_0x49c918){return function(_0xfd74d2,_0x265958,_0x37e65f){WhatsappAccountEvents[_0x0386('0x5')](_0x49c918+':'+_0xfd74d2['id'],_0xfd74d2);WhatsappAccountEvents[_0x0386('0x5')](_0x49c918,_0xfd74d2);_0x37e65f(null);};}for(var e in events){if(events[_0x0386('0x6')](e)){var event=events[e];WhatsappAccount[_0x0386('0x7')](e,emitEvent(event));}}module[_0x0386('0x8')]=WhatsappAccountEvents; \ No newline at end of file +var _0xf6f9=['exports','events','../../mysqldb','WhatsappAccount','setMaxListeners','emit','hasOwnProperty','hook'];(function(_0x4e9a1c,_0x43483f){var _0x4bb993=function(_0x47b5cf){while(--_0x47b5cf){_0x4e9a1c['push'](_0x4e9a1c['shift']());}};_0x4bb993(++_0x43483f);}(_0xf6f9,0xc1));var _0x9f6f=function(_0x418099,_0x3f01fa){_0x418099=_0x418099-0x0;var _0x4609b1=_0xf6f9[_0x418099];return _0x4609b1;};'use strict';var EventEmitter=require(_0x9f6f('0x0'));var WhatsappAccount=require(_0x9f6f('0x1'))['db'][_0x9f6f('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x9f6f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x27f5b1){return function(_0x2e2a5f,_0x4722cb,_0x5eaa15){WhatsappAccountEvents[_0x9f6f('0x4')](_0x27f5b1+':'+_0x2e2a5f['id'],_0x2e2a5f);WhatsappAccountEvents['emit'](_0x27f5b1,_0x2e2a5f);_0x5eaa15(null);};}for(var e in events){if(events[_0x9f6f('0x5')](e)){var event=events[e];WhatsappAccount[_0x9f6f('0x6')](e,emitEvent(event));}}module[_0x9f6f('0x7')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index db29812..8b2613a 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 _0x3e9c=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','WhatsappAccount','whatsapp_accounts','lodash','util'];(function(_0x13209f,_0x4e424e){var _0x3a5820=function(_0x124f96){while(--_0x124f96){_0x13209f['push'](_0x13209f['shift']());}};_0x3a5820(++_0x4e424e);}(_0x3e9c,0x98));var _0xc3e9=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3e9c[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xc3e9('0x0'));var util=require(_0xc3e9('0x1'));var logger=require(_0xc3e9('0x2'))(_0xc3e9('0x3'));var moment=require(_0xc3e9('0x4'));var BPromise=require(_0xc3e9('0x5'));var rp=require(_0xc3e9('0x6'));var fs=require('fs');var path=require(_0xc3e9('0x7'));var rimraf=require(_0xc3e9('0x8'));var config=require(_0xc3e9('0x9'));var attributes=require('./whatsappAccount.attributes');module[_0xc3e9('0xa')]=function(_0x431f6f,_0x48db8d){return _0x431f6f[_0xc3e9('0xb')](_0xc3e9('0xc'),attributes,{'tableName':_0xc3e9('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4189=['../../config/logger','bluebird','rimraf','exports','define'];(function(_0x29df9a,_0x42aff3){var _0x3a8e96=function(_0x70fbe7){while(--_0x70fbe7){_0x29df9a['push'](_0x29df9a['shift']());}};_0x3a8e96(++_0x42aff3);}(_0x4189,0x127));var _0x9418=function(_0x15bf22,_0x14a0d0){_0x15bf22=_0x15bf22-0x0;var _0x4bfc26=_0x4189[_0x15bf22];return _0x4bfc26;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9418('0x0'))('api');var moment=require('moment');var BPromise=require(_0x9418('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9418('0x2'));var config=require('../../config/environment');var attributes=require('./whatsappAccount.attributes');module[_0x9418('0x3')]=function(_0x248fbc,_0x2c2655){return _0x248fbc[_0x9418('0x4')]('WhatsappAccount',attributes,{'tableName':'whatsapp_accounts','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 1ba19ef..ce038b7 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 _0x41dd=['WhatsappAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','WhatsappAccount','find','options','raw','where','attributes','map','include','model','info','ShowWhatsappAccount','lodash','util','bluebird','../../config/logger','rpc','../../config/environment','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','then'];(function(_0x4467d8,_0x545589){var _0xd70731=function(_0x6cbc4e){while(--_0x6cbc4e){_0x4467d8['push'](_0x4467d8['shift']());}};_0xd70731(++_0x545589);}(_0x41dd,0x70));var _0xd41d=function(_0x3bf96b,_0x241008){_0x3bf96b=_0x3bf96b-0x0;var _0x431ced=_0x41dd[_0x3bf96b];return _0x431ced;};'use strict';var _=require(_0xd41d('0x0'));var util=require(_0xd41d('0x1'));var moment=require('moment');var BPromise=require(_0xd41d('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(_0xd41d('0x3'))(_0xd41d('0x4'));var config=require(_0xd41d('0x5'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xd41d('0x6')](config['redis'],{'host':_0xd41d('0x7'),'port':0x18eb});var socket=require(_0xd41d('0x8'))(new Redis(config['redis']));require(_0xd41d('0x9'))[_0xd41d('0xa')](socket);function respondWithRpcPromise(_0x305b0d,_0x11d563,_0x3a9208){return new BPromise(function(_0x589a0a,_0x39936d){return client['request'](_0x305b0d,_0x3a9208)[_0xd41d('0xb')](function(_0x5137fb){logger['info'](_0xd41d('0xc'),_0x11d563,'request\x20sent');logger[_0xd41d('0xd')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x11d563,_0xd41d('0xe'),JSON[_0xd41d('0xf')](_0x5137fb));if(_0x5137fb['error']){if(_0x5137fb[_0xd41d('0x10')][_0xd41d('0x11')]===0x1f4){logger[_0xd41d('0x10')](_0xd41d('0xc'),_0x11d563,_0x5137fb[_0xd41d('0x10')][_0xd41d('0x12')]);return _0x39936d(_0x5137fb['error'][_0xd41d('0x12')]);}logger['error'](_0xd41d('0xc'),_0x11d563,_0x5137fb[_0xd41d('0x10')][_0xd41d('0x12')]);return _0x589a0a(_0x5137fb[_0xd41d('0x10')][_0xd41d('0x12')]);}else{logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x11d563,'request\x20sent');_0x589a0a(_0x5137fb['result'][_0xd41d('0x12')]);}})[_0xd41d('0x13')](function(_0x407955){logger['error'](_0xd41d('0xc'),_0x11d563,_0x407955);_0x39936d(_0x407955);});});}exports['ShowWhatsappAccount']=function(_0x3ffa18){var _0x2d6182=this;return new Promise(function(_0x59e198,_0x4d99f6){return db[_0xd41d('0x14')][_0xd41d('0x15')]({'raw':_0x3ffa18[_0xd41d('0x16')]?_0x3ffa18['options'][_0xd41d('0x17')]===undefined?!![]:![]:!![],'where':_0x3ffa18[_0xd41d('0x16')]?_0x3ffa18[_0xd41d('0x16')][_0xd41d('0x18')]||null:null,'attributes':_0x3ffa18['options']?_0x3ffa18[_0xd41d('0x16')][_0xd41d('0x19')]||null:null,'include':_0x3ffa18[_0xd41d('0x16')]?_0x3ffa18['options']['include']?_[_0xd41d('0x1a')](_0x3ffa18[_0xd41d('0x16')][_0xd41d('0x1b')],function(_0x286cad){return{'model':db[_0x286cad['model']],'as':_0x286cad['as'],'attributes':_0x286cad[_0xd41d('0x19')],'include':_0x286cad[_0xd41d('0x1b')]?_['map'](_0x286cad[_0xd41d('0x1b')],function(_0x100fb4){return{'model':db[_0x100fb4[_0xd41d('0x1c')]],'as':_0x100fb4['as'],'attributes':_0x100fb4['attributes'],'include':_0x100fb4[_0xd41d('0x1b')]?_[_0xd41d('0x1a')](_0x100fb4[_0xd41d('0x1b')],function(_0x355bb8){return{'model':db[_0x355bb8[_0xd41d('0x1c')]],'as':_0x355bb8['as'],'attributes':_0x355bb8['attributes']};}):[]};}):[]};}):[]:[]})[_0xd41d('0xb')](function(_0x1630bf){logger[_0xd41d('0x1d')](_0xd41d('0x1e'),_0x3ffa18);logger[_0xd41d('0xd')](_0xd41d('0x1e'),_0x3ffa18,JSON[_0xd41d('0xf')](_0x1630bf));_0x59e198(_0x1630bf);})['catch'](function(_0xa740f6){logger[_0xd41d('0x10')]('ShowWhatsappAccount',_0xa740f6[_0xd41d('0x12')],_0x3ffa18);_0x4d99f6(_0x2d6182[_0xd41d('0x10')](0x1f4,_0xa740f6['message']));});});}; \ No newline at end of file +var _0x1833=['../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x1c3281,_0x5c69a0){var _0x27588d=function(_0x47114c){while(--_0x47114c){_0x1c3281['push'](_0x1c3281['shift']());}};_0x27588d(++_0x5c69a0);}(_0x1833,0x93));var _0x3183=function(_0x12e650,_0x33f29f){_0x12e650=_0x12e650-0x0;var _0x5b56b1=_0x1833[_0x12e650];return _0x5b56b1;};'use strict';var _=require(_0x3183('0x0'));var util=require(_0x3183('0x1'));var moment=require(_0x3183('0x2'));var BPromise=require(_0x3183('0x3'));var rs=require(_0x3183('0x4'));var fs=require('fs');var Redis=require(_0x3183('0x5'));var db=require(_0x3183('0x6'))['db'];var utils=require(_0x3183('0x7'));var logger=require('../../config/logger')(_0x3183('0x8'));var config=require(_0x3183('0x9'));var jayson=require(_0x3183('0xa'));var client=jayson['client'][_0x3183('0xb')]({'port':0x232a});config[_0x3183('0xc')]=_[_0x3183('0xd')](config[_0x3183('0xc')],{'host':_0x3183('0xe'),'port':0x18eb});var socket=require(_0x3183('0xf'))(new Redis(config[_0x3183('0xc')]));require(_0x3183('0x10'))['register'](socket);function respondWithRpcPromise(_0x5e3077,_0x15e8bf,_0x4cb186){return new BPromise(function(_0x2b2f99,_0x3e028f){return client[_0x3183('0x11')](_0x5e3077,_0x4cb186)[_0x3183('0x12')](function(_0x5b432a){logger[_0x3183('0x13')](_0x3183('0x14'),_0x15e8bf,_0x3183('0x15'));logger[_0x3183('0x16')](_0x3183('0x17'),_0x15e8bf,_0x3183('0x15'),JSON[_0x3183('0x18')](_0x5b432a));if(_0x5b432a[_0x3183('0x19')]){if(_0x5b432a[_0x3183('0x19')]['code']===0x1f4){logger[_0x3183('0x19')](_0x3183('0x14'),_0x15e8bf,_0x5b432a[_0x3183('0x19')][_0x3183('0x1a')]);return _0x3e028f(_0x5b432a[_0x3183('0x19')][_0x3183('0x1a')]);}logger[_0x3183('0x19')](_0x3183('0x14'),_0x15e8bf,_0x5b432a['error']['message']);return _0x2b2f99(_0x5b432a['error'][_0x3183('0x1a')]);}else{logger[_0x3183('0x13')](_0x3183('0x14'),_0x15e8bf,'request\x20sent');_0x2b2f99(_0x5b432a[_0x3183('0x1b')][_0x3183('0x1a')]);}})[_0x3183('0x1c')](function(_0x7f3d92){logger[_0x3183('0x19')](_0x3183('0x14'),_0x15e8bf,_0x7f3d92);_0x3e028f(_0x7f3d92);});});}exports[_0x3183('0x1d')]=function(_0x11f2bd){var _0x2b9a28=this;return new Promise(function(_0x262d40,_0x1d42d2){return db[_0x3183('0x1e')][_0x3183('0x1f')]({'raw':_0x11f2bd[_0x3183('0x20')]?_0x11f2bd[_0x3183('0x20')][_0x3183('0x21')]===undefined?!![]:![]:!![],'where':_0x11f2bd[_0x3183('0x20')]?_0x11f2bd[_0x3183('0x20')][_0x3183('0x22')]||null:null,'attributes':_0x11f2bd[_0x3183('0x20')]?_0x11f2bd['options'][_0x3183('0x23')]||null:null,'include':_0x11f2bd[_0x3183('0x20')]?_0x11f2bd['options'][_0x3183('0x24')]?_[_0x3183('0x25')](_0x11f2bd[_0x3183('0x20')][_0x3183('0x24')],function(_0x2e1247){return{'model':db[_0x2e1247[_0x3183('0x26')]],'as':_0x2e1247['as'],'attributes':_0x2e1247[_0x3183('0x23')],'include':_0x2e1247[_0x3183('0x24')]?_[_0x3183('0x25')](_0x2e1247['include'],function(_0x48684a){return{'model':db[_0x48684a[_0x3183('0x26')]],'as':_0x48684a['as'],'attributes':_0x48684a[_0x3183('0x23')],'include':_0x48684a[_0x3183('0x24')]?_['map'](_0x48684a[_0x3183('0x24')],function(_0x4fc488){return{'model':db[_0x4fc488['model']],'as':_0x4fc488['as'],'attributes':_0x4fc488[_0x3183('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x256b59){logger['info'](_0x3183('0x1d'),_0x11f2bd);logger[_0x3183('0x16')](_0x3183('0x1d'),_0x11f2bd,JSON['stringify'](_0x256b59));_0x262d40(_0x256b59);})[_0x3183('0x1c')](function(_0x4a9326){logger['error'](_0x3183('0x1d'),_0x4a9326[_0x3183('0x1a')],_0x11f2bd);_0x1d42d2(_0x2b9a28[_0x3183('0x19')](0x1f4,_0x4a9326[_0x3183('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 5b447a9..35bc2aa 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 _0x192d=['update','emit','removeListener','register','whatsappAccount:','./whatsappAccount.events','save','remove'];(function(_0xde91a5,_0x32dbab){var _0x135b79=function(_0x212879){while(--_0x212879){_0xde91a5['push'](_0xde91a5['shift']());}};_0x135b79(++_0x32dbab);}(_0x192d,0x175));var _0xd192=function(_0xa43e22,_0x21efb7){_0xa43e22=_0xa43e22-0x0;var _0x1d2aee=_0x192d[_0xa43e22];return _0x1d2aee;};'use strict';var WhatsappAccountEvents=require(_0xd192('0x0'));var events=[_0xd192('0x1'),_0xd192('0x2'),_0xd192('0x3')];function createListener(_0x1a1f93,_0x2d950a){return function(_0x1f5a4e){_0x2d950a[_0xd192('0x4')](_0x1a1f93,_0x1f5a4e);};}function removeListener(_0x284c35,_0x102792){return function(){WhatsappAccountEvents[_0xd192('0x5')](_0x284c35,_0x102792);};}exports[_0xd192('0x6')]=function(_0x57d3fc){for(var _0x48f1fe=0x0,_0x3dd7f4=events['length'];_0x48f1fe<_0x3dd7f4;_0x48f1fe++){var _0x228b83=events[_0x48f1fe];var _0x1d0c7d=createListener(_0xd192('0x7')+_0x228b83,_0x57d3fc);WhatsappAccountEvents['on'](_0x228b83,_0x1d0c7d);}}; \ No newline at end of file +var _0x9a84=['update','emit','register','length','whatsappAccount:','./whatsappAccount.events','save','remove'];(function(_0xbe40ad,_0x44343c){var _0x50fac9=function(_0xdaed07){while(--_0xdaed07){_0xbe40ad['push'](_0xbe40ad['shift']());}};_0x50fac9(++_0x44343c);}(_0x9a84,0x8d));var _0x49a8=function(_0x372129,_0x539547){_0x372129=_0x372129-0x0;var _0x2385b4=_0x9a84[_0x372129];return _0x2385b4;};'use strict';var WhatsappAccountEvents=require(_0x49a8('0x0'));var events=[_0x49a8('0x1'),_0x49a8('0x2'),_0x49a8('0x3')];function createListener(_0x2d8291,_0x38fe9e){return function(_0x1de0ec){_0x38fe9e[_0x49a8('0x4')](_0x2d8291,_0x1de0ec);};}function removeListener(_0x1f5784,_0xbd7c84){return function(){WhatsappAccountEvents['removeListener'](_0x1f5784,_0xbd7c84);};}exports[_0x49a8('0x5')]=function(_0x37608d){for(var _0x415588=0x0,_0xb3f774=events[_0x49a8('0x6')];_0x415588<_0xb3f774;_0x415588++){var _0x23181e=events[_0x415588];var _0x4a7ccb=createListener(_0x49a8('0x7')+_0x23181e,_0x37608d);WhatsappAccountEvents['on'](_0x23181e,_0x4a7ccb);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 63b74d3..fafec66 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 _0x641c=['index','show','post','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x641c,0x105));var _0xc641=function(_0x126a6f,_0x5985d4){_0x126a6f=_0x126a6f-0x0;var _0x548b1b=_0x641c[_0x126a6f];return _0x548b1b;};'use strict';var multer=require(_0xc641('0x0'));var util=require('util');var path=require(_0xc641('0x1'));var timeout=require(_0xc641('0x2'));var express=require('express');var router=express[_0xc641('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc641('0x4'));var interaction=require(_0xc641('0x5'));var config=require(_0xc641('0x6'));var controller=require('./whatsappApplication.controller');router[_0xc641('0x7')]('/',auth[_0xc641('0x8')](),controller[_0xc641('0x9')]);router[_0xc641('0x7')]('/:id',auth[_0xc641('0x8')](),controller[_0xc641('0xa')]);router[_0xc641('0xb')]('/',auth[_0xc641('0x8')](),controller['create']);router[_0xc641('0xc')](_0xc641('0xd'),auth[_0xc641('0x8')](),controller[_0xc641('0xe')]);router[_0xc641('0xf')](_0xc641('0xd'),auth[_0xc641('0x8')](),controller[_0xc641('0x10')]);module[_0xc641('0x11')]=router; \ No newline at end of file +var _0xacdb=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','isAuthenticated','index','show','post','create','put','/:id','update','delete','exports','util','path'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xacdb,0x7c));var _0xbacd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xacdb[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xbacd('0x0'));var path=require(_0xbacd('0x1'));var timeout=require('connect-timeout');var express=require(_0xbacd('0x2'));var router=express[_0xbacd('0x3')]();var fs_extra=require(_0xbacd('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xbacd('0x5'));var config=require(_0xbacd('0x6'));var controller=require(_0xbacd('0x7'));router['get']('/',auth[_0xbacd('0x8')](),controller[_0xbacd('0x9')]);router['get']('/:id',auth[_0xbacd('0x8')](),controller[_0xbacd('0xa')]);router[_0xbacd('0xb')]('/',auth[_0xbacd('0x8')](),controller[_0xbacd('0xc')]);router[_0xbacd('0xd')](_0xbacd('0xe'),auth['isAuthenticated'](),controller[_0xbacd('0xf')]);router[_0xbacd('0x10')](_0xbacd('0xe'),auth[_0xbacd('0x8')](),controller['destroy']);module[_0xbacd('0x11')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 20b456d..65841cc 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 _0x40e4=['STRING','exports','INTEGER','noop','TEXT'];(function(_0x519c77,_0x510f06){var _0x5935d3=function(_0x4fa1da){while(--_0x4fa1da){_0x519c77['push'](_0x519c77['shift']());}};_0x5935d3(++_0x510f06);}(_0x40e4,0x8d));var _0x440e=function(_0x4f9b3a,_0x4b31a2){_0x4f9b3a=_0x4f9b3a-0x0;var _0x10cb16=_0x40e4[_0x4f9b3a];return _0x10cb16;};'use strict';var Sequelize=require('sequelize');module[_0x440e('0x0')]={'priority':{'type':Sequelize[_0x440e('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x440e('0x2')},'appdata':{'type':Sequelize[_0x440e('0x3')]()},'description':{'type':Sequelize[_0x440e('0x4')]},'interval':{'type':Sequelize[_0x440e('0x4')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xeee1=['noop','TEXT','sequelize','exports','INTEGER','STRING'];(function(_0x375ab8,_0x41eabf){var _0x24810b=function(_0x723bcb){while(--_0x723bcb){_0x375ab8['push'](_0x375ab8['shift']());}};_0x24810b(++_0x41eabf);}(_0xeee1,0x6e));var _0x1eee=function(_0x4a402e,_0x19eebd){_0x4a402e=_0x4a402e-0x0;var _0x1af2d6=_0xeee1[_0x4a402e];return _0x1af2d6;};'use strict';var Sequelize=require(_0x1eee('0x0'));module[_0x1eee('0x1')]={'priority':{'type':Sequelize[_0x1eee('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x1eee('0x3')],'allowNull':![],'defaultValue':_0x1eee('0x4')},'appdata':{'type':Sequelize[_0x1eee('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x1eee('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 1e42283..b3ff2d0 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 _0x6df9=['eml-format','rimraf','fast-json-patch','bluebird','util','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','name','index','map','WhatsappApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','fields','attributes','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','catch','show','params','intersection','includeAll','options','find','create','body','destroy'];(function(_0x582a2e,_0x113f68){var _0x3f83dd=function(_0x27b3f8){while(--_0x27b3f8){_0x582a2e['push'](_0x582a2e['shift']());}};_0x3f83dd(++_0x113f68);}(_0x6df9,0x84));var _0x96df=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x6df9[_0xfae23b];return _0x200640;};'use strict';var emlformat=require(_0x96df('0x0'));var rimraf=require(_0x96df('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x96df('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x96df('0x3'));var Mustache=require('mustache');var util=require(_0x96df('0x4'));var path=require('path');var sox=require(_0x96df('0x5'));var csv=require('to-csv');var ejs=require(_0x96df('0x6'));var fs=require('fs');var fs_extra=require(_0x96df('0x7'));var _=require('lodash');var squel=require(_0x96df('0x8'));var crypto=require(_0x96df('0x9'));var jsforce=require(_0x96df('0xa'));var deskjs=require(_0x96df('0xb'));var toCsv=require('to-csv');var querystring=require(_0x96df('0xc'));var Papa=require(_0x96df('0xd'));var Redis=require('ioredis');var authService=require(_0x96df('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x96df('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x96df('0x10'));var config=require(_0x96df('0x11'));var licenseUtil=require(_0x96df('0x12'));var db=require(_0x96df('0x13'))['db'];function respondWithStatusCode(_0x5894f4,_0x94b613){_0x94b613=_0x94b613||0xcc;return function(_0x4fd401){if(_0x4fd401){return _0x5894f4[_0x96df('0x14')](_0x94b613);}return _0x5894f4[_0x96df('0x15')](_0x94b613)[_0x96df('0x16')]();};}function respondWithResult(_0x1f705b,_0x1ea5c4){_0x1ea5c4=_0x1ea5c4||0xc8;return function(_0x2648d1){if(_0x2648d1){return _0x1f705b['status'](_0x1ea5c4)['json'](_0x2648d1);}};}function respondWithFilteredResult(_0x5c96a6,_0x96e39){return function(_0x44dde7){if(_0x44dde7){var _0x3202f7=typeof _0x96e39[_0x96df('0x17')]===_0x96df('0x18')&&typeof _0x96e39[_0x96df('0x19')]===_0x96df('0x18');var _0x4564b6=_0x44dde7[_0x96df('0x1a')];var _0x843d9d=_0x3202f7?0x0:_0x96e39[_0x96df('0x17')];var _0x337f5f=_0x3202f7?_0x44dde7[_0x96df('0x1a')]:_0x96e39['offset']+_0x96e39[_0x96df('0x19')];var _0xe67bcc;if(_0x337f5f>=_0x4564b6){_0x337f5f=_0x4564b6;_0xe67bcc=0xc8;}else{_0xe67bcc=0xce;}_0x5c96a6[_0x96df('0x15')](_0xe67bcc);return _0x5c96a6['set'](_0x96df('0x1b'),_0x843d9d+'-'+_0x337f5f+'/'+_0x4564b6)[_0x96df('0x1c')](_0x44dde7);}return null;};}function patchUpdates(_0x6960ef){return function(_0x289244){try{jsonpatch[_0x96df('0x1d')](_0x289244,_0x6960ef,!![]);}catch(_0x503eee){return BPromise[_0x96df('0x1e')](_0x503eee);}return _0x289244[_0x96df('0x1f')]();};}function saveUpdates(_0x106463,_0x11b344){return function(_0x40a1a6){if(_0x40a1a6){return _0x40a1a6[_0x96df('0x20')](_0x106463)['then'](function(_0x4cace5){return _0x4cace5;});}return null;};}function removeEntity(_0xdbca01,_0x35ca83){return function(_0x615123){if(_0x615123){return _0x615123['destroy']()[_0x96df('0x21')](function(){_0xdbca01[_0x96df('0x15')](0xcc)[_0x96df('0x16')]();});}};}function handleEntityNotFound(_0x3c61bb,_0x1e9dbc){return function(_0x2b033e){if(!_0x2b033e){_0x3c61bb[_0x96df('0x14')](0x194);}return _0x2b033e;};}function handleError(_0x8056b7,_0xf49d02){_0xf49d02=_0xf49d02||0x1f4;return function(_0x470a5b){logger['error'](_0x470a5b['stack']);if(_0x470a5b['name']){delete _0x470a5b[_0x96df('0x22')];}_0x8056b7[_0x96df('0x15')](_0xf49d02)['send'](_0x470a5b);};}exports[_0x96df('0x23')]=function(_0x17af9e,_0x413b4f){var _0xf74a25={},_0x31c5bb={},_0x25eadf={'count':0x0,'rows':[]};var _0xa98d69=_[_0x96df('0x24')](db[_0x96df('0x25')][_0x96df('0x26')],function(_0x21bd5a){return{'name':_0x21bd5a[_0x96df('0x27')],'type':_0x21bd5a[_0x96df('0x28')][_0x96df('0x29')]};});_0x31c5bb[_0x96df('0x2a')]=_[_0x96df('0x24')](_0xa98d69,_0x96df('0x22'));_0x31c5bb[_0x96df('0x2b')]=_[_0x96df('0x2c')](_0x17af9e[_0x96df('0x2b')]);_0x31c5bb[_0x96df('0x2d')]=_['intersection'](_0x31c5bb[_0x96df('0x2a')],_0x31c5bb[_0x96df('0x2b')]);_0xf74a25['attributes']=_['intersection'](_0x31c5bb[_0x96df('0x2a')],qs['fields'](_0x17af9e[_0x96df('0x2b')][_0x96df('0x2e')]));_0xf74a25[_0x96df('0x2f')]=_0xf74a25[_0x96df('0x2f')][_0x96df('0x30')]?_0xf74a25[_0x96df('0x2f')]:_0x31c5bb[_0x96df('0x2a')];if(!_0x17af9e[_0x96df('0x2b')]['hasOwnProperty'](_0x96df('0x31'))){_0xf74a25[_0x96df('0x19')]=qs[_0x96df('0x19')](_0x17af9e[_0x96df('0x2b')][_0x96df('0x19')]);_0xf74a25[_0x96df('0x17')]=qs[_0x96df('0x17')](_0x17af9e[_0x96df('0x2b')][_0x96df('0x17')]);}_0xf74a25['order']=qs[_0x96df('0x32')](_0x17af9e[_0x96df('0x2b')][_0x96df('0x32')]);_0xf74a25[_0x96df('0x33')]=qs[_0x96df('0x2d')](_[_0x96df('0x34')](_0x17af9e['query'],_0x31c5bb[_0x96df('0x2d')]),_0xa98d69);if(_0x17af9e[_0x96df('0x2b')][_0x96df('0x35')]){_0xf74a25[_0x96df('0x33')]=_[_0x96df('0x36')](_0xf74a25[_0x96df('0x33')],{'$or':_['map'](_0xa98d69,function(_0x42da9b){if(_0x42da9b['type']!==_0x96df('0x37')){var _0x52804d={};_0x52804d[_0x42da9b[_0x96df('0x22')]]={'$like':'%'+_0x17af9e[_0x96df('0x2b')][_0x96df('0x35')]+'%'};return _0x52804d;}})});}_0xf74a25=_['merge']({},_0xf74a25,_0x17af9e['options']);var _0x13e071={'where':_0xf74a25['where']};return db[_0x96df('0x25')][_0x96df('0x1a')](_0x13e071)[_0x96df('0x21')](function(_0x2058ae){_0x25eadf[_0x96df('0x1a')]=_0x2058ae;if(_0x17af9e['query']['includeAll']){_0xf74a25['include']=[{'all':!![]}];}return db[_0x96df('0x25')]['findAll'](_0xf74a25);})[_0x96df('0x21')](function(_0x474f2b){_0x25eadf['rows']=_0x474f2b;return _0x25eadf;})[_0x96df('0x21')](respondWithFilteredResult(_0x413b4f,_0xf74a25))[_0x96df('0x38')](handleError(_0x413b4f,null));};exports[_0x96df('0x39')]=function(_0x39fe73,_0x45fb68){var _0x55f1f9={'raw':!![],'where':{'id':_0x39fe73[_0x96df('0x3a')]['id']}},_0x3dfcda={};_0x3dfcda[_0x96df('0x2a')]=_[_0x96df('0x2c')](db[_0x96df('0x25')][_0x96df('0x26')]);_0x3dfcda[_0x96df('0x2b')]=_['keys'](_0x39fe73['query']);_0x3dfcda[_0x96df('0x2d')]=_[_0x96df('0x3b')](_0x3dfcda['model'],_0x3dfcda[_0x96df('0x2b')]);_0x55f1f9[_0x96df('0x2f')]=_[_0x96df('0x3b')](_0x3dfcda[_0x96df('0x2a')],qs[_0x96df('0x2e')](_0x39fe73[_0x96df('0x2b')][_0x96df('0x2e')]));_0x55f1f9[_0x96df('0x2f')]=_0x55f1f9['attributes'][_0x96df('0x30')]?_0x55f1f9[_0x96df('0x2f')]:_0x3dfcda[_0x96df('0x2a')];if(_0x39fe73[_0x96df('0x2b')][_0x96df('0x3c')]){_0x55f1f9['include']=[{'all':!![]}];}_0x55f1f9=_[_0x96df('0x36')]({},_0x55f1f9,_0x39fe73[_0x96df('0x3d')]);return db[_0x96df('0x25')][_0x96df('0x3e')](_0x55f1f9)[_0x96df('0x21')](handleEntityNotFound(_0x45fb68,null))['then'](respondWithResult(_0x45fb68,null))[_0x96df('0x38')](handleError(_0x45fb68,null));};exports[_0x96df('0x3f')]=function(_0x287bfd,_0x25f435){return db[_0x96df('0x25')][_0x96df('0x3f')](_0x287bfd[_0x96df('0x40')],{})[_0x96df('0x21')](respondWithResult(_0x25f435,0xc9))[_0x96df('0x38')](handleError(_0x25f435,null));};exports[_0x96df('0x20')]=function(_0xf5f5f7,_0x1181ef){if(_0xf5f5f7[_0x96df('0x40')]['id']){delete _0xf5f5f7[_0x96df('0x40')]['id'];}return db[_0x96df('0x25')][_0x96df('0x3e')]({'where':{'id':_0xf5f5f7[_0x96df('0x3a')]['id']}})[_0x96df('0x21')](handleEntityNotFound(_0x1181ef,null))[_0x96df('0x21')](saveUpdates(_0xf5f5f7[_0x96df('0x40')],null))[_0x96df('0x21')](respondWithResult(_0x1181ef,null))[_0x96df('0x38')](handleError(_0x1181ef,null));};exports[_0x96df('0x41')]=function(_0x520c40,_0x33f1d3){return db[_0x96df('0x25')][_0x96df('0x3e')]({'where':{'id':_0x520c40[_0x96df('0x3a')]['id']}})[_0x96df('0x21')](handleEntityNotFound(_0x33f1d3,null))[_0x96df('0x21')](removeEntity(_0x33f1d3,null))[_0x96df('0x38')](handleError(_0x33f1d3,null));}; \ No newline at end of file +var _0x52aa=['end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','error','stack','name','send','index','map','WhatsappApplication','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','VIRTUAL','includeAll','include','findAll','catch','show','params','merge','options','find','create','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x20aae1,_0x293e25){var _0x14094b=function(_0x14974f){while(--_0x14974f){_0x20aae1['push'](_0x20aae1['shift']());}};_0x14094b(++_0x293e25);}(_0x52aa,0x113));var _0xa52a=function(_0x5038a7,_0x58aa07){_0x5038a7=_0x5038a7-0x0;var _0x167e8c=_0x52aa[_0x5038a7];return _0x167e8c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa52a('0x0'));var zipdir=require(_0xa52a('0x1'));var jsonpatch=require(_0xa52a('0x2'));var rp=require(_0xa52a('0x3'));var moment=require(_0xa52a('0x4'));var BPromise=require(_0xa52a('0x5'));var Mustache=require(_0xa52a('0x6'));var util=require(_0xa52a('0x7'));var path=require(_0xa52a('0x8'));var sox=require(_0xa52a('0x9'));var csv=require(_0xa52a('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa52a('0xb'));var squel=require(_0xa52a('0xc'));var crypto=require(_0xa52a('0xd'));var jsforce=require(_0xa52a('0xe'));var deskjs=require(_0xa52a('0xf'));var toCsv=require(_0xa52a('0xa'));var querystring=require(_0xa52a('0x10'));var Papa=require(_0xa52a('0x11'));var Redis=require(_0xa52a('0x12'));var authService=require(_0xa52a('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa52a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa52a('0x15'))(_0xa52a('0x16'));var utils=require(_0xa52a('0x17'));var config=require(_0xa52a('0x18'));var licenseUtil=require(_0xa52a('0x19'));var db=require(_0xa52a('0x1a'))['db'];function respondWithStatusCode(_0x3d4749,_0x140034){_0x140034=_0x140034||0xcc;return function(_0x466f96){if(_0x466f96){return _0x3d4749[_0xa52a('0x1b')](_0x140034);}return _0x3d4749[_0xa52a('0x1c')](_0x140034)[_0xa52a('0x1d')]();};}function respondWithResult(_0x381d76,_0x482f79){_0x482f79=_0x482f79||0xc8;return function(_0x56a2d2){if(_0x56a2d2){return _0x381d76[_0xa52a('0x1c')](_0x482f79)[_0xa52a('0x1e')](_0x56a2d2);}};}function respondWithFilteredResult(_0x534580,_0x2b9dc0){return function(_0x24cffa){if(_0x24cffa){var _0x1380b1=typeof _0x2b9dc0[_0xa52a('0x1f')]===_0xa52a('0x20')&&typeof _0x2b9dc0[_0xa52a('0x21')]===_0xa52a('0x20');var _0x243230=_0x24cffa[_0xa52a('0x22')];var _0x314323=_0x1380b1?0x0:_0x2b9dc0['offset'];var _0x1e2cc8=_0x1380b1?_0x24cffa[_0xa52a('0x22')]:_0x2b9dc0[_0xa52a('0x1f')]+_0x2b9dc0[_0xa52a('0x21')];var _0xf726ff;if(_0x1e2cc8>=_0x243230){_0x1e2cc8=_0x243230;_0xf726ff=0xc8;}else{_0xf726ff=0xce;}_0x534580[_0xa52a('0x1c')](_0xf726ff);return _0x534580['set'](_0xa52a('0x23'),_0x314323+'-'+_0x1e2cc8+'/'+_0x243230)[_0xa52a('0x1e')](_0x24cffa);}return null;};}function patchUpdates(_0xd4d131){return function(_0x38e52b){try{jsonpatch['apply'](_0x38e52b,_0xd4d131,!![]);}catch(_0x340129){return BPromise[_0xa52a('0x24')](_0x340129);}return _0x38e52b[_0xa52a('0x25')]();};}function saveUpdates(_0x327f82,_0x13ef38){return function(_0x4c8361){if(_0x4c8361){return _0x4c8361[_0xa52a('0x26')](_0x327f82)['then'](function(_0x56f900){return _0x56f900;});}return null;};}function removeEntity(_0x300faa,_0x1de0a5){return function(_0x598849){if(_0x598849){return _0x598849['destroy']()[_0xa52a('0x27')](function(){_0x300faa[_0xa52a('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1fbdc5,_0x46b8e6){return function(_0x1290d7){if(!_0x1290d7){_0x1fbdc5[_0xa52a('0x1b')](0x194);}return _0x1290d7;};}function handleError(_0x286280,_0x269431){_0x269431=_0x269431||0x1f4;return function(_0x3f2e9e){logger[_0xa52a('0x28')](_0x3f2e9e[_0xa52a('0x29')]);if(_0x3f2e9e[_0xa52a('0x2a')]){delete _0x3f2e9e[_0xa52a('0x2a')];}_0x286280[_0xa52a('0x1c')](_0x269431)[_0xa52a('0x2b')](_0x3f2e9e);};}exports[_0xa52a('0x2c')]=function(_0x15867e,_0x3bb4f7){var _0x1a82c4={},_0x950f7e={},_0x4d32fa={'count':0x0,'rows':[]};var _0x1903fb=_[_0xa52a('0x2d')](db[_0xa52a('0x2e')]['rawAttributes'],function(_0x49ab8f){return{'name':_0x49ab8f[_0xa52a('0x2f')],'type':_0x49ab8f[_0xa52a('0x30')][_0xa52a('0x31')]};});_0x950f7e['model']=_[_0xa52a('0x2d')](_0x1903fb,_0xa52a('0x2a'));_0x950f7e['query']=_[_0xa52a('0x32')](_0x15867e[_0xa52a('0x33')]);_0x950f7e[_0xa52a('0x34')]=_[_0xa52a('0x35')](_0x950f7e[_0xa52a('0x36')],_0x950f7e[_0xa52a('0x33')]);_0x1a82c4[_0xa52a('0x37')]=_[_0xa52a('0x35')](_0x950f7e['model'],qs[_0xa52a('0x38')](_0x15867e['query']['fields']));_0x1a82c4[_0xa52a('0x37')]=_0x1a82c4[_0xa52a('0x37')][_0xa52a('0x39')]?_0x1a82c4[_0xa52a('0x37')]:_0x950f7e['model'];if(!_0x15867e[_0xa52a('0x33')]['hasOwnProperty'](_0xa52a('0x3a'))){_0x1a82c4['limit']=qs[_0xa52a('0x21')](_0x15867e[_0xa52a('0x33')][_0xa52a('0x21')]);_0x1a82c4['offset']=qs['offset'](_0x15867e[_0xa52a('0x33')][_0xa52a('0x1f')]);}_0x1a82c4[_0xa52a('0x3b')]=qs[_0xa52a('0x3c')](_0x15867e[_0xa52a('0x33')][_0xa52a('0x3c')]);_0x1a82c4[_0xa52a('0x3d')]=qs[_0xa52a('0x34')](_['pick'](_0x15867e['query'],_0x950f7e['filters']),_0x1903fb);if(_0x15867e[_0xa52a('0x33')][_0xa52a('0x3e')]){_0x1a82c4['where']=_['merge'](_0x1a82c4[_0xa52a('0x3d')],{'$or':_['map'](_0x1903fb,function(_0x1116b7){if(_0x1116b7[_0xa52a('0x30')]!==_0xa52a('0x3f')){var _0x27264b={};_0x27264b[_0x1116b7['name']]={'$like':'%'+_0x15867e[_0xa52a('0x33')][_0xa52a('0x3e')]+'%'};return _0x27264b;}})});}_0x1a82c4=_['merge']({},_0x1a82c4,_0x15867e['options']);var _0x5ffb0f={'where':_0x1a82c4[_0xa52a('0x3d')]};return db[_0xa52a('0x2e')]['count'](_0x5ffb0f)[_0xa52a('0x27')](function(_0x4fa3ab){_0x4d32fa[_0xa52a('0x22')]=_0x4fa3ab;if(_0x15867e[_0xa52a('0x33')][_0xa52a('0x40')]){_0x1a82c4[_0xa52a('0x41')]=[{'all':!![]}];}return db[_0xa52a('0x2e')][_0xa52a('0x42')](_0x1a82c4);})[_0xa52a('0x27')](function(_0xc99441){_0x4d32fa['rows']=_0xc99441;return _0x4d32fa;})[_0xa52a('0x27')](respondWithFilteredResult(_0x3bb4f7,_0x1a82c4))[_0xa52a('0x43')](handleError(_0x3bb4f7,null));};exports[_0xa52a('0x44')]=function(_0x16e578,_0x53d5c6){var _0x1660c6={'raw':!![],'where':{'id':_0x16e578[_0xa52a('0x45')]['id']}},_0x52e5ca={};_0x52e5ca['model']=_['keys'](db[_0xa52a('0x2e')]['rawAttributes']);_0x52e5ca[_0xa52a('0x33')]=_[_0xa52a('0x32')](_0x16e578[_0xa52a('0x33')]);_0x52e5ca[_0xa52a('0x34')]=_['intersection'](_0x52e5ca[_0xa52a('0x36')],_0x52e5ca['query']);_0x1660c6[_0xa52a('0x37')]=_[_0xa52a('0x35')](_0x52e5ca[_0xa52a('0x36')],qs[_0xa52a('0x38')](_0x16e578[_0xa52a('0x33')][_0xa52a('0x38')]));_0x1660c6[_0xa52a('0x37')]=_0x1660c6['attributes'][_0xa52a('0x39')]?_0x1660c6[_0xa52a('0x37')]:_0x52e5ca['model'];if(_0x16e578['query']['includeAll']){_0x1660c6[_0xa52a('0x41')]=[{'all':!![]}];}_0x1660c6=_[_0xa52a('0x46')]({},_0x1660c6,_0x16e578[_0xa52a('0x47')]);return db['WhatsappApplication'][_0xa52a('0x48')](_0x1660c6)[_0xa52a('0x27')](handleEntityNotFound(_0x53d5c6,null))[_0xa52a('0x27')](respondWithResult(_0x53d5c6,null))['catch'](handleError(_0x53d5c6,null));};exports[_0xa52a('0x49')]=function(_0x454fbf,_0x260d55){return db[_0xa52a('0x2e')][_0xa52a('0x49')](_0x454fbf[_0xa52a('0x4a')],{})[_0xa52a('0x27')](respondWithResult(_0x260d55,0xc9))[_0xa52a('0x43')](handleError(_0x260d55,null));};exports[_0xa52a('0x26')]=function(_0x5935cc,_0x2c08e3){if(_0x5935cc[_0xa52a('0x4a')]['id']){delete _0x5935cc[_0xa52a('0x4a')]['id'];}return db[_0xa52a('0x2e')][_0xa52a('0x48')]({'where':{'id':_0x5935cc['params']['id']}})[_0xa52a('0x27')](handleEntityNotFound(_0x2c08e3,null))[_0xa52a('0x27')](saveUpdates(_0x5935cc[_0xa52a('0x4a')],null))[_0xa52a('0x27')](respondWithResult(_0x2c08e3,null))[_0xa52a('0x43')](handleError(_0x2c08e3,null));};exports[_0xa52a('0x4b')]=function(_0x2ec48d,_0x1fd43b){return db['WhatsappApplication'][_0xa52a('0x48')]({'where':{'id':_0x2ec48d[_0xa52a('0x45')]['id']}})['then'](handleEntityNotFound(_0x1fd43b,null))['then'](removeEntity(_0x1fd43b,null))[_0xa52a('0x43')](handleError(_0x1fd43b,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index c44694c..22bd8b1 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 _0x3c7b=['api','moment','../../config/environment','./whatsappApplication.attributes','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x3c7b,0x11d));var _0xb3c7=function(_0x2f4ea8,_0x3ab71f){_0x2f4ea8=_0x2f4ea8-0x0;var _0x49d1d6=_0x3c7b[_0x2f4ea8];return _0x49d1d6;};'use strict';var _=require(_0xb3c7('0x0'));var util=require(_0xb3c7('0x1'));var logger=require(_0xb3c7('0x2'))(_0xb3c7('0x3'));var moment=require(_0xb3c7('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb3c7('0x5'));var attributes=require(_0xb3c7('0x6'));module['exports']=function(_0x396a46,_0x5b810b){return _0x396a46[_0xb3c7('0x7')](_0xb3c7('0x8'),attributes,{'tableName':_0xb3c7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb3c7('0xa'),'collate':_0xb3c7('0xb')});}; \ No newline at end of file +var _0x5089=['util','api','moment','bluebird','request-promise','path','../../config/environment','exports','WhatsappApplication','whatsapp_applications','utf8mb4_unicode_ci','lodash'];(function(_0x5942b6,_0x589017){var _0x26c34d=function(_0x22cf18){while(--_0x22cf18){_0x5942b6['push'](_0x5942b6['shift']());}};_0x26c34d(++_0x589017);}(_0x5089,0x1bb));var _0x9508=function(_0x5e7514,_0x30c2e1){_0x5e7514=_0x5e7514-0x0;var _0x12f472=_0x5089[_0x5e7514];return _0x12f472;};'use strict';var _=require(_0x9508('0x0'));var util=require(_0x9508('0x1'));var logger=require('../../config/logger')(_0x9508('0x2'));var moment=require(_0x9508('0x3'));var BPromise=require(_0x9508('0x4'));var rp=require(_0x9508('0x5'));var fs=require('fs');var path=require(_0x9508('0x6'));var rimraf=require('rimraf');var config=require(_0x9508('0x7'));var attributes=require('./whatsappApplication.attributes');module[_0x9508('0x8')]=function(_0x4538dd,_0x257318){return _0x4538dd['define'](_0x9508('0x9'),attributes,{'tableName':_0x9508('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x9508('0xb')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 208dfa9..dd47f46 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 _0x425d=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x11bd6e,_0x20fb2f){var _0x41dcd3=function(_0x1e4dbd){while(--_0x1e4dbd){_0x11bd6e['push'](_0x11bd6e['shift']());}};_0x41dcd3(++_0x20fb2f);}(_0x425d,0x1e0));var _0xd425=function(_0x2bdb28,_0x140b07){_0x2bdb28=_0x2bdb28-0x0;var _0xec9a20=_0x425d[_0x2bdb28];return _0xec9a20;};'use strict';var _=require(_0xd425('0x0'));var util=require('util');var moment=require(_0xd425('0x1'));var BPromise=require(_0xd425('0x2'));var rs=require(_0xd425('0x3'));var fs=require('fs');var Redis=require(_0xd425('0x4'));var db=require(_0xd425('0x5'))['db'];var utils=require(_0xd425('0x6'));var logger=require(_0xd425('0x7'))('rpc');var config=require(_0xd425('0x8'));var jayson=require(_0xd425('0x9'));var client=jayson[_0xd425('0xa')][_0xd425('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d97d9,_0x1d2ed0,_0x50b061){return new BPromise(function(_0xb6ba8e,_0x374c3d){return client[_0xd425('0xc')](_0x1d97d9,_0x50b061)[_0xd425('0xd')](function(_0x2db9da){logger[_0xd425('0xe')](_0xd425('0xf'),_0x1d2ed0,_0xd425('0x10'));logger[_0xd425('0x11')](_0xd425('0x12'),_0x1d2ed0,_0xd425('0x10'),JSON[_0xd425('0x13')](_0x2db9da));if(_0x2db9da[_0xd425('0x14')]){if(_0x2db9da[_0xd425('0x14')][_0xd425('0x15')]===0x1f4){logger[_0xd425('0x14')](_0xd425('0xf'),_0x1d2ed0,_0x2db9da[_0xd425('0x14')][_0xd425('0x16')]);return _0x374c3d(_0x2db9da[_0xd425('0x14')]['message']);}logger[_0xd425('0x14')](_0xd425('0xf'),_0x1d2ed0,_0x2db9da[_0xd425('0x14')]['message']);return _0xb6ba8e(_0x2db9da[_0xd425('0x14')][_0xd425('0x16')]);}else{logger[_0xd425('0xe')](_0xd425('0xf'),_0x1d2ed0,_0xd425('0x10'));_0xb6ba8e(_0x2db9da['result'][_0xd425('0x16')]);}})[_0xd425('0x17')](function(_0x7e267e){logger[_0xd425('0x14')]('WhatsappApplication,\x20%s,\x20%s',_0x1d2ed0,_0x7e267e);_0x374c3d(_0x7e267e);});});} \ No newline at end of file +var _0xbec5=['info','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','WhatsappApplication,\x20%s,\x20%s','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x45161c,_0x5494fc){var _0x186581=function(_0x78fada){while(--_0x78fada){_0x45161c['push'](_0x45161c['shift']());}};_0x186581(++_0x5494fc);}(_0xbec5,0xe5));var _0x5bec=function(_0x22e9fe,_0x3d019f){_0x22e9fe=_0x22e9fe-0x0;var _0x47cd19=_0xbec5[_0x22e9fe];return _0x47cd19;};'use strict';var _=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var moment=require('moment');var BPromise=require(_0x5bec('0x2'));var rs=require(_0x5bec('0x3'));var fs=require('fs');var Redis=require(_0x5bec('0x4'));var db=require(_0x5bec('0x5'))['db'];var utils=require(_0x5bec('0x6'));var logger=require('../../config/logger')(_0x5bec('0x7'));var config=require(_0x5bec('0x8'));var jayson=require(_0x5bec('0x9'));var client=jayson['client'][_0x5bec('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28a427,_0x38456e,_0x406e65){return new BPromise(function(_0x43d96e,_0x302aae){return client[_0x5bec('0xb')](_0x28a427,_0x406e65)[_0x5bec('0xc')](function(_0x4d0d29){logger[_0x5bec('0xd')]('WhatsappApplication,\x20%s,\x20%s',_0x38456e,_0x5bec('0xe'));logger[_0x5bec('0xf')](_0x5bec('0x10'),_0x38456e,'request\x20sent',JSON[_0x5bec('0x11')](_0x4d0d29));if(_0x4d0d29[_0x5bec('0x12')]){if(_0x4d0d29[_0x5bec('0x12')]['code']===0x1f4){logger[_0x5bec('0x12')](_0x5bec('0x13'),_0x38456e,_0x4d0d29['error'][_0x5bec('0x14')]);return _0x302aae(_0x4d0d29[_0x5bec('0x12')][_0x5bec('0x14')]);}logger[_0x5bec('0x12')](_0x5bec('0x13'),_0x38456e,_0x4d0d29[_0x5bec('0x12')][_0x5bec('0x14')]);return _0x43d96e(_0x4d0d29[_0x5bec('0x12')][_0x5bec('0x14')]);}else{logger[_0x5bec('0xd')](_0x5bec('0x13'),_0x38456e,_0x5bec('0xe'));_0x43d96e(_0x4d0d29[_0x5bec('0x15')]['message']);}})['catch'](function(_0x15af9b){logger[_0x5bec('0x12')](_0x5bec('0x13'),_0x38456e,_0x15af9b);_0x302aae(_0x15af9b);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index fd0125c..170c4d3 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 _0xa751=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages','/:id/download','create','post','/:id/tags','whatsapp','whatsappinteraction:addtags','put','/:id','update','delete','tracked','destroy','removeTags','multer','util','path','connect-timeout'];(function(_0x1ae27c,_0x57adc6){var _0x3497d1=function(_0x211a77){while(--_0x211a77){_0x1ae27c['push'](_0x1ae27c['shift']());}};_0x3497d1(++_0x57adc6);}(_0xa751,0x175));var _0x1a75=function(_0x3f87a8,_0x4c8e34){_0x3f87a8=_0x3f87a8-0x0;var _0x1e9941=_0xa751[_0x3f87a8];return _0x1e9941;};'use strict';var multer=require(_0x1a75('0x0'));var util=require(_0x1a75('0x1'));var path=require(_0x1a75('0x2'));var timeout=require(_0x1a75('0x3'));var express=require('express');var router=express[_0x1a75('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1a75('0x5'));var interaction=require(_0x1a75('0x6'));var config=require(_0x1a75('0x7'));var controller=require('./whatsappInteraction.controller');router[_0x1a75('0x8')]('/',auth[_0x1a75('0x9')](),controller[_0x1a75('0xa')]);router[_0x1a75('0x8')](_0x1a75('0xb'),auth[_0x1a75('0x9')](),controller[_0x1a75('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x1a75('0xd')]);router[_0x1a75('0x8')](_0x1a75('0xe'),auth[_0x1a75('0x9')](),controller[_0x1a75('0xf')]);router[_0x1a75('0x8')](_0x1a75('0x10'),auth[_0x1a75('0x9')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller[_0x1a75('0x11')]);router[_0x1a75('0x12')](_0x1a75('0xe'),auth[_0x1a75('0x9')](),controller['addMessage']);router['post'](_0x1a75('0x13'),auth[_0x1a75('0x9')](),interaction['tracked'](_0x1a75('0x14'),_0x1a75('0x15')),controller['addTags']);router[_0x1a75('0x16')](_0x1a75('0x17'),auth[_0x1a75('0x9')](),interaction['tracked']('whatsapp','whatsappinteraction:update'),controller[_0x1a75('0x18')]);router[_0x1a75('0x19')](_0x1a75('0x17'),auth[_0x1a75('0x9')](),interaction[_0x1a75('0x1a')](_0x1a75('0x14'),'whatsappinteraction:destroy'),controller[_0x1a75('0x1b')]);router['delete']('/:id/tags',auth[_0x1a75('0x9')](),controller[_0x1a75('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x2675=['index','/describe','describe','/:id/messages','post','create','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','/:id','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','removeTags','multer','express','Router','../../components/auth/service','../../components/interaction/service','./whatsappInteraction.controller','get','isAuthenticated'];(function(_0x52edb5,_0x4e1c46){var _0xef7ed2=function(_0x2d38bb){while(--_0x2d38bb){_0x52edb5['push'](_0x52edb5['shift']());}};_0xef7ed2(++_0x4e1c46);}(_0x2675,0x75));var _0x5267=function(_0x40f0cf,_0x3d387a){_0x40f0cf=_0x40f0cf-0x0;var _0x223293=_0x2675[_0x40f0cf];return _0x223293;};'use strict';var multer=require(_0x5267('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5267('0x1'));var router=express[_0x5267('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x5267('0x3'));var interaction=require(_0x5267('0x4'));var config=require('../../config/environment');var controller=require(_0x5267('0x5'));router[_0x5267('0x6')]('/',auth[_0x5267('0x7')](),controller[_0x5267('0x8')]);router[_0x5267('0x6')](_0x5267('0x9'),auth['isAuthenticated'](),controller[_0x5267('0xa')]);router[_0x5267('0x6')]('/:id',auth[_0x5267('0x7')](),controller['show']);router[_0x5267('0x6')](_0x5267('0xb'),auth[_0x5267('0x7')](),controller['getMessages']);router[_0x5267('0x6')]('/:id/download',auth[_0x5267('0x7')](),controller['download']);router[_0x5267('0xc')]('/',auth[_0x5267('0x7')](),controller[_0x5267('0xd')]);router[_0x5267('0xc')](_0x5267('0xb'),auth[_0x5267('0x7')](),controller[_0x5267('0xe')]);router[_0x5267('0xc')](_0x5267('0xf'),auth[_0x5267('0x7')](),interaction[_0x5267('0x10')](_0x5267('0x11'),_0x5267('0x12')),controller['addTags']);router['put'](_0x5267('0x13'),auth[_0x5267('0x7')](),interaction[_0x5267('0x10')](_0x5267('0x11'),_0x5267('0x14')),controller[_0x5267('0x15')]);router[_0x5267('0x16')](_0x5267('0x13'),auth[_0x5267('0x7')](),interaction[_0x5267('0x10')](_0x5267('0x11'),_0x5267('0x17')),controller['destroy']);router[_0x5267('0x16')](_0x5267('0xf'),auth['isAuthenticated'](),controller[_0x5267('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 8511788..1d4c5ac 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 _0x2cd3=['STRING','ENUM','out','sequelize','exports','BOOLEAN','DATE'];(function(_0xa6cc5c,_0x239c99){var _0x44803d=function(_0x515b6e){while(--_0x515b6e){_0xa6cc5c['push'](_0xa6cc5c['shift']());}};_0x44803d(++_0x239c99);}(_0x2cd3,0xf1));var _0x32cd=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0x2cd3[_0x12d033];return _0x3b4e80;};'use strict';var Sequelize=require(_0x32cd('0x0'));var moment=require('moment');module[_0x32cd('0x1')]={'closed':{'type':Sequelize[_0x32cd('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x32cd('0x3')]},'disposition':{'type':Sequelize[_0x32cd('0x4')]},'secondDisposition':{'type':Sequelize[_0x32cd('0x4')]},'thirdDisposition':{'type':Sequelize[_0x32cd('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x32cd('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x32cd('0x5')]('in',_0x32cd('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x32cd('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x32cd('0x5')]('in',_0x32cd('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x32cd('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x00b3=['out','sequelize','BOOLEAN','DATE','STRING','ENUM'];(function(_0x15c618,_0x5c5af3){var _0x25f38d=function(_0x2575d1){while(--_0x2575d1){_0x15c618['push'](_0x15c618['shift']());}};_0x25f38d(++_0x5c5af3);}(_0x00b3,0x97));var _0x300b=function(_0x5c8258,_0x5a0437){_0x5c8258=_0x5c8258-0x0;var _0x51a263=_0x00b3[_0x5c8258];return _0x51a263;};'use strict';var Sequelize=require(_0x300b('0x0'));var moment=require('moment');module['exports']={'closed':{'type':Sequelize[_0x300b('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x300b('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x300b('0x3')]},'note':{'type':Sequelize[_0x300b('0x3')]},'phone':{'type':Sequelize[_0x300b('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x300b('0x4')]('in',_0x300b('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x300b('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x300b('0x4')]('in',_0x300b('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x300b('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 55d496c..0965153 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 _0xfa4d=['t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','value','having','`\x20=\x200','operator','getFullTextValue','ContactId','type','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','body','keys','some','compact','isEmpty','WhatsappAccountId','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','isNumeric','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.WhatsappAccountId\x20IS\x20NULL','i.WhatsappAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','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','Contact.firstName','c.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','rows','params','includeAll','include','options','WhatsappInteraction','create','describe','addMessage','omit','findOne','WhatsappMessage','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','ids','emit','whatsappInteractionTags:save','removeTags','download','unix','join','server','files','tmp','root','attachments','transcript-%d-%s.zip','CmContact','Contact','firstName','lastName','direction','secret','Owner','get','mkdirSync','Whatsapp','Account','N.A.','closedAt','disposition','Attachment','basename','createReadStream','createWriteStream','out','System','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','error','stack','name','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','talking','answered','closed','UserId','waiting','unmanaged','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id'];(function(_0x4c4b45,_0x500e33){var _0x122ac1=function(_0x1b016c){while(--_0x1b016c){_0x4c4b45['push'](_0x4c4b45['shift']());}};_0x122ac1(++_0x500e33);}(_0xfa4d,0x90));var _0xdfa4=function(_0x1c27e1,_0x10cc1c){_0x1c27e1=_0x1c27e1-0x0;var _0x9a81ac=_0xfa4d[_0x1c27e1];return _0x9a81ac;};'use strict';var emlformat=require(_0xdfa4('0x0'));var rimraf=require(_0xdfa4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdfa4('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdfa4('0x3'));var util=require(_0xdfa4('0x4'));var path=require(_0xdfa4('0x5'));var sox=require(_0xdfa4('0x6'));var csv=require(_0xdfa4('0x7'));var ejs=require(_0xdfa4('0x8'));var fs=require('fs');var fs_extra=require(_0xdfa4('0x9'));var _=require(_0xdfa4('0xa'));var squel=require(_0xdfa4('0xb'));var crypto=require(_0xdfa4('0xc'));var jsforce=require(_0xdfa4('0xd'));var deskjs=require(_0xdfa4('0xe'));var toCsv=require(_0xdfa4('0x7'));var querystring=require(_0xdfa4('0xf'));var Papa=require(_0xdfa4('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xdfa4('0x11'));var as=require(_0xdfa4('0x12'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0xdfa4('0x13'));var logger=require('../../config/logger')(_0xdfa4('0x14'));var utils=require(_0xdfa4('0x15'));var config=require(_0xdfa4('0x16'));var licenseUtil=require(_0xdfa4('0x17'));var db=require(_0xdfa4('0x18'))['db'];config[_0xdfa4('0x19')]=_[_0xdfa4('0x1a')](config[_0xdfa4('0x19')],{'host':_0xdfa4('0x1b'),'port':0x18eb});var socket=require(_0xdfa4('0x1c'))(new Redis(config[_0xdfa4('0x19')]));require(_0xdfa4('0x1d'))[_0xdfa4('0x1e')](socket);function respondWithStatusCode(_0x58ed13,_0x464b22){_0x464b22=_0x464b22||0xcc;return function(_0x5d604b){if(_0x5d604b){return _0x58ed13[_0xdfa4('0x1f')](_0x464b22);}return _0x58ed13['status'](_0x464b22)[_0xdfa4('0x20')]();};}function respondWithResult(_0x1163ed,_0x4c069a){_0x4c069a=_0x4c069a||0xc8;return function(_0x9f8bd6){if(_0x9f8bd6){return _0x1163ed[_0xdfa4('0x21')](_0x4c069a)[_0xdfa4('0x22')](_0x9f8bd6);}};}function respondWithFilteredResult(_0x36717f,_0xed6924){return function(_0x4d6fe0){if(_0x4d6fe0){var _0x5c2765=typeof _0xed6924[_0xdfa4('0x23')]===_0xdfa4('0x24')&&typeof _0xed6924[_0xdfa4('0x25')]==='undefined';var _0x5209e9=_0x4d6fe0[_0xdfa4('0x26')];var _0x4ac23a=_0x5c2765?0x0:_0xed6924[_0xdfa4('0x23')];var _0x36dd54=_0x5c2765?_0x4d6fe0[_0xdfa4('0x26')]:_0xed6924[_0xdfa4('0x23')]+_0xed6924[_0xdfa4('0x25')];var _0x2ca5e2;if(_0x36dd54>=_0x5209e9){_0x36dd54=_0x5209e9;_0x2ca5e2=0xc8;}else{_0x2ca5e2=0xce;}_0x36717f[_0xdfa4('0x21')](_0x2ca5e2);return _0x36717f[_0xdfa4('0x27')]('Content-Range',_0x4ac23a+'-'+_0x36dd54+'/'+_0x5209e9)[_0xdfa4('0x22')](_0x4d6fe0);}return null;};}function patchUpdates(_0x204f64){return function(_0x4d32ac){try{jsonpatch[_0xdfa4('0x28')](_0x4d32ac,_0x204f64,!![]);}catch(_0x405d50){return BPromise['reject'](_0x405d50);}return _0x4d32ac[_0xdfa4('0x29')]();};}function saveUpdates(_0x12c765,_0x46301b){return function(_0x4c44aa){if(_0x4c44aa){return _0x4c44aa[_0xdfa4('0x2a')](_0x12c765)[_0xdfa4('0x2b')](function(_0x41a6e9){return _0x41a6e9;});}return null;};}function removeEntity(_0x524150,_0x3dc981){return function(_0x1748ac){if(_0x1748ac){return _0x1748ac['destroy']()[_0xdfa4('0x2b')](function(){_0x524150[_0xdfa4('0x21')](0xcc)[_0xdfa4('0x20')]();});}};}function handleEntityNotFound(_0x633aa7,_0x442974){return function(_0x1fd295){if(!_0x1fd295){_0x633aa7[_0xdfa4('0x1f')](0x194);}return _0x1fd295;};}function handleError(_0xe2b998,_0x155a39){_0x155a39=_0x155a39||0x1f4;return function(_0x195ed2){logger[_0xdfa4('0x2c')](_0x195ed2[_0xdfa4('0x2d')]);if(_0x195ed2[_0xdfa4('0x2e')]){delete _0x195ed2[_0xdfa4('0x2e')];}_0xe2b998[_0xdfa4('0x21')](_0x155a39)['send'](_0x195ed2);};}function getInteractionUsers(_0x4679f9,_0x400796){return new BPromise(function(_0x267c79,_0x18d983){try{if(_0x400796[_0x4679f9['id']]){_0x4679f9[_0xdfa4('0x2f')]=_[_0xdfa4('0x30')](_0x400796[_0x4679f9['id']],function(_0x2b3a61){return{'id':_0x2b3a61['id'],'fullname':_0x2b3a61[_0xdfa4('0x31')]};});}}catch(_0x4eaf56){_0x18d983(_0x4eaf56);}_0x267c79(_0x4679f9);});}function getInteractionTags(_0x50af77,_0x8e8c07){return new BPromise(function(_0x2b076b,_0x2624de){try{if(_0x50af77[_0xdfa4('0x32')]){_0x50af77[_0xdfa4('0x33')]=[];_0x50af77[_0xdfa4('0x32')][_0xdfa4('0x34')](',')[_0xdfa4('0x35')](function(_0x445839){_0x50af77[_0xdfa4('0x33')][_0xdfa4('0x36')](_0x8e8c07[_0x445839]);});}delete _0x50af77['TagIds'];}catch(_0x444f84){_0x2624de(_0x444f84);}_0x2b076b(_0x50af77);});}function updateWhatsappInteraction(_0x48ba4b,_0x21463a,_0x361712){return new BPromise(function(_0x34e00c,_0x5b35de){return getInteractionUsers(_0x48ba4b,_0x361712)[_0xdfa4('0x2b')](function(_0x5ae7d2){return getInteractionTags(_0x5ae7d2,_0x21463a);})[_0xdfa4('0x2b')](function(_0x24278e){return getStateInteraction(_0x24278e);})['then'](function(_0x634c2e){_0x34e00c(_0x634c2e);})[_0xdfa4('0x37')](function(_0x468495){_0x5b35de(_0x468495);});});}function getStateInteraction(_0x149424){return new BPromise(function(_0x1f2b45){_0x149424['waiting']=0x0;_0x149424[_0xdfa4('0x38')]=0x0;_0x149424[_0xdfa4('0x39')]=0x0;_0x149424['unmanaged']=0x0;_0x149424['total']=0x0;if(!_0x149424[_0xdfa4('0x3a')]&&!_0x149424[_0xdfa4('0x3b')]){_0x149424[_0xdfa4('0x3c')]+=0x1;}if(!_0x149424[_0xdfa4('0x3a')]&&_0x149424[_0xdfa4('0x3b')]){_0x149424[_0xdfa4('0x38')]+=0x1;if(_0x149424['waiting']){_0x149424['waiting']-=0x1;}}if(_0x149424['closed']&&_0x149424['UserId']){_0x149424['answered']+=0x1;if(_0x149424['talking']){_0x149424[_0xdfa4('0x38')]-=0x1;}}if(_0x149424[_0xdfa4('0x3a')]&&!_0x149424['UserId']){_0x149424[_0xdfa4('0x3d')]+=0x1;if(_0x149424['waiting']){_0x149424[_0xdfa4('0x3c')]-=0x1;}}_0x149424['total']+=0x1;_0x1f2b45(_0x149424);});}exports['index']=function(_0x3fd6d4,_0x3dd60c){var _0x119421={},_0x262a0a={},_0x4433e9={'count':0x0,'rows':[]};var _0x1cc5da=_['map'](db['WhatsappInteraction'][_0xdfa4('0x3e')],function(_0xd89ce5){return{'name':_0xd89ce5[_0xdfa4('0x3f')],'type':_0xd89ce5['type'][_0xdfa4('0x40')]};});_0x262a0a[_0xdfa4('0x41')]=_['map'](_0x1cc5da,_0xdfa4('0x2e'));_0x262a0a[_0xdfa4('0x42')]=_['keys'](_0x3fd6d4[_0xdfa4('0x42')]);_0x262a0a[_0xdfa4('0x43')]=_['intersection'](_0x262a0a[_0xdfa4('0x41')],_0x262a0a['query']);_0x119421[_0xdfa4('0x44')]=_[_0xdfa4('0x45')](_0x262a0a['model'],qs[_0xdfa4('0x46')](_0x3fd6d4['query'][_0xdfa4('0x46')]));_0x119421['attributes']=_0x119421['attributes'][_0xdfa4('0x47')]?_0x119421['attributes']:_0x262a0a[_0xdfa4('0x41')];if(!_0x3fd6d4['query'][_0xdfa4('0x48')](_0xdfa4('0x49'))){_0x119421[_0xdfa4('0x25')]=qs[_0xdfa4('0x25')](_0x3fd6d4['query'][_0xdfa4('0x25')]);_0x119421[_0xdfa4('0x23')]=qs[_0xdfa4('0x23')](_0x3fd6d4[_0xdfa4('0x42')][_0xdfa4('0x23')]);}_0x119421[_0xdfa4('0x4a')]=qs[_0xdfa4('0x4b')](_0x3fd6d4[_0xdfa4('0x42')]['sort']);_0x119421[_0xdfa4('0x4c')]=qs['filters'](_[_0xdfa4('0x4d')](_0x3fd6d4['query'],_0x262a0a[_0xdfa4('0x43')]),_0x1cc5da);var _0x430ace=[];var _0x36f048=squel[_0xdfa4('0x4e')]()[_0xdfa4('0x4f')]('id')[_0xdfa4('0x4f')](_0xdfa4('0x2e'))[_0xdfa4('0x4f')](_0xdfa4('0x50'))[_0xdfa4('0x51')](_0xdfa4('0x52'));var _0x25dd8c=squel['select']()[_0xdfa4('0x4f')](_0xdfa4('0x53'))[_0xdfa4('0x4f')](_0xdfa4('0x54'))[_0xdfa4('0x4f')](_0xdfa4('0x55'))[_0xdfa4('0x51')](_0xdfa4('0x56'),'ui')[_0xdfa4('0x57')](_0xdfa4('0x58'),'u',_0xdfa4('0x59'));var _0xe85a86=squel[_0xdfa4('0x4e')]()[_0xdfa4('0x51')]('whatsapp_interactions','i')[_0xdfa4('0x57')](_0xdfa4('0x5a'),'c',_0xdfa4('0x5b'))['left_join'](_0xdfa4('0x58'),'o',_0xdfa4('0x5c'))[_0xdfa4('0x57')]('whatsapp_accounts','a',_0xdfa4('0x5d'))[_0xdfa4('0x57')](_0xdfa4('0x5e'),'me',_0xdfa4('0x5f'))[_0xdfa4('0x57')](_0xdfa4('0x60'),'it',_0xdfa4('0x61'))[_0xdfa4('0x57')](_0xdfa4('0x52'),'t',_0xdfa4('0x62'));var _0x18d36b=squel['expr']();var _0x5b34e4=[];var _0x346d8f=squel[_0xdfa4('0x63')]();var _0x63bb0b;if(_0x3fd6d4[_0xdfa4('0x42')][_0xdfa4('0x64')]){_0x63bb0b=as[_0xdfa4('0x65')](_0x3fd6d4['query'][_0xdfa4('0x64')]);var _0x447229=_0x63bb0b[_0xdfa4('0x66')];for(var _0x534f0c=0x0;_0x534f0c<_0x63bb0b[_0xdfa4('0x67')][_0xdfa4('0x47')];_0x534f0c++){var _0x6de394=_0x63bb0b[_0xdfa4('0x67')][_0x534f0c];var _0x1b76c3='i';var _0x42cd86=_[_0xdfa4('0x68')](_0x1cc5da,[_0xdfa4('0x2e'),_0x6de394[_0xdfa4('0x4f')]]);if(!_0x42cd86){switch(_0x6de394[_0xdfa4('0x4f')]){case'unreadMessages':if(_0x6de394[_0xdfa4('0x69')]==0x1){_0xe85a86[_0xdfa4('0x6a')]('`'+_0x6de394[_0xdfa4('0x4f')]+_0xdfa4('0x6b'));}else{_0xe85a86[_0xdfa4('0x6a')]('`'+_0x6de394['field']+'`\x20>\x200');}break;case'Contact':if(_0x6de394[_0xdfa4('0x6c')]==='$substring'){if(_0x6de394[_0xdfa4('0x69')][_0xdfa4('0x34')]('\x20')[_0xdfa4('0x47')]>0x1){_0x18d36b[_0x447229]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xdfa4('0x6d')](_0x6de394[_0xdfa4('0x69')]),null);}else{var _0xad2814='%'+_0x6de394[_0xdfa4('0x69')]+'%';_0x18d36b[_0x447229]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0xad2814,_0xad2814,_0xad2814);}}else{_0x42cd86=_[_0xdfa4('0x68')](_0x1cc5da,[_0xdfa4('0x2e'),_0xdfa4('0x6e')]);_0x6de394[_0xdfa4('0x4f')]='ContactId';_0x15f03d=as['buildExpression'](_0x1b76c3,_0x42cd86[_0xdfa4('0x6f')],_0x6de394);_0x18d36b[_0x447229](_0x15f03d[_0xdfa4('0x70')],_0x15f03d[_0xdfa4('0x69')][_0xdfa4('0x71')],_0x15f03d[_0xdfa4('0x69')]['end']);}break;case _0xdfa4('0x72'):var _0x3bbdcd=_0x6de394[_0xdfa4('0x69')][_0xdfa4('0x34')](',')['map'](function(_0x42c6aa){return Number(_0x42c6aa);});_0x3bbdcd[_0xdfa4('0x35')](function(_0x297f3a){_0x346d8f['or'](_0xdfa4('0x73'),'%,'+_0x297f3a+',%');});_0x5b34e4=_[_0xdfa4('0x74')](_0x5b34e4,_0x3bbdcd);break;case _0xdfa4('0x75'):if(_0x6de394['operator']===_0xdfa4('0x76')){_0x18d36b[_0x447229](_0xdfa4('0x77'),'%'+_0x6de394[_0xdfa4('0x69')]+'%',null);}else{_0x42cd86=_['find'](_0x1cc5da,[_0xdfa4('0x2e'),_0xdfa4('0x3b')]);_0x6de394['field']=_0xdfa4('0x3b');_0x15f03d=as[_0xdfa4('0x78')](_0x1b76c3,_0x42cd86[_0xdfa4('0x6f')],_0x6de394);_0x18d36b[_0x447229](_0x15f03d[_0xdfa4('0x70')],_0x15f03d[_0xdfa4('0x69')][_0xdfa4('0x71')],_0x15f03d[_0xdfa4('0x69')][_0xdfa4('0x20')]);}break;case _0xdfa4('0x79'):_0x15f03d=as[_0xdfa4('0x78')]('me',null,_0x6de394);_0x18d36b[_0x447229](_0x15f03d['text'],_0x15f03d[_0xdfa4('0x69')][_0xdfa4('0x71')],_0x15f03d[_0xdfa4('0x69')][_0xdfa4('0x20')]);break;}}else{var _0x15f03d=as[_0xdfa4('0x78')](_0x1b76c3,_0x42cd86[_0xdfa4('0x6f')],_0x6de394);_0x18d36b[_0x447229](_0x15f03d[_0xdfa4('0x70')],_0x15f03d[_0xdfa4('0x69')][_0xdfa4('0x71')],_0x15f03d[_0xdfa4('0x69')][_0xdfa4('0x20')]);}}}else{var _0x4ad98c=_(_0x3fd6d4['query'])[_0xdfa4('0x7a')]()[_0xdfa4('0x30')](function(_0x950e82){return _[_0xdfa4('0x7b')](_0x1cc5da,[_0xdfa4('0x2e'),_0x950e82])?_0x950e82:undefined;})[_0xdfa4('0x7c')]()[_0xdfa4('0x69')]();if(!_[_0xdfa4('0x7d')](_0x4ad98c)){_0x4ad98c['forEach'](function(_0x2340c9){if(_0x2340c9===_0xdfa4('0x7e')){_0xe85a86[_0xdfa4('0x4c')]('i.WhatsappAccountId\x20IN\x20?',[]['concat'](_0x3fd6d4[_0xdfa4('0x42')][_0x2340c9]));}else if(_0x2340c9===_0xdfa4('0x7f')){var _0x58f35c=JSON[_0xdfa4('0x80')](_0x3fd6d4[_0xdfa4('0x42')][_0x2340c9])[_0xdfa4('0x81')];var _0x5ecbea=JSON[_0xdfa4('0x80')](_0x3fd6d4[_0xdfa4('0x42')][_0x2340c9])[_0xdfa4('0x82')];_0xe85a86['where'](_0xdfa4('0x83'),_0x58f35c,_0x5ecbea);}else{if(_0x3fd6d4[_0xdfa4('0x42')][_0x2340c9]==='null'){_0xe85a86[_0xdfa4('0x4c')]('i.'+_0x2340c9+_0xdfa4('0x84'));}else{_0xe85a86[_0xdfa4('0x4c')]('i.'+_0x2340c9+'\x20=\x20?',_0x3fd6d4[_0xdfa4('0x42')][_0x2340c9]);}}});}if(_0x3fd6d4[_0xdfa4('0x42')][_0xdfa4('0x85')]){if(_0x3fd6d4[_0xdfa4('0x42')]['read']==0x1){_0xe85a86['having'](_0xdfa4('0x86'));}else{_0xe85a86[_0xdfa4('0x6a')]('`unreadMessages`\x20>\x200');}}if(_0x3fd6d4[_0xdfa4('0x42')][_0xdfa4('0x87')]){_0x5b34e4=_[_0xdfa4('0x88')](_0x3fd6d4[_0xdfa4('0x42')][_0xdfa4('0x87')])?_0x3fd6d4[_0xdfa4('0x42')][_0xdfa4('0x87')]:new Array(_0x3fd6d4[_0xdfa4('0x42')][_0xdfa4('0x87')]);_0x5b34e4['forEach'](function(_0x3e8b35){_0x346d8f['or'](_0xdfa4('0x73'),'%,'+_0x3e8b35+',%');});}if(_0x3fd6d4[_0xdfa4('0x42')][_0xdfa4('0x89')]){var _0x1f3fa6=_0x3fd6d4['query'][_0xdfa4('0x89')][_0xdfa4('0x8a')]('\x5c','\x5c\x5c')[_0xdfa4('0x8a')](/'/g,'\x27\x27');if(qs[_0xdfa4('0x8b')](_0x1f3fa6)){_0x18d36b['or']('i.id\x20LIKE\x20?',_0x1f3fa6+'%')['or'](_0xdfa4('0x8c'),_0x1f3fa6+'%');}else{_0x18d36b['or'](_0xdfa4('0x8d'),qs[_0xdfa4('0x6d')](_0x1f3fa6))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x1f3fa6+'%');}}}_0xe85a86['where'](_0x18d36b);_0xe85a86['group'](_0xdfa4('0x8e'));var _0x5a22d6={'type':db[_0xdfa4('0x8f')][_0xdfa4('0x90')][_0xdfa4('0x91')],'raw':!![]};var _0xc885e0=_0xe85a86[_0xdfa4('0x92')]();_0xc885e0[_0xdfa4('0x4f')](_0xdfa4('0x8e'));_0xc885e0[_0xdfa4('0x4f')](_0xdfa4('0x93'),_0xdfa4('0x94'));if(_0x119421[_0xdfa4('0x4a')]){_0x119421[_0xdfa4('0x4a')][_0xdfa4('0x35')](function(_0x31b6e4){var _0x195857=_0x31b6e4[0x0]===_0xdfa4('0x95')?_0x31b6e4[0x0]:'i.'+_0x31b6e4[0x0];_0xe85a86['order'](_0x195857,_0x31b6e4[0x1]===_0xdfa4('0x96')?![]:!![]);});}if(!_[_0xdfa4('0x7d')](_0x5b34e4)){_0xe85a86[_0xdfa4('0x6a')](_0x346d8f);_0xc885e0[_0xdfa4('0x4c')](_0xdfa4('0x97'),_0x5b34e4);}BPromise[_0xdfa4('0x98')]()['then'](function(){if(!_0x63bb0b){if(_0x3fd6d4[_0xdfa4('0x42')]['WhatsappAccountId'])return;_0xc885e0[_0xdfa4('0x4c')](_0xdfa4('0x99'));_0xe85a86[_0xdfa4('0x4c')](_0xdfa4('0x99'));return;}if(_0x3fd6d4[_0xdfa4('0x9a')][_0xdfa4('0x9b')]!==_0xdfa4('0x9c'))return;return _0x3fd6d4['user']['getWhatsappAccounts']({'attributes':['id'],'raw':!![]})[_0xdfa4('0x2b')](function(_0x38c3b1){if(_[_0xdfa4('0x7d')](_0x38c3b1)){_0xc885e0[_0xdfa4('0x4c')](_0xdfa4('0x9d'));_0xe85a86[_0xdfa4('0x4c')](_0xdfa4('0x9d'));}else{_0xc885e0[_0xdfa4('0x4c')](_0xdfa4('0x9e'),_[_0xdfa4('0x30')](_0x38c3b1,'id'));_0xe85a86['where'](_0xdfa4('0x9e'),_[_0xdfa4('0x30')](_0x38c3b1,'id'));}});})['then'](function(){if(_0x3fd6d4[_0xdfa4('0x9a')][_0xdfa4('0x9b')]===_0xdfa4('0x9c')&&!_0x63bb0b&&!_0x3fd6d4[_0xdfa4('0x42')]['WhatsappAccountId'])return[];return db[_0xdfa4('0x9f')][_0xdfa4('0x42')](_0xc885e0[_0xdfa4('0xa0')](),_0x5a22d6);})[_0xdfa4('0x2b')](function(_0x4601ac){_0x4433e9[_0xdfa4('0x26')]=_0x4601ac[_0xdfa4('0x47')];if(_0x4433e9['count']===0x0)return[];return db[_0xdfa4('0x9f')][_0xdfa4('0x42')](_0x36f048['toString'](),_0x5a22d6)[_0xdfa4('0x2b')](function(_0x4226d9){_0x430ace=_[_0xdfa4('0xa1')](_0x4226d9,'id');_0x5a22d6=_[_0xdfa4('0xa2')](_0x5a22d6,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3fd6d4[_0xdfa4('0x42')][_0xdfa4('0x46')]){_0x119421[_0xdfa4('0x44')][_0xdfa4('0x35')](function(_0x314987){_0xe85a86[_0xdfa4('0x4f')]('i.'+_0x314987);});}else{_0xe85a86[_0xdfa4('0x4f')](_0xdfa4('0x93'),_0xdfa4('0x94'));_0xe85a86[_0xdfa4('0x4f')](_0xdfa4('0xa3'),_0xdfa4('0xa4'));_0xe85a86[_0xdfa4('0x4f')](_0xdfa4('0xa5'),_0xdfa4('0xa6'));_0xe85a86[_0xdfa4('0x4f')](_0xdfa4('0xa7'),'contactName');_0xe85a86[_0xdfa4('0x4f')](_0xdfa4('0xa8'));_0xe85a86['field'](_0xdfa4('0xa9'),_0xdfa4('0xaa'));_0xe85a86['field'](_0xdfa4('0xab'),'Contact.lastName');_0xe85a86[_0xdfa4('0x4f')]('c.email',_0xdfa4('0xac'));_0xe85a86[_0xdfa4('0x4f')](_0xdfa4('0xad'),_0xdfa4('0xae'));_0xe85a86[_0xdfa4('0x4f')](_0xdfa4('0xaf'),_0xdfa4('0xb0'));_0xe85a86['field'](_0xdfa4('0xb1'),_0xdfa4('0xb2'));_0xe85a86['field']('o.fullname',_0xdfa4('0xb3'));_0xe85a86[_0xdfa4('0x4f')]('o.internal','Owner.internal');_0xe85a86[_0xdfa4('0x4f')](_0xdfa4('0xb4'),_0xdfa4('0x32'));}if(_0x119421[_0xdfa4('0x25')])_0xe85a86[_0xdfa4('0x25')](_0x119421['limit']);if(_0x119421[_0xdfa4('0x23')])_0xe85a86['offset'](_0x119421[_0xdfa4('0x23')]);return db[_0xdfa4('0x9f')][_0xdfa4('0x42')](_0xe85a86['toString'](),_0x5a22d6);})['then'](function(_0x37b886){if(_0x37b886[_0xdfa4('0x47')]>0x0)_0x25dd8c[_0xdfa4('0x4c')](_0xdfa4('0xb5'),_[_0xdfa4('0x30')](_0x37b886,'id'));return db[_0xdfa4('0x9f')][_0xdfa4('0x42')](_0x25dd8c[_0xdfa4('0xa0')](),_0x5a22d6)[_0xdfa4('0x2b')](function(_0x2203cb){var _0x2868eb=_[_0xdfa4('0xb6')](_0x2203cb,'WhatsappInteractionId');var _0x1335f7=[];_0x37b886[_0xdfa4('0x35')](function(_0x16a246){_0x1335f7['push'](updateWhatsappInteraction(_0x16a246,_0x430ace,_0x2868eb));});return BPromise['all'](_0x1335f7);});});})[_0xdfa4('0x2b')](function(_0x4ad7bb){_0x4433e9[_0xdfa4('0xb7')]=_0x4ad7bb;return _0x4433e9;})[_0xdfa4('0x2b')](respondWithFilteredResult(_0x3dd60c,_0x119421))['catch'](handleError(_0x3dd60c,null));};exports['show']=function(_0x191acb,_0x108dde){var _0x53b22f={'raw':![],'where':{'id':_0x191acb[_0xdfa4('0xb8')]['id']}},_0x25b78d={};_0x25b78d[_0xdfa4('0x41')]=_[_0xdfa4('0x7a')](db['WhatsappInteraction'][_0xdfa4('0x3e')]);_0x25b78d[_0xdfa4('0x42')]=_['keys'](_0x191acb[_0xdfa4('0x42')]);_0x25b78d[_0xdfa4('0x43')]=_[_0xdfa4('0x45')](_0x25b78d['model'],_0x25b78d[_0xdfa4('0x42')]);_0x53b22f[_0xdfa4('0x44')]=_[_0xdfa4('0x45')](_0x25b78d[_0xdfa4('0x41')],qs[_0xdfa4('0x46')](_0x191acb[_0xdfa4('0x42')]['fields']));_0x53b22f[_0xdfa4('0x44')]=_0x53b22f[_0xdfa4('0x44')][_0xdfa4('0x47')]?_0x53b22f[_0xdfa4('0x44')]:_0x25b78d[_0xdfa4('0x41')];if(_0x191acb[_0xdfa4('0x42')][_0xdfa4('0xb9')]){_0x53b22f[_0xdfa4('0xba')]=[{'all':!![]}];}_0x53b22f=_[_0xdfa4('0xa2')]({},_0x53b22f,_0x191acb[_0xdfa4('0xbb')]);return db[_0xdfa4('0xbc')][_0xdfa4('0x68')](_0x53b22f)[_0xdfa4('0x2b')](handleEntityNotFound(_0x108dde,null))[_0xdfa4('0x2b')](respondWithResult(_0x108dde,null))['catch'](handleError(_0x108dde,null));};exports['create']=function(_0x3d95dd,_0x2fb862){return db['WhatsappInteraction'][_0xdfa4('0xbd')](_0x3d95dd['body'],{})[_0xdfa4('0x2b')](respondWithResult(_0x2fb862,0xc9))[_0xdfa4('0x37')](handleError(_0x2fb862,null));};exports['update']=function(_0x5f4da4,_0x49c93b){if(_0x5f4da4[_0xdfa4('0x79')]['id']){delete _0x5f4da4['body']['id'];}return db[_0xdfa4('0xbc')][_0xdfa4('0x68')]({'where':{'id':_0x5f4da4[_0xdfa4('0xb8')]['id']}})[_0xdfa4('0x2b')](handleEntityNotFound(_0x49c93b,null))[_0xdfa4('0x2b')](saveUpdates(_0x5f4da4[_0xdfa4('0x79')],null))['then'](respondWithResult(_0x49c93b,null))[_0xdfa4('0x37')](handleError(_0x49c93b,null));};exports['destroy']=function(_0x9f5428,_0x4cecdb){return db[_0xdfa4('0xbc')][_0xdfa4('0x68')]({'where':{'id':_0x9f5428[_0xdfa4('0xb8')]['id']}})[_0xdfa4('0x2b')](handleEntityNotFound(_0x4cecdb,null))[_0xdfa4('0x2b')](removeEntity(_0x4cecdb,null))[_0xdfa4('0x37')](handleError(_0x4cecdb,null));};exports['describe']=function(_0x4424aa,_0x377b95){return db['WhatsappInteraction'][_0xdfa4('0xbe')]()[_0xdfa4('0x2b')](respondWithResult(_0x377b95,null))['catch'](handleError(_0x377b95,null));};exports['addMessage']=function(_0x358f7a,_0x1eae67,_0x513a98){return db['WhatsappMessage']['find']({'where':{'id':_0x358f7a['params']['id']}})[_0xdfa4('0x2b')](handleEntityNotFound(_0x1eae67,null))[_0xdfa4('0x2b')](function(_0xb806f2){if(_0xb806f2){return _0xb806f2[_0xdfa4('0xbf')](_0x358f7a['body']['ids'],_[_0xdfa4('0xc0')](_0x358f7a[_0xdfa4('0x79')],['ids','id'])||{});}})[_0xdfa4('0x2b')](respondWithResult(_0x1eae67,null))['catch'](handleError(_0x1eae67,null));};exports['getMessages']=function(_0x4fd797,_0x4305d0,_0x595f66){var _0x52171b={'raw':![],'where':{}};var _0x3d6ad0={};var _0x53ff21={'count':0x0,'rows':[]};return db[_0xdfa4('0xbc')][_0xdfa4('0xc1')]({'where':{'id':_0x4fd797[_0xdfa4('0xb8')]['id']}})['then'](handleEntityNotFound(_0x4305d0,null))['then'](function(_0x4d57ac){if(_0x4d57ac){_0x3d6ad0[_0xdfa4('0x41')]=_[_0xdfa4('0x7a')](db[_0xdfa4('0xc2')][_0xdfa4('0x3e')]);_0x3d6ad0[_0xdfa4('0x42')]=_[_0xdfa4('0x7a')](_0x4fd797['query']);_0x3d6ad0['filters']=_['intersection'](_0x3d6ad0[_0xdfa4('0x41')],_0x3d6ad0[_0xdfa4('0x42')]);_0x52171b[_0xdfa4('0x44')]=_[_0xdfa4('0x45')](_0x3d6ad0[_0xdfa4('0x41')],qs[_0xdfa4('0x46')](_0x4fd797[_0xdfa4('0x42')][_0xdfa4('0x46')]));_0x52171b['attributes']=_0x52171b[_0xdfa4('0x44')][_0xdfa4('0x47')]?_0x52171b['attributes']:_0x3d6ad0[_0xdfa4('0x41')];if(!_0x4fd797[_0xdfa4('0x42')][_0xdfa4('0x48')](_0xdfa4('0x49'))){_0x52171b['limit']=qs[_0xdfa4('0x25')](_0x4fd797[_0xdfa4('0x42')][_0xdfa4('0x25')]);_0x52171b[_0xdfa4('0x23')]=qs[_0xdfa4('0x23')](_0x4fd797[_0xdfa4('0x42')][_0xdfa4('0x23')]);}_0x52171b[_0xdfa4('0x4a')]=qs['sort'](_0x4fd797[_0xdfa4('0x42')][_0xdfa4('0x4b')]);_0x52171b[_0xdfa4('0x4c')]=qs[_0xdfa4('0x43')](_[_0xdfa4('0x4d')](_0x4fd797[_0xdfa4('0x42')],_0x3d6ad0[_0xdfa4('0x43')]));_0x52171b['where']['WhatsappInteractionId']=_0x4d57ac['id'];if(_0x4fd797[_0xdfa4('0x42')][_0xdfa4('0x89')]){_0x52171b[_0xdfa4('0x4c')]=_[_0xdfa4('0xa2')](_0x52171b[_0xdfa4('0x4c')],{'$or':_[_0xdfa4('0x30')](_0x52171b[_0xdfa4('0x44')],function(_0x57c12b){var _0x3f928d={};_0x3f928d[_0x57c12b]={'$like':'%'+_0x4fd797['query'][_0xdfa4('0x89')]+'%'};return _0x3f928d;})});}if(_0x4fd797['query'][_0xdfa4('0x81')]){var _0x392924=_0x4fd797[_0xdfa4('0x42')][_0xdfa4('0x81')][_0xdfa4('0x34')](',');var _0x27f78b={};_0x27f78b[_0x392924[0x0]]={'$gte':moment(_0x392924[0x1])[_0xdfa4('0xc3')](_0xdfa4('0xc4'))};_0x52171b[_0xdfa4('0x4c')]=_[_0xdfa4('0xa2')](_0x52171b[_0xdfa4('0x4c')],_0x27f78b);}_0x52171b=_[_0xdfa4('0xa2')]({},_0x52171b,_0x4fd797[_0xdfa4('0xbb')]);return db[_0xdfa4('0xc2')]['count']({'where':_0x52171b[_0xdfa4('0x4c')]})[_0xdfa4('0x2b')](function(_0x19f236){_0x53ff21[_0xdfa4('0x26')]=_0x19f236;if(_0x4fd797[_0xdfa4('0x42')][_0xdfa4('0xb9')]){_0x52171b[_0xdfa4('0xba')]=[{'all':!![]}];}return db[_0xdfa4('0xc2')][_0xdfa4('0xc5')](_0x52171b);})[_0xdfa4('0x2b')](function(_0x120dc8){_0x53ff21[_0xdfa4('0xb7')]=_0x120dc8;return _0x53ff21;});}})['then'](respondWithFilteredResult(_0x4305d0,_0x52171b))[_0xdfa4('0x37')](handleError(_0x4305d0,null));};exports[_0xdfa4('0xc6')]=function(_0x4a1b83,_0x20a19b,_0x35bf2f){return db[_0xdfa4('0xbc')][_0xdfa4('0x68')]({'where':{'id':_0x4a1b83[_0xdfa4('0xb8')]['id']}})['then'](handleEntityNotFound(_0x20a19b,null))[_0xdfa4('0x2b')](function(_0x2557e5){if(_0x2557e5){return _0x2557e5[_0xdfa4('0xc7')](_0x4a1b83[_0xdfa4('0x79')][_0xdfa4('0xc8')],_[_0xdfa4('0xc0')](_0x4a1b83[_0xdfa4('0x79')],[_0xdfa4('0xc8'),'id'])||{})['spread'](function(){return db[_0xdfa4('0x72')][_0xdfa4('0xc5')]({'attributes':['id','name','color'],'where':{'id':_0x4a1b83[_0xdfa4('0x79')][_0xdfa4('0xc8')]}});})['then'](function(_0x2d0934){socket[_0xdfa4('0xc9')](_0xdfa4('0xca'),{'id':Number(_0x4a1b83['params']['id']),'tags':_0x2d0934||[]});return{'id':Number(_0x4a1b83[_0xdfa4('0xb8')]['id']),'tags':_0x2d0934||[]};});}})[_0xdfa4('0x2b')](respondWithResult(_0x20a19b,null))[_0xdfa4('0x37')](handleError(_0x20a19b,null));};exports[_0xdfa4('0xcb')]=function(_0x102297,_0x53febf,_0x594c90){return db['WhatsappInteraction'][_0xdfa4('0x68')]({'where':{'id':_0x102297[_0xdfa4('0xb8')]['id']}})[_0xdfa4('0x2b')](handleEntityNotFound(_0x53febf,null))[_0xdfa4('0x2b')](function(_0x74f53){if(_0x74f53){return _0x74f53[_0xdfa4('0xcb')](_0x102297[_0xdfa4('0x42')][_0xdfa4('0xc8')]);}})[_0xdfa4('0x2b')](respondWithStatusCode(_0x53febf,null))[_0xdfa4('0x37')](handleError(_0x53febf,null));};exports[_0xdfa4('0xcc')]=function(_0x1c0255,_0x386994){var _0x3847c8=moment()[_0xdfa4('0xcd')]()['toString']();var _0x6a6b09=path[_0xdfa4('0xce')](config['root'],_0xdfa4('0xcf'),_0xdfa4('0xd0'),_0xdfa4('0xd1'));var _0x3d1959=path[_0xdfa4('0xce')](config[_0xdfa4('0xd2')],_0xdfa4('0xcf'),_0xdfa4('0xd0'),_0xdfa4('0xd3'));var _0x2b5257=path['join'](_0x6a6b09,_0x3847c8);var _0xf8eb32=util[_0xdfa4('0xc3')](_0xdfa4('0xd4'),_0x1c0255[_0xdfa4('0xb8')]['id'],_0x3847c8);var _0x2f827b=path[_0xdfa4('0xce')](_0x6a6b09,_0xf8eb32);var _0x129d4e=[];_0x129d4e[_0xdfa4('0x36')]({'model':db['User'],'as':_0xdfa4('0x75'),'attributes':['id',_0xdfa4('0x31')],'raw':!![]});_0x129d4e[_0xdfa4('0x36')]({'model':db[_0xdfa4('0xd5')],'as':_0xdfa4('0xd6'),'attributes':['id',_0xdfa4('0xd7'),_0xdfa4('0xd8')],'raw':!![]});if(_0x1c0255[_0xdfa4('0x42')][_0xdfa4('0xd3')]){_0x129d4e[_0xdfa4('0x36')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x58bbae=[{'model':db[_0xdfa4('0xc2')],'as':'Messages','attributes':['id',_0xdfa4('0x79'),_0xdfa4('0x7f'),_0xdfa4('0xd9'),_0xdfa4('0xda'),'read'],'include':_0x129d4e}];_0x58bbae[_0xdfa4('0x36')]({'model':db['WhatsappAccount'],'as':'Account','attributes':['id','name']});_0x58bbae[_0xdfa4('0x36')]({'model':db[_0xdfa4('0x75')],'as':_0xdfa4('0xdb'),'attributes':['id','fullname']});return db[_0xdfa4('0xbc')][_0xdfa4('0x68')]({'where':{'id':_0x1c0255[_0xdfa4('0xb8')]['id']},'include':_0x58bbae})['then'](handleEntityNotFound(_0x386994,null))['then'](function(_0x539d1c){if(_0x539d1c){var _0x354e86=_0x539d1c[_0xdfa4('0xdc')]({'plain':!![]});fs[_0xdfa4('0xdd')](_0x2b5257);var _0x3c836a={'channel':_0xdfa4('0xde'),'account':_0x354e86[_0xdfa4('0xdf')][_0xdfa4('0x2e')],'agent':_0x354e86[_0xdfa4('0xdb')]?_0x354e86[_0xdfa4('0xdb')]['fullname']:_0xdfa4('0xe0'),'createdAt':moment(_0x354e86[_0xdfa4('0x7f')])[_0xdfa4('0xc3')](_0xdfa4('0xc4'))[_0xdfa4('0xa0')](),'closedAt':_0x354e86[_0xdfa4('0x3a')]?moment(_0x354e86[_0xdfa4('0xe1')])[_0xdfa4('0xc3')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x354e86[_0xdfa4('0xe2')],'messages':_(_0x354e86['Messages'])[_0xdfa4('0x89')]({'secret':![]})[_0xdfa4('0x30')](function(_0x45a22a){if(_0x45a22a['Attachment']){var _0x412360=path[_0xdfa4('0xce')](_0x3d1959,_0x45a22a[_0xdfa4('0xe3')][_0xdfa4('0xe4')]);if(fs['existsSync'](_0x412360)){fs[_0xdfa4('0xe5')](_0x412360)['pipe'](fs[_0xdfa4('0xe6')](path[_0xdfa4('0xce')](_0x2b5257,_0x45a22a[_0xdfa4('0xe3')][_0xdfa4('0xe4')])));}}return{'date':moment(_0x45a22a['createdAt'])[_0xdfa4('0xc3')](_0xdfa4('0xc4'))[_0xdfa4('0xa0')](),'sender':_0x45a22a[_0xdfa4('0xd9')]===_0xdfa4('0xe7')?_0x45a22a[_0xdfa4('0x75')]?_0x45a22a[_0xdfa4('0x75')][_0xdfa4('0x31')]:_0xdfa4('0xe8'):_0x45a22a[_0xdfa4('0xd6')][_0xdfa4('0xd7')]+(_0x45a22a[_0xdfa4('0xd6')]['lastName']?'\x20'+_0x45a22a[_0xdfa4('0xd6')][_0xdfa4('0xd8')]:''),'body':_0x45a22a[_0xdfa4('0xe3')]?_0x45a22a[_0xdfa4('0xe3')][_0xdfa4('0xe4')]:_0x45a22a[_0xdfa4('0x79')],'direction':_0x45a22a[_0xdfa4('0xd9')]===_0xdfa4('0xe7')?'A':'C','secret':_0x45a22a['secret'],'read':_0x45a22a[_0xdfa4('0x85')],'attachment':_0x45a22a[_0xdfa4('0xe3')]};})[_0xdfa4('0x69')]()};return ejs[_0xdfa4('0xe9')](path[_0xdfa4('0xce')](config[_0xdfa4('0xd2')],_0xdfa4('0xcf'),_0xdfa4('0xea'),_0xdfa4('0xeb')),{'interaction':_0x3c836a})[_0xdfa4('0x2b')](function(_0x47ca44){var _0x230581=path[_0xdfa4('0xce')](_0x2b5257,_0xdfa4('0xec')+_0x354e86['id']+'-'+_0x3847c8+_0xdfa4('0xed'));var _0x34a155={'path':_0x230581,'channel':_0xdfa4('0xde'),'interactionId':_0x354e86['id']};return pdf[_0xdfa4('0xee')](_0x47ca44,_0x34a155);})['then'](function(){return new BPromise(function(_0x2a190b,_0x1e5f9e){zipdir(_0x2b5257,{'saveTo':_0x2f827b},function(_0x4c60db,_0x6df729){if(_0x4c60db)return _0x1e5f9e(_0x4c60db);return _0x2a190b(_0x6df729);});})[_0xdfa4('0x2b')](function(){return new BPromise(function(_0xb48e50,_0x503010){rimraf(_0x2b5257,function(_0x269116){if(_0x269116)_0x503010(_0x269116);return _0xb48e50();});});})[_0xdfa4('0x2b')](function(){return _0x386994['download'](_0x2f827b,_0xf8eb32,function(_0x139abe){if(_0x139abe){console[_0xdfa4('0xef')](_0xdfa4('0xf0'),_0x139abe);}else{fs[_0xdfa4('0xf1')](_0x2f827b);}});});});}else{return _0x386994[_0xdfa4('0x1f')](0xc8);}})[_0xdfa4('0x37')](handleError(_0x386994,null));}; \ No newline at end of file +var _0x2525=['N.A.','YYYY-MM-DD\x20HH:mm:ss','disposition','basename','existsSync','createReadStream','pipe','createWriteStream','direction','out','System','firstName','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','count','limit','set','save','update','destroy','then','name','Users','map','fullname','TagIds','forEach','Tags','push','waiting','talking','unmanaged','total','UserId','closed','answered','index','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','where','pick','select','field','tools_tags','u.id','u.fullname','ui.WhatsappInteractionId','from','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','left_join','users','o.id\x20=\x20i.UserId','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','Contact','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','find','ContactId','buildExpression','text','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','start','some','compact','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','isNumeric','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','clone','contactName','DESC','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','keyBy','merge','WhatsappInteraction','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','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.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','toString','ui.WhatsappInteractionId\x20IN\x20?','all','rows','catch','show','params','include','options','create','body','describe','addMessage','WhatsappMessage','ids','getMessages','hasOwnProperty','sort','includeAll','findAll','addTags','setTags','omit','spread','Tag','color','emit','removeTags','download','unix','root','server','files','join','attachments','format','transcript-%d-%s.zip','User','CmContact','lastName','Attachment','createdAt','secret','Account','Owner','Whatsapp'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0x2525,0x1f0));var _0x5252=function(_0x75f869,_0x3690d6){_0x75f869=_0x75f869-0x0;var _0x10af8b=_0x2525[_0x75f869];return _0x10af8b;};'use strict';var emlformat=require(_0x5252('0x0'));var rimraf=require(_0x5252('0x1'));var zipdir=require(_0x5252('0x2'));var jsonpatch=require(_0x5252('0x3'));var rp=require(_0x5252('0x4'));var moment=require(_0x5252('0x5'));var BPromise=require(_0x5252('0x6'));var Mustache=require(_0x5252('0x7'));var util=require(_0x5252('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x5252('0x9'));var ejs=require(_0x5252('0xa'));var fs=require('fs');var fs_extra=require(_0x5252('0xb'));var _=require(_0x5252('0xc'));var squel=require(_0x5252('0xd'));var crypto=require(_0x5252('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x5252('0xf'));var toCsv=require('to-csv');var querystring=require(_0x5252('0x10'));var Papa=require(_0x5252('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5252('0x12'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x5252('0x13'));var hardwareService=require(_0x5252('0x14'));var logger=require(_0x5252('0x15'))(_0x5252('0x16'));var utils=require(_0x5252('0x17'));var config=require(_0x5252('0x18'));var licenseUtil=require(_0x5252('0x19'));var db=require(_0x5252('0x1a'))['db'];config[_0x5252('0x1b')]=_[_0x5252('0x1c')](config[_0x5252('0x1b')],{'host':_0x5252('0x1d'),'port':0x18eb});var socket=require(_0x5252('0x1e'))(new Redis(config[_0x5252('0x1b')]));require('./whatsappInteraction.socket')['register'](socket);function respondWithStatusCode(_0x38246e,_0x1da80d){_0x1da80d=_0x1da80d||0xcc;return function(_0x240900){if(_0x240900){return _0x38246e[_0x5252('0x1f')](_0x1da80d);}return _0x38246e[_0x5252('0x20')](_0x1da80d)[_0x5252('0x21')]();};}function respondWithResult(_0x3aeab1,_0x5e1fb4){_0x5e1fb4=_0x5e1fb4||0xc8;return function(_0x4b244a){if(_0x4b244a){return _0x3aeab1['status'](_0x5e1fb4)[_0x5252('0x22')](_0x4b244a);}};}function respondWithFilteredResult(_0x22e8e2,_0x2ef8ec){return function(_0x10eb1e){if(_0x10eb1e){var _0x4034d2=typeof _0x2ef8ec[_0x5252('0x23')]===_0x5252('0x24')&&typeof _0x2ef8ec['limit']===_0x5252('0x24');var _0x151108=_0x10eb1e[_0x5252('0x25')];var _0x428553=_0x4034d2?0x0:_0x2ef8ec[_0x5252('0x23')];var _0x571f4d=_0x4034d2?_0x10eb1e[_0x5252('0x25')]:_0x2ef8ec[_0x5252('0x23')]+_0x2ef8ec[_0x5252('0x26')];var _0x7fb628;if(_0x571f4d>=_0x151108){_0x571f4d=_0x151108;_0x7fb628=0xc8;}else{_0x7fb628=0xce;}_0x22e8e2[_0x5252('0x20')](_0x7fb628);return _0x22e8e2[_0x5252('0x27')]('Content-Range',_0x428553+'-'+_0x571f4d+'/'+_0x151108)[_0x5252('0x22')](_0x10eb1e);}return null;};}function patchUpdates(_0x356b4c){return function(_0x57ec1b){try{jsonpatch['apply'](_0x57ec1b,_0x356b4c,!![]);}catch(_0x531417){return BPromise['reject'](_0x531417);}return _0x57ec1b[_0x5252('0x28')]();};}function saveUpdates(_0x437a75,_0x4bb596){return function(_0x3f2f9f){if(_0x3f2f9f){return _0x3f2f9f[_0x5252('0x29')](_0x437a75)['then'](function(_0x5ad231){return _0x5ad231;});}return null;};}function removeEntity(_0x3b6f4b,_0x57f24c){return function(_0x2d74af){if(_0x2d74af){return _0x2d74af[_0x5252('0x2a')]()[_0x5252('0x2b')](function(){_0x3b6f4b[_0x5252('0x20')](0xcc)[_0x5252('0x21')]();});}};}function handleEntityNotFound(_0x5d1b23,_0x537f52){return function(_0x39e1fd){if(!_0x39e1fd){_0x5d1b23['sendStatus'](0x194);}return _0x39e1fd;};}function handleError(_0x341d1d,_0x5abb6a){_0x5abb6a=_0x5abb6a||0x1f4;return function(_0x4a7d0b){logger['error'](_0x4a7d0b['stack']);if(_0x4a7d0b[_0x5252('0x2c')]){delete _0x4a7d0b[_0x5252('0x2c')];}_0x341d1d[_0x5252('0x20')](_0x5abb6a)['send'](_0x4a7d0b);};}function getInteractionUsers(_0x23b62c,_0x1de3d5){return new BPromise(function(_0x8fd7df,_0x4b6d00){try{if(_0x1de3d5[_0x23b62c['id']]){_0x23b62c[_0x5252('0x2d')]=_[_0x5252('0x2e')](_0x1de3d5[_0x23b62c['id']],function(_0xc83bae){return{'id':_0xc83bae['id'],'fullname':_0xc83bae[_0x5252('0x2f')]};});}}catch(_0x494fb1){_0x4b6d00(_0x494fb1);}_0x8fd7df(_0x23b62c);});}function getInteractionTags(_0x44974d,_0x4ad027){return new BPromise(function(_0x144dc1,_0xff2b2e){try{if(_0x44974d[_0x5252('0x30')]){_0x44974d['Tags']=[];_0x44974d[_0x5252('0x30')]['split'](',')[_0x5252('0x31')](function(_0x30c9e0){_0x44974d[_0x5252('0x32')][_0x5252('0x33')](_0x4ad027[_0x30c9e0]);});}delete _0x44974d['TagIds'];}catch(_0x2f3a73){_0xff2b2e(_0x2f3a73);}_0x144dc1(_0x44974d);});}function updateWhatsappInteraction(_0x580883,_0x5cf891,_0x5cd743){return new BPromise(function(_0x372edc,_0x5773e8){return getInteractionUsers(_0x580883,_0x5cd743)[_0x5252('0x2b')](function(_0x177f35){return getInteractionTags(_0x177f35,_0x5cf891);})[_0x5252('0x2b')](function(_0xbbb09d){return getStateInteraction(_0xbbb09d);})['then'](function(_0x4e1c96){_0x372edc(_0x4e1c96);})['catch'](function(_0x4b1428){_0x5773e8(_0x4b1428);});});}function getStateInteraction(_0x21a892){return new BPromise(function(_0x1a8480){_0x21a892[_0x5252('0x34')]=0x0;_0x21a892[_0x5252('0x35')]=0x0;_0x21a892['answered']=0x0;_0x21a892[_0x5252('0x36')]=0x0;_0x21a892[_0x5252('0x37')]=0x0;if(!_0x21a892['closed']&&!_0x21a892[_0x5252('0x38')]){_0x21a892[_0x5252('0x34')]+=0x1;}if(!_0x21a892[_0x5252('0x39')]&&_0x21a892['UserId']){_0x21a892['talking']+=0x1;if(_0x21a892[_0x5252('0x34')]){_0x21a892[_0x5252('0x34')]-=0x1;}}if(_0x21a892[_0x5252('0x39')]&&_0x21a892[_0x5252('0x38')]){_0x21a892[_0x5252('0x3a')]+=0x1;if(_0x21a892['talking']){_0x21a892[_0x5252('0x35')]-=0x1;}}if(_0x21a892[_0x5252('0x39')]&&!_0x21a892['UserId']){_0x21a892[_0x5252('0x36')]+=0x1;if(_0x21a892[_0x5252('0x34')]){_0x21a892['waiting']-=0x1;}}_0x21a892[_0x5252('0x37')]+=0x1;_0x1a8480(_0x21a892);});}exports[_0x5252('0x3b')]=function(_0x2fb20e,_0x190358){var _0x1588c3={},_0x31e161={},_0x56a7c8={'count':0x0,'rows':[]};var _0x53fd1d=_[_0x5252('0x2e')](db['WhatsappInteraction'][_0x5252('0x3c')],function(_0x564fb9){return{'name':_0x564fb9[_0x5252('0x3d')],'type':_0x564fb9[_0x5252('0x3e')]['key']};});_0x31e161[_0x5252('0x3f')]=_['map'](_0x53fd1d,_0x5252('0x2c'));_0x31e161[_0x5252('0x40')]=_[_0x5252('0x41')](_0x2fb20e[_0x5252('0x40')]);_0x31e161[_0x5252('0x42')]=_[_0x5252('0x43')](_0x31e161['model'],_0x31e161['query']);_0x1588c3[_0x5252('0x44')]=_[_0x5252('0x43')](_0x31e161[_0x5252('0x3f')],qs[_0x5252('0x45')](_0x2fb20e['query']['fields']));_0x1588c3[_0x5252('0x44')]=_0x1588c3[_0x5252('0x44')][_0x5252('0x46')]?_0x1588c3['attributes']:_0x31e161[_0x5252('0x3f')];if(!_0x2fb20e[_0x5252('0x40')]['hasOwnProperty'](_0x5252('0x47'))){_0x1588c3[_0x5252('0x26')]=qs[_0x5252('0x26')](_0x2fb20e['query'][_0x5252('0x26')]);_0x1588c3[_0x5252('0x23')]=qs['offset'](_0x2fb20e[_0x5252('0x40')]['offset']);}_0x1588c3[_0x5252('0x48')]=qs['sort'](_0x2fb20e[_0x5252('0x40')]['sort']);_0x1588c3[_0x5252('0x49')]=qs[_0x5252('0x42')](_[_0x5252('0x4a')](_0x2fb20e[_0x5252('0x40')],_0x31e161[_0x5252('0x42')]),_0x53fd1d);var _0x3d9e73=[];var _0x5460a9=squel[_0x5252('0x4b')]()['field']('id')[_0x5252('0x4c')](_0x5252('0x2c'))[_0x5252('0x4c')]('color')['from'](_0x5252('0x4d'));var _0x4ca04b=squel[_0x5252('0x4b')]()['field'](_0x5252('0x4e'))[_0x5252('0x4c')](_0x5252('0x4f'))['field'](_0x5252('0x50'))[_0x5252('0x51')]('user_has_whatsapp_interactions','ui')['left_join']('users','u','u.id\x20=\x20ui.UserId');var _0x307761=squel[_0x5252('0x4b')]()['from']('whatsapp_interactions','i')['left_join'](_0x5252('0x52'),'c',_0x5252('0x53'))[_0x5252('0x54')](_0x5252('0x55'),'o',_0x5252('0x56'))['left_join']('whatsapp_accounts','a',_0x5252('0x57'))[_0x5252('0x54')](_0x5252('0x58'),'me',_0x5252('0x59'))['left_join'](_0x5252('0x5a'),'it',_0x5252('0x5b'))['left_join'](_0x5252('0x4d'),'t',_0x5252('0x5c'));var _0x24576b=squel['expr']();var _0x3b2855=[];var _0x2d0f44=squel[_0x5252('0x5d')]();var _0x5d8637;if(_0x2fb20e['query']['search']){_0x5d8637=as[_0x5252('0x5e')](_0x2fb20e[_0x5252('0x40')][_0x5252('0x5f')]);var _0x30c64e=_0x5d8637[_0x5252('0x60')];for(var _0x453fb7=0x0;_0x453fb7<_0x5d8637[_0x5252('0x61')][_0x5252('0x46')];_0x453fb7++){var _0x3e1ad9=_0x5d8637['conditions'][_0x453fb7];var _0x49f62f='i';var _0x252e25=_['find'](_0x53fd1d,[_0x5252('0x2c'),_0x3e1ad9[_0x5252('0x4c')]]);if(!_0x252e25){switch(_0x3e1ad9['field']){case _0x5252('0x62'):if(_0x3e1ad9[_0x5252('0x63')]==0x1){_0x307761[_0x5252('0x64')]('`'+_0x3e1ad9['field']+_0x5252('0x65'));}else{_0x307761['having']('`'+_0x3e1ad9[_0x5252('0x4c')]+'`\x20>\x200');}break;case _0x5252('0x66'):if(_0x3e1ad9[_0x5252('0x67')]===_0x5252('0x68')){if(_0x3e1ad9[_0x5252('0x63')][_0x5252('0x69')]('\x20')[_0x5252('0x46')]>0x1){_0x24576b[_0x30c64e](_0x5252('0x6a'),qs[_0x5252('0x6b')](_0x3e1ad9[_0x5252('0x63')]),null);}else{var _0x29aa21='%'+_0x3e1ad9[_0x5252('0x63')]+'%';_0x24576b[_0x30c64e]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x29aa21,_0x29aa21,_0x29aa21);}}else{_0x252e25=_[_0x5252('0x6c')](_0x53fd1d,[_0x5252('0x2c'),_0x5252('0x6d')]);_0x3e1ad9[_0x5252('0x4c')]='ContactId';_0x28859f=as[_0x5252('0x6e')](_0x49f62f,_0x252e25['type'],_0x3e1ad9);_0x24576b[_0x30c64e](_0x28859f[_0x5252('0x6f')],_0x28859f[_0x5252('0x63')]['start'],_0x28859f[_0x5252('0x63')]['end']);}break;case'Tag':var _0x2a4c81=_0x3e1ad9[_0x5252('0x63')][_0x5252('0x69')](',')[_0x5252('0x2e')](function(_0xdc14d0){return Number(_0xdc14d0);});_0x2a4c81['forEach'](function(_0x1d452e){_0x2d0f44['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1d452e+',%');});_0x3b2855=_[_0x5252('0x70')](_0x3b2855,_0x2a4c81);break;case'User':if(_0x3e1ad9[_0x5252('0x67')]==='$substring'){_0x24576b[_0x30c64e](_0x5252('0x71'),'%'+_0x3e1ad9[_0x5252('0x63')]+'%',null);}else{_0x252e25=_['find'](_0x53fd1d,[_0x5252('0x2c'),_0x5252('0x38')]);_0x3e1ad9[_0x5252('0x4c')]=_0x5252('0x38');_0x28859f=as['buildExpression'](_0x49f62f,_0x252e25['type'],_0x3e1ad9);_0x24576b[_0x30c64e](_0x28859f[_0x5252('0x6f')],_0x28859f[_0x5252('0x63')][_0x5252('0x72')],_0x28859f[_0x5252('0x63')][_0x5252('0x21')]);}break;case'body':_0x28859f=as[_0x5252('0x6e')]('me',null,_0x3e1ad9);_0x24576b[_0x30c64e](_0x28859f['text'],_0x28859f[_0x5252('0x63')]['start'],_0x28859f['value']['end']);break;}}else{var _0x28859f=as[_0x5252('0x6e')](_0x49f62f,_0x252e25[_0x5252('0x3e')],_0x3e1ad9);_0x24576b[_0x30c64e](_0x28859f[_0x5252('0x6f')],_0x28859f[_0x5252('0x63')][_0x5252('0x72')],_0x28859f[_0x5252('0x63')][_0x5252('0x21')]);}}}else{var _0x1aead=_(_0x2fb20e[_0x5252('0x40')])[_0x5252('0x41')]()[_0x5252('0x2e')](function(_0x8d5794){return _[_0x5252('0x73')](_0x53fd1d,[_0x5252('0x2c'),_0x8d5794])?_0x8d5794:undefined;})[_0x5252('0x74')]()[_0x5252('0x63')]();if(!_[_0x5252('0x75')](_0x1aead)){_0x1aead[_0x5252('0x31')](function(_0x4eb184){if(_0x4eb184===_0x5252('0x76')){_0x307761['where'](_0x5252('0x77'),[][_0x5252('0x78')](_0x2fb20e[_0x5252('0x40')][_0x4eb184]));}else if(_0x4eb184==='createdAt'){var _0x2a0408=JSON[_0x5252('0x79')](_0x2fb20e[_0x5252('0x40')][_0x4eb184])[_0x5252('0x7a')];var _0x18abc3=JSON[_0x5252('0x79')](_0x2fb20e['query'][_0x4eb184])['$lte'];_0x307761[_0x5252('0x49')](_0x5252('0x7b'),_0x2a0408,_0x18abc3);}else{if(_0x2fb20e[_0x5252('0x40')][_0x4eb184]===_0x5252('0x7c')){_0x307761[_0x5252('0x49')]('i.'+_0x4eb184+_0x5252('0x7d'));}else{_0x307761['where']('i.'+_0x4eb184+_0x5252('0x7e'),_0x2fb20e[_0x5252('0x40')][_0x4eb184]);}}});}if(_0x2fb20e['query'][_0x5252('0x7f')]){if(_0x2fb20e['query'][_0x5252('0x7f')]==0x1){_0x307761[_0x5252('0x64')](_0x5252('0x80'));}else{_0x307761[_0x5252('0x64')]('`unreadMessages`\x20>\x200');}}if(_0x2fb20e[_0x5252('0x40')][_0x5252('0x81')]){_0x3b2855=_[_0x5252('0x82')](_0x2fb20e['query'][_0x5252('0x81')])?_0x2fb20e[_0x5252('0x40')][_0x5252('0x81')]:new Array(_0x2fb20e[_0x5252('0x40')]['tag']);_0x3b2855[_0x5252('0x31')](function(_0x1644c2){_0x2d0f44['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1644c2+',%');});}if(_0x2fb20e[_0x5252('0x40')][_0x5252('0x83')]){var _0x3be72b=_0x2fb20e[_0x5252('0x40')][_0x5252('0x83')][_0x5252('0x84')]('\x5c','\x5c\x5c')[_0x5252('0x84')](/'/g,'\x27\x27');if(qs[_0x5252('0x85')](_0x3be72b)){_0x24576b['or']('i.id\x20LIKE\x20?',_0x3be72b+'%')['or'](_0x5252('0x86'),_0x3be72b+'%');}else{_0x24576b['or'](_0x5252('0x87'),qs[_0x5252('0x6b')](_0x3be72b))['or'](_0x5252('0x88'),_0x3be72b+'%');}}}_0x307761[_0x5252('0x49')](_0x24576b);_0x307761[_0x5252('0x89')](_0x5252('0x8a'));var _0x597db5={'type':db[_0x5252('0x8b')]['QueryTypes'][_0x5252('0x8c')],'raw':!![]};var _0x28cd47=_0x307761[_0x5252('0x8d')]();_0x28cd47[_0x5252('0x4c')](_0x5252('0x8a'));_0x28cd47['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x5252('0x62'));if(_0x1588c3[_0x5252('0x48')]){_0x1588c3[_0x5252('0x48')][_0x5252('0x31')](function(_0x236a97){var _0x1d72cf=_0x236a97[0x0]===_0x5252('0x8e')?_0x236a97[0x0]:'i.'+_0x236a97[0x0];_0x307761[_0x5252('0x48')](_0x1d72cf,_0x236a97[0x1]===_0x5252('0x8f')?![]:!![]);});}if(!_[_0x5252('0x75')](_0x3b2855)){_0x307761['having'](_0x2d0f44);_0x28cd47[_0x5252('0x49')](_0x5252('0x90'),_0x3b2855);}BPromise[_0x5252('0x91')]()[_0x5252('0x2b')](function(){if(!_0x5d8637){if(_0x2fb20e['query']['WhatsappAccountId'])return;_0x28cd47['where'](_0x5252('0x92'));_0x307761[_0x5252('0x49')](_0x5252('0x92'));return;}if(_0x2fb20e[_0x5252('0x93')]['role']!==_0x5252('0x94'))return;return _0x2fb20e[_0x5252('0x93')][_0x5252('0x95')]({'attributes':['id'],'raw':!![]})[_0x5252('0x2b')](function(_0x50d3a0){if(_[_0x5252('0x75')](_0x50d3a0)){_0x28cd47[_0x5252('0x49')]('i.WhatsappAccountId\x20IS\x20NULL');_0x307761[_0x5252('0x49')](_0x5252('0x96'));}else{_0x28cd47[_0x5252('0x49')](_0x5252('0x77'),_[_0x5252('0x2e')](_0x50d3a0,'id'));_0x307761[_0x5252('0x49')](_0x5252('0x77'),_[_0x5252('0x2e')](_0x50d3a0,'id'));}});})[_0x5252('0x2b')](function(){if(_0x2fb20e[_0x5252('0x93')]['role']===_0x5252('0x94')&&!_0x5d8637&&!_0x2fb20e['query'][_0x5252('0x76')])return[];return db[_0x5252('0x97')][_0x5252('0x40')](_0x28cd47['toString'](),_0x597db5);})[_0x5252('0x2b')](function(_0x3991a6){_0x56a7c8[_0x5252('0x25')]=_0x3991a6[_0x5252('0x46')];if(_0x56a7c8[_0x5252('0x25')]===0x0)return[];return db['sequelize'][_0x5252('0x40')](_0x5460a9['toString'](),_0x597db5)[_0x5252('0x2b')](function(_0x30c78e){_0x3d9e73=_[_0x5252('0x98')](_0x30c78e,'id');_0x597db5=_[_0x5252('0x99')](_0x597db5,{'model':db[_0x5252('0x9a')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2fb20e[_0x5252('0x40')][_0x5252('0x45')]){_0x1588c3[_0x5252('0x44')][_0x5252('0x31')](function(_0x47b5b7){_0x307761[_0x5252('0x4c')]('i.'+_0x47b5b7);});}else{_0x307761[_0x5252('0x4c')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x5252('0x62'));_0x307761[_0x5252('0x4c')](_0x5252('0x9b'),'Account.key');_0x307761[_0x5252('0x4c')](_0x5252('0x9c'),_0x5252('0x9d'));_0x307761[_0x5252('0x4c')](_0x5252('0x9e'),_0x5252('0x8e'));_0x307761['field'](_0x5252('0x9f'));_0x307761[_0x5252('0x4c')](_0x5252('0xa0'),'Contact.firstName');_0x307761[_0x5252('0x4c')]('c.lastName','Contact.lastName');_0x307761['field'](_0x5252('0xa1'),_0x5252('0xa2'));_0x307761['field'](_0x5252('0xa3'),_0x5252('0xa4'));_0x307761[_0x5252('0x4c')]('c.mobile',_0x5252('0xa5'));_0x307761[_0x5252('0x4c')](_0x5252('0xa6'),_0x5252('0xa7'));_0x307761[_0x5252('0x4c')](_0x5252('0xa8'),_0x5252('0xa9'));_0x307761[_0x5252('0x4c')](_0x5252('0xaa'),_0x5252('0xab'));_0x307761[_0x5252('0x4c')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x5252('0x30'));}if(_0x1588c3['limit'])_0x307761[_0x5252('0x26')](_0x1588c3['limit']);if(_0x1588c3['offset'])_0x307761[_0x5252('0x23')](_0x1588c3[_0x5252('0x23')]);return db[_0x5252('0x97')][_0x5252('0x40')](_0x307761[_0x5252('0xac')](),_0x597db5);})[_0x5252('0x2b')](function(_0x2a7a90){if(_0x2a7a90[_0x5252('0x46')]>0x0)_0x4ca04b[_0x5252('0x49')](_0x5252('0xad'),_['map'](_0x2a7a90,'id'));return db[_0x5252('0x97')][_0x5252('0x40')](_0x4ca04b[_0x5252('0xac')](),_0x597db5)['then'](function(_0x32b2f3){var _0x38a9d3=_['groupBy'](_0x32b2f3,'WhatsappInteractionId');var _0x3d5308=[];_0x2a7a90[_0x5252('0x31')](function(_0x590ebd){_0x3d5308[_0x5252('0x33')](updateWhatsappInteraction(_0x590ebd,_0x3d9e73,_0x38a9d3));});return BPromise[_0x5252('0xae')](_0x3d5308);});});})[_0x5252('0x2b')](function(_0x549a68){_0x56a7c8[_0x5252('0xaf')]=_0x549a68;return _0x56a7c8;})[_0x5252('0x2b')](respondWithFilteredResult(_0x190358,_0x1588c3))[_0x5252('0xb0')](handleError(_0x190358,null));};exports[_0x5252('0xb1')]=function(_0x2dde6e,_0xba2a76){var _0x5d5880={'raw':![],'where':{'id':_0x2dde6e[_0x5252('0xb2')]['id']}},_0x277206={};_0x277206['model']=_[_0x5252('0x41')](db[_0x5252('0x9a')]['rawAttributes']);_0x277206['query']=_[_0x5252('0x41')](_0x2dde6e[_0x5252('0x40')]);_0x277206[_0x5252('0x42')]=_[_0x5252('0x43')](_0x277206[_0x5252('0x3f')],_0x277206['query']);_0x5d5880[_0x5252('0x44')]=_[_0x5252('0x43')](_0x277206[_0x5252('0x3f')],qs[_0x5252('0x45')](_0x2dde6e[_0x5252('0x40')][_0x5252('0x45')]));_0x5d5880[_0x5252('0x44')]=_0x5d5880['attributes'][_0x5252('0x46')]?_0x5d5880['attributes']:_0x277206[_0x5252('0x3f')];if(_0x2dde6e[_0x5252('0x40')]['includeAll']){_0x5d5880[_0x5252('0xb3')]=[{'all':!![]}];}_0x5d5880=_['merge']({},_0x5d5880,_0x2dde6e[_0x5252('0xb4')]);return db[_0x5252('0x9a')][_0x5252('0x6c')](_0x5d5880)[_0x5252('0x2b')](handleEntityNotFound(_0xba2a76,null))[_0x5252('0x2b')](respondWithResult(_0xba2a76,null))[_0x5252('0xb0')](handleError(_0xba2a76,null));};exports['create']=function(_0x455725,_0x3096e9){return db['WhatsappInteraction'][_0x5252('0xb5')](_0x455725[_0x5252('0xb6')],{})['then'](respondWithResult(_0x3096e9,0xc9))['catch'](handleError(_0x3096e9,null));};exports[_0x5252('0x29')]=function(_0x402d4e,_0x46845){if(_0x402d4e[_0x5252('0xb6')]['id']){delete _0x402d4e[_0x5252('0xb6')]['id'];}return db[_0x5252('0x9a')][_0x5252('0x6c')]({'where':{'id':_0x402d4e[_0x5252('0xb2')]['id']}})[_0x5252('0x2b')](handleEntityNotFound(_0x46845,null))[_0x5252('0x2b')](saveUpdates(_0x402d4e[_0x5252('0xb6')],null))['then'](respondWithResult(_0x46845,null))[_0x5252('0xb0')](handleError(_0x46845,null));};exports['destroy']=function(_0x37167a,_0x1eb2ed){return db['WhatsappInteraction'][_0x5252('0x6c')]({'where':{'id':_0x37167a['params']['id']}})['then'](handleEntityNotFound(_0x1eb2ed,null))[_0x5252('0x2b')](removeEntity(_0x1eb2ed,null))[_0x5252('0xb0')](handleError(_0x1eb2ed,null));};exports[_0x5252('0xb7')]=function(_0x2fa2ac,_0x4a05b8){return db[_0x5252('0x9a')]['describe']()['then'](respondWithResult(_0x4a05b8,null))[_0x5252('0xb0')](handleError(_0x4a05b8,null));};exports[_0x5252('0xb8')]=function(_0x5c2b25,_0x3c572c,_0x1a104d){return db[_0x5252('0xb9')][_0x5252('0x6c')]({'where':{'id':_0x5c2b25[_0x5252('0xb2')]['id']}})[_0x5252('0x2b')](handleEntityNotFound(_0x3c572c,null))[_0x5252('0x2b')](function(_0x4045c8){if(_0x4045c8){return _0x4045c8[_0x5252('0xb8')](_0x5c2b25[_0x5252('0xb6')]['ids'],_['omit'](_0x5c2b25[_0x5252('0xb6')],[_0x5252('0xba'),'id'])||{});}})['then'](respondWithResult(_0x3c572c,null))[_0x5252('0xb0')](handleError(_0x3c572c,null));};exports[_0x5252('0xbb')]=function(_0x148b5e,_0xe77744,_0x201d03){var _0x1721d6={'raw':![],'where':{}};var _0x649dcb={};var _0x4c2757={'count':0x0,'rows':[]};return db[_0x5252('0x9a')]['findOne']({'where':{'id':_0x148b5e[_0x5252('0xb2')]['id']}})[_0x5252('0x2b')](handleEntityNotFound(_0xe77744,null))[_0x5252('0x2b')](function(_0x115104){if(_0x115104){_0x649dcb[_0x5252('0x3f')]=_[_0x5252('0x41')](db[_0x5252('0xb9')]['rawAttributes']);_0x649dcb[_0x5252('0x40')]=_[_0x5252('0x41')](_0x148b5e[_0x5252('0x40')]);_0x649dcb[_0x5252('0x42')]=_[_0x5252('0x43')](_0x649dcb[_0x5252('0x3f')],_0x649dcb[_0x5252('0x40')]);_0x1721d6[_0x5252('0x44')]=_['intersection'](_0x649dcb[_0x5252('0x3f')],qs['fields'](_0x148b5e[_0x5252('0x40')]['fields']));_0x1721d6[_0x5252('0x44')]=_0x1721d6[_0x5252('0x44')][_0x5252('0x46')]?_0x1721d6['attributes']:_0x649dcb[_0x5252('0x3f')];if(!_0x148b5e[_0x5252('0x40')][_0x5252('0xbc')](_0x5252('0x47'))){_0x1721d6[_0x5252('0x26')]=qs[_0x5252('0x26')](_0x148b5e['query']['limit']);_0x1721d6['offset']=qs['offset'](_0x148b5e['query'][_0x5252('0x23')]);}_0x1721d6[_0x5252('0x48')]=qs[_0x5252('0xbd')](_0x148b5e[_0x5252('0x40')]['sort']);_0x1721d6[_0x5252('0x49')]=qs[_0x5252('0x42')](_[_0x5252('0x4a')](_0x148b5e[_0x5252('0x40')],_0x649dcb[_0x5252('0x42')]));_0x1721d6['where']['WhatsappInteractionId']=_0x115104['id'];if(_0x148b5e[_0x5252('0x40')][_0x5252('0x83')]){_0x1721d6[_0x5252('0x49')]=_[_0x5252('0x99')](_0x1721d6[_0x5252('0x49')],{'$or':_['map'](_0x1721d6[_0x5252('0x44')],function(_0x2cd173){var _0x3ffb52={};_0x3ffb52[_0x2cd173]={'$like':'%'+_0x148b5e[_0x5252('0x40')][_0x5252('0x83')]+'%'};return _0x3ffb52;})});}if(_0x148b5e[_0x5252('0x40')][_0x5252('0x7a')]){var _0x5dad41=_0x148b5e[_0x5252('0x40')][_0x5252('0x7a')][_0x5252('0x69')](',');var _0x5c6d8f={};_0x5c6d8f[_0x5dad41[0x0]]={'$gte':moment(_0x5dad41[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x1721d6[_0x5252('0x49')]=_[_0x5252('0x99')](_0x1721d6[_0x5252('0x49')],_0x5c6d8f);}_0x1721d6=_[_0x5252('0x99')]({},_0x1721d6,_0x148b5e[_0x5252('0xb4')]);return db[_0x5252('0xb9')]['count']({'where':_0x1721d6['where']})[_0x5252('0x2b')](function(_0x1c8999){_0x4c2757[_0x5252('0x25')]=_0x1c8999;if(_0x148b5e[_0x5252('0x40')][_0x5252('0xbe')]){_0x1721d6[_0x5252('0xb3')]=[{'all':!![]}];}return db[_0x5252('0xb9')][_0x5252('0xbf')](_0x1721d6);})[_0x5252('0x2b')](function(_0x363f04){_0x4c2757[_0x5252('0xaf')]=_0x363f04;return _0x4c2757;});}})[_0x5252('0x2b')](respondWithFilteredResult(_0xe77744,_0x1721d6))['catch'](handleError(_0xe77744,null));};exports[_0x5252('0xc0')]=function(_0xd0fa7b,_0x1d2d90,_0x1e17f6){return db[_0x5252('0x9a')]['find']({'where':{'id':_0xd0fa7b[_0x5252('0xb2')]['id']}})['then'](handleEntityNotFound(_0x1d2d90,null))['then'](function(_0x3b7cf9){if(_0x3b7cf9){return _0x3b7cf9[_0x5252('0xc1')](_0xd0fa7b[_0x5252('0xb6')][_0x5252('0xba')],_[_0x5252('0xc2')](_0xd0fa7b[_0x5252('0xb6')],[_0x5252('0xba'),'id'])||{})[_0x5252('0xc3')](function(){return db[_0x5252('0xc4')][_0x5252('0xbf')]({'attributes':['id',_0x5252('0x2c'),_0x5252('0xc5')],'where':{'id':_0xd0fa7b[_0x5252('0xb6')][_0x5252('0xba')]}});})['then'](function(_0x323bec){socket[_0x5252('0xc6')]('whatsappInteractionTags:save',{'id':Number(_0xd0fa7b[_0x5252('0xb2')]['id']),'tags':_0x323bec||[]});return{'id':Number(_0xd0fa7b[_0x5252('0xb2')]['id']),'tags':_0x323bec||[]};});}})[_0x5252('0x2b')](respondWithResult(_0x1d2d90,null))[_0x5252('0xb0')](handleError(_0x1d2d90,null));};exports[_0x5252('0xc7')]=function(_0x1b8dc7,_0x3c425f,_0x2f1245){return db['WhatsappInteraction'][_0x5252('0x6c')]({'where':{'id':_0x1b8dc7['params']['id']}})[_0x5252('0x2b')](handleEntityNotFound(_0x3c425f,null))[_0x5252('0x2b')](function(_0x437e21){if(_0x437e21){return _0x437e21[_0x5252('0xc7')](_0x1b8dc7[_0x5252('0x40')]['ids']);}})['then'](respondWithStatusCode(_0x3c425f,null))[_0x5252('0xb0')](handleError(_0x3c425f,null));};exports[_0x5252('0xc8')]=function(_0x49891a,_0xc6e407){var _0xc26f4=moment()[_0x5252('0xc9')]()[_0x5252('0xac')]();var _0x514e39=path['join'](config[_0x5252('0xca')],_0x5252('0xcb'),_0x5252('0xcc'),'tmp');var _0x386517=path[_0x5252('0xcd')](config[_0x5252('0xca')],_0x5252('0xcb'),_0x5252('0xcc'),_0x5252('0xce'));var _0x18e2fa=path[_0x5252('0xcd')](_0x514e39,_0xc26f4);var _0x208b31=util[_0x5252('0xcf')](_0x5252('0xd0'),_0x49891a[_0x5252('0xb2')]['id'],_0xc26f4);var _0x58e854=path[_0x5252('0xcd')](_0x514e39,_0x208b31);var _0x358cf9=[];_0x358cf9[_0x5252('0x33')]({'model':db[_0x5252('0xd1')],'as':_0x5252('0xd1'),'attributes':['id','fullname'],'raw':!![]});_0x358cf9[_0x5252('0x33')]({'model':db[_0x5252('0xd2')],'as':'Contact','attributes':['id','firstName',_0x5252('0xd3')],'raw':!![]});if(_0x49891a[_0x5252('0x40')][_0x5252('0xce')]){_0x358cf9[_0x5252('0x33')]({'model':db[_0x5252('0xd4')],'as':'Attachment','raw':!![]});}var _0x5e44d9=[{'model':db[_0x5252('0xb9')],'as':'Messages','attributes':['id',_0x5252('0xb6'),_0x5252('0xd5'),'direction',_0x5252('0xd6'),_0x5252('0x7f')],'include':_0x358cf9}];_0x5e44d9[_0x5252('0x33')]({'model':db['WhatsappAccount'],'as':_0x5252('0xd7'),'attributes':['id','name']});_0x5e44d9[_0x5252('0x33')]({'model':db['User'],'as':_0x5252('0xd8'),'attributes':['id',_0x5252('0x2f')]});return db[_0x5252('0x9a')]['find']({'where':{'id':_0x49891a['params']['id']},'include':_0x5e44d9})['then'](handleEntityNotFound(_0xc6e407,null))[_0x5252('0x2b')](function(_0x2eb911){if(_0x2eb911){var _0x5c0fbc=_0x2eb911['get']({'plain':!![]});fs['mkdirSync'](_0x18e2fa);var _0x2befa6={'channel':_0x5252('0xd9'),'account':_0x5c0fbc[_0x5252('0xd7')][_0x5252('0x2c')],'agent':_0x5c0fbc[_0x5252('0xd8')]?_0x5c0fbc['Owner']['fullname']:_0x5252('0xda'),'createdAt':moment(_0x5c0fbc['createdAt'])['format'](_0x5252('0xdb'))['toString'](),'closedAt':_0x5c0fbc[_0x5252('0x39')]?moment(_0x5c0fbc['closedAt'])[_0x5252('0xcf')]('YYYY-MM-DD\x20HH:mm:ss')[_0x5252('0xac')]():'','disposition':_0x5c0fbc[_0x5252('0xdc')],'messages':_(_0x5c0fbc['Messages'])[_0x5252('0x83')]({'secret':![]})[_0x5252('0x2e')](function(_0x5a088b){if(_0x5a088b[_0x5252('0xd4')]){var _0x3694ed=path[_0x5252('0xcd')](_0x386517,_0x5a088b['Attachment'][_0x5252('0xdd')]);if(fs[_0x5252('0xde')](_0x3694ed)){fs[_0x5252('0xdf')](_0x3694ed)[_0x5252('0xe0')](fs[_0x5252('0xe1')](path[_0x5252('0xcd')](_0x18e2fa,_0x5a088b[_0x5252('0xd4')][_0x5252('0xdd')])));}}return{'date':moment(_0x5a088b[_0x5252('0xd5')])[_0x5252('0xcf')](_0x5252('0xdb'))[_0x5252('0xac')](),'sender':_0x5a088b[_0x5252('0xe2')]===_0x5252('0xe3')?_0x5a088b[_0x5252('0xd1')]?_0x5a088b['User']['fullname']:_0x5252('0xe4'):_0x5a088b['Contact'][_0x5252('0xe5')]+(_0x5a088b[_0x5252('0x66')][_0x5252('0xd3')]?'\x20'+_0x5a088b[_0x5252('0x66')][_0x5252('0xd3')]:''),'body':_0x5a088b[_0x5252('0xd4')]?_0x5a088b['Attachment'][_0x5252('0xdd')]:_0x5a088b[_0x5252('0xb6')],'direction':_0x5a088b['direction']===_0x5252('0xe3')?'A':'C','secret':_0x5a088b[_0x5252('0xd6')],'read':_0x5a088b[_0x5252('0x7f')],'attachment':_0x5a088b[_0x5252('0xd4')]};})[_0x5252('0x63')]()};return ejs[_0x5252('0xe6')](path[_0x5252('0xcd')](config[_0x5252('0xca')],'server',_0x5252('0xe7'),_0x5252('0xe8')),{'interaction':_0x2befa6})[_0x5252('0x2b')](function(_0x49f460){var _0x2a5840=path[_0x5252('0xcd')](_0x18e2fa,_0x5252('0xe9')+_0x5c0fbc['id']+'-'+_0xc26f4+'.pdf');var _0xb3dd1a={'path':_0x2a5840,'channel':_0x5252('0xd9'),'interactionId':_0x5c0fbc['id']};return pdf[_0x5252('0xea')](_0x49f460,_0xb3dd1a);})[_0x5252('0x2b')](function(){return new BPromise(function(_0xf06a0a,_0x224516){zipdir(_0x18e2fa,{'saveTo':_0x58e854},function(_0x5a144d,_0x405703){if(_0x5a144d)return _0x224516(_0x5a144d);return _0xf06a0a(_0x405703);});})[_0x5252('0x2b')](function(){return new BPromise(function(_0x459ef0,_0x30b357){rimraf(_0x18e2fa,function(_0x27e7b0){if(_0x27e7b0)_0x30b357(_0x27e7b0);return _0x459ef0();});});})[_0x5252('0x2b')](function(){return _0xc6e407[_0x5252('0xc8')](_0x58e854,_0x208b31,function(_0x21b071){if(_0x21b071){console[_0x5252('0xeb')](_0x5252('0xec'),_0x21b071);}else{fs[_0x5252('0xed')](_0x58e854);}});});});}else{return _0xc6e407[_0x5252('0x1f')](0xc8);}})[_0x5252('0xb0')](handleError(_0xc6e407,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 64903fa..24b5bea 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 _0x9189=['WhatsappMessage','setMaxListeners','update','getUsers','then','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','WhatsappInteraction','../../mysqldb'];(function(_0x9e9ead,_0x1a7ff3){var _0x31ff57=function(_0x22a9da){while(--_0x22a9da){_0x9e9ead['push'](_0x9e9ead['shift']());}};_0x31ff57(++_0x1a7ff3);}(_0x9189,0x1b0));var _0x9918=function(_0x284afd,_0x4894b6){_0x284afd=_0x284afd-0x0;var _0x2b9f59=_0x9189[_0x284afd];return _0x2b9f59;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require('../../mysqldb')['db'][_0x9918('0x0')];var WhatsappMessage=require(_0x9918('0x1'))['db'][_0x9918('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x9918('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9918('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4cb5a2){return function(_0xfd91d2,_0x325957,_0x4a47d4){_0xfd91d2[_0x9918('0x5')]({'attributes':['id'],'raw':!![]})[_0x9918('0x6')](function(_0x7b8770){_0xfd91d2['setDataValue']('Users',_0x7b8770['map'](function(_0x46bef9){return{'id':_0x46bef9['id']};}));return WhatsappMessage[_0x9918('0x7')]({'where':{'WhatsappInteractionId':_0xfd91d2['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x21f0ff){_0xfd91d2['setDataValue'](_0x9918('0x8'),_0x21f0ff[_0x9918('0x9')]);WhatsappInteractionEvents[_0x9918('0xa')](_0x4cb5a2+':'+_0xfd91d2['id'],_0xfd91d2);WhatsappInteractionEvents[_0x9918('0xa')](_0x4cb5a2,_0xfd91d2);_0x4a47d4(null);})[_0x9918('0xb')](_0x4a47d4(null));};}for(var e in events){if(events[_0x9918('0xc')](e)){var event=events[e];WhatsappInteraction[_0x9918('0xd')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file +var _0x6ea9=['catch','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappInteraction','WhatsappMessage','save','update','remove','then','setDataValue','Users','map','findAll','unreadMessages','length','emit'];(function(_0xe2a9b7,_0xd69f5e){var _0x1e49da=function(_0xe9aafa){while(--_0xe9aafa){_0xe2a9b7['push'](_0xe2a9b7['shift']());}};_0x1e49da(++_0xd69f5e);}(_0x6ea9,0x89));var _0x96ea=function(_0x12151d,_0x5471cb){_0x12151d=_0x12151d-0x0;var _0x4fb3f8=_0x6ea9[_0x12151d];return _0x4fb3f8;};'use strict';var EventEmitter=require(_0x96ea('0x0'));var WhatsappInteraction=require(_0x96ea('0x1'))['db'][_0x96ea('0x2')];var WhatsappMessage=require(_0x96ea('0x1'))['db'][_0x96ea('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x96ea('0x4'),'afterUpdate':_0x96ea('0x5'),'afterDestroy':_0x96ea('0x6')};function emitEvent(_0x4de4d5){return function(_0xd6de64,_0x58e57e,_0x32cf31){_0xd6de64['getUsers']({'attributes':['id'],'raw':!![]})[_0x96ea('0x7')](function(_0x5da08c){_0xd6de64[_0x96ea('0x8')](_0x96ea('0x9'),_0x5da08c[_0x96ea('0xa')](function(_0x35e378){return{'id':_0x35e378['id']};}));return WhatsappMessage[_0x96ea('0xb')]({'where':{'WhatsappInteractionId':_0xd6de64['id'],'direction':'in','read':![]},'raw':!![]});})[_0x96ea('0x7')](function(_0x542e92){_0xd6de64[_0x96ea('0x8')](_0x96ea('0xc'),_0x542e92[_0x96ea('0xd')]);WhatsappInteractionEvents[_0x96ea('0xe')](_0x4de4d5+':'+_0xd6de64['id'],_0xd6de64);WhatsappInteractionEvents[_0x96ea('0xe')](_0x4de4d5,_0xd6de64);_0x32cf31(null);})[_0x96ea('0xf')](_0x32cf31(null));};}for(var e in events){if(events[_0x96ea('0x10')](e)){var event=events[e];WhatsappInteraction[_0x96ea('0x11')](e,emitEvent(event));}}module[_0x96ea('0x12')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index cbc899a..ef243a7 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 _0x35b5=['./whatsappInteraction.attributes','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x35b5,0x1d8));var _0x535b=function(_0x496cb6,_0x19c232){_0x496cb6=_0x496cb6-0x0;var _0x45b2e9=_0x35b5[_0x496cb6];return _0x45b2e9;};'use strict';var _=require(_0x535b('0x0'));var util=require('util');var logger=require(_0x535b('0x1'))(_0x535b('0x2'));var moment=require(_0x535b('0x3'));var BPromise=require(_0x535b('0x4'));var rp=require(_0x535b('0x5'));var fs=require('fs');var path=require(_0x535b('0x6'));var rimraf=require(_0x535b('0x7'));var config=require('../../config/environment');var attributes=require(_0x535b('0x8'));module['exports']=function(_0xe77db3,_0x51ce58){return _0xe77db3['define'](_0x535b('0x9'),attributes,{'tableName':_0x535b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2a2807,_0x1226a8,_0x250dd5){if(_0x2a2807[_0x535b('0xb')](_0x535b('0xc'))){_0x2a2807[_0x535b('0xd')]=moment()[_0x535b('0xe')](_0x535b('0xf'));}_0x250dd5(null,_0x2a2807);}}});}; \ No newline at end of file +var _0x7a12=['request-promise','path','../../config/environment','./whatsappInteraction.attributes','exports','define','whatsapp_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4a6cba,_0x5ddd98){var _0x21c849=function(_0x2ce56f){while(--_0x2ce56f){_0x4a6cba['push'](_0x4a6cba['shift']());}};_0x21c849(++_0x5ddd98);}(_0x7a12,0xe8));var _0x27a1=function(_0x1d464,_0x5f22ae){_0x1d464=_0x1d464-0x0;var _0x25cbee=_0x7a12[_0x1d464];return _0x25cbee;};'use strict';var _=require(_0x27a1('0x0'));var util=require(_0x27a1('0x1'));var logger=require(_0x27a1('0x2'))(_0x27a1('0x3'));var moment=require(_0x27a1('0x4'));var BPromise=require(_0x27a1('0x5'));var rp=require(_0x27a1('0x6'));var fs=require('fs');var path=require(_0x27a1('0x7'));var rimraf=require('rimraf');var config=require(_0x27a1('0x8'));var attributes=require(_0x27a1('0x9'));module[_0x27a1('0xa')]=function(_0x389116,_0x2ccadb){return _0x389116[_0x27a1('0xb')]('WhatsappInteraction',attributes,{'tableName':_0x27a1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x34efbb,_0x5431f4,_0x6872f5){if(_0x34efbb[_0x27a1('0xd')]('closed')){_0x34efbb[_0x27a1('0xe')]=moment()[_0x27a1('0xf')](_0x27a1('0x10'));}_0x6872f5(null,_0x34efbb);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 15d10e5..512a834 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 _0x9e41=['find','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','WhatsappInteraction,\x20%s,\x20%s','catch','UpdateWhatsappInteraction','update','body','options','raw','where','limit','info','WhatsappInteraction'];(function(_0x43e7a5,_0x295f53){var _0x4b9e52=function(_0x2a295d){while(--_0x2a295d){_0x43e7a5['push'](_0x43e7a5['shift']());}};_0x4b9e52(++_0x295f53);}(_0x9e41,0x188));var _0x19e4=function(_0x104c4c,_0x1e969e){_0x104c4c=_0x104c4c-0x0;var _0x291bf1=_0x9e41[_0x104c4c];return _0x291bf1;};'use strict';var _=require(_0x19e4('0x0'));var util=require(_0x19e4('0x1'));var moment=require(_0x19e4('0x2'));var BPromise=require(_0x19e4('0x3'));var rs=require(_0x19e4('0x4'));var fs=require('fs');var Redis=require(_0x19e4('0x5'));var db=require(_0x19e4('0x6'))['db'];var utils=require(_0x19e4('0x7'));var logger=require('../../config/logger')(_0x19e4('0x8'));var config=require(_0x19e4('0x9'));var jayson=require(_0x19e4('0xa'));var client=jayson['client'][_0x19e4('0xb')]({'port':0x232a});config[_0x19e4('0xc')]=_[_0x19e4('0xd')](config[_0x19e4('0xc')],{'host':_0x19e4('0xe'),'port':0x18eb});var socket=require(_0x19e4('0xf'))(new Redis(config[_0x19e4('0xc')]));require(_0x19e4('0x10'))[_0x19e4('0x11')](socket);function respondWithRpcPromise(_0x48d265,_0x405a7c,_0x4f4d5f){return new BPromise(function(_0x140baf,_0x6dc2d0){return client[_0x19e4('0x12')](_0x48d265,_0x4f4d5f)[_0x19e4('0x13')](function(_0x35b721){logger['info']('WhatsappInteraction,\x20%s,\x20%s',_0x405a7c,_0x19e4('0x14'));logger[_0x19e4('0x15')](_0x19e4('0x16'),_0x405a7c,'request\x20sent',JSON[_0x19e4('0x17')](_0x35b721));if(_0x35b721[_0x19e4('0x18')]){if(_0x35b721['error'][_0x19e4('0x19')]===0x1f4){logger[_0x19e4('0x18')]('WhatsappInteraction,\x20%s,\x20%s',_0x405a7c,_0x35b721[_0x19e4('0x18')][_0x19e4('0x1a')]);return _0x6dc2d0(_0x35b721[_0x19e4('0x18')][_0x19e4('0x1a')]);}logger[_0x19e4('0x18')](_0x19e4('0x1b'),_0x405a7c,_0x35b721[_0x19e4('0x18')][_0x19e4('0x1a')]);return _0x140baf(_0x35b721[_0x19e4('0x18')][_0x19e4('0x1a')]);}else{logger['info'](_0x19e4('0x1b'),_0x405a7c,_0x19e4('0x14'));_0x140baf(_0x35b721['result']['message']);}})[_0x19e4('0x1c')](function(_0x374982){logger['error'](_0x19e4('0x1b'),_0x405a7c,_0x374982);_0x6dc2d0(_0x374982);});});}exports[_0x19e4('0x1d')]=function(_0xdccb4f){var _0x8430f5=this;return new Promise(function(_0xf7daa6,_0x47a003){return db['WhatsappInteraction'][_0x19e4('0x1e')](_0xdccb4f[_0x19e4('0x1f')],{'raw':_0xdccb4f[_0x19e4('0x20')]?_0xdccb4f[_0x19e4('0x20')][_0x19e4('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xdccb4f[_0x19e4('0x20')]?_0xdccb4f['options'][_0x19e4('0x22')]||null:null,'attributes':_0xdccb4f[_0x19e4('0x20')]?_0xdccb4f[_0x19e4('0x20')]['attributes']||null:null,'limit':_0xdccb4f[_0x19e4('0x20')]?_0xdccb4f[_0x19e4('0x20')][_0x19e4('0x23')]||null:null})[_0x19e4('0x13')](function(_0x29d63b){logger[_0x19e4('0x24')](_0x19e4('0x1d'),_0xdccb4f);logger[_0x19e4('0x15')]('UpdateWhatsappInteraction',_0xdccb4f,JSON[_0x19e4('0x17')](_0x29d63b));_0xf7daa6(_0x29d63b);})[_0x19e4('0x1c')](function(_0x1c7fb6){logger[_0x19e4('0x18')](_0x19e4('0x1d'),_0x1c7fb6[_0x19e4('0x1a')],_0xdccb4f);_0x47a003(_0x8430f5['error'](0x1f4,_0x1c7fb6[_0x19e4('0x1a')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x259cb5){return new Promise(function(_0x426f77,_0x37c774){return db[_0x19e4('0x25')][_0x19e4('0x26')]({'where':_0x259cb5[_0x19e4('0x20')]?_0x259cb5[_0x19e4('0x20')][_0x19e4('0x22')]||null:null})[_0x19e4('0x13')](function(_0x337141){if(_0x337141){return _0x337141[_0x19e4('0x27')](_0x259cb5['body'][_0x19e4('0x28')],_['omit'](_0x259cb5[_0x19e4('0x1f')],['ids','id'])||{});}})[_0x19e4('0x29')](function(_0x2a226e){logger[_0x19e4('0x24')](_0x19e4('0x2a'),_0x259cb5);logger[_0x19e4('0x15')](_0x19e4('0x2a'),_0x259cb5,JSON[_0x19e4('0x17')](_0x2a226e));_0x426f77(_0x2a226e);})[_0x19e4('0x1c')](function(_0x367927){logger[_0x19e4('0x18')](_0x19e4('0x2a'),_0x367927[_0x19e4('0x1a')],_0x259cb5);_0x37c774(_this[_0x19e4('0x18')](0x1f4,_0x367927['message']));});});}; \ No newline at end of file +var _0xa41d=['client','http','defaults','redis','localhost','socket.io-emitter','register','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','update','body','options','raw','where','attributes','then','UpdateWhatsappInteraction','AddTagsToWhatsappInteraction','WhatsappInteraction','find','addTags','ids','omit','spread','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa41d,0x1bb));var _0xda41=function(_0x517df1,_0x14af41){_0x517df1=_0x517df1-0x0;var _0x3040d6=_0xa41d[_0x517df1];return _0x3040d6;};'use strict';var _=require(_0xda41('0x0'));var util=require(_0xda41('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xda41('0x2'));var fs=require('fs');var Redis=require(_0xda41('0x3'));var db=require(_0xda41('0x4'))['db'];var utils=require(_0xda41('0x5'));var logger=require(_0xda41('0x6'))(_0xda41('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xda41('0x8')][_0xda41('0x9')]({'port':0x232a});config['redis']=_[_0xda41('0xa')](config[_0xda41('0xb')],{'host':_0xda41('0xc'),'port':0x18eb});var socket=require(_0xda41('0xd'))(new Redis(config[_0xda41('0xb')]));require('./whatsappInteraction.socket')[_0xda41('0xe')](socket);function respondWithRpcPromise(_0x42c7b8,_0x184746,_0x2528d3){return new BPromise(function(_0x1eda0c,_0xc98c38){return client['request'](_0x42c7b8,_0x2528d3)['then'](function(_0x573dbe){logger['info'](_0xda41('0xf'),_0x184746,_0xda41('0x10'));logger[_0xda41('0x11')](_0xda41('0x12'),_0x184746,_0xda41('0x10'),JSON[_0xda41('0x13')](_0x573dbe));if(_0x573dbe['error']){if(_0x573dbe[_0xda41('0x14')][_0xda41('0x15')]===0x1f4){logger[_0xda41('0x14')](_0xda41('0xf'),_0x184746,_0x573dbe['error'][_0xda41('0x16')]);return _0xc98c38(_0x573dbe['error']['message']);}logger[_0xda41('0x14')](_0xda41('0xf'),_0x184746,_0x573dbe[_0xda41('0x14')][_0xda41('0x16')]);return _0x1eda0c(_0x573dbe['error'][_0xda41('0x16')]);}else{logger[_0xda41('0x17')](_0xda41('0xf'),_0x184746,_0xda41('0x10'));_0x1eda0c(_0x573dbe[_0xda41('0x18')]['message']);}})[_0xda41('0x19')](function(_0x1fb5e8){logger[_0xda41('0x14')](_0xda41('0xf'),_0x184746,_0x1fb5e8);_0xc98c38(_0x1fb5e8);});});}exports['UpdateWhatsappInteraction']=function(_0x3401e5){var _0x4b257e=this;return new Promise(function(_0x324a3e,_0x4b431a){return db['WhatsappInteraction'][_0xda41('0x1a')](_0x3401e5[_0xda41('0x1b')],{'raw':_0x3401e5[_0xda41('0x1c')]?_0x3401e5['options'][_0xda41('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3401e5[_0xda41('0x1c')]?_0x3401e5[_0xda41('0x1c')][_0xda41('0x1e')]||null:null,'attributes':_0x3401e5[_0xda41('0x1c')]?_0x3401e5['options'][_0xda41('0x1f')]||null:null,'limit':_0x3401e5[_0xda41('0x1c')]?_0x3401e5[_0xda41('0x1c')]['limit']||null:null})[_0xda41('0x20')](function(_0x10ca29){logger['info'](_0xda41('0x21'),_0x3401e5);logger[_0xda41('0x11')](_0xda41('0x21'),_0x3401e5,JSON['stringify'](_0x10ca29));_0x324a3e(_0x10ca29);})['catch'](function(_0x57c4cb){logger[_0xda41('0x14')](_0xda41('0x21'),_0x57c4cb[_0xda41('0x16')],_0x3401e5);_0x4b431a(_0x4b257e[_0xda41('0x14')](0x1f4,_0x57c4cb['message']));});});};exports[_0xda41('0x22')]=function(_0x1d0d79){return new Promise(function(_0x37ccd6,_0xd809f){return db[_0xda41('0x23')][_0xda41('0x24')]({'where':_0x1d0d79[_0xda41('0x1c')]?_0x1d0d79['options']['where']||null:null})['then'](function(_0x45d4c7){if(_0x45d4c7){return _0x45d4c7[_0xda41('0x25')](_0x1d0d79[_0xda41('0x1b')][_0xda41('0x26')],_[_0xda41('0x27')](_0x1d0d79[_0xda41('0x1b')],[_0xda41('0x26'),'id'])||{});}})[_0xda41('0x28')](function(_0x2e3a29){logger[_0xda41('0x17')]('AddTags',_0x1d0d79);logger[_0xda41('0x11')]('AddTags',_0x1d0d79,JSON[_0xda41('0x13')](_0x2e3a29));_0x37ccd6(_0x2e3a29);})[_0xda41('0x19')](function(_0x15421f){logger[_0xda41('0x14')]('AddTags',_0x15421f[_0xda41('0x16')],_0x1d0d79);_0xd809f(_this[_0xda41('0x14')](0x1f4,_0x15421f['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 9c0edcc..0000cd5 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 _0x2de4=['removeListener','register','length','whatsappInteraction:','./whatsappInteraction.events'];(function(_0xdc02e6,_0x16a00a){var _0x27ff2e=function(_0x1b7106){while(--_0x1b7106){_0xdc02e6['push'](_0xdc02e6['shift']());}};_0x27ff2e(++_0x16a00a);}(_0x2de4,0x1bc));var _0x42de=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2de4[_0x321bb2];return _0x9c12ed;};'use strict';var WhatsappInteractionEvents=require(_0x42de('0x0'));var events=['save','remove','update'];function createListener(_0x56523b,_0x133eef){return function(_0x542d67){_0x133eef['emit'](_0x56523b,_0x542d67);};}function removeListener(_0x1c7c76,_0x3a3c6f){return function(){WhatsappInteractionEvents[_0x42de('0x1')](_0x1c7c76,_0x3a3c6f);};}exports[_0x42de('0x2')]=function(_0x22b091){for(var _0x43fae1=0x0,_0x23a3b4=events[_0x42de('0x3')];_0x43fae1<_0x23a3b4;_0x43fae1++){var _0x315779=events[_0x43fae1];var _0x36e8b8=createListener(_0x42de('0x4')+_0x315779,_0x22b091);WhatsappInteractionEvents['on'](_0x315779,_0x36e8b8);}}; \ No newline at end of file +var _0x6dad=['whatsappInteraction:','remove','update','emit','removeListener','register','length'];(function(_0xf34b0a,_0x11e116){var _0x5021e1=function(_0x4eff67){while(--_0x4eff67){_0xf34b0a['push'](_0xf34b0a['shift']());}};_0x5021e1(++_0x11e116);}(_0x6dad,0xa2));var _0xd6da=function(_0x1d5dc4,_0x11ae65){_0x1d5dc4=_0x1d5dc4-0x0;var _0x54ba2a=_0x6dad[_0x1d5dc4];return _0x54ba2a;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=['save',_0xd6da('0x0'),_0xd6da('0x1')];function createListener(_0x440502,_0xa7a1a2){return function(_0x40da31){_0xa7a1a2[_0xd6da('0x2')](_0x440502,_0x40da31);};}function removeListener(_0x19e218,_0x570fbb){return function(){WhatsappInteractionEvents[_0xd6da('0x3')](_0x19e218,_0x570fbb);};}exports[_0xd6da('0x4')]=function(_0x3b7f3d){for(var _0x16e86f=0x0,_0x4ca325=events[_0xd6da('0x5')];_0x16e86f<_0x4ca325;_0x16e86f++){var _0x196f9d=events[_0x16e86f];var _0x108121=createListener(_0xd6da('0x6')+_0x196f9d,_0x3b7f3d);WhatsappInteractionEvents['on'](_0x196f9d,_0x108121);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 60fea47..76fdab2 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 _0xac73=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappMessage.controller','get','isAuthenticated','/describe','/:id','post','whatsapp','whatsappmessage:create','create','status','put','update','/:id/accept','accept','reject','destroy','exports','util','path','connect-timeout','express'];(function(_0xe2f9b8,_0x5b996b){var _0x42767a=function(_0x2a706f){while(--_0x2a706f){_0xe2f9b8['push'](_0xe2f9b8['shift']());}};_0x42767a(++_0x5b996b);}(_0xac73,0x128));var _0x3ac7=function(_0xc0e8d9,_0x305e75){_0xc0e8d9=_0xc0e8d9-0x0;var _0x11164a=_0xac73[_0xc0e8d9];return _0x11164a;};'use strict';var multer=require('multer');var util=require(_0x3ac7('0x0'));var path=require(_0x3ac7('0x1'));var timeout=require(_0x3ac7('0x2'));var express=require(_0x3ac7('0x3'));var router=express[_0x3ac7('0x4')]();var fs_extra=require(_0x3ac7('0x5'));var auth=require(_0x3ac7('0x6'));var interaction=require(_0x3ac7('0x7'));var config=require('../../config/environment');var controller=require(_0x3ac7('0x8'));router[_0x3ac7('0x9')]('/',auth[_0x3ac7('0xa')](),controller['index']);router[_0x3ac7('0x9')](_0x3ac7('0xb'),auth[_0x3ac7('0xa')](),controller['describe']);router[_0x3ac7('0x9')](_0x3ac7('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x3ac7('0xd')]('/',auth[_0x3ac7('0xa')](),interaction['tracked'](_0x3ac7('0xe'),_0x3ac7('0xf')),controller[_0x3ac7('0x10')]);router[_0x3ac7('0xd')]('/:id/status',controller[_0x3ac7('0x11')]);router[_0x3ac7('0x12')](_0x3ac7('0xc'),auth['isAuthenticated'](),controller[_0x3ac7('0x13')]);router[_0x3ac7('0x12')](_0x3ac7('0x14'),auth[_0x3ac7('0xa')](),controller[_0x3ac7('0x15')]);router[_0x3ac7('0x12')]('/:id/reject',auth['isAuthenticated'](),controller[_0x3ac7('0x16')]);router['delete'](_0x3ac7('0xc'),auth[_0x3ac7('0xa')](),controller[_0x3ac7('0x17')]);module[_0x3ac7('0x18')]=router; \ No newline at end of file +var _0x58f0=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','/describe','isAuthenticated','describe','show','whatsapp','create','/:id/status','status','put','update','accept','/:id/reject','reject','/:id','destroy'];(function(_0x55bce1,_0x6cecac){var _0x371921=function(_0x4bdec0){while(--_0x4bdec0){_0x55bce1['push'](_0x55bce1['shift']());}};_0x371921(++_0x6cecac);}(_0x58f0,0x11e));var _0x058f=function(_0x5698e3,_0x19bbd2){_0x5698e3=_0x5698e3-0x0;var _0x1c3ba6=_0x58f0[_0x5698e3];return _0x1c3ba6;};'use strict';var multer=require(_0x058f('0x0'));var util=require(_0x058f('0x1'));var path=require(_0x058f('0x2'));var timeout=require(_0x058f('0x3'));var express=require(_0x058f('0x4'));var router=express[_0x058f('0x5')]();var fs_extra=require(_0x058f('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x058f('0x7'));var config=require(_0x058f('0x8'));var controller=require(_0x058f('0x9'));router[_0x058f('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x058f('0xa')](_0x058f('0xb'),auth[_0x058f('0xc')](),controller[_0x058f('0xd')]);router[_0x058f('0xa')]('/:id',auth[_0x058f('0xc')](),controller[_0x058f('0xe')]);router['post']('/',auth[_0x058f('0xc')](),interaction['tracked'](_0x058f('0xf'),'whatsappmessage:create'),controller[_0x058f('0x10')]);router['post'](_0x058f('0x11'),controller[_0x058f('0x12')]);router[_0x058f('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x058f('0x14')]);router[_0x058f('0x13')]('/:id/accept',auth[_0x058f('0xc')](),controller[_0x058f('0x15')]);router[_0x058f('0x13')](_0x058f('0x16'),auth['isAuthenticated'](),controller[_0x058f('0x17')]);router['delete'](_0x058f('0x18'),auth[_0x058f('0xc')](),controller[_0x058f('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index bafcc0b..6f46a53 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 _0x99a3=['out','STRING','BOOLEAN','sequelize','exports','TEXT','medium','ENUM'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x99a3,0x14b));var _0x399a=function(_0x391316,_0x2a747d){_0x391316=_0x391316-0x0;var _0x9634d2=_0x99a3[_0x391316];return _0x9634d2;};'use strict';var Sequelize=require(_0x399a('0x0'));module[_0x399a('0x1')]={'body':{'type':Sequelize[_0x399a('0x2')](_0x399a('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x399a('0x4')]('in',_0x399a('0x5')),'defaultValue':_0x399a('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x399a('0x6')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x399a('0x7')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x399a('0x6')]},'providerResponse':{'type':Sequelize[_0x399a('0x2')]}}; \ No newline at end of file +var _0x19b9=['STRING','DATE','sequelize','exports','TEXT','BOOLEAN','ENUM','out'];(function(_0x2180e2,_0x2ecf3f){var _0x2e7057=function(_0x2562ca){while(--_0x2562ca){_0x2180e2['push'](_0x2180e2['shift']());}};_0x2e7057(++_0x2ecf3f);}(_0x19b9,0xea));var _0x919b=function(_0x2404d4,_0x2e3be9){_0x2404d4=_0x2404d4-0x0;var _0x2ffef3=_0x19b9[_0x2404d4];return _0x2ffef3;};'use strict';var Sequelize=require(_0x919b('0x0'));module[_0x919b('0x1')]={'body':{'type':Sequelize[_0x919b('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x919b('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x919b('0x4')]('in',_0x919b('0x5')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x919b('0x6')](0xbe)},'phone':{'type':Sequelize[_0x919b('0x6')]},'readAt':{'type':Sequelize[_0x919b('0x7')]},'secret':{'type':Sequelize[_0x919b('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x919b('0x6')]},'providerResponse':{'type':Sequelize[_0x919b('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 17a41f7..4554f05 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 _0xda7d=['fields','find','create','body','params','describe','whatsapp-interactions','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteractionId','isNil','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','reject','whatsapp','WhatsappInteraction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','internal','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','ejs','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','../../mysqldb','redis','socket.io-emitter','register','jayson/promise','client','http','request','info','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','WhatsappMessage','rawAttributes','type','model','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','keys'];(function(_0x48c100,_0x566f57){var _0x34dc16=function(_0x3133a7){while(--_0x3133a7){_0x48c100['push'](_0x48c100['shift']());}};_0x34dc16(++_0x566f57);}(_0xda7d,0xce));var _0xdda7=function(_0x30aa4d,_0x2b360f){_0x30aa4d=_0x30aa4d-0x0;var _0x16fc87=_0xda7d[_0x30aa4d];return _0x16fc87;};'use strict';var emlformat=require(_0xdda7('0x0'));var rimraf=require(_0xdda7('0x1'));var zipdir=require(_0xdda7('0x2'));var jsonpatch=require(_0xdda7('0x3'));var rp=require(_0xdda7('0x4'));var moment=require('moment');var BPromise=require(_0xdda7('0x5'));var Mustache=require(_0xdda7('0x6'));var util=require(_0xdda7('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xdda7('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdda7('0x9'));var squel=require(_0xdda7('0xa'));var crypto=require(_0xdda7('0xb'));var jsforce=require(_0xdda7('0xc'));var deskjs=require(_0xdda7('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdda7('0xe'));var Redis=require(_0xdda7('0xf'));var authService=require(_0xdda7('0x10'));var qs=require(_0xdda7('0x11'));var as=require(_0xdda7('0x12'));var hardwareService=require(_0xdda7('0x13'));var logger=require(_0xdda7('0x14'))(_0xdda7('0x15'));var utils=require(_0xdda7('0x16'));var config=require(_0xdda7('0x17'));var licenseUtil=require(_0xdda7('0x18'));var db=require(_0xdda7('0x19'))['db'];config['redis']=_['defaults'](config[_0xdda7('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xdda7('0x1b'))(new Redis(config['redis']));require('./whatsappMessage.socket')[_0xdda7('0x1c')](socket);var jayson=require(_0xdda7('0x1d'));var client=jayson[_0xdda7('0x1e')][_0xdda7('0x1f')]({'port':0x232c});var client9002=jayson[_0xdda7('0x1e')][_0xdda7('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x4ed9cf,_0x38a1a6,_0x4c6794,_0x435907){return new BPromise(function(_0x2f85bb,_0x25b433){var _0x2bbc5c=_0x435907||client;return _0x2bbc5c[_0xdda7('0x20')](_0x4ed9cf,_0x4c6794)['then'](function(_0xab2e30){logger[_0xdda7('0x21')]('WhatsappMessage,\x20%s,\x20%s',_0x38a1a6,_0xdda7('0x22'));logger[_0xdda7('0x23')](_0xdda7('0x24'),_0x38a1a6,_0xdda7('0x22'),JSON[_0xdda7('0x25')](_0xab2e30));if(_0xab2e30[_0xdda7('0x26')]){if(_0xab2e30[_0xdda7('0x26')][_0xdda7('0x27')]===0x1f4){logger[_0xdda7('0x26')](_0xdda7('0x28'),_0x38a1a6,_0xab2e30[_0xdda7('0x26')][_0xdda7('0x29')]);return _0x25b433(_0xab2e30['error'][_0xdda7('0x29')]);}logger[_0xdda7('0x26')](_0xdda7('0x28'),_0x38a1a6,_0xab2e30['error'][_0xdda7('0x29')]);return _0x2f85bb(_0xab2e30[_0xdda7('0x26')]['message']);}else{logger[_0xdda7('0x21')](_0xdda7('0x28'),_0x38a1a6,_0xdda7('0x22'));_0x2f85bb(_0xab2e30[_0xdda7('0x2a')][_0xdda7('0x29')]);}})[_0xdda7('0x2b')](function(_0x3743ba){logger[_0xdda7('0x26')](_0xdda7('0x28'),_0x38a1a6,_0x3743ba);_0x25b433(_0x3743ba);});});}function respondWithStatusCode(_0x303bf9,_0x5b0e3e){_0x5b0e3e=_0x5b0e3e||0xcc;return function(_0x3f5303){if(_0x3f5303){return _0x303bf9[_0xdda7('0x2c')](_0x5b0e3e);}return _0x303bf9[_0xdda7('0x2d')](_0x5b0e3e)[_0xdda7('0x2e')]();};}function respondWithResult(_0x3ea57b,_0x72610){_0x72610=_0x72610||0xc8;return function(_0x446ae8){if(_0x446ae8){return _0x3ea57b[_0xdda7('0x2d')](_0x72610)[_0xdda7('0x2f')](_0x446ae8);}};}function respondWithFilteredResult(_0x1df8ed,_0x5aeefd){return function(_0x1cff17){if(_0x1cff17){var _0x1e6969=typeof _0x5aeefd[_0xdda7('0x30')]===_0xdda7('0x31')&&typeof _0x5aeefd[_0xdda7('0x32')]===_0xdda7('0x31');var _0x2ccd63=_0x1cff17[_0xdda7('0x33')];var _0x585609=_0x1e6969?0x0:_0x5aeefd['offset'];var _0x3fdca3=_0x1e6969?_0x1cff17[_0xdda7('0x33')]:_0x5aeefd[_0xdda7('0x30')]+_0x5aeefd[_0xdda7('0x32')];var _0x3c813e;if(_0x3fdca3>=_0x2ccd63){_0x3fdca3=_0x2ccd63;_0x3c813e=0xc8;}else{_0x3c813e=0xce;}_0x1df8ed['status'](_0x3c813e);return _0x1df8ed[_0xdda7('0x34')](_0xdda7('0x35'),_0x585609+'-'+_0x3fdca3+'/'+_0x2ccd63)[_0xdda7('0x2f')](_0x1cff17);}return null;};}function patchUpdates(_0x2d8767){return function(_0x2025af){try{jsonpatch[_0xdda7('0x36')](_0x2025af,_0x2d8767,!![]);}catch(_0x52837a){return BPromise['reject'](_0x52837a);}return _0x2025af[_0xdda7('0x37')]();};}function saveUpdates(_0x2f21e0,_0x42bdcd){return function(_0x1d2606){if(_0x1d2606){return _0x1d2606[_0xdda7('0x38')](_0x2f21e0)[_0xdda7('0x39')](function(_0x290da4){return _0x290da4;});}return null;};}function removeEntity(_0xf8a14a,_0x5e94bf){return function(_0x5908c3){if(_0x5908c3){return _0x5908c3[_0xdda7('0x3a')]()[_0xdda7('0x39')](function(){_0xf8a14a[_0xdda7('0x2d')](0xcc)[_0xdda7('0x2e')]();});}};}function handleEntityNotFound(_0x49437e,_0x772ffe){return function(_0x385d82){if(!_0x385d82){_0x49437e[_0xdda7('0x2c')](0x194);}return _0x385d82;};}function handleError(_0xae41bd,_0x10b3d6){_0x10b3d6=_0x10b3d6||0x1f4;return function(_0x2bfe1e){logger['error'](_0x2bfe1e[_0xdda7('0x3b')]);if(_0x2bfe1e[_0xdda7('0x3c')]){delete _0x2bfe1e[_0xdda7('0x3c')];}_0xae41bd['status'](_0x10b3d6)[_0xdda7('0x3d')](_0x2bfe1e);};}exports[_0xdda7('0x3e')]=function(_0x5eba7c,_0x166348){var _0x340b37={},_0x44cdfe={},_0x5f4631={'count':0x0,'rows':[]};var _0x45a56=_[_0xdda7('0x3f')](db[_0xdda7('0x40')][_0xdda7('0x41')],function(_0x28f934){return{'name':_0x28f934['fieldName'],'type':_0x28f934[_0xdda7('0x42')]['key']};});_0x44cdfe[_0xdda7('0x43')]=_[_0xdda7('0x3f')](_0x45a56,'name');_0x44cdfe['query']=_['keys'](_0x5eba7c[_0xdda7('0x44')]);_0x44cdfe[_0xdda7('0x45')]=_[_0xdda7('0x46')](_0x44cdfe['model'],_0x44cdfe['query']);_0x340b37[_0xdda7('0x47')]=_[_0xdda7('0x46')](_0x44cdfe[_0xdda7('0x43')],qs['fields'](_0x5eba7c['query']['fields']));_0x340b37[_0xdda7('0x47')]=_0x340b37['attributes'][_0xdda7('0x48')]?_0x340b37[_0xdda7('0x47')]:_0x44cdfe[_0xdda7('0x43')];if(!_0x5eba7c[_0xdda7('0x44')][_0xdda7('0x49')]('nolimit')){_0x340b37['limit']=qs[_0xdda7('0x32')](_0x5eba7c[_0xdda7('0x44')]['limit']);_0x340b37['offset']=qs[_0xdda7('0x30')](_0x5eba7c['query'][_0xdda7('0x30')]);}_0x340b37[_0xdda7('0x4a')]=qs['sort'](_0x5eba7c[_0xdda7('0x44')][_0xdda7('0x4b')]);_0x340b37['where']=qs['filters'](_[_0xdda7('0x4c')](_0x5eba7c[_0xdda7('0x44')],_0x44cdfe[_0xdda7('0x45')]),_0x45a56);if(_0x5eba7c[_0xdda7('0x44')][_0xdda7('0x4d')]){_0x340b37[_0xdda7('0x4e')]=_[_0xdda7('0x4f')](_0x340b37['where'],{'$or':_[_0xdda7('0x3f')](_0x45a56,function(_0x46e8b6){if(_0x46e8b6[_0xdda7('0x42')]!==_0xdda7('0x50')){var _0xeec2db={};_0xeec2db[_0x46e8b6[_0xdda7('0x3c')]]={'$like':'%'+_0x5eba7c[_0xdda7('0x44')][_0xdda7('0x4d')]+'%'};return _0xeec2db;}})});}_0x340b37=_[_0xdda7('0x4f')]({},_0x340b37,_0x5eba7c[_0xdda7('0x51')]);var _0x571e37={'where':_0x340b37[_0xdda7('0x4e')]};return db['WhatsappMessage'][_0xdda7('0x33')](_0x571e37)[_0xdda7('0x39')](function(_0x2962b6){_0x5f4631[_0xdda7('0x33')]=_0x2962b6;if(_0x5eba7c[_0xdda7('0x44')][_0xdda7('0x52')]){_0x340b37[_0xdda7('0x53')]=[{'all':!![]}];}return db[_0xdda7('0x40')][_0xdda7('0x54')](_0x340b37);})[_0xdda7('0x39')](function(_0x54bc88){_0x5f4631[_0xdda7('0x55')]=_0x54bc88;return _0x5f4631;})[_0xdda7('0x39')](respondWithFilteredResult(_0x166348,_0x340b37))[_0xdda7('0x2b')](handleError(_0x166348,null));};exports[_0xdda7('0x56')]=function(_0x159359,_0x302548){var _0x25793b={'raw':!![],'where':{'id':_0x159359['params']['id']}},_0x536373={};_0x536373[_0xdda7('0x43')]=_[_0xdda7('0x57')](db[_0xdda7('0x40')]['rawAttributes']);_0x536373[_0xdda7('0x44')]=_[_0xdda7('0x57')](_0x159359[_0xdda7('0x44')]);_0x536373[_0xdda7('0x45')]=_['intersection'](_0x536373['model'],_0x536373[_0xdda7('0x44')]);_0x25793b['attributes']=_['intersection'](_0x536373[_0xdda7('0x43')],qs[_0xdda7('0x58')](_0x159359[_0xdda7('0x44')][_0xdda7('0x58')]));_0x25793b[_0xdda7('0x47')]=_0x25793b[_0xdda7('0x47')][_0xdda7('0x48')]?_0x25793b[_0xdda7('0x47')]:_0x536373[_0xdda7('0x43')];if(_0x159359['query']['includeAll']){_0x25793b[_0xdda7('0x53')]=[{'all':!![]}];}_0x25793b=_[_0xdda7('0x4f')]({},_0x25793b,_0x159359[_0xdda7('0x51')]);return db[_0xdda7('0x40')][_0xdda7('0x59')](_0x25793b)[_0xdda7('0x39')](handleEntityNotFound(_0x302548,null))[_0xdda7('0x39')](respondWithResult(_0x302548,null))[_0xdda7('0x2b')](handleError(_0x302548,null));};exports[_0xdda7('0x5a')]=function(_0x316393,_0x2fbd18){return db[_0xdda7('0x40')][_0xdda7('0x5a')](_0x316393['body'],{})['then'](respondWithResult(_0x2fbd18,0xc9))[_0xdda7('0x2b')](handleError(_0x2fbd18,null));};exports[_0xdda7('0x38')]=function(_0x5f1f7b,_0x24fca1){if(_0x5f1f7b[_0xdda7('0x5b')]['id']){delete _0x5f1f7b[_0xdda7('0x5b')]['id'];}return db[_0xdda7('0x40')][_0xdda7('0x59')]({'where':{'id':_0x5f1f7b[_0xdda7('0x5c')]['id']}})['then'](handleEntityNotFound(_0x24fca1,null))['then'](saveUpdates(_0x5f1f7b['body'],null))[_0xdda7('0x39')](respondWithResult(_0x24fca1,null))[_0xdda7('0x2b')](handleError(_0x24fca1,null));};exports[_0xdda7('0x3a')]=function(_0x3fdfce,_0x33795a){return db[_0xdda7('0x40')]['find']({'where':{'id':_0x3fdfce['params']['id']}})[_0xdda7('0x39')](handleEntityNotFound(_0x33795a,null))[_0xdda7('0x39')](removeEntity(_0x33795a,null))[_0xdda7('0x2b')](handleError(_0x33795a,null));};exports[_0xdda7('0x5d')]=function(_0x6090f2,_0x3ed02f){return db['WhatsappMessage'][_0xdda7('0x5d')]()['then'](respondWithResult(_0x3ed02f,null))['catch'](handleError(_0x3ed02f,null));};var interaction_log=require('../../config/logger')(_0xdda7('0x5e'));exports['accept']=function(_0x59e00b,_0x54b1ac,_0xaa9b28){var _0x32f826={'agent':{},'channel':'whatsapp'};if(_0x59e00b['body']['id']){delete _0x59e00b[_0xdda7('0x5b')]['id'];}_0x59e00b['body'][_0xdda7('0x5f')]=!![];_0x59e00b['body'][_0xdda7('0x60')]=moment()[_0xdda7('0x61')](_0xdda7('0x62'));_0x59e00b[_0xdda7('0x5b')][_0xdda7('0x63')]=_0x59e00b['body']['UserId']||_0x59e00b[_0xdda7('0x64')]['id'];_0x32f826[_0xdda7('0x65')]['id']=_0x59e00b[_0xdda7('0x5b')][_0xdda7('0x63')];return db[_0xdda7('0x40')][_0xdda7('0x59')]({'where':{'id':_0x59e00b[_0xdda7('0x5c')]['id'],'UserId':null}})[_0xdda7('0x39')](handleEntityNotFound(_0x54b1ac,null))[_0xdda7('0x39')](saveUpdates(_0x59e00b[_0xdda7('0x5b')],null))[_0xdda7('0x39')](function(_0x492d0a){if(_0x492d0a){_0x32f826[_0xdda7('0x29')]=_0x492d0a[_0xdda7('0x66')]({'plain':!![]});return db['WhatsappInteraction'][_0xdda7('0x59')]({'where':{'id':_0x492d0a[_0xdda7('0x67')]}});}return null;})[_0xdda7('0x39')](handleEntityNotFound(_0x54b1ac,null))[_0xdda7('0x39')](function(_0xb07c02){if(_0xb07c02){return _0xb07c02[_0xdda7('0x38')]({'UserId':_0x59e00b['body'][_0xdda7('0x63')],'read1stAt':_[_0xdda7('0x68')](_0xb07c02[_0xdda7('0x69')])?moment()[_0xdda7('0x61')](_0xdda7('0x62')):undefined});}return null;})['then'](function(_0x4ccb62){if(_0x4ccb62){_0x32f826[_0xdda7('0x6a')]=_0x4ccb62[_0xdda7('0x66')]({'plain':!![]});interaction_log[_0xdda7('0x21')](_0xdda7('0x6b'),_0x59e00b[_0xdda7('0x64')]['id'],_0x59e00b[_0xdda7('0x64')][_0xdda7('0x3c')],_0x59e00b[_0xdda7('0x64')]['role'],_0x32f826[_0xdda7('0x6a')]['id'],_0x59e00b[_0xdda7('0x5b')]?JSON[_0xdda7('0x25')](_0x59e00b[_0xdda7('0x5b')]):_0xdda7('0x6c'));return respondWithRpcPromise(_0xdda7('0x6d'),_0xdda7('0x6e'),_0x32f826);}return null;})[_0xdda7('0x39')](function(_0x12d306){var _0x10d222='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x12d306[_0xdda7('0x29')][_0xdda7('0x6f')];return db[_0xdda7('0x70')][_0xdda7('0x44')](_0x10d222,{'type':db[_0xdda7('0x71')][_0xdda7('0x72')][_0xdda7('0x73')],'raw':!![]})[_0xdda7('0x39')](function(_0x2696d7){return _0x2696d7;});})[_0xdda7('0x39')](function(_0x18d5ee){if(_0x18d5ee){_0x32f826[_0xdda7('0x29')][_0xdda7('0x74')]=_0x18d5ee[0x0];if(!_0x59e00b[_0xdda7('0x5b')]['UserId'])return;return db[_0xdda7('0x75')][_0xdda7('0x59')]({'where':{'id':_0x59e00b[_0xdda7('0x5b')][_0xdda7('0x63')],'role':_0xdda7('0x65')},'attributes':['id',_0xdda7('0x3c'),_0xdda7('0x76'),_0xdda7('0x77'),'internal'],'raw':!![]});}return null;})[_0xdda7('0x39')](function(_0x551869){if(!_0x551869)return null;_0x32f826[_0xdda7('0x29')][_0xdda7('0x65')]=_0x551869;return _0x32f826;})[_0xdda7('0x39')](function(_0x5d6682){if(_0x5d6682){if(_0x59e00b[_0xdda7('0x5b')][_0xdda7('0x78')]){_0x32f826[_0xdda7('0x29')][_0xdda7('0x79')]=util[_0xdda7('0x61')](_0xdda7('0x7a'),_0x59e00b[_0xdda7('0x64')][_0xdda7('0x3c')]);_0x32f826['message']['channel']=_0x32f826[_0xdda7('0x7b')];_0x32f826[_0xdda7('0x29')][_0xdda7('0x7c')]=_0x32f826['channel'];_0x32f826[_0xdda7('0x29')][_0xdda7('0x7d')]=_0xdda7('0x7e');return respondWithRpcPromise(_0xdda7('0x7f'),_0xdda7('0x7f'),{'event':'acceptmessage','message':_0x32f826[_0xdda7('0x29')]},client9002)[_0xdda7('0x39')](function(){return _0x32f826;});}return _0x32f826;}return null;})['then'](respondWithResult(_0x54b1ac,null))['catch'](handleError(_0x54b1ac,null));};var interaction_log=require(_0xdda7('0x14'))(_0xdda7('0x5e'));exports[_0xdda7('0x80')]=function(_0x2426e4,_0x44542a,_0x59abd4){var _0x2fe1a5={'agent':{},'channel':_0xdda7('0x81')};if(_0x2426e4[_0xdda7('0x5b')]['id']){delete _0x2426e4['body']['id'];}_0x2426e4[_0xdda7('0x5b')][_0xdda7('0x63')]=_0x2426e4['body'][_0xdda7('0x63')]||_0x2426e4[_0xdda7('0x64')]['id'];_0x2fe1a5['agent']['id']=_0x2426e4[_0xdda7('0x5b')][_0xdda7('0x63')];return db[_0xdda7('0x40')][_0xdda7('0x59')]({'where':{'id':_0x2426e4[_0xdda7('0x5c')]['id'],'UserId':null}})[_0xdda7('0x39')](handleEntityNotFound(_0x44542a,null))[_0xdda7('0x39')](function(_0xf6c3f2){if(_0xf6c3f2){_0x2fe1a5[_0xdda7('0x29')]=_0xf6c3f2[_0xdda7('0x66')]({'plain':!![]});return db[_0xdda7('0x82')][_0xdda7('0x59')]({'where':{'id':_0xf6c3f2[_0xdda7('0x67')]}});}return null;})[_0xdda7('0x39')](handleEntityNotFound(_0x44542a,null))[_0xdda7('0x39')](function(_0x5821d4){if(_0x5821d4){_0x2fe1a5['interaction']=_0x5821d4[_0xdda7('0x66')]({'plain':!![]});interaction_log[_0xdda7('0x21')](_0xdda7('0x83'),_0x2426e4[_0xdda7('0x64')]['id'],_0x2426e4['user'][_0xdda7('0x3c')],_0x2426e4[_0xdda7('0x64')]['role'],_0x2fe1a5['interaction']['id'],_0x2426e4['body']?JSON[_0xdda7('0x25')](_0x2426e4[_0xdda7('0x5b')]):_0xdda7('0x6c'));return respondWithRpcPromise(_0xdda7('0x84'),_0xdda7('0x85'),_0x2fe1a5);}return null;})[_0xdda7('0x39')](function(_0x5377da){var _0x34e41e=_0xdda7('0x86')+_0x5377da[_0xdda7('0x29')]['ContactId'];return db[_0xdda7('0x70')][_0xdda7('0x44')](_0x34e41e,{'type':db[_0xdda7('0x71')][_0xdda7('0x72')][_0xdda7('0x73')],'raw':!![]})[_0xdda7('0x39')](function(_0x1bfd4b){return _0x1bfd4b;});})[_0xdda7('0x39')](function(_0x4b1616){if(_0x4b1616){_0x2fe1a5['message']['contact']=_0x4b1616[0x0];if(!_0x2426e4[_0xdda7('0x5b')]['UserId'])return;return db['User'][_0xdda7('0x59')]({'where':{'id':_0x2426e4[_0xdda7('0x5b')][_0xdda7('0x63')],'role':_0xdda7('0x65')},'attributes':['id',_0xdda7('0x3c'),'fullname',_0xdda7('0x77'),_0xdda7('0x87')],'raw':!![]});}return null;})[_0xdda7('0x39')](function(_0x290f33){if(!_0x290f33)return null;_0x2fe1a5[_0xdda7('0x29')][_0xdda7('0x65')]=_0x290f33;return _0x2fe1a5;})[_0xdda7('0x39')](function(_0x3d870b){if(_0x3d870b){_0x3d870b[_0xdda7('0x29')][_0xdda7('0x79')]=util[_0xdda7('0x61')](_0xdda7('0x7a'),_0x2426e4[_0xdda7('0x64')][_0xdda7('0x3c')]);_0x3d870b[_0xdda7('0x29')]['channel']=_0x2fe1a5['channel'];_0x3d870b['message'][_0xdda7('0x7c')]=_0x2fe1a5[_0xdda7('0x7b')];_0x3d870b[_0xdda7('0x29')]['event']=_0xdda7('0x80');respondWithRpcPromise(_0xdda7('0x7f'),_0xdda7('0x7f'),{'event':_0xdda7('0x88'),'message':_0x3d870b['message']},client9002);return _0x2fe1a5;}return null;})['then'](respondWithResult(_0x44542a,null))[_0xdda7('0x2b')](handleError(_0x44542a,null));};exports[_0xdda7('0x2d')]=function(_0x446d0f,_0x1d4085,_0x164f90){if(_0x446d0f[_0xdda7('0x5b')]['id']){delete _0x446d0f[_0xdda7('0x5b')]['id'];}var _0x2f0681;return db[_0xdda7('0x40')][_0xdda7('0x59')]({'where':{'id':_0x446d0f[_0xdda7('0x5c')]['id']}})['then'](handleEntityNotFound(_0x1d4085,null))['then'](function(_0x42bba4){if(_0x42bba4){_0x2f0681=_0x42bba4;return db[_0xdda7('0x89')]['find']({'where':{'id':_0x42bba4[_0xdda7('0x8a')]}});}})[_0xdda7('0x39')](handleEntityNotFound(_0x1d4085,null))[_0xdda7('0x39')](function(_0x37c6ed){if(_0x37c6ed){logger[_0xdda7('0x23')](_0xdda7('0x8b'),'status',_0xdda7('0x8c'),_0x37c6ed[_0xdda7('0x42')],util[_0xdda7('0x8d')](_0x446d0f[_0xdda7('0x5b')],{'showHidden':![],'depth':null}));switch(_0x37c6ed[_0xdda7('0x42')]){case _0xdda7('0x8e'):if(_0x446d0f[_0xdda7('0x5b')][_0xdda7('0x8f')]&&_0x446d0f['body']['MessageSid']===_0x2f0681[_0xdda7('0x90')]&&_0x446d0f[_0xdda7('0x5b')][_0xdda7('0x91')]&&_0x446d0f[_0xdda7('0x5b')]['MessageStatus']===_0xdda7('0x5f')){return _0x2f0681[_0xdda7('0x38')]({'read':!![]});}else{logger[_0xdda7('0x26')](_0xdda7('0x92'),_0xdda7('0x2d'),_0xdda7('0x8e'),util[_0xdda7('0x8d')](_0x446d0f[_0xdda7('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x2f0681;}})[_0xdda7('0x39')](respondWithResult(_0x1d4085,null))[_0xdda7('0x2b')](handleError(_0x1d4085,null));}; \ No newline at end of file +var _0xdabc=['stack','name','send','WhatsappMessage','type','model','map','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filter','merge','includeAll','findAll','rows','show','rawAttributes','length','include','options','find','create','body','describe','whatsapp-interactions','accept','whatsapp','readAt','format','UserId','user','params','get','WhatsappInteraction','WhatsappInteractionId','isNil','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','sequelize','Sequelize','QueryTypes','contact','User','agent','fullname','email','internal','channel','motionChannel','event','EventManager','../../config/logger','reject','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','SELECT','interface','SIP/%s','rejectmessage','WhatsappAccount','WhatsappAccountId','debug','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','then','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','undefined','offset','count','limit','Content-Range','json','apply','save','update','destroy'];(function(_0x44c19e,_0x1ac1f7){var _0x5ba393=function(_0x481c77){while(--_0x481c77){_0x44c19e['push'](_0x44c19e['shift']());}};_0x5ba393(++_0x1ac1f7);}(_0xdabc,0x15a));var _0xcdab=function(_0x313927,_0x2b3a6d){_0x313927=_0x313927-0x0;var _0x545b28=_0xdabc[_0x313927];return _0x545b28;};'use strict';var emlformat=require(_0xcdab('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcdab('0x1'));var jsonpatch=require(_0xcdab('0x2'));var rp=require('request-promise');var moment=require(_0xcdab('0x3'));var BPromise=require(_0xcdab('0x4'));var Mustache=require(_0xcdab('0x5'));var util=require(_0xcdab('0x6'));var path=require('path');var sox=require(_0xcdab('0x7'));var csv=require(_0xcdab('0x8'));var ejs=require(_0xcdab('0x9'));var fs=require('fs');var fs_extra=require(_0xcdab('0xa'));var _=require(_0xcdab('0xb'));var squel=require('squel');var crypto=require(_0xcdab('0xc'));var jsforce=require(_0xcdab('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xcdab('0x8'));var querystring=require(_0xcdab('0xe'));var Papa=require('papaparse');var Redis=require(_0xcdab('0xf'));var authService=require(_0xcdab('0x10'));var qs=require(_0xcdab('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xcdab('0x12'));var utils=require('../../config/utils');var config=require(_0xcdab('0x13'));var licenseUtil=require(_0xcdab('0x14'));var db=require(_0xcdab('0x15'))['db'];config[_0xcdab('0x16')]=_[_0xcdab('0x17')](config[_0xcdab('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xcdab('0x18'))(new Redis(config[_0xcdab('0x16')]));require(_0xcdab('0x19'))[_0xcdab('0x1a')](socket);var jayson=require(_0xcdab('0x1b'));var client=jayson[_0xcdab('0x1c')][_0xcdab('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0xcdab('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x3168c5,_0x428d04,_0x36a1d0,_0x52e640){return new BPromise(function(_0x4e6d32,_0x5b556f){var _0x16bd38=_0x52e640||client;return _0x16bd38['request'](_0x3168c5,_0x36a1d0)[_0xcdab('0x1e')](function(_0x25a698){logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x428d04,_0xcdab('0x1f'));logger['debug'](_0xcdab('0x20'),_0x428d04,_0xcdab('0x1f'),JSON[_0xcdab('0x21')](_0x25a698));if(_0x25a698[_0xcdab('0x22')]){if(_0x25a698['error'][_0xcdab('0x23')]===0x1f4){logger[_0xcdab('0x22')](_0xcdab('0x24'),_0x428d04,_0x25a698[_0xcdab('0x22')][_0xcdab('0x25')]);return _0x5b556f(_0x25a698[_0xcdab('0x22')]['message']);}logger[_0xcdab('0x22')]('WhatsappMessage,\x20%s,\x20%s',_0x428d04,_0x25a698[_0xcdab('0x22')][_0xcdab('0x25')]);return _0x4e6d32(_0x25a698[_0xcdab('0x22')][_0xcdab('0x25')]);}else{logger[_0xcdab('0x26')](_0xcdab('0x24'),_0x428d04,_0xcdab('0x1f'));_0x4e6d32(_0x25a698[_0xcdab('0x27')][_0xcdab('0x25')]);}})[_0xcdab('0x28')](function(_0xd9caac){logger[_0xcdab('0x22')]('WhatsappMessage,\x20%s,\x20%s',_0x428d04,_0xd9caac);_0x5b556f(_0xd9caac);});});}function respondWithStatusCode(_0xbb220e,_0x55d89f){_0x55d89f=_0x55d89f||0xcc;return function(_0x3244de){if(_0x3244de){return _0xbb220e[_0xcdab('0x29')](_0x55d89f);}return _0xbb220e[_0xcdab('0x2a')](_0x55d89f)['end']();};}function respondWithResult(_0x583664,_0x1fce5b){_0x1fce5b=_0x1fce5b||0xc8;return function(_0x176327){if(_0x176327){return _0x583664[_0xcdab('0x2a')](_0x1fce5b)['json'](_0x176327);}};}function respondWithFilteredResult(_0x11dd38,_0x4e93ee){return function(_0x25c06e){if(_0x25c06e){var _0x38afa5=typeof _0x4e93ee['offset']===_0xcdab('0x2b')&&typeof _0x4e93ee['limit']===_0xcdab('0x2b');var _0x19d7fa=_0x25c06e['count'];var _0x4a4314=_0x38afa5?0x0:_0x4e93ee[_0xcdab('0x2c')];var _0x20b63f=_0x38afa5?_0x25c06e[_0xcdab('0x2d')]:_0x4e93ee[_0xcdab('0x2c')]+_0x4e93ee[_0xcdab('0x2e')];var _0x120e59;if(_0x20b63f>=_0x19d7fa){_0x20b63f=_0x19d7fa;_0x120e59=0xc8;}else{_0x120e59=0xce;}_0x11dd38[_0xcdab('0x2a')](_0x120e59);return _0x11dd38['set'](_0xcdab('0x2f'),_0x4a4314+'-'+_0x20b63f+'/'+_0x19d7fa)[_0xcdab('0x30')](_0x25c06e);}return null;};}function patchUpdates(_0x4c7241){return function(_0x312d7e){try{jsonpatch[_0xcdab('0x31')](_0x312d7e,_0x4c7241,!![]);}catch(_0x27069a){return BPromise['reject'](_0x27069a);}return _0x312d7e[_0xcdab('0x32')]();};}function saveUpdates(_0x5de3fb,_0x4f5382){return function(_0x22ec7d){if(_0x22ec7d){return _0x22ec7d[_0xcdab('0x33')](_0x5de3fb)[_0xcdab('0x1e')](function(_0x7e9b73){return _0x7e9b73;});}return null;};}function removeEntity(_0x40d9d5,_0x2ec7bf){return function(_0x108d83){if(_0x108d83){return _0x108d83[_0xcdab('0x34')]()[_0xcdab('0x1e')](function(){_0x40d9d5[_0xcdab('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31276f,_0x3a27a6){return function(_0x3060da){if(!_0x3060da){_0x31276f['sendStatus'](0x194);}return _0x3060da;};}function handleError(_0x5105cb,_0x27397f){_0x27397f=_0x27397f||0x1f4;return function(_0x47ade5){logger[_0xcdab('0x22')](_0x47ade5[_0xcdab('0x35')]);if(_0x47ade5[_0xcdab('0x36')]){delete _0x47ade5[_0xcdab('0x36')];}_0x5105cb[_0xcdab('0x2a')](_0x27397f)[_0xcdab('0x37')](_0x47ade5);};}exports['index']=function(_0x570883,_0x34d686){var _0x8fe009={},_0xfbeee1={},_0x2adb26={'count':0x0,'rows':[]};var _0x1e21c8=_['map'](db[_0xcdab('0x38')]['rawAttributes'],function(_0x35c4d0){return{'name':_0x35c4d0['fieldName'],'type':_0x35c4d0[_0xcdab('0x39')]['key']};});_0xfbeee1[_0xcdab('0x3a')]=_[_0xcdab('0x3b')](_0x1e21c8,_0xcdab('0x36'));_0xfbeee1['query']=_[_0xcdab('0x3c')](_0x570883[_0xcdab('0x3d')]);_0xfbeee1[_0xcdab('0x3e')]=_['intersection'](_0xfbeee1[_0xcdab('0x3a')],_0xfbeee1[_0xcdab('0x3d')]);_0x8fe009['attributes']=_[_0xcdab('0x3f')](_0xfbeee1['model'],qs[_0xcdab('0x40')](_0x570883['query']['fields']));_0x8fe009[_0xcdab('0x41')]=_0x8fe009['attributes']['length']?_0x8fe009['attributes']:_0xfbeee1[_0xcdab('0x3a')];if(!_0x570883[_0xcdab('0x3d')][_0xcdab('0x42')](_0xcdab('0x43'))){_0x8fe009[_0xcdab('0x2e')]=qs[_0xcdab('0x2e')](_0x570883['query']['limit']);_0x8fe009[_0xcdab('0x2c')]=qs[_0xcdab('0x2c')](_0x570883[_0xcdab('0x3d')]['offset']);}_0x8fe009['order']=qs[_0xcdab('0x44')](_0x570883[_0xcdab('0x3d')][_0xcdab('0x44')]);_0x8fe009[_0xcdab('0x45')]=qs[_0xcdab('0x3e')](_['pick'](_0x570883['query'],_0xfbeee1[_0xcdab('0x3e')]),_0x1e21c8);if(_0x570883['query'][_0xcdab('0x46')]){_0x8fe009[_0xcdab('0x45')]=_[_0xcdab('0x47')](_0x8fe009[_0xcdab('0x45')],{'$or':_[_0xcdab('0x3b')](_0x1e21c8,function(_0x494d88){if(_0x494d88[_0xcdab('0x39')]!=='VIRTUAL'){var _0x2b0a59={};_0x2b0a59[_0x494d88[_0xcdab('0x36')]]={'$like':'%'+_0x570883[_0xcdab('0x3d')]['filter']+'%'};return _0x2b0a59;}})});}_0x8fe009=_[_0xcdab('0x47')]({},_0x8fe009,_0x570883['options']);var _0x53a504={'where':_0x8fe009['where']};return db[_0xcdab('0x38')][_0xcdab('0x2d')](_0x53a504)[_0xcdab('0x1e')](function(_0x19cc84){_0x2adb26['count']=_0x19cc84;if(_0x570883['query'][_0xcdab('0x48')]){_0x8fe009['include']=[{'all':!![]}];}return db[_0xcdab('0x38')][_0xcdab('0x49')](_0x8fe009);})[_0xcdab('0x1e')](function(_0x283ddd){_0x2adb26[_0xcdab('0x4a')]=_0x283ddd;return _0x2adb26;})[_0xcdab('0x1e')](respondWithFilteredResult(_0x34d686,_0x8fe009))[_0xcdab('0x28')](handleError(_0x34d686,null));};exports[_0xcdab('0x4b')]=function(_0xd598f2,_0x5ac7bc){var _0x2e194f={'raw':!![],'where':{'id':_0xd598f2['params']['id']}},_0x103140={};_0x103140['model']=_[_0xcdab('0x3c')](db[_0xcdab('0x38')][_0xcdab('0x4c')]);_0x103140[_0xcdab('0x3d')]=_[_0xcdab('0x3c')](_0xd598f2[_0xcdab('0x3d')]);_0x103140[_0xcdab('0x3e')]=_[_0xcdab('0x3f')](_0x103140['model'],_0x103140[_0xcdab('0x3d')]);_0x2e194f['attributes']=_[_0xcdab('0x3f')](_0x103140[_0xcdab('0x3a')],qs[_0xcdab('0x40')](_0xd598f2[_0xcdab('0x3d')][_0xcdab('0x40')]));_0x2e194f['attributes']=_0x2e194f[_0xcdab('0x41')][_0xcdab('0x4d')]?_0x2e194f[_0xcdab('0x41')]:_0x103140[_0xcdab('0x3a')];if(_0xd598f2[_0xcdab('0x3d')][_0xcdab('0x48')]){_0x2e194f[_0xcdab('0x4e')]=[{'all':!![]}];}_0x2e194f=_[_0xcdab('0x47')]({},_0x2e194f,_0xd598f2[_0xcdab('0x4f')]);return db[_0xcdab('0x38')][_0xcdab('0x50')](_0x2e194f)[_0xcdab('0x1e')](handleEntityNotFound(_0x5ac7bc,null))[_0xcdab('0x1e')](respondWithResult(_0x5ac7bc,null))['catch'](handleError(_0x5ac7bc,null));};exports[_0xcdab('0x51')]=function(_0x34be3e,_0x3d9f25){return db['WhatsappMessage']['create'](_0x34be3e[_0xcdab('0x52')],{})[_0xcdab('0x1e')](respondWithResult(_0x3d9f25,0xc9))[_0xcdab('0x28')](handleError(_0x3d9f25,null));};exports[_0xcdab('0x33')]=function(_0x5c587a,_0x28c2fd){if(_0x5c587a['body']['id']){delete _0x5c587a[_0xcdab('0x52')]['id'];}return db[_0xcdab('0x38')][_0xcdab('0x50')]({'where':{'id':_0x5c587a['params']['id']}})[_0xcdab('0x1e')](handleEntityNotFound(_0x28c2fd,null))[_0xcdab('0x1e')](saveUpdates(_0x5c587a[_0xcdab('0x52')],null))[_0xcdab('0x1e')](respondWithResult(_0x28c2fd,null))[_0xcdab('0x28')](handleError(_0x28c2fd,null));};exports[_0xcdab('0x34')]=function(_0x4150b6,_0x2e4ef6){return db[_0xcdab('0x38')][_0xcdab('0x50')]({'where':{'id':_0x4150b6['params']['id']}})[_0xcdab('0x1e')](handleEntityNotFound(_0x2e4ef6,null))[_0xcdab('0x1e')](removeEntity(_0x2e4ef6,null))[_0xcdab('0x28')](handleError(_0x2e4ef6,null));};exports[_0xcdab('0x53')]=function(_0xdc7142,_0x334edf){return db[_0xcdab('0x38')][_0xcdab('0x53')]()[_0xcdab('0x1e')](respondWithResult(_0x334edf,null))['catch'](handleError(_0x334edf,null));};var interaction_log=require('../../config/logger')(_0xcdab('0x54'));exports[_0xcdab('0x55')]=function(_0x2c7ab3,_0x55792c,_0x757505){var _0x43955b={'agent':{},'channel':_0xcdab('0x56')};if(_0x2c7ab3['body']['id']){delete _0x2c7ab3[_0xcdab('0x52')]['id'];}_0x2c7ab3[_0xcdab('0x52')]['read']=!![];_0x2c7ab3[_0xcdab('0x52')][_0xcdab('0x57')]=moment()[_0xcdab('0x58')]('YYYY-MM-DD\x20HH:mm:ss');_0x2c7ab3[_0xcdab('0x52')][_0xcdab('0x59')]=_0x2c7ab3[_0xcdab('0x52')][_0xcdab('0x59')]||_0x2c7ab3[_0xcdab('0x5a')]['id'];_0x43955b['agent']['id']=_0x2c7ab3[_0xcdab('0x52')][_0xcdab('0x59')];return db['WhatsappMessage']['find']({'where':{'id':_0x2c7ab3[_0xcdab('0x5b')]['id'],'UserId':null}})[_0xcdab('0x1e')](handleEntityNotFound(_0x55792c,null))[_0xcdab('0x1e')](saveUpdates(_0x2c7ab3[_0xcdab('0x52')],null))['then'](function(_0x339fb6){if(_0x339fb6){_0x43955b['message']=_0x339fb6[_0xcdab('0x5c')]({'plain':!![]});return db[_0xcdab('0x5d')][_0xcdab('0x50')]({'where':{'id':_0x339fb6[_0xcdab('0x5e')]}});}return null;})[_0xcdab('0x1e')](handleEntityNotFound(_0x55792c,null))[_0xcdab('0x1e')](function(_0x22f7d1){if(_0x22f7d1){return _0x22f7d1[_0xcdab('0x33')]({'UserId':_0x2c7ab3[_0xcdab('0x52')][_0xcdab('0x59')],'read1stAt':_[_0xcdab('0x5f')](_0x22f7d1['read1stAt'])?moment()[_0xcdab('0x58')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xcdab('0x1e')](function(_0x35b1da){if(_0x35b1da){_0x43955b['interaction']=_0x35b1da[_0xcdab('0x5c')]({'plain':!![]});interaction_log[_0xcdab('0x26')](_0xcdab('0x60'),_0x2c7ab3[_0xcdab('0x5a')]['id'],_0x2c7ab3[_0xcdab('0x5a')][_0xcdab('0x36')],_0x2c7ab3[_0xcdab('0x5a')][_0xcdab('0x61')],_0x43955b[_0xcdab('0x62')]['id'],_0x2c7ab3['body']?JSON['stringify'](_0x2c7ab3[_0xcdab('0x52')]):_0xcdab('0x63'));return respondWithRpcPromise(_0xcdab('0x64'),'acceptMessage',_0x43955b);}return null;})[_0xcdab('0x1e')](function(_0x31e34a){var _0x57938a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x31e34a['message']['ContactId'];return db[_0xcdab('0x65')][_0xcdab('0x3d')](_0x57938a,{'type':db[_0xcdab('0x66')][_0xcdab('0x67')]['SELECT'],'raw':!![]})[_0xcdab('0x1e')](function(_0x2f2ed3){return _0x2f2ed3;});})[_0xcdab('0x1e')](function(_0x11b105){if(_0x11b105){_0x43955b[_0xcdab('0x25')][_0xcdab('0x68')]=_0x11b105[0x0];if(!_0x2c7ab3[_0xcdab('0x52')][_0xcdab('0x59')])return;return db[_0xcdab('0x69')]['find']({'where':{'id':_0x2c7ab3[_0xcdab('0x52')][_0xcdab('0x59')],'role':_0xcdab('0x6a')},'attributes':['id',_0xcdab('0x36'),_0xcdab('0x6b'),_0xcdab('0x6c'),_0xcdab('0x6d')],'raw':!![]});}return null;})[_0xcdab('0x1e')](function(_0x18280e){if(!_0x18280e)return null;_0x43955b[_0xcdab('0x25')][_0xcdab('0x6a')]=_0x18280e;return _0x43955b;})[_0xcdab('0x1e')](function(_0x577493){if(_0x577493){if(_0x2c7ab3[_0xcdab('0x52')]['manual']){_0x43955b[_0xcdab('0x25')]['interface']=util[_0xcdab('0x58')]('SIP/%s',_0x2c7ab3[_0xcdab('0x5a')][_0xcdab('0x36')]);_0x43955b[_0xcdab('0x25')]['channel']=_0x43955b[_0xcdab('0x6e')];_0x43955b[_0xcdab('0x25')][_0xcdab('0x6f')]=_0x43955b[_0xcdab('0x6e')];_0x43955b[_0xcdab('0x25')][_0xcdab('0x70')]='accept';return respondWithRpcPromise(_0xcdab('0x71'),_0xcdab('0x71'),{'event':'acceptmessage','message':_0x43955b[_0xcdab('0x25')]},client9002)[_0xcdab('0x1e')](function(){return _0x43955b;});}return _0x43955b;}return null;})[_0xcdab('0x1e')](respondWithResult(_0x55792c,null))[_0xcdab('0x28')](handleError(_0x55792c,null));};var interaction_log=require(_0xcdab('0x72'))('whatsapp-interactions');exports[_0xcdab('0x73')]=function(_0x3de3ce,_0x449eaf,_0x410824){var _0x43a823={'agent':{},'channel':_0xcdab('0x56')};if(_0x3de3ce['body']['id']){delete _0x3de3ce[_0xcdab('0x52')]['id'];}_0x3de3ce[_0xcdab('0x52')][_0xcdab('0x59')]=_0x3de3ce[_0xcdab('0x52')][_0xcdab('0x59')]||_0x3de3ce[_0xcdab('0x5a')]['id'];_0x43a823[_0xcdab('0x6a')]['id']=_0x3de3ce['body'][_0xcdab('0x59')];return db['WhatsappMessage']['find']({'where':{'id':_0x3de3ce[_0xcdab('0x5b')]['id'],'UserId':null}})[_0xcdab('0x1e')](handleEntityNotFound(_0x449eaf,null))[_0xcdab('0x1e')](function(_0x1c7f68){if(_0x1c7f68){_0x43a823['message']=_0x1c7f68[_0xcdab('0x5c')]({'plain':!![]});return db[_0xcdab('0x5d')][_0xcdab('0x50')]({'where':{'id':_0x1c7f68[_0xcdab('0x5e')]}});}return null;})[_0xcdab('0x1e')](handleEntityNotFound(_0x449eaf,null))[_0xcdab('0x1e')](function(_0x62ec6c){if(_0x62ec6c){_0x43a823[_0xcdab('0x62')]=_0x62ec6c['get']({'plain':!![]});interaction_log[_0xcdab('0x26')](_0xcdab('0x74'),_0x3de3ce['user']['id'],_0x3de3ce[_0xcdab('0x5a')]['name'],_0x3de3ce['user'][_0xcdab('0x61')],_0x43a823[_0xcdab('0x62')]['id'],_0x3de3ce['body']?JSON[_0xcdab('0x21')](_0x3de3ce[_0xcdab('0x52')]):_0xcdab('0x63'));return respondWithRpcPromise(_0xcdab('0x75'),_0xcdab('0x76'),_0x43a823);}return null;})[_0xcdab('0x1e')](function(_0x8c987e){var _0x557351=_0xcdab('0x77')+_0x8c987e[_0xcdab('0x25')][_0xcdab('0x78')];return db[_0xcdab('0x65')][_0xcdab('0x3d')](_0x557351,{'type':db[_0xcdab('0x66')][_0xcdab('0x67')][_0xcdab('0x79')],'raw':!![]})[_0xcdab('0x1e')](function(_0x480def){return _0x480def;});})[_0xcdab('0x1e')](function(_0x43ca3f){if(_0x43ca3f){_0x43a823[_0xcdab('0x25')][_0xcdab('0x68')]=_0x43ca3f[0x0];if(!_0x3de3ce['body'][_0xcdab('0x59')])return;return db[_0xcdab('0x69')][_0xcdab('0x50')]({'where':{'id':_0x3de3ce['body']['UserId'],'role':_0xcdab('0x6a')},'attributes':['id','name',_0xcdab('0x6b'),_0xcdab('0x6c'),_0xcdab('0x6d')],'raw':!![]});}return null;})[_0xcdab('0x1e')](function(_0x482728){if(!_0x482728)return null;_0x43a823[_0xcdab('0x25')][_0xcdab('0x6a')]=_0x482728;return _0x43a823;})[_0xcdab('0x1e')](function(_0x153154){if(_0x153154){_0x153154[_0xcdab('0x25')][_0xcdab('0x7a')]=util[_0xcdab('0x58')](_0xcdab('0x7b'),_0x3de3ce[_0xcdab('0x5a')][_0xcdab('0x36')]);_0x153154[_0xcdab('0x25')][_0xcdab('0x6e')]=_0x43a823[_0xcdab('0x6e')];_0x153154[_0xcdab('0x25')]['motionChannel']=_0x43a823[_0xcdab('0x6e')];_0x153154[_0xcdab('0x25')][_0xcdab('0x70')]=_0xcdab('0x73');respondWithRpcPromise(_0xcdab('0x71'),'EventManager',{'event':_0xcdab('0x7c'),'message':_0x153154[_0xcdab('0x25')]},client9002);return _0x43a823;}return null;})[_0xcdab('0x1e')](respondWithResult(_0x449eaf,null))['catch'](handleError(_0x449eaf,null));};exports['status']=function(_0x865b8b,_0x16dcbc,_0x92d5b1){if(_0x865b8b['body']['id']){delete _0x865b8b[_0xcdab('0x52')]['id'];}var _0x5e33d5;return db[_0xcdab('0x38')][_0xcdab('0x50')]({'where':{'id':_0x865b8b[_0xcdab('0x5b')]['id']}})[_0xcdab('0x1e')](handleEntityNotFound(_0x16dcbc,null))[_0xcdab('0x1e')](function(_0x3107bd){if(_0x3107bd){_0x5e33d5=_0x3107bd;return db[_0xcdab('0x7d')][_0xcdab('0x50')]({'where':{'id':_0x3107bd[_0xcdab('0x7e')]}});}})['then'](handleEntityNotFound(_0x16dcbc,null))[_0xcdab('0x1e')](function(_0x554c82){if(_0x554c82){logger[_0xcdab('0x7f')](_0xcdab('0x80'),'status',_0xcdab('0x81'),_0x554c82[_0xcdab('0x39')],util[_0xcdab('0x82')](_0x865b8b[_0xcdab('0x52')],{'showHidden':![],'depth':null}));switch(_0x554c82['type']){case _0xcdab('0x83'):if(_0x865b8b['body'][_0xcdab('0x84')]&&_0x865b8b[_0xcdab('0x52')][_0xcdab('0x84')]===_0x5e33d5['messageId']&&_0x865b8b[_0xcdab('0x52')]['MessageStatus']&&_0x865b8b[_0xcdab('0x52')]['MessageStatus']==='read'){return _0x5e33d5[_0xcdab('0x33')]({'read':!![]});}else{logger['error']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0xcdab('0x2a'),_0xcdab('0x83'),util[_0xcdab('0x82')](_0x865b8b[_0xcdab('0x52')],{'showHidden':![],'depth':null}));}break;}return _0x5e33d5;}})[_0xcdab('0x1e')](respondWithResult(_0x16dcbc,null))[_0xcdab('0x28')](handleError(_0x16dcbc,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index bfad9fd..02b3d34 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 _0xcb91=['save','update','emit','hasOwnProperty','hook','WhatsappMessage','setMaxListeners'];(function(_0x3c5922,_0x333a4f){var _0x14e213=function(_0x298f1e){while(--_0x298f1e){_0x3c5922['push'](_0x3c5922['shift']());}};_0x14e213(++_0x333a4f);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x272638,_0x42b993){_0x272638=_0x272638-0x0;var _0x19d027=_0xcb91[_0x272638];return _0x19d027;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require('../../mysqldb')['db'][_0x1cb9('0x0')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x1cb9('0x1')](0x0);var events={'afterCreate':_0x1cb9('0x2'),'afterUpdate':_0x1cb9('0x3'),'afterDestroy':'remove'};function emitEvent(_0x8c392f){return function(_0x2c17b8,_0x545a34,_0x13d5fd){WhatsappMessageEvents[_0x1cb9('0x4')](_0x8c392f+':'+_0x2c17b8['id'],_0x2c17b8);WhatsappMessageEvents['emit'](_0x8c392f,_0x2c17b8);_0x13d5fd(null);};}for(var e in events){if(events[_0x1cb9('0x5')](e)){var event=events[e];WhatsappMessage[_0x1cb9('0x6')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file +var _0x9e0d=['remove','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','update'];(function(_0xe39c3b,_0xf0f27f){var _0x3c3e40=function(_0x221d61){while(--_0x221d61){_0xe39c3b['push'](_0xe39c3b['shift']());}};_0x3c3e40(++_0xf0f27f);}(_0x9e0d,0xf7));var _0xd9e0=function(_0x318b73,_0x25f054){_0x318b73=_0x318b73-0x0;var _0x19061f=_0x9e0d[_0x318b73];return _0x19061f;};'use strict';var EventEmitter=require(_0xd9e0('0x0'));var WhatsappMessage=require(_0xd9e0('0x1'))['db'][_0xd9e0('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xd9e0('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd9e0('0x4'),'afterDestroy':_0xd9e0('0x5')};function emitEvent(_0x145133){return function(_0x1c83df,_0x296774,_0x36a691){WhatsappMessageEvents['emit'](_0x145133+':'+_0x1c83df['id'],_0x1c83df);WhatsappMessageEvents['emit'](_0x145133,_0x1c83df);_0x36a691(null);};}for(var e in events){if(events[_0xd9e0('0x6')](e)){var event=events[e];WhatsappMessage[_0xd9e0('0x7')](e,emitEvent(event));}}module[_0xd9e0('0x8')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index ebb5605..ed8d23e 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 _0xf227=['secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','createdAt','catch','error','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','phone','authToken','messages','create','whatsapp:','/api/whatsapp/messages/','token','sid','afterCreate','inspect','WhatsappMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','/whatsapp/v1/','text','Bearer\x20','application/json','statuses','message_id','err','finally','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','node-fetch','path','rimraf','../../config/environment','exports','define','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','toLowerCase','out'];(function(_0x453062,_0x5be53b){var _0x2b26aa=function(_0x55be77){while(--_0x55be77){_0x453062['push'](_0x453062['shift']());}};_0x2b26aa(++_0x5be53b);}(_0xf227,0x18f));var _0x7f22=function(_0x5a52a5,_0xd67baa){_0x5a52a5=_0x5a52a5-0x0;var _0x1997d8=_0xf227[_0x5a52a5];return _0x1997d8;};'use strict';var _=require(_0x7f22('0x0'));var util=require(_0x7f22('0x1'));var logger=require(_0x7f22('0x2'))(_0x7f22('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7f22('0x4'));var fetch=require(_0x7f22('0x5'));var fs=require('fs');var path=require(_0x7f22('0x6'));var rimraf=require(_0x7f22('0x7'));var config=require(_0x7f22('0x8'));var attributes=require('./whatsappMessage.attributes');module[_0x7f22('0x9')]=function(_0x51b846,_0x169e33){return _0x51b846[_0x7f22('0xa')]('WhatsappMessage',attributes,{'tableName':_0x7f22('0xb'),'paranoid':![],'indexes':[{'name':_0x7f22('0xc'),'fields':[_0x7f22('0xc')]},{'name':_0x7f22('0xd'),'fields':[_0x7f22('0xe')],'type':_0x7f22('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2002f0,_0x300a4d,_0x57aa71){var _0x3d86df=_0x51b846[_0x7f22('0x10')];var _0x424728=_0x2002f0[_0x7f22('0x11')]({'plain':!![]});if(_0x424728[_0x7f22('0x12')][_0x7f22('0x13')]()==='in'||_0x424728[_0x7f22('0x12')]['toLowerCase']()===_0x7f22('0x14')&&!_0x424728[_0x7f22('0x15')]&&!_[_0x7f22('0x16')](_0x424728[_0x7f22('0x17')])){_0x3d86df[_0x7f22('0x18')][_0x7f22('0x19')]({'where':{'id':_0x424728[_0x7f22('0x1a')]}})[_0x7f22('0x1b')](function(_0x42a46a){if(_0x42a46a){_0x42a46a[_0x7f22('0x1c')]({'lastMsgAt':_0x424728[_0x7f22('0x1d')],'lastMsgDirection':_0x424728['direction'][_0x7f22('0x13')]()});}})[_0x7f22('0x1e')](function(_0x1c9752){console[_0x7f22('0x1f')](_0x1c9752);});}if(_0x424728[_0x7f22('0x12')]===_0x7f22('0x14')&&!_0x424728[_0x7f22('0x15')]){var _0x27ba57;_0x3d86df[_0x7f22('0x20')][_0x7f22('0x21')]({'where':{'id':_0x424728[_0x7f22('0x22')]},'raw':!![]})[_0x7f22('0x1b')](function(_0x24f88c){_0x27ba57=_0x24f88c;if(_0x27ba57&&_0x27ba57[_0x7f22('0x23')]){switch(_0x27ba57['type']){case _0x7f22('0x24'):var _0x430cfd=require(_0x7f22('0x24'));if(_0x27ba57[_0x7f22('0x25')]&&_0x27ba57['authToken']&&_0x27ba57[_0x7f22('0x26')]){var _0x1293f1=new _0x430cfd(_0x27ba57['accountSid'],_0x27ba57[_0x7f22('0x27')]);_0x1293f1[_0x7f22('0x28')][_0x7f22('0x29')]({'body':_0x424728[_0x7f22('0xe')],'to':_0x7f22('0x2a')+_0x424728[_0x7f22('0x26')],'from':_0x7f22('0x2a')+_0x27ba57[_0x7f22('0x26')],'statusCallback':_0x27ba57['remote']+_0x7f22('0x2b')+_0x424728['id']+'/status?token='+_0x27ba57[_0x7f22('0x2c')]})[_0x7f22('0x1b')](function(_0x186d6e){if(_0x186d6e[_0x7f22('0x2d')]){return _0x2002f0[_0x7f22('0x1c')]({'messageId':_0x186d6e['sid']});}})[_0x7f22('0x1e')](function(_0x26ed50){logger['error']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x7f22('0x2e'),_0x7f22('0x24'),util[_0x7f22('0x2f')](_0x26ed50,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x7f22('0x30'),_0x7f22('0x2e'),_0x7f22('0x24'),_0x7f22('0x31'));}break;case _0x7f22('0x32'):var _0x389e85=_0x27ba57['accountSid'];var _0x4b146c=_0x27ba57[_0x7f22('0x27')];var _0x50f582=_0x27ba57['baseUrl']+_0x7f22('0x33')+_0x389e85+'/messages/';var _0x17ebd4={'to':[_0x424728['phone']],'message':{'type':_0x7f22('0x34'),'text':_0x424728[_0x7f22('0xe')]}};var _0x3be780={'method':'POST','uri':_0x50f582,'headers':{'Authorization':_0x7f22('0x35')+_0x4b146c,'Content-Type':_0x7f22('0x36')},'body':_0x17ebd4,'json':!![]};rp(_0x3be780)[_0x7f22('0x1b')](function(_0x120180){if(_0x120180[_0x7f22('0x37')][0x0][_0x7f22('0x38')]){return _0x2002f0['update']({'messageId':_0x120180[_0x7f22('0x37')][0x0][_0x7f22('0x38')]});}})['catch'](function(_0x58e905){logger[_0x7f22('0x39')]('WhatsappMessage,\x20%s',_0x58e905);});break;}}})[_0x7f22('0x3a')](function(){_0x57aa71();});}else{_0x57aa71();}}},'charset':'utf8mb4','collate':_0x7f22('0x3b')});}; \ No newline at end of file +var _0xaef9=['authToken','phone','messages','create','whatsapp:','/api/whatsapp/messages/','/status?token=','sid','catch','WhatsappMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','text','Bearer\x20','application/json','statuses','message_id','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','node-fetch','path','exports','define','WhatsappMessage','messageId','body','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','WhatsappInteraction','findOne','update','createdAt','error','secret','WhatsappAccount','find','WhatsappAccountId','then','type','twilio','accountSid'];(function(_0x1bc9b8,_0x379fc7){var _0x1a9a13=function(_0x3a73ea){while(--_0x3a73ea){_0x1bc9b8['push'](_0x1bc9b8['shift']());}};_0x1a9a13(++_0x379fc7);}(_0xaef9,0x13b));var _0x9aef=function(_0x46be87,_0x362bac){_0x46be87=_0x46be87-0x0;var _0x3a3fec=_0xaef9[_0x46be87];return _0x3a3fec;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9aef('0x0'))(_0x9aef('0x1'));var moment=require(_0x9aef('0x2'));var BPromise=require(_0x9aef('0x3'));var rp=require(_0x9aef('0x4'));var fetch=require(_0x9aef('0x5'));var fs=require('fs');var path=require(_0x9aef('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./whatsappMessage.attributes');module[_0x9aef('0x7')]=function(_0x980059,_0x1c1067){return _0x980059[_0x9aef('0x8')](_0x9aef('0x9'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0x9aef('0xa')]},{'name':'fti_whatsapp_messages','fields':[_0x9aef('0xb')],'type':_0x9aef('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5ad5cf,_0x5a816e,_0x55cc6d){var _0x3cf112=_0x980059[_0x9aef('0xd')];var _0x33b1ac=_0x5ad5cf[_0x9aef('0xe')]({'plain':!![]});if(_0x33b1ac[_0x9aef('0xf')][_0x9aef('0x10')]()==='in'||_0x33b1ac[_0x9aef('0xf')]['toLowerCase']()===_0x9aef('0x11')&&!_0x33b1ac['secret']&&!_[_0x9aef('0x12')](_0x33b1ac[_0x9aef('0x13')])){_0x3cf112[_0x9aef('0x14')][_0x9aef('0x15')]({'where':{'id':_0x33b1ac['WhatsappInteractionId']}})['then'](function(_0x208ac1){if(_0x208ac1){_0x208ac1[_0x9aef('0x16')]({'lastMsgAt':_0x33b1ac[_0x9aef('0x17')],'lastMsgDirection':_0x33b1ac[_0x9aef('0xf')][_0x9aef('0x10')]()});}})['catch'](function(_0x1311be){console[_0x9aef('0x18')](_0x1311be);});}if(_0x33b1ac[_0x9aef('0xf')]===_0x9aef('0x11')&&!_0x33b1ac[_0x9aef('0x19')]){var _0x56d170;_0x3cf112[_0x9aef('0x1a')][_0x9aef('0x1b')]({'where':{'id':_0x33b1ac[_0x9aef('0x1c')]},'raw':!![]})[_0x9aef('0x1d')](function(_0x1b78bc){_0x56d170=_0x1b78bc;if(_0x56d170&&_0x56d170[_0x9aef('0x1e')]){switch(_0x56d170[_0x9aef('0x1e')]){case _0x9aef('0x1f'):var _0x1b6a01=require('twilio');if(_0x56d170[_0x9aef('0x20')]&&_0x56d170[_0x9aef('0x21')]&&_0x56d170[_0x9aef('0x22')]){var _0xeb1a9d=new _0x1b6a01(_0x56d170['accountSid'],_0x56d170[_0x9aef('0x21')]);_0xeb1a9d[_0x9aef('0x23')][_0x9aef('0x24')]({'body':_0x33b1ac[_0x9aef('0xb')],'to':_0x9aef('0x25')+_0x33b1ac[_0x9aef('0x22')],'from':_0x9aef('0x25')+_0x56d170[_0x9aef('0x22')],'statusCallback':_0x56d170['remote']+_0x9aef('0x26')+_0x33b1ac['id']+_0x9aef('0x27')+_0x56d170['token']})[_0x9aef('0x1d')](function(_0x8dfb4b){if(_0x8dfb4b['sid']){return _0x5ad5cf[_0x9aef('0x16')]({'messageId':_0x8dfb4b[_0x9aef('0x28')]});}})[_0x9aef('0x29')](function(_0x35f403){logger[_0x9aef('0x18')](_0x9aef('0x2a'),'afterCreate','twilio',util[_0x9aef('0x2b')](_0x35f403,{'showHidden':![],'depth':null}));});}else{logger[_0x9aef('0x18')](_0x9aef('0x2a'),_0x9aef('0x2c'),_0x9aef('0x1f'),_0x9aef('0x2d'));}break;case _0x9aef('0x2e'):var _0x5e96bd=_0x56d170['accountSid'];var _0x1a39bd=_0x56d170[_0x9aef('0x21')];var _0x57e559=_0x56d170[_0x9aef('0x2f')]+_0x9aef('0x30')+_0x5e96bd+'/messages/';var _0x3a6a25={'to':[_0x33b1ac[_0x9aef('0x22')]],'message':{'type':_0x9aef('0x31'),'text':_0x33b1ac[_0x9aef('0xb')]}};var _0x124cc5={'method':'POST','uri':_0x57e559,'headers':{'Authorization':_0x9aef('0x32')+_0x1a39bd,'Content-Type':_0x9aef('0x33')},'body':_0x3a6a25,'json':!![]};rp(_0x124cc5)[_0x9aef('0x1d')](function(_0x2be4ea){if(_0x2be4ea[_0x9aef('0x34')][0x0]['message_id']){return _0x5ad5cf[_0x9aef('0x16')]({'messageId':_0x2be4ea[_0x9aef('0x34')][0x0][_0x9aef('0x35')]});}})[_0x9aef('0x29')](function(_0x492ee9){logger['err'](_0x9aef('0x36'),_0x492ee9);});break;}}})[_0x9aef('0x37')](function(){_0x55cc6d();});}else{_0x55cc6d();}}},'charset':_0x9aef('0x38'),'collate':_0x9aef('0x39')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index e875ccf..fe0c835 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 _0x608d=['util','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','./whatsappMessage.socket','info','WhatsappMessage,\x20%s,\x20%s','debug','error','code','message','catch','CreateWhatsappMessage','create','body','options','raw','then','stringify','lodash'];(function(_0x259a7e,_0x5d3b28){var _0x353d9a=function(_0x2b90ae){while(--_0x2b90ae){_0x259a7e['push'](_0x259a7e['shift']());}};_0x353d9a(++_0x5d3b28);}(_0x608d,0x19f));var _0xd608=function(_0x3460c7,_0x118f09){_0x3460c7=_0x3460c7-0x0;var _0x238340=_0x608d[_0x3460c7];return _0x238340;};'use strict';var _=require(_0xd608('0x0'));var util=require(_0xd608('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd608('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd608('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd608('0x4'));var config=require(_0xd608('0x5'));var jayson=require(_0xd608('0x6'));var client=jayson['client'][_0xd608('0x7')]({'port':0x232a});config['redis']=_[_0xd608('0x8')](config[_0xd608('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xd608('0xa'))(new Redis(config[_0xd608('0x9')]));require(_0xd608('0xb'))['register'](socket);function respondWithRpcPromise(_0x1c7ce1,_0x493c8e,_0x5bbd3c){return new BPromise(function(_0x57cce0,_0x1b8b2a){return client['request'](_0x1c7ce1,_0x5bbd3c)['then'](function(_0x28ba41){logger[_0xd608('0xc')](_0xd608('0xd'),_0x493c8e,'request\x20sent');logger[_0xd608('0xe')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x493c8e,'request\x20sent',JSON['stringify'](_0x28ba41));if(_0x28ba41['error']){if(_0x28ba41[_0xd608('0xf')][_0xd608('0x10')]===0x1f4){logger[_0xd608('0xf')](_0xd608('0xd'),_0x493c8e,_0x28ba41['error'][_0xd608('0x11')]);return _0x1b8b2a(_0x28ba41[_0xd608('0xf')][_0xd608('0x11')]);}logger[_0xd608('0xf')]('WhatsappMessage,\x20%s,\x20%s',_0x493c8e,_0x28ba41[_0xd608('0xf')][_0xd608('0x11')]);return _0x57cce0(_0x28ba41[_0xd608('0xf')][_0xd608('0x11')]);}else{logger[_0xd608('0xc')](_0xd608('0xd'),_0x493c8e,'request\x20sent');_0x57cce0(_0x28ba41['result']['message']);}})[_0xd608('0x12')](function(_0x3aed7e){logger[_0xd608('0xf')]('WhatsappMessage,\x20%s,\x20%s',_0x493c8e,_0x3aed7e);_0x1b8b2a(_0x3aed7e);});});}exports[_0xd608('0x13')]=function(_0x4aee4f){var _0x11c2a2=this;return new Promise(function(_0x428090,_0x31a133){return db['WhatsappMessage'][_0xd608('0x14')](_0x4aee4f[_0xd608('0x15')],{'raw':_0x4aee4f[_0xd608('0x16')]?_0x4aee4f[_0xd608('0x16')][_0xd608('0x17')]===undefined?!![]:![]:!![]})[_0xd608('0x18')](function(_0x2e9c65){logger['info'](_0xd608('0x13'),_0x4aee4f);logger[_0xd608('0xe')](_0xd608('0x13'),_0x4aee4f,JSON[_0xd608('0x19')](_0x2e9c65));_0x428090(_0x2e9c65);})['catch'](function(_0x31f8cf){logger[_0xd608('0xf')](_0xd608('0x13'),_0x31f8cf[_0xd608('0x11')],_0x4aee4f);_0x31a133(_0x11c2a2['error'](0x1f4,_0x31f8cf[_0xd608('0x11')]));});});}; \ No newline at end of file +var _0x5da3=['code','message','catch','CreateWhatsappMessage','create','body','options','raw','stringify','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./whatsappMessage.socket','register','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error'];(function(_0x2813e5,_0x45a66b){var _0xb04455=function(_0x1101a7){while(--_0x1101a7){_0x2813e5['push'](_0x2813e5['shift']());}};_0xb04455(++_0x45a66b);}(_0x5da3,0x1b6));var _0x35da=function(_0x477aa7,_0x211fc6){_0x477aa7=_0x477aa7-0x0;var _0x5c780b=_0x5da3[_0x477aa7];return _0x5c780b;};'use strict';var _=require(_0x35da('0x0'));var util=require(_0x35da('0x1'));var moment=require('moment');var BPromise=require(_0x35da('0x2'));var rs=require(_0x35da('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x35da('0x4'))['db'];var utils=require(_0x35da('0x5'));var logger=require(_0x35da('0x6'))(_0x35da('0x7'));var config=require(_0x35da('0x8'));var jayson=require(_0x35da('0x9'));var client=jayson[_0x35da('0xa')][_0x35da('0xb')]({'port':0x232a});config[_0x35da('0xc')]=_[_0x35da('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x35da('0xe'))(new Redis(config[_0x35da('0xc')]));require(_0x35da('0xf'))[_0x35da('0x10')](socket);function respondWithRpcPromise(_0xfcbdfb,_0x3c11ac,_0x27e13c){return new BPromise(function(_0x4b1fdc,_0xcd79f7){return client['request'](_0xfcbdfb,_0x27e13c)[_0x35da('0x11')](function(_0x4f3fac){logger[_0x35da('0x12')](_0x35da('0x13'),_0x3c11ac,_0x35da('0x14'));logger[_0x35da('0x15')](_0x35da('0x16'),_0x3c11ac,_0x35da('0x14'),JSON['stringify'](_0x4f3fac));if(_0x4f3fac[_0x35da('0x17')]){if(_0x4f3fac[_0x35da('0x17')][_0x35da('0x18')]===0x1f4){logger[_0x35da('0x17')](_0x35da('0x13'),_0x3c11ac,_0x4f3fac['error']['message']);return _0xcd79f7(_0x4f3fac[_0x35da('0x17')][_0x35da('0x19')]);}logger[_0x35da('0x17')](_0x35da('0x13'),_0x3c11ac,_0x4f3fac[_0x35da('0x17')][_0x35da('0x19')]);return _0x4b1fdc(_0x4f3fac[_0x35da('0x17')]['message']);}else{logger[_0x35da('0x12')]('WhatsappMessage,\x20%s,\x20%s',_0x3c11ac,'request\x20sent');_0x4b1fdc(_0x4f3fac['result'][_0x35da('0x19')]);}})[_0x35da('0x1a')](function(_0x541a04){logger['error'](_0x35da('0x13'),_0x3c11ac,_0x541a04);_0xcd79f7(_0x541a04);});});}exports[_0x35da('0x1b')]=function(_0x29ef58){var _0x192194=this;return new Promise(function(_0x70751b,_0x511da8){return db['WhatsappMessage'][_0x35da('0x1c')](_0x29ef58[_0x35da('0x1d')],{'raw':_0x29ef58[_0x35da('0x1e')]?_0x29ef58[_0x35da('0x1e')][_0x35da('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x4f733c){logger['info'](_0x35da('0x1b'),_0x29ef58);logger[_0x35da('0x15')](_0x35da('0x1b'),_0x29ef58,JSON[_0x35da('0x20')](_0x4f733c));_0x70751b(_0x4f733c);})[_0x35da('0x1a')](function(_0x4d5f9e){logger[_0x35da('0x17')](_0x35da('0x1b'),_0x4d5f9e[_0x35da('0x19')],_0x29ef58);_0x511da8(_0x192194[_0x35da('0x17')](0x1f4,_0x4d5f9e[_0x35da('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index f3cf12c..aa0fc8b 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 _0x9235=['length','whatsappMessage:','./whatsappMessage.events','update','removeListener','register'];(function(_0x40a53b,_0x13cee8){var _0x1147e4=function(_0x224978){while(--_0x224978){_0x40a53b['push'](_0x40a53b['shift']());}};_0x1147e4(++_0x13cee8);}(_0x9235,0x140));var _0x5923=function(_0xeab975,_0x1db573){_0xeab975=_0xeab975-0x0;var _0x31479d=_0x9235[_0xeab975];return _0x31479d;};'use strict';var WhatsappMessageEvents=require(_0x5923('0x0'));var events=['save','remove',_0x5923('0x1')];function createListener(_0x3a5db,_0x51e121){return function(_0x606e5f){_0x51e121['emit'](_0x3a5db,_0x606e5f);};}function removeListener(_0x2e35e1,_0x5a24cd){return function(){WhatsappMessageEvents[_0x5923('0x2')](_0x2e35e1,_0x5a24cd);};}exports[_0x5923('0x3')]=function(_0x2736c3){for(var _0x325a5b=0x0,_0x32ffd6=events[_0x5923('0x4')];_0x325a5b<_0x32ffd6;_0x325a5b++){var _0x2ca49e=events[_0x325a5b];var _0x47ecb4=createListener(_0x5923('0x5')+_0x2ca49e,_0x2736c3);WhatsappMessageEvents['on'](_0x2ca49e,_0x47ecb4);}}; \ No newline at end of file +var _0xc866=['update','emit','register','length','./whatsappMessage.events','save','remove'];(function(_0x210ff6,_0x51ccf5){var _0x22813a=function(_0x15b170){while(--_0x15b170){_0x210ff6['push'](_0x210ff6['shift']());}};_0x22813a(++_0x51ccf5);}(_0xc866,0x1d2));var _0x6c86=function(_0x4cfcef,_0x3204dc){_0x4cfcef=_0x4cfcef-0x0;var _0x186741=_0xc866[_0x4cfcef];return _0x186741;};'use strict';var WhatsappMessageEvents=require(_0x6c86('0x0'));var events=[_0x6c86('0x1'),_0x6c86('0x2'),_0x6c86('0x3')];function createListener(_0x532c76,_0x2473d4){return function(_0x2fef5a){_0x2473d4[_0x6c86('0x4')](_0x532c76,_0x2fef5a);};}function removeListener(_0x339bce,_0x1ff8e5){return function(){WhatsappMessageEvents['removeListener'](_0x339bce,_0x1ff8e5);};}exports[_0x6c86('0x5')]=function(_0x204eef){for(var _0x132b9d=0x0,_0x2b8eaa=events[_0x6c86('0x6')];_0x132b9d<_0x2b8eaa;_0x132b9d++){var _0x2ce6b5=events[_0x132b9d];var _0x11ccde=createListener('whatsappMessage:'+_0x2ce6b5,_0x204eef);WhatsappMessageEvents['on'](_0x2ce6b5,_0x11ccde);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 8cb1c26..8aae2df 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 _0x2c06=['addTeams','/:id/users','addAgents','put','destroy','delete','removeAgents','multer','util','path','express','fs-extra','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/:id','show','/:id/members','getMembers','/:id/teams','getAgents','post'];(function(_0x2b4e12,_0x1c7525){var _0x2a89b0=function(_0x32f924){while(--_0x32f924){_0x2b4e12['push'](_0x2b4e12['shift']());}};_0x2a89b0(++_0x1c7525);}(_0x2c06,0x1cf));var _0x62c0=function(_0x3749c2,_0x4ae3b7){_0x3749c2=_0x3749c2-0x0;var _0x551007=_0x2c06[_0x3749c2];return _0x551007;};'use strict';var multer=require(_0x62c0('0x0'));var util=require(_0x62c0('0x1'));var path=require(_0x62c0('0x2'));var timeout=require('connect-timeout');var express=require(_0x62c0('0x3'));var router=express['Router']();var fs_extra=require(_0x62c0('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x62c0('0x5'));var controller=require(_0x62c0('0x6'));router[_0x62c0('0x7')]('/',auth[_0x62c0('0x8')](),controller[_0x62c0('0x9')]);router[_0x62c0('0x7')]('/describe',auth[_0x62c0('0x8')](),controller['describe']);router['get'](_0x62c0('0xa'),auth[_0x62c0('0x8')](),controller[_0x62c0('0xb')]);router['get'](_0x62c0('0xc'),auth[_0x62c0('0x8')](),controller[_0x62c0('0xd')]);router[_0x62c0('0x7')](_0x62c0('0xe'),auth['isAuthenticated'](),controller['getTeams']);router['get']('/:id/users',auth[_0x62c0('0x8')](),controller[_0x62c0('0xf')]);router[_0x62c0('0x10')]('/',auth[_0x62c0('0x8')](),controller['create']);router[_0x62c0('0x10')]('/:id/teams',auth['isAuthenticated'](),controller[_0x62c0('0x11')]);router[_0x62c0('0x10')](_0x62c0('0x12'),auth[_0x62c0('0x8')](),controller[_0x62c0('0x13')]);router[_0x62c0('0x14')](_0x62c0('0xa'),auth[_0x62c0('0x8')](),controller['update']);router['delete'](_0x62c0('0xa'),auth[_0x62c0('0x8')](),controller[_0x62c0('0x15')]);router[_0x62c0('0x16')]('/:id/teams',auth[_0x62c0('0x8')](),controller['removeTeams']);router['delete'](_0x62c0('0x12'),auth[_0x62c0('0x8')](),controller[_0x62c0('0x17')]);module['exports']=router; \ No newline at end of file +var _0x6e42=['delete','removeTeams','removeAgents','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','describe','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','create','post','addTeams','addAgents','put','update','destroy'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x6e42,0x1f0));var _0x26e4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6e42[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x26e4('0x0'));var util=require(_0x26e4('0x1'));var path=require(_0x26e4('0x2'));var timeout=require(_0x26e4('0x3'));var express=require('express');var router=express[_0x26e4('0x4')]();var fs_extra=require(_0x26e4('0x5'));var auth=require(_0x26e4('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x26e4('0x7'));var controller=require(_0x26e4('0x8'));router[_0x26e4('0x9')]('/',auth[_0x26e4('0xa')](),controller[_0x26e4('0xb')]);router[_0x26e4('0x9')]('/describe',auth[_0x26e4('0xa')](),controller[_0x26e4('0xc')]);router[_0x26e4('0x9')](_0x26e4('0xd'),auth[_0x26e4('0xa')](),controller[_0x26e4('0xe')]);router[_0x26e4('0x9')](_0x26e4('0xf'),auth[_0x26e4('0xa')](),controller[_0x26e4('0x10')]);router[_0x26e4('0x9')](_0x26e4('0x11'),auth['isAuthenticated'](),controller['getTeams']);router[_0x26e4('0x9')](_0x26e4('0x12'),auth[_0x26e4('0xa')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0x26e4('0x13')]);router[_0x26e4('0x14')](_0x26e4('0x11'),auth[_0x26e4('0xa')](),controller[_0x26e4('0x15')]);router[_0x26e4('0x14')](_0x26e4('0x12'),auth[_0x26e4('0xa')](),controller[_0x26e4('0x16')]);router[_0x26e4('0x17')](_0x26e4('0xd'),auth[_0x26e4('0xa')](),controller[_0x26e4('0x18')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x26e4('0x19')]);router[_0x26e4('0x1a')](_0x26e4('0x11'),auth[_0x26e4('0xa')](),controller[_0x26e4('0x1b')]);router['delete'](_0x26e4('0x12'),auth[_0x26e4('0xa')](),controller[_0x26e4('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index e3caf56..05a29bb 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 _0x252f=['INTEGER','ENUM','roundrobin','STRING','sequelize','exports'];(function(_0x290694,_0x281935){var _0x5a0f2e=function(_0x58d7d4){while(--_0x58d7d4){_0x290694['push'](_0x290694['shift']());}};_0x5a0f2e(++_0x281935);}(_0x252f,0xd0));var _0xf252=function(_0x11435c,_0x436ccf){_0x11435c=_0x11435c-0x0;var _0x556167=_0x252f[_0x11435c];return _0x556167;};'use strict';var Sequelize=require(_0xf252('0x0'));module[_0xf252('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xf252('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf252('0x3')]('rrmemory','beepall',_0xf252('0x4'))},'description':{'type':Sequelize[_0xf252('0x5')]}}; \ No newline at end of file +var _0xdf0c=['rrmemory','beepall','roundrobin','sequelize','STRING','name','INTEGER','ENUM'];(function(_0x49434f,_0x316922){var _0x281a4e=function(_0x3fae4a){while(--_0x3fae4a){_0x49434f['push'](_0x49434f['shift']());}};_0x281a4e(++_0x316922);}(_0xdf0c,0x1ab));var _0xcdf0=function(_0x2b9e76,_0x467e25){_0x2b9e76=_0x2b9e76-0x0;var _0x4c014e=_0xdf0c[_0x2b9e76];return _0x4c014e;};'use strict';var Sequelize=require(_0xcdf0('0x0'));module['exports']={'name':{'type':Sequelize[_0xcdf0('0x1')],'unique':_0xcdf0('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xcdf0('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xcdf0('0x4')](_0xcdf0('0x5'),_0xcdf0('0x6'),_0xcdf0('0x7'))},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index ef39cfb..334aed8 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 _0x2256=['rimraf','fast-json-patch','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','localhost','socket.io-emitter','redis','./whatsappQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','set','apply','reject','save','update','destroy','then','get','error','stack','name','send','index','map','WhatsappQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','options','count','includeAll','include','findAll','params','merge','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','WhatsappQueues','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserWhatsappQueue','nolimit','order','pick','WhatsappQueueId','User','UserId','agent','whatsappPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','addTeams','ids','Team','Agents','voicePause','interface','flatMap','sequelize','forEach','emit','removeTeams','select','field','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','includes','all','compact','value','transaction','removeAgents','userWhatsappQueue:remove','addAgents','omit','userWhatsappQueue:save','isArray','getAgents'];(function(_0x437560,_0xc5d67f){var _0x278361=function(_0x4f3a0b){while(--_0x4f3a0b){_0x437560['push'](_0x437560['shift']());}};_0x278361(++_0xc5d67f);}(_0x2256,0x10c));var _0x6225=function(_0xad0322,_0x27f135){_0xad0322=_0xad0322-0x0;var _0x165b11=_0x2256[_0xad0322];return _0x165b11;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6225('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6225('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6225('0x2'));var util=require(_0x6225('0x3'));var path=require(_0x6225('0x4'));var sox=require(_0x6225('0x5'));var csv=require(_0x6225('0x6'));var ejs=require(_0x6225('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6225('0x8'));var crypto=require(_0x6225('0x9'));var jsforce=require(_0x6225('0xa'));var deskjs=require(_0x6225('0xb'));var toCsv=require('to-csv');var querystring=require(_0x6225('0xc'));var Papa=require(_0x6225('0xd'));var Redis=require(_0x6225('0xe'));var authService=require(_0x6225('0xf'));var qs=require(_0x6225('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6225('0x11'));var logger=require('../../config/logger')(_0x6225('0x12'));var utils=require(_0x6225('0x13'));var config=require(_0x6225('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x6225('0x15'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x6225('0x16'),'port':0x18eb});var socket=require(_0x6225('0x17'))(new Redis(config[_0x6225('0x18')]));require(_0x6225('0x19'))[_0x6225('0x1a')](socket);function respondWithStatusCode(_0x469c93,_0x1c661e){_0x1c661e=_0x1c661e||0xcc;return function(_0x3b50f0){if(_0x3b50f0){return _0x469c93[_0x6225('0x1b')](_0x1c661e);}return _0x469c93[_0x6225('0x1c')](_0x1c661e)[_0x6225('0x1d')]();};}function respondWithResult(_0x235bb0,_0x21d285){_0x21d285=_0x21d285||0xc8;return function(_0x4f5610){if(_0x4f5610){return _0x235bb0[_0x6225('0x1c')](_0x21d285)[_0x6225('0x1e')](_0x4f5610);}};}function respondWithFilteredResult(_0x128988,_0x2349a9){return function(_0x57b30c){if(_0x57b30c){var _0x57b940=typeof _0x2349a9[_0x6225('0x1f')]===_0x6225('0x20')&&typeof _0x2349a9[_0x6225('0x21')]===_0x6225('0x20');var _0x1c51dc=_0x57b30c['count'];var _0xc67a99=_0x57b940?0x0:_0x2349a9[_0x6225('0x1f')];var _0x46957b=_0x57b940?_0x57b30c['count']:_0x2349a9[_0x6225('0x1f')]+_0x2349a9['limit'];var _0x5fc600;if(_0x46957b>=_0x1c51dc){_0x46957b=_0x1c51dc;_0x5fc600=0xc8;}else{_0x5fc600=0xce;}_0x128988[_0x6225('0x1c')](_0x5fc600);return _0x128988[_0x6225('0x22')]('Content-Range',_0xc67a99+'-'+_0x46957b+'/'+_0x1c51dc)[_0x6225('0x1e')](_0x57b30c);}return null;};}function patchUpdates(_0x3f746b){return function(_0x2f0de5){try{jsonpatch[_0x6225('0x23')](_0x2f0de5,_0x3f746b,!![]);}catch(_0x3f772f){return BPromise[_0x6225('0x24')](_0x3f772f);}return _0x2f0de5[_0x6225('0x25')]();};}function saveUpdates(_0x143951,_0x4c99d4){return function(_0x22f3ad){if(_0x22f3ad){return _0x22f3ad[_0x6225('0x26')](_0x143951)['then'](function(_0xa84fb0){return _0xa84fb0;});}return null;};}function removeEntity(_0x34d6ec,_0x164c9f){return function(_0x22e911){if(_0x22e911){return _0x22e911[_0x6225('0x27')]()[_0x6225('0x28')](function(){var _0x146425=_0x22e911[_0x6225('0x29')]({'plain':!![]});var _0x2eae64='WhatsappQueues';return db['UserProfileResource']['destroy']({'where':{'type':_0x2eae64,'resourceId':_0x146425['id']}})[_0x6225('0x28')](function(){return _0x22e911;});})[_0x6225('0x28')](function(){_0x34d6ec[_0x6225('0x1c')](0xcc)[_0x6225('0x1d')]();});}};}function handleEntityNotFound(_0x474dcf,_0x587183){return function(_0xe09b97){if(!_0xe09b97){_0x474dcf[_0x6225('0x1b')](0x194);}return _0xe09b97;};}function handleError(_0x24a5f1,_0x3bb1c7){_0x3bb1c7=_0x3bb1c7||0x1f4;return function(_0x56ba01){logger[_0x6225('0x2a')](_0x56ba01[_0x6225('0x2b')]);if(_0x56ba01['name']){delete _0x56ba01[_0x6225('0x2c')];}_0x24a5f1[_0x6225('0x1c')](_0x3bb1c7)[_0x6225('0x2d')](_0x56ba01);};}exports[_0x6225('0x2e')]=function(_0x27bfe0,_0x39c71f){var _0x2ac8e1={},_0xe7e42a={},_0xad6cb2={'count':0x0,'rows':[]};var _0x490b43=_[_0x6225('0x2f')](db[_0x6225('0x30')][_0x6225('0x31')],function(_0x47ecfa){return{'name':_0x47ecfa[_0x6225('0x32')],'type':_0x47ecfa[_0x6225('0x33')][_0x6225('0x34')]};});_0xe7e42a[_0x6225('0x35')]=_['map'](_0x490b43,_0x6225('0x2c'));_0xe7e42a[_0x6225('0x36')]=_[_0x6225('0x37')](_0x27bfe0[_0x6225('0x36')]);_0xe7e42a[_0x6225('0x38')]=_[_0x6225('0x39')](_0xe7e42a[_0x6225('0x35')],_0xe7e42a[_0x6225('0x36')]);_0x2ac8e1[_0x6225('0x3a')]=_[_0x6225('0x39')](_0xe7e42a[_0x6225('0x35')],qs[_0x6225('0x3b')](_0x27bfe0['query'][_0x6225('0x3b')]));_0x2ac8e1[_0x6225('0x3a')]=_0x2ac8e1[_0x6225('0x3a')][_0x6225('0x3c')]?_0x2ac8e1[_0x6225('0x3a')]:_0xe7e42a[_0x6225('0x35')];if(!_0x27bfe0[_0x6225('0x36')][_0x6225('0x3d')]('nolimit')){_0x2ac8e1[_0x6225('0x21')]=qs[_0x6225('0x21')](_0x27bfe0[_0x6225('0x36')][_0x6225('0x21')]);_0x2ac8e1[_0x6225('0x1f')]=qs[_0x6225('0x1f')](_0x27bfe0[_0x6225('0x36')][_0x6225('0x1f')]);}_0x2ac8e1['order']=qs[_0x6225('0x3e')](_0x27bfe0[_0x6225('0x36')]['sort']);_0x2ac8e1[_0x6225('0x3f')]=qs[_0x6225('0x38')](_['pick'](_0x27bfe0[_0x6225('0x36')],_0xe7e42a[_0x6225('0x38')]),_0x490b43);if(_0x27bfe0['query']['filter']){_0x2ac8e1[_0x6225('0x3f')]=_['merge'](_0x2ac8e1[_0x6225('0x3f')],{'$or':_[_0x6225('0x2f')](_0x490b43,function(_0x2d27de){if(_0x2d27de['type']!=='VIRTUAL'){var _0x3ef872={};_0x3ef872[_0x2d27de[_0x6225('0x2c')]]={'$like':'%'+_0x27bfe0[_0x6225('0x36')][_0x6225('0x40')]+'%'};return _0x3ef872;}})});}_0x2ac8e1=_['merge']({},_0x2ac8e1,_0x27bfe0[_0x6225('0x41')]);var _0x344900={'where':_0x2ac8e1[_0x6225('0x3f')]};return db[_0x6225('0x30')][_0x6225('0x42')](_0x344900)['then'](function(_0x3c29ff){_0xad6cb2['count']=_0x3c29ff;if(_0x27bfe0[_0x6225('0x36')][_0x6225('0x43')]){_0x2ac8e1[_0x6225('0x44')]=[{'all':!![]}];}return db[_0x6225('0x30')][_0x6225('0x45')](_0x2ac8e1);})[_0x6225('0x28')](function(_0x43083e){_0xad6cb2['rows']=_0x43083e;return _0xad6cb2;})[_0x6225('0x28')](respondWithFilteredResult(_0x39c71f,_0x2ac8e1))['catch'](handleError(_0x39c71f,null));};exports['show']=function(_0x20291,_0x45d345){var _0x508ec9={'raw':!![],'where':{'id':_0x20291[_0x6225('0x46')]['id']}},_0x565b35={};_0x565b35[_0x6225('0x35')]=_['keys'](db['WhatsappQueue'][_0x6225('0x31')]);_0x565b35[_0x6225('0x36')]=_['keys'](_0x20291['query']);_0x565b35[_0x6225('0x38')]=_[_0x6225('0x39')](_0x565b35['model'],_0x565b35[_0x6225('0x36')]);_0x508ec9[_0x6225('0x3a')]=_[_0x6225('0x39')](_0x565b35[_0x6225('0x35')],qs[_0x6225('0x3b')](_0x20291[_0x6225('0x36')]['fields']));_0x508ec9['attributes']=_0x508ec9[_0x6225('0x3a')][_0x6225('0x3c')]?_0x508ec9[_0x6225('0x3a')]:_0x565b35[_0x6225('0x35')];if(_0x20291[_0x6225('0x36')]['includeAll']){_0x508ec9[_0x6225('0x44')]=[{'all':!![]}];}_0x508ec9=_[_0x6225('0x47')]({},_0x508ec9,_0x20291['options']);return db[_0x6225('0x30')][_0x6225('0x48')](_0x508ec9)['then'](handleEntityNotFound(_0x45d345,null))[_0x6225('0x28')](respondWithResult(_0x45d345,null))[_0x6225('0x49')](handleError(_0x45d345,null));};exports[_0x6225('0x4a')]=function(_0x387690,_0x5452a9){return db['WhatsappQueue'][_0x6225('0x4a')](_0x387690[_0x6225('0x4b')],{})[_0x6225('0x28')](function(_0x5b427c){var _0x3159f3=_0x387690['user'][_0x6225('0x29')]({'plain':!![]});if(!_0x3159f3)throw new Error(_0x6225('0x4c'));if(_0x3159f3[_0x6225('0x4d')]==='user'){var _0x50ab56=_0x5b427c[_0x6225('0x29')]({'plain':!![]});var _0x5b5c25=_0x6225('0x4e');return db[_0x6225('0x4f')]['find']({'where':{'name':_0x5b5c25,'userProfileId':_0x3159f3[_0x6225('0x50')]},'raw':!![]})[_0x6225('0x28')](function(_0x2463f8){if(_0x2463f8&&_0x2463f8['autoAssociation']===0x0){return db[_0x6225('0x51')]['create']({'name':_0x50ab56['name'],'resourceId':_0x50ab56['id'],'type':_0x2463f8[_0x6225('0x2c')],'sectionId':_0x2463f8['id']},{})[_0x6225('0x28')](function(){return _0x5b427c;});}else{return _0x5b427c;}})['catch'](function(_0x35878a){logger[_0x6225('0x2a')](_0x6225('0x52'),_0x35878a);throw _0x35878a;});}return _0x5b427c;})['then'](respondWithResult(_0x5452a9,0xc9))['catch'](handleError(_0x5452a9,null));};exports[_0x6225('0x26')]=function(_0x104d45,_0x58476c){if(_0x104d45['body']['id']){delete _0x104d45[_0x6225('0x4b')]['id'];}return db[_0x6225('0x30')][_0x6225('0x48')]({'where':{'id':_0x104d45[_0x6225('0x46')]['id']}})['then'](handleEntityNotFound(_0x58476c,null))[_0x6225('0x28')](saveUpdates(_0x104d45[_0x6225('0x4b')],null))['then'](respondWithResult(_0x58476c,null))[_0x6225('0x49')](handleError(_0x58476c,null));};exports[_0x6225('0x27')]=function(_0x1141f8,_0x2f0f41){return db[_0x6225('0x30')][_0x6225('0x48')]({'where':{'id':_0x1141f8[_0x6225('0x46')]['id']}})[_0x6225('0x28')](handleEntityNotFound(_0x2f0f41,null))['then'](removeEntity(_0x2f0f41,null))[_0x6225('0x49')](handleError(_0x2f0f41,null));};exports[_0x6225('0x53')]=function(_0x37bc67,_0x2d6c2a){return db[_0x6225('0x30')][_0x6225('0x53')]()[_0x6225('0x28')](respondWithResult(_0x2d6c2a,null))[_0x6225('0x49')](handleError(_0x2d6c2a,null));};exports['getMembers']=function(_0x330f63,_0x51c019,_0x301467){var _0x33bca9={'raw':!![],'where':{}},_0x79ef1d={},_0x2dfd9f;return db[_0x6225('0x30')][_0x6225('0x54')]({'where':{'id':_0x330f63[_0x6225('0x46')]['id']}})['then'](handleEntityNotFound(_0x51c019,null))[_0x6225('0x28')](function(_0x29be94){if(_0x29be94){_0x2dfd9f=_0x29be94[_0x6225('0x29')]({'plain':!![]});_0x79ef1d[_0x6225('0x35')]=_['keys'](db[_0x6225('0x55')][_0x6225('0x31')]);_0x79ef1d[_0x6225('0x36')]=_[_0x6225('0x37')](_0x330f63[_0x6225('0x36')]);_0x79ef1d['filters']=_[_0x6225('0x39')](_0x79ef1d[_0x6225('0x35')],_0x79ef1d['query']);_0x33bca9['attributes']=_['intersection'](_0x79ef1d[_0x6225('0x35')],qs['fields'](_0x330f63[_0x6225('0x36')][_0x6225('0x3b')]));_0x33bca9[_0x6225('0x3a')]=_0x33bca9['attributes'][_0x6225('0x3c')]?_0x33bca9['attributes']:_0x79ef1d[_0x6225('0x35')];if(!_0x330f63[_0x6225('0x36')][_0x6225('0x3d')](_0x6225('0x56'))){_0x33bca9['limit']=qs['limit'](_0x330f63['query']['limit']);_0x33bca9[_0x6225('0x1f')]=qs[_0x6225('0x1f')](_0x330f63['query']['offset']);}_0x33bca9[_0x6225('0x57')]=qs[_0x6225('0x3e')](_0x330f63[_0x6225('0x36')][_0x6225('0x3e')]);_0x33bca9[_0x6225('0x3f')]=qs['filters'](_[_0x6225('0x58')](_0x330f63[_0x6225('0x36')],_0x79ef1d['filters']));_0x33bca9[_0x6225('0x3f')][_0x6225('0x59')]=_0x29be94['id'];if(_0x330f63[_0x6225('0x36')][_0x6225('0x40')]){_0x33bca9['where']=_[_0x6225('0x47')](_0x33bca9['where'],{'$or':_[_0x6225('0x2f')](_0x33bca9['attributes'],function(_0x49a37e){var _0x4f6e5e={};_0x4f6e5e[_0x49a37e]={'$like':'%'+_0x330f63['query'][_0x6225('0x40')]+'%'};return _0x4f6e5e;})});}_0x33bca9=_['merge']({},_0x33bca9,_0x330f63['options']);return db[_0x6225('0x55')]['findAll'](_0x33bca9);}})[_0x6225('0x28')](function(_0xd44bd6){if(_0xd44bd6){return db[_0x6225('0x5a')]['findAndCountAll']({'where':{'id':_['map'](_0xd44bd6,_0x6225('0x5b')),'role':_0x6225('0x5c')},'attributes':['id',_0x6225('0x2c'),_0x6225('0x5d'),'updatedAt',_0x6225('0x5e')]});}})[_0x6225('0x28')](function(_0x6555c){if(_0x6555c){return{'count':_0x6555c[_0x6225('0x42')],'rows':_['map'](_0x6555c['rows'],function(_0x234042){return{'membername':_0x234042[_0x6225('0x2c')],'UserId':_0x234042['id'],'queue_name':_0x2dfd9f['name'],'WhatsappQueueId':_0x2dfd9f['id'],'interface':util[_0x6225('0x5f')](_0x6225('0x60'),_0x6225('0x61'),_0x234042[_0x6225('0x2c')]),'penalty':0x0,'paused':_0x234042['whatsappPause'],'createdAt':_0x234042[_0x6225('0x5e')],'updatedAt':_0x234042[_0x6225('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6225('0x28')](respondWithFilteredResult(_0x51c019,_0x33bca9))[_0x6225('0x49')](handleError(_0x51c019,null));};exports[_0x6225('0x63')]=function(_0x58170a,_0x4528b5,_0x374148){var _0x28c6c3={};var _0x395fb8={};var _0x382924;var _0x9e3c15;return db[_0x6225('0x30')][_0x6225('0x54')]({'where':{'id':_0x58170a[_0x6225('0x46')]['id']}})[_0x6225('0x28')](handleEntityNotFound(_0x4528b5,null))[_0x6225('0x28')](function(_0x23472b){if(_0x23472b){_0x382924=_0x23472b;_0x395fb8[_0x6225('0x35')]=_[_0x6225('0x37')](db['Team']['rawAttributes']);_0x395fb8['query']=_[_0x6225('0x37')](_0x58170a['query']);_0x395fb8[_0x6225('0x38')]=_[_0x6225('0x39')](_0x395fb8['model'],_0x395fb8[_0x6225('0x36')]);_0x28c6c3[_0x6225('0x3a')]=_[_0x6225('0x39')](_0x395fb8[_0x6225('0x35')],qs[_0x6225('0x3b')](_0x58170a[_0x6225('0x36')]['fields']));_0x28c6c3[_0x6225('0x3a')]=_0x28c6c3['attributes'][_0x6225('0x3c')]?_0x28c6c3[_0x6225('0x3a')]:_0x395fb8[_0x6225('0x35')];_0x28c6c3[_0x6225('0x57')]=qs[_0x6225('0x3e')](_0x58170a[_0x6225('0x36')][_0x6225('0x3e')]);_0x28c6c3[_0x6225('0x3f')]=qs['filters'](_[_0x6225('0x58')](_0x58170a[_0x6225('0x36')],_0x395fb8[_0x6225('0x38')]));if(_0x58170a[_0x6225('0x36')]['filter']){_0x28c6c3[_0x6225('0x3f')]=_[_0x6225('0x47')](_0x28c6c3[_0x6225('0x3f')],{'$or':_['map'](_0x28c6c3['attributes'],function(_0x431ef4){var _0x23c66b={};_0x23c66b[_0x431ef4]={'$like':'%'+_0x58170a[_0x6225('0x36')]['filter']+'%'};return _0x23c66b;})});}_0x28c6c3=_[_0x6225('0x47')]({},_0x28c6c3,_0x58170a['options']);return _0x382924[_0x6225('0x63')](_0x28c6c3);}})['then'](function(_0x268498){if(_0x268498){_0x9e3c15=_0x268498[_0x6225('0x3c')];if(!_0x58170a[_0x6225('0x36')][_0x6225('0x3d')](_0x6225('0x56'))){_0x28c6c3[_0x6225('0x21')]=qs[_0x6225('0x21')](_0x58170a['query']['limit']);_0x28c6c3[_0x6225('0x1f')]=qs[_0x6225('0x1f')](_0x58170a[_0x6225('0x36')]['offset']);}return _0x382924[_0x6225('0x63')](_0x28c6c3);}})[_0x6225('0x28')](function(_0x42652d){if(_0x42652d){return _0x42652d?{'count':_0x9e3c15,'rows':_0x42652d}:null;}})[_0x6225('0x28')](respondWithResult(_0x4528b5,null))[_0x6225('0x49')](handleError(_0x4528b5,null));};exports[_0x6225('0x64')]=function(_0x19dfc2,_0x2bf112,_0x52e07d){var _0x124cb9=_0x19dfc2[_0x6225('0x4b')][_0x6225('0x65')];return db[_0x6225('0x66')]['findAll']({'where':{'id':_0x124cb9},'attributes':['id'],'include':[{'model':db['User'],'as':_0x6225('0x67'),'attributes':['id','name','online',_0x6225('0x68'),_0x6225('0x69')],'raw':!![]}]})[_0x6225('0x28')](function(_0x5516c8){if(_0x5516c8){var _0x13fef9=_[_0x6225('0x6a')](_0x5516c8,function(_0x27e2f7){var _0x3cc2e3=_0x27e2f7[_0x6225('0x29')]({'plain':!![]});return _0x3cc2e3['Agents'];});return db[_0x6225('0x30')][_0x6225('0x48')]({'where':{'id':_0x19dfc2[_0x6225('0x46')]['id']}})['then'](function(_0x339810){return db[_0x6225('0x6b')]['transaction'](function(_0x214d8b){return _0x339810[_0x6225('0x64')](_0x124cb9,{'transaction':_0x214d8b})[_0x6225('0x28')](function(){return BPromise['each'](_0x13fef9,function(_0x507561){return db['UserWhatsappQueue']['findOrCreate']({'where':{'UserId':_0x507561['id'],'WhatsappQueueId':_0x19dfc2[_0x6225('0x46')]['id']},'transaction':_0x214d8b});});})[_0x6225('0x28')](function(){_0x13fef9[_0x6225('0x6c')](function(_0x36d2fd){socket[_0x6225('0x6d')]('userWhatsappQueue:save',{'UserId':_0x36d2fd['id'],'WhatsappQueueId':_0x339810['id']});});});});});}})[_0x6225('0x28')](respondWithStatusCode(_0x2bf112,null))[_0x6225('0x49')](handleError(_0x2bf112,null));};exports[_0x6225('0x6e')]=function(_0x2de91a,_0x3c9518,_0x177dec){return db[_0x6225('0x66')][_0x6225('0x45')]({'where':{'id':_0x2de91a['query'][_0x6225('0x65')]},'attributes':['id'],'include':[{'model':db[_0x6225('0x5a')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x6225('0x28')](handleEntityNotFound(_0x3c9518,null))[_0x6225('0x28')](function(_0x49eab5){var _0x15ed2f=_[_0x6225('0x2f')](_0x49eab5,'id');var _0x5ebcc3=[];var _0x418349=[];var _0x5aae54=squel[_0x6225('0x6f')]();_0x5aae54[_0x6225('0x70')](_0x6225('0x71'))[_0x6225('0x72')]('team_has_whatsapp_queues','tq')['join'](_0x6225('0x73'),'ut',_0x6225('0x74'))[_0x6225('0x3f')]('WhatsappQueueId\x20=\x20?',_0x2de91a[_0x6225('0x46')]['id']);for(var _0x49b272=0x0;_0x49b272<_0x49eab5[_0x6225('0x3c')];_0x49b272+=0x1){let _0x3d673f=_0x49eab5[_0x49b272];for(var _0x4335ca=0x0;_0x4335ca<_0x3d673f[_0x6225('0x67')][_0x6225('0x3c')];_0x4335ca+=0x1){let _0x59d82e=_0x3d673f[_0x6225('0x67')][_0x4335ca];var _0x511b49=_0x5aae54[_0x6225('0x75')]();_0x511b49[_0x6225('0x3f')](_0x6225('0x76'),_0x59d82e['id']);_0x418349['push'](db[_0x6225('0x6b')][_0x6225('0x36')](_0x511b49[_0x6225('0x77')](),{'type':db[_0x6225('0x6b')][_0x6225('0x78')][_0x6225('0x79')]})[_0x6225('0x28')](function(_0x489eb3){if(_0x489eb3[_0x6225('0x3c')]===0x1){return _0x59d82e['id'];}else{var _0x45f6d2=_['every'](_['map'](_0x489eb3,'TeamId'),function(_0x293517){return _[_0x6225('0x7a')](_0x15ed2f,_0x293517);});if(_0x45f6d2){return _0x59d82e['id'];}}}));}}return BPromise[_0x6225('0x7b')](_0x418349)[_0x6225('0x28')](function(_0x2e1cb9){_0x5ebcc3=_(_0x5ebcc3)['union'](_0x2e1cb9)[_0x6225('0x7c')]()[_0x6225('0x7d')]();return db['WhatsappQueue'][_0x6225('0x48')]({'where':{'id':_0x2de91a['params']['id']}})[_0x6225('0x28')](function(_0x3bd644){return db['sequelize'][_0x6225('0x7e')](function(_0x21fe64){return _0x3bd644[_0x6225('0x6e')](_0x2de91a['query'][_0x6225('0x65')],{'transaction':_0x21fe64})[_0x6225('0x28')](function(){if(!_['isEmpty'](_0x5ebcc3)){return _0x3bd644[_0x6225('0x7f')](_0x5ebcc3,{'transaction':_0x21fe64});}})['then'](function(){_0x5ebcc3[_0x6225('0x6c')](function(_0x2530f7){socket[_0x6225('0x6d')](_0x6225('0x80'),{'UserId':_0x2530f7,'WhatsappQueueId':_0x3bd644['id']});});});});});});})[_0x6225('0x28')](respondWithStatusCode(_0x3c9518,null))['catch'](handleError(_0x3c9518,null));};exports[_0x6225('0x81')]=function(_0x348689,_0x15406e,_0x57f184){return db[_0x6225('0x30')][_0x6225('0x48')]({'where':{'id':_0x348689[_0x6225('0x46')]['id']}})[_0x6225('0x28')](handleEntityNotFound(_0x15406e,null))[_0x6225('0x28')](function(_0x2d0680){if(_0x2d0680){return _0x2d0680[_0x6225('0x81')](_0x348689[_0x6225('0x4b')][_0x6225('0x65')],_[_0x6225('0x82')](_0x348689[_0x6225('0x4b')],['ids','id'])||{})['spread'](function(_0x468834){for(var _0x23985e=0x0;_0x23985e<_0x348689[_0x6225('0x4b')]['ids']['length'];_0x23985e+=0x1){socket['emit'](_0x6225('0x83'),{'UserId':Number(_0x348689['body']['ids'][_0x23985e]),'WhatsappQueueId':Number(_0x348689[_0x6225('0x46')]['id'])});}return _0x468834;});}})[_0x6225('0x28')](respondWithResult(_0x15406e,null))[_0x6225('0x49')](handleError(_0x15406e,null));};exports[_0x6225('0x7f')]=function(_0x45cfb7,_0x338500,_0x5cf922){return db[_0x6225('0x30')][_0x6225('0x48')]({'where':{'id':_0x45cfb7['params']['id']}})[_0x6225('0x28')](handleEntityNotFound(_0x338500,null))[_0x6225('0x28')](function(_0x45efda){if(_0x45efda){return _0x45efda[_0x6225('0x7f')](_0x45cfb7[_0x6225('0x36')][_0x6225('0x65')])[_0x6225('0x28')](function(){if(_[_0x6225('0x84')](_0x45cfb7[_0x6225('0x36')][_0x6225('0x65')])){for(var _0x413652=0x0;_0x413652<_0x45cfb7[_0x6225('0x36')][_0x6225('0x65')]['length'];_0x413652+=0x1){socket[_0x6225('0x6d')](_0x6225('0x80'),{'UserId':Number(_0x45cfb7[_0x6225('0x36')][_0x6225('0x65')][_0x413652]),'WhatsappQueueId':Number(_0x45cfb7['params']['id'])});}}else{socket[_0x6225('0x6d')](_0x6225('0x80'),{'UserId':Number(_0x45cfb7[_0x6225('0x36')]['ids']),'WhatsappQueueId':Number(_0x45cfb7[_0x6225('0x46')]['id'])});}});}})[_0x6225('0x28')](respondWithStatusCode(_0x338500,null))['catch'](handleError(_0x338500,null));};exports[_0x6225('0x85')]=function(_0x354f51,_0x52ea81,_0x1c0e0d){var _0xb88b41={};var _0x74465b={};var _0x5c8db3;var _0x3dd265;return db[_0x6225('0x30')]['findOne']({'where':{'id':_0x354f51['params']['id']}})[_0x6225('0x28')](handleEntityNotFound(_0x52ea81,null))[_0x6225('0x28')](function(_0x5f18b1){if(_0x5f18b1){_0x5c8db3=_0x5f18b1;_0x74465b['model']=_[_0x6225('0x37')](db[_0x6225('0x5a')][_0x6225('0x31')]);_0x74465b[_0x6225('0x36')]=_[_0x6225('0x37')](_0x354f51['query']);_0x74465b['filters']=_[_0x6225('0x39')](_0x74465b[_0x6225('0x35')],_0x74465b['query']);_0xb88b41[_0x6225('0x3a')]=_[_0x6225('0x39')](_0x74465b[_0x6225('0x35')],qs['fields'](_0x354f51[_0x6225('0x36')][_0x6225('0x3b')]));_0xb88b41[_0x6225('0x3a')]=_0xb88b41[_0x6225('0x3a')]['length']?_0xb88b41['attributes']:_0x74465b[_0x6225('0x35')];_0xb88b41['order']=qs[_0x6225('0x3e')](_0x354f51['query'][_0x6225('0x3e')]);_0xb88b41[_0x6225('0x3f')]=qs[_0x6225('0x38')](_[_0x6225('0x58')](_0x354f51[_0x6225('0x36')],_0x74465b['filters']));if(_0x354f51['query'][_0x6225('0x40')]){_0xb88b41['where']=_[_0x6225('0x47')](_0xb88b41[_0x6225('0x3f')],{'$or':_['map'](_0xb88b41[_0x6225('0x3a')],function(_0x53644e){var _0x2ffe5f={};_0x2ffe5f[_0x53644e]={'$like':'%'+_0x354f51['query']['filter']+'%'};return _0x2ffe5f;})});}_0xb88b41=_[_0x6225('0x47')]({},_0xb88b41,_0x354f51['options']);return _0x5c8db3[_0x6225('0x85')](_0xb88b41);}})[_0x6225('0x28')](function(_0x225d87){if(_0x225d87){_0x3dd265=_0x225d87[_0x6225('0x3c')];if(!_0x354f51['query'][_0x6225('0x3d')](_0x6225('0x56'))){_0xb88b41['limit']=qs[_0x6225('0x21')](_0x354f51['query'][_0x6225('0x21')]);_0xb88b41[_0x6225('0x1f')]=qs['offset'](_0x354f51[_0x6225('0x36')][_0x6225('0x1f')]);}return _0x5c8db3[_0x6225('0x85')](_0xb88b41);}})[_0x6225('0x28')](function(_0xf8e371){if(_0xf8e371){return _0xf8e371?{'count':_0x3dd265,'rows':_0xf8e371}:null;}})[_0x6225('0x28')](respondWithResult(_0x52ea81,null))[_0x6225('0x49')](handleError(_0x52ea81,null));}; \ No newline at end of file +var _0xb1b1=['papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','get','WhatsappQueues','then','error','stack','name','send','index','map','WhatsappQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','params','length','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserWhatsappQueue','WhatsappQueueId','User','findAndCountAll','UserId','agent','updatedAt','format','%s/%s','whatsappPause','createdAt','Team','getTeams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','ids','removeAgents','addAgents','omit','isArray','userWhatsappQueue:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x222a62,_0x50059a){var _0x1a8852=function(_0x488e41){while(--_0x488e41){_0x222a62['push'](_0x222a62['shift']());}};_0x1a8852(++_0x50059a);}(_0xb1b1,0x7d));var _0x1b1b=function(_0x148bf9,_0x1622e7){_0x148bf9=_0x148bf9-0x0;var _0x2ebaa0=_0xb1b1[_0x148bf9];return _0x2ebaa0;};'use strict';var emlformat=require(_0x1b1b('0x0'));var rimraf=require(_0x1b1b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1b1b('0x2'));var rp=require(_0x1b1b('0x3'));var moment=require(_0x1b1b('0x4'));var BPromise=require(_0x1b1b('0x5'));var Mustache=require(_0x1b1b('0x6'));var util=require(_0x1b1b('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x1b1b('0x8'));var ejs=require(_0x1b1b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1b1b('0xa'));var squel=require(_0x1b1b('0xb'));var crypto=require(_0x1b1b('0xc'));var jsforce=require(_0x1b1b('0xd'));var deskjs=require(_0x1b1b('0xe'));var toCsv=require(_0x1b1b('0x8'));var querystring=require('querystring');var Papa=require(_0x1b1b('0xf'));var Redis=require(_0x1b1b('0x10'));var authService=require(_0x1b1b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x1b1b('0x12'));var hardwareService=require(_0x1b1b('0x13'));var logger=require(_0x1b1b('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1b1b('0x15'));var db=require('../../mysqldb')['db'];config[_0x1b1b('0x16')]=_[_0x1b1b('0x17')](config[_0x1b1b('0x16')],{'host':_0x1b1b('0x18'),'port':0x18eb});var socket=require(_0x1b1b('0x19'))(new Redis(config['redis']));require('./whatsappQueue.socket')['register'](socket);function respondWithStatusCode(_0xb5f216,_0x3d7739){_0x3d7739=_0x3d7739||0xcc;return function(_0x3773d8){if(_0x3773d8){return _0xb5f216[_0x1b1b('0x1a')](_0x3d7739);}return _0xb5f216[_0x1b1b('0x1b')](_0x3d7739)[_0x1b1b('0x1c')]();};}function respondWithResult(_0x17697d,_0x39ec03){_0x39ec03=_0x39ec03||0xc8;return function(_0x520334){if(_0x520334){return _0x17697d[_0x1b1b('0x1b')](_0x39ec03)[_0x1b1b('0x1d')](_0x520334);}};}function respondWithFilteredResult(_0x22da7c,_0x2b07d5){return function(_0x166788){if(_0x166788){var _0x45aa61=typeof _0x2b07d5[_0x1b1b('0x1e')]===_0x1b1b('0x1f')&&typeof _0x2b07d5[_0x1b1b('0x20')]===_0x1b1b('0x1f');var _0xbb24c9=_0x166788[_0x1b1b('0x21')];var _0x2d4253=_0x45aa61?0x0:_0x2b07d5[_0x1b1b('0x1e')];var _0x107038=_0x45aa61?_0x166788[_0x1b1b('0x21')]:_0x2b07d5[_0x1b1b('0x1e')]+_0x2b07d5['limit'];var _0x4816f0;if(_0x107038>=_0xbb24c9){_0x107038=_0xbb24c9;_0x4816f0=0xc8;}else{_0x4816f0=0xce;}_0x22da7c[_0x1b1b('0x1b')](_0x4816f0);return _0x22da7c['set'](_0x1b1b('0x22'),_0x2d4253+'-'+_0x107038+'/'+_0xbb24c9)[_0x1b1b('0x1d')](_0x166788);}return null;};}function patchUpdates(_0x2128df){return function(_0x50bfb6){try{jsonpatch[_0x1b1b('0x23')](_0x50bfb6,_0x2128df,!![]);}catch(_0x11dce0){return BPromise[_0x1b1b('0x24')](_0x11dce0);}return _0x50bfb6[_0x1b1b('0x25')]();};}function saveUpdates(_0x20202b,_0x34eb7b){return function(_0x262dc8){if(_0x262dc8){return _0x262dc8[_0x1b1b('0x26')](_0x20202b)['then'](function(_0x5444ea){return _0x5444ea;});}return null;};}function removeEntity(_0x33d74a,_0x101ad3){return function(_0x1e56a5){if(_0x1e56a5){return _0x1e56a5[_0x1b1b('0x27')]()['then'](function(){var _0x19ef4a=_0x1e56a5[_0x1b1b('0x28')]({'plain':!![]});var _0x20e267=_0x1b1b('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0x20e267,'resourceId':_0x19ef4a['id']}})[_0x1b1b('0x2a')](function(){return _0x1e56a5;});})[_0x1b1b('0x2a')](function(){_0x33d74a[_0x1b1b('0x1b')](0xcc)[_0x1b1b('0x1c')]();});}};}function handleEntityNotFound(_0x4bf2c7,_0x28cacb){return function(_0x352660){if(!_0x352660){_0x4bf2c7[_0x1b1b('0x1a')](0x194);}return _0x352660;};}function handleError(_0x25bf10,_0x4c3582){_0x4c3582=_0x4c3582||0x1f4;return function(_0x149436){logger[_0x1b1b('0x2b')](_0x149436[_0x1b1b('0x2c')]);if(_0x149436['name']){delete _0x149436[_0x1b1b('0x2d')];}_0x25bf10[_0x1b1b('0x1b')](_0x4c3582)[_0x1b1b('0x2e')](_0x149436);};}exports[_0x1b1b('0x2f')]=function(_0x407751,_0x42c5fd){var _0x438390={},_0x584c60={},_0x3c9dbd={'count':0x0,'rows':[]};var _0x30a30a=_[_0x1b1b('0x30')](db[_0x1b1b('0x31')][_0x1b1b('0x32')],function(_0x52fbef){return{'name':_0x52fbef[_0x1b1b('0x33')],'type':_0x52fbef[_0x1b1b('0x34')][_0x1b1b('0x35')]};});_0x584c60[_0x1b1b('0x36')]=_[_0x1b1b('0x30')](_0x30a30a,'name');_0x584c60[_0x1b1b('0x37')]=_[_0x1b1b('0x38')](_0x407751['query']);_0x584c60[_0x1b1b('0x39')]=_['intersection'](_0x584c60['model'],_0x584c60[_0x1b1b('0x37')]);_0x438390['attributes']=_[_0x1b1b('0x3a')](_0x584c60[_0x1b1b('0x36')],qs['fields'](_0x407751[_0x1b1b('0x37')][_0x1b1b('0x3b')]));_0x438390[_0x1b1b('0x3c')]=_0x438390['attributes']['length']?_0x438390['attributes']:_0x584c60[_0x1b1b('0x36')];if(!_0x407751[_0x1b1b('0x37')][_0x1b1b('0x3d')](_0x1b1b('0x3e'))){_0x438390[_0x1b1b('0x20')]=qs[_0x1b1b('0x20')](_0x407751['query']['limit']);_0x438390[_0x1b1b('0x1e')]=qs[_0x1b1b('0x1e')](_0x407751[_0x1b1b('0x37')][_0x1b1b('0x1e')]);}_0x438390[_0x1b1b('0x3f')]=qs[_0x1b1b('0x40')](_0x407751[_0x1b1b('0x37')][_0x1b1b('0x40')]);_0x438390[_0x1b1b('0x41')]=qs[_0x1b1b('0x39')](_[_0x1b1b('0x42')](_0x407751[_0x1b1b('0x37')],_0x584c60[_0x1b1b('0x39')]),_0x30a30a);if(_0x407751[_0x1b1b('0x37')][_0x1b1b('0x43')]){_0x438390[_0x1b1b('0x41')]=_[_0x1b1b('0x44')](_0x438390['where'],{'$or':_[_0x1b1b('0x30')](_0x30a30a,function(_0x5437b2){if(_0x5437b2[_0x1b1b('0x34')]!==_0x1b1b('0x45')){var _0x4553ca={};_0x4553ca[_0x5437b2[_0x1b1b('0x2d')]]={'$like':'%'+_0x407751['query'][_0x1b1b('0x43')]+'%'};return _0x4553ca;}})});}_0x438390=_[_0x1b1b('0x44')]({},_0x438390,_0x407751[_0x1b1b('0x46')]);var _0x44b1f2={'where':_0x438390[_0x1b1b('0x41')]};return db[_0x1b1b('0x31')][_0x1b1b('0x21')](_0x44b1f2)['then'](function(_0x3e2e13){_0x3c9dbd['count']=_0x3e2e13;if(_0x407751[_0x1b1b('0x37')]['includeAll']){_0x438390['include']=[{'all':!![]}];}return db[_0x1b1b('0x31')][_0x1b1b('0x47')](_0x438390);})['then'](function(_0xd471ac){_0x3c9dbd[_0x1b1b('0x48')]=_0xd471ac;return _0x3c9dbd;})[_0x1b1b('0x2a')](respondWithFilteredResult(_0x42c5fd,_0x438390))[_0x1b1b('0x49')](handleError(_0x42c5fd,null));};exports['show']=function(_0x3a549a,_0x3f3284){var _0x143f80={'raw':!![],'where':{'id':_0x3a549a[_0x1b1b('0x4a')]['id']}},_0x5679cd={};_0x5679cd[_0x1b1b('0x36')]=_[_0x1b1b('0x38')](db[_0x1b1b('0x31')]['rawAttributes']);_0x5679cd['query']=_['keys'](_0x3a549a[_0x1b1b('0x37')]);_0x5679cd[_0x1b1b('0x39')]=_['intersection'](_0x5679cd[_0x1b1b('0x36')],_0x5679cd[_0x1b1b('0x37')]);_0x143f80[_0x1b1b('0x3c')]=_[_0x1b1b('0x3a')](_0x5679cd['model'],qs[_0x1b1b('0x3b')](_0x3a549a[_0x1b1b('0x37')][_0x1b1b('0x3b')]));_0x143f80[_0x1b1b('0x3c')]=_0x143f80[_0x1b1b('0x3c')][_0x1b1b('0x4b')]?_0x143f80[_0x1b1b('0x3c')]:_0x5679cd['model'];if(_0x3a549a[_0x1b1b('0x37')][_0x1b1b('0x4c')]){_0x143f80[_0x1b1b('0x4d')]=[{'all':!![]}];}_0x143f80=_['merge']({},_0x143f80,_0x3a549a['options']);return db[_0x1b1b('0x31')][_0x1b1b('0x4e')](_0x143f80)[_0x1b1b('0x2a')](handleEntityNotFound(_0x3f3284,null))[_0x1b1b('0x2a')](respondWithResult(_0x3f3284,null))['catch'](handleError(_0x3f3284,null));};exports[_0x1b1b('0x4f')]=function(_0x18e276,_0x521bbb){return db[_0x1b1b('0x31')][_0x1b1b('0x4f')](_0x18e276[_0x1b1b('0x50')],{})[_0x1b1b('0x2a')](function(_0x44006e){var _0x5db5ef=_0x18e276[_0x1b1b('0x51')][_0x1b1b('0x28')]({'plain':!![]});if(!_0x5db5ef)throw new Error(_0x1b1b('0x52'));if(_0x5db5ef[_0x1b1b('0x53')]===_0x1b1b('0x51')){var _0x1d5591=_0x44006e[_0x1b1b('0x28')]({'plain':!![]});var _0x5875fc=_0x1b1b('0x29');return db[_0x1b1b('0x54')][_0x1b1b('0x4e')]({'where':{'name':_0x5875fc,'userProfileId':_0x5db5ef[_0x1b1b('0x55')]},'raw':!![]})[_0x1b1b('0x2a')](function(_0x1e8aa0){if(_0x1e8aa0&&_0x1e8aa0[_0x1b1b('0x56')]===0x0){return db['UserProfileResource'][_0x1b1b('0x4f')]({'name':_0x1d5591[_0x1b1b('0x2d')],'resourceId':_0x1d5591['id'],'type':_0x1e8aa0[_0x1b1b('0x2d')],'sectionId':_0x1e8aa0['id']},{})[_0x1b1b('0x2a')](function(){return _0x44006e;});}else{return _0x44006e;}})[_0x1b1b('0x49')](function(_0x1d17a7){logger[_0x1b1b('0x2b')](_0x1b1b('0x57'),_0x1d17a7);throw _0x1d17a7;});}return _0x44006e;})['then'](respondWithResult(_0x521bbb,0xc9))[_0x1b1b('0x49')](handleError(_0x521bbb,null));};exports['update']=function(_0x247b64,_0x28008c){if(_0x247b64['body']['id']){delete _0x247b64['body']['id'];}return db[_0x1b1b('0x31')][_0x1b1b('0x4e')]({'where':{'id':_0x247b64[_0x1b1b('0x4a')]['id']}})[_0x1b1b('0x2a')](handleEntityNotFound(_0x28008c,null))['then'](saveUpdates(_0x247b64['body'],null))['then'](respondWithResult(_0x28008c,null))[_0x1b1b('0x49')](handleError(_0x28008c,null));};exports[_0x1b1b('0x27')]=function(_0x5cd694,_0x318c48){return db['WhatsappQueue'][_0x1b1b('0x4e')]({'where':{'id':_0x5cd694['params']['id']}})['then'](handleEntityNotFound(_0x318c48,null))[_0x1b1b('0x2a')](removeEntity(_0x318c48,null))['catch'](handleError(_0x318c48,null));};exports[_0x1b1b('0x58')]=function(_0x53d28c,_0x14ac29){return db[_0x1b1b('0x31')]['describe']()[_0x1b1b('0x2a')](respondWithResult(_0x14ac29,null))[_0x1b1b('0x49')](handleError(_0x14ac29,null));};exports[_0x1b1b('0x59')]=function(_0x5ae1c2,_0x419ab1,_0x367138){var _0x1cafb6={'raw':!![],'where':{}},_0x477996={},_0x24dd07;return db[_0x1b1b('0x31')][_0x1b1b('0x5a')]({'where':{'id':_0x5ae1c2[_0x1b1b('0x4a')]['id']}})[_0x1b1b('0x2a')](handleEntityNotFound(_0x419ab1,null))[_0x1b1b('0x2a')](function(_0x10075e){if(_0x10075e){_0x24dd07=_0x10075e[_0x1b1b('0x28')]({'plain':!![]});_0x477996[_0x1b1b('0x36')]=_['keys'](db[_0x1b1b('0x5b')]['rawAttributes']);_0x477996['query']=_['keys'](_0x5ae1c2[_0x1b1b('0x37')]);_0x477996[_0x1b1b('0x39')]=_[_0x1b1b('0x3a')](_0x477996[_0x1b1b('0x36')],_0x477996[_0x1b1b('0x37')]);_0x1cafb6[_0x1b1b('0x3c')]=_['intersection'](_0x477996['model'],qs[_0x1b1b('0x3b')](_0x5ae1c2[_0x1b1b('0x37')]['fields']));_0x1cafb6['attributes']=_0x1cafb6[_0x1b1b('0x3c')][_0x1b1b('0x4b')]?_0x1cafb6[_0x1b1b('0x3c')]:_0x477996['model'];if(!_0x5ae1c2[_0x1b1b('0x37')][_0x1b1b('0x3d')]('nolimit')){_0x1cafb6['limit']=qs[_0x1b1b('0x20')](_0x5ae1c2[_0x1b1b('0x37')][_0x1b1b('0x20')]);_0x1cafb6[_0x1b1b('0x1e')]=qs[_0x1b1b('0x1e')](_0x5ae1c2[_0x1b1b('0x37')]['offset']);}_0x1cafb6[_0x1b1b('0x3f')]=qs[_0x1b1b('0x40')](_0x5ae1c2[_0x1b1b('0x37')][_0x1b1b('0x40')]);_0x1cafb6[_0x1b1b('0x41')]=qs[_0x1b1b('0x39')](_['pick'](_0x5ae1c2[_0x1b1b('0x37')],_0x477996[_0x1b1b('0x39')]));_0x1cafb6[_0x1b1b('0x41')][_0x1b1b('0x5c')]=_0x10075e['id'];if(_0x5ae1c2[_0x1b1b('0x37')][_0x1b1b('0x43')]){_0x1cafb6[_0x1b1b('0x41')]=_[_0x1b1b('0x44')](_0x1cafb6[_0x1b1b('0x41')],{'$or':_['map'](_0x1cafb6['attributes'],function(_0x65e507){var _0x28d786={};_0x28d786[_0x65e507]={'$like':'%'+_0x5ae1c2[_0x1b1b('0x37')][_0x1b1b('0x43')]+'%'};return _0x28d786;})});}_0x1cafb6=_[_0x1b1b('0x44')]({},_0x1cafb6,_0x5ae1c2['options']);return db[_0x1b1b('0x5b')][_0x1b1b('0x47')](_0x1cafb6);}})[_0x1b1b('0x2a')](function(_0x4440af){if(_0x4440af){return db[_0x1b1b('0x5d')][_0x1b1b('0x5e')]({'where':{'id':_['map'](_0x4440af,_0x1b1b('0x5f')),'role':_0x1b1b('0x60')},'attributes':['id',_0x1b1b('0x2d'),'whatsappPause',_0x1b1b('0x61'),'createdAt']});}})[_0x1b1b('0x2a')](function(_0x484d93){if(_0x484d93){return{'count':_0x484d93[_0x1b1b('0x21')],'rows':_['map'](_0x484d93[_0x1b1b('0x48')],function(_0x5107e7){return{'membername':_0x5107e7[_0x1b1b('0x2d')],'UserId':_0x5107e7['id'],'queue_name':_0x24dd07[_0x1b1b('0x2d')],'WhatsappQueueId':_0x24dd07['id'],'interface':util[_0x1b1b('0x62')](_0x1b1b('0x63'),'SIP',_0x5107e7[_0x1b1b('0x2d')]),'penalty':0x0,'paused':_0x5107e7[_0x1b1b('0x64')],'createdAt':_0x5107e7[_0x1b1b('0x65')],'updatedAt':_0x5107e7[_0x1b1b('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1b1b('0x2a')](respondWithFilteredResult(_0x419ab1,_0x1cafb6))[_0x1b1b('0x49')](handleError(_0x419ab1,null));};exports['getTeams']=function(_0x2a1201,_0x14ff5c,_0x12cdaa){var _0x499675={};var _0x42984a={};var _0x36402b;var _0x400964;return db[_0x1b1b('0x31')][_0x1b1b('0x5a')]({'where':{'id':_0x2a1201[_0x1b1b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x14ff5c,null))[_0x1b1b('0x2a')](function(_0x2da0e9){if(_0x2da0e9){_0x36402b=_0x2da0e9;_0x42984a['model']=_[_0x1b1b('0x38')](db[_0x1b1b('0x66')][_0x1b1b('0x32')]);_0x42984a[_0x1b1b('0x37')]=_[_0x1b1b('0x38')](_0x2a1201[_0x1b1b('0x37')]);_0x42984a['filters']=_['intersection'](_0x42984a['model'],_0x42984a[_0x1b1b('0x37')]);_0x499675['attributes']=_['intersection'](_0x42984a['model'],qs['fields'](_0x2a1201[_0x1b1b('0x37')]['fields']));_0x499675[_0x1b1b('0x3c')]=_0x499675[_0x1b1b('0x3c')][_0x1b1b('0x4b')]?_0x499675['attributes']:_0x42984a[_0x1b1b('0x36')];_0x499675['order']=qs[_0x1b1b('0x40')](_0x2a1201[_0x1b1b('0x37')][_0x1b1b('0x40')]);_0x499675[_0x1b1b('0x41')]=qs[_0x1b1b('0x39')](_[_0x1b1b('0x42')](_0x2a1201[_0x1b1b('0x37')],_0x42984a[_0x1b1b('0x39')]));if(_0x2a1201[_0x1b1b('0x37')]['filter']){_0x499675[_0x1b1b('0x41')]=_['merge'](_0x499675[_0x1b1b('0x41')],{'$or':_[_0x1b1b('0x30')](_0x499675[_0x1b1b('0x3c')],function(_0x1eca02){var _0x50ecd2={};_0x50ecd2[_0x1eca02]={'$like':'%'+_0x2a1201[_0x1b1b('0x37')]['filter']+'%'};return _0x50ecd2;})});}_0x499675=_['merge']({},_0x499675,_0x2a1201['options']);return _0x36402b[_0x1b1b('0x67')](_0x499675);}})[_0x1b1b('0x2a')](function(_0xb63a2f){if(_0xb63a2f){_0x400964=_0xb63a2f['length'];if(!_0x2a1201[_0x1b1b('0x37')][_0x1b1b('0x3d')](_0x1b1b('0x3e'))){_0x499675['limit']=qs['limit'](_0x2a1201[_0x1b1b('0x37')][_0x1b1b('0x20')]);_0x499675[_0x1b1b('0x1e')]=qs['offset'](_0x2a1201[_0x1b1b('0x37')][_0x1b1b('0x1e')]);}return _0x36402b[_0x1b1b('0x67')](_0x499675);}})['then'](function(_0x22ec5c){if(_0x22ec5c){return _0x22ec5c?{'count':_0x400964,'rows':_0x22ec5c}:null;}})['then'](respondWithResult(_0x14ff5c,null))[_0x1b1b('0x49')](handleError(_0x14ff5c,null));};exports['addTeams']=function(_0x191956,_0x38c94b,_0x49df8a){var _0x585fcf=_0x191956[_0x1b1b('0x50')]['ids'];return db[_0x1b1b('0x66')][_0x1b1b('0x47')]({'where':{'id':_0x585fcf},'attributes':['id'],'include':[{'model':db['User'],'as':_0x1b1b('0x68'),'attributes':['id',_0x1b1b('0x2d'),_0x1b1b('0x69'),_0x1b1b('0x6a'),_0x1b1b('0x6b')],'raw':!![]}]})[_0x1b1b('0x2a')](function(_0x55865e){if(_0x55865e){var _0x8befe2=_[_0x1b1b('0x6c')](_0x55865e,function(_0x2fc733){var _0x10913b=_0x2fc733[_0x1b1b('0x28')]({'plain':!![]});return _0x10913b['Agents'];});return db[_0x1b1b('0x31')]['find']({'where':{'id':_0x191956[_0x1b1b('0x4a')]['id']}})[_0x1b1b('0x2a')](function(_0x1a15b5){return db[_0x1b1b('0x6d')][_0x1b1b('0x6e')](function(_0x5a7fa8){return _0x1a15b5['addTeams'](_0x585fcf,{'transaction':_0x5a7fa8})[_0x1b1b('0x2a')](function(){return BPromise[_0x1b1b('0x6f')](_0x8befe2,function(_0x1977dc){return db[_0x1b1b('0x5b')][_0x1b1b('0x70')]({'where':{'UserId':_0x1977dc['id'],'WhatsappQueueId':_0x191956['params']['id']},'transaction':_0x5a7fa8});});})[_0x1b1b('0x2a')](function(){_0x8befe2[_0x1b1b('0x71')](function(_0x125904){socket[_0x1b1b('0x72')]('userWhatsappQueue:save',{'UserId':_0x125904['id'],'WhatsappQueueId':_0x1a15b5['id']});});});});});}})['then'](respondWithStatusCode(_0x38c94b,null))[_0x1b1b('0x49')](handleError(_0x38c94b,null));};exports[_0x1b1b('0x73')]=function(_0x4d8ae8,_0x5af7f5,_0x3de3d5){return db[_0x1b1b('0x66')][_0x1b1b('0x47')]({'where':{'id':_0x4d8ae8[_0x1b1b('0x37')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x1b1b('0x68'),'attributes':['id'],'raw':!![]}]})[_0x1b1b('0x2a')](handleEntityNotFound(_0x5af7f5,null))[_0x1b1b('0x2a')](function(_0x1e2e21){var _0x11f530=_[_0x1b1b('0x30')](_0x1e2e21,'id');var _0xc7663a=[];var _0x43a607=[];var _0x5ccd71=squel[_0x1b1b('0x74')]();_0x5ccd71[_0x1b1b('0x75')](_0x1b1b('0x76'))['from'](_0x1b1b('0x77'),'tq')[_0x1b1b('0x78')](_0x1b1b('0x79'),'ut',_0x1b1b('0x7a'))[_0x1b1b('0x41')]('WhatsappQueueId\x20=\x20?',_0x4d8ae8[_0x1b1b('0x4a')]['id']);for(var _0x5a7f67=0x0;_0x5a7f67<_0x1e2e21[_0x1b1b('0x4b')];_0x5a7f67+=0x1){let _0x4b1b9a=_0x1e2e21[_0x5a7f67];for(var _0x209d2c=0x0;_0x209d2c<_0x4b1b9a['Agents']['length'];_0x209d2c+=0x1){let _0xac98ef=_0x4b1b9a['Agents'][_0x209d2c];var _0x3759b7=_0x5ccd71[_0x1b1b('0x7b')]();_0x3759b7[_0x1b1b('0x41')](_0x1b1b('0x7c'),_0xac98ef['id']);_0x43a607['push'](db[_0x1b1b('0x6d')][_0x1b1b('0x37')](_0x3759b7['toString'](),{'type':db[_0x1b1b('0x6d')][_0x1b1b('0x7d')][_0x1b1b('0x7e')]})[_0x1b1b('0x2a')](function(_0x38ce7c){if(_0x38ce7c['length']===0x1){return _0xac98ef['id'];}else{var _0x5ef357=_['every'](_[_0x1b1b('0x30')](_0x38ce7c,_0x1b1b('0x7f')),function(_0x7b99f7){return _[_0x1b1b('0x80')](_0x11f530,_0x7b99f7);});if(_0x5ef357){return _0xac98ef['id'];}}}));}}return BPromise[_0x1b1b('0x81')](_0x43a607)[_0x1b1b('0x2a')](function(_0x5dfd75){_0xc7663a=_(_0xc7663a)[_0x1b1b('0x82')](_0x5dfd75)[_0x1b1b('0x83')]()[_0x1b1b('0x84')]();return db[_0x1b1b('0x31')][_0x1b1b('0x4e')]({'where':{'id':_0x4d8ae8[_0x1b1b('0x4a')]['id']}})[_0x1b1b('0x2a')](function(_0x26bf43){return db[_0x1b1b('0x6d')]['transaction'](function(_0x8a10f6){return _0x26bf43[_0x1b1b('0x73')](_0x4d8ae8[_0x1b1b('0x37')][_0x1b1b('0x85')],{'transaction':_0x8a10f6})[_0x1b1b('0x2a')](function(){if(!_['isEmpty'](_0xc7663a)){return _0x26bf43[_0x1b1b('0x86')](_0xc7663a,{'transaction':_0x8a10f6});}})[_0x1b1b('0x2a')](function(){_0xc7663a['forEach'](function(_0x43b3f1){socket[_0x1b1b('0x72')]('userWhatsappQueue:remove',{'UserId':_0x43b3f1,'WhatsappQueueId':_0x26bf43['id']});});});});});});})['then'](respondWithStatusCode(_0x5af7f5,null))[_0x1b1b('0x49')](handleError(_0x5af7f5,null));};exports[_0x1b1b('0x87')]=function(_0x3715b9,_0x2cb1e9,_0x3f3ec5){return db['WhatsappQueue'][_0x1b1b('0x4e')]({'where':{'id':_0x3715b9[_0x1b1b('0x4a')]['id']}})[_0x1b1b('0x2a')](handleEntityNotFound(_0x2cb1e9,null))[_0x1b1b('0x2a')](function(_0x1cd3b2){if(_0x1cd3b2){return _0x1cd3b2[_0x1b1b('0x87')](_0x3715b9['body'][_0x1b1b('0x85')],_[_0x1b1b('0x88')](_0x3715b9[_0x1b1b('0x50')],['ids','id'])||{})['spread'](function(_0x3a41b7){for(var _0x1c60c9=0x0;_0x1c60c9<_0x3715b9[_0x1b1b('0x50')][_0x1b1b('0x85')][_0x1b1b('0x4b')];_0x1c60c9+=0x1){socket[_0x1b1b('0x72')]('userWhatsappQueue:save',{'UserId':Number(_0x3715b9['body'][_0x1b1b('0x85')][_0x1c60c9]),'WhatsappQueueId':Number(_0x3715b9[_0x1b1b('0x4a')]['id'])});}return _0x3a41b7;});}})[_0x1b1b('0x2a')](respondWithResult(_0x2cb1e9,null))[_0x1b1b('0x49')](handleError(_0x2cb1e9,null));};exports['removeAgents']=function(_0x31112b,_0x1f8456,_0x246463){return db[_0x1b1b('0x31')][_0x1b1b('0x4e')]({'where':{'id':_0x31112b[_0x1b1b('0x4a')]['id']}})[_0x1b1b('0x2a')](handleEntityNotFound(_0x1f8456,null))[_0x1b1b('0x2a')](function(_0x2e366b){if(_0x2e366b){return _0x2e366b[_0x1b1b('0x86')](_0x31112b[_0x1b1b('0x37')][_0x1b1b('0x85')])[_0x1b1b('0x2a')](function(){if(_[_0x1b1b('0x89')](_0x31112b[_0x1b1b('0x37')]['ids'])){for(var _0x471f6b=0x0;_0x471f6b<_0x31112b['query'][_0x1b1b('0x85')][_0x1b1b('0x4b')];_0x471f6b+=0x1){socket[_0x1b1b('0x72')](_0x1b1b('0x8a'),{'UserId':Number(_0x31112b['query'][_0x1b1b('0x85')][_0x471f6b]),'WhatsappQueueId':Number(_0x31112b['params']['id'])});}}else{socket['emit'](_0x1b1b('0x8a'),{'UserId':Number(_0x31112b[_0x1b1b('0x37')][_0x1b1b('0x85')]),'WhatsappQueueId':Number(_0x31112b[_0x1b1b('0x4a')]['id'])});}});}})[_0x1b1b('0x2a')](respondWithStatusCode(_0x1f8456,null))[_0x1b1b('0x49')](handleError(_0x1f8456,null));};exports['getAgents']=function(_0x47b9c1,_0x130671,_0x27d0f6){var _0x12b900={};var _0x26b7bd={};var _0x2ff3c7;var _0x58f336;return db['WhatsappQueue']['findOne']({'where':{'id':_0x47b9c1[_0x1b1b('0x4a')]['id']}})[_0x1b1b('0x2a')](handleEntityNotFound(_0x130671,null))[_0x1b1b('0x2a')](function(_0x571f97){if(_0x571f97){_0x2ff3c7=_0x571f97;_0x26b7bd[_0x1b1b('0x36')]=_[_0x1b1b('0x38')](db['User'][_0x1b1b('0x32')]);_0x26b7bd['query']=_[_0x1b1b('0x38')](_0x47b9c1[_0x1b1b('0x37')]);_0x26b7bd[_0x1b1b('0x39')]=_[_0x1b1b('0x3a')](_0x26b7bd[_0x1b1b('0x36')],_0x26b7bd[_0x1b1b('0x37')]);_0x12b900[_0x1b1b('0x3c')]=_['intersection'](_0x26b7bd[_0x1b1b('0x36')],qs[_0x1b1b('0x3b')](_0x47b9c1['query']['fields']));_0x12b900[_0x1b1b('0x3c')]=_0x12b900[_0x1b1b('0x3c')][_0x1b1b('0x4b')]?_0x12b900[_0x1b1b('0x3c')]:_0x26b7bd[_0x1b1b('0x36')];_0x12b900[_0x1b1b('0x3f')]=qs[_0x1b1b('0x40')](_0x47b9c1[_0x1b1b('0x37')][_0x1b1b('0x40')]);_0x12b900['where']=qs[_0x1b1b('0x39')](_[_0x1b1b('0x42')](_0x47b9c1[_0x1b1b('0x37')],_0x26b7bd[_0x1b1b('0x39')]));if(_0x47b9c1[_0x1b1b('0x37')][_0x1b1b('0x43')]){_0x12b900[_0x1b1b('0x41')]=_[_0x1b1b('0x44')](_0x12b900[_0x1b1b('0x41')],{'$or':_[_0x1b1b('0x30')](_0x12b900[_0x1b1b('0x3c')],function(_0x56c3a9){var _0x443317={};_0x443317[_0x56c3a9]={'$like':'%'+_0x47b9c1[_0x1b1b('0x37')][_0x1b1b('0x43')]+'%'};return _0x443317;})});}_0x12b900=_[_0x1b1b('0x44')]({},_0x12b900,_0x47b9c1['options']);return _0x2ff3c7['getAgents'](_0x12b900);}})[_0x1b1b('0x2a')](function(_0x5a91e4){if(_0x5a91e4){_0x58f336=_0x5a91e4[_0x1b1b('0x4b')];if(!_0x47b9c1[_0x1b1b('0x37')][_0x1b1b('0x3d')]('nolimit')){_0x12b900[_0x1b1b('0x20')]=qs[_0x1b1b('0x20')](_0x47b9c1['query'][_0x1b1b('0x20')]);_0x12b900[_0x1b1b('0x1e')]=qs[_0x1b1b('0x1e')](_0x47b9c1[_0x1b1b('0x37')][_0x1b1b('0x1e')]);}return _0x2ff3c7[_0x1b1b('0x8b')](_0x12b900);}})['then'](function(_0x1b1624){if(_0x1b1624){return _0x1b1624?{'count':_0x58f336,'rows':_0x1b1624}:null;}})[_0x1b1b('0x2a')](respondWithResult(_0x130671,null))[_0x1b1b('0x49')](handleError(_0x130671,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index f901d5d..d18413e 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 _0x54d9=['exports','events','../../mysqldb','WhatsappQueue','setMaxListeners','update','remove','emit','hook'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x54d9,0x1b1));var _0x954d=function(_0x36c87d,_0x2ab247){_0x36c87d=_0x36c87d-0x0;var _0x54dc55=_0x54d9[_0x36c87d];return _0x54dc55;};'use strict';var EventEmitter=require(_0x954d('0x0'));var WhatsappQueue=require(_0x954d('0x1'))['db'][_0x954d('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x954d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x954d('0x4'),'afterDestroy':_0x954d('0x5')};function emitEvent(_0x31f513){return function(_0x220078,_0x33f8b0,_0x25a0a5){WhatsappQueueEvents[_0x954d('0x6')](_0x31f513+':'+_0x220078['id'],_0x220078);WhatsappQueueEvents[_0x954d('0x6')](_0x31f513,_0x220078);_0x25a0a5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0x954d('0x7')](e,emitEvent(event));}}module[_0x954d('0x8')]=WhatsappQueueEvents; \ No newline at end of file +var _0x9e31=['save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','WhatsappQueue','setMaxListeners'];(function(_0x5b3d6d,_0x10324d){var _0x39fb30=function(_0xec4783){while(--_0xec4783){_0x5b3d6d['push'](_0x5b3d6d['shift']());}};_0x39fb30(++_0x10324d);}(_0x9e31,0x115));var _0x19e3=function(_0x35e124,_0x44ffff){_0x35e124=_0x35e124-0x0;var _0xf6408a=_0x9e31[_0x35e124];return _0xf6408a;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0x19e3('0x0'))['db'][_0x19e3('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x19e3('0x2')](0x0);var events={'afterCreate':_0x19e3('0x3'),'afterUpdate':_0x19e3('0x4'),'afterDestroy':_0x19e3('0x5')};function emitEvent(_0x1c18c7){return function(_0x3c8721,_0x1694ec,_0x3d3958){WhatsappQueueEvents[_0x19e3('0x6')](_0x1c18c7+':'+_0x3c8721['id'],_0x3c8721);WhatsappQueueEvents['emit'](_0x1c18c7,_0x3c8721);_0x3d3958(null);};}for(var e in events){if(events[_0x19e3('0x7')](e)){var event=events[e];WhatsappQueue[_0x19e3('0x8')](e,emitEvent(event));}}module[_0x19e3('0x9')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 9f1cead..10d46ca 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 _0x74be=['request-promise','path','rimraf','../../config/environment','exports','define','lodash','util','../../config/logger','api','moment'];(function(_0x522382,_0x3e2f0a){var _0x4e7baf=function(_0x5b578d){while(--_0x5b578d){_0x522382['push'](_0x522382['shift']());}};_0x4e7baf(++_0x3e2f0a);}(_0x74be,0x8a));var _0xe74b=function(_0x859202,_0x3dee73){_0x859202=_0x859202-0x0;var _0xcf86cc=_0x74be[_0x859202];return _0xcf86cc;};'use strict';var _=require(_0xe74b('0x0'));var util=require(_0xe74b('0x1'));var logger=require(_0xe74b('0x2'))(_0xe74b('0x3'));var moment=require(_0xe74b('0x4'));var BPromise=require('bluebird');var rp=require(_0xe74b('0x5'));var fs=require('fs');var path=require(_0xe74b('0x6'));var rimraf=require(_0xe74b('0x7'));var config=require(_0xe74b('0x8'));var attributes=require('./whatsappQueue.attributes');module[_0xe74b('0x9')]=function(_0x339c66,_0xe6fd90){return _0x339c66[_0xe74b('0xa')]('WhatsappQueue',attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc33f=['./whatsappQueue.attributes','define','WhatsappQueue','whatsapp_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x347db4,_0x2f0864){var _0x71667c=function(_0x3a0586){while(--_0x3a0586){_0x347db4['push'](_0x347db4['shift']());}};_0x71667c(++_0x2f0864);}(_0xc33f,0x170));var _0xfc33=function(_0xb9622e,_0x91225d){_0xb9622e=_0xb9622e-0x0;var _0x12969e=_0xc33f[_0xb9622e];return _0x12969e;};'use strict';var _=require(_0xfc33('0x0'));var util=require(_0xfc33('0x1'));var logger=require(_0xfc33('0x2'))(_0xfc33('0x3'));var moment=require(_0xfc33('0x4'));var BPromise=require(_0xfc33('0x5'));var rp=require(_0xfc33('0x6'));var fs=require('fs');var path=require(_0xfc33('0x7'));var rimraf=require(_0xfc33('0x8'));var config=require(_0xfc33('0x9'));var attributes=require(_0xfc33('0xa'));module['exports']=function(_0x1ec1a5,_0x15a2e4){return _0x1ec1a5[_0xfc33('0xb')](_0xfc33('0xc'),attributes,{'tableName':_0xfc33('0xd'),'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 bef9429..f552c20 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 _0xf19b=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetWhatsappQueue','findAll','options','raw','where','attributes','include','model','map','ShowWhatsappQueue','util','moment','bluebird','randomstring'];(function(_0x9fd705,_0x249798){var _0x1c0995=function(_0x449d8b){while(--_0x449d8b){_0x9fd705['push'](_0x9fd705['shift']());}};_0x1c0995(++_0x249798);}(_0xf19b,0x1ea));var _0xbf19=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xf19b[_0x4cf98e];return _0x1623ac;};'use strict';var _=require('lodash');var util=require(_0xbf19('0x0'));var moment=require(_0xbf19('0x1'));var BPromise=require(_0xbf19('0x2'));var rs=require(_0xbf19('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbf19('0x4'));var logger=require('../../config/logger')(_0xbf19('0x5'));var config=require(_0xbf19('0x6'));var jayson=require(_0xbf19('0x7'));var client=jayson[_0xbf19('0x8')][_0xbf19('0x9')]({'port':0x232a});config['redis']=_[_0xbf19('0xa')](config['redis'],{'host':_0xbf19('0xb'),'port':0x18eb});var socket=require(_0xbf19('0xc'))(new Redis(config[_0xbf19('0xd')]));require(_0xbf19('0xe'))[_0xbf19('0xf')](socket);function respondWithRpcPromise(_0x5373af,_0x5d72ce,_0x5f4a76){return new BPromise(function(_0x430fc3,_0x503f06){return client[_0xbf19('0x10')](_0x5373af,_0x5f4a76)[_0xbf19('0x11')](function(_0xd0b7d1){logger[_0xbf19('0x12')](_0xbf19('0x13'),_0x5d72ce,_0xbf19('0x14'));logger[_0xbf19('0x15')](_0xbf19('0x16'),_0x5d72ce,_0xbf19('0x14'),JSON[_0xbf19('0x17')](_0xd0b7d1));if(_0xd0b7d1[_0xbf19('0x18')]){if(_0xd0b7d1[_0xbf19('0x18')][_0xbf19('0x19')]===0x1f4){logger['error'](_0xbf19('0x13'),_0x5d72ce,_0xd0b7d1['error'][_0xbf19('0x1a')]);return _0x503f06(_0xd0b7d1['error']['message']);}logger[_0xbf19('0x18')](_0xbf19('0x13'),_0x5d72ce,_0xd0b7d1['error'][_0xbf19('0x1a')]);return _0x430fc3(_0xd0b7d1[_0xbf19('0x18')]['message']);}else{logger['info'](_0xbf19('0x13'),_0x5d72ce,'request\x20sent');_0x430fc3(_0xd0b7d1['result']['message']);}})[_0xbf19('0x1b')](function(_0x3efbc6){logger[_0xbf19('0x18')](_0xbf19('0x13'),_0x5d72ce,_0x3efbc6);_0x503f06(_0x3efbc6);});});}exports[_0xbf19('0x1c')]=function(_0x177840){var _0x57b051=this;return new Promise(function(_0x2ca2de,_0x2ba1b4){return db['WhatsappQueue'][_0xbf19('0x1d')]({'raw':_0x177840['options']?_0x177840[_0xbf19('0x1e')][_0xbf19('0x1f')]===undefined?!![]:![]:!![],'where':_0x177840[_0xbf19('0x1e')]?_0x177840[_0xbf19('0x1e')][_0xbf19('0x20')]||null:null,'attributes':_0x177840[_0xbf19('0x1e')]?_0x177840[_0xbf19('0x1e')][_0xbf19('0x21')]||null:null,'limit':_0x177840['options']?_0x177840[_0xbf19('0x1e')]['limit']||null:null,'include':_0x177840[_0xbf19('0x1e')]?_0x177840['options'][_0xbf19('0x22')]?_['map'](_0x177840[_0xbf19('0x1e')][_0xbf19('0x22')],function(_0x1445da){return{'model':db[_0x1445da[_0xbf19('0x23')]],'as':_0x1445da['as'],'attributes':_0x1445da[_0xbf19('0x21')],'include':_0x1445da[_0xbf19('0x22')]?_[_0xbf19('0x24')](_0x1445da[_0xbf19('0x22')],function(_0xf38039){return{'model':db[_0xf38039[_0xbf19('0x23')]],'as':_0xf38039['as'],'attributes':_0xf38039[_0xbf19('0x21')],'include':_0xf38039[_0xbf19('0x22')]?_[_0xbf19('0x24')](_0xf38039[_0xbf19('0x22')],function(_0x13e7b1){return{'model':db[_0x13e7b1[_0xbf19('0x23')]],'as':_0x13e7b1['as'],'attributes':_0x13e7b1[_0xbf19('0x21')]};}):[]};}):[]};}):[]:[]})[_0xbf19('0x11')](function(_0x55b9ca){logger[_0xbf19('0x12')](_0xbf19('0x1c'),_0x177840);logger[_0xbf19('0x15')](_0xbf19('0x1c'),_0x177840,JSON[_0xbf19('0x17')](_0x55b9ca));_0x2ca2de(_0x55b9ca);})['catch'](function(_0x19c760){logger[_0xbf19('0x18')](_0xbf19('0x1c'),_0x19c760[_0xbf19('0x1a')],_0x177840);_0x2ba1b4(_0x57b051[_0xbf19('0x18')](0x1f4,_0x19c760[_0xbf19('0x1a')]));});});};exports[_0xbf19('0x25')]=function(_0x771872){var _0x17090a=this;return new Promise(function(_0xe29227,_0x39d6a8){return db['WhatsappQueue']['find']({'raw':_0x771872[_0xbf19('0x1e')]?_0x771872[_0xbf19('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x771872[_0xbf19('0x1e')]?_0x771872['options'][_0xbf19('0x20')]||null:null,'attributes':_0x771872[_0xbf19('0x1e')]?_0x771872[_0xbf19('0x1e')][_0xbf19('0x21')]||null:null,'include':_0x771872['options']?_0x771872[_0xbf19('0x1e')][_0xbf19('0x22')]?_[_0xbf19('0x24')](_0x771872[_0xbf19('0x1e')][_0xbf19('0x22')],function(_0x42bd2c){return{'model':db[_0x42bd2c[_0xbf19('0x23')]],'as':_0x42bd2c['as'],'attributes':_0x42bd2c['attributes'],'include':_0x42bd2c[_0xbf19('0x22')]?_[_0xbf19('0x24')](_0x42bd2c['include'],function(_0x170c6){return{'model':db[_0x170c6['model']],'as':_0x170c6['as'],'attributes':_0x170c6[_0xbf19('0x21')],'include':_0x170c6[_0xbf19('0x22')]?_[_0xbf19('0x24')](_0x170c6[_0xbf19('0x22')],function(_0x4da37b){return{'model':db[_0x4da37b[_0xbf19('0x23')]],'as':_0x4da37b['as'],'attributes':_0x4da37b[_0xbf19('0x21')]};}):[]};}):[]};}):[]:[]})[_0xbf19('0x11')](function(_0x2be61e){logger[_0xbf19('0x12')](_0xbf19('0x25'),_0x771872);logger['debug'](_0xbf19('0x25'),_0x771872,JSON[_0xbf19('0x17')](_0x2be61e));_0xe29227(_0x2be61e);})[_0xbf19('0x1b')](function(_0x368efd){logger[_0xbf19('0x18')](_0xbf19('0x25'),_0x368efd[_0xbf19('0x1a')],_0x771872);_0x39d6a8(_0x17090a[_0xbf19('0x18')](0x1f4,_0x368efd[_0xbf19('0x1a')]));});});}; \ No newline at end of file +var _0xfbfb=['client','redis','localhost','socket.io-emitter','./whatsappQueue.socket','request','then','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','attributes','include','map','model','info','where','ShowWhatsappQueue','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5b7327,_0x3da7cc){var _0x1518a1=function(_0x32345a){while(--_0x32345a){_0x5b7327['push'](_0x5b7327['shift']());}};_0x1518a1(++_0x3da7cc);}(_0xfbfb,0x144));var _0xbfbf=function(_0x478481,_0x52705e){_0x478481=_0x478481-0x0;var _0x2e1674=_0xfbfb[_0x478481];return _0x2e1674;};'use strict';var _=require('lodash');var util=require(_0xbfbf('0x0'));var moment=require(_0xbfbf('0x1'));var BPromise=require(_0xbfbf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbfbf('0x3'));var db=require(_0xbfbf('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbfbf('0x5'))(_0xbfbf('0x6'));var config=require(_0xbfbf('0x7'));var jayson=require(_0xbfbf('0x8'));var client=jayson[_0xbfbf('0x9')]['http']({'port':0x232a});config[_0xbfbf('0xa')]=_['defaults'](config[_0xbfbf('0xa')],{'host':_0xbfbf('0xb'),'port':0x18eb});var socket=require(_0xbfbf('0xc'))(new Redis(config[_0xbfbf('0xa')]));require(_0xbfbf('0xd'))['register'](socket);function respondWithRpcPromise(_0x3a6285,_0x18b1cb,_0x5adf4a){return new BPromise(function(_0x34fc03,_0x25e3df){return client[_0xbfbf('0xe')](_0x3a6285,_0x5adf4a)[_0xbfbf('0xf')](function(_0x3a879b){logger['info'](_0xbfbf('0x10'),_0x18b1cb,_0xbfbf('0x11'));logger[_0xbfbf('0x12')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x18b1cb,_0xbfbf('0x11'),JSON[_0xbfbf('0x13')](_0x3a879b));if(_0x3a879b[_0xbfbf('0x14')]){if(_0x3a879b[_0xbfbf('0x14')][_0xbfbf('0x15')]===0x1f4){logger['error'](_0xbfbf('0x10'),_0x18b1cb,_0x3a879b[_0xbfbf('0x14')][_0xbfbf('0x16')]);return _0x25e3df(_0x3a879b['error'][_0xbfbf('0x16')]);}logger[_0xbfbf('0x14')](_0xbfbf('0x10'),_0x18b1cb,_0x3a879b[_0xbfbf('0x14')]['message']);return _0x34fc03(_0x3a879b[_0xbfbf('0x14')][_0xbfbf('0x16')]);}else{logger['info']('WhatsappQueue,\x20%s,\x20%s',_0x18b1cb,_0xbfbf('0x11'));_0x34fc03(_0x3a879b[_0xbfbf('0x17')][_0xbfbf('0x16')]);}})[_0xbfbf('0x18')](function(_0x16f9b5){logger[_0xbfbf('0x14')](_0xbfbf('0x10'),_0x18b1cb,_0x16f9b5);_0x25e3df(_0x16f9b5);});});}exports[_0xbfbf('0x19')]=function(_0x33c18e){var _0x203bfa=this;return new Promise(function(_0x29a09a,_0x46e0ae){return db[_0xbfbf('0x1a')][_0xbfbf('0x1b')]({'raw':_0x33c18e['options']?_0x33c18e[_0xbfbf('0x1c')][_0xbfbf('0x1d')]===undefined?!![]:![]:!![],'where':_0x33c18e['options']?_0x33c18e[_0xbfbf('0x1c')]['where']||null:null,'attributes':_0x33c18e[_0xbfbf('0x1c')]?_0x33c18e[_0xbfbf('0x1c')][_0xbfbf('0x1e')]||null:null,'limit':_0x33c18e['options']?_0x33c18e['options']['limit']||null:null,'include':_0x33c18e['options']?_0x33c18e[_0xbfbf('0x1c')][_0xbfbf('0x1f')]?_[_0xbfbf('0x20')](_0x33c18e[_0xbfbf('0x1c')][_0xbfbf('0x1f')],function(_0x106c69){return{'model':db[_0x106c69[_0xbfbf('0x21')]],'as':_0x106c69['as'],'attributes':_0x106c69['attributes'],'include':_0x106c69[_0xbfbf('0x1f')]?_[_0xbfbf('0x20')](_0x106c69[_0xbfbf('0x1f')],function(_0xbf6f55){return{'model':db[_0xbf6f55[_0xbfbf('0x21')]],'as':_0xbf6f55['as'],'attributes':_0xbf6f55[_0xbfbf('0x1e')],'include':_0xbf6f55[_0xbfbf('0x1f')]?_[_0xbfbf('0x20')](_0xbf6f55['include'],function(_0x1d0efe){return{'model':db[_0x1d0efe['model']],'as':_0x1d0efe['as'],'attributes':_0x1d0efe['attributes']};}):[]};}):[]};}):[]:[]})[_0xbfbf('0xf')](function(_0x3c7951){logger[_0xbfbf('0x22')](_0xbfbf('0x19'),_0x33c18e);logger[_0xbfbf('0x12')](_0xbfbf('0x19'),_0x33c18e,JSON[_0xbfbf('0x13')](_0x3c7951));_0x29a09a(_0x3c7951);})[_0xbfbf('0x18')](function(_0x27b837){logger[_0xbfbf('0x14')]('GetWhatsappQueue',_0x27b837[_0xbfbf('0x16')],_0x33c18e);_0x46e0ae(_0x203bfa['error'](0x1f4,_0x27b837[_0xbfbf('0x16')]));});});};exports['ShowWhatsappQueue']=function(_0x35b668){var _0x4b1daa=this;return new Promise(function(_0x4743c7,_0x12a079){return db[_0xbfbf('0x1a')]['find']({'raw':_0x35b668[_0xbfbf('0x1c')]?_0x35b668[_0xbfbf('0x1c')][_0xbfbf('0x1d')]===undefined?!![]:![]:!![],'where':_0x35b668[_0xbfbf('0x1c')]?_0x35b668[_0xbfbf('0x1c')][_0xbfbf('0x23')]||null:null,'attributes':_0x35b668[_0xbfbf('0x1c')]?_0x35b668['options'][_0xbfbf('0x1e')]||null:null,'include':_0x35b668[_0xbfbf('0x1c')]?_0x35b668[_0xbfbf('0x1c')][_0xbfbf('0x1f')]?_[_0xbfbf('0x20')](_0x35b668[_0xbfbf('0x1c')][_0xbfbf('0x1f')],function(_0x5be5a5){return{'model':db[_0x5be5a5[_0xbfbf('0x21')]],'as':_0x5be5a5['as'],'attributes':_0x5be5a5[_0xbfbf('0x1e')],'include':_0x5be5a5['include']?_['map'](_0x5be5a5[_0xbfbf('0x1f')],function(_0x4293e8){return{'model':db[_0x4293e8[_0xbfbf('0x21')]],'as':_0x4293e8['as'],'attributes':_0x4293e8[_0xbfbf('0x1e')],'include':_0x4293e8[_0xbfbf('0x1f')]?_[_0xbfbf('0x20')](_0x4293e8[_0xbfbf('0x1f')],function(_0x2304a2){return{'model':db[_0x2304a2[_0xbfbf('0x21')]],'as':_0x2304a2['as'],'attributes':_0x2304a2['attributes']};}):[]};}):[]};}):[]:[]})[_0xbfbf('0xf')](function(_0x3250bf){logger[_0xbfbf('0x22')](_0xbfbf('0x24'),_0x35b668);logger[_0xbfbf('0x12')](_0xbfbf('0x24'),_0x35b668,JSON[_0xbfbf('0x13')](_0x3250bf));_0x4743c7(_0x3250bf);})[_0xbfbf('0x18')](function(_0x37ea37){logger[_0xbfbf('0x14')](_0xbfbf('0x24'),_0x37ea37[_0xbfbf('0x16')],_0x35b668);_0x12a079(_0x4b1daa['error'](0x1f4,_0x37ea37['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 9b01536..a67911d 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 _0x5294=['removeListener','register','length','whatsappQueue:','save','remove','update','emit'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x5294,0x10c));var _0x4529=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x5294[_0x5783f4];return _0x28e380;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0x4529('0x0'),_0x4529('0x1'),_0x4529('0x2')];function createListener(_0x4a9f31,_0x20c6dc){return function(_0x19ce73){_0x20c6dc[_0x4529('0x3')](_0x4a9f31,_0x19ce73);};}function removeListener(_0x1a5a9a,_0x39229d){return function(){WhatsappQueueEvents[_0x4529('0x4')](_0x1a5a9a,_0x39229d);};}exports[_0x4529('0x5')]=function(_0xaa4377){for(var _0x21654e=0x0,_0x2da071=events[_0x4529('0x6')];_0x21654e<_0x2da071;_0x21654e++){var _0x37e5aa=events[_0x21654e];var _0x2b3284=createListener(_0x4529('0x7')+_0x37e5aa,_0xaa4377);WhatsappQueueEvents['on'](_0x37e5aa,_0x2b3284);}}; \ No newline at end of file +var _0x3640=['update','emit','register','whatsappQueue:','./whatsappQueue.events','save','remove'];(function(_0x55bc0b,_0x95ab1b){var _0x10ffd6=function(_0x29695b){while(--_0x29695b){_0x55bc0b['push'](_0x55bc0b['shift']());}};_0x10ffd6(++_0x95ab1b);}(_0x3640,0xb3));var _0x0364=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0x3640[_0x2ec461];return _0x28603d;};'use strict';var WhatsappQueueEvents=require(_0x0364('0x0'));var events=[_0x0364('0x1'),_0x0364('0x2'),_0x0364('0x3')];function createListener(_0x2561b0,_0x586e8e){return function(_0x5999f2){_0x586e8e[_0x0364('0x4')](_0x2561b0,_0x5999f2);};}function removeListener(_0x1f9018,_0x4108ed){return function(){WhatsappQueueEvents['removeListener'](_0x1f9018,_0x4108ed);};}exports[_0x0364('0x5')]=function(_0x462627){for(var _0x5ec77e=0x0,_0x276c5a=events['length'];_0x5ec77e<_0x276c5a;_0x5ec77e++){var _0x2d0eb8=events[_0x5ec77e];var _0x469f6e=createListener(_0x0364('0x6')+_0x2d0eb8,_0x462627);WhatsappQueueEvents['on'](_0x2d0eb8,_0x469f6e);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 7fca626..7ead6f5 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 _0x1543=['./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x59deeb,_0x5e4092){var _0x2631fd=function(_0x2d8679){while(--_0x2d8679){_0x59deeb['push'](_0x59deeb['shift']());}};_0x2631fd(++_0x5e4092);}(_0x1543,0x1c5));var _0x3154=function(_0x348b34,_0x4078f2){_0x348b34=_0x348b34-0x0;var _0x5e495d=_0x1543[_0x348b34];return _0x5e495d;};'use strict';var multer=require(_0x3154('0x0'));var util=require(_0x3154('0x1'));var path=require(_0x3154('0x2'));var timeout=require(_0x3154('0x3'));var express=require(_0x3154('0x4'));var router=express[_0x3154('0x5')]();var fs_extra=require(_0x3154('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3154('0x7'));var config=require(_0x3154('0x8'));var controller=require(_0x3154('0x9'));router[_0x3154('0xa')]('/',auth[_0x3154('0xb')](),controller[_0x3154('0xc')]);router[_0x3154('0xa')](_0x3154('0xd'),auth[_0x3154('0xb')](),controller[_0x3154('0xe')]);router['get'](_0x3154('0xf'),auth[_0x3154('0xb')](),controller[_0x3154('0x10')]);router[_0x3154('0x11')]('/',auth[_0x3154('0xb')](),controller['create']);router['put'](_0x3154('0xf'),auth[_0x3154('0xb')](),controller[_0x3154('0x12')]);router[_0x3154('0x13')]('/:id',auth[_0x3154('0xb')](),controller[_0x3154('0x14')]);module[_0x3154('0x15')]=router; \ No newline at end of file +var _0x4e78=['put','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create'];(function(_0x521e8d,_0x23a290){var _0x518bbd=function(_0x4241eb){while(--_0x4241eb){_0x521e8d['push'](_0x521e8d['shift']());}};_0x518bbd(++_0x23a290);}(_0x4e78,0xca));var _0x84e7=function(_0x152449,_0x49f41d){_0x152449=_0x152449-0x0;var _0x5b58b2=_0x4e78[_0x152449];return _0x5b58b2;};'use strict';var multer=require('multer');var util=require(_0x84e7('0x0'));var path=require(_0x84e7('0x1'));var timeout=require(_0x84e7('0x2'));var express=require(_0x84e7('0x3'));var router=express[_0x84e7('0x4')]();var fs_extra=require(_0x84e7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x84e7('0x6'));var config=require(_0x84e7('0x7'));var controller=require(_0x84e7('0x8'));router[_0x84e7('0x9')]('/',auth[_0x84e7('0xa')](),controller[_0x84e7('0xb')]);router[_0x84e7('0x9')](_0x84e7('0xc'),auth[_0x84e7('0xa')](),controller[_0x84e7('0xd')]);router[_0x84e7('0x9')](_0x84e7('0xe'),auth['isAuthenticated'](),controller[_0x84e7('0xf')]);router[_0x84e7('0x10')]('/',auth[_0x84e7('0xa')](),controller[_0x84e7('0x11')]);router[_0x84e7('0x12')]('/:id',auth[_0x84e7('0xa')](),controller[_0x84e7('0x13')]);router[_0x84e7('0x14')](_0x84e7('0xe'),auth[_0x84e7('0xa')](),controller[_0x84e7('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 0961283..3a6e9e2 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(_0x4ee2a7,_0x3e7627){var _0x52b906=function(_0x557ca1){while(--_0x557ca1){_0x4ee2a7['push'](_0x4ee2a7['shift']());}};_0x52b906(++_0x3e7627);}(_0x7a54,0x106));var _0x47a5=function(_0x4d8aa1,_0x49d232){_0x4d8aa1=_0x4d8aa1-0x0;var _0xbc1d4c=_0x7a54[_0x4d8aa1];return _0xbc1d4c;};'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(_0x28c4f7,_0x5beb4a){var _0x56f515=function(_0xb06f6f){while(--_0xb06f6f){_0x28c4f7['push'](_0x28c4f7['shift']());}};_0x56f515(++_0x5beb4a);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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 ea40070..951ea03 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 _0x6b20=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','WhatsappQueueReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','includeAll','findAll','rows','catch','show','params','include','options','find','create','update','body','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger'];(function(_0x1917d8,_0x5c61eb){var _0x2f8f9a=function(_0x44a788){while(--_0x44a788){_0x1917d8['push'](_0x1917d8['shift']());}};_0x2f8f9a(++_0x5c61eb);}(_0x6b20,0xd1));var _0x06b2=function(_0x239345,_0x1d7e1b){_0x239345=_0x239345-0x0;var _0x21bb2e=_0x6b20[_0x239345];return _0x21bb2e;};'use strict';var emlformat=require(_0x06b2('0x0'));var rimraf=require(_0x06b2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x06b2('0x2'));var rp=require('request-promise');var moment=require(_0x06b2('0x3'));var BPromise=require(_0x06b2('0x4'));var Mustache=require(_0x06b2('0x5'));var util=require('util');var path=require(_0x06b2('0x6'));var sox=require(_0x06b2('0x7'));var csv=require(_0x06b2('0x8'));var ejs=require(_0x06b2('0x9'));var fs=require('fs');var fs_extra=require(_0x06b2('0xa'));var _=require(_0x06b2('0xb'));var squel=require(_0x06b2('0xc'));var crypto=require('crypto');var jsforce=require(_0x06b2('0xd'));var deskjs=require(_0x06b2('0xe'));var toCsv=require(_0x06b2('0x8'));var querystring=require('querystring');var Papa=require(_0x06b2('0xf'));var Redis=require('ioredis');var authService=require(_0x06b2('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x06b2('0x11'));var logger=require(_0x06b2('0x12'))('api');var utils=require(_0x06b2('0x13'));var config=require(_0x06b2('0x14'));var licenseUtil=require(_0x06b2('0x15'));var db=require(_0x06b2('0x16'))['db'];function respondWithStatusCode(_0x44a9b4,_0x810a12){_0x810a12=_0x810a12||0xcc;return function(_0x3039c9){if(_0x3039c9){return _0x44a9b4[_0x06b2('0x17')](_0x810a12);}return _0x44a9b4[_0x06b2('0x18')](_0x810a12)[_0x06b2('0x19')]();};}function respondWithResult(_0xa81f11,_0x2822e9){_0x2822e9=_0x2822e9||0xc8;return function(_0x26faee){if(_0x26faee){return _0xa81f11['status'](_0x2822e9)[_0x06b2('0x1a')](_0x26faee);}};}function respondWithFilteredResult(_0xaee98c,_0x47496c){return function(_0x3830e9){if(_0x3830e9){var _0xef0466=typeof _0x47496c[_0x06b2('0x1b')]==='undefined'&&typeof _0x47496c[_0x06b2('0x1c')]===_0x06b2('0x1d');var _0x525945=_0x3830e9[_0x06b2('0x1e')];var _0x594b48=_0xef0466?0x0:_0x47496c['offset'];var _0x192270=_0xef0466?_0x3830e9[_0x06b2('0x1e')]:_0x47496c[_0x06b2('0x1b')]+_0x47496c[_0x06b2('0x1c')];var _0x4c4e21;if(_0x192270>=_0x525945){_0x192270=_0x525945;_0x4c4e21=0xc8;}else{_0x4c4e21=0xce;}_0xaee98c[_0x06b2('0x18')](_0x4c4e21);return _0xaee98c[_0x06b2('0x1f')](_0x06b2('0x20'),_0x594b48+'-'+_0x192270+'/'+_0x525945)[_0x06b2('0x1a')](_0x3830e9);}return null;};}function patchUpdates(_0xe28985){return function(_0x368ad8){try{jsonpatch[_0x06b2('0x21')](_0x368ad8,_0xe28985,!![]);}catch(_0x5ca622){return BPromise[_0x06b2('0x22')](_0x5ca622);}return _0x368ad8[_0x06b2('0x23')]();};}function saveUpdates(_0xb05f65,_0x208384){return function(_0x4e2a4c){if(_0x4e2a4c){return _0x4e2a4c['update'](_0xb05f65)[_0x06b2('0x24')](function(_0xb5231e){return _0xb5231e;});}return null;};}function removeEntity(_0x4fc95f,_0x39659f){return function(_0x5e40f2){if(_0x5e40f2){return _0x5e40f2[_0x06b2('0x25')]()[_0x06b2('0x24')](function(){_0x4fc95f[_0x06b2('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4382ce,_0x306ce){return function(_0xc65820){if(!_0xc65820){_0x4382ce[_0x06b2('0x17')](0x194);}return _0xc65820;};}function handleError(_0x1173fc,_0x4f5e90){_0x4f5e90=_0x4f5e90||0x1f4;return function(_0xbb00ea){logger[_0x06b2('0x26')](_0xbb00ea[_0x06b2('0x27')]);if(_0xbb00ea[_0x06b2('0x28')]){delete _0xbb00ea[_0x06b2('0x28')];}_0x1173fc[_0x06b2('0x18')](_0x4f5e90)['send'](_0xbb00ea);};}exports[_0x06b2('0x29')]=function(_0x2a3228,_0x2720fa){var _0x13c0eb={},_0x1f02d8={},_0x1bfaa9={'count':0x0,'rows':[]};var _0x3668bb=_['map'](db[_0x06b2('0x2a')][_0x06b2('0x2b')],function(_0x1637c2){return{'name':_0x1637c2[_0x06b2('0x2c')],'type':_0x1637c2[_0x06b2('0x2d')][_0x06b2('0x2e')]};});_0x1f02d8[_0x06b2('0x2f')]=_[_0x06b2('0x30')](_0x3668bb,'name');_0x1f02d8[_0x06b2('0x31')]=_[_0x06b2('0x32')](_0x2a3228[_0x06b2('0x31')]);_0x1f02d8[_0x06b2('0x33')]=_[_0x06b2('0x34')](_0x1f02d8[_0x06b2('0x2f')],_0x1f02d8[_0x06b2('0x31')]);_0x13c0eb['attributes']=_['intersection'](_0x1f02d8[_0x06b2('0x2f')],qs[_0x06b2('0x35')](_0x2a3228[_0x06b2('0x31')]['fields']));_0x13c0eb[_0x06b2('0x36')]=_0x13c0eb[_0x06b2('0x36')][_0x06b2('0x37')]?_0x13c0eb[_0x06b2('0x36')]:_0x1f02d8[_0x06b2('0x2f')];if(!_0x2a3228[_0x06b2('0x31')]['hasOwnProperty'](_0x06b2('0x38'))){_0x13c0eb[_0x06b2('0x1c')]=qs[_0x06b2('0x1c')](_0x2a3228['query'][_0x06b2('0x1c')]);_0x13c0eb[_0x06b2('0x1b')]=qs['offset'](_0x2a3228[_0x06b2('0x31')][_0x06b2('0x1b')]);}_0x13c0eb[_0x06b2('0x39')]=qs[_0x06b2('0x3a')](_0x2a3228[_0x06b2('0x31')][_0x06b2('0x3a')]);_0x13c0eb[_0x06b2('0x3b')]=qs[_0x06b2('0x33')](_[_0x06b2('0x3c')](_0x2a3228[_0x06b2('0x31')],_0x1f02d8[_0x06b2('0x33')]),_0x3668bb);if(_0x2a3228[_0x06b2('0x31')]['filter']){_0x13c0eb[_0x06b2('0x3b')]=_['merge'](_0x13c0eb['where'],{'$or':_[_0x06b2('0x30')](_0x3668bb,function(_0x4e92e0){if(_0x4e92e0[_0x06b2('0x2d')]!=='VIRTUAL'){var _0x35e29c={};_0x35e29c[_0x4e92e0[_0x06b2('0x28')]]={'$like':'%'+_0x2a3228[_0x06b2('0x31')][_0x06b2('0x3d')]+'%'};return _0x35e29c;}})});}_0x13c0eb=_[_0x06b2('0x3e')]({},_0x13c0eb,_0x2a3228['options']);var _0x404eab={'where':_0x13c0eb[_0x06b2('0x3b')]};return db[_0x06b2('0x2a')][_0x06b2('0x1e')](_0x404eab)[_0x06b2('0x24')](function(_0x39fd60){_0x1bfaa9['count']=_0x39fd60;if(_0x2a3228[_0x06b2('0x31')][_0x06b2('0x3f')]){_0x13c0eb['include']=[{'all':!![]}];}return db['WhatsappQueueReport'][_0x06b2('0x40')](_0x13c0eb);})[_0x06b2('0x24')](function(_0x286c9b){_0x1bfaa9[_0x06b2('0x41')]=_0x286c9b;return _0x1bfaa9;})[_0x06b2('0x24')](respondWithFilteredResult(_0x2720fa,_0x13c0eb))[_0x06b2('0x42')](handleError(_0x2720fa,null));};exports[_0x06b2('0x43')]=function(_0x2ff968,_0x2e2a80){var _0x117bf4={'raw':!![],'where':{'id':_0x2ff968[_0x06b2('0x44')]['id']}},_0x1d7750={};_0x1d7750[_0x06b2('0x2f')]=_[_0x06b2('0x32')](db[_0x06b2('0x2a')][_0x06b2('0x2b')]);_0x1d7750[_0x06b2('0x31')]=_[_0x06b2('0x32')](_0x2ff968[_0x06b2('0x31')]);_0x1d7750['filters']=_[_0x06b2('0x34')](_0x1d7750[_0x06b2('0x2f')],_0x1d7750[_0x06b2('0x31')]);_0x117bf4[_0x06b2('0x36')]=_['intersection'](_0x1d7750[_0x06b2('0x2f')],qs[_0x06b2('0x35')](_0x2ff968['query'][_0x06b2('0x35')]));_0x117bf4[_0x06b2('0x36')]=_0x117bf4['attributes'][_0x06b2('0x37')]?_0x117bf4[_0x06b2('0x36')]:_0x1d7750['model'];if(_0x2ff968['query']['includeAll']){_0x117bf4[_0x06b2('0x45')]=[{'all':!![]}];}_0x117bf4=_[_0x06b2('0x3e')]({},_0x117bf4,_0x2ff968[_0x06b2('0x46')]);return db[_0x06b2('0x2a')][_0x06b2('0x47')](_0x117bf4)['then'](handleEntityNotFound(_0x2e2a80,null))['then'](respondWithResult(_0x2e2a80,null))[_0x06b2('0x42')](handleError(_0x2e2a80,null));};exports[_0x06b2('0x48')]=function(_0x979759,_0x1f4d89){return db[_0x06b2('0x2a')][_0x06b2('0x48')](_0x979759['body'],{})[_0x06b2('0x24')](respondWithResult(_0x1f4d89,0xc9))[_0x06b2('0x42')](handleError(_0x1f4d89,null));};exports[_0x06b2('0x49')]=function(_0x33f72e,_0x146c5c){if(_0x33f72e[_0x06b2('0x4a')]['id']){delete _0x33f72e['body']['id'];}return db[_0x06b2('0x2a')][_0x06b2('0x47')]({'where':{'id':_0x33f72e[_0x06b2('0x44')]['id']}})[_0x06b2('0x24')](handleEntityNotFound(_0x146c5c,null))['then'](saveUpdates(_0x33f72e[_0x06b2('0x4a')],null))[_0x06b2('0x24')](respondWithResult(_0x146c5c,null))[_0x06b2('0x42')](handleError(_0x146c5c,null));};exports[_0x06b2('0x25')]=function(_0x546c9e,_0x346f04){return db[_0x06b2('0x2a')][_0x06b2('0x47')]({'where':{'id':_0x546c9e[_0x06b2('0x44')]['id']}})[_0x06b2('0x24')](handleEntityNotFound(_0x346f04,null))[_0x06b2('0x24')](removeEntity(_0x346f04,null))[_0x06b2('0x42')](handleError(_0x346f04,null));};exports[_0x06b2('0x4b')]=function(_0x568091,_0x33bc8e){return db[_0x06b2('0x2a')][_0x06b2('0x4b')]()[_0x06b2('0x24')](respondWithResult(_0x33bc8e,null))[_0x06b2('0x42')](handleError(_0x33bc8e,null));}; \ No newline at end of file +var _0x087b=['name','send','index','map','WhatsappQueueReport','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','merge','find','create','body','update','params','describe','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../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','apply','reject','save','then','error','stack'];(function(_0x597cc7,_0x31a1e2){var _0x51f55b=function(_0x133fc6){while(--_0x133fc6){_0x597cc7['push'](_0x597cc7['shift']());}};_0x51f55b(++_0x31a1e2);}(_0x087b,0x11a));var _0xb087=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0x087b[_0x3ea913];return _0x2b4f28;};'use strict';var emlformat=require(_0xb087('0x0'));var rimraf=require(_0xb087('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb087('0x2'));var moment=require('moment');var BPromise=require(_0xb087('0x3'));var Mustache=require(_0xb087('0x4'));var util=require(_0xb087('0x5'));var path=require(_0xb087('0x6'));var sox=require(_0xb087('0x7'));var csv=require(_0xb087('0x8'));var ejs=require(_0xb087('0x9'));var fs=require('fs');var fs_extra=require(_0xb087('0xa'));var _=require(_0xb087('0xb'));var squel=require(_0xb087('0xc'));var crypto=require(_0xb087('0xd'));var jsforce=require(_0xb087('0xe'));var deskjs=require(_0xb087('0xf'));var toCsv=require(_0xb087('0x8'));var querystring=require(_0xb087('0x10'));var Papa=require(_0xb087('0x11'));var Redis=require(_0xb087('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb087('0x13'));var as=require(_0xb087('0x14'));var hardwareService=require(_0xb087('0x15'));var logger=require(_0xb087('0x16'))(_0xb087('0x17'));var utils=require(_0xb087('0x18'));var config=require(_0xb087('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xb087('0x1a'))['db'];function respondWithStatusCode(_0x31f977,_0x323656){_0x323656=_0x323656||0xcc;return function(_0x51ceaa){if(_0x51ceaa){return _0x31f977[_0xb087('0x1b')](_0x323656);}return _0x31f977[_0xb087('0x1c')](_0x323656)[_0xb087('0x1d')]();};}function respondWithResult(_0x46410b,_0x11784c){_0x11784c=_0x11784c||0xc8;return function(_0x12d0db){if(_0x12d0db){return _0x46410b[_0xb087('0x1c')](_0x11784c)[_0xb087('0x1e')](_0x12d0db);}};}function respondWithFilteredResult(_0x24e1a3,_0x16d0b7){return function(_0x5193a4){if(_0x5193a4){var _0x43e576=typeof _0x16d0b7[_0xb087('0x1f')]==='undefined'&&typeof _0x16d0b7[_0xb087('0x20')]===_0xb087('0x21');var _0x2e9e74=_0x5193a4['count'];var _0x330005=_0x43e576?0x0:_0x16d0b7[_0xb087('0x1f')];var _0x17200d=_0x43e576?_0x5193a4[_0xb087('0x22')]:_0x16d0b7['offset']+_0x16d0b7[_0xb087('0x20')];var _0x28428e;if(_0x17200d>=_0x2e9e74){_0x17200d=_0x2e9e74;_0x28428e=0xc8;}else{_0x28428e=0xce;}_0x24e1a3[_0xb087('0x1c')](_0x28428e);return _0x24e1a3[_0xb087('0x23')]('Content-Range',_0x330005+'-'+_0x17200d+'/'+_0x2e9e74)['json'](_0x5193a4);}return null;};}function patchUpdates(_0x5ea3dc){return function(_0x49450a){try{jsonpatch[_0xb087('0x24')](_0x49450a,_0x5ea3dc,!![]);}catch(_0x17be8e){return BPromise[_0xb087('0x25')](_0x17be8e);}return _0x49450a[_0xb087('0x26')]();};}function saveUpdates(_0x1fb765,_0x258b4c){return function(_0x31ae01){if(_0x31ae01){return _0x31ae01['update'](_0x1fb765)[_0xb087('0x27')](function(_0x466397){return _0x466397;});}return null;};}function removeEntity(_0x1de654,_0x1cfb3e){return function(_0x3ad74e){if(_0x3ad74e){return _0x3ad74e['destroy']()[_0xb087('0x27')](function(){_0x1de654[_0xb087('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a2dc6,_0x50745a){return function(_0x598b99){if(!_0x598b99){_0x5a2dc6['sendStatus'](0x194);}return _0x598b99;};}function handleError(_0x304840,_0x45685d){_0x45685d=_0x45685d||0x1f4;return function(_0x1d124f){logger[_0xb087('0x28')](_0x1d124f[_0xb087('0x29')]);if(_0x1d124f[_0xb087('0x2a')]){delete _0x1d124f[_0xb087('0x2a')];}_0x304840[_0xb087('0x1c')](_0x45685d)[_0xb087('0x2b')](_0x1d124f);};}exports[_0xb087('0x2c')]=function(_0x18058c,_0x31e3e6){var _0xb0baf6={},_0x263259={},_0x593b78={'count':0x0,'rows':[]};var _0x37393a=_[_0xb087('0x2d')](db[_0xb087('0x2e')][_0xb087('0x2f')],function(_0x22d441){return{'name':_0x22d441[_0xb087('0x30')],'type':_0x22d441[_0xb087('0x31')][_0xb087('0x32')]};});_0x263259['model']=_['map'](_0x37393a,_0xb087('0x2a'));_0x263259[_0xb087('0x33')]=_['keys'](_0x18058c[_0xb087('0x33')]);_0x263259[_0xb087('0x34')]=_[_0xb087('0x35')](_0x263259[_0xb087('0x36')],_0x263259[_0xb087('0x33')]);_0xb0baf6[_0xb087('0x37')]=_[_0xb087('0x35')](_0x263259[_0xb087('0x36')],qs[_0xb087('0x38')](_0x18058c[_0xb087('0x33')][_0xb087('0x38')]));_0xb0baf6[_0xb087('0x37')]=_0xb0baf6['attributes'][_0xb087('0x39')]?_0xb0baf6['attributes']:_0x263259[_0xb087('0x36')];if(!_0x18058c[_0xb087('0x33')][_0xb087('0x3a')](_0xb087('0x3b'))){_0xb0baf6[_0xb087('0x20')]=qs[_0xb087('0x20')](_0x18058c[_0xb087('0x33')][_0xb087('0x20')]);_0xb0baf6[_0xb087('0x1f')]=qs['offset'](_0x18058c['query'][_0xb087('0x1f')]);}_0xb0baf6[_0xb087('0x3c')]=qs[_0xb087('0x3d')](_0x18058c[_0xb087('0x33')][_0xb087('0x3d')]);_0xb0baf6['where']=qs[_0xb087('0x34')](_[_0xb087('0x3e')](_0x18058c['query'],_0x263259['filters']),_0x37393a);if(_0x18058c[_0xb087('0x33')][_0xb087('0x3f')]){_0xb0baf6[_0xb087('0x40')]=_['merge'](_0xb0baf6[_0xb087('0x40')],{'$or':_[_0xb087('0x2d')](_0x37393a,function(_0x1caa6e){if(_0x1caa6e[_0xb087('0x31')]!==_0xb087('0x41')){var _0x5db6b9={};_0x5db6b9[_0x1caa6e[_0xb087('0x2a')]]={'$like':'%'+_0x18058c['query'][_0xb087('0x3f')]+'%'};return _0x5db6b9;}})});}_0xb0baf6=_['merge']({},_0xb0baf6,_0x18058c[_0xb087('0x42')]);var _0xc9f9e9={'where':_0xb0baf6['where']};return db[_0xb087('0x2e')]['count'](_0xc9f9e9)[_0xb087('0x27')](function(_0x4a360c){_0x593b78[_0xb087('0x22')]=_0x4a360c;if(_0x18058c[_0xb087('0x33')][_0xb087('0x43')]){_0xb0baf6[_0xb087('0x44')]=[{'all':!![]}];}return db[_0xb087('0x2e')][_0xb087('0x45')](_0xb0baf6);})[_0xb087('0x27')](function(_0x5e7690){_0x593b78[_0xb087('0x46')]=_0x5e7690;return _0x593b78;})['then'](respondWithFilteredResult(_0x31e3e6,_0xb0baf6))[_0xb087('0x47')](handleError(_0x31e3e6,null));};exports[_0xb087('0x48')]=function(_0x5b6924,_0xb662bf){var _0x45dc6f={'raw':!![],'where':{'id':_0x5b6924['params']['id']}},_0x7650c5={};_0x7650c5[_0xb087('0x36')]=_['keys'](db[_0xb087('0x2e')][_0xb087('0x2f')]);_0x7650c5['query']=_[_0xb087('0x49')](_0x5b6924[_0xb087('0x33')]);_0x7650c5['filters']=_[_0xb087('0x35')](_0x7650c5[_0xb087('0x36')],_0x7650c5['query']);_0x45dc6f[_0xb087('0x37')]=_[_0xb087('0x35')](_0x7650c5[_0xb087('0x36')],qs[_0xb087('0x38')](_0x5b6924['query']['fields']));_0x45dc6f[_0xb087('0x37')]=_0x45dc6f[_0xb087('0x37')][_0xb087('0x39')]?_0x45dc6f[_0xb087('0x37')]:_0x7650c5[_0xb087('0x36')];if(_0x5b6924[_0xb087('0x33')]['includeAll']){_0x45dc6f['include']=[{'all':!![]}];}_0x45dc6f=_[_0xb087('0x4a')]({},_0x45dc6f,_0x5b6924['options']);return db[_0xb087('0x2e')][_0xb087('0x4b')](_0x45dc6f)[_0xb087('0x27')](handleEntityNotFound(_0xb662bf,null))[_0xb087('0x27')](respondWithResult(_0xb662bf,null))['catch'](handleError(_0xb662bf,null));};exports[_0xb087('0x4c')]=function(_0x562751,_0x2fe8a0){return db[_0xb087('0x2e')][_0xb087('0x4c')](_0x562751[_0xb087('0x4d')],{})[_0xb087('0x27')](respondWithResult(_0x2fe8a0,0xc9))['catch'](handleError(_0x2fe8a0,null));};exports[_0xb087('0x4e')]=function(_0xb15e28,_0x588d96){if(_0xb15e28['body']['id']){delete _0xb15e28[_0xb087('0x4d')]['id'];}return db['WhatsappQueueReport']['find']({'where':{'id':_0xb15e28[_0xb087('0x4f')]['id']}})[_0xb087('0x27')](handleEntityNotFound(_0x588d96,null))['then'](saveUpdates(_0xb15e28[_0xb087('0x4d')],null))[_0xb087('0x27')](respondWithResult(_0x588d96,null))[_0xb087('0x47')](handleError(_0x588d96,null));};exports['destroy']=function(_0x5ba160,_0x30cc83){return db['WhatsappQueueReport']['find']({'where':{'id':_0x5ba160[_0xb087('0x4f')]['id']}})[_0xb087('0x27')](handleEntityNotFound(_0x30cc83,null))[_0xb087('0x27')](removeEntity(_0x30cc83,null))[_0xb087('0x47')](handleError(_0x30cc83,null));};exports[_0xb087('0x50')]=function(_0x148642,_0xbd849d){return db[_0xb087('0x2e')][_0xb087('0x50')]()[_0xb087('0x27')](respondWithResult(_0xbd849d,null))[_0xb087('0x47')](handleError(_0xbd849d,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 3efe80f..e207ca0 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 _0x5ab1=['./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x286c82,_0x563a51){var _0x5265a4=function(_0x36d34a){while(--_0x36d34a){_0x286c82['push'](_0x286c82['shift']());}};_0x5265a4(++_0x563a51);}(_0x5ab1,0x148));var _0x15ab=function(_0x48d0bc,_0x291f6d){_0x48d0bc=_0x48d0bc-0x0;var _0xc90fae=_0x5ab1[_0x48d0bc];return _0xc90fae;};'use strict';var _=require(_0x15ab('0x0'));var util=require('util');var logger=require(_0x15ab('0x1'))(_0x15ab('0x2'));var moment=require(_0x15ab('0x3'));var BPromise=require(_0x15ab('0x4'));var rp=require(_0x15ab('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x15ab('0x6'));var config=require(_0x15ab('0x7'));var attributes=require(_0x15ab('0x8'));module[_0x15ab('0x9')]=function(_0x1d645e,_0x58e169){return _0x1d645e[_0x15ab('0xa')](_0x15ab('0xb'),attributes,{'tableName':_0x15ab('0xc'),'paranoid':![],'indexes':[{'name':_0x15ab('0xd'),'fields':[_0x15ab('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb190=['uniqueid','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','report_whatsapp_queue'];(function(_0x3308ad,_0x20cd38){var _0x17a1fb=function(_0x2765b3){while(--_0x2765b3){_0x3308ad['push'](_0x3308ad['shift']());}};_0x17a1fb(++_0x20cd38);}(_0xb190,0x10b));var _0x0b19=function(_0x5cf623,_0x245772){_0x5cf623=_0x5cf623-0x0;var _0x1fa996=_0xb190[_0x5cf623];return _0x1fa996;};'use strict';var _=require(_0x0b19('0x0'));var util=require(_0x0b19('0x1'));var logger=require('../../config/logger')(_0x0b19('0x2'));var moment=require(_0x0b19('0x3'));var BPromise=require(_0x0b19('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0b19('0x5'));var rimraf=require(_0x0b19('0x6'));var config=require(_0x0b19('0x7'));var attributes=require(_0x0b19('0x8'));module[_0x0b19('0x9')]=function(_0x54caf7,_0x18642f){return _0x54caf7[_0x0b19('0xa')](_0x0b19('0xb'),attributes,{'tableName':_0x0b19('0xc'),'paranoid':![],'indexes':[{'name':_0x0b19('0xd'),'fields':[_0x0b19('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 ae77a14..0fc5f5d 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 _0xbcb8=['update','where','attributes','limit','UpdateWhatsappQueueReport','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','body','options','raw','stringify'];(function(_0x42f009,_0x5e27b1){var _0x22a1e0=function(_0x297993){while(--_0x297993){_0x42f009['push'](_0x42f009['shift']());}};_0x22a1e0(++_0x5e27b1);}(_0xbcb8,0x85));var _0x8bcb=function(_0x226b42,_0xc8d7e9){_0x226b42=_0x226b42-0x0;var _0x13d20d=_0xbcb8[_0x226b42];return _0x13d20d;};'use strict';var _=require(_0x8bcb('0x0'));var util=require('util');var moment=require(_0x8bcb('0x1'));var BPromise=require('bluebird');var rs=require(_0x8bcb('0x2'));var fs=require('fs');var Redis=require(_0x8bcb('0x3'));var db=require(_0x8bcb('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8bcb('0x5'))(_0x8bcb('0x6'));var config=require(_0x8bcb('0x7'));var jayson=require(_0x8bcb('0x8'));var client=jayson[_0x8bcb('0x9')][_0x8bcb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ebbf4,_0x4dafe6,_0x527e64){return new BPromise(function(_0x52594f,_0x2f69fb){return client[_0x8bcb('0xb')](_0x5ebbf4,_0x527e64)[_0x8bcb('0xc')](function(_0x288852){logger[_0x8bcb('0xd')](_0x8bcb('0xe'),_0x4dafe6,_0x8bcb('0xf'));logger[_0x8bcb('0x10')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x4dafe6,_0x8bcb('0xf'),JSON['stringify'](_0x288852));if(_0x288852[_0x8bcb('0x11')]){if(_0x288852[_0x8bcb('0x11')]['code']===0x1f4){logger[_0x8bcb('0x11')]('WhatsappQueueReport,\x20%s,\x20%s',_0x4dafe6,_0x288852['error']['message']);return _0x2f69fb(_0x288852[_0x8bcb('0x11')]['message']);}logger['error'](_0x8bcb('0xe'),_0x4dafe6,_0x288852[_0x8bcb('0x11')]['message']);return _0x52594f(_0x288852['error'][_0x8bcb('0x12')]);}else{logger[_0x8bcb('0xd')](_0x8bcb('0xe'),_0x4dafe6,'request\x20sent');_0x52594f(_0x288852[_0x8bcb('0x13')][_0x8bcb('0x12')]);}})[_0x8bcb('0x14')](function(_0x4058aa){logger[_0x8bcb('0x11')](_0x8bcb('0xe'),_0x4dafe6,_0x4058aa);_0x2f69fb(_0x4058aa);});});}exports[_0x8bcb('0x15')]=function(_0x5f3e9f){var _0x211a4c=this;return new Promise(function(_0x1af04d,_0x1c4d2a){return db[_0x8bcb('0x16')]['create'](_0x5f3e9f[_0x8bcb('0x17')],{'raw':_0x5f3e9f['options']?_0x5f3e9f[_0x8bcb('0x18')][_0x8bcb('0x19')]===undefined?!![]:![]:!![]})[_0x8bcb('0xc')](function(_0x5ab571){logger[_0x8bcb('0xd')](_0x8bcb('0x15'),_0x5f3e9f);logger[_0x8bcb('0x10')]('CreateWhatsappQueueReport',_0x5f3e9f,JSON[_0x8bcb('0x1a')](_0x5ab571));_0x1af04d(_0x5ab571);})[_0x8bcb('0x14')](function(_0x5839d6){logger['error'](_0x8bcb('0x15'),_0x5839d6[_0x8bcb('0x12')],_0x5f3e9f);_0x1c4d2a(_0x211a4c['error'](0x1f4,_0x5839d6[_0x8bcb('0x12')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x4b0a7f){var _0x428243=this;return new Promise(function(_0x57a14d,_0x34c576){return db['WhatsappQueueReport'][_0x8bcb('0x1b')](_0x4b0a7f[_0x8bcb('0x17')],{'raw':_0x4b0a7f[_0x8bcb('0x18')]?_0x4b0a7f[_0x8bcb('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b0a7f[_0x8bcb('0x18')]?_0x4b0a7f[_0x8bcb('0x18')][_0x8bcb('0x1c')]||null:null,'attributes':_0x4b0a7f[_0x8bcb('0x18')]?_0x4b0a7f[_0x8bcb('0x18')][_0x8bcb('0x1d')]||null:null,'limit':_0x4b0a7f[_0x8bcb('0x18')]?_0x4b0a7f[_0x8bcb('0x18')][_0x8bcb('0x1e')]||null:null})['then'](function(_0x5e6fb4){logger['info']('UpdateWhatsappQueueReport',_0x4b0a7f);logger[_0x8bcb('0x10')](_0x8bcb('0x1f'),_0x4b0a7f,JSON['stringify'](_0x5e6fb4));_0x57a14d(_0x5e6fb4);})['catch'](function(_0x43df14){logger[_0x8bcb('0x11')](_0x8bcb('0x1f'),_0x43df14[_0x8bcb('0x12')],_0x4b0a7f);_0x34c576(_0x428243[_0x8bcb('0x11')](0x1f4,_0x43df14[_0x8bcb('0x12')]));});});}; \ No newline at end of file +var _0x46eb=['request','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','WhatsappQueueReport','create','body','options','raw','then','CreateWhatsappQueueReport','catch','UpdateWhatsappQueueReport','update','where','attributes','limit','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0x4baf53,_0x457861){var _0x454573=function(_0x5cf80c){while(--_0x5cf80c){_0x4baf53['push'](_0x4baf53['shift']());}};_0x454573(++_0x457861);}(_0x46eb,0x9b));var _0xb46e=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x46eb[_0x21a9d9];return _0x46adce;};'use strict';var _=require('lodash');var util=require(_0xb46e('0x0'));var moment=require(_0xb46e('0x1'));var BPromise=require(_0xb46e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb46e('0x3'));var db=require(_0xb46e('0x4'))['db'];var utils=require(_0xb46e('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xb46e('0x6'));var jayson=require(_0xb46e('0x7'));var client=jayson[_0xb46e('0x8')][_0xb46e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e9c50,_0x414841,_0x22e0d4){return new BPromise(function(_0x338afb,_0xd7c600){return client[_0xb46e('0xa')](_0x3e9c50,_0x22e0d4)['then'](function(_0x1e7d45){logger['info'](_0xb46e('0xb'),_0x414841,_0xb46e('0xc'));logger[_0xb46e('0xd')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x414841,_0xb46e('0xc'),JSON[_0xb46e('0xe')](_0x1e7d45));if(_0x1e7d45[_0xb46e('0xf')]){if(_0x1e7d45[_0xb46e('0xf')][_0xb46e('0x10')]===0x1f4){logger[_0xb46e('0xf')]('WhatsappQueueReport,\x20%s,\x20%s',_0x414841,_0x1e7d45['error'][_0xb46e('0x11')]);return _0xd7c600(_0x1e7d45[_0xb46e('0xf')][_0xb46e('0x11')]);}logger[_0xb46e('0xf')](_0xb46e('0xb'),_0x414841,_0x1e7d45['error']['message']);return _0x338afb(_0x1e7d45[_0xb46e('0xf')][_0xb46e('0x11')]);}else{logger[_0xb46e('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0x414841,_0xb46e('0xc'));_0x338afb(_0x1e7d45[_0xb46e('0x13')][_0xb46e('0x11')]);}})['catch'](function(_0x345e78){logger[_0xb46e('0xf')](_0xb46e('0xb'),_0x414841,_0x345e78);_0xd7c600(_0x345e78);});});}exports['CreateWhatsappQueueReport']=function(_0x4916c6){var _0x2f5cd4=this;return new Promise(function(_0x12dbe9,_0x1ac80c){return db[_0xb46e('0x14')][_0xb46e('0x15')](_0x4916c6[_0xb46e('0x16')],{'raw':_0x4916c6[_0xb46e('0x17')]?_0x4916c6[_0xb46e('0x17')][_0xb46e('0x18')]===undefined?!![]:![]:!![]})[_0xb46e('0x19')](function(_0x28b7f5){logger[_0xb46e('0x12')](_0xb46e('0x1a'),_0x4916c6);logger['debug']('CreateWhatsappQueueReport',_0x4916c6,JSON[_0xb46e('0xe')](_0x28b7f5));_0x12dbe9(_0x28b7f5);})[_0xb46e('0x1b')](function(_0x13fcd1){logger[_0xb46e('0xf')]('CreateWhatsappQueueReport',_0x13fcd1['message'],_0x4916c6);_0x1ac80c(_0x2f5cd4[_0xb46e('0xf')](0x1f4,_0x13fcd1[_0xb46e('0x11')]));});});};exports[_0xb46e('0x1c')]=function(_0xf26469){var _0x56e4f2=this;return new Promise(function(_0x230485,_0xe4a3af){return db[_0xb46e('0x14')][_0xb46e('0x1d')](_0xf26469[_0xb46e('0x16')],{'raw':_0xf26469['options']?_0xf26469[_0xb46e('0x17')][_0xb46e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf26469['options']?_0xf26469[_0xb46e('0x17')][_0xb46e('0x1e')]||null:null,'attributes':_0xf26469[_0xb46e('0x17')]?_0xf26469[_0xb46e('0x17')][_0xb46e('0x1f')]||null:null,'limit':_0xf26469['options']?_0xf26469[_0xb46e('0x17')][_0xb46e('0x20')]||null:null})['then'](function(_0x246a55){logger[_0xb46e('0x12')](_0xb46e('0x1c'),_0xf26469);logger[_0xb46e('0xd')](_0xb46e('0x1c'),_0xf26469,JSON[_0xb46e('0xe')](_0x246a55));_0x230485(_0x246a55);})['catch'](function(_0x312a09){logger['error'](_0xb46e('0x1c'),_0x312a09[_0xb46e('0x11')],_0xf26469);_0xe4a3af(_0x56e4f2[_0xb46e('0xf')](0x1f4,_0x312a09[_0xb46e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 92b013a..60eae4e 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 _0x1301=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','destroy','exports','multer'];(function(_0x107ad9,_0x5509c9){var _0x28cb4a=function(_0x1e6c31){while(--_0x1e6c31){_0x107ad9['push'](_0x107ad9['shift']());}};_0x28cb4a(++_0x5509c9);}(_0x1301,0xe5));var _0x1130=function(_0x33bd56,_0x3383aa){_0x33bd56=_0x33bd56-0x0;var _0x40c502=_0x1301[_0x33bd56];return _0x40c502;};'use strict';var multer=require(_0x1130('0x0'));var util=require(_0x1130('0x1'));var path=require(_0x1130('0x2'));var timeout=require(_0x1130('0x3'));var express=require(_0x1130('0x4'));var router=express[_0x1130('0x5')]();var fs_extra=require(_0x1130('0x6'));var auth=require(_0x1130('0x7'));var interaction=require(_0x1130('0x8'));var config=require(_0x1130('0x9'));var controller=require(_0x1130('0xa'));router[_0x1130('0xb')]('/',auth[_0x1130('0xc')](),controller[_0x1130('0xd')]);router[_0x1130('0xb')](_0x1130('0xe'),auth[_0x1130('0xc')](),controller[_0x1130('0xf')]);router[_0x1130('0xb')](_0x1130('0x10'),auth[_0x1130('0xc')](),controller['show']);router[_0x1130('0x11')]('/',auth[_0x1130('0xc')](),controller[_0x1130('0x12')]);router[_0x1130('0x13')]('/:id',auth[_0x1130('0xc')](),controller[_0x1130('0x14')]);router['delete']('/:id',auth[_0x1130('0xc')](),controller[_0x1130('0x15')]);module[_0x1130('0x16')]=router; \ No newline at end of file +var _0xa648=['../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','isAuthenticated','get','/describe','describe','create','put','/:id','update','delete','exports','multer','util','connect-timeout','express','../../components/auth/service'];(function(_0x4896ba,_0x331c83){var _0x18ba92=function(_0x54b7cb){while(--_0x54b7cb){_0x4896ba['push'](_0x4896ba['shift']());}};_0x18ba92(++_0x331c83);}(_0xa648,0xaf));var _0x8a64=function(_0x31ea7c,_0xd97210){_0x31ea7c=_0x31ea7c-0x0;var _0x57df2d=_0xa648[_0x31ea7c];return _0x57df2d;};'use strict';var multer=require(_0x8a64('0x0'));var util=require(_0x8a64('0x1'));var path=require('path');var timeout=require(_0x8a64('0x2'));var express=require(_0x8a64('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8a64('0x4'));var interaction=require(_0x8a64('0x5'));var config=require(_0x8a64('0x6'));var controller=require(_0x8a64('0x7'));router['get']('/',auth[_0x8a64('0x8')](),controller['index']);router[_0x8a64('0x9')](_0x8a64('0xa'),auth[_0x8a64('0x8')](),controller[_0x8a64('0xb')]);router['get']('/:id',auth[_0x8a64('0x8')](),controller['show']);router['post']('/',auth[_0x8a64('0x8')](),controller[_0x8a64('0xc')]);router[_0x8a64('0xd')](_0x8a64('0xe'),auth[_0x8a64('0x8')](),controller[_0x8a64('0xf')]);router[_0x8a64('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x8a64('0x11')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index a2e5f74..af64e74 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 _0xd844=['exports','ENUM','account','DATE','sequelize'];(function(_0xf0bcac,_0x531755){var _0x4e4c65=function(_0x35a77a){while(--_0x35a77a){_0xf0bcac['push'](_0xf0bcac['shift']());}};_0x4e4c65(++_0x531755);}(_0xd844,0x6d));var _0x4d84=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xd844[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0x4d84('0x0'));module[_0x4d84('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x4d84('0x2')](_0x4d84('0x3'),'agent','queue'),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x4d84('0x4')]}}; \ No newline at end of file +var _0x1681=['STRING','ENUM','account','agent','queue','DATE'];(function(_0x4007c4,_0x59a06e){var _0x2cf513=function(_0x423501){while(--_0x423501){_0x4007c4['push'](_0x4007c4['shift']());}};_0x2cf513(++_0x59a06e);}(_0x1681,0x12c));var _0x1168=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1681[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x1168('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x1168('0x1')](_0x1168('0x2'),_0x1168('0x3'),_0x1168('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x1168('0x5')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 5e745f5..da60a0e 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 _0x9a44=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','stack','name','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','order','sort','pick','filter','where','merge','WhatsappTransferReport','includeAll','findAll','catch','show','params','length','include','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x422461,_0x4ed604){var _0xfa8561=function(_0x3252e1){while(--_0x3252e1){_0x422461['push'](_0x422461['shift']());}};_0xfa8561(++_0x4ed604);}(_0x9a44,0xc2));var _0x49a4=function(_0x17d6db,_0x734ff3){_0x17d6db=_0x17d6db-0x0;var _0x4321d1=_0x9a44[_0x17d6db];return _0x4321d1;};'use strict';var emlformat=require(_0x49a4('0x0'));var rimraf=require(_0x49a4('0x1'));var zipdir=require(_0x49a4('0x2'));var jsonpatch=require(_0x49a4('0x3'));var rp=require('request-promise');var moment=require(_0x49a4('0x4'));var BPromise=require(_0x49a4('0x5'));var Mustache=require(_0x49a4('0x6'));var util=require('util');var path=require(_0x49a4('0x7'));var sox=require(_0x49a4('0x8'));var csv=require('to-csv');var ejs=require(_0x49a4('0x9'));var fs=require('fs');var fs_extra=require(_0x49a4('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x49a4('0xb'));var deskjs=require(_0x49a4('0xc'));var toCsv=require(_0x49a4('0xd'));var querystring=require(_0x49a4('0xe'));var Papa=require('papaparse');var Redis=require(_0x49a4('0xf'));var authService=require(_0x49a4('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x49a4('0x11'));var hardwareService=require(_0x49a4('0x12'));var logger=require(_0x49a4('0x13'))(_0x49a4('0x14'));var utils=require(_0x49a4('0x15'));var config=require(_0x49a4('0x16'));var licenseUtil=require(_0x49a4('0x17'));var db=require(_0x49a4('0x18'))['db'];function respondWithStatusCode(_0x11c670,_0x663a47){_0x663a47=_0x663a47||0xcc;return function(_0x489efc){if(_0x489efc){return _0x11c670[_0x49a4('0x19')](_0x663a47);}return _0x11c670[_0x49a4('0x1a')](_0x663a47)[_0x49a4('0x1b')]();};}function respondWithResult(_0x32adfc,_0x3c487a){_0x3c487a=_0x3c487a||0xc8;return function(_0x2df61e){if(_0x2df61e){return _0x32adfc[_0x49a4('0x1a')](_0x3c487a)['json'](_0x2df61e);}};}function respondWithFilteredResult(_0x548833,_0x3f01a5){return function(_0x14814c){if(_0x14814c){var _0x22b5e1=typeof _0x3f01a5[_0x49a4('0x1c')]===_0x49a4('0x1d')&&typeof _0x3f01a5[_0x49a4('0x1e')]===_0x49a4('0x1d');var _0x32e309=_0x14814c['count'];var _0x2ee114=_0x22b5e1?0x0:_0x3f01a5[_0x49a4('0x1c')];var _0x5a94a7=_0x22b5e1?_0x14814c[_0x49a4('0x1f')]:_0x3f01a5[_0x49a4('0x1c')]+_0x3f01a5[_0x49a4('0x1e')];var _0x529141;if(_0x5a94a7>=_0x32e309){_0x5a94a7=_0x32e309;_0x529141=0xc8;}else{_0x529141=0xce;}_0x548833['status'](_0x529141);return _0x548833[_0x49a4('0x20')](_0x49a4('0x21'),_0x2ee114+'-'+_0x5a94a7+'/'+_0x32e309)['json'](_0x14814c);}return null;};}function patchUpdates(_0x2f821e){return function(_0x26a97c){try{jsonpatch[_0x49a4('0x22')](_0x26a97c,_0x2f821e,!![]);}catch(_0x476c79){return BPromise[_0x49a4('0x23')](_0x476c79);}return _0x26a97c[_0x49a4('0x24')]();};}function saveUpdates(_0x30dd1d,_0x44d81a){return function(_0x1f4687){if(_0x1f4687){return _0x1f4687[_0x49a4('0x25')](_0x30dd1d)[_0x49a4('0x26')](function(_0x26625f){return _0x26625f;});}return null;};}function removeEntity(_0x1f03de,_0x5912eb){return function(_0x1b7503){if(_0x1b7503){return _0x1b7503['destroy']()[_0x49a4('0x26')](function(){_0x1f03de['status'](0xcc)[_0x49a4('0x1b')]();});}};}function handleEntityNotFound(_0x56362b,_0x3cbd54){return function(_0x277779){if(!_0x277779){_0x56362b[_0x49a4('0x19')](0x194);}return _0x277779;};}function handleError(_0x5c0d3b,_0x139c8c){_0x139c8c=_0x139c8c||0x1f4;return function(_0x8e6285){logger['error'](_0x8e6285[_0x49a4('0x27')]);if(_0x8e6285[_0x49a4('0x28')]){delete _0x8e6285[_0x49a4('0x28')];}_0x5c0d3b[_0x49a4('0x1a')](_0x139c8c)['send'](_0x8e6285);};}exports[_0x49a4('0x29')]=function(_0x3b2e46,_0x18f8f0){var _0x1ffc75={},_0x44067b={},_0x9c9cc6={'count':0x0,'rows':[]};var _0x1a7c15=_[_0x49a4('0x2a')](db['WhatsappTransferReport'][_0x49a4('0x2b')],function(_0x3ebd9b){return{'name':_0x3ebd9b[_0x49a4('0x2c')],'type':_0x3ebd9b['type']['key']};});_0x44067b[_0x49a4('0x2d')]=_['map'](_0x1a7c15,_0x49a4('0x28'));_0x44067b[_0x49a4('0x2e')]=_[_0x49a4('0x2f')](_0x3b2e46[_0x49a4('0x2e')]);_0x44067b[_0x49a4('0x30')]=_[_0x49a4('0x31')](_0x44067b[_0x49a4('0x2d')],_0x44067b[_0x49a4('0x2e')]);_0x1ffc75[_0x49a4('0x32')]=_[_0x49a4('0x31')](_0x44067b[_0x49a4('0x2d')],qs[_0x49a4('0x33')](_0x3b2e46[_0x49a4('0x2e')][_0x49a4('0x33')]));_0x1ffc75[_0x49a4('0x32')]=_0x1ffc75[_0x49a4('0x32')]['length']?_0x1ffc75[_0x49a4('0x32')]:_0x44067b[_0x49a4('0x2d')];if(!_0x3b2e46[_0x49a4('0x2e')]['hasOwnProperty']('nolimit')){_0x1ffc75['limit']=qs[_0x49a4('0x1e')](_0x3b2e46[_0x49a4('0x2e')]['limit']);_0x1ffc75[_0x49a4('0x1c')]=qs[_0x49a4('0x1c')](_0x3b2e46[_0x49a4('0x2e')][_0x49a4('0x1c')]);}_0x1ffc75[_0x49a4('0x34')]=qs[_0x49a4('0x35')](_0x3b2e46[_0x49a4('0x2e')]['sort']);_0x1ffc75['where']=qs[_0x49a4('0x30')](_[_0x49a4('0x36')](_0x3b2e46[_0x49a4('0x2e')],_0x44067b[_0x49a4('0x30')]),_0x1a7c15);if(_0x3b2e46[_0x49a4('0x2e')][_0x49a4('0x37')]){_0x1ffc75[_0x49a4('0x38')]=_[_0x49a4('0x39')](_0x1ffc75[_0x49a4('0x38')],{'$or':_[_0x49a4('0x2a')](_0x1a7c15,function(_0x38b200){if(_0x38b200['type']!=='VIRTUAL'){var _0x1e70c6={};_0x1e70c6[_0x38b200[_0x49a4('0x28')]]={'$like':'%'+_0x3b2e46[_0x49a4('0x2e')][_0x49a4('0x37')]+'%'};return _0x1e70c6;}})});}_0x1ffc75=_[_0x49a4('0x39')]({},_0x1ffc75,_0x3b2e46['options']);var _0xcdac5b={'where':_0x1ffc75[_0x49a4('0x38')]};return db[_0x49a4('0x3a')][_0x49a4('0x1f')](_0xcdac5b)['then'](function(_0x1bfbbb){_0x9c9cc6[_0x49a4('0x1f')]=_0x1bfbbb;if(_0x3b2e46[_0x49a4('0x2e')][_0x49a4('0x3b')]){_0x1ffc75['include']=[{'all':!![]}];}return db[_0x49a4('0x3a')][_0x49a4('0x3c')](_0x1ffc75);})[_0x49a4('0x26')](function(_0x24690a){_0x9c9cc6['rows']=_0x24690a;return _0x9c9cc6;})['then'](respondWithFilteredResult(_0x18f8f0,_0x1ffc75))[_0x49a4('0x3d')](handleError(_0x18f8f0,null));};exports[_0x49a4('0x3e')]=function(_0x2f68e4,_0x24882a){var _0x4c6a24={'raw':!![],'where':{'id':_0x2f68e4[_0x49a4('0x3f')]['id']}},_0x402166={};_0x402166[_0x49a4('0x2d')]=_[_0x49a4('0x2f')](db['WhatsappTransferReport'][_0x49a4('0x2b')]);_0x402166[_0x49a4('0x2e')]=_[_0x49a4('0x2f')](_0x2f68e4[_0x49a4('0x2e')]);_0x402166[_0x49a4('0x30')]=_[_0x49a4('0x31')](_0x402166[_0x49a4('0x2d')],_0x402166['query']);_0x4c6a24[_0x49a4('0x32')]=_[_0x49a4('0x31')](_0x402166[_0x49a4('0x2d')],qs[_0x49a4('0x33')](_0x2f68e4[_0x49a4('0x2e')]['fields']));_0x4c6a24['attributes']=_0x4c6a24[_0x49a4('0x32')][_0x49a4('0x40')]?_0x4c6a24[_0x49a4('0x32')]:_0x402166[_0x49a4('0x2d')];if(_0x2f68e4['query'][_0x49a4('0x3b')]){_0x4c6a24[_0x49a4('0x41')]=[{'all':!![]}];}_0x4c6a24=_[_0x49a4('0x39')]({},_0x4c6a24,_0x2f68e4[_0x49a4('0x42')]);return db[_0x49a4('0x3a')][_0x49a4('0x43')](_0x4c6a24)[_0x49a4('0x26')](handleEntityNotFound(_0x24882a,null))[_0x49a4('0x26')](respondWithResult(_0x24882a,null))['catch'](handleError(_0x24882a,null));};exports[_0x49a4('0x44')]=function(_0x26eed3,_0x276cf1){return db[_0x49a4('0x3a')][_0x49a4('0x44')](_0x26eed3[_0x49a4('0x45')],{})[_0x49a4('0x26')](respondWithResult(_0x276cf1,0xc9))[_0x49a4('0x3d')](handleError(_0x276cf1,null));};exports[_0x49a4('0x25')]=function(_0x24de8b,_0x1b9a88){if(_0x24de8b[_0x49a4('0x45')]['id']){delete _0x24de8b[_0x49a4('0x45')]['id'];}return db['WhatsappTransferReport'][_0x49a4('0x43')]({'where':{'id':_0x24de8b[_0x49a4('0x3f')]['id']}})[_0x49a4('0x26')](handleEntityNotFound(_0x1b9a88,null))[_0x49a4('0x26')](saveUpdates(_0x24de8b[_0x49a4('0x45')],null))[_0x49a4('0x26')](respondWithResult(_0x1b9a88,null))[_0x49a4('0x3d')](handleError(_0x1b9a88,null));};exports['destroy']=function(_0xc53b3f,_0x564421){return db[_0x49a4('0x3a')][_0x49a4('0x43')]({'where':{'id':_0xc53b3f[_0x49a4('0x3f')]['id']}})[_0x49a4('0x26')](handleEntityNotFound(_0x564421,null))[_0x49a4('0x26')](removeEntity(_0x564421,null))[_0x49a4('0x3d')](handleError(_0x564421,null));};exports[_0x49a4('0x46')]=function(_0x5d1508,_0x3073a7){return db['WhatsappTransferReport'][_0x49a4('0x46')]()[_0x49a4('0x26')](respondWithResult(_0x3073a7,null))[_0x49a4('0x3d')](handleError(_0x3073a7,null));}; \ No newline at end of file +var _0xbc6b=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','update','then','destroy','error','stack','name','map','WhatsappTransferReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','findAll','rows','catch','show','params','includeAll','include','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis'];(function(_0x53949c,_0x3a81b0){var _0x2d18b5=function(_0x3612e8){while(--_0x3612e8){_0x53949c['push'](_0x53949c['shift']());}};_0x2d18b5(++_0x3a81b0);}(_0xbc6b,0xd4));var _0xbbc6=function(_0x1e4a8e,_0x18022b){_0x1e4a8e=_0x1e4a8e-0x0;var _0x5408f9=_0xbc6b[_0x1e4a8e];return _0x5408f9;};'use strict';var emlformat=require(_0xbbc6('0x0'));var rimraf=require(_0xbbc6('0x1'));var zipdir=require(_0xbbc6('0x2'));var jsonpatch=require(_0xbbc6('0x3'));var rp=require(_0xbbc6('0x4'));var moment=require(_0xbbc6('0x5'));var BPromise=require(_0xbbc6('0x6'));var Mustache=require(_0xbbc6('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xbbc6('0x8'));var ejs=require(_0xbbc6('0x9'));var fs=require('fs');var fs_extra=require(_0xbbc6('0xa'));var _=require(_0xbbc6('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xbbc6('0xc'));var toCsv=require(_0xbbc6('0x8'));var querystring=require(_0xbbc6('0xd'));var Papa=require(_0xbbc6('0xe'));var Redis=require(_0xbbc6('0xf'));var authService=require(_0xbbc6('0x10'));var qs=require(_0xbbc6('0x11'));var as=require(_0xbbc6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbbc6('0x13'))(_0xbbc6('0x14'));var utils=require('../../config/utils');var config=require(_0xbbc6('0x15'));var licenseUtil=require(_0xbbc6('0x16'));var db=require(_0xbbc6('0x17'))['db'];function respondWithStatusCode(_0x2a0157,_0x407083){_0x407083=_0x407083||0xcc;return function(_0x4edaaf){if(_0x4edaaf){return _0x2a0157[_0xbbc6('0x18')](_0x407083);}return _0x2a0157[_0xbbc6('0x19')](_0x407083)[_0xbbc6('0x1a')]();};}function respondWithResult(_0x49c9fb,_0x45781f){_0x45781f=_0x45781f||0xc8;return function(_0x2cc973){if(_0x2cc973){return _0x49c9fb[_0xbbc6('0x19')](_0x45781f)[_0xbbc6('0x1b')](_0x2cc973);}};}function respondWithFilteredResult(_0x5e2648,_0x54ac84){return function(_0xd150){if(_0xd150){var _0x2e4db8=typeof _0x54ac84[_0xbbc6('0x1c')]===_0xbbc6('0x1d')&&typeof _0x54ac84['limit']===_0xbbc6('0x1d');var _0x54972f=_0xd150[_0xbbc6('0x1e')];var _0x22f9cd=_0x2e4db8?0x0:_0x54ac84[_0xbbc6('0x1c')];var _0x28aa28=_0x2e4db8?_0xd150[_0xbbc6('0x1e')]:_0x54ac84[_0xbbc6('0x1c')]+_0x54ac84[_0xbbc6('0x1f')];var _0x4b49db;if(_0x28aa28>=_0x54972f){_0x28aa28=_0x54972f;_0x4b49db=0xc8;}else{_0x4b49db=0xce;}_0x5e2648['status'](_0x4b49db);return _0x5e2648[_0xbbc6('0x20')]('Content-Range',_0x22f9cd+'-'+_0x28aa28+'/'+_0x54972f)[_0xbbc6('0x1b')](_0xd150);}return null;};}function patchUpdates(_0x5ec049){return function(_0x117e6c){try{jsonpatch[_0xbbc6('0x21')](_0x117e6c,_0x5ec049,!![]);}catch(_0x497c4c){return BPromise[_0xbbc6('0x22')](_0x497c4c);}return _0x117e6c['save']();};}function saveUpdates(_0x482e31,_0x106ebc){return function(_0x1875ba){if(_0x1875ba){return _0x1875ba[_0xbbc6('0x23')](_0x482e31)[_0xbbc6('0x24')](function(_0x215536){return _0x215536;});}return null;};}function removeEntity(_0x560162,_0x44f3ab){return function(_0x547f1d){if(_0x547f1d){return _0x547f1d[_0xbbc6('0x25')]()[_0xbbc6('0x24')](function(){_0x560162[_0xbbc6('0x19')](0xcc)[_0xbbc6('0x1a')]();});}};}function handleEntityNotFound(_0x13d17f,_0x4c70b1){return function(_0x27ff41){if(!_0x27ff41){_0x13d17f['sendStatus'](0x194);}return _0x27ff41;};}function handleError(_0x20d1c0,_0x929aea){_0x929aea=_0x929aea||0x1f4;return function(_0x2ac894){logger[_0xbbc6('0x26')](_0x2ac894[_0xbbc6('0x27')]);if(_0x2ac894[_0xbbc6('0x28')]){delete _0x2ac894[_0xbbc6('0x28')];}_0x20d1c0['status'](_0x929aea)['send'](_0x2ac894);};}exports['index']=function(_0x26c8d4,_0x23a6b0){var _0x2f6f55={},_0x4c186c={},_0x8abe94={'count':0x0,'rows':[]};var _0x1a6651=_[_0xbbc6('0x29')](db[_0xbbc6('0x2a')][_0xbbc6('0x2b')],function(_0x56cf81){return{'name':_0x56cf81[_0xbbc6('0x2c')],'type':_0x56cf81[_0xbbc6('0x2d')][_0xbbc6('0x2e')]};});_0x4c186c['model']=_[_0xbbc6('0x29')](_0x1a6651,'name');_0x4c186c[_0xbbc6('0x2f')]=_[_0xbbc6('0x30')](_0x26c8d4[_0xbbc6('0x2f')]);_0x4c186c[_0xbbc6('0x31')]=_[_0xbbc6('0x32')](_0x4c186c[_0xbbc6('0x33')],_0x4c186c['query']);_0x2f6f55[_0xbbc6('0x34')]=_[_0xbbc6('0x32')](_0x4c186c['model'],qs[_0xbbc6('0x35')](_0x26c8d4[_0xbbc6('0x2f')][_0xbbc6('0x35')]));_0x2f6f55[_0xbbc6('0x34')]=_0x2f6f55[_0xbbc6('0x34')][_0xbbc6('0x36')]?_0x2f6f55[_0xbbc6('0x34')]:_0x4c186c['model'];if(!_0x26c8d4[_0xbbc6('0x2f')][_0xbbc6('0x37')](_0xbbc6('0x38'))){_0x2f6f55['limit']=qs[_0xbbc6('0x1f')](_0x26c8d4[_0xbbc6('0x2f')][_0xbbc6('0x1f')]);_0x2f6f55['offset']=qs['offset'](_0x26c8d4[_0xbbc6('0x2f')]['offset']);}_0x2f6f55[_0xbbc6('0x39')]=qs[_0xbbc6('0x3a')](_0x26c8d4[_0xbbc6('0x2f')][_0xbbc6('0x3a')]);_0x2f6f55[_0xbbc6('0x3b')]=qs[_0xbbc6('0x31')](_[_0xbbc6('0x3c')](_0x26c8d4[_0xbbc6('0x2f')],_0x4c186c[_0xbbc6('0x31')]),_0x1a6651);if(_0x26c8d4[_0xbbc6('0x2f')][_0xbbc6('0x3d')]){_0x2f6f55[_0xbbc6('0x3b')]=_[_0xbbc6('0x3e')](_0x2f6f55[_0xbbc6('0x3b')],{'$or':_[_0xbbc6('0x29')](_0x1a6651,function(_0x3743e2){if(_0x3743e2[_0xbbc6('0x2d')]!==_0xbbc6('0x3f')){var _0x427dde={};_0x427dde[_0x3743e2[_0xbbc6('0x28')]]={'$like':'%'+_0x26c8d4[_0xbbc6('0x2f')]['filter']+'%'};return _0x427dde;}})});}_0x2f6f55=_[_0xbbc6('0x3e')]({},_0x2f6f55,_0x26c8d4['options']);var _0x60e5f1={'where':_0x2f6f55[_0xbbc6('0x3b')]};return db['WhatsappTransferReport'][_0xbbc6('0x1e')](_0x60e5f1)[_0xbbc6('0x24')](function(_0x399490){_0x8abe94[_0xbbc6('0x1e')]=_0x399490;if(_0x26c8d4[_0xbbc6('0x2f')]['includeAll']){_0x2f6f55['include']=[{'all':!![]}];}return db[_0xbbc6('0x2a')][_0xbbc6('0x40')](_0x2f6f55);})['then'](function(_0x36262e){_0x8abe94[_0xbbc6('0x41')]=_0x36262e;return _0x8abe94;})['then'](respondWithFilteredResult(_0x23a6b0,_0x2f6f55))[_0xbbc6('0x42')](handleError(_0x23a6b0,null));};exports[_0xbbc6('0x43')]=function(_0x30adef,_0x53e275){var _0x1d40f8={'raw':!![],'where':{'id':_0x30adef[_0xbbc6('0x44')]['id']}},_0x46c812={};_0x46c812[_0xbbc6('0x33')]=_['keys'](db[_0xbbc6('0x2a')][_0xbbc6('0x2b')]);_0x46c812[_0xbbc6('0x2f')]=_[_0xbbc6('0x30')](_0x30adef[_0xbbc6('0x2f')]);_0x46c812[_0xbbc6('0x31')]=_['intersection'](_0x46c812[_0xbbc6('0x33')],_0x46c812[_0xbbc6('0x2f')]);_0x1d40f8[_0xbbc6('0x34')]=_[_0xbbc6('0x32')](_0x46c812[_0xbbc6('0x33')],qs['fields'](_0x30adef[_0xbbc6('0x2f')][_0xbbc6('0x35')]));_0x1d40f8[_0xbbc6('0x34')]=_0x1d40f8[_0xbbc6('0x34')][_0xbbc6('0x36')]?_0x1d40f8[_0xbbc6('0x34')]:_0x46c812[_0xbbc6('0x33')];if(_0x30adef[_0xbbc6('0x2f')][_0xbbc6('0x45')]){_0x1d40f8[_0xbbc6('0x46')]=[{'all':!![]}];}_0x1d40f8=_['merge']({},_0x1d40f8,_0x30adef[_0xbbc6('0x47')]);return db['WhatsappTransferReport'][_0xbbc6('0x48')](_0x1d40f8)['then'](handleEntityNotFound(_0x53e275,null))[_0xbbc6('0x24')](respondWithResult(_0x53e275,null))['catch'](handleError(_0x53e275,null));};exports[_0xbbc6('0x49')]=function(_0x1b00bb,_0xcdb960){return db[_0xbbc6('0x2a')]['create'](_0x1b00bb[_0xbbc6('0x4a')],{})['then'](respondWithResult(_0xcdb960,0xc9))[_0xbbc6('0x42')](handleError(_0xcdb960,null));};exports[_0xbbc6('0x23')]=function(_0x5832d8,_0x9fe19e){if(_0x5832d8[_0xbbc6('0x4a')]['id']){delete _0x5832d8[_0xbbc6('0x4a')]['id'];}return db[_0xbbc6('0x2a')][_0xbbc6('0x48')]({'where':{'id':_0x5832d8[_0xbbc6('0x44')]['id']}})[_0xbbc6('0x24')](handleEntityNotFound(_0x9fe19e,null))['then'](saveUpdates(_0x5832d8['body'],null))['then'](respondWithResult(_0x9fe19e,null))[_0xbbc6('0x42')](handleError(_0x9fe19e,null));};exports[_0xbbc6('0x25')]=function(_0x2c6a6e,_0x24b2bc){return db[_0xbbc6('0x2a')][_0xbbc6('0x48')]({'where':{'id':_0x2c6a6e[_0xbbc6('0x44')]['id']}})[_0xbbc6('0x24')](handleEntityNotFound(_0x24b2bc,null))['then'](removeEntity(_0x24b2bc,null))[_0xbbc6('0x42')](handleError(_0x24b2bc,null));};exports[_0xbbc6('0x4b')]=function(_0x88a263,_0x4ffd3c){return db[_0xbbc6('0x2a')][_0xbbc6('0x4b')]()['then'](respondWithResult(_0x4ffd3c,null))[_0xbbc6('0x42')](handleError(_0x4ffd3c,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index ba0659c..0ddbad8 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 _0x5705=['uniqueid','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','WhatsappTransferReport','report_whatsapp_transfer'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x5705,0x76));var _0x5570=function(_0x5e9396,_0x161fdd){_0x5e9396=_0x5e9396-0x0;var _0x4172e3=_0x5705[_0x5e9396];return _0x4172e3;};'use strict';var _=require(_0x5570('0x0'));var util=require('util');var logger=require(_0x5570('0x1'))(_0x5570('0x2'));var moment=require(_0x5570('0x3'));var BPromise=require('bluebird');var rp=require(_0x5570('0x4'));var fs=require('fs');var path=require(_0x5570('0x5'));var rimraf=require(_0x5570('0x6'));var config=require(_0x5570('0x7'));var attributes=require('./whatsappTransferReport.attributes');module[_0x5570('0x8')]=function(_0x14ba6e,_0x292d5e){return _0x14ba6e[_0x5570('0x9')](_0x5570('0xa'),attributes,{'tableName':_0x5570('0xb'),'paranoid':![],'indexes':[{'name':_0x5570('0xc'),'fields':[_0x5570('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8d91=['./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','util','request-promise','path','../../config/environment'];(function(_0x4eeb2b,_0x3ac05e){var _0x196b29=function(_0x45c9df){while(--_0x45c9df){_0x4eeb2b['push'](_0x4eeb2b['shift']());}};_0x196b29(++_0x3ac05e);}(_0x8d91,0x18c));var _0x18d9=function(_0x225cef,_0x56781c){_0x225cef=_0x225cef-0x0;var _0x254f6a=_0x8d91[_0x225cef];return _0x254f6a;};'use strict';var _=require('lodash');var util=require(_0x18d9('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x18d9('0x1'));var fs=require('fs');var path=require(_0x18d9('0x2'));var rimraf=require('rimraf');var config=require(_0x18d9('0x3'));var attributes=require(_0x18d9('0x4'));module[_0x18d9('0x5')]=function(_0x2c3854,_0x1dc927){return _0x2c3854[_0x18d9('0x6')](_0x18d9('0x7'),attributes,{'tableName':_0x18d9('0x8'),'paranoid':![],'indexes':[{'name':_0x18d9('0x9'),'fields':[_0x18d9('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 21f349f..2aca05c 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 _0x962a=['bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment'];(function(_0x285473,_0x57d53f){var _0x1171af=function(_0x59bb2a){while(--_0x59bb2a){_0x285473['push'](_0x285473['shift']());}};_0x1171af(++_0x57d53f);}(_0x962a,0x1c9));var _0xa962=function(_0x541565,_0xbacd48){_0x541565=_0x541565-0x0;var _0x1464ef=_0x962a[_0x541565];return _0x1464ef;};'use strict';var _=require(_0xa962('0x0'));var util=require(_0xa962('0x1'));var moment=require(_0xa962('0x2'));var BPromise=require(_0xa962('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa962('0x4'));var db=require(_0xa962('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa962('0x6'))(_0xa962('0x7'));var config=require(_0xa962('0x8'));var jayson=require(_0xa962('0x9'));var client=jayson['client'][_0xa962('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x175122,_0x4012e8,_0x3347a8){return new BPromise(function(_0x6a1a02,_0xf1bd43){return client[_0xa962('0xb')](_0x175122,_0x3347a8)[_0xa962('0xc')](function(_0x2fba17){logger[_0xa962('0xd')](_0xa962('0xe'),_0x4012e8,_0xa962('0xf'));logger[_0xa962('0x10')](_0xa962('0x11'),_0x4012e8,'request\x20sent',JSON[_0xa962('0x12')](_0x2fba17));if(_0x2fba17['error']){if(_0x2fba17[_0xa962('0x13')][_0xa962('0x14')]===0x1f4){logger[_0xa962('0x13')](_0xa962('0xe'),_0x4012e8,_0x2fba17[_0xa962('0x13')][_0xa962('0x15')]);return _0xf1bd43(_0x2fba17[_0xa962('0x13')][_0xa962('0x15')]);}logger[_0xa962('0x13')](_0xa962('0xe'),_0x4012e8,_0x2fba17[_0xa962('0x13')][_0xa962('0x15')]);return _0x6a1a02(_0x2fba17[_0xa962('0x13')][_0xa962('0x15')]);}else{logger['info'](_0xa962('0xe'),_0x4012e8,'request\x20sent');_0x6a1a02(_0x2fba17[_0xa962('0x16')][_0xa962('0x15')]);}})['catch'](function(_0xf011f5){logger[_0xa962('0x13')](_0xa962('0xe'),_0x4012e8,_0xf011f5);_0xf1bd43(_0xf011f5);});});} \ No newline at end of file +var _0x81b9=['message','info','result','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x171776,_0x4adb34){var _0x198e85=function(_0x2d579d){while(--_0x2d579d){_0x171776['push'](_0x171776['shift']());}};_0x198e85(++_0x4adb34);}(_0x81b9,0x180));var _0x981b=function(_0x1f31b7,_0xf6bc3f){_0x1f31b7=_0x1f31b7-0x0;var _0x28d3d=_0x81b9[_0x1f31b7];return _0x28d3d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x981b('0x0'));var BPromise=require(_0x981b('0x1'));var rs=require(_0x981b('0x2'));var fs=require('fs');var Redis=require(_0x981b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x981b('0x4'));var logger=require(_0x981b('0x5'))(_0x981b('0x6'));var config=require('../../config/environment');var jayson=require(_0x981b('0x7'));var client=jayson[_0x981b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x352b53,_0x2fb674,_0x3c281c){return new BPromise(function(_0x51aaf4,_0x4f5729){return client[_0x981b('0x9')](_0x352b53,_0x3c281c)['then'](function(_0x4eb6f2){logger['info'](_0x981b('0xa'),_0x2fb674,_0x981b('0xb'));logger[_0x981b('0xc')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x2fb674,_0x981b('0xb'),JSON[_0x981b('0xd')](_0x4eb6f2));if(_0x4eb6f2[_0x981b('0xe')]){if(_0x4eb6f2[_0x981b('0xe')][_0x981b('0xf')]===0x1f4){logger[_0x981b('0xe')](_0x981b('0xa'),_0x2fb674,_0x4eb6f2['error'][_0x981b('0x10')]);return _0x4f5729(_0x4eb6f2[_0x981b('0xe')][_0x981b('0x10')]);}logger[_0x981b('0xe')](_0x981b('0xa'),_0x2fb674,_0x4eb6f2['error'][_0x981b('0x10')]);return _0x51aaf4(_0x4eb6f2[_0x981b('0xe')][_0x981b('0x10')]);}else{logger[_0x981b('0x11')](_0x981b('0xa'),_0x2fb674,_0x981b('0xb'));_0x51aaf4(_0x4eb6f2[_0x981b('0x12')][_0x981b('0x10')]);}})[_0x981b('0x13')](function(_0x560d8d){logger[_0x981b('0xe')](_0x981b('0xa'),_0x2fb674,_0x560d8d);_0x4f5729(_0x560d8d);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 5f60a9b..6b8d897 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe5e0=['length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','Online\x20apps:','online','Offline\x20apps:','status','join','None','log','App\x20Ready!','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/cloud-provider','sequelize','sync','then','seedDB','default','start','info','filter','exitCode'];(function(_0x42c118,_0x197006){var _0x112ebd=function(_0x337411){while(--_0x337411){_0x42c118['push'](_0x42c118['shift']());}};_0x112ebd(++_0x197006);}(_0xe5e0,0x1be));var _0x0e5e=function(_0x37d0b1,_0x162d9e){_0x37d0b1=_0x37d0b1-0x0;var _0x4e8801=_0xe5e0[_0x37d0b1];return _0x4e8801;};'use strict';var _=require(_0x0e5e('0x0'));var db=require(_0x0e5e('0x1'))['db'];var seedDb=require(_0x0e5e('0x2'));var checkLicense=require(_0x0e5e('0x3'));var rpc=require(_0x0e5e('0x4'));var config=require(_0x0e5e('0x5'));var logger=require(_0x0e5e('0x6'))(_0x0e5e('0x7'));var pm2=require(_0x0e5e('0x8'));var pm2Config=require('./config/pm2/config');var schedule=require(_0x0e5e('0x9'));var chat=require(_0x0e5e('0xa'));var whatsapp=require(_0x0e5e('0xb'));var transcribe=require('./config/schedule/transcribe');var provider=require(_0x0e5e('0xc'));function main(){return db[_0x0e5e('0xd')][_0x0e5e('0xe')]()[_0x0e5e('0xf')](function(){if(config[_0x0e5e('0x10')]){return seedDb[_0x0e5e('0x11')]();}})[_0x0e5e('0xf')](function(){return checkLicense['default']();})['then'](function(){return rpc['listen']();})[_0x0e5e('0xf')](function(_0x17a208){logger['info'](_0x17a208);return chat['start']();})[_0x0e5e('0xf')](function(){return whatsapp[_0x0e5e('0x12')]();})[_0x0e5e('0xf')](function(){return schedule[_0x0e5e('0x12')]();})['then'](function(){return transcribe[_0x0e5e('0x12')]();})[_0x0e5e('0xf')](function(){return provider['start']();})[_0x0e5e('0xf')](function(_0x1e73e9){logger[_0x0e5e('0x13')](_0x1e73e9);return pm2['start'](pm2Config);})[_0x0e5e('0xf')](function(_0x2353b3){var _0x187d39=_0x2353b3[_0x0e5e('0x14')](function(_0x19d3a1){return typeof _0x19d3a1[_0x0e5e('0x15')]==='number'&&_0x19d3a1[_0x0e5e('0x15')]>=0x0;});if(_0x187d39[_0x0e5e('0x16')]>0x0){throw new Error(_0x187d39[_0x0e5e('0x16')]+_0x0e5e('0x17')+_[_0x0e5e('0x18')](_0x187d39,function(_0x550dda){return'\x22'+_0x550dda[_0x0e5e('0x19')][_0x0e5e('0x1a')]+'\x22';}));}logger['info'](_0x0e5e('0x1b'),_[_0x0e5e('0x18')](_['filter'](_0x2353b3,{'status':_0x0e5e('0x1c')}),_0x0e5e('0x1a'))['join']());logger[_0x0e5e('0x13')](_0x0e5e('0x1d'),_[_0x0e5e('0x18')](_['filter'](_0x2353b3,function(_0x4f468f){return _0x4f468f[_0x0e5e('0x1e')]!==_0x0e5e('0x1c');}),_0x0e5e('0x1a'))[_0x0e5e('0x1f')]()||_0x0e5e('0x20'));console[_0x0e5e('0x21')](_0x0e5e('0x22'));})[_0x0e5e('0x23')](function(_0x182acb){console[_0x0e5e('0x21')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error!',_0x182acb);logger[_0x0e5e('0x24')](_0x0e5e('0x25'),_0x182acb);process[_0x0e5e('0x26')](0x1);});}main(); \ No newline at end of file +var _0x770d=['number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','Online\x20apps:','status','online','join','None','App\x20Ready!','catch','log','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','./config/logger','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/cloud-provider','sequelize','sync','then','seedDB','default','listen','info','start','filter','exitCode'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x770d,0x122));var _0xd770=function(_0xf822f2,_0x532a8f){_0xf822f2=_0xf822f2-0x0;var _0x1cd623=_0x770d[_0xf822f2];return _0x1cd623;};'use strict';var _=require(_0xd770('0x0'));var db=require(_0xd770('0x1'))['db'];var seedDb=require(_0xd770('0x2'));var checkLicense=require(_0xd770('0x3'));var rpc=require(_0xd770('0x4'));var config=require(_0xd770('0x5'));var logger=require(_0xd770('0x6'))('app');var pm2=require(_0xd770('0x7'));var pm2Config=require(_0xd770('0x8'));var schedule=require(_0xd770('0x9'));var chat=require(_0xd770('0xa'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require('./config/schedule/transcribe');var provider=require(_0xd770('0xb'));function main(){return db[_0xd770('0xc')][_0xd770('0xd')]()[_0xd770('0xe')](function(){if(config[_0xd770('0xf')]){return seedDb[_0xd770('0x10')]();}})[_0xd770('0xe')](function(){return checkLicense['default']();})[_0xd770('0xe')](function(){return rpc[_0xd770('0x11')]();})[_0xd770('0xe')](function(_0x46775b){logger[_0xd770('0x12')](_0x46775b);return chat['start']();})[_0xd770('0xe')](function(){return whatsapp[_0xd770('0x13')]();})[_0xd770('0xe')](function(){return schedule[_0xd770('0x13')]();})[_0xd770('0xe')](function(){return transcribe[_0xd770('0x13')]();})[_0xd770('0xe')](function(){return provider[_0xd770('0x13')]();})['then'](function(_0x4875f1){logger[_0xd770('0x12')](_0x4875f1);return pm2[_0xd770('0x13')](pm2Config);})[_0xd770('0xe')](function(_0x4561bb){var _0x51dacf=_0x4561bb[_0xd770('0x14')](function(_0x3babaf){return typeof _0x3babaf[_0xd770('0x15')]===_0xd770('0x16')&&_0x3babaf['exitCode']>=0x0;});if(_0x51dacf[_0xd770('0x17')]>0x0){throw new Error(_0x51dacf['length']+_0xd770('0x18')+_[_0xd770('0x19')](_0x51dacf,function(_0x38c57d){return'\x22'+_0x38c57d[_0xd770('0x1a')][_0xd770('0x1b')]+'\x22';}));}logger[_0xd770('0x12')](_0xd770('0x1c'),_[_0xd770('0x19')](_[_0xd770('0x14')](_0x4561bb,{'status':'online'}),_0xd770('0x1b'))['join']());logger[_0xd770('0x12')]('Offline\x20apps:',_[_0xd770('0x19')](_[_0xd770('0x14')](_0x4561bb,function(_0x10e4b1){return _0x10e4b1[_0xd770('0x1d')]!==_0xd770('0x1e');}),'name')[_0xd770('0x1f')]()||_0xd770('0x20'));console['log'](_0xd770('0x21'));})[_0xd770('0x22')](function(_0x85e70b){console[_0xd770('0x23')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error!',_0x85e70b);logger[_0xd770('0x24')](_0xd770('0x25'),_0x85e70b);process[_0xd770('0x26')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 3c3e429..b787fa9 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 _0x8138=['smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarEnableRecording','phoneBarEnableSettings','phoneBarExpires','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','isChatInteractionAuthorized','use','user','ChatInteraction','findOne','params','disposition','status','unmanaged','Unmanaged.','Forbidden.','catch','isAuthenticated','headers','authorization','startsWith','Basic','then','authenticate','pass','json','Wrong\x20credentials.','Unknown\x20authorization\x20format','apikey','getUuid','query','User','find','sub','allowedLoginAttempts','blockDuration','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','blocked','blockedAt','add','minutes','Invalid\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','webrtc','isMiddleware','setTokenCookie','role','cookie','motion.token','redirect','send','retrieveApiKey','isNil','apiKeyNonce','apiKeyIat','generateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','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~!@#$%^&-_=+[{]}.','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','splice','unshift','promisify','sign','secret','payload','options','secrets','randomBytes','toString','hex','floor','now','../../mysqldb','../../config/environment','../../config/license/util','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','util','moment','session','fullname','name','internal','email','permissions','voicePause','chatPause','mailPause','faxPause'];(function(_0x35eaac,_0x470cdd){var _0x44ff21=function(_0x233ec6){while(--_0x233ec6){_0x35eaac['push'](_0x35eaac['shift']());}};_0x44ff21(++_0x470cdd);}(_0x8138,0xed));var _0x8813=function(_0x20845e,_0x211e78){_0x20845e=_0x20845e-0x0;var _0x28cf2b=_0x8138[_0x20845e];return _0x28cf2b;};'use strict';var db=require(_0x8813('0x0'))['db'];var config=require(_0x8813('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0x8813('0x2'));var encryptor=require('../encryptor');var _=require('lodash');var jwt=require(_0x8813('0x3'));var expressJwt=require(_0x8813('0x4'));var compose=require(_0x8813('0x5'));var basicAuth=require(_0x8813('0x6'));var crypto=require(_0x8813('0x7'));var BPromise=require(_0x8813('0x8'));var util=require(_0x8813('0x9'));var moment=require(_0x8813('0xa'));var validateJwt=expressJwt({'secret':config['secrets'][_0x8813('0xb')]});var userAttributes=['id','role',_0x8813('0xc'),_0x8813('0xd'),_0x8813('0xe'),_0x8813('0xf'),'userpic',_0x8813('0x10'),'md5secret',_0x8813('0x11'),_0x8813('0x12'),_0x8813('0x13'),_0x8813('0x14'),_0x8813('0x15'),_0x8813('0x16'),_0x8813('0x17'),_0x8813('0x18'),_0x8813('0x19'),_0x8813('0x1a'),'crudPermissions',_0x8813('0x1b'),_0x8813('0x1c'),_0x8813('0x1d'),_0x8813('0x1e'),'phoneBarAutoAnswerDelay','phoneBarDnd',_0x8813('0x1f'),'phoneBarEnableDtmfTone',_0x8813('0x20'),_0x8813('0x21'),'phoneBarPrefixRequired',_0x8813('0x22'),_0x8813('0x23'),_0x8813('0x24'),_0x8813('0x25'),_0x8813('0x26'),_0x8813('0x27'),_0x8813('0x28'),_0x8813('0x29'),_0x8813('0x2a'),_0x8813('0x2b'),_0x8813('0x2c'),_0x8813('0x2d'),_0x8813('0x2e')];exports[_0x8813('0x2f')]=function(){return this['isAuthenticated'](!![])[_0x8813('0x30')](function(_0x4fda86,_0x7a470,_0x2bccb9){if(_0x4fda86[_0x8813('0x31')]){_0x2bccb9();}else{return db[_0x8813('0x32')][_0x8813('0x33')]({'where':{'id':_0x4fda86[_0x8813('0x34')]['id']},'attributes':['id','closed',_0x8813('0x35')],'raw':!![]})['then'](function(_0x5889d9){if(_0x5889d9&&_0x5889d9['closed']){return _0x7a470[_0x8813('0x36')](_0x5889d9[_0x8813('0x35')]==='unmanaged'?0x195:0x193)['json']({'message':_0x5889d9[_0x8813('0x35')]===_0x8813('0x37')?_0x8813('0x38'):_0x8813('0x39')});}else{_0x2bccb9();}})[_0x8813('0x3a')](function(_0x421ad3){_0x2bccb9(_0x421ad3);});}});};exports[_0x8813('0x3b')]=function isAuthenticated(_0x4586e1){return compose()['use'](function(_0x29592a,_0x448995,_0x160aca){var _0x11e42c;if(_0x29592a[_0x8813('0x3c')][_0x8813('0x3d')]){if(_[_0x8813('0x3e')](_0x29592a[_0x8813('0x3c')][_0x8813('0x3d')],_0x8813('0x3f'))){var _0x230736=basicAuth(_0x29592a);db['User']['find']({'where':{'name':_0x230736[_0x8813('0xd')]}})[_0x8813('0x40')](function(_0x115ba5){if(!_0x115ba5||!_0x115ba5[_0x8813('0x41')](_0x230736[_0x8813('0x42')])){return _0x448995[_0x8813('0x36')](0x191)[_0x8813('0x43')]({'message':_0x8813('0x44')});}_0x29592a['user']={'id':_0x115ba5['id']};_0x160aca();})['catch'](function(_0x38237e){_0x160aca(_0x38237e);});}else if(_['startsWith'](_0x29592a[_0x8813('0x3c')][_0x8813('0x3d')],'Bearer')){validateJwt(_0x29592a,_0x448995,_0x160aca);}else{if(_0x4586e1){_0x160aca();}else{return _0x448995[_0x8813('0x36')](0x193)[_0x8813('0x43')]({'message':_0x8813('0x45')});}}}else if(_0x29592a['query'][_0x8813('0x46')]){try{var _0xcf7e30={'audience':hardwareConf[_0x8813('0x47')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x29592a[_0x8813('0x48')][_0x8813('0x46')],_0xcf7e30)['then'](function(_0x29529f){return db[_0x8813('0x49')][_0x8813('0x4a')]({'where':{'id':_0x29529f[_0x8813('0x4b')]}})[_0x8813('0x40')](function(_0x2cf073){_0x11e42c=_0x2cf073;return db['Setting'][_0x8813('0x33')]({'where':{'id':0x1},'attributes':[_0x8813('0x4c'),_0x8813('0x4d')],'raw':!![]});})[_0x8813('0x40')](function(_0x5222e8){if(!_0x11e42c||!_['isEqual'](_0x11e42c['apiKeyNonce'],_0x29529f[_0x8813('0x4e')])){return _0x448995['status'](0x191)[_0x8813('0x43')]({'message':_0x8813('0x4f')});}if(_0x11e42c[_0x8813('0x50')]){return _0x448995[_0x8813('0x36')](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});}if(_0x11e42c[_0x8813('0x51')]){if(_0x5222e8[_0x8813('0x4d')]>0x0){if(moment(_0x11e42c[_0x8813('0x52')])[_0x8813('0x53')](_0x5222e8[_0x8813('0x4d')],_0x8813('0x54'))>moment()){return _0x448995[_0x8813('0x36')](0x191)[_0x8813('0x43')]({'message':_0x8813('0x55')});}}else{return _0x448995[_0x8813('0x36')](0x191)[_0x8813('0x43')]({'message':'Invalid\x20API\x20access\x20key'});}}_0x29592a[_0x8813('0x31')]={'id':_0x11e42c['id']};_0x160aca();});})[_0x8813('0x3a')](function(){return _0x448995['status'](0x191)[_0x8813('0x43')]({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x2103e7){_0x160aca(_0x2103e7);}}else if(_0x4586e1){_0x160aca();}else{return _0x448995[_0x8813('0x36')](0x193)[_0x8813('0x43')]({'message':'Unknown\x20authorization\x20format'});}})[_0x8813('0x30')](function(_0x55be74,_0x57a792,_0x1874bb){if(_0x55be74['user']){db[_0x8813('0x49')]['find']({'where':{'id':_0x55be74[_0x8813('0x31')]['id']},'attributes':userAttributes})[_0x8813('0x40')](function(_0xd9fdfe){if(!_0xd9fdfe){return _0x57a792['status'](0x194)['json']({'message':_0x8813('0x56')});}_0x55be74['user']=_0xd9fdfe;_0x1874bb();})[_0x8813('0x3a')](function(_0x420eb2){_0x1874bb(_0x420eb2);});}else if(_0x4586e1){_0x1874bb();}else{return _0x57a792['status'](0x194)[_0x8813('0x43')]({'message':_0x8813('0x57')});}});};exports[_0x8813('0x58')]=function canUpdate(){return compose()[_0x8813('0x30')](function(_0x67f2bb,_0x3da5d5,_0x56c1aa){return licenseUtil[_0x8813('0x59')]()['then'](function(_0x4fb010){if(_0x4fb010[_0x8813('0x5a')]){_0x56c1aa();}else{return _0x3da5d5[_0x8813('0x36')](0x193)[_0x8813('0x43')]({'message':_0x8813('0x5b')});}})[_0x8813('0x3a')](function(_0x275b1f){_0x56c1aa(_0x275b1f);});});};exports['isWebrtcLicence']=function isWebrtcLicence(){return compose()[_0x8813('0x30')](function(_0x47e1da,_0x53497d,_0x501c9c){return licenseUtil['getLicense']()[_0x8813('0x40')](function(_0x28bcbd){if(_0x28bcbd[_0x8813('0x5c')]){_0x501c9c();}else{return _0x53497d[_0x8813('0x36')](0x193)[_0x8813('0x43')]({'message':_0x8813('0x5b')});}})['catch'](function(_0x5a0839){_0x501c9c(_0x5a0839);});});};exports[_0x8813('0x5d')]=function(_0x1942af,_0x5e9f0d,_0x14f277){_0x1942af['isMiddleware']=!![];return _0x14f277();};exports['signToken']=function signToken(_0x47149c){return signJwt(_0x47149c);};exports[_0x8813('0x5e')]=function(_0x1af1a9,_0x3b8491){if(!_0x1af1a9[_0x8813('0x31')]){return _0x3b8491[_0x8813('0x36')](0x194)[_0x8813('0x43')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x43900d={'payload':{'id':_0x1af1a9['user']['id'],'role':_0x1af1a9['user'][_0x8813('0x5f')]},'options':{'expiresIn':0x15180}};return signJwt(_0x43900d)[_0x8813('0x40')](function(_0x394993){_0x3b8491[_0x8813('0x60')](_0x8813('0x61'),_0x394993);_0x3b8491[_0x8813('0x62')]('/dashboards/general');})['catch'](function(_0x1e2909){return _0x3b8491['status'](0x1f4)[_0x8813('0x63')](_0x1e2909);});};exports[_0x8813('0x64')]=function(_0x677198){if(_[_0x8813('0x65')](_0x677198[_0x8813('0x66')])||_[_0x8813('0x65')](_0x677198[_0x8813('0x67')])){return null;}else{return createJwt(_0x677198);}};exports[_0x8813('0x68')]=function(_0x513ba5){_0x513ba5[_0x8813('0x66')]=generateNonce();_0x513ba5[_0x8813('0x67')]=generateIssuedAt();return createJwt(_0x513ba5);};exports['regenerateApiKey']=function(_0x387b92,_0x48abdf){var _0x5a1c90=_0x387b92[_0x8813('0x48')]['apikey'];if(_0x5a1c90){var _0x3cf9bc={'nonce':_0x48abdf['apiKeyNonce'],'iat':_0x48abdf[_0x8813('0x67')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x8813('0x47')]()};return verifyJwt(_0x5a1c90,_0x3cf9bc)[_0x8813('0x40')](function(){return generateApiKey(_0x48abdf);});}else{throw{'message':_0x8813('0x69')};}};exports['validatePasswordPattern']=function(_0x33d532){var _0x154ddb=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x154ddb['test'](_0x33d532))throw new db[(_0x8813('0x6a'))][(_0x8813('0x6b'))](_0x8813('0x6c'));return;};exports['validatePasswordHistory']=function(_0x58c83b,_0x5ea3ea,_0x1bde28){var _0x5365a1=encryptor[_0x8813('0x6d')](_0x5ea3ea)[_0x8813('0x6e')](',');for(var _0x50ef5a=0x0;_0x50ef5a<_0x1bde28;_0x50ef5a++){if(!_0x5365a1[_0x50ef5a])break;if(_0x58c83b[_0x8813('0x6f')]()===_0x5365a1[_0x50ef5a][_0x8813('0x6f')]()){var _0x292b31=util[_0x8813('0x70')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x1bde28);if(_0x1bde28===0x1){_0x292b31=_0x8813('0x71');}throw new db['Sequelize'][(_0x8813('0x6b'))](_0x292b31);}}return;};exports[_0x8813('0x72')]=function(_0x33cee9,_0x395fbd){var _0x3a95b0=_0x395fbd?encryptor[_0x8813('0x6d')](_0x395fbd)[_0x8813('0x6e')](','):[];if(_0x3a95b0[_0x8813('0x73')]===0x5){_0x3a95b0[_0x8813('0x74')](-0x1,0x1);}_0x3a95b0[_0x8813('0x75')](_0x33cee9);return encryptor['encryptString'](_0x3a95b0['join'](','));};function signJwt(_0x1a7a04){var _0x90950e=BPromise[_0x8813('0x76')](jwt[_0x8813('0x77')],{'context':jwt});var _0xd5dd7b=_0x1a7a04[_0x8813('0x78')]||config['secrets'][_0x8813('0xb')];return new BPromise(function(_0x3d5b67,_0x14909e){_0x90950e(_0x1a7a04[_0x8813('0x79')],_0xd5dd7b,_0x1a7a04[_0x8813('0x7a')])[_0x8813('0x40')](function(_0x13765b){_0x3d5b67(_0x13765b);})[_0x8813('0x3a')](function(_0x330568){_0x14909e(_0x330568);});});}function verifyJwt(_0x3b8c92,_0x5ec8a0,_0x467a14){var _0x28449f=BPromise[_0x8813('0x76')](jwt['verify'],{'context':jwt});var _0x2480cb=_0x467a14||config[_0x8813('0x7b')]['session'];return new BPromise(function(_0x4ec4c5,_0x167170){_0x28449f(_0x3b8c92,_0x2480cb,_0x5ec8a0)['then'](function(_0x3af2bd){_0x4ec4c5(_0x3af2bd);})[_0x8813('0x3a')](function(_0x377e95){_0x167170(_0x377e95);});});}function generateNonce(){return crypto[_0x8813('0x7c')](0x10)[_0x8813('0x7d')](_0x8813('0x7e'));}function generateIssuedAt(){return Math[_0x8813('0x7f')](Date[_0x8813('0x80')]()/0x3e8)[_0x8813('0x7d')]();}function createJwt(_0x12ef3b){var _0x563de6={'payload':{'iat':_0x12ef3b[_0x8813('0x67')],'nonce':_0x12ef3b[_0x8813('0x66')]},'options':{'algorithm':'HS512','subject':_0x12ef3b['id'][_0x8813('0x7d')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0x8813('0x47')]()}};return signJwt(_0x563de6)[_0x8813('0x40')](function(_0x364137){return{'iat':_0x12ef3b[_0x8813('0x67')],'nonce':_0x12ef3b[_0x8813('0x66')],'token':_0x364137};});} \ No newline at end of file +var _0x1f11=['express-jwt','composable-middleware','basic-auth','bluebird','util','secrets','session','name','internal','userpic','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarExpires','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','isChatInteractionAuthorized','isAuthenticated','use','user','findOne','params','closed','disposition','then','unmanaged','Unmanaged.','catch','headers','authorization','Basic','User','find','pass','status','json','Wrong\x20credentials.','Bearer','apikey','getUuid','sub','Setting','blockDuration','isEqual','nonce','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','minutes','Unknown\x20authorization\x20format','User\x20object\x20not\x20found.','canUpdate','update','isWebrtcLicence','getLicense','webrtc','isMiddleware','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','role','cookie','motion.token','redirect','/dashboards/general','apiKeyNonce','isNil','apiKeyIat','regenerateApiKey','query','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~!@#$%^&-_=+[{]}.','decryptString','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','split','length','splice','unshift','promisify','payload','verify','randomBytes','hex','now','toString','HS512','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken'];(function(_0x491898,_0x5d8ed2){var _0x4c6c7a=function(_0x18d1e8){while(--_0x18d1e8){_0x491898['push'](_0x491898['shift']());}};_0x4c6c7a(++_0x5d8ed2);}(_0x1f11,0x74));var _0x11f1=function(_0x59c1e5,_0x30af2d){_0x59c1e5=_0x59c1e5-0x0;var _0x16ca53=_0x1f11[_0x59c1e5];return _0x16ca53;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0x11f1('0x0'));var hardwareConf=require(_0x11f1('0x1'));var licenseUtil=require(_0x11f1('0x2'));var encryptor=require(_0x11f1('0x3'));var _=require(_0x11f1('0x4'));var jwt=require(_0x11f1('0x5'));var expressJwt=require(_0x11f1('0x6'));var compose=require(_0x11f1('0x7'));var basicAuth=require(_0x11f1('0x8'));var crypto=require('crypto');var BPromise=require(_0x11f1('0x9'));var util=require(_0x11f1('0xa'));var moment=require('moment');var validateJwt=expressJwt({'secret':config[_0x11f1('0xb')][_0x11f1('0xc')]});var userAttributes=['id','role','fullname',_0x11f1('0xd'),_0x11f1('0xe'),'email',_0x11f1('0xf'),_0x11f1('0x10'),_0x11f1('0x11'),_0x11f1('0x12'),_0x11f1('0x13'),_0x11f1('0x14'),_0x11f1('0x15'),_0x11f1('0x16'),_0x11f1('0x17'),_0x11f1('0x18'),'showWebBar',_0x11f1('0x19'),_0x11f1('0x1a'),_0x11f1('0x1b'),_0x11f1('0x1c'),'passwordResetAt',_0x11f1('0x1d'),_0x11f1('0x1e'),_0x11f1('0x1f'),_0x11f1('0x20'),_0x11f1('0x21'),'phoneBarEnableDtmfTone','phoneBarEnableSettings',_0x11f1('0x22'),'phoneBarPrefixRequired',_0x11f1('0x23'),_0x11f1('0x24'),_0x11f1('0x25'),_0x11f1('0x26'),_0x11f1('0x27'),_0x11f1('0x28'),_0x11f1('0x29'),_0x11f1('0x2a'),_0x11f1('0x2b'),_0x11f1('0x2c'),'downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign'];exports[_0x11f1('0x2d')]=function(){return this[_0x11f1('0x2e')](!![])[_0x11f1('0x2f')](function(_0x229e58,_0x4e1fe4,_0x5c4349){if(_0x229e58[_0x11f1('0x30')]){_0x5c4349();}else{return db['ChatInteraction'][_0x11f1('0x31')]({'where':{'id':_0x229e58[_0x11f1('0x32')]['id']},'attributes':['id',_0x11f1('0x33'),_0x11f1('0x34')],'raw':!![]})[_0x11f1('0x35')](function(_0x24e359){if(_0x24e359&&_0x24e359['closed']){return _0x4e1fe4['status'](_0x24e359['disposition']===_0x11f1('0x36')?0x195:0x193)['json']({'message':_0x24e359[_0x11f1('0x34')]===_0x11f1('0x36')?_0x11f1('0x37'):'Forbidden.'});}else{_0x5c4349();}})[_0x11f1('0x38')](function(_0x56d04f){_0x5c4349(_0x56d04f);});}});};exports[_0x11f1('0x2e')]=function isAuthenticated(_0x17cfb1){return compose()['use'](function(_0x25364d,_0x12f886,_0x2258b8){var _0x42f7e8;if(_0x25364d[_0x11f1('0x39')][_0x11f1('0x3a')]){if(_['startsWith'](_0x25364d[_0x11f1('0x39')][_0x11f1('0x3a')],_0x11f1('0x3b'))){var _0x312d4c=basicAuth(_0x25364d);db[_0x11f1('0x3c')][_0x11f1('0x3d')]({'where':{'name':_0x312d4c[_0x11f1('0xd')]}})[_0x11f1('0x35')](function(_0x627e38){if(!_0x627e38||!_0x627e38['authenticate'](_0x312d4c[_0x11f1('0x3e')])){return _0x12f886[_0x11f1('0x3f')](0x191)[_0x11f1('0x40')]({'message':_0x11f1('0x41')});}_0x25364d[_0x11f1('0x30')]={'id':_0x627e38['id']};_0x2258b8();})[_0x11f1('0x38')](function(_0x5b7e30){_0x2258b8(_0x5b7e30);});}else if(_['startsWith'](_0x25364d['headers'][_0x11f1('0x3a')],_0x11f1('0x42'))){validateJwt(_0x25364d,_0x12f886,_0x2258b8);}else{if(_0x17cfb1){_0x2258b8();}else{return _0x12f886[_0x11f1('0x3f')](0x193)[_0x11f1('0x40')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x25364d['query'][_0x11f1('0x43')]){try{var _0x54a278={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x11f1('0x44')]()};verifyJwt(_0x25364d['query']['apikey'],_0x54a278)[_0x11f1('0x35')](function(_0x4cf9d9){return db[_0x11f1('0x3c')][_0x11f1('0x3d')]({'where':{'id':_0x4cf9d9[_0x11f1('0x45')]}})[_0x11f1('0x35')](function(_0x20ac21){_0x42f7e8=_0x20ac21;return db[_0x11f1('0x46')][_0x11f1('0x31')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x11f1('0x47')],'raw':!![]});})[_0x11f1('0x35')](function(_0x15d9de){if(!_0x42f7e8||!_[_0x11f1('0x48')](_0x42f7e8['apiKeyNonce'],_0x4cf9d9[_0x11f1('0x49')])){return _0x12f886[_0x11f1('0x3f')](0x191)[_0x11f1('0x40')]({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x42f7e8['disabled']){return _0x12f886['status'](0x191)[_0x11f1('0x40')]({'message':_0x11f1('0x4a')});}if(_0x42f7e8[_0x11f1('0x4b')]){if(_0x15d9de[_0x11f1('0x47')]>0x0){if(moment(_0x42f7e8[_0x11f1('0x4c')])[_0x11f1('0x4d')](_0x15d9de[_0x11f1('0x47')],_0x11f1('0x4e'))>moment()){return _0x12f886['status'](0x191)[_0x11f1('0x40')]({'message':_0x11f1('0x4a')});}}else{return _0x12f886[_0x11f1('0x3f')](0x191)[_0x11f1('0x40')]({'message':_0x11f1('0x4a')});}}_0x25364d[_0x11f1('0x30')]={'id':_0x42f7e8['id']};_0x2258b8();});})[_0x11f1('0x38')](function(){return _0x12f886[_0x11f1('0x3f')](0x191)[_0x11f1('0x40')]({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x316147){_0x2258b8(_0x316147);}}else if(_0x17cfb1){_0x2258b8();}else{return _0x12f886[_0x11f1('0x3f')](0x193)[_0x11f1('0x40')]({'message':_0x11f1('0x4f')});}})[_0x11f1('0x2f')](function(_0x169c94,_0x4ebff1,_0x5245df){if(_0x169c94[_0x11f1('0x30')]){db[_0x11f1('0x3c')][_0x11f1('0x3d')]({'where':{'id':_0x169c94[_0x11f1('0x30')]['id']},'attributes':userAttributes})[_0x11f1('0x35')](function(_0xc6d2e5){if(!_0xc6d2e5){return _0x4ebff1[_0x11f1('0x3f')](0x194)['json']({'message':'User\x20not\x20found.'});}_0x169c94[_0x11f1('0x30')]=_0xc6d2e5;_0x5245df();})[_0x11f1('0x38')](function(_0x63e6e3){_0x5245df(_0x63e6e3);});}else if(_0x17cfb1){_0x5245df();}else{return _0x4ebff1[_0x11f1('0x3f')](0x194)[_0x11f1('0x40')]({'message':_0x11f1('0x50')});}});};exports[_0x11f1('0x51')]=function canUpdate(){return compose()[_0x11f1('0x2f')](function(_0x3a2ab0,_0x4d1b19,_0x2eeb41){return licenseUtil['getLicense']()['then'](function(_0x112ba3){if(_0x112ba3[_0x11f1('0x52')]){_0x2eeb41();}else{return _0x4d1b19[_0x11f1('0x3f')](0x193)[_0x11f1('0x40')]({'message':'Forbidden'});}})[_0x11f1('0x38')](function(_0x5c09d6){_0x2eeb41(_0x5c09d6);});});};exports[_0x11f1('0x53')]=function isWebrtcLicence(){return compose()[_0x11f1('0x2f')](function(_0x4861f1,_0xef0d69,_0x48300f){return licenseUtil[_0x11f1('0x54')]()['then'](function(_0x26afb9){if(_0x26afb9[_0x11f1('0x55')]){_0x48300f();}else{return _0xef0d69[_0x11f1('0x3f')](0x193)['json']({'message':'Forbidden'});}})[_0x11f1('0x38')](function(_0x3ac584){_0x48300f(_0x3ac584);});});};exports[_0x11f1('0x56')]=function(_0x196edc,_0x395e72,_0x1e6de2){_0x196edc[_0x11f1('0x56')]=!![];return _0x1e6de2();};exports[_0x11f1('0x57')]=function signToken(_0x33e4d2){return signJwt(_0x33e4d2);};exports['setTokenCookie']=function(_0x4d6c38,_0x5bbd7b){if(!_0x4d6c38[_0x11f1('0x30')]){return _0x5bbd7b['status'](0x194)[_0x11f1('0x40')]({'message':_0x11f1('0x58')});}var _0x97082c={'payload':{'id':_0x4d6c38['user']['id'],'role':_0x4d6c38['user'][_0x11f1('0x59')]},'options':{'expiresIn':0x15180}};return signJwt(_0x97082c)['then'](function(_0x588f0e){_0x5bbd7b[_0x11f1('0x5a')](_0x11f1('0x5b'),_0x588f0e);_0x5bbd7b[_0x11f1('0x5c')](_0x11f1('0x5d'));})[_0x11f1('0x38')](function(_0x33e2b4){return _0x5bbd7b[_0x11f1('0x3f')](0x1f4)['send'](_0x33e2b4);});};exports['retrieveApiKey']=function(_0xbf4d74){if(_['isNil'](_0xbf4d74[_0x11f1('0x5e')])||_[_0x11f1('0x5f')](_0xbf4d74[_0x11f1('0x60')])){return null;}else{return createJwt(_0xbf4d74);}};exports['generateApiKey']=function(_0x3a9bb2){_0x3a9bb2['apiKeyNonce']=generateNonce();_0x3a9bb2[_0x11f1('0x60')]=generateIssuedAt();return createJwt(_0x3a9bb2);};exports[_0x11f1('0x61')]=function(_0x173393,_0x2677bd){var _0x5c4fb4=_0x173393[_0x11f1('0x62')][_0x11f1('0x43')];if(_0x5c4fb4){var _0xd8560d={'nonce':_0x2677bd[_0x11f1('0x5e')],'iat':_0x2677bd[_0x11f1('0x60')],'audience':hardwareConf[_0x11f1('0x44')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x5c4fb4,_0xd8560d)[_0x11f1('0x35')](function(){return generateApiKey(_0x2677bd);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports[_0x11f1('0x63')]=function(_0x9e7a74){var _0x45c08c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x45c08c[_0x11f1('0x64')](_0x9e7a74))throw new db[(_0x11f1('0x65'))][(_0x11f1('0x66'))](_0x11f1('0x67'));return;};exports['validatePasswordHistory']=function(_0x4e42b3,_0x8a3057,_0x16cc8b){var _0x47a1a2=encryptor[_0x11f1('0x68')](_0x8a3057)['split'](',');for(var _0x3fd91c=0x0;_0x3fd91c<_0x16cc8b;_0x3fd91c++){if(!_0x47a1a2[_0x3fd91c])break;if(_0x4e42b3[_0x11f1('0x69')]()===_0x47a1a2[_0x3fd91c][_0x11f1('0x69')]()){var _0x20a9b4=util[_0x11f1('0x6a')](_0x11f1('0x6b'),_0x16cc8b);if(_0x16cc8b===0x1){_0x20a9b4=_0x11f1('0x6c');}throw new db[(_0x11f1('0x65'))][(_0x11f1('0x66'))](_0x20a9b4);}}return;};exports[_0x11f1('0x6d')]=function(_0x1be1a9,_0x282b17){var _0x3cd59e=_0x282b17?encryptor['decryptString'](_0x282b17)[_0x11f1('0x6e')](','):[];if(_0x3cd59e[_0x11f1('0x6f')]===0x5){_0x3cd59e[_0x11f1('0x70')](-0x1,0x1);}_0x3cd59e[_0x11f1('0x71')](_0x1be1a9);return encryptor['encryptString'](_0x3cd59e['join'](','));};function signJwt(_0x5e678a){var _0x20f1e5=BPromise[_0x11f1('0x72')](jwt['sign'],{'context':jwt});var _0x4374ff=_0x5e678a['secret']||config[_0x11f1('0xb')][_0x11f1('0xc')];return new BPromise(function(_0x175f2c,_0x1c766c){_0x20f1e5(_0x5e678a[_0x11f1('0x73')],_0x4374ff,_0x5e678a['options'])[_0x11f1('0x35')](function(_0x1f9c7f){_0x175f2c(_0x1f9c7f);})[_0x11f1('0x38')](function(_0x42b0ad){_0x1c766c(_0x42b0ad);});});}function verifyJwt(_0x436296,_0x1e814a,_0x194388){var _0x561299=BPromise[_0x11f1('0x72')](jwt[_0x11f1('0x74')],{'context':jwt});var _0x2852ce=_0x194388||config[_0x11f1('0xb')]['session'];return new BPromise(function(_0x173b11,_0x1c852c){_0x561299(_0x436296,_0x2852ce,_0x1e814a)['then'](function(_0x3eea33){_0x173b11(_0x3eea33);})[_0x11f1('0x38')](function(_0x489b13){_0x1c852c(_0x489b13);});});}function generateNonce(){return crypto[_0x11f1('0x75')](0x10)['toString'](_0x11f1('0x76'));}function generateIssuedAt(){return Math['floor'](Date[_0x11f1('0x77')]()/0x3e8)[_0x11f1('0x78')]();}function createJwt(_0x3cfd35){var _0x41a745={'payload':{'iat':_0x3cfd35['apiKeyIat'],'nonce':_0x3cfd35[_0x11f1('0x5e')]},'options':{'algorithm':_0x11f1('0x79'),'subject':_0x3cfd35['id'][_0x11f1('0x78')](),'issuer':hardwareConf[_0x11f1('0x44')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x41a745)[_0x11f1('0x35')](function(_0x16bae6){return{'iat':_0x3cfd35[_0x11f1('0x60')],'nonce':_0x3cfd35[_0x11f1('0x5e')],'token':_0x16bae6};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 70edf4a..dc2343e 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 _0x0725=['utf8','base64','crypto','bluebird','lodash','../../config/logger','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','data','binary','end','final','write','decryptFile','update','close','unlink','secret','createCipher'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x0725,0x1de));var _0x5072=function(_0x135ed5,_0x3f92f9){_0x135ed5=_0x135ed5-0x0;var _0x3722d2=_0x0725[_0x135ed5];return _0x3722d2;};'use strict';var crypto=require(_0x5072('0x0'));var fs=require('fs');var BPromise=require(_0x5072('0x1'));var _=require(_0x5072('0x2'));var config=require('../../config/environment');var logger=require(_0x5072('0x3'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x5072('0x4')][_0x5072('0x5')],'algorithm':_0x5072('0x6')};const fileOptions={'algorithm':_0x5072('0x7')};if(config[_0x5072('0x8')]&&config[_0x5072('0x8')][_0x5072('0x9')]){var isSupported=isAlgorithmSupported(config[_0x5072('0x8')][_0x5072('0x9')]);if(isSupported){fileOptions[_0x5072('0x9')]=config['encrypt'][_0x5072('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x5072('0xa')](',\x20');logger[_0x5072('0xb')](config[_0x5072('0x8')][_0x5072('0x9')],_0x5072('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0x146266){return AES_SUPPORTED_RX[_0x5072('0xd')](_0x146266);}function getSupportedCiphers(){return crypto[_0x5072('0xe')]()[_0x5072('0xf')](isASupportedCipher);}function isAlgorithmSupported(_0x522b8d){return getSupportedCiphers()[_0x5072('0x10')](_0x522b8d)>-0x1;}function combineOptions(_0x3c5147){var _0x1af710={};for(var _0x4010a8 in fileOptions){if(fileOptions[_0x5072('0x11')](_0x4010a8)){_0x1af710[_0x4010a8]=fileOptions[_0x4010a8];}}if(_0x3c5147){for(var _0x5be780 in _0x3c5147){if(_0x3c5147[_0x5072('0x11')](_0x5be780)){_0x1af710[_0x5be780]=_0x3c5147[_0x5be780];}}}return _0x1af710;}exports[_0x5072('0x12')]=function(_0x4c70f2,_0x1ef6ba,_0x393142,_0x556e87){return new BPromise(function(_0x329750,_0x486513){_0x556e87=combineOptions(_0x556e87);var _0x170d5f=new Buffer(_0x393142);var _0x30c1a9=fs[_0x5072('0x13')](_0x4c70f2);var _0x11bda4=fs[_0x5072('0x14')](_0x1ef6ba);var _0x57b1f1=crypto['createCipher'](_0x556e87[_0x5072('0x9')],_0x170d5f);_0x30c1a9['on'](_0x5072('0x15'),function(_0x2521b2){var _0x3b51f7=new Buffer(_0x57b1f1['update'](_0x2521b2),_0x5072('0x16'));_0x11bda4['write'](_0x3b51f7);});_0x30c1a9['on'](_0x5072('0x17'),function(){try{var _0x1a54d3=new Buffer(_0x57b1f1[_0x5072('0x18')](_0x5072('0x16')),'binary');_0x11bda4[_0x5072('0x19')](_0x1a54d3);_0x11bda4[_0x5072('0x17')]();_0x11bda4['on']('close',function(){return _0x329750(_0x1ef6ba);});}catch(_0x46fcb8){fs['unlink'](_0x1ef6ba);return _0x486513(_0x46fcb8);}});});};exports[_0x5072('0x1a')]=function(_0x20ea36,_0x16cc11,_0x45051c,_0xce11fa){return new BPromise(function(_0x53d693,_0x496b9d){_0xce11fa=combineOptions(_0xce11fa);var _0x557245=new Buffer(_0x45051c);var _0xab0cc6=fs['createReadStream'](_0x20ea36);var _0x5947b2=fs[_0x5072('0x14')](_0x16cc11);var _0xbb779=crypto['createDecipher'](_0xce11fa[_0x5072('0x9')],_0x557245);_0xab0cc6['on'](_0x5072('0x15'),function(_0x5564ab){var _0x335748=new Buffer(_0xbb779[_0x5072('0x1b')](_0x5564ab),'binary');_0x5947b2[_0x5072('0x19')](_0x335748);});_0xab0cc6['on']('end',function(){try{var _0x277658=new Buffer(_0xbb779[_0x5072('0x18')](_0x5072('0x16')),'binary');_0x5947b2[_0x5072('0x19')](_0x277658);_0x5947b2[_0x5072('0x17')]();_0x5947b2['on'](_0x5072('0x1c'),function(){return _0x53d693(_0x16cc11);});}catch(_0x9d6b67){fs[_0x5072('0x1d')](_0x16cc11);return _0x496b9d(_0x9d6b67);}});});};exports['encryptString']=function(_0x1c059d,_0x399fba,_0x242a66){var _0x2bd279=_0x242a66||stringOptions[_0x5072('0x9')];var _0x17202b=_0x399fba||stringOptions[_0x5072('0x1e')];var _0xf0f1b9=crypto[_0x5072('0x1f')](_0x2bd279,_0x17202b);var _0x521bc9=_0xf0f1b9[_0x5072('0x1b')](_0x1c059d,_0x5072('0x20'),_0x5072('0x21'));_0x521bc9+=_0xf0f1b9[_0x5072('0x18')]('base64');return _0x521bc9;};exports['decryptString']=function(_0x1689e7,_0x1395fd,_0x42013b){var _0x1632b0=_0x42013b||stringOptions[_0x5072('0x9')];var _0x56cf24=_0x1395fd||stringOptions[_0x5072('0x1e')];var _0x55c3f0=crypto['createDecipher'](_0x1632b0,_0x56cf24);var _0x3f343e=_0x55c3f0[_0x5072('0x1b')](_0x1689e7,_0x5072('0x21'),_0x5072('0x20'));_0x3f343e+=_0x55c3f0[_0x5072('0x18')](_0x5072('0x20'));return _0x3f343e;}; \ No newline at end of file +var _0x70c3=['app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','error','test','getCiphers','indexOf','hasOwnProperty','encryptFile','createWriteStream','data','update','binary','end','final','write','close','unlink','createDecipher','encryptString','secret','createCipher','base64','decryptString','utf8','crypto','bluebird','lodash','../../config/logger'];(function(_0x4b08b0,_0x5f3530){var _0x2e8923=function(_0x4b7b2d){while(--_0x4b7b2d){_0x4b08b0['push'](_0x4b08b0['shift']());}};_0x2e8923(++_0x5f3530);}(_0x70c3,0x1a9));var _0x370c=function(_0xb2094d,_0x3b62c3){_0xb2094d=_0xb2094d-0x0;var _0x5605a8=_0x70c3[_0xb2094d];return _0x5605a8;};'use strict';var crypto=require(_0x370c('0x0'));var fs=require('fs');var BPromise=require(_0x370c('0x1'));var _=require(_0x370c('0x2'));var config=require('../../config/environment');var logger=require(_0x370c('0x3'))(_0x370c('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x370c('0x5')][_0x370c('0x6')],'algorithm':_0x370c('0x7')};const fileOptions={'algorithm':_0x370c('0x8')};if(config['encrypt']&&config[_0x370c('0x9')][_0x370c('0xa')]){var isSupported=isAlgorithmSupported(config[_0x370c('0x9')]['algorithm']);if(isSupported){fileOptions[_0x370c('0xa')]=config[_0x370c('0x9')][_0x370c('0xa')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger[_0x370c('0xb')](config[_0x370c('0x9')]['algorithm'],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x2b6b8c){return AES_SUPPORTED_RX[_0x370c('0xc')](_0x2b6b8c);}function getSupportedCiphers(){return crypto[_0x370c('0xd')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x5211d9){return getSupportedCiphers()[_0x370c('0xe')](_0x5211d9)>-0x1;}function combineOptions(_0x48e775){var _0x447b0={};for(var _0x3fa041 in fileOptions){if(fileOptions['hasOwnProperty'](_0x3fa041)){_0x447b0[_0x3fa041]=fileOptions[_0x3fa041];}}if(_0x48e775){for(var _0x5d4ddc in _0x48e775){if(_0x48e775[_0x370c('0xf')](_0x5d4ddc)){_0x447b0[_0x5d4ddc]=_0x48e775[_0x5d4ddc];}}}return _0x447b0;}exports[_0x370c('0x10')]=function(_0x348cb0,_0x370f68,_0x5c837e,_0x128892){return new BPromise(function(_0x590f7b,_0x434081){_0x128892=combineOptions(_0x128892);var _0x27f9ab=new Buffer(_0x5c837e);var _0x1e4a7f=fs['createReadStream'](_0x348cb0);var _0x569060=fs[_0x370c('0x11')](_0x370f68);var _0x48a921=crypto['createCipher'](_0x128892[_0x370c('0xa')],_0x27f9ab);_0x1e4a7f['on'](_0x370c('0x12'),function(_0x3404ca){var _0x2e46d3=new Buffer(_0x48a921[_0x370c('0x13')](_0x3404ca),_0x370c('0x14'));_0x569060['write'](_0x2e46d3);});_0x1e4a7f['on'](_0x370c('0x15'),function(){try{var _0x3f37e3=new Buffer(_0x48a921[_0x370c('0x16')](_0x370c('0x14')),_0x370c('0x14'));_0x569060[_0x370c('0x17')](_0x3f37e3);_0x569060[_0x370c('0x15')]();_0x569060['on'](_0x370c('0x18'),function(){return _0x590f7b(_0x370f68);});}catch(_0x28d0e3){fs[_0x370c('0x19')](_0x370f68);return _0x434081(_0x28d0e3);}});});};exports['decryptFile']=function(_0x5eeee2,_0xb5488,_0x2f7612,_0x368f31){return new BPromise(function(_0xe5a170,_0x9824d8){_0x368f31=combineOptions(_0x368f31);var _0x2d025c=new Buffer(_0x2f7612);var _0x581075=fs['createReadStream'](_0x5eeee2);var _0x259398=fs[_0x370c('0x11')](_0xb5488);var _0x5e26df=crypto[_0x370c('0x1a')](_0x368f31[_0x370c('0xa')],_0x2d025c);_0x581075['on'](_0x370c('0x12'),function(_0x52de73){var _0x39a5bf=new Buffer(_0x5e26df[_0x370c('0x13')](_0x52de73),'binary');_0x259398[_0x370c('0x17')](_0x39a5bf);});_0x581075['on']('end',function(){try{var _0x5a1094=new Buffer(_0x5e26df[_0x370c('0x16')](_0x370c('0x14')),_0x370c('0x14'));_0x259398[_0x370c('0x17')](_0x5a1094);_0x259398[_0x370c('0x15')]();_0x259398['on'](_0x370c('0x18'),function(){return _0xe5a170(_0xb5488);});}catch(_0x3080be){fs['unlink'](_0xb5488);return _0x9824d8(_0x3080be);}});});};exports[_0x370c('0x1b')]=function(_0x45e6d3,_0xdc5ae7,_0x664c0e){var _0x4b0f2b=_0x664c0e||stringOptions[_0x370c('0xa')];var _0x340c76=_0xdc5ae7||stringOptions[_0x370c('0x1c')];var _0x214b7c=crypto[_0x370c('0x1d')](_0x4b0f2b,_0x340c76);var _0xeb64a4=_0x214b7c[_0x370c('0x13')](_0x45e6d3,'utf8',_0x370c('0x1e'));_0xeb64a4+=_0x214b7c[_0x370c('0x16')](_0x370c('0x1e'));return _0xeb64a4;};exports[_0x370c('0x1f')]=function(_0x19b4c1,_0x5bb959,_0x385f77){var _0x4ca0c4=_0x385f77||stringOptions['algorithm'];var _0x323c8f=_0x5bb959||stringOptions[_0x370c('0x1c')];var _0x1194aa=crypto[_0x370c('0x1a')](_0x4ca0c4,_0x323c8f);var _0x35fe4e=_0x1194aa[_0x370c('0x13')](_0x19b4c1,'base64',_0x370c('0x20'));_0x35fe4e+=_0x1194aa[_0x370c('0x16')](_0x370c('0x20'));return _0x35fe4e;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index f058d85..5f2257b 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 _0xab75=['dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','range','isInteger','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','existsSync','join','mkdirSync','%s%d.%s','csv','%s.%s','writeFileSync','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','finally','exit','util','path','lodash','bluebird','zip-dir','rimraf','../../mysqldb'];(function(_0xdaed31,_0x14c405){var _0x205244=function(_0x38c07b){while(--_0x38c07b){_0xdaed31['push'](_0xdaed31['shift']());}};_0x205244(++_0x14c405);}(_0xab75,0x1b2));var _0x5ab7=function(_0x38e1c9,_0x559fc5){_0x38e1c9=_0x38e1c9-0x0;var _0x56eb53=_0xab75[_0x38e1c9];return _0x56eb53;};'use strict';var util=require(_0x5ab7('0x0'));var path=require(_0x5ab7('0x1'));var _=require(_0x5ab7('0x2'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0x5ab7('0x3'));var zipdir=require(_0x5ab7('0x4'));var rimraf=require(_0x5ab7('0x5'));var db=require(_0x5ab7('0x6'))['db'];var dbH=require('../../mysqldb')[_0x5ab7('0x7')];var logger=require(_0x5ab7('0x8'))(_0x5ab7('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x5ab7('0xa')][0x2]);var QUERY=process[_0x5ab7('0xa')][0x3];var PATH=process[_0x5ab7('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x4fe249,_0x432c4a){var _0x2b29c8={'status':_0x4fe249};var _0x5316b3={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x432c4a){_0x2b29c8['savename']=_0x432c4a;}return db[_0x5ab7('0xb')][_0x5ab7('0xc')](_0x2b29c8,_0x5316b3);}function main(){var _0x30802e=0x1388;var _0x3b35da;logger[_0x5ab7('0xd')](util[_0x5ab7('0xe')](_0x5ab7('0xf'),EXTRACTED_REPORT_ID,_0x5ab7('0x10')));return db[_0x5ab7('0x11')][_0x5ab7('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x5ab7('0x13'),_0x5ab7('0x14')]})[_0x5ab7('0x15')](function(_0x5087aa){if(_0x5087aa){_0x3b35da=_0x5087aa;_0x30802e=_0x3b35da[_0x5ab7('0x14')]||0x1388;}})[_0x5ab7('0x15')](function(){return dbH[_0x5ab7('0x16')][_0x5ab7('0x17')](util['format'](_0x5ab7('0x18'),QUERY),{'type':dbH[_0x5ab7('0x16')][_0x5ab7('0x19')][_0x5ab7('0x1a')]});})['then'](function(_0x543520){if(!_0x543520[0x0][_0x5ab7('0x1b')]){return analyticExtractedReport('Empty');}var _0x218af5=[];var _0xa40d49=0x0;if(_0x3b35da[_0x5ab7('0x13')]){if(_0x543520&&_0x543520['length']){var _0x12c2c6=_[_0x5ab7('0x1c')](_0x543520[0x0]['num']/_0x30802e);var _0x976c01=Number[_0x5ab7('0x1d')](_0x543520[0x0][_0x5ab7('0x1b')]/_0x30802e)?_0x543520[0x0][_0x5ab7('0x1b')]%_0x30802e:0x0;_0x12c2c6['forEach'](function(_0x11d2c6){if(_0x11d2c6>0x0){_0xa40d49+=_0x30802e;}_0x218af5[_0x5ab7('0x1e')](dbH['sequelize'][_0x5ab7('0x17')](util['format'](_0x5ab7('0x1f'),QUERY,_0x30802e,_0xa40d49),{'type':dbH[_0x5ab7('0x16')][_0x5ab7('0x19')][_0x5ab7('0x1a')]}));});if(_0x976c01>0x0){_0xa40d49+=_0x30802e;_0x218af5[_0x5ab7('0x1e')](dbH[_0x5ab7('0x16')][_0x5ab7('0x17')](util[_0x5ab7('0xe')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x976c01,_0xa40d49),{'type':dbH[_0x5ab7('0x16')][_0x5ab7('0x19')][_0x5ab7('0x1a')]}));}}}else{_0x218af5[_0x5ab7('0x1e')](dbH[_0x5ab7('0x16')][_0x5ab7('0x17')](QUERY,{'type':dbH[_0x5ab7('0x16')][_0x5ab7('0x19')][_0x5ab7('0x1a')]}));}var _0x27edb6=path[_0x5ab7('0x20')](PATH);var _0x1c4512=path[_0x5ab7('0x21')](PATH,_0x5ab7('0x22'));var _0x7927dd=_0x3b35da[_0x5ab7('0x13')]&&_0x218af5['length']>0x1;var _0xba3e94=[];if(!fs[_0x5ab7('0x23')](path[_0x5ab7('0x24')](_0x27edb6,_0x1c4512))&&_0x7927dd){fs[_0x5ab7('0x25')](path[_0x5ab7('0x24')](_0x27edb6,_0x1c4512));}return BPromise['each'](_0x218af5,function(_0x68b50c){_0xba3e94['push'](_0x68b50c);})[_0x5ab7('0x15')](function(){for(var _0x35f956=0x0;_0x35f956<_0xba3e94['length'];_0x35f956+=0x1){var _0x34bdfd;var _0xa752c0=_0xba3e94[_0x35f956];if(_0x7927dd){_0x34bdfd=path[_0x5ab7('0x24')](_0x27edb6,_0x1c4512,util['format'](_0x5ab7('0x26'),_0x1c4512,_0x35f956,_0x5ab7('0x27')));}else{_0x34bdfd=path['join'](_0x27edb6,util[_0x5ab7('0xe')](_0x5ab7('0x28'),_0x1c4512,_0x5ab7('0x27')));}fs[_0x5ab7('0x29')](_0x34bdfd,csv(_0xa752c0));}})['then'](function(){if(_0x7927dd){return new Promise(function(_0x16a769){zipdir(path[_0x5ab7('0x24')](_0x27edb6,_0x1c4512),{'saveTo':path[_0x5ab7('0x24')](_0x27edb6,util[_0x5ab7('0xe')](_0x5ab7('0x28'),_0x1c4512,'zip'))},function(_0x502cca,_0x504b7f){rimraf(path[_0x5ab7('0x24')](_0x27edb6,_0x1c4512),function(){});_0x16a769(_0x5ab7('0x2a'));});});}})[_0x5ab7('0x15')](function(){logger['info'](util['format'](_0x5ab7('0x2b'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport('Completed',_0x7927dd?util['format'](_0x5ab7('0x28'),_0x1c4512,_0x7927dd?_0x5ab7('0x2c'):_0x5ab7('0x27')):null);});})[_0x5ab7('0x2d')](function(_0x49a243){logger[_0x5ab7('0xd')](util[_0x5ab7('0xe')](_0x5ab7('0x2e'),EXTRACTED_REPORT_ID,_0x5ab7('0x10')),util['inspect'](_0x49a243,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x5ab7('0x2f')](function(){process[_0x5ab7('0x30')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x0bf9=['sequelize','QueryTypes','SELECT','num','Empty','length','range','isInteger','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','existsSync','join','mkdirSync','each','%s%d.%s','%s.%s','csv','zip','zip\x20finished','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Failed','finally','util','path','to-csv','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','split','splitSizeCsv','then'];(function(_0x189fca,_0x1cc26c){var _0x14e88a=function(_0x21b098){while(--_0x21b098){_0x189fca['push'](_0x189fca['shift']());}};_0x14e88a(++_0x1cc26c);}(_0x0bf9,0x1e8));var _0x90bf=function(_0x4a8179,_0x579767){_0x4a8179=_0x4a8179-0x0;var _0x38b56c=_0x0bf9[_0x4a8179];return _0x38b56c;};'use strict';var util=require(_0x90bf('0x0'));var path=require(_0x90bf('0x1'));var _=require('lodash');var csv=require(_0x90bf('0x2'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0x90bf('0x3'));var rimraf=require(_0x90bf('0x4'));var db=require('../../mysqldb')['db'];var dbH=require(_0x90bf('0x5'))[_0x90bf('0x6')];var logger=require(_0x90bf('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x90bf('0x8')][0x2]);var QUERY=process[_0x90bf('0x8')][0x3];var PATH=process[_0x90bf('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x267ef5,_0x3f04e0){var _0x281e91={'status':_0x267ef5};var _0x2e9681={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3f04e0){_0x281e91['savename']=_0x3f04e0;}return db[_0x90bf('0x9')][_0x90bf('0xa')](_0x281e91,_0x2e9681);}function main(){var _0x334c47=0x1388;var _0x526514;logger[_0x90bf('0xb')](util[_0x90bf('0xc')](_0x90bf('0xd'),EXTRACTED_REPORT_ID,'CSV'));return db[_0x90bf('0xe')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x90bf('0xf'),_0x90bf('0x10')]})['then'](function(_0xadbaa3){if(_0xadbaa3){_0x526514=_0xadbaa3;_0x334c47=_0x526514['splitSizeCsv']||0x1388;}})[_0x90bf('0x11')](function(){return dbH['sequelize']['query'](util[_0x90bf('0xc')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x90bf('0x12')][_0x90bf('0x13')][_0x90bf('0x14')]});})[_0x90bf('0x11')](function(_0x3e53f4){if(!_0x3e53f4[0x0][_0x90bf('0x15')]){return analyticExtractedReport(_0x90bf('0x16'));}var _0x2183ed=[];var _0x3559e6=0x0;if(_0x526514['split']){if(_0x3e53f4&&_0x3e53f4[_0x90bf('0x17')]){var _0x3b0261=_[_0x90bf('0x18')](_0x3e53f4[0x0]['num']/_0x334c47);var _0xd6a7d6=Number[_0x90bf('0x19')](_0x3e53f4[0x0][_0x90bf('0x15')]/_0x334c47)?_0x3e53f4[0x0][_0x90bf('0x15')]%_0x334c47:0x0;_0x3b0261['forEach'](function(_0x16b0e5){if(_0x16b0e5>0x0){_0x3559e6+=_0x334c47;}_0x2183ed[_0x90bf('0x1a')](dbH['sequelize'][_0x90bf('0x1b')](util[_0x90bf('0xc')](_0x90bf('0x1c'),QUERY,_0x334c47,_0x3559e6),{'type':dbH['sequelize'][_0x90bf('0x13')][_0x90bf('0x14')]}));});if(_0xd6a7d6>0x0){_0x3559e6+=_0x334c47;_0x2183ed['push'](dbH['sequelize'][_0x90bf('0x1b')](util[_0x90bf('0xc')](_0x90bf('0x1c'),QUERY,_0xd6a7d6,_0x3559e6),{'type':dbH[_0x90bf('0x12')]['QueryTypes'][_0x90bf('0x14')]}));}}}else{_0x2183ed[_0x90bf('0x1a')](dbH[_0x90bf('0x12')][_0x90bf('0x1b')](QUERY,{'type':dbH[_0x90bf('0x12')][_0x90bf('0x13')]['SELECT']}));}var _0x49f2d6=path[_0x90bf('0x1d')](PATH);var _0x4d4dc3=path[_0x90bf('0x1e')](PATH,_0x90bf('0x1f'));var _0x4d3d60=_0x526514[_0x90bf('0xf')]&&_0x2183ed['length']>0x1;var _0x566c6c=[];if(!fs[_0x90bf('0x20')](path[_0x90bf('0x21')](_0x49f2d6,_0x4d4dc3))&&_0x4d3d60){fs[_0x90bf('0x22')](path[_0x90bf('0x21')](_0x49f2d6,_0x4d4dc3));}return BPromise[_0x90bf('0x23')](_0x2183ed,function(_0x297c54){_0x566c6c[_0x90bf('0x1a')](_0x297c54);})[_0x90bf('0x11')](function(){for(var _0x17bd2b=0x0;_0x17bd2b<_0x566c6c[_0x90bf('0x17')];_0x17bd2b+=0x1){var _0x299c81;var _0x1dafc9=_0x566c6c[_0x17bd2b];if(_0x4d3d60){_0x299c81=path['join'](_0x49f2d6,_0x4d4dc3,util[_0x90bf('0xc')](_0x90bf('0x24'),_0x4d4dc3,_0x17bd2b,'csv'));}else{_0x299c81=path[_0x90bf('0x21')](_0x49f2d6,util[_0x90bf('0xc')](_0x90bf('0x25'),_0x4d4dc3,_0x90bf('0x26')));}fs['writeFileSync'](_0x299c81,csv(_0x1dafc9));}})[_0x90bf('0x11')](function(){if(_0x4d3d60){return new Promise(function(_0x1819a1){zipdir(path[_0x90bf('0x21')](_0x49f2d6,_0x4d4dc3),{'saveTo':path['join'](_0x49f2d6,util[_0x90bf('0xc')](_0x90bf('0x25'),_0x4d4dc3,_0x90bf('0x27')))},function(_0x1719d1,_0x196ae3){rimraf(path['join'](_0x49f2d6,_0x4d4dc3),function(){});_0x1819a1(_0x90bf('0x28'));});});}})[_0x90bf('0x11')](function(){logger['info'](util[_0x90bf('0xc')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport('Completed',_0x4d3d60?util[_0x90bf('0xc')]('%s.%s',_0x4d4dc3,_0x4d3d60?_0x90bf('0x27'):'csv'):null);});})[_0x90bf('0x29')](function(_0x427f56){logger[_0x90bf('0xb')](util[_0x90bf('0xc')](_0x90bf('0x2a'),EXTRACTED_REPORT_ID,_0x90bf('0x2b')),util['inspect'](_0x427f56,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x90bf('0x2c'));})[_0x90bf('0x2d')](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 0a24df8..d705458 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 _0xfcce=['toString','value','fill','length','auto','push','body','concat','chunk','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','header','pageBreak','before','margin','landscape','\x20/\x20','footer','Arial','right','num','Empty','Setting','find','split','splitSizePdf','then','range','isInteger','sequelize','query','QueryTypes','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','join','mkdirSync','each','flatten','%s.%s','pdf','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','AnalyticExtractedReport','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','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','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','finish','error','createPdfFromHTML','createPdfKitDocument','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','map','pick'];(function(_0x5cf53d,_0x29d8be){var _0x2c5588=function(_0x106e47){while(--_0x106e47){_0x5cf53d['push'](_0x5cf53d['shift']());}};_0x2c5588(++_0x29d8be);}(_0xfcce,0x1be));var _0xefcc=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xfcce[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xefcc('0x0'));var fs=require('fs');var util=require(_0xefcc('0x1'));var path=require(_0xefcc('0x2'));var moment=require(_0xefcc('0x3'));var htmlToPdfmake=require(_0xefcc('0x4'));var PdfPrinter=require(_0xefcc('0x5'));var zipdir=require('zip-dir');var rimraf=require(_0xefcc('0x6'));var JSDOM=require(_0xefcc('0x7'))[_0xefcc('0x8')];var window=new JSDOM('')[_0xefcc('0x9')];var BPromise=require(_0xefcc('0xa'));var db=require(_0xefcc('0xb'))['db'];var dbH=require(_0xefcc('0xb'))[_0xefcc('0xc')];var logger=require('../../config/logger')(_0xefcc('0xd'));var EXTRACTED_REPORT_ID=Number(process[_0xefcc('0xe')][0x2]);var QUERY=process[_0xefcc('0xe')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0xefcc('0xe')][0x5];var FORMAT=_0xefcc('0xf');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x420829,_0xb8a409){var _0x111185={'status':_0x420829};var _0x1b2203={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xb8a409){_0x111185[_0xefcc('0x10')]=_0xb8a409;}return db['AnalyticExtractedReport']['update'](_0x111185,_0x1b2203);}function getHeaders(_0x59ebf6){return _['map'](_0x59ebf6,function(_0x4c4413){return{'text':_0x4c4413,'style':'tableHeader'};});}function getRows(_0x3cc1e6,_0x222189){return _[_0xefcc('0x11')](_0x222189,function(_0x213434){return _(_0x213434)[_0xefcc('0x12')](_0x3cc1e6)['map'](function(_0x40802a){return _0x40802a?_[_0xefcc('0x13')](_0x40802a):'';})[_0xefcc('0x14')]();});}function createTable(_0x4fc400,_0x5ed8b2){var _0x4973a2={'widths':_[_0xefcc('0x15')](Array(_0x4fc400[_0xefcc('0x16')]),0x91),'heights':function(_0x5ddd9e){return _0x5ddd9e===0x0?_0xefcc('0x17'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x2558f3=getHeaders(_0x4fc400);_0x4973a2['body'][_0xefcc('0x18')](_0x2558f3);var _0x35822d=getRows(_0x4fc400,_0x5ed8b2);_0x4973a2[_0xefcc('0x19')]=_0x4973a2[_0xefcc('0x19')][_0xefcc('0x1a')](_0x35822d);return _0x4973a2;}function createTables(_0x4a0772){var _0x376bb0=[];var _0x71a81=_[_0xefcc('0x1b')](Object[_0xefcc('0x1c')](_0x4a0772[0x0]),0x5);_0x71a81[_0xefcc('0x1d')](function(_0x279d06){_0x376bb0[_0xefcc('0x18')](createTable(_0x279d06,_0x4a0772));});return _0x376bb0;}function getPDFDocDefinition(_0x2d46ac){var _0x3964a2=util[_0xefcc('0x1e')](_0xefcc('0x1f'),NAME,EXTRACTED_REPORT[_0xefcc('0x20')],moment(EXTRACTED_REPORT[_0xefcc('0x21')])['format'](FORMAT),moment(EXTRACTED_REPORT[_0xefcc('0x22')])['format'](FORMAT));var _0x305261=[];for(var _0x33ed8f=0x0;_0x33ed8f<_0x2d46ac['length'];_0x33ed8f++){var _0x24a894=[];if(_0x33ed8f===0x0){_0x24a894[_0xefcc('0x18')]({'text':_0x3964a2,'style':_0xefcc('0x23')});}var _0xed6bde={'table':_0x2d46ac[_0x33ed8f]};if(_0x33ed8f>0x0){_0xed6bde[_0xefcc('0x24')]=_0xefcc('0x25');_0xed6bde[_0xefcc('0x26')]=[0x0,0x46,0x0,0x0];}_0x24a894[_0xefcc('0x18')](_0xed6bde);_0x305261['push'](_0x24a894);}return{'pageSize':'A4','pageOrientation':_0xefcc('0x27'),'content':_0x305261,'footer':function(_0x5cea57,_0x3cff0a){return{'text':_0x5cea57[_0xefcc('0x13')]()+_0xefcc('0x28')+_0x3cff0a,'style':_0xefcc('0x29')};},'defaultStyle':{'font':_0xefcc('0x2a')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0xefcc('0x2b'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x45d5ef){var _0xab8609=0x1388;var _0x26ac80;if(!_0x45d5ef[0x0][_0xefcc('0x2c')]){return analyticExtractedReport(_0xefcc('0x2d'));}return db[_0xefcc('0x2e')][_0xefcc('0x2f')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xefcc('0x30'),_0xefcc('0x31')]})[_0xefcc('0x32')](function(_0x4e01c6){if(_0x4e01c6){_0x26ac80=_0x4e01c6;_0xab8609=_0x26ac80[_0xefcc('0x31')]||0x3e8;}})[_0xefcc('0x32')](function(){var _0x29341a=[];var _0x697091=0x0;if(_0x26ac80[_0xefcc('0x30')]){if(_0x45d5ef&&_0x45d5ef[_0xefcc('0x16')]){var _0x118cd7=_[_0xefcc('0x33')](_0x45d5ef[0x0][_0xefcc('0x2c')]/_0xab8609);var _0x452d22=Number[_0xefcc('0x34')](_0x45d5ef[0x0][_0xefcc('0x2c')]/_0xab8609)?_0x45d5ef[0x0][_0xefcc('0x2c')]%_0xab8609:0x0;_0x118cd7['forEach'](function(_0x241403){if(_0x241403>0x0){_0x697091+=_0xab8609;}_0x29341a['push'](dbH[_0xefcc('0x35')][_0xefcc('0x36')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0xab8609,_0x697091),{'type':dbH[_0xefcc('0x35')][_0xefcc('0x37')]['SELECT']}));});if(_0x452d22>0x0){_0x697091+=_0xab8609;_0x29341a[_0xefcc('0x18')](dbH[_0xefcc('0x35')][_0xefcc('0x36')](util[_0xefcc('0x1e')](_0xefcc('0x38'),QUERY,_0x452d22,_0x697091),{'type':dbH[_0xefcc('0x35')]['QueryTypes'][_0xefcc('0x39')]}));}}}else{_0x29341a[_0xefcc('0x18')](dbH[_0xefcc('0x35')][_0xefcc('0x36')](QUERY,{'type':dbH[_0xefcc('0x35')][_0xefcc('0x37')]['SELECT']}));}var _0x32242d=path['dirname'](PATH);var _0x3c765c=path['basename'](PATH,'.pdf');var _0x864592=_0x26ac80[_0xefcc('0x30')]&&_0x29341a[_0xefcc('0x16')]>0x1;var _0x5c06cd=[];if(!fs['existsSync'](path[_0xefcc('0x3a')](_0x32242d,_0x3c765c))&&_0x864592){fs[_0xefcc('0x3b')](path[_0xefcc('0x3a')](_0x32242d,_0x3c765c));}return BPromise[_0xefcc('0x3c')](_0x29341a,function(_0x55331d){_0x5c06cd[_0xefcc('0x18')](_0x55331d);})[_0xefcc('0x32')](function(){var _0xdaa7ea=[];for(var _0xe07617=0x0;_0xe07617<_0x5c06cd['length'];_0xe07617+=0x1){var _0x261f26=_0x5c06cd[_0xe07617];var _0x2f6edf=createTables(_[_0xefcc('0x3d')](_0x261f26));var _0x59ba28;var _0x39c36c=getPDFDocDefinition(_0x2f6edf);var _0xc68ca3=getPDFPrinter();var _0x485a72=_0xc68ca3['createPdfKitDocument'](_0x39c36c);if(_0x864592){_0x59ba28=path['join'](_0x32242d,_0x3c765c,util[_0xefcc('0x1e')]('%s%d.%s',_0x3c765c,_0xe07617,'pdf'));}else{_0x59ba28=path['join'](_0x32242d,util[_0xefcc('0x1e')](_0xefcc('0x3e'),_0x3c765c,_0xefcc('0x3f')));}_0xdaa7ea[_0xefcc('0x18')](writePDFDocument(_0x485a72,_0x59ba28));}return Promise['all'](_0xdaa7ea);})[_0xefcc('0x32')](function(){if(_0x864592){return new Promise(function(_0x46af1a){zipdir(path[_0xefcc('0x3a')](_0x32242d,_0x3c765c),{'saveTo':path[_0xefcc('0x3a')](_0x32242d,util[_0xefcc('0x1e')](_0xefcc('0x3e'),_0x3c765c,_0xefcc('0x40')))},function(){rimraf(path['join'](_0x32242d,_0x3c765c),function(){});_0x46af1a(_0xefcc('0x41'));});});}})[_0xefcc('0x32')](function(){if(!_0x864592)return;rimraf(path[_0xefcc('0x3a')](_0x32242d,_0x3c765c),function(){});})[_0xefcc('0x32')](function(){logger['info'](util[_0xefcc('0x1e')](_0xefcc('0x42'),EXTRACTED_REPORT_ID,_0xefcc('0x43')));return analyticExtractedReport(_0xefcc('0x44'),_0x864592?util[_0xefcc('0x1e')](_0xefcc('0x3e'),_0x3c765c,_0x864592?'zip':_0xefcc('0x3f')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xefcc('0x45')](util[_0xefcc('0x1e')](_0xefcc('0x46'),EXTRACTED_REPORT_ID,'PDF'));return db[_0xefcc('0x47')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0xefcc('0x32')](function(_0x35b018){EXTRACTED_REPORT=_0x35b018;return dbH[_0xefcc('0x35')][_0xefcc('0x36')](util[_0xefcc('0x1e')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xefcc('0x35')][_0xefcc('0x37')][_0xefcc('0x39')]});})[_0xefcc('0x32')](extractReport)[_0xefcc('0x48')](function(_0x5abf47){logger[_0xefcc('0x45')](util['format'](_0xefcc('0x49'),EXTRACTED_REPORT_ID,'PDF'),util[_0xefcc('0x4a')](_0x5abf47,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xefcc('0x4b'));})[_0xefcc('0x4c')](function(){process[_0xefcc('0x4d')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x41e593=new PdfPrinter({'Arial':{'normal':__dirname+_0xefcc('0x4e'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0xefcc('0x4f'),'bolditalics':__dirname+_0xefcc('0x50')}});return _0x41e593;}function getPDFDocDefinitionFromHTML(_0x26955d,_0x1d8fa6){var _0x49db2a=util[_0xefcc('0x1e')](_0xefcc('0x51'),_0x1d8fa6[_0xefcc('0x52')],_0x1d8fa6[_0xefcc('0x53')]);var _0x1247fa=moment()[_0xefcc('0x1e')](_0xefcc('0x54'))[_0xefcc('0x13')]();var _0xdb26eb=htmlToPdfmake(_0x26955d,{'window':window,'tableAutoSize':!![]});return{'content':[_0xdb26eb],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xefcc('0x55'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xefcc('0x55'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xefcc('0x55')}},'header':function(){return[{'text':_0xefcc('0x56'),'style':_0xefcc('0x23')}];},'footer':function(_0xd04874,_0x54dbf5){return[{'text':util['format'](_0xefcc('0x57'),_0x49db2a,_0xd04874,_0x54dbf5,_0x1247fa),'style':'footer'}];}};}function writePDFDocument(_0x4d1b51,_0x4e2f9b){return new Promise(function(_0x58632a,_0x139b86){var _0x15e06d=_0x4d1b51[_0xefcc('0x58')](fs['createWriteStream'](_0x4e2f9b));_0x15e06d['on'](_0xefcc('0x59'),function(){_0x58632a(_0xefcc('0x59'));});_0x15e06d['on'](_0xefcc('0x5a'),function(_0x4810cd){_0x139b86(_0x4810cd);});_0x4d1b51['end']();});}exports[_0xefcc('0x5b')]=function(_0xfadd07,_0x90a037){var _0x249813=getPDFPrinter();var _0x586bf8=getPDFDocDefinitionFromHTML(_0xfadd07,_0x90a037);var _0x31bff5=_0x249813[_0xefcc('0x5c')](_0x586bf8);return writePDFDocument(_0x31bff5,_0x90a037[_0xefcc('0x2')])[_0xefcc('0x48')](function(_0x36e297){throw _0x36e297;});}; \ No newline at end of file +var _0x872b=['createPdfKitDocument','%s%d.%s','pdf','all','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','%s.%s','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold-italic.ttf','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','header','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','path','catch','util','moment','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','AnalyticExtractedReport','update','map','tableHeader','pick','toString','value','fill','length','auto','body','keys','forEach','push','format','name','startDate','before','margin','landscape','\x20/\x20','footer','Arial','black','right','Empty','find','split','splitSizePdf','then','num','isInteger','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','basename','.pdf','join','mkdirSync','each','flatten'];(function(_0x2ea6f5,_0x4adfc4){var _0x2a88b5=function(_0x556500){while(--_0x556500){_0x2ea6f5['push'](_0x2ea6f5['shift']());}};_0x2a88b5(++_0x4adfc4);}(_0x872b,0xd1));var _0xb872=function(_0x24b556,_0x4623fa){_0x24b556=_0x24b556-0x0;var _0x1a6fc0=_0x872b[_0x24b556];return _0x1a6fc0;};'use strict';var _=require('lodash');var fs=require('fs');var util=require(_0xb872('0x0'));var path=require('path');var moment=require(_0xb872('0x1'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0xb872('0x2'));var zipdir=require(_0xb872('0x3'));var rimraf=require(_0xb872('0x4'));var JSDOM=require(_0xb872('0x5'))[_0xb872('0x6')];var window=new JSDOM('')['window'];var BPromise=require('bluebird');var db=require(_0xb872('0x7'))['db'];var dbH=require('../../mysqldb')[_0xb872('0x8')];var logger=require(_0xb872('0x9'))(_0xb872('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0xb872('0xb')][0x2]);var QUERY=process[_0xb872('0xb')][0x3];var PATH=process[_0xb872('0xb')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0xb872('0xc');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x50f1bf,_0x2d91ad){var _0xc6d4f1={'status':_0x50f1bf};var _0xca326d={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2d91ad){_0xc6d4f1['savename']=_0x2d91ad;}return db[_0xb872('0xd')][_0xb872('0xe')](_0xc6d4f1,_0xca326d);}function getHeaders(_0x12d5ff){return _[_0xb872('0xf')](_0x12d5ff,function(_0x32f48b){return{'text':_0x32f48b,'style':_0xb872('0x10')};});}function getRows(_0x429401,_0x549d27){return _[_0xb872('0xf')](_0x549d27,function(_0x589a0f){return _(_0x589a0f)[_0xb872('0x11')](_0x429401)[_0xb872('0xf')](function(_0x7b7829){return _0x7b7829?_[_0xb872('0x12')](_0x7b7829):'';})[_0xb872('0x13')]();});}function createTable(_0x4c4c0b,_0x296648){var _0x3dded2={'widths':_[_0xb872('0x14')](Array(_0x4c4c0b[_0xb872('0x15')]),0x91),'heights':function(_0x413f44){return _0x413f44===0x0?_0xb872('0x16'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x20d0b3=getHeaders(_0x4c4c0b);_0x3dded2[_0xb872('0x17')]['push'](_0x20d0b3);var _0x44122e=getRows(_0x4c4c0b,_0x296648);_0x3dded2[_0xb872('0x17')]=_0x3dded2[_0xb872('0x17')]['concat'](_0x44122e);return _0x3dded2;}function createTables(_0x1c098f){var _0x12da6e=[];var _0x2376af=_['chunk'](Object[_0xb872('0x18')](_0x1c098f[0x0]),0x5);_0x2376af[_0xb872('0x19')](function(_0xc83442){_0x12da6e[_0xb872('0x1a')](createTable(_0xc83442,_0x1c098f));});return _0x12da6e;}function getPDFDocDefinition(_0x10dc8f){var _0x2d7e22=util[_0xb872('0x1b')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT[_0xb872('0x1c')],moment(EXTRACTED_REPORT[_0xb872('0x1d')])[_0xb872('0x1b')](FORMAT),moment(EXTRACTED_REPORT['endDate'])[_0xb872('0x1b')](FORMAT));var _0x234e19=[];for(var _0x5d6d5a=0x0;_0x5d6d5a<_0x10dc8f[_0xb872('0x15')];_0x5d6d5a++){var _0xb56dab=[];if(_0x5d6d5a===0x0){_0xb56dab['push']({'text':_0x2d7e22,'style':'header'});}var _0x1fd50d={'table':_0x10dc8f[_0x5d6d5a]};if(_0x5d6d5a>0x0){_0x1fd50d['pageBreak']=_0xb872('0x1e');_0x1fd50d[_0xb872('0x1f')]=[0x0,0x46,0x0,0x0];}_0xb56dab[_0xb872('0x1a')](_0x1fd50d);_0x234e19['push'](_0xb56dab);}return{'pageSize':'A4','pageOrientation':_0xb872('0x20'),'content':_0x234e19,'footer':function(_0x1e70a4,_0x4c068b){return{'text':_0x1e70a4[_0xb872('0x12')]()+_0xb872('0x21')+_0x4c068b,'style':_0xb872('0x22')};},'defaultStyle':{'font':_0xb872('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xb872('0x24')},'footer':{'alignment':_0xb872('0x25'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x1e812f){var _0x2d1705=0x1388;var _0x19940c;if(!_0x1e812f[0x0]['num']){return analyticExtractedReport(_0xb872('0x26'));}return db['Setting'][_0xb872('0x27')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xb872('0x28'),_0xb872('0x29')]})[_0xb872('0x2a')](function(_0x3c20eb){if(_0x3c20eb){_0x19940c=_0x3c20eb;_0x2d1705=_0x19940c[_0xb872('0x29')]||0x3e8;}})[_0xb872('0x2a')](function(){var _0x11038a=[];var _0x5915d8=0x0;if(_0x19940c['split']){if(_0x1e812f&&_0x1e812f[_0xb872('0x15')]){var _0x30611c=_['range'](_0x1e812f[0x0][_0xb872('0x2b')]/_0x2d1705);var _0x59acff=Number[_0xb872('0x2c')](_0x1e812f[0x0][_0xb872('0x2b')]/_0x2d1705)?_0x1e812f[0x0]['num']%_0x2d1705:0x0;_0x30611c['forEach'](function(_0x35d39e){if(_0x35d39e>0x0){_0x5915d8+=_0x2d1705;}_0x11038a[_0xb872('0x1a')](dbH[_0xb872('0x2d')]['query'](util['format'](_0xb872('0x2e'),QUERY,_0x2d1705,_0x5915d8),{'type':dbH[_0xb872('0x2d')][_0xb872('0x2f')][_0xb872('0x30')]}));});if(_0x59acff>0x0){_0x5915d8+=_0x2d1705;_0x11038a[_0xb872('0x1a')](dbH[_0xb872('0x2d')]['query'](util[_0xb872('0x1b')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x59acff,_0x5915d8),{'type':dbH['sequelize'][_0xb872('0x2f')][_0xb872('0x30')]}));}}}else{_0x11038a[_0xb872('0x1a')](dbH[_0xb872('0x2d')]['query'](QUERY,{'type':dbH[_0xb872('0x2d')][_0xb872('0x2f')][_0xb872('0x30')]}));}var _0x16d91c=path['dirname'](PATH);var _0x5a864b=path[_0xb872('0x31')](PATH,_0xb872('0x32'));var _0x53ba2a=_0x19940c['split']&&_0x11038a[_0xb872('0x15')]>0x1;var _0x528118=[];if(!fs['existsSync'](path[_0xb872('0x33')](_0x16d91c,_0x5a864b))&&_0x53ba2a){fs[_0xb872('0x34')](path[_0xb872('0x33')](_0x16d91c,_0x5a864b));}return BPromise[_0xb872('0x35')](_0x11038a,function(_0x5d1f6d){_0x528118[_0xb872('0x1a')](_0x5d1f6d);})['then'](function(){var _0x45bdf9=[];for(var _0x4ac65e=0x0;_0x4ac65e<_0x528118['length'];_0x4ac65e+=0x1){var _0x2ebed5=_0x528118[_0x4ac65e];var _0x41e4ed=createTables(_[_0xb872('0x36')](_0x2ebed5));var _0x25545b;var _0xe07f60=getPDFDocDefinition(_0x41e4ed);var _0x1f418f=getPDFPrinter();var _0x25de20=_0x1f418f[_0xb872('0x37')](_0xe07f60);if(_0x53ba2a){_0x25545b=path[_0xb872('0x33')](_0x16d91c,_0x5a864b,util[_0xb872('0x1b')](_0xb872('0x38'),_0x5a864b,_0x4ac65e,_0xb872('0x39')));}else{_0x25545b=path['join'](_0x16d91c,util['format']('%s.%s',_0x5a864b,_0xb872('0x39')));}_0x45bdf9[_0xb872('0x1a')](writePDFDocument(_0x25de20,_0x25545b));}return Promise[_0xb872('0x3a')](_0x45bdf9);})['then'](function(){if(_0x53ba2a){return new Promise(function(_0x2faaf0){zipdir(path['join'](_0x16d91c,_0x5a864b),{'saveTo':path[_0xb872('0x33')](_0x16d91c,util['format']('%s.%s',_0x5a864b,_0xb872('0x3b')))},function(){rimraf(path[_0xb872('0x33')](_0x16d91c,_0x5a864b),function(){});_0x2faaf0('zip\x20finished');});});}})[_0xb872('0x2a')](function(){if(!_0x53ba2a)return;rimraf(path[_0xb872('0x33')](_0x16d91c,_0x5a864b),function(){});})[_0xb872('0x2a')](function(){logger[_0xb872('0x3c')](util[_0xb872('0x1b')](_0xb872('0x3d'),EXTRACTED_REPORT_ID,_0xb872('0x3e')));return analyticExtractedReport(_0xb872('0x3f'),_0x53ba2a?util[_0xb872('0x1b')](_0xb872('0x40'),_0x5a864b,_0x53ba2a?_0xb872('0x3b'):_0xb872('0x39')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xb872('0x3c')](util[_0xb872('0x1b')](_0xb872('0x41'),EXTRACTED_REPORT_ID,'PDF'));return db[_0xb872('0xd')][_0xb872('0x42')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xb872('0x2a')](function(_0x56bce1){EXTRACTED_REPORT=_0x56bce1;return dbH[_0xb872('0x2d')]['query'](util[_0xb872('0x1b')](_0xb872('0x43'),QUERY),{'type':dbH[_0xb872('0x2d')][_0xb872('0x2f')][_0xb872('0x30')]});})[_0xb872('0x2a')](extractReport)['catch'](function(_0xccf908){logger[_0xb872('0x3c')](util['format'](_0xb872('0x44'),EXTRACTED_REPORT_ID,'PDF'),util['inspect'](_0xccf908,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xb872('0x45'));})[_0xb872('0x46')](function(){process[_0xb872('0x47')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x4aa043=new PdfPrinter({'Arial':{'normal':__dirname+_0xb872('0x48'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0xb872('0x49')}});return _0x4aa043;}function getPDFDocDefinitionFromHTML(_0x161336,_0x2a848b){var _0x2145d1=util[_0xb872('0x1b')]('%s\x20#%d',_0x2a848b[_0xb872('0x4a')],_0x2a848b[_0xb872('0x4b')]);var _0x55fb12=moment()[_0xb872('0x1b')](_0xb872('0x4c'))['toString']();var _0x43364c=htmlToPdfmake(_0x161336,{'window':window,'tableAutoSize':!![]});return{'content':[_0x43364c],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xb872('0x4d'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xb872('0x4d'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xb872('0x4d')}},'header':function(){return[{'text':_0xb872('0x4e'),'style':_0xb872('0x4f')}];},'footer':function(_0x5c8b3c,_0x51f4a7){return[{'text':util['format'](_0xb872('0x50'),_0x2145d1,_0x5c8b3c,_0x51f4a7,_0x55fb12),'style':'footer'}];}};}function writePDFDocument(_0x568645,_0x4552c7){return new Promise(function(_0x1b8918,_0x291db2){var _0x3312bf=_0x568645[_0xb872('0x51')](fs[_0xb872('0x52')](_0x4552c7));_0x3312bf['on'](_0xb872('0x53'),function(){_0x1b8918(_0xb872('0x53'));});_0x3312bf['on'](_0xb872('0x54'),function(_0x26739c){_0x291db2(_0x26739c);});_0x568645[_0xb872('0x55')]();});}exports['createPdfFromHTML']=function(_0x41c1f6,_0x3c58e3){var _0x55dd22=getPDFPrinter();var _0x134f59=getPDFDocDefinitionFromHTML(_0x41c1f6,_0x3c58e3);var _0x2b2e43=_0x55dd22[_0xb872('0x37')](_0x134f59);return writePDFDocument(_0x2b2e43,_0x3c58e3[_0xb872('0x56')])[_0xb872('0x57')](function(_0x11e301){throw _0x11e301;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 6c1060f..89e7793 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 _0x1beb=['zip','catch','info','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','exit','util','path','json2xls','bluebird','zip-dir','../../mysqldb','../../config/logger','analytics','argv','savename','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','find','splitSizeXlsx','then','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','Empty','split','range','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','push','SELECT','dirname','basename','.xlsx','length','existsSync','mkdirSync','join','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed'];(function(_0xae9880,_0x23e514){var _0x29ab37=function(_0x4add1a){while(--_0x4add1a){_0xae9880['push'](_0xae9880['shift']());}};_0x29ab37(++_0x23e514);}(_0x1beb,0x165));var _0xb1be=function(_0x2cd524,_0x237f04){_0x2cd524=_0x2cd524-0x0;var _0x280259=_0x1beb[_0x2cd524];return _0x280259;};'use strict';var util=require(_0xb1be('0x0'));var path=require(_0xb1be('0x1'));var _=require('lodash');var fs=require('fs');var json2xls=require(_0xb1be('0x2'));var BPromise=require(_0xb1be('0x3'));var zipdir=require(_0xb1be('0x4'));var rimraf=require('rimraf');var db=require(_0xb1be('0x5'))['db'];var dbH=require(_0xb1be('0x5'))['dbH'];var logger=require(_0xb1be('0x6'))(_0xb1be('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0xb1be('0x8')][0x2]);var QUERY=process[_0xb1be('0x8')][0x3];var PATH=process[_0xb1be('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xc54560,_0x42014d){var _0x1c8f2e={'status':_0xc54560};var _0x533389={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x42014d){_0x1c8f2e[_0xb1be('0x9')]=_0x42014d;}return db['AnalyticExtractedReport']['update'](_0x1c8f2e,_0x533389);}function main(){var _0x349978=0x1388;var _0x1d1ef5;logger['info'](util['format'](_0xb1be('0xa'),EXTRACTED_REPORT_ID,_0xb1be('0xb')));return db['Setting'][_0xb1be('0xc')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xb1be('0xd')]})[_0xb1be('0xe')](function(_0x5eb9a7){if(_0x5eb9a7){_0x1d1ef5=_0x5eb9a7;_0x349978=_0x1d1ef5[_0xb1be('0xd')]||0x1388;}})[_0xb1be('0xe')](function(){return dbH[_0xb1be('0xf')][_0xb1be('0x10')](util[_0xb1be('0x11')](_0xb1be('0x12'),QUERY),{'type':dbH[_0xb1be('0xf')][_0xb1be('0x13')]['SELECT']});})[_0xb1be('0xe')](function(_0x5399b0){if(!_0x5399b0[0x0][_0xb1be('0x14')]){return analyticExtractedReport(_0xb1be('0x15'));}var _0x172e74=[];var _0x45a8e4=0x0;if(_0x1d1ef5[_0xb1be('0x16')]){if(_0x5399b0&&_0x5399b0['length']){var _0x4b9c12=_[_0xb1be('0x17')](_0x5399b0[0x0][_0xb1be('0x14')]/_0x349978);var _0x2bad8f=Number['isInteger'](_0x5399b0[0x0][_0xb1be('0x14')]/_0x349978)?_0x5399b0[0x0]['num']%_0x349978:0x0;_0x4b9c12[_0xb1be('0x18')](function(_0x43dda9){if(_0x43dda9>0x0){_0x45a8e4+=_0x349978;}_0x172e74['push'](dbH[_0xb1be('0xf')][_0xb1be('0x10')](util['format'](_0xb1be('0x19'),QUERY,_0x349978,_0x45a8e4),{'type':dbH[_0xb1be('0xf')][_0xb1be('0x13')]['SELECT']}));});if(_0x2bad8f>0x0){_0x45a8e4+=_0x349978;_0x172e74[_0xb1be('0x1a')](dbH[_0xb1be('0xf')]['query'](util[_0xb1be('0x11')](_0xb1be('0x19'),QUERY,_0x2bad8f,_0x45a8e4),{'type':dbH['sequelize'][_0xb1be('0x13')][_0xb1be('0x1b')]}));}}}else{_0x172e74[_0xb1be('0x1a')](dbH['sequelize'][_0xb1be('0x10')](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0xb1be('0x1b')]}));}var _0x5194d2=path[_0xb1be('0x1c')](PATH);var _0x281c25=path[_0xb1be('0x1d')](PATH,_0xb1be('0x1e'));var _0x2a1f00=_0x1d1ef5['split']&&_0x172e74[_0xb1be('0x1f')]>0x1;var _0x110640=[];if(!fs[_0xb1be('0x20')](path['join'](_0x5194d2,_0x281c25))&&_0x2a1f00){fs[_0xb1be('0x21')](path[_0xb1be('0x22')](_0x5194d2,_0x281c25));}return BPromise[_0xb1be('0x23')](_0x172e74,function(_0x5000eb){_0x110640['push'](_0x5000eb);})[_0xb1be('0xe')](function(){for(var _0x19902d=0x0;_0x19902d<_0x110640[_0xb1be('0x1f')];_0x19902d+=0x1){var _0xdfa40d;var _0x49f2e3=_0x110640[_0x19902d];if(_0x2a1f00){_0xdfa40d=path[_0xb1be('0x22')](_0x5194d2,_0x281c25,util[_0xb1be('0x11')](_0xb1be('0x24'),_0x281c25,_0x19902d,_0xb1be('0x25')));}else{_0xdfa40d=path[_0xb1be('0x22')](_0x5194d2,util['format'](_0xb1be('0x26'),_0x281c25,_0xb1be('0x25')));}fs[_0xb1be('0x27')](_0xdfa40d,json2xls(_0x49f2e3),_0xb1be('0x28'));}})['then'](function(){if(_0x2a1f00){return new Promise(function(_0x34ad22){zipdir(path['join'](_0x5194d2,_0x281c25),{'saveTo':path[_0xb1be('0x22')](_0x5194d2,util[_0xb1be('0x11')](_0xb1be('0x26'),_0x281c25,'zip'))},function(_0x3136f9,_0x3b235d){rimraf(path['join'](_0x5194d2,_0x281c25),function(){});_0x34ad22(_0xb1be('0x29'));});});}})[_0xb1be('0xe')](function(){logger['info'](util[_0xb1be('0x11')](_0xb1be('0x2a'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport('Completed',_0x2a1f00?util['format'](_0xb1be('0x26'),_0x281c25,_0x2a1f00?_0xb1be('0x2b'):_0xb1be('0x25')):null);});})[_0xb1be('0x2c')](function(_0xc0fd0e){logger[_0xb1be('0x2d')](util[_0xb1be('0x11')](_0xb1be('0x2e'),EXTRACTED_REPORT_ID,_0xb1be('0xb')),util['inspect'](_0xc0fd0e,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xb1be('0x2f'));})[_0xb1be('0x30')](function(){process[_0xb1be('0x31')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x0f8e=['update','format','Setting','split','splitSizeXlsx','then','sequelize','query','QueryTypes','num','length','range','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','basename','.xlsx','mkdirSync','join','each','%s%d.%s','xlsx','%s.%s','writeFileSync','zip\x20finished','info','Completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Failed','path','lodash','json2xls','bluebird','rimraf','../../mysqldb','analytics','argv','savename','AnalyticExtractedReport'];(function(_0x25e905,_0x42f080){var _0x4d1f16=function(_0x575f79){while(--_0x575f79){_0x25e905['push'](_0x25e905['shift']());}};_0x4d1f16(++_0x42f080);}(_0x0f8e,0x7a));var _0xe0f8=function(_0x1c73ee,_0x49a9c9){_0x1c73ee=_0x1c73ee-0x0;var _0x154f05=_0x0f8e[_0x1c73ee];return _0x154f05;};'use strict';var util=require('util');var path=require(_0xe0f8('0x0'));var _=require(_0xe0f8('0x1'));var fs=require('fs');var json2xls=require(_0xe0f8('0x2'));var BPromise=require(_0xe0f8('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0xe0f8('0x4'));var db=require(_0xe0f8('0x5'))['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require('../../config/logger')(_0xe0f8('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0xe0f8('0x7')][0x2]);var QUERY=process[_0xe0f8('0x7')][0x3];var PATH=process[_0xe0f8('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x560534,_0x13a816){var _0x5938b7={'status':_0x560534};var _0x6ce02d={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x13a816){_0x5938b7[_0xe0f8('0x8')]=_0x13a816;}return db[_0xe0f8('0x9')][_0xe0f8('0xa')](_0x5938b7,_0x6ce02d);}function main(){var _0x41a64c=0x1388;var _0x4ac120;logger['info'](util[_0xe0f8('0xb')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'XLSX'));return db[_0xe0f8('0xc')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xe0f8('0xd'),'splitSizeXlsx']})['then'](function(_0xae46f8){if(_0xae46f8){_0x4ac120=_0xae46f8;_0x41a64c=_0x4ac120[_0xe0f8('0xe')]||0x1388;}})[_0xe0f8('0xf')](function(){return dbH[_0xe0f8('0x10')][_0xe0f8('0x11')](util[_0xe0f8('0xb')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xe0f8('0x10')][_0xe0f8('0x12')]['SELECT']});})[_0xe0f8('0xf')](function(_0x12b40f){if(!_0x12b40f[0x0][_0xe0f8('0x13')]){return analyticExtractedReport('Empty');}var _0x123f27=[];var _0x1979a4=0x0;if(_0x4ac120[_0xe0f8('0xd')]){if(_0x12b40f&&_0x12b40f[_0xe0f8('0x14')]){var _0x2df42b=_[_0xe0f8('0x15')](_0x12b40f[0x0][_0xe0f8('0x13')]/_0x41a64c);var _0x46256b=Number['isInteger'](_0x12b40f[0x0]['num']/_0x41a64c)?_0x12b40f[0x0]['num']%_0x41a64c:0x0;_0x2df42b[_0xe0f8('0x16')](function(_0x384d87){if(_0x384d87>0x0){_0x1979a4+=_0x41a64c;}_0x123f27[_0xe0f8('0x17')](dbH[_0xe0f8('0x10')][_0xe0f8('0x11')](util[_0xe0f8('0xb')](_0xe0f8('0x18'),QUERY,_0x41a64c,_0x1979a4),{'type':dbH[_0xe0f8('0x10')][_0xe0f8('0x12')][_0xe0f8('0x19')]}));});if(_0x46256b>0x0){_0x1979a4+=_0x41a64c;_0x123f27[_0xe0f8('0x17')](dbH[_0xe0f8('0x10')]['query'](util[_0xe0f8('0xb')](_0xe0f8('0x18'),QUERY,_0x46256b,_0x1979a4),{'type':dbH[_0xe0f8('0x10')][_0xe0f8('0x12')][_0xe0f8('0x19')]}));}}}else{_0x123f27[_0xe0f8('0x17')](dbH[_0xe0f8('0x10')][_0xe0f8('0x11')](QUERY,{'type':dbH[_0xe0f8('0x10')]['QueryTypes'][_0xe0f8('0x19')]}));}var _0x126c4c=path[_0xe0f8('0x1a')](PATH);var _0x56422c=path[_0xe0f8('0x1b')](PATH,_0xe0f8('0x1c'));var _0x2aa15f=_0x4ac120['split']&&_0x123f27[_0xe0f8('0x14')]>0x1;var _0x146629=[];if(!fs['existsSync'](path['join'](_0x126c4c,_0x56422c))&&_0x2aa15f){fs[_0xe0f8('0x1d')](path[_0xe0f8('0x1e')](_0x126c4c,_0x56422c));}return BPromise[_0xe0f8('0x1f')](_0x123f27,function(_0x5acbab){_0x146629[_0xe0f8('0x17')](_0x5acbab);})[_0xe0f8('0xf')](function(){for(var _0x4d8b25=0x0;_0x4d8b25<_0x146629[_0xe0f8('0x14')];_0x4d8b25+=0x1){var _0x28bd10;var _0x42aed4=_0x146629[_0x4d8b25];if(_0x2aa15f){_0x28bd10=path[_0xe0f8('0x1e')](_0x126c4c,_0x56422c,util['format'](_0xe0f8('0x20'),_0x56422c,_0x4d8b25,_0xe0f8('0x21')));}else{_0x28bd10=path[_0xe0f8('0x1e')](_0x126c4c,util[_0xe0f8('0xb')](_0xe0f8('0x22'),_0x56422c,_0xe0f8('0x21')));}fs[_0xe0f8('0x23')](_0x28bd10,json2xls(_0x42aed4),'binary');}})['then'](function(){if(_0x2aa15f){return new Promise(function(_0x494497){zipdir(path[_0xe0f8('0x1e')](_0x126c4c,_0x56422c),{'saveTo':path[_0xe0f8('0x1e')](_0x126c4c,util[_0xe0f8('0xb')](_0xe0f8('0x22'),_0x56422c,'zip'))},function(_0x5b22e0,_0x3b2f50){rimraf(path[_0xe0f8('0x1e')](_0x126c4c,_0x56422c),function(){});_0x494497(_0xe0f8('0x24'));});});}})['then'](function(){logger[_0xe0f8('0x25')](util[_0xe0f8('0xb')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0xe0f8('0x26'),_0x2aa15f?util['format'](_0xe0f8('0x22'),_0x56422c,_0x2aa15f?_0xe0f8('0x27'):'xlsx'):null);});})[_0xe0f8('0x28')](function(_0x195c7c){logger[_0xe0f8('0x25')](util[_0xe0f8('0xb')](_0xe0f8('0x29'),EXTRACTED_REPORT_ID,_0xe0f8('0x2a')),util['inspect'](_0x195c7c,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xe0f8('0x2b'));})['finally'](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 72612bf..db2ce22 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 _0xbcb4=['appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','last','concat','Hangup','transaction','bulkCreate','sortBy','catch','rewrite','models','Interval','findAll','VoiceExtension','IntervalId','uniq','CAST(priority\x20AS\x20UNSIGNED)','then','groupBy','exten','queue','playback','hasOwnProperty','priority','extensions','extension','find','push','Set','format','CDR(type)=%s','type','context','VoiceExtensionId','inbound','CDR(routeid)=','outbound','CDR(destination)=','${EXTEN:','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','toLowerCase','createdAt','interval','*,*,*,*','map','filter','intervals','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','length','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','app'];(function(_0x470615,_0x1c7aaa){var _0x189c81=function(_0x398e12){while(--_0x398e12){_0x470615['push'](_0x470615['shift']());}};_0x189c81(++_0x1c7aaa);}(_0xbcb4,0x182));var _0x4bcb=function(_0x304323,_0x5240c0){_0x304323=_0x304323-0x0;var _0x4f83a2=_0xbcb4[_0x304323];return _0x4f83a2;};'use strict';var _=require('lodash');var util=require('util');function rewrite(_0xdb5237,_0x4f1587){var _0x166c08=this;return _0xdb5237[_0x4bcb('0x0')][_0x4bcb('0x1')][_0x4bcb('0x2')]({'raw':!![]})['then'](function(_0x216fee){_0x166c08['intervals']=_0x216fee;return _0xdb5237[_0x4bcb('0x0')][_0x4bcb('0x3')][_0x4bcb('0x2')]({'where':{'IntervalId':_0x4f1587[_0x4bcb('0x4')]},'raw':!![]});})['then'](function(_0x211509){return _0xdb5237[_0x4bcb('0x0')]['VoiceExtension']['findAll']({'where':{'exten':{'$in':_[_0x4bcb('0x5')](_['map'](_0x211509,'exten'))}},'order':[{'raw':_0x4bcb('0x6')}],'raw':!![]});})[_0x4bcb('0x7')](function(_0x51dcf9){var _0x512942=_['filter'](_0x51dcf9,{'priority':'1'});var _0x3c1d97=_['filter'](_0x51dcf9,{'isApp':0x1});var _0x2e92d7=_[_0x4bcb('0x8')](_0x3c1d97,_0x4bcb('0x9'));var _0x5691f8=[_0x4bcb('0xa'),_0x4bcb('0xb')];var _0x2336f5=[];var _0x494ca1=[];for(var _0x1f85aa in _0x2e92d7){if(_0x2e92d7[_0x4bcb('0xc')](_0x1f85aa)){_0x166c08[_0x4bcb('0xd')]=0x2;_0x166c08[_0x4bcb('0xe')]=[];_0x166c08[_0x4bcb('0xf')]=_[_0x4bcb('0x10')](_0x512942,{'exten':_0x2e92d7[_0x1f85aa][0x0][_0x4bcb('0x9')]});_0x166c08[_0x4bcb('0xe')][_0x4bcb('0x11')]({'type':_0x2e92d7[_0x1f85aa][0x0]['type'],'app':_0x4bcb('0x12'),'appdata':util[_0x4bcb('0x13')](_0x4bcb('0x14'),_0x2e92d7[_0x1f85aa][0x0][_0x4bcb('0x15')]),'context':_0x2e92d7[_0x1f85aa][0x0][_0x4bcb('0x16')],'exten':_0x2e92d7[_0x1f85aa][0x0][_0x4bcb('0x9')],'priority':_0x166c08[_0x4bcb('0xd')]++,'VoiceExtensionId':_0x2e92d7[_0x1f85aa][0x0][_0x4bcb('0x17')]});if(_0x2e92d7[_0x1f85aa][0x0][_0x4bcb('0x15')]===_0x4bcb('0x18')){_0x166c08[_0x4bcb('0xe')]['push']({'type':_0x2e92d7[_0x1f85aa][0x0][_0x4bcb('0x15')],'app':_0x4bcb('0x12'),'appdata':_0x4bcb('0x19')+_0x2e92d7[_0x1f85aa][0x0][_0x4bcb('0x17')],'context':_0x2e92d7[_0x1f85aa][0x0][_0x4bcb('0x16')],'exten':_0x2e92d7[_0x1f85aa][0x0][_0x4bcb('0x9')],'priority':_0x166c08[_0x4bcb('0xd')]++,'VoiceExtensionId':_0x2e92d7[_0x1f85aa][0x0][_0x4bcb('0x17')]});}else if(_0x2e92d7[_0x1f85aa][0x0]['type']===_0x4bcb('0x1a')){if(_0x166c08[_0x4bcb('0xf')]){_0x166c08[_0x4bcb('0xe')][_0x4bcb('0x11')]({'type':_0x2e92d7[_0x1f85aa][0x0][_0x4bcb('0x15')],'app':'Set','appdata':_0x4bcb('0x1b')+(_0x166c08[_0x4bcb('0xf')]['cutdigits']?_0x4bcb('0x1c')+_0x166c08['extension'][_0x4bcb('0x1d')]+'}':_0x4bcb('0x1e')),'context':_0x2e92d7[_0x1f85aa][0x0]['context'],'exten':_0x2e92d7[_0x1f85aa][0x0]['exten'],'priority':_0x166c08['priority']++,'VoiceExtensionId':_0x2e92d7[_0x1f85aa][0x0][_0x4bcb('0x17')]});}_0x166c08['extensions'][_0x4bcb('0x11')]({'type':_0x2e92d7[_0x1f85aa][0x0][_0x4bcb('0x15')],'app':_0x4bcb('0x12'),'appdata':_0x4bcb('0x19')+_0x2e92d7[_0x1f85aa][0x0][_0x4bcb('0x17')],'context':_0x2e92d7[_0x1f85aa][0x0][_0x4bcb('0x16')],'exten':_0x2e92d7[_0x1f85aa][0x0][_0x4bcb('0x9')],'priority':_0x166c08['priority']++,'VoiceExtensionId':_0x2e92d7[_0x1f85aa][0x0][_0x4bcb('0x17')]});var _0x2cc283=_0x166c08[_0x4bcb('0xd')]++;_0x166c08[_0x4bcb('0xe')]['push']({'type':_0x2e92d7[_0x1f85aa][0x0][_0x4bcb('0x15')],'app':_0x4bcb('0x1f'),'appdata':_0x4bcb('0x20')+(_0x2cc283+0x2)+_0x4bcb('0x21')+(_0x2cc283+0x1)+')','context':_0x2e92d7[_0x1f85aa][0x0][_0x4bcb('0x16')],'exten':_0x2e92d7[_0x1f85aa][0x0][_0x4bcb('0x9')],'priority':_0x2cc283,'VoiceExtensionId':_0x2e92d7[_0x1f85aa][0x0][_0x4bcb('0x17')]});if(_0x166c08[_0x4bcb('0xf')]){_0x166c08[_0x4bcb('0xe')]['push']({'type':_0x2e92d7[_0x1f85aa][0x0][_0x4bcb('0x15')],'app':_0x4bcb('0x12'),'appdata':_0x166c08[_0x4bcb('0xf')]['cutdigits']?_0x4bcb('0x22')+_0x166c08[_0x4bcb('0xf')]['cutdigits']+'}':_0x4bcb('0x23'),'context':_0x2e92d7[_0x1f85aa][0x0]['context'],'exten':_0x2e92d7[_0x1f85aa][0x0][_0x4bcb('0x9')],'priority':_0x166c08[_0x4bcb('0xd')]++,'VoiceExtensionId':_0x2e92d7[_0x1f85aa][0x0][_0x4bcb('0x17')]});}_0x166c08[_0x4bcb('0xe')][_0x4bcb('0x11')]({'type':_0x2e92d7[_0x1f85aa][0x0][_0x4bcb('0x15')],'app':'Set','appdata':_0x4bcb('0x24')+_0x2e92d7[_0x1f85aa][0x0][_0x4bcb('0x17')],'context':_0x2e92d7[_0x1f85aa][0x0]['context'],'exten':_0x2e92d7[_0x1f85aa][0x0][_0x4bcb('0x9')],'priority':_0x166c08['priority']++,'VoiceExtensionId':_0x2e92d7[_0x1f85aa][0x0][_0x4bcb('0x17')]});if(_0x166c08[_0x4bcb('0xf')]&&_0x166c08['extension'][_0x4bcb('0xc')](_0x4bcb('0x25'))&&_0x166c08[_0x4bcb('0xf')][_0x4bcb('0x25')]!==_0x4bcb('0x26')){_0x166c08[_0x4bcb('0xe')][_0x4bcb('0x11')]({'type':_0x2e92d7[_0x1f85aa][0x0][_0x4bcb('0x15')],'app':_0x4bcb('0x12'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x2e92d7[_0x1f85aa][0x0]['context'],'exten':_0x2e92d7[_0x1f85aa][0x0][_0x4bcb('0x9')],'priority':_0x166c08[_0x4bcb('0xd')]++,'VoiceExtensionId':_0x2e92d7[_0x1f85aa][0x0][_0x4bcb('0x17')]});_0x166c08['extensions']['push']({'type':_0x2e92d7[_0x1f85aa][0x0][_0x4bcb('0x15')],'app':_0x4bcb('0x12'),'appdata':_0x4bcb('0x27')+_0x166c08['extension'][_0x4bcb('0x25')]||_0x4bcb('0x28'),'context':_0x2e92d7[_0x1f85aa][0x0][_0x4bcb('0x16')],'exten':_0x2e92d7[_0x1f85aa][0x0][_0x4bcb('0x9')],'priority':_0x166c08['priority']++,'VoiceExtensionId':_0x2e92d7[_0x1f85aa][0x0]['VoiceExtensionId']});}}_0x166c08[_0x4bcb('0xe')][_0x4bcb('0x11')]({'type':_0x2e92d7[_0x1f85aa][0x0][_0x4bcb('0x15')],'app':_0x4bcb('0x12'),'appdata':_0x4bcb('0x29'),'context':_0x2e92d7[_0x1f85aa][0x0][_0x4bcb('0x16')],'exten':_0x2e92d7[_0x1f85aa][0x0][_0x4bcb('0x9')],'priority':_0x166c08[_0x4bcb('0xd')]++,'VoiceExtensionId':_0x2e92d7[_0x1f85aa][0x0][_0x4bcb('0x17')]});_0x166c08[_0x4bcb('0xe')]['push']({'type':_0x2e92d7[_0x1f85aa][0x0]['type'],'app':_0x4bcb('0x12'),'appdata':_0x4bcb('0x2a'),'context':_0x2e92d7[_0x1f85aa][0x0]['context'],'exten':_0x2e92d7[_0x1f85aa][0x0][_0x4bcb('0x9')],'priority':_0x166c08[_0x4bcb('0xd')]++,'VoiceExtensionId':_0x2e92d7[_0x1f85aa][0x0][_0x4bcb('0x17')]});_0x166c08[_0x4bcb('0xe')][_0x4bcb('0x11')]({'type':_0x2e92d7[_0x1f85aa][0x0][_0x4bcb('0x15')],'app':'Set','appdata':_0x4bcb('0x2b'),'context':_0x2e92d7[_0x1f85aa][0x0]['context'],'exten':_0x2e92d7[_0x1f85aa][0x0][_0x4bcb('0x9')],'priority':_0x166c08['priority']++,'VoiceExtensionId':_0x2e92d7[_0x1f85aa][0x0][_0x4bcb('0x17')]});for(var _0x3a8064=0x0,_0x15ace4=0x0;_0x3a8064<_0x2e92d7[_0x1f85aa]['length'];_0x3a8064+=0x1,_0x15ace4=0x0){var _0x12ad6d=_0x2e92d7[_0x1f85aa][_0x3a8064];if(_0x12ad6d['type']){_0x12ad6d[_0x4bcb('0x15')]=_0x12ad6d[_0x4bcb('0x15')][_0x4bcb('0x2c')]();}var _0x44f9c3=[];var _0x57241c=[];delete _0x12ad6d['id'];delete _0x12ad6d[_0x4bcb('0x2d')];delete _0x12ad6d['updatedAt'];var _0x5e00eb=_0x12ad6d[_0x4bcb('0x2e')]!==_0x4bcb('0x2f')?[_0x12ad6d[_0x4bcb('0x2e')]]:_0x12ad6d[_0x4bcb('0x4')]?_[_0x4bcb('0x30')](_[_0x4bcb('0x31')](_0x166c08[_0x4bcb('0x32')],{'IntervalId':_0x12ad6d[_0x4bcb('0x4')]}),_0x4bcb('0x2e')):[];if(_0x12ad6d[_0x4bcb('0xc')](_0x4bcb('0x33'))){if(_0x12ad6d[_0x4bcb('0x33')]&&_0x12ad6d[_0x4bcb('0x33')]!=='--'){_0x44f9c3[_0x4bcb('0x11')]({'type':_0x12ad6d[_0x4bcb('0x15')],'app':_0x4bcb('0x12'),'appdata':_0x4bcb('0x34')+_0x12ad6d[_0x4bcb('0x33')],'context':_0x12ad6d[_0x4bcb('0x16')],'exten':_0x12ad6d[_0x4bcb('0x9')],'priority':_0x5e00eb['length']+_0x166c08[_0x4bcb('0xd')]+_0x15ace4++,'VoiceExtensionId':_0x12ad6d[_0x4bcb('0x17')]});}}if(_0x12ad6d[_0x4bcb('0x15')]===_0x4bcb('0x1a')&&_0x12ad6d[_0x4bcb('0xc')]('callerID')){if(_0x12ad6d['callerID']){_0x44f9c3[_0x4bcb('0x11')]({'type':_0x12ad6d[_0x4bcb('0x15')],'app':'ExecIf','appdata':_0x4bcb('0x35')+_0x12ad6d['callerID']+')','context':_0x12ad6d['context'],'exten':_0x12ad6d['exten'],'priority':_0x5e00eb[_0x4bcb('0x36')]+_0x166c08[_0x4bcb('0xd')]+_0x15ace4++,'VoiceExtensionId':_0x12ad6d[_0x4bcb('0x17')]});}else{_0x44f9c3['push']({'type':_0x12ad6d[_0x4bcb('0x15')],'app':_0x4bcb('0x1f'),'appdata':_0x4bcb('0x37'),'context':_0x12ad6d[_0x4bcb('0x16')],'exten':_0x12ad6d['exten'],'priority':_0x5e00eb[_0x4bcb('0x36')]+_0x166c08[_0x4bcb('0xd')]+_0x15ace4++,'VoiceExtensionId':_0x12ad6d[_0x4bcb('0x17')]});}}if(_0x12ad6d['hasOwnProperty'](_0x4bcb('0x38'))){if(_0x5691f8['indexOf'](_0x12ad6d[_0x4bcb('0x39')][_0x4bcb('0x2c')]())>=0x0&&_0x12ad6d[_0x4bcb('0x3a')]!==_0x4bcb('0x3b')){if(_0x12ad6d['answer']){_0x44f9c3[_0x4bcb('0x11')]({'type':_0x12ad6d[_0x4bcb('0x15')],'app':_0x4bcb('0x1f'),'appdata':_0x4bcb('0x3c'),'context':_0x12ad6d[_0x4bcb('0x16')],'exten':_0x12ad6d[_0x4bcb('0x9')],'priority':_0x5e00eb['length']+_0x166c08['priority']+_0x15ace4++,'VoiceExtensionId':_0x12ad6d[_0x4bcb('0x17')]});_0x44f9c3[_0x4bcb('0x11')]({'type':_0x12ad6d[_0x4bcb('0x15')],'app':_0x4bcb('0x12'),'appdata':_0x4bcb('0x3d'),'context':_0x12ad6d[_0x4bcb('0x16')],'exten':_0x12ad6d['exten'],'priority':_0x5e00eb[_0x4bcb('0x36')]+_0x166c08[_0x4bcb('0xd')]+_0x15ace4++,'VoiceExtensionId':_0x12ad6d[_0x4bcb('0x17')]});}else{_0x44f9c3['push']({'type':_0x12ad6d[_0x4bcb('0x15')],'app':_0x4bcb('0x1f'),'appdata':_0x4bcb('0x3e'),'context':_0x12ad6d['context'],'exten':_0x12ad6d[_0x4bcb('0x9')],'priority':_0x5e00eb[_0x4bcb('0x36')]+_0x166c08['priority']+_0x15ace4++,'VoiceExtensionId':_0x12ad6d['VoiceExtensionId']});_0x44f9c3[_0x4bcb('0x11')]({'type':_0x12ad6d[_0x4bcb('0x15')],'app':_0x4bcb('0x12'),'appdata':_0x4bcb('0x3f'),'context':_0x12ad6d[_0x4bcb('0x16')],'exten':_0x12ad6d[_0x4bcb('0x9')],'priority':_0x5e00eb[_0x4bcb('0x36')]+_0x166c08[_0x4bcb('0xd')]+_0x15ace4++,'VoiceExtensionId':_0x12ad6d['VoiceExtensionId']});}}}for(var _0x28c11e=0x0;_0x28c11e<_0x5e00eb[_0x4bcb('0x36')];_0x28c11e+=0x1){var _0x24c5ca=_0x166c08[_0x4bcb('0xd')]+_0x5e00eb[_0x4bcb('0x36')];var _0x4fceb3=_0x28c11e===_0x5e00eb[_0x4bcb('0x36')]-0x1?_0x166c08[_0x4bcb('0xd')]+_0x44f9c3[_0x4bcb('0x36')]+_0x57241c[_0x4bcb('0x36')]+0x2:_0x166c08[_0x4bcb('0xd')]+_0x28c11e+0x1;_0x44f9c3[_0x4bcb('0x40')](_0x28c11e,0x0,{'type':_0x12ad6d['type'],'app':'GotoIfTime','appdata':_0x5e00eb[_0x28c11e]+'?'+_0x12ad6d[_0x4bcb('0x16')]+_0x4bcb('0x41')+_0x24c5ca+':'+_0x12ad6d['context']+_0x4bcb('0x41')+_0x4fceb3,'exten':_0x12ad6d['exten'],'context':_0x12ad6d[_0x4bcb('0x16')],'priority':_0x166c08[_0x4bcb('0xd')]+_0x28c11e,'VoiceExtensionId':_0x2e92d7[_0x1f85aa][0x0]['VoiceExtensionId']});}_0x12ad6d[_0x4bcb('0xd')]=_0x44f9c3[_0x4bcb('0x36')]?_[_0x4bcb('0x42')](_0x44f9c3)[_0x4bcb('0xd')]+0x1:_0x166c08[_0x4bcb('0xd')];_0x166c08[_0x4bcb('0xd')]=(_0x57241c[_0x4bcb('0x36')]?_['last'](_0x57241c)[_0x4bcb('0xd')]:_0x12ad6d['priority'])+0x1;_0x166c08[_0x4bcb('0xe')]=_[_0x4bcb('0x43')](_0x166c08[_0x4bcb('0xe')],_0x44f9c3,[_0x12ad6d],_0x57241c);}_0x166c08[_0x4bcb('0xe')]['push']({'type':_0x2e92d7[_0x1f85aa][0x0]['type'],'app':_0x4bcb('0x44'),'exten':_0x2e92d7[_0x1f85aa][0x0][_0x4bcb('0x9')],'context':_0x2e92d7[_0x1f85aa][0x0][_0x4bcb('0x16')],'priority':_0x166c08['priority'],'VoiceExtensionId':_0x2e92d7[_0x1f85aa][0x0][_0x4bcb('0x17')]});_0x2336f5[_0x4bcb('0x11')](_0x2e92d7[_0x1f85aa][0x0]['VoiceExtensionId']);_0x494ca1=_[_0x4bcb('0x43')](_0x494ca1,_0x166c08['extensions']);}}return _0xdb5237[_0x4bcb('0x45')](function(_0x46ead8){return _0xdb5237[_0x4bcb('0x0')][_0x4bcb('0x3')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x2336f5}},'transaction':_0x46ead8})[_0x4bcb('0x7')](function(_0x3df9c6){return _0xdb5237[_0x4bcb('0x0')][_0x4bcb('0x3')][_0x4bcb('0x46')](_[_0x4bcb('0x47')](_0x494ca1,'priority'),{'transaction':_0x46ead8});});});})[_0x4bcb('0x48')](function(_0x21909a){console['error'](_0x21909a);});}exports[_0x4bcb('0x49')]=rewrite; \ No newline at end of file +var _0x784f=['bulkCreate','catch','error','rewrite','lodash','Interval','findAll','then','intervals','models','VoiceExtension','map','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','exten','queue','playback','hasOwnProperty','priority','extensions','extension','find','push','type','Set','CDR(type)=%s','VoiceExtensionId','inbound','outbound','CDR(destination)=','${EXTEN:','${EXTEN}','context','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','cutdigits','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','length','toLowerCase','updatedAt','interval','IntervalId','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','last','concat','Hangup','destroy'];(function(_0x763f10,_0x377d9e){var _0x433a56=function(_0x12f5ca){while(--_0x12f5ca){_0x763f10['push'](_0x763f10['shift']());}};_0x433a56(++_0x377d9e);}(_0x784f,0x11c));var _0xf784=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x784f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf784('0x0'));var util=require('util');function rewrite(_0x4153bf,_0x8e9439){var _0x3406dd=this;return _0x4153bf['models'][_0xf784('0x1')][_0xf784('0x2')]({'raw':!![]})[_0xf784('0x3')](function(_0x4eee53){_0x3406dd[_0xf784('0x4')]=_0x4eee53;return _0x4153bf[_0xf784('0x5')][_0xf784('0x6')]['findAll']({'where':{'IntervalId':_0x8e9439['IntervalId']},'raw':!![]});})[_0xf784('0x3')](function(_0x3e4884){return _0x4153bf[_0xf784('0x5')][_0xf784('0x6')][_0xf784('0x2')]({'where':{'exten':{'$in':_['uniq'](_[_0xf784('0x7')](_0x3e4884,'exten'))}},'order':[{'raw':_0xf784('0x8')}],'raw':!![]});})[_0xf784('0x3')](function(_0x33d1a5){var _0x370054=_[_0xf784('0x9')](_0x33d1a5,{'priority':'1'});var _0x515b33=_[_0xf784('0x9')](_0x33d1a5,{'isApp':0x1});var _0x233bff=_[_0xf784('0xa')](_0x515b33,_0xf784('0xb'));var _0x58edc6=[_0xf784('0xc'),_0xf784('0xd')];var _0x22bb41=[];var _0xd89d05=[];for(var _0x27dd74 in _0x233bff){if(_0x233bff[_0xf784('0xe')](_0x27dd74)){_0x3406dd[_0xf784('0xf')]=0x2;_0x3406dd[_0xf784('0x10')]=[];_0x3406dd[_0xf784('0x11')]=_[_0xf784('0x12')](_0x370054,{'exten':_0x233bff[_0x27dd74][0x0]['exten']});_0x3406dd['extensions'][_0xf784('0x13')]({'type':_0x233bff[_0x27dd74][0x0][_0xf784('0x14')],'app':_0xf784('0x15'),'appdata':util['format'](_0xf784('0x16'),_0x233bff[_0x27dd74][0x0]['type']),'context':_0x233bff[_0x27dd74][0x0]['context'],'exten':_0x233bff[_0x27dd74][0x0][_0xf784('0xb')],'priority':_0x3406dd[_0xf784('0xf')]++,'VoiceExtensionId':_0x233bff[_0x27dd74][0x0][_0xf784('0x17')]});if(_0x233bff[_0x27dd74][0x0][_0xf784('0x14')]===_0xf784('0x18')){_0x3406dd[_0xf784('0x10')]['push']({'type':_0x233bff[_0x27dd74][0x0][_0xf784('0x14')],'app':_0xf784('0x15'),'appdata':'CDR(routeid)='+_0x233bff[_0x27dd74][0x0][_0xf784('0x17')],'context':_0x233bff[_0x27dd74][0x0]['context'],'exten':_0x233bff[_0x27dd74][0x0][_0xf784('0xb')],'priority':_0x3406dd[_0xf784('0xf')]++,'VoiceExtensionId':_0x233bff[_0x27dd74][0x0][_0xf784('0x17')]});}else if(_0x233bff[_0x27dd74][0x0]['type']===_0xf784('0x19')){if(_0x3406dd['extension']){_0x3406dd['extensions'][_0xf784('0x13')]({'type':_0x233bff[_0x27dd74][0x0][_0xf784('0x14')],'app':_0xf784('0x15'),'appdata':_0xf784('0x1a')+(_0x3406dd[_0xf784('0x11')]['cutdigits']?_0xf784('0x1b')+_0x3406dd['extension']['cutdigits']+'}':_0xf784('0x1c')),'context':_0x233bff[_0x27dd74][0x0][_0xf784('0x1d')],'exten':_0x233bff[_0x27dd74][0x0][_0xf784('0xb')],'priority':_0x3406dd[_0xf784('0xf')]++,'VoiceExtensionId':_0x233bff[_0x27dd74][0x0][_0xf784('0x17')]});}_0x3406dd['extensions'][_0xf784('0x13')]({'type':_0x233bff[_0x27dd74][0x0]['type'],'app':_0xf784('0x15'),'appdata':_0xf784('0x1e')+_0x233bff[_0x27dd74][0x0][_0xf784('0x17')],'context':_0x233bff[_0x27dd74][0x0]['context'],'exten':_0x233bff[_0x27dd74][0x0][_0xf784('0xb')],'priority':_0x3406dd[_0xf784('0xf')]++,'VoiceExtensionId':_0x233bff[_0x27dd74][0x0]['VoiceExtensionId']});var _0x3318a3=_0x3406dd[_0xf784('0xf')]++;_0x3406dd[_0xf784('0x10')][_0xf784('0x13')]({'type':_0x233bff[_0x27dd74][0x0][_0xf784('0x14')],'app':_0xf784('0x1f'),'appdata':_0xf784('0x20')+(_0x3318a3+0x2)+_0xf784('0x21')+(_0x3318a3+0x1)+')','context':_0x233bff[_0x27dd74][0x0][_0xf784('0x1d')],'exten':_0x233bff[_0x27dd74][0x0][_0xf784('0xb')],'priority':_0x3318a3,'VoiceExtensionId':_0x233bff[_0x27dd74][0x0][_0xf784('0x17')]});if(_0x3406dd[_0xf784('0x11')]){_0x3406dd['extensions']['push']({'type':_0x233bff[_0x27dd74][0x0][_0xf784('0x14')],'app':_0xf784('0x15'),'appdata':_0x3406dd['extension']['cutdigits']?'CDR(prefix)=${EXTEN:0:'+_0x3406dd['extension'][_0xf784('0x22')]+'}':_0xf784('0x23'),'context':_0x233bff[_0x27dd74][0x0][_0xf784('0x1d')],'exten':_0x233bff[_0x27dd74][0x0][_0xf784('0xb')],'priority':_0x3406dd[_0xf784('0xf')]++,'VoiceExtensionId':_0x233bff[_0x27dd74][0x0]['VoiceExtensionId']});}_0x3406dd[_0xf784('0x10')][_0xf784('0x13')]({'type':_0x233bff[_0x27dd74][0x0]['type'],'app':'Set','appdata':_0xf784('0x24')+_0x233bff[_0x27dd74][0x0][_0xf784('0x17')],'context':_0x233bff[_0x27dd74][0x0]['context'],'exten':_0x233bff[_0x27dd74][0x0][_0xf784('0xb')],'priority':_0x3406dd[_0xf784('0xf')]++,'VoiceExtensionId':_0x233bff[_0x27dd74][0x0]['VoiceExtensionId']});if(_0x3406dd[_0xf784('0x11')]&&_0x3406dd[_0xf784('0x11')][_0xf784('0xe')](_0xf784('0x25'))&&_0x3406dd[_0xf784('0x11')][_0xf784('0x25')]!==_0xf784('0x26')){_0x3406dd[_0xf784('0x10')]['push']({'type':_0x233bff[_0x27dd74][0x0]['type'],'app':_0xf784('0x15'),'appdata':_0xf784('0x27'),'context':_0x233bff[_0x27dd74][0x0][_0xf784('0x1d')],'exten':_0x233bff[_0x27dd74][0x0]['exten'],'priority':_0x3406dd[_0xf784('0xf')]++,'VoiceExtensionId':_0x233bff[_0x27dd74][0x0][_0xf784('0x17')]});_0x3406dd['extensions'][_0xf784('0x13')]({'type':_0x233bff[_0x27dd74][0x0][_0xf784('0x14')],'app':'Set','appdata':_0xf784('0x28')+_0x3406dd[_0xf784('0x11')]['recordingFormat']||'wav','context':_0x233bff[_0x27dd74][0x0]['context'],'exten':_0x233bff[_0x27dd74][0x0]['exten'],'priority':_0x3406dd[_0xf784('0xf')]++,'VoiceExtensionId':_0x233bff[_0x27dd74][0x0][_0xf784('0x17')]});}}_0x3406dd['extensions']['push']({'type':_0x233bff[_0x27dd74][0x0]['type'],'app':_0xf784('0x15'),'appdata':_0xf784('0x29'),'context':_0x233bff[_0x27dd74][0x0][_0xf784('0x1d')],'exten':_0x233bff[_0x27dd74][0x0][_0xf784('0xb')],'priority':_0x3406dd['priority']++,'VoiceExtensionId':_0x233bff[_0x27dd74][0x0][_0xf784('0x17')]});_0x3406dd[_0xf784('0x10')][_0xf784('0x13')]({'type':_0x233bff[_0x27dd74][0x0][_0xf784('0x14')],'app':_0xf784('0x15'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x233bff[_0x27dd74][0x0]['context'],'exten':_0x233bff[_0x27dd74][0x0]['exten'],'priority':_0x3406dd[_0xf784('0xf')]++,'VoiceExtensionId':_0x233bff[_0x27dd74][0x0][_0xf784('0x17')]});_0x3406dd['extensions'][_0xf784('0x13')]({'type':_0x233bff[_0x27dd74][0x0]['type'],'app':_0xf784('0x15'),'appdata':_0xf784('0x2a'),'context':_0x233bff[_0x27dd74][0x0]['context'],'exten':_0x233bff[_0x27dd74][0x0][_0xf784('0xb')],'priority':_0x3406dd[_0xf784('0xf')]++,'VoiceExtensionId':_0x233bff[_0x27dd74][0x0][_0xf784('0x17')]});for(var _0x3fe8f3=0x0,_0x574ae7=0x0;_0x3fe8f3<_0x233bff[_0x27dd74][_0xf784('0x2b')];_0x3fe8f3+=0x1,_0x574ae7=0x0){var _0xb402cb=_0x233bff[_0x27dd74][_0x3fe8f3];if(_0xb402cb[_0xf784('0x14')]){_0xb402cb[_0xf784('0x14')]=_0xb402cb[_0xf784('0x14')][_0xf784('0x2c')]();}var _0x3dc369=[];var _0x1fbd35=[];delete _0xb402cb['id'];delete _0xb402cb['createdAt'];delete _0xb402cb[_0xf784('0x2d')];var _0x58448e=_0xb402cb[_0xf784('0x2e')]!=='*,*,*,*'?[_0xb402cb[_0xf784('0x2e')]]:_0xb402cb[_0xf784('0x2f')]?_[_0xf784('0x7')](_[_0xf784('0x9')](_0x3406dd[_0xf784('0x4')],{'IntervalId':_0xb402cb[_0xf784('0x2f')]}),_0xf784('0x2e')):[];if(_0xb402cb[_0xf784('0xe')](_0xf784('0x30'))){if(_0xb402cb[_0xf784('0x30')]&&_0xb402cb[_0xf784('0x30')]!=='--'){_0x3dc369[_0xf784('0x13')]({'type':_0xb402cb[_0xf784('0x14')],'app':_0xf784('0x15'),'appdata':_0xf784('0x31')+_0xb402cb[_0xf784('0x30')],'context':_0xb402cb[_0xf784('0x1d')],'exten':_0xb402cb['exten'],'priority':_0x58448e[_0xf784('0x2b')]+_0x3406dd['priority']+_0x574ae7++,'VoiceExtensionId':_0xb402cb[_0xf784('0x17')]});}}if(_0xb402cb[_0xf784('0x14')]===_0xf784('0x19')&&_0xb402cb[_0xf784('0xe')]('callerID')){if(_0xb402cb[_0xf784('0x32')]){_0x3dc369['push']({'type':_0xb402cb[_0xf784('0x14')],'app':_0xf784('0x1f'),'appdata':_0xf784('0x33')+_0xb402cb[_0xf784('0x32')]+')','context':_0xb402cb[_0xf784('0x1d')],'exten':_0xb402cb[_0xf784('0xb')],'priority':_0x58448e[_0xf784('0x2b')]+_0x3406dd['priority']+_0x574ae7++,'VoiceExtensionId':_0xb402cb[_0xf784('0x17')]});}else{_0x3dc369[_0xf784('0x13')]({'type':_0xb402cb[_0xf784('0x14')],'app':_0xf784('0x1f'),'appdata':_0xf784('0x34'),'context':_0xb402cb[_0xf784('0x1d')],'exten':_0xb402cb[_0xf784('0xb')],'priority':_0x58448e[_0xf784('0x2b')]+_0x3406dd[_0xf784('0xf')]+_0x574ae7++,'VoiceExtensionId':_0xb402cb[_0xf784('0x17')]});}}if(_0xb402cb[_0xf784('0xe')](_0xf784('0x35'))){if(_0x58edc6[_0xf784('0x36')](_0xb402cb[_0xf784('0x37')]['toLowerCase']())>=0x0&&_0xb402cb['appType']!==_0xf784('0x38')){if(_0xb402cb['answer']){_0x3dc369[_0xf784('0x13')]({'type':_0xb402cb[_0xf784('0x14')],'app':_0xf784('0x1f'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0xb402cb[_0xf784('0x1d')],'exten':_0xb402cb['exten'],'priority':_0x58448e[_0xf784('0x2b')]+_0x3406dd[_0xf784('0xf')]+_0x574ae7++,'VoiceExtensionId':_0xb402cb[_0xf784('0x17')]});_0x3dc369['push']({'type':_0xb402cb[_0xf784('0x14')],'app':_0xf784('0x15'),'appdata':_0xf784('0x39'),'context':_0xb402cb[_0xf784('0x1d')],'exten':_0xb402cb[_0xf784('0xb')],'priority':_0x58448e[_0xf784('0x2b')]+_0x3406dd[_0xf784('0xf')]+_0x574ae7++,'VoiceExtensionId':_0xb402cb[_0xf784('0x17')]});}else{_0x3dc369[_0xf784('0x13')]({'type':_0xb402cb[_0xf784('0x14')],'app':_0xf784('0x1f'),'appdata':_0xf784('0x3a'),'context':_0xb402cb[_0xf784('0x1d')],'exten':_0xb402cb[_0xf784('0xb')],'priority':_0x58448e[_0xf784('0x2b')]+_0x3406dd[_0xf784('0xf')]+_0x574ae7++,'VoiceExtensionId':_0xb402cb['VoiceExtensionId']});_0x3dc369[_0xf784('0x13')]({'type':_0xb402cb[_0xf784('0x14')],'app':_0xf784('0x15'),'appdata':_0xf784('0x3b'),'context':_0xb402cb[_0xf784('0x1d')],'exten':_0xb402cb[_0xf784('0xb')],'priority':_0x58448e[_0xf784('0x2b')]+_0x3406dd[_0xf784('0xf')]+_0x574ae7++,'VoiceExtensionId':_0xb402cb[_0xf784('0x17')]});}}}for(var _0x509c78=0x0;_0x509c78<_0x58448e[_0xf784('0x2b')];_0x509c78+=0x1){var _0x217279=_0x3406dd[_0xf784('0xf')]+_0x58448e['length'];var _0x2088de=_0x509c78===_0x58448e['length']-0x1?_0x3406dd[_0xf784('0xf')]+_0x3dc369[_0xf784('0x2b')]+_0x1fbd35['length']+0x2:_0x3406dd[_0xf784('0xf')]+_0x509c78+0x1;_0x3dc369[_0xf784('0x3c')](_0x509c78,0x0,{'type':_0xb402cb[_0xf784('0x14')],'app':'GotoIfTime','appdata':_0x58448e[_0x509c78]+'?'+_0xb402cb[_0xf784('0x1d')]+_0xf784('0x3d')+_0x217279+':'+_0xb402cb[_0xf784('0x1d')]+',${EXTEN},'+_0x2088de,'exten':_0xb402cb[_0xf784('0xb')],'context':_0xb402cb['context'],'priority':_0x3406dd['priority']+_0x509c78,'VoiceExtensionId':_0x233bff[_0x27dd74][0x0][_0xf784('0x17')]});}_0xb402cb['priority']=_0x3dc369['length']?_['last'](_0x3dc369)[_0xf784('0xf')]+0x1:_0x3406dd[_0xf784('0xf')];_0x3406dd[_0xf784('0xf')]=(_0x1fbd35['length']?_[_0xf784('0x3e')](_0x1fbd35)[_0xf784('0xf')]:_0xb402cb[_0xf784('0xf')])+0x1;_0x3406dd[_0xf784('0x10')]=_[_0xf784('0x3f')](_0x3406dd[_0xf784('0x10')],_0x3dc369,[_0xb402cb],_0x1fbd35);}_0x3406dd[_0xf784('0x10')][_0xf784('0x13')]({'type':_0x233bff[_0x27dd74][0x0][_0xf784('0x14')],'app':_0xf784('0x40'),'exten':_0x233bff[_0x27dd74][0x0]['exten'],'context':_0x233bff[_0x27dd74][0x0]['context'],'priority':_0x3406dd['priority'],'VoiceExtensionId':_0x233bff[_0x27dd74][0x0][_0xf784('0x17')]});_0x22bb41['push'](_0x233bff[_0x27dd74][0x0][_0xf784('0x17')]);_0xd89d05=_[_0xf784('0x3f')](_0xd89d05,_0x3406dd['extensions']);}}return _0x4153bf['transaction'](function(_0x589d29){return _0x4153bf[_0xf784('0x5')][_0xf784('0x6')][_0xf784('0x41')]({'where':{'VoiceExtensionId':{'$in':_0x22bb41}},'transaction':_0x589d29})[_0xf784('0x3')](function(_0x61413){return _0x4153bf[_0xf784('0x5')][_0xf784('0x6')][_0xf784('0x42')](_['sortBy'](_0xd89d05,_0xf784('0xf')),{'transaction':_0x589d29});});});})[_0xf784('0x43')](function(_0x23c1a8){console[_0xf784('0x44')](_0x23c1a8);});}exports[_0xf784('0x45')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 978dde2..eead22f 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 _0xcd91=['insert','cm_hopper_black','VoiceQueue','findAll','dialCheckDuplicateType','CmList','Lists','get','always','push','sequelize','query','VoiceQueueId','onlyIfOpen','BlackLists','all','Campaign','CampaignId','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resolve','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','CSV\x20import\x20process\x20stopped!','createReadStream','parse','pause','info','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','squel','ioredis','../../../mysqldb','../../../config/environment','api','defaults','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','test','isNil','errors','length','map','message','join','hasOwnProperty','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','CmContact','create','keys','then','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','into','cm_hopper','fromQuery','scheduledAt','createdAt','select','field','NOW()','ContactId','toString','updatedAt','from','cm_contacts','deletedAt\x20IS\x20NULL','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','\x20=\x20?','id\x20IN\x20?','str','calleridnum'];(function(_0x154192,_0x2d360f){var _0x3c2792=function(_0x2e257b){while(--_0x2e257b){_0x154192['push'](_0x154192['shift']());}};_0x3c2792(++_0x2d360f);}(_0xcd91,0x167));var _0x1cd9=function(_0x6e5e34,_0x2c5142){_0x6e5e34=_0x6e5e34-0x0;var _0x3167a9=_0xcd91[_0x6e5e34];return _0x3167a9;};'use strict';var BPromise=require(_0x1cd9('0x0'));var util=require('util');var _=require('lodash');var fs=require('fs');var squel=require(_0x1cd9('0x1'));var Papa=require('papaparse');var Redis=require(_0x1cd9('0x2'));var db=require(_0x1cd9('0x3'))['db'];var config=require(_0x1cd9('0x4'));var logger=require('../../../config/logger')(_0x1cd9('0x5'));config['redis']=_[_0x1cd9('0x6')](config[_0x1cd9('0x7')],{'host':_0x1cd9('0x8'),'port':0x18eb});var socket=require(_0x1cd9('0x9'))(new Redis(config[_0x1cd9('0x7')]));require(_0x1cd9('0xa'))[_0x1cd9('0xb')](socket);try{if(!process[_0x1cd9('0xc')][0x2]||process[_0x1cd9('0xc')][0x2]===_0x1cd9('0xd')||process[_0x1cd9('0xc')][0x2]===_0x1cd9('0xe')){throw new Error(_0x1cd9('0xf'));}var FILEPATH=process[_0x1cd9('0xc')][0x2];if(!process['argv'][0x3]||process[_0x1cd9('0xc')][0x3]==='undefined'||process[_0x1cd9('0xc')][0x3]===_0x1cd9('0xe')||!process[_0x1cd9('0xc')][0x4]||process[_0x1cd9('0xc')][0x4]===_0x1cd9('0xd')||process[_0x1cd9('0xc')][0x4]===_0x1cd9('0xe')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0x1cd9('0x10')](process[_0x1cd9('0xc')][0x3][_0x1cd9('0x11')](','),process[_0x1cd9('0xc')][0x4][_0x1cd9('0x11')](','));if(!process[_0x1cd9('0xc')][0x5]||process[_0x1cd9('0xc')][0x5]===_0x1cd9('0xd')||process['argv'][0x5]===_0x1cd9('0xe')){throw new Error(_0x1cd9('0x12'));}var LISTID=process[_0x1cd9('0xc')][0x5];var COMPANYID=process[_0x1cd9('0xc')][0x6]&&process[_0x1cd9('0xc')][0x6]!==_0x1cd9('0xd')&&process[_0x1cd9('0xc')][0x6]!==_0x1cd9('0xe')?process[_0x1cd9('0xc')][0x6]:null;var DUPLICATES=process[_0x1cd9('0xc')][0x7]&&process[_0x1cd9('0xc')][0x7]!=='undefined'&&process[_0x1cd9('0xc')][0x7]!=='null'?process[_0x1cd9('0xc')][0x7]:null;if(!process['argv'][0x8]||process[_0x1cd9('0xc')][0x8]===_0x1cd9('0xd')||process[_0x1cd9('0xc')][0x8]==='null'){throw new Error(_0x1cd9('0x13'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x454019){logger[_0x1cd9('0x14')](_0x454019);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(_0x2c43fa,_0x2b18f5,_0x4f858a,_0x3b4d89){var _0x267910={'message':_0x2b18f5};_0x267910[_0x2c43fa]=!![];if(_0x4f858a){_0x267910[_0x1cd9('0x15')]=_0x4f858a;}if(_0x3b4d89){_0x267910['index']=_0x3b4d89;}return _0x267910;}function isEmail(_0x1abbbd){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))*$/[_0x1cd9('0x16')](_0x1abbbd);}function checkRow(_0x1921d5,_0xbe5606,_0x53ed58){return new BPromise(function(_0x58dba2,_0x446568){if(_[_0x1cd9('0x17')](_0x1921d5)){return _0x446568(handleCheckRowError(_0x1cd9('0x14'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x53ed58));}if(_0x1921d5[_0x1cd9('0x18')]&&_0x1921d5[_0x1cd9('0x18')][_0x1cd9('0x19')]){var _0x3c8d42=_[_0x1cd9('0x1a')](_0x1921d5['errors'],_0x1cd9('0x1b'))[_0x1cd9('0x1c')](';');return _0x446568(handleCheckRowError(_0x1cd9('0x14'),_0x3c8d42,null,_0x53ed58));}var _0x1e33ff={};for(var _0x4448f9 in FIELDS){if(FIELDS[_0x1cd9('0x1d')](_0x4448f9)&&FIELDS[_0x4448f9]){_0x1e33ff[_0x4448f9]=_0x1921d5['data'][0x0][FIELDS[_0x4448f9]]||_0x1921d5['data'][0x0]['\ufeff'+FIELDS[_0x4448f9]];}}if(!_0x1e33ff[_0x1cd9('0x1e')]){return _0x446568(handleCheckRowError(_0x1cd9('0x14'),_0x1cd9('0x1f'),null,_0x53ed58));}if(!_0x1e33ff[_0x1cd9('0x20')]){return _0x446568(handleCheckRowError(_0x1cd9('0x14'),_0x1cd9('0x21'),null,_0x53ed58));}if(_0x1e33ff[_0x1cd9('0x22')]){var _0x469e6f=moment(_0x1e33ff[_0x1cd9('0x22')],_0x1cd9('0x23'));if(!_0x469e6f['isValid']()){return _0x446568(handleCheckRowError(_0x1cd9('0x14'),_0x1cd9('0x24'),null,_0x53ed58));}}if(_0x1e33ff['email']){if(!isEmail(_0x1e33ff['email'])){return _0x446568(handleCheckRowError('error',_0x1cd9('0x25'),null,_0x53ed58));}}_0x1e33ff[_0x1cd9('0x26')]=LISTID;_0x1e33ff[_0x1cd9('0x27')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x1cd9('0x19')]&&_0xbe5606){var _0x32f6ab={};for(var _0x3108cd=0x0,_0x49f794=DUPLICATES[_0x1cd9('0x19')];_0x3108cd<_0x49f794;_0x3108cd+=0x1){_0x32f6ab[DUPLICATES[_0x3108cd]]=_0x1e33ff[DUPLICATES[_0x3108cd]];}var _0x5a503f=_[_0x1cd9('0x28')](_0xbe5606,_0x32f6ab);if(_0x5a503f){return _0x446568(handleCheckRowError(_0x1cd9('0x29'),'Duplicate\x20Contact',_0x5a503f,_0x53ed58));}}return db[_0x1cd9('0x2a')][_0x1cd9('0x2b')](_0x1e33ff,{'raw':!![],'hooks':![],'fields':_[_0x1cd9('0x2c')](_0x1e33ff)})[_0x1cd9('0x2d')](function(_0x183ad4){if(DUPLICATES&&DUPLICATES[_0x1cd9('0x19')]&&_0xbe5606){_0xbe5606['push'](_['pick'](_0x1e33ff,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x183ad4['id'];return _0x58dba2();})[_0x1cd9('0x2e')](function(_0x1f423e){return _0x446568(handleCheckRowError(_0x1cd9('0x14'),_0x1cd9('0x2f')+(_0x1f423e[_0x1cd9('0x1b')]||JSON[_0x1cd9('0x30')](_0x1f423e)),null,_0x53ed58));});});}function checkHopper(){function _0x3e1cd1(){return function(_0x340324){logger[_0x1cd9('0x14')](_0x1cd9('0x31'),_0x1cd9('0x32'),util[_0x1cd9('0x33')](_0x340324,{'showHidden':![],'depth':null}));};}var _0x49a2cf=function(_0x4cb6ca,_0x86f6a4){var _0x296e0d=squel['insert']()[_0x1cd9('0x34')](_0x1cd9('0x35'))[_0x1cd9('0x36')]([_0x1cd9('0x20'),_0x1cd9('0x37'),'ContactId','ListId',_0x86f6a4,_0x1cd9('0x38'),'updatedAt'],squel[_0x1cd9('0x39')]()[_0x1cd9('0x3a')](_0x1cd9('0x20'),_0x1cd9('0x20'))[_0x1cd9('0x3a')](_0x1cd9('0x3b'),_0x1cd9('0x37'))[_0x1cd9('0x3a')]('id',_0x1cd9('0x3c'))[_0x1cd9('0x3a')](LISTID[_0x1cd9('0x3d')](),_0x1cd9('0x26'))[_0x1cd9('0x3a')](_0x4cb6ca['id']['toString'](),_0x86f6a4)[_0x1cd9('0x3a')](_0x1cd9('0x3b'),_0x1cd9('0x38'))['field']('NOW()',_0x1cd9('0x3e'))[_0x1cd9('0x3f')](_0x1cd9('0x40'))['where'](_0x1cd9('0x41'))[_0x1cd9('0x42')](_0x1cd9('0x43'),LISTID[_0x1cd9('0x3d')]())[_0x1cd9('0x42')](_0x1cd9('0x44'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x1cd9('0x39')]()[_0x1cd9('0x3a')]('phone')[_0x1cd9('0x3f')]('cm_hopper')[_0x1cd9('0x42')](_0x86f6a4+_0x1cd9('0x45'),_0x4cb6ca['id'][_0x1cd9('0x3d')]())))[_0x1cd9('0x3d')]();return _0x296e0d;};var _0x3c168f=function(_0x254fb1,_0x39cbf6){var _0x512390=squel['insert']()[_0x1cd9('0x34')](_0x1cd9('0x35'))[_0x1cd9('0x36')]([_0x1cd9('0x20'),'scheduledAt',_0x1cd9('0x3c'),_0x1cd9('0x26'),_0x39cbf6,_0x1cd9('0x38'),_0x1cd9('0x3e')],squel[_0x1cd9('0x39')]()[_0x1cd9('0x3a')](_0x1cd9('0x20'),'phone')[_0x1cd9('0x3a')](_0x1cd9('0x3b'),'scheduledAt')[_0x1cd9('0x3a')]('id',_0x1cd9('0x3c'))[_0x1cd9('0x3a')](LISTID[_0x1cd9('0x3d')](),_0x1cd9('0x26'))[_0x1cd9('0x3a')](_0x254fb1['id']['toString'](),_0x39cbf6)['field'](_0x1cd9('0x3b'),_0x1cd9('0x38'))[_0x1cd9('0x3a')](_0x1cd9('0x3b'),'updatedAt')[_0x1cd9('0x3f')](_0x1cd9('0x40'))[_0x1cd9('0x42')](_0x1cd9('0x41'))['where'](_0x1cd9('0x43'),LISTID[_0x1cd9('0x3d')]())[_0x1cd9('0x42')](_0x1cd9('0x46'),squel[_0x1cd9('0x47')](hopperContacts))[_0x1cd9('0x42')](_0x1cd9('0x44'))[_0x1cd9('0x42')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x1cd9('0x3a')](_0x1cd9('0x48'))['from']('cm_hopper_final')[_0x1cd9('0x42')](_0x39cbf6+'\x20=\x20?',_0x254fb1['id']['toString']()))[_0x1cd9('0x42')]('phone\x20NOT\x20IN\x20(?)',squel[_0x1cd9('0x39')]()[_0x1cd9('0x3a')](_0x1cd9('0x20'))[_0x1cd9('0x3f')](_0x1cd9('0x35'))[_0x1cd9('0x42')](_0x39cbf6+_0x1cd9('0x45'),_0x254fb1['id'][_0x1cd9('0x3d')]())))[_0x1cd9('0x3d')]();return _0x512390;};function _0x428ac0(_0x531312,_0x205b69){var _0x28d846=squel['insert']()[_0x1cd9('0x34')](_0x1cd9('0x35'))[_0x1cd9('0x36')](['phone','scheduledAt',_0x1cd9('0x3c'),_0x1cd9('0x26'),_0x205b69,_0x1cd9('0x38'),'updatedAt'],squel[_0x1cd9('0x39')]()[_0x1cd9('0x3a')](_0x1cd9('0x20'),'phone')['field'](_0x1cd9('0x3b'),_0x1cd9('0x37'))['field']('id',_0x1cd9('0x3c'))['field'](LISTID[_0x1cd9('0x3d')](),_0x1cd9('0x26'))[_0x1cd9('0x3a')](_0x531312['id']['toString'](),_0x205b69)[_0x1cd9('0x3a')](_0x1cd9('0x3b'),_0x1cd9('0x38'))[_0x1cd9('0x3a')](_0x1cd9('0x3b'),'updatedAt')[_0x1cd9('0x3f')](_0x1cd9('0x40'))[_0x1cd9('0x42')](_0x1cd9('0x41'))[_0x1cd9('0x42')](_0x1cd9('0x43'),LISTID[_0x1cd9('0x3d')]())[_0x1cd9('0x42')](_0x1cd9('0x46'),squel[_0x1cd9('0x47')](hopperContacts))[_0x1cd9('0x42')](_0x1cd9('0x44')))[_0x1cd9('0x3d')]();return _0x28d846;}function _0x647245(_0x5477ed,_0x54b998){var _0x57d392=squel[_0x1cd9('0x49')]()['into'](_0x1cd9('0x4a'))['fromQuery'](['phone',_0x1cd9('0x3c'),_0x1cd9('0x26'),_0x54b998,_0x1cd9('0x38'),'updatedAt'],squel['select']()['field'](_0x1cd9('0x20'),_0x1cd9('0x20'))[_0x1cd9('0x3a')]('id',_0x1cd9('0x3c'))[_0x1cd9('0x3a')](LISTID['toString'](),'ListId')[_0x1cd9('0x3a')](_0x5477ed['id'][_0x1cd9('0x3d')](),_0x54b998)[_0x1cd9('0x3a')](_0x1cd9('0x3b'),_0x1cd9('0x38'))[_0x1cd9('0x3a')](_0x1cd9('0x3b'),_0x1cd9('0x3e'))[_0x1cd9('0x3f')]('cm_contacts')[_0x1cd9('0x42')](_0x1cd9('0x41'))[_0x1cd9('0x42')](_0x1cd9('0x43'),LISTID['toString']())[_0x1cd9('0x42')](_0x1cd9('0x46'),squel[_0x1cd9('0x47')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0x1cd9('0x3d')]();return _0x57d392;}return db[_0x1cd9('0x4b')][_0x1cd9('0x4c')]({'where':{'type':'outbound'},'attributes':['id',_0x1cd9('0x4d')],'include':[{'model':db[_0x1cd9('0x4e')],'as':_0x1cd9('0x4f'),'where':{'id':LISTID}}]})[_0x1cd9('0x2d')](function(_0x142c7e){var _0x3f70bc=[];if(_0x142c7e){var _0x521d7b;for(var _0x3f2375=0x0,_0x3552c6;_0x3f2375<_0x142c7e[_0x1cd9('0x19')];_0x3f2375+=0x1){_0x3552c6=_0x142c7e[_0x3f2375][_0x1cd9('0x50')]({'plain':!![]});switch(_0x3552c6[_0x1cd9('0x4d')]){case _0x1cd9('0x51'):_0x3f70bc[_0x1cd9('0x52')](db[_0x1cd9('0x53')][_0x1cd9('0x54')](_0x3c168f(_0x3552c6,_0x1cd9('0x55')))[_0x1cd9('0x2d')](function(){})[_0x1cd9('0x2e')](_0x3e1cd1()));break;case _0x1cd9('0x56'):_0x3f70bc[_0x1cd9('0x52')](db[_0x1cd9('0x53')][_0x1cd9('0x54')](_0x49a2cf(_0x3552c6,_0x1cd9('0x55')))['then'](function(){})[_0x1cd9('0x2e')](_0x3e1cd1()));break;default:_0x3f70bc[_0x1cd9('0x52')](db[_0x1cd9('0x53')][_0x1cd9('0x54')](_0x428ac0(_0x3552c6,'VoiceQueueId'))[_0x1cd9('0x2d')](function(){})[_0x1cd9('0x2e')](_0x3e1cd1()));}}}return _0x3f70bc;})['all']()[_0x1cd9('0x2d')](function(){return db['VoiceQueue'][_0x1cd9('0x4c')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x1cd9('0x57'),'where':{'id':LISTID}}]})['then'](function(_0x19a0ea){var _0x4a01a7=[];if(_0x19a0ea){var _0x2baacd;for(var _0x532722=0x0,_0x393bd1;_0x532722<_0x19a0ea[_0x1cd9('0x19')];_0x532722+=0x1){_0x393bd1=_0x19a0ea[_0x532722][_0x1cd9('0x50')]({'plain':!![]});_0x4a01a7[_0x1cd9('0x52')](db['sequelize']['query'](_0x647245(_0x393bd1,'VoiceQueueId'))[_0x1cd9('0x2d')](function(){})['catch'](_0x3e1cd1()));}}return _0x4a01a7;})[_0x1cd9('0x58')]();})[_0x1cd9('0x2d')](function(){return db[_0x1cd9('0x59')]['findAll']({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db['CmList'],'as':'Lists','where':{'id':LISTID}}]})[_0x1cd9('0x2d')](function(_0x33f7fa){var _0x836844=[];if(_0x33f7fa){for(var _0x26ac12=0x0,_0x3dabf7;_0x26ac12<_0x33f7fa[_0x1cd9('0x19')];_0x26ac12+=0x1){_0x3dabf7=_0x33f7fa[_0x26ac12]['get']({'plain':!![]});switch(_0x3dabf7[_0x1cd9('0x4d')]){case _0x1cd9('0x51'):_0x836844[_0x1cd9('0x52')](db[_0x1cd9('0x53')][_0x1cd9('0x54')](_0x3c168f(_0x3dabf7,'CampaignId'))[_0x1cd9('0x2d')](function(){})[_0x1cd9('0x2e')](_0x3e1cd1()));break;case _0x1cd9('0x56'):_0x836844[_0x1cd9('0x52')](db[_0x1cd9('0x53')][_0x1cd9('0x54')](_0x49a2cf(_0x3dabf7,_0x1cd9('0x5a')))[_0x1cd9('0x2d')](function(){})[_0x1cd9('0x2e')](_0x3e1cd1()));break;default:_0x836844['push'](db[_0x1cd9('0x53')]['query'](_0x428ac0(_0x3dabf7,_0x1cd9('0x5a')))[_0x1cd9('0x2d')](function(){})[_0x1cd9('0x2e')](_0x3e1cd1()));}}}return _0x836844;})[_0x1cd9('0x58')]();})[_0x1cd9('0x2d')](function(){return db['Campaign'][_0x1cd9('0x4c')]({'attributes':['id'],'include':[{'model':db[_0x1cd9('0x4e')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x1cd9('0x2d')](function(_0x10d053){var _0x40c7ad=[];if(_0x10d053){for(var _0x2107c0=0x0,_0xda90df;_0x2107c0<_0x10d053[_0x1cd9('0x19')];_0x2107c0+=0x1){_0xda90df=_0x10d053[_0x2107c0][_0x1cd9('0x50')]({'plain':!![]});_0x40c7ad[_0x1cd9('0x52')](db[_0x1cd9('0x53')]['query'](_0x647245(_0xda90df,_0x1cd9('0x5a')))[_0x1cd9('0x2d')](function(){})[_0x1cd9('0x2e')](_0x3e1cd1()));}}return _0x40c7ad;})[_0x1cd9('0x58')]();})[_0x1cd9('0x2e')](function(_0x4b85a1){logger[_0x1cd9('0x14')]('cmContact,\x20%s,\x20%s',_0x1cd9('0x5b'),_0x4b85a1[_0x1cd9('0x1b')]);});}var processPromises=function(_0xcde10f){return BPromise['all'](promises)[_0x1cd9('0x2d')](function(_0x3b5065){})[_0x1cd9('0x2e')](function(_0x549b74){logger[_0x1cd9('0x14')](_0x1cd9('0x5c'),JSON[_0x1cd9('0x30')](_0x549b74));})[_0x1cd9('0x5d')](function(){socket[_0x1cd9('0x5e')](_0x1cd9('0x5f')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0xcde10f){return _0xcde10f['resume']();}});};var endCsv=function(){return BPromise[_0x1cd9('0x60')]()['then'](function(){if(hopperContacts){return checkHopper();}})[_0x1cd9('0x2d')](function(){socket['emit'](_0x1cd9('0x5f')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x3faaf3){logger[_0x1cd9('0x14')](_0x1cd9('0x61'),JSON['stringify'](_0x3faaf3));}finally{process[_0x1cd9('0x62')](0x0);}});};process['on'](_0x1cd9('0x63'),function(){logger['info'](_0x1cd9('0x64'));endCsv();});function main(){return BPromise['resolve']()[_0x1cd9('0x2d')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x1cd9('0x11')](',');return db['CmContact'][_0x1cd9('0x4c')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x1cd9('0x2d')](function(_0x3b57c8){var _0x28dde6=fs[_0x1cd9('0x65')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x1cd9('0x66')](_0x28dde6,{'header':!![],'skipEmptyLines':!![],'step':function(_0x5be004,_0xbab8e9){total+=0x1;var _0x3ae7b9=total;promises[_0x1cd9('0x52')](checkRow(_0x5be004,_0x3b57c8,_0x3ae7b9)['then'](function(){success+=0x1;})[_0x1cd9('0x2e')](function(_0x3efc15){if(_0x3efc15[_0x1cd9('0x14')]){errors+=0x1;delete _0x3efc15[_0x1cd9('0x14')];}else if(_0x3efc15[_0x1cd9('0x29')]){duplicates+=0x1;delete _0x3efc15['duplicate'];}rows[_0x1cd9('0x52')](_0x3efc15);}));if(total%0xc8===0x0){_0xbab8e9[_0x1cd9('0x67')]();return processPromises(_0xbab8e9);}},'complete':function(){return processPromises()[_0x1cd9('0x2d')](function(){logger[_0x1cd9('0x68')](_0x1cd9('0x69'));endCsv();});},'error':function(_0x4c5ab8,_0x44cac2){logger['info'](_0x1cd9('0x6a'),JSON[_0x1cd9('0x30')](_0x4c5ab8));endCsv();}});})[_0x1cd9('0x2e')](function(_0x9137dc){logger[_0x1cd9('0x14')](_0x1cd9('0x6b'),JSON[_0x1cd9('0x30')](_0x9137dc));});}main(); \ No newline at end of file +var _0x4235=['CmList','BlackLists','Campaign','Lists','always','CampaignId','all','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','contact:csv_','resume','resolve','emit','exit','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','socket.io-emitter','register','argv','undefined','null','Missing\x20binding\x20parameters!','zipObject','split','error','contact','index','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','map','message','hasOwnProperty','data','firstName','phone','phone\x20not\x20specified!','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','length','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','push','pick','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','insert','into','fromQuery','updatedAt','select','field','NOW()','ContactId','toString','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','cm_hopper','\x20=\x20?','createdAt','scheduledAt','str','phone\x20IS\x20NOT\x20NULL','calleridnum','id\x20IN\x20?','cm_hopper_black','findAll','outbound','dialCheckDuplicateType','get','sequelize','query','VoiceQueueId','onlyIfOpen','catch','VoiceQueue'];(function(_0x7c0074,_0x1ffdcf){var _0x13e95b=function(_0x521212){while(--_0x521212){_0x7c0074['push'](_0x7c0074['shift']());}};_0x13e95b(++_0x1ffdcf);}(_0x4235,0xef));var _0x5423=function(_0x31cc6e,_0x4da430){_0x31cc6e=_0x31cc6e-0x0;var _0x39a234=_0x4235[_0x31cc6e];return _0x39a234;};'use strict';var BPromise=require(_0x5423('0x0'));var util=require(_0x5423('0x1'));var _=require(_0x5423('0x2'));var fs=require('fs');var squel=require(_0x5423('0x3'));var Papa=require(_0x5423('0x4'));var Redis=require(_0x5423('0x5'));var db=require(_0x5423('0x6'))['db'];var config=require(_0x5423('0x7'));var logger=require(_0x5423('0x8'))(_0x5423('0x9'));config[_0x5423('0xa')]=_[_0x5423('0xb')](config[_0x5423('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x5423('0xc'))(new Redis(config[_0x5423('0xa')]));require('../../../api/cmContact/cmContact.socket')[_0x5423('0xd')](socket);try{if(!process['argv'][0x2]||process[_0x5423('0xe')][0x2]===_0x5423('0xf')||process['argv'][0x2]==='null'){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0x5423('0xe')][0x2];if(!process[_0x5423('0xe')][0x3]||process['argv'][0x3]==='undefined'||process[_0x5423('0xe')][0x3]==='null'||!process[_0x5423('0xe')][0x4]||process[_0x5423('0xe')][0x4]==='undefined'||process[_0x5423('0xe')][0x4]===_0x5423('0x10')){throw new Error(_0x5423('0x11'));}var FIELDS=_[_0x5423('0x12')](process['argv'][0x3][_0x5423('0x13')](','),process[_0x5423('0xe')][0x4]['split'](','));if(!process[_0x5423('0xe')][0x5]||process[_0x5423('0xe')][0x5]===_0x5423('0xf')||process[_0x5423('0xe')][0x5]===_0x5423('0x10')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x5423('0xe')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x5423('0xe')][0x6]!==_0x5423('0xf')&&process[_0x5423('0xe')][0x6]!==_0x5423('0x10')?process[_0x5423('0xe')][0x6]:null;var DUPLICATES=process[_0x5423('0xe')][0x7]&&process[_0x5423('0xe')][0x7]!==_0x5423('0xf')&&process[_0x5423('0xe')][0x7]!==_0x5423('0x10')?process[_0x5423('0xe')][0x7]:null;if(!process[_0x5423('0xe')][0x8]||process[_0x5423('0xe')][0x8]===_0x5423('0xf')||process[_0x5423('0xe')][0x8]===_0x5423('0x10')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x5423('0xe')][0x8];}catch(_0x56261a){logger[_0x5423('0x14')](_0x56261a);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(_0xfc9ea3,_0x439bbb,_0x39749d,_0x4d6208){var _0x65dbf6={'message':_0x439bbb};_0x65dbf6[_0xfc9ea3]=!![];if(_0x39749d){_0x65dbf6[_0x5423('0x15')]=_0x39749d;}if(_0x4d6208){_0x65dbf6[_0x5423('0x16')]=_0x4d6208;}return _0x65dbf6;}function isEmail(_0x4b56a1){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'](_0x4b56a1);}function checkRow(_0xfa2a82,_0x338c71,_0x102096){return new BPromise(function(_0x53c06a,_0x30b789){if(_[_0x5423('0x17')](_0xfa2a82)){return _0x30b789(handleCheckRowError('error',_0x5423('0x18'),null,_0x102096));}if(_0xfa2a82[_0x5423('0x19')]&&_0xfa2a82[_0x5423('0x19')]['length']){var _0x54bc05=_[_0x5423('0x1a')](_0xfa2a82[_0x5423('0x19')],_0x5423('0x1b'))['join'](';');return _0x30b789(handleCheckRowError(_0x5423('0x14'),_0x54bc05,null,_0x102096));}var _0xc7f89b={};for(var _0x319ae7 in FIELDS){if(FIELDS[_0x5423('0x1c')](_0x319ae7)&&FIELDS[_0x319ae7]){_0xc7f89b[_0x319ae7]=_0xfa2a82[_0x5423('0x1d')][0x0][FIELDS[_0x319ae7]]||_0xfa2a82[_0x5423('0x1d')][0x0]['\ufeff'+FIELDS[_0x319ae7]];}}if(!_0xc7f89b[_0x5423('0x1e')]){return _0x30b789(handleCheckRowError(_0x5423('0x14'),'firstName\x20not\x20specified!',null,_0x102096));}if(!_0xc7f89b[_0x5423('0x1f')]){return _0x30b789(handleCheckRowError(_0x5423('0x14'),_0x5423('0x20'),null,_0x102096));}if(_0xc7f89b['birthDate']){var _0x2d1d0a=moment(_0xc7f89b['birthDate'],_0x5423('0x21'));if(!_0x2d1d0a[_0x5423('0x22')]()){return _0x30b789(handleCheckRowError(_0x5423('0x14'),_0x5423('0x23'),null,_0x102096));}}if(_0xc7f89b[_0x5423('0x24')]){if(!isEmail(_0xc7f89b[_0x5423('0x24')])){return _0x30b789(handleCheckRowError('error',_0x5423('0x25'),null,_0x102096));}}_0xc7f89b[_0x5423('0x26')]=LISTID;_0xc7f89b[_0x5423('0x27')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x338c71){var _0x350310={};for(var _0x51ac02=0x0,_0x23c21b=DUPLICATES[_0x5423('0x28')];_0x51ac02<_0x23c21b;_0x51ac02+=0x1){_0x350310[DUPLICATES[_0x51ac02]]=_0xc7f89b[DUPLICATES[_0x51ac02]];}var _0x114308=_[_0x5423('0x29')](_0x338c71,_0x350310);if(_0x114308){return _0x30b789(handleCheckRowError(_0x5423('0x2a'),_0x5423('0x2b'),_0x114308,_0x102096));}}return db[_0x5423('0x2c')][_0x5423('0x2d')](_0xc7f89b,{'raw':!![],'hooks':![],'fields':_[_0x5423('0x2e')](_0xc7f89b)})[_0x5423('0x2f')](function(_0x152d54){if(DUPLICATES&&DUPLICATES[_0x5423('0x28')]&&_0x338c71){_0x338c71[_0x5423('0x30')](_[_0x5423('0x31')](_0xc7f89b,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x152d54['id'];return _0x53c06a();})['catch'](function(_0x34dcec){return _0x30b789(handleCheckRowError('error',_0x5423('0x32')+(_0x34dcec[_0x5423('0x1b')]||JSON[_0x5423('0x33')](_0x34dcec)),null,_0x102096));});});}function checkHopper(){function _0x5c41e4(){return function(_0x4e133e){logger['error'](_0x5423('0x34'),_0x5423('0x35'),util['inspect'](_0x4e133e,{'showHidden':![],'depth':null}));};}var _0x47d8aa=function(_0x4c373f,_0x48ecf9){var _0x446fae=squel[_0x5423('0x36')]()[_0x5423('0x37')]('cm_hopper')[_0x5423('0x38')]([_0x5423('0x1f'),'scheduledAt','ContactId',_0x5423('0x26'),_0x48ecf9,'createdAt',_0x5423('0x39')],squel[_0x5423('0x3a')]()[_0x5423('0x3b')](_0x5423('0x1f'),'phone')['field'](_0x5423('0x3c'),'scheduledAt')['field']('id',_0x5423('0x3d'))[_0x5423('0x3b')](LISTID[_0x5423('0x3e')](),_0x5423('0x26'))[_0x5423('0x3b')](_0x4c373f['id'][_0x5423('0x3e')](),_0x48ecf9)[_0x5423('0x3b')](_0x5423('0x3c'),'createdAt')[_0x5423('0x3b')](_0x5423('0x3c'),_0x5423('0x39'))[_0x5423('0x3f')](_0x5423('0x40'))[_0x5423('0x41')](_0x5423('0x42'))[_0x5423('0x41')](_0x5423('0x43'),LISTID[_0x5423('0x3e')]())[_0x5423('0x41')]('phone\x20IS\x20NOT\x20NULL')[_0x5423('0x41')](_0x5423('0x44'),squel[_0x5423('0x3a')]()[_0x5423('0x3b')](_0x5423('0x1f'))['from'](_0x5423('0x45'))[_0x5423('0x41')](_0x48ecf9+_0x5423('0x46'),_0x4c373f['id'][_0x5423('0x3e')]())))['toString']();return _0x446fae;};var _0x150ecb=function(_0x2ff4de,_0x107089){var _0x4728a0=squel[_0x5423('0x36')]()[_0x5423('0x37')](_0x5423('0x45'))['fromQuery']([_0x5423('0x1f'),'scheduledAt',_0x5423('0x3d'),_0x5423('0x26'),_0x107089,_0x5423('0x47'),_0x5423('0x39')],squel[_0x5423('0x3a')]()[_0x5423('0x3b')](_0x5423('0x1f'),_0x5423('0x1f'))[_0x5423('0x3b')](_0x5423('0x3c'),_0x5423('0x48'))[_0x5423('0x3b')]('id',_0x5423('0x3d'))[_0x5423('0x3b')](LISTID[_0x5423('0x3e')](),_0x5423('0x26'))[_0x5423('0x3b')](_0x2ff4de['id'][_0x5423('0x3e')](),_0x107089)[_0x5423('0x3b')](_0x5423('0x3c'),_0x5423('0x47'))[_0x5423('0x3b')]('NOW()',_0x5423('0x39'))[_0x5423('0x3f')](_0x5423('0x40'))['where'](_0x5423('0x42'))[_0x5423('0x41')]('ListId\x20=\x20?',LISTID['toString']())[_0x5423('0x41')]('id\x20IN\x20?',squel[_0x5423('0x49')](hopperContacts))['where'](_0x5423('0x4a'))[_0x5423('0x41')](_0x5423('0x44'),squel[_0x5423('0x3a')]()[_0x5423('0x3b')](_0x5423('0x4b'))[_0x5423('0x3f')]('cm_hopper_final')['where'](_0x107089+_0x5423('0x46'),_0x2ff4de['id'][_0x5423('0x3e')]()))[_0x5423('0x41')](_0x5423('0x44'),squel[_0x5423('0x3a')]()[_0x5423('0x3b')](_0x5423('0x1f'))[_0x5423('0x3f')](_0x5423('0x45'))['where'](_0x107089+'\x20=\x20?',_0x2ff4de['id'][_0x5423('0x3e')]())))[_0x5423('0x3e')]();return _0x4728a0;};function _0x1bb6ff(_0x59fa87,_0x64a081){var _0x3b668a=squel['insert']()[_0x5423('0x37')]('cm_hopper')[_0x5423('0x38')](['phone',_0x5423('0x48'),_0x5423('0x3d'),'ListId',_0x64a081,_0x5423('0x47'),_0x5423('0x39')],squel[_0x5423('0x3a')]()[_0x5423('0x3b')](_0x5423('0x1f'),_0x5423('0x1f'))[_0x5423('0x3b')](_0x5423('0x3c'),_0x5423('0x48'))['field']('id',_0x5423('0x3d'))['field'](LISTID[_0x5423('0x3e')](),_0x5423('0x26'))[_0x5423('0x3b')](_0x59fa87['id'][_0x5423('0x3e')](),_0x64a081)[_0x5423('0x3b')](_0x5423('0x3c'),_0x5423('0x47'))[_0x5423('0x3b')]('NOW()',_0x5423('0x39'))[_0x5423('0x3f')](_0x5423('0x40'))[_0x5423('0x41')](_0x5423('0x42'))['where'](_0x5423('0x43'),LISTID[_0x5423('0x3e')]())[_0x5423('0x41')](_0x5423('0x4c'),squel[_0x5423('0x49')](hopperContacts))[_0x5423('0x41')](_0x5423('0x4a')))[_0x5423('0x3e')]();return _0x3b668a;}function _0x4efef9(_0x3b3e7a,_0x448eff){var _0x2c07e4=squel[_0x5423('0x36')]()[_0x5423('0x37')](_0x5423('0x4d'))['fromQuery'](['phone',_0x5423('0x3d'),'ListId',_0x448eff,_0x5423('0x47'),_0x5423('0x39')],squel[_0x5423('0x3a')]()[_0x5423('0x3b')](_0x5423('0x1f'),'phone')[_0x5423('0x3b')]('id',_0x5423('0x3d'))[_0x5423('0x3b')](LISTID['toString'](),'ListId')[_0x5423('0x3b')](_0x3b3e7a['id'][_0x5423('0x3e')](),_0x448eff)[_0x5423('0x3b')]('NOW()','createdAt')['field'](_0x5423('0x3c'),'updatedAt')['from'](_0x5423('0x40'))[_0x5423('0x41')](_0x5423('0x42'))[_0x5423('0x41')](_0x5423('0x43'),LISTID[_0x5423('0x3e')]())[_0x5423('0x41')](_0x5423('0x4c'),squel['str'](hopperContacts))['where'](_0x5423('0x4a')))[_0x5423('0x3e')]();return _0x2c07e4;}return db['VoiceQueue'][_0x5423('0x4e')]({'where':{'type':_0x5423('0x4f')},'attributes':['id',_0x5423('0x50')],'include':[{'model':db['CmList'],'as':'Lists','where':{'id':LISTID}}]})[_0x5423('0x2f')](function(_0x1f6fad){var _0x19c145=[];if(_0x1f6fad){var _0x789d84;for(var _0x2ecd1c=0x0,_0x2d0721;_0x2ecd1c<_0x1f6fad['length'];_0x2ecd1c+=0x1){_0x2d0721=_0x1f6fad[_0x2ecd1c][_0x5423('0x51')]({'plain':!![]});switch(_0x2d0721[_0x5423('0x50')]){case'always':_0x19c145[_0x5423('0x30')](db[_0x5423('0x52')][_0x5423('0x53')](_0x150ecb(_0x2d0721,_0x5423('0x54')))[_0x5423('0x2f')](function(){})['catch'](_0x5c41e4()));break;case _0x5423('0x55'):_0x19c145[_0x5423('0x30')](db[_0x5423('0x52')][_0x5423('0x53')](_0x47d8aa(_0x2d0721,_0x5423('0x54')))[_0x5423('0x2f')](function(){})[_0x5423('0x56')](_0x5c41e4()));break;default:_0x19c145[_0x5423('0x30')](db[_0x5423('0x52')][_0x5423('0x53')](_0x1bb6ff(_0x2d0721,_0x5423('0x54')))[_0x5423('0x2f')](function(){})[_0x5423('0x56')](_0x5c41e4()));}}}return _0x19c145;})['all']()[_0x5423('0x2f')](function(){return db[_0x5423('0x57')][_0x5423('0x4e')]({'where':{'type':_0x5423('0x4f')},'attributes':['id'],'include':[{'model':db[_0x5423('0x58')],'as':_0x5423('0x59'),'where':{'id':LISTID}}]})[_0x5423('0x2f')](function(_0x507bc0){var _0x19b81f=[];if(_0x507bc0){var _0x21cb53;for(var _0x19797e=0x0,_0x5904ab;_0x19797e<_0x507bc0[_0x5423('0x28')];_0x19797e+=0x1){_0x5904ab=_0x507bc0[_0x19797e][_0x5423('0x51')]({'plain':!![]});_0x19b81f[_0x5423('0x30')](db[_0x5423('0x52')]['query'](_0x4efef9(_0x5904ab,_0x5423('0x54')))[_0x5423('0x2f')](function(){})[_0x5423('0x56')](_0x5c41e4()));}}return _0x19b81f;})['all']();})[_0x5423('0x2f')](function(){return db[_0x5423('0x5a')][_0x5423('0x4e')]({'attributes':['id',_0x5423('0x50')],'include':[{'model':db['CmList'],'as':_0x5423('0x5b'),'where':{'id':LISTID}}]})['then'](function(_0x1e8139){var _0x5c73f7=[];if(_0x1e8139){for(var _0x58f4aa=0x0,_0x501649;_0x58f4aa<_0x1e8139['length'];_0x58f4aa+=0x1){_0x501649=_0x1e8139[_0x58f4aa][_0x5423('0x51')]({'plain':!![]});switch(_0x501649[_0x5423('0x50')]){case _0x5423('0x5c'):_0x5c73f7[_0x5423('0x30')](db[_0x5423('0x52')][_0x5423('0x53')](_0x150ecb(_0x501649,_0x5423('0x5d')))[_0x5423('0x2f')](function(){})[_0x5423('0x56')](_0x5c41e4()));break;case'onlyIfOpen':_0x5c73f7[_0x5423('0x30')](db[_0x5423('0x52')]['query'](_0x47d8aa(_0x501649,_0x5423('0x5d')))['then'](function(){})[_0x5423('0x56')](_0x5c41e4()));break;default:_0x5c73f7[_0x5423('0x30')](db[_0x5423('0x52')][_0x5423('0x53')](_0x1bb6ff(_0x501649,_0x5423('0x5d')))[_0x5423('0x2f')](function(){})[_0x5423('0x56')](_0x5c41e4()));}}}return _0x5c73f7;})[_0x5423('0x5e')]();})['then'](function(){return db[_0x5423('0x5a')][_0x5423('0x4e')]({'attributes':['id'],'include':[{'model':db[_0x5423('0x58')],'as':_0x5423('0x59'),'where':{'id':LISTID}}]})[_0x5423('0x2f')](function(_0x4d3f06){var _0x106c92=[];if(_0x4d3f06){for(var _0x9e44=0x0,_0x205935;_0x9e44<_0x4d3f06[_0x5423('0x28')];_0x9e44+=0x1){_0x205935=_0x4d3f06[_0x9e44][_0x5423('0x51')]({'plain':!![]});_0x106c92[_0x5423('0x30')](db['sequelize'][_0x5423('0x53')](_0x4efef9(_0x205935,'CampaignId'))[_0x5423('0x2f')](function(){})[_0x5423('0x56')](_0x5c41e4()));}}return _0x106c92;})[_0x5423('0x5e')]();})[_0x5423('0x56')](function(_0x323bda){logger[_0x5423('0x14')](_0x5423('0x5f'),_0x5423('0x60'),_0x323bda[_0x5423('0x1b')]);});}var processPromises=function(_0x400529){return BPromise['all'](promises)[_0x5423('0x2f')](function(_0x3e3d6c){})[_0x5423('0x56')](function(_0x5d46ea){logger[_0x5423('0x14')](_0x5423('0x61'),JSON[_0x5423('0x33')](_0x5d46ea));})['finally'](function(){socket['emit'](_0x5423('0x62')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x400529){return _0x400529[_0x5423('0x63')]();}});};var endCsv=function(){return BPromise[_0x5423('0x64')]()[_0x5423('0x2f')](function(){if(hopperContacts){return checkHopper();}})[_0x5423('0x2f')](function(){socket[_0x5423('0x65')](_0x5423('0x62')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x2824c9){logger[_0x5423('0x14')]('Unable\x20to\x20delete\x20temp\x20file:',JSON['stringify'](_0x2824c9));}finally{process[_0x5423('0x66')](0x0);}});};process['on']('SIGINT',function(){logger[_0x5423('0x67')](_0x5423('0x68'));endCsv();});function main(){return BPromise['resolve']()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x5423('0x13')](',');return db[_0x5423('0x2c')][_0x5423('0x4e')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x52409e){var _0x2a6a56=fs[_0x5423('0x69')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x5423('0x6a')](_0x2a6a56,{'header':!![],'skipEmptyLines':!![],'step':function(_0x5ae310,_0x69a5d0){total+=0x1;var _0x3cee3d=total;promises[_0x5423('0x30')](checkRow(_0x5ae310,_0x52409e,_0x3cee3d)[_0x5423('0x2f')](function(){success+=0x1;})[_0x5423('0x56')](function(_0x3c0e34){if(_0x3c0e34[_0x5423('0x14')]){errors+=0x1;delete _0x3c0e34[_0x5423('0x14')];}else if(_0x3c0e34[_0x5423('0x2a')]){duplicates+=0x1;delete _0x3c0e34[_0x5423('0x2a')];}rows[_0x5423('0x30')](_0x3c0e34);}));if(total%0xc8===0x0){_0x69a5d0['pause']();return processPromises(_0x69a5d0);}},'complete':function(){return processPromises()[_0x5423('0x2f')](function(){logger[_0x5423('0x67')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x2b1847,_0x5aaa16){logger['info'](_0x5423('0x6b'),JSON['stringify'](_0x2b1847));endCsv();}});})[_0x5423('0x56')](function(_0xe94df3){logger[_0x5423('0x14')](_0x5423('0x6c'),JSON[_0x5423('0x33')](_0xe94df3));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 5228411..2b02b1b 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 _0xce22=['keys',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','min_id','group','info','Received\x20SIGINT','error','message','exit','errors','push','code','spread','catch','campaigns.id','campaigns.dialTimezone','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','sequelize','length','all','then','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','query','timezones','dialTimezone','isNil','set','offset','main','send','start','binding','socket_timestamp','root','.csv','header',',utcOffset','writeFileSync','parse','createReadStream','data','rows','trim','replace','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','utcOffset','firstName','appendFileSync','emit','contact:import:','Abort\x20parser','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','format','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','CompanyId',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns','CampaignId','campaigns_has_cm_blacklists','finish','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','server/files/tmp','existsSync','file\x20doesn\x27t\x20exists','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','lodash','util','bluebird','moment','squel','../../../mysqldb','../../../config/environment/shared','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','.id\x20=\x20','\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','createdAt','updatedAt','priority','UserId','fields','join','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','cm_contacts.ListId','cm_hopper_black','ListId','\x20=\x20?','toString','.offset-cm_contacts.utcOffset\x20minute)','recallme','ListId\x20=\x20?','concat'];(function(_0x547e42,_0xbfdd11){var _0x2998a0=function(_0xff661d){while(--_0xff661d){_0x547e42['push'](_0x547e42['shift']());}};_0x2998a0(++_0xbfdd11);}(_0xce22,0x68));var _0x2ce2=function(_0x308509,_0xe1759e){_0x308509=_0x308509-0x0;var _0x3c7993=_0xce22[_0x308509];return _0x3c7993;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x2ce2('0x0'));var Papa=require('papaparse');var util=require(_0x2ce2('0x1'));var BPromise=require(_0x2ce2('0x2'));var moment=require(_0x2ce2('0x3'));var squel=require(_0x2ce2('0x4'));var Redis=require('ioredis');var db=require(_0x2ce2('0x5'))['db'];var config=require('../../../config/environment');var shared=require(_0x2ce2('0x6'));var logger=require(_0x2ce2('0x7'))(_0x2ce2('0x8'));config[_0x2ce2('0x9')]=_[_0x2ce2('0xa')](config[_0x2ce2('0x9')],{'host':_0x2ce2('0xb'),'port':0x18eb});var socket=require(_0x2ce2('0xc'))(new Redis(config[_0x2ce2('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format'](_0x2ce2('0xd'));function isEmail(_0x4b86ca){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))*$/[_0x2ce2('0xe')](_0x4b86ca);}function selectNotIn(_0x2731aa,_0x3c1b92,_0x4609f6,_0x2ab10b,_0x555929){return squel[_0x2ce2('0xf')]()[_0x2ce2('0x10')](_0x2ce2('0x11'))[_0x2ce2('0x12')](_0x2ab10b)['join'](_0x3c1b92,null,_0x3c1b92+_0x2ce2('0x13')+_0x2ab10b+'.'+_0x4609f6)['where'](_0x2ab10b+'.'+_0x4609f6+_0x2ce2('0x14')+_0x2731aa+'.'+_0x4609f6)[_0x2ce2('0x15')](_0x3c1b92+_0x2ce2('0x16')+_0x555929['join']()+')');}function insertCmHopper(_0x484b38,_0x14598e,_0x2447db,_0x65d3a6,_0x27679b){var _0x22ae48=[_0x2ce2('0x17'),_0x2ce2('0x18'),_0x2ce2('0x19'),'cm_contacts.ListId',_0x14598e+'.'+_0x65d3a6,_0x2ce2('0x1a'),_0x2ce2('0x1b'),_0x2ce2('0x1c'),_0x2ce2('0x1d'),'\x22'+_0x27679b+'\x22'];return squel[_0x2ce2('0x1e')]()[_0x2ce2('0x1f')](_0x2ce2('0x20'))[_0x2ce2('0x21')]([_0x2ce2('0x11'),_0x2ce2('0x22'),_0x2ce2('0x23'),'ListId',_0x65d3a6,_0x2ce2('0x24'),_0x2ce2('0x25'),_0x2ce2('0x26'),_0x2ce2('0x27'),'recallme'],squel[_0x2ce2('0xf')]()[_0x2ce2('0x28')](_0x22ae48)[_0x2ce2('0x12')](_0x14598e)[_0x2ce2('0x29')](_0x2ce2('0x2a'),null,_0x2ce2('0x2b')+_0x14598e+_0x2ce2('0x2c'))['join'](_0x2447db,null,_0x2447db+_0x2ce2('0x13')+_0x14598e+'.'+_0x65d3a6)['where'](_0x14598e+_0x2ce2('0x2d'),_0x484b38)[_0x2ce2('0x15')](_0x2ce2('0x2e'),NOW)[_0x2ce2('0x15')](_0x2ce2('0x2f'),selectNotIn(_0x14598e,_0x2447db,_0x65d3a6,_0x2ce2('0x20'),[_0x2ce2('0x30'),'\x22onlyIfOpen\x22']))[_0x2ce2('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x14598e,_0x2447db,_0x65d3a6,'cm_hopper',['\x22always\x22'])))['toString']();}function insertCmHopperBlack(_0x1afb71,_0x339daa,_0x5addff,_0x2f6e9f){var _0x41be97=[_0x2ce2('0x17'),_0x2ce2('0x19'),_0x2ce2('0x31'),_0x339daa+'.'+_0x2f6e9f,_0x2ce2('0x1a'),_0x2ce2('0x1b')];return squel[_0x2ce2('0x1e')]()[_0x2ce2('0x1f')](_0x2ce2('0x32'))[_0x2ce2('0x21')]([_0x2ce2('0x11'),_0x2ce2('0x23'),_0x2ce2('0x33'),_0x2f6e9f,_0x2ce2('0x24'),_0x2ce2('0x25')],squel[_0x2ce2('0xf')]()[_0x2ce2('0x28')](_0x41be97)['from'](_0x339daa)[_0x2ce2('0x29')](_0x2ce2('0x2a'),null,_0x2ce2('0x2b')+_0x339daa+_0x2ce2('0x2c'))[_0x2ce2('0x29')](_0x5addff,null,_0x5addff+_0x2ce2('0x13')+_0x339daa+'.'+_0x2f6e9f)[_0x2ce2('0x15')](_0x339daa+_0x2ce2('0x2d'),_0x1afb71)[_0x2ce2('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0x2ce2('0x2f'),squel[_0x2ce2('0xf')]()['field'](_0x2ce2('0x11'))[_0x2ce2('0x12')](_0x2ce2('0x32'))[_0x2ce2('0x15')]('ListId\x20=\x20?',_0x1afb71)[_0x2ce2('0x15')](_0x2f6e9f+_0x2ce2('0x34'),_0x339daa+'.'+_0x2f6e9f)))[_0x2ce2('0x35')]();}function insertTzCmHopper(_0x218b7d,_0x511c2c,_0x3e7b1b,_0x542a46,_0x682d44,_0x75a3d4){var _0x31be10=['cm_contacts.phone','date_add(cm_contacts.scheduledat,interval\x20'+_0x75a3d4+_0x2ce2('0x36'),_0x2ce2('0x19'),_0x2ce2('0x31'),_0x511c2c+'.'+_0x542a46,'cm_contacts.createdAt','cm_contacts.updatedAt',_0x2ce2('0x1c'),_0x2ce2('0x1d'),'\x22'+_0x682d44+'\x22'];var _0x548115=squel[_0x2ce2('0x1e')]()['into'](_0x2ce2('0x20'))[_0x2ce2('0x21')]([_0x2ce2('0x11'),_0x2ce2('0x22'),_0x2ce2('0x23'),'ListId',_0x542a46,_0x2ce2('0x24'),_0x2ce2('0x25'),'priority',_0x2ce2('0x27'),_0x2ce2('0x37')],squel['select']()['fields'](_0x31be10)[_0x2ce2('0x12')](_0x511c2c)['join']('cm_contacts',null,_0x2ce2('0x2b')+_0x511c2c+_0x2ce2('0x2c'))['join'](_0x3e7b1b,null,_0x3e7b1b+_0x2ce2('0x13')+_0x511c2c+'.'+_0x542a46)['join'](_0x75a3d4,null,_0x75a3d4+'.id\x20=\x20'+_0x511c2c+'.'+_0x542a46)['where'](_0x511c2c+_0x2ce2('0x2d'),_0x218b7d)[_0x2ce2('0x15')](_0x2ce2('0x2e'),NOW)[_0x2ce2('0x15')](_0x2ce2('0x2f'),selectNotIn(_0x511c2c,_0x3e7b1b,_0x542a46,'cm_hopper',[_0x2ce2('0x30'),'\x22onlyIfOpen\x22']))[_0x2ce2('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x511c2c,_0x3e7b1b,_0x542a46,'cm_hopper',['\x22always\x22'])))[_0x2ce2('0x35')]();return _0x548115;}function insertTzCmHopperBlack(_0x2b3408,_0x294de8,_0x4394a8,_0x1de3b6){var _0x1dac34=[_0x2ce2('0x17'),_0x2ce2('0x19'),'cm_contacts.ListId',_0x294de8+'.'+_0x1de3b6,_0x2ce2('0x1a'),_0x2ce2('0x1b')];return squel['insert']()[_0x2ce2('0x1f')](_0x2ce2('0x32'))[_0x2ce2('0x21')]([_0x2ce2('0x11'),'ContactId','ListId',_0x1de3b6,_0x2ce2('0x24'),_0x2ce2('0x25')],squel[_0x2ce2('0xf')]()['fields'](_0x1dac34)[_0x2ce2('0x12')](_0x294de8)[_0x2ce2('0x29')](_0x2ce2('0x2a'),null,'cm_contacts.ListId\x20=\x20'+_0x294de8+_0x2ce2('0x2c'))['join'](_0x4394a8,null,_0x4394a8+_0x2ce2('0x13')+_0x294de8+'.'+_0x1de3b6)[_0x2ce2('0x15')](_0x294de8+_0x2ce2('0x2d'),_0x2b3408)[_0x2ce2('0x15')](_0x2ce2('0x2e'),NOW)[_0x2ce2('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x2ce2('0xf')]()[_0x2ce2('0x10')]('phone')[_0x2ce2('0x12')](_0x2ce2('0x32'))[_0x2ce2('0x15')](_0x2ce2('0x38'),_0x2b3408)[_0x2ce2('0x15')](_0x1de3b6+_0x2ce2('0x34'),_0x294de8+'.'+_0x1de3b6)))['toString']();}function insertCmContact(_0x15a3a5,_0x16f659,_0x478d47,_0x20e2c6){var _0x29dc63=_[_0x2ce2('0x39')](_[_0x2ce2('0x3a')](_0x20e2c6),[_0x2ce2('0x33'),'CompanyId','createdAt','updatedAt']);return squel[_0x2ce2('0x1e')]()[_0x2ce2('0x1f')](_0x2ce2('0x2a'))[_0x2ce2('0x21')](_0x29dc63,squel[_0x2ce2('0xf')]()[_0x2ce2('0x28')](_0x29dc63)['from'](_0x16f659)['where']('('+_0x478d47['join'](',')+_0x2ce2('0x3b'),squel[_0x2ce2('0xf')]()[_0x2ce2('0x28')](_0x478d47)[_0x2ce2('0x12')](_0x2ce2('0x2a'))[_0x2ce2('0x15')](_0x2ce2('0x38'),_0x15a3a5)['where'](_0x2ce2('0x3c')))['where']('id\x20IN\x20?',squel[_0x2ce2('0xf')]()[_0x2ce2('0x10')]('MIN(id)',_0x2ce2('0x3d'))[_0x2ce2('0x12')](_0x16f659)[_0x2ce2('0x3e')](_0x478d47[_0x2ce2('0x29')](','))))[_0x2ce2('0x35')]();}function handleStop(){logger[_0x2ce2('0x3f')](_0x2ce2('0x40'));stopped=!![];}function handleUncaughtException(_0xe93c9e){logger[_0x2ce2('0x41')](_0xe93c9e[_0x2ce2('0x42')]);process[_0x2ce2('0x43')](0x1);}function handleError(_0x1c1fd5,_0x3dd14c){stats[_0x2ce2('0x44')][_0x2ce2('0x45')]({'name':_0x3dd14c[_0x2ce2('0x46')],'message':_0x3dd14c[_0x2ce2('0x42')],'row':_0x1c1fd5});}function handleQuery(_0x455988){logger[_0x2ce2('0x3f')](_0x455988);return db['sequelize']['query'](_0x455988)[_0x2ce2('0x47')](function(_0x40ab79){results[_0x2ce2('0x45')](_0x40ab79);})[_0x2ce2('0x48')](function(_0x435c23){logger[_0x2ce2('0x41')](_0x435c23[_0x2ce2('0x42')]);});}function updateTzCampaigns(_0x261ec0){return new Promise(function(_0x2daf3b,_0x4c679c){var _0x3fe05a=squel[_0x2ce2('0xf')]()[_0x2ce2('0x28')]([_0x2ce2('0x49'),_0x2ce2('0x4a')])['from']('campaigns')[_0x2ce2('0x29')](_0x2ce2('0x4b'),null,_0x2ce2('0x4c'))[_0x2ce2('0x15')](_0x2ce2('0x4d')+_0x261ec0);db[_0x2ce2('0x4e')]['query'](_0x3fe05a[_0x2ce2('0x35')]())[_0x2ce2('0x47')](function(_0x30045b){var _0x5cc53b=[];for(var _0x3dad3c=0x0;_0x3dad3c<_0x30045b[_0x2ce2('0x4f')];_0x3dad3c++){_0x5cc53b[_0x2ce2('0x45')](getTimezoneData(_0x30045b[_0x3dad3c],tmp_campaigns));}BPromise[_0x2ce2('0x50')](_0x5cc53b)[_0x2ce2('0x51')](function(){_0x2daf3b({'val':0x1});});})['catch'](function(_0x3969b4){logger[_0x2ce2('0x41')](_0x3969b4[_0x2ce2('0x42')]);_0x2daf3b({'val':0x0});});});}function updateTzVoiceQueues(_0x373ecc){return new Promise(function(_0x16f4ae,_0x37273d){var _0x1e6676=squel[_0x2ce2('0xf')]()['fields']([_0x2ce2('0x52'),_0x2ce2('0x53')])[_0x2ce2('0x12')](_0x2ce2('0x54'))['join'](_0x2ce2('0x55'),null,_0x2ce2('0x56'))[_0x2ce2('0x15')](_0x2ce2('0x57')+_0x373ecc);db[_0x2ce2('0x4e')][_0x2ce2('0x58')](_0x1e6676[_0x2ce2('0x35')]())[_0x2ce2('0x47')](function(_0x406d46){var _0x5bee45=[];for(var _0x37346c=0x0;_0x37346c<_0x406d46['length'];_0x37346c++){_0x5bee45['push'](getTimezoneData(_0x406d46[_0x37346c],tmp_voice_queues));}BPromise[_0x2ce2('0x50')](_0x5bee45)[_0x2ce2('0x51')](function(){_0x16f4ae({'val':0x1});});})['catch'](function(_0x1977e8){logger[_0x2ce2('0x41')](_0x1977e8[_0x2ce2('0x42')]);_0x16f4ae({'val':0x0});});});}function getTimezoneData(_0x10008b,_0x39054d){return new Promise(function(_0x21a9d4,_0xe1da96){var _0x41ea20=shared[_0x2ce2('0x59')];var _0x3ea3cb=_0x41ea20[_0x10008b[_0x2ce2('0x5a')]];if(_[_0x2ce2('0x5b')](_0x3ea3cb)){_0x21a9d4({'ret':0x1});}else{var _0x44b0ab=_0x3ea3cb['utcOffset'];var _0x4e3049=squel[_0x2ce2('0x1e')]()[_0x2ce2('0x1f')](_0x39054d)['set']('id',_0x10008b['id'])[_0x2ce2('0x5c')](_0x2ce2('0x5d'),_0x44b0ab)[_0x2ce2('0x5c')]('dialTimezone',_0x10008b[_0x2ce2('0x5a')])[_0x2ce2('0x35')]();return db[_0x2ce2('0x4e')][_0x2ce2('0x58')](_0x4e3049)[_0x2ce2('0x47')](function(_0x410edd){_0x21a9d4({'ret':0x1});})[_0x2ce2('0x48')](function(_0x29415c){logger[_0x2ce2('0x41')](_0x29415c['message']);_0xe1da96({'ret':0x1});});}});}function handleTZQuery(_0x1452cb){logger[_0x2ce2('0x3f')](_0x1452cb);return db['sequelize'][_0x2ce2('0x58')](_0x1452cb)[_0x2ce2('0x47')](function(_0x2725b8){})['catch'](function(_0x44ba6a){logger[_0x2ce2('0x41')](_0x44ba6a['message']);});}function main(_0x10940b,_0x128e42,_0x424c4b,_0x2fe451){logger['info'](_0x2ce2('0x5e'),_0x10940b,JSON['stringify'](_0x128e42));process[_0x2ce2('0x5f')](_0x2ce2('0x60'));var _0x1c0b2e=_0x128e42[_0x2ce2('0x61')];var _0x5d6935=_0x128e42[_0x2ce2('0x62')];var _0x13060a=path[_0x2ce2('0x29')](config[_0x2ce2('0x63')],'server/files/tmp',_0x5d6935+_0x2ce2('0x64'));hasTZ=_[_0x2ce2('0x3a')](_0x1c0b2e)['includes'](_0x2ce2('0x5a'));var _0x37e0b2=_[_0x2ce2('0x3a')](_0x1c0b2e)[_0x2ce2('0x29')]();logger[_0x2ce2('0x3f')](_0x2ce2('0x65'),_0x37e0b2);if(hasTZ)_0x37e0b2+=_0x2ce2('0x66');fs[_0x2ce2('0x67')](_0x13060a,_0x37e0b2+'\x0a');Papa[_0x2ce2('0x68')](fs[_0x2ce2('0x69')](_0x10940b),{'header':!![],'skipEmptyLines':!![],'step':function(_0x4044df,_0xe538c0){try{for(var _0x1393e6=0x0,_0x34d718=[];_0x1393e6<_0x4044df[_0x2ce2('0x6a')][_0x2ce2('0x4f')];_0x1393e6++){stats[_0x2ce2('0x6b')]+=0x1;if(_0x4044df[_0x2ce2('0x44')][_0x1393e6]){handleError(_0x4044df['data'][_0x1393e6],_0x4044df[_0x2ce2('0x44')][_0x1393e6]);}else{var _0x1f6f8c=[];for(var _0x3f0ed8 in _0x1c0b2e){if(_0x1c0b2e['hasOwnProperty'](_0x3f0ed8)){if(_0x4044df['data'][_0x1393e6][_0x1c0b2e[_0x3f0ed8]]){var _0x148cd6=_[_0x2ce2('0x6c')](_0x4044df['data'][_0x1393e6][_0x1c0b2e[_0x3f0ed8]][_0x2ce2('0x6d')](/"/g,'\x27'));switch(_0x3f0ed8){case _0x2ce2('0x22'):var _0xac19b=moment(_0x148cd6,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0xac19b['isValid']()){_0x34d718[_0x2ce2('0x45')]('\x22'+_0x148cd6+'\x22');}else{_0x1f6f8c[_0x2ce2('0x45')](_0x2ce2('0x6e'));}break;case'priority':var _0x4f921e=parseInt(_0x148cd6);_0x148cd6=_['isNaN'](_0x4f921e)||_0x4f921e<0x0||_0x4f921e>0x4?_0x2fe451?0x3:0x2:_0x4f921e;_0x34d718[_0x2ce2('0x45')]('\x22'+_0x148cd6+'\x22');break;case _0x2ce2('0x27'):var _0x27ba56=parseInt(_0x148cd6);if(_[_0x2ce2('0x6f')](_0x27ba56)&&_[_0x2ce2('0x70')](_0x424c4b,_0x27ba56)){_0x34d718[_0x2ce2('0x45')]('\x22'+_0x27ba56+'\x22');}else{_0x1f6f8c['push'](_0x2ce2('0x71'));}break;case _0x2ce2('0x72'):if(isEmail(_0x148cd6)){_0x34d718[_0x2ce2('0x45')]('\x22'+_0x148cd6+'\x22');}else{_0x1f6f8c[_0x2ce2('0x45')](_0x2ce2('0x73'));}break;case _0x2ce2('0x74'):var _0x3eb4e9=moment(_0x148cd6,_0x2ce2('0x75'),!![]);if(_0x3eb4e9[_0x2ce2('0x76')]()){_0x34d718['push']('\x22'+_0x148cd6+'\x22');}else{_0x1f6f8c[_0x2ce2('0x45')](_0x2ce2('0x77'));}break;case _0x2ce2('0x5a'):var _0x229fc4=shared[_0x2ce2('0x59')];var _0x4da073=_0x229fc4[_0x148cd6];if(!_['isNil'](_0x4da073)){var _0x444660=_0x4da073[_0x2ce2('0x78')];_0x34d718[_0x2ce2('0x45')]('\x22'+_0x148cd6+'\x22');_0x34d718[_0x2ce2('0x45')]('\x22'+_0x444660+'\x22');}break;default:_0x34d718[_0x2ce2('0x45')]('\x22'+_0x148cd6+'\x22');}}else{switch(_0x3f0ed8){case _0x2ce2('0x79'):case _0x2ce2('0x11'):_0x1f6f8c[_0x2ce2('0x45')](_0x3f0ed8+'\x20not\x20specified');break;default:_0x34d718[_0x2ce2('0x45')]('\x22\x22');}}}}if(_0x1f6f8c['length']){handleError(_0x4044df[_0x2ce2('0x6a')][_0x1393e6],{'code':'SystemRow','message':_0x1f6f8c[_0x2ce2('0x29')]()});}else{fs[_0x2ce2('0x7a')](_0x13060a,_0x34d718[_0x2ce2('0x29')]()+'\x0a');}_0x34d718=[];}if(!(stats[_0x2ce2('0x6b')]%0xc8)){socket[_0x2ce2('0x7b')](_0x2ce2('0x7c')+_0x5d6935,stats);stats[_0x2ce2('0x44')]=[];}}if(stopped){logger[_0x2ce2('0x3f')](_0x2ce2('0x7d'));_0xe538c0['abort']();}}catch(_0x5945cd){handleError(_0x4044df[_0x2ce2('0x6a')][_0x1393e6],{'code':_0x2ce2('0x7e'),'message':_0x5945cd[_0x2ce2('0x42')]});logger[_0x2ce2('0x41')](_0x2ce2('0x7f'),_0x5945cd['message']);}},'complete':function(){try{var _0xff96af=[];var _0x560e61=[];var _0x22351f=_0x2ce2('0x2a');if(_0x128e42['duplicates']&&_0x128e42[_0x2ce2('0x80')][_0x2ce2('0x4f')]){_0x22351f=_0x2ce2('0x81')+_0x5d6935;_0xff96af[_0x2ce2('0x45')](_0x2ce2('0x82')+_0x22351f+_0x2ce2('0x83'));}tmp_campaigns=_0x2ce2('0x84')+_0x5d6935;tmp_voice_queues=_0x2ce2('0x85')+_0x5d6935;_0x560e61[_0x2ce2('0x45')](_0x2ce2('0x82')+tmp_campaigns+_0x2ce2('0x86'));_0x560e61[_0x2ce2('0x45')]('CREATE\x20TABLE\x20'+tmp_voice_queues+_0x2ce2('0x86'));BPromise[_0x2ce2('0x87')](_0x560e61,handleTZQuery)[_0x2ce2('0x51')](function(_0x317115){updateTzCampaigns(_0x128e42[_0x2ce2('0x33')])[_0x2ce2('0x51')](function(_0x2d7562){updateTzVoiceQueues(_0x128e42['ListId'])[_0x2ce2('0x51')](function(_0x3c0246){var _0x407337=util[_0x2ce2('0x88')](_0x2ce2('0x89'),_0x13060a,_0x22351f,_0x37e0b2,_0x128e42[_0x2ce2('0x33')],_0x128e42[_0x2ce2('0x8a')]||null,NOW,NOW);if(_[_0x2ce2('0x5b')](_0x1c0b2e[_0x2ce2('0x22')])){_0x407337+=_0x2ce2('0x8b');}_0xff96af[_0x2ce2('0x45')](_0x407337);if(_0x128e42[_0x2ce2('0x80')]&&_0x128e42[_0x2ce2('0x80')][_0x2ce2('0x4f')]){_0xff96af[_0x2ce2('0x45')](insertCmContact(_0x128e42['ListId'],_0x22351f,_0x128e42['duplicates'],_0x1c0b2e));_0xff96af[_0x2ce2('0x45')](_0x2ce2('0x8c')+_0x22351f+';');}if(hasTZ){_0xff96af['push'](insertTzCmHopper(_0x128e42[_0x2ce2('0x33')],'voice_queues_has_cm_lists',_0x2ce2('0x54'),_0x2ce2('0x8d'),_0x2fe451,tmp_voice_queues));_0xff96af[_0x2ce2('0x45')](insertTzCmHopperBlack(_0x128e42[_0x2ce2('0x33')],_0x2ce2('0x8e'),_0x2ce2('0x54'),'VoiceQueueId'));_0xff96af[_0x2ce2('0x45')](insertTzCmHopper(_0x128e42[_0x2ce2('0x33')],_0x2ce2('0x4b'),_0x2ce2('0x8f'),_0x2ce2('0x90'),_0x2fe451,tmp_campaigns));_0xff96af[_0x2ce2('0x45')](insertTzCmHopperBlack(_0x128e42[_0x2ce2('0x33')],_0x2ce2('0x91'),'campaigns','CampaignId'));}else{_0xff96af[_0x2ce2('0x45')](insertCmHopper(_0x128e42[_0x2ce2('0x33')],_0x2ce2('0x55'),_0x2ce2('0x54'),_0x2ce2('0x8d'),_0x2fe451));_0xff96af[_0x2ce2('0x45')](insertCmHopperBlack(_0x128e42[_0x2ce2('0x33')],_0x2ce2('0x8e'),'voice_queues','VoiceQueueId'));_0xff96af[_0x2ce2('0x45')](insertCmHopper(_0x128e42[_0x2ce2('0x33')],_0x2ce2('0x4b'),_0x2ce2('0x8f'),_0x2ce2('0x90'),_0x2fe451));_0xff96af[_0x2ce2('0x45')](insertCmHopperBlack(_0x128e42[_0x2ce2('0x33')],'campaigns_has_cm_blacklists',_0x2ce2('0x8f'),_0x2ce2('0x90')));}_0xff96af['push'](_0x2ce2('0x8c')+tmp_campaigns+';');_0xff96af['push']('DROP\x20TABLE\x20'+tmp_voice_queues+';');BPromise[_0x2ce2('0x87')](_0xff96af,handleQuery)['then'](function(_0x198441){stats[_0x2ce2('0x92')]=!![];stats[_0x2ce2('0x93')]=_0x128e42[_0x2ce2('0x80')]&&_0x128e42[_0x2ce2('0x80')][_0x2ce2('0x4f')]?results[0x2][_0x2ce2('0x93')]:results[0x0][_0x2ce2('0x93')];socket[_0x2ce2('0x7b')](_0x2ce2('0x7c')+_0x5d6935,stats);fs['unlink'](_0x10940b);fs[_0x2ce2('0x94')](_0x13060a);process['exit'](0x0);})[_0x2ce2('0x48')](function(_0xaa3d8a){logger[_0x2ce2('0x41')](_0xaa3d8a['message']);process[_0x2ce2('0x43')](0x1);});});});});}catch(_0x4a1927){logger['error'](_0x2ce2('0x95'),_0x4a1927[_0x2ce2('0x42')]);process[_0x2ce2('0x43')](0x1);}},'error':function(_0x2cb802,_0x3b9399,_0x12af17,_0x3ec066){throw new Error(_0x3ec066);}});}function validate(){if(process[_0x2ce2('0x96')]&&process[_0x2ce2('0x96')][_0x2ce2('0x4f')]<0x4){throw new Error(_0x2ce2('0x97'));}var _0x5d86c1=path[_0x2ce2('0x29')](config[_0x2ce2('0x63')],_0x2ce2('0x98'),process[_0x2ce2('0x96')][0x2]);if(!fs[_0x2ce2('0x99')](_0x5d86c1)){throw new Error(_0x2ce2('0x9a'));}var _0x290ab0={};try{_0x290ab0=JSON['parse'](process[_0x2ce2('0x96')][0x3]);if(!_0x290ab0[_0x2ce2('0x61')]){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x290ab0[_0x2ce2('0x61')][_0x2ce2('0x11')]){throw new Error('phone\x20is\x20mandatory');}if(!_0x290ab0[_0x2ce2('0x61')][_0x2ce2('0x79')]){throw new Error(_0x2ce2('0x9b'));}var _0x3a37d2=0x0;if(_0x290ab0[_0x2ce2('0x61')][_0x2ce2('0x27')]){_0x3a37d2=0x1;}if(!_0x290ab0[_0x2ce2('0x33')]){throw new Error(_0x2ce2('0x9c'));}}catch(_0x40b981){throw new Error(_0x2ce2('0x9d'));}var _0x16cadc=[];try{_0x16cadc=_[_0x2ce2('0x9e')](JSON[_0x2ce2('0x68')](process[_0x2ce2('0x96')][0x4]),'id');}catch(_0x543cc5){logger[_0x2ce2('0x3f')](_0x2ce2('0x9f'));}main(_0x5d86c1,_0x290ab0,_0x16cadc,_0x3a37d2);}validate();process['on'](_0x2ce2('0xa0'),handleStop);process['on'](_0x2ce2('0xa1'),handleUncaughtException); \ No newline at end of file +var _0xc7d3=['fromQuery','scheduledat','ListId','updatedAt','UserId','recallme','select','fields','from','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','cm_hopper_black','ContactId','createdAt','cm_contacts','ListId\x20=\x20?','toString','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','insert','priority','.CmListId','cm_contacts.createdAt\x20=\x20?','keys','CompanyId','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','exit','push','code','message','info','sequelize','query','spread','catch','error','campaigns.id','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','campaigns_has_cm_lists.CmListId=','all','then','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','length','timezones','dialTimezone','isNil','utcOffset','set','offset','main','stringify','send','start','binding','socket_timestamp','root','server/files/tmp',',utcOffset','writeFileSync','parse','rows','errors','data','hasOwnProperty','trim','replace','isValid','isNaN','isNumber','includes','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','appendFileSync','contact:import:','Abort\x20parser','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','format','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','voice_queues_has_cm_lists','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','campaigns_has_cm_blacklists','affectedRows','emit','unlink','complete','argv','file\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','ListId\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../config/environment','import','redis','defaults','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','test','field','phone','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','into','cm_hopper'];(function(_0x73d35,_0x10fb13){var _0x32bc1a=function(_0x46f8bc){while(--_0x46f8bc){_0x73d35['push'](_0x73d35['shift']());}};_0x32bc1a(++_0x10fb13);}(_0xc7d3,0x113));var _0x3c7d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc7d3[_0x3dd15e];return _0x231fd0;};'use strict';var fs=require('fs');var path=require(_0x3c7d('0x0'));var _=require(_0x3c7d('0x1'));var Papa=require(_0x3c7d('0x2'));var util=require(_0x3c7d('0x3'));var BPromise=require(_0x3c7d('0x4'));var moment=require(_0x3c7d('0x5'));var squel=require(_0x3c7d('0x6'));var Redis=require(_0x3c7d('0x7'));var db=require('../../../mysqldb')['db'];var config=require(_0x3c7d('0x8'));var shared=require('../../../config/environment/shared');var logger=require('../../../config/logger')(_0x3c7d('0x9'));config[_0x3c7d('0xa')]=_[_0x3c7d('0xb')](config[_0x3c7d('0xa')],{'host':_0x3c7d('0xc'),'port':0x18eb});var socket=require(_0x3c7d('0xd'))(new Redis(config[_0x3c7d('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format'](_0x3c7d('0xe'));function isEmail(_0xb4c1f3){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))*$/[_0x3c7d('0xf')](_0xb4c1f3);}function selectNotIn(_0x5c3170,_0x273f03,_0x4da5fb,_0x51452b,_0x4e29ea){return squel['select']()[_0x3c7d('0x10')](_0x3c7d('0x11'))['from'](_0x51452b)[_0x3c7d('0x12')](_0x273f03,null,_0x273f03+_0x3c7d('0x13')+_0x51452b+'.'+_0x4da5fb)[_0x3c7d('0x14')](_0x51452b+'.'+_0x4da5fb+_0x3c7d('0x15')+_0x5c3170+'.'+_0x4da5fb)['where'](_0x273f03+_0x3c7d('0x16')+_0x4e29ea[_0x3c7d('0x12')]()+')');}function insertCmHopper(_0x33c833,_0x3e0c05,_0x3643f8,_0x495565,_0x3e33ef){var _0x4eede1=[_0x3c7d('0x17'),_0x3c7d('0x18'),_0x3c7d('0x19'),_0x3c7d('0x1a'),_0x3e0c05+'.'+_0x495565,_0x3c7d('0x1b'),_0x3c7d('0x1c'),_0x3c7d('0x1d'),_0x3c7d('0x1e'),'\x22'+_0x3e33ef+'\x22'];return squel['insert']()[_0x3c7d('0x1f')](_0x3c7d('0x20'))[_0x3c7d('0x21')]([_0x3c7d('0x11'),_0x3c7d('0x22'),'ContactId',_0x3c7d('0x23'),_0x495565,'createdAt',_0x3c7d('0x24'),'priority',_0x3c7d('0x25'),_0x3c7d('0x26')],squel[_0x3c7d('0x27')]()[_0x3c7d('0x28')](_0x4eede1)[_0x3c7d('0x29')](_0x3e0c05)['join']('cm_contacts',null,_0x3c7d('0x2a')+_0x3e0c05+'.CmListId')['join'](_0x3643f8,null,_0x3643f8+_0x3c7d('0x13')+_0x3e0c05+'.'+_0x495565)[_0x3c7d('0x14')](_0x3e0c05+_0x3c7d('0x2b'),_0x33c833)[_0x3c7d('0x14')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x3c7d('0x14')](_0x3c7d('0x2c'),selectNotIn(_0x3e0c05,_0x3643f8,_0x495565,'cm_hopper',[_0x3c7d('0x2d'),_0x3c7d('0x2e')]))[_0x3c7d('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x3e0c05,_0x3643f8,_0x495565,_0x3c7d('0x20'),['\x22always\x22'])))['toString']();}function insertCmHopperBlack(_0x4c272e,_0x1be227,_0x145b60,_0x30eea1){var _0x57768e=[_0x3c7d('0x17'),'cm_contacts.id','cm_contacts.ListId',_0x1be227+'.'+_0x30eea1,_0x3c7d('0x1b'),'cm_contacts.updatedAt'];return squel['insert']()['into'](_0x3c7d('0x2f'))['fromQuery']([_0x3c7d('0x11'),_0x3c7d('0x30'),_0x3c7d('0x23'),_0x30eea1,_0x3c7d('0x31'),_0x3c7d('0x24')],squel[_0x3c7d('0x27')]()[_0x3c7d('0x28')](_0x57768e)[_0x3c7d('0x29')](_0x1be227)[_0x3c7d('0x12')](_0x3c7d('0x32'),null,'cm_contacts.ListId\x20=\x20'+_0x1be227+'.CmListId')[_0x3c7d('0x12')](_0x145b60,null,_0x145b60+'.id\x20=\x20'+_0x1be227+'.'+_0x30eea1)[_0x3c7d('0x14')](_0x1be227+_0x3c7d('0x2b'),_0x4c272e)[_0x3c7d('0x14')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x3c7d('0x14')](_0x3c7d('0x2c'),squel[_0x3c7d('0x27')]()[_0x3c7d('0x10')](_0x3c7d('0x11'))[_0x3c7d('0x29')](_0x3c7d('0x2f'))[_0x3c7d('0x14')](_0x3c7d('0x33'),_0x4c272e)[_0x3c7d('0x14')](_0x30eea1+'\x20=\x20?',_0x1be227+'.'+_0x30eea1)))[_0x3c7d('0x34')]();}function insertTzCmHopper(_0x3929a9,_0x235396,_0x287f16,_0x392267,_0x30d636,_0x2c48b5){var _0x1904d4=[_0x3c7d('0x17'),_0x3c7d('0x35')+_0x2c48b5+_0x3c7d('0x36'),'cm_contacts.id',_0x3c7d('0x1a'),_0x235396+'.'+_0x392267,_0x3c7d('0x1b'),_0x3c7d('0x1c'),'cm_contacts.priority','cm_contacts.UserId','\x22'+_0x30d636+'\x22'];var _0x421c44=squel[_0x3c7d('0x37')]()['into']('cm_hopper')[_0x3c7d('0x21')]([_0x3c7d('0x11'),_0x3c7d('0x22'),_0x3c7d('0x30'),'ListId',_0x392267,'createdAt',_0x3c7d('0x24'),_0x3c7d('0x38'),_0x3c7d('0x25'),_0x3c7d('0x26')],squel[_0x3c7d('0x27')]()[_0x3c7d('0x28')](_0x1904d4)[_0x3c7d('0x29')](_0x235396)[_0x3c7d('0x12')]('cm_contacts',null,_0x3c7d('0x2a')+_0x235396+_0x3c7d('0x39'))['join'](_0x287f16,null,_0x287f16+_0x3c7d('0x13')+_0x235396+'.'+_0x392267)[_0x3c7d('0x12')](_0x2c48b5,null,_0x2c48b5+_0x3c7d('0x13')+_0x235396+'.'+_0x392267)[_0x3c7d('0x14')](_0x235396+_0x3c7d('0x2b'),_0x3929a9)[_0x3c7d('0x14')](_0x3c7d('0x3a'),NOW)[_0x3c7d('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x235396,_0x287f16,_0x392267,_0x3c7d('0x20'),['\x22always\x22',_0x3c7d('0x2e')]))[_0x3c7d('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x235396,_0x287f16,_0x392267,_0x3c7d('0x20'),[_0x3c7d('0x2d')])))['toString']();return _0x421c44;}function insertTzCmHopperBlack(_0x32ff69,_0x3c3022,_0x16d649,_0x42d221){var _0x4e0718=[_0x3c7d('0x17'),_0x3c7d('0x19'),_0x3c7d('0x1a'),_0x3c3022+'.'+_0x42d221,_0x3c7d('0x1b'),_0x3c7d('0x1c')];return squel['insert']()[_0x3c7d('0x1f')]('cm_hopper_black')[_0x3c7d('0x21')]([_0x3c7d('0x11'),_0x3c7d('0x30'),'ListId',_0x42d221,_0x3c7d('0x31'),_0x3c7d('0x24')],squel[_0x3c7d('0x27')]()[_0x3c7d('0x28')](_0x4e0718)[_0x3c7d('0x29')](_0x3c3022)['join'](_0x3c7d('0x32'),null,_0x3c7d('0x2a')+_0x3c3022+_0x3c7d('0x39'))[_0x3c7d('0x12')](_0x16d649,null,_0x16d649+'.id\x20=\x20'+_0x3c3022+'.'+_0x42d221)['where'](_0x3c3022+'.CmListId\x20=\x20?',_0x32ff69)[_0x3c7d('0x14')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x3c7d('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x3c7d('0x27')]()[_0x3c7d('0x10')]('phone')[_0x3c7d('0x29')](_0x3c7d('0x2f'))[_0x3c7d('0x14')]('ListId\x20=\x20?',_0x32ff69)[_0x3c7d('0x14')](_0x42d221+'\x20=\x20?',_0x3c3022+'.'+_0x42d221)))['toString']();}function insertCmContact(_0x40c228,_0x598a23,_0x37a5ee,_0x2a556f){var _0x611084=_['concat'](_[_0x3c7d('0x3b')](_0x2a556f),[_0x3c7d('0x23'),_0x3c7d('0x3c'),_0x3c7d('0x31'),_0x3c7d('0x24')]);return squel[_0x3c7d('0x37')]()[_0x3c7d('0x1f')](_0x3c7d('0x32'))['fromQuery'](_0x611084,squel[_0x3c7d('0x27')]()[_0x3c7d('0x28')](_0x611084)[_0x3c7d('0x29')](_0x598a23)[_0x3c7d('0x14')]('('+_0x37a5ee[_0x3c7d('0x12')](',')+')\x20NOT\x20IN\x20?',squel[_0x3c7d('0x27')]()[_0x3c7d('0x28')](_0x37a5ee)['from']('cm_contacts')['where'](_0x3c7d('0x33'),_0x40c228)['where'](_0x3c7d('0x3d')))[_0x3c7d('0x14')](_0x3c7d('0x3e'),squel[_0x3c7d('0x27')]()[_0x3c7d('0x10')](_0x3c7d('0x3f'),_0x3c7d('0x40'))[_0x3c7d('0x29')](_0x598a23)['group'](_0x37a5ee[_0x3c7d('0x12')](','))))[_0x3c7d('0x34')]();}function handleStop(){logger['info']('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0xadb1ab){logger['error'](_0xadb1ab['message']);process[_0x3c7d('0x41')](0x1);}function handleError(_0x1a4356,_0x1f9fab){stats['errors'][_0x3c7d('0x42')]({'name':_0x1f9fab[_0x3c7d('0x43')],'message':_0x1f9fab[_0x3c7d('0x44')],'row':_0x1a4356});}function handleQuery(_0x3e33f2){logger[_0x3c7d('0x45')](_0x3e33f2);return db[_0x3c7d('0x46')][_0x3c7d('0x47')](_0x3e33f2)[_0x3c7d('0x48')](function(_0x108077){results[_0x3c7d('0x42')](_0x108077);})[_0x3c7d('0x49')](function(_0x41967c){logger[_0x3c7d('0x4a')](_0x41967c['message']);});}function updateTzCampaigns(_0x38aaca){return new Promise(function(_0x57a137,_0x5be268){var _0x461064=squel[_0x3c7d('0x27')]()[_0x3c7d('0x28')]([_0x3c7d('0x4b'),_0x3c7d('0x4c')])[_0x3c7d('0x29')](_0x3c7d('0x4d'))[_0x3c7d('0x12')](_0x3c7d('0x4e'),null,'campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId')[_0x3c7d('0x14')](_0x3c7d('0x4f')+_0x38aaca);db[_0x3c7d('0x46')]['query'](_0x461064[_0x3c7d('0x34')]())[_0x3c7d('0x48')](function(_0x21ae9b){var _0xe46101=[];for(var _0x1b8e72=0x0;_0x1b8e72<_0x21ae9b['length'];_0x1b8e72++){_0xe46101[_0x3c7d('0x42')](getTimezoneData(_0x21ae9b[_0x1b8e72],tmp_campaigns));}BPromise[_0x3c7d('0x50')](_0xe46101)[_0x3c7d('0x51')](function(){_0x57a137({'val':0x1});});})[_0x3c7d('0x49')](function(_0x30db93){logger[_0x3c7d('0x4a')](_0x30db93[_0x3c7d('0x44')]);_0x57a137({'val':0x0});});});}function updateTzVoiceQueues(_0x505abc){return new Promise(function(_0x3f3dbe,_0x2c3a72){var _0x24fc1a=squel[_0x3c7d('0x27')]()[_0x3c7d('0x28')]([_0x3c7d('0x52'),_0x3c7d('0x53')])[_0x3c7d('0x29')](_0x3c7d('0x54'))[_0x3c7d('0x12')]('voice_queues_has_cm_lists',null,_0x3c7d('0x55'))['where'](_0x3c7d('0x56')+_0x505abc);db[_0x3c7d('0x46')][_0x3c7d('0x47')](_0x24fc1a[_0x3c7d('0x34')]())[_0x3c7d('0x48')](function(_0x5bd624){var _0x3de16a=[];for(var _0x48a2e6=0x0;_0x48a2e6<_0x5bd624[_0x3c7d('0x57')];_0x48a2e6++){_0x3de16a['push'](getTimezoneData(_0x5bd624[_0x48a2e6],tmp_voice_queues));}BPromise[_0x3c7d('0x50')](_0x3de16a)[_0x3c7d('0x51')](function(){_0x3f3dbe({'val':0x1});});})[_0x3c7d('0x49')](function(_0x2aad9e){logger[_0x3c7d('0x4a')](_0x2aad9e['message']);_0x3f3dbe({'val':0x0});});});}function getTimezoneData(_0x3fb50d,_0x2d01dc){return new Promise(function(_0x569edd,_0xb95f0){var _0x16fa0b=shared[_0x3c7d('0x58')];var _0x4c319b=_0x16fa0b[_0x3fb50d[_0x3c7d('0x59')]];if(_[_0x3c7d('0x5a')](_0x4c319b)){_0x569edd({'ret':0x1});}else{var _0x568d50=_0x4c319b[_0x3c7d('0x5b')];var _0x37611d=squel[_0x3c7d('0x37')]()[_0x3c7d('0x1f')](_0x2d01dc)[_0x3c7d('0x5c')]('id',_0x3fb50d['id'])['set'](_0x3c7d('0x5d'),_0x568d50)[_0x3c7d('0x5c')](_0x3c7d('0x59'),_0x3fb50d['dialTimezone'])[_0x3c7d('0x34')]();return db[_0x3c7d('0x46')]['query'](_0x37611d)[_0x3c7d('0x48')](function(_0x52f7e1){_0x569edd({'ret':0x1});})[_0x3c7d('0x49')](function(_0x36a95b){logger[_0x3c7d('0x4a')](_0x36a95b[_0x3c7d('0x44')]);_0xb95f0({'ret':0x1});});}});}function handleTZQuery(_0x2cef35){logger['info'](_0x2cef35);return db[_0x3c7d('0x46')][_0x3c7d('0x47')](_0x2cef35)['spread'](function(_0x5f1107){})[_0x3c7d('0x49')](function(_0x3f9920){logger['error'](_0x3f9920['message']);});}function main(_0x7cf5ed,_0x1ce254,_0x3f84a7,_0x19c269){logger[_0x3c7d('0x45')](_0x3c7d('0x5e'),_0x7cf5ed,JSON[_0x3c7d('0x5f')](_0x1ce254));process[_0x3c7d('0x60')](_0x3c7d('0x61'));var _0x39ca84=_0x1ce254[_0x3c7d('0x62')];var _0x5bc1c0=_0x1ce254[_0x3c7d('0x63')];var _0x1c0b18=path['join'](config[_0x3c7d('0x64')],_0x3c7d('0x65'),_0x5bc1c0+'.csv');hasTZ=_[_0x3c7d('0x3b')](_0x39ca84)['includes'](_0x3c7d('0x59'));var _0x4a3e02=_[_0x3c7d('0x3b')](_0x39ca84)[_0x3c7d('0x12')]();logger[_0x3c7d('0x45')]('header',_0x4a3e02);if(hasTZ)_0x4a3e02+=_0x3c7d('0x66');fs[_0x3c7d('0x67')](_0x1c0b18,_0x4a3e02+'\x0a');Papa[_0x3c7d('0x68')](fs['createReadStream'](_0x7cf5ed),{'header':!![],'skipEmptyLines':!![],'step':function(_0x21f8c2,_0x3c6281){try{for(var _0xcc3754=0x0,_0x316ab7=[];_0xcc3754<_0x21f8c2['data']['length'];_0xcc3754++){stats[_0x3c7d('0x69')]+=0x1;if(_0x21f8c2[_0x3c7d('0x6a')][_0xcc3754]){handleError(_0x21f8c2[_0x3c7d('0x6b')][_0xcc3754],_0x21f8c2['errors'][_0xcc3754]);}else{var _0x57cf27=[];for(var _0x1252ea in _0x39ca84){if(_0x39ca84[_0x3c7d('0x6c')](_0x1252ea)){if(_0x21f8c2[_0x3c7d('0x6b')][_0xcc3754][_0x39ca84[_0x1252ea]]){var _0x54f167=_[_0x3c7d('0x6d')](_0x21f8c2[_0x3c7d('0x6b')][_0xcc3754][_0x39ca84[_0x1252ea]][_0x3c7d('0x6e')](/"/g,'\x27'));switch(_0x1252ea){case _0x3c7d('0x22'):var _0x1ce036=moment(_0x54f167,_0x3c7d('0xe'),!![]);if(_0x1ce036[_0x3c7d('0x6f')]()){_0x316ab7[_0x3c7d('0x42')]('\x22'+_0x54f167+'\x22');}else{_0x57cf27[_0x3c7d('0x42')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x3c7d('0x38'):var _0x451885=parseInt(_0x54f167);_0x54f167=_[_0x3c7d('0x70')](_0x451885)||_0x451885<0x0||_0x451885>0x4?_0x19c269?0x3:0x2:_0x451885;_0x316ab7['push']('\x22'+_0x54f167+'\x22');break;case _0x3c7d('0x25'):var _0x48ee97=parseInt(_0x54f167);if(_[_0x3c7d('0x71')](_0x48ee97)&&_[_0x3c7d('0x72')](_0x3f84a7,_0x48ee97)){_0x316ab7['push']('\x22'+_0x48ee97+'\x22');}else{_0x57cf27[_0x3c7d('0x42')]('agent\x20not\x20exists');}break;case'email':if(isEmail(_0x54f167)){_0x316ab7['push']('\x22'+_0x54f167+'\x22');}else{_0x57cf27[_0x3c7d('0x42')](_0x3c7d('0x73'));}break;case _0x3c7d('0x74'):var _0x23b156=moment(_0x54f167,_0x3c7d('0x75'),!![]);if(_0x23b156[_0x3c7d('0x6f')]()){_0x316ab7['push']('\x22'+_0x54f167+'\x22');}else{_0x57cf27[_0x3c7d('0x42')](_0x3c7d('0x76'));}break;case _0x3c7d('0x59'):var _0x5012fd=shared[_0x3c7d('0x58')];var _0x1cbe92=_0x5012fd[_0x54f167];if(!_[_0x3c7d('0x5a')](_0x1cbe92)){var _0xa80e88=_0x1cbe92[_0x3c7d('0x5b')];_0x316ab7['push']('\x22'+_0x54f167+'\x22');_0x316ab7[_0x3c7d('0x42')]('\x22'+_0xa80e88+'\x22');}break;default:_0x316ab7['push']('\x22'+_0x54f167+'\x22');}}else{switch(_0x1252ea){case _0x3c7d('0x77'):case'phone':_0x57cf27[_0x3c7d('0x42')](_0x1252ea+_0x3c7d('0x78'));break;default:_0x316ab7[_0x3c7d('0x42')]('\x22\x22');}}}}if(_0x57cf27[_0x3c7d('0x57')]){handleError(_0x21f8c2[_0x3c7d('0x6b')][_0xcc3754],{'code':'SystemRow','message':_0x57cf27[_0x3c7d('0x12')]()});}else{fs[_0x3c7d('0x79')](_0x1c0b18,_0x316ab7['join']()+'\x0a');}_0x316ab7=[];}if(!(stats[_0x3c7d('0x69')]%0xc8)){socket['emit'](_0x3c7d('0x7a')+_0x5bc1c0,stats);stats[_0x3c7d('0x6a')]=[];}}if(stopped){logger['info'](_0x3c7d('0x7b'));_0x3c6281['abort']();}}catch(_0x33aead){handleError(_0x21f8c2[_0x3c7d('0x6b')][_0xcc3754],{'code':_0x3c7d('0x7c'),'message':_0x33aead['message']});logger[_0x3c7d('0x4a')](_0x3c7d('0x7d'),_0x33aead['message']);}},'complete':function(){try{var _0x595e14=[];var _0x183aad=[];var _0x5d1309=_0x3c7d('0x32');if(_0x1ce254['duplicates']&&_0x1ce254[_0x3c7d('0x7e')][_0x3c7d('0x57')]){_0x5d1309=_0x3c7d('0x7f')+_0x5bc1c0;_0x595e14[_0x3c7d('0x42')](_0x3c7d('0x80')+_0x5d1309+_0x3c7d('0x81'));}tmp_campaigns=_0x3c7d('0x82')+_0x5bc1c0;tmp_voice_queues=_0x3c7d('0x83')+_0x5bc1c0;_0x183aad[_0x3c7d('0x42')](_0x3c7d('0x80')+tmp_campaigns+_0x3c7d('0x84'));_0x183aad[_0x3c7d('0x42')]('CREATE\x20TABLE\x20'+tmp_voice_queues+_0x3c7d('0x84'));BPromise[_0x3c7d('0x85')](_0x183aad,handleTZQuery)[_0x3c7d('0x51')](function(_0x1eeb2d){updateTzCampaigns(_0x1ce254[_0x3c7d('0x23')])['then'](function(_0x1d04f4){updateTzVoiceQueues(_0x1ce254[_0x3c7d('0x23')])['then'](function(_0x264608){var _0x15ee1a=util[_0x3c7d('0x86')](_0x3c7d('0x87'),_0x1c0b18,_0x5d1309,_0x4a3e02,_0x1ce254[_0x3c7d('0x23')],_0x1ce254[_0x3c7d('0x3c')]||null,NOW,NOW);if(_[_0x3c7d('0x5a')](_0x39ca84['scheduledat'])){_0x15ee1a+=_0x3c7d('0x88');}_0x595e14[_0x3c7d('0x42')](_0x15ee1a);if(_0x1ce254[_0x3c7d('0x7e')]&&_0x1ce254[_0x3c7d('0x7e')]['length']){_0x595e14[_0x3c7d('0x42')](insertCmContact(_0x1ce254[_0x3c7d('0x23')],_0x5d1309,_0x1ce254[_0x3c7d('0x7e')],_0x39ca84));_0x595e14[_0x3c7d('0x42')](_0x3c7d('0x89')+_0x5d1309+';');}if(hasTZ){_0x595e14[_0x3c7d('0x42')](insertTzCmHopper(_0x1ce254[_0x3c7d('0x23')],_0x3c7d('0x8a'),'voice_queues',_0x3c7d('0x8b'),_0x19c269,tmp_voice_queues));_0x595e14[_0x3c7d('0x42')](insertTzCmHopperBlack(_0x1ce254['ListId'],_0x3c7d('0x8c'),'voice_queues',_0x3c7d('0x8b')));_0x595e14[_0x3c7d('0x42')](insertTzCmHopper(_0x1ce254[_0x3c7d('0x23')],_0x3c7d('0x4e'),_0x3c7d('0x4d'),_0x3c7d('0x8d'),_0x19c269,tmp_campaigns));_0x595e14[_0x3c7d('0x42')](insertTzCmHopperBlack(_0x1ce254[_0x3c7d('0x23')],_0x3c7d('0x8e'),'campaigns',_0x3c7d('0x8d')));}else{_0x595e14['push'](insertCmHopper(_0x1ce254[_0x3c7d('0x23')],_0x3c7d('0x8a'),_0x3c7d('0x54'),_0x3c7d('0x8b'),_0x19c269));_0x595e14[_0x3c7d('0x42')](insertCmHopperBlack(_0x1ce254[_0x3c7d('0x23')],_0x3c7d('0x8c'),_0x3c7d('0x54'),_0x3c7d('0x8b')));_0x595e14[_0x3c7d('0x42')](insertCmHopper(_0x1ce254['ListId'],_0x3c7d('0x4e'),'campaigns',_0x3c7d('0x8d'),_0x19c269));_0x595e14[_0x3c7d('0x42')](insertCmHopperBlack(_0x1ce254[_0x3c7d('0x23')],_0x3c7d('0x8e'),'campaigns',_0x3c7d('0x8d')));}_0x595e14[_0x3c7d('0x42')]('DROP\x20TABLE\x20'+tmp_campaigns+';');_0x595e14[_0x3c7d('0x42')](_0x3c7d('0x89')+tmp_voice_queues+';');BPromise[_0x3c7d('0x85')](_0x595e14,handleQuery)[_0x3c7d('0x51')](function(_0x1b98a2){stats['finish']=!![];stats[_0x3c7d('0x8f')]=_0x1ce254[_0x3c7d('0x7e')]&&_0x1ce254['duplicates']['length']?results[0x2][_0x3c7d('0x8f')]:results[0x0][_0x3c7d('0x8f')];socket[_0x3c7d('0x90')](_0x3c7d('0x7a')+_0x5bc1c0,stats);fs[_0x3c7d('0x91')](_0x7cf5ed);fs[_0x3c7d('0x91')](_0x1c0b18);process[_0x3c7d('0x41')](0x0);})[_0x3c7d('0x49')](function(_0x228e79){logger[_0x3c7d('0x4a')](_0x228e79[_0x3c7d('0x44')]);process[_0x3c7d('0x41')](0x1);});});});});}catch(_0x8658c3){logger[_0x3c7d('0x4a')](_0x3c7d('0x92'),_0x8658c3['message']);process[_0x3c7d('0x41')](0x1);}},'error':function(_0x3befc3,_0x4ab7af,_0x14aff7,_0x4e2c31){throw new Error(_0x4e2c31);}});}function validate(){if(process['argv']&&process[_0x3c7d('0x93')]['length']<0x4){throw new Error('arguments\x20\x20\x20');}var _0x5ad354=path['join'](config['root'],_0x3c7d('0x65'),process[_0x3c7d('0x93')][0x2]);if(!fs['existsSync'](_0x5ad354)){throw new Error(_0x3c7d('0x94'));}var _0x3bfe97={};try{_0x3bfe97=JSON[_0x3c7d('0x68')](process['argv'][0x3]);if(!_0x3bfe97[_0x3c7d('0x62')]){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x3bfe97['binding'][_0x3c7d('0x11')]){throw new Error(_0x3c7d('0x95'));}if(!_0x3bfe97['binding']['firstName']){throw new Error('firstName\x20is\x20mandatory');}var _0x57a81f=0x0;if(_0x3bfe97['binding']['UserId']){_0x57a81f=0x1;}if(!_0x3bfe97[_0x3c7d('0x23')]){throw new Error(_0x3c7d('0x96'));}}catch(_0x2a2e13){throw new Error('body\x20id\x20mandatory');}var _0x39166a=[];try{_0x39166a=_[_0x3c7d('0x97')](JSON[_0x3c7d('0x68')](process['argv'][0x4]),'id');}catch(_0x5cacaa){logger['info'](_0x3c7d('0x98'));}main(_0x5ad354,_0x3bfe97,_0x39166a,_0x57a81f);}validate();process['on'](_0x3c7d('0x99'),handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 95efc3e..56991f4 100644 --- a/server/components/integrations/configuration.js +++ b/server/components/integrations/configuration.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4a5d=['duration','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','inbound','push','variable','queue','Outbound\x20Call','destcalleridnum','getDescriptions','voice','***\x20Call\x20Info\x20***','Caller\x20Number','calleridnum','Caller\x20Name','calleridname','keyValue','Call\x20To','destexten','Queue','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','holdtime','Talk\x20Time','talktime','outbound','answertime','Complete\x20Time','endtime'];(function(_0x5f40e4,_0x1d70d9){var _0x23ffb3=function(_0x3ea9f0){while(--_0x3ea9f0){_0x5f40e4['push'](_0x5f40e4['shift']());}};_0x23ffb3(++_0x1d70d9);}(_0x4a5d,0x104));var _0xd4a5=function(_0x2d91c6,_0x10ae0e){_0x2d91c6=_0x2d91c6-0x0;var _0x3a8d19=_0x4a5d[_0x2d91c6];return _0x3a8d19;};'use strict';exports[_0xd4a5('0x0')]=function(_0x23771c,_0x11c2d5){var _0x293ff3=[{'type':_0xd4a5('0x1'),'content':_0xd4a5('0x2'),'variableName':null}];switch(_0x23771c[_0xd4a5('0x3')]()){case'voice':switch(_0x11c2d5[_0xd4a5('0x3')]()){case _0xd4a5('0x4'):_0x293ff3[_0xd4a5('0x5')]({'type':_0xd4a5('0x6'),'content':'','variableName':_0xd4a5('0x7')});_0x293ff3['push']({'type':_0xd4a5('0x6'),'content':'','variableName':'calleridnum'});break;case'outbound':_0x293ff3[_0xd4a5('0x5')]({'type':_0xd4a5('0x1'),'content':_0xd4a5('0x8'),'variableName':null});_0x293ff3[_0xd4a5('0x5')]({'type':_0xd4a5('0x6'),'content':'','variableName':_0xd4a5('0x9')});break;}}return _0x293ff3;};exports[_0xd4a5('0xa')]=function(_0x426467,_0x40fd89){var _0x30ef80=[];switch(_0x426467[_0xd4a5('0x3')]()){case _0xd4a5('0xb'):switch(_0x40fd89[_0xd4a5('0x3')]()){case _0xd4a5('0x4'):_0x30ef80=[{'type':_0xd4a5('0x1'),'content':_0xd4a5('0xc'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xd4a5('0xd'),'keyType':_0xd4a5('0x6'),'variableName':_0xd4a5('0xe')},{'type':'keyValue','content':'','key':_0xd4a5('0xf'),'keyType':_0xd4a5('0x6'),'variableName':_0xd4a5('0x10')},{'type':_0xd4a5('0x11'),'content':'','key':_0xd4a5('0x12'),'keyType':_0xd4a5('0x6'),'variableName':_0xd4a5('0x13')},{'type':'keyValue','content':'','key':_0xd4a5('0x14'),'keyType':_0xd4a5('0x6'),'variableName':_0xd4a5('0x7')},{'type':'keyValue','content':'','key':_0xd4a5('0x15'),'keyType':_0xd4a5('0x6'),'variableName':_0xd4a5('0x16')},{'type':'keyValue','content':'','key':_0xd4a5('0x17'),'keyType':_0xd4a5('0x6'),'variableName':_0xd4a5('0x18')},{'type':_0xd4a5('0x1'),'content':_0xd4a5('0x19'),'key':null,'keyType':null,'variableName':null},{'type':_0xd4a5('0x11'),'content':'','key':_0xd4a5('0x1a'),'keyType':_0xd4a5('0x6'),'variableName':_0xd4a5('0x1b')},{'type':'keyValue','content':'','key':_0xd4a5('0x1c'),'keyType':_0xd4a5('0x6'),'variableName':'destcalleridnum'},{'type':_0xd4a5('0x1'),'content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xd4a5('0x1d'),'keyType':_0xd4a5('0x6'),'variableName':_0xd4a5('0x18')},{'type':_0xd4a5('0x11'),'content':'','key':_0xd4a5('0x1e'),'keyType':_0xd4a5('0x6'),'variableName':_0xd4a5('0x1f')},{'type':_0xd4a5('0x11'),'content':'','key':_0xd4a5('0x20'),'keyType':_0xd4a5('0x6'),'variableName':_0xd4a5('0x21')},{'type':'keyValue','content':'','key':'Hold\x20Time','keyType':_0xd4a5('0x6'),'variableName':_0xd4a5('0x22')},{'type':_0xd4a5('0x11'),'content':'','key':_0xd4a5('0x23'),'keyType':_0xd4a5('0x6'),'variableName':_0xd4a5('0x24')}];break;case _0xd4a5('0x25'):_0x30ef80=[{'type':_0xd4a5('0x1'),'content':_0xd4a5('0xc'),'variableName':null},{'type':_0xd4a5('0x11'),'content':'','key':'Called\x20Number','keyType':_0xd4a5('0x6'),'keyContent':'','variableName':_0xd4a5('0x9')},{'type':_0xd4a5('0x11'),'content':'','key':'Member\x20Name','keyType':_0xd4a5('0x6'),'keyContent':'','variableName':'membername'},{'type':_0xd4a5('0x11'),'content':'','key':'UniqueId','keyType':_0xd4a5('0x6'),'keyContent':'','variableName':_0xd4a5('0x16')},{'type':'keyValue','content':'','key':'Date','keyType':_0xd4a5('0x6'),'keyContent':'','variableName':'starttime'},{'type':'string','content':'***\x20Time\x20Info\x20***'},{'type':_0xd4a5('0x11'),'content':'','key':'Answer\x20Time','keyType':'variable','keyContent':'','variableName':_0xd4a5('0x26')},{'type':'keyValue','content':'','key':_0xd4a5('0x27'),'keyType':_0xd4a5('0x6'),'keyContent':'','variableName':_0xd4a5('0x28')},{'type':_0xd4a5('0x11'),'content':'','key':'Duration','keyType':'variable','keyContent':'','variableName':_0xd4a5('0x29')},{'type':_0xd4a5('0x11'),'content':'','key':'Billable\x20Time','keyType':_0xd4a5('0x6'),'keyContent':'','variableName':_0xd4a5('0x2a')}];break;}}return _0x30ef80;}; \ No newline at end of file +var _0x3bc1=['outbound','Outbound\x20Call','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Connect','agentconnectAt','Hold\x20Time','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','starttime','Answer\x20Time','answertime','Duration','duration','Billable\x20Time','billableseconds','getSubjects','string','toLowerCase','voice','inbound','push','queue','variable','calleridnum'];(function(_0x493f39,_0x26a8b8){var _0x5e9dcd=function(_0x5046f8){while(--_0x5046f8){_0x493f39['push'](_0x493f39['shift']());}};_0x5e9dcd(++_0x26a8b8);}(_0x3bc1,0x78));var _0x13bc=function(_0x279591,_0x38ba17){_0x279591=_0x279591-0x0;var _0x268377=_0x3bc1[_0x279591];return _0x268377;};'use strict';exports[_0x13bc('0x0')]=function(_0x5c8a35,_0x39b233){var _0x51ad6b=[{'type':_0x13bc('0x1'),'content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x5c8a35[_0x13bc('0x2')]()){case _0x13bc('0x3'):switch(_0x39b233[_0x13bc('0x2')]()){case _0x13bc('0x4'):_0x51ad6b[_0x13bc('0x5')]({'type':'variable','content':'','variableName':_0x13bc('0x6')});_0x51ad6b[_0x13bc('0x5')]({'type':_0x13bc('0x7'),'content':'','variableName':_0x13bc('0x8')});break;case _0x13bc('0x9'):_0x51ad6b[_0x13bc('0x5')]({'type':_0x13bc('0x1'),'content':_0x13bc('0xa'),'variableName':null});_0x51ad6b['push']({'type':_0x13bc('0x7'),'content':'','variableName':_0x13bc('0xb')});break;}}return _0x51ad6b;};exports[_0x13bc('0xc')]=function(_0x5d39ed,_0x364542){var _0x1b2a5b=[];switch(_0x5d39ed[_0x13bc('0x2')]()){case'voice':switch(_0x364542['toLowerCase']()){case _0x13bc('0x4'):_0x1b2a5b=[{'type':_0x13bc('0x1'),'content':_0x13bc('0xd'),'key':null,'keyType':null,'variableName':null},{'type':_0x13bc('0xe'),'content':'','key':_0x13bc('0xf'),'keyType':_0x13bc('0x7'),'variableName':_0x13bc('0x8')},{'type':_0x13bc('0xe'),'content':'','key':_0x13bc('0x10'),'keyType':_0x13bc('0x7'),'variableName':_0x13bc('0x11')},{'type':_0x13bc('0xe'),'content':'','key':_0x13bc('0x12'),'keyType':_0x13bc('0x7'),'variableName':_0x13bc('0x13')},{'type':_0x13bc('0xe'),'content':'','key':_0x13bc('0x14'),'keyType':'variable','variableName':_0x13bc('0x6')},{'type':_0x13bc('0xe'),'content':'','key':_0x13bc('0x15'),'keyType':'variable','variableName':_0x13bc('0x16')},{'type':_0x13bc('0xe'),'content':'','key':_0x13bc('0x17'),'keyType':_0x13bc('0x7'),'variableName':_0x13bc('0x18')},{'type':_0x13bc('0x1'),'content':_0x13bc('0x19'),'key':null,'keyType':null,'variableName':null},{'type':_0x13bc('0xe'),'content':'','key':_0x13bc('0x1a'),'keyType':_0x13bc('0x7'),'variableName':'destcalleridname'},{'type':_0x13bc('0xe'),'content':'','key':_0x13bc('0x1b'),'keyType':'variable','variableName':_0x13bc('0xb')},{'type':'string','content':_0x13bc('0x1c'),'key':null,'keyType':null,'variableName':null},{'type':_0x13bc('0xe'),'content':'','key':'Agent\x20Ring','keyType':_0x13bc('0x7'),'variableName':_0x13bc('0x18')},{'type':_0x13bc('0xe'),'content':'','key':_0x13bc('0x1d'),'keyType':_0x13bc('0x7'),'variableName':_0x13bc('0x1e')},{'type':_0x13bc('0xe'),'content':'','key':'Agent\x20Complete','keyType':_0x13bc('0x7'),'variableName':'agentcompleteAt'},{'type':_0x13bc('0xe'),'content':'','key':_0x13bc('0x1f'),'keyType':_0x13bc('0x7'),'variableName':'holdtime'},{'type':_0x13bc('0xe'),'content':'','key':_0x13bc('0x20'),'keyType':_0x13bc('0x7'),'variableName':_0x13bc('0x21')}];break;case _0x13bc('0x9'):_0x1b2a5b=[{'type':_0x13bc('0x1'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0x13bc('0xe'),'content':'','key':_0x13bc('0x22'),'keyType':'variable','keyContent':'','variableName':_0x13bc('0xb')},{'type':_0x13bc('0xe'),'content':'','key':_0x13bc('0x23'),'keyType':_0x13bc('0x7'),'keyContent':'','variableName':'membername'},{'type':'keyValue','content':'','key':'UniqueId','keyType':_0x13bc('0x7'),'keyContent':'','variableName':_0x13bc('0x16')},{'type':_0x13bc('0xe'),'content':'','key':_0x13bc('0x17'),'keyType':'variable','keyContent':'','variableName':_0x13bc('0x24')},{'type':_0x13bc('0x1'),'content':'***\x20Time\x20Info\x20***'},{'type':_0x13bc('0xe'),'content':'','key':_0x13bc('0x25'),'keyType':_0x13bc('0x7'),'keyContent':'','variableName':_0x13bc('0x26')},{'type':'keyValue','content':'','key':'Complete\x20Time','keyType':_0x13bc('0x7'),'keyContent':'','variableName':'endtime'},{'type':_0x13bc('0xe'),'content':'','key':_0x13bc('0x27'),'keyType':'variable','keyContent':'','variableName':_0x13bc('0x28')},{'type':_0x13bc('0xe'),'content':'','key':_0x13bc('0x29'),'keyType':_0x13bc('0x7'),'keyContent':'','variableName':_0x13bc('0x2a')}];break;}}return _0x1b2a5b;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index aff2819..bc50c57 100644 --- a/server/components/interaction/service.js +++ b/server/components/interaction/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xca9a=['body','omit','html','phone','fax','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','chat-interactions','whatsapp-interactions','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','stringify','upperFirst','Interaction','update','info','catch','error','clone'];(function(_0x39707e,_0x16067b){var _0x5d5edb=function(_0x4267e0){while(--_0x4267e0){_0x39707e['push'](_0x39707e['shift']());}};_0x5d5edb(++_0x16067b);}(_0xca9a,0x89));var _0xaca9=function(_0x43d674,_0x4256b8){_0x43d674=_0x43d674-0x0;var _0x285a64=_0xca9a[_0x43d674];return _0x285a64;};'use strict';var _=require('lodash');var db=require(_0xaca9('0x0'))['db'];var loggers={'openchannel':require(_0xaca9('0x1'))(_0xaca9('0x2')),'mail':require('../../config/logger')(_0xaca9('0x3')),'fax':require(_0xaca9('0x1'))(_0xaca9('0x4')),'sms':require(_0xaca9('0x1'))('sms-interactions'),'chat':require(_0xaca9('0x1'))(_0xaca9('0x5')),'whatsapp':require(_0xaca9('0x1'))(_0xaca9('0x6'))};function getInteractionId(_0x1740ef,_0x53b919,_0x17ca12){if(_0x1740ef&&_0x1740ef[_['upperFirst'](_0x17ca12)+'InteractionId']){return _0x1740ef[_['upperFirst'](_0x17ca12)+'InteractionId'];}else if(_0x1740ef&&_0x1740ef['id']){return _0x1740ef['id'];}else if(_0x53b919&&_0x53b919['id']){return _0x53b919['id'];}else{return'unknown';}}function log(_0x5684a4,_0x1d1a75,_0x13aec7,_0x1aab83,_0x103cd8,_0x577624){loggers[_0x103cd8['toLowerCase']()][_0x5684a4](_0xaca9('0x7'),_0x577624['toUpperCase'](),_0x1d1a75?_0x1d1a75['id']:null,_0x1d1a75?_0x1d1a75[_0xaca9('0x8')]:null,_0x1d1a75?_0x1d1a75['role']:null,getInteractionId(_0x13aec7,_0x1aab83,_0x103cd8),_0x13aec7?JSON[_0xaca9('0x9')](_0x13aec7):'null');}function updateUser(_0x39397e,_0x47497b,_0x7d0abe,_0x2e5595,_0x5dd107){db[_[_0xaca9('0xa')](_0x2e5595)+_0xaca9('0xb')]['findOne']({'where':{'id':getInteractionId(_0x47497b,_0x7d0abe,_0x2e5595)}})['then'](function(_0x3f9ba6){if(_0x3f9ba6){return _0x3f9ba6[_0xaca9('0xc')]({'UserId':_0x39397e?_0x39397e['id']:null});}})['then'](function(_0xfe602e){if(_0xfe602e){log(_0xaca9('0xd'),_0x39397e,_0x47497b,_0x7d0abe,_0x2e5595,_0x5dd107);}})[_0xaca9('0xe')](function(){log(_0xaca9('0xf'),_0x39397e,_0x47497b,_0x7d0abe,_0x2e5595,_0x5dd107);});}exports['tracked']=function(_0x567f0b,_0x34fc0a){return function(_0x2e982a,_0x486ffd,_0x338079){var _0x50e389=_0x2e982a['user'];var _0x11c857={};var _0x5ff1e0=_0x2e982a['query'];if(_0x11c857){_0x11c857=_[_0xaca9('0x10')](_0x2e982a[_0xaca9('0x11')]);_0x11c857=_[_0xaca9('0x12')](_0x11c857,['body',_0xaca9('0x13'),_0xaca9('0x14'),_0xaca9('0x15'),'mobile']);}updateUser(_0x50e389,_0x11c857,_0x5ff1e0,_0x567f0b,_0x34fc0a);_0x338079(null);};}; \ No newline at end of file +var _0xe478=['Interaction','findOne','then','update','info','catch','error','tracked','user','clone','body','omit','phone','fax','lodash','openchannel-interactions','../../config/logger','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','role','stringify','null'];(function(_0x1e751c,_0x1b5e02){var _0x5c9495=function(_0x314d54){while(--_0x314d54){_0x1e751c['push'](_0x1e751c['shift']());}};_0x5c9495(++_0x1b5e02);}(_0xe478,0x13a));var _0x8e47=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xe478[_0x2d2c16];return _0x53f2fb;};'use strict';var _=require(_0x8e47('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require('../../config/logger')(_0x8e47('0x1')),'mail':require(_0x8e47('0x2'))('mail-interactions'),'fax':require(_0x8e47('0x2'))(_0x8e47('0x3')),'sms':require(_0x8e47('0x2'))(_0x8e47('0x4')),'chat':require(_0x8e47('0x2'))(_0x8e47('0x5')),'whatsapp':require(_0x8e47('0x2'))(_0x8e47('0x6'))};function getInteractionId(_0xde819d,_0x189f37,_0xa82d69){if(_0xde819d&&_0xde819d[_[_0x8e47('0x7')](_0xa82d69)+_0x8e47('0x8')]){return _0xde819d[_['upperFirst'](_0xa82d69)+_0x8e47('0x8')];}else if(_0xde819d&&_0xde819d['id']){return _0xde819d['id'];}else if(_0x189f37&&_0x189f37['id']){return _0x189f37['id'];}else{return _0x8e47('0x9');}}function log(_0x14f063,_0xe6cbd8,_0x2332c9,_0x3d5aea,_0xc4d268,_0x26b562){loggers[_0xc4d268[_0x8e47('0xa')]()][_0x14f063](_0x8e47('0xb'),_0x26b562['toUpperCase'](),_0xe6cbd8?_0xe6cbd8['id']:null,_0xe6cbd8?_0xe6cbd8[_0x8e47('0xc')]:null,_0xe6cbd8?_0xe6cbd8[_0x8e47('0xd')]:null,getInteractionId(_0x2332c9,_0x3d5aea,_0xc4d268),_0x2332c9?JSON[_0x8e47('0xe')](_0x2332c9):_0x8e47('0xf'));}function updateUser(_0x1ed821,_0x52f0fe,_0x2b3319,_0x4e1a1b,_0x4b13ce){db[_[_0x8e47('0x7')](_0x4e1a1b)+_0x8e47('0x10')][_0x8e47('0x11')]({'where':{'id':getInteractionId(_0x52f0fe,_0x2b3319,_0x4e1a1b)}})[_0x8e47('0x12')](function(_0x550874){if(_0x550874){return _0x550874[_0x8e47('0x13')]({'UserId':_0x1ed821?_0x1ed821['id']:null});}})[_0x8e47('0x12')](function(_0x375985){if(_0x375985){log(_0x8e47('0x14'),_0x1ed821,_0x52f0fe,_0x2b3319,_0x4e1a1b,_0x4b13ce);}})[_0x8e47('0x15')](function(){log(_0x8e47('0x16'),_0x1ed821,_0x52f0fe,_0x2b3319,_0x4e1a1b,_0x4b13ce);});}exports[_0x8e47('0x17')]=function(_0x5aed51,_0x2350b0){return function(_0x4b69c4,_0x50743d,_0x533e1d){var _0x30955b=_0x4b69c4[_0x8e47('0x18')];var _0x344258={};var _0x561320=_0x4b69c4['query'];if(_0x344258){_0x344258=_[_0x8e47('0x19')](_0x4b69c4[_0x8e47('0x1a')]);_0x344258=_[_0x8e47('0x1b')](_0x344258,[_0x8e47('0x1a'),'html',_0x8e47('0x1c'),_0x8e47('0x1d'),'mobile']);}updateUser(_0x30955b,_0x344258,_0x561320,_0x5aed51,_0x2350b0);_0x533e1d(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index cbe9992..6e6bdd4 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 _0x5687=['../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','parse','use','License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','admin','user','crypto','composable-middleware'];(function(_0x29cd14,_0x245c40){var _0x4229d1=function(_0x1ef992){while(--_0x1ef992){_0x29cd14['push'](_0x29cd14['shift']());}};_0x4229d1(++_0x245c40);}(_0x5687,0xde));var _0x7568=function(_0x2c8972,_0x1aff63){_0x2c8972=_0x2c8972-0x0;var _0x5d1e22=_0x5687[_0x2c8972];return _0x5d1e22;};'use strict';var crypto=require(_0x7568('0x0'));var util=require('util');var compose=require(_0x7568('0x1'));var db=require(_0x7568('0x2'))['db'];var config=require(_0x7568('0x3'));function getValueFromLicense(_0xc82a80,_0x44d652){if(_0xc82a80&&_0x44d652){if(_0x44d652[_0x7568('0x4')]&&_0x44d652[_0x7568('0x5')]){var _0x140777=_0x44d652[_0x7568('0x4')];var _0xbb24f5=_0x44d652['license'];var _0x2744f5=_0x140777['split']('-')[0x4];var _0x4dafbf=_0x140777[_0x7568('0x6')]('-')[0x0];var _0x3871a4=crypto[_0x7568('0x7')](_0x7568('0x8'),util[_0x7568('0x9')](_0x7568('0xa'),_0x2744f5,_0x140777,_0x4dafbf));var _0x1933b4=_0x3871a4[_0x7568('0xb')](_0xbb24f5,_0x7568('0xc'),_0x7568('0xd'));_0x1933b4+=_0x3871a4[_0x7568('0xe')](_0x7568('0xd'));var _0x346ab5=JSON[_0x7568('0xf')](_0x1933b4);return _0x346ab5['hasOwnProperty'](_0xc82a80)?_0x346ab5[_0xc82a80]:null;}}return null;}function isLimit(_0x5f08e5,_0x151be7,_0x5e3d54,_0x41b501){var _0x2b1e16=_0x151be7;return compose()[_0x7568('0x10')](function(_0x58dbf1,_0x2c7f40,_0xc68afb){return db[_0x7568('0x11')][_0x7568('0x12')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x110fdb){var _0x5afb18=getValueFromLicense(_0x5f08e5,_0x110fdb);return _0x5afb18?_0x5afb18:_0x2b1e16;})[_0x7568('0x13')](function(_0x29049d){_0x2b1e16=_0x29049d;return _0x5e3d54[_0x7568('0x14')](_0x41b501);})['then'](function(_0x3ebbc5){if(_0x3ebbc5>=_0x2b1e16){return _0x2c7f40[_0x7568('0x15')](0x193)[_0x7568('0x16')]({'message':util['format'](_0x7568('0x17'),_0x5f08e5)});}_0xc68afb();})[_0x7568('0x18')](function(_0x35d9fc){_0xc68afb(_0x35d9fc);});});}function isUserLimit(){return isLimit(_0x7568('0x19'),0x1,db['User'],{'where':{'$or':[{'role':_0x7568('0x1a')},{'role':_0x7568('0x1b')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file +var _0xc047=['format','%s:%s:%s','update','base64','utf8','final','parse','hasOwnProperty','use','License','findOne','then','count','status','json','catch','users','User','admin','isUserLimit','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','aes-256-ctr'];(function(_0x3afe98,_0x368349){var _0x5e727c=function(_0x3dd1ef){while(--_0x3dd1ef){_0x3afe98['push'](_0x3afe98['shift']());}};_0x5e727c(++_0x368349);}(_0xc047,0x19c));var _0x7c04=function(_0x47ac8c,_0x54e1fb){_0x47ac8c=_0x47ac8c-0x0;var _0x5ad1ca=_0xc047[_0x47ac8c];return _0x5ad1ca;};'use strict';var crypto=require('crypto');var util=require(_0x7c04('0x0'));var compose=require(_0x7c04('0x1'));var db=require(_0x7c04('0x2'))['db'];var config=require(_0x7c04('0x3'));function getValueFromLicense(_0x3d1f1d,_0x31896e){if(_0x3d1f1d&&_0x31896e){if(_0x31896e[_0x7c04('0x4')]&&_0x31896e[_0x7c04('0x5')]){var _0x205ee0=_0x31896e[_0x7c04('0x4')];var _0x5d92bb=_0x31896e[_0x7c04('0x5')];var _0x102e98=_0x205ee0[_0x7c04('0x6')]('-')[0x4];var _0x4c9b42=_0x205ee0[_0x7c04('0x6')]('-')[0x0];var _0x2858d4=crypto['createDecipher'](_0x7c04('0x7'),util[_0x7c04('0x8')](_0x7c04('0x9'),_0x102e98,_0x205ee0,_0x4c9b42));var _0x42a1f5=_0x2858d4[_0x7c04('0xa')](_0x5d92bb,_0x7c04('0xb'),_0x7c04('0xc'));_0x42a1f5+=_0x2858d4[_0x7c04('0xd')]('utf8');var _0x1a1e0d=JSON[_0x7c04('0xe')](_0x42a1f5);return _0x1a1e0d[_0x7c04('0xf')](_0x3d1f1d)?_0x1a1e0d[_0x3d1f1d]:null;}}return null;}function isLimit(_0x23f520,_0x200274,_0x187d19,_0x2e3c5d){var _0x2260f8=_0x200274;return compose()[_0x7c04('0x10')](function(_0x297266,_0x29345e,_0xd41cf3){return db[_0x7c04('0x11')][_0x7c04('0x12')]({'where':{'id':0x1},'raw':!![]})[_0x7c04('0x13')](function(_0x2fa15d){var _0x2bb8eb=getValueFromLicense(_0x23f520,_0x2fa15d);return _0x2bb8eb?_0x2bb8eb:_0x2260f8;})['then'](function(_0xd9dd05){_0x2260f8=_0xd9dd05;return _0x187d19[_0x7c04('0x14')](_0x2e3c5d);})['then'](function(_0x2a64d9){if(_0x2a64d9>=_0x2260f8){return _0x29345e[_0x7c04('0x15')](0x193)[_0x7c04('0x16')]({'message':util['format']('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x23f520)});}_0xd41cf3();})[_0x7c04('0x17')](function(_0x2e6917){_0xd41cf3(_0x2e6917);});});}function isUserLimit(){return isLimit(_0x7c04('0x18'),0x1,db[_0x7c04('0x19')],{'where':{'$or':[{'role':_0x7c04('0x1a')},{'role':'user'}]}});}exports[_0x7c04('0x1b')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 4a66ac0..da1a197 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 _0x8257=['$eq','$between','includes','$lte','value','add','days','format','YYYY-MM-DD','text','CAST(','field','\x20AS\x20','castTo','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','NOT\x20IN\x20?','<>\x20?','$substring','<\x20?','>\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','$startsWith','pop','DATE','utcOffset','hours','moment','parseSearch','sqlOperator','startsWith','[$or]','and','replace','split','length','slice','shift','match','indexOf','conditions','push','operator'];(function(_0x5440af,_0x5194a9){var _0x2334de=function(_0x114d1a){while(--_0x114d1a){_0x5440af['push'](_0x5440af['shift']());}};_0x2334de(++_0x5194a9);}(_0x8257,0x1a9));var _0x7825=function(_0x47e549,_0x2e53d6){_0x47e549=_0x47e549-0x0;var _0x251374=_0x8257[_0x47e549];return _0x251374;};'use strict';var _=require('lodash');var moment=require(_0x7825('0x0'));exports[_0x7825('0x1')]=function(_0x5962dd){var _0xc574cd={'conditions':[]};_0xc574cd[_0x7825('0x2')]=_[_0x7825('0x3')](_0x5962dd,_0x7825('0x4'))?'or':_0x7825('0x5');var _0x588f52=_0x5962dd[_0x7825('0x6')]('[$and]','')[_0x7825('0x6')](_0x7825('0x4'),'')[_0x7825('0x7')]('||');for(var _0x412da6=0x0;_0x412da6<_0x588f52[_0x7825('0x8')];_0x412da6++){var _0x449459=_0x588f52[_0x412da6][_0x7825('0x7')](':=');var _0xeec1bc=_0x449459[0x0];var _0x5c4cf3=_0x449459[_0x7825('0x9')](0x1);_0x5c4cf3['forEach'](function(_0xf247de){var _0x9bc504=_0xf247de[_0x7825('0x7')]('[')[_0x7825('0xa')]();var _0x460d1f=_0xf247de[_0x7825('0xb')](/\[(.*?)\]/g);_0x460d1f['forEach'](function(_0xe3d9ca){var _0x318439=_0xe3d9ca['split']('[')['filter'](function(_0x402aa0){return _0x402aa0[_0x7825('0xc')](']')>-0x1;})['map'](function(_0x3413cf){return _0x3413cf[_0x7825('0x7')](']')[0x0];})[0x0];_0xc574cd[_0x7825('0xd')][_0x7825('0xe')]({'field':_0xeec1bc,'operator':_0x9bc504,'value':_0x318439});});});}return _0xc574cd;};exports['buildExpression']=function(_0x32abfa,_0x3e219e,_0x5673ad){var _0x1c98ca={};if(_0x3e219e==='DATE'){if(_0x5673ad[_0x7825('0xf')]===_0x7825('0x10')){_0x5673ad[_0x7825('0xf')]=_0x7825('0x11');_0x5673ad['value']+=','+_0x5673ad['value'];}else if(_[_0x7825('0x12')](['$gt',_0x7825('0x13')],_0x5673ad[_0x7825('0xf')])){_0x5673ad['value']=moment(_0x5673ad[_0x7825('0x14')])[_0x7825('0x15')](0x1,_0x7825('0x16'))[_0x7825('0x17')](_0x7825('0x18'));}}if(_0x5673ad['castTo']){_0x3e219e=_0x5673ad['castTo'];_0x1c98ca[_0x7825('0x19')]=_0x7825('0x1a')+_0x32abfa+'.'+_0x5673ad[_0x7825('0x1b')]+_0x7825('0x1c')+_0x5673ad[_0x7825('0x1d')]+')\x20'+parseOperator(_0x5673ad[_0x7825('0xf')]);}else{_0x1c98ca[_0x7825('0x19')]=_0x32abfa+'.'+_0x5673ad[_0x7825('0x1b')]+'\x20'+parseOperator(_0x5673ad[_0x7825('0xf')]);}if(_[_0x7825('0x12')]([_0x7825('0x1e'),_0x7825('0x1f')],_0x5673ad[_0x7825('0xf')]))_0x1c98ca[_0x7825('0x19')]='('+_0x1c98ca[_0x7825('0x19')]+_0x7825('0x20')+_0x32abfa+'.'+_0x5673ad[_0x7825('0x1b')]+_0x7825('0x21');_0x1c98ca[_0x7825('0x14')]=parseValue(_0x3e219e,_0x5673ad[_0x7825('0xf')],_0x5673ad[_0x7825('0x14')]);return _0x1c98ca;};function parseOperator(_0xafe609){var _0x313b14;switch(_0xafe609){case _0x7825('0x22'):_0x313b14='IN\x20?';break;case _0x7825('0x1f'):_0x313b14=_0x7825('0x23');break;case _0x7825('0x10'):_0x313b14='=\x20?';break;case _0x7825('0x1e'):_0x313b14=_0x7825('0x24');break;case _0x7825('0x25'):case'$startsWith':case'$endsWith':_0x313b14='LIKE\x20?';break;case'$lt':_0x313b14=_0x7825('0x26');break;case'$gt':_0x313b14=_0x7825('0x27');break;case _0x7825('0x13'):_0x313b14='<=\x20?';break;case _0x7825('0x28'):_0x313b14=_0x7825('0x29');break;case _0x7825('0x11'):_0x313b14=_0x7825('0x2a');break;}return _0x313b14;}function parseValue(_0x29adb0,_0x1645a9,_0x63b914){var _0x5ef362={'start':undefined,'end':undefined};switch(_0x1645a9){case _0x7825('0x22'):case'$notIn':_0x5ef362[_0x7825('0x2b')]=_0x63b914[_0x7825('0x7')](',');break;case'$substring':_0x5ef362[_0x7825('0x2b')]='%'+_0x63b914+'%';break;case _0x7825('0x2c'):_0x5ef362['start']=_0x63b914+'%';break;case'$endsWith':_0x5ef362[_0x7825('0x2b')]='%'+_0x63b914;break;case'$between':var _0x4007d5=_0x63b914['split'](',');var _0x63b914=_0x4007d5[_0x7825('0xa')]();var _0x199602=_0x4007d5[_0x7825('0x2d')]();if(_0x29adb0===_0x7825('0x2e')){_0x63b914=moment(_0x63b914)['utcOffset'](0x0,!![])[_0x7825('0x17')]();_0x199602=moment(_0x199602)[_0x7825('0x2f')](0x0,!![])[_0x7825('0x15')](0x17,_0x7825('0x30'))[_0x7825('0x15')](0x3b,'minutes')['add'](0x3b,'seconds')[_0x7825('0x17')]();}_0x5ef362={'start':_0x63b914,'end':_0x199602};break;default:_0x5ef362[_0x7825('0x2b')]=_0x63b914;break;}return _0x5ef362;} \ No newline at end of file +var _0x1a7c=['$in','$ne','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','$gte','BETWEEN\x20?\x20AND\x20?','start','utcOffset','hours','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','replace','[$and]','split','forEach','shift','match','indexOf','map','buildExpression','DATE','operator','$eq','$between','value','includes','$gt','$lte','add','format','castTo','text','CAST(','field','\x20AS\x20','$notIn','\x20OR\x20','\x20IS\x20NULL)'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x1a7c,0xff));var _0xc1a7=function(_0x5e4ffa,_0x56154d){_0x5e4ffa=_0x5e4ffa-0x0;var _0x43a656=_0x1a7c[_0x5e4ffa];return _0x43a656;};'use strict';var _=require(_0xc1a7('0x0'));var moment=require(_0xc1a7('0x1'));exports[_0xc1a7('0x2')]=function(_0x43b686){var _0x446680={'conditions':[]};_0x446680[_0xc1a7('0x3')]=_[_0xc1a7('0x4')](_0x43b686,_0xc1a7('0x5'))?'or':'and';var _0x22f633=_0x43b686[_0xc1a7('0x6')](_0xc1a7('0x7'),'')['replace'](_0xc1a7('0x5'),'')[_0xc1a7('0x8')]('||');for(var _0x1167d6=0x0;_0x1167d6<_0x22f633['length'];_0x1167d6++){var _0x5193a1=_0x22f633[_0x1167d6][_0xc1a7('0x8')](':=');var _0x273e78=_0x5193a1[0x0];var _0x3f3268=_0x5193a1['slice'](0x1);_0x3f3268[_0xc1a7('0x9')](function(_0x2d7408){var _0xe4e03=_0x2d7408[_0xc1a7('0x8')]('[')[_0xc1a7('0xa')]();var _0x41c1cc=_0x2d7408[_0xc1a7('0xb')](/\[(.*?)\]/g);_0x41c1cc[_0xc1a7('0x9')](function(_0x286dc2){var _0x1412d6=_0x286dc2[_0xc1a7('0x8')]('[')['filter'](function(_0x3342f8){return _0x3342f8[_0xc1a7('0xc')](']')>-0x1;})[_0xc1a7('0xd')](function(_0x1be876){return _0x1be876['split'](']')[0x0];})[0x0];_0x446680['conditions']['push']({'field':_0x273e78,'operator':_0xe4e03,'value':_0x1412d6});});});}return _0x446680;};exports[_0xc1a7('0xe')]=function(_0xce8e7c,_0x454501,_0x5b3052){var _0x18df20={};if(_0x454501===_0xc1a7('0xf')){if(_0x5b3052[_0xc1a7('0x10')]===_0xc1a7('0x11')){_0x5b3052['operator']=_0xc1a7('0x12');_0x5b3052['value']+=','+_0x5b3052[_0xc1a7('0x13')];}else if(_[_0xc1a7('0x14')]([_0xc1a7('0x15'),_0xc1a7('0x16')],_0x5b3052[_0xc1a7('0x10')])){_0x5b3052[_0xc1a7('0x13')]=moment(_0x5b3052[_0xc1a7('0x13')])[_0xc1a7('0x17')](0x1,'days')[_0xc1a7('0x18')]('YYYY-MM-DD');}}if(_0x5b3052[_0xc1a7('0x19')]){_0x454501=_0x5b3052['castTo'];_0x18df20[_0xc1a7('0x1a')]=_0xc1a7('0x1b')+_0xce8e7c+'.'+_0x5b3052[_0xc1a7('0x1c')]+_0xc1a7('0x1d')+_0x5b3052[_0xc1a7('0x19')]+')\x20'+parseOperator(_0x5b3052[_0xc1a7('0x10')]);}else{_0x18df20[_0xc1a7('0x1a')]=_0xce8e7c+'.'+_0x5b3052['field']+'\x20'+parseOperator(_0x5b3052[_0xc1a7('0x10')]);}if(_[_0xc1a7('0x14')](['$ne',_0xc1a7('0x1e')],_0x5b3052[_0xc1a7('0x10')]))_0x18df20[_0xc1a7('0x1a')]='('+_0x18df20[_0xc1a7('0x1a')]+_0xc1a7('0x1f')+_0xce8e7c+'.'+_0x5b3052[_0xc1a7('0x1c')]+_0xc1a7('0x20');_0x18df20[_0xc1a7('0x13')]=parseValue(_0x454501,_0x5b3052[_0xc1a7('0x10')],_0x5b3052[_0xc1a7('0x13')]);return _0x18df20;};function parseOperator(_0x8539d2){var _0x3e6129;switch(_0x8539d2){case _0xc1a7('0x21'):_0x3e6129='IN\x20?';break;case'$notIn':_0x3e6129='NOT\x20IN\x20?';break;case _0xc1a7('0x11'):_0x3e6129='=\x20?';break;case _0xc1a7('0x22'):_0x3e6129='<>\x20?';break;case _0xc1a7('0x23'):case _0xc1a7('0x24'):case _0xc1a7('0x25'):_0x3e6129=_0xc1a7('0x26');break;case _0xc1a7('0x27'):_0x3e6129=_0xc1a7('0x28');break;case'$gt':_0x3e6129=_0xc1a7('0x29');break;case _0xc1a7('0x16'):_0x3e6129='<=\x20?';break;case _0xc1a7('0x2a'):_0x3e6129='>=\x20?';break;case _0xc1a7('0x12'):_0x3e6129=_0xc1a7('0x2b');break;}return _0x3e6129;}function parseValue(_0x26459d,_0x15eee6,_0x43c28c){var _0x483cff={'start':undefined,'end':undefined};switch(_0x15eee6){case _0xc1a7('0x21'):case _0xc1a7('0x1e'):_0x483cff[_0xc1a7('0x2c')]=_0x43c28c['split'](',');break;case _0xc1a7('0x23'):_0x483cff['start']='%'+_0x43c28c+'%';break;case _0xc1a7('0x24'):_0x483cff[_0xc1a7('0x2c')]=_0x43c28c+'%';break;case _0xc1a7('0x25'):_0x483cff['start']='%'+_0x43c28c;break;case _0xc1a7('0x12'):var _0x31e843=_0x43c28c[_0xc1a7('0x8')](',');var _0x43c28c=_0x31e843[_0xc1a7('0xa')]();var _0x80ad8a=_0x31e843['pop']();if(_0x26459d===_0xc1a7('0xf')){_0x43c28c=moment(_0x43c28c)[_0xc1a7('0x2d')](0x0,!![])[_0xc1a7('0x18')]();_0x80ad8a=moment(_0x80ad8a)['utcOffset'](0x0,!![])['add'](0x17,_0xc1a7('0x2e'))[_0xc1a7('0x17')](0x3b,'minutes')[_0xc1a7('0x17')](0x3b,_0xc1a7('0x2f'))[_0xc1a7('0x18')]();}_0x483cff={'start':_0x43c28c,'end':_0x80ad8a};break;default:_0x483cff[_0xc1a7('0x2c')]=_0x43c28c;break;}return _0x483cff;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index a2c802f..6174c6f 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 _0xcd59=['attributes','fields','hasOwnProperty','nolimit','order','where','pick','filter','object','columns','value','merge','map','type','VIRTUAL','lower','lodash','sequelize','moment','keys','includes','parse','split','filters','isEmpty','find','isPlainObject','$gte','format','utc','$lte','subtract','uniqueid','isArray','limit','offset','sort','indexOf','priority','cast','col','unsigned','substr','DESC','omit','length','isObject','isString','unset','isNumeric','^[+]?[0-9]*$','isEmail','match','getFullTextValue','forEach','replace','push','getOptions','$id','query','model','name','intersection'];(function(_0x3f49c5,_0x715fbe){var _0xee4c24=function(_0x3a3ea6){while(--_0x3a3ea6){_0x3f49c5['push'](_0x3f49c5['shift']());}};_0xee4c24(++_0x715fbe);}(_0xcd59,0x14b));var _0x9cd5=function(_0x345307,_0x11b6f3){_0x345307=_0x345307-0x0;var _0x1e07a7=_0xcd59[_0x345307];return _0x1e07a7;};'use strict';var _=require(_0x9cd5('0x0'));var sequelize=require(_0x9cd5('0x1'));var moment=require(_0x9cd5('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x27ce9f){var _0x271070=['ne'];try{var _0x302b21=JSON['parse'](_0x27ce9f);var _0x2d392c=Object[_0x9cd5('0x3')](_0x302b21)[0x0];return _0x271070[_0x9cd5('0x4')](_0x2d392c);}catch(_0x717731){return![];}}function getOperatorValue(_0x6acbef){var _0x2db192=JSON[_0x9cd5('0x5')](_0x6acbef);var _0x2cd19a=Object[_0x9cd5('0x3')](_0x2db192)[0x0];var _0x3f888f=_0x2db192[_0x2cd19a];return{['$'+_0x2cd19a]:_0x3f888f};}exports['fields']=function(_0x10162d){var _0x15e76c=null;if(_0x10162d){_0x15e76c=_0x10162d[_0x9cd5('0x6')](',');}return _0x15e76c;};exports[_0x9cd5('0x7')]=function(_0x162cb0,_0x4099d0){var _0x46bbca={};if(!_[_0x9cd5('0x8')](_0x162cb0)){_['forOwn'](_0x162cb0,function(_0x1c5b71,_0x16563e){try{if(_0x4099d0){var _0x3fefe6=_[_0x9cd5('0x9')](_0x4099d0,{'name':_0x16563e})||{};if(hasSequelizeOperator(_0x1c5b71)){_0x46bbca[_0x16563e]=getOperatorValue(_0x1c5b71);}else if(_0x3fefe6['type']==='DATE'&&_[_0x9cd5('0xa')](_0x1c5b71)){var _0x172e29=JSON[_0x9cd5('0x5')](_0x1c5b71);var _0x407079={'$gte':moment(moment(_0x172e29[_0x9cd5('0xb')])[_0x9cd5('0xc')]('YYYY-MM-DD'))[_0x9cd5('0xd')]()[_0x9cd5('0xc')](),'$lte':moment(moment(_0x172e29[_0x9cd5('0xe')])['format']('YYYY-MM-DD'))['utc']()[_0x9cd5('0xf')](0x1,'s')[_0x9cd5('0xc')]()};_0x46bbca[_0x16563e]=_0x407079;}else if(_0x3fefe6['name']===_0x9cd5('0x10')){_0x46bbca[_0x16563e]=_0x1c5b71;}else{_0x46bbca[_0x16563e]=_[_0x9cd5('0x11')](_0x1c5b71)?_0x1c5b71:JSON[_0x9cd5('0x5')](_0x1c5b71);}}else{_0x46bbca[_0x16563e]=_['isArray'](_0x1c5b71)?_0x1c5b71:JSON[_0x9cd5('0x5')](_0x1c5b71);}}catch(_0x2d1863){_0x46bbca[_0x16563e]=_0x1c5b71[_0x9cd5('0x6')](',');}});}return _0x46bbca;};exports[_0x9cd5('0x12')]=function(_0x21da57){_0x21da57=parseInt(_0x21da57,0xa);if(!_0x21da57||_0x21da57<0x0){_0x21da57=LIMIT_VALUE;}return _0x21da57;};exports[_0x9cd5('0x13')]=function(_0x5c1622){_0x5c1622=parseInt(_0x5c1622,0xa);if(!_0x5c1622||_0x5c1622<0x0){_0x5c1622=0x0;}return _0x5c1622;};exports[_0x9cd5('0x14')]=function(_0x18346f){var _0x3661b0,_0xb97394=null;if(_0x18346f){_0x3661b0=_0x18346f[_0x9cd5('0x6')](',');_0xb97394=_['map'](_0x3661b0,function(_0x16c4e9){if(_0x16c4e9[_0x9cd5('0x15')]('-')===0x0){return[_0x16c4e9===_0x9cd5('0x16')?sequelize[_0x9cd5('0x17')](sequelize[_0x9cd5('0x18')](_0x9cd5('0x16')),_0x9cd5('0x19')):_0x16c4e9[_0x9cd5('0x1a')](0x1),_0x9cd5('0x1b')];}else{return[_0x16c4e9==='priority'?sequelize[_0x9cd5('0x17')](sequelize[_0x9cd5('0x18')](_0x9cd5('0x16')),_0x9cd5('0x19')):_0x16c4e9,'ASC'];}});}return _0xb97394;};exports[_0x9cd5('0x1c')]=function(_0x990c25,_0x211576){if(_[_0x9cd5('0x8')](_0x990c25)){return _0x990c25;}if(_[_0x9cd5('0x11')](_0x990c25)){for(var _0x4509e7=0x0;_0x4509e7<_0x990c25[_0x9cd5('0x1d')];_0x4509e7+=0x1){_0x990c25[_0x4509e7]=this['omit'](_0x990c25[_0x4509e7],_0x211576);}return _0x990c25;}if(!_[_0x9cd5('0x1e')](_0x990c25)){return _0x990c25;}if(_[_0x9cd5('0x1f')](_0x211576)){_0x211576=[_0x211576];}if(!_[_0x9cd5('0x11')](_0x211576)){return _0x990c25;}for(var _0x4af6c8=0x0;_0x4af6c8<_0x211576['length'];_0x4af6c8+=0x1){_[_0x9cd5('0x20')](_0x990c25,_0x211576[_0x4af6c8]);}for(var _0x502257 in _0x990c25){if(_0x990c25['hasOwnProperty'](_0x502257)){_0x990c25[_0x502257]=this[_0x9cd5('0x1c')](_0x990c25[_0x502257],_0x211576);}}return _0x990c25;};exports[_0x9cd5('0x21')]=function(_0x13e0d3){return _0x13e0d3['match'](RegExp(_0x9cd5('0x22')))?!![]:![];};exports[_0x9cd5('0x23')]=function(_0x27e1fd){return _0x27e1fd[_0x9cd5('0x24')](/^\S+@\S+$/)?!![]:![];};exports[_0x9cd5('0x25')]=function(_0x14903c){var _0x1dbddc=[];_0x14903c[_0x9cd5('0x6')](/[ ,]+/)[_0x9cd5('0x26')](function(_0x1c81fd){_0x1c81fd=_0x1c81fd[_0x9cd5('0x27')](/([^:]")"+/g,'$1');_0x1c81fd='+'+_0x1c81fd+'*';var _0x4287bd=/[ `!@#$%^&*()_\-?~]/;if(_0x1c81fd[_0x9cd5('0x24')](_0x4287bd))_0x1c81fd='\x22'+_0x1c81fd+'\x22';_0x1dbddc[_0x9cd5('0x28')](_0x1c81fd);});return _0x1dbddc['join']('\x20');};exports[_0x9cd5('0x29')]=function(_0x2a6a34,_0x4bff30,_0x589958){var _0x101d99={},_0x19c9f2={};if(_0x4bff30['query'][_0x9cd5('0x2a')]){_0x4bff30['query']['id']=_0x4bff30['query'][_0x9cd5('0x2a')];delete _0x4bff30[_0x9cd5('0x2b')][_0x9cd5('0x2a')];}_0x101d99[_0x9cd5('0x2c')]=_['map'](_0x2a6a34,_0x9cd5('0x2d'));_0x101d99[_0x9cd5('0x2b')]=_[_0x9cd5('0x3')](_0x4bff30['query']);_0x101d99[_0x9cd5('0x7')]=_[_0x9cd5('0x2e')](_0x101d99[_0x9cd5('0x2c')],_0x101d99[_0x9cd5('0x2b')]);_0x19c9f2[_0x9cd5('0x2f')]=_[_0x9cd5('0x2e')](_0x101d99[_0x9cd5('0x2c')],this[_0x9cd5('0x30')](_0x4bff30[_0x9cd5('0x2b')][_0x9cd5('0x30')]));_0x19c9f2[_0x9cd5('0x2f')]=_0x19c9f2['attributes'][_0x9cd5('0x1d')]?_0x19c9f2['attributes']:_0x101d99['model'];if(!_0x4bff30[_0x9cd5('0x2b')][_0x9cd5('0x31')](_0x9cd5('0x32'))){_0x19c9f2[_0x9cd5('0x12')]=this['limit'](_0x4bff30[_0x9cd5('0x2b')][_0x9cd5('0x12')]);_0x19c9f2[_0x9cd5('0x13')]=this[_0x9cd5('0x13')](_0x4bff30['query'][_0x9cd5('0x13')]);}_0x19c9f2[_0x9cd5('0x33')]=this[_0x9cd5('0x14')](_0x4bff30[_0x9cd5('0x2b')][_0x9cd5('0x14')]);_0x19c9f2[_0x9cd5('0x34')]=this['filters'](_[_0x9cd5('0x35')](_0x4bff30[_0x9cd5('0x2b')],_0x101d99[_0x9cd5('0x7')]),_0x2a6a34);if(_0x4bff30[_0x9cd5('0x2b')][_0x9cd5('0x36')]){var _0x4182bd=_0x2a6a34;var _0x12d604=_0x4bff30[_0x9cd5('0x2b')][_0x9cd5('0x36')];if(typeof _0x12d604===_0x9cd5('0x37')){_0x4182bd=_[_0x9cd5('0x36')](_0x2a6a34,function(_0x3ed405){return _[_0x9cd5('0x4')](_0x12d604[_0x9cd5('0x38')],_0x3ed405[_0x9cd5('0x2d')]);});_0x12d604=_0x12d604[_0x9cd5('0x39')];}_0x19c9f2[_0x9cd5('0x34')]=_[_0x9cd5('0x3a')](_0x19c9f2['where'],{'$or':_[_0x9cd5('0x3b')](_0x4182bd,function(_0x58ae2e){if(_0x58ae2e[_0x9cd5('0x3c')]!==_0x9cd5('0x3d')){if(_0x589958){return sequelize[_0x9cd5('0x34')](sequelize['fn'](_0x9cd5('0x3e'),sequelize[_0x9cd5('0x18')](_0x58ae2e['name'])),{'$like':sequelize['fn'](_0x9cd5('0x3e'),'%'+_0x4bff30[_0x9cd5('0x2b')][_0x9cd5('0x36')]+'%')});}else{var _0x54ffdf={};_0x54ffdf[_0x58ae2e[_0x9cd5('0x2d')]]={'$like':'%'+_0x4bff30[_0x9cd5('0x2b')][_0x9cd5('0x36')]+'%'};return _0x54ffdf;}}})});}_0x19c9f2=_[_0x9cd5('0x3a')]({},_0x19c9f2,_0x4bff30['options']);return _0x19c9f2;}; \ No newline at end of file +var _0x2675=['value','where','merge','col','options','lodash','keys','parse','fields','split','forOwn','find','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','subtract','name','uniqueid','isArray','limit','offset','map','indexOf','cast','priority','unsigned','substr','ASC','omit','isEmpty','length','isString','hasOwnProperty','isNumeric','match','getFullTextValue','forEach','push','join','getOptions','query','$id','filters','intersection','model','attributes','nolimit','sort','filter','object','includes'];(function(_0x55deb0,_0x4e25e8){var _0x591b09=function(_0xf025ad){while(--_0xf025ad){_0x55deb0['push'](_0x55deb0['shift']());}};_0x591b09(++_0x4e25e8);}(_0x2675,0x75));var _0x5267=function(_0x1510a,_0x49451d){_0x1510a=_0x1510a-0x0;var _0x59affa=_0x2675[_0x1510a];return _0x59affa;};'use strict';var _=require(_0x5267('0x0'));var sequelize=require('sequelize');var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x4f8fae){var _0x1da342=['ne'];try{var _0x2ae442=JSON['parse'](_0x4f8fae);var _0x4600fa=Object[_0x5267('0x1')](_0x2ae442)[0x0];return _0x1da342['includes'](_0x4600fa);}catch(_0x328776){return![];}}function getOperatorValue(_0xf2b350){var _0x4bd042=JSON[_0x5267('0x2')](_0xf2b350);var _0x20f065=Object[_0x5267('0x1')](_0x4bd042)[0x0];var _0x527c16=_0x4bd042[_0x20f065];return{['$'+_0x20f065]:_0x527c16};}exports[_0x5267('0x3')]=function(_0x46bfdf){var _0x506fd7=null;if(_0x46bfdf){_0x506fd7=_0x46bfdf[_0x5267('0x4')](',');}return _0x506fd7;};exports['filters']=function(_0x3ff4e9,_0x207d47){var _0x26e22b={};if(!_['isEmpty'](_0x3ff4e9)){_[_0x5267('0x5')](_0x3ff4e9,function(_0x5060b3,_0x445151){try{if(_0x207d47){var _0x5bbf00=_[_0x5267('0x6')](_0x207d47,{'name':_0x445151})||{};if(hasSequelizeOperator(_0x5060b3)){_0x26e22b[_0x445151]=getOperatorValue(_0x5060b3);}else if(_0x5bbf00[_0x5267('0x7')]===_0x5267('0x8')&&_[_0x5267('0x9')](_0x5060b3)){var _0x1d7090=JSON[_0x5267('0x2')](_0x5060b3);var _0x20785c={'$gte':moment(moment(_0x1d7090[_0x5267('0xa')])[_0x5267('0xb')](_0x5267('0xc')))[_0x5267('0xd')]()[_0x5267('0xb')](),'$lte':moment(moment(_0x1d7090[_0x5267('0xe')])['format']('YYYY-MM-DD'))[_0x5267('0xd')]()[_0x5267('0xf')](0x1,'s')[_0x5267('0xb')]()};_0x26e22b[_0x445151]=_0x20785c;}else if(_0x5bbf00[_0x5267('0x10')]===_0x5267('0x11')){_0x26e22b[_0x445151]=_0x5060b3;}else{_0x26e22b[_0x445151]=_[_0x5267('0x12')](_0x5060b3)?_0x5060b3:JSON[_0x5267('0x2')](_0x5060b3);}}else{_0x26e22b[_0x445151]=_[_0x5267('0x12')](_0x5060b3)?_0x5060b3:JSON[_0x5267('0x2')](_0x5060b3);}}catch(_0xb1c97a){_0x26e22b[_0x445151]=_0x5060b3[_0x5267('0x4')](',');}});}return _0x26e22b;};exports[_0x5267('0x13')]=function(_0x528d61){_0x528d61=parseInt(_0x528d61,0xa);if(!_0x528d61||_0x528d61<0x0){_0x528d61=LIMIT_VALUE;}return _0x528d61;};exports[_0x5267('0x14')]=function(_0x2afd38){_0x2afd38=parseInt(_0x2afd38,0xa);if(!_0x2afd38||_0x2afd38<0x0){_0x2afd38=0x0;}return _0x2afd38;};exports['sort']=function(_0x20cb50){var _0x56733e,_0x1cf835=null;if(_0x20cb50){_0x56733e=_0x20cb50[_0x5267('0x4')](',');_0x1cf835=_[_0x5267('0x15')](_0x56733e,function(_0x2a9f99){if(_0x2a9f99[_0x5267('0x16')]('-')===0x0){return[_0x2a9f99==='priority'?sequelize[_0x5267('0x17')](sequelize['col'](_0x5267('0x18')),_0x5267('0x19')):_0x2a9f99[_0x5267('0x1a')](0x1),'DESC'];}else{return[_0x2a9f99==='priority'?sequelize['cast'](sequelize['col']('priority'),_0x5267('0x19')):_0x2a9f99,_0x5267('0x1b')];}});}return _0x1cf835;};exports[_0x5267('0x1c')]=function(_0x279377,_0x11c8ea){if(_[_0x5267('0x1d')](_0x279377)){return _0x279377;}if(_[_0x5267('0x12')](_0x279377)){for(var _0x220e03=0x0;_0x220e03<_0x279377[_0x5267('0x1e')];_0x220e03+=0x1){_0x279377[_0x220e03]=this['omit'](_0x279377[_0x220e03],_0x11c8ea);}return _0x279377;}if(!_['isObject'](_0x279377)){return _0x279377;}if(_[_0x5267('0x1f')](_0x11c8ea)){_0x11c8ea=[_0x11c8ea];}if(!_[_0x5267('0x12')](_0x11c8ea)){return _0x279377;}for(var _0x5abf95=0x0;_0x5abf95<_0x11c8ea[_0x5267('0x1e')];_0x5abf95+=0x1){_['unset'](_0x279377,_0x11c8ea[_0x5abf95]);}for(var _0x4d7c2a in _0x279377){if(_0x279377[_0x5267('0x20')](_0x4d7c2a)){_0x279377[_0x4d7c2a]=this[_0x5267('0x1c')](_0x279377[_0x4d7c2a],_0x11c8ea);}}return _0x279377;};exports[_0x5267('0x21')]=function(_0x2d2ace){return _0x2d2ace[_0x5267('0x22')](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports['isEmail']=function(_0x18020c){return _0x18020c[_0x5267('0x22')](/^\S+@\S+$/)?!![]:![];};exports[_0x5267('0x23')]=function(_0x549a66){var _0x58d685=[];_0x549a66[_0x5267('0x4')](/[ ,]+/)[_0x5267('0x24')](function(_0x1fa725){_0x1fa725=_0x1fa725['replace'](/([^:]")"+/g,'$1');_0x1fa725='+'+_0x1fa725+'*';var _0x59b091=/[ `!@#$%^&*()_\-?~]/;if(_0x1fa725[_0x5267('0x22')](_0x59b091))_0x1fa725='\x22'+_0x1fa725+'\x22';_0x58d685[_0x5267('0x25')](_0x1fa725);});return _0x58d685[_0x5267('0x26')]('\x20');};exports[_0x5267('0x27')]=function(_0x5bbb83,_0x33e456,_0x1a7f4b){var _0x4344c5={},_0xf8d7a3={};if(_0x33e456[_0x5267('0x28')][_0x5267('0x29')]){_0x33e456[_0x5267('0x28')]['id']=_0x33e456[_0x5267('0x28')]['$id'];delete _0x33e456['query'][_0x5267('0x29')];}_0x4344c5['model']=_[_0x5267('0x15')](_0x5bbb83,_0x5267('0x10'));_0x4344c5[_0x5267('0x28')]=_[_0x5267('0x1')](_0x33e456['query']);_0x4344c5[_0x5267('0x2a')]=_[_0x5267('0x2b')](_0x4344c5[_0x5267('0x2c')],_0x4344c5[_0x5267('0x28')]);_0xf8d7a3[_0x5267('0x2d')]=_[_0x5267('0x2b')](_0x4344c5[_0x5267('0x2c')],this[_0x5267('0x3')](_0x33e456['query'][_0x5267('0x3')]));_0xf8d7a3['attributes']=_0xf8d7a3[_0x5267('0x2d')][_0x5267('0x1e')]?_0xf8d7a3[_0x5267('0x2d')]:_0x4344c5[_0x5267('0x2c')];if(!_0x33e456[_0x5267('0x28')][_0x5267('0x20')](_0x5267('0x2e'))){_0xf8d7a3['limit']=this[_0x5267('0x13')](_0x33e456[_0x5267('0x28')][_0x5267('0x13')]);_0xf8d7a3[_0x5267('0x14')]=this[_0x5267('0x14')](_0x33e456[_0x5267('0x28')][_0x5267('0x14')]);}_0xf8d7a3['order']=this[_0x5267('0x2f')](_0x33e456['query'][_0x5267('0x2f')]);_0xf8d7a3['where']=this['filters'](_['pick'](_0x33e456[_0x5267('0x28')],_0x4344c5['filters']),_0x5bbb83);if(_0x33e456[_0x5267('0x28')][_0x5267('0x30')]){var _0x3d4b19=_0x5bbb83;var _0x235982=_0x33e456['query'][_0x5267('0x30')];if(typeof _0x235982===_0x5267('0x31')){_0x3d4b19=_['filter'](_0x5bbb83,function(_0x54a5e5){return _[_0x5267('0x32')](_0x235982['columns'],_0x54a5e5[_0x5267('0x10')]);});_0x235982=_0x235982[_0x5267('0x33')];}_0xf8d7a3[_0x5267('0x34')]=_[_0x5267('0x35')](_0xf8d7a3[_0x5267('0x34')],{'$or':_[_0x5267('0x15')](_0x3d4b19,function(_0x27add5){if(_0x27add5['type']!=='VIRTUAL'){if(_0x1a7f4b){return sequelize[_0x5267('0x34')](sequelize['fn']('lower',sequelize[_0x5267('0x36')](_0x27add5[_0x5267('0x10')])),{'$like':sequelize['fn']('lower','%'+_0x33e456[_0x5267('0x28')][_0x5267('0x30')]+'%')});}else{var _0x299a13={};_0x299a13[_0x27add5[_0x5267('0x10')]]={'$like':'%'+_0x33e456[_0x5267('0x28')][_0x5267('0x30')]+'%'};return _0x299a13;}}})});}_0xf8d7a3=_[_0x5267('0x35')]({},_0xf8d7a3,_0x33e456[_0x5267('0x37')]);return _0xf8d7a3;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index f83b5b7..f7ed5ec 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(_0x56213b,_0x20a174){var _0x1d74be=function(_0x54e42e){while(--_0x54e42e){_0x56213b['push'](_0x56213b['shift']());}};_0x1d74be(++_0x20a174);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'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(_0x24857e,_0x3370c){var _0x3401a6=function(_0x562da5){while(--_0x562da5){_0x24857e['push'](_0x24857e['shift']());}};_0x3401a6(++_0x3370c);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'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 6fa9133..44ffc95 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 _0xc77b=['orderBy','keys','filter','family','IPv4','internal','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','model','createHash','md5','update','digest','hex','getUuid','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','hostname','macAddress','substring','crypto','bimedia-machine-uuid','child_process','../environment','networkInterfaces'];(function(_0x345865,_0x1d878d){var _0x2e14f4=function(_0x52e646){while(--_0x52e646){_0x345865['push'](_0x345865['shift']());}};_0x2e14f4(++_0x1d878d);}(_0xc77b,0x1bd));var _0xbc77=function(_0x542b78,_0x188f9a){_0x542b78=_0x542b78-0x0;var _0x4e9796=_0xc77b[_0x542b78];return _0x4e9796;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0xbc77('0x0'));var machine=require(_0xbc77('0x1'));var exec=require(_0xbc77('0x2'))['execSync'];var config=require(_0xbc77('0x3'));function getInterfaces(){var _0x5d9c2a=[];var _0xf274de=os[_0xbc77('0x4')]();var _0x5390e1=_[_0xbc77('0x5')](_[_0xbc77('0x6')](_0xf274de));for(var _0x32cb80=0x0;_0x32cb80<_0x5390e1['length'];_0x32cb80++){var _0x4cd9f4=_0xf274de[_0x5390e1[_0x32cb80]][_0xbc77('0x7')](function(_0x15e74b){return _0x15e74b[_0xbc77('0x8')]===_0xbc77('0x9')&&_0x15e74b[_0xbc77('0xa')]===![];});_0x5d9c2a=_0x5d9c2a['concat'](_0x4cd9f4);}return _0x5d9c2a;}function getFirstInterface(){var _0x1c23bd=_['head'](getInterfaces());return{'macAddress':_0x1c23bd&&_0x1c23bd[_0xbc77('0xb')]?_0x1c23bd[_0xbc77('0xb')]:_0xbc77('0xc'),'ipAddress':_0x1c23bd&&_0x1c23bd[_0xbc77('0xd')]?_0x1c23bd[_0xbc77('0xd')]:_0xbc77('0xe')};}exports[_0xbc77('0xf')]=getFirstInterface;function getCPUhash(){var _0x5127e3=_['orderBy'](os['cpus']()['map'](function(_0x594277){return _0x594277[_0xbc77('0x10')];}))['join'](':');return crypto[_0xbc77('0x11')](_0xbc77('0x12'))[_0xbc77('0x13')](_0x5127e3)[_0xbc77('0x14')](_0xbc77('0x15'));}exports[_0xbc77('0x16')]=function(){var _0x3d6240=os['platform']();var _0x2f7633=/[0-9a-f-]{36}/;if(config[_0xbc77('0x17')]&&_0x2f7633[_0xbc77('0x18')](config[_0xbc77('0x17')])){return config['licenseToken'];}else if(_0x3d6240===_0xbc77('0x19')){return exec(_0xbc77('0x1a'),{'encoding':'utf8'})['replace']('\x0d\x0a','');}else{var _0xb441e7=getFirstInterface();var _0x45e117=getCPUhash();var _0x587252=_0x45e117+'|'+os[_0xbc77('0x1b')]()+'|'+_0xb441e7[_0xbc77('0x1c')]+'|'+_0xb441e7['ipAddress'];var _0x2384ee=crypto[_0xbc77('0x11')](_0xbc77('0x12'))[_0xbc77('0x13')](_0x587252)['digest'](_0xbc77('0x15'));return _0x2384ee[_0xbc77('0x1d')](0x0,0x8)+'-'+_0x2384ee['substring'](0x8,0xc)+'-'+_0x2384ee['substring'](0xc,0x10)+'-'+_0x2384ee['substring'](0x10,0x14)+'-'+_0x2384ee[_0xbc77('0x1d')](0x14);}}; \ No newline at end of file +var _0x5445=['crypto','child_process','execSync','../environment','orderBy','filter','family','IPv4','internal','head','mac','127.0.0.1','getFirstInterface','cpus','map','join','createHash','digest','getUuid','platform','licenseToken','test','win32','replace','macAddress','ipAddress','update','substring','lodash'];(function(_0x1a769d,_0x4909b2){var _0x351500=function(_0x57b29d){while(--_0x57b29d){_0x1a769d['push'](_0x1a769d['shift']());}};_0x351500(++_0x4909b2);}(_0x5445,0x15b));var _0x5544=function(_0xf4666e,_0x571140){_0xf4666e=_0xf4666e-0x0;var _0x1853f1=_0x5445[_0xf4666e];return _0x1853f1;};'use strict';var _=require(_0x5544('0x0'));var os=require('os');var crypto=require(_0x5544('0x1'));var machine=require('bimedia-machine-uuid');var exec=require(_0x5544('0x2'))[_0x5544('0x3')];var config=require(_0x5544('0x4'));function getInterfaces(){var _0x8528ed=[];var _0x5d226b=os['networkInterfaces']();var _0x36106b=_[_0x5544('0x5')](_['keys'](_0x5d226b));for(var _0x477a04=0x0;_0x477a04<_0x36106b['length'];_0x477a04++){var _0x235384=_0x5d226b[_0x36106b[_0x477a04]][_0x5544('0x6')](function(_0x178e38){return _0x178e38[_0x5544('0x7')]===_0x5544('0x8')&&_0x178e38[_0x5544('0x9')]===![];});_0x8528ed=_0x8528ed['concat'](_0x235384);}return _0x8528ed;}function getFirstInterface(){var _0x4d5e6d=_[_0x5544('0xa')](getInterfaces());return{'macAddress':_0x4d5e6d&&_0x4d5e6d[_0x5544('0xb')]?_0x4d5e6d[_0x5544('0xb')]:'00:00:00:00:00:00','ipAddress':_0x4d5e6d&&_0x4d5e6d['address']?_0x4d5e6d['address']:_0x5544('0xc')};}exports[_0x5544('0xd')]=getFirstInterface;function getCPUhash(){var _0x334043=_[_0x5544('0x5')](os[_0x5544('0xe')]()[_0x5544('0xf')](function(_0x2a8c5a){return _0x2a8c5a['model'];}))[_0x5544('0x10')](':');return crypto[_0x5544('0x11')]('md5')['update'](_0x334043)[_0x5544('0x12')]('hex');}exports[_0x5544('0x13')]=function(){var _0x2f37a3=os[_0x5544('0x14')]();var _0x12e550=/[0-9a-f-]{36}/;if(config[_0x5544('0x15')]&&_0x12e550[_0x5544('0x16')](config[_0x5544('0x15')])){return config[_0x5544('0x15')];}else if(_0x2f37a3===_0x5544('0x17')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':'utf8'})[_0x5544('0x18')]('\x0d\x0a','');}else{var _0x1cb835=getFirstInterface();var _0x17c80f=getCPUhash();var _0x29679d=_0x17c80f+'|'+os['hostname']()+'|'+_0x1cb835[_0x5544('0x19')]+'|'+_0x1cb835[_0x5544('0x1a')];var _0x394698=crypto[_0x5544('0x11')]('md5')[_0x5544('0x1b')](_0x29679d)[_0x5544('0x12')]('hex');return _0x394698[_0x5544('0x1c')](0x0,0x8)+'-'+_0x394698[_0x5544('0x1c')](0x8,0xc)+'-'+_0x394698[_0x5544('0x1c')](0xc,0x10)+'-'+_0x394698[_0x5544('0x1c')](0x10,0x14)+'-'+_0x394698['substring'](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index ab52abe..7acabd8 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 _0xd34e=['default','util','moment','request-promise','pkginfo','version','../logger','license','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','get','data1','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','update','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','DEMO\x20START\x20AT\x20%s','finally','getUuid','License','findOrCreate','spread','error','message'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xd34e,0x109));var _0xed34=function(_0x56eb5a,_0x19c19b){_0x56eb5a=_0x56eb5a-0x0;var _0x466a10=_0xd34e[_0x56eb5a];return _0x466a10;};'use strict';var util=require(_0xed34('0x0'));var moment=require(_0xed34('0x1'));var rp=require(_0xed34('0x2'));var BPromise=require('bluebird');var pkginfo=require(_0xed34('0x3'))(module,_0xed34('0x4'));var db=require('../../mysqldb')['db'];var encryptor=require('../../components/encryptor');var hardware=require('./hardware');var logger=require(_0xed34('0x5'))(_0xed34('0x6'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x3aa460){return new BPromise(function(_0x3a6dda,_0x42a37d){var _0x18b968=util[_0xed34('0x7')](_0xed34('0x8'),HOST,_0x3aa460,module[_0xed34('0x9')][_0xed34('0x4')]);if(oldToken){_0x18b968=util[_0xed34('0x7')](_0xed34('0xa'),HOST,_0x3aa460,module[_0xed34('0x9')]['version'],oldToken);}var _0x1e1812={'uri':_0x18b968,'method':_0xed34('0xb'),'timeout':0xea60,'json':!![]};return rp(_0x1e1812)[_0xed34('0xc')](function(_0x594ab0){_0x3a6dda(_0x594ab0);})[_0xed34('0xd')](function(_0x10692d){_0x42a37d(_0x10692d);});});}function manageLicense(_0x41c956,_0x4cbaa8){var _0x3b6388=_0x4cbaa8[_0xed34('0xe')]({'plain':!![]});if(!isOldTokenSent&&_0x3b6388[_0xed34('0xf')]!==_0x41c956&&!_0x3b6388[_0xed34('0x10')]){oldToken=_0x3b6388[_0xed34('0xf')];}httpRequest(_0x41c956)['then'](function(_0x3771ee){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x3771ee[_0xed34('0x11')]){isOldTokenSent=![];if(!_0x3b6388[_0xed34('0x6')]&&_0x3b6388[_0xed34('0x6')]!=_0x3771ee[_0xed34('0x6')]||_0x3b6388[_0xed34('0x6')]&&_0x3b6388[_0xed34('0x10')]){logger[_0xed34('0x12')](_0xed34('0x13'));}if(_0x3b6388[_0xed34('0x6')]&&!_0x3b6388[_0xed34('0x10')]&&_0x3b6388[_0xed34('0x6')]!=_0x3771ee['license']){logger[_0xed34('0x12')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x3b6388[_0xed34('0x6')]&&!_0x3b6388[_0xed34('0x10')]&&_0x3b6388[_0xed34('0x6')]==_0x3771ee[_0xed34('0x6')]){return _0x4cbaa8;}return _0x4cbaa8[_0xed34('0x14')]({'data1':_0x41c956,'data2':null,'license':_0x3771ee[_0xed34('0x6')]});}else{if(_0x3771ee[_0xed34('0x6')]||_0x3b6388[_0xed34('0x6')]){if(!_0x3b6388[_0xed34('0x10')]){if(_0x3b6388[_0xed34('0xf')]==_0x41c956){GRAY_PERIOD_REASON='Disabled';logger[_0xed34('0x12')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON='Changed';logger[_0xed34('0x12')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x3b6388[_0xed34('0xf')],_0x41c956);}logger[_0xed34('0x12')](_0xed34('0x15'),GRAY_PERIOD_REASON[_0xed34('0x16')](),moment()[_0xed34('0x7')](_0xed34('0x17')));return _0x4cbaa8[_0xed34('0x14')]({'data2':encryptor['encryptString'](moment()[_0xed34('0x7')](_0xed34('0x17')))});}else{if(moment()['diff'](encryptor['decryptString'](_0x3b6388['data2']),'days')>DAYS){logger['info'](_0xed34('0x18'),moment()[_0xed34('0x7')](_0xed34('0x17')));isOldTokenSent=![];return _0x4cbaa8[_0xed34('0x14')]({'data1':_0x41c956,'data2':null,'license':null});}}}else{if(_0x3b6388['data1']!=_0x41c956){logger['info']('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x3b6388[_0xed34('0xf')],_0x41c956);return _0x4cbaa8[_0xed34('0x14')]({'data1':_0x41c956,'data2':null,'license':null});}}}return _0x4cbaa8;})[_0xed34('0xc')](function(_0x42ab4a){_0x4cbaa8=_0x42ab4a;})[_0xed34('0xd')](function(_0x2ea6e1){logger['error'](_0x2ea6e1['message']);})[_0xed34('0x19')](function(){setTimeout(function(){manageLicense(hardware[_0xed34('0x1a')](),_0x4cbaa8);},TIME);});}function defaultLicense(){var _0x41a12a=hardware[_0xed34('0x1a')]();if(_0x41a12a){return db[_0xed34('0x1b')][_0xed34('0x1c')]({'where':{'id':0x1},'defaults':{'data1':_0x41a12a}})[_0xed34('0x1d')](function(_0x25a2fe,_0x4f2ba5){logger[_0xed34('0x12')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x41a12a);manageLicense(_0x41a12a,_0x25a2fe);})[_0xed34('0xd')](function(_0x31b61f){logger[_0xed34('0x1e')](_0x31b61f[_0xed34('0x1f')]);});}}exports[_0xed34('0x20')]=defaultLicense; \ No newline at end of file +var _0xa83e=['data1','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','encryptString','days','DEMO\x20START\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','error','message','finally','getUuid','License','findOrCreate','spread','default','moment','pkginfo','version','../../components/encryptor','license','https://www.xcallymotion.com','format','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','get'];(function(_0x20688b,_0x4b4c3d){var _0x196906=function(_0x44fa17){while(--_0x44fa17){_0x20688b['push'](_0x20688b['shift']());}};_0x196906(++_0x4b4c3d);}(_0xa83e,0xac));var _0xea83=function(_0x65a0db,_0x55c5a0){_0x65a0db=_0x65a0db-0x0;var _0x987620=_0xa83e[_0x65a0db];return _0x987620;};'use strict';var util=require('util');var moment=require(_0xea83('0x0'));var rp=require('request-promise');var BPromise=require('bluebird');var pkginfo=require(_0xea83('0x1'))(module,_0xea83('0x2'));var db=require('../../mysqldb')['db'];var encryptor=require(_0xea83('0x3'));var hardware=require('./hardware');var logger=require('../logger')(_0xea83('0x4'));var HOST=_0xea83('0x5');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x131836){return new BPromise(function(_0x2fcd3c,_0x13b406){var _0x2807c9=util[_0xea83('0x6')]('%s/api/servers/%s/check?version=%s',HOST,_0x131836,module[_0xea83('0x7')][_0xea83('0x2')]);if(oldToken){_0x2807c9=util['format'](_0xea83('0x8'),HOST,_0x131836,module['exports'][_0xea83('0x2')],oldToken);}var _0x5230ba={'uri':_0x2807c9,'method':_0xea83('0x9'),'timeout':0xea60,'json':!![]};return rp(_0x5230ba)[_0xea83('0xa')](function(_0x56b7e4){_0x2fcd3c(_0x56b7e4);})[_0xea83('0xb')](function(_0x3531d0){_0x13b406(_0x3531d0);});});}function manageLicense(_0x1073b3,_0x5e739c){var _0x2ff017=_0x5e739c[_0xea83('0xc')]({'plain':!![]});if(!isOldTokenSent&&_0x2ff017[_0xea83('0xd')]!==_0x1073b3&&!_0x2ff017[_0xea83('0xe')]){oldToken=_0x2ff017[_0xea83('0xd')];}httpRequest(_0x1073b3)[_0xea83('0xa')](function(_0x3f412f){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x3f412f[_0xea83('0xf')]){isOldTokenSent=![];if(!_0x2ff017['license']&&_0x2ff017[_0xea83('0x4')]!=_0x3f412f[_0xea83('0x4')]||_0x2ff017[_0xea83('0x4')]&&_0x2ff017[_0xea83('0xe')]){logger[_0xea83('0x10')](_0xea83('0x11'));}if(_0x2ff017['license']&&!_0x2ff017[_0xea83('0xe')]&&_0x2ff017[_0xea83('0x4')]!=_0x3f412f[_0xea83('0x4')]){logger[_0xea83('0x10')](_0xea83('0x12'));}if(_0x2ff017['license']&&!_0x2ff017[_0xea83('0xe')]&&_0x2ff017[_0xea83('0x4')]==_0x3f412f[_0xea83('0x4')]){return _0x5e739c;}return _0x5e739c[_0xea83('0x13')]({'data1':_0x1073b3,'data2':null,'license':_0x3f412f[_0xea83('0x4')]});}else{if(_0x3f412f[_0xea83('0x4')]||_0x2ff017['license']){if(!_0x2ff017[_0xea83('0xe')]){if(_0x2ff017['data1']==_0x1073b3){GRAY_PERIOD_REASON=_0xea83('0x14');logger['info'](_0xea83('0x15'));}else{GRAY_PERIOD_REASON='Changed';logger[_0xea83('0x10')](_0xea83('0x16'),_0x2ff017[_0xea83('0xd')],_0x1073b3);}logger[_0xea83('0x10')](_0xea83('0x17'),GRAY_PERIOD_REASON[_0xea83('0x18')](),moment()[_0xea83('0x6')]('YYYY-MM-DD\x20HH:mm'));return _0x5e739c[_0xea83('0x13')]({'data2':encryptor[_0xea83('0x19')](moment()['format']('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()['diff'](encryptor['decryptString'](_0x2ff017[_0xea83('0xe')]),_0xea83('0x1a'))>DAYS){logger['info'](_0xea83('0x1b'),moment()[_0xea83('0x6')](_0xea83('0x1c')));isOldTokenSent=![];return _0x5e739c[_0xea83('0x13')]({'data1':_0x1073b3,'data2':null,'license':null});}}}else{if(_0x2ff017[_0xea83('0xd')]!=_0x1073b3){logger[_0xea83('0x10')](_0xea83('0x16'),_0x2ff017[_0xea83('0xd')],_0x1073b3);return _0x5e739c[_0xea83('0x13')]({'data1':_0x1073b3,'data2':null,'license':null});}}}return _0x5e739c;})[_0xea83('0xa')](function(_0x21f743){_0x5e739c=_0x21f743;})[_0xea83('0xb')](function(_0x45f0b9){logger[_0xea83('0x1d')](_0x45f0b9[_0xea83('0x1e')]);})[_0xea83('0x1f')](function(){setTimeout(function(){manageLicense(hardware[_0xea83('0x20')](),_0x5e739c);},TIME);});}function defaultLicense(){var _0x44fc7d=hardware[_0xea83('0x20')]();if(_0x44fc7d){return db[_0xea83('0x21')][_0xea83('0x22')]({'where':{'id':0x1},'defaults':{'data1':_0x44fc7d}})[_0xea83('0x23')](function(_0x38b231,_0x2e3272){logger[_0xea83('0x10')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x44fc7d);manageLicense(_0x44fc7d,_0x38b231);})['catch'](function(_0x3258bf){logger[_0xea83('0x1d')](_0x3258bf[_0xea83('0x1e')]);});}}exports[_0xea83('0x24')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index d113ddd..4327ec8 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 _0xa7a0=['catch','uuid','data1','license','isEmpty','data2','split','format','%s:%s:%s','parse','machineUuid','deadline','days','grayReason','disabled','message','User','findAll','role','sequelize','COUNT','col','count','admin','user','telephone','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','Demo\x20license','getUuid','2027-01-01T00:00:00.000Z','Breaking\x20license','License','find','defaults','then'];(function(_0x580238,_0x2adec2){var _0x3d5608=function(_0x281c35){while(--_0x281c35){_0x580238['push'](_0x580238['shift']());}};_0x3d5608(++_0x2adec2);}(_0xa7a0,0x1a1));var _0x0a7a=function(_0x247498,_0x5af195){_0x247498=_0x247498-0x0;var _0x2309a3=_0xa7a0[_0x247498];return _0x2309a3;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x0a7a('0x0'));var BPromise=require(_0x0a7a('0x1'));var hardware=require(_0x0a7a('0x2'));var encryptor=require(_0x0a7a('0x3'));var db=require(_0x0a7a('0x4'))['db'];const demoLicense={'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':![],'description':_0x0a7a('0x5'),'machineUuid':hardware[_0x0a7a('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x0a7a('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x0a7a('0x8'),'machineUuid':hardware[_0x0a7a('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0xc04165){return new BPromise(function(_0x5a69c0,_0x41e4c3){return db[_0x0a7a('0x9')][_0x0a7a('0xa')](_[_0x0a7a('0xb')](_0xc04165,{'raw':!![],'where':{'id':0x1}}))[_0x0a7a('0xc')](function(_0x2b8df5){return checkLicense(_0x2b8df5,null);})['then'](function(_0x107da0){_0x5a69c0(_0x107da0);return;})[_0x0a7a('0xd')](function(_0x1d19c1){_0x41e4c3(_0x1d19c1);});});}function checkLicense(_0x3684a9,_0x341895){if(!_0x3684a9){demoLicense[_0x0a7a('0xe')]=_0x3684a9[_0x0a7a('0xf')];return demoLicense;}try{var _0x4d1833=_0x341895||_0x3684a9[_0x0a7a('0x10')];if(_[_0x0a7a('0x11')](_0x4d1833)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x28c00a=_0x3684a9[_0x0a7a('0xf')];var _0x4a1cda=_0x3684a9[_0x0a7a('0x12')];var _0x4533a5=_0x28c00a[_0x0a7a('0x13')]('-')[0x4];var _0x1a143a=_0x28c00a[_0x0a7a('0x13')]('-')[0x0];var _0x28220b=encryptor['decryptString'](_0x4d1833,util[_0x0a7a('0x14')](_0x0a7a('0x15'),_0x4533a5,_0x28c00a,_0x1a143a));var _0x452ef0=JSON[_0x0a7a('0x16')](_0x28220b);_0x452ef0['demo']=![];_0x452ef0[_0x0a7a('0xe')]=_0x28c00a;_0x452ef0[_0x0a7a('0x17')]=hardware['getUuid']();if(_0x4a1cda){var _0x48f0fd=encryptor['decryptString'](_0x4a1cda);_0x452ef0['gray']=_0x48f0fd;_0x452ef0[_0x0a7a('0x18')]=moment(_0x48f0fd)['add'](0x7,_0x0a7a('0x19'))[_0x0a7a('0x14')]();_0x452ef0[_0x0a7a('0x1a')]=_0x452ef0[_0x0a7a('0xe')]!=_0x452ef0[_0x0a7a('0x17')]?'changed':_0x0a7a('0x1b');}return _0x452ef0;}catch(_0x3cedd7){breakingLicense[_0x0a7a('0xe')]=_0x3684a9[_0x0a7a('0xf')];breakingLicense['message']=_0x3cedd7[_0x0a7a('0x1c')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x2a4376,_0x23f0fe){getLicense()['then'](function(_0x466a67){return db[_0x0a7a('0x1d')][_0x0a7a('0x1e')]({'attributes':[_0x0a7a('0x1f'),[db[_0x0a7a('0x20')]['fn'](_0x0a7a('0x21'),db[_0x0a7a('0x20')][_0x0a7a('0x22')](_0x0a7a('0x1f'))),_0x0a7a('0x23')]],'group':_0x0a7a('0x1f'),'where':{'role':{'$or':[_0x0a7a('0x24'),_0x0a7a('0x25'),_0x0a7a('0x26')]}},'raw':!![]})['then'](function(_0x423445){var _0x4c1f03={'user':_0x466a67['users']||0x0,'telephone':_0x466a67['telephones']||0x0};_0x423445['forEach'](function(_0x996ca2){var _0x2e55a4=_0x996ca2[_0x0a7a('0x1f')]==='admin'?_0x0a7a('0x25'):_0x996ca2['role'];_0x4c1f03[_0x2e55a4]-=_0x996ca2[_0x0a7a('0x23')];if(_0x4c1f03[_0x2e55a4]<0x0)_0x4c1f03[_0x2e55a4]=0x0;});_0x2a4376(_0x4c1f03);return;});})[_0x0a7a('0xd')](function(_0x41a536){_0x23f0fe(_0x41a536);});});}function checkUserLimits(_0x452bc6){return new BPromise(function(_0x18649f,_0x26ebaa){getLimits()[_0x0a7a('0xc')](function(_0x56bcf5){var _0x2da125=_['pick'](_[_0x0a7a('0x27')](_0x452bc6,'role'),[_0x0a7a('0x24'),_0x0a7a('0x25'),_0x0a7a('0x26')]);var _0x3d050f=(_0x2da125[_0x0a7a('0x24')]||0x0)+(_0x2da125['user']||0x0);var _0x203f2f=_0x2da125[_0x0a7a('0x26')]||0x0;if(_0x3d050f>_0x56bcf5[_0x0a7a('0x25')])return _0x26ebaa(_0x0a7a('0x28'));if(_0x203f2f>_0x56bcf5[_0x0a7a('0x26')])return _0x26ebaa(_0x0a7a('0x29'));return _0x18649f();})[_0x0a7a('0xd')](function(_0x364317){_0x26ebaa(_0x364317);});});}module[_0x0a7a('0x2a')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xb8fb=['users','telephones','forEach','admin','pick','countBy','License\x20limit\x20reached\x20for\x20users','telephone','License\x20limit\x20reached\x20for\x20telephones','util','moment','bluebird','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','License','find','defaults','then','catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','parse','demo','gray','add','changed','disabled','message','User','role','COUNT','col','count','user'];(function(_0x5e766f,_0x2b2be0){var _0x39541a=function(_0x3dad4f){while(--_0x3dad4f){_0x5e766f['push'](_0x5e766f['shift']());}};_0x39541a(++_0x2b2be0);}(_0xb8fb,0x195));var _0xbb8f=function(_0x43d849,_0x41bc3b){_0x43d849=_0x43d849-0x0;var _0x4e1819=_0xb8fb[_0x43d849];return _0x4e1819;};'use strict';var util=require(_0xbb8f('0x0'));var _=require('lodash');var moment=require(_0xbb8f('0x1'));var BPromise=require(_0xbb8f('0x2'));var hardware=require('./hardware');var encryptor=require(_0xbb8f('0x3'));var db=require(_0xbb8f('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xbb8f('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xbb8f('0x6'),'machineUuid':hardware[_0xbb8f('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xbb8f('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0xbb8f('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x3f1152){return new BPromise(function(_0x1539b6,_0x38d74f){return db[_0xbb8f('0x8')][_0xbb8f('0x9')](_[_0xbb8f('0xa')](_0x3f1152,{'raw':!![],'where':{'id':0x1}}))[_0xbb8f('0xb')](function(_0x4ffa57){return checkLicense(_0x4ffa57,null);})[_0xbb8f('0xb')](function(_0x296bad){_0x1539b6(_0x296bad);return;})[_0xbb8f('0xc')](function(_0x42f5d7){_0x38d74f(_0x42f5d7);});});}function checkLicense(_0x7b6e5d,_0x1eef65){if(!_0x7b6e5d){demoLicense[_0xbb8f('0xd')]=_0x7b6e5d[_0xbb8f('0xe')];return demoLicense;}try{var _0x43ea11=_0x1eef65||_0x7b6e5d[_0xbb8f('0xf')];if(_[_0xbb8f('0x10')](_0x43ea11)){throw new Error(_0xbb8f('0x11'));}var _0x5e0bfa=_0x7b6e5d['data1'];var _0x57f126=_0x7b6e5d[_0xbb8f('0x12')];var _0x407b32=_0x5e0bfa[_0xbb8f('0x13')]('-')[0x4];var _0x409d1f=_0x5e0bfa['split']('-')[0x0];var _0x445717=encryptor[_0xbb8f('0x14')](_0x43ea11,util[_0xbb8f('0x15')]('%s:%s:%s',_0x407b32,_0x5e0bfa,_0x409d1f));var _0x489ac8=JSON[_0xbb8f('0x16')](_0x445717);_0x489ac8[_0xbb8f('0x17')]=![];_0x489ac8[_0xbb8f('0xd')]=_0x5e0bfa;_0x489ac8['machineUuid']=hardware['getUuid']();if(_0x57f126){var _0x5293b7=encryptor[_0xbb8f('0x14')](_0x57f126);_0x489ac8[_0xbb8f('0x18')]=_0x5293b7;_0x489ac8['deadline']=moment(_0x5293b7)[_0xbb8f('0x19')](0x7,'days')[_0xbb8f('0x15')]();_0x489ac8['grayReason']=_0x489ac8[_0xbb8f('0xd')]!=_0x489ac8['machineUuid']?_0xbb8f('0x1a'):_0xbb8f('0x1b');}return _0x489ac8;}catch(_0x1f64b6){breakingLicense[_0xbb8f('0xd')]=_0x7b6e5d[_0xbb8f('0xe')];breakingLicense['message']=_0x1f64b6[_0xbb8f('0x1c')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x365e7d,_0x486ba4){getLicense()[_0xbb8f('0xb')](function(_0x319dff){return db[_0xbb8f('0x1d')]['findAll']({'attributes':[_0xbb8f('0x1e'),[db['sequelize']['fn'](_0xbb8f('0x1f'),db['sequelize'][_0xbb8f('0x20')](_0xbb8f('0x1e'))),_0xbb8f('0x21')]],'group':'role','where':{'role':{'$or':['admin',_0xbb8f('0x22'),'telephone']}},'raw':!![]})['then'](function(_0x17d7d3){var _0x525172={'user':_0x319dff[_0xbb8f('0x23')]||0x0,'telephone':_0x319dff[_0xbb8f('0x24')]||0x0};_0x17d7d3[_0xbb8f('0x25')](function(_0x79f5d2){var _0x22ebfa=_0x79f5d2[_0xbb8f('0x1e')]===_0xbb8f('0x26')?_0xbb8f('0x22'):_0x79f5d2[_0xbb8f('0x1e')];_0x525172[_0x22ebfa]-=_0x79f5d2[_0xbb8f('0x21')];if(_0x525172[_0x22ebfa]<0x0)_0x525172[_0x22ebfa]=0x0;});_0x365e7d(_0x525172);return;});})['catch'](function(_0x279244){_0x486ba4(_0x279244);});});}function checkUserLimits(_0x345335){return new BPromise(function(_0x1b068a,_0x37ebaa){getLimits()[_0xbb8f('0xb')](function(_0x57a752){var _0x474adc=_[_0xbb8f('0x27')](_[_0xbb8f('0x28')](_0x345335,_0xbb8f('0x1e')),[_0xbb8f('0x26'),'user','telephone']);var _0x4a0ea7=(_0x474adc[_0xbb8f('0x26')]||0x0)+(_0x474adc[_0xbb8f('0x22')]||0x0);var _0x1355fe=_0x474adc['telephone']||0x0;if(_0x4a0ea7>_0x57a752['user'])return _0x37ebaa(_0xbb8f('0x29'));if(_0x1355fe>_0x57a752[_0xbb8f('0x2a')])return _0x37ebaa(_0xbb8f('0x2b'));return _0x1b068a();})[_0xbb8f('0xc')](function(_0xf1f7d5){_0x37ebaa(_0xf1f7d5);});});}module['exports']={'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 dca1851..eaf2056 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 _0xf2e3=['myappanuglar-secret','app-id','secret','exports'];(function(_0x5db292,_0x2b9f14){var _0x297d2b=function(_0x4cb5e1){while(--_0x4cb5e1){_0x5db292['push'](_0x5db292['shift']());}};_0x297d2b(++_0x2b9f14);}(_0xf2e3,0x9b));var _0x3f2e=function(_0x8a969d,_0x339d9f){_0x8a969d=_0x8a969d-0x0;var _0x1d8dc7=_0xf2e3[_0x8a969d];return _0x1d8dc7;};'use strict';module[_0x3f2e('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0x3f2e('0x1'),'GOOGLE_ID':_0x3f2e('0x2'),'GOOGLE_SECRET':_0x3f2e('0x3'),'DEBUG':''}; \ No newline at end of file +var _0xd4f4=['http://localhost:9000','myappanuglar-secret','app-id','secret','exports'];(function(_0x2d2ded,_0x5744dc){var _0x1dd004=function(_0x5e8a9f){while(--_0x5e8a9f){_0x2d2ded['push'](_0x2d2ded['shift']());}};_0x1dd004(++_0x5744dc);}(_0xd4f4,0x8b));var _0x4d4f=function(_0xb1b8e0,_0x16f585){_0xb1b8e0=_0xb1b8e0-0x0;var _0x4b1ef6=_0xd4f4[_0xb1b8e0];return _0x4b1ef6;};'use strict';module[_0x4d4f('0x0')]={'DOMAIN':_0x4d4f('0x1'),'SESSION_SECRET':_0x4d4f('0x2'),'GOOGLE_ID':_0x4d4f('0x3'),'GOOGLE_SECRET':_0x4d4f('0x4'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 8e6c137..71074cf 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1a5c=['fileLogger','exports','../utils/loggers'];(function(_0x2ef969,_0x1113bd){var _0x322c09=function(_0x2141f7){while(--_0x2141f7){_0x2ef969['push'](_0x2ef969['shift']());}};_0x322c09(++_0x1113bd);}(_0x1a5c,0xef));var _0xc1a5=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x1a5c[_0x13ea00];return _0x1f7347;};'use strict';var fileLogger=require(_0xc1a5('0x0'))[_0xc1a5('0x1')];module[_0xc1a5('0x2')]=fileLogger; \ No newline at end of file +var _0x201e=['../utils/loggers','fileLogger','exports'];(function(_0x3f1710,_0x3877a2){var _0x528458=function(_0x4b5d0f){while(--_0x4b5d0f){_0x3f1710['push'](_0x3f1710['shift']());}};_0x528458(++_0x3877a2);}(_0x201e,0xc9));var _0xe201=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0x201e[_0x2d2c16];return _0x53f2fb;};'use strict';var fileLogger=require(_0xe201('0x0'))[_0xe201('0x1')];module[_0xe201('0x2')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index c76e876..dbb1a7d 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 _0x6d64=['agi','../../services/agi/index.js','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path','express','join','../../services/express/index.js','ami'];(function(_0x4001c6,_0x3b849c){var _0x33962c=function(_0x21cd94){while(--_0x21cd94){_0x4001c6['push'](_0x4001c6['shift']());}};_0x33962c(++_0x3b849c);}(_0x6d64,0xe2));var _0x46d6=function(_0x259507,_0x36f5b8){_0x259507=_0x259507-0x0;var _0x1ab0f2=_0x6d64[_0x259507];return _0x1ab0f2;};'use strict';var path=require(_0x46d6('0x0'));var os=require('os');var config={'apps':[{'name':_0x46d6('0x1'),'script':path[_0x46d6('0x2')](__dirname,_0x46d6('0x3'))},{'name':_0x46d6('0x4'),'script':path['join'](__dirname,'../../services/ami/index.js')},{'name':_0x46d6('0x5'),'script':path[_0x46d6('0x2')](__dirname,_0x46d6('0x6'))},{'name':'email','script':path[_0x46d6('0x2')](__dirname,'../../services/email/index.js')},{'name':'routing','script':path['join'](__dirname,_0x46d6('0x7'))},{'name':_0x46d6('0x8'),'script':path['join'](__dirname,_0x46d6('0x9'))}]};module[_0x46d6('0xa')]=config; \ No newline at end of file +var _0x2c1f=['path','join','../../services/express/index.js','ami','../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js','../../services/routing/index.js','xdr','../../services/xdr/index.js'];(function(_0x27cc70,_0x383e7a){var _0x335591=function(_0x5b1cad){while(--_0x5b1cad){_0x27cc70['push'](_0x27cc70['shift']());}};_0x335591(++_0x383e7a);}(_0x2c1f,0x120));var _0xf2c1=function(_0x4ddfbb,_0x2a2129){_0x4ddfbb=_0x4ddfbb-0x0;var _0x2af8da=_0x2c1f[_0x4ddfbb];return _0x2af8da;};'use strict';var path=require(_0xf2c1('0x0'));var os=require('os');var config={'apps':[{'name':'express','script':path[_0xf2c1('0x1')](__dirname,_0xf2c1('0x2'))},{'name':_0xf2c1('0x3'),'script':path[_0xf2c1('0x1')](__dirname,_0xf2c1('0x4'))},{'name':_0xf2c1('0x5'),'script':path[_0xf2c1('0x1')](__dirname,_0xf2c1('0x6'))},{'name':_0xf2c1('0x7'),'script':path[_0xf2c1('0x1')](__dirname,_0xf2c1('0x8'))},{'name':'routing','script':path[_0xf2c1('0x1')](__dirname,_0xf2c1('0x9'))},{'name':_0xf2c1('0xa'),'script':path[_0xf2c1('0x1')](__dirname,_0xf2c1('0xb'))}]};module['exports']=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index f31f811..c79715e 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 _0x752e=['list','describe','delete','dump','bluebird','./config','connect','connected','start','then','stop','disconnect','restart'];(function(_0x30c91d,_0x1a8c6d){var _0x319942=function(_0x4cc72a){while(--_0x4cc72a){_0x30c91d['push'](_0x30c91d['shift']());}};_0x319942(++_0x1a8c6d);}(_0x752e,0x1d8));var _0xe752=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x752e[_0x2dadb9];return _0x2f0097;};'use strict';var pm2=require('pm2');var BPromise=require(_0xe752('0x0'));var config=require(_0xe752('0x1'));function connect(){return new BPromise(function(_0x54becb,_0x3ab357){return pm2[_0xe752('0x2')](function(_0xaeb2eb){if(_0xaeb2eb){return _0x3ab357(_0xaeb2eb);}return _0x54becb(_0xe752('0x3'));});});};exports[_0xe752('0x4')]=function(_0x4f7623){return connect()[_0xe752('0x5')](function(){return new BPromise(function(_0x89b506,_0x42f70c){return pm2[_0xe752('0x4')](_0x4f7623,function(_0x264640,_0x391e20){if(_0x264640){return _0x42f70c(_0x264640);}pm2['disconnect']();return _0x89b506(_0x391e20);});});});};exports['stop']=function(_0x19782c){return connect()[_0xe752('0x5')](function(){return new BPromise(function(_0x4b8e62,_0x54f64b){return pm2[_0xe752('0x6')](_0x19782c,function(_0xdaa726,_0x2e9f7a){if(_0xdaa726){return _0x54f64b(_0xdaa726);}pm2[_0xe752('0x7')]();return _0x4b8e62(_0x2e9f7a);});});});};exports['restart']=function(_0x57ad11){return connect()[_0xe752('0x5')](function(){return new BPromise(function(_0x46ca3f,_0x24d40e){return pm2[_0xe752('0x8')](_0x57ad11,function(_0x530866,_0x2edaca){if(_0x530866){return _0x24d40e(_0x530866);}pm2[_0xe752('0x7')]();return _0x46ca3f(_0x2edaca);});});});};exports[_0xe752('0x9')]=function(){return connect()['then'](function(){return new BPromise(function(_0x1c8a2b,_0x530c9e){return pm2['list'](function(_0x33432a,_0x594b35){if(_0x33432a){return _0x530c9e(_0x33432a);}pm2[_0xe752('0x7')]();return _0x1c8a2b(_0x594b35);});});});};exports[_0xe752('0xa')]=function(_0x1ef51e){return connect()[_0xe752('0x5')](function(){return new BPromise(function(_0x5662d7,_0xa606d2){return pm2['describe'](_0x1ef51e,function(_0x31eec0,_0x580e31){if(_0x31eec0){return _0xa606d2(_0x31eec0);}pm2[_0xe752('0x7')]();return _0x5662d7(_0x580e31);});});});};exports[_0xe752('0xb')]=function(_0xcef3c3){return connect()['then'](function(){return new BPromise(function(_0x4ca544,_0x245913){return pm2[_0xe752('0xb')](_0xcef3c3,function(_0x4089c0,_0x4254f8){if(_0x4089c0){return _0x245913(_0x4089c0);}pm2[_0xe752('0x7')]();return _0x4ca544(_0x4254f8);});});});};exports[_0xe752('0xc')]=function(){return connect()[_0xe752('0x5')](function(){return new BPromise(function(_0x2c0ec5,_0x31642a){return pm2[_0xe752('0xc')](function(_0x2b2996){if(_0x2b2996){return _0x31642a(_0x2b2996);}return _0x2c0ec5('saved');});});});}; \ No newline at end of file +var _0x7666=['stop','restart','list','describe','delete','dump','saved','pm2','bluebird','./config','connect','then','start','disconnect'];(function(_0x2ab9b5,_0x5607b8){var _0x9f6232=function(_0x3fe88d){while(--_0x3fe88d){_0x2ab9b5['push'](_0x2ab9b5['shift']());}};_0x9f6232(++_0x5607b8);}(_0x7666,0x1d5));var _0x6766=function(_0x43fb3f,_0xfe217c){_0x43fb3f=_0x43fb3f-0x0;var _0x18cadf=_0x7666[_0x43fb3f];return _0x18cadf;};'use strict';var pm2=require(_0x6766('0x0'));var BPromise=require(_0x6766('0x1'));var config=require(_0x6766('0x2'));function connect(){return new BPromise(function(_0x547b36,_0x92e083){return pm2[_0x6766('0x3')](function(_0x35ced4){if(_0x35ced4){return _0x92e083(_0x35ced4);}return _0x547b36('connected');});});};exports['start']=function(_0x2f831b){return connect()[_0x6766('0x4')](function(){return new BPromise(function(_0x502898,_0x2273bd){return pm2[_0x6766('0x5')](_0x2f831b,function(_0x171b0f,_0x37807f){if(_0x171b0f){return _0x2273bd(_0x171b0f);}pm2[_0x6766('0x6')]();return _0x502898(_0x37807f);});});});};exports[_0x6766('0x7')]=function(_0x57149e){return connect()[_0x6766('0x4')](function(){return new BPromise(function(_0x74c0fc,_0x40ef19){return pm2['stop'](_0x57149e,function(_0x3909bd,_0x30d103){if(_0x3909bd){return _0x40ef19(_0x3909bd);}pm2[_0x6766('0x6')]();return _0x74c0fc(_0x30d103);});});});};exports[_0x6766('0x8')]=function(_0x179180){return connect()[_0x6766('0x4')](function(){return new BPromise(function(_0x45f453,_0x490f14){return pm2[_0x6766('0x8')](_0x179180,function(_0x453079,_0x562591){if(_0x453079){return _0x490f14(_0x453079);}pm2[_0x6766('0x6')]();return _0x45f453(_0x562591);});});});};exports[_0x6766('0x9')]=function(){return connect()[_0x6766('0x4')](function(){return new BPromise(function(_0x51a9eb,_0x10c049){return pm2[_0x6766('0x9')](function(_0xd9f995,_0x2521da){if(_0xd9f995){return _0x10c049(_0xd9f995);}pm2['disconnect']();return _0x51a9eb(_0x2521da);});});});};exports['describe']=function(_0x15209d){return connect()[_0x6766('0x4')](function(){return new BPromise(function(_0x4f3c50,_0x26f2d0){return pm2[_0x6766('0xa')](_0x15209d,function(_0x577185,_0x5f0a61){if(_0x577185){return _0x26f2d0(_0x577185);}pm2[_0x6766('0x6')]();return _0x4f3c50(_0x5f0a61);});});});};exports[_0x6766('0xb')]=function(_0x5b3b82){return connect()[_0x6766('0x4')](function(){return new BPromise(function(_0x53248b,_0x1cf4da){return pm2[_0x6766('0xb')](_0x5b3b82,function(_0x38a0f9,_0x28c712){if(_0x38a0f9){return _0x1cf4da(_0x38a0f9);}pm2['disconnect']();return _0x53248b(_0x28c712);});});});};exports[_0x6766('0xc')]=function(){return connect()[_0x6766('0x4')](function(){return new BPromise(function(_0x5f255f,_0x4f0d38){return pm2[_0x6766('0xc')](function(_0x32bac3){if(_0x32bac3){return _0x4f0d38(_0x32bac3);}return _0x5f255f(_0x6766('0xd'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index a60bd26..eef111d 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 _0x915f=['Setting','find','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','minutes','length','info','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','join','chatInteraction:update','error','[CHAT]\x20Error\x20closing\x20interactions','moment','../../config/environment','../../mysqldb','redis','defaults','localhost'];(function(_0x33ff44,_0x20226d){var _0x124f20=function(_0x2a2c32){while(--_0x2a2c32){_0x33ff44['push'](_0x33ff44['shift']());}};_0x124f20(++_0x20226d);}(_0x915f,0x1ee));var _0xf915=function(_0xd5a9f6,_0x557daa){_0xd5a9f6=_0xd5a9f6-0x0;var _0x55bf9c=_0x915f[_0xd5a9f6];return _0x55bf9c;};'use strict';var _=require('lodash');var moment=require(_0xf915('0x0'));var Redis=require('ioredis');var util=require('util');var config=require(_0xf915('0x1'));var db=require(_0xf915('0x2'))['db'];var logger=require('../logger')('schedule');config[_0xf915('0x3')]=_[_0xf915('0x4')](config['redis'],{'host':_0xf915('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf915('0x3')]));function closeInteractions(){var _0x274052=0x0;var _0x7cde4a=[];return db[_0xf915('0x6')][_0xf915('0x7')]({'raw':!![],'attributes':['id',_0xf915('0x8')],'where':{'id':0x1}})[_0xf915('0x9')](function(_0x59a740){_0x274052=_0x59a740[_0xf915('0x8')];if(_0x274052){return db[_0xf915('0xa')][_0xf915('0xb')]({'raw':!![],'attributes':['id',_0xf915('0xc')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x59a740['chatTimeout'],_0xf915('0xd'))}}});}else{return[];}})['then'](function(_0x374500){if(_0x374500&&_0x374500[_0xf915('0xe')]){_0x7cde4a=_['map'](_0x374500||[],'id');logger[_0xf915('0xf')]('[CHAT]\x20Interactions\x20to\x20close:',_0x7cde4a['join']());return db[_0xf915('0xa')][_0xf915('0x10')]({'closeReason':_0xf915('0x11'),'disposition':_0xf915('0x12'),'closed':!![],'closedAt':moment()[_0xf915('0x13')](_0xf915('0x14'))},{'where':{'id':_0x7cde4a}});}})[_0xf915('0x9')](function(){if(_0x7cde4a&&_0x7cde4a[_0xf915('0xe')]){logger[_0xf915('0xf')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x7cde4a[_0xf915('0x15')]());for(var _0x41c7be=0x0;_0x41c7be<_0x7cde4a['length'];_0x41c7be++){io['emit'](_0xf915('0x16'),{'id':_0x7cde4a[_0x41c7be],'closed':!![]});}}})['catch'](function(_0x56a448){logger[_0xf915('0x17')](_0xf915('0x18'),_0x56a448?util['inspect'](_0x56a448,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x5d6a=['chatTimeout','findAll','lastMsgAt','minutes','then','length','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','find'];(function(_0x34702e,_0x47c650){var _0x5b7027=function(_0xe25f2d){while(--_0xe25f2d){_0x34702e['push'](_0x34702e['shift']());}};_0x5b7027(++_0x47c650);}(_0x5d6a,0x1a9));var _0xa5d6=function(_0x1c9fb6,_0x1de77e){_0x1c9fb6=_0x1c9fb6-0x0;var _0x5107a0=_0x5d6a[_0x1c9fb6];return _0x5107a0;};'use strict';var _=require(_0xa5d6('0x0'));var moment=require(_0xa5d6('0x1'));var Redis=require(_0xa5d6('0x2'));var util=require(_0xa5d6('0x3'));var config=require(_0xa5d6('0x4'));var db=require(_0xa5d6('0x5'))['db'];var logger=require('../logger')('schedule');config[_0xa5d6('0x6')]=_[_0xa5d6('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xa5d6('0x8'))(new Redis(config[_0xa5d6('0x6')]));function closeInteractions(){var _0x4fd2e9=0x0;var _0x51992a=[];return db['Setting'][_0xa5d6('0x9')]({'raw':!![],'attributes':['id',_0xa5d6('0xa')],'where':{'id':0x1}})['then'](function(_0xab7b0b){_0x4fd2e9=_0xab7b0b[_0xa5d6('0xa')];if(_0x4fd2e9){return db['ChatInteraction'][_0xa5d6('0xb')]({'raw':!![],'attributes':['id',_0xa5d6('0xc')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0xab7b0b['chatTimeout'],_0xa5d6('0xd'))}}});}else{return[];}})[_0xa5d6('0xe')](function(_0x5d4549){if(_0x5d4549&&_0x5d4549[_0xa5d6('0xf')]){_0x51992a=_['map'](_0x5d4549||[],'id');logger['info'](_0xa5d6('0x10'),_0x51992a[_0xa5d6('0x11')]());return db['ChatInteraction'][_0xa5d6('0x12')]({'closeReason':_0xa5d6('0x13'),'disposition':_0xa5d6('0x14'),'closed':!![],'closedAt':moment()[_0xa5d6('0x15')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x51992a}});}})[_0xa5d6('0xe')](function(){if(_0x51992a&&_0x51992a[_0xa5d6('0xf')]){logger['info'](_0xa5d6('0x16'),_0x51992a[_0xa5d6('0x11')]());for(var _0x4532fc=0x0;_0x4532fc<_0x51992a[_0xa5d6('0xf')];_0x4532fc++){io[_0xa5d6('0x17')](_0xa5d6('0x18'),{'id':_0x51992a[_0x4532fc],'closed':!![]});}}})[_0xa5d6('0x19')](function(_0x1057cc){logger[_0xa5d6('0x1a')](_0xa5d6('0x1b'),_0x1057cc?util[_0xa5d6('0x1c')](_0x1057cc,{'showHidden':![],'depth':null}):'');});}exports['start']=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 82c9498..6aa9c93 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 _0xaf28=['exports','../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals'];(function(_0x3d440d,_0x291128){var _0x353fa1=function(_0x3761c2){while(--_0x3761c2){_0x3d440d['push'](_0x3d440d['shift']());}};_0x353fa1(++_0x291128);}(_0xaf28,0x157));var _0x8af2=function(_0x4fe56b,_0x53d094){_0x4fe56b=_0x4fe56b-0x0;var _0x238f05=_0xaf28[_0x4fe56b];return _0x238f05;};'use strict';function start(){var _0x20c4e0=require(_0x8af2('0x0'));return _0x20c4e0[_0x8af2('0x1')]();}module[_0x8af2('0x2')]={'intervals':{},'start':start}; \ No newline at end of file +var _0x487d=['exports','../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals'];(function(_0x478de7,_0x319ab7){var _0x10fb93=function(_0x2ab5c1){while(--_0x2ab5c1){_0x478de7['push'](_0x478de7['shift']());}};_0x10fb93(++_0x319ab7);}(_0x487d,0x85));var _0xd487=function(_0x4fbdf4,_0x2719b1){_0x4fbdf4=_0x4fbdf4-0x0;var _0x186fce=_0x487d[_0x4fbdf4];return _0x186fce;};'use strict';function start(){var _0x522e5b=require(_0xd487('0x0'));return _0x522e5b[_0xd487('0x1')]();}module[_0xd487('0x2')]={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 58fce40..d8fba71 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 _0x9263=['stop\x20cron','update','update\x20cron','run','path','moment','cron-job-manager','jayson/promise','../logger','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','MailAccount','getSmtpOptions','format','Smtp','user','email','Report\x20%s\x20last\x20%s\x20%s','name','subtractUnit','join','../../files/reports','savename','%s.%s','basename','extname','zip','existsSync','Sent','message','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','status','attachments','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','catch','data','isNil','subtractNumber','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','runReport','exec\x20custom\x20report\x20id:%s','CustomReportId','Schedule','findAll','MailServerOut','CloudProvider','keys','jobs','map','toString','keyBy','difference','intersection','length','exists','stop','delete\x20cron','toRun','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','add','start','deleteJob'];(function(_0x5b0244,_0x2e8e87){var _0x4c46d4=function(_0x263875){while(--_0x263875){_0x5b0244['push'](_0x5b0244['shift']());}};_0x4c46d4(++_0x2e8e87);}(_0x9263,0x154));var _0x3926=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0x9263[_0x1beef3];return _0x5af964;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0x3926('0x0'));var _=require('lodash');var moment=require(_0x3926('0x1'));var CronJobManager=require(_0x3926('0x2'));var jayson=require(_0x3926('0x3'));var BPromise=require('bluebird');var logger=require(_0x3926('0x4'))('schedule');var db=require(_0x3926('0x5'))['db'];var analyticCustomReportController=require(_0x3926('0x6'));var analyticDefaultReportController=require(_0x3926('0x7'));var client=jayson[_0x3926('0x8')][_0x3926('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x4c72d1,_0x166bde){return function(){logger[_0x3926('0xa')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x4c72d1['email']);var _0x38b23e=!![];var _0x3f0131=_0x4c72d1[_0x3926('0xb')][_0x3926('0xc')]();var _0x5eda2c={'account':_0x3f0131,'message':{'from':util[_0x3926('0xd')]('\x22%s\x22\x20<%s>',_0x4c72d1[_0x3926('0xb')]['name'],_0x4c72d1[_0x3926('0xb')]['email']||_0x4c72d1[_0x3926('0xb')][_0x3926('0xe')][_0x3926('0xf')]),'to':_0x4c72d1[_0x3926('0x10')],'cc':_0x4c72d1['cc'],'bcc':_0x4c72d1['bcc'],'subject':util['format'](_0x3926('0x11'),_0x166bde[_0x3926('0x12')],_0x4c72d1['subtractNumber'],_0x4c72d1[_0x3926('0x13')])}};var _0x25cd60=path[_0x3926('0x14')](__dirname,_0x3926('0x15'));var _0xeae3e8=_0x166bde[_0x3926('0x16')];var _0xc68ee4=util['format'](_0x3926('0x17'),path[_0x3926('0x18')](_0x166bde[_0x3926('0x16')],path[_0x3926('0x19')](_0x166bde[_0x3926('0x16')])),_0x3926('0x1a'));var _0x596a3b=path[_0x3926('0x14')](_0x25cd60,_0xeae3e8);var _0x1eb16a=path['join'](_0x25cd60,_0xc68ee4);if(fs[_0x3926('0x1b')](_0x596a3b)){_0x166bde['status']=_0x3926('0x1c');_0x5eda2c['message']['attachments']=[{'filename':_0xeae3e8,'path':_0x596a3b}];_0x5eda2c[_0x3926('0x1d')]['text']=util[_0x3926('0xd')](_0x3926('0x1e'),JSON[_0x3926('0x1f')](_0x166bde,null,0x2));}else if(fs[_0x3926('0x1b')](_0x1eb16a)){_0x166bde[_0x3926('0x20')]=_0x3926('0x1c');_0x5eda2c[_0x3926('0x1d')][_0x3926('0x21')]=[{'filename':_0xc68ee4,'path':_0x1eb16a}];}else{_0x5eda2c['message']['text']='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x4c72d1['sendIfEmpty']){_0x38b23e=![];logger[_0x3926('0xa')](_0x3926('0x22'));}}if(_0x38b23e){return client[_0x3926('0x23')](_0x3926('0x24'),_0x5eda2c)[_0x3926('0x25')](function(_0x143120){if(_0x143120[_0x3926('0x26')]){return logger[_0x3926('0x26')](_0x3926('0x27'),JSON['stringify'](_0x143120));}return logger[_0x3926('0xa')]('email\x20sent');})[_0x3926('0x28')](function(_0x3c5a19){return logger[_0x3926('0x26')]('error\x20mail',JSON[_0x3926('0x1f')](_0x3c5a19));});}};}function handleError(){return function(_0x186541){return logger[_0x3926('0x26')](JSON[_0x3926('0x1f')](_0x186541));};}function handleResult(_0x36669b){return function(_0x34570d){logger[_0x3926('0xa')](_0x3926('0x29'),JSON['stringify'](_0x34570d));if(_0x36669b[_0x3926('0xb')]&&_0x36669b[_0x3926('0xb')][_0x3926('0xe')]&&!_[_0x3926('0x2a')](_0x36669b[_0x3926('0x10')])){setTimeout(handleSendEmail(_0x36669b,_0x34570d),0x3c*0x3e8);}};}function handleJob(_0x2f7e2c){return function(){try{if(_['isNil'](_0x2f7e2c[_0x3926('0x2b')])){return logger[_0x3926('0xa')](_0x3926('0x2c'));}if(_['isNil'](_0x2f7e2c[_0x3926('0x13')])){return logger[_0x3926('0xa')](_0x3926('0x2d'));}var _0x24a2a9={'startDate':moment()[_0x3926('0x2e')](_0x2f7e2c['subtractNumber'],_0x2f7e2c[_0x3926('0x13')])[_0x3926('0xd')](_0x3926('0x2f')),'endDate':moment()[_0x3926('0xd')](_0x3926('0x2f')),'type':_0x3926('0x30'),'output':_0x2f7e2c[_0x3926('0x31')],'name':_0x2f7e2c[_0x3926('0x12')]};if(!_[_0x3926('0x2a')](_0x2f7e2c['DefaultReportId'])){logger[_0x3926('0xa')]('exec\x20defaul\x20report\x20id:%s',_0x2f7e2c[_0x3926('0x32')]);return analyticDefaultReportController[_0x3926('0x33')]({'id':_0x2f7e2c['DefaultReportId']},_0x24a2a9)[_0x3926('0x25')](handleResult(_0x2f7e2c))[_0x3926('0x28')](handleError());}if(!_[_0x3926('0x2a')](_0x2f7e2c['CustomReportId'])){logger['info'](_0x3926('0x34'),_0x2f7e2c[_0x3926('0x35')]);return analyticCustomReportController[_0x3926('0x33')]({'id':_0x2f7e2c[_0x3926('0x35')]},_0x24a2a9)[_0x3926('0x25')](handleResult(_0x2f7e2c))['catch'](handleError());}}catch(_0x1e9532){logger[_0x3926('0x26')](JSON['stringify'](_0x1e9532));}return logger[_0x3926('0xa')]('no\x20report\x20id');};}function getJobs(_0x580855){var _0x22755a={};if(_0x580855){_0x22755a['id']=_0x580855;}return db[_0x3926('0x36')][_0x3926('0x37')]({'where':_0x22755a,'include':[{'model':db[_0x3926('0xb')],'attributes':['id',_0x3926('0x12'),'email'],'include':[{'model':db[_0x3926('0x38')],'as':'Smtp','include':[{'model':db[_0x3926('0x39')],'as':_0x3926('0x39')}]}]}]})[_0x3926('0x25')](function(_0x4d97e8){var _0x5a9d38=_[_0x3926('0x3a')](manager[_0x3926('0x3b')]);var _0x2f08de=_[_0x3926('0x3c')](_0x4d97e8,function(_0x394a8e){return _0x394a8e['id'][_0x3926('0x3d')]();});var _0x3a21b1=_[_0x3926('0x3e')](_0x4d97e8,function(_0x1ec8e3){return _0x1ec8e3['id'][_0x3926('0x3d')]();});var _0x905844=_0x580855?_0x2f08de:_[_0x3926('0x3f')](_0x2f08de,_0x5a9d38);var _0x203845=_[_0x3926('0x40')](_0x2f08de,_0x5a9d38);var _0x34b11=_[_0x3926('0x3f')](_0x5a9d38,_0x2f08de);var _0x45a811;var _0x446f9c;for(_0x45a811=0x0;_0x45a811<_0x34b11[_0x3926('0x41')]&&!_0x580855;_0x45a811+=0x1){_0x446f9c=_0x34b11[_0x45a811]['toString']();if(manager[_0x3926('0x42')](_0x446f9c)){manager[_0x3926('0x43')](_0x446f9c);manager['deleteJob'](_0x446f9c);logger[_0x3926('0xa')](_0x3926('0x44'),_0x446f9c);}}logger[_0x3926('0xa')](_0x3926('0x45'),JSON['stringify'](_0x905844));for(_0x45a811=0x0;_0x45a811<_0x905844['length'];_0x45a811+=0x1){_0x446f9c=_0x905844[_0x45a811]['toString']();logger[_0x3926('0xa')]('index',_0x446f9c);if(_0x580855){logger['info'](_0x3926('0x46'),_0x580855);logger[_0x3926('0xa')](JSON[_0x3926('0x1f')](_0x3a21b1[_0x446f9c]));BPromise[_0x3926('0x47')]()[_0x3926('0x25')](handleJob(_0x3a21b1[_0x446f9c]));logger[_0x3926('0xa')](_0x3926('0x48'),_0x3a21b1[_0x446f9c][_0x3926('0x12')],_0x3a21b1[_0x446f9c][_0x3926('0x49')]);}else if(_0x3a21b1[_0x446f9c]['cron']&&_0x3a21b1[_0x446f9c][_0x3926('0x4a')]&&moment()[_0x3926('0x4b')](_0x3a21b1[_0x446f9c][_0x3926('0x4c')],_0x3a21b1[_0x446f9c]['endAt'])){manager[_0x3926('0x4d')](_0x446f9c,_0x3a21b1[_0x446f9c][_0x3926('0x49')],handleJob(_0x3a21b1[_0x446f9c]));manager[_0x3926('0x4e')](_0x446f9c);logger[_0x3926('0xa')]('add\x20cron',_0x3a21b1[_0x446f9c][_0x3926('0x12')],_0x3a21b1[_0x446f9c][_0x3926('0x49')]);}else if(manager[_0x3926('0x42')](_0x446f9c)){manager[_0x3926('0x43')](_0x446f9c);manager[_0x3926('0x4f')](_0x446f9c);logger[_0x3926('0xa')](_0x3926('0x50'),_0x3a21b1[_0x446f9c][_0x3926('0x12')],_0x3a21b1[_0x446f9c][_0x3926('0x49')]);}}for(_0x45a811=0x0,_0x446f9c;_0x45a811<_0x203845[_0x3926('0x41')]&&!_0x580855;_0x45a811+=0x1){_0x446f9c=_0x203845[_0x45a811]['toString']();if(manager[_0x3926('0x42')](_0x446f9c)){if(_0x3a21b1[_0x446f9c][_0x3926('0x49')]&&_0x3a21b1[_0x446f9c][_0x3926('0x4a')]&&moment()['isBetween'](_0x3a21b1[_0x446f9c][_0x3926('0x4c')],_0x3a21b1[_0x446f9c]['endAt'])){manager[_0x3926('0x51')](_0x446f9c,_0x3a21b1[_0x446f9c][_0x3926('0x49')],handleJob(_0x3a21b1[_0x446f9c]));logger[_0x3926('0xa')](_0x3926('0x52'),_0x3a21b1[_0x446f9c][_0x3926('0x12')],_0x3a21b1[_0x446f9c][_0x3926('0x49')]);}else{manager[_0x3926('0x43')](_0x446f9c);manager[_0x3926('0x4f')](_0x446f9c);logger[_0x3926('0xa')](_0x3926('0x50'),_0x3a21b1[_0x446f9c][_0x3926('0x12')],_0x3a21b1[_0x446f9c][_0x3926('0x49')]);}}}})[_0x3926('0x28')](function(_0x4bd26c){logger[_0x3926('0x26')](JSON[_0x3926('0x1f')](_0x4bd26c));});}exports[_0x3926('0x53')]=function(_0x55786e){return getJobs(_0x55786e);};exports[_0x3926('0x4e')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xb001=['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','isNil','subtractNumber','subtractUnit','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','output','DefaultReportId','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','findAll','MailServerOut','CloudProvider','keys','toString','keyBy','difference','intersection','exists','stop','deleteJob','delete\x20cron','length','index','run\x20job','cron','active','isBetween','startAt','add\x20cron','stop\x20cron','endAt','update','update\x20cron','start','util','lodash','moment','bluebird','../logger','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','info','Try\x20to\x20send\x20a\x20mail\x20to','email','\x22%s\x22\x20<%s>','MailAccount','Smtp','user','bcc','format','name','../../files/reports','savename','%s.%s','extname','zip','join','status','Sent','message','attachments','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb001,0x7a));var _0x1b00=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0xb001[_0x209941];return _0x1e8729;};'use strict';var fs=require('fs');var util=require(_0x1b00('0x0'));var path=require('path');var _=require(_0x1b00('0x1'));var moment=require(_0x1b00('0x2'));var CronJobManager=require('cron-job-manager');var jayson=require('jayson/promise');var BPromise=require(_0x1b00('0x3'));var logger=require(_0x1b00('0x4'))('schedule');var db=require(_0x1b00('0x5'))['db'];var analyticCustomReportController=require(_0x1b00('0x6'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson['client']['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x2093f9,_0x2dc615){return function(){logger[_0x1b00('0x7')](_0x1b00('0x8'),_0x2093f9[_0x1b00('0x9')]);var _0x19ef57=!![];var _0x2a58fa=_0x2093f9['MailAccount']['getSmtpOptions']();var _0x3cb813={'account':_0x2a58fa,'message':{'from':util['format'](_0x1b00('0xa'),_0x2093f9[_0x1b00('0xb')]['name'],_0x2093f9[_0x1b00('0xb')][_0x1b00('0x9')]||_0x2093f9[_0x1b00('0xb')][_0x1b00('0xc')][_0x1b00('0xd')]),'to':_0x2093f9[_0x1b00('0x9')],'cc':_0x2093f9['cc'],'bcc':_0x2093f9[_0x1b00('0xe')],'subject':util[_0x1b00('0xf')]('Report\x20%s\x20last\x20%s\x20%s',_0x2dc615[_0x1b00('0x10')],_0x2093f9['subtractNumber'],_0x2093f9['subtractUnit'])}};var _0x26eaf5=path['join'](__dirname,_0x1b00('0x11'));var _0x135eee=_0x2dc615[_0x1b00('0x12')];var _0x24ed1e=util[_0x1b00('0xf')](_0x1b00('0x13'),path['basename'](_0x2dc615[_0x1b00('0x12')],path[_0x1b00('0x14')](_0x2dc615[_0x1b00('0x12')])),_0x1b00('0x15'));var _0x4023e6=path[_0x1b00('0x16')](_0x26eaf5,_0x135eee);var _0x5f2ba8=path['join'](_0x26eaf5,_0x24ed1e);if(fs['existsSync'](_0x4023e6)){_0x2dc615[_0x1b00('0x17')]=_0x1b00('0x18');_0x3cb813[_0x1b00('0x19')][_0x1b00('0x1a')]=[{'filename':_0x135eee,'path':_0x4023e6}];_0x3cb813[_0x1b00('0x19')]['text']=util['format'](_0x1b00('0x1b'),JSON[_0x1b00('0x1c')](_0x2dc615,null,0x2));}else if(fs['existsSync'](_0x5f2ba8)){_0x2dc615[_0x1b00('0x17')]=_0x1b00('0x18');_0x3cb813[_0x1b00('0x19')][_0x1b00('0x1a')]=[{'filename':_0x24ed1e,'path':_0x5f2ba8}];}else{_0x3cb813[_0x1b00('0x19')]['text']=_0x1b00('0x1d');if(!_0x2093f9[_0x1b00('0x1e')]){_0x19ef57=![];logger[_0x1b00('0x7')](_0x1b00('0x1f'));}}if(_0x19ef57){return client['request'](_0x1b00('0x20'),_0x3cb813)[_0x1b00('0x21')](function(_0x57625f){if(_0x57625f[_0x1b00('0x22')]){return logger[_0x1b00('0x22')](_0x1b00('0x23'),JSON[_0x1b00('0x1c')](_0x57625f));}return logger[_0x1b00('0x7')](_0x1b00('0x24'));})[_0x1b00('0x25')](function(_0x51bb){return logger['error'](_0x1b00('0x23'),JSON[_0x1b00('0x1c')](_0x51bb));});}};}function handleError(){return function(_0x4efd84){return logger['error'](JSON[_0x1b00('0x1c')](_0x4efd84));};}function handleResult(_0x42f9c3){return function(_0x1ce6f6){logger['info']('data',JSON[_0x1b00('0x1c')](_0x1ce6f6));if(_0x42f9c3[_0x1b00('0xb')]&&_0x42f9c3['MailAccount'][_0x1b00('0xc')]&&!_[_0x1b00('0x26')](_0x42f9c3[_0x1b00('0x9')])){setTimeout(handleSendEmail(_0x42f9c3,_0x1ce6f6),0x3c*0x3e8);}};}function handleJob(_0x5e0f07){return function(){try{if(_[_0x1b00('0x26')](_0x5e0f07[_0x1b00('0x27')])){return logger['info']('subtractNumber\x20null\x20or\x20undefined');}if(_[_0x1b00('0x26')](_0x5e0f07[_0x1b00('0x28')])){return logger['info'](_0x1b00('0x29'));}var _0x319266={'startDate':moment()[_0x1b00('0x2a')](_0x5e0f07[_0x1b00('0x27')],_0x5e0f07[_0x1b00('0x28')])[_0x1b00('0xf')](_0x1b00('0x2b')),'endDate':moment()[_0x1b00('0xf')](_0x1b00('0x2b')),'type':'scheduled','output':_0x5e0f07[_0x1b00('0x2c')],'name':_0x5e0f07['name']};if(!_['isNil'](_0x5e0f07[_0x1b00('0x2d')])){logger['info']('exec\x20defaul\x20report\x20id:%s',_0x5e0f07[_0x1b00('0x2d')]);return analyticDefaultReportController[_0x1b00('0x2e')]({'id':_0x5e0f07[_0x1b00('0x2d')]},_0x319266)['then'](handleResult(_0x5e0f07))[_0x1b00('0x25')](handleError());}if(!_[_0x1b00('0x26')](_0x5e0f07[_0x1b00('0x2f')])){logger[_0x1b00('0x7')](_0x1b00('0x30'),_0x5e0f07[_0x1b00('0x2f')]);return analyticCustomReportController['runReport']({'id':_0x5e0f07[_0x1b00('0x2f')]},_0x319266)[_0x1b00('0x21')](handleResult(_0x5e0f07))['catch'](handleError());}}catch(_0x4ca734){logger['error'](JSON[_0x1b00('0x1c')](_0x4ca734));}return logger[_0x1b00('0x7')](_0x1b00('0x31'));};}function getJobs(_0x390372){var _0x307289={};if(_0x390372){_0x307289['id']=_0x390372;}return db['Schedule'][_0x1b00('0x32')]({'where':_0x307289,'include':[{'model':db[_0x1b00('0xb')],'attributes':['id',_0x1b00('0x10'),_0x1b00('0x9')],'include':[{'model':db[_0x1b00('0x33')],'as':_0x1b00('0xc'),'include':[{'model':db[_0x1b00('0x34')],'as':_0x1b00('0x34')}]}]}]})[_0x1b00('0x21')](function(_0x57d04e){var _0x4e09fd=_[_0x1b00('0x35')](manager['jobs']);var _0x3a3c06=_['map'](_0x57d04e,function(_0x4787c2){return _0x4787c2['id'][_0x1b00('0x36')]();});var _0xc94a7e=_[_0x1b00('0x37')](_0x57d04e,function(_0x1f2efe){return _0x1f2efe['id'][_0x1b00('0x36')]();});var _0x2690bc=_0x390372?_0x3a3c06:_[_0x1b00('0x38')](_0x3a3c06,_0x4e09fd);var _0x56cc44=_[_0x1b00('0x39')](_0x3a3c06,_0x4e09fd);var _0x5c84de=_['difference'](_0x4e09fd,_0x3a3c06);var _0x4489b7;var _0x40ab15;for(_0x4489b7=0x0;_0x4489b7<_0x5c84de['length']&&!_0x390372;_0x4489b7+=0x1){_0x40ab15=_0x5c84de[_0x4489b7][_0x1b00('0x36')]();if(manager[_0x1b00('0x3a')](_0x40ab15)){manager[_0x1b00('0x3b')](_0x40ab15);manager[_0x1b00('0x3c')](_0x40ab15);logger[_0x1b00('0x7')](_0x1b00('0x3d'),_0x40ab15);}}logger[_0x1b00('0x7')]('toRun',JSON[_0x1b00('0x1c')](_0x2690bc));for(_0x4489b7=0x0;_0x4489b7<_0x2690bc[_0x1b00('0x3e')];_0x4489b7+=0x1){_0x40ab15=_0x2690bc[_0x4489b7][_0x1b00('0x36')]();logger[_0x1b00('0x7')](_0x1b00('0x3f'),_0x40ab15);if(_0x390372){logger[_0x1b00('0x7')]('my\x20id',_0x390372);logger['info'](JSON[_0x1b00('0x1c')](_0xc94a7e[_0x40ab15]));BPromise['resolve']()[_0x1b00('0x21')](handleJob(_0xc94a7e[_0x40ab15]));logger[_0x1b00('0x7')](_0x1b00('0x40'),_0xc94a7e[_0x40ab15][_0x1b00('0x10')],_0xc94a7e[_0x40ab15][_0x1b00('0x41')]);}else if(_0xc94a7e[_0x40ab15][_0x1b00('0x41')]&&_0xc94a7e[_0x40ab15][_0x1b00('0x42')]&&moment()[_0x1b00('0x43')](_0xc94a7e[_0x40ab15][_0x1b00('0x44')],_0xc94a7e[_0x40ab15]['endAt'])){manager['add'](_0x40ab15,_0xc94a7e[_0x40ab15][_0x1b00('0x41')],handleJob(_0xc94a7e[_0x40ab15]));manager['start'](_0x40ab15);logger[_0x1b00('0x7')](_0x1b00('0x45'),_0xc94a7e[_0x40ab15][_0x1b00('0x10')],_0xc94a7e[_0x40ab15][_0x1b00('0x41')]);}else if(manager[_0x1b00('0x3a')](_0x40ab15)){manager[_0x1b00('0x3b')](_0x40ab15);manager[_0x1b00('0x3c')](_0x40ab15);logger[_0x1b00('0x7')](_0x1b00('0x46'),_0xc94a7e[_0x40ab15]['name'],_0xc94a7e[_0x40ab15][_0x1b00('0x41')]);}}for(_0x4489b7=0x0,_0x40ab15;_0x4489b7<_0x56cc44[_0x1b00('0x3e')]&&!_0x390372;_0x4489b7+=0x1){_0x40ab15=_0x56cc44[_0x4489b7][_0x1b00('0x36')]();if(manager['exists'](_0x40ab15)){if(_0xc94a7e[_0x40ab15][_0x1b00('0x41')]&&_0xc94a7e[_0x40ab15][_0x1b00('0x42')]&&moment()[_0x1b00('0x43')](_0xc94a7e[_0x40ab15]['startAt'],_0xc94a7e[_0x40ab15][_0x1b00('0x47')])){manager[_0x1b00('0x48')](_0x40ab15,_0xc94a7e[_0x40ab15]['cron'],handleJob(_0xc94a7e[_0x40ab15]));logger['info'](_0x1b00('0x49'),_0xc94a7e[_0x40ab15][_0x1b00('0x10')],_0xc94a7e[_0x40ab15][_0x1b00('0x41')]);}else{manager[_0x1b00('0x3b')](_0x40ab15);manager['deleteJob'](_0x40ab15);logger['info'](_0x1b00('0x46'),_0xc94a7e[_0x40ab15][_0x1b00('0x10')],_0xc94a7e[_0x40ab15][_0x1b00('0x41')]);}}}})[_0x1b00('0x25')](function(_0x392eae){logger[_0x1b00('0x22')](JSON[_0x1b00('0x1c')](_0x392eae));});}exports['run']=function(_0x2c4391){return getJobs(_0x2c4391);};exports[_0x1b00('0x4a')]=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 88aecc6..99a24a3 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 _0xe605=['Comprehend','substring','info','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','Transcript','TranscriptFileUri','format','[RECORDING:%d]\x20Get\x20transcript','then','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','fileText','transcript','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','ValidationError','Sentiment\x20Analysis\x20not\x20requested','language','bucket','Sequelize','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','sentimentAccountId','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','sentimentRegion','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','update','Sentiment','SentimentScore','Positive','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','sentiment','CloudProvider','Negative','COMPLETED','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Settings\x20not\x20available','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','forEach','push','all','start','lodash','aws-sdk','util','bluebird','../../mysqldb','../../config/logger','transcribe','getTranscriptionJob'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe605,0x92));var _0x5e60=function(_0x70c65c,_0x114310){_0x70c65c=_0x70c65c-0x0;var _0x525fc7=_0xe605[_0x70c65c];return _0x525fc7;};var _=require(_0x5e60('0x0'));var AWS=require(_0x5e60('0x1'));var rp=require('request-promise');var util=require(_0x5e60('0x2'));var BPromise=require(_0x5e60('0x3'));var db=require(_0x5e60('0x4'))['db'];var logger=require(_0x5e60('0x5'))(_0x5e60('0x6'));function getTranscriptionJob(_0xfe1f64,_0x3a6c7c,_0x30d8fb,_0x297ab2){return new Promise(function(_0xc41535,_0x1d4a08){var _0x168a14=new AWS['TranscribeService']({'accessKeyId':_0x3a6c7c,'secretAccessKey':_0xfe1f64,'region':_0x30d8fb});_0x168a14[_0x5e60('0x7')]({'TranscriptionJobName':_0x297ab2},function(_0x55ff5c,_0x593118){if(_0x55ff5c){return _0x1d4a08(_0x55ff5c);}else{return _0xc41535(_0x593118);}});});}function sentiment(_0x53dccb,_0x43f7eb,_0xe93f9c,_0x150a51,_0x2c5425){return new Promise(function(_0x331b3e,_0x2cbe4e){var _0x56f05a=new AWS[(_0x5e60('0x8'))]({'accessKeyId':_0x43f7eb,'secretAccessKey':_0x53dccb,'region':_0xe93f9c});_0x56f05a['detectSentiment']({'Text':_0x150a51,'LanguageCode':_0x2c5425[_0x5e60('0x9')](0x0,0x2)},function(_0x15035f,_0xcf1188){if(_0x15035f){return _0x2cbe4e(_0x15035f);}else{return _0x331b3e(_0xcf1188);}});});}function checkTranscribeJob(_0x51e7f6,_0x371df7,_0x178782){var _0x1f4e14;return new BPromise(function(_0xe039de,_0x2874c4){logger[_0x5e60('0xa')](util['format'](_0x5e60('0xb'),_0x51e7f6['id'],_0x51e7f6[_0x5e60('0xc')]));return getTranscriptionJob(_0x178782[_0x5e60('0xd')],_0x178782[_0x5e60('0xe')],_0x371df7['transcribeRegion'],_0x51e7f6[_0x5e60('0xc')])['then'](function(_0x1ffd77){logger[_0x5e60('0xa')](util['format'](_0x5e60('0xf'),_0x51e7f6['id'],_0x51e7f6[_0x5e60('0xc')],_0x1ffd77[_0x5e60('0x10')][_0x5e60('0x11')]));if(!_0x51e7f6['fileText']){switch(_0x1ffd77[_0x5e60('0x10')][_0x5e60('0x11')]){case'COMPLETED':var _0x1fa0f8={'transcribeStatus':_0x1ffd77[_0x5e60('0x10')][_0x5e60('0x11')],'fileUri':_0x1ffd77[_0x5e60('0x10')][_0x5e60('0x12')][_0x5e60('0x13')]};logger[_0x5e60('0xa')](util[_0x5e60('0x14')](_0x5e60('0x15'),_0x51e7f6['id']));return rp({'uri':_0x1ffd77[_0x5e60('0x10')][_0x5e60('0x12')]['TranscriptFileUri'],'json':!![]})[_0x5e60('0x16')](function(_0x5d77dd){logger[_0x5e60('0xa')](util[_0x5e60('0x14')](_0x5e60('0x17'),_0x51e7f6['id']));if(_0x5d77dd&&_0x5d77dd[_0x5e60('0x18')]&&_0x5d77dd[_0x5e60('0x18')][_0x5e60('0x19')]&&_0x5d77dd[_0x5e60('0x18')]['transcripts'][_0x5e60('0x1a')]){_0x1fa0f8[_0x5e60('0x1b')]='';for(var _0x19f37b=0x0;_0x19f37b<_0x5d77dd['results'][_0x5e60('0x19')][_0x5e60('0x1a')];_0x19f37b++){_0x1fa0f8[_0x5e60('0x1b')]+=_0x5d77dd[_0x5e60('0x18')]['transcripts'][_0x19f37b][_0x5e60('0x1c')]+'';}}return _0x51e7f6['update'](_0x1fa0f8);})[_0x5e60('0x16')](function(){logger[_0x5e60('0xa')](util['format'](_0x5e60('0x1d'),_0x51e7f6['id']));if(!_0x51e7f6[_0x5e60('0x1e')]){throw new db['Sequelize'][(_0x5e60('0x1f'))](_0x5e60('0x20'));}if(!_0x371df7['sentiment']||!_0x371df7['sentimentAccountId']||!_0x371df7['sentimentRegion']||!_0x371df7[_0x5e60('0x21')]||!_0x371df7[_0x5e60('0x22')]){throw new db[(_0x5e60('0x23'))][(_0x5e60('0x1f'))](_0x5e60('0x24'));}if(!_0x1fa0f8['fileText']){throw new Error(_0x5e60('0x25'));}if(_0x371df7[_0x5e60('0x26')]===_0x178782['id']){return _0x178782;}else{return db['CloudProvider'][_0x5e60('0x27')]({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0x1035b0){if(!_0x1035b0){throw new db[(_0x5e60('0x23'))][(_0x5e60('0x1f'))](_0x5e60('0x28'));}if(!_0x1035b0[_0x5e60('0xd')]||!_0x1035b0[_0x5e60('0xe')]){throw new db[(_0x5e60('0x23'))][(_0x5e60('0x1f'))](_0x5e60('0x29'));}_0x1f4e14=_0x1035b0;logger[_0x5e60('0xa')](util['format'](_0x5e60('0x2a'),_0x51e7f6['id']));return sentiment(_0x1f4e14['data1'],_0x1f4e14['data2'],_0x371df7[_0x5e60('0x2b')],_0x1fa0f8[_0x5e60('0x1b')],_0x371df7['language']);})[_0x5e60('0x16')](function(_0x576c70){logger[_0x5e60('0xa')](util[_0x5e60('0x14')](_0x5e60('0x2c'),_0x51e7f6['id']));return _0x51e7f6[_0x5e60('0x2d')]({'sentiment':_0x576c70[_0x5e60('0x2e')],'sPositive':_0x576c70[_0x5e60('0x2f')][_0x5e60('0x30')],'sNegative':_0x576c70[_0x5e60('0x2f')]['Negative'],'sMixed':_0x576c70[_0x5e60('0x2f')][_0x5e60('0x31')],'sNeutral':_0x576c70[_0x5e60('0x2f')][_0x5e60('0x32')]});})[_0x5e60('0x16')](function(){logger[_0x5e60('0xa')](util[_0x5e60('0x14')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x51e7f6['id']));_0xe039de();});case _0x5e60('0x33'):return _0x51e7f6[_0x5e60('0x2d')]({'transcribeStatus':'FAILED','failureReason':_0x1ffd77['TranscriptionJob'][_0x5e60('0x34')]})[_0x5e60('0x16')](function(){logger[_0x5e60('0xa')](util[_0x5e60('0x14')](_0x5e60('0x1d'),_0x51e7f6['id']));_0xe039de();});default:logger['info'](util[_0x5e60('0x14')](_0x5e60('0x35'),_0x51e7f6['id']));break;}}else{return BPromise[_0x5e60('0x36')]()[_0x5e60('0x16')](function(){if(!_0x51e7f6[_0x5e60('0x1e')]){throw new db[(_0x5e60('0x23'))][(_0x5e60('0x1f'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x371df7[_0x5e60('0x37')]||!_0x371df7[_0x5e60('0x26')]||!_0x371df7['sentimentRegion']||!_0x371df7['language']||!_0x371df7['bucket']){throw new db[(_0x5e60('0x23'))][(_0x5e60('0x1f'))](_0x5e60('0x24'));}if(!_0x51e7f6[_0x5e60('0x1b')]){throw new Error('Transcript\x20not\x20available');}if(_0x371df7[_0x5e60('0x26')]===_0x178782['id']){return _0x178782;}else{return db[_0x5e60('0x38')]['findOne']({'where':{'id':_settings['sentimentAccountId']}});}})[_0x5e60('0x16')](function(_0x42b9b0){if(!_0x42b9b0){throw new db[(_0x5e60('0x23'))][(_0x5e60('0x1f'))](_0x5e60('0x28'));}if(!_0x42b9b0[_0x5e60('0xd')]||!_0x42b9b0[_0x5e60('0xe')]){throw new db[(_0x5e60('0x23'))][(_0x5e60('0x1f'))]('Cloud\x20Provider\x20not\x20configured');}_0x1f4e14=_0x42b9b0;logger[_0x5e60('0xa')](util[_0x5e60('0x14')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x51e7f6['id']));return sentiment(_0x1f4e14[_0x5e60('0xd')],_0x1f4e14[_0x5e60('0xe')],_0x371df7[_0x5e60('0x2b')],_0x51e7f6[_0x5e60('0x1b')],_0x371df7[_0x5e60('0x21')]);})['then'](function(_0x3f1a53){logger[_0x5e60('0xa')](util[_0x5e60('0x14')](_0x5e60('0x2c'),_0x51e7f6['id']));return _0x51e7f6['update']({'sentiment':_0x3f1a53['Sentiment'],'sPositive':_0x3f1a53['SentimentScore'][_0x5e60('0x30')],'sNegative':_0x3f1a53[_0x5e60('0x2f')][_0x5e60('0x39')],'sMixed':_0x3f1a53[_0x5e60('0x2f')][_0x5e60('0x31')],'sNeutral':_0x3f1a53[_0x5e60('0x2f')]['Neutral'],'transcribeStatus':_0x5e60('0x3a')});})[_0x5e60('0x16')](function(){logger[_0x5e60('0xa')](util[_0x5e60('0x14')](_0x5e60('0x1d'),_0x51e7f6['id']));_0xe039de();});}})[_0x5e60('0x3b')](function(_0x214f27){if(_0x214f27){if(!_0x214f27['name']||_0x214f27[_0x5e60('0x3c')]!==_0x5e60('0x3d')){logger[_0x5e60('0x3e')](util[_0x5e60('0x14')](_0x5e60('0x3f'),_0x51e7f6['id']),util[_0x5e60('0x40')](_0x214f27,{'showHidden':![],'depth':null}));}}_0xe039de();});});}function checkTranscribe(){var _0x2a9353;var _0x4470bd;var _0x1518bd;return db[_0x5e60('0x41')][_0x5e60('0x42')]({'where':{'transcribeStatus':_0x5e60('0x43')}})[_0x5e60('0x16')](function(_0x969287){if(!_0x969287||!_0x969287[_0x5e60('0x1a')]){throw new db[(_0x5e60('0x23'))][(_0x5e60('0x1f'))](_0x5e60('0x44'));}_0x2a9353=_0x969287;return db['Setting']['findOne']({'where':{'id':0x1}});})[_0x5e60('0x16')](function(_0x4d3588){if(!_0x4d3588){throw new db[(_0x5e60('0x23'))][(_0x5e60('0x1f'))](_0x5e60('0x45'));}_0x4470bd=_0x4d3588;if(!_0x4470bd[_0x5e60('0x6')]||!_0x4470bd[_0x5e60('0x46')]||!_0x4470bd[_0x5e60('0x47')]||!_0x4470bd['language']||!_0x4470bd['bucket']){throw new db[(_0x5e60('0x23'))][(_0x5e60('0x1f'))](_0x5e60('0x48'));}return db['CloudProvider']['findOne']({'where':{'id':_0x4470bd[_0x5e60('0x46')]}});})[_0x5e60('0x16')](function(_0x179cc6){if(!_0x179cc6){throw new db['Sequelize'][(_0x5e60('0x1f'))](_0x5e60('0x28'));}if(!_0x179cc6[_0x5e60('0xd')]||!_0x179cc6[_0x5e60('0xe')]){throw new db[(_0x5e60('0x23'))][(_0x5e60('0x1f'))]('Cloud\x20Provider\x20not\x20configured');}_0x1518bd=_0x179cc6;var _0x412be1=[];_0x2a9353[_0x5e60('0x49')](function(_0x4acbe8){_0x412be1[_0x5e60('0x4a')](checkTranscribeJob(_0x4acbe8,_0x4470bd,_0x1518bd));});return BPromise[_0x5e60('0x4b')](_0x412be1);})[_0x5e60('0x3b')](function(_0x5b3b99){if(_0x5b3b99){if(!_0x5b3b99[_0x5e60('0x3c')]||_0x5b3b99[_0x5e60('0x3c')]!=='SequelizeValidationError'){logger[_0x5e60('0x3e')](util[_0x5e60('0x40')](_0x5b3b99,{'showHidden':![],'depth':null}));}}});}exports[_0x5e60('0x4c')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x3ee7=['Cloud\x20Provider\x20not\x20configured','SentimentScore','Positive','Mixed','Neutral','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','sentiment','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','findOne','Sentiment','Negative','catch','name','SequelizeValidationError','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','all','error','start','aws-sdk','bluebird','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','substring','info','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','data1','data2','transcribeRegion','fileText','TranscriptionJob','COMPLETED','TranscriptFileUri','format','Transcript','then','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','update','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','sentimentRegion','language','bucket','Transcript\x20not\x20available','Cloud\x20Provider\x20not\x20available'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3ee7,0x98));var _0x73ee=function(_0x2b0180,_0x27ae1a){_0x2b0180=_0x2b0180-0x0;var _0x346a84=_0x3ee7[_0x2b0180];return _0x346a84;};var _=require('lodash');var AWS=require(_0x73ee('0x0'));var rp=require('request-promise');var util=require('util');var BPromise=require(_0x73ee('0x1'));var db=require('../../mysqldb')['db'];var logger=require(_0x73ee('0x2'))(_0x73ee('0x3'));function getTranscriptionJob(_0x2aebdc,_0x13c058,_0x4f49d1,_0x62e720){return new Promise(function(_0x2bc2c1,_0x447c6f){var _0x4c78de=new AWS[(_0x73ee('0x4'))]({'accessKeyId':_0x13c058,'secretAccessKey':_0x2aebdc,'region':_0x4f49d1});_0x4c78de[_0x73ee('0x5')]({'TranscriptionJobName':_0x62e720},function(_0x48ec48,_0x32c472){if(_0x48ec48){return _0x447c6f(_0x48ec48);}else{return _0x2bc2c1(_0x32c472);}});});}function sentiment(_0x4a0f0a,_0x311370,_0x4692e0,_0x8d1eb9,_0xb12d2e){return new Promise(function(_0x23b4f5,_0x4d5bb7){var _0xe75883=new AWS['Comprehend']({'accessKeyId':_0x311370,'secretAccessKey':_0x4a0f0a,'region':_0x4692e0});_0xe75883['detectSentiment']({'Text':_0x8d1eb9,'LanguageCode':_0xb12d2e[_0x73ee('0x6')](0x0,0x2)},function(_0x5a4111,_0x35e995){if(_0x5a4111){return _0x4d5bb7(_0x5a4111);}else{return _0x23b4f5(_0x35e995);}});});}function checkTranscribeJob(_0x39e928,_0x4c26a7,_0x4f62ff){var _0x408377;return new BPromise(function(_0x2f9f66,_0x598057){logger[_0x73ee('0x7')](util['format'](_0x73ee('0x8'),_0x39e928['id'],_0x39e928['transcribeName']));return getTranscriptionJob(_0x4f62ff[_0x73ee('0x9')],_0x4f62ff[_0x73ee('0xa')],_0x4c26a7[_0x73ee('0xb')],_0x39e928['transcribeName'])['then'](function(_0x14899e){logger[_0x73ee('0x7')](util['format']('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x39e928['id'],_0x39e928['transcribeName'],_0x14899e['TranscriptionJob']['TranscriptionJobStatus']));if(!_0x39e928[_0x73ee('0xc')]){switch(_0x14899e[_0x73ee('0xd')]['TranscriptionJobStatus']){case _0x73ee('0xe'):var _0xd1a684={'transcribeStatus':_0x14899e[_0x73ee('0xd')]['TranscriptionJobStatus'],'fileUri':_0x14899e[_0x73ee('0xd')]['Transcript'][_0x73ee('0xf')]};logger[_0x73ee('0x7')](util[_0x73ee('0x10')]('[RECORDING:%d]\x20Get\x20transcript',_0x39e928['id']));return rp({'uri':_0x14899e[_0x73ee('0xd')][_0x73ee('0x11')][_0x73ee('0xf')],'json':!![]})[_0x73ee('0x12')](function(_0x1acef1){logger['info'](util[_0x73ee('0x10')](_0x73ee('0x13'),_0x39e928['id']));if(_0x1acef1&&_0x1acef1[_0x73ee('0x14')]&&_0x1acef1['results']['transcripts']&&_0x1acef1[_0x73ee('0x14')][_0x73ee('0x15')][_0x73ee('0x16')]){_0xd1a684[_0x73ee('0xc')]='';for(var _0xa91906=0x0;_0xa91906<_0x1acef1[_0x73ee('0x14')]['transcripts'][_0x73ee('0x16')];_0xa91906++){_0xd1a684[_0x73ee('0xc')]+=_0x1acef1[_0x73ee('0x14')]['transcripts'][_0xa91906]['transcript']+'';}}return _0x39e928[_0x73ee('0x17')](_0xd1a684);})[_0x73ee('0x12')](function(){logger['info'](util[_0x73ee('0x10')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x39e928['id']));if(!_0x39e928[_0x73ee('0x18')]){throw new db[(_0x73ee('0x19'))][(_0x73ee('0x1a'))](_0x73ee('0x1b'));}if(!_0x4c26a7['sentiment']||!_0x4c26a7[_0x73ee('0x1c')]||!_0x4c26a7[_0x73ee('0x1d')]||!_0x4c26a7[_0x73ee('0x1e')]||!_0x4c26a7[_0x73ee('0x1f')]){throw new db[(_0x73ee('0x19'))][(_0x73ee('0x1a'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0xd1a684[_0x73ee('0xc')]){throw new Error(_0x73ee('0x20'));}if(_0x4c26a7[_0x73ee('0x1c')]===_0x4f62ff['id']){return _0x4f62ff;}else{return db['CloudProvider']['findOne']({'where':{'id':_settings[_0x73ee('0x1c')]}});}})[_0x73ee('0x12')](function(_0x3f062d){if(!_0x3f062d){throw new db[(_0x73ee('0x19'))][(_0x73ee('0x1a'))](_0x73ee('0x21'));}if(!_0x3f062d['data1']||!_0x3f062d['data2']){throw new db[(_0x73ee('0x19'))][(_0x73ee('0x1a'))](_0x73ee('0x22'));}_0x408377=_0x3f062d;logger['info'](util['format']('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x39e928['id']));return sentiment(_0x408377[_0x73ee('0x9')],_0x408377['data2'],_0x4c26a7[_0x73ee('0x1d')],_0xd1a684['fileText'],_0x4c26a7[_0x73ee('0x1e')]);})[_0x73ee('0x12')](function(_0x43c7ad){logger['info'](util[_0x73ee('0x10')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x39e928['id']));return _0x39e928[_0x73ee('0x17')]({'sentiment':_0x43c7ad['Sentiment'],'sPositive':_0x43c7ad[_0x73ee('0x23')][_0x73ee('0x24')],'sNegative':_0x43c7ad[_0x73ee('0x23')]['Negative'],'sMixed':_0x43c7ad[_0x73ee('0x23')][_0x73ee('0x25')],'sNeutral':_0x43c7ad[_0x73ee('0x23')][_0x73ee('0x26')]});})['then'](function(){logger[_0x73ee('0x7')](util[_0x73ee('0x10')](_0x73ee('0x27'),_0x39e928['id']));_0x2f9f66();});case _0x73ee('0x28'):return _0x39e928[_0x73ee('0x17')]({'transcribeStatus':_0x73ee('0x28'),'failureReason':_0x14899e[_0x73ee('0xd')]['FailureReason']})['then'](function(){logger[_0x73ee('0x7')](util[_0x73ee('0x10')](_0x73ee('0x27'),_0x39e928['id']));_0x2f9f66();});default:logger[_0x73ee('0x7')](util[_0x73ee('0x10')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x39e928['id']));break;}}else{return BPromise['resolve']()[_0x73ee('0x12')](function(){if(!_0x39e928['tempSentiment']){throw new db[(_0x73ee('0x19'))][(_0x73ee('0x1a'))](_0x73ee('0x1b'));}if(!_0x4c26a7[_0x73ee('0x29')]||!_0x4c26a7[_0x73ee('0x1c')]||!_0x4c26a7[_0x73ee('0x1d')]||!_0x4c26a7[_0x73ee('0x1e')]||!_0x4c26a7['bucket']){throw new db[(_0x73ee('0x19'))][(_0x73ee('0x1a'))](_0x73ee('0x2a'));}if(!_0x39e928[_0x73ee('0xc')]){throw new Error(_0x73ee('0x20'));}if(_0x4c26a7['sentimentAccountId']===_0x4f62ff['id']){return _0x4f62ff;}else{return db[_0x73ee('0x2b')][_0x73ee('0x2c')]({'where':{'id':_settings[_0x73ee('0x1c')]}});}})[_0x73ee('0x12')](function(_0x2ac387){if(!_0x2ac387){throw new db[(_0x73ee('0x19'))][(_0x73ee('0x1a'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x2ac387['data1']||!_0x2ac387[_0x73ee('0xa')]){throw new db['Sequelize'][(_0x73ee('0x1a'))](_0x73ee('0x22'));}_0x408377=_0x2ac387;logger[_0x73ee('0x7')](util['format']('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x39e928['id']));return sentiment(_0x408377[_0x73ee('0x9')],_0x408377['data2'],_0x4c26a7[_0x73ee('0x1d')],_0x39e928['fileText'],_0x4c26a7['language']);})[_0x73ee('0x12')](function(_0x3fa4b3){logger[_0x73ee('0x7')](util[_0x73ee('0x10')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x39e928['id']));return _0x39e928[_0x73ee('0x17')]({'sentiment':_0x3fa4b3[_0x73ee('0x2d')],'sPositive':_0x3fa4b3[_0x73ee('0x23')][_0x73ee('0x24')],'sNegative':_0x3fa4b3[_0x73ee('0x23')][_0x73ee('0x2e')],'sMixed':_0x3fa4b3[_0x73ee('0x23')][_0x73ee('0x25')],'sNeutral':_0x3fa4b3[_0x73ee('0x23')][_0x73ee('0x26')],'transcribeStatus':'COMPLETED'});})['then'](function(){logger[_0x73ee('0x7')](util[_0x73ee('0x10')](_0x73ee('0x27'),_0x39e928['id']));_0x2f9f66();});}})[_0x73ee('0x2f')](function(_0x356982){if(_0x356982){if(!_0x356982[_0x73ee('0x30')]||_0x356982[_0x73ee('0x30')]!==_0x73ee('0x31')){logger['error'](util[_0x73ee('0x10')](_0x73ee('0x32'),_0x39e928['id']),util['inspect'](_0x356982,{'showHidden':![],'depth':null}));}}_0x2f9f66();});});}function checkTranscribe(){var _0x45a84b;var _0x2ef2b0;var _0x367b16;return db[_0x73ee('0x33')][_0x73ee('0x34')]({'where':{'transcribeStatus':_0x73ee('0x35')}})['then'](function(_0x51b123){if(!_0x51b123||!_0x51b123['length']){throw new db['Sequelize'][(_0x73ee('0x1a'))](_0x73ee('0x36'));}_0x45a84b=_0x51b123;return db['Setting']['findOne']({'where':{'id':0x1}});})[_0x73ee('0x12')](function(_0x4d6a7c){if(!_0x4d6a7c){throw new db[(_0x73ee('0x19'))][(_0x73ee('0x1a'))](_0x73ee('0x37'));}_0x2ef2b0=_0x4d6a7c;if(!_0x2ef2b0[_0x73ee('0x3')]||!_0x2ef2b0[_0x73ee('0x38')]||!_0x2ef2b0[_0x73ee('0xb')]||!_0x2ef2b0[_0x73ee('0x1e')]||!_0x2ef2b0[_0x73ee('0x1f')]){throw new db['Sequelize'][(_0x73ee('0x1a'))](_0x73ee('0x39'));}return db['CloudProvider']['findOne']({'where':{'id':_0x2ef2b0[_0x73ee('0x38')]}});})[_0x73ee('0x12')](function(_0x22879b){if(!_0x22879b){throw new db['Sequelize']['ValidationError'](_0x73ee('0x21'));}if(!_0x22879b[_0x73ee('0x9')]||!_0x22879b[_0x73ee('0xa')]){throw new db[(_0x73ee('0x19'))][(_0x73ee('0x1a'))](_0x73ee('0x22'));}_0x367b16=_0x22879b;var _0x1402ea=[];_0x45a84b[_0x73ee('0x3a')](function(_0x1c4aaf){_0x1402ea['push'](checkTranscribeJob(_0x1c4aaf,_0x2ef2b0,_0x367b16));});return BPromise[_0x73ee('0x3b')](_0x1402ea);})[_0x73ee('0x2f')](function(_0x2cb580){if(_0x2cb580){if(!_0x2cb580['name']||_0x2cb580[_0x73ee('0x30')]!==_0x73ee('0x31')){logger[_0x73ee('0x3c')](util['inspect'](_0x2cb580,{'showHidden':![],'depth':null}));}}});}exports[_0x73ee('0x3d')]=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 8fbced0..05f1f72 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 _0x0018=['redis','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','then','length','info','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','join','emit','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule'];(function(_0x54d60b,_0x33bb6f){var _0x3c7f38=function(_0x7cfaac){while(--_0x7cfaac){_0x54d60b['push'](_0x54d60b['shift']());}};_0x3c7f38(++_0x33bb6f);}(_0x0018,0x1aa));var _0x8001=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x0018[_0x432682];return _0x463d05;};'use strict';var _=require(_0x8001('0x0'));var moment=require(_0x8001('0x1'));var Redis=require(_0x8001('0x2'));var util=require(_0x8001('0x3'));var config=require(_0x8001('0x4'));var db=require(_0x8001('0x5'))['db'];var logger=require(_0x8001('0x6'))(_0x8001('0x7'));config['redis']=_['defaults'](config[_0x8001('0x8')],{'host':_0x8001('0x9'),'port':0x18eb});var io=require(_0x8001('0xa'))(new Redis(config[_0x8001('0x8')]));function closeInteractions(){var _0x473f1c=[];return db[_0x8001('0xb')][_0x8001('0xc')]({'raw':!![],'attributes':['id',_0x8001('0xd')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x8001('0xe')](0x18,'hours')}}})[_0x8001('0xf')](function(_0x5d6d7a){if(_0x5d6d7a&&_0x5d6d7a[_0x8001('0x10')]){_0x473f1c=_['map'](_0x5d6d7a||[],'id');logger[_0x8001('0x11')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x473f1c['join']());return db[_0x8001('0xb')][_0x8001('0x12')]({'closeReason':_0x8001('0x13'),'disposition':_0x8001('0x14'),'closed':!![],'closedAt':moment()[_0x8001('0x15')](_0x8001('0x16'))},{'where':{'id':_0x473f1c}});}})[_0x8001('0xf')](function(){if(_0x473f1c&&_0x473f1c['length']){logger[_0x8001('0x11')](_0x8001('0x17'),_0x473f1c[_0x8001('0x18')]());for(var _0x15331d=0x0;_0x15331d<_0x473f1c[_0x8001('0x10')];_0x15331d++){io[_0x8001('0x19')]('whatsappInteraction:update',{'id':_0x473f1c[_0x15331d],'closed':!![]});}}})[_0x8001('0x1a')](function(_0x4b990f){logger[_0x8001('0x1b')](_0x8001('0x1c'),_0x4b990f?util[_0x8001('0x1d')](_0x4b990f,{'showHidden':![],'depth':null}):'');});}exports[_0x8001('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xd2f3=['../../mysqldb','../logger','schedule','redis','localhost','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','WhatsappInteraction','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','join','emit','whatsappInteraction:update','catch','inspect','start','moment','ioredis','util'];(function(_0xdfa88c,_0x128b2a){var _0x163ea4=function(_0x339319){while(--_0x339319){_0xdfa88c['push'](_0xdfa88c['shift']());}};_0x163ea4(++_0x128b2a);}(_0xd2f3,0x169));var _0x3d2f=function(_0x451712,_0x3c99b6){_0x451712=_0x451712-0x0;var _0x1b135a=_0xd2f3[_0x451712];return _0x1b135a;};'use strict';var _=require('lodash');var moment=require(_0x3d2f('0x0'));var Redis=require(_0x3d2f('0x1'));var util=require(_0x3d2f('0x2'));var config=require('../../config/environment');var db=require(_0x3d2f('0x3'))['db'];var logger=require(_0x3d2f('0x4'))(_0x3d2f('0x5'));config[_0x3d2f('0x6')]=_['defaults'](config[_0x3d2f('0x6')],{'host':_0x3d2f('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3d2f('0x6')]));function closeInteractions(){var _0x49c075=[];return db['WhatsappInteraction']['findAll']({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0x3d2f('0x8'))}}})[_0x3d2f('0x9')](function(_0x53cb46){if(_0x53cb46&&_0x53cb46[_0x3d2f('0xa')]){_0x49c075=_[_0x3d2f('0xb')](_0x53cb46||[],'id');logger[_0x3d2f('0xc')](_0x3d2f('0xd'),_0x49c075['join']());return db[_0x3d2f('0xe')][_0x3d2f('0xf')]({'closeReason':_0x3d2f('0x10'),'disposition':_0x3d2f('0x11'),'closed':!![],'closedAt':moment()[_0x3d2f('0x12')](_0x3d2f('0x13'))},{'where':{'id':_0x49c075}});}})['then'](function(){if(_0x49c075&&_0x49c075[_0x3d2f('0xa')]){logger[_0x3d2f('0xc')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x49c075[_0x3d2f('0x14')]());for(var _0xcd9d04=0x0;_0xcd9d04<_0x49c075[_0x3d2f('0xa')];_0xcd9d04++){io[_0x3d2f('0x15')](_0x3d2f('0x16'),{'id':_0x49c075[_0xcd9d04],'closed':!![]});}}})[_0x3d2f('0x17')](function(_0x147707){logger['error']('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x147707?util[_0x3d2f('0x18')](_0x147707,{'showHidden':![],'depth':null}):'');});}exports[_0x3d2f('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 4c491db..e9b5c50 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x35ae=['then','bulkCreate','finished\x20populating','contacts1','CmHopper','log','hopper1','contacts2','hopper2','catch','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','destroy'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0x35ae,0x186));var _0xe35a=function(_0x2610cf,_0x307298){_0x2610cf=_0x2610cf-0x0;var _0x104f26=_0x35ae[_0x2610cf];return _0x104f26;};'use strict';var util=require(_0xe35a('0x0'));var db=require(_0xe35a('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xe35a('0x2')]({'id':i,'firstName':_0xe35a('0x3')+i,'lastName':_0xe35a('0x4')+i,'phone':0xf879fb460+i,'email':_0xe35a('0x5')+i+_0xe35a('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xe35a('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xe35a('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xe35a('0x7')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xe35a('0x2')]({'id':i,'firstName':_0xe35a('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0xe35a('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0xe35a('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xe35a('0x7')](),'updatedAt':Date[_0xe35a('0x7')]()});}db[_0xe35a('0x8')][_0xe35a('0x9')]({'where':{}})[_0xe35a('0xa')](function(){return db[_0xe35a('0x8')][_0xe35a('0xb')](contacts);})['then'](function(){console['log'](_0xe35a('0xc'),_0xe35a('0xd'));return db['CmHopper']['destroy']({'where':{}});})[_0xe35a('0xa')](function(){return db[_0xe35a('0xe')][_0xe35a('0xb')](hopper);})[_0xe35a('0xa')](function(){console[_0xe35a('0xf')](_0xe35a('0xc'),_0xe35a('0x10'));return db['CmContact'][_0xe35a('0xb')](contacts2);})[_0xe35a('0xa')](function(){console[_0xe35a('0xf')](_0xe35a('0xc'),_0xe35a('0x11'));return db[_0xe35a('0xe')][_0xe35a('0xb')](hopper2);})[_0xe35a('0xa')](function(){console['log'](_0xe35a('0xc'),_0xe35a('0x12'));})[_0xe35a('0x13')](function(_0x37df39){console[_0xe35a('0xf')](_0x37df39);}); \ No newline at end of file +var _0x4395=['Innocenzo','innocenzo.biondo','@xcally.com','now','Biondo','CmContact','bulkCreate','then','log','finished\x20populating','contacts1','CmHopper','destroy','hopper1','contacts2','hopper2','catch','push'];(function(_0x5bf420,_0x2d068d){var _0x1c5255=function(_0x4964a2){while(--_0x4964a2){_0x5bf420['push'](_0x5bf420['shift']());}};_0x1c5255(++_0x2d068d);}(_0x4395,0x19d));var _0x5439=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4395[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x5439('0x0')]({'id':i,'firstName':_0x5439('0x1')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x5439('0x2')+i+_0x5439('0x3')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x5439('0x0')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x5439('0x4')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x5439('0x0')]({'id':i,'firstName':_0x5439('0x1')+i,'lastName':_0x5439('0x5')+i,'phone':0xf879fb460+i,'email':_0x5439('0x2')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x5439('0x0')]({'id':i,'active':![],'scheduledat':Date[_0x5439('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x5439('0x4')](),'updatedAt':Date[_0x5439('0x4')]()});}db[_0x5439('0x6')]['destroy']({'where':{}})['then'](function(){return db['CmContact'][_0x5439('0x7')](contacts);})[_0x5439('0x8')](function(){console[_0x5439('0x9')](_0x5439('0xa'),_0x5439('0xb'));return db[_0x5439('0xc')][_0x5439('0xd')]({'where':{}});})[_0x5439('0x8')](function(){return db['CmHopper'][_0x5439('0x7')](hopper);})['then'](function(){console[_0x5439('0x9')](_0x5439('0xa'),_0x5439('0xe'));return db[_0x5439('0x6')][_0x5439('0x7')](contacts2);})[_0x5439('0x8')](function(){console['log'](_0x5439('0xa'),_0x5439('0xf'));return db[_0x5439('0xc')][_0x5439('0x7')](hopper2);})[_0x5439('0x8')](function(){console['log'](_0x5439('0xa'),_0x5439('0x10'));})[_0x5439('0x11')](function(_0x54ce33){console[_0x5439('0x9')](_0x54ce33);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 0f6797c..cad8b65 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaf54=['all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','catch','util','../mysqldb','push','format','%s%s','agent','password','wss'];(function(_0x5870b6,_0x131954){var _0x489d3b=function(_0x3cc398){while(--_0x3cc398){_0x5870b6['push'](_0x5870b6['shift']());}};_0x489d3b(++_0x131954);}(_0xaf54,0x84));var _0x4af5=function(_0x8afdd0,_0x548ad1){_0x8afdd0=_0x8afdd0-0x0;var _0x3de7ac=_0xaf54[_0x8afdd0];return _0x3de7ac;};'use strict';var util=require(_0x4af5('0x0'));var db=require(_0x4af5('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x4af5('0x2')]({'name':util[_0x4af5('0x3')](_0x4af5('0x4'),_0x4af5('0x5'),i),'fullname':util['format'](_0x4af5('0x4'),_0x4af5('0x5'),i),'email':util[_0x4af5('0x3')]('%s%s@xcally.com',_0x4af5('0x5'),i),'role':_0x4af5('0x5'),'password':_0x4af5('0x6'),'internal':0xfa0+i,'type':'friend','transport':['udp','ws',_0x4af5('0x7')],'disallow':[_0x4af5('0x8')],'allow':[_0x4af5('0x9')],'defaultuser':util[_0x4af5('0x3')](_0x4af5('0x4'),_0x4af5('0x5'),i),'encryption':_0x4af5('0xa'),'avpf':_0x4af5('0xa'),'force_avp':_0x4af5('0xa'),'icesupport':_0x4af5('0xa'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0x4af5('0xb'),'dtlsprivatekey':_0x4af5('0xc'),'dtlssetup':_0x4af5('0xd'),'callerid':util[_0x4af5('0x3')](_0x4af5('0xe'),util['format'](_0x4af5('0x4'),_0x4af5('0x5'),i),0xfa0+i)});}db[_0x4af5('0xf')][_0x4af5('0x10')](users)[_0x4af5('0x11')](function(){console[_0x4af5('0x12')]('add\x20user');})[_0x4af5('0x13')](function(_0x1b4eef){console[_0x4af5('0x12')](_0x1b4eef);}); \ No newline at end of file +var _0x78e7=['agent','password','friend','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','catch','log','util','../mysqldb','format','%s%s'];(function(_0xd16f52,_0x2619a3){var _0x3ff424=function(_0x4959b2){while(--_0x4959b2){_0xd16f52['push'](_0xd16f52['shift']());}};_0x3ff424(++_0x2619a3);}(_0x78e7,0x9c));var _0x778e=function(_0x404b85,_0x3056c7){_0x404b85=_0x404b85-0x0;var _0x5ae857=_0x78e7[_0x404b85];return _0x5ae857;};'use strict';var util=require(_0x778e('0x0'));var db=require(_0x778e('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0x778e('0x2')](_0x778e('0x3'),'agent',i),'fullname':util['format'](_0x778e('0x3'),'agent',i),'email':util[_0x778e('0x2')]('%s%s@xcally.com',_0x778e('0x4'),i),'role':_0x778e('0x4'),'password':_0x778e('0x5'),'internal':0xfa0+i,'type':_0x778e('0x6'),'transport':['udp','ws',_0x778e('0x7')],'disallow':[_0x778e('0x8')],'allow':[_0x778e('0x9')],'defaultuser':util[_0x778e('0x2')](_0x778e('0x3'),_0x778e('0x4'),i),'encryption':_0x778e('0xa'),'avpf':'yes','force_avp':_0x778e('0xa'),'icesupport':'yes','dtlsenable':_0x778e('0xa'),'dtlsverify':'no','dtlscertfile':_0x778e('0xb'),'dtlsprivatekey':_0x778e('0xc'),'dtlssetup':_0x778e('0xd'),'callerid':util[_0x778e('0x2')](_0x778e('0xe'),util['format'](_0x778e('0x3'),_0x778e('0x4'),i),0xfa0+i)});}db[_0x778e('0xf')][_0x778e('0x10')](users)[_0x778e('0x11')](function(){console['log']('add\x20user');})[_0x778e('0x12')](function(_0x5a21f6){console[_0x778e('0x13')](_0x5a21f6);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 7f1b71f..03fac53 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8004=['Campaign','where','Agents','length','user:%s','handshake','query','find','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','FaxInteraction','FaxInteractions','SmsInteractions','WhatsappInteractions','format','admin','voice:inbound','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','FaxQueues','voice:outbound','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getOpenchannelQueues','getWhatsappQueues','all','chat','fax','mail','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','user_has_chat_interactions:remove','MailInteractions','removeMailInteractions','emit','user_has_mail_interactions:remove','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','OpenchannelInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','default','connection','setMaxListeners','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','address','log','DISCONNECTED','CONNECTED','lodash','util','../mysqldb','./environment','name','User','role','telephone','agent','type','ivr','UserProfileSection','findOne','then','VoiceQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','map'];(function(_0xaacf9c,_0x30040c){var _0x5d6172=function(_0x447ad3){while(--_0x447ad3){_0xaacf9c['push'](_0xaacf9c['shift']());}};_0x5d6172(++_0x30040c);}(_0x8004,0x176));var _0x4800=function(_0x24eba4,_0x133cdb){_0x24eba4=_0x24eba4-0x0;var _0x3bcbbd=_0x8004[_0x24eba4];return _0x3bcbbd;};'use strict';var _=require(_0x4800('0x0'));var util=require(_0x4800('0x1'));var BPromise=require('bluebird');var db=require(_0x4800('0x2'))['db'];var config=require(_0x4800('0x3'));var queryQueues={'attributes':['id',_0x4800('0x4')],'include':[{'as':'Agents','model':db[_0x4800('0x5')],'attributes':['id',_0x4800('0x4'),_0x4800('0x6')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x4800('0x4')],'where':{'role':_0x4800('0x7')}};var queryTrunks={'raw':!![],'attributes':['id',_0x4800('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0x4800('0x4')],'where':{'role':_0x4800('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x4800('0x4'),_0x4800('0x9')],'where':{'type':_0x4800('0xa')}};function getAssociatedResources(_0x53e2bd,_0xb79395,_0x205a46){return db[_0x4800('0xb')][_0x4800('0xc')]({'where':{'name':_0x53e2bd,'userProfileId':_0xb79395},'raw':!![]})[_0x4800('0xd')](function(_0x3aa2fc){if(_0x3aa2fc){if(_0x3aa2fc['autoAssociation']){switch(_0x53e2bd){case _0x4800('0xe'):case'ChatQueues':case'FaxQueues':case _0x4800('0xf'):case _0x4800('0x10'):case _0x4800('0x11'):case _0x4800('0x12'):return db[_0x205a46][_0x4800('0x13')](queryQueues);case _0x4800('0x14'):return db[_0x205a46][_0x4800('0x13')](queryTelephones);case _0x4800('0x15'):return db[_0x205a46][_0x4800('0x13')](queryTrunks);case _0x4800('0x16'):return db[_0x205a46][_0x4800('0x13')](queryCampaigns);}}else{return db[_0x4800('0x17')][_0x4800('0x13')]({'attributes':[_0x4800('0x18')],'where':{'sectionId':_0x3aa2fc['id']},'raw':!![]})[_0x4800('0xd')](function(_0x487d84){if(_0x487d84){var _0x235be5={'where':{'id':_[_0x4800('0x19')](_0x487d84,_0x4800('0x18'))},'raw':!![]};switch(_0x205a46){case'User':_0x235be5['where'][_0x4800('0x6')]=_0x4800('0x7');break;case _0x4800('0x1a'):_0x235be5[_0x4800('0x1b')][_0x4800('0x9')]=_0x4800('0xa');break;}return db[_0x205a46][_0x4800('0x13')](_0x235be5);}else{return[];}});}}else{return[];}})[_0x4800('0xd')](function(_0x47dff7){return _0x47dff7;});}function joinOrLeaveQueues(_0x56858a,_0x59f1fa,_0x9fb5cc,_0x353f63){_0x56858a[_0x59f1fa](util['format']('%s:queue:%s',_0x9fb5cc,_0x353f63['name']));if(_0x353f63[_0x4800('0x1c')]){for(var _0x381fbd=0x0;_0x381fbd<_0x353f63[_0x4800('0x1c')][_0x4800('0x1d')];_0x381fbd+=0x1){_0x56858a[_0x59f1fa](util['format'](_0x4800('0x1e'),_0x353f63['Agents'][_0x381fbd]['name']));}}}function joinOrLeave(_0x42aa06,_0x57bff8,_0x1a6915){var _0x22f7af;if(_0x42aa06[_0x4800('0x1f')][_0x4800('0x20')]['id']){db[_0x4800('0x5')][_0x4800('0x21')]({'attributes':['id',_0x4800('0x4'),_0x4800('0x6'),_0x4800('0x22')],'where':{'id':_0x42aa06[_0x4800('0x1f')][_0x4800('0x20')]['id']},'include':[{'model':db[_0x4800('0x23')],'as':_0x4800('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x4800('0x25')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x4800('0x26')],'as':_0x4800('0x27'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0x4800('0x28'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0x4800('0x29'),'attributes':['id'],'raw':!![]}]})[_0x4800('0xd')](function(_0xbdd431){if(_0xbdd431){_0x22f7af=_0xbdd431;_0x42aa06[_0x57bff8](util[_0x4800('0x2a')](_0x4800('0x1e'),_0xbdd431[_0x4800('0x4')]));var _0x55c9f5=[];switch(_0xbdd431[_0x4800('0x6')]){case _0x4800('0x2b'):_0x42aa06[_0x57bff8](_0x4800('0x2c'));_0x42aa06[_0x57bff8]('voice:outbound');if(queryQueues['hasOwnProperty'](_0x4800('0x2d'))){delete queryQueues[_0x4800('0x2d')];}_0x55c9f5[_0x4800('0x2e')](db[_0x4800('0x2f')]['findAll'](queryQueues));_0x55c9f5[_0x4800('0x2e')](db[_0x4800('0x30')][_0x4800('0x13')](queryQueues));_0x55c9f5['push'](db[_0x4800('0x31')][_0x4800('0x13')](queryQueues));_0x55c9f5[_0x4800('0x2e')](db[_0x4800('0x32')][_0x4800('0x13')](queryQueues));_0x55c9f5[_0x4800('0x2e')](db[_0x4800('0x33')][_0x4800('0x13')](queryQueues));_0x55c9f5[_0x4800('0x2e')](db[_0x4800('0x34')][_0x4800('0x13')](queryQueues));_0x55c9f5[_0x4800('0x2e')](db[_0x4800('0x35')][_0x4800('0x13')](queryQueues));_0x55c9f5['push'](db[_0x4800('0x5')]['findAll'](queryTelephones));_0x55c9f5['push'](db[_0x4800('0x36')][_0x4800('0x13')](queryTrunks));_0x55c9f5[_0x4800('0x2e')](db[_0x4800('0x1a')]['findAll'](queryCampaigns));_0x55c9f5[_0x4800('0x2e')](db['User'][_0x4800('0x13')](queryAgents));break;case _0x4800('0x37'):_0x42aa06[_0x57bff8]('voice:inbound');_0x42aa06[_0x57bff8]('voice:outbound');_0x55c9f5[_0x4800('0x2e')](getAssociatedResources(_0x4800('0xe'),_0xbdd431[_0x4800('0x22')],_0x4800('0x2f')));_0x55c9f5[_0x4800('0x2e')](getAssociatedResources('ChatQueues',_0xbdd431[_0x4800('0x22')],_0x4800('0x30')));_0x55c9f5[_0x4800('0x2e')](getAssociatedResources(_0x4800('0x38'),_0xbdd431['userProfileId'],_0x4800('0x31')));_0x55c9f5[_0x4800('0x2e')](getAssociatedResources(_0x4800('0xf'),_0xbdd431[_0x4800('0x22')],'SmsQueue'));_0x55c9f5[_0x4800('0x2e')](getAssociatedResources(_0x4800('0x10'),_0xbdd431[_0x4800('0x22')],_0x4800('0x33')));_0x55c9f5[_0x4800('0x2e')](getAssociatedResources(_0x4800('0x11'),_0xbdd431[_0x4800('0x22')],_0x4800('0x34')));_0x55c9f5[_0x4800('0x2e')](getAssociatedResources(_0x4800('0x12'),_0xbdd431[_0x4800('0x22')],'WhatsappQueue'));_0x55c9f5['push'](getAssociatedResources(_0x4800('0x14'),_0xbdd431[_0x4800('0x22')],_0x4800('0x5')));_0x55c9f5[_0x4800('0x2e')](getAssociatedResources(_0x4800('0x15'),_0xbdd431[_0x4800('0x22')],'Trunk'));_0x55c9f5['push'](getAssociatedResources('IvrCampaigns',_0xbdd431['userProfileId'],'Campaign'));_0x55c9f5[_0x4800('0x2e')](db[_0x4800('0x5')][_0x4800('0x13')](queryAgents));break;case _0x4800('0x8'):_0x42aa06[_0x57bff8](_0x4800('0x2c'));_0x42aa06[_0x57bff8](_0x4800('0x39'));_0x55c9f5[_0x4800('0x2e')](_0xbdd431[_0x4800('0x3a')]({'attributes':['id',_0x4800('0x4')]}));_0x55c9f5['push'](_0xbdd431[_0x4800('0x3b')]({'attributes':['id','name']}));_0x55c9f5[_0x4800('0x2e')](_0xbdd431[_0x4800('0x3c')]({'attributes':['id','name']}));_0x55c9f5[_0x4800('0x2e')](_0xbdd431[_0x4800('0x3d')]({'attributes':['id',_0x4800('0x4')]}));_0x55c9f5[_0x4800('0x2e')](_0xbdd431['getMailQueues']({'attributes':['id',_0x4800('0x4')]}));_0x55c9f5[_0x4800('0x2e')](_0xbdd431[_0x4800('0x3e')]({'attributes':['id','name']}));_0x55c9f5['push'](_0xbdd431[_0x4800('0x3f')]({'attributes':['id',_0x4800('0x4')]}));break;}return BPromise[_0x4800('0x40')](_0x55c9f5);}})[_0x4800('0xd')](function(_0x13e528){if(_0x13e528&&_0x13e528[_0x4800('0x1d')]){for(var _0x3d699c=0x0;_0x3d699c<_0x13e528[_0x4800('0x1d')];_0x3d699c+=0x1){for(var _0x3a21dc=0x0;_0x3a21dc<_0x13e528[_0x3d699c][_0x4800('0x1d')];_0x3a21dc+=0x1){switch(_0x3d699c){case 0x0:joinOrLeaveQueues(_0x42aa06,_0x57bff8,'voice',_0x13e528[_0x3d699c][_0x3a21dc]);break;case 0x1:joinOrLeaveQueues(_0x42aa06,_0x57bff8,_0x4800('0x41'),_0x13e528[_0x3d699c][_0x3a21dc]);break;case 0x2:joinOrLeaveQueues(_0x42aa06,_0x57bff8,_0x4800('0x42'),_0x13e528[_0x3d699c][_0x3a21dc]);break;case 0x3:joinOrLeaveQueues(_0x42aa06,_0x57bff8,'sms',_0x13e528[_0x3d699c][_0x3a21dc]);break;case 0x4:joinOrLeaveQueues(_0x42aa06,_0x57bff8,_0x4800('0x43'),_0x13e528[_0x3d699c][_0x3a21dc]);break;case 0x5:joinOrLeaveQueues(_0x42aa06,_0x57bff8,_0x4800('0x44'),_0x13e528[_0x3d699c][_0x3a21dc]);break;case 0x6:joinOrLeaveQueues(_0x42aa06,_0x57bff8,_0x4800('0x45'),_0x13e528[_0x3d699c][_0x3a21dc]);break;case 0x7:if(_0x22f7af[_0x4800('0x6')]!==_0x4800('0x8'))_0x42aa06[_0x57bff8](util[_0x4800('0x2a')](_0x4800('0x46'),_0x13e528[_0x3d699c][_0x3a21dc][_0x4800('0x4')]));break;case 0x8:if(_0x22f7af['role']!==_0x4800('0x8'))_0x42aa06[_0x57bff8](util[_0x4800('0x2a')](_0x4800('0x47'),_0x13e528[_0x3d699c][_0x3a21dc][_0x4800('0x4')]));break;case 0x9:if(_0x22f7af['role']!==_0x4800('0x8'))_0x42aa06[_0x57bff8](util[_0x4800('0x2a')](_0x4800('0x48'),_0x13e528[_0x3d699c][_0x3a21dc][_0x4800('0x9')],_0x13e528[_0x3d699c][_0x3a21dc]['name']));break;case 0xa:_0x42aa06[_0x57bff8](util[_0x4800('0x2a')](_0x4800('0x1e'),_0x13e528[_0x3d699c][_0x3a21dc]['name']));break;}}}}})[_0x4800('0xd')](function(){if(_0x57bff8===_0x4800('0x49')){var _0x305fd6=_['map'](_0x22f7af[_0x4800('0x24')],'id');return _0x22f7af[_0x4800('0x4a')](_0x305fd6)[_0x4800('0xd')](function(){for(var _0x16f395=0x0;_0x16f395<_0x305fd6[_0x4800('0x1d')];_0x16f395+=0x1){_0x1a6915['emit'](_0x4800('0x4b'),{'ChatInteractionId':Number(_0x305fd6[_0x16f395]),'UserId':Number(_0x22f7af['id'])});}});}})[_0x4800('0xd')](function(){if(_0x57bff8==='leave'){var _0x4e5fd9=_[_0x4800('0x19')](_0x22f7af[_0x4800('0x4c')],'id');return _0x22f7af[_0x4800('0x4d')](_0x4e5fd9)['then'](function(){for(var _0x360115=0x0;_0x360115<_0x4e5fd9[_0x4800('0x1d')];_0x360115+=0x1){_0x1a6915[_0x4800('0x4e')](_0x4800('0x4f'),{'MailInteractionId':Number(_0x4e5fd9[_0x360115]),'UserId':Number(_0x22f7af['id'])});}});}})[_0x4800('0xd')](function(){if(_0x57bff8==='leave'){var _0x217a1c=_[_0x4800('0x19')](_0x22f7af['FaxInteractions'],'id');return _0x22f7af['removeFaxInteractions'](_0x217a1c)[_0x4800('0xd')](function(){for(var _0x41526f=0x0;_0x41526f<_0x217a1c['length'];_0x41526f+=0x1){_0x1a6915['emit'](_0x4800('0x50'),{'FaxInteractionId':Number(_0x217a1c[_0x41526f]),'UserId':Number(_0x22f7af['id'])});}});}})[_0x4800('0xd')](function(){if(_0x57bff8===_0x4800('0x49')){var _0x1b00b6=_['map'](_0x22f7af[_0x4800('0x28')],'id');return _0x22f7af[_0x4800('0x51')](_0x1b00b6)['then'](function(){for(var _0x170625=0x0;_0x170625<_0x1b00b6[_0x4800('0x1d')];_0x170625+=0x1){_0x1a6915[_0x4800('0x4e')](_0x4800('0x52'),{'SmsInteractionId':Number(_0x1b00b6[_0x170625]),'UserId':Number(_0x22f7af['id'])});}});}})[_0x4800('0xd')](function(){if(_0x57bff8===_0x4800('0x49')){var _0x217b47=_[_0x4800('0x19')](_0x22f7af[_0x4800('0x53')],'id');return _0x22f7af[_0x4800('0x54')](_0x217b47)[_0x4800('0xd')](function(){for(var _0x29a316=0x0;_0x29a316<_0x217b47['length'];_0x29a316+=0x1){_0x1a6915[_0x4800('0x4e')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x217b47[_0x29a316]),'UserId':Number(_0x22f7af['id'])});}});}})['then'](function(){if(_0x57bff8==='leave'){var _0x50ca42=_[_0x4800('0x19')](_0x22f7af['WhatsappInteractions'],'id');return _0x22f7af[_0x4800('0x55')](_0x50ca42)['then'](function(){for(var _0x37aba2=0x0;_0x37aba2<_0x50ca42[_0x4800('0x1d')];_0x37aba2+=0x1){_0x1a6915['emit'](_0x4800('0x56'),{'WhatsappInteractionId':Number(_0x50ca42[_0x37aba2]),'UserId':Number(_0x22f7af['id'])});}});}})[_0x4800('0x57')](function(_0x4ae1d7){_0x42aa06['log'](_0x4ae1d7);});}}function onDisconnect(_0x476f0b,_0x58e341){joinOrLeave(_0x476f0b,_0x4800('0x49'),_0x58e341);}function onConnect(_0x170bce){joinOrLeave(_0x170bce,'join');}exports[_0x4800('0x58')]=function(_0x2a534c){_0x2a534c['on'](_0x4800('0x59'),function(_0xe9d8a9){_0xe9d8a9[_0x4800('0x5a')](0x0);_0xe9d8a9['address']=_0xe9d8a9[_0x4800('0x5b')][_0x4800('0x59')][_0x4800('0x5c')]+':'+_0xe9d8a9['request']['connection'][_0x4800('0x5d')];_0xe9d8a9[_0x4800('0x5e')]=new Date();_0xe9d8a9['log']=function(_0x3281ff){console['log'](_0x4800('0x5f')+_0xe9d8a9['nsp'][_0x4800('0x4')]+'['+_0xe9d8a9[_0x4800('0x60')]+']',_0x3281ff);};_0xe9d8a9['on']('disconnect',function(){onDisconnect(_0xe9d8a9,_0x2a534c);_0xe9d8a9[_0x4800('0x61')](_0x4800('0x62'));});onConnect(_0xe9d8a9);_0xe9d8a9[_0x4800('0x61')](_0x4800('0x63'));});}; \ No newline at end of file +var _0x1107=['log','join','default','connection','setMaxListeners','address','request','remoteAddress','remotePort','connectedAt','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','name','Agents','role','agent','telephone','type','ivr','UserProfileSection','then','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','User','where','%s:queue:%s','length','format','user:%s','handshake','find','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','hasOwnProperty','include','push','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','Trunk','Campaign','user','voice:outbound','VoiceQueue','ChatQueue','voice:inbound','getChatQueues','getFaxQueues','getOpenchannelQueues','all','voice','chat','fax','sms','mail','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','emit','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch'];(function(_0x57ca15,_0x4c1f5e){var _0x4dbc85=function(_0x325409){while(--_0x325409){_0x57ca15['push'](_0x57ca15['shift']());}};_0x4dbc85(++_0x4c1f5e);}(_0x1107,0xd8));var _0x7110=function(_0x1fc122,_0x5e2c17){_0x1fc122=_0x1fc122-0x0;var _0xa2cb13=_0x1107[_0x1fc122];return _0xa2cb13;};'use strict';var _=require(_0x7110('0x0'));var util=require(_0x7110('0x1'));var BPromise=require(_0x7110('0x2'));var db=require('../mysqldb')['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0x7110('0x3')],'include':[{'as':_0x7110('0x4'),'model':db['User'],'attributes':['id',_0x7110('0x3'),_0x7110('0x5')],'raw':!![],'where':{'role':_0x7110('0x6')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x7110('0x3')],'where':{'role':_0x7110('0x7')}};var queryTrunks={'raw':!![],'attributes':['id',_0x7110('0x3')]};var queryAgents={'raw':!![],'attributes':['id',_0x7110('0x3')],'where':{'role':_0x7110('0x6')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x7110('0x3'),_0x7110('0x8')],'where':{'type':_0x7110('0x9')}};function getAssociatedResources(_0x466351,_0x271466,_0x4960b1){return db[_0x7110('0xa')]['findOne']({'where':{'name':_0x466351,'userProfileId':_0x271466},'raw':!![]})[_0x7110('0xb')](function(_0x19d729){if(_0x19d729){if(_0x19d729['autoAssociation']){switch(_0x466351){case _0x7110('0xc'):case _0x7110('0xd'):case _0x7110('0xe'):case _0x7110('0xf'):case _0x7110('0x10'):case _0x7110('0x11'):case _0x7110('0x12'):return db[_0x4960b1][_0x7110('0x13')](queryQueues);case _0x7110('0x14'):return db[_0x4960b1]['findAll'](queryTelephones);case _0x7110('0x15'):return db[_0x4960b1]['findAll'](queryTrunks);case _0x7110('0x16'):return db[_0x4960b1]['findAll'](queryCampaigns);}}else{return db[_0x7110('0x17')][_0x7110('0x13')]({'attributes':[_0x7110('0x18')],'where':{'sectionId':_0x19d729['id']},'raw':!![]})[_0x7110('0xb')](function(_0x26fe8a){if(_0x26fe8a){var _0x1a8f7f={'where':{'id':_[_0x7110('0x19')](_0x26fe8a,'resourceId')},'raw':!![]};switch(_0x4960b1){case _0x7110('0x1a'):_0x1a8f7f['where'][_0x7110('0x5')]=_0x7110('0x7');break;case'Campaign':_0x1a8f7f[_0x7110('0x1b')][_0x7110('0x8')]=_0x7110('0x9');break;}return db[_0x4960b1]['findAll'](_0x1a8f7f);}else{return[];}});}}else{return[];}})['then'](function(_0x25cc51){return _0x25cc51;});}function joinOrLeaveQueues(_0x13c8ea,_0x388c84,_0x21cc2e,_0x2adfc7){_0x13c8ea[_0x388c84](util['format'](_0x7110('0x1c'),_0x21cc2e,_0x2adfc7[_0x7110('0x3')]));if(_0x2adfc7[_0x7110('0x4')]){for(var _0x264250=0x0;_0x264250<_0x2adfc7[_0x7110('0x4')][_0x7110('0x1d')];_0x264250+=0x1){_0x13c8ea[_0x388c84](util[_0x7110('0x1e')](_0x7110('0x1f'),_0x2adfc7['Agents'][_0x264250][_0x7110('0x3')]));}}}function joinOrLeave(_0x5e22d9,_0x3bd510,_0xcf45c){var _0x2373b4;if(_0x5e22d9[_0x7110('0x20')]['query']['id']){db[_0x7110('0x1a')][_0x7110('0x21')]({'attributes':['id',_0x7110('0x3'),'role',_0x7110('0x22')],'where':{'id':_0x5e22d9['handshake']['query']['id']},'include':[{'model':db[_0x7110('0x23')],'as':_0x7110('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x7110('0x25')],'as':_0x7110('0x26'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0x7110('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x7110('0x28')],'as':_0x7110('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0x7110('0x2a')],'as':_0x7110('0x2b'),'attributes':['id'],'raw':!![]},{'model':db[_0x7110('0x2c')],'as':_0x7110('0x2d'),'attributes':['id'],'raw':!![]}]})[_0x7110('0xb')](function(_0x1b163a){if(_0x1b163a){_0x2373b4=_0x1b163a;_0x5e22d9[_0x3bd510](util[_0x7110('0x1e')](_0x7110('0x1f'),_0x1b163a[_0x7110('0x3')]));var _0x5aedc2=[];switch(_0x1b163a['role']){case _0x7110('0x2e'):_0x5e22d9[_0x3bd510]('voice:inbound');_0x5e22d9[_0x3bd510]('voice:outbound');if(queryQueues[_0x7110('0x2f')](_0x7110('0x30'))){delete queryQueues['include'];}_0x5aedc2[_0x7110('0x31')](db['VoiceQueue'][_0x7110('0x13')](queryQueues));_0x5aedc2[_0x7110('0x31')](db['ChatQueue'][_0x7110('0x13')](queryQueues));_0x5aedc2[_0x7110('0x31')](db[_0x7110('0x32')]['findAll'](queryQueues));_0x5aedc2[_0x7110('0x31')](db[_0x7110('0x33')][_0x7110('0x13')](queryQueues));_0x5aedc2[_0x7110('0x31')](db[_0x7110('0x34')][_0x7110('0x13')](queryQueues));_0x5aedc2[_0x7110('0x31')](db[_0x7110('0x35')][_0x7110('0x13')](queryQueues));_0x5aedc2['push'](db['WhatsappQueue'][_0x7110('0x13')](queryQueues));_0x5aedc2['push'](db[_0x7110('0x1a')][_0x7110('0x13')](queryTelephones));_0x5aedc2[_0x7110('0x31')](db[_0x7110('0x36')]['findAll'](queryTrunks));_0x5aedc2['push'](db[_0x7110('0x37')]['findAll'](queryCampaigns));_0x5aedc2[_0x7110('0x31')](db[_0x7110('0x1a')]['findAll'](queryAgents));break;case _0x7110('0x38'):_0x5e22d9[_0x3bd510]('voice:inbound');_0x5e22d9[_0x3bd510](_0x7110('0x39'));_0x5aedc2[_0x7110('0x31')](getAssociatedResources(_0x7110('0xc'),_0x1b163a[_0x7110('0x22')],_0x7110('0x3a')));_0x5aedc2['push'](getAssociatedResources(_0x7110('0xd'),_0x1b163a[_0x7110('0x22')],_0x7110('0x3b')));_0x5aedc2[_0x7110('0x31')](getAssociatedResources(_0x7110('0xe'),_0x1b163a[_0x7110('0x22')],'FaxQueue'));_0x5aedc2[_0x7110('0x31')](getAssociatedResources(_0x7110('0xf'),_0x1b163a[_0x7110('0x22')],'SmsQueue'));_0x5aedc2['push'](getAssociatedResources('MailQueues',_0x1b163a[_0x7110('0x22')],_0x7110('0x34')));_0x5aedc2[_0x7110('0x31')](getAssociatedResources(_0x7110('0x11'),_0x1b163a['userProfileId'],_0x7110('0x35')));_0x5aedc2[_0x7110('0x31')](getAssociatedResources('WhatsappQueues',_0x1b163a[_0x7110('0x22')],'WhatsappQueue'));_0x5aedc2['push'](getAssociatedResources('Telephones',_0x1b163a[_0x7110('0x22')],'User'));_0x5aedc2[_0x7110('0x31')](getAssociatedResources(_0x7110('0x15'),_0x1b163a[_0x7110('0x22')],'Trunk'));_0x5aedc2[_0x7110('0x31')](getAssociatedResources('IvrCampaigns',_0x1b163a[_0x7110('0x22')],_0x7110('0x37')));_0x5aedc2[_0x7110('0x31')](db[_0x7110('0x1a')][_0x7110('0x13')](queryAgents));break;case _0x7110('0x6'):_0x5e22d9[_0x3bd510](_0x7110('0x3c'));_0x5e22d9[_0x3bd510]('voice:outbound');_0x5aedc2[_0x7110('0x31')](_0x1b163a['getVoiceQueues']({'attributes':['id',_0x7110('0x3')]}));_0x5aedc2['push'](_0x1b163a[_0x7110('0x3d')]({'attributes':['id',_0x7110('0x3')]}));_0x5aedc2['push'](_0x1b163a[_0x7110('0x3e')]({'attributes':['id',_0x7110('0x3')]}));_0x5aedc2[_0x7110('0x31')](_0x1b163a['getSmsQueues']({'attributes':['id','name']}));_0x5aedc2[_0x7110('0x31')](_0x1b163a['getMailQueues']({'attributes':['id',_0x7110('0x3')]}));_0x5aedc2[_0x7110('0x31')](_0x1b163a[_0x7110('0x3f')]({'attributes':['id',_0x7110('0x3')]}));_0x5aedc2[_0x7110('0x31')](_0x1b163a['getWhatsappQueues']({'attributes':['id',_0x7110('0x3')]}));break;}return BPromise[_0x7110('0x40')](_0x5aedc2);}})[_0x7110('0xb')](function(_0x15b2ca){if(_0x15b2ca&&_0x15b2ca['length']){for(var _0x1bb7f3=0x0;_0x1bb7f3<_0x15b2ca[_0x7110('0x1d')];_0x1bb7f3+=0x1){for(var _0x4ca881=0x0;_0x4ca881<_0x15b2ca[_0x1bb7f3]['length'];_0x4ca881+=0x1){switch(_0x1bb7f3){case 0x0:joinOrLeaveQueues(_0x5e22d9,_0x3bd510,_0x7110('0x41'),_0x15b2ca[_0x1bb7f3][_0x4ca881]);break;case 0x1:joinOrLeaveQueues(_0x5e22d9,_0x3bd510,_0x7110('0x42'),_0x15b2ca[_0x1bb7f3][_0x4ca881]);break;case 0x2:joinOrLeaveQueues(_0x5e22d9,_0x3bd510,_0x7110('0x43'),_0x15b2ca[_0x1bb7f3][_0x4ca881]);break;case 0x3:joinOrLeaveQueues(_0x5e22d9,_0x3bd510,_0x7110('0x44'),_0x15b2ca[_0x1bb7f3][_0x4ca881]);break;case 0x4:joinOrLeaveQueues(_0x5e22d9,_0x3bd510,_0x7110('0x45'),_0x15b2ca[_0x1bb7f3][_0x4ca881]);break;case 0x5:joinOrLeaveQueues(_0x5e22d9,_0x3bd510,'openchannel',_0x15b2ca[_0x1bb7f3][_0x4ca881]);break;case 0x6:joinOrLeaveQueues(_0x5e22d9,_0x3bd510,_0x7110('0x46'),_0x15b2ca[_0x1bb7f3][_0x4ca881]);break;case 0x7:if(_0x2373b4['role']!==_0x7110('0x6'))_0x5e22d9[_0x3bd510](util['format'](_0x7110('0x47'),_0x15b2ca[_0x1bb7f3][_0x4ca881][_0x7110('0x3')]));break;case 0x8:if(_0x2373b4[_0x7110('0x5')]!=='agent')_0x5e22d9[_0x3bd510](util[_0x7110('0x1e')](_0x7110('0x48'),_0x15b2ca[_0x1bb7f3][_0x4ca881]['name']));break;case 0x9:if(_0x2373b4[_0x7110('0x5')]!==_0x7110('0x6'))_0x5e22d9[_0x3bd510](util[_0x7110('0x1e')](_0x7110('0x49'),_0x15b2ca[_0x1bb7f3][_0x4ca881][_0x7110('0x8')],_0x15b2ca[_0x1bb7f3][_0x4ca881][_0x7110('0x3')]));break;case 0xa:_0x5e22d9[_0x3bd510](util[_0x7110('0x1e')](_0x7110('0x1f'),_0x15b2ca[_0x1bb7f3][_0x4ca881]['name']));break;}}}}})[_0x7110('0xb')](function(){if(_0x3bd510===_0x7110('0x4a')){var _0x29ffe6=_[_0x7110('0x19')](_0x2373b4['ChatInteractions'],'id');return _0x2373b4['removeChatInteractions'](_0x29ffe6)[_0x7110('0xb')](function(){for(var _0x26976d=0x0;_0x26976d<_0x29ffe6[_0x7110('0x1d')];_0x26976d+=0x1){_0xcf45c[_0x7110('0x4b')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x29ffe6[_0x26976d]),'UserId':Number(_0x2373b4['id'])});}});}})['then'](function(){if(_0x3bd510===_0x7110('0x4a')){var _0x3d7ad6=_[_0x7110('0x19')](_0x2373b4[_0x7110('0x26')],'id');return _0x2373b4[_0x7110('0x4c')](_0x3d7ad6)[_0x7110('0xb')](function(){for(var _0xa28592=0x0;_0xa28592<_0x3d7ad6['length'];_0xa28592+=0x1){_0xcf45c[_0x7110('0x4b')](_0x7110('0x4d'),{'MailInteractionId':Number(_0x3d7ad6[_0xa28592]),'UserId':Number(_0x2373b4['id'])});}});}})[_0x7110('0xb')](function(){if(_0x3bd510==='leave'){var _0x106ea4=_[_0x7110('0x19')](_0x2373b4[_0x7110('0x27')],'id');return _0x2373b4[_0x7110('0x4e')](_0x106ea4)[_0x7110('0xb')](function(){for(var _0x5c9b76=0x0;_0x5c9b76<_0x106ea4[_0x7110('0x1d')];_0x5c9b76+=0x1){_0xcf45c[_0x7110('0x4b')](_0x7110('0x4f'),{'FaxInteractionId':Number(_0x106ea4[_0x5c9b76]),'UserId':Number(_0x2373b4['id'])});}});}})[_0x7110('0xb')](function(){if(_0x3bd510===_0x7110('0x4a')){var _0x2102fd=_[_0x7110('0x19')](_0x2373b4[_0x7110('0x29')],'id');return _0x2373b4[_0x7110('0x50')](_0x2102fd)[_0x7110('0xb')](function(){for(var _0x64b6df=0x0;_0x64b6df<_0x2102fd['length'];_0x64b6df+=0x1){_0xcf45c[_0x7110('0x4b')](_0x7110('0x51'),{'SmsInteractionId':Number(_0x2102fd[_0x64b6df]),'UserId':Number(_0x2373b4['id'])});}});}})[_0x7110('0xb')](function(){if(_0x3bd510===_0x7110('0x4a')){var _0x9f41ab=_[_0x7110('0x19')](_0x2373b4['OpenchannelInteractions'],'id');return _0x2373b4[_0x7110('0x52')](_0x9f41ab)[_0x7110('0xb')](function(){for(var _0x444025=0x0;_0x444025<_0x9f41ab[_0x7110('0x1d')];_0x444025+=0x1){_0xcf45c[_0x7110('0x4b')](_0x7110('0x53'),{'OpenchannelInteractionId':Number(_0x9f41ab[_0x444025]),'UserId':Number(_0x2373b4['id'])});}});}})[_0x7110('0xb')](function(){if(_0x3bd510===_0x7110('0x4a')){var _0x3b17b4=_[_0x7110('0x19')](_0x2373b4[_0x7110('0x2d')],'id');return _0x2373b4[_0x7110('0x54')](_0x3b17b4)[_0x7110('0xb')](function(){for(var _0xfb36c1=0x0;_0xfb36c1<_0x3b17b4[_0x7110('0x1d')];_0xfb36c1+=0x1){_0xcf45c[_0x7110('0x4b')](_0x7110('0x55'),{'WhatsappInteractionId':Number(_0x3b17b4[_0xfb36c1]),'UserId':Number(_0x2373b4['id'])});}});}})[_0x7110('0x56')](function(_0x364a42){_0x5e22d9[_0x7110('0x57')](_0x364a42);});}}function onDisconnect(_0xb8f1d7,_0x5ec978){joinOrLeave(_0xb8f1d7,_0x7110('0x4a'),_0x5ec978);}function onConnect(_0x1112f7){joinOrLeave(_0x1112f7,_0x7110('0x58'));}exports[_0x7110('0x59')]=function(_0xc58606){_0xc58606['on'](_0x7110('0x5a'),function(_0x2d3f96){_0x2d3f96[_0x7110('0x5b')](0x0);_0x2d3f96[_0x7110('0x5c')]=_0x2d3f96[_0x7110('0x5d')][_0x7110('0x5a')][_0x7110('0x5e')]+':'+_0x2d3f96[_0x7110('0x5d')]['connection'][_0x7110('0x5f')];_0x2d3f96[_0x7110('0x60')]=new Date();_0x2d3f96[_0x7110('0x57')]=function(_0x34de8b){console[_0x7110('0x57')]('SocketIO\x20'+_0x2d3f96[_0x7110('0x61')][_0x7110('0x3')]+'['+_0x2d3f96[_0x7110('0x5c')]+']',_0x34de8b);};_0x2d3f96['on'](_0x7110('0x62'),function(){onDisconnect(_0x2d3f96,_0xc58606);_0x2d3f96[_0x7110('0x57')](_0x7110('0x63'));});onConnect(_0x2d3f96);_0x2d3f96[_0x7110('0x57')](_0x7110('0x64'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index b91e4e5..865b560 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 _0xa509=['Fax','FaxInteraction','Mail','MailInteraction','Openchannel','OpenchannelInteraction','OpenchannelMessage','EventManager','then','info','Trigger,\x20%s','code','error','get','channel','motionChannel','event','direction','undefined','ContactId','sequelize','query','Sequelize','contact','interface','format','SIP/%s','agent','incomingmessage','outgoingmessage','catch','AfterCreateMessage','opened','resolve','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','UserId','name','AfterCreate','changed','closed','substatus','SELECT','AfterUpdate','User','find','fullname','internal','default','hasOwnProperty','model','callback','condition','util','../../mysqldb','jayson/promise','triggers','client','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','closedinteraction','ChatMessage','newmessage','ChatOfflineMessage','SmsInteraction','Sms','WhatsappInteraction','Whatsapp','WhatsappMessage'];(function(_0x53fa56,_0x287f65){var _0x6fd27=function(_0x56a967){while(--_0x56a967){_0x53fa56['push'](_0x53fa56['shift']());}};_0x6fd27(++_0x287f65);}(_0xa509,0x1e5));var _0x9a50=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xa509[_0x122ef9];return _0x42fba0;};'use strict';var util=require(_0x9a50('0x0'));var db=require(_0x9a50('0x1'))['db'];var jayson=require(_0x9a50('0x2'));var logger=require('../logger')(_0x9a50('0x3'));var client=jayson[_0x9a50('0x4')]['http']({'port':0x232a});var triggers=[{'channel':_0x9a50('0x5'),'model':_0x9a50('0x6'),'event':_0x9a50('0x7'),'condition':_0x9a50('0x8'),'callback':afterCreate},{'channel':'Chat','model':'ChatInteraction','event':_0x9a50('0x9'),'condition':_0x9a50('0xa'),'callback':afterUpdate},{'channel':_0x9a50('0x5'),'model':_0x9a50('0xb'),'event':_0x9a50('0x7'),'condition':_0x9a50('0xc'),'callback':afterCreateMessage},{'channel':_0x9a50('0x5'),'model':_0x9a50('0xd'),'event':_0x9a50('0x7'),'condition':_0x9a50('0xc'),'callback':afterCreateOfflineMessage},{'channel':'Sms','model':_0x9a50('0xe'),'event':_0x9a50('0x7'),'condition':_0x9a50('0x8'),'callback':afterCreate},{'channel':_0x9a50('0xf'),'model':'SmsInteraction','event':_0x9a50('0x9'),'condition':_0x9a50('0xa'),'callback':afterUpdate},{'channel':_0x9a50('0xf'),'model':'SmsMessage','event':_0x9a50('0x7'),'condition':_0x9a50('0xc'),'callback':afterCreateMessage},{'channel':'Whatsapp','model':_0x9a50('0x10'),'event':'afterCreate','condition':_0x9a50('0x8'),'callback':afterCreate},{'channel':_0x9a50('0x11'),'model':_0x9a50('0x10'),'event':_0x9a50('0x9'),'condition':_0x9a50('0xa'),'callback':afterUpdate},{'channel':_0x9a50('0x11'),'model':_0x9a50('0x12'),'event':'afterCreate','condition':_0x9a50('0xc'),'callback':afterCreateMessage},{'channel':_0x9a50('0x13'),'model':_0x9a50('0x14'),'event':_0x9a50('0x7'),'condition':_0x9a50('0x8'),'callback':afterCreate},{'channel':'Fax','model':'FaxInteraction','event':'afterUpdate','condition':_0x9a50('0xa'),'callback':afterUpdate},{'channel':'Fax','model':'FaxMessage','event':_0x9a50('0x7'),'condition':_0x9a50('0xc'),'callback':afterCreateMessage},{'channel':_0x9a50('0x15'),'model':_0x9a50('0x16'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0x9a50('0x15'),'model':_0x9a50('0x16'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0x9a50('0x15'),'model':'MailMessage','event':_0x9a50('0x7'),'condition':_0x9a50('0xc'),'callback':afterCreateMessage},{'channel':_0x9a50('0x17'),'model':_0x9a50('0x18'),'event':_0x9a50('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x9a50('0x17'),'model':_0x9a50('0x18'),'event':'afterUpdate','condition':_0x9a50('0xa'),'callback':afterUpdate},{'channel':_0x9a50('0x17'),'model':_0x9a50('0x19'),'event':'afterCreate','condition':_0x9a50('0xc'),'callback':afterCreateMessage}];function request(_0x2f380c){return client['request'](_0x9a50('0x1a'),_0x2f380c)[_0x9a50('0x1b')](function(_0x152cf7){logger[_0x9a50('0x1c')](_0x9a50('0x1d'),'EventManager',_0x152cf7);if(_0x152cf7['error']){if(_0x152cf7['error'][_0x9a50('0x1e')]===0x1f4){logger[_0x9a50('0x1f')](_0x9a50('0x1d'),_0x9a50('0x1a'),_0x152cf7['error']);}}})['catch'](function(_0x156f27){logger[_0x9a50('0x1f')](_0x9a50('0x1d'),'EventManager',_0x156f27);});}function afterCreateMessage(_0x4457fc){return function(_0x423919){_0x423919=_0x423919[_0x9a50('0x20')]({'plain':!![]});_0x423919[_0x9a50('0x21')]=_0x4457fc;_0x423919[_0x9a50('0x22')]=_0x4457fc;_0x423919[_0x9a50('0x23')]=_0x423919[_0x9a50('0x24')];Promise['resolve']()[_0x9a50('0x1b')](function(){if(typeof _0x423919['ContactId']===_0x9a50('0x25'))return null;var _0x204a7d='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x423919[_0x9a50('0x26')];return db[_0x9a50('0x27')][_0x9a50('0x28')](_0x204a7d,{'type':db[_0x9a50('0x29')]['QueryTypes']['SELECT'],'raw':!![]});})['then'](function(_0x3b11b3){if(_0x3b11b3){_0x423919[_0x9a50('0x2a')]=_0x3b11b3[0x0];}if(typeof _0x423919['UserId']==='undefined')return;return getAgent(_0x423919['UserId']);})[_0x9a50('0x1b')](function(_0x4fb87f){if(_0x4fb87f){_0x423919[_0x9a50('0x2b')]=util[_0x9a50('0x2c')](_0x9a50('0x2d'),_0x4fb87f['name']);_0x423919[_0x9a50('0x2e')]=_0x4fb87f;_0x423919[_0x9a50('0x21')]=_0x4457fc;return request({'event':_0x9a50('0x2f'),'message':_0x423919});}else{return request({'event':_0x9a50('0x30'),'message':_0x423919});}})[_0x9a50('0x31')](function(_0x2d190b){logger['error'](_0x9a50('0x1d'),_0x9a50('0x32'),_0x2d190b);});};}function afterCreateOfflineMessage(_0x56ff16){return function(_0x2f152f){_0x2f152f=_0x2f152f[_0x9a50('0x20')]({'plain':!![]});_0x2f152f['channel']=_0x56ff16;_0x2f152f[_0x9a50('0x22')]=_0x56ff16;_0x2f152f[_0x9a50('0x23')]='offlineMessage';return request({'event':_0x2f152f[_0x9a50('0x23')],'message':_0x2f152f});};}function afterCreate(_0x385643,_0xffa60c){return function(_0x51c2f5){_0x51c2f5=_0x51c2f5['get']({'plain':!![]});_0x51c2f5['channel']=_0x385643;_0x51c2f5[_0x9a50('0x22')]=_0x385643;_0x51c2f5[_0x9a50('0x23')]=_0x9a50('0x33');Promise[_0x9a50('0x34')]()[_0x9a50('0x1b')](function(){var _0x534fd5=_0x9a50('0x35')+_0x51c2f5[_0x9a50('0x26')];return db[_0x9a50('0x27')]['query'](_0x534fd5,{'type':db[_0x9a50('0x29')][_0x9a50('0x36')]['SELECT'],'raw':!![]});})['then'](function(_0x16c45c){if(_0x16c45c){_0x51c2f5['contact']=_0x16c45c[0x0];}if(typeof _0x51c2f5[_0x9a50('0x37')]===_0x9a50('0x25'))return;return getAgent(_0x51c2f5['UserId']);})[_0x9a50('0x1b')](function(_0x4ec725){if(_0x4ec725){_0x51c2f5[_0x9a50('0x2b')]=util[_0x9a50('0x2c')]('SIP/%s',_0x4ec725[_0x9a50('0x38')]);_0x51c2f5[_0x9a50('0x2e')]=_0x4ec725;}return request({'event':_0xffa60c,'message':_0x51c2f5});})[_0x9a50('0x31')](function(_0x8a462f){logger[_0x9a50('0x1f')]('Trigger,\x20%s',_0x9a50('0x39'),_0x8a462f);});};}function afterUpdate(_0x215532){return function(_0x282087){var _0x3f9214=_0x282087[_0x9a50('0x3a')](_0x9a50('0x3b'))&&_0x282087[_0x9a50('0x3b')];var _0x3ece03=_0x282087[_0x9a50('0x3a')](_0x9a50('0x3c'));if(_0x3f9214||_0x3ece03){var _0xeeba2b=_0x3f9214?'closedinteraction':_0x9a50('0x3c');var _0x44d330=_0x282087[_0x9a50('0x20')]({'plain':!![]});_0x44d330[_0x9a50('0x21')]=_0x215532;_0x44d330[_0x9a50('0x22')]=_0x215532;_0x44d330['event']=_0x3f9214?_0x9a50('0x3b'):_0x9a50('0x3c');var _0x242808=_0x9a50('0x35')+_0x44d330[_0x9a50('0x26')];return db[_0x9a50('0x27')]['query'](_0x242808,{'type':db[_0x9a50('0x29')]['QueryTypes'][_0x9a50('0x3d')],'raw':!![]})[_0x9a50('0x1b')](function(_0x5b821e){if(_0x5b821e){_0x44d330[_0x9a50('0x2a')]=_0x5b821e[0x0];}if(typeof _0x44d330[_0x9a50('0x37')]===_0x9a50('0x25'))return;return getAgent(_0x44d330[_0x9a50('0x37')]);})[_0x9a50('0x1b')](function(_0x30b231){if(_0x30b231){_0x44d330[_0x9a50('0x2b')]=util[_0x9a50('0x2c')]('SIP/%s',_0x30b231['name']);_0x44d330[_0x9a50('0x2e')]=_0x30b231;}return request({'event':_0xeeba2b,'message':_0x44d330});})[_0x9a50('0x31')](function(_0x21707a){logger['error']('Trigger,\x20%s',_0x9a50('0x3e'),_0x21707a);});}};}function getAgent(_0x53408b){return db[_0x9a50('0x3f')][_0x9a50('0x40')]({'where':{'id':_0x53408b},'attributes':['id',_0x9a50('0x38'),_0x9a50('0x41'),'email',_0x9a50('0x42')],'raw':!![]})['then'](function(_0x23bc88){return _0x23bc88;});}exports[_0x9a50('0x43')]=function(){for(var _0x1992f4=0x0;_0x1992f4=_0x4e05f7[_0x5b6f('0x15')]){throw Error(_0x5b6f('0x16'));}_0x51c23f(_0x354da3);})[_0x5b6f('0x17')](function(_0x47857b){_0x4c0186(_0x47857b);});});}; \ No newline at end of file +var _0x62f6=['getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','lodash','bluebird','voice','mail','chat','fax','sms','whatsapp','openchannel','isValidChannel','includes','isUndefined','updateAttributes','User','count','agent','then'];(function(_0x3712ce,_0x33d4f5){var _0x47cf63=function(_0x16c1fa){while(--_0x16c1fa){_0x3712ce['push'](_0x3712ce['shift']());}};_0x47cf63(++_0x33d4f5);}(_0x62f6,0x1bb));var _0x662f=function(_0x187756,_0x5dda6a){_0x187756=_0x187756-0x0;var _0x5833ad=_0x62f6[_0x187756];return _0x5833ad;};'use strict';var _=require(_0x662f('0x0'));var BPromise=require(_0x662f('0x1'));var db=require('../mysqldb')['db'];var util=require('./license/util');var channels=[_0x662f('0x2'),_0x662f('0x3'),_0x662f('0x4'),_0x662f('0x5'),_0x662f('0x6'),_0x662f('0x7'),_0x662f('0x8')];exports['getChannels']=function(){return channels;};exports[_0x662f('0x9')]=function(_0x507e3d){_0x507e3d=_0x507e3d['toLowerCase']();return _[_0x662f('0xa')](channels,_0x507e3d);};exports['clearBlockUser']=function(_0x11b5c9,_0x388564,_0x1c1c99,_0x520731){var _0x54fac4={'loginAttempts':_0x388564,'blocked':_0x1c1c99};if(!_[_0x662f('0xb')](_0x520731)){_0x54fac4['blockedAt']=_0x520731;}return _0x11b5c9[_0x662f('0xc')](_0x54fac4);};exports['getLicense']=function(_0x52445d){return new BPromise(function(_0x3cd081,_0x5a8a9f){var _0xa55cac=0x0;if(_0x52445d['role']!=='agent'){_0x3cd081(_0x52445d);}db[_0x662f('0xd')][_0x662f('0xe')]({'where':{'role':_0x662f('0xf'),'online':!![],'id':{'$ne':_0x52445d['id']}}})[_0x662f('0x10')](function(_0x52fc89){_0xa55cac=_0x52fc89;return util[_0x662f('0x11')]();})[_0x662f('0x10')](function(_0x489219){if(_0x489219&&_0x489219[_0x662f('0x12')]&&_0xa55cac>=_0x489219[_0x662f('0x12')]){throw Error(_0x662f('0x13'));}_0x3cd081(_0x52445d);})['catch'](function(_0x55f48f){_0x5a8a9f(_0x55f48f);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 9535da2..d9cb1a7 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2580=['exports','404','status','render','json','send'];(function(_0x11a890,_0x59b390){var _0x220a4c=function(_0x2ada9e){while(--_0x2ada9e){_0x11a890['push'](_0x11a890['shift']());}};_0x220a4c(++_0x59b390);}(_0x2580,0x156));var _0x0258=function(_0x298edf,_0x3e4586){_0x298edf=_0x298edf-0x0;var _0x2355cf=_0x2580[_0x298edf];return _0x2355cf;};'use strict';module[_0x0258('0x0')][0x194]=function pageNotFound(_0x950d2b,_0x349e3d){var _0x507b75=_0x0258('0x1');var _0x3dfee2=0x194;var _0x4ab711={'status':_0x3dfee2};_0x349e3d[_0x0258('0x2')](_0x4ab711[_0x0258('0x2')]);_0x349e3d[_0x0258('0x3')](_0x507b75,{},function(_0x2dd993,_0x3a35d6){if(_0x2dd993){return _0x349e3d[_0x0258('0x2')](_0x4ab711[_0x0258('0x2')])[_0x0258('0x4')](_0x4ab711);}_0x349e3d[_0x0258('0x5')](_0x3a35d6);});}; \ No newline at end of file +var _0x6a14=['status','render','json','send','exports','404'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6a14,0x13c));var _0x46a1=function(_0x6d62c2,_0x4c6379){_0x6d62c2=_0x6d62c2-0x0;var _0x44b5b4=_0x6a14[_0x6d62c2];return _0x44b5b4;};'use strict';module[_0x46a1('0x0')][0x194]=function pageNotFound(_0x28a64f,_0x46fc93){var _0x3cec1e=_0x46a1('0x1');var _0x5035aa=0x194;var _0x2430bb={'status':_0x5035aa};_0x46fc93[_0x46a1('0x2')](_0x2430bb[_0x46a1('0x2')]);_0x46fc93[_0x46a1('0x3')](_0x3cec1e,{},function(_0x27f79b,_0x88c193){if(_0x27f79b){return _0x46fc93['status'](_0x2430bb['status'])[_0x46a1('0x4')](_0x2430bb);}_0x46fc93[_0x46a1('0x5')](_0x88c193);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 1b79a5b..a2b1316 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbe80=['ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','ChatMessage','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','../api/variable/variable.model','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','VtigerConfiguration','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','Integration','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','../api/chatInternalMessage/chatInternalMessage.model','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','SquareProject','../api/squareProject/squareProject.model','SquareRecording','SquareMessage','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfileSection','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','User','hasOne','UserId','userSetting','cascade','hasMany','Recordings','VoiceQueuesRt','Extensions','HopperHistory','ChatInteractions','SmsInteraction','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteraction','WhatsappInteractions','UserProfile','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','OpenchannelInteractions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','MailQueues','ChatQueue','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueue','UserOpenchannelQueue','WhatsappQueue','WhatsappQueues','ChatWebsite','ChatWebsites','user_has_chat_websites','FaxAccount','FaxAccounts','MailAccount','MailAccounts','user_has_mail_accounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccount','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','SpiedAgents','Applications','Sounds','Members','VoiceQueueId','Hoppers','HopperFinals','HopperHistories','HopperBlacks','JscriptySessions','belongsTo','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','mailboxuser','uniqueid','AgentReports','ContactId','MailServerIn','MailAccountId','CloudProviderId','Imap','Disposition','Dispositions','MailMessage','ListId','Agents','team_has_mail_queues','MailInteractionId','Account','mail_interaction_has_tags','ThroughTags','Users','user_has_mail_interactions','Attachments','Interaction','ChatWebsiteId','restrict','List','Contact','Items','FaxAccountId','FaxApplication','Exntensions','user_has_fax_accounts','TagId','FaxInteractionId','Tags','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','Interactions','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','Answers','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','Agent','Queue','Website','ChatInteractionId','chat_interaction_has_tags','ChatOfflineMessageId','ChatInternalMessage','ChatGroupId','CompanyId','Company','cm_contact_has_tags','CampaignId','Owner','OwnerId','All','OneAll','AutomationAllId','Any','OneAny','Actions','ParentId','Intervals','MailApplications','SmsApplications','DefaultReportId','AnalyticCustomReport','VoiceMusicOnHold','Mohs','moh_has_sounds','whatsapp_interaction_has_tags','AllCondition','AnyConditions','AnyCondition','TriggerId','Fields','CustomReportId','MetricId','Configurations','SubjectId','Descriptions','FieldId','Subject','Description','Field','Variable','VariableId','AccountId','Subjects','DescriptionId','ZohoConfiguration','ZendeskAccount','FreshdeskConfiguration','FreshdeskField','int_freshdesk_configuration_has_tags','ServicenowField','Dynamics365Field','FreshsalesField','FromId','ToId','JscriptyQuestionReport','SessionId','JscriptyAnswerReport','SmsQueueReport','JscriptyProject','ProjectId','team_has_chat_queues','OpenchannelQueues','team_has_whatsapp_queues','TeamVoicePrefix','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromAccount','FromAgent','ToUserId','ToAgent','ToAccount','FromChatWebsiteId','FromUserId','FromFaxAccountId','ToFaxQueueId','ToQueue','ToFaxAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','SmsTransferReport','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','voice_queues_has_cm_lists','userProfileId','UserProfileResource','sectionId','WhatsappAccountId','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','user','Smtp','../config/environment','sequelize','lodash','determine','motion2','xcall','xC@LL1234','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','defaultsDeep','127.0.0.1','database','username','password','options','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','UserVoiceQueue','UserChatQueue','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','../api/mailMessage/mailMessage.model','MailApplication','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','FaxQueueReport','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsInteraction/smsInteraction.model','SmsMessage','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model'];(function(_0x2af235,_0x1df5cd){var _0x165850=function(_0x3c9540){while(--_0x3c9540){_0x2af235['push'](_0x2af235['shift']());}};_0x165850(++_0x1df5cd);}(_0xbe80,0x194));var _0x0be8=function(_0x1c09aa,_0x5e3cc8){_0x1c09aa=_0x1c09aa-0x0;var _0x45fc9c=_0xbe80[_0x1c09aa];return _0x45fc9c;};'use strict';var config=require(_0x0be8('0x0'));var Sequelize=require(_0x0be8('0x1'));var _=require(_0x0be8('0x2'));var jstz=require('jstz');var timezone=jstz[_0x0be8('0x3')]();config[_0x0be8('0x1')]=_['defaultsDeep'](config[_0x0be8('0x1')],{'database':_0x0be8('0x4'),'username':_0x0be8('0x5'),'password':_0x0be8('0x6'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x0be8('0x7'),'dialectOptions':{'charset':_0x0be8('0x8')},'logging':![],'timezone':timezone[_0x0be8('0x9')](),'define':{'charset':_0x0be8('0xa'),'collate':_0x0be8('0xb')}}});config[_0x0be8('0xc')]=_[_0x0be8('0xd')](config[_0x0be8('0xc')],{'database':_0x0be8('0x4'),'username':'xcall','password':_0x0be8('0x6'),'options':{'host':_0x0be8('0xe'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x0be8('0x9')](),'define':{'charset':_0x0be8('0xa'),'collate':_0x0be8('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x0be8('0x1')][_0x0be8('0xf')],config[_0x0be8('0x1')][_0x0be8('0x10')],config[_0x0be8('0x1')][_0x0be8('0x11')],config['sequelize'][_0x0be8('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x0be8('0xc')][_0x0be8('0xf')],config[_0x0be8('0xc')][_0x0be8('0x10')],config[_0x0be8('0xc')][_0x0be8('0x11')],config[_0x0be8('0xc')][_0x0be8('0x12')])};db['User']=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0x14'));db[_0x0be8('0x15')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0x16'));db[_0x0be8('0x17')]=db['sequelize'][_0x0be8('0x13')](_0x0be8('0x18'));db[_0x0be8('0x19')]=db[_0x0be8('0x1')][_0x0be8('0x13')]('../api/voiceExtension/voiceExtension.model');db['VoiceMusicOnHold']=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0x1a'));db[_0x0be8('0x1b')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0x1c'));db[_0x0be8('0x1d')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0x1e'));db[_0x0be8('0x1f')]=db['sequelize']['import'](_0x0be8('0x20'));db[_0x0be8('0x21')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0x22'));db[_0x0be8('0x23')]=db['sequelize'][_0x0be8('0x13')](_0x0be8('0x24'));db[_0x0be8('0x25')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0x26'));db[_0x0be8('0x27')]=db[_0x0be8('0x1')]['import'](_0x0be8('0x28'));db[_0x0be8('0x29')]=db['sequelize']['import'](_0x0be8('0x2a'));db[_0x0be8('0x2b')]=db['sequelize']['import'](_0x0be8('0x2c'));db[_0x0be8('0x2d')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0x2e'));db[_0x0be8('0x2f')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0x30'));db[_0x0be8('0x31')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0x32'));db[_0x0be8('0x33')]=db[_0x0be8('0x1')][_0x0be8('0x13')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0x0be8('0x34')]=db['sequelize']['import']('../api/userVoiceQueue/userVoiceQueue.model');db[_0x0be8('0x35')]=db[_0x0be8('0x1')][_0x0be8('0x13')]('../api/userChatQueue/userChatQueue.model');db[_0x0be8('0x36')]=db['sequelize'][_0x0be8('0x13')](_0x0be8('0x37'));db[_0x0be8('0x38')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0x39'));db[_0x0be8('0x3a')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0x3b'));db['UserOpenchannelQueue']=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0x3c'));db[_0x0be8('0x3d')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0x3e'));db['MailServerIn']=db[_0x0be8('0x1')]['import'](_0x0be8('0x3f'));db[_0x0be8('0x40')]=db['sequelize']['import'](_0x0be8('0x41'));db['MailAccount']=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0x42'));db[_0x0be8('0x43')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0x44'));db[_0x0be8('0x45')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0x46'));db[_0x0be8('0x47')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0x48'));db['MailMessage']=db[_0x0be8('0x1')]['import'](_0x0be8('0x49'));db[_0x0be8('0x4a')]=db[_0x0be8('0x1')]['import']('../api/mailApplication/mailApplication.model');db[_0x0be8('0x4b')]=db['sequelize'][_0x0be8('0x13')](_0x0be8('0x4c'));db[_0x0be8('0x4d')]=db['sequelize'][_0x0be8('0x13')]('../api/dashboard/dashboard.model');db[_0x0be8('0x4e')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0x4f'));db['FaxAccount']=db['sequelize']['import']('../api/faxAccount/faxAccount.model');db['FaxApplication']=db[_0x0be8('0x1')][_0x0be8('0x13')]('../api/faxApplication/faxApplication.model');db[_0x0be8('0x50')]=db['sequelize'][_0x0be8('0x13')](_0x0be8('0x51'));db[_0x0be8('0x52')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0x53'));db[_0x0be8('0x54')]=db['sequelize'][_0x0be8('0x13')]('../api/faxQueue/faxQueue.model');db[_0x0be8('0x55')]=db[_0x0be8('0x1')]['import']('../api/faxQueueReport/faxQueueReport.model');db[_0x0be8('0x56')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0x57'));db[_0x0be8('0x58')]=db['sequelize'][_0x0be8('0x13')]('../api/smsApplication/smsApplication.model');db['SmsInteraction']=db[_0x0be8('0x1')]['import'](_0x0be8('0x59'));db[_0x0be8('0x5a')]=db[_0x0be8('0x1')][_0x0be8('0x13')]('../api/smsMessage/smsMessage.model');db[_0x0be8('0x5b')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0x5c'));db[_0x0be8('0x5d')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0x5e'));db[_0x0be8('0x5f')]=db['sequelize'][_0x0be8('0x13')](_0x0be8('0x60'));db[_0x0be8('0x61')]=db[_0x0be8('0x1')]['import']('../api/openchannelInteraction/openchannelInteraction.model');db[_0x0be8('0x62')]=db['sequelize'][_0x0be8('0x13')](_0x0be8('0x63'));db['OpenchannelQueue']=db['sequelize']['import']('../api/openchannelQueue/openchannelQueue.model');db['ChatWebsite']=db['sequelize'][_0x0be8('0x13')]('../api/chatWebsite/chatWebsite.model');db[_0x0be8('0x64')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0x65'));db[_0x0be8('0x66')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0x67'));db[_0x0be8('0x68')]=db[_0x0be8('0x1')]['import']('../api/chatInteraction/chatInteraction.model');db[_0x0be8('0x69')]=db[_0x0be8('0x1')][_0x0be8('0x13')]('../api/chatMessage/chatMessage.model');db[_0x0be8('0x6a')]=db[_0x0be8('0x1')]['import'](_0x0be8('0x6b'));db['ChatQueue']=db['sequelize']['import'](_0x0be8('0x6c'));db[_0x0be8('0x6d')]=db[_0x0be8('0x1')]['import'](_0x0be8('0x6e'));db[_0x0be8('0x6f')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0x70'));db[_0x0be8('0x71')]=db[_0x0be8('0x1')]['import']('../api/cmCompany/cmCompany.model');db[_0x0be8('0x72')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0x73'));db[_0x0be8('0x74')]=db['sequelize'][_0x0be8('0x13')](_0x0be8('0x75'));db[_0x0be8('0x76')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0x77'));db[_0x0be8('0x78')]=db[_0x0be8('0x1')][_0x0be8('0x13')]('../api/cmHopperFinal/cmHopperFinal.model');db[_0x0be8('0x79')]=db['sequelize'][_0x0be8('0x13')](_0x0be8('0x7a'));db[_0x0be8('0x7b')]=db['sequelize']['import'](_0x0be8('0x7c'));db[_0x0be8('0x7d')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0x7e'));db[_0x0be8('0x7f')]=db[_0x0be8('0x1')][_0x0be8('0x13')]('../api/action/action.model');db[_0x0be8('0x80')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0x81'));db[_0x0be8('0x82')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0x83'));db['Disposition']=db[_0x0be8('0x1')]['import'](_0x0be8('0x84'));db[_0x0be8('0x85')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0x86'));db[_0x0be8('0x87')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0x88'));db[_0x0be8('0x89')]=db['sequelize'][_0x0be8('0x13')](_0x0be8('0x8a'));db['Cdr']=db[_0x0be8('0x1')]['import'](_0x0be8('0x8b'));db[_0x0be8('0x8c')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0x8d'));db[_0x0be8('0x8e')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0x8f'));db[_0x0be8('0x90')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0x91'));db[_0x0be8('0x92')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0x93'));db[_0x0be8('0x94')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0x95'));db[_0x0be8('0x96')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0x97'));db['Variable']=db['sequelize'][_0x0be8('0x13')](_0x0be8('0x98'));db['Integration']=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0x99'));db[_0x0be8('0x9a')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0x9b'));db['AnalyticCustomReport']=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0x9c'));db[_0x0be8('0x9d')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0x9e'));db[_0x0be8('0x9f')]=db[_0x0be8('0x1')][_0x0be8('0x13')]('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0x0be8('0xa0')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0xa1'));db[_0x0be8('0xa2')]=db['sequelize'][_0x0be8('0x13')](_0x0be8('0xa3'));db[_0x0be8('0xa4')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0xa5'));db[_0x0be8('0xa6')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0xa7'));db[_0x0be8('0xa8')]=db[_0x0be8('0x1')]['import'](_0x0be8('0xa9'));db[_0x0be8('0xaa')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0xab'));db[_0x0be8('0xac')]=db['sequelize'][_0x0be8('0x13')](_0x0be8('0xad'));db[_0x0be8('0xae')]=db['sequelize'][_0x0be8('0x13')](_0x0be8('0xaf'));db[_0x0be8('0xb0')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0xb1'));db[_0x0be8('0xb2')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0xb3'));db[_0x0be8('0xb4')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0xb5'));db[_0x0be8('0xb6')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0xb7'));db[_0x0be8('0xb8')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0xb9'));db['ZohoConfiguration']=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0xba'));db[_0x0be8('0xbb')]=db[_0x0be8('0x1')][_0x0be8('0x13')]('../api/intZohoField/intZohoField.model');db['ZendeskAccount']=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0xbc'));db[_0x0be8('0xbd')]=db[_0x0be8('0x1')]['import'](_0x0be8('0xbe'));db[_0x0be8('0xbf')]=db['sequelize'][_0x0be8('0x13')](_0x0be8('0xc0'));db[_0x0be8('0xc1')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0xc2'));db['FreshdeskConfiguration']=db[_0x0be8('0x1')]['import'](_0x0be8('0xc3'));db['FreshdeskField']=db['sequelize']['import'](_0x0be8('0xc4'));db[_0x0be8('0xc5')]=db[_0x0be8('0x1')]['import']('../api/intVtigerAccount/intVtigerAccount.model');db[_0x0be8('0xc6')]=db[_0x0be8('0x1')][_0x0be8('0x13')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x0be8('0xc7')]=db[_0x0be8('0x1')]['import'](_0x0be8('0xc8'));db[_0x0be8('0xc9')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0xca'));db[_0x0be8('0xcb')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0xcc'));db['ServicenowField']=db[_0x0be8('0x1')]['import']('../api/intServicenowField/intServicenowField.model');db[_0x0be8('0xcd')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0xce'));db[_0x0be8('0xcf')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0xd0'));db['Dynamics365Field']=db[_0x0be8('0x1')]['import'](_0x0be8('0xd1'));db[_0x0be8('0xd2')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0xd3'));db[_0x0be8('0xd4')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0xd5'));db['FreshsalesField']=db['sequelize'][_0x0be8('0x13')]('../api/intFreshsalesField/intFreshsalesField.model');db[_0x0be8('0xd6')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0x99'));db['Network']=db['sequelize'][_0x0be8('0x13')](_0x0be8('0xd7'));db[_0x0be8('0xd8')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0xd9'));db['ChatInternalMessage']=db['sequelize']['import'](_0x0be8('0xda'));db['JscriptyAnswerReport']=db[_0x0be8('0x1')]['import'](_0x0be8('0xdb'));db['JscriptyQuestionReport']=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0xdc'));db[_0x0be8('0xdd')]=db[_0x0be8('0x1')]['import'](_0x0be8('0xde'));db['SmsQueueReport']=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0xdf'));db['SquareReport']=db['sequelize'][_0x0be8('0x13')](_0x0be8('0xe0'));db['SquareDetailsReport']=db[_0x0be8('0x1')]['import'](_0x0be8('0xe1'));db['JscriptyProject']=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0xe2'));db[_0x0be8('0xe3')]=db['sequelize']['import']('../api/setting/setting.model');db['SquareOdbc']=db[_0x0be8('0x1')][_0x0be8('0x13')]('../api/squareOdbc/squareOdbc.model');db[_0x0be8('0xe4')]=db['sequelize'][_0x0be8('0x13')](_0x0be8('0xe5'));db[_0x0be8('0xe6')]=db['sequelize'][_0x0be8('0x13')]('../api/squareRecording/squareRecording.model');db[_0x0be8('0xe7')]=db[_0x0be8('0x1')]['import']('../api/squareMessage/squareMessage.model');db[_0x0be8('0xe8')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0xe9'));db[_0x0be8('0xea')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0xeb'));db[_0x0be8('0xec')]=db[_0x0be8('0x1')]['import'](_0x0be8('0xed'));db[_0x0be8('0xee')]=db[_0x0be8('0x1')][_0x0be8('0x13')]('../api/migration/migration.model');db[_0x0be8('0xef')]=db['sequelize'][_0x0be8('0x13')](_0x0be8('0xf0'));db[_0x0be8('0xf1')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0xf2'));db[_0x0be8('0xf3')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0xf4'));db[_0x0be8('0xf5')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0xf6'));db[_0x0be8('0xf7')]=db[_0x0be8('0x1')][_0x0be8('0x13')]('../api/faxTransferReport/faxTransferReport.model');db[_0x0be8('0xf8')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0xf9'));db['SmsTransferReport']=db['sequelize'][_0x0be8('0x13')](_0x0be8('0xfa'));db[_0x0be8('0xfb')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0xfc'));db[_0x0be8('0xfd')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0xfe'));db['UserProfile']=db[_0x0be8('0x1')][_0x0be8('0x13')]('../api/userProfile/userProfile.model');db[_0x0be8('0xff')]=db['sequelize'][_0x0be8('0x13')]('../api/userProfileSection/userProfileSection.model');db['UserProfileResource']=db['sequelize'][_0x0be8('0x13')](_0x0be8('0x100'));db[_0x0be8('0x101')]=db[_0x0be8('0x1')][_0x0be8('0x13')](_0x0be8('0x102'));db['WhatsappAccount']=db[_0x0be8('0x1')][_0x0be8('0x13')]('../api/whatsappAccount/whatsappAccount.model');db[_0x0be8('0x103')]=db[_0x0be8('0x1')]['import'](_0x0be8('0x104'));db['WhatsappInteraction']=db[_0x0be8('0x1')]['import'](_0x0be8('0x105'));db[_0x0be8('0x106')]=db['sequelize'][_0x0be8('0x13')](_0x0be8('0x107'));db[_0x0be8('0x108')]=db[_0x0be8('0x1')]['import'](_0x0be8('0x109'));db[_0x0be8('0x10a')]=db['sequelize'][_0x0be8('0x13')]('../api/whatsappTransferReport/whatsappTransferReport.model');db['WhatsappQueue']=db['sequelize'][_0x0be8('0x13')](_0x0be8('0x10b'));db[_0x0be8('0x10c')]=db['sequelize']['import'](_0x0be8('0x10d'));db[_0x0be8('0x10e')]=db['sequelize'][_0x0be8('0x13')]('../api/teamVoiceQueue/teamVoiceQueue.model');db['TeamVoicePrefix']=db['sequelize'][_0x0be8('0x13')](_0x0be8('0x10f'));db[_0x0be8('0x110')]=db['sequelize'][_0x0be8('0x13')](_0x0be8('0x111'));db[_0x0be8('0x112')]=db[_0x0be8('0x1')]['import'](_0x0be8('0x113'));db[_0x0be8('0x114')][_0x0be8('0x115')](db[_0x0be8('0x21')],{'as':_0x0be8('0x21'),'onDelete':'cascade','foreignKey':_0x0be8('0x116')});db[_0x0be8('0x114')][_0x0be8('0x115')](db['UserSetting'],{'as':_0x0be8('0x117'),'onDelete':_0x0be8('0x118'),'foreignKey':_0x0be8('0x116')});db[_0x0be8('0x114')][_0x0be8('0x119')](db[_0x0be8('0x1d')],{'as':_0x0be8('0x11a'),'foreignKey':_0x0be8('0x116')});db[_0x0be8('0x114')][_0x0be8('0x119')](db[_0x0be8('0x33')],{'as':_0x0be8('0x11b'),'foreignKey':_0x0be8('0x116')});db['User']['hasMany'](db[_0x0be8('0x19')],{'as':_0x0be8('0x11c'),'onDelete':_0x0be8('0x118'),'hooks':!![]});db[_0x0be8('0x114')][_0x0be8('0x119')](db[_0x0be8('0x78')],{'as':'HopperFinals','foreignKey':_0x0be8('0x116')});db[_0x0be8('0x114')][_0x0be8('0x119')](db[_0x0be8('0x79')],{'as':_0x0be8('0x11d'),'foreignKey':_0x0be8('0x116')});db[_0x0be8('0x114')]['hasMany'](db[_0x0be8('0x7b')],{'as':_0x0be8('0x7b'),'foreignKey':'UserId'});db[_0x0be8('0x114')]['hasMany'](db[_0x0be8('0x61')],{'as':'OpenchannelInteractions','foreignKey':'UserId'});db[_0x0be8('0x114')][_0x0be8('0x119')](db[_0x0be8('0x68')],{'as':_0x0be8('0x11e'),'foreignKey':'UserId'});db['User'][_0x0be8('0x119')](db[_0x0be8('0x11f')],{'as':_0x0be8('0x120'),'foreignKey':_0x0be8('0x116')});db[_0x0be8('0x114')][_0x0be8('0x119')](db['FaxInteraction'],{'as':_0x0be8('0x121'),'foreignKey':_0x0be8('0x116')});db[_0x0be8('0x114')][_0x0be8('0x119')](db[_0x0be8('0x47')],{'as':_0x0be8('0x122'),'foreignKey':_0x0be8('0x116')});db[_0x0be8('0x114')][_0x0be8('0x119')](db[_0x0be8('0x123')],{'as':_0x0be8('0x124'),'foreignKey':'UserId'});db[_0x0be8('0x114')]['hasMany'](db[_0x0be8('0x101')],{'as':'UserNotifications','foreignKey':'SenderId'});db[_0x0be8('0x114')]['belongsTo'](db[_0x0be8('0x125')],{'as':'UserProfile','foreignKey':'userProfileId'});db[_0x0be8('0x114')][_0x0be8('0x126')](db[_0x0be8('0x6d')],{'as':_0x0be8('0x127'),'through':_0x0be8('0x128')});db[_0x0be8('0x114')][_0x0be8('0x126')](db['CmContact'],{'as':_0x0be8('0x129'),'through':_0x0be8('0x12a')});db[_0x0be8('0x114')][_0x0be8('0x126')](db['CmList'],{'as':_0x0be8('0x12b'),'through':_0x0be8('0x12c')});db[_0x0be8('0x114')]['belongsToMany'](db[_0x0be8('0xe8')],{'through':_0x0be8('0x12d')});db[_0x0be8('0x114')]['belongsToMany'](db['MailInteraction'],{'as':_0x0be8('0x122'),'through':'user_has_mail_interactions'});db['User'][_0x0be8('0x126')](db[_0x0be8('0x68')],{'as':'ChatInteractions','through':_0x0be8('0x12e')});db['User'][_0x0be8('0x126')](db[_0x0be8('0x50')],{'as':_0x0be8('0x121'),'through':_0x0be8('0x12f')});db[_0x0be8('0x114')][_0x0be8('0x126')](db['SmsInteraction'],{'as':'SmsInteractions','through':_0x0be8('0x130')});db[_0x0be8('0x114')][_0x0be8('0x126')](db[_0x0be8('0x61')],{'as':_0x0be8('0x131'),'through':_0x0be8('0x132')});db[_0x0be8('0x114')][_0x0be8('0x126')](db['WhatsappInteraction'],{'as':_0x0be8('0x124'),'through':_0x0be8('0x133')});db[_0x0be8('0x114')][_0x0be8('0x126')](db[_0x0be8('0x1b')],{'as':_0x0be8('0x134'),'through':'UserVoiceQueue','required':![]});db[_0x0be8('0x114')]['belongsToMany'](db['VoicePrefix'],{'as':_0x0be8('0x135'),'through':_0x0be8('0x110'),'required':![]});db[_0x0be8('0x114')][_0x0be8('0x126')](db['MailQueue'],{'as':_0x0be8('0x136'),'through':_0x0be8('0x36'),'required':![]});db[_0x0be8('0x114')][_0x0be8('0x126')](db[_0x0be8('0x137')],{'as':_0x0be8('0x138'),'through':_0x0be8('0x35'),'required':![],'hooks':!![]});db[_0x0be8('0x114')][_0x0be8('0x126')](db[_0x0be8('0x54')],{'as':_0x0be8('0x139'),'through':_0x0be8('0x38'),'required':![]});db[_0x0be8('0x114')][_0x0be8('0x126')](db[_0x0be8('0x5b')],{'as':_0x0be8('0x13a'),'through':_0x0be8('0x3a'),'required':![]});db[_0x0be8('0x114')]['belongsToMany'](db[_0x0be8('0x13b')],{'as':'OpenchannelQueues','through':_0x0be8('0x13c'),'required':![]});db['User'][_0x0be8('0x126')](db[_0x0be8('0x13d')],{'as':_0x0be8('0x13e'),'through':_0x0be8('0x3d'),'required':![]});db['User']['belongsToMany'](db[_0x0be8('0xfb')],{'through':_0x0be8('0x12c')});db[_0x0be8('0x114')]['belongsToMany'](db[_0x0be8('0x13f')],{'as':_0x0be8('0x140'),'through':_0x0be8('0x141')});db[_0x0be8('0x114')][_0x0be8('0x126')](db[_0x0be8('0x142')],{'as':_0x0be8('0x143'),'through':'user_has_fax_accounts'});db[_0x0be8('0x114')][_0x0be8('0x126')](db[_0x0be8('0x144')],{'as':_0x0be8('0x145'),'through':_0x0be8('0x146')});db[_0x0be8('0x114')][_0x0be8('0x126')](db[_0x0be8('0x5d')],{'as':'OpenchannelAccounts','through':_0x0be8('0x147')});db[_0x0be8('0x114')][_0x0be8('0x126')](db[_0x0be8('0x56')],{'as':_0x0be8('0x148'),'through':_0x0be8('0x149')});db['User'][_0x0be8('0x126')](db[_0x0be8('0x14a')],{'as':_0x0be8('0x14b'),'through':_0x0be8('0x14c')});db[_0x0be8('0x114')][_0x0be8('0x126')](db['SquareProject'],{'as':_0x0be8('0x14d'),'through':'user_has_square_projects'});db[_0x0be8('0x15')]['hasMany'](db['VoiceExtension'],{'as':_0x0be8('0x14e'),'onDelete':_0x0be8('0x118'),'foreignKey':'ChanSpyId'});db[_0x0be8('0x17')]['hasMany'](db[_0x0be8('0x19')],{'onDelete':_0x0be8('0x118')});db[_0x0be8('0x19')][_0x0be8('0x119')](db['VoiceExtension'],{'as':_0x0be8('0x14f'),'onDelete':_0x0be8('0x118')});db['VoiceMusicOnHold'][_0x0be8('0x126')](db['Sound'],{'as':_0x0be8('0x150'),'through':'moh_has_sounds'});db[_0x0be8('0x1b')]['hasMany'](db['UserVoiceQueueRt'],{'as':_0x0be8('0x151'),'foreignKey':_0x0be8('0x152')});db[_0x0be8('0x1b')][_0x0be8('0x119')](db[_0x0be8('0x74')],{'as':_0x0be8('0x153'),'foreignKey':_0x0be8('0x152')});db[_0x0be8('0x1b')][_0x0be8('0x119')](db[_0x0be8('0x78')],{'as':_0x0be8('0x154'),'foreignKey':'VoiceQueueId'});db[_0x0be8('0x1b')][_0x0be8('0x119')](db[_0x0be8('0x79')],{'as':_0x0be8('0x155'),'foreignKey':'VoiceQueueId'});db[_0x0be8('0x1b')][_0x0be8('0x119')](db[_0x0be8('0x7b')],{'as':_0x0be8('0x7b'),'foreignKey':_0x0be8('0x152')});db[_0x0be8('0x1b')][_0x0be8('0x119')](db[_0x0be8('0x76')],{'as':_0x0be8('0x156'),'foreignKey':_0x0be8('0x152')});db[_0x0be8('0x1b')][_0x0be8('0x119')](db[_0x0be8('0xdd')],{'as':_0x0be8('0x157'),'foreignKey':_0x0be8('0x152')});db[_0x0be8('0x1b')][_0x0be8('0x158')](db[_0x0be8('0x2f')],{'as':_0x0be8('0x2f'),'foreignKey':_0x0be8('0x159')});db[_0x0be8('0x1b')][_0x0be8('0x158')](db[_0x0be8('0x2f')],{'as':_0x0be8('0x15a'),'foreignKey':_0x0be8('0x15b')});db[_0x0be8('0x1b')][_0x0be8('0x158')](db[_0x0be8('0x87')],{'as':'Interval','foreignKey':_0x0be8('0x15c')});db['VoiceQueue'][_0x0be8('0x158')](db[_0x0be8('0x89')],{'as':_0x0be8('0x15d'),'foreignKey':_0x0be8('0x15e')});db[_0x0be8('0x1b')][_0x0be8('0x126')](db[_0x0be8('0xfb')],{'as':_0x0be8('0x12b'),'through':'voice_queues_has_cm_lists'});db[_0x0be8('0x1b')][_0x0be8('0x126')](db[_0x0be8('0x114')],{'as':'Agents','through':_0x0be8('0x34')});db[_0x0be8('0x1b')]['belongsToMany'](db[_0x0be8('0xe8')],{'as':_0x0be8('0x15f'),'through':_0x0be8('0x10e')});db[_0x0be8('0x1b')]['belongsToMany'](db['CmList'],{'as':_0x0be8('0x160'),'through':_0x0be8('0x161')});db[_0x0be8('0x1d')][_0x0be8('0x158')](db[_0x0be8('0x114')],{'as':_0x0be8('0x114'),'foreignKey':_0x0be8('0x116')});db[_0x0be8('0x1f')][_0x0be8('0x158')](db[_0x0be8('0x114')],{'as':_0x0be8('0x114'),'foreignKey':_0x0be8('0x116')});db[_0x0be8('0x21')][_0x0be8('0x119')](db[_0x0be8('0x23')],{'as':_0x0be8('0x162'),'onDelete':'cascade','foreignKey':'mailboxuser','sourceKey':_0x0be8('0x163')});db['VoiceMailMessage'][_0x0be8('0x158')](db[_0x0be8('0x21')],{'foreignKey':_0x0be8('0x164'),'targetKey':_0x0be8('0x163')});db[_0x0be8('0x25')][_0x0be8('0x119')](db[_0x0be8('0x2b')],{'as':'QueueCalls','foreignKey':_0x0be8('0x165'),'constraints':![]});db[_0x0be8('0x25')][_0x0be8('0x119')](db[_0x0be8('0x29')],{'as':_0x0be8('0x166'),'foreignKey':_0x0be8('0x165'),'constraints':![]});db[_0x0be8('0x25')]['belongsTo'](db[_0x0be8('0x114')],{'as':'User','foreignKey':_0x0be8('0x116')});db[_0x0be8('0x25')][_0x0be8('0x158')](db[_0x0be8('0x72')],{'as':'Contact','foreignKey':_0x0be8('0x167')});db[_0x0be8('0x168')][_0x0be8('0x158')](db[_0x0be8('0x144')],{'as':'MailAccount','foreignKey':_0x0be8('0x169')});db[_0x0be8('0x168')][_0x0be8('0x158')](db[_0x0be8('0x10c')],{'as':_0x0be8('0x10c'),'foreignKey':_0x0be8('0x16a'),'onDelete':'restrict'});db[_0x0be8('0x40')][_0x0be8('0x158')](db['MailAccount'],{'as':_0x0be8('0x144'),'foreignKey':_0x0be8('0x169')});db[_0x0be8('0x40')][_0x0be8('0x158')](db['CloudProvider'],{'as':_0x0be8('0x10c'),'foreignKey':_0x0be8('0x16a'),'onDelete':'restrict'});db[_0x0be8('0x144')][_0x0be8('0x115')](db['MailServerIn'],{'as':_0x0be8('0x16b'),'onDelete':_0x0be8('0x118')});db[_0x0be8('0x144')][_0x0be8('0x115')](db['MailServerOut'],{'as':'Smtp','onDelete':'cascade'});db[_0x0be8('0x144')][_0x0be8('0x119')](db[_0x0be8('0x16c')],{'as':_0x0be8('0x16d'),'foreignKey':_0x0be8('0x169'),'onDelete':_0x0be8('0x118')});db['MailAccount'][_0x0be8('0x119')](db[_0x0be8('0x82')],{'as':'Answers','foreignKey':_0x0be8('0x169')});db[_0x0be8('0x144')]['hasMany'](db[_0x0be8('0x16e')],{'as':'Messages','foreignKey':'MailAccountId'});db['MailAccount'][_0x0be8('0x119')](db[_0x0be8('0x47')],{'as':'Interactions'});db[_0x0be8('0x144')][_0x0be8('0x119')](db['MailApplication'],{'as':_0x0be8('0x14f')});db[_0x0be8('0x144')][_0x0be8('0x158')](db['CmList'],{'as':'List','foreignKey':_0x0be8('0x16f')});db[_0x0be8('0x144')][_0x0be8('0x158')](db[_0x0be8('0x94')],{'as':_0x0be8('0x94'),'foreignKey':'TemplateId'});db[_0x0be8('0x144')][_0x0be8('0x158')](db[_0x0be8('0x89')],{'as':_0x0be8('0x15d'),'foreignKey':_0x0be8('0x15e')});db[_0x0be8('0x144')][_0x0be8('0x126')](db[_0x0be8('0x114')],{'as':'Agents','through':_0x0be8('0x146')});db[_0x0be8('0x43')][_0x0be8('0x126')](db[_0x0be8('0x114')],{'as':_0x0be8('0x170'),'through':'UserMailQueue'});db[_0x0be8('0x43')][_0x0be8('0x126')](db[_0x0be8('0xe8')],{'through':_0x0be8('0x171'),'as':_0x0be8('0x15f')});db[_0x0be8('0x47')][_0x0be8('0x119')](db[_0x0be8('0x16e')],{'as':_0x0be8('0x162'),'onDelete':_0x0be8('0x118'),'foreignKey':_0x0be8('0x172')});db[_0x0be8('0x47')][_0x0be8('0x158')](db[_0x0be8('0x144')],{'as':_0x0be8('0x173'),'foreignKey':_0x0be8('0x169')});db[_0x0be8('0x47')][_0x0be8('0x158')](db[_0x0be8('0x72')],{'as':'Contact','foreignKey':_0x0be8('0x167')});db[_0x0be8('0x47')][_0x0be8('0x158')](db['User'],{'as':'Owner','foreignKey':_0x0be8('0x116')});db[_0x0be8('0x47')][_0x0be8('0x126')](db[_0x0be8('0x92')],{'through':_0x0be8('0x174'),'as':'Tags'});db[_0x0be8('0x47')][_0x0be8('0x126')](db[_0x0be8('0x92')],{'through':_0x0be8('0x174'),'as':_0x0be8('0x175')});db[_0x0be8('0x47')]['belongsToMany'](db['User'],{'as':_0x0be8('0x176'),'through':_0x0be8('0x177'),'foreignKey':'MailInteractionId'});db['MailMessage']['hasMany'](db[_0x0be8('0xef')],{'as':_0x0be8('0x178'),'onDelete':_0x0be8('0x118')});db[_0x0be8('0x16e')][_0x0be8('0x158')](db[_0x0be8('0x114')],{'as':'User'});db[_0x0be8('0x16e')][_0x0be8('0x158')](db[_0x0be8('0x72')],{'onDelete':_0x0be8('0x118'),'as':'Contact'});db[_0x0be8('0x16e')][_0x0be8('0x158')](db['MailInteraction'],{'as':_0x0be8('0x179'),'foreignKey':'MailInteractionId'});db[_0x0be8('0x16e')][_0x0be8('0x158')](db[_0x0be8('0x144')],{'as':'Account','foreignKey':_0x0be8('0x169')});db[_0x0be8('0x16e')][_0x0be8('0x158')](db[_0x0be8('0x13f')],{'as':_0x0be8('0x13f'),'foreignKey':_0x0be8('0x17a')});db[_0x0be8('0x16e')][_0x0be8('0x158')](db[_0x0be8('0x6a')],{'as':_0x0be8('0x6a'),'foreignKey':'ChatOfflineMessageId'});db[_0x0be8('0x4a')][_0x0be8('0x158')](db[_0x0be8('0x114')],{'onDelete':_0x0be8('0x17b')});db[_0x0be8('0x4a')][_0x0be8('0x158')](db['MailQueue'],{'onDelete':_0x0be8('0x17b')});db['MailApplication'][_0x0be8('0x158')](db[_0x0be8('0x144')],{'onDelete':_0x0be8('0x17b')});db[_0x0be8('0x4a')][_0x0be8('0x158')](db['Interval'],{'onDelete':_0x0be8('0x17b'),'foreignKey':_0x0be8('0x15c')});db[_0x0be8('0x4a')][_0x0be8('0x158')](db['Tag'],{'onDelete':'restrict','foreignKey':'TagId'});db[_0x0be8('0x4b')]['belongsTo'](db[_0x0be8('0x144')],{});db['MailQueueReport']['belongsTo'](db[_0x0be8('0xfb')],{'as':_0x0be8('0x17c'),'foreignKey':_0x0be8('0x16f')});db[_0x0be8('0x4b')][_0x0be8('0x158')](db[_0x0be8('0x72')],{'as':_0x0be8('0x17d'),'foreignKey':_0x0be8('0x167')});db[_0x0be8('0x4b')][_0x0be8('0x158')](db[_0x0be8('0x47')],{});db['MailQueueReport'][_0x0be8('0x158')](db[_0x0be8('0x16e')],{});db[_0x0be8('0x4b')][_0x0be8('0x158')](db['User'],{});db[_0x0be8('0x4b')]['belongsTo'](db[_0x0be8('0x43')],{});db['Dashboard'][_0x0be8('0x119')](db['DashboardItem'],{'as':_0x0be8('0x17e'),'onDelete':'cascade'});db[_0x0be8('0x142')][_0x0be8('0x119')](db[_0x0be8('0x16c')],{'as':_0x0be8('0x16d'),'foreignKey':'FaxAccountId','onDelete':'cascade'});db[_0x0be8('0x142')][_0x0be8('0x119')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0x0be8('0x17f')});db['FaxAccount'][_0x0be8('0x119')](db[_0x0be8('0x50')],{'as':'Interactions'});db[_0x0be8('0x142')][_0x0be8('0x119')](db[_0x0be8('0x180')],{'as':'Applications'});db[_0x0be8('0x142')][_0x0be8('0x119')](db[_0x0be8('0x19')],{'as':_0x0be8('0x181'),'onDelete':'cascade'});db[_0x0be8('0x142')][_0x0be8('0x119')](db[_0x0be8('0x52')],{'as':_0x0be8('0x162')});db['FaxAccount']['belongsTo'](db[_0x0be8('0x2f')],{'as':_0x0be8('0x2f')});db['FaxAccount']['belongsTo'](db[_0x0be8('0xfb')],{'as':_0x0be8('0x17c'),'foreignKey':_0x0be8('0x16f')});db[_0x0be8('0x142')][_0x0be8('0x158')](db[_0x0be8('0x89')],{'as':'mandatoryDispositionPause','foreignKey':_0x0be8('0x15e')});db[_0x0be8('0x142')][_0x0be8('0x126')](db[_0x0be8('0x114')],{'as':_0x0be8('0x170'),'through':_0x0be8('0x182')});db[_0x0be8('0x180')][_0x0be8('0x158')](db[_0x0be8('0x114')],{'onDelete':_0x0be8('0x17b')});db[_0x0be8('0x180')]['belongsTo'](db[_0x0be8('0x54')],{'onDelete':_0x0be8('0x17b')});db['FaxApplication'][_0x0be8('0x158')](db[_0x0be8('0x142')],{'onDelete':_0x0be8('0x17b')});db[_0x0be8('0x180')][_0x0be8('0x158')](db['Tag'],{'onDelete':_0x0be8('0x17b'),'foreignKey':_0x0be8('0x183')});db[_0x0be8('0x50')]['hasMany'](db[_0x0be8('0x52')],{'as':_0x0be8('0x162'),'onDelete':'cascade','foreignKey':_0x0be8('0x184')});db['FaxInteraction'][_0x0be8('0x158')](db[_0x0be8('0x142')],{'as':_0x0be8('0x173'),'foreignKey':_0x0be8('0x17f')});db[_0x0be8('0x50')]['belongsTo'](db[_0x0be8('0x72')],{'as':'Contact','foreignKey':_0x0be8('0x167')});db[_0x0be8('0x50')][_0x0be8('0x158')](db[_0x0be8('0x114')],{'as':'Owner','foreignKey':_0x0be8('0x116')});db[_0x0be8('0x50')][_0x0be8('0x126')](db['Tag'],{'through':'fax_interaction_has_tags','as':_0x0be8('0x185')});db[_0x0be8('0x50')][_0x0be8('0x126')](db['Tag'],{'through':_0x0be8('0x186'),'as':_0x0be8('0x175')});db[_0x0be8('0x50')]['belongsToMany'](db[_0x0be8('0x114')],{'as':_0x0be8('0x176'),'through':_0x0be8('0x12f'),'foreignKey':_0x0be8('0x184')});db[_0x0be8('0x52')][_0x0be8('0x158')](db['User'],{'onDelete':_0x0be8('0x118'),'as':_0x0be8('0x114')});db[_0x0be8('0x52')][_0x0be8('0x158')](db[_0x0be8('0x50')],{'as':_0x0be8('0x179'),'foreignKey':_0x0be8('0x184')});db['FaxMessage']['belongsTo'](db[_0x0be8('0x72')],{'onDelete':'cascade','as':_0x0be8('0x17d')});db[_0x0be8('0x52')][_0x0be8('0x158')](db[_0x0be8('0xef')],{'as':_0x0be8('0xef'),'foreignKey':_0x0be8('0x187')});db[_0x0be8('0x52')][_0x0be8('0x158')](db['FaxAccount'],{'as':'Account','foreignKey':_0x0be8('0x17f')});db[_0x0be8('0x54')][_0x0be8('0x126')](db[_0x0be8('0x114')],{'as':_0x0be8('0x170'),'through':_0x0be8('0x38')});db[_0x0be8('0x54')][_0x0be8('0x126')](db[_0x0be8('0xe8')],{'through':_0x0be8('0x188'),'as':_0x0be8('0x15f')});db[_0x0be8('0x55')]['belongsTo'](db[_0x0be8('0x142')],{});db[_0x0be8('0x55')][_0x0be8('0x158')](db[_0x0be8('0xfb')],{'as':_0x0be8('0x17c'),'foreignKey':_0x0be8('0x16f')});db[_0x0be8('0x55')][_0x0be8('0x158')](db[_0x0be8('0x72')],{'as':_0x0be8('0x17d'),'foreignKey':'ContactId'});db[_0x0be8('0x55')][_0x0be8('0x158')](db['FaxInteraction'],{});db[_0x0be8('0x55')][_0x0be8('0x158')](db[_0x0be8('0x52')],{});db[_0x0be8('0x55')]['belongsTo'](db[_0x0be8('0x114')],{});db[_0x0be8('0x55')]['belongsTo'](db[_0x0be8('0x54')],{});db[_0x0be8('0x56')][_0x0be8('0x119')](db[_0x0be8('0x16c')],{'as':_0x0be8('0x16d'),'foreignKey':_0x0be8('0x189'),'onDelete':_0x0be8('0x118')});db[_0x0be8('0x56')]['hasMany'](db[_0x0be8('0x82')],{'as':'Answers','foreignKey':_0x0be8('0x189')});db[_0x0be8('0x56')][_0x0be8('0x119')](db[_0x0be8('0x5a')],{'as':_0x0be8('0x162'),'foreignKey':'SmsAccountId'});db[_0x0be8('0x56')][_0x0be8('0x119')](db[_0x0be8('0x11f')],{'as':_0x0be8('0x18a')});db[_0x0be8('0x56')]['hasMany'](db[_0x0be8('0x58')],{'as':_0x0be8('0x14f')});db[_0x0be8('0x56')][_0x0be8('0x158')](db['CmList'],{'as':_0x0be8('0x17c'),'foreignKey':'ListId'});db[_0x0be8('0x56')]['belongsTo'](db['Pause'],{'as':_0x0be8('0x15d'),'foreignKey':_0x0be8('0x15e')});db['SmsAccount']['belongsToMany'](db['User'],{'as':'Agents','through':'user_has_sms_accounts'});db[_0x0be8('0x58')][_0x0be8('0x158')](db[_0x0be8('0x114')],{'onDelete':_0x0be8('0x17b')});db[_0x0be8('0x58')][_0x0be8('0x158')](db['SmsQueue'],{'onDelete':_0x0be8('0x17b')});db[_0x0be8('0x58')][_0x0be8('0x158')](db[_0x0be8('0x56')],{'onDelete':_0x0be8('0x17b')});db[_0x0be8('0x58')][_0x0be8('0x158')](db[_0x0be8('0x87')],{'onDelete':_0x0be8('0x17b'),'foreignKey':_0x0be8('0x15c')});db[_0x0be8('0x58')]['belongsTo'](db['Tag'],{'onDelete':_0x0be8('0x17b'),'foreignKey':_0x0be8('0x183')});db[_0x0be8('0x11f')][_0x0be8('0x119')](db[_0x0be8('0x5a')],{'as':_0x0be8('0x162'),'onDelete':_0x0be8('0x118'),'foreignKey':_0x0be8('0x18b')});db[_0x0be8('0x11f')][_0x0be8('0x158')](db[_0x0be8('0x56')],{'as':_0x0be8('0x173'),'foreignKey':_0x0be8('0x189')});db[_0x0be8('0x11f')][_0x0be8('0x158')](db[_0x0be8('0x72')],{'as':_0x0be8('0x17d'),'foreignKey':_0x0be8('0x167')});db['SmsInteraction'][_0x0be8('0x158')](db[_0x0be8('0x114')],{'as':'Owner','foreignKey':_0x0be8('0x116')});db[_0x0be8('0x11f')]['belongsToMany'](db[_0x0be8('0x92')],{'through':_0x0be8('0x18c'),'as':'Tags'});db[_0x0be8('0x11f')][_0x0be8('0x126')](db[_0x0be8('0x92')],{'through':_0x0be8('0x18c'),'as':_0x0be8('0x175')});db['SmsInteraction']['belongsToMany'](db[_0x0be8('0x114')],{'as':_0x0be8('0x176'),'through':'user_has_sms_interactions','foreignKey':'SmsInteractionId'});db[_0x0be8('0x5a')][_0x0be8('0x158')](db[_0x0be8('0x114')],{'as':_0x0be8('0x114')});db[_0x0be8('0x5a')][_0x0be8('0x158')](db['CmContact'],{'onDelete':'cascade','as':_0x0be8('0x17d')});db[_0x0be8('0x5a')][_0x0be8('0x158')](db[_0x0be8('0x11f')],{'onDelete':_0x0be8('0x118'),'as':_0x0be8('0x179'),'foreignKey':_0x0be8('0x18b')});db[_0x0be8('0x5a')][_0x0be8('0x158')](db['SmsAccount'],{'as':_0x0be8('0x173'),'foreignKey':_0x0be8('0x189')});db[_0x0be8('0x5b')][_0x0be8('0x126')](db[_0x0be8('0x114')],{'as':'Agents','through':_0x0be8('0x3a'),'foreignKey':_0x0be8('0x18d')});db[_0x0be8('0x5b')][_0x0be8('0x126')](db[_0x0be8('0xe8')],{'through':_0x0be8('0x18e'),'as':_0x0be8('0x15f')});db[_0x0be8('0x5d')][_0x0be8('0x119')](db[_0x0be8('0x16c')],{'as':_0x0be8('0x16d'),'foreignKey':_0x0be8('0x18f'),'onDelete':_0x0be8('0x118')});db[_0x0be8('0x5d')]['hasMany'](db[_0x0be8('0x82')],{'as':_0x0be8('0x190'),'foreignKey':_0x0be8('0x18f')});db['OpenchannelAccount']['hasMany'](db['OpenchannelInteraction'],{'as':_0x0be8('0x18a'),'foreignKey':'OpenchannelAccountId'});db[_0x0be8('0x5d')]['hasMany'](db[_0x0be8('0x62')],{'as':_0x0be8('0x162'),'foreignKey':_0x0be8('0x18f')});db[_0x0be8('0x5d')][_0x0be8('0x119')](db[_0x0be8('0x5f')],{'as':'Applications','foreignKey':_0x0be8('0x18f')});db[_0x0be8('0x5d')][_0x0be8('0x158')](db['CmList'],{'as':_0x0be8('0x17c'),'foreignKey':'ListId'});db[_0x0be8('0x5d')][_0x0be8('0x158')](db[_0x0be8('0x89')],{'as':'mandatoryDispositionPause','foreignKey':_0x0be8('0x15e')});db[_0x0be8('0x5d')][_0x0be8('0x126')](db['User'],{'as':_0x0be8('0x170'),'through':_0x0be8('0x147')});db['OpenchannelApplication']['belongsTo'](db[_0x0be8('0x114')],{'onDelete':_0x0be8('0x17b')});db[_0x0be8('0x5f')][_0x0be8('0x158')](db[_0x0be8('0x13b')],{'onDelete':_0x0be8('0x17b'),'foreignKey':_0x0be8('0x191')});db[_0x0be8('0x5f')]['belongsTo'](db['OpenchannelAccount'],{'onDelete':_0x0be8('0x17b'),'foreignKey':_0x0be8('0x18f')});db[_0x0be8('0x5f')][_0x0be8('0x158')](db[_0x0be8('0x87')],{'onDelete':_0x0be8('0x17b'),'foreignKey':_0x0be8('0x15c')});db[_0x0be8('0x5f')][_0x0be8('0x158')](db[_0x0be8('0x92')],{'onDelete':_0x0be8('0x17b'),'foreignKey':_0x0be8('0x183')});db['OpenchannelInteraction'][_0x0be8('0x119')](db[_0x0be8('0x62')],{'as':_0x0be8('0x162'),'onDelete':_0x0be8('0x118'),'foreignKey':_0x0be8('0x192')});db[_0x0be8('0x61')][_0x0be8('0x158')](db[_0x0be8('0x5d')],{'as':_0x0be8('0x173'),'foreignKey':_0x0be8('0x18f')});db[_0x0be8('0x61')][_0x0be8('0x158')](db[_0x0be8('0x72')],{'as':_0x0be8('0x17d'),'foreignKey':_0x0be8('0x167')});db['OpenchannelInteraction']['belongsTo'](db[_0x0be8('0x114')],{'as':'Owner','foreignKey':_0x0be8('0x116')});db[_0x0be8('0x61')][_0x0be8('0x126')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0be8('0x185')});db[_0x0be8('0x61')]['belongsToMany'](db[_0x0be8('0x92')],{'through':_0x0be8('0x193'),'as':_0x0be8('0x175')});db[_0x0be8('0x61')][_0x0be8('0x126')](db['User'],{'as':_0x0be8('0x176'),'through':_0x0be8('0x132'),'foreignKey':_0x0be8('0x192')});db[_0x0be8('0x62')][_0x0be8('0x158')](db[_0x0be8('0x114')],{'onDelete':_0x0be8('0x118'),'as':'User'});db[_0x0be8('0x62')]['belongsTo'](db['CmContact'],{'onDelete':_0x0be8('0x118'),'as':_0x0be8('0x17d')});db[_0x0be8('0x62')][_0x0be8('0x158')](db['OpenchannelInteraction'],{'onDelete':_0x0be8('0x118'),'as':_0x0be8('0x179'),'foreignKey':_0x0be8('0x192')});db[_0x0be8('0x62')][_0x0be8('0x158')](db[_0x0be8('0xef')],{'as':_0x0be8('0xef'),'foreignKey':_0x0be8('0x187')});db[_0x0be8('0x62')][_0x0be8('0x158')](db[_0x0be8('0x5d')],{'as':'Account','foreignKey':_0x0be8('0x18f')});db[_0x0be8('0x13b')][_0x0be8('0x126')](db[_0x0be8('0x114')],{'as':_0x0be8('0x170'),'through':'UserOpenchannelQueue','foreignKey':_0x0be8('0x191')});db[_0x0be8('0x13b')][_0x0be8('0x126')](db[_0x0be8('0xe8')],{'through':_0x0be8('0x194'),'as':_0x0be8('0x15f')});db[_0x0be8('0x13f')][_0x0be8('0x119')](db[_0x0be8('0x16c')],{'as':_0x0be8('0x16d'),'foreignKey':_0x0be8('0x17a'),'onDelete':'cascade'});db[_0x0be8('0x13f')][_0x0be8('0x119')](db[_0x0be8('0x82')],{'as':_0x0be8('0x190'),'foreignKey':_0x0be8('0x17a')});db['ChatWebsite'][_0x0be8('0x119')](db['ChatProactiveAction'],{'as':'ProactiveActions'});db[_0x0be8('0x13f')]['hasMany'](db['ChatInteraction'],{'as':_0x0be8('0x18a')});db['ChatWebsite'][_0x0be8('0x119')](db[_0x0be8('0x66')],{'as':_0x0be8('0x14f')});db[_0x0be8('0x13f')][_0x0be8('0x119')](db[_0x0be8('0x69')],{'as':_0x0be8('0x162')});db[_0x0be8('0x13f')][_0x0be8('0x158')](db[_0x0be8('0xfb')],{'as':'List','foreignKey':_0x0be8('0x16f')});db[_0x0be8('0x13f')][_0x0be8('0x158')](db[_0x0be8('0x87')],{'as':'Interval','foreignKey':_0x0be8('0x15c')});db['ChatWebsite'][_0x0be8('0x158')](db['MailAccount'],{'as':'MailAccount','foreignKey':_0x0be8('0x169')});db[_0x0be8('0x13f')]['belongsTo'](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db['ChatWebsite'][_0x0be8('0x126')](db[_0x0be8('0x114')],{'as':_0x0be8('0x170'),'through':_0x0be8('0x141')});db[_0x0be8('0x64')][_0x0be8('0x158')](db[_0x0be8('0x5d')],{});db['OpenchannelQueueReport'][_0x0be8('0x158')](db[_0x0be8('0xfb')],{'as':_0x0be8('0x17c'),'foreignKey':_0x0be8('0x16f')});db[_0x0be8('0x64')][_0x0be8('0x158')](db[_0x0be8('0x72')],{'as':_0x0be8('0x17d'),'foreignKey':_0x0be8('0x167')});db[_0x0be8('0x64')][_0x0be8('0x158')](db['OpenchannelInteraction'],{});db[_0x0be8('0x64')][_0x0be8('0x158')](db[_0x0be8('0x62')],{});db[_0x0be8('0x64')][_0x0be8('0x158')](db[_0x0be8('0x114')],{});db['OpenchannelQueueReport']['belongsTo'](db[_0x0be8('0x13b')],{});db[_0x0be8('0x66')][_0x0be8('0x158')](db[_0x0be8('0x114')],{'as':_0x0be8('0x195'),'foreignKey':_0x0be8('0x116'),'onDelete':_0x0be8('0x17b')});db['ChatApplication'][_0x0be8('0x158')](db[_0x0be8('0x137')],{'as':_0x0be8('0x196'),'foreignKey':'ChatQueueId','onDelete':_0x0be8('0x17b')});db['ChatApplication'][_0x0be8('0x158')](db[_0x0be8('0x13f')],{'as':_0x0be8('0x197'),'foreignKey':'ChatWebsiteId','onDelete':'restrict'});db[_0x0be8('0x66')][_0x0be8('0x158')](db[_0x0be8('0x92')],{'onDelete':_0x0be8('0x17b'),'foreignKey':_0x0be8('0x183')});db[_0x0be8('0x68')][_0x0be8('0x119')](db[_0x0be8('0x69')],{'as':_0x0be8('0x162'),'onDelete':_0x0be8('0x118'),'foreignKey':_0x0be8('0x198')});db[_0x0be8('0x68')]['belongsTo'](db[_0x0be8('0x13f')],{'as':_0x0be8('0x173'),'foreignKey':_0x0be8('0x17a')});db[_0x0be8('0x68')][_0x0be8('0x158')](db[_0x0be8('0x72')],{'as':_0x0be8('0x17d'),'foreignKey':_0x0be8('0x167')});db['ChatInteraction'][_0x0be8('0x158')](db['User'],{'as':'Owner','foreignKey':'UserId'});db['ChatInteraction'][_0x0be8('0x126')](db[_0x0be8('0x92')],{'through':_0x0be8('0x199'),'as':_0x0be8('0x185')});db[_0x0be8('0x68')]['belongsToMany'](db[_0x0be8('0x92')],{'through':_0x0be8('0x199'),'as':_0x0be8('0x175')});db[_0x0be8('0x68')][_0x0be8('0x126')](db['User'],{'as':_0x0be8('0x176'),'through':_0x0be8('0x12e'),'foreignKey':_0x0be8('0x198')});db[_0x0be8('0x69')][_0x0be8('0x158')](db[_0x0be8('0x114')],{'onDelete':_0x0be8('0x118'),'as':_0x0be8('0x114')});db[_0x0be8('0x69')][_0x0be8('0x158')](db[_0x0be8('0x72')],{'onDelete':_0x0be8('0x118'),'as':_0x0be8('0x17d'),'foreignKey':_0x0be8('0x167')});db[_0x0be8('0x69')][_0x0be8('0x158')](db['ChatInteraction'],{'onDelete':'cascade','as':_0x0be8('0x179'),'foreignKey':_0x0be8('0x198')});db[_0x0be8('0x69')][_0x0be8('0x158')](db[_0x0be8('0xef')],{'as':_0x0be8('0xef'),'foreignKey':'AttachmentId'});db[_0x0be8('0x69')][_0x0be8('0x158')](db[_0x0be8('0x13f')],{'as':_0x0be8('0x173'),'foreignKey':_0x0be8('0x17a')});db[_0x0be8('0x6a')]['hasMany'](db['Attachment'],{'as':'Attachments','foreignKey':_0x0be8('0x19a'),'onDelete':_0x0be8('0x118'),'hooks':!![]});db[_0x0be8('0x6a')][_0x0be8('0x158')](db['CmContact'],{'onDelete':_0x0be8('0x118'),'as':'Contact','foreignKey':_0x0be8('0x167')});db[_0x0be8('0x6a')][_0x0be8('0x158')](db[_0x0be8('0x13f')],{'as':'Account','foreignKey':_0x0be8('0x17a')});db['ChatQueue']['belongsToMany'](db[_0x0be8('0x114')],{'as':_0x0be8('0x170'),'through':_0x0be8('0x35'),'hooks':!![]});db[_0x0be8('0x137')]['belongsToMany'](db['Team'],{'through':'team_has_chat_queues','as':_0x0be8('0x15f')});db[_0x0be8('0x6d')][_0x0be8('0x119')](db[_0x0be8('0x19b')],{'as':'Messages','foreignKey':_0x0be8('0x19c'),'onDelete':_0x0be8('0x118')});db[_0x0be8('0x6d')][_0x0be8('0x126')](db['User'],{'as':_0x0be8('0x151'),'through':_0x0be8('0x128')});db['ChatProactiveAction'][_0x0be8('0x158')](db[_0x0be8('0x13f')],{'as':'Website','foreignKey':_0x0be8('0x17a')});db[_0x0be8('0x71')]['hasMany'](db[_0x0be8('0x72')],{'as':_0x0be8('0x129'),'foreignKey':_0x0be8('0x19d')});db[_0x0be8('0x72')][_0x0be8('0x119')](db[_0x0be8('0x74')],{'as':_0x0be8('0x153'),'foreignKey':_0x0be8('0x167')});db[_0x0be8('0x72')][_0x0be8('0x119')](db['CmHopperFinal'],{'as':_0x0be8('0x154'),'foreignKey':_0x0be8('0x167')});db[_0x0be8('0x72')][_0x0be8('0x119')](db[_0x0be8('0x79')],{'as':_0x0be8('0x155'),'foreignKey':_0x0be8('0x167')});db[_0x0be8('0x72')][_0x0be8('0x119')](db[_0x0be8('0x7b')],{'as':'ReportAgentPreview','foreignKey':_0x0be8('0x167')});db[_0x0be8('0x72')][_0x0be8('0x119')](db[_0x0be8('0xdd')],{'as':_0x0be8('0x157'),'foreignKey':_0x0be8('0x167')});db[_0x0be8('0x72')][_0x0be8('0x119')](db[_0x0be8('0x61')],{'as':_0x0be8('0x131'),'foreignKey':'ContactId','onDelete':_0x0be8('0x17b')});db['CmContact']['hasMany'](db[_0x0be8('0x68')],{'as':_0x0be8('0x11e'),'foreignKey':_0x0be8('0x167'),'onDelete':_0x0be8('0x17b')});db[_0x0be8('0x72')][_0x0be8('0x119')](db[_0x0be8('0x11f')],{'as':_0x0be8('0x120'),'foreignKey':_0x0be8('0x167'),'onDelete':_0x0be8('0x17b')});db[_0x0be8('0x72')][_0x0be8('0x119')](db[_0x0be8('0x50')],{'as':_0x0be8('0x121'),'foreignKey':'ContactId','onDelete':_0x0be8('0x17b')});db[_0x0be8('0x72')][_0x0be8('0x119')](db[_0x0be8('0x47')],{'as':_0x0be8('0x122'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0x0be8('0x72')][_0x0be8('0x158')](db[_0x0be8('0x71')],{'as':_0x0be8('0x19e'),'foreignKey':'CompanyId'});db[_0x0be8('0x72')]['belongsTo'](db['CmList'],{'as':_0x0be8('0x17c'),'foreignKey':'ListId','onDelete':_0x0be8('0x118')});db[_0x0be8('0x72')][_0x0be8('0x126')](db['User'],{'as':_0x0be8('0x176'),'through':'cm_user_has_contacts'});db['CmContact'][_0x0be8('0x126')](db['Tag'],{'as':_0x0be8('0x185'),'through':_0x0be8('0x19f')});db[_0x0be8('0x72')]['belongsToMany'](db[_0x0be8('0x92')],{'through':_0x0be8('0x19f'),'as':_0x0be8('0x175')});db[_0x0be8('0x74')]['belongsTo'](db['CmContact'],{'as':_0x0be8('0x17d'),'foreignKey':'ContactId','onDelete':_0x0be8('0x118')});db['CmHopper'][_0x0be8('0x158')](db[_0x0be8('0xfb')],{'as':_0x0be8('0x17c'),'foreignKey':_0x0be8('0x16f'),'onDelete':_0x0be8('0x118')});db[_0x0be8('0x74')][_0x0be8('0x158')](db[_0x0be8('0x114')],{'as':'Agent','foreignKey':_0x0be8('0x116')});db[_0x0be8('0x74')][_0x0be8('0x158')](db[_0x0be8('0x1b')],{'as':'Queue','foreignKey':'VoiceQueueId','onDelete':_0x0be8('0x118')});db[_0x0be8('0x74')]['belongsTo'](db[_0x0be8('0xec')],{'as':_0x0be8('0xec'),'foreignKey':_0x0be8('0x1a0'),'onDelete':'cascade'});db['CmHopper'][_0x0be8('0x158')](db['User'],{'as':_0x0be8('0x1a1'),'foreignKey':_0x0be8('0x1a2')});db[_0x0be8('0x76')]['belongsTo'](db[_0x0be8('0x72')],{'as':_0x0be8('0x17d'),'foreignKey':_0x0be8('0x167'),'onDelete':_0x0be8('0x118')});db[_0x0be8('0x76')][_0x0be8('0x158')](db[_0x0be8('0xfb')],{'as':_0x0be8('0x17c'),'foreignKey':'ListId','onDelete':_0x0be8('0x118')});db['CmHopperBlack'][_0x0be8('0x158')](db['VoiceQueue'],{'as':_0x0be8('0x196'),'foreignKey':_0x0be8('0x152'),'onDelete':_0x0be8('0x118')});db[_0x0be8('0x76')][_0x0be8('0x158')](db[_0x0be8('0xec')],{'as':_0x0be8('0xec'),'foreignKey':_0x0be8('0x1a0'),'onDelete':_0x0be8('0x118')});db[_0x0be8('0x80')][_0x0be8('0x119')](db[_0x0be8('0x85')],{'as':{'plural':_0x0be8('0x1a3'),'singular':_0x0be8('0x1a4')},'foreignKey':_0x0be8('0x1a5'),'onDelete':'cascade','hooks':!![]});db[_0x0be8('0x80')][_0x0be8('0x119')](db[_0x0be8('0x85')],{'as':{'plural':_0x0be8('0x1a6'),'singular':_0x0be8('0x1a7')},'foreignKey':'AutomationAnyId','onDelete':'cascade','hooks':!![]});db[_0x0be8('0x80')][_0x0be8('0x119')](db[_0x0be8('0x7f')],{'as':_0x0be8('0x1a8'),'foreignKey':'AutomationId','onDelete':_0x0be8('0x118'),'hooks':!![]});db[_0x0be8('0x16c')]['hasMany'](db[_0x0be8('0x16c')],{'as':_0x0be8('0x16d'),'foreignKey':_0x0be8('0x1a9'),'onDelete':_0x0be8('0x118')});db[_0x0be8('0x87')][_0x0be8('0x119')](db[_0x0be8('0x87')],{'as':_0x0be8('0x1aa'),'foreignKey':'IntervalId','onDelete':_0x0be8('0x118'),'hooks':!![],'required':![]});db[_0x0be8('0x87')][_0x0be8('0x119')](db[_0x0be8('0x19')],{'as':'Extensions','foreignKey':_0x0be8('0x15c'),'onDelete':'restrict'});db[_0x0be8('0x87')][_0x0be8('0x119')](db[_0x0be8('0x4a')],{'as':_0x0be8('0x1ab'),'foreignKey':_0x0be8('0x15c')});db['Interval'][_0x0be8('0x119')](db['ChatApplication'],{'as':'ChatApplications','foreignKey':_0x0be8('0x15c')});db[_0x0be8('0x87')][_0x0be8('0x119')](db[_0x0be8('0x180')],{'as':'FaxApplications','foreignKey':_0x0be8('0x15c')});db[_0x0be8('0x87')]['hasMany'](db[_0x0be8('0x58')],{'as':_0x0be8('0x1ac'),'foreignKey':_0x0be8('0x15c')});db[_0x0be8('0x8e')][_0x0be8('0x158')](db[_0x0be8('0x144')],{});db[_0x0be8('0x8e')][_0x0be8('0x158')](db['AnalyticDefaultReport'],{'foreignKey':_0x0be8('0x1ad')});db['Schedule'][_0x0be8('0x158')](db[_0x0be8('0x1ae')],{'foreignKey':'CustomReportId'});db[_0x0be8('0x90')][_0x0be8('0x126')](db[_0x0be8('0x1af')],{'as':_0x0be8('0x1b0'),'through':_0x0be8('0x1b1'),'onDelete':_0x0be8('0x17b')});db[_0x0be8('0x92')][_0x0be8('0x126')](db[_0x0be8('0x72')],{'through':_0x0be8('0x19f')});db[_0x0be8('0x92')][_0x0be8('0x126')](db[_0x0be8('0x68')],{'through':'chat_interaction_has_tags'});db[_0x0be8('0x92')][_0x0be8('0x126')](db['MailInteraction'],{'through':_0x0be8('0x174')});db[_0x0be8('0x92')]['belongsToMany'](db[_0x0be8('0x11f')],{'through':_0x0be8('0x18c')});db['Tag'][_0x0be8('0x126')](db[_0x0be8('0x50')],{'through':_0x0be8('0x186')});db[_0x0be8('0x92')][_0x0be8('0x126')](db[_0x0be8('0x61')],{'through':_0x0be8('0x193')});db[_0x0be8('0x92')]['belongsToMany'](db[_0x0be8('0x123')],{'through':_0x0be8('0x1b2')});db[_0x0be8('0x96')][_0x0be8('0x119')](db[_0x0be8('0x85')],{'as':{'plural':'AllConditions','singular':_0x0be8('0x1b3')},'foreignKey':'TriggerAllId','onDelete':_0x0be8('0x118'),'hooks':!![]});db[_0x0be8('0x96')][_0x0be8('0x119')](db[_0x0be8('0x85')],{'as':{'plural':_0x0be8('0x1b4'),'singular':_0x0be8('0x1b5')},'foreignKey':'TriggerAnyId','onDelete':_0x0be8('0x118'),'hooks':!![]});db[_0x0be8('0x96')][_0x0be8('0x119')](db['Action'],{'as':_0x0be8('0x1a8'),'foreignKey':_0x0be8('0x1b6'),'onDelete':'cascade','hooks':!![]});db[_0x0be8('0x1ae')]['hasMany'](db[_0x0be8('0xa2')],{'as':_0x0be8('0x1b7'),'onDelete':_0x0be8('0x118'),'foreignKey':_0x0be8('0x1b8'),'hooks':!![]});db[_0x0be8('0x9d')][_0x0be8('0x119')](db['AnalyticFieldReport'],{'as':_0x0be8('0x1b7'),'onDelete':_0x0be8('0x118'),'foreignKey':_0x0be8('0x1ad')});db['AnalyticMetric'][_0x0be8('0x119')](db[_0x0be8('0xa2')],{'as':_0x0be8('0x1b7'),'onDelete':'cascade','foreignKey':_0x0be8('0x1b9')});db[_0x0be8('0xa2')]['belongsTo'](db['AnalyticMetric'],{'foreignKey':_0x0be8('0x1b9')});db[_0x0be8('0xa6')][_0x0be8('0x119')](db[_0x0be8('0xa8')],{'as':_0x0be8('0x1ba'),'onDelete':_0x0be8('0x118'),'foreignKey':'AccountId'});db['SalesforceConfiguration']['hasMany'](db[_0x0be8('0xaa')],{'as':'Subjects','onDelete':_0x0be8('0x118'),'foreignKey':_0x0be8('0x1bb')});db[_0x0be8('0xa8')][_0x0be8('0x119')](db['SalesforceField'],{'as':_0x0be8('0x1bc'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x0be8('0xa8')]['hasMany'](db[_0x0be8('0xaa')],{'as':'Fields','onDelete':_0x0be8('0x118'),'foreignKey':_0x0be8('0x1bd')});db['SalesforceConfiguration'][_0x0be8('0x158')](db[_0x0be8('0xa6')],{'as':_0x0be8('0x173'),'foreignKey':'AccountId'});db[_0x0be8('0xaa')][_0x0be8('0x119')](db[_0x0be8('0xaa')],{'as':_0x0be8('0x1be'),'foreignKey':_0x0be8('0x1bb')});db[_0x0be8('0xaa')]['hasMany'](db['SalesforceField'],{'as':_0x0be8('0x1bf'),'foreignKey':'DescriptionId'});db[_0x0be8('0xaa')][_0x0be8('0x119')](db['SalesforceField'],{'as':_0x0be8('0x1c0'),'foreignKey':_0x0be8('0x1bd')});db[_0x0be8('0xaa')]['belongsTo'](db[_0x0be8('0x1c1')],{'as':_0x0be8('0x1c1'),'foreignKey':_0x0be8('0x1c2')});db[_0x0be8('0xac')][_0x0be8('0x119')](db[_0x0be8('0xae')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x0be8('0x1c3')});db[_0x0be8('0xae')][_0x0be8('0x119')](db[_0x0be8('0xb0')],{'as':_0x0be8('0x1c4'),'onDelete':_0x0be8('0x118'),'foreignKey':_0x0be8('0x1bb')});db[_0x0be8('0xae')][_0x0be8('0x119')](db[_0x0be8('0xb0')],{'as':_0x0be8('0x1bc'),'onDelete':_0x0be8('0x118'),'foreignKey':'DescriptionId'});db['SugarcrmConfiguration'][_0x0be8('0x119')](db['SugarcrmField'],{'as':'Fields','onDelete':_0x0be8('0x118'),'foreignKey':_0x0be8('0x1bd')});db['SugarcrmConfiguration'][_0x0be8('0x158')](db['SugarcrmAccount'],{'as':'Account','foreignKey':_0x0be8('0x1c3')});db[_0x0be8('0xb0')][_0x0be8('0x119')](db[_0x0be8('0xb0')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x0be8('0xb0')][_0x0be8('0x119')](db[_0x0be8('0xb0')],{'as':_0x0be8('0x1bf'),'foreignKey':_0x0be8('0x1c5')});db[_0x0be8('0xb0')]['hasMany'](db['SugarcrmField'],{'as':_0x0be8('0x1c0'),'foreignKey':_0x0be8('0x1bd')});db['SugarcrmField'][_0x0be8('0x158')](db['Variable'],{'as':'Variable','foreignKey':_0x0be8('0x1c2')});db[_0x0be8('0xb2')][_0x0be8('0x119')](db[_0x0be8('0xb4')],{'as':_0x0be8('0x1ba'),'onDelete':_0x0be8('0x118'),'foreignKey':_0x0be8('0x1c3')});db[_0x0be8('0xb4')][_0x0be8('0x119')](db[_0x0be8('0xb6')],{'as':'Subjects','onDelete':_0x0be8('0x118'),'foreignKey':_0x0be8('0x1bb')});db[_0x0be8('0xb4')][_0x0be8('0x119')](db[_0x0be8('0xb6')],{'as':_0x0be8('0x1bc'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x0be8('0xb4')][_0x0be8('0x119')](db['DeskField'],{'as':_0x0be8('0x1b7'),'onDelete':_0x0be8('0x118'),'foreignKey':_0x0be8('0x1bd')});db['DeskConfiguration'][_0x0be8('0x158')](db[_0x0be8('0xb2')],{'as':_0x0be8('0x173'),'foreignKey':_0x0be8('0x1c3')});db[_0x0be8('0xb4')][_0x0be8('0x126')](db[_0x0be8('0x92')],{'through':'int_desk_configuration_has_tags'});db[_0x0be8('0xb6')][_0x0be8('0x119')](db[_0x0be8('0xb6')],{'as':_0x0be8('0x1be'),'foreignKey':_0x0be8('0x1bb')});db['DeskField'][_0x0be8('0x119')](db[_0x0be8('0xb6')],{'as':'Description','foreignKey':_0x0be8('0x1c5')});db[_0x0be8('0xb6')][_0x0be8('0x119')](db[_0x0be8('0xb6')],{'as':_0x0be8('0x1c0'),'foreignKey':_0x0be8('0x1bd')});db[_0x0be8('0xb6')][_0x0be8('0x158')](db[_0x0be8('0x1c1')],{'as':_0x0be8('0x1c1'),'foreignKey':_0x0be8('0x1c2')});db[_0x0be8('0xb8')]['hasMany'](db[_0x0be8('0x1c6')],{'as':'Configurations','onDelete':_0x0be8('0x118'),'foreignKey':_0x0be8('0x1c3')});db[_0x0be8('0x1c6')]['hasMany'](db['ZohoField'],{'as':_0x0be8('0x1c4'),'onDelete':_0x0be8('0x118'),'foreignKey':_0x0be8('0x1bb')});db['ZohoConfiguration'][_0x0be8('0x119')](db['ZohoField'],{'as':_0x0be8('0x1bc'),'onDelete':_0x0be8('0x118'),'foreignKey':_0x0be8('0x1c5')});db[_0x0be8('0x1c6')]['hasMany'](db[_0x0be8('0xbb')],{'as':_0x0be8('0x1b7'),'onDelete':'cascade','foreignKey':_0x0be8('0x1bd')});db[_0x0be8('0x1c6')][_0x0be8('0x158')](db[_0x0be8('0xb8')],{'as':_0x0be8('0x173'),'foreignKey':_0x0be8('0x1c3')});db[_0x0be8('0xbb')][_0x0be8('0x119')](db[_0x0be8('0xbb')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x0be8('0xbb')]['hasMany'](db[_0x0be8('0xbb')],{'as':_0x0be8('0x1bf'),'foreignKey':_0x0be8('0x1c5')});db['ZohoField'][_0x0be8('0x119')](db[_0x0be8('0xbb')],{'as':_0x0be8('0x1c0'),'foreignKey':_0x0be8('0x1bd')});db['ZohoField'][_0x0be8('0x158')](db['Variable'],{'as':_0x0be8('0x1c1'),'foreignKey':_0x0be8('0x1c2')});db[_0x0be8('0x1c7')][_0x0be8('0x119')](db[_0x0be8('0xbd')],{'as':'Configurations','onDelete':_0x0be8('0x118'),'foreignKey':_0x0be8('0x1c3')});db[_0x0be8('0xbd')][_0x0be8('0x119')](db[_0x0be8('0xbf')],{'as':'Subjects','foreignKey':_0x0be8('0x1bb')});db[_0x0be8('0xbd')][_0x0be8('0x119')](db[_0x0be8('0xbf')],{'as':_0x0be8('0x1bc'),'foreignKey':'DescriptionId'});db[_0x0be8('0xbd')][_0x0be8('0x119')](db[_0x0be8('0xbf')],{'as':_0x0be8('0x1b7'),'foreignKey':_0x0be8('0x1bd')});db[_0x0be8('0xbd')][_0x0be8('0x158')](db[_0x0be8('0x1c7')],{'as':_0x0be8('0x173'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0x0be8('0x126')](db[_0x0be8('0x92')],{'through':'int_zendesk_configuration_has_tags'});db[_0x0be8('0xbf')][_0x0be8('0x119')](db[_0x0be8('0xbf')],{'as':_0x0be8('0x1be'),'foreignKey':_0x0be8('0x1bb')});db['ZendeskField'][_0x0be8('0x119')](db[_0x0be8('0xbf')],{'as':_0x0be8('0x1bf'),'foreignKey':_0x0be8('0x1c5')});db['ZendeskField']['hasMany'](db[_0x0be8('0xbf')],{'as':_0x0be8('0x1c0'),'foreignKey':_0x0be8('0x1bd')});db['ZendeskField'][_0x0be8('0x158')](db[_0x0be8('0x1c1')],{'as':_0x0be8('0x1c1'),'foreignKey':'VariableId'});db[_0x0be8('0xc1')][_0x0be8('0x119')](db[_0x0be8('0x1c8')],{'as':_0x0be8('0x1ba'),'onDelete':'cascade','foreignKey':_0x0be8('0x1c3')});db[_0x0be8('0x1c8')][_0x0be8('0x119')](db[_0x0be8('0x1c9')],{'as':'Subjects','onDelete':'cascade','foreignKey':_0x0be8('0x1bb')});db[_0x0be8('0x1c8')][_0x0be8('0x119')](db['FreshdeskField'],{'as':_0x0be8('0x1bc'),'onDelete':'cascade','foreignKey':_0x0be8('0x1c5')});db[_0x0be8('0x1c8')][_0x0be8('0x119')](db[_0x0be8('0x1c9')],{'as':_0x0be8('0x1b7'),'onDelete':_0x0be8('0x118'),'foreignKey':_0x0be8('0x1bd')});db[_0x0be8('0x1c8')][_0x0be8('0x158')](db[_0x0be8('0xc1')],{'as':'Account','foreignKey':_0x0be8('0x1c3')});db[_0x0be8('0x1c8')]['belongsToMany'](db[_0x0be8('0x92')],{'through':_0x0be8('0x1ca')});db[_0x0be8('0x1c9')][_0x0be8('0x119')](db[_0x0be8('0x1c9')],{'as':_0x0be8('0x1be'),'foreignKey':_0x0be8('0x1bb')});db[_0x0be8('0x1c9')][_0x0be8('0x119')](db[_0x0be8('0x1c9')],{'as':_0x0be8('0x1bf'),'foreignKey':_0x0be8('0x1c5')});db[_0x0be8('0x1c9')][_0x0be8('0x119')](db[_0x0be8('0x1c9')],{'as':_0x0be8('0x1c0'),'foreignKey':_0x0be8('0x1bd')});db['FreshdeskField']['belongsTo'](db[_0x0be8('0x1c1')],{'as':_0x0be8('0x1c1'),'foreignKey':_0x0be8('0x1c2')});db['VtigerAccount'][_0x0be8('0x119')](db[_0x0be8('0xc6')],{'as':'Configurations','onDelete':_0x0be8('0x118'),'foreignKey':_0x0be8('0x1c3')});db[_0x0be8('0xc6')][_0x0be8('0x119')](db['VtigerField'],{'as':_0x0be8('0x1c4'),'foreignKey':_0x0be8('0x1bb')});db[_0x0be8('0xc6')][_0x0be8('0x119')](db[_0x0be8('0xc7')],{'as':'Descriptions','foreignKey':_0x0be8('0x1c5')});db[_0x0be8('0xc6')][_0x0be8('0x119')](db['VtigerField'],{'as':_0x0be8('0x1b7'),'foreignKey':_0x0be8('0x1bd')});db[_0x0be8('0xc6')]['belongsTo'](db['VtigerAccount'],{'as':_0x0be8('0x173'),'foreignKey':_0x0be8('0x1c3')});db['VtigerField'][_0x0be8('0x119')](db[_0x0be8('0xc7')],{'as':_0x0be8('0x1be'),'foreignKey':_0x0be8('0x1bb')});db[_0x0be8('0xc7')][_0x0be8('0x119')](db[_0x0be8('0xc7')],{'as':_0x0be8('0x1bf'),'foreignKey':_0x0be8('0x1c5')});db[_0x0be8('0xc7')][_0x0be8('0x119')](db['VtigerField'],{'as':_0x0be8('0x1c0'),'foreignKey':_0x0be8('0x1bd')});db[_0x0be8('0xc7')][_0x0be8('0x158')](db['Variable'],{'as':_0x0be8('0x1c1'),'foreignKey':'VariableId'});db[_0x0be8('0xc9')][_0x0be8('0x119')](db['ServicenowConfiguration'],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x0be8('0x1c3')});db[_0x0be8('0xcb')][_0x0be8('0x119')](db[_0x0be8('0x1cb')],{'as':_0x0be8('0x1c4'),'foreignKey':_0x0be8('0x1bb')});db[_0x0be8('0xcb')]['hasMany'](db[_0x0be8('0x1cb')],{'as':'Descriptions','foreignKey':'DescriptionId'});db[_0x0be8('0xcb')][_0x0be8('0x119')](db[_0x0be8('0x1cb')],{'as':_0x0be8('0x1b7'),'foreignKey':_0x0be8('0x1bd')});db[_0x0be8('0xcb')]['belongsTo'](db['ServicenowAccount'],{'as':'Account','foreignKey':_0x0be8('0x1c3')});db[_0x0be8('0x1cb')]['hasMany'](db[_0x0be8('0x1cb')],{'as':'Subject','foreignKey':_0x0be8('0x1bb')});db['ServicenowField'][_0x0be8('0x119')](db[_0x0be8('0x1cb')],{'as':_0x0be8('0x1bf'),'foreignKey':_0x0be8('0x1c5')});db['ServicenowField'][_0x0be8('0x119')](db['ServicenowField'],{'as':_0x0be8('0x1c0'),'foreignKey':'FieldId'});db[_0x0be8('0x1cb')][_0x0be8('0x158')](db[_0x0be8('0x1c1')],{'as':_0x0be8('0x1c1'),'foreignKey':_0x0be8('0x1c2')});db[_0x0be8('0xcd')]['hasMany'](db[_0x0be8('0xcf')],{'as':'Configurations','onDelete':_0x0be8('0x118'),'foreignKey':'AccountId'});db[_0x0be8('0xcd')]['belongsTo'](db[_0x0be8('0x10c')],{'as':_0x0be8('0x10c'),'foreignKey':_0x0be8('0x16a')});db['Dynamics365Configuration']['hasMany'](db[_0x0be8('0x1cc')],{'as':_0x0be8('0x1c4'),'onDelete':_0x0be8('0x118'),'foreignKey':_0x0be8('0x1bb')});db[_0x0be8('0xcf')][_0x0be8('0x119')](db['Dynamics365Field'],{'as':_0x0be8('0x1bc'),'onDelete':_0x0be8('0x118'),'foreignKey':_0x0be8('0x1c5')});db[_0x0be8('0xcf')][_0x0be8('0x119')](db[_0x0be8('0x1cc')],{'as':_0x0be8('0x1b7'),'onDelete':_0x0be8('0x118'),'foreignKey':'FieldId'});db['Dynamics365Configuration'][_0x0be8('0x158')](db[_0x0be8('0xcd')],{'as':_0x0be8('0x173'),'foreignKey':_0x0be8('0x1c3')});db[_0x0be8('0x1cc')][_0x0be8('0x119')](db['Dynamics365Field'],{'as':_0x0be8('0x1be'),'foreignKey':'SubjectId'});db[_0x0be8('0x1cc')][_0x0be8('0x119')](db[_0x0be8('0x1cc')],{'as':_0x0be8('0x1bf'),'foreignKey':'DescriptionId'});db[_0x0be8('0x1cc')]['hasMany'](db[_0x0be8('0x1cc')],{'as':_0x0be8('0x1c0'),'foreignKey':_0x0be8('0x1bd')});db[_0x0be8('0x1cc')]['belongsTo'](db['Variable'],{'as':_0x0be8('0x1c1'),'foreignKey':_0x0be8('0x1c2')});db[_0x0be8('0xd2')][_0x0be8('0x119')](db[_0x0be8('0xd4')],{'as':_0x0be8('0x1ba'),'onDelete':'cascade','foreignKey':_0x0be8('0x1c3')});db['FreshsalesConfiguration']['hasMany'](db[_0x0be8('0x1cd')],{'as':_0x0be8('0x1c4'),'foreignKey':_0x0be8('0x1bb')});db['FreshsalesConfiguration']['hasMany'](db[_0x0be8('0x1cd')],{'as':_0x0be8('0x1bc'),'foreignKey':_0x0be8('0x1c5')});db[_0x0be8('0xd4')]['hasMany'](db['FreshsalesField'],{'as':'Fields','foreignKey':_0x0be8('0x1bd')});db[_0x0be8('0xd4')][_0x0be8('0x158')](db['FreshsalesAccount'],{'as':_0x0be8('0x173'),'foreignKey':_0x0be8('0x1c3')});db['FreshsalesField'][_0x0be8('0x119')](db['FreshsalesField'],{'as':_0x0be8('0x1be'),'foreignKey':'SubjectId'});db[_0x0be8('0x1cd')][_0x0be8('0x119')](db['FreshsalesField'],{'as':_0x0be8('0x1bf'),'foreignKey':_0x0be8('0x1c5')});db[_0x0be8('0x1cd')][_0x0be8('0x119')](db[_0x0be8('0x1cd')],{'as':_0x0be8('0x1c0'),'foreignKey':_0x0be8('0x1bd')});db[_0x0be8('0x1cd')]['belongsTo'](db[_0x0be8('0x1c1')],{'as':_0x0be8('0x1c1'),'foreignKey':_0x0be8('0x1c2')});db[_0x0be8('0xd8')]['belongsTo'](db[_0x0be8('0x13f')],{});db[_0x0be8('0xd8')][_0x0be8('0x158')](db[_0x0be8('0xfb')],{'as':_0x0be8('0x17c'),'foreignKey':_0x0be8('0x16f')});db[_0x0be8('0xd8')][_0x0be8('0x158')](db[_0x0be8('0x72')],{'as':_0x0be8('0x17d'),'foreignKey':'ContactId'});db[_0x0be8('0xd8')]['belongsTo'](db[_0x0be8('0x68')],{});db[_0x0be8('0xd8')][_0x0be8('0x158')](db['ChatMessage'],{});db[_0x0be8('0xd8')][_0x0be8('0x158')](db['User'],{});db[_0x0be8('0xd8')][_0x0be8('0x158')](db[_0x0be8('0x137')],{});db['ChatInternalMessage'][_0x0be8('0x158')](db['User'],{'onDelete':'cascade','foreignKey':_0x0be8('0x1ce')});db[_0x0be8('0x19b')][_0x0be8('0x158')](db[_0x0be8('0x114')],{'onDelete':_0x0be8('0x118'),'foreignKey':_0x0be8('0x1cf')});db[_0x0be8('0xdd')][_0x0be8('0x119')](db[_0x0be8('0x1d0')],{'foreignKey':_0x0be8('0x1d1'),'onDelete':_0x0be8('0x118')});db[_0x0be8('0xdd')][_0x0be8('0x119')](db[_0x0be8('0x1d2')],{'foreignKey':_0x0be8('0x1d1'),'onDelete':_0x0be8('0x118')});db[_0x0be8('0x1d3')]['belongsTo'](db[_0x0be8('0x56')],{});db[_0x0be8('0x1d3')]['belongsTo'](db[_0x0be8('0xfb')],{'as':_0x0be8('0x17c'),'foreignKey':_0x0be8('0x16f')});db[_0x0be8('0x1d3')][_0x0be8('0x158')](db[_0x0be8('0x72')],{'as':_0x0be8('0x17d'),'foreignKey':_0x0be8('0x167')});db['SmsQueueReport'][_0x0be8('0x158')](db[_0x0be8('0x11f')],{});db['SmsQueueReport'][_0x0be8('0x158')](db[_0x0be8('0x5a')],{});db[_0x0be8('0x1d3')]['belongsTo'](db[_0x0be8('0x114')],{});db[_0x0be8('0x1d3')][_0x0be8('0x158')](db[_0x0be8('0x5b')],{});db[_0x0be8('0x1d4')]['hasMany'](db[_0x0be8('0xdd')],{'foreignKey':_0x0be8('0x1d5')});db[_0x0be8('0x1d4')][_0x0be8('0x119')](db[_0x0be8('0x1d0')],{'foreignKey':_0x0be8('0x1d5')});db[_0x0be8('0x1d4')][_0x0be8('0x119')](db['JscriptyAnswerReport'],{'foreignKey':_0x0be8('0x1d5')});db[_0x0be8('0xe4')]['belongsToMany'](db['User'],{'as':_0x0be8('0x176'),'through':'user_has_square_projects'});db[_0x0be8('0xe8')][_0x0be8('0x126')](db[_0x0be8('0x114')],{'as':_0x0be8('0x170'),'through':_0x0be8('0x12d')});db[_0x0be8('0xe8')][_0x0be8('0x126')](db[_0x0be8('0x1b')],{'through':'TeamVoiceQueue','as':'VoiceQueues'});db[_0x0be8('0xe8')][_0x0be8('0x126')](db[_0x0be8('0x43')],{'through':'team_has_mail_queues','as':_0x0be8('0x136')});db[_0x0be8('0xe8')][_0x0be8('0x126')](db[_0x0be8('0x137')],{'through':_0x0be8('0x1d6'),'as':_0x0be8('0x138')});db[_0x0be8('0xe8')]['belongsToMany'](db[_0x0be8('0x54')],{'through':_0x0be8('0x188'),'as':_0x0be8('0x139')});db[_0x0be8('0xe8')][_0x0be8('0x126')](db['SmsQueue'],{'through':'team_has_sms_queues','as':_0x0be8('0x13a')});db['Team']['belongsToMany'](db[_0x0be8('0x13b')],{'through':_0x0be8('0x194'),'as':_0x0be8('0x1d7')});db[_0x0be8('0xe8')][_0x0be8('0x126')](db[_0x0be8('0x13d')],{'through':_0x0be8('0x1d8'),'as':'WhatsappQueues'});db[_0x0be8('0xe8')][_0x0be8('0x126')](db[_0x0be8('0xfd')],{'through':_0x0be8('0x1d9'),'as':_0x0be8('0x135')});db[_0x0be8('0xec')][_0x0be8('0x119')](db[_0x0be8('0x74')],{'as':_0x0be8('0x153'),'foreignKey':_0x0be8('0x1a0')});db[_0x0be8('0xec')][_0x0be8('0x119')](db[_0x0be8('0x78')],{'as':_0x0be8('0x154'),'foreignKey':_0x0be8('0x1a0')});db[_0x0be8('0xec')][_0x0be8('0x119')](db['CmHopperHistory'],{'as':_0x0be8('0x155'),'foreignKey':_0x0be8('0x1a0')});db['Campaign'][_0x0be8('0x119')](db[_0x0be8('0x76')],{'as':_0x0be8('0x156'),'foreignKey':_0x0be8('0x1a0')});db[_0x0be8('0xec')][_0x0be8('0x158')](db['Trunk'],{'as':'Trunk','foreignKey':_0x0be8('0x159')});db[_0x0be8('0xec')][_0x0be8('0x158')](db[_0x0be8('0x2f')],{'as':_0x0be8('0x15a'),'foreignKey':_0x0be8('0x15b')});db['Campaign'][_0x0be8('0x158')](db[_0x0be8('0x87')],{'as':_0x0be8('0x87'),'foreignKey':_0x0be8('0x15c')});db[_0x0be8('0xec')]['belongsTo'](db[_0x0be8('0xe4')],{'as':'SquareProject','foreignKey':_0x0be8('0x1da')});db[_0x0be8('0xec')]['belongsToMany'](db[_0x0be8('0xfb')],{'as':_0x0be8('0x12b'),'through':_0x0be8('0x1db')});db[_0x0be8('0xec')][_0x0be8('0x126')](db['CmList'],{'as':'BlackLists','through':_0x0be8('0x1dc')});db[_0x0be8('0xef')][_0x0be8('0x158')](db[_0x0be8('0x6a')],{'as':_0x0be8('0x6a'),'foreignKey':'ChatOfflineMessageId'});db[_0x0be8('0xf3')][_0x0be8('0x158')](db[_0x0be8('0x16e')],{});db[_0x0be8('0xf3')]['belongsTo'](db['MailInteraction'],{});db[_0x0be8('0xf3')][_0x0be8('0x158')](db['MailAccount'],{'foreignKey':'FromMailAccountId','as':_0x0be8('0x1dd')});db[_0x0be8('0xf3')]['belongsTo'](db[_0x0be8('0x114')],{'foreignKey':'FromUserId','as':_0x0be8('0x1de')});db[_0x0be8('0xf3')]['belongsTo'](db[_0x0be8('0x114')],{'foreignKey':_0x0be8('0x1df'),'as':_0x0be8('0x1e0')});db[_0x0be8('0xf3')]['belongsTo'](db[_0x0be8('0x43')],{'foreignKey':'ToMailQueueId','as':'ToQueue'});db[_0x0be8('0xf3')]['belongsTo'](db[_0x0be8('0x144')],{'foreignKey':'ToMailAccountId','as':_0x0be8('0x1e1')});db[_0x0be8('0xf5')][_0x0be8('0x158')](db['ChatMessage'],{});db['ChatTransferReport'][_0x0be8('0x158')](db[_0x0be8('0x68')],{});db[_0x0be8('0xf5')][_0x0be8('0x158')](db[_0x0be8('0x13f')],{'foreignKey':_0x0be8('0x1e2'),'as':_0x0be8('0x1dd')});db[_0x0be8('0xf5')][_0x0be8('0x158')](db[_0x0be8('0x114')],{'foreignKey':_0x0be8('0x1e3'),'as':_0x0be8('0x1de')});db[_0x0be8('0xf5')][_0x0be8('0x158')](db[_0x0be8('0x114')],{'foreignKey':_0x0be8('0x1df'),'as':'ToAgent'});db[_0x0be8('0xf5')][_0x0be8('0x158')](db[_0x0be8('0x137')],{'foreignKey':'ToChatQueueId','as':'ToQueue'});db['ChatTransferReport'][_0x0be8('0x158')](db[_0x0be8('0x13f')],{'foreignKey':'ToChatWebsiteId','as':_0x0be8('0x1e1')});db[_0x0be8('0xf7')][_0x0be8('0x158')](db['FaxMessage'],{});db['FaxTransferReport']['belongsTo'](db[_0x0be8('0x50')],{});db['FaxTransferReport'][_0x0be8('0x158')](db[_0x0be8('0x142')],{'foreignKey':_0x0be8('0x1e4'),'as':_0x0be8('0x1dd')});db[_0x0be8('0xf7')][_0x0be8('0x158')](db[_0x0be8('0x114')],{'foreignKey':_0x0be8('0x1e3'),'as':_0x0be8('0x1de')});db[_0x0be8('0xf7')][_0x0be8('0x158')](db[_0x0be8('0x114')],{'foreignKey':'ToUserId','as':_0x0be8('0x1e0')});db[_0x0be8('0xf7')][_0x0be8('0x158')](db[_0x0be8('0x54')],{'foreignKey':_0x0be8('0x1e5'),'as':_0x0be8('0x1e6')});db[_0x0be8('0xf7')]['belongsTo'](db['FaxAccount'],{'foreignKey':_0x0be8('0x1e7'),'as':_0x0be8('0x1e1')});db[_0x0be8('0xf8')][_0x0be8('0x158')](db[_0x0be8('0x62')],{});db[_0x0be8('0xf8')][_0x0be8('0x158')](db[_0x0be8('0x61')],{});db[_0x0be8('0xf8')][_0x0be8('0x158')](db[_0x0be8('0x5d')],{'foreignKey':'FromOpenchannelAccountId','as':_0x0be8('0x1dd')});db[_0x0be8('0xf8')][_0x0be8('0x158')](db[_0x0be8('0x114')],{'foreignKey':_0x0be8('0x1e3'),'as':_0x0be8('0x1de')});db['OpenchannelTransferReport'][_0x0be8('0x158')](db[_0x0be8('0x114')],{'foreignKey':_0x0be8('0x1df'),'as':_0x0be8('0x1e0')});db[_0x0be8('0xf8')]['belongsTo'](db[_0x0be8('0x13b')],{'foreignKey':_0x0be8('0x1e8'),'as':_0x0be8('0x1e6')});db[_0x0be8('0xf8')][_0x0be8('0x158')](db['OpenchannelAccount'],{'foreignKey':_0x0be8('0x1e9'),'as':_0x0be8('0x1e1')});db[_0x0be8('0x1ea')][_0x0be8('0x158')](db[_0x0be8('0x5a')],{});db['SmsTransferReport'][_0x0be8('0x158')](db[_0x0be8('0x11f')],{});db[_0x0be8('0x1ea')][_0x0be8('0x158')](db[_0x0be8('0x56')],{'foreignKey':_0x0be8('0x1eb'),'as':_0x0be8('0x1dd')});db['SmsTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x0be8('0x1e3'),'as':_0x0be8('0x1de')});db[_0x0be8('0x1ea')]['belongsTo'](db['User'],{'foreignKey':_0x0be8('0x1df'),'as':'ToAgent'});db[_0x0be8('0x1ea')]['belongsTo'](db[_0x0be8('0x5b')],{'foreignKey':_0x0be8('0x1ec'),'as':_0x0be8('0x1e6')});db[_0x0be8('0x1ea')][_0x0be8('0x158')](db[_0x0be8('0x56')],{'foreignKey':_0x0be8('0x1ed'),'as':_0x0be8('0x1e1')});db['CmList'][_0x0be8('0x119')](db[_0x0be8('0x16c')],{'as':_0x0be8('0x16d'),'foreignKey':_0x0be8('0x16f'),'onDelete':'cascade'});db[_0x0be8('0xfb')][_0x0be8('0x119')](db['CmCustomField'],{'as':_0x0be8('0x1ee'),'foreignKey':_0x0be8('0x16f')});db[_0x0be8('0xfb')][_0x0be8('0x119')](db[_0x0be8('0x72')],{'as':_0x0be8('0x129'),'onDelete':_0x0be8('0x118'),'foreignKey':_0x0be8('0x16f')});db['CmList'][_0x0be8('0x119')](db[_0x0be8('0x78')],{'as':'HopperFinals','foreignKey':_0x0be8('0x16f')});db[_0x0be8('0xfb')][_0x0be8('0x119')](db[_0x0be8('0x79')],{'as':_0x0be8('0x11d'),'foreignKey':'ListId'});db['CmList'][_0x0be8('0x119')](db[_0x0be8('0x7b')],{'as':_0x0be8('0x7b'),'foreignKey':_0x0be8('0x16f')});db[_0x0be8('0xfb')][_0x0be8('0x126')](db[_0x0be8('0x1b')],{'as':_0x0be8('0x1ef'),'through':_0x0be8('0x1f0')});db[_0x0be8('0xfb')][_0x0be8('0x126')](db['User'],{'as':_0x0be8('0x170'),'through':'cm_user_has_lists'});db[_0x0be8('0xfd')][_0x0be8('0x119')](db[_0x0be8('0x19')],{'as':'Extensions','onDelete':'cascade'});db[_0x0be8('0xfd')][_0x0be8('0x126')](db['User'],{'as':'Agents','through':_0x0be8('0x110')});db['VoicePrefix'][_0x0be8('0x126')](db[_0x0be8('0xe8')],{'through':'TeamVoicePrefix','as':_0x0be8('0x15f')});db[_0x0be8('0x125')][_0x0be8('0x119')](db[_0x0be8('0x114')],{'as':'Users','foreignKey':_0x0be8('0x1f1')});db[_0x0be8('0x125')]['hasMany'](db[_0x0be8('0xff')],{'as':'UserProfileSections','foreignKey':_0x0be8('0x1f1'),'onDelete':_0x0be8('0x118')});db['UserProfileSection'][_0x0be8('0x119')](db[_0x0be8('0x1f2')],{'as':'Resources','foreignKey':_0x0be8('0x1f3'),'onDelete':_0x0be8('0x118')});db[_0x0be8('0x14a')][_0x0be8('0x119')](db[_0x0be8('0x16c')],{'as':_0x0be8('0x16d'),'foreignKey':_0x0be8('0x1f4'),'onDelete':'cascade'});db['WhatsappAccount'][_0x0be8('0x119')](db[_0x0be8('0x82')],{'as':_0x0be8('0x190'),'foreignKey':_0x0be8('0x1f4')});db['WhatsappAccount'][_0x0be8('0x119')](db[_0x0be8('0x106')],{'as':_0x0be8('0x162'),'foreignKey':_0x0be8('0x1f4')});db['WhatsappAccount'][_0x0be8('0x119')](db['WhatsappInteraction'],{'as':_0x0be8('0x18a')});db[_0x0be8('0x14a')]['hasMany'](db[_0x0be8('0x103')],{'as':'Applications'});db['WhatsappAccount'][_0x0be8('0x158')](db[_0x0be8('0xfb')],{'as':_0x0be8('0x17c'),'foreignKey':_0x0be8('0x16f')});db[_0x0be8('0x14a')][_0x0be8('0x158')](db[_0x0be8('0x89')],{'as':_0x0be8('0x15d'),'foreignKey':_0x0be8('0x15e')});db[_0x0be8('0x14a')][_0x0be8('0x126')](db['User'],{'as':'Agents','through':_0x0be8('0x14c')});db[_0x0be8('0x103')]['belongsTo'](db['User'],{'onDelete':_0x0be8('0x17b')});db[_0x0be8('0x103')][_0x0be8('0x158')](db[_0x0be8('0x13d')],{'onDelete':_0x0be8('0x17b')});db['WhatsappApplication'][_0x0be8('0x158')](db[_0x0be8('0x14a')],{'onDelete':_0x0be8('0x17b')});db[_0x0be8('0x103')]['belongsTo'](db[_0x0be8('0x87')],{'onDelete':_0x0be8('0x17b'),'foreignKey':_0x0be8('0x15c')});db['WhatsappApplication'][_0x0be8('0x158')](db[_0x0be8('0x92')],{'onDelete':'restrict','foreignKey':_0x0be8('0x183')});db['WhatsappInteraction'][_0x0be8('0x119')](db[_0x0be8('0x106')],{'as':_0x0be8('0x162'),'onDelete':'cascade','foreignKey':_0x0be8('0x1f5')});db[_0x0be8('0x123')]['belongsTo'](db[_0x0be8('0x14a')],{'as':'Account','foreignKey':_0x0be8('0x1f4')});db[_0x0be8('0x123')][_0x0be8('0x158')](db[_0x0be8('0x72')],{'as':'Contact','foreignKey':'ContactId'});db[_0x0be8('0x123')][_0x0be8('0x158')](db[_0x0be8('0x114')],{'as':_0x0be8('0x1a1'),'foreignKey':_0x0be8('0x116')});db['WhatsappInteraction']['belongsToMany'](db[_0x0be8('0x92')],{'through':'whatsapp_interaction_has_tags','as':_0x0be8('0x185')});db[_0x0be8('0x123')][_0x0be8('0x126')](db[_0x0be8('0x92')],{'through':_0x0be8('0x1b2'),'as':'ThroughTags'});db[_0x0be8('0x123')][_0x0be8('0x126')](db[_0x0be8('0x114')],{'as':'Users','through':'user_has_whatsapp_interactions','foreignKey':_0x0be8('0x1f5')});db[_0x0be8('0x106')][_0x0be8('0x158')](db[_0x0be8('0x114')],{'as':_0x0be8('0x114')});db['WhatsappMessage']['belongsTo'](db[_0x0be8('0x72')],{'onDelete':_0x0be8('0x118'),'as':_0x0be8('0x17d')});db[_0x0be8('0x106')][_0x0be8('0x158')](db[_0x0be8('0x123')],{'onDelete':_0x0be8('0x118'),'as':_0x0be8('0x179'),'foreignKey':'WhatsappInteractionId'});db[_0x0be8('0x106')]['belongsTo'](db[_0x0be8('0x14a')],{'as':'Account','foreignKey':_0x0be8('0x1f4')});db[_0x0be8('0x108')][_0x0be8('0x158')](db[_0x0be8('0x14a')],{});db[_0x0be8('0x108')]['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0x0be8('0x16f')});db['WhatsappQueueReport'][_0x0be8('0x158')](db['CmContact'],{'as':_0x0be8('0x17d'),'foreignKey':_0x0be8('0x167')});db[_0x0be8('0x108')]['belongsTo'](db['WhatsappInteraction'],{});db[_0x0be8('0x108')][_0x0be8('0x158')](db['WhatsappQueue'],{});db[_0x0be8('0x108')][_0x0be8('0x158')](db['WhatsappMessage'],{});db['WhatsappQueueReport'][_0x0be8('0x158')](db[_0x0be8('0x114')],{});db[_0x0be8('0x10a')][_0x0be8('0x158')](db[_0x0be8('0x106')],{});db[_0x0be8('0x10a')][_0x0be8('0x158')](db[_0x0be8('0x123')],{});db['WhatsappTransferReport'][_0x0be8('0x158')](db[_0x0be8('0x14a')],{'foreignKey':_0x0be8('0x1f6'),'as':_0x0be8('0x1dd')});db['WhatsappTransferReport'][_0x0be8('0x158')](db['WhatsappAccount'],{'foreignKey':_0x0be8('0x1f7'),'as':_0x0be8('0x1e1')});db['WhatsappTransferReport'][_0x0be8('0x158')](db[_0x0be8('0x13d')],{'foreignKey':'ToQueueId','as':'ToQueue'});db[_0x0be8('0x10a')][_0x0be8('0x158')](db[_0x0be8('0x114')],{'foreignKey':_0x0be8('0x1e3'),'as':_0x0be8('0x1de')});db[_0x0be8('0x10a')]['belongsTo'](db[_0x0be8('0x114')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x0be8('0x13d')][_0x0be8('0x126')](db[_0x0be8('0x114')],{'as':_0x0be8('0x170'),'through':_0x0be8('0x3d'),'foreignKey':'WhatsappQueueId'});db[_0x0be8('0x13d')][_0x0be8('0x126')](db[_0x0be8('0xe8')],{'through':_0x0be8('0x1d8'),'as':_0x0be8('0x15f')});db[_0x0be8('0x112')][_0x0be8('0x158')](db[_0x0be8('0x114')],{'as':_0x0be8('0x1f8'),'foreignKey':_0x0be8('0x116'),'onDelete':_0x0be8('0x118'),'hooks':!![]});db[_0x0be8('0x10c')][_0x0be8('0x115')](db[_0x0be8('0xcd')],{'as':'Dynamics365Account','onDelete':_0x0be8('0x17b')});db['CloudProvider'][_0x0be8('0x115')](db[_0x0be8('0x168')],{'as':_0x0be8('0x16b'),'onDelete':_0x0be8('0x17b')});db['CloudProvider']['hasOne'](db[_0x0be8('0x40')],{'as':_0x0be8('0x1f9'),'onDelete':_0x0be8('0x17b')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xc280=['Answers','List','Template','mandatoryDispositionPauseId','Agents','team_has_mail_queues','MailInteractionId','Account','ContactId','Tag','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachments','Interaction','ChatOfflineMessageId','TagId','ListId','FaxAccountId','Exntensions','FaxMessage','FaxInteractionId','Owner','fax_interaction_has_tags','user_has_fax_interactions','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','user_has_openchannel_interactions','team_has_openchannel_queues','ChatWebsiteId','Interactions','Queue','ChatQueueId','ChatInteractionId','team_has_chat_queues','ChatGroupId','CompanyId','OpenchannelInteractions','SmsInteractions','Company','cm_contact_has_tags','Agent','Campaign','CampaignId','OwnerId','Automation','All','OneAll','AutomationAllId','Any','AutomationAnyId','Actions','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','chat_interaction_has_tags','whatsapp_interaction_has_tags','Trigger','AllConditions','AnyCondition','TriggerId','Fields','MetricId','Configurations','AccountId','Subjects','SubjectId','DescriptionId','Subject','Description','Descriptions','VariableId','DeskField','FieldId','Field','ZendeskAccount','ZendeskConfiguration','FreshdeskConfiguration','ServicenowConfiguration','ServicenowField','Dynamics365Account','FreshsalesField','FromId','ToId','SessionId','JscriptyAnswerReport','JscriptyProject','ProjectId','MailQueues','FaxQueues','SmsQueues','team_has_whatsapp_queues','HopperBlacks','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','ToChatQueueId','ToChatWebsiteId','ToFaxQueueId','ToFaxAccountId','OpenchannelTransferReport','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','Queues','Extensions','UserVoicePrefix','Resources','WhatsappAccountId','WhatsappMessage','WhatsappApplication','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','user','exports','../config/environment','sequelize','lodash','determine','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','mysql','name','utf8','utf8_general_ci','sequelizeHistory','utf8mb4','database','username','password','options','User','../api/user/user.model','VoiceChanSpy','import','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','MemberReport','../api/memberReport/memberReport.model','Trunk','VoiceTransferReport','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','SmsAccount','SmsApplication','../api/smsApplication/smsApplication.model','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','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','Pause','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','../api/tag/tag.model','../api/template/template.model','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','../api/intDeskField/intDeskField.model','ZohoAccount','ZohoConfiguration','ZohoField','../api/intZohoField/intZohoField.model','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowField/intServicenowField.model','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','Dynamics365Field','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../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/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','../api/voicePrefix/voicePrefix.model','UserProfile','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','hasOne','cascade','UserId','userSetting','hasMany','Recordings','VoiceQueuesRt','CmHopperFinal','HopperFinals','HopperHistory','ChatInteraction','ChatInteractions','FaxInteractions','MailInteraction','MailInteractions','SenderId','userProfileId','belongsToMany','Groups','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_sms_interactions','WhatsappInteractions','user_has_whatsapp_interactions','VoiceQueues','UserVoiceQueue','VoicePrefix','VoicePrefixes','ChatQueue','ChatQueues','OpenchannelQueues','UserWhatsappQueue','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','user_has_square_projects','SpiedAgents','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperHistories','JscriptySessions','belongsTo','TrunkId','TrunkBackupId','IntervalId','mandatoryDispositionPause','Lists','voice_queues_has_cm_lists','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','VoiceCallReport','QueueCalls','uniqueid','AgentReports','Contact','MailAccountId','CloudProviderId','restrict','MailServerOut','Imap','Smtp','Dispositions'];(function(_0x381606,_0x53382c){var _0x31c4ca=function(_0x310493){while(--_0x310493){_0x381606['push'](_0x381606['shift']());}};_0x31c4ca(++_0x53382c);}(_0xc280,0x92));var _0x0c28=function(_0x83e3a1,_0x2aca79){_0x83e3a1=_0x83e3a1-0x0;var _0x1121c4=_0xc280[_0x83e3a1];return _0x1121c4;};'use strict';var config=require(_0x0c28('0x0'));var Sequelize=require(_0x0c28('0x1'));var _=require(_0x0c28('0x2'));var jstz=require('jstz');var timezone=jstz[_0x0c28('0x3')]();config['sequelize']=_[_0x0c28('0x4')](config[_0x0c28('0x1')],{'database':_0x0c28('0x5'),'username':_0x0c28('0x6'),'password':_0x0c28('0x7'),'options':{'host':_0x0c28('0x8'),'port':0xcea,'dialect':_0x0c28('0x9'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x0c28('0xa')](),'define':{'charset':_0x0c28('0xb'),'collate':_0x0c28('0xc')}}});config[_0x0c28('0xd')]=_[_0x0c28('0x4')](config[_0x0c28('0xd')],{'database':'motion2','username':'xcall','password':_0x0c28('0x7'),'options':{'host':_0x0c28('0x8'),'port':0xcea,'dialect':_0x0c28('0x9'),'dialectOptions':{'charset':_0x0c28('0xe')},'logging':![],'timezone':timezone[_0x0c28('0xa')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x0c28('0x1')][_0x0c28('0xf')],config['sequelize'][_0x0c28('0x10')],config[_0x0c28('0x1')][_0x0c28('0x11')],config[_0x0c28('0x1')][_0x0c28('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x0c28('0xd')][_0x0c28('0xf')],config[_0x0c28('0xd')][_0x0c28('0x10')],config[_0x0c28('0xd')][_0x0c28('0x11')],config[_0x0c28('0xd')]['options'])};db[_0x0c28('0x13')]=db[_0x0c28('0x1')]['import'](_0x0c28('0x14'));db[_0x0c28('0x15')]=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0x17'));db['VoiceContext']=db['sequelize'][_0x0c28('0x16')](_0x0c28('0x18'));db[_0x0c28('0x19')]=db[_0x0c28('0x1')]['import'](_0x0c28('0x1a'));db[_0x0c28('0x1b')]=db['sequelize'][_0x0c28('0x16')](_0x0c28('0x1c'));db[_0x0c28('0x1d')]=db[_0x0c28('0x1')]['import'](_0x0c28('0x1e'));db[_0x0c28('0x1f')]=db[_0x0c28('0x1')][_0x0c28('0x16')]('../api/voiceRecording/voiceRecording.model');db[_0x0c28('0x20')]=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0x21'));db[_0x0c28('0x22')]=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0x23'));db[_0x0c28('0x24')]=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0x25'));db['VoiceCallReport']=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0x26'));db[_0x0c28('0x27')]=db[_0x0c28('0x1')][_0x0c28('0x16')]('../api/voiceDialReport/voiceDialReport.model');db[_0x0c28('0x28')]=db['sequelize']['import'](_0x0c28('0x29'));db[_0x0c28('0x2a')]=db['sequelize']['import']('../api/voiceQueueReport/voiceQueueReport.model');db[_0x0c28('0x2b')]=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0x2c'));db[_0x0c28('0x2d')]=db[_0x0c28('0x1')]['import']('../api/trunk/trunk.model');db[_0x0c28('0x2e')]=db[_0x0c28('0x1')]['import']('../api/voiceTransferReport/voiceTransferReport.model');db[_0x0c28('0x2f')]=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0x30'));db['UserVoiceQueue']=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0x31'));db[_0x0c28('0x32')]=db[_0x0c28('0x1')]['import'](_0x0c28('0x33'));db[_0x0c28('0x34')]=db['sequelize'][_0x0c28('0x16')](_0x0c28('0x35'));db[_0x0c28('0x36')]=db['sequelize'][_0x0c28('0x16')](_0x0c28('0x37'));db[_0x0c28('0x38')]=db[_0x0c28('0x1')]['import'](_0x0c28('0x39'));db[_0x0c28('0x3a')]=db[_0x0c28('0x1')]['import'](_0x0c28('0x3b'));db['UserWhatsappQueue']=db[_0x0c28('0x1')][_0x0c28('0x16')]('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0x0c28('0x3c')]=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0x3d'));db['MailServerOut']=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0x3e'));db[_0x0c28('0x3f')]=db['sequelize'][_0x0c28('0x16')](_0x0c28('0x40'));db[_0x0c28('0x41')]=db['sequelize'][_0x0c28('0x16')](_0x0c28('0x42'));db[_0x0c28('0x43')]=db[_0x0c28('0x1')][_0x0c28('0x16')]('../api/mailSubstatus/mailSubstatus.model');db['MailInteraction']=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0x44'));db[_0x0c28('0x45')]=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0x46'));db[_0x0c28('0x47')]=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0x48'));db[_0x0c28('0x49')]=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0x4a'));db[_0x0c28('0x4b')]=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0x4c'));db[_0x0c28('0x4d')]=db[_0x0c28('0x1')]['import'](_0x0c28('0x4e'));db[_0x0c28('0x4f')]=db[_0x0c28('0x1')]['import'](_0x0c28('0x50'));db[_0x0c28('0x51')]=db[_0x0c28('0x1')]['import'](_0x0c28('0x52'));db[_0x0c28('0x53')]=db[_0x0c28('0x1')][_0x0c28('0x16')]('../api/faxInteraction/faxInteraction.model');db['FaxMessage']=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0x54'));db[_0x0c28('0x55')]=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0x56'));db[_0x0c28('0x57')]=db[_0x0c28('0x1')][_0x0c28('0x16')]('../api/faxQueueReport/faxQueueReport.model');db[_0x0c28('0x58')]=db[_0x0c28('0x1')][_0x0c28('0x16')]('../api/smsAccount/smsAccount.model');db[_0x0c28('0x59')]=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0x5a'));db[_0x0c28('0x5b')]=db['sequelize'][_0x0c28('0x16')](_0x0c28('0x5c'));db[_0x0c28('0x5d')]=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0x5e'));db[_0x0c28('0x5f')]=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0x60'));db[_0x0c28('0x61')]=db['sequelize'][_0x0c28('0x16')](_0x0c28('0x62'));db[_0x0c28('0x63')]=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0x64'));db[_0x0c28('0x65')]=db[_0x0c28('0x1')]['import'](_0x0c28('0x66'));db[_0x0c28('0x67')]=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0x68'));db[_0x0c28('0x69')]=db['sequelize'][_0x0c28('0x16')](_0x0c28('0x6a'));db[_0x0c28('0x6b')]=db['sequelize'][_0x0c28('0x16')](_0x0c28('0x6c'));db[_0x0c28('0x6d')]=db[_0x0c28('0x1')]['import'](_0x0c28('0x6e'));db[_0x0c28('0x6f')]=db[_0x0c28('0x1')]['import'](_0x0c28('0x70'));db['ChatInteraction']=db['sequelize']['import']('../api/chatInteraction/chatInteraction.model');db[_0x0c28('0x71')]=db[_0x0c28('0x1')]['import'](_0x0c28('0x72'));db[_0x0c28('0x73')]=db['sequelize'][_0x0c28('0x16')]('../api/chatOfflineMessage/chatOfflineMessage.model');db['ChatQueue']=db[_0x0c28('0x1')][_0x0c28('0x16')]('../api/chatQueue/chatQueue.model');db[_0x0c28('0x74')]=db[_0x0c28('0x1')]['import'](_0x0c28('0x75'));db[_0x0c28('0x76')]=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0x77'));db[_0x0c28('0x78')]=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0x79'));db['CmContact']=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0x7a'));db[_0x0c28('0x7b')]=db[_0x0c28('0x1')]['import'](_0x0c28('0x7c'));db[_0x0c28('0x7d')]=db['sequelize'][_0x0c28('0x16')](_0x0c28('0x7e'));db['CmHopperFinal']=db['sequelize'][_0x0c28('0x16')](_0x0c28('0x7f'));db[_0x0c28('0x80')]=db['sequelize']['import'](_0x0c28('0x81'));db[_0x0c28('0x82')]=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0x83'));db[_0x0c28('0x84')]=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0x85'));db[_0x0c28('0x86')]=db['sequelize'][_0x0c28('0x16')]('../api/action/action.model');db['Automation']=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0x87'));db[_0x0c28('0x88')]=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0x89'));db[_0x0c28('0x8a')]=db['sequelize'][_0x0c28('0x16')](_0x0c28('0x8b'));db[_0x0c28('0x8c')]=db['sequelize'][_0x0c28('0x16')](_0x0c28('0x8d'));db[_0x0c28('0x8e')]=db['sequelize']['import']('../api/interval/interval.model');db[_0x0c28('0x8f')]=db['sequelize'][_0x0c28('0x16')]('../api/pause/pause.model');db[_0x0c28('0x90')]=db['sequelize'][_0x0c28('0x16')](_0x0c28('0x91'));db[_0x0c28('0x92')]=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0x93'));db[_0x0c28('0x94')]=db[_0x0c28('0x1')]['import'](_0x0c28('0x95'));db[_0x0c28('0x96')]=db[_0x0c28('0x1')]['import'](_0x0c28('0x97'));db['Tag']=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0x98'));db['Template']=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0x99'));db['Trigger']=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0x9a'));db[_0x0c28('0x9b')]=db['sequelize'][_0x0c28('0x16')](_0x0c28('0x9c'));db[_0x0c28('0x9d')]=db['sequelize']['import'](_0x0c28('0x9e'));db[_0x0c28('0x9f')]=db['sequelize'][_0x0c28('0x16')](_0x0c28('0xa0'));db[_0x0c28('0xa1')]=db[_0x0c28('0x1')][_0x0c28('0x16')]('../api/analyticCustomReport/analyticCustomReport.model');db[_0x0c28('0xa2')]=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0xa3'));db[_0x0c28('0xa4')]=db[_0x0c28('0x1')]['import']('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0x0c28('0xa5')]=db['sequelize'][_0x0c28('0x16')](_0x0c28('0xa6'));db[_0x0c28('0xa7')]=db[_0x0c28('0x1')]['import'](_0x0c28('0xa8'));db[_0x0c28('0xa9')]=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0xaa'));db[_0x0c28('0xab')]=db[_0x0c28('0x1')]['import'](_0x0c28('0xac'));db[_0x0c28('0xad')]=db[_0x0c28('0x1')][_0x0c28('0x16')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0x0c28('0xae')]=db['sequelize']['import'](_0x0c28('0xaf'));db[_0x0c28('0xb0')]=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0xb1'));db[_0x0c28('0xb2')]=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0xb3'));db[_0x0c28('0xb4')]=db['sequelize']['import'](_0x0c28('0xb5'));db[_0x0c28('0xb6')]=db['sequelize']['import'](_0x0c28('0xb7'));db[_0x0c28('0xb8')]=db['sequelize']['import'](_0x0c28('0xb9'));db['DeskField']=db['sequelize'][_0x0c28('0x16')](_0x0c28('0xba'));db[_0x0c28('0xbb')]=db[_0x0c28('0x1')][_0x0c28('0x16')]('../api/intZohoAccount/intZohoAccount.model');db[_0x0c28('0xbc')]=db['sequelize']['import']('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0x0c28('0xbd')]=db['sequelize'][_0x0c28('0x16')](_0x0c28('0xbe'));db['ZendeskAccount']=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0xbf'));db['ZendeskConfiguration']=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0xc0'));db[_0x0c28('0xc1')]=db[_0x0c28('0x1')][_0x0c28('0x16')]('../api/intZendeskField/intZendeskField.model');db[_0x0c28('0xc2')]=db['sequelize'][_0x0c28('0x16')](_0x0c28('0xc3'));db['FreshdeskConfiguration']=db[_0x0c28('0x1')][_0x0c28('0x16')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0x0c28('0xc4')]=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0xc5'));db[_0x0c28('0xc6')]=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0xc7'));db[_0x0c28('0xc8')]=db[_0x0c28('0x1')]['import'](_0x0c28('0xc9'));db[_0x0c28('0xca')]=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0xcb'));db[_0x0c28('0xcc')]=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0xcd'));db['ServicenowConfiguration']=db[_0x0c28('0x1')][_0x0c28('0x16')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db['ServicenowField']=db['sequelize'][_0x0c28('0x16')](_0x0c28('0xce'));db['Dynamics365Account']=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0xcf'));db[_0x0c28('0xd0')]=db['sequelize'][_0x0c28('0x16')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0x0c28('0xd1')]=db[_0x0c28('0x1')][_0x0c28('0x16')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0x0c28('0xd2')]=db['sequelize']['import'](_0x0c28('0xd3'));db[_0x0c28('0xd4')]=db[_0x0c28('0x1')][_0x0c28('0x16')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db['FreshsalesField']=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0xd5'));db['Integration']=db[_0x0c28('0x1')]['import'](_0x0c28('0x9e'));db[_0x0c28('0xd6')]=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0xd7'));db[_0x0c28('0xd8')]=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0xd9'));db[_0x0c28('0xda')]=db[_0x0c28('0x1')][_0x0c28('0x16')]('../api/chatInternalMessage/chatInternalMessage.model');db['JscriptyAnswerReport']=db['sequelize']['import'](_0x0c28('0xdb'));db[_0x0c28('0xdc')]=db[_0x0c28('0x1')]['import'](_0x0c28('0xdd'));db[_0x0c28('0xde')]=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0xdf'));db[_0x0c28('0xe0')]=db['sequelize'][_0x0c28('0x16')](_0x0c28('0xe1'));db[_0x0c28('0xe2')]=db['sequelize'][_0x0c28('0x16')](_0x0c28('0xe3'));db[_0x0c28('0xe4')]=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0xe5'));db['JscriptyProject']=db[_0x0c28('0x1')][_0x0c28('0x16')]('../api/jscriptyProject/jscriptyProject.model');db['Setting']=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0xe6'));db[_0x0c28('0xe7')]=db['sequelize']['import'](_0x0c28('0xe8'));db[_0x0c28('0xe9')]=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0xea'));db[_0x0c28('0xeb')]=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0xec'));db[_0x0c28('0xed')]=db[_0x0c28('0x1')]['import'](_0x0c28('0xee'));db[_0x0c28('0xef')]=db['sequelize'][_0x0c28('0x16')](_0x0c28('0xf0'));db[_0x0c28('0xf1')]=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0xf2'));db['Campaign']=db[_0x0c28('0x1')]['import'](_0x0c28('0xf3'));db[_0x0c28('0xf4')]=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0xf5'));db[_0x0c28('0xf6')]=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0xf7'));db[_0x0c28('0xf8')]=db[_0x0c28('0x1')]['import'](_0x0c28('0xf9'));db[_0x0c28('0xfa')]=db[_0x0c28('0x1')][_0x0c28('0x16')]('../api/mailTransferReport/mailTransferReport.model');db[_0x0c28('0xfb')]=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0xfc'));db[_0x0c28('0xfd')]=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0xfe'));db['OpenchannelTransferReport']=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0xff'));db[_0x0c28('0x100')]=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0x101'));db[_0x0c28('0x102')]=db['sequelize'][_0x0c28('0x16')](_0x0c28('0x103'));db['VoicePrefix']=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0x104'));db[_0x0c28('0x105')]=db[_0x0c28('0x1')]['import']('../api/userProfile/userProfile.model');db[_0x0c28('0x106')]=db['sequelize'][_0x0c28('0x16')](_0x0c28('0x107'));db[_0x0c28('0x108')]=db[_0x0c28('0x1')][_0x0c28('0x16')]('../api/userProfileResource/userProfileResource.model');db[_0x0c28('0x109')]=db[_0x0c28('0x1')]['import'](_0x0c28('0x10a'));db[_0x0c28('0x10b')]=db['sequelize'][_0x0c28('0x16')](_0x0c28('0x10c'));db['WhatsappApplication']=db[_0x0c28('0x1')]['import'](_0x0c28('0x10d'));db[_0x0c28('0x10e')]=db[_0x0c28('0x1')][_0x0c28('0x16')]('../api/whatsappInteraction/whatsappInteraction.model');db['WhatsappMessage']=db[_0x0c28('0x1')]['import']('../api/whatsappMessage/whatsappMessage.model');db[_0x0c28('0x10f')]=db['sequelize'][_0x0c28('0x16')](_0x0c28('0x110'));db['WhatsappTransferReport']=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0x111'));db[_0x0c28('0x112')]=db[_0x0c28('0x1')]['import'](_0x0c28('0x113'));db[_0x0c28('0x114')]=db[_0x0c28('0x1')][_0x0c28('0x16')]('../api/cloudProvider/cloudProvider.model');db[_0x0c28('0x115')]=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0x116'));db[_0x0c28('0x117')]=db[_0x0c28('0x1')][_0x0c28('0x16')](_0x0c28('0x118'));db['UserVoicePrefix']=db['sequelize'][_0x0c28('0x16')](_0x0c28('0x119'));db[_0x0c28('0x11a')]=db['sequelize'][_0x0c28('0x16')](_0x0c28('0x11b'));db[_0x0c28('0x13')][_0x0c28('0x11c')](db[_0x0c28('0x22')],{'as':_0x0c28('0x22'),'onDelete':_0x0c28('0x11d'),'foreignKey':_0x0c28('0x11e')});db[_0x0c28('0x13')][_0x0c28('0x11c')](db['UserSetting'],{'as':_0x0c28('0x11f'),'onDelete':_0x0c28('0x11d'),'foreignKey':_0x0c28('0x11e')});db['User'][_0x0c28('0x120')](db[_0x0c28('0x1f')],{'as':_0x0c28('0x121'),'foreignKey':_0x0c28('0x11e')});db['User'][_0x0c28('0x120')](db[_0x0c28('0x2f')],{'as':_0x0c28('0x122'),'foreignKey':_0x0c28('0x11e')});db[_0x0c28('0x13')]['hasMany'](db[_0x0c28('0x19')],{'as':'Extensions','onDelete':'cascade','hooks':!![]});db['User'][_0x0c28('0x120')](db[_0x0c28('0x123')],{'as':_0x0c28('0x124'),'foreignKey':_0x0c28('0x11e')});db['User']['hasMany'](db[_0x0c28('0x80')],{'as':_0x0c28('0x125'),'foreignKey':_0x0c28('0x11e')});db[_0x0c28('0x13')][_0x0c28('0x120')](db['ReportAgentPreview'],{'as':_0x0c28('0x82'),'foreignKey':_0x0c28('0x11e')});db['User'][_0x0c28('0x120')](db[_0x0c28('0x65')],{'as':'OpenchannelInteractions','foreignKey':_0x0c28('0x11e')});db[_0x0c28('0x13')][_0x0c28('0x120')](db[_0x0c28('0x126')],{'as':_0x0c28('0x127'),'foreignKey':_0x0c28('0x11e')});db['User'][_0x0c28('0x120')](db[_0x0c28('0x5b')],{'as':'SmsInteractions','foreignKey':'UserId'});db[_0x0c28('0x13')][_0x0c28('0x120')](db[_0x0c28('0x53')],{'as':_0x0c28('0x128'),'foreignKey':_0x0c28('0x11e')});db['User']['hasMany'](db[_0x0c28('0x129')],{'as':_0x0c28('0x12a'),'foreignKey':_0x0c28('0x11e')});db[_0x0c28('0x13')][_0x0c28('0x120')](db[_0x0c28('0x10e')],{'as':'WhatsappInteractions','foreignKey':_0x0c28('0x11e')});db[_0x0c28('0x13')]['hasMany'](db[_0x0c28('0x109')],{'as':'UserNotifications','foreignKey':_0x0c28('0x12b')});db[_0x0c28('0x13')]['belongsTo'](db[_0x0c28('0x105')],{'as':_0x0c28('0x105'),'foreignKey':_0x0c28('0x12c')});db[_0x0c28('0x13')][_0x0c28('0x12d')](db['ChatGroup'],{'as':_0x0c28('0x12e'),'through':_0x0c28('0x12f')});db[_0x0c28('0x13')][_0x0c28('0x12d')](db[_0x0c28('0x130')],{'as':_0x0c28('0x131'),'through':_0x0c28('0x132')});db['User'][_0x0c28('0x12d')](db[_0x0c28('0x102')],{'as':'Lists','through':_0x0c28('0x133')});db[_0x0c28('0x13')][_0x0c28('0x12d')](db[_0x0c28('0xef')],{'through':_0x0c28('0x134')});db[_0x0c28('0x13')][_0x0c28('0x12d')](db['MailInteraction'],{'as':'MailInteractions','through':_0x0c28('0x135')});db[_0x0c28('0x13')][_0x0c28('0x12d')](db[_0x0c28('0x126')],{'as':_0x0c28('0x127'),'through':_0x0c28('0x136')});db[_0x0c28('0x13')][_0x0c28('0x12d')](db[_0x0c28('0x53')],{'as':_0x0c28('0x128'),'through':'user_has_fax_interactions'});db[_0x0c28('0x13')]['belongsToMany'](db[_0x0c28('0x5b')],{'as':'SmsInteractions','through':_0x0c28('0x137')});db[_0x0c28('0x13')][_0x0c28('0x12d')](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','through':'user_has_openchannel_interactions'});db[_0x0c28('0x13')][_0x0c28('0x12d')](db[_0x0c28('0x10e')],{'as':_0x0c28('0x138'),'through':_0x0c28('0x139')});db[_0x0c28('0x13')][_0x0c28('0x12d')](db['VoiceQueue'],{'as':_0x0c28('0x13a'),'through':_0x0c28('0x13b'),'required':![]});db[_0x0c28('0x13')]['belongsToMany'](db[_0x0c28('0x13c')],{'as':_0x0c28('0x13d'),'through':'UserVoicePrefix','required':![]});db[_0x0c28('0x13')][_0x0c28('0x12d')](db[_0x0c28('0x41')],{'as':'MailQueues','through':_0x0c28('0x34'),'required':![]});db[_0x0c28('0x13')][_0x0c28('0x12d')](db[_0x0c28('0x13e')],{'as':_0x0c28('0x13f'),'through':_0x0c28('0x32'),'required':![],'hooks':!![]});db[_0x0c28('0x13')][_0x0c28('0x12d')](db[_0x0c28('0x55')],{'as':'FaxQueues','through':'UserFaxQueue','required':![]});db[_0x0c28('0x13')]['belongsToMany'](db[_0x0c28('0x5f')],{'as':'SmsQueues','through':'UserSmsQueue','required':![]});db[_0x0c28('0x13')]['belongsToMany'](db[_0x0c28('0x69')],{'as':_0x0c28('0x140'),'through':_0x0c28('0x3a'),'required':![]});db[_0x0c28('0x13')][_0x0c28('0x12d')](db[_0x0c28('0x112')],{'as':'WhatsappQueues','through':_0x0c28('0x141'),'required':![]});db[_0x0c28('0x13')][_0x0c28('0x12d')](db[_0x0c28('0x102')],{'through':_0x0c28('0x133')});db[_0x0c28('0x13')][_0x0c28('0x12d')](db[_0x0c28('0x6b')],{'as':_0x0c28('0x142'),'through':_0x0c28('0x143')});db[_0x0c28('0x13')][_0x0c28('0x12d')](db[_0x0c28('0x4f')],{'as':'FaxAccounts','through':_0x0c28('0x144')});db['User'][_0x0c28('0x12d')](db[_0x0c28('0x3f')],{'as':_0x0c28('0x145'),'through':_0x0c28('0x146')});db['User'][_0x0c28('0x12d')](db['OpenchannelAccount'],{'as':_0x0c28('0x147'),'through':'user_has_openchannel_accounts'});db['User']['belongsToMany'](db[_0x0c28('0x58')],{'as':_0x0c28('0x148'),'through':_0x0c28('0x149')});db[_0x0c28('0x13')][_0x0c28('0x12d')](db[_0x0c28('0x10b')],{'as':_0x0c28('0x14a'),'through':_0x0c28('0x14b')});db[_0x0c28('0x13')]['belongsToMany'](db[_0x0c28('0xe9')],{'as':'SquareProjects','through':_0x0c28('0x14c')});db[_0x0c28('0x15')][_0x0c28('0x120')](db['VoiceExtension'],{'as':_0x0c28('0x14d'),'onDelete':'cascade','foreignKey':'ChanSpyId'});db['VoiceContext']['hasMany'](db[_0x0c28('0x19')],{'onDelete':_0x0c28('0x11d')});db[_0x0c28('0x19')][_0x0c28('0x120')](db[_0x0c28('0x19')],{'as':_0x0c28('0x14e'),'onDelete':_0x0c28('0x11d')});db[_0x0c28('0x1b')][_0x0c28('0x12d')](db[_0x0c28('0x96')],{'as':_0x0c28('0x14f'),'through':_0x0c28('0x150')});db[_0x0c28('0x1d')][_0x0c28('0x120')](db[_0x0c28('0x2f')],{'as':_0x0c28('0x151'),'foreignKey':_0x0c28('0x152')});db['VoiceQueue'][_0x0c28('0x120')](db[_0x0c28('0x7b')],{'as':_0x0c28('0x153'),'foreignKey':_0x0c28('0x152')});db[_0x0c28('0x1d')][_0x0c28('0x120')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0x0c28('0x152')});db[_0x0c28('0x1d')][_0x0c28('0x120')](db[_0x0c28('0x80')],{'as':_0x0c28('0x154'),'foreignKey':_0x0c28('0x152')});db['VoiceQueue'][_0x0c28('0x120')](db[_0x0c28('0x82')],{'as':_0x0c28('0x82'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x0c28('0x120')](db['CmHopperBlack'],{'as':'HopperBlacks','foreignKey':_0x0c28('0x152')});db[_0x0c28('0x1d')][_0x0c28('0x120')](db['JscriptySessionReport'],{'as':_0x0c28('0x155'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x0c28('0x156')](db[_0x0c28('0x2d')],{'as':_0x0c28('0x2d'),'foreignKey':_0x0c28('0x157')});db[_0x0c28('0x1d')]['belongsTo'](db[_0x0c28('0x2d')],{'as':'TrunkBackup','foreignKey':_0x0c28('0x158')});db[_0x0c28('0x1d')][_0x0c28('0x156')](db[_0x0c28('0x8e')],{'as':_0x0c28('0x8e'),'foreignKey':_0x0c28('0x159')});db[_0x0c28('0x1d')][_0x0c28('0x156')](db[_0x0c28('0x8f')],{'as':_0x0c28('0x15a'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x0c28('0x1d')][_0x0c28('0x12d')](db[_0x0c28('0x102')],{'as':_0x0c28('0x15b'),'through':_0x0c28('0x15c')});db['VoiceQueue'][_0x0c28('0x12d')](db[_0x0c28('0x13')],{'as':'Agents','through':_0x0c28('0x13b')});db[_0x0c28('0x1d')]['belongsToMany'](db[_0x0c28('0xef')],{'as':_0x0c28('0x15d'),'through':_0x0c28('0x115')});db[_0x0c28('0x1d')][_0x0c28('0x12d')](db[_0x0c28('0x102')],{'as':_0x0c28('0x15e'),'through':_0x0c28('0x15f')});db['VoiceRecording'][_0x0c28('0x156')](db[_0x0c28('0x13')],{'as':'User','foreignKey':_0x0c28('0x11e')});db[_0x0c28('0x20')]['belongsTo'](db[_0x0c28('0x13')],{'as':_0x0c28('0x13'),'foreignKey':_0x0c28('0x11e')});db[_0x0c28('0x22')]['hasMany'](db[_0x0c28('0x24')],{'as':_0x0c28('0x160'),'onDelete':'cascade','foreignKey':_0x0c28('0x161'),'sourceKey':_0x0c28('0x162')});db[_0x0c28('0x24')]['belongsTo'](db[_0x0c28('0x22')],{'foreignKey':_0x0c28('0x161'),'targetKey':_0x0c28('0x162')});db[_0x0c28('0x163')][_0x0c28('0x120')](db['VoiceQueueReport'],{'as':_0x0c28('0x164'),'foreignKey':_0x0c28('0x165'),'constraints':![]});db[_0x0c28('0x163')]['hasMany'](db[_0x0c28('0x28')],{'as':_0x0c28('0x166'),'foreignKey':_0x0c28('0x165'),'constraints':![]});db[_0x0c28('0x163')][_0x0c28('0x156')](db[_0x0c28('0x13')],{'as':_0x0c28('0x13'),'foreignKey':'UserId'});db[_0x0c28('0x163')]['belongsTo'](db['CmContact'],{'as':_0x0c28('0x167'),'foreignKey':'ContactId'});db[_0x0c28('0x3c')][_0x0c28('0x156')](db[_0x0c28('0x3f')],{'as':_0x0c28('0x3f'),'foreignKey':_0x0c28('0x168')});db[_0x0c28('0x3c')][_0x0c28('0x156')](db[_0x0c28('0x114')],{'as':_0x0c28('0x114'),'foreignKey':_0x0c28('0x169'),'onDelete':_0x0c28('0x16a')});db[_0x0c28('0x16b')][_0x0c28('0x156')](db[_0x0c28('0x3f')],{'as':_0x0c28('0x3f'),'foreignKey':_0x0c28('0x168')});db[_0x0c28('0x16b')][_0x0c28('0x156')](db[_0x0c28('0x114')],{'as':_0x0c28('0x114'),'foreignKey':_0x0c28('0x169'),'onDelete':_0x0c28('0x16a')});db[_0x0c28('0x3f')]['hasOne'](db['MailServerIn'],{'as':_0x0c28('0x16c'),'onDelete':_0x0c28('0x11d')});db[_0x0c28('0x3f')]['hasOne'](db[_0x0c28('0x16b')],{'as':_0x0c28('0x16d'),'onDelete':'cascade'});db['MailAccount'][_0x0c28('0x120')](db[_0x0c28('0x8a')],{'as':_0x0c28('0x16e'),'foreignKey':_0x0c28('0x168'),'onDelete':_0x0c28('0x11d')});db['MailAccount']['hasMany'](db[_0x0c28('0x88')],{'as':_0x0c28('0x16f'),'foreignKey':_0x0c28('0x168')});db[_0x0c28('0x3f')][_0x0c28('0x120')](db[_0x0c28('0x45')],{'as':_0x0c28('0x160'),'foreignKey':_0x0c28('0x168')});db[_0x0c28('0x3f')]['hasMany'](db[_0x0c28('0x129')],{'as':'Interactions'});db['MailAccount']['hasMany'](db[_0x0c28('0x47')],{'as':_0x0c28('0x14e')});db[_0x0c28('0x3f')][_0x0c28('0x156')](db[_0x0c28('0x102')],{'as':_0x0c28('0x170'),'foreignKey':'ListId'});db[_0x0c28('0x3f')][_0x0c28('0x156')](db[_0x0c28('0x171')],{'as':_0x0c28('0x171'),'foreignKey':'TemplateId'});db[_0x0c28('0x3f')][_0x0c28('0x156')](db[_0x0c28('0x8f')],{'as':_0x0c28('0x15a'),'foreignKey':_0x0c28('0x172')});db[_0x0c28('0x3f')]['belongsToMany'](db['User'],{'as':_0x0c28('0x173'),'through':_0x0c28('0x146')});db[_0x0c28('0x41')][_0x0c28('0x12d')](db[_0x0c28('0x13')],{'as':_0x0c28('0x173'),'through':_0x0c28('0x34')});db[_0x0c28('0x41')][_0x0c28('0x12d')](db[_0x0c28('0xef')],{'through':_0x0c28('0x174'),'as':'Teams'});db[_0x0c28('0x129')][_0x0c28('0x120')](db[_0x0c28('0x45')],{'as':'Messages','onDelete':_0x0c28('0x11d'),'foreignKey':_0x0c28('0x175')});db[_0x0c28('0x129')]['belongsTo'](db[_0x0c28('0x3f')],{'as':_0x0c28('0x176'),'foreignKey':'MailAccountId'});db[_0x0c28('0x129')][_0x0c28('0x156')](db[_0x0c28('0x130')],{'as':_0x0c28('0x167'),'foreignKey':_0x0c28('0x177')});db['MailInteraction'][_0x0c28('0x156')](db[_0x0c28('0x13')],{'as':'Owner','foreignKey':_0x0c28('0x11e')});db['MailInteraction'][_0x0c28('0x12d')](db[_0x0c28('0x178')],{'through':_0x0c28('0x179'),'as':_0x0c28('0x17a')});db[_0x0c28('0x129')][_0x0c28('0x12d')](db[_0x0c28('0x178')],{'through':_0x0c28('0x179'),'as':_0x0c28('0x17b')});db['MailInteraction'][_0x0c28('0x12d')](db['User'],{'as':_0x0c28('0x17c'),'through':'user_has_mail_interactions','foreignKey':_0x0c28('0x175')});db['MailMessage'][_0x0c28('0x120')](db[_0x0c28('0xf6')],{'as':_0x0c28('0x17d'),'onDelete':_0x0c28('0x11d')});db[_0x0c28('0x45')][_0x0c28('0x156')](db[_0x0c28('0x13')],{'as':_0x0c28('0x13')});db[_0x0c28('0x45')][_0x0c28('0x156')](db['CmContact'],{'onDelete':_0x0c28('0x11d'),'as':_0x0c28('0x167')});db[_0x0c28('0x45')][_0x0c28('0x156')](db[_0x0c28('0x129')],{'as':_0x0c28('0x17e'),'foreignKey':_0x0c28('0x175')});db['MailMessage'][_0x0c28('0x156')](db[_0x0c28('0x3f')],{'as':_0x0c28('0x176'),'foreignKey':_0x0c28('0x168')});db[_0x0c28('0x45')][_0x0c28('0x156')](db[_0x0c28('0x6b')],{'as':_0x0c28('0x6b'),'foreignKey':'ChatWebsiteId'});db[_0x0c28('0x45')][_0x0c28('0x156')](db[_0x0c28('0x73')],{'as':'ChatOfflineMessage','foreignKey':_0x0c28('0x17f')});db[_0x0c28('0x47')]['belongsTo'](db['User'],{'onDelete':_0x0c28('0x16a')});db[_0x0c28('0x47')][_0x0c28('0x156')](db['MailQueue'],{'onDelete':_0x0c28('0x16a')});db[_0x0c28('0x47')][_0x0c28('0x156')](db[_0x0c28('0x3f')],{'onDelete':_0x0c28('0x16a')});db['MailApplication'][_0x0c28('0x156')](db[_0x0c28('0x8e')],{'onDelete':'restrict','foreignKey':_0x0c28('0x159')});db[_0x0c28('0x47')]['belongsTo'](db['Tag'],{'onDelete':_0x0c28('0x16a'),'foreignKey':_0x0c28('0x180')});db[_0x0c28('0x49')]['belongsTo'](db[_0x0c28('0x3f')],{});db['MailQueueReport'][_0x0c28('0x156')](db[_0x0c28('0x102')],{'as':_0x0c28('0x170'),'foreignKey':_0x0c28('0x181')});db[_0x0c28('0x49')][_0x0c28('0x156')](db[_0x0c28('0x130')],{'as':_0x0c28('0x167'),'foreignKey':_0x0c28('0x177')});db[_0x0c28('0x49')][_0x0c28('0x156')](db[_0x0c28('0x129')],{});db[_0x0c28('0x49')][_0x0c28('0x156')](db[_0x0c28('0x45')],{});db['MailQueueReport'][_0x0c28('0x156')](db[_0x0c28('0x13')],{});db[_0x0c28('0x49')][_0x0c28('0x156')](db[_0x0c28('0x41')],{});db[_0x0c28('0x4b')][_0x0c28('0x120')](db['DashboardItem'],{'as':'Items','onDelete':_0x0c28('0x11d')});db[_0x0c28('0x4f')][_0x0c28('0x120')](db[_0x0c28('0x8a')],{'as':_0x0c28('0x16e'),'foreignKey':'FaxAccountId','onDelete':_0x0c28('0x11d')});db['FaxAccount'][_0x0c28('0x120')](db[_0x0c28('0x88')],{'as':'Answers','foreignKey':_0x0c28('0x182')});db['FaxAccount'][_0x0c28('0x120')](db['FaxInteraction'],{'as':'Interactions'});db['FaxAccount']['hasMany'](db[_0x0c28('0x51')],{'as':_0x0c28('0x14e')});db[_0x0c28('0x4f')]['hasMany'](db['VoiceExtension'],{'as':_0x0c28('0x183'),'onDelete':_0x0c28('0x11d')});db['FaxAccount'][_0x0c28('0x120')](db[_0x0c28('0x184')],{'as':_0x0c28('0x160')});db[_0x0c28('0x4f')]['belongsTo'](db[_0x0c28('0x2d')],{'as':_0x0c28('0x2d')});db[_0x0c28('0x4f')][_0x0c28('0x156')](db[_0x0c28('0x102')],{'as':'List','foreignKey':_0x0c28('0x181')});db[_0x0c28('0x4f')][_0x0c28('0x156')](db[_0x0c28('0x8f')],{'as':_0x0c28('0x15a'),'foreignKey':_0x0c28('0x172')});db[_0x0c28('0x4f')]['belongsToMany'](db[_0x0c28('0x13')],{'as':_0x0c28('0x173'),'through':_0x0c28('0x144')});db[_0x0c28('0x51')][_0x0c28('0x156')](db[_0x0c28('0x13')],{'onDelete':_0x0c28('0x16a')});db[_0x0c28('0x51')][_0x0c28('0x156')](db[_0x0c28('0x55')],{'onDelete':'restrict'});db[_0x0c28('0x51')][_0x0c28('0x156')](db[_0x0c28('0x4f')],{'onDelete':_0x0c28('0x16a')});db[_0x0c28('0x51')][_0x0c28('0x156')](db[_0x0c28('0x178')],{'onDelete':_0x0c28('0x16a'),'foreignKey':_0x0c28('0x180')});db['FaxInteraction']['hasMany'](db[_0x0c28('0x184')],{'as':_0x0c28('0x160'),'onDelete':_0x0c28('0x11d'),'foreignKey':_0x0c28('0x185')});db['FaxInteraction'][_0x0c28('0x156')](db[_0x0c28('0x4f')],{'as':_0x0c28('0x176'),'foreignKey':_0x0c28('0x182')});db[_0x0c28('0x53')][_0x0c28('0x156')](db[_0x0c28('0x130')],{'as':'Contact','foreignKey':_0x0c28('0x177')});db[_0x0c28('0x53')]['belongsTo'](db['User'],{'as':_0x0c28('0x186'),'foreignKey':_0x0c28('0x11e')});db[_0x0c28('0x53')][_0x0c28('0x12d')](db[_0x0c28('0x178')],{'through':_0x0c28('0x187'),'as':_0x0c28('0x17a')});db[_0x0c28('0x53')][_0x0c28('0x12d')](db[_0x0c28('0x178')],{'through':_0x0c28('0x187'),'as':_0x0c28('0x17b')});db[_0x0c28('0x53')][_0x0c28('0x12d')](db['User'],{'as':'Users','through':_0x0c28('0x188'),'foreignKey':'FaxInteractionId'});db['FaxMessage'][_0x0c28('0x156')](db['User'],{'onDelete':_0x0c28('0x11d'),'as':_0x0c28('0x13')});db[_0x0c28('0x184')][_0x0c28('0x156')](db[_0x0c28('0x53')],{'as':_0x0c28('0x17e'),'foreignKey':_0x0c28('0x185')});db[_0x0c28('0x184')][_0x0c28('0x156')](db[_0x0c28('0x130')],{'onDelete':'cascade','as':'Contact'});db[_0x0c28('0x184')]['belongsTo'](db[_0x0c28('0xf6')],{'as':'Attachment','foreignKey':_0x0c28('0x189')});db[_0x0c28('0x184')][_0x0c28('0x156')](db[_0x0c28('0x4f')],{'as':'Account','foreignKey':'FaxAccountId'});db[_0x0c28('0x55')][_0x0c28('0x12d')](db[_0x0c28('0x13')],{'as':_0x0c28('0x173'),'through':_0x0c28('0x36')});db['FaxQueue']['belongsToMany'](db[_0x0c28('0xef')],{'through':_0x0c28('0x18a'),'as':_0x0c28('0x15d')});db[_0x0c28('0x57')]['belongsTo'](db[_0x0c28('0x4f')],{});db['FaxQueueReport'][_0x0c28('0x156')](db['CmList'],{'as':_0x0c28('0x170'),'foreignKey':'ListId'});db[_0x0c28('0x57')][_0x0c28('0x156')](db[_0x0c28('0x130')],{'as':'Contact','foreignKey':_0x0c28('0x177')});db[_0x0c28('0x57')][_0x0c28('0x156')](db[_0x0c28('0x53')],{});db['FaxQueueReport'][_0x0c28('0x156')](db[_0x0c28('0x184')],{});db[_0x0c28('0x57')][_0x0c28('0x156')](db[_0x0c28('0x13')],{});db['FaxQueueReport']['belongsTo'](db[_0x0c28('0x55')],{});db[_0x0c28('0x58')][_0x0c28('0x120')](db[_0x0c28('0x8a')],{'as':'Dispositions','foreignKey':_0x0c28('0x18b'),'onDelete':_0x0c28('0x11d')});db[_0x0c28('0x58')][_0x0c28('0x120')](db[_0x0c28('0x88')],{'as':_0x0c28('0x16f'),'foreignKey':_0x0c28('0x18b')});db[_0x0c28('0x58')][_0x0c28('0x120')](db[_0x0c28('0x5d')],{'as':'Messages','foreignKey':_0x0c28('0x18b')});db[_0x0c28('0x58')][_0x0c28('0x120')](db[_0x0c28('0x5b')],{'as':'Interactions'});db['SmsAccount'][_0x0c28('0x120')](db[_0x0c28('0x59')],{'as':_0x0c28('0x14e')});db[_0x0c28('0x58')]['belongsTo'](db[_0x0c28('0x102')],{'as':_0x0c28('0x170'),'foreignKey':_0x0c28('0x181')});db['SmsAccount'][_0x0c28('0x156')](db[_0x0c28('0x8f')],{'as':_0x0c28('0x15a'),'foreignKey':_0x0c28('0x172')});db[_0x0c28('0x58')][_0x0c28('0x12d')](db[_0x0c28('0x13')],{'as':_0x0c28('0x173'),'through':_0x0c28('0x149')});db['SmsApplication'][_0x0c28('0x156')](db['User'],{'onDelete':_0x0c28('0x16a')});db[_0x0c28('0x59')][_0x0c28('0x156')](db['SmsQueue'],{'onDelete':_0x0c28('0x16a')});db[_0x0c28('0x59')][_0x0c28('0x156')](db[_0x0c28('0x58')],{'onDelete':_0x0c28('0x16a')});db[_0x0c28('0x59')][_0x0c28('0x156')](db[_0x0c28('0x8e')],{'onDelete':_0x0c28('0x16a'),'foreignKey':'IntervalId'});db[_0x0c28('0x59')]['belongsTo'](db[_0x0c28('0x178')],{'onDelete':'restrict','foreignKey':_0x0c28('0x180')});db[_0x0c28('0x5b')]['hasMany'](db[_0x0c28('0x5d')],{'as':_0x0c28('0x160'),'onDelete':_0x0c28('0x11d'),'foreignKey':_0x0c28('0x18c')});db[_0x0c28('0x5b')][_0x0c28('0x156')](db[_0x0c28('0x58')],{'as':_0x0c28('0x176'),'foreignKey':'SmsAccountId'});db[_0x0c28('0x5b')]['belongsTo'](db[_0x0c28('0x130')],{'as':_0x0c28('0x167'),'foreignKey':'ContactId'});db['SmsInteraction'][_0x0c28('0x156')](db['User'],{'as':'Owner','foreignKey':_0x0c28('0x11e')});db['SmsInteraction']['belongsToMany'](db[_0x0c28('0x178')],{'through':'sms_interaction_has_tags','as':_0x0c28('0x17a')});db['SmsInteraction']['belongsToMany'](db[_0x0c28('0x178')],{'through':_0x0c28('0x18d'),'as':'ThroughTags'});db[_0x0c28('0x5b')]['belongsToMany'](db[_0x0c28('0x13')],{'as':_0x0c28('0x17c'),'through':_0x0c28('0x137'),'foreignKey':_0x0c28('0x18c')});db[_0x0c28('0x5d')][_0x0c28('0x156')](db[_0x0c28('0x13')],{'as':_0x0c28('0x13')});db[_0x0c28('0x5d')]['belongsTo'](db[_0x0c28('0x130')],{'onDelete':'cascade','as':'Contact'});db[_0x0c28('0x5d')]['belongsTo'](db[_0x0c28('0x5b')],{'onDelete':'cascade','as':_0x0c28('0x17e'),'foreignKey':_0x0c28('0x18c')});db['SmsMessage']['belongsTo'](db['SmsAccount'],{'as':'Account','foreignKey':_0x0c28('0x18b')});db['SmsQueue']['belongsToMany'](db[_0x0c28('0x13')],{'as':_0x0c28('0x173'),'through':_0x0c28('0x38'),'foreignKey':_0x0c28('0x18e')});db[_0x0c28('0x5f')][_0x0c28('0x12d')](db[_0x0c28('0xef')],{'through':_0x0c28('0x18f'),'as':_0x0c28('0x15d')});db['OpenchannelAccount'][_0x0c28('0x120')](db['Disposition'],{'as':_0x0c28('0x16e'),'foreignKey':_0x0c28('0x190'),'onDelete':_0x0c28('0x11d')});db[_0x0c28('0x61')][_0x0c28('0x120')](db[_0x0c28('0x88')],{'as':_0x0c28('0x16f'),'foreignKey':'OpenchannelAccountId'});db[_0x0c28('0x61')][_0x0c28('0x120')](db[_0x0c28('0x65')],{'as':'Interactions','foreignKey':_0x0c28('0x190')});db[_0x0c28('0x61')][_0x0c28('0x120')](db[_0x0c28('0x67')],{'as':'Messages','foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x0c28('0x120')](db[_0x0c28('0x63')],{'as':'Applications','foreignKey':_0x0c28('0x190')});db[_0x0c28('0x61')][_0x0c28('0x156')](db[_0x0c28('0x102')],{'as':_0x0c28('0x170'),'foreignKey':_0x0c28('0x181')});db[_0x0c28('0x61')][_0x0c28('0x156')](db[_0x0c28('0x8f')],{'as':_0x0c28('0x15a'),'foreignKey':_0x0c28('0x172')});db[_0x0c28('0x61')][_0x0c28('0x12d')](db[_0x0c28('0x13')],{'as':_0x0c28('0x173'),'through':'user_has_openchannel_accounts'});db[_0x0c28('0x63')][_0x0c28('0x156')](db[_0x0c28('0x13')],{'onDelete':_0x0c28('0x16a')});db['OpenchannelApplication'][_0x0c28('0x156')](db[_0x0c28('0x69')],{'onDelete':'restrict','foreignKey':_0x0c28('0x191')});db['OpenchannelApplication'][_0x0c28('0x156')](db[_0x0c28('0x61')],{'onDelete':_0x0c28('0x16a'),'foreignKey':'OpenchannelAccountId'});db[_0x0c28('0x63')]['belongsTo'](db[_0x0c28('0x8e')],{'onDelete':_0x0c28('0x16a'),'foreignKey':_0x0c28('0x159')});db[_0x0c28('0x63')]['belongsTo'](db[_0x0c28('0x178')],{'onDelete':_0x0c28('0x16a'),'foreignKey':_0x0c28('0x180')});db[_0x0c28('0x65')][_0x0c28('0x120')](db[_0x0c28('0x67')],{'as':_0x0c28('0x160'),'onDelete':'cascade','foreignKey':_0x0c28('0x192')});db['OpenchannelInteraction'][_0x0c28('0x156')](db[_0x0c28('0x61')],{'as':_0x0c28('0x176'),'foreignKey':_0x0c28('0x190')});db[_0x0c28('0x65')]['belongsTo'](db[_0x0c28('0x130')],{'as':_0x0c28('0x167'),'foreignKey':_0x0c28('0x177')});db['OpenchannelInteraction'][_0x0c28('0x156')](db[_0x0c28('0x13')],{'as':_0x0c28('0x186'),'foreignKey':_0x0c28('0x11e')});db[_0x0c28('0x65')][_0x0c28('0x12d')](db[_0x0c28('0x178')],{'through':_0x0c28('0x193'),'as':_0x0c28('0x17a')});db[_0x0c28('0x65')][_0x0c28('0x12d')](db[_0x0c28('0x178')],{'through':_0x0c28('0x193'),'as':_0x0c28('0x17b')});db[_0x0c28('0x65')][_0x0c28('0x12d')](db[_0x0c28('0x13')],{'as':_0x0c28('0x17c'),'through':_0x0c28('0x194'),'foreignKey':_0x0c28('0x192')});db['OpenchannelMessage'][_0x0c28('0x156')](db[_0x0c28('0x13')],{'onDelete':'cascade','as':_0x0c28('0x13')});db[_0x0c28('0x67')]['belongsTo'](db[_0x0c28('0x130')],{'onDelete':_0x0c28('0x11d'),'as':'Contact'});db[_0x0c28('0x67')]['belongsTo'](db[_0x0c28('0x65')],{'onDelete':_0x0c28('0x11d'),'as':_0x0c28('0x17e'),'foreignKey':_0x0c28('0x192')});db[_0x0c28('0x67')][_0x0c28('0x156')](db[_0x0c28('0xf6')],{'as':_0x0c28('0xf6'),'foreignKey':_0x0c28('0x189')});db[_0x0c28('0x67')][_0x0c28('0x156')](db[_0x0c28('0x61')],{'as':_0x0c28('0x176'),'foreignKey':'OpenchannelAccountId'});db[_0x0c28('0x69')][_0x0c28('0x12d')](db[_0x0c28('0x13')],{'as':_0x0c28('0x173'),'through':'UserOpenchannelQueue','foreignKey':_0x0c28('0x191')});db['OpenchannelQueue'][_0x0c28('0x12d')](db[_0x0c28('0xef')],{'through':_0x0c28('0x195'),'as':_0x0c28('0x15d')});db[_0x0c28('0x6b')][_0x0c28('0x120')](db[_0x0c28('0x8a')],{'as':'Dispositions','foreignKey':_0x0c28('0x196'),'onDelete':_0x0c28('0x11d')});db['ChatWebsite'][_0x0c28('0x120')](db[_0x0c28('0x88')],{'as':'Answers','foreignKey':_0x0c28('0x196')});db[_0x0c28('0x6b')][_0x0c28('0x120')](db[_0x0c28('0x76')],{'as':'ProactiveActions'});db[_0x0c28('0x6b')][_0x0c28('0x120')](db[_0x0c28('0x126')],{'as':_0x0c28('0x197')});db['ChatWebsite'][_0x0c28('0x120')](db[_0x0c28('0x6f')],{'as':_0x0c28('0x14e')});db[_0x0c28('0x6b')][_0x0c28('0x120')](db['ChatMessage'],{'as':_0x0c28('0x160')});db[_0x0c28('0x6b')][_0x0c28('0x156')](db[_0x0c28('0x102')],{'as':_0x0c28('0x170'),'foreignKey':_0x0c28('0x181')});db[_0x0c28('0x6b')][_0x0c28('0x156')](db[_0x0c28('0x8e')],{'as':_0x0c28('0x8e'),'foreignKey':_0x0c28('0x159')});db[_0x0c28('0x6b')][_0x0c28('0x156')](db[_0x0c28('0x3f')],{'as':_0x0c28('0x3f'),'foreignKey':_0x0c28('0x168')});db[_0x0c28('0x6b')][_0x0c28('0x156')](db['Pause'],{'as':_0x0c28('0x15a'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x0c28('0x6b')][_0x0c28('0x12d')](db[_0x0c28('0x13')],{'as':_0x0c28('0x173'),'through':_0x0c28('0x143')});db[_0x0c28('0x6d')][_0x0c28('0x156')](db[_0x0c28('0x61')],{});db[_0x0c28('0x6d')]['belongsTo'](db[_0x0c28('0x102')],{'as':_0x0c28('0x170'),'foreignKey':_0x0c28('0x181')});db[_0x0c28('0x6d')][_0x0c28('0x156')](db[_0x0c28('0x130')],{'as':'Contact','foreignKey':_0x0c28('0x177')});db['OpenchannelQueueReport'][_0x0c28('0x156')](db['OpenchannelInteraction'],{});db[_0x0c28('0x6d')]['belongsTo'](db[_0x0c28('0x67')],{});db[_0x0c28('0x6d')]['belongsTo'](db[_0x0c28('0x13')],{});db['OpenchannelQueueReport']['belongsTo'](db[_0x0c28('0x69')],{});db['ChatApplication']['belongsTo'](db[_0x0c28('0x13')],{'as':'Agent','foreignKey':_0x0c28('0x11e'),'onDelete':_0x0c28('0x16a')});db[_0x0c28('0x6f')]['belongsTo'](db['ChatQueue'],{'as':_0x0c28('0x198'),'foreignKey':_0x0c28('0x199'),'onDelete':_0x0c28('0x16a')});db[_0x0c28('0x6f')]['belongsTo'](db[_0x0c28('0x6b')],{'as':'Website','foreignKey':'ChatWebsiteId','onDelete':'restrict'});db['ChatApplication'][_0x0c28('0x156')](db[_0x0c28('0x178')],{'onDelete':_0x0c28('0x16a'),'foreignKey':_0x0c28('0x180')});db[_0x0c28('0x126')][_0x0c28('0x120')](db[_0x0c28('0x71')],{'as':_0x0c28('0x160'),'onDelete':_0x0c28('0x11d'),'foreignKey':_0x0c28('0x19a')});db['ChatInteraction'][_0x0c28('0x156')](db[_0x0c28('0x6b')],{'as':_0x0c28('0x176'),'foreignKey':_0x0c28('0x196')});db[_0x0c28('0x126')][_0x0c28('0x156')](db[_0x0c28('0x130')],{'as':_0x0c28('0x167'),'foreignKey':_0x0c28('0x177')});db[_0x0c28('0x126')]['belongsTo'](db[_0x0c28('0x13')],{'as':'Owner','foreignKey':_0x0c28('0x11e')});db[_0x0c28('0x126')][_0x0c28('0x12d')](db['Tag'],{'through':'chat_interaction_has_tags','as':_0x0c28('0x17a')});db['ChatInteraction'][_0x0c28('0x12d')](db[_0x0c28('0x178')],{'through':'chat_interaction_has_tags','as':_0x0c28('0x17b')});db['ChatInteraction']['belongsToMany'](db[_0x0c28('0x13')],{'as':_0x0c28('0x17c'),'through':_0x0c28('0x136'),'foreignKey':_0x0c28('0x19a')});db[_0x0c28('0x71')][_0x0c28('0x156')](db[_0x0c28('0x13')],{'onDelete':_0x0c28('0x11d'),'as':_0x0c28('0x13')});db['ChatMessage'][_0x0c28('0x156')](db[_0x0c28('0x130')],{'onDelete':_0x0c28('0x11d'),'as':'Contact','foreignKey':_0x0c28('0x177')});db['ChatMessage'][_0x0c28('0x156')](db[_0x0c28('0x126')],{'onDelete':_0x0c28('0x11d'),'as':_0x0c28('0x17e'),'foreignKey':_0x0c28('0x19a')});db[_0x0c28('0x71')][_0x0c28('0x156')](db['Attachment'],{'as':_0x0c28('0xf6'),'foreignKey':'AttachmentId'});db['ChatMessage'][_0x0c28('0x156')](db[_0x0c28('0x6b')],{'as':_0x0c28('0x176'),'foreignKey':_0x0c28('0x196')});db['ChatOfflineMessage'][_0x0c28('0x120')](db[_0x0c28('0xf6')],{'as':_0x0c28('0x17d'),'foreignKey':_0x0c28('0x17f'),'onDelete':_0x0c28('0x11d'),'hooks':!![]});db[_0x0c28('0x73')][_0x0c28('0x156')](db[_0x0c28('0x130')],{'onDelete':'cascade','as':_0x0c28('0x167'),'foreignKey':_0x0c28('0x177')});db[_0x0c28('0x73')][_0x0c28('0x156')](db[_0x0c28('0x6b')],{'as':'Account','foreignKey':_0x0c28('0x196')});db['ChatQueue'][_0x0c28('0x12d')](db[_0x0c28('0x13')],{'as':_0x0c28('0x173'),'through':'UserChatQueue','hooks':!![]});db[_0x0c28('0x13e')][_0x0c28('0x12d')](db[_0x0c28('0xef')],{'through':_0x0c28('0x19b'),'as':_0x0c28('0x15d')});db['ChatGroup'][_0x0c28('0x120')](db['ChatInternalMessage'],{'as':_0x0c28('0x160'),'foreignKey':_0x0c28('0x19c'),'onDelete':'cascade'});db['ChatGroup'][_0x0c28('0x12d')](db[_0x0c28('0x13')],{'as':_0x0c28('0x151'),'through':_0x0c28('0x12f')});db[_0x0c28('0x76')]['belongsTo'](db['ChatWebsite'],{'as':'Website','foreignKey':_0x0c28('0x196')});db['CmCompany'][_0x0c28('0x120')](db[_0x0c28('0x130')],{'as':_0x0c28('0x131'),'foreignKey':_0x0c28('0x19d')});db[_0x0c28('0x130')][_0x0c28('0x120')](db[_0x0c28('0x7b')],{'as':_0x0c28('0x153'),'foreignKey':_0x0c28('0x177')});db[_0x0c28('0x130')][_0x0c28('0x120')](db[_0x0c28('0x123')],{'as':_0x0c28('0x124'),'foreignKey':_0x0c28('0x177')});db['CmContact'][_0x0c28('0x120')](db[_0x0c28('0x80')],{'as':_0x0c28('0x154'),'foreignKey':'ContactId'});db[_0x0c28('0x130')][_0x0c28('0x120')](db[_0x0c28('0x82')],{'as':_0x0c28('0x82'),'foreignKey':'ContactId'});db[_0x0c28('0x130')][_0x0c28('0x120')](db[_0x0c28('0xde')],{'as':_0x0c28('0x155'),'foreignKey':_0x0c28('0x177')});db[_0x0c28('0x130')][_0x0c28('0x120')](db[_0x0c28('0x65')],{'as':_0x0c28('0x19e'),'foreignKey':_0x0c28('0x177'),'onDelete':_0x0c28('0x16a')});db['CmContact'][_0x0c28('0x120')](db[_0x0c28('0x126')],{'as':'ChatInteractions','foreignKey':_0x0c28('0x177'),'onDelete':_0x0c28('0x16a')});db['CmContact'][_0x0c28('0x120')](db[_0x0c28('0x5b')],{'as':_0x0c28('0x19f'),'foreignKey':_0x0c28('0x177'),'onDelete':'restrict'});db[_0x0c28('0x130')][_0x0c28('0x120')](db[_0x0c28('0x53')],{'as':_0x0c28('0x128'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0x0c28('0x130')][_0x0c28('0x120')](db[_0x0c28('0x129')],{'as':_0x0c28('0x12a'),'foreignKey':_0x0c28('0x177'),'onDelete':_0x0c28('0x16a')});db[_0x0c28('0x130')][_0x0c28('0x156')](db[_0x0c28('0x78')],{'as':_0x0c28('0x1a0'),'foreignKey':_0x0c28('0x19d')});db[_0x0c28('0x130')][_0x0c28('0x156')](db[_0x0c28('0x102')],{'as':_0x0c28('0x170'),'foreignKey':_0x0c28('0x181'),'onDelete':_0x0c28('0x11d')});db['CmContact'][_0x0c28('0x12d')](db[_0x0c28('0x13')],{'as':_0x0c28('0x17c'),'through':_0x0c28('0x132')});db['CmContact'][_0x0c28('0x12d')](db[_0x0c28('0x178')],{'as':_0x0c28('0x17a'),'through':_0x0c28('0x1a1')});db[_0x0c28('0x130')][_0x0c28('0x12d')](db[_0x0c28('0x178')],{'through':'cm_contact_has_tags','as':_0x0c28('0x17b')});db['CmHopper'][_0x0c28('0x156')](db[_0x0c28('0x130')],{'as':_0x0c28('0x167'),'foreignKey':_0x0c28('0x177'),'onDelete':_0x0c28('0x11d')});db['CmHopper']['belongsTo'](db[_0x0c28('0x102')],{'as':_0x0c28('0x170'),'foreignKey':_0x0c28('0x181'),'onDelete':_0x0c28('0x11d')});db[_0x0c28('0x7b')][_0x0c28('0x156')](db[_0x0c28('0x13')],{'as':_0x0c28('0x1a2'),'foreignKey':'UserId'});db['CmHopper'][_0x0c28('0x156')](db[_0x0c28('0x1d')],{'as':_0x0c28('0x198'),'foreignKey':_0x0c28('0x152'),'onDelete':_0x0c28('0x11d')});db[_0x0c28('0x7b')][_0x0c28('0x156')](db[_0x0c28('0x1a3')],{'as':_0x0c28('0x1a3'),'foreignKey':_0x0c28('0x1a4'),'onDelete':_0x0c28('0x11d')});db[_0x0c28('0x7b')][_0x0c28('0x156')](db[_0x0c28('0x13')],{'as':_0x0c28('0x186'),'foreignKey':_0x0c28('0x1a5')});db[_0x0c28('0x7d')]['belongsTo'](db[_0x0c28('0x130')],{'as':_0x0c28('0x167'),'foreignKey':_0x0c28('0x177'),'onDelete':_0x0c28('0x11d')});db['CmHopperBlack'][_0x0c28('0x156')](db[_0x0c28('0x102')],{'as':_0x0c28('0x170'),'foreignKey':_0x0c28('0x181'),'onDelete':'cascade'});db[_0x0c28('0x7d')][_0x0c28('0x156')](db[_0x0c28('0x1d')],{'as':'Queue','foreignKey':_0x0c28('0x152'),'onDelete':_0x0c28('0x11d')});db['CmHopperBlack'][_0x0c28('0x156')](db[_0x0c28('0x1a3')],{'as':_0x0c28('0x1a3'),'foreignKey':'CampaignId','onDelete':_0x0c28('0x11d')});db[_0x0c28('0x1a6')][_0x0c28('0x120')](db[_0x0c28('0x8c')],{'as':{'plural':_0x0c28('0x1a7'),'singular':_0x0c28('0x1a8')},'foreignKey':_0x0c28('0x1a9'),'onDelete':_0x0c28('0x11d'),'hooks':!![]});db['Automation'][_0x0c28('0x120')](db[_0x0c28('0x8c')],{'as':{'plural':_0x0c28('0x1aa'),'singular':'OneAny'},'foreignKey':_0x0c28('0x1ab'),'onDelete':_0x0c28('0x11d'),'hooks':!![]});db[_0x0c28('0x1a6')][_0x0c28('0x120')](db[_0x0c28('0x86')],{'as':_0x0c28('0x1ac'),'foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db[_0x0c28('0x8a')]['hasMany'](db['Disposition'],{'as':_0x0c28('0x16e'),'foreignKey':_0x0c28('0x1ad'),'onDelete':_0x0c28('0x11d')});db[_0x0c28('0x8e')][_0x0c28('0x120')](db[_0x0c28('0x8e')],{'as':_0x0c28('0x1ae'),'foreignKey':'IntervalId','onDelete':'cascade','hooks':!![],'required':![]});db['Interval'][_0x0c28('0x120')](db[_0x0c28('0x19')],{'as':'Extensions','foreignKey':'IntervalId','onDelete':_0x0c28('0x16a')});db['Interval'][_0x0c28('0x120')](db[_0x0c28('0x47')],{'as':_0x0c28('0x1af'),'foreignKey':_0x0c28('0x159')});db[_0x0c28('0x8e')][_0x0c28('0x120')](db[_0x0c28('0x6f')],{'as':_0x0c28('0x1b0'),'foreignKey':'IntervalId'});db[_0x0c28('0x8e')][_0x0c28('0x120')](db[_0x0c28('0x51')],{'as':_0x0c28('0x1b1'),'foreignKey':_0x0c28('0x159')});db[_0x0c28('0x8e')][_0x0c28('0x120')](db['SmsApplication'],{'as':_0x0c28('0x1b2'),'foreignKey':_0x0c28('0x159')});db[_0x0c28('0x94')][_0x0c28('0x156')](db[_0x0c28('0x3f')],{});db[_0x0c28('0x94')][_0x0c28('0x156')](db[_0x0c28('0xa2')],{'foreignKey':_0x0c28('0x1b3')});db['Schedule'][_0x0c28('0x156')](db[_0x0c28('0xa1')],{'foreignKey':_0x0c28('0x1b4')});db[_0x0c28('0x96')][_0x0c28('0x12d')](db[_0x0c28('0x1b')],{'as':'Mohs','through':_0x0c28('0x150'),'onDelete':_0x0c28('0x16a')});db[_0x0c28('0x178')][_0x0c28('0x12d')](db['CmContact'],{'through':_0x0c28('0x1a1')});db[_0x0c28('0x178')]['belongsToMany'](db[_0x0c28('0x126')],{'through':_0x0c28('0x1b5')});db['Tag'][_0x0c28('0x12d')](db[_0x0c28('0x129')],{'through':'mail_interaction_has_tags'});db[_0x0c28('0x178')][_0x0c28('0x12d')](db[_0x0c28('0x5b')],{'through':_0x0c28('0x18d')});db[_0x0c28('0x178')][_0x0c28('0x12d')](db[_0x0c28('0x53')],{'through':'fax_interaction_has_tags'});db[_0x0c28('0x178')][_0x0c28('0x12d')](db[_0x0c28('0x65')],{'through':_0x0c28('0x193')});db['Tag'][_0x0c28('0x12d')](db['WhatsappInteraction'],{'through':_0x0c28('0x1b6')});db[_0x0c28('0x1b7')][_0x0c28('0x120')](db[_0x0c28('0x8c')],{'as':{'plural':_0x0c28('0x1b8'),'singular':'AllCondition'},'foreignKey':'TriggerAllId','onDelete':_0x0c28('0x11d'),'hooks':!![]});db[_0x0c28('0x1b7')][_0x0c28('0x120')](db[_0x0c28('0x8c')],{'as':{'plural':'AnyConditions','singular':_0x0c28('0x1b9')},'foreignKey':'TriggerAnyId','onDelete':'cascade','hooks':!![]});db['Trigger'][_0x0c28('0x120')](db[_0x0c28('0x86')],{'as':_0x0c28('0x1ac'),'foreignKey':_0x0c28('0x1ba'),'onDelete':_0x0c28('0x11d'),'hooks':!![]});db['AnalyticCustomReport'][_0x0c28('0x120')](db[_0x0c28('0xa7')],{'as':_0x0c28('0x1bb'),'onDelete':'cascade','foreignKey':_0x0c28('0x1b4'),'hooks':!![]});db[_0x0c28('0xa2')]['hasMany'](db[_0x0c28('0xa7')],{'as':_0x0c28('0x1bb'),'onDelete':_0x0c28('0x11d'),'foreignKey':'DefaultReportId'});db['AnalyticMetric']['hasMany'](db[_0x0c28('0xa7')],{'as':_0x0c28('0x1bb'),'onDelete':_0x0c28('0x11d'),'foreignKey':_0x0c28('0x1bc')});db['AnalyticFieldReport'][_0x0c28('0x156')](db[_0x0c28('0xa5')],{'foreignKey':_0x0c28('0x1bc')});db['SalesforceAccount'][_0x0c28('0x120')](db['SalesforceConfiguration'],{'as':_0x0c28('0x1bd'),'onDelete':'cascade','foreignKey':_0x0c28('0x1be')});db[_0x0c28('0xad')]['hasMany'](db[_0x0c28('0xae')],{'as':_0x0c28('0x1bf'),'onDelete':_0x0c28('0x11d'),'foreignKey':_0x0c28('0x1c0')});db[_0x0c28('0xad')]['hasMany'](db[_0x0c28('0xae')],{'as':'Descriptions','onDelete':_0x0c28('0x11d'),'foreignKey':_0x0c28('0x1c1')});db[_0x0c28('0xad')][_0x0c28('0x120')](db[_0x0c28('0xae')],{'as':_0x0c28('0x1bb'),'onDelete':_0x0c28('0x11d'),'foreignKey':'FieldId'});db['SalesforceConfiguration'][_0x0c28('0x156')](db[_0x0c28('0xab')],{'as':_0x0c28('0x176'),'foreignKey':'AccountId'});db[_0x0c28('0xae')]['hasMany'](db[_0x0c28('0xae')],{'as':_0x0c28('0x1c2'),'foreignKey':_0x0c28('0x1c0')});db[_0x0c28('0xae')][_0x0c28('0x120')](db[_0x0c28('0xae')],{'as':_0x0c28('0x1c3'),'foreignKey':'DescriptionId'});db[_0x0c28('0xae')]['hasMany'](db[_0x0c28('0xae')],{'as':'Field','foreignKey':'FieldId'});db[_0x0c28('0xae')][_0x0c28('0x156')](db[_0x0c28('0x9b')],{'as':_0x0c28('0x9b'),'foreignKey':'VariableId'});db['SugarcrmAccount'][_0x0c28('0x120')](db['SugarcrmConfiguration'],{'as':_0x0c28('0x1bd'),'onDelete':_0x0c28('0x11d'),'foreignKey':'AccountId'});db[_0x0c28('0xb2')][_0x0c28('0x120')](db[_0x0c28('0xb4')],{'as':_0x0c28('0x1bf'),'onDelete':_0x0c28('0x11d'),'foreignKey':_0x0c28('0x1c0')});db['SugarcrmConfiguration'][_0x0c28('0x120')](db[_0x0c28('0xb4')],{'as':_0x0c28('0x1c4'),'onDelete':_0x0c28('0x11d'),'foreignKey':_0x0c28('0x1c1')});db[_0x0c28('0xb2')][_0x0c28('0x120')](db[_0x0c28('0xb4')],{'as':_0x0c28('0x1bb'),'onDelete':_0x0c28('0x11d'),'foreignKey':'FieldId'});db[_0x0c28('0xb2')]['belongsTo'](db[_0x0c28('0xb0')],{'as':'Account','foreignKey':_0x0c28('0x1be')});db['SugarcrmField']['hasMany'](db[_0x0c28('0xb4')],{'as':_0x0c28('0x1c2'),'foreignKey':_0x0c28('0x1c0')});db['SugarcrmField'][_0x0c28('0x120')](db['SugarcrmField'],{'as':_0x0c28('0x1c3'),'foreignKey':_0x0c28('0x1c1')});db[_0x0c28('0xb4')][_0x0c28('0x120')](db[_0x0c28('0xb4')],{'as':'Field','foreignKey':'FieldId'});db[_0x0c28('0xb4')][_0x0c28('0x156')](db[_0x0c28('0x9b')],{'as':'Variable','foreignKey':_0x0c28('0x1c5')});db[_0x0c28('0xb6')][_0x0c28('0x120')](db[_0x0c28('0xb8')],{'as':_0x0c28('0x1bd'),'onDelete':'cascade','foreignKey':_0x0c28('0x1be')});db['DeskConfiguration']['hasMany'](db[_0x0c28('0x1c6')],{'as':_0x0c28('0x1bf'),'onDelete':_0x0c28('0x11d'),'foreignKey':_0x0c28('0x1c0')});db[_0x0c28('0xb8')][_0x0c28('0x120')](db[_0x0c28('0x1c6')],{'as':_0x0c28('0x1c4'),'onDelete':_0x0c28('0x11d'),'foreignKey':_0x0c28('0x1c1')});db[_0x0c28('0xb8')][_0x0c28('0x120')](db['DeskField'],{'as':_0x0c28('0x1bb'),'onDelete':_0x0c28('0x11d'),'foreignKey':_0x0c28('0x1c7')});db[_0x0c28('0xb8')][_0x0c28('0x156')](db[_0x0c28('0xb6')],{'as':_0x0c28('0x176'),'foreignKey':_0x0c28('0x1be')});db[_0x0c28('0xb8')][_0x0c28('0x12d')](db['Tag'],{'through':'int_desk_configuration_has_tags'});db['DeskField']['hasMany'](db[_0x0c28('0x1c6')],{'as':'Subject','foreignKey':_0x0c28('0x1c0')});db[_0x0c28('0x1c6')][_0x0c28('0x120')](db[_0x0c28('0x1c6')],{'as':_0x0c28('0x1c3'),'foreignKey':'DescriptionId'});db['DeskField'][_0x0c28('0x120')](db[_0x0c28('0x1c6')],{'as':_0x0c28('0x1c8'),'foreignKey':_0x0c28('0x1c7')});db['DeskField'][_0x0c28('0x156')](db[_0x0c28('0x9b')],{'as':_0x0c28('0x9b'),'foreignKey':_0x0c28('0x1c5')});db['ZohoAccount'][_0x0c28('0x120')](db[_0x0c28('0xbc')],{'as':_0x0c28('0x1bd'),'onDelete':_0x0c28('0x11d'),'foreignKey':_0x0c28('0x1be')});db[_0x0c28('0xbc')][_0x0c28('0x120')](db[_0x0c28('0xbd')],{'as':_0x0c28('0x1bf'),'onDelete':_0x0c28('0x11d'),'foreignKey':'SubjectId'});db[_0x0c28('0xbc')]['hasMany'](db[_0x0c28('0xbd')],{'as':_0x0c28('0x1c4'),'onDelete':'cascade','foreignKey':_0x0c28('0x1c1')});db[_0x0c28('0xbc')][_0x0c28('0x120')](db[_0x0c28('0xbd')],{'as':'Fields','onDelete':_0x0c28('0x11d'),'foreignKey':'FieldId'});db[_0x0c28('0xbc')][_0x0c28('0x156')](db[_0x0c28('0xbb')],{'as':'Account','foreignKey':_0x0c28('0x1be')});db[_0x0c28('0xbd')][_0x0c28('0x120')](db[_0x0c28('0xbd')],{'as':_0x0c28('0x1c2'),'foreignKey':_0x0c28('0x1c0')});db[_0x0c28('0xbd')]['hasMany'](db[_0x0c28('0xbd')],{'as':_0x0c28('0x1c3'),'foreignKey':'DescriptionId'});db[_0x0c28('0xbd')]['hasMany'](db[_0x0c28('0xbd')],{'as':_0x0c28('0x1c8'),'foreignKey':'FieldId'});db[_0x0c28('0xbd')][_0x0c28('0x156')](db[_0x0c28('0x9b')],{'as':'Variable','foreignKey':_0x0c28('0x1c5')});db[_0x0c28('0x1c9')][_0x0c28('0x120')](db[_0x0c28('0x1ca')],{'as':_0x0c28('0x1bd'),'onDelete':'cascade','foreignKey':_0x0c28('0x1be')});db[_0x0c28('0x1ca')][_0x0c28('0x120')](db[_0x0c28('0xc1')],{'as':_0x0c28('0x1bf'),'foreignKey':_0x0c28('0x1c0')});db['ZendeskConfiguration']['hasMany'](db[_0x0c28('0xc1')],{'as':_0x0c28('0x1c4'),'foreignKey':_0x0c28('0x1c1')});db[_0x0c28('0x1ca')]['hasMany'](db[_0x0c28('0xc1')],{'as':'Fields','foreignKey':_0x0c28('0x1c7')});db[_0x0c28('0x1ca')][_0x0c28('0x156')](db['ZendeskAccount'],{'as':'Account','foreignKey':_0x0c28('0x1be')});db['ZendeskConfiguration'][_0x0c28('0x12d')](db['Tag'],{'through':'int_zendesk_configuration_has_tags'});db[_0x0c28('0xc1')][_0x0c28('0x120')](db[_0x0c28('0xc1')],{'as':'Subject','foreignKey':_0x0c28('0x1c0')});db[_0x0c28('0xc1')][_0x0c28('0x120')](db[_0x0c28('0xc1')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x0c28('0xc1')]['hasMany'](db[_0x0c28('0xc1')],{'as':'Field','foreignKey':_0x0c28('0x1c7')});db[_0x0c28('0xc1')]['belongsTo'](db[_0x0c28('0x9b')],{'as':_0x0c28('0x9b'),'foreignKey':_0x0c28('0x1c5')});db['FreshdeskAccount'][_0x0c28('0x120')](db[_0x0c28('0x1cb')],{'as':_0x0c28('0x1bd'),'onDelete':_0x0c28('0x11d'),'foreignKey':_0x0c28('0x1be')});db[_0x0c28('0x1cb')][_0x0c28('0x120')](db[_0x0c28('0xc4')],{'as':_0x0c28('0x1bf'),'onDelete':_0x0c28('0x11d'),'foreignKey':'SubjectId'});db[_0x0c28('0x1cb')][_0x0c28('0x120')](db['FreshdeskField'],{'as':_0x0c28('0x1c4'),'onDelete':_0x0c28('0x11d'),'foreignKey':'DescriptionId'});db[_0x0c28('0x1cb')][_0x0c28('0x120')](db[_0x0c28('0xc4')],{'as':_0x0c28('0x1bb'),'onDelete':'cascade','foreignKey':_0x0c28('0x1c7')});db['FreshdeskConfiguration'][_0x0c28('0x156')](db[_0x0c28('0xc2')],{'as':_0x0c28('0x176'),'foreignKey':_0x0c28('0x1be')});db[_0x0c28('0x1cb')][_0x0c28('0x12d')](db['Tag'],{'through':'int_freshdesk_configuration_has_tags'});db['FreshdeskField']['hasMany'](db['FreshdeskField'],{'as':_0x0c28('0x1c2'),'foreignKey':_0x0c28('0x1c0')});db[_0x0c28('0xc4')]['hasMany'](db['FreshdeskField'],{'as':_0x0c28('0x1c3'),'foreignKey':'DescriptionId'});db[_0x0c28('0xc4')]['hasMany'](db['FreshdeskField'],{'as':_0x0c28('0x1c8'),'foreignKey':_0x0c28('0x1c7')});db[_0x0c28('0xc4')][_0x0c28('0x156')](db[_0x0c28('0x9b')],{'as':_0x0c28('0x9b'),'foreignKey':'VariableId'});db[_0x0c28('0xc6')]['hasMany'](db[_0x0c28('0xc8')],{'as':'Configurations','onDelete':_0x0c28('0x11d'),'foreignKey':_0x0c28('0x1be')});db[_0x0c28('0xc8')][_0x0c28('0x120')](db[_0x0c28('0xca')],{'as':'Subjects','foreignKey':_0x0c28('0x1c0')});db[_0x0c28('0xc8')][_0x0c28('0x120')](db[_0x0c28('0xca')],{'as':_0x0c28('0x1c4'),'foreignKey':_0x0c28('0x1c1')});db[_0x0c28('0xc8')]['hasMany'](db[_0x0c28('0xca')],{'as':'Fields','foreignKey':_0x0c28('0x1c7')});db['VtigerConfiguration'][_0x0c28('0x156')](db[_0x0c28('0xc6')],{'as':'Account','foreignKey':_0x0c28('0x1be')});db[_0x0c28('0xca')]['hasMany'](db[_0x0c28('0xca')],{'as':_0x0c28('0x1c2'),'foreignKey':'SubjectId'});db['VtigerField']['hasMany'](db[_0x0c28('0xca')],{'as':_0x0c28('0x1c3'),'foreignKey':_0x0c28('0x1c1')});db[_0x0c28('0xca')][_0x0c28('0x120')](db[_0x0c28('0xca')],{'as':_0x0c28('0x1c8'),'foreignKey':_0x0c28('0x1c7')});db['VtigerField'][_0x0c28('0x156')](db['Variable'],{'as':_0x0c28('0x9b'),'foreignKey':_0x0c28('0x1c5')});db[_0x0c28('0xcc')][_0x0c28('0x120')](db[_0x0c28('0x1cc')],{'as':_0x0c28('0x1bd'),'onDelete':_0x0c28('0x11d'),'foreignKey':_0x0c28('0x1be')});db[_0x0c28('0x1cc')][_0x0c28('0x120')](db[_0x0c28('0x1cd')],{'as':_0x0c28('0x1bf'),'foreignKey':'SubjectId'});db[_0x0c28('0x1cc')][_0x0c28('0x120')](db[_0x0c28('0x1cd')],{'as':_0x0c28('0x1c4'),'foreignKey':_0x0c28('0x1c1')});db[_0x0c28('0x1cc')][_0x0c28('0x120')](db[_0x0c28('0x1cd')],{'as':_0x0c28('0x1bb'),'foreignKey':_0x0c28('0x1c7')});db[_0x0c28('0x1cc')][_0x0c28('0x156')](db[_0x0c28('0xcc')],{'as':_0x0c28('0x176'),'foreignKey':_0x0c28('0x1be')});db[_0x0c28('0x1cd')][_0x0c28('0x120')](db[_0x0c28('0x1cd')],{'as':_0x0c28('0x1c2'),'foreignKey':_0x0c28('0x1c0')});db['ServicenowField'][_0x0c28('0x120')](db[_0x0c28('0x1cd')],{'as':_0x0c28('0x1c3'),'foreignKey':'DescriptionId'});db[_0x0c28('0x1cd')][_0x0c28('0x120')](db[_0x0c28('0x1cd')],{'as':_0x0c28('0x1c8'),'foreignKey':_0x0c28('0x1c7')});db[_0x0c28('0x1cd')]['belongsTo'](db[_0x0c28('0x9b')],{'as':_0x0c28('0x9b'),'foreignKey':_0x0c28('0x1c5')});db[_0x0c28('0x1ce')]['hasMany'](db[_0x0c28('0xd0')],{'as':_0x0c28('0x1bd'),'onDelete':_0x0c28('0x11d'),'foreignKey':_0x0c28('0x1be')});db[_0x0c28('0x1ce')][_0x0c28('0x156')](db[_0x0c28('0x114')],{'as':'CloudProvider','foreignKey':_0x0c28('0x169')});db[_0x0c28('0xd0')][_0x0c28('0x120')](db[_0x0c28('0xd1')],{'as':_0x0c28('0x1bf'),'onDelete':_0x0c28('0x11d'),'foreignKey':'SubjectId'});db[_0x0c28('0xd0')][_0x0c28('0x120')](db['Dynamics365Field'],{'as':_0x0c28('0x1c4'),'onDelete':_0x0c28('0x11d'),'foreignKey':_0x0c28('0x1c1')});db['Dynamics365Configuration'][_0x0c28('0x120')](db[_0x0c28('0xd1')],{'as':_0x0c28('0x1bb'),'onDelete':_0x0c28('0x11d'),'foreignKey':_0x0c28('0x1c7')});db['Dynamics365Configuration'][_0x0c28('0x156')](db['Dynamics365Account'],{'as':'Account','foreignKey':_0x0c28('0x1be')});db['Dynamics365Field'][_0x0c28('0x120')](db[_0x0c28('0xd1')],{'as':'Subject','foreignKey':_0x0c28('0x1c0')});db[_0x0c28('0xd1')]['hasMany'](db['Dynamics365Field'],{'as':_0x0c28('0x1c3'),'foreignKey':_0x0c28('0x1c1')});db['Dynamics365Field'][_0x0c28('0x120')](db[_0x0c28('0xd1')],{'as':'Field','foreignKey':_0x0c28('0x1c7')});db[_0x0c28('0xd1')][_0x0c28('0x156')](db[_0x0c28('0x9b')],{'as':_0x0c28('0x9b'),'foreignKey':_0x0c28('0x1c5')});db[_0x0c28('0xd2')][_0x0c28('0x120')](db['FreshsalesConfiguration'],{'as':_0x0c28('0x1bd'),'onDelete':_0x0c28('0x11d'),'foreignKey':_0x0c28('0x1be')});db[_0x0c28('0xd4')][_0x0c28('0x120')](db['FreshsalesField'],{'as':_0x0c28('0x1bf'),'foreignKey':_0x0c28('0x1c0')});db[_0x0c28('0xd4')]['hasMany'](db[_0x0c28('0x1cf')],{'as':_0x0c28('0x1c4'),'foreignKey':_0x0c28('0x1c1')});db[_0x0c28('0xd4')]['hasMany'](db[_0x0c28('0x1cf')],{'as':_0x0c28('0x1bb'),'foreignKey':_0x0c28('0x1c7')});db[_0x0c28('0xd4')][_0x0c28('0x156')](db[_0x0c28('0xd2')],{'as':'Account','foreignKey':_0x0c28('0x1be')});db[_0x0c28('0x1cf')]['hasMany'](db[_0x0c28('0x1cf')],{'as':_0x0c28('0x1c2'),'foreignKey':'SubjectId'});db[_0x0c28('0x1cf')][_0x0c28('0x120')](db[_0x0c28('0x1cf')],{'as':'Description','foreignKey':_0x0c28('0x1c1')});db[_0x0c28('0x1cf')][_0x0c28('0x120')](db['FreshsalesField'],{'as':'Field','foreignKey':_0x0c28('0x1c7')});db[_0x0c28('0x1cf')]['belongsTo'](db['Variable'],{'as':_0x0c28('0x9b'),'foreignKey':'VariableId'});db[_0x0c28('0xd8')][_0x0c28('0x156')](db['ChatWebsite'],{});db[_0x0c28('0xd8')][_0x0c28('0x156')](db['CmList'],{'as':_0x0c28('0x170'),'foreignKey':_0x0c28('0x181')});db['ChatQueueReport']['belongsTo'](db[_0x0c28('0x130')],{'as':_0x0c28('0x167'),'foreignKey':_0x0c28('0x177')});db[_0x0c28('0xd8')]['belongsTo'](db[_0x0c28('0x126')],{});db[_0x0c28('0xd8')][_0x0c28('0x156')](db[_0x0c28('0x71')],{});db['ChatQueueReport'][_0x0c28('0x156')](db[_0x0c28('0x13')],{});db[_0x0c28('0xd8')][_0x0c28('0x156')](db[_0x0c28('0x13e')],{});db[_0x0c28('0xda')][_0x0c28('0x156')](db['User'],{'onDelete':_0x0c28('0x11d'),'foreignKey':_0x0c28('0x1d0')});db[_0x0c28('0xda')][_0x0c28('0x156')](db[_0x0c28('0x13')],{'onDelete':_0x0c28('0x11d'),'foreignKey':_0x0c28('0x1d1')});db[_0x0c28('0xde')][_0x0c28('0x120')](db[_0x0c28('0xdc')],{'foreignKey':_0x0c28('0x1d2'),'onDelete':'cascade'});db[_0x0c28('0xde')][_0x0c28('0x120')](db[_0x0c28('0x1d3')],{'foreignKey':_0x0c28('0x1d2'),'onDelete':_0x0c28('0x11d')});db['SmsQueueReport']['belongsTo'](db[_0x0c28('0x58')],{});db[_0x0c28('0xe0')][_0x0c28('0x156')](db[_0x0c28('0x102')],{'as':_0x0c28('0x170'),'foreignKey':_0x0c28('0x181')});db['SmsQueueReport'][_0x0c28('0x156')](db[_0x0c28('0x130')],{'as':'Contact','foreignKey':_0x0c28('0x177')});db['SmsQueueReport']['belongsTo'](db[_0x0c28('0x5b')],{});db[_0x0c28('0xe0')]['belongsTo'](db['SmsMessage'],{});db[_0x0c28('0xe0')][_0x0c28('0x156')](db[_0x0c28('0x13')],{});db[_0x0c28('0xe0')][_0x0c28('0x156')](db[_0x0c28('0x5f')],{});db[_0x0c28('0x1d4')][_0x0c28('0x120')](db[_0x0c28('0xde')],{'foreignKey':_0x0c28('0x1d5')});db[_0x0c28('0x1d4')][_0x0c28('0x120')](db[_0x0c28('0xdc')],{'foreignKey':_0x0c28('0x1d5')});db['JscriptyProject'][_0x0c28('0x120')](db['JscriptyAnswerReport'],{'foreignKey':_0x0c28('0x1d5')});db['SquareProject'][_0x0c28('0x12d')](db[_0x0c28('0x13')],{'as':_0x0c28('0x17c'),'through':_0x0c28('0x14c')});db['Team'][_0x0c28('0x12d')](db[_0x0c28('0x13')],{'as':_0x0c28('0x173'),'through':_0x0c28('0x134')});db[_0x0c28('0xef')][_0x0c28('0x12d')](db[_0x0c28('0x1d')],{'through':_0x0c28('0x115'),'as':_0x0c28('0x13a')});db[_0x0c28('0xef')][_0x0c28('0x12d')](db[_0x0c28('0x41')],{'through':_0x0c28('0x174'),'as':_0x0c28('0x1d6')});db[_0x0c28('0xef')]['belongsToMany'](db[_0x0c28('0x13e')],{'through':_0x0c28('0x19b'),'as':'ChatQueues'});db[_0x0c28('0xef')]['belongsToMany'](db[_0x0c28('0x55')],{'through':_0x0c28('0x18a'),'as':_0x0c28('0x1d7')});db[_0x0c28('0xef')][_0x0c28('0x12d')](db[_0x0c28('0x5f')],{'through':'team_has_sms_queues','as':_0x0c28('0x1d8')});db[_0x0c28('0xef')][_0x0c28('0x12d')](db['OpenchannelQueue'],{'through':_0x0c28('0x195'),'as':_0x0c28('0x140')});db[_0x0c28('0xef')][_0x0c28('0x12d')](db[_0x0c28('0x112')],{'through':_0x0c28('0x1d9'),'as':'WhatsappQueues'});db[_0x0c28('0xef')][_0x0c28('0x12d')](db[_0x0c28('0x13c')],{'through':_0x0c28('0x117'),'as':'VoicePrefixes'});db[_0x0c28('0x1a3')]['hasMany'](db['CmHopper'],{'as':_0x0c28('0x153'),'foreignKey':_0x0c28('0x1a4')});db[_0x0c28('0x1a3')][_0x0c28('0x120')](db[_0x0c28('0x123')],{'as':_0x0c28('0x124'),'foreignKey':_0x0c28('0x1a4')});db[_0x0c28('0x1a3')][_0x0c28('0x120')](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':_0x0c28('0x1a4')});db[_0x0c28('0x1a3')]['hasMany'](db[_0x0c28('0x7d')],{'as':_0x0c28('0x1da'),'foreignKey':_0x0c28('0x1a4')});db[_0x0c28('0x1a3')][_0x0c28('0x156')](db['Trunk'],{'as':'Trunk','foreignKey':_0x0c28('0x157')});db[_0x0c28('0x1a3')]['belongsTo'](db[_0x0c28('0x2d')],{'as':'TrunkBackup','foreignKey':_0x0c28('0x158')});db[_0x0c28('0x1a3')]['belongsTo'](db['Interval'],{'as':_0x0c28('0x8e'),'foreignKey':_0x0c28('0x159')});db['Campaign'][_0x0c28('0x156')](db['SquareProject'],{'as':_0x0c28('0xe9'),'foreignKey':_0x0c28('0x1db')});db[_0x0c28('0x1a3')][_0x0c28('0x12d')](db[_0x0c28('0x102')],{'as':'Lists','through':_0x0c28('0x1dc')});db['Campaign'][_0x0c28('0x12d')](db[_0x0c28('0x102')],{'as':'BlackLists','through':_0x0c28('0x1dd')});db[_0x0c28('0xf6')]['belongsTo'](db[_0x0c28('0x73')],{'as':_0x0c28('0x73'),'foreignKey':_0x0c28('0x17f')});db[_0x0c28('0xfa')][_0x0c28('0x156')](db[_0x0c28('0x45')],{});db[_0x0c28('0xfa')][_0x0c28('0x156')](db['MailInteraction'],{});db[_0x0c28('0xfa')][_0x0c28('0x156')](db[_0x0c28('0x3f')],{'foreignKey':_0x0c28('0x1de'),'as':_0x0c28('0x1df')});db[_0x0c28('0xfa')][_0x0c28('0x156')](db[_0x0c28('0x13')],{'foreignKey':_0x0c28('0x1e0'),'as':_0x0c28('0x1e1')});db[_0x0c28('0xfa')][_0x0c28('0x156')](db[_0x0c28('0x13')],{'foreignKey':_0x0c28('0x1e2'),'as':_0x0c28('0x1e3')});db['MailTransferReport'][_0x0c28('0x156')](db[_0x0c28('0x41')],{'foreignKey':_0x0c28('0x1e4'),'as':_0x0c28('0x1e5')});db[_0x0c28('0xfa')][_0x0c28('0x156')](db['MailAccount'],{'foreignKey':_0x0c28('0x1e6'),'as':_0x0c28('0x1e7')});db[_0x0c28('0xfb')]['belongsTo'](db[_0x0c28('0x71')],{});db['ChatTransferReport'][_0x0c28('0x156')](db[_0x0c28('0x126')],{});db[_0x0c28('0xfb')][_0x0c28('0x156')](db[_0x0c28('0x6b')],{'foreignKey':'FromChatWebsiteId','as':'FromAccount'});db[_0x0c28('0xfb')][_0x0c28('0x156')](db[_0x0c28('0x13')],{'foreignKey':_0x0c28('0x1e0'),'as':'FromAgent'});db[_0x0c28('0xfb')][_0x0c28('0x156')](db[_0x0c28('0x13')],{'foreignKey':_0x0c28('0x1e2'),'as':_0x0c28('0x1e3')});db[_0x0c28('0xfb')][_0x0c28('0x156')](db[_0x0c28('0x13e')],{'foreignKey':_0x0c28('0x1e8'),'as':_0x0c28('0x1e5')});db[_0x0c28('0xfb')][_0x0c28('0x156')](db[_0x0c28('0x6b')],{'foreignKey':_0x0c28('0x1e9'),'as':_0x0c28('0x1e7')});db[_0x0c28('0xfd')][_0x0c28('0x156')](db[_0x0c28('0x184')],{});db['FaxTransferReport']['belongsTo'](db[_0x0c28('0x53')],{});db[_0x0c28('0xfd')][_0x0c28('0x156')](db['FaxAccount'],{'foreignKey':'FromFaxAccountId','as':_0x0c28('0x1df')});db[_0x0c28('0xfd')][_0x0c28('0x156')](db[_0x0c28('0x13')],{'foreignKey':_0x0c28('0x1e0'),'as':_0x0c28('0x1e1')});db['FaxTransferReport'][_0x0c28('0x156')](db[_0x0c28('0x13')],{'foreignKey':_0x0c28('0x1e2'),'as':_0x0c28('0x1e3')});db[_0x0c28('0xfd')][_0x0c28('0x156')](db[_0x0c28('0x55')],{'foreignKey':_0x0c28('0x1ea'),'as':_0x0c28('0x1e5')});db['FaxTransferReport'][_0x0c28('0x156')](db[_0x0c28('0x4f')],{'foreignKey':_0x0c28('0x1eb'),'as':_0x0c28('0x1e7')});db[_0x0c28('0x1ec')][_0x0c28('0x156')](db['OpenchannelMessage'],{});db[_0x0c28('0x1ec')][_0x0c28('0x156')](db[_0x0c28('0x65')],{});db['OpenchannelTransferReport']['belongsTo'](db[_0x0c28('0x61')],{'foreignKey':_0x0c28('0x1ed'),'as':_0x0c28('0x1df')});db[_0x0c28('0x1ec')][_0x0c28('0x156')](db[_0x0c28('0x13')],{'foreignKey':_0x0c28('0x1e0'),'as':_0x0c28('0x1e1')});db[_0x0c28('0x1ec')][_0x0c28('0x156')](db[_0x0c28('0x13')],{'foreignKey':_0x0c28('0x1e2'),'as':_0x0c28('0x1e3')});db[_0x0c28('0x1ec')][_0x0c28('0x156')](db['OpenchannelQueue'],{'foreignKey':_0x0c28('0x1ee'),'as':_0x0c28('0x1e5')});db[_0x0c28('0x1ec')][_0x0c28('0x156')](db['OpenchannelAccount'],{'foreignKey':_0x0c28('0x1ef'),'as':_0x0c28('0x1e7')});db[_0x0c28('0x100')][_0x0c28('0x156')](db[_0x0c28('0x5d')],{});db['SmsTransferReport']['belongsTo'](db[_0x0c28('0x5b')],{});db[_0x0c28('0x100')][_0x0c28('0x156')](db[_0x0c28('0x58')],{'foreignKey':_0x0c28('0x1f0'),'as':_0x0c28('0x1df')});db[_0x0c28('0x100')][_0x0c28('0x156')](db[_0x0c28('0x13')],{'foreignKey':_0x0c28('0x1e0'),'as':'FromAgent'});db[_0x0c28('0x100')][_0x0c28('0x156')](db[_0x0c28('0x13')],{'foreignKey':_0x0c28('0x1e2'),'as':'ToAgent'});db['SmsTransferReport'][_0x0c28('0x156')](db[_0x0c28('0x5f')],{'foreignKey':_0x0c28('0x1f1'),'as':'ToQueue'});db[_0x0c28('0x100')]['belongsTo'](db['SmsAccount'],{'foreignKey':_0x0c28('0x1f2'),'as':_0x0c28('0x1e7')});db[_0x0c28('0x102')][_0x0c28('0x120')](db['Disposition'],{'as':_0x0c28('0x16e'),'foreignKey':'ListId','onDelete':_0x0c28('0x11d')});db[_0x0c28('0x102')][_0x0c28('0x120')](db[_0x0c28('0x84')],{'as':'CustomFields','foreignKey':_0x0c28('0x181')});db[_0x0c28('0x102')][_0x0c28('0x120')](db[_0x0c28('0x130')],{'as':_0x0c28('0x131'),'onDelete':_0x0c28('0x11d'),'foreignKey':_0x0c28('0x181')});db[_0x0c28('0x102')]['hasMany'](db[_0x0c28('0x123')],{'as':_0x0c28('0x124'),'foreignKey':_0x0c28('0x181')});db['CmList'][_0x0c28('0x120')](db[_0x0c28('0x80')],{'as':_0x0c28('0x125'),'foreignKey':_0x0c28('0x181')});db[_0x0c28('0x102')][_0x0c28('0x120')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0x0c28('0x181')});db[_0x0c28('0x102')][_0x0c28('0x12d')](db[_0x0c28('0x1d')],{'as':_0x0c28('0x1f3'),'through':_0x0c28('0x15c')});db[_0x0c28('0x102')][_0x0c28('0x12d')](db[_0x0c28('0x13')],{'as':_0x0c28('0x173'),'through':_0x0c28('0x133')});db[_0x0c28('0x13c')][_0x0c28('0x120')](db[_0x0c28('0x19')],{'as':_0x0c28('0x1f4'),'onDelete':'cascade'});db[_0x0c28('0x13c')][_0x0c28('0x12d')](db['User'],{'as':_0x0c28('0x173'),'through':_0x0c28('0x1f5')});db[_0x0c28('0x13c')][_0x0c28('0x12d')](db[_0x0c28('0xef')],{'through':_0x0c28('0x117'),'as':_0x0c28('0x15d')});db[_0x0c28('0x105')][_0x0c28('0x120')](db[_0x0c28('0x13')],{'as':'Users','foreignKey':'userProfileId'});db[_0x0c28('0x105')][_0x0c28('0x120')](db[_0x0c28('0x106')],{'as':'UserProfileSections','foreignKey':_0x0c28('0x12c'),'onDelete':_0x0c28('0x11d')});db['UserProfileSection']['hasMany'](db[_0x0c28('0x108')],{'as':_0x0c28('0x1f6'),'foreignKey':'sectionId','onDelete':'cascade'});db[_0x0c28('0x10b')][_0x0c28('0x120')](db[_0x0c28('0x8a')],{'as':_0x0c28('0x16e'),'foreignKey':_0x0c28('0x1f7'),'onDelete':'cascade'});db['WhatsappAccount']['hasMany'](db['CannedAnswer'],{'as':'Answers','foreignKey':'WhatsappAccountId'});db[_0x0c28('0x10b')]['hasMany'](db[_0x0c28('0x1f8')],{'as':'Messages','foreignKey':_0x0c28('0x1f7')});db[_0x0c28('0x10b')][_0x0c28('0x120')](db[_0x0c28('0x10e')],{'as':_0x0c28('0x197')});db[_0x0c28('0x10b')][_0x0c28('0x120')](db[_0x0c28('0x1f9')],{'as':_0x0c28('0x14e')});db[_0x0c28('0x10b')]['belongsTo'](db[_0x0c28('0x102')],{'as':_0x0c28('0x170'),'foreignKey':'ListId'});db['WhatsappAccount']['belongsTo'](db[_0x0c28('0x8f')],{'as':_0x0c28('0x15a'),'foreignKey':_0x0c28('0x172')});db['WhatsappAccount']['belongsToMany'](db[_0x0c28('0x13')],{'as':'Agents','through':_0x0c28('0x14b')});db[_0x0c28('0x1f9')][_0x0c28('0x156')](db[_0x0c28('0x13')],{'onDelete':_0x0c28('0x16a')});db[_0x0c28('0x1f9')][_0x0c28('0x156')](db[_0x0c28('0x112')],{'onDelete':_0x0c28('0x16a')});db[_0x0c28('0x1f9')][_0x0c28('0x156')](db['WhatsappAccount'],{'onDelete':_0x0c28('0x16a')});db[_0x0c28('0x1f9')][_0x0c28('0x156')](db[_0x0c28('0x8e')],{'onDelete':'restrict','foreignKey':_0x0c28('0x159')});db['WhatsappApplication']['belongsTo'](db[_0x0c28('0x178')],{'onDelete':'restrict','foreignKey':_0x0c28('0x180')});db[_0x0c28('0x10e')][_0x0c28('0x120')](db['WhatsappMessage'],{'as':'Messages','onDelete':_0x0c28('0x11d'),'foreignKey':_0x0c28('0x1fa')});db[_0x0c28('0x10e')]['belongsTo'](db[_0x0c28('0x10b')],{'as':_0x0c28('0x176'),'foreignKey':_0x0c28('0x1f7')});db[_0x0c28('0x10e')][_0x0c28('0x156')](db[_0x0c28('0x130')],{'as':_0x0c28('0x167'),'foreignKey':_0x0c28('0x177')});db[_0x0c28('0x10e')][_0x0c28('0x156')](db[_0x0c28('0x13')],{'as':_0x0c28('0x186'),'foreignKey':_0x0c28('0x11e')});db[_0x0c28('0x10e')][_0x0c28('0x12d')](db[_0x0c28('0x178')],{'through':'whatsapp_interaction_has_tags','as':_0x0c28('0x17a')});db[_0x0c28('0x10e')][_0x0c28('0x12d')](db['Tag'],{'through':_0x0c28('0x1b6'),'as':_0x0c28('0x17b')});db[_0x0c28('0x10e')]['belongsToMany'](db[_0x0c28('0x13')],{'as':_0x0c28('0x17c'),'through':_0x0c28('0x139'),'foreignKey':_0x0c28('0x1fa')});db[_0x0c28('0x1f8')]['belongsTo'](db[_0x0c28('0x13')],{'as':_0x0c28('0x13')});db[_0x0c28('0x1f8')][_0x0c28('0x156')](db[_0x0c28('0x130')],{'onDelete':_0x0c28('0x11d'),'as':_0x0c28('0x167')});db[_0x0c28('0x1f8')][_0x0c28('0x156')](db[_0x0c28('0x10e')],{'onDelete':_0x0c28('0x11d'),'as':_0x0c28('0x17e'),'foreignKey':_0x0c28('0x1fa')});db[_0x0c28('0x1f8')][_0x0c28('0x156')](db[_0x0c28('0x10b')],{'as':_0x0c28('0x176'),'foreignKey':_0x0c28('0x1f7')});db[_0x0c28('0x10f')][_0x0c28('0x156')](db[_0x0c28('0x10b')],{});db[_0x0c28('0x10f')]['belongsTo'](db['CmList'],{'as':_0x0c28('0x170'),'foreignKey':_0x0c28('0x181')});db[_0x0c28('0x10f')][_0x0c28('0x156')](db[_0x0c28('0x130')],{'as':_0x0c28('0x167'),'foreignKey':'ContactId'});db[_0x0c28('0x10f')][_0x0c28('0x156')](db[_0x0c28('0x10e')],{});db['WhatsappQueueReport'][_0x0c28('0x156')](db['WhatsappQueue'],{});db[_0x0c28('0x10f')][_0x0c28('0x156')](db[_0x0c28('0x1f8')],{});db[_0x0c28('0x10f')][_0x0c28('0x156')](db['User'],{});db['WhatsappTransferReport'][_0x0c28('0x156')](db[_0x0c28('0x1f8')],{});db['WhatsappTransferReport'][_0x0c28('0x156')](db['WhatsappInteraction'],{});db[_0x0c28('0x1fb')][_0x0c28('0x156')](db['WhatsappAccount'],{'foreignKey':_0x0c28('0x1fc'),'as':'FromAccount'});db[_0x0c28('0x1fb')]['belongsTo'](db[_0x0c28('0x10b')],{'foreignKey':_0x0c28('0x1fd'),'as':_0x0c28('0x1e7')});db[_0x0c28('0x1fb')][_0x0c28('0x156')](db['WhatsappQueue'],{'foreignKey':_0x0c28('0x1fe'),'as':'ToQueue'});db[_0x0c28('0x1fb')][_0x0c28('0x156')](db['User'],{'foreignKey':_0x0c28('0x1e0'),'as':_0x0c28('0x1e1')});db['WhatsappTransferReport'][_0x0c28('0x156')](db['User'],{'foreignKey':_0x0c28('0x1e2'),'as':_0x0c28('0x1e3')});db[_0x0c28('0x112')]['belongsToMany'](db[_0x0c28('0x13')],{'as':_0x0c28('0x173'),'through':_0x0c28('0x141'),'foreignKey':'WhatsappQueueId'});db[_0x0c28('0x112')][_0x0c28('0x12d')](db[_0x0c28('0xef')],{'through':'team_has_whatsapp_queues','as':'Teams'});db[_0x0c28('0x11a')][_0x0c28('0x156')](db[_0x0c28('0x13')],{'as':_0x0c28('0x1ff'),'foreignKey':_0x0c28('0x11e'),'onDelete':_0x0c28('0x11d'),'hooks':!![]});db[_0x0c28('0x114')][_0x0c28('0x11c')](db[_0x0c28('0x1ce')],{'as':'Dynamics365Account','onDelete':_0x0c28('0x16a')});db[_0x0c28('0x114')]['hasOne'](db[_0x0c28('0x3c')],{'as':_0x0c28('0x16c'),'onDelete':_0x0c28('0x16a')});db[_0x0c28('0x114')][_0x0c28('0x11c')](db[_0x0c28('0x16b')],{'as':_0x0c28('0x16d'),'onDelete':_0x0c28('0x16a')});module[_0x0c28('0x200')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 1717d8a..c9627a4 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb138=['/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/condition','/api/intervals','./api/interval','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','./api/template','/api/triggers','./api/trigger','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/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/integrations/zoho/configurations','./api/intZohoConfiguration','./api/intZohoField','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','./api/intServicenowField','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','/api/teams','./api/team','/api/campaigns','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','./api/mailTransferReport','./api/chatTransferReport','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','./api/cmList','/api/voice/prefixes','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','/api/whatsapp/reports/transfer','/api/whatsapp/queues','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/user-settings','/api/auth/local','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','/api/jira','./api/jira','/api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','./api/webbar','/api/logs','/apidoc','join','root','/www','static','/demo','/snippet','snippet','3.0.0','/plugins','/server/files/plugins','/:url(api|auth|components|app|bower_components|assets)/*','get','route','resolve','appPath','/index.html','path','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','then','use','./api/user','./api/voiceChanSpy','/api/voice/contexts','/api/voice/extensions','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails/messages','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/substatuses','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','/api/mail/applications','./api/mailQueueReport','./api/dashboard','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','/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/sms/messages','/api/sms/queues','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','./api/chatProactiveAction'];(function(_0x1b9e6b,_0x351c34){var _0x5977fe=function(_0x47075c){while(--_0x47075c){_0x1b9e6b['push'](_0x1b9e6b['shift']());}};_0x5977fe(++_0x351c34);}(_0xb138,0x1dd));var _0x8b13=function(_0x5c4203,_0x24e655){_0x5c4203=_0x5c4203-0x0;var _0x1c0640=_0xb138[_0x5c4203];return _0x1c0640;};'use strict';var path=require(_0x8b13('0x0'));var express=require(_0x8b13('0x1'));var errors=require(_0x8b13('0x2'));var config=require(_0x8b13('0x3'));var setupLoggers=require(_0x8b13('0x4'))[_0x8b13('0x5')];var clientSideLogs=require(_0x8b13('0x6'));exports['default']=function(_0x4411a0){return setupLoggers(_0x4411a0)[_0x8b13('0x7')](function(){_0x4411a0[_0x8b13('0x8')]('/api/users',require(_0x8b13('0x9')));_0x4411a0[_0x8b13('0x8')]('/api/voice/chanspy',require(_0x8b13('0xa')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0xb'),require('./api/voiceContext'));_0x4411a0[_0x8b13('0x8')](_0x8b13('0xc'),require('./api/voiceExtension'));_0x4411a0['use'](_0x8b13('0xd'),require(_0x8b13('0xe')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0xf'),require(_0x8b13('0x10')));_0x4411a0['use'](_0x8b13('0x11'),require(_0x8b13('0x12')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x13'),require(_0x8b13('0x14')));_0x4411a0[_0x8b13('0x8')]('/api/voice/mails',require('./api/voiceMail'));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x15'),require('./api/voiceMailMessage'));_0x4411a0['use']('/api/voice/calls/reports',require(_0x8b13('0x16')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x17'),require(_0x8b13('0x18')));_0x4411a0[_0x8b13('0x8')]('/api/voice/agents/reports',require(_0x8b13('0x19')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x1a'),require(_0x8b13('0x1b')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x1c'),require(_0x8b13('0x1d')));_0x4411a0[_0x8b13('0x8')]('/api/trunks',require('./api/trunk'));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x1e'),require(_0x8b13('0x1f')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x20'),require(_0x8b13('0x21')));_0x4411a0['use'](_0x8b13('0x22'),require(_0x8b13('0x23')));_0x4411a0[_0x8b13('0x8')]('/api/mail/queues',require('./api/mailQueue'));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x24'),require('./api/mailSubstatus'));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x25'),require(_0x8b13('0x26')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x27'),require('./api/mailMessage'));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x28'),require('./api/mailApplication'));_0x4411a0[_0x8b13('0x8')]('/api/mail/reports/queue',require(_0x8b13('0x29')));_0x4411a0[_0x8b13('0x8')]('/api/dashboards',require(_0x8b13('0x2a')));_0x4411a0[_0x8b13('0x8')]('/api/dashboards/items',require(_0x8b13('0x2b')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x2c'),require(_0x8b13('0x2d')));_0x4411a0[_0x8b13('0x8')]('/api/fax/applications',require(_0x8b13('0x2e')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x2f'),require(_0x8b13('0x30')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x31'),require('./api/faxMessage'));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x32'),require(_0x8b13('0x33')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x34'),require(_0x8b13('0x35')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x36'),require(_0x8b13('0x37')));_0x4411a0['use'](_0x8b13('0x38'),require(_0x8b13('0x39')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x3a'),require('./api/smsInteraction'));_0x4411a0['use'](_0x8b13('0x3b'),require('./api/smsMessage'));_0x4411a0['use'](_0x8b13('0x3c'),require('./api/smsQueue'));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x3d'),require(_0x8b13('0x3e')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x3f'),require(_0x8b13('0x40')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x41'),require(_0x8b13('0x42')));_0x4411a0[_0x8b13('0x8')]('/api/openchannel/messages',require(_0x8b13('0x43')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x44'),require(_0x8b13('0x45')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x46'),require(_0x8b13('0x47')));_0x4411a0[_0x8b13('0x8')]('/api/openchannel/reports/queue',require(_0x8b13('0x48')));_0x4411a0['use'](_0x8b13('0x49'),require(_0x8b13('0x4a')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x4b'),require(_0x8b13('0x4c')));_0x4411a0[_0x8b13('0x8')]('/api/chat/messages',require('./api/chatMessage'));_0x4411a0[_0x8b13('0x8')]('/api/chat/offline_messages',require(_0x8b13('0x4d')));_0x4411a0['use'](_0x8b13('0x4e'),require(_0x8b13('0x4f')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x50'),require(_0x8b13('0x51')));_0x4411a0['use']('/api/chat/proactive_actions',require(_0x8b13('0x52')));_0x4411a0['use'](_0x8b13('0x53'),require(_0x8b13('0x54')));_0x4411a0['use'](_0x8b13('0x55'),require(_0x8b13('0x56')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x57'),require(_0x8b13('0x58')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x59'),require('./api/cmHopperBlack'));_0x4411a0['use']('/api/cm/hopper_final',require(_0x8b13('0x5a')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x5b'),require(_0x8b13('0x5c')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x5d'),require('./api/cmCustomField'));_0x4411a0[_0x8b13('0x8')]('/api/actions',require(_0x8b13('0x5e')));_0x4411a0['use'](_0x8b13('0x5f'),require(_0x8b13('0x60')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x61'),require(_0x8b13('0x62')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x63'),require('./api/disposition'));_0x4411a0['use']('/api/conditions',require(_0x8b13('0x64')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x65'),require(_0x8b13('0x66')));_0x4411a0['use']('/api/pauses',require(_0x8b13('0x67')));_0x4411a0['use'](_0x8b13('0x68'),require(_0x8b13('0x69')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x6a'),require(_0x8b13('0x6b')));_0x4411a0['use'](_0x8b13('0x6c'),require(_0x8b13('0x6d')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x6e'),require(_0x8b13('0x6f')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x70'),require(_0x8b13('0x71')));_0x4411a0[_0x8b13('0x8')]('/api/templates',require(_0x8b13('0x72')));_0x4411a0['use'](_0x8b13('0x73'),require(_0x8b13('0x74')));_0x4411a0[_0x8b13('0x8')]('/api/variables',require(_0x8b13('0x75')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x76'),require(_0x8b13('0x77')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x78'),require(_0x8b13('0x79')));_0x4411a0['use'](_0x8b13('0x7a'),require('./api/analyticCustomReport'));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x7b'),require(_0x8b13('0x7c')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x7d'),require(_0x8b13('0x7e')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x7f'),require(_0x8b13('0x80')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x81'),require(_0x8b13('0x82')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x83'),require(_0x8b13('0x84')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x85'),require('./api/intSalesforceAccount'));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x86'),require('./api/intSalesforceConfiguration'));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x87'),require(_0x8b13('0x88')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x89'),require(_0x8b13('0x8a')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x8b'),require(_0x8b13('0x8c')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x8d'),require(_0x8b13('0x8e')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x8f'),require(_0x8b13('0x90')));_0x4411a0['use'](_0x8b13('0x91'),require(_0x8b13('0x92')));_0x4411a0['use'](_0x8b13('0x93'),require(_0x8b13('0x94')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x95'),require(_0x8b13('0x96')));_0x4411a0['use'](_0x8b13('0x97'),require(_0x8b13('0x98')));_0x4411a0[_0x8b13('0x8')]('/api/integrations/zoho/fields',require(_0x8b13('0x99')));_0x4411a0[_0x8b13('0x8')]('/api/integrations/zendesk/accounts',require(_0x8b13('0x9a')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x9b'),require(_0x8b13('0x9c')));_0x4411a0['use'](_0x8b13('0x9d'),require(_0x8b13('0x9e')));_0x4411a0['use'](_0x8b13('0x9f'),require(_0x8b13('0xa0')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0xa1'),require('./api/intFreshdeskConfiguration'));_0x4411a0[_0x8b13('0x8')](_0x8b13('0xa2'),require(_0x8b13('0xa3')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0xa4'),require(_0x8b13('0xa5')));_0x4411a0['use'](_0x8b13('0xa6'),require(_0x8b13('0xa7')));_0x4411a0[_0x8b13('0x8')]('/api/integrations/vtiger/fields',require(_0x8b13('0xa8')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0xa9'),require(_0x8b13('0xaa')));_0x4411a0['use']('/api/integrations/servicenow/configurations',require('./api/intServicenowConfiguration'));_0x4411a0['use']('/api/integrations/servicenow/fields',require(_0x8b13('0xab')));_0x4411a0[_0x8b13('0x8')]('/api/integrations/dynamics365/accounts',require(_0x8b13('0xac')));_0x4411a0['use'](_0x8b13('0xad'),require(_0x8b13('0xae')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0xaf'),require(_0x8b13('0xb0')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0xb1'),require('./api/intFreshsalesAccount'));_0x4411a0[_0x8b13('0x8')]('/api/integrations/freshsales/configurations',require(_0x8b13('0xb2')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0xb3'),require(_0x8b13('0xb4')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0xb5'),require(_0x8b13('0xb6')));_0x4411a0['use'](_0x8b13('0xb7'),require('./api/chatQueueReport'));_0x4411a0[_0x8b13('0x8')](_0x8b13('0xb8'),require(_0x8b13('0xb9')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0xba'),require('./api/jscriptyAnswerReport'));_0x4411a0['use'](_0x8b13('0xbb'),require(_0x8b13('0xbc')));_0x4411a0['use'](_0x8b13('0xbd'),require(_0x8b13('0xbe')));_0x4411a0[_0x8b13('0x8')]('/api/sms/reports/queue',require(_0x8b13('0xbf')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0xc0'),require(_0x8b13('0xc1')));_0x4411a0['use'](_0x8b13('0xc2'),require(_0x8b13('0xc3')));_0x4411a0['use'](_0x8b13('0xc4'),require(_0x8b13('0xc5')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0xc6'),require(_0x8b13('0xc7')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0xc8'),require(_0x8b13('0xc9')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0xca'),require(_0x8b13('0xcb')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0xcc'),require(_0x8b13('0xcd')));_0x4411a0['use'](_0x8b13('0xce'),require('./api/squareMessage'));_0x4411a0[_0x8b13('0x8')](_0x8b13('0xcf'),require(_0x8b13('0xd0')));_0x4411a0[_0x8b13('0x8')]('/api/license',require('./api/license'));_0x4411a0[_0x8b13('0x8')](_0x8b13('0xd1'),require('./api/campaign'));_0x4411a0[_0x8b13('0x8')](_0x8b13('0xd2'),require(_0x8b13('0xd3')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0xd4'),require(_0x8b13('0xd5')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0xd6'),require(_0x8b13('0xd7')));_0x4411a0[_0x8b13('0x8')]('/api/mail/reports/transfer',require(_0x8b13('0xd8')));_0x4411a0[_0x8b13('0x8')]('/api/chat/reports/transfer',require(_0x8b13('0xd9')));_0x4411a0[_0x8b13('0x8')]('/api/fax/reports/transfer',require(_0x8b13('0xda')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0xdb'),require(_0x8b13('0xdc')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0xdd'),require(_0x8b13('0xde')));_0x4411a0[_0x8b13('0x8')]('/api/cm/lists',require(_0x8b13('0xdf')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0xe0'),require('./api/voicePrefix'));_0x4411a0[_0x8b13('0x8')]('/api/userProfiles',require(_0x8b13('0xe1')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0xe2'),require(_0x8b13('0xe3')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0xe4'),require(_0x8b13('0xe5')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0xe6'),require(_0x8b13('0xe7')));_0x4411a0['use'](_0x8b13('0xe8'),require(_0x8b13('0xe9')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0xea'),require(_0x8b13('0xeb')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0xec'),require(_0x8b13('0xed')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0xee'),require(_0x8b13('0xef')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0xf0'),require('./api/whatsappQueueReport'));_0x4411a0['use'](_0x8b13('0xf1'),require('./api/whatsappTransferReport'));_0x4411a0[_0x8b13('0x8')](_0x8b13('0xf2'),require('./api/whatsappQueue'));_0x4411a0['use'](_0x8b13('0xf3'),require(_0x8b13('0xf4')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0xf5'),require(_0x8b13('0xf6')));_0x4411a0['use'](_0x8b13('0xf7'),require('./api/user-setting'));_0x4411a0[_0x8b13('0x8')](_0x8b13('0xf8'),require('./api/authLocal'));_0x4411a0[_0x8b13('0x8')](_0x8b13('0xf9'),require(_0x8b13('0xfa')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0xfb'),require('./api/authActiveDirectory'));_0x4411a0[_0x8b13('0x8')](_0x8b13('0xfc'),require(_0x8b13('0xfd')));_0x4411a0['use'](_0x8b13('0xfe'),require('./api/rpc'));_0x4411a0[_0x8b13('0x8')](_0x8b13('0xff'),require(_0x8b13('0x100')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x101'),require(_0x8b13('0x102')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x103'),require(_0x8b13('0x104')));_0x4411a0[_0x8b13('0x8')]('/api/webbar',require(_0x8b13('0x105')));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x106'),clientSideLogs);_0x4411a0[_0x8b13('0x8')](_0x8b13('0x107'),express['static'](path[_0x8b13('0x108')](config[_0x8b13('0x109')],_0x8b13('0x107'))));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x10a'),express[_0x8b13('0x10b')](path['join'](config[_0x8b13('0x109')],_0x8b13('0x10a'))));_0x4411a0['use'](_0x8b13('0x10c'),express['static'](path[_0x8b13('0x108')](config['root'],_0x8b13('0x10c'))));_0x4411a0[_0x8b13('0x8')](_0x8b13('0x10d'),express[_0x8b13('0x10b')](path[_0x8b13('0x108')](config[_0x8b13('0x109')],_0x8b13('0x10e'),_0x8b13('0x10f'))));_0x4411a0['use'](_0x8b13('0x110'),express[_0x8b13('0x10b')](path['join'](config[_0x8b13('0x109')],_0x8b13('0x111'))));_0x4411a0['route'](_0x8b13('0x112'))[_0x8b13('0x113')](errors[0x194]);_0x4411a0[_0x8b13('0x114')]('/*')[_0x8b13('0x113')](function(_0x1f333e,_0x518b59){_0x518b59['sendFile'](path[_0x8b13('0x115')](_0x4411a0[_0x8b13('0x113')](_0x8b13('0x116'))+_0x8b13('0x117')));});return _0x4411a0;});}; \ No newline at end of file +var _0x6f47=['/api/openchannel/messages','/api/openchannel/queues','./api/openchannelQueue','/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/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','./api/cmCustomField','/api/automations','./api/automation','/api/canned_answers','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/cdr','./api/cdr','/api/voiceQueuesLog','/api/schedules','/api/sounds','/api/tags','./api/tag','/api/templates','/api/triggers','./api/trigger','/api/variables','./api/variable','./api/integration','/api/integrations/reports','./api/integrationReport','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','./api/analyticExtractedReport','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmField','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/configurations','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','/api/integrations/freshdesk/fields','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','/api/integrations/dynamics365/fields','./api/intDynamics365Field','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','./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/square/reports','/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/square/messages','./api/squareMessage','./api/team','/api/license','/api/campaigns','./api/campaign','/api/migrations','./api/attachment','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/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/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','./api/user-setting','/api/auth/local','./api/authLocal','/api/auth/google','./api/authActiveDirectory','/api/rpc','./api/rpc','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/logs','static','join','root','/apidoc','/www','/demo','/snippet','snippet','3.0.0','route','/:url(api|auth|components|app|bower_components|assets)/*','get','resolve','/index.html','express','./errors','./utils/client-side-logger','./api/client-side-logs','then','use','/api/users','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','./api/voiceMusicOnHold','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','/api/mail/reports/queue','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','./api/faxApplication','/api/fax/messages','./api/faxMessage','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','/api/openchannel/interactions','./api/openchannelInteraction'];(function(_0x23f845,_0x34b4f5){var _0x4cd3e5=function(_0x42d4fe){while(--_0x42d4fe){_0x23f845['push'](_0x23f845['shift']());}};_0x4cd3e5(++_0x34b4f5);}(_0x6f47,0xc7));var _0x76f4=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0x6f47[_0x38ced4];return _0x547c07;};'use strict';var path=require('path');var express=require(_0x76f4('0x0'));var errors=require(_0x76f4('0x1'));var config=require('./config/environment');var setupLoggers=require(_0x76f4('0x2'))['setupLoggers'];var clientSideLogs=require(_0x76f4('0x3'));exports['default']=function(_0xe214ad){return setupLoggers(_0xe214ad)[_0x76f4('0x4')](function(){_0xe214ad[_0x76f4('0x5')](_0x76f4('0x6'),require('./api/user'));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x7'),require(_0x76f4('0x8')));_0xe214ad['use'](_0x76f4('0x9'),require(_0x76f4('0xa')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xb'),require(_0x76f4('0xc')));_0xe214ad['use']('/api/voice/mohs',require(_0x76f4('0xd')));_0xe214ad[_0x76f4('0x5')]('/api/voice/queues',require('./api/voiceQueue'));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xe'),require(_0x76f4('0xf')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x10'),require(_0x76f4('0x11')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x12'),require(_0x76f4('0x13')));_0xe214ad['use'](_0x76f4('0x14'),require(_0x76f4('0x15')));_0xe214ad['use']('/api/voice/calls/reports',require('./api/voiceCallReport'));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x16'),require(_0x76f4('0x17')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x18'),require(_0x76f4('0x19')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x1a'),require(_0x76f4('0x1b')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x1c'),require(_0x76f4('0x1d')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x1e'),require(_0x76f4('0x1f')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x20'),require(_0x76f4('0x21')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x22'),require(_0x76f4('0x23')));_0xe214ad[_0x76f4('0x5')]('/api/mail/accounts',require(_0x76f4('0x24')));_0xe214ad['use'](_0x76f4('0x25'),require(_0x76f4('0x26')));_0xe214ad[_0x76f4('0x5')]('/api/mail/substatuses',require('./api/mailSubstatus'));_0xe214ad['use'](_0x76f4('0x27'),require(_0x76f4('0x28')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x29'),require(_0x76f4('0x2a')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x2b'),require('./api/mailApplication'));_0xe214ad['use'](_0x76f4('0x2c'),require('./api/mailQueueReport'));_0xe214ad[_0x76f4('0x5')]('/api/dashboards',require('./api/dashboard'));_0xe214ad['use'](_0x76f4('0x2d'),require(_0x76f4('0x2e')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x2f'),require(_0x76f4('0x30')));_0xe214ad[_0x76f4('0x5')]('/api/fax/applications',require(_0x76f4('0x31')));_0xe214ad['use']('/api/fax/interactions',require('./api/faxInteraction'));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x32'),require(_0x76f4('0x33')));_0xe214ad[_0x76f4('0x5')]('/api/fax/queues',require(_0x76f4('0x34')));_0xe214ad['use'](_0x76f4('0x35'),require(_0x76f4('0x36')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x37'),require(_0x76f4('0x38')));_0xe214ad['use']('/api/sms/applications',require(_0x76f4('0x39')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x3a'),require(_0x76f4('0x3b')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x3c'),require(_0x76f4('0x3d')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x3e'),require(_0x76f4('0x3f')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x40'),require('./api/openchannelAccount'));_0xe214ad['use']('/api/openchannel/applications',require('./api/openchannelApplication'));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x41'),require(_0x76f4('0x42')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x43'),require('./api/openchannelMessage'));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x44'),require(_0x76f4('0x45')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x46'),require(_0x76f4('0x47')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x48'),require(_0x76f4('0x49')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x4a'),require(_0x76f4('0x4b')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x4c'),require(_0x76f4('0x4d')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x4e'),require(_0x76f4('0x4f')));_0xe214ad['use'](_0x76f4('0x50'),require(_0x76f4('0x51')));_0xe214ad[_0x76f4('0x5')]('/api/chat/queues',require('./api/chatQueue'));_0xe214ad[_0x76f4('0x5')]('/api/chat/groups',require(_0x76f4('0x52')));_0xe214ad['use'](_0x76f4('0x53'),require(_0x76f4('0x54')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x55'),require(_0x76f4('0x56')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x57'),require(_0x76f4('0x58')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x59'),require('./api/cmHopper'));_0xe214ad['use'](_0x76f4('0x5a'),require(_0x76f4('0x5b')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x5c'),require(_0x76f4('0x5d')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x5e'),require(_0x76f4('0x5f')));_0xe214ad[_0x76f4('0x5')]('/api/cm/custom_fields',require(_0x76f4('0x60')));_0xe214ad[_0x76f4('0x5')]('/api/actions',require('./api/action'));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x61'),require(_0x76f4('0x62')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x63'),require('./api/cannedAnswer'));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x64'),require(_0x76f4('0x65')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x66'),require(_0x76f4('0x67')));_0xe214ad['use'](_0x76f4('0x68'),require(_0x76f4('0x69')));_0xe214ad[_0x76f4('0x5')]('/api/pauses',require('./api/pause'));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x6a'),require(_0x76f4('0x6b')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x6c'),require('./api/voiceQueuesLog'));_0xe214ad['use'](_0x76f4('0x6d'),require('./api/schedule'));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x6e'),require('./api/sound'));_0xe214ad['use'](_0x76f4('0x6f'),require(_0x76f4('0x70')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x71'),require('./api/template'));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x72'),require(_0x76f4('0x73')));_0xe214ad['use'](_0x76f4('0x74'),require(_0x76f4('0x75')));_0xe214ad['use']('/api/integrations',require(_0x76f4('0x76')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x77'),require(_0x76f4('0x78')));_0xe214ad[_0x76f4('0x5')]('/api/analytics/custom_reports',require(_0x76f4('0x79')));_0xe214ad['use'](_0x76f4('0x7a'),require(_0x76f4('0x7b')));_0xe214ad[_0x76f4('0x5')]('/api/analytics/extracted_reports',require(_0x76f4('0x7c')));_0xe214ad[_0x76f4('0x5')]('/api/analytics/metrics',require(_0x76f4('0x7d')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x7e'),require(_0x76f4('0x7f')));_0xe214ad[_0x76f4('0x5')]('/api/analytics/tree_reports',require(_0x76f4('0x80')));_0xe214ad['use'](_0x76f4('0x81'),require(_0x76f4('0x82')));_0xe214ad[_0x76f4('0x5')]('/api/integrations/salesforce/configurations',require(_0x76f4('0x83')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x84'),require(_0x76f4('0x85')));_0xe214ad['use'](_0x76f4('0x86'),require(_0x76f4('0x87')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x88'),require('./api/intSugarcrmConfiguration'));_0xe214ad[_0x76f4('0x5')]('/api/integrations/sugarcrm/fields',require(_0x76f4('0x89')));_0xe214ad[_0x76f4('0x5')]('/api/integrations/desk/accounts',require('./api/intDeskAccount'));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x8a'),require(_0x76f4('0x8b')));_0xe214ad['use'](_0x76f4('0x8c'),require(_0x76f4('0x8d')));_0xe214ad[_0x76f4('0x5')]('/api/integrations/zoho/accounts',require('./api/intZohoAccount'));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x8e'),require('./api/intZohoConfiguration'));_0xe214ad['use'](_0x76f4('0x8f'),require(_0x76f4('0x90')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x91'),require(_0x76f4('0x92')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x93'),require(_0x76f4('0x94')));_0xe214ad[_0x76f4('0x5')]('/api/integrations/zendesk/fields',require('./api/intZendeskField'));_0xe214ad['use'](_0x76f4('0x95'),require(_0x76f4('0x96')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x97'),require('./api/intFreshdeskConfiguration'));_0xe214ad['use'](_0x76f4('0x98'),require('./api/intFreshdeskField'));_0xe214ad[_0x76f4('0x5')]('/api/integrations/vtiger/accounts',require(_0x76f4('0x99')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x9a'),require(_0x76f4('0x9b')));_0xe214ad['use'](_0x76f4('0x9c'),require(_0x76f4('0x9d')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x9e'),require(_0x76f4('0x9f')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xa0'),require('./api/intServicenowConfiguration'));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xa1'),require(_0x76f4('0xa2')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xa3'),require(_0x76f4('0xa4')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xa5'),require('./api/intDynamics365Configuration'));_0xe214ad['use'](_0x76f4('0xa6'),require(_0x76f4('0xa7')));_0xe214ad[_0x76f4('0x5')]('/api/integrations/freshsales/accounts',require(_0x76f4('0xa8')));_0xe214ad['use'](_0x76f4('0xa9'),require(_0x76f4('0xaa')));_0xe214ad['use'](_0x76f4('0xab'),require(_0x76f4('0xac')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xad'),require(_0x76f4('0xae')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xaf'),require(_0x76f4('0xb0')));_0xe214ad[_0x76f4('0x5')]('/api/chat/internal/messages',require(_0x76f4('0xb1')));_0xe214ad['use'](_0x76f4('0xb2'),require(_0x76f4('0xb3')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xb4'),require(_0x76f4('0xb5')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xb6'),require(_0x76f4('0xb7')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xb8'),require('./api/smsQueueReport'));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xb9'),require('./api/squareReport'));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xba'),require(_0x76f4('0xbb')));_0xe214ad['use'](_0x76f4('0xbc'),require(_0x76f4('0xbd')));_0xe214ad[_0x76f4('0x5')]('/api/settings',require(_0x76f4('0xbe')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xbf'),require(_0x76f4('0xc0')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xc1'),require(_0x76f4('0xc2')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xc3'),require('./api/squareRecording'));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xc4'),require(_0x76f4('0xc5')));_0xe214ad[_0x76f4('0x5')]('/api/teams',require(_0x76f4('0xc6')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xc7'),require('./api/license'));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xc8'),require(_0x76f4('0xc9')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xca'),require('./api/migration'));_0xe214ad[_0x76f4('0x5')]('/api/attachments',require(_0x76f4('0xcb')));_0xe214ad[_0x76f4('0x5')]('/api/plugins',require('./api/plugin'));_0xe214ad['use'](_0x76f4('0xcc'),require(_0x76f4('0xcd')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xce'),require(_0x76f4('0xcf')));_0xe214ad[_0x76f4('0x5')]('/api/fax/reports/transfer',require(_0x76f4('0xd0')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xd1'),require(_0x76f4('0xd2')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xd3'),require(_0x76f4('0xd4')));_0xe214ad[_0x76f4('0x5')]('/api/cm/lists',require(_0x76f4('0xd5')));_0xe214ad['use'](_0x76f4('0xd6'),require(_0x76f4('0xd7')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xd8'),require(_0x76f4('0xd9')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xda'),require(_0x76f4('0xdb')));_0xe214ad['use'](_0x76f4('0xdc'),require('./api/userProfileResource'));_0xe214ad['use']('/api/userNotifications',require(_0x76f4('0xdd')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xde'),require(_0x76f4('0xdf')));_0xe214ad['use'](_0x76f4('0xe0'),require(_0x76f4('0xe1')));_0xe214ad[_0x76f4('0x5')]('/api/whatsapp/interactions',require(_0x76f4('0xe2')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xe3'),require(_0x76f4('0xe4')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xe5'),require(_0x76f4('0xe6')));_0xe214ad['use'](_0x76f4('0xe7'),require(_0x76f4('0xe8')));_0xe214ad['use'](_0x76f4('0xe9'),require(_0x76f4('0xea')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xeb'),require(_0x76f4('0xec')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xed'),require(_0x76f4('0xee')));_0xe214ad[_0x76f4('0x5')]('/api/user-settings',require(_0x76f4('0xef')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xf0'),require(_0x76f4('0xf1')));_0xe214ad['use'](_0x76f4('0xf2'),require('./api/authGoogle'));_0xe214ad[_0x76f4('0x5')]('/api/auth/activedirectory',require(_0x76f4('0xf3')));_0xe214ad[_0x76f4('0x5')]('/api/jira',require('./api/jira'));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xf4'),require(_0x76f4('0xf5')));_0xe214ad['use']('/api/version',require(_0x76f4('0xf6')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xf7'),require(_0x76f4('0xf8')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xf9'),require(_0x76f4('0xfa')));_0xe214ad[_0x76f4('0x5')]('/api/webbar',require('./api/webbar'));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xfb'),clientSideLogs);_0xe214ad[_0x76f4('0x5')]('/apidoc',express[_0x76f4('0xfc')](path[_0x76f4('0xfd')](config[_0x76f4('0xfe')],_0x76f4('0xff'))));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x100'),express[_0x76f4('0xfc')](path['join'](config[_0x76f4('0xfe')],_0x76f4('0x100'))));_0xe214ad[_0x76f4('0x5')]('/demo',express[_0x76f4('0xfc')](path[_0x76f4('0xfd')](config[_0x76f4('0xfe')],_0x76f4('0x101'))));_0xe214ad['use'](_0x76f4('0x102'),express['static'](path[_0x76f4('0xfd')](config['root'],_0x76f4('0x103'),_0x76f4('0x104'))));_0xe214ad[_0x76f4('0x5')]('/plugins',express[_0x76f4('0xfc')](path[_0x76f4('0xfd')](config[_0x76f4('0xfe')],'/server/files/plugins')));_0xe214ad[_0x76f4('0x105')](_0x76f4('0x106'))['get'](errors[0x194]);_0xe214ad['route']('/*')[_0x76f4('0x107')](function(_0x39afa3,_0x515cfe){_0x515cfe['sendFile'](path[_0x76f4('0x108')](_0xe214ad[_0x76f4('0x107')]('appPath')+_0x76f4('0x109')));});return _0xe214ad;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 3d9ba8d..5c0bf5a 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8bda=['../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.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/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intDynamics365Account/intDynamics365Account.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/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','lodash','../config/environment','merge','../api/user/user.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/memberReport/memberReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc'];(function(_0x29bc1d,_0x138b6b){var _0x488d5f=function(_0xe3cc9e){while(--_0xe3cc9e){_0x29bc1d['push'](_0x29bc1d['shift']());}};_0x488d5f(++_0x138b6b);}(_0x8bda,0x1e6));var _0xa8bd=function(_0x4232d8,_0x13fd09){_0x4232d8=_0x4232d8-0x0;var _0x324de2=_0x8bda[_0x4232d8];return _0x324de2;};'use strict';var jayson=require('jayson/promise');var _=require(_0xa8bd('0x0'));var config=require(_0xa8bd('0x1'));exports['listen']=function(){return new Promise(function(_0x3feb07,_0x323b9d){var _0x4cb776={};_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require(_0xa8bd('0x3')));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require('../api/voiceExtension/voiceExtension.rpc'));_0x4cb776=_['merge'](_0x4cb776,require(_0xa8bd('0x4')));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require(_0xa8bd('0x5')));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require(_0xa8bd('0x6')));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require(_0xa8bd('0x7')));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require(_0xa8bd('0x8')));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require('../api/trunk/trunk.rpc'));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require(_0xa8bd('0x9')));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require(_0xa8bd('0xa')));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require(_0xa8bd('0xb')));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require('../api/mailAccount/mailAccount.rpc'));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require(_0xa8bd('0xc')));_0x4cb776=_['merge'](_0x4cb776,require(_0xa8bd('0xd')));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require(_0xa8bd('0xe')));_0x4cb776=_['merge'](_0x4cb776,require(_0xa8bd('0xf')));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require(_0xa8bd('0x10')));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require('../api/faxAccount/faxAccount.rpc'));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require(_0xa8bd('0x11')));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require(_0xa8bd('0x12')));_0x4cb776=_['merge'](_0x4cb776,require('../api/faxMessage/faxMessage.rpc'));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require(_0xa8bd('0x13')));_0x4cb776=_['merge'](_0x4cb776,require(_0xa8bd('0x14')));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require(_0xa8bd('0x15')));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require('../api/smsInteraction/smsInteraction.rpc'));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require(_0xa8bd('0x16')));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require(_0xa8bd('0x17')));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require(_0xa8bd('0x18')));_0x4cb776=_['merge'](_0x4cb776,require(_0xa8bd('0x19')));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require(_0xa8bd('0x1a')));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require(_0xa8bd('0x1b')));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require(_0xa8bd('0x1c')));_0x4cb776=_['merge'](_0x4cb776,require(_0xa8bd('0x1d')));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require(_0xa8bd('0x1e')));_0x4cb776=_['merge'](_0x4cb776,require(_0xa8bd('0x1f')));_0x4cb776=_['merge'](_0x4cb776,require('../api/cmContact/cmContact.rpc'));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require(_0xa8bd('0x20')));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require(_0xa8bd('0x21')));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require(_0xa8bd('0x22')));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require(_0xa8bd('0x23')));_0x4cb776=_['merge'](_0x4cb776,require(_0xa8bd('0x24')));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require(_0xa8bd('0x25')));_0x4cb776=_['merge'](_0x4cb776,require(_0xa8bd('0x26')));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require('../api/sound/sound.rpc'));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require(_0xa8bd('0x27')));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require(_0xa8bd('0x28')));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require(_0xa8bd('0x29')));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require(_0xa8bd('0x2a')));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require(_0xa8bd('0x2b')));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require(_0xa8bd('0x2c')));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x4cb776=_['merge'](_0x4cb776,require(_0xa8bd('0x2d')));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require(_0xa8bd('0x2e')));_0x4cb776=_['merge'](_0x4cb776,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require(_0xa8bd('0x2f')));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require(_0xa8bd('0x30')));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require(_0xa8bd('0x31')));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require(_0xa8bd('0x32')));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require(_0xa8bd('0x33')));_0x4cb776=_['merge'](_0x4cb776,require(_0xa8bd('0x34')));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require(_0xa8bd('0x35')));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require(_0xa8bd('0x36')));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require(_0xa8bd('0x37')));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require(_0xa8bd('0x38')));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require('../api/campaign/campaign.rpc'));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require(_0xa8bd('0x39')));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require(_0xa8bd('0x3a')));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require(_0xa8bd('0x3b')));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require(_0xa8bd('0x3c')));_0x4cb776=_['merge'](_0x4cb776,require(_0xa8bd('0x3d')));_0x4cb776=_[_0xa8bd('0x2')](_0x4cb776,require(_0xa8bd('0x3e')));_0x4cb776=_['merge'](_0x4cb776,require(_0xa8bd('0x3f')));var _0x14a9cc=jayson[_0xa8bd('0x40')](_0x4cb776)['http']();var _0x5d0d7e=config[_0xa8bd('0x41')][_0xa8bd('0x42')]||config[_0xa8bd('0x42')]+0x1;var _0x5acfa5=config['rpc']['ip']||_0xa8bd('0x43');_0x14a9cc['on'](_0xa8bd('0x44'),function(_0x20d0ce){return _0x323b9d(_0x20d0ce);});_0x14a9cc['listen'](_0x5d0d7e,_0x5acfa5,function(){console[_0xa8bd('0x45')](_0xa8bd('0x46'),_0x5acfa5,_0x5d0d7e);require(_0xa8bd('0x47'))[_0xa8bd('0x48')]();return _0x3feb07(_0xa8bd('0x49')+_0x5acfa5+':'+_0x5d0d7e);});});}; \ No newline at end of file +var _0x2c1a=['../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.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/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.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/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','http','rpc','port','localhost','error','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailApplication/mailApplication.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/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc'];(function(_0x4dcef2,_0x52845d){var _0xe80f33=function(_0x510b1c){while(--_0x510b1c){_0x4dcef2['push'](_0x4dcef2['shift']());}};_0xe80f33(++_0x52845d);}(_0x2c1a,0x151));var _0xa2c1=function(_0x4aaa47,_0x5a6913){_0x4aaa47=_0x4aaa47-0x0;var _0x25b5c4=_0x2c1a[_0x4aaa47];return _0x25b5c4;};'use strict';var jayson=require(_0xa2c1('0x0'));var _=require(_0xa2c1('0x1'));var config=require('../config/environment');exports[_0xa2c1('0x2')]=function(){return new Promise(function(_0x2599a9,_0xa154d8){var _0x5007a7={};_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require(_0xa2c1('0x4')));_0x5007a7=_['merge'](_0x5007a7,require(_0xa2c1('0x5')));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require('../api/voiceQueue/voiceQueue.rpc'));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require(_0xa2c1('0x6')));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require(_0xa2c1('0x7')));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require(_0xa2c1('0x8')));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require(_0xa2c1('0x9')));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x5007a7=_['merge'](_0x5007a7,require('../api/memberReport/memberReport.rpc'));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require('../api/trunk/trunk.rpc'));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require(_0xa2c1('0xa')));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require(_0xa2c1('0xb')));_0x5007a7=_['merge'](_0x5007a7,require(_0xa2c1('0xc')));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require('../api/mailAccount/mailAccount.rpc'));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require(_0xa2c1('0xd')));_0x5007a7=_['merge'](_0x5007a7,require(_0xa2c1('0xe')));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require('../api/mailMessage/mailMessage.rpc'));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require(_0xa2c1('0xf')));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require(_0xa2c1('0x10')));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require(_0xa2c1('0x11')));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require(_0xa2c1('0x12')));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require(_0xa2c1('0x13')));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require(_0xa2c1('0x14')));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require(_0xa2c1('0x15')));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require(_0xa2c1('0x16')));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require('../api/smsAccount/smsAccount.rpc'));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require(_0xa2c1('0x17')));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require(_0xa2c1('0x18')));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require(_0xa2c1('0x19')));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require(_0xa2c1('0x1a')));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require(_0xa2c1('0x1b')));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require(_0xa2c1('0x1c')));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require(_0xa2c1('0x1d')));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require(_0xa2c1('0x1e')));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require(_0xa2c1('0x1f')));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require(_0xa2c1('0x20')));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require('../api/chatQueue/chatQueue.rpc'));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require(_0xa2c1('0x21')));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require(_0xa2c1('0x22')));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require(_0xa2c1('0x23')));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require(_0xa2c1('0x24')));_0x5007a7=_['merge'](_0x5007a7,require(_0xa2c1('0x25')));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require(_0xa2c1('0x26')));_0x5007a7=_['merge'](_0x5007a7,require(_0xa2c1('0x27')));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require(_0xa2c1('0x28')));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require('../api/sound/sound.rpc'));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require(_0xa2c1('0x29')));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require(_0xa2c1('0x2a')));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require(_0xa2c1('0x2b')));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require(_0xa2c1('0x2c')));_0x5007a7=_['merge'](_0x5007a7,require(_0xa2c1('0x2d')));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require(_0xa2c1('0x2e')));_0x5007a7=_['merge'](_0x5007a7,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require(_0xa2c1('0x2f')));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require(_0xa2c1('0x30')));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require(_0xa2c1('0x31')));_0x5007a7=_['merge'](_0x5007a7,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require(_0xa2c1('0x32')));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x5007a7=_['merge'](_0x5007a7,require(_0xa2c1('0x33')));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require(_0xa2c1('0x34')));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require('../api/squareReport/squareReport.rpc'));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require(_0xa2c1('0x35')));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require('../api/setting/setting.rpc'));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require(_0xa2c1('0x36')));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require(_0xa2c1('0x37')));_0x5007a7=_['merge'](_0x5007a7,require(_0xa2c1('0x38')));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require(_0xa2c1('0x39')));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require(_0xa2c1('0x3a')));_0x5007a7=_['merge'](_0x5007a7,require(_0xa2c1('0x3b')));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require(_0xa2c1('0x3c')));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require(_0xa2c1('0x3d')));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require(_0xa2c1('0x3e')));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require(_0xa2c1('0x3f')));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require(_0xa2c1('0x40')));_0x5007a7=_[_0xa2c1('0x3')](_0x5007a7,require(_0xa2c1('0x41')));var _0x4ec34c=jayson['server'](_0x5007a7)[_0xa2c1('0x42')]();var _0x258dc2=config[_0xa2c1('0x43')][_0xa2c1('0x44')]||config[_0xa2c1('0x44')]+0x1;var _0x11d2e7=config['rpc']['ip']||_0xa2c1('0x45');_0x4ec34c['on'](_0xa2c1('0x46'),function(_0x4c66be){return _0xa154d8(_0x4c66be);});_0x4ec34c['listen'](_0x258dc2,_0x11d2e7,function(){console['log']('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x11d2e7,_0x258dc2);require(_0xa2c1('0x47'))[_0xa2c1('0x48')]();return _0x2599a9(_0xa2c1('0x49')+_0x11d2e7+':'+_0x258dc2);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 162bdb5..7ee3e14 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 _0x50be=['GOTO\x20%s\x20%s\x20%s','getVariable','wav','BEEP','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','WAIT','label','exports','util','lodash','events','./reply','./error','call','setEncoding','utf8','headers','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','no\x20code','replace','result=','substr','indexOf','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','destroy','function','write','inherits','prototype','sendRequest','sync','answer','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','SAY\x20DIGITS\x20%s\x20%s','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setContext'];(function(_0x101469,_0x3cceef){var _0x4441e9=function(_0x30f754){while(--_0x30f754){_0x101469['push'](_0x101469['shift']());}};_0x4441e9(++_0x3cceef);}(_0x50be,0x191));var _0xe50b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x50be[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xe50b('0x0'));var _=require(_0xe50b('0x1'));var EventEmitter=require(_0xe50b('0x2'))['EventEmitter'];var AGIReply=require(_0xe50b('0x3'));var AGIError=require(_0xe50b('0x4'));function AGIChannel(_0x17fca2){var _0x1f24a4=this,_0x37abc4=new AGIReply(),_0x4f671a=![],_0x36c3c1={};EventEmitter[_0xe50b('0x5')](_0x1f24a4);_0x17fca2[_0xe50b('0x6')](_0xe50b('0x7'));_0x17fca2['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x37abc4['setEncoding']('utf8');_0x37abc4['on'](_0xe50b('0x8'),function(_0x49ec34){for(var _0x32bea3 in _0x49ec34){_0x1f24a4[_0x32bea3]=_0x49ec34[_0x32bea3];}_0x1f24a4[_0xe50b('0x9')](_0xe50b('0xa'));});_0x37abc4['on'](_0xe50b('0xb'),function(_0x55963a){if(_0x55963a[_0xe50b('0xc')]()==_0xe50b('0xd')){_0x1f24a4[_0xe50b('0x9')](_0xe50b('0xd'));return;}if(_0x55963a[_0xe50b('0xe')](0x0,0xb)==_0xe50b('0xf')){_0x4f671a=!![];}if(_0x4f671a){_0x36c3c1['rx']+=_0x55963a+'\x0a';if(_0x55963a[_0xe50b('0x10')](_0xe50b('0x11'))!=-0x1){_0x4f671a=![];}}else{_0x36c3c1['rx']=_0x55963a;}if(_0x4f671a){return;}if(typeof _0x36c3c1['cb']=='function'){var _0x1d5b34=_0x36c3c1['rx'][_0xe50b('0xe')](0x0,0x3),_0x4b6722=null,_0x3ad322=null;_0x1d5b34=parseInt(_0x1d5b34);if(isNaN(_0x1d5b34)){_0x36c3c1['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xe50b('0x12')});return;}if(_0x1d5b34!=0xc8){_0x36c3c1['cb'](null,{'code':_0x1d5b34,'result':-0x1,'extra':'KO'});return;}_0x4b6722=_0x36c3c1['rx'][_0xe50b('0xe')](0x4)[_0xe50b('0x13')](_0xe50b('0x14'),'');if(_0x4b6722['indexOf']('\x20')!=-0x1){_0x4b6722=_0x4b6722[_0xe50b('0x15')](0x0,_0x4b6722[_0xe50b('0x16')]('\x20'));}if(_[_0xe50b('0x17')](_0x4b6722,'-1')){_0x4b6722=parseInt(_0x4b6722);}_0x3ad322=_0x36c3c1['rx'][_0xe50b('0x18')]('\x20');if(_0x3ad322[_0xe50b('0x19')]==0x3){_0x3ad322=_0x3ad322[0x2][_0xe50b('0xe')](0x1,_0x3ad322[0x2][_0xe50b('0x19')]-0x1);}else if(_0x3ad322[_0xe50b('0x19')]>0x3){var _0x97507c=/\((.+)\)/;var _0x5002f0=_0x36c3c1['rx'][_0xe50b('0x1a')](_0x97507c);if(_0x5002f0){_0x3ad322=_0x5002f0[0x1];}else{_0x3ad322=null;}}else{_0x3ad322=null;}_0x36c3c1['cb'](null,{'code':_0x1d5b34,'result':_0x4b6722,'extra':_0x3ad322});}});_0x17fca2['on']('error',function(_0x1bd1b8){_0x1f24a4['emit'](_0xe50b('0x1b'),new AGIError(_0xe50b('0x1c'),_0x1bd1b8[_0xe50b('0x1d')]));});_0x17fca2['on']('close',function(){_0x1f24a4['emit'](_0xe50b('0x1e'),new AGIError(_0xe50b('0x1f')));});_0x17fca2['on'](_0xe50b('0x20'),function(){_0x1f24a4[_0xe50b('0x9')](_0xe50b('0x20'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x17fca2[_0xe50b('0x21')]();});_0x17fca2['pipe'](_0x37abc4);this['command']=function(_0x29ce7f,_0x17f56e){var _0x29ce7f=_0x29ce7f||'',_0x17f56e=typeof _0x17f56e==_0xe50b('0x22')?_0x17f56e:new Function();_0x36c3c1={'tx':_0x29ce7f,'rx':'','cb':_0x17f56e};_0x17fca2[_0xe50b('0x23')](_0x29ce7f+'\x0a');},this[_0xe50b('0x1e')]=function(){_0x17fca2[_0xe50b('0x21')]();};}util[_0xe50b('0x24')](AGIChannel,EventEmitter);AGIChannel[_0xe50b('0x25')][_0xe50b('0x26')]=function(_0x52e699){return this['command'][_0xe50b('0x27')](this,_0x52e699);};AGIChannel[_0xe50b('0x25')][_0xe50b('0x28')]=function(){return this[_0xe50b('0x26')](_0xe50b('0x29'));};AGIChannel['prototype'][_0xe50b('0x2a')]=function(_0x12e70c,_0x2b1faf,_0x9088d4){_0x12e70c=_0x12e70c===undefined?_0xe50b('0x2b'):_0x12e70c;_0x2b1faf=_0x2b1faf===undefined?'5':_0x2b1faf;_0x9088d4=_0x9088d4===undefined?'1':_0x9088d4;return this[_0xe50b('0x26')](util[_0xe50b('0x2c')](_0xe50b('0x2d'),_0x12e70c,_0x2b1faf*0x3e8,_0x9088d4));};AGIChannel[_0xe50b('0x25')][_0xe50b('0x2e')]=function(_0x37b77c){_0x37b77c=_0x37b77c||'NO\x20MESSAGE';return this[_0xe50b('0x26')](util[_0xe50b('0x2c')](_0xe50b('0x2f'),_0x37b77c));};AGIChannel['prototype'][_0xe50b('0x30')]=function(_0xfee52c,_0x5242e4){if(_[_0xe50b('0x31')](_0x5242e4)){return this[_0xe50b('0x26')](util[_0xe50b('0x2c')](_0xe50b('0x32'),_0xfee52c,_0x5242e4[_0xe50b('0x33')](',')));}return this[_0xe50b('0x26')](util[_0xe50b('0x2c')](_0xe50b('0x32'),_0xfee52c,_0x5242e4));};AGIChannel[_0xe50b('0x25')]['setContext']=function(_0x362996){return this['sendRequest'](util[_0xe50b('0x2c')]('SET\x20CONTEXT\x20%s',_0x362996));};AGIChannel['prototype']['setExtension']=function(_0x53de93){return this['sendRequest'](util[_0xe50b('0x2c')](_0xe50b('0x34'),_0x53de93));};AGIChannel[_0xe50b('0x25')][_0xe50b('0x35')]=function(_0x1edf6c){return this[_0xe50b('0x26')](util[_0xe50b('0x2c')](_0xe50b('0x36'),_0x1edf6c));};AGIChannel[_0xe50b('0x25')][_0xe50b('0xd')]=function(){return this['sendRequest'](_0xe50b('0x37'));};AGIChannel[_0xe50b('0x25')][_0xe50b('0x38')]=function(_0x49f0e5,_0x400920){var _0x1f2b1e=_[_0xe50b('0x39')](_0x400920)||_['isNumber'](_0x400920)?_0x400920['toString']():_0x400920;return this[_0xe50b('0x26')](util['format'](_0xe50b('0x3a'),_0x49f0e5,_0x1f2b1e?_0x1f2b1e[_0xe50b('0x3b')]()[_0xe50b('0x13')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xe50b('0x25')][_0xe50b('0x3c')]=function(_0x4e3ad6,_0x15f790){return this['sendRequest'](util[_0xe50b('0x2c')](_0xe50b('0x3d'),_0x4e3ad6,_0x15f790));};AGIChannel[_0xe50b('0x25')]['sayDigits']=function(_0x23769f,_0x189e75){return this['sendRequest'](util[_0xe50b('0x2c')](_0xe50b('0x3e'),_0x23769f,_0x189e75));};AGIChannel[_0xe50b('0x25')]['sayPhonetic']=function(_0x3b82ef,_0xf9c44f){return this[_0xe50b('0x26')](util['format'](_0xe50b('0x3f'),_0x3b82ef,_0xf9c44f));};AGIChannel[_0xe50b('0x25')][_0xe50b('0x40')]=function(_0x141fb0,_0x38ebf3,_0x4ce2b7){_0x38ebf3=_0x38ebf3||this[_0xe50b('0x41')];_0x4ce2b7=_0x4ce2b7||0x1;this[_0xe50b('0x42')](_0x141fb0);this['setExtension'](_0x38ebf3);this[_0xe50b('0x35')](_0x4ce2b7);return this[_0xe50b('0x2e')](util[_0xe50b('0x2c')](_0xe50b('0x43'),_0x141fb0,_0x38ebf3,_0x4ce2b7));};AGIChannel[_0xe50b('0x25')][_0xe50b('0x44')]=function(_0x53e9e9){return this[_0xe50b('0x26')](util[_0xe50b('0x2c')]('GET\x20VARIABLE\x20\x22%s\x22',_0x53e9e9));};AGIChannel[_0xe50b('0x25')]['recordFile']=function(_0x10e1bf,_0x15ad0e,_0x27e23b,_0x386d22,_0x4f2be0,_0x2d37e1){_0x15ad0e=_0x15ad0e||_0xe50b('0x45');_0x27e23b=_0x27e23b||'';_0x386d22=_0x386d22===undefined?-0x1:_0x386d22==='-1'?-0x1:_0x386d22*0x3e8;_0x4f2be0=_0x4f2be0===undefined?'':'s='+_0x4f2be0;_0x2d37e1=_0x2d37e1?_0xe50b('0x46'):'';return this[_0xe50b('0x26')](util[_0xe50b('0x2c')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x10e1bf,_0x15ad0e,_0x27e23b,_0x386d22,_0x2d37e1,_0x4f2be0));};AGIChannel['prototype']['streamFile']=function(_0x2bb882,_0x7925fe){_0x7925fe=_0x7925fe||'';return this[_0xe50b('0x26')](util[_0xe50b('0x2c')](_0xe50b('0x47'),_0x2bb882,_0x7925fe));};AGIChannel[_0xe50b('0x25')][_0xe50b('0x48')]=function(_0x2e1f17){return this[_0xe50b('0x30')](_0xe50b('0x49'),_0x2e1f17);};AGIChannel[_0xe50b('0x25')][_0xe50b('0x4a')]=function(_0x26c610){return this[_0xe50b('0x30')](_0xe50b('0x4b'),_0x26c610);};AGIChannel[_0xe50b('0x25')][_0xe50b('0x1b')]=function(_0x121860,_0x5eaaf8){this['noop'](util[_0xe50b('0x2c')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x121860['id'],_0x121860[_0xe50b('0x4c')],_0x5eaaf8));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xe50b('0x4d')]=AGIChannel; \ No newline at end of file +var _0xf588=['no\x20code','result=','indexOf','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','pipe','command','write','sendRequest','sync','prototype','answer','ANSWER','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','isBoolean','isNumber','toString','replace','sayNumber','SAY\x20NUMBER\x20%s\x20%s','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','noop','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','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','exports','events','EventEmitter','./reply','./error','call','setEncoding','utf8','ready','hangup','emit','substring','520-Invalid','search','520\x20End\x20of\x20proper','function'];(function(_0x33ddea,_0x222f65){var _0x5e2f59=function(_0x15bf02){while(--_0x15bf02){_0x33ddea['push'](_0x33ddea['shift']());}};_0x5e2f59(++_0x222f65);}(_0xf588,0x1ad));var _0x8f58=function(_0x4b4c68,_0x6817a1){_0x4b4c68=_0x4b4c68-0x0;var _0x1e61c3=_0xf588[_0x4b4c68];return _0x1e61c3;};'use strict';var util=require('util');var _=require('lodash');var EventEmitter=require(_0x8f58('0x0'))[_0x8f58('0x1')];var AGIReply=require(_0x8f58('0x2'));var AGIError=require(_0x8f58('0x3'));function AGIChannel(_0x2ce0c0){var _0x4b87d7=this,_0x3ad607=new AGIReply(),_0xbd02cd=![],_0x2f51c4={};EventEmitter[_0x8f58('0x4')](_0x4b87d7);_0x2ce0c0[_0x8f58('0x5')](_0x8f58('0x6'));_0x2ce0c0['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x3ad607[_0x8f58('0x5')](_0x8f58('0x6'));_0x3ad607['on']('headers',function(_0x85448){for(var _0x32e4f0 in _0x85448){_0x4b87d7[_0x32e4f0]=_0x85448[_0x32e4f0];}_0x4b87d7['emit'](_0x8f58('0x7'));});_0x3ad607['on']('line',function(_0x1a2255){if(_0x1a2255['toLowerCase']()==_0x8f58('0x8')){_0x4b87d7[_0x8f58('0x9')]('hangup');return;}if(_0x1a2255[_0x8f58('0xa')](0x0,0xb)==_0x8f58('0xb')){_0xbd02cd=!![];}if(_0xbd02cd){_0x2f51c4['rx']+=_0x1a2255+'\x0a';if(_0x1a2255[_0x8f58('0xc')](_0x8f58('0xd'))!=-0x1){_0xbd02cd=![];}}else{_0x2f51c4['rx']=_0x1a2255;}if(_0xbd02cd){return;}if(typeof _0x2f51c4['cb']==_0x8f58('0xe')){var _0x360125=_0x2f51c4['rx'][_0x8f58('0xa')](0x0,0x3),_0x184152=null,_0x1c5bf8=null;_0x360125=parseInt(_0x360125);if(isNaN(_0x360125)){_0x2f51c4['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x8f58('0xf')});return;}if(_0x360125!=0xc8){_0x2f51c4['cb'](null,{'code':_0x360125,'result':-0x1,'extra':'KO'});return;}_0x184152=_0x2f51c4['rx'][_0x8f58('0xa')](0x4)['replace'](_0x8f58('0x10'),'');if(_0x184152[_0x8f58('0x11')]('\x20')!=-0x1){_0x184152=_0x184152['substr'](0x0,_0x184152[_0x8f58('0x11')]('\x20'));}if(_['startsWith'](_0x184152,'-1')){_0x184152=parseInt(_0x184152);}_0x1c5bf8=_0x2f51c4['rx'][_0x8f58('0x12')]('\x20');if(_0x1c5bf8[_0x8f58('0x13')]==0x3){_0x1c5bf8=_0x1c5bf8[0x2][_0x8f58('0xa')](0x1,_0x1c5bf8[0x2]['length']-0x1);}else if(_0x1c5bf8[_0x8f58('0x13')]>0x3){var _0x2dcbca=/\((.+)\)/;var _0x19f2c6=_0x2f51c4['rx'][_0x8f58('0x14')](_0x2dcbca);if(_0x19f2c6){_0x1c5bf8=_0x19f2c6[0x1];}else{_0x1c5bf8=null;}}else{_0x1c5bf8=null;}_0x2f51c4['cb'](null,{'code':_0x360125,'result':_0x184152,'extra':_0x1c5bf8});}});_0x2ce0c0['on'](_0x8f58('0x15'),function(_0x99d326){_0x4b87d7[_0x8f58('0x9')]('error',new AGIError(_0x8f58('0x16'),_0x99d326[_0x8f58('0x17')]));});_0x2ce0c0['on'](_0x8f58('0x18'),function(){_0x4b87d7[_0x8f58('0x9')]('close',new AGIError(_0x8f58('0x19')));});_0x2ce0c0['on'](_0x8f58('0x1a'),function(){_0x4b87d7[_0x8f58('0x9')](_0x8f58('0x1a'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x2ce0c0['destroy']();});_0x2ce0c0[_0x8f58('0x1b')](_0x3ad607);this[_0x8f58('0x1c')]=function(_0x14e133,_0x3face0){var _0x14e133=_0x14e133||'',_0x3face0=typeof _0x3face0==_0x8f58('0xe')?_0x3face0:new Function();_0x2f51c4={'tx':_0x14e133,'rx':'','cb':_0x3face0};_0x2ce0c0[_0x8f58('0x1d')](_0x14e133+'\x0a');},this['close']=function(){_0x2ce0c0['destroy']();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x8f58('0x1e')]=function(_0x563dab){return this[_0x8f58('0x1c')][_0x8f58('0x1f')](this,_0x563dab);};AGIChannel[_0x8f58('0x20')][_0x8f58('0x21')]=function(){return this[_0x8f58('0x1e')](_0x8f58('0x22'));};AGIChannel[_0x8f58('0x20')]['getData']=function(_0x21a232,_0x54da03,_0x571111){_0x21a232=_0x21a232===undefined?_0x8f58('0x23'):_0x21a232;_0x54da03=_0x54da03===undefined?'5':_0x54da03;_0x571111=_0x571111===undefined?'1':_0x571111;return this[_0x8f58('0x1e')](util[_0x8f58('0x24')](_0x8f58('0x25'),_0x21a232,_0x54da03*0x3e8,_0x571111));};AGIChannel['prototype']['noop']=function(_0x836f81){_0x836f81=_0x836f81||'NO\x20MESSAGE';return this[_0x8f58('0x1e')](util[_0x8f58('0x24')]('VERBOSE\x20\x22%s\x22',_0x836f81));};AGIChannel[_0x8f58('0x20')][_0x8f58('0x26')]=function(_0x2e06f1,_0xdb45aa){if(_[_0x8f58('0x27')](_0xdb45aa)){return this[_0x8f58('0x1e')](util[_0x8f58('0x24')](_0x8f58('0x28'),_0x2e06f1,_0xdb45aa[_0x8f58('0x29')](',')));}return this['sendRequest'](util[_0x8f58('0x24')]('EXEC\x20%s\x20%s',_0x2e06f1,_0xdb45aa));};AGIChannel[_0x8f58('0x20')][_0x8f58('0x2a')]=function(_0x3f6680){return this[_0x8f58('0x1e')](util['format'](_0x8f58('0x2b'),_0x3f6680));};AGIChannel['prototype'][_0x8f58('0x2c')]=function(_0x1f5a57){return this[_0x8f58('0x1e')](util[_0x8f58('0x24')](_0x8f58('0x2d'),_0x1f5a57));};AGIChannel['prototype'][_0x8f58('0x2e')]=function(_0x86d0bc){return this[_0x8f58('0x1e')](util['format'](_0x8f58('0x2f'),_0x86d0bc));};AGIChannel['prototype'][_0x8f58('0x8')]=function(){return this[_0x8f58('0x1e')](_0x8f58('0x30'));};AGIChannel['prototype']['setVariable']=function(_0x5b6616,_0x1b7463){var _0x11fbfc=_[_0x8f58('0x31')](_0x1b7463)||_[_0x8f58('0x32')](_0x1b7463)?_0x1b7463[_0x8f58('0x33')]():_0x1b7463;return this[_0x8f58('0x1e')](util['format']('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x5b6616,_0x11fbfc?_0x11fbfc[_0x8f58('0x33')]()[_0x8f58('0x34')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x8f58('0x35')]=function(_0x53f29f,_0x488f8c){return this[_0x8f58('0x1e')](util[_0x8f58('0x24')](_0x8f58('0x36'),_0x53f29f,_0x488f8c));};AGIChannel[_0x8f58('0x20')]['sayDigits']=function(_0xe31b68,_0x88fa53){return this[_0x8f58('0x1e')](util[_0x8f58('0x24')](_0x8f58('0x37'),_0xe31b68,_0x88fa53));};AGIChannel['prototype'][_0x8f58('0x38')]=function(_0x10c426,_0x4440d2){return this[_0x8f58('0x1e')](util[_0x8f58('0x24')](_0x8f58('0x39'),_0x10c426,_0x4440d2));};AGIChannel['prototype'][_0x8f58('0x3a')]=function(_0x4c91a3,_0x4a1b1d,_0x35e06c){_0x4a1b1d=_0x4a1b1d||this[_0x8f58('0x3b')];_0x35e06c=_0x35e06c||0x1;this[_0x8f58('0x2a')](_0x4c91a3);this[_0x8f58('0x2c')](_0x4a1b1d);this[_0x8f58('0x2e')](_0x35e06c);return this[_0x8f58('0x3c')](util[_0x8f58('0x24')](_0x8f58('0x3d'),_0x4c91a3,_0x4a1b1d,_0x35e06c));};AGIChannel[_0x8f58('0x20')][_0x8f58('0x3e')]=function(_0x572233){return this[_0x8f58('0x1e')](util[_0x8f58('0x24')](_0x8f58('0x3f'),_0x572233));};AGIChannel[_0x8f58('0x20')][_0x8f58('0x40')]=function(_0x1558ac,_0x5cf3f7,_0x3d5062,_0x3ac576,_0x408e43,_0x2909b4){_0x5cf3f7=_0x5cf3f7||'wav';_0x3d5062=_0x3d5062||'';_0x3ac576=_0x3ac576===undefined?-0x1:_0x3ac576==='-1'?-0x1:_0x3ac576*0x3e8;_0x408e43=_0x408e43===undefined?'':'s='+_0x408e43;_0x2909b4=_0x2909b4?_0x8f58('0x41'):'';return this[_0x8f58('0x1e')](util[_0x8f58('0x24')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x1558ac,_0x5cf3f7,_0x3d5062,_0x3ac576,_0x2909b4,_0x408e43));};AGIChannel[_0x8f58('0x20')]['streamFile']=function(_0x23665b,_0x201543){_0x201543=_0x201543||'';return this['sendRequest'](util[_0x8f58('0x24')](_0x8f58('0x42'),_0x23665b,_0x201543));};AGIChannel[_0x8f58('0x20')][_0x8f58('0x43')]=function(_0x402374){return this[_0x8f58('0x26')](_0x8f58('0x44'),_0x402374);};AGIChannel[_0x8f58('0x20')][_0x8f58('0x45')]=function(_0x7be8fe){return this[_0x8f58('0x26')](_0x8f58('0x46'),_0x7be8fe);};AGIChannel[_0x8f58('0x20')][_0x8f58('0x15')]=function(_0x5c7290,_0x2fd065){this[_0x8f58('0x3c')](util[_0x8f58('0x24')](_0x8f58('0x47'),_0x5c7290['id'],_0x5c7290[_0x8f58('0x48')],_0x2fd065));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x8f58('0x49')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index b4c5387..e6f1d2f 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 _0xd520=['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.','E_AGI_UNDEFINED','push','format','apply','name','exports','util','Undefined\x20error.'];(function(_0x2553e0,_0x5ca062){var _0x504ace=function(_0xc184d2){while(--_0xc184d2){_0x2553e0['push'](_0x2553e0['shift']());}};_0x504ace(++_0x5ca062);}(_0xd520,0x86));var _0x0d52=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xd520[_0x30ae5e];return _0x1f2e93;};'use strict';var util=require(_0x0d52('0x0'));var error={'E_AGI_UNDEFINED':_0x0d52('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0x0d52('0x2'),'E_AGI_SERVER_CLOSE':_0x0d52('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0x0d52('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0x0d52('0x5'),'E_AGI_SOCKET_ERROR':_0x0d52('0x6'),'E_AGI_SOCKET_CLOSE':_0x0d52('0x7'),'E_AGI_SOCKET_TIMEOUT':_0x0d52('0x8'),'E_AGI_COMMAND_EMPTY':_0x0d52('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x0d52('0xa'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x27b457){var _0x27b457=_0x27b457||null,_0x42ee2b=_0x42ee2b||[],_0x2f36ac=0x1,_0x1f86f4='';if(!error[_0x27b457]){_0x27b457=_0x0d52('0xb');}_0x42ee2b[_0x0d52('0xc')](error[_0x27b457]);while(arguments[_0x2f36ac]){_0x42ee2b[_0x0d52('0xc')](arguments[_0x2f36ac]);_0x2f36ac++;}_0x1f86f4=util[_0x0d52('0xd')][_0x0d52('0xe')](util,_0x42ee2b);this['message']=_0x1f86f4;this[_0x0d52('0xf')]=_0x27b457;}module[_0x0d52('0x10')]=AGIError; \ No newline at end of file +var _0x2bda=['Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','push','format','exports','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.'];(function(_0x404922,_0x4ec4f8){var _0x337c86=function(_0x494791){while(--_0x494791){_0x404922['push'](_0x404922['shift']());}};_0x337c86(++_0x4ec4f8);}(_0x2bda,0xc9));var _0xa2bd=function(_0x8c8176,_0x5360a1){_0x8c8176=_0x8c8176-0x0;var _0x4dc47b=_0x2bda[_0x8c8176];return _0x4dc47b;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0xa2bd('0x0'),'E_AGI_ARGUMENT_PORT':_0xa2bd('0x1'),'E_AGI_SERVER_ERROR':_0xa2bd('0x2'),'E_AGI_SERVER_CLOSE':_0xa2bd('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0xa2bd('0x4'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0xa2bd('0x5'),'E_AGI_COMMAND_EMPTY':_0xa2bd('0x6'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xa2bd('0x7'),'E_AGI_IVR_ENTRY':_0xa2bd('0x8')};function AGIError(_0x18908f){var _0x18908f=_0x18908f||null,_0x4a4f8c=_0x4a4f8c||[],_0x4898ea=0x1,_0x209c3f='';if(!error[_0x18908f]){_0x18908f='E_AGI_UNDEFINED';}_0x4a4f8c[_0xa2bd('0x9')](error[_0x18908f]);while(arguments[_0x4898ea]){_0x4a4f8c[_0xa2bd('0x9')](arguments[_0x4898ea]);_0x4898ea++;}_0x209c3f=util[_0xa2bd('0xa')]['apply'](util,_0x4a4f8c);this['message']=_0x209c3f;this['name']=_0x18908f;}module[_0xa2bd('0xb')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 8434868..248f5e3 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 _0xc0a6=['numberOfEdges','prototype','addVertex','addEdge','push','relations','getVertex','traverseBFS','info','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','vswitch','default','agicommand','target','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','menu','getdigits','getsecretdigits','vertices','edges'];(function(_0x3fda95,_0x28ad04){var _0x39b294=function(_0x24439b){while(--_0x24439b){_0x3fda95['push'](_0x3fda95['shift']());}};_0x39b294(++_0x28ad04);}(_0xc0a6,0xcb));var _0x6c0a=function(_0x267fa5,_0x3f09b8){_0x267fa5=_0x267fa5-0x0;var _0x20fb4d=_0xc0a6[_0x267fa5];return _0x20fb4d;};'use strict';var _=require(_0x6c0a('0x0'));var logger=require(_0x6c0a('0x1'))('agi');var verticesWithRetry=[_0x6c0a('0x2'),_0x6c0a('0x3'),_0x6c0a('0x4')];var Graph=function(){this[_0x6c0a('0x5')]={};this[_0x6c0a('0x6')]={};this[_0x6c0a('0x7')]=0x0;};Graph[_0x6c0a('0x8')][_0x6c0a('0x9')]=function(_0x5d66ee){this[_0x6c0a('0x5')][_0x5d66ee['id']]=_0x5d66ee;this[_0x6c0a('0x6')][_0x5d66ee['id']]=[];};Graph[_0x6c0a('0x8')][_0x6c0a('0xa')]=function(_0x48695b,_0x344873,_0x40098b){this['edges'][_0x48695b][_0x6c0a('0xb')]({'target':_0x344873,'condition':_0x40098b});this['numberOfEdges']+=0x1;};Graph[_0x6c0a('0x8')]['size']=function(){return _['size'](this['vertices']);};Graph['prototype'][_0x6c0a('0xc')]=function(){return this['numberOfEdges'];};Graph[_0x6c0a('0x8')][_0x6c0a('0xd')]=function(_0x657160){return this['vertices'][_0x657160];};Graph[_0x6c0a('0x8')][_0x6c0a('0xe')]=function(_0x6e611d,_0x3e3a3a){if(!this[_0x6c0a('0x5')][_0x6e611d]){return logger[_0x6c0a('0xf')]('no\x20vertex\x20found');}var _0xa29638=_0x3e3a3a(this[_0x6c0a('0x5')][_0x6e611d]);if(!_0xa29638){return logger[_0x6c0a('0xf')](_0x6c0a('0x10'));}if(this[_0x6c0a('0x6')][_0x6e611d][_0x6c0a('0x11')]===0x0){return logger[_0x6c0a('0xf')](_0x6c0a('0x12'));}for(var _0x38de86=0x0,_0xab501f=[],_0x140803=![];_0x38de86\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','evtHangup','createSquareReport','then','catch','hasOwnProperty','indexOf','agi_','substring','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','find','handleNotFound','production','initialize','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','finally','./server','connection','projectUpdate','lodash','syncho','util','../../config/environment','../../config/logger','agi','defaults','127.0.0.1','nextTick','error','findIndex','deleted','push','log','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d'];(function(_0x34d4e8,_0x4220e9){var _0x5b7491=function(_0x5e3733){while(--_0x5e3733){_0x34d4e8['push'](_0x34d4e8['shift']());}};_0x5b7491(++_0x4220e9);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xc4aa[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0xac4a('0x0'));var syncho=require(_0xac4a('0x1'));var util=require(_0xac4a('0x2'));var config=require(_0xac4a('0x3'));var logger=require(_0xac4a('0x4'))(_0xac4a('0x5'));var utilLicense=require('../../config/license/util');var rpc=require('./rpc');var Project=require('./project');var projects=[];config[_0xac4a('0x5')]=_[_0xac4a('0x6')](config[_0xac4a('0x5')],{'ip':_0xac4a('0x7'),'port':0x11dd});function connectionHandler(_0x96be2b){process[_0xac4a('0x8')](function(){syncho(function(){try{setChannelVariables(_0x96be2b);agiHandler(_0x96be2b);}catch(_0x3ef77c){logger[_0xac4a('0x9')](_0x3ef77c['stack']);}});});}function projectUpdateHandler(_0x5b8339){try{var _0x1aba6d=_[_0xac4a('0xa')](projects,['id',_0x5b8339['id']]);if(_0x1aba6d>-0x1){if(_0x5b8339[_0xac4a('0xb')]===!![]){projects['splice'](_0x1aba6d,0x1);}else{projects[_0x1aba6d]=_0x5b8339;}}else{projects[_0xac4a('0xc')](_0x5b8339);}}catch(_0x3a82de){logger[_0xac4a('0x9')](_0x3a82de['stack']);}}function listeningHandler(){console[_0xac4a('0xd')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0xac4a('0x5')]['port']);logger[_0xac4a('0xe')](util[_0xac4a('0xf')](_0xac4a('0x10'),config['agi']['ip'],config[_0xac4a('0x5')][_0xac4a('0x11')]));}function errorHandler(_0x247b78){if(_0x247b78&&_0x247b78[_0xac4a('0x12')]&&_0x247b78[_0xac4a('0x13')]){logger[_0xac4a('0x9')](util[_0xac4a('0xf')](_0xac4a('0x14'),_0x247b78[_0xac4a('0x12')],_0x247b78[_0xac4a('0x13')]));}else{logger[_0xac4a('0x9')](util[_0xac4a('0xf')]('[ERROR]\x20%s',_0x247b78[_0xac4a('0x15')]));}}function closeHandler(){logger[_0xac4a('0xe')](util[_0xac4a('0xf')](_0xac4a('0x16'),this[_0xac4a('0x17')],this[_0xac4a('0x18')],this[_0xac4a('0x19')],this[_0xac4a('0x1a')],this['uniqueid']));try{createSquareReport(this);}catch(_0x5ac21e){logger[_0xac4a('0x9')](_0x5ac21e[_0xac4a('0x15')]);}}function timeoutHandler(){logger[_0xac4a('0xe')](util['format'](_0xac4a('0x1b'),this[_0xac4a('0x17')],this[_0xac4a('0x18')],this[_0xac4a('0x19')],this[_0xac4a('0x1a')],this[_0xac4a('0x1c')]));}function hangupHandler(){logger[_0xac4a('0xe')](util[_0xac4a('0xf')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xac4a('0x17')],this[_0xac4a('0x18')],this['callerid'],this[_0xac4a('0x1a')],this[_0xac4a('0x1c')]));this[_0xac4a('0x1d')]=!![];}function createSquareReport(_0x947d8e,_0x4d2d6c){rpc[_0xac4a('0x1e')](_0x947d8e)[_0xac4a('0x1f')](function(_0x15435c){if(_0x4d2d6c){_0x4d2d6c(null,_0x15435c);}})[_0xac4a('0x20')](function(_0x594f36){if(_0x4d2d6c){_0x4d2d6c(null,_0x594f36);}});}function setChannelVariables(_0x2b0dc2){for(var _0x222507 in _0x2b0dc2){if(_0x2b0dc2[_0xac4a('0x21')](_0x222507)){if(_0x222507[_0xac4a('0x22')](_0xac4a('0x23'))===0x0){_0x2b0dc2[_0x222507[_0xac4a('0x24')](0x4)]=_0x2b0dc2[_0x222507];delete _0x2b0dc2[_0x222507];}}}}function agiHandler(_0x215a31){logger[_0xac4a('0x25')](_0xac4a('0x26'),JSON[_0xac4a('0x27')](_0x215a31,null,0x2));logger[_0xac4a('0xe')](util['format'](_0xac4a('0x28'),_0x215a31[_0xac4a('0x17')],_0x215a31[_0xac4a('0x18')],_0x215a31[_0xac4a('0x19')],_0x215a31[_0xac4a('0x1a')],_0x215a31['uniqueid']));_0x215a31['on']('error',errorHandler);_0x215a31['on'](_0xac4a('0x29'),closeHandler);_0x215a31['on'](_0xac4a('0x2a'),timeoutHandler);_0x215a31[_0xac4a('0x1d')]=![];_0x215a31['on']('hangup',hangupHandler);var _0x4bda1f=_[_0xac4a('0x2b')](projects,[_0xac4a('0x12'),_0x215a31[_0xac4a('0x17')]]);if(!_0x4bda1f)return Project[_0xac4a('0x2c')](_0x215a31);if(!_0x4bda1f[_0xac4a('0x2d')])return Project['handleUnpublished'](_0x215a31);return Project[_0xac4a('0x2e')](_0x4bda1f,_0x215a31);}function main(){var _0x482afc;return utilLicense[_0xac4a('0x2f')]()['then'](function(_0x17e6de){if(!_0x17e6de)return;if(_0x17e6de[_0xac4a('0x30')]){if(_0x17e6de[_0xac4a('0x31')]&&_0x17e6de[_0xac4a('0x31')]>0x0){logger[_0xac4a('0xe')](util[_0xac4a('0xf')](_0xac4a('0x32'),_0x17e6de[_0xac4a('0x31')]));_0x482afc=_0x17e6de[_0xac4a('0x31')];}else{logger[_0xac4a('0xe')](_0xac4a('0x33'));}}else{logger[_0xac4a('0xe')](_0xac4a('0x34'));_0x482afc=-0x1;}})[_0xac4a('0x1f')](function(){return Project['getAll']();})[_0xac4a('0x1f')](function(_0x1c41fb){projects=_0x1c41fb;return;})['catch'](function(_0x2a5419){logger[_0xac4a('0x9')]('[LICENSE]',_0x2a5419['stack']);})[_0xac4a('0x35')](function(){var _0x1ba096=require(_0xac4a('0x36'))(config[_0xac4a('0x5')]['port'],config[_0xac4a('0x5')]['ip'],_0x482afc);_0x1ba096['on'](_0xac4a('0x9'),errorHandler);_0x1ba096['on']('listening',listeningHandler);_0x1ba096['on'](_0xac4a('0x37'),connectionHandler);_0x1ba096['on'](_0xac4a('0x29'),closeHandler);_0x1ba096['on'](_0xac4a('0x38'),projectUpdateHandler);});}main(); \ No newline at end of file +var _0x68fd=['port','info','format','name','[%s]\x20%s','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','createSquareReport','then','catch','hasOwnProperty','indexOf','agi_','substring','variables','stringify','timeout','hangup','find','production','initialize','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','[LICENSE]','finally','./server','listening','connection','projectUpdate','lodash','util','../../config/environment','agi','../../config/license/util','./rpc','./project','defaults','127.0.0.1','error','stack','findIndex','deleted','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!'];(function(_0x203ee7,_0x915b1a){var _0x231aa0=function(_0x22ea4c){while(--_0x22ea4c){_0x203ee7['push'](_0x203ee7['shift']());}};_0x231aa0(++_0x915b1a);}(_0x68fd,0x1e9));var _0xd68f=function(_0x22be83,_0x12c153){_0x22be83=_0x22be83-0x0;var _0x51684b=_0x68fd[_0x22be83];return _0x51684b;};'use strict';var _=require(_0xd68f('0x0'));var syncho=require('syncho');var util=require(_0xd68f('0x1'));var config=require(_0xd68f('0x2'));var logger=require('../../config/logger')(_0xd68f('0x3'));var utilLicense=require(_0xd68f('0x4'));var rpc=require(_0xd68f('0x5'));var Project=require(_0xd68f('0x6'));var projects=[];config[_0xd68f('0x3')]=_[_0xd68f('0x7')](config[_0xd68f('0x3')],{'ip':_0xd68f('0x8'),'port':0x11dd});function connectionHandler(_0xc59f3e){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0xc59f3e);agiHandler(_0xc59f3e);}catch(_0xb3cb35){logger[_0xd68f('0x9')](_0xb3cb35[_0xd68f('0xa')]);}});});}function projectUpdateHandler(_0x22c199){try{var _0x17c341=_[_0xd68f('0xb')](projects,['id',_0x22c199['id']]);if(_0x17c341>-0x1){if(_0x22c199[_0xd68f('0xc')]===!![]){projects['splice'](_0x17c341,0x1);}else{projects[_0x17c341]=_0x22c199;}}else{projects['push'](_0x22c199);}}catch(_0x1c397a){logger['error'](_0x1c397a[_0xd68f('0xa')]);}}function listeningHandler(){console[_0xd68f('0xd')](_0xd68f('0xe'),config[_0xd68f('0x3')][_0xd68f('0xf')]);logger[_0xd68f('0x10')](util[_0xd68f('0x11')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config['agi']['ip'],config['agi']['port']));}function errorHandler(_0xe53f3a){if(_0xe53f3a&&_0xe53f3a[_0xd68f('0x12')]&&_0xe53f3a['message']){logger[_0xd68f('0x9')](util[_0xd68f('0x11')](_0xd68f('0x13'),_0xe53f3a[_0xd68f('0x12')],_0xe53f3a[_0xd68f('0x14')]));}else{logger[_0xd68f('0x9')](util[_0xd68f('0x11')]('[ERROR]\x20%s',_0xe53f3a[_0xd68f('0xa')]));}}function closeHandler(){logger['info'](util['format'](_0xd68f('0x15'),this[_0xd68f('0x16')],this[_0xd68f('0x17')],this[_0xd68f('0x18')],this[_0xd68f('0x19')],this[_0xd68f('0x1a')]));try{createSquareReport(this);}catch(_0xa09f23){logger['error'](_0xa09f23['stack']);}}function timeoutHandler(){logger[_0xd68f('0x10')](util[_0xd68f('0x11')](_0xd68f('0x1b'),this[_0xd68f('0x16')],this[_0xd68f('0x17')],this['callerid'],this[_0xd68f('0x19')],this[_0xd68f('0x1a')]));}function hangupHandler(){logger[_0xd68f('0x10')](util['format'](_0xd68f('0x1c'),this[_0xd68f('0x16')],this[_0xd68f('0x17')],this['callerid'],this['dnid'],this[_0xd68f('0x1a')]));this['evtHangup']=!![];}function createSquareReport(_0x563cd3,_0x3cf02f){rpc[_0xd68f('0x1d')](_0x563cd3)[_0xd68f('0x1e')](function(_0x3f11f9){if(_0x3cf02f){_0x3cf02f(null,_0x3f11f9);}})[_0xd68f('0x1f')](function(_0x434fde){if(_0x3cf02f){_0x3cf02f(null,_0x434fde);}});}function setChannelVariables(_0x169dea){for(var _0x277605 in _0x169dea){if(_0x169dea[_0xd68f('0x20')](_0x277605)){if(_0x277605[_0xd68f('0x21')](_0xd68f('0x22'))===0x0){_0x169dea[_0x277605[_0xd68f('0x23')](0x4)]=_0x169dea[_0x277605];delete _0x169dea[_0x277605];}}}}function agiHandler(_0xee7d9d){logger['debug'](_0xd68f('0x24'),JSON[_0xd68f('0x25')](_0xee7d9d,null,0x2));logger['info'](util[_0xd68f('0x11')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0xee7d9d['arg_1'],_0xee7d9d[_0xd68f('0x17')],_0xee7d9d[_0xd68f('0x18')],_0xee7d9d[_0xd68f('0x19')],_0xee7d9d['uniqueid']));_0xee7d9d['on'](_0xd68f('0x9'),errorHandler);_0xee7d9d['on']('close',closeHandler);_0xee7d9d['on'](_0xd68f('0x26'),timeoutHandler);_0xee7d9d['evtHangup']=![];_0xee7d9d['on'](_0xd68f('0x27'),hangupHandler);var _0x2dd737=_[_0xd68f('0x28')](projects,[_0xd68f('0x12'),_0xee7d9d[_0xd68f('0x16')]]);if(!_0x2dd737)return Project['handleNotFound'](_0xee7d9d);if(!_0x2dd737[_0xd68f('0x29')])return Project['handleUnpublished'](_0xee7d9d);return Project[_0xd68f('0x2a')](_0x2dd737,_0xee7d9d);}function main(){var _0x5cc929;return utilLicense[_0xd68f('0x2b')]()[_0xd68f('0x1e')](function(_0x105053){if(!_0x105053)return;if(_0x105053[_0xd68f('0x2c')]){if(_0x105053['callysquare']&&_0x105053[_0xd68f('0x2d')]>0x0){logger[_0xd68f('0x10')](util[_0xd68f('0x11')](_0xd68f('0x2e'),_0x105053['callysquare']));_0x5cc929=_0x105053[_0xd68f('0x2d')];}else{logger[_0xd68f('0x10')](_0xd68f('0x2f'));}}else{logger[_0xd68f('0x10')](_0xd68f('0x30'));_0x5cc929=-0x1;}})[_0xd68f('0x1e')](function(){return Project[_0xd68f('0x31')]();})[_0xd68f('0x1e')](function(_0x5590e0){projects=_0x5590e0;return;})[_0xd68f('0x1f')](function(_0x3133d2){logger[_0xd68f('0x9')](_0xd68f('0x32'),_0x3133d2[_0xd68f('0xa')]);})[_0xd68f('0x33')](function(){var _0x1ff0ac=require(_0xd68f('0x34'))(config['agi'][_0xd68f('0xf')],config[_0xd68f('0x3')]['ip'],_0x5cc929);_0x1ff0ac['on'](_0xd68f('0x9'),errorHandler);_0x1ff0ac['on'](_0xd68f('0x35'),listeningHandler);_0x1ff0ac['on'](_0xd68f('0x36'),connectionHandler);_0x1ff0ac['on']('close',closeHandler);_0x1ff0ac['on'](_0xd68f('0x37'),projectUpdateHandler);});}main(); \ No newline at end of file diff --git a/server/services/agi/mailRpc/index.js b/server/services/agi/mailRpc/index.js index 75c2eaf..0eadb9b 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 _0x3fa5=['then','error','message','result','catch','sendMailMessage','SendMail','bluebird','client','http'];(function(_0x127e8b,_0x3a6a20){var _0x1b41d0=function(_0x1e7dbe){while(--_0x1e7dbe){_0x127e8b['push'](_0x127e8b['shift']());}};_0x1b41d0(++_0x3a6a20);}(_0x3fa5,0x133));var _0x53fa=function(_0x4f13bc,_0xedba6d){_0x4f13bc=_0x4f13bc-0x0;var _0x45e2be=_0x3fa5[_0x4f13bc];return _0x45e2be;};'use strict';var BPromise=require(_0x53fa('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x53fa('0x1')][_0x53fa('0x2')]({'port':0x232b});function request(_0x2aaca4,_0x39037b){return new BPromise(function(_0x28d038,_0xd4e8af){return client['request'](_0x2aaca4,_0x39037b)[_0x53fa('0x3')](function(_0x5439d3){if(_0x5439d3[_0x53fa('0x4')]){return _0xd4e8af(_0x5439d3[_0x53fa('0x4')][_0x53fa('0x5')]);}else{return _0x28d038(_0x5439d3[_0x53fa('0x6')]);}})[_0x53fa('0x7')](function(_0x290c03){return _0xd4e8af(_0x290c03);});});}exports[_0x53fa('0x8')]=function(_0xbbee79,_0x1505c9){return request(_0x53fa('0x9'),{'account':_0xbbee79,'message':_0x1505c9});}; \ No newline at end of file +var _0x34cb=['result','catch','sendMailMessage','SendMail','jayson/promise','client','http','error','message'];(function(_0x303f1f,_0x1bcea4){var _0x1ef72f=function(_0x57c147){while(--_0x57c147){_0x303f1f['push'](_0x303f1f['shift']());}};_0x1ef72f(++_0x1bcea4);}(_0x34cb,0x79));var _0xb34c=function(_0x1622a0,_0x2b55a9){_0x1622a0=_0x1622a0-0x0;var _0x2a2308=_0x34cb[_0x1622a0];return _0x2a2308;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xb34c('0x0'));var client=jayson[_0xb34c('0x1')][_0xb34c('0x2')]({'port':0x232b});function request(_0x3ce461,_0x4e2442){return new BPromise(function(_0x4a8e49,_0x3b9981){return client['request'](_0x3ce461,_0x4e2442)['then'](function(_0xfc8589){if(_0xfc8589[_0xb34c('0x3')]){return _0x3b9981(_0xfc8589[_0xb34c('0x3')][_0xb34c('0x4')]);}else{return _0x4a8e49(_0xfc8589[_0xb34c('0x5')]);}})[_0xb34c('0x6')](function(_0x4969e0){return _0x3b9981(_0x4969e0);});});}exports[_0xb34c('0x7')]=function(_0x6fd754,_0x207519){return request(_0xb34c('0x8'),{'account':_0x6fd754,'message':_0x207519});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index 6783d1b..e62c2fe 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 _0x8a3a=['uniqueid','clear','agicommand','info','context','extension','priority','response','stringify','result','evtHangup','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','arg_1','dnid','traverseBFS','vertex','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20found','exports','xml2json','../../config/logger','agi','./rpc','./mailRpc','./graph','./vertices','getSquareProjects','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','hasOwnProperty','retry','maxRetry','addVertex','mxCell','length','source','target','addEdge','value','toJson','mxGraphModel','root','production','start','debug','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','omit','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname'];(function(_0x20c77e,_0x34ad3b){var _0x3fe066=function(_0x510bf3){while(--_0x510bf3){_0x20c77e['push'](_0x20c77e['shift']());}};_0x3fe066(++_0x34ad3b);}(_0x8a3a,0x189));var _0xa8a3=function(_0x2dbe8a,_0x163529){_0x2dbe8a=_0x2dbe8a-0x0;var _0x20e7a2=_0x8a3a[_0x2dbe8a];return _0x20e7a2;};'use strict';var _=require('lodash');var moment=require('moment');var parser=require(_0xa8a3('0x0'));var util=require('util');var logger=require(_0xa8a3('0x1'))(_0xa8a3('0x2'));var rpc=require(_0xa8a3('0x3'));var mailRpc=require(_0xa8a3('0x4'));var Graph=require(_0xa8a3('0x5'));var Vertices=require(_0xa8a3('0x6'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0xa8a3('0x7')]()[_0xa8a3('0x8')](function(_0x4e4490){logger[_0xa8a3('0x9')](_0xa8a3('0xa'),_0x4e4490[_0xa8a3('0xb')]);return[];});}function addVertex(_0x434553,_0x57e06a,_0x35e9e3){_0x57e06a['agicommand']=_0x35e9e3;if(_0x57e06a[_0xa8a3('0xc')](_0xa8a3('0xd'))){_0x57e06a[_0xa8a3('0xe')]=parseInt(_0x57e06a['retry'],0xa);}_0x434553[_0xa8a3('0xf')](_['omit'](_0x57e06a,_0xa8a3('0x10')));}function initGraph(_0x52a0c2,_0x48f924){var _0x5648e1=new Graph();for(var _0x18a8d8 in _0x52a0c2){if(_0x52a0c2[_0xa8a3('0xc')](_0x18a8d8)){if(_['isArray'](_0x52a0c2[_0x18a8d8])){for(var _0x53dfd3=0x0;_0x53dfd3<_0x52a0c2[_0x18a8d8][_0xa8a3('0x11')];_0x53dfd3+=0x1){addVertex(_0x5648e1,_0x52a0c2[_0x18a8d8][_0x53dfd3],_0x18a8d8);}}else{addVertex(_0x5648e1,_0x52a0c2[_0x18a8d8],_0x18a8d8);}}}for(var _0x1eefa8=0x0;_0x1eefa8<_0x48f924['length'];_0x1eefa8+=0x1){if(_0x48f924[_0x1eefa8][_0xa8a3('0x12')]&&_0x48f924[_0x1eefa8][_0xa8a3('0x13')]){_0x5648e1[_0xa8a3('0x14')](_0x48f924[_0x1eefa8]['source'],_0x48f924[_0x1eefa8][_0xa8a3('0x13')],_0x48f924[_0x1eefa8][_0xa8a3('0x15')]);}}return _0x5648e1;}function getRoot(_0x5d669f){return parser[_0xa8a3('0x16')](_0x5d669f,{'object':!![]})[_0xa8a3('0x17')][_0xa8a3('0x18')];}function inspect(_0x519f8c){return util['inspect'](_0x519f8c,{'showHidden':![],'depth':null});}function initialize(_0x5bfe4e,_0x4bbeed){var _0x501159=getRoot(_0x5bfe4e[_0xa8a3('0x19')]);if(!_0x501159||!_0x501159[_0xa8a3('0x1a')])return;var _0x4887d4,_0x30a8a0,_0x5ecf22;logger[_0xa8a3('0x1b')](_0xa8a3('0x18'),JSON['stringify'](_0x501159,null,0x2));_0x4bbeed[_0xa8a3('0x1c')]=moment()[_0xa8a3('0x1d')](_0xa8a3('0x1e'));_0x4887d4=initGraph(_[_0xa8a3('0x1f')](_0x501159,_0xa8a3('0x10')),_0x501159[_0xa8a3('0x10')]);_0x30a8a0=new Vertices(_0x4bbeed,rpc,mailRpc);logger['info'](util[_0xa8a3('0x1d')](_0xa8a3('0x20'),_0x4bbeed['arg_1'],_0x4bbeed[_0xa8a3('0x21')],_0x4bbeed['callerid'],_0x4bbeed['dnid'],_0x4bbeed[_0xa8a3('0x22')]));_0x4887d4['traverseBFS'](_0x501159[_0xa8a3('0x1a')]['id'],function(_0x571546){try{_0x571546=_0x30a8a0[_0xa8a3('0x23')](_0x571546);logger[_0xa8a3('0x1b')]('vertex',JSON['stringify'](_0x571546,null,0x2));if(_0x571546[_0xa8a3('0x24')]==='gotoc'){logger[_0xa8a3('0x25')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x4bbeed[_0xa8a3('0x26')]=_0x571546['context']||_0x4bbeed['context'];_0x4bbeed[_0xa8a3('0x27')]=_0x571546['extension'];_0x4bbeed[_0xa8a3('0x28')]=_0x571546['priority']?_0x571546[_0xa8a3('0x28')]-0x1:0x1;return null;}else if(_0x571546&&_0x30a8a0[_0x571546['agicommand']]){_0x5ecf22=_0x30a8a0[_0x571546[_0xa8a3('0x24')]](_0x571546);logger[_0xa8a3('0x25')](_0xa8a3('0x29'),JSON[_0xa8a3('0x2a')](_0x5ecf22,null,0x2));if(_0x5ecf22&&_0x5ecf22['code']===AGI_CODE_SUCCESS&&_0x5ecf22[_0xa8a3('0x2b')]!==AGI_RESULT_ERROR&&!_0x4bbeed[_0xa8a3('0x2c')]){logger[_0xa8a3('0x1b')](_0xa8a3('0x29'),inspect(_0x5ecf22));return _[_0xa8a3('0x2d')](_0x5ecf22[_0xa8a3('0x2b')])?null:_0x5ecf22['result'][_0xa8a3('0x2e')]();}else{logger[_0xa8a3('0x9')]('response',inspect(_0x5ecf22));return null;}}else{logger[_0xa8a3('0x9')](_0xa8a3('0x2f'));return null;}}catch(_0x396ecb){logger['error'](_0x396ecb[_0xa8a3('0xb')]);return null;}});if(_0x501159[_0xa8a3('0x30')]){logger[_0xa8a3('0x25')](util[_0xa8a3('0x1d')](_0xa8a3('0x31'),_0x4bbeed[_0xa8a3('0x32')],_0x4bbeed[_0xa8a3('0x21')],_0x4bbeed['callerid'],_0x4bbeed[_0xa8a3('0x33')],_0x4bbeed[_0xa8a3('0x22')]));_0x4887d4[_0xa8a3('0x34')](_0x501159[_0xa8a3('0x30')]['id'],function(_0x3e4cf7){try{_0x3e4cf7=_0x30a8a0[_0xa8a3('0x23')](_0x3e4cf7);logger['debug'](_0xa8a3('0x35'),JSON[_0xa8a3('0x2a')](_0x3e4cf7,null,0x2));if(_0x3e4cf7&&_0x30a8a0[_0x3e4cf7[_0xa8a3('0x24')]]){_0x5ecf22=_0x30a8a0[_0x3e4cf7[_0xa8a3('0x24')]](_0x3e4cf7);if(_0x5ecf22){logger[_0xa8a3('0x1b')]('response',inspect(_0x5ecf22));return _[_0xa8a3('0x2d')](_0x5ecf22[_0xa8a3('0x2b')])?null:_0x5ecf22[_0xa8a3('0x2b')][_0xa8a3('0x2e')]();}else{logger['error'](_0xa8a3('0x29'),inspect(_0x5ecf22));return null;}}else{logger['error'](_0xa8a3('0x2f'));return null;}}catch(_0x15a16c){logger[_0xa8a3('0x9')](_0x15a16c[_0xa8a3('0xb')]);return null;}});}logger[_0xa8a3('0x25')](util['format'](_0xa8a3('0x36'),_0x4bbeed[_0xa8a3('0x32')],_0x4bbeed[_0xa8a3('0x21')],_0x4bbeed[_0xa8a3('0x37')],_0x4bbeed[_0xa8a3('0x33')],_0x4bbeed[_0xa8a3('0x22')]));logger[_0xa8a3('0x25')](util['format'](_0xa8a3('0x38'),_0x4bbeed['context'],_0x4bbeed[_0xa8a3('0x27')],parseInt(_0x4bbeed[_0xa8a3('0x28')],0xa)+0x1));_0x4bbeed[_0xa8a3('0x39')](_0x4bbeed[_0xa8a3('0x26')],_0x4bbeed[_0xa8a3('0x27')],parseInt(_0x4bbeed[_0xa8a3('0x28')],0xa)+0x1);_0x4bbeed[_0xa8a3('0x3a')]();}function handleNotFound(_0x14b0eb){logger[_0xa8a3('0x9')](util['format'](_0xa8a3('0x3b'),_0x14b0eb[_0xa8a3('0x32')]));_0x14b0eb['continueAt'](_0x14b0eb['context'],_0x14b0eb['extension'],parseInt(_0x14b0eb[_0xa8a3('0x28')],0xa)+0x1);_0x14b0eb[_0xa8a3('0x3a')]();}function handleUnpublished(_0xb7e230){logger[_0xa8a3('0x9')](util['format']('Project\x20%s\x20not\x20published',_0xb7e230[_0xa8a3('0x32')]));_0xb7e230[_0xa8a3('0x39')](_0xb7e230['context'],_0xb7e230[_0xa8a3('0x27')],parseInt(_0xb7e230[_0xa8a3('0x28')],0xa)+0x1);_0xb7e230[_0xa8a3('0x3a')]();}module[_0xa8a3('0x3c')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0xb7b4=['../../config/logger','./rpc','./graph','./vertices','Unable\x20to\x20download\x20CallySquare\x20projects','stack','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','isArray','length','source','target','addEdge','value','toJson','mxGraphModel','root','inspect','production','start','debug','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','stringify','agicommand','gotoc','context','extension','priority','result','response','isUndefined','toString','error','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','clear','vertex','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20found','close','exports','lodash','moment','util'];(function(_0x224030,_0x22d775){var _0xfdd313=function(_0x2c7ae4){while(--_0x2c7ae4){_0x224030['push'](_0x224030['shift']());}};_0xfdd313(++_0x22d775);}(_0xb7b4,0x1a8));var _0x4b7b=function(_0x1fac1e,_0x2a6686){_0x1fac1e=_0x1fac1e-0x0;var _0x37d611=_0xb7b4[_0x1fac1e];return _0x37d611;};'use strict';var _=require(_0x4b7b('0x0'));var moment=require(_0x4b7b('0x1'));var parser=require('xml2json');var util=require(_0x4b7b('0x2'));var logger=require(_0x4b7b('0x3'))('agi');var rpc=require(_0x4b7b('0x4'));var mailRpc=require('./mailRpc');var Graph=require(_0x4b7b('0x5'));var Vertices=require(_0x4b7b('0x6'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc['getSquareProjects']()['catch'](function(_0x23fa99){logger['error'](_0x4b7b('0x7'),_0x23fa99[_0x4b7b('0x8')]);return[];});}function addVertex(_0x41429c,_0x4bd2b5,_0x3c36fe){_0x4bd2b5['agicommand']=_0x3c36fe;if(_0x4bd2b5[_0x4b7b('0x9')](_0x4b7b('0xa'))){_0x4bd2b5[_0x4b7b('0xb')]=parseInt(_0x4bd2b5[_0x4b7b('0xa')],0xa);}_0x41429c[_0x4b7b('0xc')](_[_0x4b7b('0xd')](_0x4bd2b5,_0x4b7b('0xe')));}function initGraph(_0x421bbb,_0x408e70){var _0x175259=new Graph();for(var _0x3fd48c in _0x421bbb){if(_0x421bbb[_0x4b7b('0x9')](_0x3fd48c)){if(_[_0x4b7b('0xf')](_0x421bbb[_0x3fd48c])){for(var _0x5260e8=0x0;_0x5260e8<_0x421bbb[_0x3fd48c][_0x4b7b('0x10')];_0x5260e8+=0x1){addVertex(_0x175259,_0x421bbb[_0x3fd48c][_0x5260e8],_0x3fd48c);}}else{addVertex(_0x175259,_0x421bbb[_0x3fd48c],_0x3fd48c);}}}for(var _0x35f282=0x0;_0x35f282<_0x408e70[_0x4b7b('0x10')];_0x35f282+=0x1){if(_0x408e70[_0x35f282][_0x4b7b('0x11')]&&_0x408e70[_0x35f282][_0x4b7b('0x12')]){_0x175259[_0x4b7b('0x13')](_0x408e70[_0x35f282][_0x4b7b('0x11')],_0x408e70[_0x35f282][_0x4b7b('0x12')],_0x408e70[_0x35f282][_0x4b7b('0x14')]);}}return _0x175259;}function getRoot(_0x1806ca){return parser[_0x4b7b('0x15')](_0x1806ca,{'object':!![]})[_0x4b7b('0x16')][_0x4b7b('0x17')];}function inspect(_0x27e6bc){return util[_0x4b7b('0x18')](_0x27e6bc,{'showHidden':![],'depth':null});}function initialize(_0x336114,_0x146aaa){var _0x56557e=getRoot(_0x336114[_0x4b7b('0x19')]);if(!_0x56557e||!_0x56557e[_0x4b7b('0x1a')])return;var _0x185214,_0x12a4e4,_0x52bd2f;logger[_0x4b7b('0x1b')]('root',JSON['stringify'](_0x56557e,null,0x2));_0x146aaa[_0x4b7b('0x1c')]=moment()[_0x4b7b('0x1d')](_0x4b7b('0x1e'));_0x185214=initGraph(_[_0x4b7b('0xd')](_0x56557e,_0x4b7b('0xe')),_0x56557e[_0x4b7b('0xe')]);_0x12a4e4=new Vertices(_0x146aaa,rpc,mailRpc);logger[_0x4b7b('0x1f')](util[_0x4b7b('0x1d')](_0x4b7b('0x20'),_0x146aaa[_0x4b7b('0x21')],_0x146aaa[_0x4b7b('0x22')],_0x146aaa[_0x4b7b('0x23')],_0x146aaa[_0x4b7b('0x24')],_0x146aaa[_0x4b7b('0x25')]));_0x185214[_0x4b7b('0x26')](_0x56557e[_0x4b7b('0x1a')]['id'],function(_0x5090e8){try{_0x5090e8=_0x12a4e4['clear'](_0x5090e8);logger[_0x4b7b('0x1b')]('vertex',JSON[_0x4b7b('0x27')](_0x5090e8,null,0x2));if(_0x5090e8[_0x4b7b('0x28')]===_0x4b7b('0x29')){logger['info']('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x146aaa[_0x4b7b('0x2a')]=_0x5090e8[_0x4b7b('0x2a')]||_0x146aaa[_0x4b7b('0x2a')];_0x146aaa[_0x4b7b('0x2b')]=_0x5090e8[_0x4b7b('0x2b')];_0x146aaa[_0x4b7b('0x2c')]=_0x5090e8['priority']?_0x5090e8[_0x4b7b('0x2c')]-0x1:0x1;return null;}else if(_0x5090e8&&_0x12a4e4[_0x5090e8['agicommand']]){_0x52bd2f=_0x12a4e4[_0x5090e8[_0x4b7b('0x28')]](_0x5090e8);logger[_0x4b7b('0x1f')]('response',JSON['stringify'](_0x52bd2f,null,0x2));if(_0x52bd2f&&_0x52bd2f['code']===AGI_CODE_SUCCESS&&_0x52bd2f[_0x4b7b('0x2d')]!==AGI_RESULT_ERROR&&!_0x146aaa['evtHangup']){logger['debug'](_0x4b7b('0x2e'),inspect(_0x52bd2f));return _[_0x4b7b('0x2f')](_0x52bd2f[_0x4b7b('0x2d')])?null:_0x52bd2f[_0x4b7b('0x2d')][_0x4b7b('0x30')]();}else{logger[_0x4b7b('0x31')](_0x4b7b('0x2e'),inspect(_0x52bd2f));return null;}}else{logger[_0x4b7b('0x31')](_0x4b7b('0x32'));return null;}}catch(_0x28c5cc){logger[_0x4b7b('0x31')](_0x28c5cc['stack']);return null;}});if(_0x56557e[_0x4b7b('0x33')]){logger[_0x4b7b('0x1f')](util[_0x4b7b('0x1d')](_0x4b7b('0x34'),_0x146aaa[_0x4b7b('0x21')],_0x146aaa['calleridname'],_0x146aaa['callerid'],_0x146aaa['dnid'],_0x146aaa[_0x4b7b('0x25')]));_0x185214[_0x4b7b('0x26')](_0x56557e[_0x4b7b('0x33')]['id'],function(_0x1df6e6){try{_0x1df6e6=_0x12a4e4[_0x4b7b('0x35')](_0x1df6e6);logger['debug'](_0x4b7b('0x36'),JSON[_0x4b7b('0x27')](_0x1df6e6,null,0x2));if(_0x1df6e6&&_0x12a4e4[_0x1df6e6['agicommand']]){_0x52bd2f=_0x12a4e4[_0x1df6e6[_0x4b7b('0x28')]](_0x1df6e6);if(_0x52bd2f){logger[_0x4b7b('0x1b')](_0x4b7b('0x2e'),inspect(_0x52bd2f));return _[_0x4b7b('0x2f')](_0x52bd2f[_0x4b7b('0x2d')])?null:_0x52bd2f[_0x4b7b('0x2d')]['toString']();}else{logger[_0x4b7b('0x31')](_0x4b7b('0x2e'),inspect(_0x52bd2f));return null;}}else{logger['error']('agicommand\x20not\x20found');return null;}}catch(_0x4e65ac){logger[_0x4b7b('0x31')](_0x4e65ac[_0x4b7b('0x8')]);return null;}});}logger[_0x4b7b('0x1f')](util[_0x4b7b('0x1d')](_0x4b7b('0x37'),_0x146aaa[_0x4b7b('0x21')],_0x146aaa[_0x4b7b('0x22')],_0x146aaa[_0x4b7b('0x23')],_0x146aaa[_0x4b7b('0x24')],_0x146aaa[_0x4b7b('0x25')]));logger[_0x4b7b('0x1f')](util[_0x4b7b('0x1d')](_0x4b7b('0x38'),_0x146aaa['context'],_0x146aaa[_0x4b7b('0x2b')],parseInt(_0x146aaa[_0x4b7b('0x2c')],0xa)+0x1));_0x146aaa[_0x4b7b('0x39')](_0x146aaa[_0x4b7b('0x2a')],_0x146aaa[_0x4b7b('0x2b')],parseInt(_0x146aaa[_0x4b7b('0x2c')],0xa)+0x1);_0x146aaa['close']();}function handleNotFound(_0x2a0463){logger['error'](util[_0x4b7b('0x1d')](_0x4b7b('0x3a'),_0x2a0463[_0x4b7b('0x21')]));_0x2a0463[_0x4b7b('0x39')](_0x2a0463[_0x4b7b('0x2a')],_0x2a0463[_0x4b7b('0x2b')],parseInt(_0x2a0463['priority'],0xa)+0x1);_0x2a0463[_0x4b7b('0x3b')]();}function handleUnpublished(_0x1db7ba){logger[_0x4b7b('0x31')](util[_0x4b7b('0x1d')]('Project\x20%s\x20not\x20published',_0x1db7ba[_0x4b7b('0x21')]));_0x1db7ba[_0x4b7b('0x39')](_0x1db7ba[_0x4b7b('0x2a')],_0x1db7ba[_0x4b7b('0x2b')],parseInt(_0x1db7ba['priority'],0xa)+0x1);_0x1db7ba[_0x4b7b('0x3b')]();}module[_0x4b7b('0x3c')]={'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 f4bf1eb..f50a9f7 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 _0x3d81=['\x0d\x0a\x0d\x0a','indexOf','substring','length','split','slice','trim','emit','headers','line','util','stream','Transform','_localBuffer','_inBody','prototype','_transform'];(function(_0x1b6e2f,_0xe71395){var _0x5763e1=function(_0x547c79){while(--_0x547c79){_0x1b6e2f['push'](_0x1b6e2f['shift']());}};_0x5763e1(++_0xe71395);}(_0x3d81,0xc5));var _0x13d8=function(_0x2d5f7a,_0x57350c){_0x2d5f7a=_0x2d5f7a-0x0;var _0x3e9616=_0x3d81[_0x2d5f7a];return _0x3e9616;};'use strict';var util=require(_0x13d8('0x0'));var Transform=require(_0x13d8('0x1'))[_0x13d8('0x2')];function AGIReply(_0x3f5c42){Transform['call'](this,_0x3f5c42);this[_0x13d8('0x3')]='';this[_0x13d8('0x4')]=![];}util['inherits'](AGIReply,Transform);AGIReply[_0x13d8('0x5')][_0x13d8('0x6')]=function(_0x3c8654,_0x4e22a5,_0x1eb5f9){var _0x2d8616='\x0a',_0x559ddd=['\x0a\x0a',_0x13d8('0x7')],_0x583e8e=-0x1,_0x451ade=-0x1,_0x3c3c00='',_0x1b0440=0x0,_0xc3f6d8='',_0x11bbda='';this[_0x13d8('0x3')]+=_0x3c8654['toString']();_0xc3f6d8=this['_localBuffer'];if(!this[_0x13d8('0x4')]){_0x1b0440=0x0;while(_0x559ddd[_0x1b0440]){while((_0x451ade=_0xc3f6d8[_0x13d8('0x8')](_0x559ddd[_0x1b0440]))!=-0x1){_0x3c3c00=_0x559ddd[_0x1b0440];_0x11bbda=_0xc3f6d8[_0x13d8('0x9')](0x0,_0x451ade);_0xc3f6d8=_0xc3f6d8[_0x13d8('0x9')](_0x451ade+_0x3c3c00[_0x13d8('0xa')]);var _0x26f042=_0x11bbda[_0x13d8('0xb')](_0x2d8616),_0x78cdc6=0x0,_0x541f3e={},_0x4a8bbb='',_0x109471='',_0x170199=-0x1;while(_0x26f042[_0x78cdc6]){_0x170199=_0x26f042[_0x78cdc6][_0x13d8('0x8')](':');if(_0x170199!=-0x1){_0x4a8bbb=_0x26f042[_0x78cdc6][_0x13d8('0xc')](0x0,_0x170199)[_0x13d8('0xd')]();_0x109471=_0x26f042[_0x78cdc6][_0x13d8('0xc')](_0x170199+0x1)[_0x13d8('0xd')]();if(_0x4a8bbb[_0x13d8('0xa')]>0x0){_0x541f3e[_0x4a8bbb]=_0x109471;}}else{}_0x78cdc6++;}this[_0x13d8('0xe')](_0x13d8('0xf'),_0x541f3e);this[_0x13d8('0x4')]=!![];}_0x1b0440++;}this['_localBuffer']=_0xc3f6d8;}else{while((_0x583e8e=_0xc3f6d8[_0x13d8('0x8')](_0x2d8616))!=-0x1){_0x11bbda=_0xc3f6d8[_0x13d8('0x9')](0x0,_0x583e8e);this[_0x13d8('0xe')](_0x13d8('0x10'),_0x11bbda);_0xc3f6d8=_0xc3f6d8['substring'](_0x583e8e+_0x2d8616[_0x13d8('0xa')]);}this['_localBuffer']=_0xc3f6d8;}_0x1eb5f9();};module['exports']=AGIReply; \ No newline at end of file +var _0xd171=['toString','indexOf','substring','split','trim','slice','emit','headers','line','length','exports','util','stream','Transform','_localBuffer','_inBody','inherits','prototype','_transform'];(function(_0x3a902a,_0xca8442){var _0x24f2d5=function(_0xb6799a){while(--_0xb6799a){_0x3a902a['push'](_0x3a902a['shift']());}};_0x24f2d5(++_0xca8442);}(_0xd171,0xa3));var _0x1d17=function(_0x509da2,_0xd2f81a){_0x509da2=_0x509da2-0x0;var _0x277535=_0xd171[_0x509da2];return _0x277535;};'use strict';var util=require(_0x1d17('0x0'));var Transform=require(_0x1d17('0x1'))[_0x1d17('0x2')];function AGIReply(_0x59d430){Transform['call'](this,_0x59d430);this[_0x1d17('0x3')]='';this[_0x1d17('0x4')]=![];}util[_0x1d17('0x5')](AGIReply,Transform);AGIReply[_0x1d17('0x6')][_0x1d17('0x7')]=function(_0x8a20f6,_0x5579d5,_0x178a9b){var _0x11df32='\x0a',_0x57dbc2=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x6a718b=-0x1,_0x3ff576=-0x1,_0x2223be='',_0x2a873d=0x0,_0x2c52d0='',_0x342d30='';this[_0x1d17('0x3')]+=_0x8a20f6[_0x1d17('0x8')]();_0x2c52d0=this[_0x1d17('0x3')];if(!this[_0x1d17('0x4')]){_0x2a873d=0x0;while(_0x57dbc2[_0x2a873d]){while((_0x3ff576=_0x2c52d0[_0x1d17('0x9')](_0x57dbc2[_0x2a873d]))!=-0x1){_0x2223be=_0x57dbc2[_0x2a873d];_0x342d30=_0x2c52d0[_0x1d17('0xa')](0x0,_0x3ff576);_0x2c52d0=_0x2c52d0[_0x1d17('0xa')](_0x3ff576+_0x2223be['length']);var _0x54329b=_0x342d30[_0x1d17('0xb')](_0x11df32),_0x284a4b=0x0,_0x120097={},_0x62c482='',_0x23318b='',_0x1b60f2=-0x1;while(_0x54329b[_0x284a4b]){_0x1b60f2=_0x54329b[_0x284a4b][_0x1d17('0x9')](':');if(_0x1b60f2!=-0x1){_0x62c482=_0x54329b[_0x284a4b]['slice'](0x0,_0x1b60f2)[_0x1d17('0xc')]();_0x23318b=_0x54329b[_0x284a4b][_0x1d17('0xd')](_0x1b60f2+0x1)[_0x1d17('0xc')]();if(_0x62c482['length']>0x0){_0x120097[_0x62c482]=_0x23318b;}}else{}_0x284a4b++;}this[_0x1d17('0xe')](_0x1d17('0xf'),_0x120097);this[_0x1d17('0x4')]=!![];}_0x2a873d++;}this[_0x1d17('0x3')]=_0x2c52d0;}else{while((_0x6a718b=_0x2c52d0[_0x1d17('0x9')](_0x11df32))!=-0x1){_0x342d30=_0x2c52d0[_0x1d17('0xa')](0x0,_0x6a718b);this[_0x1d17('0xe')](_0x1d17('0x10'),_0x342d30);_0x2c52d0=_0x2c52d0[_0x1d17('0xa')](_0x6a718b+_0x11df32[_0x1d17('0x11')]);}this[_0x1d17('0x3')]=_0x2c52d0;}_0x178a9b();};module[_0x1d17('0x12')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index ffaf79d..777908f 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 _0x4d9e=['createCmContact','ShowCmHopper','ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','PauseUser','agentUnpause','LogoutUser','lodash','client','then','error','message','result','getSquareProjects','GetSquareProjects','name','production','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','ShowSquareOdbc','dsn','ShowUser','phone','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x4460dd,_0x5075d5){var _0x117099=function(_0x127673){while(--_0x127673){_0x4460dd['push'](_0x4460dd['shift']());}};_0x117099(++_0x5075d5);}(_0x4d9e,0x18c));var _0xe4d9=function(_0x1ffdff,_0x3acc52){_0x1ffdff=_0x1ffdff-0x0;var _0x238153=_0x4d9e[_0x1ffdff];return _0x238153;};'use strict';var _=require(_0xe4d9('0x0'));var moment=require('moment');var jayson=require('jayson/promise');var client=jayson[_0xe4d9('0x1')]['http']({'port':0x2329});function request(_0x36adac,_0x4d7687){return new Promise(function(_0x2c6990,_0x2deaef){return client['request'](_0x36adac,_0x4d7687)[_0xe4d9('0x2')](function(_0x3175e8){if(_0x3175e8[_0xe4d9('0x3')]){return _0x2deaef(_0x3175e8[_0xe4d9('0x3')][_0xe4d9('0x4')]);}else{return _0x2c6990(_0x3175e8[_0xe4d9('0x5')]);}})['catch'](function(_0x36316f){return _0x2deaef(_0x36316f);});});}exports[_0xe4d9('0x6')]=function(){return request(_0xe4d9('0x7'),{'options':{'raw':![],'attributes':['id',_0xe4d9('0x8'),_0xe4d9('0x9')]}});};exports[_0xe4d9('0xa')]=function(_0x4b7cd0){return request(_0xe4d9('0xb'),{'options':{'raw':![],'where':{'name':_0x4b7cd0},'attributes':[_0xe4d9('0x9')]}});};exports[_0xe4d9('0xc')]=function(_0x3575ac){return request(_0xe4d9('0xd'),{'options':{'raw':![],'where':{'id':_0x3575ac},'include':[{'model':_0xe4d9('0xe'),'as':_0xe4d9('0xf'),'include':[{'model':'CloudProvider','as':'CloudProvider'}]}],'attributes':['id','name','email'],'smtp':!![]}});};exports['getSquareProjectById']=function(_0x4b5b09){return request('ShowSquareProject',{'options':{'where':{'id':_0x4b5b09},'attributes':['name']}});};exports[_0xe4d9('0x10')]=function(_0x3238d4){return request(_0xe4d9('0x11'),{'options':{'where':{'id':_0x3238d4},'attributes':['name']}});};exports[_0xe4d9('0x12')]=function(_0x3f6ce4){return request(_0xe4d9('0x13'),{'options':{'where':{'id':_0x3f6ce4},'attributes':[_0xe4d9('0x8')]}});};exports['getSquareOdbcById']=function(_0x331ef3){return request(_0xe4d9('0x14'),{'options':{'where':{'id':_0x331ef3},'attributes':[_0xe4d9('0x15')]}});};exports['getUserById']=function(_0x4d2afd){return request(_0xe4d9('0x16'),{'options':{'where':{'id':_0x4d2afd},'attributes':[_0xe4d9('0x8')]}});};exports['getContactByPhone']=function(_0x2e1490){return request('GetContactByPhone',{'options':{'where':{'phone':_0x2e1490[_0xe4d9('0x17')]},'attributes':['id']}});};exports[_0xe4d9('0x18')]=function(_0x1ea096){return request(_0xe4d9('0x19'),{'options':{'where':{'id':_0x1ea096},'attributes':['name']}});};exports[_0xe4d9('0x1a')]=function(_0x3c2017){return request(_0xe4d9('0x1b'),{'options':{'where':{'id':_0x3c2017},'attributes':[_0xe4d9('0x1c')]}});};exports[_0xe4d9('0x1d')]=function(_0x1146fc){return request(_0xe4d9('0x1e'),{'options':{'raw':![],'where':{'id':_0x1146fc},'include':[{'model':_0xe4d9('0x1f'),'as':_0xe4d9('0x20')}]}});};exports['getSmsAccountById']=function(_0x44f1aa){return request(_0xe4d9('0x21'),{'options':{'where':{'id':_0x44f1aa},'attributes':['id','name']}});};exports[_0xe4d9('0x22')]=function(_0x50d377){return request(_0xe4d9('0x23'),{'body':_0x50d377});};exports[_0xe4d9('0x24')]=function(_0x5b494d){return request(_0xe4d9('0x25'),{'body':_0x5b494d});};exports[_0xe4d9('0x26')]=function(_0x5b88e9){return request(_0xe4d9('0x27'),{'body':_[_0xe4d9('0x28')](_0x5b88e9,{'project_name':_0x5b88e9[_0xe4d9('0x29')],'prev_project_name':_0x5b88e9['arg_2']||'','is_subproject':_0x5b88e9['arg_2']?!![]:![],'leaveAt':moment()[_0xe4d9('0x2a')](_0xe4d9('0x2b'))})});};exports['createSquareRecording']=function(_0x5dddd2){return request('CreateSquareRecording',{'body':_0x5dddd2});};exports['createSquareMessage']=function(_0x221a61){return request('CreateSquareMessage',{'body':_0x221a61});};exports[_0xe4d9('0x2c')]=function(_0x1f3d90){return request(_0xe4d9('0x2d'),{'options':{'raw':![],'where':{'phone':_0x1f3d90['phone'],'ListId':_0x1f3d90[_0xe4d9('0x2e')]}}})[_0xe4d9('0x2')](function(_0x250de5){if(_0x250de5){return _0x250de5;}return request(_0xe4d9('0x2f'),{'body':_0x1f3d90});});};exports[_0xe4d9('0x30')]=function(_0x1904d1){return request(_0xe4d9('0x31'),{'options':{'where':{'id':_0x1904d1},'attributes':[_0xe4d9('0x8')]}});};exports[_0xe4d9('0x32')]=function(_0x3e6ea7,_0x519c18){return request(_0xe4d9('0x33'),{'body':{'interface':_0x519c18},'options':{'where':_0x3e6ea7}});};exports['agentPause']=function(_0x22efd2,_0x349be3,_0x2b716b){return request(_0xe4d9('0x34'),{'body':{'type':_0x349be3,'uniqueid':_0x2b716b},'options':{'where':_0x22efd2}});};exports[_0xe4d9('0x35')]=function(_0x12e0ae){return request('UnpauseUser',{'body':{},'options':{'where':_0x12e0ae}});};exports['agentLogout']=function(_0x4d7f17){return request(_0xe4d9('0x36'),{'body':{},'options':{'where':_0x4d7f17}});}; \ No newline at end of file +var _0x2bbb=['createSquareRecording','CreateSquareRecording','createSquareMessage','createCmContact','ShowCmHopper','ListId','CreateCmContact','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','agentLogout','LogoutUser','moment','jayson/promise','client','request','then','error','result','catch','getSquareProjects','name','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','Smtp','CloudProvider','email','getSquareProjectById','getVoiceQueueById','getVariableById','ShowVariable','ShowSquareOdbc','dsn','getUserById','ShowUser','getContactByPhone','GetContactByPhone','phone','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','ShowInterval','ShowSmsAccount','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x56756b,_0x3e8cc7){var _0xa3002=function(_0x5f1386){while(--_0x5f1386){_0x56756b['push'](_0x56756b['shift']());}};_0xa3002(++_0x3e8cc7);}(_0x2bbb,0x85));var _0xb2bb=function(_0x467a84,_0x541669){_0x467a84=_0x467a84-0x0;var _0x56a510=_0x2bbb[_0x467a84];return _0x56a510;};'use strict';var _=require('lodash');var moment=require(_0xb2bb('0x0'));var jayson=require(_0xb2bb('0x1'));var client=jayson[_0xb2bb('0x2')]['http']({'port':0x2329});function request(_0x2a4072,_0x30b641){return new Promise(function(_0x14da5e,_0x242b0b){return client[_0xb2bb('0x3')](_0x2a4072,_0x30b641)[_0xb2bb('0x4')](function(_0x59030e){if(_0x59030e[_0xb2bb('0x5')]){return _0x242b0b(_0x59030e[_0xb2bb('0x5')]['message']);}else{return _0x14da5e(_0x59030e[_0xb2bb('0x6')]);}})[_0xb2bb('0x7')](function(_0x1738d9){return _0x242b0b(_0x1738d9);});});}exports[_0xb2bb('0x8')]=function(){return request('GetSquareProjects',{'options':{'raw':![],'attributes':['id',_0xb2bb('0x9'),'production']}});};exports[_0xb2bb('0xa')]=function(_0x2c0ab9){return request(_0xb2bb('0xb'),{'options':{'raw':![],'where':{'name':_0x2c0ab9},'attributes':[_0xb2bb('0xc')]}});};exports[_0xb2bb('0xd')]=function(_0x574166){return request(_0xb2bb('0xe'),{'options':{'raw':![],'where':{'id':_0x574166},'include':[{'model':'MailServerOut','as':_0xb2bb('0xf'),'include':[{'model':_0xb2bb('0x10'),'as':_0xb2bb('0x10')}]}],'attributes':['id',_0xb2bb('0x9'),_0xb2bb('0x11')],'smtp':!![]}});};exports[_0xb2bb('0x12')]=function(_0x4f88bf){return request(_0xb2bb('0xb'),{'options':{'where':{'id':_0x4f88bf},'attributes':[_0xb2bb('0x9')]}});};exports[_0xb2bb('0x13')]=function(_0x2905e2){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x2905e2},'attributes':[_0xb2bb('0x9')]}});};exports[_0xb2bb('0x14')]=function(_0x3bb017){return request(_0xb2bb('0x15'),{'options':{'where':{'id':_0x3bb017},'attributes':[_0xb2bb('0x9')]}});};exports['getSquareOdbcById']=function(_0x1a46eb){return request(_0xb2bb('0x16'),{'options':{'where':{'id':_0x1a46eb},'attributes':[_0xb2bb('0x17')]}});};exports[_0xb2bb('0x18')]=function(_0x2dcb2d){return request(_0xb2bb('0x19'),{'options':{'where':{'id':_0x2dcb2d},'attributes':[_0xb2bb('0x9')]}});};exports[_0xb2bb('0x1a')]=function(_0x8d2033){return request(_0xb2bb('0x1b'),{'options':{'where':{'phone':_0x8d2033[_0xb2bb('0x1c')]},'attributes':['id']}});};exports[_0xb2bb('0x1d')]=function(_0x5e8d6a){return request(_0xb2bb('0x1e'),{'options':{'where':{'id':_0x5e8d6a},'attributes':['name']}});};exports[_0xb2bb('0x1f')]=function(_0x48debd){return request(_0xb2bb('0x20'),{'options':{'where':{'id':_0x48debd},'attributes':[_0xb2bb('0x21')]}});};exports['getIntervalById']=function(_0x302cd4){return request(_0xb2bb('0x22'),{'options':{'raw':![],'where':{'id':_0x302cd4},'include':[{'model':'Interval','as':'Intervals'}]}});};exports['getSmsAccountById']=function(_0x2f1e0f){return request(_0xb2bb('0x23'),{'options':{'where':{'id':_0x2f1e0f},'attributes':['id',_0xb2bb('0x9')]}});};exports['createSmsMessage']=function(_0x297d52){return request(_0xb2bb('0x24'),{'body':_0x297d52});};exports[_0xb2bb('0x25')]=function(_0x52c3c7){return request(_0xb2bb('0x26'),{'body':_0x52c3c7});};exports[_0xb2bb('0x27')]=function(_0x32a336){return request(_0xb2bb('0x28'),{'body':_['merge'](_0x32a336,{'project_name':_0x32a336[_0xb2bb('0x29')],'prev_project_name':_0x32a336[_0xb2bb('0x2a')]||'','is_subproject':_0x32a336[_0xb2bb('0x2a')]?!![]:![],'leaveAt':moment()['format'](_0xb2bb('0x2b'))})});};exports[_0xb2bb('0x2c')]=function(_0x400fff){return request(_0xb2bb('0x2d'),{'body':_0x400fff});};exports[_0xb2bb('0x2e')]=function(_0x2da423){return request('CreateSquareMessage',{'body':_0x2da423});};exports[_0xb2bb('0x2f')]=function(_0x48d96f){return request(_0xb2bb('0x30'),{'options':{'raw':![],'where':{'phone':_0x48d96f['phone'],'ListId':_0x48d96f[_0xb2bb('0x31')]}}})[_0xb2bb('0x4')](function(_0x5719f3){if(_0x5719f3){return _0x5719f3;}return request(_0xb2bb('0x32'),{'body':_0x48d96f});});};exports['getPauseById']=function(_0x232f27){return request(_0xb2bb('0x33'),{'options':{'where':{'id':_0x232f27},'attributes':['name']}});};exports[_0xb2bb('0x34')]=function(_0x8cbc9f,_0x214649){return request(_0xb2bb('0x35'),{'body':{'interface':_0x214649},'options':{'where':_0x8cbc9f}});};exports[_0xb2bb('0x36')]=function(_0x2cb843,_0x289d11,_0x4504a1){return request(_0xb2bb('0x37'),{'body':{'type':_0x289d11,'uniqueid':_0x4504a1},'options':{'where':_0x2cb843}});};exports[_0xb2bb('0x38')]=function(_0x286520){return request('UnpauseUser',{'body':{},'options':{'where':_0x286520}});};exports[_0xb2bb('0x39')]=function(_0x14b207){return request(_0xb2bb('0x3a'),{'body':{},'options':{'where':_0x14b207}});}; \ 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 98591bd..658eeff 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 _0x34f2=['./polly','./lex'];(function(_0x74892f,_0x1e981b){var _0x10ee61=function(_0x3c480a){while(--_0x3c480a){_0x74892f['push'](_0x74892f['shift']());}};_0x10ee61(++_0x1e981b);}(_0x34f2,0x15a));var _0x234f=function(_0x91db46,_0xf276ad){_0x91db46=_0x91db46-0x0;var _0x5bb735=_0x34f2[_0x91db46];return _0x5bb735;};var polly=require(_0x234f('0x0'));var lex=require(_0x234f('0x1'));module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x1a44=['./polly','exports'];(function(_0x59562a,_0x521555){var _0x2c2168=function(_0x35b9cf){while(--_0x35b9cf){_0x59562a['push'](_0x59562a['shift']());}};_0x2c2168(++_0x521555);}(_0x1a44,0xc4));var _0x41a4=function(_0x56ed39,_0x3ea49c){_0x56ed39=_0x56ed39-0x0;var _0x5203ae=_0x1a44[_0x56ed39];return _0x5203ae;};var polly=require(_0x41a4('0x0'));var lex=require('./lex');module[_0x41a4('0x1')]={'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 574bdbe..51b19bb 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 _0xd8b0=['exports','./lib/api'];(function(_0x59ab37,_0x40549e){var _0x42d7e0=function(_0x5388df){while(--_0x5388df){_0x59ab37['push'](_0x59ab37['shift']());}};_0x42d7e0(++_0x40549e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var lex=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]=function(_0x5a55a3,_0x585166,_0x4b72b0,_0x3ff8df,_0x5b9b89,_0x43bca1){return lex(_0x5a55a3,_0x585166,_0x4b72b0,_0x3ff8df,_0x5b9b89,_0x43bca1);}; \ No newline at end of file +var _0x6f0d=['exports'];(function(_0x9a89ec,_0x784009){var _0x539570=function(_0x27667e){while(--_0x27667e){_0x9a89ec['push'](_0x9a89ec['shift']());}};_0x539570(++_0x784009);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x5edbd5,_0x1557e6){_0x5edbd5=_0x5edbd5-0x0;var _0x489145=_0x6f0d[_0x5edbd5];return _0x489145;};'use strict';var lex=require('./lib/api');module[_0xd6f0('0x0')]=function(_0x64ebf2,_0xd1480,_0x107a8c,_0x573473,_0x275230,_0x135a93){return lex(_0x64ebf2,_0xd1480,_0x107a8c,_0x573473,_0x275230,_0x135a93);}; \ 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 9b45a4c..792d1d8 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(_0x1e8aa1,_0x33e399){var _0x4c1247=function(_0x4919cd){while(--_0x4919cd){_0x1e8aa1['push'](_0x1e8aa1['shift']());}};_0x4c1247(++_0x33e399);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'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(_0x36f8aa,_0x45ac37){var _0xbcdae4=function(_0x2bdc78){while(--_0x2bdc78){_0x36f8aa['push'](_0x36f8aa['shift']());}};_0xbcdae4(++_0x45ac37);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'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 b027535..9f43bbe 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 _0xaca9=['exports','./lib/api'];(function(_0x2a6b55,_0x572485){var _0x3dd7fd=function(_0x52837f){while(--_0x52837f){_0x2a6b55['push'](_0x2a6b55['shift']());}};_0x3dd7fd(++_0x572485);}(_0xaca9,0x17d));var _0x9aca=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0xaca9[_0x3d42d8];return _0x27fc41;};'use strict';var polly=require(_0x9aca('0x0'));module[_0x9aca('0x1')]=function(_0x30b522,_0x23dd66,_0x57cf8f,_0x5b2713,_0x2923e3,_0x387f6c,_0x3aa696){return polly(_0x30b522,_0x23dd66,_0x57cf8f,_0x5b2713,_0x2923e3,_0x387f6c,_0x3aa696);}; \ No newline at end of file +var _0xbffa=['exports','./lib/api'];(function(_0x54de1f,_0x39e7d2){var _0x3d0b43=function(_0x317189){while(--_0x317189){_0x54de1f['push'](_0x54de1f['shift']());}};_0x3d0b43(++_0x39e7d2);}(_0xbffa,0x1bf));var _0xabff=function(_0x10a791,_0x16ee83){_0x10a791=_0x10a791-0x0;var _0x256995=_0xbffa[_0x10a791];return _0x256995;};'use strict';var polly=require(_0xabff('0x0'));module[_0xabff('0x1')]=function(_0x56d176,_0x985d57,_0x3ff046,_0x103ca9,_0xd7f590,_0x26277b,_0x139b57){return polly(_0x56d176,_0x985d57,_0x3ff046,_0x103ca9,_0xd7f590,_0x26277b,_0x139b57);}; \ 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 b8791bb..cb9df17 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 _0xa1a5=['exports','mp3','path','bluebird','aws-sdk','synthesizeSpeech','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x4ec612,_0x122199){var _0x4a1bf1=function(_0x36107b){while(--_0x36107b){_0x4ec612['push'](_0x4ec612['shift']());}};_0x4a1bf1(++_0x122199);}(_0xa1a5,0x1f1));var _0x5a1a=function(_0x48e585,_0x1f7a5e){_0x48e585=_0x48e585-0x0;var _0x4ffa55=_0xa1a5[_0x48e585];return _0x4ffa55;};'use strict';var fs=require('fs');var path=require(_0x5a1a('0x0'));var BPromise=require(_0x5a1a('0x1'));var rs=require('randomstring');var AWS=require(_0x5a1a('0x2'));function pollyResult(_0x57729c,_0x37099e,_0x467377){return new BPromise(function(_0x1fb205,_0x1dd073){_0x57729c[_0x5a1a('0x3')](_0x37099e,function(_0x214a96,_0x5a4366){if(_0x214a96){_0x1dd073(_0x214a96);}else if(_0x5a4366){if(_0x5a4366['AudioStream']instanceof Buffer){fs['writeFile'](_0x467377,_0x5a4366[_0x5a1a('0x4')],function(_0x43c269){if(_0x43c269){_0x1dd073(_0x43c269);}else{_0x1fb205();}});}else{_0x1dd073(new Error(_0x5a1a('0x5')));}}else{_0x1dd073(new Error(_0x5a1a('0x6')));}});});}module[_0x5a1a('0x7')]=function(_0x2e53f1,_0x46082c,_0x14109d,_0x7239ad,_0x762f9e,_0x54a24c,_0x11ee55){var _0x2aeaff=new AWS['Polly']({'accessKeyId':_0x2e53f1,'secretAccessKey':_0x46082c,'region':_0x14109d});var _0x57ee41={'Text':_0x762f9e,'TextType':_0x54a24c||'text','OutputFormat':_0x5a1a('0x8'),'VoiceId':_0x7239ad};return pollyResult(_0x2aeaff,_0x57ee41,_0x11ee55);}; \ No newline at end of file +var _0xd9f3=['AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','text','mp3','bluebird','randomstring','aws-sdk','synthesizeSpeech','writeFile'];(function(_0x8ad45d,_0x2c14cd){var _0x1c31b0=function(_0x278393){while(--_0x278393){_0x8ad45d['push'](_0x8ad45d['shift']());}};_0x1c31b0(++_0x2c14cd);}(_0xd9f3,0x127));var _0x3d9f=function(_0x5533e0,_0x41764f){_0x5533e0=_0x5533e0-0x0;var _0x178423=_0xd9f3[_0x5533e0];return _0x178423;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0x3d9f('0x0'));var rs=require(_0x3d9f('0x1'));var AWS=require(_0x3d9f('0x2'));function pollyResult(_0xd8969,_0xc3ca3b,_0xbb6af4){return new BPromise(function(_0x58dbf2,_0x30cfe3){_0xd8969[_0x3d9f('0x3')](_0xc3ca3b,function(_0x460c7f,_0x9f6c76){if(_0x460c7f){_0x30cfe3(_0x460c7f);}else if(_0x9f6c76){if(_0x9f6c76['AudioStream']instanceof Buffer){fs[_0x3d9f('0x4')](_0xbb6af4,_0x9f6c76[_0x3d9f('0x5')],function(_0x2a8da2){if(_0x2a8da2){_0x30cfe3(_0x2a8da2);}else{_0x58dbf2();}});}else{_0x30cfe3(new Error(_0x3d9f('0x6')));}}else{_0x30cfe3(new Error(_0x3d9f('0x7')));}});});}module['exports']=function(_0x549004,_0x23dd24,_0x427c67,_0x5bf3f7,_0x3ac9e9,_0xedf2c2,_0x56b6a7){var _0x4d8c7a=new AWS['Polly']({'accessKeyId':_0x549004,'secretAccessKey':_0x23dd24,'region':_0x427c67});var _0x272ad1={'Text':_0x3ac9e9,'TextType':_0xedf2c2||_0x3d9f('0x8'),'OutputFormat':_0x3d9f('0x9'),'VoiceId':_0x5bf3f7};return pollyResult(_0x4d8c7a,_0x272ad1,_0x56b6a7);}; \ 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 0816f08..f308ba9 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. * // * * // ************************************************************************* -var _0x1f23=['./lib/api'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x1f23,0xd1));var _0x31f2=function(_0x2adf31,_0x39cfb6){_0x2adf31=_0x2adf31-0x0;var _0x4d9818=_0x1f23[_0x2adf31];return _0x4d9818;};'use strict';var asr=require(_0x31f2('0x0'));module['exports']=function(_0x11bf00,_0x2f4517,_0x4af90b,_0x21de14){return asr(_0x11bf00,_0x2f4517,_0x4af90b);}; \ No newline at end of file +var _0x7f00=['exports','./lib/api'];(function(_0x1147ab,_0x10e72b){var _0x55cb5a=function(_0x364bd6){while(--_0x364bd6){_0x1147ab['push'](_0x1147ab['shift']());}};_0x55cb5a(++_0x10e72b);}(_0x7f00,0x18b));var _0x07f0=function(_0x253b13,_0x247a2f){_0x253b13=_0x253b13-0x0;var _0x396bcc=_0x7f00[_0x253b13];return _0x396bcc;};'use strict';var asr=require(_0x07f0('0x0'));module[_0x07f0('0x1')]=function(_0x3ae673,_0x1d3a28,_0x32dd14,_0x193402){return asr(_0x3ae673,_0x1d3a28,_0x32dd14);}; \ 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 959bf30..2b3113d 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 _0x41bb=['8000','url','bluebird','exports','string','length','filepath\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','/v1/speech:recognize?key='];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0x41bb,0xc5));var _0xb41b=function(_0x18e3e7,_0x39886c){_0x18e3e7=_0x18e3e7-0x0;var _0x211dee=_0x41bb[_0x18e3e7];return _0x211dee;};'use strict';var url=require(_0xb41b('0x0'));var BPromise=require(_0xb41b('0x1'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0xb41b('0x2')]=function(_0x4d5578,_0x30ea75,_0x1c9d36){return new BPromise(function(_0x148333,_0x448c8e){var _0x4ee21b;if(typeof _0x4d5578!==_0xb41b('0x3')||_0x4d5578[_0xb41b('0x4')]===0x0){return _0x448c8e(_0xb41b('0x5'));}if(typeof _0x30ea75!=='string'||_0x30ea75['length']===0x0){return _0x448c8e('key\x20should\x20be\x20a\x20string');}if(typeof _0x1c9d36!==_0xb41b('0x6')&&(typeof _0x1c9d36!==_0xb41b('0x3')||_0x1c9d36['length']===0x0)){return _0x448c8e(_0xb41b('0x7'));}try{_0x4ee21b=fs[_0xb41b('0x8')](_0x4d5578)[_0xb41b('0x9')](_0xb41b('0xa'));}catch(_0x26d531){return _0x448c8e(_0x26d531);}return _0x148333({'method':_0xb41b('0xb'),'uri':host+_0xb41b('0xc')+_0x30ea75,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0xb41b('0xd'),'languageCode':_0x1c9d36},'audio':{'content':_0x4ee21b}},'json':!![]});});}; \ No newline at end of file +var _0x79d8=['bluebird','https://speech.googleapis.com','exports','string','filepath\x20should\x20be\x20a\x20string','length','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync','toString','LINEAR16','8000','url'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x79d8,0x67));var _0x879d=function(_0x3ea4c0,_0x73d322){_0x3ea4c0=_0x3ea4c0-0x0;var _0x4d9e1c=_0x79d8[_0x3ea4c0];return _0x4d9e1c;};'use strict';var url=require(_0x879d('0x0'));var BPromise=require(_0x879d('0x1'));var fs=require('fs');var host=_0x879d('0x2');module[_0x879d('0x3')]=function(_0x5d4308,_0x20dbdc,_0x858c6){return new BPromise(function(_0x52d8df,_0x2b38f9){var _0x3d8c64;if(typeof _0x5d4308!==_0x879d('0x4')||_0x5d4308['length']===0x0){return _0x2b38f9(_0x879d('0x5'));}if(typeof _0x20dbdc!==_0x879d('0x4')||_0x20dbdc[_0x879d('0x6')]===0x0){return _0x2b38f9(_0x879d('0x7'));}if(typeof _0x858c6!=='undefined'&&(typeof _0x858c6!==_0x879d('0x4')||_0x858c6[_0x879d('0x6')]===0x0)){return _0x2b38f9(_0x879d('0x8'));}try{_0x3d8c64=fs[_0x879d('0x9')](_0x5d4308)[_0x879d('0xa')]('base64');}catch(_0x1cc5bf){return _0x2b38f9(_0x1cc5bf);}return _0x52d8df({'method':'POST','uri':host+'/v1/speech:recognize?key='+_0x20dbdc,'body':{'config':{'encoding':_0x879d('0xb'),'sampleRateHertz':_0x879d('0xc'),'languageCode':_0x858c6},'audio':{'content':_0x3d8c64}},'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 c33f341..dd3e053 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 _0x85af=['./asr'];(function(_0x281531,_0x436a1f){var _0x2d5267=function(_0x43498c){while(--_0x43498c){_0x281531['push'](_0x281531['shift']());}};_0x2d5267(++_0x436a1f);}(_0x85af,0x11b));var _0xf85a=function(_0x53ff1c,_0x2fe2ba){_0x53ff1c=_0x53ff1c-0x0;var _0x1bee4e=_0x85af[_0x53ff1c];return _0x1bee4e;};var asr=require(_0xf85a('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0x1fd8=['./asr'];(function(_0x103470,_0x1b0551){var _0xa44946=function(_0x523f32){while(--_0x523f32){_0x103470['push'](_0x103470['shift']());}};_0xa44946(++_0x1b0551);}(_0x1fd8,0x100));var _0x81fd=function(_0x269f3f,_0x454d58){_0x269f3f=_0x269f3f-0x0;var _0x28932a=_0x1fd8[_0x269f3f];return _0x28932a;};var asr=require(_0x81fd('0x0'));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 4480ec0..0da6597 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 _0x8b9a=['%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','nda','channelData','CustomActionData','AudioFromTts','Data','dirName','bluebird','dialogflow','http','https','md5','path','querystring','request-promise','randomstring','sox','google-tts-api','url','parse','util','./aws','./google','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','host','get','statusCode','error','request\x20to\x20','statusMessage','createWriteStream','finish','close','unlink','download\x20error','end','https:','\x20failed,\x20status\x20code\x20=\x20','data','error\x20convert','info','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','then','chmodSync','777','split','readFileSync','toString','base64','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','input','audioConfig','MP3','text:synthesize','POST','.mp3','from','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','stringify','null','generic','parse\x20response\x20failed:\x0a','lang\x20\x22','\x22\x20might\x20not\x20exist','googleASR','asr','uri','results','map','alternatives','join','confidence','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','source','result','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','status','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','length','Dialogflow\x20V2\x20response:','queryResult','diagnosticInfo','fields','end_conversation','boolValue','intent','displayName','responseId','intentDetectionConfidence','fulfillmentText','tildeASR','Tilde\x20ASR\x20transcription','transcript','Tilde\x20ASR\x20confidence','awsPolly','polly','lex','ispeechTTS'];(function(_0x5a456c,_0x383e77){var _0x3ba13a=function(_0x3da6c9){while(--_0x3da6c9){_0x5a456c['push'](_0x5a456c['shift']());}};_0x3ba13a(++_0x383e77);}(_0x8b9a,0x1aa));var _0xa8b9=function(_0x1f5857,_0x43b0b7){_0x1f5857=_0x1f5857-0x0;var _0x1d752a=_0x8b9a[_0x1f5857];return _0x1d752a;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0xa8b9('0x0'));var dialogflow=require(_0xa8b9('0x1'));var fs=require('fs');var http=require(_0xa8b9('0x2'));var https=require(_0xa8b9('0x3'));var md5=require(_0xa8b9('0x4'));var path=require(_0xa8b9('0x5'));var querystring=require(_0xa8b9('0x6'));var rp=require(_0xa8b9('0x7'));var rs=require(_0xa8b9('0x8'));var sox=require(_0xa8b9('0x9'));var tts=require(_0xa8b9('0xa'));var urlParse=require(_0xa8b9('0xb'))[_0xa8b9('0xc')];var util=require(_0xa8b9('0xd'));var aws=require(_0xa8b9('0xe'));var google=require(_0xa8b9('0xf'));var sestek=require('./sestek');var tilde=require(_0xa8b9('0x10'));var logger=require(_0xa8b9('0x11'))(_0xa8b9('0x12'));var ISPEECH_API=_0xa8b9('0x13');function downloadFile(_0xb58238,_0x1c4453){return new BPromise(function(_0x187843,_0x100408){var _0x2b8c33=urlParse(_0xb58238);var _0x4c87e6=_0x2b8c33[_0xa8b9('0x14')]==='https:'?https:http;var _0x7e5b2c={'host':_0x2b8c33[_0xa8b9('0x15')],'path':_0x2b8c33[_0xa8b9('0x5')],'headers':{'user-agent':'WHAT_EVER'}};_0x4c87e6[_0xa8b9('0x16')](_0x7e5b2c,function(_0x514dd3){if(_0x514dd3[_0xa8b9('0x17')]!==0xc8){logger[_0xa8b9('0x18')](_0xa8b9('0x19')+_0xb58238+'\x20failed,\x20status\x20code\x20=\x20'+_0x514dd3['statusCode']+'\x20('+_0x514dd3[_0xa8b9('0x1a')]+')');_0x100408(new Error(_0xa8b9('0x19')+_0xb58238+'\x20failed,\x20status\x20code\x20=\x20'+_0x514dd3['statusCode']+'\x20('+_0x514dd3[_0xa8b9('0x1a')]+')'));return;}var _0x47a390=fs[_0xa8b9('0x1b')](_0x1c4453);_0x47a390['on'](_0xa8b9('0x1c'),function(){logger['info']('finish\x20download\x20file');_0x47a390[_0xa8b9('0x1d')](_0x187843);});_0x47a390['on']('error',function(_0x4b8964){fs[_0xa8b9('0x1e')](_0x1c4453);logger[_0xa8b9('0x18')](_0xa8b9('0x1f'),_0x4b8964);_0x100408(_0x4b8964);});_0x514dd3['pipe'](_0x47a390);})['on'](_0xa8b9('0x18'),function(_0x50cfdf){logger['error'](_0x50cfdf);_0x100408(_0x50cfdf);})[_0xa8b9('0x20')]();});}function uploadFile(_0x29c708){return new BPromise(function(_0x574e80,_0x11e796){var _0x45c92a=urlParse(_0x29c708);var _0x2e8ff9=_0x45c92a[_0xa8b9('0x14')]===_0xa8b9('0x21')?https:http;var _0x3f1959={'host':_0x45c92a['host'],'path':_0x45c92a[_0xa8b9('0x5')],'headers':{'user-agent':'WHAT_EVER'}};_0x2e8ff9[_0xa8b9('0x16')](_0x3f1959,function(_0x328fde){if(_0x328fde[_0xa8b9('0x17')]!==0xc8){_0x11e796(new Error('request\x20to\x20'+_0x29c708+_0xa8b9('0x22')+_0x328fde['statusCode']+'\x20('+_0x328fde[_0xa8b9('0x1a')]+')'));return;}var _0x462b2d='';_0x328fde['on'](_0xa8b9('0x23'),function(_0x16041a){_0x462b2d+=_0x16041a;});_0x328fde['on'](_0xa8b9('0x20'),function(){_0x574e80(_0x462b2d);});})['on'](_0xa8b9('0x18'),function(_0xed8496){_0x11e796(_0xed8496);})[_0xa8b9('0x20')]();});}function convertFile(_0x3dadbf,_0x423ff3){return new BPromise(function(_0x7d739f,_0x5980be){var _0x37f954=sox['transcode'](_0x3dadbf,_0x423ff3,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x37f954['on'](_0xa8b9('0x18'),function(_0x50ec65){logger[_0xa8b9('0x18')](_0xa8b9('0x24'),_0x50ec65);_0x5980be(_0x50ec65);});_0x37f954['on']('end',function(){logger[_0xa8b9('0x25')](_0xa8b9('0x26'));_0x7d739f();});_0x37f954[_0xa8b9('0x27')]();});}function base64Decode(_0x28c56e,_0x26c510){var _0x10f9e8=path[_0xa8b9('0x28')](__dirname,_0xa8b9('0x29'),rs[_0xa8b9('0x2a')](0x4)+_0xa8b9('0x2b'));fs[_0xa8b9('0x2c')](_0x10f9e8,_0x28c56e,'base64');return convertFile(_0x10f9e8,_0x26c510)[_0xa8b9('0x2d')](function(){try{fs[_0xa8b9('0x1e')](_0x10f9e8);fs[_0xa8b9('0x2e')](_0x26c510,_0xa8b9('0x2f'));}catch(_0x573066){logger[_0xa8b9('0x18')](_0x573066);}return _0x26c510[_0xa8b9('0x30')]('.')[0x0];});}function base64Encode(_0x34d88f){var _0x591b5c=fs[_0xa8b9('0x31')](_0x34d88f);return new Buffer(_0x591b5c)[_0xa8b9('0x32')](_0xa8b9('0x33'));}exports[_0xa8b9('0x34')]=function(_0xd1f150,_0x5b44e3,_0x58282f,_0x9c033,_0x43c52d,_0xe7a080){var _0x10900f,_0x77e5;var _0x1f8978=_0xa8b9('0x35');var _0x5762e6=_0xa8b9('0x36')+_0xd1f150;var _0x3d7992={};if(_0x5b44e3==='ssml'){_0x3d7992[_0xa8b9('0x37')]={'ssml':_0x58282f};}else{_0x3d7992[_0xa8b9('0x37')]={'text':_0x58282f};};_0x3d7992['voice']={'languageCode':_0x9c033,'ssmlGender':_0x43c52d};_0x3d7992[_0xa8b9('0x38')]={'audioEncoding':_0xa8b9('0x39'),'sampleRateHertz':0x1f40};var _0x545c66={'url':_0x1f8978+_0xa8b9('0x3a')+_0x5762e6,'method':_0xa8b9('0x3b'),'json':!![],'body':_0x3d7992};return rp(_0x545c66)['then'](function(_0x5ed1ea){return new BPromise(function(_0x54909b,_0x1b0514){_0x10900f=path['resolve'](__dirname,_0xa8b9('0x29'),rs[_0xa8b9('0x2a')](0x4)+_0xa8b9('0x3c'));var _0x4b254d=Buffer[_0xa8b9('0x3d')](_0x5ed1ea['audioContent'],_0xa8b9('0x33'));return fs['writeFile'](_0x10900f,_0x4b254d,function(_0x229e6b){_0x1b0514(_0x229e6b);},function(_0x3969b1){fs[_0xa8b9('0x2e')](_0x10900f,'777');_0x54909b(_0x3969b1);});});})['then'](function(_0x3f8499){_0x77e5=path['resolve'](__dirname,_0xa8b9('0x29'),rs[_0xa8b9('0x2a')](0x4)+_0xa8b9('0x2b'));return convertFile(_0x10900f,_0x77e5);})[_0xa8b9('0x2d')](function(){try{fs[_0xa8b9('0x1e')](_0x10900f);fs[_0xa8b9('0x2e')](_0x77e5,_0xa8b9('0x2f'));}catch(_0x1fe236){logger[_0xa8b9('0x18')](_0x1fe236);}logger['info'](_0xa8b9('0x3e'),_0x77e5[_0xa8b9('0x30')]('.')[0x0]);return _0x77e5[_0xa8b9('0x30')]('.')[0x0];});};exports[_0xa8b9('0x3f')]=function(_0xefba0c,_0x2b0407){var _0x1609dd=_0xa8b9('0x40');var _0x4f7bf6,_0x579faa;var _0x116ec0;var _0x21e2a6={'encoding':_0xa8b9('0x41'),'method':'POST','timeout':0x2710,'url':_0x1609dd,'headers':{'Content-Type':_0xa8b9('0x42')},'body':'f.req='+encodeURIComponent(JSON[_0xa8b9('0x43')]([[['jQ1olc',JSON['stringify']([_0xefba0c,_0x2b0407||'en',![],_0xa8b9('0x44')]),null,_0xa8b9('0x45')]]]))};return rp(_0x21e2a6)[_0xa8b9('0x2d')](function(_0x4b17a9){try{_0x116ec0=eval(_0x4b17a9['slice'](0x5))[0x0][0x2];}catch(_0x4fdc0f){throw new Error(_0xa8b9('0x46')+_0x4b17a9[_0xa8b9('0x23')]);}if(!_0x116ec0){if(_0xefba0c['length']>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0xa8b9('0x47')+_0x2b0407+_0xa8b9('0x48'));}}try{_0x116ec0=eval(_0x116ec0)[0x0];}catch(_0x38d398){throw new Error(_0xa8b9('0x46')+res['data']);}const _0x17943a=_0x116ec0;_0x4f7bf6=path[_0xa8b9('0x28')](__dirname,_0xa8b9('0x29'),rs[_0xa8b9('0x2a')](0x4)+_0xa8b9('0x3c'));fs[_0xa8b9('0x2c')](_0x4f7bf6,_0x116ec0,{'encoding':_0xa8b9('0x33')});_0x579faa=path[_0xa8b9('0x28')](__dirname,_0xa8b9('0x29'),rs[_0xa8b9('0x2a')](0x4)+_0xa8b9('0x2b'));return convertFile(_0x4f7bf6,_0x579faa);})[_0xa8b9('0x2d')](function(){try{fs[_0xa8b9('0x1e')](_0x4f7bf6);fs['chmodSync'](_0x579faa,_0xa8b9('0x2f'));}catch(_0x223699){logger['error'](_0x223699);}logger[_0xa8b9('0x25')]('goggleTTS\x20path',_0x579faa[_0xa8b9('0x30')]('.')[0x0]);return _0x579faa[_0xa8b9('0x30')]('.')[0x0];});};exports[_0xa8b9('0x49')]=function(_0x3f49da,_0x1bd4ed,_0x3ef31a){return google[_0xa8b9('0x4a')](_0x3f49da,_0x1bd4ed,_0x3ef31a)[_0xa8b9('0x2d')](function(_0xd5c977){logger[_0xa8b9('0x25')](_0xd5c977[_0xa8b9('0x4b')]);return rp(_0xd5c977);})[_0xa8b9('0x2d')](function(_0x31dbc9){var _0x65894e='';var _0x27900e=0x0;try{fs[_0xa8b9('0x1e')](_0x3f49da);}catch(_0x428679){logger[_0xa8b9('0x18')](_0x428679);}if(_0x31dbc9&&_0x31dbc9[_0xa8b9('0x4c')]){_0x65894e=_0x31dbc9[_0xa8b9('0x4c')][_0xa8b9('0x4d')](function(_0x471f36){return _0x471f36&&_0x471f36[_0xa8b9('0x4e')][0x0]&&_0x471f36[_0xa8b9('0x4e')][0x0]['transcript']?_0x471f36['alternatives'][0x0]['transcript']:'';})[_0xa8b9('0x4f')]('\x0a');_0x27900e=_0x31dbc9[_0xa8b9('0x4c')][_0xa8b9('0x4d')](function(_0x15eb13){return _0x15eb13&&_0x15eb13['alternatives'][0x0]&&_0x15eb13[_0xa8b9('0x4e')][0x0][_0xa8b9('0x50')]?_0x15eb13[_0xa8b9('0x4e')][0x0][_0xa8b9('0x50')]:0x0;})[_0xa8b9('0x4f')]('\x0a');}logger['info']('googleASR\x20transcription',_0x65894e);logger[_0xa8b9('0x25')](_0xa8b9('0x51'),_0x27900e);return{'transcript':_0x65894e,'confidence':_0x27900e};})[_0xa8b9('0x52')](function(_0x40ba0b){logger[_0xa8b9('0x18')](_0xa8b9('0x53'),_0x40ba0b['statusCode'],_0x40ba0b[_0xa8b9('0x54')],_0x40ba0b[_0xa8b9('0x55')]);});};exports[_0xa8b9('0x56')]=function(_0x12f4b8,_0x4a692e,_0x546306,_0x151e34){var _0x1c1f9e=apiai(_0x4a692e,{'language':_0x151e34||'en'});return _0x1c1f9e[_0xa8b9('0x57')](_0x546306,{'sessionId':md5(_0x12f4b8)})['then'](function(_0x21ee7b){logger[_0xa8b9('0x25')](JSON[_0xa8b9('0x43')](_0x21ee7b));return{'source':_0x21ee7b['result'][_0xa8b9('0x58')],'resolvedQuery':_0x21ee7b[_0xa8b9('0x59')][_0xa8b9('0x5a')],'action':_0x21ee7b[_0xa8b9('0x59')][_0xa8b9('0x5b')],'actionIncomplete':_0x21ee7b['result'][_0xa8b9('0x5c')],'speech':_0x21ee7b[_0xa8b9('0x59')][_0xa8b9('0x5d')][_0xa8b9('0x5e')],'score':_0x21ee7b[_0xa8b9('0x59')][_0xa8b9('0x5f')],'statusCode':_0x21ee7b[_0xa8b9('0x60')][_0xa8b9('0x61')],'endConversation':_0x21ee7b[_0xa8b9('0x59')][_0xa8b9('0x62')][_0xa8b9('0x63')]||![],'isFallbackIntent':_0x21ee7b[_0xa8b9('0x59')]['metadata'][_0xa8b9('0x64')]};});};exports[_0xa8b9('0x65')]=function(_0x53597f,_0x4d8629,_0x5f3ccb,_0x2aa9f1,_0x1a84b3,_0x1b59bd){var _0x157c41=_0x2aa9f1[_0xa8b9('0x66')](/\\n/g,'\x0a');var _0x3c823d={'credentials':{'private_key':_0x157c41,'client_email':_0x5f3ccb}};var _0x46163d=new dialogflow[(_0xa8b9('0x67'))](_0x3c823d);var _0x527b1a=_0x46163d[_0xa8b9('0x68')](_0x4d8629,md5(_0x53597f));var _0x7c240a={'session':_0x527b1a,'queryInput':{'text':{'text':_0x1a84b3,'languageCode':_0x1b59bd}}};return _0x46163d[_0xa8b9('0x69')](_0x7c240a)['then'](function(_0x45de2e){if(_0x45de2e&&_0x45de2e[_0xa8b9('0x6a')]){logger['info'](_0xa8b9('0x6b'),JSON[_0xa8b9('0x43')](_0x45de2e));var _0x6d8d7a=_0x45de2e[0x0];if(_0x6d8d7a){var _0x2d583b={'action':_0x6d8d7a[_0xa8b9('0x6c')][_0xa8b9('0x5b')],'allRequiredParamsPresent':_0x6d8d7a['queryResult']['allRequiredParamsPresent'],'endConversation':_0x6d8d7a[_0xa8b9('0x6c')][_0xa8b9('0x6d')]&&_0x6d8d7a[_0xa8b9('0x6c')][_0xa8b9('0x6d')][_0xa8b9('0x6e')]?_0x6d8d7a[_0xa8b9('0x6c')]['diagnosticInfo'][_0xa8b9('0x6e')][_0xa8b9('0x6f')][_0xa8b9('0x70')]:![],'fulfillmentText':_0x6d8d7a['queryResult']['fulfillmentText'],'intentName':_0x6d8d7a[_0xa8b9('0x6c')][_0xa8b9('0x71')]['name'],'intentDisplayName':_0x6d8d7a[_0xa8b9('0x6c')][_0xa8b9('0x71')][_0xa8b9('0x72')],'isFallbackIntent':_0x6d8d7a[_0xa8b9('0x6c')][_0xa8b9('0x71')]['isFallback'],'languageCode':_0x6d8d7a[_0xa8b9('0x6c')]['languageCode'],'queryText':_0x6d8d7a['queryResult']['queryText'],'responseId':_0x6d8d7a[_0xa8b9('0x73')],'score':_0x6d8d7a[_0xa8b9('0x6c')][_0xa8b9('0x74')],'speech':_0x6d8d7a[_0xa8b9('0x6c')][_0xa8b9('0x75')],'providerResponse':JSON[_0xa8b9('0x43')](_0x45de2e)};return _0x2d583b;}}});};exports[_0xa8b9('0x76')]=function(_0x32736f,_0x1657fe,_0x444ef3,_0x167e94){return tilde[_0xa8b9('0x4a')](_0x32736f,_0x1657fe,_0x444ef3,_0x167e94)[_0xa8b9('0x2d')](function(_0x4af2bc){try{fs['unlink'](_0x32736f);}catch(_0x30321f){logger[_0xa8b9('0x18')](_0x30321f);}logger[_0xa8b9('0x25')](_0xa8b9('0x77'),_0x4af2bc[_0xa8b9('0x78')]);logger['info'](_0xa8b9('0x79'),_0x4af2bc[_0xa8b9('0x50')]);return _0x4af2bc;});};exports[_0xa8b9('0x7a')]=function(_0x26d4d4,_0x33a248,_0x650055,_0x57ed0a,_0x277dea,_0x42f796){var _0x381a8a=path[_0xa8b9('0x28')](__dirname,'tmp',rs[_0xa8b9('0x2a')](0x4)+'.mp3');var _0x47eed3;return aws[_0xa8b9('0x7b')](_0x26d4d4,_0x33a248,_0x650055,_0x57ed0a,_0x277dea,_0x42f796,_0x381a8a)[_0xa8b9('0x2d')](function(){_0x47eed3=path[_0xa8b9('0x28')](__dirname,_0xa8b9('0x29'),rs[_0xa8b9('0x2a')](0x4)+'.wav');return convertFile(_0x381a8a,_0x47eed3);})[_0xa8b9('0x2d')](function(){try{fs[_0xa8b9('0x1e')](_0x381a8a);fs['chmodSync'](_0x47eed3,_0xa8b9('0x2f'));}catch(_0x216230){logger[_0xa8b9('0x18')](_0x216230);}return _0x47eed3[_0xa8b9('0x30')]('.')[0x0];});};exports['awsLex']=function(_0x56aa2b,_0x8c88e3,_0x6e855c,_0x5313eb,_0x10d364,_0x508f3b){return aws[_0xa8b9('0x7c')](_0x56aa2b,_0x8c88e3,_0x6e855c,_0x5313eb,_0x10d364,_0x508f3b)[_0xa8b9('0x2d')](function(_0x3c4c20){logger[_0xa8b9('0x25')](JSON[_0xa8b9('0x43')](_0x3c4c20));return _0x3c4c20;});};exports[_0xa8b9('0x7d')]=function(_0x5e0d20,_0x1764e1,_0x50f3cf,_0x5169ef){var _0x334211=util['format'](_0xa8b9('0x7e'),ISPEECH_API,_0x5e0d20,encodeURIComponent(_0x1764e1),_0x50f3cf,_0x5169ef);var _0x22560b=path[_0xa8b9('0x28')](__dirname,_0xa8b9('0x29'),rs[_0xa8b9('0x2a')](0x4)+'.mp3');var _0x5d955f;return downloadFile(_0x334211,_0x22560b)[_0xa8b9('0x2d')](function(){_0x5d955f=path[_0xa8b9('0x28')](__dirname,_0xa8b9('0x29'),rs[_0xa8b9('0x2a')](0x4)+_0xa8b9('0x2b'));return convertFile(_0x22560b,_0x5d955f);})[_0xa8b9('0x2d')](function(){try{fs[_0xa8b9('0x1e')](_0x22560b);fs[_0xa8b9('0x2e')](_0x5d955f,'777');}catch(_0x536aff){logger[_0xa8b9('0x18')](_0x536aff);}return _0x5d955f['split']('.')[0x0];});};exports[_0xa8b9('0x7f')]=function(_0x5523b0,_0x34e172,_0xaf4bc8,_0x28cd87){var _0xc4ffca=util['format'](_0xa8b9('0x80'),ISPEECH_API,_0x34e172,_0xaf4bc8,base64Encode(_0x5523b0),_0x28cd87?util['format'](_0xa8b9('0x81'),encodeURIComponent(_0x28cd87)):_0xa8b9('0x82'));return uploadFile(_0xc4ffca)['then'](function(_0x45f0bc){return querystring[_0xa8b9('0xc')](_0x45f0bc);});};exports[_0xa8b9('0x83')]=function(_0x18c363,_0x1f79a6){return sestek[_0xa8b9('0x84')](_0x18c363,_0x1f79a6)['then'](function(_0x593db9){logger[_0xa8b9('0x25')](JSON['stringify'](_0x593db9));var _0x293948={'speech':_0x593db9['text'],'action':_0x593db9[_0xa8b9('0x85')]?_0x593db9[_0xa8b9('0x85')]['CustomAction']:undefined,'actiondata':_0x593db9[_0xa8b9('0x85')]?_0x593db9['channelData'][_0xa8b9('0x86')]:undefined};if(_0x593db9[_0xa8b9('0x85')]&&_0x593db9['channelData'][_0xa8b9('0x87')]){return base64Decode(_0x593db9[_0xa8b9('0x85')]['AudioFromTts'][_0xa8b9('0x88')],path[_0xa8b9('0x28')](__dirname,_0xa8b9('0x29'),rs[_0xa8b9('0x2a')](0x4)+_0xa8b9('0x2b')))[_0xa8b9('0x2d')](function(_0x2ea690){_0x293948['audiofile']=_0x2ea690;return _0x293948;});}return _0x293948;});};exports[_0xa8b9('0x89')]=function(){return __dirname;}; \ No newline at end of file +var _0x1b3c=['metadata','endConversation','googleDialogflowV2','replace','sessionPath','detectIntent','length','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','intent','displayName','isFallback','responseId','intentDetectionConfidence','Tilde\x20ASR\x20transcription','awsPolly','polly','awsLex','ispeechTTS','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','parse','sestekNDA','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','apiai-promise','bluebird','dialogflow','http','https','md5','randomstring','google-tts-api','url','util','./aws','./google','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','path','WHAT_EVER','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusCode','statusMessage','finish','finish\x20download\x20file','close','unlink','download\x20error','end','get','data','wav','error\x20convert','info','finish\x20to\x20convert','start','resolve','.wav','writeFileSync','then','chmodSync','777','split','readFileSync','toString','base64','googleCloudTTS','https://texttospeech.googleapis.com/v1/','ssml','input','audioConfig','MP3','text:synthesize','POST','generate','.mp3','from','audioContent','writeFile','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','application/x-www-form-urlencoded','stringify','jQ1olc','null','generic','parse\x20response\x20failed:\x0a','lang\x20\x22','\x22\x20might\x20not\x20exist','tmp','goggleTTS\x20path','googleASR','asr','uri','results','alternatives','transcript','map','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','googleDialogflow','textRequest','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','code'];(function(_0x3a7455,_0x46b004){var _0x216c72=function(_0xdd775c){while(--_0xdd775c){_0x3a7455['push'](_0x3a7455['shift']());}};_0x216c72(++_0x46b004);}(_0x1b3c,0x12f));var _0xc1b3=function(_0x28c667,_0xd32899){_0x28c667=_0x28c667-0x0;var _0xbc6b8c=_0x1b3c[_0x28c667];return _0xbc6b8c;};'use strict';var apiai=require(_0xc1b3('0x0'));var BPromise=require(_0xc1b3('0x1'));var dialogflow=require(_0xc1b3('0x2'));var fs=require('fs');var http=require(_0xc1b3('0x3'));var https=require(_0xc1b3('0x4'));var md5=require(_0xc1b3('0x5'));var path=require('path');var querystring=require('querystring');var rp=require('request-promise');var rs=require(_0xc1b3('0x6'));var sox=require('sox');var tts=require(_0xc1b3('0x7'));var urlParse=require(_0xc1b3('0x8'))['parse'];var util=require(_0xc1b3('0x9'));var aws=require(_0xc1b3('0xa'));var google=require(_0xc1b3('0xb'));var sestek=require(_0xc1b3('0xc'));var tilde=require(_0xc1b3('0xd'));var logger=require(_0xc1b3('0xe'))(_0xc1b3('0xf'));var ISPEECH_API=_0xc1b3('0x10');function downloadFile(_0x104c08,_0x36b9ec){return new BPromise(function(_0x204783,_0x345f65){var _0x709a3e=urlParse(_0x104c08);var _0x4d76ca=_0x709a3e[_0xc1b3('0x11')]===_0xc1b3('0x12')?https:http;var _0x2fbbd4={'host':_0x709a3e[_0xc1b3('0x13')],'path':_0x709a3e[_0xc1b3('0x14')],'headers':{'user-agent':_0xc1b3('0x15')}};_0x4d76ca['get'](_0x2fbbd4,function(_0x5d2141){if(_0x5d2141['statusCode']!==0xc8){logger[_0xc1b3('0x16')](_0xc1b3('0x17')+_0x104c08+_0xc1b3('0x18')+_0x5d2141[_0xc1b3('0x19')]+'\x20('+_0x5d2141[_0xc1b3('0x1a')]+')');_0x345f65(new Error('request\x20to\x20'+_0x104c08+_0xc1b3('0x18')+_0x5d2141[_0xc1b3('0x19')]+'\x20('+_0x5d2141[_0xc1b3('0x1a')]+')'));return;}var _0xfcc5e9=fs['createWriteStream'](_0x36b9ec);_0xfcc5e9['on'](_0xc1b3('0x1b'),function(){logger['info'](_0xc1b3('0x1c'));_0xfcc5e9[_0xc1b3('0x1d')](_0x204783);});_0xfcc5e9['on'](_0xc1b3('0x16'),function(_0x4afc09){fs[_0xc1b3('0x1e')](_0x36b9ec);logger[_0xc1b3('0x16')](_0xc1b3('0x1f'),_0x4afc09);_0x345f65(_0x4afc09);});_0x5d2141['pipe'](_0xfcc5e9);})['on'](_0xc1b3('0x16'),function(_0x1ee010){logger[_0xc1b3('0x16')](_0x1ee010);_0x345f65(_0x1ee010);})[_0xc1b3('0x20')]();});}function uploadFile(_0x2a4ae0){return new BPromise(function(_0x386d4d,_0x21fe7c){var _0x2d9f98=urlParse(_0x2a4ae0);var _0x127186=_0x2d9f98[_0xc1b3('0x11')]===_0xc1b3('0x12')?https:http;var _0x3af91d={'host':_0x2d9f98[_0xc1b3('0x13')],'path':_0x2d9f98[_0xc1b3('0x14')],'headers':{'user-agent':_0xc1b3('0x15')}};_0x127186[_0xc1b3('0x21')](_0x3af91d,function(_0x1cdb4d){if(_0x1cdb4d[_0xc1b3('0x19')]!==0xc8){_0x21fe7c(new Error('request\x20to\x20'+_0x2a4ae0+'\x20failed,\x20status\x20code\x20=\x20'+_0x1cdb4d[_0xc1b3('0x19')]+'\x20('+_0x1cdb4d[_0xc1b3('0x1a')]+')'));return;}var _0x8ea05d='';_0x1cdb4d['on'](_0xc1b3('0x22'),function(_0x4d4f77){_0x8ea05d+=_0x4d4f77;});_0x1cdb4d['on']('end',function(){_0x386d4d(_0x8ea05d);});})['on'](_0xc1b3('0x16'),function(_0xb90389){_0x21fe7c(_0xb90389);})[_0xc1b3('0x20')]();});}function convertFile(_0x815387,_0x2541c7){return new BPromise(function(_0x2d8c85,_0x299402){var _0x595404=sox['transcode'](_0x815387,_0x2541c7,{'sampleRate':0x1f40,'format':_0xc1b3('0x23'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x595404['on']('error',function(_0x1de5d7){logger[_0xc1b3('0x16')](_0xc1b3('0x24'),_0x1de5d7);_0x299402(_0x1de5d7);});_0x595404['on'](_0xc1b3('0x20'),function(){logger[_0xc1b3('0x25')](_0xc1b3('0x26'));_0x2d8c85();});_0x595404[_0xc1b3('0x27')]();});}function base64Decode(_0x580d15,_0x59d04c){var _0x414f36=path[_0xc1b3('0x28')](__dirname,'tmp',rs['generate'](0x4)+_0xc1b3('0x29'));fs[_0xc1b3('0x2a')](_0x414f36,_0x580d15,'base64');return convertFile(_0x414f36,_0x59d04c)[_0xc1b3('0x2b')](function(){try{fs[_0xc1b3('0x1e')](_0x414f36);fs[_0xc1b3('0x2c')](_0x59d04c,_0xc1b3('0x2d'));}catch(_0x2d26c3){logger[_0xc1b3('0x16')](_0x2d26c3);}return _0x59d04c[_0xc1b3('0x2e')]('.')[0x0];});}function base64Encode(_0x2f4446){var _0x2a0b46=fs[_0xc1b3('0x2f')](_0x2f4446);return new Buffer(_0x2a0b46)[_0xc1b3('0x30')](_0xc1b3('0x31'));}exports[_0xc1b3('0x32')]=function(_0xb6f371,_0x3a0da8,_0x5d065c,_0x5bc90b,_0xe95916,_0x1372ea){var _0x1a6cd3,_0x20a915;var _0xa15cb4=_0xc1b3('0x33');var _0x53bf89='?key='+_0xb6f371;var _0xe8b13e={};if(_0x3a0da8===_0xc1b3('0x34')){_0xe8b13e[_0xc1b3('0x35')]={'ssml':_0x5d065c};}else{_0xe8b13e[_0xc1b3('0x35')]={'text':_0x5d065c};};_0xe8b13e['voice']={'languageCode':_0x5bc90b,'ssmlGender':_0xe95916};_0xe8b13e[_0xc1b3('0x36')]={'audioEncoding':_0xc1b3('0x37'),'sampleRateHertz':0x1f40};var _0x4898ef={'url':_0xa15cb4+_0xc1b3('0x38')+_0x53bf89,'method':_0xc1b3('0x39'),'json':!![],'body':_0xe8b13e};return rp(_0x4898ef)[_0xc1b3('0x2b')](function(_0x3374ed){return new BPromise(function(_0x28301b,_0x303780){_0x1a6cd3=path['resolve'](__dirname,'tmp',rs[_0xc1b3('0x3a')](0x4)+_0xc1b3('0x3b'));var _0x1c8e6f=Buffer[_0xc1b3('0x3c')](_0x3374ed[_0xc1b3('0x3d')],_0xc1b3('0x31'));return fs[_0xc1b3('0x3e')](_0x1a6cd3,_0x1c8e6f,function(_0x4e648c){_0x303780(_0x4e648c);},function(_0x160764){fs[_0xc1b3('0x2c')](_0x1a6cd3,'777');_0x28301b(_0x160764);});});})[_0xc1b3('0x2b')](function(_0x5af154){_0x20a915=path['resolve'](__dirname,'tmp',rs[_0xc1b3('0x3a')](0x4)+'.wav');return convertFile(_0x1a6cd3,_0x20a915);})['then'](function(){try{fs['unlink'](_0x1a6cd3);fs['chmodSync'](_0x20a915,_0xc1b3('0x2d'));}catch(_0x36f811){logger[_0xc1b3('0x16')](_0x36f811);}logger[_0xc1b3('0x25')]('googleCloudTTS\x20path',_0x20a915[_0xc1b3('0x2e')]('.')[0x0]);return _0x20a915[_0xc1b3('0x2e')]('.')[0x0];});};exports[_0xc1b3('0x3f')]=function(_0x1176d8,_0xead252){var _0xdad07e=_0xc1b3('0x40');var _0x4bf4bc,_0x340886;var _0x521e88;var _0x1f5a7a={'encoding':'utf8','method':_0xc1b3('0x39'),'timeout':0x2710,'url':_0xdad07e,'headers':{'Content-Type':_0xc1b3('0x41')},'body':'f.req='+encodeURIComponent(JSON[_0xc1b3('0x42')]([[[_0xc1b3('0x43'),JSON['stringify']([_0x1176d8,_0xead252||'en',![],_0xc1b3('0x44')]),null,_0xc1b3('0x45')]]]))};return rp(_0x1f5a7a)[_0xc1b3('0x2b')](function(_0x598149){try{_0x521e88=eval(_0x598149['slice'](0x5))[0x0][0x2];}catch(_0x4fcd64){throw new Error(_0xc1b3('0x46')+_0x598149[_0xc1b3('0x22')]);}if(!_0x521e88){if(_0x1176d8['length']>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0xc1b3('0x47')+_0xead252+_0xc1b3('0x48'));}}try{_0x521e88=eval(_0x521e88)[0x0];}catch(_0x327a93){throw new Error(_0xc1b3('0x46')+res[_0xc1b3('0x22')]);}const _0x1cf280=_0x521e88;_0x4bf4bc=path[_0xc1b3('0x28')](__dirname,_0xc1b3('0x49'),rs['generate'](0x4)+_0xc1b3('0x3b'));fs['writeFileSync'](_0x4bf4bc,_0x521e88,{'encoding':'base64'});_0x340886=path[_0xc1b3('0x28')](__dirname,_0xc1b3('0x49'),rs['generate'](0x4)+'.wav');return convertFile(_0x4bf4bc,_0x340886);})[_0xc1b3('0x2b')](function(){try{fs[_0xc1b3('0x1e')](_0x4bf4bc);fs['chmodSync'](_0x340886,'777');}catch(_0x55c185){logger['error'](_0x55c185);}logger[_0xc1b3('0x25')](_0xc1b3('0x4a'),_0x340886['split']('.')[0x0]);return _0x340886[_0xc1b3('0x2e')]('.')[0x0];});};exports[_0xc1b3('0x4b')]=function(_0x525b40,_0x361330,_0x26b29f){return google[_0xc1b3('0x4c')](_0x525b40,_0x361330,_0x26b29f)['then'](function(_0x455a01){logger[_0xc1b3('0x25')](_0x455a01[_0xc1b3('0x4d')]);return rp(_0x455a01);})[_0xc1b3('0x2b')](function(_0x5723f1){var _0x4f72d0='';var _0x39d6d8=0x0;try{fs[_0xc1b3('0x1e')](_0x525b40);}catch(_0x41c85f){logger[_0xc1b3('0x16')](_0x41c85f);}if(_0x5723f1&&_0x5723f1[_0xc1b3('0x4e')]){_0x4f72d0=_0x5723f1[_0xc1b3('0x4e')]['map'](function(_0x4f3d79){return _0x4f3d79&&_0x4f3d79[_0xc1b3('0x4f')][0x0]&&_0x4f3d79['alternatives'][0x0]['transcript']?_0x4f3d79[_0xc1b3('0x4f')][0x0][_0xc1b3('0x50')]:'';})['join']('\x0a');_0x39d6d8=_0x5723f1[_0xc1b3('0x4e')][_0xc1b3('0x51')](function(_0x54fbf9){return _0x54fbf9&&_0x54fbf9[_0xc1b3('0x4f')][0x0]&&_0x54fbf9['alternatives'][0x0][_0xc1b3('0x52')]?_0x54fbf9[_0xc1b3('0x4f')][0x0][_0xc1b3('0x52')]:0x0;})['join']('\x0a');}logger[_0xc1b3('0x25')](_0xc1b3('0x53'),_0x4f72d0);logger[_0xc1b3('0x25')](_0xc1b3('0x54'),_0x39d6d8);return{'transcript':_0x4f72d0,'confidence':_0x39d6d8};})[_0xc1b3('0x55')](function(_0x28d0a4){logger[_0xc1b3('0x16')](_0xc1b3('0x56'),_0x28d0a4[_0xc1b3('0x19')],_0x28d0a4[_0xc1b3('0x57')],_0x28d0a4['message']);});};exports[_0xc1b3('0x58')]=function(_0xd4a944,_0x3772d2,_0x3e37ac,_0x31eaa3){var _0xf33a40=apiai(_0x3772d2,{'language':_0x31eaa3||'en'});return _0xf33a40[_0xc1b3('0x59')](_0x3e37ac,{'sessionId':md5(_0xd4a944)})[_0xc1b3('0x2b')](function(_0x5bb367){logger['info'](JSON['stringify'](_0x5bb367));return{'source':_0x5bb367[_0xc1b3('0x5a')][_0xc1b3('0x5b')],'resolvedQuery':_0x5bb367[_0xc1b3('0x5a')][_0xc1b3('0x5c')],'action':_0x5bb367[_0xc1b3('0x5a')][_0xc1b3('0x5d')],'actionIncomplete':_0x5bb367[_0xc1b3('0x5a')][_0xc1b3('0x5e')],'speech':_0x5bb367[_0xc1b3('0x5a')][_0xc1b3('0x5f')][_0xc1b3('0x60')],'score':_0x5bb367[_0xc1b3('0x5a')][_0xc1b3('0x61')],'statusCode':_0x5bb367['status'][_0xc1b3('0x62')],'endConversation':_0x5bb367[_0xc1b3('0x5a')][_0xc1b3('0x63')][_0xc1b3('0x64')]||![],'isFallbackIntent':_0x5bb367[_0xc1b3('0x5a')][_0xc1b3('0x63')]['isFallbackIntent']};});};exports[_0xc1b3('0x65')]=function(_0x4c75c2,_0x343fd7,_0x520c79,_0x2d3a44,_0x27f48a,_0x5df808){var _0x2e34c5=_0x2d3a44[_0xc1b3('0x66')](/\\n/g,'\x0a');var _0x305f33={'credentials':{'private_key':_0x2e34c5,'client_email':_0x520c79}};var _0x2bb2b3=new dialogflow['SessionsClient'](_0x305f33);var _0x5ef0a1=_0x2bb2b3[_0xc1b3('0x67')](_0x343fd7,md5(_0x4c75c2));var _0x5cff0c={'session':_0x5ef0a1,'queryInput':{'text':{'text':_0x27f48a,'languageCode':_0x5df808}}};return _0x2bb2b3[_0xc1b3('0x68')](_0x5cff0c)[_0xc1b3('0x2b')](function(_0xf1aba1){if(_0xf1aba1&&_0xf1aba1[_0xc1b3('0x69')]){logger[_0xc1b3('0x25')]('Dialogflow\x20V2\x20response:',JSON['stringify'](_0xf1aba1));var _0x21580e=_0xf1aba1[0x0];if(_0x21580e){var _0x75de2e={'action':_0x21580e[_0xc1b3('0x6a')][_0xc1b3('0x5d')],'allRequiredParamsPresent':_0x21580e['queryResult'][_0xc1b3('0x6b')],'endConversation':_0x21580e['queryResult'][_0xc1b3('0x6c')]&&_0x21580e[_0xc1b3('0x6a')][_0xc1b3('0x6c')][_0xc1b3('0x6d')]?_0x21580e['queryResult']['diagnosticInfo']['fields'][_0xc1b3('0x6e')][_0xc1b3('0x6f')]:![],'fulfillmentText':_0x21580e['queryResult']['fulfillmentText'],'intentName':_0x21580e[_0xc1b3('0x6a')][_0xc1b3('0x70')][_0xc1b3('0x57')],'intentDisplayName':_0x21580e[_0xc1b3('0x6a')][_0xc1b3('0x70')][_0xc1b3('0x71')],'isFallbackIntent':_0x21580e[_0xc1b3('0x6a')]['intent'][_0xc1b3('0x72')],'languageCode':_0x21580e[_0xc1b3('0x6a')]['languageCode'],'queryText':_0x21580e['queryResult']['queryText'],'responseId':_0x21580e[_0xc1b3('0x73')],'score':_0x21580e[_0xc1b3('0x6a')][_0xc1b3('0x74')],'speech':_0x21580e[_0xc1b3('0x6a')]['fulfillmentText'],'providerResponse':JSON[_0xc1b3('0x42')](_0xf1aba1)};return _0x75de2e;}}});};exports['tildeASR']=function(_0x2f223a,_0x1c1774,_0x2cf0bd,_0x78bf22){return tilde[_0xc1b3('0x4c')](_0x2f223a,_0x1c1774,_0x2cf0bd,_0x78bf22)['then'](function(_0x372b68){try{fs[_0xc1b3('0x1e')](_0x2f223a);}catch(_0x1fba85){logger[_0xc1b3('0x16')](_0x1fba85);}logger['info'](_0xc1b3('0x75'),_0x372b68[_0xc1b3('0x50')]);logger[_0xc1b3('0x25')]('Tilde\x20ASR\x20confidence',_0x372b68[_0xc1b3('0x52')]);return _0x372b68;});};exports[_0xc1b3('0x76')]=function(_0x53eebf,_0x59f089,_0x23d081,_0x80a64d,_0x4ca501,_0x4effb6){var _0x3b1b59=path[_0xc1b3('0x28')](__dirname,_0xc1b3('0x49'),rs[_0xc1b3('0x3a')](0x4)+_0xc1b3('0x3b'));var _0x1cbcdb;return aws[_0xc1b3('0x77')](_0x53eebf,_0x59f089,_0x23d081,_0x80a64d,_0x4ca501,_0x4effb6,_0x3b1b59)[_0xc1b3('0x2b')](function(){_0x1cbcdb=path['resolve'](__dirname,'tmp',rs[_0xc1b3('0x3a')](0x4)+_0xc1b3('0x29'));return convertFile(_0x3b1b59,_0x1cbcdb);})[_0xc1b3('0x2b')](function(){try{fs[_0xc1b3('0x1e')](_0x3b1b59);fs[_0xc1b3('0x2c')](_0x1cbcdb,_0xc1b3('0x2d'));}catch(_0x120fbc){logger[_0xc1b3('0x16')](_0x120fbc);}return _0x1cbcdb[_0xc1b3('0x2e')]('.')[0x0];});};exports[_0xc1b3('0x78')]=function(_0x37793c,_0x362d1c,_0x2b0e54,_0xbfc475,_0x62c9d3,_0x4268dc){return aws['lex'](_0x37793c,_0x362d1c,_0x2b0e54,_0xbfc475,_0x62c9d3,_0x4268dc)['then'](function(_0x2936fb){logger[_0xc1b3('0x25')](JSON[_0xc1b3('0x42')](_0x2936fb));return _0x2936fb;});};exports[_0xc1b3('0x79')]=function(_0x43caa3,_0x1117cf,_0x517f03,_0xc37b94){var _0x34784a=util['format'](_0xc1b3('0x7a'),ISPEECH_API,_0x43caa3,encodeURIComponent(_0x1117cf),_0x517f03,_0xc37b94);var _0x19efd6=path[_0xc1b3('0x28')](__dirname,_0xc1b3('0x49'),rs[_0xc1b3('0x3a')](0x4)+_0xc1b3('0x3b'));var _0x2c5e59;return downloadFile(_0x34784a,_0x19efd6)[_0xc1b3('0x2b')](function(){_0x2c5e59=path[_0xc1b3('0x28')](__dirname,_0xc1b3('0x49'),rs[_0xc1b3('0x3a')](0x4)+_0xc1b3('0x29'));return convertFile(_0x19efd6,_0x2c5e59);})[_0xc1b3('0x2b')](function(){try{fs['unlink'](_0x19efd6);fs[_0xc1b3('0x2c')](_0x2c5e59,_0xc1b3('0x2d'));}catch(_0x3ada70){logger[_0xc1b3('0x16')](_0x3ada70);}return _0x2c5e59[_0xc1b3('0x2e')]('.')[0x0];});};exports['ispeechASR']=function(_0x205a9f,_0x1e8685,_0x2db408,_0x4b7ad8){var _0x24919b=util[_0xc1b3('0x7b')](_0xc1b3('0x7c'),ISPEECH_API,_0x1e8685,_0x2db408,base64Encode(_0x205a9f),_0x4b7ad8?util[_0xc1b3('0x7b')](_0xc1b3('0x7d'),encodeURIComponent(_0x4b7ad8)):'freeform=3');return uploadFile(_0x24919b)[_0xc1b3('0x2b')](function(_0x5d837d){return querystring[_0xc1b3('0x7e')](_0x5d837d);});};exports[_0xc1b3('0x7f')]=function(_0x5cb0e8,_0x216171){return sestek['nda'](_0x5cb0e8,_0x216171)[_0xc1b3('0x2b')](function(_0x5bccc6){logger[_0xc1b3('0x25')](JSON['stringify'](_0x5bccc6));var _0x257a5a={'speech':_0x5bccc6['text'],'action':_0x5bccc6[_0xc1b3('0x80')]?_0x5bccc6['channelData'][_0xc1b3('0x81')]:undefined,'actiondata':_0x5bccc6['channelData']?_0x5bccc6[_0xc1b3('0x80')][_0xc1b3('0x82')]:undefined};if(_0x5bccc6[_0xc1b3('0x80')]&&_0x5bccc6['channelData']['AudioFromTts']){return base64Decode(_0x5bccc6[_0xc1b3('0x80')][_0xc1b3('0x83')][_0xc1b3('0x84')],path[_0xc1b3('0x28')](__dirname,_0xc1b3('0x49'),rs[_0xc1b3('0x3a')](0x4)+_0xc1b3('0x29')))[_0xc1b3('0x2b')](function(_0x54a9ba){_0x257a5a[_0xc1b3('0x85')]=_0x54a9ba;return _0x257a5a;});}return _0x257a5a;});};exports['dirName']=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 6c9a743..3b04bfb 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 _0x4fc5=['./nda'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0x4fc5,0xa3));var _0x54fc=function(_0x3f92c7,_0x863c8){_0x3f92c7=_0x3f92c7-0x0;var _0x2e7f61=_0x4fc5[_0x3f92c7];return _0x2e7f61;};var nda=require(_0x54fc('0x0'));module['exports']={'nda':nda}; \ No newline at end of file +var _0x9f0b=['./nda'];(function(_0x353313,_0x5c3686){var _0x4cb750=function(_0x17ac7e){while(--_0x17ac7e){_0x353313['push'](_0x353313['shift']());}};_0x4cb750(++_0x5c3686);}(_0x9f0b,0x18d));var _0xb9f0=function(_0x2d4065,_0x38dc95){_0x2d4065=_0x2d4065-0x0;var _0xef6016=_0x9f0b[_0x2d4065];return _0xef6016;};var nda=require(_0xb9f0('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 c64d079..81e0dbf 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 _0x3276=['body','channelData','ProjectName','ndagenerate_audio','audio/wav','CustomAction','custom_action_data','CustomActionData','info','stringify','request-promise','agi','exports','POST','resolve','password','username','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','Nda','uniqueid','calleridname','dnid','extension','Bearer\x20','access_token','project'];(function(_0xf74003,_0xeedfda){var _0x50875a=function(_0x43743d){while(--_0x43743d){_0xf74003['push'](_0xf74003['shift']());}};_0x50875a(++_0xeedfda);}(_0x3276,0xc7));var _0x6327=function(_0x224758,_0x301107){_0x224758=_0x224758-0x0;var _0x4988ea=_0x3276[_0x224758];return _0x4988ea;};'use strict';var rp=require(_0x6327('0x0'));var url=require('url');var logger=require('../../../../../config/logger')(_0x6327('0x1'));module[_0x6327('0x2')]=function(_0x23e033,_0x1ca8a6){var _0x270378={'method':_0x6327('0x3'),'uri':url[_0x6327('0x4')](_0x1ca8a6['ndauth_url'],'/token'),'form':{'grant_type':_0x6327('0x5'),'username':_0x1ca8a6[_0x6327('0x6')],'password':_0x1ca8a6[_0x6327('0x5')]},'json':!![]};return rp(_0x270378)['then'](function(_0x29ba24){var _0x3e9616={'method':_0x6327('0x3'),'uri':url[_0x6327('0x4')](_0x1ca8a6['ndassistant_url'],_0x6327('0x7')),'body':{'type':_0x1ca8a6[_0x6327('0x8')]||'message','channelId':_0x6327('0x9'),'conversation':{'id':_0x23e033[_0x6327('0xa')]},'from':{'id':_0x23e033['callerid'],'name':_0x23e033[_0x6327('0xb')]},'recipient':{'id':_0x23e033[_0x6327('0xc')],'name':_0x23e033[_0x6327('0xd')]},'text':_0x1ca8a6['text'],'channelData':{}},'headers':{'Authorization':_0x6327('0xe')+_0x29ba24[_0x6327('0xf')]},'json':!![]};if(_0x1ca8a6[_0x6327('0x10')]){_0x3e9616[_0x6327('0x11')][_0x6327('0x12')][_0x6327('0x13')]=_0x1ca8a6[_0x6327('0x10')];}if(_0x1ca8a6[_0x6327('0x14')]=='1'){_0x3e9616[_0x6327('0x11')][_0x6327('0x12')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x6327('0x15')};}if(_0x1ca8a6['custom_action']){_0x3e9616[_0x6327('0x11')][_0x6327('0x12')][_0x6327('0x16')]=_0x1ca8a6['custom_action'];if(_0x1ca8a6[_0x6327('0x17')]){_0x3e9616[_0x6327('0x11')][_0x6327('0x12')][_0x6327('0x18')]=_0x1ca8a6[_0x6327('0x17')];}}logger[_0x6327('0x19')](JSON[_0x6327('0x1a')](_0x3e9616));return rp(_0x3e9616);});}; \ No newline at end of file +var _0x6324=['POST','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','Nda','uniqueid','callerid','calleridname','dnid','extension','text','Bearer\x20','project','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','body','custom_action_data','info','stringify','request-promise','url','../../../../../config/logger','agi','resolve','/token','password','username'];(function(_0x3b632f,_0x453380){var _0x10e788=function(_0x2228a4){while(--_0x2228a4){_0x3b632f['push'](_0x3b632f['shift']());}};_0x10e788(++_0x453380);}(_0x6324,0x142));var _0x4632=function(_0x2b0074,_0x42d50b){_0x2b0074=_0x2b0074-0x0;var _0x25b012=_0x6324[_0x2b0074];return _0x25b012;};'use strict';var rp=require(_0x4632('0x0'));var url=require(_0x4632('0x1'));var logger=require(_0x4632('0x2'))(_0x4632('0x3'));module['exports']=function(_0x1805c5,_0x48e508){var _0x3bea40={'method':'POST','uri':url[_0x4632('0x4')](_0x48e508['ndauth_url'],_0x4632('0x5')),'form':{'grant_type':_0x4632('0x6'),'username':_0x48e508[_0x4632('0x7')],'password':_0x48e508[_0x4632('0x6')]},'json':!![]};return rp(_0x3bea40)['then'](function(_0x17e860){var _0x44dd6d={'method':_0x4632('0x8'),'uri':url['resolve'](_0x48e508[_0x4632('0x9')],_0x4632('0xa')),'body':{'type':_0x48e508['ndaactivity_type']||'message','channelId':_0x4632('0xb'),'conversation':{'id':_0x1805c5[_0x4632('0xc')]},'from':{'id':_0x1805c5[_0x4632('0xd')],'name':_0x1805c5[_0x4632('0xe')]},'recipient':{'id':_0x1805c5[_0x4632('0xf')],'name':_0x1805c5[_0x4632('0x10')]},'text':_0x48e508[_0x4632('0x11')],'channelData':{}},'headers':{'Authorization':_0x4632('0x12')+_0x17e860['access_token']},'json':!![]};if(_0x48e508[_0x4632('0x13')]){_0x44dd6d['body'][_0x4632('0x14')][_0x4632('0x15')]=_0x48e508[_0x4632('0x13')];}if(_0x48e508[_0x4632('0x16')]=='1'){_0x44dd6d['body'][_0x4632('0x14')][_0x4632('0x17')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x4632('0x18')};}if(_0x48e508[_0x4632('0x19')]){_0x44dd6d[_0x4632('0x1a')]['channelData']['CustomAction']=_0x48e508[_0x4632('0x19')];if(_0x48e508[_0x4632('0x1b')]){_0x44dd6d[_0x4632('0x1a')][_0x4632('0x14')]['CustomActionData']=_0x48e508[_0x4632('0x1b')];}}logger[_0x4632('0x1c')](JSON[_0x4632('0x1d')](_0x44dd6d));return rp(_0x44dd6d);});}; \ 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 f1c5825..8f6ab5d 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 _0xe930=['./lib/api','exports'];(function(_0x3b9855,_0x14e215){var _0x24878e=function(_0x11ffb0){while(--_0x11ffb0){_0x3b9855['push'](_0x3b9855['shift']());}};_0x24878e(++_0x14e215);}(_0xe930,0x1de));var _0x0e93=function(_0x382c73,_0x199cab){_0x382c73=_0x382c73-0x0;var _0x1dd0bf=_0xe930[_0x382c73];return _0x1dd0bf;};'use strict';var asr=require(_0x0e93('0x0'));module[_0x0e93('0x1')]=function(_0x5371c2,_0x51ac93,_0x2bbe38,_0x5e5e39){return asr(_0x5371c2,_0x51ac93,_0x2bbe38,_0x5e5e39);}; \ No newline at end of file +var _0xe295=['exports'];(function(_0x1e9819,_0x1dab2c){var _0x24515e=function(_0x21e755){while(--_0x21e755){_0x1e9819['push'](_0x1e9819['shift']());}};_0x24515e(++_0x1dab2c);}(_0xe295,0x143));var _0x5e29=function(_0x9f021c,_0x59b485){_0x9f021c=_0x9f021c-0x0;var _0x3f6ca8=_0xe295[_0x9f021c];return _0x3f6ca8;};'use strict';var asr=require('./lib/api');module[_0x5e29('0x0')]=function(_0x138038,_0x1b1c3d,_0x455539,_0x31c0cf){return asr(_0x138038,_0x1b1c3d,_0x455539,_0x31c0cf);}; \ 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 05c8c5e..a8b6498 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 _0xe04d=['bluebird','moment','../../../../../../config/logger','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','Tilde\x20ASR\x20hypoteses','hypotheses','likelihood','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'];(function(_0x512efc,_0xf42eee){var _0x49fd98=function(_0x2ee5a5){while(--_0x2ee5a5){_0x512efc['push'](_0x512efc['shift']());}};_0x49fd98(++_0xf42eee);}(_0xe04d,0xde));var _0xde04=function(_0x2adfb1,_0x406e6e){_0x2adfb1=_0x2adfb1-0x0;var _0xa52d45=_0xe04d[_0x2adfb1];return _0xa52d45;};'use strict';var BPromise=require(_0xde04('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xde04('0x1'));var crypto=require('crypto');var logger=require(_0xde04('0x2'))('agi');module['exports']=function(_0x34dc2b,_0x134c90,_0x2bbbb9,_0xa4e22b){return new BPromise(function(_0x351fe1,_0xeabe06){logger[_0xde04('0x3')](_0xde04('0x4'),_0xa4e22b||_0xde04('0x5'));var _0x3c9011=new WebSocket(_0xa4e22b||_0xde04('0x5'),{'perMessageDeflate':![]});var _0xa8840b='';var _0x5d93fc='0';var _0x2b6e19='1';var _0x15e191=_0xde04('0x6');function _0x22fc63(_0x4aaeeb){var _0x309483=crypto[_0xde04('0x7')](_0xde04('0x8'));_0x309483[_0xde04('0x9')](_0x4aaeeb);return _0x309483['digest'](_0xde04('0xa'));}function _0x591253(){try{logger[_0xde04('0x3')](_0xde04('0xb'));var _0x49f082=moment()[_0xde04('0xc')]();var _0x4db534=_0x22fc63(_0x49f082+_0x134c90+_0x2bbbb9);_0x3c9011[_0xde04('0xd')](JSON[_0xde04('0xe')]({'appID':_0x134c90,'timestamp':_0x49f082,'appKey':_0x4db534}));var _0x2aefa5=fs[_0xde04('0xf')](_0x34dc2b);_0x2aefa5['on']('data',function(_0x5f3e22){_0x3c9011[_0xde04('0xd')](_0x5f3e22);});_0x2aefa5['on'](_0xde04('0x10'),function(){_0x3c9011[_0xde04('0xd')](_0xde04('0x11'));});}catch(_0x5c94f5){logger[_0xde04('0x12')](_0xde04('0x13'),JSON[_0xde04('0xe')](_0x5c94f5));_0x3c9011[_0xde04('0x14')]();}}function _0x35bb44(_0x3e0221){try{if(_0x3e0221){var _0x43c48a=JSON[_0xde04('0x15')](_0x3e0221);switch(_0x43c48a[_0xde04('0x16')]){case 0x0:if(_0x43c48a['result']){if(_0x43c48a[_0xde04('0x17')]['final']){logger[_0xde04('0x3')](_0xde04('0x18'),JSON[_0xde04('0xe')](_0x43c48a['result'][_0xde04('0x19')]));_0xa8840b=_0x43c48a[_0xde04('0x17')]['hypotheses'][0x0]['transcript'];_0x5d93fc=_0x43c48a[_0xde04('0x17')][_0xde04('0x19')][0x0][_0xde04('0x1a')];_0x2b6e19='0';_0x15e191='Success.';_0x3c9011[_0xde04('0x14')]();}}break;case 0x1:logger[_0xde04('0x3')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x2b6e19='1';_0x15e191=_0xde04('0x6');break;case 0x2:logger[_0xde04('0x3')](_0xde04('0x1b'));_0x2b6e19='2';_0x15e191='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger['info']('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x2b6e19='9';_0x15e191=_0xde04('0x1c');break;case 0xa:logger[_0xde04('0x3')]('Authentication\x20failed.');_0x2b6e19='10';_0x15e191=_0xde04('0x1d');break;case 0xb:logger[_0xde04('0x3')](_0xde04('0x1e'));_0x2b6e19='11';_0x15e191=_0xde04('0x1e');}}}catch(_0x55e9a4){logger[_0xde04('0x12')](_0xde04('0x1f'),JSON[_0xde04('0xe')](_0x55e9a4));_0x3c9011[_0xde04('0x14')]();}}function _0x3b5a25(){logger['info'](_0xde04('0x20'));_0x351fe1({'transcript':_0xa8840b,'confidence':_0x5d93fc,'status':_0x2b6e19,'status_message':_0x15e191});}function _0x1a41a7(_0x4c31c8){logger[_0xde04('0x12')](_0xde04('0x21'));if(!_[_0xde04('0x22')](_0x4c31c8)){logger['error'](_[_0xde04('0x23')](_0x4c31c8)?JSON[_0xde04('0xe')](_0x4c31c8):_0x4c31c8);}}_0x3c9011['on'](_0xde04('0x24'),_0x591253);_0x3c9011['on']('message',_0x35bb44);_0x3c9011['on']('close',_0x3b5a25);_0x3c9011['on']('error',_0x1a41a7);});}; \ No newline at end of file +var _0x382d=['isNil','isObject','open','message','bluebird','lodash','moment','crypto','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','Open\x20Tilde\x20ASR\x20socket','unix','stringify','createReadStream','data','send','close','EOS','error','Tilde\x20ASR\x20send\x20error','status','result','Tilde\x20ASR\x20hypoteses','hypotheses','likelihood','Success.','terminate','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.','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket'];(function(_0x1d720a,_0x5e93e5){var _0x240199=function(_0x2f6ad2){while(--_0x2f6ad2){_0x1d720a['push'](_0x1d720a['shift']());}};_0x240199(++_0x5e93e5);}(_0x382d,0x194));var _0xd382=function(_0x5a6de8,_0x282458){_0x5a6de8=_0x5a6de8-0x0;var _0x4fedeb=_0x382d[_0x5a6de8];return _0x4fedeb;};'use strict';var BPromise=require(_0xd382('0x0'));var _=require(_0xd382('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xd382('0x2'));var crypto=require(_0xd382('0x3'));var logger=require('../../../../../../config/logger')(_0xd382('0x4'));module[_0xd382('0x5')]=function(_0x325909,_0xee6325,_0x51f107,_0x50e21d){return new BPromise(function(_0x27ded6,_0x58c583){logger[_0xd382('0x6')](_0xd382('0x7'),_0x50e21d||_0xd382('0x8'));var _0x4fdd40=new WebSocket(_0x50e21d||_0xd382('0x8'),{'perMessageDeflate':![]});var _0x1796cf='';var _0x5e85e5='0';var _0x33c35e='1';var _0x4c0a18=_0xd382('0x9');function _0x3d7fe2(_0x22c1e9){var _0x57420f=crypto[_0xd382('0xa')](_0xd382('0xb'));_0x57420f[_0xd382('0xc')](_0x22c1e9);return _0x57420f['digest']('hex');}function _0x436c71(){try{logger['info'](_0xd382('0xd'));var _0xcad462=moment()[_0xd382('0xe')]();var _0x1f13cd=_0x3d7fe2(_0xcad462+_0xee6325+_0x51f107);_0x4fdd40['send'](JSON[_0xd382('0xf')]({'appID':_0xee6325,'timestamp':_0xcad462,'appKey':_0x1f13cd}));var _0x249e60=fs[_0xd382('0x10')](_0x325909);_0x249e60['on'](_0xd382('0x11'),function(_0x5404b1){_0x4fdd40[_0xd382('0x12')](_0x5404b1);});_0x249e60['on'](_0xd382('0x13'),function(){_0x4fdd40['send'](_0xd382('0x14'));});}catch(_0x31c34c){logger[_0xd382('0x15')](_0xd382('0x16'),JSON[_0xd382('0xf')](_0x31c34c));_0x4fdd40['terminate']();}}function _0x5b2bd1(_0x4f0418){try{if(_0x4f0418){var _0x4d7414=JSON['parse'](_0x4f0418);switch(_0x4d7414[_0xd382('0x17')]){case 0x0:if(_0x4d7414[_0xd382('0x18')]){if(_0x4d7414[_0xd382('0x18')]['final']){logger[_0xd382('0x6')](_0xd382('0x19'),JSON[_0xd382('0xf')](_0x4d7414[_0xd382('0x18')][_0xd382('0x1a')]));_0x1796cf=_0x4d7414['result']['hypotheses'][0x0]['transcript'];_0x5e85e5=_0x4d7414['result'][_0xd382('0x1a')][0x0][_0xd382('0x1b')];_0x33c35e='0';_0x4c0a18=_0xd382('0x1c');_0x4fdd40[_0xd382('0x1d')]();}}break;case 0x1:logger[_0xd382('0x6')](_0xd382('0x9'));_0x33c35e='1';_0x4c0a18=_0xd382('0x9');break;case 0x2:logger[_0xd382('0x6')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x33c35e='2';_0x4c0a18=_0xd382('0x1e');break;case 0x9:logger[_0xd382('0x6')](_0xd382('0x1f'));_0x33c35e='9';_0x4c0a18=_0xd382('0x1f');break;case 0xa:logger[_0xd382('0x6')](_0xd382('0x20'));_0x33c35e='10';_0x4c0a18='Authentication\x20failed.';break;case 0xb:logger[_0xd382('0x6')](_0xd382('0x21'));_0x33c35e='11';_0x4c0a18=_0xd382('0x21');}}}catch(_0xe3d7a3){logger['error']('Tilde\x20ASR\x20parse\x20error',JSON[_0xd382('0xf')](_0xe3d7a3));_0x4fdd40[_0xd382('0x1d')]();}}function _0x285e96(){logger[_0xd382('0x6')](_0xd382('0x22'));_0x27ded6({'transcript':_0x1796cf,'confidence':_0x5e85e5,'status':_0x33c35e,'status_message':_0x4c0a18});}function _0x55b383(_0x5a9cbf){logger['error'](_0xd382('0x23'));if(!_[_0xd382('0x24')](_0x5a9cbf)){logger['error'](_[_0xd382('0x25')](_0x5a9cbf)?JSON[_0xd382('0xf')](_0x5a9cbf):_0x5a9cbf);}}_0x4fdd40['on'](_0xd382('0x26'),_0x436c71);_0x4fdd40['on'](_0xd382('0x27'),_0x5b2bd1);_0x4fdd40['on'](_0xd382('0x13'),_0x285e96);_0x4fdd40['on'](_0xd382('0x15'),_0x55b383);});}; \ 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 14df84e..595a5b2 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 _0x0e0c=['./asr'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0e0c,0xc6));var _0xc0e0=function(_0x419961,_0xbca36b){_0x419961=_0x419961-0x0;var _0x1a45fa=_0x0e0c[_0x419961];return _0x1a45fa;};var asr=require(_0xc0e0('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0x8c5b=['./asr'];(function(_0x32fe3e,_0x5993d2){var _0x13445b=function(_0x23c6b6){while(--_0x23c6b6){_0x32fe3e['push'](_0x32fe3e['shift']());}};_0x13445b(++_0x5993d2);}(_0x8c5b,0xcd));var _0xb8c5=function(_0x3a9661,_0x530b12){_0x3a9661=_0x3a9661-0x0;var _0x5bb119=_0x8c5b[_0x3a9661];return _0x5bb119;};var asr=require(_0xb8c5('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 4007ce5..5638503 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 _0xde74=['connection','data','parse','projectUpdate','log','getConnections','error','E_AGI_SERVER_MAXCONNECTION','ready','E_AGI_SERVER_CLOSE','nextTick','inherits','net','events','./channel','call','emit','E_AGI_ARGUMENT_PORT','listen','listening'];(function(_0x3e5607,_0x5c21bc){var _0x3e8519=function(_0x19d77b){while(--_0x19d77b){_0x3e5607['push'](_0x3e5607['shift']());}};_0x3e8519(++_0x5c21bc);}(_0xde74,0x1c4));var _0x4de7=function(_0x3194fa,_0x288daa){_0x3194fa=_0x3194fa-0x0;var _0xc69550=_0xde74[_0x3194fa];return _0xc69550;};'use strict';var util=require('util');var net=require(_0x4de7('0x0'));var EventEmitter=require(_0x4de7('0x1'))['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0x4de7('0x2'));var AGIServer=function(_0x56461f,_0x3483ba,_0x19d824){var _0x53e709=this;var _0x5ee5f8=null;var _0x31323a=0x0;if(!_0x56461f)_0x56461f=0x11dd;if(!_0x3483ba)_0x3483ba='127.0.0.1';EventEmitter[_0x4de7('0x3')](_0x53e709);function _0x3b94ac(){if(!_0x56461f){_0x53e709[_0x4de7('0x4')]('error',new AGIError(_0x4de7('0x5')));return![];}_0x5ee5f8=net['createServer']();_0x5ee5f8[_0x4de7('0x6')](_0x56461f,_0x3483ba);_0x5ee5f8['on'](_0x4de7('0x7'),function(){_0x53e709[_0x4de7('0x4')](_0x4de7('0x7'));});_0x5ee5f8['on'](_0x4de7('0x8'),function(_0x22b7a3){_0x22b7a3['on'](_0x4de7('0x9'),function(_0x3c9240){try{var _0x28fc0b=JSON[_0x4de7('0xa')](_0x3c9240);_0x53e709['emit'](_0x4de7('0xb'),_0x28fc0b);}catch(_0x39809a){console[_0x4de7('0xc')](_0x39809a);}});_0x5ee5f8[_0x4de7('0xd')](function(_0x2013da,_0x49fcf9){if(_0x2013da){_0x53e709['emit'](_0x4de7('0xe'),new AGIError('E_AGI_SERVER_ERROR',_0x2013da));}else if(_0x19d824&&_0x19d824<0x0){_0x53e709[_0x4de7('0x4')](_0x4de7('0xe'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x22b7a3['destroy']();}else if(_0x19d824&&_0x19d824>0x0&&_0x19d824<_0x49fcf9){_0x31323a+=0x1;_0x53e709[_0x4de7('0x4')](_0x4de7('0xe'),new AGIError(_0x4de7('0xf'),_0x31323a));_0x22b7a3['destroy']();}else{var _0xde1356=new AGIChannel(_0x22b7a3);_0xde1356['on'](_0x4de7('0x10'),function(){_0x53e709[_0x4de7('0x4')](_0x4de7('0x8'),_0xde1356);});}});});_0x5ee5f8['on'](_0x4de7('0xe'),function(_0x415bd9){_0x53e709[_0x4de7('0x4')](_0x4de7('0xe'),new AGIError('E_AGI_SERVER_ERROR',_0x415bd9['code']));});_0x5ee5f8['on']('close',function(){_0x53e709[_0x4de7('0x4')]('close',new AGIError(_0x4de7('0x11')));});}process[_0x4de7('0x12')](function(){_0x3b94ac();});};util[_0x4de7('0x13')](AGIServer,EventEmitter);module['exports']=function(_0x103059,_0x5367d1,_0x5e9d17){return new AGIServer(_0x103059,_0x5367d1,_0x5e9d17);}; \ No newline at end of file +var _0x7c30=['createServer','listening','connection','data','parse','projectUpdate','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','ready','close','E_AGI_SERVER_CLOSE','nextTick','util','net','events','./error','./channel','call','emit','error','E_AGI_ARGUMENT_PORT'];(function(_0x3a951e,_0x35eade){var _0x142e63=function(_0x377c54){while(--_0x377c54){_0x3a951e['push'](_0x3a951e['shift']());}};_0x142e63(++_0x35eade);}(_0x7c30,0xbd));var _0x07c3=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x7c30[_0x17d9e3];return _0x14192d;};'use strict';var util=require(_0x07c3('0x0'));var net=require(_0x07c3('0x1'));var EventEmitter=require(_0x07c3('0x2'))['EventEmitter'];var AGIError=require(_0x07c3('0x3'));var AGIChannel=require(_0x07c3('0x4'));var AGIServer=function(_0x53c92c,_0x643817,_0xf85cbc){var _0xca05d9=this;var _0x1378e6=null;var _0x95ec71=0x0;if(!_0x53c92c)_0x53c92c=0x11dd;if(!_0x643817)_0x643817='127.0.0.1';EventEmitter[_0x07c3('0x5')](_0xca05d9);function _0x5a6b49(){if(!_0x53c92c){_0xca05d9[_0x07c3('0x6')](_0x07c3('0x7'),new AGIError(_0x07c3('0x8')));return![];}_0x1378e6=net[_0x07c3('0x9')]();_0x1378e6['listen'](_0x53c92c,_0x643817);_0x1378e6['on'](_0x07c3('0xa'),function(){_0xca05d9[_0x07c3('0x6')](_0x07c3('0xa'));});_0x1378e6['on'](_0x07c3('0xb'),function(_0xcaa2b3){_0xcaa2b3['on'](_0x07c3('0xc'),function(_0x1ed20c){try{var _0x44f1e5=JSON[_0x07c3('0xd')](_0x1ed20c);_0xca05d9[_0x07c3('0x6')](_0x07c3('0xe'),_0x44f1e5);}catch(_0x987f18){console['log'](_0x987f18);}});_0x1378e6['getConnections'](function(_0x3a97d3,_0x51655a){if(_0x3a97d3){_0xca05d9[_0x07c3('0x6')](_0x07c3('0x7'),new AGIError(_0x07c3('0xf'),_0x3a97d3));}else if(_0xf85cbc&&_0xf85cbc<0x0){_0xca05d9[_0x07c3('0x6')](_0x07c3('0x7'),new AGIError(_0x07c3('0x10')));_0xcaa2b3[_0x07c3('0x11')]();}else if(_0xf85cbc&&_0xf85cbc>0x0&&_0xf85cbc<_0x51655a){_0x95ec71+=0x1;_0xca05d9['emit'](_0x07c3('0x7'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x95ec71));_0xcaa2b3[_0x07c3('0x11')]();}else{var _0x1b7177=new AGIChannel(_0xcaa2b3);_0x1b7177['on'](_0x07c3('0x12'),function(){_0xca05d9['emit'](_0x07c3('0xb'),_0x1b7177);});}});});_0x1378e6['on'](_0x07c3('0x7'),function(_0x55113a){_0xca05d9[_0x07c3('0x6')](_0x07c3('0x7'),new AGIError('E_AGI_SERVER_ERROR',_0x55113a['code']));});_0x1378e6['on'](_0x07c3('0x13'),function(){_0xca05d9['emit'](_0x07c3('0x13'),new AGIError(_0x07c3('0x14')));});}process[_0x07c3('0x15')](function(){_0x5a6b49();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x1aaae0,_0x111dc8,_0xd6c3d4){return new AGIServer(_0x1aaae0,_0x111dc8,_0xd6c3d4);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 17ee46e..072d7d3 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 _0xdbfc=['no\x20text\x20configured','MRCPSynth','noop','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','no\x20grammar\x20configured','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','no\x20list\x20selected','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Executed\x20command\x20MRCPSynth\x20%s','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','grammar','MRCPRecog','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','no\x20variable\x20found','keys','%s[%s][%s]','%s_ROWS_COUNT','dial','Enter\x20in\x20DIAL\x20(%s)\x20block','no\x20user\x20selected','sip_id','DIAL','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','Trying\x20Dialogflow:\x20%s','speech','out','Dialogflow\x20Result\x20%s','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','bot','Trying\x20DialogflowV2:\x20%s','providerResponse','DIALOGFLOW_%s','dialogflowV2','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','ndassistant_url','SESTEK_NDA_%s','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','end','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','opts','Executed\x20command\x20%s','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','getSound','no\x20file\x20audio\x20found','getData','test','mindigit','maxdigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_bot_name','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','NOBEEP','recordFile','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','beep','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','Enter\x20in\x20GOTO\x20(%s)\x20block','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','no\x20condition\x20configured','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME\x20%s\x20%s','true','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','IspeechASR\x20Result\x20%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','intKey','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','file_id','no\x20file\x20audio\x20selected','response','output','pause','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','getVoiceQueue','indexOf','toLowerCase','QUEUE','macro','gosub','Executed\x20command\x20%s\x20%s','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','200','%s_STATUS_MESSAGE','statusMessage','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','variable\x20%s\x20set','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','sayNumber','number','sayphonetic','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','user','bcc','subject','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','debug','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','no\x20variable\x20selected','variable_value','start','START\x20CALLY\x20SQUARE','yes','Answer','subproject','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://%s/square,\x22%s\x22,\x22%s\x22','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','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','VOICEMAIL','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','util','lodash','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawBody','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','getVariable','getVariableById','name','catch','prototype','getVoiceQueueById','then','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSoundById','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','getSoundPath','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','extension','priority','accountcode','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','scheduledAt','callback','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','en-US','MP3','googleTTS','google_tts_language','restAPI','method','timeout','includes','POST','PUT','toUpperCase','body','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','render','url','parse','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','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','Amy','aws_text_type','awsLex','aws_lex_region','googleASR','tildeASR','appid','appsecret','uri','clear','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','%s.%s','split','replaceAll','extra','getAndSetVariable','result','setVariable','maxRetry','retry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block'];(function(_0x158e3b,_0x4534b){var _0x551a1d=function(_0x629c21){while(--_0x629c21){_0x158e3b['push'](_0x158e3b['shift']());}};_0x551a1d(++_0x4534b);}(_0xdbfc,0x11d));var _0xcdbf=function(_0x303b3f,_0x33decc){_0x303b3f=_0x303b3f-0x0;var _0x149607=_0xdbfc[_0x303b3f];return _0x149607;};'use strict';var fs=require('fs');var util=require(_0xcdbf('0x0'));var _=require(_0xcdbf('0x1'));var sh=require('shelljs');var odbc=require('odbc')();var rs=require(_0xcdbf('0x2'));var moment=require(_0xcdbf('0x3'));var Mustache=require(_0xcdbf('0x4'));var rp=require(_0xcdbf('0x5'));var logger=require(_0xcdbf('0x6'))(_0xcdbf('0x7'));var config=require(_0xcdbf('0x8'));var shared=require('../../config/environment/shared');var scripts=require(_0xcdbf('0x9'));var FILES_PATH=_0xcdbf('0xa');var recursiveMapAttributes=['rawHeaders',_0xcdbf('0xb')];var verticesWithRetry=[_0xcdbf('0xc'),_0xcdbf('0xd'),_0xcdbf('0xe')];var AGIVertices=function(_0x59cb76,_0x171058,_0x30e0a4){this[_0xcdbf('0xf')]=_0x59cb76;this[_0xcdbf('0x10')]=_0x171058;this[_0xcdbf('0x11')]=_0x30e0a4;};AGIVertices['prototype'][_0xcdbf('0x12')]=function(_0x5b5049,_0x167988){this['rpc'][_0xcdbf('0x13')](_0x5b5049)['then'](function(_0x13a02d){_0x167988(null,_0x13a02d?_0x13a02d[_0xcdbf('0x14')]:![]);})[_0xcdbf('0x15')](function(_0x4e64dd){_0x167988(_0x4e64dd);});};AGIVertices[_0xcdbf('0x16')]['getVoiceQueue']=function(_0xe034bc,_0x4264b6){this[_0xcdbf('0x10')][_0xcdbf('0x17')](_0xe034bc)[_0xcdbf('0x18')](function(_0x5ec307){_0x4264b6(null,_0x5ec307?_0x5ec307[_0xcdbf('0x14')]:![]);})[_0xcdbf('0x15')](function(_0x1ce3bb){_0x4264b6(_0x1ce3bb);});};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0x19')]=function(_0x2d78bc,_0x19b5bd){this[_0xcdbf('0x10')][_0xcdbf('0x1a')](_0x2d78bc)[_0xcdbf('0x18')](function(_0x133959){_0x19b5bd(null,_0x133959?_0x133959['name']:![]);})[_0xcdbf('0x15')](function(_0x402166){_0x19b5bd(_0x402166);});};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0x1b')]=function(_0x10df54,_0x1ec5dc){this['rpc'][_0xcdbf('0x1c')](_0x10df54)[_0xcdbf('0x18')](function(_0x41458b){_0x1ec5dc(null,_0x41458b?_0x41458b[_0xcdbf('0x1d')]:![]);})[_0xcdbf('0x15')](function(_0x5ab036){_0x1ec5dc(_0x5ab036);});};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0x1e')]=function(_0x22bbf7,_0x123d96){this['rpc'][_0xcdbf('0x1f')](_0x22bbf7)['then'](function(_0x574502){_0x123d96(null,_0x574502?_0x574502[_0xcdbf('0x14')]:![]);})['catch'](function(_0x7fb6b7){_0x123d96(_0x7fb6b7);});};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0x20')]=function(_0x21da6e,_0x2b9764){this['rpc'][_0xcdbf('0x21')](_0x21da6e)[_0xcdbf('0x18')](function(_0x19898b){_0x2b9764(null,_0x19898b?_0x19898b[_0xcdbf('0x14')]:![]);})[_0xcdbf('0x15')](function(_0x3ef24b){_0x2b9764(_0x3ef24b);});};AGIVertices[_0xcdbf('0x16')]['getSound']=function(_0x3b96ba,_0x37a5b1){var _0xc9f8e5=this;this[_0xcdbf('0x10')][_0xcdbf('0x22')](_0x3b96ba)[_0xcdbf('0x18')](function(_0x3c3c4b){_0x37a5b1(null,_0x3c3c4b?_0xc9f8e5['getSoundPath'](_0x3c3c4b[_0xcdbf('0x23')]):![]);})[_0xcdbf('0x15')](function(_0x475118){_0x37a5b1(_0x475118);});};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0x24')]=function(_0x575be6,_0x2863d0){this[_0xcdbf('0x10')][_0xcdbf('0x25')](_0x575be6)[_0xcdbf('0x18')](function(_0xaa66bd){_0x2863d0(null,_0xaa66bd?_0xaa66bd:![]);})[_0xcdbf('0x15')](function(_0x4fb7c2){_0x2863d0(_0x4fb7c2);});};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0x26')]=function(_0x39e439,_0x39e327,_0x2e7ad5){this['mailRpc'][_0xcdbf('0x26')](_0x39e439,_0x39e327)[_0xcdbf('0x18')](function(){_0x2e7ad5(null);})[_0xcdbf('0x15')](function(_0x3cb09f){_0x2e7ad5(_0x3cb09f);});};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0x27')]=function(_0x2a37e2,_0x8fea82){this[_0xcdbf('0x10')][_0xcdbf('0x28')](_0x2a37e2)['then'](function(_0x531bf8){if(_0x531bf8){if(_0x531bf8[_0xcdbf('0x29')]){_0x8fea82(null,[_0x531bf8[_0xcdbf('0x2a')]]);}else{_0x8fea82(null,_[_0xcdbf('0x2b')](_0x531bf8['Intervals'],_0xcdbf('0x2a')));}}else{_0x8fea82(null,![]);}})[_0xcdbf('0x15')](function(_0x1fa97f){_0x8fea82(_0x1fa97f);});};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0x2c')]=function(_0x74ee45){return util[_0xcdbf('0x2d')](_0xcdbf('0x2e'),FILES_PATH,_0x74ee45);};AGIVertices['prototype'][_0xcdbf('0x2f')]=function(_0x5987ed,_0x4122ea,_0x4b7ed6){odbc[_0xcdbf('0x30')](_0x5987ed,function(_0x3c1e03){if(_0x3c1e03){logger[_0xcdbf('0x31')](_0xcdbf('0x32'),_0x3c1e03);_0x4b7ed6(_0x3c1e03);}else{logger[_0xcdbf('0x33')](_0xcdbf('0x34'));odbc[_0xcdbf('0x35')](_0x4122ea,function(_0x4378b7,_0x116453){if(_0x4378b7){logger[_0xcdbf('0x33')]('Error\x20executing\x20query\x20%s',_0x4122ea);_0x4b7ed6(_0x4378b7);}else{logger[_0xcdbf('0x33')](_0xcdbf('0x36'),_0x4122ea);odbc[_0xcdbf('0x37')](function(_0x24356d){if(_0x24356d){logger['error'](_0xcdbf('0x38'),_0x24356d);}_0x4b7ed6(null,_0x116453);});}});}});};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0x39')]=function(_0x192760,_0x1eee6f){this[_0xcdbf('0x10')][_0xcdbf('0x3a')](_0x192760)[_0xcdbf('0x18')](function(_0x4daeb3){_0x1eee6f(null,_0x4daeb3?_0x4daeb3:![]);})[_0xcdbf('0x15')](function(_0x1d8216){_0x1eee6f(_0x1d8216);});};AGIVertices['prototype'][_0xcdbf('0x3b')]=function(_0x1d5fb2,_0x21f36c){this[_0xcdbf('0x10')][_0xcdbf('0x3b')](_0x1d5fb2)[_0xcdbf('0x18')](function(_0x332ad5){_0x21f36c(null,_0x332ad5);})[_0xcdbf('0x15')](function(_0x3f6d9e){_0x21f36c(_0x3f6d9e);});};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0x3c')]=function(_0x4c444a,_0x204b66,_0x3f25bb){this[_0xcdbf('0x10')]['createSquareDetailsReport']({'uniqueid':this[_0xcdbf('0xf')][_0xcdbf('0x3d')],'node':_0x4c444a[_0xcdbf('0x3e')],'application':_0x4c444a[_0xcdbf('0x3f')],'data':_0x204b66||null,'project_name':this[_0xcdbf('0xf')][_0xcdbf('0x40')],'callerid':this['channel'][_0xcdbf('0x41')]})[_0xcdbf('0x18')](function(_0x285f94){if(_0x3f25bb){_0x3f25bb(null,_0x285f94);}})[_0xcdbf('0x15')](function(_0x5d923e){if(_0x3f25bb){_0x3f25bb(_0x5d923e);}});};AGIVertices['prototype'][_0xcdbf('0x42')]=function(_0x18367b,_0x1ffc73,_0x102376,_0x153884){this['rpc'][_0xcdbf('0x42')]({'uniqueid':this['channel'][_0xcdbf('0x3d')],'callerid':this[_0xcdbf('0xf')][_0xcdbf('0x41')],'calleridname':this['channel'][_0xcdbf('0x43')],'context':this['channel'][_0xcdbf('0x44')],'extension':this[_0xcdbf('0xf')][_0xcdbf('0x45')],'priority':this[_0xcdbf('0xf')][_0xcdbf('0x46')],'accountcode':this[_0xcdbf('0xf')][_0xcdbf('0x47')],'dnid':this[_0xcdbf('0xf')]['dnid'],'projectName':this[_0xcdbf('0xf')][_0xcdbf('0x40')],'saveName':_0x1ffc73,'filename':_0x18367b[_0xcdbf('0x48')]||_0x1ffc73,'savePath':_0x102376})[_0xcdbf('0x18')](function(_0x5a33b0){_0x153884(null,_0x5a33b0);})[_0xcdbf('0x15')](function(_0x296633){_0x153884(_0x296633);});};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0x49')]=function(_0x8468fa,_0x32be86,_0x4e6e91,_0x560df1,_0x9198f9){this[_0xcdbf('0x10')][_0xcdbf('0x49')]({'uniqueid':this['channel'][_0xcdbf('0x3d')],'body':_0x8468fa,'direction':_0x32be86,'providerName':_0x4e6e91,'providerResponse':_0x560df1})[_0xcdbf('0x18')](function(_0x1c0739){if(_0x9198f9){_0x9198f9(null,_0x1c0739);}})[_0xcdbf('0x15')](function(_0x2b5fdb){if(_0x9198f9){_0x9198f9(_0x2b5fdb);}});};AGIVertices['prototype'][_0xcdbf('0x4a')]=function(_0x267594,_0x48eb1b){this[_0xcdbf('0x10')][_0xcdbf('0x4a')]({'firstName':_[_0xcdbf('0x4b')](_0x267594[_0xcdbf('0x14')])||_[_0xcdbf('0x4c')](_0x267594[_0xcdbf('0x14')])?_0xcdbf('0x4d')+Math[_0xcdbf('0x4e')]():_0x267594[_0xcdbf('0x14')],'lastName':_['isEmpty'](_0x267594['lastName'])||_['isNil'](_0x267594[_0xcdbf('0x4f')])?null:_0x267594['lastName'],'phone':_0x267594[_0xcdbf('0x50')],'ListId':_0x267594['list_id'],'scheduledat':_0x267594[_0xcdbf('0x51')],'callbackUniqueid':this['channel']['uniqueid'],'tags':_0xcdbf('0x52'),'description':'Callback\x20scheduled\x20at\x20'+_0x267594[_0xcdbf('0x51')][_0xcdbf('0x53')](),'priority':_0x267594[_0xcdbf('0x54')]})['then'](function(_0x4a9bb7){_0x48eb1b(null,_0x4a9bb7);})[_0xcdbf('0x15')](function(_0x325575){_0x48eb1b(_0x325575);});};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0x55')]=function(_0x391086,_0x56593c){this[_0xcdbf('0x10')][_0xcdbf('0x56')](_0x391086)[_0xcdbf('0x18')](function(_0xe2ec5f){_0x56593c(null,_0xe2ec5f?_0xe2ec5f[_0xcdbf('0x14')]:![]);})[_0xcdbf('0x15')](function(_0x32cba1){_0x56593c(_0x32cba1);});};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0x57')]=function(_0xbda577,_0x1e370c,_0x5cf047){var _0xb7fcb9={'role':_0xcdbf('0x58')};_0xb7fcb9[_0xbda577]=this[_0xcdbf('0xf')]['callerid'];this[_0xcdbf('0x10')][_0xcdbf('0x57')](_0xb7fcb9,_0x1e370c,this['channel'][_0xcdbf('0x3d')])[_0xcdbf('0x18')](function(_0x25ee42){_0x5cf047(null,_[_0xcdbf('0x4c')](_0x25ee42)?![]:!![]);})[_0xcdbf('0x15')](function(_0xf01610){logger[_0xcdbf('0x31')](_0xf01610);_0x5cf047(null,![]);});};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0x59')]=function(_0x32c955,_0x1b6cdf){var _0x44e6f4={'role':_0xcdbf('0x58')};_0x44e6f4[_0x32c955]=this[_0xcdbf('0xf')][_0xcdbf('0x41')];this[_0xcdbf('0x10')][_0xcdbf('0x59')](_0x44e6f4)[_0xcdbf('0x18')](function(_0x41c4e8){_0x1b6cdf(null,_['isNil'](_0x41c4e8)?![]:!![]);})[_0xcdbf('0x15')](function(_0x3bdffb){logger[_0xcdbf('0x31')](_0x3bdffb);_0x1b6cdf(null,![]);});};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0x5a')]=function(_0x3f5008,_0x552f6e){var _0x24a779={'role':_0xcdbf('0x58')};_0x24a779[_0x3f5008]=this[_0xcdbf('0xf')][_0xcdbf('0x41')];this[_0xcdbf('0x10')][_0xcdbf('0x5a')](_0x24a779)[_0xcdbf('0x18')](function(_0x5e760f){_0x552f6e(null,_['isNil'](_0x5e760f)?![]:!![]);})['catch'](function(_0x477996){logger[_0xcdbf('0x31')](_0x477996);_0x552f6e(null,![]);});};AGIVertices['prototype'][_0xcdbf('0x5b')]=function(_0x272855,_0x3af934){var _0x4985a9={'role':_0xcdbf('0x58')};_0x4985a9[_0x272855]=this[_0xcdbf('0xf')][_0xcdbf('0x41')];var _0x6c9b10=_0x272855!='internal'?util[_0xcdbf('0x2d')](_0xcdbf('0x5c'),_0xcdbf('0x5d'),this[_0xcdbf('0xf')][_0xcdbf('0x41')]):undefined;this[_0xcdbf('0x10')][_0xcdbf('0x5b')](_0x4985a9,_0x6c9b10)[_0xcdbf('0x18')](function(_0x4871bf){_0x3af934(null,_[_0xcdbf('0x4c')](_0x4871bf)?![]:!![]);})[_0xcdbf('0x15')](function(_0x43d842){logger['error'](_0x43d842);_0x3af934(null,![]);});};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0x5e')]=function(_0x42d56c,_0x1b907d){sh[_0xcdbf('0x5f')](_[_0xcdbf('0x60')](_0x42d56c),function(_0xc2e5f9,_0x43529e){var _0x2f5b10=_0x43529e[_0xcdbf('0x61')](/(\r\n|\n|\r)/gm,'');_0x1b907d(null,_0x2f5b10);});};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0x62')]=function(_0x27acdc,_0x26d5c4){scripts[_0xcdbf('0x62')](_0x27acdc[_0xcdbf('0x63')],_0x27acdc[_0xcdbf('0x64')]||_0xcdbf('0x65'),_0x27acdc['text'],_0x27acdc['languageCode']||_0xcdbf('0x66'),_0x27acdc['ssmlGender']||'MALE',_0x27acdc['audioEncoding']||_0xcdbf('0x67'))['then'](function(_0x53a8dc){_0x26d5c4(null,_0x53a8dc);})[_0xcdbf('0x15')](function(_0x2a41bd){_0x26d5c4(_0x2a41bd);});};AGIVertices['prototype'][_0xcdbf('0x68')]=function(_0x17a911,_0x456653){scripts[_0xcdbf('0x68')](_0x17a911[_0xcdbf('0x65')],_0x17a911[_0xcdbf('0x69')]||'en',0x1)['then'](function(_0x29a03e){_0x456653(null,_0x29a03e);})[_0xcdbf('0x15')](function(_0xce5562){_0x456653(_0xce5562);});};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0x6a')]=function(_0x536a24,_0x476f86){var _0x1a2d4f={'uri':_0x536a24['url'],'method':_0x536a24[_0xcdbf('0x6b')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x536a24[_0xcdbf('0x6c')])==='number'&&parseInt(_0x536a24[_0xcdbf('0x6c')])>=0x1?parseInt(_0x536a24[_0xcdbf('0x6c')])*0x3e8:0x5*0x3e8};if(_[_0xcdbf('0x6d')]([_0xcdbf('0x6e'),_0xcdbf('0x6f')],_0x1a2d4f[_0xcdbf('0x6b')][_0xcdbf('0x70')]())){try{_0x1a2d4f[_0xcdbf('0x71')]=_0x536a24[_0xcdbf('0xb')]?JSON['parse'](_0x536a24['rawBody']):{};}catch(_0x492389){logger[_0xcdbf('0x31')](_0xcdbf('0x72'),_0x492389);}}try{_0x1a2d4f[_0xcdbf('0x73')]=_0x536a24['rawHeaders']?JSON['parse'](_0x536a24[_0xcdbf('0x74')]):{};}catch(_0x42fa14){logger['error'](_0xcdbf('0x75'),_0x42fa14);}if(_0x536a24['computedVariables']){try{var _0x1b88b4=require(_0x536a24[_0xcdbf('0x76')])[_0xcdbf('0x77')](this,_0x1a2d4f);_0x1a2d4f['uri']=Mustache[_0xcdbf('0x78')](_0x536a24[_0xcdbf('0x79')],_0x1b88b4,{},['$$','$$']);if(_0x1a2d4f['headers']){_0x1a2d4f[_0xcdbf('0x73')]=JSON[_0xcdbf('0x7a')](Mustache['render'](JSON[_0xcdbf('0x7b')](_0x1a2d4f[_0xcdbf('0x73')]),_0x1b88b4,{},['$$','$$']));}if(_0x1a2d4f[_0xcdbf('0x71')]){_0x1a2d4f['body']=JSON[_0xcdbf('0x7a')](Mustache['render'](JSON['stringify'](_0x1a2d4f[_0xcdbf('0x71')]),_0x1b88b4,{},['$$','$$']));}}catch(_0x9f5dd9){logger[_0xcdbf('0x31')](_0xcdbf('0x7c'),_0x9f5dd9);}}rp(_0x1a2d4f)['then'](function(_0x280ea2){var _0x507f88={'statusCode':_0x280ea2['statusCode']||0xc8,'statusMessage':_0x280ea2['statusMessage']||'OK','headers':_0x280ea2['headers']||{},'body':_0x280ea2[_0xcdbf('0x71')]||{}};_0x476f86(null,_0x507f88);})['catch'](function(_0x1a1b9f){var _0x15fde3={'statusCode':_0x1a1b9f[_0xcdbf('0x7d')]||0x1f4,'statusMessage':_0x1a1b9f[_0xcdbf('0x7e')]||_0xcdbf('0x7f'),'headers':_0x1a1b9f[_0xcdbf('0x80')][_0xcdbf('0x73')]||{},'body':_0x1a1b9f['options']['body']||{}};_0x476f86(null,_0x15fde3);});};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0x81')]=function(_0x4c0498,_0x7caaf6){scripts['googleDialogflow'](this[_0xcdbf('0xf')][_0xcdbf('0x3d')],_0x4c0498[_0xcdbf('0x82')],_0x4c0498[_0xcdbf('0x65')],_0x4c0498[_0xcdbf('0x83')]||'en')[_0xcdbf('0x18')](function(_0x44403c){_0x7caaf6(null,_0x44403c);})[_0xcdbf('0x15')](function(_0x676eac){_0x7caaf6(_0x676eac);});};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0x84')]=function(_0x370e55,_0x49df96){scripts[_0xcdbf('0x84')](this[_0xcdbf('0xf')][_0xcdbf('0x3d')],_0x370e55[_0xcdbf('0x85')],_0x370e55[_0xcdbf('0x86')],_0x370e55[_0xcdbf('0x87')],_0x370e55[_0xcdbf('0x65')],_0x370e55[_0xcdbf('0x88')]||'en')[_0xcdbf('0x18')](function(_0x1a8783){_0x49df96(null,_0x1a8783);})['catch'](function(_0x1e540a){_0x49df96(_0x1e540a);});};AGIVertices['prototype'][_0xcdbf('0x89')]=function(_0x2c6b88,_0xbd8f71){scripts[_0xcdbf('0x89')](this[_0xcdbf('0xf')],_0x2c6b88)[_0xcdbf('0x18')](function(_0x307a3d){_0xbd8f71(null,_0x307a3d);})[_0xcdbf('0x15')](function(_0x41e2d3){_0xbd8f71(_0x41e2d3);});};AGIVertices[_0xcdbf('0x16')]['ispeechTTS']=function(_0x41506f,_0x61cd24){scripts[_0xcdbf('0x8a')](_0x41506f[_0xcdbf('0x82')],_0x41506f[_0xcdbf('0x65')],_0x41506f[_0xcdbf('0x8b')]||_0xcdbf('0x66'),_0x41506f[_0xcdbf('0x8c')])['then'](function(_0x2cff51){_0x61cd24(null,_0x2cff51);})[_0xcdbf('0x15')](function(_0x2bc882){_0x61cd24(_0x2bc882);});};AGIVertices['prototype'][_0xcdbf('0x8d')]=function(_0x37fe15,_0x319715,_0x216733){scripts[_0xcdbf('0x8d')](_0x319715,_0x37fe15[_0xcdbf('0x82')],_0x37fe15[_0xcdbf('0x8e')]||_0xcdbf('0x66'),this[_0xcdbf('0x8f')](_0x37fe15[_0xcdbf('0x90')])?_0x37fe15[_0xcdbf('0x90')]:undefined)[_0xcdbf('0x18')](function(_0x4fe766){_0x216733(null,_0x4fe766);})[_0xcdbf('0x15')](function(_0x1d6de9){_0x216733(_0x1d6de9);});};AGIVertices['prototype'][_0xcdbf('0x91')]=function(_0x4cbb81,_0x403f18){scripts[_0xcdbf('0x91')](_0x4cbb81[_0xcdbf('0x92')],_0x4cbb81[_0xcdbf('0x93')],_0x4cbb81[_0xcdbf('0x94')],_0x4cbb81[_0xcdbf('0x95')]||_0xcdbf('0x96'),_0x4cbb81[_0xcdbf('0x65')],_0x4cbb81[_0xcdbf('0x97')]||_0xcdbf('0x65'))['then'](function(_0x25228a){_0x403f18(null,_0x25228a);})[_0xcdbf('0x15')](function(_0x34a5da){_0x403f18(_0x34a5da);});};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0x98')]=function(_0x9927d4,_0xc28e73){scripts[_0xcdbf('0x98')](this[_0xcdbf('0xf')][_0xcdbf('0x3d')],_0x9927d4[_0xcdbf('0x92')],_0x9927d4[_0xcdbf('0x93')],_0x9927d4[_0xcdbf('0x99')],_0x9927d4[_0xcdbf('0x65')],_0x9927d4['aws_bot_name'])['then'](function(_0xc2f3eb){_0xc28e73(null,_0xc2f3eb);})['catch'](function(_0x16b7b6){_0xc28e73(_0x16b7b6);});};AGIVertices['prototype']['googleASR']=function(_0x1ea59a,_0x5bb0fb,_0x1a745d){scripts[_0xcdbf('0x9a')](_0x5bb0fb,_0x1ea59a[_0xcdbf('0x82')],_0x1ea59a['google_asr_language']||_0xcdbf('0x66'))[_0xcdbf('0x18')](function(_0xaa14d4){_0x1a745d(null,_0xaa14d4);})[_0xcdbf('0x15')](function(_0x34283f){_0x1a745d(_0x34283f);});};AGIVertices['prototype'][_0xcdbf('0x9b')]=function(_0x1ed269,_0x18dac6,_0x2d9909){scripts[_0xcdbf('0x9b')](_0x18dac6,_0x1ed269[_0xcdbf('0x9c')],_0x1ed269[_0xcdbf('0x9d')],_0x1ed269[_0xcdbf('0x9e')])['then'](function(_0xb77a49){_0x2d9909(null,_0xb77a49);})[_0xcdbf('0x15')](function(_0x13aa8f){_0x2d9909(_0x13aa8f);});};AGIVertices['prototype'][_0xcdbf('0x9f')]=function(_0x351c30){var _0x52073d=_[_0xcdbf('0x6d')](verticesWithRetry,_0x351c30[_0xcdbf('0x3f')])?_0x351c30:_[_0xcdbf('0xa0')](_0x351c30);for(var _0x2b3159 in _0x52073d){if(_0x52073d[_0xcdbf('0xa1')](_0x2b3159)){if(_0x52073d[_0x2b3159]&&_[_0xcdbf('0xa2')](_0x52073d[_0x2b3159])){if(_[_0xcdbf('0x6d')](recursiveMapAttributes,_0x2b3159)){_0x52073d[_0x2b3159]=this[_0xcdbf('0xa3')](_0x52073d[_0x2b3159]);}else{_0x52073d[_0x2b3159]=this[_0xcdbf('0xa4')](_0x52073d[_0x2b3159]);}}}}return _0x52073d;};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0xa5')]=function(_0x4d20da){for(var _0x3ac4b5 in _0x4d20da){if(_0x4d20da[_0xcdbf('0xa1')](_0x3ac4b5)){if(_[_0xcdbf('0xa6')](_0x4d20da[_0x3ac4b5])){this[_0xcdbf('0xa5')](_0x4d20da[_0x3ac4b5]);}else if(_[_0xcdbf('0xa7')](_0x4d20da[_0x3ac4b5])){for(var _0x219df9=0x0;_0x219df9<_0x4d20da[_0x3ac4b5][_0xcdbf('0xa8')];_0x219df9++){this['recursiveNodeIndex'](_0x4d20da[_0x3ac4b5][_0x219df9]);}}else if(_[_0xcdbf('0xa2')](_0x4d20da[_0x3ac4b5])){_0x4d20da[_0x3ac4b5]=this[_0xcdbf('0xa4')](_0x4d20da[_0x3ac4b5]);}}}};AGIVertices[_0xcdbf('0x16')]['saveRestApiResult']=function(_0x1c0259,_0x177dca){for(var _0x48093f in _0x1c0259){if(_0x1c0259[_0xcdbf('0xa1')](_0x48093f)){if(_[_0xcdbf('0xa6')](_0x1c0259[_0x48093f])){if(!_[_0xcdbf('0x4b')](_0x1c0259[_0x48093f])){this[_0xcdbf('0xa9')](_0x1c0259[_0x48093f],util[_0xcdbf('0x2d')](_0xcdbf('0xaa'),_0x177dca,_0x48093f));}}else if(_[_0xcdbf('0xa7')](_0x1c0259[_0x48093f])){for(var _0x11c69a=0x0;_0x11c69a<_0x1c0259[_0x48093f][_0xcdbf('0xa8')];_0x11c69a++){this[_0xcdbf('0xa9')](_0x1c0259[_0x48093f][_0x11c69a],util[_0xcdbf('0x2d')](_0xcdbf('0xaa'),_0x177dca,_0x48093f+'['+_0x11c69a+']'));}}else{if(!_['isNil'](_0x1c0259[_0x48093f])){this[_0xcdbf('0xf')]['setVariable'](util[_0xcdbf('0x2d')](_0xcdbf('0xaa'),_0x177dca,_0x48093f),_0x1c0259[_0x48093f]);}}}}};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0xa3')]=function(_0x248541){try{var _0x5c783f=JSON['parse'](_0x248541);this[_0xcdbf('0xa5')](_0x5c783f);return JSON['stringify'](_0x5c783f);}catch(_0x76efca){return this[_0xcdbf('0xa4')](_0x248541);}};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0xa4')]=function(_0x582f6){var _0x4bdc48=_0x582f6[_0xcdbf('0xab')]('{');for(var _0x6a0c83=0x1;_0x6a0c83<_0x4bdc48[_0xcdbf('0xa8')];_0x6a0c83+=0x1){var _0x4fddf0=_0x4bdc48[_0x6a0c83][_0xcdbf('0xab')]('}');if(_0x4fddf0['length']>0x1){_0x582f6=_0x582f6[_0xcdbf('0xac')]('{'+_0x4fddf0[0x0]+'}',this[_0xcdbf('0xf')][_0xcdbf('0x12')](_0x4fddf0[0x0])[_0xcdbf('0xad')]||_0x4fddf0[0x0]);}}if(_0x4bdc48[_0xcdbf('0xa8')]===0x1){return _0x582f6['toString']();}return this[_0xcdbf('0xa4')](_0x582f6);};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0xae')]=function(_0x174edb,_0x4f93e4){var _0x48562c=this['channel'][_0xcdbf('0x12')](_0x174edb);if(_0x48562c[_0xcdbf('0xaf')]===-0x1){return _0x48562c;}logger[_0xcdbf('0x33')](util[_0xcdbf('0x2d')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x4f93e4,_0x48562c[_0xcdbf('0xad')]));return this[_0xcdbf('0xf')][_0xcdbf('0xb0')](_0x4f93e4,_0x48562c[_0xcdbf('0xad')]);};AGIVertices['prototype']['isConfigured']=function(_0x636ea0){return _0x636ea0&&_0x636ea0!=='0'&&_0x636ea0!=='-1'&&_0x636ea0!=='';};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0xb1')]=function(_0x27ff40){this[_0xcdbf('0x3c')]['sync'](this,_0x27ff40,'-');_0x27ff40[_0xcdbf('0xb2')]=_0x27ff40[_0xcdbf('0xb1')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xcdbf('0x16')]['mrcpsynth']=function(_0x55fffa){logger[_0xcdbf('0x33')](util[_0xcdbf('0x2d')](_0xcdbf('0xb3'),_0x55fffa['label']));if(!this['isConfigured'](_0x55fffa[_0xcdbf('0x65')])){return this[_0xcdbf('0xf')]['noop'](_0xcdbf('0xb4'));}var _0x20bdd5='\x22'+_0x55fffa[_0xcdbf('0x65')]+'\x22';if(this[_0xcdbf('0x8f')](_0x55fffa[_0xcdbf('0x80')])){_0x20bdd5+=','+_0x55fffa['options'];}var _0x39a98a=this[_0xcdbf('0xf')][_0xcdbf('0x5f')](_0xcdbf('0xb5'),_0x20bdd5);if(_0x39a98a[_0xcdbf('0xaf')]===-0x1){return _0x39a98a;}return this[_0xcdbf('0xf')][_0xcdbf('0xb6')](util[_0xcdbf('0x2d')]('Executed\x20command\x20MRCPSynth\x20%s',_0x20bdd5));};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0xb7')]=function(_0xc395b9){logger[_0xcdbf('0x33')](util['format'](_0xcdbf('0xb8'),_0xc395b9[_0xcdbf('0x3e')]));if(!this[_0xcdbf('0x8f')](_0xc395b9['grammar'])){return this[_0xcdbf('0xf')][_0xcdbf('0xb6')](_0xcdbf('0xb9'));}var _0x3649ad=_0xc395b9['grammar'];if(this['isConfigured'](_0xc395b9[_0xcdbf('0x80')])){_0x3649ad+=','+_0xc395b9[_0xcdbf('0x80')];}var _0x55f987=this[_0xcdbf('0xf')]['exec']('MRCPRecog',_0x3649ad);if(_0x55f987['result']===-0x1){return _0x55f987;}var _0x2ca00e=this[_0xcdbf('0xae')](_0xcdbf('0xba'),_0xcdbf('0xbb'));if(_0x2ca00e[_0xcdbf('0xaf')]===-0x1){return _0x2ca00e;}var _0x32e91a=this[_0xcdbf('0xae')](_0xcdbf('0xbc'),_0xcdbf('0xbd'));if(_0x32e91a[_0xcdbf('0xaf')]===-0x1){return _0x32e91a;}var _0x48dd90=this['getAndSetVariable'](_0xcdbf('0xbe'),_0xcdbf('0xbf'));if(_0x48dd90[_0xcdbf('0xaf')]===-0x1){return _0x48dd90;}return this[_0xcdbf('0xf')]['noop'](util[_0xcdbf('0x2d')](_0xcdbf('0xc0'),_0x3649ad));};AGIVertices['prototype'][_0xcdbf('0x7')]=function(_0x4d65f9){logger[_0xcdbf('0x33')](util[_0xcdbf('0x2d')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x4d65f9[_0xcdbf('0x3e')]));return this['channel'][_0xcdbf('0x7')]([_0x4d65f9[_0xcdbf('0xc1')],_0x4d65f9[_0xcdbf('0xc2')]]);};AGIVertices['prototype'][_0xcdbf('0xc3')]=function(_0x1ff874){logger[_0xcdbf('0x33')](util['format'](_0xcdbf('0xc4'),_0x1ff874[_0xcdbf('0x3e')]));if(this[_0xcdbf('0x8f')](_0x1ff874[_0xcdbf('0x6c')])){logger['info'](util[_0xcdbf('0x2d')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x1ff874[_0xcdbf('0x6c')]));var _0x3e3743=this[_0xcdbf('0xf')]['wait'](_0x1ff874[_0xcdbf('0x6c')]);if(_0x3e3743['result']===-0x1){return _0x3e3743;}}return this[_0xcdbf('0xf')][_0xcdbf('0xc3')]();};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0x52')]=function(_0x534654){logger[_0xcdbf('0x33')](util['format'](_0xcdbf('0xc5'),_0x534654[_0xcdbf('0x3e')]));if(!this[_0xcdbf('0x8f')](_0x534654[_0xcdbf('0xc6')])){return this['channel'][_0xcdbf('0x31')](_0x534654,_0xcdbf('0xc7'));}_0x534654[_0xcdbf('0x51')]=moment();if(this[_0xcdbf('0x8f')](_0x534654[_0xcdbf('0xc8')])){_0x534654[_0xcdbf('0x51')]=moment()[_0xcdbf('0xc9')](_0x534654[_0xcdbf('0xc8')],_0xcdbf('0xca'));}if(!this[_0xcdbf('0x8f')](_0x534654['callback_priority'])){_0x534654[_0xcdbf('0x54')]=0x2;}this['createCmContact'][_0xcdbf('0x77')](this,_0x534654);return this[_0xcdbf('0xf')][_0xcdbf('0xb6')](util[_0xcdbf('0x2d')](_0xcdbf('0xcb'),_0x534654['phone'],_0x534654[_0xcdbf('0xc6')],_0x534654[_0xcdbf('0x51')]));};AGIVertices['prototype']['custom_app']=function(_0x44deb8){logger[_0xcdbf('0x33')](util[_0xcdbf('0x2d')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x44deb8[_0xcdbf('0x3e')]));var _0x24fcb8=this[_0xcdbf('0xf')]['exec'](_0x44deb8[_0xcdbf('0xcc')],_0x44deb8[_0xcdbf('0x80')]);if(_0x24fcb8['result']===-0x1){return _0x24fcb8;}return this[_0xcdbf('0xf')]['noop'](util[_0xcdbf('0x2d')]('Executed\x20command\x20%s\x20%s',_0x44deb8[_0xcdbf('0xcc')],_0x44deb8[_0xcdbf('0x80')]));};AGIVertices['prototype'][_0xcdbf('0xcd')]=function(_0x5cf117){logger[_0xcdbf('0x33')](util[_0xcdbf('0x2d')](_0xcdbf('0xce'),_0x5cf117[_0xcdbf('0x3e')]));if(!this['isConfigured'](_0x5cf117['text'])){return this['channel'][_0xcdbf('0xb6')](_0xcdbf('0xb4'));}var _0x35b688='\x22'+_0x5cf117[_0xcdbf('0x65')]+'\x22';if(this[_0xcdbf('0x8f')](_0x5cf117[_0xcdbf('0x80')])){_0x35b688+=','+_0x5cf117['options'];}var _0x3b9b71=this[_0xcdbf('0xf')][_0xcdbf('0x5f')](_0xcdbf('0xb5'),_0x35b688);if(_0x3b9b71['result']===-0x1){return _0x3b9b71;}return this['channel'][_0xcdbf('0xb6')](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x35b688));};AGIVertices['prototype'][_0xcdbf('0xcf')]=function(_0x42b57c){logger[_0xcdbf('0x33')](util[_0xcdbf('0x2d')](_0xcdbf('0xd0'),_0x42b57c[_0xcdbf('0x3e')]));if(!this['isConfigured'](_0x42b57c[_0xcdbf('0x65')])){return this[_0xcdbf('0xf')][_0xcdbf('0xb6')](_0xcdbf('0xb4'));}var _0x53f0b9='\x22'+_0x42b57c['text']+'\x22';if(this['isConfigured'](_0x42b57c[_0xcdbf('0x80')])){_0x53f0b9+=','+_0x42b57c['options'];}var _0x47d40c=this[_0xcdbf('0xf')][_0xcdbf('0x5f')](_0xcdbf('0xb5'),_0x53f0b9);if(_0x47d40c[_0xcdbf('0xaf')]===-0x1){return _0x47d40c;}return this[_0xcdbf('0xf')][_0xcdbf('0xb6')](util[_0xcdbf('0x2d')](_0xcdbf('0xd1'),_0x53f0b9));};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0xd2')]=function(_0x2d7d9e){logger[_0xcdbf('0x33')](util['format'](_0xcdbf('0xd3'),_0x2d7d9e[_0xcdbf('0x3e')]));if(!this[_0xcdbf('0x8f')](_0x2d7d9e['grammar'])){return this[_0xcdbf('0xf')][_0xcdbf('0xb6')](_0xcdbf('0xb9'));}var _0x58db30=_0x2d7d9e[_0xcdbf('0xd4')];if(this[_0xcdbf('0x8f')](_0x2d7d9e[_0xcdbf('0x80')])){_0x58db30+=','+_0x2d7d9e[_0xcdbf('0x80')];}var _0x37e9cf=this[_0xcdbf('0xf')][_0xcdbf('0x5f')](_0xcdbf('0xd5'),_0x58db30);if(_0x37e9cf[_0xcdbf('0xaf')]===-0x1){return _0x37e9cf;}var _0x431eb=this[_0xcdbf('0xae')](_0xcdbf('0xba'),_0xcdbf('0xd6'));if(_0x431eb[_0xcdbf('0xaf')]===-0x1){return _0x431eb;}var _0x7513d6=this['getAndSetVariable'](_0xcdbf('0xbc'),_0xcdbf('0xd7'));if(_0x7513d6['result']===-0x1){return _0x7513d6;}var _0x412241=this['getAndSetVariable'](_0xcdbf('0xbe'),_0xcdbf('0xd8'));if(_0x412241[_0xcdbf('0xaf')]===-0x1){return _0x412241;}return this[_0xcdbf('0xf')]['noop'](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0x58db30));};AGIVertices['prototype'][_0xcdbf('0xd9')]=function(_0x5e606c){logger[_0xcdbf('0x33')](util[_0xcdbf('0x2d')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x5e606c[_0xcdbf('0x3e')]));if(!this['isConfigured'](_0x5e606c[_0xcdbf('0xd4')])){return this['channel'][_0xcdbf('0xb6')](_0xcdbf('0xb9'));}var _0x5e15bb=_0x5e606c[_0xcdbf('0xd4')];if(this[_0xcdbf('0x8f')](_0x5e606c[_0xcdbf('0x80')])){_0x5e15bb+=','+_0x5e606c['options'];}var _0x5ad908=this['channel'][_0xcdbf('0x5f')](_0xcdbf('0xd5'),_0x5e15bb);if(_0x5ad908['result']===-0x1){return _0x5ad908;}var _0x3936a7=this[_0xcdbf('0xae')](_0xcdbf('0xba'),_0xcdbf('0xda'));if(_0x3936a7['result']===-0x1){return _0x3936a7;}var _0x54417c=this[_0xcdbf('0xae')](_0xcdbf('0xbc'),_0xcdbf('0xdb'));if(_0x54417c[_0xcdbf('0xaf')]===-0x1){return _0x54417c;}var _0x5a3c15=this[_0xcdbf('0xae')]('RECOG_INSTANCE()','SESTEK_ASR_INSTANCE');if(_0x5a3c15[_0xcdbf('0xaf')]===-0x1){return _0x5a3c15;}return this['channel']['noop'](util['format'](_0xcdbf('0xc0'),_0x5e15bb));};AGIVertices[_0xcdbf('0x16')]['database']=function(_0x4c0b59){logger[_0xcdbf('0x33')](util[_0xcdbf('0x2d')](_0xcdbf('0xdc'),_0x4c0b59[_0xcdbf('0x3e')]));if(!this[_0xcdbf('0x8f')](_0x4c0b59[_0xcdbf('0xdd')])){return this[_0xcdbf('0xf')][_0xcdbf('0x31')](_0x4c0b59,_0xcdbf('0xde'));}var _0x18562b=this[_0xcdbf('0x1b')][_0xcdbf('0x77')](this,_0x4c0b59[_0xcdbf('0xdd')]);if(!_0x18562b){return this[_0xcdbf('0xf')][_0xcdbf('0x31')](_0x4c0b59,_0xcdbf('0xdf'));}if(!this['isConfigured'](_0x4c0b59[_0xcdbf('0x35')])){return this['channel'][_0xcdbf('0x31')](_0x4c0b59,_0xcdbf('0xe0'));}var _0x2f03bb=_0x4c0b59['query'][_0xcdbf('0x61')](/(\r\n|\n|\r)/gm,'\x20');this[_0xcdbf('0xf')][_0xcdbf('0xb6')](util['format'](_0xcdbf('0xe1'),_0x2f03bb));var _0x24c8a1=this['getQueryOdbc'][_0xcdbf('0x77')](this,_0x18562b,_0x2f03bb);this[_0xcdbf('0x3c')][_0xcdbf('0x77')](this,_0x4c0b59,_0x2f03bb);if(!this['isConfigured'](_0x4c0b59['variable_id'])){return this['channel'][_0xcdbf('0xb6')](_0xcdbf('0xe2'));}var _0x3bb83b=this[_0xcdbf('0x12')][_0xcdbf('0x77')](this,_0x4c0b59[_0xcdbf('0xe3')]);if(!_0x3bb83b){return this[_0xcdbf('0xf')][_0xcdbf('0x31')](_0x4c0b59,_0xcdbf('0xe4'));}var _0x405596=this;_0x24c8a1['forEach'](function(_0x47b93b,_0x343080){Object[_0xcdbf('0xe5')](_0x47b93b)['forEach'](function(_0x16328e){_0x405596[_0xcdbf('0xf')][_0xcdbf('0xb0')](util['format'](_0xcdbf('0xe6'),_0x3bb83b,_0x343080,_0x16328e),_0x47b93b[_0x16328e]);});});this[_0xcdbf('0xf')][_0xcdbf('0xb0')](util[_0xcdbf('0x2d')](_0xcdbf('0xe7'),_0x3bb83b),_0x24c8a1[_0xcdbf('0xa8')]);return this[_0xcdbf('0xf')][_0xcdbf('0xb6')](util[_0xcdbf('0x2d')]('variable\x20%s\x20set',_0x3bb83b));};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0xe8')]=function(_0xb4bc52){logger['debug'](util[_0xcdbf('0x2d')](_0xcdbf('0xe9'),_0xb4bc52['label']));if(!this[_0xcdbf('0x8f')](_0xb4bc52['sip_id'])){return this[_0xcdbf('0xf')][_0xcdbf('0x31')](_0xb4bc52,_0xcdbf('0xea'));}var _0x3501c1=this[_0xcdbf('0x1e')][_0xcdbf('0x77')](this,_0xb4bc52[_0xcdbf('0xeb')]);if(!_0x3501c1){return this[_0xcdbf('0xf')][_0xcdbf('0x31')](_0xb4bc52,'no\x20user\x20found');}var _0x36b68e=this[_0xcdbf('0xf')][_0xcdbf('0x5f')](_0xcdbf('0xec'),[util[_0xcdbf('0x2d')]('SIP/%s',_0x3501c1),_0xb4bc52['timeout'],_0xb4bc52['opts'],_0xb4bc52[_0xcdbf('0x79')]]);if(_0x36b68e['result']===-0x1){return _0x36b68e;}return this[_0xcdbf('0xf')]['noop'](util['format']('Executed\x20command\x20%s','DIAL'));};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0xed')]=function(_0x15d268){logger[_0xcdbf('0x33')](util[_0xcdbf('0x2d')](_0xcdbf('0xee'),_0x15d268['label']));if(!this[_0xcdbf('0x8f')](_0x15d268[_0xcdbf('0x82')])){return this[_0xcdbf('0xf')][_0xcdbf('0xb6')](_0xcdbf('0xef'));}if(!this[_0xcdbf('0x8f')](_0x15d268['text'])){return this['channel'][_0xcdbf('0xb6')]('no\x20text\x20configured');}this[_0xcdbf('0xf')]['bot']=!![];this[_0xcdbf('0x3c')](_0x15d268);this['createSquareMessage'](_0x15d268['text'],'in','','');this[_0xcdbf('0xf')][_0xcdbf('0xb6')](util[_0xcdbf('0x2d')](_0xcdbf('0xf0'),_0x15d268[_0xcdbf('0x65')]));var _0x1b2bc1=this[_0xcdbf('0x81')]['sync'](this,_0x15d268);if(_0x1b2bc1){for(var _0x3409e7 in _0x1b2bc1){if(_0x1b2bc1[_0xcdbf('0xa1')](_0x3409e7)){this[_0xcdbf('0xf')][_0xcdbf('0xb0')](util['format']('DIALOGFLOW_%s',_0x3409e7[_0xcdbf('0x70')]()),_0x1b2bc1[_0x3409e7]);}}this[_0xcdbf('0x49')](_0x1b2bc1[_0xcdbf('0xf1')],_0xcdbf('0xf2'),'dialogflow','');return this[_0xcdbf('0xf')][_0xcdbf('0xb6')](util['format'](_0xcdbf('0xf3'),_0x1b2bc1['speech']));}return this['channel']['error'](_0x15d268,'Dialogflow\x20is\x20unreachable');};AGIVertices['prototype']['dialogflowV2']=function(_0x21b7a2){logger[_0xcdbf('0x33')](util[_0xcdbf('0x2d')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x21b7a2[_0xcdbf('0x3e')]));if(!this[_0xcdbf('0x8f')](_0x21b7a2['dialogflowV2_project_id'])){return this[_0xcdbf('0xf')][_0xcdbf('0xb6')]('no\x20project_id\x20configured');}if(!this[_0xcdbf('0x8f')](_0x21b7a2[_0xcdbf('0x86')])){return this[_0xcdbf('0xf')]['noop'](_0xcdbf('0xf4'));}if(!this[_0xcdbf('0x8f')](_0x21b7a2[_0xcdbf('0x87')])){return this[_0xcdbf('0xf')][_0xcdbf('0xb6')](_0xcdbf('0xf5'));}if(!this[_0xcdbf('0x8f')](_0x21b7a2[_0xcdbf('0x88')])){return this[_0xcdbf('0xf')][_0xcdbf('0xb6')](_0xcdbf('0xf6'));}if(!this[_0xcdbf('0x8f')](_0x21b7a2[_0xcdbf('0x65')])){return this[_0xcdbf('0xf')][_0xcdbf('0xb6')]('no\x20text\x20configured');}this['channel'][_0xcdbf('0xf7')]=!![];this[_0xcdbf('0x3c')](_0x21b7a2);this[_0xcdbf('0x49')](_0x21b7a2[_0xcdbf('0x65')],'in','','');this[_0xcdbf('0xf')][_0xcdbf('0xb6')](util['format'](_0xcdbf('0xf8'),_0x21b7a2[_0xcdbf('0x65')]));var _0x10a720=this['googleDialogflowV2']['sync'](this,_0x21b7a2);if(_0x10a720){for(var _0x558370 in _0x10a720){if(_0x10a720[_0xcdbf('0xa1')](_0x558370)){if(_0x558370!==_0xcdbf('0xf9')){this[_0xcdbf('0xf')]['setVariable'](util[_0xcdbf('0x2d')](_0xcdbf('0xfa'),_0x558370['toUpperCase']()),_0x10a720[_0x558370]);}}}this[_0xcdbf('0x49')](_0x10a720[_0xcdbf('0xf1')],_0xcdbf('0xf2'),_0xcdbf('0xfb'),_0x10a720[_0xcdbf('0xf9')]);return this[_0xcdbf('0xf')][_0xcdbf('0xb6')](util[_0xcdbf('0x2d')](_0xcdbf('0xfc'),_0x10a720[_0xcdbf('0xf1')]));}return this[_0xcdbf('0xf')][_0xcdbf('0x31')](_0x21b7a2,_0xcdbf('0xfd'));};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0xfe')]=function(_0xcf88dc){logger[_0xcdbf('0x33')](util[_0xcdbf('0x2d')](_0xcdbf('0xff'),_0xcf88dc[_0xcdbf('0x3e')]));if(!this['isConfigured'](_0xcf88dc['ndauth_url'])){return this[_0xcdbf('0xf')][_0xcdbf('0xb6')](_0xcdbf('0x100'));}if(!this['isConfigured'](_0xcf88dc[_0xcdbf('0x101')])){return this[_0xcdbf('0xf')][_0xcdbf('0xb6')](_0xcdbf('0x102'));}if(!this['isConfigured'](_0xcf88dc['password'])){return this[_0xcdbf('0xf')][_0xcdbf('0xb6')]('no\x20password\x20configured');}if(!this[_0xcdbf('0x8f')](_0xcf88dc[_0xcdbf('0x103')])){return this[_0xcdbf('0xf')][_0xcdbf('0xb6')](_0xcdbf('0xb4'));}this[_0xcdbf('0xf')][_0xcdbf('0xf7')]=!![];this[_0xcdbf('0x3c')](_0xcf88dc);this[_0xcdbf('0x49')](_0xcf88dc[_0xcdbf('0x65')],'in','','');this[_0xcdbf('0xf')][_0xcdbf('0xb6')](util[_0xcdbf('0x2d')]('Trying\x20SestekNDA:\x20%s',_0xcf88dc['text']));var _0x5c0432=this[_0xcdbf('0x89')][_0xcdbf('0x77')](this,_0xcf88dc);if(_0x5c0432){for(var _0x52c5af in _0x5c0432){if(_0x5c0432[_0xcdbf('0xa1')](_0x52c5af)){this['channel'][_0xcdbf('0xb0')](util[_0xcdbf('0x2d')](_0xcdbf('0x104'),_0x52c5af['toUpperCase']()),_0x5c0432[_0x52c5af]);}}this['createSquareMessage'](_0x5c0432[_0xcdbf('0xf1')],_0xcdbf('0xf2'),_0xcdbf('0xfe'),'');if(_0x5c0432['audiofile']){this[_0xcdbf('0xf')][_0xcdbf('0xb6')](util['format'](_0xcdbf('0x105'),_0x5c0432[_0xcdbf('0x106')]));var _0x22ddb1=this[_0xcdbf('0xf')][_0xcdbf('0x107')](_0x5c0432[_0xcdbf('0x106')]);try{fs[_0xcdbf('0x108')](_0x5c0432[_0xcdbf('0x106')]+_0xcdbf('0x109'));}catch(_0xddc602){logger[_0xcdbf('0x31')](_0xddc602);}return _0x22ddb1;}else{return this[_0xcdbf('0xf')][_0xcdbf('0xb6')](util[_0xcdbf('0x2d')](_0xcdbf('0x10a'),_0x5c0432[_0xcdbf('0xf1')]));}}return this[_0xcdbf('0xf')]['error'](_0xcf88dc,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0xcdbf('0x16')]['end']=function(_0x4d9d67){logger['info'](util[_0xcdbf('0x2d')]('Enter\x20in\x20END\x20(%s)\x20block',_0x4d9d67[_0xcdbf('0x3e')]));return this[_0xcdbf('0xf')]['noop'](_0xcdbf('0x10b'));};AGIVertices['prototype']['ext_dial']=function(_0x384b02){logger[_0xcdbf('0x33')](util[_0xcdbf('0x2d')](_0xcdbf('0x10c'),_0x384b02[_0xcdbf('0x3e')]));var _0x1e4c4d='';if(_0x384b02[_0xcdbf('0x10d')]){if(!this[_0xcdbf('0x8f')](_0x384b02[_0xcdbf('0x10d')])){return this[_0xcdbf('0xf')]['error'](_0x384b02,_0xcdbf('0x10e'));}else{var _0x4ebc49=parseInt(_0x384b02['trunk_id'],0xa);if(isNaN(_0x4ebc49)){_0x1e4c4d=_0x384b02['trunk_id'];}else{_0x1e4c4d=this[_0xcdbf('0x20')][_0xcdbf('0x77')](this,_0x384b02[_0xcdbf('0x10d')]);if(!_0x1e4c4d){return this[_0xcdbf('0xf')]['error'](_0x384b02,_0xcdbf('0x10f'));}}}}else if(_0x384b02[_0xcdbf('0x110')]){_0x1e4c4d=_0x384b02[_0xcdbf('0x110')];}else{return this[_0xcdbf('0xf')][_0xcdbf('0x31')](_0x384b02,'no\x20trunk\x20selected');}var _0x5f346a=this['channel'][_0xcdbf('0x5f')](_0xcdbf('0xec'),[util[_0xcdbf('0x2d')](_0xcdbf('0x111'),_0x1e4c4d,_0x384b02[_0xcdbf('0x50')]),_0x384b02[_0xcdbf('0x6c')],_0x384b02[_0xcdbf('0x112')],_0x384b02[_0xcdbf('0x79')]]);if(_0x5f346a[_0xcdbf('0xaf')]===-0x1){return _0x5f346a;}return this[_0xcdbf('0xf')][_0xcdbf('0xb6')](util[_0xcdbf('0x2d')](_0xcdbf('0x113'),'DIAL'));};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0x114')]=function(_0xad782){logger['info'](util['format']('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0xad782[_0xcdbf('0x3e')]));return this[_0xcdbf('0xf')][_0xcdbf('0xb6')](_0xcdbf('0x114'));};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0xd')]=function(_0x29dcef){logger['info'](util[_0xcdbf('0x2d')](_0xcdbf('0x115'),_0x29dcef[_0xcdbf('0x3e')]));if(_0x29dcef['retry']===0x0){return this['maxRetry'](_0x29dcef);}_0x29dcef[_0xcdbf('0xb2')]-=0x1;if(!this['isConfigured'](_0x29dcef['file_id'])){return this[_0xcdbf('0xf')]['error'](_0x29dcef,'no\x20file\x20audio\x20selected');}var _0x2abbd4=this[_0xcdbf('0x116')][_0xcdbf('0x77')](this,_0x29dcef['file_id']);if(!_0x2abbd4){return this[_0xcdbf('0xf')]['error'](_0x29dcef,_0xcdbf('0x117'));}if(!this[_0xcdbf('0x8f')](_0x29dcef[_0xcdbf('0xe3')])){return this[_0xcdbf('0xf')][_0xcdbf('0x31')](_0xcdbf('0xe2'));}var _0x29fdb2=this['channel'][_0xcdbf('0x118')](_0x2abbd4,_0x29dcef['response'],_0x29dcef['maxdigit']);var _0x4ecc0d=_0x29fdb2[_0xcdbf('0xaf')]?_0x29fdb2['result'][_0xcdbf('0x53')]():'';logger[_0xcdbf('0x33')](_0xcdbf('0x119'),JSON['stringify'](_0x29fdb2));if(_0x29fdb2[_0xcdbf('0xaf')]===-0x1){this[_0xcdbf('0x3c')]['sync'](this,_0x29dcef,_0x4ecc0d);return _0x29fdb2;}else if(_0x29fdb2[_0xcdbf('0xad')]===_0xcdbf('0x6c')){_0x29fdb2[_0xcdbf('0xaf')]=_0x4ecc0d[_0xcdbf('0xa8')]>=parseInt(_0x29dcef[_0xcdbf('0x11a')])?'x':'i';}else{_0x29fdb2[_0xcdbf('0xaf')]=_0x4ecc0d[_0xcdbf('0xa8')]>=parseInt(_0x29dcef[_0xcdbf('0x11a')])&&_0x4ecc0d[_0xcdbf('0xa8')]<=parseInt(_0x29dcef[_0xcdbf('0x11b')])?'x':'i';}var _0x111aa4=this[_0xcdbf('0x12')][_0xcdbf('0x77')](this,_0x29dcef['variable_id']);if(!_0x111aa4){return this[_0xcdbf('0xf')][_0xcdbf('0x31')](_0x29dcef,'no\x20variable\x20found');}this['channel'][_0xcdbf('0xb0')](_0x111aa4,_0x4ecc0d);if(this[_0xcdbf('0x8f')](_0x29dcef['hiddendigitsnum'])){var _0x12179c=parseInt(_0x29dcef[_0xcdbf('0x11c')],0xa);var _0x20bf12=rs[_0xcdbf('0x11d')]({'charset':'*','length':_0x12179c});var _0x3ff95b=_0x4ecc0d[_0xcdbf('0xa8')];if(_0x3ff95b>0x0){if(_0x3ff95b>_0x12179c){this['createSquareDetailsReport'][_0xcdbf('0x77')](this,_0x29dcef,_0x29dcef[_0xcdbf('0x11e')]===_0xcdbf('0x11f')?_0x20bf12+_0x4ecc0d[_0xcdbf('0x120')](_0x12179c):_0x4ecc0d[_0xcdbf('0x120')](0x0,_0x3ff95b-_0x12179c)+_0x20bf12);}else{this[_0xcdbf('0x3c')][_0xcdbf('0x77')](this,_0x29dcef,rs[_0xcdbf('0x11d')]({'charset':'*','length':_0x3ff95b}));}}else{this[_0xcdbf('0x3c')][_0xcdbf('0x77')](this,_0x29dcef,'');}}else{this[_0xcdbf('0x3c')][_0xcdbf('0x77')](this,_0x29dcef,_0x4ecc0d);}return _0x29fdb2;};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0xe')]=function(_0x520722){logger[_0xcdbf('0x33')](util['format'](_0xcdbf('0x121'),_0x520722[_0xcdbf('0x3e')]));return this[_0xcdbf('0xd')](_0x520722);};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0x122')]=function(_0x40c988){logger['info'](util[_0xcdbf('0x2d')](_0xcdbf('0x123'),_0x40c988[_0xcdbf('0x3e')]));this[_0xcdbf('0x3c')][_0xcdbf('0x77')](this,_0x40c988,_0x40c988[_0xcdbf('0x124')]);return this[_0xcdbf('0xf')]['noop'](util['format'](_0xcdbf('0x125'),_0x40c988[_0xcdbf('0x124')]));};AGIVertices['prototype'][_0xcdbf('0x126')]=function(_0x1c441e){logger[_0xcdbf('0x33')](util[_0xcdbf('0x2d')](_0xcdbf('0x127'),_0x1c441e[_0xcdbf('0x3e')]));if(!this[_0xcdbf('0x8f')](_0x1c441e[_0xcdbf('0x92')])||!this[_0xcdbf('0x8f')](_0x1c441e[_0xcdbf('0x93')])){return this[_0xcdbf('0xf')][_0xcdbf('0xb6')](_0xcdbf('0x128'));}if(!this['isConfigured'](_0x1c441e[_0xcdbf('0x65')])){return this[_0xcdbf('0xf')][_0xcdbf('0xb6')](_0xcdbf('0xb4'));}this[_0xcdbf('0xf')][_0xcdbf('0xb6')](util[_0xcdbf('0x2d')]('Trying\x20aws\x20Polly\x20%s',_0x1c441e[_0xcdbf('0x65')]));var _0x3f1544=this[_0xcdbf('0x91')]['sync'](this,_0x1c441e);if(_0x3f1544){this[_0xcdbf('0xf')][_0xcdbf('0xb6')](util[_0xcdbf('0x2d')](_0xcdbf('0x129'),_0x3f1544));var _0x5a9293=this['channel']['streamFile'](_0x3f1544);try{fs['unlink'](_0x3f1544+_0xcdbf('0x109'));}catch(_0xada118){logger[_0xcdbf('0x31')](_0xada118);}return _0x5a9293;}return this['channel']['error'](_0x1c441e,_0xcdbf('0x12a'));};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0x12b')]=function(_0x5e997d){logger[_0xcdbf('0x33')](util[_0xcdbf('0x2d')](_0xcdbf('0x12c'),_0x5e997d[_0xcdbf('0x3e')]));if(!this[_0xcdbf('0x8f')](_0x5e997d['aws_access_key_id'])||!this[_0xcdbf('0x8f')](_0x5e997d[_0xcdbf('0x93')])){return this['channel'][_0xcdbf('0xb6')](_0xcdbf('0x128'));}if(!this[_0xcdbf('0x8f')](_0x5e997d[_0xcdbf('0x12d')])){return this['channel'][_0xcdbf('0xb6')]('no\x20bot\x20name\x20configured');}if(!this[_0xcdbf('0x8f')](_0x5e997d[_0xcdbf('0x65')])){return this[_0xcdbf('0xf')]['noop'](_0xcdbf('0xb4'));}this['channel'][_0xcdbf('0xf7')]=!![];this[_0xcdbf('0x3c')](_0x5e997d);this['createSquareMessage'](_0x5e997d[_0xcdbf('0x65')],'in','','');this[_0xcdbf('0xf')][_0xcdbf('0xb6')](util[_0xcdbf('0x2d')](_0xcdbf('0x12e'),_0x5e997d[_0xcdbf('0x65')]));var _0xe72850=this[_0xcdbf('0x98')]['sync'](this,_0x5e997d);if(_0xe72850){for(var _0x1940b3 in _0xe72850){if(_0xe72850['hasOwnProperty'](_0x1940b3)&&_['isString'](_0xe72850[_0x1940b3])){this['channel']['setVariable'](util['format'](_0xcdbf('0x12f'),_0x1940b3[_0xcdbf('0x70')]()),_0xe72850[_0x1940b3]);}}if(_[_0xcdbf('0x4c')](_0xe72850['message'])){return this[_0xcdbf('0xf')][_0xcdbf('0xb6')](_0xcdbf('0x130'));}else{this[_0xcdbf('0x49')](_0xe72850[_0xcdbf('0x7e')],_0xcdbf('0xf2'),_0xcdbf('0x131'),'');return this[_0xcdbf('0xf')][_0xcdbf('0xb6')](util['format'](_0xcdbf('0x132'),_0xe72850[_0xcdbf('0x7e')]));}}return this[_0xcdbf('0xf')][_0xcdbf('0x31')](_0x5e997d,_0xcdbf('0x133'));};AGIVertices['prototype'][_0xcdbf('0x134')]=function(_0x56c534){logger[_0xcdbf('0x33')](util['format'](_0xcdbf('0x135'),_0x56c534['label'],_0x56c534[_0xcdbf('0x6c')]));if(!this[_0xcdbf('0x8f')](_0x56c534['key'])){return this[_0xcdbf('0xf')]['noop'](_0xcdbf('0xef'));}var _0x371c08=_0xcdbf('0x136');var _0x16053d=util[_0xcdbf('0x2d')](_0xcdbf('0x137'),FILES_PATH,rs['generate'](0x4));var _0x4b587c=util[_0xcdbf('0x2d')](_0xcdbf('0xaa'),_0x16053d,_0x371c08);var _0x5a88a3=!![];if(_0x56c534['beep']===_0xcdbf('0x138')){_0x5a88a3=![];}var _0xc90479=this[_0xcdbf('0xf')][_0xcdbf('0x139')](_0x16053d,_0x371c08,_0x56c534['intKey'],_0x56c534[_0xcdbf('0x6c')],undefined,_0x5a88a3);if(_0xc90479[_0xcdbf('0xaf')]!==-0x1){this[_0xcdbf('0xf')][_0xcdbf('0xb6')](util[_0xcdbf('0x2d')](_0xcdbf('0x13a'),_0x4b587c));var _0x2c0144=this[_0xcdbf('0x9a')][_0xcdbf('0x77')](this,_0x56c534,_0x4b587c);if(_0x2c0144){for(var _0x55e26d in _0x2c0144){if(_0x2c0144['hasOwnProperty'](_0x55e26d)){this[_0xcdbf('0xf')]['setVariable'](util['format'](_0xcdbf('0x13b'),_0x55e26d[_0xcdbf('0x70')]()),_0x2c0144[_0x55e26d]);}}return this['channel'][_0xcdbf('0xb6')](util[_0xcdbf('0x2d')](_0xcdbf('0x13c'),JSON[_0xcdbf('0x7b')](_0x2c0144)));}}return _0xc90479;};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0x13d')]=function(_0xecd4aa){logger['info'](util[_0xcdbf('0x2d')](_0xcdbf('0x13e'),_0xecd4aa[_0xcdbf('0x3e')]));if(!this[_0xcdbf('0x8f')](_0xecd4aa[_0xcdbf('0x9c')])){return this[_0xcdbf('0xf')][_0xcdbf('0xb6')](_0xcdbf('0x13f'));}if(!this['isConfigured'](_0xecd4aa['appsecret'])){return this[_0xcdbf('0xf')][_0xcdbf('0xb6')](_0xcdbf('0x140'));}var _0xe10246=_0xcdbf('0x136');var _0x4f3e58=util[_0xcdbf('0x2d')](_0xcdbf('0x137'),FILES_PATH,rs['generate'](0x4));var _0x553f97=util[_0xcdbf('0x2d')]('%s.%s',_0x4f3e58,_0xe10246);var _0x1cf25a=!![];if(_0xecd4aa[_0xcdbf('0x141')]==='NOBEEP'){_0x1cf25a=![];}var _0x500554=this[_0xcdbf('0xf')][_0xcdbf('0x139')](_0x4f3e58,_0xe10246,_0xecd4aa['intKey'],_0xecd4aa[_0xcdbf('0x6c')],undefined,_0x1cf25a);if(_0x500554[_0xcdbf('0xaf')]!==-0x1){this['channel'][_0xcdbf('0xb6')](util[_0xcdbf('0x2d')](_0xcdbf('0x142'),_0x553f97));var _0x22e62e=this[_0xcdbf('0x9b')][_0xcdbf('0x77')](this,_0xecd4aa,_0x553f97);if(_0x22e62e){for(var _0x5f0e04 in _0x22e62e){if(_0x22e62e[_0xcdbf('0xa1')](_0x5f0e04)){this[_0xcdbf('0xf')]['setVariable'](util[_0xcdbf('0x2d')](_0xcdbf('0x143'),_0x5f0e04['toUpperCase']()),_0x22e62e[_0x5f0e04]);}}return this[_0xcdbf('0xf')][_0xcdbf('0xb6')](util['format'](_0xcdbf('0x144'),JSON['stringify'](_0x22e62e)));}}return _0x500554;};AGIVertices[_0xcdbf('0x16')]['gotoc']=function(_0x9d5afb){logger['info'](util[_0xcdbf('0x2d')](_0xcdbf('0x145'),_0x9d5afb[_0xcdbf('0x3e')]));return this['channel']['continueAt'](_0x9d5afb['context'],_0x9d5afb[_0xcdbf('0x45')],_0x9d5afb[_0xcdbf('0x46')]);};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0x146')]=function(_0x78f8eb){logger['info'](util[_0xcdbf('0x2d')](_0xcdbf('0x147'),_0x78f8eb[_0xcdbf('0x3e')]));if(!this['isConfigured'](_0x78f8eb['condition'])){return this[_0xcdbf('0xf')]['error'](_0x78f8eb,_0xcdbf('0x148'));}try{var _0x4975e7=eval(_0x78f8eb['condition'])?'true':_0xcdbf('0x149');this[_0xcdbf('0xf')]['noop'](util[_0xcdbf('0x2d')]('EVAL\x20CONDITION\x20%s\x20%s',_0x78f8eb['condition'],_0x4975e7));return{'code':0xc8,'result':_0x4975e7};}catch(_0x15e949){return{'code':0xc8,'result':_0xcdbf('0x149')};}};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0x14a')]=function(_0x18d612){logger[_0xcdbf('0x33')](util[_0xcdbf('0x2d')](_0xcdbf('0x14b'),_0x18d612[_0xcdbf('0x3e')]));if(!this[_0xcdbf('0x8f')](_0x18d612[_0xcdbf('0x14c')])){return this[_0xcdbf('0xf')][_0xcdbf('0x31')](_0x18d612,_0xcdbf('0x14d'));}var _0x209145=this[_0xcdbf('0x27')][_0xcdbf('0x77')](this,_0x18d612[_0xcdbf('0x14c')]);if(!_0x209145){return this[_0xcdbf('0xf')][_0xcdbf('0x31')](_0x18d612,_0xcdbf('0x14e'));}for(var _0x5ad4e5=0x0;_0x5ad4e5<_0x209145['length'];_0x5ad4e5+=0x1){var _0x1fa644=this[_0xcdbf('0xf')]['getVariable'](util[_0xcdbf('0x2d')]('IFTIME(%s?true:false)',_0x209145[_0x5ad4e5]));if(_0x1fa644[_0xcdbf('0xaf')]===-0x1){return _0x1fa644;}logger[_0xcdbf('0x33')](util[_0xcdbf('0x2d')](_0xcdbf('0x14f'),_0x209145[_0x5ad4e5],_0x1fa644[_0xcdbf('0xad')]));if(_0x1fa644[_0xcdbf('0xad')]===_0xcdbf('0x150')){logger['info'](util['format']('IFTIME\x20%s\x20%s',_0x209145[_0x5ad4e5],_0xcdbf('0x150')));this[_0xcdbf('0xf')][_0xcdbf('0xb6')](util['format']('IFTIME\x20%s\x20%s',_0x209145[_0x5ad4e5],_0xcdbf('0x150')));return{'code':0xc8,'result':'true'};}else{logger['info'](util[_0xcdbf('0x2d')]('IFTIME\x20%s\x20%s',_0x209145[_0x5ad4e5],_0xcdbf('0x149')));this[_0xcdbf('0xf')]['noop'](util[_0xcdbf('0x2d')]('IFTIME\x20%s\x20%s',_0x209145[_0x5ad4e5],_0xcdbf('0x149')));}}return{'code':0xc8,'result':_0xcdbf('0x149')};};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0x151')]=function(_0x2a99c6){logger['info'](util[_0xcdbf('0x2d')](_0xcdbf('0x152'),_0x2a99c6[_0xcdbf('0x3e')]));return this[_0xcdbf('0xf')]['hangup']();};AGIVertices['prototype']['ispeechasr']=function(_0x2975fc){logger[_0xcdbf('0x33')](util[_0xcdbf('0x2d')](_0xcdbf('0x153'),_0x2975fc['label']));if(!this[_0xcdbf('0x8f')](_0x2975fc[_0xcdbf('0x82')])){return this[_0xcdbf('0xf')]['noop'](_0xcdbf('0xef'));}var _0x330b1a=_0xcdbf('0x136');var _0x394493=util[_0xcdbf('0x2d')]('%s/recordings/%s',FILES_PATH,rs[_0xcdbf('0x11d')](0x4));var _0x166266=util[_0xcdbf('0x2d')](_0xcdbf('0xaa'),_0x394493,_0x330b1a);var _0x35c32f=!![];if(_0x2975fc[_0xcdbf('0x141')]===_0xcdbf('0x138')){_0x35c32f=![];}var _0x4c4359=this[_0xcdbf('0xf')]['recordFile'](_0x394493,_0x330b1a,_0x2975fc['intKey'],_0x2975fc[_0xcdbf('0x6c')],undefined,_0x35c32f);if(_0x4c4359[_0xcdbf('0xaf')]!==-0x1){this[_0xcdbf('0xf')][_0xcdbf('0xb6')](util[_0xcdbf('0x2d')](_0xcdbf('0x154'),_0x166266));var _0x22ffe2=this[_0xcdbf('0x8d')][_0xcdbf('0x77')](this,_0x2975fc,_0x166266);if(_0x22ffe2){for(var _0x18aa1a in _0x22ffe2){if(_0x22ffe2[_0xcdbf('0xa1')](_0x18aa1a)){this[_0xcdbf('0xf')][_0xcdbf('0xb0')](util[_0xcdbf('0x2d')]('ISPEECH_ASR_%s',_0x18aa1a['toUpperCase']()),_0x22ffe2[_0x18aa1a]);}}return this[_0xcdbf('0xf')][_0xcdbf('0xb6')](util[_0xcdbf('0x2d')](_0xcdbf('0x155'),JSON['stringify'](_0x22ffe2)));}}return _0x4c4359;};AGIVertices['prototype']['ispeechtts']=function(_0x421e93){logger[_0xcdbf('0x33')](util['format'](_0xcdbf('0x156'),_0x421e93[_0xcdbf('0x3e')]));if(!this[_0xcdbf('0x8f')](_0x421e93[_0xcdbf('0x82')])){return this[_0xcdbf('0xf')]['noop'](_0xcdbf('0xef'));}if(!this[_0xcdbf('0x8f')](_0x421e93[_0xcdbf('0x65')])){return this['channel'][_0xcdbf('0xb6')](_0xcdbf('0xb4'));}this[_0xcdbf('0xf')][_0xcdbf('0xb6')](util['format'](_0xcdbf('0x157'),_0x421e93[_0xcdbf('0x65')]));var _0x5d820a=this[_0xcdbf('0x8a')][_0xcdbf('0x77')](this,_0x421e93);if(_0x5d820a){this[_0xcdbf('0xf')][_0xcdbf('0xb6')](util['format'](_0xcdbf('0x154'),_0x5d820a));var _0x1764c9=this[_0xcdbf('0xf')][_0xcdbf('0x107')](_0x5d820a,_0x421e93[_0xcdbf('0x158')]);try{fs['unlink'](_0x5d820a+'.wav');}catch(_0x2424a6){logger[_0xcdbf('0x31')](_0x2424a6);}return _0x1764c9;}return this[_0xcdbf('0xf')]['error'](_0x421e93,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0xcdbf('0x16')]['login']=function(_0x3ca244){logger[_0xcdbf('0x33')](util[_0xcdbf('0x2d')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x3ca244[_0xcdbf('0x3e')]));if(!this['isConfigured'](_0x3ca244['findBy'])){return this[_0xcdbf('0xf')][_0xcdbf('0x31')](_0x3ca244,_0xcdbf('0x159'));}logger['info'](util[_0xcdbf('0x2d')](_0xcdbf('0x15a'),this['channel'][_0xcdbf('0x41')],_0x3ca244[_0xcdbf('0x15b')]));var _0x1d2cdd=this[_0xcdbf('0x5b')]['sync'](this,_0x3ca244[_0xcdbf('0x15b')]);if(_0x1d2cdd){logger[_0xcdbf('0x33')](util['format'](_0xcdbf('0x15c'),this[_0xcdbf('0xf')][_0xcdbf('0x41')],_0x3ca244[_0xcdbf('0x15b')]));this[_0xcdbf('0xf')]['noop'](util[_0xcdbf('0x2d')](_0xcdbf('0x15c'),this[_0xcdbf('0xf')]['callerid'],_0x3ca244[_0xcdbf('0x15b')]));return{'code':0xc8,'result':'success'};}else{logger[_0xcdbf('0x33')](util[_0xcdbf('0x2d')](_0xcdbf('0x15d'),this[_0xcdbf('0xf')]['callerid'],_0x3ca244[_0xcdbf('0x15b')]));this[_0xcdbf('0xf')]['noop'](util['format'](_0xcdbf('0x15d'),this[_0xcdbf('0xf')]['callerid'],_0x3ca244[_0xcdbf('0x15b')]));return{'code':0xc8,'result':_0xcdbf('0x15e')};}};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0x15f')]=function(_0x27ca17){logger[_0xcdbf('0x33')](util[_0xcdbf('0x2d')](_0xcdbf('0x160'),_0x27ca17[_0xcdbf('0x3e')]));if(!this[_0xcdbf('0x8f')](_0x27ca17['findBy'])){return this['channel'][_0xcdbf('0x31')](_0x27ca17,_0xcdbf('0x159'));}logger[_0xcdbf('0x33')](util['format'](_0xcdbf('0x15a'),this[_0xcdbf('0xf')]['callerid'],_0x27ca17[_0xcdbf('0x15b')]));var _0x43a93c=this[_0xcdbf('0x5a')][_0xcdbf('0x77')](this,_0x27ca17[_0xcdbf('0x15b')]);if(_0x43a93c){logger['info'](util['format'](_0xcdbf('0x15c'),this[_0xcdbf('0xf')][_0xcdbf('0x41')],_0x27ca17[_0xcdbf('0x15b')]));this[_0xcdbf('0xf')][_0xcdbf('0xb6')](util[_0xcdbf('0x2d')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xcdbf('0xf')][_0xcdbf('0x41')],_0x27ca17[_0xcdbf('0x15b')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0xcdbf('0x2d')](_0xcdbf('0x15d'),this['channel'][_0xcdbf('0x41')],_0x27ca17[_0xcdbf('0x15b')]));this['channel'][_0xcdbf('0xb6')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xcdbf('0xf')]['callerid'],_0x27ca17['findBy']));return{'code':0xc8,'result':_0xcdbf('0x15e')};}};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0x161')]=function(_0x1d9593){logger[_0xcdbf('0x33')](util[_0xcdbf('0x2d')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x1d9593[_0xcdbf('0x3e')]));if(!this['isConfigured'](_0x1d9593[_0xcdbf('0x162')])){return this[_0xcdbf('0xf')][_0xcdbf('0x31')](_0x1d9593,_0xcdbf('0x163'));}this[_0xcdbf('0xf')][_0xcdbf('0xb6')](util[_0xcdbf('0x2d')](_0xcdbf('0x164'),_0x1d9593[_0xcdbf('0x162')]));var _0x341437=eval(_0x1d9593[_0xcdbf('0x162')]);if(!this['isConfigured'](_0x1d9593[_0xcdbf('0xe3')])){return this[_0xcdbf('0xf')][_0xcdbf('0xb6')](_0xcdbf('0xe2'));}var _0x57eb79=this['getVariable'][_0xcdbf('0x77')](this,_0x1d9593[_0xcdbf('0xe3')]);if(!_0x57eb79){return this[_0xcdbf('0xf')][_0xcdbf('0x31')](_0x1d9593,_0xcdbf('0xe4'));}if(_[_0xcdbf('0xa7')](_0x341437)){var _0x499ee3=this;_0x341437['forEach'](function(_0x1baf3f,_0x3312fc){_0x499ee3[_0xcdbf('0xf')]['setVariable'](util['format'](_0xcdbf('0x165'),_0x57eb79,_0x3312fc),_0x1baf3f);});return this[_0xcdbf('0xf')][_0xcdbf('0xb6')](util[_0xcdbf('0x2d')](_0xcdbf('0x166'),_0x57eb79));}else{return this[_0xcdbf('0xf')]['setVariable'](_0x57eb79,_0x341437);}};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0xc')]=function(_0x2a2fe9){logger[_0xcdbf('0x33')](util[_0xcdbf('0x2d')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x2a2fe9[_0xcdbf('0x3e')]));if(_0x2a2fe9[_0xcdbf('0xb2')]===0x0){return this[_0xcdbf('0xb1')](_0x2a2fe9);}_0x2a2fe9[_0xcdbf('0xb2')]-=0x1;if(!this['isConfigured'](_0x2a2fe9[_0xcdbf('0x167')])){return this['channel']['error'](_0x2a2fe9,_0xcdbf('0x168'));}var _0x567e12=this[_0xcdbf('0x116')][_0xcdbf('0x77')](this,_0x2a2fe9[_0xcdbf('0x167')]);if(!_0x567e12){return this['channel'][_0xcdbf('0x31')](_0x2a2fe9,_0xcdbf('0x117'));}var _0x5b110b=this[_0xcdbf('0xf')][_0xcdbf('0x118')](_0x567e12,_0x2a2fe9[_0xcdbf('0x169')],_0x2a2fe9['digit']);var _0x19064f=_0x5b110b[_0xcdbf('0xaf')];if(_0x5b110b[_0xcdbf('0xaf')]===-0x1){this[_0xcdbf('0x3c')]['sync'](this,_0x2a2fe9,'-1');return _0x5b110b;}else if(_0x5b110b[_0xcdbf('0xad')]===_0xcdbf('0x6c')){_0x5b110b[_0xcdbf('0xaf')]=_0x5b110b[_0xcdbf('0xaf')]['length']>0x0?_0x5b110b[_0xcdbf('0xaf')]:'t';}else if(_[_0xcdbf('0x4b')](_0x5b110b[_0xcdbf('0xaf')])){_0x5b110b[_0xcdbf('0xaf')]='#';_0x19064f='#';}if(!this[_0xcdbf('0x8f')](_0x2a2fe9['variable_id'])){this[_0xcdbf('0xf')][_0xcdbf('0xb6')](_0xcdbf('0xe2'));}else{var _0x452f6e=this['getVariable']['sync'](this,_0x2a2fe9[_0xcdbf('0xe3')]);if(!_0x452f6e){return this[_0xcdbf('0xf')][_0xcdbf('0x31')](_0x2a2fe9,_0xcdbf('0xe4'));}this[_0xcdbf('0xf')][_0xcdbf('0xb0')](_0x452f6e,_0x19064f);}this[_0xcdbf('0x3c')][_0xcdbf('0x77')](this,_0x2a2fe9,_0x19064f);return _0x5b110b;};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0xb6')]=function(_0xbee57d){logger[_0xcdbf('0x33')](util[_0xcdbf('0x2d')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0xbee57d[_0xcdbf('0x3e')]));return this[_0xcdbf('0xf')][_0xcdbf('0xb6')](_0xbee57d[_0xcdbf('0x16a')]||_0xbee57d['label']);};AGIVertices['prototype'][_0xcdbf('0x16b')]=function(_0x1ab7d9){logger['info'](util[_0xcdbf('0x2d')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x1ab7d9[_0xcdbf('0x3e')]));if(!this[_0xcdbf('0x8f')](_0x1ab7d9[_0xcdbf('0x15b')])){return this[_0xcdbf('0xf')][_0xcdbf('0x31')](_0x1ab7d9,_0xcdbf('0x159'));}logger['info'](util[_0xcdbf('0x2d')](_0xcdbf('0x15a'),this[_0xcdbf('0xf')]['callerid'],_0x1ab7d9[_0xcdbf('0x15b')]));var _0x47a32a=this[_0xcdbf('0x55')][_0xcdbf('0x77')](this,_0x1ab7d9[_0xcdbf('0x16c')]);var _0x31a0ca=this[_0xcdbf('0x57')]['sync'](this,_0x1ab7d9['findBy'],_0x47a32a);if(_0x31a0ca){logger[_0xcdbf('0x33')](util['format'](_0xcdbf('0x15c'),this[_0xcdbf('0xf')]['callerid'],_0x1ab7d9[_0xcdbf('0x15b')]));this[_0xcdbf('0xf')][_0xcdbf('0xb6')](util[_0xcdbf('0x2d')](_0xcdbf('0x15c'),this[_0xcdbf('0xf')][_0xcdbf('0x41')],_0x1ab7d9[_0xcdbf('0x15b')]));return{'code':0xc8,'result':'success'};}else{logger[_0xcdbf('0x33')](util[_0xcdbf('0x2d')](_0xcdbf('0x15d'),this[_0xcdbf('0xf')][_0xcdbf('0x41')],_0x1ab7d9['findBy']));this['channel'][_0xcdbf('0xb6')](util[_0xcdbf('0x2d')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xcdbf('0xf')]['callerid'],_0x1ab7d9[_0xcdbf('0x15b')]));return{'code':0xc8,'result':_0xcdbf('0x15e')};}};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0x16d')]=function(_0x3ddd54){logger[_0xcdbf('0x33')](util[_0xcdbf('0x2d')](_0xcdbf('0x16e'),_0x3ddd54[_0xcdbf('0x3e')]));if(!this['isConfigured'](_0x3ddd54['file_id'])){return this['channel'][_0xcdbf('0x31')](_0x3ddd54,_0xcdbf('0x168'));}var _0x43035f=this[_0xcdbf('0x116')][_0xcdbf('0x77')](this,_0x3ddd54['file_id']);if(!_0x43035f){return this[_0xcdbf('0xf')]['error'](_0x3ddd54,_0xcdbf('0x117'));}var _0x5a4b12=this[_0xcdbf('0xf')]['exec'](_0xcdbf('0x16f'),[_0x43035f,_0x3ddd54[_0xcdbf('0x112')]]);if(_0x5a4b12[_0xcdbf('0xaf')]===-0x1){return _0x5a4b12;}return this[_0xcdbf('0xf')][_0xcdbf('0xb6')](util[_0xcdbf('0x2d')]('Executed\x20command\x20%s\x20%s',_0xcdbf('0x16f'),_0x43035f));};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0x170')]=function(_0x2234b8){logger[_0xcdbf('0x33')](util[_0xcdbf('0x2d')](_0xcdbf('0x171'),_0x2234b8[_0xcdbf('0x3e')]));if(!this['isConfigured'](_0x2234b8[_0xcdbf('0x172')])){return this['channel']['error'](_0x2234b8,'no\x20queue\x20selected');}var _0x422636='';var _0x2c4674=parseInt(_0x2234b8['queue_id'],0xa);if(isNaN(_0x2c4674)){_0x422636=_0x2234b8[_0xcdbf('0x172')];}else{_0x422636=this[_0xcdbf('0x173')][_0xcdbf('0x77')](this,_0x2234b8[_0xcdbf('0x172')]);if(!_0x422636){return this[_0xcdbf('0xf')]['error'](_0x2234b8,'no\x20queue\x20found');}}var _0x4521ad='';if(this[_0xcdbf('0x8f')](_0x2234b8[_0xcdbf('0x167')])){var _0x5e1c04=this[_0xcdbf('0x116')][_0xcdbf('0x77')](this,_0x2234b8[_0xcdbf('0x167')]);if(_0x5e1c04){_0x4521ad=_0x5e1c04;}}this[_0xcdbf('0x3c')][_0xcdbf('0x77')](this,_0x2234b8,_0x422636);if(_0x2234b8['opts'][_0xcdbf('0x174')]('x')<0x0){_0x2234b8['opts']+='x';}if(_0x2234b8[_0xcdbf('0x112')][_0xcdbf('0x174')]('X')<0x0){_0x2234b8[_0xcdbf('0x112')]+='X';}this[_0xcdbf('0xf')][_0xcdbf('0xb0')]('XMCS-QUEUE',_0x422636?_0x422636[_0xcdbf('0x175')]():'');var _0x50db21=this[_0xcdbf('0xf')][_0xcdbf('0x5f')](_0xcdbf('0x176'),[_0x422636,_0x2234b8['opts'],_0x2234b8[_0xcdbf('0x79')],_0x4521ad,_0x2234b8['timeout'],_0x2234b8['agi'],_0x2234b8[_0xcdbf('0x177')],_0x2234b8[_0xcdbf('0x178')],'',_0x2234b8['position']]);if(_0x50db21[_0xcdbf('0xaf')]===-0x1){return _0x50db21;}return this[_0xcdbf('0xf')][_0xcdbf('0xb6')](util[_0xcdbf('0x2d')](_0xcdbf('0x179'),_0xcdbf('0x176'),_0x422636));};AGIVertices['prototype'][_0xcdbf('0x17a')]=function(_0x59639b){logger[_0xcdbf('0x33')](util['format'](_0xcdbf('0x17b'),_0x59639b[_0xcdbf('0x3e')]));var _0x379658=_0x59639b[_0xcdbf('0x17c')]||_0xcdbf('0x136');var _0x4736c2=util['format'](_0xcdbf('0x17d'),this['channel']['uniqueid'],rs[_0xcdbf('0x11d')](0x5));var _0x26c632=util[_0xcdbf('0x2d')](_0xcdbf('0x17e'),FILES_PATH,_0x4736c2,_0x379658);var _0x54e4e0=util[_0xcdbf('0x2d')](_0xcdbf('0x137'),FILES_PATH,_0x4736c2);this[_0xcdbf('0x42')][_0xcdbf('0x77')](this,_0x59639b,_0x4736c2,_0x26c632);this[_0xcdbf('0xf')][_0xcdbf('0xb0')]('RECORDING_SAVENAME',_0x4736c2);logger[_0xcdbf('0x33')](_0xcdbf('0x17f'),_0x54e4e0,_0x379658,_0x59639b['escape_digits'],_0x59639b[_0xcdbf('0x6c')]);return this[_0xcdbf('0xf')][_0xcdbf('0x139')](_0x54e4e0,_0x379658,_0x59639b[_0xcdbf('0x180')],_0x59639b['timeout'],undefined,!![]);};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0x181')]=function(_0x20feec){logger[_0xcdbf('0x33')](util[_0xcdbf('0x2d')](_0xcdbf('0x182'),_0x20feec[_0xcdbf('0x3e')]));if(!this[_0xcdbf('0x8f')](_0x20feec[_0xcdbf('0x79')])){return this[_0xcdbf('0xf')][_0xcdbf('0xb6')](_0xcdbf('0x183'));}var _0x3a08b6=this[_0xcdbf('0x6a')]['sync'](this,_0x20feec);logger[_0xcdbf('0x33')](util[_0xcdbf('0x2d')](_0xcdbf('0x184'),util['inspect'](_0x3a08b6,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x20feec[_0xcdbf('0xe3')])){return this[_0xcdbf('0xf')]['noop']('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x1ce6e3=this[_0xcdbf('0x12')][_0xcdbf('0x77')](this,_0x20feec[_0xcdbf('0xe3')]);if(!_0x1ce6e3){return this[_0xcdbf('0xf')][_0xcdbf('0x31')](_0x20feec,_0xcdbf('0xe4'));}this[_0xcdbf('0xf')][_0xcdbf('0xb0')](util['format']('%s_STATUS_CODE',_0x1ce6e3),_0x3a08b6[_0xcdbf('0x7d')]?_0x3a08b6['statusCode']:_0xcdbf('0x185'));this['channel'][_0xcdbf('0xb0')](util['format'](_0xcdbf('0x186'),_0x1ce6e3),_0x3a08b6[_0xcdbf('0x187')]?_0x3a08b6['statusMessage']:'OK');if(_0x3a08b6[_0xcdbf('0x71')]){try{this[_0xcdbf('0xa9')](_0x3a08b6['body'],_0x1ce6e3);}catch(_0x2cf9f5){logger[_0xcdbf('0x31')](util[_0xcdbf('0x2d')](_0xcdbf('0x188'),_0x1ce6e3));}}return this[_0xcdbf('0xf')][_0xcdbf('0xb6')](util[_0xcdbf('0x2d')](_0xcdbf('0x189'),_0x1ce6e3));};AGIVertices[_0xcdbf('0x16')]['saydigits']=function(_0x2e47bf){logger[_0xcdbf('0x33')](util[_0xcdbf('0x2d')](_0xcdbf('0x18a'),_0x2e47bf['label']));return this[_0xcdbf('0xf')][_0xcdbf('0x18b')](_0x2e47bf[_0xcdbf('0x18c')][_0xcdbf('0x61')](/\s+/g,''),_0x2e47bf[_0xcdbf('0x180')]);};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0x18d')]=function(_0xb62457){logger[_0xcdbf('0x33')](util[_0xcdbf('0x2d')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0xb62457[_0xcdbf('0x3e')]));return this[_0xcdbf('0xf')][_0xcdbf('0x18e')](_0xb62457[_0xcdbf('0x18f')][_0xcdbf('0x61')](/\s+/g,''),_0xb62457[_0xcdbf('0x180')]);};AGIVertices['prototype'][_0xcdbf('0x190')]=function(_0x19376b){logger[_0xcdbf('0x33')](util['format']('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x19376b[_0xcdbf('0x3e')]));return this[_0xcdbf('0xf')][_0xcdbf('0x191')](_0x19376b[_0xcdbf('0x65')],_0x19376b[_0xcdbf('0x180')]);};AGIVertices[_0xcdbf('0x16')]['sendMail']=function(_0x4db6c9){logger[_0xcdbf('0x33')](util['format'](_0xcdbf('0x192'),_0x4db6c9['label']));if(!this[_0xcdbf('0x8f')](_0x4db6c9[_0xcdbf('0x193')])){return this[_0xcdbf('0xf')][_0xcdbf('0xb6')](_0xcdbf('0x194'));}var _0x38a321=this[_0xcdbf('0x24')][_0xcdbf('0x77')](this,_0x4db6c9[_0xcdbf('0x193')]);if(!_0x38a321||!_0x38a321[_0xcdbf('0x195')]){return this['channel']['error'](_0x4db6c9,_0xcdbf('0x196'));}var _0x2d0972={'from':util['format'](_0xcdbf('0x197'),_0x38a321[_0xcdbf('0x14')],_0x38a321['email']||_0x38a321[_0xcdbf('0x195')][_0xcdbf('0x198')]),'to':_0x4db6c9['to']||'','cc':_0x4db6c9['cc']||'','bcc':_0x4db6c9[_0xcdbf('0x199')]||'','subject':_0x4db6c9[_0xcdbf('0x19a')],'html':_0x4db6c9['text'],'text':_0x4db6c9[_0xcdbf('0x65')]};if(this['isConfigured'](_0x4db6c9[_0xcdbf('0x19b')])){}logger['debug'](_0xcdbf('0x19c'),JSON[_0xcdbf('0x7b')](_0x2d0972));this['createSquareDetailsReport'][_0xcdbf('0x77')](this,_0x4db6c9,_0x4db6c9[_0xcdbf('0x193')]);this['channel']['noop'](util[_0xcdbf('0x2d')](_0xcdbf('0x19d'),_0x38a321[_0xcdbf('0x14')]));this[_0xcdbf('0x26')]['sync'](this,_0x38a321[_0xcdbf('0x19e')],_0x2d0972);return this[_0xcdbf('0xf')][_0xcdbf('0xb6')](_0xcdbf('0x19f'));};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0x1a0')]=function(_0x3e911d){logger[_0xcdbf('0x33')](util['format'](_0xcdbf('0x1a1'),_0x3e911d[_0xcdbf('0x3e')]));return this['channel'][_0xcdbf('0xb6')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0xcdbf('0x16')]['sendSMS']=function(_0x30bd5a){logger[_0xcdbf('0x33')](util['format'](_0xcdbf('0x1a2'),_0x30bd5a[_0xcdbf('0x3e')]));if(!this[_0xcdbf('0x8f')](_0x30bd5a[_0xcdbf('0x1a3')])){return this[_0xcdbf('0xf')][_0xcdbf('0xb6')](_0xcdbf('0x1a4'));}var _0x297746=this[_0xcdbf('0x39')][_0xcdbf('0x77')](this,_0x30bd5a['sms_account_id']);if(!_0x297746){return this[_0xcdbf('0xf')][_0xcdbf('0x31')](_0x30bd5a,_0xcdbf('0x1a5'));}var _0x5e0a8c={'body':_0x30bd5a[_0xcdbf('0x1a6')],'phone':_0x30bd5a['to']||'','SmsAccountId':_0x297746['id']};logger[_0xcdbf('0x1a7')](_0xcdbf('0x1a8'),JSON[_0xcdbf('0x7b')](_0x5e0a8c));this[_0xcdbf('0x3c')][_0xcdbf('0x77')](this,_0x30bd5a,_0x30bd5a[_0xcdbf('0x1a3')]);this[_0xcdbf('0xf')]['noop'](util[_0xcdbf('0x2d')](_0xcdbf('0x1a9'),_0x297746['name']));this[_0xcdbf('0x3b')][_0xcdbf('0x77')](this,_0x5e0a8c);return this[_0xcdbf('0xf')][_0xcdbf('0xb6')](_0xcdbf('0x1aa'));};AGIVertices['prototype'][_0xcdbf('0x1ab')]=function(_0x3653d3){logger[_0xcdbf('0x33')](util[_0xcdbf('0x2d')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x3653d3[_0xcdbf('0x3e')]));if(!this[_0xcdbf('0x8f')](_0x3653d3[_0xcdbf('0xe3')])){return this[_0xcdbf('0xf')][_0xcdbf('0x31')](_0x3653d3,_0xcdbf('0x1ac'));}var _0x515260=this['getVariable']['sync'](this,_0x3653d3[_0xcdbf('0xe3')]);if(!_0x515260){return this[_0xcdbf('0xf')]['error'](_0x3653d3,_0xcdbf('0xe4'));}return this['channel'][_0xcdbf('0xb0')](_0x515260,_0x3653d3[_0xcdbf('0x1ad')]);};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0x1ae')]=function(_0x44137){logger[_0xcdbf('0x33')](util[_0xcdbf('0x2d')]('Enter\x20in\x20START\x20(%s)\x20block',_0x44137['label']));this['channel'][_0xcdbf('0xb6')](_0xcdbf('0x1af'));if(_0x44137['answer']===_0xcdbf('0x1b0')){this[_0xcdbf('0xf')][_0xcdbf('0xb6')](_0xcdbf('0x1b1'));return this[_0xcdbf('0xf')][_0xcdbf('0xc3')]();}return this['channel']['noop']('Skipped\x20Answer');};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0x1b2')]=function(_0x4c6d66){logger['info'](util['format'](_0xcdbf('0x1b3'),_0x4c6d66[_0xcdbf('0x3e')]));if(!this[_0xcdbf('0x8f')](_0x4c6d66[_0xcdbf('0x1b4')])){return this[_0xcdbf('0xf')][_0xcdbf('0x31')](_0x4c6d66,'no\x20subproject\x20selected');}var _0x303aad=this[_0xcdbf('0x19')][_0xcdbf('0x77')](this,_0x4c6d66[_0xcdbf('0x1b4')]);if(!this['isConfigured'](_0x303aad)){return this[_0xcdbf('0xf')][_0xcdbf('0x31')](_0x4c6d66,util[_0xcdbf('0x2d')](_0xcdbf('0x1b5'),_0x4c6d66['project_id']));}if(_0x303aad===this[_0xcdbf('0xf')]['arg_1']){return this[_0xcdbf('0xf')][_0xcdbf('0x31')](_0x4c6d66,_0xcdbf('0x1b6'));}this['createSquareDetailsReport'][_0xcdbf('0x77')](this,_0x4c6d66,_0x303aad);var _0x3b01c4=this[_0xcdbf('0xf')][_0xcdbf('0x5f')]('AGI',util[_0xcdbf('0x2d')](_0xcdbf('0x1b7'),config[_0xcdbf('0x7')][_0xcdbf('0x1b8')]||'127.0.0.1',_0x303aad,this['channel'][_0xcdbf('0x40')]));if(_0x3b01c4[_0xcdbf('0xaf')]===-0x1){return _0x3b01c4;}return this[_0xcdbf('0xf')][_0xcdbf('0xb6')](util['format'](_0xcdbf('0x179'),_0xcdbf('0x1b9'),_0x303aad));};AGIVertices['prototype'][_0xcdbf('0x1ba')]=function(_0x1d33f4){logger[_0xcdbf('0x33')](util['format']('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x1d33f4[_0xcdbf('0x3e')]));var _0x1698a1=this[_0xcdbf('0x5e')][_0xcdbf('0x77')](this,_0x1d33f4[_0xcdbf('0xc1')]);this[_0xcdbf('0x3c')]['sync'](this,_0x1d33f4,_0x1d33f4[_0xcdbf('0xc1')]);if(this[_0xcdbf('0x8f')](_0x1d33f4[_0xcdbf('0xe3')])){var _0x1e05f2=this[_0xcdbf('0x12')]['sync'](this,_0x1d33f4['variable_id']);if(_0x1e05f2){this[_0xcdbf('0xf')][_0xcdbf('0xb0')](_0x1e05f2,_0x1698a1);return this[_0xcdbf('0xf')]['noop'](util[_0xcdbf('0x2d')](_0xcdbf('0x1bb'),_0x1d33f4['command'],_0x1e05f2));}}return this[_0xcdbf('0xf')][_0xcdbf('0xb6')](util[_0xcdbf('0x2d')](_0xcdbf('0x1bc'),_0x1d33f4['command']));};AGIVertices['prototype'][_0xcdbf('0x1bd')]=function(_0x24be8f){logger[_0xcdbf('0x33')](util[_0xcdbf('0x2d')](_0xcdbf('0x1be'),_0x24be8f[_0xcdbf('0x3e')]));_0x24be8f[_0xcdbf('0x65')]=_0x24be8f[_0xcdbf('0x65')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x24be8f[_0xcdbf('0x63')])){return this['channel']['noop']('no\x20apiKey\x20configured');}if(!this[_0xcdbf('0x8f')](_0x24be8f['text'])){return this['channel'][_0xcdbf('0xb6')](_0xcdbf('0xb4'));}this[_0xcdbf('0xf')]['noop'](util[_0xcdbf('0x2d')](_0xcdbf('0x1bf'),_0x24be8f[_0xcdbf('0x65')]));var _0x48a3a3=this[_0xcdbf('0x62')][_0xcdbf('0x77')](this,_0x24be8f);if(_0x48a3a3){this[_0xcdbf('0xf')][_0xcdbf('0xb6')](util[_0xcdbf('0x2d')](_0xcdbf('0x1c0'),_0x48a3a3));var _0x26a79e=this[_0xcdbf('0xf')][_0xcdbf('0x107')](_0x48a3a3);try{fs['unlink'](_0x48a3a3+_0xcdbf('0x109'));}catch(_0x85741){logger['error'](_0x85741);}return _0x26a79e;}return this[_0xcdbf('0xf')][_0xcdbf('0x31')](_0x24be8f,_0xcdbf('0x1c1'));};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0x1c2')]=function(_0x1a2585){logger[_0xcdbf('0x33')](util[_0xcdbf('0x2d')](_0xcdbf('0x1c3'),_0x1a2585[_0xcdbf('0x3e')]));_0x1a2585[_0xcdbf('0x65')]=_0x1a2585[_0xcdbf('0x65')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x1a2585[_0xcdbf('0x65')])){return this[_0xcdbf('0xf')]['noop'](_0xcdbf('0xb4'));}this[_0xcdbf('0xf')]['noop'](util[_0xcdbf('0x2d')](_0xcdbf('0x1c4'),_0x1a2585[_0xcdbf('0x65')]));var _0x285551=this[_0xcdbf('0x68')]['sync'](this,_0x1a2585);if(_0x285551){this[_0xcdbf('0xf')][_0xcdbf('0xb6')](util['format'](_0xcdbf('0x1c5'),_0x285551));var _0x1c53df=this[_0xcdbf('0xf')]['streamFile'](_0x285551);try{fs[_0xcdbf('0x108')](_0x285551+_0xcdbf('0x109'));}catch(_0xefb911){logger[_0xcdbf('0x31')](_0xefb911);}return _0x1c53df;}return this[_0xcdbf('0xf')][_0xcdbf('0x31')](_0x1a2585,_0xcdbf('0x1c6'));};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0x1c7')]=function(_0x853fb1){logger[_0xcdbf('0x33')](util['format'](_0xcdbf('0x1c8'),_0x853fb1[_0xcdbf('0x3e')]));if(!this[_0xcdbf('0x8f')](_0x853fb1[_0xcdbf('0x15b')])){return this[_0xcdbf('0xf')]['error'](_0x853fb1,_0xcdbf('0x159'));}logger[_0xcdbf('0x33')](util[_0xcdbf('0x2d')](_0xcdbf('0x15a'),this[_0xcdbf('0xf')][_0xcdbf('0x41')],_0x853fb1['findBy']));var _0x52e152=this[_0xcdbf('0x59')][_0xcdbf('0x77')](this,_0x853fb1['findBy']);if(_0x52e152){logger[_0xcdbf('0x33')](util[_0xcdbf('0x2d')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xcdbf('0xf')][_0xcdbf('0x41')],_0x853fb1['findBy']));this[_0xcdbf('0xf')][_0xcdbf('0xb6')](util[_0xcdbf('0x2d')](_0xcdbf('0x15c'),this['channel']['callerid'],_0x853fb1['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0xcdbf('0x33')](util[_0xcdbf('0x2d')](_0xcdbf('0x15d'),this[_0xcdbf('0xf')][_0xcdbf('0x41')],_0x853fb1[_0xcdbf('0x15b')]));this['channel'][_0xcdbf('0xb6')](util[_0xcdbf('0x2d')](_0xcdbf('0x15d'),this[_0xcdbf('0xf')][_0xcdbf('0x41')],_0x853fb1[_0xcdbf('0x15b')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0x1c9')]=function(_0x28b7fd){logger[_0xcdbf('0x33')](util[_0xcdbf('0x2d')](_0xcdbf('0x1ca'),_0x28b7fd[_0xcdbf('0x3e')]));var _0x3e9ddc=this[_0xcdbf('0xf')]['exec']('VOICEMAIL',[_0x28b7fd[_0xcdbf('0x1cb')],_0x28b7fd[_0xcdbf('0x80')]]);if(_0x3e9ddc[_0xcdbf('0xaf')]===-0x1){return _0x3e9ddc;}return this[_0xcdbf('0xf')]['noop'](util['format'](_0xcdbf('0x179'),_0xcdbf('0x1cc'),_0x28b7fd['mailbox']));};AGIVertices[_0xcdbf('0x16')][_0xcdbf('0x1cd')]=function(_0x376ef0){logger[_0xcdbf('0x33')](util[_0xcdbf('0x2d')](_0xcdbf('0x1ce'),_0x376ef0[_0xcdbf('0x3e')]));if(!this[_0xcdbf('0x8f')](_0x376ef0[_0xcdbf('0xe3')])){return this['channel'][_0xcdbf('0x31')](_0x376ef0,'no\x20variable\x20selected');}var _0x233932=this[_0xcdbf('0x12')][_0xcdbf('0x77')](this,_0x376ef0[_0xcdbf('0xe3')]);if(!_0x233932){return this[_0xcdbf('0xf')]['error'](_0x376ef0,_0xcdbf('0xe4'));}var _0x1c9172=this[_0xcdbf('0xf')][_0xcdbf('0x12')](_0x233932);return{'code':0xc8,'result':_0x1c9172[_0xcdbf('0xad')]?_0x1c9172[_0xcdbf('0xad')]:'-'};};String[_0xcdbf('0x16')][_0xcdbf('0xac')]=function(_0x1bca03,_0xb7daa2){return this[_0xcdbf('0xab')](_0x1bca03)[_0xcdbf('0x1cf')](_0xb7daa2);};module[_0xcdbf('0x1d0')]=AGIVertices; \ No newline at end of file +var _0x4b07=['Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','arg_1','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','system','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','apiKey','no\x20apiKey\x20configured','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','lodash','shelljs','randomstring','moment','mustache','request-promise','agi','/var/opt/motion2/server/files','rawHeaders','getdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getSound','getSoundById','getSoundPath','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','IntervalId','map','Intervals','interval','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','callerid','createSquareRecording','calleridname','priority','accountcode','dnid','createSquareMessage','createCmContact','isNil','callback_','random','isEmpty','lastName','phone','list_id','scheduledAt','Callback\x20scheduled\x20at\x20','toString','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','google_cloud_tts_text_type','text','en-US','ssmlGender','MALE','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','includes','PUT','body','rawBody','parse','computedVariables','sync','render','stringify','headers','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','googleDialogflow','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','private_key','ispeechTTS','key','ispeech_tts_language','ispeechASR','ispeech_asr_language','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appsecret','uri','clear','agicommand','clone','isString','replaceObjectAllVariables','hasOwnProperty','isPlainObject','recursiveNodeIndex','isArray','replaceAllVariables','saveRestApiResult','%s.%s','split','replaceAll','length','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','extra','setVariable','isConfigured','maxRetry','retry','no\x20text\x20configured','options','result','noop','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','MRCPSynth','lumenvoxasr','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','getSquareOdbc','odbc_id','no\x20query\x20configured','variable_id','forEach','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','DIALOGFLOW_%s','toUpperCase','speech','dialogflow','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','client_email','no\x20private_key\x20configured','dialogflowV2_language','no\x20anguage\x20configured','bot','Trying\x20DialogflowV2:\x20%s','providerResponse','out','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','ndauth_url','no\x20ndauth\x20url\x20configured','password','no\x20password\x20configured','Trying\x20SestekNDA:\x20%s','sestekNDA','SESTEK_NDA_%s','audiofile','unlink','SestekNDA\x20Result\x20%s','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','no\x20file\x20audio\x20selected','file_id','no\x20file\x20audio\x20found','no\x20variable\x20selected\x20for\x20the\x20result','response','maxdigit','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','streamFile','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','NOBEEP','intKey','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','appid','no\x20appid\x20configured','no\x20appsecret\x20configured','recordFile','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','context','extension','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','true','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20interval\x20configured','interval_id','no\x20intervals\x20found','IFTIME\x20%s\x20%s','hangup','ispeechasr','ISPEECH_ASR_%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20%s\x20file\x20created','.wav','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','AGENT\x20%s\x20NOT\x20FOUND\x20BY','Enter\x20in\x20LOGOUT\x20(%s)\x20block','success','failure','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','math\x20%s','menu','Enter\x20in\x20MENU\x20(%s)\x20block','getData','no\x20variable\x20found','Enter\x20in\x20NOOP\x20(%s)\x20block','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','getPause','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','indexOf','gosub','position','recordingFormat','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','number','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20found','Smtp','user','bcc','template_id','sendMail\x20message','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','sms_account_id','getSmsAccount','no\x20sms\x20account\x20found','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','yes','Answer','Skipped\x20Answer','subproject'];(function(_0x465701,_0x19417d){var _0x5e012e=function(_0x4fda3b){while(--_0x4fda3b){_0x465701['push'](_0x465701['shift']());}};_0x5e012e(++_0x19417d);}(_0x4b07,0x1d6));var _0x74b0=function(_0x4c317c,_0x4eef93){_0x4c317c=_0x4c317c-0x0;var _0x3bfb5a=_0x4b07[_0x4c317c];return _0x3bfb5a;};'use strict';var fs=require('fs');var util=require('util');var _=require(_0x74b0('0x0'));var sh=require(_0x74b0('0x1'));var odbc=require('odbc')();var rs=require(_0x74b0('0x2'));var moment=require(_0x74b0('0x3'));var Mustache=require(_0x74b0('0x4'));var rp=require(_0x74b0('0x5'));var logger=require('../../config/logger')(_0x74b0('0x6'));var config=require('../../config/environment');var shared=require('../../config/environment/shared');var scripts=require('./scripts');var FILES_PATH=_0x74b0('0x7');var recursiveMapAttributes=[_0x74b0('0x8'),'rawBody'];var verticesWithRetry=['menu',_0x74b0('0x9'),'getsecretdigits'];var AGIVertices=function(_0x2fb592,_0x36bb9d,_0x269a93){this[_0x74b0('0xa')]=_0x2fb592;this[_0x74b0('0xb')]=_0x36bb9d;this[_0x74b0('0xc')]=_0x269a93;};AGIVertices[_0x74b0('0xd')][_0x74b0('0xe')]=function(_0xcc3693,_0x12a169){this[_0x74b0('0xb')][_0x74b0('0xf')](_0xcc3693)[_0x74b0('0x10')](function(_0x308b10){_0x12a169(null,_0x308b10?_0x308b10[_0x74b0('0x11')]:![]);})[_0x74b0('0x12')](function(_0x4e9f47){_0x12a169(_0x4e9f47);});};AGIVertices[_0x74b0('0xd')][_0x74b0('0x13')]=function(_0x52dc45,_0xefd5f7){this['rpc'][_0x74b0('0x14')](_0x52dc45)[_0x74b0('0x10')](function(_0x4c7e56){_0xefd5f7(null,_0x4c7e56?_0x4c7e56[_0x74b0('0x11')]:![]);})['catch'](function(_0x3b002a){_0xefd5f7(_0x3b002a);});};AGIVertices['prototype'][_0x74b0('0x15')]=function(_0x547b94,_0x106de6){this[_0x74b0('0xb')][_0x74b0('0x16')](_0x547b94)[_0x74b0('0x10')](function(_0x26deb1){_0x106de6(null,_0x26deb1?_0x26deb1[_0x74b0('0x11')]:![]);})[_0x74b0('0x12')](function(_0x3079f0){_0x106de6(_0x3079f0);});};AGIVertices['prototype']['getSquareOdbc']=function(_0x55ccc1,_0x12fb6a){this['rpc'][_0x74b0('0x17')](_0x55ccc1)[_0x74b0('0x10')](function(_0xc17e43){_0x12fb6a(null,_0xc17e43?_0xc17e43[_0x74b0('0x18')]:![]);})['catch'](function(_0x18004b){_0x12fb6a(_0x18004b);});};AGIVertices[_0x74b0('0xd')][_0x74b0('0x19')]=function(_0xc6c020,_0x550ff7){this[_0x74b0('0xb')][_0x74b0('0x1a')](_0xc6c020)[_0x74b0('0x10')](function(_0x167dd7){_0x550ff7(null,_0x167dd7?_0x167dd7[_0x74b0('0x11')]:![]);})[_0x74b0('0x12')](function(_0x7259f4){_0x550ff7(_0x7259f4);});};AGIVertices[_0x74b0('0xd')][_0x74b0('0x1b')]=function(_0x54e2fd,_0x17bdf8){this['rpc']['getTrunkById'](_0x54e2fd)[_0x74b0('0x10')](function(_0x331cb1){_0x17bdf8(null,_0x331cb1?_0x331cb1[_0x74b0('0x11')]:![]);})['catch'](function(_0x4e08a1){_0x17bdf8(_0x4e08a1);});};AGIVertices[_0x74b0('0xd')][_0x74b0('0x1c')]=function(_0x531fee,_0x57c283){var _0x317b92=this;this[_0x74b0('0xb')][_0x74b0('0x1d')](_0x531fee)[_0x74b0('0x10')](function(_0x118ba5){_0x57c283(null,_0x118ba5?_0x317b92[_0x74b0('0x1e')](_0x118ba5['save_name']):![]);})[_0x74b0('0x12')](function(_0x5be6cb){_0x57c283(_0x5be6cb);});};AGIVertices[_0x74b0('0xd')][_0x74b0('0x1f')]=function(_0x4dfbdb,_0x2b93ae){this[_0x74b0('0xb')][_0x74b0('0x20')](_0x4dfbdb)['then'](function(_0x529abb){_0x2b93ae(null,_0x529abb?_0x529abb:![]);})['catch'](function(_0x11640a){_0x2b93ae(_0x11640a);});};AGIVertices[_0x74b0('0xd')]['sendMailMessage']=function(_0x198de5,_0x40c4f3,_0x3a77a4){this[_0x74b0('0xc')][_0x74b0('0x21')](_0x198de5,_0x40c4f3)[_0x74b0('0x10')](function(){_0x3a77a4(null);})['catch'](function(_0x476c32){_0x3a77a4(_0x476c32);});};AGIVertices[_0x74b0('0xd')][_0x74b0('0x22')]=function(_0x5615fb,_0x43a16b){this[_0x74b0('0xb')]['getIntervalById'](_0x5615fb)[_0x74b0('0x10')](function(_0x15b5e3){if(_0x15b5e3){if(_0x15b5e3[_0x74b0('0x23')]){_0x43a16b(null,[_0x15b5e3['interval']]);}else{_0x43a16b(null,_[_0x74b0('0x24')](_0x15b5e3[_0x74b0('0x25')],_0x74b0('0x26')));}}else{_0x43a16b(null,![]);}})['catch'](function(_0x5cdf7a){_0x43a16b(_0x5cdf7a);});};AGIVertices[_0x74b0('0xd')]['getSoundPath']=function(_0x24cd14){return util[_0x74b0('0x27')](_0x74b0('0x28'),FILES_PATH,_0x24cd14);};AGIVertices[_0x74b0('0xd')][_0x74b0('0x29')]=function(_0x41c8b7,_0x18987d,_0xe9af56){odbc[_0x74b0('0x2a')](_0x41c8b7,function(_0x27e8ef){if(_0x27e8ef){logger[_0x74b0('0x2b')](_0x74b0('0x2c'),_0x27e8ef);_0xe9af56(_0x27e8ef);}else{logger[_0x74b0('0x2d')](_0x74b0('0x2e'));odbc[_0x74b0('0x2f')](_0x18987d,function(_0x26e116,_0x4520b8){if(_0x26e116){logger[_0x74b0('0x2d')](_0x74b0('0x30'),_0x18987d);_0xe9af56(_0x26e116);}else{logger[_0x74b0('0x2d')](_0x74b0('0x31'),_0x18987d);odbc[_0x74b0('0x32')](function(_0x4713d7){if(_0x4713d7){logger[_0x74b0('0x2b')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x4713d7);}_0xe9af56(null,_0x4520b8);});}});}});};AGIVertices[_0x74b0('0xd')]['getSmsAccount']=function(_0x4c37bd,_0x4fe7da){this[_0x74b0('0xb')][_0x74b0('0x33')](_0x4c37bd)[_0x74b0('0x10')](function(_0x1531c2){_0x4fe7da(null,_0x1531c2?_0x1531c2:![]);})[_0x74b0('0x12')](function(_0x145f01){_0x4fe7da(_0x145f01);});};AGIVertices['prototype']['createSmsMessage']=function(_0x21ff78,_0x53b380){this[_0x74b0('0xb')][_0x74b0('0x34')](_0x21ff78)[_0x74b0('0x10')](function(_0x589b24){_0x53b380(null,_0x589b24);})['catch'](function(_0x4e20ec){_0x53b380(_0x4e20ec);});};AGIVertices[_0x74b0('0xd')][_0x74b0('0x35')]=function(_0xffc84,_0x3fbc9e,_0x4aed4e){this[_0x74b0('0xb')][_0x74b0('0x35')]({'uniqueid':this['channel'][_0x74b0('0x36')],'node':_0xffc84[_0x74b0('0x37')],'application':_0xffc84['agicommand'],'data':_0x3fbc9e||null,'project_name':this[_0x74b0('0xa')]['arg_1'],'callerid':this[_0x74b0('0xa')][_0x74b0('0x38')]})[_0x74b0('0x10')](function(_0x48925b){if(_0x4aed4e){_0x4aed4e(null,_0x48925b);}})['catch'](function(_0x14c22f){if(_0x4aed4e){_0x4aed4e(_0x14c22f);}});};AGIVertices['prototype'][_0x74b0('0x39')]=function(_0x5b43c6,_0x30ea94,_0x720d59,_0x120d00){this[_0x74b0('0xb')][_0x74b0('0x39')]({'uniqueid':this[_0x74b0('0xa')][_0x74b0('0x36')],'callerid':this[_0x74b0('0xa')][_0x74b0('0x38')],'calleridname':this[_0x74b0('0xa')][_0x74b0('0x3a')],'context':this[_0x74b0('0xa')]['context'],'extension':this[_0x74b0('0xa')]['extension'],'priority':this[_0x74b0('0xa')][_0x74b0('0x3b')],'accountcode':this[_0x74b0('0xa')][_0x74b0('0x3c')],'dnid':this[_0x74b0('0xa')][_0x74b0('0x3d')],'projectName':this['channel']['arg_1'],'saveName':_0x30ea94,'filename':_0x5b43c6['file']||_0x30ea94,'savePath':_0x720d59})['then'](function(_0x24ccc5){_0x120d00(null,_0x24ccc5);})[_0x74b0('0x12')](function(_0x507fb8){_0x120d00(_0x507fb8);});};AGIVertices[_0x74b0('0xd')][_0x74b0('0x3e')]=function(_0x163af6,_0x52636a,_0x3d8e39,_0x1fe49d,_0x3d4336){this[_0x74b0('0xb')]['createSquareMessage']({'uniqueid':this[_0x74b0('0xa')][_0x74b0('0x36')],'body':_0x163af6,'direction':_0x52636a,'providerName':_0x3d8e39,'providerResponse':_0x1fe49d})[_0x74b0('0x10')](function(_0x1afc24){if(_0x3d4336){_0x3d4336(null,_0x1afc24);}})['catch'](function(_0x391f7d){if(_0x3d4336){_0x3d4336(_0x391f7d);}});};AGIVertices[_0x74b0('0xd')][_0x74b0('0x3f')]=function(_0x1ecb14,_0x139e79){this[_0x74b0('0xb')]['createCmContact']({'firstName':_['isEmpty'](_0x1ecb14['name'])||_[_0x74b0('0x40')](_0x1ecb14[_0x74b0('0x11')])?_0x74b0('0x41')+Math[_0x74b0('0x42')]():_0x1ecb14[_0x74b0('0x11')],'lastName':_[_0x74b0('0x43')](_0x1ecb14['lastName'])||_['isNil'](_0x1ecb14[_0x74b0('0x44')])?null:_0x1ecb14['lastName'],'phone':_0x1ecb14[_0x74b0('0x45')],'ListId':_0x1ecb14[_0x74b0('0x46')],'scheduledat':_0x1ecb14[_0x74b0('0x47')],'callbackUniqueid':this[_0x74b0('0xa')]['uniqueid'],'tags':'callback','description':_0x74b0('0x48')+_0x1ecb14[_0x74b0('0x47')][_0x74b0('0x49')](),'priority':_0x1ecb14['callback_priority']})[_0x74b0('0x10')](function(_0x510307){_0x139e79(null,_0x510307);})[_0x74b0('0x12')](function(_0x2c501d){_0x139e79(_0x2c501d);});};AGIVertices['prototype']['getPause']=function(_0x23ffb7,_0xd50cbb){this[_0x74b0('0xb')]['getPauseById'](_0x23ffb7)['then'](function(_0x5a9d11){_0xd50cbb(null,_0x5a9d11?_0x5a9d11[_0x74b0('0x11')]:![]);})[_0x74b0('0x12')](function(_0x203129){_0xd50cbb(_0x203129);});};AGIVertices[_0x74b0('0xd')][_0x74b0('0x4a')]=function(_0x52c185,_0x12bd39,_0x2e527c){var _0x5737bc={'role':_0x74b0('0x4b')};_0x5737bc[_0x52c185]=this['channel']['callerid'];this['rpc'][_0x74b0('0x4a')](_0x5737bc,_0x12bd39,this['channel'][_0x74b0('0x36')])[_0x74b0('0x10')](function(_0x3fd856){_0x2e527c(null,_['isNil'](_0x3fd856)?![]:!![]);})[_0x74b0('0x12')](function(_0x17d6e9){logger[_0x74b0('0x2b')](_0x17d6e9);_0x2e527c(null,![]);});};AGIVertices[_0x74b0('0xd')]['agentUnpause']=function(_0x1f402a,_0x59f41e){var _0xf9874={'role':'agent'};_0xf9874[_0x1f402a]=this[_0x74b0('0xa')][_0x74b0('0x38')];this[_0x74b0('0xb')][_0x74b0('0x4c')](_0xf9874)['then'](function(_0x247ed0){_0x59f41e(null,_[_0x74b0('0x40')](_0x247ed0)?![]:!![]);})[_0x74b0('0x12')](function(_0x187d02){logger[_0x74b0('0x2b')](_0x187d02);_0x59f41e(null,![]);});};AGIVertices[_0x74b0('0xd')][_0x74b0('0x4d')]=function(_0x1f6859,_0x5a8dac){var _0x560117={'role':_0x74b0('0x4b')};_0x560117[_0x1f6859]=this[_0x74b0('0xa')]['callerid'];this['rpc'][_0x74b0('0x4d')](_0x560117)[_0x74b0('0x10')](function(_0x44fd05){_0x5a8dac(null,_[_0x74b0('0x40')](_0x44fd05)?![]:!![]);})[_0x74b0('0x12')](function(_0x2a39bf){logger[_0x74b0('0x2b')](_0x2a39bf);_0x5a8dac(null,![]);});};AGIVertices['prototype'][_0x74b0('0x4e')]=function(_0x446055,_0x50fe2d){var _0x41dbce={'role':_0x74b0('0x4b')};_0x41dbce[_0x446055]=this[_0x74b0('0xa')]['callerid'];var _0x30a115=_0x446055!=_0x74b0('0x4f')?util[_0x74b0('0x27')]('%s/%s@from-sip/n',_0x74b0('0x50'),this[_0x74b0('0xa')][_0x74b0('0x38')]):undefined;this['rpc'][_0x74b0('0x4e')](_0x41dbce,_0x30a115)['then'](function(_0x3fe7f8){_0x50fe2d(null,_['isNil'](_0x3fe7f8)?![]:!![]);})[_0x74b0('0x12')](function(_0xc7ded0){logger[_0x74b0('0x2b')](_0xc7ded0);_0x50fe2d(null,![]);});};AGIVertices['prototype'][_0x74b0('0x51')]=function(_0x10bd64,_0x79df8a){sh[_0x74b0('0x52')](_[_0x74b0('0x53')](_0x10bd64),function(_0x644fb2,_0x101d0c){var _0x234235=_0x101d0c[_0x74b0('0x54')](/(\r\n|\n|\r)/gm,'');_0x79df8a(null,_0x234235);});};AGIVertices[_0x74b0('0xd')][_0x74b0('0x55')]=function(_0x1aa9b5,_0x2cc749){scripts[_0x74b0('0x55')](_0x1aa9b5['apiKey'],_0x1aa9b5[_0x74b0('0x56')]||_0x74b0('0x57'),_0x1aa9b5['text'],_0x1aa9b5['languageCode']||_0x74b0('0x58'),_0x1aa9b5[_0x74b0('0x59')]||_0x74b0('0x5a'),_0x1aa9b5['audioEncoding']||_0x74b0('0x5b'))[_0x74b0('0x10')](function(_0x30d35c){_0x2cc749(null,_0x30d35c);})[_0x74b0('0x12')](function(_0xb457eb){_0x2cc749(_0xb457eb);});};AGIVertices[_0x74b0('0xd')][_0x74b0('0x5c')]=function(_0x2c467a,_0x4d19af){scripts[_0x74b0('0x5c')](_0x2c467a[_0x74b0('0x57')],_0x2c467a[_0x74b0('0x5d')]||'en',0x1)['then'](function(_0x39f4d3){_0x4d19af(null,_0x39f4d3);})[_0x74b0('0x12')](function(_0x1b3d70){_0x4d19af(_0x1b3d70);});};AGIVertices[_0x74b0('0xd')][_0x74b0('0x5e')]=function(_0x2a88ae,_0x1b95a1){var _0x22c9f8={'uri':_0x2a88ae[_0x74b0('0x5f')],'method':_0x2a88ae[_0x74b0('0x60')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x2a88ae[_0x74b0('0x61')])==='number'&&parseInt(_0x2a88ae[_0x74b0('0x61')])>=0x1?parseInt(_0x2a88ae[_0x74b0('0x61')])*0x3e8:0x5*0x3e8};if(_[_0x74b0('0x62')](['POST',_0x74b0('0x63')],_0x22c9f8[_0x74b0('0x60')]['toUpperCase']())){try{_0x22c9f8[_0x74b0('0x64')]=_0x2a88ae[_0x74b0('0x65')]?JSON[_0x74b0('0x66')](_0x2a88ae[_0x74b0('0x65')]):{};}catch(_0x35a3e6){logger[_0x74b0('0x2b')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x35a3e6);}}try{_0x22c9f8['headers']=_0x2a88ae[_0x74b0('0x8')]?JSON[_0x74b0('0x66')](_0x2a88ae[_0x74b0('0x8')]):{};}catch(_0x4415ea){logger[_0x74b0('0x2b')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x4415ea);}if(_0x2a88ae['computedVariables']){try{var _0x190d10=require(_0x2a88ae[_0x74b0('0x67')])[_0x74b0('0x68')](this,_0x22c9f8);_0x22c9f8['uri']=Mustache[_0x74b0('0x69')](_0x2a88ae['url'],_0x190d10,{},['$$','$$']);if(_0x22c9f8['headers']){_0x22c9f8['headers']=JSON[_0x74b0('0x66')](Mustache[_0x74b0('0x69')](JSON[_0x74b0('0x6a')](_0x22c9f8[_0x74b0('0x6b')]),_0x190d10,{},['$$','$$']));}if(_0x22c9f8[_0x74b0('0x64')]){_0x22c9f8[_0x74b0('0x64')]=JSON['parse'](Mustache[_0x74b0('0x69')](JSON[_0x74b0('0x6a')](_0x22c9f8[_0x74b0('0x64')]),_0x190d10,{},['$$','$$']));}}catch(_0x54eb6d){logger['error'](_0x74b0('0x6c'),_0x54eb6d);}}rp(_0x22c9f8)['then'](function(_0x16b216){var _0x503087={'statusCode':_0x16b216[_0x74b0('0x6d')]||0xc8,'statusMessage':_0x16b216[_0x74b0('0x6e')]||'OK','headers':_0x16b216[_0x74b0('0x6b')]||{},'body':_0x16b216[_0x74b0('0x64')]||{}};_0x1b95a1(null,_0x503087);})[_0x74b0('0x12')](function(_0x4c1190){var _0x1dae36={'statusCode':_0x4c1190[_0x74b0('0x6d')]||0x1f4,'statusMessage':_0x4c1190[_0x74b0('0x6f')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x4c1190['options']['headers']||{},'body':_0x4c1190['options'][_0x74b0('0x64')]||{}};_0x1b95a1(null,_0x1dae36);});};AGIVertices['prototype'][_0x74b0('0x70')]=function(_0xbe3561,_0x5e392d){scripts[_0x74b0('0x70')](this[_0x74b0('0xa')][_0x74b0('0x36')],_0xbe3561['key'],_0xbe3561['text'],_0xbe3561[_0x74b0('0x71')]||'en')[_0x74b0('0x10')](function(_0x493e38){_0x5e392d(null,_0x493e38);})[_0x74b0('0x12')](function(_0x28f8f6){_0x5e392d(_0x28f8f6);});};AGIVertices[_0x74b0('0xd')][_0x74b0('0x72')]=function(_0x53d338,_0x5c6d57){scripts[_0x74b0('0x72')](this[_0x74b0('0xa')]['uniqueid'],_0x53d338[_0x74b0('0x73')],_0x53d338['client_email'],_0x53d338[_0x74b0('0x74')],_0x53d338['text'],_0x53d338['dialogflowV2_language']||'en')[_0x74b0('0x10')](function(_0x378d1b){_0x5c6d57(null,_0x378d1b);})[_0x74b0('0x12')](function(_0x5784e6){_0x5c6d57(_0x5784e6);});};AGIVertices['prototype']['sestekNDA']=function(_0x214ac3,_0x402877){scripts['sestekNDA'](this['channel'],_0x214ac3)[_0x74b0('0x10')](function(_0x76cc1c){_0x402877(null,_0x76cc1c);})['catch'](function(_0x52f51f){_0x402877(_0x52f51f);});};AGIVertices[_0x74b0('0xd')]['ispeechTTS']=function(_0x20d28d,_0x230d8f){scripts[_0x74b0('0x75')](_0x20d28d[_0x74b0('0x76')],_0x20d28d[_0x74b0('0x57')],_0x20d28d[_0x74b0('0x77')]||_0x74b0('0x58'),_0x20d28d['speed'])[_0x74b0('0x10')](function(_0x498a44){_0x230d8f(null,_0x498a44);})['catch'](function(_0x2384e8){_0x230d8f(_0x2384e8);});};AGIVertices[_0x74b0('0xd')][_0x74b0('0x78')]=function(_0x52c4a7,_0x493283,_0x56cba5){scripts[_0x74b0('0x78')](_0x493283,_0x52c4a7[_0x74b0('0x76')],_0x52c4a7[_0x74b0('0x79')]||_0x74b0('0x58'),this['isConfigured'](_0x52c4a7[_0x74b0('0x7a')])?_0x52c4a7['model']:undefined)[_0x74b0('0x10')](function(_0x2b0aee){_0x56cba5(null,_0x2b0aee);})[_0x74b0('0x12')](function(_0x2f3954){_0x56cba5(_0x2f3954);});};AGIVertices[_0x74b0('0xd')][_0x74b0('0x7b')]=function(_0x4ab76a,_0x219852){scripts['awsPolly'](_0x4ab76a[_0x74b0('0x7c')],_0x4ab76a[_0x74b0('0x7d')],_0x4ab76a[_0x74b0('0x7e')],_0x4ab76a['aws_polly_voice']||'Amy',_0x4ab76a[_0x74b0('0x57')],_0x4ab76a['aws_text_type']||_0x74b0('0x57'))[_0x74b0('0x10')](function(_0x232363){_0x219852(null,_0x232363);})[_0x74b0('0x12')](function(_0xd98892){_0x219852(_0xd98892);});};AGIVertices[_0x74b0('0xd')][_0x74b0('0x7f')]=function(_0x483ee6,_0x5d7c5c){scripts[_0x74b0('0x7f')](this[_0x74b0('0xa')]['uniqueid'],_0x483ee6[_0x74b0('0x7c')],_0x483ee6[_0x74b0('0x7d')],_0x483ee6[_0x74b0('0x80')],_0x483ee6[_0x74b0('0x57')],_0x483ee6[_0x74b0('0x81')])[_0x74b0('0x10')](function(_0x3bfedd){_0x5d7c5c(null,_0x3bfedd);})[_0x74b0('0x12')](function(_0x4005da){_0x5d7c5c(_0x4005da);});};AGIVertices[_0x74b0('0xd')][_0x74b0('0x82')]=function(_0x462f43,_0x29b702,_0x37fae6){scripts[_0x74b0('0x82')](_0x29b702,_0x462f43[_0x74b0('0x76')],_0x462f43[_0x74b0('0x83')]||_0x74b0('0x58'))[_0x74b0('0x10')](function(_0x1a186d){_0x37fae6(null,_0x1a186d);})[_0x74b0('0x12')](function(_0x3efd5c){_0x37fae6(_0x3efd5c);});};AGIVertices[_0x74b0('0xd')][_0x74b0('0x84')]=function(_0x218103,_0x159f41,_0x563de2){scripts[_0x74b0('0x84')](_0x159f41,_0x218103['appid'],_0x218103[_0x74b0('0x85')],_0x218103[_0x74b0('0x86')])[_0x74b0('0x10')](function(_0x554b16){_0x563de2(null,_0x554b16);})[_0x74b0('0x12')](function(_0xc63dc6){_0x563de2(_0xc63dc6);});};AGIVertices[_0x74b0('0xd')][_0x74b0('0x87')]=function(_0x23c435){var _0x2243ea=_[_0x74b0('0x62')](verticesWithRetry,_0x23c435[_0x74b0('0x88')])?_0x23c435:_[_0x74b0('0x89')](_0x23c435);for(var _0x2f85e2 in _0x2243ea){if(_0x2243ea['hasOwnProperty'](_0x2f85e2)){if(_0x2243ea[_0x2f85e2]&&_[_0x74b0('0x8a')](_0x2243ea[_0x2f85e2])){if(_[_0x74b0('0x62')](recursiveMapAttributes,_0x2f85e2)){_0x2243ea[_0x2f85e2]=this[_0x74b0('0x8b')](_0x2243ea[_0x2f85e2]);}else{_0x2243ea[_0x2f85e2]=this['replaceAllVariables'](_0x2243ea[_0x2f85e2]);}}}}return _0x2243ea;};AGIVertices['prototype']['recursiveNodeIndex']=function(_0x2b9707){for(var _0x49816e in _0x2b9707){if(_0x2b9707[_0x74b0('0x8c')](_0x49816e)){if(_[_0x74b0('0x8d')](_0x2b9707[_0x49816e])){this[_0x74b0('0x8e')](_0x2b9707[_0x49816e]);}else if(_[_0x74b0('0x8f')](_0x2b9707[_0x49816e])){for(var _0x5a32be=0x0;_0x5a32be<_0x2b9707[_0x49816e]['length'];_0x5a32be++){this[_0x74b0('0x8e')](_0x2b9707[_0x49816e][_0x5a32be]);}}else if(_[_0x74b0('0x8a')](_0x2b9707[_0x49816e])){_0x2b9707[_0x49816e]=this[_0x74b0('0x90')](_0x2b9707[_0x49816e]);}}}};AGIVertices[_0x74b0('0xd')][_0x74b0('0x91')]=function(_0x3f06c0,_0xe79c25){for(var _0x51061f in _0x3f06c0){if(_0x3f06c0[_0x74b0('0x8c')](_0x51061f)){if(_[_0x74b0('0x8d')](_0x3f06c0[_0x51061f])){if(!_[_0x74b0('0x43')](_0x3f06c0[_0x51061f])){this['saveRestApiResult'](_0x3f06c0[_0x51061f],util['format'](_0x74b0('0x92'),_0xe79c25,_0x51061f));}}else if(_[_0x74b0('0x8f')](_0x3f06c0[_0x51061f])){for(var _0x1c789f=0x0;_0x1c789f<_0x3f06c0[_0x51061f]['length'];_0x1c789f++){this['saveRestApiResult'](_0x3f06c0[_0x51061f][_0x1c789f],util['format']('%s.%s',_0xe79c25,_0x51061f+'['+_0x1c789f+']'));}}else{if(!_[_0x74b0('0x40')](_0x3f06c0[_0x51061f])){this['channel']['setVariable'](util['format']('%s.%s',_0xe79c25,_0x51061f),_0x3f06c0[_0x51061f]);}}}}};AGIVertices[_0x74b0('0xd')][_0x74b0('0x8b')]=function(_0x23c595){try{var _0x1a17b0=JSON[_0x74b0('0x66')](_0x23c595);this[_0x74b0('0x8e')](_0x1a17b0);return JSON[_0x74b0('0x6a')](_0x1a17b0);}catch(_0x2a4a06){return this[_0x74b0('0x90')](_0x23c595);}};AGIVertices[_0x74b0('0xd')]['replaceAllVariables']=function(_0x70e10e){var _0x171f0d=_0x70e10e['split']('{');for(var _0x275033=0x1;_0x275033<_0x171f0d['length'];_0x275033+=0x1){var _0x4157b8=_0x171f0d[_0x275033][_0x74b0('0x93')]('}');if(_0x4157b8['length']>0x1){_0x70e10e=_0x70e10e[_0x74b0('0x94')]('{'+_0x4157b8[0x0]+'}',this['channel'][_0x74b0('0xe')](_0x4157b8[0x0])['extra']||_0x4157b8[0x0]);}}if(_0x171f0d[_0x74b0('0x95')]===0x1){return _0x70e10e[_0x74b0('0x49')]();}return this[_0x74b0('0x90')](_0x70e10e);};AGIVertices['prototype'][_0x74b0('0x96')]=function(_0x56661a,_0x4aa291){var _0x5df04c=this[_0x74b0('0xa')][_0x74b0('0xe')](_0x56661a);if(_0x5df04c['result']===-0x1){return _0x5df04c;}logger[_0x74b0('0x2d')](util[_0x74b0('0x27')](_0x74b0('0x97'),_0x4aa291,_0x5df04c[_0x74b0('0x98')]));return this[_0x74b0('0xa')][_0x74b0('0x99')](_0x4aa291,_0x5df04c[_0x74b0('0x98')]);};AGIVertices[_0x74b0('0xd')][_0x74b0('0x9a')]=function(_0x1fb422){return _0x1fb422&&_0x1fb422!=='0'&&_0x1fb422!=='-1'&&_0x1fb422!=='';};AGIVertices[_0x74b0('0xd')][_0x74b0('0x9b')]=function(_0x2e26ff){this[_0x74b0('0x35')][_0x74b0('0x68')](this,_0x2e26ff,'-');_0x2e26ff[_0x74b0('0x9c')]=_0x2e26ff[_0x74b0('0x9b')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x74b0('0xd')]['mrcpsynth']=function(_0x3332e2){logger[_0x74b0('0x2d')](util['format']('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x3332e2['label']));if(!this[_0x74b0('0x9a')](_0x3332e2['text'])){return this[_0x74b0('0xa')]['noop'](_0x74b0('0x9d'));}var _0x31b078='\x22'+_0x3332e2['text']+'\x22';if(this['isConfigured'](_0x3332e2[_0x74b0('0x9e')])){_0x31b078+=','+_0x3332e2[_0x74b0('0x9e')];}var _0xe2468f=this[_0x74b0('0xa')]['exec']('MRCPSynth',_0x31b078);if(_0xe2468f[_0x74b0('0x9f')]===-0x1){return _0xe2468f;}return this[_0x74b0('0xa')][_0x74b0('0xa0')](util['format'](_0x74b0('0xa1'),_0x31b078));};AGIVertices[_0x74b0('0xd')][_0x74b0('0xa2')]=function(_0x429722){logger[_0x74b0('0x2d')](util['format'](_0x74b0('0xa3'),_0x429722[_0x74b0('0x37')]));if(!this[_0x74b0('0x9a')](_0x429722[_0x74b0('0xa4')])){return this[_0x74b0('0xa')][_0x74b0('0xa0')]('no\x20grammar\x20configured');}var _0x557265=_0x429722[_0x74b0('0xa4')];if(this[_0x74b0('0x9a')](_0x429722['options'])){_0x557265+=','+_0x429722[_0x74b0('0x9e')];}var _0x4152e9=this[_0x74b0('0xa')][_0x74b0('0x52')](_0x74b0('0xa5'),_0x557265);if(_0x4152e9[_0x74b0('0x9f')]===-0x1){return _0x4152e9;}var _0x57ca7c=this['getAndSetVariable'](_0x74b0('0xa6'),_0x74b0('0xa7'));if(_0x57ca7c[_0x74b0('0x9f')]===-0x1){return _0x57ca7c;}var _0x92732d=this[_0x74b0('0x96')](_0x74b0('0xa8'),_0x74b0('0xa9'));if(_0x92732d[_0x74b0('0x9f')]===-0x1){return _0x92732d;}var _0x209cb0=this[_0x74b0('0x96')](_0x74b0('0xaa'),_0x74b0('0xab'));if(_0x209cb0[_0x74b0('0x9f')]===-0x1){return _0x209cb0;}return this[_0x74b0('0xa')]['noop'](util[_0x74b0('0x27')]('Executed\x20command\x20MRCPRecog\x20%s',_0x557265));};AGIVertices[_0x74b0('0xd')][_0x74b0('0x6')]=function(_0x4592e0){logger['info'](util[_0x74b0('0x27')](_0x74b0('0xac'),_0x4592e0[_0x74b0('0x37')]));return this['channel'][_0x74b0('0x6')]([_0x4592e0[_0x74b0('0xad')],_0x4592e0[_0x74b0('0xae')]]);};AGIVertices[_0x74b0('0xd')]['answer']=function(_0x36065b){logger[_0x74b0('0x2d')](util['format'](_0x74b0('0xaf'),_0x36065b[_0x74b0('0x37')]));if(this['isConfigured'](_0x36065b[_0x74b0('0x61')])){logger[_0x74b0('0x2d')](util[_0x74b0('0x27')](_0x74b0('0xb0'),_0x36065b[_0x74b0('0x61')]));var _0x594e26=this[_0x74b0('0xa')]['wait'](_0x36065b['timeout']);if(_0x594e26[_0x74b0('0x9f')]===-0x1){return _0x594e26;}}return this[_0x74b0('0xa')]['answer']();};AGIVertices[_0x74b0('0xd')][_0x74b0('0xb1')]=function(_0x5c7b4a){logger[_0x74b0('0x2d')](util[_0x74b0('0x27')](_0x74b0('0xb2'),_0x5c7b4a[_0x74b0('0x37')]));if(!this[_0x74b0('0x9a')](_0x5c7b4a[_0x74b0('0x46')])){return this[_0x74b0('0xa')][_0x74b0('0x2b')](_0x5c7b4a,'no\x20list\x20selected');}_0x5c7b4a[_0x74b0('0x47')]=moment();if(this['isConfigured'](_0x5c7b4a['delay'])){_0x5c7b4a[_0x74b0('0x47')]=moment()['add'](_0x5c7b4a['delay'],'minutes');}if(!this[_0x74b0('0x9a')](_0x5c7b4a['callback_priority'])){_0x5c7b4a['callback_priority']=0x2;}this[_0x74b0('0x3f')][_0x74b0('0x68')](this,_0x5c7b4a);return this[_0x74b0('0xa')]['noop'](util[_0x74b0('0x27')](_0x74b0('0xb3'),_0x5c7b4a['phone'],_0x5c7b4a[_0x74b0('0x46')],_0x5c7b4a[_0x74b0('0x47')]));};AGIVertices[_0x74b0('0xd')][_0x74b0('0xb4')]=function(_0x150e3e){logger['info'](util[_0x74b0('0x27')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x150e3e[_0x74b0('0x37')]));var _0x1b2fd6=this[_0x74b0('0xa')][_0x74b0('0x52')](_0x150e3e[_0x74b0('0xb5')],_0x150e3e[_0x74b0('0x9e')]);if(_0x1b2fd6[_0x74b0('0x9f')]===-0x1){return _0x1b2fd6;}return this['channel'][_0x74b0('0xa0')](util['format'](_0x74b0('0xb6'),_0x150e3e[_0x74b0('0xb5')],_0x150e3e[_0x74b0('0x9e')]));};AGIVertices['prototype'][_0x74b0('0xb7')]=function(_0x1fa355){logger[_0x74b0('0x2d')](util[_0x74b0('0x27')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x1fa355[_0x74b0('0x37')]));if(!this[_0x74b0('0x9a')](_0x1fa355[_0x74b0('0x57')])){return this[_0x74b0('0xa')]['noop']('no\x20text\x20configured');}var _0x5c2f43='\x22'+_0x1fa355[_0x74b0('0x57')]+'\x22';if(this['isConfigured'](_0x1fa355[_0x74b0('0x9e')])){_0x5c2f43+=','+_0x1fa355[_0x74b0('0x9e')];}var _0xd78680=this[_0x74b0('0xa')]['exec'](_0x74b0('0xb8'),_0x5c2f43);if(_0xd78680[_0x74b0('0x9f')]===-0x1){return _0xd78680;}return this[_0x74b0('0xa')][_0x74b0('0xa0')](util[_0x74b0('0x27')]('Executed\x20command\x20MRCPSynth\x20%s',_0x5c2f43));};AGIVertices[_0x74b0('0xd')]['sestektts']=function(_0x34b05b){logger[_0x74b0('0x2d')](util[_0x74b0('0x27')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x34b05b[_0x74b0('0x37')]));if(!this['isConfigured'](_0x34b05b[_0x74b0('0x57')])){return this[_0x74b0('0xa')][_0x74b0('0xa0')](_0x74b0('0x9d'));}var _0x4a503d='\x22'+_0x34b05b[_0x74b0('0x57')]+'\x22';if(this['isConfigured'](_0x34b05b[_0x74b0('0x9e')])){_0x4a503d+=','+_0x34b05b[_0x74b0('0x9e')];}var _0x48d11c=this[_0x74b0('0xa')][_0x74b0('0x52')](_0x74b0('0xb8'),_0x4a503d);if(_0x48d11c[_0x74b0('0x9f')]===-0x1){return _0x48d11c;}return this[_0x74b0('0xa')][_0x74b0('0xa0')](util[_0x74b0('0x27')](_0x74b0('0xa1'),_0x4a503d));};AGIVertices['prototype'][_0x74b0('0xb9')]=function(_0x337b3e){logger[_0x74b0('0x2d')](util[_0x74b0('0x27')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x337b3e[_0x74b0('0x37')]));if(!this[_0x74b0('0x9a')](_0x337b3e[_0x74b0('0xa4')])){return this['channel'][_0x74b0('0xa0')]('no\x20grammar\x20configured');}var _0x1209f8=_0x337b3e['grammar'];if(this[_0x74b0('0x9a')](_0x337b3e[_0x74b0('0x9e')])){_0x1209f8+=','+_0x337b3e[_0x74b0('0x9e')];}var _0x313d7c=this['channel'][_0x74b0('0x52')](_0x74b0('0xa5'),_0x1209f8);if(_0x313d7c[_0x74b0('0x9f')]===-0x1){return _0x313d7c;}var _0x1a819c=this['getAndSetVariable'](_0x74b0('0xa6'),_0x74b0('0xba'));if(_0x1a819c[_0x74b0('0x9f')]===-0x1){return _0x1a819c;}var _0x44472c=this[_0x74b0('0x96')](_0x74b0('0xa8'),_0x74b0('0xbb'));if(_0x44472c[_0x74b0('0x9f')]===-0x1){return _0x44472c;}var _0x2c7e0f=this[_0x74b0('0x96')]('RECOG_INSTANCE()',_0x74b0('0xbc'));if(_0x2c7e0f[_0x74b0('0x9f')]===-0x1){return _0x2c7e0f;}return this['channel']['noop'](util[_0x74b0('0x27')](_0x74b0('0xbd'),_0x1209f8));};AGIVertices['prototype'][_0x74b0('0xbe')]=function(_0x3698a1){logger['info'](util[_0x74b0('0x27')](_0x74b0('0xbf'),_0x3698a1[_0x74b0('0x37')]));if(!this[_0x74b0('0x9a')](_0x3698a1[_0x74b0('0xa4')])){return this['channel'][_0x74b0('0xa0')]('no\x20grammar\x20configured');}var _0x1260cd=_0x3698a1[_0x74b0('0xa4')];if(this['isConfigured'](_0x3698a1[_0x74b0('0x9e')])){_0x1260cd+=','+_0x3698a1[_0x74b0('0x9e')];}var _0x5d4701=this[_0x74b0('0xa')]['exec'](_0x74b0('0xa5'),_0x1260cd);if(_0x5d4701[_0x74b0('0x9f')]===-0x1){return _0x5d4701;}var _0x524fb5=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0x74b0('0xc0'));if(_0x524fb5[_0x74b0('0x9f')]===-0x1){return _0x524fb5;}var _0x77082d=this[_0x74b0('0x96')]('RECOG_INPUT()',_0x74b0('0xc1'));if(_0x77082d['result']===-0x1){return _0x77082d;}var _0x1623cc=this[_0x74b0('0x96')]('RECOG_INSTANCE()','SESTEK_ASR_INSTANCE');if(_0x1623cc[_0x74b0('0x9f')]===-0x1){return _0x1623cc;}return this[_0x74b0('0xa')][_0x74b0('0xa0')](util['format'](_0x74b0('0xbd'),_0x1260cd));};AGIVertices[_0x74b0('0xd')][_0x74b0('0xc2')]=function(_0x43aadd){logger[_0x74b0('0x2d')](util[_0x74b0('0x27')](_0x74b0('0xc3'),_0x43aadd[_0x74b0('0x37')]));if(!this[_0x74b0('0x9a')](_0x43aadd['odbc_id'])){return this['channel'][_0x74b0('0x2b')](_0x43aadd,_0x74b0('0xc4'));}var _0x3164f4=this[_0x74b0('0xc5')][_0x74b0('0x68')](this,_0x43aadd[_0x74b0('0xc6')]);if(!_0x3164f4){return this['channel'][_0x74b0('0x2b')](_0x43aadd,'no\x20odbc\x20database\x20found');}if(!this[_0x74b0('0x9a')](_0x43aadd[_0x74b0('0x2f')])){return this['channel'][_0x74b0('0x2b')](_0x43aadd,_0x74b0('0xc7'));}var _0x4a9618=_0x43aadd['query'][_0x74b0('0x54')](/(\r\n|\n|\r)/gm,'\x20');this[_0x74b0('0xa')][_0x74b0('0xa0')](util[_0x74b0('0x27')]('query:\x20%s',_0x4a9618));var _0x52a69b=this['getQueryOdbc']['sync'](this,_0x3164f4,_0x4a9618);this[_0x74b0('0x35')][_0x74b0('0x68')](this,_0x43aadd,_0x4a9618);if(!this[_0x74b0('0x9a')](_0x43aadd['variable_id'])){return this[_0x74b0('0xa')][_0x74b0('0xa0')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x389030=this[_0x74b0('0xe')]['sync'](this,_0x43aadd[_0x74b0('0xc8')]);if(!_0x389030){return this['channel'][_0x74b0('0x2b')](_0x43aadd,'no\x20variable\x20found');}var _0x326975=this;_0x52a69b[_0x74b0('0xc9')](function(_0xd304ed,_0x17bfaf){Object['keys'](_0xd304ed)[_0x74b0('0xc9')](function(_0x47f578){_0x326975[_0x74b0('0xa')][_0x74b0('0x99')](util[_0x74b0('0x27')](_0x74b0('0xca'),_0x389030,_0x17bfaf,_0x47f578),_0xd304ed[_0x47f578]);});});this['channel'][_0x74b0('0x99')](util[_0x74b0('0x27')](_0x74b0('0xcb'),_0x389030),_0x52a69b['length']);return this[_0x74b0('0xa')][_0x74b0('0xa0')](util['format'](_0x74b0('0xcc'),_0x389030));};AGIVertices[_0x74b0('0xd')][_0x74b0('0xcd')]=function(_0x5a30ac){logger[_0x74b0('0xce')](util['format'](_0x74b0('0xcf'),_0x5a30ac['label']));if(!this[_0x74b0('0x9a')](_0x5a30ac[_0x74b0('0xd0')])){return this[_0x74b0('0xa')][_0x74b0('0x2b')](_0x5a30ac,_0x74b0('0xd1'));}var _0x625064=this[_0x74b0('0x19')][_0x74b0('0x68')](this,_0x5a30ac['sip_id']);if(!_0x625064){return this[_0x74b0('0xa')]['error'](_0x5a30ac,_0x74b0('0xd2'));}var _0x5172b7=this['channel'][_0x74b0('0x52')](_0x74b0('0xd3'),[util['format'](_0x74b0('0xd4'),_0x625064),_0x5a30ac[_0x74b0('0x61')],_0x5a30ac[_0x74b0('0xd5')],_0x5a30ac[_0x74b0('0x5f')]]);if(_0x5172b7[_0x74b0('0x9f')]===-0x1){return _0x5172b7;}return this[_0x74b0('0xa')]['noop'](util[_0x74b0('0x27')](_0x74b0('0xd6'),'DIAL'));};AGIVertices['prototype']['dialogflow']=function(_0x4defb1){logger[_0x74b0('0x2d')](util[_0x74b0('0x27')](_0x74b0('0xd7'),_0x4defb1[_0x74b0('0x37')]));if(!this['isConfigured'](_0x4defb1[_0x74b0('0x76')])){return this[_0x74b0('0xa')][_0x74b0('0xa0')](_0x74b0('0xd8'));}if(!this[_0x74b0('0x9a')](_0x4defb1[_0x74b0('0x57')])){return this[_0x74b0('0xa')]['noop'](_0x74b0('0x9d'));}this['channel']['bot']=!![];this[_0x74b0('0x35')](_0x4defb1);this[_0x74b0('0x3e')](_0x4defb1[_0x74b0('0x57')],'in','','');this['channel'][_0x74b0('0xa0')](util['format']('Trying\x20Dialogflow:\x20%s',_0x4defb1[_0x74b0('0x57')]));var _0x47364d=this[_0x74b0('0x70')]['sync'](this,_0x4defb1);if(_0x47364d){for(var _0x45f3e2 in _0x47364d){if(_0x47364d[_0x74b0('0x8c')](_0x45f3e2)){this[_0x74b0('0xa')][_0x74b0('0x99')](util['format'](_0x74b0('0xd9'),_0x45f3e2[_0x74b0('0xda')]()),_0x47364d[_0x45f3e2]);}}this[_0x74b0('0x3e')](_0x47364d[_0x74b0('0xdb')],'out',_0x74b0('0xdc'),'');return this[_0x74b0('0xa')][_0x74b0('0xa0')](util['format'](_0x74b0('0xdd'),_0x47364d[_0x74b0('0xdb')]));}return this[_0x74b0('0xa')][_0x74b0('0x2b')](_0x4defb1,_0x74b0('0xde'));};AGIVertices[_0x74b0('0xd')][_0x74b0('0xdf')]=function(_0x1ac795){logger[_0x74b0('0x2d')](util['format'](_0x74b0('0xe0'),_0x1ac795['label']));if(!this['isConfigured'](_0x1ac795[_0x74b0('0x73')])){return this[_0x74b0('0xa')]['noop']('no\x20project_id\x20configured');}if(!this['isConfigured'](_0x1ac795[_0x74b0('0xe1')])){return this[_0x74b0('0xa')][_0x74b0('0xa0')]('no\x20client_email\x20configured');}if(!this[_0x74b0('0x9a')](_0x1ac795[_0x74b0('0x74')])){return this[_0x74b0('0xa')][_0x74b0('0xa0')](_0x74b0('0xe2'));}if(!this[_0x74b0('0x9a')](_0x1ac795[_0x74b0('0xe3')])){return this[_0x74b0('0xa')]['noop'](_0x74b0('0xe4'));}if(!this[_0x74b0('0x9a')](_0x1ac795['text'])){return this[_0x74b0('0xa')][_0x74b0('0xa0')](_0x74b0('0x9d'));}this[_0x74b0('0xa')][_0x74b0('0xe5')]=!![];this[_0x74b0('0x35')](_0x1ac795);this[_0x74b0('0x3e')](_0x1ac795[_0x74b0('0x57')],'in','','');this[_0x74b0('0xa')][_0x74b0('0xa0')](util[_0x74b0('0x27')](_0x74b0('0xe6'),_0x1ac795['text']));var _0x38baef=this[_0x74b0('0x72')][_0x74b0('0x68')](this,_0x1ac795);if(_0x38baef){for(var _0x44391b in _0x38baef){if(_0x38baef['hasOwnProperty'](_0x44391b)){if(_0x44391b!==_0x74b0('0xe7')){this[_0x74b0('0xa')][_0x74b0('0x99')](util[_0x74b0('0x27')]('DIALOGFLOW_%s',_0x44391b[_0x74b0('0xda')]()),_0x38baef[_0x44391b]);}}}this[_0x74b0('0x3e')](_0x38baef[_0x74b0('0xdb')],_0x74b0('0xe8'),_0x74b0('0xdf'),_0x38baef[_0x74b0('0xe7')]);return this['channel']['noop'](util[_0x74b0('0x27')](_0x74b0('0xe9'),_0x38baef[_0x74b0('0xdb')]));}return this[_0x74b0('0xa')]['error'](_0x1ac795,_0x74b0('0xea'));};AGIVertices[_0x74b0('0xd')][_0x74b0('0xeb')]=function(_0x2db92f){logger[_0x74b0('0x2d')](util[_0x74b0('0x27')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x2db92f['label']));if(!this[_0x74b0('0x9a')](_0x2db92f[_0x74b0('0xec')])){return this[_0x74b0('0xa')][_0x74b0('0xa0')](_0x74b0('0xed'));}if(!this[_0x74b0('0x9a')](_0x2db92f['username'])){return this[_0x74b0('0xa')][_0x74b0('0xa0')]('no\x20username\x20configured');}if(!this[_0x74b0('0x9a')](_0x2db92f[_0x74b0('0xee')])){return this[_0x74b0('0xa')]['noop'](_0x74b0('0xef'));}if(!this['isConfigured'](_0x2db92f['ndassistant_url'])){return this['channel'][_0x74b0('0xa0')](_0x74b0('0x9d'));}this[_0x74b0('0xa')]['bot']=!![];this['createSquareDetailsReport'](_0x2db92f);this[_0x74b0('0x3e')](_0x2db92f[_0x74b0('0x57')],'in','','');this['channel'][_0x74b0('0xa0')](util[_0x74b0('0x27')](_0x74b0('0xf0'),_0x2db92f[_0x74b0('0x57')]));var _0x53b2be=this[_0x74b0('0xf1')]['sync'](this,_0x2db92f);if(_0x53b2be){for(var _0x3e1f2d in _0x53b2be){if(_0x53b2be[_0x74b0('0x8c')](_0x3e1f2d)){this[_0x74b0('0xa')][_0x74b0('0x99')](util[_0x74b0('0x27')](_0x74b0('0xf2'),_0x3e1f2d[_0x74b0('0xda')]()),_0x53b2be[_0x3e1f2d]);}}this['createSquareMessage'](_0x53b2be[_0x74b0('0xdb')],_0x74b0('0xe8'),_0x74b0('0xeb'),'');if(_0x53b2be['audiofile']){this['channel'][_0x74b0('0xa0')](util['format']('Sestek\x20NDA\x20%s\x20file\x20created',_0x53b2be['audiofile']));var _0x4fd2b6=this[_0x74b0('0xa')]['streamFile'](_0x53b2be[_0x74b0('0xf3')]);try{fs[_0x74b0('0xf4')](_0x53b2be[_0x74b0('0xf3')]+'.wav');}catch(_0x80faad){logger['error'](_0x80faad);}return _0x4fd2b6;}else{return this[_0x74b0('0xa')][_0x74b0('0xa0')](util['format'](_0x74b0('0xf5'),_0x53b2be[_0x74b0('0xdb')]));}}return this[_0x74b0('0xa')][_0x74b0('0x2b')](_0x2db92f,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0x74b0('0xd')][_0x74b0('0xf6')]=function(_0x5189da){logger[_0x74b0('0x2d')](util[_0x74b0('0x27')](_0x74b0('0xf7'),_0x5189da[_0x74b0('0x37')]));return this[_0x74b0('0xa')]['noop']('end');};AGIVertices[_0x74b0('0xd')][_0x74b0('0xf8')]=function(_0x3baaeb){logger['info'](util[_0x74b0('0x27')](_0x74b0('0xf9'),_0x3baaeb[_0x74b0('0x37')]));var _0x3604e2='';if(_0x3baaeb[_0x74b0('0xfa')]){if(!this[_0x74b0('0x9a')](_0x3baaeb[_0x74b0('0xfa')])){return this['channel'][_0x74b0('0x2b')](_0x3baaeb,_0x74b0('0xfb'));}else{var _0x40a329=parseInt(_0x3baaeb[_0x74b0('0xfa')],0xa);if(isNaN(_0x40a329)){_0x3604e2=_0x3baaeb[_0x74b0('0xfa')];}else{_0x3604e2=this['getTrunk'][_0x74b0('0x68')](this,_0x3baaeb[_0x74b0('0xfa')]);if(!_0x3604e2){return this[_0x74b0('0xa')][_0x74b0('0x2b')](_0x3baaeb,_0x74b0('0xfc'));}}}}else if(_0x3baaeb[_0x74b0('0xfd')]){_0x3604e2=_0x3baaeb[_0x74b0('0xfd')];}else{return this[_0x74b0('0xa')][_0x74b0('0x2b')](_0x3baaeb,'no\x20trunk\x20selected');}var _0x386435=this[_0x74b0('0xa')][_0x74b0('0x52')]('DIAL',[util[_0x74b0('0x27')](_0x74b0('0xfe'),_0x3604e2,_0x3baaeb[_0x74b0('0x45')]),_0x3baaeb['timeout'],_0x3baaeb[_0x74b0('0xd5')],_0x3baaeb[_0x74b0('0x5f')]]);if(_0x386435[_0x74b0('0x9f')]===-0x1){return _0x386435;}return this[_0x74b0('0xa')][_0x74b0('0xa0')](util['format'](_0x74b0('0xd6'),_0x74b0('0xd3')));};AGIVertices[_0x74b0('0xd')]['finally']=function(_0x16ceed){logger[_0x74b0('0x2d')](util[_0x74b0('0x27')](_0x74b0('0xff'),_0x16ceed['label']));return this[_0x74b0('0xa')][_0x74b0('0xa0')](_0x74b0('0x100'));};AGIVertices['prototype']['getdigits']=function(_0x3a4b05){logger[_0x74b0('0x2d')](util[_0x74b0('0x27')](_0x74b0('0x101'),_0x3a4b05[_0x74b0('0x37')]));if(_0x3a4b05[_0x74b0('0x9c')]===0x0){return this['maxRetry'](_0x3a4b05);}_0x3a4b05[_0x74b0('0x9c')]-=0x1;if(!this[_0x74b0('0x9a')](_0x3a4b05['file_id'])){return this[_0x74b0('0xa')]['error'](_0x3a4b05,_0x74b0('0x102'));}var _0x361856=this[_0x74b0('0x1c')][_0x74b0('0x68')](this,_0x3a4b05[_0x74b0('0x103')]);if(!_0x361856){return this[_0x74b0('0xa')][_0x74b0('0x2b')](_0x3a4b05,_0x74b0('0x104'));}if(!this['isConfigured'](_0x3a4b05[_0x74b0('0xc8')])){return this[_0x74b0('0xa')]['error'](_0x74b0('0x105'));}var _0x14cfab=this['channel']['getData'](_0x361856,_0x3a4b05[_0x74b0('0x106')],_0x3a4b05[_0x74b0('0x107')]);var _0x33c1a7=_0x14cfab['result']?_0x14cfab[_0x74b0('0x9f')][_0x74b0('0x49')]():'';logger['info']('test',JSON[_0x74b0('0x6a')](_0x14cfab));if(_0x14cfab[_0x74b0('0x9f')]===-0x1){this['createSquareDetailsReport']['sync'](this,_0x3a4b05,_0x33c1a7);return _0x14cfab;}else if(_0x14cfab[_0x74b0('0x98')]==='timeout'){_0x14cfab[_0x74b0('0x9f')]=_0x33c1a7[_0x74b0('0x95')]>=parseInt(_0x3a4b05[_0x74b0('0x108')])?'x':'i';}else{_0x14cfab[_0x74b0('0x9f')]=_0x33c1a7[_0x74b0('0x95')]>=parseInt(_0x3a4b05[_0x74b0('0x108')])&&_0x33c1a7[_0x74b0('0x95')]<=parseInt(_0x3a4b05['maxdigit'])?'x':'i';}var _0x318711=this['getVariable'][_0x74b0('0x68')](this,_0x3a4b05[_0x74b0('0xc8')]);if(!_0x318711){return this[_0x74b0('0xa')]['error'](_0x3a4b05,'no\x20variable\x20found');}this[_0x74b0('0xa')][_0x74b0('0x99')](_0x318711,_0x33c1a7);if(this[_0x74b0('0x9a')](_0x3a4b05['hiddendigitsnum'])){var _0x231d8e=parseInt(_0x3a4b05[_0x74b0('0x109')],0xa);var _0x31fb0e=rs[_0x74b0('0x10a')]({'charset':'*','length':_0x231d8e});var _0x4569bc=_0x33c1a7[_0x74b0('0x95')];if(_0x4569bc>0x0){if(_0x4569bc>_0x231d8e){this[_0x74b0('0x35')][_0x74b0('0x68')](this,_0x3a4b05,_0x3a4b05[_0x74b0('0x10b')]===_0x74b0('0x10c')?_0x31fb0e+_0x33c1a7[_0x74b0('0x10d')](_0x231d8e):_0x33c1a7[_0x74b0('0x10d')](0x0,_0x4569bc-_0x231d8e)+_0x31fb0e);}else{this['createSquareDetailsReport'][_0x74b0('0x68')](this,_0x3a4b05,rs[_0x74b0('0x10a')]({'charset':'*','length':_0x4569bc}));}}else{this[_0x74b0('0x35')]['sync'](this,_0x3a4b05,'');}}else{this[_0x74b0('0x35')][_0x74b0('0x68')](this,_0x3a4b05,_0x33c1a7);}return _0x14cfab;};AGIVertices[_0x74b0('0xd')][_0x74b0('0x10e')]=function(_0x36d729){logger[_0x74b0('0x2d')](util[_0x74b0('0x27')](_0x74b0('0x10f'),_0x36d729[_0x74b0('0x37')]));return this[_0x74b0('0x9')](_0x36d729);};AGIVertices[_0x74b0('0xd')]['goal']=function(_0x6880ea){logger[_0x74b0('0x2d')](util['format'](_0x74b0('0x110'),_0x6880ea['label']));this[_0x74b0('0x35')][_0x74b0('0x68')](this,_0x6880ea,_0x6880ea[_0x74b0('0x111')]);return this[_0x74b0('0xa')]['noop'](util[_0x74b0('0x27')](_0x74b0('0x112'),_0x6880ea[_0x74b0('0x111')]));};AGIVertices[_0x74b0('0xd')][_0x74b0('0x113')]=function(_0xb33d64){logger[_0x74b0('0x2d')](util[_0x74b0('0x27')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0xb33d64['label']));if(!this[_0x74b0('0x9a')](_0xb33d64[_0x74b0('0x7c')])||!this[_0x74b0('0x9a')](_0xb33d64['aws_secret_access_key'])){return this[_0x74b0('0xa')][_0x74b0('0xa0')](_0x74b0('0x114'));}if(!this['isConfigured'](_0xb33d64[_0x74b0('0x57')])){return this[_0x74b0('0xa')][_0x74b0('0xa0')](_0x74b0('0x9d'));}this[_0x74b0('0xa')]['noop'](util[_0x74b0('0x27')](_0x74b0('0x115'),_0xb33d64[_0x74b0('0x57')]));var _0x4096be=this[_0x74b0('0x7b')][_0x74b0('0x68')](this,_0xb33d64);if(_0x4096be){this['channel'][_0x74b0('0xa0')](util['format'](_0x74b0('0x116'),_0x4096be));var _0x47cf9d=this[_0x74b0('0xa')][_0x74b0('0x117')](_0x4096be);try{fs[_0x74b0('0xf4')](_0x4096be+'.wav');}catch(_0x1e2669){logger[_0x74b0('0x2b')](_0x1e2669);}return _0x47cf9d;}return this[_0x74b0('0xa')][_0x74b0('0x2b')](_0xb33d64,_0x74b0('0x118'));};AGIVertices[_0x74b0('0xd')][_0x74b0('0x119')]=function(_0x4d3697){logger[_0x74b0('0x2d')](util[_0x74b0('0x27')](_0x74b0('0x11a'),_0x4d3697['label']));if(!this[_0x74b0('0x9a')](_0x4d3697[_0x74b0('0x7c')])||!this[_0x74b0('0x9a')](_0x4d3697[_0x74b0('0x7d')])){return this[_0x74b0('0xa')]['noop']('no\x20valid\x20credentials\x20configured');}if(!this[_0x74b0('0x9a')](_0x4d3697[_0x74b0('0x81')])){return this[_0x74b0('0xa')]['noop'](_0x74b0('0x11b'));}if(!this[_0x74b0('0x9a')](_0x4d3697[_0x74b0('0x57')])){return this[_0x74b0('0xa')][_0x74b0('0xa0')](_0x74b0('0x9d'));}this['channel'][_0x74b0('0xe5')]=!![];this[_0x74b0('0x35')](_0x4d3697);this[_0x74b0('0x3e')](_0x4d3697[_0x74b0('0x57')],'in','','');this['channel']['noop'](util[_0x74b0('0x27')]('Trying\x20Amazon\x20Lex:\x20%s',_0x4d3697[_0x74b0('0x57')]));var _0x3173e1=this[_0x74b0('0x7f')]['sync'](this,_0x4d3697);if(_0x3173e1){for(var _0x49153a in _0x3173e1){if(_0x3173e1['hasOwnProperty'](_0x49153a)&&_['isString'](_0x3173e1[_0x49153a])){this[_0x74b0('0xa')][_0x74b0('0x99')](util[_0x74b0('0x27')](_0x74b0('0x11c'),_0x49153a[_0x74b0('0xda')]()),_0x3173e1[_0x49153a]);}}if(_[_0x74b0('0x40')](_0x3173e1['message'])){return this[_0x74b0('0xa')][_0x74b0('0xa0')](_0x74b0('0x11d'));}else{this[_0x74b0('0x3e')](_0x3173e1[_0x74b0('0x6f')],_0x74b0('0xe8'),'amazonlex','');return this[_0x74b0('0xa')][_0x74b0('0xa0')](util[_0x74b0('0x27')](_0x74b0('0x11e'),_0x3173e1[_0x74b0('0x6f')]));}}return this[_0x74b0('0xa')][_0x74b0('0x2b')](_0x4d3697,_0x74b0('0x11f'));};AGIVertices['prototype'][_0x74b0('0x120')]=function(_0xfea59c){logger[_0x74b0('0x2d')](util['format'](_0x74b0('0x121'),_0xfea59c['label'],_0xfea59c[_0x74b0('0x61')]));if(!this[_0x74b0('0x9a')](_0xfea59c[_0x74b0('0x76')])){return this[_0x74b0('0xa')][_0x74b0('0xa0')](_0x74b0('0xd8'));}var _0x2e1a95=_0x74b0('0x122');var _0x29c33f=util['format'](_0x74b0('0x123'),FILES_PATH,rs[_0x74b0('0x10a')](0x4));var _0x2559f9=util[_0x74b0('0x27')]('%s.%s',_0x29c33f,_0x2e1a95);var _0x265ad5=!![];if(_0xfea59c[_0x74b0('0x124')]===_0x74b0('0x125')){_0x265ad5=![];}var _0x5ac5cc=this[_0x74b0('0xa')]['recordFile'](_0x29c33f,_0x2e1a95,_0xfea59c[_0x74b0('0x126')],_0xfea59c[_0x74b0('0x61')],undefined,_0x265ad5);if(_0x5ac5cc[_0x74b0('0x9f')]!==-0x1){this[_0x74b0('0xa')][_0x74b0('0xa0')](util[_0x74b0('0x27')]('google\x20%s\x20file\x20created',_0x2559f9));var _0x16760d=this['googleASR'][_0x74b0('0x68')](this,_0xfea59c,_0x2559f9);if(_0x16760d){for(var _0x2a4c9b in _0x16760d){if(_0x16760d['hasOwnProperty'](_0x2a4c9b)){this[_0x74b0('0xa')]['setVariable'](util[_0x74b0('0x27')]('GOOGLE_ASR_%s',_0x2a4c9b[_0x74b0('0xda')]()),_0x16760d[_0x2a4c9b]);}}return this[_0x74b0('0xa')][_0x74b0('0xa0')](util[_0x74b0('0x27')](_0x74b0('0x127'),JSON['stringify'](_0x16760d)));}}return _0x5ac5cc;};AGIVertices[_0x74b0('0xd')][_0x74b0('0x128')]=function(_0x2cef55){logger[_0x74b0('0x2d')](util[_0x74b0('0x27')](_0x74b0('0x129'),_0x2cef55[_0x74b0('0x37')]));if(!this['isConfigured'](_0x2cef55[_0x74b0('0x12a')])){return this['channel'][_0x74b0('0xa0')](_0x74b0('0x12b'));}if(!this[_0x74b0('0x9a')](_0x2cef55[_0x74b0('0x85')])){return this[_0x74b0('0xa')]['noop'](_0x74b0('0x12c'));}var _0x50a765=_0x74b0('0x122');var _0x5330a6=util[_0x74b0('0x27')](_0x74b0('0x123'),FILES_PATH,rs[_0x74b0('0x10a')](0x4));var _0x16e5cf=util[_0x74b0('0x27')](_0x74b0('0x92'),_0x5330a6,_0x50a765);var _0x1e427b=!![];if(_0x2cef55['beep']===_0x74b0('0x125')){_0x1e427b=![];}var _0x4e448e=this['channel'][_0x74b0('0x12d')](_0x5330a6,_0x50a765,_0x2cef55['intKey'],_0x2cef55['timeout'],undefined,_0x1e427b);if(_0x4e448e['result']!==-0x1){this[_0x74b0('0xa')][_0x74b0('0xa0')](util['format'](_0x74b0('0x12e'),_0x16e5cf));var _0x540c78=this['tildeASR'][_0x74b0('0x68')](this,_0x2cef55,_0x16e5cf);if(_0x540c78){for(var _0x59128e in _0x540c78){if(_0x540c78['hasOwnProperty'](_0x59128e)){this['channel'][_0x74b0('0x99')](util[_0x74b0('0x27')]('TILDE_ASR_%s',_0x59128e[_0x74b0('0xda')]()),_0x540c78[_0x59128e]);}}return this['channel'][_0x74b0('0xa0')](util['format'](_0x74b0('0x12f'),JSON[_0x74b0('0x6a')](_0x540c78)));}}return _0x4e448e;};AGIVertices['prototype'][_0x74b0('0x130')]=function(_0x27d76f){logger[_0x74b0('0x2d')](util['format'](_0x74b0('0x131'),_0x27d76f[_0x74b0('0x37')]));return this[_0x74b0('0xa')][_0x74b0('0x132')](_0x27d76f[_0x74b0('0x133')],_0x27d76f[_0x74b0('0x134')],_0x27d76f[_0x74b0('0x3b')]);};AGIVertices[_0x74b0('0xd')][_0x74b0('0x135')]=function(_0xf09837){logger[_0x74b0('0x2d')](util[_0x74b0('0x27')](_0x74b0('0x136'),_0xf09837[_0x74b0('0x37')]));if(!this['isConfigured'](_0xf09837['condition'])){return this[_0x74b0('0xa')][_0x74b0('0x2b')](_0xf09837,'no\x20condition\x20configured');}try{var _0x22fc9c=eval(_0xf09837['condition'])?_0x74b0('0x137'):_0x74b0('0x138');this[_0x74b0('0xa')][_0x74b0('0xa0')](util[_0x74b0('0x27')]('EVAL\x20CONDITION\x20%s\x20%s',_0xf09837['condition'],_0x22fc9c));return{'code':0xc8,'result':_0x22fc9c};}catch(_0x588748){return{'code':0xc8,'result':_0x74b0('0x138')};}};AGIVertices[_0x74b0('0xd')][_0x74b0('0x139')]=function(_0x335b8c){logger[_0x74b0('0x2d')](util['format'](_0x74b0('0x13a'),_0x335b8c[_0x74b0('0x37')]));if(!this['isConfigured'](_0x335b8c['interval_id'])){return this['channel'][_0x74b0('0x2b')](_0x335b8c,_0x74b0('0x13b'));}var _0x18c868=this['getIntervals'][_0x74b0('0x68')](this,_0x335b8c[_0x74b0('0x13c')]);if(!_0x18c868){return this[_0x74b0('0xa')][_0x74b0('0x2b')](_0x335b8c,_0x74b0('0x13d'));}for(var _0x5d8775=0x0;_0x5d8775<_0x18c868[_0x74b0('0x95')];_0x5d8775+=0x1){var _0xdd1ef3=this[_0x74b0('0xa')][_0x74b0('0xe')](util[_0x74b0('0x27')]('IFTIME(%s?true:false)',_0x18c868[_0x5d8775]));if(_0xdd1ef3[_0x74b0('0x9f')]===-0x1){return _0xdd1ef3;}logger['info'](util[_0x74b0('0x27')]('IFTIME\x20%s\x20%s',_0x18c868[_0x5d8775],_0xdd1ef3[_0x74b0('0x98')]));if(_0xdd1ef3[_0x74b0('0x98')]===_0x74b0('0x137')){logger[_0x74b0('0x2d')](util[_0x74b0('0x27')]('IFTIME\x20%s\x20%s',_0x18c868[_0x5d8775],_0x74b0('0x137')));this[_0x74b0('0xa')]['noop'](util[_0x74b0('0x27')](_0x74b0('0x13e'),_0x18c868[_0x5d8775],_0x74b0('0x137')));return{'code':0xc8,'result':'true'};}else{logger[_0x74b0('0x2d')](util[_0x74b0('0x27')](_0x74b0('0x13e'),_0x18c868[_0x5d8775],'false'));this['channel']['noop'](util[_0x74b0('0x27')](_0x74b0('0x13e'),_0x18c868[_0x5d8775],'false'));}}return{'code':0xc8,'result':_0x74b0('0x138')};};AGIVertices[_0x74b0('0xd')][_0x74b0('0x13f')]=function(_0x25a745){logger[_0x74b0('0x2d')](util[_0x74b0('0x27')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x25a745[_0x74b0('0x37')]));return this[_0x74b0('0xa')][_0x74b0('0x13f')]();};AGIVertices[_0x74b0('0xd')][_0x74b0('0x140')]=function(_0x34112b){logger[_0x74b0('0x2d')](util[_0x74b0('0x27')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x34112b[_0x74b0('0x37')]));if(!this[_0x74b0('0x9a')](_0x34112b['key'])){return this[_0x74b0('0xa')][_0x74b0('0xa0')](_0x74b0('0xd8'));}var _0x917718=_0x74b0('0x122');var _0x13acce=util['format']('%s/recordings/%s',FILES_PATH,rs[_0x74b0('0x10a')](0x4));var _0x2accc0=util[_0x74b0('0x27')]('%s.%s',_0x13acce,_0x917718);var _0x4ce393=!![];if(_0x34112b['beep']===_0x74b0('0x125')){_0x4ce393=![];}var _0x28a60c=this['channel'][_0x74b0('0x12d')](_0x13acce,_0x917718,_0x34112b['intKey'],_0x34112b['timeout'],undefined,_0x4ce393);if(_0x28a60c[_0x74b0('0x9f')]!==-0x1){this[_0x74b0('0xa')][_0x74b0('0xa0')](util[_0x74b0('0x27')]('ispeech\x20%s\x20file\x20created',_0x2accc0));var _0xd742f=this[_0x74b0('0x78')]['sync'](this,_0x34112b,_0x2accc0);if(_0xd742f){for(var _0x1d2403 in _0xd742f){if(_0xd742f[_0x74b0('0x8c')](_0x1d2403)){this[_0x74b0('0xa')][_0x74b0('0x99')](util[_0x74b0('0x27')](_0x74b0('0x141'),_0x1d2403[_0x74b0('0xda')]()),_0xd742f[_0x1d2403]);}}return this['channel'][_0x74b0('0xa0')](util[_0x74b0('0x27')]('IspeechASR\x20Result\x20%s',JSON['stringify'](_0xd742f)));}}return _0x28a60c;};AGIVertices['prototype'][_0x74b0('0x142')]=function(_0x55f69c){logger[_0x74b0('0x2d')](util['format'](_0x74b0('0x143'),_0x55f69c[_0x74b0('0x37')]));if(!this[_0x74b0('0x9a')](_0x55f69c['key'])){return this[_0x74b0('0xa')]['noop'](_0x74b0('0xd8'));}if(!this[_0x74b0('0x9a')](_0x55f69c['text'])){return this[_0x74b0('0xa')][_0x74b0('0xa0')](_0x74b0('0x9d'));}this[_0x74b0('0xa')][_0x74b0('0xa0')](util[_0x74b0('0x27')](_0x74b0('0x144'),_0x55f69c['text']));var _0x456709=this[_0x74b0('0x75')][_0x74b0('0x68')](this,_0x55f69c);if(_0x456709){this['channel'][_0x74b0('0xa0')](util['format'](_0x74b0('0x145'),_0x456709));var _0x2b6142=this[_0x74b0('0xa')][_0x74b0('0x117')](_0x456709,_0x55f69c['intKey']);try{fs[_0x74b0('0xf4')](_0x456709+_0x74b0('0x146'));}catch(_0x223b77){logger['error'](_0x223b77);}return _0x2b6142;}return this[_0x74b0('0xa')][_0x74b0('0x2b')](_0x55f69c,_0x74b0('0x147'));};AGIVertices[_0x74b0('0xd')][_0x74b0('0x148')]=function(_0x5e5d7e){logger[_0x74b0('0x2d')](util[_0x74b0('0x27')](_0x74b0('0x149'),_0x5e5d7e['label']));if(!this['isConfigured'](_0x5e5d7e[_0x74b0('0x14a')])){return this['channel'][_0x74b0('0x2b')](_0x5e5d7e,_0x74b0('0x14b'));}logger['info'](util[_0x74b0('0x27')](_0x74b0('0x14c'),this[_0x74b0('0xa')]['callerid'],_0x5e5d7e[_0x74b0('0x14a')]));var _0x3db8d1=this[_0x74b0('0x4e')][_0x74b0('0x68')](this,_0x5e5d7e[_0x74b0('0x14a')]);if(_0x3db8d1){logger[_0x74b0('0x2d')](util['format'](_0x74b0('0x14d'),this['channel'][_0x74b0('0x38')],_0x5e5d7e['findBy']));this[_0x74b0('0xa')]['noop'](util[_0x74b0('0x27')](_0x74b0('0x14d'),this[_0x74b0('0xa')][_0x74b0('0x38')],_0x5e5d7e[_0x74b0('0x14a')]));return{'code':0xc8,'result':'success'};}else{logger[_0x74b0('0x2d')](util[_0x74b0('0x27')](_0x74b0('0x14e'),this['channel'][_0x74b0('0x38')],_0x5e5d7e[_0x74b0('0x14a')]));this[_0x74b0('0xa')][_0x74b0('0xa0')](util[_0x74b0('0x27')](_0x74b0('0x14e'),this[_0x74b0('0xa')]['callerid'],_0x5e5d7e[_0x74b0('0x14a')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype']['logout']=function(_0x4bebf1){logger[_0x74b0('0x2d')](util['format'](_0x74b0('0x14f'),_0x4bebf1[_0x74b0('0x37')]));if(!this[_0x74b0('0x9a')](_0x4bebf1['findBy'])){return this[_0x74b0('0xa')][_0x74b0('0x2b')](_0x4bebf1,'no\x20find\x20by\x20configured');}logger[_0x74b0('0x2d')](util[_0x74b0('0x27')](_0x74b0('0x14c'),this[_0x74b0('0xa')][_0x74b0('0x38')],_0x4bebf1[_0x74b0('0x14a')]));var _0xc22528=this[_0x74b0('0x4d')][_0x74b0('0x68')](this,_0x4bebf1[_0x74b0('0x14a')]);if(_0xc22528){logger[_0x74b0('0x2d')](util[_0x74b0('0x27')](_0x74b0('0x14d'),this[_0x74b0('0xa')][_0x74b0('0x38')],_0x4bebf1['findBy']));this[_0x74b0('0xa')][_0x74b0('0xa0')](util[_0x74b0('0x27')](_0x74b0('0x14d'),this[_0x74b0('0xa')][_0x74b0('0x38')],_0x4bebf1[_0x74b0('0x14a')]));return{'code':0xc8,'result':_0x74b0('0x150')};}else{logger[_0x74b0('0x2d')](util['format'](_0x74b0('0x14e'),this[_0x74b0('0xa')][_0x74b0('0x38')],_0x4bebf1[_0x74b0('0x14a')]));this[_0x74b0('0xa')][_0x74b0('0xa0')](util[_0x74b0('0x27')](_0x74b0('0x14e'),this[_0x74b0('0xa')]['callerid'],_0x4bebf1[_0x74b0('0x14a')]));return{'code':0xc8,'result':_0x74b0('0x151')};}};AGIVertices[_0x74b0('0xd')][_0x74b0('0x152')]=function(_0x2d3097){logger[_0x74b0('0x2d')](util[_0x74b0('0x27')](_0x74b0('0x153'),_0x2d3097[_0x74b0('0x37')]));if(!this['isConfigured'](_0x2d3097[_0x74b0('0x154')])){return this[_0x74b0('0xa')][_0x74b0('0x2b')](_0x2d3097,'no\x20operation\x20configured');}this[_0x74b0('0xa')][_0x74b0('0xa0')](util[_0x74b0('0x27')](_0x74b0('0x155'),_0x2d3097[_0x74b0('0x154')]));var _0x30ee7c=eval(_0x2d3097[_0x74b0('0x154')]);if(!this[_0x74b0('0x9a')](_0x2d3097[_0x74b0('0xc8')])){return this[_0x74b0('0xa')][_0x74b0('0xa0')](_0x74b0('0x105'));}var _0x50a647=this['getVariable'][_0x74b0('0x68')](this,_0x2d3097[_0x74b0('0xc8')]);if(!_0x50a647){return this[_0x74b0('0xa')][_0x74b0('0x2b')](_0x2d3097,'no\x20variable\x20found');}if(_['isArray'](_0x30ee7c)){var _0x572788=this;_0x30ee7c[_0x74b0('0xc9')](function(_0x400da7,_0x344dc4){_0x572788[_0x74b0('0xa')][_0x74b0('0x99')](util['format']('%s[%s]',_0x50a647,_0x344dc4),_0x400da7);});return this['channel'][_0x74b0('0xa0')](util[_0x74b0('0x27')]('variable\x20%s[key]\x20set',_0x50a647));}else{return this[_0x74b0('0xa')][_0x74b0('0x99')](_0x50a647,_0x30ee7c);}};AGIVertices['prototype'][_0x74b0('0x156')]=function(_0x252b36){logger[_0x74b0('0x2d')](util[_0x74b0('0x27')](_0x74b0('0x157'),_0x252b36['label']));if(_0x252b36[_0x74b0('0x9c')]===0x0){return this[_0x74b0('0x9b')](_0x252b36);}_0x252b36[_0x74b0('0x9c')]-=0x1;if(!this[_0x74b0('0x9a')](_0x252b36[_0x74b0('0x103')])){return this[_0x74b0('0xa')][_0x74b0('0x2b')](_0x252b36,_0x74b0('0x102'));}var _0x228804=this['getSound'][_0x74b0('0x68')](this,_0x252b36['file_id']);if(!_0x228804){return this[_0x74b0('0xa')][_0x74b0('0x2b')](_0x252b36,'no\x20file\x20audio\x20found');}var _0x43ab9c=this[_0x74b0('0xa')][_0x74b0('0x158')](_0x228804,_0x252b36['response'],_0x252b36['digit']);var _0x1fe7c2=_0x43ab9c['result'];if(_0x43ab9c[_0x74b0('0x9f')]===-0x1){this['createSquareDetailsReport'][_0x74b0('0x68')](this,_0x252b36,'-1');return _0x43ab9c;}else if(_0x43ab9c[_0x74b0('0x98')]===_0x74b0('0x61')){_0x43ab9c['result']=_0x43ab9c[_0x74b0('0x9f')][_0x74b0('0x95')]>0x0?_0x43ab9c[_0x74b0('0x9f')]:'t';}else if(_['isEmpty'](_0x43ab9c['result'])){_0x43ab9c[_0x74b0('0x9f')]='#';_0x1fe7c2='#';}if(!this[_0x74b0('0x9a')](_0x252b36['variable_id'])){this['channel']['noop'](_0x74b0('0x105'));}else{var _0x59cb2e=this[_0x74b0('0xe')][_0x74b0('0x68')](this,_0x252b36['variable_id']);if(!_0x59cb2e){return this[_0x74b0('0xa')]['error'](_0x252b36,_0x74b0('0x159'));}this[_0x74b0('0xa')][_0x74b0('0x99')](_0x59cb2e,_0x1fe7c2);}this[_0x74b0('0x35')]['sync'](this,_0x252b36,_0x1fe7c2);return _0x43ab9c;};AGIVertices['prototype'][_0x74b0('0xa0')]=function(_0x4826ef){logger[_0x74b0('0x2d')](util[_0x74b0('0x27')](_0x74b0('0x15a'),_0x4826ef[_0x74b0('0x37')]));return this[_0x74b0('0xa')]['noop'](_0x4826ef[_0x74b0('0x15b')]||_0x4826ef[_0x74b0('0x37')]);};AGIVertices[_0x74b0('0xd')]['pause']=function(_0x56eb83){logger[_0x74b0('0x2d')](util[_0x74b0('0x27')](_0x74b0('0x15c'),_0x56eb83[_0x74b0('0x37')]));if(!this[_0x74b0('0x9a')](_0x56eb83[_0x74b0('0x14a')])){return this[_0x74b0('0xa')][_0x74b0('0x2b')](_0x56eb83,_0x74b0('0x14b'));}logger[_0x74b0('0x2d')](util[_0x74b0('0x27')](_0x74b0('0x14c'),this[_0x74b0('0xa')]['callerid'],_0x56eb83[_0x74b0('0x14a')]));var _0x3f8619=this[_0x74b0('0x15d')][_0x74b0('0x68')](this,_0x56eb83[_0x74b0('0x15e')]);var _0x4a8c3e=this['agentPause']['sync'](this,_0x56eb83[_0x74b0('0x14a')],_0x3f8619);if(_0x4a8c3e){logger['info'](util[_0x74b0('0x27')](_0x74b0('0x14d'),this[_0x74b0('0xa')][_0x74b0('0x38')],_0x56eb83['findBy']));this[_0x74b0('0xa')][_0x74b0('0xa0')](util[_0x74b0('0x27')](_0x74b0('0x14d'),this[_0x74b0('0xa')][_0x74b0('0x38')],_0x56eb83[_0x74b0('0x14a')]));return{'code':0xc8,'result':_0x74b0('0x150')};}else{logger[_0x74b0('0x2d')](util[_0x74b0('0x27')](_0x74b0('0x14e'),this[_0x74b0('0xa')][_0x74b0('0x38')],_0x56eb83[_0x74b0('0x14a')]));this[_0x74b0('0xa')]['noop'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x74b0('0x38')],_0x56eb83[_0x74b0('0x14a')]));return{'code':0xc8,'result':_0x74b0('0x151')};}};AGIVertices[_0x74b0('0xd')][_0x74b0('0x15f')]=function(_0xd94323){logger[_0x74b0('0x2d')](util[_0x74b0('0x27')](_0x74b0('0x160'),_0xd94323[_0x74b0('0x37')]));if(!this['isConfigured'](_0xd94323[_0x74b0('0x103')])){return this[_0x74b0('0xa')][_0x74b0('0x2b')](_0xd94323,_0x74b0('0x102'));}var _0x34fceb=this[_0x74b0('0x1c')][_0x74b0('0x68')](this,_0xd94323[_0x74b0('0x103')]);if(!_0x34fceb){return this['channel'][_0x74b0('0x2b')](_0xd94323,'no\x20file\x20audio\x20found');}var _0x23a608=this[_0x74b0('0xa')][_0x74b0('0x52')](_0x74b0('0x161'),[_0x34fceb,_0xd94323['opts']]);if(_0x23a608[_0x74b0('0x9f')]===-0x1){return _0x23a608;}return this[_0x74b0('0xa')][_0x74b0('0xa0')](util[_0x74b0('0x27')]('Executed\x20command\x20%s\x20%s',_0x74b0('0x161'),_0x34fceb));};AGIVertices[_0x74b0('0xd')][_0x74b0('0x162')]=function(_0x187ad0){logger['info'](util[_0x74b0('0x27')](_0x74b0('0x163'),_0x187ad0['label']));if(!this[_0x74b0('0x9a')](_0x187ad0[_0x74b0('0x164')])){return this[_0x74b0('0xa')][_0x74b0('0x2b')](_0x187ad0,_0x74b0('0x165'));}var _0x48ee4b='';var _0x247842=parseInt(_0x187ad0[_0x74b0('0x164')],0xa);if(isNaN(_0x247842)){_0x48ee4b=_0x187ad0[_0x74b0('0x164')];}else{_0x48ee4b=this[_0x74b0('0x13')][_0x74b0('0x68')](this,_0x187ad0[_0x74b0('0x164')]);if(!_0x48ee4b){return this[_0x74b0('0xa')][_0x74b0('0x2b')](_0x187ad0,'no\x20queue\x20found');}}var _0x45cdb4='';if(this['isConfigured'](_0x187ad0[_0x74b0('0x103')])){var _0x40d27f=this['getSound'][_0x74b0('0x68')](this,_0x187ad0[_0x74b0('0x103')]);if(_0x40d27f){_0x45cdb4=_0x40d27f;}}this[_0x74b0('0x35')]['sync'](this,_0x187ad0,_0x48ee4b);if(_0x187ad0['opts'][_0x74b0('0x166')]('x')<0x0){_0x187ad0[_0x74b0('0xd5')]+='x';}if(_0x187ad0['opts']['indexOf']('X')<0x0){_0x187ad0['opts']+='X';}this['channel'][_0x74b0('0x99')]('XMCS-QUEUE',_0x48ee4b?_0x48ee4b['toLowerCase']():'');var _0x2745b6=this[_0x74b0('0xa')]['exec']('QUEUE',[_0x48ee4b,_0x187ad0[_0x74b0('0xd5')],_0x187ad0[_0x74b0('0x5f')],_0x45cdb4,_0x187ad0[_0x74b0('0x61')],_0x187ad0[_0x74b0('0x6')],_0x187ad0['macro'],_0x187ad0[_0x74b0('0x167')],'',_0x187ad0[_0x74b0('0x168')]]);if(_0x2745b6[_0x74b0('0x9f')]===-0x1){return _0x2745b6;}return this[_0x74b0('0xa')]['noop'](util[_0x74b0('0x27')]('Executed\x20command\x20%s\x20%s','QUEUE',_0x48ee4b));};AGIVertices[_0x74b0('0xd')]['record']=function(_0x5c27ce){logger['info'](util['format']('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x5c27ce['label']));var _0x191e16=_0x5c27ce[_0x74b0('0x169')]||_0x74b0('0x122');var _0x47eccc=util[_0x74b0('0x27')]('%s_%s',this[_0x74b0('0xa')][_0x74b0('0x36')],rs['generate'](0x5));var _0xfd38b6=util[_0x74b0('0x27')]('%s/recordings/%s.%s',FILES_PATH,_0x47eccc,_0x191e16);var _0x324c42=util['format'](_0x74b0('0x123'),FILES_PATH,_0x47eccc);this[_0x74b0('0x39')][_0x74b0('0x68')](this,_0x5c27ce,_0x47eccc,_0xfd38b6);this[_0x74b0('0xa')]['setVariable'](_0x74b0('0x16a'),_0x47eccc);logger[_0x74b0('0x2d')](_0x74b0('0x16b'),_0x324c42,_0x191e16,_0x5c27ce[_0x74b0('0x16c')],_0x5c27ce[_0x74b0('0x61')]);return this[_0x74b0('0xa')][_0x74b0('0x12d')](_0x324c42,_0x191e16,_0x5c27ce[_0x74b0('0x16c')],_0x5c27ce[_0x74b0('0x61')],undefined,!![]);};AGIVertices[_0x74b0('0xd')]['restapi']=function(_0x3dff2c){logger[_0x74b0('0x2d')](util[_0x74b0('0x27')](_0x74b0('0x16d'),_0x3dff2c[_0x74b0('0x37')]));if(!this[_0x74b0('0x9a')](_0x3dff2c[_0x74b0('0x5f')])){return this[_0x74b0('0xa')][_0x74b0('0xa0')](_0x74b0('0x16e'));}var _0x1e0f67=this[_0x74b0('0x5e')]['sync'](this,_0x3dff2c);logger[_0x74b0('0x2d')](util['format'](_0x74b0('0x16f'),util[_0x74b0('0x170')](_0x1e0f67,{'showHidden':![],'depth':null})));if(!this[_0x74b0('0x9a')](_0x3dff2c[_0x74b0('0xc8')])){return this['channel'][_0x74b0('0xa0')](_0x74b0('0x171'));}var _0x170605=this[_0x74b0('0xe')][_0x74b0('0x68')](this,_0x3dff2c[_0x74b0('0xc8')]);if(!_0x170605){return this['channel'][_0x74b0('0x2b')](_0x3dff2c,_0x74b0('0x159'));}this['channel']['setVariable'](util[_0x74b0('0x27')](_0x74b0('0x172'),_0x170605),_0x1e0f67['statusCode']?_0x1e0f67['statusCode']:_0x74b0('0x173'));this['channel'][_0x74b0('0x99')](util['format'](_0x74b0('0x174'),_0x170605),_0x1e0f67[_0x74b0('0x6e')]?_0x1e0f67['statusMessage']:'OK');if(_0x1e0f67[_0x74b0('0x64')]){try{this['saveRestApiResult'](_0x1e0f67[_0x74b0('0x64')],_0x170605);}catch(_0x3c5d0c){logger[_0x74b0('0x2b')](util['format']('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x170605));}}return this[_0x74b0('0xa')][_0x74b0('0xa0')](util[_0x74b0('0x27')](_0x74b0('0xcc'),_0x170605));};AGIVertices['prototype'][_0x74b0('0x175')]=function(_0x2b9e83){logger[_0x74b0('0x2d')](util[_0x74b0('0x27')](_0x74b0('0x176'),_0x2b9e83[_0x74b0('0x37')]));return this[_0x74b0('0xa')][_0x74b0('0x177')](_0x2b9e83[_0x74b0('0x178')]['replace'](/\s+/g,''),_0x2b9e83['escape_digits']);};AGIVertices['prototype'][_0x74b0('0x179')]=function(_0x2c3c52){logger[_0x74b0('0x2d')](util[_0x74b0('0x27')](_0x74b0('0x17a'),_0x2c3c52['label']));return this['channel'][_0x74b0('0x17b')](_0x2c3c52[_0x74b0('0x17c')]['replace'](/\s+/g,''),_0x2c3c52[_0x74b0('0x16c')]);};AGIVertices[_0x74b0('0xd')][_0x74b0('0x17d')]=function(_0x597973){logger[_0x74b0('0x2d')](util[_0x74b0('0x27')](_0x74b0('0x17e'),_0x597973[_0x74b0('0x37')]));return this[_0x74b0('0xa')][_0x74b0('0x17f')](_0x597973['text'],_0x597973['escape_digits']);};AGIVertices[_0x74b0('0xd')][_0x74b0('0x180')]=function(_0x39dfa1){logger[_0x74b0('0x2d')](util[_0x74b0('0x27')](_0x74b0('0x181'),_0x39dfa1[_0x74b0('0x37')]));if(!this[_0x74b0('0x9a')](_0x39dfa1[_0x74b0('0x182')])){return this[_0x74b0('0xa')][_0x74b0('0xa0')]('no\x20mail\x20account\x20configured');}var _0x52a35d=this[_0x74b0('0x1f')][_0x74b0('0x68')](this,_0x39dfa1[_0x74b0('0x182')]);if(!_0x52a35d||!_0x52a35d['Smtp']){return this[_0x74b0('0xa')][_0x74b0('0x2b')](_0x39dfa1,_0x74b0('0x183'));}var _0x31f3d7={'from':util['format']('\x22%s\x22\x20<%s>',_0x52a35d[_0x74b0('0x11')],_0x52a35d['email']||_0x52a35d[_0x74b0('0x184')][_0x74b0('0x185')]),'to':_0x39dfa1['to']||'','cc':_0x39dfa1['cc']||'','bcc':_0x39dfa1[_0x74b0('0x186')]||'','subject':_0x39dfa1['subject'],'html':_0x39dfa1[_0x74b0('0x57')],'text':_0x39dfa1[_0x74b0('0x57')]};if(this[_0x74b0('0x9a')](_0x39dfa1[_0x74b0('0x187')])){}logger[_0x74b0('0xce')](_0x74b0('0x188'),JSON[_0x74b0('0x6a')](_0x31f3d7));this['createSquareDetailsReport'][_0x74b0('0x68')](this,_0x39dfa1,_0x39dfa1[_0x74b0('0x182')]);this[_0x74b0('0xa')]['noop'](util['format']('Trying\x20SendMail\x20with\x20account\x20%s',_0x52a35d[_0x74b0('0x11')]));this[_0x74b0('0x21')][_0x74b0('0x68')](this,_0x52a35d[_0x74b0('0x189')],_0x31f3d7);return this[_0x74b0('0xa')][_0x74b0('0xa0')](_0x74b0('0x18a'));};AGIVertices[_0x74b0('0xd')][_0x74b0('0x18b')]=function(_0x38fc08){logger[_0x74b0('0x2d')](util[_0x74b0('0x27')](_0x74b0('0x18c'),_0x38fc08[_0x74b0('0x37')]));return this[_0x74b0('0xa')]['noop']('SENDFAX\x20block\x20not\x20implemented');};AGIVertices['prototype'][_0x74b0('0x18d')]=function(_0x443323){logger['info'](util[_0x74b0('0x27')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x443323[_0x74b0('0x37')]));if(!this['isConfigured'](_0x443323[_0x74b0('0x18e')])){return this[_0x74b0('0xa')]['noop']('no\x20sms\x20account\x20configured');}var _0x2a163b=this[_0x74b0('0x18f')][_0x74b0('0x68')](this,_0x443323[_0x74b0('0x18e')]);if(!_0x2a163b){return this[_0x74b0('0xa')][_0x74b0('0x2b')](_0x443323,_0x74b0('0x190'));}var _0x3aad77={'body':_0x443323['sms_text'],'phone':_0x443323['to']||'','SmsAccountId':_0x2a163b['id']};logger[_0x74b0('0xce')]('sendSMS\x20message',JSON[_0x74b0('0x6a')](_0x3aad77));this[_0x74b0('0x35')][_0x74b0('0x68')](this,_0x443323,_0x443323[_0x74b0('0x18e')]);this[_0x74b0('0xa')][_0x74b0('0xa0')](util[_0x74b0('0x27')](_0x74b0('0x191'),_0x2a163b[_0x74b0('0x11')]));this[_0x74b0('0x34')][_0x74b0('0x68')](this,_0x3aad77);return this[_0x74b0('0xa')][_0x74b0('0xa0')](_0x74b0('0x192'));};AGIVertices[_0x74b0('0xd')]['set']=function(_0x568149){logger[_0x74b0('0x2d')](util['format'](_0x74b0('0x193'),_0x568149['label']));if(!this[_0x74b0('0x9a')](_0x568149[_0x74b0('0xc8')])){return this[_0x74b0('0xa')][_0x74b0('0x2b')](_0x568149,_0x74b0('0x194'));}var _0x5ea09d=this[_0x74b0('0xe')][_0x74b0('0x68')](this,_0x568149['variable_id']);if(!_0x5ea09d){return this[_0x74b0('0xa')][_0x74b0('0x2b')](_0x568149,_0x74b0('0x159'));}return this[_0x74b0('0xa')]['setVariable'](_0x5ea09d,_0x568149[_0x74b0('0x195')]);};AGIVertices['prototype'][_0x74b0('0x196')]=function(_0x43d2e6){logger[_0x74b0('0x2d')](util[_0x74b0('0x27')](_0x74b0('0x197'),_0x43d2e6['label']));this['channel']['noop'](_0x74b0('0x198'));if(_0x43d2e6[_0x74b0('0x199')]===_0x74b0('0x19a')){this[_0x74b0('0xa')][_0x74b0('0xa0')](_0x74b0('0x19b'));return this[_0x74b0('0xa')]['answer']();}return this[_0x74b0('0xa')][_0x74b0('0xa0')](_0x74b0('0x19c'));};AGIVertices[_0x74b0('0xd')][_0x74b0('0x19d')]=function(_0x4799fe){logger['info'](util['format'](_0x74b0('0x19e'),_0x4799fe['label']));if(!this[_0x74b0('0x9a')](_0x4799fe[_0x74b0('0x19f')])){return this[_0x74b0('0xa')]['error'](_0x4799fe,_0x74b0('0x1a0'));}var _0xe552f2=this[_0x74b0('0x15')][_0x74b0('0x68')](this,_0x4799fe[_0x74b0('0x19f')]);if(!this[_0x74b0('0x9a')](_0xe552f2)){return this[_0x74b0('0xa')][_0x74b0('0x2b')](_0x4799fe,util[_0x74b0('0x27')](_0x74b0('0x1a1'),_0x4799fe[_0x74b0('0x19f')]));}if(_0xe552f2===this['channel'][_0x74b0('0x1a2')]){return this['channel'][_0x74b0('0x2b')](_0x4799fe,_0x74b0('0x1a3'));}this[_0x74b0('0x35')][_0x74b0('0x68')](this,_0x4799fe,_0xe552f2);var _0x26e617=this['channel'][_0x74b0('0x52')](_0x74b0('0x1a4'),util[_0x74b0('0x27')](_0x74b0('0x1a5'),config['agi'][_0x74b0('0x1a6')]||_0x74b0('0x1a7'),_0xe552f2,this[_0x74b0('0xa')]['arg_1']));if(_0x26e617['result']===-0x1){return _0x26e617;}return this[_0x74b0('0xa')]['noop'](util[_0x74b0('0x27')](_0x74b0('0xb6'),_0x74b0('0x1a4'),_0xe552f2));};AGIVertices['prototype'][_0x74b0('0x1a8')]=function(_0x517e95){logger['info'](util[_0x74b0('0x27')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x517e95['label']));var _0x4d7731=this[_0x74b0('0x51')][_0x74b0('0x68')](this,_0x517e95[_0x74b0('0xad')]);this[_0x74b0('0x35')][_0x74b0('0x68')](this,_0x517e95,_0x517e95[_0x74b0('0xad')]);if(this[_0x74b0('0x9a')](_0x517e95[_0x74b0('0xc8')])){var _0x229ad9=this[_0x74b0('0xe')]['sync'](this,_0x517e95['variable_id']);if(_0x229ad9){this['channel']['setVariable'](_0x229ad9,_0x4d7731);return this['channel'][_0x74b0('0xa0')](util[_0x74b0('0x27')](_0x74b0('0x1a9'),_0x517e95[_0x74b0('0xad')],_0x229ad9));}}return this[_0x74b0('0xa')][_0x74b0('0xa0')](util[_0x74b0('0x27')](_0x74b0('0x1aa'),_0x517e95[_0x74b0('0xad')]));};AGIVertices['prototype']['google_cloud_tts']=function(_0xcd68c8){logger[_0x74b0('0x2d')](util['format'](_0x74b0('0x1ab'),_0xcd68c8[_0x74b0('0x37')]));_0xcd68c8[_0x74b0('0x57')]=_0xcd68c8[_0x74b0('0x57')][_0x74b0('0x54')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x74b0('0x9a')](_0xcd68c8[_0x74b0('0x1ac')])){return this[_0x74b0('0xa')][_0x74b0('0xa0')](_0x74b0('0x1ad'));}if(!this[_0x74b0('0x9a')](_0xcd68c8[_0x74b0('0x57')])){return this[_0x74b0('0xa')]['noop'](_0x74b0('0x9d'));}this['channel'][_0x74b0('0xa0')](util['format']('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0xcd68c8[_0x74b0('0x57')]));var _0x2448f1=this[_0x74b0('0x55')][_0x74b0('0x68')](this,_0xcd68c8);if(_0x2448f1){this[_0x74b0('0xa')][_0x74b0('0xa0')](util[_0x74b0('0x27')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x2448f1));var _0xd9ce80=this['channel']['streamFile'](_0x2448f1);try{fs['unlink'](_0x2448f1+_0x74b0('0x146'));}catch(_0xf83a82){logger[_0x74b0('0x2b')](_0xf83a82);}return _0xd9ce80;}return this['channel'][_0x74b0('0x2b')](_0xcd68c8,_0x74b0('0x1ae'));};AGIVertices[_0x74b0('0xd')][_0x74b0('0x1af')]=function(_0x4d4d5a){logger[_0x74b0('0x2d')](util[_0x74b0('0x27')](_0x74b0('0x1b0'),_0x4d4d5a[_0x74b0('0x37')]));_0x4d4d5a[_0x74b0('0x57')]=_0x4d4d5a[_0x74b0('0x57')][_0x74b0('0x54')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x4d4d5a[_0x74b0('0x57')])){return this[_0x74b0('0xa')]['noop'](_0x74b0('0x9d'));}this[_0x74b0('0xa')][_0x74b0('0xa0')](util[_0x74b0('0x27')](_0x74b0('0x1b1'),_0x4d4d5a[_0x74b0('0x57')]));var _0x167906=this[_0x74b0('0x5c')]['sync'](this,_0x4d4d5a);if(_0x167906){this[_0x74b0('0xa')]['noop'](util[_0x74b0('0x27')](_0x74b0('0x1b2'),_0x167906));var _0xd73287=this[_0x74b0('0xa')][_0x74b0('0x117')](_0x167906);try{fs['unlink'](_0x167906+_0x74b0('0x146'));}catch(_0x5ecc5d){logger[_0x74b0('0x2b')](_0x5ecc5d);}return _0xd73287;}return this[_0x74b0('0xa')][_0x74b0('0x2b')](_0x4d4d5a,'Google\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0x74b0('0x1b3')]=function(_0x5a67ce){logger[_0x74b0('0x2d')](util[_0x74b0('0x27')](_0x74b0('0x1b4'),_0x5a67ce['label']));if(!this['isConfigured'](_0x5a67ce[_0x74b0('0x14a')])){return this[_0x74b0('0xa')][_0x74b0('0x2b')](_0x5a67ce,_0x74b0('0x14b'));}logger[_0x74b0('0x2d')](util[_0x74b0('0x27')](_0x74b0('0x14c'),this[_0x74b0('0xa')][_0x74b0('0x38')],_0x5a67ce[_0x74b0('0x14a')]));var _0x346396=this[_0x74b0('0x4c')][_0x74b0('0x68')](this,_0x5a67ce[_0x74b0('0x14a')]);if(_0x346396){logger['info'](util[_0x74b0('0x27')](_0x74b0('0x14d'),this['channel']['callerid'],_0x5a67ce[_0x74b0('0x14a')]));this[_0x74b0('0xa')][_0x74b0('0xa0')](util[_0x74b0('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x74b0('0xa')][_0x74b0('0x38')],_0x5a67ce[_0x74b0('0x14a')]));return{'code':0xc8,'result':_0x74b0('0x150')};}else{logger['info'](util[_0x74b0('0x27')](_0x74b0('0x14e'),this[_0x74b0('0xa')][_0x74b0('0x38')],_0x5a67ce[_0x74b0('0x14a')]));this[_0x74b0('0xa')][_0x74b0('0xa0')](util[_0x74b0('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x74b0('0xa')][_0x74b0('0x38')],_0x5a67ce['findBy']));return{'code':0xc8,'result':_0x74b0('0x151')};}};AGIVertices['prototype']['voicemail']=function(_0x2255b0){logger['info'](util[_0x74b0('0x27')](_0x74b0('0x1b5'),_0x2255b0[_0x74b0('0x37')]));var _0x32f0a0=this[_0x74b0('0xa')][_0x74b0('0x52')](_0x74b0('0x1b6'),[_0x2255b0[_0x74b0('0x1b7')],_0x2255b0[_0x74b0('0x9e')]]);if(_0x32f0a0[_0x74b0('0x9f')]===-0x1){return _0x32f0a0;}return this['channel'][_0x74b0('0xa0')](util[_0x74b0('0x27')](_0x74b0('0xb6'),_0x74b0('0x1b6'),_0x2255b0[_0x74b0('0x1b7')]));};AGIVertices['prototype']['vswitch']=function(_0x5bf5c6){logger[_0x74b0('0x2d')](util[_0x74b0('0x27')](_0x74b0('0x1b8'),_0x5bf5c6['label']));if(!this['isConfigured'](_0x5bf5c6[_0x74b0('0xc8')])){return this[_0x74b0('0xa')][_0x74b0('0x2b')](_0x5bf5c6,_0x74b0('0x194'));}var _0x5464bd=this[_0x74b0('0xe')][_0x74b0('0x68')](this,_0x5bf5c6['variable_id']);if(!_0x5464bd){return this[_0x74b0('0xa')][_0x74b0('0x2b')](_0x5bf5c6,'no\x20variable\x20found');}var _0x2c5750=this[_0x74b0('0xa')][_0x74b0('0xe')](_0x5464bd);return{'code':0xc8,'result':_0x2c5750[_0x74b0('0x98')]?_0x2c5750[_0x74b0('0x98')]:'-'};};String['prototype'][_0x74b0('0x94')]=function(_0x1aca4c,_0xea90cb){return this['split'](_0x1aca4c)[_0x74b0('0x1b9')](_0xea90cb);};module['exports']=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 68f4dcf..4ae118b 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 _0xa7ec=['[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','syncAttendedTransfer','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','syncBlindTransfer','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','Auto-Pause','exports','util','lodash','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','hanguprequest','bind','hangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','blindtransfer','custom:agentConnectPreview','seconds','prototype','startAcw','interface','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','getAgent','then','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','updateAcw','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','message','stopAcw','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','update','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','syncAgentConnect','[ACW][syncAgentConnect]\x20%s','syncAgentConnectPreview','[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','isUndefined','attended','[%s][HANGUP:UNIQUEID]','linkedid','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xa7ec,0x178));var _0xca7e=function(_0x54a462,_0xb2ba9){_0x54a462=_0x54a462-0x0;var _0x1c2ee5=_0xa7ec[_0x54a462];return _0x1c2ee5;};'use strict';var util=require(_0xca7e('0x0'));var _=require(_0xca7e('0x1'));var moment=require('moment');var ami=require('../ami');var logger=require('../../../config/logger')(_0xca7e('0x2'));var RpcUser=require(_0xca7e('0x3'));var RpcVoiceAgentReport=require(_0xca7e('0x4'));function Acw(_0x290fc1){this['voiceQueues']=_0x290fc1[_0xca7e('0x5')];this[_0xca7e('0x6')]=_0x290fc1[_0xca7e('0x6')];this['timers']=_0x290fc1[_0xca7e('0x7')];this[_0xca7e('0x8')]={};ami['on'](_0xca7e('0x9'),this['syncAgentConnect']['bind'](this));ami['on'](_0xca7e('0xa'),this['syncHangupRequest'][_0xca7e('0xb')](this));ami['on'](_0xca7e('0xc'),this['syncHangup']['bind'](this));ami['on'](_0xca7e('0xd'),this[_0xca7e('0xe')][_0xca7e('0xb')](this));ami['on'](_0xca7e('0xf'),this['syncAttendedTransfer'][_0xca7e('0xb')](this));ami['on'](_0xca7e('0x10'),this['syncBlindTransfer'][_0xca7e('0xb')](this));ami['on'](_0xca7e('0x11'),this['syncAgentConnectPreview'][_0xca7e('0xb')](this));}function getDiff(_0x2b1a25){var _0x175995=moment()['milliseconds'](0x0);var _0x5f01a9=moment(_0x2b1a25)['milliseconds'](0x0);return _0x175995['diff'](_0x5f01a9,_0xca7e('0x12'));}Acw[_0xca7e('0x13')][_0xca7e('0x14')]=function(_0x292104){try{var _0x3fdf65=this;var _0xb63104=this[_0xca7e('0x8')][_0x292104][_0xca7e('0x15')];var _0x10d508=this[_0xca7e('0x8')][_0x292104]['queue'];var _0x218c15=this[_0xca7e('0x5')][_0x10d508];var _0x238274=![];var _0x557d9c=_0xca7e('0x16');if(_0x218c15[_0xca7e('0x17')]){if(_0x218c15['mandatoryDispositionPause']['name']){_0x238274=!![];_0x557d9c=_0x218c15[_0xca7e('0x18')][_0xca7e('0x19')];}}ami[_0xca7e('0x1a')]({'action':_0xca7e('0x1b'),'interface':_0xb63104,'paused':!![],'reason':_0x557d9c})['then'](function(_0x2e676e){if(_0x3fdf65[_0xca7e('0x6')][_0xb63104]){return RpcUser[_0xca7e('0x1c')](_0x3fdf65['agents'][_0xb63104]['id'])[_0xca7e('0x1d')](function(_0x1890cd){if(_0x1890cd&&!_0x1890cd[_0xca7e('0x1e')]){logger[_0xca7e('0x1f')](_0xca7e('0x20'),_0x292104,_0xb63104,_0x10d508);var _0x3ed235=_0x3fdf65['channels'][_0x292104]['attended']&&_0x3fdf65[_0xca7e('0x8')][_0x292104][_0xca7e('0x21')]?_0x3fdf65['channels'][_0x292104][_0xca7e('0x21')]:_0x292104;return RpcUser['savePause'](_0x3fdf65['agents'][_0xb63104],_0x557d9c,_0x3ed235)[_0xca7e('0x1d')](function(_0x238211){if(!_0x238274){_0x3fdf65[_0xca7e('0x7')][_0xb63104]={};logger['info'](_0xca7e('0x22'),_0x292104,_0x3fdf65[_0xca7e('0x5')][_0x10d508][_0xca7e('0x23')],_0xb63104,_0x10d508);_0x3fdf65['timers'][_0xb63104][_0xca7e('0x24')]=setTimeout(_0x3fdf65['stopAcw']['bind'](_0x3fdf65,_0xb63104),_0x3fdf65[_0xca7e('0x5')][_0x10d508]['acwTimeout']*0x3e8);_0x3fdf65[_0xca7e('0x7')][_0xb63104][_0xca7e('0x25')]=moment()[_0xca7e('0x26')](_0xca7e('0x27'));_0x3fdf65['timers'][_0xb63104][_0xca7e('0x28')]=_0x292104;_0x3fdf65[_0xca7e('0x7')][_0xb63104][_0xca7e('0x29')]=_0x10d508;_0x3fdf65['timers'][_0xb63104][_0xca7e('0x2a')]=function(){var _0xc5d33b=getDiff(_0x3fdf65[_0xca7e('0x7')][_0xb63104]['lastPauseAt']);clearTimeout(_0x3fdf65[_0xca7e('0x7')][_0xb63104][_0xca7e('0x24')]);_0x3fdf65[_0xca7e('0x7')][_0xb63104][_0xca7e('0x24')]=![];RpcVoiceAgentReport['update']({'acwtime':_0xc5d33b},_0x3fdf65[_0xca7e('0x7')][_0xb63104][_0xca7e('0x28')],_0xb63104)[_0xca7e('0x1d')](function(_0x1e8698){logger['info'](_0xca7e('0x2b'),_0x292104,_0xc5d33b,_0x1e8698);})[_0xca7e('0x2c')](function(_0x3b82d9){logger[_0xca7e('0x2d')](_0xca7e('0x2e'),_0x292104,_0x3b82d9);});delete _0x3fdf65[_0xca7e('0x7')][_0xb63104];};}});}else{logger[_0xca7e('0x1f')](_0xca7e('0x2f'),_0x292104,_0xb63104,_0x10d508);}});}})[_0xca7e('0x2c')](function(_0x5f4a5f){logger[_0xca7e('0x2d')](_0xca7e('0x22'),_0x292104,_0x3fdf65[_0xca7e('0x5')][_0x10d508][_0xca7e('0x23')],_0xb63104,_0x10d508);})[_0xca7e('0x30')](function(){delete _0x3fdf65['channels'][_0x292104];});}catch(_0x124244){logger['error']('[ACW][START]\x20%s',_0x124244[_0xca7e('0x31')]);}};Acw[_0xca7e('0x13')][_0xca7e('0x32')]=function(_0x180eb3){try{var _0x262770=this;if(_0x262770[_0xca7e('0x7')][_0x180eb3]){_0x262770[_0xca7e('0x7')][_0x180eb3][_0xca7e('0x24')]=![];var _0x3b9edb=_0x262770[_0xca7e('0x7')][_0x180eb3][_0xca7e('0x28')];var _0x418436=_0x262770['timers'][_0x180eb3][_0xca7e('0x29')];var _0xfc913=_0x262770[_0xca7e('0x5')][_0x418436]['acwTimeout'];logger[_0xca7e('0x1f')](_0xca7e('0x33'),_0x3b9edb,_0x180eb3);RpcUser[_0xca7e('0x34')](this['agents'][_0x180eb3]);RpcVoiceAgentReport[_0xca7e('0x35')]({'acwtime':_0xfc913,'agentacw':!![]},_0x3b9edb,_0x180eb3)[_0xca7e('0x1d')](function(_0x4b87d1){logger[_0xca7e('0x1f')](_0xca7e('0x2b'),_0x3b9edb,_0xfc913,_0x4b87d1);})['catch'](function(_0x4b1d2b){logger[_0xca7e('0x2d')](_0xca7e('0x2e'),_0x3b9edb,_0x4b1d2b);});}else{logger[_0xca7e('0x2d')](_0xca7e('0x36'),_0x180eb3);if(_0x262770[_0xca7e('0x7')]){logger[_0xca7e('0x1f')](_0xca7e('0x37'),JSON[_0xca7e('0x38')](_0x262770[_0xca7e('0x7')]));}}}catch(_0x3b28af){logger['error'](_0xca7e('0x39'),_0x3b28af[_0xca7e('0x31')]);}};Acw[_0xca7e('0x13')][_0xca7e('0x3a')]=function(_0x496290){try{if(this[_0xca7e('0x5')][_0x496290['queue']]&&(this[_0xca7e('0x5')][_0x496290['queue']][_0xca7e('0x2')]||this[_0xca7e('0x5')][_0x496290[_0xca7e('0x29')]]['mandatoryDisposition'])){if(this['agents'][_0x496290[_0xca7e('0x15')]]){this[_0xca7e('0x8')][_0x496290[_0xca7e('0x28')]]={'queue':_0x496290[_0xca7e('0x29')],'interface':_0x496290['interface'],'destlinkedid':_0x496290[_0xca7e('0x21')]};}}}catch(_0x32a38a){logger['error'](_0xca7e('0x3b'),_0x32a38a['message']);}};Acw[_0xca7e('0x13')][_0xca7e('0x3c')]=function(_0x43bc4b){try{if(this[_0xca7e('0x5')][_0x43bc4b[_0xca7e('0x29')]]&&(this[_0xca7e('0x5')][_0x43bc4b[_0xca7e('0x29')]][_0xca7e('0x2')]||this['voiceQueues'][_0x43bc4b[_0xca7e('0x29')]][_0xca7e('0x17')])){if(this[_0xca7e('0x6')][_0x43bc4b[_0xca7e('0x15')]]){this['channels'][_0x43bc4b[_0xca7e('0x28')]]={'queue':_0x43bc4b['queue'],'interface':_0x43bc4b[_0xca7e('0x15')]};}}}catch(_0x4a92c1){logger[_0xca7e('0x2d')](_0xca7e('0x3d'),_0x4a92c1[_0xca7e('0x31')]);}};Acw['prototype'][_0xca7e('0x3e')]=function(_0x58da1c){try{if(this[_0xca7e('0x8')][_0x58da1c[_0xca7e('0x28')]]&&_[_0xca7e('0x3f')](this[_0xca7e('0x8')][_0x58da1c[_0xca7e('0x28')]][_0xca7e('0x40')])){logger[_0xca7e('0x1f')](_0xca7e('0x41'),_0x58da1c[_0xca7e('0x28')]);this['startAcw'](_0x58da1c[_0xca7e('0x28')]);}else if(this[_0xca7e('0x8')][_0x58da1c['linkedid']]&&_[_0xca7e('0x3f')](this[_0xca7e('0x8')][_0x58da1c[_0xca7e('0x42')]][_0xca7e('0x40')])){logger[_0xca7e('0x1f')]('[%s][HANGUP:LINKEDID]',_0x58da1c['linkedid']);this[_0xca7e('0x14')](_0x58da1c['linkedid']);}}catch(_0x37e708){logger[_0xca7e('0x2d')](_0xca7e('0x43'),_0x37e708[_0xca7e('0x31')]);}};Acw[_0xca7e('0x13')]['syncHangup']=function(_0x3f0015){try{if(this[_0xca7e('0x8')][_0x3f0015[_0xca7e('0x28')]]&&this[_0xca7e('0x8')][_0x3f0015[_0xca7e('0x28')]][_0xca7e('0x40')]){logger[_0xca7e('0x1f')](_0xca7e('0x44'),_0x3f0015[_0xca7e('0x28')]);this['startAcw'](_0x3f0015[_0xca7e('0x28')]);}else if(this[_0xca7e('0x8')][_0x3f0015['linkedid']]&&this[_0xca7e('0x8')][_0x3f0015[_0xca7e('0x42')]][_0xca7e('0x40')]){logger['info'](_0xca7e('0x45'),_0x3f0015[_0xca7e('0x42')]);this[_0xca7e('0x14')](_0x3f0015[_0xca7e('0x42')]);}}catch(_0x3d3b1b){logger[_0xca7e('0x2d')](_0xca7e('0x46'),_0x3d3b1b['message']);}};Acw['prototype'][_0xca7e('0x47')]=function(_0x5c14d5){try{if(!_[_0xca7e('0x48')](this['channels'][_0x5c14d5[_0xca7e('0x49')]])){this[_0xca7e('0x14')](_0x5c14d5[_0xca7e('0x49')]);if(this[_0xca7e('0x8')][_0x5c14d5[_0xca7e('0x4a')]]){this[_0xca7e('0x8')][_0x5c14d5[_0xca7e('0x4a')]][_0xca7e('0x40')]=!![];this[_0xca7e('0x8')][_0x5c14d5['transfertargetuniqueid']]=this[_0xca7e('0x8')][_0x5c14d5[_0xca7e('0x4a')]];delete this[_0xca7e('0x8')][_0x5c14d5[_0xca7e('0x4a')]];}}else if(!_['isNil'](this[_0xca7e('0x8')][_0x5c14d5[_0xca7e('0x4b')]])){this[_0xca7e('0x14')](_0x5c14d5['transfertargetuniqueid']);if(this[_0xca7e('0x8')][_0x5c14d5[_0xca7e('0x4c')]]){this[_0xca7e('0x8')][_0x5c14d5[_0xca7e('0x4c')]]['attended']=!![];this['channels'][_0x5c14d5['transfereeuniqueid']]=this[_0xca7e('0x8')][_0x5c14d5[_0xca7e('0x4c')]];delete this['channels'][_0x5c14d5[_0xca7e('0x4c')]];}}}catch(_0x291389){logger[_0xca7e('0x2d')]('[ACW][syncAttendedTransfer]\x20%s',_0x291389[_0xca7e('0x31')]);}};Acw[_0xca7e('0x13')][_0xca7e('0x4d')]=function(_0x6c22c0){try{if(this[_0xca7e('0x8')][_0x6c22c0[_0xca7e('0x4e')]]){logger[_0xca7e('0x1f')](_0xca7e('0x4f'),JSON[_0xca7e('0x38')](_0x6c22c0[_0xca7e('0x4e')]));this[_0xca7e('0x14')](_0x6c22c0[_0xca7e('0x4e')]);}else if(this['channels'][_0x6c22c0['transfererlinkedid']]){logger[_0xca7e('0x1f')](_0xca7e('0x50'),JSON[_0xca7e('0x38')](_0x6c22c0['transfererlinkedid']));this[_0xca7e('0x14')](_0x6c22c0[_0xca7e('0x51')]);}}catch(_0x515210){logger['error'](_0xca7e('0x52'),_0x515210[_0xca7e('0x31')]);}};Acw[_0xca7e('0x13')][_0xca7e('0xe')]=function(_0x277cdd){try{if(this[_0xca7e('0x5')][_0x277cdd[_0xca7e('0x29')]]&&this[_0xca7e('0x5')][_0x277cdd[_0xca7e('0x29')]][_0xca7e('0x53')]===_0xca7e('0x54')){if(this[_0xca7e('0x6')][_0x277cdd[_0xca7e('0x15')]]){logger[_0xca7e('0x1f')](_0xca7e('0x55'),_0x277cdd['uniqueid'],_0x277cdd[_0xca7e('0x15')],_0x277cdd['queue']);return RpcUser[_0xca7e('0x56')](this['agents'][_0x277cdd[_0xca7e('0x15')]],_0xca7e('0x57'),_0x277cdd[_0xca7e('0x28')]);}}}catch(_0x5684e3){logger['error']('[ACW][syncAgentRingNoAnswer]\x20%s',_0x5684e3[_0xca7e('0x31')]);}};module[_0xca7e('0x58')]=Acw; \ No newline at end of file +var _0xd7eb=['origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','syncBlindTransfer','transfereruniqueid','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','channels','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','syncAttendedTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','startAcw','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','timers','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','stopAcw','lastPauseAt','YYYY-MM-DD\x20HH:mm:ss','updateAcw','timer','update','uniqueid','catch','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','acwTimeout','finally','[ACW][START]\x20%s','message','prototype','[%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','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','attended','[%s][HANGUP:UNIQUEID]','[%s][HANGUP:LINKEDID]','linkedid','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid'];(function(_0xbe3b31,_0x476b64){var _0x3aa76e=function(_0x1a2dfc){while(--_0x1a2dfc){_0xbe3b31['push'](_0xbe3b31['shift']());}};_0x3aa76e(++_0x476b64);}(_0xd7eb,0x172));var _0xbd7e=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xd7eb[_0x413feb];return _0x40ee88;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xbd7e('0x0'));var ami=require(_0xbd7e('0x1'));var logger=require(_0xbd7e('0x2'))(_0xbd7e('0x3'));var RpcUser=require(_0xbd7e('0x4'));var RpcVoiceAgentReport=require(_0xbd7e('0x5'));function Acw(_0x2feb14){this['voiceQueues']=_0x2feb14[_0xbd7e('0x6')];this[_0xbd7e('0x7')]=_0x2feb14[_0xbd7e('0x7')];this['timers']=_0x2feb14['timers'];this[_0xbd7e('0x8')]={};ami['on']('agentconnect',this['syncAgentConnect'][_0xbd7e('0x9')](this));ami['on'](_0xbd7e('0xa'),this[_0xbd7e('0xb')][_0xbd7e('0x9')](this));ami['on'](_0xbd7e('0xc'),this[_0xbd7e('0xd')][_0xbd7e('0x9')](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer']['bind'](this));ami['on']('attendedtransfer',this[_0xbd7e('0xe')][_0xbd7e('0x9')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0xbd7e('0x9')](this));ami['on'](_0xbd7e('0xf'),this[_0xbd7e('0x10')][_0xbd7e('0x9')](this));}function getDiff(_0x3c6330){var _0x460306=moment()['milliseconds'](0x0);var _0x43d8bc=moment(_0x3c6330)[_0xbd7e('0x11')](0x0);return _0x460306[_0xbd7e('0x12')](_0x43d8bc,_0xbd7e('0x13'));}Acw['prototype'][_0xbd7e('0x14')]=function(_0x579758){try{var _0x4abeba=this;var _0x166288=this[_0xbd7e('0x8')][_0x579758][_0xbd7e('0x15')];var _0x40cea8=this[_0xbd7e('0x8')][_0x579758][_0xbd7e('0x16')];var _0x1170ab=this['voiceQueues'][_0x40cea8];var _0x232509=![];var _0x2e5506=_0xbd7e('0x17');if(_0x1170ab[_0xbd7e('0x18')]){if(_0x1170ab[_0xbd7e('0x19')][_0xbd7e('0x1a')]){_0x232509=!![];_0x2e5506=_0x1170ab[_0xbd7e('0x19')][_0xbd7e('0x1a')];}}ami[_0xbd7e('0x1b')]({'action':_0xbd7e('0x1c'),'interface':_0x166288,'paused':!![],'reason':_0x2e5506})[_0xbd7e('0x1d')](function(_0x3e63fb){if(_0x4abeba[_0xbd7e('0x7')][_0x166288]){return RpcUser[_0xbd7e('0x1e')](_0x4abeba['agents'][_0x166288]['id'])[_0xbd7e('0x1d')](function(_0xcf008){if(_0xcf008&&!_0xcf008[_0xbd7e('0x1f')]){logger[_0xbd7e('0x20')](_0xbd7e('0x21'),_0x579758,_0x166288,_0x40cea8);var _0x37fe54=_0x4abeba['channels'][_0x579758]['attended']&&_0x4abeba[_0xbd7e('0x8')][_0x579758]['destlinkedid']?_0x4abeba['channels'][_0x579758][_0xbd7e('0x22')]:_0x579758;return RpcUser[_0xbd7e('0x23')](_0x4abeba[_0xbd7e('0x7')][_0x166288],_0x2e5506,_0x37fe54)[_0xbd7e('0x1d')](function(_0x463666){if(!_0x232509){_0x4abeba[_0xbd7e('0x24')][_0x166288]={};logger[_0xbd7e('0x20')](_0xbd7e('0x25'),_0x579758,_0x4abeba[_0xbd7e('0x6')][_0x40cea8]['acwTimeout'],_0x166288,_0x40cea8);_0x4abeba[_0xbd7e('0x24')][_0x166288]['timer']=setTimeout(_0x4abeba[_0xbd7e('0x26')][_0xbd7e('0x9')](_0x4abeba,_0x166288),_0x4abeba['voiceQueues'][_0x40cea8]['acwTimeout']*0x3e8);_0x4abeba[_0xbd7e('0x24')][_0x166288][_0xbd7e('0x27')]=moment()['format'](_0xbd7e('0x28'));_0x4abeba[_0xbd7e('0x24')][_0x166288]['uniqueid']=_0x579758;_0x4abeba[_0xbd7e('0x24')][_0x166288][_0xbd7e('0x16')]=_0x40cea8;_0x4abeba[_0xbd7e('0x24')][_0x166288][_0xbd7e('0x29')]=function(){var _0x1c41f8=getDiff(_0x4abeba[_0xbd7e('0x24')][_0x166288]['lastPauseAt']);clearTimeout(_0x4abeba[_0xbd7e('0x24')][_0x166288]['timer']);_0x4abeba[_0xbd7e('0x24')][_0x166288][_0xbd7e('0x2a')]=![];RpcVoiceAgentReport[_0xbd7e('0x2b')]({'acwtime':_0x1c41f8},_0x4abeba[_0xbd7e('0x24')][_0x166288][_0xbd7e('0x2c')],_0x166288)[_0xbd7e('0x1d')](function(_0x4ce174){logger[_0xbd7e('0x20')]('[%s][UPDATE][ACWTIME:%s]',_0x579758,_0x1c41f8,_0x4ce174);})[_0xbd7e('0x2d')](function(_0x4e9386){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x579758,_0x4e9386);});delete _0x4abeba[_0xbd7e('0x24')][_0x166288];};}});}else{logger[_0xbd7e('0x20')](_0xbd7e('0x2e'),_0x579758,_0x166288,_0x40cea8);}});}})['catch'](function(_0x18c0f0){logger[_0xbd7e('0x2f')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x579758,_0x4abeba[_0xbd7e('0x6')][_0x40cea8][_0xbd7e('0x30')],_0x166288,_0x40cea8);})[_0xbd7e('0x31')](function(){delete _0x4abeba[_0xbd7e('0x8')][_0x579758];});}catch(_0x4618e6){logger['error'](_0xbd7e('0x32'),_0x4618e6[_0xbd7e('0x33')]);}};Acw[_0xbd7e('0x34')][_0xbd7e('0x26')]=function(_0x5e25f3){try{var _0x56f9a4=this;if(_0x56f9a4[_0xbd7e('0x24')][_0x5e25f3]){_0x56f9a4[_0xbd7e('0x24')][_0x5e25f3]['timer']=![];var _0xe30f6c=_0x56f9a4[_0xbd7e('0x24')][_0x5e25f3][_0xbd7e('0x2c')];var _0x525498=_0x56f9a4[_0xbd7e('0x24')][_0x5e25f3][_0xbd7e('0x16')];var _0x2e5704=_0x56f9a4[_0xbd7e('0x6')][_0x525498][_0xbd7e('0x30')];logger[_0xbd7e('0x20')](_0xbd7e('0x35'),_0xe30f6c,_0x5e25f3);RpcUser[_0xbd7e('0x36')](this['agents'][_0x5e25f3]);RpcVoiceAgentReport[_0xbd7e('0x2b')]({'acwtime':_0x2e5704,'agentacw':!![]},_0xe30f6c,_0x5e25f3)[_0xbd7e('0x1d')](function(_0x275063){logger['info'](_0xbd7e('0x37'),_0xe30f6c,_0x2e5704,_0x275063);})['catch'](function(_0x3483cb){logger[_0xbd7e('0x2f')](_0xbd7e('0x38'),_0xe30f6c,_0x3483cb);});}else{logger['error'](_0xbd7e('0x39'),_0x5e25f3);if(_0x56f9a4[_0xbd7e('0x24')]){logger['info'](_0xbd7e('0x3a'),JSON[_0xbd7e('0x3b')](_0x56f9a4[_0xbd7e('0x24')]));}}}catch(_0x1123c0){logger[_0xbd7e('0x2f')]('[ACW][STOP]\x20%s',_0x1123c0[_0xbd7e('0x33')]);}};Acw[_0xbd7e('0x34')][_0xbd7e('0x3c')]=function(_0x3c53b8){try{if(this['voiceQueues'][_0x3c53b8['queue']]&&(this[_0xbd7e('0x6')][_0x3c53b8['queue']][_0xbd7e('0x3')]||this[_0xbd7e('0x6')][_0x3c53b8[_0xbd7e('0x16')]][_0xbd7e('0x18')])){if(this[_0xbd7e('0x7')][_0x3c53b8[_0xbd7e('0x15')]]){this[_0xbd7e('0x8')][_0x3c53b8[_0xbd7e('0x2c')]]={'queue':_0x3c53b8['queue'],'interface':_0x3c53b8[_0xbd7e('0x15')],'destlinkedid':_0x3c53b8['destlinkedid']};}}}catch(_0x4fe6d8){logger[_0xbd7e('0x2f')](_0xbd7e('0x3d'),_0x4fe6d8[_0xbd7e('0x33')]);}};Acw['prototype'][_0xbd7e('0x10')]=function(_0x71b45c){try{if(this['voiceQueues'][_0x71b45c[_0xbd7e('0x16')]]&&(this['voiceQueues'][_0x71b45c[_0xbd7e('0x16')]][_0xbd7e('0x3')]||this['voiceQueues'][_0x71b45c['queue']][_0xbd7e('0x18')])){if(this[_0xbd7e('0x7')][_0x71b45c[_0xbd7e('0x15')]]){this[_0xbd7e('0x8')][_0x71b45c['uniqueid']]={'queue':_0x71b45c[_0xbd7e('0x16')],'interface':_0x71b45c['interface']};}}}catch(_0x2e25b3){logger[_0xbd7e('0x2f')](_0xbd7e('0x3e'),_0x2e25b3[_0xbd7e('0x33')]);}};Acw[_0xbd7e('0x34')][_0xbd7e('0xb')]=function(_0x4be2f6){try{if(this[_0xbd7e('0x8')][_0x4be2f6[_0xbd7e('0x2c')]]&&_[_0xbd7e('0x3f')](this[_0xbd7e('0x8')][_0x4be2f6[_0xbd7e('0x2c')]][_0xbd7e('0x40')])){logger[_0xbd7e('0x20')](_0xbd7e('0x41'),_0x4be2f6['uniqueid']);this['startAcw'](_0x4be2f6[_0xbd7e('0x2c')]);}else if(this['channels'][_0x4be2f6['linkedid']]&&_[_0xbd7e('0x3f')](this[_0xbd7e('0x8')][_0x4be2f6['linkedid']]['attended'])){logger['info'](_0xbd7e('0x42'),_0x4be2f6[_0xbd7e('0x43')]);this[_0xbd7e('0x14')](_0x4be2f6['linkedid']);}}catch(_0x5c7159){logger[_0xbd7e('0x2f')]('[ACW][syncHangupRequest]\x20%s',_0x5c7159[_0xbd7e('0x33')]);}};Acw[_0xbd7e('0x34')]['syncHangup']=function(_0x229a7d){try{if(this[_0xbd7e('0x8')][_0x229a7d['uniqueid']]&&this[_0xbd7e('0x8')][_0x229a7d[_0xbd7e('0x2c')]][_0xbd7e('0x40')]){logger['info'](_0xbd7e('0x44'),_0x229a7d[_0xbd7e('0x2c')]);this[_0xbd7e('0x14')](_0x229a7d[_0xbd7e('0x2c')]);}else if(this[_0xbd7e('0x8')][_0x229a7d[_0xbd7e('0x43')]]&&this[_0xbd7e('0x8')][_0x229a7d[_0xbd7e('0x43')]][_0xbd7e('0x40')]){logger['info'](_0xbd7e('0x45'),_0x229a7d['linkedid']);this[_0xbd7e('0x14')](_0x229a7d['linkedid']);}}catch(_0x5faa67){logger[_0xbd7e('0x2f')](_0xbd7e('0x46'),_0x5faa67[_0xbd7e('0x33')]);}};Acw[_0xbd7e('0x34')][_0xbd7e('0xe')]=function(_0x4b28db){try{if(!_[_0xbd7e('0x47')](this['channels'][_0x4b28db[_0xbd7e('0x48')]])){this[_0xbd7e('0x14')](_0x4b28db['transfereeuniqueid']);if(this[_0xbd7e('0x8')][_0x4b28db['secondtransfereruniqueid']]){this[_0xbd7e('0x8')][_0x4b28db['secondtransfereruniqueid']][_0xbd7e('0x40')]=!![];this[_0xbd7e('0x8')][_0x4b28db['transfertargetuniqueid']]=this['channels'][_0x4b28db[_0xbd7e('0x49')]];delete this['channels'][_0x4b28db['secondtransfereruniqueid']];}}else if(!_[_0xbd7e('0x47')](this[_0xbd7e('0x8')][_0x4b28db[_0xbd7e('0x4a')]])){this[_0xbd7e('0x14')](_0x4b28db['transfertargetuniqueid']);if(this[_0xbd7e('0x8')][_0x4b28db[_0xbd7e('0x4b')]]){this[_0xbd7e('0x8')][_0x4b28db['origtransfereruniqueid']][_0xbd7e('0x40')]=!![];this[_0xbd7e('0x8')][_0x4b28db[_0xbd7e('0x48')]]=this['channels'][_0x4b28db[_0xbd7e('0x4b')]];delete this['channels'][_0x4b28db[_0xbd7e('0x4b')]];}}}catch(_0x1d49d7){logger[_0xbd7e('0x2f')](_0xbd7e('0x4c'),_0x1d49d7[_0xbd7e('0x33')]);}};Acw[_0xbd7e('0x34')][_0xbd7e('0x4d')]=function(_0x2be0f6){try{if(this[_0xbd7e('0x8')][_0x2be0f6['transfereruniqueid']]){logger[_0xbd7e('0x20')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0xbd7e('0x3b')](_0x2be0f6[_0xbd7e('0x4e')]));this[_0xbd7e('0x14')](_0x2be0f6[_0xbd7e('0x4e')]);}else if(this['channels'][_0x2be0f6['transfererlinkedid']]){logger[_0xbd7e('0x20')](_0xbd7e('0x4f'),JSON['stringify'](_0x2be0f6[_0xbd7e('0x50')]));this[_0xbd7e('0x14')](_0x2be0f6['transfererlinkedid']);}}catch(_0x22c1d7){logger[_0xbd7e('0x2f')](_0xbd7e('0x51'),_0x22c1d7[_0xbd7e('0x33')]);}};Acw['prototype'][_0xbd7e('0x52')]=function(_0x570fb1){try{if(this[_0xbd7e('0x6')][_0x570fb1[_0xbd7e('0x16')]]&&this[_0xbd7e('0x6')][_0x570fb1[_0xbd7e('0x16')]][_0xbd7e('0x53')]===_0xbd7e('0x54')){if(this[_0xbd7e('0x7')][_0x570fb1['interface']]){logger[_0xbd7e('0x20')](_0xbd7e('0x55'),_0x570fb1['uniqueid'],_0x570fb1[_0xbd7e('0x15')],_0x570fb1[_0xbd7e('0x16')]);return RpcUser[_0xbd7e('0x23')](this[_0xbd7e('0x7')][_0x570fb1[_0xbd7e('0x15')]],_0xbd7e('0x56'),_0x570fb1[_0xbd7e('0x2c')]);}}}catch(_0xc84062){logger[_0xbd7e('0x2f')](_0xbd7e('0x57'),_0xc84062[_0xbd7e('0x33')]);}};module[_0xbd7e('0x58')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 3dc0e08..1fc4d2c 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 _0xb7e7=['username','Action','devicestatelist','actionSipPeerStatus','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipShowRegistry','actionDeviceStateList','catch','[ami.js][fullybooted]','exports','asterisk-manager','moment','lodash','ami','asterisk','port','password','keepConnected','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s'];(function(_0x1389b7,_0x1680d0){var _0x439e35=function(_0x46c610){while(--_0x46c610){_0x1389b7['push'](_0x1389b7['shift']());}};_0x439e35(++_0x1680d0);}(_0xb7e7,0x121));var _0x7b7e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xb7e7[_0x2f3848];return _0x102668;};'use strict';var Manager=require(_0x7b7e('0x0'));var BPromise=require('bluebird');var moment=require(_0x7b7e('0x1'));var util=require('util');var _=require(_0x7b7e('0x2'));var logger=require('../../config/logger')(_0x7b7e('0x3'));var config=require('../../config/environment');var ami=new Manager(config[_0x7b7e('0x4')][_0x7b7e('0x5')],config[_0x7b7e('0x4')]['ip'],config['asterisk']['username'],config[_0x7b7e('0x4')][_0x7b7e('0x6')],!![]);ami[_0x7b7e('0x7')]();ami['Action']=BPromise[_0x7b7e('0x8')](ami[_0x7b7e('0x9')]);function error(_0x2917f9){logger[_0x7b7e('0xa')](util[_0x7b7e('0xb')](_0x7b7e('0xc'),config[_0x7b7e('0x4')]['username'],config[_0x7b7e('0x4')]['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')],util[_0x7b7e('0xd')](_0x2917f9,![],null)));}function close(){logger[_0x7b7e('0xa')](util[_0x7b7e('0xb')](_0x7b7e('0xe'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config['asterisk']['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x7b7e('0x10')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x7b7e('0x10')]({'action':_0x7b7e('0x11')});};};ami[_0x7b7e('0x12')]=function(){return function(){return ami[_0x7b7e('0x10')]({'action':_0x7b7e('0x13')});};};ami['actionQueueSummary']=function(){return function(){return ami['Action']({'action':_0x7b7e('0x14')});};};ami[_0x7b7e('0x15')]=function(){return function(){return ami[_0x7b7e('0x10')]({'action':_0x7b7e('0x16')});};};function connect(_0x2cc400){logger[_0x7b7e('0x17')](util[_0x7b7e('0xb')](_0x7b7e('0x18'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config[_0x7b7e('0x4')]['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')]));ami[_0x7b7e('0x19')](_0x7b7e('0xa'),error);ami[_0x7b7e('0x19')](_0x7b7e('0x1a'),close);}ami['on']('connect',connect);ami['on'](_0x7b7e('0x1b'),function(_0x43db4f){logger[_0x7b7e('0x17')](util['format'](_0x7b7e('0x1c'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config[_0x7b7e('0x4')]['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')],util[_0x7b7e('0xd')](_0x43db4f,![],null)));});ami['on'](_0x7b7e('0x1d'),function(_0x53bbb3){logger['info'](util['format'](_0x7b7e('0x1e'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config['asterisk']['ip'],config['asterisk']['port']));return BPromise[_0x7b7e('0x1f')]()[_0x7b7e('0x20')](ami[_0x7b7e('0x21')]())[_0x7b7e('0x20')](ami[_0x7b7e('0x22')]())['then'](ami[_0x7b7e('0x12')]())[_0x7b7e('0x20')](ami['actionQueueSummary']())['then'](ami['actionCoreShowChannels']())[_0x7b7e('0x23')](function(_0x423832){logger['error'](_0x7b7e('0x24'),util['inspect'](_0x423832,{'showHidden':![],'depth':null}));});});ami[_0x7b7e('0x19')](_0x7b7e('0xa'),error);ami[_0x7b7e('0x19')]('close',close);module[_0x7b7e('0x25')]=ami; \ No newline at end of file +var _0x2032=['exports','bluebird','moment','util','../../config/logger','ami','asterisk','port','username','password','keepConnected','Action','promisify','action','format','error','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipShowRegistry','actionDeviceStateList','catch','inspect'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2032,0xd9));var _0x2203=function(_0x56bf79,_0x5310c8){_0x56bf79=_0x56bf79-0x0;var _0x48e636=_0x2032[_0x56bf79];return _0x48e636;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x2203('0x0'));var moment=require(_0x2203('0x1'));var util=require(_0x2203('0x2'));var _=require('lodash');var logger=require(_0x2203('0x3'))(_0x2203('0x4'));var config=require('../../config/environment');var ami=new Manager(config[_0x2203('0x5')][_0x2203('0x6')],config[_0x2203('0x5')]['ip'],config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')][_0x2203('0x8')],!![]);ami[_0x2203('0x9')]();ami[_0x2203('0xa')]=BPromise[_0x2203('0xb')](ami[_0x2203('0xc')]);function error(_0x5ecf9e){logger['error'](util[_0x2203('0xd')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')],util['inspect'](_0x5ecf9e,![],null)));}function close(){logger[_0x2203('0xe')](util['format'](_0x2203('0xf'),config[_0x2203('0x5')]['username'],config['asterisk']['ip'],config['asterisk']['port']));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x2203('0xa')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x10')});};};ami[_0x2203('0x11')]=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x12')});};};ami[_0x2203('0x13')]=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x14')});};};ami[_0x2203('0x15')]=function(){return function(){return ami[_0x2203('0xa')]({'action':'coreshowchannels'});};};function connect(_0x280eda){logger[_0x2203('0x16')](util['format'](_0x2203('0x17'),config[_0x2203('0x5')]['username'],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')]));ami[_0x2203('0x18')](_0x2203('0xe'),error);ami[_0x2203('0x18')](_0x2203('0x19'),close);}ami['on'](_0x2203('0x1a'),connect);ami['on']('shutdown',function(_0x13d3f7){logger['info'](util['format'](_0x2203('0x1b'),config['asterisk'][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')],util['inspect'](_0x13d3f7,![],null)));});ami['on']('fullybooted',function(_0x226374){logger[_0x2203('0x16')](util[_0x2203('0xd')](_0x2203('0x1c'),config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config[_0x2203('0x5')]['port']));return BPromise[_0x2203('0x1d')]()[_0x2203('0x1e')](ami[_0x2203('0x1f')]())['then'](ami[_0x2203('0x20')]())[_0x2203('0x1e')](ami['actionSipPeerStatus']())[_0x2203('0x1e')](ami[_0x2203('0x13')]())[_0x2203('0x1e')](ami[_0x2203('0x15')]())[_0x2203('0x21')](function(_0x1df508){logger[_0x2203('0xe')]('[ami.js][fullybooted]',util[_0x2203('0x22')](_0x1df508,{'showHidden':![],'depth':null}));});});ami[_0x2203('0x18')](_0x2203('0xe'),error);ami[_0x2203('0x18')]('close',close);module[_0x2203('0x23')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index b7c4ad7..b432211 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 _0x9ffd=['catch','exports','jayson/promise','bluebird','../../config/logger','client','http','Request','then','debug','rpc','memberReport','error','result'];(function(_0x144c7b,_0x29683a){var _0xe7dfe8=function(_0x1b2985){while(--_0x1b2985){_0x144c7b['push'](_0x144c7b['shift']());}};_0xe7dfe8(++_0x29683a);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x19c045,_0x4848fd){_0x19c045=_0x19c045-0x0;var _0x4a983f=_0x9ffd[_0x19c045];return _0x4a983f;};'use strict';var jayson=require(_0xd9ff('0x0'));var BPromise=require(_0xd9ff('0x1'));var logger=require(_0xd9ff('0x2'))('ami');var client=jayson[_0xd9ff('0x3')][_0xd9ff('0x4')]({'port':0x2329});client[_0xd9ff('0x5')]=function(_0x5493ae,_0x53e962){return new BPromise(function(_0x1c9460,_0x111697){return client['request'](_0x5493ae,_0x53e962)[_0xd9ff('0x6')](function(_0x2982c3){logger[_0xd9ff('0x7')](_0xd9ff('0x8'),_0xd9ff('0x9'),_0x5493ae,_0x53e962,_0x2982c3);if(_0x2982c3[_0xd9ff('0xa')]){logger[_0xd9ff('0xa')](_0xd9ff('0x8'),_0xd9ff('0x9'),_0x5493ae,_0x2982c3['error']['message'],_0x53e962);return _0x111697(_0x2982c3['error']['message']);}else{return _0x1c9460(_0x2982c3[_0xd9ff('0xb')]);}})[_0xd9ff('0xc')](function(_0x193537){logger[_0xd9ff('0xa')](_0xd9ff('0x8'),_0xd9ff('0x9'),_0x5493ae,_0x193537,_0x53e962);return _0x111697(_0x193537);});});};module[_0xd9ff('0xd')]=client; \ No newline at end of file +var _0x0713=['rpc','memberReport','error','message','result','catch','exports','../../config/logger','ami','client','http','Request','request','then','debug'];(function(_0x55dfae,_0x265c60){var _0x56a608=function(_0x4efe02){while(--_0x4efe02){_0x55dfae['push'](_0x55dfae['shift']());}};_0x56a608(++_0x265c60);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var client=jayson[_0x3071('0x2')][_0x3071('0x3')]({'port':0x2329});client[_0x3071('0x4')]=function(_0x52b5fb,_0x2c547f){return new BPromise(function(_0x7b18a4,_0x33a70c){return client[_0x3071('0x5')](_0x52b5fb,_0x2c547f)[_0x3071('0x6')](function(_0x41cf76){logger[_0x3071('0x7')](_0x3071('0x8'),_0x3071('0x9'),_0x52b5fb,_0x2c547f,_0x41cf76);if(_0x41cf76[_0x3071('0xa')]){logger[_0x3071('0xa')](_0x3071('0x8'),_0x3071('0x9'),_0x52b5fb,_0x41cf76['error'][_0x3071('0xb')],_0x2c547f);return _0x33a70c(_0x41cf76[_0x3071('0xa')][_0x3071('0xb')]);}else{return _0x7b18a4(_0x41cf76[_0x3071('0xc')]);}})[_0x3071('0xd')](function(_0x4a470a){logger[_0x3071('0xa')](_0x3071('0x8'),_0x3071('0x9'),_0x52b5fb,_0x4a470a,_0x2c547f);return _0x33a70c(_0x4a470a);});});};module[_0x3071('0xe')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index ba3490f..a8ced6b 100644 --- a/server/services/ami/dialer/action.js +++ b/server/services/ami/dialer/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x69af=['countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','UserId','VoiceQueueId','CampaignId','starttime','format','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>','substring','dialCutDigit','getQueue','exports','util','lodash','moment','string','isNil','voiceQueue','uniqueid','name','Contact','phone','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry'];(function(_0x45ff95,_0x4c138e){var _0x3ff0a7=function(_0x4163a7){while(--_0x4163a7){_0x45ff95['push'](_0x45ff95['shift']());}};_0x3ff0a7(++_0x4c138e);}(_0x69af,0xf4));var _0xf69a=function(_0x162605,_0x35e275){_0x162605=_0x162605-0x0;var _0x271643=_0x69af[_0x162605];return _0x271643;};'use strict';var util=require(_0xf69a('0x0'));var _=require(_0xf69a('0x1'));var moment=require(_0xf69a('0x2'));function checkNameSurname(_0x378d91,_0x502211,_0x5da02){var _0x54c3be='';if(!_['isNil'](_0x502211)&&_0xf69a('0x3')===typeof _0x502211){_0x54c3be+=_0x502211;}if(!_[_0xf69a('0x4')](_0x5da02)&&_0xf69a('0x3')===typeof _0x5da02){_0x54c3be+='\x20'+_0x5da02;}if(_0x54c3be!==''){return _0x54c3be;}return _0x378d91;}function Action(_0x14decf,_0x339cd6,_0x2b492c){this[_0xf69a('0x5')]=_0x14decf;this[_0xf69a('0x6')]=_0x2b492c||undefined;this[_0xf69a('0x7')]=checkNameSurname(_0x339cd6[_0xf69a('0x8')][_0xf69a('0x9')],_0x339cd6[_0xf69a('0x8')][_0xf69a('0xa')],_0x339cd6[_0xf69a('0x8')][_0xf69a('0xb')]);this[_0xf69a('0xc')]=_0x339cd6[_0xf69a('0x8')]['phone'];this[_0xf69a('0xd')]=_0x14decf[_0xf69a('0x7')];this[_0xf69a('0xe')]=_0x339cd6['active']||![];this[_0xf69a('0xf')]=_0x14decf[_0xf69a('0xf')];this['dialQueueTimeout']=_0x14decf[_0xf69a('0x10')]||0x3;this[_0xf69a('0x11')]=_0x339cd6[_0xf69a('0x11')];this[_0xf69a('0x12')]=_0x339cd6[_0xf69a('0x12')];this[_0xf69a('0x13')]=_0x339cd6['countcongestionretry'];this[_0xf69a('0x14')]=_0x339cd6[_0xf69a('0x14')];this[_0xf69a('0x15')]=_0x339cd6[_0xf69a('0x15')];this[_0xf69a('0x16')]=_0x339cd6[_0xf69a('0x16')];this[_0xf69a('0x17')]=_0x339cd6[_0xf69a('0x17')];this[_0xf69a('0x18')]=_0x339cd6['countmachineretry'];this[_0xf69a('0x19')]=_0x339cd6[_0xf69a('0x19')];this[_0xf69a('0x1a')]=_0x339cd6[_0xf69a('0x1a')];this['ListId']=_0x339cd6['ListId'];this[_0xf69a('0x1b')]=_0x339cd6['UserId'];this[_0xf69a('0x1c')]=_0x339cd6[_0xf69a('0x1c')];this['CampaignId']=_0x339cd6[_0xf69a('0x1d')];this['idHopper']=_0x339cd6['id'];this['ContactFirstName']=_0x339cd6[_0xf69a('0x8')][_0xf69a('0xa')]||'';this[_0xf69a('0x1e')]=moment()[_0xf69a('0x1f')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xf69a('0x20')]=_0x339cd6[_0xf69a('0x20')];this[_0xf69a('0x21')]=_0x339cd6[_0xf69a('0x21')];this[_0xf69a('0x22')]=_0x339cd6['callbackat'];this[_0xf69a('0x23')]=_0x339cd6[_0xf69a('0x23')];this[_0xf69a('0x24')]='';this[_0xf69a('0x25')]='';}Action[_0xf69a('0x26')]['getCaller']=function(){return util[_0xf69a('0x1f')](_0xf69a('0x27'),this[_0xf69a('0x7')],this[_0xf69a('0x5')]['dialCutDigit']>0x0?this[_0xf69a('0xc')][_0xf69a('0x28')](this[_0xf69a('0x5')][_0xf69a('0x29')]):this['number']);};Action[_0xf69a('0x26')][_0xf69a('0x2a')]=function(){return this[_0xf69a('0xd')];};module[_0xf69a('0x2b')]=Action; \ No newline at end of file +var _0x6d1c=['phone','lastName','number','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','firstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','prototype','\x22%s\x22\x20<%s>','dialCutDigit','substring','queue','util','lodash','string','isNil','voiceQueue','uniqueid','name','Contact'];(function(_0x21c0de,_0x4a9720){var _0x32229e=function(_0x275c29){while(--_0x275c29){_0x21c0de['push'](_0x21c0de['shift']());}};_0x32229e(++_0x4a9720);}(_0x6d1c,0xcf));var _0xc6d1=function(_0x4e783c,_0x51a362){_0x4e783c=_0x4e783c-0x0;var _0x2fbd6d=_0x6d1c[_0x4e783c];return _0x2fbd6d;};'use strict';var util=require(_0xc6d1('0x0'));var _=require(_0xc6d1('0x1'));var moment=require('moment');function checkNameSurname(_0x5674de,_0xf19335,_0x194fd3){var _0xfc00a3='';if(!_['isNil'](_0xf19335)&&_0xc6d1('0x2')===typeof _0xf19335){_0xfc00a3+=_0xf19335;}if(!_[_0xc6d1('0x3')](_0x194fd3)&&_0xc6d1('0x2')===typeof _0x194fd3){_0xfc00a3+='\x20'+_0x194fd3;}if(_0xfc00a3!==''){return _0xfc00a3;}return _0x5674de;}function Action(_0x14665c,_0x22141c,_0x2d2fc5){this[_0xc6d1('0x4')]=_0x14665c;this[_0xc6d1('0x5')]=_0x2d2fc5||undefined;this[_0xc6d1('0x6')]=checkNameSurname(_0x22141c[_0xc6d1('0x7')][_0xc6d1('0x8')],_0x22141c[_0xc6d1('0x7')]['firstName'],_0x22141c[_0xc6d1('0x7')][_0xc6d1('0x9')]);this[_0xc6d1('0xa')]=_0x22141c[_0xc6d1('0x7')][_0xc6d1('0x8')];this['queue']=_0x14665c[_0xc6d1('0x6')];this[_0xc6d1('0xb')]=_0x22141c[_0xc6d1('0xb')]||![];this[_0xc6d1('0xc')]=_0x14665c[_0xc6d1('0xc')];this['dialQueueTimeout']=_0x14665c[_0xc6d1('0xd')]||0x3;this[_0xc6d1('0xe')]=_0x22141c[_0xc6d1('0xe')];this['countbusyretry']=_0x22141c[_0xc6d1('0xf')];this[_0xc6d1('0x10')]=_0x22141c[_0xc6d1('0x10')];this['countnoanswerretry']=_0x22141c[_0xc6d1('0x11')];this[_0xc6d1('0x12')]=_0x22141c[_0xc6d1('0x12')];this['countdropretry']=_0x22141c[_0xc6d1('0x13')];this[_0xc6d1('0x14')]=_0x22141c[_0xc6d1('0x14')];this[_0xc6d1('0x15')]=_0x22141c[_0xc6d1('0x15')];this[_0xc6d1('0x16')]=_0x22141c[_0xc6d1('0x16')];this[_0xc6d1('0x17')]=_0x22141c[_0xc6d1('0x17')];this[_0xc6d1('0x18')]=_0x22141c[_0xc6d1('0x18')];this[_0xc6d1('0x19')]=_0x22141c['UserId'];this[_0xc6d1('0x1a')]=_0x22141c['VoiceQueueId'];this[_0xc6d1('0x1b')]=_0x22141c['CampaignId'];this[_0xc6d1('0x1c')]=_0x22141c['id'];this[_0xc6d1('0x1d')]=_0x22141c[_0xc6d1('0x7')][_0xc6d1('0x1e')]||'';this[_0xc6d1('0x1f')]=moment()[_0xc6d1('0x20')](_0xc6d1('0x21'));this['callback']=_0x22141c[_0xc6d1('0x22')];this[_0xc6d1('0x23')]=_0x22141c['callbackuniqueid'];this[_0xc6d1('0x24')]=_0x22141c[_0xc6d1('0x24')];this[_0xc6d1('0x25')]=_0x22141c[_0xc6d1('0x25')];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0xc6d1('0x26')]['getCaller']=function(){return util[_0xc6d1('0x20')](_0xc6d1('0x27'),this[_0xc6d1('0x6')],this[_0xc6d1('0x4')][_0xc6d1('0x28')]>0x0?this[_0xc6d1('0xa')][_0xc6d1('0x29')](this[_0xc6d1('0x4')][_0xc6d1('0x28')]):this[_0xc6d1('0xa')]);};Action[_0xc6d1('0x26')]['getQueue']=function(){return this[_0xc6d1('0x2a')];};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index b6121b2..5b6068c 100644 --- a/server/services/ami/dialer/agentComplete.js +++ b/server/services/ami/dialer/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0668=['campaigntype','outbound','queue','type','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','number','starttime','responsetime','answertime','format','ringtime','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','util','lodash','moment','milliseconds','statedesc','Answer','scheduledat'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0668,0x19d));var _0x8066=function(_0x1dfbdf,_0x459d58){_0x1dfbdf=_0x1dfbdf-0x0;var _0x2893a6=_0x0668[_0x1dfbdf];return _0x2893a6;};'use strict';var util=require(_0x8066('0x0'));var _=require(_0x8066('0x1'));var moment=require(_0x8066('0x2'));function getSeconds(_0x1acfe1,_0x2e7e28){var _0x29c03c=moment(_0x1acfe1)[_0x8066('0x3')](0x0);var _0x36a231=moment(_0x2e7e28)['milliseconds'](0x0);return _0x29c03c['diff'](_0x36a231,'seconds');}function AgentComplete(_0x402c0b,_0x9378d2){this['state']=0x4;this[_0x8066('0x4')]=_0x8066('0x5');this['scheduledat']=_0x402c0b[_0x8066('0x6')];this['type']=_0x402c0b['type'];this[_0x8066('0x7')]=_0x402c0b['type']===_0x8066('0x8')?_0x8066('0x9'):_0x402c0b[_0x8066('0xa')];this[_0x8066('0xb')]=_0x402c0b[_0x8066('0xb')];this['countcongestionretry']=_0x402c0b['countcongestionretry'];this[_0x8066('0xc')]=_0x402c0b['countnoanswerretry'];this[_0x8066('0xd')]=_0x402c0b[_0x8066('0xb')]+_0x402c0b[_0x8066('0xe')]+_0x402c0b['countnoanswerretry']+_0x402c0b[_0x8066('0xf')]+_0x402c0b[_0x8066('0x10')]+_0x402c0b['countabandonedretry']+_0x402c0b['countmachineretry']+_0x402c0b['countagentrejectretry'];this[_0x8066('0xf')]=_0x402c0b[_0x8066('0xf')];this[_0x8066('0x10')]=_0x402c0b['countdropretry'];this[_0x8066('0x11')]=_0x402c0b[_0x8066('0x11')];this[_0x8066('0x12')]=_0x402c0b[_0x8066('0x12')];this[_0x8066('0x13')]=_0x402c0b[_0x8066('0x13')];this[_0x8066('0x14')]=_0x9378d2[_0x8066('0x14')];this['calleridname']=_0x402c0b[_0x8066('0x15')];this['calleridnum']=_0x402c0b[_0x8066('0x16')];this[_0x8066('0x17')]=_0x402c0b['starttime'];this[_0x8066('0x18')]=_0x402c0b[_0x8066('0x18')];this['answertime']=_0x402c0b[_0x8066('0x19')];this['endtime']=moment()[_0x8066('0x1a')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x8066('0x1b')]=getSeconds(_0x402c0b[_0x8066('0x18')],_0x402c0b[_0x8066('0x17')]);this[_0x8066('0x1c')]=getSeconds(_0x402c0b[_0x8066('0x19')],_0x402c0b[_0x8066('0x18')]);this[_0x8066('0x1d')]=getSeconds(this['endtime'],_0x402c0b[_0x8066('0x19')]);this['queue']=_0x9378d2[_0x8066('0x9')];this['membername']=_0x9378d2[_0x8066('0x1e')];this[_0x8066('0x1f')]=_0x9378d2[_0x8066('0x1f')];this[_0x8066('0x20')]=_0x402c0b[_0x8066('0x20')];this[_0x8066('0x21')]=_0x402c0b[_0x8066('0x21')];this[_0x8066('0x22')]=_0x402c0b[_0x8066('0x22')];this[_0x8066('0x23')]=_0x402c0b[_0x8066('0x23')];this[_0x8066('0x24')]=_0x402c0b['ContactId'];this[_0x8066('0x25')]=_0x402c0b['ListId'];this[_0x8066('0x26')]=_0x402c0b[_0x8066('0x26')];this[_0x8066('0x27')]=_0x402c0b['VoiceQueueId'];this[_0x8066('0x28')]=_0x402c0b[_0x8066('0x28')];this['originatecalleridnum']=_0x402c0b['originatecalleridnum']||'';this[_0x8066('0x29')]=_0x402c0b['originatecalleridname']||'';}module['exports']=AgentComplete; \ No newline at end of file +var _0xa000=['scheduledat','type','campaigntype','outbound','queue','countcongestionretry','countnoanswerretry','countbusyretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','answertime','membername','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','state','statedesc'];(function(_0x36d38e,_0x55a8af){var _0x1c145c=function(_0x2abd78){while(--_0x2abd78){_0x36d38e['push'](_0x36d38e['shift']());}};_0x1c145c(++_0x55a8af);}(_0xa000,0x162));var _0x0a00=function(_0x14529e,_0x3db79e){_0x14529e=_0x14529e-0x0;var _0x27e554=_0xa000[_0x14529e];return _0x27e554;};'use strict';var util=require(_0x0a00('0x0'));var _=require(_0x0a00('0x1'));var moment=require(_0x0a00('0x2'));function getSeconds(_0xe5476d,_0x777fc1){var _0x3745a1=moment(_0xe5476d)[_0x0a00('0x3')](0x0);var _0x33926e=moment(_0x777fc1)['milliseconds'](0x0);return _0x3745a1['diff'](_0x33926e,'seconds');}function AgentComplete(_0x43fb51,_0x22c112){this[_0x0a00('0x4')]=0x4;this[_0x0a00('0x5')]='Answer';this['scheduledat']=_0x43fb51[_0x0a00('0x6')];this[_0x0a00('0x7')]=_0x43fb51[_0x0a00('0x7')];this[_0x0a00('0x8')]=_0x43fb51[_0x0a00('0x7')]===_0x0a00('0x9')?_0x0a00('0xa'):_0x43fb51[_0x0a00('0x7')];this['countbusyretry']=_0x43fb51['countbusyretry'];this[_0x0a00('0xb')]=_0x43fb51[_0x0a00('0xb')];this[_0x0a00('0xc')]=_0x43fb51[_0x0a00('0xc')];this['countglobal']=_0x43fb51[_0x0a00('0xd')]+_0x43fb51['countcongestionretry']+_0x43fb51[_0x0a00('0xc')]+_0x43fb51['countnosuchnumberretry']+_0x43fb51['countdropretry']+_0x43fb51['countabandonedretry']+_0x43fb51[_0x0a00('0xe')]+_0x43fb51[_0x0a00('0xf')];this['countnosuchnumberretry']=_0x43fb51[_0x0a00('0x10')];this['countdropretry']=_0x43fb51['countdropretry'];this[_0x0a00('0x11')]=_0x43fb51[_0x0a00('0x11')];this['countmachineretry']=_0x43fb51[_0x0a00('0xe')];this['countagentrejectretry']=_0x43fb51[_0x0a00('0xf')];this['uniqueid']=_0x22c112[_0x0a00('0x12')];this[_0x0a00('0x13')]=_0x43fb51[_0x0a00('0x14')];this[_0x0a00('0x15')]=_0x43fb51[_0x0a00('0x16')];this[_0x0a00('0x17')]=_0x43fb51[_0x0a00('0x17')];this[_0x0a00('0x18')]=_0x43fb51[_0x0a00('0x18')];this['answertime']=_0x43fb51['answertime'];this[_0x0a00('0x19')]=moment()['format'](_0x0a00('0x1a'));this[_0x0a00('0x1b')]=getSeconds(_0x43fb51['responsetime'],_0x43fb51[_0x0a00('0x17')]);this['holdtime']=getSeconds(_0x43fb51[_0x0a00('0x1c')],_0x43fb51[_0x0a00('0x18')]);this['talktime']=getSeconds(this[_0x0a00('0x19')],_0x43fb51[_0x0a00('0x1c')]);this[_0x0a00('0xa')]=_0x22c112[_0x0a00('0xa')];this[_0x0a00('0x1d')]=_0x22c112['membername'];this['reason']=_0x22c112['reason'];this[_0x0a00('0x1e')]=_0x43fb51[_0x0a00('0x1e')];this['callbackuniqueid']=_0x43fb51['callbackuniqueid'];this['callbackat']=_0x43fb51[_0x0a00('0x1f')];this[_0x0a00('0x20')]=_0x43fb51[_0x0a00('0x20')];this[_0x0a00('0x21')]=_0x43fb51['ContactId'];this[_0x0a00('0x22')]=_0x43fb51['ListId'];this[_0x0a00('0x23')]=_0x43fb51['UserId'];this[_0x0a00('0x24')]=_0x43fb51[_0x0a00('0x24')];this[_0x0a00('0x25')]=_0x43fb51[_0x0a00('0x25')];this[_0x0a00('0x26')]=_0x43fb51[_0x0a00('0x26')]||'';this[_0x0a00('0x27')]=_0x43fb51['originatecalleridname']||'';}module['exports']=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 0254834..b00c488 100644 --- a/server/services/ami/dialer/final.js +++ b/server/services/ami/dialer/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdd0c=['diff','seconds','uniqueid','scheduledat','type','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','queue','calleridname','calleridnum','starttime','responsetime','endtime','holdtime','talktime','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds'];(function(_0x4e2af2,_0x548fbd){var _0x584ac9=function(_0xe41ee8){while(--_0xe41ee8){_0x4e2af2['push'](_0x4e2af2['shift']());}};_0x584ac9(++_0x548fbd);}(_0xdd0c,0x165));var _0xcdd0=function(_0x329314,_0x2fdbbd){_0x329314=_0x329314-0x0;var _0x379ae6=_0xdd0c[_0x329314];return _0x379ae6;};'use strict';var util=require('util');var _=require(_0xcdd0('0x0'));var moment=require(_0xcdd0('0x1'));function getSeconds(_0x3c0b5d,_0x5e3ada){var _0xe8ed9=moment(_0x3c0b5d)['milliseconds'](0x0);var _0x3d8684=moment(_0x5e3ada)[_0xcdd0('0x2')](0x0);return _0xe8ed9[_0xcdd0('0x3')](_0x3d8684,_0xcdd0('0x4'));}function Final(_0x17ad7d){this['uniqueid']=_0x17ad7d[_0xcdd0('0x5')];this[_0xcdd0('0x6')]=_0x17ad7d[_0xcdd0('0x6')];this[_0xcdd0('0x7')]=_0x17ad7d[_0xcdd0('0x7')];this['campaigntype']=_0x17ad7d[_0xcdd0('0x7')]==='outbound'?'queue':_0x17ad7d[_0xcdd0('0x7')];this[_0xcdd0('0x8')]=_0x17ad7d[_0xcdd0('0x8')];this[_0xcdd0('0x9')]=_0x17ad7d[_0xcdd0('0x9')];this[_0xcdd0('0xa')]=_0x17ad7d[_0xcdd0('0xa')];this[_0xcdd0('0xb')]=_0x17ad7d[_0xcdd0('0x8')]+_0x17ad7d[_0xcdd0('0x9')]+_0x17ad7d['countnoanswerretry']+_0x17ad7d['countnosuchnumberretry']+_0x17ad7d[_0xcdd0('0xc')]+_0x17ad7d[_0xcdd0('0xd')]+_0x17ad7d['countmachineretry']+_0x17ad7d[_0xcdd0('0xe')];this[_0xcdd0('0xf')]=_0x17ad7d['countnosuchnumberretry'];this[_0xcdd0('0xc')]=_0x17ad7d[_0xcdd0('0xc')];this[_0xcdd0('0xd')]=_0x17ad7d[_0xcdd0('0xd')];this[_0xcdd0('0x10')]=_0x17ad7d['countmachineretry'];this['countagentrejectretry']=_0x17ad7d[_0xcdd0('0xe')];this[_0xcdd0('0x11')]=_0x17ad7d[_0xcdd0('0x11')];this[_0xcdd0('0x12')]=_0x17ad7d[_0xcdd0('0x12')];this[_0xcdd0('0x13')]=_0x17ad7d[_0xcdd0('0x13')];this[_0xcdd0('0x14')]=_0x17ad7d[_0xcdd0('0x14')];this[_0xcdd0('0x15')]=_0x17ad7d['responsetime'];this[_0xcdd0('0x16')]=_0x17ad7d[_0xcdd0('0x15')];this['ringtime']=_0x17ad7d['ringtime']||0x0;this[_0xcdd0('0x17')]=_0x17ad7d[_0xcdd0('0x17')]||0x0;this['talktime']=_0x17ad7d[_0xcdd0('0x18')]||0x0;this['callback']=_0x17ad7d['callback'];this['callbackuniqueid']=_0x17ad7d[_0xcdd0('0x19')];this[_0xcdd0('0x1a')]=_0x17ad7d['callbackat'];this[_0xcdd0('0x1b')]=_0x17ad7d[_0xcdd0('0x1b')];this[_0xcdd0('0x1c')]=_0x17ad7d['ContactId'];this[_0xcdd0('0x1d')]=_0x17ad7d[_0xcdd0('0x1d')];this['UserId']=_0x17ad7d[_0xcdd0('0x1e')];this[_0xcdd0('0x1f')]=_0x17ad7d['VoiceQueueId'];this[_0xcdd0('0x20')]=_0x17ad7d['CampaignId'];this[_0xcdd0('0x21')]=_0x17ad7d[_0xcdd0('0x21')]||'';this[_0xcdd0('0x22')]=_0x17ad7d['originatecalleridname']||'';}module[_0xcdd0('0x23')]=Final; \ No newline at end of file +var _0xcca7=['milliseconds','diff','seconds','uniqueid','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment'];(function(_0x1ab8fa,_0x543ec5){var _0x8d09a=function(_0x2d1cd8){while(--_0x2d1cd8){_0x1ab8fa['push'](_0x1ab8fa['shift']());}};_0x8d09a(++_0x543ec5);}(_0xcca7,0x1aa));var _0x7cca=function(_0x2bb044,_0x553025){_0x2bb044=_0x2bb044-0x0;var _0x145cb5=_0xcca7[_0x2bb044];return _0x145cb5;};'use strict';var util=require(_0x7cca('0x0'));var _=require(_0x7cca('0x1'));var moment=require(_0x7cca('0x2'));function getSeconds(_0x33db4f,_0x5cfce5){var _0x4c311e=moment(_0x33db4f)[_0x7cca('0x3')](0x0);var _0x533b00=moment(_0x5cfce5)[_0x7cca('0x3')](0x0);return _0x4c311e[_0x7cca('0x4')](_0x533b00,_0x7cca('0x5'));}function Final(_0x312e98){this[_0x7cca('0x6')]=_0x312e98[_0x7cca('0x6')];this['scheduledat']=_0x312e98['scheduledat'];this[_0x7cca('0x7')]=_0x312e98[_0x7cca('0x7')];this[_0x7cca('0x8')]=_0x312e98[_0x7cca('0x7')]===_0x7cca('0x9')?_0x7cca('0xa'):_0x312e98[_0x7cca('0x7')];this[_0x7cca('0xb')]=_0x312e98[_0x7cca('0xb')];this[_0x7cca('0xc')]=_0x312e98['countcongestionretry'];this[_0x7cca('0xd')]=_0x312e98[_0x7cca('0xd')];this[_0x7cca('0xe')]=_0x312e98[_0x7cca('0xb')]+_0x312e98[_0x7cca('0xc')]+_0x312e98['countnoanswerretry']+_0x312e98[_0x7cca('0xf')]+_0x312e98[_0x7cca('0x10')]+_0x312e98[_0x7cca('0x11')]+_0x312e98['countmachineretry']+_0x312e98['countagentrejectretry'];this[_0x7cca('0xf')]=_0x312e98[_0x7cca('0xf')];this[_0x7cca('0x10')]=_0x312e98[_0x7cca('0x10')];this[_0x7cca('0x11')]=_0x312e98[_0x7cca('0x11')];this[_0x7cca('0x12')]=_0x312e98['countmachineretry'];this[_0x7cca('0x13')]=_0x312e98['countagentrejectretry'];this['queue']=_0x312e98['queue'];this[_0x7cca('0x14')]=_0x312e98[_0x7cca('0x14')];this[_0x7cca('0x15')]=_0x312e98[_0x7cca('0x15')];this[_0x7cca('0x16')]=_0x312e98['starttime'];this[_0x7cca('0x17')]=_0x312e98['responsetime'];this['endtime']=_0x312e98['responsetime'];this[_0x7cca('0x18')]=_0x312e98[_0x7cca('0x18')]||0x0;this[_0x7cca('0x19')]=_0x312e98[_0x7cca('0x19')]||0x0;this[_0x7cca('0x1a')]=_0x312e98[_0x7cca('0x1a')]||0x0;this[_0x7cca('0x1b')]=_0x312e98[_0x7cca('0x1b')];this['callbackuniqueid']=_0x312e98[_0x7cca('0x1c')];this[_0x7cca('0x1d')]=_0x312e98[_0x7cca('0x1d')];this[_0x7cca('0x1e')]=_0x312e98['recallme'];this[_0x7cca('0x1f')]=_0x312e98[_0x7cca('0x1f')];this[_0x7cca('0x20')]=_0x312e98[_0x7cca('0x20')];this[_0x7cca('0x21')]=_0x312e98[_0x7cca('0x21')];this[_0x7cca('0x22')]=_0x312e98[_0x7cca('0x22')];this['CampaignId']=_0x312e98[_0x7cca('0x23')];this[_0x7cca('0x24')]=_0x312e98[_0x7cca('0x24')]||'';this[_0x7cca('0x25')]=_0x312e98[_0x7cca('0x25')]||'';}module[_0x7cca('0x26')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index e974642..c6000d6 100644 --- a/server/services/ami/dialer/hangup.js +++ b/server/services/ami/dialer/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1701=['talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','util','lodash','moment','milliseconds','diff','seconds','state','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countmachineretry','countagentrejectretry','countdropretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime'];(function(_0x6f76f5,_0xaa19d4){var _0x11d801=function(_0x57acee){while(--_0x57acee){_0x6f76f5['push'](_0x6f76f5['shift']());}};_0x11d801(++_0xaa19d4);}(_0x1701,0xf4));var _0x1170=function(_0x2acfe9,_0x55cd0c){_0x2acfe9=_0x2acfe9-0x0;var _0x374599=_0x1701[_0x2acfe9];return _0x374599;};'use strict';var util=require(_0x1170('0x0'));var _=require(_0x1170('0x1'));var moment=require(_0x1170('0x2'));function getSeconds(_0x409978,_0x19e12c){var _0x51b342=moment(_0x409978)[_0x1170('0x3')](0x0);var _0x146845=moment(_0x19e12c)[_0x1170('0x3')](0x0);return _0x51b342[_0x1170('0x4')](_0x146845,_0x1170('0x5'));}function Hangup(_0x5d14e1,_0x5b2695){this[_0x1170('0x6')]=0x4;this['statedesc']=_0x1170('0x7');this[_0x1170('0x8')]=_0x5d14e1[_0x1170('0x8')];this[_0x1170('0x9')]=_0x5d14e1[_0x1170('0x9')];this[_0x1170('0xa')]=_0x5d14e1[_0x1170('0x9')]===_0x1170('0xb')?_0x1170('0xc'):_0x5d14e1[_0x1170('0x9')];this['countbusyretry']=_0x5d14e1[_0x1170('0xd')];this[_0x1170('0xe')]=_0x5d14e1[_0x1170('0xe')];this[_0x1170('0xf')]=_0x5d14e1[_0x1170('0xf')];this[_0x1170('0x10')]=_0x5d14e1[_0x1170('0xd')]+_0x5d14e1[_0x1170('0xe')]+_0x5d14e1[_0x1170('0xf')]+_0x5d14e1[_0x1170('0x11')]+_0x5d14e1['countdropretry']+_0x5d14e1['countabandonedretry']+_0x5d14e1[_0x1170('0x12')]+_0x5d14e1[_0x1170('0x13')];this['countnosuchnumberretry']=_0x5d14e1[_0x1170('0x11')];this['countdropretry']=_0x5d14e1[_0x1170('0x14')];this[_0x1170('0x15')]=_0x5d14e1[_0x1170('0x15')];this[_0x1170('0x12')]=_0x5d14e1[_0x1170('0x12')];this[_0x1170('0x13')]=_0x5d14e1[_0x1170('0x13')];this[_0x1170('0x16')]=_0x5b2695[_0x1170('0x16')];this[_0x1170('0x17')]=_0x5d14e1[_0x1170('0x18')];this[_0x1170('0x19')]=_0x5d14e1['number'];this[_0x1170('0x1a')]=_0x5d14e1[_0x1170('0x1a')];this[_0x1170('0x1b')]=_0x5d14e1['responsetime'];this[_0x1170('0x1c')]=moment()['format'](_0x1170('0x1d'));this[_0x1170('0x1e')]=getSeconds(_0x5d14e1[_0x1170('0x1b')],_0x5d14e1[_0x1170('0x1a')]);this[_0x1170('0x1f')]=0x0;this[_0x1170('0x20')]=getSeconds(this['endtime'],_0x5d14e1['responsetime']);this[_0x1170('0xc')]=_0x5d14e1[_0x1170('0xc')];this[_0x1170('0x21')]=_0x1170('0x22');this[_0x1170('0x23')]=_0x5b2695[_0x1170('0x24')];this[_0x1170('0x25')]=_0x5d14e1[_0x1170('0x25')];this[_0x1170('0x26')]=_0x5d14e1[_0x1170('0x26')];this['callbackat']=_0x5d14e1[_0x1170('0x27')];this[_0x1170('0x28')]=_0x5d14e1['recallme'];this[_0x1170('0x29')]=_0x5d14e1[_0x1170('0x29')];this[_0x1170('0x2a')]=_0x5d14e1[_0x1170('0x2a')];this[_0x1170('0x2b')]=_0x5d14e1[_0x1170('0x2b')];this[_0x1170('0x2c')]=_0x5d14e1[_0x1170('0x2c')];this[_0x1170('0x2d')]=_0x5d14e1[_0x1170('0x2d')];}module['exports']=Hangup; \ No newline at end of file +var _0x3727=['Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','format','ringtime','holdtime','talktime','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc'];(function(_0x931e6b,_0x96f9a6){var _0x599365=function(_0x5324f4){while(--_0x5324f4){_0x931e6b['push'](_0x931e6b['shift']());}};_0x599365(++_0x96f9a6);}(_0x3727,0x7f));var _0x7372=function(_0x5fec98,_0x221ed8){_0x5fec98=_0x5fec98-0x0;var _0x3c9c47=_0x3727[_0x5fec98];return _0x3c9c47;};'use strict';var util=require(_0x7372('0x0'));var _=require(_0x7372('0x1'));var moment=require(_0x7372('0x2'));function getSeconds(_0x235a6e,_0x4d2825){var _0x572c8e=moment(_0x235a6e)[_0x7372('0x3')](0x0);var _0x559392=moment(_0x4d2825)[_0x7372('0x3')](0x0);return _0x572c8e[_0x7372('0x4')](_0x559392,_0x7372('0x5'));}function Hangup(_0x400033,_0x1d7d90){this[_0x7372('0x6')]=0x4;this[_0x7372('0x7')]=_0x7372('0x8');this[_0x7372('0x9')]=_0x400033[_0x7372('0x9')];this['type']=_0x400033[_0x7372('0xa')];this[_0x7372('0xb')]=_0x400033[_0x7372('0xa')]===_0x7372('0xc')?_0x7372('0xd'):_0x400033[_0x7372('0xa')];this[_0x7372('0xe')]=_0x400033['countbusyretry'];this['countcongestionretry']=_0x400033[_0x7372('0xf')];this[_0x7372('0x10')]=_0x400033[_0x7372('0x10')];this[_0x7372('0x11')]=_0x400033[_0x7372('0xe')]+_0x400033[_0x7372('0xf')]+_0x400033[_0x7372('0x10')]+_0x400033[_0x7372('0x12')]+_0x400033[_0x7372('0x13')]+_0x400033['countabandonedretry']+_0x400033['countmachineretry']+_0x400033[_0x7372('0x14')];this[_0x7372('0x12')]=_0x400033['countnosuchnumberretry'];this['countdropretry']=_0x400033[_0x7372('0x13')];this['countabandonedretry']=_0x400033['countabandonedretry'];this['countmachineretry']=_0x400033['countmachineretry'];this[_0x7372('0x14')]=_0x400033[_0x7372('0x14')];this['uniqueid']=_0x1d7d90[_0x7372('0x15')];this[_0x7372('0x16')]=_0x400033[_0x7372('0x17')];this[_0x7372('0x18')]=_0x400033[_0x7372('0x19')];this[_0x7372('0x1a')]=_0x400033[_0x7372('0x1a')];this['responsetime']=_0x400033[_0x7372('0x1b')];this[_0x7372('0x1c')]=moment()[_0x7372('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x7372('0x1e')]=getSeconds(_0x400033[_0x7372('0x1b')],_0x400033[_0x7372('0x1a')]);this[_0x7372('0x1f')]=0x0;this[_0x7372('0x20')]=getSeconds(this[_0x7372('0x1c')],_0x400033[_0x7372('0x1b')]);this[_0x7372('0xd')]=_0x400033[_0x7372('0xd')];this['membername']='IVR';this[_0x7372('0x21')]=_0x1d7d90[_0x7372('0x22')];this[_0x7372('0x23')]=_0x400033[_0x7372('0x23')];this['callbackuniqueid']=_0x400033[_0x7372('0x24')];this[_0x7372('0x25')]=_0x400033[_0x7372('0x25')];this[_0x7372('0x26')]=_0x400033[_0x7372('0x26')];this[_0x7372('0x27')]=_0x400033[_0x7372('0x27')];this[_0x7372('0x28')]=_0x400033[_0x7372('0x28')];this[_0x7372('0x29')]=_0x400033[_0x7372('0x29')];this[_0x7372('0x2a')]=_0x400033['VoiceQueueId'];this[_0x7372('0x2b')]=_0x400033[_0x7372('0x2b')];}module[_0x7372('0x2c')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index fcc82d1..ce53a5c 100644 --- a/server/services/ami/dialer/history.js +++ b/server/services/ami/dialer/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x413f=['type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countagentrejectretry','countabandonedretry','countmachineretry','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat'];(function(_0xf168d3,_0x43dcfc){var _0x17fb54=function(_0x3d9674){while(--_0x3d9674){_0xf168d3['push'](_0xf168d3['shift']());}};_0x17fb54(++_0x43dcfc);}(_0x413f,0xd7));var _0xf413=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x413f[_0x57b54c];return _0x59cc19;};'use strict';var util=require('util');var _=require(_0xf413('0x0'));var moment=require(_0xf413('0x1'));function getSeconds(_0x6da32e,_0x5312e9){var _0x2ac01a=moment(_0x6da32e)[_0xf413('0x2')](0x0);var _0x2b6d03=moment(_0x5312e9)['milliseconds'](0x0);return _0x2ac01a[_0xf413('0x3')](_0x2b6d03,_0xf413('0x4'));}function History(_0x4a5c3c){this[_0xf413('0x5')]=_0x4a5c3c[_0xf413('0x5')];this['scheduledat']=_0x4a5c3c[_0xf413('0x6')]||undefined;this[_0xf413('0x7')]=_0x4a5c3c[_0xf413('0x7')];this['campaigntype']=_0x4a5c3c[_0xf413('0x7')]==='outbound'?_0xf413('0x8'):_0x4a5c3c[_0xf413('0x7')];this[_0xf413('0x9')]=_0x4a5c3c[_0xf413('0x9')];this[_0xf413('0xa')]=_0x4a5c3c['countcongestionretry'];this[_0xf413('0xb')]=_0x4a5c3c[_0xf413('0xb')];this[_0xf413('0xc')]=_0x4a5c3c[_0xf413('0x9')]+_0x4a5c3c[_0xf413('0xa')]+_0x4a5c3c[_0xf413('0xb')]+_0x4a5c3c[_0xf413('0xd')]+_0x4a5c3c[_0xf413('0xe')]+_0x4a5c3c['countabandonedretry']+_0x4a5c3c['countmachineretry']+_0x4a5c3c[_0xf413('0xf')];this['countnosuchnumberretry']=_0x4a5c3c[_0xf413('0xd')];this[_0xf413('0xe')]=_0x4a5c3c[_0xf413('0xe')];this[_0xf413('0x10')]=_0x4a5c3c[_0xf413('0x10')];this['countmachineretry']=_0x4a5c3c[_0xf413('0x11')];this[_0xf413('0xf')]=_0x4a5c3c['countagentrejectretry'];this[_0xf413('0x8')]=_0x4a5c3c['queue'];this['calleridname']=_0x4a5c3c['name'];this[_0xf413('0x12')]=_0x4a5c3c[_0xf413('0x13')];this[_0xf413('0x14')]=_0x4a5c3c[_0xf413('0x14')];this[_0xf413('0x15')]=_0x4a5c3c['responsetime'];this[_0xf413('0x16')]=_0x4a5c3c['responsetime'];this[_0xf413('0x17')]=getSeconds(_0x4a5c3c[_0xf413('0x15')],_0x4a5c3c[_0xf413('0x14')]);this[_0xf413('0x18')]=0x0;this[_0xf413('0x19')]=0x0;this[_0xf413('0x1a')]=_0x4a5c3c[_0xf413('0x1a')];this[_0xf413('0x1b')]=_0x4a5c3c[_0xf413('0x1b')];this[_0xf413('0x1c')]=_0x4a5c3c[_0xf413('0x1c')];this[_0xf413('0x1d')]=_0x4a5c3c['recallme'];this[_0xf413('0x1e')]=_0x4a5c3c['ContactId'];this[_0xf413('0x1f')]=_0x4a5c3c[_0xf413('0x1f')];this[_0xf413('0x20')]=_0x4a5c3c['UserId'];this[_0xf413('0x21')]=_0x4a5c3c['VoiceQueueId'];this['CampaignId']=_0x4a5c3c['CampaignId'];this[_0xf413('0x22')]=_0x4a5c3c['originatecalleridnum']||'';this['originatecalleridname']=_0x4a5c3c[_0xf413('0x23')]||'';}module[_0xf413('0x24')]=History; \ No newline at end of file +var _0x1037=['milliseconds','diff','seconds','uniqueid','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment'];(function(_0x4257b0,_0x37e20b){var _0x2dc301=function(_0x58eaeb){while(--_0x58eaeb){_0x4257b0['push'](_0x4257b0['shift']());}};_0x2dc301(++_0x37e20b);}(_0x1037,0x1cb));var _0x7103=function(_0x404957,_0x5192a4){_0x404957=_0x404957-0x0;var _0x4e0365=_0x1037[_0x404957];return _0x4e0365;};'use strict';var util=require(_0x7103('0x0'));var _=require(_0x7103('0x1'));var moment=require(_0x7103('0x2'));function getSeconds(_0x40ef30,_0x395cd4){var _0x33573b=moment(_0x40ef30)[_0x7103('0x3')](0x0);var _0x11a1aa=moment(_0x395cd4)[_0x7103('0x3')](0x0);return _0x33573b[_0x7103('0x4')](_0x11a1aa,_0x7103('0x5'));}function History(_0x1776a5){this[_0x7103('0x6')]=_0x1776a5[_0x7103('0x6')];this['scheduledat']=_0x1776a5['scheduledat']||undefined;this['type']=_0x1776a5[_0x7103('0x7')];this[_0x7103('0x8')]=_0x1776a5['type']===_0x7103('0x9')?_0x7103('0xa'):_0x1776a5[_0x7103('0x7')];this[_0x7103('0xb')]=_0x1776a5['countbusyretry'];this[_0x7103('0xc')]=_0x1776a5['countcongestionretry'];this[_0x7103('0xd')]=_0x1776a5['countnoanswerretry'];this[_0x7103('0xe')]=_0x1776a5[_0x7103('0xb')]+_0x1776a5[_0x7103('0xc')]+_0x1776a5[_0x7103('0xd')]+_0x1776a5['countnosuchnumberretry']+_0x1776a5[_0x7103('0xf')]+_0x1776a5[_0x7103('0x10')]+_0x1776a5[_0x7103('0x11')]+_0x1776a5[_0x7103('0x12')];this[_0x7103('0x13')]=_0x1776a5[_0x7103('0x13')];this[_0x7103('0xf')]=_0x1776a5['countdropretry'];this[_0x7103('0x10')]=_0x1776a5['countabandonedretry'];this[_0x7103('0x11')]=_0x1776a5[_0x7103('0x11')];this[_0x7103('0x12')]=_0x1776a5[_0x7103('0x12')];this[_0x7103('0xa')]=_0x1776a5[_0x7103('0xa')];this[_0x7103('0x14')]=_0x1776a5[_0x7103('0x15')];this[_0x7103('0x16')]=_0x1776a5[_0x7103('0x17')];this[_0x7103('0x18')]=_0x1776a5['starttime'];this['responsetime']=_0x1776a5[_0x7103('0x19')];this[_0x7103('0x1a')]=_0x1776a5[_0x7103('0x19')];this[_0x7103('0x1b')]=getSeconds(_0x1776a5[_0x7103('0x19')],_0x1776a5[_0x7103('0x18')]);this[_0x7103('0x1c')]=0x0;this[_0x7103('0x1d')]=0x0;this['callback']=_0x1776a5[_0x7103('0x1e')];this['callbackuniqueid']=_0x1776a5[_0x7103('0x1f')];this[_0x7103('0x20')]=_0x1776a5[_0x7103('0x20')];this[_0x7103('0x21')]=_0x1776a5[_0x7103('0x21')];this['ContactId']=_0x1776a5[_0x7103('0x22')];this[_0x7103('0x23')]=_0x1776a5[_0x7103('0x23')];this[_0x7103('0x24')]=_0x1776a5[_0x7103('0x24')];this[_0x7103('0x25')]=_0x1776a5[_0x7103('0x25')];this[_0x7103('0x26')]=_0x1776a5['CampaignId'];this['originatecalleridnum']=_0x1776a5[_0x7103('0x27')]||'';this[_0x7103('0x28')]=_0x1776a5['originatecalleridname']||'';}module[_0x7103('0x29')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index ef73ef1..5f45054 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 _0x23ec=['custom:agentnosuchnumber','nosuchnumber','checkRetriveMax','reason\x200\x20no\x20such\x20number....','stateGlobal','outboundNoAnswerCallsDay','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMinThreshold','predictiveIntervalMultiplicativeFactor','check\x20predictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','dialPredictiveInterval','startMethodPredictive','Predictive\x20after\x20first\x20interval','getDataPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','floor','one\x20call\x20every:','[handlePredictive]','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','actionOriginate','scheduledat','dialRecallMeTimeout','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','inBlackList','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','dialLimitQueue','not_inuse','RUNNING','[getContactDialer2]','[handlePredictive][limitChannel]','tryOriginatePredictive','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','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','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','----\x20Agent\x20Busy\x20Factor\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','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','interval\x20=\x20','Umin\x20=\x20','bluebird','uuid','md5','../preview/util/util','../../../config/environment/','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./final','./agentComplete','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','prototype','tail','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','custom:queuesummary','hangup','newexten','varset','syncVarSet','queuemember','syncQueueMember','syncQueueStatusComplete','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','message','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','\x20INTERVAL_IS_NULL','Intervals','INTERVAL_IS_NULL','[ifTime][Action]','Error','milliseconds','diff','seconds','type','outbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','loggedInDb','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalAvailable','originated','erlangCalls','Trunk','active','stringify','format','voice_queue:save','campaign:ivr:%s','isEmpty','info','-----\x20Stats\x20Predictive\x20---','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','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','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\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','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','merge','handlePredictive','clearing\x20variable\x20handle\x20predictive','ivr','string','\x22\x22\x20<>','error','inspect','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','starttime','clearZombieChannels','uniqueId','[uniqueid]','actions','isNil','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','resolve','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','saveInDb','pick','ContactId','UserId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','reachable','SIP/%s','unmonitored','uniqueid','variable','amdstatus','exten','dialAMDActive','value','outboundAnswerAgiCallsDay','membername','AMD','emit','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','Machine','countmachineretry','[syncAgentComplete][createHistory][0]','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','minutes','YYYY-MM-DD\x20HH:mm:ss','ListId','VoiceQueueId','[rescheduleContact][Machine]','HANGUP','HangupInAMD','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','countglobal','countbusyretry','reason\x2019\x20machine....','syncHangup','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','Unknow','syncAgentComplete','reason','agent','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','[syncQueueCallerAbandon]\x20[Drop]','droptime','dialQueueTimeout','Drop','TIMEOUT','agiafterat','queueCallerAbandonCreateState','add','dialDropRetryFrequency','[rescheduleContact][Drop]','calleridname','calleridnum','Abandoned','dropreason','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','syncNewExten','actionid','roundrobin','locked','paused','stateinterface','push','queueStatusComplete','idHopper','[Catch][Preview][syncQueueStatusComplete]','finally','_rr','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','run','[booked][RR][finaly]','[booked][unlock]','[unlock][syncQueueStatusComplete]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','loopCampaigns','resetActiveCalls','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','INTERVAL_IS_EMPTY','Failure','\x20Intervals\x20is\x20empty\x20','timezones','isArray','command','iftime\x20%s,%s','content','indexOf','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','power','handlePower','dialPowerLevel','Queue','method\x20not\x20recognized','checkPreviewRecallReminder','Agent','user:%s','user:dialPreviewRecallReminder','dialGlobalInterval','checkIfTimeIntervals','dialTimezone','[syncQueueSummary]','launchHandleIvr','\x5cw{0,','pow','replace','random','match','Contact','phone','originate','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialer','ACTIVE','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-CAMPAIGNID','%s%s','XMD-','toUpper','callerid','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','dialOriginateTimeout','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','response','callProgressDetecting','[callProgressDetecting]\x20','countnoanswerretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','object','evt\x20is\x20undefine','NoSuchNumber'];(function(_0x25def4,_0x4a4c7d){var _0x3bc600=function(_0x113c09){while(--_0x113c09){_0x25def4['push'](_0x25def4['shift']());}};_0x3bc600(++_0x4a4c7d);}(_0x23ec,0x6e));var _0xc23e=function(_0x426a52,_0x278322){_0x426a52=_0x426a52-0x0;var _0x5a2d38=_0x23ec[_0x426a52];return _0x5a2d38;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require(_0xc23e('0x0'));var uuid=require(_0xc23e('0x1'));var moment=require('moment');var rr=require('rr');var md5=require(_0xc23e('0x2'));var Redis=require('ioredis');var ut=require(_0xc23e('0x3'));var config=require(_0xc23e('0x4'));var logger=require(_0xc23e('0x5'))('dialer');var loggerBooked=require(_0xc23e('0x5'))(_0xc23e('0x6'));var loggerPredictive=require(_0xc23e('0x5'))(_0xc23e('0x7'));var loggerPredictiveCalls=require('../../../config/logger')(_0xc23e('0x8'));var loggerSyncQueueSummary=require('../../../config/logger')(_0xc23e('0x9'));var ami=require(_0xc23e('0xa'));config[_0xc23e('0xb')]=_[_0xc23e('0xc')](config['redis'],{'host':_0xc23e('0xd'),'port':0x18eb});var io=require(_0xc23e('0xe'))(new Redis(config[_0xc23e('0xb')]));var cmHopper=require(_0xc23e('0xf'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0xc23e('0x10'));var voiceQueueRt=require(_0xc23e('0x11'));var RpcSetting=require('../rpc/setting');var Action=require(_0xc23e('0x12'));var History=require(_0xc23e('0x13'));var Final=require(_0xc23e('0x14'));var AgentComplete=require(_0xc23e('0x15'));var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require('./hangup');var ipAgi=process[_0xc23e('0x16')][_0xc23e('0x17')]||_0xc23e('0x18');var strategy={'rrmemory':_0xc23e('0x19'),'roundrobin':'roundrobin'};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0xc23e('0x1a')]['enqueue']=function(_0xc3aaac){this[_0xc23e('0x1b')]=this['tail']?this[_0xc23e('0x1b')]['finally'](_0xc3aaac):_0xc3aaac();};function Dialer(_0x39962d,_0x2f0096){this[_0xc23e('0x1c')]=new Sequence();this[_0xc23e('0x1d')]=_0x2f0096;this[_0xc23e('0x1e')]=_0x39962d[_0xc23e('0x1e')];this[_0xc23e('0x1f')]=_0x39962d[_0xc23e('0x1f')];this[_0xc23e('0x20')]=_0x39962d[_0xc23e('0x20')];this['trunks']=_0x39962d[_0xc23e('0x21')];this[_0xc23e('0x22')]=config[_0xc23e('0x22')]||0x2;this[_0xc23e('0x23')]={};this['actions']={};this['contactsId']={};this['uniqueId']={};this[_0xc23e('0x24')]={};this[_0xc23e('0x25')]={};this[_0xc23e('0x26')]={};this[_0xc23e('0x27')]={};this[_0xc23e('0x28')]={};this[_0xc23e('0x29')]={};ami['on'](_0xc23e('0x2a'),this[_0xc23e('0x2b')][_0xc23e('0x2c')](this));ami['on'](_0xc23e('0x2d'),this[_0xc23e('0x2e')]['bind'](this));ami['on'](_0xc23e('0x2f'),this[_0xc23e('0x30')][_0xc23e('0x2c')](this));ami['on'](_0xc23e('0x31'),this['syncAgentComplete']['bind'](this));ami['on'](_0xc23e('0x32'),this[_0xc23e('0x9')][_0xc23e('0x2c')](this));ami['on'](_0xc23e('0x33'),this['syncHangup'][_0xc23e('0x2c')](this));ami['on'](_0xc23e('0x34'),this['syncNewExten']['bind'](this));ami['on'](_0xc23e('0x35'),this[_0xc23e('0x36')]['bind'](this));ami['on'](_0xc23e('0x37'),this[_0xc23e('0x38')][_0xc23e('0x2c')](this));ami['on']('queuestatuscomplete',this[_0xc23e('0x39')][_0xc23e('0x2c')](this));this['loopCampaigns']();this[_0xc23e('0x3a')]();RpcSetting[_0xc23e('0x3b')]()[_0xc23e('0x3c')](function(_0x2d0b4c){previewRecallmeReminderInterval=_0x2d0b4c[_0xc23e('0x3d')];});}function isNotNull(_0x35466a){return _0x35466a!==null&&!_[_0xc23e('0x3e')](_0x35466a);}function checkIsLoggedIn(_0x2390a0,_0x46f1e7){return function(){if(_0x46f1e7<=0x0){_0x2390a0[_0xc23e('0x3f')]='AGENTS_NOT_LOGGED';throw _0x2390a0[_0xc23e('0x40')]+_0xc23e('0x41');}};}function isActive(_0x39f91a){return _0x39f91a;}function checkIsActive(_0x35aad0,_0x100392){return function(){if(!isActive(_0x100392)){_0x35aad0[_0xc23e('0x3f')]=_0xc23e('0x42');throw _0x35aad0['name']+_0xc23e('0x43');}};}function checkInterval(_0x128241){return function(){if(!isNotNull(_0x128241[_0xc23e('0x44')])){_0x128241[_0xc23e('0x3f')]='INTERVAL_IS_NULL';throw _0x128241[_0xc23e('0x40')]+_0xc23e('0x45');}if(!isNotNull(_0x128241[_0xc23e('0x44')][_0xc23e('0x46')])){_0x128241['message']='INTERVAL_IS_NULL';throw _0x128241[_0xc23e('0x40')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_['isEmpty'](_0x128241[_0xc23e('0x44')][_0xc23e('0x46')]))){_0x128241[_0xc23e('0x3f')]=_0xc23e('0x47');throw _0x128241[_0xc23e('0x40')]+_0xc23e('0x45');}};}function msgResponse(_0x268e8b,_0x18c083,_0x17b013){return{'action':_0x268e8b,'response':_0x18c083,'message':_0x17b013,'stack':_0x17b013};}function myreject(_0x2639a2){return function(_0x1d9cde){return _0x2639a2(msgResponse(_0xc23e('0x48'),_0xc23e('0x49'),JSON['stringify'](_0x1d9cde)));};}function getSeconds(_0x3080e2,_0x1bac65){var _0x1275f9=moment(_0x3080e2)[_0xc23e('0x4a')](0x0);var _0x58196a=moment(_0x1bac65)[_0xc23e('0x4a')](0x0);return _0x1275f9[_0xc23e('0x4b')](_0x58196a,_0xc23e('0x4c'));}function emit(_0xb112e7,_0x5a54fc,_0x5e2775){io['to'](_0xb112e7)['emit'](_0x5a54fc,_0x5e2775);}function emitVoiceQueueSummary(_0x37dd3e){if(_0x37dd3e[_0xc23e('0x4d')]===_0xc23e('0x4e')){var _0x275395={'id':_0x37dd3e['id'],'name':_0x37dd3e[_0xc23e('0x40')],'strategy':_0x37dd3e[_0xc23e('0x4f')],'answered':_0x37dd3e[_0xc23e('0x50')],'available':_0x37dd3e[_0xc23e('0x51')],'loggedIn':_0x37dd3e[_0xc23e('0x52')],'pTalking':_0x37dd3e[_0xc23e('0x53')],'sumBillable':_0x37dd3e[_0xc23e('0x54')],'sumDuration':_0x37dd3e[_0xc23e('0x55')],'sumHoldTime':_0x37dd3e[_0xc23e('0x56')]||0x0,'talking':_0x37dd3e[_0xc23e('0x57')],'total':_0x37dd3e[_0xc23e('0x58')],'type':_0x37dd3e[_0xc23e('0x4d')],'unmanaged':_0x37dd3e[_0xc23e('0x59')],'abandoned':_0x37dd3e['abandoned'],'waiting':_0x37dd3e['waiting'],'loggedInDb':_0x37dd3e[_0xc23e('0x5a')],'dialActive':_0x37dd3e['dialActive'],'dialMethod':_0x37dd3e[_0xc23e('0x5b')],'dialOriginateCallerIdName':_0x37dd3e[_0xc23e('0x5c')],'dialOriginateCallerIdNumber':_0x37dd3e[_0xc23e('0x5d')],'dialOriginateTimeout':_0x37dd3e['dialOriginateTimeout'],'dialPrefix':_0x37dd3e[_0xc23e('0x5e')],'outboundAnswerAgiCallsDay':_0x37dd3e['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x37dd3e[_0xc23e('0x5f')],'outboundBlacklistCallsDay':_0x37dd3e[_0xc23e('0x60')],'outboundBusyCallsDay':_0x37dd3e[_0xc23e('0x61')],'outboundCongestionCallsDay':_0x37dd3e[_0xc23e('0x62')],'outboundDropCallsDayACS':_0x37dd3e[_0xc23e('0x63')],'outboundDropCallsDayCallersExit':_0x37dd3e[_0xc23e('0x64')],'outboundDropCallsDayTimeout':_0x37dd3e[_0xc23e('0x65')],'outboundNoAnswerCallsDay':_0x37dd3e['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x37dd3e[_0xc23e('0x66')],'outboundOriginateFailureCallsDay':_0x37dd3e['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x37dd3e[_0xc23e('0x67')],'outboundRejectCallsDay':_0x37dd3e[_0xc23e('0x68')],'outboundUnknownCallsDay':_0x37dd3e[_0xc23e('0x69')],'predictiveIntervalAnsweredCalls':_0x37dd3e['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x37dd3e[_0xc23e('0x6a')],'predictiveIntervalAvgTalktime':_0x37dd3e[_0xc23e('0x6b')],'predictiveIntervalDroppedCallsCallersExit':_0x37dd3e[_0xc23e('0x6c')],'predictiveIntervalDroppedCallsTimeout':_0x37dd3e[_0xc23e('0x6d')],'predictiveIntervalErlangCalls':_0x37dd3e['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x37dd3e[_0xc23e('0x6e')],'predictiveIntervalHitRate':_0x37dd3e[_0xc23e('0x6f')],'predictiveIntervalMultiplicativeFactor':_0x37dd3e['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x37dd3e['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x37dd3e[_0xc23e('0x70')],'predictiveIntervalTotalCalls':_0x37dd3e['predictiveIntervalTotalCalls'],'message':_0x37dd3e[_0xc23e('0x3f')],'originated':_0x37dd3e[_0xc23e('0x71')],'erlangCalls':_0x37dd3e[_0xc23e('0x72')],'erlangCallToSecond':_0x37dd3e['erlangCallToSecond'],'erlangAbandonmentRate':_0x37dd3e['erlangAbandonmentRate'],'erlangBusyFactor':_0x37dd3e['erlangBusyFactor'],'startPredictive':_0x37dd3e[_0xc23e('0x25')],'startProgressive':_0x37dd3e['startProgressive']};if(_0x37dd3e[_0xc23e('0x73')]){_0x275395[_0xc23e('0x73')]={'id':_0x37dd3e[_0xc23e('0x73')]['id'],'name':_0x37dd3e[_0xc23e('0x73')][_0xc23e('0x40')],'active':_0x37dd3e[_0xc23e('0x73')][_0xc23e('0x74')],'callerid':_0x37dd3e[_0xc23e('0x73')]['callerid']};}if(_0x37dd3e[_0xc23e('0x44')]){_0x275395['Interval']={'id':_0x37dd3e[_0xc23e('0x44')]['id'],'name':_0x37dd3e[_0xc23e('0x44')]['name']};}var _0x5d5a25=md5(JSON[_0xc23e('0x75')](_0x275395));if(_0x37dd3e[_0xc23e('0x2')]!==_0x5d5a25){_0x37dd3e[_0xc23e('0x2')]=_0x5d5a25;emit(util[_0xc23e('0x76')]('voice:queue:%s',_0x275395[_0xc23e('0x40')]),_0xc23e('0x77'),_0x275395);}}}function emitCampaignSummary(_0x27cd3d){if(_0x27cd3d['type']==='ivr'){emit(util['format'](_0xc23e('0x78'),_0x27cd3d['name']),'campaign:save',_0x27cd3d);}}function checkGetDataPredictive(_0x3094dc){if(isNotNull(_0x3094dc)&&!_[_0xc23e('0x79')](_0x3094dc)){loggerPredictive[_0xc23e('0x7a')](_0xc23e('0x7b'));loggerPredictive['info'](_0xc23e('0x7c'),_0x3094dc[_0xc23e('0x7d')]);loggerPredictive[_0xc23e('0x7a')](_0xc23e('0x7e'),_0x3094dc[_0xc23e('0x7f')]);loggerPredictive[_0xc23e('0x7a')](_0xc23e('0x80'),_0x3094dc[_0xc23e('0x6d')]);loggerPredictive[_0xc23e('0x7a')](_0xc23e('0x81'),_0x3094dc[_0xc23e('0x6c')]);loggerPredictive[_0xc23e('0x7a')](_0xc23e('0x82'),_0x3094dc['predictiveIntervalAvgHoldtime']);loggerPredictive[_0xc23e('0x7a')](_0xc23e('0x83'),_0x3094dc[_0xc23e('0x6b')]);loggerPredictive[_0xc23e('0x7a')](_0xc23e('0x84'));if(_0x3094dc[_0xc23e('0x7d')]>0x0){if(!_[_0xc23e('0x3e')](_0x3094dc[_0xc23e('0x6b')])&&_0x3094dc[_0xc23e('0x6b')]>0x0){return!![];}loggerPredictive[_0xc23e('0x7a')](_0xc23e('0x85'));if(!_[_0xc23e('0x3e')](_0x3094dc[_0xc23e('0x6a')])&&_0x3094dc[_0xc23e('0x6a')]>0x0){return!![];}loggerPredictive[_0xc23e('0x7a')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0xc23e('0x7a')](_0xc23e('0x86'));}}else{loggerPredictive['info']('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x428abb){return function(_0x28fc7e){loggerPredictive[_0xc23e('0x7a')](_0xc23e('0x87'));loggerPredictive['info']('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x28fc7e[_0xc23e('0x72')]);loggerPredictive[_0xc23e('0x7a')](_0xc23e('0x88'),_0x28fc7e[_0xc23e('0x89')]);loggerPredictive[_0xc23e('0x7a')](_0xc23e('0x8a'),_0x28fc7e[_0xc23e('0x8b')]);loggerPredictive[_0xc23e('0x7a')](_0xc23e('0x8c'),_0x28fc7e[_0xc23e('0x8d')]);loggerPredictive[_0xc23e('0x7a')](_0xc23e('0x8a'),_0x28fc7e[_0xc23e('0x8b')]);loggerPredictive[_0xc23e('0x7a')](_0xc23e('0x84'));_[_0xc23e('0x8e')](_0x428abb,_0x28fc7e);};}function getDiff(_0x5b57cd){var _0x331c1f=moment()[_0xc23e('0x4a')](0x0);var _0x250d88=moment(_0x5b57cd)[_0xc23e('0x4a')](0x0);return _0x331c1f[_0xc23e('0x4b')](_0x250d88,_0xc23e('0x4c'));}function ifInterval(_0x11535e,_0x3569f6){if(_[_0xc23e('0x3e')](_0x3569f6)){return![];}return getDiff(_0x3569f6)<_0x11535e*0x3c;}function freeVariablesPredictive(_0x54b27d){if(isNotNull(_0x54b27d)){if(!_[_0xc23e('0x3e')](_0x54b27d[_0xc23e('0x26')])){_0x54b27d[_0xc23e('0x26')]=undefined;loggerPredictive[_0xc23e('0x7a')](_0x54b27d[_0xc23e('0x40')],'clearing\x20variable\x20start\x20progressive');}if(!_['isUndefined'](_0x54b27d[_0xc23e('0x25')])){_0x54b27d[_0xc23e('0x25')]=undefined;loggerPredictive[_0xc23e('0x7a')](_0x54b27d[_0xc23e('0x40')],'clearing\x20variable\x20start\x20predictive');}if(!_['isUndefined'](_0x54b27d[_0xc23e('0x8f')])){clearInterval(_0x54b27d[_0xc23e('0x8f')]);_0x54b27d[_0xc23e('0x8f')]=undefined;loggerPredictive[_0xc23e('0x7a')](_0x54b27d['name'],_0xc23e('0x90'));}}}function erlangb(_0x1b35ce,_0x278e1d){if(_0x278e1d===0x0){return 0x0;}var _0x79a25c=0x1;for(var _0x24b859=0x1;_0x24b859<=_0x278e1d;_0x24b859+=0x1){_0x79a25c=0x1+_0x79a25c*_0x24b859/_0x1b35ce;}return 0x1/_0x79a25c;}function isVoiceQueueOutbound(_0x29c06e){return _0x29c06e===_0xc23e('0x4e');}function isNotPreview(_0x322334){return _0x322334!==_0xc23e('0x1d');}function isCampaignIvr(_0x3e8f52){return _0x3e8f52===_0xc23e('0x91');}function getCallerId(_0xd9d3d8,_0x11026e,_0x3ee71b){if(!_[_0xc23e('0x3e')](_0x3ee71b)&&typeof _0x3ee71b===_0xc23e('0x92')&&!_['isEmpty'](_0x3ee71b)){if(!_['isUndefined'](_0x11026e)&&typeof _0x11026e===_0xc23e('0x92')&&!_['isEmpty'](_0x11026e)){return util['format']('\x22%s\x22\x20<%s>',_0x11026e,_0x3ee71b);}return util[_0xc23e('0x76')]('\x22%s\x22\x20<%s>',_0x3ee71b,_0x3ee71b);}if(!_[_0xc23e('0x3e')](_0xd9d3d8)&&typeof _0xd9d3d8===_0xc23e('0x92')&&!_[_0xc23e('0x79')](_0xd9d3d8)){return _0xd9d3d8;}return _0xc23e('0x93');}function loggerCatchQueueSummary(_0x10eb39,_0x7b0d7d){return function(_0x25a7f4){freeVariablesPredictive(_0x7b0d7d);emitVoiceQueueSummary(_0x7b0d7d);emitCampaignSummary(_0x7b0d7d);loggerSyncQueueSummary[_0xc23e('0x94')](_0x10eb39,util['inspect'](_0x25a7f4,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x10f9ff,_0x36277d){return function(_0x2f869f){loggerPredictive['error'](_0x36277d[_0xc23e('0x40')],_0x10f9ff);loggerPredictive[_0xc23e('0x94')](_0x2f869f['stack']);freeVariablesPredictive(_0x36277d);};}function loggerCatch(_0x6e5985){return function(_0x17ed73){logger[_0xc23e('0x94')](_0x6e5985,util[_0xc23e('0x95')](_0x17ed73,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x65f3df){return _0x65f3df&&!_[_0xc23e('0x3e')](_0x65f3df)&&_0x65f3df[_0xc23e('0x96')]>0x0;}function decremetOriginate(_0x296c04){if(!_['isUndefined'](_0x296c04)&&_0x296c04!==null){if(typeof _0x296c04[_0xc23e('0x71')]!==_0xc23e('0x97')){if(_0x296c04[_0xc23e('0x71')]>0x0){_0x296c04[_0xc23e('0x71')]-=0x1;}else{logger[_0xc23e('0x94')](_0xc23e('0x98'));}}}else{logger[_0xc23e('0x94')](_0xc23e('0x99'));}}function checkContactLowerLimitOriginate(_0x5603bf,_0x7fa1c0,_0x57533f){if(_0x7fa1c0>_0x57533f){for(var _0x11a2ba=0x0;_0x11a2ba<_0x7fa1c0-_0x57533f;_0x11a2ba+=0x1){decremetOriginate(_0x5603bf);}}}function loggerGetContactDialer(_0x279022,_0x5633da,_0x2e899b){return function(_0x111832){checkContactLowerLimitOriginate(_0x5633da,_0x2e899b,0x0);logger['error'](_0x279022,util[_0xc23e('0x95')](_0x111832,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x3798a8){return function(_0x5b34ee){if(isNotNull(_0x5b34ee)&&isNotNull(_0x5b34ee[0x0])){if(_0x5b34ee[0x0]['contactsRescheduled']>0x0){_0x3798a8[_0xc23e('0x3f')]='RESCHEDULED_CONTACTS';logger['info']('[getContactDialer2][ReScheduled]'+_0x3798a8[_0xc23e('0x40')],_0x5b34ee[0x0]['contactsRescheduled'],'contacts');}else{_0x3798a8['message']='AVAILABLE_CONTACTS_FINISHED';logger['info'](_0xc23e('0x9a')+_0x3798a8[_0xc23e('0x40')]);}}};}function notSendMessagesQueue(_0x4a6ad5){if(_0x4a6ad5[_0xc23e('0x9b')]){freeVariablesPredictive(_0x4a6ad5);if(_0x4a6ad5[_0xc23e('0x71')]===0x0&&_0x4a6ad5[_0xc23e('0x57')]===0x0&&_0x4a6ad5['waiting']===0x0&&(_0x4a6ad5['pTalking']||0x0)===0x0){_0x4a6ad5['sendMessageOneNotActive']=![];_0x4a6ad5[_0xc23e('0x51')]=0x0;_0x4a6ad5[_0xc23e('0x3f')]=_0xc23e('0x42');loggerSyncQueueSummary['error'](_0xc23e('0x9c'),_0x4a6ad5[_0xc23e('0x40')],_0xc23e('0x9d'));}else{_0x4a6ad5[_0xc23e('0x3f')]='IS_DISACTIVED';loggerSyncQueueSummary[_0xc23e('0x94')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x4a6ad5[_0xc23e('0x40')],_0xc23e('0x9e'));}emitVoiceQueueSummary(_0x4a6ad5);}}function notSendMessagesCampaign(_0x55d6e2){if(_0x55d6e2[_0xc23e('0x9b')]){if(_0x55d6e2['originated']===0x0){_0x55d6e2[_0xc23e('0x9b')]=![];_0x55d6e2['message']=_0xc23e('0x42');loggerSyncQueueSummary[_0xc23e('0x94')](_0xc23e('0x9f'),_0x55d6e2[_0xc23e('0x40')],_0xc23e('0x9d'));}else{_0x55d6e2['message']='IS_DISACTIVED';loggerSyncQueueSummary[_0xc23e('0x94')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x55d6e2[_0xc23e('0x40')],_0xc23e('0x9e'));}emitCampaignSummary(_0x55d6e2);}}function createObjHistory(_0x441d77,_0x1338b4,_0x193e12,_0x101ca1,_0x102ca7){_0x441d77[_0xc23e('0x3f')]=_0x193e12;var _0x25a2ce=new Action(_0x441d77,_0x1338b4);var _0x8682f=new History(_0x25a2ce);_0x8682f[_0xc23e('0xa0')]=_0x101ca1;_0x8682f[_0xc23e('0xa1')]=_0x102ca7;_0x8682f[_0xc23e('0xa2')]=_0x25a2ce[_0xc23e('0xa3')];return _0x8682f;}Dialer[_0xc23e('0x1a')][_0xc23e('0x3a')]=function(){var _0x46f5df=this;setInterval(function(){_0x46f5df[_0xc23e('0xa4')](_0x46f5df[_0xc23e('0xa5')],_0xc23e('0xa6'));_0x46f5df['clearZombieChannels'](_0x46f5df[_0xc23e('0xa7')],'[actions]');},0x32c8);};Dialer[_0xc23e('0x1a')][_0xc23e('0xa4')]=function(_0x1b1681,_0x9f6f19){var _0x135080=this;for(var _0x1858db in _0x1b1681){if(typeof _0x1b1681[_0x1858db]!==_0xc23e('0x97')){this[_0xc23e('0x1c')]['enqueue'](function(){if(!_[_0xc23e('0xa8')](_0x1b1681[_0x1858db])){return ami[_0xc23e('0xa9')]({'action':_0xc23e('0xaa'),'channel':_0x1b1681[_0x1858db][_0xc23e('0xab')]})[_0xc23e('0xac')](function(_0x22e1ef){if(_0x22e1ef[_0xc23e('0x3f')]===_0xc23e('0xad')){setTimeout(function(){if(_0x1b1681[_0x1858db]&&_0x1b1681[_0x1858db][_0xc23e('0x4d')]!==_0xc23e('0x91')){_0x135080[_0xc23e('0xae')](_0x135080[_0xc23e('0x1e')][_0x1b1681[_0x1858db][_0xc23e('0xaf')]]);logger[_0xc23e('0x94')](_0xc23e('0xb0'),_0x9f6f19,_0x1858db,_0x1b1681[_0x1858db]['queue']);delete _0x1b1681[_0x1858db];}if(_0x1b1681[_0x1858db]&&_0x1b1681[_0x1858db][_0xc23e('0x4d')]===_0xc23e('0x91')){_0x135080[_0xc23e('0xae')](_0x135080['campaigns'][_0x1b1681[_0x1858db][_0xc23e('0xaf')]]);logger[_0xc23e('0x94')](_0xc23e('0xb1'),_0x9f6f19,_0x1858db,_0x1b1681[_0x1858db][_0xc23e('0xaf')]);delete _0x1b1681[_0x1858db];}},0x2328);}});}});}}};Dialer['prototype'][_0xc23e('0xb2')]=function(_0x191a21){return BPromise[_0xc23e('0xb3')]()[_0xc23e('0x3c')](cmHopper[_0xc23e('0xb2')](_0x191a21))['catch'](loggerCatch('[countReScheduled]\x20'));};Dialer[_0xc23e('0x1a')][_0xc23e('0xb4')]=function(_0x201eeb){return BPromise[_0xc23e('0xb3')]()[_0xc23e('0x3c')](cmHopperBlack[_0xc23e('0xb4')](_0x201eeb))[_0xc23e('0xac')](loggerCatch(_0xc23e('0xb5')));};Dialer[_0xc23e('0x1a')][_0xc23e('0xb6')]=function(_0x6ea080){return BPromise[_0xc23e('0xb3')]()[_0xc23e('0x3c')](cmHopperBlack['checkIsBlackListIvr'](_0x6ea080))[_0xc23e('0xac')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer['prototype'][_0xc23e('0xb7')]=function(_0xdaa68a){return BPromise[_0xc23e('0xb3')]()['then'](cmHopperHistory[_0xc23e('0xb8')](_0xdaa68a))[_0xc23e('0xac')](loggerCatch(_0xc23e('0xb9')));};Dialer[_0xc23e('0x1a')][_0xc23e('0xba')]=function(_0x5dbe1c){return BPromise[_0xc23e('0xb3')]()[_0xc23e('0x3c')](cmHopper['rescheduleContact'](_0x5dbe1c))[_0xc23e('0xac')](loggerCatch(_0xc23e('0xbb')));};Dialer[_0xc23e('0x1a')][_0xc23e('0xbc')]=function(_0x172011,_0x4c9aa8,_0x3630c1){return BPromise[_0xc23e('0xb3')]()[_0xc23e('0x3c')](cmHopper[_0xc23e('0xbc')](_0x172011,_0x4c9aa8,_0x3630c1))[_0xc23e('0xac')](loggerCatch(_0xc23e('0xbd')));};Dialer['prototype'][_0xc23e('0xbe')]=function(_0x4236c9,_0x2043a7,_0x514be6,_0xcb85b7,_0x4deac6){return BPromise[_0xc23e('0xb3')]()[_0xc23e('0x3c')](cmHopper[_0xc23e('0xbe')](_0x4236c9,_0x2043a7,_0x514be6,_0xcb85b7))[_0xc23e('0xac')](function(_0x15eafb){_0x4deac6[_0xc23e('0xbf')]-=_0x514be6;_0x4deac6[_0xc23e('0xbf')]=_0x4deac6[_0xc23e('0xbf')]>0x0?_0x4deac6[_0xc23e('0xbf')]:0x0;loggerCatch(_0xc23e('0xc0'))(_0x15eafb);});};Dialer[_0xc23e('0x1a')][_0xc23e('0xc1')]=function(_0x32f49f,_0xa3cd71,_0x23124c,_0x5b0de1){return BPromise['resolve']()['then'](cmHopper[_0xc23e('0xc1')](_0x32f49f,_0xa3cd71,_0x23124c))[_0xc23e('0xac')](function(_0x47b473){_0x5b0de1[_0xc23e('0xbf')]-=_0xa3cd71;_0x5b0de1[_0xc23e('0xbf')]=_0x5b0de1[_0xc23e('0xbf')]>0x0?_0x5b0de1['temp']:0x0;loggerCatch(_0xc23e('0xc2'))(_0x47b473);});};Dialer[_0xc23e('0x1a')]['getVoiceQueueRtPauses']=function(_0x241848){return BPromise[_0xc23e('0xb3')]()[_0xc23e('0x3c')](voiceQueueRt[_0xc23e('0xc3')](_0x241848))['catch'](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0xc23e('0x1a')][_0xc23e('0xc4')]=function(_0x2a0aff){return BPromise['resolve']()[_0xc23e('0x3c')](cmHopper[_0xc23e('0xc4')](_0x2a0aff))[_0xc23e('0xac')](loggerCatch(_0xc23e('0xc5')));};Dialer[_0xc23e('0x1a')][_0xc23e('0xc6')]=function(_0x364705){return BPromise[_0xc23e('0xb3')]()[_0xc23e('0x3c')](cmHopperHistory[_0xc23e('0xc6')](_0x364705))[_0xc23e('0xac')](loggerCatch('[createHistory]\x20'));};Dialer['prototype']['updateOriginated']=function(_0xe6cf46){if(!_['isUndefined'](_0xe6cf46)&&_0xe6cf46!==null){if(typeof _0xe6cf46[_0xc23e('0x71')]!==_0xc23e('0x97')){if(_0xe6cf46[_0xc23e('0x71')]>0x0){_0xe6cf46[_0xc23e('0x71')]-=0x1;}else{logger[_0xc23e('0x94')](_0xc23e('0xc7'));}}}else{logger[_0xc23e('0x94')](_0xc23e('0xc8'));}};Dialer[_0xc23e('0x1a')][_0xc23e('0xc9')]=function(_0x720186,_0x16e32d){var _0x5cac51=this;return function(_0x1feca8){_0x5cac51['updateOriginated'](_0x16e32d);logger[_0xc23e('0x94')](_0x720186,util[_0xc23e('0x95')](_0x1feca8,{'showHidden':![],'depth':null}));};};Dialer[_0xc23e('0x1a')][_0xc23e('0xca')]=function(_0x22498a,_0x351a2c,_0x5d1949){var _0x3c3c4b={'state':0x19,'statedesc':'notFound'};this[_0xc23e('0xae')](_0x351a2c);this[_0xc23e('0xcb')](_[_0xc23e('0x8e')](_0x3c3c4b,_[_0xc23e('0xcc')](_0x5d1949,[_0xc23e('0xcd'),'ListId',_0xc23e('0xce'),'VoiceQueueId',_0xc23e('0xcf')])),_0xc23e('0xd0'),_0xc23e('0xd1'));logger['error'](_0x22498a);};Dialer['prototype'][_0xc23e('0xd2')]=function(_0x327a42){return _0x327a42===_0xc23e('0xd3');};Dialer[_0xc23e('0x1a')][_0xc23e('0xd4')]=function(_0x57ccea){return!_[_0xc23e('0x3e')](_0x57ccea)&&_0x57ccea&&!_[_0xc23e('0x3e')](_0x57ccea[_0xc23e('0x40')])&&!_['isUndefined'](_0x57ccea['active'])&&_0x57ccea[_0xc23e('0x74')]&&(this[_0xc23e('0x21')][util['format']('SIP/%s',_0x57ccea[_0xc23e('0x40')])][_0xc23e('0xaa')]===_0xc23e('0xd5')||this[_0xc23e('0x21')][util[_0xc23e('0x76')](_0xc23e('0xd6'),_0x57ccea[_0xc23e('0x40')])][_0xc23e('0xaa')]===_0xc23e('0xd7'));};Dialer[_0xc23e('0x1a')][_0xc23e('0xcb')]=function(_0x52945b,_0x60e737,_0x3a6deb){this['createHistory'](_0x52945b)[_0xc23e('0xac')](loggerCatch(_0x60e737));this[_0xc23e('0xc4')](_0x52945b)[_0xc23e('0xac')](loggerCatch(_0x3a6deb));};Dialer[_0xc23e('0x1a')][_0xc23e('0x36')]=function(_0xe50e85){var _0x20e945=this[_0xc23e('0xa5')][_0xe50e85[_0xc23e('0xd8')]];var _0x47d897;if(!_['isNil'](_0xe50e85)&&!_[_0xc23e('0xa8')](_0xe50e85['variable'])&&!_[_0xc23e('0xa8')](_0xe50e85[_0xc23e('0xd9')][_0xc23e('0xda')])&&_0xe50e85[_0xc23e('0xdb')]==='xcally-motion-dialer'&&_0x20e945){if(_0x20e945[_0xc23e('0x4d')]!=='ivr'&&this[_0xc23e('0x1e')][_0x20e945[_0xc23e('0xaf')]][_0xc23e('0xdc')]&&_0xe50e85[_0xc23e('0xdd')]==='HANGUP'){delete this[_0xc23e('0xa5')][_0xe50e85[_0xc23e('0xd8')]];this[_0xc23e('0xae')](this['voiceQueues'][_0x20e945['queue']]);this['voiceQueues'][_0x20e945[_0xc23e('0xaf')]]['outboundAnswerCallsDay']+=0x1;this[_0xc23e('0x1e')][_0x20e945[_0xc23e('0xaf')]][_0xc23e('0xde')]+=0x1;_0x47d897=new Hangup(_0x20e945,_0xe50e85);_0x47d897[_0xc23e('0xa0')]=0x12;_0x47d897['statedesc']='HangupInAMD';_0x47d897[_0xc23e('0xdf')]=_0xc23e('0xe0');ami[_0xc23e('0xe1')](_0xc23e('0xe2'),ut[_0xc23e('0xe3')](_0x47d897,_0xc23e('0xe4')));this['saveInDb'](_0x47d897,_0xc23e('0xe5'),_0xc23e('0xe6'));}if(_0x20e945[_0xc23e('0x4d')]!==_0xc23e('0x91')&&this[_0xc23e('0x1e')][_0x20e945[_0xc23e('0xaf')]]['dialAMDActive']&&_0xe50e85[_0xc23e('0xdd')]==='MACHINE'){var _0x122209=this;return new BPromise(function(_0x131fcd,_0x5d9fce){delete _0x122209['uniqueId'][_0xe50e85[_0xc23e('0xd8')]];_0x122209['updateOriginated'](_0x122209[_0xc23e('0x1e')][_0x20e945[_0xc23e('0xaf')]]);_0x122209[_0xc23e('0x1e')][_0x20e945[_0xc23e('0xaf')]][_0xc23e('0x5f')]+=0x1;_0x122209[_0xc23e('0x1e')][_0x20e945[_0xc23e('0xaf')]][_0xc23e('0xde')]+=0x1;var _0x490213=_0x122209[_0xc23e('0x1e')][_0x20e945[_0xc23e('0xaf')]];var _0x1bac84=new Hangup(_0x20e945,_0xe50e85);_0x1bac84[_0xc23e('0xa0')]=0x13;_0x1bac84['statedesc']=_0xc23e('0xe7');_0x1bac84[_0xc23e('0xdf')]=_0xc23e('0xe0');_0x1bac84[_0xc23e('0xe8')]+=0x1;_0x1bac84['countglobal']+=0x1;_0x1bac84[_0xc23e('0xe4')]=!![];ami[_0xc23e('0xe1')]('custom:amd',ut[_0xc23e('0xe3')](_0x1bac84,_0xc23e('0xe4')));_0x122209[_0xc23e('0xc6')](_0x1bac84)['catch'](loggerCatch(_0xc23e('0xe9')));if(_0x1bac84['countbusyretry']+_0x1bac84[_0xc23e('0xea')]+_0x1bac84['countnoanswerretry']+_0x1bac84[_0xc23e('0xeb')]+_0x1bac84[_0xc23e('0xec')]+_0x1bac84[_0xc23e('0xed')]+_0x1bac84[_0xc23e('0xe8')]+_0x1bac84[_0xc23e('0xee')]>=_0x490213[_0xc23e('0xef')]){_0x122209['stateGlobal'](_0x1bac84,_0x131fcd,_0x5d9fce,_0xc23e('0xf0'));}else{if(_0x1bac84[_0xc23e('0xe8')]>=_0x490213[_0xc23e('0xf1')]){_0x122209[_0xc23e('0xf2')](_0x1bac84,_0x131fcd,_0x5d9fce,'reason\x2019\x20machine....');}else{_0x122209[_0xc23e('0xba')]({'active':![],'countmachineretry':_0x1bac84[_0xc23e('0xe8')],'scheduledat':moment()['add'](_0x490213['dialMachineRetryFrequency'],_0xc23e('0xf3'))[_0xc23e('0x76')](_0xc23e('0xf4')),'ContactId':_0x1bac84[_0xc23e('0xcd')],'ListId':_0x1bac84[_0xc23e('0xf5')],'VoiceQueueId':_0x1bac84[_0xc23e('0xf6')]||undefined,'CampaignId':_0x1bac84['CampaignId']||undefined})[_0xc23e('0xac')](loggerCatch(_0xc23e('0xf7')));_0x131fcd({'reschedule':0x1});}}});}if(_0x20e945[_0xc23e('0x4d')]===_0xc23e('0x91')&&this[_0xc23e('0x1f')][_0x20e945['queue']][_0xc23e('0xdc')]&&_0xe50e85[_0xc23e('0xdd')]===_0xc23e('0xf8')){delete this[_0xc23e('0xa5')][_0xe50e85[_0xc23e('0xd8')]];this['updateOriginated'](this[_0xc23e('0x1f')][_0x20e945[_0xc23e('0xaf')]]);_0x47d897=new Hangup(_0x20e945,_0xe50e85);_0x47d897[_0xc23e('0xa0')]=0x12;_0x47d897[_0xc23e('0xa1')]=_0xc23e('0xf9');_0x47d897['membername']=_0xc23e('0xe0');ami['emit'](_0xc23e('0xe2'),ut[_0xc23e('0xe3')](_0x47d897,_0xc23e('0xe4')));this[_0xc23e('0xcb')](_0x47d897,_0xc23e('0xfa'),_0xc23e('0xfb'));}if(_0x20e945[_0xc23e('0x4d')]===_0xc23e('0x91')&&this[_0xc23e('0x1f')][_0x20e945[_0xc23e('0xaf')]][_0xc23e('0xdc')]&&_0xe50e85[_0xc23e('0xdd')]===_0xc23e('0xfc')){var _0x122209=this;return new BPromise(function(_0x527a7a,_0x11a1ab){delete _0x122209[_0xc23e('0xa5')][_0xe50e85['uniqueid']];_0x122209[_0xc23e('0xae')](_0x122209[_0xc23e('0x1f')][_0x20e945[_0xc23e('0xaf')]]);_0x122209['campaigns'][_0x20e945[_0xc23e('0xaf')]][_0xc23e('0x5f')]+=0x1;_0x122209[_0xc23e('0x1f')][_0x20e945[_0xc23e('0xaf')]][_0xc23e('0xde')]+=0x1;var _0xc62ebc=_0x122209[_0xc23e('0x1f')][_0x20e945['queue']];var _0x328a0e=new Hangup(_0x20e945,_0xe50e85);_0x328a0e[_0xc23e('0xa0')]=0x13;_0x328a0e[_0xc23e('0xa1')]='Machine';_0x328a0e[_0xc23e('0xdf')]=_0xc23e('0xe0');_0x328a0e['countmachineretry']+=0x1;_0x328a0e[_0xc23e('0xfd')]+=0x1;_0x328a0e[_0xc23e('0xe4')]=!![];ami[_0xc23e('0xe1')]('custom:amd',ut['buildObj'](_0x328a0e,_0xc23e('0xe4')));_0x122209['createHistory'](_0x328a0e)[_0xc23e('0xac')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x328a0e[_0xc23e('0xfe')]+_0x328a0e[_0xc23e('0xea')]+_0x328a0e['countnoanswerretry']+_0x328a0e['countnosuchnumberretry']+_0x328a0e[_0xc23e('0xec')]+_0x328a0e[_0xc23e('0xed')]+_0x328a0e[_0xc23e('0xe8')]+_0x328a0e['countagentrejectretry']>=_0xc62ebc[_0xc23e('0xef')]){_0x122209['stateGlobal'](_0x328a0e,_0x527a7a,_0x11a1ab,_0xc23e('0xf0'));}else{if(_0x328a0e[_0xc23e('0xe8')]>=_0xc62ebc[_0xc23e('0xf1')]){_0x122209[_0xc23e('0xf2')](_0x328a0e,_0x527a7a,_0x11a1ab,_0xc23e('0xff'));}else{_0x122209[_0xc23e('0xba')]({'active':![],'countmachineretry':_0x328a0e[_0xc23e('0xe8')],'scheduledat':moment()['add'](_0xc62ebc['dialMachineRetryFrequency'],_0xc23e('0xf3'))[_0xc23e('0x76')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x328a0e[_0xc23e('0xcd')],'ListId':_0x328a0e[_0xc23e('0xf5')],'VoiceQueueId':_0x328a0e[_0xc23e('0xf6')]||undefined,'CampaignId':_0x328a0e[_0xc23e('0xcf')]||undefined})[_0xc23e('0xac')](loggerCatch('[rescheduleContact][Machine]'));_0x527a7a({'reschedule':0x1});}}});}}};Dialer['prototype'][_0xc23e('0x100')]=function(_0x48da3f){var _0x28365f=this[_0xc23e('0xa5')][_0x48da3f[_0xc23e('0xd8')]];var _0x42298a=this;var _0x5cb497;if(_0x28365f&&_0x28365f[_0xc23e('0x4d')]==='ivr'){delete this[_0xc23e('0xa5')][_0x48da3f['uniqueid']];this[_0xc23e('0xae')](this[_0xc23e('0x1f')][_0x28365f[_0xc23e('0xaf')]]);this[_0xc23e('0x1f')][_0x28365f[_0xc23e('0xaf')]][_0xc23e('0x101')]+=0x1;_0x5cb497=new Hangup(_0x28365f,_0x48da3f);this[_0xc23e('0xc6')](_0x5cb497)[_0xc23e('0xac')](loggerCatch(_0xc23e('0x102')));this[_0xc23e('0xc4')](_0x5cb497)[_0xc23e('0xac')](loggerCatch(_0xc23e('0x103')));}if(_0x28365f&&_0x28365f[_0xc23e('0x4d')]!==_0xc23e('0x91')&&isNotNull(this[_0xc23e('0x1e')][_0x28365f[_0xc23e('0xaf')]][_0xc23e('0x104')])){delete this[_0xc23e('0xa5')][_0x48da3f[_0xc23e('0xd8')]];this[_0xc23e('0xae')](this['voiceQueues'][_0x28365f[_0xc23e('0xaf')]]);this['voiceQueues'][_0x28365f[_0xc23e('0xaf')]][_0xc23e('0x5f')]+=0x1;this[_0xc23e('0x1e')][_0x28365f['queue']]['outboundAnswerAgiCallsDay']+=0x1;_0x5cb497=new Hangup(_0x28365f,_0x48da3f);_0x5cb497['state']=0x10;_0x5cb497['statedesc']=_0xc23e('0x105');_0x5cb497[_0xc23e('0xdf')]='AGI';this['createHistory'](_0x5cb497)[_0xc23e('0xac')](loggerCatch(_0xc23e('0x102')));this['moveContactManagedDialer'](_0x5cb497)[_0xc23e('0xac')](loggerCatch('[syncHangupIvr]'));}if(_0x28365f&&_0x28365f[_0xc23e('0x4d')]!==_0xc23e('0x91')&&!isNotNull(this[_0xc23e('0x1e')][_0x28365f[_0xc23e('0xaf')]]['dialQueueProject'])){delete this[_0xc23e('0xa5')][_0x48da3f[_0xc23e('0xd8')]];this['updateOriginated'](this['voiceQueues'][_0x28365f[_0xc23e('0xaf')]]);this[_0xc23e('0x1e')][_0x28365f[_0xc23e('0xaf')]]['outboundUnknownCallsDay']+=0x1;_0x5cb497=new Hangup(_0x28365f,_0x48da3f);_0x5cb497[_0xc23e('0xa0')]=0xc;_0x5cb497['statedesc']=_0x48da3f['cause-txt'];_0x5cb497[_0xc23e('0xdf')]=_0xc23e('0x106');this['createHistory'](_0x5cb497)[_0xc23e('0xac')](loggerCatch(_0xc23e('0x102')));this[_0xc23e('0xc4')](_0x5cb497)['catch'](loggerCatch(_0xc23e('0x103')));}};Dialer['prototype'][_0xc23e('0x107')]=function(_0x51ecf1){var _0x217ece=this[_0xc23e('0xa5')][_0x51ecf1['uniqueid']];var _0x290b8c=this;if(this['voiceQueues'][_0x51ecf1[_0xc23e('0xaf')]]){if(_0x217ece&&_0x217ece['type']!==_0xc23e('0x91')){delete this[_0xc23e('0xa5')][_0x51ecf1[_0xc23e('0xd8')]];this[_0xc23e('0x1e')][_0x51ecf1[_0xc23e('0xaf')]][_0xc23e('0x5f')]+=0x1;var _0x53a448=new AgentComplete(_0x217ece,_0x51ecf1);if(_0x51ecf1[_0xc23e('0x108')]===_0xc23e('0x109')){_0x53a448['agiafterat']=this[_0xc23e('0x1e')][_0x51ecf1['queue']][_0xc23e('0x10a')]&&this['voiceQueues'][_0x51ecf1[_0xc23e('0xaf')]][_0xc23e('0x10b')]?moment()[_0xc23e('0x76')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this['createHistory'](_0x53a448)['catch'](loggerCatch(_0xc23e('0x10c')));this[_0xc23e('0xc4')](_0x53a448)[_0xc23e('0xac')](loggerCatch(_0xc23e('0x10d')));}}};Dialer['prototype'][_0xc23e('0x2b')]=function(_0x22beb3){if(this[_0xc23e('0x1e')][_0x22beb3[_0xc23e('0xaf')]]){if(this['uniqueId'][_0x22beb3[_0xc23e('0xd8')]]&&this[_0xc23e('0xa5')][_0x22beb3['uniqueid']][_0xc23e('0x4d')]!==_0xc23e('0x91')){this[_0xc23e('0xae')](this[_0xc23e('0x1e')][_0x22beb3[_0xc23e('0xaf')]]);this[_0xc23e('0xa5')][_0x22beb3[_0xc23e('0xd8')]][_0xc23e('0x10e')]=moment()[_0xc23e('0x76')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0xc23e('0x1a')]['queueCallerAbandonCreateState']=function(_0x18ddec){this[_0xc23e('0xc6')](_0x18ddec)[_0xc23e('0xac')](loggerCatch(_0xc23e('0x10c')));this[_0xc23e('0xc4')](_0x18ddec)[_0xc23e('0xac')](loggerCatch(_0xc23e('0x10f')));};Dialer[_0xc23e('0x1a')][_0xc23e('0x2e')]=function(_0x20984b){var _0x310f60=this[_0xc23e('0xa5')][_0x20984b[_0xc23e('0xd8')]];var _0x3472a2=this;if(this['voiceQueues'][_0x20984b['queue']]){if(_0x310f60&&_0x310f60[_0xc23e('0x4d')]!=='ivr'){delete this['uniqueId'][_0x20984b['uniqueid']];this[_0xc23e('0xae')](this[_0xc23e('0x1e')][_0x20984b[_0xc23e('0xaf')]]);_0x310f60[_0xc23e('0x110')]=moment()[_0xc23e('0x76')](_0xc23e('0xf4'));var _0x2d3e01=new QueueCallerAbandon(_0x310f60,_0x20984b);if(getSeconds(_0x310f60[_0xc23e('0x110')],_0x310f60['responsetime'])>=_0x310f60[_0xc23e('0x111')]){this[_0xc23e('0x1e')][_0x20984b[_0xc23e('0xaf')]][_0xc23e('0x6d')]+=0x1;this[_0xc23e('0x1e')][_0x20984b['queue']][_0xc23e('0x65')]+=0x1;this[_0xc23e('0x1e')][_0x20984b[_0xc23e('0xaf')]][_0xc23e('0x6e')]+=0x1;_0x2d3e01[_0xc23e('0xa0')]=0xa;_0x2d3e01[_0xc23e('0xa1')]=_0xc23e('0x112');_0x2d3e01['dropreason']=_0xc23e('0x113');_0x2d3e01[_0xc23e('0x114')]=this[_0xc23e('0x1e')][_0x20984b[_0xc23e('0xaf')]][_0xc23e('0x10a')]?moment()['format'](_0xc23e('0xf4')):undefined;_0x2d3e01[_0xc23e('0xec')]+=0x1;_0x2d3e01[_0xc23e('0xfd')]+=0x1;if(_0x2d3e01['countdropretry']>=this['voiceQueues'][_0x20984b[_0xc23e('0xaf')]]['dialDropMaxRetry']){this[_0xc23e('0x115')](_0x2d3e01);}else{this[_0xc23e('0xba')]({'active':![],'countdropretry':_0x2d3e01['countdropretry'],'scheduledat':moment()[_0xc23e('0x116')](this[_0xc23e('0x1e')][_0x20984b[_0xc23e('0xaf')]][_0xc23e('0x117')],'minutes')[_0xc23e('0x76')](_0xc23e('0xf4')),'ContactId':_0x310f60[_0xc23e('0xcd')],'ListId':_0x310f60['ListId'],'VoiceQueueId':_0x310f60[_0xc23e('0xf6')]||undefined,'CampaignId':_0x310f60[_0xc23e('0xcf')]||undefined})[_0xc23e('0xac')](loggerCatch(_0xc23e('0x118')));var _0x31d2d0=new History(_0x2d3e01);_0x31d2d0[_0xc23e('0xa0')]=0xa;_0x31d2d0[_0xc23e('0xa1')]='Drop';_0x31d2d0[_0xc23e('0xa3')]=moment()[_0xc23e('0x76')](_0xc23e('0xf4'));_0x31d2d0[_0xc23e('0xa2')]=_0x31d2d0[_0xc23e('0xa3')];_0x31d2d0[_0xc23e('0x119')]=_0x2d3e01[_0xc23e('0x119')];_0x31d2d0[_0xc23e('0x11a')]=_0x2d3e01[_0xc23e('0x11a')];this[_0xc23e('0xc6')](_0x31d2d0)['catch'](loggerCatch('[syncAgentComplete][createHistory][10]'));}}else{this[_0xc23e('0x1e')][_0x20984b[_0xc23e('0xaf')]][_0xc23e('0x6c')]+=0x1;this[_0xc23e('0x1e')][_0x20984b['queue']][_0xc23e('0x64')]+=0x1;_0x2d3e01[_0xc23e('0xa0')]=0xb;_0x2d3e01[_0xc23e('0xa1')]=_0xc23e('0x11b');_0x2d3e01[_0xc23e('0x11c')]=_0xc23e('0x11d');_0x2d3e01[_0xc23e('0xed')]+=0x1;_0x2d3e01[_0xc23e('0xfd')]+=0x1;if(_0x2d3e01[_0xc23e('0xed')]>=this[_0xc23e('0x1e')][_0x20984b[_0xc23e('0xaf')]][_0xc23e('0x11e')]){this[_0xc23e('0x115')](_0x2d3e01);}else{this[_0xc23e('0xba')]({'active':![],'countabandonedretry':_0x2d3e01['countabandonedretry'],'scheduledat':moment()[_0xc23e('0x116')](this[_0xc23e('0x1e')][_0x20984b[_0xc23e('0xaf')]][_0xc23e('0x11f')],_0xc23e('0xf3'))[_0xc23e('0x76')](_0xc23e('0xf4')),'ContactId':_0x310f60[_0xc23e('0xcd')],'ListId':_0x310f60[_0xc23e('0xf5')],'VoiceQueueId':_0x310f60[_0xc23e('0xf6')]||undefined,'CampaignId':_0x310f60['CampaignId']||undefined})['catch'](loggerCatch(_0xc23e('0x120')));var _0x31d2d0=new History(_0x2d3e01);_0x31d2d0[_0xc23e('0xa0')]=0xb;_0x31d2d0[_0xc23e('0xa1')]='Abandoned';_0x31d2d0[_0xc23e('0xa3')]=moment()[_0xc23e('0x76')](_0xc23e('0xf4'));_0x31d2d0['endtime']=_0x31d2d0['starttime'];_0x31d2d0[_0xc23e('0x119')]=_0x2d3e01[_0xc23e('0x119')];_0x31d2d0[_0xc23e('0x11a')]=_0x2d3e01[_0xc23e('0x11a')];this['createHistory'](_0x31d2d0)['catch'](loggerCatch(_0xc23e('0x121')));}}}}};Dialer[_0xc23e('0x1a')][_0xc23e('0x122')]=function(_0x351373){if(this['actions'][_0x351373['uniqueid']]){this['actions'][_0x351373[_0xc23e('0xd8')]][_0xc23e('0xab')]=_0x351373[_0xc23e('0xab')];}if(this[_0xc23e('0xa5')][_0x351373['uniqueid']]){this[_0xc23e('0xa5')][_0x351373[_0xc23e('0xd8')]]['channel']=_0x351373[_0xc23e('0xab')];}};Dialer[_0xc23e('0x1a')]['syncQueueMember']=function(_0x4315c4){if(strategy[this['voiceQueues'][this['actions'][_0x4315c4[_0xc23e('0x123')]]['queue']]['strategy']]===_0xc23e('0x124')){if(this[_0xc23e('0xa7')][_0x4315c4['actionid']]&&_['isNil'](this[_0xc23e('0xa7')][_0x4315c4[_0xc23e('0x123')]][_0xc23e('0x125')])&&_0x4315c4['status']==='1'&&_0x4315c4[_0xc23e('0x126')]==='0'){if(this[_0xc23e('0x20')][_0x4315c4[_0xc23e('0x127')]]){if(!this[_0xc23e('0x20')][_0x4315c4['stateinterface']][_0xc23e('0x125')]){this['agents'][_0x4315c4[_0xc23e('0x127')]][_0xc23e('0x125')]=!![];this[_0xc23e('0xa7')][_0x4315c4[_0xc23e('0x123')]]['locked']=!![];this['actions'][_0x4315c4[_0xc23e('0x123')]][_0xc23e('0x127')]=_0x4315c4[_0xc23e('0x127')];}}}}else if((strategy[this[_0xc23e('0x1e')][this[_0xc23e('0xa7')][_0x4315c4[_0xc23e('0x123')]]['queue']][_0xc23e('0x4f')]]||'rrmemory')===_0xc23e('0x19')){if(this[_0xc23e('0xa7')][_0x4315c4[_0xc23e('0x123')]]){if(this[_0xc23e('0x20')][_0x4315c4[_0xc23e('0x127')]]){this['actions'][_0x4315c4['actionid']][_0xc23e('0x127')]=_0x4315c4['stateinterface'];if(_[_0xc23e('0xa8')](this[_0xc23e('0x28')][this[_0xc23e('0xa7')][_0x4315c4[_0xc23e('0x123')]][_0xc23e('0xaf')]])){this['queueBooked'][this[_0xc23e('0xa7')][_0x4315c4[_0xc23e('0x123')]][_0xc23e('0xaf')]]=[];}this['queueBooked'][this[_0xc23e('0xa7')][_0x4315c4[_0xc23e('0x123')]]['queue']][_0xc23e('0x128')](_['merge'](_[_0xc23e('0xcc')](this['actions'][_0x4315c4[_0xc23e('0x123')]],['idHopper',_0xc23e('0x127')]),{'status':_0x4315c4[_0xc23e('0xaa')],'paused':_0x4315c4['paused']}));}}}};function unlockQueueStatus(_0x2d2055,_0x555e3c){setTimeout(function(){if(_[_0xc23e('0x3e')](_0x2d2055['queueStatusComplete'])){loggerBooked[_0xc23e('0x94')]('[unlockQueueStatus][undefined]',_0x555e3c);}_0x2d2055[_0xc23e('0x129')]=!![];loggerBooked['info']('[booked][unlockQueueStatus]',_0x555e3c,JSON[_0xc23e('0x75')](_[_0xc23e('0xcc')](_0x2d2055,[_0xc23e('0x40'),_0xc23e('0x129')])));},0x1f3);}Dialer[_0xc23e('0x1a')][_0xc23e('0x39')]=function(_0x3e3307){var _0x226019=this;var _0x3b67a6=_0x226019[_0xc23e('0x1e')][_0x226019[_0xc23e('0xa7')][_0x3e3307[_0xc23e('0x123')]][_0xc23e('0xaf')]];if(strategy[this[_0xc23e('0x1e')][this[_0xc23e('0xa7')][_0x3e3307[_0xc23e('0x123')]][_0xc23e('0xaf')]][_0xc23e('0x4f')]]===_0xc23e('0x124')){if(this['actions'][_0x3e3307[_0xc23e('0x123')]]&&this['actions'][_0x3e3307['actionid']][_0xc23e('0x127')]){this[_0xc23e('0x1d')]['run'](this[_0xc23e('0xa7')][_0x3e3307[_0xc23e('0x123')]][_0xc23e('0x12a')],this[_0xc23e('0xa7')][_0x3e3307['actionid']]['stateinterface'])[_0xc23e('0xac')](function(_0x4eb0b7){logger[_0xc23e('0x94')](_0xc23e('0x12b'),util[_0xc23e('0x95')](_0x4eb0b7,{'showHidden':![],'depth':null}));})[_0xc23e('0x12c')](function(){_0x226019[_0xc23e('0xae')](_0x226019['voiceQueues'][_0x226019[_0xc23e('0xa7')][_0x3e3307[_0xc23e('0x123')]][_0xc23e('0xaf')]]);_0x226019[_0xc23e('0x20')][_0x226019[_0xc23e('0xa7')][_0x3e3307['actionid']]['stateinterface']]['locked']=![];delete _0x226019[_0xc23e('0xa7')][_0x3e3307[_0xc23e('0x123')]];unlockQueueStatus(_0x3b67a6);});}else{this[_0xc23e('0xae')](this[_0xc23e('0x1e')][this[_0xc23e('0xa7')][_0x3e3307[_0xc23e('0x123')]][_0xc23e('0xaf')]]);this[_0xc23e('0xba')]({'active':![],'ContactId':this[_0xc23e('0xa7')][_0x3e3307[_0xc23e('0x123')]][_0xc23e('0xcd')],'ListId':this[_0xc23e('0xa7')][_0x3e3307[_0xc23e('0x123')]][_0xc23e('0xf5')],'VoiceQueueId':this['actions'][_0x3e3307[_0xc23e('0x123')]][_0xc23e('0xf6')]||undefined,'CampaignId':this['actions'][_0x3e3307[_0xc23e('0x123')]][_0xc23e('0xcf')]||undefined})[_0xc23e('0xac')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this['actions'][_0x3e3307[_0xc23e('0x123')]];unlockQueueStatus(_0x3b67a6);}}else if((strategy[this[_0xc23e('0x1e')][this['actions'][_0x3e3307[_0xc23e('0x123')]]['queue']][_0xc23e('0x4f')]]||_0xc23e('0x19'))===_0xc23e('0x19')){var _0x1f89f2;if(this[_0xc23e('0xa7')][_0x3e3307[_0xc23e('0x123')]]&&!_[_0xc23e('0x79')](this[_0xc23e('0x28')][this[_0xc23e('0xa7')][_0x3e3307['actionid']]['queue']])){if(this[_0xc23e('0x29')][_0x226019[_0xc23e('0xa7')][_0x3e3307[_0xc23e('0x123')]]['queue']]){this[_0xc23e('0x29')][_0x226019[_0xc23e('0xa7')][_0x3e3307[_0xc23e('0x123')]][_0xc23e('0xaf')]]=this['queueBookedRR'][this[_0xc23e('0xa7')][_0x3e3307[_0xc23e('0x123')]][_0xc23e('0xaf')]]?this[_0xc23e('0x29')][this[_0xc23e('0xa7')][_0x3e3307['actionid']][_0xc23e('0xaf')]]:this[_0xc23e('0x28')][this[_0xc23e('0xa7')][_0x3e3307[_0xc23e('0x123')]]['queue']]?this[_0xc23e('0x28')][this[_0xc23e('0xa7')][_0x3e3307[_0xc23e('0x123')]][_0xc23e('0xaf')]][_0xc23e('0x12d')]||0x0:0x0;}this[_0xc23e('0x28')][this['actions'][_0x3e3307['actionid']]['queue']][_0xc23e('0x12d')]=this[_0xc23e('0x29')][this[_0xc23e('0xa7')][_0x3e3307[_0xc23e('0x123')]][_0xc23e('0xaf')]];for(var _0x1dcbb3=0x0;_0x1dcbb3=0x0;})['catch'](myreject(_0x4cf831)));}}else{_0x1032e0[_0xc23e('0x128')](ami[_0xc23e('0xa9')]({'action':_0xc23e('0x145'),'command':util[_0xc23e('0x76')]('iftime\x20%s,%s',_0x54f1ab,!_['isUndefined'](config['timezones'][_0x2d1738])?_0x2d1738:'')})['then'](function(_0x5c9c26){return _0x5c9c26[_0xc23e('0x147')][_0xc23e('0x148')]('true')>=0x0;})['catch'](myreject(_0x4cf831)));}BPromise[_0xc23e('0x14a')](_0x1032e0)[_0xc23e('0x3c')](function(_0xa9f074){var _0x5a7850=_[_0xc23e('0x14b')](_0xa9f074);if(_0x5a7850){return _0x5400e8(_0x5a7850);}else{_0x347a55['message']=_0x4bf31d?_0xc23e('0x14c'):_0xc23e('0x14d');return _0x4cf831(msgResponse(_0xc23e('0x14e'),_0xc23e('0x141'),'Global:\x20'+_0x4bf31d+'\x20'+_0x1bf23c+_0xc23e('0x14f')+util['inspect'](_0x54f1ab,{'showHidden':![],'depth':null})+_0xc23e('0x150')+_0x2d1738));}})[_0xc23e('0xac')](function(_0xe107bc){return _0x4cf831(msgResponse('ifTime',_0xc23e('0x141'),JSON[_0xc23e('0x75')](_0xe107bc)));});});};Dialer[_0xc23e('0x1a')][_0xc23e('0x151')]=function(_0xad47e1){var _0x1dafbf=this;return function(){switch(_0xad47e1['dialMethod']){case'progressive':freeVariablesPredictive(_0xad47e1);_0x1dafbf['handlePower'](_0xad47e1,0x1);break;case _0xc23e('0x152'):freeVariablesPredictive(_0xad47e1);_0x1dafbf[_0xc23e('0x153')](_0xad47e1,_0xad47e1[_0xc23e('0x154')]);break;case _0xc23e('0x7'):_0x1dafbf['predictive'](_0xad47e1);break;case _0xc23e('0x6'):freeVariablesPredictive(_0xad47e1);_0x1dafbf[_0xc23e('0x153')](_0xad47e1,0x1);break;default:freeVariablesPredictive(_0xad47e1);logger[_0xc23e('0x94')](_0xc23e('0x155'),_0xad47e1[_0xc23e('0x40')],_0xc23e('0x156'));}};};Dialer[_0xc23e('0x1a')][_0xc23e('0x157')]=function(_0x47896f){return BPromise[_0xc23e('0xb3')]()['then'](cmHopper['handlePreviewRecallNotifications'](_0x47896f['id'],previewRecallmeReminderInterval))['then'](function(_0x305b68){for(var _0x32e880=0x0;_0x32e880<_0x305b68[_0xc23e('0x96')];_0x32e880++){var _0x11c0aa=_0x305b68[_0x32e880][_0xc23e('0x158')][_0xc23e('0x40')];if(_0x11c0aa)io['to'](util[_0xc23e('0x76')](_0xc23e('0x159'),_0x11c0aa))[_0xc23e('0xe1')](_0xc23e('0x15a'),{'hopper':_0x305b68[_0x32e880]});}})[_0xc23e('0xac')](function(_0x5c5381){});};Dialer[_0xc23e('0x1a')]['launchHandleIvr']=function(_0x451173){var _0x892ced=this;return function(){_0x892ced['handleIvr'](_0x451173);};};Dialer[_0xc23e('0x1a')]['syncQueueSummary']=function(_0x3b5aaa){var _0x47bfe8=this;if(isNotPreview(_0x3b5aaa['dialMethod'])){if(isVoiceQueueOutbound(_0x3b5aaa[_0xc23e('0x4d')])&&isActive(_0x3b5aaa['dialActive'])){_0x3b5aaa[_0xc23e('0x9b')]=!![];BPromise[_0xc23e('0xb3')]()[_0xc23e('0x3c')](checkIsLoggedIn(_0x3b5aaa,_0x3b5aaa['loggedIn']))[_0xc23e('0x3c')](checkIsActive(_0x3b5aaa,_0x3b5aaa['dialActive']))['then'](checkInterval(_0x3b5aaa))[_0xc23e('0x3c')](_0x47bfe8[_0xc23e('0x13a')](_0x3b5aaa))[_0xc23e('0x3c')](_0x47bfe8[_0xc23e('0x13e')](_0x3b5aaa[_0xc23e('0x15b')],_0x3b5aaa['dialTimezone'],_0x3b5aaa[_0xc23e('0x40')],_0x3b5aaa))['then'](_0x47bfe8[_0xc23e('0x15c')](_0x3b5aaa['Interval'],_0x3b5aaa[_0xc23e('0x15d')],_0x3b5aaa[_0xc23e('0x40')],_0x3b5aaa))[_0xc23e('0x3c')](_0x47bfe8[_0xc23e('0x151')](_0x3b5aaa))[_0xc23e('0xac')](loggerCatchQueueSummary(_0xc23e('0x15e'),_0x3b5aaa));}else{notSendMessagesQueue(_0x3b5aaa);}}else{freeVariablesPredictive(_0x3b5aaa);if(_0x3b5aaa['dialPreviewRecallmeReminder']){_0x47bfe8['checkPreviewRecallReminder'](_0x3b5aaa);}}};Dialer[_0xc23e('0x1a')]['syncCampaigns']=function(){var _0x4f8c9a=this;var _0x506afc;for(var _0x36c479 in this['campaigns']){if(typeof this['campaigns'][_0x36c479]!=='undefined'){_0x506afc=this[_0xc23e('0x1f')][_0x36c479];if(isCampaignIvr(_0x506afc['type'])&&isActive(_0x506afc[_0xc23e('0x74')])){_0x506afc[_0xc23e('0x9b')]=!![];BPromise[_0xc23e('0xb3')]()[_0xc23e('0x3c')](checkIsActive(_0x506afc,_0x506afc[_0xc23e('0x74')]))[_0xc23e('0x3c')](checkInterval(_0x506afc))[_0xc23e('0x3c')](_0x4f8c9a[_0xc23e('0x13a')](_0x506afc))[_0xc23e('0x3c')](_0x4f8c9a[_0xc23e('0x13e')](_0x506afc[_0xc23e('0x15b')],_0x506afc[_0xc23e('0x15d')],_0x506afc[_0xc23e('0x40')],_0x506afc))[_0xc23e('0x3c')](_0x4f8c9a[_0xc23e('0x15c')](_0x506afc[_0xc23e('0x44')],_0x506afc[_0xc23e('0x15d')],_0x506afc[_0xc23e('0x40')],_0x506afc))[_0xc23e('0x3c')](_0x4f8c9a[_0xc23e('0x15f')](_0x506afc))['catch'](loggerCatchQueueSummary('[syncCampaigns]',_0x506afc));}else{notSendMessagesCampaign(_0x506afc);}}}};function getCallerIdRandom(_0x18b61d,_0x1a3855){var _0x3d494c;var _0x271d4d;var _0x553229;if(_0x1a3855<=0x0){_0x1a3855=0x1;}_0x3d494c=new RegExp(_0xc23e('0x160')+_0x1a3855+'}$');_0x271d4d=Math[_0xc23e('0x161')](0xa,_0x1a3855-0x1);_0x553229=Math[_0xc23e('0x161')](0xa,_0x1a3855)-0x1;return util['format']('%s',_[_0xc23e('0x162')](_0x18b61d,_0x3d494c,_[_0xc23e('0x163')](_0x271d4d,_0x553229)));}function extractCalleridName(_0x5dc75c){var _0x451803=_0x5dc75c['match'](/"(.*?)"/);return _0x451803?_0x451803[0x1]:_0x5dc75c;}function extractCalleridNumber(_0x1709d7){var _0x4571e0=_0x1709d7[_0xc23e('0x164')](/<(.*?)>/);return _0x4571e0?_0x4571e0[0x1]:_0x1709d7;}Dialer[_0xc23e('0x1a')]['actionOriginate']=function(_0x209ccd,_0x3161d5){var _0x479c68=this;var _0x3a9f91=uuid['v4']();this[_0xc23e('0xa7')][_0x3a9f91]=new Action(_0x209ccd,_0x3161d5,_0x3a9f91);return new BPromise(function(_0x391f58,_0x3c8a49){if(_[_0xc23e('0x3e')](_0x209ccd)&&typeof _0x209ccd!=='object'){return _0x3c8a49(msgResponse('originate',_0xc23e('0x141'),'voiceQueue\x20is\x20undefine'));}if(_['isUndefined'](_0x3161d5[_0xc23e('0x165')][_0xc23e('0x166')])||_0x3161d5[_0xc23e('0x165')][_0xc23e('0x166')]===null){return _0x3c8a49(msgResponse(_0xc23e('0x167'),_0xc23e('0x141'),_0xc23e('0x168')));}var _0x43b9d8={'XMD-CALLERID':_0x479c68[_0xc23e('0xa7')][_0x3a9f91][_0xc23e('0x169')](),'XMD-AGI':_0x209ccd[_0xc23e('0x104')]?util[_0xc23e('0x76')](_0xc23e('0x16a'),ipAgi,_0x209ccd[_0xc23e('0x104')]):_0xc23e('0x16b'),'XMD-AGIAFTER':_0x209ccd['dialQueueProject2']?util[_0xc23e('0x76')](_0xc23e('0x16a'),ipAgi,_0x209ccd[_0xc23e('0x10a')]):_0xc23e('0x16b'),'XMD-QUEUE':_0x209ccd['type']===_0xc23e('0x4e')?util[_0xc23e('0x76')](_0xc23e('0x16c'),_0x209ccd[_0xc23e('0x40')],_0x209ccd[_0xc23e('0x16d')]||'',_0x209ccd[_0xc23e('0x10b')]?'c':'',_0x209ccd[_0xc23e('0x111')]||0x3):_0xc23e('0x16b'),'XMD-CONTACTID':_0x3161d5[_0xc23e('0xcd')],'XMD-CDRTYPE':_0xc23e('0x16e'),'CALLERID(all)':_0x479c68['actions'][_0x3a9f91][_0xc23e('0x169')](),'XMD-AMD':_0x209ccd['dialAMDActive']?_0xc23e('0x16f'):_0xc23e('0x16b'),'XMD-DESTINATION':_0xc23e('0x170')};if(_0x209ccd[_0xc23e('0xdc')]){_0x43b9d8[_0xc23e('0x171')]=_0x209ccd[_0xc23e('0x172')]||0x9c4;_0x43b9d8[_0xc23e('0x173')]=_0x209ccd[_0xc23e('0x174')]||0x5dc;_0x43b9d8[_0xc23e('0x175')]=_0x209ccd[_0xc23e('0x176')]||0x320;_0x43b9d8[_0xc23e('0x177')]=_0x209ccd[_0xc23e('0x178')]||0x1388;_0x43b9d8[_0xc23e('0x179')]=_0x209ccd[_0xc23e('0x17a')]||0x64;_0x43b9d8['XMD-AMDBETWEENWORDSSILENCE']=_0x209ccd[_0xc23e('0x17b')]||0x32;_0x43b9d8[_0xc23e('0x17c')]=_0x209ccd['dialAMDMaximumNumberOfWords']||0x3;_0x43b9d8[_0xc23e('0x17d')]=_0x209ccd[_0xc23e('0x17e')]||0x100;_0x43b9d8[_0xc23e('0x17f')]=_0x209ccd[_0xc23e('0x180')]||0x1388;}if(_0x209ccd[_0xc23e('0x4d')]===_0xc23e('0x4e')){_0x43b9d8['XMD-VOICEQUEUEID']=_0x3161d5[_0xc23e('0xf6')];}else{_0x43b9d8[_0xc23e('0x181')]=_0x3161d5[_0xc23e('0xcf')];}for(var _0x322354 in _0x3161d5[_0xc23e('0x165')]){if(typeof _0x3161d5[_0xc23e('0x165')][_0x322354]!==_0xc23e('0x97')){if(isNotNull(_0x3161d5[_0xc23e('0x165')][_0x322354])&&_0x322354!=='id'&&_0x322354!=='tags'&&_0x322354!=='createdAt'&&_0x322354!=='updatedAt'){_0x43b9d8[util[_0xc23e('0x76')](_0xc23e('0x182'),_0xc23e('0x183'),_[_0xc23e('0x184')](_0x322354))]=_0x3161d5[_0xc23e('0x165')][_0x322354];}}}var _0x10789d=_0x479c68[_0xc23e('0xd4')](_0x209ccd['Trunk'])?getCallerId(_0x209ccd[_0xc23e('0x73')][_0xc23e('0x185')],_0x209ccd[_0xc23e('0x5c')],_0x209ccd[_0xc23e('0x186')]>0x0?getCallerIdRandom(_0x209ccd['dialOriginateCallerIdNumber'],_0x209ccd[_0xc23e('0x186')]):_0x209ccd[_0xc23e('0x5d')]):getCallerId(_[_0xc23e('0xa8')](_0x209ccd['TrunkBackup'])?_0x209ccd[_0xc23e('0x73')][_0xc23e('0x185')]:_0x209ccd[_0xc23e('0x13b')][_0xc23e('0x185')],_0x209ccd[_0xc23e('0x5c')],_0x209ccd[_0xc23e('0x186')]>0x0?getCallerIdRandom(_0x209ccd[_0xc23e('0x5d')],_0x209ccd[_0xc23e('0x186')]):_0x209ccd[_0xc23e('0x5d')]);if(_0x10789d){_0x43b9d8[_0xc23e('0x187')]=_0x479c68[_0xc23e('0xa7')][_0x3a9f91][_0xc23e('0x188')]=extractCalleridName(_0x10789d);_0x43b9d8[_0xc23e('0x189')]=_0x479c68[_0xc23e('0xa7')][_0x3a9f91][_0xc23e('0x18a')]=extractCalleridNumber(_0x10789d);}return ami[_0xc23e('0xa9')]({'actionid':_0x3a9f91,'action':'originate','channel':_0x479c68[_0xc23e('0xd4')](_0x209ccd['Trunk'])?util['format'](_0xc23e('0x18b'),_0x209ccd[_0xc23e('0x73')][_0xc23e('0x40')],isNotNull(_0x209ccd[_0xc23e('0x5e')])?_0x209ccd[_0xc23e('0x5e')][_0xc23e('0x18c')]()||'':'',_0x209ccd[_0xc23e('0x18d')]>0x0?_0x3161d5[_0xc23e('0x165')]['phone'][_0xc23e('0x18e')](_0x209ccd[_0xc23e('0x18d')]):_0x3161d5['Contact'][_0xc23e('0x166')]):util['format'](_0xc23e('0x18b'),_[_0xc23e('0xa8')](_0x209ccd[_0xc23e('0x13b')])?_0x209ccd[_0xc23e('0x73')]['name']:_0x209ccd[_0xc23e('0x13b')][_0xc23e('0x40')],isNotNull(_0x209ccd['dialPrefix'])?_0x209ccd[_0xc23e('0x5e')][_0xc23e('0x18c')]()||'':'',_0x209ccd['dialCutDigit']>0x0?_0x3161d5[_0xc23e('0x165')][_0xc23e('0x166')][_0xc23e('0x18e')](_0x209ccd[_0xc23e('0x18d')]):_0x3161d5['Contact'][_0xc23e('0x166')]),'callerid':_0x10789d,'Exten':'xcally-motion-dialer','Context':_0xc23e('0x18f'),'Priority':'1','variable':_0x43b9d8,'timeout':(_0x209ccd[_0xc23e('0x190')]||0x1e)*0x3e8,'async':!![],'channelid':_0x3a9f91})[_0xc23e('0x3c')](function(_0x4f3143){return _0x391f58(_0x4f3143);})[_0xc23e('0xac')](function(_0x1c28a9){_0x209ccd['outboundOriginateFailureCallsDay']+=0x1;var _0x50c662=new History(_0x479c68[_0xc23e('0xa7')][_0x3a9f91]);logger[_0xc23e('0x94')](util['format'](_0xc23e('0x191'),JSON[_0xc23e('0x75')](_0x1c28a9)));_0x50c662[_0xc23e('0xa0')]=0xe;_0x50c662['statedesc']=_0xc23e('0x192');_0x50c662[_0xc23e('0xa3')]=moment()[_0xc23e('0x76')]('YYYY-MM-DD\x20HH:mm:ss');_0x50c662['endtime']=_0x50c662[_0xc23e('0xa3')];_0x479c68[_0xc23e('0xc6')](_0x50c662)[_0xc23e('0xac')](loggerCatch(_0xc23e('0x193')));_0x479c68[_0xc23e('0xc4')](_0x50c662)[_0xc23e('0xac')](loggerCatch(_0xc23e('0x193')))[_0xc23e('0x12c')](function(){delete _0x479c68[_0xc23e('0xa7')][_0x3a9f91];return _0x3c8a49(msgResponse(_0xc23e('0x167'),_0xc23e('0x49'),_0xc23e('0x194')));});});});};Dialer[_0xc23e('0x1a')][_0xc23e('0x30')]=function(_0x86375d){var _0x3cb745=this['actions'][_0x86375d[_0xc23e('0x123')]];if(_0x3cb745){delete this[_0xc23e('0xa7')][_0x86375d[_0xc23e('0x123')]];_0x3cb745['responsetime']=moment()[_0xc23e('0x76')](_0xc23e('0xf4'));var _0x56a51a=_0x3cb745[_0xc23e('0x4d')]===_0xc23e('0x91')?this[_0xc23e('0x1f')][_0x3cb745[_0xc23e('0xaf')]]:this[_0xc23e('0x1e')][_0x3cb745['getQueue']()];if(!this['isSuccess'](_0x86375d[_0xc23e('0x195')])){this[_0xc23e('0xae')](_0x56a51a);return this[_0xc23e('0x196')](_0x3cb745,_0x56a51a,_0x86375d)[_0xc23e('0xac')](loggerCatch(_0xc23e('0x197')));}this['uniqueId'][_0x86375d[_0xc23e('0xd8')]]=_0x3cb745;}};Dialer[_0xc23e('0x1a')]['checkRetriveMax']=function(_0x2dfdf5,_0x3a36b8,_0x96ae11){var _0x4e6eb1=new History(_0x3a36b8);if(_0x4e6eb1[_0xc23e('0xfe')]+_0x4e6eb1[_0xc23e('0xea')]+_0x4e6eb1[_0xc23e('0x198')]+_0x4e6eb1[_0xc23e('0xeb')]+_0x4e6eb1[_0xc23e('0xec')]+_0x4e6eb1['countabandonedretry']+_0x4e6eb1[_0xc23e('0xe8')]+_0x4e6eb1['countagentrejectretry']>=_0x96ae11[_0xc23e('0xef')]-0x1){return!![];}switch(_0x2dfdf5){case 0x3:if(_0x4e6eb1['countnoanswerretry']>=_0x96ae11[_0xc23e('0x199')]-0x1){return!![];}this[_0xc23e('0xba')]({'active':![],'countnoanswerretry':_0x4e6eb1[_0xc23e('0x198')]+=0x1,'scheduledat':moment()[_0xc23e('0x116')](_0x96ae11[_0xc23e('0x19a')],'minutes')['format'](_0xc23e('0xf4')),'ContactId':_0x4e6eb1['ContactId'],'ListId':_0x4e6eb1[_0xc23e('0xf5')],'VoiceQueueId':_0x4e6eb1[_0xc23e('0xf6')]||undefined,'CampaignId':_0x4e6eb1[_0xc23e('0xcf')]||undefined})[_0xc23e('0xac')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x4e6eb1[_0xc23e('0xfe')]>=_0x96ae11[_0xc23e('0x19b')]-0x1){return!![];}this[_0xc23e('0xba')]({'active':![],'countbusyretry':_0x4e6eb1['countbusyretry']+=0x1,'scheduledat':moment()[_0xc23e('0x116')](_0x96ae11[_0xc23e('0x19c')],_0xc23e('0xf3'))[_0xc23e('0x76')](_0xc23e('0xf4')),'ContactId':_0x4e6eb1[_0xc23e('0xcd')],'ListId':_0x4e6eb1[_0xc23e('0xf5')],'VoiceQueueId':_0x4e6eb1['VoiceQueueId']||undefined,'CampaignId':_0x4e6eb1[_0xc23e('0xcf')]||undefined})['catch'](loggerCatch(_0xc23e('0x19d')));break;case 0x8:if(_0x4e6eb1['countcongestionretry']>=_0x96ae11[_0xc23e('0x19e')]-0x1){return!![];}this[_0xc23e('0xba')]({'active':![],'countcongestionretry':_0x4e6eb1['countcongestionretry']+=0x1,'scheduledat':moment()[_0xc23e('0x116')](_0x96ae11[_0xc23e('0x19f')],_0xc23e('0xf3'))[_0xc23e('0x76')](_0xc23e('0xf4')),'ContactId':_0x4e6eb1[_0xc23e('0xcd')],'ListId':_0x4e6eb1[_0xc23e('0xf5')],'VoiceQueueId':_0x4e6eb1[_0xc23e('0xf6')]||undefined,'CampaignId':_0x4e6eb1[_0xc23e('0xcf')]||undefined})[_0xc23e('0xac')](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x4e6eb1['countnosuchnumberretry']>=_0x96ae11[_0xc23e('0x1a0')]-0x1){return!![];}else{this[_0xc23e('0xba')]({'active':![],'countnosuchnumberretry':_0x4e6eb1[_0xc23e('0xeb')]+=0x1,'scheduledat':moment()[_0xc23e('0x116')](_0x96ae11[_0xc23e('0x1a1')],_0xc23e('0xf3'))['format'](_0xc23e('0xf4')),'ContactId':_0x4e6eb1['ContactId'],'ListId':_0x4e6eb1[_0xc23e('0xf5')],'VoiceQueueId':_0x4e6eb1[_0xc23e('0xf6')]||undefined,'CampaignId':_0x4e6eb1['CampaignId']||undefined})['catch'](loggerCatch(_0xc23e('0x1a2')));}break;case 0xa:if(_0x4e6eb1['countdropretry']>=_0x96ae11['dialDropMaxRetry']-0x1){return!![];}this[_0xc23e('0xba')]({'active':![],'countdropretry':_0x4e6eb1[_0xc23e('0xec')]+=0x1,'scheduledat':moment()[_0xc23e('0x116')](_0x96ae11[_0xc23e('0x117')],_0xc23e('0xf3'))[_0xc23e('0x76')](_0xc23e('0xf4')),'ContactId':_0x4e6eb1[_0xc23e('0xcd')],'ListId':_0x4e6eb1[_0xc23e('0xf5')],'VoiceQueueId':_0x4e6eb1[_0xc23e('0xf6')]||undefined,'CampaignId':_0x4e6eb1[_0xc23e('0xcf')]||undefined})[_0xc23e('0xac')](loggerCatch(_0xc23e('0x118')));break;case 0xb:if(_0x4e6eb1[_0xc23e('0xed')]>=_0x96ae11['dialAbandonedMaxRetry']-0x1){return!![];}this[_0xc23e('0xba')]({'active':![],'countabandonedretry':_0x4e6eb1[_0xc23e('0xed')]+=0x1,'scheduledat':moment()[_0xc23e('0x116')](_0x96ae11['dialAbandonedRetryFrequency'],_0xc23e('0xf3'))[_0xc23e('0x76')](_0xc23e('0xf4')),'ContactId':_0x4e6eb1[_0xc23e('0xcd')],'ListId':_0x4e6eb1[_0xc23e('0xf5')],'VoiceQueueId':_0x4e6eb1[_0xc23e('0xf6')]||undefined,'CampaignId':_0x4e6eb1['CampaignId']||undefined})['catch'](loggerCatch(_0xc23e('0x120')));break;case 0x13:if(_0x4e6eb1[_0xc23e('0xe8')]>=_0x96ae11[_0xc23e('0xf1')]-0x1){return!![];}this[_0xc23e('0xba')]({'active':![],'countmachineretry':_0x4e6eb1['countmachineretry']+=0x1,'scheduledat':moment()['add'](_0x96ae11['dialMachineRetryFrequency'],_0xc23e('0xf3'))[_0xc23e('0x76')](_0xc23e('0xf4')),'ContactId':_0x4e6eb1[_0xc23e('0xcd')],'ListId':_0x4e6eb1[_0xc23e('0xf5')],'VoiceQueueId':_0x4e6eb1[_0xc23e('0xf6')]||undefined,'CampaignId':_0x4e6eb1[_0xc23e('0xcf')]||undefined})[_0xc23e('0xac')](loggerCatch(_0xc23e('0xf7')));break;case 0x14:if(_0x4e6eb1[_0xc23e('0xee')]>=_0x96ae11[_0xc23e('0x1a3')]-0x1){return!![];}this[_0xc23e('0xba')]({'active':![],'countagentrejectretry':_0x4e6eb1[_0xc23e('0xee')]+=0x1,'scheduledat':moment()[_0xc23e('0x116')](_0x96ae11[_0xc23e('0x1a4')],'minutes')[_0xc23e('0x76')](_0xc23e('0xf4')),'ContactId':_0x4e6eb1[_0xc23e('0xcd')],'ListId':_0x4e6eb1[_0xc23e('0xf5')],'VoiceQueueId':_0x4e6eb1[_0xc23e('0xf6')]||undefined,'CampaignId':_0x4e6eb1[_0xc23e('0xcf')]||undefined})[_0xc23e('0xac')](loggerCatch(_0xc23e('0x1a5')));break;default:return!![];}};Dialer[_0xc23e('0x1a')][_0xc23e('0x196')]=function(_0x1d9096,_0x223976,_0x2d0026){var _0x9f3d25=this;var _0x4e7caf=new History(_0x1d9096);return new BPromise(function(_0xd31b3c,_0x27c173){if(_[_0xc23e('0x3e')](_0x223976)&&typeof _0x223976!=='object'){return _0x27c173(msgResponse(_0xc23e('0x1a6'),_0xc23e('0x141'),'entity\x20is\x20undefine'));}if(_[_0xc23e('0x3e')](_0x2d0026)&&typeof _0x2d0026!==_0xc23e('0x1a7')){return _0x27c173(msgResponse(_0xc23e('0x1a6'),_0xc23e('0x141'),_0xc23e('0x1a8')));}switch(_0x2d0026[_0xc23e('0x108')]){case'0':_0x223976[_0xc23e('0x66')]+=0x1;_0x4e7caf['state']=0x0;_0x4e7caf['statedesc']=_0xc23e('0x1a9');_0x4e7caf[_0xc23e('0xeb')]+=0x1;_0x4e7caf[_0xc23e('0xfd')]+=0x1;ami[_0xc23e('0xe1')](_0xc23e('0x1aa'),ut[_0xc23e('0xe3')](_0x1d9096,_0xc23e('0x1ab')));_0x9f3d25['createHistory'](_0x4e7caf)['catch'](loggerCatch(_0xc23e('0xe9')));if(_0x9f3d25[_0xc23e('0x1ac')](0x0,_0x1d9096,_0x223976)){if(_0x4e7caf[_0xc23e('0xeb')]>=_0x223976['dialNoSuchNumberMaxRetry']){_0x9f3d25[_0xc23e('0xf2')](_0x4e7caf,_0xd31b3c,_0x27c173,_0xc23e('0x1ad'));}else{_0x9f3d25[_0xc23e('0x1ae')](_0x4e7caf,_0xd31b3c,_0x27c173,_0xc23e('0x1ad'));}}break;case'3':_0x223976[_0xc23e('0x1af')]+=0x1;_0x4e7caf[_0xc23e('0xa0')]=0x3;_0x4e7caf[_0xc23e('0xa1')]=_0xc23e('0x1b0');_0x4e7caf['countnoanswerretry']+=0x1;_0x4e7caf[_0xc23e('0xfd')]+=0x1;ami[_0xc23e('0xe1')](_0xc23e('0x1b1'),ut['buildObj'](_0x1d9096,_0xc23e('0x1b2')));_0x9f3d25[_0xc23e('0xc6')](_0x4e7caf)['catch'](loggerCatch(_0xc23e('0x1b3')));if(_0x9f3d25[_0xc23e('0x1ac')](0x3,_0x1d9096,_0x223976)){if(_0x4e7caf[_0xc23e('0x198')]>=_0x223976[_0xc23e('0x199')]){_0x9f3d25['createStateFinal'](_0x4e7caf,_0xd31b3c,_0x27c173,_0xc23e('0x1b4'));}else{_0x9f3d25[_0xc23e('0x1ae')](_0x4e7caf,_0xd31b3c,_0x27c173,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x223976['outboundBusyCallsDay']+=0x1;_0x4e7caf['state']=0x5;_0x4e7caf[_0xc23e('0xa1')]=_0xc23e('0x1b5');_0x4e7caf[_0xc23e('0xfe')]+=0x1;_0x4e7caf[_0xc23e('0xfd')]+=0x1;ami[_0xc23e('0xe1')](_0xc23e('0x1b6'),ut[_0xc23e('0xe3')](_0x1d9096,_0xc23e('0x1b7')));_0x9f3d25[_0xc23e('0xc6')](_0x4e7caf)[_0xc23e('0xac')](loggerCatch(_0xc23e('0x1b8')));if(_0x9f3d25[_0xc23e('0x1ac')](0x5,_0x1d9096,_0x223976)){if(_0x4e7caf[_0xc23e('0xfe')]>=_0x223976[_0xc23e('0x19b')]){_0x9f3d25[_0xc23e('0xf2')](_0x4e7caf,_0xd31b3c,_0x27c173,_0xc23e('0x1b9'));}else{_0x9f3d25[_0xc23e('0x1ae')](_0x4e7caf,_0xd31b3c,_0x27c173,_0xc23e('0x1b9'));}}break;case'8':_0x223976[_0xc23e('0x62')]+=0x1;_0x4e7caf[_0xc23e('0xa0')]=0x8;_0x4e7caf['statedesc']=_0xc23e('0x1ba');_0x4e7caf[_0xc23e('0xea')]+=0x1;_0x4e7caf[_0xc23e('0xfd')]+=0x1;ami[_0xc23e('0xe1')](_0xc23e('0x1bb'),ut[_0xc23e('0xe3')](_0x1d9096,'congestion'));_0x9f3d25[_0xc23e('0xc6')](_0x4e7caf)['catch'](loggerCatch(_0xc23e('0x1bc')));if(_0x9f3d25[_0xc23e('0x1ac')](0x8,_0x1d9096,_0x223976)){if(_0x4e7caf[_0xc23e('0xea')]>=_0x223976[_0xc23e('0x19e')]){_0x9f3d25[_0xc23e('0xf2')](_0x4e7caf,_0xd31b3c,_0x27c173,_0xc23e('0x1bd'));}else{_0x9f3d25[_0xc23e('0x1ae')](_0x4e7caf,_0xd31b3c,_0x27c173,_0xc23e('0x1bd'));}}break;case'11':_0x223976[_0xc23e('0x1be')]+=0x1;_0x4e7caf[_0xc23e('0xa0')]=0xb;_0x4e7caf[_0xc23e('0xa1')]=_0xc23e('0x11b');_0x4e7caf[_0xc23e('0xed')]+=0x1;_0x4e7caf[_0xc23e('0xfd')]+=0x1;_0x9f3d25[_0xc23e('0xc6')](_0x4e7caf)[_0xc23e('0xac')](loggerCatch(_0xc23e('0x121')));if(_0x9f3d25[_0xc23e('0x1ac')](0xb,_0x1d9096,_0x223976)){if(_0x4e7caf[_0xc23e('0xed')]>=_0x223976[_0xc23e('0x11e')]){_0x9f3d25['createStateFinal'](_0x4e7caf,_0xd31b3c,_0x27c173,_0xc23e('0x1bf'));}else{_0x9f3d25[_0xc23e('0x1ae')](_0x4e7caf,_0xd31b3c,_0x27c173,_0xc23e('0x1bf'));}}break;case'20':_0x223976['outboundRejectCallsDay']+=0x1;_0x4e7caf['state']=0x14;_0x4e7caf[_0xc23e('0xa1')]='AgentReject';_0x4e7caf[_0xc23e('0xee')]+=0x1;_0x4e7caf[_0xc23e('0xfd')]+=0x1;ami[_0xc23e('0xe1')](_0xc23e('0x1c0'),ut[_0xc23e('0xe3')](_0x1d9096,_0xc23e('0x1c1')));_0x9f3d25[_0xc23e('0xc6')](_0x4e7caf)[_0xc23e('0xac')](loggerCatch(_0xc23e('0x1c2')));if(_0x9f3d25['checkRetriveMax'](0x14,_0x1d9096,_0x223976)){if(_0x4e7caf[_0xc23e('0xee')]>=_0x223976[_0xc23e('0x1a3')]){_0x9f3d25['createStateFinal'](_0x4e7caf,_0xd31b3c,_0x27c173,_0xc23e('0x1c3'));}else{_0x9f3d25['stateGlobal'](_0x4e7caf,_0xd31b3c,_0x27c173,_0xc23e('0x1c3'));}}break;default:_0x223976[_0xc23e('0x69')]+=0x1;_0x4e7caf[_0xc23e('0xa0')]=0xc;_0x4e7caf[_0xc23e('0xa1')]=_0x2d0026[_0xc23e('0x108')];_0x9f3d25['createHistory'](_0x4e7caf)[_0xc23e('0xac')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x9f3d25['checkRetriveMax'](_0x2d0026[_0xc23e('0x108')],_0x1d9096,_0x223976)){if(_0x4e7caf[_0xc23e('0xfe')]+_0x4e7caf[_0xc23e('0xea')]+_0x4e7caf[_0xc23e('0x198')]+_0x4e7caf[_0xc23e('0xeb')]+_0x4e7caf[_0xc23e('0xec')]+_0x4e7caf[_0xc23e('0xed')]+_0x4e7caf[_0xc23e('0xe8')]+_0x4e7caf[_0xc23e('0xee')]>=_0x223976[_0xc23e('0xef')]){_0x9f3d25['stateGlobal'](_0x4e7caf,_0xd31b3c,_0x27c173,_0x2d0026[_0xc23e('0x108')]);}else{_0x9f3d25[_0xc23e('0xf2')](_0x4e7caf,_0xd31b3c,_0x27c173,_0x2d0026[_0xc23e('0x108')]);}}}});};Dialer[_0xc23e('0x1a')][_0xc23e('0x1ae')]=function(_0xa223d6,_0x4b7300,_0x2dcb3a,_0x326491){var _0x478b81=new Final(_0xa223d6);_0x478b81[_0xc23e('0xa0')]=0xf;_0x478b81['statedesc']='Global';this['createStateFinal'](_0x478b81,_0x4b7300,_0x2dcb3a,_0x326491);};Dialer[_0xc23e('0x1a')][_0xc23e('0xf2')]=function(_0x1134e5,_0x1b5603,_0x4838e7,_0x5a4425){this[_0xc23e('0xc4')](_0x1134e5)[_0xc23e('0x3c')](function(){return _0x1b5603(msgResponse(_0xc23e('0x1a6'),_0xc23e('0xd3'),_0x5a4425));})[_0xc23e('0xac')](function(){return _0x4838e7(msgResponse(_0xc23e('0x1c4'),_0xc23e('0x141'),_0xc23e('0x1c5')));});};Dialer['prototype'][_0xc23e('0x7')]=function(_0x432b83){var _0xfdd4b3=_0x432b83[_0xc23e('0x1c6')]/0x64;var _0x2b9848=_0x432b83[_0xc23e('0x65')]/(_0x432b83[_0xc23e('0x65')]+_0x432b83[_0xc23e('0x5f')]);var _0x25e6be=Math[_0xc23e('0x1c7')](_0x432b83[_0xc23e('0x70')]*(_0x432b83['predictiveIntervalMaxThreshold']/0x64));var _0x2b255e=Math['round'](_0x432b83[_0xc23e('0x70')]*(_0x432b83[_0xc23e('0x1c8')]/0x64));var _0x379cc9=_0x432b83[_0xc23e('0x51')]+_0x432b83[_0xc23e('0x57')];var _0x13e75b=Math['floor'](_0x432b83[_0xc23e('0x72')]*_0x432b83[_0xc23e('0x8b')]*_0x432b83['predictiveIntervalHitRate']*_0x432b83[_0xc23e('0x1c9')]);if(_['isUndefined'](_0x432b83['startProgressive'])){if(!_[_0xc23e('0x3e')](_0x432b83[_0xc23e('0x25')])){_0x432b83['startPredictive']=undefined;loggerPredictive['error']('[startMethodPredictive][StartProgressive]',_0xc23e('0x1ca'));}if(!_['isUndefined'](_0x432b83[_0xc23e('0x8f')])){loggerPredictive[_0xc23e('0x94')](_0xc23e('0x1cb'),_0xc23e('0x1cc'));clearInterval(_0x432b83[_0xc23e('0x8f')]);_0x432b83[_0xc23e('0x8f')]=undefined;}_0x432b83[_0xc23e('0x26')]=moment()[_0xc23e('0x76')](_0xc23e('0xf4'));loggerPredictive[_0xc23e('0x7a')](_0x432b83[_0xc23e('0x40')],_0xc23e('0x1cd'),_0x432b83['startProgressive']);this[_0xc23e('0x153')](_0x432b83,0x1);}else if(ifInterval(_0x432b83['dialPredictiveInterval'],_0x432b83[_0xc23e('0x26')])){this[_0xc23e('0x153')](_0x432b83,0x1);loggerPredictiveCalls[_0xc23e('0x7a')]('[startMethodPredictive][StartProgressive][Loop]',_0x432b83[_0xc23e('0x26')],_0x432b83['name']);_0x432b83[_0xc23e('0x72')]=0x0;_0x432b83[_0xc23e('0x6e')]=0x0;}else if(_0xfdd4b3<_0x2b9848&&_0x432b83[_0xc23e('0x1ce')]===_0xc23e('0x1cf')){freeVariablesPredictive(_0x432b83);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0xc23e('0x1d0'),_0x2b9848,_0xc23e('0x26'),_0x432b83[_0xc23e('0x40')]);}else if(_0x13e75b<_0x432b83['predictiveIntervalErlangCallsDroppedCalls']&&_0x432b83[_0xc23e('0x1ce')]==='dropRate'){freeVariablesPredictive(_0x432b83);loggerPredictive['info'](_0xc23e('0x1d1'),_0xc23e('0x1d2'),_0x13e75b,'Drop\x20in\x20this\x20interval',_0x432b83['predictiveIntervalErlangCallsDroppedCalls'],'startProgressive',_0x432b83[_0xc23e('0x40')]);}else if(!ifInterval(_0x432b83['dialPredictiveInterval'],_0x432b83[_0xc23e('0x26')])&&_[_0xc23e('0x3e')](_0x432b83[_0xc23e('0x25')])&&!_[_0xc23e('0x3e')](_0x432b83[_0xc23e('0x26')])){_0x432b83[_0xc23e('0x25')]=moment()[_0xc23e('0x76')](_0xc23e('0xf4'));loggerPredictive[_0xc23e('0x7a')](_0x432b83[_0xc23e('0x40')],'started\x20in\x20predictive\x20at',_0x432b83[_0xc23e('0x25')]);this[_0xc23e('0xb7')](_0x432b83[_0xc23e('0x1d3')])[_0xc23e('0x3c')](this['getDataPredictive'](_0x432b83))['then'](mergeDataErlangB(_0x432b83))[_0xc23e('0x3c')](this[_0xc23e('0x1d4')](_0x432b83))[_0xc23e('0xac')](loggerCatchPredictive(_0xc23e('0x1d5'),_0x432b83));}else if(!ifInterval(_0x432b83[_0xc23e('0x1d3')],_0x432b83[_0xc23e('0x25')])){_0x432b83[_0xc23e('0x6e')]=0x0;_0x432b83[_0xc23e('0x25')]=moment()[_0xc23e('0x76')](_0xc23e('0xf4'));loggerPredictive[_0xc23e('0x7a')](_0x432b83[_0xc23e('0x40')],'recalculate\x20predictive\x20at',_0x432b83[_0xc23e('0x25')]);clearInterval(_0x432b83[_0xc23e('0x8f')]);_0x432b83[_0xc23e('0x8f')]=undefined;this[_0xc23e('0xb7')](_0x432b83[_0xc23e('0x1d3')])[_0xc23e('0x3c')](this[_0xc23e('0x1d6')](_0x432b83))[_0xc23e('0x3c')](mergeDataErlangB(_0x432b83))['then'](this[_0xc23e('0x1d4')](_0x432b83))[_0xc23e('0xac')](loggerCatchPredictive(_0xc23e('0x1d7'),_0x432b83));}else if(_0x432b83['predictiveIntervalAvailable']&&_0x379cc9<_0x432b83[_0xc23e('0x70')]-_0x2b255e){freeVariablesPredictive(_0x432b83);loggerPredictive['info'](_0x432b83['name'],_0xc23e('0x1d8'),_0x379cc9,_0xc23e('0x1d9'),_0x432b83[_0xc23e('0x70')],'-',_0x2b255e,'=',_0x432b83[_0xc23e('0x70')]-_0x2b255e,')');}else if(_0x432b83[_0xc23e('0x70')]&&_0x379cc9>_0x432b83[_0xc23e('0x70')]+_0x25e6be){freeVariablesPredictive(_0x432b83);loggerPredictive[_0xc23e('0x7a')](_0x432b83[_0xc23e('0x40')],_0xc23e('0x1d8'),_0x379cc9,_0xc23e('0x1da'),_0x432b83[_0xc23e('0x70')],'+',_0x25e6be,'=',_0x432b83['predictiveIntervalAvailable']+_0x25e6be,')');}};Dialer['prototype'][_0xc23e('0x1d6')]=function(_0x5d4759){var _0x1d50f5=this;return function(_0xc9317a){return new BPromise(function(_0x312f63,_0x30f289){_[_0xc23e('0x8e')](_0x5d4759,_0xc9317a[0x0]);if(checkGetDataPredictive(_0xc9317a[0x0])){var _0x1b7a49=_0x5d4759[_0xc23e('0x70')]=_0x5d4759[_0xc23e('0x57')]+_0x5d4759[_0xc23e('0x51')];var _0x27d02e=_0x5d4759['dialPredictiveInterval']*0x3c;var _0x1b7aa4=_0xc9317a[0x0][_0xc23e('0x6b')]+_0xc9317a[0x0][_0xc23e('0x6a')];var _0x226187=(_0xc9317a[0x0][_0xc23e('0x7f')]+_0xc9317a[0x0][_0xc23e('0x6d')]+_0xc9317a[0x0][_0xc23e('0x6c')])/_0xc9317a[0x0][_0xc23e('0x7d')];_0x5d4759[_0xc23e('0x6f')]=_0x226187>0x0?_0x226187:0x1;switch(_0x5d4759[_0xc23e('0x1ce')]){case'dropRate':var _0x283b17=_0x5d4759[_0xc23e('0x1c6')]/0x64;return _0x1d50f5[_0xc23e('0x1db')](_0x1b7a49,_0x27d02e,_0x1b7aa4,_0x226187,_0x283b17)[_0xc23e('0x3c')](function(_0x555705){return _0x312f63(_0x555705);});case _0xc23e('0x1dc'):var _0xb34df2=_0x5d4759['dialPredictiveOptimizationPercentage']/0x64;return _0x1d50f5[_0xc23e('0x1dd')](_0x1b7a49,_0x27d02e,_0x1b7aa4,_0x226187,_0xb34df2)[_0xc23e('0x3c')](function(_0x29a4e1){return _0x312f63(_0x29a4e1);});default:return _0x30f289(msgResponse(_0xc23e('0x1de'),'Failure',_0xc23e('0x1df')));}}else{return _0x30f289(msgResponse(_0xc23e('0x1de'),_0xc23e('0x141'),_0xc23e('0x1e0')));}});};};Dialer[_0xc23e('0x1a')][_0xc23e('0x1e1')]=function(_0x1b48a5){var _0xaece35=this;return function(_0x21aa16){return new BPromise(function(_0x1c2db7,_0x544294){_[_0xc23e('0x8e')](_0x1b48a5,_0x21aa16[0x0]);if(checkGetDataPredictive(_0x21aa16[0x0])){loggerPredictive['info'](JSON[_0xc23e('0x75')](_0x21aa16[0x0]));if(_0x1b48a5[_0xc23e('0x1ce')]===_0xc23e('0x1cf')){return _0xaece35[_0xc23e('0xc3')](_0x1b48a5['id'])[_0xc23e('0x3c')](function(_0x15d2a5){var _0x25abea=_0x1b48a5[_0xc23e('0x52')]-_0x15d2a5[0x0][_0xc23e('0x1e2')];var _0x2814a4=_0x1b48a5[_0xc23e('0x1d3')]*0x3c;var _0x5b383a=_0x21aa16[0x0][_0xc23e('0x6b')]+_0x21aa16[0x0][_0xc23e('0x6a')];var _0x551e3a=(_0x21aa16[0x0][_0xc23e('0x7f')]+_0x21aa16[0x0][_0xc23e('0x6d')]+_0x21aa16[0x0][_0xc23e('0x6c')])/_0x21aa16[0x0][_0xc23e('0x7d')];var _0x11a4a3=_0x1b48a5[_0xc23e('0x1c6')]/0x64;_0x1b48a5[_0xc23e('0x1e3')]=_0x15d2a5[0x0][_0xc23e('0x1e2')]||0x0;_0x1b48a5[_0xc23e('0x6f')]=_0x551e3a>0x0?_0x551e3a:0x1;return _0xaece35['abandonmentRate'](_0x25abea,_0x2814a4,_0x5b383a,_0x551e3a,_0x11a4a3);})[_0xc23e('0x3c')](function(_0x244469){return _0x1c2db7(_0x244469);})[_0xc23e('0xac')](function(_0x450445){return _0x544294(msgResponse(_0xc23e('0x1e4'),'Failure',JSON[_0xc23e('0x75')](_0x450445)));});}if(_0x1b48a5[_0xc23e('0x1ce')]==='agentBusyFactor'){return _0xaece35[_0xc23e('0xc3')](_0x1b48a5['id'])['then'](function(_0xd8237e){var _0x2d99de=_0x1b48a5[_0xc23e('0x52')]-_0xd8237e[0x0][_0xc23e('0x1e2')];var _0x1f386a=_0x1b48a5[_0xc23e('0x1d3')]*0x3c;var _0x7597cf=_0x21aa16[0x0]['predictiveIntervalAvgTalktime']+_0x21aa16[0x0][_0xc23e('0x6a')];var _0x5e4c52=(_0x21aa16[0x0][_0xc23e('0x7f')]+_0x21aa16[0x0][_0xc23e('0x6d')]+_0x21aa16[0x0][_0xc23e('0x6c')])/_0x21aa16[0x0]['predictiveIntervalTotalCalls'];var _0x3aae02=_0x1b48a5['dialPredictiveOptimizationPercentage']/0x64;_0x1b48a5[_0xc23e('0x1e3')]=_0xd8237e[0x0][_0xc23e('0x1e2')]||0x0;_0x1b48a5[_0xc23e('0x6f')]=_0x5e4c52>0x0?_0x5e4c52:0x1;return _0xaece35[_0xc23e('0x1dd')](_0x2d99de,_0x1f386a,_0x7597cf,_0x5e4c52,_0x3aae02);})[_0xc23e('0x3c')](function(_0x475069){return _0x1c2db7(_0x475069);})[_0xc23e('0xac')](function(_0x18f069){return _0x544294(msgResponse('[CatchErlangB]',_0xc23e('0x141'),JSON[_0xc23e('0x75')](_0x18f069)));});}}else{return _0x544294(msgResponse('[getDataPredictive]',_0xc23e('0x141'),'check\x20failure'));}});};};Dialer[_0xc23e('0x1a')]['startMethodPredictive']=function(_0x18322d){var _0xcaa4fc=this;return function(){var _0x336087=0x0;var _0x23f6b1=Math[_0xc23e('0x1e5')](_0x18322d[_0xc23e('0x89')]*0x3e8);if(_0x23f6b1>0x0){_0x23f6b1=_0x23f6b1<0x64?0x64:_0x23f6b1;loggerPredictive[_0xc23e('0x7a')](_0x18322d[_0xc23e('0x40')],_0xc23e('0x1e6'),_0x23f6b1,'milliseconds');_0x18322d[_0xc23e('0x8f')]=setInterval(function(){_0xcaa4fc[_0xc23e('0x8f')](_0x18322d);loggerPredictiveCalls[_0xc23e('0x7a')](_0xc23e('0x1e7'),_0x336087+=0x1);},_0x23f6b1);}else{loggerPredictive[_0xc23e('0x7a')](_0x18322d['name'],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0xc23e('0x1a')][_0xc23e('0x1e8')]=function(_0x116aac,_0x5abbda){var _0x556cb4=this;return function(_0x470800){if(_[_0xc23e('0x79')](_0x470800)){if(_['isNil'](_0x5abbda[_0xc23e('0xce')])||!_0x5abbda[_0xc23e('0x1e9')]){if(_0x116aac[_0xc23e('0x5b')]===_0xc23e('0x6')){_0x116aac['queueStatusComplete']=_[_0xc23e('0x3e')](_0x116aac[_0xc23e('0x129')])?!![]:_0x116aac[_0xc23e('0x129')];var _0x5ddee0=uuid['v4']();_0x556cb4['actions'][_0x5ddee0]=new Action(_0x116aac,_0x5abbda,_0x5ddee0);loggerBooked[_0xc23e('0x7a')](_0xc23e('0x1ea'),_0x5ddee0,_0xc23e('0x1eb'),JSON[_0xc23e('0x75')](_0x116aac[_0xc23e('0x129')]),_0xc23e('0x1ec'),_0x116aac[_0xc23e('0x40')]);if(_0x116aac[_0xc23e('0x129')]){_0x116aac[_0xc23e('0x129')]=![];_0x556cb4[_0xc23e('0x28')][_0x556cb4[_0xc23e('0xa7')][_0x5ddee0]['queue']]=[];ami['Action']({'actionid':_0x5ddee0,'action':_0xc23e('0x1ed'),'queue':_0x116aac['name']})[_0xc23e('0xac')](function(){_0x556cb4['updateOriginated'](_0x116aac);_0x556cb4[_0xc23e('0xba')]({'active':![],'ContactId':_0x556cb4[_0xc23e('0xa7')][_0x5ddee0]['ContactId'],'ListId':_0x556cb4[_0xc23e('0xa7')][_0x5ddee0][_0xc23e('0xf5')],'VoiceQueueId':_0x556cb4[_0xc23e('0xa7')][_0x5ddee0]['VoiceQueueId']||undefined,'CampaignId':_0x556cb4['actions'][_0x5ddee0][_0xc23e('0xcf')]||undefined})['catch'](loggerCatch(_0xc23e('0x1ee')));delete _0x556cb4['actions'][_0x5ddee0];});}else{loggerBooked['info'](_0xc23e('0x1ef'),JSON['stringify'](_0x116aac[_0xc23e('0x129')]),'Queue:\x20',_0x116aac[_0xc23e('0x40')]);_0x556cb4[_0xc23e('0xae')](_0x116aac);_0x556cb4['rescheduleContact']({'active':![],'ContactId':_0x556cb4[_0xc23e('0xa7')][_0x5ddee0][_0xc23e('0xcd')],'ListId':_0x556cb4[_0xc23e('0xa7')][_0x5ddee0][_0xc23e('0xf5')],'VoiceQueueId':_0x556cb4[_0xc23e('0xa7')][_0x5ddee0][_0xc23e('0xf6')]||undefined,'CampaignId':_0x556cb4[_0xc23e('0xa7')][_0x5ddee0]['CampaignId']||undefined})[_0xc23e('0xac')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x556cb4[_0xc23e('0xa7')][_0x5ddee0];}}else{return _0x556cb4[_0xc23e('0x1f0')](_0x116aac,_0x5abbda);}}else{if(getDiff(_0x5abbda[_0xc23e('0x1f1')])<_0x116aac[_0xc23e('0x1f2')]*0x3c){if(_0x5abbda[_0xc23e('0x158')]&&!_0x5abbda[_0xc23e('0x158')]['voicePause']){_0x556cb4[_0xc23e('0x1d')][_0xc23e('0x131')](_0x5abbda['id'])[_0xc23e('0x12c')](function(){_0x556cb4[_0xc23e('0xae')](_0x116aac);});}else{_0x556cb4['unlockContact']({'active':![]},_0x5abbda['id'],0x1)[_0xc23e('0x12c')](function(){_0x556cb4[_0xc23e('0xae')](_0x116aac);});}}else{_0x116aac[_0xc23e('0x67')]+=0x1;_0x556cb4[_0xc23e('0xae')](_0x116aac);if(_0x116aac[_0xc23e('0x1f3')]){_0x556cb4['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x5abbda[_0xc23e('0xcd')],'ListId':_0x5abbda[_0xc23e('0xf5')],'VoiceQueueId':_0x5abbda[_0xc23e('0xf6')]||undefined,'CampaignId':_0x5abbda['CampaignId']||undefined})[_0xc23e('0xac')](loggerCatch(_0xc23e('0x1f4')));_0x556cb4[_0xc23e('0xc6')](createObjHistory(_0x116aac,_0x5abbda,_0xc23e('0x1f5'),0x17,_0xc23e('0x1f6')))[_0xc23e('0xac')](loggerCatch(_0xc23e('0x1f7')));}else{_0x556cb4[_0xc23e('0xcb')](createObjHistory(_0x116aac,_0x5abbda,_0xc23e('0x1f8'),0x16,_0xc23e('0x1f9')),_0xc23e('0x1fa'),_0xc23e('0x1fb'));}}}}else{_0x116aac[_0xc23e('0x60')]+=0x1;_0x556cb4[_0xc23e('0xcb')](createObjHistory(_0x116aac,_0x5abbda,'BLACKLIST',0xd,'Blacklist'),'[Originate][historyBlacklist]','[Originate][MoveBlacklist]');throw _0xc23e('0x1fc');}};};Dialer[_0xc23e('0x1a')]['handleIvr']=function(_0x3f74ae){var _0x25cd67=this;var _0x18311f=_0x3f74ae[_0xc23e('0x1fd')]-_0x3f74ae['originated']-_0x3f74ae[_0xc23e('0xbf')];emitCampaignSummary(_0x3f74ae);if(_0x18311f>0x0){if(_0x18311f>this['maxNumberOriginate']){_0x18311f=this[_0xc23e('0x22')];}_0x3f74ae[_0xc23e('0xbf')]+=_0x18311f;this[_0xc23e('0xc1')](_0x3f74ae['id'],_0x18311f,_0x3f74ae[_0xc23e('0x1fe')],_0x3f74ae)[_0xc23e('0x3c')](function(_0x12df12){_0x3f74ae[_0xc23e('0xbf')]-=_0x18311f;_0x3f74ae['temp']=_0x3f74ae[_0xc23e('0xbf')]>0x0?_0x3f74ae[_0xc23e('0xbf')]:0x0;if(!checkContactEmpty(_0x12df12)){_0x3f74ae[_0xc23e('0x3f')]='AVAILABLE_CONTACTS_FINISHED';logger[_0xc23e('0x7a')](_0xc23e('0x1ff')+_0x3f74ae[_0xc23e('0x40')]);}else{_0x3f74ae['originated']+=_0x12df12[_0xc23e('0x96')];_0x3f74ae[_0xc23e('0x3f')]='RUNNING';for(var _0x48a904=0x0;_0x48a904<_0x12df12['length'];_0x48a904+=0x1){_0x3f74ae['ivrTotalCallsDays']+=0x1;if(_['isNil'](_0x12df12[_0x48a904])||_['isNil'](_0x12df12[_0x48a904]['Contact'])||_['isNil'](_0x12df12[_0x48a904][_0xc23e('0x165')][_0xc23e('0x166')])){_0x25cd67[_0xc23e('0xca')](_0xc23e('0x200'),_0x3f74ae,_0x12df12[_0x48a904]);}else{_0x25cd67['checkIsBlackListIvr'](_['pick'](_0x12df12[_0x48a904],[_0xc23e('0xcf'),_0xc23e('0x201')]))['then'](_0x25cd67[_0xc23e('0x1e8')](_0x3f74ae,_0x12df12[_0x48a904]))[_0xc23e('0xac')](_0x25cd67[_0xc23e('0xc9')](_0xc23e('0x202'),_0x3f74ae));}}}})[_0xc23e('0xac')](loggerGetContactDialer('[getContactCampaign2]',_0x3f74ae,_0x18311f));}};Dialer[_0xc23e('0x1a')][_0xc23e('0x153')]=function(_0x229db0,_0x23050d){var _0x70515c=this;var _0x3ae23b=[];var _0x18a209=_0x23050d>=0x1?_0x23050d:0x1;if(_0x229db0['dialMethod']===_0xc23e('0x6')){_0x18a209=0x1;}var _0xf4e3c4=Math[_0xc23e('0x1e5')](_0x229db0[_0xc23e('0x51')]*_0x18a209)-_0x229db0[_0xc23e('0x71')]-_0x229db0['temp'];emitVoiceQueueSummary(_0x229db0);if(_0x229db0[_0xc23e('0x203')]>0x0){var _0x4fb502=_0x229db0[_0xc23e('0x203')]-_0x229db0[_0xc23e('0x71')]-_0x229db0[_0xc23e('0x57')]-_0x229db0[_0xc23e('0xbf')]-_0x229db0[_0xc23e('0x53')];if(_0xf4e3c4>_0x4fb502){_0xf4e3c4=_0x4fb502;}}if(_0xf4e3c4>0x0){if(_0x229db0[_0xc23e('0x5b')]===_0xc23e('0x6')){_0xf4e3c4=0x1;}if(_0xf4e3c4>this[_0xc23e('0x22')]){_0xf4e3c4=this[_0xc23e('0x22')];}_0x229db0[_0xc23e('0xbf')]+=_0xf4e3c4;for(var _0x30dc24 in this['agents']){if(typeof this[_0xc23e('0x20')][_0x30dc24]!==_0xc23e('0x97')){if(this[_0xc23e('0x20')][_0x30dc24][_0xc23e('0xa0')]===_0xc23e('0x204')&&this[_0xc23e('0x20')][_0x30dc24][_0xc23e('0xaa')]===_0xc23e('0xd5')){_0x3ae23b['push'](this['agents'][_0x30dc24]['id']);}}}this[_0xc23e('0xbe')](_0x229db0['id'],_0x3ae23b,_0xf4e3c4,_0x229db0[_0xc23e('0x1fe')],_0x229db0)[_0xc23e('0x3c')](function(_0x4e6d9a){_0x229db0[_0xc23e('0xbf')]-=_0xf4e3c4;_0x229db0[_0xc23e('0xbf')]=_0x229db0[_0xc23e('0xbf')]>0x0?_0x229db0[_0xc23e('0xbf')]:0x0;if(!checkContactEmpty(_0x4e6d9a)){_0x70515c[_0xc23e('0xb2')](_0x229db0)[_0xc23e('0x3c')](sendMessageReschedule(_0x229db0))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x229db0[_0xc23e('0x71')]+=_0x4e6d9a['length'];_0x229db0[_0xc23e('0x3f')]=_0x229db0[_0xc23e('0x5b')]===_0xc23e('0x6')?_0xc23e('0x16f'):_0xc23e('0x205');for(var _0xbae213=0x0;_0xbae213<_0x4e6d9a['length'];_0xbae213+=0x1){if(_[_0xc23e('0xa8')](_0x4e6d9a[_0xbae213])||_[_0xc23e('0xa8')](_0x4e6d9a[_0xbae213][_0xc23e('0x165')])||_[_0xc23e('0xa8')](_0x4e6d9a[_0xbae213][_0xc23e('0x165')]['phone'])){_0x70515c[_0xc23e('0xca')](_0xc23e('0x200'),_0x229db0,_0x4e6d9a[_0xbae213]);}else{_0x70515c[_0xc23e('0xb4')](_[_0xc23e('0xcc')](_0x4e6d9a[_0xbae213],[_0xc23e('0xf6'),_0xc23e('0x201')]))[_0xc23e('0x3c')](_0x70515c['checkContactBlack'](_0x229db0,_0x4e6d9a[_0xbae213]))['catch'](_0x70515c[_0xc23e('0xc9')]('[actionOriginate]\x20',_0x229db0));}}}})[_0xc23e('0xac')](loggerGetContactDialer(_0xc23e('0x206'),_0x229db0,_0xf4e3c4));}};Dialer['prototype'][_0xc23e('0x8f')]=function(_0x2a0d43){if(_0x2a0d43[_0xc23e('0x203')]>0x0){var _0x267536=_0x2a0d43[_0xc23e('0x203')]-_0x2a0d43['originated']-_0x2a0d43[_0xc23e('0x57')];if(_0x267536>0x0){this['tryOriginatePredictive'](_0x2a0d43);}else{loggerPredictiveCalls[_0xc23e('0x7a')](_0xc23e('0x207'));}}else{this[_0xc23e('0x208')](_0x2a0d43);}};Dialer[_0xc23e('0x1a')][_0xc23e('0x208')]=function(_0x30c4a3){var _0x277e8c=this;var _0x396fe6=[];_0x30c4a3[_0xc23e('0x71')]+=0x1;for(var _0x3d0977 in this[_0xc23e('0x20')]){if(typeof this['agents'][_0x3d0977]!==_0xc23e('0x97')){if(this[_0xc23e('0x20')][_0x3d0977]['state']===_0xc23e('0x204')&&this[_0xc23e('0x20')][_0x3d0977]['status']===_0xc23e('0xd5')){_0x396fe6['push'](this[_0xc23e('0x20')][_0x3d0977]['id']);}}}this[_0xc23e('0xbe')](_0x30c4a3['id'],_0x396fe6,0x1,_0x30c4a3[_0xc23e('0x1fe')],_0x30c4a3)[_0xc23e('0x3c')](function(_0x47f3b2){if(!checkContactEmpty(_0x47f3b2)){checkContactLowerLimitOriginate(_0x30c4a3,0x1,0x0);_0x277e8c[_0xc23e('0xb2')](_0x30c4a3)[_0xc23e('0x3c')](sendMessageReschedule(_0x30c4a3))[_0xc23e('0xac')](loggerCatch('[countReScheduled]\x20'));}else{_0x30c4a3[_0xc23e('0x3f')]='RUNNING';if(_[_0xc23e('0xa8')](_0x47f3b2[0x0])||_['isNil'](_0x47f3b2[0x0][_0xc23e('0x165')])||_[_0xc23e('0xa8')](_0x47f3b2[0x0][_0xc23e('0x165')][_0xc23e('0x166')])){_0x277e8c[_0xc23e('0xca')](_0xc23e('0x200'),_0x30c4a3,_0x47f3b2[0x0]);}else{_0x277e8c['checkIsBlackList'](_[_0xc23e('0xcc')](_0x47f3b2[0x0],[_0xc23e('0xf6'),_0xc23e('0x201')]))[_0xc23e('0x3c')](_0x277e8c['checkContactBlack'](_0x30c4a3,_0x47f3b2[0x0]))[_0xc23e('0xac')](_0x277e8c[_0xc23e('0xc9')](_0xc23e('0x209'),_0x30c4a3));}}})['catch'](loggerGetContactDialer(_0xc23e('0x20a'),_0x30c4a3,0x1));emitVoiceQueueSummary(_0x30c4a3);};Dialer['prototype'][_0xc23e('0x1db')]=function(_0x8464d3,_0x152034,_0x6f9b89,_0x358f57,_0x114762,_0x47a9fc){loggerPredictive['info']('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0xc23e('0x7a')]('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',_0x8464d3);loggerPredictive['info'](_0xc23e('0x20b'),_0x152034);loggerPredictive['info'](_0xc23e('0x20c'),_0x6f9b89);loggerPredictive[_0xc23e('0x7a')]('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',_0x358f57);loggerPredictive['info'](_0xc23e('0x20d'),_0x114762);loggerPredictive['info'](_0xc23e('0x84'));return new BPromise(function(_0xe32f46,_0x31e4b2){if(_0x8464d3<=0x0||isNaN(_0x8464d3)){return _0x31e4b2(msgResponse(_0xc23e('0x20e'),_0xc23e('0x49'),_0xc23e('0x20f')+_0x8464d3));}if(_0x6f9b89<=0x0||isNaN(_0x6f9b89)){return _0x31e4b2(msgResponse(_0xc23e('0x20e'),'Error',_0xc23e('0x210')+_0x6f9b89));}if(_0x358f57<=0x0||isNaN(_0x358f57)){return _0x31e4b2(msgResponse('[abandonmentRate]','Error',_0xc23e('0x211')+_0x358f57));}if(_0x152034<=0x0||isNaN(_0x152034)){return _0x31e4b2(msgResponse(_0xc23e('0x20e'),_0xc23e('0x49'),'interval\x20=\x20'+_0x152034));}if(_0x114762<=0x0||isNaN(_0x114762)){return _0x31e4b2(msgResponse(_0xc23e('0x20e'),_0xc23e('0x49'),'Amax\x20=\x20'+_0x114762));}_0x47a9fc=_0x47a9fc||0x0;var _0x2d7c0a=0x1/_0x6f9b89;var _0x454003=0x0;var _0x14dbe6=0x0;var _0x17a341=0x0;var _0x55df0e=0x0;for(var _0x1f1db4=0x0;_0x17a341<_0x114762;_0x1f1db4+=0x1){_0x14dbe6=_0x1f1db4/_0x152034;_0x454003=(_0x358f57*_0x14dbe6+_0x47a9fc)/_0x2d7c0a;_0x17a341=erlangb(_0x454003,_0x8464d3);_0x55df0e=_0x454003/_0x8464d3*(0x1-erlangb(_0x454003,_0x8464d3));}return _0xe32f46({'erlangCalls':_0x1f1db4,'erlangCallToSecond':_0x152034/_0x1f1db4,'erlangAbandonmentRate':_0x17a341,'erlangBusyFactor':_0x55df0e});});};Dialer[_0xc23e('0x1a')][_0xc23e('0x1dd')]=function(_0x47ec9a,_0x6b5c5b,_0x41d4d4,_0x5defec,_0x60a6ef,_0x3d22d5){loggerPredictive[_0xc23e('0x7a')](_0xc23e('0x212'));loggerPredictive[_0xc23e('0x7a')]('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',_0x47ec9a);loggerPredictive['info'](_0xc23e('0x20b'),_0x6b5c5b);loggerPredictive[_0xc23e('0x7a')]('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',_0x41d4d4);loggerPredictive['info'](_0xc23e('0x213'),_0x5defec);loggerPredictive[_0xc23e('0x7a')](_0xc23e('0x214'),_0x60a6ef);loggerPredictive['info'](_0xc23e('0x84'));return new BPromise(function(_0x3895a5,_0x27b38f){if(_0x47ec9a<=0x0||isNaN(_0x47ec9a)){return _0x27b38f(msgResponse(_0xc23e('0x215'),'Error',_0xc23e('0x20f')+_0x47ec9a));}if(_0x41d4d4<=0x0||isNaN(_0x41d4d4)){return _0x27b38f(msgResponse(_0xc23e('0x215'),'Error',_0xc23e('0x210')+_0x41d4d4));}if(_0x5defec<=0x0||isNaN(_0x5defec)){return _0x27b38f(msgResponse(_0xc23e('0x215'),'Error',_0xc23e('0x211')+_0x5defec));}if(_0x6b5c5b<=0x0||isNaN(_0x6b5c5b)){return _0x27b38f(msgResponse(_0xc23e('0x215'),'Error',_0xc23e('0x216')+_0x6b5c5b));}if(_0x60a6ef<=0x0||isNaN(_0x60a6ef)){return _0x27b38f(msgResponse(_0xc23e('0x215'),_0xc23e('0x49'),_0xc23e('0x217')+_0x60a6ef));}_0x3d22d5=_0x3d22d5||0x0;var _0x1e7b51=0x1/_0x41d4d4;var _0x27998f=0x0;var _0xbc8350=0x0;var _0x422e52=0x0;var _0x3c47a6=0x0;for(var _0x5ab7f4=0x0;_0x3c47a6<_0x60a6ef;_0x5ab7f4+=0x1){_0xbc8350=_0x5ab7f4/_0x6b5c5b;_0x27998f=(_0x5defec*_0xbc8350+_0x3d22d5)/_0x1e7b51;_0x422e52=erlangb(_0x27998f,_0x47ec9a);_0x3c47a6=_0x27998f/_0x47ec9a*(0x1-erlangb(_0x27998f,_0x47ec9a));}return _0x3895a5({'erlangCalls':_0x5ab7f4,'erlangCallToSecond':_0x6b5c5b/_0x5ab7f4,'erlangAbandonmentRate':_0x422e52,'erlangBusyFactor':_0x3c47a6});});};module['exports']=Dialer; \ No newline at end of file +var _0x3047=['RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','[getContactDialer2][Empty]','sendMessageOneNotActive','talking','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','NOT_ACTIVE','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','endtime','starttime','prototype','clearZombieChannels','[uniqueid]','[actions]','enqueue','isNil','Action','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','[countReScheduled]\x20','resolve','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','loggerHandler','emptyContact','notFound','saveInDb','merge','ContactId','ListId','UserId','CampaignId','[emptyContact][createHistory]','isSuccess','Success','isTrunkReachable','SIP/%s','status','reachable','unmonitored','uniqueid','variable','amdstatus','dialAMDActive','HANGUP','statedesc','HangupInAMD','membername','AMD','emit','buildObj','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','value','MACHINE','Machine','countmachineretry','amd','custom:amd','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','dialMachineMaxRetry','reason\x2019\x20machine....','add','minutes','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countglobal','stateGlobal','createStateFinal','dialMachineRetryFrequency','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AGI','cause-txt','Unknow','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','dropreason','TIMEOUT','dialDropMaxRetry','VoiceQueueId','Drop','calleridname','[syncAgentComplete][createHistory][10]','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','Abandoned','calleridnum','[syncAgentComplete][createHistory][11]','syncNewExten','channel','actionid','locked','paused','stateinterface','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','pick','roundrobin','run','[unlock][syncQueueStatusComplete]','length','_rr','unlockRR','contactAgent-idHopper:\x20','[Catch][Preview][syncQueueStatusComplete]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','resetActiveCalls','checkIsTrunkReachable','TrunkBackup','checkIfTime','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','command','interval','content','indexOf','true','iftime\x20%s,%s','all','some','GLOBAL_INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','Timezone:\x20','checkDialMethod','progressive','power','handlePower','dialPowerLevel','Queue','method\x20not\x20recognized','checkPreviewRecallReminder','handlePreviewRecallNotifications','Agent','user:%s','user:dialPreviewRecallReminder','launchHandleIvr','handleIvr','dialActive','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','[syncQueueSummary]','dialPreviewRecallmeReminder','syncCampaigns','active','[syncCampaigns]','pow','replace','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','Contact','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','dialQueueOptions','getCaller','ACTIVE','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','tags','createdAt','updatedAt','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','originatecalleridname','SIP/%s/%s%s','trim','dialCutDigit','from-sip','[originate][error]','originate\x20action\x20Error','getQueue','response','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','[rescheduleContact][Drop]','[rescheduleContact][Abandoned]','callProgressDetecting','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','reason','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','round','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]','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','started\x20in\x20predictive\x20at','startMethodPredictive','recalculate\x20predictive\x20at','averageHandleTime','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','getDataPredictive','abandonmentRate','agentBusyFactor','busyFactor','Unknown\x20Predictive','[getDataPredictive]','check\x20failure','outboundQueuePauses','[CatchErlangB]','one\x20call\x20every:','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','dialOrderByScheduledAt','AVAILABLE_CONTACTS_FINISHED','[getContactCampaign2][Empty]','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','RUNNING','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[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','Ts\x20=\x20','p\x20=\x20','[abandonmentRate]','interval\x20=\x20','----\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','exports','lodash','bluebird','uuid','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','../ami','defaults','redis','socket.io-emitter','../rpc/cmHopper','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','rrmemory','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','custom:queuesummary','syncQueueSummary','hangup','syncHangup','syncVarSet','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','then','isUndefined','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','message','isEmpty','[ifTime][Action]','Error','stringify','seconds','type','outbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','abandoned','waiting','loggedInDb','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','callerid','md5','format','voice:queue:%s','campaign:ivr:%s','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','milliseconds','clearing\x20variable\x20start\x20progressive','handlePredictive','clearing\x20variable\x20handle\x20predictive','preview','ivr','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled'];(function(_0x31eb10,_0x5ac7a4){var _0x153ba8=function(_0x45f3c5){while(--_0x45f3c5){_0x31eb10['push'](_0x31eb10['shift']());}};_0x153ba8(++_0x5ac7a4);}(_0x3047,0x183));var _0x7304=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3047[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var _=require(_0x7304('0x0'));var BPromise=require(_0x7304('0x1'));var uuid=require(_0x7304('0x2'));var moment=require('moment');var rr=require('rr');var md5=require('md5');var Redis=require(_0x7304('0x3'));var ut=require(_0x7304('0x4'));var config=require(_0x7304('0x5'));var logger=require(_0x7304('0x6'))(_0x7304('0x7'));var loggerBooked=require(_0x7304('0x6'))(_0x7304('0x8'));var loggerPredictive=require(_0x7304('0x6'))(_0x7304('0x9'));var loggerPredictiveCalls=require(_0x7304('0x6'))(_0x7304('0xa'));var loggerSyncQueueSummary=require(_0x7304('0x6'))('syncQueueSummary');var ami=require(_0x7304('0xb'));config['redis']=_[_0x7304('0xc')](config[_0x7304('0xd')],{'host':'localhost','port':0x18eb});var io=require(_0x7304('0xe'))(new Redis(config[_0x7304('0xd')]));var cmHopper=require(_0x7304('0xf'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require('../rpc/setting');var Action=require(_0x7304('0x10'));var History=require(_0x7304('0x11'));var Final=require(_0x7304('0x12'));var AgentComplete=require(_0x7304('0x13'));var QueueCallerAbandon=require(_0x7304('0x14'));var Hangup=require(_0x7304('0x15'));var ipAgi=process[_0x7304('0x16')][_0x7304('0x17')]||'127.0.0.1';var strategy={'rrmemory':_0x7304('0x18'),'roundrobin':'roundrobin'};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x2b64bc){this[_0x7304('0x19')]=this[_0x7304('0x19')]?this[_0x7304('0x19')][_0x7304('0x1a')](_0x2b64bc):_0x2b64bc();};function Dialer(_0x437d30,_0x140415){this[_0x7304('0x1b')]=new Sequence();this['preview']=_0x140415;this[_0x7304('0x1c')]=_0x437d30[_0x7304('0x1c')];this[_0x7304('0x1d')]=_0x437d30['campaigns'];this[_0x7304('0x1e')]=_0x437d30[_0x7304('0x1e')];this[_0x7304('0x1f')]=_0x437d30[_0x7304('0x1f')];this[_0x7304('0x20')]=config[_0x7304('0x20')]||0x2;this[_0x7304('0x21')]={};this[_0x7304('0x22')]={};this[_0x7304('0x23')]={};this[_0x7304('0x24')]={};this[_0x7304('0x25')]={};this[_0x7304('0x26')]={};this[_0x7304('0x27')]={};this[_0x7304('0x28')]={};this[_0x7304('0x29')]={};this[_0x7304('0x2a')]={};ami['on']('agentconnect',this[_0x7304('0x2b')][_0x7304('0x2c')](this));ami['on'](_0x7304('0x2d'),this[_0x7304('0x2e')]['bind'](this));ami['on'](_0x7304('0x2f'),this[_0x7304('0x30')]['bind'](this));ami['on'](_0x7304('0x31'),this['syncAgentComplete'][_0x7304('0x2c')](this));ami['on'](_0x7304('0x32'),this[_0x7304('0x33')][_0x7304('0x2c')](this));ami['on'](_0x7304('0x34'),this[_0x7304('0x35')][_0x7304('0x2c')](this));ami['on']('newexten',this['syncNewExten'][_0x7304('0x2c')](this));ami['on']('varset',this[_0x7304('0x36')][_0x7304('0x2c')](this));ami['on']('queuemember',this[_0x7304('0x37')]['bind'](this));ami['on'](_0x7304('0x38'),this[_0x7304('0x39')][_0x7304('0x2c')](this));this[_0x7304('0x3a')]();this[_0x7304('0x3b')]();RpcSetting['getSettings']()[_0x7304('0x3c')](function(_0x5f46fa){previewRecallmeReminderInterval=_0x5f46fa['previewRecallmeReminderInterval'];});}function isNotNull(_0x3d705b){return _0x3d705b!==null&&!_[_0x7304('0x3d')](_0x3d705b);}function checkIsLoggedIn(_0x56ca3d,_0x4346b){return function(){if(_0x4346b<=0x0){_0x56ca3d['message']=_0x7304('0x3e');throw _0x56ca3d[_0x7304('0x3f')]+_0x7304('0x40');}};}function isActive(_0x383c7a){return _0x383c7a;}function checkIsActive(_0x5d60d4,_0x4e776a){return function(){if(!isActive(_0x4e776a)){_0x5d60d4['message']='NOT_ACTIVE';throw _0x5d60d4[_0x7304('0x3f')]+'\x20NOT\x20Active';}};}function checkInterval(_0x2d244f){return function(){if(!isNotNull(_0x2d244f[_0x7304('0x41')])){_0x2d244f['message']=_0x7304('0x42');throw _0x2d244f['name']+_0x7304('0x43');}if(!isNotNull(_0x2d244f[_0x7304('0x41')][_0x7304('0x44')])){_0x2d244f[_0x7304('0x45')]=_0x7304('0x42');throw _0x2d244f[_0x7304('0x3f')]+_0x7304('0x43');}if(!isNotNull(_[_0x7304('0x46')](_0x2d244f['Interval']['Intervals']))){_0x2d244f[_0x7304('0x45')]=_0x7304('0x42');throw _0x2d244f[_0x7304('0x3f')]+_0x7304('0x43');}};}function msgResponse(_0x15091a,_0xd82123,_0xcb14af){return{'action':_0x15091a,'response':_0xd82123,'message':_0xcb14af,'stack':_0xcb14af};}function myreject(_0x2e92ec){return function(_0x501791){return _0x2e92ec(msgResponse(_0x7304('0x47'),_0x7304('0x48'),JSON[_0x7304('0x49')](_0x501791)));};}function getSeconds(_0xd4b404,_0x241853){var _0x329ae2=moment(_0xd4b404)['milliseconds'](0x0);var _0x14a375=moment(_0x241853)['milliseconds'](0x0);return _0x329ae2['diff'](_0x14a375,_0x7304('0x4a'));}function emit(_0x271555,_0xd9c379,_0x122ea5){io['to'](_0x271555)['emit'](_0xd9c379,_0x122ea5);}function emitVoiceQueueSummary(_0x5df9c4){if(_0x5df9c4[_0x7304('0x4b')]===_0x7304('0x4c')){var _0x520768={'id':_0x5df9c4['id'],'name':_0x5df9c4[_0x7304('0x3f')],'strategy':_0x5df9c4[_0x7304('0x4d')],'answered':_0x5df9c4[_0x7304('0x4e')],'available':_0x5df9c4[_0x7304('0x4f')],'loggedIn':_0x5df9c4[_0x7304('0x50')],'pTalking':_0x5df9c4[_0x7304('0x51')],'sumBillable':_0x5df9c4[_0x7304('0x52')],'sumDuration':_0x5df9c4[_0x7304('0x53')],'sumHoldTime':_0x5df9c4[_0x7304('0x54')]||0x0,'talking':_0x5df9c4['talking'],'total':_0x5df9c4['total'],'type':_0x5df9c4[_0x7304('0x4b')],'unmanaged':_0x5df9c4['unmanaged'],'abandoned':_0x5df9c4[_0x7304('0x55')],'waiting':_0x5df9c4[_0x7304('0x56')],'loggedInDb':_0x5df9c4[_0x7304('0x57')],'dialActive':_0x5df9c4['dialActive'],'dialMethod':_0x5df9c4[_0x7304('0x58')],'dialOriginateCallerIdName':_0x5df9c4[_0x7304('0x59')],'dialOriginateCallerIdNumber':_0x5df9c4['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x5df9c4[_0x7304('0x5a')],'dialPrefix':_0x5df9c4[_0x7304('0x5b')],'outboundAnswerAgiCallsDay':_0x5df9c4[_0x7304('0x5c')],'outboundAnswerCallsDay':_0x5df9c4[_0x7304('0x5d')],'outboundBlacklistCallsDay':_0x5df9c4['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x5df9c4[_0x7304('0x5e')],'outboundCongestionCallsDay':_0x5df9c4[_0x7304('0x5f')],'outboundDropCallsDayACS':_0x5df9c4['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x5df9c4[_0x7304('0x60')],'outboundDropCallsDayTimeout':_0x5df9c4[_0x7304('0x61')],'outboundNoAnswerCallsDay':_0x5df9c4[_0x7304('0x62')],'outboundNoSuchCallsDay':_0x5df9c4[_0x7304('0x63')],'outboundOriginateFailureCallsDay':_0x5df9c4[_0x7304('0x64')],'outboundReCallsDay':_0x5df9c4[_0x7304('0x65')],'outboundRejectCallsDay':_0x5df9c4[_0x7304('0x66')],'outboundUnknownCallsDay':_0x5df9c4[_0x7304('0x67')],'predictiveIntervalAnsweredCalls':_0x5df9c4[_0x7304('0x68')],'predictiveIntervalAvgHoldtime':_0x5df9c4[_0x7304('0x69')],'predictiveIntervalAvgTalktime':_0x5df9c4[_0x7304('0x6a')],'predictiveIntervalDroppedCallsCallersExit':_0x5df9c4[_0x7304('0x6b')],'predictiveIntervalDroppedCallsTimeout':_0x5df9c4[_0x7304('0x6c')],'predictiveIntervalErlangCalls':_0x5df9c4['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x5df9c4[_0x7304('0x6d')],'predictiveIntervalHitRate':_0x5df9c4['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x5df9c4['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x5df9c4[_0x7304('0x6e')],'predictiveIntervalAvailable':_0x5df9c4[_0x7304('0x6f')],'predictiveIntervalTotalCalls':_0x5df9c4[_0x7304('0x70')],'message':_0x5df9c4['message'],'originated':_0x5df9c4[_0x7304('0x71')],'erlangCalls':_0x5df9c4[_0x7304('0x72')],'erlangCallToSecond':_0x5df9c4[_0x7304('0x73')],'erlangAbandonmentRate':_0x5df9c4[_0x7304('0x74')],'erlangBusyFactor':_0x5df9c4[_0x7304('0x75')],'startPredictive':_0x5df9c4['startPredictive'],'startProgressive':_0x5df9c4[_0x7304('0x27')]};if(_0x5df9c4[_0x7304('0x76')]){_0x520768['Trunk']={'id':_0x5df9c4[_0x7304('0x76')]['id'],'name':_0x5df9c4[_0x7304('0x76')][_0x7304('0x3f')],'active':_0x5df9c4[_0x7304('0x76')]['active'],'callerid':_0x5df9c4['Trunk'][_0x7304('0x77')]};}if(_0x5df9c4[_0x7304('0x41')]){_0x520768['Interval']={'id':_0x5df9c4[_0x7304('0x41')]['id'],'name':_0x5df9c4['Interval'][_0x7304('0x3f')]};}var _0x11656c=md5(JSON[_0x7304('0x49')](_0x520768));if(_0x5df9c4[_0x7304('0x78')]!==_0x11656c){_0x5df9c4['md5']=_0x11656c;emit(util[_0x7304('0x79')](_0x7304('0x7a'),_0x520768[_0x7304('0x3f')]),'voice_queue:save',_0x520768);}}}function emitCampaignSummary(_0x4424e1){if(_0x4424e1[_0x7304('0x4b')]==='ivr'){emit(util[_0x7304('0x79')](_0x7304('0x7b'),_0x4424e1['name']),'campaign:save',_0x4424e1);}}function checkGetDataPredictive(_0x31fa81){if(isNotNull(_0x31fa81)&&!_[_0x7304('0x46')](_0x31fa81)){loggerPredictive[_0x7304('0x7c')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0x7304('0x7c')](_0x7304('0x7d'),_0x31fa81[_0x7304('0x70')]);loggerPredictive[_0x7304('0x7c')](_0x7304('0x7e'),_0x31fa81['predictiveIntervalAnsweredCalls']);loggerPredictive[_0x7304('0x7c')](_0x7304('0x7f'),_0x31fa81[_0x7304('0x6c')]);loggerPredictive[_0x7304('0x7c')](_0x7304('0x80'),_0x31fa81['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive['info'](_0x7304('0x81'),_0x31fa81[_0x7304('0x69')]);loggerPredictive[_0x7304('0x7c')](_0x7304('0x82'),_0x31fa81[_0x7304('0x6a')]);loggerPredictive[_0x7304('0x7c')](_0x7304('0x83'));if(_0x31fa81['predictiveIntervalTotalCalls']>0x0){if(!_[_0x7304('0x3d')](_0x31fa81['predictiveIntervalAvgTalktime'])&&_0x31fa81['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive['info'](_0x7304('0x84'));if(!_['isUndefined'](_0x31fa81[_0x7304('0x69')])&&_0x31fa81['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0x7304('0x7c')](_0x7304('0x85'));}else{loggerPredictive[_0x7304('0x7c')](_0x7304('0x86'));}}else{loggerPredictive['info'](_0x7304('0x87'));}return![];}function mergeDataErlangB(_0xdabc95){return function(_0x2abcc1){loggerPredictive[_0x7304('0x7c')](_0x7304('0x88'));loggerPredictive[_0x7304('0x7c')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2abcc1[_0x7304('0x72')]);loggerPredictive[_0x7304('0x7c')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2abcc1[_0x7304('0x73')]);loggerPredictive[_0x7304('0x7c')](_0x7304('0x89'),_0x2abcc1[_0x7304('0x74')]);loggerPredictive[_0x7304('0x7c')](_0x7304('0x8a'),_0x2abcc1['erlangBusyFactor']);loggerPredictive['info'](_0x7304('0x89'),_0x2abcc1[_0x7304('0x74')]);loggerPredictive[_0x7304('0x7c')]('---------------------------');_['merge'](_0xdabc95,_0x2abcc1);};}function getDiff(_0x504e64){var _0x256373=moment()[_0x7304('0x8b')](0x0);var _0x41a271=moment(_0x504e64)[_0x7304('0x8b')](0x0);return _0x256373['diff'](_0x41a271,_0x7304('0x4a'));}function ifInterval(_0x536f88,_0x1ade2f){if(_[_0x7304('0x3d')](_0x1ade2f)){return![];}return getDiff(_0x1ade2f)<_0x536f88*0x3c;}function freeVariablesPredictive(_0x4c2c35){if(isNotNull(_0x4c2c35)){if(!_[_0x7304('0x3d')](_0x4c2c35[_0x7304('0x27')])){_0x4c2c35[_0x7304('0x27')]=undefined;loggerPredictive['info'](_0x4c2c35[_0x7304('0x3f')],_0x7304('0x8c'));}if(!_[_0x7304('0x3d')](_0x4c2c35[_0x7304('0x26')])){_0x4c2c35[_0x7304('0x26')]=undefined;loggerPredictive[_0x7304('0x7c')](_0x4c2c35[_0x7304('0x3f')],'clearing\x20variable\x20start\x20predictive');}if(!_['isUndefined'](_0x4c2c35['handlePredictive'])){clearInterval(_0x4c2c35[_0x7304('0x8d')]);_0x4c2c35[_0x7304('0x8d')]=undefined;loggerPredictive[_0x7304('0x7c')](_0x4c2c35['name'],_0x7304('0x8e'));}}}function erlangb(_0x26a927,_0x2c3e22){if(_0x2c3e22===0x0){return 0x0;}var _0x167da9=0x1;for(var _0x462623=0x1;_0x462623<=_0x2c3e22;_0x462623+=0x1){_0x167da9=0x1+_0x167da9*_0x462623/_0x26a927;}return 0x1/_0x167da9;}function isVoiceQueueOutbound(_0x3f2757){return _0x3f2757==='outbound';}function isNotPreview(_0x561116){return _0x561116!==_0x7304('0x8f');}function isCampaignIvr(_0x301f3a){return _0x301f3a===_0x7304('0x90');}function getCallerId(_0x523853,_0x59ab59,_0x165647){if(!_['isUndefined'](_0x165647)&&typeof _0x165647===_0x7304('0x91')&&!_[_0x7304('0x46')](_0x165647)){if(!_['isUndefined'](_0x59ab59)&&typeof _0x59ab59===_0x7304('0x91')&&!_[_0x7304('0x46')](_0x59ab59)){return util['format'](_0x7304('0x92'),_0x59ab59,_0x165647);}return util['format'](_0x7304('0x92'),_0x165647,_0x165647);}if(!_[_0x7304('0x3d')](_0x523853)&&typeof _0x523853===_0x7304('0x91')&&!_[_0x7304('0x46')](_0x523853)){return _0x523853;}return _0x7304('0x93');}function loggerCatchQueueSummary(_0x12bac3,_0x3e4912){return function(_0x4f2f67){freeVariablesPredictive(_0x3e4912);emitVoiceQueueSummary(_0x3e4912);emitCampaignSummary(_0x3e4912);loggerSyncQueueSummary['error'](_0x12bac3,util['inspect'](_0x4f2f67,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x3a8836,_0x2ae108){return function(_0xc6cfe2){loggerPredictive['error'](_0x2ae108['name'],_0x3a8836);loggerPredictive['error'](_0xc6cfe2['stack']);freeVariablesPredictive(_0x2ae108);};}function loggerCatch(_0x1bdebd){return function(_0x2e5a7f){logger[_0x7304('0x94')](_0x1bdebd,util[_0x7304('0x95')](_0x2e5a7f,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x7ecb1a){return _0x7ecb1a&&!_[_0x7304('0x3d')](_0x7ecb1a)&&_0x7ecb1a['length']>0x0;}function decremetOriginate(_0x54a21d){if(!_['isUndefined'](_0x54a21d)&&_0x54a21d!==null){if(typeof _0x54a21d['originated']!==_0x7304('0x96')){if(_0x54a21d['originated']>0x0){_0x54a21d[_0x7304('0x71')]-=0x1;}else{logger['error'](_0x7304('0x97'));}}}else{logger['error'](_0x7304('0x98'));}}function checkContactLowerLimitOriginate(_0x568337,_0x28af84,_0x237c2f){if(_0x28af84>_0x237c2f){for(var _0xcf0be3=0x0;_0xcf0be3<_0x28af84-_0x237c2f;_0xcf0be3+=0x1){decremetOriginate(_0x568337);}}}function loggerGetContactDialer(_0x590bcc,_0x532cd5,_0xc51078){return function(_0xdeb1e9){checkContactLowerLimitOriginate(_0x532cd5,_0xc51078,0x0);logger['error'](_0x590bcc,util[_0x7304('0x95')](_0xdeb1e9,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x1f3c4d){return function(_0x4ac07f){if(isNotNull(_0x4ac07f)&&isNotNull(_0x4ac07f[0x0])){if(_0x4ac07f[0x0][_0x7304('0x99')]>0x0){_0x1f3c4d[_0x7304('0x45')]=_0x7304('0x9a');logger[_0x7304('0x7c')](_0x7304('0x9b')+_0x1f3c4d['name'],_0x4ac07f[0x0][_0x7304('0x99')],_0x7304('0x9c'));}else{_0x1f3c4d[_0x7304('0x45')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x7304('0x7c')](_0x7304('0x9d')+_0x1f3c4d[_0x7304('0x3f')]);}}};}function notSendMessagesQueue(_0x3e5c7d){if(_0x3e5c7d[_0x7304('0x9e')]){freeVariablesPredictive(_0x3e5c7d);if(_0x3e5c7d[_0x7304('0x71')]===0x0&&_0x3e5c7d[_0x7304('0x9f')]===0x0&&_0x3e5c7d[_0x7304('0x56')]===0x0&&(_0x3e5c7d['pTalking']||0x0)===0x0){_0x3e5c7d[_0x7304('0x9e')]=![];_0x3e5c7d[_0x7304('0x4f')]=0x0;_0x3e5c7d['message']='NOT_ACTIVE';loggerSyncQueueSummary[_0x7304('0x94')](_0x7304('0xa0'),_0x3e5c7d[_0x7304('0x3f')],_0x7304('0xa1'));}else{_0x3e5c7d[_0x7304('0x45')]=_0x7304('0xa2');loggerSyncQueueSummary[_0x7304('0x94')](_0x7304('0xa0'),_0x3e5c7d[_0x7304('0x3f')],_0x7304('0xa3'));}emitVoiceQueueSummary(_0x3e5c7d);}}function notSendMessagesCampaign(_0x7b0670){if(_0x7b0670[_0x7304('0x9e')]){if(_0x7b0670[_0x7304('0x71')]===0x0){_0x7b0670[_0x7304('0x9e')]=![];_0x7b0670[_0x7304('0x45')]=_0x7304('0xa4');loggerSyncQueueSummary[_0x7304('0x94')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x7b0670[_0x7304('0x3f')],'is\x20not\x20active');}else{_0x7b0670[_0x7304('0x45')]=_0x7304('0xa2');loggerSyncQueueSummary[_0x7304('0x94')](_0x7304('0xa5'),_0x7b0670[_0x7304('0x3f')],'is\x20disactive');}emitCampaignSummary(_0x7b0670);}}function createObjHistory(_0xcff51a,_0x430618,_0x1708d8,_0x1fe5e1,_0x26d9d7){_0xcff51a[_0x7304('0x45')]=_0x1708d8;var _0x29b14c=new Action(_0xcff51a,_0x430618);var _0x5ee5c2=new History(_0x29b14c);_0x5ee5c2[_0x7304('0xa6')]=_0x1fe5e1;_0x5ee5c2['statedesc']=_0x26d9d7;_0x5ee5c2[_0x7304('0xa7')]=_0x29b14c[_0x7304('0xa8')];return _0x5ee5c2;}Dialer[_0x7304('0xa9')]['loopClearZombieChannels']=function(){var _0x2cc86c=this;setInterval(function(){_0x2cc86c[_0x7304('0xaa')](_0x2cc86c[_0x7304('0x24')],_0x7304('0xab'));_0x2cc86c[_0x7304('0xaa')](_0x2cc86c['actions'],_0x7304('0xac'));},0x32c8);};Dialer[_0x7304('0xa9')][_0x7304('0xaa')]=function(_0x160138,_0x495ccd){var _0xe59b3=this;for(var _0x41253e in _0x160138){if(typeof _0x160138[_0x41253e]!==_0x7304('0x96')){this['sequence'][_0x7304('0xad')](function(){if(!_[_0x7304('0xae')](_0x160138[_0x41253e])){return ami[_0x7304('0xaf')]({'action':'status','channel':_0x160138[_0x41253e]['channel']})[_0x7304('0xb0')](function(_0x4fb915){if(_0x4fb915[_0x7304('0x45')]===_0x7304('0xb1')){setTimeout(function(){if(_0x160138[_0x41253e]&&_0x160138[_0x41253e][_0x7304('0x4b')]!==_0x7304('0x90')){_0xe59b3[_0x7304('0xb2')](_0xe59b3[_0x7304('0x1c')][_0x160138[_0x41253e][_0x7304('0xb3')]]);logger[_0x7304('0x94')](_0x7304('0xb4'),_0x495ccd,_0x41253e,_0x160138[_0x41253e][_0x7304('0xb3')]);delete _0x160138[_0x41253e];}if(_0x160138[_0x41253e]&&_0x160138[_0x41253e]['type']==='ivr'){_0xe59b3[_0x7304('0xb2')](_0xe59b3[_0x7304('0x1d')][_0x160138[_0x41253e]['queue']]);logger['error'](_0x7304('0xb5'),_0x495ccd,_0x41253e,_0x160138[_0x41253e][_0x7304('0xb3')]);delete _0x160138[_0x41253e];}},0x2328);}});}});}}};Dialer[_0x7304('0xa9')][_0x7304('0xb6')]=function(_0x2ef3c2){return BPromise['resolve']()[_0x7304('0x3c')](cmHopper[_0x7304('0xb6')](_0x2ef3c2))[_0x7304('0xb0')](loggerCatch(_0x7304('0xb7')));};Dialer[_0x7304('0xa9')]['checkIsBlackList']=function(_0x5ae24b){return BPromise[_0x7304('0xb8')]()[_0x7304('0x3c')](cmHopperBlack[_0x7304('0xb9')](_0x5ae24b))[_0x7304('0xb0')](loggerCatch(_0x7304('0xba')));};Dialer['prototype']['checkIsBlackListIvr']=function(_0x436031){return BPromise['resolve']()[_0x7304('0x3c')](cmHopperBlack[_0x7304('0xbb')](_0x436031))[_0x7304('0xb0')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer[_0x7304('0xa9')]['averageHandleTime']=function(_0x4e5d64){return BPromise['resolve']()['then'](cmHopperHistory[_0x7304('0xbc')](_0x4e5d64))['catch'](loggerCatch(_0x7304('0xbd')));};Dialer[_0x7304('0xa9')][_0x7304('0xbe')]=function(_0x30aa81){return BPromise[_0x7304('0xb8')]()['then'](cmHopper['rescheduleContact'](_0x30aa81))[_0x7304('0xb0')](loggerCatch(_0x7304('0xbf')));};Dialer[_0x7304('0xa9')]['unlockContact']=function(_0x557008,_0x4eb465,_0x602701){return BPromise[_0x7304('0xb8')]()[_0x7304('0x3c')](cmHopper[_0x7304('0xc0')](_0x557008,_0x4eb465,_0x602701))[_0x7304('0xb0')](loggerCatch(_0x7304('0xc1')));};Dialer['prototype'][_0x7304('0xc2')]=function(_0x14e58b,_0x296a69,_0x41955a,_0x521f61,_0x28984d){return BPromise['resolve']()['then'](cmHopper['getContactDialer'](_0x14e58b,_0x296a69,_0x41955a,_0x521f61))[_0x7304('0xb0')](function(_0x3657bb){_0x28984d[_0x7304('0xc3')]-=_0x41955a;_0x28984d['temp']=_0x28984d[_0x7304('0xc3')]>0x0?_0x28984d['temp']:0x0;loggerCatch(_0x7304('0xc4'))(_0x3657bb);});};Dialer['prototype'][_0x7304('0xc5')]=function(_0xffa164,_0xd92c51,_0x373d23,_0x57525c){return BPromise[_0x7304('0xb8')]()['then'](cmHopper[_0x7304('0xc5')](_0xffa164,_0xd92c51,_0x373d23))[_0x7304('0xb0')](function(_0x29394c){_0x57525c['temp']-=_0xd92c51;_0x57525c[_0x7304('0xc3')]=_0x57525c[_0x7304('0xc3')]>0x0?_0x57525c['temp']:0x0;loggerCatch('[getContactDialerIvr]\x20')(_0x29394c);});};Dialer[_0x7304('0xa9')][_0x7304('0xc6')]=function(_0x4da165){return BPromise[_0x7304('0xb8')]()[_0x7304('0x3c')](voiceQueueRt[_0x7304('0xc6')](_0x4da165))[_0x7304('0xb0')](loggerCatch(_0x7304('0xc7')));};Dialer['prototype'][_0x7304('0xc8')]=function(_0x3380f6){return BPromise['resolve']()[_0x7304('0x3c')](cmHopper[_0x7304('0xc8')](_0x3380f6))[_0x7304('0xb0')](loggerCatch(_0x7304('0xc9')));};Dialer['prototype'][_0x7304('0xca')]=function(_0x2b10b4){return BPromise['resolve']()[_0x7304('0x3c')](cmHopperHistory[_0x7304('0xca')](_0x2b10b4))['catch'](loggerCatch(_0x7304('0xcb')));};Dialer[_0x7304('0xa9')][_0x7304('0xb2')]=function(_0x29032d){if(!_[_0x7304('0x3d')](_0x29032d)&&_0x29032d!==null){if(typeof _0x29032d[_0x7304('0x71')]!==_0x7304('0x96')){if(_0x29032d['originated']>0x0){_0x29032d[_0x7304('0x71')]-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x7304('0x94')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer['prototype'][_0x7304('0xcc')]=function(_0x40f5c6,_0xcae4bc){var _0x471fee=this;return function(_0x4fac77){_0x471fee[_0x7304('0xb2')](_0xcae4bc);logger[_0x7304('0x94')](_0x40f5c6,util[_0x7304('0x95')](_0x4fac77,{'showHidden':![],'depth':null}));};};Dialer[_0x7304('0xa9')][_0x7304('0xcd')]=function(_0x2b40ce,_0xf19717,_0x58469e){var _0x4b0e1b={'state':0x19,'statedesc':_0x7304('0xce')};this['updateOriginated'](_0xf19717);this[_0x7304('0xcf')](_[_0x7304('0xd0')](_0x4b0e1b,_['pick'](_0x58469e,[_0x7304('0xd1'),_0x7304('0xd2'),_0x7304('0xd3'),'VoiceQueueId',_0x7304('0xd4')])),_0x7304('0xd5'),'[emptyContact]');logger[_0x7304('0x94')](_0x2b40ce);};Dialer[_0x7304('0xa9')][_0x7304('0xd6')]=function(_0xb24761){return _0xb24761===_0x7304('0xd7');};Dialer[_0x7304('0xa9')][_0x7304('0xd8')]=function(_0x3d34e5){return!_[_0x7304('0x3d')](_0x3d34e5)&&_0x3d34e5&&!_['isUndefined'](_0x3d34e5[_0x7304('0x3f')])&&!_['isUndefined'](_0x3d34e5['active'])&&_0x3d34e5['active']&&(this[_0x7304('0x1f')][util[_0x7304('0x79')](_0x7304('0xd9'),_0x3d34e5[_0x7304('0x3f')])][_0x7304('0xda')]===_0x7304('0xdb')||this[_0x7304('0x1f')][util['format'](_0x7304('0xd9'),_0x3d34e5[_0x7304('0x3f')])][_0x7304('0xda')]===_0x7304('0xdc'));};Dialer[_0x7304('0xa9')][_0x7304('0xcf')]=function(_0x48ab3a,_0x128435,_0x15a3fa){this[_0x7304('0xca')](_0x48ab3a)[_0x7304('0xb0')](loggerCatch(_0x128435));this[_0x7304('0xc8')](_0x48ab3a)['catch'](loggerCatch(_0x15a3fa));};Dialer['prototype'][_0x7304('0x36')]=function(_0x382bcf){var _0x6cfab1=this[_0x7304('0x24')][_0x382bcf[_0x7304('0xdd')]];var _0x2c06d3;if(!_['isNil'](_0x382bcf)&&!_[_0x7304('0xae')](_0x382bcf[_0x7304('0xde')])&&!_[_0x7304('0xae')](_0x382bcf['variable'][_0x7304('0xdf')])&&_0x382bcf['exten']==='xcally-motion-dialer'&&_0x6cfab1){if(_0x6cfab1[_0x7304('0x4b')]!==_0x7304('0x90')&&this['voiceQueues'][_0x6cfab1[_0x7304('0xb3')]][_0x7304('0xe0')]&&_0x382bcf['value']===_0x7304('0xe1')){delete this[_0x7304('0x24')][_0x382bcf[_0x7304('0xdd')]];this[_0x7304('0xb2')](this[_0x7304('0x1c')][_0x6cfab1[_0x7304('0xb3')]]);this[_0x7304('0x1c')][_0x6cfab1['queue']][_0x7304('0x5d')]+=0x1;this[_0x7304('0x1c')][_0x6cfab1['queue']][_0x7304('0x5c')]+=0x1;_0x2c06d3=new Hangup(_0x6cfab1,_0x382bcf);_0x2c06d3['state']=0x12;_0x2c06d3[_0x7304('0xe2')]=_0x7304('0xe3');_0x2c06d3[_0x7304('0xe4')]=_0x7304('0xe5');ami[_0x7304('0xe6')]('custom:amd',ut[_0x7304('0xe7')](_0x2c06d3,'amd'));this[_0x7304('0xcf')](_0x2c06d3,_0x7304('0xe8'),_0x7304('0xe9'));}if(_0x6cfab1[_0x7304('0x4b')]!==_0x7304('0x90')&&this[_0x7304('0x1c')][_0x6cfab1[_0x7304('0xb3')]][_0x7304('0xe0')]&&_0x382bcf[_0x7304('0xea')]===_0x7304('0xeb')){var _0x935250=this;return new BPromise(function(_0x408e82,_0x47a685){delete _0x935250['uniqueId'][_0x382bcf[_0x7304('0xdd')]];_0x935250[_0x7304('0xb2')](_0x935250[_0x7304('0x1c')][_0x6cfab1[_0x7304('0xb3')]]);_0x935250[_0x7304('0x1c')][_0x6cfab1['queue']]['outboundAnswerCallsDay']+=0x1;_0x935250[_0x7304('0x1c')][_0x6cfab1[_0x7304('0xb3')]][_0x7304('0x5c')]+=0x1;var _0x2d9dae=_0x935250[_0x7304('0x1c')][_0x6cfab1[_0x7304('0xb3')]];var _0x4dde87=new Hangup(_0x6cfab1,_0x382bcf);_0x4dde87[_0x7304('0xa6')]=0x13;_0x4dde87[_0x7304('0xe2')]=_0x7304('0xec');_0x4dde87[_0x7304('0xe4')]=_0x7304('0xe5');_0x4dde87[_0x7304('0xed')]+=0x1;_0x4dde87['countglobal']+=0x1;_0x4dde87[_0x7304('0xee')]=!![];ami['emit'](_0x7304('0xef'),ut[_0x7304('0xe7')](_0x4dde87,_0x7304('0xee')));_0x935250[_0x7304('0xca')](_0x4dde87)[_0x7304('0xb0')](loggerCatch(_0x7304('0xf0')));if(_0x4dde87[_0x7304('0xf1')]+_0x4dde87[_0x7304('0xf2')]+_0x4dde87[_0x7304('0xf3')]+_0x4dde87[_0x7304('0xf4')]+_0x4dde87[_0x7304('0xf5')]+_0x4dde87[_0x7304('0xf6')]+_0x4dde87[_0x7304('0xed')]+_0x4dde87[_0x7304('0xf7')]>=_0x2d9dae[_0x7304('0xf8')]){_0x935250['stateGlobal'](_0x4dde87,_0x408e82,_0x47a685,'reason19\x20machine....');}else{if(_0x4dde87[_0x7304('0xed')]>=_0x2d9dae[_0x7304('0xf9')]){_0x935250['createStateFinal'](_0x4dde87,_0x408e82,_0x47a685,_0x7304('0xfa'));}else{_0x935250[_0x7304('0xbe')]({'active':![],'countmachineretry':_0x4dde87[_0x7304('0xed')],'scheduledat':moment()[_0x7304('0xfb')](_0x2d9dae['dialMachineRetryFrequency'],_0x7304('0xfc'))[_0x7304('0x79')](_0x7304('0xfd')),'ContactId':_0x4dde87[_0x7304('0xd1')],'ListId':_0x4dde87[_0x7304('0xd2')],'VoiceQueueId':_0x4dde87['VoiceQueueId']||undefined,'CampaignId':_0x4dde87[_0x7304('0xd4')]||undefined})['catch'](loggerCatch(_0x7304('0xfe')));_0x408e82({'reschedule':0x1});}}});}if(_0x6cfab1['type']===_0x7304('0x90')&&this[_0x7304('0x1d')][_0x6cfab1[_0x7304('0xb3')]][_0x7304('0xe0')]&&_0x382bcf['value']===_0x7304('0xe1')){delete this[_0x7304('0x24')][_0x382bcf[_0x7304('0xdd')]];this[_0x7304('0xb2')](this['campaigns'][_0x6cfab1[_0x7304('0xb3')]]);_0x2c06d3=new Hangup(_0x6cfab1,_0x382bcf);_0x2c06d3['state']=0x12;_0x2c06d3[_0x7304('0xe2')]=_0x7304('0xe3');_0x2c06d3[_0x7304('0xe4')]='AMD';ami[_0x7304('0xe6')]('custom:amd',ut['buildObj'](_0x2c06d3,_0x7304('0xee')));this['saveInDb'](_0x2c06d3,_0x7304('0xff'),_0x7304('0x100'));}if(_0x6cfab1[_0x7304('0x4b')]===_0x7304('0x90')&&this[_0x7304('0x1d')][_0x6cfab1['queue']][_0x7304('0xe0')]&&_0x382bcf[_0x7304('0xea')]==='MACHINE'){var _0x935250=this;return new BPromise(function(_0x437949,_0x2ac836){delete _0x935250[_0x7304('0x24')][_0x382bcf[_0x7304('0xdd')]];_0x935250['updateOriginated'](_0x935250[_0x7304('0x1d')][_0x6cfab1[_0x7304('0xb3')]]);_0x935250[_0x7304('0x1d')][_0x6cfab1['queue']]['outboundAnswerCallsDay']+=0x1;_0x935250[_0x7304('0x1d')][_0x6cfab1[_0x7304('0xb3')]][_0x7304('0x5c')]+=0x1;var _0x3039b7=_0x935250[_0x7304('0x1d')][_0x6cfab1[_0x7304('0xb3')]];var _0x580759=new Hangup(_0x6cfab1,_0x382bcf);_0x580759[_0x7304('0xa6')]=0x13;_0x580759[_0x7304('0xe2')]=_0x7304('0xec');_0x580759[_0x7304('0xe4')]=_0x7304('0xe5');_0x580759['countmachineretry']+=0x1;_0x580759[_0x7304('0x101')]+=0x1;_0x580759[_0x7304('0xee')]=!![];ami['emit'](_0x7304('0xef'),ut['buildObj'](_0x580759,'amd'));_0x935250[_0x7304('0xca')](_0x580759)[_0x7304('0xb0')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x580759[_0x7304('0xf1')]+_0x580759[_0x7304('0xf2')]+_0x580759['countnoanswerretry']+_0x580759['countnosuchnumberretry']+_0x580759['countdropretry']+_0x580759[_0x7304('0xf6')]+_0x580759[_0x7304('0xed')]+_0x580759[_0x7304('0xf7')]>=_0x3039b7['dialGlobalMaxRetry']){_0x935250[_0x7304('0x102')](_0x580759,_0x437949,_0x2ac836,'reason19\x20machine....');}else{if(_0x580759['countmachineretry']>=_0x3039b7['dialMachineMaxRetry']){_0x935250[_0x7304('0x103')](_0x580759,_0x437949,_0x2ac836,_0x7304('0xfa'));}else{_0x935250['rescheduleContact']({'active':![],'countmachineretry':_0x580759['countmachineretry'],'scheduledat':moment()[_0x7304('0xfb')](_0x3039b7[_0x7304('0x104')],_0x7304('0xfc'))[_0x7304('0x79')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x580759[_0x7304('0xd1')],'ListId':_0x580759[_0x7304('0xd2')],'VoiceQueueId':_0x580759['VoiceQueueId']||undefined,'CampaignId':_0x580759[_0x7304('0xd4')]||undefined})[_0x7304('0xb0')](loggerCatch(_0x7304('0xfe')));_0x437949({'reschedule':0x1});}}});}}};Dialer[_0x7304('0xa9')][_0x7304('0x35')]=function(_0x55f328){var _0x5d8bf5=this[_0x7304('0x24')][_0x55f328[_0x7304('0xdd')]];var _0x221a13=this;var _0x543c0b;if(_0x5d8bf5&&_0x5d8bf5[_0x7304('0x4b')]===_0x7304('0x90')){delete this[_0x7304('0x24')][_0x55f328[_0x7304('0xdd')]];this['updateOriginated'](this[_0x7304('0x1d')][_0x5d8bf5[_0x7304('0xb3')]]);this['campaigns'][_0x5d8bf5[_0x7304('0xb3')]][_0x7304('0x105')]+=0x1;_0x543c0b=new Hangup(_0x5d8bf5,_0x55f328);this[_0x7304('0xca')](_0x543c0b)[_0x7304('0xb0')](loggerCatch(_0x7304('0x106')));this[_0x7304('0xc8')](_0x543c0b)[_0x7304('0xb0')](loggerCatch(_0x7304('0x107')));}if(_0x5d8bf5&&_0x5d8bf5['type']!==_0x7304('0x90')&&isNotNull(this[_0x7304('0x1c')][_0x5d8bf5[_0x7304('0xb3')]][_0x7304('0x108')])){delete this[_0x7304('0x24')][_0x55f328[_0x7304('0xdd')]];this[_0x7304('0xb2')](this[_0x7304('0x1c')][_0x5d8bf5[_0x7304('0xb3')]]);this['voiceQueues'][_0x5d8bf5['queue']][_0x7304('0x5d')]+=0x1;this[_0x7304('0x1c')][_0x5d8bf5[_0x7304('0xb3')]][_0x7304('0x5c')]+=0x1;_0x543c0b=new Hangup(_0x5d8bf5,_0x55f328);_0x543c0b[_0x7304('0xa6')]=0x10;_0x543c0b[_0x7304('0xe2')]='AnswerAGI';_0x543c0b[_0x7304('0xe4')]=_0x7304('0x109');this[_0x7304('0xca')](_0x543c0b)['catch'](loggerCatch(_0x7304('0x106')));this[_0x7304('0xc8')](_0x543c0b)[_0x7304('0xb0')](loggerCatch(_0x7304('0x107')));}if(_0x5d8bf5&&_0x5d8bf5[_0x7304('0x4b')]!==_0x7304('0x90')&&!isNotNull(this[_0x7304('0x1c')][_0x5d8bf5[_0x7304('0xb3')]]['dialQueueProject'])){delete this[_0x7304('0x24')][_0x55f328[_0x7304('0xdd')]];this[_0x7304('0xb2')](this[_0x7304('0x1c')][_0x5d8bf5[_0x7304('0xb3')]]);this['voiceQueues'][_0x5d8bf5[_0x7304('0xb3')]][_0x7304('0x67')]+=0x1;_0x543c0b=new Hangup(_0x5d8bf5,_0x55f328);_0x543c0b['state']=0xc;_0x543c0b['statedesc']=_0x55f328[_0x7304('0x10a')];_0x543c0b[_0x7304('0xe4')]=_0x7304('0x10b');this['createHistory'](_0x543c0b)[_0x7304('0xb0')](loggerCatch(_0x7304('0x106')));this[_0x7304('0xc8')](_0x543c0b)[_0x7304('0xb0')](loggerCatch(_0x7304('0x107')));}};Dialer['prototype']['syncAgentComplete']=function(_0x576cdc){var _0x1088fa=this['uniqueId'][_0x576cdc[_0x7304('0xdd')]];var _0xc6aafd=this;if(this[_0x7304('0x1c')][_0x576cdc['queue']]){if(_0x1088fa&&_0x1088fa[_0x7304('0x4b')]!==_0x7304('0x90')){delete this['uniqueId'][_0x576cdc[_0x7304('0xdd')]];this['voiceQueues'][_0x576cdc['queue']][_0x7304('0x5d')]+=0x1;var _0x33475f=new AgentComplete(_0x1088fa,_0x576cdc);if(_0x576cdc['reason']==='agent'){_0x33475f[_0x7304('0x10c')]=this[_0x7304('0x1c')][_0x576cdc[_0x7304('0xb3')]][_0x7304('0x10d')]&&this['voiceQueues'][_0x576cdc[_0x7304('0xb3')]][_0x7304('0x10e')]?moment()[_0x7304('0x79')](_0x7304('0xfd')):undefined;}this['createHistory'](_0x33475f)[_0x7304('0xb0')](loggerCatch(_0x7304('0x10f')));this[_0x7304('0xc8')](_0x33475f)['catch'](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x7304('0xa9')][_0x7304('0x2b')]=function(_0x40e9ed){if(this[_0x7304('0x1c')][_0x40e9ed[_0x7304('0xb3')]]){if(this[_0x7304('0x24')][_0x40e9ed[_0x7304('0xdd')]]&&this['uniqueId'][_0x40e9ed[_0x7304('0xdd')]][_0x7304('0x4b')]!==_0x7304('0x90')){this[_0x7304('0xb2')](this['voiceQueues'][_0x40e9ed[_0x7304('0xb3')]]);this[_0x7304('0x24')][_0x40e9ed[_0x7304('0xdd')]][_0x7304('0x110')]=moment()['format'](_0x7304('0xfd'));}}};Dialer[_0x7304('0xa9')][_0x7304('0x111')]=function(_0x2fdfcf){this[_0x7304('0xca')](_0x2fdfcf)[_0x7304('0xb0')](loggerCatch(_0x7304('0x10f')));this[_0x7304('0xc8')](_0x2fdfcf)[_0x7304('0xb0')](loggerCatch(_0x7304('0x112')));};Dialer[_0x7304('0xa9')]['syncQueueCallerAbandon']=function(_0x320a3a){var _0x58d701=this['uniqueId'][_0x320a3a['uniqueid']];var _0x12c5b9=this;if(this[_0x7304('0x1c')][_0x320a3a[_0x7304('0xb3')]]){if(_0x58d701&&_0x58d701[_0x7304('0x4b')]!==_0x7304('0x90')){delete this['uniqueId'][_0x320a3a[_0x7304('0xdd')]];this['updateOriginated'](this[_0x7304('0x1c')][_0x320a3a[_0x7304('0xb3')]]);_0x58d701[_0x7304('0x113')]=moment()[_0x7304('0x79')](_0x7304('0xfd'));var _0x188523=new QueueCallerAbandon(_0x58d701,_0x320a3a);if(getSeconds(_0x58d701['droptime'],_0x58d701[_0x7304('0x114')])>=_0x58d701[_0x7304('0x115')]){this[_0x7304('0x1c')][_0x320a3a[_0x7304('0xb3')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this['voiceQueues'][_0x320a3a[_0x7304('0xb3')]][_0x7304('0x61')]+=0x1;this[_0x7304('0x1c')][_0x320a3a[_0x7304('0xb3')]][_0x7304('0x6d')]+=0x1;_0x188523[_0x7304('0xa6')]=0xa;_0x188523[_0x7304('0xe2')]='Drop';_0x188523[_0x7304('0x116')]=_0x7304('0x117');_0x188523[_0x7304('0x10c')]=this['voiceQueues'][_0x320a3a['queue']][_0x7304('0x10d')]?moment()[_0x7304('0x79')](_0x7304('0xfd')):undefined;_0x188523[_0x7304('0xf5')]+=0x1;_0x188523[_0x7304('0x101')]+=0x1;if(_0x188523['countdropretry']>=this[_0x7304('0x1c')][_0x320a3a[_0x7304('0xb3')]][_0x7304('0x118')]){this[_0x7304('0x111')](_0x188523);}else{this[_0x7304('0xbe')]({'active':![],'countdropretry':_0x188523[_0x7304('0xf5')],'scheduledat':moment()[_0x7304('0xfb')](this['voiceQueues'][_0x320a3a[_0x7304('0xb3')]]['dialDropRetryFrequency'],_0x7304('0xfc'))[_0x7304('0x79')](_0x7304('0xfd')),'ContactId':_0x58d701[_0x7304('0xd1')],'ListId':_0x58d701['ListId'],'VoiceQueueId':_0x58d701[_0x7304('0x119')]||undefined,'CampaignId':_0x58d701[_0x7304('0xd4')]||undefined})[_0x7304('0xb0')](loggerCatch('[rescheduleContact][Drop]'));var _0x48ada2=new History(_0x188523);_0x48ada2[_0x7304('0xa6')]=0xa;_0x48ada2['statedesc']=_0x7304('0x11a');_0x48ada2[_0x7304('0xa8')]=moment()[_0x7304('0x79')]('YYYY-MM-DD\x20HH:mm:ss');_0x48ada2['endtime']=_0x48ada2[_0x7304('0xa8')];_0x48ada2[_0x7304('0x11b')]=_0x188523['calleridname'];_0x48ada2['calleridnum']=_0x188523['calleridnum'];this['createHistory'](_0x48ada2)['catch'](loggerCatch(_0x7304('0x11c')));}}else{this[_0x7304('0x1c')][_0x320a3a['queue']][_0x7304('0x6b')]+=0x1;this[_0x7304('0x1c')][_0x320a3a[_0x7304('0xb3')]]['outboundDropCallsDayCallersExit']+=0x1;_0x188523[_0x7304('0xa6')]=0xb;_0x188523[_0x7304('0xe2')]='Abandoned';_0x188523[_0x7304('0x116')]=_0x7304('0x11d');_0x188523['countabandonedretry']+=0x1;_0x188523[_0x7304('0x101')]+=0x1;if(_0x188523[_0x7304('0xf6')]>=this['voiceQueues'][_0x320a3a['queue']][_0x7304('0x11e')]){this['queueCallerAbandonCreateState'](_0x188523);}else{this[_0x7304('0xbe')]({'active':![],'countabandonedretry':_0x188523[_0x7304('0xf6')],'scheduledat':moment()['add'](this[_0x7304('0x1c')][_0x320a3a['queue']][_0x7304('0x11f')],'minutes')['format'](_0x7304('0xfd')),'ContactId':_0x58d701['ContactId'],'ListId':_0x58d701[_0x7304('0xd2')],'VoiceQueueId':_0x58d701[_0x7304('0x119')]||undefined,'CampaignId':_0x58d701[_0x7304('0xd4')]||undefined})[_0x7304('0xb0')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x48ada2=new History(_0x188523);_0x48ada2[_0x7304('0xa6')]=0xb;_0x48ada2['statedesc']=_0x7304('0x120');_0x48ada2[_0x7304('0xa8')]=moment()[_0x7304('0x79')]('YYYY-MM-DD\x20HH:mm:ss');_0x48ada2[_0x7304('0xa7')]=_0x48ada2[_0x7304('0xa8')];_0x48ada2['calleridname']=_0x188523[_0x7304('0x11b')];_0x48ada2[_0x7304('0x121')]=_0x188523[_0x7304('0x121')];this[_0x7304('0xca')](_0x48ada2)[_0x7304('0xb0')](loggerCatch(_0x7304('0x122')));}}}}};Dialer['prototype'][_0x7304('0x123')]=function(_0x240ab6){if(this[_0x7304('0x22')][_0x240ab6[_0x7304('0xdd')]]){this[_0x7304('0x22')][_0x240ab6[_0x7304('0xdd')]]['channel']=_0x240ab6['channel'];}if(this['uniqueId'][_0x240ab6[_0x7304('0xdd')]]){this['uniqueId'][_0x240ab6[_0x7304('0xdd')]][_0x7304('0x124')]=_0x240ab6['channel'];}};Dialer[_0x7304('0xa9')][_0x7304('0x37')]=function(_0x27fdb3){if(strategy[this['voiceQueues'][this[_0x7304('0x22')][_0x27fdb3['actionid']][_0x7304('0xb3')]][_0x7304('0x4d')]]==='roundrobin'){if(this['actions'][_0x27fdb3['actionid']]&&_[_0x7304('0xae')](this[_0x7304('0x22')][_0x27fdb3[_0x7304('0x125')]][_0x7304('0x126')])&&_0x27fdb3[_0x7304('0xda')]==='1'&&_0x27fdb3[_0x7304('0x127')]==='0'){if(this[_0x7304('0x1e')][_0x27fdb3[_0x7304('0x128')]]){if(!this[_0x7304('0x1e')][_0x27fdb3[_0x7304('0x128')]]['locked']){this['agents'][_0x27fdb3[_0x7304('0x128')]][_0x7304('0x126')]=!![];this['actions'][_0x27fdb3[_0x7304('0x125')]]['locked']=!![];this[_0x7304('0x22')][_0x27fdb3[_0x7304('0x125')]]['stateinterface']=_0x27fdb3[_0x7304('0x128')];}}}}else if((strategy[this[_0x7304('0x1c')][this[_0x7304('0x22')][_0x27fdb3[_0x7304('0x125')]][_0x7304('0xb3')]]['strategy']]||_0x7304('0x18'))==='rrmemory'){if(this['actions'][_0x27fdb3[_0x7304('0x125')]]){if(this[_0x7304('0x1e')][_0x27fdb3[_0x7304('0x128')]]){this['actions'][_0x27fdb3[_0x7304('0x125')]]['stateinterface']=_0x27fdb3[_0x7304('0x128')];if(_[_0x7304('0xae')](this[_0x7304('0x29')][this[_0x7304('0x22')][_0x27fdb3['actionid']]['queue']])){this[_0x7304('0x29')][this[_0x7304('0x22')][_0x27fdb3[_0x7304('0x125')]][_0x7304('0xb3')]]=[];}this[_0x7304('0x29')][this[_0x7304('0x22')][_0x27fdb3['actionid']][_0x7304('0xb3')]][_0x7304('0x129')](_[_0x7304('0xd0')](_['pick'](this['actions'][_0x27fdb3[_0x7304('0x125')]],[_0x7304('0x12a'),_0x7304('0x128')]),{'status':_0x27fdb3[_0x7304('0xda')],'paused':_0x27fdb3[_0x7304('0x127')]}));}}}};function unlockQueueStatus(_0x166ab6,_0x433568){setTimeout(function(){if(_[_0x7304('0x3d')](_0x166ab6[_0x7304('0x12b')])){loggerBooked['error'](_0x7304('0x12c'),_0x433568);}_0x166ab6[_0x7304('0x12b')]=!![];loggerBooked['info']('[booked][unlockQueueStatus]',_0x433568,JSON[_0x7304('0x49')](_[_0x7304('0x12d')](_0x166ab6,[_0x7304('0x3f'),'queueStatusComplete'])));},0x1f3);}Dialer[_0x7304('0xa9')][_0x7304('0x39')]=function(_0x5ed50f){var _0x109ddf=this;var _0x3b641c=_0x109ddf['voiceQueues'][_0x109ddf[_0x7304('0x22')][_0x5ed50f[_0x7304('0x125')]][_0x7304('0xb3')]];if(strategy[this[_0x7304('0x1c')][this[_0x7304('0x22')][_0x5ed50f[_0x7304('0x125')]][_0x7304('0xb3')]]['strategy']]===_0x7304('0x12e')){if(this[_0x7304('0x22')][_0x5ed50f[_0x7304('0x125')]]&&this[_0x7304('0x22')][_0x5ed50f[_0x7304('0x125')]][_0x7304('0x128')]){this[_0x7304('0x8f')][_0x7304('0x12f')](this[_0x7304('0x22')][_0x5ed50f['actionid']][_0x7304('0x12a')],this[_0x7304('0x22')][_0x5ed50f['actionid']][_0x7304('0x128')])[_0x7304('0xb0')](function(_0x8c95dd){logger[_0x7304('0x94')]('[Catch][Preview][syncQueueStatusComplete]',util[_0x7304('0x95')](_0x8c95dd,{'showHidden':![],'depth':null}));})['finally'](function(){_0x109ddf[_0x7304('0xb2')](_0x109ddf[_0x7304('0x1c')][_0x109ddf[_0x7304('0x22')][_0x5ed50f[_0x7304('0x125')]][_0x7304('0xb3')]]);_0x109ddf[_0x7304('0x1e')][_0x109ddf[_0x7304('0x22')][_0x5ed50f[_0x7304('0x125')]][_0x7304('0x128')]][_0x7304('0x126')]=![];delete _0x109ddf[_0x7304('0x22')][_0x5ed50f[_0x7304('0x125')]];unlockQueueStatus(_0x3b641c);});}else{this['updateOriginated'](this[_0x7304('0x1c')][this['actions'][_0x5ed50f[_0x7304('0x125')]]['queue']]);this[_0x7304('0xbe')]({'active':![],'ContactId':this['actions'][_0x5ed50f[_0x7304('0x125')]][_0x7304('0xd1')],'ListId':this['actions'][_0x5ed50f['actionid']][_0x7304('0xd2')],'VoiceQueueId':this['actions'][_0x5ed50f[_0x7304('0x125')]][_0x7304('0x119')]||undefined,'CampaignId':this[_0x7304('0x22')][_0x5ed50f['actionid']][_0x7304('0xd4')]||undefined})[_0x7304('0xb0')](loggerCatch(_0x7304('0x130')));delete this['actions'][_0x5ed50f[_0x7304('0x125')]];unlockQueueStatus(_0x3b641c);}}else if((strategy[this['voiceQueues'][this[_0x7304('0x22')][_0x5ed50f[_0x7304('0x125')]][_0x7304('0xb3')]]['strategy']]||_0x7304('0x18'))==='rrmemory'){var _0x18d66f;if(this['actions'][_0x5ed50f[_0x7304('0x125')]]&&!_[_0x7304('0x46')](this[_0x7304('0x29')][this[_0x7304('0x22')][_0x5ed50f['actionid']][_0x7304('0xb3')]])){if(this[_0x7304('0x2a')][_0x109ddf[_0x7304('0x22')][_0x5ed50f[_0x7304('0x125')]]['queue']]){this['queueBookedRR'][_0x109ddf['actions'][_0x5ed50f[_0x7304('0x125')]]['queue']]=this[_0x7304('0x2a')][this[_0x7304('0x22')][_0x5ed50f[_0x7304('0x125')]][_0x7304('0xb3')]]?this[_0x7304('0x2a')][this['actions'][_0x5ed50f['actionid']][_0x7304('0xb3')]]:this[_0x7304('0x29')][this[_0x7304('0x22')][_0x5ed50f[_0x7304('0x125')]][_0x7304('0xb3')]]?this['queueBooked'][this[_0x7304('0x22')][_0x5ed50f[_0x7304('0x125')]]['queue']]['_rr']||0x0:0x0;}this[_0x7304('0x29')][this[_0x7304('0x22')][_0x5ed50f[_0x7304('0x125')]][_0x7304('0xb3')]]['_rr']=this[_0x7304('0x2a')][this[_0x7304('0x22')][_0x5ed50f[_0x7304('0x125')]][_0x7304('0xb3')]];for(var _0x4f50a3=0x0;_0x4f50a3=0x0;})[_0x7304('0xb0')](myreject(_0x7316cf)));}}else{_0x2a2cff[_0x7304('0x129')](ami['Action']({'action':_0x7304('0x145'),'command':util[_0x7304('0x79')](_0x7304('0x14a'),_0xf29909,!_[_0x7304('0x3d')](config[_0x7304('0x142')][_0x5a8f27])?_0x5a8f27:'')})['then'](function(_0x44443c){return _0x44443c[_0x7304('0x147')][_0x7304('0x148')]('true')>=0x0;})[_0x7304('0xb0')](myreject(_0x7316cf)));}BPromise[_0x7304('0x14b')](_0x2a2cff)['then'](function(_0x293574){var _0x406f50=_[_0x7304('0x14c')](_0x293574);if(_0x406f50){return _0x29de4f(_0x406f50);}else{_0x3bf2d8[_0x7304('0x45')]=_0xfa772a?_0x7304('0x14d'):'INTERVAL_IS_OVERTIME';return _0x7316cf(msgResponse(_0x7304('0x14e'),_0x7304('0x13e'),_0x7304('0x14f')+_0xfa772a+'\x20'+_0x31b5d1+'\x20Interval\x20is\x20overtime:\x20'+util[_0x7304('0x95')](_0xf29909,{'showHidden':![],'depth':null})+_0x7304('0x150')+_0x5a8f27));}})['catch'](function(_0x5dd085){return _0x7316cf(msgResponse(_0x7304('0x13d'),_0x7304('0x13e'),JSON['stringify'](_0x5dd085)));});});};Dialer[_0x7304('0xa9')][_0x7304('0x151')]=function(_0x2d03b4){var _0x4fbe37=this;return function(){switch(_0x2d03b4[_0x7304('0x58')]){case _0x7304('0x152'):freeVariablesPredictive(_0x2d03b4);_0x4fbe37['handlePower'](_0x2d03b4,0x1);break;case _0x7304('0x153'):freeVariablesPredictive(_0x2d03b4);_0x4fbe37[_0x7304('0x154')](_0x2d03b4,_0x2d03b4[_0x7304('0x155')]);break;case _0x7304('0x9'):_0x4fbe37[_0x7304('0x9')](_0x2d03b4);break;case'booked':freeVariablesPredictive(_0x2d03b4);_0x4fbe37[_0x7304('0x154')](_0x2d03b4,0x1);break;default:freeVariablesPredictive(_0x2d03b4);logger[_0x7304('0x94')](_0x7304('0x156'),_0x2d03b4['name'],_0x7304('0x157'));}};};Dialer[_0x7304('0xa9')][_0x7304('0x158')]=function(_0xb7824f){return BPromise[_0x7304('0xb8')]()[_0x7304('0x3c')](cmHopper[_0x7304('0x159')](_0xb7824f['id'],previewRecallmeReminderInterval))['then'](function(_0x5ece85){for(var _0x262f6a=0x0;_0x262f6a<_0x5ece85[_0x7304('0x131')];_0x262f6a++){var _0x22bbaa=_0x5ece85[_0x262f6a][_0x7304('0x15a')][_0x7304('0x3f')];if(_0x22bbaa)io['to'](util[_0x7304('0x79')](_0x7304('0x15b'),_0x22bbaa))[_0x7304('0xe6')](_0x7304('0x15c'),{'hopper':_0x5ece85[_0x262f6a]});}})[_0x7304('0xb0')](function(_0x41d974){});};Dialer[_0x7304('0xa9')][_0x7304('0x15d')]=function(_0x160609){var _0x4e8a5c=this;return function(){_0x4e8a5c[_0x7304('0x15e')](_0x160609);};};Dialer[_0x7304('0xa9')][_0x7304('0x33')]=function(_0x463791){var _0x22b605=this;if(isNotPreview(_0x463791[_0x7304('0x58')])){if(isVoiceQueueOutbound(_0x463791['type'])&&isActive(_0x463791[_0x7304('0x15f')])){_0x463791[_0x7304('0x9e')]=!![];BPromise[_0x7304('0xb8')]()[_0x7304('0x3c')](checkIsLoggedIn(_0x463791,_0x463791[_0x7304('0x50')]))[_0x7304('0x3c')](checkIsActive(_0x463791,_0x463791['dialActive']))[_0x7304('0x3c')](checkInterval(_0x463791))['then'](_0x22b605[_0x7304('0x13a')](_0x463791))[_0x7304('0x3c')](_0x22b605[_0x7304('0x13c')](_0x463791[_0x7304('0x160')],_0x463791[_0x7304('0x161')],_0x463791['name'],_0x463791))['then'](_0x22b605[_0x7304('0x162')](_0x463791[_0x7304('0x41')],_0x463791['dialTimezone'],_0x463791[_0x7304('0x3f')],_0x463791))[_0x7304('0x3c')](_0x22b605[_0x7304('0x151')](_0x463791))[_0x7304('0xb0')](loggerCatchQueueSummary(_0x7304('0x163'),_0x463791));}else{notSendMessagesQueue(_0x463791);}}else{freeVariablesPredictive(_0x463791);if(_0x463791[_0x7304('0x164')]){_0x22b605[_0x7304('0x158')](_0x463791);}}};Dialer[_0x7304('0xa9')][_0x7304('0x165')]=function(){var _0x32e974=this;var _0x138953;for(var _0xb490c6 in this[_0x7304('0x1d')]){if(typeof this[_0x7304('0x1d')][_0xb490c6]!==_0x7304('0x96')){_0x138953=this[_0x7304('0x1d')][_0xb490c6];if(isCampaignIvr(_0x138953[_0x7304('0x4b')])&&isActive(_0x138953['active'])){_0x138953[_0x7304('0x9e')]=!![];BPromise[_0x7304('0xb8')]()['then'](checkIsActive(_0x138953,_0x138953[_0x7304('0x166')]))[_0x7304('0x3c')](checkInterval(_0x138953))[_0x7304('0x3c')](_0x32e974['checkIsTrunkReachable'](_0x138953))[_0x7304('0x3c')](_0x32e974[_0x7304('0x13c')](_0x138953[_0x7304('0x160')],_0x138953['dialTimezone'],_0x138953[_0x7304('0x3f')],_0x138953))[_0x7304('0x3c')](_0x32e974[_0x7304('0x162')](_0x138953[_0x7304('0x41')],_0x138953[_0x7304('0x161')],_0x138953['name'],_0x138953))[_0x7304('0x3c')](_0x32e974[_0x7304('0x15d')](_0x138953))[_0x7304('0xb0')](loggerCatchQueueSummary(_0x7304('0x167'),_0x138953));}else{notSendMessagesCampaign(_0x138953);}}}};function getCallerIdRandom(_0x2865f1,_0x5837be){var _0x34322a;var _0x251ec8;var _0x228b16;if(_0x5837be<=0x0){_0x5837be=0x1;}_0x34322a=new RegExp('\x5cw{0,'+_0x5837be+'}$');_0x251ec8=Math[_0x7304('0x168')](0xa,_0x5837be-0x1);_0x228b16=Math[_0x7304('0x168')](0xa,_0x5837be)-0x1;return util['format']('%s',_[_0x7304('0x169')](_0x2865f1,_0x34322a,_[_0x7304('0x16a')](_0x251ec8,_0x228b16)));}function extractCalleridName(_0x3ec186){var _0x5657e2=_0x3ec186['match'](/"(.*?)"/);return _0x5657e2?_0x5657e2[0x1]:_0x3ec186;}function extractCalleridNumber(_0x2bd38f){var _0x215dc5=_0x2bd38f[_0x7304('0x16b')](/<(.*?)>/);return _0x215dc5?_0x215dc5[0x1]:_0x2bd38f;}Dialer[_0x7304('0xa9')][_0x7304('0x16c')]=function(_0x342e1f,_0x9040c9){var _0x4ce9b=this;var _0x3713b7=uuid['v4']();this[_0x7304('0x22')][_0x3713b7]=new Action(_0x342e1f,_0x9040c9,_0x3713b7);return new BPromise(function(_0x4bf522,_0x5304a7){if(_[_0x7304('0x3d')](_0x342e1f)&&typeof _0x342e1f!==_0x7304('0x16d')){return _0x5304a7(msgResponse(_0x7304('0x16e'),'Failure',_0x7304('0x16f')));}if(_[_0x7304('0x3d')](_0x9040c9['Contact'][_0x7304('0x170')])||_0x9040c9[_0x7304('0x171')][_0x7304('0x170')]===null){return _0x5304a7(msgResponse('originate',_0x7304('0x13e'),_0x7304('0x172')));}var _0x1fddb0={'XMD-CALLERID':_0x4ce9b['actions'][_0x3713b7]['getCaller'](),'XMD-AGI':_0x342e1f[_0x7304('0x108')]?util[_0x7304('0x79')](_0x7304('0x173'),ipAgi,_0x342e1f[_0x7304('0x108')]):_0x7304('0x174'),'XMD-AGIAFTER':_0x342e1f['dialQueueProject2']?util[_0x7304('0x79')](_0x7304('0x173'),ipAgi,_0x342e1f[_0x7304('0x10d')]):'NONE','XMD-QUEUE':_0x342e1f['type']===_0x7304('0x4c')?util[_0x7304('0x79')]('\x22%s,%s%s,,,%s\x22',_0x342e1f[_0x7304('0x3f')],_0x342e1f[_0x7304('0x175')]||'',_0x342e1f[_0x7304('0x10e')]?'c':'',_0x342e1f[_0x7304('0x115')]||0x3):_0x7304('0x174'),'XMD-CONTACTID':_0x9040c9[_0x7304('0xd1')],'XMD-CDRTYPE':_0x7304('0x7'),'CALLERID(all)':_0x4ce9b[_0x7304('0x22')][_0x3713b7][_0x7304('0x176')](),'XMD-AMD':_0x342e1f[_0x7304('0xe0')]?_0x7304('0x177'):'NONE','XMD-DESTINATION':_0x7304('0x178')};if(_0x342e1f[_0x7304('0xe0')]){_0x1fddb0[_0x7304('0x179')]=_0x342e1f[_0x7304('0x17a')]||0x9c4;_0x1fddb0[_0x7304('0x17b')]=_0x342e1f['dialAMDGreeting']||0x5dc;_0x1fddb0['XMD-AMDAFTERGREETINGSILENCE']=_0x342e1f[_0x7304('0x17c')]||0x320;_0x1fddb0[_0x7304('0x17d')]=_0x342e1f[_0x7304('0x17e')]||0x1388;_0x1fddb0[_0x7304('0x17f')]=_0x342e1f['dialAMDMinWordLength']||0x64;_0x1fddb0['XMD-AMDBETWEENWORDSSILENCE']=_0x342e1f[_0x7304('0x180')]||0x32;_0x1fddb0[_0x7304('0x181')]=_0x342e1f[_0x7304('0x182')]||0x3;_0x1fddb0['XMD-AMDSILENCETHRESHOLD']=_0x342e1f[_0x7304('0x183')]||0x100;_0x1fddb0['XMD-AMDMAXIMUMWORDLENGTH']=_0x342e1f[_0x7304('0x184')]||0x1388;}if(_0x342e1f[_0x7304('0x4b')]==='outbound'){_0x1fddb0[_0x7304('0x185')]=_0x9040c9['VoiceQueueId'];}else{_0x1fddb0['XMD-CAMPAIGNID']=_0x9040c9[_0x7304('0xd4')];}for(var _0x279c5b in _0x9040c9[_0x7304('0x171')]){if(typeof _0x9040c9['Contact'][_0x279c5b]!==_0x7304('0x96')){if(isNotNull(_0x9040c9['Contact'][_0x279c5b])&&_0x279c5b!=='id'&&_0x279c5b!==_0x7304('0x186')&&_0x279c5b!==_0x7304('0x187')&&_0x279c5b!==_0x7304('0x188')){_0x1fddb0[util['format']('%s%s',_0x7304('0x189'),_[_0x7304('0x18a')](_0x279c5b))]=_0x9040c9[_0x7304('0x171')][_0x279c5b];}}}var _0x5f45fd=_0x4ce9b[_0x7304('0xd8')](_0x342e1f['Trunk'])?getCallerId(_0x342e1f[_0x7304('0x76')][_0x7304('0x77')],_0x342e1f['dialOriginateCallerIdName'],_0x342e1f[_0x7304('0x18b')]>0x0?getCallerIdRandom(_0x342e1f[_0x7304('0x18c')],_0x342e1f['dialRandomLastDigitCallerIdNumber']):_0x342e1f[_0x7304('0x18c')]):getCallerId(_['isNil'](_0x342e1f['TrunkBackup'])?_0x342e1f[_0x7304('0x76')]['callerid']:_0x342e1f[_0x7304('0x13b')][_0x7304('0x77')],_0x342e1f[_0x7304('0x59')],_0x342e1f[_0x7304('0x18b')]>0x0?getCallerIdRandom(_0x342e1f['dialOriginateCallerIdNumber'],_0x342e1f[_0x7304('0x18b')]):_0x342e1f[_0x7304('0x18c')]);if(_0x5f45fd){_0x1fddb0['XMD-ORIGINATECALLERIDNAME']=_0x4ce9b[_0x7304('0x22')][_0x3713b7][_0x7304('0x18d')]=extractCalleridName(_0x5f45fd);_0x1fddb0['XMD-ORIGINATECALLERIDNUM']=_0x4ce9b[_0x7304('0x22')][_0x3713b7]['originatecalleridnum']=extractCalleridNumber(_0x5f45fd);}return ami[_0x7304('0xaf')]({'actionid':_0x3713b7,'action':'originate','channel':_0x4ce9b['isTrunkReachable'](_0x342e1f[_0x7304('0x76')])?util[_0x7304('0x79')](_0x7304('0x18e'),_0x342e1f['Trunk'][_0x7304('0x3f')],isNotNull(_0x342e1f[_0x7304('0x5b')])?_0x342e1f[_0x7304('0x5b')][_0x7304('0x18f')]()||'':'',_0x342e1f[_0x7304('0x190')]>0x0?_0x9040c9['Contact'][_0x7304('0x170')]['substring'](_0x342e1f[_0x7304('0x190')]):_0x9040c9[_0x7304('0x171')][_0x7304('0x170')]):util['format'](_0x7304('0x18e'),_['isNil'](_0x342e1f[_0x7304('0x13b')])?_0x342e1f[_0x7304('0x76')][_0x7304('0x3f')]:_0x342e1f[_0x7304('0x13b')][_0x7304('0x3f')],isNotNull(_0x342e1f[_0x7304('0x5b')])?_0x342e1f[_0x7304('0x5b')]['trim']()||'':'',_0x342e1f[_0x7304('0x190')]>0x0?_0x9040c9['Contact']['phone']['substring'](_0x342e1f[_0x7304('0x190')]):_0x9040c9['Contact'][_0x7304('0x170')]),'callerid':_0x5f45fd,'Exten':_0x7304('0x178'),'Context':_0x7304('0x191'),'Priority':'1','variable':_0x1fddb0,'timeout':(_0x342e1f['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x3713b7})[_0x7304('0x3c')](function(_0x2fe68a){return _0x4bf522(_0x2fe68a);})['catch'](function(_0x2497f8){_0x342e1f[_0x7304('0x64')]+=0x1;var _0x1a9ffb=new History(_0x4ce9b['actions'][_0x3713b7]);logger[_0x7304('0x94')](util[_0x7304('0x79')]('[originateError]:\x20%s',JSON[_0x7304('0x49')](_0x2497f8)));_0x1a9ffb[_0x7304('0xa6')]=0xe;_0x1a9ffb[_0x7304('0xe2')]='OriginateError';_0x1a9ffb[_0x7304('0xa8')]=moment()[_0x7304('0x79')](_0x7304('0xfd'));_0x1a9ffb[_0x7304('0xa7')]=_0x1a9ffb['starttime'];_0x4ce9b['createHistory'](_0x1a9ffb)['catch'](loggerCatch(_0x7304('0x192')));_0x4ce9b[_0x7304('0xc8')](_0x1a9ffb)[_0x7304('0xb0')](loggerCatch(_0x7304('0x192')))[_0x7304('0x1a')](function(){delete _0x4ce9b[_0x7304('0x22')][_0x3713b7];return _0x5304a7(msgResponse(_0x7304('0x16e'),_0x7304('0x48'),_0x7304('0x193')));});});});};Dialer[_0x7304('0xa9')][_0x7304('0x30')]=function(_0x304042){var _0x4230ce=this[_0x7304('0x22')][_0x304042[_0x7304('0x125')]];if(_0x4230ce){delete this[_0x7304('0x22')][_0x304042[_0x7304('0x125')]];_0x4230ce[_0x7304('0x114')]=moment()[_0x7304('0x79')]('YYYY-MM-DD\x20HH:mm:ss');var _0x2a76c4=_0x4230ce[_0x7304('0x4b')]==='ivr'?this[_0x7304('0x1d')][_0x4230ce[_0x7304('0xb3')]]:this[_0x7304('0x1c')][_0x4230ce[_0x7304('0x194')]()];if(!this[_0x7304('0xd6')](_0x304042[_0x7304('0x195')])){this[_0x7304('0xb2')](_0x2a76c4);return this['callProgressDetecting'](_0x4230ce,_0x2a76c4,_0x304042)[_0x7304('0xb0')](loggerCatch('[callProgressDetecting]\x20'));}this['uniqueId'][_0x304042[_0x7304('0xdd')]]=_0x4230ce;}};Dialer[_0x7304('0xa9')][_0x7304('0x196')]=function(_0x6d8614,_0x5ded91,_0x484e37){var _0x9d1fde=new History(_0x5ded91);if(_0x9d1fde['countbusyretry']+_0x9d1fde['countcongestionretry']+_0x9d1fde[_0x7304('0xf3')]+_0x9d1fde[_0x7304('0xf4')]+_0x9d1fde['countdropretry']+_0x9d1fde[_0x7304('0xf6')]+_0x9d1fde['countmachineretry']+_0x9d1fde[_0x7304('0xf7')]>=_0x484e37['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x6d8614){case 0x3:if(_0x9d1fde[_0x7304('0xf3')]>=_0x484e37[_0x7304('0x197')]-0x1){return!![];}this[_0x7304('0xbe')]({'active':![],'countnoanswerretry':_0x9d1fde[_0x7304('0xf3')]+=0x1,'scheduledat':moment()[_0x7304('0xfb')](_0x484e37[_0x7304('0x198')],_0x7304('0xfc'))['format'](_0x7304('0xfd')),'ContactId':_0x9d1fde['ContactId'],'ListId':_0x9d1fde['ListId'],'VoiceQueueId':_0x9d1fde[_0x7304('0x119')]||undefined,'CampaignId':_0x9d1fde['CampaignId']||undefined})[_0x7304('0xb0')](loggerCatch(_0x7304('0x199')));break;case 0x5:if(_0x9d1fde[_0x7304('0xf1')]>=_0x484e37[_0x7304('0x19a')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x9d1fde[_0x7304('0xf1')]+=0x1,'scheduledat':moment()[_0x7304('0xfb')](_0x484e37['dialBusyRetryFrequency'],_0x7304('0xfc'))['format'](_0x7304('0xfd')),'ContactId':_0x9d1fde[_0x7304('0xd1')],'ListId':_0x9d1fde[_0x7304('0xd2')],'VoiceQueueId':_0x9d1fde['VoiceQueueId']||undefined,'CampaignId':_0x9d1fde['CampaignId']||undefined})['catch'](loggerCatch(_0x7304('0x19b')));break;case 0x8:if(_0x9d1fde[_0x7304('0xf2')]>=_0x484e37[_0x7304('0x19c')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x9d1fde[_0x7304('0xf2')]+=0x1,'scheduledat':moment()[_0x7304('0xfb')](_0x484e37['dialCongestionRetryFrequency'],_0x7304('0xfc'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x9d1fde[_0x7304('0xd1')],'ListId':_0x9d1fde[_0x7304('0xd2')],'VoiceQueueId':_0x9d1fde['VoiceQueueId']||undefined,'CampaignId':_0x9d1fde[_0x7304('0xd4')]||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x9d1fde[_0x7304('0xf4')]>=_0x484e37[_0x7304('0x19d')]-0x1){return!![];}else{this[_0x7304('0xbe')]({'active':![],'countnosuchnumberretry':_0x9d1fde['countnosuchnumberretry']+=0x1,'scheduledat':moment()['add'](_0x484e37[_0x7304('0x19e')],_0x7304('0xfc'))[_0x7304('0x79')](_0x7304('0xfd')),'ContactId':_0x9d1fde['ContactId'],'ListId':_0x9d1fde['ListId'],'VoiceQueueId':_0x9d1fde[_0x7304('0x119')]||undefined,'CampaignId':_0x9d1fde[_0x7304('0xd4')]||undefined})[_0x7304('0xb0')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x9d1fde[_0x7304('0xf5')]>=_0x484e37[_0x7304('0x118')]-0x1){return!![];}this[_0x7304('0xbe')]({'active':![],'countdropretry':_0x9d1fde[_0x7304('0xf5')]+=0x1,'scheduledat':moment()[_0x7304('0xfb')](_0x484e37[_0x7304('0x19f')],'minutes')[_0x7304('0x79')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x9d1fde['ContactId'],'ListId':_0x9d1fde[_0x7304('0xd2')],'VoiceQueueId':_0x9d1fde[_0x7304('0x119')]||undefined,'CampaignId':_0x9d1fde[_0x7304('0xd4')]||undefined})[_0x7304('0xb0')](loggerCatch(_0x7304('0x1a0')));break;case 0xb:if(_0x9d1fde[_0x7304('0xf6')]>=_0x484e37[_0x7304('0x11e')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countabandonedretry':_0x9d1fde[_0x7304('0xf6')]+=0x1,'scheduledat':moment()['add'](_0x484e37[_0x7304('0x11f')],_0x7304('0xfc'))[_0x7304('0x79')](_0x7304('0xfd')),'ContactId':_0x9d1fde[_0x7304('0xd1')],'ListId':_0x9d1fde[_0x7304('0xd2')],'VoiceQueueId':_0x9d1fde[_0x7304('0x119')]||undefined,'CampaignId':_0x9d1fde[_0x7304('0xd4')]||undefined})[_0x7304('0xb0')](loggerCatch(_0x7304('0x1a1')));break;case 0x13:if(_0x9d1fde[_0x7304('0xed')]>=_0x484e37[_0x7304('0xf9')]-0x1){return!![];}this[_0x7304('0xbe')]({'active':![],'countmachineretry':_0x9d1fde[_0x7304('0xed')]+=0x1,'scheduledat':moment()[_0x7304('0xfb')](_0x484e37[_0x7304('0x104')],'minutes')[_0x7304('0x79')](_0x7304('0xfd')),'ContactId':_0x9d1fde[_0x7304('0xd1')],'ListId':_0x9d1fde[_0x7304('0xd2')],'VoiceQueueId':_0x9d1fde['VoiceQueueId']||undefined,'CampaignId':_0x9d1fde[_0x7304('0xd4')]||undefined})[_0x7304('0xb0')](loggerCatch(_0x7304('0xfe')));break;case 0x14:if(_0x9d1fde[_0x7304('0xf7')]>=_0x484e37['dialAgentRejectMaxRetry']-0x1){return!![];}this[_0x7304('0xbe')]({'active':![],'countagentrejectretry':_0x9d1fde[_0x7304('0xf7')]+=0x1,'scheduledat':moment()[_0x7304('0xfb')](_0x484e37['dialAgentRejectRetryFrequency'],_0x7304('0xfc'))[_0x7304('0x79')](_0x7304('0xfd')),'ContactId':_0x9d1fde[_0x7304('0xd1')],'ListId':_0x9d1fde[_0x7304('0xd2')],'VoiceQueueId':_0x9d1fde[_0x7304('0x119')]||undefined,'CampaignId':_0x9d1fde['CampaignId']||undefined})[_0x7304('0xb0')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0x7304('0xa9')][_0x7304('0x1a2')]=function(_0xf430d7,_0x3d6ff2,_0x42f42b){var _0x5b5ea9=this;var _0x2c61b9=new History(_0xf430d7);return new BPromise(function(_0x57e1fb,_0x4ee84b){if(_[_0x7304('0x3d')](_0x3d6ff2)&&typeof _0x3d6ff2!==_0x7304('0x16d')){return _0x4ee84b(msgResponse(_0x7304('0x1a3'),_0x7304('0x13e'),_0x7304('0x1a4')));}if(_[_0x7304('0x3d')](_0x42f42b)&&typeof _0x42f42b!==_0x7304('0x16d')){return _0x4ee84b(msgResponse(_0x7304('0x1a3'),_0x7304('0x13e'),_0x7304('0x1a5')));}switch(_0x42f42b[_0x7304('0x1a6')]){case'0':_0x3d6ff2['outboundNoSuchCallsDay']+=0x1;_0x2c61b9[_0x7304('0xa6')]=0x0;_0x2c61b9[_0x7304('0xe2')]=_0x7304('0x1a7');_0x2c61b9[_0x7304('0xf4')]+=0x1;_0x2c61b9[_0x7304('0x101')]+=0x1;ami[_0x7304('0xe6')](_0x7304('0x1a8'),ut[_0x7304('0xe7')](_0xf430d7,_0x7304('0x1a9')));_0x5b5ea9[_0x7304('0xca')](_0x2c61b9)['catch'](loggerCatch(_0x7304('0xf0')));if(_0x5b5ea9['checkRetriveMax'](0x0,_0xf430d7,_0x3d6ff2)){if(_0x2c61b9[_0x7304('0xf4')]>=_0x3d6ff2[_0x7304('0x19d')]){_0x5b5ea9[_0x7304('0x103')](_0x2c61b9,_0x57e1fb,_0x4ee84b,_0x7304('0x1aa'));}else{_0x5b5ea9[_0x7304('0x102')](_0x2c61b9,_0x57e1fb,_0x4ee84b,_0x7304('0x1aa'));}}break;case'3':_0x3d6ff2[_0x7304('0x62')]+=0x1;_0x2c61b9[_0x7304('0xa6')]=0x3;_0x2c61b9[_0x7304('0xe2')]=_0x7304('0x1ab');_0x2c61b9[_0x7304('0xf3')]+=0x1;_0x2c61b9['countglobal']+=0x1;ami['emit'](_0x7304('0x1ac'),ut[_0x7304('0xe7')](_0xf430d7,_0x7304('0x1ad')));_0x5b5ea9[_0x7304('0xca')](_0x2c61b9)['catch'](loggerCatch(_0x7304('0x1ae')));if(_0x5b5ea9[_0x7304('0x196')](0x3,_0xf430d7,_0x3d6ff2)){if(_0x2c61b9[_0x7304('0xf3')]>=_0x3d6ff2[_0x7304('0x197')]){_0x5b5ea9[_0x7304('0x103')](_0x2c61b9,_0x57e1fb,_0x4ee84b,_0x7304('0x1af'));}else{_0x5b5ea9['stateGlobal'](_0x2c61b9,_0x57e1fb,_0x4ee84b,_0x7304('0x1af'));}}break;case'5':_0x3d6ff2[_0x7304('0x5e')]+=0x1;_0x2c61b9[_0x7304('0xa6')]=0x5;_0x2c61b9['statedesc']='Busy';_0x2c61b9[_0x7304('0xf1')]+=0x1;_0x2c61b9['countglobal']+=0x1;ami[_0x7304('0xe6')](_0x7304('0x1b0'),ut[_0x7304('0xe7')](_0xf430d7,_0x7304('0x1b1')));_0x5b5ea9['createHistory'](_0x2c61b9)[_0x7304('0xb0')](loggerCatch(_0x7304('0x1b2')));if(_0x5b5ea9[_0x7304('0x196')](0x5,_0xf430d7,_0x3d6ff2)){if(_0x2c61b9[_0x7304('0xf1')]>=_0x3d6ff2[_0x7304('0x19a')]){_0x5b5ea9[_0x7304('0x103')](_0x2c61b9,_0x57e1fb,_0x4ee84b,_0x7304('0x1b3'));}else{_0x5b5ea9[_0x7304('0x102')](_0x2c61b9,_0x57e1fb,_0x4ee84b,_0x7304('0x1b3'));}}break;case'8':_0x3d6ff2[_0x7304('0x5f')]+=0x1;_0x2c61b9[_0x7304('0xa6')]=0x8;_0x2c61b9['statedesc']=_0x7304('0x1b4');_0x2c61b9[_0x7304('0xf2')]+=0x1;_0x2c61b9[_0x7304('0x101')]+=0x1;ami[_0x7304('0xe6')](_0x7304('0x1b5'),ut[_0x7304('0xe7')](_0xf430d7,_0x7304('0x1b6')));_0x5b5ea9[_0x7304('0xca')](_0x2c61b9)['catch'](loggerCatch(_0x7304('0x1b7')));if(_0x5b5ea9['checkRetriveMax'](0x8,_0xf430d7,_0x3d6ff2)){if(_0x2c61b9[_0x7304('0xf2')]>=_0x3d6ff2[_0x7304('0x19c')]){_0x5b5ea9[_0x7304('0x103')](_0x2c61b9,_0x57e1fb,_0x4ee84b,'reason\x208\x20congestion');}else{_0x5b5ea9['stateGlobal'](_0x2c61b9,_0x57e1fb,_0x4ee84b,_0x7304('0x1b8'));}}break;case'11':_0x3d6ff2[_0x7304('0x1b9')]+=0x1;_0x2c61b9[_0x7304('0xa6')]=0xb;_0x2c61b9[_0x7304('0xe2')]=_0x7304('0x120');_0x2c61b9['countabandonedretry']+=0x1;_0x2c61b9[_0x7304('0x101')]+=0x1;_0x5b5ea9[_0x7304('0xca')](_0x2c61b9)[_0x7304('0xb0')](loggerCatch(_0x7304('0x122')));if(_0x5b5ea9['checkRetriveMax'](0xb,_0xf430d7,_0x3d6ff2)){if(_0x2c61b9[_0x7304('0xf6')]>=_0x3d6ff2[_0x7304('0x11e')]){_0x5b5ea9['createStateFinal'](_0x2c61b9,_0x57e1fb,_0x4ee84b,_0x7304('0x1ba'));}else{_0x5b5ea9['stateGlobal'](_0x2c61b9,_0x57e1fb,_0x4ee84b,_0x7304('0x1ba'));}}break;case'20':_0x3d6ff2[_0x7304('0x66')]+=0x1;_0x2c61b9[_0x7304('0xa6')]=0x14;_0x2c61b9[_0x7304('0xe2')]=_0x7304('0x1bb');_0x2c61b9[_0x7304('0xf7')]+=0x1;_0x2c61b9[_0x7304('0x101')]+=0x1;ami[_0x7304('0xe6')](_0x7304('0x1bc'),ut[_0x7304('0xe7')](_0xf430d7,_0x7304('0x1bd')));_0x5b5ea9[_0x7304('0xca')](_0x2c61b9)[_0x7304('0xb0')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x5b5ea9['checkRetriveMax'](0x14,_0xf430d7,_0x3d6ff2)){if(_0x2c61b9['countagentrejectretry']>=_0x3d6ff2['dialAgentRejectMaxRetry']){_0x5b5ea9[_0x7304('0x103')](_0x2c61b9,_0x57e1fb,_0x4ee84b,_0x7304('0x1be'));}else{_0x5b5ea9[_0x7304('0x102')](_0x2c61b9,_0x57e1fb,_0x4ee84b,'reason\x2020\x20agentreject');}}break;default:_0x3d6ff2[_0x7304('0x67')]+=0x1;_0x2c61b9['state']=0xc;_0x2c61b9[_0x7304('0xe2')]=_0x42f42b['reason'];_0x5b5ea9[_0x7304('0xca')](_0x2c61b9)['catch'](loggerCatch(_0x7304('0x1bf')));if(_0x5b5ea9[_0x7304('0x196')](_0x42f42b[_0x7304('0x1a6')],_0xf430d7,_0x3d6ff2)){if(_0x2c61b9[_0x7304('0xf1')]+_0x2c61b9[_0x7304('0xf2')]+_0x2c61b9[_0x7304('0xf3')]+_0x2c61b9[_0x7304('0xf4')]+_0x2c61b9[_0x7304('0xf5')]+_0x2c61b9[_0x7304('0xf6')]+_0x2c61b9['countmachineretry']+_0x2c61b9[_0x7304('0xf7')]>=_0x3d6ff2[_0x7304('0xf8')]){_0x5b5ea9[_0x7304('0x102')](_0x2c61b9,_0x57e1fb,_0x4ee84b,_0x42f42b[_0x7304('0x1a6')]);}else{_0x5b5ea9[_0x7304('0x103')](_0x2c61b9,_0x57e1fb,_0x4ee84b,_0x42f42b[_0x7304('0x1a6')]);}}}});};Dialer[_0x7304('0xa9')][_0x7304('0x102')]=function(_0x530e4b,_0x71f2d,_0x2c0c62,_0x1352ba){var _0x4b273e=new Final(_0x530e4b);_0x4b273e[_0x7304('0xa6')]=0xf;_0x4b273e[_0x7304('0xe2')]=_0x7304('0x1c0');this['createStateFinal'](_0x4b273e,_0x71f2d,_0x2c0c62,_0x1352ba);};Dialer['prototype'][_0x7304('0x103')]=function(_0x534a79,_0x37dd48,_0x29e682,_0x2deb7d){this[_0x7304('0xc8')](_0x534a79)[_0x7304('0x3c')](function(){return _0x37dd48(msgResponse(_0x7304('0x1a3'),'Success',_0x2deb7d));})[_0x7304('0xb0')](function(){return _0x29e682(msgResponse(_0x7304('0x1c1'),_0x7304('0x13e'),'contact\x20not\x20moved'));});};Dialer['prototype'][_0x7304('0x9')]=function(_0x2d67f1){var _0x452539=_0x2d67f1[_0x7304('0x1c2')]/0x64;var _0x557b16=_0x2d67f1[_0x7304('0x61')]/(_0x2d67f1[_0x7304('0x61')]+_0x2d67f1[_0x7304('0x5d')]);var _0x12fb6e=Math[_0x7304('0x1c3')](_0x2d67f1[_0x7304('0x6f')]*(_0x2d67f1[_0x7304('0x1c4')]/0x64));var _0x24c9dc=Math[_0x7304('0x1c3')](_0x2d67f1['predictiveIntervalAvailable']*(_0x2d67f1[_0x7304('0x1c5')]/0x64));var _0xa64926=_0x2d67f1[_0x7304('0x4f')]+_0x2d67f1[_0x7304('0x9f')];var _0x9a6c13=Math[_0x7304('0x1c6')](_0x2d67f1[_0x7304('0x72')]*_0x2d67f1[_0x7304('0x74')]*_0x2d67f1[_0x7304('0x1c7')]*_0x2d67f1[_0x7304('0x1c8')]);if(_['isUndefined'](_0x2d67f1['startProgressive'])){if(!_[_0x7304('0x3d')](_0x2d67f1[_0x7304('0x26')])){_0x2d67f1[_0x7304('0x26')]=undefined;loggerPredictive['error'](_0x7304('0x1c9'),_0x7304('0x1ca'));}if(!_['isUndefined'](_0x2d67f1[_0x7304('0x8d')])){loggerPredictive[_0x7304('0x94')]('[startMethodPredictive][StartProgressive]',_0x7304('0x1cb'));clearInterval(_0x2d67f1[_0x7304('0x8d')]);_0x2d67f1['handlePredictive']=undefined;}_0x2d67f1[_0x7304('0x27')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x2d67f1[_0x7304('0x3f')],_0x7304('0x1cc'),_0x2d67f1['startProgressive']);this['handlePower'](_0x2d67f1,0x1);}else if(ifInterval(_0x2d67f1[_0x7304('0x1cd')],_0x2d67f1[_0x7304('0x27')])){this[_0x7304('0x154')](_0x2d67f1,0x1);loggerPredictiveCalls['info'](_0x7304('0x1ce'),_0x2d67f1[_0x7304('0x27')],_0x2d67f1[_0x7304('0x3f')]);_0x2d67f1[_0x7304('0x72')]=0x0;_0x2d67f1[_0x7304('0x6d')]=0x0;}else if(_0x452539<_0x557b16&&_0x2d67f1['dialPredictiveOptimization']===_0x7304('0x1cf')){freeVariablesPredictive(_0x2d67f1);loggerPredictive['info'](_0x7304('0x1d0'),_0x7304('0x1d1'),_0x557b16,_0x7304('0x27'),_0x2d67f1['name']);}else if(_0x9a6c13<_0x2d67f1[_0x7304('0x6d')]&&_0x2d67f1[_0x7304('0x1d2')]===_0x7304('0x1cf')){freeVariablesPredictive(_0x2d67f1);loggerPredictive[_0x7304('0x7c')](_0x7304('0x1d3'),'Max\x20Drop\x20',_0x9a6c13,'Drop\x20in\x20this\x20interval',_0x2d67f1[_0x7304('0x6d')],_0x7304('0x27'),_0x2d67f1['name']);}else if(!ifInterval(_0x2d67f1['dialPredictiveInterval'],_0x2d67f1[_0x7304('0x27')])&&_['isUndefined'](_0x2d67f1[_0x7304('0x26')])&&!_[_0x7304('0x3d')](_0x2d67f1[_0x7304('0x27')])){_0x2d67f1[_0x7304('0x26')]=moment()[_0x7304('0x79')](_0x7304('0xfd'));loggerPredictive[_0x7304('0x7c')](_0x2d67f1[_0x7304('0x3f')],_0x7304('0x1d4'),_0x2d67f1['startPredictive']);this['averageHandleTime'](_0x2d67f1['dialPredictiveInterval'])['then'](this['getDataPredictive'](_0x2d67f1))['then'](mergeDataErlangB(_0x2d67f1))['then'](this[_0x7304('0x1d5')](_0x2d67f1))[_0x7304('0xb0')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x2d67f1));}else if(!ifInterval(_0x2d67f1[_0x7304('0x1cd')],_0x2d67f1['startPredictive'])){_0x2d67f1['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x2d67f1[_0x7304('0x26')]=moment()['format'](_0x7304('0xfd'));loggerPredictive['info'](_0x2d67f1[_0x7304('0x3f')],_0x7304('0x1d6'),_0x2d67f1[_0x7304('0x26')]);clearInterval(_0x2d67f1['handlePredictive']);_0x2d67f1['handlePredictive']=undefined;this[_0x7304('0x1d7')](_0x2d67f1[_0x7304('0x1cd')])['then'](this['getDataPredictive'](_0x2d67f1))['then'](mergeDataErlangB(_0x2d67f1))[_0x7304('0x3c')](this['startMethodPredictive'](_0x2d67f1))[_0x7304('0xb0')](loggerCatchPredictive(_0x7304('0x1d8'),_0x2d67f1));}else if(_0x2d67f1[_0x7304('0x6f')]&&_0xa64926<_0x2d67f1[_0x7304('0x6f')]-_0x24c9dc){freeVariablesPredictive(_0x2d67f1);loggerPredictive[_0x7304('0x7c')](_0x2d67f1[_0x7304('0x3f')],_0x7304('0x1d9'),_0xa64926,')\x20are\x20less\x20than\x20threshold\x20(',_0x2d67f1[_0x7304('0x6f')],'-',_0x24c9dc,'=',_0x2d67f1[_0x7304('0x6f')]-_0x24c9dc,')');}else if(_0x2d67f1[_0x7304('0x6f')]&&_0xa64926>_0x2d67f1['predictiveIntervalAvailable']+_0x12fb6e){freeVariablesPredictive(_0x2d67f1);loggerPredictive[_0x7304('0x7c')](_0x2d67f1[_0x7304('0x3f')],_0x7304('0x1d9'),_0xa64926,_0x7304('0x1da'),_0x2d67f1[_0x7304('0x6f')],'+',_0x12fb6e,'=',_0x2d67f1[_0x7304('0x6f')]+_0x12fb6e,')');}};Dialer[_0x7304('0xa9')][_0x7304('0x1db')]=function(_0x3247af){var _0x4fa27a=this;return function(_0x541317){return new BPromise(function(_0x27ed16,_0x19dbba){_[_0x7304('0xd0')](_0x3247af,_0x541317[0x0]);if(checkGetDataPredictive(_0x541317[0x0])){var _0x229f8f=_0x3247af[_0x7304('0x6f')]=_0x3247af['talking']+_0x3247af[_0x7304('0x4f')];var _0x26971b=_0x3247af['dialPredictiveInterval']*0x3c;var _0x5ba9b7=_0x541317[0x0]['predictiveIntervalAvgTalktime']+_0x541317[0x0][_0x7304('0x69')];var _0x16636c=(_0x541317[0x0][_0x7304('0x68')]+_0x541317[0x0][_0x7304('0x6c')]+_0x541317[0x0][_0x7304('0x6b')])/_0x541317[0x0]['predictiveIntervalTotalCalls'];_0x3247af[_0x7304('0x1c7')]=_0x16636c>0x0?_0x16636c:0x1;switch(_0x3247af[_0x7304('0x1d2')]){case _0x7304('0x1cf'):var _0x392b27=_0x3247af[_0x7304('0x1c2')]/0x64;return _0x4fa27a[_0x7304('0x1dc')](_0x229f8f,_0x26971b,_0x5ba9b7,_0x16636c,_0x392b27)['then'](function(_0x17419c){return _0x27ed16(_0x17419c);});case _0x7304('0x1dd'):var _0x143091=_0x3247af[_0x7304('0x1c2')]/0x64;return _0x4fa27a[_0x7304('0x1de')](_0x229f8f,_0x26971b,_0x5ba9b7,_0x16636c,_0x143091)['then'](function(_0x37de47){return _0x27ed16(_0x37de47);});default:return _0x19dbba(msgResponse('[getDataPredictive]','Failure',_0x7304('0x1df')));}}else{return _0x19dbba(msgResponse(_0x7304('0x1e0'),'Failure',_0x7304('0x1e1')));}});};};Dialer['prototype']['getDataPredictiveOld']=function(_0x57836f){var _0x3c17e4=this;return function(_0x11e631){return new BPromise(function(_0x2332a5,_0x6e49ee){_[_0x7304('0xd0')](_0x57836f,_0x11e631[0x0]);if(checkGetDataPredictive(_0x11e631[0x0])){loggerPredictive[_0x7304('0x7c')](JSON['stringify'](_0x11e631[0x0]));if(_0x57836f[_0x7304('0x1d2')]===_0x7304('0x1cf')){return _0x3c17e4['getVoiceQueueRtPauses'](_0x57836f['id'])[_0x7304('0x3c')](function(_0x19f60a){var _0x2f02f8=_0x57836f['loggedIn']-_0x19f60a[0x0][_0x7304('0x1e2')];var _0x40ef88=_0x57836f[_0x7304('0x1cd')]*0x3c;var _0x35d5fa=_0x11e631[0x0][_0x7304('0x6a')]+_0x11e631[0x0]['predictiveIntervalAvgHoldtime'];var _0x7e0b28=(_0x11e631[0x0][_0x7304('0x68')]+_0x11e631[0x0][_0x7304('0x6c')]+_0x11e631[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x11e631[0x0][_0x7304('0x70')];var _0x3fcf68=_0x57836f[_0x7304('0x1c2')]/0x64;_0x57836f[_0x7304('0x6e')]=_0x19f60a[0x0][_0x7304('0x1e2')]||0x0;_0x57836f[_0x7304('0x1c7')]=_0x7e0b28>0x0?_0x7e0b28:0x1;return _0x3c17e4[_0x7304('0x1dc')](_0x2f02f8,_0x40ef88,_0x35d5fa,_0x7e0b28,_0x3fcf68);})['then'](function(_0x2fc605){return _0x2332a5(_0x2fc605);})[_0x7304('0xb0')](function(_0x406765){return _0x6e49ee(msgResponse(_0x7304('0x1e3'),_0x7304('0x13e'),JSON['stringify'](_0x406765)));});}if(_0x57836f[_0x7304('0x1d2')]==='agentBusyFactor'){return _0x3c17e4[_0x7304('0xc6')](_0x57836f['id'])[_0x7304('0x3c')](function(_0x4b76dd){var _0x5f5b4e=_0x57836f[_0x7304('0x50')]-_0x4b76dd[0x0]['outboundQueuePauses'];var _0x52c426=_0x57836f[_0x7304('0x1cd')]*0x3c;var _0x1789df=_0x11e631[0x0][_0x7304('0x6a')]+_0x11e631[0x0][_0x7304('0x69')];var _0x1ad59c=(_0x11e631[0x0]['predictiveIntervalAnsweredCalls']+_0x11e631[0x0][_0x7304('0x6c')]+_0x11e631[0x0][_0x7304('0x6b')])/_0x11e631[0x0][_0x7304('0x70')];var _0x5e4c52=_0x57836f[_0x7304('0x1c2')]/0x64;_0x57836f['predictiveIntervalPauses']=_0x4b76dd[0x0][_0x7304('0x1e2')]||0x0;_0x57836f['predictiveIntervalHitRate']=_0x1ad59c>0x0?_0x1ad59c:0x1;return _0x3c17e4['busyFactor'](_0x5f5b4e,_0x52c426,_0x1789df,_0x1ad59c,_0x5e4c52);})[_0x7304('0x3c')](function(_0x1449b3){return _0x2332a5(_0x1449b3);})[_0x7304('0xb0')](function(_0x3499d5){return _0x6e49ee(msgResponse(_0x7304('0x1e3'),_0x7304('0x13e'),JSON[_0x7304('0x49')](_0x3499d5)));});}}else{return _0x6e49ee(msgResponse(_0x7304('0x1e0'),_0x7304('0x13e'),_0x7304('0x1e1')));}});};};Dialer[_0x7304('0xa9')][_0x7304('0x1d5')]=function(_0x31c611){var _0x261457=this;return function(){var _0x5bbb20=0x0;var _0x39a8c5=Math[_0x7304('0x1c6')](_0x31c611['erlangCallToSecond']*0x3e8);if(_0x39a8c5>0x0){_0x39a8c5=_0x39a8c5<0x64?0x64:_0x39a8c5;loggerPredictive[_0x7304('0x7c')](_0x31c611[_0x7304('0x3f')],_0x7304('0x1e4'),_0x39a8c5,_0x7304('0x8b'));_0x31c611[_0x7304('0x8d')]=setInterval(function(){_0x261457[_0x7304('0x8d')](_0x31c611);loggerPredictiveCalls[_0x7304('0x7c')]('[handlePredictive]',_0x5bbb20+=0x1);},_0x39a8c5);}else{loggerPredictive[_0x7304('0x7c')](_0x31c611['name'],_0x7304('0x1e5'));}};};Dialer[_0x7304('0xa9')][_0x7304('0x1e6')]=function(_0x5850b0,_0x1912e3){var _0x3cdee4=this;return function(_0x1d4338){if(_[_0x7304('0x46')](_0x1d4338)){if(_[_0x7304('0xae')](_0x1912e3[_0x7304('0xd3')])||!_0x1912e3[_0x7304('0x1e7')]){if(_0x5850b0[_0x7304('0x58')]===_0x7304('0x8')){_0x5850b0[_0x7304('0x12b')]=_[_0x7304('0x3d')](_0x5850b0[_0x7304('0x12b')])?!![]:_0x5850b0['queueStatusComplete'];var _0x612c9f=uuid['v4']();_0x3cdee4[_0x7304('0x22')][_0x612c9f]=new Action(_0x5850b0,_0x1912e3,_0x612c9f);loggerBooked[_0x7304('0x7c')]('[booked][checkContactBlack]',_0x612c9f,_0x7304('0x1e8'),JSON['stringify'](_0x5850b0[_0x7304('0x12b')]),_0x7304('0x1e9'),_0x5850b0[_0x7304('0x3f')]);if(_0x5850b0[_0x7304('0x12b')]){_0x5850b0['queueStatusComplete']=![];_0x3cdee4[_0x7304('0x29')][_0x3cdee4[_0x7304('0x22')][_0x612c9f][_0x7304('0xb3')]]=[];ami[_0x7304('0xaf')]({'actionid':_0x612c9f,'action':_0x7304('0x1ea'),'queue':_0x5850b0['name']})['catch'](function(){_0x3cdee4[_0x7304('0xb2')](_0x5850b0);_0x3cdee4[_0x7304('0xbe')]({'active':![],'ContactId':_0x3cdee4[_0x7304('0x22')][_0x612c9f][_0x7304('0xd1')],'ListId':_0x3cdee4[_0x7304('0x22')][_0x612c9f][_0x7304('0xd2')],'VoiceQueueId':_0x3cdee4[_0x7304('0x22')][_0x612c9f][_0x7304('0x119')]||undefined,'CampaignId':_0x3cdee4[_0x7304('0x22')][_0x612c9f][_0x7304('0xd4')]||undefined})[_0x7304('0xb0')](loggerCatch(_0x7304('0x1eb')));delete _0x3cdee4[_0x7304('0x22')][_0x612c9f];});}else{loggerBooked['info'](_0x7304('0x1ec'),JSON[_0x7304('0x49')](_0x5850b0[_0x7304('0x12b')]),_0x7304('0x1e9'),_0x5850b0['name']);_0x3cdee4[_0x7304('0xb2')](_0x5850b0);_0x3cdee4[_0x7304('0xbe')]({'active':![],'ContactId':_0x3cdee4['actions'][_0x612c9f][_0x7304('0xd1')],'ListId':_0x3cdee4['actions'][_0x612c9f]['ListId'],'VoiceQueueId':_0x3cdee4[_0x7304('0x22')][_0x612c9f][_0x7304('0x119')]||undefined,'CampaignId':_0x3cdee4[_0x7304('0x22')][_0x612c9f][_0x7304('0xd4')]||undefined})[_0x7304('0xb0')](loggerCatch(_0x7304('0x1eb')));delete _0x3cdee4['actions'][_0x612c9f];}}else{return _0x3cdee4[_0x7304('0x16c')](_0x5850b0,_0x1912e3);}}else{if(getDiff(_0x1912e3[_0x7304('0x1ed')])<_0x5850b0[_0x7304('0x1ee')]*0x3c){if(_0x1912e3[_0x7304('0x15a')]&&!_0x1912e3['Agent'][_0x7304('0x1ef')]){_0x3cdee4[_0x7304('0x8f')][_0x7304('0x12f')](_0x1912e3['id'])[_0x7304('0x1a')](function(){_0x3cdee4[_0x7304('0xb2')](_0x5850b0);});}else{_0x3cdee4[_0x7304('0xc0')]({'active':![]},_0x1912e3['id'],0x1)[_0x7304('0x1a')](function(){_0x3cdee4[_0x7304('0xb2')](_0x5850b0);});}}else{_0x5850b0[_0x7304('0x65')]+=0x1;_0x3cdee4[_0x7304('0xb2')](_0x5850b0);if(_0x5850b0[_0x7304('0x1f0')]){_0x3cdee4[_0x7304('0xbe')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x1912e3[_0x7304('0xd1')],'ListId':_0x1912e3[_0x7304('0xd2')],'VoiceQueueId':_0x1912e3[_0x7304('0x119')]||undefined,'CampaignId':_0x1912e3[_0x7304('0xd4')]||undefined})[_0x7304('0xb0')](loggerCatch(_0x7304('0x1f1')));_0x3cdee4['createHistory'](createObjHistory(_0x5850b0,_0x1912e3,_0x7304('0x1f2'),0x17,_0x7304('0x1f3')))['catch'](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x3cdee4[_0x7304('0xcf')](createObjHistory(_0x5850b0,_0x1912e3,_0x7304('0x1f4'),0x16,_0x7304('0x1f5')),_0x7304('0x1f6'),_0x7304('0x1f7'));}}}}else{_0x5850b0[_0x7304('0x1f8')]+=0x1;_0x3cdee4[_0x7304('0xcf')](createObjHistory(_0x5850b0,_0x1912e3,_0x7304('0x1f9'),0xd,'Blacklist'),_0x7304('0x1fa'),_0x7304('0x1fb'));throw _0x7304('0x1fc');}};};Dialer[_0x7304('0xa9')]['handleIvr']=function(_0x244f27){var _0x4767fa=this;var _0x504244=_0x244f27['limitCalls']-_0x244f27[_0x7304('0x71')]-_0x244f27[_0x7304('0xc3')];emitCampaignSummary(_0x244f27);if(_0x504244>0x0){if(_0x504244>this[_0x7304('0x20')]){_0x504244=this[_0x7304('0x20')];}_0x244f27[_0x7304('0xc3')]+=_0x504244;this[_0x7304('0xc5')](_0x244f27['id'],_0x504244,_0x244f27[_0x7304('0x1fd')],_0x244f27)[_0x7304('0x3c')](function(_0x10be3a){_0x244f27[_0x7304('0xc3')]-=_0x504244;_0x244f27[_0x7304('0xc3')]=_0x244f27[_0x7304('0xc3')]>0x0?_0x244f27['temp']:0x0;if(!checkContactEmpty(_0x10be3a)){_0x244f27[_0x7304('0x45')]=_0x7304('0x1fe');logger['info'](_0x7304('0x1ff')+_0x244f27[_0x7304('0x3f')]);}else{_0x244f27['originated']+=_0x10be3a['length'];_0x244f27[_0x7304('0x45')]='RUNNING';for(var _0x243aa9=0x0;_0x243aa9<_0x10be3a[_0x7304('0x131')];_0x243aa9+=0x1){_0x244f27[_0x7304('0x200')]+=0x1;if(_[_0x7304('0xae')](_0x10be3a[_0x243aa9])||_['isNil'](_0x10be3a[_0x243aa9][_0x7304('0x171')])||_['isNil'](_0x10be3a[_0x243aa9][_0x7304('0x171')]['phone'])){_0x4767fa[_0x7304('0xcd')](_0x7304('0x201'),_0x244f27,_0x10be3a[_0x243aa9]);}else{_0x4767fa['checkIsBlackListIvr'](_['pick'](_0x10be3a[_0x243aa9],[_0x7304('0xd4'),_0x7304('0x202')]))[_0x7304('0x3c')](_0x4767fa[_0x7304('0x1e6')](_0x244f27,_0x10be3a[_0x243aa9]))['catch'](_0x4767fa[_0x7304('0xcc')](_0x7304('0x203'),_0x244f27));}}}})['catch'](loggerGetContactDialer(_0x7304('0x204'),_0x244f27,_0x504244));}};Dialer[_0x7304('0xa9')]['handlePower']=function(_0x13a5cb,_0x5c936a){var _0x547071=this;var _0x37a3d8=[];var _0x9695ec=_0x5c936a>=0x1?_0x5c936a:0x1;if(_0x13a5cb[_0x7304('0x58')]===_0x7304('0x8')){_0x9695ec=0x1;}var _0x47010f=Math['floor'](_0x13a5cb[_0x7304('0x4f')]*_0x9695ec)-_0x13a5cb[_0x7304('0x71')]-_0x13a5cb[_0x7304('0xc3')];emitVoiceQueueSummary(_0x13a5cb);if(_0x13a5cb[_0x7304('0x205')]>0x0){var _0x19b943=_0x13a5cb[_0x7304('0x205')]-_0x13a5cb['originated']-_0x13a5cb[_0x7304('0x9f')]-_0x13a5cb[_0x7304('0xc3')]-_0x13a5cb[_0x7304('0x51')];if(_0x47010f>_0x19b943){_0x47010f=_0x19b943;}}if(_0x47010f>0x0){if(_0x13a5cb[_0x7304('0x58')]===_0x7304('0x8')){_0x47010f=0x1;}if(_0x47010f>this[_0x7304('0x20')]){_0x47010f=this[_0x7304('0x20')];}_0x13a5cb[_0x7304('0xc3')]+=_0x47010f;for(var _0x29be95 in this[_0x7304('0x1e')]){if(typeof this['agents'][_0x29be95]!==_0x7304('0x96')){if(this[_0x7304('0x1e')][_0x29be95][_0x7304('0xa6')]===_0x7304('0x206')&&this[_0x7304('0x1e')][_0x29be95]['status']===_0x7304('0xdb')){_0x37a3d8[_0x7304('0x129')](this['agents'][_0x29be95]['id']);}}}this[_0x7304('0xc2')](_0x13a5cb['id'],_0x37a3d8,_0x47010f,_0x13a5cb['dialOrderByScheduledAt'],_0x13a5cb)['then'](function(_0x37f137){_0x13a5cb[_0x7304('0xc3')]-=_0x47010f;_0x13a5cb[_0x7304('0xc3')]=_0x13a5cb['temp']>0x0?_0x13a5cb['temp']:0x0;if(!checkContactEmpty(_0x37f137)){_0x547071[_0x7304('0xb6')](_0x13a5cb)[_0x7304('0x3c')](sendMessageReschedule(_0x13a5cb))[_0x7304('0xb0')](loggerCatch('[countReScheduled]\x20'));}else{_0x13a5cb[_0x7304('0x71')]+=_0x37f137['length'];_0x13a5cb[_0x7304('0x45')]=_0x13a5cb[_0x7304('0x58')]===_0x7304('0x8')?_0x7304('0x177'):_0x7304('0x207');for(var _0x139476=0x0;_0x139476<_0x37f137[_0x7304('0x131')];_0x139476+=0x1){if(_[_0x7304('0xae')](_0x37f137[_0x139476])||_[_0x7304('0xae')](_0x37f137[_0x139476][_0x7304('0x171')])||_['isNil'](_0x37f137[_0x139476][_0x7304('0x171')]['phone'])){_0x547071['emptyContact'](_0x7304('0x201'),_0x13a5cb,_0x37f137[_0x139476]);}else{_0x547071['checkIsBlackList'](_[_0x7304('0x12d')](_0x37f137[_0x139476],[_0x7304('0x119'),_0x7304('0x202')]))['then'](_0x547071[_0x7304('0x1e6')](_0x13a5cb,_0x37f137[_0x139476]))[_0x7304('0xb0')](_0x547071[_0x7304('0xcc')](_0x7304('0x201'),_0x13a5cb));}}}})[_0x7304('0xb0')](loggerGetContactDialer(_0x7304('0x208'),_0x13a5cb,_0x47010f));}};Dialer[_0x7304('0xa9')][_0x7304('0x8d')]=function(_0x1dbacd){if(_0x1dbacd[_0x7304('0x205')]>0x0){var _0x38fb4d=_0x1dbacd[_0x7304('0x205')]-_0x1dbacd[_0x7304('0x71')]-_0x1dbacd['talking'];if(_0x38fb4d>0x0){this[_0x7304('0x209')](_0x1dbacd);}else{loggerPredictiveCalls[_0x7304('0x7c')](_0x7304('0x20a'));}}else{this['tryOriginatePredictive'](_0x1dbacd);}};Dialer['prototype']['tryOriginatePredictive']=function(_0x8dfc0b){var _0x432e09=this;var _0x44b5ae=[];_0x8dfc0b[_0x7304('0x71')]+=0x1;for(var _0x4556bf in this[_0x7304('0x1e')]){if(typeof this[_0x7304('0x1e')][_0x4556bf]!==_0x7304('0x96')){if(this[_0x7304('0x1e')][_0x4556bf][_0x7304('0xa6')]==='not_inuse'&&this[_0x7304('0x1e')][_0x4556bf][_0x7304('0xda')]===_0x7304('0xdb')){_0x44b5ae[_0x7304('0x129')](this[_0x7304('0x1e')][_0x4556bf]['id']);}}}this['getContactDialer'](_0x8dfc0b['id'],_0x44b5ae,0x1,_0x8dfc0b[_0x7304('0x1fd')],_0x8dfc0b)[_0x7304('0x3c')](function(_0xfa6602){if(!checkContactEmpty(_0xfa6602)){checkContactLowerLimitOriginate(_0x8dfc0b,0x1,0x0);_0x432e09[_0x7304('0xb6')](_0x8dfc0b)[_0x7304('0x3c')](sendMessageReschedule(_0x8dfc0b))['catch'](loggerCatch(_0x7304('0xb7')));}else{_0x8dfc0b['message']='RUNNING';if(_[_0x7304('0xae')](_0xfa6602[0x0])||_[_0x7304('0xae')](_0xfa6602[0x0]['Contact'])||_[_0x7304('0xae')](_0xfa6602[0x0][_0x7304('0x171')][_0x7304('0x170')])){_0x432e09['emptyContact']('[actionOriginate]\x20',_0x8dfc0b,_0xfa6602[0x0]);}else{_0x432e09[_0x7304('0xb9')](_['pick'](_0xfa6602[0x0],[_0x7304('0x119'),_0x7304('0x202')]))[_0x7304('0x3c')](_0x432e09['checkContactBlack'](_0x8dfc0b,_0xfa6602[0x0]))[_0x7304('0xb0')](_0x432e09[_0x7304('0xcc')](_0x7304('0x20b'),_0x8dfc0b));}}})['catch'](loggerGetContactDialer(_0x7304('0x20c'),_0x8dfc0b,0x1));emitVoiceQueueSummary(_0x8dfc0b);};Dialer['prototype']['abandonmentRate']=function(_0xdcf9be,_0x34fa4b,_0x115e98,_0x14630b,_0x501008,_0x430e44){loggerPredictive[_0x7304('0x7c')](_0x7304('0x20d'));loggerPredictive[_0x7304('0x7c')](_0x7304('0x20e'),_0xdcf9be);loggerPredictive[_0x7304('0x7c')](_0x7304('0x20f'),_0x34fa4b);loggerPredictive[_0x7304('0x7c')](_0x7304('0x210'),_0x115e98);loggerPredictive[_0x7304('0x7c')](_0x7304('0x211'),_0x14630b);loggerPredictive[_0x7304('0x7c')](_0x7304('0x212'),_0x501008);loggerPredictive['info'](_0x7304('0x83'));return new BPromise(function(_0x5b01ed,_0x580d0f){if(_0xdcf9be<=0x0||isNaN(_0xdcf9be)){return _0x580d0f(msgResponse('[abandonmentRate]','Error',_0x7304('0x213')+_0xdcf9be));}if(_0x115e98<=0x0||isNaN(_0x115e98)){return _0x580d0f(msgResponse('[abandonmentRate]',_0x7304('0x48'),_0x7304('0x214')+_0x115e98));}if(_0x14630b<=0x0||isNaN(_0x14630b)){return _0x580d0f(msgResponse('[abandonmentRate]','Error',_0x7304('0x215')+_0x14630b));}if(_0x34fa4b<=0x0||isNaN(_0x34fa4b)){return _0x580d0f(msgResponse(_0x7304('0x216'),_0x7304('0x48'),_0x7304('0x217')+_0x34fa4b));}if(_0x501008<=0x0||isNaN(_0x501008)){return _0x580d0f(msgResponse(_0x7304('0x216'),_0x7304('0x48'),'Amax\x20=\x20'+_0x501008));}_0x430e44=_0x430e44||0x0;var _0x9cd80b=0x1/_0x115e98;var _0x29aade=0x0;var _0x2d0fb1=0x0;var _0x5f27d7=0x0;var _0x359e32=0x0;for(var _0x4b87ca=0x0;_0x5f27d7<_0x501008;_0x4b87ca+=0x1){_0x2d0fb1=_0x4b87ca/_0x34fa4b;_0x29aade=(_0x14630b*_0x2d0fb1+_0x430e44)/_0x9cd80b;_0x5f27d7=erlangb(_0x29aade,_0xdcf9be);_0x359e32=_0x29aade/_0xdcf9be*(0x1-erlangb(_0x29aade,_0xdcf9be));}return _0x5b01ed({'erlangCalls':_0x4b87ca,'erlangCallToSecond':_0x34fa4b/_0x4b87ca,'erlangAbandonmentRate':_0x5f27d7,'erlangBusyFactor':_0x359e32});});};Dialer[_0x7304('0xa9')]['busyFactor']=function(_0x3cb0aa,_0x377608,_0x248dbf,_0x48a581,_0xc0aa54,_0x463578){loggerPredictive[_0x7304('0x7c')](_0x7304('0x218'));loggerPredictive[_0x7304('0x7c')]('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',_0x3cb0aa);loggerPredictive[_0x7304('0x7c')](_0x7304('0x20f'),_0x377608);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',_0x248dbf);loggerPredictive['info'](_0x7304('0x211'),_0x48a581);loggerPredictive[_0x7304('0x7c')](_0x7304('0x219'),_0xc0aa54);loggerPredictive[_0x7304('0x7c')](_0x7304('0x83'));return new BPromise(function(_0x534c46,_0x362ce8){if(_0x3cb0aa<=0x0||isNaN(_0x3cb0aa)){return _0x362ce8(msgResponse(_0x7304('0x21a'),'Error',_0x7304('0x213')+_0x3cb0aa));}if(_0x248dbf<=0x0||isNaN(_0x248dbf)){return _0x362ce8(msgResponse(_0x7304('0x21a'),_0x7304('0x48'),_0x7304('0x214')+_0x248dbf));}if(_0x48a581<=0x0||isNaN(_0x48a581)){return _0x362ce8(msgResponse('[busyFactor]',_0x7304('0x48'),'p\x20=\x20'+_0x48a581));}if(_0x377608<=0x0||isNaN(_0x377608)){return _0x362ce8(msgResponse(_0x7304('0x21a'),_0x7304('0x48'),_0x7304('0x217')+_0x377608));}if(_0xc0aa54<=0x0||isNaN(_0xc0aa54)){return _0x362ce8(msgResponse('[busyFactor]',_0x7304('0x48'),_0x7304('0x21b')+_0xc0aa54));}_0x463578=_0x463578||0x0;var _0x15099b=0x1/_0x248dbf;var _0x981bf9=0x0;var _0x23de7a=0x0;var _0x456105=0x0;var _0x39145e=0x0;for(var _0x5c36fd=0x0;_0x39145e<_0xc0aa54;_0x5c36fd+=0x1){_0x23de7a=_0x5c36fd/_0x377608;_0x981bf9=(_0x48a581*_0x23de7a+_0x463578)/_0x15099b;_0x456105=erlangb(_0x981bf9,_0x3cb0aa);_0x39145e=_0x981bf9/_0x3cb0aa*(0x1-erlangb(_0x981bf9,_0x3cb0aa));}return _0x534c46({'erlangCalls':_0x5c36fd,'erlangCallToSecond':_0x377608/_0x5c36fd,'erlangAbandonmentRate':_0x456105,'erlangBusyFactor':_0x39145e});});};module[_0x7304('0x21c')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 6462f1e..d3f3262 100644 --- a/server/services/ami/dialer/queueCallerAbandon.js +++ b/server/services/ami/dialer/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1e72=['ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','util','milliseconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','droptime','talktime','membername','connectedlinename','reason','callbackuniqueid','callbackat','recallme'];(function(_0x55c736,_0x2ba06c){var _0x15f0a9=function(_0x54837d){while(--_0x54837d){_0x55c736['push'](_0x55c736['shift']());}};_0x15f0a9(++_0x2ba06c);}(_0x1e72,0x1a1));var _0x21e7=function(_0x5d67ec,_0x387510){_0x5d67ec=_0x5d67ec-0x0;var _0x4344cd=_0x1e72[_0x5d67ec];return _0x4344cd;};'use strict';var util=require(_0x21e7('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x2f61ff,_0x505f28){var _0x12b2a5=moment(_0x2f61ff)[_0x21e7('0x1')](0x0);var _0x1ccc12=moment(_0x505f28)[_0x21e7('0x1')](0x0);return _0x12b2a5['diff'](_0x1ccc12,'seconds');}function QueueCallerAbandon(_0x3cad61,_0xeb1d3a){this['scheduledat']=_0x3cad61[_0x21e7('0x2')];this[_0x21e7('0x3')]=_0x3cad61[_0x21e7('0x3')];this[_0x21e7('0x4')]=_0x3cad61[_0x21e7('0x3')]===_0x21e7('0x5')?_0x21e7('0x6'):_0x3cad61['type'];this[_0x21e7('0x7')]=_0x3cad61['countbusyretry'];this[_0x21e7('0x8')]=_0x3cad61[_0x21e7('0x8')];this['countnoanswerretry']=_0x3cad61[_0x21e7('0x9')];this[_0x21e7('0xa')]=_0x3cad61[_0x21e7('0x7')]+_0x3cad61[_0x21e7('0x8')]+_0x3cad61[_0x21e7('0x9')]+_0x3cad61[_0x21e7('0xb')]+_0x3cad61[_0x21e7('0xc')]+_0x3cad61[_0x21e7('0xd')]+_0x3cad61[_0x21e7('0xe')]+_0x3cad61[_0x21e7('0xf')];this['countnosuchnumberretry']=_0x3cad61[_0x21e7('0xb')];this['countdropretry']=_0x3cad61['countdropretry'];this['countabandonedretry']=_0x3cad61[_0x21e7('0xd')];this['countmachineretry']=_0x3cad61[_0x21e7('0xe')];this[_0x21e7('0xf')]=_0x3cad61[_0x21e7('0xf')];this[_0x21e7('0x10')]=_0xeb1d3a[_0x21e7('0x10')];this[_0x21e7('0x11')]=_0x3cad61[_0x21e7('0x12')];this[_0x21e7('0x13')]=_0x3cad61[_0x21e7('0x14')];this[_0x21e7('0x15')]=_0x3cad61[_0x21e7('0x15')];this[_0x21e7('0x16')]=_0x3cad61[_0x21e7('0x16')];this['droptime']=_0x3cad61['droptime'];this[_0x21e7('0x17')]=this['droptime'];this[_0x21e7('0x18')]=getSeconds(_0x3cad61[_0x21e7('0x16')],_0x3cad61[_0x21e7('0x15')]);this[_0x21e7('0x19')]=getSeconds(this[_0x21e7('0x1a')],_0x3cad61[_0x21e7('0x16')]);this[_0x21e7('0x1b')]=0x0;this['queue']=_0xeb1d3a[_0x21e7('0x6')];this[_0x21e7('0x1c')]=_0xeb1d3a[_0x21e7('0x1d')];this['reason']=_0xeb1d3a[_0x21e7('0x1e')];this['callback']=_0x3cad61['callback'];this[_0x21e7('0x1f')]=_0x3cad61[_0x21e7('0x1f')];this[_0x21e7('0x20')]=_0x3cad61[_0x21e7('0x20')];this[_0x21e7('0x21')]=_0x3cad61['recallme'];this[_0x21e7('0x22')]=_0x3cad61['ContactId'];this['ListId']=_0x3cad61[_0x21e7('0x23')];this[_0x21e7('0x24')]=_0x3cad61[_0x21e7('0x24')];this['VoiceQueueId']=_0x3cad61[_0x21e7('0x25')];this[_0x21e7('0x26')]=_0x3cad61[_0x21e7('0x26')];this[_0x21e7('0x27')]=_0x3cad61[_0x21e7('0x27')]||'';this['originatecalleridname']=_0x3cad61['originatecalleridname']||'';}module[_0x21e7('0x28')]=QueueCallerAbandon; \ No newline at end of file +var _0xf229=['originatecalleridname','exports','moment','milliseconds','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','droptime','ringtime','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum'];(function(_0x2572f3,_0x3b5007){var _0x3c50c4=function(_0xf80f38){while(--_0xf80f38){_0x2572f3['push'](_0x2572f3['shift']());}};_0x3c50c4(++_0x3b5007);}(_0xf229,0x17c));var _0x9f22=function(_0x4c5b29,_0x1f82f3){_0x4c5b29=_0x4c5b29-0x0;var _0x1b6b92=_0xf229[_0x4c5b29];return _0x1b6b92;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x9f22('0x0'));function getSeconds(_0x254eae,_0x19419b){var _0x2e13b5=moment(_0x254eae)[_0x9f22('0x1')](0x0);var _0x4e185b=moment(_0x19419b)[_0x9f22('0x1')](0x0);return _0x2e13b5['diff'](_0x4e185b,_0x9f22('0x2'));}function QueueCallerAbandon(_0x458b83,_0x2217a6){this[_0x9f22('0x3')]=_0x458b83[_0x9f22('0x3')];this[_0x9f22('0x4')]=_0x458b83[_0x9f22('0x4')];this[_0x9f22('0x5')]=_0x458b83[_0x9f22('0x4')]===_0x9f22('0x6')?_0x9f22('0x7'):_0x458b83[_0x9f22('0x4')];this[_0x9f22('0x8')]=_0x458b83[_0x9f22('0x8')];this[_0x9f22('0x9')]=_0x458b83['countcongestionretry'];this[_0x9f22('0xa')]=_0x458b83[_0x9f22('0xa')];this[_0x9f22('0xb')]=_0x458b83[_0x9f22('0x8')]+_0x458b83[_0x9f22('0x9')]+_0x458b83[_0x9f22('0xa')]+_0x458b83[_0x9f22('0xc')]+_0x458b83[_0x9f22('0xd')]+_0x458b83[_0x9f22('0xe')]+_0x458b83[_0x9f22('0xf')]+_0x458b83[_0x9f22('0x10')];this['countnosuchnumberretry']=_0x458b83[_0x9f22('0xc')];this[_0x9f22('0xd')]=_0x458b83[_0x9f22('0xd')];this[_0x9f22('0xe')]=_0x458b83['countabandonedretry'];this[_0x9f22('0xf')]=_0x458b83[_0x9f22('0xf')];this[_0x9f22('0x10')]=_0x458b83[_0x9f22('0x10')];this[_0x9f22('0x11')]=_0x2217a6[_0x9f22('0x11')];this[_0x9f22('0x12')]=_0x458b83['name'];this[_0x9f22('0x13')]=_0x458b83[_0x9f22('0x14')];this[_0x9f22('0x15')]=_0x458b83[_0x9f22('0x15')];this[_0x9f22('0x16')]=_0x458b83[_0x9f22('0x16')];this['droptime']=_0x458b83[_0x9f22('0x17')];this['endtime']=this[_0x9f22('0x17')];this[_0x9f22('0x18')]=getSeconds(_0x458b83['responsetime'],_0x458b83[_0x9f22('0x15')]);this[_0x9f22('0x19')]=getSeconds(this['droptime'],_0x458b83[_0x9f22('0x16')]);this[_0x9f22('0x1a')]=0x0;this['queue']=_0x2217a6['queue'];this[_0x9f22('0x1b')]=_0x2217a6[_0x9f22('0x1c')];this['reason']=_0x2217a6[_0x9f22('0x1d')];this['callback']=_0x458b83[_0x9f22('0x1e')];this[_0x9f22('0x1f')]=_0x458b83['callbackuniqueid'];this[_0x9f22('0x20')]=_0x458b83[_0x9f22('0x20')];this[_0x9f22('0x21')]=_0x458b83[_0x9f22('0x21')];this[_0x9f22('0x22')]=_0x458b83[_0x9f22('0x22')];this['ListId']=_0x458b83[_0x9f22('0x23')];this['UserId']=_0x458b83[_0x9f22('0x24')];this[_0x9f22('0x25')]=_0x458b83[_0x9f22('0x25')];this[_0x9f22('0x26')]=_0x458b83[_0x9f22('0x26')];this[_0x9f22('0x27')]=_0x458b83['originatecalleridnum']||'';this[_0x9f22('0x28')]=_0x458b83['originatecalleridname']||'';}module[_0x9f22('0x29')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 9b3ecbe..1eb2ae5 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(_0x446f71,_0x30132e){var _0x51bccf=function(_0x24490e){while(--_0x24490e){_0x446f71['push'](_0x446f71['shift']());}};_0x51bccf(++_0x30132e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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(_0xda11cc,_0x281901){var _0x153c56=function(_0x4ece1b){while(--_0x4ece1b){_0xda11cc['push'](_0xda11cc['shift']());}};_0x153c56(++_0x281901);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'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 4f6d4b1..693e758 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 _0xefda=['faxstatus','updateStatus','SENDING\x20FAILED:\x20','SENDING\x20FAILED','execOriginate','FaxAccountId','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','isValid','Trunk\x20Reachable','format','path','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','ext','isTrunkReachable','isNil','active','trunks','SIP/%s','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','Is\x20Valid','exports','util','uuid','moment','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./util/util','./action','../rpc/faxAccount','../rpc/attachment','channels','faxAccounts','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','.pdf','application/pdf','then','notify','parse','catch','error','\x20notify\x20','\x20receiveFax\x20','stringify','pick','response','reason','AttachmentId','update','[Fax][Message][Error][Updated]','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages'];(function(_0x12ca5f,_0x223d98){var _0xfc3ae9=function(_0x1928fb){while(--_0x1928fb){_0x12ca5f['push'](_0x12ca5f['shift']());}};_0xfc3ae9(++_0x223d98);}(_0xefda,0x96));var _0xaefd=function(_0x5cc96b,_0x45b46d){_0x5cc96b=_0x5cc96b-0x0;var _0x59e5ee=_0xefda[_0x5cc96b];return _0x59e5ee;};'use strict';var util=require(_0xaefd('0x0'));var _=require('lodash');var BPromise=require('bluebird');var uuid=require(_0xaefd('0x1'));var moment=require(_0xaefd('0x2'));var path=require('path');var tiff2pdf=require(_0xaefd('0x3'));var gs=require(_0xaefd('0x4'));var logger=require(_0xaefd('0x5'))(_0xaefd('0x6'));var ami=require(_0xaefd('0x7'));var rpcDb=require(_0xaefd('0x8'));var Channel=require('./channel');var ut=require(_0xaefd('0x9'));var Action=require(_0xaefd('0xa'));var faxAccount=require(_0xaefd('0xb'));var attachment=require(_0xaefd('0xc'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x15193c){this[_0xaefd('0xd')]={};this[_0xaefd('0xe')]=_0x15193c['faxAccounts'];this['trunks']=_0x15193c['trunks'];this[_0xaefd('0xf')]={};ami['on'](_0xaefd('0x10'),this[_0xaefd('0x11')][_0xaefd('0x12')](this));ami['on'](_0xaefd('0x13'),this[_0xaefd('0x14')][_0xaefd('0x12')](this));ami['on'](_0xaefd('0x15'),this[_0xaefd('0x16')][_0xaefd('0x12')](this));ami['on'](_0xaefd('0x17'),this['syncNewExten'][_0xaefd('0x12')](this));ami['on']('faxstatus',this[_0xaefd('0x18')][_0xaefd('0x12')](this));ami['on'](_0xaefd('0x19'),this[_0xaefd('0x1a')]['bind'](this));ami['on'](_0xaefd('0x1b'),this[_0xaefd('0x1c')][_0xaefd('0x12')](this));ami['on'](_0xaefd('0x1d'),this[_0xaefd('0x1e')][_0xaefd('0x12')](this));}Fax[_0xaefd('0x1f')][_0xaefd('0x11')]=function(_0x51987a){if(_0x51987a[_0xaefd('0x20')]===_0xaefd('0x21')){for(var _0x9748f4 in this[_0xaefd('0xe')]){if(this[_0xaefd('0xe')][_0xaefd('0x22')](_0x9748f4)){if(_0x51987a['exten']===this[_0xaefd('0xe')][_0x9748f4][_0xaefd('0x23')]){this[_0xaefd('0xd')][_0x51987a[_0xaefd('0x24')]]={};this[_0xaefd('0xd')][_0x51987a[_0xaefd('0x24')]]['channel']=_0x51987a[_0xaefd('0x25')];this[_0xaefd('0xd')][_0x51987a[_0xaefd('0x24')]]['id']=this[_0xaefd('0xe')][_0x9748f4]['id'];this[_0xaefd('0xd')][_0x51987a['uniqueid']]['name']=this['faxAccounts'][_0x9748f4][_0xaefd('0x26')];logger[_0xaefd('0x27')](_0x51987a[_0xaefd('0x24')],'\x20syncNewchannel\x20');}}}}if(this[_0xaefd('0xf')][_0x51987a['uniqueid']]){this[_0xaefd('0xd')][_0x51987a[_0xaefd('0x24')]]={};this[_0xaefd('0xd')][_0x51987a['uniqueid']][_0xaefd('0x25')]=_0x51987a[_0xaefd('0x25')];logger[_0xaefd('0x27')](_0x51987a[_0xaefd('0x24')],_0xaefd('0x28'));}};Fax['prototype'][_0xaefd('0x14')]=function(_0x58c008){if(this[_0xaefd('0xd')][_0x58c008[_0xaefd('0x24')]]){for(var _0x5470bd in _0x58c008[_0xaefd('0x29')]){if(_0x58c008[_0xaefd('0x29')]['hasOwnProperty'](_0x5470bd)){this[_0xaefd('0xd')][_0x58c008[_0xaefd('0x24')]][_0x5470bd]=_0x58c008[_0xaefd('0x2a')];}}}};Fax['prototype'][_0xaefd('0x16')]=function(_0x5c573b){if(this[_0xaefd('0xd')][_0x5c573b['uniqueid']]){this['channels'][_0x5c573b[_0xaefd('0x24')]][_0xaefd('0x2b')]=_0x5c573b['channelstate'];this['channels'][_0x5c573b['uniqueid']][_0xaefd('0x2c')]=_0x5c573b[_0xaefd('0x2c')];}};Fax['prototype']['syncNewExten']=function(_0x62ef86){if(this[_0xaefd('0xd')][_0x62ef86[_0xaefd('0x24')]]){for(var _0x21d358 in _0x62ef86['variable']){if(_0x62ef86[_0xaefd('0x29')][_0xaefd('0x22')](_0x21d358)){this[_0xaefd('0xd')][_0x62ef86[_0xaefd('0x24')]][_0x21d358]=_0x62ef86[_0xaefd('0x2a')];}}}};Fax[_0xaefd('0x1f')][_0xaefd('0x18')]=function(_0x42dcc3){if(this[_0xaefd('0xd')][_0x42dcc3[_0xaefd('0x24')]]){this[_0xaefd('0xd')][_0x42dcc3[_0xaefd('0x24')]][_0xaefd('0x2d')]=_0x42dcc3[_0xaefd('0x2d')];this[_0xaefd('0xd')][_0x42dcc3[_0xaefd('0x24')]]['status']=_0x42dcc3[_0xaefd('0x2e')];this[_0xaefd('0xd')][_0x42dcc3[_0xaefd('0x24')]]['localstationid']=_0x42dcc3[_0xaefd('0x23')];this['channels'][_0x42dcc3[_0xaefd('0x24')]][_0xaefd('0x2f')]=_0x42dcc3[_0xaefd('0x2f')];logger[_0xaefd('0x27')](_0x42dcc3[_0xaefd('0x24')],_0xaefd('0x30'));}};Fax[_0xaefd('0x1f')][_0xaefd('0x1a')]=function(_0x407bea){var _0x28491b=this;if(this[_0xaefd('0xd')][_0x407bea[_0xaefd('0x24')]]){var _0x1233a9=this[_0xaefd('0xd')][_0x407bea['uniqueid']]['id'];this[_0xaefd('0xd')][_0x407bea['uniqueid']][_0xaefd('0x31')]=_0x407bea[_0xaefd('0x31')];this[_0xaefd('0xd')][_0x407bea[_0xaefd('0x24')]][_0xaefd('0x32')]=_0x407bea[_0xaefd('0x32')];this[_0xaefd('0xd')][_0x407bea[_0xaefd('0x24')]][_0xaefd('0x23')]=_0x407bea[_0xaefd('0x23')];this['channels'][_0x407bea[_0xaefd('0x24')]][_0xaefd('0x33')]=_0x407bea['resolution'];this[_0xaefd('0xd')][_0x407bea[_0xaefd('0x24')]][_0xaefd('0x34')]=_0x407bea['transferrate'];this['channels'][_0x407bea[_0xaefd('0x24')]][_0xaefd('0x2f')]=_0x407bea[_0xaefd('0x2f')];this[_0xaefd('0xd')][_0x407bea[_0xaefd('0x24')]][_0xaefd('0x35')]=_0x407bea[_0xaefd('0x35')];if(this[_0xaefd('0xd')][_0x407bea['uniqueid']][_0xaefd('0x32')]>0x0){tiff2pdf(_0x407bea[_0xaefd('0x2f')],_0xaefd('0x36'),function(_0xa68009){logger[_0xaefd('0x27')](_0x407bea[_0xaefd('0x24')],_0xaefd('0x37'),_0xa68009[_0xaefd('0x38')]);attachment['create']({'name':path['parse'](_0x407bea[_0xaefd('0x2f')])[_0xaefd('0x26')],'basename':path['parse'](_0x407bea['filename'])[_0xaefd('0x26')]+_0xaefd('0x39'),'type':_0xaefd('0x3a')})[_0xaefd('0x3b')](function(_0x42820d){faxAccount[_0xaefd('0x3c')](_0x1233a9,{'from':_0x407bea[_0xaefd('0x35')],'mapKey':_0xaefd('0x6'),'body':path[_0xaefd('0x3d')](_0x407bea['filename'])[_0xaefd('0x26')]+_0xaefd('0x39'),'AttachmentId':_0x42820d['id']})[_0xaefd('0x3e')](function(_0x2f0cc6){logger[_0xaefd('0x3f')](_0x407bea[_0xaefd('0x24')],_0xaefd('0x40'),JSON['stringify'](_0x2f0cc6));});})[_0xaefd('0x3e')](function(_0x4badfd){logger[_0xaefd('0x3f')](_0x407bea[_0xaefd('0x24')],_0xaefd('0x41'),JSON[_0xaefd('0x42')](_0x4badfd));});});}logger['info'](_0x407bea['uniqueid'],_0xaefd('0x41'));}};Fax[_0xaefd('0x1f')][_0xaefd('0x1e')]=function(_0x4eeb56){if(this[_0xaefd('0xf')][_0x4eeb56[_0xaefd('0x24')]]){_['merge'](this[_0xaefd('0xd')][_0x4eeb56[_0xaefd('0x24')]],_[_0xaefd('0x43')](_0x4eeb56,[_0xaefd('0x44'),_0xaefd('0x45')]));}};function updateStatus(_0xcdb133){if(_0xcdb133[_0xaefd('0x46')]){faxMessage[_0xaefd('0x47')](_0xcdb133['AttachmentId'],{'failMessage':'SENDING\x20FAILED\x20'})[_0xaefd('0x3b')](function(_0x2aad86){ut['logger'](_0xaefd('0x48'),_0x2aad86);})['catch'](function(_0x14f48d){ut[_0xaefd('0x49')](_0xaefd('0x4a'),_0x14f48d);});}else{ut[_0xaefd('0x49')](_0xaefd('0x4b'));}}Fax[_0xaefd('0x1f')]['updateStatus']=function(_0x56e180,_0x1fd0b0,_0x338823){var _0x500cc6=this;var _0x398ea0={};if(_0x1fd0b0){_0x398ea0={'read':_0x1fd0b0};}else{_0x398ea0={'failMessage':_0x338823};}if(this[_0xaefd('0xf')][_0x56e180][_0xaefd('0x46')]){faxMessage[_0xaefd('0x47')](this['actions'][_0x56e180]['AttachmentId'],_0x398ea0)[_0xaefd('0x3b')](function(_0x41ef40){ut[_0xaefd('0x49')](_0xaefd('0x4c'),_0x41ef40);})[_0xaefd('0x3e')](function(_0x47cac9){ut[_0xaefd('0x49')](_0xaefd('0x4d'),_0x47cac9);})['finally'](function(){delete _0x500cc6[_0xaefd('0xd')][_0x56e180];delete _0x500cc6[_0xaefd('0xf')][_0x56e180];});}else{ut['logger'](_0xaefd('0x4e'));delete this[_0xaefd('0xd')][_0x56e180];delete this[_0xaefd('0xf')][_0x56e180];}};Fax['prototype'][_0xaefd('0x1c')]=function(_0x1a9842){var _0x584df3=this;if(this[_0xaefd('0xd')][_0x1a9842[_0xaefd('0x24')]]){if(this[_0xaefd('0xf')][_0x1a9842[_0xaefd('0x24')]]){this['channels'][_0x1a9842['uniqueid']]['id']=this[_0xaefd('0xf')][_0x1a9842[_0xaefd('0x24')]]['id'];this[_0xaefd('0xd')][_0x1a9842[_0xaefd('0x24')]][_0xaefd('0x26')]=this[_0xaefd('0xf')][_0x1a9842[_0xaefd('0x24')]][_0xaefd('0x26')];}logger[_0xaefd('0x27')](_0x1a9842[_0xaefd('0x24')],this['actions'][_0x1a9842['uniqueid']]?_0xaefd('0x4f'):_0xaefd('0x50'),JSON[_0xaefd('0x42')](this[_0xaefd('0xd')][_0x1a9842['uniqueid']]));if(this[_0xaefd('0xf')][_0x1a9842[_0xaefd('0x24')]]){if(this[_0xaefd('0xd')][_0x1a9842[_0xaefd('0x24')]][_0xaefd('0x51')]>0x0&&this[_0xaefd('0xd')][_0x1a9842[_0xaefd('0x24')]][_0xaefd('0x52')]==='SUCCESS'){this[_0xaefd('0x53')](_0x1a9842[_0xaefd('0x24')],!![]);}else{this[_0xaefd('0x53')](_0x1a9842[_0xaefd('0x24')],![],this['channels'][_0x1a9842[_0xaefd('0x24')]]['faxstatusstring']?_0xaefd('0x54')+this[_0xaefd('0xd')][_0x1a9842['uniqueid']]['faxstatusstring']:_0xaefd('0x55'));}}}};Fax['prototype']['send']=function(_0x4e75bc){var _0xe2397c=this;return new BPromise(function(_0x2747b4,_0x27fcb4){_0xe2397c[_0xaefd('0x56')](_0x4e75bc,_0xe2397c[_0xaefd('0xe')][_0x4e75bc[_0xaefd('0x57')]])['then'](function(_0x5d308a){ut['logger']('[Fax][execOriginate][success]',_0x5d308a);_0x2747b4(ut[_0xaefd('0x38')]('Fax\x20received'));})[_0xaefd('0x3e')](function(_0x481e3a){ut[_0xaefd('0x49')](_0xaefd('0x58'),_0x481e3a);updateStatus(_0x4e75bc);_0x27fcb4(ut[_0xaefd('0x38')](_0xaefd('0x59')));});});};Fax[_0xaefd('0x1f')][_0xaefd('0x5a')]=function(_0x368009){var _0x4b173f=this;return new BPromise(function(_0x72a9e2,_0x4113e4){var _0x131fe0=_0x4b173f[_0xaefd('0x5b')](_0x4b173f['faxAccounts'][_0x368009[_0xaefd('0x57')]]['Trunk'],_0x368009);if(_0x131fe0[_0xaefd('0x5c')]){_0x72a9e2(ut[_0xaefd('0x38')](_0xaefd('0x5d')));}else{_0x4113e4(ut[_0xaefd('0x38')](_0x131fe0[_0xaefd('0x38')]));}});};function originate(_0xa918d3,_0x57776e,_0x1a6195){return new BPromise(function(_0x3b39db,_0x4a9fa5){if(_0x1a6195){var _0x39ee5=util[_0xaefd('0x5e')]('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[_0xaefd('0x3d')](_0xa918d3[_0xaefd('0x5f')])[_0xaefd('0x26')],_0xa918d3[_0xaefd('0x5f')]);gs[_0xaefd('0x60')](_0x39ee5)[_0xaefd('0x3b')](function(){_0xa918d3[_0xaefd('0x5f')]=util[_0xaefd('0x5e')](_0xaefd('0x61'),path[_0xaefd('0x3d')](_0xa918d3[_0xaefd('0x5f')])[_0xaefd('0x62')],path[_0xaefd('0x3d')](_0xa918d3[_0xaefd('0x5f')])[_0xaefd('0x26')]);_0x57776e[_0xaefd('0x63')]=_0xa918d3[_0xaefd('0x5f')];ut['logger'](_0xaefd('0x64'),'');ami[_0xaefd('0x65')](ut[_0xaefd('0x66')](_0xa918d3,_0x57776e))['then'](function(_0x35f0a3){_0x3b39db(_0x35f0a3);})[_0xaefd('0x3e')](function(_0x47270b){_0x4a9fa5(_0x47270b);});})[_0xaefd('0x3e')](function(_0x513941){_0x4a9fa5(_0x513941);});}else{ami[_0xaefd('0x65')](ut['variablesAction'](_0xa918d3,_0x57776e))[_0xaefd('0x3b')](function(_0x4917a2){_0x3b39db(_0x4917a2);})[_0xaefd('0x3e')](function(_0x6c3427){_0x4a9fa5(_0x6c3427);});}});}Fax[_0xaefd('0x1f')]['execOriginate']=function(_0x5259bf,_0x121cfb){var _0x2254c9=this;return new BPromise(function(_0x21bac3,_0x99f17b){var _0x157a2a=uuid['v4']();var _0x805c70=ut['addVariables'](_0x5259bf,_0x121cfb);_0x2254c9['actions'][_0x157a2a]=new Action(_0x157a2a,_0x121cfb,_0x5259bf);var _0x58c97c=_0x2254c9['actions'][_0x157a2a];if(path['parse'](_0x5259bf[_0xaefd('0x5f')])[_0xaefd('0x67')]===_0xaefd('0x39')){originate(_0x58c97c,_0x805c70,!![])[_0xaefd('0x3b')](function(_0x5ae635){_0x21bac3(_0x5ae635);})[_0xaefd('0x3e')](function(_0x1c4508){_0x99f17b(_0x1c4508);});}else{originate(_0x58c97c,_0x805c70,![])['then'](function(_0xf63e04){_0x21bac3(_0xf63e04);})['catch'](function(_0x9c5ad6){_0x99f17b(_0x9c5ad6);});}});};Fax['prototype'][_0xaefd('0x68')]=function(_0x4b1ade){return!_[_0xaefd('0x69')](_0x4b1ade)&&!_['isNil'](_0x4b1ade[_0xaefd('0x26')])&&!_[_0xaefd('0x69')](_0x4b1ade['active'])&&_0x4b1ade[_0xaefd('0x6a')]&&!_[_0xaefd('0x69')](this[_0xaefd('0x6b')][util['format'](_0xaefd('0x6c'),_0x4b1ade[_0xaefd('0x26')])])&&!_[_0xaefd('0x69')](this[_0xaefd('0x6b')][util[_0xaefd('0x5e')]('SIP/%s',_0x4b1ade[_0xaefd('0x26')])][_0xaefd('0x2e')])&&(this['trunks'][util[_0xaefd('0x5e')](_0xaefd('0x6c'),_0x4b1ade[_0xaefd('0x26')])][_0xaefd('0x2e')]==='reachable'||this[_0xaefd('0x6b')][util['format'](_0xaefd('0x6c'),_0x4b1ade[_0xaefd('0x26')])][_0xaefd('0x2e')]==='unmonitored');};Fax[_0xaefd('0x1f')][_0xaefd('0x5b')]=function(_0x3c569a,_0x5afbda){if(!this[_0xaefd('0x68')](_0x3c569a)){ut[_0xaefd('0x49')](_0xaefd('0x6d'),_[_0xaefd('0x69')](_0x3c569a)?'':_0x3c569a['name']+_0xaefd('0x6e'));return{'isValid':![],'message':_0xaefd('0x6f')};}if(_[_0xaefd('0x69')](_0x5afbda[_0xaefd('0x6')])){ut['logger'](_0xaefd('0x70'),JSON[_0xaefd('0x42')](_0x5afbda));return{'isValid':![],'message':_0xaefd('0x71')};}if(_[_0xaefd('0x69')](_0x5afbda['path'])){ut[_0xaefd('0x49')]('[Fax][checkTrunk][Empty\x20path]',JSON[_0xaefd('0x42')](_0x5afbda));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0xaefd('0x72')};};module[_0xaefd('0x73')]=Fax; \ No newline at end of file +var _0x5eb8=['remotestationid','pagestransferred','resolution','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','.pdf','application/pdf','then','parse','catch','\x20notify\x20','stringify','error','\x20receiveFax\x20','syncOriginateResponse','merge','pick','response','AttachmentId','update','SENDING\x20FAILED\x20','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','[Fax][Message][Updated]','logger','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatus','updateStatus','faxstatusstring','SENDING\x20FAILED','send','FaxAccountId','Fax\x20received','[Fax][execOriginate][failure]','checkTrunk','Trunk','isValid','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','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','isNil','active','SIP/%s','reachable','unmonitored','isTrunkReachable','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Is\x20Valid','exports','bluebird','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','syncVarSet','syncNewState','newexten','syncNewExten','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','prototype','hasOwnProperty','exten','localstationid','uniqueid','name','channel','info','\x20syncNewchannel\x20','variable','channelstate','channelstatedesc','value','operation','status','filename'];(function(_0x125286,_0x5c7d57){var _0x132553=function(_0x4cfe70){while(--_0x4cfe70){_0x125286['push'](_0x125286['shift']());}};_0x132553(++_0x5c7d57);}(_0x5eb8,0xb0));var _0x85eb=function(_0xe7d07d,_0x52e4e3){_0xe7d07d=_0xe7d07d-0x0;var _0x229e46=_0x5eb8[_0xe7d07d];return _0x229e46;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require(_0x85eb('0x0'));var uuid=require(_0x85eb('0x1'));var moment=require(_0x85eb('0x2'));var path=require(_0x85eb('0x3'));var tiff2pdf=require(_0x85eb('0x4'));var gs=require(_0x85eb('0x5'));var logger=require(_0x85eb('0x6'))(_0x85eb('0x7'));var ami=require(_0x85eb('0x8'));var rpcDb=require(_0x85eb('0x9'));var Channel=require(_0x85eb('0xa'));var ut=require(_0x85eb('0xb'));var Action=require('./action');var faxAccount=require(_0x85eb('0xc'));var attachment=require(_0x85eb('0xd'));var faxMessage=require(_0x85eb('0xe'));function Fax(_0x5cd4ec){this[_0x85eb('0xf')]={};this['faxAccounts']=_0x5cd4ec[_0x85eb('0x10')];this[_0x85eb('0x11')]=_0x5cd4ec[_0x85eb('0x11')];this[_0x85eb('0x12')]={};ami['on'](_0x85eb('0x13'),this[_0x85eb('0x14')][_0x85eb('0x15')](this));ami['on']('varset',this[_0x85eb('0x16')][_0x85eb('0x15')](this));ami['on']('newstate',this[_0x85eb('0x17')][_0x85eb('0x15')](this));ami['on'](_0x85eb('0x18'),this[_0x85eb('0x19')]['bind'](this));ami['on']('faxstatus',this[_0x85eb('0x1a')]['bind'](this));ami['on'](_0x85eb('0x1b'),this[_0x85eb('0x1c')][_0x85eb('0x15')](this));ami['on'](_0x85eb('0x1d'),this[_0x85eb('0x1e')]['bind'](this));ami['on'](_0x85eb('0x1f'),this['syncOriginateResponse'][_0x85eb('0x15')](this));}Fax[_0x85eb('0x20')][_0x85eb('0x14')]=function(_0x5deab1){if(_0x5deab1['context']==='from-voip-provider'){for(var _0x50d2a8 in this[_0x85eb('0x10')]){if(this[_0x85eb('0x10')][_0x85eb('0x21')](_0x50d2a8)){if(_0x5deab1[_0x85eb('0x22')]===this[_0x85eb('0x10')][_0x50d2a8][_0x85eb('0x23')]){this['channels'][_0x5deab1[_0x85eb('0x24')]]={};this[_0x85eb('0xf')][_0x5deab1[_0x85eb('0x24')]]['channel']=_0x5deab1['channel'];this['channels'][_0x5deab1['uniqueid']]['id']=this[_0x85eb('0x10')][_0x50d2a8]['id'];this[_0x85eb('0xf')][_0x5deab1[_0x85eb('0x24')]][_0x85eb('0x25')]=this[_0x85eb('0x10')][_0x50d2a8][_0x85eb('0x25')];logger['info'](_0x5deab1['uniqueid'],'\x20syncNewchannel\x20');}}}}if(this[_0x85eb('0x12')][_0x5deab1[_0x85eb('0x24')]]){this[_0x85eb('0xf')][_0x5deab1[_0x85eb('0x24')]]={};this[_0x85eb('0xf')][_0x5deab1[_0x85eb('0x24')]]['channel']=_0x5deab1[_0x85eb('0x26')];logger[_0x85eb('0x27')](_0x5deab1[_0x85eb('0x24')],_0x85eb('0x28'));}};Fax[_0x85eb('0x20')]['syncVarSet']=function(_0x2e5aa3){if(this[_0x85eb('0xf')][_0x2e5aa3[_0x85eb('0x24')]]){for(var _0x3e7eb9 in _0x2e5aa3[_0x85eb('0x29')]){if(_0x2e5aa3[_0x85eb('0x29')]['hasOwnProperty'](_0x3e7eb9)){this['channels'][_0x2e5aa3[_0x85eb('0x24')]][_0x3e7eb9]=_0x2e5aa3['value'];}}}};Fax[_0x85eb('0x20')]['syncNewState']=function(_0x4229e9){if(this[_0x85eb('0xf')][_0x4229e9[_0x85eb('0x24')]]){this[_0x85eb('0xf')][_0x4229e9[_0x85eb('0x24')]][_0x85eb('0x2a')]=_0x4229e9[_0x85eb('0x2a')];this['channels'][_0x4229e9[_0x85eb('0x24')]][_0x85eb('0x2b')]=_0x4229e9['channelstatedesc'];}};Fax[_0x85eb('0x20')]['syncNewExten']=function(_0x5439aa){if(this[_0x85eb('0xf')][_0x5439aa[_0x85eb('0x24')]]){for(var _0x3e6f34 in _0x5439aa[_0x85eb('0x29')]){if(_0x5439aa[_0x85eb('0x29')][_0x85eb('0x21')](_0x3e6f34)){this[_0x85eb('0xf')][_0x5439aa[_0x85eb('0x24')]][_0x3e6f34]=_0x5439aa[_0x85eb('0x2c')];}}}};Fax[_0x85eb('0x20')]['syncFaxStatus']=function(_0x14fe58){if(this[_0x85eb('0xf')][_0x14fe58['uniqueid']]){this['channels'][_0x14fe58[_0x85eb('0x24')]][_0x85eb('0x2d')]=_0x14fe58[_0x85eb('0x2d')];this[_0x85eb('0xf')][_0x14fe58[_0x85eb('0x24')]][_0x85eb('0x2e')]=_0x14fe58[_0x85eb('0x2e')];this[_0x85eb('0xf')][_0x14fe58[_0x85eb('0x24')]][_0x85eb('0x23')]=_0x14fe58[_0x85eb('0x23')];this[_0x85eb('0xf')][_0x14fe58[_0x85eb('0x24')]][_0x85eb('0x2f')]=_0x14fe58['filename'];logger[_0x85eb('0x27')](_0x14fe58[_0x85eb('0x24')],'\x20syncFaxStatus\x20');}};Fax['prototype'][_0x85eb('0x1c')]=function(_0xe22d16){var _0x5389d8=this;if(this[_0x85eb('0xf')][_0xe22d16['uniqueid']]){var _0x4440ec=this['channels'][_0xe22d16[_0x85eb('0x24')]]['id'];this['channels'][_0xe22d16[_0x85eb('0x24')]]['remotestationid']=_0xe22d16[_0x85eb('0x30')];this[_0x85eb('0xf')][_0xe22d16['uniqueid']][_0x85eb('0x31')]=_0xe22d16['pagestransferred'];this[_0x85eb('0xf')][_0xe22d16[_0x85eb('0x24')]]['localstationid']=_0xe22d16[_0x85eb('0x23')];this['channels'][_0xe22d16['uniqueid']][_0x85eb('0x32')]=_0xe22d16['resolution'];this[_0x85eb('0xf')][_0xe22d16[_0x85eb('0x24')]]['transferrate']=_0xe22d16['transferrate'];this[_0x85eb('0xf')][_0xe22d16[_0x85eb('0x24')]]['filename']=_0xe22d16['filename'];this[_0x85eb('0xf')][_0xe22d16[_0x85eb('0x24')]][_0x85eb('0x33')]=_0xe22d16[_0x85eb('0x33')];if(this[_0x85eb('0xf')][_0xe22d16['uniqueid']][_0x85eb('0x31')]>0x0){tiff2pdf(_0xe22d16[_0x85eb('0x2f')],_0x85eb('0x34'),function(_0x3b096b){logger[_0x85eb('0x27')](_0xe22d16[_0x85eb('0x24')],_0x85eb('0x35'),_0x3b096b[_0x85eb('0x36')]);attachment[_0x85eb('0x37')]({'name':path['parse'](_0xe22d16[_0x85eb('0x2f')])[_0x85eb('0x25')],'basename':path['parse'](_0xe22d16[_0x85eb('0x2f')])[_0x85eb('0x25')]+_0x85eb('0x38'),'type':_0x85eb('0x39')})[_0x85eb('0x3a')](function(_0x2372ad){faxAccount['notify'](_0x4440ec,{'from':_0xe22d16[_0x85eb('0x33')],'mapKey':_0x85eb('0x7'),'body':path[_0x85eb('0x3b')](_0xe22d16[_0x85eb('0x2f')])[_0x85eb('0x25')]+_0x85eb('0x38'),'AttachmentId':_0x2372ad['id']})[_0x85eb('0x3c')](function(_0x202590){logger['error'](_0xe22d16[_0x85eb('0x24')],_0x85eb('0x3d'),JSON[_0x85eb('0x3e')](_0x202590));});})[_0x85eb('0x3c')](function(_0x154399){logger[_0x85eb('0x3f')](_0xe22d16[_0x85eb('0x24')],_0x85eb('0x40'),JSON[_0x85eb('0x3e')](_0x154399));});});}logger[_0x85eb('0x27')](_0xe22d16[_0x85eb('0x24')],_0x85eb('0x40'));}};Fax['prototype'][_0x85eb('0x41')]=function(_0x2c951b){if(this[_0x85eb('0x12')][_0x2c951b['uniqueid']]){_[_0x85eb('0x42')](this[_0x85eb('0xf')][_0x2c951b[_0x85eb('0x24')]],_[_0x85eb('0x43')](_0x2c951b,[_0x85eb('0x44'),'reason']));}};function updateStatus(_0x2ef4d1){if(_0x2ef4d1[_0x85eb('0x45')]){faxMessage[_0x85eb('0x46')](_0x2ef4d1['AttachmentId'],{'failMessage':_0x85eb('0x47')})[_0x85eb('0x3a')](function(_0x1efc6f){ut['logger']('[Fax][Message][Error][Updated]',_0x1efc6f);})[_0x85eb('0x3c')](function(_0x52996f){ut['logger'](_0x85eb('0x48'),_0x52996f);});}else{ut['logger'](_0x85eb('0x49'));}}Fax[_0x85eb('0x20')]['updateStatus']=function(_0x4abe5e,_0x27ce2a,_0x249511){var _0x178d76=this;var _0x40d64d={};if(_0x27ce2a){_0x40d64d={'read':_0x27ce2a};}else{_0x40d64d={'failMessage':_0x249511};}if(this[_0x85eb('0x12')][_0x4abe5e]['AttachmentId']){faxMessage[_0x85eb('0x46')](this[_0x85eb('0x12')][_0x4abe5e][_0x85eb('0x45')],_0x40d64d)[_0x85eb('0x3a')](function(_0x1614dd){ut['logger'](_0x85eb('0x4a'),_0x1614dd);})['catch'](function(_0xd2e792){ut[_0x85eb('0x4b')]('[Fax][Message][NoUpdate1]',_0xd2e792);})[_0x85eb('0x4c')](function(){delete _0x178d76[_0x85eb('0xf')][_0x4abe5e];delete _0x178d76[_0x85eb('0x12')][_0x4abe5e];});}else{ut[_0x85eb('0x4b')](_0x85eb('0x4d'));delete this[_0x85eb('0xf')][_0x4abe5e];delete this['actions'][_0x4abe5e];}};Fax[_0x85eb('0x20')]['syncHangup']=function(_0x311857){var _0x20f4b3=this;if(this['channels'][_0x311857[_0x85eb('0x24')]]){if(this[_0x85eb('0x12')][_0x311857['uniqueid']]){this[_0x85eb('0xf')][_0x311857['uniqueid']]['id']=this[_0x85eb('0x12')][_0x311857[_0x85eb('0x24')]]['id'];this[_0x85eb('0xf')][_0x311857[_0x85eb('0x24')]][_0x85eb('0x25')]=this[_0x85eb('0x12')][_0x311857['uniqueid']][_0x85eb('0x25')];}logger[_0x85eb('0x27')](_0x311857[_0x85eb('0x24')],this[_0x85eb('0x12')][_0x311857[_0x85eb('0x24')]]?_0x85eb('0x4e'):_0x85eb('0x4f'),JSON[_0x85eb('0x3e')](this[_0x85eb('0xf')][_0x311857[_0x85eb('0x24')]]));if(this[_0x85eb('0x12')][_0x311857['uniqueid']]){if(this[_0x85eb('0xf')][_0x311857[_0x85eb('0x24')]][_0x85eb('0x50')]>0x0&&this[_0x85eb('0xf')][_0x311857[_0x85eb('0x24')]][_0x85eb('0x51')]==='SUCCESS'){this[_0x85eb('0x52')](_0x311857['uniqueid'],!![]);}else{this[_0x85eb('0x52')](_0x311857[_0x85eb('0x24')],![],this[_0x85eb('0xf')][_0x311857[_0x85eb('0x24')]][_0x85eb('0x53')]?'SENDING\x20FAILED:\x20'+this[_0x85eb('0xf')][_0x311857[_0x85eb('0x24')]][_0x85eb('0x53')]:_0x85eb('0x54'));}}}};Fax[_0x85eb('0x20')][_0x85eb('0x55')]=function(_0x23fcf9){var _0x5de716=this;return new BPromise(function(_0x5b611f,_0x3b896a){_0x5de716['execOriginate'](_0x23fcf9,_0x5de716[_0x85eb('0x10')][_0x23fcf9[_0x85eb('0x56')]])[_0x85eb('0x3a')](function(_0x41960f){ut[_0x85eb('0x4b')]('[Fax][execOriginate][success]',_0x41960f);_0x5b611f(ut[_0x85eb('0x36')](_0x85eb('0x57')));})[_0x85eb('0x3c')](function(_0x235fde){ut[_0x85eb('0x4b')](_0x85eb('0x58'),_0x235fde);updateStatus(_0x23fcf9);_0x3b896a(ut['message']('Fax\x20failed'));});});};Fax[_0x85eb('0x20')]['checkAfterSend']=function(_0x1378f4){var _0xc4b933=this;return new BPromise(function(_0xe08b39,_0x23f24a){var _0x232e3f=_0xc4b933[_0x85eb('0x59')](_0xc4b933['faxAccounts'][_0x1378f4[_0x85eb('0x56')]][_0x85eb('0x5a')],_0x1378f4);if(_0x232e3f[_0x85eb('0x5b')]){_0xe08b39(ut[_0x85eb('0x36')]('Trunk\x20Reachable'));}else{_0x23f24a(ut[_0x85eb('0x36')](_0x232e3f[_0x85eb('0x36')]));}});};function originate(_0xcc7da3,_0x14bf0e,_0x5037c7){return new BPromise(function(_0x459317,_0x2e6734){if(_0x5037c7){var _0x13a040=util[_0x85eb('0x5c')](_0x85eb('0x5d'),path[_0x85eb('0x3b')](_0xcc7da3[_0x85eb('0x3')])[_0x85eb('0x25')],_0xcc7da3[_0x85eb('0x3')]);gs[_0x85eb('0x5e')](_0x13a040)[_0x85eb('0x3a')](function(){_0xcc7da3[_0x85eb('0x3')]=util[_0x85eb('0x5c')](_0x85eb('0x5f'),path[_0x85eb('0x3b')](_0xcc7da3[_0x85eb('0x3')])[_0x85eb('0x60')],path[_0x85eb('0x3b')](_0xcc7da3[_0x85eb('0x3')])['name']);_0x14bf0e[_0x85eb('0x61')]=_0xcc7da3['path'];ut[_0x85eb('0x4b')](_0x85eb('0x62'),'');ami[_0x85eb('0x63')](ut[_0x85eb('0x64')](_0xcc7da3,_0x14bf0e))[_0x85eb('0x3a')](function(_0x3de724){_0x459317(_0x3de724);})[_0x85eb('0x3c')](function(_0x3076df){_0x2e6734(_0x3076df);});})[_0x85eb('0x3c')](function(_0x569ebe){_0x2e6734(_0x569ebe);});}else{ami[_0x85eb('0x63')](ut[_0x85eb('0x64')](_0xcc7da3,_0x14bf0e))[_0x85eb('0x3a')](function(_0x31f977){_0x459317(_0x31f977);})[_0x85eb('0x3c')](function(_0x496216){_0x2e6734(_0x496216);});}});}Fax[_0x85eb('0x20')]['execOriginate']=function(_0x24e609,_0x330c2b){var _0x29600d=this;return new BPromise(function(_0x55bab0,_0x2daa64){var _0x2e358d=uuid['v4']();var _0x1169c8=ut['addVariables'](_0x24e609,_0x330c2b);_0x29600d['actions'][_0x2e358d]=new Action(_0x2e358d,_0x330c2b,_0x24e609);var _0x45a1ef=_0x29600d[_0x85eb('0x12')][_0x2e358d];if(path[_0x85eb('0x3b')](_0x24e609[_0x85eb('0x3')])['ext']===_0x85eb('0x38')){originate(_0x45a1ef,_0x1169c8,!![])['then'](function(_0x11a3bd){_0x55bab0(_0x11a3bd);})[_0x85eb('0x3c')](function(_0x528d2e){_0x2daa64(_0x528d2e);});}else{originate(_0x45a1ef,_0x1169c8,![])[_0x85eb('0x3a')](function(_0x404663){_0x55bab0(_0x404663);})[_0x85eb('0x3c')](function(_0x53cf37){_0x2daa64(_0x53cf37);});}});};Fax[_0x85eb('0x20')]['isTrunkReachable']=function(_0x18049b){return!_[_0x85eb('0x65')](_0x18049b)&&!_[_0x85eb('0x65')](_0x18049b[_0x85eb('0x25')])&&!_[_0x85eb('0x65')](_0x18049b[_0x85eb('0x66')])&&_0x18049b[_0x85eb('0x66')]&&!_[_0x85eb('0x65')](this[_0x85eb('0x11')][util['format'](_0x85eb('0x67'),_0x18049b[_0x85eb('0x25')])])&&!_['isNil'](this['trunks'][util[_0x85eb('0x5c')]('SIP/%s',_0x18049b[_0x85eb('0x25')])]['status'])&&(this[_0x85eb('0x11')][util['format'](_0x85eb('0x67'),_0x18049b[_0x85eb('0x25')])]['status']===_0x85eb('0x68')||this[_0x85eb('0x11')][util['format'](_0x85eb('0x67'),_0x18049b[_0x85eb('0x25')])][_0x85eb('0x2e')]===_0x85eb('0x69'));};Fax['prototype'][_0x85eb('0x59')]=function(_0x53ccc5,_0x3acae9){if(!this[_0x85eb('0x6a')](_0x53ccc5)){ut[_0x85eb('0x4b')]('[Fax][checkTrunk][Trunk\x20not\x20work]',_[_0x85eb('0x65')](_0x53ccc5)?'':_0x53ccc5[_0x85eb('0x25')]+_0x85eb('0x6b'));return{'isValid':![],'message':'Trunk\x20not\x20working'};}if(_[_0x85eb('0x65')](_0x3acae9['fax'])){ut[_0x85eb('0x4b')](_0x85eb('0x6c'),JSON[_0x85eb('0x3e')](_0x3acae9));return{'isValid':![],'message':'Empty\x20Fax'};}if(_['isNil'](_0x3acae9['path'])){ut[_0x85eb('0x4b')](_0x85eb('0x6d'),JSON[_0x85eb('0x3e')](_0x3acae9));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0x85eb('0x6e')};};module[_0x85eb('0x6f')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 7b3ff9a..78201e1 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 _0x54bd=['../../../config/logger','preview','error','notify','resolve','catch','bluebird'];(function(_0x1c6669,_0x9a9789){var _0x5d71c7=function(_0x182dd7){while(--_0x182dd7){_0x1c6669['push'](_0x1c6669['shift']());}};_0x5d71c7(++_0x9a9789);}(_0x54bd,0x125));var _0xd54b=function(_0x54d176,_0x5603b4){_0x54d176=_0x54d176-0x0;var _0x447f92=_0x54bd[_0x54d176];return _0x447f92;};'use strict';var util=require('util');var BPromise=require(_0xd54b('0x0'));var logger=require(_0xd54b('0x1'))(_0xd54b('0x2'));var _=require('lodash');var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x542979){return function(_0x3aa01e){logger[_0xd54b('0x3')](_0x542979,util['inspect'](_0x3aa01e,{'showHidden':![],'depth':null}));};}exports[_0xd54b('0x4')]=function(_0x2c55e0,_0x38ed37){return BPromise[_0xd54b('0x5')]()['then'](faxAccount['notify'](_0x2c55e0,_0x38ed37))[_0xd54b('0x6')](loggerCatch('[Notify]\x20'));}; \ No newline at end of file +var _0x23ab=['catch','[Notify]\x20','util','../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect','notify','resolve','then'];(function(_0xfba42c,_0x41f976){var _0x2c856f=function(_0x4928c4){while(--_0x4928c4){_0xfba42c['push'](_0xfba42c['shift']());}};_0x2c856f(++_0x41f976);}(_0x23ab,0xc2));var _0xb23a=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x23ab[_0x2641f9];return _0x585741;};'use strict';var util=require(_0xb23a('0x0'));var BPromise=require('bluebird');var logger=require(_0xb23a('0x1'))(_0xb23a('0x2'));var _=require(_0xb23a('0x3'));var faxAccount=require(_0xb23a('0x4'));function loggerCatch(_0x19c4f7){return function(_0x507885){logger[_0xb23a('0x5')](_0x19c4f7,util[_0xb23a('0x6')](_0x507885,{'showHidden':![],'depth':null}));};}exports[_0xb23a('0x7')]=function(_0x3388f3,_0x53434b){return BPromise[_0xb23a('0x8')]()[_0xb23a('0x9')](faxAccount[_0xb23a('0x7')](_0x3388f3,_0x53434b))[_0xb23a('0xa')](loggerCatch(_0xb23a('0xb')));}; \ 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 5605e00..ff4231d 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 _0x1780=['Exec\x20gs','\x20Error\x20:','inspect','util','../../../../config/logger','fax','bluebird','child_process','exec','execute','info'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1780,0x1c6));var _0x0178=function(_0x4b7a6b,_0xa84f4){_0x4b7a6b=_0x4b7a6b-0x0;var _0x3d237c=_0x1780[_0x4b7a6b];return _0x3d237c;};'use strict';var util=require(_0x0178('0x0'));var logger=require(_0x0178('0x1'))(_0x0178('0x2'));var BPromise=require(_0x0178('0x3'));var exec=require(_0x0178('0x4'))[_0x0178('0x5')];exports[_0x0178('0x6')]=function(_0x3dc138){return new BPromise(function(_0x3b6fc6,_0xebd130){exec(_0x3dc138,function(_0x562421,_0x354e1d,_0x4fb2b4){logger[_0x0178('0x7')](_0x0178('0x8'),_0x354e1d);if(_0x562421){logger[_0x0178('0x7')](_0x0178('0x8'),_0x0178('0x9'),util[_0x0178('0xa')](_0x562421,{'showHidden':![],'depth':null}),_0x354e1d,_0x4fb2b4);_0xebd130(_0x562421);}_0x3b6fc6(_0x354e1d);});});}; \ No newline at end of file +var _0xa182=['info','Exec\x20gs','\x20Error\x20:','inspect','util','../../../../config/logger','fax','bluebird','child_process','execute'];(function(_0x4f7e88,_0x8dfd1c){var _0x479ef2=function(_0x561923){while(--_0x561923){_0x4f7e88['push'](_0x4f7e88['shift']());}};_0x479ef2(++_0x8dfd1c);}(_0xa182,0xf4));var _0x2a18=function(_0x281b7b,_0x5142fd){_0x281b7b=_0x281b7b-0x0;var _0x92329a=_0xa182[_0x281b7b];return _0x92329a;};'use strict';var util=require(_0x2a18('0x0'));var logger=require(_0x2a18('0x1'))(_0x2a18('0x2'));var BPromise=require(_0x2a18('0x3'));var exec=require(_0x2a18('0x4'))['exec'];exports[_0x2a18('0x5')]=function(_0x488689){return new BPromise(function(_0x8ac43d,_0x556402){exec(_0x488689,function(_0x3be893,_0x55de94,_0x538976){logger[_0x2a18('0x6')](_0x2a18('0x7'),_0x55de94);if(_0x3be893){logger[_0x2a18('0x6')](_0x2a18('0x7'),_0x2a18('0x8'),util[_0x2a18('0x9')](_0x3be893,{'showHidden':![],'depth':null}),_0x55de94,_0x538976);_0x556402(_0x3be893);}_0x8ac43d(_0x55de94);});});}; \ 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 5905f34..fc22b2c 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 _0xd9a0=['../../../../config/logger','fax','logger','inspect','addVariables','ecm','minrate','maxrate','\x22%s\x22','modem','gateway','faxdetect','t38timeout','path','variablesAction','uniqueid','originate','channel','\x22%s\x22\x20<%s>','headerinfo','moment'];(function(_0x197ae3,_0x451c0d){var _0x47646f=function(_0x55ccae){while(--_0x55ccae){_0x197ae3['push'](_0x197ae3['shift']());}};_0x47646f(++_0x451c0d);}(_0xd9a0,0x68));var _0x0d9a=function(_0x2219de,_0xf3fa47){_0x2219de=_0x2219de-0x0;var _0x562975=_0xd9a0[_0x2219de];return _0x562975;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x0d9a('0x0'));var logger=require(_0x0d9a('0x1'))(_0x0d9a('0x2'));exports['message']=function(_0x5a4bc4){return{'message':_0x5a4bc4};};exports[_0x0d9a('0x3')]=function(_0x36eee8,_0x4c1959){logger['info'](_0x36eee8,util[_0x0d9a('0x4')](_0x4c1959,{'showHidden':![],'depth':null}));};exports[_0x0d9a('0x5')]=function(_0x491fb9,_0x59bca5){var _0xd777ab={'XMF-ECM':_0x59bca5[_0x0d9a('0x6')],'XMF-HEADERINFO':_0x59bca5['headerinfo'],'XMF-MINRATE':_0x59bca5[_0x0d9a('0x7')],'XMF-MAXRATE':_0x59bca5[_0x0d9a('0x8')],'XMF-MODEM':util['format'](_0x0d9a('0x9'),_0x59bca5[_0x0d9a('0xa')]),'XMF-GATEWAY':_0x59bca5[_0x0d9a('0xb')],'XMF-FAXDETECT':_0x59bca5[_0x0d9a('0xc')],'XMF-T38TIMEOUT':_0x59bca5[_0x0d9a('0xd')],'XMF-LOCALSTATIONID':_0x59bca5['localstationid'],'XMF-PATH':_0x491fb9[_0x0d9a('0xe')]};return _0xd777ab;};exports[_0x0d9a('0xf')]=function(_0x33dd39,_0x1e3ee0){return{'actionid':_0x33dd39[_0x0d9a('0x10')],'action':_0x0d9a('0x11'),'channel':_0x33dd39[_0x0d9a('0x12')],'Exten':'xcally-motion-fax','Context':'from-sip','Priority':'1','callerid':util['format'](_0x0d9a('0x13'),_0x33dd39[_0x0d9a('0x14')]?_0x33dd39['headerinfo']:'',_0x33dd39['localstationid']),'variable':_0x1e3ee0,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x33dd39[_0x0d9a('0x10')]};}; \ No newline at end of file +var _0xfa15=['uniqueid','originate','channel','xcally-motion-fax','from-sip','headerinfo','localstationid','util','lodash','moment','../../../../config/logger','fax','message','logger','addVariables','ecm','minrate','maxrate','format','modem','gateway','faxdetect','t38timeout','path','variablesAction'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xfa15,0x101));var _0x5fa1=function(_0x4f5afd,_0x37c53b){_0x4f5afd=_0x4f5afd-0x0;var _0x3a1cb4=_0xfa15[_0x4f5afd];return _0x3a1cb4;};'use strict';var util=require(_0x5fa1('0x0'));var _=require(_0x5fa1('0x1'));var moment=require(_0x5fa1('0x2'));var logger=require(_0x5fa1('0x3'))(_0x5fa1('0x4'));exports[_0x5fa1('0x5')]=function(_0x129236){return{'message':_0x129236};};exports[_0x5fa1('0x6')]=function(_0x4d2d92,_0x34a566){logger['info'](_0x4d2d92,util['inspect'](_0x34a566,{'showHidden':![],'depth':null}));};exports[_0x5fa1('0x7')]=function(_0x2cd33c,_0x485192){var _0xba2eb7={'XMF-ECM':_0x485192[_0x5fa1('0x8')],'XMF-HEADERINFO':_0x485192['headerinfo'],'XMF-MINRATE':_0x485192[_0x5fa1('0x9')],'XMF-MAXRATE':_0x485192[_0x5fa1('0xa')],'XMF-MODEM':util[_0x5fa1('0xb')]('\x22%s\x22',_0x485192[_0x5fa1('0xc')]),'XMF-GATEWAY':_0x485192[_0x5fa1('0xd')],'XMF-FAXDETECT':_0x485192[_0x5fa1('0xe')],'XMF-T38TIMEOUT':_0x485192[_0x5fa1('0xf')],'XMF-LOCALSTATIONID':_0x485192['localstationid'],'XMF-PATH':_0x2cd33c[_0x5fa1('0x10')]};return _0xba2eb7;};exports[_0x5fa1('0x11')]=function(_0x329674,_0x3b18a2){return{'actionid':_0x329674[_0x5fa1('0x12')],'action':_0x5fa1('0x13'),'channel':_0x329674[_0x5fa1('0x14')],'Exten':_0x5fa1('0x15'),'Context':_0x5fa1('0x16'),'Priority':'1','callerid':util['format']('\x22%s\x22\x20<%s>',_0x329674[_0x5fa1('0x17')]?_0x329674[_0x5fa1('0x17')]:'',_0x329674[_0x5fa1('0x18')]),'variable':_0x3b18a2,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x329674[_0x5fa1('0x12')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 569d9ea..74ca0bf 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 _0x0dbe=['catch','error','inspect','listen','sync','[index.js][main]','bluebird','util','./report','./acw','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','resolve','then','initAgents','initVoiceQueues','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initDeskAccounts','getZohoAccounts','getVtigerAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports'];(function(_0x2b3c5c,_0x1380f4){var _0x2f080a=function(_0x581186){while(--_0x581186){_0x2b3c5c['push'](_0x2b3c5c['shift']());}};_0x2f080a(++_0x1380f4);}(_0x0dbe,0x106));var _0xe0db=function(_0x53c256,_0x382a24){_0x53c256=_0x53c256-0x0;var _0x25feb6=_0x0dbe[_0x53c256];return _0x25feb6;};'use strict';var BPromise=require(_0xe0db('0x0'));var util=require(_0xe0db('0x1'));var moment=require('moment');var server=require('./server');var Realtime=require('./realtime');var Report=require(_0xe0db('0x2'));var Acw=require(_0xe0db('0x3'));var Trigger=require('./trigger');var Dialer=require(_0xe0db('0x4'));var Preview=require(_0xe0db('0x5'));var Fax=require(_0xe0db('0x6'));var user=require(_0xe0db('0x7'));var voiceQueue=require(_0xe0db('0x8'));var voiceQueueReport=require(_0xe0db('0x9'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0xe0db('0xa'));var trigger=require(_0xe0db('0xb'));var template=require(_0xe0db('0xc'));var cmHopperHistory=require(_0xe0db('0xd'));var campaign=require(_0xe0db('0xe'));var voiceExtension=require(_0xe0db('0xf'));var faxAccount=require(_0xe0db('0x10'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0xe0db('0x11'));var freshdesk=require(_0xe0db('0x12'));var desk=require(_0xe0db('0x13'));var zoho=require(_0xe0db('0x14'));var vtiger=require(_0xe0db('0x15'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0xe0db('0x16'));var dynamics365=require(_0xe0db('0x17'));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(_0xe0db('0x18'))(_0xe0db('0x19'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xe0db('0x1a')](_0xe0db('0x1b'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xe0db('0x1a')](_0xe0db('0x1b'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xe0db('0x1c')]()[_0xe0db('0x1d')](user['getAgents']())[_0xe0db('0x1d')](realtime[_0xe0db('0x1e')]())['then'](user['getTelephones']())[_0xe0db('0x1d')](realtime['initTelephones']())[_0xe0db('0x1d')](trunk['getTrunks']())[_0xe0db('0x1d')](realtime['initTrunks']())[_0xe0db('0x1d')](voiceQueue['getVoiceQueues']())['then'](realtime[_0xe0db('0x1f')]())[_0xe0db('0x1d')](trigger['getTriggers']())[_0xe0db('0x1d')](realtime['initTriggers']())[_0xe0db('0x1d')](template[_0xe0db('0x20')]())[_0xe0db('0x1d')](realtime[_0xe0db('0x21')]())[_0xe0db('0x1d')](zendesk[_0xe0db('0x22')]())[_0xe0db('0x1d')](realtime[_0xe0db('0x23')]())[_0xe0db('0x1d')](salesforce[_0xe0db('0x24')]())[_0xe0db('0x1d')](realtime[_0xe0db('0x25')]())[_0xe0db('0x1d')](sugarcrm[_0xe0db('0x26')]())['then'](realtime[_0xe0db('0x27')]())[_0xe0db('0x1d')](freshdesk[_0xe0db('0x28')]())['then'](realtime['initFreshdeskAccounts']())[_0xe0db('0x1d')](desk['getDeskAccounts']())[_0xe0db('0x1d')](realtime[_0xe0db('0x29')]())[_0xe0db('0x1d')](zoho[_0xe0db('0x2a')]())[_0xe0db('0x1d')](realtime['initZohoAccounts']())[_0xe0db('0x1d')](vtiger[_0xe0db('0x2b')]())[_0xe0db('0x1d')](realtime['initVtigerAccounts']())[_0xe0db('0x1d')](freshsales['getFreshsalesAccounts']())[_0xe0db('0x1d')](realtime['initFreshsalesAccounts']())[_0xe0db('0x1d')](servicenow['getServicenowAccounts']())[_0xe0db('0x1d')](realtime[_0xe0db('0x2c')]())[_0xe0db('0x1d')](dynamics365[_0xe0db('0x2d')]())[_0xe0db('0x1d')](realtime[_0xe0db('0x2e')]())[_0xe0db('0x1d')](campaign[_0xe0db('0x2f')]())[_0xe0db('0x1d')](realtime[_0xe0db('0x30')]())[_0xe0db('0x1d')](voiceExtension[_0xe0db('0x31')]())[_0xe0db('0x1d')](realtime[_0xe0db('0x32')]())[_0xe0db('0x1d')](faxAccount['getFaxAccounts']())[_0xe0db('0x1d')](realtime[_0xe0db('0x33')]())[_0xe0db('0x1d')](function(){return realtime;});}function initParams(){return BPromise[_0xe0db('0x1c')]()[_0xe0db('0x1d')](voiceQueueReport[_0xe0db('0x34')]())['then'](realtime[_0xe0db('0x35')]())[_0xe0db('0x1d')](cmHopperHistory['getVoiceQueueHopperHistory']())['then'](realtime[_0xe0db('0x36')]())[_0xe0db('0x1d')](cmHopperHistory[_0xe0db('0x37')]())['then'](realtime['initCampaignHopperHistory']())[_0xe0db('0x1d')](voiceCallReport[_0xe0db('0x38')]())[_0xe0db('0x1d')](realtime[_0xe0db('0x39')]())[_0xe0db('0x3a')](function(_0x192757){logger[_0xe0db('0x3b')]('[index.js][initParams]',util[_0xe0db('0x3c')](_0x192757,{'showHidden':![],'depth':null}));});}function main(){return server[_0xe0db('0x3d')](realtime,preview,fax)[_0xe0db('0x1d')](function(_0x26a497){return initRealtime();})['then'](function(){return initParams();})['then'](function(){report[_0xe0db('0x3e')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x378189){logger[_0xe0db('0x3b')](_0xe0db('0x3f'),util[_0xe0db('0x3c')](_0x378189,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x9d16=['./rpc/integrations/salesforce','./rpc/integrations/freshdesk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','ami','get','hour','resolve','then','getAgents','initAgents','initTelephones','initTrunks','getVoiceQueues','initTriggers','initTemplates','getZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','getFaxAccounts','initFaxAccounts','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','[index.js][initParams]','inspect','listen','sync','[index.js][main]','bluebird','util','moment','./server','./realtime','./report','./acw','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk'];(function(_0x5ecb65,_0x150439){var _0x32c120=function(_0x566a76){while(--_0x566a76){_0x5ecb65['push'](_0x5ecb65['shift']());}};_0x32c120(++_0x150439);}(_0x9d16,0x77));var _0x69d1=function(_0x128bef,_0xc7a0af){_0x128bef=_0x128bef-0x0;var _0x1ba862=_0x9d16[_0x128bef];return _0x1ba862;};'use strict';var BPromise=require(_0x69d1('0x0'));var util=require(_0x69d1('0x1'));var moment=require(_0x69d1('0x2'));var server=require(_0x69d1('0x3'));var Realtime=require(_0x69d1('0x4'));var Report=require(_0x69d1('0x5'));var Acw=require(_0x69d1('0x6'));var Trigger=require('./trigger');var Dialer=require(_0x69d1('0x7'));var Preview=require(_0x69d1('0x8'));var Fax=require(_0x69d1('0x9'));var user=require(_0x69d1('0xa'));var voiceQueue=require(_0x69d1('0xb'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x69d1('0xc'));var trigger=require(_0x69d1('0xd'));var template=require(_0x69d1('0xe'));var cmHopperHistory=require(_0x69d1('0xf'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0x69d1('0x10'));var faxAccount=require(_0x69d1('0x11'));var zendesk=require(_0x69d1('0x12'));var salesforce=require(_0x69d1('0x13'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require(_0x69d1('0x14'));var desk=require('./rpc/integrations/desk');var zoho=require(_0x69d1('0x15'));var vtiger=require(_0x69d1('0x16'));var freshsales=require(_0x69d1('0x17'));var servicenow=require(_0x69d1('0x18'));var dynamics365=require('./rpc/integrations/dynamics365');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('../../config/logger')(_0x69d1('0x19'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x69d1('0x1a')](_0x69d1('0x1b'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x69d1('0x1a')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x69d1('0x1c')]()[_0x69d1('0x1d')](user[_0x69d1('0x1e')]())['then'](realtime[_0x69d1('0x1f')]())[_0x69d1('0x1d')](user['getTelephones']())['then'](realtime[_0x69d1('0x20')]())[_0x69d1('0x1d')](trunk['getTrunks']())[_0x69d1('0x1d')](realtime[_0x69d1('0x21')]())[_0x69d1('0x1d')](voiceQueue[_0x69d1('0x22')]())[_0x69d1('0x1d')](realtime['initVoiceQueues']())[_0x69d1('0x1d')](trigger['getTriggers']())[_0x69d1('0x1d')](realtime[_0x69d1('0x23')]())['then'](template['getTemplates']())[_0x69d1('0x1d')](realtime[_0x69d1('0x24')]())[_0x69d1('0x1d')](zendesk[_0x69d1('0x25')]())['then'](realtime['initZendeskAccounts']())['then'](salesforce['getSalesforceAccounts']())['then'](realtime[_0x69d1('0x26')]())['then'](sugarcrm[_0x69d1('0x27')]())['then'](realtime[_0x69d1('0x28')]())[_0x69d1('0x1d')](freshdesk[_0x69d1('0x29')]())[_0x69d1('0x1d')](realtime[_0x69d1('0x2a')]())[_0x69d1('0x1d')](desk['getDeskAccounts']())[_0x69d1('0x1d')](realtime['initDeskAccounts']())['then'](zoho['getZohoAccounts']())[_0x69d1('0x1d')](realtime[_0x69d1('0x2b')]())[_0x69d1('0x1d')](vtiger[_0x69d1('0x2c')]())['then'](realtime[_0x69d1('0x2d')]())[_0x69d1('0x1d')](freshsales['getFreshsalesAccounts']())['then'](realtime[_0x69d1('0x2e')]())[_0x69d1('0x1d')](servicenow[_0x69d1('0x2f')]())[_0x69d1('0x1d')](realtime[_0x69d1('0x30')]())['then'](dynamics365['getDynamics365Accounts']())[_0x69d1('0x1d')](realtime[_0x69d1('0x31')]())[_0x69d1('0x1d')](campaign[_0x69d1('0x32')]())[_0x69d1('0x1d')](realtime[_0x69d1('0x33')]())['then'](voiceExtension[_0x69d1('0x34')]())[_0x69d1('0x1d')](realtime['initVoiceExtensions']())['then'](faxAccount[_0x69d1('0x35')]())[_0x69d1('0x1d')](realtime[_0x69d1('0x36')]())[_0x69d1('0x1d')](function(){return realtime;});}function initParams(){return BPromise[_0x69d1('0x1c')]()[_0x69d1('0x1d')](voiceQueueReport['getVoiceQueueReports']())['then'](realtime[_0x69d1('0x37')]())['then'](cmHopperHistory[_0x69d1('0x38')]())['then'](realtime[_0x69d1('0x39')]())[_0x69d1('0x1d')](cmHopperHistory[_0x69d1('0x3a')]())['then'](realtime[_0x69d1('0x3b')]())[_0x69d1('0x1d')](voiceCallReport[_0x69d1('0x3c')]())[_0x69d1('0x1d')](realtime[_0x69d1('0x3d')]())[_0x69d1('0x3e')](function(_0x126dc1){logger[_0x69d1('0x3f')](_0x69d1('0x40'),util[_0x69d1('0x41')](_0x126dc1,{'showHidden':![],'depth':null}));});}function main(){return server[_0x69d1('0x42')](realtime,preview,fax)[_0x69d1('0x1d')](function(_0x196379){return initRealtime();})['then'](function(){return initParams();})[_0x69d1('0x1d')](function(){report[_0x69d1('0x43')]();setInterval(initRealtime,0x1388);})[_0x69d1('0x3e')](function(_0x36d48d){logger['error'](_0x69d1('0x44'),util[_0x69d1('0x41')](_0x36d48d,{'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 2119391..1776a88 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 _0xcb91=['name','email','accountcode','fullname','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusQueue','onhold','local','updateStatusRealtime','state','idle','inuse','talking','statePause','voiceStatusTime','toNumber','voiceStatusCallerIdNumber','stringify','format','emit','user:presence','exports','moment','md5','ioredis','../../../config/environment','defaults','redis','socket.io-emitter'];(function(_0x4dfb6f,_0x1b143f){var _0x36c798=function(_0x3cd724){while(--_0x3cd724){_0x4dfb6f['push'](_0x4dfb6f['shift']());}};_0x36c798(++_0x1b143f);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4ec9e3,_0x15fbf4){_0x4ec9e3=_0x4ec9e3-0x0;var _0x2883ce=_0xcb91[_0x4ec9e3];return _0x2883ce;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var md5=require(_0x1cb9('0x1'));var Redis=require(_0x1cb9('0x2'));var config=require(_0x1cb9('0x3'));config['redis']=_[_0x1cb9('0x4')](config[_0x1cb9('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x1cb9('0x6'))(new Redis(config[_0x1cb9('0x5')]));function Agent(_0x53ffbd){this['id']=_0x53ffbd['id']||0x0;this[_0x1cb9('0x7')]=_0x53ffbd[_0x1cb9('0x7')]||'';this['email']=_0x53ffbd[_0x1cb9('0x8')]||'';this[_0x1cb9('0x9')]=_0x53ffbd['accountcode']||'';this[_0x1cb9('0xa')]=_0x53ffbd['fullname']||'';this['state']=_0x1cb9('0xb');this[_0x1cb9('0xc')]=0x0;this[_0x1cb9('0xd')]=_0x1cb9('0xb');this[_0x1cb9('0xe')]='';this['phone']='';this[_0x1cb9('0xf')]='';this[_0x1cb9('0x10')]='';this[_0x1cb9('0x11')]=_0x53ffbd[_0x1cb9('0x11')]||![];this[_0x1cb9('0x12')]='unknown';this['voiceStatusTime']=0x0;this['voiceStatusCallerIdNumber']='';this[_0x1cb9('0x13')]='';this[_0x1cb9('0x14')]=![];this[_0x1cb9('0x15')]=![];this[_0x1cb9('0x1')]='';}Agent['prototype'][_0x1cb9('0x16')]=function(_0x6ef389){var _0x1b3cd7;if(_0x6ef389&&_0x6ef389[_0x1cb9('0x17')]){_0x1b3cd7=_0x6ef389[_0x1cb9('0x17')]['toLowerCase']();switch(_0x1b3cd7){case'not_inuse':_0x1b3cd7=_0x1cb9('0x18');break;case _0x1cb9('0x19'):_0x1b3cd7=_0x1cb9('0x1a');break;}}if(_0x1b3cd7&&this[_0x1cb9('0x12')]!==_0x1b3cd7||_0x6ef389[_0x1cb9('0x1b')]){this[_0x1cb9('0x1c')]=_[_0x1cb9('0x1d')](moment()['format']('x'));}if(_0x1b3cd7){this['voiceStatus']=_0x1b3cd7;}var _0x1b2fa6={'id':this['id'],'name':this[_0x1cb9('0x7')],'email':this[_0x1cb9('0x8')],'accountcode':this[_0x1cb9('0x9')],'fullname':this[_0x1cb9('0xa')],'state':this[_0x1cb9('0x17')],'stateTime':this[_0x1cb9('0xc')],'status':this['status'],'address':this['address'],'online':this[_0x1cb9('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x1cb9('0x1c')],'voiceStatusCallerIdNumber':this[_0x1cb9('0x1e')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this['interface'],'onhold':this[_0x1cb9('0x14')]};var _0x325637=md5(JSON[_0x1cb9('0x1f')](_0x1b2fa6));if(this[_0x1cb9('0x1')]!==_0x325637){this[_0x1cb9('0x1')]=_0x325637;io['to'](util[_0x1cb9('0x20')]('user:%s',_0x1b2fa6['name']))[_0x1cb9('0x21')]('user:save',_0x1b2fa6);io[_0x1cb9('0x21')](_0x1cb9('0x22'),_0x1b2fa6);}};module[_0x1cb9('0x23')]=Agent; \ No newline at end of file +var _0xcb91=['name','email','accountcode','fullname','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusQueue','onhold','local','updateStatusRealtime','state','idle','inuse','talking','statePause','voiceStatusTime','toNumber','voiceStatusCallerIdNumber','stringify','format','emit','user:presence','exports','moment','md5','ioredis','../../../config/environment','defaults','redis','socket.io-emitter'];(function(_0x45b57a,_0x550aec){var _0x2dee78=function(_0x29aaf1){while(--_0x29aaf1){_0x45b57a['push'](_0x45b57a['shift']());}};_0x2dee78(++_0x550aec);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x215dc8,_0x52c245){_0x215dc8=_0x215dc8-0x0;var _0x583ea3=_0xcb91[_0x215dc8];return _0x583ea3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var md5=require(_0x1cb9('0x1'));var Redis=require(_0x1cb9('0x2'));var config=require(_0x1cb9('0x3'));config['redis']=_[_0x1cb9('0x4')](config[_0x1cb9('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x1cb9('0x6'))(new Redis(config[_0x1cb9('0x5')]));function Agent(_0x53ffbd){this['id']=_0x53ffbd['id']||0x0;this[_0x1cb9('0x7')]=_0x53ffbd[_0x1cb9('0x7')]||'';this['email']=_0x53ffbd[_0x1cb9('0x8')]||'';this[_0x1cb9('0x9')]=_0x53ffbd['accountcode']||'';this[_0x1cb9('0xa')]=_0x53ffbd['fullname']||'';this['state']=_0x1cb9('0xb');this[_0x1cb9('0xc')]=0x0;this[_0x1cb9('0xd')]=_0x1cb9('0xb');this[_0x1cb9('0xe')]='';this['phone']='';this[_0x1cb9('0xf')]='';this[_0x1cb9('0x10')]='';this[_0x1cb9('0x11')]=_0x53ffbd[_0x1cb9('0x11')]||![];this[_0x1cb9('0x12')]='unknown';this['voiceStatusTime']=0x0;this['voiceStatusCallerIdNumber']='';this[_0x1cb9('0x13')]='';this[_0x1cb9('0x14')]=![];this[_0x1cb9('0x15')]=![];this[_0x1cb9('0x1')]='';}Agent['prototype'][_0x1cb9('0x16')]=function(_0x6ef389){var _0x1b3cd7;if(_0x6ef389&&_0x6ef389[_0x1cb9('0x17')]){_0x1b3cd7=_0x6ef389[_0x1cb9('0x17')]['toLowerCase']();switch(_0x1b3cd7){case'not_inuse':_0x1b3cd7=_0x1cb9('0x18');break;case _0x1cb9('0x19'):_0x1b3cd7=_0x1cb9('0x1a');break;}}if(_0x1b3cd7&&this[_0x1cb9('0x12')]!==_0x1b3cd7||_0x6ef389[_0x1cb9('0x1b')]){this[_0x1cb9('0x1c')]=_[_0x1cb9('0x1d')](moment()['format']('x'));}if(_0x1b3cd7){this['voiceStatus']=_0x1b3cd7;}var _0x1b2fa6={'id':this['id'],'name':this[_0x1cb9('0x7')],'email':this[_0x1cb9('0x8')],'accountcode':this[_0x1cb9('0x9')],'fullname':this[_0x1cb9('0xa')],'state':this[_0x1cb9('0x17')],'stateTime':this[_0x1cb9('0xc')],'status':this['status'],'address':this['address'],'online':this[_0x1cb9('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x1cb9('0x1c')],'voiceStatusCallerIdNumber':this[_0x1cb9('0x1e')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this['interface'],'onhold':this[_0x1cb9('0x14')]};var _0x325637=md5(JSON[_0x1cb9('0x1f')](_0x1b2fa6));if(this[_0x1cb9('0x1')]!==_0x325637){this[_0x1cb9('0x1')]=_0x325637;io['to'](util[_0x1cb9('0x20')]('user:%s',_0x1b2fa6['name']))[_0x1cb9('0x21')]('user:save',_0x1b2fa6);io[_0x1cb9('0x21')](_0x1cb9('0x22'),_0x1b2fa6);}};module[_0x1cb9('0x23')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index c571e39..bc93760 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 _0x04eb=['dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','message','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency'];(function(_0x3e4a13,_0x377dd2){var _0x479175=function(_0x5bb8df){while(--_0x5bb8df){_0x3e4a13['push'](_0x3e4a13['shift']());}};_0x479175(++_0x377dd2);}(_0x04eb,0x14e));var _0xb04e=function(_0x53b243,_0x2703ff){_0x53b243=_0x53b243-0x0;var _0x389a88=_0x04eb[_0x53b243];return _0x389a88;};'use strict';function Campaign(_0x155bee){this['id']=_0x155bee['id']||0x0;this[_0xb04e('0x0')]=_0x155bee[_0xb04e('0x0')]||'';this[_0xb04e('0x1')]=_0x155bee[_0xb04e('0x1')]||_0xb04e('0x2');this[_0xb04e('0x3')]=0x0;this[_0xb04e('0x4')]=0x0;this[_0xb04e('0x5')]=0x0;this['ivrTotalCallsDays']=0x0;this[_0xb04e('0x6')]='';this['sendMessageOneNotActive']=!![];this[_0xb04e('0x7')]=_0x155bee['active'];this[_0xb04e('0x8')]=_0x155bee[_0xb04e('0x8')];this[_0xb04e('0x9')]=_0x155bee[_0xb04e('0x9')]||null;this[_0xb04e('0xa')]=_0x155bee[_0xb04e('0xa')]?_0x155bee[_0xb04e('0xa')]:null;this['dialOriginateCallerIdName']=_0x155bee[_0xb04e('0xb')];this[_0xb04e('0xc')]=_0x155bee[_0xb04e('0xc')];this[_0xb04e('0xd')]=_0x155bee[_0xb04e('0xd')]||0x1e;this[_0xb04e('0xe')]=_0x155bee[_0xb04e('0xe')];this[_0xb04e('0xf')]=_0x155bee['dialCongestionRetryFrequency'];this[_0xb04e('0x10')]=_0x155bee[_0xb04e('0x10')];this[_0xb04e('0x11')]=_0x155bee[_0xb04e('0x11')];this['dialNoAnswerMaxRetry']=_0x155bee[_0xb04e('0x12')];this['dialNoAnswerRetryFrequency']=_0x155bee[_0xb04e('0x13')];this[_0xb04e('0x14')]=_0x155bee['dialGlobalMaxRetry'];this[_0xb04e('0x15')]=_0x155bee['dialNoSuchNumberMaxRetry']||0x3;this[_0xb04e('0x16')]=_0x155bee[_0xb04e('0x16')]||0x96;this['dialDropMaxRetry']=_0x155bee[_0xb04e('0x17')]||0x3;this['dialDropRetryFrequency']=_0x155bee['dialDropRetryFrequency']||0x96;this[_0xb04e('0x18')]=_0x155bee[_0xb04e('0x18')]||0x3;this['dialAbandonedRetryFrequency']=_0x155bee[_0xb04e('0x19')]||0x96;this['dialMachineMaxRetry']=_0x155bee['dialMachineMaxRetry']||0x3;this['dialMachineRetryFrequency']=_0x155bee[_0xb04e('0x1a')]||0x96;this[_0xb04e('0x1b')]=_0x155bee[_0xb04e('0x1b')]||0x3;this[_0xb04e('0x1c')]=_0x155bee[_0xb04e('0x1c')]||0x96;this[_0xb04e('0x1d')]=_0x155bee[_0xb04e('0x1d')]||_0xb04e('0x1e');this[_0xb04e('0x1f')]=_0x155bee['dialPrefix']||undefined;this[_0xb04e('0x20')]=_0x155bee[_0xb04e('0x20')]||undefined;this[_0xb04e('0x21')]=_0x155bee['dialCutDigit']||undefined;this[_0xb04e('0x22')]=_0x155bee[_0xb04e('0x22')]?_0x155bee[_0xb04e('0x22')]:undefined;this[_0xb04e('0x23')]=_0x155bee['Trunk']?_0x155bee[_0xb04e('0x23')]:undefined;this[_0xb04e('0x24')]=_0x155bee[_0xb04e('0x24')]?_0x155bee['Interval']:undefined;this[_0xb04e('0x25')]=_0x155bee[_0xb04e('0x25')]?_0x155bee[_0xb04e('0x25')]:undefined;this[_0xb04e('0x26')]=_0x155bee[_0xb04e('0x25')]?_0x155bee[_0xb04e('0x25')][_0xb04e('0x0')]:undefined;this[_0xb04e('0x27')]=_0x155bee[_0xb04e('0x27')]||![];this[_0xb04e('0x28')]=_0x155bee['dialAMDInitialSilence'];this[_0xb04e('0x29')]=_0x155bee[_0xb04e('0x29')];this['dialAMDAfterGreetingSilence']=_0x155bee[_0xb04e('0x2a')];this['dialAMDTotalAnalysisTime']=_0x155bee[_0xb04e('0x2b')];this[_0xb04e('0x2c')]=_0x155bee[_0xb04e('0x2c')];this[_0xb04e('0x2d')]=_0x155bee['dialAMDBetweenWordsSilence'];this[_0xb04e('0x2e')]=_0x155bee['dialAMDMaximumNumberOfWords'];this[_0xb04e('0x2f')]=_0x155bee['dialAMDSilenceThreshold'];this[_0xb04e('0x30')]=_0x155bee['dialAMDMaximumWordLength'];}module[_0xb04e('0x31')]=Campaign; \ No newline at end of file +var _0x3e39=['dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','originated','temp','ivrAnswerCallsDay','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency'];(function(_0x514867,_0xbc5f43){var _0x3a1b64=function(_0x4d66c4){while(--_0x4d66c4){_0x514867['push'](_0x514867['shift']());}};_0x3a1b64(++_0xbc5f43);}(_0x3e39,0x187));var _0x93e3=function(_0x531935,_0x3ffdbe){_0x531935=_0x531935-0x0;var _0x310ae9=_0x3e39[_0x531935];return _0x310ae9;};'use strict';function Campaign(_0xe033a0){this['id']=_0xe033a0['id']||0x0;this['name']=_0xe033a0[_0x93e3('0x0')]||'';this['type']=_0xe033a0[_0x93e3('0x1')]||'campaign';this[_0x93e3('0x2')]=0x0;this[_0x93e3('0x3')]=0x0;this[_0x93e3('0x4')]=0x0;this['ivrTotalCallsDays']=0x0;this[_0x93e3('0x5')]='';this[_0x93e3('0x6')]=!![];this[_0x93e3('0x7')]=_0xe033a0['active'];this[_0x93e3('0x8')]=_0xe033a0[_0x93e3('0x8')];this[_0x93e3('0x9')]=_0xe033a0[_0x93e3('0x9')]||null;this[_0x93e3('0xa')]=_0xe033a0[_0x93e3('0xa')]?_0xe033a0[_0x93e3('0xa')]:null;this['dialOriginateCallerIdName']=_0xe033a0[_0x93e3('0xb')];this[_0x93e3('0xc')]=_0xe033a0[_0x93e3('0xc')];this[_0x93e3('0xd')]=_0xe033a0[_0x93e3('0xd')]||0x1e;this['dialCongestionMaxRetry']=_0xe033a0[_0x93e3('0xe')];this[_0x93e3('0xf')]=_0xe033a0[_0x93e3('0xf')];this[_0x93e3('0x10')]=_0xe033a0[_0x93e3('0x10')];this['dialBusyRetryFrequency']=_0xe033a0[_0x93e3('0x11')];this[_0x93e3('0x12')]=_0xe033a0[_0x93e3('0x12')];this[_0x93e3('0x13')]=_0xe033a0[_0x93e3('0x13')];this[_0x93e3('0x14')]=_0xe033a0[_0x93e3('0x14')];this[_0x93e3('0x15')]=_0xe033a0[_0x93e3('0x15')]||0x3;this[_0x93e3('0x16')]=_0xe033a0[_0x93e3('0x16')]||0x96;this['dialDropMaxRetry']=_0xe033a0['dialDropMaxRetry']||0x3;this[_0x93e3('0x17')]=_0xe033a0[_0x93e3('0x17')]||0x96;this[_0x93e3('0x18')]=_0xe033a0['dialAbandonedMaxRetry']||0x3;this[_0x93e3('0x19')]=_0xe033a0['dialAbandonedRetryFrequency']||0x96;this[_0x93e3('0x1a')]=_0xe033a0['dialMachineMaxRetry']||0x3;this[_0x93e3('0x1b')]=_0xe033a0[_0x93e3('0x1b')]||0x96;this['dialAgentRejectMaxRetry']=_0xe033a0[_0x93e3('0x1c')]||0x3;this[_0x93e3('0x1d')]=_0xe033a0['dialAgentRejectRetryFrequency']||0x96;this[_0x93e3('0x1e')]=_0xe033a0['dialOrderByScheduledAt']||'DESC';this[_0x93e3('0x1f')]=_0xe033a0[_0x93e3('0x1f')]||undefined;this[_0x93e3('0x20')]=_0xe033a0[_0x93e3('0x20')]||undefined;this[_0x93e3('0x21')]=_0xe033a0[_0x93e3('0x21')]||undefined;this[_0x93e3('0x22')]=_0xe033a0[_0x93e3('0x22')]?_0xe033a0[_0x93e3('0x22')]:undefined;this[_0x93e3('0x23')]=_0xe033a0[_0x93e3('0x23')]?_0xe033a0[_0x93e3('0x23')]:undefined;this['Interval']=_0xe033a0[_0x93e3('0x24')]?_0xe033a0[_0x93e3('0x24')]:undefined;this['SquareProject']=_0xe033a0[_0x93e3('0x25')]?_0xe033a0['SquareProject']:undefined;this[_0x93e3('0x26')]=_0xe033a0[_0x93e3('0x25')]?_0xe033a0[_0x93e3('0x25')][_0x93e3('0x0')]:undefined;this[_0x93e3('0x27')]=_0xe033a0[_0x93e3('0x27')]||![];this['dialAMDInitialSilence']=_0xe033a0['dialAMDInitialSilence'];this[_0x93e3('0x28')]=_0xe033a0[_0x93e3('0x28')];this[_0x93e3('0x29')]=_0xe033a0[_0x93e3('0x29')];this[_0x93e3('0x2a')]=_0xe033a0[_0x93e3('0x2a')];this['dialAMDMinWordLength']=_0xe033a0['dialAMDMinWordLength'];this[_0x93e3('0x2b')]=_0xe033a0[_0x93e3('0x2b')];this['dialAMDMaximumNumberOfWords']=_0xe033a0['dialAMDMaximumNumberOfWords'];this['dialAMDSilenceThreshold']=_0xe033a0[_0x93e3('0x2c')];this[_0x93e3('0x2d')]=_0xe033a0[_0x93e3('0x2d')];}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 34172e7..b1a5eec 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 _0xbd50=['monitorFilename','queue','monitors','transfercalleridnum','transferType','mohtime','exports','destinationchannel','calleridname','connectedlinenum','connectedlinename','uniqueid','linkedid','unmanaged','abandoned','lastapplication','duration','billableseconds','holdtime','type','tag','monitor'];(function(_0x1b0852,_0xdfff71){var _0x5003dd=function(_0x12505e){while(--_0x12505e){_0x1b0852['push'](_0x1b0852['shift']());}};_0x5003dd(++_0xdfff71);}(_0xbd50,0x151));var _0x0bd5=function(_0x370992,_0x339d10){_0x370992=_0x370992-0x0;var _0x185238=_0xbd50[_0x370992];return _0x185238;};'use strict';function Channel(){this['starttime']=null;this['channel']='';this[_0x0bd5('0x0')]='';this['calleridnum']=0x0;this[_0x0bd5('0x1')]='';this[_0x0bd5('0x2')]=undefined;this[_0x0bd5('0x3')]=undefined;this['accountcode']=0x0;this['context']='';this[_0x0bd5('0x4')]=0x0;this[_0x0bd5('0x5')]=0x0;this['exten']=0x0;this['answered']=![];this['answertime']=null;this['endtime']=null;this[_0x0bd5('0x6')]=![];this[_0x0bd5('0x7')]=![];this[_0x0bd5('0x8')]='';this['lastdata']='';this[_0x0bd5('0x9')]=0x0;this[_0x0bd5('0xa')]=0x0;this[_0x0bd5('0xb')]=0x0;this[_0x0bd5('0xc')]=null;this[_0x0bd5('0xd')]=null;this['disposition']=null;this[_0x0bd5('0xe')]=![];this[_0x0bd5('0xf')]=null;this[_0x0bd5('0x10')]=null;this[_0x0bd5('0x11')]=[];this[_0x0bd5('0x12')]=undefined;this['transferconnectedlinenum']=undefined;this[_0x0bd5('0x13')]=undefined;this[_0x0bd5('0x14')]=0x0;}module[_0x0bd5('0x15')]=Channel; \ No newline at end of file +var _0xeeeb=['monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','accountcode','exten','answered','answertime','endtime','unmanaged','abandoned','lastdata','holdtime','disposition','monitor','queue'];(function(_0x4ae50b,_0xa29a65){var _0x1a6d93=function(_0x59b2ec){while(--_0x59b2ec){_0x4ae50b['push'](_0x4ae50b['shift']());}};_0x1a6d93(++_0xa29a65);}(_0xeeeb,0x1bb));var _0xbeee=function(_0x10f330,_0x313a04){_0x10f330=_0x10f330-0x0;var _0x43bcf8=_0xeeeb[_0x10f330];return _0x43bcf8;};'use strict';function Channel(){this['starttime']=null;this[_0xbeee('0x0')]='';this[_0xbeee('0x1')]='';this[_0xbeee('0x2')]=0x0;this[_0xbeee('0x3')]='';this[_0xbeee('0x4')]=undefined;this['connectedlinename']=undefined;this[_0xbeee('0x5')]=0x0;this['context']='';this['uniqueid']=0x0;this['linkedid']=0x0;this[_0xbeee('0x6')]=0x0;this[_0xbeee('0x7')]=![];this[_0xbeee('0x8')]=null;this[_0xbeee('0x9')]=null;this[_0xbeee('0xa')]=![];this[_0xbeee('0xb')]=![];this['lastapplication']='';this[_0xbeee('0xc')]='';this['duration']=0x0;this['billableseconds']=0x0;this[_0xbeee('0xd')]=0x0;this['type']=null;this['tag']=null;this[_0xbeee('0xe')]=null;this[_0xbeee('0xf')]=![];this['monitorFilename']=null;this[_0xbeee('0x10')]=null;this[_0xbeee('0x11')]=[];this[_0xbeee('0x12')]=undefined;this[_0xbeee('0x13')]=undefined;this[_0xbeee('0x14')]=undefined;this[_0xbeee('0x15')]=0x0;}module[_0xbeee('0x16')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index ea0a0a9..6a020ba 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 _0x014d=['consumerSecret','token','tokenSecret','type','serverUrl','exports','name','username','remoteUri','password','consumerKey'];(function(_0x59ece8,_0x199710){var _0x4a0548=function(_0x2f1eac){while(--_0x2f1eac){_0x59ece8['push'](_0x59ece8['shift']());}};_0x4a0548(++_0x199710);}(_0x014d,0xc1));var _0xd014=function(_0x46877c,_0x318ac6){_0x46877c=_0x46877c-0x0;var _0x1860b3=_0x014d[_0x46877c];return _0x1860b3;};'use strict';function DeskAccount(_0x4adef1){this['id']=_0x4adef1['id']||0x0;this[_0xd014('0x0')]=_0x4adef1[_0xd014('0x0')]||'';this[_0xd014('0x1')]=_0x4adef1[_0xd014('0x1')]||'';this[_0xd014('0x2')]=_0x4adef1[_0xd014('0x2')]||'';this['authType']=_0x4adef1['authType']||'';this[_0xd014('0x3')]=_0x4adef1['password']||'';this[_0xd014('0x4')]=_0x4adef1[_0xd014('0x4')]||'';this[_0xd014('0x5')]=_0x4adef1[_0xd014('0x5')]||'';this[_0xd014('0x6')]=_0x4adef1[_0xd014('0x6')]||'';this[_0xd014('0x7')]=_0x4adef1['tokenSecret']||'';this[_0xd014('0x8')]=_0x4adef1[_0xd014('0x8')]||'';this['serverUrl']=_0x4adef1[_0xd014('0x9')]||'';this['Configurations']=_0x4adef1['Configurations']||{};}module[_0xd014('0xa')]=DeskAccount; \ No newline at end of file +var _0xba81=['type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret'];(function(_0x427971,_0x49677b){var _0x19e2de=function(_0x44aae5){while(--_0x44aae5){_0x427971['push'](_0x427971['shift']());}};_0x19e2de(++_0x49677b);}(_0xba81,0x1be));var _0x1ba8=function(_0x34b821,_0x504e55){_0x34b821=_0x34b821-0x0;var _0x5e00a0=_0xba81[_0x34b821];return _0x5e00a0;};'use strict';function DeskAccount(_0x568884){this['id']=_0x568884['id']||0x0;this[_0x1ba8('0x0')]=_0x568884[_0x1ba8('0x0')]||'';this[_0x1ba8('0x1')]=_0x568884['username']||'';this[_0x1ba8('0x2')]=_0x568884[_0x1ba8('0x2')]||'';this[_0x1ba8('0x3')]=_0x568884[_0x1ba8('0x3')]||'';this[_0x1ba8('0x4')]=_0x568884[_0x1ba8('0x4')]||'';this['consumerKey']=_0x568884[_0x1ba8('0x5')]||'';this[_0x1ba8('0x6')]=_0x568884[_0x1ba8('0x6')]||'';this['token']=_0x568884[_0x1ba8('0x7')]||'';this[_0x1ba8('0x8')]=_0x568884[_0x1ba8('0x8')]||'';this[_0x1ba8('0x9')]=_0x568884[_0x1ba8('0x9')]||'';this[_0x1ba8('0xa')]=_0x568884['serverUrl']||'';this[_0x1ba8('0xb')]=_0x568884[_0x1ba8('0xb')]||{};}module[_0x1ba8('0xc')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 7ca35e5..8cf6575 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 _0x774c=['tenantId','clientId','clientSecret','serverUrl','Configurations','exports','username','password','remoteUri'];(function(_0x3ab1ba,_0x2daf35){var _0xe7fa17=function(_0x2c4bde){while(--_0x2c4bde){_0x3ab1ba['push'](_0x3ab1ba['shift']());}};_0xe7fa17(++_0x2daf35);}(_0x774c,0x189));var _0xc774=function(_0x24d560,_0x2e0e7b){_0x24d560=_0x24d560-0x0;var _0x18f7b3=_0x774c[_0x24d560];return _0x18f7b3;};'use strict';function Dynamics365Account(_0x519607){this['id']=_0x519607['id']||0x0;this['name']=_0x519607['name']||'';this[_0xc774('0x0')]=_0x519607[_0xc774('0x0')]||'';this[_0xc774('0x1')]=_0x519607['password']||'';this[_0xc774('0x2')]=_0x519607['remoteUri']||'';this[_0xc774('0x3')]=_0x519607[_0xc774('0x3')]||'';this[_0xc774('0x4')]=_0x519607[_0xc774('0x4')]||'';this[_0xc774('0x5')]=_0x519607[_0xc774('0x5')]||{};this[_0xc774('0x6')]=_0x519607[_0xc774('0x6')]||'';this['modernAuthentication']=_0x519607['modernAuthentication']||![];this[_0xc774('0x7')]=_0x519607[_0xc774('0x7')]||{};this['CloudProvider']=_0x519607['CloudProvider']||{};}module[_0xc774('0x8')]=Dynamics365Account; \ No newline at end of file +var _0x4d1a=['remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports','name','username','password'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4d1a,0x1d1));var _0xa4d1=function(_0x29d23a,_0x220ab3){_0x29d23a=_0x29d23a-0x0;var _0x534f39=_0x4d1a[_0x29d23a];return _0x534f39;};'use strict';function Dynamics365Account(_0x1f6391){this['id']=_0x1f6391['id']||0x0;this[_0xa4d1('0x0')]=_0x1f6391[_0xa4d1('0x0')]||'';this[_0xa4d1('0x1')]=_0x1f6391['username']||'';this[_0xa4d1('0x2')]=_0x1f6391[_0xa4d1('0x2')]||'';this[_0xa4d1('0x3')]=_0x1f6391[_0xa4d1('0x3')]||'';this[_0xa4d1('0x4')]=_0x1f6391[_0xa4d1('0x4')]||'';this[_0xa4d1('0x5')]=_0x1f6391[_0xa4d1('0x5')]||'';this['clientSecret']=_0x1f6391[_0xa4d1('0x6')]||{};this[_0xa4d1('0x7')]=_0x1f6391[_0xa4d1('0x7')]||'';this['modernAuthentication']=_0x1f6391[_0xa4d1('0x8')]||![];this[_0xa4d1('0x9')]=_0x1f6391['Configurations']||{};this[_0xa4d1('0xa')]=_0x1f6391[_0xa4d1('0xa')]||{};}module[_0xa4d1('0xb')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index aea8de2..bc60dd1 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 _0x9ca0=['ecm','headerinfo','localstationid','minrate','maxrate','modem','gateway','faxdetect','t38timeout','tech','Trunk','ListId','key','name','description'];(function(_0x20f188,_0x31f63d){var _0x56ee8e=function(_0x3968cd){while(--_0x3968cd){_0x20f188['push'](_0x20f188['shift']());}};_0x56ee8e(++_0x31f63d);}(_0x9ca0,0x11b));var _0x09ca=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0x9ca0[_0x2f3848];return _0x102668;};'use strict';function FaxAccount(_0x1466f9){this['id']=_0x1466f9['id']||0x0;this[_0x09ca('0x0')]=_0x1466f9[_0x09ca('0x0')]||'';this[_0x09ca('0x1')]=_0x1466f9['description'];this[_0x09ca('0x2')]=_0x1466f9['ecm'];this['headerinfo']=_0x1466f9[_0x09ca('0x3')];this[_0x09ca('0x4')]=_0x1466f9[_0x09ca('0x4')];this['minrate']=_0x1466f9[_0x09ca('0x5')]||0x960;this['maxrate']=_0x1466f9[_0x09ca('0x6')]||0x3840;this[_0x09ca('0x7')]=_0x1466f9['modem']||'v17,v27,v29';this[_0x09ca('0x8')]=_0x1466f9['gateway']||'no';this[_0x09ca('0x9')]=_0x1466f9[_0x09ca('0x9')]||'no';this['t38timeout']=_0x1466f9[_0x09ca('0xa')]||0x1388;this['tech']=_0x1466f9[_0x09ca('0xb')]||'SIP';this[_0x09ca('0xc')]=_0x1466f9[_0x09ca('0xc')]?_0x1466f9[_0x09ca('0xc')]:undefined;this[_0x09ca('0xd')]=_0x1466f9[_0x09ca('0xd')];this[_0x09ca('0xe')]=_0x1466f9['key'];}module['exports']=FaxAccount; \ No newline at end of file +var _0xa936=['Trunk','ListId','exports','name','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP'];(function(_0x9b8b,_0x167145){var _0x586ac1=function(_0x3a1093){while(--_0x3a1093){_0x9b8b['push'](_0x9b8b['shift']());}};_0x586ac1(++_0x167145);}(_0xa936,0x183));var _0x6a93=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xa936[_0x57b54c];return _0x59cc19;};'use strict';function FaxAccount(_0x368666){this['id']=_0x368666['id']||0x0;this[_0x6a93('0x0')]=_0x368666['name']||'';this['description']=_0x368666['description'];this[_0x6a93('0x1')]=_0x368666[_0x6a93('0x1')];this[_0x6a93('0x2')]=_0x368666[_0x6a93('0x2')];this['localstationid']=_0x368666[_0x6a93('0x3')];this[_0x6a93('0x4')]=_0x368666[_0x6a93('0x4')]||0x960;this[_0x6a93('0x5')]=_0x368666[_0x6a93('0x5')]||0x3840;this[_0x6a93('0x6')]=_0x368666['modem']||_0x6a93('0x7');this[_0x6a93('0x8')]=_0x368666['gateway']||'no';this[_0x6a93('0x9')]=_0x368666[_0x6a93('0x9')]||'no';this[_0x6a93('0xa')]=_0x368666['t38timeout']||0x1388;this[_0x6a93('0xb')]=_0x368666['tech']||_0x6a93('0xc');this[_0x6a93('0xd')]=_0x368666['Trunk']?_0x368666[_0x6a93('0xd')]:undefined;this[_0x6a93('0xe')]=_0x368666[_0x6a93('0xe')];this['key']=_0x368666['key'];}module[_0x6a93('0xf')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 99d25bd..53658f9 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 _0x2cd2=['name','username','apiKey','token','remoteUri','serverUrl','Configurations','exports'];(function(_0x36a26f,_0x49e6de){var _0x5bd70d=function(_0x5f5a65){while(--_0x5f5a65){_0x36a26f['push'](_0x36a26f['shift']());}};_0x5bd70d(++_0x49e6de);}(_0x2cd2,0x160));var _0x22cd=function(_0x32900a,_0x6fbf0f){_0x32900a=_0x32900a-0x0;var _0x583ba1=_0x2cd2[_0x32900a];return _0x583ba1;};'use strict';function FreshdeskAccount(_0x94fe24){this['id']=_0x94fe24['id']||0x0;this[_0x22cd('0x0')]=_0x94fe24[_0x22cd('0x0')]||'';this[_0x22cd('0x1')]=_0x94fe24[_0x22cd('0x1')]||'';this[_0x22cd('0x2')]=_0x94fe24[_0x22cd('0x3')]||'';this[_0x22cd('0x4')]=_0x94fe24[_0x22cd('0x4')]||'';this[_0x22cd('0x5')]=_0x94fe24[_0x22cd('0x5')]||'';this[_0x22cd('0x6')]=_0x94fe24[_0x22cd('0x6')]||{};}module[_0x22cd('0x7')]=FreshdeskAccount; \ No newline at end of file +var _0xcb5a=['apiKey','token','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x210afd,_0xfdbbce){var _0x44e252=function(_0x2ac6a5){while(--_0x2ac6a5){_0x210afd['push'](_0x210afd['shift']());}};_0x44e252(++_0xfdbbce);}(_0xcb5a,0x14e));var _0xacb5=function(_0x6e2772,_0x1c0255){_0x6e2772=_0x6e2772-0x0;var _0x3c6b98=_0xcb5a[_0x6e2772];return _0x3c6b98;};'use strict';function FreshdeskAccount(_0x561aa2){this['id']=_0x561aa2['id']||0x0;this[_0xacb5('0x0')]=_0x561aa2[_0xacb5('0x0')]||'';this[_0xacb5('0x1')]=_0x561aa2[_0xacb5('0x1')]||'';this[_0xacb5('0x2')]=_0x561aa2[_0xacb5('0x3')]||'';this['remoteUri']=_0x561aa2[_0xacb5('0x4')]||'';this['serverUrl']=_0x561aa2[_0xacb5('0x5')]||'';this[_0xacb5('0x6')]=_0x561aa2[_0xacb5('0x6')]||{};}module[_0xacb5('0x7')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index fbc3e4d..eb174f6 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 _0x9305=['Configurations','exports','name','username','apiKey','token','remoteUri','serverUrl'];(function(_0x15a8fa,_0x4652b2){var _0x1355c2=function(_0x203292){while(--_0x203292){_0x15a8fa['push'](_0x15a8fa['shift']());}};_0x1355c2(++_0x4652b2);}(_0x9305,0x1e2));var _0x5930=function(_0x340e55,_0x589a3c){_0x340e55=_0x340e55-0x0;var _0x33ad3b=_0x9305[_0x340e55];return _0x33ad3b;};'use strict';function FreshsalesAccount(_0x2a1952){this['id']=_0x2a1952['id']||0x0;this[_0x5930('0x0')]=_0x2a1952[_0x5930('0x0')]||'';this[_0x5930('0x1')]=_0x2a1952['username']||'';this[_0x5930('0x2')]=_0x2a1952[_0x5930('0x3')]||'';this[_0x5930('0x4')]=_0x2a1952[_0x5930('0x4')]||'';this['serverUrl']=_0x2a1952[_0x5930('0x5')]||'';this[_0x5930('0x6')]=_0x2a1952[_0x5930('0x6')]||{};}module[_0x5930('0x7')]=FreshsalesAccount; \ No newline at end of file +var _0x1b69=['remoteUri','serverUrl','Configurations','exports','username','apiKey'];(function(_0x50c7d6,_0x43aaed){var _0x4e1b11=function(_0x247a15){while(--_0x247a15){_0x50c7d6['push'](_0x50c7d6['shift']());}};_0x4e1b11(++_0x43aaed);}(_0x1b69,0x190));var _0x91b6=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0x1b69[_0x3de8a4];return _0x4635cf;};'use strict';function FreshsalesAccount(_0x4ec0c0){this['id']=_0x4ec0c0['id']||0x0;this['name']=_0x4ec0c0['name']||'';this[_0x91b6('0x0')]=_0x4ec0c0[_0x91b6('0x0')]||'';this[_0x91b6('0x1')]=_0x4ec0c0['token']||'';this[_0x91b6('0x2')]=_0x4ec0c0[_0x91b6('0x2')]||'';this[_0x91b6('0x3')]=_0x4ec0c0[_0x91b6('0x3')]||'';this[_0x91b6('0x4')]=_0x4ec0c0[_0x91b6('0x4')]||{};}module[_0x91b6('0x5')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index c35cee3..03be7f4 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 _0xb332=['position','count','queuecallerabandon','queuecallercomplete','originalposition','channel','connectedlinenum','accountcode','context','exten','priority','assigned','motionChannel','voice','variables','exports','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt'];(function(_0x2e08cb,_0x3987c8){var _0x223e9d=function(_0x16b5d0){while(--_0x16b5d0){_0x2e08cb['push'](_0x2e08cb['shift']());}};_0x223e9d(++_0x3987c8);}(_0xb332,0x15a));var _0x2b33=function(_0x15af0f,_0x5454ce){_0x15af0f=_0x15af0f-0x0;var _0x2bd1cb=_0xb332[_0x15af0f];return _0x2bd1cb;};'use strict';function QueueReport(){this['type']='inbound';this[_0x2b33('0x0')]='';this[_0x2b33('0x1')]='';this[_0x2b33('0x2')]='';this[_0x2b33('0x3')]='';this[_0x2b33('0x4')]=null;this[_0x2b33('0x5')]=null;this[_0x2b33('0x6')]=0x1;this[_0x2b33('0x7')]=0x1;this[_0x2b33('0x8')]=![];this['queuecallerabandonAt']=null;this[_0x2b33('0x9')]=![];this['queuecallercompleteAt']=null;this['queuecallerexit']=![];this['queuecallerexitAt']=null;this[_0x2b33('0xa')]=0x1;this[_0x2b33('0xb')]='';this[_0x2b33('0xc')]='';this['connectedlinename']='';this[_0x2b33('0xd')]='';this[_0x2b33('0xe')]='';this[_0x2b33('0xf')]='';this[_0x2b33('0x10')]='';this['holdtime']=0x0;this[_0x2b33('0x11')]=![];this['lastAssignedTo']='';this[_0x2b33('0x12')]=_0x2b33('0x13');this['mohtime']=0x0;this[_0x2b33('0x14')]={};}module[_0x2b33('0x15')]=QueueReport; \ No newline at end of file +var _0xb58a=['priority','holdtime','lastAssignedTo','motionChannel','exports','type','inbound','calleridnum','calleridname','queue','queuecallerjoinAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallerexit','channel','connectedlinenum','connectedlinename','accountcode','context','exten'];(function(_0x48a96f,_0x530059){var _0x3ff3ef=function(_0x286059){while(--_0x286059){_0x48a96f['push'](_0x48a96f['shift']());}};_0x3ff3ef(++_0x530059);}(_0xb58a,0x1a3));var _0xab58=function(_0x5c2a2b,_0x22c94e){_0x5c2a2b=_0x5c2a2b-0x0;var _0x19921f=_0xb58a[_0x5c2a2b];return _0x19921f;};'use strict';function QueueReport(){this[_0xab58('0x0')]=_0xab58('0x1');this['uniqueid']='';this[_0xab58('0x2')]='';this[_0xab58('0x3')]='';this[_0xab58('0x4')]='';this[_0xab58('0x5')]=null;this['queuecallerleaveAt']=null;this[_0xab58('0x6')]=0x1;this[_0xab58('0x7')]=0x1;this[_0xab58('0x8')]=![];this[_0xab58('0x9')]=null;this[_0xab58('0xa')]=![];this['queuecallercompleteAt']=null;this[_0xab58('0xb')]=![];this['queuecallerexitAt']=null;this['originalposition']=0x1;this[_0xab58('0xc')]='';this[_0xab58('0xd')]='';this[_0xab58('0xe')]='';this[_0xab58('0xf')]='';this[_0xab58('0x10')]='';this[_0xab58('0x11')]='';this[_0xab58('0x12')]='';this[_0xab58('0x13')]=0x0;this['assigned']=![];this[_0xab58('0x14')]='';this[_0xab58('0x15')]='voice';this['mohtime']=0x0;this['variables']={};}module[_0xab58('0x16')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 8cd07d6..343a21c 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 _0x9333=['name','username','remoteUri','password','clientId','clientSecret','securityToken','serverUrl','Configurations','exports'];(function(_0x1106d6,_0x45d02b){var _0x60230f=function(_0x3fbf28){while(--_0x3fbf28){_0x1106d6['push'](_0x1106d6['shift']());}};_0x60230f(++_0x45d02b);}(_0x9333,0x122));var _0x3933=function(_0x7a0827,_0x257546){_0x7a0827=_0x7a0827-0x0;var _0x182dbc=_0x9333[_0x7a0827];return _0x182dbc;};'use strict';function SalesforceAccount(_0x391eba){this['id']=_0x391eba['id']||0x0;this[_0x3933('0x0')]=_0x391eba['name']||'';this['username']=_0x391eba[_0x3933('0x1')]||'';this[_0x3933('0x2')]=_0x391eba['remoteUri']||'';this['password']=_0x391eba[_0x3933('0x3')]||'';this[_0x3933('0x4')]=_0x391eba[_0x3933('0x4')]||'';this[_0x3933('0x5')]=_0x391eba[_0x3933('0x5')]||'';this['securityToken']=_0x391eba[_0x3933('0x6')]||'';this['type']=_0x391eba['type']||'integrationTab';this[_0x3933('0x7')]=_0x391eba[_0x3933('0x7')]||'';this[_0x3933('0x8')]=_0x391eba[_0x3933('0x8')]||{};}module[_0x3933('0x9')]=SalesforceAccount; \ No newline at end of file +var _0xbf6c=['serverUrl','Configurations','name','username','remoteUri','password','clientId','securityToken','type','integrationTab'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0xbf6c,0x1a6));var _0xcbf6=function(_0x687e1b,_0x5835b4){_0x687e1b=_0x687e1b-0x0;var _0x56c5fc=_0xbf6c[_0x687e1b];return _0x56c5fc;};'use strict';function SalesforceAccount(_0x3821a6){this['id']=_0x3821a6['id']||0x0;this[_0xcbf6('0x0')]=_0x3821a6['name']||'';this[_0xcbf6('0x1')]=_0x3821a6[_0xcbf6('0x1')]||'';this[_0xcbf6('0x2')]=_0x3821a6[_0xcbf6('0x2')]||'';this[_0xcbf6('0x3')]=_0x3821a6[_0xcbf6('0x3')]||'';this[_0xcbf6('0x4')]=_0x3821a6[_0xcbf6('0x4')]||'';this['clientSecret']=_0x3821a6['clientSecret']||'';this['securityToken']=_0x3821a6[_0xcbf6('0x5')]||'';this[_0xcbf6('0x6')]=_0x3821a6[_0xcbf6('0x6')]||_0xcbf6('0x7');this[_0xcbf6('0x8')]=_0x3821a6[_0xcbf6('0x8')]||'';this['Configurations']=_0x3821a6[_0xcbf6('0x9')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index e6a71c0..1fe0290 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 _0xa90a=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0xecb043,_0x20ccfb){var _0x23fb89=function(_0x34beb4){while(--_0x34beb4){_0xecb043['push'](_0xecb043['shift']());}};_0x23fb89(++_0x20ccfb);}(_0xa90a,0xd1));var _0xaa90=function(_0x393bf5,_0x225cac){_0x393bf5=_0x393bf5-0x0;var _0xcb023=_0xa90a[_0x393bf5];return _0xcb023;};'use strict';function ServicenowAccount(_0x5e1233){this['id']=_0x5e1233['id']||0x0;this[_0xaa90('0x0')]=_0x5e1233[_0xaa90('0x0')]||'';this[_0xaa90('0x1')]=_0x5e1233[_0xaa90('0x1')]||'';this[_0xaa90('0x2')]=_0x5e1233[_0xaa90('0x2')]||'';this['remoteUri']=_0x5e1233[_0xaa90('0x3')]||'';this[_0xaa90('0x4')]=_0x5e1233[_0xaa90('0x4')]||'';this[_0xaa90('0x5')]=_0x5e1233[_0xaa90('0x5')]||{};}module[_0xaa90('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x5259=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0xbad45c,_0x1ddc99){var _0x261692=function(_0x1bbdf9){while(--_0x1bbdf9){_0xbad45c['push'](_0xbad45c['shift']());}};_0x261692(++_0x1ddc99);}(_0x5259,0x9c));var _0x9525=function(_0xd2f4ac,_0x5aa8e5){_0xd2f4ac=_0xd2f4ac-0x0;var _0x9757b2=_0x5259[_0xd2f4ac];return _0x9757b2;};'use strict';function ServicenowAccount(_0x237ba2){this['id']=_0x237ba2['id']||0x0;this[_0x9525('0x0')]=_0x237ba2[_0x9525('0x0')]||'';this['username']=_0x237ba2[_0x9525('0x1')]||'';this['password']=_0x237ba2[_0x9525('0x2')]||'';this[_0x9525('0x3')]=_0x237ba2[_0x9525('0x3')]||'';this[_0x9525('0x4')]=_0x237ba2[_0x9525('0x4')]||'';this['Configurations']=_0x237ba2[_0x9525('0x5')]||{};}module[_0x9525('0x6')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 02373b1..358b28a 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 _0x899a=['remoteUri','serverUrl','Configurations','name','username','password'];(function(_0x43c0d8,_0x59449e){var _0x255aaf=function(_0x204b32){while(--_0x204b32){_0x43c0d8['push'](_0x43c0d8['shift']());}};_0x255aaf(++_0x59449e);}(_0x899a,0x1c5));var _0xa899=function(_0x44dbc3,_0xc86e24){_0x44dbc3=_0x44dbc3-0x0;var _0x16c50c=_0x899a[_0x44dbc3];return _0x16c50c;};'use strict';function SugarcrmAccount(_0x186630){this['id']=_0x186630['id']||0x0;this['name']=_0x186630[_0xa899('0x0')]||'';this['username']=_0x186630[_0xa899('0x1')]||'';this[_0xa899('0x2')]=_0x186630[_0xa899('0x2')]||'';this[_0xa899('0x3')]=_0x186630[_0xa899('0x3')]||'';this[_0xa899('0x4')]=_0x186630['serverUrl']||'';this[_0xa899('0x5')]=_0x186630['Configurations']||{};}module['exports']=SugarcrmAccount; \ No newline at end of file +var _0x4d1a=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x104a84,_0x285970){var _0x4973ff=function(_0x5064e7){while(--_0x5064e7){_0x104a84['push'](_0x104a84['shift']());}};_0x4973ff(++_0x285970);}(_0x4d1a,0x100));var _0xa4d1=function(_0x2904e8,_0x509a01){_0x2904e8=_0x2904e8-0x0;var _0x2a63f9=_0x4d1a[_0x2904e8];return _0x2a63f9;};'use strict';function SugarcrmAccount(_0x10a359){this['id']=_0x10a359['id']||0x0;this['name']=_0x10a359[_0xa4d1('0x0')]||'';this[_0xa4d1('0x1')]=_0x10a359[_0xa4d1('0x1')]||'';this['password']=_0x10a359[_0xa4d1('0x2')]||'';this[_0xa4d1('0x3')]=_0x10a359[_0xa4d1('0x3')]||'';this[_0xa4d1('0x4')]=_0x10a359[_0xa4d1('0x4')]||'';this[_0xa4d1('0x5')]=_0x10a359[_0xa4d1('0x5')]||{};}module[_0xa4d1('0x6')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index d23fa1e..5e56469 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 _0x33a5=['accountcode','unknown','stateTime','status','address','exports','name'];(function(_0x343d06,_0x536f11){var _0xd5d760=function(_0x1430b1){while(--_0x1430b1){_0x343d06['push'](_0x343d06['shift']());}};_0xd5d760(++_0x536f11);}(_0x33a5,0x180));var _0x533a=function(_0x2db4a4,_0x4255f8){_0x2db4a4=_0x2db4a4-0x0;var _0x19f839=_0x33a5[_0x2db4a4];return _0x19f839;};'use strict';function Telephone(_0x1d401c){this['id']=_0x1d401c['id']||0x0;this[_0x533a('0x0')]=_0x1d401c[_0x533a('0x0')]||'';this[_0x533a('0x1')]=_0x1d401c[_0x533a('0x1')]||'';this['state']=_0x533a('0x2');this[_0x533a('0x3')]=0x0;this[_0x533a('0x4')]=_0x533a('0x2');this[_0x533a('0x5')]='';}module[_0x533a('0x6')]=Telephone; \ No newline at end of file +var _0x6075=['stateTime','address','name','accountcode'];(function(_0x4b12c8,_0x2b1889){var _0x579fea=function(_0x76b929){while(--_0x76b929){_0x4b12c8['push'](_0x4b12c8['shift']());}};_0x579fea(++_0x2b1889);}(_0x6075,0x142));var _0x5607=function(_0x2ebb69,_0x3ef13d){_0x2ebb69=_0x2ebb69-0x0;var _0x5991aa=_0x6075[_0x2ebb69];return _0x5991aa;};'use strict';function Telephone(_0x3bdc22){this['id']=_0x3bdc22['id']||0x0;this[_0x5607('0x0')]=_0x3bdc22['name']||'';this[_0x5607('0x1')]=_0x3bdc22[_0x5607('0x1')]||'';this['state']='unknown';this[_0x5607('0x2')]=0x0;this['status']='unknown';this[_0x5607('0x3')]='';}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 2db5cfd..c55b9c1 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 _0xb10b=['name','html'];(function(_0x5409ae,_0x48c2af){var _0x1ac9b=function(_0x2f02c9){while(--_0x2f02c9){_0x5409ae['push'](_0x5409ae['shift']());}};_0x1ac9b(++_0x48c2af);}(_0xb10b,0x12a));var _0xbb10=function(_0x363a2b,_0x2c51a2){_0x363a2b=_0x363a2b-0x0;var _0x2c720e=_0xb10b[_0x363a2b];return _0x2c720e;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x1bb165,_0x5e040f){var _0x292d61=function(_0x457065){while(--_0x457065){_0x1bb165['push'](_0x1bb165['shift']());}};_0x292d61(++_0x5e040f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'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 eabe1d0..3d2704f 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 _0x0b0e=['channel','voice','status','AllConditions','AnyConditions','Actions','exports','name'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0b0e,0x187));var _0xe0b0=function(_0x7611ce,_0x4a4441){_0x7611ce=_0x7611ce-0x0;var _0x67d3ab=_0x0b0e[_0x7611ce];return _0x67d3ab;};'use strict';function Trigger(_0x29cd1e){this['id']=_0x29cd1e['id']||0x0;this['name']=_0x29cd1e[_0xe0b0('0x0')]||'';this['channel']=_0x29cd1e[_0xe0b0('0x1')]||_0xe0b0('0x2');this[_0xe0b0('0x3')]=_0x29cd1e[_0xe0b0('0x3')]||![];this[_0xe0b0('0x4')]=_0x29cd1e[_0xe0b0('0x4')]||[];this[_0xe0b0('0x5')]=_0x29cd1e[_0xe0b0('0x5')]||[];this[_0xe0b0('0x6')]=_0x29cd1e[_0xe0b0('0x6')]||[];}module[_0xe0b0('0x7')]=Trigger; \ No newline at end of file +var _0x14a0=['voice','status','AnyConditions','Actions','name','channel'];(function(_0x1b23c6,_0x36ef6a){var _0x524c1e=function(_0x4d845){while(--_0x4d845){_0x1b23c6['push'](_0x1b23c6['shift']());}};_0x524c1e(++_0x36ef6a);}(_0x14a0,0x8e));var _0x014a=function(_0x382fc3,_0x339c11){_0x382fc3=_0x382fc3-0x0;var _0x53626=_0x14a0[_0x382fc3];return _0x53626;};'use strict';function Trigger(_0x1ee939){this['id']=_0x1ee939['id']||0x0;this[_0x014a('0x0')]=_0x1ee939[_0x014a('0x0')]||'';this[_0x014a('0x1')]=_0x1ee939[_0x014a('0x1')]||_0x014a('0x2');this[_0x014a('0x3')]=_0x1ee939[_0x014a('0x3')]||![];this['AllConditions']=_0x1ee939['AllConditions']||[];this[_0x014a('0x4')]=_0x1ee939[_0x014a('0x4')]||[];this[_0x014a('0x5')]=_0x1ee939['Actions']||[];}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 c629954..2b22420 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 _0x3a15=['defaultuser','exports','active','name','unknown','registry','split','domain','domainport','refresh','registrationtime','address'];(function(_0x504826,_0x14d14e){var _0x54f4aa=function(_0xdd14c4){while(--_0xdd14c4){_0x504826['push'](_0x504826['shift']());}};_0x54f4aa(++_0x14d14e);}(_0x3a15,0xda));var _0x53a1=function(_0x75e338,_0x5dbfe9){_0x75e338=_0x75e338-0x0;var _0x367cb2=_0x3a15[_0x75e338];return _0x367cb2;};'use strict';function Trunk(_0x5e9db0){this['id']=_0x5e9db0['id']||0x0;this['active']=_0x5e9db0[_0x53a1('0x0')]||![];this[_0x53a1('0x1')]=_0x5e9db0[_0x53a1('0x1')]||'';this['state']=_0x53a1('0x2');this['stateTime']=0x0;this['status']=_0x53a1('0x2');this[_0x53a1('0x3')]=_0x5e9db0[_0x53a1('0x3')]&&_0x5e9db0[_0x53a1('0x3')]['indexOf'](':')?_0x5e9db0[_0x53a1('0x3')][_0x53a1('0x4')](':')[0x0]:'';this['host']='';this['port']='';this[_0x53a1('0x5')]='';this[_0x53a1('0x6')]='';this[_0x53a1('0x7')]='';this['stateRegistry']=_0x53a1('0x2');this[_0x53a1('0x8')]='';this[_0x53a1('0x9')]='';this[_0x53a1('0xa')]=_0x5e9db0['defaultuser']||'';}module[_0x53a1('0xb')]=Trunk; \ No newline at end of file +var _0xac65=['domain','domainport','refresh','stateRegistry','address','defaultuser','exports','active','name','state','unknown','stateTime','status','registry','host','port'];(function(_0x31ecc4,_0x2f79cf){var _0x2bf0e4=function(_0x5ac709){while(--_0x5ac709){_0x31ecc4['push'](_0x31ecc4['shift']());}};_0x2bf0e4(++_0x2f79cf);}(_0xac65,0x107));var _0x5ac6=function(_0x492536,_0x308305){_0x492536=_0x492536-0x0;var _0x5490c0=_0xac65[_0x492536];return _0x5490c0;};'use strict';function Trunk(_0x208482){this['id']=_0x208482['id']||0x0;this['active']=_0x208482[_0x5ac6('0x0')]||![];this[_0x5ac6('0x1')]=_0x208482[_0x5ac6('0x1')]||'';this[_0x5ac6('0x2')]=_0x5ac6('0x3');this[_0x5ac6('0x4')]=0x0;this[_0x5ac6('0x5')]='unknown';this[_0x5ac6('0x6')]=_0x208482[_0x5ac6('0x6')]&&_0x208482[_0x5ac6('0x6')]['indexOf'](':')?_0x208482[_0x5ac6('0x6')]['split'](':')[0x0]:'';this[_0x5ac6('0x7')]='';this[_0x5ac6('0x8')]='';this[_0x5ac6('0x9')]='';this[_0x5ac6('0xa')]='';this[_0x5ac6('0xb')]='';this[_0x5ac6('0xc')]=_0x5ac6('0x3');this['registrationtime']='';this[_0x5ac6('0xd')]='';this['defaultuser']=_0x208482[_0x5ac6('0xe')]||'';}module[_0x5ac6('0xf')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 3af41e2..3ce93ca 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 _0x41e9=['mandatoryDisposition','exports','exten','recordingFormat','none'];(function(_0x3b9b48,_0x4fcb01){var _0x4c3027=function(_0x427f8d){while(--_0x427f8d){_0x3b9b48['push'](_0x3b9b48['shift']());}};_0x4c3027(++_0x4fcb01);}(_0x41e9,0x110));var _0x941e=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x41e9[_0x59ee6f];return _0x4c0979;};'use strict';function voiceExtension(_0x4fd6e2){this['id']=_0x4fd6e2['id']||0x0;this['exten']=_0x4fd6e2[_0x941e('0x0')]||'';this[_0x941e('0x1')]=_0x4fd6e2['recordingFormat']||_0x941e('0x2');this[_0x941e('0x3')]=_0x4fd6e2[_0x941e('0x3')]||![];}module[_0x941e('0x4')]=voiceExtension; \ No newline at end of file +var _0x210e=['mandatoryDisposition','exports','exten','recordingFormat','none'];(function(_0x13cb4f,_0x690637){var _0x51fd44=function(_0x18d82a){while(--_0x18d82a){_0x13cb4f['push'](_0x13cb4f['shift']());}};_0x51fd44(++_0x690637);}(_0x210e,0x197));var _0xe210=function(_0xe429f8,_0xb5ddb4){_0xe429f8=_0xe429f8-0x0;var _0x439723=_0x210e[_0xe429f8];return _0x439723;};'use strict';function voiceExtension(_0x3ddd8d){this['id']=_0x3ddd8d['id']||0x0;this[_0xe210('0x0')]=_0x3ddd8d['exten']||'';this[_0xe210('0x1')]=_0x3ddd8d[_0xe210('0x1')]||_0xe210('0x2');this[_0xe210('0x3')]=_0x3ddd8d[_0xe210('0x3')]||![];}module[_0xe210('0x4')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 57e9fd3..c4b880b 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 _0xe689=['dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvailable','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','waiting','talking','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','temp','dialTimezone','dialGlobalInterval','dialActive','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','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDGreeting'];(function(_0x1e5a2d,_0x1378d5){var _0x198293=function(_0x52e0d5){while(--_0x52e0d5){_0x1e5a2d['push'](_0x1e5a2d['shift']());}};_0x198293(++_0x1378d5);}(_0xe689,0x12a));var _0x9e68=function(_0x398b00,_0x496ac3){_0x398b00=_0x398b00-0x0;var _0x47776f=_0xe689[_0x398b00];return _0x47776f;};'use strict';var statusDesc=[_0x9e68('0x0'),_0x9e68('0x1'),_0x9e68('0x2'),_0x9e68('0x3'),_0x9e68('0x4'),_0x9e68('0x5'),_0x9e68('0x6'),_0x9e68('0x7'),_0x9e68('0x8')];var monitorFormat={'wav':_0x9e68('0x9'),'wav49':_0x9e68('0xa'),'gsm':_0x9e68('0xb')};var strategy={'rrmemory':_0x9e68('0xc'),'roundrobin':_0x9e68('0xd')};function VoiceQueue(_0x10e8a9){this['id']=_0x10e8a9['id']||0x0;this[_0x9e68('0xe')]=_0x10e8a9[_0x9e68('0xe')]||'';this[_0x9e68('0xf')]=_0x10e8a9[_0x9e68('0xf')]||'';this['type']=_0x10e8a9['type']||'inbound';this[_0x9e68('0x10')]=0x0;this[_0x9e68('0x11')]=0x0;this[_0x9e68('0x12')]=0x0;this[_0x9e68('0x13')]=0x0;this[_0x9e68('0x14')]=0x0;this[_0x9e68('0x15')]=0x0;this[_0x9e68('0x16')]=0x0;this[_0x9e68('0x17')]=0x0;this[_0x9e68('0x18')]=0x0;this[_0x9e68('0x19')]=0x0;this[_0x9e68('0x1a')]=0x0;this['acw']=_0x10e8a9[_0x9e68('0x1b')]||![];this[_0x9e68('0x1c')]=_0x10e8a9['acwTimeout']||0xa;this[_0x9e68('0x1d')]=_0x10e8a9[_0x9e68('0x1d')]||'no';this['sendMessageOneNotActive']=!![];this['message']='';this['originated']=0x0;this[_0x9e68('0x1e')]=0x0;this[_0x9e68('0x1f')]=_0x10e8a9[_0x9e68('0x1f')]||null;this[_0x9e68('0x20')]=_0x10e8a9['dialGlobalInterval']?_0x10e8a9[_0x9e68('0x20')]:null;this[_0x9e68('0x21')]=_0x10e8a9['dialActive'];this['dialMethod']=_0x10e8a9['dialMethod']||_0x9e68('0x22');this[_0x9e68('0x23')]=_0x10e8a9[_0x9e68('0x23')]||0x0;this[_0x9e68('0x24')]=_0x10e8a9[_0x9e68('0x24')]||0x0;this[_0x9e68('0x25')]=_0x10e8a9[_0x9e68('0x25')]||0x1;this[_0x9e68('0x26')]=_0x10e8a9[_0x9e68('0x26')]||_0x9e68('0x27');this[_0x9e68('0x28')]=_0x10e8a9[_0x9e68('0x28')]||0.03;this['dialPredictiveInterval']=_0x10e8a9[_0x9e68('0x29')]||0x258;this[_0x9e68('0x2a')]=_0x10e8a9['dialOriginateCallerIdName']||_0x9e68('0x2b');this['dialOriginateCallerIdNumber']=_0x10e8a9[_0x9e68('0x2c')]||'anonymous';this[_0x9e68('0x2d')]=_0x10e8a9['dialOriginateTimeout']||0x1e;this[_0x9e68('0x2e')]=_0x10e8a9[_0x9e68('0x2e')]||_0x9e68('0x2f');this[_0x9e68('0x30')]=_0x10e8a9[_0x9e68('0x30')]||0x3;this[_0x9e68('0x31')]=_0x10e8a9[_0x9e68('0x31')]||undefined;this[_0x9e68('0x32')]=_0x10e8a9[_0x9e68('0x32')]||0x3;this[_0x9e68('0x33')]=_0x10e8a9[_0x9e68('0x33')]||0x96;this[_0x9e68('0x34')]=_0x10e8a9[_0x9e68('0x34')]||0x3;this[_0x9e68('0x35')]=_0x10e8a9[_0x9e68('0x35')]||0x96;this[_0x9e68('0x36')]=_0x10e8a9[_0x9e68('0x36')]||0x3;this['dialNoAnswerRetryFrequency']=_0x10e8a9[_0x9e68('0x37')]||0x96;this[_0x9e68('0x38')]=_0x10e8a9[_0x9e68('0x38')]||0x3;this[_0x9e68('0x39')]=_0x10e8a9[_0x9e68('0x39')]||0x96;this[_0x9e68('0x3a')]=_0x10e8a9[_0x9e68('0x3a')]||0x3;this[_0x9e68('0x3b')]=_0x10e8a9[_0x9e68('0x3b')]||0x96;this['dialAbandonedMaxRetry']=_0x10e8a9['dialAbandonedMaxRetry']||0x3;this[_0x9e68('0x3c')]=_0x10e8a9[_0x9e68('0x3c')]||0x96;this[_0x9e68('0x3d')]=_0x10e8a9[_0x9e68('0x3d')]||0x3;this[_0x9e68('0x3e')]=_0x10e8a9['dialMachineRetryFrequency']||0x96;this[_0x9e68('0x3f')]=_0x10e8a9[_0x9e68('0x3f')]||0x3;this['dialAgentRejectRetryFrequency']=_0x10e8a9['dialAgentRejectRetryFrequency']||0x96;this['dialGlobalMaxRetry']=_0x10e8a9[_0x9e68('0x40')]||0x4;this[_0x9e68('0x41')]=_0x10e8a9[_0x9e68('0x41')]?_0x10e8a9['Trunk']:undefined;this[_0x9e68('0x42')]=_0x10e8a9['TrunkBackup']?_0x10e8a9[_0x9e68('0x42')]:undefined;this[_0x9e68('0x43')]=_0x10e8a9[_0x9e68('0x43')]||undefined;this[_0x9e68('0x44')]=_0x10e8a9[_0x9e68('0x44')]?_0x10e8a9[_0x9e68('0x44')]:undefined;this[_0x9e68('0x45')]=_0x10e8a9['dialOrderByScheduledAt']||_0x9e68('0x46');this[_0x9e68('0x47')]=_0x10e8a9['dialRandomLastDigitCallerIdNumber']||undefined;this['dialCutDigit']=_0x10e8a9[_0x9e68('0x48')]||undefined;this[_0x9e68('0x49')]=strategy[_0x10e8a9[_0x9e68('0x49')]]||_0x9e68('0xc');this[_0x9e68('0x4a')]=!![];this[_0x9e68('0x4b')]=_0x10e8a9[_0x9e68('0x4b')]||![];this['dialAMDInitialSilence']=_0x10e8a9['dialAMDInitialSilence'];this[_0x9e68('0x4c')]=_0x10e8a9[_0x9e68('0x4c')];this[_0x9e68('0x4d')]=_0x10e8a9[_0x9e68('0x4d')];this[_0x9e68('0x4e')]=_0x10e8a9['dialAMDTotalAnalysisTime'];this[_0x9e68('0x4f')]=_0x10e8a9[_0x9e68('0x4f')];this[_0x9e68('0x50')]=_0x10e8a9[_0x9e68('0x50')];this[_0x9e68('0x51')]=_0x10e8a9['dialAMDMaximumNumberOfWords'];this[_0x9e68('0x52')]=_0x10e8a9[_0x9e68('0x52')];this[_0x9e68('0x53')]=_0x10e8a9[_0x9e68('0x53')];this[_0x9e68('0x54')]=0x0;this[_0x9e68('0x55')]=0x0;this[_0x9e68('0x56')]=_0x10e8a9[_0x9e68('0x56')];this[_0x9e68('0x57')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0x9e68('0x58')]=0x0;this[_0x9e68('0x59')]=0x0;this[_0x9e68('0x5a')]=0x0;this[_0x9e68('0x5b')]=0x0;this[_0x9e68('0x5c')]=0x0;this[_0x9e68('0x5d')]=0x0;this[_0x9e68('0x5e')]=0x0;this[_0x9e68('0x5f')]=0x0;this[_0x9e68('0x60')]=0x0;this[_0x9e68('0x61')]=0x0;this[_0x9e68('0x62')]=0x0;this[_0x9e68('0x63')]=0x0;this[_0x9e68('0x64')]=undefined;this[_0x9e68('0x65')]=undefined;this[_0x9e68('0x66')]=undefined;this[_0x9e68('0x67')]=1.05;this[_0x9e68('0x68')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0x9e68('0x69')]=0x0;this[_0x9e68('0x6a')]=0x0;this[_0x9e68('0x6b')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this['predictiveIntervalPauses']=0x0;this[_0x9e68('0x6c')]=0x0;this['predictiveIntervalMaxThreshold']=_0x10e8a9['dialPredictiveIntervalMaxThreshold']||0x14;this['predictiveIntervalMinThreshold']=_0x10e8a9[_0x9e68('0x6d')]||0xa;this[_0x9e68('0x6e')]=0x0;this[_0x9e68('0x6f')]=0x0;this[_0x9e68('0x70')]=0x1;this[_0x9e68('0x71')]=0x0;this[_0x9e68('0x72')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0x9e68('0x73')]=0x0;this['dialRecallMeTimeout']=_0x10e8a9[_0x9e68('0x74')]||0x1e;this[_0x9e68('0x75')]=_0x10e8a9['dialRecallInQueue']||![];this['dialPreviewAutoRecallMe']=!!_0x10e8a9['dialPreviewAutoRecallMe']||![];this[_0x9e68('0x76')]=!!_0x10e8a9['dialPreviewRecallmeReminder']||![];this[_0x9e68('0x77')]=_0x10e8a9[_0x9e68('0x77')]||undefined;this[_0x9e68('0x78')]=_0x10e8a9[_0x9e68('0x78')]||![];this[_0x9e68('0x79')]=_0x10e8a9[_0x9e68('0x79')]||![];this[_0x9e68('0xf')]=monitorFormat[_0x10e8a9[_0x9e68('0xf')]]?monitorFormat[_0x10e8a9[_0x9e68('0xf')]]:undefined;this[_0x9e68('0x7a')]=_0x10e8a9[_0x9e68('0x7a')]||![];this[_0x9e68('0x7b')]=_0x10e8a9['mandatoryDispositionPause']?_0x10e8a9['mandatoryDispositionPause']:undefined;}module[_0x9e68('0x7c')]=VoiceQueue; \ No newline at end of file +var _0x71a6=['dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundAbandonedDay','startPredictive','handlePredictive','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalHitRate','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','not_inuse','inuse','invalid','unavailable','ringing','onhold','wav','gsm','rrmemory','roundrobin','name','monitor_format','inbound','total','answered','sumBillable','unmanaged','abandoned','available','acw','acwTimeout','autopause','message','originated','temp','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x71a6,0x1dd));var _0x671a=function(_0x5ba549,_0x425afd){_0x5ba549=_0x5ba549-0x0;var _0x36e3a1=_0x71a6[_0x5ba549];return _0x36e3a1;};'use strict';var statusDesc=['unknown',_0x671a('0x0'),_0x671a('0x1'),'busy',_0x671a('0x2'),_0x671a('0x3'),_0x671a('0x4'),'ringinuse',_0x671a('0x5')];var monitorFormat={'wav':_0x671a('0x6'),'wav49':'wav49','gsm':_0x671a('0x7')};var strategy={'rrmemory':_0x671a('0x8'),'roundrobin':_0x671a('0x9')};function VoiceQueue(_0x5c6b6e){this['id']=_0x5c6b6e['id']||0x0;this[_0x671a('0xa')]=_0x5c6b6e[_0x671a('0xa')]||'';this[_0x671a('0xb')]=_0x5c6b6e[_0x671a('0xb')]||'';this['type']=_0x5c6b6e['type']||_0x671a('0xc');this['waiting']=0x0;this['talking']=0x0;this[_0x671a('0xd')]=0x0;this[_0x671a('0xe')]=0x0;this['sumDuration']=0x0;this['sumHoldTime']=0x0;this[_0x671a('0xf')]=0x0;this[_0x671a('0x10')]=0x0;this[_0x671a('0x11')]=0x0;this['loggedIn']=0x0;this[_0x671a('0x12')]=0x0;this[_0x671a('0x13')]=_0x5c6b6e[_0x671a('0x13')]||![];this[_0x671a('0x14')]=_0x5c6b6e[_0x671a('0x14')]||0xa;this[_0x671a('0x15')]=_0x5c6b6e['autopause']||'no';this['sendMessageOneNotActive']=!![];this[_0x671a('0x16')]='';this[_0x671a('0x17')]=0x0;this[_0x671a('0x18')]=0x0;this['dialTimezone']=_0x5c6b6e['dialTimezone']||null;this[_0x671a('0x19')]=_0x5c6b6e['dialGlobalInterval']?_0x5c6b6e['dialGlobalInterval']:null;this[_0x671a('0x1a')]=_0x5c6b6e[_0x671a('0x1a')];this[_0x671a('0x1b')]=_0x5c6b6e[_0x671a('0x1b')]||_0x671a('0x1c');this['dialLimitChannel']=_0x5c6b6e[_0x671a('0x1d')]||0x0;this[_0x671a('0x1e')]=_0x5c6b6e[_0x671a('0x1e')]||0x0;this[_0x671a('0x1f')]=_0x5c6b6e['dialPowerLevel']||0x1;this[_0x671a('0x20')]=_0x5c6b6e['dialPredictiveOptimization']||_0x671a('0x21');this['dialPredictiveOptimizationPercentage']=_0x5c6b6e['dialPredictiveOptimizationPercentage']||0.03;this['dialPredictiveInterval']=_0x5c6b6e[_0x671a('0x22')]||0x258;this[_0x671a('0x23')]=_0x5c6b6e[_0x671a('0x23')]||_0x671a('0x24');this[_0x671a('0x25')]=_0x5c6b6e[_0x671a('0x25')]||_0x671a('0x24');this['dialOriginateTimeout']=_0x5c6b6e[_0x671a('0x26')]||0x1e;this['dialQueueOptions']=_0x5c6b6e[_0x671a('0x27')]||_0x671a('0x28');this[_0x671a('0x29')]=_0x5c6b6e['dialQueueTimeout']||0x3;this['dialQueueProject']=_0x5c6b6e[_0x671a('0x2a')]||undefined;this[_0x671a('0x2b')]=_0x5c6b6e[_0x671a('0x2b')]||0x3;this[_0x671a('0x2c')]=_0x5c6b6e[_0x671a('0x2c')]||0x96;this[_0x671a('0x2d')]=_0x5c6b6e['dialBusyMaxRetry']||0x3;this[_0x671a('0x2e')]=_0x5c6b6e['dialBusyRetryFrequency']||0x96;this[_0x671a('0x2f')]=_0x5c6b6e[_0x671a('0x2f')]||0x3;this[_0x671a('0x30')]=_0x5c6b6e[_0x671a('0x30')]||0x96;this[_0x671a('0x31')]=_0x5c6b6e[_0x671a('0x31')]||0x3;this[_0x671a('0x32')]=_0x5c6b6e[_0x671a('0x32')]||0x96;this['dialDropMaxRetry']=_0x5c6b6e[_0x671a('0x33')]||0x3;this[_0x671a('0x34')]=_0x5c6b6e[_0x671a('0x34')]||0x96;this[_0x671a('0x35')]=_0x5c6b6e[_0x671a('0x35')]||0x3;this[_0x671a('0x36')]=_0x5c6b6e[_0x671a('0x36')]||0x96;this[_0x671a('0x37')]=_0x5c6b6e['dialMachineMaxRetry']||0x3;this['dialMachineRetryFrequency']=_0x5c6b6e['dialMachineRetryFrequency']||0x96;this[_0x671a('0x38')]=_0x5c6b6e['dialAgentRejectMaxRetry']||0x3;this[_0x671a('0x39')]=_0x5c6b6e[_0x671a('0x39')]||0x96;this[_0x671a('0x3a')]=_0x5c6b6e[_0x671a('0x3a')]||0x4;this['Trunk']=_0x5c6b6e[_0x671a('0x3b')]?_0x5c6b6e[_0x671a('0x3b')]:undefined;this['TrunkBackup']=_0x5c6b6e[_0x671a('0x3c')]?_0x5c6b6e['TrunkBackup']:undefined;this['dialPrefix']=_0x5c6b6e[_0x671a('0x3d')]||undefined;this['Interval']=_0x5c6b6e[_0x671a('0x3e')]?_0x5c6b6e[_0x671a('0x3e')]:undefined;this[_0x671a('0x3f')]=_0x5c6b6e['dialOrderByScheduledAt']||'DESC';this['dialRandomLastDigitCallerIdNumber']=_0x5c6b6e[_0x671a('0x40')]||undefined;this['dialCutDigit']=_0x5c6b6e[_0x671a('0x41')]||undefined;this[_0x671a('0x42')]=strategy[_0x5c6b6e['strategy']]||_0x671a('0x8');this['queueStatusComplete']=!![];this[_0x671a('0x43')]=_0x5c6b6e[_0x671a('0x43')]||![];this[_0x671a('0x44')]=_0x5c6b6e['dialAMDInitialSilence'];this['dialAMDGreeting']=_0x5c6b6e[_0x671a('0x45')];this[_0x671a('0x46')]=_0x5c6b6e['dialAMDAfterGreetingSilence'];this[_0x671a('0x47')]=_0x5c6b6e['dialAMDTotalAnalysisTime'];this[_0x671a('0x48')]=_0x5c6b6e[_0x671a('0x48')];this[_0x671a('0x49')]=_0x5c6b6e['dialAMDBetweenWordsSilence'];this[_0x671a('0x4a')]=_0x5c6b6e[_0x671a('0x4a')];this['dialAMDSilenceThreshold']=_0x5c6b6e[_0x671a('0x4b')];this[_0x671a('0x4c')]=_0x5c6b6e[_0x671a('0x4c')];this['outboundRejectCallsDay']=0x0;this['pTalking']=0x0;this['timeout']=_0x5c6b6e['timeout'];this[_0x671a('0x4d')]=0x0;this[_0x671a('0x4e')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x671a('0x4f')]=0x0;this[_0x671a('0x50')]=0x0;this['outboundNoSuchCallsDay']=0x0;this['outboundUnknownCallsDay']=0x0;this['outboundBlacklistCallsDay']=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0x671a('0x51')]=0x0;this[_0x671a('0x52')]=0x0;this[_0x671a('0x53')]=0x0;this['outboundReCallsDay']=0x0;this[_0x671a('0x54')]=0x0;this['startProgressive']=undefined;this[_0x671a('0x55')]=undefined;this[_0x671a('0x56')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0x671a('0x57')]=0x0;this[_0x671a('0x58')]=0x0;this[_0x671a('0x59')]=0x0;this[_0x671a('0x5a')]=0x0;this[_0x671a('0x5b')]=0x0;this[_0x671a('0x5c')]=0x0;this[_0x671a('0x5d')]=0x0;this['predictiveIntervalMaxThreshold']=_0x5c6b6e[_0x671a('0x5e')]||0x14;this[_0x671a('0x5f')]=_0x5c6b6e[_0x671a('0x5e')]||0xa;this[_0x671a('0x60')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0x671a('0x61')]=0x1;this['erlangCalls']=0x0;this[_0x671a('0x62')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0x671a('0x63')]=0x0;this[_0x671a('0x64')]=_0x5c6b6e[_0x671a('0x64')]||0x1e;this[_0x671a('0x65')]=_0x5c6b6e['dialRecallInQueue']||![];this[_0x671a('0x66')]=!!_0x5c6b6e[_0x671a('0x66')]||![];this[_0x671a('0x67')]=!!_0x5c6b6e[_0x671a('0x67')]||![];this[_0x671a('0x68')]=_0x5c6b6e[_0x671a('0x68')]||undefined;this['dialAgiAfterHangupClient']=_0x5c6b6e[_0x671a('0x69')]||![];this[_0x671a('0x6a')]=_0x5c6b6e[_0x671a('0x6a')]||![];this[_0x671a('0xb')]=monitorFormat[_0x5c6b6e[_0x671a('0xb')]]?monitorFormat[_0x5c6b6e['monitor_format']]:undefined;this['mandatoryDisposition']=_0x5c6b6e[_0x671a('0x6b')]||![];this['mandatoryDispositionPause']=_0x5c6b6e[_0x671a('0x6c')]?_0x5c6b6e[_0x671a('0x6c')]:undefined;}module[_0x671a('0x6d')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index ef82f8e..6418f2a 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 _0xf05f=['username','accessKey','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x50812c,_0x2f5827){var _0xcf4060=function(_0x33f7f9){while(--_0x33f7f9){_0x50812c['push'](_0x50812c['shift']());}};_0xcf4060(++_0x2f5827);}(_0xf05f,0xae));var _0xff05=function(_0x4f3d48,_0x2d90b6){_0x4f3d48=_0x4f3d48-0x0;var _0x534df0=_0xf05f[_0x4f3d48];return _0x534df0;};'use strict';function VtigerAccount(_0x454b78){this['id']=_0x454b78['id']||0x0;this[_0xff05('0x0')]=_0x454b78[_0xff05('0x0')]||'';this[_0xff05('0x1')]=_0x454b78['username']||'';this[_0xff05('0x2')]=_0x454b78[_0xff05('0x2')]||'';this[_0xff05('0x3')]=_0x454b78[_0xff05('0x3')]||'';this[_0xff05('0x4')]=_0x454b78[_0xff05('0x4')]||'';this[_0xff05('0x5')]=_0x454b78[_0xff05('0x5')]||{};}module[_0xff05('0x6')]=VtigerAccount; \ No newline at end of file +var _0x6c01=['exports','name','username','accessKey','remoteUri','serverUrl','Configurations'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6c01,0x78));var _0x16c0=function(_0x1b24b9,_0x10a377){_0x1b24b9=_0x1b24b9-0x0;var _0x4f2ff3=_0x6c01[_0x1b24b9];return _0x4f2ff3;};'use strict';function VtigerAccount(_0x156a53){this['id']=_0x156a53['id']||0x0;this[_0x16c0('0x0')]=_0x156a53[_0x16c0('0x0')]||'';this[_0x16c0('0x1')]=_0x156a53[_0x16c0('0x1')]||'';this[_0x16c0('0x2')]=_0x156a53[_0x16c0('0x2')]||'';this['remoteUri']=_0x156a53[_0x16c0('0x3')]||'';this[_0x16c0('0x4')]=_0x156a53[_0x16c0('0x4')]||'';this[_0x16c0('0x5')]=_0x156a53[_0x16c0('0x5')]||{};}module[_0x16c0('0x6')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index d8f2dae..51b1731 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 _0xee6c=['name','username','password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports'];(function(_0x3d97ac,_0x5d85ef){var _0x241659=function(_0x440e34){while(--_0x440e34){_0x3d97ac['push'](_0x3d97ac['shift']());}};_0x241659(++_0x5d85ef);}(_0xee6c,0x14a));var _0xcee6=function(_0x182506,_0x57cf6a){_0x182506=_0x182506-0x0;var _0x3294e6=_0xee6c[_0x182506];return _0x3294e6;};'use strict';function ZendeskAccount(_0x29285c){this['id']=_0x29285c['id']||0x0;this['name']=_0x29285c[_0xcee6('0x0')]||'';this[_0xcee6('0x1')]=_0x29285c[_0xcee6('0x1')]||'';this[_0xcee6('0x2')]=_0x29285c[_0xcee6('0x2')]||'';this['token']=_0x29285c[_0xcee6('0x3')]||'';this[_0xcee6('0x4')]=_0x29285c[_0xcee6('0x4')]||'';this[_0xcee6('0x5')]=_0x29285c[_0xcee6('0x5')]||'';this[_0xcee6('0x6')]=_0x29285c['type']||_0xcee6('0x7');this[_0xcee6('0x8')]=_0x29285c[_0xcee6('0x8')]||'';this[_0xcee6('0x9')]=_0x29285c[_0xcee6('0x9')]||{};}module[_0xcee6('0xa')]=ZendeskAccount; \ No newline at end of file +var _0x7bfc=['authType','type','integrationTab','serverUrl','Configurations','exports','name','username','password','token','remoteUri'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x7bfc,0x74));var _0xc7bf=function(_0x13a007,_0x1d6696){_0x13a007=_0x13a007-0x0;var _0x465582=_0x7bfc[_0x13a007];return _0x465582;};'use strict';function ZendeskAccount(_0x39be4e){this['id']=_0x39be4e['id']||0x0;this['name']=_0x39be4e[_0xc7bf('0x0')]||'';this[_0xc7bf('0x1')]=_0x39be4e[_0xc7bf('0x1')]||'';this[_0xc7bf('0x2')]=_0x39be4e[_0xc7bf('0x2')]||'';this['token']=_0x39be4e[_0xc7bf('0x3')]||'';this[_0xc7bf('0x4')]=_0x39be4e[_0xc7bf('0x4')]||'';this[_0xc7bf('0x5')]=_0x39be4e[_0xc7bf('0x5')]||'';this[_0xc7bf('0x6')]=_0x39be4e[_0xc7bf('0x6')]||_0xc7bf('0x7');this[_0xc7bf('0x8')]=_0x39be4e[_0xc7bf('0x8')]||'';this['Configurations']=_0x39be4e[_0xc7bf('0x9')]||{};}module[_0xc7bf('0xa')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index aa7a2d6..0ee7eb1 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 _0x07a2=['clientSecret','serverUrl','code','refreshToken','Configurations','exports','name','description','host','zone','clientId'];(function(_0x48e675,_0x270383){var _0x260d65=function(_0x14509d){while(--_0x14509d){_0x48e675['push'](_0x48e675['shift']());}};_0x260d65(++_0x270383);}(_0x07a2,0x1a8));var _0x207a=function(_0x401ccd,_0x140815){_0x401ccd=_0x401ccd-0x0;var _0x5a57ad=_0x07a2[_0x401ccd];return _0x5a57ad;};'use strict';function ZohoAccount(_0x1ee0c1){this['id']=_0x1ee0c1['id']||0x0;this[_0x207a('0x0')]=_0x1ee0c1[_0x207a('0x0')]||'';this[_0x207a('0x1')]=_0x1ee0c1[_0x207a('0x1')]||'';this[_0x207a('0x2')]=_0x1ee0c1[_0x207a('0x2')]||'';this[_0x207a('0x3')]=_0x1ee0c1[_0x207a('0x3')]||'';this['clientId']=_0x1ee0c1[_0x207a('0x4')]||'';this[_0x207a('0x5')]=_0x1ee0c1[_0x207a('0x5')]||'';this[_0x207a('0x6')]=_0x1ee0c1[_0x207a('0x6')]||'';this['code']=_0x1ee0c1[_0x207a('0x7')]||'';this['refreshToken']=_0x1ee0c1[_0x207a('0x8')]||'';this[_0x207a('0x9')]=_0x1ee0c1[_0x207a('0x9')]||{};}module[_0x207a('0xa')]=ZohoAccount; \ No newline at end of file +var _0x1cbf=['clientSecret','code','refreshToken','Configurations','exports','name','description','host','zone'];(function(_0x184eff,_0x5f2711){var _0x23fd0a=function(_0x5eea52){while(--_0x5eea52){_0x184eff['push'](_0x184eff['shift']());}};_0x23fd0a(++_0x5f2711);}(_0x1cbf,0x1a3));var _0xf1cb=function(_0x645bee,_0x2ea0a7){_0x645bee=_0x645bee-0x0;var _0x322d93=_0x1cbf[_0x645bee];return _0x322d93;};'use strict';function ZohoAccount(_0x282323){this['id']=_0x282323['id']||0x0;this['name']=_0x282323[_0xf1cb('0x0')]||'';this[_0xf1cb('0x1')]=_0x282323[_0xf1cb('0x1')]||'';this[_0xf1cb('0x2')]=_0x282323['host']||'';this[_0xf1cb('0x3')]=_0x282323[_0xf1cb('0x3')]||'';this['clientId']=_0x282323['clientId']||'';this[_0xf1cb('0x4')]=_0x282323['clientSecret']||'';this['serverUrl']=_0x282323['serverUrl']||'';this[_0xf1cb('0x5')]=_0x282323[_0xf1cb('0x5')]||'';this['refreshToken']=_0x282323[_0xf1cb('0x6')]||'';this[_0xf1cb('0x7')]=_0x282323[_0xf1cb('0x7')]||{};}module[_0xf1cb('0x8')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 47222d6..b482651 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 _0xb3d0=['lastName','active','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','callback','callbackuniqueid','callbackat','ContactId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','number','exports','moment','string','uniqueid','idContact','queue','name','type','campaigntype','membername','isNil','Agent','channelAgent','format','SIP/%s','calleridname','phone','Contact'];(function(_0x51c180,_0x17317f){var _0x1a93e7=function(_0x1e03cd){while(--_0x1e03cd){_0x51c180['push'](_0x51c180['shift']());}};_0x1a93e7(++_0x17317f);}(_0xb3d0,0xe5));var _0x0b3d=function(_0x30ca85,_0x1b793f){_0x30ca85=_0x30ca85-0x0;var _0x97097d=_0xb3d0[_0x30ca85];return _0x97097d;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x0b3d('0x0'));function checkNameSurname(_0x1c3849,_0x4c25c6,_0x48499b){var _0x4e673f='';if(!_['isNil'](_0x4c25c6)&&_0x0b3d('0x1')===typeof _0x4c25c6){_0x4e673f+=_0x4c25c6;}if(!_['isNil'](_0x48499b)&&'string'===typeof _0x48499b){_0x4e673f+='\x20'+_0x48499b;}if(_0x4e673f!==''){return _0x4e673f;}return _0x1c3849;}function Action(_0x5d9856,_0x3e253d,_0x4a5771,_0x1d9096,_0x1cb51e){this[_0x0b3d('0x2')]=_0x4a5771||undefined;this[_0x0b3d('0x3')]=_0x5d9856['id'];this[_0x0b3d('0x4')]=_0x3e253d[_0x0b3d('0x5')];this[_0x0b3d('0x6')]=_0x3e253d['type'];this[_0x0b3d('0x7')]='queue';this['dialAnswer']=![];this[_0x0b3d('0x8')]=_[_0x0b3d('0x9')](_0x5d9856[_0x0b3d('0xa')])?undefined:_0x5d9856[_0x0b3d('0xa')][_0x0b3d('0x5')];this[_0x0b3d('0xb')]=this[_0x0b3d('0x8')]?util[_0x0b3d('0xc')](_0x0b3d('0xd'),this[_0x0b3d('0x8')]):_0x1d9096||undefined;this[_0x0b3d('0xe')]=checkNameSurname(_0x5d9856['Contact'][_0x0b3d('0xf')],_0x5d9856[_0x0b3d('0x10')]['firstName'],_0x5d9856[_0x0b3d('0x10')][_0x0b3d('0x11')]);this[_0x0b3d('0x12')]=_0x5d9856['active']||![];this['calleridnum']=_0x5d9856[_0x0b3d('0x10')][_0x0b3d('0xf')];this[_0x0b3d('0x13')]=_0x5d9856['scheduledat'];this[_0x0b3d('0x14')]=_0x5d9856[_0x0b3d('0x14')]||0x0;this[_0x0b3d('0x15')]=_0x5d9856[_0x0b3d('0x15')]||0x0;this[_0x0b3d('0x16')]=_0x5d9856[_0x0b3d('0x16')]||0x0;this[_0x0b3d('0x17')]=(_0x5d9856['countbusyretry']||0x0)+(_0x5d9856[_0x0b3d('0x15')]||0x0)+(_0x5d9856[_0x0b3d('0x16')]||0x0)+(_0x5d9856[_0x0b3d('0x18')]||0x0)+(_0x5d9856[_0x0b3d('0x19')]||0x0)+(_0x5d9856[_0x0b3d('0x1a')]||0x0)+(_0x5d9856['countmachineretry']||0x0)+(_0x5d9856[_0x0b3d('0x1b')]||0x0);this[_0x0b3d('0x18')]=_0x5d9856[_0x0b3d('0x18')]||0x0;this[_0x0b3d('0x19')]=_0x5d9856[_0x0b3d('0x19')]||0x0;this['countabandonedretry']=_0x5d9856[_0x0b3d('0x1a')]||0x0;this[_0x0b3d('0x1c')]=_0x5d9856[_0x0b3d('0x1c')]||0x0;this['countagentrejectretry']=_0x5d9856[_0x0b3d('0x1b')]||0x0;this['callback']=_0x5d9856[_0x0b3d('0x1d')];this[_0x0b3d('0x1e')]=_0x5d9856[_0x0b3d('0x1e')];this[_0x0b3d('0x1f')]=_0x5d9856[_0x0b3d('0x1f')];this['recallme']=_0x5d9856['recallme'];this[_0x0b3d('0x20')]=_0x5d9856['ContactId'];this['ListId']=_0x5d9856['ListId'];this['UserId']=_[_0x0b3d('0x9')](_0x5d9856[_0x0b3d('0xa')])?_0x5d9856[_0x0b3d('0x21')]:_0x5d9856[_0x0b3d('0xa')]['id'];this[_0x0b3d('0x22')]=_0x5d9856['VoiceQueueId'];this[_0x0b3d('0x23')]='';this[_0x0b3d('0x24')]='';}Action[_0x0b3d('0x25')][_0x0b3d('0x26')]=function(){return util['format']('\x22%s\x22\x20<%s>',this[_0x0b3d('0xe')],this[_0x0b3d('0x27')]);};module[_0x0b3d('0x28')]=Action; \ No newline at end of file +var _0x73dd=['Agent','channelAgent','format','SIP/%s','calleridname','phone','Contact','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countnoanswerretry','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>','exports','util','lodash','moment','isNil','uniqueid','idContact','queue','name','type','campaigntype','dialAnswer','membername'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0x73dd,0xd5));var _0xd73d=function(_0x311d45,_0x6aa7a9){_0x311d45=_0x311d45-0x0;var _0x5e82f7=_0x73dd[_0x311d45];return _0x5e82f7;};'use strict';var util=require(_0xd73d('0x0'));var _=require(_0xd73d('0x1'));var moment=require(_0xd73d('0x2'));function checkNameSurname(_0x1de2b9,_0x4693b6,_0x1e982b){var _0x4822e1='';if(!_[_0xd73d('0x3')](_0x4693b6)&&'string'===typeof _0x4693b6){_0x4822e1+=_0x4693b6;}if(!_['isNil'](_0x1e982b)&&'string'===typeof _0x1e982b){_0x4822e1+='\x20'+_0x1e982b;}if(_0x4822e1!==''){return _0x4822e1;}return _0x1de2b9;}function Action(_0x59111f,_0x1c9daf,_0x492ab2,_0x39bb09,_0xbe81f7){this[_0xd73d('0x4')]=_0x492ab2||undefined;this[_0xd73d('0x5')]=_0x59111f['id'];this[_0xd73d('0x6')]=_0x1c9daf[_0xd73d('0x7')];this[_0xd73d('0x8')]=_0x1c9daf['type'];this[_0xd73d('0x9')]='queue';this[_0xd73d('0xa')]=![];this[_0xd73d('0xb')]=_['isNil'](_0x59111f[_0xd73d('0xc')])?undefined:_0x59111f[_0xd73d('0xc')][_0xd73d('0x7')];this[_0xd73d('0xd')]=this[_0xd73d('0xb')]?util[_0xd73d('0xe')](_0xd73d('0xf'),this[_0xd73d('0xb')]):_0x39bb09||undefined;this[_0xd73d('0x10')]=checkNameSurname(_0x59111f['Contact'][_0xd73d('0x11')],_0x59111f[_0xd73d('0x12')][_0xd73d('0x13')],_0x59111f[_0xd73d('0x12')][_0xd73d('0x14')]);this[_0xd73d('0x15')]=_0x59111f[_0xd73d('0x15')]||![];this[_0xd73d('0x16')]=_0x59111f[_0xd73d('0x12')]['phone'];this['scheduledat']=_0x59111f[_0xd73d('0x17')];this[_0xd73d('0x18')]=_0x59111f[_0xd73d('0x18')]||0x0;this['countcongestionretry']=_0x59111f['countcongestionretry']||0x0;this[_0xd73d('0x19')]=_0x59111f['countnoanswerretry']||0x0;this['countglobal']=(_0x59111f[_0xd73d('0x18')]||0x0)+(_0x59111f[_0xd73d('0x1a')]||0x0)+(_0x59111f['countnoanswerretry']||0x0)+(_0x59111f[_0xd73d('0x1b')]||0x0)+(_0x59111f[_0xd73d('0x1c')]||0x0)+(_0x59111f[_0xd73d('0x1d')]||0x0)+(_0x59111f[_0xd73d('0x1e')]||0x0)+(_0x59111f[_0xd73d('0x1f')]||0x0);this['countnosuchnumberretry']=_0x59111f[_0xd73d('0x1b')]||0x0;this[_0xd73d('0x1c')]=_0x59111f['countdropretry']||0x0;this[_0xd73d('0x1d')]=_0x59111f[_0xd73d('0x1d')]||0x0;this['countmachineretry']=_0x59111f['countmachineretry']||0x0;this[_0xd73d('0x1f')]=_0x59111f[_0xd73d('0x1f')]||0x0;this['callback']=_0x59111f[_0xd73d('0x20')];this[_0xd73d('0x21')]=_0x59111f[_0xd73d('0x21')];this['callbackat']=_0x59111f[_0xd73d('0x22')];this[_0xd73d('0x23')]=_0x59111f['recallme'];this[_0xd73d('0x24')]=_0x59111f[_0xd73d('0x24')];this[_0xd73d('0x25')]=_0x59111f[_0xd73d('0x25')];this[_0xd73d('0x26')]=_[_0xd73d('0x3')](_0x59111f[_0xd73d('0xc')])?_0x59111f[_0xd73d('0x26')]:_0x59111f[_0xd73d('0xc')]['id'];this[_0xd73d('0x27')]=_0x59111f[_0xd73d('0x27')];this[_0xd73d('0x28')]='';this[_0xd73d('0x29')]='';}Action[_0xd73d('0x2a')]['getCaller']=function(){return util[_0xd73d('0xe')](_0xd73d('0x2b'),this['calleridname'],this['number']);};module[_0xd73d('0x2c')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 0f2f158..2ba5815 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 _0x0c02=['Congestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','dialAgentRejectMaxRetry','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','countmachineretry','cause-txt','dialstatus','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','originated:\x20','callProgressDetectingAgent','isUndefined','object','reason','logAgent','NoSuchNumber','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','NoAnswer','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent][logAnswerAGI]','updateOriginated','[callProgressDetectingAgent]','checkInBlack','Contact','phone','isEmpty','[Preview][execCall][success]','\x20IdHopper:\x20','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','execRun','pick','unlock','unlockContact','recallme','checkIsBlackList','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','isActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','SIP/%s/%s%s','trim','dialCutDigit','substring','getCallerId','dialOriginateCallerIdName','getCallerIdRandom','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','originatecalleridname','extractCalleridName','extractCalleridNumber','addVariables','toLowerVariables','variablesAction','[originated][increment]','OriginateError','channel','actionid','lookAgent','logLookAgent','clone','isFailure','response','disableContact','idContact','custom:agentringnoanswer','rejected','starttime','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','callProgressDetectingCustomer','statedesc','transfer','[syncHangup][talking][cause]','destlinkedid','destuniqueid','syncHangupRequest','addVariable','variables','syncVarSet','filterKey','keys','variable','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','lodash','bluebird','moment','md5','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','redis','localhost','socket.io-emitter','prototype','enqueue','sequence','campaignsPreview','voiceQueues','trunks','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','dialend','syncDialEnd','newexten','syncNewExten','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','loopCampaigns','emit','type','name','strategy','answered','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startProgressive','Trunk','active','callerid','Interval','stringify','voice:queue:%s','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','format','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','NOT_ACTIVE','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','message','logger','\x20is\x20disactive','syncCampaigns','hasOwnProperty','booked','outbound','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','Queue','actions','pTalking:\x20','dialAnswer','contactId','UserId','VoiceQueueId','ListId','Action','status','catch','No\x20such\x20channel','queue','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','info','[action]','getContactRecallMe','agentReadyId','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','then','[RecallMe]','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','logger2','[getContactRecallMe]','IsNotLoggedIn','isTrunkReachable','TrunkBackup','ACTIVE','buildObj','nosuchnumber','dialGlobalMaxRetry','cloneAction','Global','dialNoSuchNumberMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','countnosuchnumberretry','dialNoSuchNumberRetryFrequency','unlockAgent','ANSWER','responsetime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','acw','buildAcw','custom:agentcomplete','complete','outboundAnswerCallsDay','[16]','countglobal','totalGlobal','Answer','[callProgressDetectingCustomer][logAnswer]','talktime','[syncHangup][talking][decrement]','linkedid','BUSY','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusyGlobal]','countbusyretry','dialBusyMaxRetry','[callProgressDetectingCustomer][logBusy]','dialBusyRetryFrequency','activeContact','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','dialNoAnswerMaxRetry','scheduledAt','CONGESTION','countcongestionretry'];(function(_0x16221e,_0x2253c2){var _0x138d29=function(_0x36e22c){while(--_0x36e22c){_0x16221e['push'](_0x16221e['shift']());}};_0x138d29(++_0x2253c2);}(_0x0c02,0x84));var _0x20c0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c02[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var _=require(_0x20c0('0x0'));var BPromise=require(_0x20c0('0x1'));var uuid=require('uuid');var moment=require(_0x20c0('0x2'));var md5=require(_0x20c0('0x3'));var Redis=require(_0x20c0('0x4'));var config=require(_0x20c0('0x5'));var logger=require(_0x20c0('0x6'))(_0x20c0('0x7'));var loggerAction=require(_0x20c0('0x6'))(_0x20c0('0x8'));var ami=require(_0x20c0('0x9'));var rpcDb=require(_0x20c0('0xa'));var Action=require('./action');var ut=require('./util/util');config['redis']=_['defaults'](config[_0x20c0('0xb')],{'host':_0x20c0('0xc'),'port':0x18eb});var io=require(_0x20c0('0xd'))(new Redis(config[_0x20c0('0xb')]));var Sequence=function(){};Sequence[_0x20c0('0xe')][_0x20c0('0xf')]=function(_0x4d3caf){this['tail']=this['tail']?this['tail']['finally'](_0x4d3caf):_0x4d3caf();};function Preview(_0x2f82ed){this[_0x20c0('0x10')]=new Sequence();this[_0x20c0('0x11')]=_0x2f82ed[_0x20c0('0x12')];this['trunks']=_0x2f82ed[_0x20c0('0x13')];this['actions']={};this['agents']=_0x2f82ed[_0x20c0('0x14')];this[_0x20c0('0x15')]=0x0;ami['on'](_0x20c0('0x16'),this[_0x20c0('0x17')][_0x20c0('0x18')](this));ami['on'](_0x20c0('0x19'),this[_0x20c0('0x1a')][_0x20c0('0x18')](this));ami['on'](_0x20c0('0x1b'),this['syncHangupRequest'][_0x20c0('0x18')](this));ami['on'](_0x20c0('0x1c'),this[_0x20c0('0x1d')][_0x20c0('0x18')](this));ami['on'](_0x20c0('0x1e'),this[_0x20c0('0x1f')]['bind'](this));ami['on']('varset',this['syncVarSet'][_0x20c0('0x18')](this));ami['on'](_0x20c0('0x20'),this[_0x20c0('0x21')][_0x20c0('0x18')](this));ami['on']('blindtransfer',this[_0x20c0('0x22')][_0x20c0('0x18')](this));this[_0x20c0('0x23')](this['campaignsPreview']);}function emit(_0x54bd1e,_0x343db7,_0x108973){io['to'](_0x54bd1e)[_0x20c0('0x24')](_0x343db7,_0x108973);}function emitCampaignPreview(_0x2315dc){if(_0x2315dc[_0x20c0('0x25')]==='outbound'){var _0x2213f5={'id':_0x2315dc['id'],'name':_0x2315dc[_0x20c0('0x26')],'strategy':_0x2315dc[_0x20c0('0x27')],'answered':_0x2315dc[_0x20c0('0x28')],'available':_0x2315dc['available'],'loggedIn':_0x2315dc[_0x20c0('0x29')],'pTalking':_0x2315dc[_0x20c0('0x2a')],'sumBillable':_0x2315dc[_0x20c0('0x2b')],'sumDuration':_0x2315dc[_0x20c0('0x2c')],'sumHoldTime':_0x2315dc[_0x20c0('0x2d')]||0x0,'talking':_0x2315dc[_0x20c0('0x2e')],'total':_0x2315dc[_0x20c0('0x2f')],'type':_0x2315dc['type'],'unmanaged':_0x2315dc[_0x20c0('0x30')],'abandoned':_0x2315dc[_0x20c0('0x31')],'waiting':_0x2315dc[_0x20c0('0x32')],'loggedInDb':_0x2315dc[_0x20c0('0x33')],'dialActive':_0x2315dc[_0x20c0('0x34')],'dialMethod':_0x2315dc[_0x20c0('0x35')],'dialOriginateCallerIdName':_0x2315dc['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x2315dc['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x2315dc[_0x20c0('0x36')],'dialPrefix':_0x2315dc[_0x20c0('0x37')],'outboundAnswerAgiCallsDay':_0x2315dc[_0x20c0('0x38')],'outboundAnswerCallsDay':_0x2315dc['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x2315dc[_0x20c0('0x39')],'outboundBusyCallsDay':_0x2315dc[_0x20c0('0x3a')],'outboundCongestionCallsDay':_0x2315dc[_0x20c0('0x3b')],'outboundDropCallsDayACS':_0x2315dc[_0x20c0('0x3c')],'outboundDropCallsDayCallersExit':_0x2315dc['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x2315dc['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x2315dc[_0x20c0('0x3d')],'outboundNoSuchCallsDay':_0x2315dc[_0x20c0('0x3e')],'outboundOriginateFailureCallsDay':_0x2315dc[_0x20c0('0x3f')],'outboundReCallsDay':_0x2315dc[_0x20c0('0x40')],'outboundRejectCallsDay':_0x2315dc[_0x20c0('0x41')],'outboundUnknownCallsDay':_0x2315dc[_0x20c0('0x42')],'outboundAbandonedCallsDay':_0x2315dc[_0x20c0('0x43')],'predictiveIntervalAnsweredCalls':_0x2315dc[_0x20c0('0x44')],'predictiveIntervalAvgHoldtime':_0x2315dc[_0x20c0('0x45')],'predictiveIntervalAvgTalktime':_0x2315dc[_0x20c0('0x46')],'predictiveIntervalDroppedCallsCallersExit':_0x2315dc[_0x20c0('0x47')],'predictiveIntervalDroppedCallsTimeout':_0x2315dc[_0x20c0('0x48')],'predictiveIntervalErlangCalls':_0x2315dc[_0x20c0('0x49')],'predictiveIntervalErlangCallsDroppedCalls':_0x2315dc[_0x20c0('0x4a')],'predictiveIntervalHitRate':_0x2315dc['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x2315dc[_0x20c0('0x4b')],'predictiveIntervalPauses':_0x2315dc[_0x20c0('0x4c')],'predictiveIntervalAvailable':_0x2315dc[_0x20c0('0x4d')],'predictiveIntervalTotalCalls':_0x2315dc[_0x20c0('0x4e')],'message':_0x2315dc['message'],'originated':_0x2315dc[_0x20c0('0x4f')],'erlangCalls':_0x2315dc[_0x20c0('0x50')],'erlangCallToSecond':_0x2315dc[_0x20c0('0x51')],'erlangAbandonmentRate':_0x2315dc[_0x20c0('0x52')],'erlangBusyFactor':_0x2315dc[_0x20c0('0x53')],'startPredictive':_0x2315dc['startPredictive'],'startProgressive':_0x2315dc[_0x20c0('0x54')]};if(_0x2315dc['Trunk']){_0x2213f5['Trunk']={'id':_0x2315dc[_0x20c0('0x55')]['id'],'name':_0x2315dc[_0x20c0('0x55')][_0x20c0('0x26')],'active':_0x2315dc[_0x20c0('0x55')][_0x20c0('0x56')],'callerid':_0x2315dc[_0x20c0('0x55')][_0x20c0('0x57')]};}if(_0x2315dc['Interval']){_0x2213f5['Interval']={'id':_0x2315dc['Interval']['id'],'name':_0x2315dc[_0x20c0('0x58')][_0x20c0('0x26')]};}var _0x545b39=md5(JSON[_0x20c0('0x59')](_0x2213f5));if(_0x2315dc[_0x20c0('0x3')]!==_0x545b39){_0x2315dc['md5']=_0x545b39;emit(util['format'](_0x20c0('0x5a'),_0x2213f5[_0x20c0('0x26')]),'voice_queue:save',_0x2213f5);}}}function emitVoiceQueueChannelRemove(_0x44326a){logger['info'](_0x20c0('0x5b'),JSON[_0x20c0('0x59')](_0x44326a));emit(util[_0x20c0('0x5c')](_0x20c0('0x5a'),_0x44326a['name']),_0x20c0('0x5d'),_0x44326a);io[_0x20c0('0x24')](_0x20c0('0x5e'),_0x44326a);}function notSendMessagesQueue(_0x415b41){if(_0x415b41[_0x20c0('0x5f')]){if(_0x415b41[_0x20c0('0x4f')]===0x0&&_0x415b41[_0x20c0('0x2a')]===0x0){_0x415b41[_0x20c0('0x5f')]=![];_0x415b41['available']=0x0;_0x415b41['paused']=0x0;_0x415b41['message']=_0x20c0('0x60');ut['logger'](_0x20c0('0x61'),_0x415b41[_0x20c0('0x26')]+_0x20c0('0x62'));}else{_0x415b41[_0x20c0('0x63')]='IS_DISACTIVED';ut[_0x20c0('0x64')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x415b41['name']+_0x20c0('0x65'));}emitCampaignPreview(_0x415b41);}}Preview[_0x20c0('0xe')][_0x20c0('0x23')]=function(){var _0x446c89=this;setInterval(function(){_0x446c89['syncCampaigns']();},0x7cf);};Preview[_0x20c0('0xe')][_0x20c0('0x66')]=function(){var _0x39852a=this[_0x20c0('0x11')];this['clockClearZombieChannels']+=0x1;for(var _0x44a142 in _0x39852a){if(_0x39852a[_0x20c0('0x67')](_0x44a142)&&(_0x39852a[_0x44a142]['dialMethod']===_0x20c0('0x7')||_0x39852a[_0x44a142][_0x20c0('0x35')]===_0x20c0('0x68'))&&_0x39852a[_0x44a142]['type']===_0x20c0('0x69')){if(this['clockClearZombieChannels']>0x7){this['clockClearZombieChannels']=0x0;this['clearZombieChannels']();}}if(_0x39852a[_0x20c0('0x67')](_0x44a142)&&_0x39852a[_0x44a142]['dialMethod']===_0x20c0('0x7')&&_0x39852a[_0x44a142][_0x20c0('0x25')]===_0x20c0('0x69')){if(_0x39852a[_0x44a142][_0x20c0('0x34')]){this[_0x20c0('0x6a')](_0x39852a[_0x44a142]);if(_0x39852a[_0x44a142][_0x20c0('0x6b')])this[_0x20c0('0x6c')](_0x39852a[_0x44a142]);}else{notSendMessagesQueue(_0x39852a[_0x44a142]);}}}};Preview['prototype'][_0x20c0('0x6d')]=function(_0x3f908c){var _0x523b16=this;this[_0x20c0('0x10')][_0x20c0('0xf')](function(){if(!_[_0x20c0('0x6e')](_0x523b16['actions'][_0x3f908c])){loggerAction['info'](_0x20c0('0x6f'),_0x3f908c,_0x20c0('0x70'),_0x523b16[_0x20c0('0x71')][_0x3f908c]['queue'],'originated:\x20',JSON[_0x20c0('0x59')](_0x523b16[_0x20c0('0x11')][_0x523b16[_0x20c0('0x71')][_0x3f908c]['queue']][_0x20c0('0x4f')]),_0x20c0('0x72'),JSON['stringify'](_0x523b16['campaignsPreview'][_0x523b16[_0x20c0('0x71')][_0x3f908c]['queue']][_0x20c0('0x2a')]),JSON['stringify'](_0x523b16[_0x20c0('0x71')][_0x3f908c][_0x20c0('0x73')]),JSON['stringify'](_['pick'](_0x523b16[_0x20c0('0x71')][_0x3f908c],[_0x20c0('0x74'),_0x20c0('0x75'),_0x20c0('0x76'),_0x20c0('0x77')])));return ami[_0x20c0('0x78')]({'action':_0x20c0('0x79'),'channel':_0x523b16[_0x20c0('0x71')][_0x3f908c]['channel']})[_0x20c0('0x7a')](function(_0x5d6fd5){if(_0x5d6fd5[_0x20c0('0x63')]===_0x20c0('0x7b')){setTimeout(function(){if(_0x523b16[_0x20c0('0x71')][_0x3f908c]){ut['updateOriginated'](_0x523b16['campaignsPreview'][_0x523b16[_0x20c0('0x71')][_0x3f908c][_0x20c0('0x7c')]],_0x20c0('0x7d'));if(_0x523b16[_0x20c0('0x71')][_0x3f908c][_0x20c0('0x73')]===!![]){ut[_0x20c0('0x7e')](_0x523b16[_0x20c0('0x11')][_0x523b16['actions'][_0x3f908c]['queue']],_0x20c0('0x7d'));ut[_0x20c0('0x7f')](_0x20c0('0x80')+_0x3f908c,_0x523b16['actions'][_0x3f908c][_0x20c0('0x7c')]);}ut['loggerError'](_0x20c0('0x81')+_0x3f908c,_0x523b16[_0x20c0('0x71')][_0x3f908c][_0x20c0('0x7c')]);delete _0x523b16['actions'][_0x3f908c];}},0x2328);}});}});};Preview[_0x20c0('0xe')][_0x20c0('0x82')]=function(){var _0x3de5e9=this;loggerAction[_0x20c0('0x83')](_0x20c0('0x84'),_['size'](this[_0x20c0('0x71')]));for(var _0x439717 in this[_0x20c0('0x71')]){if(_0x3de5e9[_0x20c0('0x71')]['hasOwnProperty'](_0x439717)){_0x3de5e9[_0x20c0('0x6d')](_0x439717);}}};Preview['prototype'][_0x20c0('0x6c')]=function(_0x5d40c9){var _0x10b007=this;rpcDb[_0x20c0('0x85')](_0x5d40c9['id'],ut[_0x20c0('0x86')](this[_0x20c0('0x14')]))['then'](function(_0x371cbb){if(!_[_0x20c0('0x6e')](_0x371cbb)){for(var _0x1e1c4b=0x0;_0x1e1c4b<_0x371cbb[_0x20c0('0x87')];_0x1e1c4b+=0x1){if(ut[_0x20c0('0x88')](_0x371cbb[_0x1e1c4b][_0x20c0('0x89')])<_0x5d40c9[_0x20c0('0x8a')]*0x3c){if(_0x371cbb[_0x1e1c4b][_0x20c0('0x8b')]&&!_0x371cbb[_0x1e1c4b]['Agent'][_0x20c0('0x8c')]){_0x10b007[_0x20c0('0x8d')](_0x371cbb[_0x1e1c4b]['id'])[_0x20c0('0x8e')](ut['logger2'](_0x20c0('0x8f')))[_0x20c0('0x7a')](ut['logger2'](_0x20c0('0x8f')));}else{rpcDb['disableContact'](_0x371cbb[_0x1e1c4b]['id']);}}else{var _0x495c9d=new Action(_0x371cbb[_0x1e1c4b],_0x5d40c9);_0x495c9d['starttime']=moment()['format'](_0x20c0('0x90'));_0x5d40c9[_0x20c0('0x40')]+=0x1;ut[_0x20c0('0x91')](_0x495c9d,0x17,_0x20c0('0x92'));if(_0x5d40c9[_0x20c0('0x93')]){rpcDb[_0x20c0('0x94')](ut[_0x20c0('0x95')](_0x371cbb[_0x1e1c4b]));rpcDb[_0x20c0('0x96')](_0x495c9d,_0x20c0('0x97'));}else{ut['logCustomer'](_0x495c9d,0x16,_0x20c0('0x98'));rpcDb[_0x20c0('0x96')](_0x495c9d,_0x20c0('0x99'));rpcDb[_0x20c0('0x9a')](_0x495c9d,_0x20c0('0x99'));}}}}})[_0x20c0('0x7a')](ut[_0x20c0('0x9b')](_0x20c0('0x9c')));};Preview[_0x20c0('0xe')][_0x20c0('0x6a')]=function(_0x54b78f){_0x54b78f[_0x20c0('0x5f')]=!![];if(ut[_0x20c0('0x9d')](_0x54b78f[_0x20c0('0x29')])){_0x54b78f[_0x20c0('0x63')]='AGENTS_NOT_LOGGED';}else if(!ut['isActive'](_0x54b78f[_0x20c0('0x34')])){_0x54b78f[_0x20c0('0x63')]='NOT_ACTIVE';}else if(!this[_0x20c0('0x9e')](_0x54b78f['Trunk'])){if(!this[_0x20c0('0x9e')](_0x54b78f[_0x20c0('0x9f')])){_0x54b78f[_0x20c0('0x63')]='TRUNK_IS_NOT_REACHABLE';}else{_0x54b78f['message']=_0x20c0('0xa0');}}else{_0x54b78f[_0x20c0('0x63')]=_0x20c0('0xa0');}emitCampaignPreview(_0x54b78f);};Preview[_0x20c0('0xe')]['callProgressDetectingCustomer']=function(_0x526bdb,_0x5aa681,_0x72427e){var _0x386129=this;var _0x3c0b96=this['actions'][_0x5aa681];var _0x47b241=this[_0x20c0('0x11')][_0x3c0b96[_0x20c0('0x7c')]];var _0x54b562;if(_0x47b241){switch(_0x72427e){case'1':_0x47b241[_0x20c0('0x3e')]+=0x1;_0x3c0b96['countnosuchnumberretry']+=0x1;_0x3c0b96['countglobal']=ut['totalGlobal'](_0x3c0b96);ut[_0x20c0('0x91')](_0x3c0b96,0x0,'NoSuchNumber');ami[_0x20c0('0x24')]('custom:agentnosuchnumber',ut[_0x20c0('0xa1')](_0x3c0b96,_0x20c0('0xa2')));rpcDb[_0x20c0('0x96')](_0x3c0b96,'[callProgressDetectingCustomer][logNoSuch]');if(ut['totalGlobal'](_0x3c0b96)>=_0x47b241[_0x20c0('0xa3')]){_0x54b562=ut[_0x20c0('0xa4')](_0x3c0b96,0xf,_0x20c0('0xa5'));rpcDb[_0x20c0('0x9a')](_0x54b562,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x3c0b96['countnosuchnumberretry']>=_0x47b241[_0x20c0('0xa6')]){rpcDb[_0x20c0('0x9a')](_0x3c0b96,_0x20c0('0xa7'));}else{rpcDb[_0x20c0('0xa8')](ut['scheduledAt'](_0x3c0b96,_0x20c0('0xa9'),_0x47b241[_0x20c0('0xaa')]),_0x3c0b96[_0x20c0('0xab')],_0x3c0b96['activeContact']);}}delete this['actions'][_0x526bdb['linkedid']];break;case _0x20c0('0xac'):var _0xe3c380=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3c0b96[_0x20c0('0xad')]=_0xe3c380;_0x3c0b96['answertime']=_0xe3c380;_0x3c0b96['dialAnswer']=!![];_0x47b241[_0x20c0('0x2a')]+=0x1;logger[_0x20c0('0x83')](_0x20c0('0xae'),_0x3c0b96[_0x20c0('0xaf')],_0x20c0('0xb0'),_0x47b241[_0x20c0('0x26')],_0x20c0('0x72'),_0x47b241[_0x20c0('0x2a')]);ami[_0x20c0('0x24')](_0x20c0('0xb1'),ut[_0x20c0('0xa1')](_0x3c0b96,'connect',this[_0x20c0('0x11')][_0x3c0b96[_0x20c0('0x7c')]]));if(_0x47b241[_0x20c0('0xb2')]){ami[_0x20c0('0x24')]('custom:agentConnectPreview',ut[_0x20c0('0xb3')](_0x3c0b96));}break;case'16':ami[_0x20c0('0x24')](_0x20c0('0xb4'),ut[_0x20c0('0xa1')](_0x3c0b96,_0x20c0('0xb5'),this[_0x20c0('0x11')][_0x3c0b96[_0x20c0('0x7c')]]));emitVoiceQueueChannelRemove(ut[_0x20c0('0xa1')](_0x3c0b96,_0x20c0('0xb5')));_0x47b241[_0x20c0('0xb6')]+=0x1;_0x47b241[_0x20c0('0x2f')]+=0x1;_0x47b241[_0x20c0('0x28')]+=0x1;ut[_0x20c0('0x7e')](_0x47b241,_0x20c0('0xb7'));_0x3c0b96[_0x20c0('0xb8')]=ut[_0x20c0('0xb9')](_0x3c0b96);ut[_0x20c0('0x91')](_0x3c0b96,0x4,_0x20c0('0xba'));rpcDb[_0x20c0('0x96')](_0x3c0b96,_0x20c0('0xbb'));rpcDb[_0x20c0('0x9a')](_0x3c0b96,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb['crateCustomerReportQueue'](_0x3c0b96);_0x47b241[_0x20c0('0x2c')]+=_0x3c0b96[_0x20c0('0xbc')];_0x47b241[_0x20c0('0x2b')]+=_0x3c0b96[_0x20c0('0xbc')];logger['info'](_0x20c0('0xbd'),_0x3c0b96[_0x20c0('0xaf')],_0x20c0('0xb0'),_0x47b241['name'],'pTalking:\x20',_0x47b241[_0x20c0('0x2a')]);delete this[_0x20c0('0x71')][_0x526bdb[_0x20c0('0xbe')]];break;case _0x20c0('0xbf'):_0x47b241['outboundBusyCallsDay']+=0x1;_0x3c0b96['countbusyretry']+=0x1;_0x3c0b96[_0x20c0('0xb8')]=ut[_0x20c0('0xb9')](_0x3c0b96);ut[_0x20c0('0x91')](_0x3c0b96,0x5,_0x20c0('0xc0'));ami[_0x20c0('0x24')](_0x20c0('0xc1'),ut['buildObj'](_0x3c0b96,_0x20c0('0xc2')));rpcDb[_0x20c0('0x96')](_0x3c0b96,'[callProgressDetectingCustomer][logBusy]');if(ut['totalGlobal'](_0x3c0b96)>=_0x47b241[_0x20c0('0xa3')]){_0x54b562=ut['cloneAction'](_0x3c0b96,0xf,_0x20c0('0xa5'));rpcDb[_0x20c0('0x9a')](_0x54b562,_0x20c0('0xc3'));}else{if(_0x3c0b96[_0x20c0('0xc4')]>=_0x47b241[_0x20c0('0xc5')]){rpcDb[_0x20c0('0x9a')](_0x3c0b96,_0x20c0('0xc6'));}else{rpcDb[_0x20c0('0xa8')](ut['scheduledAt'](_0x3c0b96,_0x20c0('0xc4'),_0x47b241[_0x20c0('0xc7')]),_0x3c0b96[_0x20c0('0xab')],_0x3c0b96[_0x20c0('0xc8')]);}}break;case'NOANSWER':_0x47b241['outboundNoAnswerCallsDay']+=0x1;_0x3c0b96['countnoanswerretry']+=0x1;_0x3c0b96['countglobal']=ut[_0x20c0('0xb9')](_0x3c0b96);ut[_0x20c0('0x91')](_0x3c0b96,0x3,'NoAnswer');ami['emit'](_0x20c0('0xc9'),ut['buildObj'](_0x3c0b96,'noanswer'));rpcDb[_0x20c0('0x96')](_0x3c0b96,_0x20c0('0xca'));if(ut[_0x20c0('0xb9')](_0x3c0b96)>=_0x47b241[_0x20c0('0xa3')]){_0x54b562=ut[_0x20c0('0xa4')](_0x3c0b96,0xf,'Global');rpcDb[_0x20c0('0x9a')](_0x54b562,_0x20c0('0xcb'));}else{if(_0x3c0b96[_0x20c0('0xcc')]>=_0x47b241[_0x20c0('0xcd')]){rpcDb[_0x20c0('0x9a')](_0x3c0b96,_0x20c0('0xca'));}else{rpcDb['rescheduleContact'](ut[_0x20c0('0xce')](_0x3c0b96,_0x20c0('0xcc'),_0x47b241['dialNoAnswerRetryFrequency']),_0x3c0b96[_0x20c0('0xab')],_0x3c0b96[_0x20c0('0xc8')]);}}break;case _0x20c0('0xcf'):_0x47b241[_0x20c0('0x3b')]+=0x1;_0x3c0b96[_0x20c0('0xd0')]+=0x1;_0x3c0b96[_0x20c0('0xb8')]=ut[_0x20c0('0xb9')](_0x3c0b96);ut[_0x20c0('0x91')](_0x3c0b96,0x8,_0x20c0('0xd1'));ami[_0x20c0('0x24')]('custom:agentcongestion',ut[_0x20c0('0xa1')](_0x3c0b96,_0x20c0('0xd2')));rpcDb[_0x20c0('0x96')](_0x3c0b96,_0x20c0('0xd3'));if(ut[_0x20c0('0xb9')](_0x3c0b96)>=_0x47b241[_0x20c0('0xa3')]){_0x54b562=ut[_0x20c0('0xa4')](_0x3c0b96,0xf,_0x20c0('0xa5'));rpcDb['createCustomerFinal'](_0x54b562,_0x20c0('0xd4'));}else{if(_0x3c0b96[_0x20c0('0xd0')]>=_0x47b241[_0x20c0('0xd5')]){rpcDb[_0x20c0('0x9a')](_0x3c0b96,_0x20c0('0xd3'));}else{rpcDb[_0x20c0('0xa8')](ut[_0x20c0('0xce')](_0x3c0b96,_0x20c0('0xd0'),_0x47b241['dialBusyRetryFrequency']),_0x3c0b96['unlockAgent'],_0x3c0b96[_0x20c0('0xc8')]);}}break;case _0x20c0('0xd6'):_0x47b241[_0x20c0('0x41')]+=0x1;_0x3c0b96[_0x20c0('0xd7')]+=0x1;_0x3c0b96[_0x20c0('0xb8')]=ut['totalGlobal'](_0x3c0b96);ut[_0x20c0('0x91')](_0x3c0b96,0x14,_0x20c0('0xd8'));ami['emit'](_0x20c0('0xd9'),ut[_0x20c0('0xa1')](_0x3c0b96,_0x20c0('0xda')));rpcDb[_0x20c0('0x96')](_0x3c0b96,_0x20c0('0xdb'));if(ut[_0x20c0('0xb9')](_0x3c0b96)>=_0x47b241[_0x20c0('0xa3')]){_0x54b562=ut[_0x20c0('0xa4')](_0x3c0b96,0x14,'AgentReject');rpcDb[_0x20c0('0x9a')](_0x54b562,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x3c0b96[_0x20c0('0xd7')]>=_0x47b241[_0x20c0('0xdc')]){rpcDb[_0x20c0('0x9a')](_0x3c0b96,_0x20c0('0xdd'));}else{rpcDb[_0x20c0('0xa8')](ut[_0x20c0('0xce')](_0x3c0b96,'countagentrejectretry',_0x47b241[_0x20c0('0xde')]),_0x3c0b96[_0x20c0('0xab')],_0x3c0b96['activeContact']);}}break;case _0x20c0('0xdf'):_0x47b241[_0x20c0('0x43')]+=0x1;_0x3c0b96[_0x20c0('0xe0')]+=0x1;_0x3c0b96['countglobal']=ut['totalGlobal'](_0x3c0b96);ut[_0x20c0('0x91')](_0x3c0b96,0xb,_0x20c0('0xe1'));rpcDb[_0x20c0('0x96')](_0x3c0b96,_0x20c0('0xe2'));if(ut['totalGlobal'](_0x3c0b96)>=_0x47b241[_0x20c0('0xa3')]){_0x54b562=ut[_0x20c0('0xa4')](_0x3c0b96,0xf,_0x20c0('0xa5'));rpcDb['createCustomerFinal'](_0x54b562,_0x20c0('0xe2'));}else{if(_0x3c0b96[_0x20c0('0xe3')]>=_0x47b241['dialAbandonedMaxRety']){rpcDb[_0x20c0('0x9a')](_0x3c0b96,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb[_0x20c0('0xa8')](ut[_0x20c0('0xce')](_0x3c0b96,_0x20c0('0xe0'),_0x47b241['dialAbandonedRetryFrequency']),_0x3c0b96['unlockAgent'],_0x3c0b96[_0x20c0('0xc8')]);}}break;case'18':_0x47b241[_0x20c0('0x42')]+=0x1;_0x3c0b96[_0x20c0('0xe4')]+=0x1;_0x3c0b96[_0x20c0('0xb8')]=ut[_0x20c0('0xb9')](_0x3c0b96);ut[_0x20c0('0x91')](_0x3c0b96,0x12,_0x526bdb[_0x20c0('0xe5')]||_0x526bdb[_0x20c0('0xe6')]);ami['emit']('custom:amd',ut[_0x20c0('0xa1')](_0x3c0b96,_0x20c0('0xe7')));rpcDb[_0x20c0('0x96')](_0x3c0b96,_0x20c0('0xe8'));if(ut[_0x20c0('0xb9')](_0x3c0b96)>=_0x47b241[_0x20c0('0xa3')]){_0x54b562=ut[_0x20c0('0xa4')](_0x3c0b96,0xf,_0x20c0('0xa5'));rpcDb[_0x20c0('0x9a')](_0x54b562,_0x20c0('0xe8'));}else{rpcDb[_0x20c0('0x9a')](_0x3c0b96,'[callProgressDetectingCustomer][hangupInAMD]');}delete this['actions'][_0x526bdb[_0x20c0('0xbe')]];break;case'19':_0x47b241[_0x20c0('0x42')]+=0x1;_0x3c0b96[_0x20c0('0xb8')]=ut[_0x20c0('0xb9')](_0x3c0b96);ut['logCustomer'](_0x3c0b96,0x13,_0x526bdb[_0x20c0('0xe5')]||_0x526bdb[_0x20c0('0xe6')]);ami[_0x20c0('0x24')]('custom:amd',ut[_0x20c0('0xa1')](_0x3c0b96,_0x20c0('0xe7')));rpcDb[_0x20c0('0x96')](_0x3c0b96,_0x20c0('0xe9'));if(ut['totalGlobal'](_0x3c0b96)>=_0x47b241[_0x20c0('0xa3')]){_0x54b562=ut[_0x20c0('0xa4')](_0x3c0b96,0xf,_0x20c0('0xa5'));rpcDb[_0x20c0('0x9a')](_0x54b562,_0x20c0('0xe9'));}else{rpcDb[_0x20c0('0x9a')](_0x3c0b96,_0x20c0('0xe9'));}delete this['actions'][_0x526bdb[_0x20c0('0xbe')]];break;default:if(_0x3c0b96[_0x20c0('0x73')]){ut[_0x20c0('0x7e')](_0x47b241,_0x20c0('0xea'));ut[_0x20c0('0x7f')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x47b241[_0x20c0('0x26')],_0x526bdb);}_0x47b241[_0x20c0('0x42')]+=0x1;_0x3c0b96[_0x20c0('0xb8')]=ut[_0x20c0('0xb9')](_0x3c0b96);ut[_0x20c0('0x91')](_0x3c0b96,0xc,_0x526bdb[_0x20c0('0xe5')]||_0x526bdb[_0x20c0('0xe6')]);rpcDb[_0x20c0('0x96')](_0x3c0b96,_0x20c0('0xeb'));if(ut[_0x20c0('0xb9')](_0x3c0b96)>=_0x47b241[_0x20c0('0xa3')]){_0x54b562=ut['cloneAction'](_0x3c0b96,0xf,'Global');rpcDb[_0x20c0('0x9a')](_0x54b562,_0x20c0('0xec'));}else{rpcDb['createCustomerFinal'](_0x3c0b96,_0x20c0('0xec'));}delete this[_0x20c0('0x71')][_0x526bdb['linkedid']];}if(!(_0x3c0b96[_0x20c0('0x73')]&&_0x72427e==='16')){ut['updateOriginated'](_0x47b241,_0x20c0('0xed'));logger[_0x20c0('0x83')](_0x20c0('0xee'),_0x3c0b96[_0x20c0('0xaf')],_0x20c0('0xb0'),_0x47b241[_0x20c0('0x26')],_0x20c0('0xef'),_0x47b241['originated']);}if(_0x72427e!==_0x20c0('0xac')){delete this[_0x20c0('0x71')][_0x526bdb[_0x20c0('0xbe')]];delete this[_0x20c0('0x71')][_0x526bdb['destlinkedid']];}}};Preview[_0x20c0('0xe')][_0x20c0('0xf0')]=function(_0x3f247b,_0x4e35c4,_0x213cdd){if(_[_0x20c0('0xf1')](_0x4e35c4)&&_0x20c0('0xf2')!==typeof _0x4e35c4){return;}if(_[_0x20c0('0xf1')](_0x213cdd)&&'object'!==typeof _0x213cdd){return;}switch(_0x213cdd[_0x20c0('0xf3')]){case'0':ut[_0x20c0('0xf4')](_0x3f247b,0x0,_0x20c0('0xf5'));rpcDb[_0x20c0('0xf6')](_0x3f247b,_0x20c0('0xf7'));break;case'3':ut[_0x20c0('0xf4')](_0x3f247b,0x3,_0x20c0('0xf8'));rpcDb[_0x20c0('0xf6')](_0x3f247b,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0x20c0('0xf4')](_0x3f247b,0x5,'Busy');rpcDb[_0x20c0('0xf6')](_0x3f247b,_0x20c0('0xf9'));break;case'8':ut[_0x20c0('0xf4')](_0x3f247b,0x8,_0x20c0('0xd1'));rpcDb[_0x20c0('0xf6')](_0x3f247b,_0x20c0('0xfa'));break;case'22':ut[_0x20c0('0xf4')](_0x3f247b,0x16,'AnswerAGI');rpcDb[_0x20c0('0xf6')](_0x3f247b,_0x20c0('0xfb'));break;default:ut[_0x20c0('0xf4')](_0x3f247b,0xc,_0x213cdd['reason']);rpcDb[_0x20c0('0xf6')](_0x3f247b,_0x20c0('0xfa'));}ut[_0x20c0('0xfc')](_0x4e35c4,_0x20c0('0xfd'));logger['info']('[originated][decrement][callProgressDetectingAgent]',_0x3f247b['uniqueid'],_0x20c0('0xb0'),_0x4e35c4['name'],_0x20c0('0xef'),_0x4e35c4[_0x20c0('0x4f')]);delete this[_0x20c0('0x71')][_0x3f247b[_0x20c0('0xaf')]];};Preview[_0x20c0('0xe')][_0x20c0('0xfe')]=function(_0x1b2a21,_0x44e05e,_0x5a7afb,_0x5730ea,_0x1ba7c8){var _0x20c5bb=this;return new BPromise(function(_0xca0a7b,_0x2c3e65){if(_[_0x20c0('0x6e')](_0x44e05e)||_[_0x20c0('0x6e')](_0x44e05e[_0x20c0('0xff')])||_[_0x20c0('0x6e')](_0x44e05e['Contact'][_0x20c0('0x100')])||_[_0x20c0('0x6e')](_0x44e05e[_0x20c0('0x76')])){_0x2c3e65(ut[_0x20c0('0x63')]('Contact\x20is\x20undefined',_0x5730ea,_0x1ba7c8));return;}var _0x1aed96=uuid['v4']();var _0x3e8c95=_0x20c5bb[_0x20c0('0x11')][_0x44e05e[_0x20c0('0x70')][_0x20c0('0x26')]];var _0x257cc8=_0x5a7afb?_0x20c5bb[_0x20c0('0x14')][_0x5a7afb]['id']:undefined;_0x20c5bb[_0x20c0('0x71')][_0x1aed96]=new Action(_0x44e05e,_0x3e8c95,_0x1aed96,_0x5a7afb,_0x257cc8);var _0x6322b1=_0x20c5bb['actions'][_0x1aed96];_0x6322b1[_0x20c0('0xab')]=_0x5730ea;_0x6322b1[_0x20c0('0xc8')]=_0x1ba7c8;_0x6322b1['lookAgent']=_0x5a7afb;if(_[_0x20c0('0x101')](_0x1b2a21)){_0x20c5bb['execCall'](_0x6322b1,_0x3e8c95,_0x44e05e,_0x5a7afb)['then'](function(_0x208c03){logger[_0x20c0('0x83')](_0x20c0('0x102'),'Queue:\x20'+_0x6322b1[_0x20c0('0x7c')]+_0x20c0('0x103')+_0x6322b1['idContact'],JSON[_0x20c0('0x59')](_0x208c03));ami[_0x20c0('0x24')]('custom:agentcalled',ut[_0x20c0('0xa1')](_0x6322b1,_0x20c0('0x104'),_0x20c5bb[_0x20c0('0x11')][_0x6322b1[_0x20c0('0x7c')]]));_0xca0a7b(ut[_0x20c0('0x63')](_0x20c0('0x105')));})[_0x20c0('0x7a')](function(_0x22eadd){ut[_0x20c0('0x64')](_0x20c0('0x106'),_0x22eadd);_0x2c3e65(ut[_0x20c0('0x63')](_0x20c0('0x107'),_0x5730ea,_0x1ba7c8));});}else{_0x3e8c95[_0x20c0('0x39')]+=0x1;ut[_0x20c0('0x108')](_0x6322b1);rpcDb[_0x20c0('0x109')](_0x6322b1,_0x20c0('0x10a'));delete _0x20c5bb[_0x20c0('0x71')][_0x1aed96];_0x2c3e65(ut[_0x20c0('0x63')](_0x20c0('0x10b'),_0x5730ea,_0x1ba7c8));}});};Preview[_0x20c0('0xe')][_0x20c0('0x9e')]=function(_0x613d7){return!_[_0x20c0('0x6e')](_0x613d7)&&!_[_0x20c0('0x6e')](_0x613d7[_0x20c0('0x26')])&&!_[_0x20c0('0x6e')](_0x613d7['active'])&&_0x613d7[_0x20c0('0x56')]&&!_['isNil'](this[_0x20c0('0x13')][util[_0x20c0('0x5c')]('SIP/%s',_0x613d7[_0x20c0('0x26')])])&&!_[_0x20c0('0x6e')](this[_0x20c0('0x13')][util[_0x20c0('0x5c')](_0x20c0('0x10c'),_0x613d7[_0x20c0('0x26')])][_0x20c0('0x79')])&&(this[_0x20c0('0x13')][util[_0x20c0('0x5c')](_0x20c0('0x10c'),_0x613d7[_0x20c0('0x26')])]['status']===_0x20c0('0x10d')||this[_0x20c0('0x13')][util[_0x20c0('0x5c')](_0x20c0('0x10c'),_0x613d7[_0x20c0('0x26')])][_0x20c0('0x79')]==='unmonitored');};Preview['prototype'][_0x20c0('0x8d')]=function(_0x312ae,_0x5357cf){var _0x118460=this;return new BPromise(function(_0x3874fa,_0x2a34ec){_0x118460[_0x20c0('0x10e')](_0x312ae,_0x5357cf)[_0x20c0('0x8e')](function(_0x21c5a0){_0x3874fa(_[_0x20c0('0x10f')](_0x21c5a0,['message']));})[_0x20c0('0x7a')](function(_0x43c7b8){if(_0x43c7b8[_0x20c0('0x110')]){rpcDb[_0x20c0('0x111')](_0x312ae);}if(_0x43c7b8[_0x20c0('0x56')]){rpcDb['disableContact'](_0x312ae);}_0x2a34ec(_[_0x20c0('0x10f')](_0x43c7b8,[_0x20c0('0x63')]));});});};Preview['prototype'][_0x20c0('0x10e')]=function(_0x234f1d,_0x965553){var _0xb26f55=this;return new BPromise(function(_0x5089fc,_0x4628ce){var _0xee7f40,_0x5e0d39;rpcDb['getContactPreview'](_0x234f1d)['then'](function(_0x21bbf4){if(!_[_0x20c0('0x6e')](_0x21bbf4[0x0])){_0x5e0d39=_0x21bbf4[0x0][_0x20c0('0x112')]?![]:!![];_0xee7f40=_0x21bbf4[0x0]['recallme']?!![]:![];_0xee7f40=_0x965553?!![]:_0xee7f40;}var _0x291928=_0xb26f55['validateContact'](_0x21bbf4);if(_0x291928['isValid']){rpcDb[_0x20c0('0x113')](_[_0x20c0('0x10f')](_0x21bbf4[0x0],['VoiceQueueId','Contact.phone']))[_0x20c0('0x8e')](function(_0x282dfc){_0xb26f55[_0x20c0('0xfe')](_0x282dfc,_0x21bbf4[0x0],_0x965553,_0x5e0d39,_0xee7f40)[_0x20c0('0x8e')](function(_0x271b68){_0x5089fc(_0x271b68);})[_0x20c0('0x7a')](function(_0xd47161){_0x4628ce(_0xd47161);});})[_0x20c0('0x7a')](function(_0x311f02){ut[_0x20c0('0x64')]('[Preview][checkIsBlackList]',_0x311f02);_0x4628ce(ut[_0x20c0('0x63')](_0x20c0('0x114'),_0x5e0d39,_0xee7f40));});}else{_0x4628ce(ut[_0x20c0('0x63')](_0x291928[_0x20c0('0x63')],_0x5e0d39,_0xee7f40));}})[_0x20c0('0x7a')](function(_0x193d61){ut['logger'](_0x20c0('0x115'),_0x193d61);_0x4628ce(ut[_0x20c0('0x63')](_0x20c0('0x114'),![],!![]));});});};Preview[_0x20c0('0xe')]['validateContact']=function(_0x52549c){if(_[_0x20c0('0x6e')](_0x52549c)||_[_0x20c0('0x101')](_0x52549c)||!_[_0x20c0('0x6e')](_0x52549c[0x0][_0x20c0('0x8b')])&&_[_0x20c0('0x6e')](_0x52549c[0x0]['Agent'][_0x20c0('0x26')])){ut[_0x20c0('0x64')](_0x20c0('0x116'),_0x52549c);return{'isValid':![],'message':_0x20c0('0x117')};}var _0x2b493b=this[_0x20c0('0x11')][_0x52549c[0x0][_0x20c0('0x70')][_0x20c0('0x26')]];_0x2b493b['message']=_0x20c0('0xa0');if(_[_0x20c0('0x6e')](_0x2b493b)){ut['logger'](_0x20c0('0x118'),_0x2b493b);return{'isValid':![],'message':_0x20c0('0x119')};}if(!this[_0x20c0('0x9e')](_0x2b493b[_0x20c0('0x55')])){ut[_0x20c0('0x64')](_0x20c0('0x11a'),_0x20c0('0x11b')+_0x2b493b[_0x20c0('0x26')]+_0x20c0('0x11c'));if(!this[_0x20c0('0x9e')](_0x2b493b[_0x20c0('0x9f')])){ut[_0x20c0('0x64')](_0x20c0('0x11a'),_0x2b493b[_0x20c0('0x26')]+_0x20c0('0x11d'));return{'isValid':![],'message':_0x20c0('0x11e')};}}if(!ut[_0x20c0('0x11f')](_0x2b493b['dialActive'])){ut[_0x20c0('0x64')](_0x20c0('0x120'),_0x2b493b[_0x20c0('0x26')]+_0x20c0('0x121'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x2b493b[_0x20c0('0x26')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview['prototype']['execCall']=function(_0x387c4,_0x51b8ae,_0x3ce9d8,_0x51c89d){var _0x4565df=this;return new BPromise(function(_0x162249,_0x8070b5){var _0x17d0a6=_0x387c4[_0x20c0('0xaf')];var _0x400cc2=_0x4565df[_0x20c0('0x9e')](_0x51b8ae[_0x20c0('0x55')])?util['format'](_0x20c0('0x122'),_0x51b8ae['Trunk'][_0x20c0('0x26')],_[_0x20c0('0x6e')](_0x51b8ae['dialPrefix'])?'':_0x51b8ae[_0x20c0('0x37')][_0x20c0('0x123')]()||'',_0x51b8ae[_0x20c0('0x124')]>0x0?_0x3ce9d8['Contact'][_0x20c0('0x100')][_0x20c0('0x125')](_0x51b8ae['dialCutDigit']):_0x3ce9d8['Contact']['phone']):util[_0x20c0('0x5c')](_0x20c0('0x122'),_['isNil'](_0x51b8ae[_0x20c0('0x9f')])?_0x51b8ae[_0x20c0('0x55')][_0x20c0('0x26')]:_0x51b8ae[_0x20c0('0x9f')][_0x20c0('0x26')],_[_0x20c0('0x6e')](_0x51b8ae[_0x20c0('0x37')])?'':_0x51b8ae[_0x20c0('0x37')][_0x20c0('0x123')]()||'',_0x51b8ae[_0x20c0('0x124')]>0x0?_0x3ce9d8[_0x20c0('0xff')]['phone'][_0x20c0('0x125')](_0x51b8ae[_0x20c0('0x124')]):_0x3ce9d8[_0x20c0('0xff')]['phone']);var _0x14b270=_0x4565df['isTrunkReachable'](_0x51b8ae[_0x20c0('0x55')])?ut[_0x20c0('0x126')](_0x51b8ae[_0x20c0('0x55')][_0x20c0('0x57')],_0x51b8ae[_0x20c0('0x127')],_0x51b8ae['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x20c0('0x128')](_0x51b8ae[_0x20c0('0x129')],_0x51b8ae[_0x20c0('0x12a')]):_0x51b8ae[_0x20c0('0x129')]):ut[_0x20c0('0x126')](_[_0x20c0('0x6e')](_0x51b8ae['TrunkBackup'])?_0x51b8ae[_0x20c0('0x55')][_0x20c0('0x57')]:_0x51b8ae[_0x20c0('0x9f')]['callerid'],_0x51b8ae[_0x20c0('0x127')],_0x51b8ae['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x20c0('0x128')](_0x51b8ae['dialOriginateCallerIdNumber'],_0x51b8ae['dialRandomLastDigitCallerIdNumber']):_0x51b8ae['dialOriginateCallerIdNumber']);if(_0x14b270){_0x387c4[_0x20c0('0x12b')]=ut[_0x20c0('0x12c')](_0x14b270);_0x387c4['originatecalleridnum']=ut[_0x20c0('0x12d')](_0x14b270);}var _0x57d1d4=ut[_0x20c0('0x12e')](_0x51b8ae,_0x3ce9d8,_0x400cc2,_0x14b270,_0x17d0a6,_0x387c4);_['merge'](_0x387c4,ut[_0x20c0('0x12f')](_0x57d1d4));_0x387c4['starttime']=moment()[_0x20c0('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0x20c0('0x78')](ut[_0x20c0('0x130')](_0x387c4,_0x51b8ae,_0x57d1d4,_0x387c4[_0x20c0('0xc8')],_0x51c89d))['then'](function(_0x2f1a89){_0x51b8ae[_0x20c0('0x4f')]+=0x1;logger[_0x20c0('0x83')](_0x20c0('0x131'),_0x17d0a6,_0x20c0('0xb0'),_0x51b8ae[_0x20c0('0x26')],'originated:\x20',_0x51b8ae['originated']);_0x162249(_0x2f1a89);})[_0x20c0('0x7a')](function(_0x163965){ut[_0x20c0('0xf4')](_0x387c4,0xe,_0x20c0('0x132'));rpcDb[_0x20c0('0xf6')](_0x387c4,'[originateFailure][logOriginateFailure]');_0x8070b5(_0x163965);});});};Preview['prototype'][_0x20c0('0x1f')]=function(_0x1d7d09){if(this[_0x20c0('0x71')][_0x1d7d09[_0x20c0('0xbe')]]){this['actions'][_0x1d7d09['linkedid']][_0x20c0('0x133')]=_0x1d7d09['channel'];}};Preview[_0x20c0('0xe')]['syncOriginateResponse']=function(_0x1be240){var _0x1e6150=this;var _0xbf8078=this[_0x20c0('0x71')][_0x1be240[_0x20c0('0x134')]];if(_0xbf8078){if(_0xbf8078[_0x20c0('0x135')]&&this[_0x20c0('0x14')][_0xbf8078[_0x20c0('0x135')]]){ut[_0x20c0('0x136')](_0xbf8078,this[_0x20c0('0x14')][_0xbf8078[_0x20c0('0x135')]][_0x20c0('0x26')],this[_0x20c0('0x14')][_0xbf8078[_0x20c0('0x135')]]['id']);}var _0x2d3476=_[_0x20c0('0x137')](_0xbf8078);_0x2d3476[_0x20c0('0xad')]=moment()['format'](_0x20c0('0x90'));var _0x2d9f40=_0x1e6150['campaignsPreview'][_0xbf8078[_0x20c0('0x7c')]];if(ut[_0x20c0('0x138')](_0x1be240[_0x20c0('0x139')])){if(_0xbf8078[_0x20c0('0xab')]){rpcDb[_0x20c0('0x111')](_0xbf8078['idContact']);}if(_0xbf8078[_0x20c0('0xc8')]){rpcDb[_0x20c0('0x13a')](_0xbf8078[_0x20c0('0x13b')]);}ami['emit'](_0x20c0('0x13c'),ut[_0x20c0('0xa1')](_0xbf8078,_0x20c0('0x13d'),this[_0x20c0('0x11')][_0xbf8078[_0x20c0('0x7c')]]));this[_0x20c0('0xf0')](_0x2d3476,_0x2d9f40,_0x1be240);}else{_0xbf8078[_0x20c0('0x13e')]=moment()[_0x20c0('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0x20c0('0xf4')](_0x2d3476,0x4,_0x20c0('0xba'));rpcDb[_0x20c0('0xf6')](_0x2d3476,_0x20c0('0x13f'));}}};Preview[_0x20c0('0xe')][_0x20c0('0x1a')]=function(_0x2b326c){var _0xfabc53=this;var _0x2b9a47=this[_0x20c0('0x71')][_0x2b326c[_0x20c0('0xbe')]];var _0x4cae55;if(_0x2b9a47){_0x4cae55=this['campaignsPreview'][_0x2b9a47[_0x20c0('0x7c')]];logger[_0x20c0('0x83')](_0x20c0('0x140'),_0x2b326c['linkedid'],_0x20c0('0xb0'),_0x4cae55[_0x20c0('0x26')],_0x20c0('0x72'),_0x4cae55[_0x20c0('0x2a')]);}if(this[_0x20c0('0x71')][_0x2b326c[_0x20c0('0xbe')]]&&_0x2b326c[_0x20c0('0xbe')]!==_0x2b326c[_0x20c0('0xaf')]){if(_0x2b326c[_0x20c0('0x141')]==='16'&&this['actions'][_0x2b326c['linkedid']][_0x20c0('0x73')]){this[_0x20c0('0x142')](_0x2b326c,_0x2b326c[_0x20c0('0xbe')],_0x2b326c['cause']);}else if(this[_0x20c0('0x71')][_0x2b326c[_0x20c0('0xbe')]][_0x20c0('0x73')]){logger[_0x20c0('0x83')]('[syncHangup][talking][cause]',_0x2b326c[_0x20c0('0xbe')],_0x2b326c[_0x20c0('0x141')],_0x20c0('0xb0'),_0x4cae55[_0x20c0('0x26')],_0x20c0('0x72'),_0x4cae55[_0x20c0('0x2a')]);this['callProgressDetectingCustomer'](_0x2b326c,_0x2b326c['linkedid'],_0x2b326c['cause']);}}else if(_0x2b9a47&&_[_0x20c0('0x6e')](_0x2b9a47[_0x20c0('0x143')])&&_0x4cae55['dialQueueProject']&&_0x2b326c[_0x20c0('0xbe')]===_0x2b326c['uniqueid']&&_[_0x20c0('0x6e')](_0x2b326c['reason'])&&_0x2b326c[_0x20c0('0x141')]==='16'&&_0x2b326c['channelstate']==='6'&&_['isUndefined'](_0x2b9a47[_0x20c0('0x144')])){if(_0x2b9a47[_0x20c0('0xab')]){rpcDb[_0x20c0('0x111')](_0x2b9a47[_0x20c0('0x13b')]);}if(_0x2b9a47[_0x20c0('0xc8')]){rpcDb['disableContact'](_0x2b9a47['idContact']);}_0x2b326c['reason']='22';this[_0x20c0('0xf0')](_0x2b9a47,_0x4cae55,_0x2b326c);}else if(_0x2b9a47&&_0x2b9a47[_0x20c0('0x144')]){if(_0x2b326c[_0x20c0('0x141')]==='16'&&this[_0x20c0('0x71')][_0x2b326c['linkedid']][_0x20c0('0x73')]){logger[_0x20c0('0x83')]('[syncHangup][talking][transfer]',_0x2b326c[_0x20c0('0xbe')],_0x2b326c[_0x20c0('0x141')],_0x20c0('0xb0'),_0x4cae55[_0x20c0('0x26')],_0x20c0('0x72'),_0x4cae55[_0x20c0('0x2a')]);this[_0x20c0('0x142')](_0x2b326c,_0x2b326c[_0x20c0('0xbe')],_0x2b326c[_0x20c0('0x141')]);}else if(this[_0x20c0('0x71')][_0x2b326c[_0x20c0('0xbe')]][_0x20c0('0x73')]){logger[_0x20c0('0x83')](_0x20c0('0x145'),_0x2b326c[_0x20c0('0xbe')],_0x2b326c[_0x20c0('0x141')],_0x20c0('0xb0'),_0x4cae55[_0x20c0('0x26')],_0x20c0('0x72'),_0x4cae55[_0x20c0('0x2a')]);this['callProgressDetectingCustomer'](_0x2b326c,_0x2b326c[_0x20c0('0xbe')],_0x2b326c[_0x20c0('0x141')]);}}};Preview[_0x20c0('0xe')][_0x20c0('0x1d')]=function(_0x5a9e91){if(this[_0x20c0('0x71')][_0x5a9e91[_0x20c0('0x146')]]&&_0x5a9e91[_0x20c0('0x146')]!==_0x5a9e91[_0x20c0('0x147')]){this['callProgressDetectingCustomer'](_0x5a9e91,_0x5a9e91[_0x20c0('0x146')],_0x5a9e91['dialstatus']);}};Preview[_0x20c0('0xe')][_0x20c0('0x148')]=function(_0x16611){if(this[_0x20c0('0x71')][_0x16611[_0x20c0('0xbe')]]&&_0x16611['linkedid']!==_0x16611[_0x20c0('0xaf')]&&!this['actions'][_0x16611[_0x20c0('0xbe')]][_0x20c0('0x73')]){if(_0x16611['cause']==='1'){this[_0x20c0('0x142')](_0x16611,_0x16611[_0x20c0('0xbe')],_0x16611[_0x20c0('0x141')]);}}};Preview[_0x20c0('0xe')][_0x20c0('0x149')]=function(_0x5c62fc,_0x13f1cd,_0x48f49){if(this[_0x20c0('0x71')][_0x5c62fc]){if(_[_0x20c0('0x6e')](this[_0x20c0('0x71')][_0x5c62fc][_0x20c0('0x14a')])){this['actions'][_0x5c62fc][_0x20c0('0x14a')]={};}this[_0x20c0('0x71')][_0x5c62fc][_0x20c0('0x14a')][_0x13f1cd]=_0x48f49;}};Preview[_0x20c0('0xe')][_0x20c0('0x14b')]=function(_0xf5916c){try{if(!_[_0x20c0('0x6e')](_0xf5916c)){if(ut[_0x20c0('0x14c')](_[_0x20c0('0x14d')](_0xf5916c[_0x20c0('0x14e')])[0x0])){this[_0x20c0('0x149')](_0xf5916c['uniqueid'],_['keys'](_0xf5916c[_0x20c0('0x14e')])[0x0],_0xf5916c['value']);}}}catch(_0x459f69){logger[_0x20c0('0x14f')](_0x20c0('0x150'),util[_0x20c0('0x151')](_0x459f69,{'showHidden':![],'depth':null}));}};Preview[_0x20c0('0xe')][_0x20c0('0x21')]=function(_0xd432ff){if(_0xd432ff){if(this[_0x20c0('0x71')][_0xd432ff[_0x20c0('0x152')]]){this[_0x20c0('0x71')][_0xd432ff[_0x20c0('0x152')]]['transfer']=!![];}}};Preview[_0x20c0('0xe')][_0x20c0('0x22')]=function(_0x4de746){if(_0x4de746){if(this['actions'][_0x4de746['transfererlinkedid']]){this[_0x20c0('0x71')][_0x4de746[_0x20c0('0x153')]][_0x20c0('0x144')]=!![];}}};module[_0x20c0('0x154')]=Preview; \ No newline at end of file +var _0xb458=['active','callerid','Interval','stringify','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','paused','message','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','syncCampaigns','hasOwnProperty','preview','booked','outbound','clearZombieChannels','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','sequence','isNil','[clearZombieChannels][talking]','originated:\x20','queue','originated','pTalking:\x20','dialAnswer','pick','UserId','VoiceQueueId','Action','status','channel','catch','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','then','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','disableContact','starttime','format','YYYY-MM-DD\x20HH:mm:ss','RecallInQueue','dialRecallInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','[HistoryRecallClose]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','logCustomer','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','linkedid','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','complete','[16]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','BUSY','countbusyretry','Busy','custom:agentbusy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','scheduledAt','NOANSWER','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerRetryFrequency','CONGESTION','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','dialCongestionMaxRetry','dialBusyRetryFrequency','countagentrejectretry','[syncHangupRequest][logAgentReject]','AgentReject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','countabandonedretry','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','NoAnswer','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','Congestion','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','Contact\x20is\x20undefined','Queue','lookAgent','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','unmonitored','execRun','unlock','unlockContact','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','isEmpty','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','phone','substring','dialCutDigit','getCallerId','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdName','getCallerIdRandom','originatecalleridname','extractCalleridName','extractCalleridNumber','addVariables','merge','toLowerVariables','variablesAction','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','isFailure','custom:agentringnoanswer','rejected','[syncHangup][talking]','cause','statedesc','channelstate','transfer','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','addVariable','variables','keys','variable','error','inspect','transfertargetlinkedid','syncBlindTransfer','transfererlinkedid','exports','util','lodash','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','./rpcDb','./action','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','syncHangup','bind','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','loopCampaigns','emit','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','total','type','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','name'];(function(_0x235482,_0x14b833){var _0x5f5bea=function(_0x17a254){while(--_0x17a254){_0x235482['push'](_0x235482['shift']());}};_0x5f5bea(++_0x14b833);}(_0xb458,0x103));var _0x8b45=function(_0x17ebb6,_0x465af7){_0x17ebb6=_0x17ebb6-0x0;var _0x32ec22=_0xb458[_0x17ebb6];return _0x32ec22;};'use strict';var util=require(_0x8b45('0x0'));var _=require(_0x8b45('0x1'));var BPromise=require(_0x8b45('0x2'));var uuid=require('uuid');var moment=require('moment');var md5=require(_0x8b45('0x3'));var Redis=require(_0x8b45('0x4'));var config=require(_0x8b45('0x5'));var logger=require(_0x8b45('0x6'))('preview');var loggerAction=require(_0x8b45('0x6'))('actionPreview');var ami=require('../ami');var rpcDb=require(_0x8b45('0x7'));var Action=require(_0x8b45('0x8'));var ut=require(_0x8b45('0x9'));config[_0x8b45('0xa')]=_[_0x8b45('0xb')](config['redis'],{'host':_0x8b45('0xc'),'port':0x18eb});var io=require(_0x8b45('0xd'))(new Redis(config[_0x8b45('0xa')]));var Sequence=function(){};Sequence[_0x8b45('0xe')][_0x8b45('0xf')]=function(_0x499899){this[_0x8b45('0x10')]=this[_0x8b45('0x10')]?this['tail']['finally'](_0x499899):_0x499899();};function Preview(_0x5bb708){this['sequence']=new Sequence();this[_0x8b45('0x11')]=_0x5bb708[_0x8b45('0x12')];this[_0x8b45('0x13')]=_0x5bb708['trunks'];this[_0x8b45('0x14')]={};this[_0x8b45('0x15')]=_0x5bb708[_0x8b45('0x15')];this[_0x8b45('0x16')]=0x0;ami['on'](_0x8b45('0x17'),this[_0x8b45('0x18')]['bind'](this));ami['on']('hangup',this[_0x8b45('0x19')][_0x8b45('0x1a')](this));ami['on'](_0x8b45('0x1b'),this[_0x8b45('0x1c')][_0x8b45('0x1a')](this));ami['on'](_0x8b45('0x1d'),this[_0x8b45('0x1e')][_0x8b45('0x1a')](this));ami['on'](_0x8b45('0x1f'),this[_0x8b45('0x20')][_0x8b45('0x1a')](this));ami['on'](_0x8b45('0x21'),this[_0x8b45('0x22')][_0x8b45('0x1a')](this));ami['on'](_0x8b45('0x23'),this[_0x8b45('0x24')][_0x8b45('0x1a')](this));ami['on'](_0x8b45('0x25'),this['syncBlindTransfer'][_0x8b45('0x1a')](this));this[_0x8b45('0x26')](this[_0x8b45('0x11')]);}function emit(_0x46e21a,_0x3e1438,_0x23eae6){io['to'](_0x46e21a)[_0x8b45('0x27')](_0x3e1438,_0x23eae6);}function emitCampaignPreview(_0x32b917){if(_0x32b917['type']==='outbound'){var _0x41154a={'id':_0x32b917['id'],'name':_0x32b917['name'],'strategy':_0x32b917[_0x8b45('0x28')],'answered':_0x32b917[_0x8b45('0x29')],'available':_0x32b917[_0x8b45('0x2a')],'loggedIn':_0x32b917[_0x8b45('0x2b')],'pTalking':_0x32b917[_0x8b45('0x2c')],'sumBillable':_0x32b917[_0x8b45('0x2d')],'sumDuration':_0x32b917[_0x8b45('0x2e')],'sumHoldTime':_0x32b917['sumHoldTime']||0x0,'talking':_0x32b917['talking'],'total':_0x32b917[_0x8b45('0x2f')],'type':_0x32b917[_0x8b45('0x30')],'unmanaged':_0x32b917['unmanaged'],'abandoned':_0x32b917['abandoned'],'waiting':_0x32b917[_0x8b45('0x31')],'loggedInDb':_0x32b917[_0x8b45('0x32')],'dialActive':_0x32b917[_0x8b45('0x33')],'dialMethod':_0x32b917[_0x8b45('0x34')],'dialOriginateCallerIdName':_0x32b917['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x32b917[_0x8b45('0x35')],'dialOriginateTimeout':_0x32b917[_0x8b45('0x36')],'dialPrefix':_0x32b917[_0x8b45('0x37')],'outboundAnswerAgiCallsDay':_0x32b917[_0x8b45('0x38')],'outboundAnswerCallsDay':_0x32b917[_0x8b45('0x39')],'outboundBlacklistCallsDay':_0x32b917[_0x8b45('0x3a')],'outboundBusyCallsDay':_0x32b917[_0x8b45('0x3b')],'outboundCongestionCallsDay':_0x32b917[_0x8b45('0x3c')],'outboundDropCallsDayACS':_0x32b917[_0x8b45('0x3d')],'outboundDropCallsDayCallersExit':_0x32b917[_0x8b45('0x3e')],'outboundDropCallsDayTimeout':_0x32b917[_0x8b45('0x3f')],'outboundNoAnswerCallsDay':_0x32b917[_0x8b45('0x40')],'outboundNoSuchCallsDay':_0x32b917[_0x8b45('0x41')],'outboundOriginateFailureCallsDay':_0x32b917['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x32b917[_0x8b45('0x42')],'outboundRejectCallsDay':_0x32b917[_0x8b45('0x43')],'outboundUnknownCallsDay':_0x32b917[_0x8b45('0x44')],'outboundAbandonedCallsDay':_0x32b917[_0x8b45('0x45')],'predictiveIntervalAnsweredCalls':_0x32b917[_0x8b45('0x46')],'predictiveIntervalAvgHoldtime':_0x32b917[_0x8b45('0x47')],'predictiveIntervalAvgTalktime':_0x32b917[_0x8b45('0x48')],'predictiveIntervalDroppedCallsCallersExit':_0x32b917[_0x8b45('0x49')],'predictiveIntervalDroppedCallsTimeout':_0x32b917['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x32b917[_0x8b45('0x4a')],'predictiveIntervalErlangCallsDroppedCalls':_0x32b917[_0x8b45('0x4b')],'predictiveIntervalHitRate':_0x32b917[_0x8b45('0x4c')],'predictiveIntervalMultiplicativeFactor':_0x32b917[_0x8b45('0x4d')],'predictiveIntervalPauses':_0x32b917[_0x8b45('0x4e')],'predictiveIntervalAvailable':_0x32b917['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x32b917[_0x8b45('0x4f')],'message':_0x32b917['message'],'originated':_0x32b917['originated'],'erlangCalls':_0x32b917[_0x8b45('0x50')],'erlangCallToSecond':_0x32b917[_0x8b45('0x51')],'erlangAbandonmentRate':_0x32b917[_0x8b45('0x52')],'erlangBusyFactor':_0x32b917[_0x8b45('0x53')],'startPredictive':_0x32b917[_0x8b45('0x54')],'startProgressive':_0x32b917[_0x8b45('0x55')]};if(_0x32b917['Trunk']){_0x41154a[_0x8b45('0x56')]={'id':_0x32b917[_0x8b45('0x56')]['id'],'name':_0x32b917[_0x8b45('0x56')][_0x8b45('0x57')],'active':_0x32b917['Trunk'][_0x8b45('0x58')],'callerid':_0x32b917[_0x8b45('0x56')][_0x8b45('0x59')]};}if(_0x32b917['Interval']){_0x41154a[_0x8b45('0x5a')]={'id':_0x32b917[_0x8b45('0x5a')]['id'],'name':_0x32b917[_0x8b45('0x5a')]['name']};}var _0x1adc4e=md5(JSON[_0x8b45('0x5b')](_0x41154a));if(_0x32b917[_0x8b45('0x3')]!==_0x1adc4e){_0x32b917[_0x8b45('0x3')]=_0x1adc4e;emit(util['format'](_0x8b45('0x5c'),_0x41154a[_0x8b45('0x57')]),_0x8b45('0x5d'),_0x41154a);}}}function emitVoiceQueueChannelRemove(_0x15df7c){logger[_0x8b45('0x5e')](_0x8b45('0x5f'),JSON['stringify'](_0x15df7c));emit(util['format'](_0x8b45('0x5c'),_0x15df7c[_0x8b45('0x57')]),_0x8b45('0x60'),_0x15df7c);io[_0x8b45('0x27')](_0x8b45('0x61'),_0x15df7c);}function notSendMessagesQueue(_0x4c4dbc){if(_0x4c4dbc[_0x8b45('0x62')]){if(_0x4c4dbc['originated']===0x0&&_0x4c4dbc[_0x8b45('0x2c')]===0x0){_0x4c4dbc[_0x8b45('0x62')]=![];_0x4c4dbc[_0x8b45('0x2a')]=0x0;_0x4c4dbc[_0x8b45('0x63')]=0x0;_0x4c4dbc[_0x8b45('0x64')]=_0x8b45('0x65');ut[_0x8b45('0x66')](_0x8b45('0x67'),_0x4c4dbc[_0x8b45('0x57')]+_0x8b45('0x68'));}else{_0x4c4dbc[_0x8b45('0x64')]='IS_DISACTIVED';ut[_0x8b45('0x66')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x4c4dbc[_0x8b45('0x57')]+'\x20is\x20disactive');}emitCampaignPreview(_0x4c4dbc);}}Preview[_0x8b45('0xe')][_0x8b45('0x26')]=function(){var _0x117f25=this;setInterval(function(){_0x117f25[_0x8b45('0x69')]();},0x7cf);};Preview[_0x8b45('0xe')][_0x8b45('0x69')]=function(){var _0x58e663=this[_0x8b45('0x11')];this['clockClearZombieChannels']+=0x1;for(var _0x4c56c8 in _0x58e663){if(_0x58e663[_0x8b45('0x6a')](_0x4c56c8)&&(_0x58e663[_0x4c56c8][_0x8b45('0x34')]===_0x8b45('0x6b')||_0x58e663[_0x4c56c8]['dialMethod']===_0x8b45('0x6c'))&&_0x58e663[_0x4c56c8]['type']===_0x8b45('0x6d')){if(this[_0x8b45('0x16')]>0x7){this[_0x8b45('0x16')]=0x0;this[_0x8b45('0x6e')]();}}if(_0x58e663[_0x8b45('0x6a')](_0x4c56c8)&&_0x58e663[_0x4c56c8][_0x8b45('0x34')]==='preview'&&_0x58e663[_0x4c56c8][_0x8b45('0x30')]===_0x8b45('0x6d')){if(_0x58e663[_0x4c56c8][_0x8b45('0x33')]){this[_0x8b45('0x6f')](_0x58e663[_0x4c56c8]);if(_0x58e663[_0x4c56c8][_0x8b45('0x70')])this[_0x8b45('0x71')](_0x58e663[_0x4c56c8]);}else{notSendMessagesQueue(_0x58e663[_0x4c56c8]);}}}};Preview[_0x8b45('0xe')][_0x8b45('0x72')]=function(_0x37b94a){var _0x462b51=this;this[_0x8b45('0x73')][_0x8b45('0xf')](function(){if(!_[_0x8b45('0x74')](_0x462b51[_0x8b45('0x14')][_0x37b94a])){loggerAction[_0x8b45('0x5e')](_0x8b45('0x75'),_0x37b94a,'Queue',_0x462b51['actions'][_0x37b94a]['queue'],_0x8b45('0x76'),JSON[_0x8b45('0x5b')](_0x462b51[_0x8b45('0x11')][_0x462b51[_0x8b45('0x14')][_0x37b94a][_0x8b45('0x77')]][_0x8b45('0x78')]),_0x8b45('0x79'),JSON[_0x8b45('0x5b')](_0x462b51['campaignsPreview'][_0x462b51[_0x8b45('0x14')][_0x37b94a]['queue']][_0x8b45('0x2c')]),JSON[_0x8b45('0x5b')](_0x462b51[_0x8b45('0x14')][_0x37b94a][_0x8b45('0x7a')]),JSON['stringify'](_[_0x8b45('0x7b')](_0x462b51[_0x8b45('0x14')][_0x37b94a],['contactId',_0x8b45('0x7c'),_0x8b45('0x7d'),'ListId'])));return ami[_0x8b45('0x7e')]({'action':_0x8b45('0x7f'),'channel':_0x462b51[_0x8b45('0x14')][_0x37b94a][_0x8b45('0x80')]})[_0x8b45('0x81')](function(_0x3d1bf1){if(_0x3d1bf1['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x462b51[_0x8b45('0x14')][_0x37b94a]){ut[_0x8b45('0x82')](_0x462b51[_0x8b45('0x11')][_0x462b51['actions'][_0x37b94a][_0x8b45('0x77')]],_0x8b45('0x83'));if(_0x462b51[_0x8b45('0x14')][_0x37b94a][_0x8b45('0x7a')]===!![]){ut[_0x8b45('0x84')](_0x462b51['campaignsPreview'][_0x462b51[_0x8b45('0x14')][_0x37b94a][_0x8b45('0x77')]],'[clearZombieChannel]');ut[_0x8b45('0x85')]('[Dialer][checkChannel][pTalking][Preview]'+_0x37b94a,_0x462b51[_0x8b45('0x14')][_0x37b94a][_0x8b45('0x77')]);}ut[_0x8b45('0x85')](_0x8b45('0x86')+_0x37b94a,_0x462b51['actions'][_0x37b94a][_0x8b45('0x77')]);delete _0x462b51[_0x8b45('0x14')][_0x37b94a];}},0x2328);}});}});};Preview[_0x8b45('0xe')][_0x8b45('0x6e')]=function(){var _0x3e3df2=this;loggerAction[_0x8b45('0x5e')](_0x8b45('0x87'),_[_0x8b45('0x88')](this[_0x8b45('0x14')]));for(var _0x5ba878 in this[_0x8b45('0x14')]){if(_0x3e3df2[_0x8b45('0x14')][_0x8b45('0x6a')](_0x5ba878)){_0x3e3df2[_0x8b45('0x72')](_0x5ba878);}}};Preview[_0x8b45('0xe')]['recallMe']=function(_0x1744f8){var _0x1477bd=this;rpcDb[_0x8b45('0x89')](_0x1744f8['id'],ut['agentReadyId'](this[_0x8b45('0x15')]))[_0x8b45('0x8a')](function(_0x3d7efe){if(!_[_0x8b45('0x74')](_0x3d7efe)){for(var _0x5795ca=0x0;_0x5795ca<_0x3d7efe[_0x8b45('0x8b')];_0x5795ca+=0x1){if(ut[_0x8b45('0x8c')](_0x3d7efe[_0x5795ca][_0x8b45('0x8d')])<_0x1744f8[_0x8b45('0x8e')]*0x3c){if(_0x3d7efe[_0x5795ca]['Agent']&&!_0x3d7efe[_0x5795ca][_0x8b45('0x8f')][_0x8b45('0x90')]){_0x1477bd[_0x8b45('0x91')](_0x3d7efe[_0x5795ca]['id'])[_0x8b45('0x8a')](ut[_0x8b45('0x92')]('[RecallMe]'))[_0x8b45('0x81')](ut['logger2'](_0x8b45('0x93')));}else{rpcDb[_0x8b45('0x94')](_0x3d7efe[_0x5795ca]['id']);}}else{var _0x19152b=new Action(_0x3d7efe[_0x5795ca],_0x1744f8);_0x19152b[_0x8b45('0x95')]=moment()[_0x8b45('0x96')](_0x8b45('0x97'));_0x1744f8['outboundReCallsDay']+=0x1;ut['logCustomer'](_0x19152b,0x17,_0x8b45('0x98'));if(_0x1744f8[_0x8b45('0x99')]){rpcDb['rescheduleContactInQueue'](ut[_0x8b45('0x9a')](_0x3d7efe[_0x5795ca]));rpcDb[_0x8b45('0x9b')](_0x19152b,_0x8b45('0x9c'));}else{ut['logCustomer'](_0x19152b,0x16,'RecallFailedTimeout');rpcDb[_0x8b45('0x9b')](_0x19152b,_0x8b45('0x9d'));rpcDb['createCustomerFinal'](_0x19152b,_0x8b45('0x9d'));}}}}})['catch'](ut[_0x8b45('0x92')]('[getContactRecallMe]'));};Preview['prototype'][_0x8b45('0x6f')]=function(_0x7f5a4e){_0x7f5a4e['sendMessageOneNotActive']=!![];if(ut[_0x8b45('0x9e')](_0x7f5a4e[_0x8b45('0x2b')])){_0x7f5a4e[_0x8b45('0x64')]=_0x8b45('0x9f');}else if(!ut[_0x8b45('0xa0')](_0x7f5a4e['dialActive'])){_0x7f5a4e[_0x8b45('0x64')]=_0x8b45('0x65');}else if(!this[_0x8b45('0xa1')](_0x7f5a4e['Trunk'])){if(!this['isTrunkReachable'](_0x7f5a4e[_0x8b45('0xa2')])){_0x7f5a4e['message']=_0x8b45('0xa3');}else{_0x7f5a4e['message']='ACTIVE';}}else{_0x7f5a4e['message']=_0x8b45('0xa4');}emitCampaignPreview(_0x7f5a4e);};Preview['prototype'][_0x8b45('0xa5')]=function(_0x123117,_0x51ad6b,_0x3db84e){var _0x1b3890=this;var _0x5f3477=this[_0x8b45('0x14')][_0x51ad6b];var _0x46b686=this[_0x8b45('0x11')][_0x5f3477[_0x8b45('0x77')]];var _0x15cf9d;if(_0x46b686){switch(_0x3db84e){case'1':_0x46b686[_0x8b45('0x41')]+=0x1;_0x5f3477[_0x8b45('0xa6')]+=0x1;_0x5f3477[_0x8b45('0xa7')]=ut[_0x8b45('0xa8')](_0x5f3477);ut[_0x8b45('0xa9')](_0x5f3477,0x0,_0x8b45('0xaa'));ami[_0x8b45('0x27')]('custom:agentnosuchnumber',ut[_0x8b45('0xab')](_0x5f3477,_0x8b45('0xac')));rpcDb[_0x8b45('0x9b')](_0x5f3477,_0x8b45('0xad'));if(ut[_0x8b45('0xa8')](_0x5f3477)>=_0x46b686[_0x8b45('0xae')]){_0x15cf9d=ut[_0x8b45('0xaf')](_0x5f3477,0xf,_0x8b45('0xb0'));rpcDb[_0x8b45('0xb1')](_0x15cf9d,_0x8b45('0xb2'));}else{if(_0x5f3477[_0x8b45('0xa6')]>=_0x46b686[_0x8b45('0xb3')]){rpcDb[_0x8b45('0xb1')](_0x5f3477,_0x8b45('0xb2'));}else{rpcDb[_0x8b45('0xb4')](ut['scheduledAt'](_0x5f3477,_0x8b45('0xa6'),_0x46b686[_0x8b45('0xb5')]),_0x5f3477[_0x8b45('0xb6')],_0x5f3477[_0x8b45('0xb7')]);}}delete this[_0x8b45('0x14')][_0x123117[_0x8b45('0xb8')]];break;case _0x8b45('0xb9'):var _0x1e7c12=moment()['format'](_0x8b45('0x97'));_0x5f3477[_0x8b45('0xba')]=_0x1e7c12;_0x5f3477[_0x8b45('0xbb')]=_0x1e7c12;_0x5f3477[_0x8b45('0x7a')]=!![];_0x46b686[_0x8b45('0x2c')]+=0x1;logger[_0x8b45('0x5e')](_0x8b45('0xbc'),_0x5f3477[_0x8b45('0xbd')],_0x8b45('0xbe'),_0x46b686[_0x8b45('0x57')],_0x8b45('0x79'),_0x46b686['pTalking']);ami['emit'](_0x8b45('0xbf'),ut[_0x8b45('0xab')](_0x5f3477,_0x8b45('0xc0'),this[_0x8b45('0x11')][_0x5f3477[_0x8b45('0x77')]]));if(_0x46b686[_0x8b45('0xc1')]){ami[_0x8b45('0x27')](_0x8b45('0xc2'),ut[_0x8b45('0xc3')](_0x5f3477));}break;case'16':ami['emit']('custom:agentcomplete',ut[_0x8b45('0xab')](_0x5f3477,_0x8b45('0xc4'),this[_0x8b45('0x11')][_0x5f3477[_0x8b45('0x77')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x5f3477,_0x8b45('0xc4')));_0x46b686[_0x8b45('0x39')]+=0x1;_0x46b686[_0x8b45('0x2f')]+=0x1;_0x46b686[_0x8b45('0x29')]+=0x1;ut[_0x8b45('0x84')](_0x46b686,_0x8b45('0xc5'));_0x5f3477['countglobal']=ut['totalGlobal'](_0x5f3477);ut[_0x8b45('0xa9')](_0x5f3477,0x4,'Answer');rpcDb['createCustomerHistory'](_0x5f3477,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0x8b45('0xb1')](_0x5f3477,_0x8b45('0xc6'));rpcDb[_0x8b45('0xc7')](_0x5f3477);_0x46b686[_0x8b45('0x2e')]+=_0x5f3477[_0x8b45('0xc8')];_0x46b686[_0x8b45('0x2d')]+=_0x5f3477[_0x8b45('0xc8')];logger[_0x8b45('0x5e')](_0x8b45('0xc9'),_0x5f3477[_0x8b45('0xbd')],_0x8b45('0xbe'),_0x46b686[_0x8b45('0x57')],_0x8b45('0x79'),_0x46b686[_0x8b45('0x2c')]);delete this[_0x8b45('0x14')][_0x123117['linkedid']];break;case _0x8b45('0xca'):_0x46b686[_0x8b45('0x3b')]+=0x1;_0x5f3477[_0x8b45('0xcb')]+=0x1;_0x5f3477[_0x8b45('0xa7')]=ut[_0x8b45('0xa8')](_0x5f3477);ut[_0x8b45('0xa9')](_0x5f3477,0x5,_0x8b45('0xcc'));ami[_0x8b45('0x27')](_0x8b45('0xcd'),ut[_0x8b45('0xab')](_0x5f3477,'busy'));rpcDb[_0x8b45('0x9b')](_0x5f3477,_0x8b45('0xce'));if(ut[_0x8b45('0xa8')](_0x5f3477)>=_0x46b686[_0x8b45('0xae')]){_0x15cf9d=ut['cloneAction'](_0x5f3477,0xf,_0x8b45('0xb0'));rpcDb['createCustomerFinal'](_0x15cf9d,_0x8b45('0xcf'));}else{if(_0x5f3477['countbusyretry']>=_0x46b686[_0x8b45('0xd0')]){rpcDb[_0x8b45('0xb1')](_0x5f3477,_0x8b45('0xce'));}else{rpcDb[_0x8b45('0xb4')](ut[_0x8b45('0xd1')](_0x5f3477,_0x8b45('0xcb'),_0x46b686['dialBusyRetryFrequency']),_0x5f3477[_0x8b45('0xb6')],_0x5f3477[_0x8b45('0xb7')]);}}break;case _0x8b45('0xd2'):_0x46b686[_0x8b45('0x40')]+=0x1;_0x5f3477['countnoanswerretry']+=0x1;_0x5f3477[_0x8b45('0xa7')]=ut[_0x8b45('0xa8')](_0x5f3477);ut['logCustomer'](_0x5f3477,0x3,'NoAnswer');ami[_0x8b45('0x27')](_0x8b45('0xd3'),ut[_0x8b45('0xab')](_0x5f3477,'noanswer'));rpcDb[_0x8b45('0x9b')](_0x5f3477,'[callProgressDetectingCustomer][logNoAnswer]');if(ut[_0x8b45('0xa8')](_0x5f3477)>=_0x46b686[_0x8b45('0xae')]){_0x15cf9d=ut['cloneAction'](_0x5f3477,0xf,'Global');rpcDb[_0x8b45('0xb1')](_0x15cf9d,_0x8b45('0xd4'));}else{if(_0x5f3477[_0x8b45('0xd5')]>=_0x46b686[_0x8b45('0xd6')]){rpcDb['createCustomerFinal'](_0x5f3477,_0x8b45('0xd7'));}else{rpcDb[_0x8b45('0xb4')](ut[_0x8b45('0xd1')](_0x5f3477,_0x8b45('0xd5'),_0x46b686[_0x8b45('0xd8')]),_0x5f3477[_0x8b45('0xb6')],_0x5f3477['activeContact']);}}break;case _0x8b45('0xd9'):_0x46b686[_0x8b45('0x3c')]+=0x1;_0x5f3477['countcongestionretry']+=0x1;_0x5f3477[_0x8b45('0xa7')]=ut[_0x8b45('0xa8')](_0x5f3477);ut['logCustomer'](_0x5f3477,0x8,'Congestion');ami['emit'](_0x8b45('0xda'),ut[_0x8b45('0xab')](_0x5f3477,_0x8b45('0xdb')));rpcDb[_0x8b45('0x9b')](_0x5f3477,_0x8b45('0xdc'));if(ut[_0x8b45('0xa8')](_0x5f3477)>=_0x46b686[_0x8b45('0xae')]){_0x15cf9d=ut['cloneAction'](_0x5f3477,0xf,_0x8b45('0xb0'));rpcDb[_0x8b45('0xb1')](_0x15cf9d,_0x8b45('0xdd'));}else{if(_0x5f3477[_0x8b45('0xde')]>=_0x46b686[_0x8b45('0xdf')]){rpcDb[_0x8b45('0xb1')](_0x5f3477,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0x8b45('0xb4')](ut[_0x8b45('0xd1')](_0x5f3477,_0x8b45('0xde'),_0x46b686[_0x8b45('0xe0')]),_0x5f3477[_0x8b45('0xb6')],_0x5f3477['activeContact']);}}break;case'CANCEL':_0x46b686[_0x8b45('0x43')]+=0x1;_0x5f3477[_0x8b45('0xe1')]+=0x1;_0x5f3477[_0x8b45('0xa7')]=ut[_0x8b45('0xa8')](_0x5f3477);ut[_0x8b45('0xa9')](_0x5f3477,0x14,'AgentReject');ami[_0x8b45('0x27')]('custom:agentreject',ut[_0x8b45('0xab')](_0x5f3477,'agentreject'));rpcDb[_0x8b45('0x9b')](_0x5f3477,_0x8b45('0xe2'));if(ut[_0x8b45('0xa8')](_0x5f3477)>=_0x46b686[_0x8b45('0xae')]){_0x15cf9d=ut[_0x8b45('0xaf')](_0x5f3477,0x14,_0x8b45('0xe3'));rpcDb[_0x8b45('0xb1')](_0x15cf9d,_0x8b45('0xe4'));}else{if(_0x5f3477[_0x8b45('0xe1')]>=_0x46b686[_0x8b45('0xe5')]){rpcDb[_0x8b45('0xb1')](_0x5f3477,_0x8b45('0xe4'));}else{rpcDb[_0x8b45('0xb4')](ut[_0x8b45('0xd1')](_0x5f3477,'countagentrejectretry',_0x46b686[_0x8b45('0xe6')]),_0x5f3477[_0x8b45('0xb6')],_0x5f3477[_0x8b45('0xb7')]);}}break;case'ABANDONED':_0x46b686[_0x8b45('0x45')]+=0x1;_0x5f3477['countabandonedretry']+=0x1;_0x5f3477[_0x8b45('0xa7')]=ut[_0x8b45('0xa8')](_0x5f3477);ut['logCustomer'](_0x5f3477,0xb,_0x8b45('0xe7'));rpcDb['createCustomerHistory'](_0x5f3477,_0x8b45('0xe8'));if(ut[_0x8b45('0xa8')](_0x5f3477)>=_0x46b686[_0x8b45('0xae')]){_0x15cf9d=ut[_0x8b45('0xaf')](_0x5f3477,0xf,_0x8b45('0xb0'));rpcDb[_0x8b45('0xb1')](_0x15cf9d,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x5f3477['countabandonedetry']>=_0x46b686[_0x8b45('0xe9')]){rpcDb[_0x8b45('0xb1')](_0x5f3477,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x5f3477,_0x8b45('0xea'),_0x46b686['dialAbandonedRetryFrequency']),_0x5f3477[_0x8b45('0xb6')],_0x5f3477[_0x8b45('0xb7')]);}}break;case'18':_0x46b686[_0x8b45('0x44')]+=0x1;_0x5f3477[_0x8b45('0xeb')]+=0x1;_0x5f3477['countglobal']=ut[_0x8b45('0xa8')](_0x5f3477);ut[_0x8b45('0xa9')](_0x5f3477,0x12,_0x123117[_0x8b45('0xec')]||_0x123117[_0x8b45('0xed')]);ami[_0x8b45('0x27')](_0x8b45('0xee'),ut[_0x8b45('0xab')](_0x5f3477,_0x8b45('0xef')));rpcDb['createCustomerHistory'](_0x5f3477,_0x8b45('0xf0'));if(ut['totalGlobal'](_0x5f3477)>=_0x46b686[_0x8b45('0xae')]){_0x15cf9d=ut['cloneAction'](_0x5f3477,0xf,'Global');rpcDb['createCustomerFinal'](_0x15cf9d,_0x8b45('0xf0'));}else{rpcDb[_0x8b45('0xb1')](_0x5f3477,'[callProgressDetectingCustomer][hangupInAMD]');}delete this[_0x8b45('0x14')][_0x123117[_0x8b45('0xb8')]];break;case'19':_0x46b686[_0x8b45('0x44')]+=0x1;_0x5f3477[_0x8b45('0xa7')]=ut[_0x8b45('0xa8')](_0x5f3477);ut[_0x8b45('0xa9')](_0x5f3477,0x13,_0x123117[_0x8b45('0xec')]||_0x123117[_0x8b45('0xed')]);ami[_0x8b45('0x27')]('custom:amd',ut[_0x8b45('0xab')](_0x5f3477,_0x8b45('0xef')));rpcDb[_0x8b45('0x9b')](_0x5f3477,_0x8b45('0xf1'));if(ut['totalGlobal'](_0x5f3477)>=_0x46b686[_0x8b45('0xae')]){_0x15cf9d=ut[_0x8b45('0xaf')](_0x5f3477,0xf,_0x8b45('0xb0'));rpcDb[_0x8b45('0xb1')](_0x15cf9d,_0x8b45('0xf1'));}else{rpcDb['createCustomerFinal'](_0x5f3477,_0x8b45('0xf1'));}delete this['actions'][_0x123117[_0x8b45('0xb8')]];break;default:if(_0x5f3477[_0x8b45('0x7a')]){ut['decrementTalkink'](_0x46b686,'[default]');ut[_0x8b45('0x85')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x46b686[_0x8b45('0x57')],_0x123117);}_0x46b686['outboundUnknownCallsDay']+=0x1;_0x5f3477[_0x8b45('0xa7')]=ut[_0x8b45('0xa8')](_0x5f3477);ut[_0x8b45('0xa9')](_0x5f3477,0xc,_0x123117['cause-txt']||_0x123117[_0x8b45('0xed')]);rpcDb['createCustomerHistory'](_0x5f3477,_0x8b45('0xf2'));if(ut[_0x8b45('0xa8')](_0x5f3477)>=_0x46b686[_0x8b45('0xae')]){_0x15cf9d=ut[_0x8b45('0xaf')](_0x5f3477,0xf,_0x8b45('0xb0'));rpcDb[_0x8b45('0xb1')](_0x15cf9d,_0x8b45('0xf3'));}else{rpcDb[_0x8b45('0xb1')](_0x5f3477,_0x8b45('0xf3'));}delete this[_0x8b45('0x14')][_0x123117[_0x8b45('0xb8')]];}if(!(_0x5f3477[_0x8b45('0x7a')]&&_0x3db84e==='16')){ut[_0x8b45('0x82')](_0x46b686,_0x8b45('0xf4'));logger[_0x8b45('0x5e')]('[originated][decrement][callProgressDetectingCustomer]',_0x5f3477[_0x8b45('0xbd')],_0x8b45('0xbe'),_0x46b686['name'],'originated:\x20',_0x46b686[_0x8b45('0x78')]);}if(_0x3db84e!==_0x8b45('0xb9')){delete this[_0x8b45('0x14')][_0x123117[_0x8b45('0xb8')]];delete this[_0x8b45('0x14')][_0x123117[_0x8b45('0xf5')]];}}};Preview[_0x8b45('0xe')][_0x8b45('0xf6')]=function(_0xc28f57,_0x4ad1fe,_0x39626f){if(_[_0x8b45('0xf7')](_0x4ad1fe)&&'object'!==typeof _0x4ad1fe){return;}if(_[_0x8b45('0xf7')](_0x39626f)&&_0x8b45('0xf8')!==typeof _0x39626f){return;}switch(_0x39626f[_0x8b45('0xf9')]){case'0':ut[_0x8b45('0xfa')](_0xc28f57,0x0,_0x8b45('0xaa'));rpcDb[_0x8b45('0xfb')](_0xc28f57,_0x8b45('0xfc'));break;case'3':ut[_0x8b45('0xfa')](_0xc28f57,0x3,_0x8b45('0xfd'));rpcDb[_0x8b45('0xfb')](_0xc28f57,_0x8b45('0xfe'));break;case'5':ut[_0x8b45('0xfa')](_0xc28f57,0x5,_0x8b45('0xcc'));rpcDb['createAgentHistory'](_0xc28f57,_0x8b45('0xff'));break;case'8':ut['logAgent'](_0xc28f57,0x8,_0x8b45('0x100'));rpcDb[_0x8b45('0xfb')](_0xc28f57,_0x8b45('0x101'));break;case'22':ut['logAgent'](_0xc28f57,0x16,_0x8b45('0x102'));rpcDb[_0x8b45('0xfb')](_0xc28f57,_0x8b45('0x103'));break;default:ut[_0x8b45('0xfa')](_0xc28f57,0xc,_0x39626f[_0x8b45('0xf9')]);rpcDb[_0x8b45('0xfb')](_0xc28f57,'[callProgressDetectingAgent][logCongestion]');}ut[_0x8b45('0x82')](_0x4ad1fe,_0x8b45('0x104'));logger[_0x8b45('0x5e')](_0x8b45('0x105'),_0xc28f57['uniqueid'],_0x8b45('0xbe'),_0x4ad1fe[_0x8b45('0x57')],_0x8b45('0x76'),_0x4ad1fe[_0x8b45('0x78')]);delete this['actions'][_0xc28f57[_0x8b45('0xbd')]];};Preview[_0x8b45('0xe')][_0x8b45('0x106')]=function(_0x4d5539,_0x1d2f2d,_0x1411e0,_0xeee220,_0x1d3a00){var _0x2783b2=this;return new BPromise(function(_0x82ec51,_0x59c08a){if(_[_0x8b45('0x74')](_0x1d2f2d)||_[_0x8b45('0x74')](_0x1d2f2d['Contact'])||_[_0x8b45('0x74')](_0x1d2f2d[_0x8b45('0x107')]['phone'])||_[_0x8b45('0x74')](_0x1d2f2d[_0x8b45('0x7d')])){_0x59c08a(ut[_0x8b45('0x64')](_0x8b45('0x108'),_0xeee220,_0x1d3a00));return;}var _0x1d5e77=uuid['v4']();var _0x3e62af=_0x2783b2[_0x8b45('0x11')][_0x1d2f2d[_0x8b45('0x109')]['name']];var _0x147b83=_0x1411e0?_0x2783b2['agents'][_0x1411e0]['id']:undefined;_0x2783b2[_0x8b45('0x14')][_0x1d5e77]=new Action(_0x1d2f2d,_0x3e62af,_0x1d5e77,_0x1411e0,_0x147b83);var _0x255b6a=_0x2783b2[_0x8b45('0x14')][_0x1d5e77];_0x255b6a['unlockAgent']=_0xeee220;_0x255b6a[_0x8b45('0xb7')]=_0x1d3a00;_0x255b6a[_0x8b45('0x10a')]=_0x1411e0;if(_['isEmpty'](_0x4d5539)){_0x2783b2[_0x8b45('0x10b')](_0x255b6a,_0x3e62af,_0x1d2f2d,_0x1411e0)[_0x8b45('0x8a')](function(_0x2884a4){logger[_0x8b45('0x5e')](_0x8b45('0x10c'),_0x8b45('0x10d')+_0x255b6a[_0x8b45('0x77')]+_0x8b45('0x10e')+_0x255b6a[_0x8b45('0x10f')],JSON['stringify'](_0x2884a4));ami[_0x8b45('0x27')](_0x8b45('0x110'),ut[_0x8b45('0xab')](_0x255b6a,'called',_0x2783b2[_0x8b45('0x11')][_0x255b6a['queue']]));_0x82ec51(ut[_0x8b45('0x64')]('Calling'));})['catch'](function(_0x1cfe9d){ut[_0x8b45('0x66')](_0x8b45('0x111'),_0x1cfe9d);_0x59c08a(ut['message'](_0x8b45('0x112'),_0xeee220,_0x1d3a00));});}else{_0x3e62af[_0x8b45('0x3a')]+=0x1;ut[_0x8b45('0x113')](_0x255b6a);rpcDb[_0x8b45('0x114')](_0x255b6a,_0x8b45('0x115'));delete _0x2783b2[_0x8b45('0x14')][_0x1d5e77];_0x59c08a(ut[_0x8b45('0x64')](_0x8b45('0x116'),_0xeee220,_0x1d3a00));}});};Preview['prototype'][_0x8b45('0xa1')]=function(_0x43c32c){return!_[_0x8b45('0x74')](_0x43c32c)&&!_[_0x8b45('0x74')](_0x43c32c[_0x8b45('0x57')])&&!_[_0x8b45('0x74')](_0x43c32c['active'])&&_0x43c32c['active']&&!_[_0x8b45('0x74')](this['trunks'][util['format'](_0x8b45('0x117'),_0x43c32c[_0x8b45('0x57')])])&&!_[_0x8b45('0x74')](this[_0x8b45('0x13')][util[_0x8b45('0x96')]('SIP/%s',_0x43c32c[_0x8b45('0x57')])][_0x8b45('0x7f')])&&(this['trunks'][util['format'](_0x8b45('0x117'),_0x43c32c[_0x8b45('0x57')])][_0x8b45('0x7f')]===_0x8b45('0x118')||this[_0x8b45('0x13')][util[_0x8b45('0x96')](_0x8b45('0x117'),_0x43c32c[_0x8b45('0x57')])][_0x8b45('0x7f')]===_0x8b45('0x119'));};Preview[_0x8b45('0xe')][_0x8b45('0x91')]=function(_0x584b98,_0x3ef8be){var _0x475cb8=this;return new BPromise(function(_0x181134,_0x47a0d9){_0x475cb8[_0x8b45('0x11a')](_0x584b98,_0x3ef8be)['then'](function(_0x208e72){_0x181134(_[_0x8b45('0x7b')](_0x208e72,[_0x8b45('0x64')]));})[_0x8b45('0x81')](function(_0x28d0de){if(_0x28d0de[_0x8b45('0x11b')]){rpcDb[_0x8b45('0x11c')](_0x584b98);}if(_0x28d0de[_0x8b45('0x58')]){rpcDb[_0x8b45('0x94')](_0x584b98);}_0x47a0d9(_[_0x8b45('0x7b')](_0x28d0de,['message']));});});};Preview[_0x8b45('0xe')][_0x8b45('0x11a')]=function(_0x5e8425,_0x252ef3){var _0x2a3676=this;return new BPromise(function(_0x3cafc4,_0x461169){var _0x221594,_0x3468c7;rpcDb[_0x8b45('0x11d')](_0x5e8425)['then'](function(_0x19222d){if(!_['isNil'](_0x19222d[0x0])){_0x3468c7=_0x19222d[0x0][_0x8b45('0x11e')]?![]:!![];_0x221594=_0x19222d[0x0][_0x8b45('0x11e')]?!![]:![];_0x221594=_0x252ef3?!![]:_0x221594;}var _0x4e7673=_0x2a3676[_0x8b45('0x11f')](_0x19222d);if(_0x4e7673[_0x8b45('0x120')]){rpcDb[_0x8b45('0x121')](_[_0x8b45('0x7b')](_0x19222d[0x0],[_0x8b45('0x7d'),'Contact.phone']))[_0x8b45('0x8a')](function(_0x5a31c8){_0x2a3676[_0x8b45('0x106')](_0x5a31c8,_0x19222d[0x0],_0x252ef3,_0x3468c7,_0x221594)[_0x8b45('0x8a')](function(_0x4bd7e8){_0x3cafc4(_0x4bd7e8);})['catch'](function(_0x4a998f){_0x461169(_0x4a998f);});})['catch'](function(_0x1f8c01){ut[_0x8b45('0x66')](_0x8b45('0x122'),_0x1f8c01);_0x461169(ut[_0x8b45('0x64')](_0x8b45('0x123'),_0x3468c7,_0x221594));});}else{_0x461169(ut[_0x8b45('0x64')](_0x4e7673[_0x8b45('0x64')],_0x3468c7,_0x221594));}})[_0x8b45('0x81')](function(_0x2458eb){ut[_0x8b45('0x66')](_0x8b45('0x124'),_0x2458eb);_0x461169(ut[_0x8b45('0x64')](_0x8b45('0x123'),![],!![]));});});};Preview[_0x8b45('0xe')][_0x8b45('0x11f')]=function(_0x556900){if(_['isNil'](_0x556900)||_[_0x8b45('0x125')](_0x556900)||!_[_0x8b45('0x74')](_0x556900[0x0]['Agent'])&&_[_0x8b45('0x74')](_0x556900[0x0][_0x8b45('0x8f')][_0x8b45('0x57')])){ut[_0x8b45('0x66')](_0x8b45('0x126'),_0x556900);return{'isValid':![],'message':_0x8b45('0x127')};}var _0x4ede39=this[_0x8b45('0x11')][_0x556900[0x0]['Queue']['name']];_0x4ede39[_0x8b45('0x64')]='ACTIVE';if(_[_0x8b45('0x74')](_0x4ede39)){ut[_0x8b45('0x66')](_0x8b45('0x128'),_0x4ede39);return{'isValid':![],'message':_0x8b45('0x129')};}if(!this[_0x8b45('0xa1')](_0x4ede39[_0x8b45('0x56')])){ut[_0x8b45('0x66')](_0x8b45('0x12a'),_0x8b45('0x12b')+_0x4ede39[_0x8b45('0x57')]+_0x8b45('0x12c'));if(!this[_0x8b45('0xa1')](_0x4ede39[_0x8b45('0xa2')])){ut['logger'](_0x8b45('0x12a'),_0x4ede39[_0x8b45('0x57')]+_0x8b45('0x12d'));return{'isValid':![],'message':_0x8b45('0x12e')};}}if(!ut[_0x8b45('0xa0')](_0x4ede39['dialActive'])){ut[_0x8b45('0x66')](_0x8b45('0x12f'),_0x4ede39[_0x8b45('0x57')]+_0x8b45('0x130'));return{'isValid':![],'message':_0x8b45('0x12b')+_0x4ede39[_0x8b45('0x57')]+_0x8b45('0x130')};}return{'isValid':!![],'message':_0x8b45('0x131')};};Preview[_0x8b45('0xe')][_0x8b45('0x10b')]=function(_0x478262,_0x3aec32,_0x218549,_0x160165){var _0xa534a1=this;return new BPromise(function(_0x3976ff,_0x6b30ad){var _0x4245d6=_0x478262[_0x8b45('0xbd')];var _0x3b857f=_0xa534a1[_0x8b45('0xa1')](_0x3aec32['Trunk'])?util[_0x8b45('0x96')](_0x8b45('0x132'),_0x3aec32['Trunk'][_0x8b45('0x57')],_[_0x8b45('0x74')](_0x3aec32[_0x8b45('0x37')])?'':_0x3aec32[_0x8b45('0x37')][_0x8b45('0x133')]()||'',_0x3aec32['dialCutDigit']>0x0?_0x218549[_0x8b45('0x107')][_0x8b45('0x134')][_0x8b45('0x135')](_0x3aec32[_0x8b45('0x136')]):_0x218549[_0x8b45('0x107')][_0x8b45('0x134')]):util['format']('SIP/%s/%s%s',_[_0x8b45('0x74')](_0x3aec32[_0x8b45('0xa2')])?_0x3aec32[_0x8b45('0x56')]['name']:_0x3aec32[_0x8b45('0xa2')][_0x8b45('0x57')],_['isNil'](_0x3aec32[_0x8b45('0x37')])?'':_0x3aec32['dialPrefix'][_0x8b45('0x133')]()||'',_0x3aec32[_0x8b45('0x136')]>0x0?_0x218549[_0x8b45('0x107')][_0x8b45('0x134')]['substring'](_0x3aec32[_0x8b45('0x136')]):_0x218549[_0x8b45('0x107')][_0x8b45('0x134')]);var _0x443cf7=_0xa534a1[_0x8b45('0xa1')](_0x3aec32[_0x8b45('0x56')])?ut[_0x8b45('0x137')](_0x3aec32[_0x8b45('0x56')][_0x8b45('0x59')],_0x3aec32['dialOriginateCallerIdName'],_0x3aec32[_0x8b45('0x138')]>0x0?ut['getCallerIdRandom'](_0x3aec32[_0x8b45('0x35')],_0x3aec32[_0x8b45('0x138')]):_0x3aec32[_0x8b45('0x35')]):ut[_0x8b45('0x137')](_[_0x8b45('0x74')](_0x3aec32[_0x8b45('0xa2')])?_0x3aec32[_0x8b45('0x56')][_0x8b45('0x59')]:_0x3aec32[_0x8b45('0xa2')][_0x8b45('0x59')],_0x3aec32[_0x8b45('0x139')],_0x3aec32['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x8b45('0x13a')](_0x3aec32[_0x8b45('0x35')],_0x3aec32[_0x8b45('0x138')]):_0x3aec32[_0x8b45('0x35')]);if(_0x443cf7){_0x478262[_0x8b45('0x13b')]=ut[_0x8b45('0x13c')](_0x443cf7);_0x478262['originatecalleridnum']=ut[_0x8b45('0x13d')](_0x443cf7);}var _0x261277=ut[_0x8b45('0x13e')](_0x3aec32,_0x218549,_0x3b857f,_0x443cf7,_0x4245d6,_0x478262);_[_0x8b45('0x13f')](_0x478262,ut[_0x8b45('0x140')](_0x261277));_0x478262[_0x8b45('0x95')]=moment()[_0x8b45('0x96')](_0x8b45('0x97'));ami[_0x8b45('0x7e')](ut[_0x8b45('0x141')](_0x478262,_0x3aec32,_0x261277,_0x478262[_0x8b45('0xb7')],_0x160165))['then'](function(_0x46a362){_0x3aec32[_0x8b45('0x78')]+=0x1;logger[_0x8b45('0x5e')]('[originated][increment]',_0x4245d6,'\x20Queue',_0x3aec32[_0x8b45('0x57')],'originated:\x20',_0x3aec32['originated']);_0x3976ff(_0x46a362);})[_0x8b45('0x81')](function(_0x43c29d){ut[_0x8b45('0xfa')](_0x478262,0xe,_0x8b45('0x142'));rpcDb[_0x8b45('0xfb')](_0x478262,_0x8b45('0x143'));_0x6b30ad(_0x43c29d);});});};Preview[_0x8b45('0xe')][_0x8b45('0x20')]=function(_0x3b6466){if(this['actions'][_0x3b6466['linkedid']]){this[_0x8b45('0x14')][_0x3b6466[_0x8b45('0xb8')]]['channel']=_0x3b6466['channel'];}};Preview[_0x8b45('0xe')]['syncOriginateResponse']=function(_0xf96b96){var _0x2cbd75=this;var _0x42acdb=this[_0x8b45('0x14')][_0xf96b96[_0x8b45('0x144')]];if(_0x42acdb){if(_0x42acdb[_0x8b45('0x10a')]&&this[_0x8b45('0x15')][_0x42acdb[_0x8b45('0x10a')]]){ut[_0x8b45('0x145')](_0x42acdb,this[_0x8b45('0x15')][_0x42acdb[_0x8b45('0x10a')]][_0x8b45('0x57')],this[_0x8b45('0x15')][_0x42acdb[_0x8b45('0x10a')]]['id']);}var _0x4f1d30=_[_0x8b45('0x146')](_0x42acdb);_0x4f1d30[_0x8b45('0xba')]=moment()[_0x8b45('0x96')]('YYYY-MM-DD\x20HH:mm:ss');var _0x5ae53d=_0x2cbd75[_0x8b45('0x11')][_0x42acdb[_0x8b45('0x77')]];if(ut[_0x8b45('0x147')](_0xf96b96['response'])){if(_0x42acdb['unlockAgent']){rpcDb[_0x8b45('0x11c')](_0x42acdb[_0x8b45('0x10f')]);}if(_0x42acdb[_0x8b45('0xb7')]){rpcDb[_0x8b45('0x94')](_0x42acdb['idContact']);}ami[_0x8b45('0x27')](_0x8b45('0x148'),ut[_0x8b45('0xab')](_0x42acdb,_0x8b45('0x149'),this[_0x8b45('0x11')][_0x42acdb[_0x8b45('0x77')]]));this[_0x8b45('0xf6')](_0x4f1d30,_0x5ae53d,_0xf96b96);}else{_0x42acdb[_0x8b45('0x95')]=moment()[_0x8b45('0x96')](_0x8b45('0x97'));ut['logAgent'](_0x4f1d30,0x4,'Answer');rpcDb[_0x8b45('0xfb')](_0x4f1d30,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0x8b45('0xe')]['syncHangup']=function(_0x17e00a){var _0x309a59=this;var _0x31e15c=this['actions'][_0x17e00a[_0x8b45('0xb8')]];var _0x457bea;if(_0x31e15c){_0x457bea=this[_0x8b45('0x11')][_0x31e15c[_0x8b45('0x77')]];logger[_0x8b45('0x5e')](_0x8b45('0x14a'),_0x17e00a[_0x8b45('0xb8')],_0x8b45('0xbe'),_0x457bea['name'],'pTalking:\x20',_0x457bea[_0x8b45('0x2c')]);}if(this[_0x8b45('0x14')][_0x17e00a['linkedid']]&&_0x17e00a[_0x8b45('0xb8')]!==_0x17e00a['uniqueid']){if(_0x17e00a[_0x8b45('0x14b')]==='16'&&this[_0x8b45('0x14')][_0x17e00a['linkedid']][_0x8b45('0x7a')]){this['callProgressDetectingCustomer'](_0x17e00a,_0x17e00a['linkedid'],_0x17e00a[_0x8b45('0x14b')]);}else if(this[_0x8b45('0x14')][_0x17e00a[_0x8b45('0xb8')]][_0x8b45('0x7a')]){logger[_0x8b45('0x5e')]('[syncHangup][talking][cause]',_0x17e00a[_0x8b45('0xb8')],_0x17e00a[_0x8b45('0x14b')],'\x20Queue',_0x457bea[_0x8b45('0x57')],_0x8b45('0x79'),_0x457bea['pTalking']);this['callProgressDetectingCustomer'](_0x17e00a,_0x17e00a[_0x8b45('0xb8')],_0x17e00a[_0x8b45('0x14b')]);}}else if(_0x31e15c&&_[_0x8b45('0x74')](_0x31e15c[_0x8b45('0x14c')])&&_0x457bea['dialQueueProject']&&_0x17e00a[_0x8b45('0xb8')]===_0x17e00a[_0x8b45('0xbd')]&&_[_0x8b45('0x74')](_0x17e00a[_0x8b45('0xf9')])&&_0x17e00a[_0x8b45('0x14b')]==='16'&&_0x17e00a[_0x8b45('0x14d')]==='6'&&_[_0x8b45('0xf7')](_0x31e15c[_0x8b45('0x14e')])){if(_0x31e15c[_0x8b45('0xb6')]){rpcDb[_0x8b45('0x11c')](_0x31e15c[_0x8b45('0x10f')]);}if(_0x31e15c['activeContact']){rpcDb[_0x8b45('0x94')](_0x31e15c[_0x8b45('0x10f')]);}_0x17e00a[_0x8b45('0xf9')]='22';this[_0x8b45('0xf6')](_0x31e15c,_0x457bea,_0x17e00a);}else if(_0x31e15c&&_0x31e15c[_0x8b45('0x14e')]){if(_0x17e00a[_0x8b45('0x14b')]==='16'&&this['actions'][_0x17e00a[_0x8b45('0xb8')]][_0x8b45('0x7a')]){logger[_0x8b45('0x5e')](_0x8b45('0x14f'),_0x17e00a[_0x8b45('0xb8')],_0x17e00a[_0x8b45('0x14b')],_0x8b45('0xbe'),_0x457bea[_0x8b45('0x57')],_0x8b45('0x79'),_0x457bea[_0x8b45('0x2c')]);this[_0x8b45('0xa5')](_0x17e00a,_0x17e00a[_0x8b45('0xb8')],_0x17e00a[_0x8b45('0x14b')]);}else if(this[_0x8b45('0x14')][_0x17e00a[_0x8b45('0xb8')]][_0x8b45('0x7a')]){logger[_0x8b45('0x5e')](_0x8b45('0x150'),_0x17e00a[_0x8b45('0xb8')],_0x17e00a[_0x8b45('0x14b')],_0x8b45('0xbe'),_0x457bea[_0x8b45('0x57')],_0x8b45('0x79'),_0x457bea['pTalking']);this[_0x8b45('0xa5')](_0x17e00a,_0x17e00a[_0x8b45('0xb8')],_0x17e00a['cause']);}}};Preview[_0x8b45('0xe')][_0x8b45('0x1e')]=function(_0x10b08c){if(this[_0x8b45('0x14')][_0x10b08c[_0x8b45('0xf5')]]&&_0x10b08c[_0x8b45('0xf5')]!==_0x10b08c['destuniqueid']){this[_0x8b45('0xa5')](_0x10b08c,_0x10b08c['destlinkedid'],_0x10b08c[_0x8b45('0xed')]);}};Preview[_0x8b45('0xe')][_0x8b45('0x1c')]=function(_0x20c8b4){if(this['actions'][_0x20c8b4[_0x8b45('0xb8')]]&&_0x20c8b4[_0x8b45('0xb8')]!==_0x20c8b4[_0x8b45('0xbd')]&&!this[_0x8b45('0x14')][_0x20c8b4[_0x8b45('0xb8')]]['dialAnswer']){if(_0x20c8b4[_0x8b45('0x14b')]==='1'){this[_0x8b45('0xa5')](_0x20c8b4,_0x20c8b4[_0x8b45('0xb8')],_0x20c8b4['cause']);}}};Preview[_0x8b45('0xe')][_0x8b45('0x151')]=function(_0xa2711,_0x57e75e,_0xd631be){if(this[_0x8b45('0x14')][_0xa2711]){if(_[_0x8b45('0x74')](this['actions'][_0xa2711][_0x8b45('0x152')])){this[_0x8b45('0x14')][_0xa2711]['variables']={};}this[_0x8b45('0x14')][_0xa2711][_0x8b45('0x152')][_0x57e75e]=_0xd631be;}};Preview[_0x8b45('0xe')][_0x8b45('0x22')]=function(_0x3e9ec4){try{if(!_['isNil'](_0x3e9ec4)){if(ut['filterKey'](_[_0x8b45('0x153')](_0x3e9ec4['variable'])[0x0])){this[_0x8b45('0x151')](_0x3e9ec4['uniqueid'],_[_0x8b45('0x153')](_0x3e9ec4[_0x8b45('0x154')])[0x0],_0x3e9ec4['value']);}}}catch(_0x3f9e9a){logger[_0x8b45('0x155')]('[syncVarSet][Preview]',util[_0x8b45('0x156')](_0x3f9e9a,{'showHidden':![],'depth':null}));}};Preview[_0x8b45('0xe')]['syncAttendedTransfer']=function(_0x2a4615){if(_0x2a4615){if(this[_0x8b45('0x14')][_0x2a4615[_0x8b45('0x157')]]){this[_0x8b45('0x14')][_0x2a4615['transfertargetlinkedid']][_0x8b45('0x14e')]=!![];}}};Preview[_0x8b45('0xe')][_0x8b45('0x158')]=function(_0x32d3bf){if(_0x32d3bf){if(this[_0x8b45('0x14')][_0x32d3bf[_0x8b45('0x159')]]){this[_0x8b45('0x14')][_0x32d3bf['transfererlinkedid']]['transfer']=!![];}}};module[_0x8b45('0x15a')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index f1cec1d..6c33f79 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 _0x6ab7=['unlockContact','disableContact','[activeContact]\x20','crateCustomerReportQueue','uniqueid','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','xcally-motion-preview','holdtime','assigned','queuecallerexitreason','COMPLETED','create','[GetContactRecallMe]\x20','rescheduleContactInQueue','rescheduleContact','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','error','inspect','resolve','then','createHistory','[createHistory]\x20','moveContactManagedDialer','catch','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createCustomerHistory','UserId','active','countReScheduled','[countReScheduled]\x20'];(function(_0x38257d,_0x4aa6da){var _0x1175b3=function(_0x5b900a){while(--_0x5b900a){_0x38257d['push'](_0x38257d['shift']());}};_0x1175b3(++_0x4aa6da);}(_0x6ab7,0xee));var _0x76ab=function(_0x590f37,_0x160f07){_0x590f37=_0x590f37-0x0;var _0x64a1d=_0x6ab7[_0x590f37];return _0x64a1d;};'use strict';var util=require(_0x76ab('0x0'));var BPromise=require(_0x76ab('0x1'));var logger=require(_0x76ab('0x2'))('preview');var _=require(_0x76ab('0x3'));var cmHopper=require(_0x76ab('0x4'));var cmHopperFinal=require(_0x76ab('0x5'));var cmHopperHistory=require(_0x76ab('0x6'));var cmHopperBlack=require(_0x76ab('0x7'));var voiceQueueRt=require(_0x76ab('0x8'));var agentReportPreview=require(_0x76ab('0x9'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x1cee69){return function(_0xda5ae4){logger[_0x76ab('0xa')](_0x1cee69,util[_0x76ab('0xb')](_0xda5ae4,{'showHidden':![],'depth':null}));};}function create(_0x4d57ba){return BPromise[_0x76ab('0xc')]()[_0x76ab('0xd')](cmHopperHistory[_0x76ab('0xe')](_0x4d57ba))['catch'](loggerCatch(_0x76ab('0xf')));}function createAgent(_0x1a57fc){return BPromise[_0x76ab('0xc')]()[_0x76ab('0xd')](agentReportPreview[_0x76ab('0xe')](_0x1a57fc))['catch'](loggerCatch(_0x76ab('0xf')));}function moveContact(_0x123256){return BPromise[_0x76ab('0xc')]()[_0x76ab('0xd')](cmHopper[_0x76ab('0x10')](_0x123256,!![]))[_0x76ab('0x11')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0x76ab('0x12')]=function(_0x144717){return BPromise[_0x76ab('0xc')]()[_0x76ab('0xd')](cmHopperBlack[_0x76ab('0x12')](_0x144717))['catch'](loggerCatch(_0x76ab('0x13')));};exports[_0x76ab('0x14')]=function(_0x50f987){return BPromise[_0x76ab('0xc')]()[_0x76ab('0xd')](cmHopper['getContactPreview'](_0x50f987))[_0x76ab('0x11')](loggerCatch(_0x76ab('0x15')));};exports[_0x76ab('0xe')]=function(_0x503709,_0x55319c){create(_0x503709)[_0x76ab('0x11')](loggerCatch(_0x55319c));moveContact(_0x503709)[_0x76ab('0x11')](loggerCatch(_0x55319c));};exports['createAgentHistory']=function(_0x3c5697,_0x50b6a3){createAgent(_0x3c5697)[_0x76ab('0x11')](loggerCatch(_0x50b6a3));};exports[_0x76ab('0x16')]=function(_0x3057bb,_0x179945){create(_0x3057bb)['catch'](loggerCatch(_0x179945));};exports['createCustomerFinal']=function(_0x1f2be4,_0xd01f1e){moveContact(_0x1f2be4)['catch'](loggerCatch(_0xd01f1e));};exports['rescheduleContact']=function(_0x430c21,_0x230111,_0x1963c7){if(_0x230111){_0x430c21[_0x76ab('0x17')]=null;}if(_0x1963c7){_0x430c21[_0x76ab('0x18')]=![];}return BPromise[_0x76ab('0xc')]()['then'](cmHopper['rescheduleContact'](_0x430c21))[_0x76ab('0x11')](loggerCatch('[rescheduleContact]\x20'));};exports[_0x76ab('0x19')]=function(_0x7cec95){return BPromise[_0x76ab('0xc')]()[_0x76ab('0xd')](cmHopper['countReScheduled'](_0x7cec95))[_0x76ab('0x11')](loggerCatch(_0x76ab('0x1a')));};exports[_0x76ab('0x1b')]=function(_0x942ca1){return BPromise['resolve']()['then'](cmHopper[_0x76ab('0x1b')]({'UserId':null},_0x942ca1,0x1))['catch'](loggerCatch('[unlockContact]\x20'));};exports[_0x76ab('0x1c')]=function(_0x2da0d0){return BPromise['resolve']()[_0x76ab('0xd')](cmHopper[_0x76ab('0x1b')]({'active':![]},_0x2da0d0,0x1))[_0x76ab('0x11')](loggerCatch(_0x76ab('0x1d')));};exports[_0x76ab('0x1e')]=function(_0x30b48e){var _0x164675={};_0x164675['type']=_0x30b48e['type'];_0x164675[_0x76ab('0x1f')]=_0x30b48e[_0x76ab('0x1f')];_0x164675[_0x76ab('0x20')]=_0x30b48e[_0x76ab('0x20')];_0x164675[_0x76ab('0x21')]=_0x30b48e[_0x76ab('0x21')];_0x164675[_0x76ab('0x22')]=_0x30b48e[_0x76ab('0x22')];_0x164675['queuecallerjoinAt']=_0x30b48e[_0x76ab('0x23')];_0x164675[_0x76ab('0x24')]=_0x30b48e[_0x76ab('0x23')];_0x164675[_0x76ab('0x25')]=0x1;_0x164675[_0x76ab('0x26')]=_0x30b48e[_0x76ab('0x27')];_0x164675[_0x76ab('0x28')]=_0x30b48e[_0x76ab('0x29')];_0x164675[_0x76ab('0x2a')]='from-sip';_0x164675['exten']=_0x76ab('0x2b');_0x164675[_0x76ab('0x2c')]=0x0;_0x164675[_0x76ab('0x2d')]=0x1;_0x164675['lastAssignedTo']=_0x30b48e[_0x76ab('0x29')];_0x164675[_0x76ab('0x2e')]=_0x76ab('0x2f');return BPromise['resolve']()[_0x76ab('0xd')](voiceQueueReport[_0x76ab('0x30')](_0x164675))['catch'](loggerCatch('[voiceQueueReport]\x20'));};exports['getContactRecallMe']=function(_0x1a7042,_0x201227){return BPromise[_0x76ab('0xc')]()[_0x76ab('0xd')](cmHopper['getContactRecallMe'](_0x1a7042,_0x201227))[_0x76ab('0x11')](loggerCatch(_0x76ab('0x31')));};exports[_0x76ab('0x32')]=function(_0x46b25f){return BPromise[_0x76ab('0xc')]()[_0x76ab('0xd')](cmHopper[_0x76ab('0x33')](_0x46b25f,!![],!![]))[_0x76ab('0x11')](loggerCatch(_0x76ab('0x34')));}; \ No newline at end of file +var _0xcb1d=['type','uniqueid','calleridname','queue','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','util','bluebird','../../../config/logger','lodash','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','inspect','createHistory','catch','[createHistory]\x20','then','resolve','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','rescheduleContact','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[activeContact]\x20'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcb1d,0xe1));var _0xdcb1=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xcb1d[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0xdcb1('0x0'));var BPromise=require(_0xdcb1('0x1'));var logger=require(_0xdcb1('0x2'))('preview');var _=require(_0xdcb1('0x3'));var cmHopper=require(_0xdcb1('0x4'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0xdcb1('0x5'));var cmHopperBlack=require(_0xdcb1('0x6'));var voiceQueueRt=require(_0xdcb1('0x7'));var agentReportPreview=require(_0xdcb1('0x8'));var voiceQueueReport=require(_0xdcb1('0x9'));function loggerCatch(_0x2ffb12){return function(_0x63c80a){logger['error'](_0x2ffb12,util[_0xdcb1('0xa')](_0x63c80a,{'showHidden':![],'depth':null}));};}function create(_0x478983){return BPromise['resolve']()['then'](cmHopperHistory[_0xdcb1('0xb')](_0x478983))[_0xdcb1('0xc')](loggerCatch(_0xdcb1('0xd')));}function createAgent(_0xff7241){return BPromise['resolve']()[_0xdcb1('0xe')](agentReportPreview[_0xdcb1('0xb')](_0xff7241))[_0xdcb1('0xc')](loggerCatch(_0xdcb1('0xd')));}function moveContact(_0x186a0f){return BPromise[_0xdcb1('0xf')]()['then'](cmHopper[_0xdcb1('0x10')](_0x186a0f,!![]))[_0xdcb1('0xc')](loggerCatch(_0xdcb1('0x11')));}exports[_0xdcb1('0x12')]=function(_0x4e40cb){return BPromise[_0xdcb1('0xf')]()[_0xdcb1('0xe')](cmHopperBlack['checkIsBlackList'](_0x4e40cb))['catch'](loggerCatch(_0xdcb1('0x13')));};exports['getContactPreview']=function(_0x243ac4){return BPromise['resolve']()['then'](cmHopper[_0xdcb1('0x14')](_0x243ac4))['catch'](loggerCatch(_0xdcb1('0x15')));};exports[_0xdcb1('0xb')]=function(_0x5950de,_0x89b775){create(_0x5950de)[_0xdcb1('0xc')](loggerCatch(_0x89b775));moveContact(_0x5950de)['catch'](loggerCatch(_0x89b775));};exports[_0xdcb1('0x16')]=function(_0x10db90,_0x5411e4){createAgent(_0x10db90)[_0xdcb1('0xc')](loggerCatch(_0x5411e4));};exports[_0xdcb1('0x17')]=function(_0xbef009,_0x1f7e36){create(_0xbef009)[_0xdcb1('0xc')](loggerCatch(_0x1f7e36));};exports['createCustomerFinal']=function(_0x56037b,_0x1732ba){moveContact(_0x56037b)[_0xdcb1('0xc')](loggerCatch(_0x1732ba));};exports[_0xdcb1('0x18')]=function(_0x5dc4dc,_0x17e3e6,_0x4c09d8){if(_0x17e3e6){_0x5dc4dc['UserId']=null;}if(_0x4c09d8){_0x5dc4dc['active']=![];}return BPromise[_0xdcb1('0xf')]()[_0xdcb1('0xe')](cmHopper[_0xdcb1('0x18')](_0x5dc4dc))['catch'](loggerCatch(_0xdcb1('0x19')));};exports[_0xdcb1('0x1a')]=function(_0x3609a2){return BPromise['resolve']()['then'](cmHopper[_0xdcb1('0x1a')](_0x3609a2))[_0xdcb1('0xc')](loggerCatch(_0xdcb1('0x1b')));};exports['unlockContact']=function(_0x35440b){return BPromise['resolve']()[_0xdcb1('0xe')](cmHopper[_0xdcb1('0x1c')]({'UserId':null},_0x35440b,0x1))[_0xdcb1('0xc')](loggerCatch('[unlockContact]\x20'));};exports['disableContact']=function(_0x5bd618){return BPromise[_0xdcb1('0xf')]()[_0xdcb1('0xe')](cmHopper[_0xdcb1('0x1c')]({'active':![]},_0x5bd618,0x1))[_0xdcb1('0xc')](loggerCatch(_0xdcb1('0x1d')));};exports['crateCustomerReportQueue']=function(_0x39b080){var _0x4ebe6a={};_0x4ebe6a[_0xdcb1('0x1e')]=_0x39b080[_0xdcb1('0x1e')];_0x4ebe6a[_0xdcb1('0x1f')]=_0x39b080['uniqueid'];_0x4ebe6a['calleridnum']=_0x39b080['calleridnum'];_0x4ebe6a[_0xdcb1('0x20')]=_0x39b080[_0xdcb1('0x20')];_0x4ebe6a[_0xdcb1('0x21')]=_0x39b080['queue'];_0x4ebe6a['queuecallerjoinAt']=_0x39b080[_0xdcb1('0x22')];_0x4ebe6a[_0xdcb1('0x23')]=_0x39b080[_0xdcb1('0x22')];_0x4ebe6a[_0xdcb1('0x24')]=0x1;_0x4ebe6a[_0xdcb1('0x25')]=_0x39b080[_0xdcb1('0x26')];_0x4ebe6a[_0xdcb1('0x27')]=_0x39b080[_0xdcb1('0x28')];_0x4ebe6a[_0xdcb1('0x29')]='from-sip';_0x4ebe6a[_0xdcb1('0x2a')]=_0xdcb1('0x2b');_0x4ebe6a[_0xdcb1('0x2c')]=0x0;_0x4ebe6a[_0xdcb1('0x2d')]=0x1;_0x4ebe6a[_0xdcb1('0x2e')]=_0x39b080['membername'];_0x4ebe6a['queuecallerexitreason']=_0xdcb1('0x2f');return BPromise[_0xdcb1('0xf')]()[_0xdcb1('0xe')](voiceQueueReport[_0xdcb1('0x30')](_0x4ebe6a))['catch'](loggerCatch(_0xdcb1('0x31')));};exports[_0xdcb1('0x32')]=function(_0xada612,_0x53b2b8){return BPromise[_0xdcb1('0xf')]()['then'](cmHopper[_0xdcb1('0x32')](_0xada612,_0x53b2b8))['catch'](loggerCatch('[GetContactRecallMe]\x20'));};exports['rescheduleContactInQueue']=function(_0x298a6d){return BPromise['resolve']()[_0xdcb1('0xe')](cmHopper[_0xdcb1('0x18')](_0x298a6d,!![],!![]))[_0xdcb1('0xc')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ 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 15c52de..4930b7c 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 _0xf49d=['Queue','name','calleridname','calleridnum','dialer','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','createdAt','updatedAt','%s%s','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','YYYY-MM-DD\x20HH:mm:ss','ringtime','logCustomer','talktime','Failure','RECALL','BOOKED','originate','channelAgent','from-sip','uniqueid','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','Global','scheduledAt','active','scheduledat','ContactId','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','interface','motionChannel','voice','mandatoryDisposition','agentReadyId','not_inuse','status','push','diff','createBody','CampaignId','type','campaigntype','dialAnswer','membername','countglobal','callback','callbackuniqueid','recallme','UserId','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-callerid','xmd-agiafter','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitter','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','match','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','seconds','loggerCatch','inspect','logger','info','loggerError','error','logger2','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil'];(function(_0x113c14,_0x51c16b){var _0x42cf3e=function(_0x4d1b7f){while(--_0x4d1b7f){_0x113c14['push'](_0x113c14['shift']());}};_0x42cf3e(++_0x51c16b);}(_0xf49d,0xfc));var _0xdf49=function(_0x19367f,_0x4ff28f){_0x19367f=_0x19367f-0x0;var _0x33a9fe=_0xf49d[_0x19367f];return _0x33a9fe;};'use strict';var util=require('util');var _=require(_0xdf49('0x0'));var moment=require(_0xdf49('0x1'));var logger=require(_0xdf49('0x2'))(_0xdf49('0x3'));var ipAgi=process[_0xdf49('0x4')][_0xdf49('0x5')]||_0xdf49('0x6');function getSeconds(_0x2aeb37,_0x2397f3){var _0x9a2c1a=moment(_0x2aeb37)[_0xdf49('0x7')](0x0);var _0x2284e6=moment(_0x2397f3)[_0xdf49('0x7')](0x0);return _0x9a2c1a['diff'](_0x2284e6,_0xdf49('0x8'));}exports[_0xdf49('0x9')]=function(_0x56a31c){return function(_0x1b14b7){logger['error'](_0x56a31c,util[_0xdf49('0xa')](_0x1b14b7,{'showHidden':![],'depth':null}));};};exports[_0xdf49('0xb')]=function(_0x12354a,_0x28847a){logger[_0xdf49('0xc')](_0x12354a,util[_0xdf49('0xa')](_0x28847a,{'showHidden':![],'depth':null}));};exports[_0xdf49('0xd')]=function(_0x49bf30,_0xdca795){logger[_0xdf49('0xe')](_0x49bf30,util[_0xdf49('0xa')](_0xdca795,{'showHidden':![],'depth':null}));};exports[_0xdf49('0xf')]=function(_0x2997){return function(_0x47631f){logger[_0xdf49('0xc')](_0x2997,util[_0xdf49('0xa')](_0x47631f,{'showHidden':![],'depth':null}));};};exports[_0xdf49('0x10')]=function(_0x40cbbc,_0xe26496,_0x3887d6){return{'message':_0x40cbbc,'unlock':_0xe26496,'active':_0x3887d6};};exports[_0xdf49('0x11')]=function(_0x1fcef6,_0x14486c,_0x7ba9ee){if(!_[_0xdf49('0x12')](_0x7ba9ee)&&_0xdf49('0x13')===typeof _0x7ba9ee&&!_['isEmpty'](_0x7ba9ee)){if(!_['isUndefined'](_0x14486c)&&_0xdf49('0x13')===typeof _0x14486c&&!_[_0xdf49('0x14')](_0x14486c)){return util[_0xdf49('0x15')](_0xdf49('0x16'),_0x14486c,_0x7ba9ee);}return util[_0xdf49('0x15')](_0xdf49('0x16'),_0x7ba9ee,_0x7ba9ee);}if(!_[_0xdf49('0x12')](_0x1fcef6)&&_0xdf49('0x13')===typeof _0x1fcef6&&!_[_0xdf49('0x14')](_0x1fcef6)){return _0x1fcef6;}return _0xdf49('0x17');};exports[_0xdf49('0x18')]=function(_0x5652a3){if(_[_0xdf49('0x19')](_0x5652a3)){return![];}return _0x5652a3;};exports['addVariables']=function(_0x2c6b14,_0x2fe32d,_0x36011f,_0x1ddd69,_0x3e40c6,_0x4c4b20){var _0xf587c5={'XMD-QUEUE':_0x2fe32d[_0xdf49('0x1a')]?_0x2fe32d[_0xdf49('0x1a')][_0xdf49('0x1b')]:'','XMD-CALLERID':_0x1ddd69,'XMD-CALLERID-PREVIEW':_0x4c4b20?util['format'](_0xdf49('0x16'),_0x4c4b20[_0xdf49('0x1c')],_0x4c4b20[_0xdf49('0x1d')]):_0x1ddd69,'XMD-DIALID':_0x3e40c6,'XMD-CONTACTID':_0x2fe32d['ContactId'],'XMD-CDRTYPE':_0xdf49('0x1e'),'CALLERID(all)':_0x1ddd69,'XMD-VOICEQUEUEID':_0x2fe32d['VoiceQueueId'],'XMD-DIALCHANNEL':_0x36011f,'XMD-DIALTIMEOUT':_0x2c6b14[_0xdf49('0x1f')]||0x1e,'XMD-DIALOPTIONS':util[_0xdf49('0x15')](_0xdf49('0x20'),_0x2c6b14[_0xdf49('0x21')]?'g':'',_['isEmpty'](_0x2c6b14[_0xdf49('0x22')])?'':_0xdf49('0x23')),'XMD-DIALURL':_0x2c6b14['dialPreviewUrl']||'','XMD-AGI':_0x2c6b14[_0xdf49('0x24')]?util['format'](_0xdf49('0x25'),ipAgi,_0x2c6b14['dialQueueProject']):_0xdf49('0x26'),'XMD-AGIAFTER':_0x2c6b14[_0xdf49('0x21')]?util[_0xdf49('0x15')](_0xdf49('0x25'),ipAgi,_0x2c6b14['dialQueueProject2']):'NONE','XMD-ORIGINATECALLERIDNUM':_0x4c4b20?_0x4c4b20[_0xdf49('0x27')]:'','XMD-ORIGINATECALLERIDNAME':_0x4c4b20?_0x4c4b20[_0xdf49('0x28')]:'','XMD-DESTINATION':_0xdf49('0x29'),'SIPADDHEADER':_0xdf49('0x2a')};if(!_['isEmpty'](_0x2c6b14[_0xdf49('0x22')])){_0xf587c5[util[_0xdf49('0x15')]('%s',_0xdf49('0x2b'))]=_0x2c6b14[_0xdf49('0x22')];_0xf587c5[util[_0xdf49('0x15')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x3e40c6;}if(_0x2fe32d&&_0x2fe32d[_0xdf49('0x2c')]){for(var _0x3c0fc1 in _0x2fe32d[_0xdf49('0x2c')]){if(_0x2fe32d[_0xdf49('0x2c')][_0xdf49('0x2d')](_0x3c0fc1)){if(!_[_0xdf49('0x19')](_0x2fe32d[_0xdf49('0x2c')][_0x3c0fc1])&&_0x3c0fc1!=='id'&&_0x3c0fc1!=='tags'&&_0x3c0fc1!==_0xdf49('0x2e')&&_0x3c0fc1!==_0xdf49('0x2f')){_0xf587c5[util[_0xdf49('0x15')](_0xdf49('0x30'),'XMD-',_[_0xdf49('0x31')](_0x3c0fc1))]=_0x2fe32d[_0xdf49('0x2c')][_0x3c0fc1];}}}}return _0xf587c5;};exports[_0xdf49('0x32')]=function(_0x140c20){var _0x3eb941={};for(var _0x20aa36 in _0x140c20){if(_0x140c20[_0xdf49('0x2d')](_0x20aa36)){_0x3eb941[util[_0xdf49('0x15')]('%s',_[_0xdf49('0x33')](_0x20aa36))]=_0x140c20[_0x20aa36];}}return{'variables':_0x3eb941};};exports[_0xdf49('0x34')]=function(_0x129bca,_0x1dc2e6){if(!_[_0xdf49('0x19')](_0x129bca)){if(_0x129bca[_0xdf49('0x2d')](_0xdf49('0x35'))){if(_0x129bca[_0xdf49('0x35')]>0x0){_0x129bca['originated']-=0x1;}else{logger[_0xdf49('0xe')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x1dc2e6);}}}else{logger[_0xdf49('0xe')](_0xdf49('0x36'),_0x1dc2e6);}};exports[_0xdf49('0x37')]=function(_0xa7fd9a){var _0x4e793b=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0xa7fd9a[_0xdf49('0x38')]=0xd;_0xa7fd9a[_0xdf49('0x39')]=_0xdf49('0x3a');_0xa7fd9a[_0xdf49('0x3b')]=_0x4e793b;_0xa7fd9a[_0xdf49('0x3c')]=_0x4e793b;_0xa7fd9a[_0xdf49('0x3d')]=_0x4e793b;};exports[_0xdf49('0x3e')]=function(_0x34ab0a,_0xb0b2ee,_0x5eec8c){var _0x5bfd99=moment()[_0xdf49('0x15')](_0xdf49('0x3f'));_0x34ab0a['state']=_0xb0b2ee;_0x34ab0a['statedesc']=_0x5eec8c;_0x34ab0a['responsetime']=_0x5bfd99;_0x34ab0a[_0xdf49('0x40')]=getSeconds(_0x34ab0a[_0xdf49('0x3c')],_0x34ab0a['starttime']);};exports['logLookAgent']=function(_0x5794bf,_0x2421ea,_0x46d456){_0x5794bf['membername']=_0x2421ea;_0x5794bf['UserId']=_0x46d456;};exports[_0xdf49('0x41')]=function(_0x41b471,_0x25c0fd,_0x169e6c){var _0x1e5496=moment()[_0xdf49('0x15')]('YYYY-MM-DD\x20HH:mm:ss');_0x41b471[_0xdf49('0x38')]=_0x25c0fd;_0x41b471[_0xdf49('0x39')]=_0x169e6c;_0x41b471[_0xdf49('0x3c')]=_0x41b471[_0xdf49('0x3c')]?_0x41b471[_0xdf49('0x3c')]:_0x1e5496;_0x41b471[_0xdf49('0x3d')]=_0x41b471[_0xdf49('0x3d')]?_0x41b471['endtime']:_0x1e5496;_0x41b471[_0xdf49('0x40')]=getSeconds(_0x41b471['responsetime']||0x0,_0x41b471[_0xdf49('0x3b')]||0x0);_0x41b471[_0xdf49('0x42')]=_0x41b471['answertime']?getSeconds(_0x41b471[_0xdf49('0x3d')],_0x41b471['answertime']):0x0;};exports['isFailure']=function(_0x3fd29e){return _0x3fd29e===_0xdf49('0x43');};exports['variablesAction']=function(_0x395620,_0x405715,_0x3b75eb,_0x320a61,_0xb41b7){var _0x1e383c=_0x320a61?_0xdf49('0x44'):_0x395620[_0xdf49('0x1c')];_0x1e383c=_0xb41b7?_0xdf49('0x45'):_0x1e383c;return{'actionid':_0x395620['uniqueid'],'action':_0xdf49('0x46'),'channel':_0x395620[_0xdf49('0x47')],'callerid':util[_0xdf49('0x15')]('\x22%s\x22\x20<%s>',_0x1e383c,_0x395620[_0xdf49('0x1d')]),'Exten':_0xdf49('0x29'),'Context':_0xdf49('0x48'),'Priority':'1','variable':_0x3b75eb,'timeout':(_0x405715['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x395620[_0xdf49('0x49')]};};exports['totalGlobal']=function(_0x4f8d0a){return _0x4f8d0a[_0xdf49('0x4a')]+_0x4f8d0a[_0xdf49('0x4b')]+_0x4f8d0a[_0xdf49('0x4c')]+_0x4f8d0a[_0xdf49('0x4d')]+_0x4f8d0a[_0xdf49('0x4e')];};exports['cloneAction']=function(_0x4c8188){var _0x451c5f=_['clone'](_0x4c8188);_0x451c5f[_0xdf49('0x38')]=0xf;_0x451c5f[_0xdf49('0x39')]=_0xdf49('0x4f');return _0x451c5f;};exports[_0xdf49('0x50')]=function(_0x45661f,_0x17a290,_0x326df8){var _0x340fab={};_0x340fab[_0x17a290]=_0x45661f[_0x17a290];_0x340fab[_0xdf49('0x51')]=![];_0x340fab[_0xdf49('0x52')]=moment()['add'](_0x326df8,'minutes')[_0xdf49('0x15')](_0xdf49('0x3f'));_0x340fab[_0xdf49('0x53')]=_0x45661f[_0xdf49('0x53')];_0x340fab['ListId']=_0x45661f[_0xdf49('0x54')];_0x340fab[_0xdf49('0x55')]=_0x45661f[_0xdf49('0x55')]||undefined;return _0x340fab;};exports[_0xdf49('0x56')]=function(_0x55a254,_0x466f6f){if(!_[_0xdf49('0x19')](_0x55a254)){if(_0x55a254['pTalking']>0x0){_0x55a254[_0xdf49('0x57')]-=0x1;}else{logger[_0xdf49('0xe')](_0x466f6f,_0xdf49('0x58'));}}else{logger[_0xdf49('0xe')](_0x466f6f,_0xdf49('0x59'));}};exports[_0xdf49('0x5a')]=function(_0x446b53){if(_0x446b53<=0x0){return!![];}return![];};exports['buildObj']=function(_0x3005,_0x563504,_0x1fe5b0){_0x3005[_0xdf49('0x5b')]=_0x563504;_0x3005[_0xdf49('0x1b')]=_0x3005[_0xdf49('0x5c')];_0x3005[_0xdf49('0x5d')]=_0x3005[_0xdf49('0x47')];_0x3005[_0xdf49('0x5e')]=_0xdf49('0x5f');if(_0x1fe5b0){_0x3005[_0xdf49('0x60')]=_0x1fe5b0['mandatoryDisposition'];}return _0x3005;};exports['buildAcw']=function(_0x48b840){var _0x6b0bb8={};_0x6b0bb8[_0xdf49('0x5c')]=_0x48b840[_0xdf49('0x5c')];_0x6b0bb8[_0xdf49('0x5d')]=_0x48b840[_0xdf49('0x47')];_0x6b0bb8[_0xdf49('0x49')]=_0x48b840[_0xdf49('0x49')];return _0x6b0bb8;};exports[_0xdf49('0x61')]=function(_0x3808a7){var _0x2c1167=[];for(var _0x1b76cf in _0x3808a7){if(_0x3808a7[_0xdf49('0x2d')](_0x1b76cf)){if(!_[_0xdf49('0x19')](_0x3808a7[_0x1b76cf])&&_0x3808a7[_0x1b76cf]['state']===_0xdf49('0x62')&&_0x3808a7[_0x1b76cf][_0xdf49('0x63')]==='reachable'){_0x2c1167[_0xdf49('0x64')](_0x3808a7[_0x1b76cf]['id']);}}}return _0x2c1167;};exports['getDiff']=function(_0x525a12){var _0x25ed2f=moment()['milliseconds'](0x0);var _0x5ad47f=moment(_0x525a12)['milliseconds'](0x0);return _0x25ed2f[_0xdf49('0x65')](_0x5ad47f,_0xdf49('0x8'));};exports[_0xdf49('0x66')]=function(_0x520c01){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x520c01[_0xdf49('0x53')],'ListId':_0x520c01[_0xdf49('0x54')],'VoiceQueueId':_0x520c01[_0xdf49('0x55')]||undefined,'CampaignId':_0x520c01[_0xdf49('0x67')]||undefined};};exports['filterKey']=function(_0x36ce23){if(_0x36ce23==='uniqueid'||_0x36ce23==='idContact'||_0x36ce23==='queue'||_0x36ce23===_0xdf49('0x68')||_0x36ce23===_0xdf49('0x69')||_0x36ce23===_0xdf49('0x6a')||_0x36ce23===_0xdf49('0x6b')||_0x36ce23===_0xdf49('0x47')||_0x36ce23===_0xdf49('0x1c')||_0x36ce23===_0xdf49('0x51')||_0x36ce23==='calleridnum'||_0x36ce23===_0xdf49('0x52')||_0x36ce23===_0xdf49('0x4a')||_0x36ce23==='countcongestionretry'||_0x36ce23===_0xdf49('0x4c')||_0x36ce23===_0xdf49('0x6c')||_0x36ce23===_0xdf49('0x6d')||_0x36ce23===_0xdf49('0x6e')||_0x36ce23==='callbackat'||_0x36ce23===_0xdf49('0x6f')||_0x36ce23===_0xdf49('0x53')||_0x36ce23===_0xdf49('0x54')||_0x36ce23===_0xdf49('0x70')||_0x36ce23===_0xdf49('0x55')||_0x36ce23==='sipcallid'||_0x36ce23===_0xdf49('0x71')||_0x36ce23===_0xdf49('0x72')||_0x36ce23===_0xdf49('0x73')||_0x36ce23===_0xdf49('0x74')||_0x36ce23===_0xdf49('0x75')||_0x36ce23===_0xdf49('0x76')||_0x36ce23===_0xdf49('0x77')||_0x36ce23===_0xdf49('0x78')||_0x36ce23===_0xdf49('0x79')||_0x36ce23===_0xdf49('0x7a')||_0x36ce23==='xmd-cdrtype'||_0x36ce23===_0xdf49('0x7b')||_0x36ce23===_0xdf49('0x7c')||_0x36ce23==='xmd-agi'||_0x36ce23===_0xdf49('0x7d')||_0x36ce23===_0xdf49('0x7e')||_0x36ce23==='rtpaudioqosjitter'||_0x36ce23===_0xdf49('0x7f')||_0x36ce23===_0xdf49('0x80')||_0x36ce23===_0xdf49('0x81')||_0x36ce23===_0xdf49('0x82')||_0x36ce23===_0xdf49('0x83')||_0x36ce23===_0xdf49('0x7d')||_0x36ce23===_0xdf49('0x7e')||_0x36ce23===_0xdf49('0x84')||_0x36ce23===_0xdf49('0x7f')||_0x36ce23==='rtpaudioqosloss'||_0x36ce23===_0xdf49('0x81')||_0x36ce23===_0xdf49('0x82')||_0x36ce23===_0xdf49('0x83')||_0x36ce23==='bridgepeer'||_0x36ce23===_0xdf49('0x85')||_0x36ce23==='state'||_0x36ce23===_0xdf49('0x39')){return![];}return!![];};exports[_0xdf49('0x86')]=function(_0x4bf5de,_0x13fdcf){var _0x1c724b,_0x44e356,_0x5f4e36;if(_0x13fdcf<=0x0){_0x13fdcf=0x1;}_0x1c724b=new RegExp(_0xdf49('0x87')+_0x13fdcf+'}$');_0x44e356=Math[_0xdf49('0x88')](0xa,_0x13fdcf-0x1);_0x5f4e36=Math[_0xdf49('0x88')](0xa,_0x13fdcf)-0x1;return util[_0xdf49('0x15')]('%s',_[_0xdf49('0x89')](_0x4bf5de,_0x1c724b,_['random'](_0x44e356,_0x5f4e36)));};exports['extractCalleridName']=function(_0x721d23){var _0x258d02=_0x721d23[_0xdf49('0x8a')](/"(.*?)"/);return _0x258d02?_0x258d02[0x1]:_0x721d23;};exports['extractCalleridNumber']=function(_0x55f463){var _0x2c67cd=_0x55f463[_0xdf49('0x8a')](/<(.*?)>/);return _0x2c67cd?_0x2c67cd[0x1]:_0x55f463;}; \ No newline at end of file +var _0x848a=['\x22\x22\x20<>','isActive','isNil','addVariables','Queue','calleridnum','VoiceQueueId','\x22rtTxX%s%s\x22','dialQueueProject2','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','NONE','\x22agi://%s/square,%s\x22','originatecalleridnum','_XCALLY_MIXMONITOR_FORMAT','monitor_format','Contact','hasOwnProperty','tags','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','state','statedesc','starttime','responsetime','endtime','logAgent','YYYY-MM-DD\x20HH:mm:ss','ringtime','logLookAgent','membername','UserId','logCustomer','talktime','answertime','isFailure','Failure','variablesAction','RECALL','calleridname','BOOKED','uniqueid','originate','channelAgent','xcally-motion-preview','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','cloneAction','clone','Global','active','add','minutes','ContactId','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','name','queue','interface','motionChannel','voice','mandatoryDisposition','buildAcw','agentReadyId','status','reachable','push','getDiff','filterKey','idContact','campaigntype','dialAnswer','scheduledat','countglobal','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-queue','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agi','rtpaudioqosbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','getCallerIdRandom','\x5cw{0,','replace','random','extractCalleridName','match','extractCalleridNumber','util','lodash','moment','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','error','info','inspect','loggerError','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>'];(function(_0x45b3ee,_0x41dd2a){var _0x332b0a=function(_0xc64ff0){while(--_0xc64ff0){_0x45b3ee['push'](_0x45b3ee['shift']());}};_0x332b0a(++_0x41dd2a);}(_0x848a,0x105));var _0xa848=function(_0x48b810,_0x173a5e){_0x48b810=_0x48b810-0x0;var _0x23c17d=_0x848a[_0x48b810];return _0x23c17d;};'use strict';var util=require(_0xa848('0x0'));var _=require(_0xa848('0x1'));var moment=require(_0xa848('0x2'));var logger=require('../../../../config/logger')(_0xa848('0x3'));var ipAgi=process[_0xa848('0x4')][_0xa848('0x5')]||_0xa848('0x6');function getSeconds(_0x45b3fd,_0x10e91d){var _0x10631b=moment(_0x45b3fd)['milliseconds'](0x0);var _0x257f52=moment(_0x10e91d)[_0xa848('0x7')](0x0);return _0x10631b[_0xa848('0x8')](_0x257f52,_0xa848('0x9'));}exports['loggerCatch']=function(_0x3a1bd9){return function(_0x28512b){logger[_0xa848('0xa')](_0x3a1bd9,util['inspect'](_0x28512b,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x46bc34,_0x28e34d){logger[_0xa848('0xb')](_0x46bc34,util[_0xa848('0xc')](_0x28e34d,{'showHidden':![],'depth':null}));};exports[_0xa848('0xd')]=function(_0x593f75,_0x4136a1){logger[_0xa848('0xa')](_0x593f75,util[_0xa848('0xc')](_0x4136a1,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x5f0c6f){return function(_0x5e2cc9){logger[_0xa848('0xb')](_0x5f0c6f,util['inspect'](_0x5e2cc9,{'showHidden':![],'depth':null}));};};exports[_0xa848('0xe')]=function(_0x37a367,_0x2f7949,_0x565c5e){return{'message':_0x37a367,'unlock':_0x2f7949,'active':_0x565c5e};};exports[_0xa848('0xf')]=function(_0x471848,_0x1f5bf2,_0x14a1bd){if(!_[_0xa848('0x10')](_0x14a1bd)&&_0xa848('0x11')===typeof _0x14a1bd&&!_[_0xa848('0x12')](_0x14a1bd)){if(!_[_0xa848('0x10')](_0x1f5bf2)&&_0xa848('0x11')===typeof _0x1f5bf2&&!_[_0xa848('0x12')](_0x1f5bf2)){return util[_0xa848('0x13')]('\x22%s\x22\x20<%s>',_0x1f5bf2,_0x14a1bd);}return util['format'](_0xa848('0x14'),_0x14a1bd,_0x14a1bd);}if(!_[_0xa848('0x10')](_0x471848)&&_0xa848('0x11')===typeof _0x471848&&!_[_0xa848('0x12')](_0x471848)){return _0x471848;}return _0xa848('0x15');};exports[_0xa848('0x16')]=function(_0x59371b){if(_[_0xa848('0x17')](_0x59371b)){return![];}return _0x59371b;};exports[_0xa848('0x18')]=function(_0x46ec21,_0xdf9a7b,_0x472834,_0x10628b,_0x5cdac6,_0x122082){var _0x513c30={'XMD-QUEUE':_0xdf9a7b['Queue']?_0xdf9a7b[_0xa848('0x19')]['name']:'','XMD-CALLERID':_0x10628b,'XMD-CALLERID-PREVIEW':_0x122082?util[_0xa848('0x13')](_0xa848('0x14'),_0x122082['calleridname'],_0x122082[_0xa848('0x1a')]):_0x10628b,'XMD-DIALID':_0x5cdac6,'XMD-CONTACTID':_0xdf9a7b['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x10628b,'XMD-VOICEQUEUEID':_0xdf9a7b[_0xa848('0x1b')],'XMD-DIALCHANNEL':_0x472834,'XMD-DIALTIMEOUT':_0x46ec21['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util['format'](_0xa848('0x1c'),_0x46ec21[_0xa848('0x1d')]?'g':'',_[_0xa848('0x12')](_0x46ec21['monitor_format'])?'':_0xa848('0x1e')),'XMD-DIALURL':_0x46ec21[_0xa848('0x1f')]||'','XMD-AGI':_0x46ec21[_0xa848('0x20')]?util[_0xa848('0x13')]('\x22agi://%s/square,%s\x22',ipAgi,_0x46ec21[_0xa848('0x20')]):_0xa848('0x21'),'XMD-AGIAFTER':_0x46ec21[_0xa848('0x1d')]?util[_0xa848('0x13')](_0xa848('0x22'),ipAgi,_0x46ec21['dialQueueProject2']):_0xa848('0x21'),'XMD-ORIGINATECALLERIDNUM':_0x122082?_0x122082[_0xa848('0x23')]:'','XMD-ORIGINATECALLERIDNAME':_0x122082?_0x122082['originatecalleridname']:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_[_0xa848('0x12')](_0x46ec21['monitor_format'])){_0x513c30[util['format']('%s',_0xa848('0x24'))]=_0x46ec21[_0xa848('0x25')];_0x513c30[util[_0xa848('0x13')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x5cdac6;}if(_0xdf9a7b&&_0xdf9a7b[_0xa848('0x26')]){for(var _0x1c4f30 in _0xdf9a7b['Contact']){if(_0xdf9a7b[_0xa848('0x26')][_0xa848('0x27')](_0x1c4f30)){if(!_['isNil'](_0xdf9a7b[_0xa848('0x26')][_0x1c4f30])&&_0x1c4f30!=='id'&&_0x1c4f30!==_0xa848('0x28')&&_0x1c4f30!=='createdAt'&&_0x1c4f30!==_0xa848('0x29')){_0x513c30[util['format'](_0xa848('0x2a'),_0xa848('0x2b'),_[_0xa848('0x2c')](_0x1c4f30))]=_0xdf9a7b['Contact'][_0x1c4f30];}}}}return _0x513c30;};exports[_0xa848('0x2d')]=function(_0x58bb20){var _0x50ca86={};for(var _0x561a5b in _0x58bb20){if(_0x58bb20[_0xa848('0x27')](_0x561a5b)){_0x50ca86[util[_0xa848('0x13')]('%s',_[_0xa848('0x2e')](_0x561a5b))]=_0x58bb20[_0x561a5b];}}return{'variables':_0x50ca86};};exports[_0xa848('0x2f')]=function(_0x5aa05b,_0x119019){if(!_[_0xa848('0x17')](_0x5aa05b)){if(_0x5aa05b[_0xa848('0x27')]('originated')){if(_0x5aa05b[_0xa848('0x30')]>0x0){_0x5aa05b[_0xa848('0x30')]-=0x1;}else{logger[_0xa848('0xa')](_0xa848('0x31'),_0x119019);}}}else{logger[_0xa848('0xa')](_0xa848('0x32'),_0x119019);}};exports['logBlacklist']=function(_0x145b25){var _0x2914c9=moment()[_0xa848('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x145b25[_0xa848('0x33')]=0xd;_0x145b25[_0xa848('0x34')]='Blacklist';_0x145b25[_0xa848('0x35')]=_0x2914c9;_0x145b25[_0xa848('0x36')]=_0x2914c9;_0x145b25[_0xa848('0x37')]=_0x2914c9;};exports[_0xa848('0x38')]=function(_0x5b9a7a,_0xc555c6,_0x3ba442){var _0x1cd3f3=moment()[_0xa848('0x13')](_0xa848('0x39'));_0x5b9a7a['state']=_0xc555c6;_0x5b9a7a[_0xa848('0x34')]=_0x3ba442;_0x5b9a7a[_0xa848('0x36')]=_0x1cd3f3;_0x5b9a7a[_0xa848('0x3a')]=getSeconds(_0x5b9a7a[_0xa848('0x36')],_0x5b9a7a[_0xa848('0x35')]);};exports[_0xa848('0x3b')]=function(_0x364575,_0x4bbc7f,_0x2fa5be){_0x364575[_0xa848('0x3c')]=_0x4bbc7f;_0x364575[_0xa848('0x3d')]=_0x2fa5be;};exports[_0xa848('0x3e')]=function(_0x3e1b17,_0x171317,_0x20feb4){var _0x4d330a=moment()[_0xa848('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x3e1b17[_0xa848('0x33')]=_0x171317;_0x3e1b17[_0xa848('0x34')]=_0x20feb4;_0x3e1b17[_0xa848('0x36')]=_0x3e1b17['responsetime']?_0x3e1b17[_0xa848('0x36')]:_0x4d330a;_0x3e1b17['endtime']=_0x3e1b17[_0xa848('0x37')]?_0x3e1b17[_0xa848('0x37')]:_0x4d330a;_0x3e1b17[_0xa848('0x3a')]=getSeconds(_0x3e1b17['responsetime']||0x0,_0x3e1b17[_0xa848('0x35')]||0x0);_0x3e1b17[_0xa848('0x3f')]=_0x3e1b17[_0xa848('0x40')]?getSeconds(_0x3e1b17['endtime'],_0x3e1b17['answertime']):0x0;};exports[_0xa848('0x41')]=function(_0x50e2ae){return _0x50e2ae===_0xa848('0x42');};exports[_0xa848('0x43')]=function(_0x2f806d,_0x3da641,_0x2b5495,_0x152c8b,_0x40396c){var _0x58d41e=_0x152c8b?_0xa848('0x44'):_0x2f806d[_0xa848('0x45')];_0x58d41e=_0x40396c?_0xa848('0x46'):_0x58d41e;return{'actionid':_0x2f806d[_0xa848('0x47')],'action':_0xa848('0x48'),'channel':_0x2f806d[_0xa848('0x49')],'callerid':util['format']('\x22%s\x22\x20<%s>',_0x58d41e,_0x2f806d[_0xa848('0x1a')]),'Exten':_0xa848('0x4a'),'Context':'from-sip','Priority':'1','variable':_0x2b5495,'timeout':(_0x3da641[_0xa848('0x4b')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2f806d['uniqueid']};};exports[_0xa848('0x4c')]=function(_0x43d394){return _0x43d394[_0xa848('0x4d')]+_0x43d394[_0xa848('0x4e')]+_0x43d394[_0xa848('0x4f')]+_0x43d394[_0xa848('0x50')]+_0x43d394['countnosuchnumberretry'];};exports[_0xa848('0x51')]=function(_0x285bc3){var _0x86952c=_[_0xa848('0x52')](_0x285bc3);_0x86952c['state']=0xf;_0x86952c['statedesc']=_0xa848('0x53');return _0x86952c;};exports['scheduledAt']=function(_0x4c1359,_0x1d794d,_0x46a384){var _0x325535={};_0x325535[_0x1d794d]=_0x4c1359[_0x1d794d];_0x325535[_0xa848('0x54')]=![];_0x325535['scheduledat']=moment()[_0xa848('0x55')](_0x46a384,_0xa848('0x56'))[_0xa848('0x13')](_0xa848('0x39'));_0x325535[_0xa848('0x57')]=_0x4c1359[_0xa848('0x57')];_0x325535[_0xa848('0x58')]=_0x4c1359['ListId'];_0x325535[_0xa848('0x1b')]=_0x4c1359[_0xa848('0x1b')]||undefined;return _0x325535;};exports[_0xa848('0x59')]=function(_0x1c7c86,_0x24fa0b){if(!_[_0xa848('0x17')](_0x1c7c86)){if(_0x1c7c86[_0xa848('0x5a')]>0x0){_0x1c7c86['pTalking']-=0x1;}else{logger[_0xa848('0xa')](_0x24fa0b,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0xa848('0xa')](_0x24fa0b,_0xa848('0x5b'));}};exports[_0xa848('0x5c')]=function(_0x1c7189){if(_0x1c7189<=0x0){return!![];}return![];};exports[_0xa848('0x5d')]=function(_0x4ebcbe,_0x3aa7a3,_0x7571c5){_0x4ebcbe['lastevent']=_0x3aa7a3;_0x4ebcbe[_0xa848('0x5e')]=_0x4ebcbe[_0xa848('0x5f')];_0x4ebcbe[_0xa848('0x60')]=_0x4ebcbe[_0xa848('0x49')];_0x4ebcbe[_0xa848('0x61')]=_0xa848('0x62');if(_0x7571c5){_0x4ebcbe['mandatoryDisposition']=_0x7571c5[_0xa848('0x63')];}return _0x4ebcbe;};exports[_0xa848('0x64')]=function(_0x142a4c){var _0x58cd92={};_0x58cd92[_0xa848('0x5f')]=_0x142a4c['queue'];_0x58cd92[_0xa848('0x60')]=_0x142a4c[_0xa848('0x49')];_0x58cd92[_0xa848('0x47')]=_0x142a4c[_0xa848('0x47')];return _0x58cd92;};exports[_0xa848('0x65')]=function(_0x331c42){var _0xcf3777=[];for(var _0x5a63a8 in _0x331c42){if(_0x331c42[_0xa848('0x27')](_0x5a63a8)){if(!_[_0xa848('0x17')](_0x331c42[_0x5a63a8])&&_0x331c42[_0x5a63a8][_0xa848('0x33')]==='not_inuse'&&_0x331c42[_0x5a63a8][_0xa848('0x66')]===_0xa848('0x67')){_0xcf3777[_0xa848('0x68')](_0x331c42[_0x5a63a8]['id']);}}}return _0xcf3777;};exports[_0xa848('0x69')]=function(_0x23d287){var _0x253ca6=moment()[_0xa848('0x7')](0x0);var _0x44cfaa=moment(_0x23d287)[_0xa848('0x7')](0x0);return _0x253ca6['diff'](_0x44cfaa,_0xa848('0x9'));};exports['createBody']=function(_0x528f43){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x528f43[_0xa848('0x57')],'ListId':_0x528f43[_0xa848('0x58')],'VoiceQueueId':_0x528f43[_0xa848('0x1b')]||undefined,'CampaignId':_0x528f43['CampaignId']||undefined};};exports[_0xa848('0x6a')]=function(_0x24b7e6){if(_0x24b7e6===_0xa848('0x47')||_0x24b7e6===_0xa848('0x6b')||_0x24b7e6==='queue'||_0x24b7e6==='type'||_0x24b7e6===_0xa848('0x6c')||_0x24b7e6===_0xa848('0x6d')||_0x24b7e6==='membername'||_0x24b7e6===_0xa848('0x49')||_0x24b7e6===_0xa848('0x45')||_0x24b7e6==='active'||_0x24b7e6==='calleridnum'||_0x24b7e6===_0xa848('0x6e')||_0x24b7e6==='countbusyretry'||_0x24b7e6===_0xa848('0x4e')||_0x24b7e6===_0xa848('0x4f')||_0x24b7e6===_0xa848('0x6f')||_0x24b7e6===_0xa848('0x70')||_0x24b7e6===_0xa848('0x71')||_0x24b7e6===_0xa848('0x72')||_0x24b7e6===_0xa848('0x73')||_0x24b7e6===_0xa848('0x57')||_0x24b7e6===_0xa848('0x58')||_0x24b7e6===_0xa848('0x3d')||_0x24b7e6==='VoiceQueueId'||_0x24b7e6===_0xa848('0x74')||_0x24b7e6==='xmd-voicequeueid'||_0x24b7e6===_0xa848('0x75')||_0x24b7e6==='xmd-phone'||_0x24b7e6===_0xa848('0x76')||_0x24b7e6===_0xa848('0x77')||_0x24b7e6===_0xa848('0x78')||_0x24b7e6===_0xa848('0x79')||_0x24b7e6===_0xa848('0x7a')||_0x24b7e6==='xmd-dialchannel'||_0x24b7e6===_0xa848('0x7b')||_0x24b7e6===_0xa848('0x7c')||_0x24b7e6===_0xa848('0x7d')||_0x24b7e6==='xmd-agiafter'||_0x24b7e6===_0xa848('0x7e')||_0x24b7e6==='rtpaudioqos'||_0x24b7e6===_0xa848('0x7f')||_0x24b7e6==='rtpaudioqosjitter'||_0x24b7e6==='rtpaudioqosjitterbridged'||_0x24b7e6==='rtpaudioqosloss'||_0x24b7e6===_0xa848('0x80')||_0x24b7e6===_0xa848('0x81')||_0x24b7e6===_0xa848('0x82')||_0x24b7e6===_0xa848('0x83')||_0x24b7e6===_0xa848('0x7f')||_0x24b7e6===_0xa848('0x84')||_0x24b7e6===_0xa848('0x85')||_0x24b7e6==='rtpaudioqosloss'||_0x24b7e6===_0xa848('0x80')||_0x24b7e6===_0xa848('0x81')||_0x24b7e6===_0xa848('0x82')||_0x24b7e6==='bridgepeer'||_0x24b7e6==='bridgepvtcallid'||_0x24b7e6==='state'||_0x24b7e6==='statedesc'){return![];}return!![];};exports[_0xa848('0x86')]=function(_0x7cb9b7,_0x5131ec){var _0x2eb176,_0xa4dafa,_0x559894;if(_0x5131ec<=0x0){_0x5131ec=0x1;}_0x2eb176=new RegExp(_0xa848('0x87')+_0x5131ec+'}$');_0xa4dafa=Math['pow'](0xa,_0x5131ec-0x1);_0x559894=Math['pow'](0xa,_0x5131ec)-0x1;return util[_0xa848('0x13')]('%s',_[_0xa848('0x88')](_0x7cb9b7,_0x2eb176,_[_0xa848('0x89')](_0xa4dafa,_0x559894)));};exports[_0xa848('0x8a')]=function(_0x40e2f5){var _0x1ad62c=_0x40e2f5[_0xa848('0x8b')](/"(.*?)"/);return _0x1ad62c?_0x1ad62c[0x1]:_0x40e2f5;};exports[_0xa848('0x8c')]=function(_0x548154){var _0x1cc171=_0x548154[_0xa848('0x8b')](/<(.*?)>/);return _0x1cc171?_0x1cc171[0x1]:_0x548154;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 2d7235d..1e988b1 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 _0x78dc=['voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number','boolean','reload','voicequeuechannel'];(function(_0x21a314,_0xbe022b){var _0x3eb9f6=function(_0x3b53ff){while(--_0x3b53ff){_0x21a314['push'](_0x21a314['shift']());}};_0x3eb9f6(++_0xbe022b);}(_0x78dc,0x8a));var _0xc78d=function(_0x51ac09,_0x383098){_0x51ac09=_0x51ac09-0x0;var _0x3f827d=_0x78dc[_0x51ac09];return _0x3f827d;};'use strict';exports[_0xc78d('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0xc78d('0x1'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0xc78d('0x2'),'required':![]},'paused':{'type':_0xc78d('0x3'),'required':![]}};exports['queueremove']={'queue':{'type':'string','required':!![]},'interface':{'type':_0xc78d('0x1'),'required':!![]}};exports['queuepause']={'interface':{'type':'string','required':!![]},'paused':{'type':_0xc78d('0x3')},'reason':{'type':_0xc78d('0x1'),'required':![]}};exports[_0xc78d('0x4')]={'module':{'type':'string','required':![]}};exports[_0xc78d('0x5')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xc78d('0x6')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':'string'},'format':{'type':_0xc78d('0x1')},'mixmonitorid':{'type':'string'}};exports[_0xc78d('0x7')]={'uniqueid':{'type':_0xc78d('0x1'),'required':!![]}};exports[_0xc78d('0x8')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0xc78d('0x1'),'required':!![]},'context':{'type':_0xc78d('0x1')}}; \ No newline at end of file +var _0xda87=['queueadd','string','boolean','queueremove','queuepause','reload','voicequeuechannel','voicequeuechannelhangup','voicequeuechannelredirect'];(function(_0x36a736,_0x1629c3){var _0x3bee52=function(_0x8bc46){while(--_0x8bc46){_0x36a736['push'](_0x36a736['shift']());}};_0x3bee52(++_0x1629c3);}(_0xda87,0xfc));var _0x7da8=function(_0x27af08,_0x192c31){_0x27af08=_0x27af08-0x0;var _0x49eb8e=_0xda87[_0x27af08];return _0x49eb8e;};'use strict';exports[_0x7da8('0x0')]={'queue':{'type':_0x7da8('0x1'),'required':!![]},'interface':{'type':_0x7da8('0x1'),'required':!![]},'membername':{'type':_0x7da8('0x1'),'required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':_0x7da8('0x2'),'required':![]}};exports[_0x7da8('0x3')]={'queue':{'type':_0x7da8('0x1'),'required':!![]},'interface':{'type':_0x7da8('0x1'),'required':!![]}};exports[_0x7da8('0x4')]={'interface':{'type':_0x7da8('0x1'),'required':!![]},'paused':{'type':_0x7da8('0x2')},'reason':{'type':'string','required':![]}};exports[_0x7da8('0x5')]={'module':{'type':_0x7da8('0x1'),'required':![]}};exports[_0x7da8('0x6')]={'uniqueid':{'type':_0x7da8('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':'string','required':!![]},'filename':{'type':'string'},'format':{'type':_0x7da8('0x1')},'mixmonitorid':{'type':_0x7da8('0x1')}};exports[_0x7da8('0x7')]={'uniqueid':{'type':_0x7da8('0x1'),'required':!![]}};exports[_0x7da8('0x8')]={'uniqueid':{'type':_0x7da8('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0x7da8('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 50cfe1a..81495a0 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 _0xed8d=['isUndefined','initVoiceQueues','initTriggers','triggers','initTemplates','templates','zendeskAccounts','initFreshdeskAccounts','freshdeskAccounts','initDeskAccounts','deskAccounts','initSugarcrmAccounts','vtigerAccounts','servicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','uniqueid','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','diff','queuecallerjoinAt','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','bluebird','lodash','moment','../model/agent','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','agents','telephones','trunks','voiceQueues','outbound','voiceExtensions','queueChannels','outboundChannels','timers','settings','salesforceAccounts','sugarcrmAccounts','zohoAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','isNil','interface','total','answered','sumHoldTime','sumDuration','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','sumBillable','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','mergeFromDatabase','prototype','initAgents','length'];(function(_0x3fde79,_0x11e979){var _0x4f4edb=function(_0x48db64){while(--_0x48db64){_0x3fde79['push'](_0x3fde79['shift']());}};_0x4f4edb(++_0x11e979);}(_0xed8d,0x1ce));var _0xded8=function(_0x57373f,_0x38677b){_0x57373f=_0x57373f-0x0;var _0x3ca700=_0xed8d[_0x57373f];return _0x3ca700;};'use strict';var BPromise=require(_0xded8('0x0'));var util=require('util');var _=require(_0xded8('0x1'));var moment=require(_0xded8('0x2'));var Agent=require(_0xded8('0x3'));var Telephone=require('../model/telephone');var Trunk=require(_0xded8('0x4'));var VoiceQueue=require(_0xded8('0x5'));var Trigger=require(_0xded8('0x6'));var Template=require(_0xded8('0x7'));var Campaign=require(_0xded8('0x8'));var VoiceExtension=require(_0xded8('0x9'));var ZendeskAccount=require(_0xded8('0xa'));var SalesforceAccount=require(_0xded8('0xb'));var FreshdeskAccount=require(_0xded8('0xc'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0xded8('0xd'));var DeskAccount=require(_0xded8('0xe'));var VtigerAccount=require(_0xded8('0xf'));var ServicenowAccount=require(_0xded8('0x10'));var Dynamics365Account=require(_0xded8('0x11'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require('../model/faxAccount');var Realtime=function(){this[_0xded8('0x12')]={};this[_0xded8('0x13')]={};this[_0xded8('0x14')]={};this[_0xded8('0x15')]={};this['triggers']={};this['campaigns']={};this['templates']={};this[_0xded8('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xded8('0x17')]={};this['channels']={};this[_0xded8('0x18')]={};this[_0xded8('0x19')]={};this[_0xded8('0x1a')]={};this[_0xded8('0x1b')]={};this['zendeskAccounts']={};this[_0xded8('0x1c')]={};this[_0xded8('0x1d')]={};this['freshdeskAccounts']={};this[_0xded8('0x1e')]={};this['deskAccounts']={};this['vtigerAccounts']={};this['servicenowAccounts']={};this[_0xded8('0x1f')]={};this[_0xded8('0x20')]={};this[_0xded8('0x21')]={};};function freeIsNotKey(_0x57cdb4,_0x19a70c,_0x1ce1b1){var _0x5befbe=_[_0xded8('0x22')](_0x57cdb4,function(_0x554fe8,_0x10afec){return _0x554fe8[_0x1ce1b1];});for(var _0x3034a5 in _0x19a70c){if(_0x19a70c[_0xded8('0x23')](_0x3034a5)){if(!_0x5befbe[_0x3034a5]){delete _0x19a70c[_0x3034a5];}}}}function freeIsNotKeySip(_0x234a18,_0x1726ab){var _0x30a690=_[_0xded8('0x22')](_0x234a18,function(_0x1a0660,_0x2e1c4){return util[_0xded8('0x24')](_0xded8('0x25'),_0x1a0660[_0xded8('0x26')]);});for(var _0x1c8cec in _0x1726ab){if(_0x1726ab[_0xded8('0x23')](_0x1c8cec)){if(!_0x30a690[_0x1c8cec]){delete _0x1726ab[_0x1c8cec];}}}}function freeIsNotKeyAgent(_0x46127a,_0xe06e05){var _0x30cb99=_['mapKeys'](_0x46127a,function(_0x23a1db,_0x2ca544){var _0x532fcb=_[_0xded8('0x27')](_0x23a1db['interface'])?util[_0xded8('0x24')](_0xded8('0x25'),_0x23a1db[_0xded8('0x26')]):_0x23a1db[_0xded8('0x28')];return _0x532fcb;});for(var _0x3b44cc in _0xe06e05){if(_0xe06e05[_0xded8('0x23')](_0x3b44cc)){if(!_0x30cb99[_0x3b44cc]){delete _0xe06e05[_0x3b44cc];}}}}function clearVoiceCallReports(_0x548912){_0x548912[_0xded8('0x29')]=0x0;_0x548912[_0xded8('0x2a')]=0x0;_0x548912[_0xded8('0x2b')]=0x0;_0x548912[_0xded8('0x2c')]=0x0;_0x548912['sumBillable']=0x0;}function clearCampaigns(_0x4d2719){if(!_[_0xded8('0x2d')](_0x4d2719)){for(var _0x1c93a7 in _0x4d2719){if(_0x4d2719[_0xded8('0x23')](_0x1c93a7)){_0x4d2719[_0x1c93a7][_0xded8('0x2e')]=0x0;_0x4d2719[_0x1c93a7][_0xded8('0x2f')]=0x0;}}}}function clearVoiceQueues(_0x3fd0cb){if(!_[_0xded8('0x2d')](_0x3fd0cb)){for(var _0x37b4b9 in _0x3fd0cb){if(_0x3fd0cb[_0xded8('0x23')](_0x37b4b9)){_0x3fd0cb[_0x37b4b9][_0xded8('0x29')]=0x0;_0x3fd0cb[_0x37b4b9]['answered']=0x0;_0x3fd0cb[_0x37b4b9][_0xded8('0x30')]=0x0;_0x3fd0cb[_0x37b4b9]['abandoned']=0x0;_0x3fd0cb[_0x37b4b9][_0xded8('0x2b')]=0x0;_0x3fd0cb[_0x37b4b9]['sumDuration']=0x0;_0x3fd0cb[_0x37b4b9][_0xded8('0x31')]=0x0;_0x3fd0cb[_0x37b4b9][_0xded8('0x32')]=0x0;_0x3fd0cb[_0x37b4b9]['outboundNoAnswerCallsDay']=0x0;_0x3fd0cb[_0x37b4b9][_0xded8('0x33')]=0x0;_0x3fd0cb[_0x37b4b9][_0xded8('0x34')]=0x0;_0x3fd0cb[_0x37b4b9]['outboundNoSuchCallsDay']=0x0;_0x3fd0cb[_0x37b4b9]['outboundUnknownCallsDay']=0x0;_0x3fd0cb[_0x37b4b9][_0xded8('0x35')]=0x0;_0x3fd0cb[_0x37b4b9][_0xded8('0x36')]=0x0;_0x3fd0cb[_0x37b4b9][_0xded8('0x37')]=0x0;_0x3fd0cb[_0x37b4b9]['outboundOriginateFailureCallsDay']=0x0;_0x3fd0cb[_0x37b4b9][_0xded8('0x38')]=0x0;_0x3fd0cb[_0x37b4b9][_0xded8('0x39')]=0x0;_0x3fd0cb[_0x37b4b9]['outboundAnswerAgiCallsDay']=0x0;_0x3fd0cb[_0x37b4b9][_0xded8('0x3a')]=0x0;_0x3fd0cb[_0x37b4b9]['queueStatusComplete']=!![];}}}}Realtime['prototype'][_0xded8('0x3b')]=function(_0x203390,_0x3f54a9){for(var _0x1a2db5 in _0x3f54a9){if(_0x203390[_0xded8('0x23')](_0x1a2db5)){_0x203390[_0x1a2db5]=_0x3f54a9[_0x1a2db5];}}};Realtime[_0xded8('0x3c')][_0xded8('0x3d')]=function(){var _0xe3ed8=this;return function(_0x30d635){if(_0x30d635){freeIsNotKeyAgent(_0x30d635,_0xe3ed8['agents']);for(var _0x30c3dd=0x0,_0x429d5d={},_0x1e2000={};_0x30c3dd<_0x30d635[_0xded8('0x3e')];_0x30c3dd+=0x1){_0x429d5d=_0x30d635[_0x30c3dd];var _0x17935d=_[_0xded8('0x27')](_0x429d5d['interface'])?util[_0xded8('0x24')](_0xded8('0x25'),_0x429d5d[_0xded8('0x26')]):_0x429d5d[_0xded8('0x28')];if(_[_0xded8('0x3f')](_0xe3ed8[_0xded8('0x12')][_0x17935d])){_0xe3ed8[_0xded8('0x12')][_0x17935d]=new Agent(_0x429d5d);}else{_0xe3ed8[_0xded8('0x3b')](_0xe3ed8[_0xded8('0x12')][_0x17935d],_0x429d5d);}}}return _0xe3ed8['agents'];};};Realtime[_0xded8('0x3c')]['initTelephones']=function(){var _0x4e1193=this;return function(_0x3d4f14){if(_0x3d4f14){freeIsNotKeySip(_0x3d4f14,_0x4e1193['telephones']);for(var _0x209abf=0x0,_0x4e8642={},_0x1a08e1={};_0x209abf<_0x3d4f14[_0xded8('0x3e')];_0x209abf+=0x1){_0x4e8642=_0x3d4f14[_0x209abf];if(_[_0xded8('0x3f')](_0x4e1193[_0xded8('0x13')][util[_0xded8('0x24')](_0xded8('0x25'),_0x4e8642['name'])])){_0x4e1193['telephones'][util['format']('SIP/%s',_0x4e8642[_0xded8('0x26')])]=new Telephone(_0x4e8642);}else{_0x4e1193[_0xded8('0x3b')](_0x4e1193[_0xded8('0x13')][util[_0xded8('0x24')](_0xded8('0x25'),_0x4e8642[_0xded8('0x26')])],_0x4e8642);}}}return _0x4e1193[_0xded8('0x13')];};};Realtime[_0xded8('0x3c')]['initTrunks']=function(){var _0x47e996=this;return function(_0x36e59a){if(_0x36e59a){freeIsNotKeySip(_0x36e59a,_0x47e996['trunks']);for(var _0x5366e5=0x0,_0x4b3a61={},_0x3ccd72={};_0x5366e5<_0x36e59a[_0xded8('0x3e')];_0x5366e5+=0x1){_0x4b3a61=_0x36e59a[_0x5366e5];if(_['isUndefined'](_0x47e996[_0xded8('0x14')][util[_0xded8('0x24')]('SIP/%s',_0x4b3a61[_0xded8('0x26')])])){_0x47e996[_0xded8('0x14')][util[_0xded8('0x24')](_0xded8('0x25'),_0x4b3a61['name'])]=new Trunk(_0x4b3a61);}else{_0x47e996[_0xded8('0x3b')](_0x47e996[_0xded8('0x14')][util[_0xded8('0x24')](_0xded8('0x25'),_0x4b3a61[_0xded8('0x26')])],_0x4b3a61);}}}return _0x47e996['trunks'];};};Realtime[_0xded8('0x3c')][_0xded8('0x40')]=function(){var _0x11477e=this;return function(_0x596db5){if(_0x596db5){freeIsNotKey(_0x596db5,_0x11477e['voiceQueues'],_0xded8('0x26'));for(var _0x2792f2=0x0,_0x17a873={},_0x118c31={};_0x2792f2<_0x596db5[_0xded8('0x3e')];_0x2792f2+=0x1){_0x17a873=_0x596db5[_0x2792f2];if(_['isUndefined'](_0x11477e[_0xded8('0x15')][_0x17a873[_0xded8('0x26')]])){_0x11477e['voiceQueues'][_0x17a873[_0xded8('0x26')]]=new VoiceQueue(_0x17a873);}else{_0x11477e[_0xded8('0x3b')](_0x11477e[_0xded8('0x15')][_0x17a873[_0xded8('0x26')]],_0x17a873);}}}return _0x11477e[_0xded8('0x15')];};};Realtime[_0xded8('0x3c')][_0xded8('0x41')]=function(){var _0x12c85b=this;return function(_0xfd21ef){if(_0xfd21ef){freeIsNotKey(_0xfd21ef,_0x12c85b[_0xded8('0x42')],'id');for(var _0x4e8d21=0x0,_0x2a76d8={},_0x1c972e={};_0x4e8d21<_0xfd21ef['length'];_0x4e8d21+=0x1){_0x2a76d8=_0xfd21ef[_0x4e8d21];if(_[_0xded8('0x3f')](_0x12c85b[_0xded8('0x42')][_0x2a76d8['id']])){_0x12c85b[_0xded8('0x42')][_0x2a76d8['id']]=new Trigger(_0x2a76d8);}else{_0x12c85b['mergeFromDatabase'](_0x12c85b[_0xded8('0x42')][_0x2a76d8['id']],_0x2a76d8);}}}return _0x12c85b[_0xded8('0x42')];};};Realtime[_0xded8('0x3c')][_0xded8('0x43')]=function(){var _0x1cbf7f=this;return function(_0x296771){if(_0x296771){freeIsNotKey(_0x296771,_0x1cbf7f[_0xded8('0x44')],'id');for(var _0x2c4e1d=0x0,_0x40613a={},_0xde4b2={};_0x2c4e1d<_0x296771[_0xded8('0x3e')];_0x2c4e1d+=0x1){_0x40613a=_0x296771[_0x2c4e1d];if(_[_0xded8('0x3f')](_0x1cbf7f[_0xded8('0x44')][_0x40613a['id']])){_0x1cbf7f[_0xded8('0x44')][_0x40613a['id']]=new Template(_0x40613a);}else{_0x1cbf7f[_0xded8('0x3b')](_0x1cbf7f[_0xded8('0x44')][_0x40613a['id']],_0x40613a);}}}return _0x1cbf7f['templates'];};};Realtime[_0xded8('0x3c')]['initZendeskAccounts']=function(){var _0x5e5312=this;return function(_0x307c4d){if(_0x307c4d){freeIsNotKey(_0x307c4d,_0x5e5312[_0xded8('0x45')],'id');for(var _0x163c0a=0x0,_0x3b3f81={},_0x41894d={};_0x163c0a<_0x307c4d[_0xded8('0x3e')];_0x163c0a+=0x1){_0x3b3f81=_0x307c4d[_0x163c0a];if(_['isUndefined'](_0x5e5312['zendeskAccounts'][_0x3b3f81['id']])){_0x5e5312[_0xded8('0x45')][_0x3b3f81['id']]=new ZendeskAccount(_0x3b3f81);}else{_0x5e5312[_0xded8('0x3b')](_0x5e5312[_0xded8('0x45')][_0x3b3f81['id']],_0x3b3f81);}}}return _0x5e5312[_0xded8('0x45')];};};Realtime[_0xded8('0x3c')]['initSalesforceAccounts']=function(){var _0x492345=this;return function(_0x48811a){if(_0x48811a){freeIsNotKey(_0x48811a,_0x492345[_0xded8('0x1c')],'id');for(var _0x11bbfd=0x0,_0x26f3d0={},_0x26b92a={};_0x11bbfd<_0x48811a[_0xded8('0x3e')];_0x11bbfd+=0x1){_0x26f3d0=_0x48811a[_0x11bbfd];if(_[_0xded8('0x3f')](_0x492345[_0xded8('0x1c')][_0x26f3d0['id']])){_0x492345[_0xded8('0x1c')][_0x26f3d0['id']]=new SalesforceAccount(_0x26f3d0);}else{_0x492345[_0xded8('0x3b')](_0x492345[_0xded8('0x1c')][_0x26f3d0['id']],_0x26f3d0);}}}return _0x492345[_0xded8('0x1c')];};};Realtime[_0xded8('0x3c')][_0xded8('0x46')]=function(){var _0x5a3492=this;return function(_0x45ba14){if(_0x45ba14){freeIsNotKey(_0x45ba14,_0x5a3492[_0xded8('0x47')],'id');for(var _0x1d6eee=0x0,_0x5bfe47={},_0x174d20={};_0x1d6eee<_0x45ba14[_0xded8('0x3e')];_0x1d6eee+=0x1){_0x5bfe47=_0x45ba14[_0x1d6eee];if(_[_0xded8('0x3f')](_0x5a3492['freshdeskAccounts'][_0x5bfe47['id']])){_0x5a3492['freshdeskAccounts'][_0x5bfe47['id']]=new FreshdeskAccount(_0x5bfe47);}else{_0x5a3492[_0xded8('0x3b')](_0x5a3492[_0xded8('0x47')][_0x5bfe47['id']],_0x5bfe47);}}}return _0x5a3492[_0xded8('0x47')];};};Realtime['prototype']['initZohoAccounts']=function(){var _0x2e438f=this;return function(_0x5cb5b6){if(_0x5cb5b6){freeIsNotKey(_0x5cb5b6,_0x2e438f[_0xded8('0x1e')],'id');for(var _0x2c3455=0x0,_0x5965bf={},_0x5dee82={};_0x2c3455<_0x5cb5b6[_0xded8('0x3e')];_0x2c3455+=0x1){_0x5965bf=_0x5cb5b6[_0x2c3455];if(_['isUndefined'](_0x2e438f[_0xded8('0x1e')][_0x5965bf['id']])){_0x2e438f[_0xded8('0x1e')][_0x5965bf['id']]=new ZohoAccount(_0x5965bf);}else{_0x2e438f[_0xded8('0x3b')](_0x2e438f[_0xded8('0x1e')][_0x5965bf['id']],_0x5965bf);}}}return _0x2e438f[_0xded8('0x1e')];};};Realtime[_0xded8('0x3c')][_0xded8('0x48')]=function(){var _0x3d47b5=this;return function(_0xbb6d9c){if(_0xbb6d9c){freeIsNotKey(_0xbb6d9c,_0x3d47b5['deskAccounts'],'id');for(var _0x1c7e4b=0x0,_0x15f722={},_0x256e4f={};_0x1c7e4b<_0xbb6d9c[_0xded8('0x3e')];_0x1c7e4b+=0x1){_0x15f722=_0xbb6d9c[_0x1c7e4b];if(_[_0xded8('0x3f')](_0x3d47b5[_0xded8('0x49')][_0x15f722['id']])){_0x3d47b5[_0xded8('0x49')][_0x15f722['id']]=new DeskAccount(_0x15f722);}else{_0x3d47b5[_0xded8('0x3b')](_0x3d47b5[_0xded8('0x49')][_0x15f722['id']],_0x15f722);}}}return _0x3d47b5['deskAccounts'];};};Realtime['prototype'][_0xded8('0x4a')]=function(){var _0x212f9e=this;return function(_0x370d23){if(_0x370d23){freeIsNotKey(_0x370d23,_0x212f9e['sugarcrmAccounts'],'id');for(var _0x22f51c=0x0,_0x1c4d52={},_0x3117fc={};_0x22f51c<_0x370d23[_0xded8('0x3e')];_0x22f51c+=0x1){_0x1c4d52=_0x370d23[_0x22f51c];if(_[_0xded8('0x3f')](_0x212f9e['sugarcrmAccounts'][_0x1c4d52['id']])){_0x212f9e[_0xded8('0x1d')][_0x1c4d52['id']]=new SugarcrmAccount(_0x1c4d52);}else{_0x212f9e[_0xded8('0x3b')](_0x212f9e['sugarcrmAccounts'][_0x1c4d52['id']],_0x1c4d52);}}}return _0x212f9e['sugarcrmAccounts'];};};Realtime[_0xded8('0x3c')]['initVtigerAccounts']=function(){var _0x4b7aa0=this;return function(_0x47d943){if(_0x47d943){freeIsNotKey(_0x47d943,_0x4b7aa0[_0xded8('0x4b')],'id');for(var _0x4228f5=0x0,_0x254759={},_0x4ffa28={};_0x4228f5<_0x47d943[_0xded8('0x3e')];_0x4228f5+=0x1){_0x254759=_0x47d943[_0x4228f5];if(_[_0xded8('0x3f')](_0x4b7aa0[_0xded8('0x4b')][_0x254759['id']])){_0x4b7aa0[_0xded8('0x4b')][_0x254759['id']]=new VtigerAccount(_0x254759);}else{_0x4b7aa0[_0xded8('0x3b')](_0x4b7aa0['vtigerAccounts'][_0x254759['id']],_0x254759);}}}return _0x4b7aa0[_0xded8('0x4b')];};};Realtime[_0xded8('0x3c')]['initServicenowAccounts']=function(){var _0x2cc9ca=this;return function(_0x10b0e5){if(_0x10b0e5){freeIsNotKey(_0x10b0e5,_0x2cc9ca[_0xded8('0x4c')],'id');for(var _0x4adc1c=0x0,_0x3e80a3={},_0x1eb8fe={};_0x4adc1c<_0x10b0e5[_0xded8('0x3e')];_0x4adc1c+=0x1){_0x3e80a3=_0x10b0e5[_0x4adc1c];if(_[_0xded8('0x3f')](_0x2cc9ca['servicenowAccounts'][_0x3e80a3['id']])){_0x2cc9ca['servicenowAccounts'][_0x3e80a3['id']]=new ServicenowAccount(_0x3e80a3);}else{_0x2cc9ca[_0xded8('0x3b')](_0x2cc9ca[_0xded8('0x4c')][_0x3e80a3['id']],_0x3e80a3);}}}return _0x2cc9ca[_0xded8('0x4c')];};};Realtime[_0xded8('0x3c')][_0xded8('0x4d')]=function(){var _0x261be9=this;return function(_0x5ca852){if(_0x5ca852){freeIsNotKey(_0x5ca852,_0x261be9[_0xded8('0x1f')],'id');for(var _0x55bc96=0x0,_0x34d248={},_0x778d71={};_0x55bc96<_0x5ca852[_0xded8('0x3e')];_0x55bc96+=0x1){_0x34d248=_0x5ca852[_0x55bc96];if(_['isUndefined'](_0x261be9['dynamics365Accounts'][_0x34d248['id']])){_0x261be9[_0xded8('0x1f')][_0x34d248['id']]=new Dynamics365Account(_0x34d248);}else{_0x261be9[_0xded8('0x3b')](_0x261be9[_0xded8('0x1f')][_0x34d248['id']],_0x34d248);}}}return _0x261be9[_0xded8('0x1f')];};};Realtime['prototype'][_0xded8('0x4e')]=function(){var _0x383e3b=this;return function(_0x15e00f){if(_0x15e00f){freeIsNotKey(_0x15e00f,_0x383e3b['freshsalesAccounts'],'id');for(var _0x1099ac=0x0,_0x2db774={},_0x1c4bcf={};_0x1099ac<_0x15e00f[_0xded8('0x3e')];_0x1099ac+=0x1){_0x2db774=_0x15e00f[_0x1099ac];if(_[_0xded8('0x3f')](_0x383e3b['freshsalesAccounts'][_0x2db774['id']])){_0x383e3b[_0xded8('0x20')][_0x2db774['id']]=new FreshsalesAccount(_0x2db774);}else{_0x383e3b[_0xded8('0x3b')](_0x383e3b[_0xded8('0x20')][_0x2db774['id']],_0x2db774);}}}return _0x383e3b[_0xded8('0x20')];};};Realtime['prototype'][_0xded8('0x4f')]=function(){var _0x750056=this;return function(_0x4adadf){for(var _0x90a82a=0x0;_0x90a82a<_0x4adadf[_0xded8('0x3e')];_0x90a82a+=0x1){_[_0xded8('0x50')](_0x750056['voiceQueues'][_0x4adadf[_0x90a82a]['name']],_0x4adadf[_0x90a82a]);}return _0x750056[_0xded8('0x15')];};};Realtime[_0xded8('0x3c')][_0xded8('0x51')]=function(){var _0x347293=this;return function(_0x3e2b7e){clearVoiceQueues(_0x347293[_0xded8('0x15')]);if(_0x3e2b7e){_0x3e2b7e=_['groupBy'](_0x3e2b7e,_0xded8('0x52'));for(var _0x3fb5b0 in _0x3e2b7e){if(_0x3e2b7e[_0xded8('0x23')](_0x3fb5b0)){var _0x47d220={};for(var _0x422d0b=0x0;_0x422d0b<_0x3e2b7e[_0x3fb5b0]['length'];_0x422d0b+=0x1){var _0x319d9f=_0x3e2b7e[_0x3fb5b0][_0x422d0b][_0xded8('0x53')];if(_0x347293[_0xded8('0x15')][_0x319d9f]){if(_0x3e2b7e[_0x3fb5b0][_0x422d0b][_0xded8('0x54')]){_0x347293['voiceQueues'][_0x319d9f][_0xded8('0x30')]+=0x1;}if(_0x3e2b7e[_0x3fb5b0][_0x422d0b][_0xded8('0x55')]){_0x347293[_0xded8('0x15')][_0x319d9f]['abandoned']+=0x1;}_0x347293[_0xded8('0x15')][_0x319d9f][_0xded8('0x2b')]+=moment(_0x3e2b7e[_0x3fb5b0][_0x422d0b][_0xded8('0x56')])['diff'](moment(_0x3e2b7e[_0x3fb5b0][_0x422d0b]['queuecallerjoinAt']),_0xded8('0x57'))||0x0;if(_0x422d0b===_0x3e2b7e[_0x3fb5b0][_0xded8('0x3e')]-0x1){_0x347293[_0xded8('0x15')][_0x319d9f][_0xded8('0x2c')]+=moment(_0x3e2b7e[_0x3fb5b0][_0x422d0b][_0xded8('0x58')]||_0x3e2b7e[_0x3fb5b0][_0x422d0b][_0xded8('0x59')]||_0x3e2b7e[_0x3fb5b0][_0x422d0b][_0xded8('0x5a')])[_0xded8('0x5b')](moment(_0x3e2b7e[_0x3fb5b0][_0x422d0b][_0xded8('0x5c')]),_0xded8('0x57'))||0x0;_0x347293[_0xded8('0x15')][_0x319d9f][_0xded8('0x29')]+=0x1;if(_0x3e2b7e[_0x3fb5b0][_0x422d0b]['queuecallercomplete']){_0x347293[_0xded8('0x15')][_0x319d9f][_0xded8('0x2a')]+=0x1;_0x347293['voiceQueues'][_0x319d9f][_0xded8('0x31')]+=moment(_0x3e2b7e[_0x3fb5b0][_0x422d0b][_0xded8('0x58')])[_0xded8('0x5b')](moment(_0x3e2b7e[_0x3fb5b0][_0x422d0b]['queuecallerleaveAt']),_0xded8('0x57'))||0x0;}}else{_0x347293['voiceQueues'][_0x319d9f][_0xded8('0x2c')]+=_0x347293[_0xded8('0x15')][_0x319d9f][_0xded8('0x2b')]||0x0;}}}}}}return _0x347293[_0xded8('0x15')];};};Realtime[_0xded8('0x3c')][_0xded8('0x5d')]=function(){var _0x2c4b54=this;return function(_0x3bf517){clearVoiceCallReports(_0x2c4b54[_0xded8('0x16')]);if(_0x3bf517){for(var _0x56eae9=0x0;_0x56eae9<_0x3bf517[_0xded8('0x3e')];_0x56eae9+=0x1){_0x2c4b54[_0xded8('0x16')][_0xded8('0x29')]+=0x1;_0x2c4b54[_0xded8('0x16')][_0xded8('0x2c')]+=_0x3bf517[_0x56eae9][_0xded8('0x5e')];if(_0x3bf517[_0x56eae9][_0xded8('0x5f')]===_0xded8('0x60')){_0x2c4b54[_0xded8('0x16')]['answered']+=0x1;_0x2c4b54[_0xded8('0x16')][_0xded8('0x2b')]+=_0x3bf517[_0x56eae9]['duration']-_0x3bf517[_0x56eae9]['billableseconds']||0x0;_0x2c4b54[_0xded8('0x16')][_0xded8('0x31')]+=_0x3bf517[_0x56eae9][_0xded8('0x61')];}}}return _0x2c4b54[_0xded8('0x16')];};};Realtime[_0xded8('0x3c')]['initCampaigns']=function(){var _0x3ccf16=this;return function(_0x4cea64){if(_0x4cea64){freeIsNotKey(_0x4cea64,_0x3ccf16[_0xded8('0x62')],_0xded8('0x26'));for(var _0x184db3=0x0,_0x37c5c1={};_0x184db3<_0x4cea64[_0xded8('0x3e')];_0x184db3+=0x1){_0x37c5c1=_0x4cea64[_0x184db3];if(_['isUndefined'](_0x3ccf16[_0xded8('0x62')][_0x37c5c1[_0xded8('0x26')]])){_0x3ccf16[_0xded8('0x62')][_0x37c5c1[_0xded8('0x26')]]=new Campaign(_0x37c5c1);}else{_0x3ccf16[_0xded8('0x3b')](_0x3ccf16[_0xded8('0x62')][_0x37c5c1['name']],_0x37c5c1);_0x3ccf16['campaigns'][_0x37c5c1[_0xded8('0x26')]][_0xded8('0x63')]=_0x37c5c1['SquareProject']?_0x37c5c1[_0xded8('0x64')][_0xded8('0x26')]:undefined;}}}return _0x3ccf16[_0xded8('0x62')];};};Realtime[_0xded8('0x3c')][_0xded8('0x65')]=function(){var _0x26b07f=this;return function(_0x4ad78a){if(_0x4ad78a){freeIsNotKey(_0x4ad78a,_0x26b07f[_0xded8('0x17')],'id');for(var _0xecc2ef=0x0,_0x19b2d1={};_0xecc2ef<_0x4ad78a[_0xded8('0x3e')];_0xecc2ef+=0x1){_0x19b2d1=_0x4ad78a[_0xecc2ef];if(_['isUndefined'](_0x26b07f[_0xded8('0x17')][_0x19b2d1['id']])){_0x26b07f[_0xded8('0x17')][_0x19b2d1['id']]=new VoiceExtension(_0x19b2d1);}else{_0x26b07f[_0xded8('0x3b')](_0x26b07f[_0xded8('0x17')][_0x19b2d1['id']],_0x19b2d1);}}}return _0x26b07f['voiceExtensions'];};};Realtime[_0xded8('0x3c')][_0xded8('0x66')]=function(){var _0x52b2aa=this;return function(_0x4262fa){clearCampaigns(_0x52b2aa['campaigns']);for(var _0x5bc920=0x0;_0x5bc920<_0x4262fa['length'];_0x5bc920+=0x1){_[_0xded8('0x50')](_0x52b2aa[_0xded8('0x62')][_0x4262fa[_0x5bc920]['name']],_0x4262fa[_0x5bc920]);}return _0x52b2aa['campaigns'];};};Realtime[_0xded8('0x3c')][_0xded8('0x67')]=function(){var _0x551487=this;return function(_0x5d4ce8){if(_0x5d4ce8){freeIsNotKey(_0x5d4ce8,_0x551487['faxAccounts'],'id');for(var _0x128e93=0x0,_0x2e9b2b={},_0x2b931d={};_0x128e93<_0x5d4ce8[_0xded8('0x3e')];_0x128e93+=0x1){_0x2e9b2b=_0x5d4ce8[_0x128e93];if(_[_0xded8('0x3f')](_0x551487['faxAccounts'][_0x2e9b2b['id']])){_0x551487[_0xded8('0x21')][_0x2e9b2b['id']]=new FaxAccount(_0x2e9b2b);}else{_0x551487[_0xded8('0x3b')](_0x551487[_0xded8('0x21')][_0x2e9b2b['id']],_0x2e9b2b);}}}return _0x551487[_0xded8('0x21')];};};module[_0xded8('0x68')]=Realtime; \ No newline at end of file +var _0x20fb=['initAgents','agents','length','isUndefined','initTelephones','initVoiceQueues','initTemplates','initZendeskAccounts','zendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts','deskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','merge','groupBy','queuecallerabandon','abandoned','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallercomplete','initVoiceCallReports','duration','disposition','billableseconds','dialQueueProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','faxAccounts','bluebird','util','../model/agent','../model/trunk','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','telephones','trunks','voiceQueues','triggers','campaigns','templates','outbound','channels','queueChannels','timers','settings','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','mapKeys','format','SIP/%s','name','isNil','interface','hasOwnProperty','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','queueStatusComplete','prototype','mergeFromDatabase'];(function(_0x4c0eb2,_0x19fac7){var _0x36a1df=function(_0x3dc5d6){while(--_0x3dc5d6){_0x4c0eb2['push'](_0x4c0eb2['shift']());}};_0x36a1df(++_0x19fac7);}(_0x20fb,0xf7));var _0xb20f=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0x20fb[_0x1b7368];return _0x25d54c;};'use strict';var BPromise=require(_0xb20f('0x0'));var util=require(_0xb20f('0x1'));var _=require('lodash');var moment=require('moment');var Agent=require(_0xb20f('0x2'));var Telephone=require('../model/telephone');var Trunk=require(_0xb20f('0x3'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0xb20f('0x4'));var Template=require(_0xb20f('0x5'));var Campaign=require(_0xb20f('0x6'));var VoiceExtension=require(_0xb20f('0x7'));var ZendeskAccount=require(_0xb20f('0x8'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0xb20f('0x9'));var SugarcrmAccount=require(_0xb20f('0xa'));var ZohoAccount=require(_0xb20f('0xb'));var DeskAccount=require(_0xb20f('0xc'));var VtigerAccount=require(_0xb20f('0xd'));var ServicenowAccount=require(_0xb20f('0xe'));var Dynamics365Account=require(_0xb20f('0xf'));var FreshsalesAccount=require(_0xb20f('0x10'));var FaxAccount=require(_0xb20f('0x11'));var Realtime=function(){this['agents']={};this[_0xb20f('0x12')]={};this[_0xb20f('0x13')]={};this[_0xb20f('0x14')]={};this[_0xb20f('0x15')]={};this[_0xb20f('0x16')]={};this[_0xb20f('0x17')]={};this[_0xb20f('0x18')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0xb20f('0x19')]={};this[_0xb20f('0x1a')]={};this['outboundChannels']={};this[_0xb20f('0x1b')]={};this[_0xb20f('0x1c')]={};this['zendeskAccounts']={};this[_0xb20f('0x1d')]={};this[_0xb20f('0x1e')]={};this[_0xb20f('0x1f')]={};this['zohoAccounts']={};this['deskAccounts']={};this[_0xb20f('0x20')]={};this[_0xb20f('0x21')]={};this[_0xb20f('0x22')]={};this[_0xb20f('0x23')]={};this['faxAccounts']={};};function freeIsNotKey(_0x4b9b02,_0x4e932e,_0x160cd7){var _0x212173=_[_0xb20f('0x24')](_0x4b9b02,function(_0x4db3e1,_0x4ccd62){return _0x4db3e1[_0x160cd7];});for(var _0x5ceaae in _0x4e932e){if(_0x4e932e['hasOwnProperty'](_0x5ceaae)){if(!_0x212173[_0x5ceaae]){delete _0x4e932e[_0x5ceaae];}}}}function freeIsNotKeySip(_0x2bd037,_0x4cca83){var _0x3ed609=_['mapKeys'](_0x2bd037,function(_0x59310d,_0x4e482a){return util[_0xb20f('0x25')](_0xb20f('0x26'),_0x59310d[_0xb20f('0x27')]);});for(var _0x49d20d in _0x4cca83){if(_0x4cca83['hasOwnProperty'](_0x49d20d)){if(!_0x3ed609[_0x49d20d]){delete _0x4cca83[_0x49d20d];}}}}function freeIsNotKeyAgent(_0x3e0474,_0x4dd35c){var _0x274fce=_['mapKeys'](_0x3e0474,function(_0x115e1b,_0x137d4d){var _0x8d92b0=_[_0xb20f('0x28')](_0x115e1b['interface'])?util[_0xb20f('0x25')](_0xb20f('0x26'),_0x115e1b[_0xb20f('0x27')]):_0x115e1b[_0xb20f('0x29')];return _0x8d92b0;});for(var _0x5bb505 in _0x4dd35c){if(_0x4dd35c[_0xb20f('0x2a')](_0x5bb505)){if(!_0x274fce[_0x5bb505]){delete _0x4dd35c[_0x5bb505];}}}}function clearVoiceCallReports(_0x288839){_0x288839[_0xb20f('0x2b')]=0x0;_0x288839[_0xb20f('0x2c')]=0x0;_0x288839[_0xb20f('0x2d')]=0x0;_0x288839[_0xb20f('0x2e')]=0x0;_0x288839[_0xb20f('0x2f')]=0x0;}function clearCampaigns(_0x2ccc26){if(!_[_0xb20f('0x30')](_0x2ccc26)){for(var _0x5cb777 in _0x2ccc26){if(_0x2ccc26[_0xb20f('0x2a')](_0x5cb777)){_0x2ccc26[_0x5cb777][_0xb20f('0x31')]=0x0;_0x2ccc26[_0x5cb777][_0xb20f('0x32')]=0x0;}}}}function clearVoiceQueues(_0x3c134f){if(!_[_0xb20f('0x30')](_0x3c134f)){for(var _0x335b23 in _0x3c134f){if(_0x3c134f['hasOwnProperty'](_0x335b23)){_0x3c134f[_0x335b23][_0xb20f('0x2b')]=0x0;_0x3c134f[_0x335b23][_0xb20f('0x2c')]=0x0;_0x3c134f[_0x335b23][_0xb20f('0x33')]=0x0;_0x3c134f[_0x335b23]['abandoned']=0x0;_0x3c134f[_0x335b23][_0xb20f('0x2d')]=0x0;_0x3c134f[_0x335b23]['sumDuration']=0x0;_0x3c134f[_0x335b23]['sumBillable']=0x0;_0x3c134f[_0x335b23][_0xb20f('0x34')]=0x0;_0x3c134f[_0x335b23][_0xb20f('0x35')]=0x0;_0x3c134f[_0x335b23][_0xb20f('0x36')]=0x0;_0x3c134f[_0x335b23]['outboundCongestionCallsDay']=0x0;_0x3c134f[_0x335b23][_0xb20f('0x37')]=0x0;_0x3c134f[_0x335b23][_0xb20f('0x38')]=0x0;_0x3c134f[_0x335b23][_0xb20f('0x39')]=0x0;_0x3c134f[_0x335b23][_0xb20f('0x3a')]=0x0;_0x3c134f[_0x335b23][_0xb20f('0x3b')]=0x0;_0x3c134f[_0x335b23][_0xb20f('0x3c')]=0x0;_0x3c134f[_0x335b23][_0xb20f('0x3d')]=0x0;_0x3c134f[_0x335b23]['outboundReCallsDay']=0x0;_0x3c134f[_0x335b23][_0xb20f('0x34')]=0x0;_0x3c134f[_0x335b23]['outboundAnswerCallsDay']=0x0;_0x3c134f[_0x335b23][_0xb20f('0x3e')]=!![];}}}}Realtime[_0xb20f('0x3f')][_0xb20f('0x40')]=function(_0x4351a2,_0x561ea7){for(var _0x430e0b in _0x561ea7){if(_0x4351a2[_0xb20f('0x2a')](_0x430e0b)){_0x4351a2[_0x430e0b]=_0x561ea7[_0x430e0b];}}};Realtime[_0xb20f('0x3f')][_0xb20f('0x41')]=function(){var _0x514168=this;return function(_0xcc7ce9){if(_0xcc7ce9){freeIsNotKeyAgent(_0xcc7ce9,_0x514168[_0xb20f('0x42')]);for(var _0x417e05=0x0,_0xbcd1ab={},_0x73b66e={};_0x417e05<_0xcc7ce9[_0xb20f('0x43')];_0x417e05+=0x1){_0xbcd1ab=_0xcc7ce9[_0x417e05];var _0x2ce512=_[_0xb20f('0x28')](_0xbcd1ab[_0xb20f('0x29')])?util[_0xb20f('0x25')](_0xb20f('0x26'),_0xbcd1ab[_0xb20f('0x27')]):_0xbcd1ab[_0xb20f('0x29')];if(_[_0xb20f('0x44')](_0x514168[_0xb20f('0x42')][_0x2ce512])){_0x514168[_0xb20f('0x42')][_0x2ce512]=new Agent(_0xbcd1ab);}else{_0x514168[_0xb20f('0x40')](_0x514168[_0xb20f('0x42')][_0x2ce512],_0xbcd1ab);}}}return _0x514168[_0xb20f('0x42')];};};Realtime[_0xb20f('0x3f')][_0xb20f('0x45')]=function(){var _0x5d8666=this;return function(_0x3e7932){if(_0x3e7932){freeIsNotKeySip(_0x3e7932,_0x5d8666[_0xb20f('0x12')]);for(var _0x5ce085=0x0,_0x8103a1={},_0x391407={};_0x5ce085<_0x3e7932[_0xb20f('0x43')];_0x5ce085+=0x1){_0x8103a1=_0x3e7932[_0x5ce085];if(_['isUndefined'](_0x5d8666[_0xb20f('0x12')][util[_0xb20f('0x25')](_0xb20f('0x26'),_0x8103a1[_0xb20f('0x27')])])){_0x5d8666[_0xb20f('0x12')][util[_0xb20f('0x25')]('SIP/%s',_0x8103a1[_0xb20f('0x27')])]=new Telephone(_0x8103a1);}else{_0x5d8666[_0xb20f('0x40')](_0x5d8666[_0xb20f('0x12')][util['format'](_0xb20f('0x26'),_0x8103a1[_0xb20f('0x27')])],_0x8103a1);}}}return _0x5d8666[_0xb20f('0x12')];};};Realtime[_0xb20f('0x3f')]['initTrunks']=function(){var _0x1f347b=this;return function(_0x56448a){if(_0x56448a){freeIsNotKeySip(_0x56448a,_0x1f347b[_0xb20f('0x13')]);for(var _0x1a319b=0x0,_0x16edec={},_0x4f7d02={};_0x1a319b<_0x56448a['length'];_0x1a319b+=0x1){_0x16edec=_0x56448a[_0x1a319b];if(_[_0xb20f('0x44')](_0x1f347b[_0xb20f('0x13')][util[_0xb20f('0x25')](_0xb20f('0x26'),_0x16edec[_0xb20f('0x27')])])){_0x1f347b['trunks'][util[_0xb20f('0x25')](_0xb20f('0x26'),_0x16edec[_0xb20f('0x27')])]=new Trunk(_0x16edec);}else{_0x1f347b['mergeFromDatabase'](_0x1f347b[_0xb20f('0x13')][util[_0xb20f('0x25')]('SIP/%s',_0x16edec[_0xb20f('0x27')])],_0x16edec);}}}return _0x1f347b[_0xb20f('0x13')];};};Realtime['prototype'][_0xb20f('0x46')]=function(){var _0x573237=this;return function(_0x4cac1d){if(_0x4cac1d){freeIsNotKey(_0x4cac1d,_0x573237['voiceQueues'],'name');for(var _0x133a4d=0x0,_0x44cd75={},_0x44eaef={};_0x133a4d<_0x4cac1d['length'];_0x133a4d+=0x1){_0x44cd75=_0x4cac1d[_0x133a4d];if(_[_0xb20f('0x44')](_0x573237['voiceQueues'][_0x44cd75['name']])){_0x573237['voiceQueues'][_0x44cd75['name']]=new VoiceQueue(_0x44cd75);}else{_0x573237[_0xb20f('0x40')](_0x573237[_0xb20f('0x14')][_0x44cd75[_0xb20f('0x27')]],_0x44cd75);}}}return _0x573237[_0xb20f('0x14')];};};Realtime[_0xb20f('0x3f')]['initTriggers']=function(){var _0x57c55d=this;return function(_0x137f20){if(_0x137f20){freeIsNotKey(_0x137f20,_0x57c55d[_0xb20f('0x15')],'id');for(var _0x18b7ac=0x0,_0x2ddfa6={},_0x1367d3={};_0x18b7ac<_0x137f20[_0xb20f('0x43')];_0x18b7ac+=0x1){_0x2ddfa6=_0x137f20[_0x18b7ac];if(_[_0xb20f('0x44')](_0x57c55d[_0xb20f('0x15')][_0x2ddfa6['id']])){_0x57c55d['triggers'][_0x2ddfa6['id']]=new Trigger(_0x2ddfa6);}else{_0x57c55d[_0xb20f('0x40')](_0x57c55d[_0xb20f('0x15')][_0x2ddfa6['id']],_0x2ddfa6);}}}return _0x57c55d[_0xb20f('0x15')];};};Realtime[_0xb20f('0x3f')][_0xb20f('0x47')]=function(){var _0x1ece26=this;return function(_0x36eb16){if(_0x36eb16){freeIsNotKey(_0x36eb16,_0x1ece26[_0xb20f('0x17')],'id');for(var _0x5b3ed9=0x0,_0x538585={},_0x78aee8={};_0x5b3ed9<_0x36eb16[_0xb20f('0x43')];_0x5b3ed9+=0x1){_0x538585=_0x36eb16[_0x5b3ed9];if(_[_0xb20f('0x44')](_0x1ece26[_0xb20f('0x17')][_0x538585['id']])){_0x1ece26['templates'][_0x538585['id']]=new Template(_0x538585);}else{_0x1ece26[_0xb20f('0x40')](_0x1ece26[_0xb20f('0x17')][_0x538585['id']],_0x538585);}}}return _0x1ece26[_0xb20f('0x17')];};};Realtime[_0xb20f('0x3f')][_0xb20f('0x48')]=function(){var _0x34f64f=this;return function(_0x1b8c70){if(_0x1b8c70){freeIsNotKey(_0x1b8c70,_0x34f64f['zendeskAccounts'],'id');for(var _0x5e744f=0x0,_0xec466a={},_0x3816e0={};_0x5e744f<_0x1b8c70['length'];_0x5e744f+=0x1){_0xec466a=_0x1b8c70[_0x5e744f];if(_[_0xb20f('0x44')](_0x34f64f[_0xb20f('0x49')][_0xec466a['id']])){_0x34f64f[_0xb20f('0x49')][_0xec466a['id']]=new ZendeskAccount(_0xec466a);}else{_0x34f64f[_0xb20f('0x40')](_0x34f64f['zendeskAccounts'][_0xec466a['id']],_0xec466a);}}}return _0x34f64f['zendeskAccounts'];};};Realtime[_0xb20f('0x3f')][_0xb20f('0x4a')]=function(){var _0x56bd93=this;return function(_0x40bfd){if(_0x40bfd){freeIsNotKey(_0x40bfd,_0x56bd93[_0xb20f('0x1d')],'id');for(var _0x580333=0x0,_0x21e196={},_0x49b8b1={};_0x580333<_0x40bfd['length'];_0x580333+=0x1){_0x21e196=_0x40bfd[_0x580333];if(_['isUndefined'](_0x56bd93[_0xb20f('0x1d')][_0x21e196['id']])){_0x56bd93[_0xb20f('0x1d')][_0x21e196['id']]=new SalesforceAccount(_0x21e196);}else{_0x56bd93[_0xb20f('0x40')](_0x56bd93[_0xb20f('0x1d')][_0x21e196['id']],_0x21e196);}}}return _0x56bd93[_0xb20f('0x1d')];};};Realtime[_0xb20f('0x3f')][_0xb20f('0x4b')]=function(){var _0x189cd9=this;return function(_0x345b82){if(_0x345b82){freeIsNotKey(_0x345b82,_0x189cd9[_0xb20f('0x1f')],'id');for(var _0x55fae6=0x0,_0x20c8a7={},_0x24a7e7={};_0x55fae6<_0x345b82[_0xb20f('0x43')];_0x55fae6+=0x1){_0x20c8a7=_0x345b82[_0x55fae6];if(_['isUndefined'](_0x189cd9['freshdeskAccounts'][_0x20c8a7['id']])){_0x189cd9[_0xb20f('0x1f')][_0x20c8a7['id']]=new FreshdeskAccount(_0x20c8a7);}else{_0x189cd9['mergeFromDatabase'](_0x189cd9[_0xb20f('0x1f')][_0x20c8a7['id']],_0x20c8a7);}}}return _0x189cd9['freshdeskAccounts'];};};Realtime[_0xb20f('0x3f')][_0xb20f('0x4c')]=function(){var _0x1389cf=this;return function(_0x1c03a4){if(_0x1c03a4){freeIsNotKey(_0x1c03a4,_0x1389cf[_0xb20f('0x4d')],'id');for(var _0x283102=0x0,_0x356d6c={},_0x537bdd={};_0x283102<_0x1c03a4[_0xb20f('0x43')];_0x283102+=0x1){_0x356d6c=_0x1c03a4[_0x283102];if(_[_0xb20f('0x44')](_0x1389cf[_0xb20f('0x4d')][_0x356d6c['id']])){_0x1389cf[_0xb20f('0x4d')][_0x356d6c['id']]=new ZohoAccount(_0x356d6c);}else{_0x1389cf[_0xb20f('0x40')](_0x1389cf[_0xb20f('0x4d')][_0x356d6c['id']],_0x356d6c);}}}return _0x1389cf[_0xb20f('0x4d')];};};Realtime[_0xb20f('0x3f')][_0xb20f('0x4e')]=function(){var _0x2baf64=this;return function(_0x2228ac){if(_0x2228ac){freeIsNotKey(_0x2228ac,_0x2baf64[_0xb20f('0x4f')],'id');for(var _0x26cfad=0x0,_0x23e0c6={},_0x2b1a50={};_0x26cfad<_0x2228ac[_0xb20f('0x43')];_0x26cfad+=0x1){_0x23e0c6=_0x2228ac[_0x26cfad];if(_[_0xb20f('0x44')](_0x2baf64['deskAccounts'][_0x23e0c6['id']])){_0x2baf64[_0xb20f('0x4f')][_0x23e0c6['id']]=new DeskAccount(_0x23e0c6);}else{_0x2baf64[_0xb20f('0x40')](_0x2baf64[_0xb20f('0x4f')][_0x23e0c6['id']],_0x23e0c6);}}}return _0x2baf64[_0xb20f('0x4f')];};};Realtime[_0xb20f('0x3f')][_0xb20f('0x50')]=function(){var _0x2f9579=this;return function(_0x3047f0){if(_0x3047f0){freeIsNotKey(_0x3047f0,_0x2f9579[_0xb20f('0x1e')],'id');for(var _0x51b332=0x0,_0xaace04={},_0x5e87c4={};_0x51b332<_0x3047f0[_0xb20f('0x43')];_0x51b332+=0x1){_0xaace04=_0x3047f0[_0x51b332];if(_['isUndefined'](_0x2f9579[_0xb20f('0x1e')][_0xaace04['id']])){_0x2f9579[_0xb20f('0x1e')][_0xaace04['id']]=new SugarcrmAccount(_0xaace04);}else{_0x2f9579[_0xb20f('0x40')](_0x2f9579[_0xb20f('0x1e')][_0xaace04['id']],_0xaace04);}}}return _0x2f9579['sugarcrmAccounts'];};};Realtime['prototype'][_0xb20f('0x51')]=function(){var _0x5dc691=this;return function(_0x4af8f0){if(_0x4af8f0){freeIsNotKey(_0x4af8f0,_0x5dc691[_0xb20f('0x20')],'id');for(var _0x4f5f0c=0x0,_0x196f22={},_0x536f8b={};_0x4f5f0c<_0x4af8f0[_0xb20f('0x43')];_0x4f5f0c+=0x1){_0x196f22=_0x4af8f0[_0x4f5f0c];if(_[_0xb20f('0x44')](_0x5dc691['vtigerAccounts'][_0x196f22['id']])){_0x5dc691[_0xb20f('0x20')][_0x196f22['id']]=new VtigerAccount(_0x196f22);}else{_0x5dc691[_0xb20f('0x40')](_0x5dc691[_0xb20f('0x20')][_0x196f22['id']],_0x196f22);}}}return _0x5dc691['vtigerAccounts'];};};Realtime[_0xb20f('0x3f')][_0xb20f('0x52')]=function(){var _0xefadda=this;return function(_0xf725e0){if(_0xf725e0){freeIsNotKey(_0xf725e0,_0xefadda[_0xb20f('0x21')],'id');for(var _0x2b10e0=0x0,_0x5ae7d7={},_0x59a07a={};_0x2b10e0<_0xf725e0[_0xb20f('0x43')];_0x2b10e0+=0x1){_0x5ae7d7=_0xf725e0[_0x2b10e0];if(_[_0xb20f('0x44')](_0xefadda[_0xb20f('0x21')][_0x5ae7d7['id']])){_0xefadda[_0xb20f('0x21')][_0x5ae7d7['id']]=new ServicenowAccount(_0x5ae7d7);}else{_0xefadda['mergeFromDatabase'](_0xefadda[_0xb20f('0x21')][_0x5ae7d7['id']],_0x5ae7d7);}}}return _0xefadda[_0xb20f('0x21')];};};Realtime[_0xb20f('0x3f')][_0xb20f('0x53')]=function(){var _0x3c873a=this;return function(_0x16711b){if(_0x16711b){freeIsNotKey(_0x16711b,_0x3c873a['dynamics365Accounts'],'id');for(var _0x10c5ee=0x0,_0x510a45={},_0x2b0809={};_0x10c5ee<_0x16711b['length'];_0x10c5ee+=0x1){_0x510a45=_0x16711b[_0x10c5ee];if(_['isUndefined'](_0x3c873a[_0xb20f('0x22')][_0x510a45['id']])){_0x3c873a['dynamics365Accounts'][_0x510a45['id']]=new Dynamics365Account(_0x510a45);}else{_0x3c873a['mergeFromDatabase'](_0x3c873a['dynamics365Accounts'][_0x510a45['id']],_0x510a45);}}}return _0x3c873a[_0xb20f('0x22')];};};Realtime['prototype'][_0xb20f('0x54')]=function(){var _0x53bf45=this;return function(_0x270e3c){if(_0x270e3c){freeIsNotKey(_0x270e3c,_0x53bf45[_0xb20f('0x23')],'id');for(var _0xdd8de7=0x0,_0x2aaa76={},_0x1fd21a={};_0xdd8de7<_0x270e3c['length'];_0xdd8de7+=0x1){_0x2aaa76=_0x270e3c[_0xdd8de7];if(_[_0xb20f('0x44')](_0x53bf45[_0xb20f('0x23')][_0x2aaa76['id']])){_0x53bf45[_0xb20f('0x23')][_0x2aaa76['id']]=new FreshsalesAccount(_0x2aaa76);}else{_0x53bf45[_0xb20f('0x40')](_0x53bf45['freshsalesAccounts'][_0x2aaa76['id']],_0x2aaa76);}}}return _0x53bf45[_0xb20f('0x23')];};};Realtime['prototype']['initVoiceQueueHopperHistory']=function(){var _0x665f8a=this;return function(_0x442dc3){for(var _0x53f711=0x0;_0x53f711<_0x442dc3[_0xb20f('0x43')];_0x53f711+=0x1){_[_0xb20f('0x55')](_0x665f8a[_0xb20f('0x14')][_0x442dc3[_0x53f711][_0xb20f('0x27')]],_0x442dc3[_0x53f711]);}return _0x665f8a['voiceQueues'];};};Realtime['prototype']['initVoiceQueueReports']=function(){var _0x59b6b4=this;return function(_0xf2aa22){clearVoiceQueues(_0x59b6b4[_0xb20f('0x14')]);if(_0xf2aa22){_0xf2aa22=_[_0xb20f('0x56')](_0xf2aa22,'uniqueid');for(var _0x2820ff in _0xf2aa22){if(_0xf2aa22[_0xb20f('0x2a')](_0x2820ff)){var _0x45baf9={};for(var _0x4a800e=0x0;_0x4a800e<_0xf2aa22[_0x2820ff][_0xb20f('0x43')];_0x4a800e+=0x1){var _0xcae45=_0xf2aa22[_0x2820ff][_0x4a800e]['queue'];if(_0x59b6b4[_0xb20f('0x14')][_0xcae45]){if(_0xf2aa22[_0x2820ff][_0x4a800e]['queuecallerexit']){_0x59b6b4['voiceQueues'][_0xcae45][_0xb20f('0x33')]+=0x1;}if(_0xf2aa22[_0x2820ff][_0x4a800e][_0xb20f('0x57')]){_0x59b6b4[_0xb20f('0x14')][_0xcae45][_0xb20f('0x58')]+=0x1;}_0x59b6b4[_0xb20f('0x14')][_0xcae45][_0xb20f('0x2d')]+=moment(_0xf2aa22[_0x2820ff][_0x4a800e][_0xb20f('0x59')])[_0xb20f('0x5a')](moment(_0xf2aa22[_0x2820ff][_0x4a800e][_0xb20f('0x5b')]),_0xb20f('0x5c'))||0x0;if(_0x4a800e===_0xf2aa22[_0x2820ff]['length']-0x1){_0x59b6b4[_0xb20f('0x14')][_0xcae45][_0xb20f('0x2e')]+=moment(_0xf2aa22[_0x2820ff][_0x4a800e][_0xb20f('0x5d')]||_0xf2aa22[_0x2820ff][_0x4a800e]['queuecallerabandonAt']||_0xf2aa22[_0x2820ff][_0x4a800e]['queuecallerexitAt'])[_0xb20f('0x5a')](moment(_0xf2aa22[_0x2820ff][_0x4a800e][_0xb20f('0x5b')]),_0xb20f('0x5c'))||0x0;_0x59b6b4[_0xb20f('0x14')][_0xcae45][_0xb20f('0x2b')]+=0x1;if(_0xf2aa22[_0x2820ff][_0x4a800e][_0xb20f('0x5e')]){_0x59b6b4[_0xb20f('0x14')][_0xcae45]['answered']+=0x1;_0x59b6b4[_0xb20f('0x14')][_0xcae45]['sumBillable']+=moment(_0xf2aa22[_0x2820ff][_0x4a800e][_0xb20f('0x5d')])['diff'](moment(_0xf2aa22[_0x2820ff][_0x4a800e][_0xb20f('0x59')]),_0xb20f('0x5c'))||0x0;}}else{_0x59b6b4['voiceQueues'][_0xcae45][_0xb20f('0x2e')]+=_0x59b6b4[_0xb20f('0x14')][_0xcae45][_0xb20f('0x2d')]||0x0;}}}}}}return _0x59b6b4[_0xb20f('0x14')];};};Realtime[_0xb20f('0x3f')][_0xb20f('0x5f')]=function(){var _0x136f51=this;return function(_0x95fcf5){clearVoiceCallReports(_0x136f51[_0xb20f('0x18')]);if(_0x95fcf5){for(var _0x178268=0x0;_0x178268<_0x95fcf5['length'];_0x178268+=0x1){_0x136f51[_0xb20f('0x18')][_0xb20f('0x2b')]+=0x1;_0x136f51[_0xb20f('0x18')][_0xb20f('0x2e')]+=_0x95fcf5[_0x178268][_0xb20f('0x60')];if(_0x95fcf5[_0x178268][_0xb20f('0x61')]==='ANSWERED'){_0x136f51[_0xb20f('0x18')][_0xb20f('0x2c')]+=0x1;_0x136f51[_0xb20f('0x18')][_0xb20f('0x2d')]+=_0x95fcf5[_0x178268][_0xb20f('0x60')]-_0x95fcf5[_0x178268][_0xb20f('0x62')]||0x0;_0x136f51[_0xb20f('0x18')][_0xb20f('0x2f')]+=_0x95fcf5[_0x178268][_0xb20f('0x62')];}}}return _0x136f51['outbound'];};};Realtime[_0xb20f('0x3f')]['initCampaigns']=function(){var _0x4100be=this;return function(_0x433765){if(_0x433765){freeIsNotKey(_0x433765,_0x4100be[_0xb20f('0x16')],_0xb20f('0x27'));for(var _0x16e122=0x0,_0xe5c2fd={};_0x16e122<_0x433765['length'];_0x16e122+=0x1){_0xe5c2fd=_0x433765[_0x16e122];if(_[_0xb20f('0x44')](_0x4100be[_0xb20f('0x16')][_0xe5c2fd[_0xb20f('0x27')]])){_0x4100be[_0xb20f('0x16')][_0xe5c2fd[_0xb20f('0x27')]]=new Campaign(_0xe5c2fd);}else{_0x4100be[_0xb20f('0x40')](_0x4100be[_0xb20f('0x16')][_0xe5c2fd['name']],_0xe5c2fd);_0x4100be[_0xb20f('0x16')][_0xe5c2fd[_0xb20f('0x27')]][_0xb20f('0x63')]=_0xe5c2fd['SquareProject']?_0xe5c2fd['SquareProject'][_0xb20f('0x27')]:undefined;}}}return _0x4100be['campaigns'];};};Realtime[_0xb20f('0x3f')][_0xb20f('0x64')]=function(){var _0x2004eb=this;return function(_0x1ae3c2){if(_0x1ae3c2){freeIsNotKey(_0x1ae3c2,_0x2004eb[_0xb20f('0x65')],'id');for(var _0x5b9922=0x0,_0x56f845={};_0x5b9922<_0x1ae3c2[_0xb20f('0x43')];_0x5b9922+=0x1){_0x56f845=_0x1ae3c2[_0x5b9922];if(_['isUndefined'](_0x2004eb[_0xb20f('0x65')][_0x56f845['id']])){_0x2004eb['voiceExtensions'][_0x56f845['id']]=new VoiceExtension(_0x56f845);}else{_0x2004eb[_0xb20f('0x40')](_0x2004eb[_0xb20f('0x65')][_0x56f845['id']],_0x56f845);}}}return _0x2004eb[_0xb20f('0x65')];};};Realtime[_0xb20f('0x3f')][_0xb20f('0x66')]=function(){var _0x542589=this;return function(_0x38b3ae){clearCampaigns(_0x542589[_0xb20f('0x16')]);for(var _0x2d671d=0x0;_0x2d671d<_0x38b3ae[_0xb20f('0x43')];_0x2d671d+=0x1){_['merge'](_0x542589[_0xb20f('0x16')][_0x38b3ae[_0x2d671d][_0xb20f('0x27')]],_0x38b3ae[_0x2d671d]);}return _0x542589[_0xb20f('0x16')];};};Realtime[_0xb20f('0x3f')]['initFaxAccounts']=function(){var _0x437b5e=this;return function(_0x1d79ea){if(_0x1d79ea){freeIsNotKey(_0x1d79ea,_0x437b5e[_0xb20f('0x67')],'id');for(var _0x2239a1=0x0,_0x2524e1={},_0x11e44c={};_0x2239a1<_0x1d79ea[_0xb20f('0x43')];_0x2239a1+=0x1){_0x2524e1=_0x1d79ea[_0x2239a1];if(_['isUndefined'](_0x437b5e[_0xb20f('0x67')][_0x2524e1['id']])){_0x437b5e[_0xb20f('0x67')][_0x2524e1['id']]=new FaxAccount(_0x2524e1);}else{_0x437b5e[_0xb20f('0x40')](_0x437b5e['faxAccounts'][_0x2524e1['id']],_0x2524e1);}}}return _0x437b5e[_0xb20f('0x67')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 054ce64..c217287 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 _0x9aee=['voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','agents','accountcode','name','isNil','interface','format','SIP/%s','voiceQueueReport','length','connectedlinenum','assigned','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','getAgentByInternal','keys','getCallType','channel','split','calleridnum','outbound','internal','destination','type','dialer','lastapplication','queue','lastdata','context','callerid','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','UserId','membername','monitor','monitors','filename','createdAt','connectedlinename','exten','xcally-motion-dialer','isArray','forEach','startsWith','indexOf','mobile','phone','lastIndexOf','transfererlinkedid','exports','lodash','moment','util','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceAgentReport','./voiceDialReport','./userReport','telephones','prototype','sync','realtime','xdr','disabled','custom:voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport'];(function(_0x1d30a3,_0x5f428c){var _0x32bba1=function(_0x5a60cc){while(--_0x5a60cc){_0x1d30a3['push'](_0x1d30a3['shift']());}};_0x32bba1(++_0x5f428c);}(_0x9aee,0x1b7));var _0xe9ae=function(_0x3c86b4,_0x431782){_0x3c86b4=_0x3c86b4-0x0;var _0x268334=_0x9aee[_0x3c86b4];return _0x268334;};'use strict';var _=require(_0xe9ae('0x0'));var moment=require(_0xe9ae('0x1'));var util=require(_0xe9ae('0x2'));var config=require('../../../config/environment');var ami=require('../ami');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0xe9ae('0x3'));var RpcVoiceDialReport=require(_0xe9ae('0x4'));var RpcMemberReport=require(_0xe9ae('0x5'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0xe9ae('0x6'));var RpcVoiceTransferReport=require(_0xe9ae('0x7'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0xe9ae('0x8'));var VoiceDialReport=require(_0xe9ae('0x9'));var UserReport=require(_0xe9ae('0xa'));function Report(_0x6be6b9){this['realtime']=_0x6be6b9;this['agents']=_0x6be6b9['agents'];this[_0xe9ae('0xb')]=_0x6be6b9[_0xe9ae('0xb')];}Report[_0xe9ae('0xc')][_0xe9ae('0xd')]=function(_0x1b8ef5){var _0x4d9d43=new VoiceQueueReport(this[_0xe9ae('0xe')]);var _0x2cadf8=new VoiceAgentReport(this[_0xe9ae('0xe')]);var _0x651ee3=new VoiceDialReport(this[_0xe9ae('0xe')]);var _0x13bf0f=new VoiceCallReport(this['realtime']);var _0x40043f=new UserReport(this[_0xe9ae('0xe')]);if(config[_0xe9ae('0xf')]&&config[_0xe9ae('0xf')][_0xe9ae('0x10')]){ami['on'](_0xe9ae('0x11'),this['voiceQueueReport'][_0xe9ae('0x12')](this));ami['on'](_0xe9ae('0x13'),this[_0xe9ae('0x14')][_0xe9ae('0x12')](this));ami['on']('custom:voiceAgentReport',this[_0xe9ae('0x15')][_0xe9ae('0x12')](this));ami['on'](_0xe9ae('0x16'),this[_0xe9ae('0x17')][_0xe9ae('0x12')](this));ami['on']('blindtransfer',this[_0xe9ae('0x18')][_0xe9ae('0x12')](this));ami['on'](_0xe9ae('0x19'),this[_0xe9ae('0x1a')][_0xe9ae('0x12')](this));}};Report[_0xe9ae('0xc')][_0xe9ae('0x1b')]=function(_0x569cb9){var _0x1d7fde;_0x1d7fde=_[_0xe9ae('0x1c')](this[_0xe9ae('0x1d')],function(_0x2d508a){return _0x2d508a[_0xe9ae('0x1e')]==_0x569cb9||_0x2d508a[_0xe9ae('0x1f')]==_0x569cb9;});if(_[_0xe9ae('0x20')](_0x1d7fde)){var _0x38a5a7=_[_0xe9ae('0x1c')](this[_0xe9ae('0xb')],function(_0x51a3f8){return _0x51a3f8[_0xe9ae('0x1e')]==_0x569cb9||_0x51a3f8[_0xe9ae('0x1f')]==_0x569cb9;});if(_0x38a5a7){_0x1d7fde=_[_0xe9ae('0x1c')](this['agents'],function(_0x14237f){return _0x14237f[_0xe9ae('0x21')]==util[_0xe9ae('0x22')](_0xe9ae('0x23'),_0x38a5a7['name']);});}}return _0x1d7fde;};Report['prototype'][_0xe9ae('0x24')]=function(_0x7a063d){for(var _0x5dae95=0x0;_0x5dae95<_0x7a063d[_0xe9ae('0x25')];_0x5dae95+=0x1){var _0x51932b=this['findAgent'](_0x7a063d[_0x5dae95][_0xe9ae('0x26')]);if(_0x51932b){_0x7a063d[_0x5dae95][_0xe9ae('0x1e')]=_0x51932b[_0xe9ae('0x1e')];_0x7a063d[_0x5dae95][_0xe9ae('0x27')]=!![];_0x7a063d[_0x5dae95]['lastAssignedTo']=_0x51932b[_0xe9ae('0x1f')];_0x7a063d[_0x5dae95]['interface']=_['isNil'](_0x51932b[_0xe9ae('0x21')])?util['format'](_0xe9ae('0x23'),_0x51932b[_0xe9ae('0x1f')]):_0x51932b[_0xe9ae('0x21')];if(_0x7a063d[_0x5dae95]['queuecallercomplete']){_0x7a063d[_0x5dae95][_0xe9ae('0x28')]=moment()[_0xe9ae('0x22')](_0xe9ae('0x29'));}if(_0x7a063d[_0x5dae95][_0xe9ae('0x2a')]){_0x7a063d[_0x5dae95][_0xe9ae('0x2b')]=moment()[_0xe9ae('0x22')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0xe9ae('0x24')](_0x7a063d[_0x5dae95]);}RpcVoiceQueueReport[_0xe9ae('0x2c')](_0x7a063d[_0x5dae95]);}};function extractCalleridNumber(_0x3b3129){var _0x3c46da=_0x3b3129[_0xe9ae('0x2d')](/<(.*?)>/);return _0x3c46da?_0x3c46da[0x1]:_0x3b3129;}Report[_0xe9ae('0xc')][_0xe9ae('0x2e')]=function(_0x5981f7){for(var _0x41453a=0x0;_0x41453a','calleridname','transfers','linkedid','uniqueid','blindTransfer','type','UserId','membername','monitorFilename'];(function(_0x5305dc,_0x3a0acc){var _0x47b203=function(_0x53f023){while(--_0x53f023){_0x5305dc['push'](_0x5305dc['shift']());}};_0x47b203(++_0x3a0acc);}(_0x094c,0x16a));var _0xc094=function(_0x53e35e,_0x114a69){_0x53e35e=_0x53e35e-0x0;var _0xaaaa6a=_0x094c[_0x53e35e];return _0xaaaa6a;};'use strict';var _=require(_0xc094('0x0'));var moment=require(_0xc094('0x1'));var util=require('util');var config=require(_0xc094('0x2'));var ami=require(_0xc094('0x3'));var RpcVoiceAgentReport=require(_0xc094('0x4'));var RpcVoiceCallReport=require(_0xc094('0x5'));var RpcVoiceDialReport=require(_0xc094('0x6'));var RpcMemberReport=require(_0xc094('0x7'));var RpcVoiceQueueReport=require(_0xc094('0x8'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0xc094('0x9'));var VoiceQueueReport=require(_0xc094('0xa'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0xc094('0xb'));var UserReport=require(_0xc094('0xc'));function Report(_0x5e07ff){this[_0xc094('0xd')]=_0x5e07ff;this[_0xc094('0xe')]=_0x5e07ff[_0xc094('0xe')];this[_0xc094('0xf')]=_0x5e07ff[_0xc094('0xf')];}Report[_0xc094('0x10')]['sync']=function(_0x4725ef){var _0x25d26e=new VoiceQueueReport(this['realtime']);var _0x5234af=new VoiceAgentReport(this[_0xc094('0xd')]);var _0x430370=new VoiceDialReport(this[_0xc094('0xd')]);var _0x1d43ec=new VoiceCallReport(this[_0xc094('0xd')]);var _0x39b01b=new UserReport(this[_0xc094('0xd')]);if(config[_0xc094('0x11')]&&config[_0xc094('0x11')][_0xc094('0x12')]){ami['on']('custom:voiceQueueReport',this[_0xc094('0x13')][_0xc094('0x14')](this));ami['on']('custom:voiceCallReport',this[_0xc094('0x15')][_0xc094('0x14')](this));ami['on'](_0xc094('0x16'),this[_0xc094('0x17')][_0xc094('0x14')](this));ami['on']('custom:voiceDialReport',this[_0xc094('0x18')][_0xc094('0x14')](this));ami['on'](_0xc094('0x19'),this['blindTransfer'][_0xc094('0x14')](this));ami['on'](_0xc094('0x1a'),this[_0xc094('0x1b')][_0xc094('0x14')](this));}};Report[_0xc094('0x10')][_0xc094('0x1c')]=function(_0x5bde21){var _0x59880c;_0x59880c=_[_0xc094('0x1d')](this[_0xc094('0xe')],function(_0x5509ef){return _0x5509ef[_0xc094('0x1e')]==_0x5bde21||_0x5509ef[_0xc094('0x1f')]==_0x5bde21;});if(_[_0xc094('0x20')](_0x59880c)){var _0x4f345d=_[_0xc094('0x1d')](this[_0xc094('0xf')],function(_0x4b8dde){return _0x4b8dde[_0xc094('0x1e')]==_0x5bde21||_0x4b8dde[_0xc094('0x1f')]==_0x5bde21;});if(_0x4f345d){_0x59880c=_[_0xc094('0x1d')](this[_0xc094('0xe')],function(_0x3cfad1){return _0x3cfad1['interface']==util[_0xc094('0x21')](_0xc094('0x22'),_0x4f345d[_0xc094('0x1f')]);});}}return _0x59880c;};Report[_0xc094('0x10')][_0xc094('0x13')]=function(_0x101cec){for(var _0x4a4ff3=0x0;_0x4a4ff3<_0x101cec[_0xc094('0x23')];_0x4a4ff3+=0x1){var _0x25a141=this['findAgent'](_0x101cec[_0x4a4ff3]['connectedlinenum']);if(_0x25a141){_0x101cec[_0x4a4ff3][_0xc094('0x1e')]=_0x25a141[_0xc094('0x1e')];_0x101cec[_0x4a4ff3][_0xc094('0x24')]=!![];_0x101cec[_0x4a4ff3][_0xc094('0x25')]=_0x25a141[_0xc094('0x1f')];_0x101cec[_0x4a4ff3]['interface']=_[_0xc094('0x20')](_0x25a141[_0xc094('0x26')])?util[_0xc094('0x21')](_0xc094('0x22'),_0x25a141[_0xc094('0x1f')]):_0x25a141[_0xc094('0x26')];if(_0x101cec[_0x4a4ff3][_0xc094('0x27')]){_0x101cec[_0x4a4ff3]['queuecallercompleteAt']=moment()[_0xc094('0x21')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x101cec[_0x4a4ff3][_0xc094('0x28')]){_0x101cec[_0x4a4ff3]['queuecallerexitAt']=moment()[_0xc094('0x21')](_0xc094('0x29'));}RpcMemberReport[_0xc094('0x13')](_0x101cec[_0x4a4ff3]);}RpcVoiceQueueReport[_0xc094('0x2a')](_0x101cec[_0x4a4ff3]);}};function extractCalleridNumber(_0x41c83c){var _0x2d0112=_0x41c83c['match'](/<(.*?)>/);return _0x2d0112?_0x2d0112[0x1]:_0x41c83c;}Report[_0xc094('0x10')][_0xc094('0x2b')]=function(_0x811dfe){for(var _0x1865a3=0x0;_0x1865a30x0?_0x1eb486:0x0;this[_0x9bff('0x14')][_0x163e1a['queue']][_0x9bff('0x2f')]=this[_0x9bff('0x14')][_0x163e1a[_0x9bff('0x6a')]][_0x9bff('0x2f')]>_[_0x9bff('0x6e')](_0x163e1a[_0x9bff('0x70')])?_[_0x9bff('0x6e')](_0x163e1a[_0x9bff('0x70')]):this[_0x9bff('0x14')][_0x163e1a[_0x9bff('0x6a')]][_0x9bff('0x2f')];this[_0x9bff('0x51')](this[_0x9bff('0x14')][_0x163e1a[_0x9bff('0x6a')]],_0x9bff('0x66'));}logger[_0x9bff('0x48')](_0x9bff('0x71'),util['inspect'](this[_0x9bff('0x14')][_0x163e1a['queue']],{'showHidden':![],'depth':null}));ami[_0x9bff('0x43')](_0x9bff('0x72'),this['voiceQueues'][_0x163e1a['queue']]);}}}catch(_0x303940){logger[_0x9bff('0x38')](_0x9bff('0x68'),util[_0x9bff('0x3a')](_0x303940,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9bff('0xc')]['syncQueueSummaryComplete']=function(_0xd42157){logger[_0x9bff('0x48')](_0x9bff('0x73'),util[_0x9bff('0x3a')](_0xd42157,{'showHidden':![],'depth':null}));this[_0x9bff('0x65')]=!![];};VoiceQueueReport[_0x9bff('0xc')][_0x9bff('0x18')]=function(_0x15308e){try{if(this['isNotNull'](_0x15308e)){logger['debug']('[%s][voiceQueueReport][queuecallerjoin]',_0x15308e[_0x9bff('0x4a')],util[_0x9bff('0x3a')](_0x15308e,{'showHidden':![],'depth':null}));if(_[_0x9bff('0x61')](this['queueReports'][_0x15308e[_0x9bff('0x4a')]]))this[_0x9bff('0x11')][_0x15308e[_0x9bff('0x4a')]]=[];if(_[_0x9bff('0x61')](this['channels'][_0x15308e[_0x9bff('0x4a')]]))this[_0x9bff('0x13')][_0x15308e[_0x9bff('0x4a')]]={};var _0x17178a=new QueueReport();_0x17178a[_0x9bff('0x4e')]=_0x15308e[_0x9bff('0x6a')];_0x17178a['type']=this[_0x9bff('0x14')][_0x17178a[_0x9bff('0x4e')]]&&this['voiceQueues'][_0x17178a['name']][_0x9bff('0x74')]?this[_0x9bff('0x14')][_0x17178a['name']]['type']||'inbound':'inbound';_0x17178a['queue']=_0x15308e[_0x9bff('0x6a')];_0x17178a['queuecallerjoinAt']=moment()['format'](_0x9bff('0x75'));_0x17178a[_0x9bff('0x76')]=_0x15308e[_0x9bff('0x76')];_0x17178a[_0x9bff('0x77')]=_0x15308e[_0x9bff('0x77')];_0x17178a[_0x9bff('0x4a')]=_0x15308e[_0x9bff('0x4a')];_0x17178a[_0x9bff('0x78')]=this[_0x9bff('0x13')][_0x15308e[_0x9bff('0x4a')]][_0x9bff('0x78')];logger[_0x9bff('0x6b')](_0x9bff('0x79'),_0x17178a[_0x9bff('0x4e')],_0x17178a[_0x9bff('0x74')]);_[_0x9bff('0x7a')](_0x17178a,_[_0x9bff('0x7b')](_0x15308e,_['keys'](_0x17178a)));this[_0x9bff('0x11')][_0x15308e[_0x9bff('0x4a')]][_0x9bff('0x7c')](_0x17178a);this[_0x9bff('0x13')][_0x15308e[_0x9bff('0x4a')]]=_0x17178a;this[_0x9bff('0x7d')](_0x17178a,_0x9bff('0x17'));}}catch(_0x12b3cc){logger['error']('[%s][voiceQueueReport][queuecallerjoin]',_0x15308e['uniqueid'],util['inspect'](_0x12b3cc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9bff('0xc')][_0x9bff('0x1a')]=function(_0x48770f){try{if(this[_0x9bff('0x60')](_0x48770f)){logger[_0x9bff('0x48')](_0x9bff('0x7e'),_0x48770f[_0x9bff('0x4a')],util[_0x9bff('0x3a')](_0x48770f,{'showHidden':![],'depth':null}));if(this[_0x9bff('0x11')][_0x48770f[_0x9bff('0x4a')]]){var _0x13cb8a=_[_0x9bff('0x7f')](this['queueReports'][_0x48770f[_0x9bff('0x4a')]]);_0x13cb8a[_0x9bff('0x80')]=![];_0x13cb8a['queuecallercompleteAt']=null;_0x13cb8a['holdtime']=_0x48770f[_0x9bff('0x81')];_0x13cb8a[_0x9bff('0x82')]=_0x48770f[_0x9bff('0x82')];_0x13cb8a['queuecallerabandon']=!![];_0x13cb8a[_0x9bff('0x83')]=moment()['format'](_0x9bff('0x75'));_0x13cb8a[_0x9bff('0x84')]=_0x9bff('0x85');_0x13cb8a['lastAssignedTo']=null;logger[_0x9bff('0x6b')](_0x9bff('0x86'),_0x13cb8a[_0x9bff('0x4e')],_0x13cb8a[_0x9bff('0x74')]);this['channels'][_0x48770f[_0x9bff('0x4a')]]=_0x13cb8a;this[_0x9bff('0x41')](_0x13cb8a,'queuecallerabandon');}}}catch(_0x4a738f){logger[_0x9bff('0x38')](_0x9bff('0x7e'),_0x48770f[_0x9bff('0x4a')],util[_0x9bff('0x3a')](_0x4a738f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9bff('0xc')][_0x9bff('0x1c')]=function(_0x2754fe){try{if(this[_0x9bff('0x60')](_0x2754fe)){logger[_0x9bff('0x48')](_0x9bff('0x87'),_0x2754fe[_0x9bff('0x4a')],util[_0x9bff('0x3a')](_0x2754fe,{'showHidden':![],'depth':null}));if(this[_0x9bff('0x11')][_0x2754fe[_0x9bff('0x4a')]]){var _0x2611f1=_[_0x9bff('0x7f')](this['queueReports'][_0x2754fe[_0x9bff('0x4a')]]);_0x2611f1['queuecallerleaveAt']=moment()['format'](_0x9bff('0x75'));_0x2611f1['connectedlinenum']=_0x2754fe[_0x9bff('0x88')];_0x2611f1['connectedlinename']=_0x2754fe[_0x9bff('0x89')];logger[_0x9bff('0x6b')](_0x9bff('0x8a'),_0x2611f1[_0x9bff('0x4e')],_0x2611f1[_0x9bff('0x74')],_0x2754fe[_0x9bff('0x88')],_0x2754fe[_0x9bff('0x89')]);this['channels'][_0x2754fe['uniqueid']]=_0x2611f1;this[_0x9bff('0x7d')](_0x2611f1,_0x9bff('0x1b'));}}}catch(_0x30c2f4){logger['error'](_0x9bff('0x87'),_0x2754fe[_0x9bff('0x4a')],util[_0x9bff('0x3a')](_0x30c2f4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9bff('0xc')][_0x9bff('0x20')]=function(_0xd8cccf){try{if(this[_0x9bff('0x60')](_0xd8cccf)){logger[_0x9bff('0x48')](_0x9bff('0x8b'),_0xd8cccf[_0x9bff('0x4a')],util[_0x9bff('0x3a')](_0xd8cccf,{'showHidden':![],'depth':null}));if(this[_0x9bff('0x11')][_0xd8cccf[_0x9bff('0x4a')]]){var _0x4ebf20=_[_0x9bff('0x7f')](this[_0x9bff('0x11')][_0xd8cccf['uniqueid']]);_0x4ebf20[_0x9bff('0x80')]=!![];_0x4ebf20[_0x9bff('0x84')]='COMPLETEDBYAGENT';logger[_0x9bff('0x6b')](_0x9bff('0x8c'),_0x4ebf20[_0x9bff('0x4e')],_0x4ebf20[_0x9bff('0x74')]);}}}catch(_0x3f8678){logger[_0x9bff('0x38')](_0x9bff('0x8b'),_0xd8cccf[_0x9bff('0x4a')],util[_0x9bff('0x3a')](_0x3f8678,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9bff('0xc')][_0x9bff('0x1e')]=function(_0x4f27e6){try{if(this[_0x9bff('0x60')](_0x4f27e6)){logger['debug']('[%s][voiceQueueReport][agentcomplete]',_0x4f27e6[_0x9bff('0x4a')],util[_0x9bff('0x3a')](_0x4f27e6,{'showHidden':![],'depth':null}));if(this[_0x9bff('0x11')][_0x4f27e6[_0x9bff('0x4a')]]){var _0x5879bf=_[_0x9bff('0x7f')](this[_0x9bff('0x11')][_0x4f27e6[_0x9bff('0x4a')]]);_0x5879bf[_0x9bff('0x19')]=![];_0x5879bf[_0x9bff('0x83')]=null;_0x5879bf['assigned']=!![];_0x5879bf[_0x9bff('0x8d')]=_0x4f27e6[_0x9bff('0x8e')];_0x5879bf[_0x9bff('0x81')]=_0x4f27e6[_0x9bff('0x81')];_0x5879bf[_0x9bff('0x80')]=!![];_0x5879bf[_0x9bff('0x8f')]=![];_0x5879bf[_0x9bff('0x90')]=null;if(!_0x5879bf['transfer']){if(_0x4f27e6[_0x9bff('0x91')]=='transfer'){_0x5879bf[_0x9bff('0x84')]=_0x9bff('0x92');logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x5879bf[_0x9bff('0x4e')],_0x5879bf[_0x9bff('0x74')]);}else{if(_[_0x9bff('0x93')](_0x4f27e6[_0x9bff('0x94')][_0x9bff('0x95')](),_0x9bff('0x96'))){if(this[_0x9bff('0x11')][_0x4f27e6[_0x9bff('0x97')]]){var _0x5180eb=_[_0x9bff('0x7f')](this[_0x9bff('0x11')][_0x4f27e6[_0x9bff('0x97')]]);_0x5180eb[_0x9bff('0x80')]=![];_0x5180eb['queuecallerexit']=!![];_0x5180eb[_0x9bff('0x90')]=moment(_0x5879bf[_0x9bff('0x98')])[_0x9bff('0x99')](_0x4f27e6[_0x9bff('0x81')],_0x9bff('0x9a'))['format'](_0x9bff('0x75'));_0x5180eb['queuecallerexitreason']=_0x9bff('0x9b');_0x5180eb[_0x9bff('0x9c')]=!![];_0x5180eb['transfertype']=_0x9bff('0x9d');_0x5180eb[_0x9bff('0x9e')]=_0x4f27e6['destexten'];_0x5180eb[_0x9bff('0x9f')]=_0x4f27e6[_0x9bff('0x4a')];logger[_0x9bff('0x6b')](_0x9bff('0xa0'),_0x5180eb['name'],_0x5180eb[_0x9bff('0x74')]);var _0x152ce6=this['queueReports'][_0x4f27e6[_0x9bff('0x97')]];this[_0x9bff('0x11')][_0x4f27e6[_0x9bff('0x97')]]=this['queueReports'][_0x4f27e6[_0x9bff('0x4a')]];this[_0x9bff('0x11')][_0x4f27e6[_0x9bff('0x4a')]]=_0x152ce6;}}else{_0x5879bf[_0x9bff('0x84')]=_0x9bff('0xa1')+_0x4f27e6['reason'][_0x9bff('0xa2')]();logger[_0x9bff('0x6b')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x5879bf[_0x9bff('0x4e')],_0x5879bf[_0x9bff('0x74')],_0x5879bf[_0x9bff('0x84')]);}}}this[_0x9bff('0x13')][_0x4f27e6[_0x9bff('0x4a')]]=_0x5879bf;this['emitVoiceQueueChannelRemove'](_0x5879bf,_0x9bff('0x1d'));}}}catch(_0x2dd33b){logger[_0x9bff('0x38')]('[%s][voiceQueueReport][agentcomplete]',_0x4f27e6[_0x9bff('0x4a')],util[_0x9bff('0x3a')](_0x2dd33b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9bff('0xc')][_0x9bff('0xa3')]=function(_0x1d0244){try{if(this[_0x9bff('0x60')](_0x1d0244)){logger['debug'](_0x9bff('0xa4'),_0x1d0244[_0x9bff('0x4a')],util[_0x9bff('0x3a')](_0x1d0244,{'showHidden':![],'depth':null}));this[_0x9bff('0xa5')](_0x1d0244[_0x9bff('0x4a')],_[_0x9bff('0xa6')](_0x1d0244[_0x9bff('0xa7')])[0x0],_0x1d0244[_0x9bff('0xa8')]);if(this[_0x9bff('0x11')][_0x1d0244['uniqueid']]){var _0x2252c5=_[_0x9bff('0x7f')](this[_0x9bff('0x11')][_0x1d0244[_0x9bff('0x4a')]]);if(_0x2252c5){if(this[_0x9bff('0x60')](_0x1d0244[_0x9bff('0xa7')])&&this[_0x9bff('0x60')](_0x1d0244[_0x9bff('0xa7')][_0x9bff('0xa9')])){switch(_0x1d0244[_0x9bff('0xa8')]){case _0x9bff('0xaa'):_0x2252c5[_0x9bff('0x8f')]=![];_0x2252c5[_0x9bff('0x90')]=null;break;case _0x9bff('0xab'):_0x2252c5[_0x9bff('0xac')]=_0x9bff('0xad');_0x2252c5[_0x9bff('0x8f')]=!![];_0x2252c5[_0x9bff('0x90')]=moment()[_0x9bff('0x4c')](_0x9bff('0x75'));_0x2252c5[_0x9bff('0xae')]=moment()[_0x9bff('0x4c')](_0x9bff('0x75'));logger[_0x9bff('0x48')](_0x9bff('0xaf'),_0x1d0244[_0x9bff('0x4a')],util['inspect'](_0x2252c5,{'showHidden':![],'depth':null}));ami['emit'](_0x9bff('0xb0'),_0x2252c5);break;default:_0x2252c5[_0x9bff('0x8f')]=!![];_0x2252c5[_0x9bff('0x90')]=moment()[_0x9bff('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');_0x2252c5['queuecallerleaveAt']=moment()[_0x9bff('0x4c')](_0x9bff('0x75'));}_0x2252c5[_0x9bff('0x19')]=![];_0x2252c5[_0x9bff('0x83')]=null;_0x2252c5['queuecallerexitreason']=_0x1d0244[_0x9bff('0xa8')];this[_0x9bff('0x13')][_0x1d0244['uniqueid']]=_0x2252c5;this[_0x9bff('0x41')](_0x2252c5,'varset');}else if(this[_0x9bff('0x60')](_0x1d0244[_0x9bff('0xa7')])&&this[_0x9bff('0x60')](_0x1d0244['variable'][_0x9bff('0xb1')])){if(!_0x2252c5[_0x9bff('0x19')]){_0x2252c5['queuecallerexit']=!![];_0x2252c5['queuecallerexitAt']=moment()[_0x9bff('0x4c')](_0x9bff('0x75'));_0x2252c5[_0x9bff('0x84')]=_0x9bff('0xb2');_0x2252c5['queuecallerleaveAt']=moment()[_0x9bff('0x4c')](_0x9bff('0x75'));this[_0x9bff('0x13')][_0x1d0244[_0x9bff('0x4a')]]=_0x2252c5;}}logger['info'](_0x9bff('0xb3'),_0x1d0244[_0x9bff('0x4a')],_0x2252c5[_0x9bff('0x4e')],_0x2252c5[_0x9bff('0x74')],_[_0x9bff('0xa6')](_0x1d0244[_0x9bff('0xa7')])[0x0],_0x1d0244[_0x9bff('0xa8')]);_0x2252c5[_0x9bff('0x3c')]=this['variables'][_0x1d0244[_0x9bff('0x4a')]];}}}}catch(_0x3f3dd4){logger['error'](_0x9bff('0xa4'),_0x1d0244[_0x9bff('0x4a')],util[_0x9bff('0x3a')](_0x3f3dd4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9bff('0xc')][_0x9bff('0xa5')]=function(_0x25caa9,_0x25ccdf,_0x4ec63d){var _0x44cabf=[_0x9bff('0xb4'),'rtpaudioqosbridged',_0x9bff('0xb5'),_0x9bff('0xb6'),_0x9bff('0xb7'),_0x9bff('0xb8'),'rtpaudioqosrtt',_0x9bff('0xb9'),_0x9bff('0xba'),_0x9bff('0xbb'),_0x9bff('0xbc'),_0x9bff('0xbd'),_0x9bff('0xbe'),_0x9bff('0xbf'),_0x9bff('0xc0'),_0x9bff('0xc1'),'membername',_0x9bff('0xc2'),'memberrealtime'];if(!_[_0x9bff('0x34')](_0x25ccdf)&&!_[_0x9bff('0xc3')](_0x44cabf,_0x25ccdf)){if(_[_0x9bff('0x61')](this['variables'][_0x25caa9])){this[_0x9bff('0x3c')][_0x25caa9]={};}this[_0x9bff('0x3c')][_0x25caa9][_0x25ccdf]=_0x4ec63d;}};VoiceQueueReport[_0x9bff('0xc')]['syncHangup']=function(_0xa2c9a7){try{if(this[_0x9bff('0x60')](_0xa2c9a7)){logger[_0x9bff('0x48')]('[%s][voiceQueueReport][hangup]',_0xa2c9a7['uniqueid'],util[_0x9bff('0x3a')](_0xa2c9a7,{'showHidden':![],'depth':null}));if(this[_0x9bff('0x11')][_0xa2c9a7[_0x9bff('0x4a')]]){for(var _0x51ec64=0x0,_0x4d9024={};_0x51ec640x0?_0x48bfa9:0x0;this['voiceQueues'][_0x3ccd5e[_0x3fbd('0x62')]]['talking']=this['voiceQueues'][_0x3ccd5e[_0x3fbd('0x62')]]['talking']>_['toNumber'](_0x3ccd5e['loggedin'])?_[_0x3fbd('0x67')](_0x3ccd5e[_0x3fbd('0x69')]):this[_0x3fbd('0x12')][_0x3ccd5e[_0x3fbd('0x62')]][_0x3fbd('0x53')];this[_0x3fbd('0x6a')](this[_0x3fbd('0x12')][_0x3ccd5e[_0x3fbd('0x62')]],_0x3fbd('0x15'));}logger[_0x3fbd('0x3e')](_0x3fbd('0x6b'),util[_0x3fbd('0x35')](this[_0x3fbd('0x12')][_0x3ccd5e[_0x3fbd('0x62')]],{'showHidden':![],'depth':null}));ami[_0x3fbd('0x3c')](_0x3fbd('0x6c'),this['voiceQueues'][_0x3ccd5e[_0x3fbd('0x62')]]);}}}catch(_0x5aed71){logger['error'](_0x3fbd('0x60'),util['inspect'](_0x5aed71,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x3fbd('0x6d')]=function(_0x1353c3){logger[_0x3fbd('0x3e')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0x3fbd('0x35')](_0x1353c3,{'showHidden':![],'depth':null}));this['flagQueueSummary']=!![];};VoiceQueueReport[_0x3fbd('0x2c')][_0x3fbd('0x18')]=function(_0x119548){try{if(this[_0x3fbd('0x61')](_0x119548)){logger[_0x3fbd('0x3e')](_0x3fbd('0x6e'),_0x119548[_0x3fbd('0x41')],util['inspect'](_0x119548,{'showHidden':![],'depth':null}));if(_[_0x3fbd('0x6f')](this[_0x3fbd('0xe')][_0x119548[_0x3fbd('0x41')]]))this[_0x3fbd('0xe')][_0x119548[_0x3fbd('0x41')]]=[];if(_[_0x3fbd('0x6f')](this[_0x3fbd('0x10')][_0x119548[_0x3fbd('0x41')]]))this['channels'][_0x119548[_0x3fbd('0x41')]]={};var _0x2ae758=new QueueReport();_0x2ae758[_0x3fbd('0x48')]=_0x119548[_0x3fbd('0x62')];_0x2ae758[_0x3fbd('0x4b')]=this[_0x3fbd('0x12')][_0x2ae758[_0x3fbd('0x48')]]&&this[_0x3fbd('0x12')][_0x2ae758[_0x3fbd('0x48')]][_0x3fbd('0x4b')]?this[_0x3fbd('0x12')][_0x2ae758[_0x3fbd('0x48')]][_0x3fbd('0x4b')]||_0x3fbd('0x4c'):'inbound';_0x2ae758[_0x3fbd('0x62')]=_0x119548[_0x3fbd('0x62')];_0x2ae758[_0x3fbd('0x70')]=moment()[_0x3fbd('0x42')]('YYYY-MM-DD\x20HH:mm:ss');_0x2ae758['position']=_0x119548['position'];_0x2ae758[_0x3fbd('0x71')]=_0x119548[_0x3fbd('0x71')];_0x2ae758[_0x3fbd('0x41')]=_0x119548[_0x3fbd('0x41')];_0x2ae758['routealias']=this['channels'][_0x119548[_0x3fbd('0x41')]][_0x3fbd('0x72')];logger[_0x3fbd('0x64')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x2ae758[_0x3fbd('0x48')],_0x2ae758[_0x3fbd('0x4b')]);_[_0x3fbd('0x73')](_0x2ae758,_[_0x3fbd('0x74')](_0x119548,_['keys'](_0x2ae758)));this[_0x3fbd('0xe')][_0x119548[_0x3fbd('0x41')]][_0x3fbd('0x75')](_0x2ae758);this[_0x3fbd('0x10')][_0x119548['uniqueid']]=_0x2ae758;this[_0x3fbd('0x3d')](_0x2ae758,_0x3fbd('0x76'));}}catch(_0xa4c16d){logger[_0x3fbd('0x36')](_0x3fbd('0x6e'),_0x119548[_0x3fbd('0x41')],util['inspect'](_0xa4c16d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3fbd('0x2c')][_0x3fbd('0x1a')]=function(_0x355962){try{if(this[_0x3fbd('0x61')](_0x355962)){logger[_0x3fbd('0x3e')](_0x3fbd('0x77'),_0x355962[_0x3fbd('0x41')],util[_0x3fbd('0x35')](_0x355962,{'showHidden':![],'depth':null}));if(this[_0x3fbd('0xe')][_0x355962[_0x3fbd('0x41')]]){var _0x159766=_[_0x3fbd('0x78')](this[_0x3fbd('0xe')][_0x355962[_0x3fbd('0x41')]]);_0x159766[_0x3fbd('0x79')]=![];_0x159766[_0x3fbd('0x7a')]=null;_0x159766[_0x3fbd('0x7b')]=_0x355962['holdtime'];_0x159766[_0x3fbd('0x7c')]=_0x355962[_0x3fbd('0x7c')];_0x159766[_0x3fbd('0x19')]=!![];_0x159766[_0x3fbd('0x7d')]=moment()[_0x3fbd('0x42')](_0x3fbd('0x7e'));_0x159766[_0x3fbd('0x46')]=_0x3fbd('0x7f');_0x159766[_0x3fbd('0x80')]=null;logger['info'](_0x3fbd('0x81'),_0x159766[_0x3fbd('0x48')],_0x159766[_0x3fbd('0x4b')]);this[_0x3fbd('0x10')][_0x355962[_0x3fbd('0x41')]]=_0x159766;this['emitVoiceQueueChannelRemove'](_0x159766,_0x3fbd('0x19'));}}}catch(_0x40f198){logger[_0x3fbd('0x36')]('[%s][voiceQueueReport][queuecallerabandon]',_0x355962['uniqueid'],util[_0x3fbd('0x35')](_0x40f198,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3fbd('0x2c')][_0x3fbd('0x1b')]=function(_0x46ab2a){try{if(this['isNotNull'](_0x46ab2a)){logger['debug'](_0x3fbd('0x82'),_0x46ab2a[_0x3fbd('0x41')],util[_0x3fbd('0x35')](_0x46ab2a,{'showHidden':![],'depth':null}));if(this[_0x3fbd('0xe')][_0x46ab2a['uniqueid']]){var _0x49aa60=_[_0x3fbd('0x78')](this[_0x3fbd('0xe')][_0x46ab2a[_0x3fbd('0x41')]]);_0x49aa60[_0x3fbd('0x83')]=moment()['format'](_0x3fbd('0x7e'));_0x49aa60[_0x3fbd('0x84')]=_0x46ab2a['connectedlinenum'];_0x49aa60['connectedlinename']=_0x46ab2a[_0x3fbd('0x85')];logger[_0x3fbd('0x64')](_0x3fbd('0x86'),_0x49aa60['name'],_0x49aa60[_0x3fbd('0x4b')],_0x46ab2a[_0x3fbd('0x84')],_0x46ab2a['connectedlinename']);this[_0x3fbd('0x10')][_0x46ab2a['uniqueid']]=_0x49aa60;this[_0x3fbd('0x3d')](_0x49aa60,_0x3fbd('0x87'));}}}catch(_0x414e2f){logger[_0x3fbd('0x36')](_0x3fbd('0x82'),_0x46ab2a['uniqueid'],util['inspect'](_0x414e2f,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x3fbd('0x88')]=function(_0x2d1e30){try{if(this[_0x3fbd('0x61')](_0x2d1e30)){logger[_0x3fbd('0x3e')](_0x3fbd('0x89'),_0x2d1e30[_0x3fbd('0x41')],util[_0x3fbd('0x35')](_0x2d1e30,{'showHidden':![],'depth':null}));if(this[_0x3fbd('0xe')][_0x2d1e30[_0x3fbd('0x41')]]){var _0x21cef0=_['last'](this[_0x3fbd('0xe')][_0x2d1e30[_0x3fbd('0x41')]]);_0x21cef0[_0x3fbd('0x79')]=!![];_0x21cef0['queuecallerexitreason']=_0x3fbd('0x8a');logger[_0x3fbd('0x64')](_0x3fbd('0x8b'),_0x21cef0[_0x3fbd('0x48')],_0x21cef0[_0x3fbd('0x4b')]);}}}catch(_0x6bc1db){logger[_0x3fbd('0x36')]('[%s][voiceQueueReport][agentconnect]',_0x2d1e30[_0x3fbd('0x41')],util[_0x3fbd('0x35')](_0x6bc1db,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3fbd('0x2c')][_0x3fbd('0x1d')]=function(_0x4d253d){try{if(this[_0x3fbd('0x61')](_0x4d253d)){logger['debug']('[%s][voiceQueueReport][agentcomplete]',_0x4d253d[_0x3fbd('0x41')],util[_0x3fbd('0x35')](_0x4d253d,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x4d253d[_0x3fbd('0x41')]]){var _0xa1eb74=_[_0x3fbd('0x78')](this[_0x3fbd('0xe')][_0x4d253d[_0x3fbd('0x41')]]);_0xa1eb74['queuecallerabandon']=![];_0xa1eb74[_0x3fbd('0x7d')]=null;_0xa1eb74[_0x3fbd('0x8c')]=!![];_0xa1eb74[_0x3fbd('0x80')]=_0x4d253d[_0x3fbd('0x8d')];_0xa1eb74[_0x3fbd('0x7b')]=_0x4d253d[_0x3fbd('0x7b')];_0xa1eb74[_0x3fbd('0x79')]=!![];_0xa1eb74[_0x3fbd('0x8e')]=![];_0xa1eb74[_0x3fbd('0x8f')]=null;if(!_0xa1eb74['transfer']){if(_0x4d253d[_0x3fbd('0x90')]==_0x3fbd('0x91')){_0xa1eb74[_0x3fbd('0x46')]=_0x3fbd('0x92');logger[_0x3fbd('0x64')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0xa1eb74[_0x3fbd('0x48')],_0xa1eb74['type']);}else{if(_['startsWith'](_0x4d253d[_0x3fbd('0x31')][_0x3fbd('0x93')](),'local/')){if(this['queueReports'][_0x4d253d[_0x3fbd('0x94')]]){var _0x4e43f9=_[_0x3fbd('0x78')](this[_0x3fbd('0xe')][_0x4d253d[_0x3fbd('0x94')]]);_0x4e43f9['queuecallercomplete']=![];_0x4e43f9[_0x3fbd('0x8e')]=!![];_0x4e43f9[_0x3fbd('0x8f')]=moment(_0xa1eb74[_0x3fbd('0x70')])[_0x3fbd('0x95')](_0x4d253d[_0x3fbd('0x7b')],_0x3fbd('0x96'))[_0x3fbd('0x42')]('YYYY-MM-DD\x20HH:mm:ss');_0x4e43f9[_0x3fbd('0x46')]=_0x3fbd('0x97');_0x4e43f9['transfer']=!![];_0x4e43f9[_0x3fbd('0x98')]=_0x3fbd('0x99');_0x4e43f9[_0x3fbd('0x9a')]=_0x4d253d[_0x3fbd('0x9b')];_0x4e43f9['transferuniqueid']=_0x4d253d[_0x3fbd('0x41')];logger['info'](_0x3fbd('0x9c'),_0x4e43f9[_0x3fbd('0x48')],_0x4e43f9[_0x3fbd('0x4b')]);var _0x11d2d4=this['queueReports'][_0x4d253d[_0x3fbd('0x94')]];this[_0x3fbd('0xe')][_0x4d253d[_0x3fbd('0x94')]]=this[_0x3fbd('0xe')][_0x4d253d[_0x3fbd('0x41')]];this[_0x3fbd('0xe')][_0x4d253d[_0x3fbd('0x41')]]=_0x11d2d4;}}else{_0xa1eb74[_0x3fbd('0x46')]=_0x3fbd('0x9d')+_0x4d253d[_0x3fbd('0x90')]['toUpperCase']();logger[_0x3fbd('0x64')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0xa1eb74[_0x3fbd('0x48')],_0xa1eb74[_0x3fbd('0x4b')],_0xa1eb74['queuecallerexitreason']);}}}this[_0x3fbd('0x10')][_0x4d253d['uniqueid']]=_0xa1eb74;this[_0x3fbd('0x45')](_0xa1eb74,_0x3fbd('0x1c'));}}}catch(_0x565191){logger[_0x3fbd('0x36')]('[%s][voiceQueueReport][agentcomplete]',_0x4d253d[_0x3fbd('0x41')],util[_0x3fbd('0x35')](_0x565191,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3fbd('0x2c')][_0x3fbd('0x20')]=function(_0x1902ec){try{if(this[_0x3fbd('0x61')](_0x1902ec)){logger[_0x3fbd('0x3e')](_0x3fbd('0x9e'),_0x1902ec[_0x3fbd('0x41')],util[_0x3fbd('0x35')](_0x1902ec,{'showHidden':![],'depth':null}));this[_0x3fbd('0x9f')](_0x1902ec['uniqueid'],_[_0x3fbd('0xa0')](_0x1902ec[_0x3fbd('0xa1')])[0x0],_0x1902ec[_0x3fbd('0xa2')]);if(this[_0x3fbd('0xe')][_0x1902ec[_0x3fbd('0x41')]]){var _0x19e304=_[_0x3fbd('0x78')](this[_0x3fbd('0xe')][_0x1902ec[_0x3fbd('0x41')]]);if(_0x19e304){if(this['isNotNull'](_0x1902ec[_0x3fbd('0xa1')])&&this[_0x3fbd('0x61')](_0x1902ec['variable'][_0x3fbd('0xa3')])){switch(_0x1902ec[_0x3fbd('0xa2')]){case _0x3fbd('0xa4'):_0x19e304['queuecallerexit']=![];_0x19e304['queuecallerexitAt']=null;break;case _0x3fbd('0xa5'):_0x19e304['lastevent']=_0x3fbd('0xa6');_0x19e304[_0x3fbd('0x8e')]=!![];_0x19e304[_0x3fbd('0x8f')]=moment()[_0x3fbd('0x42')](_0x3fbd('0x7e'));_0x19e304[_0x3fbd('0x83')]=moment()[_0x3fbd('0x42')](_0x3fbd('0x7e'));logger['debug']('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x1902ec[_0x3fbd('0x41')],util[_0x3fbd('0x35')](_0x19e304,{'showHidden':![],'depth':null}));ami[_0x3fbd('0x3c')](_0x3fbd('0xa7'),_0x19e304);break;default:_0x19e304[_0x3fbd('0x8e')]=!![];_0x19e304[_0x3fbd('0x8f')]=moment()[_0x3fbd('0x42')](_0x3fbd('0x7e'));_0x19e304['queuecallerleaveAt']=moment()[_0x3fbd('0x42')](_0x3fbd('0x7e'));}_0x19e304[_0x3fbd('0x19')]=![];_0x19e304[_0x3fbd('0x7d')]=null;_0x19e304['queuecallerexitreason']=_0x1902ec[_0x3fbd('0xa2')];this[_0x3fbd('0x10')][_0x1902ec['uniqueid']]=_0x19e304;this[_0x3fbd('0x45')](_0x19e304,'varset');}else if(this[_0x3fbd('0x61')](_0x1902ec[_0x3fbd('0xa1')])&&this['isNotNull'](_0x1902ec['variable'][_0x3fbd('0xa8')])){if(!_0x19e304[_0x3fbd('0x19')]){_0x19e304[_0x3fbd('0x8e')]=!![];_0x19e304[_0x3fbd('0x8f')]=moment()[_0x3fbd('0x42')](_0x3fbd('0x7e'));_0x19e304[_0x3fbd('0x46')]=_0x3fbd('0xa9');_0x19e304[_0x3fbd('0x83')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x3fbd('0x10')][_0x1902ec[_0x3fbd('0x41')]]=_0x19e304;}}logger['info'](_0x3fbd('0xaa'),_0x1902ec[_0x3fbd('0x41')],_0x19e304['name'],_0x19e304['type'],_['keys'](_0x1902ec['variable'])[0x0],_0x1902ec['value']);_0x19e304[_0x3fbd('0x14')]=this[_0x3fbd('0x14')][_0x1902ec[_0x3fbd('0x41')]];}}}}catch(_0x228ce9){logger['error'](_0x3fbd('0x9e'),_0x1902ec[_0x3fbd('0x41')],util[_0x3fbd('0x35')](_0x228ce9,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x3fbd('0x9f')]=function(_0x2d7554,_0xa4a931,_0x6f80b5){var _0x54776e=['rtpaudioqos',_0x3fbd('0xab'),_0x3fbd('0xac'),_0x3fbd('0xad'),'rtpaudioqosloss',_0x3fbd('0xae'),_0x3fbd('0xaf'),_0x3fbd('0xb0'),'sipcallid','sipuri','bridgepeer',_0x3fbd('0xb1'),_0x3fbd('0xb2'),_0x3fbd('0xb3'),_0x3fbd('0xb4'),_0x3fbd('0xb5'),_0x3fbd('0x8d'),_0x3fbd('0xb6'),_0x3fbd('0xb7')];if(!_['isNil'](_0xa4a931)&&!_[_0x3fbd('0xb8')](_0x54776e,_0xa4a931)){if(_[_0x3fbd('0x6f')](this[_0x3fbd('0x14')][_0x2d7554])){this[_0x3fbd('0x14')][_0x2d7554]={};}this[_0x3fbd('0x14')][_0x2d7554][_0xa4a931]=_0x6f80b5;}};VoiceQueueReport[_0x3fbd('0x2c')][_0x3fbd('0x22')]=function(_0x1ac26e){try{if(this[_0x3fbd('0x61')](_0x1ac26e)){logger[_0x3fbd('0x3e')]('[%s][voiceQueueReport][hangup]',_0x1ac26e['uniqueid'],util['inspect'](_0x1ac26e,{'showHidden':![],'depth':null}));if(this[_0x3fbd('0xe')][_0x1ac26e[_0x3fbd('0x41')]]){for(var _0x5d88ba=0x0,_0x3c2e20={};_0x5d88ba=0x0?moment(_0x3eb13a['endtime'])['diff'](_0x3eb13a[_0x7e7d('0x18')],'seconds'):null,'data1':_0x7e7d('0x19'),'data2':_0x3eb13a[_0x7e7d('0x12')],'data3':_0x3eb13a[_0x7e7d('0x1a')],'data4':_0x3eb13a[_0x7e7d('0x1b')]||null,'role':_0x7e7d('0x11'),'internal':_0x3eb13a['accountcode']?_[_0x7e7d('0x13')](_0x3eb13a[_0x7e7d('0x12')]):undefined,'uniqueid':_0x3eb13a[_0x7e7d('0x1c')]},'log':_0x7e7d('0x6')});}; \ No newline at end of file +var _0x5d2e=['toNumber','uniqueid','Request','membername','endtime','starttime','outbound','dialstring','moment','lodash','util','../client','queuecallercompleteAt','queuecallerexitAt','CreateMemberReport','voice','lastAssignedTo','interface','SIP/%s','TALKING','queuecallerleaveAt','diff','seconds','inbound','exten','agent','accountcode'];(function(_0x2e412d,_0x4a6bd7){var _0x31c901=function(_0x1d057c){while(--_0x1d057c){_0x2e412d['push'](_0x2e412d['shift']());}};_0x31c901(++_0x4a6bd7);}(_0x5d2e,0xaa));var _0xe5d2=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x5d2e[_0x465a0c];return _0x1e202e;};'use strict';var moment=require(_0xe5d2('0x0'));var _=require(_0xe5d2('0x1'));var util=require(_0xe5d2('0x2'));var client=require(_0xe5d2('0x3'));exports['voiceQueueReport']=function(_0x394fc7){var _0x1b1416=_0x394fc7[_0xe5d2('0x4')]||_0x394fc7[_0xe5d2('0x5')];return client['Request'](_0xe5d2('0x6'),{'body':{'channel':_0xe5d2('0x7'),'membername':_0x394fc7[_0xe5d2('0x8')],'interface':_['isNil'](_0x394fc7[_0xe5d2('0x9')])?util['format'](_0xe5d2('0xa'),_0x394fc7[_0xe5d2('0x8')]):_0x394fc7[_0xe5d2('0x9')],'type':_0xe5d2('0xb'),'enterAt':_0x394fc7[_0xe5d2('0xc')],'exitAt':_0x1b1416,'duration':moment(_0x1b1416)[_0xe5d2('0xd')](_0x394fc7[_0xe5d2('0xc')],_0xe5d2('0xe')),'data1':_0xe5d2('0xf'),'data2':_0x394fc7['calleridnum'],'data3':_0x394fc7[_0xe5d2('0x10')],'data4':null,'data5':_0x394fc7['queue'],'role':_0xe5d2('0x11'),'internal':_0x394fc7[_0xe5d2('0x12')]?_[_0xe5d2('0x13')](_0x394fc7['accountcode']):undefined,'uniqueid':_0x394fc7[_0xe5d2('0x14')]},'log':_0xe5d2('0x6')});};exports['voiceDialReport']=function(_0x37a434){return client[_0xe5d2('0x15')](_0xe5d2('0x6'),{'body':{'channel':_0xe5d2('0x7'),'membername':_0x37a434[_0xe5d2('0x16')],'interface':_0x37a434[_0xe5d2('0x9')],'type':'TALKING','enterAt':_0x37a434['starttime'],'exitAt':_0x37a434[_0xe5d2('0x17')],'duration':moment(_0x37a434[_0xe5d2('0x17')])['diff'](_0x37a434[_0xe5d2('0x18')],'seconds')>=0x0?moment(_0x37a434['endtime'])['diff'](_0x37a434['starttime'],_0xe5d2('0xe')):null,'data1':_0xe5d2('0x19'),'data2':_0x37a434['accountcode'],'data3':_0x37a434[_0xe5d2('0x10')],'data4':_0x37a434[_0xe5d2('0x1a')]||null,'role':_0xe5d2('0x11'),'internal':_0x37a434[_0xe5d2('0x12')]?_[_0xe5d2('0x13')](_0x37a434[_0xe5d2('0x12')]):undefined,'uniqueid':_0x37a434['uniqueid']},'log':_0xe5d2('0x6')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index d928406..4431c5e 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 _0x9091=['GetSettings','../client','Request','stopRecordingOnTransfer'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x9091,0x1ed));var _0x1909=function(_0x3c3117,_0x99360a){_0x3c3117=_0x3c3117-0x0;var _0x2f0031=_0x9091[_0x3c3117];return _0x2f0031;};'use strict';var client=require(_0x1909('0x0'));exports['getSettings']=function(){return client[_0x1909('0x1')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x1909('0x2'),'previewRecallmeReminderInterval']},'log':_0x1909('0x3')});}; \ No newline at end of file +var _0x161a=['ShowSetting','previewRecallmeReminderInterval','Request'];(function(_0x185ced,_0x15d3a4){var _0xb62c3c=function(_0x32c67a){while(--_0x32c67a){_0x185ced['push'](_0x185ced['shift']());}};_0xb62c3c(++_0x15d3a4);}(_0x161a,0x140));var _0xa161=function(_0x5db657,_0x2f40b3){_0x5db657=_0x5db657-0x0;var _0x2d6e70=_0x161a[_0x5db657];return _0x2d6e70;};'use strict';var client=require('../client');exports['getSettings']=function(){return client[_0xa161('0x0')](_0xa161('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer',_0xa161('0x2')]},'log':'GetSettings'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index b4f286d..ee86545 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 _0xccac=['getTemplates','Request','GetTemplate','../client'];(function(_0x1f3d15,_0x5176a8){var _0x48617b=function(_0x5e2eb8){while(--_0x5e2eb8){_0x1f3d15['push'](_0x1f3d15['shift']());}};_0x48617b(++_0x5176a8);}(_0xccac,0x1cb));var _0xccca=function(_0x1e4079,_0x18c002){_0x1e4079=_0x1e4079-0x0;var _0x24f302=_0xccac[_0x1e4079];return _0x24f302;};'use strict';var client=require(_0xccca('0x0'));exports[_0xccca('0x1')]=function(_0x29f623){return function(_0x186226){return client[_0xccca('0x2')](_0xccca('0x3'),{'options':{'raw':!![],'attributes':['id','name','html']},'log':_0xccca('0x3')});};}; \ No newline at end of file +var _0x7cfa=['Request','GetTemplate','name','../client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7cfa,0x137));var _0xa7cf=function(_0x27dad6,_0x28a639){_0x27dad6=_0x27dad6-0x0;var _0xc2c723=_0x7cfa[_0x27dad6];return _0xc2c723;};'use strict';var client=require(_0xa7cf('0x0'));exports['getTemplates']=function(_0x5df2f7){return function(_0xd35f8){return client[_0xa7cf('0x1')](_0xa7cf('0x2'),{'options':{'raw':!![],'attributes':['id',_0xa7cf('0x3'),'html']},'log':_0xa7cf('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 4e7e01e..a7884b5 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 _0x8e3b=['data3','data5','data6','data7','getTriggers','Request','GetTrigger','status','AllConditions','field','operator','Condition','AnyConditions','value','Action','action'];(function(_0x1ee92a,_0x1de5e9){var _0x3d0f06=function(_0x20f6f3){while(--_0x20f6f3){_0x1ee92a['push'](_0x1ee92a['shift']());}};_0x3d0f06(++_0x1de5e9);}(_0x8e3b,0x1e4));var _0xb8e3=function(_0xd5a842,_0x3bef1f){_0xd5a842=_0xd5a842-0x0;var _0xcedd84=_0x8e3b[_0xd5a842];return _0xcedd84;};'use strict';var client=require('../client');exports[_0xb8e3('0x0')]=function(_0x511551){return function(_0x39db89){return client[_0xb8e3('0x1')](_0xb8e3('0x2'),{'options':{'raw':![],'attributes':['id','name','channel',_0xb8e3('0x3')],'include':[{'model':'Condition','as':_0xb8e3('0x4'),'attributes':['id',_0xb8e3('0x5'),_0xb8e3('0x6'),'value']},{'model':_0xb8e3('0x7'),'as':_0xb8e3('0x8'),'attributes':['id',_0xb8e3('0x5'),_0xb8e3('0x6'),_0xb8e3('0x9')]},{'model':_0xb8e3('0xa'),'as':'Actions','attributes':['id',_0xb8e3('0xb'),'data1','data2',_0xb8e3('0xc'),'data4',_0xb8e3('0xd'),_0xb8e3('0xe'),_0xb8e3('0xf')]}]},'log':_0xb8e3('0x2')});};}; \ No newline at end of file +var _0x6fcf=['getTriggers','Request','GetTrigger','name','channel','status','Condition','operator','value','AnyConditions','field','Action','Actions','action','data2','data4','data5','data6','data7','../client'];(function(_0x14a3fc,_0x1ba30c){var _0x61984c=function(_0x58ff91){while(--_0x58ff91){_0x14a3fc['push'](_0x14a3fc['shift']());}};_0x61984c(++_0x1ba30c);}(_0x6fcf,0x8b));var _0xf6fc=function(_0x9105f4,_0x3bf6f7){_0x9105f4=_0x9105f4-0x0;var _0x57a818=_0x6fcf[_0x9105f4];return _0x57a818;};'use strict';var client=require(_0xf6fc('0x0'));exports[_0xf6fc('0x1')]=function(_0x52cf07){return function(_0x1d66bc){return client[_0xf6fc('0x2')](_0xf6fc('0x3'),{'options':{'raw':![],'attributes':['id',_0xf6fc('0x4'),_0xf6fc('0x5'),_0xf6fc('0x6')],'include':[{'model':_0xf6fc('0x7'),'as':'AllConditions','attributes':['id','field',_0xf6fc('0x8'),_0xf6fc('0x9')]},{'model':_0xf6fc('0x7'),'as':_0xf6fc('0xa'),'attributes':['id',_0xf6fc('0xb'),_0xf6fc('0x8'),_0xf6fc('0x9')]},{'model':_0xf6fc('0xc'),'as':_0xf6fc('0xd'),'attributes':['id',_0xf6fc('0xe'),'data1',_0xf6fc('0xf'),'data3',_0xf6fc('0x10'),_0xf6fc('0x11'),_0xf6fc('0x12'),_0xf6fc('0x13')]}]},'log':_0xf6fc('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 14cdf66..a4789ba 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 _0xf2cb=['getTrunks','GetTrunk','registry','defaultuser'];(function(_0x1b3e56,_0x36eedb){var _0x1032be=function(_0x59f6df){while(--_0x59f6df){_0x1b3e56['push'](_0x1b3e56['shift']());}};_0x1032be(++_0x36eedb);}(_0xf2cb,0x130));var _0xbf2c=function(_0x31f999,_0x200073){_0x31f999=_0x31f999-0x0;var _0x32b0b9=_0xf2cb[_0x31f999];return _0x32b0b9;};'use strict';var client=require('../client');exports[_0xbf2c('0x0')]=function(_0x5e5c76){return function(_0x15aa19){return client['Request'](_0xbf2c('0x1'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0xbf2c('0x2'),_0xbf2c('0x3')]},'log':'GetTrunk'});};}; \ No newline at end of file +var _0x3f11=['../client','Request','GetTrunk','registry'];(function(_0x47f9a9,_0x1a361a){var _0x563941=function(_0xcaaa17){while(--_0xcaaa17){_0x47f9a9['push'](_0x47f9a9['shift']());}};_0x563941(++_0x1a361a);}(_0x3f11,0x6c));var _0x13f1=function(_0x4c8240,_0x2726cb){_0x4c8240=_0x4c8240-0x0;var _0x197de3=_0x3f11[_0x4c8240];return _0x197de3;};'use strict';var client=require(_0x13f1('0x0'));exports['getTrunks']=function(_0x58261b){return function(_0x4998e3){return client[_0x13f1('0x1')](_0x13f1('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0x13f1('0x3'),'defaultuser']},'log':_0x13f1('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index aba2ad1..4e6c890 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 _0xcb91=['UnpauseUser','getAgent','ShowUser','email','lastPauseAt','Request','GetUser','agent','name','accountcode','fullname','lastLoginAt','pauseType','voicePause','phone','interface','getAgents','internal','getTelephones','savePause','PauseUser'];(function(_0x5ec3d8,_0x34e085){var _0x4d7fb3=function(_0x25a249){while(--_0x25a249){_0x5ec3d8['push'](_0x5ec3d8['shift']());}};_0x4d7fb3(++_0x34e085);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x28014d,_0x383e2f){_0x28014d=_0x28014d-0x0;var _0x2572cc=_0xcb91[_0x28014d];return _0x2572cc;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2')},'attributes':['id',_0x1cb9('0x3'),'email',_0x1cb9('0x4'),_0x1cb9('0x5'),'online',_0x1cb9('0x6'),_0x1cb9('0x7'),'lastPauseAt',_0x1cb9('0x8'),_0x1cb9('0x9'),'mobile',_0x1cb9('0xa')]},'log':_0x1cb9('0xb')});};};exports['getTelephones']=function(){return function(){return client[_0x1cb9('0x0')]('GetUser',{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x4'),_0x1cb9('0xc')]},'log':_0x1cb9('0xd')});};};exports[_0x1cb9('0xe')]=function(_0x50ce71,_0x9b58f1,_0x44a6b4){return client[_0x1cb9('0x0')](_0x1cb9('0xf'),{'body':{'type':_0x9b58f1,'uniqueid':_0x44a6b4},'options':{'where':{'id':_0x50ce71['id']}},'log':_0x1cb9('0xe')});};exports['saveUnpause']=function(_0x5e3c19){return client['Request'](_0x1cb9('0x10'),{'body':{},'options':{'where':{'id':_0x5e3c19['id']}},'log':_0x1cb9('0xe')});};exports[_0x1cb9('0x11')]=function(_0x1c714f){return client['Request'](_0x1cb9('0x12'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2'),'id':_0x1c714f},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x13'),_0x1cb9('0x4'),'fullname','online',_0x1cb9('0x6'),_0x1cb9('0x7'),_0x1cb9('0x14'),_0x1cb9('0x8'),_0x1cb9('0xa')]},'log':_0x1cb9('0x11')});}; \ No newline at end of file +var _0xedd9=['mobile','getTelephones','internal','PauseUser','savePause','saveUnpause','UnpauseUser','ShowUser','interface','getAgent','getAgents','Request','GetUser','agent','name','email','accountcode','fullname','lastLoginAt','pauseType','lastPauseAt','voicePause'];(function(_0x17822f,_0x5a1314){var _0xf31ab8=function(_0x584137){while(--_0x584137){_0x17822f['push'](_0x17822f['shift']());}};_0xf31ab8(++_0x5a1314);}(_0xedd9,0xfc));var _0x9edd=function(_0x10d440,_0x373e58){_0x10d440=_0x10d440-0x0;var _0x23ab5b=_0xedd9[_0x10d440];return _0x23ab5b;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3')},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),_0x9edd('0xb'),'phone',_0x9edd('0xc'),'interface']},'log':_0x9edd('0x0')});};};exports[_0x9edd('0xd')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x9edd('0x4'),'accountcode',_0x9edd('0xe')]},'log':_0x9edd('0xd')});};};exports['savePause']=function(_0xbf9da6,_0x13dc4f,_0x5b6c00){return client[_0x9edd('0x1')](_0x9edd('0xf'),{'body':{'type':_0x13dc4f,'uniqueid':_0x5b6c00},'options':{'where':{'id':_0xbf9da6['id']}},'log':_0x9edd('0x10')});};exports[_0x9edd('0x11')]=function(_0x287ddd){return client[_0x9edd('0x1')](_0x9edd('0x12'),{'body':{},'options':{'where':{'id':_0x287ddd['id']}},'log':_0x9edd('0x10')});};exports['getAgent']=function(_0x176bfa){return client[_0x9edd('0x1')](_0x9edd('0x13'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3'),'id':_0x176bfa},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),'voicePause',_0x9edd('0x14')]},'log':_0x9edd('0x15')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 0ade266..e3c940c 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 _0x710c=['create','Request','CreateVoiceAgentReport','UpdateVoiceAgentReport'];(function(_0x11752f,_0x1b0a07){var _0x597150=function(_0x582257){while(--_0x582257){_0x11752f['push'](_0x11752f['shift']());}};_0x597150(++_0x1b0a07);}(_0x710c,0x1b8));var _0xc710=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0x710c[_0x22b68a];return _0x1ac67a;};'use strict';var client=require('../client');exports[_0xc710('0x0')]=function(_0x102265){return client[_0xc710('0x1')](_0xc710('0x2'),{'body':_0x102265,'log':_0xc710('0x2')});};exports['update']=function(_0x94de91,_0x1686df,_0x28fe9e){return client['Request'](_0xc710('0x3'),{'body':_0x94de91,'options':{'where':{'uniqueid':_0x1686df,'interface':_0x28fe9e,'agentcomplete':!![]}},'log':_0xc710('0x3')});}; \ No newline at end of file +var _0xd42d=['CreateVoiceAgentReport','update','UpdateVoiceAgentReport','create','Request'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xd42d,0x148));var _0xdd42=function(_0x35383e,_0x501f9a){_0x35383e=_0x35383e-0x0;var _0x17b8cd=_0xd42d[_0x35383e];return _0x17b8cd;};'use strict';var client=require('../client');exports[_0xdd42('0x0')]=function(_0x47fb08){return client[_0xdd42('0x1')]('CreateVoiceAgentReport',{'body':_0x47fb08,'log':_0xdd42('0x2')});};exports[_0xdd42('0x3')]=function(_0x11e0f2,_0x5c4587,_0x240bbb){return client[_0xdd42('0x1')]('UpdateVoiceAgentReport',{'body':_0x11e0f2,'options':{'where':{'uniqueid':_0x5c4587,'interface':_0x240bbb,'agentcomplete':!![]}},'log':_0xdd42('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 2c52f2c..9d24200 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 _0xed9b=['../client','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','getVoiceCallReports','outbound','startOf','day','YYYY-MM-DD\x20HH:mm:ss','billableseconds','GetVoiceCallReports','util'];(function(_0x9a7ea6,_0x1807a2){var _0x1c2040=function(_0x55b7ec){while(--_0x55b7ec){_0x9a7ea6['push'](_0x9a7ea6['shift']());}};_0x1c2040(++_0x1807a2);}(_0xed9b,0xd1));var _0xbed9=function(_0x3f6b1b,_0x58d3d6){_0x3f6b1b=_0x3f6b1b-0x0;var _0x4a3d2b=_0xed9b[_0x3f6b1b];return _0x4a3d2b;};'use strict';var moment=require('moment');var util=require(_0xbed9('0x0'));var _=require('lodash');var client=require(_0xbed9('0x1'));exports['create']=function(_0x146fbf){return client[_0xbed9('0x2')](_0xbed9('0x3'),{'body':_[_0xbed9('0x4')](_0x146fbf,{'source':_0x146fbf[_0xbed9('0x5')],'destinationcontext':_0x146fbf[_0xbed9('0x6')],'callerid':_0x146fbf[_0xbed9('0x7')],'amaflags':'DOCUMENTATION'}),'log':_0xbed9('0x3')});};exports[_0xbed9('0x8')]=function(){return function(){return client[_0xbed9('0x2')]('GetVoiceCallReport',{'options':{'where':{'type':[_0xbed9('0x9')],'createdAt':{'$between':[moment()[_0xbed9('0xa')](_0xbed9('0xb'))['format'](_0xbed9('0xc')),moment()['endOf']('day')['format']('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':['type','disposition','duration',_0xbed9('0xd')]},'log':_0xbed9('0xe')});};}; \ No newline at end of file +var _0x6088=['create','CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','Request','GetVoiceCallReport','outbound','format','YYYY-MM-DD\x20HH:mm:ss','endOf','day','type','billableseconds','moment'];(function(_0x3855b4,_0x2c0cfc){var _0x1e2177=function(_0xb97efe){while(--_0xb97efe){_0x3855b4['push'](_0x3855b4['shift']());}};_0x1e2177(++_0x2c0cfc);}(_0x6088,0xd7));var _0x8608=function(_0x177ba6,_0x48f5b2){_0x177ba6=_0x177ba6-0x0;var _0xb9aa6=_0x6088[_0x177ba6];return _0xb9aa6;};'use strict';var moment=require(_0x8608('0x0'));var util=require('util');var _=require('lodash');var client=require('../client');exports[_0x8608('0x1')]=function(_0x20537c){return client['Request'](_0x8608('0x2'),{'body':_[_0x8608('0x3')](_0x20537c,{'source':_0x20537c[_0x8608('0x4')],'destinationcontext':_0x20537c[_0x8608('0x5')],'callerid':_0x20537c[_0x8608('0x6')],'amaflags':_0x8608('0x7')}),'log':_0x8608('0x2')});};exports[_0x8608('0x8')]=function(){return function(){return client[_0x8608('0x9')](_0x8608('0xa'),{'options':{'where':{'type':[_0x8608('0xb')],'createdAt':{'$between':[moment()['startOf']('day')[_0x8608('0xc')](_0x8608('0xd')),moment()[_0x8608('0xe')](_0x8608('0xf'))[_0x8608('0xc')](_0x8608('0xd'))]}},'attributes':[_0x8608('0x10'),'disposition','duration',_0x8608('0x11')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index b90a793..57b873a 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 _0xd896=['CreateVoiceDialReport','../client','Request'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xd896,0xf4));var _0x6d89=function(_0x5c80a9,_0x484c69){_0x5c80a9=_0x5c80a9-0x0;var _0x3fc2b2=_0xd896[_0x5c80a9];return _0x3fc2b2;};'use strict';var client=require(_0x6d89('0x0'));exports['create']=function(_0x237f12){return client[_0x6d89('0x1')](_0x6d89('0x2'),{'body':_0x237f12,'log':_0x6d89('0x2')});}; \ No newline at end of file +var _0x1b11=['../client','Request','CreateVoiceDialReport'];(function(_0x5d6de9,_0x29cccd){var _0x38f60d=function(_0x1aa7ea){while(--_0x1aa7ea){_0x5d6de9['push'](_0x5d6de9['shift']());}};_0x38f60d(++_0x29cccd);}(_0x1b11,0xc9));var _0x11b1=function(_0x16cb48,_0x247838){_0x16cb48=_0x16cb48-0x0;var _0x205c7c=_0x1b11[_0x16cb48];return _0x205c7c;};'use strict';var client=require(_0x11b1('0x0'));exports['create']=function(_0x4afc9c){return client[_0x11b1('0x1')](_0x11b1('0x2'),{'body':_0x4afc9c,'log':_0x11b1('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 4c6ea4f..53faae9 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 _0x22fb=['recordingFormat','getVoiceExtensions','Request','exten'];(function(_0x1e5303,_0x36c0f0){var _0xd1556b=function(_0x1b959e){while(--_0x1b959e){_0x1e5303['push'](_0x1e5303['shift']());}};_0xd1556b(++_0x36c0f0);}(_0x22fb,0x192));var _0xb22f=function(_0x3e67fc,_0x3c2ea9){_0x3e67fc=_0x3e67fc-0x0;var _0x4023fa=_0x22fb[_0x3e67fc];return _0x4023fa;};'use strict';var client=require('../client');exports['getVoiceExtensions']=function(){return function(){return client[_0xb22f('0x0')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0xb22f('0x1'),_0xb22f('0x2')],'where':{'VoiceExtensionId':null}},'log':_0xb22f('0x3')});};}; \ No newline at end of file +var _0xc686=['getVoiceExtensions','Request','exten'];(function(_0x36d9d7,_0x354658){var _0x528de9=function(_0x123896){while(--_0x123896){_0x36d9d7['push'](_0x36d9d7['shift']());}};_0x528de9(++_0x354658);}(_0xc686,0x148));var _0x6c68=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0xc686[_0x33032e];return _0x13316b;};'use strict';var client=require('../client');exports['getVoiceExtensions']=function(){return function(){return client[_0x6c68('0x0')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0x6c68('0x1'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0x6c68('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 952f80c..d4f2e18 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 _0xb2ce=['dialOriginateTimeout','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupClient','dialQueueProject2','monitor_format','strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','name','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','getVoiceQueues','Request','acw','acwTimeout','autopause','dialActive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber'];(function(_0xc5707b,_0x78312d){var _0x407939=function(_0x8a8056){while(--_0x8a8056){_0xc5707b['push'](_0xc5707b['shift']());}};_0x407939(++_0x78312d);}(_0xb2ce,0x77));var _0xeb2c=function(_0x64db82,_0xaf1365){_0x64db82=_0x64db82-0x0;var _0x18d5fa=_0xb2ce[_0x64db82];return _0x18d5fa;};'use strict';var client=require('../client');exports[_0xeb2c('0x0')]=function(){return function(){return client[_0xeb2c('0x1')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id','name',_0xeb2c('0x2'),_0xeb2c('0x3'),_0xeb2c('0x4'),'monitor_format','type',_0xeb2c('0x5'),'dialMethod',_0xeb2c('0x6'),_0xeb2c('0x7'),_0xeb2c('0x8'),_0xeb2c('0x9'),'dialPredictiveOptimizationPercentage',_0xeb2c('0xa'),_0xeb2c('0xb'),_0xeb2c('0xc'),_0xeb2c('0xd'),'dialQueueOptions',_0xeb2c('0xe'),_0xeb2c('0xf'),_0xeb2c('0x10'),'dialCongestionRetryFrequency',_0xeb2c('0x11'),_0xeb2c('0x12'),_0xeb2c('0x13'),_0xeb2c('0x14'),_0xeb2c('0x15'),_0xeb2c('0x16'),_0xeb2c('0x17'),_0xeb2c('0x18'),_0xeb2c('0x19'),_0xeb2c('0x1a'),_0xeb2c('0x1b'),'dialAMDGreeting',_0xeb2c('0x1c'),_0xeb2c('0x1d'),_0xeb2c('0x1e'),_0xeb2c('0x1f'),_0xeb2c('0x20'),_0xeb2c('0x21'),_0xeb2c('0x22'),_0xeb2c('0x23'),_0xeb2c('0x24'),_0xeb2c('0x25'),_0xeb2c('0x26'),'dialAgiAfterHangupAgent',_0xeb2c('0x27'),_0xeb2c('0x28'),_0xeb2c('0x29'),_0xeb2c('0x2a'),_0xeb2c('0x2b'),'dialCutDigit',_0xeb2c('0x2c'),'dialNoSuchNumberRetryFrequency',_0xeb2c('0x2d'),_0xeb2c('0x2e'),_0xeb2c('0x2f'),_0xeb2c('0x30'),_0xeb2c('0x31'),_0xeb2c('0x32'),_0xeb2c('0x33'),_0xeb2c('0x34'),_0xeb2c('0x35'),'dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold',_0xeb2c('0x36'),_0xeb2c('0x37')],'include':[{'model':_0xeb2c('0x38'),'as':_0xeb2c('0x38'),'attributes':['id',_0xeb2c('0x39'),_0xeb2c('0x3a'),_0xeb2c('0x3b')]},{'model':_0xeb2c('0x3c'),'as':_0xeb2c('0x3d'),'attributes':['id',_0xeb2c('0x39')]},{'model':'Trunk','as':_0xeb2c('0x3e'),'attributes':['id',_0xeb2c('0x39'),_0xeb2c('0x3a'),'active']},{'model':_0xeb2c('0x3f'),'as':_0xeb2c('0x3f'),'attributes':['id',_0xeb2c('0x39')],'include':[{'model':_0xeb2c('0x3f'),'as':_0xeb2c('0x40'),'attributes':['id','name',_0xeb2c('0x41')]}]}]},'log':_0xeb2c('0x0')});};}; \ No newline at end of file +var _0xd2ba=['dialMachineRetryFrequency','dialAgentRejectMaxRetry','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewRecallmeReminder','Trunk','name','callerid','active','mandatoryDispositionPause','Interval','../client','getVoiceQueues','Request','GetVoiceQueue','acw','acwTimeout','autopause','monitor_format','type','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedRetryFrequency'];(function(_0x379799,_0x4ccf16){var _0x46e431=function(_0x34bd4d){while(--_0x34bd4d){_0x379799['push'](_0x379799['shift']());}};_0x46e431(++_0x4ccf16);}(_0xd2ba,0x108));var _0xad2b=function(_0x1aac09,_0x38ac68){_0x1aac09=_0x1aac09-0x0;var _0xbf1baa=_0xd2ba[_0x1aac09];return _0xbf1baa;};'use strict';var client=require(_0xad2b('0x0'));exports[_0xad2b('0x1')]=function(){return function(){return client[_0xad2b('0x2')](_0xad2b('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xad2b('0x4'),_0xad2b('0x5'),_0xad2b('0x6'),_0xad2b('0x7'),_0xad2b('0x8'),'dialActive',_0xad2b('0x9'),_0xad2b('0xa'),_0xad2b('0xb'),_0xad2b('0xc'),_0xad2b('0xd'),_0xad2b('0xe'),_0xad2b('0xf'),_0xad2b('0x10'),_0xad2b('0x11'),_0xad2b('0x12'),'dialQueueOptions',_0xad2b('0x13'),_0xad2b('0x14'),_0xad2b('0x15'),_0xad2b('0x16'),_0xad2b('0x17'),_0xad2b('0x18'),_0xad2b('0x19'),_0xad2b('0x1a'),_0xad2b('0x1b'),_0xad2b('0x1c'),'dialGlobalInterval',_0xad2b('0x1d'),_0xad2b('0x1e'),_0xad2b('0x1f'),_0xad2b('0x20'),_0xad2b('0x21'),_0xad2b('0x22'),_0xad2b('0x23'),_0xad2b('0x24'),'dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords',_0xad2b('0x25'),_0xad2b('0x26'),_0xad2b('0x27'),'dialRecallMeTimeout',_0xad2b('0x28'),_0xad2b('0x29'),'dialAgiAfterHangupAgent',_0xad2b('0x2a'),_0xad2b('0x2b'),'monitor_format',_0xad2b('0x2c'),_0xad2b('0x2d'),_0xad2b('0x2e'),_0xad2b('0x2f'),_0xad2b('0x30'),_0xad2b('0x31'),'dialDropRetryFrequency','dialAbandonedMaxRetry',_0xad2b('0x32'),'dialMachineMaxRetry',_0xad2b('0x33'),_0xad2b('0x34'),'dialAgentRejectRetryFrequency',_0xad2b('0x35'),_0xad2b('0x36'),_0xad2b('0x37'),'dialPreviewAutoRecallMe',_0xad2b('0x38')],'include':[{'model':_0xad2b('0x39'),'as':_0xad2b('0x39'),'attributes':['id',_0xad2b('0x3a'),_0xad2b('0x3b'),_0xad2b('0x3c')]},{'model':'Pause','as':_0xad2b('0x3d'),'attributes':['id',_0xad2b('0x3a')]},{'model':_0xad2b('0x39'),'as':'TrunkBackup','attributes':['id',_0xad2b('0x3a'),_0xad2b('0x3b'),_0xad2b('0x3c')]},{'model':'Interval','as':_0xad2b('0x3e'),'attributes':['id',_0xad2b('0x3a')],'include':[{'model':'Interval','as':'Intervals','attributes':['id',_0xad2b('0x3a'),'interval']}]}]},'log':_0xad2b('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 4e35ffd..52a7cf0 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(_0xd973a4,_0x2436de){var _0x2c4758=function(_0xd974ee){while(--_0xd974ee){_0xd973a4['push'](_0xd973a4['shift']());}};_0x2c4758(++_0x2436de);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'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(_0x538a45,_0x4b577f){var _0x5e81b0=function(_0x1b8db2){while(--_0x1b8db2){_0x538a45['push'](_0x538a45['shift']());}};_0x5e81b0(++_0x4b577f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'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 dcb3ebc..f7942db 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 _0x1ae2=['../client','getVoiceQueueRtPauses'];(function(_0x29ac98,_0x8bfad3){var _0xf9f323=function(_0x16c8f4){while(--_0x16c8f4){_0x29ac98['push'](_0x29ac98['shift']());}};_0xf9f323(++_0x8bfad3);}(_0x1ae2,0x108));var _0x21ae=function(_0x56f878,_0x4d6fa1){_0x56f878=_0x56f878-0x0;var _0x17f795=_0x1ae2[_0x56f878];return _0x17f795;};'use strict';var client=require(_0x21ae('0x0'));exports[_0x21ae('0x1')]=function(_0x256be9){return function(){return client['Request']('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x256be9,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file +var _0xc662=['Request','getVoiceQueueRtPauses'];(function(_0x719685,_0x8ac629){var _0x4ab6ce=function(_0x5dbe87){while(--_0x5dbe87){_0x719685['push'](_0x719685['shift']());}};_0x4ab6ce(++_0x8ac629);}(_0xc662,0xc7));var _0x2c66=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xc662[_0x54d4fe];return _0x1ab5bb;};'use strict';var client=require('../client');exports[_0x2c66('0x0')]=function(_0x15b4b2){return function(){return client[_0x2c66('0x1')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x15b4b2,'paused':!![]},'raw':!![]},'log':_0x2c66('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index cf88175..3062408 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 _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x29bfdd,_0x40b6d1){var _0x454c51=function(_0x393f07){while(--_0x393f07){_0x29bfdd['push'](_0x29bfdd['shift']());}};_0x454c51(++_0x40b6d1);}(_0x7a54,0x106));var _0x47a5=function(_0x5c535e,_0x1c8e8e){_0x5c535e=_0x5c535e-0x0;var _0x1ff6a0=_0x7a54[_0x5c535e];return _0x1ff6a0;};'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 +var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x538ac2,_0x241e69){var _0x534358=function(_0x565f48){while(--_0x565f48){_0x538ac2['push'](_0x538ac2['shift']());}};_0x534358(++_0x241e69);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'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 diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 8a4b32d..b5b1956 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 _0x67f3=['transferercalleridname','transfererconnectedlinenum','transfereraccountcode','transferercontext','transfererlinkedid','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','attendedTransfer','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinename','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel'];(function(_0x4e648f,_0x4687a6){var _0x1683f8=function(_0x357f9f){while(--_0x357f9f){_0x4e648f['push'](_0x4e648f['shift']());}};_0x1683f8(++_0x4687a6);}(_0x67f3,0x119));var _0x367f=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x67f3[_0x4e676e];return _0x336a3c;};'use strict';var client=require(_0x367f('0x0'));exports[_0x367f('0x1')]={};exports[_0x367f('0x2')]=function(_0x3ee3d3){return client[_0x367f('0x3')](_0x367f('0x4'),{'body':{'result':_0x3ee3d3[_0x367f('0x5')],'transfererchannel':_0x3ee3d3[_0x367f('0x6')],'transferercalleridnum':_0x3ee3d3['transferercalleridnum'],'transferercalleridname':_0x3ee3d3[_0x367f('0x7')],'transfererconnectedlinenum':_0x3ee3d3[_0x367f('0x8')],'transfererconnectedlinename':_0x3ee3d3['transfererconnectedlinename'],'transfereraccountcode':_0x3ee3d3[_0x367f('0x9')],'transferercontext':_0x3ee3d3[_0x367f('0xa')],'transfererexten':_0x3ee3d3['transfererexten'],'transfererlinkedid':_0x3ee3d3[_0x367f('0xb')],'transfereechannel':_0x3ee3d3['transfereechannel'],'transfereecalleridnum':_0x3ee3d3['transfereecalleridnum'],'transfereecalleridname':_0x3ee3d3[_0x367f('0xc')],'transfereeconnectedlinenum':_0x3ee3d3[_0x367f('0xd')],'transfereeconnectedlinename':_0x3ee3d3[_0x367f('0xe')],'transfereeaccountcode':_0x3ee3d3[_0x367f('0xf')],'transfereecontext':_0x3ee3d3[_0x367f('0x10')],'transfereeexten':_0x3ee3d3[_0x367f('0x11')],'transfereelinkedid':_0x3ee3d3[_0x367f('0x12')],'isexternal':_0x3ee3d3[_0x367f('0x13')],'context':_0x3ee3d3[_0x367f('0x14')],'extension':_0x3ee3d3['extension'],'type':'blind'},'log':'CreateVoiceTransferReport'});};exports[_0x367f('0x15')]=function(_0x4fe2db){return client['Request'](_0x367f('0x4'),{'body':{'result':_0x4fe2db[_0x367f('0x5')],'transfererchannel':_0x4fe2db[_0x367f('0x16')],'transferercalleridnum':_0x4fe2db[_0x367f('0x17')],'transferercalleridname':_0x4fe2db['origtransferercalleridname'],'transfererconnectedlinenum':_0x4fe2db['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x4fe2db[_0x367f('0x18')],'transfereraccountcode':_0x4fe2db['origtransfereraccountcode'],'transferercontext':_0x4fe2db['secondtransferercontext'],'transfererexten':_0x4fe2db['secondtransfererexten'],'transfererlinkedid':_0x4fe2db['origtransfererlinkedid'],'transfereechannel':_0x4fe2db[_0x367f('0x19')],'transfereecalleridnum':_0x4fe2db[_0x367f('0x1a')],'transfereecalleridname':_0x4fe2db[_0x367f('0x1b')],'transfereeconnectedlinenum':_0x4fe2db['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x4fe2db[_0x367f('0x1c')],'transfereeaccountcode':_0x4fe2db[_0x367f('0x1d')],'transfereecontext':_0x4fe2db[_0x367f('0x1e')],'transfereeexten':_0x4fe2db[_0x367f('0x1f')],'transfereelinkedid':_0x4fe2db[_0x367f('0x20')],'isexternal':_0x4fe2db[_0x367f('0x13')],'context':_0x4fe2db[_0x367f('0x21')],'extension':_0x4fe2db[_0x367f('0x22')],'type':_0x367f('0x23')},'log':_0x367f('0x4')});}; \ No newline at end of file +var _0x4b72=['secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','origtransferercontext','origtransfererexten','../client','transfers','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','attendedTransfer','Request','origtransfererchannel','secondtransfererconnectedlinename','origtransfereraccountcode'];(function(_0x168401,_0x25eb66){var _0x2e1c62=function(_0x1fe65b){while(--_0x1fe65b){_0x168401['push'](_0x168401['shift']());}};_0x2e1c62(++_0x25eb66);}(_0x4b72,0x1ec));var _0x24b7=function(_0x3d6448,_0x2846ad){_0x3d6448=_0x3d6448-0x0;var _0x22bad5=_0x4b72[_0x3d6448];return _0x22bad5;};'use strict';var client=require(_0x24b7('0x0'));exports[_0x24b7('0x1')]={};exports['blindTransfer']=function(_0x3b0c0b){return client['Request'](_0x24b7('0x2'),{'body':{'result':_0x3b0c0b[_0x24b7('0x3')],'transfererchannel':_0x3b0c0b[_0x24b7('0x4')],'transferercalleridnum':_0x3b0c0b[_0x24b7('0x5')],'transferercalleridname':_0x3b0c0b['transferercalleridname'],'transfererconnectedlinenum':_0x3b0c0b[_0x24b7('0x6')],'transfererconnectedlinename':_0x3b0c0b[_0x24b7('0x7')],'transfereraccountcode':_0x3b0c0b[_0x24b7('0x8')],'transferercontext':_0x3b0c0b[_0x24b7('0x9')],'transfererexten':_0x3b0c0b[_0x24b7('0xa')],'transfererlinkedid':_0x3b0c0b[_0x24b7('0xb')],'transfereechannel':_0x3b0c0b['transfereechannel'],'transfereecalleridnum':_0x3b0c0b[_0x24b7('0xc')],'transfereecalleridname':_0x3b0c0b[_0x24b7('0xd')],'transfereeconnectedlinenum':_0x3b0c0b['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x3b0c0b[_0x24b7('0xe')],'transfereeaccountcode':_0x3b0c0b[_0x24b7('0xf')],'transfereecontext':_0x3b0c0b[_0x24b7('0x10')],'transfereeexten':_0x3b0c0b[_0x24b7('0x11')],'transfereelinkedid':_0x3b0c0b[_0x24b7('0x12')],'isexternal':_0x3b0c0b[_0x24b7('0x13')],'context':_0x3b0c0b[_0x24b7('0x14')],'extension':_0x3b0c0b[_0x24b7('0x15')],'type':_0x24b7('0x16')},'log':_0x24b7('0x2')});};exports[_0x24b7('0x17')]=function(_0x5c1e66){return client[_0x24b7('0x18')](_0x24b7('0x2'),{'body':{'result':_0x5c1e66[_0x24b7('0x3')],'transfererchannel':_0x5c1e66[_0x24b7('0x19')],'transferercalleridnum':_0x5c1e66['origtransferercalleridnum'],'transferercalleridname':_0x5c1e66['origtransferercalleridname'],'transfererconnectedlinenum':_0x5c1e66['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x5c1e66[_0x24b7('0x1a')],'transfereraccountcode':_0x5c1e66[_0x24b7('0x1b')],'transferercontext':_0x5c1e66[_0x24b7('0x1c')],'transfererexten':_0x5c1e66[_0x24b7('0x1d')],'transfererlinkedid':_0x5c1e66[_0x24b7('0x1e')],'transfereechannel':_0x5c1e66[_0x24b7('0x1f')],'transfereecalleridnum':_0x5c1e66[_0x24b7('0x20')],'transfereecalleridname':_0x5c1e66[_0x24b7('0x21')],'transfereeconnectedlinenum':_0x5c1e66['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x5c1e66[_0x24b7('0x22')],'transfereeaccountcode':_0x5c1e66[_0x24b7('0x23')],'transfereecontext':_0x5c1e66[_0x24b7('0x24')],'transfereeexten':_0x5c1e66[_0x24b7('0x25')],'transfereelinkedid':_0x5c1e66['transfertargetlinkedid'],'isexternal':_0x5c1e66['isexternal'],'context':_0x5c1e66[_0x24b7('0x26')],'extension':_0x5c1e66[_0x24b7('0x27')],'type':'attended'},'log':_0x24b7('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 882bcfa..3924eaa 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 _0x39e6=['MixMonitor','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','Channel\x20doesn\x27t\x20exist','StopMixMonitor','destinationchannel','monitors','%s.%s','StopMixMonitor\x20Success','queueChannels','voicequeuechannelhangup','Hangup','context','trunks','outboundChannels','campaigns','event','Event\x20name\x20mandatory','emit','faxAccounts','checkAfterSend','http','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','moment','../../../config/environment','../ami','listen','format','%s/%s','SIP','name','timers','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','ami\x20disconnected','join','pick','keys','action','Action','then','message','catch','username','content','voiceQueues','hasOwnProperty','strategy','available','pTalking','sumHoldTime','talking','total','type','unmanaged','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','omit','undefined','values','channels','voicechannel','validate','map','find','uniqueid','channel','filename','wav'];(function(_0x2823fb,_0x3365ec){var _0x3c6d14=function(_0x1e7ac8){while(--_0x1e7ac8){_0x2823fb['push'](_0x2823fb['shift']());}};_0x3c6d14(++_0x3365ec);}(_0x39e6,0x9e));var _0x639e=function(_0xe97169,_0x5a9357){_0xe97169=_0xe97169-0x0;var _0x46e281=_0x39e6[_0xe97169];return _0x46e281;};'use strict';var _=require(_0x639e('0x0'));var util=require('util');var jayson=require(_0x639e('0x1'));var schema=require('validate');var BPromise=require('bluebird');var moment=require(_0x639e('0x2'));var config=require(_0x639e('0x3'));var properties=require('../properties');var ami=require(_0x639e('0x4'));exports[_0x639e('0x5')]=function(_0x199e72,_0x2935fd,_0x15e5df){return new BPromise(function(_0x320448,_0x3812c0){var _0x21db36={'QueuePause':function(_0x36b11f){return new Promise(function(_0x134eec,_0x29e806){var _0x2fab76=util[_0x639e('0x6')](_0x639e('0x7'),_0x639e('0x8'),_0x36b11f[_0x639e('0x9')]);if(_0x199e72[_0x639e('0xa')]&&_0x199e72[_0x639e('0xa')][_0x2fab76]&&_0x199e72['timers'][_0x2fab76]['timer']){_0x199e72[_0x639e('0xa')][_0x2fab76][_0x639e('0xb')]();}if(_0x199e72[_0x639e('0xc')][_0x2fab76]){_0x199e72[_0x639e('0xc')][_0x2fab76][_0x639e('0xd')]({'statePause':_0x36b11f[_0x639e('0xe')]?!![]:![]});}_0x134eec({'code':0xc8,'message':_0x639e('0xf')});});},'Reload':function(_0x4f3d38){var _0x56d9bb=this;return new Promise(function(_0x3c6a33,_0x3a1693){if(ami[_0x639e('0x10')]()==![]){return _0x3a1693(_0x56d9bb[_0x639e('0x11')](0x1f4,[config[_0x639e('0x12')]['ip'],config[_0x639e('0x12')]['username'],_0x639e('0x13')][_0x639e('0x14')]('\x20')));}_0x4f3d38=_[_0x639e('0x15')](_0x4f3d38,_[_0x639e('0x16')](properties['module']));_0x4f3d38[_0x639e('0x17')]='Reload';return ami[_0x639e('0x18')](_0x4f3d38)[_0x639e('0x19')](function(_0x391957){_0x3c6a33({'code':0xc8,'message':_0x391957[_0x639e('0x1a')]});})[_0x639e('0x1b')](function(_0x1c023e){_0x3a1693(_0x56d9bb['error'](0x1f5,_0x1c023e[_0x639e('0x1a')]));});});},'Command':function(_0x34baca){var _0x36f71d=this;return new Promise(function(_0x1da55e,_0x59f772){if(ami[_0x639e('0x10')]()==![]){return _0x59f772(_0x36f71d[_0x639e('0x11')](0x1f4,[config[_0x639e('0x12')]['ip'],config[_0x639e('0x12')][_0x639e('0x1c')],'ami\x20disconnected'][_0x639e('0x14')]('\x20')));}_0x34baca=_[_0x639e('0x15')](_0x34baca,'command');_0x34baca[_0x639e('0x17')]='Command';return ami['Action'](_0x34baca)[_0x639e('0x19')](function(_0x3813f6){_0x1da55e({'code':0xc8,'message':_0x3813f6[_0x639e('0x1d')]});})[_0x639e('0x1b')](function(_0x211fcb){_0x59f772(_0x36f71d['error'](0x1f5,_0x211fcb[_0x639e('0x1a')]));});});},'VoiceQueues':function(_0x3647d9){return new Promise(function(_0x39b44f,_0x2da264){var _0x2df4d1=[];for(var _0x5f27f6 in _0x199e72[_0x639e('0x1e')]){if(_0x199e72[_0x639e('0x1e')][_0x639e('0x1f')](_0x5f27f6)){var _0x10abb0=_0x199e72['voiceQueues'][_0x5f27f6];var _0x2ae3b7={'id':_0x10abb0['id'],'name':_0x10abb0[_0x639e('0x9')],'strategy':_0x10abb0[_0x639e('0x20')],'answered':_0x10abb0['answered'],'available':_0x10abb0[_0x639e('0x21')],'loggedIn':_0x10abb0['loggedIn'],'pTalking':_0x10abb0[_0x639e('0x22')],'sumBillable':_0x10abb0['sumBillable'],'sumDuration':_0x10abb0['sumDuration'],'sumHoldTime':_0x10abb0[_0x639e('0x23')]||0x0,'talking':_0x10abb0[_0x639e('0x24')],'total':_0x10abb0[_0x639e('0x25')],'type':_0x10abb0[_0x639e('0x26')],'unmanaged':_0x10abb0[_0x639e('0x27')],'abandoned':_0x10abb0[_0x639e('0x28')],'waiting':_0x10abb0['waiting'],'loggedInDb':_0x10abb0[_0x639e('0x29')]};if(_0x10abb0[_0x639e('0x26')]==='outbound'){_0x2ae3b7['dialActive']=_0x10abb0[_0x639e('0x2a')];_0x2ae3b7[_0x639e('0x2b')]=_0x10abb0[_0x639e('0x2b')];_0x2ae3b7['dialOriginateCallerIdName']=_0x10abb0[_0x639e('0x2c')];_0x2ae3b7['dialOriginateCallerIdNumber']=_0x10abb0[_0x639e('0x2d')];_0x2ae3b7[_0x639e('0x2e')]=_0x10abb0[_0x639e('0x2e')];_0x2ae3b7['dialPrefix']=_0x10abb0[_0x639e('0x2f')];_0x2ae3b7['temp']=_0x10abb0[_0x639e('0x30')];_0x2ae3b7[_0x639e('0x31')]=_0x10abb0[_0x639e('0x31')];_0x2ae3b7['outboundAnswerCallsDay']=_0x10abb0[_0x639e('0x32')];_0x2ae3b7[_0x639e('0x33')]=_0x10abb0[_0x639e('0x33')];_0x2ae3b7['outboundBusyCallsDay']=_0x10abb0[_0x639e('0x34')];_0x2ae3b7['outboundCongestionCallsDay']=_0x10abb0[_0x639e('0x35')];_0x2ae3b7[_0x639e('0x36')]=_0x10abb0[_0x639e('0x36')];_0x2ae3b7[_0x639e('0x37')]=_0x10abb0[_0x639e('0x37')];_0x2ae3b7['outboundDropCallsDayTimeout']=_0x10abb0[_0x639e('0x38')];_0x2ae3b7[_0x639e('0x39')]=_0x10abb0[_0x639e('0x39')];_0x2ae3b7[_0x639e('0x3a')]=_0x10abb0['outboundNoSuchCallsDay'];_0x2ae3b7[_0x639e('0x3b')]=_0x10abb0[_0x639e('0x3b')];_0x2ae3b7[_0x639e('0x3c')]=_0x10abb0['outboundReCallsDay'];_0x2ae3b7[_0x639e('0x3d')]=_0x10abb0['outboundRejectCallsDay'];_0x2ae3b7[_0x639e('0x3e')]=_0x10abb0[_0x639e('0x3e')];_0x2ae3b7[_0x639e('0x3f')]=_0x10abb0[_0x639e('0x3f')];_0x2ae3b7[_0x639e('0x40')]=_0x10abb0[_0x639e('0x40')];_0x2ae3b7['predictiveIntervalAvgTalktime']=_0x10abb0[_0x639e('0x41')];_0x2ae3b7[_0x639e('0x42')]=_0x10abb0['predictiveIntervalDroppedCallsCallersExit'];_0x2ae3b7[_0x639e('0x43')]=_0x10abb0['predictiveIntervalDroppedCallsTimeout'];_0x2ae3b7[_0x639e('0x44')]=_0x10abb0[_0x639e('0x44')];_0x2ae3b7[_0x639e('0x45')]=_0x10abb0[_0x639e('0x45')];_0x2ae3b7[_0x639e('0x46')]=_0x10abb0[_0x639e('0x46')];_0x2ae3b7[_0x639e('0x47')]=_0x10abb0[_0x639e('0x47')];_0x2ae3b7['predictiveIntervalPauses']=_0x10abb0['predictiveIntervalPauses'];_0x2ae3b7['predictiveIntervalAvailable']=_0x10abb0['predictiveIntervalAvailable'];_0x2ae3b7[_0x639e('0x48')]=_0x10abb0[_0x639e('0x48')];_0x2ae3b7['message']=_0x10abb0[_0x639e('0x1a')];_0x2ae3b7[_0x639e('0x49')]=_0x10abb0[_0x639e('0x49')];_0x2ae3b7['erlangCalls']=_0x10abb0[_0x639e('0x4a')];_0x2ae3b7[_0x639e('0x4b')]=_0x10abb0[_0x639e('0x4b')];_0x2ae3b7[_0x639e('0x4c')]=_0x10abb0[_0x639e('0x4c')];_0x2ae3b7[_0x639e('0x4d')]=_0x10abb0[_0x639e('0x4d')];_0x2ae3b7[_0x639e('0x4e')]=_0x10abb0[_0x639e('0x4e')];_0x2ae3b7['startProgressive']=_0x10abb0[_0x639e('0x4f')];}if(_0x10abb0[_0x639e('0x50')]){_0x2ae3b7[_0x639e('0x50')]={'id':_0x10abb0[_0x639e('0x50')]['id'],'name':_0x10abb0[_0x639e('0x50')][_0x639e('0x9')],'active':_0x10abb0['Trunk'][_0x639e('0x51')],'callerid':_0x10abb0[_0x639e('0x50')][_0x639e('0x52')]};}if(_0x10abb0[_0x639e('0x53')]){_0x2ae3b7[_0x639e('0x53')]={'id':_0x10abb0[_0x639e('0x53')]['id'],'name':_0x10abb0[_0x639e('0x53')][_0x639e('0x9')]};}_0x2df4d1[_0x639e('0x54')](_0x2ae3b7);}}_0x39b44f({'count':_0x2df4d1[_0x639e('0x55')],'rows':_0x2df4d1});});},'UpdateVoiceQueue':function(_0x2c504e){return new Promise(function(_0x2a679c,_0x4e01f1){var _0xe25497=_['find'](_0x199e72['voiceQueues'],{'id':parseInt(_0x2c504e['id'])});var _0x261d6a=_[_0x639e('0x56')](_0x2c504e,['id']);if(_0xe25497){for(var _0x44a3e5 in _0x261d6a){if(typeof _0x261d6a[_0x44a3e5]!==_0x639e('0x57')&&typeof _0xe25497[_0x44a3e5]!==_0x639e('0x57')){_0xe25497[_0x44a3e5]=_0x261d6a[_0x44a3e5];}}_0x2a679c(_0xe25497);}else{_0x4e01f1();}});},'VoiceChannels':function(_0x5b27b6){return new Promise(function(_0x2b0dbb,_0x1fa830){var _0x56ecea=_[_0x639e('0x58')](_0x199e72[_0x639e('0x59')]);_0x2b0dbb({'count':_0x56ecea[_0x639e('0x55')],'rows':_0x56ecea});});},'VoiceChannelMixMonitor':function(_0x4c5899){var _0x12e146=this;return new Promise(function(_0x1d9fc5,_0x32add6){if(ami[_0x639e('0x10')]()==![]){return _0x32add6(_0x12e146['error'](0x1f4,[config[_0x639e('0x12')]['ip'],config['asterisk'][_0x639e('0x1c')],'ami\x20disconnected'][_0x639e('0x14')]('\x20')));}var _0x413ebd=schema(properties[_0x639e('0x5a')])[_0x639e('0x5b')](_0x4c5899);if(_0x413ebd[_0x639e('0x55')]>0x0){return _0x32add6(_0x12e146['error'](0x1f4,_[_0x639e('0x5c')](_0x413ebd,_0x639e('0x1a'))[_0x639e('0x14')](',\x20')));}var _0x4dab80=_[_0x639e('0x5d')](_0x199e72[_0x639e('0x59')],{'uniqueid':_0x4c5899[_0x639e('0x5e')]});if(_0x4dab80&&_0x4dab80[_0x639e('0x5f')]){var _0x5292ef=util[_0x639e('0x6')]('%s.%s',_0x4c5899[_0x639e('0x60')]||_0x4c5899[_0x639e('0x5e')],_0x4c5899[_0x639e('0x6')]||_0x639e('0x61'));return ami['Action']({'action':_0x639e('0x62'),'channel':_0x4dab80['channel'],'file':_0x5292ef,'options':'ai(mixmonitorid)'})[_0x639e('0x19')](function(_0x1e9278){var _0x1daeea=_[_0x639e('0x5d')](_0x4dab80['monitors'],{'filename':_0x639e('0x63')+_0x5292ef[_0x639e('0x64')]()});if(_[_0x639e('0x65')](_0x1daeea)){_0x4dab80['monitors'][_0x639e('0x54')]({'filename':_0x639e('0x63')+_0x5292ef[_0x639e('0x64')](),'createdAt':moment()[_0x639e('0x6')](_0x639e('0x66')),'mixmonitorid':_0x1e9278[_0x639e('0x67')],'status':_0x639e('0x68')});}else{_0x1daeea['mixmonitorid']=_0x1e9278[_0x639e('0x67')];_0x1daeea[_0x639e('0x69')]=_0x639e('0x68');}_0x1d9fc5({'code':0xc8,'message':[_0x4c5899[_0x639e('0x5e')],'MixMonitor\x20Success',_0x1e9278[_0x639e('0x67')]][_0x639e('0x14')]('\x20'),'mixmonitorid':_0x1e9278[_0x639e('0x67')]});})['catch'](function(_0x4ecd7e){_0x32add6(_0x12e146['error'](0x1f5,[_0x4c5899[_0x639e('0x5e')],_0x4ecd7e[_0x639e('0x1a')]['toLowerCase']()][_0x639e('0x14')]('\x20')));});}else{return _0x32add6(_0x12e146[_0x639e('0x11')](0x1f5,_0x639e('0x6a')));}});},'VoiceChannelStopMixMonitor':function(_0x29314a){var _0x3d116a=this;return new Promise(function(_0x5bab36,_0x427f11){if(ami[_0x639e('0x10')]()==![]){return _0x427f11(_0x3d116a['error'](0x1f4,[config[_0x639e('0x12')]['ip'],config[_0x639e('0x12')]['username'],'ami\x20disconnected'][_0x639e('0x14')]('\x20')));}var _0x549d44=schema(properties[_0x639e('0x5a')])[_0x639e('0x5b')](_0x29314a);if(_0x549d44[_0x639e('0x55')]>0x0){return _0x427f11(_0x3d116a['error'](0x1f4,_[_0x639e('0x5c')](_0x549d44,_0x639e('0x1a'))[_0x639e('0x14')](',\x20')));}var _0x3b8401=_['find'](_0x199e72[_0x639e('0x59')],{'uniqueid':_0x29314a[_0x639e('0x5e')]});if(_0x3b8401){return BPromise['resolve']()[_0x639e('0x19')](function(){if(_0x3b8401[_0x639e('0x5f')]){return ami[_0x639e('0x18')]({'action':_0x639e('0x6b'),'channel':_0x3b8401[_0x639e('0x5f')],'mixmonitorid':_0x29314a['mixmonitorid']})[_0x639e('0x1b')](function(_0x94fab4){});}})[_0x639e('0x19')](function(){if(_0x3b8401[_0x639e('0x6c')]){return ami[_0x639e('0x18')]({'action':_0x639e('0x6b'),'channel':_0x3b8401[_0x639e('0x6c')],'mixmonitorid':_0x29314a[_0x639e('0x67')]})[_0x639e('0x1b')](function(_0x22fca7){});}})['then'](function(_0x5982a0){var _0xdeb345=_[_0x639e('0x5d')](_0x3b8401[_0x639e('0x6d')],{'mixmonitorid':_0x29314a[_0x639e('0x67')]});if(_0xdeb345){_0xdeb345[_0x639e('0x69')]='stop';}})[_0x639e('0x19')](function(){var _0x48fc0e=util[_0x639e('0x6')](_0x639e('0x6e'),_0x29314a[_0x639e('0x60')]||_0x29314a['uniqueid'],_0x29314a['format']||_0x639e('0x61'));var _0x2a5ca9=_[_0x639e('0x5d')](_0x3b8401['monitors'],{'filename':'/var/spool/asterisk/monitor/'+_0x48fc0e[_0x639e('0x64')]()});if(_0x2a5ca9){_0x2a5ca9[_0x639e('0x69')]='stop';}})[_0x639e('0x19')](function(){_0x5bab36({'code':0xc8,'message':[_0x29314a[_0x639e('0x5e')],_0x639e('0x6f')][_0x639e('0x14')]('\x20')});})['catch'](function(_0x476d46){_0x427f11(_0x3d116a[_0x639e('0x11')](0x1f5,[_0x29314a[_0x639e('0x5e')],_0x476d46[_0x639e('0x1a')]['toLowerCase']()][_0x639e('0x14')]('\x20')));});}else{return _0x427f11(_0x3d116a[_0x639e('0x11')](0x1f5,_0x639e('0x6a')));}});},'VoiceQueuesChannels':function(_0x3c945c){return new Promise(function(_0x806962,_0x4d7e98){var _0x207e2c=_[_0x639e('0x58')](_0x199e72[_0x639e('0x70')]);_0x806962({'count':_0x207e2c[_0x639e('0x55')],'rows':_0x207e2c});});},'VoiceQueuesChannel':function(_0x2aa53b){var _0x250046=this;return new Promise(function(_0x606061,_0x31a209){var _0x3a87e3=schema(properties['voicequeuechannel'])[_0x639e('0x5b')](_0x2aa53b);if(_0x3a87e3[_0x639e('0x55')]>0x0){return _0x31a209(_0x250046[_0x639e('0x11')](0x1f4,_[_0x639e('0x5c')](_0x3a87e3,_0x639e('0x1a'))['join'](',\x20')));}var _0x5c265c=_[_0x639e('0x5d')](_0x199e72['queueChannels'],{'uniqueid':_0x2aa53b[_0x639e('0x5e')]});if(_0x5c265c){_0x606061(_0x5c265c);}else{return _0x31a209(_0x250046[_0x639e('0x11')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x27517f){var _0xbe7032=this;return new Promise(function(_0x821ac7,_0x3f347b){if(ami['isConnected']()==![]){return _0x3f347b(_0xbe7032[_0x639e('0x11')](0x1f4,[config[_0x639e('0x12')]['ip'],config[_0x639e('0x12')][_0x639e('0x1c')],'ami\x20disconnected'][_0x639e('0x14')]('\x20')));}var _0x5f324b=schema(properties[_0x639e('0x71')])[_0x639e('0x5b')](_0x27517f);if(_0x5f324b[_0x639e('0x55')]>0x0){return _0x3f347b(_0xbe7032['error'](0x1f4,_[_0x639e('0x5c')](_0x5f324b,_0x639e('0x1a'))[_0x639e('0x14')](',\x20')));}var _0x2d0ef5=_[_0x639e('0x5d')](_0x199e72['queueChannels'],{'uniqueid':_0x27517f['uniqueid']});if(_0x2d0ef5&&_0x2d0ef5[_0x639e('0x5f')]){return ami[_0x639e('0x18')]({'action':_0x639e('0x72'),'channel':_0x2d0ef5[_0x639e('0x5f')]})[_0x639e('0x19')](function(_0x4d2b66){_0x821ac7({'code':0xc8,'message':[_0x27517f[_0x639e('0x5e')],_0x4d2b66[_0x639e('0x1a')][_0x639e('0x64')]()][_0x639e('0x14')]('\x20')});})[_0x639e('0x1b')](function(_0x433bb6){_0x3f347b(_0xbe7032[_0x639e('0x11')](0x1f5,[_0x27517f[_0x639e('0x5e')],_0x433bb6['message']['toLowerCase']()]['join']('\x20')));});}else{return _0x3f347b(_0xbe7032[_0x639e('0x11')](0x1f5,_0x639e('0x6a')));}});},'VoiceQueuesChannelRedirect':function(_0x413fb5){var _0x13e28d=this;return new Promise(function(_0x2a2e9b,_0x3c9ac4){if(ami[_0x639e('0x10')]()==![]){return _0x3c9ac4(_0x13e28d['error'](0x1f4,[config[_0x639e('0x12')]['ip'],config['asterisk'][_0x639e('0x1c')],_0x639e('0x13')][_0x639e('0x14')]('\x20')));}var _0x457f21=schema(properties['voicequeuechannelredirect'])[_0x639e('0x5b')](_0x413fb5);if(_0x457f21[_0x639e('0x55')]>0x0){return _0x3c9ac4(_0x13e28d[_0x639e('0x11')](0x1f4,_[_0x639e('0x5c')](_0x457f21,'message')[_0x639e('0x14')](',\x20')));}var _0xd66e73=_[_0x639e('0x5d')](_0x199e72[_0x639e('0x70')],{'uniqueid':_0x413fb5['uniqueid']});if(_0xd66e73&&_0xd66e73[_0x639e('0x5f')]){return ami[_0x639e('0x18')]({'action':'Redirect','channel':_0xd66e73[_0x639e('0x5f')],'exten':_0x413fb5['exten'],'context':_0x413fb5[_0x639e('0x73')]||_0xd66e73[_0x639e('0x73')],'priority':0x1})[_0x639e('0x19')](function(_0x2b2799){_0x2a2e9b({'code':0xc8,'message':[_0x413fb5[_0x639e('0x5e')],_0x2b2799['message'][_0x639e('0x64')]()][_0x639e('0x14')]('\x20')});})[_0x639e('0x1b')](function(_0x5495d5){_0x3c9ac4(_0x13e28d[_0x639e('0x11')](0x1f5,[_0x413fb5[_0x639e('0x5e')],_0x5495d5[_0x639e('0x1a')]['toLowerCase']()][_0x639e('0x14')]('\x20')));});}else{return _0x3c9ac4(_0x13e28d[_0x639e('0x11')](0x1f5,_0x639e('0x6a')));}});},'Agents':function(_0x1839ae){return new Promise(function(_0x351459,_0x31facd){var _0x2669a3=_[_0x639e('0x58')](_0x199e72[_0x639e('0xc')]);_0x351459({'count':_0x2669a3[_0x639e('0x55')],'rows':_0x2669a3});});},'Telephones':function(_0x3a90e2){return new Promise(function(_0x101230,_0x34183e){var _0x498ced=_[_0x639e('0x58')](_0x199e72['telephones']);_0x101230({'count':_0x498ced[_0x639e('0x55')],'rows':_0x498ced});});},'Trunks':function(_0x25faba){return new Promise(function(_0x91c03,_0x40625b){var _0x2d5f67=_['values'](_0x199e72[_0x639e('0x74')]);_0x91c03({'count':_0x2d5f67[_0x639e('0x55')],'rows':_0x2d5f67});});},'OutboundChannels':function(_0x38d5d4){return new Promise(function(_0x2cd5c6,_0x452085){var _0x1c14a3=_[_0x639e('0x58')](_0x199e72[_0x639e('0x75')]);_0x2cd5c6({'count':_0x1c14a3[_0x639e('0x55')],'rows':_0x1c14a3});});},'Outbound':function(_0x3d2a25){return new Promise(function(_0x28e379,_0x59b26e){_0x28e379(_0x199e72['outbound']);});},'Campaigns':function(_0x284de7){return new Promise(function(_0x1e8927,_0x2146fe){var _0x4ce384=_[_0x639e('0x58')](_0x199e72[_0x639e('0x76')]);_0x1e8927({'count':_0x4ce384[_0x639e('0x55')],'rows':_0x4ce384});});},'VoiceQueuesPreview':function(_0x516e7f){var _0xe9bfb9=this;return new Promise(function(_0x33d71e,_0x1664fd){_0x2935fd['run'](_0x516e7f['id'])[_0x639e('0x19')](function(_0x66f38a){_0x33d71e({'code':0xc8,'message':_0x66f38a[_0x639e('0x1a')]});})[_0x639e('0x1b')](function(_0x30911e){_0x1664fd(_0xe9bfb9[_0x639e('0x11')](0x1f4,_0x30911e[_0x639e('0x1a')]));});});},'EventManager':function(_0x167ec3){var _0x581d53=this;return new Promise(function(_0xfa5b9,_0x53cbcc){if(!_0x167ec3[_0x639e('0x77')]){return _0x53cbcc(_0x581d53[_0x639e('0x11')](0x1f4,_0x639e('0x78')));}ami[_0x639e('0x79')]('custom:'+_0x167ec3[_0x639e('0x77')],_0x167ec3[_0x639e('0x1a')]);_0xfa5b9({'code':0xc8,'message':_0x167ec3});});},'FaxAccounts':function(_0x56b313){return new Promise(function(_0x47bf07,_0xedca5f){var _0x24d1b3=_[_0x639e('0x58')](_0x199e72[_0x639e('0x7a')]);_0x47bf07({'count':_0x24d1b3[_0x639e('0x55')],'rows':_0x24d1b3});});},'SendFax':function(_0x195b09){var _0x1b53b2=this;return new Promise(function(_0x413d4d,_0x4522cc){_0x15e5df['send'](_0x195b09)[_0x639e('0x19')](function(_0x3a51e1){_0x413d4d({'code':0xc8,'message':_0x3a51e1[_0x639e('0x1a')]});})[_0x639e('0x1b')](function(_0x255562){_0x4522cc(_0x1b53b2[_0x639e('0x11')](0x1f4,_0x255562[_0x639e('0x1a')]));});});},'CheckAfterSend':function(_0x4e41a2){var _0x125490=this;return new Promise(function(_0x418264,_0x585f04){_0x15e5df[_0x639e('0x7b')](_0x4e41a2)[_0x639e('0x19')](function(_0x203a59){_0x418264({'code':0xc8,'message':_0x203a59['message']});})['catch'](function(_0x2b83c7){_0x585f04(_0x125490['error'](0x1f4,_0x2b83c7[_0x639e('0x1a')]));});});}};var _0x1d5f57=jayson['server'](_0x21db36)[_0x639e('0x7c')]();_0x1d5f57['on'](_0x639e('0x11'),function(_0x282c08){return _0x3812c0(_0x282c08);});_0x1d5f57[_0x639e('0x5')](0x232a,_0x639e('0x7d'),function(){console['log'](_0x639e('0x7e'),0x232a);return _0x320448(_0x639e('0x7f')+0x232a);});});}; \ No newline at end of file +var _0xbff5=['/var/spool/asterisk/monitor/','isNil','monitors','push','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','stop','status','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','Hangup','voicequeuechannelredirect','Redirect','exten','telephones','trunks','outboundChannels','campaigns','event','Event\x20name\x20mandatory','custom:','faxAccounts','server','http','listen','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','bluebird','moment','../../../config/environment','../ami','%s/%s','name','timers','agents','pause','isConnected','asterisk','username','ami\x20disconnected','pick','keys','module','Reload','Action','then','message','catch','error','join','command','Command','content','voiceQueues','hasOwnProperty','answered','available','pTalking','sumHoldTime','total','type','unmanaged','abandoned','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','callerid','Interval','length','omit','undefined','values','voicechannel','map','find','channels','uniqueid','channel','%s.%s','filename','format','wav','MixMonitor','ai(mixmonitorid)'];(function(_0x3545fc,_0x2b06b1){var _0x470b66=function(_0x10baee){while(--_0x10baee){_0x3545fc['push'](_0x3545fc['shift']());}};_0x470b66(++_0x2b06b1);}(_0xbff5,0x1bc));var _0x5bff=function(_0xb5a8a6,_0x4c8e31){_0xb5a8a6=_0xb5a8a6-0x0;var _0x4c462d=_0xbff5[_0xb5a8a6];return _0x4c462d;};'use strict';var _=require(_0x5bff('0x0'));var util=require(_0x5bff('0x1'));var jayson=require(_0x5bff('0x2'));var schema=require(_0x5bff('0x3'));var BPromise=require(_0x5bff('0x4'));var moment=require(_0x5bff('0x5'));var config=require(_0x5bff('0x6'));var properties=require('../properties');var ami=require(_0x5bff('0x7'));exports['listen']=function(_0x4c567d,_0x16ed7b,_0x1d8650){return new BPromise(function(_0x151add,_0xa54c57){var _0x43605a={'QueuePause':function(_0xd4b9dc){return new Promise(function(_0x1acb49,_0x139c99){var _0x3eb6f9=util['format'](_0x5bff('0x8'),'SIP',_0xd4b9dc[_0x5bff('0x9')]);if(_0x4c567d[_0x5bff('0xa')]&&_0x4c567d['timers'][_0x3eb6f9]&&_0x4c567d[_0x5bff('0xa')][_0x3eb6f9]['timer']){_0x4c567d[_0x5bff('0xa')][_0x3eb6f9]['updateAcw']();}if(_0x4c567d[_0x5bff('0xb')][_0x3eb6f9]){_0x4c567d[_0x5bff('0xb')][_0x3eb6f9]['updateStatusRealtime']({'statePause':_0xd4b9dc[_0x5bff('0xc')]?!![]:![]});}_0x1acb49({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x335e78){var _0x635926=this;return new Promise(function(_0x548128,_0xa0dced){if(ami[_0x5bff('0xd')]()==![]){return _0xa0dced(_0x635926['error'](0x1f4,[config['asterisk']['ip'],config[_0x5bff('0xe')][_0x5bff('0xf')],_0x5bff('0x10')]['join']('\x20')));}_0x335e78=_[_0x5bff('0x11')](_0x335e78,_[_0x5bff('0x12')](properties[_0x5bff('0x13')]));_0x335e78['action']=_0x5bff('0x14');return ami[_0x5bff('0x15')](_0x335e78)[_0x5bff('0x16')](function(_0x546351){_0x548128({'code':0xc8,'message':_0x546351[_0x5bff('0x17')]});})[_0x5bff('0x18')](function(_0x36653b){_0xa0dced(_0x635926[_0x5bff('0x19')](0x1f5,_0x36653b['message']));});});},'Command':function(_0x3065c1){var _0x5357d4=this;return new Promise(function(_0x878040,_0x4d0111){if(ami[_0x5bff('0xd')]()==![]){return _0x4d0111(_0x5357d4[_0x5bff('0x19')](0x1f4,[config[_0x5bff('0xe')]['ip'],config[_0x5bff('0xe')][_0x5bff('0xf')],_0x5bff('0x10')][_0x5bff('0x1a')]('\x20')));}_0x3065c1=_[_0x5bff('0x11')](_0x3065c1,_0x5bff('0x1b'));_0x3065c1['action']=_0x5bff('0x1c');return ami[_0x5bff('0x15')](_0x3065c1)[_0x5bff('0x16')](function(_0x1e7f8a){_0x878040({'code':0xc8,'message':_0x1e7f8a[_0x5bff('0x1d')]});})[_0x5bff('0x18')](function(_0x3913fd){_0x4d0111(_0x5357d4[_0x5bff('0x19')](0x1f5,_0x3913fd['message']));});});},'VoiceQueues':function(_0x5741d9){return new Promise(function(_0x9a69de,_0x53bd97){var _0x220c8f=[];for(var _0xcc091d in _0x4c567d[_0x5bff('0x1e')]){if(_0x4c567d[_0x5bff('0x1e')][_0x5bff('0x1f')](_0xcc091d)){var _0x1140eb=_0x4c567d[_0x5bff('0x1e')][_0xcc091d];var _0xedba9d={'id':_0x1140eb['id'],'name':_0x1140eb['name'],'strategy':_0x1140eb['strategy'],'answered':_0x1140eb[_0x5bff('0x20')],'available':_0x1140eb[_0x5bff('0x21')],'loggedIn':_0x1140eb['loggedIn'],'pTalking':_0x1140eb[_0x5bff('0x22')],'sumBillable':_0x1140eb['sumBillable'],'sumDuration':_0x1140eb['sumDuration'],'sumHoldTime':_0x1140eb[_0x5bff('0x23')]||0x0,'talking':_0x1140eb['talking'],'total':_0x1140eb[_0x5bff('0x24')],'type':_0x1140eb[_0x5bff('0x25')],'unmanaged':_0x1140eb[_0x5bff('0x26')],'abandoned':_0x1140eb[_0x5bff('0x27')],'waiting':_0x1140eb['waiting'],'loggedInDb':_0x1140eb[_0x5bff('0x28')]};if(_0x1140eb['type']===_0x5bff('0x29')){_0xedba9d['dialActive']=_0x1140eb[_0x5bff('0x2a')];_0xedba9d[_0x5bff('0x2b')]=_0x1140eb[_0x5bff('0x2b')];_0xedba9d[_0x5bff('0x2c')]=_0x1140eb[_0x5bff('0x2c')];_0xedba9d[_0x5bff('0x2d')]=_0x1140eb['dialOriginateCallerIdNumber'];_0xedba9d[_0x5bff('0x2e')]=_0x1140eb[_0x5bff('0x2e')];_0xedba9d[_0x5bff('0x2f')]=_0x1140eb[_0x5bff('0x2f')];_0xedba9d[_0x5bff('0x30')]=_0x1140eb[_0x5bff('0x30')];_0xedba9d[_0x5bff('0x31')]=_0x1140eb[_0x5bff('0x31')];_0xedba9d['outboundAnswerCallsDay']=_0x1140eb[_0x5bff('0x32')];_0xedba9d[_0x5bff('0x33')]=_0x1140eb[_0x5bff('0x33')];_0xedba9d[_0x5bff('0x34')]=_0x1140eb['outboundBusyCallsDay'];_0xedba9d[_0x5bff('0x35')]=_0x1140eb[_0x5bff('0x35')];_0xedba9d['outboundDropCallsDayACS']=_0x1140eb[_0x5bff('0x36')];_0xedba9d[_0x5bff('0x37')]=_0x1140eb[_0x5bff('0x37')];_0xedba9d[_0x5bff('0x38')]=_0x1140eb['outboundDropCallsDayTimeout'];_0xedba9d[_0x5bff('0x39')]=_0x1140eb[_0x5bff('0x39')];_0xedba9d[_0x5bff('0x3a')]=_0x1140eb['outboundNoSuchCallsDay'];_0xedba9d[_0x5bff('0x3b')]=_0x1140eb['outboundOriginateFailureCallsDay'];_0xedba9d[_0x5bff('0x3c')]=_0x1140eb[_0x5bff('0x3c')];_0xedba9d[_0x5bff('0x3d')]=_0x1140eb['outboundRejectCallsDay'];_0xedba9d[_0x5bff('0x3e')]=_0x1140eb[_0x5bff('0x3e')];_0xedba9d[_0x5bff('0x3f')]=_0x1140eb['predictiveIntervalAnsweredCalls'];_0xedba9d[_0x5bff('0x40')]=_0x1140eb[_0x5bff('0x40')];_0xedba9d['predictiveIntervalAvgTalktime']=_0x1140eb[_0x5bff('0x41')];_0xedba9d[_0x5bff('0x42')]=_0x1140eb[_0x5bff('0x42')];_0xedba9d[_0x5bff('0x43')]=_0x1140eb[_0x5bff('0x43')];_0xedba9d['predictiveIntervalErlangCalls']=_0x1140eb[_0x5bff('0x44')];_0xedba9d['predictiveIntervalErlangCallsDroppedCalls']=_0x1140eb[_0x5bff('0x45')];_0xedba9d[_0x5bff('0x46')]=_0x1140eb[_0x5bff('0x46')];_0xedba9d[_0x5bff('0x47')]=_0x1140eb[_0x5bff('0x47')];_0xedba9d[_0x5bff('0x48')]=_0x1140eb[_0x5bff('0x48')];_0xedba9d['predictiveIntervalAvailable']=_0x1140eb['predictiveIntervalAvailable'];_0xedba9d[_0x5bff('0x49')]=_0x1140eb[_0x5bff('0x49')];_0xedba9d[_0x5bff('0x17')]=_0x1140eb[_0x5bff('0x17')];_0xedba9d[_0x5bff('0x4a')]=_0x1140eb[_0x5bff('0x4a')];_0xedba9d[_0x5bff('0x4b')]=_0x1140eb[_0x5bff('0x4b')];_0xedba9d['erlangCallToSecond']=_0x1140eb[_0x5bff('0x4c')];_0xedba9d['erlangAbandonmentRate']=_0x1140eb[_0x5bff('0x4d')];_0xedba9d[_0x5bff('0x4e')]=_0x1140eb['erlangBusyFactor'];_0xedba9d[_0x5bff('0x4f')]=_0x1140eb[_0x5bff('0x4f')];_0xedba9d['startProgressive']=_0x1140eb[_0x5bff('0x50')];}if(_0x1140eb[_0x5bff('0x51')]){_0xedba9d[_0x5bff('0x51')]={'id':_0x1140eb['Trunk']['id'],'name':_0x1140eb[_0x5bff('0x51')][_0x5bff('0x9')],'active':_0x1140eb[_0x5bff('0x51')]['active'],'callerid':_0x1140eb[_0x5bff('0x51')][_0x5bff('0x52')]};}if(_0x1140eb[_0x5bff('0x53')]){_0xedba9d[_0x5bff('0x53')]={'id':_0x1140eb['Interval']['id'],'name':_0x1140eb[_0x5bff('0x53')]['name']};}_0x220c8f['push'](_0xedba9d);}}_0x9a69de({'count':_0x220c8f[_0x5bff('0x54')],'rows':_0x220c8f});});},'UpdateVoiceQueue':function(_0x95cf00){return new Promise(function(_0x564bc5,_0x2132bf){var _0xbebf66=_['find'](_0x4c567d[_0x5bff('0x1e')],{'id':parseInt(_0x95cf00['id'])});var _0x3e56c3=_[_0x5bff('0x55')](_0x95cf00,['id']);if(_0xbebf66){for(var _0x39c90f in _0x3e56c3){if(typeof _0x3e56c3[_0x39c90f]!=='undefined'&&typeof _0xbebf66[_0x39c90f]!==_0x5bff('0x56')){_0xbebf66[_0x39c90f]=_0x3e56c3[_0x39c90f];}}_0x564bc5(_0xbebf66);}else{_0x2132bf();}});},'VoiceChannels':function(_0x22f0b6){return new Promise(function(_0x44a34a,_0x738700){var _0x1e94c5=_[_0x5bff('0x57')](_0x4c567d['channels']);_0x44a34a({'count':_0x1e94c5[_0x5bff('0x54')],'rows':_0x1e94c5});});},'VoiceChannelMixMonitor':function(_0x14f4d4){var _0x5d5b1f=this;return new Promise(function(_0x2487f6,_0x5c59c0){if(ami['isConnected']()==![]){return _0x5c59c0(_0x5d5b1f['error'](0x1f4,[config[_0x5bff('0xe')]['ip'],config[_0x5bff('0xe')]['username'],_0x5bff('0x10')][_0x5bff('0x1a')]('\x20')));}var _0x3360d8=schema(properties[_0x5bff('0x58')])[_0x5bff('0x3')](_0x14f4d4);if(_0x3360d8['length']>0x0){return _0x5c59c0(_0x5d5b1f[_0x5bff('0x19')](0x1f4,_[_0x5bff('0x59')](_0x3360d8,'message')[_0x5bff('0x1a')](',\x20')));}var _0x48feaa=_[_0x5bff('0x5a')](_0x4c567d[_0x5bff('0x5b')],{'uniqueid':_0x14f4d4[_0x5bff('0x5c')]});if(_0x48feaa&&_0x48feaa[_0x5bff('0x5d')]){var _0x29f7dc=util['format'](_0x5bff('0x5e'),_0x14f4d4[_0x5bff('0x5f')]||_0x14f4d4['uniqueid'],_0x14f4d4[_0x5bff('0x60')]||_0x5bff('0x61'));return ami['Action']({'action':_0x5bff('0x62'),'channel':_0x48feaa[_0x5bff('0x5d')],'file':_0x29f7dc,'options':_0x5bff('0x63')})[_0x5bff('0x16')](function(_0x24ad0f){var _0x1be6eb=_['find'](_0x48feaa['monitors'],{'filename':_0x5bff('0x64')+_0x29f7dc['toLowerCase']()});if(_[_0x5bff('0x65')](_0x1be6eb)){_0x48feaa[_0x5bff('0x66')][_0x5bff('0x67')]({'filename':_0x5bff('0x64')+_0x29f7dc[_0x5bff('0x68')](),'createdAt':moment()[_0x5bff('0x60')](_0x5bff('0x69')),'mixmonitorid':_0x24ad0f[_0x5bff('0x6a')],'status':_0x5bff('0x6b')});}else{_0x1be6eb[_0x5bff('0x6a')]=_0x24ad0f[_0x5bff('0x6a')];_0x1be6eb['status']='rec';}_0x2487f6({'code':0xc8,'message':[_0x14f4d4[_0x5bff('0x5c')],'MixMonitor\x20Success',_0x24ad0f[_0x5bff('0x6a')]]['join']('\x20'),'mixmonitorid':_0x24ad0f[_0x5bff('0x6a')]});})[_0x5bff('0x18')](function(_0xb20434){_0x5c59c0(_0x5d5b1f[_0x5bff('0x19')](0x1f5,[_0x14f4d4[_0x5bff('0x5c')],_0xb20434[_0x5bff('0x17')][_0x5bff('0x68')]()][_0x5bff('0x1a')]('\x20')));});}else{return _0x5c59c0(_0x5d5b1f[_0x5bff('0x19')](0x1f5,_0x5bff('0x6c')));}});},'VoiceChannelStopMixMonitor':function(_0x1470bc){var _0x57053a=this;return new Promise(function(_0x142854,_0x56eff2){if(ami['isConnected']()==![]){return _0x56eff2(_0x57053a['error'](0x1f4,[config[_0x5bff('0xe')]['ip'],config['asterisk'][_0x5bff('0xf')],_0x5bff('0x10')][_0x5bff('0x1a')]('\x20')));}var _0x3192cb=schema(properties['voicechannel'])['validate'](_0x1470bc);if(_0x3192cb['length']>0x0){return _0x56eff2(_0x57053a[_0x5bff('0x19')](0x1f4,_[_0x5bff('0x59')](_0x3192cb,'message')[_0x5bff('0x1a')](',\x20')));}var _0x3bb787=_[_0x5bff('0x5a')](_0x4c567d[_0x5bff('0x5b')],{'uniqueid':_0x1470bc[_0x5bff('0x5c')]});if(_0x3bb787){return BPromise[_0x5bff('0x6d')]()[_0x5bff('0x16')](function(){if(_0x3bb787[_0x5bff('0x5d')]){return ami[_0x5bff('0x15')]({'action':_0x5bff('0x6e'),'channel':_0x3bb787[_0x5bff('0x5d')],'mixmonitorid':_0x1470bc[_0x5bff('0x6a')]})[_0x5bff('0x18')](function(_0x33464a){});}})['then'](function(){if(_0x3bb787[_0x5bff('0x6f')]){return ami[_0x5bff('0x15')]({'action':_0x5bff('0x6e'),'channel':_0x3bb787[_0x5bff('0x6f')],'mixmonitorid':_0x1470bc[_0x5bff('0x6a')]})[_0x5bff('0x18')](function(_0x24916c){});}})[_0x5bff('0x16')](function(_0x2522bd){var _0x257410=_[_0x5bff('0x5a')](_0x3bb787[_0x5bff('0x66')],{'mixmonitorid':_0x1470bc[_0x5bff('0x6a')]});if(_0x257410){_0x257410['status']=_0x5bff('0x70');}})[_0x5bff('0x16')](function(){var _0x24df6b=util[_0x5bff('0x60')](_0x5bff('0x5e'),_0x1470bc['filename']||_0x1470bc[_0x5bff('0x5c')],_0x1470bc[_0x5bff('0x60')]||'wav');var _0x1b35ae=_[_0x5bff('0x5a')](_0x3bb787[_0x5bff('0x66')],{'filename':'/var/spool/asterisk/monitor/'+_0x24df6b[_0x5bff('0x68')]()});if(_0x1b35ae){_0x1b35ae[_0x5bff('0x71')]=_0x5bff('0x70');}})[_0x5bff('0x16')](function(){_0x142854({'code':0xc8,'message':[_0x1470bc[_0x5bff('0x5c')],_0x5bff('0x72')][_0x5bff('0x1a')]('\x20')});})[_0x5bff('0x18')](function(_0x23f021){_0x56eff2(_0x57053a[_0x5bff('0x19')](0x1f5,[_0x1470bc[_0x5bff('0x5c')],_0x23f021[_0x5bff('0x17')]['toLowerCase']()]['join']('\x20')));});}else{return _0x56eff2(_0x57053a[_0x5bff('0x19')](0x1f5,_0x5bff('0x6c')));}});},'VoiceQueuesChannels':function(_0x1bed0d){return new Promise(function(_0x597eea,_0x26899a){var _0x5cc8ce=_['values'](_0x4c567d[_0x5bff('0x73')]);_0x597eea({'count':_0x5cc8ce['length'],'rows':_0x5cc8ce});});},'VoiceQueuesChannel':function(_0x536fee){var _0x12bb42=this;return new Promise(function(_0x227723,_0x4d6cc5){var _0x29ed8d=schema(properties[_0x5bff('0x74')])[_0x5bff('0x3')](_0x536fee);if(_0x29ed8d[_0x5bff('0x54')]>0x0){return _0x4d6cc5(_0x12bb42[_0x5bff('0x19')](0x1f4,_[_0x5bff('0x59')](_0x29ed8d,_0x5bff('0x17'))[_0x5bff('0x1a')](',\x20')));}var _0x1c3fbf=_[_0x5bff('0x5a')](_0x4c567d[_0x5bff('0x73')],{'uniqueid':_0x536fee[_0x5bff('0x5c')]});if(_0x1c3fbf){_0x227723(_0x1c3fbf);}else{return _0x4d6cc5(_0x12bb42[_0x5bff('0x19')](0x1f5,_0x5bff('0x6c')));}});},'VoiceQueuesChannelHangup':function(_0x16d5d4){var _0x8851=this;return new Promise(function(_0x39bc4e,_0x1df78d){if(ami[_0x5bff('0xd')]()==![]){return _0x1df78d(_0x8851[_0x5bff('0x19')](0x1f4,[config[_0x5bff('0xe')]['ip'],config['asterisk'][_0x5bff('0xf')],_0x5bff('0x10')]['join']('\x20')));}var _0x29d02a=schema(properties['voicequeuechannelhangup'])[_0x5bff('0x3')](_0x16d5d4);if(_0x29d02a[_0x5bff('0x54')]>0x0){return _0x1df78d(_0x8851['error'](0x1f4,_[_0x5bff('0x59')](_0x29d02a,_0x5bff('0x17'))[_0x5bff('0x1a')](',\x20')));}var _0x341d5a=_[_0x5bff('0x5a')](_0x4c567d[_0x5bff('0x73')],{'uniqueid':_0x16d5d4[_0x5bff('0x5c')]});if(_0x341d5a&&_0x341d5a[_0x5bff('0x5d')]){return ami[_0x5bff('0x15')]({'action':_0x5bff('0x75'),'channel':_0x341d5a[_0x5bff('0x5d')]})['then'](function(_0x20bc69){_0x39bc4e({'code':0xc8,'message':[_0x16d5d4[_0x5bff('0x5c')],_0x20bc69['message'][_0x5bff('0x68')]()][_0x5bff('0x1a')]('\x20')});})[_0x5bff('0x18')](function(_0x49d3db){_0x1df78d(_0x8851[_0x5bff('0x19')](0x1f5,[_0x16d5d4[_0x5bff('0x5c')],_0x49d3db[_0x5bff('0x17')][_0x5bff('0x68')]()]['join']('\x20')));});}else{return _0x1df78d(_0x8851['error'](0x1f5,_0x5bff('0x6c')));}});},'VoiceQueuesChannelRedirect':function(_0x59e996){var _0xd9f5e5=this;return new Promise(function(_0x40bd5d,_0x3834c8){if(ami['isConnected']()==![]){return _0x3834c8(_0xd9f5e5[_0x5bff('0x19')](0x1f4,[config[_0x5bff('0xe')]['ip'],config[_0x5bff('0xe')][_0x5bff('0xf')],_0x5bff('0x10')][_0x5bff('0x1a')]('\x20')));}var _0x4b40c5=schema(properties[_0x5bff('0x76')])[_0x5bff('0x3')](_0x59e996);if(_0x4b40c5[_0x5bff('0x54')]>0x0){return _0x3834c8(_0xd9f5e5[_0x5bff('0x19')](0x1f4,_['map'](_0x4b40c5,_0x5bff('0x17'))['join'](',\x20')));}var _0x14f5c0=_[_0x5bff('0x5a')](_0x4c567d[_0x5bff('0x73')],{'uniqueid':_0x59e996[_0x5bff('0x5c')]});if(_0x14f5c0&&_0x14f5c0[_0x5bff('0x5d')]){return ami[_0x5bff('0x15')]({'action':_0x5bff('0x77'),'channel':_0x14f5c0['channel'],'exten':_0x59e996[_0x5bff('0x78')],'context':_0x59e996['context']||_0x14f5c0['context'],'priority':0x1})[_0x5bff('0x16')](function(_0x377bc7){_0x40bd5d({'code':0xc8,'message':[_0x59e996['uniqueid'],_0x377bc7['message'][_0x5bff('0x68')]()][_0x5bff('0x1a')]('\x20')});})[_0x5bff('0x18')](function(_0xe95398){_0x3834c8(_0xd9f5e5['error'](0x1f5,[_0x59e996[_0x5bff('0x5c')],_0xe95398['message'][_0x5bff('0x68')]()][_0x5bff('0x1a')]('\x20')));});}else{return _0x3834c8(_0xd9f5e5[_0x5bff('0x19')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x2e8cb2){return new Promise(function(_0x5a5e97,_0x382be1){var _0x406c7c=_[_0x5bff('0x57')](_0x4c567d['agents']);_0x5a5e97({'count':_0x406c7c['length'],'rows':_0x406c7c});});},'Telephones':function(_0x28aee9){return new Promise(function(_0x3b0bb1,_0x2b8ec5){var _0x2bfdbc=_[_0x5bff('0x57')](_0x4c567d[_0x5bff('0x79')]);_0x3b0bb1({'count':_0x2bfdbc[_0x5bff('0x54')],'rows':_0x2bfdbc});});},'Trunks':function(_0x315aba){return new Promise(function(_0x1b6a75,_0x59efd7){var _0x435076=_[_0x5bff('0x57')](_0x4c567d[_0x5bff('0x7a')]);_0x1b6a75({'count':_0x435076['length'],'rows':_0x435076});});},'OutboundChannels':function(_0x5877a0){return new Promise(function(_0x2bba31,_0xd30d2f){var _0x4b216f=_['values'](_0x4c567d[_0x5bff('0x7b')]);_0x2bba31({'count':_0x4b216f['length'],'rows':_0x4b216f});});},'Outbound':function(_0x391b56){return new Promise(function(_0xc0fcc2,_0x2efdb9){_0xc0fcc2(_0x4c567d[_0x5bff('0x29')]);});},'Campaigns':function(_0x5804f2){return new Promise(function(_0x7f29e1,_0x574d38){var _0x155bf3=_[_0x5bff('0x57')](_0x4c567d[_0x5bff('0x7c')]);_0x7f29e1({'count':_0x155bf3[_0x5bff('0x54')],'rows':_0x155bf3});});},'VoiceQueuesPreview':function(_0x63b716){var _0x551d39=this;return new Promise(function(_0x46d12e,_0x320109){_0x16ed7b['run'](_0x63b716['id'])[_0x5bff('0x16')](function(_0x494872){_0x46d12e({'code':0xc8,'message':_0x494872[_0x5bff('0x17')]});})[_0x5bff('0x18')](function(_0x2c6f32){_0x320109(_0x551d39['error'](0x1f4,_0x2c6f32[_0x5bff('0x17')]));});});},'EventManager':function(_0x3033de){var _0x3977d3=this;return new Promise(function(_0x223c6f,_0x701e08){if(!_0x3033de[_0x5bff('0x7d')]){return _0x701e08(_0x3977d3['error'](0x1f4,_0x5bff('0x7e')));}ami['emit'](_0x5bff('0x7f')+_0x3033de[_0x5bff('0x7d')],_0x3033de[_0x5bff('0x17')]);_0x223c6f({'code':0xc8,'message':_0x3033de});});},'FaxAccounts':function(_0x3b240f){return new Promise(function(_0x2efeb0,_0x70fdf2){var _0x331810=_[_0x5bff('0x57')](_0x4c567d[_0x5bff('0x80')]);_0x2efeb0({'count':_0x331810[_0x5bff('0x54')],'rows':_0x331810});});},'SendFax':function(_0x429263){var _0x995f09=this;return new Promise(function(_0x40de11,_0x4cfb5b){_0x1d8650['send'](_0x429263)[_0x5bff('0x16')](function(_0x2e45e4){_0x40de11({'code':0xc8,'message':_0x2e45e4[_0x5bff('0x17')]});})[_0x5bff('0x18')](function(_0x406b88){_0x4cfb5b(_0x995f09['error'](0x1f4,_0x406b88[_0x5bff('0x17')]));});});},'CheckAfterSend':function(_0x31eae5){var _0x1d5599=this;return new Promise(function(_0x5a6b0f,_0x2f1f80){_0x1d8650['checkAfterSend'](_0x31eae5)[_0x5bff('0x16')](function(_0x51c0a1){_0x5a6b0f({'code':0xc8,'message':_0x51c0a1[_0x5bff('0x17')]});})['catch'](function(_0xe39373){_0x2f1f80(_0x1d5599[_0x5bff('0x19')](0x1f4,_0xe39373[_0x5bff('0x17')]));});});}};var _0x560d5d=jayson[_0x5bff('0x81')](_0x43605a)[_0x5bff('0x82')]();_0x560d5d['on'](_0x5bff('0x19'),function(_0x3dbb53){return _0xa54c57(_0x3dbb53);});_0x560d5d[_0x5bff('0x83')](0x232a,_0x5bff('0x84'),function(){console[_0x5bff('0x85')](_0x5bff('0x86'),0x232a);return _0x151add(_0x5bff('0x87')+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 60e6912..f34b16f 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 _0x17ba=['name','trigger:%s','toLowerCase','lodash','bluebird','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','map','destcalleridnum','calleridnum','firstName','lastName','mobile','fax','createdAt','updatedAt','union','then','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','uniqueid','routeId','calleridname','','Unknown','destcalleridname','resolve','createContact','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s'];(function(_0xfd42fa,_0x2ef3a9){var _0x1d1045=function(_0x5366ac){while(--_0x5366ac){_0xfd42fa['push'](_0xfd42fa['shift']());}};_0x1d1045(++_0x2ef3a9);}(_0x17ba,0xab));var _0xa17b=function(_0x191c96,_0x3498ad){_0x191c96=_0x191c96-0x0;var _0x4d448b=_0x17ba[_0x191c96];return _0x4d448b;};'use strict';var _=require(_0xa17b('0x0'));var BPromise=require(_0xa17b('0x1'));var Redis=require('ioredis');var util=require(_0xa17b('0x2'));var config=require(_0xa17b('0x3'));var logger=require(_0xa17b('0x4'))(_0xa17b('0x5'));var cmContactRpc=require(_0xa17b('0x6'));config[_0xa17b('0x7')]=_[_0xa17b('0x8')](config[_0xa17b('0x7')],{'host':_0xa17b('0x9'),'port':0x18eb});var io=require(_0xa17b('0xa'))(new Redis(config[_0xa17b('0x7')]));function emit(_0x2e3d43,_0x1957be,_0x57f9cd,_0x2ca4d3,_0x17d1d2){logger[_0xa17b('0xb')](_0xa17b('0xc'),_0x2e3d43,_0x1957be['id'],_0x57f9cd,_0x2ca4d3,JSON[_0xa17b('0xd')](_0x17d1d2));io['to'](_0x57f9cd)['emit'](_0x2ca4d3,_0x17d1d2);}exports[_0xa17b('0xe')]=function(_0x38b8f1,_0x322dc0,_0x1e799a,_0x140943){var _0x4382df,_0xc5ef2e;var _0x5593c4={};var _0xd2ccce=Number(_0x1e799a[_0xa17b('0xf')]);var _0x3c3a8a=_0x1e799a['data2']?Boolean(Number(_0x1e799a[_0xa17b('0x10')])):![];var _0x3d7d46;var _0x30236c=![];if(!_[_0xa17b('0x11')](_0x1e799a['data5'])){if(_0x1e799a[_0xa17b('0x12')]=='1')_0x30236c=!![];}if(!_0x30236c){if(_0x140943['xmd-contactid']){_0x5593c4['id']=_0x140943[_0xa17b('0x13')];}}if(!_0x5593c4['id']){_0x5593c4[_0xa17b('0x14')]=_0xd2ccce;_0x3d7d46=_0x1e799a['data3']&&_0x1e799a[_0xa17b('0x15')]!=='0'?_0x1e799a[_0xa17b('0x15')][_0xa17b('0x16')](','):[_0xa17b('0x17')];_0x5593c4['$or']=_[_0xa17b('0x18')](_0x3d7d46,function(_0x5e21c2){var _0x4d5592={};_0x4d5592[_0x5e21c2]=_0x140943['routeId']?_0x140943[_0xa17b('0x19')]:_0x140943[_0xa17b('0x1a')];return _0x4d5592;});}var _0x53a0f7=['id',_0xa17b('0x1b'),_0xa17b('0x1c'),_0xa17b('0x17'),_0xa17b('0x1d'),_0xa17b('0x1e'),_0xa17b('0x14'),_0xa17b('0x1f'),'scheduledAt',_0xa17b('0x20')];var _0x3f409a=_[_0xa17b('0x21')](_0x53a0f7,_0x3d7d46);BPromise['resolve']()[_0xa17b('0x22')](cmContactRpc[_0xa17b('0x23')]({'attributes':_0x3f409a,'where':_0x5593c4}))[_0xa17b('0x22')](function(_0xbbbb62){_0xc5ef2e=_0xbbbb62;if(!_[_0xa17b('0x24')](_0xc5ef2e)){if(_0xc5ef2e[_0xa17b('0x25')]===0x1){_0x4382df=_0xc5ef2e[0x0];logger['info'](_0xa17b('0x26'),_0x140943['uniqueid'],_0x322dc0['id'],_0x4382df['id']);}else{logger[_0xa17b('0xb')](_0xa17b('0x27'),_0x140943['uniqueid'],_0x322dc0['id'],_['map'](_0xc5ef2e,'id')[_0xa17b('0x28')](','));}return;}else{logger[_0xa17b('0xb')](_0xa17b('0x29'),_0x140943[_0xa17b('0x2a')],_0x322dc0['id']);var _0x3c32a5={'ListId':_0xd2ccce};var _0x3a64f5=_0x1e799a['data4']&&_0x1e799a['data4']!=='0'?_0x1e799a['data4']:'phone';if(_0x3c3a8a){logger[_0xa17b('0xb')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x140943[_0xa17b('0x2a')],_0x322dc0['id']);_0x3c32a5[_0x3a64f5]=_['isNil'](_0x140943[_0xa17b('0x2b')])?_0x140943[_0xa17b('0x1a')]:_0x140943[_0xa17b('0x19')];if(_[_0xa17b('0x11')](_0x140943[_0xa17b('0x2b')])){_0x3c32a5[_0xa17b('0x1b')]=_0x140943[_0xa17b('0x2c')]&&_0x140943[_0xa17b('0x2c')]!==_0xa17b('0x2d')?_0x140943[_0xa17b('0x2c')]:_0xa17b('0x2e');}else{_0x3c32a5['firstName']=_0x140943['destcalleridname']&&_0x140943['destcalleridname']!==_0xa17b('0x2d')?_0x140943[_0xa17b('0x2f')]:_0xa17b('0x2e');}return BPromise[_0xa17b('0x30')]()[_0xa17b('0x22')](cmContactRpc[_0xa17b('0x31')](_0x3c32a5))[_0xa17b('0x22')](function(_0x1bdd09){_0x4382df=_0x1bdd09;_0xc5ef2e['push'](_0x1bdd09);if(_0x4382df){logger[_0xa17b('0xb')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x140943[_0xa17b('0x2a')],_0x322dc0['id'],_0x4382df['id']);}return;});}else{logger[_0xa17b('0xb')](_0xa17b('0x32'),_0x140943[_0xa17b('0x2a')],_0x322dc0['id']);_0x3c32a5[_0x3a64f5]=_[_0xa17b('0x11')](_0x140943[_0xa17b('0x2b')])?_0x140943['calleridnum']:_0x140943[_0xa17b('0x19')];if(_[_0xa17b('0x11')](_0x140943[_0xa17b('0x2b')])){_0x3c32a5[_0xa17b('0x1b')]=_0x140943[_0xa17b('0x2c')]&&_0x140943['calleridname']!==_0xa17b('0x2d')?_0x140943['calleridname']:_0xa17b('0x2e');}else{_0x3c32a5['firstName']=_0x140943[_0xa17b('0x2f')]&&_0x140943[_0xa17b('0x2f')]!==''?_0x140943[_0xa17b('0x2f')]:_0xa17b('0x2e');}_0x4382df=_0x3c32a5;_0xc5ef2e['push'](_0x3c32a5);return;}}})[_0xa17b('0x22')](function(){if(_0x38b8f1){emit(_0x140943[_0xa17b('0x2a')],_0x322dc0,util[_0xa17b('0x33')](_0xa17b('0x34'),_0x38b8f1[_0xa17b('0x35')]),util['format'](_0xa17b('0x36'),_0x1e799a['action'][_0xa17b('0x37')]()),{'evt':_['merge'](_0x140943,{'autoCreate':_0x3c3a8a}),'contact':_0x4382df===undefined?{}:_0x4382df,'contacts':_0xc5ef2e[_0xa17b('0x25')]===0x0?undefined:_0xc5ef2e});}});}; \ No newline at end of file +var _0xb903=['data1','data2','data5','xmd-contactid','data3','split','phone','destcalleridnum','calleridnum','firstName','fax','ListId','scheduledAt','updatedAt','union','resolve','then','getContacts','isEmpty','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','routeId','calleridname','','Unknown','destcalleridname','push','user:%s','format','trigger:%s','action','toLowerCase','merge','length','lodash','bluebird','ioredis','util','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost','info'];(function(_0x3a6b60,_0xc8b7b){var _0x179e8b=function(_0x31196c){while(--_0x31196c){_0x3a6b60['push'](_0x3a6b60['shift']());}};_0x179e8b(++_0xc8b7b);}(_0xb903,0x185));var _0x3b90=function(_0x11fc39,_0x372492){_0x11fc39=_0x11fc39-0x0;var _0x5f2f5a=_0xb903[_0x11fc39];return _0x5f2f5a;};'use strict';var _=require(_0x3b90('0x0'));var BPromise=require(_0x3b90('0x1'));var Redis=require(_0x3b90('0x2'));var util=require(_0x3b90('0x3'));var config=require('../../../../config/environment');var logger=require(_0x3b90('0x4'))(_0x3b90('0x5'));var cmContactRpc=require(_0x3b90('0x6'));config[_0x3b90('0x7')]=_[_0x3b90('0x8')](config[_0x3b90('0x7')],{'host':_0x3b90('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3b90('0x7')]));function emit(_0x5e845a,_0x55792c,_0x153283,_0x2e4c06,_0x42efe8){logger[_0x3b90('0xa')]('[CM][%s][%s]',_0x5e845a,_0x55792c['id'],_0x153283,_0x2e4c06,JSON['stringify'](_0x42efe8));io['to'](_0x153283)['emit'](_0x2e4c06,_0x42efe8);}exports['exec']=function(_0x56261b,_0x55db3f,_0x336913,_0x5af39c){var _0x574955,_0x30c49c;var _0x233509={};var _0x4bb8f4=Number(_0x336913[_0x3b90('0xb')]);var _0x174c0d=_0x336913[_0x3b90('0xc')]?Boolean(Number(_0x336913['data2'])):![];var _0x5447df;var _0x58c4d1=![];if(!_['isNil'](_0x336913['data5'])){if(_0x336913[_0x3b90('0xd')]=='1')_0x58c4d1=!![];}if(!_0x58c4d1){if(_0x5af39c[_0x3b90('0xe')]){_0x233509['id']=_0x5af39c['xmd-contactid'];}}if(!_0x233509['id']){_0x233509['ListId']=_0x4bb8f4;_0x5447df=_0x336913[_0x3b90('0xf')]&&_0x336913[_0x3b90('0xf')]!=='0'?_0x336913[_0x3b90('0xf')][_0x3b90('0x10')](','):[_0x3b90('0x11')];_0x233509['$or']=_['map'](_0x5447df,function(_0xd83280){var _0x5420dc={};_0x5420dc[_0xd83280]=_0x5af39c['routeId']?_0x5af39c[_0x3b90('0x12')]:_0x5af39c[_0x3b90('0x13')];return _0x5420dc;});}var _0x11ad7d=['id',_0x3b90('0x14'),'lastName',_0x3b90('0x11'),'mobile',_0x3b90('0x15'),_0x3b90('0x16'),'createdAt',_0x3b90('0x17'),_0x3b90('0x18')];var _0x3642c0=_[_0x3b90('0x19')](_0x11ad7d,_0x5447df);BPromise[_0x3b90('0x1a')]()[_0x3b90('0x1b')](cmContactRpc[_0x3b90('0x1c')]({'attributes':_0x3642c0,'where':_0x233509}))[_0x3b90('0x1b')](function(_0xa98414){_0x30c49c=_0xa98414;if(!_[_0x3b90('0x1d')](_0x30c49c)){if(_0x30c49c['length']===0x1){_0x574955=_0x30c49c[0x0];logger[_0x3b90('0xa')](_0x3b90('0x1e'),_0x5af39c[_0x3b90('0x1f')],_0x55db3f['id'],_0x574955['id']);}else{logger[_0x3b90('0xa')](_0x3b90('0x20'),_0x5af39c[_0x3b90('0x1f')],_0x55db3f['id'],_['map'](_0x30c49c,'id')['join'](','));}return;}else{logger[_0x3b90('0xa')](_0x3b90('0x21'),_0x5af39c[_0x3b90('0x1f')],_0x55db3f['id']);var _0x2ffa1a={'ListId':_0x4bb8f4};var _0x583523=_0x336913[_0x3b90('0x22')]&&_0x336913[_0x3b90('0x22')]!=='0'?_0x336913[_0x3b90('0x22')]:'phone';if(_0x174c0d){logger[_0x3b90('0xa')](_0x3b90('0x23'),_0x5af39c[_0x3b90('0x1f')],_0x55db3f['id']);_0x2ffa1a[_0x583523]=_[_0x3b90('0x24')](_0x5af39c[_0x3b90('0x25')])?_0x5af39c[_0x3b90('0x13')]:_0x5af39c['destcalleridnum'];if(_[_0x3b90('0x24')](_0x5af39c['routeId'])){_0x2ffa1a[_0x3b90('0x14')]=_0x5af39c[_0x3b90('0x26')]&&_0x5af39c[_0x3b90('0x26')]!==_0x3b90('0x27')?_0x5af39c[_0x3b90('0x26')]:_0x3b90('0x28');}else{_0x2ffa1a[_0x3b90('0x14')]=_0x5af39c[_0x3b90('0x29')]&&_0x5af39c['destcalleridname']!==''?_0x5af39c[_0x3b90('0x29')]:_0x3b90('0x28');}return BPromise[_0x3b90('0x1a')]()[_0x3b90('0x1b')](cmContactRpc['createContact'](_0x2ffa1a))['then'](function(_0xd33ac9){_0x574955=_0xd33ac9;_0x30c49c[_0x3b90('0x2a')](_0xd33ac9);if(_0x574955){logger[_0x3b90('0xa')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x5af39c[_0x3b90('0x1f')],_0x55db3f['id'],_0x574955['id']);}return;});}else{logger['info']('[CM][%s][%s]\x20Autocreate\x20disabled',_0x5af39c[_0x3b90('0x1f')],_0x55db3f['id']);_0x2ffa1a[_0x583523]=_[_0x3b90('0x24')](_0x5af39c['routeId'])?_0x5af39c[_0x3b90('0x13')]:_0x5af39c[_0x3b90('0x12')];if(_[_0x3b90('0x24')](_0x5af39c['routeId'])){_0x2ffa1a['firstName']=_0x5af39c[_0x3b90('0x26')]&&_0x5af39c[_0x3b90('0x26')]!==_0x3b90('0x27')?_0x5af39c[_0x3b90('0x26')]:'Unknown';}else{_0x2ffa1a['firstName']=_0x5af39c[_0x3b90('0x29')]&&_0x5af39c[_0x3b90('0x29')]!==''?_0x5af39c['destcalleridname']:_0x3b90('0x28');}_0x574955=_0x2ffa1a;_0x30c49c[_0x3b90('0x2a')](_0x2ffa1a);return;}}})[_0x3b90('0x1b')](function(){if(_0x56261b){emit(_0x5af39c[_0x3b90('0x1f')],_0x55db3f,util['format'](_0x3b90('0x2b'),_0x56261b['name']),util[_0x3b90('0x2c')](_0x3b90('0x2d'),_0x336913[_0x3b90('0x2e')][_0x3b90('0x2f')]()),{'evt':_[_0x3b90('0x30')](_0x5af39c,{'autoCreate':_0x174c0d}),'contact':_0x574955===undefined?{}:_0x574955,'contacts':_0x30c49c[_0x3b90('0x31')]===0x0?undefined:_0x30c49c});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 545cb5b..f28e433 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 _0x8a25=['render','template\x20not\x20found','uri','buildUri','isNil','data3','data4','location','uriLocation','windowWidth','data5','800','windowHeight','data6','600','winapp','winApplication','winArguments','format','user:%s','name','trigger:%s:%s','toLowerCase','merge','trigger:%s','contactmanager','exec','queue','routeId','urlforward','parse','query','search','replace','channel','AllConditions','every','checkConditions','AnyConditions','some','field','account','chat','ChatWebsiteId','operator','upperFirst','AccountId','interaction','message','value','event','agent','membername','lastevent','mailSubstatus','substatus','offlineMessage','created','equals','util','lodash','url','mustache','ioredis','./urlforward','./cmContact','../../../config/logger','trigger','../ami','redis','defaults','localhost','triggers','agents','voiceQueues','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','deskAccounts','syncCustomEvent','bind','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:dialbegin','syncAgentDial','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:outgoingmessage','custom:offlineMessage','info','emit','prototype','clone','motionChannel','undefined','voice','checkTriggers','checkTrigger','variables','length','Actions','interface','action','data1','popup','data2','html','templates'];(function(_0x3046dc,_0x169f39){var _0x1a5eaf=function(_0x50d2aa){while(--_0x50d2aa){_0x3046dc['push'](_0x3046dc['shift']());}};_0x1a5eaf(++_0x169f39);}(_0x8a25,0xb7));var _0x58a2=function(_0x34e038,_0x596a18){_0x34e038=_0x34e038-0x0;var _0x185d86=_0x8a25[_0x34e038];return _0x185d86;};'use strict';var util=require(_0x58a2('0x0'));var _=require(_0x58a2('0x1'));var url=require(_0x58a2('0x2'));var Mustache=require(_0x58a2('0x3'));var Redis=require(_0x58a2('0x4'));var urlforward=require(_0x58a2('0x5'));var integration=require('./integration');var cmContact=require(_0x58a2('0x6'));var script=require('./script');var config=require('../../../config/environment');var logger=require(_0x58a2('0x7'))(_0x58a2('0x8'));var ami=require(_0x58a2('0x9'));config[_0x58a2('0xa')]=_[_0x58a2('0xb')](config[_0x58a2('0xa')],{'host':_0x58a2('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x58a2('0xa')]));var operators={'equals':function(_0x12d2b8,_0x187c6e){return _0x12d2b8==_0x187c6e;},'not_equals':function(_0x2c17d9,_0x4e32bd){return _0x2c17d9!=_0x4e32bd;}};var barAndWebActions=['popup',_0x58a2('0x2'),'winapp'];function Trigger(_0x58566e){this[_0x58a2('0xd')]=_0x58566e[_0x58a2('0xd')];this[_0x58a2('0xe')]=_0x58566e[_0x58a2('0xe')];this[_0x58a2('0xf')]=_0x58566e[_0x58a2('0xf')];this['templates']=_0x58566e['templates'];this[_0x58a2('0x10')]=_0x58566e[_0x58a2('0x10')];this[_0x58a2('0x11')]=_0x58566e[_0x58a2('0x11')];this[_0x58a2('0x12')]=_0x58566e[_0x58a2('0x12')];this[_0x58a2('0x13')]=_0x58566e[_0x58a2('0x13')];this[_0x58a2('0x14')]=_0x58566e[_0x58a2('0x14')];this[_0x58a2('0x15')]=_0x58566e[_0x58a2('0x15')];this['deskAccounts']=_0x58566e['deskAccounts'];this[_0x58a2('0x16')]=_0x58566e[_0x58a2('0x16')];this[_0x58a2('0x17')]=_0x58566e[_0x58a2('0x17')];this[_0x58a2('0x18')]=_0x58566e['dynamics365Accounts'];this[_0x58a2('0x19')]=_0x58566e['freshsalesAccounts'];this[_0x58a2('0x1a')]={'zendesk':this[_0x58a2('0x11')],'salesforce':this['salesforceAccounts'],'freshdesk':this[_0x58a2('0x12')],'sugarcrm':this[_0x58a2('0x14')],'zoho':this[_0x58a2('0x15')],'desk':this[_0x58a2('0x1b')],'vtiger':this[_0x58a2('0x16')],'dynamics365':this['dynamics365Accounts'],'freshsales':this[_0x58a2('0x19')],'servicenow':this[_0x58a2('0x17')]};ami['on']('custom:agentcalled',this[_0x58a2('0x1c')][_0x58a2('0x1d')](this));ami['on']('custom:agentconnect',this['syncCustomEvent'][_0x58a2('0x1d')](this));ami['on'](_0x58a2('0x1e'),this[_0x58a2('0x1c')][_0x58a2('0x1d')](this));ami['on'](_0x58a2('0x1f'),this[_0x58a2('0x1c')]['bind'](this));ami['on'](_0x58a2('0x20'),this[_0x58a2('0x1c')][_0x58a2('0x1d')](this));ami['on'](_0x58a2('0x21'),this[_0x58a2('0x1c')][_0x58a2('0x1d')](this));ami['on'](_0x58a2('0x22'),this[_0x58a2('0x1c')][_0x58a2('0x1d')](this));ami['on'](_0x58a2('0x23'),this[_0x58a2('0x1c')][_0x58a2('0x1d')](this));ami['on'](_0x58a2('0x24'),this['syncCustomEvent'][_0x58a2('0x1d')](this));ami['on'](_0x58a2('0x25'),this['syncCustomEvent'][_0x58a2('0x1d')](this));ami['on'](_0x58a2('0x26'),this[_0x58a2('0x1c')][_0x58a2('0x1d')](this));ami['on']('custom:timeout',this[_0x58a2('0x1c')]['bind'](this));ami['on'](_0x58a2('0x27'),this[_0x58a2('0x28')][_0x58a2('0x1d')](this));ami['on']('custom:dialconnect',this['syncAgentDial']['bind'](this));ami['on'](_0x58a2('0x29'),this[_0x58a2('0x28')]['bind'](this));ami['on'](_0x58a2('0x2a'),this[_0x58a2('0x1c')][_0x58a2('0x1d')](this));ami['on'](_0x58a2('0x2b'),this[_0x58a2('0x1c')][_0x58a2('0x1d')](this));ami['on']('custom:substatus',this[_0x58a2('0x1c')][_0x58a2('0x1d')](this));ami['on']('custom:incomingmessage',this[_0x58a2('0x1c')][_0x58a2('0x1d')](this));ami['on'](_0x58a2('0x2c'),this[_0x58a2('0x1c')]['bind'](this));ami['on']('custom:acceptmessage',this[_0x58a2('0x1c')]['bind'](this));ami['on']('custom:rejectmessage',this[_0x58a2('0x1c')]['bind'](this));ami['on'](_0x58a2('0x2d'),this[_0x58a2('0x1c')][_0x58a2('0x1d')](this));}Trigger['prototype']['emit']=function(_0x1a7a60,_0x58bbac,_0x48d51b){logger[_0x58a2('0x2e')](_0x1a7a60,_0x58bbac,JSON['stringify'](_0x48d51b));io['to'](_0x1a7a60)[_0x58a2('0x2f')](_0x58bbac,_0x48d51b);};Trigger[_0x58a2('0x30')][_0x58a2('0x1c')]=function(_0x558af4){var _0x22aa6b=_[_0x58a2('0x31')](_0x558af4);if(typeof _0x22aa6b[_0x58a2('0x32')]===_0x58a2('0x33')){_0x22aa6b[_0x58a2('0x32')]=_0x58a2('0x34');}this['checkTriggers'](_0x22aa6b);};Trigger[_0x58a2('0x30')][_0x58a2('0x28')]=function(_0x5d9780){if(this[_0x58a2('0xe')][_0x5d9780['interface']]){this[_0x58a2('0x1c')](_0x5d9780);}};Trigger['prototype'][_0x58a2('0x35')]=function(_0xc20a8f){var _0x3be086;for(var _0x5abccf in this[_0x58a2('0xd')]){if(this['triggers']['hasOwnProperty'](_0x5abccf)){if(this[_0x58a2('0xd')][_0x5abccf]['status']){_0x3be086=this[_0x58a2('0x36')](this[_0x58a2('0xd')][_0x5abccf],_0xc20a8f);if(_0x3be086){_['merge'](_0xc20a8f,_0xc20a8f[_0x58a2('0x37')]);for(var _0x1d8f88=0x0,_0x55b6ce,_0x145374,_0xb4ef34;_0x1d8f880x0){_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 _0x55ca=['debug','[HTTP]','stringify','GET','authType','basic','%s:%s','username','token','%s/token:%s','toString','base64','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','_embedded','entries','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','length','forEach','includes','picklist','type','nameField','customField','toLowerCase','content','string','idField','custom_fields','variable','variableName','customVariable','Variable','name','priority','merge','xCALLY','Motion','CTI','concat','Tags','getString','Descriptions','/api/v2/users/%d','user','Fields','stripTrailingSlash','serverUrl','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/agent/tickets/%s','catch','unmanaged','monitor_format','lastevent','toUpperCase','Recording\x20is\x20enabled!','lodash','request-promise','./util','../../../../config/environment','desk','redis','defaults','localhost','socket.io-emitter','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/users','remoteUri','then','total_entries','find','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me'];(function(_0x3d65fd,_0x58aebf){var _0x1f33f2=function(_0x20fc8c){while(--_0x20fc8c){_0x3d65fd['push'](_0x3d65fd['shift']());}};_0x1f33f2(++_0x58aebf);}(_0x55ca,0x126));var _0xa55c=function(_0x516ffb,_0x5b5b42){_0x516ffb=_0x516ffb-0x0;var _0x319667=_0x55ca[_0x516ffb];return _0x319667;};'use strict';var _=require(_0xa55c('0x0'));var rp=require(_0xa55c('0x1'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var intUtil=require(_0xa55c('0x2'));var config=require(_0xa55c('0x3'));var logger=require('../../../../config/logger')(_0xa55c('0x4'));config[_0xa55c('0x5')]=_[_0xa55c('0x6')](config[_0xa55c('0x5')],{'host':_0xa55c('0x7'),'port':0x18eb});var io=require(_0xa55c('0x8'))(new Redis(config[_0xa55c('0x5')]));function emit(_0x4d0624,_0x2121fd,_0x2537f0){io['to'](_0x4d0624)['emit'](_0x2121fd,_0x2537f0);}var headers={'Content-Type':_0xa55c('0x9'),'Accept':_0xa55c('0x9')};function getUser(_0x52a3bc,_0x5849ad){if(intUtil[_0xa55c('0xa')](_0x5849ad)===!![]){logger[_0xa55c('0xb')](_0xa55c('0xc'),_0x5849ad);return request({'uri':util[_0xa55c('0xd')](_0xa55c('0xe'),_0x52a3bc[_0xa55c('0xf')])})[_0xa55c('0x10')](function(_0x70c2de){if(_0x70c2de[_0xa55c('0x11')]){return _[_0xa55c('0x12')](_0x70c2de['_embedded']['entries'],{'email':_0x5849ad});}})[_0xa55c('0x10')](function(_0x576044){if(_0x576044){logger['info']('Agent\x20found!');return _0x576044;}else{logger[_0xa55c('0xb')](_0xa55c('0x13'));return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x14'),_0x52a3bc[_0xa55c('0xf')])});}});}else{logger[_0xa55c('0xb')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x14'),_0x52a3bc[_0xa55c('0xf')])});}}function request(_0x31e10d){logger[_0xa55c('0x15')](_0xa55c('0x16'),JSON[_0xa55c('0x17')](_0x31e10d));return rp(_[_0xa55c('0x6')](_0x31e10d,{'method':_0xa55c('0x18'),'headers':headers,'json':!![]}));}function getAuth(_0x4cee3c){var _0x3d4c9e;if(_0x4cee3c[_0xa55c('0x19')]===_0xa55c('0x1a')){_0x3d4c9e=util[_0xa55c('0xd')](_0xa55c('0x1b'),_0x4cee3c[_0xa55c('0x1c')],_0x4cee3c['password']);}else if(_0x4cee3c['authType']===_0xa55c('0x1d')){_0x3d4c9e=util[_0xa55c('0xd')](_0xa55c('0x1e'),_0x4cee3c['username'],_0x4cee3c[_0xa55c('0x1d')]);}return util[_0xa55c('0xd')]('Basic\x20%s',new Buffer(_0x3d4c9e)[_0xa55c('0x1f')](_0xa55c('0x20')));}function getEndUser(_0x940f28,_0x1965f1,_0x234372){logger['info'](_0xa55c('0x21'),_0x234372);return request({'uri':util['format']('%s/customers/search',_0x940f28['remoteUri']),'qs':{'phone':_0x234372}})[_0xa55c('0x10')](function(_0x54b038){if(_0x54b038[_0xa55c('0x11')]){logger[_0xa55c('0xb')](_0xa55c('0x22'));return _0x54b038[_0xa55c('0x23')][_0xa55c('0x24')][0x0];}else{logger[_0xa55c('0xb')](_0xa55c('0x25'));return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x26'),_0x940f28[_0xa55c('0xf')]),'method':_0xa55c('0x27'),'body':{'first_name':_0x1965f1,'title':_0x1965f1,'phone_numbers':[{'type':'work','value':_0x234372}]}});}});}function getTags(_0x430d55,_0x28814f){var _0x1c9f6b=[];if(_0x430d55&&_0x430d55[_0xa55c('0x28')]>0x0){_0x1c9f6b=_['map'](_0x430d55,_0x28814f);}return _0x1c9f6b;}function getCustomFields(_0x1377b0,_0x22f6b6){var _0x1b8388=[];var _0x201941={'custom_fields':{}};if(_0x1377b0[_0xa55c('0x28')]>0x0){_[_0xa55c('0x29')](_0x1377b0,function(_0x52d37f){if(_[_0xa55c('0x2a')](['string',_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x2d')]&&!_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0x52d37f['nameField'][_0xa55c('0x2f')]()]=_0x52d37f[_0xa55c('0x30')][_0xa55c('0x1f')]();}else if(_[_0xa55c('0x2a')]([_0xa55c('0x31'),_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x52d37f['content']['toString']();}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x34')&&_0x52d37f['variableName']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x35')]]&&(_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f[_0xa55c('0x35')]][_0xa55c('0x1f')]());}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x36')&&_0x52d37f['Variable']&&_0x52d37f['Variable']['name']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x37')]['name'][_0xa55c('0x2f')]()]&&(_0x201941['custom_fields'][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f['Variable'][_0xa55c('0x38')][_0xa55c('0x2f')]()][_0xa55c('0x1f')]());}});}if(_0x201941['priority']){_0x201941[_0xa55c('0x39')]=Number(_0x201941[_0xa55c('0x39')]);}return _0x201941;}function getTicket(_0x47e93c,_0x6f9c4c,_0x194e78,_0x4d9083,_0x529ff8){logger[_0xa55c('0xb')]('Creating\x20new\x20ticket...');var _0x1e75dc=_[_0xa55c('0x3a')]({'subject':intUtil['getString'](_0x4d9083['Subjects'],_0x529ff8,'\x20'),'type':'phone','status':'new','labels':[_0xa55c('0x3b'),_0xa55c('0x3c'),_0xa55c('0x3d')][_0xa55c('0x3e')](getTags(_0x4d9083[_0xa55c('0x3f')],'name')),'description':intUtil[_0xa55c('0x40')](_0x4d9083[_0xa55c('0x41')],_0x529ff8,'\x0a'),'_links':{'assigned_user':{'href':util[_0xa55c('0xd')](_0xa55c('0x42'),_0x6f9c4c['id']),'class':_0xa55c('0x43')}},'message':{'direction':'in','body':intUtil[_0xa55c('0x40')](_0x4d9083['Descriptions'],_0x529ff8,'\x0a')}},getCustomFields(_0x4d9083[_0xa55c('0x44')],_0x529ff8));return request({'uri':util['format']('%s/customers/%d/cases',_0x47e93c[_0xa55c('0xf')],_0x194e78['id']),'method':_0xa55c('0x27'),'body':_0x1e75dc});}exports['queue']=function(_0x2bd98b,_0x508bd3,_0x5f25f7,_0x2f8449,_0x3fea03,_0x1630ac){var _0x540337,_0x1b2708;_0x1630ac[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1630ac[_0xa55c('0xf')]);_0x1630ac['serverUrl']=intUtil[_0xa55c('0x45')](_0x1630ac[_0xa55c('0x46')]);if(_0x3fea03&&_0x3fea03['monitor_format']){logger[_0xa55c('0xb')](_0xa55c('0x47'),'Recording\x20is\x20enabled!');_0x508bd3[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1630ac['serverUrl'],_0x508bd3[_0xa55c('0x4a')],md5(_0x508bd3['uniqueid']));}else{_0x508bd3[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1630ac);return getUser(_0x1630ac,_0x2f8449[_0xa55c('0x4c')])['then'](function(_0x41eab1){_0x540337=_0x41eab1;logger[_0xa55c('0xb')]('The\x20User\x20ID\x20is:',_0x540337['id']);return getEndUser(_0x1630ac,_0x508bd3[_0xa55c('0x4d')],_0x508bd3[_0xa55c('0x4e')]);})['then'](function(_0x11ff1d){_0x1b2708=_0x11ff1d;logger[_0xa55c('0xb')]('The\x20Enduser\x20ID\x20is:',_0x1b2708['id']);return getTicket(_0x1630ac,_0x540337,_0x1b2708,_0x5f25f7,_0x508bd3);})[_0xa55c('0x10')](function(_0x81cee8){if(_0x81cee8){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger['info'](_0xa55c('0x50'),_0x81cee8['id']);switch(_0x1630ac['type']){case _0xa55c('0x51'):logger[_0xa55c('0xb')](_0xa55c('0x47'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449['name']),_0xa55c('0x53'),{'recordId':_0x81cee8['id']});break;case _0xa55c('0x54'):logger[_0xa55c('0xb')](_0xa55c('0x47'),_0xa55c('0x55'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449[_0xa55c('0x38')]),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')]('https://xcally.desk.com/web/agent/case/%d',_0x81cee8['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x47'),_0xa55c('0x58'));}}})['catch'](function(_0x4c3095){console[_0xa55c('0x57')](_0x4c3095);logger['error'](_0xa55c('0x47'),JSON['stringify'](_0x4c3095));});};exports[_0xa55c('0x59')]=function(_0x228df4,_0x181802,_0x3f9313,_0x2ecf79,_0x5b1cf3,_0x44b7c1,_0x4607ca){var _0x4b85cc,_0x3929a6;_0x44b7c1[_0xa55c('0xf')]=intUtil[_0xa55c('0x45')](_0x44b7c1[_0xa55c('0xf')]);_0x44b7c1['serverUrl']=intUtil['stripTrailingSlash'](_0x44b7c1[_0xa55c('0x46')]);if(_0x4607ca&&_0x4607ca[_0xa55c('0x5a')]&&_0x4607ca[_0xa55c('0x5a')]!==_0xa55c('0x5b')){logger['info'](_0xa55c('0x5c'),'Recording\x20is\x20enabled!');_0x181802[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x44b7c1[_0xa55c('0x46')],_0x181802[_0xa55c('0x4a')],md5(_0x181802['uniqueid']));}headers[_0xa55c('0x4b')]=getAuth(_0x44b7c1);return getUser(_0x44b7c1,_0x2ecf79['email'])[_0xa55c('0x10')](function(_0x157afe){_0x4b85cc=_0x157afe;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0x4b85cc['id']);return getEndUser(_0x44b7c1,_0x181802[_0xa55c('0x5e')],_0x181802[_0xa55c('0x5f')]);})[_0xa55c('0x10')](function(_0x53e2be){_0x3929a6=_0x53e2be;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3929a6['id']);return getTicket(_0x44b7c1,_0x4b85cc,_0x3929a6,_0x3f9313,_0x181802);})[_0xa55c('0x10')](function(_0x23a30e){if(_0x23a30e){logger[_0xa55c('0xb')]('Ticket\x20created!');logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x23a30e['id']);switch(_0x44b7c1[_0xa55c('0x2c')]){case _0xa55c('0x51'):logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x61'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2ecf79[_0xa55c('0x38')]),_0xa55c('0x53'),{'recordId':_0x23a30e['id']});break;case'newTab':logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x55'));emit(util['format'](_0xa55c('0x52'),_0x2ecf79['name']),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')](_0xa55c('0x62'),_0x44b7c1[_0xa55c('0xf')],_0x23a30e['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x5c'),_0xa55c('0x58'));}}})[_0xa55c('0x63')](function(_0x14b515){logger[_0xa55c('0x57')]('[OUTBOUND]',JSON[_0xa55c('0x17')](_0x14b515));});};exports[_0xa55c('0x64')]=function(_0x4ef914,_0x18b928,_0x2b8b88,_0x3e3b4b,_0x9fe234,_0x1b8b06){var _0xa38271,_0x3cef1f;_0x1b8b06[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1b8b06[_0xa55c('0xf')]);_0x1b8b06[_0xa55c('0x46')]=intUtil[_0xa55c('0x45')](_0x1b8b06[_0xa55c('0x46')]);if(_0x9fe234&&_0x9fe234[_0xa55c('0x65')]){logger[_0xa55c('0xb')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',_0xa55c('0x68'));_0x18b928['recordingURL']=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1b8b06[_0xa55c('0x46')],_0x18b928[_0xa55c('0x4a')],md5(_0x18b928[_0xa55c('0x4a')]));}else{_0x18b928[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1b8b06);return getUser(_0x1b8b06)[_0xa55c('0x10')](function(_0x2e4cf7){_0xa38271=_0x2e4cf7;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0xa38271['id']);return getEndUser(_0x1b8b06,_0x18b928['calleridname'],_0x18b928[_0xa55c('0x4e')]);})['then'](function(_0x1228a4){_0x3cef1f=_0x1228a4;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3cef1f['id']);return getTicket(_0x1b8b06,_0xa38271,_0x3cef1f,_0x2b8b88,_0x18b928);})['then'](function(_0x4d9722){if(_0x4d9722){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x4d9722['id']);}})['catch'](function(_0x149cb9){logger[_0xa55c('0x57')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',JSON[_0xa55c('0x17')](_0x149cb9));});}; \ 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 9fa1d23..d7e07ae 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 _0xb255=['monitor_format','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','name',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','./util','md5','../../../../config/logger','dynamics365','../../../../config/environment','defaults','redis','localhost','socket.io-emitter','remoteUri','CloudProvider','data7','data2','data5','POST','clientId','password','clientSecret','then','access_token','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','Bearer\x20','value','isNil','validateEmail','userEmail','email','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId','destcalleridnum','calleridnum','contacts','4.0','odata-entityid','lastIndexOf','enduserId','catch','toLowerCase','outbound','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','telephone1','contactid',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','string','picklist','type','nameField','customField','idField','substring','indexOf','content','ticketType','incident','assign','getString','Subjects','Descriptions','/systemusers(','Fields','phonecall','callDirection','queue','/contacts(','phonecalls','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','modernAuthentication','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s'];(function(_0x1d0b20,_0x15898a){var _0x563b0d=function(_0x51ccde){while(--_0x51ccde){_0x1d0b20['push'](_0x1d0b20['shift']());}};_0x563b0d(++_0x15898a);}(_0xb255,0x79));var _0x5b25=function(_0x512371,_0x2bc842){_0x512371=_0x512371-0x0;var _0x1c7db0=_0xb255[_0x512371];return _0x1c7db0;};'use strict';var _=require(_0x5b25('0x0'));var rp=require(_0x5b25('0x1'));var util=require(_0x5b25('0x2'));var intUtil=require(_0x5b25('0x3'));var md5=require(_0x5b25('0x4'));var Redis=require('ioredis');var logger=require(_0x5b25('0x5'))(_0x5b25('0x6'));var config=require(_0x5b25('0x7'));config['redis']=_[_0x5b25('0x8')](config[_0x5b25('0x9')],{'host':_0x5b25('0xa'),'port':0x18eb});var io=require(_0x5b25('0xb'))(new Redis(config[_0x5b25('0x9')]));function getAuthToken(_0x3f4424,_0x115943,_0x351765){if(_0x3f4424['modernAuthentication']){_0x3f4424[_0x5b25('0xc')]=_0x3f4424[_0x5b25('0xd')][_0x5b25('0xe')];_0x3f4424['tenantId']=_0x3f4424[_0x5b25('0xd')][_0x5b25('0xf')];return Promise['resolve'](_0x3f4424[_0x5b25('0xd')][_0x5b25('0x10')]);}var _0x1ea87b={'method':_0x5b25('0x11'),'uri':_0x115943,'form':{'client_id':_0x3f4424[_0x5b25('0x12')],'resource':_0x3f4424['remoteUri'],'username':_0x3f4424['username'],'password':_0x3f4424[_0x5b25('0x13')],'grant_type':_0x5b25('0x13'),'client_secret':_0x3f4424[_0x5b25('0x14')]},'json':!![]};return rp(_0x1ea87b)[_0x5b25('0x15')](function(_0x205029){return _0x205029[_0x5b25('0x16')];})['catch'](function(_0x32468b){logger[_0x5b25('0x17')]('['+[_0x351765[_0x5b25('0x18')]()]+_0x5b25('0x19'));return _0x32468b[_0x5b25('0x1a')];});}function getUser(_0x2f392f,_0x3a1bc0,_0x16f3d3,_0x2c8243,_0xaf575b,_0x597454){return new Promise(function(_0x2e1017,_0x8e00a8){return getAuthToken(_0x3a1bc0,_0x2c8243,_0x597454)[_0x5b25('0x15')](function(_0x1c0345){var _0x1b43cf={'method':_0x5b25('0x1b'),'uri':_0xaf575b+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0x5b25('0x1c')+_0x1c0345,'OData-Version':'4.0'},'json':!![]};return rp(_0x1b43cf);})['then'](function(_0x5cdcc9){var _0x2c8f4b=_0x5cdcc9[_0x5b25('0x1d')];var _0x2aea99=![];var _0xa67f5c=null;if(!_[_0x5b25('0x1e')](_0x16f3d3)){if(intUtil[_0x5b25('0x1f')](_0x16f3d3['email'])){_0x2f392f[_0x5b25('0x20')]=_0x16f3d3[_0x5b25('0x21')];for(_0xa67f5c=0x0;_0xa67f5c<_0x2c8f4b[_0x5b25('0x22')];_0xa67f5c++){if(_0x2c8f4b[_0xa67f5c][_0x5b25('0x23')]===_0x16f3d3['email']&&!_0x2c8f4b[_0xa67f5c][_0x5b25('0x24')]){_0x2aea99=!![];logger[_0x5b25('0x25')]('['+[_0x597454[_0x5b25('0x18')]()]+_0x5b25('0x26')+_0x2c8f4b[_0xa67f5c][_0x5b25('0x27')]+'!');_0x2f392f[_0x5b25('0x28')]=_0x2c8f4b[_0xa67f5c][_0x5b25('0x27')];}}}}if(!_0x2aea99){logger[_0x5b25('0x25')]('['+[_0x597454[_0x5b25('0x18')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x2f392f[_0x5b25('0x20')]=_0x3a1bc0['username'];for(_0xa67f5c=0x0;_0xa67f5c<_0x2c8f4b[_0x5b25('0x22')];_0xa67f5c++){if(_0x2c8f4b[_0xa67f5c]['internalemailaddress']===_0x3a1bc0['username']){_0x2f392f['userId']=_0x2c8f4b[_0xa67f5c][_0x5b25('0x27')];}}}_0x2e1017(_0x2f392f);})['catch'](function(_0x9c9666){_0x8e00a8(_0x9c9666[_0x5b25('0x1a')]);});});}function createEndUser(_0x366177,_0x2b7fbd,_0x3465f4,_0x41ebfe,_0x5cda7b,_0xff0632){return new Promise(function(_0x32293a,_0x2eb050){return getAuthToken(_0x2b7fbd,_0x3465f4,_0xff0632)[_0x5b25('0x15')](function(_0x351748){var _0x257e9b=_0xff0632['toLowerCase']()==='outbound'?_0x5cda7b[_0x5b25('0x29')]:_0x5cda7b[_0x5b25('0x2a')];var _0x527d3a={'method':'POST','uri':_0x41ebfe+_0x5b25('0x2b'),'body':{'telephone1':_0x257e9b,'fullname':_0x257e9b,'firstname':_0x257e9b,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x366177[_0x5b25('0x28')]+')'},'headers':{'Authorization':_0x5b25('0x1c')+_0x351748,'OData-Version':_0x5b25('0x2c')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x527d3a);})[_0x5b25('0x15')](function(_0x14775f){var _0x38461d=_0x14775f['headers'][_0x5b25('0x2d')];var _0x34a5ae=_0x38461d['substring'](_0x38461d[_0x5b25('0x2e')]('(')+0x1,_0x38461d[_0x5b25('0x2e')](')'));_0x366177[_0x5b25('0x2f')]=_0x34a5ae;_0x32293a(_0x366177);})[_0x5b25('0x30')](function(_0x35311c){_0x2eb050(_0x35311c[_0x5b25('0x1a')]);});});}function getEndUser(_0x2a21f5,_0x486412,_0x385266,_0x41083f,_0x2a12cf,_0x4096d1,_0x26c015){var _0x60afec=_0x4096d1[_0x5b25('0x31')]()===_0x5b25('0x32')?_0x2a12cf[_0x5b25('0x29')]:_0x2a12cf[_0x5b25('0x2a')];return getAuthToken(_0x486412,_0x385266,_0x4096d1)[_0x5b25('0x15')](function(_0x51748c){var _0x1dbc9a={'method':_0x5b25('0x1b'),'uri':_0x41083f+_0x5b25('0x33')+_0x60afec[_0x5b25('0x34')]('+',_0x5b25('0x35'))+'\x27','headers':{'Authorization':_0x5b25('0x1c')+_0x51748c,'If-None-Match':null,'OData-Version':_0x5b25('0x2c')},'json':!![]};return rp(_0x1dbc9a);})[_0x5b25('0x15')](function(_0x385f4d){var _0x50cce2=![];if(!_0x385f4d)return _0x50cce2;var _0x3fc20f=_0x385f4d['value'];for(var _0x1271a5=0x0;_0x1271a5<_0x3fc20f[_0x5b25('0x22')];_0x1271a5++){if(_0x3fc20f[_0x1271a5][_0x5b25('0x36')]===_0x60afec){_0x50cce2=!![];_0x2a21f5[_0x5b25('0x2f')]=_0x3fc20f[_0x1271a5][_0x5b25('0x37')];}}return _0x50cce2;})['then'](function(_0x19a247){if(_0x19a247)return _0x2a21f5;if(_0x26c015==='nothing'){logger[_0x5b25('0x25')]('['+[_0x4096d1[_0x5b25('0x18')]()]+_0x5b25('0x38'));return _0x2a21f5;}return createEndUser(_0x2a21f5,_0x486412,_0x385266,_0x41083f,_0x2a12cf,_0x4096d1)[_0x5b25('0x15')](function(_0x5a3710){logger[_0x5b25('0x25')]('['+[_0x4096d1[_0x5b25('0x18')]()]+_0x5b25('0x39'),_0x5a3710['enduserId']);return _0x5a3710;});});}function getCustomFields(_0x352386,_0x2c38b6,_0x344687){var _0x1bcd9e={};if(_0x352386['length']>0x0){_[_0x5b25('0x3a')](_0x352386,function(_0x298a62){if(_['includes']([_0x5b25('0x3b'),_0x5b25('0x3c')],_0x298a62[_0x5b25('0x3d')])&&_0x298a62[_0x5b25('0x3e')]&&!_0x298a62[_0x5b25('0x3f')]){var _0x219026=_0x298a62[_0x5b25('0x40')][_0x5b25('0x31')]();var _0x1cdbb9=_0x219026[_0x5b25('0x41')](0x0,_0x219026[_0x5b25('0x42')]('_'));var _0x4c65d0=_0x219026['substring'](_0x219026[_0x5b25('0x42')]('_')+0x1);if(_0x1cdbb9===_0x344687){_0x1bcd9e[_0x4c65d0]=_0x298a62[_0x5b25('0x43')];}}});}return _0x1bcd9e;}function getTicket(_0x4e4d79,_0x2ef79f,_0x5cf463,_0x36df66,_0x5b68f0,_0x5d4f11,_0x3e4f0c){return new Promise(function(_0x24d930,_0xedf757){var _0x31a5ab;return getAuthToken(_0x2ef79f,_0x5cf463,_0x3e4f0c)['then'](function(_0x74ae6f){if(_0x5d4f11[_0x5b25('0x44')]===_0x5b25('0x45')){_0x31a5ab={'method':_0x5b25('0x11'),'uri':_0x36df66+'incidents','body':Object[_0x5b25('0x46')]({},{'title':intUtil[_0x5b25('0x47')](_0x5d4f11[_0x5b25('0x48')],_0x5b68f0,'\x20'),'description':intUtil[_0x5b25('0x47')](_0x5d4f11[_0x5b25('0x49')],_0x5b68f0,'\x0a'),'customerid_contact@odata.bind':_0x4e4d79['enduserId']?'/contacts('+_0x4e4d79[_0x5b25('0x2f')]+')':undefined,'ownerid@odata.bind':_0x5b25('0x4a')+_0x4e4d79[_0x5b25('0x28')]+')','caseorigincode':'1'},getCustomFields(_0x5d4f11[_0x5b25('0x4b')],_0x5b68f0,_0x5d4f11[_0x5b25('0x44')])),'headers':{'Authorization':_0x5b25('0x1c')+_0x74ae6f,'OData-Version':_0x5b25('0x2c')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x5d4f11['ticketType']===_0x5b25('0x4c')){var _0x28c21f=_0x4e4d79['enduserId']?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x4e4d79[_0x5b25('0x28')]+')','participationtypemask':_0x4e4d79[_0x5b25('0x4d')]===_0x5b25('0x4e')?0x2:0x1},{'partyid_contact@odata.bind':_0x5b25('0x4f')+_0x4e4d79[_0x5b25('0x2f')]+')','participationtypemask':_0x4e4d79[_0x5b25('0x4d')]===_0x5b25('0x4e')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':'/systemusers('+_0x4e4d79['userId']+')','participationtypemask':_0x4e4d79[_0x5b25('0x4d')]===_0x5b25('0x4e')?0x2:0x1}];_0x31a5ab={'method':_0x5b25('0x11'),'uri':_0x36df66+_0x5b25('0x50'),'body':Object[_0x5b25('0x46')]({},{'subject':intUtil[_0x5b25('0x47')](_0x5d4f11['Subjects'],_0x5b68f0,'\x20'),'phonenumber':String(_0x5b68f0[_0x5b25('0x2a')]),'description':intUtil['getString'](_0x5d4f11[_0x5b25('0x49')],_0x5b68f0,'\x0a'),'regardingobjectid_contact@odata.bind':_0x4e4d79[_0x5b25('0x2f')]?_0x5b25('0x4f')+_0x4e4d79[_0x5b25('0x2f')]+')':undefined,'ownerid@odata.bind':_0x5b25('0x4a')+_0x4e4d79['userId']+')','directioncode':_0x4e4d79[_0x5b25('0x4d')]===_0x5b25('0x4e')?![]:!![],'phonecall_activity_parties':_0x28c21f},getCustomFields(_0x5d4f11[_0x5b25('0x4b')],_0x5b68f0,_0x5d4f11[_0x5b25('0x44')])),'headers':{'Authorization':_0x5b25('0x1c')+_0x74ae6f,'OData-Version':_0x5b25('0x2c')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x31a5ab);})[_0x5b25('0x15')](function(_0x8c08e9){var _0x2c53a6=_0x8c08e9['headers'][_0x5b25('0x2d')];var _0x416f23=_0x2c53a6[_0x5b25('0x41')](_0x2c53a6[_0x5b25('0x2e')]('(')+0x1,_0x2c53a6[_0x5b25('0x2e')](')'));_0x4e4d79[_0x5b25('0x51')]=_0x416f23;_0x24d930(_0x4e4d79);})[_0x5b25('0x30')](function(_0x564626){_0xedf757(_0x564626[_0x5b25('0x1a')]);});});}function emit(_0x4b4030,_0x5ad585,_0x20d939,_0x2c7f53){var _0x4e6df9={'uri':util[_0x5b25('0x52')](_0x5b25('0x53'),_0x4b4030,_0x20d939,_0x2c7f53)};io['to'](util[_0x5b25('0x52')](_0x5b25('0x54'),_0x5ad585))[_0x5b25('0x55')](_0x5b25('0x56'),_0x4e6df9);}exports['cs']=function(_0x542758,_0x69d76a,_0x5655cd,_0x3b8399,_0x2ef663,_0x2d3bcc,_0x457e3a,_0x13aff6){var _0x35b120={};_0x2d3bcc[_0x5b25('0xc')]=_0x2d3bcc[_0x5b25('0x57')]?intUtil[_0x5b25('0x58')](_0x2d3bcc[_0x5b25('0xd')][_0x5b25('0xe')]):intUtil[_0x5b25('0x58')](_0x2d3bcc[_0x5b25('0xc')]);_0x2d3bcc[_0x5b25('0x59')]=intUtil[_0x5b25('0x58')](_0x2d3bcc[_0x5b25('0x59')]);_0x35b120[_0x5b25('0x4d')]=_0x13aff6===_0x5b25('0x4e')||_0x13aff6===_0x5b25('0x5a')?'queue':'outbound';var _0x185574=_0x2d3bcc[_0x5b25('0x57')]?util[_0x5b25('0x52')](_0x5b25('0x5b'),_0x2d3bcc['CloudProvider']['data7']):util[_0x5b25('0x52')]('%s/api/data/v9.0/',_0x2d3bcc[_0x5b25('0xc')]);var _0x53add3=util[_0x5b25('0x52')]('https://login.microsoftonline.com/%s/oauth2/token',_0x2d3bcc['tenantId']);var _0x8bf807=util[_0x5b25('0x52')](_0x5b25('0x5c'),_0x2d3bcc[_0x5b25('0x59')],_0x69d76a['uniqueid'],md5(_0x69d76a['uniqueid']));if(_0x2ef663&&_0x2ef663[_0x5b25('0x5d')]){logger[_0x5b25('0x25')]('[QUEUE]',_0x5b25('0x5e'));_0x69d76a['recordingURL']=_0x8bf807;}else if(_0x457e3a&&_0x457e3a[_0x5b25('0x5f')]&&_0x457e3a[_0x5b25('0x5f')]!==_0x5b25('0x60')){logger[_0x5b25('0x25')](_0x5b25('0x61'),_0x5b25('0x5e'));_0x69d76a[_0x5b25('0x62')]=_0x8bf807;}else{_0x69d76a['recordingURL']='';}return getUser(_0x35b120,_0x2d3bcc,_0x3b8399,_0x53add3,_0x185574,_0x13aff6)[_0x5b25('0x15')](function(_0x5ea77b){logger['info']('['+_0x13aff6['toUpperCase']()+_0x5b25('0x63'),_0x5ea77b[_0x5b25('0x28')]);logger[_0x5b25('0x25')]('['+_0x13aff6[_0x5b25('0x18')]()+_0x5b25('0x64'),_0x5ea77b[_0x5b25('0x20')]);return getEndUser(_0x5ea77b,_0x2d3bcc,_0x53add3,_0x185574,_0x69d76a,_0x13aff6,_0x5655cd['moduleCreate']);})[_0x5b25('0x15')](function(_0x149488){logger['info']('['+_0x13aff6[_0x5b25('0x18')]()+_0x5b25('0x65'),_0x149488['enduserId']);logger['info']('['+_0x13aff6[_0x5b25('0x18')]()+_0x5b25('0x66'),_0x69d76a['calleridnum']);return getTicket(_0x149488,_0x2d3bcc,_0x53add3,_0x185574,_0x69d76a,_0x5655cd,_0x13aff6);})[_0x5b25('0x15')](function(_0x1b9b64){logger[_0x5b25('0x25')](util[_0x5b25('0x52')]('['+_0x13aff6['toUpperCase']()+_0x5b25('0x67'),_0x5655cd['ticketType'],_0x1b9b64['ticketId']));logger['info'](util[_0x5b25('0x52')]('['+_0x13aff6['toUpperCase']()+_0x5b25('0x68'),_0x13aff6));if(_0x13aff6!==_0x5b25('0x5a')){logger[_0x5b25('0x25')]('['+_0x13aff6[_0x5b25('0x18')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x2d3bcc[_0x5b25('0xc')],_0x3b8399[_0x5b25('0x69')],_0x5655cd['ticketType'],_0x1b9b64['ticketId']);}})[_0x5b25('0x30')](function(_0x1c4fdf){logger[_0x5b25('0x17')]('['+_0x13aff6[_0x5b25('0x18')]()+_0x5b25('0x6a'),_0x1c4fdf['message']);});}; \ No newline at end of file +var _0x878e=['incident','incidents','getString','Descriptions','/systemusers(','Fields','ticketType','/contacts(','callDirection','queue','phonecalls','assign','Subjects','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','trigger:browser:url','stripTrailingSlash','serverUrl','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','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','name',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','localhost','modernAuthentication','remoteUri','CloudProvider','data7','tenantId','data2','resolve','clientId','username','password','clientSecret','then','access_token','catch','error',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0','value','isNil','email','userEmail','internalemailaddress','isdisabled','info','toUpperCase',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','length','toLowerCase','outbound','destcalleridnum','calleridnum','POST','contacts','Bearer\x20','headers','odata-entityid','substring','lastIndexOf','enduserId','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','%2b','telephone1','contactid','forEach','includes','picklist','type','nameField','customField','indexOf'];(function(_0x5e18aa,_0xa0a74){var _0x45b5d3=function(_0x1f14cf){while(--_0x1f14cf){_0x5e18aa['push'](_0x5e18aa['shift']());}};_0x45b5d3(++_0xa0a74);}(_0x878e,0x1ce));var _0xe878=function(_0x4d5179,_0x1275a1){_0x4d5179=_0x4d5179-0x0;var _0xe7d4d1=_0x878e[_0x4d5179];return _0xe7d4d1;};'use strict';var _=require(_0xe878('0x0'));var rp=require(_0xe878('0x1'));var util=require(_0xe878('0x2'));var intUtil=require(_0xe878('0x3'));var md5=require(_0xe878('0x4'));var Redis=require(_0xe878('0x5'));var logger=require(_0xe878('0x6'))(_0xe878('0x7'));var config=require(_0xe878('0x8'));config[_0xe878('0x9')]=_[_0xe878('0xa')](config['redis'],{'host':_0xe878('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe878('0x9')]));function getAuthToken(_0x53b136,_0x4d1895,_0x465a65){if(_0x53b136[_0xe878('0xc')]){_0x53b136[_0xe878('0xd')]=_0x53b136[_0xe878('0xe')][_0xe878('0xf')];_0x53b136[_0xe878('0x10')]=_0x53b136[_0xe878('0xe')][_0xe878('0x11')];return Promise[_0xe878('0x12')](_0x53b136['CloudProvider']['data5']);}var _0x466d9d={'method':'POST','uri':_0x4d1895,'form':{'client_id':_0x53b136[_0xe878('0x13')],'resource':_0x53b136[_0xe878('0xd')],'username':_0x53b136[_0xe878('0x14')],'password':_0x53b136[_0xe878('0x15')],'grant_type':'password','client_secret':_0x53b136[_0xe878('0x16')]},'json':!![]};return rp(_0x466d9d)[_0xe878('0x17')](function(_0x11fbfd){return _0x11fbfd[_0xe878('0x18')];})[_0xe878('0x19')](function(_0x1d1ae8){logger[_0xe878('0x1a')]('['+[_0x465a65['toUpperCase']()]+_0xe878('0x1b'));return _0x1d1ae8[_0xe878('0x1c')];});}function getUser(_0x3549a6,_0x12f2cc,_0x31e9c3,_0x2ed61b,_0x53894e,_0x487472){return new Promise(function(_0x296041,_0x20b1aa){return getAuthToken(_0x12f2cc,_0x2ed61b,_0x487472)['then'](function(_0x4217ad){var _0x1106df={'method':_0xe878('0x1d'),'uri':_0x53894e+_0xe878('0x1e'),'headers':{'Authorization':'Bearer\x20'+_0x4217ad,'OData-Version':_0xe878('0x1f')},'json':!![]};return rp(_0x1106df);})[_0xe878('0x17')](function(_0x56ddf6){var _0x2c8812=_0x56ddf6[_0xe878('0x20')];var _0x4fb685=![];var _0x4f5f24=null;if(!_[_0xe878('0x21')](_0x31e9c3)){if(intUtil['validateEmail'](_0x31e9c3[_0xe878('0x22')])){_0x3549a6[_0xe878('0x23')]=_0x31e9c3[_0xe878('0x22')];for(_0x4f5f24=0x0;_0x4f5f24<_0x2c8812['length'];_0x4f5f24++){if(_0x2c8812[_0x4f5f24][_0xe878('0x24')]===_0x31e9c3['email']&&!_0x2c8812[_0x4f5f24][_0xe878('0x25')]){_0x4fb685=!![];logger[_0xe878('0x26')]('['+[_0x487472[_0xe878('0x27')]()]+_0xe878('0x28')+_0x2c8812[_0x4f5f24][_0xe878('0x29')]+'!');_0x3549a6[_0xe878('0x2a')]=_0x2c8812[_0x4f5f24][_0xe878('0x29')];}}}}if(!_0x4fb685){logger['info']('['+[_0x487472[_0xe878('0x27')]()]+_0xe878('0x2b'));_0x3549a6['userEmail']=_0x12f2cc['username'];for(_0x4f5f24=0x0;_0x4f5f24<_0x2c8812[_0xe878('0x2c')];_0x4f5f24++){if(_0x2c8812[_0x4f5f24][_0xe878('0x24')]===_0x12f2cc[_0xe878('0x14')]){_0x3549a6['userId']=_0x2c8812[_0x4f5f24][_0xe878('0x29')];}}}_0x296041(_0x3549a6);})[_0xe878('0x19')](function(_0x5067b3){_0x20b1aa(_0x5067b3[_0xe878('0x1c')]);});});}function createEndUser(_0x146cc7,_0x507784,_0x12967b,_0x4673e3,_0x475840,_0x458068){return new Promise(function(_0x580e10,_0xfdde25){return getAuthToken(_0x507784,_0x12967b,_0x458068)[_0xe878('0x17')](function(_0x2f98da){var _0x4c12d0=_0x458068[_0xe878('0x2d')]()===_0xe878('0x2e')?_0x475840[_0xe878('0x2f')]:_0x475840[_0xe878('0x30')];var _0x105465={'method':_0xe878('0x31'),'uri':_0x4673e3+_0xe878('0x32'),'body':{'telephone1':_0x4c12d0,'fullname':_0x4c12d0,'firstname':_0x4c12d0,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x146cc7[_0xe878('0x2a')]+')'},'headers':{'Authorization':_0xe878('0x33')+_0x2f98da,'OData-Version':_0xe878('0x1f')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x105465);})[_0xe878('0x17')](function(_0x317f5d){var _0x3bf851=_0x317f5d[_0xe878('0x34')][_0xe878('0x35')];var _0x171809=_0x3bf851[_0xe878('0x36')](_0x3bf851[_0xe878('0x37')]('(')+0x1,_0x3bf851[_0xe878('0x37')](')'));_0x146cc7[_0xe878('0x38')]=_0x171809;_0x580e10(_0x146cc7);})['catch'](function(_0x1776e4){_0xfdde25(_0x1776e4[_0xe878('0x1c')]);});});}function getEndUser(_0x1247c4,_0xe9d82e,_0x2938fd,_0x451b6d,_0x2f3854,_0x52e09d,_0x3d7f21){var _0x27f906=_0x52e09d[_0xe878('0x2d')]()===_0xe878('0x2e')?_0x2f3854['destcalleridnum']:_0x2f3854[_0xe878('0x30')];return getAuthToken(_0xe9d82e,_0x2938fd,_0x52e09d)[_0xe878('0x17')](function(_0x56a340){var _0x373c23={'method':_0xe878('0x1d'),'uri':_0x451b6d+_0xe878('0x39')+_0x27f906['replace']('+',_0xe878('0x3a'))+'\x27','headers':{'Authorization':_0xe878('0x33')+_0x56a340,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x373c23);})[_0xe878('0x17')](function(_0x3ea0c5){var _0x1c9f5f=![];if(!_0x3ea0c5)return _0x1c9f5f;var _0x78ec83=_0x3ea0c5[_0xe878('0x20')];for(var _0x4337a4=0x0;_0x4337a4<_0x78ec83[_0xe878('0x2c')];_0x4337a4++){if(_0x78ec83[_0x4337a4][_0xe878('0x3b')]===_0x27f906){_0x1c9f5f=!![];_0x1247c4[_0xe878('0x38')]=_0x78ec83[_0x4337a4][_0xe878('0x3c')];}}return _0x1c9f5f;})[_0xe878('0x17')](function(_0x472fc0){if(_0x472fc0)return _0x1247c4;if(_0x3d7f21==='nothing'){logger[_0xe878('0x26')]('['+[_0x52e09d[_0xe878('0x27')]()]+']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing');return _0x1247c4;}return createEndUser(_0x1247c4,_0xe9d82e,_0x2938fd,_0x451b6d,_0x2f3854,_0x52e09d)[_0xe878('0x17')](function(_0x4c1b93){logger['info']('['+[_0x52e09d['toUpperCase']()]+']\x20Enduser\x20created!',_0x4c1b93[_0xe878('0x38')]);return _0x4c1b93;});});}function getCustomFields(_0x521946,_0x2ffd72,_0x48d8cc){var _0x132e89={};if(_0x521946['length']>0x0){_[_0xe878('0x3d')](_0x521946,function(_0x389f62){if(_[_0xe878('0x3e')](['string',_0xe878('0x3f')],_0x389f62[_0xe878('0x40')])&&_0x389f62[_0xe878('0x41')]&&!_0x389f62[_0xe878('0x42')]){var _0x59efa0=_0x389f62['idField']['toLowerCase']();var _0x361d8c=_0x59efa0[_0xe878('0x36')](0x0,_0x59efa0[_0xe878('0x43')]('_'));var _0x2085d3=_0x59efa0[_0xe878('0x36')](_0x59efa0[_0xe878('0x43')]('_')+0x1);if(_0x361d8c===_0x48d8cc){_0x132e89[_0x2085d3]=_0x389f62['content'];}}});}return _0x132e89;}function getTicket(_0x59c948,_0xe73512,_0x5f05d4,_0xc1f93c,_0x1516e0,_0x4cd0c2,_0x56f2bf){return new Promise(function(_0x1fa5f3,_0x5ec7db){var _0x35572d;return getAuthToken(_0xe73512,_0x5f05d4,_0x56f2bf)[_0xe878('0x17')](function(_0x4aa9cd){if(_0x4cd0c2['ticketType']===_0xe878('0x44')){_0x35572d={'method':_0xe878('0x31'),'uri':_0xc1f93c+_0xe878('0x45'),'body':Object['assign']({},{'title':intUtil[_0xe878('0x46')](_0x4cd0c2['Subjects'],_0x1516e0,'\x20'),'description':intUtil['getString'](_0x4cd0c2[_0xe878('0x47')],_0x1516e0,'\x0a'),'customerid_contact@odata.bind':_0x59c948[_0xe878('0x38')]?'/contacts('+_0x59c948[_0xe878('0x38')]+')':undefined,'ownerid@odata.bind':_0xe878('0x48')+_0x59c948['userId']+')','caseorigincode':'1'},getCustomFields(_0x4cd0c2[_0xe878('0x49')],_0x1516e0,_0x4cd0c2[_0xe878('0x4a')])),'headers':{'Authorization':_0xe878('0x33')+_0x4aa9cd,'OData-Version':_0xe878('0x1f')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x4cd0c2['ticketType']==='phonecall'){var _0x483303=_0x59c948['enduserId']?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x59c948[_0xe878('0x2a')]+')','participationtypemask':_0x59c948['callDirection']==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0xe878('0x4b')+_0x59c948[_0xe878('0x38')]+')','participationtypemask':_0x59c948[_0xe878('0x4c')]===_0xe878('0x4d')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':'/systemusers('+_0x59c948[_0xe878('0x2a')]+')','participationtypemask':_0x59c948[_0xe878('0x4c')]===_0xe878('0x4d')?0x2:0x1}];_0x35572d={'method':'POST','uri':_0xc1f93c+_0xe878('0x4e'),'body':Object[_0xe878('0x4f')]({},{'subject':intUtil[_0xe878('0x46')](_0x4cd0c2[_0xe878('0x50')],_0x1516e0,'\x20'),'phonenumber':String(_0x1516e0[_0xe878('0x30')]),'description':intUtil[_0xe878('0x46')](_0x4cd0c2[_0xe878('0x47')],_0x1516e0,'\x0a'),'regardingobjectid_contact@odata.bind':_0x59c948['enduserId']?_0xe878('0x4b')+_0x59c948[_0xe878('0x38')]+')':undefined,'ownerid@odata.bind':_0xe878('0x48')+_0x59c948[_0xe878('0x2a')]+')','directioncode':_0x59c948[_0xe878('0x4c')]==='queue'?![]:!![],'phonecall_activity_parties':_0x483303},getCustomFields(_0x4cd0c2[_0xe878('0x49')],_0x1516e0,_0x4cd0c2[_0xe878('0x4a')])),'headers':{'Authorization':_0xe878('0x33')+_0x4aa9cd,'OData-Version':_0xe878('0x1f')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x35572d);})['then'](function(_0x41c9c1){var _0x319120=_0x41c9c1[_0xe878('0x34')][_0xe878('0x35')];var _0x42a7bd=_0x319120['substring'](_0x319120[_0xe878('0x37')]('(')+0x1,_0x319120['lastIndexOf'](')'));_0x59c948[_0xe878('0x51')]=_0x42a7bd;_0x1fa5f3(_0x59c948);})['catch'](function(_0x1efcc5){_0x5ec7db(_0x1efcc5[_0xe878('0x1c')]);});});}function emit(_0x635a0f,_0x115e7f,_0x347014,_0x55eac6){var _0x225a69={'uri':util[_0xe878('0x52')](_0xe878('0x53'),_0x635a0f,_0x347014,_0x55eac6)};io['to'](util[_0xe878('0x52')](_0xe878('0x54'),_0x115e7f))['emit'](_0xe878('0x55'),_0x225a69);}exports['cs']=function(_0x1214d3,_0x45fbc9,_0x5739cf,_0x386ba4,_0x406d76,_0x23298a,_0x11e79f,_0x10e3b5){var _0x50fb15={};_0x23298a[_0xe878('0xd')]=_0x23298a[_0xe878('0xc')]?intUtil[_0xe878('0x56')](_0x23298a['CloudProvider'][_0xe878('0xf')]):intUtil[_0xe878('0x56')](_0x23298a[_0xe878('0xd')]);_0x23298a[_0xe878('0x57')]=intUtil[_0xe878('0x56')](_0x23298a[_0xe878('0x57')]);_0x50fb15['callDirection']=_0x10e3b5===_0xe878('0x4d')||_0x10e3b5===_0xe878('0x58')?'queue':_0xe878('0x2e');var _0x5d590a=_0x23298a[_0xe878('0xc')]?util[_0xe878('0x52')](_0xe878('0x59'),_0x23298a[_0xe878('0xe')][_0xe878('0xf')]):util[_0xe878('0x52')]('%s/api/data/v9.0/',_0x23298a['remoteUri']);var _0x59440d=util[_0xe878('0x52')](_0xe878('0x5a'),_0x23298a[_0xe878('0x10')]);var _0x142a85=util[_0xe878('0x52')](_0xe878('0x5b'),_0x23298a[_0xe878('0x57')],_0x45fbc9[_0xe878('0x5c')],md5(_0x45fbc9[_0xe878('0x5c')]));if(_0x406d76&&_0x406d76[_0xe878('0x5d')]){logger[_0xe878('0x26')]('[QUEUE]',_0xe878('0x5e'));_0x45fbc9[_0xe878('0x5f')]=_0x142a85;}else if(_0x11e79f&&_0x11e79f[_0xe878('0x60')]&&_0x11e79f[_0xe878('0x60')]!==_0xe878('0x61')){logger[_0xe878('0x26')]('[OUTBOUND]',_0xe878('0x5e'));_0x45fbc9[_0xe878('0x5f')]=_0x142a85;}else{_0x45fbc9['recordingURL']='';}return getUser(_0x50fb15,_0x23298a,_0x386ba4,_0x59440d,_0x5d590a,_0x10e3b5)[_0xe878('0x17')](function(_0x209aab){logger['info']('['+_0x10e3b5['toUpperCase']()+_0xe878('0x62'),_0x209aab['userId']);logger[_0xe878('0x26')]('['+_0x10e3b5[_0xe878('0x27')]()+_0xe878('0x63'),_0x209aab['userEmail']);return getEndUser(_0x209aab,_0x23298a,_0x59440d,_0x5d590a,_0x45fbc9,_0x10e3b5,_0x5739cf[_0xe878('0x64')]);})[_0xe878('0x17')](function(_0x2b90bf){logger[_0xe878('0x26')]('['+_0x10e3b5[_0xe878('0x27')]()+_0xe878('0x65'),_0x2b90bf[_0xe878('0x38')]);logger[_0xe878('0x26')]('['+_0x10e3b5[_0xe878('0x27')]()+_0xe878('0x66'),_0x45fbc9['calleridnum']);return getTicket(_0x2b90bf,_0x23298a,_0x59440d,_0x5d590a,_0x45fbc9,_0x5739cf,_0x10e3b5);})[_0xe878('0x17')](function(_0x23cc81){logger['info'](util['format']('['+_0x10e3b5[_0xe878('0x27')]()+_0xe878('0x67'),_0x5739cf['ticketType'],_0x23cc81[_0xe878('0x51')]));logger[_0xe878('0x26')](util['format']('['+_0x10e3b5[_0xe878('0x27')]()+']\x20Call\x20direction:\x20%s',_0x10e3b5));if(_0x10e3b5!==_0xe878('0x58')){logger[_0xe878('0x26')]('['+_0x10e3b5['toUpperCase']()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x23298a['remoteUri'],_0x386ba4[_0xe878('0x68')],_0x5739cf[_0xe878('0x4a')],_0x23cc81[_0xe878('0x51')]);}})[_0xe878('0x19')](function(_0x3ea867){logger[_0xe878('0x1a')]('['+_0x10e3b5['toUpperCase']()+_0xe878('0x69'),_0x3ea867['message']);});}; \ 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 fa5e5c4..5586e82 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 _0x997c=['Subjects','Descriptions','
','name','custom_fields','keyBy','value','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','%s/api/v2/agents','length','Agent\x20found!','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','find','Enduser\x20created.','Basic\x20%s','apiKey','base64','debug','[HTTP]','stringify','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','toString','idField','push','variable','variableName','customVariable','Variable','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','none','[OUTBOUND]','Authorization','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','unmanaged','lastevent','toUpperCase','calleridnum','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','format','Caller\x20-\x20%s','getString'];(function(_0x69ea92,_0x14506b){var _0x45b8ea=function(_0x2a33c0){while(--_0x2a33c0){_0x69ea92['push'](_0x69ea92['shift']());}};_0x45b8ea(++_0x14506b);}(_0x997c,0xae));var _0xc997=function(_0xf759e3,_0x6fe18c){_0xf759e3=_0xf759e3-0x0;var _0xff6c1f=_0x997c[_0xf759e3];return _0xff6c1f;};'use strict';var _=require(_0xc997('0x0'));var rp=require(_0xc997('0x1'));var md5=require('md5');var util=require(_0xc997('0x2'));var Redis=require(_0xc997('0x3'));var intUtil=require(_0xc997('0x4'));var config=require(_0xc997('0x5'));var logger=require(_0xc997('0x6'))(_0xc997('0x7'));config[_0xc997('0x8')]=_[_0xc997('0x9')](config['redis'],{'host':_0xc997('0xa'),'port':0x18eb});var io=require(_0xc997('0xb'))(new Redis(config[_0xc997('0x8')]));var headers={'Content-Type':_0xc997('0xc'),'Accept':_0xc997('0xc')};function emit(_0x160803,_0x29b3ba,_0x4817b9){io['to'](_0x160803)[_0xc997('0xd')](_0x29b3ba,_0x4817b9);}function getTicket(_0x49d753,_0x12eeaa,_0xd1f8c1,_0x1eae3b,_0xeacf0a){logger[_0xc997('0xe')]('Creating\x20new\x20ticket...');var _0x395b15=_['merge']({'responder_id':_0x12eeaa['id'],'requester_id':_0xd1f8c1['id'],'name':util[_0xc997('0xf')](_0xc997('0x10'),_0xeacf0a['calleridname']),'phone':_0xeacf0a['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xc997('0x11')](_0x1eae3b[_0xc997('0x12')],_0xeacf0a,'\x20'),'description':intUtil[_0xc997('0x11')](_0x1eae3b[_0xc997('0x13')],_0xeacf0a,_0xc997('0x14')),'tags':getTags(_0x1eae3b['Tags'],_0xc997('0x15'))},getCustomFields(_0x1eae3b['Fields'],_0xeacf0a));_0x395b15[_0xc997('0x16')]=_['mapValues'](_[_0xc997('0x17')](_0x395b15[_0xc997('0x16')],'id'),_0xc997('0x18'));return request({'uri':util['format'](_0xc997('0x19'),_0x49d753[_0xc997('0x1a')]),'method':_0xc997('0x1b'),'body':_0x395b15})[_0xc997('0x1c')](function(_0x283cb3){logger[_0xc997('0xe')](_0xc997('0x1d'));return _0x283cb3;});}function getUser(_0x247165,_0x1e512d){if(intUtil['validateEmail'](_0x1e512d)){return request({'uri':util[_0xc997('0xf')](_0xc997('0x1e'),_0x247165[_0xc997('0x1a')]),'qs':{'email':_0x1e512d}})[_0xc997('0x1c')](function(_0x432c55){if(_0x432c55[_0xc997('0x1f')]){logger['info'](_0xc997('0x20'));return _['find'](_0x432c55,function(_0x32cf1d){return _0x32cf1d[_0xc997('0x21')][_0xc997('0x22')]===_0x1e512d;});}else{logger[_0xc997('0xe')](_0xc997('0x23'));return request({'uri':util[_0xc997('0xf')](_0xc997('0x24'),_0x247165['remoteUri'])})[_0xc997('0x1c')](function(_0x39d66d){logger[_0xc997('0xe')]('Admin\x20account\x20selected.');return _0x39d66d;});}});}else{logger['info'](_0xc997('0x25'));return request({'uri':util[_0xc997('0xf')](_0xc997('0x24'),_0x247165['remoteUri'])})[_0xc997('0x1c')](function(_0x59552d){logger[_0xc997('0xe')](_0xc997('0x26'));return _0x59552d;});}}function getEndUser(_0x187b01,_0x3957a6,_0x31aa35){logger[_0xc997('0xe')](_0xc997('0x27'),_0x31aa35);return request({'uri':util[_0xc997('0xf')](_0xc997('0x28'),_0x187b01[_0xc997('0x1a')]),'qs':{'phone':_0x31aa35}})[_0xc997('0x1c')](function(_0x15d6e0){if(_0x15d6e0[_0xc997('0x1f')]){logger[_0xc997('0xe')](_0xc997('0x29'));return _[_0xc997('0x2a')](_0x15d6e0,{'phone':_0x31aa35});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xc997('0xf')]('%s/api/v2/contacts',_0x187b01['remoteUri']),'method':'POST','body':{'name':_0x3957a6,'phone':_0x31aa35}})[_0xc997('0x1c')](function(_0x401db6){logger['info'](_0xc997('0x2b'));return _0x401db6;});}});}function getAuth(_0x3ea185){return util[_0xc997('0xf')](_0xc997('0x2c'),new Buffer(_0x3ea185[_0xc997('0x2d')]+':X')['toString'](_0xc997('0x2e')));}function request(_0x27942b){logger[_0xc997('0x2f')](_0xc997('0x30'),JSON[_0xc997('0x31')](_0x27942b));return rp(_[_0xc997('0x9')](_0x27942b,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0xbd05fd,_0x552d91){var _0x107fc3=[];if(_0xbd05fd&&_0xbd05fd[_0xc997('0x1f')]>0x0){_0x107fc3=_[_0xc997('0x32')](_0xbd05fd,_0x552d91);}return _0x107fc3;}function getCustomFields(_0x2d36d5,_0x55b69d){var _0x3c6a7a=[];var _0x28ba74={'custom_fields':[]};if(_0x2d36d5[_0xc997('0x1f')]>0x0){_[_0xc997('0x33')](_0x2d36d5,function(_0x5700c){if(_[_0xc997('0x34')]([_0xc997('0x35'),_0xc997('0x36')],_0x5700c[_0xc997('0x37')])&&_0x5700c[_0xc997('0x38')]&&!_0x5700c[_0xc997('0x39')]){_0x28ba74[_0x5700c['nameField'][_0xc997('0x3a')]()]=_0x5700c[_0xc997('0x3b')][_0xc997('0x3c')]();}else if(_['includes']([_0xc997('0x35'),_0xc997('0x36')],_0x5700c['type'])&&_0x5700c[_0xc997('0x3d')]&&_0x5700c[_0xc997('0x39')]){_0x28ba74[_0xc997('0x16')][_0xc997('0x3e')]({'id':_0x5700c[_0xc997('0x3d')],'value':_0x5700c[_0xc997('0x3b')][_0xc997('0x3c')]()});}else if(_0x5700c[_0xc997('0x37')]===_0xc997('0x3f')&&_0x5700c[_0xc997('0x40')]&&_0x5700c[_0xc997('0x3d')]&&_0x5700c['customField']){_0x55b69d[_0x5700c[_0xc997('0x40')]]&&_0x28ba74[_0xc997('0x16')][_0xc997('0x3e')]({'id':_0x5700c[_0xc997('0x3d')],'value':_0x55b69d[_0x5700c[_0xc997('0x40')]]['toString']()});}else if(_0x5700c[_0xc997('0x37')]===_0xc997('0x41')&&_0x5700c[_0xc997('0x42')]&&_0x5700c[_0xc997('0x42')][_0xc997('0x15')]&&_0x5700c['idField']&&_0x5700c[_0xc997('0x39')]){_0x55b69d[_0x5700c[_0xc997('0x42')]['name']['toLowerCase']()]&&_0x28ba74[_0xc997('0x16')][_0xc997('0x3e')]({'id':_0x5700c[_0xc997('0x3d')],'value':_0x55b69d[_0x5700c[_0xc997('0x42')][_0xc997('0x15')][_0xc997('0x3a')]()][_0xc997('0x3c')]()});}});}return _0x28ba74;}exports['queue']=function(_0xa9191d,_0x2a262b,_0x135026,_0x234c2d,_0x148329,_0x291b1b){var _0x24ae01,_0xd11277;_0x291b1b[_0xc997('0x1a')]=intUtil[_0xc997('0x43')](_0x291b1b[_0xc997('0x1a')]);_0x291b1b[_0xc997('0x44')]=intUtil[_0xc997('0x43')](_0x291b1b[_0xc997('0x44')]);if(_0x148329&&_0x148329[_0xc997('0x45')]){logger['info'](_0xc997('0x46'),_0xc997('0x47'));_0x2a262b[_0xc997('0x48')]=util[_0xc997('0xf')](_0xc997('0x49'),_0x291b1b['serverUrl'],_0x2a262b['uniqueid'],md5(_0x2a262b[_0xc997('0x4a')]));}else{_0x2a262b[_0xc997('0x48')]='';}headers['Authorization']=getAuth(_0x291b1b);return getUser(_0x291b1b,_0x234c2d[_0xc997('0x22')])['then'](function(_0x2e8765){_0x24ae01=_0x2e8765;logger[_0xc997('0xe')]('The\x20User\x20ID\x20is:',_0x24ae01['id']);return getEndUser(_0x291b1b,_0x2a262b[_0xc997('0x4b')],_0x2a262b['calleridnum']);})[_0xc997('0x1c')](function(_0x530d1c){_0xd11277=_0x530d1c;logger['info'](_0xc997('0x4c'),_0xd11277['id']);return getTicket(_0x291b1b,_0x24ae01,_0xd11277,_0x135026,_0x2a262b);})[_0xc997('0x1c')](function(_0x478d3e){if(_0x478d3e&&_0x478d3e['id']){logger['info'](_0xc997('0x1d'));logger[_0xc997('0xe')](_0xc997('0x4d'),_0x478d3e['id']);logger[_0xc997('0xe')](_0xc997('0x46'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xc997('0xf')]('user:%s',_0x234c2d['name']),_0xc997('0x4e'),{'uri':util[_0xc997('0xf')](_0xc997('0x4f'),_0x291b1b['remoteUri'],_0x478d3e['id'])});}})[_0xc997('0x50')](function(_0x49f48b){logger[_0xc997('0x51')](_0xc997('0x46'),JSON['stringify'](_0x49f48b));});};exports[_0xc997('0x52')]=function(_0x569b49,_0x258639,_0x25a85d,_0x633c18,_0x576ad5,_0x3c584c,_0x4d501e){var _0x30893c,_0x547343;_0x3c584c[_0xc997('0x1a')]=intUtil[_0xc997('0x43')](_0x3c584c[_0xc997('0x1a')]);_0x3c584c[_0xc997('0x44')]=intUtil['stripTrailingSlash'](_0x3c584c[_0xc997('0x44')]);if(_0x4d501e&&_0x4d501e['recordingFormat']&&_0x4d501e[_0xc997('0x53')]!==_0xc997('0x54')){logger[_0xc997('0xe')](_0xc997('0x55'),_0xc997('0x47'));_0x258639[_0xc997('0x48')]=util['format'](_0xc997('0x49'),_0x3c584c['serverUrl'],_0x258639['uniqueid'],md5(_0x258639[_0xc997('0x4a')]));}headers[_0xc997('0x56')]=getAuth(_0x3c584c);return getUser(_0x3c584c,_0x633c18['email'])['then'](function(_0x276bc1){_0x30893c=_0x276bc1;logger[_0xc997('0xe')](_0xc997('0x57'),_0x30893c['id']);return getEndUser(_0x3c584c,_0x258639[_0xc997('0x58')],_0x258639[_0xc997('0x59')]);})[_0xc997('0x1c')](function(_0x42c46b){_0x547343=_0x42c46b;logger['info']('The\x20Enduser\x20ID\x20is:',_0x547343['id']);return getTicket(_0x3c584c,_0x30893c,_0x547343,_0x25a85d,_0x258639);})[_0xc997('0x1c')](function(_0xed4a41){if(_0xed4a41&&_0xed4a41['id']){logger[_0xc997('0xe')]('Ticket\x20created!');logger[_0xc997('0xe')]('The\x20Ticket\x20ID\x20is:',_0xed4a41['id']);logger[_0xc997('0xe')](_0xc997('0x55'),_0xc997('0x5a'));emit(util[_0xc997('0xf')](_0xc997('0x5b'),_0x633c18[_0xc997('0x15')]),'trigger:browser:url',{'uri':util[_0xc997('0xf')](_0xc997('0x4f'),_0x3c584c['remoteUri'],_0xed4a41['id'])});}})[_0xc997('0x50')](function(_0x25dbeb){logger['error']('[OUTBOUND]',JSON[_0xc997('0x31')](_0x25dbeb));});};exports[_0xc997('0x5c')]=function(_0x3c4b2c,_0x483906,_0x13ca23,_0x80e389,_0x226503,_0x3adf2e){var _0x2b6b72,_0x18600b;_0x3adf2e[_0xc997('0x1a')]=intUtil['stripTrailingSlash'](_0x3adf2e[_0xc997('0x1a')]);_0x3adf2e[_0xc997('0x44')]=intUtil[_0xc997('0x43')](_0x3adf2e[_0xc997('0x44')]);if(_0x226503&&_0x226503[_0xc997('0x45')]){logger[_0xc997('0xe')]('['+_0x483906[_0xc997('0x5d')][_0xc997('0x5e')]()+']',_0xc997('0x47'));_0x483906[_0xc997('0x48')]=util[_0xc997('0xf')](_0xc997('0x49'),_0x3adf2e[_0xc997('0x44')],_0x483906[_0xc997('0x4a')],md5(_0x483906['uniqueid']));}else{_0x483906[_0xc997('0x48')]='';}headers[_0xc997('0x56')]=getAuth(_0x3adf2e);return getUser(_0x3adf2e,'')['then'](function(_0x4c1510){_0x2b6b72=_0x4c1510;logger[_0xc997('0xe')](_0xc997('0x57'),_0x2b6b72['id']);return getEndUser(_0x3adf2e,_0x483906[_0xc997('0x4b')],_0x483906[_0xc997('0x5f')]);})[_0xc997('0x1c')](function(_0x53c509){_0x18600b=_0x53c509;logger[_0xc997('0xe')](_0xc997('0x4c'),_0x18600b['id']);return getTicket(_0x3adf2e,_0x2b6b72,_0x18600b,_0x13ca23,_0x483906);})[_0xc997('0x1c')](function(_0x6c5532){if(_0x6c5532){logger[_0xc997('0xe')](_0xc997('0x1d'));logger[_0xc997('0xe')](_0xc997('0x4d'),_0x6c5532['id']);}})[_0xc997('0x50')](function(_0x4e17a0){logger[_0xc997('0x51')]('['+_0x483906[_0xc997('0x5d')][_0xc997('0x5e')]()+']',JSON[_0xc997('0x31')](_0x4e17a0));});}; \ No newline at end of file +var _0x503c=['trigger:browser:url','catch','error','outbound','serverUrl','recordingFormat','none','[OUTBOUND]','destcalleridnum','%s/helpdesk/tickets/%d','unmanaged','toUpperCase','lastevent','lodash','request-promise','md5','util','ioredis','./util','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','Creating\x20new\x20ticket...','format','calleridname','calleridnum','getString','Subjects','Descriptions','name','Fields','custom_fields','mapValues','value','remoteUri','POST','info','Ticket\x20created!','validateEmail','%s/api/v2/agents','Agent\x20found!','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','then','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','length','Enduser\x20found!','find','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Basic\x20%s','apiKey','[HTTP]','stringify','GET','map','forEach','includes','picklist','type','nameField','customField','toLowerCase','content','toString','string','push','idField','variableName','customVariable','Variable','queue','stripTrailingSlash','monitor_format','[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'];(function(_0xc8fa31,_0x1212f9){var _0x1a32fc=function(_0x440fcd){while(--_0x440fcd){_0xc8fa31['push'](_0xc8fa31['shift']());}};_0x1a32fc(++_0x1212f9);}(_0x503c,0x124));var _0xc503=function(_0x340aa9,_0x212291){_0x340aa9=_0x340aa9-0x0;var _0x25efee=_0x503c[_0x340aa9];return _0x25efee;};'use strict';var _=require(_0xc503('0x0'));var rp=require(_0xc503('0x1'));var md5=require(_0xc503('0x2'));var util=require(_0xc503('0x3'));var Redis=require(_0xc503('0x4'));var intUtil=require(_0xc503('0x5'));var config=require('../../../../config/environment');var logger=require(_0xc503('0x6'))(_0xc503('0x7'));config[_0xc503('0x8')]=_[_0xc503('0x9')](config[_0xc503('0x8')],{'host':_0xc503('0xa'),'port':0x18eb});var io=require(_0xc503('0xb'))(new Redis(config[_0xc503('0x8')]));var headers={'Content-Type':'application/json','Accept':_0xc503('0xc')};function emit(_0x32f2db,_0x54bb07,_0x4f39fc){io['to'](_0x32f2db)[_0xc503('0xd')](_0x54bb07,_0x4f39fc);}function getTicket(_0x11525a,_0x50128c,_0x1001ae,_0x2e0e0e,_0x5eeebf){logger['info'](_0xc503('0xe'));var _0x4f9645=_['merge']({'responder_id':_0x50128c['id'],'requester_id':_0x1001ae['id'],'name':util[_0xc503('0xf')]('Caller\x20-\x20%s',_0x5eeebf[_0xc503('0x10')]),'phone':_0x5eeebf[_0xc503('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xc503('0x12')](_0x2e0e0e[_0xc503('0x13')],_0x5eeebf,'\x20'),'description':intUtil[_0xc503('0x12')](_0x2e0e0e[_0xc503('0x14')],_0x5eeebf,'
'),'tags':getTags(_0x2e0e0e['Tags'],_0xc503('0x15'))},getCustomFields(_0x2e0e0e[_0xc503('0x16')],_0x5eeebf));_0x4f9645[_0xc503('0x17')]=_[_0xc503('0x18')](_['keyBy'](_0x4f9645[_0xc503('0x17')],'id'),_0xc503('0x19'));return request({'uri':util[_0xc503('0xf')]('%s/api/v2/tickets',_0x11525a[_0xc503('0x1a')]),'method':_0xc503('0x1b'),'body':_0x4f9645})['then'](function(_0x3f03e6){logger[_0xc503('0x1c')](_0xc503('0x1d'));return _0x3f03e6;});}function getUser(_0x145da1,_0x522462){if(intUtil[_0xc503('0x1e')](_0x522462)){return request({'uri':util[_0xc503('0xf')](_0xc503('0x1f'),_0x145da1['remoteUri']),'qs':{'email':_0x522462}})['then'](function(_0x5c283b){if(_0x5c283b['length']){logger[_0xc503('0x1c')](_0xc503('0x20'));return _['find'](_0x5c283b,function(_0x4b4fba){return _0x4b4fba['contact'][_0xc503('0x21')]===_0x522462;});}else{logger[_0xc503('0x1c')](_0xc503('0x22'));return request({'uri':util[_0xc503('0xf')]('%s/api/v2/agents/me',_0x145da1[_0xc503('0x1a')])})[_0xc503('0x23')](function(_0xe60605){logger[_0xc503('0x1c')](_0xc503('0x24'));return _0xe60605;});}});}else{logger['info'](_0xc503('0x25'));return request({'uri':util['format'](_0xc503('0x26'),_0x145da1[_0xc503('0x1a')])})['then'](function(_0xda2a37){logger['info']('Admin\x20account\x20selected.');return _0xda2a37;});}}function getEndUser(_0xbd7ac9,_0x2e71f7,_0x47adb3){logger['info'](_0xc503('0x27'),_0x47adb3);return request({'uri':util[_0xc503('0xf')](_0xc503('0x28'),_0xbd7ac9[_0xc503('0x1a')]),'qs':{'phone':_0x47adb3}})['then'](function(_0x513b09){if(_0x513b09[_0xc503('0x29')]){logger['info'](_0xc503('0x2a'));return _[_0xc503('0x2b')](_0x513b09,{'phone':_0x47adb3});}else{logger['info'](_0xc503('0x2c'));return request({'uri':util[_0xc503('0xf')](_0xc503('0x28'),_0xbd7ac9[_0xc503('0x1a')]),'method':_0xc503('0x1b'),'body':{'name':_0x2e71f7,'phone':_0x47adb3}})[_0xc503('0x23')](function(_0x3d545c){logger[_0xc503('0x1c')]('Enduser\x20created.');return _0x3d545c;});}});}function getAuth(_0x451b29){return util[_0xc503('0xf')](_0xc503('0x2d'),new Buffer(_0x451b29[_0xc503('0x2e')]+':X')['toString']('base64'));}function request(_0x49b2ca){logger['debug'](_0xc503('0x2f'),JSON[_0xc503('0x30')](_0x49b2ca));return rp(_[_0xc503('0x9')](_0x49b2ca,{'method':_0xc503('0x31'),'headers':headers,'json':!![]}));}function getTags(_0x3303c3,_0x825b8a){var _0x12b13f=[];if(_0x3303c3&&_0x3303c3[_0xc503('0x29')]>0x0){_0x12b13f=_[_0xc503('0x32')](_0x3303c3,_0x825b8a);}return _0x12b13f;}function getCustomFields(_0x127500,_0x4587da){var _0x59ceeb=[];var _0x5ee582={'custom_fields':[]};if(_0x127500[_0xc503('0x29')]>0x0){_[_0xc503('0x33')](_0x127500,function(_0x3d282a){if(_[_0xc503('0x34')](['string',_0xc503('0x35')],_0x3d282a[_0xc503('0x36')])&&_0x3d282a[_0xc503('0x37')]&&!_0x3d282a[_0xc503('0x38')]){_0x5ee582[_0x3d282a[_0xc503('0x37')][_0xc503('0x39')]()]=_0x3d282a[_0xc503('0x3a')][_0xc503('0x3b')]();}else if(_[_0xc503('0x34')]([_0xc503('0x3c'),'picklist'],_0x3d282a[_0xc503('0x36')])&&_0x3d282a['idField']&&_0x3d282a[_0xc503('0x38')]){_0x5ee582[_0xc503('0x17')][_0xc503('0x3d')]({'id':_0x3d282a[_0xc503('0x3e')],'value':_0x3d282a[_0xc503('0x3a')][_0xc503('0x3b')]()});}else if(_0x3d282a[_0xc503('0x36')]==='variable'&&_0x3d282a[_0xc503('0x3f')]&&_0x3d282a[_0xc503('0x3e')]&&_0x3d282a[_0xc503('0x38')]){_0x4587da[_0x3d282a[_0xc503('0x3f')]]&&_0x5ee582['custom_fields'][_0xc503('0x3d')]({'id':_0x3d282a[_0xc503('0x3e')],'value':_0x4587da[_0x3d282a[_0xc503('0x3f')]]['toString']()});}else if(_0x3d282a[_0xc503('0x36')]===_0xc503('0x40')&&_0x3d282a[_0xc503('0x41')]&&_0x3d282a[_0xc503('0x41')][_0xc503('0x15')]&&_0x3d282a[_0xc503('0x3e')]&&_0x3d282a[_0xc503('0x38')]){_0x4587da[_0x3d282a['Variable']['name'][_0xc503('0x39')]()]&&_0x5ee582[_0xc503('0x17')][_0xc503('0x3d')]({'id':_0x3d282a[_0xc503('0x3e')],'value':_0x4587da[_0x3d282a[_0xc503('0x41')][_0xc503('0x15')]['toLowerCase']()]['toString']()});}});}return _0x5ee582;}exports[_0xc503('0x42')]=function(_0x36b5ba,_0x4fdc98,_0x31cf9b,_0x32c47b,_0x496893,_0x4c1412){var _0x4c274f,_0x381ede;_0x4c1412[_0xc503('0x1a')]=intUtil[_0xc503('0x43')](_0x4c1412[_0xc503('0x1a')]);_0x4c1412['serverUrl']=intUtil[_0xc503('0x43')](_0x4c1412['serverUrl']);if(_0x496893&&_0x496893[_0xc503('0x44')]){logger[_0xc503('0x1c')](_0xc503('0x45'),_0xc503('0x46'));_0x4fdc98[_0xc503('0x47')]=util[_0xc503('0xf')](_0xc503('0x48'),_0x4c1412['serverUrl'],_0x4fdc98[_0xc503('0x49')],md5(_0x4fdc98[_0xc503('0x49')]));}else{_0x4fdc98[_0xc503('0x47')]='';}headers[_0xc503('0x4a')]=getAuth(_0x4c1412);return getUser(_0x4c1412,_0x32c47b[_0xc503('0x21')])[_0xc503('0x23')](function(_0x178b5f){_0x4c274f=_0x178b5f;logger['info'](_0xc503('0x4b'),_0x4c274f['id']);return getEndUser(_0x4c1412,_0x4fdc98[_0xc503('0x10')],_0x4fdc98[_0xc503('0x11')]);})['then'](function(_0x4f28a7){_0x381ede=_0x4f28a7;logger['info'](_0xc503('0x4c'),_0x381ede['id']);return getTicket(_0x4c1412,_0x4c274f,_0x381ede,_0x31cf9b,_0x4fdc98);})[_0xc503('0x23')](function(_0x56fb99){if(_0x56fb99&&_0x56fb99['id']){logger[_0xc503('0x1c')]('Ticket\x20created!');logger[_0xc503('0x1c')](_0xc503('0x4d'),_0x56fb99['id']);logger[_0xc503('0x1c')](_0xc503('0x45'),_0xc503('0x4e'));emit(util[_0xc503('0xf')](_0xc503('0x4f'),_0x32c47b[_0xc503('0x15')]),_0xc503('0x50'),{'uri':util[_0xc503('0xf')]('%s/helpdesk/tickets/%d',_0x4c1412[_0xc503('0x1a')],_0x56fb99['id'])});}})[_0xc503('0x51')](function(_0x4b2276){logger[_0xc503('0x52')]('[QUEUE]',JSON[_0xc503('0x30')](_0x4b2276));});};exports[_0xc503('0x53')]=function(_0x1133f0,_0x211b2c,_0x28f6d9,_0x39b9a0,_0x394e54,_0x39dfaa,_0xd07f26){var _0x1b6141,_0x461a28;_0x39dfaa[_0xc503('0x1a')]=intUtil['stripTrailingSlash'](_0x39dfaa[_0xc503('0x1a')]);_0x39dfaa['serverUrl']=intUtil[_0xc503('0x43')](_0x39dfaa[_0xc503('0x54')]);if(_0xd07f26&&_0xd07f26[_0xc503('0x55')]&&_0xd07f26['recordingFormat']!==_0xc503('0x56')){logger[_0xc503('0x1c')](_0xc503('0x57'),_0xc503('0x46'));_0x211b2c[_0xc503('0x47')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x39dfaa[_0xc503('0x54')],_0x211b2c['uniqueid'],md5(_0x211b2c[_0xc503('0x49')]));}headers[_0xc503('0x4a')]=getAuth(_0x39dfaa);return getUser(_0x39dfaa,_0x39b9a0[_0xc503('0x21')])[_0xc503('0x23')](function(_0x211a32){_0x1b6141=_0x211a32;logger[_0xc503('0x1c')](_0xc503('0x4b'),_0x1b6141['id']);return getEndUser(_0x39dfaa,_0x211b2c['destcalleridname'],_0x211b2c[_0xc503('0x58')]);})[_0xc503('0x23')](function(_0x164342){_0x461a28=_0x164342;logger[_0xc503('0x1c')](_0xc503('0x4c'),_0x461a28['id']);return getTicket(_0x39dfaa,_0x1b6141,_0x461a28,_0x28f6d9,_0x211b2c);})[_0xc503('0x23')](function(_0x23801e){if(_0x23801e&&_0x23801e['id']){logger[_0xc503('0x1c')](_0xc503('0x1d'));logger[_0xc503('0x1c')](_0xc503('0x4d'),_0x23801e['id']);logger[_0xc503('0x1c')]('[OUTBOUND]',_0xc503('0x4e'));emit(util[_0xc503('0xf')]('user:%s',_0x39b9a0['name']),_0xc503('0x50'),{'uri':util['format'](_0xc503('0x59'),_0x39dfaa[_0xc503('0x1a')],_0x23801e['id'])});}})[_0xc503('0x51')](function(_0x594420){logger[_0xc503('0x52')](_0xc503('0x57'),JSON[_0xc503('0x30')](_0x594420));});};exports[_0xc503('0x5a')]=function(_0x17da9c,_0x5068fa,_0x1c1c56,_0x403e1a,_0x2592f7,_0x4b15e5){var _0x3dac6b,_0x5d4f27;_0x4b15e5[_0xc503('0x1a')]=intUtil['stripTrailingSlash'](_0x4b15e5[_0xc503('0x1a')]);_0x4b15e5[_0xc503('0x54')]=intUtil[_0xc503('0x43')](_0x4b15e5[_0xc503('0x54')]);if(_0x2592f7&&_0x2592f7[_0xc503('0x44')]){logger['info']('['+_0x5068fa['lastevent'][_0xc503('0x5b')]()+']',_0xc503('0x46'));_0x5068fa['recordingURL']=util['format'](_0xc503('0x48'),_0x4b15e5[_0xc503('0x54')],_0x5068fa[_0xc503('0x49')],md5(_0x5068fa[_0xc503('0x49')]));}else{_0x5068fa[_0xc503('0x47')]='';}headers[_0xc503('0x4a')]=getAuth(_0x4b15e5);return getUser(_0x4b15e5,'')[_0xc503('0x23')](function(_0x2d142f){_0x3dac6b=_0x2d142f;logger[_0xc503('0x1c')]('The\x20User\x20ID\x20is:',_0x3dac6b['id']);return getEndUser(_0x4b15e5,_0x5068fa[_0xc503('0x10')],_0x5068fa[_0xc503('0x11')]);})[_0xc503('0x23')](function(_0x34536e){_0x5d4f27=_0x34536e;logger[_0xc503('0x1c')](_0xc503('0x4c'),_0x5d4f27['id']);return getTicket(_0x4b15e5,_0x3dac6b,_0x5d4f27,_0x1c1c56,_0x5068fa);})[_0xc503('0x23')](function(_0x5d0fad){if(_0x5d0fad){logger[_0xc503('0x1c')](_0xc503('0x1d'));logger[_0xc503('0x1c')](_0xc503('0x4d'),_0x5d0fad['id']);}})[_0xc503('0x51')](function(_0x3c644a){logger[_0xc503('0x52')]('['+_0x5068fa[_0xc503('0x5c')]['toUpperCase']()+']',JSON[_0xc503('0x30')](_0x3c644a));});}; \ 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 1882ad4..43eaa9c 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 _0xee70=['&f=','find','format','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','add','ticketId','Task\x20created:','/contacts/','user:%s','emit','apiKey','remoteUri','serverUrl','stripTrailingSlash','adminEmail','destcalleridnum','calleridnum','callDirection','unmanaged','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','lodash','request-promise','md5','bluebird','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','localhost','socket.io-emitter','GET','headers','info','users','length','email','adminId','Admin\x20found:','error','toUpperCase','message','/api/selector/owners','then','agentEmail','Getting\x20user\x20with\x20email','User\x20found:','userId','Requested\x20Resource\x20not\x20Found','catch','/api/lookup?q='];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xee70,0x7b));var _0x0ee7=function(_0x88ab96,_0x498aa1){_0x88ab96=_0x88ab96-0x0;var _0x323963=_0xee70[_0x88ab96];return _0x323963;};'use strict';var _=require(_0x0ee7('0x0'));var rp=require(_0x0ee7('0x1'));var md5=require(_0x0ee7('0x2'));var util=require('util');var moment=require('moment');var Promise=require(_0x0ee7('0x3'));var Redis=require('ioredis');var intUtil=require(_0x0ee7('0x4'));var config=require(_0x0ee7('0x5'));var logger=require(_0x0ee7('0x6'))(_0x0ee7('0x7'));config[_0x0ee7('0x8')]=_['defaults'](config[_0x0ee7('0x8')],{'host':_0x0ee7('0x9'),'port':0x18eb});var io=require(_0x0ee7('0xa'))(new Redis(config[_0x0ee7('0x8')]));function getAdminId(_0x2bc9bd,_0x5d940d,_0x3fd4b7,_0x33ecbd){return new Promise(function(_0x30ad5d,_0x6b6b84){var _0x17bc9e=![];var _0x309ed8={'method':_0x0ee7('0xb'),'uri':_0x33ecbd+'/api/selector/owners','json':!![]};_0x309ed8[_0x0ee7('0xc')]=_0x3fd4b7;logger[_0x0ee7('0xd')]('Getting\x20admin\x20information');return rp(_0x309ed8)['then'](function(_0x39adc2){if(_0x39adc2){var _0xefd308=_0x39adc2[_0x0ee7('0xe')];var _0x1a65ec=null;for(_0x1a65ec=0x0;_0x1a65ec<_0xefd308[_0x0ee7('0xf')];_0x1a65ec++){if(_0xefd308[_0x1a65ec][_0x0ee7('0x10')]===_0x2bc9bd['adminEmail']){_0x2bc9bd[_0x0ee7('0x11')]=_0xefd308[_0x1a65ec]['id'];_0x17bc9e=!![];}}if(_0x17bc9e){logger[_0x0ee7('0xd')](_0x0ee7('0x12'),_0x2bc9bd[_0x0ee7('0x11')]);_0x30ad5d(_0x2bc9bd);}else{_0x6b6b84({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x6b6b84({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})['catch'](function(_0x343a95){logger[_0x0ee7('0x13')]('['+[_0x5d940d[_0x0ee7('0x14')]()]+']',_0x343a95[_0x0ee7('0x15')]);_0x6b6b84(_0x343a95);});});}function getUser(_0x43f1b1,_0x132990,_0x240660){return function(_0x15e927){return new Promise(function(_0x3e0e37,_0x154e24){var _0x308908={'method':_0x0ee7('0xb'),'uri':_0x240660+_0x0ee7('0x16'),'json':!![]};_0x308908[_0x0ee7('0xc')]=_0x132990;logger[_0x0ee7('0xd')]('Getting\x20user\x20list');return rp(_0x308908)[_0x0ee7('0x17')](function(_0x442e24){if(_0x442e24){var _0x2f3d09=_0x442e24[_0x0ee7('0xe')];var _0x2e0976=![];var _0xa90d79=null;if(_0x15e927[_0x0ee7('0x18')]!==null){logger['info'](_0x0ee7('0x19'),_0x15e927[_0x0ee7('0x18')]);_0x15e927['userEmail']=_0x15e927[_0x0ee7('0x18')];for(_0xa90d79=0x0;_0xa90d79<_0x2f3d09[_0x0ee7('0xf')];_0xa90d79++){if(_0x2f3d09[_0xa90d79][_0x0ee7('0x10')]===_0x15e927[_0x0ee7('0x18')]){_0x2e0976=!![];_0x15e927['userId']=_0x2f3d09[_0xa90d79]['id'];logger['info'](_0x0ee7('0x1a'),_0x15e927['userId']);}}}if(!_0x2e0976){logger[_0x0ee7('0xd')]('Admin\x20selected');_0x15e927['userEmail']=_0x15e927['adminEmail'];_0x15e927[_0x0ee7('0x1b')]=_0x15e927[_0x0ee7('0x11')];_0x2e0976=!![];}if(_0x2e0976){_0x3e0e37(_0x15e927);}else{_0x154e24({'statusCode':0x194,'message':_0x0ee7('0x1c')});}}else{_0x154e24({'statusCode':0x194,'message':_0x0ee7('0x1c')});}})[_0x0ee7('0x1d')](function(_0x4047b0){logger[_0x0ee7('0x13')]('['+[_0x43f1b1[_0x0ee7('0x14')]()]+']',_0x4047b0[_0x0ee7('0x15')]);_0x154e24(_0x4047b0);});});};}function searchContact(_0x29634f,_0x575ba5,_0x2662dc,_0x7b8622){return new Promise(function(_0x4dbaf1,_0x28d674){var _0x4bdad={'method':_0x0ee7('0xb'),'headers':_0x575ba5,'uri':_0x29634f+_0x0ee7('0x1e')+_0x7b8622+_0x0ee7('0x1f')+_0x2662dc+'&entities=contact','json':!![]};rp(_0x4bdad)[_0x0ee7('0x17')](function(_0x47dcc9){var _0xfbdb34=_[_0x0ee7('0x20')](_0x47dcc9['contacts']['contacts'],[_0x2662dc,_0x7b8622]);_0x4dbaf1(_0xfbdb34);})[_0x0ee7('0x1d')](function(_0x21909a){_0x28d674(_0x21909a);});});}function getEndUser(_0x288e14,_0x427c7d,_0x3d6c7d){return function(_0x13a919){return new Promise(function(_0x20a673,_0x579e86){logger[_0x0ee7('0xd')](util[_0x0ee7('0x21')]('Searching\x20contact\x20with\x20phone\x20%s',_0x13a919[_0x0ee7('0x22')]));searchContact(_0x3d6c7d,_0x427c7d,_0x0ee7('0x23'),_0x13a919[_0x0ee7('0x22')])[_0x0ee7('0x17')](function(_0x4f41c8){if(_0x4f41c8){_0x13a919[_0x0ee7('0x24')]=_0x4f41c8['id'];logger[_0x0ee7('0xd')](_0x0ee7('0x25'),_0x13a919[_0x0ee7('0x24')]);return _0x20a673(_0x13a919);}searchContact(_0x3d6c7d,_0x427c7d,_0x0ee7('0x26'),_0x13a919['contactNumber'])[_0x0ee7('0x17')](function(_0x3a3f17){if(_0x3a3f17){_0x13a919[_0x0ee7('0x24')]=_0x3a3f17['id'];logger[_0x0ee7('0xd')](_0x0ee7('0x27'),_0x13a919[_0x0ee7('0x24')]);return _0x20a673(_0x13a919);}createEndUser(_0x13a919,_0x288e14,_0x427c7d,_0x3d6c7d)['then'](function(_0x175f16){logger[_0x0ee7('0xd')](_0x0ee7('0x28'),_0x175f16[_0x0ee7('0x24')]);return _0x20a673(_0x175f16);});});})[_0x0ee7('0x1d')](function(_0x100901){_0x579e86(_0x100901);});});};}function createEndUser(_0x55e7bb,_0x477c75,_0x2c96d4,_0x5a005c){return new Promise(function(_0x44c7ff,_0x18c096){var _0x2f32d5=moment();var _0x526bcf={'method':'POST','uri':_0x5a005c+_0x0ee7('0x29'),'body':{'contact':{'last_name':_0x55e7bb[_0x0ee7('0x22')],'work_number':_0x55e7bb[_0x0ee7('0x22')],'mobile_number':_0x55e7bb[_0x0ee7('0x22')],'owner_id':_0x55e7bb[_0x0ee7('0x1b')],'created_at':_0x2f32d5[_0x0ee7('0x21')](_0x0ee7('0x2a'))}},'json':!![]};_0x526bcf[_0x0ee7('0xc')]=_0x2c96d4;logger[_0x0ee7('0xd')](_0x0ee7('0x2b'));return rp(_0x526bcf)[_0x0ee7('0x17')](function(_0x4928d1){_0x55e7bb[_0x0ee7('0x24')]=_0x4928d1[_0x0ee7('0x2c')]['id'];_0x44c7ff(_0x55e7bb);})['catch'](function(_0x48e46d){logger[_0x0ee7('0x13')]('['+[_0x477c75[_0x0ee7('0x14')]()]+']',_0x48e46d['message']);_0x18c096(_0x48e46d[_0x0ee7('0x15')]);});});}function getTicket(_0x3edd61,_0x5ddc6d,_0x102665,_0x161d28,_0x2f3852){return function(_0x50a89c){logger['info'](_0x0ee7('0x2d'));return new Promise(function(_0x287ff9,_0x29e81a){var _0x2fab49=moment();var _0x83827e={'method':'POST','uri':_0x102665+_0x0ee7('0x2e'),'body':{'title':intUtil[_0x0ee7('0x2f')](_0x161d28[_0x0ee7('0x30')],_0x2f3852,'\x20'),'description':intUtil['getString'](_0x161d28['Descriptions'],_0x2f3852,'\x0a'),'owner_id':_0x50a89c[_0x0ee7('0x1b')],'creater_id':_0x50a89c[_0x0ee7('0x11')],'targetable_id':_0x50a89c[_0x0ee7('0x24')],'targetable_type':'Contact','created_at':_0x2fab49[_0x0ee7('0x21')](_0x0ee7('0x2a')),'due_date':_0x2fab49[_0x0ee7('0x31')](0x1e,'m')[_0x0ee7('0x21')](_0x0ee7('0x2a'))},'json':!![]};_0x83827e['headers']=_0x5ddc6d;return rp(_0x83827e)[_0x0ee7('0x17')](function(_0x52e54d){_0x50a89c[_0x0ee7('0x32')]=_0x52e54d['task']['id'];logger['info'](_0x0ee7('0x33'),_0x50a89c[_0x0ee7('0x32')]);_0x287ff9(_0x50a89c);})[_0x0ee7('0x1d')](function(_0x5b6f73){logger['error']('['+[_0x3edd61[_0x0ee7('0x14')]()]+']',_0x5b6f73[_0x0ee7('0x15')]);_0x29e81a(_0x5b6f73[_0x0ee7('0x15')]);});});};}function emit(_0x188657,_0x445409,_0x2cea5e){var _0x5ce405={'uri':_0x188657+_0x0ee7('0x34')+_0x2cea5e};io['to'](util[_0x0ee7('0x21')](_0x0ee7('0x35'),_0x445409))[_0x0ee7('0x36')]('trigger:browser:url',_0x5ce405);}exports['cs']=function(_0x57f01f,_0x12ee9e,_0x45ea15,_0x8b2d5a,_0x285ee7,_0x40a1f6,_0x2f3245,_0x5630a1){var _0x2b5c79={};var _0x23ee24={'Authorization':'Token\x20token='+_0x40a1f6[_0x0ee7('0x37')]};_0x40a1f6[_0x0ee7('0x38')]=intUtil['stripTrailingSlash'](_0x40a1f6[_0x0ee7('0x38')]);_0x40a1f6[_0x0ee7('0x39')]=intUtil[_0x0ee7('0x3a')](_0x40a1f6['serverUrl']);var _0x22a215=_0x40a1f6[_0x0ee7('0x38')];_0x2b5c79[_0x0ee7('0x3b')]=_0x40a1f6['username'];_0x2b5c79['contactNumber']=_0x5630a1['toLowerCase']()==='outbound'?_0x12ee9e[_0x0ee7('0x3c')]:_0x12ee9e[_0x0ee7('0x3d')];_0x2b5c79[_0x0ee7('0x3e')]=_0x5630a1==='queue'||_0x5630a1===_0x0ee7('0x3f')?_0x0ee7('0x40'):'outbound';if(_0x8b2d5a){_0x2b5c79[_0x0ee7('0x18')]=_0x8b2d5a[_0x0ee7('0x10')];}var _0x5cacc1=util[_0x0ee7('0x21')](_0x0ee7('0x41'),_0x40a1f6[_0x0ee7('0x39')],_0x12ee9e[_0x0ee7('0x42')],md5(_0x12ee9e[_0x0ee7('0x42')]));if(_0x285ee7&&_0x285ee7[_0x0ee7('0x43')]){logger['info'](_0x0ee7('0x44'),'Recording\x20is\x20enabled!');_0x12ee9e['recordingURL']=_0x5cacc1;}else if(_0x2f3245&&_0x2f3245[_0x0ee7('0x45')]&&_0x2f3245[_0x0ee7('0x45')]!==_0x0ee7('0x46')){logger[_0x0ee7('0xd')](_0x0ee7('0x47'),'Recording\x20is\x20enabled!');_0x12ee9e[_0x0ee7('0x48')]=_0x5cacc1;}else{_0x12ee9e[_0x0ee7('0x48')]='';}return getAdminId(_0x2b5c79,_0x5630a1,_0x23ee24,_0x22a215)[_0x0ee7('0x17')](getUser(_0x5630a1,_0x23ee24,_0x22a215))[_0x0ee7('0x17')](getEndUser(_0x5630a1,_0x23ee24,_0x22a215))[_0x0ee7('0x17')](getTicket(_0x5630a1,_0x23ee24,_0x22a215,_0x45ea15,_0x12ee9e))['then'](function(_0x3f20fd){logger[_0x0ee7('0xd')](util[_0x0ee7('0x21')](_0x0ee7('0x49'),_0x3f20fd[_0x0ee7('0x32')]));if(_0x5630a1!==_0x0ee7('0x3f')){logger['info']('['+[_0x5630a1[_0x0ee7('0x14')]()]+']',_0x0ee7('0x4a'));emit(_0x22a215,_0x8b2d5a[_0x0ee7('0x4b')],_0x3f20fd['endUserId']);}})[_0x0ee7('0x1d')](function(_0x4d2987){logger[_0x0ee7('0x13')]('['+[_0x5630a1[_0x0ee7('0x14')]()]+_0x0ee7('0x4c'),util['inspect'](_0x4d2987,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xc8d4=['info','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userId','User\x20found:','Admin\x20selected','message','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','endUserId','Contact\x20found\x20mobile_number:','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Descriptions','Contact','add','YYYY-MM-DDTHH:mm:ss','ticketId','Task\x20created:','user:%s','trigger:browser:url','Token\x20token=','apiKey','remoteUri','serverUrl','stripTrailingSlash','username','toLowerCase','outbound','calleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','moment','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','GET','/api/selector/owners','headers','Getting\x20admin\x20information','then','users','length','email','adminEmail','adminId'];(function(_0x49fe77,_0x282065){var _0xafaa87=function(_0x153864){while(--_0x153864){_0x49fe77['push'](_0x49fe77['shift']());}};_0xafaa87(++_0x282065);}(_0xc8d4,0x1de));var _0x4c8d=function(_0x54f763,_0x463936){_0x54f763=_0x54f763-0x0;var _0x4332b7=_0xc8d4[_0x54f763];return _0x4332b7;};'use strict';var _=require(_0x4c8d('0x0'));var rp=require(_0x4c8d('0x1'));var md5=require(_0x4c8d('0x2'));var util=require('util');var moment=require(_0x4c8d('0x3'));var Promise=require('bluebird');var Redis=require('ioredis');var intUtil=require(_0x4c8d('0x4'));var config=require(_0x4c8d('0x5'));var logger=require(_0x4c8d('0x6'))('freshsales');config[_0x4c8d('0x7')]=_[_0x4c8d('0x8')](config['redis'],{'host':_0x4c8d('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4c8d('0x7')]));function getAdminId(_0xad6524,_0x29b183,_0x299615,_0x31656d){return new Promise(function(_0x494183,_0x5e7906){var _0x5ba806=![];var _0x24684c={'method':_0x4c8d('0xa'),'uri':_0x31656d+_0x4c8d('0xb'),'json':!![]};_0x24684c[_0x4c8d('0xc')]=_0x299615;logger['info'](_0x4c8d('0xd'));return rp(_0x24684c)[_0x4c8d('0xe')](function(_0x43fb32){if(_0x43fb32){var _0x46cab6=_0x43fb32[_0x4c8d('0xf')];var _0x22a315=null;for(_0x22a315=0x0;_0x22a315<_0x46cab6[_0x4c8d('0x10')];_0x22a315++){if(_0x46cab6[_0x22a315][_0x4c8d('0x11')]===_0xad6524[_0x4c8d('0x12')]){_0xad6524[_0x4c8d('0x13')]=_0x46cab6[_0x22a315]['id'];_0x5ba806=!![];}}if(_0x5ba806){logger[_0x4c8d('0x14')](_0x4c8d('0x15'),_0xad6524[_0x4c8d('0x13')]);_0x494183(_0xad6524);}else{_0x5e7906({'statusCode':0x194,'message':_0x4c8d('0x16')});}}else{_0x5e7906({'statusCode':0x194,'message':_0x4c8d('0x16')});}})[_0x4c8d('0x17')](function(_0x1c207e){logger[_0x4c8d('0x18')]('['+[_0x29b183[_0x4c8d('0x19')]()]+']',_0x1c207e['message']);_0x5e7906(_0x1c207e);});});}function getUser(_0x2619ec,_0xa2d4d3,_0x52b1bc){return function(_0x2c81c1){return new Promise(function(_0x2d7f7e,_0x48c408){var _0x273b04={'method':_0x4c8d('0xa'),'uri':_0x52b1bc+'/api/selector/owners','json':!![]};_0x273b04[_0x4c8d('0xc')]=_0xa2d4d3;logger[_0x4c8d('0x14')](_0x4c8d('0x1a'));return rp(_0x273b04)[_0x4c8d('0xe')](function(_0x5070de){if(_0x5070de){var _0x368b96=_0x5070de['users'];var _0x516258=![];var _0x3f26c4=null;if(_0x2c81c1[_0x4c8d('0x1b')]!==null){logger['info'](_0x4c8d('0x1c'),_0x2c81c1[_0x4c8d('0x1b')]);_0x2c81c1['userEmail']=_0x2c81c1[_0x4c8d('0x1b')];for(_0x3f26c4=0x0;_0x3f26c4<_0x368b96[_0x4c8d('0x10')];_0x3f26c4++){if(_0x368b96[_0x3f26c4]['email']===_0x2c81c1['agentEmail']){_0x516258=!![];_0x2c81c1[_0x4c8d('0x1d')]=_0x368b96[_0x3f26c4]['id'];logger[_0x4c8d('0x14')](_0x4c8d('0x1e'),_0x2c81c1['userId']);}}}if(!_0x516258){logger[_0x4c8d('0x14')](_0x4c8d('0x1f'));_0x2c81c1['userEmail']=_0x2c81c1[_0x4c8d('0x12')];_0x2c81c1[_0x4c8d('0x1d')]=_0x2c81c1[_0x4c8d('0x13')];_0x516258=!![];}if(_0x516258){_0x2d7f7e(_0x2c81c1);}else{_0x48c408({'statusCode':0x194,'message':_0x4c8d('0x16')});}}else{_0x48c408({'statusCode':0x194,'message':_0x4c8d('0x16')});}})['catch'](function(_0x58db76){logger[_0x4c8d('0x18')]('['+[_0x2619ec[_0x4c8d('0x19')]()]+']',_0x58db76[_0x4c8d('0x20')]);_0x48c408(_0x58db76);});});};}function searchContact(_0x53e787,_0x40cc4f,_0x15f8b9,_0x42a9fd){return new Promise(function(_0x35bdf1,_0x26c156){var _0x30277b={'method':'GET','headers':_0x40cc4f,'uri':_0x53e787+_0x4c8d('0x21')+_0x42a9fd+_0x4c8d('0x22')+_0x15f8b9+_0x4c8d('0x23'),'json':!![]};rp(_0x30277b)['then'](function(_0x1ab49c){var _0x3d1d29=_[_0x4c8d('0x24')](_0x1ab49c['contacts'][_0x4c8d('0x25')],[_0x15f8b9,_0x42a9fd]);_0x35bdf1(_0x3d1d29);})[_0x4c8d('0x17')](function(_0xd060a4){_0x26c156(_0xd060a4);});});}function getEndUser(_0x2947e5,_0x7d0451,_0x3dd02e){return function(_0x5b0036){return new Promise(function(_0x1ab7f9,_0x377d05){logger[_0x4c8d('0x14')](util[_0x4c8d('0x26')](_0x4c8d('0x27'),_0x5b0036[_0x4c8d('0x28')]));searchContact(_0x3dd02e,_0x7d0451,'mobile_number',_0x5b0036[_0x4c8d('0x28')])[_0x4c8d('0xe')](function(_0x29134d){if(_0x29134d){_0x5b0036[_0x4c8d('0x29')]=_0x29134d['id'];logger[_0x4c8d('0x14')](_0x4c8d('0x2a'),_0x5b0036[_0x4c8d('0x29')]);return _0x1ab7f9(_0x5b0036);}searchContact(_0x3dd02e,_0x7d0451,'work_number',_0x5b0036[_0x4c8d('0x28')])[_0x4c8d('0xe')](function(_0x51871d){if(_0x51871d){_0x5b0036[_0x4c8d('0x29')]=_0x51871d['id'];logger[_0x4c8d('0x14')](_0x4c8d('0x2b'),_0x5b0036[_0x4c8d('0x29')]);return _0x1ab7f9(_0x5b0036);}createEndUser(_0x5b0036,_0x2947e5,_0x7d0451,_0x3dd02e)[_0x4c8d('0xe')](function(_0x2e902a){logger[_0x4c8d('0x14')](_0x4c8d('0x2c'),_0x2e902a[_0x4c8d('0x29')]);return _0x1ab7f9(_0x2e902a);});});})[_0x4c8d('0x17')](function(_0x3d87f7){_0x377d05(_0x3d87f7);});});};}function createEndUser(_0x17c39c,_0x157f5c,_0x46d213,_0x4c236f){return new Promise(function(_0x451eef,_0x381b2b){var _0x3b5e74=moment();var _0x4883b6={'method':_0x4c8d('0x2d'),'uri':_0x4c236f+_0x4c8d('0x2e'),'body':{'contact':{'last_name':_0x17c39c[_0x4c8d('0x28')],'work_number':_0x17c39c[_0x4c8d('0x28')],'mobile_number':_0x17c39c[_0x4c8d('0x28')],'owner_id':_0x17c39c[_0x4c8d('0x1d')],'created_at':_0x3b5e74[_0x4c8d('0x26')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x4883b6[_0x4c8d('0xc')]=_0x46d213;logger[_0x4c8d('0x14')](_0x4c8d('0x2f'));return rp(_0x4883b6)[_0x4c8d('0xe')](function(_0x1ae870){_0x17c39c[_0x4c8d('0x29')]=_0x1ae870[_0x4c8d('0x30')]['id'];_0x451eef(_0x17c39c);})['catch'](function(_0x2cf352){logger[_0x4c8d('0x18')]('['+[_0x157f5c[_0x4c8d('0x19')]()]+']',_0x2cf352[_0x4c8d('0x20')]);_0x381b2b(_0x2cf352[_0x4c8d('0x20')]);});});}function getTicket(_0x5400dd,_0x3bf470,_0x28d3be,_0x5c827c,_0x1e5e7a){return function(_0xeab9ee){logger[_0x4c8d('0x14')](_0x4c8d('0x31'));return new Promise(function(_0x28bbc7,_0x502566){var _0x1b5b41=moment();var _0x20d261={'method':_0x4c8d('0x2d'),'uri':_0x28d3be+_0x4c8d('0x32'),'body':{'title':intUtil[_0x4c8d('0x33')](_0x5c827c['Subjects'],_0x1e5e7a,'\x20'),'description':intUtil[_0x4c8d('0x33')](_0x5c827c[_0x4c8d('0x34')],_0x1e5e7a,'\x0a'),'owner_id':_0xeab9ee[_0x4c8d('0x1d')],'creater_id':_0xeab9ee[_0x4c8d('0x13')],'targetable_id':_0xeab9ee[_0x4c8d('0x29')],'targetable_type':_0x4c8d('0x35'),'created_at':_0x1b5b41['format']('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x1b5b41[_0x4c8d('0x36')](0x1e,'m')[_0x4c8d('0x26')](_0x4c8d('0x37'))},'json':!![]};_0x20d261[_0x4c8d('0xc')]=_0x3bf470;return rp(_0x20d261)[_0x4c8d('0xe')](function(_0x42d3e5){_0xeab9ee[_0x4c8d('0x38')]=_0x42d3e5['task']['id'];logger['info'](_0x4c8d('0x39'),_0xeab9ee[_0x4c8d('0x38')]);_0x28bbc7(_0xeab9ee);})['catch'](function(_0x20e994){logger['error']('['+[_0x5400dd[_0x4c8d('0x19')]()]+']',_0x20e994['message']);_0x502566(_0x20e994[_0x4c8d('0x20')]);});});};}function emit(_0x1569ac,_0x578fd2,_0x23e5b0){var _0x441ecb={'uri':_0x1569ac+'/contacts/'+_0x23e5b0};io['to'](util['format'](_0x4c8d('0x3a'),_0x578fd2))['emit'](_0x4c8d('0x3b'),_0x441ecb);}exports['cs']=function(_0x4d0fbd,_0x458d8b,_0x14a9c7,_0x441592,_0x46f1c0,_0x273224,_0x490cb4,_0xeada1c){var _0x5a7776={};var _0x4a3752={'Authorization':_0x4c8d('0x3c')+_0x273224[_0x4c8d('0x3d')]};_0x273224[_0x4c8d('0x3e')]=intUtil['stripTrailingSlash'](_0x273224['remoteUri']);_0x273224[_0x4c8d('0x3f')]=intUtil[_0x4c8d('0x40')](_0x273224[_0x4c8d('0x3f')]);var _0x56d669=_0x273224[_0x4c8d('0x3e')];_0x5a7776[_0x4c8d('0x12')]=_0x273224[_0x4c8d('0x41')];_0x5a7776[_0x4c8d('0x28')]=_0xeada1c[_0x4c8d('0x42')]()===_0x4c8d('0x43')?_0x458d8b['destcalleridnum']:_0x458d8b[_0x4c8d('0x44')];_0x5a7776['callDirection']=_0xeada1c===_0x4c8d('0x45')||_0xeada1c===_0x4c8d('0x46')?_0x4c8d('0x45'):_0x4c8d('0x43');if(_0x441592){_0x5a7776[_0x4c8d('0x1b')]=_0x441592['email'];}var _0x4d4063=util['format'](_0x4c8d('0x47'),_0x273224['serverUrl'],_0x458d8b[_0x4c8d('0x48')],md5(_0x458d8b[_0x4c8d('0x48')]));if(_0x46f1c0&&_0x46f1c0[_0x4c8d('0x49')]){logger[_0x4c8d('0x14')](_0x4c8d('0x4a'),_0x4c8d('0x4b'));_0x458d8b[_0x4c8d('0x4c')]=_0x4d4063;}else if(_0x490cb4&&_0x490cb4[_0x4c8d('0x4d')]&&_0x490cb4[_0x4c8d('0x4d')]!=='none'){logger[_0x4c8d('0x14')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x458d8b[_0x4c8d('0x4c')]=_0x4d4063;}else{_0x458d8b['recordingURL']='';}return getAdminId(_0x5a7776,_0xeada1c,_0x4a3752,_0x56d669)[_0x4c8d('0xe')](getUser(_0xeada1c,_0x4a3752,_0x56d669))[_0x4c8d('0xe')](getEndUser(_0xeada1c,_0x4a3752,_0x56d669))['then'](getTicket(_0xeada1c,_0x4a3752,_0x56d669,_0x14a9c7,_0x458d8b))['then'](function(_0x9bbd4e){logger[_0x4c8d('0x14')](util[_0x4c8d('0x26')](_0x4c8d('0x4e'),_0x9bbd4e[_0x4c8d('0x38')]));if(_0xeada1c!=='unmanaged'){logger[_0x4c8d('0x14')]('['+[_0xeada1c[_0x4c8d('0x19')]()]+']',_0x4c8d('0x4f'));emit(_0x56d669,_0x441592[_0x4c8d('0x50')],_0x9bbd4e[_0x4c8d('0x29')]);}})[_0x4c8d('0x17')](function(_0x24355a){logger[_0x4c8d('0x18')]('['+[_0xeada1c['toUpperCase']()]+_0x4c8d('0x51'),util[_0x4c8d('0x52')](_0x24355a,{'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 421c437..7b6b78c 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 _0xf75e=['exec','includes','data1','toLowerCase','data2','find','Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','salesforce','dynamics365','unknown\x20integration','../../../../config/logger','error','format','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./sugarcrm','./freshdesk','./desk','./servicenow','./dynamics365','./freshsales','zendesk','sugarcrm','freshdesk','desk','vtiger','freshsales','servicenow'];(function(_0x43d58a,_0x5635c6){var _0x130ef6=function(_0x25f3ad){while(--_0x25f3ad){_0x43d58a['push'](_0x43d58a['shift']());}};_0x130ef6(++_0x5635c6);}(_0xf75e,0x17c));var _0xef75=function(_0x4b82fb,_0x48e582){_0x4b82fb=_0x4b82fb-0x0;var _0x62f6ed=_0xf75e[_0x4b82fb];return _0x62f6ed;};'use strict';var _=require(_0xef75('0x0'));var util=require(_0xef75('0x1'));var zendesk=require(_0xef75('0x2'));var salesforce=require('./salesforce');var sugarcrm=require(_0xef75('0x3'));var freshdesk=require(_0xef75('0x4'));var zoho=require('./zoho');var desk=require(_0xef75('0x5'));var vtiger=require('./vtiger');var servicenow=require(_0xef75('0x6'));var dynamics365=require(_0xef75('0x7'));var freshsales=require(_0xef75('0x8'));var integrations=[_0xef75('0x9'),'salesforce',_0xef75('0xa'),_0xef75('0xb'),'zoho',_0xef75('0xc'),_0xef75('0xd'),'dynamics365',_0xef75('0xe'),_0xef75('0xf')];exports[_0xef75('0x10')]=function(_0x2516c6,_0x13be88,_0x2467c7,_0x23f832,_0x42aa52,_0x437d84){if(_0x2467c7){if(_[_0xef75('0x11')](integrations,_0x2516c6[_0xef75('0x12')][_0xef75('0x13')]())){try{var _0x25c006=null;var _0x5be066='';var _0x49aafd=_0x2467c7[_0x2516c6[_0xef75('0x12')]['toLowerCase']()];if(_0x49aafd){var _0x509be2=_0x49aafd[_0x2516c6[_0xef75('0x14')]];if(_0x509be2){var _0x2e042d=_[_0xef75('0x15')](_0x509be2[_0xef75('0x16')],{'id':parseInt(_0x2516c6[_0xef75('0x17')],0xa)});if(_0x2e042d){if(_0x23f832){if(_0x42aa52&&_0x13be88[_0xef75('0x18')]){_0x5be066=_0xef75('0x18');}else if(_0x13be88[_0xef75('0x19')]){_0x5be066=_0xef75('0x1a');}else{console[_0xef75('0x1b')](_0xef75('0x1c'),_0x13be88);}}else{_0x5be066='unmanaged';}switch(_0x2516c6[_0xef75('0x12')]['toLowerCase']()){case _0xef75('0x9'):zendesk[_0x5be066](_0x2516c6,_0x13be88,_0x2e042d,_0x23f832,_0x42aa52,_0x509be2,_0x437d84);break;case _0xef75('0x1d'):salesforce[_0x5be066](_0x2516c6,_0x13be88,_0x2e042d,_0x23f832,_0x42aa52,_0x509be2,_0x437d84);break;case _0xef75('0xa'):sugarcrm[_0x5be066](_0x2516c6,_0x13be88,_0x2e042d,_0x23f832,_0x42aa52,_0x509be2,_0x437d84);break;case _0xef75('0xb'):freshdesk[_0x5be066](_0x2516c6,_0x13be88,_0x2e042d,_0x23f832,_0x42aa52,_0x509be2,_0x437d84);break;case'zoho':zoho[_0x5be066](_0x2516c6,_0x13be88,_0x2e042d,_0x23f832,_0x42aa52,_0x509be2,_0x437d84);break;case'desk':desk[_0x5be066](_0x2516c6,_0x13be88,_0x2e042d,_0x23f832,_0x42aa52,_0x509be2,_0x437d84);break;case _0xef75('0xd'):vtiger[_0x5be066](_0x2516c6,_0x13be88,_0x2e042d,_0x23f832,_0x42aa52,_0x509be2,_0x437d84);break;case _0xef75('0xe'):freshsales['cs'](_0x2516c6,_0x13be88,_0x2e042d,_0x23f832,_0x42aa52,_0x509be2,_0x437d84,_0x5be066);break;case _0xef75('0xf'):servicenow['cs'](_0x2516c6,_0x13be88,_0x2e042d,_0x23f832,_0x42aa52,_0x509be2,_0x437d84,_0x5be066);break;case _0xef75('0x1e'):dynamics365['cs'](_0x2516c6,_0x13be88,_0x2e042d,_0x23f832,_0x42aa52,_0x509be2,_0x437d84,_0x5be066);break;default:console['log'](_0xef75('0x1f'));}}else{_0x25c006=require(_0xef75('0x20'))(_0x2516c6['data1']['toLowerCase']());_0x25c006[_0xef75('0x21')]('[EXEC]',util[_0xef75('0x22')]('%s\x20configuration\x20#%s\x20not\x20found',_0x2516c6['data1'][_0xef75('0x13')](),_0x2516c6['data3']));}}else{_0x25c006=require(_0xef75('0x20'))(_0x2516c6[_0xef75('0x12')][_0xef75('0x13')]());_0x25c006[_0xef75('0x21')]('[EXEC]',util[_0xef75('0x22')](_0xef75('0x23'),_0x2516c6['data1'][_0xef75('0x13')](),_0x2516c6[_0xef75('0x14')]));}}else{}}catch(_0x1c5c94){console[_0xef75('0x21')](_0x1c5c94);}}}}; \ No newline at end of file +var _0x5407=['zoho','desk','log','unknown\x20integration','../../../../config/logger','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','error','%s\x20account\x20#%s\x20not\x20found','lodash','util','./salesforce','./sugarcrm','./freshdesk','./vtiger','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','vtiger','dynamics365','freshsales','servicenow','exec','includes','data1','toLowerCase','data2','find','Configurations','data3','queue','unmanaged'];(function(_0x1f1bde,_0x3033f9){var _0x33bd44=function(_0x18d028){while(--_0x18d028){_0x1f1bde['push'](_0x1f1bde['shift']());}};_0x33bd44(++_0x3033f9);}(_0x5407,0xbe));var _0x7540=function(_0x29fbab,_0x4611e8){_0x29fbab=_0x29fbab-0x0;var _0x2177ef=_0x5407[_0x29fbab];return _0x2177ef;};'use strict';var _=require(_0x7540('0x0'));var util=require(_0x7540('0x1'));var zendesk=require('./zendesk');var salesforce=require(_0x7540('0x2'));var sugarcrm=require(_0x7540('0x3'));var freshdesk=require(_0x7540('0x4'));var zoho=require('./zoho');var desk=require('./desk');var vtiger=require(_0x7540('0x5'));var servicenow=require('./servicenow');var dynamics365=require(_0x7540('0x6'));var freshsales=require(_0x7540('0x7'));var integrations=[_0x7540('0x8'),_0x7540('0x9'),_0x7540('0xa'),_0x7540('0xb'),'zoho','desk',_0x7540('0xc'),_0x7540('0xd'),_0x7540('0xe'),_0x7540('0xf')];exports[_0x7540('0x10')]=function(_0x426c2f,_0x4572d4,_0x103cc9,_0xbe7629,_0x36708a,_0x36351b){if(_0x103cc9){if(_[_0x7540('0x11')](integrations,_0x426c2f[_0x7540('0x12')][_0x7540('0x13')]())){try{var _0x19260f=null;var _0x4884c3='';var _0x2d2afc=_0x103cc9[_0x426c2f[_0x7540('0x12')][_0x7540('0x13')]()];if(_0x2d2afc){var _0x1c6933=_0x2d2afc[_0x426c2f[_0x7540('0x14')]];if(_0x1c6933){var _0x13dcec=_[_0x7540('0x15')](_0x1c6933[_0x7540('0x16')],{'id':parseInt(_0x426c2f[_0x7540('0x17')],0xa)});if(_0x13dcec){if(_0xbe7629){if(_0x36708a&&_0x4572d4[_0x7540('0x18')]){_0x4884c3=_0x7540('0x18');}else if(_0x4572d4['routeId']){_0x4884c3='outbound';}else{console['log']('EVENT\x20UNKNOWN',_0x4572d4);}}else{_0x4884c3=_0x7540('0x19');}switch(_0x426c2f[_0x7540('0x12')]['toLowerCase']()){case _0x7540('0x8'):zendesk[_0x4884c3](_0x426c2f,_0x4572d4,_0x13dcec,_0xbe7629,_0x36708a,_0x1c6933,_0x36351b);break;case _0x7540('0x9'):salesforce[_0x4884c3](_0x426c2f,_0x4572d4,_0x13dcec,_0xbe7629,_0x36708a,_0x1c6933,_0x36351b);break;case'sugarcrm':sugarcrm[_0x4884c3](_0x426c2f,_0x4572d4,_0x13dcec,_0xbe7629,_0x36708a,_0x1c6933,_0x36351b);break;case'freshdesk':freshdesk[_0x4884c3](_0x426c2f,_0x4572d4,_0x13dcec,_0xbe7629,_0x36708a,_0x1c6933,_0x36351b);break;case _0x7540('0x1a'):zoho[_0x4884c3](_0x426c2f,_0x4572d4,_0x13dcec,_0xbe7629,_0x36708a,_0x1c6933,_0x36351b);break;case _0x7540('0x1b'):desk[_0x4884c3](_0x426c2f,_0x4572d4,_0x13dcec,_0xbe7629,_0x36708a,_0x1c6933,_0x36351b);break;case _0x7540('0xc'):vtiger[_0x4884c3](_0x426c2f,_0x4572d4,_0x13dcec,_0xbe7629,_0x36708a,_0x1c6933,_0x36351b);break;case _0x7540('0xe'):freshsales['cs'](_0x426c2f,_0x4572d4,_0x13dcec,_0xbe7629,_0x36708a,_0x1c6933,_0x36351b,_0x4884c3);break;case'servicenow':servicenow['cs'](_0x426c2f,_0x4572d4,_0x13dcec,_0xbe7629,_0x36708a,_0x1c6933,_0x36351b,_0x4884c3);break;case'dynamics365':dynamics365['cs'](_0x426c2f,_0x4572d4,_0x13dcec,_0xbe7629,_0x36708a,_0x1c6933,_0x36351b,_0x4884c3);break;default:console[_0x7540('0x1c')](_0x7540('0x1d'));}}else{_0x19260f=require(_0x7540('0x1e'))(_0x426c2f[_0x7540('0x12')][_0x7540('0x13')]());_0x19260f['error'](_0x7540('0x1f'),util[_0x7540('0x20')](_0x7540('0x21'),_0x426c2f[_0x7540('0x12')][_0x7540('0x13')](),_0x426c2f[_0x7540('0x17')]));}}else{_0x19260f=require(_0x7540('0x1e'))(_0x426c2f[_0x7540('0x12')]['toLowerCase']());_0x19260f[_0x7540('0x22')](_0x7540('0x1f'),util[_0x7540('0x20')](_0x7540('0x23'),_0x426c2f[_0x7540('0x12')][_0x7540('0x13')](),_0x426c2f[_0x7540('0x14')]));}}else{}}catch(_0x2a0b4c){console[_0x7540('0x22')](_0x2a0b4c);}}}}; \ 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 77078c2..0e36f47 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 _0x1f90=['leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','create','validateEmail','sobject','User','find','execute','then','Email','Agent\x20%s\x20found.','resolve','Name','identity','user_id','display_name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','cloneDeep','additionalSearchContact','$or','additionalSearchLead','merge','Lead','account_contact_lead','additionalSearchAccount','length','Contact','Account','attributes','type','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','','format','Caller\x20-\x20%s','LastName','Company','includes','string','idField','content','toString','variableName','customVariable','Variable','toLowerCase','name','password','concat','securityToken','remoteUri','https://login.salesforce.com','clientSecret','queue','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','calleridname','[QUEUE]\x20Ticket\x20%s\x20created','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','recordingFormat','none','uniqueid','email','destcalleridname','destcalleridnum','Fields','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','%s/%s/e','Salesforce\x20account\x20type\x20not\x20recognized','[OUTBOUND]','monitor_format','calleridnum','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.','lodash','moment','bluebird','md5','jsforce','util','ioredis','../../../../config/environment','redis','socket.io-emitter','emit','assign','getString','Subjects','Descriptions','ticketType','Task','utc','IsReminderSet','contact','endUserType','lead','WhoId','account','WhatId','Case','AccountId'];(function(_0x266bd1,_0x3934e3){var _0x377302=function(_0x578fec){while(--_0x578fec){_0x266bd1['push'](_0x266bd1['shift']());}};_0x377302(++_0x3934e3);}(_0x1f90,0xd3));var _0x01f9=function(_0x44c768,_0x552a5e){_0x44c768=_0x44c768-0x0;var _0x55daf5=_0x1f90[_0x44c768];return _0x55daf5;};'use strict';var _=require(_0x01f9('0x0'));var rp=require('request-promise');var moment=require(_0x01f9('0x1'));var BPromise=require(_0x01f9('0x2'));var md5=require(_0x01f9('0x3'));var jsforce=require(_0x01f9('0x4'));var util=require(_0x01f9('0x5'));var Redis=require(_0x01f9('0x6'));var intUtil=require('./util');var config=require(_0x01f9('0x7'));var logger=require('../../../../config/logger')('salesforce');config[_0x01f9('0x8')]=_['defaults'](config[_0x01f9('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x01f9('0x9'))(new Redis(config[_0x01f9('0x8')]));function emit(_0xa06235,_0x1660fa,_0x2e4cb1){io['to'](_0xa06235)[_0x01f9('0xa')](_0x1660fa,_0x2e4cb1);}function getTicket(_0x132e43,_0x28d28c,_0x3e9945,_0x2d6362,_0x52b970,_0x316402,_0x49cb04,_0x1e0e0c){var _0x17cb83=Object[_0x01f9('0xb')]({},{'OwnerId':_0x28d28c['id'],'Subject':intUtil[_0x01f9('0xc')](_0x2d6362[_0x01f9('0xd')],_0x52b970,'\x20'),'Description':intUtil[_0x01f9('0xc')](_0x2d6362[_0x01f9('0xe')],_0x52b970,'\x0a')},getCustomFields(_0x316402,_0x52b970));if(_0x3e9945){if(_0x2d6362[_0x01f9('0xf')]===_0x01f9('0x10')){_0x17cb83['ActivityDate']=moment[_0x01f9('0x11')]();_0x17cb83[_0x01f9('0x12')]=![];_0x17cb83['IsRecurrence']=![];if(_0x3e9945['endUserType']===_0x01f9('0x13')||_0x3e9945[_0x01f9('0x14')]===_0x01f9('0x15')){_0x17cb83[_0x01f9('0x16')]=_0x3e9945['id'];}else if(_0x3e9945[_0x01f9('0x14')]===_0x01f9('0x17')){_0x17cb83[_0x01f9('0x18')]=_0x3e9945['id'];}}else if(_0x2d6362[_0x01f9('0xf')]===_0x01f9('0x19')){if(_0x3e9945[_0x01f9('0x14')]===_0x01f9('0x13')){_0x17cb83['ContactId']=_0x3e9945['id'];}else if(_0x3e9945[_0x01f9('0x14')]===_0x01f9('0x17')){_0x17cb83[_0x01f9('0x1a')]=_0x3e9945['id'];}else if(_0x3e9945[_0x01f9('0x14')]===_0x01f9('0x15')&&_0x2d6362[_0x01f9('0x1b')]){_0x17cb83[_0x2d6362[_0x01f9('0x1b')]]=_0x3e9945['id'];}else{logger[_0x01f9('0x1c')](_0x01f9('0x1d'));}}}return _0x49cb04['sobject'](_0x2d6362[_0x01f9('0xf')])[_0x01f9('0x1e')](_0x17cb83);}function getUser(_0x507f03,_0x526c93,_0x38143c){if(!_['isNil'](_0x526c93)&&intUtil[_0x01f9('0x1f')](_0x526c93)){var _0x75e8d7={'Email':_0x526c93};var _0x4596b7={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x38143c[_0x01f9('0x20')](_0x01f9('0x21'))[_0x01f9('0x22')](_0x75e8d7,_0x4596b7)[_0x01f9('0x23')]()[_0x01f9('0x24')](function(_0x4b2c5f){if(_0x4b2c5f['length']){var _0x5948d3=_['find'](_0x4b2c5f,function(_0x34c46d){return _0x34c46d[_0x01f9('0x25')]===_0x526c93;});if(_0x5948d3){logger[_0x01f9('0x1c')](_0x01f9('0x26'),_0x526c93);return BPromise[_0x01f9('0x27')]({'id':_0x5948d3['Id'],'name':_0x5948d3[_0x01f9('0x28')]});}}else{logger[_0x01f9('0x1c')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x526c93);return _0x38143c[_0x01f9('0x29')]()[_0x01f9('0x24')](function(_0x4a08de){return BPromise[_0x01f9('0x27')]({'id':_0x4a08de[_0x01f9('0x2a')],'name':_0x4a08de[_0x01f9('0x2b')]});});}});}else{logger[_0x01f9('0x1c')](_0x01f9('0x2c'),_0x526c93);return _0x38143c[_0x01f9('0x29')]()[_0x01f9('0x24')](function(_0x3d17b){return BPromise['resolve']({'id':_0x3d17b[_0x01f9('0x2a')],'name':_0x3d17b[_0x01f9('0x2b')]});});}}function getEndUser(_0x167c23,_0x34470a,_0x2f6364,_0x4b2483,_0x408f5a){var _0xcfb26d={'$or':{'Phone':_0x4b2483}};var _0x24bd97={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x01f9('0x27')]()[_0x01f9('0x24')](function(){logger[_0x01f9('0x1c')](_0x01f9('0x2d'),_0x4b2483,_0x34470a[_0x01f9('0x2e')]);switch(_0x34470a[_0x01f9('0x2e')]){case'contact_lead':var _0x54655d=_[_0x01f9('0x2f')](_0xcfb26d);if(_0x34470a[_0x01f9('0x30')]){var _0x53e108={};_0x53e108[_0x34470a[_0x01f9('0x30')]]=_0x4b2483;_['merge'](_0x54655d[_0x01f9('0x31')],_0x53e108);}return _0x408f5a[_0x01f9('0x20')]('Contact')[_0x01f9('0x22')](_0x54655d,_0x24bd97)[_0x01f9('0x23')]()[_0x01f9('0x24')](function(_0x321c26){if(_0x321c26&&_0x321c26['length']){return _0x321c26;}else{var _0x397551=_[_0x01f9('0x2f')](_0xcfb26d);if(_0x34470a[_0x01f9('0x32')]){var _0x1aaf44={};_0x1aaf44[_0x34470a[_0x01f9('0x32')]]=_0x4b2483;_[_0x01f9('0x33')](_0x397551['$or'],_0x1aaf44);}return _0x408f5a[_0x01f9('0x20')](_0x01f9('0x34'))[_0x01f9('0x22')](_0x397551,_0x24bd97);}});case _0x01f9('0x35'):var _0x3da7e5=_[_0x01f9('0x2f')](_0xcfb26d);if(_0x34470a['additionalSearchAccount']){var _0x53e108={};_0x53e108[_0x34470a[_0x01f9('0x36')]]=_0x4b2483;_[_0x01f9('0x33')](_0x3da7e5['$or'],_0x53e108);}return _0x408f5a['sobject']('Account')[_0x01f9('0x22')](_0x3da7e5,_0x24bd97)[_0x01f9('0x23')]()[_0x01f9('0x24')](function(_0x5cfa26){if(_0x5cfa26&&_0x5cfa26[_0x01f9('0x37')]){return _0x5cfa26;}else{var _0x5ef578=_[_0x01f9('0x2f')](_0xcfb26d);if(_0x34470a[_0x01f9('0x30')]){var _0x5a9ece={};_0x5a9ece[_0x34470a[_0x01f9('0x30')]]=_0x4b2483;_[_0x01f9('0x33')](_0x5ef578[_0x01f9('0x31')],_0x5a9ece);}return _0x408f5a['sobject'](_0x01f9('0x38'))[_0x01f9('0x22')](_0x5ef578,_0x24bd97)[_0x01f9('0x24')](function(_0x1cff25){if(_0x1cff25&&_0x1cff25['length']){return _0x1cff25;}else{var _0x1ffb0d=_[_0x01f9('0x2f')](_0xcfb26d);if(_0x34470a[_0x01f9('0x32')]){var _0x10717a={};_0x10717a[_0x34470a[_0x01f9('0x32')]]=_0x4b2483;_['merge'](_0x1ffb0d[_0x01f9('0x31')],_0x10717a);}return _0x408f5a['sobject']('Lead')[_0x01f9('0x22')](_0x1ffb0d,_0x24bd97);}});}});case _0x01f9('0x13'):var _0x54655d=_[_0x01f9('0x2f')](_0xcfb26d);if(_0x34470a[_0x01f9('0x30')]){var _0x53e108={};_0x53e108[_0x34470a[_0x01f9('0x30')]]=_0x4b2483;_[_0x01f9('0x33')](_0x54655d[_0x01f9('0x31')],_0x53e108);}return _0x408f5a[_0x01f9('0x20')]('Contact')['find'](_0x54655d,_0x24bd97)[_0x01f9('0x23')]();case _0x01f9('0x15'):var _0x58b2be=_[_0x01f9('0x2f')](_0xcfb26d);if(_0x34470a[_0x01f9('0x32')]){var _0x53e108={};_0x53e108[_0x34470a[_0x01f9('0x32')]]=_0x4b2483;_[_0x01f9('0x33')](_0x58b2be[_0x01f9('0x31')],_0x53e108);}return _0x408f5a[_0x01f9('0x20')](_0x01f9('0x34'))[_0x01f9('0x22')](_0x58b2be,_0x24bd97);case'account':var _0x3da7e5=_[_0x01f9('0x2f')](_0xcfb26d);if(_0x34470a['additionalSearchAccount']){var _0x53e108={};_0x53e108[_0x34470a['additionalSearchAccount']]=_0x4b2483;_[_0x01f9('0x33')](_0x3da7e5[_0x01f9('0x31')],_0x53e108);}return _0x408f5a[_0x01f9('0x20')](_0x01f9('0x39'))[_0x01f9('0x22')](_0x3da7e5,_0x24bd97);default:return null;}})[_0x01f9('0x24')](function(_0x595ad8){if(_0x595ad8&&_0x595ad8['length']){var _0x22ead9=_['first'](_0x595ad8);if(_0x22ead9){return BPromise[_0x01f9('0x27')]({'id':_0x22ead9['Id'],'name':_0x22ead9[_0x01f9('0x28')],'phone':_0x22ead9['Phone'],'endUserType':_0x22ead9[_0x01f9('0x3a')][_0x01f9('0x3b')]['toLowerCase']()});}}})['then'](function(_0x270536){if(_0x270536){logger[_0x01f9('0x1c')](_0x01f9('0x3c'),_0x270536[_0x01f9('0x14')],_0x4b2483);return BPromise[_0x01f9('0x27')](_0x270536);}else{logger[_0x01f9('0x1c')](_0x01f9('0x3d'),_0x4b2483);var _0x2ca1b0={'Phone':_0x4b2483};if(_0x34470a['moduleCreate']){if(_0x34470a[_0x01f9('0x3e')]===_0x01f9('0x13')){logger['info'](_0x01f9('0x3f'),_0x4b2483,_0x34470a['moduleCreate']);_0x2ca1b0['LastName']=_0x2f6364!==_0x01f9('0x40')?_0x2f6364:util[_0x01f9('0x41')](_0x01f9('0x42'),_0x4b2483);}else if(_0x34470a[_0x01f9('0x3e')]===_0x01f9('0x15')){logger[_0x01f9('0x1c')](_0x01f9('0x3f'),_0x4b2483,_0x34470a['moduleCreate']);_0x2ca1b0[_0x01f9('0x43')]=_0x2f6364!==_0x01f9('0x40')?_0x2f6364:util['format'](_0x01f9('0x42'),_0x4b2483);_0x2ca1b0[_0x01f9('0x44')]='No\x20Company';}else if(_0x34470a['moduleCreate']===_0x01f9('0x17')){logger[_0x01f9('0x1c')](_0x01f9('0x3f'),_0x4b2483,_0x34470a['moduleCreate']);_0x2ca1b0[_0x01f9('0x28')]=_0x2f6364!==_0x01f9('0x40')?_0x2f6364:util[_0x01f9('0x41')](_0x01f9('0x42'),_0x4b2483);}else{return null;}}return _0x408f5a[_0x01f9('0x20')](_['upperFirst'](_0x34470a[_0x01f9('0x3e')]))[_0x01f9('0x1e')](_0x2ca1b0)['then'](function(_0xc4caea){return BPromise[_0x01f9('0x27')]({'id':_0xc4caea['id'],'endUserType':_0x34470a[_0x01f9('0x3e')]});});}});}function getCustomFields(_0x72148f,_0x1d08da){var _0xbd5ae0={};if(_0x72148f[_0x01f9('0x37')]>0x0){_['forEach'](_0x72148f,function(_0x492b93){if(_[_0x01f9('0x45')]([_0x01f9('0x46'),'picklist'],_0x492b93['type'])&&_0x492b93[_0x01f9('0x47')]){_0xbd5ae0[_0x492b93[_0x01f9('0x47')]]=_0x492b93[_0x01f9('0x48')][_0x01f9('0x49')]();}else if(_0x492b93[_0x01f9('0x3b')]==='variable'&&_0x492b93[_0x01f9('0x4a')]&&_0x492b93['idField']){_0x1d08da[_0x492b93[_0x01f9('0x4a')]]&&(_0xbd5ae0[_0x492b93[_0x01f9('0x47')]]=_0x1d08da[_0x492b93[_0x01f9('0x4a')]]['toString']());}else if(_0x492b93[_0x01f9('0x3b')]===_0x01f9('0x4b')&&_0x492b93[_0x01f9('0x4c')]&&_0x492b93[_0x01f9('0x4c')]['name']&&_0x492b93['idField']){_0x1d08da[_0x492b93[_0x01f9('0x4c')]['name'][_0x01f9('0x4d')]()]&&(_0xbd5ae0[_0x492b93[_0x01f9('0x47')]]=_0x1d08da[_0x492b93['Variable'][_0x01f9('0x4e')][_0x01f9('0x4d')]()]['toString']());}});}return _0xbd5ae0;}function getConnection(_0x319a5b){var _0x49056e=_0x319a5b[_0x01f9('0x4f')][_0x01f9('0x50')](_0x319a5b[_0x01f9('0x51')]);var _0x323aec=new jsforce['Connection']({'oauth2':{'loginUrl':_0x319a5b[_0x01f9('0x52')]||_0x01f9('0x53'),'clientId':_0x319a5b['clientId'],'clientSecret':_0x319a5b[_0x01f9('0x54')]}});return _0x323aec['login'](_0x319a5b['username'],_0x49056e)[_0x01f9('0x24')](function(){logger['info']('Connection\x20established.');return _0x323aec;});}exports[_0x01f9('0x55')]=function(_0x40424f,_0x2f7553,_0x4b0c17,_0x21e851,_0x315bc7,_0x35e20c){var _0x22347b,_0x4c846f,_0x1ef0d6,_0x3f3150;_0x35e20c[_0x01f9('0x56')]=intUtil['stripTrailingSlash'](_0x35e20c['serverUrl']);_0x35e20c[_0x01f9('0x52')]=intUtil[_0x01f9('0x57')](_0x35e20c['remoteUri']);if(_0x315bc7&&_0x315bc7['monitor_format']){logger['info'](_0x01f9('0x58'),_0x01f9('0x59'));_0x2f7553[_0x01f9('0x5a')]=util['format'](_0x01f9('0x5b'),_0x35e20c['serverUrl'],_0x2f7553['uniqueid'],md5(_0x2f7553['uniqueid']));}else{_0x2f7553[_0x01f9('0x5a')]='';}return getConnection(_0x35e20c)[_0x01f9('0x24')](function(_0x24a64d){_0x3f3150=_0x24a64d;return getUser(_0x35e20c,_0x21e851['email'],_0x3f3150);})[_0x01f9('0x24')](function(_0x5391b2){_0x22347b=_0x5391b2;return getEndUser(_0x35e20c,_0x4b0c17,_0x2f7553[_0x01f9('0x5c')],_0x2f7553['calleridnum'],_0x3f3150);})['then'](function(_0x223817){_0x4c846f=_0x223817;return getTicket(_0x35e20c,_0x22347b,_0x4c846f,_0x4b0c17,_0x2f7553,_0x4b0c17['Fields'],_0x3f3150,_0x01f9('0x55'));})[_0x01f9('0x24')](function(_0x30f4b7){_0x1ef0d6=_0x30f4b7;logger[_0x01f9('0x1c')](_0x01f9('0x5d'),_0x1ef0d6['id']);logger[_0x01f9('0x1c')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x1ef0d6['id'],_0x21e851[_0x01f9('0x4e')],_0x35e20c['type']);switch(_0x35e20c[_0x01f9('0x3b')]){case _0x01f9('0x5e'):emit(util[_0x01f9('0x41')](_0x01f9('0x5f'),_0x21e851[_0x01f9('0x4e')]),_0x01f9('0x60'),{'recordId':_0x1ef0d6['id']});break;case _0x01f9('0x61'):emit(util[_0x01f9('0x41')]('user:%s',_0x21e851[_0x01f9('0x4e')]),_0x01f9('0x62'),{'uri':util[_0x01f9('0x41')]('%s/%s/e',_0x3f3150[_0x01f9('0x63')],_0x1ef0d6['id'])});break;default:logger[_0x01f9('0x64')](_0x01f9('0x65'));}})[_0x01f9('0x66')](function(_0x210156){logger['error'](_0x01f9('0x58'),_0x210156);});};exports['outbound']=function(_0x285d09,_0x5190f7,_0x2a57a2,_0x447349,_0x17d4db,_0x52422e,_0x12fd3e){var _0x2aff9b,_0x3adfd1,_0x35be6c,_0x7df344;_0x52422e[_0x01f9('0x56')]=intUtil[_0x01f9('0x57')](_0x52422e[_0x01f9('0x56')]);_0x52422e[_0x01f9('0x52')]=intUtil[_0x01f9('0x57')](_0x52422e[_0x01f9('0x52')]);if(_0x12fd3e&&_0x12fd3e[_0x01f9('0x67')]&&_0x12fd3e[_0x01f9('0x67')]!==_0x01f9('0x68')){logger['info']('[OUTBOUND]',_0x01f9('0x59'));_0x5190f7[_0x01f9('0x5a')]=util[_0x01f9('0x41')](_0x01f9('0x5b'),_0x52422e[_0x01f9('0x56')],_0x5190f7[_0x01f9('0x69')],md5(_0x5190f7['uniqueid']));}return getConnection(_0x52422e)[_0x01f9('0x24')](function(_0x5dfa93){_0x7df344=_0x5dfa93;return getUser(_0x52422e,_0x447349[_0x01f9('0x6a')],_0x7df344);})[_0x01f9('0x24')](function(_0x45c7d7){_0x2aff9b=_0x45c7d7;return getEndUser(_0x52422e,_0x2a57a2,_0x5190f7[_0x01f9('0x6b')],_0x5190f7[_0x01f9('0x6c')],_0x7df344);})[_0x01f9('0x24')](function(_0x4d12f9){_0x3adfd1=_0x4d12f9;return getTicket(_0x52422e,_0x2aff9b,_0x3adfd1,_0x2a57a2,_0x5190f7,_0x2a57a2[_0x01f9('0x6d')],_0x7df344,'outbound');})[_0x01f9('0x24')](function(_0xbbc716){_0x35be6c=_0xbbc716;logger[_0x01f9('0x1c')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x35be6c['id']);logger[_0x01f9('0x1c')](_0x01f9('0x6e'),_0x35be6c['id'],_0x447349['name'],_0x52422e['type']);switch(_0x52422e['type']){case _0x01f9('0x5e'):emit(util[_0x01f9('0x41')](_0x01f9('0x5f'),_0x447349[_0x01f9('0x4e')]),_0x01f9('0x60'),{'recordId':_0x35be6c['id']});break;case'newTab':emit(util[_0x01f9('0x41')](_0x01f9('0x5f'),_0x447349['name']),'trigger:browser:url',{'uri':util['format'](_0x01f9('0x6f'),_0x7df344[_0x01f9('0x63')],_0x35be6c['id'])});break;default:logger[_0x01f9('0x64')]('[OUTBOUND]',_0x01f9('0x70'));}})[_0x01f9('0x66')](function(_0x36a546){logger[_0x01f9('0x64')](_0x01f9('0x71'),_0x36a546);});};exports['unmanaged']=function(_0x28962d,_0x4b8ed2,_0x1b60cd,_0x23fe2e,_0x4e74d6,_0x336b62){var _0x24a22c,_0x2d9c03,_0x44ae52,_0x2d0709;_0x336b62[_0x01f9('0x56')]=intUtil[_0x01f9('0x57')](_0x336b62[_0x01f9('0x56')]);_0x336b62['remoteUri']=intUtil['stripTrailingSlash'](_0x336b62[_0x01f9('0x52')]);if(_0x4e74d6&&_0x4e74d6[_0x01f9('0x72')]){logger[_0x01f9('0x1c')]('['+_0x4b8ed2['lastevent']['toUpperCase']()+']',_0x01f9('0x59'));_0x4b8ed2[_0x01f9('0x5a')]=util[_0x01f9('0x41')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x336b62[_0x01f9('0x56')],_0x4b8ed2['uniqueid'],md5(_0x4b8ed2[_0x01f9('0x69')]));}else{_0x4b8ed2[_0x01f9('0x5a')]='';}return getConnection(_0x336b62)[_0x01f9('0x24')](function(_0x1d5f41){_0x2d0709=_0x1d5f41;if(!_['isNil'](_0x23fe2e)){return getUser(_0x336b62,_0x23fe2e[_0x01f9('0x4e')],_0x2d0709);}else{return getUser(_0x336b62,null,_0x2d0709);}})['then'](function(_0x10964b){_0x24a22c=_0x10964b;return getEndUser(_0x336b62,_0x1b60cd,_0x4b8ed2[_0x01f9('0x5c')],_0x4b8ed2[_0x01f9('0x73')],_0x2d0709);})['then'](function(_0x18851f){_0x2d9c03=_0x18851f;return getTicket(_0x336b62,_0x24a22c,_0x2d9c03,_0x1b60cd,_0x4b8ed2,_0x1b60cd[_0x01f9('0x6d')],_0x2d0709);})[_0x01f9('0x24')](function(_0x2d8098){_0x44ae52=_0x2d8098;logger[_0x01f9('0x1c')]('['+_0x4b8ed2[_0x01f9('0x74')][_0x01f9('0x75')]()+_0x01f9('0x76'),_0x44ae52['id']);logger[_0x01f9('0x1c')]('['+_0x4b8ed2['lastevent'][_0x01f9('0x75')]()+']\x20Integration\x20account\x20type\x20%s.',_0x336b62[_0x01f9('0x3b')]);})[_0x01f9('0x66')](function(_0x4e18ab){logger[_0x01f9('0x64')]('['+_0x4b8ed2['lastevent'][_0x01f9('0x75')]()+']',_0x4e18ab);});}; \ No newline at end of file +var _0x5da7=['toUpperCase',']\x20Integration\x20account\x20type\x20%s.','error','lodash','md5','jsforce','util','ioredis','../../../../config/environment','salesforce','redis','defaults','socket.io-emitter','emit','assign','getString','ticketType','Task','ActivityDate','IsReminderSet','IsRecurrence','endUserType','contact','lead','WhoId','account','WhatId','AccountId','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','create','isNil','then','find','info','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','display_name','identity','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','additionalSearchContact','merge','$or','Contact','execute','length','cloneDeep','additionalSearchLead','sobject','Lead','account_contact_lead','additionalSearchAccount','Account','first','attributes','type','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','LastName','','format','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Caller\x20-\x20%s','upperFirst','forEach','string','picklist','idField','content','variableName','toString','Variable','name','toLowerCase','password','concat','Connection','https://login.salesforce.com','clientId','login','username','Connection\x20established.','serverUrl','stripTrailingSlash','remoteUri','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','queue','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','newTab','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','monitor_format','lastevent',']\x20Ticket\x20%s\x20created.'];(function(_0x42104e,_0x1408bb){var _0x5951c0=function(_0x3b00bf){while(--_0x3b00bf){_0x42104e['push'](_0x42104e['shift']());}};_0x5951c0(++_0x1408bb);}(_0x5da7,0x1ef));var _0x75da=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5da7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x75da('0x0'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var md5=require(_0x75da('0x1'));var jsforce=require(_0x75da('0x2'));var util=require(_0x75da('0x3'));var Redis=require(_0x75da('0x4'));var intUtil=require('./util');var config=require(_0x75da('0x5'));var logger=require('../../../../config/logger')(_0x75da('0x6'));config[_0x75da('0x7')]=_[_0x75da('0x8')](config[_0x75da('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x75da('0x9'))(new Redis(config['redis']));function emit(_0x79824e,_0xb97e49,_0xd3d45b){io['to'](_0x79824e)[_0x75da('0xa')](_0xb97e49,_0xd3d45b);}function getTicket(_0xe61422,_0x367518,_0x1e7436,_0x13e4d1,_0x4941a4,_0xb79606,_0x525dd3,_0x9374c1){var _0x32a8cc=Object[_0x75da('0xb')]({},{'OwnerId':_0x367518['id'],'Subject':intUtil[_0x75da('0xc')](_0x13e4d1['Subjects'],_0x4941a4,'\x20'),'Description':intUtil['getString'](_0x13e4d1['Descriptions'],_0x4941a4,'\x0a')},getCustomFields(_0xb79606,_0x4941a4));if(_0x1e7436){if(_0x13e4d1[_0x75da('0xd')]===_0x75da('0xe')){_0x32a8cc[_0x75da('0xf')]=moment['utc']();_0x32a8cc[_0x75da('0x10')]=![];_0x32a8cc[_0x75da('0x11')]=![];if(_0x1e7436[_0x75da('0x12')]===_0x75da('0x13')||_0x1e7436['endUserType']===_0x75da('0x14')){_0x32a8cc[_0x75da('0x15')]=_0x1e7436['id'];}else if(_0x1e7436[_0x75da('0x12')]===_0x75da('0x16')){_0x32a8cc[_0x75da('0x17')]=_0x1e7436['id'];}}else if(_0x13e4d1[_0x75da('0xd')]==='Case'){if(_0x1e7436[_0x75da('0x12')]==='contact'){_0x32a8cc['ContactId']=_0x1e7436['id'];}else if(_0x1e7436[_0x75da('0x12')]==='account'){_0x32a8cc[_0x75da('0x18')]=_0x1e7436['id'];}else if(_0x1e7436[_0x75da('0x12')]==='lead'&&_0x13e4d1[_0x75da('0x19')]){_0x32a8cc[_0x13e4d1['leadId']]=_0x1e7436['id'];}else{logger['info'](_0x75da('0x1a'));}}}return _0x525dd3['sobject'](_0x13e4d1['ticketType'])[_0x75da('0x1b')](_0x32a8cc);}function getUser(_0x4da7f1,_0x215f68,_0x30c713){if(!_[_0x75da('0x1c')](_0x215f68)&&intUtil['validateEmail'](_0x215f68)){var _0x1c73b4={'Email':_0x215f68};var _0x385909={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x30c713['sobject']('User')['find'](_0x1c73b4,_0x385909)['execute']()[_0x75da('0x1d')](function(_0x300b91){if(_0x300b91['length']){var _0x17575e=_[_0x75da('0x1e')](_0x300b91,function(_0x25b451){return _0x25b451['Email']===_0x215f68;});if(_0x17575e){logger[_0x75da('0x1f')](_0x75da('0x20'),_0x215f68);return BPromise[_0x75da('0x21')]({'id':_0x17575e['Id'],'name':_0x17575e[_0x75da('0x22')]});}}else{logger['info'](_0x75da('0x23'),_0x215f68);return _0x30c713['identity']()[_0x75da('0x1d')](function(_0x1bb5b5){return BPromise[_0x75da('0x21')]({'id':_0x1bb5b5['user_id'],'name':_0x1bb5b5[_0x75da('0x24')]});});}});}else{logger[_0x75da('0x1f')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x215f68);return _0x30c713[_0x75da('0x25')]()[_0x75da('0x1d')](function(_0x5624b3){return BPromise[_0x75da('0x21')]({'id':_0x5624b3['user_id'],'name':_0x5624b3[_0x75da('0x24')]});});}}function getEndUser(_0x2e0562,_0xc34a49,_0x3ba5d8,_0x369ab7,_0x5b6f5a){var _0x2dade2={'$or':{'Phone':_0x369ab7}};var _0x35463f={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x75da('0x21')]()['then'](function(){logger['info'](_0x75da('0x26'),_0x369ab7,_0xc34a49[_0x75da('0x27')]);switch(_0xc34a49[_0x75da('0x27')]){case _0x75da('0x28'):var _0xf902c4=_['cloneDeep'](_0x2dade2);if(_0xc34a49[_0x75da('0x29')]){var _0x173563={};_0x173563[_0xc34a49[_0x75da('0x29')]]=_0x369ab7;_[_0x75da('0x2a')](_0xf902c4[_0x75da('0x2b')],_0x173563);}return _0x5b6f5a['sobject'](_0x75da('0x2c'))[_0x75da('0x1e')](_0xf902c4,_0x35463f)[_0x75da('0x2d')]()[_0x75da('0x1d')](function(_0x21d18a){if(_0x21d18a&&_0x21d18a[_0x75da('0x2e')]){return _0x21d18a;}else{var _0x4d202f=_[_0x75da('0x2f')](_0x2dade2);if(_0xc34a49[_0x75da('0x30')]){var _0x23d663={};_0x23d663[_0xc34a49[_0x75da('0x30')]]=_0x369ab7;_[_0x75da('0x2a')](_0x4d202f[_0x75da('0x2b')],_0x23d663);}return _0x5b6f5a[_0x75da('0x31')](_0x75da('0x32'))[_0x75da('0x1e')](_0x4d202f,_0x35463f);}});case _0x75da('0x33'):var _0x487d4a=_[_0x75da('0x2f')](_0x2dade2);if(_0xc34a49[_0x75da('0x34')]){var _0x173563={};_0x173563[_0xc34a49[_0x75da('0x34')]]=_0x369ab7;_[_0x75da('0x2a')](_0x487d4a[_0x75da('0x2b')],_0x173563);}return _0x5b6f5a[_0x75da('0x31')]('Account')['find'](_0x487d4a,_0x35463f)[_0x75da('0x2d')]()[_0x75da('0x1d')](function(_0xb00220){if(_0xb00220&&_0xb00220['length']){return _0xb00220;}else{var _0x3388a9=_[_0x75da('0x2f')](_0x2dade2);if(_0xc34a49[_0x75da('0x29')]){var _0x8644a7={};_0x8644a7[_0xc34a49[_0x75da('0x29')]]=_0x369ab7;_[_0x75da('0x2a')](_0x3388a9[_0x75da('0x2b')],_0x8644a7);}return _0x5b6f5a[_0x75da('0x31')](_0x75da('0x2c'))['find'](_0x3388a9,_0x35463f)['then'](function(_0x46ce6f){if(_0x46ce6f&&_0x46ce6f[_0x75da('0x2e')]){return _0x46ce6f;}else{var _0xa49777=_['cloneDeep'](_0x2dade2);if(_0xc34a49['additionalSearchLead']){var _0x310e4b={};_0x310e4b[_0xc34a49['additionalSearchLead']]=_0x369ab7;_[_0x75da('0x2a')](_0xa49777[_0x75da('0x2b')],_0x310e4b);}return _0x5b6f5a[_0x75da('0x31')](_0x75da('0x32'))[_0x75da('0x1e')](_0xa49777,_0x35463f);}});}});case _0x75da('0x13'):var _0xf902c4=_[_0x75da('0x2f')](_0x2dade2);if(_0xc34a49[_0x75da('0x29')]){var _0x173563={};_0x173563[_0xc34a49[_0x75da('0x29')]]=_0x369ab7;_['merge'](_0xf902c4[_0x75da('0x2b')],_0x173563);}return _0x5b6f5a[_0x75da('0x31')]('Contact')[_0x75da('0x1e')](_0xf902c4,_0x35463f)['execute']();case'lead':var _0x21aeb3=_['cloneDeep'](_0x2dade2);if(_0xc34a49['additionalSearchLead']){var _0x173563={};_0x173563[_0xc34a49[_0x75da('0x30')]]=_0x369ab7;_[_0x75da('0x2a')](_0x21aeb3[_0x75da('0x2b')],_0x173563);}return _0x5b6f5a[_0x75da('0x31')](_0x75da('0x32'))[_0x75da('0x1e')](_0x21aeb3,_0x35463f);case'account':var _0x487d4a=_['cloneDeep'](_0x2dade2);if(_0xc34a49[_0x75da('0x34')]){var _0x173563={};_0x173563[_0xc34a49[_0x75da('0x34')]]=_0x369ab7;_[_0x75da('0x2a')](_0x487d4a[_0x75da('0x2b')],_0x173563);}return _0x5b6f5a['sobject'](_0x75da('0x35'))[_0x75da('0x1e')](_0x487d4a,_0x35463f);default:return null;}})[_0x75da('0x1d')](function(_0x469b46){if(_0x469b46&&_0x469b46['length']){var _0x1a6117=_[_0x75da('0x36')](_0x469b46);if(_0x1a6117){return BPromise[_0x75da('0x21')]({'id':_0x1a6117['Id'],'name':_0x1a6117[_0x75da('0x22')],'phone':_0x1a6117['Phone'],'endUserType':_0x1a6117[_0x75da('0x37')][_0x75da('0x38')]['toLowerCase']()});}}})[_0x75da('0x1d')](function(_0x3388bd){if(_0x3388bd){logger[_0x75da('0x1f')](_0x75da('0x39'),_0x3388bd[_0x75da('0x12')],_0x369ab7);return BPromise[_0x75da('0x21')](_0x3388bd);}else{logger[_0x75da('0x1f')](_0x75da('0x3a'),_0x369ab7);var _0x4a066b={'Phone':_0x369ab7};if(_0xc34a49[_0x75da('0x3b')]){if(_0xc34a49[_0x75da('0x3b')]===_0x75da('0x13')){logger[_0x75da('0x1f')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x369ab7,_0xc34a49[_0x75da('0x3b')]);_0x4a066b[_0x75da('0x3c')]=_0x3ba5d8!==_0x75da('0x3d')?_0x3ba5d8:util[_0x75da('0x3e')]('Caller\x20-\x20%s',_0x369ab7);}else if(_0xc34a49[_0x75da('0x3b')]===_0x75da('0x14')){logger[_0x75da('0x1f')](_0x75da('0x3f'),_0x369ab7,_0xc34a49[_0x75da('0x3b')]);_0x4a066b['LastName']=_0x3ba5d8!==_0x75da('0x3d')?_0x3ba5d8:util[_0x75da('0x3e')](_0x75da('0x40'),_0x369ab7);_0x4a066b['Company']='No\x20Company';}else if(_0xc34a49[_0x75da('0x3b')]===_0x75da('0x16')){logger[_0x75da('0x1f')](_0x75da('0x3f'),_0x369ab7,_0xc34a49['moduleCreate']);_0x4a066b[_0x75da('0x22')]=_0x3ba5d8!==_0x75da('0x3d')?_0x3ba5d8:util[_0x75da('0x3e')]('Caller\x20-\x20%s',_0x369ab7);}else{return null;}}return _0x5b6f5a[_0x75da('0x31')](_[_0x75da('0x41')](_0xc34a49[_0x75da('0x3b')]))['create'](_0x4a066b)[_0x75da('0x1d')](function(_0xd50624){return BPromise[_0x75da('0x21')]({'id':_0xd50624['id'],'endUserType':_0xc34a49['moduleCreate']});});}});}function getCustomFields(_0x30e003,_0x1a06b3){var _0x22b353={};if(_0x30e003[_0x75da('0x2e')]>0x0){_[_0x75da('0x42')](_0x30e003,function(_0x423de5){if(_['includes']([_0x75da('0x43'),_0x75da('0x44')],_0x423de5[_0x75da('0x38')])&&_0x423de5[_0x75da('0x45')]){_0x22b353[_0x423de5[_0x75da('0x45')]]=_0x423de5[_0x75da('0x46')]['toString']();}else if(_0x423de5['type']==='variable'&&_0x423de5[_0x75da('0x47')]&&_0x423de5[_0x75da('0x45')]){_0x1a06b3[_0x423de5[_0x75da('0x47')]]&&(_0x22b353[_0x423de5[_0x75da('0x45')]]=_0x1a06b3[_0x423de5['variableName']][_0x75da('0x48')]());}else if(_0x423de5[_0x75da('0x38')]==='customVariable'&&_0x423de5[_0x75da('0x49')]&&_0x423de5['Variable'][_0x75da('0x4a')]&&_0x423de5['idField']){_0x1a06b3[_0x423de5[_0x75da('0x49')]['name'][_0x75da('0x4b')]()]&&(_0x22b353[_0x423de5[_0x75da('0x45')]]=_0x1a06b3[_0x423de5[_0x75da('0x49')][_0x75da('0x4a')][_0x75da('0x4b')]()][_0x75da('0x48')]());}});}return _0x22b353;}function getConnection(_0x10608a){var _0x324e02=_0x10608a[_0x75da('0x4c')][_0x75da('0x4d')](_0x10608a['securityToken']);var _0x24c5c3=new jsforce[(_0x75da('0x4e'))]({'oauth2':{'loginUrl':_0x10608a['remoteUri']||_0x75da('0x4f'),'clientId':_0x10608a[_0x75da('0x50')],'clientSecret':_0x10608a['clientSecret']}});return _0x24c5c3[_0x75da('0x51')](_0x10608a[_0x75da('0x52')],_0x324e02)[_0x75da('0x1d')](function(){logger[_0x75da('0x1f')](_0x75da('0x53'));return _0x24c5c3;});}exports['queue']=function(_0x15c8ed,_0x37c561,_0x926020,_0x238eb7,_0x251174,_0x48b43f){var _0x33e3ea,_0x153026,_0x48f63a,_0x57bea1;_0x48b43f[_0x75da('0x54')]=intUtil[_0x75da('0x55')](_0x48b43f[_0x75da('0x54')]);_0x48b43f['remoteUri']=intUtil['stripTrailingSlash'](_0x48b43f[_0x75da('0x56')]);if(_0x251174&&_0x251174['monitor_format']){logger[_0x75da('0x1f')](_0x75da('0x57'),_0x75da('0x58'));_0x37c561[_0x75da('0x59')]=util[_0x75da('0x3e')](_0x75da('0x5a'),_0x48b43f[_0x75da('0x54')],_0x37c561[_0x75da('0x5b')],md5(_0x37c561['uniqueid']));}else{_0x37c561['recordingURL']='';}return getConnection(_0x48b43f)[_0x75da('0x1d')](function(_0x226e99){_0x57bea1=_0x226e99;return getUser(_0x48b43f,_0x238eb7[_0x75da('0x5c')],_0x57bea1);})[_0x75da('0x1d')](function(_0x568617){_0x33e3ea=_0x568617;return getEndUser(_0x48b43f,_0x926020,_0x37c561[_0x75da('0x5d')],_0x37c561[_0x75da('0x5e')],_0x57bea1);})[_0x75da('0x1d')](function(_0x36184e){_0x153026=_0x36184e;return getTicket(_0x48b43f,_0x33e3ea,_0x153026,_0x926020,_0x37c561,_0x926020[_0x75da('0x5f')],_0x57bea1,_0x75da('0x60'));})[_0x75da('0x1d')](function(_0x26e027){_0x48f63a=_0x26e027;logger[_0x75da('0x1f')](_0x75da('0x61'),_0x48f63a['id']);logger[_0x75da('0x1f')](_0x75da('0x62'),_0x48f63a['id'],_0x238eb7[_0x75da('0x4a')],_0x48b43f['type']);switch(_0x48b43f[_0x75da('0x38')]){case'integrationTab':emit(util[_0x75da('0x3e')]('user:%s',_0x238eb7[_0x75da('0x4a')]),_0x75da('0x63'),{'recordId':_0x48f63a['id']});break;case _0x75da('0x64'):emit(util[_0x75da('0x3e')](_0x75da('0x65'),_0x238eb7[_0x75da('0x4a')]),_0x75da('0x66'),{'uri':util['format'](_0x75da('0x67'),_0x57bea1[_0x75da('0x68')],_0x48f63a['id'])});break;default:logger['error'](_0x75da('0x69'));}})[_0x75da('0x6a')](function(_0x3acdd8){logger['error']('[QUEUE]',_0x3acdd8);});};exports[_0x75da('0x6b')]=function(_0x68d40c,_0xf47547,_0x5699fb,_0x1cf8d1,_0x270ed4,_0x28d37d,_0x2223f5){var _0x1fa10f,_0x5531be,_0x5b6706,_0x2b3867;_0x28d37d['serverUrl']=intUtil[_0x75da('0x55')](_0x28d37d['serverUrl']);_0x28d37d[_0x75da('0x56')]=intUtil[_0x75da('0x55')](_0x28d37d['remoteUri']);if(_0x2223f5&&_0x2223f5[_0x75da('0x6c')]&&_0x2223f5[_0x75da('0x6c')]!==_0x75da('0x6d')){logger[_0x75da('0x1f')](_0x75da('0x6e'),_0x75da('0x58'));_0xf47547[_0x75da('0x59')]=util['format'](_0x75da('0x5a'),_0x28d37d[_0x75da('0x54')],_0xf47547[_0x75da('0x5b')],md5(_0xf47547[_0x75da('0x5b')]));}return getConnection(_0x28d37d)['then'](function(_0x548277){_0x2b3867=_0x548277;return getUser(_0x28d37d,_0x1cf8d1[_0x75da('0x5c')],_0x2b3867);})[_0x75da('0x1d')](function(_0x589ce0){_0x1fa10f=_0x589ce0;return getEndUser(_0x28d37d,_0x5699fb,_0xf47547[_0x75da('0x6f')],_0xf47547[_0x75da('0x70')],_0x2b3867);})[_0x75da('0x1d')](function(_0x48c794){_0x5531be=_0x48c794;return getTicket(_0x28d37d,_0x1fa10f,_0x5531be,_0x5699fb,_0xf47547,_0x5699fb[_0x75da('0x5f')],_0x2b3867,_0x75da('0x6b'));})[_0x75da('0x1d')](function(_0x42bfc1){_0x5b6706=_0x42bfc1;logger[_0x75da('0x1f')](_0x75da('0x71'),_0x5b6706['id']);logger['info'](_0x75da('0x72'),_0x5b6706['id'],_0x1cf8d1['name'],_0x28d37d[_0x75da('0x38')]);switch(_0x28d37d['type']){case'integrationTab':emit(util[_0x75da('0x3e')](_0x75da('0x65'),_0x1cf8d1[_0x75da('0x4a')]),'trigger:salesforce:display',{'recordId':_0x5b6706['id']});break;case'newTab':emit(util[_0x75da('0x3e')]('user:%s',_0x1cf8d1[_0x75da('0x4a')]),_0x75da('0x66'),{'uri':util[_0x75da('0x3e')]('%s/%s/e',_0x2b3867[_0x75da('0x68')],_0x5b6706['id'])});break;default:logger['error'](_0x75da('0x6e'),_0x75da('0x73'));}})[_0x75da('0x6a')](function(_0x5ae2b5){logger['error'](_0x75da('0x6e'),_0x5ae2b5);});};exports[_0x75da('0x74')]=function(_0x529147,_0x407c2f,_0x4a0230,_0x2fb365,_0x125ebf,_0x1a0d8f){var _0x1512d8,_0x428197,_0x5ef850,_0x4743c6;_0x1a0d8f[_0x75da('0x54')]=intUtil[_0x75da('0x55')](_0x1a0d8f[_0x75da('0x54')]);_0x1a0d8f['remoteUri']=intUtil[_0x75da('0x55')](_0x1a0d8f['remoteUri']);if(_0x125ebf&&_0x125ebf[_0x75da('0x75')]){logger['info']('['+_0x407c2f[_0x75da('0x76')]['toUpperCase']()+']',_0x75da('0x58'));_0x407c2f['recordingURL']=util[_0x75da('0x3e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1a0d8f[_0x75da('0x54')],_0x407c2f[_0x75da('0x5b')],md5(_0x407c2f[_0x75da('0x5b')]));}else{_0x407c2f[_0x75da('0x59')]='';}return getConnection(_0x1a0d8f)[_0x75da('0x1d')](function(_0x56b870){_0x4743c6=_0x56b870;if(!_[_0x75da('0x1c')](_0x2fb365)){return getUser(_0x1a0d8f,_0x2fb365[_0x75da('0x4a')],_0x4743c6);}else{return getUser(_0x1a0d8f,null,_0x4743c6);}})[_0x75da('0x1d')](function(_0x4fce67){_0x1512d8=_0x4fce67;return getEndUser(_0x1a0d8f,_0x4a0230,_0x407c2f[_0x75da('0x5d')],_0x407c2f['calleridnum'],_0x4743c6);})[_0x75da('0x1d')](function(_0x3b11c3){_0x428197=_0x3b11c3;return getTicket(_0x1a0d8f,_0x1512d8,_0x428197,_0x4a0230,_0x407c2f,_0x4a0230['Fields'],_0x4743c6);})['then'](function(_0x42f90b){_0x5ef850=_0x42f90b;logger['info']('['+_0x407c2f[_0x75da('0x76')]['toUpperCase']()+_0x75da('0x77'),_0x5ef850['id']);logger[_0x75da('0x1f')]('['+_0x407c2f[_0x75da('0x76')][_0x75da('0x78')]()+_0x75da('0x79'),_0x1a0d8f[_0x75da('0x38')]);})['catch'](function(_0x140184){logger[_0x75da('0x7a')]('['+_0x407c2f['lastevent'][_0x75da('0x78')]()+']',_0x140184);});}; \ 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 1a6dca3..427cf8f 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 _0xe67c=['variableName','customVariable','name','outbound','incident','getString','Descriptions',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number','label','?sysparm_query=name%3D','label_entry','Incident\x20-\x20',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%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','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','email','destcalleridnum','callDirection','queue','format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','unmanaged',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','bluebird','request-promise','util','md5','./util','defaults','redis','localhost','GET','sys_user?sysparm_query=user_name%3Dadmin','result','length','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','then','],\x20getUser\x20entity','active','true','userId','adminEmail','],\x20getUser\x20crm','],\x20createEndUser\x20input\x20crm','POST','endUserNumber','user','System','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','picklist','type','customField','nameField','toLowerCase','content','toString','includes','string','idField','variable'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe67c,0x163));var _0xce67=function(_0x550de3,_0x40f64e){_0x550de3=_0x550de3-0x0;var _0x2304d8=_0xe67c[_0x550de3];return _0x2304d8;};'use strict';var _=require('lodash');var Promise=require(_0xce67('0x0'));var rp=require(_0xce67('0x1'));var util=require(_0xce67('0x2'));var md5=require(_0xce67('0x3'));var Redis=require('ioredis');var intUtil=require(_0xce67('0x4'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')('servicenow');config['redis']=_[_0xce67('0x5')](config[_0xce67('0x6')],{'host':_0xce67('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xce67('0x6')]));function getAdminUser(_0x50b993,_0x24618a,_0x25641b,_0x22ccc9,_0x151b63,_0x2e6fe6){return new Promise(function(_0x423f63,_0x331403){var _0x2c4773={'method':_0xce67('0x8'),'uri':_0x22ccc9+_0xce67('0x9')+'&'+_0x151b63+'&'+_0x2e6fe6,'auth':_0x24618a,'json':!![]};return rp(_0x2c4773)['then'](function(_0x214ea6){if(_0x214ea6[_0xce67('0xa')][_0xce67('0xb')]>0x0){_0x25641b[_0xce67('0xc')]=_0x214ea6[_0xce67('0xa')][0x0][_0xce67('0xd')];}logger[_0xce67('0xe')]('['+[_0x50b993[_0xce67('0xf')]()]+_0xce67('0x10'),_0x25641b);_0x423f63(_0x25641b);})[_0xce67('0x11')](function(_0x83619b){logger[_0xce67('0x12')]('['+[_0x50b993[_0xce67('0xf')]()]+']',_0x83619b[_0xce67('0x13')]);_0x331403(_0x83619b[_0xce67('0x13')]);});});}function getUser(_0x58d5b1,_0x5bf74d,_0x32624c,_0x4ee546,_0x156089){return function(_0x26575e){logger[_0xce67('0xe')]('['+[_0x58d5b1['toUpperCase']()]+_0xce67('0x14'),_0x26575e);return new Promise(function(_0xc6ce75,_0x20a05c){if(intUtil[_0xce67('0x15')](_0x26575e[_0xce67('0x16')])){var _0x6145d7={'method':_0xce67('0x8'),'uri':_0x32624c+_0xce67('0x17')+_0x26575e[_0xce67('0x16')]+'&'+_0x4ee546+'&'+_0x156089,'auth':_0x5bf74d,'json':!![]};logger[_0xce67('0xe')]('['+[_0x58d5b1[_0xce67('0xf')]()]+'],\x20getUser\x20rp\x20obj',_0x6145d7);return rp(_0x6145d7)[_0xce67('0x18')](function(_0xa77ff9){logger[_0xce67('0xe')]('['+[_0x58d5b1[_0xce67('0xf')]()]+_0xce67('0x19'),_0xa77ff9);if(_0xa77ff9['result']['length']>0x0&&String(_0xa77ff9['result'][0x0][_0xce67('0x1a')])===_0xce67('0x1b')){_0x26575e[_0xce67('0x1c')]=_0xa77ff9[_0xce67('0xa')][0x0]['sys_id'];}else{_0x26575e[_0xce67('0x1c')]=_0x26575e[_0xce67('0xc')];_0x26575e[_0xce67('0x16')]=_0x26575e[_0xce67('0x1d')];}logger['info']('['+[_0x58d5b1[_0xce67('0xf')]()]+_0xce67('0x1e'),_0x26575e);_0xc6ce75(_0x26575e);})[_0xce67('0x11')](function(_0x4bceb3){logger[_0xce67('0x12')]('['+[_0x58d5b1['toUpperCase']()]+']',_0x4bceb3[_0xce67('0x13')]);_0x20a05c(_0x4bceb3[_0xce67('0x13')]);});}else{logger[_0xce67('0xe')]('['+[_0x58d5b1[_0xce67('0xf')]()]+']\x20using\x20admin\x20profile');_0x26575e[_0xce67('0x1c')]=_0x26575e[_0xce67('0xc')];_0x26575e['userEmail']=_0x26575e['adminEmail'];_0xc6ce75(_0x26575e);}});};}function createEndUser(_0x3f22cf,_0x19c325,_0x5463d6,_0x2f9183,_0x464490){logger[_0xce67('0xe')]('['+[_0x3f22cf[_0xce67('0xf')]()]+_0xce67('0x1f'),_0x5463d6);return new Promise(function(_0x1621ab,_0x33cbfa){var _0x25a069={'method':_0xce67('0x20'),'uri':_0x2f9183+'sys_user?'+_0x464490,'body':{'user_name':_0x5463d6[_0xce67('0x21')],'roles':_0xce67('0x22'),'first_name':_0x5463d6[_0xce67('0x21')],'active':_0xce67('0x1b'),'date_format':_0xce67('0x23'),'phone':_0x5463d6['endUserNumber']},'auth':_0x19c325,'json':!![]};return rp(_0x25a069)[_0xce67('0x18')](function(_0x1e2ed1){logger[_0xce67('0xe')]('['+[_0x3f22cf[_0xce67('0xf')]()]+'],\x20EndUser\x20schema',_0x1e2ed1[_0xce67('0xa')]);_0x5463d6[_0xce67('0x24')]=_0x1e2ed1[_0xce67('0xa')]['sys_id'];_0x1621ab(_0x5463d6);})[_0xce67('0x11')](function(_0x5743a7){logger[_0xce67('0x12')]('['+[_0x3f22cf[_0xce67('0xf')]()]+']',_0x5743a7[_0xce67('0x13')]);_0x33cbfa(_0x5743a7['message']);});});}function getEndUser(_0x360814,_0x3cd7ac,_0x10bc0b,_0x91bd7d,_0xa1d3c4){return function(_0xf06cab){logger[_0xce67('0xe')]('['+[_0x360814['toUpperCase']()]+_0xce67('0x25'),_0xf06cab);return new Promise(function(_0x2dd26a,_0x5060ec){var _0x19f06e={'method':_0xce67('0x8'),'uri':_0x10bc0b+_0xce67('0x26')+_0xf06cab[_0xce67('0x21')]+'&'+_0x91bd7d+'&'+_0xa1d3c4,'auth':_0x3cd7ac,'json':!![]};return rp(_0x19f06e)[_0xce67('0x18')](function(_0xa47a6a){if(_0xa47a6a[_0xce67('0xa')][_0xce67('0xb')]>0x0){_0xf06cab[_0xce67('0x24')]=_0xa47a6a['result'][0x0][_0xce67('0xd')];logger[_0xce67('0xe')]('['+[_0x360814[_0xce67('0xf')]()]+_0xce67('0x27'),_0xf06cab);_0x2dd26a(_0xf06cab);}else{return createEndUser(_0x360814,_0x3cd7ac,_0xf06cab,_0x10bc0b,_0x91bd7d)[_0xce67('0x18')](function(_0x350541){logger[_0xce67('0xe')]('['+[_0x360814[_0xce67('0xf')]()]+_0xce67('0x28'),_0x350541);_0x2dd26a(_0x350541);});}})[_0xce67('0x11')](function(_0x41ceaf){logger[_0xce67('0x12')]('['+[_0x360814[_0xce67('0xf')]()]+']',_0x41ceaf[_0xce67('0x13')]);_0x5060ec(_0x41ceaf['message']);});});};}function getCustomFields(_0x489c75,_0xb1dcf4){var _0xb98c4f={};if(_0x489c75['length']>0x0){_[_0xce67('0x29')](_0x489c75,function(_0x58ef7a){if(_['includes'](['string',_0xce67('0x2a')],_0x58ef7a[_0xce67('0x2b')])&&_0x58ef7a['nameField']&&!_0x58ef7a[_0xce67('0x2c')]){_0xb98c4f[_0x58ef7a[_0xce67('0x2d')][_0xce67('0x2e')]()]=_0x58ef7a[_0xce67('0x2f')][_0xce67('0x30')]();}else if(_[_0xce67('0x31')]([_0xce67('0x32'),_0xce67('0x2a')],_0x58ef7a[_0xce67('0x2b')])&&_0x58ef7a[_0xce67('0x33')]&&_0x58ef7a[_0xce67('0x2c')]){_0xb98c4f[_0x58ef7a[_0xce67('0x33')][_0xce67('0x2e')]()]=_0x58ef7a['content'][_0xce67('0x30')]();}else if(_0x58ef7a[_0xce67('0x2b')]===_0xce67('0x34')&&_0x58ef7a['variableName']&&_0x58ef7a[_0xce67('0x33')]&&_0x58ef7a[_0xce67('0x2c')]){_0xb98c4f[_0x58ef7a[_0xce67('0x33')]['toLowerCase']()]=_0xb1dcf4[_0x58ef7a[_0xce67('0x35')]][_0xce67('0x30')]();}else if(_0x58ef7a[_0xce67('0x2b')]===_0xce67('0x36')&&_0x58ef7a['Variable']&&_0x58ef7a['Variable'][_0xce67('0x37')]&&_0x58ef7a['idField']&&_0x58ef7a[_0xce67('0x2c')]){_0xb98c4f[_0x58ef7a[_0xce67('0x33')][_0xce67('0x2e')]()]=_0xb1dcf4[_0x58ef7a['Variable'][_0xce67('0x37')][_0xce67('0x2e')]()]['toString']();}});}return _0xb98c4f;}function getTicket(_0x52ee48,_0x1cd5dd,_0x5ebb5d,_0x37baee,_0x4ab433,_0x4c5394){return function(_0x4e2aca){logger[_0xce67('0xe')]('['+[_0x52ee48[_0xce67('0xf')]()]+']\x20getTicket\x20input\x20crm',_0x4e2aca);return new Promise(function(_0x1ee96a,_0x1012c8){var _0x392923=_0x52ee48[_0xce67('0x2e')]()===_0xce67('0x38')?_0x4e2aca[_0xce67('0x1c')]:_0x4e2aca['endUserId'];var _0x230d23={'method':_0xce67('0x20'),'uri':_0x5ebb5d+_0xce67('0x39')+'?'+_0x4c5394,'body':Object['assign']({},{'active':_0xce67('0x1b'),'caller_id':_0x392923,'assigned_to':_0x4e2aca[_0xce67('0x1c')],'short_description':intUtil[_0xce67('0x3a')](_0x37baee['Subjects'],_0x4ab433,'\x20'),'description':intUtil['getString'](_0x37baee[_0xce67('0x3b')],_0x4ab433,'\x0a')},getCustomFields(_0x37baee['Fields'],_0x4ab433)),'auth':_0x1cd5dd,'json':!![]};return rp(_0x230d23)[_0xce67('0x18')](function(_0x2b7093){logger[_0xce67('0xe')]('['+[_0x52ee48[_0xce67('0xf')]()]+_0xce67('0x3c'),_0x2b7093[_0xce67('0xa')]);_0x4e2aca[_0xce67('0x3d')]=_0x2b7093[_0xce67('0xa')][_0xce67('0xd')];_0x4e2aca[_0xce67('0x3e')]=_0x2b7093[_0xce67('0xa')][_0xce67('0x3f')];logger[_0xce67('0xe')]('['+[_0x52ee48['toUpperCase']()]+']\x20getTicket\x20crm',_0x4e2aca);_0x1ee96a(_0x4e2aca);})['catch'](function(_0x3c5a55){logger[_0xce67('0x12')]('['+[_0x52ee48['toUpperCase']()]+']',_0x3c5a55[_0xce67('0x13')]);_0x1012c8(_0x3c5a55[_0xce67('0x13')]);});});};}function createRemoteTag(_0x17b24f,_0x12a1ae,_0x36b27a,_0x189367){return new Promise(function(_0x5a61ee,_0x4f65f5){var _0x377795={'method':'POST','uri':_0x36b27a+_0xce67('0x40')+'?'+_0x189367,'body':{'short_description':_0x17b24f,'global':!![],'active':!![],'name':_0x17b24f},'auth':_0x12a1ae,'json':!![]};return rp(_0x377795)[_0xce67('0x18')](function(_0x1e8ae4){var _0x366307=_0x1e8ae4[_0xce67('0xa')]['sys_id'];_0x5a61ee(_0x366307);});});}function getRemoteTag(_0x3da528,_0x46e3e8,_0x4e490a,_0x363239,_0x1cf21b){return new Promise(function(_0x449f70,_0x5e67fb){var _0x483434={'method':_0xce67('0x8'),'uri':_0x4e490a+'label'+_0xce67('0x41')+_0x3da528+'&'+_0x363239,'auth':_0x46e3e8,'json':!![]};return rp(_0x483434)[_0xce67('0x18')](function(_0x591708){if(_0x591708[_0xce67('0xa')]['length']>0x0){var _0x5dc264=_0x591708[_0xce67('0xa')][0x0][_0xce67('0xd')];_0x449f70(_0x5dc264);}else{return createRemoteTag(_0x3da528,_0x46e3e8,_0x4e490a,_0x363239)[_0xce67('0x18')](function(_0x43ecbb){_0x449f70(_0x43ecbb);});}});});}function assignTagToIncident(_0x47c8eb,_0x51a3e5,_0x84acb3,_0x1ac538,_0x2249ea){return new Promise(function(_0x21179d,_0xb7a16d){var _0x152ec4={'method':_0xce67('0x20'),'uri':_0x84acb3+_0xce67('0x42')+'?'+_0x2249ea,'body':{'label':_0x47c8eb,'table':_0xce67('0x39'),'id_type':'Incident','table_key':_0x1ac538[_0xce67('0x3d')],'title':_0xce67('0x43')+_0x1ac538[_0xce67('0x3e')],'id_display':_0x1ac538[_0xce67('0x3e')]},'auth':_0x51a3e5,'json':!![]};return rp(_0x152ec4)[_0xce67('0x18')](function(_0x981cdd){_0x21179d();})[_0xce67('0x11')](function(){_0x21179d();});});}function manageTags(_0x194de2,_0x33882d,_0x3a2c76,_0x438d9f,_0x5c5834,_0x559963,_0x95958){return new Promise(function(_0x4a1d1e,_0x411d9d){var _0x27189b=[];_0x33882d[_0xce67('0x29')](function(_0x4ed8b6){_0x27189b['push'](getRemoteTag(_0x4ed8b6,_0x3a2c76,_0x438d9f,_0x559963,_0x95958));});return Promise['all'](_0x27189b)[_0xce67('0x18')](function(_0x22c5c7){if(_0x22c5c7['length']){logger[_0xce67('0xe')]('['+[_0x194de2[_0xce67('0xf')]()]+_0xce67('0x44'),_0x22c5c7);var _0xeb77c8=[];_0x22c5c7['forEach'](function(_0xe7d1e1){_0xeb77c8['push'](assignTagToIncident(_0xe7d1e1,_0x3a2c76,_0x438d9f,_0x5c5834,_0x559963));});return Promise['all'](_0xeb77c8)['then'](function(){_0x4a1d1e();})[_0xce67('0x11')](function(){_0x4a1d1e();});}else{_0x4a1d1e();}});});}function getTags(_0x57cced,_0x2e9ce2,_0x45fd73,_0x18c4a0,_0x3b2b04,_0x90960a){return function(_0x593276){return new Promise(function(_0x1e71cf,_0xf412fc){var _0x58843c=[];var _0x4c9938=_0x18c4a0[_0xce67('0x45')];if(_0x4c9938&&_0x4c9938[_0xce67('0xb')]>0x0){_0x58843c=_[_0xce67('0x46')](_0x4c9938,_0xce67('0x37'));}if(_0x58843c['length']>0x0){return manageTags(_0x57cced,_0x58843c,_0x2e9ce2,_0x45fd73,_0x593276,_0x3b2b04,_0x90960a)[_0xce67('0x18')](function(){_0x1e71cf(_0x593276);});}else{_0x1e71cf(_0x593276);}});};}function emit(_0x59a479,_0x2fe958,_0xd1a1e2){var _0x27a4a5=_0xce67('0x47')+_0xce67('0x48')+_0xce67('0x49')+'%255EORDERBYDESCnumber';var _0x12adbf={'uri':_0x59a479+_0xce67('0x4a')+_0xd1a1e2+_0x27a4a5};io['to'](util['format'](_0xce67('0x4b'),_0x2fe958))[_0xce67('0x4c')](_0xce67('0x4d'),_0x12adbf);}exports['cs']=function(_0x3421b4,_0x4bda49,_0x27f4ef,_0x1f7e4e,_0x3a2a27,_0x5db53b,_0x112601,_0x27de4b){var _0x2b3e47={};var _0x499598={'user':_0x5db53b[_0xce67('0x4e')],'pass':_0x5db53b[_0xce67('0x4f')]};var _0x5ece55=_0xce67('0x50');var _0x366934=_0xce67('0x51');_0x5db53b[_0xce67('0x52')]=intUtil[_0xce67('0x53')](_0x5db53b[_0xce67('0x52')]);_0x5db53b[_0xce67('0x54')]=intUtil[_0xce67('0x53')](_0x5db53b[_0xce67('0x54')]);var _0x125e89=util['format']('%s/api/now/table/',_0x5db53b[_0xce67('0x52')]);_0x2b3e47[_0xce67('0x16')]=!_['isNil'](_0x1f7e4e)?_0x1f7e4e[_0xce67('0x55')]:null;_0x2b3e47[_0xce67('0x1d')]=_0x5db53b[_0xce67('0x55')];_0x2b3e47[_0xce67('0x21')]=_0x27de4b[_0xce67('0x2e')]()===_0xce67('0x38')?_0x4bda49[_0xce67('0x56')]:_0x4bda49['calleridnum'];_0x2b3e47[_0xce67('0x57')]=_0x27de4b===_0xce67('0x58')||_0x27de4b==='unmanaged'?_0xce67('0x58'):_0xce67('0x38');var _0x8a781e=util[_0xce67('0x59')](_0xce67('0x5a'),_0x5db53b['serverUrl'],_0x4bda49[_0xce67('0x5b')],md5(_0x4bda49[_0xce67('0x5b')]));if(_0x3a2a27&&_0x3a2a27['monitor_format']){logger[_0xce67('0xe')](_0xce67('0x5c'),_0xce67('0x5d'));_0x4bda49[_0xce67('0x5e')]=_0x8a781e;}else if(_0x112601&&_0x112601[_0xce67('0x5f')]&&_0x112601[_0xce67('0x5f')]!=='none'){logger[_0xce67('0xe')](_0xce67('0x60'),_0xce67('0x5d'));_0x4bda49[_0xce67('0x5e')]=_0x8a781e;}else{_0x4bda49[_0xce67('0x5e')]='';}return getAdminUser(_0x27de4b,_0x499598,_0x2b3e47,_0x125e89,_0x366934,_0x5ece55)[_0xce67('0x18')](getUser(_0x27de4b,_0x499598,_0x125e89,_0x366934,_0x5ece55))[_0xce67('0x18')](getEndUser(_0x27de4b,_0x499598,_0x125e89,_0x366934,_0x5ece55))[_0xce67('0x18')](getTicket(_0x27de4b,_0x499598,_0x125e89,_0x27f4ef,_0x4bda49,_0x366934))['then'](function(_0x46ad43){logger[_0xce67('0xe')](util[_0xce67('0x59')](_0xce67('0x61'),_0x46ad43[_0xce67('0x3d')]));logger[_0xce67('0xe')](util[_0xce67('0x59')](_0xce67('0x62'),_0x27de4b));if(_0x27de4b!==_0xce67('0x63')){logger['info']('['+[_0x27de4b[_0xce67('0xf')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x5db53b[_0xce67('0x52')],_0x1f7e4e[_0xce67('0x37')],_0x46ad43['ticketId']);}})[_0xce67('0x11')](function(_0x38dd6e){logger[_0xce67('0x12')]('['+[_0x27de4b['toUpperCase']()]+_0xce67('0x64'),util[_0xce67('0x65')](_0x38dd6e,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xe244=['error','sys_user?sysparm_query=phone%3D','],\x20createEndUser\x20crm','includes','string','picklist','nameField','customField','content','type','idField','variable','variableName','toLowerCase','toString','customVariable','Variable',']\x20getTicket\x20input\x20crm','outbound','POST','incident','assign','getString','Subjects','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketNumber','number','label','?sysparm_query=name%3D','label_entry','Incident','ticketId','Incident\x20-\x20','forEach','push','all','map','name','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','password','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','isNil','email','destcalleridnum','calleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','message','],\x20getUser\x20input\x20crm','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','active','true','userId','adminEmail',']\x20using\x20admin\x20profile','adminId','],\x20createEndUser\x20input\x20crm','sys_user?','endUserNumber','],\x20EndUser\x20schema','endUserId'];(function(_0x2f50d0,_0x2d2fac){var _0x4f27fa=function(_0x5bd382){while(--_0x5bd382){_0x2f50d0['push'](_0x2f50d0['shift']());}};_0x4f27fa(++_0x2d2fac);}(_0xe244,0x1ec));var _0x4e24=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xe244[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x4e24('0x0'));var Promise=require(_0x4e24('0x1'));var rp=require(_0x4e24('0x2'));var util=require('util');var md5=require('md5');var Redis=require(_0x4e24('0x3'));var intUtil=require(_0x4e24('0x4'));var config=require(_0x4e24('0x5'));var logger=require(_0x4e24('0x6'))(_0x4e24('0x7'));config[_0x4e24('0x8')]=_[_0x4e24('0x9')](config[_0x4e24('0x8')],{'host':_0x4e24('0xa'),'port':0x18eb});var io=require(_0x4e24('0xb'))(new Redis(config[_0x4e24('0x8')]));function getAdminUser(_0x5bd8e1,_0x4a893c,_0x3deff3,_0x312a46,_0x16df77,_0x2cc93f){return new Promise(function(_0x5333bf,_0x3f7444){var _0x4a50ca={'method':_0x4e24('0xc'),'uri':_0x312a46+_0x4e24('0xd')+'&'+_0x16df77+'&'+_0x2cc93f,'auth':_0x4a893c,'json':!![]};return rp(_0x4a50ca)[_0x4e24('0xe')](function(_0x222fc5){if(_0x222fc5[_0x4e24('0xf')][_0x4e24('0x10')]>0x0){_0x3deff3['adminId']=_0x222fc5[_0x4e24('0xf')][0x0][_0x4e24('0x11')];}logger[_0x4e24('0x12')]('['+[_0x5bd8e1[_0x4e24('0x13')]()]+_0x4e24('0x14'),_0x3deff3);_0x5333bf(_0x3deff3);})[_0x4e24('0x15')](function(_0x55e992){logger['error']('['+[_0x5bd8e1[_0x4e24('0x13')]()]+']',_0x55e992[_0x4e24('0x16')]);_0x3f7444(_0x55e992[_0x4e24('0x16')]);});});}function getUser(_0xfa7b83,_0x350289,_0x654c6d,_0x3e5f41,_0x41b864){return function(_0x41cf27){logger[_0x4e24('0x12')]('['+[_0xfa7b83[_0x4e24('0x13')]()]+_0x4e24('0x17'),_0x41cf27);return new Promise(function(_0x3b43f2,_0x48bb02){if(intUtil['validateEmail'](_0x41cf27[_0x4e24('0x18')])){var _0x66696f={'method':_0x4e24('0xc'),'uri':_0x654c6d+_0x4e24('0x19')+_0x41cf27['userEmail']+'&'+_0x3e5f41+'&'+_0x41b864,'auth':_0x350289,'json':!![]};logger[_0x4e24('0x12')]('['+[_0xfa7b83[_0x4e24('0x13')]()]+_0x4e24('0x1a'),_0x66696f);return rp(_0x66696f)[_0x4e24('0xe')](function(_0x5abb68){logger[_0x4e24('0x12')]('['+[_0xfa7b83[_0x4e24('0x13')]()]+'],\x20getUser\x20entity',_0x5abb68);if(_0x5abb68[_0x4e24('0xf')]['length']>0x0&&String(_0x5abb68[_0x4e24('0xf')][0x0][_0x4e24('0x1b')])===_0x4e24('0x1c')){_0x41cf27['userId']=_0x5abb68['result'][0x0][_0x4e24('0x11')];}else{_0x41cf27[_0x4e24('0x1d')]=_0x41cf27['adminId'];_0x41cf27[_0x4e24('0x18')]=_0x41cf27[_0x4e24('0x1e')];}logger['info']('['+[_0xfa7b83[_0x4e24('0x13')]()]+'],\x20getUser\x20crm',_0x41cf27);_0x3b43f2(_0x41cf27);})['catch'](function(_0x2a17df){logger['error']('['+[_0xfa7b83['toUpperCase']()]+']',_0x2a17df['message']);_0x48bb02(_0x2a17df[_0x4e24('0x16')]);});}else{logger[_0x4e24('0x12')]('['+[_0xfa7b83[_0x4e24('0x13')]()]+_0x4e24('0x1f'));_0x41cf27[_0x4e24('0x1d')]=_0x41cf27[_0x4e24('0x20')];_0x41cf27[_0x4e24('0x18')]=_0x41cf27[_0x4e24('0x1e')];_0x3b43f2(_0x41cf27);}});};}function createEndUser(_0x346234,_0x523650,_0x11aaef,_0x42443b,_0x476574){logger[_0x4e24('0x12')]('['+[_0x346234[_0x4e24('0x13')]()]+_0x4e24('0x21'),_0x11aaef);return new Promise(function(_0x35a1ce,_0x7d33){var _0x5c8957={'method':'POST','uri':_0x42443b+_0x4e24('0x22')+_0x476574,'body':{'user_name':_0x11aaef[_0x4e24('0x23')],'roles':'user','first_name':_0x11aaef[_0x4e24('0x23')],'active':_0x4e24('0x1c'),'date_format':'System','phone':_0x11aaef[_0x4e24('0x23')]},'auth':_0x523650,'json':!![]};return rp(_0x5c8957)[_0x4e24('0xe')](function(_0x3121e1){logger[_0x4e24('0x12')]('['+[_0x346234['toUpperCase']()]+_0x4e24('0x24'),_0x3121e1[_0x4e24('0xf')]);_0x11aaef[_0x4e24('0x25')]=_0x3121e1[_0x4e24('0xf')][_0x4e24('0x11')];_0x35a1ce(_0x11aaef);})['catch'](function(_0x180eff){logger[_0x4e24('0x26')]('['+[_0x346234[_0x4e24('0x13')]()]+']',_0x180eff[_0x4e24('0x16')]);_0x7d33(_0x180eff[_0x4e24('0x16')]);});});}function getEndUser(_0x133bbc,_0x320ddd,_0x13ffc4,_0x473f74,_0x1dcda9){return function(_0x23ff68){logger[_0x4e24('0x12')]('['+[_0x133bbc['toUpperCase']()]+'],\x20getEndUser\x20input\x20crm',_0x23ff68);return new Promise(function(_0x4b95d9,_0x34e824){var _0x5796a0={'method':'GET','uri':_0x13ffc4+_0x4e24('0x27')+_0x23ff68[_0x4e24('0x23')]+'&'+_0x473f74+'&'+_0x1dcda9,'auth':_0x320ddd,'json':!![]};return rp(_0x5796a0)[_0x4e24('0xe')](function(_0x4db878){if(_0x4db878[_0x4e24('0xf')][_0x4e24('0x10')]>0x0){_0x23ff68[_0x4e24('0x25')]=_0x4db878[_0x4e24('0xf')][0x0]['sys_id'];logger[_0x4e24('0x12')]('['+[_0x133bbc['toUpperCase']()]+'],\x20getEndUser\x20crm',_0x23ff68);_0x4b95d9(_0x23ff68);}else{return createEndUser(_0x133bbc,_0x320ddd,_0x23ff68,_0x13ffc4,_0x473f74)[_0x4e24('0xe')](function(_0x46f4c7){logger['info']('['+[_0x133bbc['toUpperCase']()]+_0x4e24('0x28'),_0x46f4c7);_0x4b95d9(_0x46f4c7);});}})[_0x4e24('0x15')](function(_0x2084d4){logger['error']('['+[_0x133bbc[_0x4e24('0x13')]()]+']',_0x2084d4[_0x4e24('0x16')]);_0x34e824(_0x2084d4[_0x4e24('0x16')]);});});};}function getCustomFields(_0x429d19,_0x3aa790){var _0x42b5da={};if(_0x429d19[_0x4e24('0x10')]>0x0){_['forEach'](_0x429d19,function(_0x149cd6){if(_[_0x4e24('0x29')]([_0x4e24('0x2a'),_0x4e24('0x2b')],_0x149cd6['type'])&&_0x149cd6[_0x4e24('0x2c')]&&!_0x149cd6[_0x4e24('0x2d')]){_0x42b5da[_0x149cd6[_0x4e24('0x2c')]['toLowerCase']()]=_0x149cd6[_0x4e24('0x2e')]['toString']();}else if(_[_0x4e24('0x29')]([_0x4e24('0x2a'),_0x4e24('0x2b')],_0x149cd6[_0x4e24('0x2f')])&&_0x149cd6['idField']&&_0x149cd6[_0x4e24('0x2d')]){_0x42b5da[_0x149cd6[_0x4e24('0x30')]['toLowerCase']()]=_0x149cd6['content']['toString']();}else if(_0x149cd6[_0x4e24('0x2f')]===_0x4e24('0x31')&&_0x149cd6[_0x4e24('0x32')]&&_0x149cd6[_0x4e24('0x30')]&&_0x149cd6[_0x4e24('0x2d')]){_0x42b5da[_0x149cd6[_0x4e24('0x30')][_0x4e24('0x33')]()]=_0x3aa790[_0x149cd6['variableName']][_0x4e24('0x34')]();}else if(_0x149cd6['type']===_0x4e24('0x35')&&_0x149cd6[_0x4e24('0x36')]&&_0x149cd6[_0x4e24('0x36')]['name']&&_0x149cd6[_0x4e24('0x30')]&&_0x149cd6[_0x4e24('0x2d')]){_0x42b5da[_0x149cd6[_0x4e24('0x30')]['toLowerCase']()]=_0x3aa790[_0x149cd6['Variable']['name'][_0x4e24('0x33')]()]['toString']();}});}return _0x42b5da;}function getTicket(_0x59853a,_0x3b2dfa,_0x10e915,_0x377ba8,_0x34c538,_0x268254){return function(_0x39fe0e){logger['info']('['+[_0x59853a[_0x4e24('0x13')]()]+_0x4e24('0x37'),_0x39fe0e);return new Promise(function(_0x192464,_0x7f7884){var _0x33af63=_0x59853a['toLowerCase']()===_0x4e24('0x38')?_0x39fe0e[_0x4e24('0x1d')]:_0x39fe0e['endUserId'];var _0x237f7c={'method':_0x4e24('0x39'),'uri':_0x10e915+_0x4e24('0x3a')+'?'+_0x268254,'body':Object[_0x4e24('0x3b')]({},{'active':_0x4e24('0x1c'),'caller_id':_0x33af63,'assigned_to':_0x39fe0e[_0x4e24('0x1d')],'short_description':intUtil[_0x4e24('0x3c')](_0x377ba8[_0x4e24('0x3d')],_0x34c538,'\x20'),'description':intUtil[_0x4e24('0x3c')](_0x377ba8['Descriptions'],_0x34c538,'\x0a')},getCustomFields(_0x377ba8[_0x4e24('0x3e')],_0x34c538)),'auth':_0x3b2dfa,'json':!![]};return rp(_0x237f7c)['then'](function(_0x24c7ed){logger['info']('['+[_0x59853a['toUpperCase']()]+_0x4e24('0x3f'),_0x24c7ed[_0x4e24('0xf')]);_0x39fe0e['ticketId']=_0x24c7ed['result']['sys_id'];_0x39fe0e[_0x4e24('0x40')]=_0x24c7ed[_0x4e24('0xf')][_0x4e24('0x41')];logger['info']('['+[_0x59853a[_0x4e24('0x13')]()]+']\x20getTicket\x20crm',_0x39fe0e);_0x192464(_0x39fe0e);})[_0x4e24('0x15')](function(_0x49eb68){logger['error']('['+[_0x59853a[_0x4e24('0x13')]()]+']',_0x49eb68[_0x4e24('0x16')]);_0x7f7884(_0x49eb68[_0x4e24('0x16')]);});});};}function createRemoteTag(_0x4f35b2,_0x23b9b4,_0x2777dc,_0x4fe732){return new Promise(function(_0x165bb0,_0x120251){var _0x4776f3={'method':_0x4e24('0x39'),'uri':_0x2777dc+'label'+'?'+_0x4fe732,'body':{'short_description':_0x4f35b2,'global':!![],'active':!![],'name':_0x4f35b2},'auth':_0x23b9b4,'json':!![]};return rp(_0x4776f3)[_0x4e24('0xe')](function(_0x872ca1){var _0x378257=_0x872ca1['result'][_0x4e24('0x11')];_0x165bb0(_0x378257);});});}function getRemoteTag(_0xf4f27b,_0x1a384c,_0x2cdd1f,_0x5e8fc3,_0x323b49){return new Promise(function(_0x2d4f18,_0xc60008){var _0x4e1584={'method':_0x4e24('0xc'),'uri':_0x2cdd1f+_0x4e24('0x42')+_0x4e24('0x43')+_0xf4f27b+'&'+_0x5e8fc3,'auth':_0x1a384c,'json':!![]};return rp(_0x4e1584)[_0x4e24('0xe')](function(_0x1d1258){if(_0x1d1258['result'][_0x4e24('0x10')]>0x0){var _0x52040a=_0x1d1258[_0x4e24('0xf')][0x0][_0x4e24('0x11')];_0x2d4f18(_0x52040a);}else{return createRemoteTag(_0xf4f27b,_0x1a384c,_0x2cdd1f,_0x5e8fc3)['then'](function(_0x37e0bf){_0x2d4f18(_0x37e0bf);});}});});}function assignTagToIncident(_0x247aaf,_0x5c6129,_0x4a33b3,_0x1bd6fb,_0xa7a3f3){return new Promise(function(_0xa6e4c1,_0x485338){var _0x3153e7={'method':'POST','uri':_0x4a33b3+_0x4e24('0x44')+'?'+_0xa7a3f3,'body':{'label':_0x247aaf,'table':'incident','id_type':_0x4e24('0x45'),'table_key':_0x1bd6fb[_0x4e24('0x46')],'title':_0x4e24('0x47')+_0x1bd6fb[_0x4e24('0x40')],'id_display':_0x1bd6fb['ticketNumber']},'auth':_0x5c6129,'json':!![]};return rp(_0x3153e7)[_0x4e24('0xe')](function(_0x348d11){_0xa6e4c1();})[_0x4e24('0x15')](function(){_0xa6e4c1();});});}function manageTags(_0x5bf006,_0x2b70e9,_0x45d4b3,_0x27efc3,_0x3e6802,_0xe11d4b,_0x285040){return new Promise(function(_0x25a656,_0x5dce71){var _0x1f7355=[];_0x2b70e9[_0x4e24('0x48')](function(_0x20f5b3){_0x1f7355[_0x4e24('0x49')](getRemoteTag(_0x20f5b3,_0x45d4b3,_0x27efc3,_0xe11d4b,_0x285040));});return Promise[_0x4e24('0x4a')](_0x1f7355)[_0x4e24('0xe')](function(_0x551943){if(_0x551943['length']){logger[_0x4e24('0x12')]('['+[_0x5bf006[_0x4e24('0x13')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x551943);var _0x3eb984=[];_0x551943[_0x4e24('0x48')](function(_0xafbec1){_0x3eb984[_0x4e24('0x49')](assignTagToIncident(_0xafbec1,_0x45d4b3,_0x27efc3,_0x3e6802,_0xe11d4b));});return Promise[_0x4e24('0x4a')](_0x3eb984)[_0x4e24('0xe')](function(){_0x25a656();})[_0x4e24('0x15')](function(){_0x25a656();});}else{_0x25a656();}});});}function getTags(_0x322f6d,_0x2fb135,_0x4fe698,_0x2e2003,_0x23c273,_0x4e2feb){return function(_0x101172){return new Promise(function(_0xa4768d,_0x3eff61){var _0x173c5a=[];var _0x825866=_0x2e2003['Tags'];if(_0x825866&&_0x825866[_0x4e24('0x10')]>0x0){_0x173c5a=_[_0x4e24('0x4b')](_0x825866,_0x4e24('0x4c'));}if(_0x173c5a[_0x4e24('0x10')]>0x0){return manageTags(_0x322f6d,_0x173c5a,_0x2fb135,_0x4fe698,_0x101172,_0x23c273,_0x4e2feb)['then'](function(){_0xa4768d(_0x101172);});}else{_0xa4768d(_0x101172);}});};}function emit(_0x108f33,_0x2e4311,_0x4ce752){var _0x334b54='%26sysparm_record_target%3Dincident'+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0x4e24('0x4d')+_0x4e24('0x4e');var _0x30af77={'uri':_0x108f33+_0x4e24('0x4f')+_0x4ce752+_0x334b54};io['to'](util[_0x4e24('0x50')](_0x4e24('0x51'),_0x2e4311))[_0x4e24('0x52')](_0x4e24('0x53'),_0x30af77);}exports['cs']=function(_0x3fb5fb,_0x32034f,_0x5b382f,_0x46c081,_0x19d7a5,_0x3413fa,_0x255bca,_0x4929f9){var _0x1724c8={};var _0x373634={'user':_0x3413fa['username'],'pass':_0x3413fa[_0x4e24('0x54')]};var _0x3f5c3d='sysparm_limit=1';var _0x3943eb=_0x4e24('0x55');_0x3413fa[_0x4e24('0x56')]=intUtil[_0x4e24('0x57')](_0x3413fa['remoteUri']);_0x3413fa[_0x4e24('0x58')]=intUtil[_0x4e24('0x57')](_0x3413fa[_0x4e24('0x58')]);var _0x6f494d=util[_0x4e24('0x50')]('%s/api/now/table/',_0x3413fa[_0x4e24('0x56')]);_0x1724c8['userEmail']=!_[_0x4e24('0x59')](_0x46c081)?_0x46c081[_0x4e24('0x5a')]:null;_0x1724c8[_0x4e24('0x1e')]=_0x3413fa[_0x4e24('0x5a')];_0x1724c8['endUserNumber']=_0x4929f9[_0x4e24('0x33')]()===_0x4e24('0x38')?_0x32034f[_0x4e24('0x5b')]:_0x32034f[_0x4e24('0x5c')];_0x1724c8[_0x4e24('0x5d')]=_0x4929f9===_0x4e24('0x5e')||_0x4929f9==='unmanaged'?'queue':_0x4e24('0x38');var _0x322f14=util[_0x4e24('0x50')](_0x4e24('0x5f'),_0x3413fa[_0x4e24('0x58')],_0x32034f['uniqueid'],md5(_0x32034f['uniqueid']));if(_0x19d7a5&&_0x19d7a5[_0x4e24('0x60')]){logger[_0x4e24('0x12')](_0x4e24('0x61'),_0x4e24('0x62'));_0x32034f['recordingURL']=_0x322f14;}else if(_0x255bca&&_0x255bca['recordingFormat']&&_0x255bca[_0x4e24('0x63')]!==_0x4e24('0x64')){logger[_0x4e24('0x12')]('[OUTBOUND]',_0x4e24('0x62'));_0x32034f[_0x4e24('0x65')]=_0x322f14;}else{_0x32034f['recordingURL']='';}return getAdminUser(_0x4929f9,_0x373634,_0x1724c8,_0x6f494d,_0x3943eb,_0x3f5c3d)[_0x4e24('0xe')](getUser(_0x4929f9,_0x373634,_0x6f494d,_0x3943eb,_0x3f5c3d))['then'](getEndUser(_0x4929f9,_0x373634,_0x6f494d,_0x3943eb,_0x3f5c3d))[_0x4e24('0xe')](getTicket(_0x4929f9,_0x373634,_0x6f494d,_0x5b382f,_0x32034f,_0x3943eb))[_0x4e24('0xe')](function(_0x1f3c6a){logger[_0x4e24('0x12')](util[_0x4e24('0x50')](_0x4e24('0x66'),_0x1f3c6a[_0x4e24('0x46')]));logger[_0x4e24('0x12')](util['format'](_0x4e24('0x67'),_0x4929f9));if(_0x4929f9!=='unmanaged'){logger[_0x4e24('0x12')]('['+[_0x4929f9['toUpperCase']()]+']',_0x4e24('0x68'));emit(_0x3413fa['remoteUri'],_0x46c081[_0x4e24('0x4c')],_0x1f3c6a[_0x4e24('0x46')]);}})['catch'](function(_0x564d38){logger[_0x4e24('0x26')]('['+[_0x4929f9[_0x4e24('0x13')]()]+_0x4e24('0x69'),util['inspect'](_0x564d38,{'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 924d34a..f5f46e0 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 _0x5ff6=['JSON','Calls','format','Basic\x20%s','toString','base64','get_server_info','Getting\x20agent\x20with\x20name','get_entry_list','stringify','Employees','user_name','then','entry_list','find','name_value_list','Agent\x20found!','resolve','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','phone_home','Enduser\x20found!','set_entry','first_name','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','forEach','type','nameField','customField','content','string','custom_fields','variable','customVariable','Variable','toLowerCase','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','recordingURL','calleridname','calleridnum','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Fields','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','catch','error','lastevent','isNil','toUpperCase','lodash','request-promise','bluebird','md5','util','./util','../../../../config/logger','redis','socket.io-emitter','POST','info','Creating\x20new\x20ticket...','getString','Subjects','created_by','description','Descriptions','date_start','slice','parent_id','parent_type','Contacts','parent_name','name','direction','length','variableName','push','idField'];(function(_0x2c5399,_0x48edf3){var _0x266d49=function(_0x2a7393){while(--_0x2a7393){_0x2c5399['push'](_0x2c5399['shift']());}};_0x266d49(++_0x48edf3);}(_0x5ff6,0xcd));var _0x65ff=function(_0x54bcaf,_0x18740d){_0x54bcaf=_0x54bcaf-0x0;var _0x54d305=_0x5ff6[_0x54bcaf];return _0x54d305;};'use strict';var _=require(_0x65ff('0x0'));var rp=require(_0x65ff('0x1'));var BPromise=require(_0x65ff('0x2'));var md5=require(_0x65ff('0x3'));var util=require(_0x65ff('0x4'));var Redis=require('ioredis');var intUtil=require(_0x65ff('0x5'));var config=require('../../../../config/environment');var logger=require(_0x65ff('0x6'))('sugarcrm');config[_0x65ff('0x7')]=_['defaults'](config[_0x65ff('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x65ff('0x8'))(new Redis(config[_0x65ff('0x7')]));var def={'method':_0x65ff('0x9'),'json':!![]};function emit(_0x364ab9,_0x306145,_0x358ac2){io['to'](_0x364ab9)['emit'](_0x306145,_0x358ac2);}function getTicket(_0x3cc87b,_0x522a1e,_0x36ed37,_0x210452,_0x191e49,_0x22c21d,_0x46e48c,_0x4555f1){logger[_0x65ff('0xa')](_0x65ff('0xb'));var _0x2a016b=new Date();var _0x1d1a63=[{'name':'name','value':intUtil[_0x65ff('0xc')](_0x210452[_0x65ff('0xd')],_0x191e49,'\x20')},{'name':'assigned_user_id','value':_0x522a1e['id']},{'name':_0x65ff('0xe'),'value':_0x522a1e['id']},{'name':_0x65ff('0xf'),'value':intUtil[_0x65ff('0xc')](_0x210452[_0x65ff('0x10')],_0x191e49,'\x0a')},{'name':_0x65ff('0x11'),'value':_0x2a016b['toISOString']()[_0x65ff('0x12')](0x0,0x13)['replace']('T','\x20')},{'name':'duration_hours','value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0x65ff('0x13'),'value':_0x36ed37['id']},{'name':_0x65ff('0x14'),'value':_0x65ff('0x15')},{'name':_0x65ff('0x16'),'value':_0x36ed37[_0x65ff('0x17')]},{'name':_0x65ff('0x18'),'value':_0x4555f1}];if(_0x22c21d[_0x65ff('0x19')]){_['forEach'](_0x22c21d,function(_0x59b83a){if(_0x191e49[_0x59b83a[_0x65ff('0x1a')]]){_0x1d1a63[_0x65ff('0x1b')]({'name':_0x59b83a[_0x65ff('0x1c')],'value':_0x191e49[_0x59b83a[_0x65ff('0x1a')]]});}});}return request({'form':{'method':'set_entry','input_type':_0x65ff('0x1d'),'response_type':_0x65ff('0x1d'),'rest_data':JSON['stringify']({'session':_0x46e48c['id'],'module_name':_0x65ff('0x1e'),'name_value_list':_0x1d1a63})}});}function getAuth(_0x3478bb){return util[_0x65ff('0x1f')](_0x65ff('0x20'),new Buffer(_0x3478bb['apiKey']+':X')[_0x65ff('0x21')](_0x65ff('0x22')));}function getServerInfo(_0x2f6d9c){return request({'form':{'method':_0x65ff('0x23'),'input_type':_0x65ff('0x1d'),'response_type':_0x65ff('0x1d'),'rest_data':JSON['stringify']({'session':_0x2f6d9c['id']})}});}function getUser(_0xba4383,_0x4f14ff,_0x285f45){if(!_['isNil'](_0x4f14ff)){logger[_0x65ff('0xa')](_0x65ff('0x24'),_0x4f14ff);return request({'form':{'method':_0x65ff('0x25'),'input_type':_0x65ff('0x1d'),'response_type':'JSON','rest_data':JSON[_0x65ff('0x26')]({'session':_0x285f45['id'],'module_name':_0x65ff('0x27'),'query':util['format']('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x4f14ff),'order_by':'','offset':'0','select_fields':['id',_0x65ff('0x17'),_0x65ff('0x28')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x65ff('0x29')](function(_0x1275d8){if(_0x1275d8[_0x65ff('0x2a')][_0x65ff('0x19')]){var _0x39c0cf=_[_0x65ff('0x2b')](_0x1275d8[_0x65ff('0x2a')],function(_0x1523a4){return _0x1523a4[_0x65ff('0x2c')][_0x65ff('0x28')]['value']===_0x4f14ff;});if(_0x39c0cf){logger[_0x65ff('0xa')](_0x65ff('0x2d'));return BPromise[_0x65ff('0x2e')]({'id':_0x39c0cf['name_value_list']['id'][_0x65ff('0x2f')],'name':_0x39c0cf[_0x65ff('0x2c')][_0x65ff('0x17')]['value']});}}logger[_0x65ff('0xa')](_0x65ff('0x30'));return BPromise[_0x65ff('0x2e')]({'id':_0x285f45[_0x65ff('0x2c')][_0x65ff('0x31')][_0x65ff('0x2f')],'name':_0x285f45[_0x65ff('0x2c')][_0x65ff('0x28')][_0x65ff('0x2f')]});});}else{logger[_0x65ff('0xa')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0x65ff('0x2e')]({'id':_0x285f45[_0x65ff('0x2c')][_0x65ff('0x31')][_0x65ff('0x2f')],'name':_0x285f45['name_value_list'][_0x65ff('0x28')][_0x65ff('0x2f')]});}}function getEndUser(_0x69c45,_0x128b4e,_0x1d0302,_0x1dd456){logger[_0x65ff('0xa')]('Searching\x20enduser\x20with\x20phone',_0x1d0302);return request({'form':{'method':'get_entry_list','input_type':_0x65ff('0x1d'),'response_type':_0x65ff('0x1d'),'rest_data':JSON[_0x65ff('0x26')]({'session':_0x1dd456['id'],'module_name':_0x65ff('0x15'),'query':util['format']('contacts.phone_home\x20=\x20\x22%s\x22',_0x1d0302),'order_by':'','offset':'0','select_fields':['id',_0x65ff('0x17'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x2ffe0c){if(_0x2ffe0c['entry_list'][_0x65ff('0x19')]){var _0x306015=_['find'](_0x2ffe0c[_0x65ff('0x2a')],function(_0x2f0b27){return _0x2f0b27[_0x65ff('0x2c')][_0x65ff('0x32')][_0x65ff('0x2f')]===_0x1d0302;});if(_0x306015){logger[_0x65ff('0xa')](_0x65ff('0x33'));return BPromise[_0x65ff('0x2e')]({'id':_0x306015[_0x65ff('0x2c')]['id'][_0x65ff('0x2f')],'name':_0x306015['name_value_list']['name']['value'],'phone':_0x306015['name_value_list'][_0x65ff('0x32')][_0x65ff('0x2f')]});}}else{logger[_0x65ff('0xa')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0x65ff('0x34'),'input_type':_0x65ff('0x1d'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x1dd456['id'],'module_name':_0x65ff('0x15'),'name_value_list':[{'name':_0x65ff('0x35'),'value':_0x128b4e!==''?_0x128b4e:util[_0x65ff('0x1f')](_0x65ff('0x36'),_0x1d0302)},{'name':_0x65ff('0x32'),'value':_0x1d0302}]})}})[_0x65ff('0x29')](function(_0x5daee5){logger[_0x65ff('0xa')](_0x65ff('0x37'));return BPromise[_0x65ff('0x2e')]({'id':_0x5daee5['id'],'name':_0x5daee5[_0x65ff('0x2a')]['first_name'][_0x65ff('0x2f')],'phone':_0x5daee5[_0x65ff('0x2a')][_0x65ff('0x32')][_0x65ff('0x2f')]});});}});}function request(_0x232b2a){logger[_0x65ff('0x38')](_0x65ff('0x39'),JSON['stringify'](_0x232b2a));return rp(_[_0x65ff('0x3a')](def,_0x232b2a));}function getTags(_0x42e092,_0x3f9372){var _0x4fdda8=[];if(_0x42e092&&_0x42e092['length']>0x0){_0x4fdda8=_[_0x65ff('0x3b')](_0x42e092,_0x3f9372);}return _0x4fdda8;}function getCustomFields(_0x39f43a,_0x2b6c21){var _0x504b8d=[];var _0x546d6a={'custom_fields':[]};if(_0x39f43a['length']>0x0){_[_0x65ff('0x3c')](_0x39f43a,function(_0x512e2f){if(_0x512e2f[_0x65ff('0x3d')]==='string'&&_0x512e2f[_0x65ff('0x3e')]&&!_0x512e2f[_0x65ff('0x3f')]){_0x546d6a[_0x512e2f[_0x65ff('0x3e')]['toLowerCase']()]=_0x512e2f[_0x65ff('0x40')][_0x65ff('0x21')]();}else if(_0x512e2f[_0x65ff('0x3d')]===_0x65ff('0x41')&&_0x512e2f[_0x65ff('0x1c')]&&_0x512e2f[_0x65ff('0x3f')]){_0x546d6a[_0x65ff('0x42')][_0x65ff('0x1b')]({'id':_0x512e2f['idField'],'value':_0x512e2f['content'][_0x65ff('0x21')]()});}else if(_0x512e2f[_0x65ff('0x3d')]===_0x65ff('0x43')&&_0x512e2f[_0x65ff('0x1a')]&&_0x512e2f[_0x65ff('0x1c')]&&_0x512e2f[_0x65ff('0x3f')]){_0x2b6c21[_0x512e2f[_0x65ff('0x1a')]]&&_0x546d6a[_0x65ff('0x42')][_0x65ff('0x1b')]({'id':_0x512e2f[_0x65ff('0x1c')],'value':_0x2b6c21[_0x512e2f['variableName']][_0x65ff('0x21')]()});}else if(_0x512e2f[_0x65ff('0x3d')]===_0x65ff('0x44')&&_0x512e2f[_0x65ff('0x45')]&&_0x512e2f['Variable']['name']&&_0x512e2f[_0x65ff('0x1c')]&&_0x512e2f[_0x65ff('0x3f')]){_0x2b6c21[_0x512e2f[_0x65ff('0x45')][_0x65ff('0x17')][_0x65ff('0x46')]()]&&_0x546d6a[_0x65ff('0x42')]['push']({'id':_0x512e2f[_0x65ff('0x1c')],'value':_0x2b6c21[_0x512e2f[_0x65ff('0x45')][_0x65ff('0x17')][_0x65ff('0x46')]()][_0x65ff('0x21')]()});}});}return _0x546d6a;}function getConnection(_0x45ee59){return request({'method':_0x65ff('0x9'),'form':{'method':'login','input_type':_0x65ff('0x1d'),'response_type':_0x65ff('0x1d'),'rest_data':JSON[_0x65ff('0x26')]({'user_auth':{'user_name':_0x45ee59[_0x65ff('0x47')],'password':_0x45ee59[_0x65ff('0x48')],'encryption':_0x65ff('0x49')},'application':_0x65ff('0x4a')})}})[_0x65ff('0x29')](function(_0x113977){var _0x4fa6d8=_0x113977;if(_0x4fa6d8['id']){def[_0x65ff('0x4b')]=_0x4fa6d8['id'];return BPromise[_0x65ff('0x2e')](_0x4fa6d8);}else{throw new Error(util['format'](_0x65ff('0x4c'),_0x45ee59['id']));}});}function setRelationship(_0x59f4f2,_0x83ea51,_0x32d3bf,_0x143815){return request({'form':{'method':_0x65ff('0x4d'),'input_type':_0x65ff('0x1d'),'response_type':'JSON','rest_data':JSON[_0x65ff('0x26')]({'session':_0x59f4f2['id'],'module_name':_0x65ff('0x1e'),'module_id':_0x32d3bf['id'],'link_field_name':_0x143815,'related_ids':[_0x83ea51['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x65ff('0x4e')]=function(_0x15a67c,_0x2b9d49,_0x22b535,_0x136af9,_0x69f81a,_0x2a31e2){var _0x1f7a8b,_0x4622be,_0x478d8b,_0x1d44b5;_0x2a31e2[_0x65ff('0x4f')]=intUtil['stripTrailingSlash'](_0x2a31e2[_0x65ff('0x4f')]);_0x2a31e2['serverUrl']=intUtil[_0x65ff('0x50')](_0x2a31e2[_0x65ff('0x51')]);def[_0x65ff('0x52')]=util[_0x65ff('0x1f')](_0x65ff('0x53'),_0x2a31e2[_0x65ff('0x4f')]);if(_0x69f81a&&_0x69f81a[_0x65ff('0x54')]){logger['info'](_0x65ff('0x55'),_0x65ff('0x56'));_0x2b9d49['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2a31e2[_0x65ff('0x51')],_0x2b9d49[_0x65ff('0x57')],md5(_0x2b9d49[_0x65ff('0x57')]));}else{_0x2b9d49[_0x65ff('0x58')]='';}return getConnection(_0x2a31e2)[_0x65ff('0x29')](function(_0x3b179b){_0x1d44b5=_0x3b179b;return getUser(_0x2a31e2,_0x136af9[_0x65ff('0x17')],_0x1d44b5);})[_0x65ff('0x29')](function(_0x2d7e05){_0x1f7a8b=_0x2d7e05;logger[_0x65ff('0xa')]('The\x20User\x20ID\x20is:',_0x1f7a8b['id']);return getEndUser(_0x2a31e2,_0x2b9d49[_0x65ff('0x59')],_0x2b9d49[_0x65ff('0x5a')],_0x1d44b5);})[_0x65ff('0x29')](function(_0x6cd6dd){_0x4622be=_0x6cd6dd;logger['info']('The\x20Enduser\x20ID\x20is:',_0x4622be['id']);return getTicket(_0x2a31e2,_0x1f7a8b,_0x4622be,_0x22b535,_0x2b9d49,_0x22b535['Fields'],_0x1d44b5,_0x65ff('0x5b'));})[_0x65ff('0x29')](function(_0x389129){_0x478d8b=_0x389129;logger[_0x65ff('0xa')](_0x65ff('0x5c'));logger[_0x65ff('0xa')](_0x65ff('0x5d'),_0x478d8b['id']);return setRelationship(_0x1d44b5,_0x1f7a8b,_0x478d8b,_0x65ff('0x5e'));})[_0x65ff('0x29')](function(){return setRelationship(_0x1d44b5,_0x4622be,_0x478d8b,_0x65ff('0x5f'));})[_0x65ff('0x29')](function(){return getServerInfo(_0x1d44b5);})[_0x65ff('0x29')](function(_0x462c48){var _0x4d6314=parseInt(_0x462c48[_0x65ff('0x60')][_0x65ff('0x61')](0x0));var _0x11d497=util[_0x65ff('0x1f')](_0x65ff('0x62'),_0x2a31e2['remoteUri'],_0x478d8b['id']);if(_0x4d6314>0x6){_0x11d497=util[_0x65ff('0x1f')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x2a31e2[_0x65ff('0x4f')],_0x478d8b['id']);}logger[_0x65ff('0xa')](_0x65ff('0x55'),_0x65ff('0x63'));emit(util[_0x65ff('0x1f')](_0x65ff('0x64'),_0x136af9[_0x65ff('0x17')]),_0x65ff('0x65'),{'uri':_0x11d497});})['catch'](function(_0x2a263f){logger['error'](_0x65ff('0x55'),JSON[_0x65ff('0x26')](_0x2a263f));});};exports[_0x65ff('0x66')]=function(_0x227696,_0x5134cf,_0x36a620,_0x650c15,_0x5e3ece,_0x2d4560,_0x1806b5){var _0x5ee248,_0x4b0819,_0x13cdc8,_0x270b76;_0x2d4560[_0x65ff('0x4f')]=intUtil[_0x65ff('0x50')](_0x2d4560['remoteUri']);_0x2d4560['serverUrl']=intUtil[_0x65ff('0x50')](_0x2d4560['serverUrl']);def[_0x65ff('0x52')]=util[_0x65ff('0x1f')]('%s/service/v4_1/rest.php',_0x2d4560[_0x65ff('0x4f')]);if(_0x1806b5&&_0x1806b5[_0x65ff('0x67')]&&_0x1806b5[_0x65ff('0x67')]!==_0x65ff('0x68')){logger[_0x65ff('0xa')](_0x65ff('0x69'),_0x65ff('0x56'));_0x5134cf['recordingURL']=util['format'](_0x65ff('0x6a'),_0x2d4560['serverUrl'],_0x5134cf[_0x65ff('0x57')],md5(_0x5134cf[_0x65ff('0x57')]));}return getConnection(_0x2d4560)[_0x65ff('0x29')](function(_0x1457c9){_0x270b76=_0x1457c9;return getUser(_0x2d4560,_0x650c15[_0x65ff('0x17')],_0x270b76);})[_0x65ff('0x29')](function(_0x4f0e0e){_0x5ee248=_0x4f0e0e;logger['info'](_0x65ff('0x6b'),_0x5ee248['id']);return getEndUser(_0x2d4560,_0x5134cf[_0x65ff('0x6c')],_0x5134cf[_0x65ff('0x6d')],_0x270b76);})[_0x65ff('0x29')](function(_0x1f2847){_0x4b0819=_0x1f2847;logger[_0x65ff('0xa')]('The\x20Enduser\x20ID\x20is:',_0x4b0819['id']);return getTicket(_0x2d4560,_0x5ee248,_0x4b0819,_0x36a620,_0x5134cf,_0x36a620[_0x65ff('0x6e')],_0x270b76,'Outbound');})['then'](function(_0x49cbc2){_0x13cdc8=_0x49cbc2;logger[_0x65ff('0xa')](_0x65ff('0x5c'));logger['info'](_0x65ff('0x5d'),_0x13cdc8['id']);return setRelationship(_0x270b76,_0x5ee248,_0x13cdc8,_0x65ff('0x5e'));})['then'](function(){return setRelationship(_0x270b76,_0x4b0819,_0x13cdc8,_0x65ff('0x5f'));})[_0x65ff('0x29')](function(){return getServerInfo(_0x270b76);})[_0x65ff('0x29')](function(_0x2e9ba2){var _0x2433b7=parseInt(_0x2e9ba2[_0x65ff('0x60')][_0x65ff('0x61')](0x0));var _0x26e587=util['format'](_0x65ff('0x62'),_0x2d4560[_0x65ff('0x4f')],_0x13cdc8['id']);if(_0x2433b7>0x6){_0x26e587=util['format'](_0x65ff('0x6f'),_0x2d4560['remoteUri'],_0x13cdc8['id']);}logger[_0x65ff('0xa')](_0x65ff('0x69'),_0x65ff('0x63'));emit(util[_0x65ff('0x1f')](_0x65ff('0x64'),_0x650c15[_0x65ff('0x17')]),_0x65ff('0x65'),{'uri':_0x26e587});})[_0x65ff('0x70')](function(_0x39a9a2){logger[_0x65ff('0x71')](_0x65ff('0x69'),JSON[_0x65ff('0x26')](_0x39a9a2));});};exports['unmanaged']=function(_0x351721,_0x20a637,_0x19d3d9,_0x7206b8,_0x451271,_0x3db63e){var _0x3202b9,_0x177974,_0xad6126,_0x316aa8;_0x3db63e[_0x65ff('0x4f')]=intUtil[_0x65ff('0x50')](_0x3db63e[_0x65ff('0x4f')]);_0x3db63e['serverUrl']=intUtil[_0x65ff('0x50')](_0x3db63e[_0x65ff('0x51')]);def[_0x65ff('0x52')]=util[_0x65ff('0x1f')](_0x65ff('0x53'),_0x3db63e['remoteUri']);if(_0x451271&&_0x451271[_0x65ff('0x54')]){logger[_0x65ff('0xa')]('['+_0x20a637[_0x65ff('0x72')]['toUpperCase']()+']',_0x65ff('0x56'));_0x20a637[_0x65ff('0x58')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3db63e[_0x65ff('0x51')],_0x20a637[_0x65ff('0x57')],md5(_0x20a637['uniqueid']));}else{_0x20a637[_0x65ff('0x58')]='';}return getConnection(_0x3db63e)[_0x65ff('0x29')](function(_0x9e2abd){_0x316aa8=_0x9e2abd;if(!_[_0x65ff('0x73')](_0x7206b8)){return getUser(_0x3db63e,_0x7206b8[_0x65ff('0x17')],_0x316aa8);}else{return getUser(_0x3db63e,null,_0x316aa8);}})[_0x65ff('0x29')](function(_0x4295e0){_0x3202b9=_0x4295e0;logger[_0x65ff('0xa')](_0x65ff('0x6b'),_0x3202b9['id']);return getEndUser(_0x3db63e,_0x20a637['calleridname'],_0x20a637[_0x65ff('0x5a')],_0x316aa8);})[_0x65ff('0x29')](function(_0x1a09d5){_0x177974=_0x1a09d5;logger['info']('The\x20Enduser\x20ID\x20is:',_0x177974['id']);return getTicket(_0x3db63e,_0x3202b9,_0x177974,_0x19d3d9,_0x20a637,_0x19d3d9[_0x65ff('0x6e')],_0x316aa8,_0x65ff('0x5b'));})['then'](function(_0x4eed8f){_0xad6126=_0x4eed8f;logger[_0x65ff('0xa')](_0x65ff('0x5c'));logger[_0x65ff('0xa')]('The\x20Ticket\x20ID\x20is:',_0xad6126['id']);return setRelationship(_0x316aa8,_0x3202b9,_0xad6126,_0x65ff('0x5e'));})['then'](function(){return setRelationship(_0x316aa8,_0x177974,_0xad6126,_0x65ff('0x5f'));})[_0x65ff('0x29')](function(){return getServerInfo(_0x316aa8);})[_0x65ff('0x70')](function(_0x56d1ef){logger['error']('['+_0x20a637[_0x65ff('0x72')][_0x65ff('0x74')]()+']',JSON[_0x65ff('0x26')](_0x56d1ef));});}; \ No newline at end of file +var _0xb4eb=['POST','name','assigned_user_id','created_by','description','getString','Descriptions','date_start','toISOString','slice','replace','duration_hours','parent_id','parent_type','Contacts','parent_name','length','forEach','push','idField','variableName','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','isNil','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','info','resolve','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','set_entry','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','type','string','nameField','customField','toLowerCase','content','variable','custom_fields','customVariable','Variable','login','password','PLAIN','xCALLY\x20Motion\x20integration','set_relationship','queue','stripTrailingSlash','remoteUri','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:','Fields','Inbound','The\x20Ticket\x20ID\x20is:','users','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','trigger:browser:url','catch','outbound','uri','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','Ticket\x20created!','error','unmanaged','lastevent','toUpperCase','contacts','lodash','request-promise','bluebird','md5','util','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter'];(function(_0x1babf8,_0x14f0e4){var _0x426afe=function(_0x4ea840){while(--_0x4ea840){_0x1babf8['push'](_0x1babf8['shift']());}};_0x426afe(++_0x14f0e4);}(_0xb4eb,0xeb));var _0xbb4e=function(_0xae4f10,_0x43c975){_0xae4f10=_0xae4f10-0x0;var _0x1986a0=_0xb4eb[_0xae4f10];return _0x1986a0;};'use strict';var _=require(_0xbb4e('0x0'));var rp=require(_0xbb4e('0x1'));var BPromise=require(_0xbb4e('0x2'));var md5=require(_0xbb4e('0x3'));var util=require(_0xbb4e('0x4'));var Redis=require('ioredis');var intUtil=require(_0xbb4e('0x5'));var config=require(_0xbb4e('0x6'));var logger=require(_0xbb4e('0x7'))(_0xbb4e('0x8'));config[_0xbb4e('0x9')]=_[_0xbb4e('0xa')](config[_0xbb4e('0x9')],{'host':_0xbb4e('0xb'),'port':0x18eb});var io=require(_0xbb4e('0xc'))(new Redis(config[_0xbb4e('0x9')]));var def={'method':_0xbb4e('0xd'),'json':!![]};function emit(_0x29eaab,_0x5887fa,_0x5b5095){io['to'](_0x29eaab)['emit'](_0x5887fa,_0x5b5095);}function getTicket(_0x4ee10b,_0x102a50,_0x47e8dc,_0x6b138e,_0x398429,_0x253862,_0x347994,_0x2cf577){logger['info']('Creating\x20new\x20ticket...');var _0x116b64=new Date();var _0x2afcba=[{'name':_0xbb4e('0xe'),'value':intUtil['getString'](_0x6b138e['Subjects'],_0x398429,'\x20')},{'name':_0xbb4e('0xf'),'value':_0x102a50['id']},{'name':_0xbb4e('0x10'),'value':_0x102a50['id']},{'name':_0xbb4e('0x11'),'value':intUtil[_0xbb4e('0x12')](_0x6b138e[_0xbb4e('0x13')],_0x398429,'\x0a')},{'name':_0xbb4e('0x14'),'value':_0x116b64[_0xbb4e('0x15')]()[_0xbb4e('0x16')](0x0,0x13)[_0xbb4e('0x17')]('T','\x20')},{'name':_0xbb4e('0x18'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0xbb4e('0x19'),'value':_0x47e8dc['id']},{'name':_0xbb4e('0x1a'),'value':_0xbb4e('0x1b')},{'name':_0xbb4e('0x1c'),'value':_0x47e8dc[_0xbb4e('0xe')]},{'name':'direction','value':_0x2cf577}];if(_0x253862[_0xbb4e('0x1d')]){_[_0xbb4e('0x1e')](_0x253862,function(_0x44d6ce){if(_0x398429[_0x44d6ce['variableName']]){_0x2afcba[_0xbb4e('0x1f')]({'name':_0x44d6ce[_0xbb4e('0x20')],'value':_0x398429[_0x44d6ce[_0xbb4e('0x21')]]});}});}return request({'form':{'method':'set_entry','input_type':_0xbb4e('0x22'),'response_type':'JSON','rest_data':JSON[_0xbb4e('0x23')]({'session':_0x347994['id'],'module_name':_0xbb4e('0x24'),'name_value_list':_0x2afcba})}});}function getAuth(_0x12c46f){return util[_0xbb4e('0x25')](_0xbb4e('0x26'),new Buffer(_0x12c46f[_0xbb4e('0x27')]+':X')[_0xbb4e('0x28')]('base64'));}function getServerInfo(_0x111aa9){return request({'form':{'method':'get_server_info','input_type':_0xbb4e('0x22'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x111aa9['id']})}});}function getUser(_0x147e54,_0x1eddf4,_0x2bb0ad){if(!_[_0xbb4e('0x29')](_0x1eddf4)){logger['info']('Getting\x20agent\x20with\x20name',_0x1eddf4);return request({'form':{'method':_0xbb4e('0x2a'),'input_type':'JSON','response_type':_0xbb4e('0x22'),'rest_data':JSON['stringify']({'session':_0x2bb0ad['id'],'module_name':_0xbb4e('0x2b'),'query':util[_0xbb4e('0x25')](_0xbb4e('0x2c'),_0x1eddf4),'order_by':'','offset':'0','select_fields':['id',_0xbb4e('0xe'),_0xbb4e('0x2d')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xbb4e('0x2e')](function(_0x399ee8){if(_0x399ee8[_0xbb4e('0x2f')][_0xbb4e('0x1d')]){var _0x37f4da=_[_0xbb4e('0x30')](_0x399ee8['entry_list'],function(_0x4dc864){return _0x4dc864[_0xbb4e('0x31')][_0xbb4e('0x2d')]['value']===_0x1eddf4;});if(_0x37f4da){logger[_0xbb4e('0x32')]('Agent\x20found!');return BPromise[_0xbb4e('0x33')]({'id':_0x37f4da[_0xbb4e('0x31')]['id'][_0xbb4e('0x34')],'name':_0x37f4da[_0xbb4e('0x31')][_0xbb4e('0xe')][_0xbb4e('0x34')]});}}logger['info'](_0xbb4e('0x35'));return BPromise[_0xbb4e('0x33')]({'id':_0x2bb0ad[_0xbb4e('0x31')][_0xbb4e('0x36')]['value'],'name':_0x2bb0ad[_0xbb4e('0x31')][_0xbb4e('0x2d')][_0xbb4e('0x34')]});});}else{logger[_0xbb4e('0x32')](_0xbb4e('0x37'));return BPromise[_0xbb4e('0x33')]({'id':_0x2bb0ad[_0xbb4e('0x31')][_0xbb4e('0x36')][_0xbb4e('0x34')],'name':_0x2bb0ad[_0xbb4e('0x31')]['user_name'][_0xbb4e('0x34')]});}}function getEndUser(_0x2130b8,_0x22b3a0,_0x67a2f5,_0xc69150){logger[_0xbb4e('0x32')]('Searching\x20enduser\x20with\x20phone',_0x67a2f5);return request({'form':{'method':'get_entry_list','input_type':_0xbb4e('0x22'),'response_type':_0xbb4e('0x22'),'rest_data':JSON['stringify']({'session':_0xc69150['id'],'module_name':_0xbb4e('0x1b'),'query':util[_0xbb4e('0x25')](_0xbb4e('0x38'),_0x67a2f5),'order_by':'','offset':'0','select_fields':['id',_0xbb4e('0xe'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x26c76d){if(_0x26c76d[_0xbb4e('0x2f')][_0xbb4e('0x1d')]){var _0x275143=_[_0xbb4e('0x30')](_0x26c76d[_0xbb4e('0x2f')],function(_0xe83190){return _0xe83190[_0xbb4e('0x31')][_0xbb4e('0x39')][_0xbb4e('0x34')]===_0x67a2f5;});if(_0x275143){logger['info'](_0xbb4e('0x3a'));return BPromise['resolve']({'id':_0x275143['name_value_list']['id'][_0xbb4e('0x34')],'name':_0x275143[_0xbb4e('0x31')]['name']['value'],'phone':_0x275143[_0xbb4e('0x31')][_0xbb4e('0x39')]['value']});}}else{logger[_0xbb4e('0x32')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0xbb4e('0x3b'),'input_type':_0xbb4e('0x22'),'response_type':_0xbb4e('0x22'),'rest_data':JSON[_0xbb4e('0x23')]({'session':_0xc69150['id'],'module_name':_0xbb4e('0x1b'),'name_value_list':[{'name':_0xbb4e('0x3c'),'value':_0x22b3a0!==_0xbb4e('0x3d')?_0x22b3a0:util['format'](_0xbb4e('0x3e'),_0x67a2f5)},{'name':'phone_home','value':_0x67a2f5}]})}})[_0xbb4e('0x2e')](function(_0xb9dd0f){logger[_0xbb4e('0x32')](_0xbb4e('0x3f'));return BPromise[_0xbb4e('0x33')]({'id':_0xb9dd0f['id'],'name':_0xb9dd0f[_0xbb4e('0x2f')][_0xbb4e('0x3c')][_0xbb4e('0x34')],'phone':_0xb9dd0f[_0xbb4e('0x2f')][_0xbb4e('0x39')]['value']});});}});}function request(_0xe412c4){logger[_0xbb4e('0x40')](_0xbb4e('0x41'),JSON[_0xbb4e('0x23')](_0xe412c4));return rp(_[_0xbb4e('0x42')](def,_0xe412c4));}function getTags(_0x4f7d33,_0x37a719){var _0x1276ad=[];if(_0x4f7d33&&_0x4f7d33['length']>0x0){_0x1276ad=_[_0xbb4e('0x43')](_0x4f7d33,_0x37a719);}return _0x1276ad;}function getCustomFields(_0x5ea45e,_0x116a2c){var _0x4fd572=[];var _0x3fe61a={'custom_fields':[]};if(_0x5ea45e['length']>0x0){_['forEach'](_0x5ea45e,function(_0x32f4a5){if(_0x32f4a5[_0xbb4e('0x44')]===_0xbb4e('0x45')&&_0x32f4a5[_0xbb4e('0x46')]&&!_0x32f4a5[_0xbb4e('0x47')]){_0x3fe61a[_0x32f4a5['nameField'][_0xbb4e('0x48')]()]=_0x32f4a5[_0xbb4e('0x49')][_0xbb4e('0x28')]();}else if(_0x32f4a5[_0xbb4e('0x44')]===_0xbb4e('0x45')&&_0x32f4a5[_0xbb4e('0x20')]&&_0x32f4a5[_0xbb4e('0x47')]){_0x3fe61a['custom_fields'][_0xbb4e('0x1f')]({'id':_0x32f4a5['idField'],'value':_0x32f4a5[_0xbb4e('0x49')]['toString']()});}else if(_0x32f4a5['type']===_0xbb4e('0x4a')&&_0x32f4a5[_0xbb4e('0x21')]&&_0x32f4a5[_0xbb4e('0x20')]&&_0x32f4a5[_0xbb4e('0x47')]){_0x116a2c[_0x32f4a5[_0xbb4e('0x21')]]&&_0x3fe61a[_0xbb4e('0x4b')][_0xbb4e('0x1f')]({'id':_0x32f4a5[_0xbb4e('0x20')],'value':_0x116a2c[_0x32f4a5[_0xbb4e('0x21')]][_0xbb4e('0x28')]()});}else if(_0x32f4a5[_0xbb4e('0x44')]===_0xbb4e('0x4c')&&_0x32f4a5[_0xbb4e('0x4d')]&&_0x32f4a5[_0xbb4e('0x4d')][_0xbb4e('0xe')]&&_0x32f4a5[_0xbb4e('0x20')]&&_0x32f4a5[_0xbb4e('0x47')]){_0x116a2c[_0x32f4a5['Variable'][_0xbb4e('0xe')][_0xbb4e('0x48')]()]&&_0x3fe61a['custom_fields'][_0xbb4e('0x1f')]({'id':_0x32f4a5[_0xbb4e('0x20')],'value':_0x116a2c[_0x32f4a5[_0xbb4e('0x4d')][_0xbb4e('0xe')]['toLowerCase']()][_0xbb4e('0x28')]()});}});}return _0x3fe61a;}function getConnection(_0x3d2e1a){return request({'method':_0xbb4e('0xd'),'form':{'method':_0xbb4e('0x4e'),'input_type':_0xbb4e('0x22'),'response_type':_0xbb4e('0x22'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x3d2e1a['username'],'password':_0x3d2e1a[_0xbb4e('0x4f')],'encryption':_0xbb4e('0x50')},'application':_0xbb4e('0x51')})}})['then'](function(_0x47e9ad){var _0x4d74a1=_0x47e9ad;if(_0x4d74a1['id']){def['sessionID']=_0x4d74a1['id'];return BPromise[_0xbb4e('0x33')](_0x4d74a1);}else{throw new Error(util[_0xbb4e('0x25')]('Account\x20%d\x20is\x20not\x20valid',_0x3d2e1a['id']));}});}function setRelationship(_0x73ad78,_0x30c1a1,_0x1085e9,_0x459972){return request({'form':{'method':_0xbb4e('0x52'),'input_type':_0xbb4e('0x22'),'response_type':_0xbb4e('0x22'),'rest_data':JSON['stringify']({'session':_0x73ad78['id'],'module_name':'Calls','module_id':_0x1085e9['id'],'link_field_name':_0x459972,'related_ids':[_0x30c1a1['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xbb4e('0x53')]=function(_0xcaebf4,_0x2e9630,_0x16e2f7,_0x5b8a90,_0x1a2e9e,_0x4e6093){var _0x422b14,_0x195127,_0x3db873,_0x4fc8f2;_0x4e6093['remoteUri']=intUtil[_0xbb4e('0x54')](_0x4e6093[_0xbb4e('0x55')]);_0x4e6093[_0xbb4e('0x56')]=intUtil[_0xbb4e('0x54')](_0x4e6093[_0xbb4e('0x56')]);def['uri']=util['format'](_0xbb4e('0x57'),_0x4e6093['remoteUri']);if(_0x1a2e9e&&_0x1a2e9e[_0xbb4e('0x58')]){logger[_0xbb4e('0x32')](_0xbb4e('0x59'),_0xbb4e('0x5a'));_0x2e9630[_0xbb4e('0x5b')]=util[_0xbb4e('0x25')](_0xbb4e('0x5c'),_0x4e6093[_0xbb4e('0x56')],_0x2e9630[_0xbb4e('0x5d')],md5(_0x2e9630[_0xbb4e('0x5d')]));}else{_0x2e9630[_0xbb4e('0x5b')]='';}return getConnection(_0x4e6093)[_0xbb4e('0x2e')](function(_0x32eacb){_0x4fc8f2=_0x32eacb;return getUser(_0x4e6093,_0x5b8a90['name'],_0x4fc8f2);})['then'](function(_0x7f2efb){_0x422b14=_0x7f2efb;logger[_0xbb4e('0x32')](_0xbb4e('0x5e'),_0x422b14['id']);return getEndUser(_0x4e6093,_0x2e9630[_0xbb4e('0x5f')],_0x2e9630[_0xbb4e('0x60')],_0x4fc8f2);})[_0xbb4e('0x2e')](function(_0x538419){_0x195127=_0x538419;logger[_0xbb4e('0x32')](_0xbb4e('0x61'),_0x195127['id']);return getTicket(_0x4e6093,_0x422b14,_0x195127,_0x16e2f7,_0x2e9630,_0x16e2f7[_0xbb4e('0x62')],_0x4fc8f2,_0xbb4e('0x63'));})[_0xbb4e('0x2e')](function(_0x2849ee){_0x3db873=_0x2849ee;logger[_0xbb4e('0x32')]('Ticket\x20created!');logger['info'](_0xbb4e('0x64'),_0x3db873['id']);return setRelationship(_0x4fc8f2,_0x422b14,_0x3db873,_0xbb4e('0x65'));})[_0xbb4e('0x2e')](function(){return setRelationship(_0x4fc8f2,_0x195127,_0x3db873,'contacts');})['then'](function(){return getServerInfo(_0x4fc8f2);})[_0xbb4e('0x2e')](function(_0xa08f0f){var _0x459e3f=parseInt(_0xa08f0f[_0xbb4e('0x66')][_0xbb4e('0x67')](0x0));var _0x57ac16=util['format'](_0xbb4e('0x68'),_0x4e6093[_0xbb4e('0x55')],_0x3db873['id']);if(_0x459e3f>0x6){_0x57ac16=util[_0xbb4e('0x25')](_0xbb4e('0x69'),_0x4e6093[_0xbb4e('0x55')],_0x3db873['id']);}logger[_0xbb4e('0x32')]('[QUEUE]',_0xbb4e('0x6a'));emit(util[_0xbb4e('0x25')](_0xbb4e('0x6b'),_0x5b8a90['name']),_0xbb4e('0x6c'),{'uri':_0x57ac16});})[_0xbb4e('0x6d')](function(_0x390bc8){logger['error']('[QUEUE]',JSON[_0xbb4e('0x23')](_0x390bc8));});};exports[_0xbb4e('0x6e')]=function(_0xe82111,_0x381eef,_0x4666e9,_0x241cf9,_0x18fefc,_0x518fb0,_0x5ac5d0){var _0x2df6fe,_0x49db22,_0x4ee42b,_0x13be53;_0x518fb0[_0xbb4e('0x55')]=intUtil['stripTrailingSlash'](_0x518fb0[_0xbb4e('0x55')]);_0x518fb0[_0xbb4e('0x56')]=intUtil[_0xbb4e('0x54')](_0x518fb0[_0xbb4e('0x56')]);def[_0xbb4e('0x6f')]=util['format'](_0xbb4e('0x57'),_0x518fb0['remoteUri']);if(_0x5ac5d0&&_0x5ac5d0[_0xbb4e('0x70')]&&_0x5ac5d0[_0xbb4e('0x70')]!==_0xbb4e('0x71')){logger[_0xbb4e('0x32')](_0xbb4e('0x72'),_0xbb4e('0x5a'));_0x381eef[_0xbb4e('0x5b')]=util[_0xbb4e('0x25')](_0xbb4e('0x5c'),_0x518fb0['serverUrl'],_0x381eef[_0xbb4e('0x5d')],md5(_0x381eef[_0xbb4e('0x5d')]));}return getConnection(_0x518fb0)[_0xbb4e('0x2e')](function(_0x5ded0c){_0x13be53=_0x5ded0c;return getUser(_0x518fb0,_0x241cf9[_0xbb4e('0xe')],_0x13be53);})['then'](function(_0x1e5438){_0x2df6fe=_0x1e5438;logger[_0xbb4e('0x32')](_0xbb4e('0x5e'),_0x2df6fe['id']);return getEndUser(_0x518fb0,_0x381eef[_0xbb4e('0x73')],_0x381eef[_0xbb4e('0x74')],_0x13be53);})[_0xbb4e('0x2e')](function(_0x10c886){_0x49db22=_0x10c886;logger['info'](_0xbb4e('0x61'),_0x49db22['id']);return getTicket(_0x518fb0,_0x2df6fe,_0x49db22,_0x4666e9,_0x381eef,_0x4666e9[_0xbb4e('0x62')],_0x13be53,_0xbb4e('0x75'));})[_0xbb4e('0x2e')](function(_0x31019f){_0x4ee42b=_0x31019f;logger[_0xbb4e('0x32')](_0xbb4e('0x76'));logger['info'](_0xbb4e('0x64'),_0x4ee42b['id']);return setRelationship(_0x13be53,_0x2df6fe,_0x4ee42b,_0xbb4e('0x65'));})[_0xbb4e('0x2e')](function(){return setRelationship(_0x13be53,_0x49db22,_0x4ee42b,'contacts');})['then'](function(){return getServerInfo(_0x13be53);})[_0xbb4e('0x2e')](function(_0x327f41){var _0x1d1356=parseInt(_0x327f41[_0xbb4e('0x66')][_0xbb4e('0x67')](0x0));var _0x285f13=util['format'](_0xbb4e('0x68'),_0x518fb0['remoteUri'],_0x4ee42b['id']);if(_0x1d1356>0x6){_0x285f13=util[_0xbb4e('0x25')](_0xbb4e('0x69'),_0x518fb0[_0xbb4e('0x55')],_0x4ee42b['id']);}logger[_0xbb4e('0x32')](_0xbb4e('0x72'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xbb4e('0x25')]('user:%s',_0x241cf9[_0xbb4e('0xe')]),'trigger:browser:url',{'uri':_0x285f13});})['catch'](function(_0x487ee1){logger[_0xbb4e('0x77')](_0xbb4e('0x72'),JSON[_0xbb4e('0x23')](_0x487ee1));});};exports[_0xbb4e('0x78')]=function(_0x10743d,_0x3c4a78,_0x2db40e,_0x9ee0d3,_0x3ca9b9,_0x2420b2){var _0x20df08,_0x2a6c96,_0x53fcb0,_0x4f827b;_0x2420b2['remoteUri']=intUtil[_0xbb4e('0x54')](_0x2420b2[_0xbb4e('0x55')]);_0x2420b2[_0xbb4e('0x56')]=intUtil[_0xbb4e('0x54')](_0x2420b2[_0xbb4e('0x56')]);def[_0xbb4e('0x6f')]=util[_0xbb4e('0x25')](_0xbb4e('0x57'),_0x2420b2[_0xbb4e('0x55')]);if(_0x3ca9b9&&_0x3ca9b9[_0xbb4e('0x58')]){logger[_0xbb4e('0x32')]('['+_0x3c4a78[_0xbb4e('0x79')][_0xbb4e('0x7a')]()+']',_0xbb4e('0x5a'));_0x3c4a78[_0xbb4e('0x5b')]=util[_0xbb4e('0x25')](_0xbb4e('0x5c'),_0x2420b2[_0xbb4e('0x56')],_0x3c4a78[_0xbb4e('0x5d')],md5(_0x3c4a78[_0xbb4e('0x5d')]));}else{_0x3c4a78['recordingURL']='';}return getConnection(_0x2420b2)['then'](function(_0x48d6bd){_0x4f827b=_0x48d6bd;if(!_['isNil'](_0x9ee0d3)){return getUser(_0x2420b2,_0x9ee0d3['name'],_0x4f827b);}else{return getUser(_0x2420b2,null,_0x4f827b);}})[_0xbb4e('0x2e')](function(_0x33e3a3){_0x20df08=_0x33e3a3;logger[_0xbb4e('0x32')]('The\x20User\x20ID\x20is:',_0x20df08['id']);return getEndUser(_0x2420b2,_0x3c4a78[_0xbb4e('0x5f')],_0x3c4a78[_0xbb4e('0x60')],_0x4f827b);})[_0xbb4e('0x2e')](function(_0x9c4e86){_0x2a6c96=_0x9c4e86;logger[_0xbb4e('0x32')]('The\x20Enduser\x20ID\x20is:',_0x2a6c96['id']);return getTicket(_0x2420b2,_0x20df08,_0x2a6c96,_0x2db40e,_0x3c4a78,_0x2db40e['Fields'],_0x4f827b,_0xbb4e('0x63'));})[_0xbb4e('0x2e')](function(_0x3cf990){_0x53fcb0=_0x3cf990;logger['info'](_0xbb4e('0x76'));logger[_0xbb4e('0x32')](_0xbb4e('0x64'),_0x53fcb0['id']);return setRelationship(_0x4f827b,_0x20df08,_0x53fcb0,_0xbb4e('0x65'));})[_0xbb4e('0x2e')](function(){return setRelationship(_0x4f827b,_0x2a6c96,_0x53fcb0,_0xbb4e('0x7b'));})[_0xbb4e('0x2e')](function(){return getServerInfo(_0x4f827b);})[_0xbb4e('0x6d')](function(_0x55887e){logger[_0xbb4e('0x77')]('['+_0x3c4a78[_0xbb4e('0x79')][_0xbb4e('0x7a')]()+']',JSON[_0xbb4e('0x23')](_0x55887e));});}; \ 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 9016c3a..dc14dfb 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 _0x6f74=['getString','length','sortBy','string','push','type','variable','variableName','toString','Variable','name','toLowerCase','keyType','key','format','keyContent','%s:\x20%s','customVariable','join','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','test','lodash'];(function(_0x4942db,_0x117f69){var _0x20b6af=function(_0x5cc6f2){while(--_0x5cc6f2){_0x4942db['push'](_0x4942db['shift']());}};_0x20b6af(++_0x117f69);}(_0x6f74,0xcf));var _0x46f7=function(_0x213c6,_0x57cda2){_0x213c6=_0x213c6-0x0;var _0x19c241=_0x6f74[_0x213c6];return _0x19c241;};'use strict';var _=require(_0x46f7('0x0'));var util=require('util');exports[_0x46f7('0x1')]=function(_0x1ae387,_0x357b66,_0x172d3c){var _0x116e91=[];if(_0x1ae387[_0x46f7('0x2')]>0x0){var _0x80aabb=_[_0x46f7('0x3')](_0x1ae387,['id']);for(var _0x345a2d=0x0;_0x345a2d<_0x80aabb[_0x46f7('0x2')];_0x345a2d++){var _0x3c4410=_0x80aabb[_0x345a2d];if(_0x3c4410['type']===_0x46f7('0x4')){_0x116e91[_0x46f7('0x5')](_0x3c4410['content']);}else if(_0x3c4410[_0x46f7('0x6')]===_0x46f7('0x7')&&_0x3c4410[_0x46f7('0x8')]){_0x357b66[_0x3c4410['variableName']]&&_0x116e91[_0x46f7('0x5')](_0x357b66[_0x3c4410['variableName']][_0x46f7('0x9')]());}else if(_0x3c4410[_0x46f7('0x6')]==='customVariable'&&_0x3c4410[_0x46f7('0xa')]&&_0x3c4410[_0x46f7('0xa')][_0x46f7('0xb')]){_0x357b66[_0x3c4410[_0x46f7('0xa')][_0x46f7('0xb')][_0x46f7('0xc')]()]&&_0x116e91[_0x46f7('0x5')](_0x357b66[_0x3c4410['Variable']['name'][_0x46f7('0xc')]()][_0x46f7('0x9')]());}else if(_0x3c4410[_0x46f7('0x6')]==='keyValue'){if(_0x3c4410[_0x46f7('0xd')]===_0x46f7('0x4')&&_0x3c4410[_0x46f7('0xe')]){_0x116e91[_0x46f7('0x5')](util[_0x46f7('0xf')]('%s:\x20%s',_0x3c4410['key'],_0x3c4410[_0x46f7('0x10')]));}else if(_0x3c4410[_0x46f7('0xd')]===_0x46f7('0x7')&&_0x3c4410[_0x46f7('0x8')]&&_0x3c4410[_0x46f7('0xe')]){_0x357b66[_0x3c4410[_0x46f7('0x8')]]&&_0x116e91[_0x46f7('0x5')](util[_0x46f7('0xf')](_0x46f7('0x11'),_0x3c4410[_0x46f7('0xe')],_0x357b66[_0x3c4410[_0x46f7('0x8')]]));}else if(_0x3c4410[_0x46f7('0xd')]===_0x46f7('0x12')&&_0x3c4410[_0x46f7('0xa')]&&_0x3c4410[_0x46f7('0xa')][_0x46f7('0xb')]&&_0x3c4410['key']){_0x357b66[_0x3c4410[_0x46f7('0xa')][_0x46f7('0xb')][_0x46f7('0xc')]()]&&_0x116e91[_0x46f7('0x5')](util[_0x46f7('0xf')]('%s:\x20%s',_0x3c4410['key'],_0x357b66[_0x3c4410[_0x46f7('0xa')][_0x46f7('0xb')][_0x46f7('0xc')]()]));}}}}return _0x116e91[_0x46f7('0x13')](_0x172d3c);};exports[_0x46f7('0x14')]=function(_0x3e40e7){var _0x10d433=_0x3e40e7[_0x46f7('0x15')](-0x1);if(_0x10d433==='/'){_0x3e40e7=_0x3e40e7[_0x46f7('0x16')](0x0,_0x3e40e7[_0x46f7('0x17')](_0x10d433));}return _0x3e40e7;};exports[_0x46f7('0x18')]=function(_0x585143){if(!_['isNil'](_0x585143)&&_0x585143!==''){var _0x21d2e0=/^(([^<>()\[\]\\.,;:\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 _0x21d2e0[_0x46f7('0x19')](String(_0x585143)[_0x46f7('0xc')]());}else{return![];}}; \ No newline at end of file +var _0xc109=['name','toLowerCase','keyValue','string','key','format','%s:\x20%s','keyContent','keyType','join','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','test','lodash','util','getString','length','sortBy','type','content','variable','variableName','push','toString','customVariable','Variable'];(function(_0x2fd52c,_0x30d640){var _0x2a17bb=function(_0x47433a){while(--_0x47433a){_0x2fd52c['push'](_0x2fd52c['shift']());}};_0x2a17bb(++_0x30d640);}(_0xc109,0xa1));var _0x9c10=function(_0x4a0801,_0x55b298){_0x4a0801=_0x4a0801-0x0;var _0x47306d=_0xc109[_0x4a0801];return _0x47306d;};'use strict';var _=require(_0x9c10('0x0'));var util=require(_0x9c10('0x1'));exports[_0x9c10('0x2')]=function(_0x123a74,_0x290d77,_0x114e86){var _0x36b31d=[];if(_0x123a74[_0x9c10('0x3')]>0x0){var _0x24f945=_[_0x9c10('0x4')](_0x123a74,['id']);for(var _0x3594a8=0x0;_0x3594a8<_0x24f945['length'];_0x3594a8++){var _0x5808d1=_0x24f945[_0x3594a8];if(_0x5808d1[_0x9c10('0x5')]==='string'){_0x36b31d['push'](_0x5808d1[_0x9c10('0x6')]);}else if(_0x5808d1[_0x9c10('0x5')]===_0x9c10('0x7')&&_0x5808d1[_0x9c10('0x8')]){_0x290d77[_0x5808d1['variableName']]&&_0x36b31d[_0x9c10('0x9')](_0x290d77[_0x5808d1[_0x9c10('0x8')]][_0x9c10('0xa')]());}else if(_0x5808d1['type']===_0x9c10('0xb')&&_0x5808d1['Variable']&&_0x5808d1[_0x9c10('0xc')][_0x9c10('0xd')]){_0x290d77[_0x5808d1[_0x9c10('0xc')][_0x9c10('0xd')][_0x9c10('0xe')]()]&&_0x36b31d[_0x9c10('0x9')](_0x290d77[_0x5808d1[_0x9c10('0xc')][_0x9c10('0xd')]['toLowerCase']()][_0x9c10('0xa')]());}else if(_0x5808d1['type']===_0x9c10('0xf')){if(_0x5808d1['keyType']===_0x9c10('0x10')&&_0x5808d1[_0x9c10('0x11')]){_0x36b31d[_0x9c10('0x9')](util[_0x9c10('0x12')](_0x9c10('0x13'),_0x5808d1['key'],_0x5808d1[_0x9c10('0x14')]));}else if(_0x5808d1[_0x9c10('0x15')]===_0x9c10('0x7')&&_0x5808d1['variableName']&&_0x5808d1[_0x9c10('0x11')]){_0x290d77[_0x5808d1[_0x9c10('0x8')]]&&_0x36b31d[_0x9c10('0x9')](util[_0x9c10('0x12')](_0x9c10('0x13'),_0x5808d1['key'],_0x290d77[_0x5808d1['variableName']]));}else if(_0x5808d1[_0x9c10('0x15')]===_0x9c10('0xb')&&_0x5808d1[_0x9c10('0xc')]&&_0x5808d1[_0x9c10('0xc')]['name']&&_0x5808d1[_0x9c10('0x11')]){_0x290d77[_0x5808d1[_0x9c10('0xc')][_0x9c10('0xd')][_0x9c10('0xe')]()]&&_0x36b31d[_0x9c10('0x9')](util[_0x9c10('0x12')](_0x9c10('0x13'),_0x5808d1[_0x9c10('0x11')],_0x290d77[_0x5808d1['Variable'][_0x9c10('0xd')][_0x9c10('0xe')]()]));}}}}return _0x36b31d[_0x9c10('0x16')](_0x114e86);};exports[_0x9c10('0x17')]=function(_0x5305c5){var _0x51d4d6=_0x5305c5[_0x9c10('0x18')](-0x1);if(_0x51d4d6==='/'){_0x5305c5=_0x5305c5[_0x9c10('0x19')](0x0,_0x5305c5[_0x9c10('0x1a')](_0x51d4d6));}return _0x5305c5;};exports[_0x9c10('0x1b')]=function(_0x520afc){if(!_['isNil'](_0x520afc)&&_0x520afc!==''){var _0x11a390=/^(([^<>()\[\]\\.,;:\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 _0x11a390[_0x9c10('0x1c')](String(_0x520afc)['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 ff077bc..115d8a8 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 _0x34e8=['redis','defaults','localhost','emit','length','forEach','includes','string','picklist','type','idField','toString','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','getString','Subjects','POST','format','remoteUri','create','sessionName','HelpDesk','stringify','success','error','catch','statusCode','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','query','username','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','result','Agent\x20found!','resolve','email1','first_name','last_name','userId','[vTiger],\x20%s,\x20%s,\x20%s','getUser','admin','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!','phone','getEndUser','accessKey','getchallenge','then','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','recordingURL','email','The\x20User\x20ID\x20is:','calleridnum','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','split','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','bluebird','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger'];(function(_0x1af377,_0x9a0732){var _0xe45ec4=function(_0x41f000){while(--_0x41f000){_0x1af377['push'](_0x1af377['shift']());}};_0xe45ec4(++_0x9a0732);}(_0x34e8,0x12c));var _0x834e=function(_0x53f104,_0x363872){_0x53f104=_0x53f104-0x0;var _0x391c34=_0x34e8[_0x53f104];return _0x391c34;};'use strict';var _=require(_0x834e('0x0'));var rp=require(_0x834e('0x1'));var BPromise=require(_0x834e('0x2'));var md5=require(_0x834e('0x3'));var util=require('util');var Redis=require(_0x834e('0x4'));var intUtil=require(_0x834e('0x5'));var config=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));config[_0x834e('0x9')]=_[_0x834e('0xa')](config['redis'],{'host':_0x834e('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x834e('0x9')]));function emit(_0x3cc2e3,_0x3a3ef6,_0x2e69e2){io['to'](_0x3cc2e3)[_0x834e('0xc')](_0x3a3ef6,_0x2e69e2);}function getCustomFields(_0x23501c,_0x363786){var _0x1af45a={};if(_0x23501c[_0x834e('0xd')]>0x0){_[_0x834e('0xe')](_0x23501c,function(_0x1e41fe){if(_[_0x834e('0xf')]([_0x834e('0x10'),_0x834e('0x11')],_0x1e41fe[_0x834e('0x12')])&&_0x1e41fe[_0x834e('0x13')]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x1e41fe['content'][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='variable'&&_0x1e41fe[_0x834e('0x15')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe[_0x834e('0x15')]]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['variableName']][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='customVariable'&&_0x1e41fe[_0x834e('0x16')]&&_0x1e41fe['Variable'][_0x834e('0x17')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()][_0x834e('0x14')]();}});}return _0x1af45a;}function createTicket(_0xb993a1,_0x237947,_0x254677,_0x1dd214,_0x595515,_0x2545b4,_0x1fd2c6){logger[_0x834e('0x19')](_0x834e('0x1a'));var _0x4ab05d=_[_0x834e('0x1b')]({'parent_id':'','assigned_user_id':_0x237947['id'],'ticketpriorities':_0x834e('0x1c'),'ticketstatus':'Open','ticket_title':intUtil[_0x834e('0x1d')](_0x1dd214[_0x834e('0x1e')],_0x595515,'\x20'),'description':intUtil[_0x834e('0x1d')](_0x1dd214['Descriptions'],_0x595515,'\x0a'),'contact_id':_0x254677['id']},getCustomFields(_0x2545b4,_0x595515));var _0x4e3f48={'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0xb993a1[_0x834e('0x21')]),'form':{'operation':_0x834e('0x22'),'username':_0xb993a1['username'],'sessionName':_0x1fd2c6[_0x834e('0x23')],'elementType':_0x834e('0x24'),'element':JSON[_0x834e('0x25')](_0x4ab05d)},'json':!![]};return request(_0x4e3f48)['then'](function(_0x24fcf7){if(_0x24fcf7[_0x834e('0x26')]){return BPromise['resolve']({'id':_0x24fcf7['result']['id']});}else{throw new Error(util[_0x834e('0x20')]('Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s',JSON[_0x834e('0x25')](_0x24fcf7[_0x834e('0x27')])));}})[_0x834e('0x28')](function(_0x2cc2eb){var _0x3cd928=_0x2cc2eb[_0x834e('0x29')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','createTicket',_0x3cd928,JSON['stringify'](_0x2cc2eb));});}function getUser(_0x2c7a8d,_0x567cea,_0x106d6a){if(intUtil['validateEmail'](_0x567cea)){logger[_0x834e('0x19')](_0x834e('0x2a'),_0x567cea);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x2c7a8d[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x2c7a8d[_0x834e('0x2e')],'sessionName':_0x106d6a[_0x834e('0x23')],'query':util['format'](_0x834e('0x2f'),_0x567cea)},'json':!![]})['then'](function(_0x2c75c2){if(_0x2c75c2[_0x834e('0x26')]&&_0x2c75c2[_0x834e('0x30')][_0x834e('0xd')]){logger[_0x834e('0x19')](_0x834e('0x31'));return BPromise[_0x834e('0x32')]({'id':_0x2c75c2[_0x834e('0x30')][0x0]['id'],'email':_0x2c75c2[_0x834e('0x30')][0x0][_0x834e('0x33')],'name':_0x2c75c2['result'][0x0][_0x834e('0x34')]+'\x20'+_0x2c75c2[_0x834e('0x30')][_0x834e('0x35')]});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':'admin'});}})['catch'](function(_0x3e58fa){var _0x41bf4d=_0x3e58fa[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x41bf4d,JSON['stringify'](_0x3e58fa));});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':_0x834e('0x39')})[_0x834e('0x28')](function(_0x491c28){var _0x481f70=_0x491c28[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x481f70,JSON[_0x834e('0x25')](_0x491c28));});}}function getEndUser(_0x4ca43c,_0x1c5ed6,_0x548d1d,_0x50c243){logger[_0x834e('0x19')]('Searching\x20end\x20user\x20with\x20phone',_0x548d1d);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x4ca43c[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x4ca43c['username'],'sessionName':_0x50c243[_0x834e('0x23')],'query':util[_0x834e('0x20')](_0x834e('0x3a'),_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d)},'json':!![]})['then'](function(_0x35380e){if(_0x35380e[_0x834e('0x26')]&&_0x35380e['result'][_0x834e('0xd')]){logger['info'](_0x834e('0x3b'));return BPromise[_0x834e('0x32')]({'id':_0x35380e['result'][0x0]['id'],'name':_0x35380e['result'][0x0][_0x834e('0x3c')]+'\x20'+_0x35380e[_0x834e('0x30')][0x0][_0x834e('0x3d')],'phone':_0x548d1d});}else{logger[_0x834e('0x19')](_0x834e('0x3e'));return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0x4ca43c[_0x834e('0x21')]),'form':{'operation':'create','sessionName':_0x50c243[_0x834e('0x23')],'elementType':'Contacts','element':JSON[_0x834e('0x25')]({'lastname':_0x1c5ed6,'phone':_0x548d1d,'assigned_user_id':'\x20'})},'json':!![]})['then'](function(_0x361f60){logger[_0x834e('0x19')]('Enduser\x20created.');return BPromise[_0x834e('0x32')]({'id':_0x361f60[_0x834e('0x30')]['id'],'name':_0x361f60[_0x834e('0x30')][_0x834e('0x3d')],'phone':_0x361f60[_0x834e('0x30')][_0x834e('0x3f')]});})[_0x834e('0x28')](function(_0x3ccd8e){var _0x5dc63b=_0x3ccd8e[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x40'),_0x5dc63b,JSON['stringify'](_0x3ccd8e));});}});}function getConnection(_0x112306){var _0x42fd90=_0x112306[_0x834e('0x2e')];var _0x2112d5=_0x112306[_0x834e('0x41')];return request({'method':_0x834e('0x2b'),'uri':util['format']('%s/webservice.php',_0x112306[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x42'),'username':_0x42fd90},'json':!![]})[_0x834e('0x43')](function(_0x40ff5a){if(_0x40ff5a[_0x834e('0x26')]){return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x112306[_0x834e('0x21')]),'form':{'operation':_0x834e('0x44'),'username':_0x42fd90,'accessKey':md5(_0x40ff5a[_0x834e('0x30')][_0x834e('0x45')]+_0x2112d5)},'json':!![]});}})[_0x834e('0x43')](function(_0x1a3237){if(_0x1a3237[_0x834e('0x26')]){return BPromise[_0x834e('0x32')](_0x1a3237[_0x834e('0x30')]);}else{throw new Error(util[_0x834e('0x20')](_0x834e('0x46'),_0x112306['id']));}})[_0x834e('0x28')](function(_0x4cfacd){var _0x1cc0b8=_0x4cfacd[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x47'),_0x1cc0b8,JSON['stringify'](_0x4cfacd));});}function request(_0x3dcca3){logger[_0x834e('0x19')](_0x834e('0x48'),JSON[_0x834e('0x25')](_0x3dcca3));return rp(_0x3dcca3);}exports[_0x834e('0x49')]=function(_0xb77aab,_0x4549ba,_0x4a8b32,_0x1ad7fe,_0x8bc6c6,_0x3e0550){var _0x363675,_0x86ad2b,_0x396bbe,_0x344b51;_0x3e0550[_0x834e('0x21')]=intUtil['stripTrailingSlash'](_0x3e0550[_0x834e('0x21')]);if(_0x8bc6c6&&_0x8bc6c6['monitor_format']){logger[_0x834e('0x19')]('[QUEUE]',_0x834e('0x4a'));_0x4549ba['recordingURL']=util['format'](_0x834e('0x4b'),_0x3e0550[_0x834e('0x4c')],_0x4549ba['uniqueid'],md5(_0x4549ba['uniqueid']));}else{_0x4549ba[_0x834e('0x4d')]='';}return getConnection(_0x3e0550)[_0x834e('0x43')](function(_0x138ed2){_0x344b51=_0x138ed2;return getUser(_0x3e0550,_0x1ad7fe[_0x834e('0x4e')],_0x344b51);})[_0x834e('0x43')](function(_0x315858){_0x363675=_0x315858;logger[_0x834e('0x19')](_0x834e('0x4f'),_0x363675['id']);return getEndUser(_0x3e0550,_0x4549ba['calleridname'],_0x4549ba[_0x834e('0x50')],_0x344b51);})[_0x834e('0x43')](function(_0x5d5ac2){_0x86ad2b=_0x5d5ac2;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x86ad2b['id']);return createTicket(_0x3e0550,_0x363675,_0x86ad2b,_0x4a8b32,_0x4549ba,_0x4a8b32[_0x834e('0x51')],_0x344b51);})[_0x834e('0x43')](function(_0x5160c4){_0x396bbe=_0x5160c4;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x396bbe['id']);var _0x5a2924=util[_0x834e('0x20')](_0x834e('0x54'),_0x3e0550[_0x834e('0x21')],_['split'](_0x396bbe['id'],'x')[0x1]);logger[_0x834e('0x19')](_0x834e('0x55'),_0x834e('0x56'));emit(util[_0x834e('0x20')](_0x834e('0x57'),_0x1ad7fe[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5a2924});})[_0x834e('0x28')](function(_0x208c21){logger[_0x834e('0x27')](_0x834e('0x55'),JSON[_0x834e('0x25')](_0x208c21));});};exports[_0x834e('0x59')]=function(_0x1659c8,_0x460a7a,_0x17b8e3,_0x297cce,_0x14ed83,_0x193a15,_0x3e3467){var _0xed4081,_0x2cb233,_0x5c83eb,_0x2145cf;_0x193a15[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x193a15[_0x834e('0x21')]);_0x193a15['serverUrl']=intUtil[_0x834e('0x5a')](_0x193a15['serverUrl']);if(_0x3e3467&&_0x3e3467['recordingFormat']&&_0x3e3467[_0x834e('0x5b')]!==_0x834e('0x5c')){logger[_0x834e('0x19')](_0x834e('0x5d'),_0x834e('0x4a'));_0x460a7a[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x193a15['serverUrl'],_0x460a7a[_0x834e('0x5e')],md5(_0x460a7a['uniqueid']));}return getConnection(_0x193a15)[_0x834e('0x43')](function(_0xd35dda){_0x2145cf=_0xd35dda;return getUser(_0x193a15,_0x297cce['email'],_0x2145cf);})['then'](function(_0x4a4def){_0xed4081=_0x4a4def;logger[_0x834e('0x19')](_0x834e('0x4f'),_0xed4081['id']);return getEndUser(_0x193a15,_0x460a7a[_0x834e('0x5f')],_0x460a7a[_0x834e('0x60')],_0x2145cf);})['then'](function(_0x2b0d93){_0x2cb233=_0x2b0d93;logger[_0x834e('0x19')](_0x834e('0x61'),_0x2cb233['id']);return createTicket(_0x193a15,_0xed4081,_0x2cb233,_0x17b8e3,_0x460a7a,_0x17b8e3[_0x834e('0x51')],_0x2145cf);})[_0x834e('0x43')](function(_0x28b5c9){_0x5c83eb=_0x28b5c9;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x5c83eb['id']);var _0x5b2bf6=util[_0x834e('0x20')](_0x834e('0x54'),_0x193a15[_0x834e('0x21')],_[_0x834e('0x62')](_0x5c83eb['id'],'x')[0x1]);logger['info'](_0x834e('0x5d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x297cce[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5b2bf6});})['catch'](function(_0x2645df){logger[_0x834e('0x27')]('[OUTBOUND]',JSON[_0x834e('0x25')](_0x2645df));});};exports[_0x834e('0x63')]=function(_0x4b88e7,_0x5df169,_0x346be5,_0x2a42a3,_0x8bc7d9,_0x44c909){var _0x1d8e7,_0x493239,_0x264a6f,_0x520367;_0x44c909[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x21')]);_0x44c909['serverUrl']=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x4c')]);if(_0x8bc7d9&&_0x8bc7d9['monitor_format']){logger[_0x834e('0x19')]('['+_0x5df169[_0x834e('0x64')][_0x834e('0x65')]()+']','Recording\x20is\x20enabled!');_0x5df169[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x44c909[_0x834e('0x4c')],_0x5df169[_0x834e('0x5e')],md5(_0x5df169[_0x834e('0x5e')]));}else{_0x5df169[_0x834e('0x4d')]='';}return getConnection(_0x44c909)[_0x834e('0x43')](function(_0xd49002){_0x520367=_0xd49002;return getUser(_0x44c909,'',_0x520367);})[_0x834e('0x43')](function(_0x57d898){_0x1d8e7=_0x57d898;logger['info']('The\x20User\x20ID\x20is:',_0x1d8e7['id']);return getEndUser(_0x44c909,_0x5df169[_0x834e('0x66')],_0x5df169[_0x834e('0x50')],_0x520367);})[_0x834e('0x43')](function(_0x37fa2c){_0x493239=_0x37fa2c;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x493239['id']);return createTicket(_0x44c909,_0x1d8e7,_0x493239,_0x346be5,_0x5df169,_0x346be5['Fields'],_0x520367);})[_0x834e('0x43')](function(_0x1ad428){_0x264a6f=_0x1ad428;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')]('The\x20Ticket\x20ID\x20is:',_0x264a6f['id']);})[_0x834e('0x28')](function(_0x2b162a){logger[_0x834e('0x27')]('['+_0x5df169['lastevent'][_0x834e('0x65')]()+']',JSON[_0x834e('0x25')](_0x2b162a));});}; \ 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(_0x24fabb,_0x2a9881){var _0x264450=function(_0x40fd9f){while(--_0x40fd9f){_0x24fabb['push'](_0x24fabb['shift']());}};_0x264450(++_0x2a9881);}(_0x9c44,0x178));var _0x49c4=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x9c44[_0x465a0c];return _0x1e202e;};'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 59e8c53..836ba9f 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 _0x17b7=['ioredis','./util','../../../../config/environment','redis','defaults','localhost','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','name','getString','Subjects','Descriptions','then','Ticket\x20created!','ticket','Getting\x20agent\x20with\x20email','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','%s/search.json','filter','end-user','length','first','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','token','%s/token:%s','base64','[HTTP]','stringify','map','forEach','includes','picklist','type','nameField','toLowerCase','content','string','idField','customField','push','toString','variableName','custom_fields','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','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','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/agent/tickets/%s','replace','/api/v2','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','recordingFormat','[OUTBOUND]','recordingURL','destcalleridname','destcalleridnum','trigger:browser:url','Zendesk\x20account\x20type\x20not\x20recognized','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','md5','util'];(function(_0x3a066b,_0x3559b1){var _0x461cef=function(_0x4acb92){while(--_0x4acb92){_0x3a066b['push'](_0x3a066b['shift']());}};_0x461cef(++_0x3559b1);}(_0x17b7,0x1b5));var _0x717b=function(_0x4c6d7c,_0x144e6f){_0x4c6d7c=_0x4c6d7c-0x0;var _0x169339=_0x17b7[_0x4c6d7c];return _0x169339;};'use strict';var _=require(_0x717b('0x0'));var rp=require('request-promise');var md5=require(_0x717b('0x1'));var util=require(_0x717b('0x2'));var Redis=require(_0x717b('0x3'));var intUtil=require(_0x717b('0x4'));var config=require(_0x717b('0x5'));var logger=require('../../../../config/logger')('zendesk');config[_0x717b('0x6')]=_[_0x717b('0x7')](config['redis'],{'host':_0x717b('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x5afaf3,_0x47c0b,_0x3e9793){io['to'](_0x5afaf3)[_0x717b('0x9')](_0x47c0b,_0x3e9793);}var headers={'Content-Type':'application/json','Accept':_0x717b('0xa')};function getTicket(_0x51e862,_0x1e0733,_0x41e787,_0x5d1147,_0x4e1118){logger[_0x717b('0xb')](_0x717b('0xc'));return request({'uri':util[_0x717b('0xd')](_0x717b('0xe'),_0x51e862[_0x717b('0xf')]),'method':_0x717b('0x10'),'body':{'ticket':_[_0x717b('0x11')]({'requester_id':_0x41e787['id'],'submitter_id':_0x1e0733?_0x1e0733['id']:undefined,'assignee_id':_0x1e0733?_0x1e0733['id']:undefined,'tags':getTags(_0x5d1147['Tags'],_0x717b('0x12')),'subject':intUtil[_0x717b('0x13')](_0x5d1147[_0x717b('0x14')],_0x4e1118,'\x20'),'description':intUtil[_0x717b('0x13')](_0x5d1147[_0x717b('0x15')],_0x4e1118,'\x0a'),'comment':{'public':![],'body':intUtil[_0x717b('0x13')](_0x5d1147[_0x717b('0x15')],_0x4e1118,'\x0a')}},getCustomFields(_0x5d1147['Fields'],_0x4e1118))}})[_0x717b('0x16')](function(_0x5a6eb6){logger[_0x717b('0xb')](_0x717b('0x17'));return _0x5a6eb6[_0x717b('0x18')];});}function getUser(_0x1c7822,_0x340da7){if(intUtil['validateEmail'](_0x340da7)){logger[_0x717b('0xb')](_0x717b('0x19'),_0x340da7);return request({'uri':util[_0x717b('0xd')]('%s/search.json',_0x1c7822[_0x717b('0xf')]),'qs':{'query':util[_0x717b('0xd')](_0x717b('0x1a'),_0x340da7)}})[_0x717b('0x16')](function(_0x526aaf){if(_0x526aaf[_0x717b('0x1b')]){logger[_0x717b('0xb')](_0x717b('0x1c'));return _['find'](_0x526aaf[_0x717b('0x1d')],{'email':_0x340da7,'role':_0x717b('0x1e')});}else{logger[_0x717b('0xb')](_0x717b('0x1f'));return request({'uri':util[_0x717b('0xd')](_0x717b('0x20'),_0x1c7822[_0x717b('0xf')])})[_0x717b('0x16')](function(_0x3d896f){logger[_0x717b('0xb')](_0x717b('0x21'));return _0x3d896f[_0x717b('0x22')];});}});}else{logger[_0x717b('0xb')](_0x717b('0x1f'));return request({'uri':util['format'](_0x717b('0x20'),_0x1c7822['remoteUri'])})['then'](function(_0x1006d4){logger['info'](_0x717b('0x21'));return _0x1006d4[_0x717b('0x22')];});}}function getEndUser(_0x20e62e,_0x10ec54,_0x3f7eaa){logger[_0x717b('0xb')](_0x717b('0x23'),_0x3f7eaa);return request({'uri':util[_0x717b('0xd')](_0x717b('0x24'),_0x20e62e[_0x717b('0xf')]),'qs':{'query':util[_0x717b('0xd')]('type:user\x20role:end-user\x20phone:%s',_0x3f7eaa)}})[_0x717b('0x16')](function(_0xc952f0){var _0x2128ad;if(_0xc952f0[_0x717b('0x1d')]['length']){_0xc952f0[_0x717b('0x1d')]=_[_0x717b('0x25')](_0xc952f0[_0x717b('0x1d')],{'suspended':![],'role':_0x717b('0x26')});if(_0xc952f0['results'][_0x717b('0x27')]){_0x2128ad=_[_0x717b('0x28')](_0xc952f0[_0x717b('0x1d')]);}}if(_0x2128ad){logger[_0x717b('0xb')]('Enduser\x20found!');return _0x2128ad;}else{logger[_0x717b('0xb')](_0x717b('0x29'));return request({'uri':util['format']('%s/users.json',_0x20e62e['remoteUri']),'method':_0x717b('0x10'),'body':{'user':{'role':_0x717b('0x26'),'name':util['format'](_0x717b('0x2a'),_0x10ec54||_0x3f7eaa),'phone':_0x3f7eaa}}})[_0x717b('0x16')](function(_0x4ca19d){logger[_0x717b('0xb')](_0x717b('0x2b'));return _0x4ca19d[_0x717b('0x22')];});}});}function getAuth(_0x306bdd){var _0x48c23d;if(_0x306bdd[_0x717b('0x2c')]===_0x717b('0x2d')){_0x48c23d=util[_0x717b('0xd')](_0x717b('0x2e'),_0x306bdd[_0x717b('0x2f')],_0x306bdd[_0x717b('0x2d')]);}else if(_0x306bdd[_0x717b('0x2c')]===_0x717b('0x30')){_0x48c23d=util[_0x717b('0xd')](_0x717b('0x31'),_0x306bdd['username'],_0x306bdd[_0x717b('0x30')]);}return util[_0x717b('0xd')]('Basic\x20%s',new Buffer(_0x48c23d)['toString'](_0x717b('0x32')));}function request(_0x40af83){logger['debug'](_0x717b('0x33'),JSON[_0x717b('0x34')](_0x40af83));return rp(_[_0x717b('0x7')](_0x40af83,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x5f1858,_0x2e99c0){var _0x252b43=[];if(_0x5f1858&&_0x5f1858[_0x717b('0x27')]>0x0){_0x252b43=_[_0x717b('0x35')](_0x5f1858,_0x2e99c0);}return _0x252b43;}function getCustomFields(_0x207631,_0x284537){var _0x178b0f=[];var _0x2d7c79={'custom_fields':[]};if(_0x207631[_0x717b('0x27')]>0x0){_[_0x717b('0x36')](_0x207631,function(_0x2efc68){if(_[_0x717b('0x37')](['string',_0x717b('0x38')],_0x2efc68[_0x717b('0x39')])&&_0x2efc68[_0x717b('0x3a')]&&!_0x2efc68['customField']){_0x2d7c79[_0x2efc68['nameField'][_0x717b('0x3b')]()]=_0x2efc68[_0x717b('0x3c')]['toString']();}else if(_[_0x717b('0x37')]([_0x717b('0x3d'),_0x717b('0x38')],_0x2efc68[_0x717b('0x39')])&&_0x2efc68[_0x717b('0x3e')]&&_0x2efc68[_0x717b('0x3f')]){_0x2d7c79['custom_fields'][_0x717b('0x40')]({'id':_0x2efc68[_0x717b('0x3e')],'value':_0x2efc68[_0x717b('0x3c')][_0x717b('0x41')]()});}else if(_0x2efc68[_0x717b('0x39')]==='variable'&&_0x2efc68[_0x717b('0x42')]&&_0x2efc68[_0x717b('0x3e')]&&_0x2efc68['customField']){_0x284537[_0x2efc68[_0x717b('0x42')]]&&_0x2d7c79[_0x717b('0x43')][_0x717b('0x40')]({'id':_0x2efc68[_0x717b('0x3e')],'value':_0x284537[_0x2efc68[_0x717b('0x42')]][_0x717b('0x41')]()});}else if(_0x2efc68[_0x717b('0x39')]===_0x717b('0x44')&&_0x2efc68[_0x717b('0x45')]&&_0x2efc68[_0x717b('0x45')][_0x717b('0x12')]&&_0x2efc68[_0x717b('0x3e')]&&_0x2efc68[_0x717b('0x3f')]){_0x284537[_0x2efc68[_0x717b('0x45')][_0x717b('0x12')][_0x717b('0x3b')]()]&&_0x2d7c79['custom_fields'][_0x717b('0x40')]({'id':_0x2efc68['idField'],'value':_0x284537[_0x2efc68[_0x717b('0x45')]['name'][_0x717b('0x3b')]()][_0x717b('0x41')]()});}});}return _0x2d7c79;}exports[_0x717b('0x46')]=function(_0xcf472c,_0x30a87d,_0x25fc8a,_0x3aed29,_0xb80f9b,_0x4d6b6c){var _0x3a4d8c,_0x296cec;_0x4d6b6c['remoteUri']=intUtil['stripTrailingSlash'](_0x4d6b6c[_0x717b('0xf')]);_0x4d6b6c['serverUrl']=intUtil[_0x717b('0x47')](_0x4d6b6c[_0x717b('0x48')]);if(_0xb80f9b&&_0xb80f9b[_0x717b('0x49')]){logger[_0x717b('0xb')]('[QUEUE]',_0x717b('0x4a'));_0x30a87d['recordingURL']=util[_0x717b('0xd')](_0x717b('0x4b'),_0x4d6b6c[_0x717b('0x48')],_0x30a87d['uniqueid'],md5(_0x30a87d[_0x717b('0x4c')]));}else{_0x30a87d['recordingURL']='';}headers[_0x717b('0x4d')]=getAuth(_0x4d6b6c);return getUser(_0x4d6b6c,_0x3aed29[_0x717b('0x4e')])[_0x717b('0x16')](function(_0x4ff8e7){_0x3a4d8c=_0x4ff8e7;logger['info'](_0x717b('0x4f'),_0x3a4d8c['id']);return getEndUser(_0x4d6b6c,_0x30a87d[_0x717b('0x50')],_0x30a87d[_0x717b('0x51')]);})['then'](function(_0x42bfc3){_0x296cec=_0x42bfc3;logger['info'](_0x717b('0x52'),_0x296cec['id']);return getTicket(_0x4d6b6c,_0x3a4d8c,_0x296cec,_0x25fc8a,_0x30a87d);})[_0x717b('0x16')](function(_0x8fb1cf){if(_0x8fb1cf){logger['info'](_0x717b('0x53'),_0x8fb1cf['id']);switch(_0x4d6b6c['type']){case _0x717b('0x54'):logger[_0x717b('0xb')](_0x717b('0x55'),_0x717b('0x56'));return request({'uri':util['format'](_0x717b('0x57'),_0x4d6b6c['remoteUri'],_0x3a4d8c['id'],_0x8fb1cf['id']),'method':_0x717b('0x10')});case _0x717b('0x58'):logger[_0x717b('0xb')](_0x717b('0x55'),_0x717b('0x59'));emit(util[_0x717b('0xd')](_0x717b('0x5a'),_0x3aed29[_0x717b('0x12')]),'trigger:browser:url',{'uri':util['format'](_0x717b('0x5b'),_0x4d6b6c['remoteUri'][_0x717b('0x5c')](_0x717b('0x5d'),''),_0x8fb1cf['id'])});break;default:logger[_0x717b('0x5e')](_0x717b('0x55'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x2fdbd1){logger[_0x717b('0x5e')](_0x717b('0x5f'),util[_0x717b('0x60')](_0x2fdbd1,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x1dba6f,_0x120fdf,_0x4a9b06,_0x35a869,_0x3f5cd7,_0xaae38f,_0x27fa5b){var _0x1770e2,_0x59ce75;_0xaae38f['remoteUri']=intUtil['stripTrailingSlash'](_0xaae38f[_0x717b('0xf')]);_0xaae38f[_0x717b('0x48')]=intUtil['stripTrailingSlash'](_0xaae38f['serverUrl']);if(_0x27fa5b&&_0x27fa5b[_0x717b('0x61')]&&_0x27fa5b[_0x717b('0x61')]!=='none'){logger[_0x717b('0xb')](_0x717b('0x62'),_0x717b('0x4a'));_0x120fdf[_0x717b('0x63')]=util[_0x717b('0xd')](_0x717b('0x4b'),_0xaae38f[_0x717b('0x48')],_0x120fdf['uniqueid'],md5(_0x120fdf[_0x717b('0x4c')]));}headers[_0x717b('0x4d')]=getAuth(_0xaae38f);return getUser(_0xaae38f,_0x35a869[_0x717b('0x4e')])[_0x717b('0x16')](function(_0x278db9){_0x1770e2=_0x278db9;logger[_0x717b('0xb')](_0x717b('0x4f'),_0x1770e2['id']);return getEndUser(_0xaae38f,_0x120fdf[_0x717b('0x64')],_0x120fdf[_0x717b('0x65')]);})[_0x717b('0x16')](function(_0x58d07a){_0x59ce75=_0x58d07a;logger[_0x717b('0xb')]('The\x20Enduser\x20ID\x20is:',_0x59ce75['id']);return getTicket(_0xaae38f,_0x1770e2,_0x59ce75,_0x4a9b06,_0x120fdf);})[_0x717b('0x16')](function(_0x58504f){if(_0x58504f){logger['info'](_0x717b('0x53'),_0x58504f['id']);switch(_0xaae38f[_0x717b('0x39')]){case'integrationTab':logger[_0x717b('0xb')](_0x717b('0x62'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x717b('0xd')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0xaae38f[_0x717b('0xf')],_0x1770e2['id'],_0x58504f['id']),'method':_0x717b('0x10')});case'newTab':logger[_0x717b('0xb')](_0x717b('0x62'),_0x717b('0x59'));emit(util[_0x717b('0xd')](_0x717b('0x5a'),_0x35a869[_0x717b('0x12')]),_0x717b('0x66'),{'uri':util['format'](_0x717b('0x5b'),_0xaae38f['remoteUri'][_0x717b('0x5c')](_0x717b('0x5d'),''),_0x58504f['id'])});break;default:logger[_0x717b('0x5e')](_0x717b('0x62'),_0x717b('0x67'));}}})[_0x717b('0x68')](function(_0x4d6afe){logger['error'](_0x717b('0x69'),util[_0x717b('0x60')](_0x4d6afe,{'showHidden':!![],'depth':null}));});};exports[_0x717b('0x6a')]=function(_0xacfe92,_0x50a885,_0x11ff23,_0x2be080,_0x3de231,_0x14d6ba){var _0x36a311,_0x1eddf1;_0x14d6ba[_0x717b('0xf')]=intUtil[_0x717b('0x47')](_0x14d6ba[_0x717b('0xf')]);_0x14d6ba[_0x717b('0x48')]=intUtil[_0x717b('0x47')](_0x14d6ba[_0x717b('0x48')]);if(_0x3de231&&_0x3de231[_0x717b('0x49')]){logger['info']('['+_0x50a885[_0x717b('0x6b')]['toUpperCase']()+']',_0x717b('0x4a'));_0x50a885[_0x717b('0x63')]=util[_0x717b('0xd')](_0x717b('0x4b'),_0x14d6ba[_0x717b('0x48')],_0x50a885['uniqueid'],md5(_0x50a885[_0x717b('0x4c')]));}else{_0x50a885[_0x717b('0x63')]='';}headers[_0x717b('0x4d')]=getAuth(_0x14d6ba);return getUser(_0x14d6ba)[_0x717b('0x16')](function(_0x524308){_0x36a311=_0x524308;logger[_0x717b('0xb')](_0x717b('0x4f'),_0x36a311['id']);return getEndUser(_0x14d6ba,_0x50a885[_0x717b('0x50')],_0x50a885[_0x717b('0x51')]);})[_0x717b('0x16')](function(_0x395ddc){_0x1eddf1=_0x395ddc;logger[_0x717b('0xb')]('The\x20Enduser\x20ID\x20is:',_0x1eddf1['id']);return getTicket(_0x14d6ba,_0x36a311,_0x1eddf1,_0x11ff23,_0x50a885);})[_0x717b('0x16')](function(_0x10e3fe){if(_0x10e3fe){logger[_0x717b('0xb')]('The\x20Ticket\x20ID\x20is:',_0x10e3fe['id']);}})['catch'](function(_0xeeb1cf){logger[_0x717b('0x5e')]('['+_0x50a885[_0x717b('0x6b')][_0x717b('0x6c')]()+']'+_0x717b('0x6d'),util['inspect'](_0xeeb1cf,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x8f42=['The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','replace','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','recordingFormat','email','destcalleridname','[OUTBOUND]','%s/channels/voice/agents/%d/tickets/%d/display.json','user:%s','%s/agent/tickets/%s','/api/v2','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','toUpperCase','Recording\x20is\x20enabled!','calleridname','lodash','request-promise','md5','util','ioredis','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','POST','merge','Tags','getString','Descriptions','Fields','then','Getting\x20agent\x20with\x20email','type:user\x20role:agent\x20email:%s','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','remoteUri','user','Searching\x20enduser\x20with\x20phone','%s/search.json','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','%s:%s','username','password','token','%s/token:%s','Basic\x20%s','toString','base64','[HTTP]','stringify','GET','map','forEach','includes','string','picklist','type','nameField','toLowerCase','idField','customField','custom_fields','content','variable','variableName','push','customVariable','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:'];(function(_0x3968c9,_0x346c1b){var _0x790570=function(_0x569dab){while(--_0x569dab){_0x3968c9['push'](_0x3968c9['shift']());}};_0x790570(++_0x346c1b);}(_0x8f42,0x88));var _0x28f4=function(_0x4bb6c1,_0x4d467e){_0x4bb6c1=_0x4bb6c1-0x0;var _0x4f7ff4=_0x8f42[_0x4bb6c1];return _0x4f7ff4;};'use strict';var _=require(_0x28f4('0x0'));var rp=require(_0x28f4('0x1'));var md5=require(_0x28f4('0x2'));var util=require(_0x28f4('0x3'));var Redis=require(_0x28f4('0x4'));var intUtil=require('./util');var config=require(_0x28f4('0x5'));var logger=require(_0x28f4('0x6'))(_0x28f4('0x7'));config[_0x28f4('0x8')]=_[_0x28f4('0x9')](config[_0x28f4('0x8')],{'host':_0x28f4('0xa'),'port':0x18eb});var io=require(_0x28f4('0xb'))(new Redis(config['redis']));function emit(_0x144f20,_0x2bb15c,_0xe27cdb){io['to'](_0x144f20)[_0x28f4('0xc')](_0x2bb15c,_0xe27cdb);}var headers={'Content-Type':_0x28f4('0xd'),'Accept':_0x28f4('0xd')};function getTicket(_0x1e3be2,_0x25b0f3,_0x47eb68,_0x5f08a4,_0x29f7e4){logger[_0x28f4('0xe')](_0x28f4('0xf'));return request({'uri':util[_0x28f4('0x10')](_0x28f4('0x11'),_0x1e3be2['remoteUri']),'method':_0x28f4('0x12'),'body':{'ticket':_[_0x28f4('0x13')]({'requester_id':_0x47eb68['id'],'submitter_id':_0x25b0f3?_0x25b0f3['id']:undefined,'assignee_id':_0x25b0f3?_0x25b0f3['id']:undefined,'tags':getTags(_0x5f08a4[_0x28f4('0x14')],'name'),'subject':intUtil[_0x28f4('0x15')](_0x5f08a4['Subjects'],_0x29f7e4,'\x20'),'description':intUtil['getString'](_0x5f08a4[_0x28f4('0x16')],_0x29f7e4,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x5f08a4[_0x28f4('0x16')],_0x29f7e4,'\x0a')}},getCustomFields(_0x5f08a4[_0x28f4('0x17')],_0x29f7e4))}})[_0x28f4('0x18')](function(_0x47b582){logger[_0x28f4('0xe')]('Ticket\x20created!');return _0x47b582['ticket'];});}function getUser(_0x4ab77f,_0x2a8a1d){if(intUtil['validateEmail'](_0x2a8a1d)){logger[_0x28f4('0xe')](_0x28f4('0x19'),_0x2a8a1d);return request({'uri':util[_0x28f4('0x10')]('%s/search.json',_0x4ab77f['remoteUri']),'qs':{'query':util[_0x28f4('0x10')](_0x28f4('0x1a'),_0x2a8a1d)}})[_0x28f4('0x18')](function(_0x4f54b3){if(_0x4f54b3['count']){logger[_0x28f4('0xe')](_0x28f4('0x1b'));return _[_0x28f4('0x1c')](_0x4f54b3[_0x28f4('0x1d')],{'email':_0x2a8a1d,'role':_0x28f4('0x1e')});}else{logger['info'](_0x28f4('0x1f'));return request({'uri':util[_0x28f4('0x10')]('%s/users/me.json',_0x4ab77f['remoteUri'])})[_0x28f4('0x18')](function(_0x5063c1){logger[_0x28f4('0xe')](_0x28f4('0x20'));return _0x5063c1['user'];});}});}else{logger[_0x28f4('0xe')](_0x28f4('0x1f'));return request({'uri':util[_0x28f4('0x10')]('%s/users/me.json',_0x4ab77f[_0x28f4('0x21')])})[_0x28f4('0x18')](function(_0x561ac9){logger[_0x28f4('0xe')](_0x28f4('0x20'));return _0x561ac9[_0x28f4('0x22')];});}}function getEndUser(_0x144720,_0x1f9882,_0x228a9a){logger[_0x28f4('0xe')](_0x28f4('0x23'),_0x228a9a);return request({'uri':util['format'](_0x28f4('0x24'),_0x144720[_0x28f4('0x21')]),'qs':{'query':util['format'](_0x28f4('0x25'),_0x228a9a)}})[_0x28f4('0x18')](function(_0x8bb675){var _0x27034a;if(_0x8bb675[_0x28f4('0x1d')][_0x28f4('0x26')]){_0x8bb675[_0x28f4('0x1d')]=_[_0x28f4('0x27')](_0x8bb675['results'],{'suspended':![],'role':_0x28f4('0x28')});if(_0x8bb675[_0x28f4('0x1d')][_0x28f4('0x26')]){_0x27034a=_[_0x28f4('0x29')](_0x8bb675[_0x28f4('0x1d')]);}}if(_0x27034a){logger['info'](_0x28f4('0x2a'));return _0x27034a;}else{logger[_0x28f4('0xe')](_0x28f4('0x2b'));return request({'uri':util[_0x28f4('0x10')](_0x28f4('0x2c'),_0x144720[_0x28f4('0x21')]),'method':_0x28f4('0x12'),'body':{'user':{'role':_0x28f4('0x28'),'name':util['format'](_0x28f4('0x2d'),_0x1f9882||_0x228a9a),'phone':_0x228a9a}}})['then'](function(_0x1d075c){logger[_0x28f4('0xe')](_0x28f4('0x2e'));return _0x1d075c[_0x28f4('0x22')];});}});}function getAuth(_0xf6d63a){var _0x405dfc;if(_0xf6d63a[_0x28f4('0x2f')]==='password'){_0x405dfc=util[_0x28f4('0x10')](_0x28f4('0x30'),_0xf6d63a[_0x28f4('0x31')],_0xf6d63a[_0x28f4('0x32')]);}else if(_0xf6d63a['authType']===_0x28f4('0x33')){_0x405dfc=util[_0x28f4('0x10')](_0x28f4('0x34'),_0xf6d63a[_0x28f4('0x31')],_0xf6d63a['token']);}return util[_0x28f4('0x10')](_0x28f4('0x35'),new Buffer(_0x405dfc)[_0x28f4('0x36')](_0x28f4('0x37')));}function request(_0x5673c9){logger['debug'](_0x28f4('0x38'),JSON[_0x28f4('0x39')](_0x5673c9));return rp(_[_0x28f4('0x9')](_0x5673c9,{'method':_0x28f4('0x3a'),'headers':headers,'json':!![]}));}function getTags(_0x5e87fa,_0x12d353){var _0x518b11=[];if(_0x5e87fa&&_0x5e87fa['length']>0x0){_0x518b11=_[_0x28f4('0x3b')](_0x5e87fa,_0x12d353);}return _0x518b11;}function getCustomFields(_0xed7ee0,_0x3612fd){var _0x31c545=[];var _0x4c9fc6={'custom_fields':[]};if(_0xed7ee0['length']>0x0){_[_0x28f4('0x3c')](_0xed7ee0,function(_0x1d3885){if(_[_0x28f4('0x3d')]([_0x28f4('0x3e'),_0x28f4('0x3f')],_0x1d3885[_0x28f4('0x40')])&&_0x1d3885[_0x28f4('0x41')]&&!_0x1d3885['customField']){_0x4c9fc6[_0x1d3885[_0x28f4('0x41')][_0x28f4('0x42')]()]=_0x1d3885['content'][_0x28f4('0x36')]();}else if(_['includes'](['string',_0x28f4('0x3f')],_0x1d3885[_0x28f4('0x40')])&&_0x1d3885[_0x28f4('0x43')]&&_0x1d3885[_0x28f4('0x44')]){_0x4c9fc6[_0x28f4('0x45')]['push']({'id':_0x1d3885[_0x28f4('0x43')],'value':_0x1d3885[_0x28f4('0x46')][_0x28f4('0x36')]()});}else if(_0x1d3885[_0x28f4('0x40')]===_0x28f4('0x47')&&_0x1d3885[_0x28f4('0x48')]&&_0x1d3885['idField']&&_0x1d3885[_0x28f4('0x44')]){_0x3612fd[_0x1d3885[_0x28f4('0x48')]]&&_0x4c9fc6[_0x28f4('0x45')][_0x28f4('0x49')]({'id':_0x1d3885[_0x28f4('0x43')],'value':_0x3612fd[_0x1d3885[_0x28f4('0x48')]][_0x28f4('0x36')]()});}else if(_0x1d3885[_0x28f4('0x40')]===_0x28f4('0x4a')&&_0x1d3885['Variable']&&_0x1d3885['Variable']['name']&&_0x1d3885[_0x28f4('0x43')]&&_0x1d3885[_0x28f4('0x44')]){_0x3612fd[_0x1d3885[_0x28f4('0x4b')][_0x28f4('0x4c')]['toLowerCase']()]&&_0x4c9fc6['custom_fields'][_0x28f4('0x49')]({'id':_0x1d3885[_0x28f4('0x43')],'value':_0x3612fd[_0x1d3885[_0x28f4('0x4b')][_0x28f4('0x4c')][_0x28f4('0x42')]()][_0x28f4('0x36')]()});}});}return _0x4c9fc6;}exports[_0x28f4('0x4d')]=function(_0x4df94a,_0x17e642,_0x36be78,_0x1ce675,_0xfbc90a,_0x4f8d65){var _0x21ee8f,_0x2f6ff6;_0x4f8d65[_0x28f4('0x21')]=intUtil[_0x28f4('0x4e')](_0x4f8d65[_0x28f4('0x21')]);_0x4f8d65[_0x28f4('0x4f')]=intUtil[_0x28f4('0x4e')](_0x4f8d65['serverUrl']);if(_0xfbc90a&&_0xfbc90a[_0x28f4('0x50')]){logger[_0x28f4('0xe')]('[QUEUE]','Recording\x20is\x20enabled!');_0x17e642[_0x28f4('0x51')]=util[_0x28f4('0x10')](_0x28f4('0x52'),_0x4f8d65[_0x28f4('0x4f')],_0x17e642[_0x28f4('0x53')],md5(_0x17e642[_0x28f4('0x53')]));}else{_0x17e642['recordingURL']='';}headers[_0x28f4('0x54')]=getAuth(_0x4f8d65);return getUser(_0x4f8d65,_0x1ce675['email'])[_0x28f4('0x18')](function(_0x1f26ca){_0x21ee8f=_0x1f26ca;logger[_0x28f4('0xe')](_0x28f4('0x55'),_0x21ee8f['id']);return getEndUser(_0x4f8d65,_0x17e642['calleridname'],_0x17e642[_0x28f4('0x56')]);})[_0x28f4('0x18')](function(_0x315250){_0x2f6ff6=_0x315250;logger[_0x28f4('0xe')](_0x28f4('0x57'),_0x2f6ff6['id']);return getTicket(_0x4f8d65,_0x21ee8f,_0x2f6ff6,_0x36be78,_0x17e642);})[_0x28f4('0x18')](function(_0x9435a3){if(_0x9435a3){logger[_0x28f4('0xe')](_0x28f4('0x58'),_0x9435a3['id']);switch(_0x4f8d65[_0x28f4('0x40')]){case _0x28f4('0x59'):logger[_0x28f4('0xe')](_0x28f4('0x5a'),_0x28f4('0x5b'));return request({'uri':util[_0x28f4('0x10')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x4f8d65[_0x28f4('0x21')],_0x21ee8f['id'],_0x9435a3['id']),'method':_0x28f4('0x12')});case'newTab':logger[_0x28f4('0xe')](_0x28f4('0x5a'),_0x28f4('0x5c'));emit(util[_0x28f4('0x10')]('user:%s',_0x1ce675[_0x28f4('0x4c')]),_0x28f4('0x5d'),{'uri':util[_0x28f4('0x10')]('%s/agent/tickets/%s',_0x4f8d65[_0x28f4('0x21')][_0x28f4('0x5e')]('/api/v2',''),_0x9435a3['id'])});break;default:logger[_0x28f4('0x5f')]('[QUEUE]',_0x28f4('0x60'));}}})[_0x28f4('0x61')](function(_0x502df4){logger[_0x28f4('0x5f')](_0x28f4('0x62'),util[_0x28f4('0x63')](_0x502df4,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x557801,_0x5737f0,_0xc8121d,_0x25a6da,_0x4eca6f,_0x3ee78a,_0x1db7d5){var _0x3418fe,_0x2aff97;_0x3ee78a[_0x28f4('0x21')]=intUtil[_0x28f4('0x4e')](_0x3ee78a[_0x28f4('0x21')]);_0x3ee78a[_0x28f4('0x4f')]=intUtil[_0x28f4('0x4e')](_0x3ee78a[_0x28f4('0x4f')]);if(_0x1db7d5&&_0x1db7d5[_0x28f4('0x64')]&&_0x1db7d5[_0x28f4('0x64')]!=='none'){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x5737f0[_0x28f4('0x51')]=util[_0x28f4('0x10')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3ee78a['serverUrl'],_0x5737f0[_0x28f4('0x53')],md5(_0x5737f0['uniqueid']));}headers[_0x28f4('0x54')]=getAuth(_0x3ee78a);return getUser(_0x3ee78a,_0x25a6da[_0x28f4('0x65')])[_0x28f4('0x18')](function(_0x1150cb){_0x3418fe=_0x1150cb;logger[_0x28f4('0xe')]('The\x20User\x20ID\x20is:',_0x3418fe['id']);return getEndUser(_0x3ee78a,_0x5737f0[_0x28f4('0x66')],_0x5737f0['destcalleridnum']);})['then'](function(_0x339449){_0x2aff97=_0x339449;logger['info'](_0x28f4('0x57'),_0x2aff97['id']);return getTicket(_0x3ee78a,_0x3418fe,_0x2aff97,_0xc8121d,_0x5737f0);})[_0x28f4('0x18')](function(_0x1185d0){if(_0x1185d0){logger['info'](_0x28f4('0x58'),_0x1185d0['id']);switch(_0x3ee78a[_0x28f4('0x40')]){case'integrationTab':logger[_0x28f4('0xe')](_0x28f4('0x67'),_0x28f4('0x5b'));return request({'uri':util[_0x28f4('0x10')](_0x28f4('0x68'),_0x3ee78a[_0x28f4('0x21')],_0x3418fe['id'],_0x1185d0['id']),'method':_0x28f4('0x12')});case'newTab':logger[_0x28f4('0xe')](_0x28f4('0x67'),_0x28f4('0x5c'));emit(util['format'](_0x28f4('0x69'),_0x25a6da[_0x28f4('0x4c')]),'trigger:browser:url',{'uri':util['format'](_0x28f4('0x6a'),_0x3ee78a[_0x28f4('0x21')][_0x28f4('0x5e')](_0x28f4('0x6b'),''),_0x1185d0['id'])});break;default:logger[_0x28f4('0x5f')]('[OUTBOUND]',_0x28f4('0x60'));}}})[_0x28f4('0x61')](function(_0x9dde71){logger['error'](_0x28f4('0x6c'),util['inspect'](_0x9dde71,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x449a1f,_0x19941c,_0x4c33aa,_0x274a5c,_0x793c4,_0x5da67a){var _0x57acec,_0x102e8c;_0x5da67a[_0x28f4('0x21')]=intUtil[_0x28f4('0x4e')](_0x5da67a['remoteUri']);_0x5da67a['serverUrl']=intUtil[_0x28f4('0x4e')](_0x5da67a[_0x28f4('0x4f')]);if(_0x793c4&&_0x793c4[_0x28f4('0x50')]){logger[_0x28f4('0xe')]('['+_0x19941c['lastevent'][_0x28f4('0x6d')]()+']',_0x28f4('0x6e'));_0x19941c['recordingURL']=util['format'](_0x28f4('0x52'),_0x5da67a[_0x28f4('0x4f')],_0x19941c[_0x28f4('0x53')],md5(_0x19941c[_0x28f4('0x53')]));}else{_0x19941c[_0x28f4('0x51')]='';}headers[_0x28f4('0x54')]=getAuth(_0x5da67a);return getUser(_0x5da67a)[_0x28f4('0x18')](function(_0x3b99e0){_0x57acec=_0x3b99e0;logger[_0x28f4('0xe')](_0x28f4('0x55'),_0x57acec['id']);return getEndUser(_0x5da67a,_0x19941c[_0x28f4('0x6f')],_0x19941c[_0x28f4('0x56')]);})[_0x28f4('0x18')](function(_0x5d955f){_0x102e8c=_0x5d955f;logger[_0x28f4('0xe')](_0x28f4('0x57'),_0x102e8c['id']);return getTicket(_0x5da67a,_0x57acec,_0x102e8c,_0x4c33aa,_0x19941c);})[_0x28f4('0x18')](function(_0x3a2405){if(_0x3a2405){logger[_0x28f4('0xe')]('The\x20Ticket\x20ID\x20is:',_0x3a2405['id']);}})[_0x28f4('0x61')](function(_0x4372c0){logger[_0x28f4('0x5f')]('['+_0x19941c['lastevent']['toUpperCase']()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x4372c0,{'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 cf6793e..5b3c99c 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 _0x96f3=['Agent\x20found!','findIndex','profile','Administrator','user','Using\x20the\x20admin\x20account!','error','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','role','first_name','last_name','code','SUCCESS','details','moduleCreate','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','lead','Creating\x20new\x20call...','administrator','Subject','getString','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','talktime','Call_Duration','mm:ss','endtime','utc','YYYY-MM-DDTHH:mm:ss','diff','lastevent','called','Call_Result','Called','connect','rejected','timeout','Timeout','Call_Start_Time','outbound','starttime','agentcalledAt','Call_Type','merge','Call\x20created!','err','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','recordingURL','zoho.eu','email','calleridname','Inbound','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','recordingFormat','none','[OUTBOUND]','com','destcalleridnum','Outbound','The\x20Call\x20ID\x20is:','unmanaged','toUpperCase','The\x20User\x20ID\x20is:','calleridnum','lodash','request-promise','md5','util','./util','moment','../../../../config/environment','../../../../config/logger','zoho','redis','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','length','forEach','includes','string','picklist','idField','content','toString','type','variableName','Variable','name','toLowerCase','split','isNil','access_token','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','refreshToken','clientId','clientSecret','refresh_token','then','expires_in','seconds','catch','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','Zoho-oauthtoken\x20','isArrayLikeObject','users'];(function(_0x352de7,_0x42d665){var _0x76cff2=function(_0x4e9f7c){while(--_0x4e9f7c){_0x352de7['push'](_0x352de7['shift']());}};_0x76cff2(++_0x42d665);}(_0x96f3,0xf7));var _0x396f=function(_0x1da852,_0x5ba0f3){_0x1da852=_0x1da852-0x0;var _0x3e62ec=_0x96f3[_0x1da852];return _0x3e62ec;};'use strict';var _=require(_0x396f('0x0'));var rp=require(_0x396f('0x1'));var md5=require(_0x396f('0x2'));var util=require(_0x396f('0x3'));var intUtil=require(_0x396f('0x4'));var moment=require(_0x396f('0x5'));var Redis=require('ioredis');var BPromise=require('bluebird');var config=require(_0x396f('0x6'));var logger=require(_0x396f('0x7'))(_0x396f('0x8'));config['redis']=_['defaults'](config[_0x396f('0x9')],{'host':_0x396f('0xa'),'port':0x18eb});var io=require(_0x396f('0xb'))(new Redis(config[_0x396f('0x9')]));function emit(_0xe3854d,_0x4030f3,_0x49dc5b){io['to'](_0xe3854d)[_0x396f('0xc')](_0x4030f3,_0x49dc5b);}function request(_0x5d3a7e){logger[_0x396f('0xd')](_0x396f('0xe'),JSON[_0x396f('0xf')](_0x5d3a7e));return rp(_0x5d3a7e);}function getCustomFields(_0x47ac1c,_0x326e3b){var _0x5e591d={};if(_0x47ac1c[_0x396f('0x10')]>0x0){_[_0x396f('0x11')](_0x47ac1c,function(_0x131469){if(_[_0x396f('0x12')]([_0x396f('0x13'),_0x396f('0x14')],_0x131469['type'])&&_0x131469[_0x396f('0x15')]){_0x5e591d[_0x131469[_0x396f('0x15')]]=_0x131469[_0x396f('0x16')][_0x396f('0x17')]();}else if(_0x131469[_0x396f('0x18')]==='variable'&&_0x131469[_0x396f('0x19')]&&_0x131469[_0x396f('0x15')]&&_0x326e3b[_0x131469[_0x396f('0x19')]]){_0x5e591d[_0x131469[_0x396f('0x15')]]=_0x326e3b[_0x131469[_0x396f('0x19')]][_0x396f('0x17')]();}else if(_0x131469[_0x396f('0x18')]==='customVariable'&&_0x131469[_0x396f('0x1a')]&&_0x131469[_0x396f('0x1a')][_0x396f('0x1b')]&&_0x131469[_0x396f('0x15')]&&_0x326e3b[_0x131469['Variable']['name']['toLowerCase']()]){_0x5e591d[_0x131469[_0x396f('0x15')]]=_0x326e3b[_0x131469[_0x396f('0x1a')][_0x396f('0x1b')][_0x396f('0x1c')]()][_0x396f('0x17')]();}});}return _0x5e591d;}function getName(_0xe3e337){if(_0xe3e337['indexOf']('\x20')>0x0){var _0x20dc40=_0xe3e337[_0x396f('0x1d')](/ (.+)/);if(_0x20dc40[0x1]){return _0x20dc40;}}return[_0xe3e337,_0xe3e337];}var accountsTokens={};function getAccessToken(_0x1fb76c){return new Promise(function(_0x1e3b48,_0x3127f1){if(!_['isNil'](accountsTokens[_0x1fb76c['id']])&&!_[_0x396f('0x1e')](accountsTokens[_0x1fb76c['id']][_0x396f('0x1f')])){if(moment()['isBefore'](accountsTokens[_0x1fb76c['id']]['expires_in'])){_0x1e3b48(accountsTokens[_0x1fb76c['id']][_0x396f('0x1f')]);}}var _0x54e181;switch(_0x1fb76c[_0x396f('0x20')]){case'US':_0x54e181=_0x396f('0x21');break;case'AU':_0x54e181=_0x396f('0x22');break;case'EU':_0x54e181=_0x396f('0x23');break;case'IN':_0x54e181=_0x396f('0x24');break;case'CN':_0x54e181=_0x396f('0x25');break;default:_0x54e181='https://accounts.zoho.eu';break;}var _0x1f2b0c={'method':_0x396f('0x26'),'uri':_0x54e181+_0x396f('0x27'),'qs':{'refresh_token':_0x1fb76c[_0x396f('0x28')],'client_id':_0x1fb76c[_0x396f('0x29')],'client_secret':_0x1fb76c[_0x396f('0x2a')],'grant_type':_0x396f('0x2b')},'json':!![]};return rp(_0x1f2b0c)[_0x396f('0x2c')](function(_0x3e0d3c){accountsTokens[_0x1fb76c['id']]={'access_token':_0x3e0d3c[_0x396f('0x1f')],'expires_in':moment()['add'](_0x3e0d3c[_0x396f('0x2d')],_0x396f('0x2e'))};_0x1e3b48(_0x3e0d3c[_0x396f('0x1f')]);})[_0x396f('0x2f')](function(_0x2034a9){logger['error']('Failing\x20creating\x20the\x20access_token',_0x2034a9[_0x396f('0x30')]);_0x3127f1(_0x2034a9);});});}function getUser(_0x1702cd,_0xff2c66,_0x2d60fb,_0xdd5f4){logger[_0x396f('0x31')](_0x396f('0x32'));return request({'method':_0x396f('0x33'),'uri':util[_0x396f('0x34')](_0x396f('0x35'),_0xff2c66),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0x396f('0x36')+_0x1702cd},'json':!![]})[_0x396f('0x2c')](function(_0x2b66ab){if(_0x2b66ab['users']){var _0x411fbd=-0x1;if(_[_0x396f('0x37')](_0x2b66ab[_0x396f('0x38')])){if(!_['isNil'](_0xdd5f4)){_0x411fbd=_['findIndex'](_0x2b66ab[_0x396f('0x38')],function(_0x4b3b1f){return _0x4b3b1f['email']===_0xdd5f4;});}if(_0x411fbd>=0x0){logger[_0x396f('0x31')](_0x396f('0x39'));}else{logger['info']('Using\x20the\x20admin\x20account!');_0x411fbd=_[_0x396f('0x3a')](_0x2b66ab[_0x396f('0x38')],function(_0x2d4d92){return _0x2d4d92[_0x396f('0x3b')]['name']===_0x396f('0x3c');});}return _0x2b66ab[_0x396f('0x38')][_0x411fbd];}else{if(_0x2b66ab[_0x396f('0x3d')][_0x396f('0x3b')][_0x396f('0x1b')]===_0x396f('0x3c')){logger[_0x396f('0x31')](_0x396f('0x3e'));user=_0x2b66ab[_0x396f('0x3d')];return user;}else{logger[_0x396f('0x3f')](_0x396f('0x40'),JSON[_0x396f('0xf')](_0x2b66ab));throw new Error(_0x396f('0x41')+JSON['stringify'](_0x2b66ab));}}}else{logger[_0x396f('0x3f')](_0x396f('0x40'),JSON[_0x396f('0xf')](_0x2b66ab));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON['stringify'](_0x2b66ab));}})[_0x396f('0x2f')](function(_0x202616){console[_0x396f('0x3f')](_0x202616);});}function getZohoUser(_0x550bcf,_0x54c67f){return new BPromise(function(_0x262732,_0x3d2ef3){request(_0x550bcf)[_0x396f('0x2c')](function(_0x3f815d){var _0x4e3a32=null;if(_0x3f815d){_0x4e3a32=_0x3f815d[_0x396f('0x42')][0x0];_0x4e3a32[_0x396f('0x43')]=_0x54c67f;}_0x262732(_0x4e3a32);})['catch'](function(_0xde6077){_0x3d2ef3(_0xde6077);});});}function createEndUser(_0x8caac7,_0x2c0a9e,_0x58dab9,_0x31981e,_0x163175,_0x22985e){var _0x58dab9=getName(_0x58dab9);return request({'method':_0x396f('0x26'),'uri':_0x396f('0x44')+_0x2c0a9e+_0x396f('0x45')+_[_0x396f('0x46')](_0x22985e['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x58dab9[0x1],'First_Name':_0x58dab9[0x0],'Phone':_0x31981e,'Owner':{'name':!_[_0x396f('0x1e')](_0x163175['role'][_0x396f('0x1b')])?_0x163175[_0x396f('0x47')][_0x396f('0x1b')]:!_[_0x396f('0x1e')](_0x163175[_0x396f('0x48')])?_0x163175[_0x396f('0x48')]+'\x20'+_0x163175['last_name']:_0x163175[_0x396f('0x49')],'id':_0x163175['id']}}]},'headers':{'Authorization':_0x396f('0x36')+_0x8caac7},'json':!![]})['then'](function(_0x4a0f1c){if(_0x4a0f1c&&_0x4a0f1c[_0x396f('0x42')][0x0][_0x396f('0x4a')]===_0x396f('0x4b')){var _0x14ed92=_0x4a0f1c[_0x396f('0x42')][0x0][_0x396f('0x4c')];_0x14ed92[_0x396f('0x43')]=_[_0x396f('0x46')](_0x22985e[_0x396f('0x4d')])+'s';return _0x14ed92;}logger[_0x396f('0x3f')](_0x396f('0x40'),JSON[_0x396f('0xf')](data));throw new Error(_0x396f('0x4e')+JSON[_0x396f('0xf')](data));})[_0x396f('0x2f')](function(_0x11e256){console[_0x396f('0x4f')](_0x396f('0x50'),_0x11e256);});}function getEndUser(_0x495428,_0xb445a2,_0x4f9e3c,_0x41618e,_0x27f6e5,_0x456be0,_0x7289e6){var _0x38eeb1={'method':_0x396f('0x33'),'uri':'','headers':{'Authorization':_0x396f('0x36')+_0x495428},'json':!![]};switch(_0x7289e6[_0x396f('0x51')]){case _0x396f('0x52'):_0x38eeb1[_0x396f('0x53')]=_0x396f('0x44')+_0xb445a2+_0x396f('0x54')+_0x27f6e5+'))';return getZohoUser(_0x38eeb1,_0x396f('0x55'))['then'](function(_0x5d0c3f){if(_0x5d0c3f)return _0x5d0c3f;_0x38eeb1['uri']=_0x396f('0x44')+_0xb445a2+_0x396f('0x56')+_0x27f6e5+'))';return getZohoUser(_0x38eeb1,_0x396f('0x57'))['then'](function(_0x2c9ea5){if(_0x2c9ea5)return _0x2c9ea5;if(_0x7289e6[_0x396f('0x4d')]!=_0x396f('0x58')){return createEndUser(_0x495428,_0xb445a2,_0x41618e,_0x27f6e5,_0x456be0,_0x7289e6);}else{return{};}});});break;case'contact':_0x38eeb1['uri']=_0x396f('0x44')+_0xb445a2+_0x396f('0x54')+_0x27f6e5+'))';return getZohoUser(_0x38eeb1,_0x396f('0x55'))[_0x396f('0x2c')](function(_0x798ac2){if(_0x798ac2)return _0x798ac2;if(_0x7289e6[_0x396f('0x4d')]!='nothing'){return createEndUser(_0x495428,_0xb445a2,_0x41618e,_0x27f6e5,_0x456be0,_0x7289e6);}else{return{};}});break;case _0x396f('0x59'):_0x38eeb1[_0x396f('0x53')]=_0x396f('0x44')+_0xb445a2+_0x396f('0x56')+_0x27f6e5+'))';return getZohoUser(_0x38eeb1,_0x396f('0x57'))['then'](function(_0x4439cb){if(_0x4439cb)return _0x4439cb;if(_0x7289e6['moduleCreate']!=_0x396f('0x58')){return createEndUser(_0x495428,_0xb445a2,_0x41618e,_0x27f6e5,_0x456be0,_0x7289e6);}else{return{};}});break;}}function getCall(_0x58e684,_0x4a526d,_0x35f0dd,_0x5c5aa9,_0x7e06ff,_0x50e197,_0x4f903f,_0x1cc332){logger[_0x396f('0x31')](_0x396f('0x5a'));var _0x289909={};_0x289909['Owner']={'name':!_['isNil'](_0x5c5aa9[_0x396f('0x47')][_0x396f('0x1b')])&&!_[_0x396f('0x1e')](_0x5c5aa9['profile']['name'])&&_0x5c5aa9[_0x396f('0x3b')]['name']===_0x396f('0x5b')?_0x5c5aa9[_0x396f('0x47')][_0x396f('0x1b')]:!_['isNil'](_0x5c5aa9['first_name'])?_0x5c5aa9[_0x396f('0x48')]+'\x20'+_0x5c5aa9[_0x396f('0x49')]:_0x5c5aa9[_0x396f('0x49')],'id':_0x5c5aa9['id']};_0x289909[_0x396f('0x5c')]=intUtil[_0x396f('0x5d')](_0x50e197['Subjects'],_0x4f903f,'\x20');_0x289909[_0x396f('0x5e')]=intUtil[_0x396f('0x5d')](_0x50e197[_0x396f('0x5f')],_0x4f903f,'\x0a');if(_0x7e06ff['enduserType']===_0x396f('0x55')){_0x289909[_0x396f('0x60')]={'name':!_[_0x396f('0x1e')](_0x7e06ff[_0x396f('0x61')])?_0x7e06ff[_0x396f('0x61')]:!_[_0x396f('0x1e')](_0x7e06ff[_0x396f('0x62')])?_0x7e06ff[_0x396f('0x62')]+'\x20'+_0x7e06ff[_0x396f('0x63')]:_0x7e06ff['Last_Name'],'id':_0x7e06ff['id']};}if(_0x7e06ff[_0x396f('0x43')]===_0x396f('0x57')){_0x289909[_0x396f('0x64')]={'name':!_[_0x396f('0x1e')](_0x7e06ff[_0x396f('0x61')])?_0x7e06ff[_0x396f('0x61')]:!_['isNil'](_0x7e06ff['First_Name'])?_0x7e06ff[_0x396f('0x62')]+'\x20'+_0x7e06ff[_0x396f('0x63')]:_0x7e06ff[_0x396f('0x63')],'id':_0x7e06ff['id']};_0x289909['$se_module']=_['startCase'](_0x7e06ff[_0x396f('0x43')]);}if(_0x4f903f[_0x396f('0x65')]){_0x289909[_0x396f('0x66')]=moment['utc'](parseInt(_0x4f903f[_0x396f('0x65')])*0x3e8)[_0x396f('0x34')](_0x396f('0x67'));}else if(_0x4f903f['answertime']&&_0x4f903f[_0x396f('0x68')]){_0x289909[_0x396f('0x66')]=moment[_0x396f('0x69')](moment(_0x4f903f['endtime'],_0x396f('0x6a'))[_0x396f('0x6b')](moment(_0x4f903f['starttime'],_0x396f('0x6a'))))[_0x396f('0x34')](_0x396f('0x67'));}switch(_0x4f903f[_0x396f('0x6c')]){case _0x396f('0x6d'):_0x289909[_0x396f('0x6e')]=_0x396f('0x6f');break;case'complete':case _0x396f('0x70'):_0x289909['Call_Result']='Answered';break;case _0x396f('0x71'):_0x289909[_0x396f('0x6e')]='Rejected';break;case'abandoned':_0x289909[_0x396f('0x6e')]='Abandoned';break;case _0x396f('0x72'):_0x289909[_0x396f('0x6e')]=_0x396f('0x73');default:}_0x289909[_0x396f('0x74')]=(_0x1cc332===_0x396f('0x75')?moment(_0x4f903f[_0x396f('0x76')])[_0x396f('0x34')](_0x396f('0x6a')):moment(_0x4f903f[_0x396f('0x77')])[_0x396f('0x34')](_0x396f('0x6a')))||moment()[_0x396f('0x34')]('YYYY-MM-DDTHH:mm:ss');_0x289909[_0x396f('0x78')]=_0x1cc332||'Inbound';_0x289909=_[_0x396f('0x79')](_0x289909,getCustomFields(_0x50e197['Fields'],_0x4f903f));return request({'method':_0x396f('0x26'),'uri':_0x396f('0x44')+_0x4a526d+'/crm/v2/Calls','headers':{'Authorization':_0x396f('0x36')+_0x58e684},'body':{'data':[_0x289909]},'json':!![]})[_0x396f('0x2c')](function(_0x5e99ff){if(_0x5e99ff&&_0x5e99ff[_0x396f('0x42')][0x0]['code']==='SUCCESS'){logger[_0x396f('0x31')](_0x396f('0x7a'));return{'id':_0x5e99ff[_0x396f('0x42')][0x0][_0x396f('0x4c')]['id']};}})[_0x396f('0x2f')](function(_0xf898fe){logger['info'](_0x396f('0x7b'),_0xf898fe[_0x396f('0x30')]);console['log'](_0x396f('0x7b'),_0xf898fe);});}exports['queue']=function(_0xd4e0da,_0x578e79,_0x3a1156,_0xf85c8d,_0x49adc2,_0x42d3a8){var _0x36cb71,_0x20892e,_0x170b1d;_0x42d3a8[_0x396f('0x7c')]=intUtil[_0x396f('0x7d')](_0x42d3a8[_0x396f('0x7c')]);_0x42d3a8['serverUrl']=intUtil['stripTrailingSlash'](_0x42d3a8[_0x396f('0x7e')]);if(_0x49adc2&&_0x49adc2[_0x396f('0x7f')]){logger[_0x396f('0x31')](_0x396f('0x80'),_0x396f('0x81'));_0x578e79['recordingURL']=_0x42d3a8[_0x396f('0x7e')]+_0x396f('0x82')+_0x578e79[_0x396f('0x83')]+_0x396f('0x84')+md5(_0x578e79[_0x396f('0x83')]);}else{_0x578e79[_0x396f('0x85')]='';}var _0x359376=_0x42d3a8[_0x396f('0x7c')]===_0x396f('0x86')?'eu':'com';return getAccessToken(_0x42d3a8)['then'](function(_0x1c3b22){_0x170b1d=_0x1c3b22;return getUser(_0x170b1d,_0x359376,_0x42d3a8,_0xf85c8d[_0x396f('0x87')]);})[_0x396f('0x2c')](function(_0x477372){_0x36cb71=_0x477372;logger[_0x396f('0x31')]('The\x20User\x20ID\x20is:',_0x36cb71['id']);return getEndUser(_0x170b1d,_0x359376,_0x42d3a8,_0x578e79[_0x396f('0x88')],_0x578e79['calleridnum'],_0x36cb71,_0x3a1156);})['then'](function(_0xd60583){_0x20892e=_0xd60583;return getCall(_0x170b1d,_0x359376,_0x42d3a8,_0x36cb71,_0x20892e,_0x3a1156,_0x578e79,_0x396f('0x89'));})[_0x396f('0x2c')](function(_0x1ac47f){if(_0x1ac47f){logger['info']('The\x20Call\x20ID\x20is:',_0x1ac47f['id']);logger['info'](_0x396f('0x80'),_0x396f('0x8a'));emit(util[_0x396f('0x34')](_0x396f('0x8b'),_0xf85c8d[_0x396f('0x1b')]),_0x396f('0x8c'),{'uri':'https://crm.'+_0x42d3a8[_0x396f('0x7c')]+'/crm/EntityInfo.do?module=Calls&id='+_0x1ac47f['id']});}})[_0x396f('0x2f')](function(_0x4e165c){logger[_0x396f('0x3f')](_0x396f('0x80'),JSON['stringify'](_0x4e165c));});};exports[_0x396f('0x75')]=function(_0x1cbf3d,_0x4b045f,_0x482c81,_0x34665b,_0x104131,_0x37e8b8,_0x540b01){var _0x386693,_0x4eeb33,_0x1cb0ad;_0x37e8b8[_0x396f('0x7c')]=intUtil['stripTrailingSlash'](_0x37e8b8[_0x396f('0x7c')]);_0x37e8b8[_0x396f('0x7e')]=intUtil['stripTrailingSlash'](_0x37e8b8[_0x396f('0x7e')]);if(_0x540b01&&_0x540b01[_0x396f('0x8d')]&&_0x540b01[_0x396f('0x8d')]!==_0x396f('0x8e')){logger[_0x396f('0x31')](_0x396f('0x8f'),_0x396f('0x81'));_0x4b045f[_0x396f('0x85')]=_0x37e8b8[_0x396f('0x7e')]+_0x396f('0x82')+_0x4b045f['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x4b045f[_0x396f('0x83')]);}var _0x2709a8=_0x37e8b8[_0x396f('0x7c')]===_0x396f('0x86')?'eu':_0x396f('0x90');return getAccessToken(_0x37e8b8)[_0x396f('0x2c')](function(_0x7b9aec){_0x1cb0ad=_0x7b9aec;return getUser(_0x1cb0ad,_0x2709a8,_0x37e8b8,_0x34665b['email']);})[_0x396f('0x2c')](function(_0x1a0786){_0x386693=_0x1a0786;logger['info']('The\x20User\x20ID\x20is:',_0x386693['id']);return getEndUser(_0x1cb0ad,_0x2709a8,_0x37e8b8,_0x4b045f['destcalleridname'],_0x4b045f[_0x396f('0x91')],_0x386693,_0x482c81);})['then'](function(_0x2a6f9b){_0x4eeb33=_0x2a6f9b;return getCall(_0x1cb0ad,_0x2709a8,_0x37e8b8,_0x386693,_0x4eeb33,_0x482c81,_0x4b045f,_0x396f('0x92'));})['then'](function(_0x350e09){if(_0x350e09){logger[_0x396f('0x31')](_0x396f('0x93'),_0x350e09['id']);logger[_0x396f('0x31')](_0x396f('0x8f'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x396f('0x34')](_0x396f('0x8b'),_0x34665b[_0x396f('0x1b')]),'trigger:browser:url',{'uri':'https://crm.'+_0x37e8b8[_0x396f('0x7c')]+'/crm/EntityInfo.do?module=Calls&id='+_0x350e09['id']});}})[_0x396f('0x2f')](function(_0x535c5d){logger['error'](_0x396f('0x8f'),JSON[_0x396f('0xf')](_0x535c5d));});};exports[_0x396f('0x94')]=function(_0x291dca,_0x2e936e,_0x4d13cf,_0x23396d,_0x311c2e,_0x5e79a7){var _0x3e70ee,_0x1960e2,_0x19922a;_0x5e79a7[_0x396f('0x7c')]=intUtil[_0x396f('0x7d')](_0x5e79a7['host']);_0x5e79a7[_0x396f('0x7e')]=intUtil['stripTrailingSlash'](_0x5e79a7['serverUrl']);if(_0x311c2e&&_0x311c2e[_0x396f('0x7f')]){logger[_0x396f('0x31')]('['+_0x2e936e['lastevent'][_0x396f('0x95')]()+']',_0x396f('0x81'));_0x2e936e[_0x396f('0x85')]=_0x5e79a7[_0x396f('0x7e')]+'/api/voice/recordings/'+_0x2e936e[_0x396f('0x83')]+'/downloads?type=uniqueid&token='+md5(_0x2e936e['uniqueid']);}else{_0x2e936e[_0x396f('0x85')]='';}var _0x45bc87=_0x5e79a7[_0x396f('0x7c')]===_0x396f('0x86')?'eu':_0x396f('0x90');return getAccessToken(_0x5e79a7)[_0x396f('0x2c')](function(_0x196b52){_0x19922a=_0x196b52;return getUser(_0x19922a,_0x45bc87,_0x5e79a7);})[_0x396f('0x2c')](function(_0x46f14b){_0x3e70ee=_0x46f14b;logger[_0x396f('0x31')](_0x396f('0x96'),_0x3e70ee['id']);return getEndUser(_0x19922a,_0x45bc87,_0x5e79a7,_0x2e936e[_0x396f('0x88')],_0x2e936e[_0x396f('0x97')],_0x3e70ee,_0x4d13cf);})['then'](function(_0x2aa557){_0x1960e2=_0x2aa557;return getCall(_0x19922a,_0x45bc87,_0x5e79a7,_0x3e70ee,_0x1960e2,_0x4d13cf,_0x2e936e,_0x396f('0x89'));})[_0x396f('0x2c')](function(_0x4c8c92){if(_0x4c8c92){logger[_0x396f('0x31')]('The\x20Call\x20ID\x20is:',_0x4c8c92['id']);}})[_0x396f('0x2f')](function(_0x3de080){logger['error']('['+_0x2e936e['lastevent'][_0x396f('0x95')]()+']',JSON[_0x396f('0xf')](_0x3de080));});}; \ No newline at end of file +var _0x26ab=['isNil','isBefore','expires_in','access_token','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','refreshToken','clientId','clientSecret','then','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','users','isArrayLikeObject','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','https://www.zohoapis.','/crm/v2/','startCase','role','first_name','last_name','Zoho-oauthtoken\x20','data','code','SUCCESS','enduserType','moduleCreate','Error:\x20','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','Owner','Subject','Subjects','Description','getString','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','talktime','Call_Duration','utc','mm:ss','answertime','endtime','diff','starttime','format','lastevent','called','Call_Result','Called','complete','connect','Answered','rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','agentcalledAt','YYYY-MM-DDTHH:mm:ss','Call_Type','Inbound','merge','Fields','Call\x20created!','details','err','queue','host','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','/downloads?type=uniqueid&token=','uniqueid','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','toUpperCase','calleridnum','request-promise','md5','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','localhost','emit','debug','[HTTP]','stringify','length','includes','string','idField','type','variable','variableName','toString','Variable','name','toLowerCase','indexOf'];(function(_0x5b39f3,_0x1bc28a){var _0xfec1fa=function(_0x42f1dd){while(--_0x42f1dd){_0x5b39f3['push'](_0x5b39f3['shift']());}};_0xfec1fa(++_0x1bc28a);}(_0x26ab,0x117));var _0xb26a=function(_0x20b966,_0x1cf3ad){_0x20b966=_0x20b966-0x0;var _0x14b006=_0x26ab[_0x20b966];return _0x14b006;};'use strict';var _=require('lodash');var rp=require(_0xb26a('0x0'));var md5=require(_0xb26a('0x1'));var util=require('util');var intUtil=require(_0xb26a('0x2'));var moment=require(_0xb26a('0x3'));var Redis=require(_0xb26a('0x4'));var BPromise=require(_0xb26a('0x5'));var config=require(_0xb26a('0x6'));var logger=require(_0xb26a('0x7'))(_0xb26a('0x8'));config[_0xb26a('0x9')]=_['defaults'](config[_0xb26a('0x9')],{'host':_0xb26a('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb26a('0x9')]));function emit(_0x470a67,_0x1bacc3,_0xb56f4c){io['to'](_0x470a67)[_0xb26a('0xb')](_0x1bacc3,_0xb56f4c);}function request(_0x173db8){logger[_0xb26a('0xc')](_0xb26a('0xd'),JSON[_0xb26a('0xe')](_0x173db8));return rp(_0x173db8);}function getCustomFields(_0x5c0d33,_0x14bd4c){var _0x18e00d={};if(_0x5c0d33[_0xb26a('0xf')]>0x0){_['forEach'](_0x5c0d33,function(_0x3f97f2){if(_[_0xb26a('0x10')]([_0xb26a('0x11'),'picklist'],_0x3f97f2['type'])&&_0x3f97f2[_0xb26a('0x12')]){_0x18e00d[_0x3f97f2['idField']]=_0x3f97f2['content']['toString']();}else if(_0x3f97f2[_0xb26a('0x13')]===_0xb26a('0x14')&&_0x3f97f2['variableName']&&_0x3f97f2['idField']&&_0x14bd4c[_0x3f97f2[_0xb26a('0x15')]]){_0x18e00d[_0x3f97f2[_0xb26a('0x12')]]=_0x14bd4c[_0x3f97f2[_0xb26a('0x15')]][_0xb26a('0x16')]();}else if(_0x3f97f2['type']==='customVariable'&&_0x3f97f2[_0xb26a('0x17')]&&_0x3f97f2['Variable']['name']&&_0x3f97f2['idField']&&_0x14bd4c[_0x3f97f2[_0xb26a('0x17')][_0xb26a('0x18')][_0xb26a('0x19')]()]){_0x18e00d[_0x3f97f2[_0xb26a('0x12')]]=_0x14bd4c[_0x3f97f2[_0xb26a('0x17')][_0xb26a('0x18')][_0xb26a('0x19')]()]['toString']();}});}return _0x18e00d;}function getName(_0x219c06){if(_0x219c06[_0xb26a('0x1a')]('\x20')>0x0){var _0x466728=_0x219c06['split'](/ (.+)/);if(_0x466728[0x1]){return _0x466728;}}return[_0x219c06,_0x219c06];}var accountsTokens={};function getAccessToken(_0x10a1e1){return new Promise(function(_0x204d7e,_0x415753){if(!_[_0xb26a('0x1b')](accountsTokens[_0x10a1e1['id']])&&!_[_0xb26a('0x1b')](accountsTokens[_0x10a1e1['id']]['access_token'])){if(moment()[_0xb26a('0x1c')](accountsTokens[_0x10a1e1['id']][_0xb26a('0x1d')])){_0x204d7e(accountsTokens[_0x10a1e1['id']][_0xb26a('0x1e')]);}}var _0x30434a;switch(_0x10a1e1[_0xb26a('0x1f')]){case'US':_0x30434a=_0xb26a('0x20');break;case'AU':_0x30434a=_0xb26a('0x21');break;case'EU':_0x30434a=_0xb26a('0x22');break;case'IN':_0x30434a=_0xb26a('0x23');break;case'CN':_0x30434a=_0xb26a('0x24');break;default:_0x30434a=_0xb26a('0x22');break;}var _0x305358={'method':_0xb26a('0x25'),'uri':_0x30434a+_0xb26a('0x26'),'qs':{'refresh_token':_0x10a1e1[_0xb26a('0x27')],'client_id':_0x10a1e1[_0xb26a('0x28')],'client_secret':_0x10a1e1[_0xb26a('0x29')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x305358)[_0xb26a('0x2a')](function(_0x3ee3d3){accountsTokens[_0x10a1e1['id']]={'access_token':_0x3ee3d3['access_token'],'expires_in':moment()['add'](_0x3ee3d3[_0xb26a('0x1d')],_0xb26a('0x2b'))};_0x204d7e(_0x3ee3d3[_0xb26a('0x1e')]);})[_0xb26a('0x2c')](function(_0x8c2aa4){logger[_0xb26a('0x2d')](_0xb26a('0x2e'),_0x8c2aa4[_0xb26a('0x2f')]);_0x415753(_0x8c2aa4);});});}function getUser(_0x2ec380,_0x2b265e,_0x1ac251,_0x35e2dc){logger[_0xb26a('0x30')](_0xb26a('0x31'));return request({'method':_0xb26a('0x32'),'uri':util['format']('https://www.zohoapis.%s/crm/v2/users',_0x2b265e),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x2ec380},'json':!![]})[_0xb26a('0x2a')](function(_0x2e369c){if(_0x2e369c[_0xb26a('0x33')]){var _0x2e636a=-0x1;if(_[_0xb26a('0x34')](_0x2e369c[_0xb26a('0x33')])){if(!_[_0xb26a('0x1b')](_0x35e2dc)){_0x2e636a=_[_0xb26a('0x35')](_0x2e369c[_0xb26a('0x33')],function(_0x2b02b1){return _0x2b02b1[_0xb26a('0x36')]===_0x35e2dc;});}if(_0x2e636a>=0x0){logger[_0xb26a('0x30')](_0xb26a('0x37'));}else{logger[_0xb26a('0x30')](_0xb26a('0x38'));_0x2e636a=_[_0xb26a('0x35')](_0x2e369c['users'],function(_0x52a220){return _0x52a220[_0xb26a('0x39')][_0xb26a('0x18')]===_0xb26a('0x3a');});}return _0x2e369c[_0xb26a('0x33')][_0x2e636a];}else{if(_0x2e369c[_0xb26a('0x3b')]['profile'][_0xb26a('0x18')]===_0xb26a('0x3a')){logger['info'](_0xb26a('0x38'));user=_0x2e369c[_0xb26a('0x3b')];return user;}else{logger[_0xb26a('0x2d')](_0xb26a('0x3c'),JSON[_0xb26a('0xe')](_0x2e369c));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0xb26a('0xe')](_0x2e369c));}}}else{logger[_0xb26a('0x2d')](_0xb26a('0x3c'),JSON[_0xb26a('0xe')](_0x2e369c));throw new Error(_0xb26a('0x3d')+JSON[_0xb26a('0xe')](_0x2e369c));}})[_0xb26a('0x2c')](function(_0x2dcf53){console[_0xb26a('0x2d')](_0x2dcf53);});}function getZohoUser(_0x4607c6,_0x364c18){return new BPromise(function(_0x2052e3,_0x53b06f){request(_0x4607c6)[_0xb26a('0x2a')](function(_0x151f2f){var _0x1398d7=null;if(_0x151f2f){_0x1398d7=_0x151f2f['data'][0x0];_0x1398d7['enduserType']=_0x364c18;}_0x2052e3(_0x1398d7);})[_0xb26a('0x2c')](function(_0xf36050){_0x53b06f(_0xf36050);});});}function createEndUser(_0x340b14,_0x440756,_0x3de91c,_0x499234,_0x43b9da,_0x19264d){var _0x3de91c=getName(_0x3de91c);return request({'method':_0xb26a('0x25'),'uri':_0xb26a('0x3e')+_0x440756+_0xb26a('0x3f')+_[_0xb26a('0x40')](_0x19264d['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x3de91c[0x1],'First_Name':_0x3de91c[0x0],'Phone':_0x499234,'Owner':{'name':!_[_0xb26a('0x1b')](_0x43b9da[_0xb26a('0x41')][_0xb26a('0x18')])?_0x43b9da[_0xb26a('0x41')]['name']:!_[_0xb26a('0x1b')](_0x43b9da[_0xb26a('0x42')])?_0x43b9da[_0xb26a('0x42')]+'\x20'+_0x43b9da[_0xb26a('0x43')]:_0x43b9da['last_name'],'id':_0x43b9da['id']}}]},'headers':{'Authorization':_0xb26a('0x44')+_0x340b14},'json':!![]})[_0xb26a('0x2a')](function(_0x7b2142){if(_0x7b2142&&_0x7b2142[_0xb26a('0x45')][0x0][_0xb26a('0x46')]===_0xb26a('0x47')){var _0x42268d=_0x7b2142[_0xb26a('0x45')][0x0]['details'];_0x42268d[_0xb26a('0x48')]=_[_0xb26a('0x40')](_0x19264d[_0xb26a('0x49')])+'s';return _0x42268d;}logger[_0xb26a('0x2d')](_0xb26a('0x3c'),JSON[_0xb26a('0xe')](data));throw new Error(_0xb26a('0x4a')+JSON[_0xb26a('0xe')](data));})[_0xb26a('0x2c')](function(_0x4cae54){console['log']('CREATE\x20ERROR',_0x4cae54);});}function getEndUser(_0x3edc83,_0x3f0bbd,_0x5c6c0b,_0xcf4773,_0xdca172,_0xef5b40,_0x5911d6){var _0x5b9369={'method':_0xb26a('0x32'),'uri':'','headers':{'Authorization':_0xb26a('0x44')+_0x3edc83},'json':!![]};switch(_0x5911d6['moduleSearch']){case'contact_lead':_0x5b9369[_0xb26a('0x4b')]='https://www.zohoapis.'+_0x3f0bbd+_0xb26a('0x4c')+_0xdca172+'))';return getZohoUser(_0x5b9369,_0xb26a('0x4d'))[_0xb26a('0x2a')](function(_0x5c0f4e){if(_0x5c0f4e)return _0x5c0f4e;_0x5b9369[_0xb26a('0x4b')]=_0xb26a('0x3e')+_0x3f0bbd+_0xb26a('0x4e')+_0xdca172+'))';return getZohoUser(_0x5b9369,_0xb26a('0x4f'))['then'](function(_0x1b1638){if(_0x1b1638)return _0x1b1638;if(_0x5911d6[_0xb26a('0x49')]!=_0xb26a('0x50')){return createEndUser(_0x3edc83,_0x3f0bbd,_0xcf4773,_0xdca172,_0xef5b40,_0x5911d6);}else{return{};}});});break;case _0xb26a('0x51'):_0x5b9369['uri']='https://www.zohoapis.'+_0x3f0bbd+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0xdca172+'))';return getZohoUser(_0x5b9369,_0xb26a('0x4d'))[_0xb26a('0x2a')](function(_0xc716a7){if(_0xc716a7)return _0xc716a7;if(_0x5911d6[_0xb26a('0x49')]!=_0xb26a('0x50')){return createEndUser(_0x3edc83,_0x3f0bbd,_0xcf4773,_0xdca172,_0xef5b40,_0x5911d6);}else{return{};}});break;case'lead':_0x5b9369['uri']=_0xb26a('0x3e')+_0x3f0bbd+_0xb26a('0x4e')+_0xdca172+'))';return getZohoUser(_0x5b9369,_0xb26a('0x4f'))[_0xb26a('0x2a')](function(_0x1c6973){if(_0x1c6973)return _0x1c6973;if(_0x5911d6[_0xb26a('0x49')]!=_0xb26a('0x50')){return createEndUser(_0x3edc83,_0x3f0bbd,_0xcf4773,_0xdca172,_0xef5b40,_0x5911d6);}else{return{};}});break;}}function getCall(_0x41fc41,_0x1d5f4b,_0x5e197f,_0x45824f,_0x1feee4,_0x1a6f09,_0x5b1ca7,_0x13e7fc){logger[_0xb26a('0x30')]('Creating\x20new\x20call...');var _0x3f43ec={};_0x3f43ec[_0xb26a('0x52')]={'name':!_[_0xb26a('0x1b')](_0x45824f[_0xb26a('0x41')]['name'])&&!_[_0xb26a('0x1b')](_0x45824f[_0xb26a('0x39')][_0xb26a('0x18')])&&_0x45824f[_0xb26a('0x39')]['name']==='administrator'?_0x45824f[_0xb26a('0x41')][_0xb26a('0x18')]:!_[_0xb26a('0x1b')](_0x45824f[_0xb26a('0x42')])?_0x45824f[_0xb26a('0x42')]+'\x20'+_0x45824f['last_name']:_0x45824f[_0xb26a('0x43')],'id':_0x45824f['id']};_0x3f43ec[_0xb26a('0x53')]=intUtil['getString'](_0x1a6f09[_0xb26a('0x54')],_0x5b1ca7,'\x20');_0x3f43ec[_0xb26a('0x55')]=intUtil[_0xb26a('0x56')](_0x1a6f09[_0xb26a('0x57')],_0x5b1ca7,'\x0a');if(_0x1feee4[_0xb26a('0x48')]===_0xb26a('0x4d')){_0x3f43ec[_0xb26a('0x58')]={'name':!_['isNil'](_0x1feee4[_0xb26a('0x59')])?_0x1feee4[_0xb26a('0x59')]:!_[_0xb26a('0x1b')](_0x1feee4[_0xb26a('0x5a')])?_0x1feee4[_0xb26a('0x5a')]+'\x20'+_0x1feee4[_0xb26a('0x5b')]:_0x1feee4[_0xb26a('0x5b')],'id':_0x1feee4['id']};}if(_0x1feee4[_0xb26a('0x48')]===_0xb26a('0x4f')){_0x3f43ec[_0xb26a('0x5c')]={'name':!_[_0xb26a('0x1b')](_0x1feee4['Full_Name'])?_0x1feee4['Full_Name']:!_[_0xb26a('0x1b')](_0x1feee4[_0xb26a('0x5a')])?_0x1feee4['First_Name']+'\x20'+_0x1feee4['Last_Name']:_0x1feee4[_0xb26a('0x5b')],'id':_0x1feee4['id']};_0x3f43ec['$se_module']=_[_0xb26a('0x40')](_0x1feee4[_0xb26a('0x48')]);}if(_0x5b1ca7[_0xb26a('0x5d')]){_0x3f43ec[_0xb26a('0x5e')]=moment[_0xb26a('0x5f')](parseInt(_0x5b1ca7[_0xb26a('0x5d')])*0x3e8)['format'](_0xb26a('0x60'));}else if(_0x5b1ca7[_0xb26a('0x61')]&&_0x5b1ca7[_0xb26a('0x62')]){_0x3f43ec['Call_Duration']=moment[_0xb26a('0x5f')](moment(_0x5b1ca7[_0xb26a('0x62')],'YYYY-MM-DDTHH:mm:ss')[_0xb26a('0x63')](moment(_0x5b1ca7[_0xb26a('0x64')],'YYYY-MM-DDTHH:mm:ss')))[_0xb26a('0x65')](_0xb26a('0x60'));}switch(_0x5b1ca7[_0xb26a('0x66')]){case _0xb26a('0x67'):_0x3f43ec[_0xb26a('0x68')]=_0xb26a('0x69');break;case _0xb26a('0x6a'):case _0xb26a('0x6b'):_0x3f43ec[_0xb26a('0x68')]=_0xb26a('0x6c');break;case _0xb26a('0x6d'):_0x3f43ec[_0xb26a('0x68')]='Rejected';break;case _0xb26a('0x6e'):_0x3f43ec['Call_Result']=_0xb26a('0x6f');break;case _0xb26a('0x70'):_0x3f43ec[_0xb26a('0x68')]=_0xb26a('0x71');default:}_0x3f43ec[_0xb26a('0x72')]=(_0x13e7fc==='outbound'?moment(_0x5b1ca7[_0xb26a('0x64')])[_0xb26a('0x65')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x5b1ca7[_0xb26a('0x73')])[_0xb26a('0x65')](_0xb26a('0x74')))||moment()[_0xb26a('0x65')](_0xb26a('0x74'));_0x3f43ec[_0xb26a('0x75')]=_0x13e7fc||_0xb26a('0x76');_0x3f43ec=_[_0xb26a('0x77')](_0x3f43ec,getCustomFields(_0x1a6f09[_0xb26a('0x78')],_0x5b1ca7));return request({'method':'POST','uri':'https://www.zohoapis.'+_0x1d5f4b+'/crm/v2/Calls','headers':{'Authorization':_0xb26a('0x44')+_0x41fc41},'body':{'data':[_0x3f43ec]},'json':!![]})['then'](function(_0x389558){if(_0x389558&&_0x389558[_0xb26a('0x45')][0x0]['code']===_0xb26a('0x47')){logger[_0xb26a('0x30')](_0xb26a('0x79'));return{'id':_0x389558['data'][0x0][_0xb26a('0x7a')]['id']};}})[_0xb26a('0x2c')](function(_0x4a9582){logger[_0xb26a('0x30')](_0xb26a('0x7b'),_0x4a9582['stack']);console['log'](_0xb26a('0x7b'),_0x4a9582);});}exports[_0xb26a('0x7c')]=function(_0x164d44,_0x379829,_0xf724a1,_0x53ecfe,_0x1b44ac,_0x534c15){var _0xa2c03f,_0x4c26f2,_0x20196b;_0x534c15[_0xb26a('0x7d')]=intUtil[_0xb26a('0x7e')](_0x534c15[_0xb26a('0x7d')]);_0x534c15['serverUrl']=intUtil[_0xb26a('0x7e')](_0x534c15[_0xb26a('0x7f')]);if(_0x1b44ac&&_0x1b44ac['monitor_format']){logger[_0xb26a('0x30')](_0xb26a('0x80'),_0xb26a('0x81'));_0x379829[_0xb26a('0x82')]=_0x534c15[_0xb26a('0x7f')]+_0xb26a('0x83')+_0x379829['uniqueid']+_0xb26a('0x84')+md5(_0x379829[_0xb26a('0x85')]);}else{_0x379829['recordingURL']='';}var _0x6723a2=_0x534c15[_0xb26a('0x7d')]===_0xb26a('0x86')?'eu':_0xb26a('0x87');return getAccessToken(_0x534c15)[_0xb26a('0x2a')](function(_0x17aa65){_0x20196b=_0x17aa65;return getUser(_0x20196b,_0x6723a2,_0x534c15,_0x53ecfe[_0xb26a('0x36')]);})[_0xb26a('0x2a')](function(_0x5c9b66){_0xa2c03f=_0x5c9b66;logger[_0xb26a('0x30')](_0xb26a('0x88'),_0xa2c03f['id']);return getEndUser(_0x20196b,_0x6723a2,_0x534c15,_0x379829[_0xb26a('0x89')],_0x379829['calleridnum'],_0xa2c03f,_0xf724a1);})[_0xb26a('0x2a')](function(_0x44e76d){_0x4c26f2=_0x44e76d;return getCall(_0x20196b,_0x6723a2,_0x534c15,_0xa2c03f,_0x4c26f2,_0xf724a1,_0x379829,_0xb26a('0x76'));})[_0xb26a('0x2a')](function(_0x9a28d2){if(_0x9a28d2){logger[_0xb26a('0x30')](_0xb26a('0x8a'),_0x9a28d2['id']);logger[_0xb26a('0x30')](_0xb26a('0x80'),_0xb26a('0x8b'));emit(util[_0xb26a('0x65')](_0xb26a('0x8c'),_0x53ecfe['name']),_0xb26a('0x8d'),{'uri':_0xb26a('0x8e')+_0x534c15['host']+_0xb26a('0x8f')+_0x9a28d2['id']});}})['catch'](function(_0x3f1497){logger[_0xb26a('0x2d')](_0xb26a('0x80'),JSON[_0xb26a('0xe')](_0x3f1497));});};exports[_0xb26a('0x90')]=function(_0x16c491,_0x1440d6,_0x1a7122,_0x4a8709,_0x302c7d,_0xf66d06,_0x2e4c03){var _0x1baf68,_0x2351fe,_0x3e2db1;_0xf66d06[_0xb26a('0x7d')]=intUtil[_0xb26a('0x7e')](_0xf66d06[_0xb26a('0x7d')]);_0xf66d06[_0xb26a('0x7f')]=intUtil[_0xb26a('0x7e')](_0xf66d06[_0xb26a('0x7f')]);if(_0x2e4c03&&_0x2e4c03[_0xb26a('0x91')]&&_0x2e4c03[_0xb26a('0x91')]!==_0xb26a('0x92')){logger['info'](_0xb26a('0x93'),_0xb26a('0x81'));_0x1440d6['recordingURL']=_0xf66d06[_0xb26a('0x7f')]+_0xb26a('0x83')+_0x1440d6[_0xb26a('0x85')]+_0xb26a('0x84')+md5(_0x1440d6[_0xb26a('0x85')]);}var _0x47ad72=_0xf66d06[_0xb26a('0x7d')]==='zoho.eu'?'eu':'com';return getAccessToken(_0xf66d06)[_0xb26a('0x2a')](function(_0x164ebb){_0x3e2db1=_0x164ebb;return getUser(_0x3e2db1,_0x47ad72,_0xf66d06,_0x4a8709[_0xb26a('0x36')]);})[_0xb26a('0x2a')](function(_0x4bef74){_0x1baf68=_0x4bef74;logger[_0xb26a('0x30')](_0xb26a('0x88'),_0x1baf68['id']);return getEndUser(_0x3e2db1,_0x47ad72,_0xf66d06,_0x1440d6[_0xb26a('0x94')],_0x1440d6[_0xb26a('0x95')],_0x1baf68,_0x1a7122);})[_0xb26a('0x2a')](function(_0x346c63){_0x2351fe=_0x346c63;return getCall(_0x3e2db1,_0x47ad72,_0xf66d06,_0x1baf68,_0x2351fe,_0x1a7122,_0x1440d6,_0xb26a('0x96'));})['then'](function(_0x582772){if(_0x582772){logger['info'](_0xb26a('0x8a'),_0x582772['id']);logger[_0xb26a('0x30')](_0xb26a('0x93'),_0xb26a('0x8b'));emit(util[_0xb26a('0x65')](_0xb26a('0x8c'),_0x4a8709['name']),_0xb26a('0x8d'),{'uri':_0xb26a('0x8e')+_0xf66d06[_0xb26a('0x7d')]+_0xb26a('0x8f')+_0x582772['id']});}})[_0xb26a('0x2c')](function(_0xfeeb21){logger[_0xb26a('0x2d')](_0xb26a('0x93'),JSON[_0xb26a('0xe')](_0xfeeb21));});};exports['unmanaged']=function(_0x131b9d,_0x5e82da,_0x2c0dc7,_0x424ab7,_0x1dd3dd,_0x257cc2){var _0xe693fe,_0x4c1602,_0x3d0339;_0x257cc2['host']=intUtil[_0xb26a('0x7e')](_0x257cc2['host']);_0x257cc2[_0xb26a('0x7f')]=intUtil['stripTrailingSlash'](_0x257cc2[_0xb26a('0x7f')]);if(_0x1dd3dd&&_0x1dd3dd['monitor_format']){logger['info']('['+_0x5e82da[_0xb26a('0x66')][_0xb26a('0x97')]()+']',_0xb26a('0x81'));_0x5e82da[_0xb26a('0x82')]=_0x257cc2[_0xb26a('0x7f')]+_0xb26a('0x83')+_0x5e82da[_0xb26a('0x85')]+_0xb26a('0x84')+md5(_0x5e82da[_0xb26a('0x85')]);}else{_0x5e82da[_0xb26a('0x82')]='';}var _0x3938dd=_0x257cc2[_0xb26a('0x7d')]===_0xb26a('0x86')?'eu':_0xb26a('0x87');return getAccessToken(_0x257cc2)['then'](function(_0x4a4b51){_0x3d0339=_0x4a4b51;return getUser(_0x3d0339,_0x3938dd,_0x257cc2);})[_0xb26a('0x2a')](function(_0x2e46c2){_0xe693fe=_0x2e46c2;logger[_0xb26a('0x30')](_0xb26a('0x88'),_0xe693fe['id']);return getEndUser(_0x3d0339,_0x3938dd,_0x257cc2,_0x5e82da[_0xb26a('0x89')],_0x5e82da[_0xb26a('0x98')],_0xe693fe,_0x2c0dc7);})[_0xb26a('0x2a')](function(_0x90d13b){_0x4c1602=_0x90d13b;return getCall(_0x3d0339,_0x3938dd,_0x257cc2,_0xe693fe,_0x4c1602,_0x2c0dc7,_0x5e82da,_0xb26a('0x76'));})[_0xb26a('0x2a')](function(_0x21b863){if(_0x21b863){logger[_0xb26a('0x30')]('The\x20Call\x20ID\x20is:',_0x21b863['id']);}})['catch'](function(_0x43c30d){logger[_0xb26a('0x2d')]('['+_0x5e82da[_0xb26a('0x66')][_0xb26a('0x97')]()+']',JSON[_0xb26a('0xe')](_0x43c30d));});}; \ 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 a83016a..afca697 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 _0xf45f=['format','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','mustache','../../../../config/logger','trigger','exec','data2','render','data3','error'];(function(_0x36921f,_0x3d8888){var _0x2a20bb=function(_0x3cada9){while(--_0x3cada9){_0x36921f['push'](_0x36921f['shift']());}};_0x2a20bb(++_0x3d8888);}(_0xf45f,0xab));var _0xff45=function(_0x2cd3e4,_0x45197e){_0x2cd3e4=_0x2cd3e4-0x0;var _0x2bc9b9=_0xf45f[_0x2cd3e4];return _0x2bc9b9;};'use strict';var util=require(_0xff45('0x0'));var sh=require('shelljs');var Mustache=require(_0xff45('0x1'));var logger=require(_0xff45('0x2'))(_0xff45('0x3'));exports[_0xff45('0x4')]=function(_0x48b7d5,_0xf5ca0e){var _0x333b75=_0x48b7d5['data2']?_0x48b7d5[_0xff45('0x5')]:'Script';var _0x2ea084=_0x48b7d5['data3']?Mustache[_0xff45('0x6')](_0x48b7d5[_0xff45('0x7')],_0xf5ca0e):_0xf5ca0e;sh['exec'](_0x2ea084,function(_0x43d8c2,_0x4a8193,_0x401560){if(_0x43d8c2!==0x0){logger[_0xff45('0x8')](util[_0xff45('0x9')]('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x333b75,_0x2ea084,_0x43d8c2,_0x401560));}else{logger[_0xff45('0xa')](util[_0xff45('0x9')](_0xff45('0xb'),_0x333b75,_0x2ea084,_0x4a8193));}});}; \ No newline at end of file +var _0x9c99=['error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','util','shelljs','mustache','../../../../config/logger','trigger','data2','Script','render','data3','exec'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x9c99,0x1d2));var _0x99c9=function(_0x119d25,_0x588c8){_0x119d25=_0x119d25-0x0;var _0x39cf30=_0x9c99[_0x119d25];return _0x39cf30;};'use strict';var util=require(_0x99c9('0x0'));var sh=require(_0x99c9('0x1'));var Mustache=require(_0x99c9('0x2'));var logger=require(_0x99c9('0x3'))(_0x99c9('0x4'));exports['exec']=function(_0x1ba21a,_0x1d1b56){var _0x534a77=_0x1ba21a['data2']?_0x1ba21a[_0x99c9('0x5')]:_0x99c9('0x6');var _0x532f78=_0x1ba21a['data3']?Mustache[_0x99c9('0x7')](_0x1ba21a[_0x99c9('0x8')],_0x1d1b56):_0x1d1b56;sh[_0x99c9('0x9')](_0x532f78,function(_0x2d687a,_0xc52618,_0xc06b99){if(_0x2d687a!==0x0){logger[_0x99c9('0xa')](util[_0x99c9('0xb')](_0x99c9('0xc'),_0x534a77,_0x532f78,_0x2d687a,_0xc06b99));}else{logger[_0x99c9('0xd')](util[_0x99c9('0xb')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x534a77,_0x532f78,_0xc52618));}});}; \ 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 e86b096..41bb64e 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 _0x0636=['data7','parse','body','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','format','%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','request-promise','util','mustache','exec','toUpperCase','render','data2','data5','number','headers','data6','stack','data1','GET','POST','PUT'];(function(_0x2a3609,_0x453c7b){var _0x236673=function(_0x5369c6){while(--_0x5369c6){_0x2a3609['push'](_0x2a3609['shift']());}};_0x236673(++_0x453c7b);}(_0x0636,0xd0));var _0x6063=function(_0x488764,_0xcb6b5b){_0x488764=_0x488764-0x0;var _0x52956d=_0x0636[_0x488764];return _0x52956d;};'use strict';var rp=require(_0x6063('0x0'));var util=require(_0x6063('0x1'));var _=require('lodash');var Mustache=require(_0x6063('0x2'));var logger=require('../../../../config/logger')('trigger');exports[_0x6063('0x3')]=function(_0x2d6b6c,_0x1cb4fa){var _0x42cadc,_0x5dccd8;var _0x3e7cb7={'method':_0x2d6b6c['data1'][_0x6063('0x4')](),'uri':Mustache[_0x6063('0x5')](_0x2d6b6c[_0x6063('0x6')],_0x1cb4fa),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x2d6b6c[_0x6063('0x7')])===_0x6063('0x8')&&parseInt(_0x2d6b6c[_0x6063('0x7')])>=0x1&&parseInt(_0x2d6b6c[_0x6063('0x7')])<=0xa?parseInt(_0x2d6b6c[_0x6063('0x7')])*0x3e8:0x5*0x3e8};try{_0x3e7cb7[_0x6063('0x9')]=_0x2d6b6c[_0x6063('0xa')]?JSON['parse'](Mustache['render'](_0x2d6b6c[_0x6063('0xa')],_0x1cb4fa)):{};}catch(_0x1276ec){logger['error'](_0x1276ec[_0x6063('0xb')]);}switch(_0x2d6b6c[_0x6063('0xc')][_0x6063('0x4')]()){case _0x6063('0xd'):case'DELETE':_0x42cadc=null;_0x3e7cb7['qs']=_0x1cb4fa;break;case _0x6063('0xe'):case _0x6063('0xf'):if(_0x2d6b6c[_0x6063('0x10')]){try{_0x42cadc=JSON[_0x6063('0x11')](Mustache[_0x6063('0x5')](_0x2d6b6c[_0x6063('0x10')],_0x1cb4fa));_0x3e7cb7[_0x6063('0x12')]=_0x42cadc;}catch(_0x39df3e){logger['error'](_0x39df3e['stack']);logger[_0x6063('0x13')](_0x6063('0x14'));}}else{_0x42cadc=_0x1cb4fa;_0x3e7cb7[_0x6063('0x12')]=_0x42cadc;}break;}logger[_0x6063('0x15')](util['format'](_0x6063('0x16'),_0x2d6b6c[_0x6063('0xc')],_0x2d6b6c[_0x6063('0x6')],JSON[_0x6063('0x17')](_0x3e7cb7)));rp(_0x3e7cb7)[_0x6063('0x18')](function(_0xd92276){_0x42cadc=!_[_0x6063('0x19')](_0x42cadc)?_0x6063('0x1a')+_0x42cadc:'';_0x5dccd8=typeof _0xd92276[_0x6063('0x12')]==='object'?JSON[_0x6063('0x17')](_0xd92276[_0x6063('0x12')]):_0xd92276[_0x6063('0x12')];logger[_0x6063('0x15')](util[_0x6063('0x1b')](_0x6063('0x1c'),_0x2d6b6c[_0x6063('0xc')],_0x2d6b6c[_0x6063('0x6')],_0xd92276[_0x6063('0x1d')],_0x5dccd8));})[_0x6063('0x1e')](function(_0x51f605){logger[_0x6063('0x13')](util[_0x6063('0x1b')](_0x6063('0x1f'),_0x2d6b6c[_0x6063('0xc')],_0x2d6b6c[_0x6063('0x6')],_0x51f605['statusCode'],_0x51f605['name'],_0x51f605['message']));});}; \ No newline at end of file +var _0xfcd9=['stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','data1','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util','mustache','exec','toUpperCase','render','data2','data5','headers','data6','parse','error','GET','DELETE','POST','PUT','data7','body','stack','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xfcd9,0x90));var _0x9fcd=function(_0x114da0,_0x19188f){_0x114da0=_0x114da0-0x0;var _0x5f1d8a=_0xfcd9[_0x114da0];return _0x5f1d8a;};'use strict';var rp=require(_0x9fcd('0x0'));var util=require(_0x9fcd('0x1'));var _=require('lodash');var Mustache=require(_0x9fcd('0x2'));var logger=require('../../../../config/logger')('trigger');exports[_0x9fcd('0x3')]=function(_0x2d3ff3,_0x4c7cf0){var _0x4486db,_0x21ddfb;var _0x2837d4={'method':_0x2d3ff3['data1'][_0x9fcd('0x4')](),'uri':Mustache[_0x9fcd('0x5')](_0x2d3ff3[_0x9fcd('0x6')],_0x4c7cf0),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x2d3ff3[_0x9fcd('0x7')])==='number'&&parseInt(_0x2d3ff3[_0x9fcd('0x7')])>=0x1&&parseInt(_0x2d3ff3[_0x9fcd('0x7')])<=0xa?parseInt(_0x2d3ff3['data5'])*0x3e8:0x5*0x3e8};try{_0x2837d4[_0x9fcd('0x8')]=_0x2d3ff3[_0x9fcd('0x9')]?JSON[_0x9fcd('0xa')](Mustache[_0x9fcd('0x5')](_0x2d3ff3[_0x9fcd('0x9')],_0x4c7cf0)):{};}catch(_0x2c2207){logger[_0x9fcd('0xb')](_0x2c2207['stack']);}switch(_0x2d3ff3['data1'][_0x9fcd('0x4')]()){case _0x9fcd('0xc'):case _0x9fcd('0xd'):_0x4486db=null;_0x2837d4['qs']=_0x4c7cf0;break;case _0x9fcd('0xe'):case _0x9fcd('0xf'):if(_0x2d3ff3[_0x9fcd('0x10')]){try{_0x4486db=JSON[_0x9fcd('0xa')](Mustache[_0x9fcd('0x5')](_0x2d3ff3[_0x9fcd('0x10')],_0x4c7cf0));_0x2837d4[_0x9fcd('0x11')]=_0x4486db;}catch(_0x579f8a){logger[_0x9fcd('0xb')](_0x579f8a[_0x9fcd('0x12')]);logger['error'](_0x9fcd('0x13'));}}else{_0x4486db=_0x4c7cf0;_0x2837d4[_0x9fcd('0x11')]=_0x4486db;}break;}logger[_0x9fcd('0x14')](util['format']('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x2d3ff3['data1'],_0x2d3ff3['data2'],JSON[_0x9fcd('0x15')](_0x2837d4)));rp(_0x2837d4)[_0x9fcd('0x16')](function(_0x1089f1){_0x4486db=!_[_0x9fcd('0x17')](_0x4486db)?_0x9fcd('0x18')+_0x4486db:'';_0x21ddfb=typeof _0x1089f1['body']===_0x9fcd('0x19')?JSON[_0x9fcd('0x15')](_0x1089f1[_0x9fcd('0x11')]):_0x1089f1[_0x9fcd('0x11')];logger['info'](util['format'](_0x9fcd('0x1a'),_0x2d3ff3[_0x9fcd('0x1b')],_0x2d3ff3['data2'],_0x1089f1[_0x9fcd('0x1c')],_0x21ddfb));})[_0x9fcd('0x1d')](function(_0x4745fc){logger[_0x9fcd('0xb')](util['format'](_0x9fcd('0x1e'),_0x2d3ff3['data1'],_0x2d3ff3[_0x9fcd('0x6')],_0x4745fc['statusCode'],_0x4745fc[_0x9fcd('0x1f')],_0x4745fc[_0x9fcd('0x20')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 4128828..3e99376 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 _0xaa50=['jayson/promise','bluebird','../../config/logger','routing','client','http','Request','request','then','debug','rpc','error','message','result'];(function(_0x4bbcf5,_0x4ac00c){var _0x1b39d5=function(_0x391e32){while(--_0x391e32){_0x4bbcf5['push'](_0x4bbcf5['shift']());}};_0x1b39d5(++_0x4ac00c);}(_0xaa50,0xfc));var _0x0aa5=function(_0x312fb6,_0x49b5aa){_0x312fb6=_0x312fb6-0x0;var _0x5536f1=_0xaa50[_0x312fb6];return _0x5536f1;};'use strict';var jayson=require(_0x0aa5('0x0'));var BPromise=require(_0x0aa5('0x1'));var logger=require(_0x0aa5('0x2'))(_0x0aa5('0x3'));var client=jayson[_0x0aa5('0x4')][_0x0aa5('0x5')]({'port':0x2329});client[_0x0aa5('0x6')]=function(_0x23df9a,_0x2d13a5){return new BPromise(function(_0x4887cc,_0x117614){return client[_0x0aa5('0x7')](_0x23df9a,_0x2d13a5)[_0x0aa5('0x8')](function(_0x57c33c){logger[_0x0aa5('0x9')](_0x0aa5('0xa'),_0x0aa5('0x3'),_0x23df9a,_0x2d13a5,_0x57c33c);if(_0x57c33c['error']){logger[_0x0aa5('0xb')](_0x0aa5('0xa'),'routing',_0x23df9a,_0x57c33c[_0x0aa5('0xb')]['message'],_0x2d13a5);return _0x117614(_0x57c33c[_0x0aa5('0xb')][_0x0aa5('0xc')]);}else{return _0x4887cc(_0x57c33c[_0x0aa5('0xd')]);}})['catch'](function(_0x233f18){logger[_0x0aa5('0xb')](_0x0aa5('0xa'),'routing',_0x23df9a,_0x233f18,_0x2d13a5);return _0x117614(_0x233f18);});});};module['exports']=client; \ No newline at end of file +var _0xc182=['routing','client','then','debug','error','rpc','message','exports','jayson/promise','bluebird','../../config/logger'];(function(_0x34bffd,_0x282274){var _0x3f7019=function(_0x5c416b){while(--_0x5c416b){_0x34bffd['push'](_0x34bffd['shift']());}};_0x3f7019(++_0x282274);}(_0xc182,0x8c));var _0x2c18=function(_0x2a514e,_0x445eae){_0x2a514e=_0x2a514e-0x0;var _0x3d1a66=_0xc182[_0x2a514e];return _0x3d1a66;};'use strict';var jayson=require(_0x2c18('0x0'));var BPromise=require(_0x2c18('0x1'));var logger=require(_0x2c18('0x2'))(_0x2c18('0x3'));var client=jayson[_0x2c18('0x4')]['http']({'port':0x2329});client['Request']=function(_0x37417f,_0x15f703){return new BPromise(function(_0xe6cb80,_0x2b1fdf){return client['request'](_0x37417f,_0x15f703)[_0x2c18('0x5')](function(_0x6b81ea){logger[_0x2c18('0x6')]('rpc',_0x2c18('0x3'),_0x37417f,_0x15f703,_0x6b81ea);if(_0x6b81ea[_0x2c18('0x7')]){logger[_0x2c18('0x7')](_0x2c18('0x8'),_0x2c18('0x3'),_0x37417f,_0x6b81ea[_0x2c18('0x7')]['message'],_0x15f703);return _0x2b1fdf(_0x6b81ea[_0x2c18('0x7')][_0x2c18('0x9')]);}else{return _0xe6cb80(_0x6b81ea['result']);}})['catch'](function(_0x4cfd4d){logger['error'](_0x2c18('0x8'),_0x2c18('0x3'),_0x37417f,_0x4cfd4d,_0x15f703);return _0x2b1fdf(_0x4cfd4d);});});};module[_0x2c18('0xa')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index ec00fb8..b0f3e0a 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 _0x62de=['./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','then','getMailAccounts','initMailAccounts','refresh','mailAccounts','listen','getSettings','loginMailFrequency','catch','error','./server'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x62de,0xef));var _0xe62d=function(_0x1d8ab5,_0x2f41d9){_0x1d8ab5=_0x1d8ab5-0x0;var _0x2eb1bc=_0x62de[_0x1d8ab5];return _0x2eb1bc;};'use strict';var server=require(_0xe62d('0x0'));var Realtime=require(_0xe62d('0x1'));var EmailChannel=require(_0xe62d('0x2'));var mailAccount=require(_0xe62d('0x3'));var setting=require(_0xe62d('0x4'));var logger=require(_0xe62d('0x5'))('email');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()[_0xe62d('0x6')](mailAccount[_0xe62d('0x7')]())[_0xe62d('0x6')](realtime[_0xe62d('0x8')]())['then'](function(){email[_0xe62d('0x9')](realtime[_0xe62d('0xa')]);return realtime;});}function main(){return server[_0xe62d('0xb')](realtime,email)[_0xe62d('0x6')](function(){return initRealtime();})[_0xe62d('0x6')](function(){return setting[_0xe62d('0xc')]();})[_0xe62d('0x6')](function(_0x2a0520){return setInterval(initRealtime,_0x2a0520[_0xe62d('0xd')]*0x3e8);})[_0xe62d('0xe')](function(_0x55c4aa){logger[_0xe62d('0xf')]('Email\x20service\x20initialization',_0x55c4aa);});}main(); \ No newline at end of file +var _0xad91=['email','then','initMailAccounts','refresh','listen','getSettings','loginMailFrequency','error','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting'];(function(_0x2e5395,_0x37cf94){var _0x3303af=function(_0x2427b2){while(--_0x2427b2){_0x2e5395['push'](_0x2e5395['shift']());}};_0x3303af(++_0x37cf94);}(_0xad91,0x181));var _0x1ad9=function(_0x6acb69,_0xd36dbf){_0x6acb69=_0x6acb69-0x0;var _0x29a021=_0xad91[_0x6acb69];return _0x29a021;};'use strict';var server=require(_0x1ad9('0x0'));var Realtime=require(_0x1ad9('0x1'));var EmailChannel=require(_0x1ad9('0x2'));var mailAccount=require(_0x1ad9('0x3'));var setting=require(_0x1ad9('0x4'));var logger=require('../../config/logger')(_0x1ad9('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()[_0x1ad9('0x6')](mailAccount['getMailAccounts']())['then'](realtime[_0x1ad9('0x7')]())[_0x1ad9('0x6')](function(){email[_0x1ad9('0x8')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0x1ad9('0x9')](realtime,email)[_0x1ad9('0x6')](function(){return initRealtime();})[_0x1ad9('0x6')](function(){return setting[_0x1ad9('0xa')]();})['then'](function(_0x279d38){return setInterval(initRealtime,_0x279d38[_0x1ad9('0xb')]*0x3e8);})['catch'](function(_0x4e1f07){logger[_0x1ad9('0xc')]('Email\x20service\x20initialization',_0x4e1f07);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 0cccfa2..30f25c4 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 _0x3daf=['handleImapEmail','info','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','error','stringify','handleImapEnd','sendMail','send','verifySmtp','Smtp','lastSync','verified','verify','lodash','moment','bluebird','md5','ioredis','../../../config/environment','email','redis','defaults','localhost','./imap','./smtp','../rpc/mailAccount','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','Imap','status','messageStatus','total','mailAccount:update','refresh','service','provider','custom','box','handleImapBox','bind','handleImapError','isNil','disabled','messages'];(function(_0x3adc9f,_0x5d49d5){var _0x432a40=function(_0x4e95da){while(--_0x4e95da){_0x3adc9f['push'](_0x3adc9f['shift']());}};_0x432a40(++_0x5d49d5);}(_0x3daf,0x1d3));var _0xf3da=function(_0x3233e7,_0x38ff96){_0x3233e7=_0x3233e7-0x0;var _0x460008=_0x3daf[_0x3233e7];return _0x460008;};'use strict';var _=require(_0xf3da('0x0'));var moment=require(_0xf3da('0x1'));var BPromise=require(_0xf3da('0x2'));var md5=require(_0xf3da('0x3'));var Redis=require(_0xf3da('0x4'));var config=require(_0xf3da('0x5'));var logger=require('../../../config/logger')(_0xf3da('0x6'));config[_0xf3da('0x7')]=_[_0xf3da('0x8')](config[_0xf3da('0x7')],{'host':_0xf3da('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf3da('0x7')]));var EmailImap=require(_0xf3da('0xa'));var EmailSmtp=require(_0xf3da('0xb'));var mailAccount=require(_0xf3da('0xc'));var md5Accounts={};function EmailChannel(_0x4042e1){logger['info']('start\x20email\x20channel');this[_0xf3da('0xd')]=_0x4042e1[_0xf3da('0xd')];this[_0xf3da('0xe')]={};this[_0xf3da('0xf')]=new EmailSmtp();}EmailChannel[_0xf3da('0x10')][_0xf3da('0x11')]=function(_0xfaed1f){var _0x1d51a5=this[_0xf3da('0xd')][_0xfaed1f];var _0xa646d1={'id':_0x1d51a5['id'],'name':_0x1d51a5[_0xf3da('0x12')],'key':_0x1d51a5[_0xf3da('0x13')],'active':_0x1d51a5[_0xf3da('0x14')],'Imap':{'status':_0x1d51a5[_0xf3da('0x15')][_0xf3da('0x16')],'messageStatus':_0x1d51a5['Imap'][_0xf3da('0x17')],'total':_0x1d51a5[_0xf3da('0x15')][_0xf3da('0x18')]}};if(_['isNil'](md5Accounts[_0xfaed1f])){md5Accounts[_0xfaed1f]={};}var _0x163f04=md5(JSON['stringify'](_0xa646d1));if(md5Accounts[_0xfaed1f][_0xf3da('0x3')]!==_0x163f04){md5Accounts[_0xfaed1f][_0xf3da('0x3')]=_0x163f04;io[_0xf3da('0x11')](_0xf3da('0x19'),_0xa646d1);}};EmailChannel[_0xf3da('0x10')][_0xf3da('0x1a')]=function(_0x15297f){for(var _0x2fd728 in _0x15297f){if(_0x15297f['hasOwnProperty'](_0x2fd728)){if(_0x15297f[_0x2fd728][_0xf3da('0x15')]&&_0x15297f[_0x2fd728][_0xf3da('0x14')]){var _0x50b4aa=_0x15297f[_0x2fd728][_0xf3da('0x15')];if(!_0x50b4aa[_0xf3da('0x1b')]&&_0x15297f[_0x2fd728][_0xf3da('0x1c')]!==_0xf3da('0x1d'))_0x50b4aa[_0xf3da('0x1b')]=_0x15297f[_0x2fd728][_0xf3da('0x1c')];if(!this[_0xf3da('0xe')]['hasOwnProperty'](_0x50b4aa['id'])){this[_0xf3da('0xe')][_0x50b4aa['id']]=new EmailImap(_0x50b4aa,_0x15297f[_0x2fd728][_0xf3da('0x6')]);this['imapAccounts'][_0x50b4aa['id']]['on'](_0xf3da('0x1e'),this[_0xf3da('0x1f')][_0xf3da('0x20')](this,_0x2fd728));this[_0xf3da('0xe')][_0x50b4aa['id']]['on'](_0xf3da('0x6'),this['handleImapEmail'][_0xf3da('0x20')](this,_0x2fd728));this[_0xf3da('0xe')][_0x50b4aa['id']]['on']('end',this['handleImapEnd']['bind'](this,_0x2fd728));this[_0xf3da('0xe')][_0x50b4aa['id']]['on']('error',this[_0xf3da('0x21')]['bind'](this,_0x2fd728));}}else{if(_[_0xf3da('0x22')](this[_0xf3da('0xd')][_0x2fd728][_0xf3da('0x15')])){this[_0xf3da('0xd')][_0x2fd728][_0xf3da('0x15')]={};}this[_0xf3da('0xd')][_0x2fd728][_0xf3da('0x15')][_0xf3da('0x16')]=_0xf3da('0x23');this[_0xf3da('0xd')][_0x2fd728][_0xf3da('0x15')]['messageStatus']='';this[_0xf3da('0x11')](_0x2fd728);}}}};EmailChannel[_0xf3da('0x10')][_0xf3da('0x1f')]=function(_0x3c08f5,_0x53d005){if(this[_0xf3da('0xd')][_0x3c08f5]){this[_0xf3da('0xd')][_0x3c08f5][_0xf3da('0x15')]['status']='connected';this['mailAccounts'][_0x3c08f5]['Imap'][_0xf3da('0x17')]=_0x53d005[_0xf3da('0x12')];if(_0x53d005[_0xf3da('0x24')]){this[_0xf3da('0xd')][_0x3c08f5][_0xf3da('0x15')]['total']=_0x53d005['messages']['total'];}return this[_0xf3da('0x11')](_0x3c08f5);}};EmailChannel['prototype'][_0xf3da('0x25')]=function(_0x1d0f74,_0x1d2628){logger[_0xf3da('0x26')](_0xf3da('0x27'),_0x1d2628['firstName'],_0x1d2628[_0xf3da('0x28')],_0x1d2628[_0xf3da('0x29')],_0x1d0f74);if(this[_0xf3da('0xd')][_0x1d0f74]){return mailAccount[_0xf3da('0x2a')](_0x1d0f74,_0x1d2628)[_0xf3da('0x2b')](function(_0x10aff4){if(_0x10aff4){logger['info'](_0xf3da('0x2c'));}})[_0xf3da('0x2d')](function(_0x2199d7){logger[_0xf3da('0x2e')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0xf3da('0x2f')](_0x2199d7));});}};EmailChannel['prototype'][_0xf3da('0x30')]=function(_0x208079){if(this[_0xf3da('0xd')][_0x208079]&&this[_0xf3da('0xd')][_0x208079]['Imap']){if(this['imapAccounts'][this[_0xf3da('0xd')][_0x208079][_0xf3da('0x15')]['id']]){delete this[_0xf3da('0xe')][this[_0xf3da('0xd')][_0x208079][_0xf3da('0x15')]['id']];}this[_0xf3da('0xd')][_0x208079][_0xf3da('0x15')]['lastSync']=moment();this[_0xf3da('0x11')](_0x208079);}};EmailChannel['prototype'][_0xf3da('0x21')]=function(_0x3a5aef,_0x36bccb){if(this[_0xf3da('0xd')][_0x3a5aef]){this[_0xf3da('0xd')][_0x3a5aef][_0xf3da('0x15')][_0xf3da('0x16')]=_0xf3da('0x2e');this['mailAccounts'][_0x3a5aef][_0xf3da('0x15')]['messageStatus']=_0x36bccb;return this['emit'](_0x3a5aef);}};EmailChannel[_0xf3da('0x10')][_0xf3da('0x31')]=function(_0x4d97f2,_0x4e72dd){return this[_0xf3da('0xf')][_0xf3da('0x32')](_0x4d97f2,_0x4e72dd);};EmailChannel['prototype'][_0xf3da('0x33')]=function(_0x1fec63){var _0x1b3d71=this;if(this[_0xf3da('0xd')][_0x1fec63['id']]){if(_[_0xf3da('0x22')](this[_0xf3da('0xd')][_0x1fec63['id']][_0xf3da('0x34')])){this['mailAccounts'][_0x1fec63['id']][_0xf3da('0x34')]={};}this['mailAccounts'][_0x1fec63['id']]['Smtp'][_0xf3da('0x35')]=moment();return new BPromise(function(_0x5dd098,_0x357e30){return _0x1b3d71['smtp']['verify'](_0x1fec63)[_0xf3da('0x2b')](function(_0x209f05){_0x1b3d71[_0xf3da('0xd')][_0x1fec63['id']][_0xf3da('0x34')][_0xf3da('0x16')]=_0xf3da('0x36');_0x1b3d71[_0xf3da('0xd')][_0x1fec63['id']][_0xf3da('0x34')][_0xf3da('0x17')]='';_0x1b3d71[_0xf3da('0x11')](_0x1fec63['id']);_0x5dd098(_0x209f05);})['catch'](function(_0x1912bc){_0x1b3d71['mailAccounts'][_0x1fec63['id']][_0xf3da('0x34')][_0xf3da('0x16')]=_0xf3da('0x2e');_0x1b3d71[_0xf3da('0xd')][_0x1fec63['id']][_0xf3da('0x34')][_0xf3da('0x17')]=_0x1912bc;_0x1b3d71['emit'](_0x1fec63['id']);_0x357e30(_0x1912bc);});});}return this[_0xf3da('0xf')][_0xf3da('0x37')](_0x1fec63);};module['exports']=EmailChannel; \ No newline at end of file +var _0xdb83=['box','handleImapBox','bind','email','handleImapEmail','end','handleImapEnd','error','handleImapError','disabled','prototype','messages','from','notify','Mail\x20accepted\x20from\x20routing','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','send','verifySmtp','Smtp','verify','verified','catch','exports','bluebird','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','./imap','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','emit','name','key','active','Imap','status','messageStatus','total','isNil','stringify','mailAccount:update','refresh','hasOwnProperty','service','provider'];(function(_0x4ce45a,_0x55a777){var _0x3b65d2=function(_0x11309c){while(--_0x11309c){_0x4ce45a['push'](_0x4ce45a['shift']());}};_0x3b65d2(++_0x55a777);}(_0xdb83,0x121));var _0x3db8=function(_0x3b261e,_0x513c07){_0x3b261e=_0x3b261e-0x0;var _0x17d7c7=_0xdb83[_0x3b261e];return _0x17d7c7;};'use strict';var _=require('lodash');var moment=require('moment');var BPromise=require(_0x3db8('0x0'));var md5=require(_0x3db8('0x1'));var Redis=require(_0x3db8('0x2'));var config=require(_0x3db8('0x3'));var logger=require('../../../config/logger')('email');config[_0x3db8('0x4')]=_['defaults'](config[_0x3db8('0x4')],{'host':_0x3db8('0x5'),'port':0x18eb});var io=require(_0x3db8('0x6'))(new Redis(config['redis']));var EmailImap=require(_0x3db8('0x7'));var EmailSmtp=require('./smtp');var mailAccount=require(_0x3db8('0x8'));var md5Accounts={};function EmailChannel(_0x36c9cb){logger[_0x3db8('0x9')](_0x3db8('0xa'));this[_0x3db8('0xb')]=_0x36c9cb[_0x3db8('0xb')];this[_0x3db8('0xc')]={};this[_0x3db8('0xd')]=new EmailSmtp();}EmailChannel['prototype'][_0x3db8('0xe')]=function(_0x404d7b){var _0x4a0a10=this[_0x3db8('0xb')][_0x404d7b];var _0x34827d={'id':_0x4a0a10['id'],'name':_0x4a0a10[_0x3db8('0xf')],'key':_0x4a0a10[_0x3db8('0x10')],'active':_0x4a0a10[_0x3db8('0x11')],'Imap':{'status':_0x4a0a10[_0x3db8('0x12')][_0x3db8('0x13')],'messageStatus':_0x4a0a10[_0x3db8('0x12')][_0x3db8('0x14')],'total':_0x4a0a10['Imap'][_0x3db8('0x15')]}};if(_[_0x3db8('0x16')](md5Accounts[_0x404d7b])){md5Accounts[_0x404d7b]={};}var _0x1ccf78=md5(JSON[_0x3db8('0x17')](_0x34827d));if(md5Accounts[_0x404d7b][_0x3db8('0x1')]!==_0x1ccf78){md5Accounts[_0x404d7b][_0x3db8('0x1')]=_0x1ccf78;io[_0x3db8('0xe')](_0x3db8('0x18'),_0x34827d);}};EmailChannel['prototype'][_0x3db8('0x19')]=function(_0x4deab7){for(var _0x1a09dd in _0x4deab7){if(_0x4deab7[_0x3db8('0x1a')](_0x1a09dd)){if(_0x4deab7[_0x1a09dd][_0x3db8('0x12')]&&_0x4deab7[_0x1a09dd][_0x3db8('0x11')]){var _0x4ec6ce=_0x4deab7[_0x1a09dd][_0x3db8('0x12')];if(!_0x4ec6ce[_0x3db8('0x1b')]&&_0x4deab7[_0x1a09dd][_0x3db8('0x1c')]!=='custom')_0x4ec6ce[_0x3db8('0x1b')]=_0x4deab7[_0x1a09dd][_0x3db8('0x1c')];if(!this[_0x3db8('0xc')][_0x3db8('0x1a')](_0x4ec6ce['id'])){this[_0x3db8('0xc')][_0x4ec6ce['id']]=new EmailImap(_0x4ec6ce,_0x4deab7[_0x1a09dd]['email']);this[_0x3db8('0xc')][_0x4ec6ce['id']]['on'](_0x3db8('0x1d'),this[_0x3db8('0x1e')][_0x3db8('0x1f')](this,_0x1a09dd));this[_0x3db8('0xc')][_0x4ec6ce['id']]['on'](_0x3db8('0x20'),this[_0x3db8('0x21')][_0x3db8('0x1f')](this,_0x1a09dd));this[_0x3db8('0xc')][_0x4ec6ce['id']]['on'](_0x3db8('0x22'),this[_0x3db8('0x23')][_0x3db8('0x1f')](this,_0x1a09dd));this[_0x3db8('0xc')][_0x4ec6ce['id']]['on'](_0x3db8('0x24'),this[_0x3db8('0x25')][_0x3db8('0x1f')](this,_0x1a09dd));}}else{if(_['isNil'](this['mailAccounts'][_0x1a09dd]['Imap'])){this['mailAccounts'][_0x1a09dd][_0x3db8('0x12')]={};}this[_0x3db8('0xb')][_0x1a09dd][_0x3db8('0x12')][_0x3db8('0x13')]=_0x3db8('0x26');this[_0x3db8('0xb')][_0x1a09dd][_0x3db8('0x12')][_0x3db8('0x14')]='';this[_0x3db8('0xe')](_0x1a09dd);}}}};EmailChannel[_0x3db8('0x27')][_0x3db8('0x1e')]=function(_0x2790dc,_0x816a24){if(this[_0x3db8('0xb')][_0x2790dc]){this[_0x3db8('0xb')][_0x2790dc][_0x3db8('0x12')][_0x3db8('0x13')]='connected';this[_0x3db8('0xb')][_0x2790dc][_0x3db8('0x12')][_0x3db8('0x14')]=_0x816a24[_0x3db8('0xf')];if(_0x816a24[_0x3db8('0x28')]){this[_0x3db8('0xb')][_0x2790dc][_0x3db8('0x12')]['total']=_0x816a24[_0x3db8('0x28')][_0x3db8('0x15')];}return this[_0x3db8('0xe')](_0x2790dc);}};EmailChannel['prototype']['handleImapEmail']=function(_0x2ea856,_0x101f0){logger['info']('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x101f0['firstName'],_0x101f0['lastName'],_0x101f0[_0x3db8('0x29')],_0x2ea856);if(this[_0x3db8('0xb')][_0x2ea856]){return mailAccount[_0x3db8('0x2a')](_0x2ea856,_0x101f0)['then'](function(_0x4a53aa){if(_0x4a53aa){logger[_0x3db8('0x9')](_0x3db8('0x2b'));}})['catch'](function(_0x10e0de){logger[_0x3db8('0x24')](_0x3db8('0x2c'),JSON['stringify'](_0x10e0de));});}};EmailChannel[_0x3db8('0x27')]['handleImapEnd']=function(_0x4d49a4){if(this[_0x3db8('0xb')][_0x4d49a4]&&this[_0x3db8('0xb')][_0x4d49a4]['Imap']){if(this[_0x3db8('0xc')][this[_0x3db8('0xb')][_0x4d49a4]['Imap']['id']]){delete this['imapAccounts'][this[_0x3db8('0xb')][_0x4d49a4][_0x3db8('0x12')]['id']];}this[_0x3db8('0xb')][_0x4d49a4]['Imap'][_0x3db8('0x2d')]=moment();this[_0x3db8('0xe')](_0x4d49a4);}};EmailChannel[_0x3db8('0x27')][_0x3db8('0x25')]=function(_0x43286c,_0x777f13){if(this[_0x3db8('0xb')][_0x43286c]){this['mailAccounts'][_0x43286c]['Imap'][_0x3db8('0x13')]='error';this[_0x3db8('0xb')][_0x43286c][_0x3db8('0x12')][_0x3db8('0x14')]=_0x777f13;return this[_0x3db8('0xe')](_0x43286c);}};EmailChannel['prototype']['sendMail']=function(_0x4b460,_0x4ef93e){return this[_0x3db8('0xd')][_0x3db8('0x2e')](_0x4b460,_0x4ef93e);};EmailChannel[_0x3db8('0x27')][_0x3db8('0x2f')]=function(_0x45e164){var _0x179fcc=this;if(this[_0x3db8('0xb')][_0x45e164['id']]){if(_[_0x3db8('0x16')](this[_0x3db8('0xb')][_0x45e164['id']][_0x3db8('0x30')])){this[_0x3db8('0xb')][_0x45e164['id']][_0x3db8('0x30')]={};}this[_0x3db8('0xb')][_0x45e164['id']][_0x3db8('0x30')]['lastSync']=moment();return new BPromise(function(_0x4207c2,_0x3762b6){return _0x179fcc[_0x3db8('0xd')][_0x3db8('0x31')](_0x45e164)['then'](function(_0x307d40){_0x179fcc[_0x3db8('0xb')][_0x45e164['id']][_0x3db8('0x30')][_0x3db8('0x13')]=_0x3db8('0x32');_0x179fcc[_0x3db8('0xb')][_0x45e164['id']][_0x3db8('0x30')][_0x3db8('0x14')]='';_0x179fcc['emit'](_0x45e164['id']);_0x4207c2(_0x307d40);})[_0x3db8('0x33')](function(_0x3a1f7e){_0x179fcc['mailAccounts'][_0x45e164['id']][_0x3db8('0x30')]['status']=_0x3db8('0x24');_0x179fcc[_0x3db8('0xb')][_0x45e164['id']][_0x3db8('0x30')][_0x3db8('0x14')]=_0x3a1f7e;_0x179fcc[_0x3db8('0xe')](_0x45e164['id']);_0x3762b6(_0x3a1f7e);});});}return this['smtp'][_0x3db8('0x31')](_0x45e164);};module[_0x3db8('0x34')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index b6f462f..c1f5390 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 _0x1115=['openBox','mailbox','handleOpenBox','emit','readUnseen','handleCloseBox','end','search','handleReadUnseen','length','handleFetchError','handleFetchMessage','body','handleMessageBody','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','email','handleFetchEnd','closeBox','textCode','hasOwnProperty','upperFirst','exports','util','imap','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','./utils','INBOX','account','once','bind','handleEnd','error','handleError','connect','inherits','prototype','getAccount','connTimeout','authTimeout','user','anonymous@xcally.com','modernAuthentication','generateXOAuth2Token','CloudProvider','password','authentication','host','port','tls','required','handleReady'];(function(_0x58245d,_0x2b7846){var _0x38eb5d=function(_0x70b8fc){while(--_0x70b8fc){_0x58245d['push'](_0x58245d['shift']());}};_0x38eb5d(++_0x2b7846);}(_0x1115,0x1b6));var _0x5111=function(_0x471b70,_0x11218d){_0x471b70=_0x471b70-0x0;var _0x1c7dbc=_0x1115[_0x471b70];return _0x1c7dbc;};'use strict';var _=require('lodash');var util=require(_0x5111('0x0'));var Imap=require(_0x5111('0x1'));var simpleParser=require(_0x5111('0x2'))[_0x5111('0x3')];var Iconv=require(_0x5111('0x4'))[_0x5111('0x5')];var EventEmitter=require(_0x5111('0x6'))[_0x5111('0x7')];var utils=require(_0x5111('0x8'));var logger=require('../../../config/logger')('email');function EmailImap(_0x467c3a,_0x115ba7){this['mailbox']=_0x5111('0x9');this[_0x5111('0xa')]=this['getAccount'](_0x467c3a,_0x115ba7);this[_0x5111('0x1')]=new Imap(this['account']);this[_0x5111('0x1')][_0x5111('0xb')]('ready',this['handleReady'][_0x5111('0xc')](this));this['imap'][_0x5111('0xb')]('end',this[_0x5111('0xd')][_0x5111('0xc')](this));this[_0x5111('0x1')]['on'](_0x5111('0xe'),this[_0x5111('0xf')][_0x5111('0xc')](this));this[_0x5111('0x1')][_0x5111('0x10')]();}util[_0x5111('0x11')](EmailImap,EventEmitter);EmailImap[_0x5111('0x12')][_0x5111('0x13')]=function(_0x62ce44,_0x264703){var _0x3e60b5={'connTimeout':_0x62ce44[_0x5111('0x14')]?_0x62ce44[_0x5111('0x14')]*0x3e8:0x2710,'authTimeout':_0x62ce44[_0x5111('0x15')]?_0x62ce44[_0x5111('0x15')]*0x3e8:0x1388};if(_0x62ce44['service']){_0x3e60b5[_0x5111('0x16')]=_0x62ce44['user'];_0x3e60b5['email']=_0x264703||_0x62ce44[_0x5111('0x16')]||_0x5111('0x17');if(_0x62ce44[_0x5111('0x18')]){_0x3e60b5['xoauth2']=utils[_0x5111('0x19')](_0x62ce44[_0x5111('0x1a')]['data5'],_0x62ce44[_0x5111('0x16')]);}else{_0x3e60b5[_0x5111('0x1b')]=_0x62ce44[_0x5111('0x1b')];}}else{if(_0x62ce44[_0x5111('0x1c')]){_0x3e60b5['user']=_0x62ce44[_0x5111('0x16')];_0x3e60b5[_0x5111('0x1b')]=_0x62ce44[_0x5111('0x1b')];}}_0x3e60b5[_0x5111('0x1d')]=_0x62ce44[_0x5111('0x1d')];_0x3e60b5[_0x5111('0x1e')]=_0x62ce44[_0x5111('0x1e')]||0x3e1;if(_0x62ce44[_0x5111('0x1f')]){_0x3e60b5[_0x5111('0x1f')]=!![];}else{_0x3e60b5[_0x5111('0x1f')]=![];_0x3e60b5['autotls']=_0x5111('0x20');}return _0x3e60b5;};EmailImap[_0x5111('0x12')][_0x5111('0x21')]=function(){this['imap'][_0x5111('0x22')](this[_0x5111('0x23')],![],this[_0x5111('0x24')][_0x5111('0xc')](this));};EmailImap[_0x5111('0x12')][_0x5111('0x24')]=function(_0x5990,_0x316b39){if(_0x5990){this[_0x5111('0xf')](_0x5990,!![]);}else{this[_0x5111('0x25')]('box',_0x316b39);this[_0x5111('0x26')]();}};EmailImap[_0x5111('0x12')][_0x5111('0x27')]=function(_0x3e7e59){if(_0x3e7e59){this[_0x5111('0xf')](_0x3e7e59,!![]);}else{this[_0x5111('0x1')][_0x5111('0x28')]();}};EmailImap['prototype'][_0x5111('0x26')]=function(){this[_0x5111('0x1')][_0x5111('0x29')](['UNSEEN'],this[_0x5111('0x2a')][_0x5111('0xc')](this));};EmailImap[_0x5111('0x12')]['handleReadUnseen']=function(_0x491a4c,_0x20dea1){if(_0x491a4c){this['handleError'](_0x491a4c,!![]);}else{if(_0x20dea1[_0x5111('0x2b')]){try{var _0x5b5a6d=this[_0x5111('0x1')]['fetch'](_0x20dea1,{'bodies':'','markSeen':!![]});_0x5b5a6d['on']('message',this['handleFetchMessage'][_0x5111('0xc')](this));_0x5b5a6d[_0x5111('0xb')](_0x5111('0xe'),this[_0x5111('0x2c')][_0x5111('0xc')](this));_0x5b5a6d[_0x5111('0xb')](_0x5111('0x28'),this['handleFetchEnd'][_0x5111('0xc')](this));}catch(_0x37c981){logger[_0x5111('0xe')](_0x37c981);}}else{this[_0x5111('0x1')]['closeBox'](!![],this['handleCloseBox'][_0x5111('0xc')](this));}}};EmailImap[_0x5111('0x12')][_0x5111('0x2d')]=function(_0x44b9d9){_0x44b9d9['on'](_0x5111('0x2e'),this[_0x5111('0x2f')][_0x5111('0xc')](this));_0x44b9d9[_0x5111('0xb')]('attributes',this[_0x5111('0x30')][_0x5111('0xc')](this));_0x44b9d9[_0x5111('0xb')]('end',this[_0x5111('0x31')][_0x5111('0xc')](this));};EmailImap[_0x5111('0x12')]['handleMessageBody']=function(_0x4ecbc9){simpleParser(_0x4ecbc9,{'Iconv':Iconv},this['handleSimpleParser'][_0x5111('0xc')](this));};EmailImap[_0x5111('0x12')][_0x5111('0x30')]=function(){};EmailImap[_0x5111('0x12')][_0x5111('0x31')]=function(){};EmailImap['prototype'][_0x5111('0x32')]=function(_0x222c73,_0x2ea08e){if(_0x222c73){logger[_0x5111('0xe')](_0x222c73);}else{var _0x521a45=this;utils[_0x5111('0x33')](this[_0x5111('0xa')],_0x2ea08e,function(_0x2add19){_0x521a45[_0x5111('0x25')](_0x5111('0x34'),_0x2add19);});}};EmailImap[_0x5111('0x12')][_0x5111('0x35')]=function(){this[_0x5111('0x1')][_0x5111('0x36')](!![],this[_0x5111('0x27')][_0x5111('0xc')](this));};EmailImap[_0x5111('0x12')][_0x5111('0x2c')]=function(_0x4e0bc4){this[_0x5111('0xf')](_0x4e0bc4);this[_0x5111('0x1')]['closeBox'](!![],this[_0x5111('0x27')][_0x5111('0xc')](this));};EmailImap[_0x5111('0x12')][_0x5111('0xd')]=function(){this[_0x5111('0x25')](_0x5111('0x28'));};EmailImap[_0x5111('0x12')]['handleError']=function(_0x36bd18,_0x2b7bdf){logger[_0x5111('0xe')](_0x5111('0xf'),this[_0x5111('0xa')]['email'],JSON['stringify'](_0x36bd18));var _0x10efb4='';if(_0x36bd18){if(_0x36bd18[_0x5111('0x37')]){_0x10efb4=_0x36bd18['textCode'];}else{for(var _0x2fc02e in _0x36bd18){if(_0x36bd18[_0x5111('0x38')](_0x2fc02e)){_0x10efb4+=_[_0x5111('0x39')](_0x2fc02e)+':\x20'+_0x36bd18[_0x2fc02e]+'\x0a';}}}}if(_0x2b7bdf){this[_0x5111('0x1')][_0x5111('0x28')]();}else{this[_0x5111('0x25')](_0x5111('0xe'),_0x10efb4);this[_0x5111('0x25')](_0x5111('0x28'));}};module[_0x5111('0x3a')]=EmailImap; \ No newline at end of file +var _0xfdbd=['error','handleError','connect','inherits','prototype','connTimeout','authTimeout','service','user','anonymous@xcally.com','modernAuthentication','xoauth2','CloudProvider','data5','password','authentication','host','port','tls','autotls','required','mailbox','handleOpenBox','emit','box','readUnseen','handleCloseBox','end','search','handleReadUnseen','fetch','message','handleFetchMessage','handleFetchError','closeBox','body','handleMessageBody','attributes','handleMessageEnd','handleSimpleParser','handleMessageAttributes','parser','account','handleFetchEnd','stringify','textCode','hasOwnProperty','exports','lodash','util','imap','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','../../../config/logger','getAccount','once','ready','handleReady','bind','handleEnd'];(function(_0xb9f734,_0x5abb48){var _0x59b662=function(_0x374d9a){while(--_0x374d9a){_0xb9f734['push'](_0xb9f734['shift']());}};_0x59b662(++_0x5abb48);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x515e9f,_0xff9586){_0x515e9f=_0x515e9f-0x0;var _0x19cbf0=_0xfdbd[_0x515e9f];return _0x19cbf0;};'use strict';var _=require(_0xdfdb('0x0'));var util=require(_0xdfdb('0x1'));var Imap=require(_0xdfdb('0x2'));var simpleParser=require(_0xdfdb('0x3'))[_0xdfdb('0x4')];var Iconv=require(_0xdfdb('0x5'))[_0xdfdb('0x6')];var EventEmitter=require(_0xdfdb('0x7'))[_0xdfdb('0x8')];var utils=require('./utils');var logger=require(_0xdfdb('0x9'))('email');function EmailImap(_0x453ef6,_0x41bd5e){this['mailbox']='INBOX';this['account']=this[_0xdfdb('0xa')](_0x453ef6,_0x41bd5e);this[_0xdfdb('0x2')]=new Imap(this['account']);this[_0xdfdb('0x2')][_0xdfdb('0xb')](_0xdfdb('0xc'),this[_0xdfdb('0xd')][_0xdfdb('0xe')](this));this[_0xdfdb('0x2')][_0xdfdb('0xb')]('end',this[_0xdfdb('0xf')][_0xdfdb('0xe')](this));this['imap']['on'](_0xdfdb('0x10'),this[_0xdfdb('0x11')][_0xdfdb('0xe')](this));this[_0xdfdb('0x2')][_0xdfdb('0x12')]();}util[_0xdfdb('0x13')](EmailImap,EventEmitter);EmailImap[_0xdfdb('0x14')][_0xdfdb('0xa')]=function(_0x51162f,_0x48a66a){var _0x2c44dc={'connTimeout':_0x51162f['connTimeout']?_0x51162f[_0xdfdb('0x15')]*0x3e8:0x2710,'authTimeout':_0x51162f[_0xdfdb('0x16')]?_0x51162f[_0xdfdb('0x16')]*0x3e8:0x1388};if(_0x51162f[_0xdfdb('0x17')]){_0x2c44dc[_0xdfdb('0x18')]=_0x51162f[_0xdfdb('0x18')];_0x2c44dc['email']=_0x48a66a||_0x51162f['user']||_0xdfdb('0x19');if(_0x51162f[_0xdfdb('0x1a')]){_0x2c44dc[_0xdfdb('0x1b')]=utils['generateXOAuth2Token'](_0x51162f[_0xdfdb('0x1c')][_0xdfdb('0x1d')],_0x51162f[_0xdfdb('0x18')]);}else{_0x2c44dc[_0xdfdb('0x1e')]=_0x51162f[_0xdfdb('0x1e')];}}else{if(_0x51162f[_0xdfdb('0x1f')]){_0x2c44dc[_0xdfdb('0x18')]=_0x51162f[_0xdfdb('0x18')];_0x2c44dc['password']=_0x51162f[_0xdfdb('0x1e')];}}_0x2c44dc[_0xdfdb('0x20')]=_0x51162f[_0xdfdb('0x20')];_0x2c44dc['port']=_0x51162f[_0xdfdb('0x21')]||0x3e1;if(_0x51162f[_0xdfdb('0x22')]){_0x2c44dc[_0xdfdb('0x22')]=!![];}else{_0x2c44dc['tls']=![];_0x2c44dc[_0xdfdb('0x23')]=_0xdfdb('0x24');}return _0x2c44dc;};EmailImap[_0xdfdb('0x14')]['handleReady']=function(){this[_0xdfdb('0x2')]['openBox'](this[_0xdfdb('0x25')],![],this[_0xdfdb('0x26')][_0xdfdb('0xe')](this));};EmailImap[_0xdfdb('0x14')]['handleOpenBox']=function(_0x4c253e,_0x4363d8){if(_0x4c253e){this[_0xdfdb('0x11')](_0x4c253e,!![]);}else{this[_0xdfdb('0x27')](_0xdfdb('0x28'),_0x4363d8);this[_0xdfdb('0x29')]();}};EmailImap['prototype'][_0xdfdb('0x2a')]=function(_0x2d5fe2){if(_0x2d5fe2){this[_0xdfdb('0x11')](_0x2d5fe2,!![]);}else{this['imap'][_0xdfdb('0x2b')]();}};EmailImap['prototype'][_0xdfdb('0x29')]=function(){this[_0xdfdb('0x2')][_0xdfdb('0x2c')](['UNSEEN'],this['handleReadUnseen'][_0xdfdb('0xe')](this));};EmailImap[_0xdfdb('0x14')][_0xdfdb('0x2d')]=function(_0x3a2ec3,_0x371b69){if(_0x3a2ec3){this[_0xdfdb('0x11')](_0x3a2ec3,!![]);}else{if(_0x371b69['length']){try{var _0xf396d5=this[_0xdfdb('0x2')][_0xdfdb('0x2e')](_0x371b69,{'bodies':'','markSeen':!![]});_0xf396d5['on'](_0xdfdb('0x2f'),this[_0xdfdb('0x30')][_0xdfdb('0xe')](this));_0xf396d5[_0xdfdb('0xb')](_0xdfdb('0x10'),this[_0xdfdb('0x31')][_0xdfdb('0xe')](this));_0xf396d5[_0xdfdb('0xb')]('end',this['handleFetchEnd'][_0xdfdb('0xe')](this));}catch(_0x5288a1){logger[_0xdfdb('0x10')](_0x5288a1);}}else{this[_0xdfdb('0x2')][_0xdfdb('0x32')](!![],this[_0xdfdb('0x2a')]['bind'](this));}}};EmailImap[_0xdfdb('0x14')]['handleFetchMessage']=function(_0x341f0d){_0x341f0d['on'](_0xdfdb('0x33'),this[_0xdfdb('0x34')][_0xdfdb('0xe')](this));_0x341f0d[_0xdfdb('0xb')](_0xdfdb('0x35'),this['handleMessageAttributes'][_0xdfdb('0xe')](this));_0x341f0d[_0xdfdb('0xb')]('end',this[_0xdfdb('0x36')][_0xdfdb('0xe')](this));};EmailImap[_0xdfdb('0x14')][_0xdfdb('0x34')]=function(_0x439f32){simpleParser(_0x439f32,{'Iconv':Iconv},this[_0xdfdb('0x37')][_0xdfdb('0xe')](this));};EmailImap[_0xdfdb('0x14')][_0xdfdb('0x38')]=function(){};EmailImap[_0xdfdb('0x14')][_0xdfdb('0x36')]=function(){};EmailImap['prototype'][_0xdfdb('0x37')]=function(_0x2e65b9,_0x3d3807){if(_0x2e65b9){logger[_0xdfdb('0x10')](_0x2e65b9);}else{var _0x2ac83d=this;utils[_0xdfdb('0x39')](this[_0xdfdb('0x3a')],_0x3d3807,function(_0x30a56e){_0x2ac83d['emit']('email',_0x30a56e);});}};EmailImap[_0xdfdb('0x14')][_0xdfdb('0x3b')]=function(){this[_0xdfdb('0x2')][_0xdfdb('0x32')](!![],this[_0xdfdb('0x2a')][_0xdfdb('0xe')](this));};EmailImap[_0xdfdb('0x14')][_0xdfdb('0x31')]=function(_0xcee274){this['handleError'](_0xcee274);this[_0xdfdb('0x2')][_0xdfdb('0x32')](!![],this[_0xdfdb('0x2a')][_0xdfdb('0xe')](this));};EmailImap[_0xdfdb('0x14')]['handleEnd']=function(){this[_0xdfdb('0x27')](_0xdfdb('0x2b'));};EmailImap[_0xdfdb('0x14')][_0xdfdb('0x11')]=function(_0x431004,_0x58842e){logger[_0xdfdb('0x10')](_0xdfdb('0x11'),this[_0xdfdb('0x3a')]['email'],JSON[_0xdfdb('0x3c')](_0x431004));var _0x539294='';if(_0x431004){if(_0x431004[_0xdfdb('0x3d')]){_0x539294=_0x431004['textCode'];}else{for(var _0x15b0c6 in _0x431004){if(_0x431004[_0xdfdb('0x3e')](_0x15b0c6)){_0x539294+=_['upperFirst'](_0x15b0c6)+':\x20'+_0x431004[_0x15b0c6]+'\x0a';}}}}if(_0x58842e){this[_0xdfdb('0x2')]['end']();}else{this[_0xdfdb('0x27')](_0xdfdb('0x10'),_0x539294);this[_0xdfdb('0x27')](_0xdfdb('0x2b'));}};module[_0xdfdb('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 b142535..f010d56 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 _0x9585=['use','toString','prototype','verify','Not\x20verifired','exports','send','createTransport'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x9585,0x9e));var _0x5958=function(_0x150146,_0x3a04c4){_0x150146=_0x150146-0x0;var _0x539f40=_0x9585[_0x150146];return _0x539f40;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp['prototype'][_0x5958('0x0')]=function(_0x40b61f,_0x54d207){return new Promise(function(_0x2ba7ec,_0x5a7153){var _0x37bda0=nodemailer[_0x5958('0x1')](_0x40b61f);_0x37bda0[_0x5958('0x2')]('compile',inlineBase64());_0x37bda0['sendMail'](_0x54d207,function(_0xd0b704,_0x1556ea){if(_0xd0b704){_0x5a7153(_0xd0b704[_0x5958('0x3')]());}else{_0x2ba7ec(_0x1556ea);}});});};EmailSmtp[_0x5958('0x4')][_0x5958('0x5')]=function(_0x5d4cdc){return new Promise(function(_0x348d25,_0x2aa6a2){var _0x19b419=nodemailer[_0x5958('0x1')](_0x5d4cdc);_0x19b419['verify'](function(_0x55255a,_0x34602a){if(_0x55255a){_0x2aa6a2(_0x55255a[_0x5958('0x3')]());}else{if(_0x34602a){_0x348d25(_0x34602a);}else{_0x2aa6a2(_0x5958('0x6'));}}});});};module[_0x5958('0x7')]=EmailSmtp; \ No newline at end of file +var _0x2a1a=['Not\x20verifired','exports','nodemailer','send','use','compile','prototype','createTransport','toString'];(function(_0x39ef73,_0x41c3eb){var _0x274e9f=function(_0x56bc33){while(--_0x56bc33){_0x39ef73['push'](_0x39ef73['shift']());}};_0x274e9f(++_0x41c3eb);}(_0x2a1a,0xa4));var _0xa2a1=function(_0x1402b1,_0x404818){_0x1402b1=_0x1402b1-0x0;var _0xd5f947=_0x2a1a[_0x1402b1];return _0xd5f947;};'use strict';var nodemailer=require(_0xa2a1('0x0'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp['prototype'][_0xa2a1('0x1')]=function(_0x75e65e,_0x46089e){return new Promise(function(_0xd66567,_0x113726){var _0x56e841=nodemailer['createTransport'](_0x75e65e);_0x56e841[_0xa2a1('0x2')](_0xa2a1('0x3'),inlineBase64());_0x56e841['sendMail'](_0x46089e,function(_0x4fbe8a,_0x335f9a){if(_0x4fbe8a){_0x113726(_0x4fbe8a['toString']());}else{_0xd66567(_0x335f9a);}});});};EmailSmtp[_0xa2a1('0x4')]['verify']=function(_0xcc60c4){return new Promise(function(_0x2530c1,_0x3603d3){var _0x5c7ff2=nodemailer[_0xa2a1('0x5')](_0xcc60c4);_0x5c7ff2['verify'](function(_0x52617b,_0x207093){if(_0x52617b){_0x3603d3(_0x52617b[_0xa2a1('0x6')]());}else{if(_0x207093){_0x2530c1(_0x207093);}else{_0x3603d3(_0xa2a1('0x7'));}}});});};module[_0xa2a1('0x8')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index a136fb2..da9359a 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 _0xf426=['originCc','bcc','attach','type','filename','attachment-','%s-%s','now','join','root','server/files/attachments/','writeFileSync','content','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','indexOf','line','isAutoreply','parser','from','messageId','inReplyTo','date','format','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','first','BodyHTML','

Empty\x20message

','Attachments','Title','Data','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','base64','lodash','moment','randomstring','util','node-tnef','../../../config/logger','email','../../../config/environment','head','address','anonymous','@xcally.com','name','substring','split','length','value','pop','isEmpty','generate','html','test','replace','includes','\x20[Attachment:\x20','\x20]','body','textAsHtml','originTo','message'];(function(_0x226098,_0x3027fe){var _0x42fbc1=function(_0x4cc405){while(--_0x4cc405){_0x226098['push'](_0x226098['shift']());}};_0x42fbc1(++_0x3027fe);}(_0xf426,0x11c));var _0x6f42=function(_0x4b9b78,_0x1dc74a){_0x4b9b78=_0x4b9b78-0x0;var _0x330388=_0xf426[_0x4b9b78];return _0x330388;};'use strict';var _=require(_0x6f42('0x0'));var moment=require(_0x6f42('0x1'));var random=require(_0x6f42('0x2'));var fs=require('fs');var path=require('path');var util=require(_0x6f42('0x3'));var tnef=require(_0x6f42('0x4'));var logger=require(_0x6f42('0x5'))(_0x6f42('0x6'));var config=require(_0x6f42('0x7'));function getAddress(_0x1bf3f5){var _0x31784b=_[_0x6f42('0x8')](_0x1bf3f5['value']);return _0x31784b&&_0x31784b['address']?_0x31784b[_0x6f42('0x9')]:_0x6f42('0xa')+random['generate'](0x6)+_0x6f42('0xb');}function getFirstName(_0x383767){var _0x4bc5ef=_['head'](_0x383767['value']);if(_0x4bc5ef&&_0x4bc5ef[_0x6f42('0xc')]){if(_0x4bc5ef[_0x6f42('0xc')]==_0x4bc5ef['address']){return _0x4bc5ef[_0x6f42('0xc')][_0x6f42('0xd')](0x0,_0x4bc5ef['name']['indexOf']('@'));}var _0xeb9dce=_0x4bc5ef[_0x6f42('0xc')][_0x6f42('0xe')](/\s+/);return _0xeb9dce[_0x6f42('0xf')]>0x1?_0xeb9dce['slice'](0x0,-0x1)['join']('\x20'):_0x4bc5ef[_0x6f42('0xc')];}return'Anonymous';}function getLastName(_0x5085b5){var _0x3af60a=_['head'](_0x5085b5[_0x6f42('0x10')]);if(_0x3af60a&&_0x3af60a[_0x6f42('0xc')]){var _0x3976e4=_0x3af60a[_0x6f42('0xc')]['split'](/\s+/);return _0x3976e4[_0x6f42('0xf')]>0x1?_0x3976e4[_0x6f42('0x11')]():'';}return'';}function getMails(_0x5015e8,_0x290dcd){var _0xee5aa2='';for(var _0xd6686d=0x0;_0xd6686d<_0x290dcd['value'][_0x6f42('0xf')];_0xd6686d+=0x1){if(_0x290dcd[_0x6f42('0x10')][_0xd6686d][_0x6f42('0x9')]!==_0x5015e8){if(!_[_0x6f42('0x12')](_0xee5aa2)){_0xee5aa2+=',';}_0xee5aa2+=_0x290dcd[_0x6f42('0x10')][_0xd6686d][_0x6f42('0xc')]||_0x290dcd[_0x6f42('0x10')][_0xd6686d][_0x6f42('0x9')]||'';_0xee5aa2+='\x20<';_0xee5aa2+=_0x290dcd[_0x6f42('0x10')][_0xd6686d][_0x6f42('0x9')]?_0x290dcd[_0x6f42('0x10')][_0xd6686d][_0x6f42('0x9')]:_0x6f42('0xa')+random[_0x6f42('0x13')](0x6)+_0x6f42('0xb');_0xee5aa2+='>';}}return _0xee5aa2;}function parseEmail(_0x2d7a1b,_0x53d485,_0x4e3b75){if(_0x53d485[_0x6f42('0x14')]){var _0xa996bd=/)<[^<]*)*<\/script>/gi;while(_0xa996bd[_0x6f42('0x15')](_0x53d485[_0x6f42('0x14')])){_0x53d485['html']=_0x53d485[_0x6f42('0x14')][_0x6f42('0x16')](_0xa996bd,'');}if(_0x53d485[_0x6f42('0x14')][_0x6f42('0x17')](_0x6f42('0x18'))){var _0x405f9a=[];_0x53d485[_0x6f42('0x19')][_0x6f42('0x1a')](_0x5c1511=>{_0x405f9a[_0x6f42('0x1b')](_0x5c1511['filename']);});var _0x2bfbf6=/]+>/g;var _0x1e46e7=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x348d1f=_0x53d485[_0x6f42('0x14')][_0x6f42('0x16')](_0x1e46e7,_0x6f42('0x1c'));var _0x151098=_0x348d1f[_0x6f42('0x16')](_0x2bfbf6,_0x6f42('0x1d'));for(let _0x10bc01=0x0;_0x10bc01<_0x405f9a[_0x6f42('0xf')];_0x10bc01++){var _0x456085=_0x151098[_0x6f42('0x16')](_0x6f42('0x1d'),_0x6f42('0x1e')+_0x405f9a[_0x10bc01]+_0x6f42('0x1f'));_0x151098=_0x456085;}_0x53d485['html']=_0x151098;}_0x4e3b75[_0x6f42('0x20')]=_0x53d485[_0x6f42('0x14')];}else{_0x4e3b75[_0x6f42('0x20')]=_0x53d485[_0x6f42('0x21')];}if(_0x4e3b75[_0x6f42('0x20')]){_0x4e3b75['body']=_0x4e3b75[_0x6f42('0x20')][_0x6f42('0x16')](/0x0){var _0x25d584=[_0x6f42('0x33'),_0x6f42('0x34'),_0x6f42('0x35')];for(var _0x36270e=0x0;_0x36270e<_0x53d485[_0x6f42('0x32')]['length'];_0x36270e++){var _0x3cf12a=_[_0x6f42('0x36')](_0x25d584,_0x53d485['headerLines'][_0x36270e][_0x6f42('0x37')]);if(_0x3cf12a>=0x0){_0x4e3b75[_0x6f42('0x38')]=!![];}}}return _0x4e3b75;}exports[_0x6f42('0x39')]=function(_0x5d3e2f,_0x1e1b05,_0xf6870e){var _0x3a697d={'from':getAddress(_0x1e1b05[_0x6f42('0x3a')]),'firstName':getFirstName(_0x1e1b05['from']),'lastName':getLastName(_0x1e1b05[_0x6f42('0x3a')]),'mapKey':_0x6f42('0x6'),'message':{'from':getMails(_0x5d3e2f[_0x6f42('0x6')],_0x1e1b05[_0x6f42('0x3a')]),'to':_0x5d3e2f['email'],'cc':'','subject':_0x1e1b05['subject']||'','messageId':_0x1e1b05[_0x6f42('0x3b')],'inReplyTo':_0x1e1b05[_0x6f42('0x3c')],'sentAt':moment(_0x1e1b05[_0x6f42('0x3d')])[_0x6f42('0x3e')](_0x6f42('0x3f')),'attach':![],'attachments':[]}};if(!_0x1e1b05[_0x6f42('0x14')]&&!_0x1e1b05['textAsHtml']){var _0x298402=_[_0x6f42('0x40')](_0x1e1b05['attachments'],{'contentType':_0x6f42('0x41')});if(_0x298402[_0x6f42('0xf')]){logger[_0x6f42('0x42')](util[_0x6f42('0x3e')](_0x6f42('0x43'),_0x1e1b05['messageId']));tnef['parseBuffer'](_[_0x6f42('0x44')](_0x298402)['content'],function(_0x45d220,_0x484288){if(_0x484288){_0x1e1b05[_0x6f42('0x14')]=_0x484288[_0x6f42('0x45')]||_0x6f42('0x46');if(_0x484288[_0x6f42('0x47')]){for(var _0x46106a=0x0;_0x46106a<_0x484288[_0x6f42('0x47')][_0x6f42('0xf')];_0x46106a++){var _0x12ba49=_0x484288[_0x6f42('0x47')][_0x46106a];_0x3a697d[_0x6f42('0x23')][_0x6f42('0x19')][_0x6f42('0x1b')]({'filename':_0x12ba49[_0x6f42('0x48')],'content':Buffer[_0x6f42('0x3a')](_0x12ba49[_0x6f42('0x49')])});}}}_0xf6870e(parseEmail(_0x5d3e2f,_0x1e1b05,_0x3a697d));});}else{_0x1e1b05[_0x6f42('0x14')]=_0x6f42('0x46');_0xf6870e(parseEmail(_0x5d3e2f,_0x1e1b05,_0x3a697d));}}else{_0xf6870e(parseEmail(_0x5d3e2f,_0x1e1b05,_0x3a697d));}};exports[_0x6f42('0x4a')]=function(_0x4335a7,_0x2e203b){var _0x2f4a6e=[_0x6f42('0x4b')+(_0x2e203b||''),_0x6f42('0x4c')+_0x4335a7,'',''];return Buffer[_0x6f42('0x3a')](_0x2f4a6e['join'](''),_0x6f42('0x4d'))[_0x6f42('0x4e')](_0x6f42('0x4f'));}; \ No newline at end of file +var _0xfd19=['server/files/attachments/','writeFileSync','content','contentType','headerLines','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','line','isAutoreply','parser','from','subject','messageId','inReplyTo','date','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','

Empty\x20message

','Attachments','Title','Data','generateXOAuth2Token','user=','utf-8','toString','base64','lodash','moment','randomstring','node-tnef','email','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','substring','indexOf','length','slice','join','Anonymous','split','isEmpty','test','html','includes','\x20[Attachment:\x20','\x20]','body','textAsHtml','0x1?_0x46fec2[_0x9fd1('0x10')](0x0,-0x1)[_0x9fd1('0x11')]('\x20'):_0x512983[_0x9fd1('0xc')];}return _0x9fd1('0x12');}function getLastName(_0x3cb034){var _0x42e990=_[_0x9fd1('0x6')](_0x3cb034[_0x9fd1('0x7')]);if(_0x42e990&&_0x42e990[_0x9fd1('0xc')]){var _0x877105=_0x42e990[_0x9fd1('0xc')][_0x9fd1('0x13')](/\s+/);return _0x877105[_0x9fd1('0xf')]>0x1?_0x877105['pop']():'';}return'';}function getMails(_0x3e254d,_0x3f7a02){var _0x2fde70='';for(var _0x93fb07=0x0;_0x93fb07<_0x3f7a02[_0x9fd1('0x7')][_0x9fd1('0xf')];_0x93fb07+=0x1){if(_0x3f7a02[_0x9fd1('0x7')][_0x93fb07][_0x9fd1('0x8')]!==_0x3e254d){if(!_[_0x9fd1('0x14')](_0x2fde70)){_0x2fde70+=',';}_0x2fde70+=_0x3f7a02[_0x9fd1('0x7')][_0x93fb07][_0x9fd1('0xc')]||_0x3f7a02[_0x9fd1('0x7')][_0x93fb07][_0x9fd1('0x8')]||'';_0x2fde70+='\x20<';_0x2fde70+=_0x3f7a02[_0x9fd1('0x7')][_0x93fb07][_0x9fd1('0x8')]?_0x3f7a02['value'][_0x93fb07][_0x9fd1('0x8')]:_0x9fd1('0x9')+random['generate'](0x6)+_0x9fd1('0xb');_0x2fde70+='>';}}return _0x2fde70;}function parseEmail(_0x275b9a,_0x827c86,_0x18742e){if(_0x827c86['html']){var _0x23277f=/)<[^<]*)*<\/script>/gi;while(_0x23277f[_0x9fd1('0x15')](_0x827c86['html'])){_0x827c86[_0x9fd1('0x16')]=_0x827c86['html']['replace'](_0x23277f,'');}if(_0x827c86[_0x9fd1('0x16')][_0x9fd1('0x17')](_0x9fd1('0x18'))){var _0x1c2964=[];_0x827c86['attachments'][_0x9fd1('0x19')](_0x42c74d=>{_0x1c2964[_0x9fd1('0x1a')](_0x42c74d[_0x9fd1('0x1b')]);});var _0x1dbaf5=/]+>/g;var _0x5092b6=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x50bb0d=_0x827c86[_0x9fd1('0x16')]['replace'](_0x5092b6,_0x9fd1('0x1c'));var _0x3f701a=_0x50bb0d[_0x9fd1('0x1d')](_0x1dbaf5,'_IMG');for(let _0x5647aa=0x0;_0x5647aa<_0x1c2964[_0x9fd1('0xf')];_0x5647aa++){var _0x8843fb=_0x3f701a[_0x9fd1('0x1d')](_0x9fd1('0x1e'),_0x9fd1('0x1f')+_0x1c2964[_0x5647aa]+_0x9fd1('0x20'));_0x3f701a=_0x8843fb;}_0x827c86[_0x9fd1('0x16')]=_0x3f701a;}_0x18742e[_0x9fd1('0x21')]=_0x827c86[_0x9fd1('0x16')];}else{_0x18742e[_0x9fd1('0x21')]=_0x827c86[_0x9fd1('0x22')];}if(_0x18742e['body']){_0x18742e[_0x9fd1('0x21')]=_0x18742e[_0x9fd1('0x21')][_0x9fd1('0x1d')](/0x0){var _0x5a1f0e=['Auto-Submitted:\x20auto-replied',_0x9fd1('0x32'),_0x9fd1('0x33')];for(var _0x36e70c=0x0;_0x36e70c<_0x827c86[_0x9fd1('0x31')][_0x9fd1('0xf')];_0x36e70c++){var _0x3a93bf=_['indexOf'](_0x5a1f0e,_0x827c86['headerLines'][_0x36e70c][_0x9fd1('0x34')]);if(_0x3a93bf>=0x0){_0x18742e[_0x9fd1('0x35')]=!![];}}}return _0x18742e;}exports[_0x9fd1('0x36')]=function(_0x433486,_0x206e72,_0x138f25){var _0x5804d0={'from':getAddress(_0x206e72[_0x9fd1('0x37')]),'firstName':getFirstName(_0x206e72[_0x9fd1('0x37')]),'lastName':getLastName(_0x206e72[_0x9fd1('0x37')]),'mapKey':_0x9fd1('0x4'),'message':{'from':getMails(_0x433486[_0x9fd1('0x4')],_0x206e72[_0x9fd1('0x37')]),'to':_0x433486[_0x9fd1('0x4')],'cc':'','subject':_0x206e72[_0x9fd1('0x38')]||'','messageId':_0x206e72[_0x9fd1('0x39')],'inReplyTo':_0x206e72[_0x9fd1('0x3a')],'sentAt':moment(_0x206e72[_0x9fd1('0x3b')])['format']('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x206e72[_0x9fd1('0x16')]&&!_0x206e72[_0x9fd1('0x22')]){var _0x3f6a9e=_['filter'](_0x206e72[_0x9fd1('0x28')],{'contentType':_0x9fd1('0x3c')});if(_0x3f6a9e[_0x9fd1('0xf')]){logger[_0x9fd1('0x3d')](util[_0x9fd1('0x2b')](_0x9fd1('0x3e'),_0x206e72[_0x9fd1('0x39')]));tnef[_0x9fd1('0x3f')](_[_0x9fd1('0x40')](_0x3f6a9e)['content'],function(_0x8455ec,_0x1a6397){if(_0x1a6397){_0x206e72[_0x9fd1('0x16')]=_0x1a6397['BodyHTML']||_0x9fd1('0x41');if(_0x1a6397['Attachments']){for(var _0x1509c9=0x0;_0x1509c9<_0x1a6397[_0x9fd1('0x42')][_0x9fd1('0xf')];_0x1509c9++){var _0x2530ba=_0x1a6397[_0x9fd1('0x42')][_0x1509c9];_0x5804d0[_0x9fd1('0x24')][_0x9fd1('0x28')][_0x9fd1('0x1a')]({'filename':_0x2530ba[_0x9fd1('0x43')],'content':Buffer[_0x9fd1('0x37')](_0x2530ba[_0x9fd1('0x44')])});}}}_0x138f25(parseEmail(_0x433486,_0x206e72,_0x5804d0));});}else{_0x206e72[_0x9fd1('0x16')]='

Empty\x20message

';_0x138f25(parseEmail(_0x433486,_0x206e72,_0x5804d0));}}else{_0x138f25(parseEmail(_0x433486,_0x206e72,_0x5804d0));}};exports[_0x9fd1('0x45')]=function(_0x57dea8,_0x96e00d){var _0x262e3b=[_0x9fd1('0x46')+(_0x96e00d||''),'auth=Bearer\x20'+_0x57dea8,'',''];return Buffer[_0x9fd1('0x37')](_0x262e3b[_0x9fd1('0x11')](''),_0x9fd1('0x47'))[_0x9fd1('0x48')](_0x9fd1('0x49'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index e98ac4f..9531828 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 _0x55be=['lodash','name','Service','key','SERV','active','Imap','Smtp','exports'];(function(_0x54f4f0,_0x1766ec){var _0x44bd15=function(_0x5b6fc6){while(--_0x5b6fc6){_0x54f4f0['push'](_0x54f4f0['shift']());}};_0x44bd15(++_0x1766ec);}(_0x55be,0x87));var _0xe55b=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x55be[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0xe55b('0x0'));function MailAccount(_0x52ed04){this['id']=_0x52ed04['id']||0x0;this[_0xe55b('0x1')]=_0x52ed04['name']||_0xe55b('0x2');this[_0xe55b('0x3')]=_0x52ed04['key']||_0xe55b('0x4');this[_0xe55b('0x5')]=_0x52ed04[_0xe55b('0x5')]||![];this[_0xe55b('0x6')]=_0x52ed04[_0xe55b('0x6')]||[];this['Smtp']=_0x52ed04[_0xe55b('0x7')]||[];}module[_0xe55b('0x8')]=MailAccount; \ No newline at end of file +var _0x5e46=['exports','lodash','name','Service','key','active','Imap','Smtp'];(function(_0x1d50f2,_0x3c3ec6){var _0x3769b8=function(_0x50926a){while(--_0x50926a){_0x1d50f2['push'](_0x1d50f2['shift']());}};_0x3769b8(++_0x3c3ec6);}(_0x5e46,0x159));var _0x65e4=function(_0x3484ab,_0xf94e08){_0x3484ab=_0x3484ab-0x0;var _0x19214a=_0x5e46[_0x3484ab];return _0x19214a;};'use strict';var _=require(_0x65e4('0x0'));function MailAccount(_0xf71160){this['id']=_0xf71160['id']||0x0;this[_0x65e4('0x1')]=_0xf71160['name']||_0x65e4('0x2');this['key']=_0xf71160[_0x65e4('0x3')]||'SERV';this[_0x65e4('0x4')]=_0xf71160['active']||![];this['Imap']=_0xf71160[_0x65e4('0x5')]||[];this[_0x65e4('0x6')]=_0xf71160['Smtp']||[];}module[_0x65e4('0x7')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 604d82b..711400c 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 _0x4d33=['initMailAccounts','mailAccounts','length','isUndefined','exports','lodash','../model/mailAccount','mapKeys','hasOwnProperty','prototype'];(function(_0x55aa6b,_0x57c39b){var _0x20a950=function(_0x112f37){while(--_0x112f37){_0x55aa6b['push'](_0x55aa6b['shift']());}};_0x20a950(++_0x57c39b);}(_0x4d33,0x1e5));var _0x34d3=function(_0x576266,_0x4002b0){_0x576266=_0x576266-0x0;var _0x18234f=_0x4d33[_0x576266];return _0x18234f;};'use strict';var _=require(_0x34d3('0x0'));var MailAccount=require(_0x34d3('0x1'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x14aba3,_0x1c2cf0,_0x6bdcc5){var _0x42dda9=_[_0x34d3('0x2')](_0x14aba3,function(_0x47b4d2,_0x410d2e){return _0x47b4d2[_0x6bdcc5];});for(var _0x113110 in _0x1c2cf0){if(_0x1c2cf0[_0x34d3('0x3')](_0x113110)){if(!_0x42dda9[_0x113110]){delete _0x1c2cf0[_0x113110];}}}}Realtime[_0x34d3('0x4')]['mergeFromDatabase']=function(_0x3d6d66,_0x1a992d){for(var _0x2965ea in _0x1a992d){if(_0x3d6d66['hasOwnProperty'](_0x2965ea)){_0x3d6d66[_0x2965ea]=_0x1a992d[_0x2965ea];}}};Realtime[_0x34d3('0x4')][_0x34d3('0x5')]=function(){var _0x550cee=this;return function(_0xb0b79a){if(_0xb0b79a){freeIsNotKey(_0xb0b79a,_0x550cee[_0x34d3('0x6')],'id');for(var _0xe6b80d=0x0,_0x2a694a={},_0x3fedf8={};_0xe6b80d<_0xb0b79a[_0x34d3('0x7')];_0xe6b80d+=0x1){_0x2a694a=_0xb0b79a[_0xe6b80d];if(_[_0x34d3('0x8')](_0x550cee[_0x34d3('0x6')][_0x2a694a['id']])){_0x550cee[_0x34d3('0x6')][_0x2a694a['id']]=new MailAccount(_0x2a694a);}else{_['merge'](_0x550cee[_0x34d3('0x6')][_0x2a694a['id']],_0x2a694a);}}}return _0x550cee[_0x34d3('0x6')];};};module[_0x34d3('0x9')]=Realtime; \ No newline at end of file +var _0x9162=['mapKeys','hasOwnProperty','prototype','initMailAccounts','length','isUndefined','lodash','mailAccounts'];(function(_0x5ac1e5,_0x4b5012){var _0x1bccc6=function(_0x102562){while(--_0x102562){_0x5ac1e5['push'](_0x5ac1e5['shift']());}};_0x1bccc6(++_0x4b5012);}(_0x9162,0x19e));var _0x2916=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x9162[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0x2916('0x0'));var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0x2916('0x1')]={};};function freeIsNotKey(_0x31032e,_0xa51303,_0x232017){var _0x215ed1=_[_0x2916('0x2')](_0x31032e,function(_0x21a4a7,_0x11edfa){return _0x21a4a7[_0x232017];});for(var _0x187eda in _0xa51303){if(_0xa51303[_0x2916('0x3')](_0x187eda)){if(!_0x215ed1[_0x187eda]){delete _0xa51303[_0x187eda];}}}}Realtime[_0x2916('0x4')]['mergeFromDatabase']=function(_0xc10655,_0x385b21){for(var _0x2fa9a8 in _0x385b21){if(_0xc10655[_0x2916('0x3')](_0x2fa9a8)){_0xc10655[_0x2fa9a8]=_0x385b21[_0x2fa9a8];}}};Realtime[_0x2916('0x4')][_0x2916('0x5')]=function(){var _0x225a9b=this;return function(_0x39e125){if(_0x39e125){freeIsNotKey(_0x39e125,_0x225a9b['mailAccounts'],'id');for(var _0x31ab3a=0x0,_0x20424a={},_0x34dfd1={};_0x31ab3a<_0x39e125[_0x2916('0x6')];_0x31ab3a+=0x1){_0x20424a=_0x39e125[_0x31ab3a];if(_[_0x2916('0x7')](_0x225a9b['mailAccounts'][_0x20424a['id']])){_0x225a9b[_0x2916('0x1')][_0x20424a['id']]=new MailAccount(_0x20424a);}else{_['merge'](_0x225a9b[_0x2916('0x1')][_0x20424a['id']],_0x20424a);}}}return _0x225a9b[_0x2916('0x1')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index b723a84..36cca0d 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 _0xf5c0=['MailServerOut','Smtp','CloudProvider','notify','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','name','provider','email','key','ListId','MailServerIn','Imap','service','type','data5'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xf5c0,0x9d));var _0x0f5c=function(_0x1b81ae,_0x1941f7){_0x1b81ae=_0x1b81ae-0x0;var _0x33ba48=_0xf5c0[_0x1b81ae];return _0x33ba48;};'use strict';var client=require(_0x0f5c('0x0'));exports[_0x0f5c('0x1')]=function(){return function(){return client[_0x0f5c('0x2')](_0x0f5c('0x3'),{'options':{'attributes':['id',_0x0f5c('0x4'),_0x0f5c('0x5'),'service',_0x0f5c('0x6'),'active',_0x0f5c('0x7'),_0x0f5c('0x8'),'TemplateId'],'raw':![],'include':[{'model':_0x0f5c('0x9'),'as':_0x0f5c('0xa'),'include':[{'model':'CloudProvider','attributes':['id',_0x0f5c('0x4'),_0x0f5c('0xb'),_0x0f5c('0xc'),_0x0f5c('0xd')],'as':'CloudProvider'}]},{'model':_0x0f5c('0xe'),'as':_0x0f5c('0xf'),'include':[{'model':_0x0f5c('0x10'),'attributes':['id','name',_0x0f5c('0xb'),'type','data5'],'as':_0x0f5c('0x10')}]}]},'log':'getMailAccount'});};};exports[_0x0f5c('0x11')]=function(_0x554671,_0x5a9b2e){return client[_0x0f5c('0x2')](_0x0f5c('0x12'),{'account':{'id':_0x554671},'body':_0x5a9b2e,'log':'NotifyMailAccount'});}; \ No newline at end of file +var _0x4813=['key','ListId','TemplateId','MailServerIn','type','data5','CloudProvider','getMailAccount','notify','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','name','provider','service','active'];(function(_0x10f096,_0x722741){var _0xea8154=function(_0x5a274a){while(--_0x5a274a){_0x10f096['push'](_0x10f096['shift']());}};_0xea8154(++_0x722741);}(_0x4813,0x14e));var _0x3481=function(_0x52dda6,_0x238b2b){_0x52dda6=_0x52dda6-0x0;var _0x10239f=_0x4813[_0x52dda6];return _0x10239f;};'use strict';var client=require(_0x3481('0x0'));exports[_0x3481('0x1')]=function(){return function(){return client[_0x3481('0x2')](_0x3481('0x3'),{'options':{'attributes':['id',_0x3481('0x4'),_0x3481('0x5'),_0x3481('0x6'),'email',_0x3481('0x7'),_0x3481('0x8'),_0x3481('0x9'),_0x3481('0xa')],'raw':![],'include':[{'model':_0x3481('0xb'),'as':'Imap','include':[{'model':'CloudProvider','attributes':['id',_0x3481('0x4'),'service',_0x3481('0xc'),_0x3481('0xd')],'as':_0x3481('0xe')}]},{'model':'MailServerOut','as':'Smtp','include':[{'model':'CloudProvider','attributes':['id',_0x3481('0x4'),'service','type',_0x3481('0xd')],'as':_0x3481('0xe')}]}]},'log':_0x3481('0xf')});};};exports[_0x3481('0x10')]=function(_0x29fd04,_0x369fd7){return client[_0x3481('0x2')](_0x3481('0x11'),{'account':{'id':_0x29fd04},'body':_0x369fd7,'log':_0x3481('0x11')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 233b96b..8370ab8 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 _0xc46b=['GetSettings','getSettings','Request','ShowSetting','loginMailFrequency'];(function(_0x427bb1,_0x48b035){var _0x301f5c=function(_0x4709b7){while(--_0x4709b7){_0x427bb1['push'](_0x427bb1['shift']());}};_0x301f5c(++_0x48b035);}(_0xc46b,0x137));var _0xbc46=function(_0x56691d,_0x2d49ed){_0x56691d=_0x56691d-0x0;var _0x56ca0a=_0xc46b[_0x56691d];return _0x56ca0a;};'use strict';var client=require('../client');exports[_0xbc46('0x0')]=function(){return client[_0xbc46('0x1')](_0xbc46('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xbc46('0x3')]},'log':_0xbc46('0x4')});}; \ No newline at end of file +var _0xe31b=['loginMailFrequency','GetSettings','../client','getSettings','Request','ShowSetting'];(function(_0xbd00dd,_0x2996a9){var _0x607c15=function(_0x3b6c29){while(--_0x3b6c29){_0xbd00dd['push'](_0xbd00dd['shift']());}};_0x607c15(++_0x2996a9);}(_0xe31b,0x1b2));var _0xbe31=function(_0x49f118,_0x5138e4){_0x49f118=_0x49f118-0x0;var _0x3a0443=_0xe31b[_0x49f118];return _0x3a0443;};'use strict';var client=require(_0xbe31('0x0'));exports[_0xbe31('0x1')]=function(){return client[_0xbe31('0x2')](_0xbe31('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xbe31('0x4')]},'log':_0xbe31('0x5')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 9a28190..ad057d9 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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'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 4f7fdc5..ea0a6d2 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 _0x47d2=['once','log','exports','lodash','express','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','port','socket.io','websocket','defaults','redis','localhost','adapter','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express'];(function(_0x3a5ffb,_0x235413){var _0x2759d5=function(_0x5d2f50){while(--_0x5d2f50){_0x3a5ffb['push'](_0x3a5ffb['shift']());}};_0x2759d5(++_0x235413);}(_0x47d2,0x18a));var _0x247d=function(_0x2fde10,_0x3c77f2){_0x2fde10=_0x2fde10-0x0;var _0x4c97ae=_0x47d2[_0x2fde10];return _0x4c97ae;};'use strict';var _=require(_0x247d('0x0'));var http=require('http');var express=require(_0x247d('0x1'));var sticky=require(_0x247d('0x2'));var Redis=require(_0x247d('0x3'));var config=require(_0x247d('0x4'));var app=express();var server=http[_0x247d('0x5')](app);server[_0x247d('0x6')]=0xdbba0;if(sticky[_0x247d('0x7')](server,config[_0x247d('0x8')])){var socketio=require(_0x247d('0x9'))(server,{'transports':[_0x247d('0xa'),'polling']});config['redis']=_[_0x247d('0xb')](config[_0x247d('0xc')],{'host':_0x247d('0xd'),'port':0x18eb});socketio[_0x247d('0xe')](require(_0x247d('0xf'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config['redis'])}));require(_0x247d('0x10'))[_0x247d('0x11')]();require(_0x247d('0x12'))[_0x247d('0x11')](socketio);require(_0x247d('0x13'))[_0x247d('0x11')](app);require('../../routes')['default'](app);}else{server[_0x247d('0x14')]('listening',function(){console[_0x247d('0x15')]('Express\x20server\x20listening\x20on\x20port\x20%d!',config[_0x247d('0x8')]);});}exports=module[_0x247d('0x16')]=app; \ No newline at end of file +var _0x2b38=['timeout','listen','port','socket.io','websocket','polling','defaults','redis','default','../../config/express','../../routes','once','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express','sticky-session','../../config/environment','createServer'];(function(_0xe69415,_0x37d140){var _0x6ffe2d=function(_0x397237){while(--_0x397237){_0xe69415['push'](_0xe69415['shift']());}};_0x6ffe2d(++_0x37d140);}(_0x2b38,0x1b2));var _0x82b3=function(_0x256bb2,_0x23d994){_0x256bb2=_0x256bb2-0x0;var _0x87bbea=_0x2b38[_0x256bb2];return _0x87bbea;};'use strict';var _=require(_0x82b3('0x0'));var http=require(_0x82b3('0x1'));var express=require(_0x82b3('0x2'));var sticky=require(_0x82b3('0x3'));var Redis=require('ioredis');var config=require(_0x82b3('0x4'));var app=express();var server=http[_0x82b3('0x5')](app);server[_0x82b3('0x6')]=0xdbba0;if(sticky[_0x82b3('0x7')](server,config[_0x82b3('0x8')])){var socketio=require(_0x82b3('0x9'))(server,{'transports':[_0x82b3('0xa'),_0x82b3('0xb')]});config['redis']=_[_0x82b3('0xc')](config[_0x82b3('0xd')],{'host':'localhost','port':0x18eb});socketio['adapter'](require('socket.io-redis')({'pubClient':new Redis(config[_0x82b3('0xd')]),'subClient':new Redis(config[_0x82b3('0xd')])}));require('../../config/triggers')[_0x82b3('0xe')]();require('../../config/socketio')[_0x82b3('0xe')](socketio);require(_0x82b3('0xf'))[_0x82b3('0xe')](app);require(_0x82b3('0x10'))[_0x82b3('0xe')](app);}else{server[_0x82b3('0x11')]('listening',function(){console['log'](_0x82b3('0x12'),config['port']);});}exports=module[_0x82b3('0x13')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index f73376f..3920302 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 _0x5f48=['routing','http','request','then','debug','rpc','error','message','result','catch','exports','bluebird','../../config/logger'];(function(_0x38780d,_0x1c7705){var _0x55a572=function(_0x5d4e9a){while(--_0x5d4e9a){_0x38780d['push'](_0x38780d['shift']());}};_0x55a572(++_0x1c7705);}(_0x5f48,0x1b8));var _0x85f4=function(_0xe1ad40,_0x309e30){_0xe1ad40=_0xe1ad40-0x0;var _0x211af7=_0x5f48[_0xe1ad40];return _0x211af7;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x85f4('0x0'));var logger=require(_0x85f4('0x1'))(_0x85f4('0x2'));var client=jayson['client'][_0x85f4('0x3')]({'port':0x2329});client['Request']=function(_0x3edebc,_0x228496){return new BPromise(function(_0x386368,_0x1b3b2b){return client[_0x85f4('0x4')](_0x3edebc,_0x228496)[_0x85f4('0x5')](function(_0x2f693a){logger[_0x85f4('0x6')](_0x85f4('0x7'),'routing',_0x3edebc,_0x228496,_0x2f693a);if(_0x2f693a[_0x85f4('0x8')]){logger[_0x85f4('0x8')](_0x85f4('0x7'),_0x85f4('0x2'),_0x3edebc,_0x2f693a[_0x85f4('0x8')][_0x85f4('0x9')],_0x228496);return _0x1b3b2b(_0x2f693a['error'][_0x85f4('0x9')]);}else{return _0x386368(_0x2f693a[_0x85f4('0xa')]);}})[_0x85f4('0xb')](function(_0x3f2792){logger['error'](_0x85f4('0x7'),_0x85f4('0x2'),_0x3edebc,_0x3f2792,_0x228496);return _0x1b3b2b(_0x3f2792);});});};module[_0x85f4('0xc')]=client; \ No newline at end of file +var _0x5808=['result','catch','exports','jayson/promise','bluebird','../../config/logger','client','http','Request','request','rpc','routing','error','message'];(function(_0x2abd62,_0x36911e){var _0x1c41af=function(_0x431f8f){while(--_0x431f8f){_0x2abd62['push'](_0x2abd62['shift']());}};_0x1c41af(++_0x36911e);}(_0x5808,0x161));var _0x8580=function(_0x3f0b30,_0x159bc8){_0x3f0b30=_0x3f0b30-0x0;var _0x2748a5=_0x5808[_0x3f0b30];return _0x2748a5;};'use strict';var jayson=require(_0x8580('0x0'));var BPromise=require(_0x8580('0x1'));var logger=require(_0x8580('0x2'))('routing');var client=jayson[_0x8580('0x3')][_0x8580('0x4')]({'port':0x2329});client[_0x8580('0x5')]=function(_0x4dbbc8,_0xb58ed4){return new BPromise(function(_0x31c1da,_0x5871c4){return client[_0x8580('0x6')](_0x4dbbc8,_0xb58ed4)['then'](function(_0x95c274){logger['debug'](_0x8580('0x7'),_0x8580('0x8'),_0x4dbbc8,_0xb58ed4,_0x95c274);if(_0x95c274[_0x8580('0x9')]){logger[_0x8580('0x9')](_0x8580('0x7'),_0x8580('0x8'),_0x4dbbc8,_0x95c274[_0x8580('0x9')][_0x8580('0xa')],_0xb58ed4);return _0x5871c4(_0x95c274[_0x8580('0x9')][_0x8580('0xa')]);}else{return _0x31c1da(_0x95c274[_0x8580('0xb')]);}})[_0x8580('0xc')](function(_0x2173c2){logger[_0x8580('0x9')]('rpc',_0x8580('0x8'),_0x4dbbc8,_0x2173c2,_0xb58ed4);return _0x5871c4(_0x2173c2);});});};module[_0x8580('0xd')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 175c84c..7676ec9 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 _0x2447=['./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/whatsappQueue','then','getAgents','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','initWhatsappQueues','log','bluebird','./realtime','./rpc/openchannelQueue'];(function(_0x1222c7,_0x32d942){var _0x20ff86=function(_0x42c5f8){while(--_0x42c5f8){_0x1222c7['push'](_0x1222c7['shift']());}};_0x20ff86(++_0x32d942);}(_0x2447,0xcc));var _0x7244=function(_0x42b394,_0x128751){_0x42b394=_0x42b394-0x0;var _0x560848=_0x2447[_0x42b394];return _0x560848;};'use strict';var BPromise=require(_0x7244('0x0'));var server=require('./server');var Realtime=require(_0x7244('0x1'));var user=require('./rpc/user');var interval=require('./rpc/interval');var openchannelQueue=require(_0x7244('0x2'));var chatQueue=require(_0x7244('0x3'));var smsQueue=require(_0x7244('0x4'));var mailQueue=require(_0x7244('0x5'));var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0x7244('0x6'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0x7244('0x7')](user[_0x7244('0x8')]())['then'](realtime[_0x7244('0x9')]())[_0x7244('0x7')](interval[_0x7244('0xa')]())['then'](realtime[_0x7244('0xb')]())[_0x7244('0x7')](openchannelQueue[_0x7244('0xc')]())[_0x7244('0x7')](realtime[_0x7244('0xd')]())[_0x7244('0x7')](chatQueue['getChatQueues']())[_0x7244('0x7')](realtime[_0x7244('0xe')]())[_0x7244('0x7')](smsQueue[_0x7244('0xf')]())[_0x7244('0x7')](realtime[_0x7244('0x10')]())[_0x7244('0x7')](mailQueue[_0x7244('0x11')]())[_0x7244('0x7')](realtime[_0x7244('0x12')]())[_0x7244('0x7')](faxQueue[_0x7244('0x13')]())[_0x7244('0x7')](realtime[_0x7244('0x14')]())[_0x7244('0x7')](whatsappQueue['getWhatsappQueues']())[_0x7244('0x7')](realtime[_0x7244('0x15')]())['then'](function(){return realtime;});}function main(){return server['listen'](realtime)[_0x7244('0x7')](function(_0x2010e0){return initRealtime();})[_0x7244('0x7')](function(_0x591048){return setInterval(initRealtime,0x1388);})['catch'](function(_0x6c0597){console[_0x7244('0x16')](_0x6c0597);});}main(); \ No newline at end of file +var _0x8847=['getAgents','initAgents','getOpenchannelQueues','initOpenchannelQueues','initChatQueues','initSmsQueues','getMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','bluebird','./server','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then'];(function(_0x4d6b7c,_0x525cd3){var _0x17ba83=function(_0x4d2392){while(--_0x4d2392){_0x4d6b7c['push'](_0x4d6b7c['shift']());}};_0x17ba83(++_0x525cd3);}(_0x8847,0xd6));var _0x7884=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x8847[_0x2dadb9];return _0x2f0097;};'use strict';var BPromise=require(_0x7884('0x0'));var server=require(_0x7884('0x1'));var Realtime=require('./realtime');var user=require(_0x7884('0x2'));var interval=require(_0x7884('0x3'));var openchannelQueue=require(_0x7884('0x4'));var chatQueue=require('./rpc/chatQueue');var smsQueue=require(_0x7884('0x5'));var mailQueue=require(_0x7884('0x6'));var faxQueue=require(_0x7884('0x7'));var whatsappQueue=require(_0x7884('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x7884('0x9')]()[_0x7884('0xa')](user[_0x7884('0xb')]())[_0x7884('0xa')](realtime[_0x7884('0xc')]())[_0x7884('0xa')](interval['getIntervals']())['then'](realtime['initIntervals']())[_0x7884('0xa')](openchannelQueue[_0x7884('0xd')]())['then'](realtime[_0x7884('0xe')]())[_0x7884('0xa')](chatQueue['getChatQueues']())[_0x7884('0xa')](realtime[_0x7884('0xf')]())[_0x7884('0xa')](smsQueue['getSmsQueues']())['then'](realtime[_0x7884('0x10')]())[_0x7884('0xa')](mailQueue[_0x7884('0x11')]())[_0x7884('0xa')](realtime['initMailQueues']())[_0x7884('0xa')](faxQueue[_0x7884('0x12')]())[_0x7884('0xa')](realtime[_0x7884('0x13')]())['then'](whatsappQueue[_0x7884('0x14')]())[_0x7884('0xa')](realtime[_0x7884('0x15')]())['then'](function(){return realtime;});}function main(){return server[_0x7884('0x16')](realtime)[_0x7884('0xa')](function(_0x35c48c){return initRealtime();})['then'](function(_0x4cb561){return setInterval(initRealtime,0x1388);})[_0x7884('0x17')](function(_0x15d66a){console[_0x7884('0x18')](_0x15d66a);});}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 b636529..72eec4b 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 _0x814b=['init','parse','map','object','lodash','util','events','EventEmitter','isNil','register','ignoreFactChanges','inherits','prototype','rules','isArray','concat','isObject','push','sync','filter','activeRules','orderBy','asc','execute','result','clone','name','ruleRef','call','next','isEqual','nextTick','restart','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','consequence','fromJSON'];(function(_0x5070a4,_0x1db896){var _0x179668=function(_0x43b757){while(--_0x43b757){_0x5070a4['push'](_0x5070a4['shift']());}};_0x179668(++_0x1db896);}(_0x814b,0x1a2));var _0xb814=function(_0x1a9390,_0x3339e6){_0x1a9390=_0x1a9390-0x0;var _0x2b4514=_0x814b[_0x1a9390];return _0x2b4514;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var EventEmitter=require(_0xb814('0x2'))[_0xb814('0x3')];function RuleEngine(_0xfbb64b,_0x477725){this['init']();if(!_[_0xb814('0x4')](_0xfbb64b)){this[_0xb814('0x5')](_0xfbb64b);}if(_0x477725){this[_0xb814('0x6')]=_0x477725[_0xb814('0x6')];}return this;}util[_0xb814('0x7')](RuleEngine,EventEmitter);RuleEngine[_0xb814('0x8')]['init']=function(_0x3b0829){this[_0xb814('0x9')]=[];this['activeRules']=[];};RuleEngine[_0xb814('0x8')][_0xb814('0x5')]=function(_0x186d5a){if(Array[_0xb814('0xa')](_0x186d5a)){this[_0xb814('0x9')]=this[_0xb814('0x9')][_0xb814('0xb')](_0x186d5a);}else if(_0x186d5a!==null&&_[_0xb814('0xc')](_0x186d5a)){this[_0xb814('0x9')][_0xb814('0xd')](_0x186d5a);}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0xe')]=function(){this['activeRules']=this[_0xb814('0x9')][_0xb814('0xf')](function(_0x35b10d){if(_[_0xb814('0x4')](_0x35b10d['on'])){_0x35b10d['on']=!![];}if(_0x35b10d['on']===!![]){return _0x35b10d;}});this[_0xb814('0x10')]=_[_0xb814('0x11')](this[_0xb814('0x10')],['p'],[_0xb814('0x12')]);};RuleEngine[_0xb814('0x8')][_0xb814('0x13')]=function(_0x3f4881,_0x44fb96){var _0x17f5bd=![];_0x3f4881[_0xb814('0x14')]=!![];var _0x303aca=_[_0xb814('0x15')](_0x3f4881);var _0x45e0d0=_[_0xb814('0x15')](_0x3f4881);var _0x125ce2=this[_0xb814('0x10')];var _0x7a21ef=[];var _0x48c9df=this[_0xb814('0x6')];(function FnRuleLoop(_0x55ba16){var _0x270598={'rules':function(){return _0x125ce2;},'rule':function(){return _0x125ce2[_0x55ba16];},'when':function(_0xfac75b){if(_0xfac75b){var _0x4c3007=_0x125ce2[_0x55ba16]['consequence'];_0x4c3007['ruleRef']=_0x125ce2[_0x55ba16]['id']||_0x125ce2[_0x55ba16][_0xb814('0x16')]||'index_'+_0x55ba16;process['nextTick'](function(){_0x7a21ef[_0xb814('0xd')](_0x4c3007[_0xb814('0x17')]);_0x4c3007[_0xb814('0x18')](_0x303aca,_0x270598);});}else{process['nextTick'](function(){_0x270598[_0xb814('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x17f5bd=!![];return FnRuleLoop(0x0);},'next':function(_0x531032){if(!_0x48c9df&&!_[_0xb814('0x1a')](_0x45e0d0,_0x303aca)){_0x45e0d0=_[_0xb814('0x15')](_0x303aca);process[_0xb814('0x1b')](function(){_0x270598[_0xb814('0x1c')]();});}else{process[_0xb814('0x1b')](function(){if(_[_0xb814('0x4')](_0x531032)){return FnRuleLoop(_0x55ba16+0x1);}else{return FnRuleLoop(_0x531032);}});}}};if(_0x55ba16<_0x125ce2[_0xb814('0x1d')]&&_0x17f5bd===![]){var _0x594470=_0x125ce2[_0x55ba16][_0xb814('0x1e')];_0x594470['call'](_0x303aca,_0x270598);}else{process[_0xb814('0x1b')](function(){_0x303aca[_0xb814('0x1f')]=_0x7a21ef;return _0x44fb96?_0x44fb96(_0x303aca):_[_0xb814('0x20')]();});}}(0x0));};RuleEngine[_0xb814('0x8')][_0xb814('0x21')]=function(_0xb9e57d){if(_[_0xb814('0x4')](_0xb9e57d)){return this['rules'];}else{var _0x392222=_[_0xb814('0x22')](_0xb9e57d);return _[_0xb814('0xf')](this[_0xb814('0x9')],_0x392222);}};RuleEngine[_0xb814('0x8')][_0xb814('0x23')]=function(_0x3f0150,_0x1e4e89){var _0x5a6291=_0x3f0150==='on'||_0x3f0150==='ON'?!![]:![];var _0x271aa8=this[_0xb814('0x21')](_0x1e4e89);for(var _0x52ed64=0x0,_0x9008b2=_0x271aa8[_0xb814('0x1d')];_0x52ed64<_0x9008b2;_0x52ed64+=0x1){_0x271aa8[_0x52ed64]['on']=_0x5a6291;}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0x24')]=function(_0x2051d0,_0x58c3ca){_0x2051d0=parseInt(_0x2051d0,0xa);var _0x338a28=this['findRules'](_0x58c3ca);for(var _0x6efe9a=0x0,_0x5f3e9b=_0x338a28['length'];_0x6efe9a<_0x5f3e9b;_0x6efe9a+=0x1){_0x338a28[_0x6efe9a][_0xb814('0x25')]=_0x2051d0;}this['sync']();};RuleEngine[_0xb814('0x8')][_0xb814('0x26')]=function(){var _0x2b91bd=this['rules'];if(_0x2b91bd instanceof Array){_0x2b91bd=_0x2b91bd['map'](function(_0x26d3a9){_0x26d3a9[_0xb814('0x1e')]=_0x26d3a9['condition'][_0xb814('0x27')]();_0x26d3a9[_0xb814('0x28')]=_0x26d3a9[_0xb814('0x28')][_0xb814('0x27')]();return _0x26d3a9;});}else if(!_[_0xb814('0x4')](_0x2b91bd)){_0x2b91bd[_0xb814('0x1e')]=_0x2b91bd[_0xb814('0x1e')]['toString']();_0x2b91bd[_0xb814('0x28')]=_0x2b91bd[_0xb814('0x28')][_0xb814('0x27')]();}return _0x2b91bd;};RuleEngine[_0xb814('0x8')][_0xb814('0x29')]=function(_0x4ff31a){this[_0xb814('0x2a')]();if(_['isString'](_0x4ff31a)){_0x4ff31a=JSON[_0xb814('0x2b')](_0x4ff31a);}if(_0x4ff31a instanceof Array){_0x4ff31a=_0x4ff31a[_0xb814('0x2c')](function(_0xe0f509){_0xe0f509['condition']=eval('('+_0xe0f509[_0xb814('0x1e')]+')');_0xe0f509[_0xb814('0x28')]=eval('('+_0xe0f509['consequence']+')');return _0xe0f509;});}else if(_0x4ff31a!==null&&typeof _0x4ff31a==_0xb814('0x2d')){_0x4ff31a[_0xb814('0x1e')]=eval('('+_0x4ff31a[_0xb814('0x1e')]+')');_0x4ff31a[_0xb814('0x28')]=eval('('+_0x4ff31a[_0xb814('0x28')]+')');}this[_0xb814('0x5')](_0x4ff31a);};module['exports']=RuleEngine; \ No newline at end of file +var _0x1261=['isNil','register','ignoreFactChanges','activeRules','prototype','isArray','rules','concat','isObject','push','sync','filter','orderBy','asc','result','clone','name','nextTick','ruleRef','isEqual','restart','length','condition','noop','findRules','matches','turn','prioritize','priority','toString','consequence','fromJSON','isString','parse','map','object','exports','util','events','EventEmitter','init'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1261,0x144));var _0x1126=function(_0x1f37e1,_0x1b42ea){_0x1f37e1=_0x1f37e1-0x0;var _0x329f45=_0x1261[_0x1f37e1];return _0x329f45;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var EventEmitter=require(_0x1126('0x1'))[_0x1126('0x2')];function RuleEngine(_0x331a2c,_0x39b786){this[_0x1126('0x3')]();if(!_[_0x1126('0x4')](_0x331a2c)){this[_0x1126('0x5')](_0x331a2c);}if(_0x39b786){this[_0x1126('0x6')]=_0x39b786[_0x1126('0x6')];}return this;}util['inherits'](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x1126('0x3')]=function(_0x907180){this['rules']=[];this[_0x1126('0x7')]=[];};RuleEngine[_0x1126('0x8')][_0x1126('0x5')]=function(_0x3abb0b){if(Array[_0x1126('0x9')](_0x3abb0b)){this['rules']=this[_0x1126('0xa')][_0x1126('0xb')](_0x3abb0b);}else if(_0x3abb0b!==null&&_[_0x1126('0xc')](_0x3abb0b)){this['rules'][_0x1126('0xd')](_0x3abb0b);}this['sync']();};RuleEngine['prototype'][_0x1126('0xe')]=function(){this['activeRules']=this[_0x1126('0xa')][_0x1126('0xf')](function(_0xd26a32){if(_[_0x1126('0x4')](_0xd26a32['on'])){_0xd26a32['on']=!![];}if(_0xd26a32['on']===!![]){return _0xd26a32;}});this[_0x1126('0x7')]=_[_0x1126('0x10')](this[_0x1126('0x7')],['p'],[_0x1126('0x11')]);};RuleEngine[_0x1126('0x8')]['execute']=function(_0x5de9a7,_0x1af673){var _0x154e20=![];_0x5de9a7[_0x1126('0x12')]=!![];var _0x4be0c6=_[_0x1126('0x13')](_0x5de9a7);var _0x4794a7=_[_0x1126('0x13')](_0x5de9a7);var _0x42f379=this[_0x1126('0x7')];var _0x4e1c97=[];var _0x245cd7=this[_0x1126('0x6')];(function FnRuleLoop(_0x4a7b49){var _0x4d2b38={'rules':function(){return _0x42f379;},'rule':function(){return _0x42f379[_0x4a7b49];},'when':function(_0x22ae0b){if(_0x22ae0b){var _0x2b2487=_0x42f379[_0x4a7b49]['consequence'];_0x2b2487['ruleRef']=_0x42f379[_0x4a7b49]['id']||_0x42f379[_0x4a7b49][_0x1126('0x14')]||'index_'+_0x4a7b49;process[_0x1126('0x15')](function(){_0x4e1c97[_0x1126('0xd')](_0x2b2487[_0x1126('0x16')]);_0x2b2487['call'](_0x4be0c6,_0x4d2b38);});}else{process[_0x1126('0x15')](function(){_0x4d2b38['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x154e20=!![];return FnRuleLoop(0x0);},'next':function(_0x56efeb){if(!_0x245cd7&&!_[_0x1126('0x17')](_0x4794a7,_0x4be0c6)){_0x4794a7=_[_0x1126('0x13')](_0x4be0c6);process[_0x1126('0x15')](function(){_0x4d2b38[_0x1126('0x18')]();});}else{process['nextTick'](function(){if(_[_0x1126('0x4')](_0x56efeb)){return FnRuleLoop(_0x4a7b49+0x1);}else{return FnRuleLoop(_0x56efeb);}});}}};if(_0x4a7b49<_0x42f379[_0x1126('0x19')]&&_0x154e20===![]){var _0x48a08d=_0x42f379[_0x4a7b49][_0x1126('0x1a')];_0x48a08d['call'](_0x4be0c6,_0x4d2b38);}else{process['nextTick'](function(){_0x4be0c6['matchPath']=_0x4e1c97;return _0x1af673?_0x1af673(_0x4be0c6):_[_0x1126('0x1b')]();});}}(0x0));};RuleEngine[_0x1126('0x8')][_0x1126('0x1c')]=function(_0x34bcf1){if(_[_0x1126('0x4')](_0x34bcf1)){return this[_0x1126('0xa')];}else{var _0xea0971=_[_0x1126('0x1d')](_0x34bcf1);return _['filter'](this[_0x1126('0xa')],_0xea0971);}};RuleEngine[_0x1126('0x8')][_0x1126('0x1e')]=function(_0x5ddf63,_0x541bc9){var _0xeb7d89=_0x5ddf63==='on'||_0x5ddf63==='ON'?!![]:![];var _0x39bf0e=this['findRules'](_0x541bc9);for(var _0x2fb797=0x0,_0x23d2bc=_0x39bf0e['length'];_0x2fb797<_0x23d2bc;_0x2fb797+=0x1){_0x39bf0e[_0x2fb797]['on']=_0xeb7d89;}this[_0x1126('0xe')]();};RuleEngine['prototype'][_0x1126('0x1f')]=function(_0x4bd50b,_0x771bb8){_0x4bd50b=parseInt(_0x4bd50b,0xa);var _0x583ce6=this[_0x1126('0x1c')](_0x771bb8);for(var _0x5f2611=0x0,_0x5252e0=_0x583ce6['length'];_0x5f2611<_0x5252e0;_0x5f2611+=0x1){_0x583ce6[_0x5f2611][_0x1126('0x20')]=_0x4bd50b;}this[_0x1126('0xe')]();};RuleEngine[_0x1126('0x8')]['toJSON']=function(){var _0x2a3055=this[_0x1126('0xa')];if(_0x2a3055 instanceof Array){_0x2a3055=_0x2a3055['map'](function(_0x3dd50e){_0x3dd50e[_0x1126('0x1a')]=_0x3dd50e[_0x1126('0x1a')][_0x1126('0x21')]();_0x3dd50e['consequence']=_0x3dd50e['consequence'][_0x1126('0x21')]();return _0x3dd50e;});}else if(!_[_0x1126('0x4')](_0x2a3055)){_0x2a3055[_0x1126('0x1a')]=_0x2a3055[_0x1126('0x1a')]['toString']();_0x2a3055[_0x1126('0x22')]=_0x2a3055[_0x1126('0x22')][_0x1126('0x21')]();}return _0x2a3055;};RuleEngine[_0x1126('0x8')][_0x1126('0x23')]=function(_0x5df232){this[_0x1126('0x3')]();if(_[_0x1126('0x24')](_0x5df232)){_0x5df232=JSON[_0x1126('0x25')](_0x5df232);}if(_0x5df232 instanceof Array){_0x5df232=_0x5df232[_0x1126('0x26')](function(_0x5c019d){_0x5c019d['condition']=eval('('+_0x5c019d[_0x1126('0x1a')]+')');_0x5c019d[_0x1126('0x22')]=eval('('+_0x5c019d['consequence']+')');return _0x5c019d;});}else if(_0x5df232!==null&&typeof _0x5df232==_0x1126('0x27')){_0x5df232[_0x1126('0x1a')]=eval('('+_0x5df232[_0x1126('0x1a')]+')');_0x5df232['consequence']=eval('('+_0x5df232['consequence']+')');}this[_0x1126('0x5')](_0x5df232);};module[_0x1126('0x28')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index d8dc6d4..8e5b28b 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 _0x3478=['client','http','request','error','message','result','catch','bluebird'];(function(_0x1ec83e,_0x345ca4){var _0x4719a7=function(_0x57a98a){while(--_0x57a98a){_0x1ec83e['push'](_0x1ec83e['shift']());}};_0x4719a7(++_0x345ca4);}(_0x3478,0x117));var _0x8347=function(_0x43d06a,_0x2d46b6){_0x43d06a=_0x43d06a-0x0;var _0x4bd34f=_0x3478[_0x43d06a];return _0x4bd34f;};'use strict';var BPromise=require(_0x8347('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x8347('0x1')][_0x8347('0x2')]({'port':0x232b});function request(_0x242ce3,_0x49eb5f){return new BPromise(function(_0x2a1355,_0x171a5a){return client[_0x8347('0x3')](_0x242ce3,_0x49eb5f)['then'](function(_0x32d00d){if(_0x32d00d[_0x8347('0x4')]){return _0x171a5a(_0x32d00d[_0x8347('0x4')][_0x8347('0x5')]);}else{return _0x2a1355(_0x32d00d[_0x8347('0x6')]);}})[_0x8347('0x7')](function(_0x4df5ab){return _0x171a5a(_0x4df5ab);});});}exports['sendMailMessage']=function(_0x3fdb3a,_0x244d0d){return request('SendMail',{'account':_0x3fdb3a,'message':_0x244d0d});}; \ No newline at end of file +var _0x563b=['client','http','then','error','message','result','sendMailMessage','bluebird'];(function(_0x560924,_0x258a47){var _0x5c694d=function(_0x599a81){while(--_0x599a81){_0x560924['push'](_0x560924['shift']());}};_0x5c694d(++_0x258a47);}(_0x563b,0xef));var _0xb563=function(_0x4360dd,_0x106782){_0x4360dd=_0x4360dd-0x0;var _0x5b1a0e=_0x563b[_0x4360dd];return _0x5b1a0e;};'use strict';var BPromise=require(_0xb563('0x0'));var jayson=require('jayson/promise');var client=jayson[_0xb563('0x1')][_0xb563('0x2')]({'port':0x232b});function request(_0x59f18a,_0x540ff){return new BPromise(function(_0x14cf26,_0x362cb0){return client['request'](_0x59f18a,_0x540ff)[_0xb563('0x3')](function(_0x43c597){if(_0x43c597[_0xb563('0x4')]){return _0x362cb0(_0x43c597[_0xb563('0x4')][_0xb563('0x5')]);}else{return _0x14cf26(_0x43c597[_0xb563('0x6')]);}})['catch'](function(_0x2c3ecf){return _0x362cb0(_0x2c3ecf);});});}exports[_0xb563('0x7')]=function(_0x16968e,_0x533e60){return request('SendMail',{'account':_0x16968e,'message':_0x533e60});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index e07b4c2..b3c3ffc 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 _0x1394=['moment','md5','../../../config/environment','defaults','redis','socket.io-emitter','name','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','mailStatusTime','mailCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','busy','busyQueue','prototype','getChannelStatus','Capacity','CurrentCapacity','maxcapacity','idle','updateRealtime','mail','chat','fax','sms','whatsapp','Status','StatusTime','format','online','chatCurrentCapacity','mailStatus','mailCurrentCapacity','openchannelCurrentCapacity','stringify','emit','user:save','lodash'];(function(_0x423efe,_0x16497d){var _0x1466b8=function(_0x153100){while(--_0x153100){_0x423efe['push'](_0x423efe['shift']());}};_0x1466b8(++_0x16497d);}(_0x1394,0xb3));var _0x4139=function(_0x55b6a6,_0x1f6235){_0x55b6a6=_0x55b6a6-0x0;var _0x4d7974=_0x1394[_0x55b6a6];return _0x4d7974;};'use strict';var _=require(_0x4139('0x0'));var moment=require(_0x4139('0x1'));var md5=require(_0x4139('0x2'));var Redis=require('ioredis');var config=require(_0x4139('0x3'));config['redis']=_[_0x4139('0x4')](config[_0x4139('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x4139('0x6'))(new Redis(config['redis']));function Agent(_0x1962f2){this['id']=_0x1962f2['id']||0x0;this[_0x4139('0x7')]=_0x1962f2[_0x4139('0x7')]||'';this['online']=_0x1962f2['online']||!![];this['voicePause']=_0x1962f2[_0x4139('0x8')]||![];this[_0x4139('0x9')]=_0x1962f2[_0x4139('0x9')]||![];this[_0x4139('0xa')]=_0x1962f2[_0x4139('0xa')]||![];this[_0x4139('0xb')]=_0x1962f2[_0x4139('0xb')]||![];this[_0x4139('0xc')]=_0x1962f2['smsPause']||![];this[_0x4139('0xd')]=_0x1962f2[_0x4139('0xd')]||![];this[_0x4139('0xe')]=_0x4139('0xf');this[_0x4139('0x10')]=0x0;this[_0x4139('0x11')]=_0x1962f2[_0x4139('0x11')]||0x0;this['chatCurrentCapacity']=0x0;this['mailStatus']=_0x4139('0xf');this[_0x4139('0x12')]=0x0;this[_0x4139('0x13')]=_0x1962f2[_0x4139('0x13')]||0x0;this['mailCurrentCapacity']=0x0;this[_0x4139('0x14')]=_0x4139('0xf');this[_0x4139('0x15')]=0x0;this['faxCapacity']=_0x1962f2[_0x4139('0x16')]||0x0;this[_0x4139('0x17')]=0x0;this[_0x4139('0x18')]='unknown';this[_0x4139('0x19')]=0x0;this[_0x4139('0x1a')]=_0x1962f2[_0x4139('0x1a')]||0x0;this[_0x4139('0x1b')]=0x0;this[_0x4139('0x1c')]=_0x4139('0xf');this[_0x4139('0x1d')]=0x0;this[_0x4139('0x1e')]=_0x1962f2[_0x4139('0x1e')]||0x0;this[_0x4139('0x1f')]=0x0;this[_0x4139('0x20')]=_0x4139('0xf');this[_0x4139('0x21')]=0x0;this[_0x4139('0x22')]=_0x1962f2[_0x4139('0x22')]||0x0;this['openchannelCurrentCapacity']=0x0;this[_0x4139('0x23')]=![];this[_0x4139('0x24')]=undefined;this[_0x4139('0x2')]='';this['updateRealtime']();}Agent[_0x4139('0x25')][_0x4139('0x26')]=function(_0x32baba){if(this[_0x32baba+'CurrentCapacity']>0x0){if(this[_0x32baba+_0x4139('0x27')]>0x0&&this[_0x32baba+_0x4139('0x28')]>=this[_0x32baba+'Capacity']){return _0x4139('0x29');}else{return'working';}}else{return _0x4139('0x2a');}};Agent[_0x4139('0x25')][_0x4139('0x2b')]=function(){var _0x4fdcf2=[_0x4139('0x2c'),_0x4139('0x2d'),'openchannel',_0x4139('0x2e'),_0x4139('0x2f'),_0x4139('0x30')];for(var _0x157965=0x0;_0x157965<_0x4fdcf2['length'];_0x157965+=0x1){var _0x23376e=this[_0x4139('0x26')](_0x4fdcf2[_0x157965]);if(this[_0x4fdcf2[_0x157965]+_0x4139('0x31')]!==_0x23376e){this[_0x4fdcf2[_0x157965]+_0x4139('0x32')]=_['toNumber'](moment()[_0x4139('0x33')]('x'));}this[_0x4fdcf2[_0x157965]+_0x4139('0x31')]=_0x23376e;}var _0x16fd4e={'id':this['id'],'name':this[_0x4139('0x7')],'online':this[_0x4139('0x34')],'voicePause':this['voicePause'],'chatPause':this[_0x4139('0x9')],'mailPause':this['mailPause'],'smsPause':this['smsPause'],'faxPause':this[_0x4139('0xb')],'openchannelPause':this[_0x4139('0xd')],'chatStatus':this[_0x4139('0xe')],'chatStatusTime':this[_0x4139('0x10')],'chatCapacity':this[_0x4139('0x11')],'chatCurrentCapacity':this[_0x4139('0x35')],'mailStatus':this[_0x4139('0x36')],'mailStatusTime':this[_0x4139('0x12')],'mailCapacity':this[_0x4139('0x13')],'mailCurrentCapacity':this[_0x4139('0x37')],'faxStatus':this[_0x4139('0x14')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x4139('0x17')],'smsStatus':this[_0x4139('0x18')],'smsStatusTime':this[_0x4139('0x19')],'smsCapacity':this[_0x4139('0x1a')],'smsCurrentCapacity':this[_0x4139('0x1b')],'whatsappStatus':this[_0x4139('0x1c')],'whatsappStatusTime':this[_0x4139('0x1d')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0x4139('0x20')],'openchannelStatusTime':this[_0x4139('0x21')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0x4139('0x38')],'busy':this[_0x4139('0x23')],'busyQueue':this[_0x4139('0x24')]};var _0x51d6d4=md5(JSON[_0x4139('0x39')](_0x16fd4e));if(this[_0x4139('0x2')]!==_0x51d6d4){this[_0x4139('0x2')]=_0x51d6d4;io[_0x4139('0x3a')](_0x4139('0x3b'),_0x16fd4e);}};module['exports']=Agent; \ No newline at end of file +var _0x305b=['chatStatus','chatStatusTime','smsStatus','whatsappStatus','whatsappStatusTime','stringify','emit','user:save','exports','lodash','moment','md5','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','online','chatPause','mailPause','faxPause','smsPause','unknown','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','updateRealtime','prototype','Capacity','CurrentCapacity','maxcapacity','idle','mail','chat','openchannel','fax','length','StatusTime','format','Status','voicePause'];(function(_0xb7ed6,_0x560630){var _0x45e73d=function(_0x184bad){while(--_0x184bad){_0xb7ed6['push'](_0xb7ed6['shift']());}};_0x45e73d(++_0x560630);}(_0x305b,0x81));var _0xb305=function(_0xd2d54,_0x5329f7){_0xd2d54=_0xd2d54-0x0;var _0x78b113=_0x305b[_0xd2d54];return _0x78b113;};'use strict';var _=require(_0xb305('0x0'));var moment=require(_0xb305('0x1'));var md5=require(_0xb305('0x2'));var Redis=require('ioredis');var config=require(_0xb305('0x3'));config[_0xb305('0x4')]=_[_0xb305('0x5')](config[_0xb305('0x4')],{'host':_0xb305('0x6'),'port':0x18eb});var io=require(_0xb305('0x7'))(new Redis(config[_0xb305('0x4')]));function Agent(_0x2deaee){this['id']=_0x2deaee['id']||0x0;this[_0xb305('0x8')]=_0x2deaee[_0xb305('0x8')]||'';this[_0xb305('0x9')]=_0x2deaee[_0xb305('0x9')]||!![];this['voicePause']=_0x2deaee['voicePause']||![];this[_0xb305('0xa')]=_0x2deaee['chatPause']||![];this[_0xb305('0xb')]=_0x2deaee[_0xb305('0xb')]||![];this[_0xb305('0xc')]=_0x2deaee[_0xb305('0xc')]||![];this[_0xb305('0xd')]=_0x2deaee['smsPause']||![];this['openchannelPause']=_0x2deaee['openchannelPause']||![];this['chatStatus']=_0xb305('0xe');this['chatStatusTime']=0x0;this[_0xb305('0xf')]=_0x2deaee[_0xb305('0xf')]||0x0;this[_0xb305('0x10')]=0x0;this[_0xb305('0x11')]=_0xb305('0xe');this[_0xb305('0x12')]=0x0;this[_0xb305('0x13')]=_0x2deaee[_0xb305('0x13')]||0x0;this[_0xb305('0x14')]=0x0;this[_0xb305('0x15')]='unknown';this[_0xb305('0x16')]=0x0;this[_0xb305('0x17')]=_0x2deaee['faxCapacity']||0x0;this[_0xb305('0x18')]=0x0;this['smsStatus']='unknown';this[_0xb305('0x19')]=0x0;this[_0xb305('0x1a')]=_0x2deaee[_0xb305('0x1a')]||0x0;this[_0xb305('0x1b')]=0x0;this['whatsappStatus']='unknown';this['whatsappStatusTime']=0x0;this[_0xb305('0x1c')]=_0x2deaee['whatsappCapacity']||0x0;this[_0xb305('0x1d')]=0x0;this[_0xb305('0x1e')]=_0xb305('0xe');this[_0xb305('0x1f')]=0x0;this[_0xb305('0x20')]=_0x2deaee[_0xb305('0x20')]||0x0;this[_0xb305('0x21')]=0x0;this[_0xb305('0x22')]=![];this[_0xb305('0x23')]=undefined;this[_0xb305('0x2')]='';this[_0xb305('0x24')]();}Agent[_0xb305('0x25')]['getChannelStatus']=function(_0x30b1e6){if(this[_0x30b1e6+'CurrentCapacity']>0x0){if(this[_0x30b1e6+_0xb305('0x26')]>0x0&&this[_0x30b1e6+_0xb305('0x27')]>=this[_0x30b1e6+_0xb305('0x26')]){return _0xb305('0x28');}else{return'working';}}else{return _0xb305('0x29');}};Agent[_0xb305('0x25')][_0xb305('0x24')]=function(){var _0x15809f=[_0xb305('0x2a'),_0xb305('0x2b'),_0xb305('0x2c'),_0xb305('0x2d'),'sms','whatsapp'];for(var _0x2b2535=0x0;_0x2b2535<_0x15809f[_0xb305('0x2e')];_0x2b2535+=0x1){var _0x4be5d9=this['getChannelStatus'](_0x15809f[_0x2b2535]);if(this[_0x15809f[_0x2b2535]+'Status']!==_0x4be5d9){this[_0x15809f[_0x2b2535]+_0xb305('0x2f')]=_['toNumber'](moment()[_0xb305('0x30')]('x'));}this[_0x15809f[_0x2b2535]+_0xb305('0x31')]=_0x4be5d9;}var _0x4938d2={'id':this['id'],'name':this['name'],'online':this[_0xb305('0x9')],'voicePause':this[_0xb305('0x32')],'chatPause':this[_0xb305('0xa')],'mailPause':this[_0xb305('0xb')],'smsPause':this[_0xb305('0xd')],'faxPause':this[_0xb305('0xc')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0xb305('0x33')],'chatStatusTime':this[_0xb305('0x34')],'chatCapacity':this[_0xb305('0xf')],'chatCurrentCapacity':this[_0xb305('0x10')],'mailStatus':this[_0xb305('0x11')],'mailStatusTime':this[_0xb305('0x12')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0xb305('0x14')],'faxStatus':this[_0xb305('0x15')],'faxStatusTime':this[_0xb305('0x16')],'faxCapacity':this[_0xb305('0x17')],'faxCurrentCapacity':this[_0xb305('0x18')],'smsStatus':this[_0xb305('0x35')],'smsStatusTime':this[_0xb305('0x19')],'smsCapacity':this[_0xb305('0x1a')],'smsCurrentCapacity':this[_0xb305('0x1b')],'whatsappStatus':this[_0xb305('0x36')],'whatsappStatusTime':this[_0xb305('0x37')],'whatsappCapacity':this[_0xb305('0x1c')],'whatsappCurrentCapacity':this[_0xb305('0x1d')],'openchannelStatus':this[_0xb305('0x1e')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0xb305('0x20')],'openchannelCurrentCapacity':this[_0xb305('0x21')],'busy':this[_0xb305('0x22')],'busyQueue':this['busyQueue']};var _0x1f4abd=md5(JSON[_0xb305('0x38')](_0x4938d2));if(this[_0xb305('0x2')]!==_0x1f4abd){this[_0xb305('0x2')]=_0x1f4abd;io[_0xb305('0x39')](_0xb305('0x3a'),_0x4938d2);}};module[_0xb305('0x3b')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 72c9774..78fb749 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 _0x8677=['Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','loggedIn','paused','length','online','chatPause','available','stringify','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','beepall'];(function(_0x26d42e,_0x123573){var _0x39ae3a=function(_0x1f65cf){while(--_0x1f65cf){_0x26d42e['push'](_0x26d42e['shift']());}};_0x39ae3a(++_0x123573);}(_0x8677,0x1d1));var _0x7867=function(_0xa674e,_0x4a7e6e){_0xa674e=_0xa674e-0x0;var _0x1e61be=_0x8677[_0xa674e];return _0x1e61be;};'use strict';var _=require(_0x7867('0x0'));var md5=require(_0x7867('0x1'));var util=require('util');var Redis=require(_0x7867('0x2'));var config=require(_0x7867('0x3'));config[_0x7867('0x4')]=_[_0x7867('0x5')](config[_0x7867('0x4')],{'host':_0x7867('0x6'),'port':0x18eb});var io=require(_0x7867('0x7'))(new Redis(config[_0x7867('0x4')]));function ChatQueue(_0x126de7){this['id']=_0x126de7['id']||0x0;this[_0x7867('0x8')]=_0x126de7[_0x7867('0x8')]||'';this[_0x7867('0x9')]=_0x126de7[_0x7867('0x9')]||0xa;this['strategy']=_0x126de7['strategy']||_0x7867('0xa');this[_0x7867('0xb')]=_0x126de7['Agents'];this[_0x7867('0xc')]={};this[_0x7867('0xd')]=0x0;this[_0x7867('0x1')]='';this[_0x7867('0xe')]();this[_0x7867('0xf')]();}ChatQueue['prototype'][_0x7867('0xe')]=function(){var _0x337155=this[_0x7867('0xc')][_0x7867('0x10')];this['mapAgentsId']=_['map'](this[_0x7867('0xb')],'id');this[_0x7867('0xc')][_0x7867('0x10')]=_0x337155;};ChatQueue['prototype']['updateRealtime']=function(){this[_0x7867('0x11')]=0x0;this[_0x7867('0x12')]=0x0;for(var _0x35080b=0x0;_0x35080b=0x0?this['available']:0x0;var _0x2ef8f5={'id':this['id'],'available':this[_0x7867('0x16')],'loggedIn':this[_0x7867('0x11')],'name':this[_0x7867('0x8')],'paused':this[_0x7867('0x12')],'waiting':this['waiting']};var _0x2d5fb5=md5(JSON[_0x7867('0x17')](_0x2ef8f5));if(this[_0x7867('0x1')]!==_0x2d5fb5){this[_0x7867('0x1')]=_0x2d5fb5;io['to'](util['format'](_0x7867('0x18'),_0x2ef8f5[_0x7867('0x8')]))[_0x7867('0x19')](_0x7867('0x1a'),_0x2ef8f5);}};module[_0x7867('0x1b')]=ChatQueue; \ No newline at end of file +var _0xefd4=['defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','online','paused','available','waiting','stringify','format','chat:queue:%s','chat_queue:save','lodash','md5','ioredis','../../../config/environment','redis'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xefd4,0x109));var _0x4efd=function(_0x5bcd0a,_0x2a552d){_0x5bcd0a=_0x5bcd0a-0x0;var _0x5293a6=_0xefd4[_0x5bcd0a];return _0x5293a6;};'use strict';var _=require(_0x4efd('0x0'));var md5=require(_0x4efd('0x1'));var util=require('util');var Redis=require(_0x4efd('0x2'));var config=require(_0x4efd('0x3'));config[_0x4efd('0x4')]=_[_0x4efd('0x5')](config[_0x4efd('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x4efd('0x6'))(new Redis(config[_0x4efd('0x4')]));function ChatQueue(_0x450589){this['id']=_0x450589['id']||0x0;this[_0x4efd('0x7')]=_0x450589[_0x4efd('0x7')]||'';this[_0x4efd('0x8')]=_0x450589['timeout']||0xa;this[_0x4efd('0x9')]=_0x450589[_0x4efd('0x9')]||_0x4efd('0xa');this['Agents']=_0x450589[_0x4efd('0xb')];this[_0x4efd('0xc')]={};this['waiting']=0x0;this[_0x4efd('0x1')]='';this[_0x4efd('0xd')]();this[_0x4efd('0xe')]();}ChatQueue[_0x4efd('0xf')][_0x4efd('0xd')]=function(){var _0x34b021=this[_0x4efd('0xc')][_0x4efd('0x10')];this['mapAgentsId']=_[_0x4efd('0x11')](this[_0x4efd('0xb')],'id');this['mapAgentsId']['_rr']=_0x34b021;};ChatQueue[_0x4efd('0xf')][_0x4efd('0xe')]=function(){this[_0x4efd('0x12')]=0x0;this['paused']=0x0;for(var _0x398d88=0x0;_0x398d88=0x0?this['available']:0x0;var _0x392561={'id':this['id'],'available':this[_0x4efd('0x15')],'loggedIn':this[_0x4efd('0x12')],'name':this['name'],'paused':this[_0x4efd('0x14')],'waiting':this[_0x4efd('0x16')]};var _0x43760b=md5(JSON[_0x4efd('0x17')](_0x392561));if(this[_0x4efd('0x1')]!==_0x43760b){this[_0x4efd('0x1')]=_0x43760b;io['to'](util[_0x4efd('0x18')](_0x4efd('0x19'),_0x392561[_0x4efd('0x7')]))['emit'](_0x4efd('0x1a'),_0x392561);}};module['exports']=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 16a52f4..277ba67 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 _0xaf40=['lodash','md5','util','ioredis','redis','localhost','name','timeout','strategy','beepall','Agents','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','paused','length','online','faxPause','available','stringify','format','fax:queue:%s','emit'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0xaf40,0x17a));var _0x0af4=function(_0xf279de,_0x3b2059){_0xf279de=_0xf279de-0x0;var _0x288491=_0xaf40[_0xf279de];return _0x288491;};'use strict';var _=require(_0x0af4('0x0'));var md5=require(_0x0af4('0x1'));var util=require(_0x0af4('0x2'));var Redis=require(_0x0af4('0x3'));var config=require('../../../config/environment');config[_0x0af4('0x4')]=_['defaults'](config[_0x0af4('0x4')],{'host':_0x0af4('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0af4('0x4')]));function FaxQueue(_0x39a958){this['id']=_0x39a958['id']||0x0;this[_0x0af4('0x6')]=_0x39a958[_0x0af4('0x6')]||'';this['timeout']=_0x39a958[_0x0af4('0x7')]||0xa;this[_0x0af4('0x8')]=_0x39a958['strategy']||_0x0af4('0x9');this['Agents']=_0x39a958[_0x0af4('0xa')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x0af4('0x1')]='';this[_0x0af4('0xb')]();this[_0x0af4('0xc')]();}FaxQueue[_0x0af4('0xd')]['updateRouting']=function(){var _0x3b62f6=this[_0x0af4('0xe')][_0x0af4('0xf')];this[_0x0af4('0xe')]=_[_0x0af4('0x10')](this[_0x0af4('0xa')],'id');this[_0x0af4('0xe')][_0x0af4('0xf')]=_0x3b62f6;};FaxQueue[_0x0af4('0xd')][_0x0af4('0xc')]=function(){this[_0x0af4('0x11')]=0x0;this[_0x0af4('0x12')]=0x0;for(var _0x1c4ce5=0x0;_0x1c4ce5=0x0?this[_0x0af4('0x16')]:0x0;var _0x348a6f={'id':this['id'],'available':this['available'],'loggedIn':this[_0x0af4('0x11')],'name':this[_0x0af4('0x6')],'paused':this[_0x0af4('0x12')],'waiting':this['waiting']};var _0x1775a5=md5(JSON[_0x0af4('0x17')](_0x348a6f));if(this[_0x0af4('0x1')]!==_0x1775a5){this[_0x0af4('0x1')]=_0x1775a5;io['to'](util[_0x0af4('0x18')](_0x0af4('0x19'),_0x348a6f[_0x0af4('0x6')]))[_0x0af4('0x1a')]('fax_queue:save',_0x348a6f);}};module['exports']=FaxQueue; \ No newline at end of file +var _0x8261=['redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','map','_rr','loggedIn','length','paused','available','stringify','format','fax:queue:%s','fax_queue:save','lodash','../../../config/environment'];(function(_0x4787f4,_0xcea063){var _0x3ddcb1=function(_0x1b5d29){while(--_0x1b5d29){_0x4787f4['push'](_0x4787f4['shift']());}};_0x3ddcb1(++_0xcea063);}(_0x8261,0x129));var _0x1826=function(_0x5da729,_0x4987f2){_0x5da729=_0x5da729-0x0;var _0x59d938=_0x8261[_0x5da729];return _0x59d938;};'use strict';var _=require(_0x1826('0x0'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var config=require(_0x1826('0x1'));config[_0x1826('0x2')]=_['defaults'](config[_0x1826('0x2')],{'host':'localhost','port':0x18eb});var io=require(_0x1826('0x3'))(new Redis(config[_0x1826('0x2')]));function FaxQueue(_0x27da6a){this['id']=_0x27da6a['id']||0x0;this['name']=_0x27da6a[_0x1826('0x4')]||'';this[_0x1826('0x5')]=_0x27da6a[_0x1826('0x5')]||0xa;this[_0x1826('0x6')]=_0x27da6a[_0x1826('0x6')]||_0x1826('0x7');this[_0x1826('0x8')]=_0x27da6a[_0x1826('0x8')];this[_0x1826('0x9')]={};this[_0x1826('0xa')]=0x0;this['md5']='';this['updateRouting']();this[_0x1826('0xb')]();}FaxQueue[_0x1826('0xc')]['updateRouting']=function(){var _0x3c79e5=this[_0x1826('0x9')]['_rr'];this['mapAgentsId']=_[_0x1826('0xd')](this[_0x1826('0x8')],'id');this['mapAgentsId'][_0x1826('0xe')]=_0x3c79e5;};FaxQueue['prototype'][_0x1826('0xb')]=function(){this[_0x1826('0xf')]=0x0;this['paused']=0x0;for(var _0x4b77c1=0x0;_0x4b77c1=0x0?this[_0x1826('0x12')]:0x0;var _0x24c8e4={'id':this['id'],'available':this[_0x1826('0x12')],'loggedIn':this[_0x1826('0xf')],'name':this[_0x1826('0x4')],'paused':this[_0x1826('0x11')],'waiting':this[_0x1826('0xa')]};var _0x2d51bf=md5(JSON[_0x1826('0x13')](_0x24c8e4));if(this['md5']!==_0x2d51bf){this['md5']=_0x2d51bf;io['to'](util[_0x1826('0x14')](_0x1826('0x15'),_0x24c8e4[_0x1826('0x4')]))['emit'](_0x1826('0x16'),_0x24c8e4);}};module['exports']=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index e1ed8e3..cc82047 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 _0xa8f4=['exports','name','Intervals'];(function(_0x440355,_0x4d3219){var _0x40171a=function(_0x1aefa0){while(--_0x1aefa0){_0x440355['push'](_0x440355['shift']());}};_0x40171a(++_0x4d3219);}(_0xa8f4,0x148));var _0x4a8f=function(_0x2fd483,_0x5a7953){_0x2fd483=_0x2fd483-0x0;var _0x22b79c=_0xa8f4[_0x2fd483];return _0x22b79c;};'use strict';function Interval(_0xb602bb){this['id']=_0xb602bb['id']||0x0;this[_0x4a8f('0x0')]=_0xb602bb[_0x4a8f('0x0')]||'';this['Intervals']=_0xb602bb[_0x4a8f('0x1')]||{};}module[_0x4a8f('0x2')]=Interval; \ No newline at end of file +var _0x2d19=['exports','name','Intervals'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x2d19,0xc4));var _0x92d1=function(_0x1139d0,_0x41e5f8){_0x1139d0=_0x1139d0-0x0;var _0xcc01a6=_0x2d19[_0x1139d0];return _0xcc01a6;};'use strict';function Interval(_0x461149){this['id']=_0x461149['id']||0x0;this[_0x92d1('0x0')]=_0x461149[_0x92d1('0x0')]||'';this[_0x92d1('0x1')]=_0x461149[_0x92d1('0x1')]||{};}module[_0x92d1('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 bf2366c..0390a6d 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 _0xe6ba=['../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRealtime','_rr','mapAgentsId','map','prototype','loggedIn','length','online','mailPause','paused','available','stringify','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','util','ioredis'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0xe6ba,0x1ec));var _0xae6b=function(_0x10322d,_0x179761){_0x10322d=_0x10322d-0x0;var _0x3ce975=_0xe6ba[_0x10322d];return _0x3ce975;};'use strict';var _=require(_0xae6b('0x0'));var md5=require(_0xae6b('0x1'));var util=require(_0xae6b('0x2'));var Redis=require(_0xae6b('0x3'));var config=require(_0xae6b('0x4'));config[_0xae6b('0x5')]=_[_0xae6b('0x6')](config[_0xae6b('0x5')],{'host':_0xae6b('0x7'),'port':0x18eb});var io=require(_0xae6b('0x8'))(new Redis(config[_0xae6b('0x5')]));function MailQueue(_0x31819a){this['id']=_0x31819a['id']||0x0;this[_0xae6b('0x9')]=_0x31819a[_0xae6b('0x9')]||'';this[_0xae6b('0xa')]=_0x31819a['timeout']||0xa;this[_0xae6b('0xb')]=_0x31819a['strategy']||_0xae6b('0xc');this[_0xae6b('0xd')]=_0x31819a[_0xae6b('0xd')];this['mapAgentsId']={};this[_0xae6b('0xe')]=0x0;this[_0xae6b('0x1')]='';this['updateRouting']();this[_0xae6b('0xf')]();}MailQueue['prototype']['updateRouting']=function(){var _0x3da4ad=this['mapAgentsId'][_0xae6b('0x10')];this[_0xae6b('0x11')]=_[_0xae6b('0x12')](this['Agents'],'id');this['mapAgentsId'][_0xae6b('0x10')]=_0x3da4ad;};MailQueue[_0xae6b('0x13')][_0xae6b('0xf')]=function(){this[_0xae6b('0x14')]=0x0;this['paused']=0x0;for(var _0x5e747a=0x0;_0x5e747a=0x0?this[_0xae6b('0x19')]:0x0;var _0x49dba1={'id':this['id'],'available':this['available'],'loggedIn':this[_0xae6b('0x14')],'name':this[_0xae6b('0x9')],'paused':this['paused'],'waiting':this[_0xae6b('0xe')]};var _0x5393dc=md5(JSON[_0xae6b('0x1a')](_0x49dba1));if(this[_0xae6b('0x1')]!==_0x5393dc){this[_0xae6b('0x1')]=_0x5393dc;io['to'](util['format'](_0xae6b('0x1b'),_0x49dba1[_0xae6b('0x9')]))[_0xae6b('0x1c')](_0xae6b('0x1d'),_0x49dba1);}};module[_0xae6b('0x1e')]=MailQueue; \ No newline at end of file +var _0x5143=['mail_queue:save','lodash','md5','util','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','online','mailPause','paused','available','stringify','format','emit'];(function(_0x2ed527,_0x248b7b){var _0x175a73=function(_0x2c5c1b){while(--_0x2c5c1b){_0x2ed527['push'](_0x2ed527['shift']());}};_0x175a73(++_0x248b7b);}(_0x5143,0x189));var _0x3514=function(_0x27528b,_0x3c6355){_0x27528b=_0x27528b-0x0;var _0x6321c5=_0x5143[_0x27528b];return _0x6321c5;};'use strict';var _=require(_0x3514('0x0'));var md5=require(_0x3514('0x1'));var util=require(_0x3514('0x2'));var Redis=require('ioredis');var config=require(_0x3514('0x3'));config[_0x3514('0x4')]=_[_0x3514('0x5')](config[_0x3514('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x3514('0x6'))(new Redis(config[_0x3514('0x4')]));function MailQueue(_0x3a4f38){this['id']=_0x3a4f38['id']||0x0;this[_0x3514('0x7')]=_0x3a4f38[_0x3514('0x7')]||'';this[_0x3514('0x8')]=_0x3a4f38[_0x3514('0x8')]||0xa;this['strategy']=_0x3a4f38[_0x3514('0x9')]||_0x3514('0xa');this['Agents']=_0x3a4f38[_0x3514('0xb')];this['mapAgentsId']={};this[_0x3514('0xc')]=0x0;this['md5']='';this[_0x3514('0xd')]();this[_0x3514('0xe')]();}MailQueue[_0x3514('0xf')][_0x3514('0xd')]=function(){var _0x5b6633=this[_0x3514('0x10')][_0x3514('0x11')];this['mapAgentsId']=_[_0x3514('0x12')](this[_0x3514('0xb')],'id');this[_0x3514('0x10')]['_rr']=_0x5b6633;};MailQueue[_0x3514('0xf')]['updateRealtime']=function(){this[_0x3514('0x13')]=0x0;this['paused']=0x0;for(var _0x1d641f=0x0;_0x1d641f=0x0?this['available']:0x0;var _0x90026e={'id':this['id'],'available':this['available'],'loggedIn':this[_0x3514('0x13')],'name':this[_0x3514('0x7')],'paused':this[_0x3514('0x16')],'waiting':this[_0x3514('0xc')]};var _0x336b3c=md5(JSON[_0x3514('0x18')](_0x90026e));if(this[_0x3514('0x1')]!==_0x336b3c){this[_0x3514('0x1')]=_0x336b3c;io['to'](util[_0x3514('0x19')]('mail:queue:%s',_0x90026e['name']))[_0x3514('0x1a')](_0x3514('0x1b'),_0x90026e);}};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 9cb9362..d8eff34 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(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xc4aa[_0x4ff09b];return _0x3f5c2e;};'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 _0x1261=['available','stringify','openchannel:queue:%s','openchannel_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','mapAgentsId','map','_rr','updateRealtime','loggedIn','paused','length','online'];(function(_0x419e17,_0x7fe78c){var _0x1f2044=function(_0x3723e6){while(--_0x3723e6){_0x419e17['push'](_0x419e17['shift']());}};_0x1f2044(++_0x7fe78c);}(_0x1261,0x144));var _0x1126=function(_0xe67e22,_0x547e07){_0xe67e22=_0xe67e22-0x0;var _0x39ff12=_0x1261[_0xe67e22];return _0x39ff12;};'use strict';var _=require('lodash');var md5=require(_0x1126('0x0'));var util=require(_0x1126('0x1'));var Redis=require(_0x1126('0x2'));var config=require(_0x1126('0x3'));config[_0x1126('0x4')]=_[_0x1126('0x5')](config[_0x1126('0x4')],{'host':_0x1126('0x6'),'port':0x18eb});var io=require(_0x1126('0x7'))(new Redis(config[_0x1126('0x4')]));function OpenchannelQueue(_0x5a2189){this['id']=_0x5a2189['id']||0x0;this['name']=_0x5a2189[_0x1126('0x8')]||'';this[_0x1126('0x9')]=_0x5a2189['timeout']||0xa;this[_0x1126('0xa')]=_0x5a2189[_0x1126('0xa')]||_0x1126('0xb');this[_0x1126('0xc')]=_0x5a2189[_0x1126('0xc')];this['mapAgentsId']={};this[_0x1126('0xd')]=0x0;this[_0x1126('0x0')]='';this[_0x1126('0xe')]();this['updateRealtime']();}OpenchannelQueue[_0x1126('0xf')]['updateRouting']=function(){var _0x52ef15=this[_0x1126('0x10')]['_rr'];this[_0x1126('0x10')]=_[_0x1126('0x11')](this[_0x1126('0xc')],'id');this[_0x1126('0x10')][_0x1126('0x12')]=_0x52ef15;};OpenchannelQueue[_0x1126('0xf')][_0x1126('0x13')]=function(){this[_0x1126('0x14')]=0x0;this[_0x1126('0x15')]=0x0;for(var _0x53a8f0=0x0;_0x53a8f0=0x0?this['available']:0x0;var _0x4d2b38={'id':this['id'],'available':this[_0x1126('0x18')],'loggedIn':this[_0x1126('0x14')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x1126('0xd')]};var _0x58b109=md5(JSON[_0x1126('0x19')](_0x4d2b38));if(this[_0x1126('0x0')]!==_0x58b109){this[_0x1126('0x0')]=_0x58b109;io['to'](util['format'](_0x1126('0x1a'),_0x4d2b38['name']))['emit'](_0x1126('0x1b'),_0x4d2b38);}};module[_0x1126('0x1c')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 0b2f89f..296ca52 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 _0x689c=['defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','md5','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','online','available','paused','stringify','emit','sms_queue:save','exports','util','ioredis','../../../config/environment','redis'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0x689c,0x9e));var _0xc689=function(_0x24806f,_0x427c85){_0x24806f=_0x24806f-0x0;var _0x1cc85d=_0x689c[_0x24806f];return _0x1cc85d;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0xc689('0x0'));var Redis=require(_0xc689('0x1'));var config=require(_0xc689('0x2'));config[_0xc689('0x3')]=_[_0xc689('0x4')](config[_0xc689('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0xc689('0x5'))(new Redis(config['redis']));function SmsQueue(_0x47aaf0){this['id']=_0x47aaf0['id']||0x0;this[_0xc689('0x6')]=_0x47aaf0[_0xc689('0x6')]||'';this[_0xc689('0x7')]=_0x47aaf0[_0xc689('0x7')]||0xa;this[_0xc689('0x8')]=_0x47aaf0['strategy']||_0xc689('0x9');this[_0xc689('0xa')]=_0x47aaf0[_0xc689('0xa')];this['mapAgentsId']={};this[_0xc689('0xb')]=0x0;this[_0xc689('0xc')]='';this[_0xc689('0xd')]();this[_0xc689('0xe')]();}SmsQueue[_0xc689('0xf')][_0xc689('0xd')]=function(){var _0x367b1d=this[_0xc689('0x10')][_0xc689('0x11')];this[_0xc689('0x10')]=_[_0xc689('0x12')](this['Agents'],'id');this[_0xc689('0x10')]['_rr']=_0x367b1d;};SmsQueue[_0xc689('0xf')][_0xc689('0xe')]=function(){this[_0xc689('0x13')]=0x0;this['paused']=0x0;for(var _0xc3b854=0x0;_0xc3b854=0x0?this[_0xc689('0x15')]:0x0;var _0x1edaef={'id':this['id'],'available':this[_0xc689('0x15')],'loggedIn':this[_0xc689('0x13')],'name':this[_0xc689('0x6')],'paused':this[_0xc689('0x16')],'waiting':this['waiting']};var _0x45e4c3=md5(JSON[_0xc689('0x17')](_0x1edaef));if(this['md5']!==_0x45e4c3){this['md5']=_0x45e4c3;io['to'](util['format']('sms:queue:%s',_0x1edaef['name']))[_0xc689('0x18')](_0xc689('0x19'),_0x1edaef);}};module[_0xc689('0x1a')]=SmsQueue; \ No newline at end of file +var _0x3140=['length','online','loggedIn','available','format','sms:queue:%s','emit','lodash','md5','util','ioredis','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','map','_rr','paused'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3140,0xaf));var _0x0314=function(_0x1cb84c,_0x576b00){_0x1cb84c=_0x1cb84c-0x0;var _0x1ff4ed=_0x3140[_0x1cb84c];return _0x1ff4ed;};'use strict';var _=require(_0x0314('0x0'));var md5=require(_0x0314('0x1'));var util=require(_0x0314('0x2'));var Redis=require(_0x0314('0x3'));var config=require('../../../config/environment');config['redis']=_[_0x0314('0x4')](config[_0x0314('0x5')],{'host':_0x0314('0x6'),'port':0x18eb});var io=require(_0x0314('0x7'))(new Redis(config[_0x0314('0x5')]));function SmsQueue(_0x46c395){this['id']=_0x46c395['id']||0x0;this[_0x0314('0x8')]=_0x46c395[_0x0314('0x8')]||'';this[_0x0314('0x9')]=_0x46c395[_0x0314('0x9')]||0xa;this[_0x0314('0xa')]=_0x46c395['strategy']||_0x0314('0xb');this[_0x0314('0xc')]=_0x46c395['Agents'];this['mapAgentsId']={};this[_0x0314('0xd')]=0x0;this['md5']='';this[_0x0314('0xe')]();this[_0x0314('0xf')]();}SmsQueue[_0x0314('0x10')][_0x0314('0xe')]=function(){var _0x375416=this[_0x0314('0x11')]['_rr'];this[_0x0314('0x11')]=_[_0x0314('0x12')](this[_0x0314('0xc')],'id');this[_0x0314('0x11')][_0x0314('0x13')]=_0x375416;};SmsQueue[_0x0314('0x10')][_0x0314('0xf')]=function(){this['loggedIn']=0x0;this[_0x0314('0x14')]=0x0;for(var _0xbe0b07=0x0;_0xbe0b07=0x0?this['available']:0x0;var _0x39db0b={'id':this['id'],'available':this[_0x0314('0x18')],'loggedIn':this['loggedIn'],'name':this[_0x0314('0x8')],'paused':this[_0x0314('0x14')],'waiting':this['waiting']};var _0x1a25cf=md5(JSON['stringify'](_0x39db0b));if(this[_0x0314('0x1')]!==_0x1a25cf){this[_0x0314('0x1')]=_0x1a25cf;io['to'](util[_0x0314('0x19')](_0x0314('0x1a'),_0x39db0b[_0x0314('0x8')]))[_0x0314('0x1b')]('sms_queue:save',_0x39db0b);}};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 36162eb..2c9065c 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 _0x8eac=['length','online','available','stringify','format','whatsapp:queue:%s','emit','lodash','md5','util','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x8eac,0x103));var _0xc8ea=function(_0x4f1423,_0x13cc99){_0x4f1423=_0x4f1423-0x0;var _0x33c235=_0x8eac[_0x4f1423];return _0x33c235;};'use strict';var _=require(_0xc8ea('0x0'));var md5=require(_0xc8ea('0x1'));var util=require(_0xc8ea('0x2'));var Redis=require('ioredis');var config=require(_0xc8ea('0x3'));config[_0xc8ea('0x4')]=_[_0xc8ea('0x5')](config[_0xc8ea('0x4')],{'host':_0xc8ea('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function WhatsappQueue(_0xd25322){this['id']=_0xd25322['id']||0x0;this[_0xc8ea('0x7')]=_0xd25322[_0xc8ea('0x7')]||'';this[_0xc8ea('0x8')]=_0xd25322[_0xc8ea('0x8')]||0xa;this[_0xc8ea('0x9')]=_0xd25322[_0xc8ea('0x9')]||_0xc8ea('0xa');this[_0xc8ea('0xb')]=_0xd25322[_0xc8ea('0xb')];this[_0xc8ea('0xc')]={};this[_0xc8ea('0xd')]=0x0;this['md5']='';this[_0xc8ea('0xe')]();this[_0xc8ea('0xf')]();}WhatsappQueue[_0xc8ea('0x10')][_0xc8ea('0xe')]=function(){var _0x2e7c8c=this['mapAgentsId'][_0xc8ea('0x11')];this[_0xc8ea('0xc')]=_[_0xc8ea('0x12')](this[_0xc8ea('0xb')],'id');this[_0xc8ea('0xc')]['_rr']=_0x2e7c8c;};WhatsappQueue['prototype'][_0xc8ea('0xf')]=function(){this[_0xc8ea('0x13')]=0x0;this[_0xc8ea('0x14')]=0x0;for(var _0x128e24=0x0;_0x128e24=0x0?this['available']:0x0;var _0xf74748={'id':this['id'],'available':this[_0xc8ea('0x17')],'loggedIn':this['loggedIn'],'name':this[_0xc8ea('0x7')],'paused':this[_0xc8ea('0x14')],'waiting':this[_0xc8ea('0xd')]};var _0x386453=md5(JSON[_0xc8ea('0x18')](_0xf74748));if(this[_0xc8ea('0x1')]!==_0x386453){this['md5']=_0x386453;io['to'](util[_0xc8ea('0x19')](_0xc8ea('0x1a'),_0xf74748[_0xc8ea('0x7')]))[_0xc8ea('0x1b')]('whatsapp_queue:save',_0xf74748);}};module['exports']=WhatsappQueue; \ No newline at end of file +var _0x22c5=['md5','updateRouting','prototype','_rr','updateRealtime','loggedIn','paused','online','whatsappPause','available','waiting','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x22c5,0x1a4));var _0x522c=function(_0x1b5576,_0xbe03c6){_0x1b5576=_0x1b5576-0x0;var _0x2b1bf0=_0x22c5[_0x1b5576];return _0x2b1bf0;};'use strict';var _=require(_0x522c('0x0'));var md5=require('md5');var util=require(_0x522c('0x1'));var Redis=require(_0x522c('0x2'));var config=require(_0x522c('0x3'));config[_0x522c('0x4')]=_[_0x522c('0x5')](config[_0x522c('0x4')],{'host':_0x522c('0x6'),'port':0x18eb});var io=require(_0x522c('0x7'))(new Redis(config[_0x522c('0x4')]));function WhatsappQueue(_0x1719b3){this['id']=_0x1719b3['id']||0x0;this[_0x522c('0x8')]=_0x1719b3['name']||'';this[_0x522c('0x9')]=_0x1719b3[_0x522c('0x9')]||0xa;this[_0x522c('0xa')]=_0x1719b3[_0x522c('0xa')]||_0x522c('0xb');this['Agents']=_0x1719b3[_0x522c('0xc')];this[_0x522c('0xd')]={};this['waiting']=0x0;this[_0x522c('0xe')]='';this[_0x522c('0xf')]();this['updateRealtime']();}WhatsappQueue[_0x522c('0x10')][_0x522c('0xf')]=function(){var _0x58ab43=this[_0x522c('0xd')][_0x522c('0x11')];this['mapAgentsId']=_['map'](this[_0x522c('0xc')],'id');this[_0x522c('0xd')][_0x522c('0x11')]=_0x58ab43;};WhatsappQueue[_0x522c('0x10')][_0x522c('0x12')]=function(){this[_0x522c('0x13')]=0x0;this[_0x522c('0x14')]=0x0;for(var _0x3e85ff=0x0;_0x3e85ff=0x0?this[_0x522c('0x17')]:0x0;var _0x28b290={'id':this['id'],'available':this['available'],'loggedIn':this[_0x522c('0x13')],'name':this['name'],'paused':this[_0x522c('0x14')],'waiting':this[_0x522c('0x18')]};var _0x2eb8bd=md5(JSON[_0x522c('0x19')](_0x28b290));if(this[_0x522c('0xe')]!==_0x2eb8bd){this[_0x522c('0xe')]=_0x2eb8bd;io['to'](util[_0x522c('0x1a')](_0x522c('0x1b'),_0x28b290['name']))[_0x522c('0x1c')](_0x522c('0x1d'),_0x28b290);}};module[_0x522c('0x1e')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index e4b8130..86521d2 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(_0x4cc67d,_0x1782ce){var _0x2fdc78=function(_0x96cf3c){while(--_0x96cf3c){_0x4cc67d['push'](_0x4cc67d['shift']());}};_0x2fdc78(++_0x1782ce);}(_0xb10b,0x12a));var _0xbb10=function(_0x4c836d,_0x144891){_0x4c836d=_0x4c836d-0x0;var _0x299319=_0xb10b[_0x4c836d];return _0x299319;};'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(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'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 1e7a908..bffdd4e 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 _0x7846=['UpdateChatInteraction','updateChatInteraction','AddTagsToChatInteraction','addTagsToChatInteraction','update','Request'];(function(_0x5c2367,_0xf5528c){var _0x3976e3=function(_0xf51935){while(--_0xf51935){_0x5c2367['push'](_0x5c2367['shift']());}};_0x3976e3(++_0xf5528c);}(_0x7846,0xf4));var _0x6784=function(_0x5c4e16,_0x113035){_0x5c4e16=_0x5c4e16-0x0;var _0x36044a=_0x7846[_0x5c4e16];return _0x36044a;};'use strict';var client=require('../client');exports[_0x6784('0x0')]=function(_0x2c4fd7,_0x3bc014){return client[_0x6784('0x1')](_0x6784('0x2'),{'body':_0x3bc014,'options':{'where':{'id':_0x2c4fd7}},'log':_0x6784('0x3')});};exports['addTags']=function(_0x13ba3e,_0x24c16b){return client[_0x6784('0x1')](_0x6784('0x4'),{'body':_0x24c16b,'options':{'where':{'id':_0x13ba3e}},'log':_0x6784('0x5')});}; \ No newline at end of file +var _0xa1e1=['Request','UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update'];(function(_0x50bf24,_0x495636){var _0x5c9024=function(_0x107277){while(--_0x107277){_0x50bf24['push'](_0x50bf24['shift']());}};_0x5c9024(++_0x495636);}(_0xa1e1,0x14e));var _0x1a1e=function(_0x586743,_0x341397){_0x586743=_0x586743-0x0;var _0x3d2529=_0xa1e1[_0x586743];return _0x3d2529;};'use strict';var client=require(_0x1a1e('0x0'));exports[_0x1a1e('0x1')]=function(_0x6a6493,_0x149502){return client[_0x1a1e('0x2')](_0x1a1e('0x3'),{'body':_0x149502,'options':{'where':{'id':_0x6a6493}},'log':_0x1a1e('0x4')});};exports[_0x1a1e('0x5')]=function(_0x24ff25,_0x43fbb3){return client[_0x1a1e('0x2')](_0x1a1e('0x6'),{'body':_0x43fbb3,'options':{'where':{'id':_0x24ff25}},'log':_0x1a1e('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 0bd2f4a..e8d8357 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 _0x1f1c=['createChatMessage','../client'];(function(_0x37a365,_0x344448){var _0x32e27d=function(_0x56fd83){while(--_0x56fd83){_0x37a365['push'](_0x37a365['shift']());}};_0x32e27d(++_0x344448);}(_0x1f1c,0x1b9));var _0xc1f1=function(_0x39997c,_0x5595f4){_0x39997c=_0x39997c-0x0;var _0x284810=_0x1f1c[_0x39997c];return _0x284810;};'use strict';var client=require(_0xc1f1('0x0'));exports['create']=function(_0x425105){return client['Request']('CreateChatMessage',{'body':_0x425105,'log':_0xc1f1('0x1')});}; \ No newline at end of file +var _0x8add=['Request','CreateChatMessage','createChatMessage','../client','create'];(function(_0x1e71b8,_0x2ba29c){var _0x32f86e=function(_0x112457){while(--_0x112457){_0x1e71b8['push'](_0x1e71b8['shift']());}};_0x32f86e(++_0x2ba29c);}(_0x8add,0xf3));var _0xd8ad=function(_0x925fd9,_0x1ec868){_0x925fd9=_0x925fd9-0x0;var _0x3e84ef=_0x8add[_0x925fd9];return _0x3e84ef;};'use strict';var client=require(_0xd8ad('0x0'));exports[_0xd8ad('0x1')]=function(_0x288a6a){return client[_0xd8ad('0x2')](_0xd8ad('0x3'),{'body':_0x288a6a,'log':_0xd8ad('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index c52adb6..0eb5ae0 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 _0x385b=['GetChatQueue','name','timeout','strategy','Agents','online','chatPause','getChatQueues'];(function(_0x1139d0,_0x41e5f8){var _0xcc01a6=function(_0x504ffa){while(--_0x504ffa){_0x1139d0['push'](_0x1139d0['shift']());}};_0xcc01a6(++_0x41e5f8);}(_0x385b,0x1a7));var _0xb385=function(_0x3a2575,_0x456f90){_0x3a2575=_0x3a2575-0x0;var _0x4c822e=_0x385b[_0x3a2575];return _0x4c822e;};'use strict';var client=require('../client');exports[_0xb385('0x0')]=function(){return function(){return client['Request'](_0xb385('0x1'),{'options':{'raw':![],'attributes':['id',_0xb385('0x2'),_0xb385('0x3'),_0xb385('0x4')],'include':[{'model':'User','as':_0xb385('0x5'),'attributes':['id',_0xb385('0x2'),_0xb385('0x6'),_0xb385('0x7')]}]},'log':_0xb385('0x0')});};}; \ No newline at end of file +var _0xf350=['User','Agents','../client','GetChatQueue','name','timeout','strategy'];(function(_0x5a7eeb,_0x16a204){var _0x1278e1=function(_0x182fc9){while(--_0x182fc9){_0x5a7eeb['push'](_0x5a7eeb['shift']());}};_0x1278e1(++_0x16a204);}(_0xf350,0x105));var _0x0f35=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf350[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0x0f35('0x0'));exports['getChatQueues']=function(){return function(){return client['Request'](_0x0f35('0x1'),{'options':{'raw':![],'attributes':['id',_0x0f35('0x2'),_0x0f35('0x3'),_0x0f35('0x4')],'include':[{'model':_0x0f35('0x5'),'as':_0x0f35('0x6'),'attributes':['id',_0x0f35('0x2'),'online','chatPause']}]},'log':'getChatQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index b31cbf9..785a902 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 _0x2b84=['DESC','../client','Request','CreateChatQueueReport','UpdateChatQueueReport'];(function(_0x47c13a,_0x388ad5){var _0x40d1f4=function(_0x485352){while(--_0x485352){_0x47c13a['push'](_0x47c13a['shift']());}};_0x40d1f4(++_0x388ad5);}(_0x2b84,0x105));var _0x42b8=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x2b84[_0x6c993a];return _0x27f547;};'use strict';var client=require(_0x42b8('0x0'));exports['create']=function(_0x17ebee){return client[_0x42b8('0x1')](_0x42b8('0x2'),{'body':_0x17ebee,'log':_0x42b8('0x2')});};exports['update']=function(_0x1d40a2,_0x14cc6b){return client[_0x42b8('0x1')](_0x42b8('0x3'),{'body':_0x14cc6b,'options':{'where':{'uniqueid':_0x1d40a2},'order':[['id',_0x42b8('0x4')]],'limit':0x1},'log':_0x42b8('0x3')});}; \ No newline at end of file +var _0xd0bb=['UpdateChatQueueReport','../client','create','CreateChatQueueReport','update','Request','DESC'];(function(_0x16a6bf,_0x2bece9){var _0x1eb2fc=function(_0x3d8973){while(--_0x3d8973){_0x16a6bf['push'](_0x16a6bf['shift']());}};_0x1eb2fc(++_0x2bece9);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x5b083b,_0x145a9b){_0x5b083b=_0x5b083b-0x0;var _0x6c2225=_0xd0bb[_0x5b083b];return _0x6c2225;};'use strict';var client=require(_0xbd0b('0x0'));exports[_0xbd0b('0x1')]=function(_0x43bfb8){return client['Request'](_0xbd0b('0x2'),{'body':_0x43bfb8,'log':'CreateChatQueueReport'});};exports[_0xbd0b('0x3')]=function(_0x1f6ec3,_0x53e6ce){return client[_0xbd0b('0x4')]('UpdateChatQueueReport',{'body':_0x53e6ce,'options':{'where':{'uniqueid':_0x1f6ec3},'order':[['id',_0xbd0b('0x5')]],'limit':0x1},'log':_0xbd0b('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index c85bf0a..8eb0b2f 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(_0x2f1114,_0x4561f1){var _0x2fe856=function(_0x8397f8){while(--_0x8397f8){_0x2f1114['push'](_0x2f1114['shift']());}};_0x2fe856(++_0x4561f1);}(_0x7a54,0x106));var _0x47a5=function(_0x731482,_0x26c2ee){_0x731482=_0x731482-0x0;var _0x2634a6=_0x7a54[_0x731482];return _0x2634a6;};'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(_0x5e9d35,_0x382c91){var _0x3beb2e=function(_0x4242cf){while(--_0x4242cf){_0x5e9d35['push'](_0x5e9d35['shift']());}};_0x3beb2e(++_0x382c91);}(_0x7a54,0x106));var _0x47a5=function(_0x2ff064,_0xbdeb85){_0x2ff064=_0x2ff064-0x0;var _0x56cc67=_0x7a54[_0x2ff064];return _0x56cc67;};'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 c2fecf4..4219740 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 _0x4845=['CreateFaxMessage','createFaxMessage','../client','create','Request'];(function(_0x40ea65,_0x238739){var _0x5f1b5f=function(_0x1b4006){while(--_0x1b4006){_0x40ea65['push'](_0x40ea65['shift']());}};_0x5f1b5f(++_0x238739);}(_0x4845,0xe3));var _0x5484=function(_0x16ac9f,_0x294907){_0x16ac9f=_0x16ac9f-0x0;var _0x422836=_0x4845[_0x16ac9f];return _0x422836;};'use strict';var client=require(_0x5484('0x0'));exports[_0x5484('0x1')]=function(_0x3aa8e6){return client[_0x5484('0x2')](_0x5484('0x3'),{'body':_0x3aa8e6,'log':_0x5484('0x4')});}; \ No newline at end of file +var _0x064d=['../client','create','Request','CreateFaxMessage','createFaxMessage'];(function(_0xa6e83b,_0x266b29){var _0x21d379=function(_0x20e42c){while(--_0x20e42c){_0xa6e83b['push'](_0xa6e83b['shift']());}};_0x21d379(++_0x266b29);}(_0x064d,0xff));var _0xd064=function(_0x3d4ad2,_0x4310c1){_0x3d4ad2=_0x3d4ad2-0x0;var _0x3421e8=_0x064d[_0x3d4ad2];return _0x3421e8;};'use strict';var client=require(_0xd064('0x0'));exports[_0xd064('0x1')]=function(_0x260cd7){return client[_0xd064('0x2')](_0xd064('0x3'),{'body':_0x260cd7,'log':_0xd064('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 6e77cd2..236c604 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 _0xba94=['../client','Request','GetFaxQueue','name','timeout','strategy','User','Agents','online'];(function(_0x3bc459,_0x4eae5c){var _0x32b153=function(_0x51ed63){while(--_0x51ed63){_0x3bc459['push'](_0x3bc459['shift']());}};_0x32b153(++_0x4eae5c);}(_0xba94,0x132));var _0x4ba9=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0xba94[_0x47aa64];return _0x549c7a;};'use strict';var client=require(_0x4ba9('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0x4ba9('0x1')](_0x4ba9('0x2'),{'options':{'raw':![],'attributes':['id',_0x4ba9('0x3'),_0x4ba9('0x4'),_0x4ba9('0x5')],'include':[{'model':_0x4ba9('0x6'),'as':_0x4ba9('0x7'),'attributes':['id',_0x4ba9('0x3'),_0x4ba9('0x8'),'faxPause']}]},'log':'getFaxQueues'});};}; \ No newline at end of file +var _0x021c=['User','faxPause','getFaxQueues','Request','name','strategy'];(function(_0x184b44,_0x2783ef){var _0x241493=function(_0x1952c4){while(--_0x1952c4){_0x184b44['push'](_0x184b44['shift']());}};_0x241493(++_0x2783ef);}(_0x021c,0x75));var _0xc021=function(_0x435aba,_0x1910b4){_0x435aba=_0x435aba-0x0;var _0x19c266=_0x021c[_0x435aba];return _0x19c266;};'use strict';var client=require('../client');exports['getFaxQueues']=function(){return function(){return client[_0xc021('0x0')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0xc021('0x1'),'timeout',_0xc021('0x2')],'include':[{'model':_0xc021('0x3'),'as':'Agents','attributes':['id','name','online',_0xc021('0x4')]}]},'log':_0xc021('0x5')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 993ff66..56982a7 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 _0x33de=['../client','create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x33de,0x1bc));var _0xe33d=function(_0x4030d4,_0x336ab2){_0x4030d4=_0x4030d4-0x0;var _0x342e02=_0x33de[_0x4030d4];return _0x342e02;};'use strict';var client=require(_0xe33d('0x0'));exports[_0xe33d('0x1')]=function(_0x2d11c8){return client[_0xe33d('0x2')]('CreateFaxQueueReport',{'body':_0x2d11c8,'log':_0xe33d('0x3')});};exports[_0xe33d('0x4')]=function(_0x1436b4,_0x24c26a){return client['Request'](_0xe33d('0x5'),{'body':_0x24c26a,'options':{'where':{'uniqueid':_0x1436b4},'order':[['id','DESC']],'limit':0x1},'log':_0xe33d('0x5')});}; \ No newline at end of file +var _0x1c25=['DESC','UpdateFaxQueueReport','../client','create','CreateFaxQueueReport','update','Request'];(function(_0x2433f1,_0x5abf81){var _0x1610d4=function(_0x35e45f){while(--_0x35e45f){_0x2433f1['push'](_0x2433f1['shift']());}};_0x1610d4(++_0x5abf81);}(_0x1c25,0x12f));var _0x51c2=function(_0x3bd165,_0x24ac18){_0x3bd165=_0x3bd165-0x0;var _0x1476b6=_0x1c25[_0x3bd165];return _0x1476b6;};'use strict';var client=require(_0x51c2('0x0'));exports[_0x51c2('0x1')]=function(_0x4b1231){return client['Request'](_0x51c2('0x2'),{'body':_0x4b1231,'log':_0x51c2('0x2')});};exports[_0x51c2('0x3')]=function(_0x3d4ef5,_0x2dcbd4){return client[_0x51c2('0x4')]('UpdateFaxQueueReport',{'body':_0x2dcbd4,'options':{'where':{'uniqueid':_0x3d4ef5},'order':[['id',_0x51c2('0x5')]],'limit':0x1},'log':_0x51c2('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 2b5eb6e..9a580d1 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 _0xe9b3=['Intervals','interval','../client','name','Interval'];(function(_0xa911b9,_0x24c5c9){var _0x93af13=function(_0x46ea0f){while(--_0x46ea0f){_0xa911b9['push'](_0xa911b9['shift']());}};_0x93af13(++_0x24c5c9);}(_0xe9b3,0xd9));var _0x3e9b=function(_0x163735,_0x5e38f3){_0x163735=_0x163735-0x0;var _0x311dd1=_0xe9b3[_0x163735];return _0x311dd1;};'use strict';var client=require(_0x3e9b('0x0'));exports['getIntervals']=function(){return function(){return client['Request']('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x3e9b('0x1')],'include':[{'model':_0x3e9b('0x2'),'as':_0x3e9b('0x3'),'attributes':['id',_0x3e9b('0x1'),_0x3e9b('0x4')]}]},'log':'getIntervals'});};}; \ No newline at end of file +var _0xa8ac=['interval','getIntervals','Request','GetInterval','name','Interval','Intervals'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa8ac,0x1cf));var _0xca8a=function(_0x49e482,_0x1e0d3d){_0x49e482=_0x49e482-0x0;var _0x47edac=_0xa8ac[_0x49e482];return _0x47edac;};'use strict';var client=require('../client');exports[_0xca8a('0x0')]=function(){return function(){return client[_0xca8a('0x1')](_0xca8a('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xca8a('0x3')],'include':[{'model':_0xca8a('0x4'),'as':_0xca8a('0x5'),'attributes':['id',_0xca8a('0x3'),_0xca8a('0x6')]}]},'log':_0xca8a('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index debee90..f51aa52 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 _0x0424=['Request','UpdateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction'];(function(_0x461ed8,_0x115252){var _0x369fcf=function(_0x51f391){while(--_0x51f391){_0x461ed8['push'](_0x461ed8['shift']());}};_0x369fcf(++_0x115252);}(_0x0424,0x159));var _0x4042=function(_0x4920f2,_0xa4bfbf){_0x4920f2=_0x4920f2-0x0;var _0x1f27cf=_0x0424[_0x4920f2];return _0x1f27cf;};'use strict';var client=require('../client');exports['update']=function(_0x27e499,_0x28e024){return client[_0x4042('0x0')](_0x4042('0x1'),{'body':_0x28e024,'options':{'where':{'id':_0x27e499}},'log':'updateMailInteraction'});};exports[_0x4042('0x2')]=function(_0x519987,_0x491eae){return client[_0x4042('0x0')](_0x4042('0x3'),{'body':_0x491eae,'options':{'where':{'id':_0x519987}},'log':_0x4042('0x4')});}; \ No newline at end of file +var _0x32f4=['updateMailInteraction','Request','AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','UpdateMailInteraction'];(function(_0x5aef74,_0x4c8395){var _0x5d6b7e=function(_0x4b7622){while(--_0x4b7622){_0x5aef74['push'](_0x5aef74['shift']());}};_0x5d6b7e(++_0x4c8395);}(_0x32f4,0x154));var _0x432f=function(_0x529ac4,_0x51bc05){_0x529ac4=_0x529ac4-0x0;var _0x4e0a30=_0x32f4[_0x529ac4];return _0x4e0a30;};'use strict';var client=require(_0x432f('0x0'));exports[_0x432f('0x1')]=function(_0x29845b,_0x2b22ad){return client['Request'](_0x432f('0x2'),{'body':_0x2b22ad,'options':{'where':{'id':_0x29845b}},'log':_0x432f('0x3')});};exports['addTags']=function(_0x354293,_0x1eabac){return client[_0x432f('0x4')](_0x432f('0x5'),{'body':_0x1eabac,'options':{'where':{'id':_0x354293}},'log':_0x432f('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 38ba109..d3caab7 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 _0x1828=['../client','createMailMessage'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0x1828,0x1bc));var _0x8182=function(_0x43f72e,_0x5eaec4){_0x43f72e=_0x43f72e-0x0;var _0x3a6167=_0x1828[_0x43f72e];return _0x3a6167;};'use strict';var client=require(_0x8182('0x0'));exports['create']=function(_0x181e8e){return client['Request']('CreateMailMessage',{'body':_0x181e8e,'log':_0x8182('0x1')});}; \ No newline at end of file +var _0xc8b1=['Request','create'];(function(_0x1765a8,_0x5bcf40){var _0x4c10a7=function(_0x2d4220){while(--_0x2d4220){_0x1765a8['push'](_0x1765a8['shift']());}};_0x4c10a7(++_0x5bcf40);}(_0xc8b1,0xc3));var _0x1c8b=function(_0x182ccb,_0x2c0bba){_0x182ccb=_0x182ccb-0x0;var _0x51b581=_0xc8b1[_0x182ccb];return _0x51b581;};'use strict';var client=require('../client');exports[_0x1c8b('0x0')]=function(_0x49a5c5){return client[_0x1c8b('0x1')]('CreateMailMessage',{'body':_0x49a5c5,'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 cc82cdd..485f434 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 _0x88a8=['GetMailQueue','name','strategy','Agents','online','mailPause','getMailQueues','Request'];(function(_0xc8ffa5,_0x1fd15f){var _0x35bc1b=function(_0x41bfa9){while(--_0x41bfa9){_0xc8ffa5['push'](_0xc8ffa5['shift']());}};_0x35bc1b(++_0x1fd15f);}(_0x88a8,0x19e));var _0x888a=function(_0x2912b9,_0x1787d7){_0x2912b9=_0x2912b9-0x0;var _0x53d64d=_0x88a8[_0x2912b9];return _0x53d64d;};'use strict';var client=require('../client');exports[_0x888a('0x0')]=function(){return function(){return client[_0x888a('0x1')](_0x888a('0x2'),{'options':{'raw':![],'attributes':['id',_0x888a('0x3'),'timeout',_0x888a('0x4')],'include':[{'model':'User','as':_0x888a('0x5'),'attributes':['id',_0x888a('0x3'),_0x888a('0x6'),_0x888a('0x7')]}]},'log':_0x888a('0x0')});};}; \ No newline at end of file +var _0xa7cc=['User','Agents','name','online','../client','getMailQueues','Request','GetMailQueue','timeout','strategy'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0xa7cc,0xa4));var _0xca7c=function(_0x53806a,_0x5770b7){_0x53806a=_0x53806a-0x0;var _0x599bd3=_0xa7cc[_0x53806a];return _0x599bd3;};'use strict';var client=require(_0xca7c('0x0'));exports[_0xca7c('0x1')]=function(){return function(){return client[_0xca7c('0x2')](_0xca7c('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xca7c('0x4'),_0xca7c('0x5')],'include':[{'model':_0xca7c('0x6'),'as':_0xca7c('0x7'),'attributes':['id',_0xca7c('0x8'),_0xca7c('0x9'),'mailPause']}]},'log':_0xca7c('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 212fa14..ad18a46 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 _0x6c89=['UpdateMailQueueReport','DESC','../client','create','Request','CreateMailQueueReport','update'];(function(_0x59162a,_0x10e547){var _0x35e50d=function(_0x578425){while(--_0x578425){_0x59162a['push'](_0x59162a['shift']());}};_0x35e50d(++_0x10e547);}(_0x6c89,0x1d0));var _0x96c8=function(_0x2d7fc9,_0xd62516){_0x2d7fc9=_0x2d7fc9-0x0;var _0x1c81fb=_0x6c89[_0x2d7fc9];return _0x1c81fb;};'use strict';var client=require(_0x96c8('0x0'));exports[_0x96c8('0x1')]=function(_0x17ef05){return client[_0x96c8('0x2')](_0x96c8('0x3'),{'body':_0x17ef05,'log':'CreateMailQueueReport'});};exports[_0x96c8('0x4')]=function(_0x16313a,_0x54b2fe){return client[_0x96c8('0x2')](_0x96c8('0x5'),{'body':_0x54b2fe,'options':{'where':{'uniqueid':_0x16313a},'order':[['id',_0x96c8('0x6')]],'limit':0x1},'log':_0x96c8('0x5')});}; \ No newline at end of file +var _0x26d2=['CreateMailQueueReport','update','DESC','Request'];(function(_0x176143,_0xb9ed04){var _0x5c719c=function(_0x4264e0){while(--_0x4264e0){_0x176143['push'](_0x176143['shift']());}};_0x5c719c(++_0xb9ed04);}(_0x26d2,0xeb));var _0x226d=function(_0x254076,_0x5e7b8d){_0x254076=_0x254076-0x0;var _0x21a93e=_0x26d2[_0x254076];return _0x21a93e;};'use strict';var client=require('../client');exports['create']=function(_0x50bad0){return client[_0x226d('0x0')](_0x226d('0x1'),{'body':_0x50bad0,'log':_0x226d('0x1')});};exports[_0x226d('0x2')]=function(_0x25388b,_0xa30260){return client[_0x226d('0x0')]('UpdateMailQueueReport',{'body':_0xa30260,'options':{'where':{'uniqueid':_0x25388b},'order':[['id',_0x226d('0x3')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 57f9525..e0e9dcd 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 _0x1ee8=['Request','UpdateOpenchannelInteraction','addTags','addTagsToChatInteraction'];(function(_0x4ab782,_0x274661){var _0x350e1f=function(_0x521478){while(--_0x521478){_0x4ab782['push'](_0x4ab782['shift']());}};_0x350e1f(++_0x274661);}(_0x1ee8,0x168));var _0x81ee=function(_0x590b39,_0x34b19d){_0x590b39=_0x590b39-0x0;var _0x3af355=_0x1ee8[_0x590b39];return _0x3af355;};'use strict';var client=require('../client');exports['update']=function(_0x2c50d1,_0x54c4ab){return client[_0x81ee('0x0')](_0x81ee('0x1'),{'body':_0x54c4ab,'options':{'where':{'id':_0x2c50d1}},'log':'updateOpenchannelInteraction'});};exports[_0x81ee('0x2')]=function(_0xa54759,_0xd8e8b8){return client[_0x81ee('0x0')]('AddTagsToOpenchannelInteraction',{'body':_0xd8e8b8,'options':{'where':{'id':_0xa54759}},'log':_0x81ee('0x3')});}; \ No newline at end of file +var _0x5076=['Request','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client'];(function(_0x3416d3,_0x4b6f3e){var _0x304937=function(_0x103cce){while(--_0x103cce){_0x3416d3['push'](_0x3416d3['shift']());}};_0x304937(++_0x4b6f3e);}(_0x5076,0xd6));var _0x6507=function(_0x2747b8,_0x430ea7){_0x2747b8=_0x2747b8-0x0;var _0x1bb962=_0x5076[_0x2747b8];return _0x1bb962;};'use strict';var client=require(_0x6507('0x0'));exports['update']=function(_0x16c601,_0x3ad6a2){return client[_0x6507('0x1')]('UpdateOpenchannelInteraction',{'body':_0x3ad6a2,'options':{'where':{'id':_0x16c601}},'log':'updateOpenchannelInteraction'});};exports[_0x6507('0x2')]=function(_0x4e548c,_0x47a157){return client['Request'](_0x6507('0x3'),{'body':_0x47a157,'options':{'where':{'id':_0x4e548c}},'log':_0x6507('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index c177a77..c026a98 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 _0x7562=['create','Request','createOpenchannelMessage'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x7562,0x165));var _0x2756=function(_0x39938f,_0x4c3859){_0x39938f=_0x39938f-0x0;var _0x3537d9=_0x7562[_0x39938f];return _0x3537d9;};'use strict';var client=require('../client');exports[_0x2756('0x0')]=function(_0x4fb868){return client[_0x2756('0x1')]('CreateOpenchannelMessage',{'body':_0x4fb868,'log':_0x2756('0x2')});}; \ No newline at end of file +var _0xaa8a=['createOpenchannelMessage','../client','Request','CreateOpenchannelMessage'];(function(_0x25860c,_0x407214){var _0x17fb57=function(_0x1de879){while(--_0x1de879){_0x25860c['push'](_0x25860c['shift']());}};_0x17fb57(++_0x407214);}(_0xaa8a,0xb5));var _0xaaa8=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xaa8a[_0x4b369d];return _0x571a98;};'use strict';var client=require(_0xaaa8('0x0'));exports['create']=function(_0x174744){return client[_0xaaa8('0x1')](_0xaaa8('0x2'),{'body':_0x174744,'log':_0xaaa8('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index c737321..564004f 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 _0x5aab=['Request','GetOpenchannelQueue','name','User','Agents','online','openchannelPause','getOpenchannelQueues'];(function(_0x14b1dd,_0x3f2e69){var _0x20e65e=function(_0x13f34d){while(--_0x13f34d){_0x14b1dd['push'](_0x14b1dd['shift']());}};_0x20e65e(++_0x3f2e69);}(_0x5aab,0x90));var _0xb5aa=function(_0xb3e41b,_0x473fa0){_0xb3e41b=_0xb3e41b-0x0;var _0x2cf08c=_0x5aab[_0xb3e41b];return _0x2cf08c;};'use strict';var client=require('../client');exports['getOpenchannelQueues']=function(){return function(){return client[_0xb5aa('0x0')](_0xb5aa('0x1'),{'options':{'raw':![],'attributes':['id',_0xb5aa('0x2'),'timeout','strategy'],'include':[{'model':_0xb5aa('0x3'),'as':_0xb5aa('0x4'),'attributes':['id',_0xb5aa('0x2'),_0xb5aa('0x5'),_0xb5aa('0x6')]}]},'log':_0xb5aa('0x7')});};}; \ No newline at end of file +var _0xeb4c=['strategy','User','Agents','name','online','openchannelPause','getOpenchannelQueues','../client','Request','timeout'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0xeb4c,0x93));var _0xceb4=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xeb4c[_0x5ddb1c];return _0x354adc;};'use strict';var client=require(_0xceb4('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client[_0xceb4('0x1')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id','name',_0xceb4('0x2'),_0xceb4('0x3')],'include':[{'model':_0xceb4('0x4'),'as':_0xceb4('0x5'),'attributes':['id',_0xceb4('0x6'),_0xceb4('0x7'),_0xceb4('0x8')]}]},'log':_0xceb4('0x9')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 59c7d12..5a3bcd8 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 _0x9f31=['CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','../client','create','Request'];(function(_0x732470,_0x179024){var _0x53784b=function(_0x284ca1){while(--_0x284ca1){_0x732470['push'](_0x732470['shift']());}};_0x53784b(++_0x179024);}(_0x9f31,0x8d));var _0x19f3=function(_0x456b57,_0x58691a){_0x456b57=_0x456b57-0x0;var _0x18f49f=_0x9f31[_0x456b57];return _0x18f49f;};'use strict';var client=require(_0x19f3('0x0'));exports[_0x19f3('0x1')]=function(_0x1b43ca){return client[_0x19f3('0x2')](_0x19f3('0x3'),{'body':_0x1b43ca,'log':_0x19f3('0x3')});};exports[_0x19f3('0x4')]=function(_0x5b800,_0x11f8ba){return client[_0x19f3('0x2')](_0x19f3('0x5'),{'body':_0x11f8ba,'options':{'where':{'uniqueid':_0x5b800},'order':[['id','DESC']],'limit':0x1},'log':_0x19f3('0x5')});}; \ No newline at end of file +var _0xa0d1=['../client','create','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC'];(function(_0x1ff91c,_0xfa6d9c){var _0x44464c=function(_0x494a7c){while(--_0x494a7c){_0x1ff91c['push'](_0x1ff91c['shift']());}};_0x44464c(++_0xfa6d9c);}(_0xa0d1,0x118));var _0x1a0d=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xa0d1[_0x5d6456];return _0x4d66c1;};'use strict';var client=require(_0x1a0d('0x0'));exports[_0x1a0d('0x1')]=function(_0x234087){return client[_0x1a0d('0x2')]('CreateOpenchannelQueueReport',{'body':_0x234087,'log':_0x1a0d('0x3')});};exports[_0x1a0d('0x4')]=function(_0x2921d7,_0x55dbd7){return client[_0x1a0d('0x2')](_0x1a0d('0x5'),{'body':_0x55dbd7,'options':{'where':{'uniqueid':_0x2921d7},'order':[['id',_0x1a0d('0x6')]],'limit':0x1},'log':_0x1a0d('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 86cd019..8dbf920 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 _0x0f9f=['updateSmsInteraction','addTags','Request','AddTagsToSmsInteraction','addTagsToSmsInteraction','update','UpdateSmsInteraction'];(function(_0x5997d0,_0x164a94){var _0x373e0d=function(_0x594220){while(--_0x594220){_0x5997d0['push'](_0x5997d0['shift']());}};_0x373e0d(++_0x164a94);}(_0x0f9f,0x1cc));var _0xf0f9=function(_0x26a672,_0x59f5be){_0x26a672=_0x26a672-0x0;var _0x348f43=_0x0f9f[_0x26a672];return _0x348f43;};'use strict';var client=require('../client');exports[_0xf0f9('0x0')]=function(_0x438c8d,_0x1eba20){return client['Request'](_0xf0f9('0x1'),{'body':_0x1eba20,'options':{'where':{'id':_0x438c8d}},'log':_0xf0f9('0x2')});};exports[_0xf0f9('0x3')]=function(_0x17eab4,_0x2f8d38){return client[_0xf0f9('0x4')](_0xf0f9('0x5'),{'body':_0x2f8d38,'options':{'where':{'id':_0x17eab4}},'log':_0xf0f9('0x6')});}; \ No newline at end of file +var _0x4d61=['update','Request','UpdateSmsInteraction','updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client'];(function(_0x1da0e2,_0x31fdf3){var _0x25b30b=function(_0x333fd5){while(--_0x333fd5){_0x1da0e2['push'](_0x1da0e2['shift']());}};_0x25b30b(++_0x31fdf3);}(_0x4d61,0x147));var _0x14d6=function(_0x16b667,_0xadec02){_0x16b667=_0x16b667-0x0;var _0x58620e=_0x4d61[_0x16b667];return _0x58620e;};'use strict';var client=require(_0x14d6('0x0'));exports[_0x14d6('0x1')]=function(_0xc97451,_0x24999b){return client[_0x14d6('0x2')](_0x14d6('0x3'),{'body':_0x24999b,'options':{'where':{'id':_0xc97451}},'log':_0x14d6('0x4')});};exports[_0x14d6('0x5')]=function(_0x2950b7,_0x5da268){return client[_0x14d6('0x2')](_0x14d6('0x6'),{'body':_0x5da268,'options':{'where':{'id':_0x2950b7}},'log':_0x14d6('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 635119a..86bf22f 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 _0x5853=['createSmsMessage','../client','create','Request'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x5853,0x129));var _0x3585=function(_0x28aea5,_0x3bb12e){_0x28aea5=_0x28aea5-0x0;var _0x6a55f9=_0x5853[_0x28aea5];return _0x6a55f9;};'use strict';var client=require(_0x3585('0x0'));exports[_0x3585('0x1')]=function(_0x4943f4){return client[_0x3585('0x2')]('CreateSmsMessage',{'body':_0x4943f4,'log':_0x3585('0x3')});}; \ No newline at end of file +var _0x27b8=['createSmsMessage','Request'];(function(_0x49422e,_0x2c7e5d){var _0x427062=function(_0x5661ce){while(--_0x5661ce){_0x49422e['push'](_0x49422e['shift']());}};_0x427062(++_0x2c7e5d);}(_0x27b8,0x157));var _0x827b=function(_0x2e0ff4,_0xdb13f2){_0x2e0ff4=_0x2e0ff4-0x0;var _0x344926=_0x27b8[_0x2e0ff4];return _0x344926;};'use strict';var client=require('../client');exports['create']=function(_0x3fd6d0){return client[_0x827b('0x0')]('CreateSmsMessage',{'body':_0x3fd6d0,'log':_0x827b('0x1')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 38ea56c..ff26c5b 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(_0x5d2709,_0x135785){var _0x354258=function(_0x32ec96){while(--_0x32ec96){_0x5d2709['push'](_0x5d2709['shift']());}};_0x354258(++_0x135785);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'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 _0x9c44=['Request','GetSmsQueue','name','timeout','strategy','User','online','getSmsQueues'];(function(_0x3d0f7f,_0x22a6f0){var _0x15db17=function(_0x5d3509){while(--_0x5d3509){_0x3d0f7f['push'](_0x3d0f7f['shift']());}};_0x15db17(++_0x22a6f0);}(_0x9c44,0x178));var _0x49c4=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x9c44[_0x3d42d8];return _0x27fc41;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':![],'attributes':['id',_0x49c4('0x2'),_0x49c4('0x3'),_0x49c4('0x4')],'include':[{'model':_0x49c4('0x5'),'as':'Agents','attributes':['id','name',_0x49c4('0x6'),'smsPause']}]},'log':_0x49c4('0x7')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 7c1884a..d35074f 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(_0x369ed8,_0x2527a3){var _0x3157b9=function(_0x237cab){while(--_0x237cab){_0x369ed8['push'](_0x369ed8['shift']());}};_0x3157b9(++_0x2527a3);}(_0x70e0,0x17b));var _0x070e=function(_0x5c5b88,_0x126157){_0x5c5b88=_0x5c5b88-0x0;var _0x4bc83d=_0x70e0[_0x5c5b88];return _0x4bc83d;};'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 _0x008c=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x38323b,_0x5f79df){var _0x2b9af5=function(_0x576caa){while(--_0x576caa){_0x38323b['push'](_0x38323b['shift']());}};_0x2b9af5(++_0x5f79df);}(_0x008c,0x188));var _0xc008=function(_0x206137,_0x2a56c7){_0x206137=_0x206137-0x0;var _0x96c5f7=_0x008c[_0x206137];return _0x96c5f7;};'use strict';var client=require(_0xc008('0x0'));exports[_0xc008('0x1')]=function(_0x15aadc){return client[_0xc008('0x2')](_0xc008('0x3'),{'body':_0x15aadc,'log':'CreateSmsQueueReport'});};exports[_0xc008('0x4')]=function(_0x47063f,_0x10b33c){return client[_0xc008('0x2')](_0xc008('0x5'),{'body':_0x10b33c,'options':{'where':{'uniqueid':_0x47063f},'order':[['id',_0xc008('0x6')]],'limit':0x1},'log':_0xc008('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 38c2092..3d720ea 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(_0x5e94e2,_0x5ae7c8){var _0x4fc45c=function(_0x54743d){while(--_0x54743d){_0x5e94e2['push'](_0x5e94e2['shift']());}};_0x4fc45c(++_0x5ae7c8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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(_0x2dd1ff,_0x4e0c61){var _0x44b4f6=function(_0x424136){while(--_0x424136){_0x2dd1ff['push'](_0x2dd1ff['shift']());}};_0x44b4f6(++_0x4e0c61);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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 5955ba6..7b0ba03 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 _0x5d17=['../client','update','Request','UpdateWhatsappInteraction','updateWhatsappInteraction','AddTagsToWhatsappInteraction'];(function(_0x22cc84,_0x7861de){var _0x5263d7=function(_0x5ab4d9){while(--_0x5ab4d9){_0x22cc84['push'](_0x22cc84['shift']());}};_0x5263d7(++_0x7861de);}(_0x5d17,0x114));var _0x75d1=function(_0x5200c4,_0x4d59a6){_0x5200c4=_0x5200c4-0x0;var _0x36cb24=_0x5d17[_0x5200c4];return _0x36cb24;};'use strict';var client=require(_0x75d1('0x0'));exports[_0x75d1('0x1')]=function(_0x58fb6b,_0x5b3ed3){return client[_0x75d1('0x2')](_0x75d1('0x3'),{'body':_0x5b3ed3,'options':{'where':{'id':_0x58fb6b}},'log':_0x75d1('0x4')});};exports['addTags']=function(_0x177460,_0x45d03a){return client[_0x75d1('0x2')](_0x75d1('0x5'),{'body':_0x45d03a,'options':{'where':{'id':_0x177460}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file +var _0x49c1=['Request','updateWhatsappInteraction','addTags','addTagsToWhatsappInteraction','../client'];(function(_0x58400b,_0x237e91){var _0x40106f=function(_0x3336f0){while(--_0x3336f0){_0x58400b['push'](_0x58400b['shift']());}};_0x40106f(++_0x237e91);}(_0x49c1,0xef));var _0x149c=function(_0x43852a,_0x3c787a){_0x43852a=_0x43852a-0x0;var _0x37cff6=_0x49c1[_0x43852a];return _0x37cff6;};'use strict';var client=require(_0x149c('0x0'));exports['update']=function(_0x466227,_0x2f0c65){return client[_0x149c('0x1')]('UpdateWhatsappInteraction',{'body':_0x2f0c65,'options':{'where':{'id':_0x466227}},'log':_0x149c('0x2')});};exports[_0x149c('0x3')]=function(_0x4c3294,_0xdb4fdf){return client[_0x149c('0x1')]('AddTagsToWhatsappInteraction',{'body':_0xdb4fdf,'options':{'where':{'id':_0x4c3294}},'log':_0x149c('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 5bef33a..ffc26ac 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 _0x9c13=['../client','CreateWhatsappMessage'];(function(_0x460c38,_0x257274){var _0x1486b8=function(_0x40d2c1){while(--_0x40d2c1){_0x460c38['push'](_0x460c38['shift']());}};_0x1486b8(++_0x257274);}(_0x9c13,0x1ba));var _0x39c1=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0x9c13[_0x12d033];return _0x3b4e80;};'use strict';var client=require(_0x39c1('0x0'));exports['create']=function(_0x16f196){return client['Request'](_0x39c1('0x1'),{'body':_0x16f196,'log':'createWhatsappMessage'});}; \ No newline at end of file +var _0x67b0=['createWhatsappMessage','Request'];(function(_0x2e3860,_0x478138){var _0x1f49e1=function(_0x420722){while(--_0x420722){_0x2e3860['push'](_0x2e3860['shift']());}};_0x1f49e1(++_0x478138);}(_0x67b0,0x1cb));var _0x067b=function(_0x4eb510,_0x4b4e20){_0x4eb510=_0x4eb510-0x0;var _0x10a9fe=_0x67b0[_0x4eb510];return _0x10a9fe;};'use strict';var client=require('../client');exports['create']=function(_0x68da5f){return client[_0x067b('0x0')]('CreateWhatsappMessage',{'body':_0x68da5f,'log':_0x067b('0x1')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index a9f25c8..4a1e32a 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 _0x1851=['GetWhatsappQueue','name','timeout','strategy','Agents','online','whatsappPause','getWhatsappQueues','../client','Request'];(function(_0xf43bc4,_0x50449c){var _0x237010=function(_0xdcd362){while(--_0xdcd362){_0xf43bc4['push'](_0xf43bc4['shift']());}};_0x237010(++_0x50449c);}(_0x1851,0x166));var _0x1185=function(_0x6a6817,_0x22b098){_0x6a6817=_0x6a6817-0x0;var _0x51429c=_0x1851[_0x6a6817];return _0x51429c;};'use strict';var client=require(_0x1185('0x0'));exports['getWhatsappQueues']=function(){return function(){return client[_0x1185('0x1')](_0x1185('0x2'),{'options':{'raw':![],'attributes':['id',_0x1185('0x3'),_0x1185('0x4'),_0x1185('0x5')],'include':[{'model':'User','as':_0x1185('0x6'),'attributes':['id',_0x1185('0x3'),_0x1185('0x7'),_0x1185('0x8')]}]},'log':_0x1185('0x9')});};}; \ No newline at end of file +var _0x568f=['strategy','User','Agents','online','whatsappPause','../client','getWhatsappQueues','name'];(function(_0x2bcde5,_0x1ea091){var _0x493c51=function(_0x3ab999){while(--_0x3ab999){_0x2bcde5['push'](_0x2bcde5['shift']());}};_0x493c51(++_0x1ea091);}(_0x568f,0x1a5));var _0xf568=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x568f[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xf568('0x0'));exports[_0xf568('0x1')]=function(){return function(){return client['Request']('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0xf568('0x2'),'timeout',_0xf568('0x3')],'include':[{'model':_0xf568('0x4'),'as':_0xf568('0x5'),'attributes':['id','name',_0xf568('0x6'),_0xf568('0x7')]}]},'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 37c89c3..4da1f97 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 _0xb98e=['DESC','Request','CreateWhatsappQueueReport','UpdateWhatsappQueueReport'];(function(_0x576e92,_0x165314){var _0x24c32e=function(_0x1648b1){while(--_0x1648b1){_0x576e92['push'](_0x576e92['shift']());}};_0x24c32e(++_0x165314);}(_0xb98e,0xbd));var _0xeb98=function(_0x502c79,_0x5b2173){_0x502c79=_0x502c79-0x0;var _0x10e412=_0xb98e[_0x502c79];return _0x10e412;};'use strict';var client=require('../client');exports['create']=function(_0x320bc7){return client[_0xeb98('0x0')](_0xeb98('0x1'),{'body':_0x320bc7,'log':_0xeb98('0x1')});};exports['update']=function(_0x31bd5e,_0x114043){return client['Request'](_0xeb98('0x2'),{'body':_0x114043,'options':{'where':{'uniqueid':_0x31bd5e},'order':[['id',_0xeb98('0x3')]],'limit':0x1},'log':_0xeb98('0x2')});}; \ No newline at end of file +var _0x1df1=['Request','CreateWhatsappQueueReport','update','DESC','UpdateWhatsappQueueReport','../client','create'];(function(_0x2ae424,_0x307344){var _0x5c9540=function(_0x22ba0a){while(--_0x22ba0a){_0x2ae424['push'](_0x2ae424['shift']());}};_0x5c9540(++_0x307344);}(_0x1df1,0xc9));var _0x11df=function(_0x89b024,_0x438e96){_0x89b024=_0x89b024-0x0;var _0x23b5a0=_0x1df1[_0x89b024];return _0x23b5a0;};'use strict';var client=require(_0x11df('0x0'));exports[_0x11df('0x1')]=function(_0xf2725f){return client[_0x11df('0x2')](_0x11df('0x3'),{'body':_0xf2725f,'log':_0x11df('0x3')});};exports[_0x11df('0x4')]=function(_0x6a7ee6,_0x3f877c){return client['Request']('UpdateWhatsappQueueReport',{'body':_0x3f877c,'options':{'where':{'uniqueid':_0x6a7ee6},'order':[['id',_0x11df('0x5')]],'limit':0x1},'log':_0x11df('0x6')});}; \ 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 64c63be..74264ed 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 _0x934f=['map','message','join','stop','agents','timeout','createQueue','atimeout','channel','format','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','agent','error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','util','seq-queue','../../../../config/logger','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','info','name','toLowerCase','consequence','length'];(function(_0x3eb630,_0x552586){var _0x1b840d=function(_0x2594a8){while(--_0x2594a8){_0x3eb630['push'](_0x3eb630['shift']());}};_0x1b840d(++_0x552586);}(_0x934f,0x1d0));var _0xf934=function(_0x14fd3e,_0x1949ae){_0x14fd3e=_0x14fd3e-0x0;var _0x3958d5=_0x934f[_0x14fd3e];return _0x3958d5;};'use strict';var schema=require(_0xf934('0x0'));var _=require('lodash');var util=require(_0xf934('0x1'));var seqqueue=require(_0xf934('0x2'));var logger=require(_0xf934('0x3'))('routing');var strategy=require('./strategy');var queue=schema({'name':{'type':_0xf934('0x4'),'required':!![],'message':_0xf934('0x5')},'timeout':{'type':'number','message':_0xf934('0x6')}});function writeLog(_0x65ba7e,_0x35e291,_0x1cd6b4){return logger[_0xf934('0x7')](util['format']('[%s][AGENT][NAME:%s][STATUS:%s]',_0x65ba7e,_0x35e291[_0xf934('0x8')],_0x1cd6b4));}function handleFindAgent(_0x2a6466){return function(_0x5854da){return _0x5854da[_0xf934('0x8')]['toLowerCase']()===_0x2a6466[_0xf934('0x9')]();};}exports[_0xf934('0xa')]=function(_0x48757a,_0x48c9c5,_0xadf3c8,_0x7b24c){return function(_0x2e1b66){try{var _0x40ab57={'name':_0x48c9c5[0x0],'timeout':_0x48c9c5[0x1]};var _0x1fe058=queue[_0xf934('0x0')](_0x40ab57,{'typecast':!![]});if(_0x1fe058[_0xf934('0xb')]){logger['error']('[%s][AGENT]\x20%s',_0x48757a,_[_0xf934('0xc')](_0x1fe058,_0xf934('0xd'))[_0xf934('0xe')](',\x20'));_0x2e1b66[_0xf934('0xf')]();}else{var _0x5f324a=_['find'](_0xadf3c8[_0xf934('0x10')],handleFindAgent(_0x40ab57[_0xf934('0x8')]));if(_0x5f324a){var _0xc73da5=(_0x40ab57[_0xf934('0x11')]||0xa)*0x3e8;var _0x6c99bc,_0x4f26cc;var _0x21adf7=seqqueue[_0xf934('0x12')](_0xc73da5);_0x21adf7['id']=_0x48757a;_0x21adf7[_0xf934('0x13')]=_0xc73da5;_0x21adf7[_0xf934('0x14')]=_0x7b24c[_0xf934('0x14')];writeLog(_0x48757a,_0x5f324a,util[_0xf934('0x15')]('START:%s',_0xc73da5));_0xadf3c8[_0xf934('0x16')][_0x48757a]['on'](_0xf934('0x17'),function(){logger['info'](_0xf934('0x18'),_0x48757a);clearTimeout(_0x4f26cc);_0x4f26cc=undefined;_0x21adf7[_0xf934('0x19')]();if(_0xadf3c8[_0xf934('0x16')][_0x48757a]){delete _0xadf3c8[_0xf934('0x16')][_0x48757a];}_0x2e1b66[_0xf934('0xf')]();});_0xadf3c8[_0xf934('0x16')][_0x48757a]['on'](_0xf934('0x1a'),function(){if(_0xadf3c8[_0xf934('0x16')][_0x48757a]){delete _0xadf3c8[_0xf934('0x16')][_0x48757a];}});_0x4f26cc=setTimeout(function(){logger[_0xf934('0x7')](_0xf934('0x1b'),_0x48757a);clearTimeout(_0x4f26cc);_0x21adf7[_0xf934('0x19')]();_0x2e1b66['next']();},_0xc73da5);strategy[_0xf934('0x1c')](_0x21adf7,_0x5f324a,_0xadf3c8,_0x7b24c);}else{logger[_0xf934('0x1d')](_0xf934('0x1e'),_0x48757a,_0x40ab57[_0xf934('0x8')]);_0x2e1b66['stop']();}}}catch(_0x264b12){console[_0xf934('0x1f')](_0x264b12);logger[_0xf934('0x1d')](_0xf934('0x20'),_0x48757a,_0x264b12[_0xf934('0x21')]);_0x2e1b66['stop']();}};}; \ No newline at end of file +var _0x04be=['message','join','stop','timeout','createQueue','channel','START:%s','rules','[%s][AGENT]\x20ROUTING\x20STOPPED','close','info','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','stack','validate','lodash','util','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','error','[%s][AGENT]\x20%s','map'];(function(_0x4ccb31,_0x15cef9){var _0x4bce35=function(_0x4c9ac4){while(--_0x4c9ac4){_0x4ccb31['push'](_0x4ccb31['shift']());}};_0x4bce35(++_0x15cef9);}(_0x04be,0x106));var _0xe04b=function(_0x25af34,_0x5bf1f5){_0x25af34=_0x25af34-0x0;var _0x3f81bf=_0x04be[_0x25af34];return _0x3f81bf;};'use strict';var schema=require(_0xe04b('0x0'));var _=require(_0xe04b('0x1'));var util=require(_0xe04b('0x2'));var seqqueue=require('seq-queue');var logger=require(_0xe04b('0x3'))(_0xe04b('0x4'));var strategy=require(_0xe04b('0x5'));var queue=schema({'name':{'type':_0xe04b('0x6'),'required':!![],'message':_0xe04b('0x7')},'timeout':{'type':_0xe04b('0x8'),'message':_0xe04b('0x9')}});function writeLog(_0x178e22,_0x2e4fdb,_0x4c2b75){return logger['info'](util[_0xe04b('0xa')](_0xe04b('0xb'),_0x178e22,_0x2e4fdb[_0xe04b('0xc')],_0x4c2b75));}function handleFindAgent(_0x5a86bd){return function(_0x5628e1){return _0x5628e1[_0xe04b('0xc')]['toLowerCase']()===_0x5a86bd[_0xe04b('0xd')]();};}exports[_0xe04b('0xe')]=function(_0x24fca0,_0x15f1b6,_0x4abda6,_0x19342a){return function(_0x3378b4){try{var _0x5d94dc={'name':_0x15f1b6[0x0],'timeout':_0x15f1b6[0x1]};var _0x434e3c=queue['validate'](_0x5d94dc,{'typecast':!![]});if(_0x434e3c['length']){logger[_0xe04b('0xf')](_0xe04b('0x10'),_0x24fca0,_[_0xe04b('0x11')](_0x434e3c,_0xe04b('0x12'))[_0xe04b('0x13')](',\x20'));_0x3378b4[_0xe04b('0x14')]();}else{var _0x208fcc=_['find'](_0x4abda6['agents'],handleFindAgent(_0x5d94dc[_0xe04b('0xc')]));if(_0x208fcc){var _0x390c74=(_0x5d94dc[_0xe04b('0x15')]||0xa)*0x3e8;var _0xce7cc8,_0x3b6388;var _0x1d3a51=seqqueue[_0xe04b('0x16')](_0x390c74);_0x1d3a51['id']=_0x24fca0;_0x1d3a51['atimeout']=_0x390c74;_0x1d3a51[_0xe04b('0x17')]=_0x19342a['channel'];writeLog(_0x24fca0,_0x208fcc,util['format'](_0xe04b('0x18'),_0x390c74));_0x4abda6[_0xe04b('0x19')][_0x24fca0]['on']('end',function(){logger['info'](_0xe04b('0x1a'),_0x24fca0);clearTimeout(_0x3b6388);_0x3b6388=undefined;_0x1d3a51[_0xe04b('0x1b')]();if(_0x4abda6['rules'][_0x24fca0]){delete _0x4abda6[_0xe04b('0x19')][_0x24fca0];}_0x3378b4['stop']();});_0x4abda6[_0xe04b('0x19')][_0x24fca0]['on']('complete',function(){if(_0x4abda6[_0xe04b('0x19')][_0x24fca0]){delete _0x4abda6[_0xe04b('0x19')][_0x24fca0];}});_0x3b6388=setTimeout(function(){logger[_0xe04b('0x1c')](_0xe04b('0x1d'),_0x24fca0);clearTimeout(_0x3b6388);_0x1d3a51['close']();_0x3378b4[_0xe04b('0x1e')]();},_0x390c74);strategy[_0xe04b('0x1f')](_0x1d3a51,_0x208fcc,_0x4abda6,_0x19342a);}else{logger[_0xe04b('0xf')](_0xe04b('0x20'),_0x24fca0,_0x5d94dc[_0xe04b('0xc')]);_0x3378b4[_0xe04b('0x14')]();}}}catch(_0x4086d7){console[_0xe04b('0x21')](_0x4086d7);logger[_0xe04b('0xf')]('[%s][QUEUE]\x20%s',_0x24fca0,_0x4086d7[_0xe04b('0x22')]);_0x3378b4['stop']();}};}; \ 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 17d7cc9..ec75417 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 _0xfd21=['account','upperFirst','body','getMustacheRender','Message','info','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','LexRuntime','message','toString','postText','amazonlex','providerName','providerResponse','create','then','lodash','moment','aws-sdk','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','interaction','UserId','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss','channel','sms','whatsapp','phone','chat'];(function(_0x4c9fb9,_0xebf7b8){var _0x1bdb93=function(_0x42e150){while(--_0x42e150){_0x4c9fb9['push'](_0x4c9fb9['shift']());}};_0x1bdb93(++_0xebf7b8);}(_0xfd21,0x149));var _0x1fd2=function(_0x378a94,_0xf1c516){_0x378a94=_0x378a94-0x0;var _0x2e3640=_0xfd21[_0x378a94];return _0x2e3640;};'use strict';var _=require(_0x1fd2('0x0'));var moment=require(_0x1fd2('0x1'));var AWS=require(_0x1fd2('0x2'));var utils=require(_0x1fd2('0x3'));var logger=require('../../../../config/logger')(_0x1fd2('0x4'));var rpc={'chatMessage':require(_0x1fd2('0x5')),'openchannelMessage':require(_0x1fd2('0x6')),'mailMessage':require(_0x1fd2('0x7')),'smsMessage':require(_0x1fd2('0x8')),'faxMessage':require(_0x1fd2('0x9')),'whatsappMessage':require(_0x1fd2('0xa'))};exports['consequence']=function(_0x18f672,_0xa00d02){return function(_0x348a05){try{if(!_['isNil'](this[_0x1fd2('0xb')][_0x1fd2('0xc')])){logger['info'](_0x1fd2('0xd'),_0x18f672,_0x1fd2('0xe'));return _0x348a05[_0x1fd2('0xf')]();}var _0x2bc244={'ContactId':this[_0x1fd2('0x10')]['id'],'sentAt':moment()['format'](_0x1fd2('0x11')),'direction':'out'};if(this[_0x1fd2('0x12')]===_0x1fd2('0x13')||this['channel']===_0x1fd2('0x14')){_0x2bc244[_0x1fd2('0x15')]=this['interaction'][_0x1fd2('0x15')];}var _0x297d11=this[_0x1fd2('0x12')];if(_0x297d11===_0x1fd2('0x16')){_0x2bc244['ChatWebsiteId']=this[_0x1fd2('0x17')]['id'];}else{_0x2bc244[_[_0x1fd2('0x18')](_0x297d11)+'AccountId']=this[_0x1fd2('0x17')]['id'];}_0x2bc244[_[_0x1fd2('0x18')](_0x297d11)+'InteractionId']=this[_0x1fd2('0xb')]['id'];if(this[_0x1fd2('0xb')]['created']){var _0x25529a=_0xa00d02[0x4];if(!_['isEmpty'](_0x25529a)){_0x2bc244[_0x1fd2('0x19')]=utils[_0x1fd2('0x1a')](_0x25529a,this);return rpc[_0x297d11+_0x1fd2('0x1b')]['create'](_0x2bc244)['then'](function(_0x1296ce){logger[_0x1fd2('0x1c')](_0x1fd2('0xd'),_0x18f672,_0x2bc244[_0x1fd2('0x19')]);})[_0x1fd2('0x1d')](function(_0x3d7129){logger[_0x1fd2('0x1e')](_0x1fd2('0xd'),_0x18f672,JSON[_0x1fd2('0x1f')](_0x3d7129));})[_0x1fd2('0x20')](function(){logger[_0x1fd2('0x1c')](_0x1fd2('0x21'),_0x18f672);_0x348a05[_0x1fd2('0x22')]();});}else{logger[_0x1fd2('0x1c')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x18f672);_0x348a05[_0x1fd2('0x22')]();}}else{var _0x6db507=this;var _0x75835d=new AWS[(_0x1fd2('0x23'))]({'accessKeyId':_0xa00d02[0x0],'secretAccessKey':_0xa00d02[0x1],'region':_0xa00d02[0x2]});var _0x59df46={'botAlias':'$LATEST','botName':_0xa00d02[0x3],'inputText':this[_0x1fd2('0x24')][_0x1fd2('0x19')],'userId':this[_0x1fd2('0x12')]+':'+this['interaction']['id'][_0x1fd2('0x25')]()};_0x75835d[_0x1fd2('0x26')](_0x59df46,function(_0x1b5ac0,_0x27720d){if(_0x1b5ac0){logger[_0x1fd2('0x1e')](_0x1fd2('0xd'),_0x18f672,_0x1b5ac0[_0x1fd2('0x24')]);_0x348a05[_0x1fd2('0xf')]();}else if(_0x27720d&&_0x27720d['message']){_0x6db507[_0x1fd2('0x19')][_0x1fd2('0x27')]=_0x27720d;_0x2bc244[_0x1fd2('0x19')]=_0x27720d[_0x1fd2('0x24')];_0x2bc244[_0x1fd2('0x28')]=_0x1fd2('0x27');_0x2bc244[_0x1fd2('0x29')]=JSON[_0x1fd2('0x1f')](_0x27720d);return rpc[_0x297d11+_0x1fd2('0x1b')][_0x1fd2('0x2a')](_0x2bc244)[_0x1fd2('0x2b')](function(_0x477c61){logger['info'](_0x1fd2('0xd'),_0x18f672,_0x2bc244['body']);if(_0x27720d['dialogState']=='Failed'){_0x348a05['next']();}else{_0x348a05[_0x1fd2('0x22')]();}})[_0x1fd2('0x1d')](function(_0x4fa76c){logger[_0x1fd2('0x1e')](_0x1fd2('0xd'),_0x18f672,JSON['stringify'](_0x4fa76c));_0x348a05[_0x1fd2('0xf')]();});}else{_0x348a05[_0x1fd2('0xf')]();}});}}catch(_0x3082ee){logger[_0x1fd2('0x1e')](_0x1fd2('0xd'),_0x18f672,JSON[_0x1fd2('0x1f')](_0x3082ee));_0x348a05[_0x1fd2('0x22')]();}};}; \ No newline at end of file +var _0xe9c0=['phone','interaction','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','info','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!','LexRuntime','$LATEST','message','toString','postText','amazonlex','providerName','providerResponse','Failed','error','lodash','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','UserId','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','channel','sms'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0xe9c0,0xaf));var _0x0e9c=function(_0x55018a,_0x4b5296){_0x55018a=_0x55018a-0x0;var _0x2d1dea=_0xe9c0[_0x55018a];return _0x2d1dea;};'use strict';var _=require(_0x0e9c('0x0'));var moment=require('moment');var AWS=require('aws-sdk');var utils=require('./utils');var logger=require(_0x0e9c('0x1'))(_0x0e9c('0x2'));var rpc={'chatMessage':require(_0x0e9c('0x3')),'openchannelMessage':require(_0x0e9c('0x4')),'mailMessage':require(_0x0e9c('0x5')),'smsMessage':require(_0x0e9c('0x6')),'faxMessage':require(_0x0e9c('0x7')),'whatsappMessage':require(_0x0e9c('0x8'))};exports['consequence']=function(_0x27335d,_0x214160){return function(_0x351b8c){try{if(!_[_0x0e9c('0x9')](this['interaction'][_0x0e9c('0xa')])){logger['info'](_0x0e9c('0xb'),_0x27335d,_0x0e9c('0xc'));return _0x351b8c[_0x0e9c('0xd')]();}var _0x4fdfe8={'ContactId':this['contact']['id'],'sentAt':moment()[_0x0e9c('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this[_0x0e9c('0xf')]===_0x0e9c('0x10')||this[_0x0e9c('0xf')]==='whatsapp'){_0x4fdfe8[_0x0e9c('0x11')]=this[_0x0e9c('0x12')]['phone'];}var _0x290f97=this[_0x0e9c('0xf')];if(_0x290f97==='chat'){_0x4fdfe8[_0x0e9c('0x13')]=this['account']['id'];}else{_0x4fdfe8[_[_0x0e9c('0x14')](_0x290f97)+_0x0e9c('0x15')]=this[_0x0e9c('0x16')]['id'];}_0x4fdfe8[_[_0x0e9c('0x14')](_0x290f97)+_0x0e9c('0x17')]=this['interaction']['id'];if(this[_0x0e9c('0x12')][_0x0e9c('0x18')]){var _0x14b1d5=_0x214160[0x4];if(!_[_0x0e9c('0x19')](_0x14b1d5)){_0x4fdfe8[_0x0e9c('0x1a')]=utils[_0x0e9c('0x1b')](_0x14b1d5,this);return rpc[_0x290f97+_0x0e9c('0x1c')][_0x0e9c('0x1d')](_0x4fdfe8)[_0x0e9c('0x1e')](function(_0x41c325){logger[_0x0e9c('0x1f')]('[%s][AMAZONLEX]\x20%s',_0x27335d,_0x4fdfe8[_0x0e9c('0x1a')]);})[_0x0e9c('0x20')](function(_0x4946b3){logger['error'](_0x0e9c('0xb'),_0x27335d,JSON[_0x0e9c('0x21')](_0x4946b3));})[_0x0e9c('0x22')](function(){logger[_0x0e9c('0x1f')](_0x0e9c('0x23'),_0x27335d);_0x351b8c[_0x0e9c('0x24')]();});}else{logger['info'](_0x0e9c('0x25'),_0x27335d);_0x351b8c['stop']();}}else{var _0x3f1c84=this;var _0x240a91=new AWS[(_0x0e9c('0x26'))]({'accessKeyId':_0x214160[0x0],'secretAccessKey':_0x214160[0x1],'region':_0x214160[0x2]});var _0x2a8402={'botAlias':_0x0e9c('0x27'),'botName':_0x214160[0x3],'inputText':this[_0x0e9c('0x28')][_0x0e9c('0x1a')],'userId':this[_0x0e9c('0xf')]+':'+this[_0x0e9c('0x12')]['id'][_0x0e9c('0x29')]()};_0x240a91[_0x0e9c('0x2a')](_0x2a8402,function(_0x159290,_0x236055){if(_0x159290){logger['error'](_0x0e9c('0xb'),_0x27335d,_0x159290[_0x0e9c('0x28')]);_0x351b8c[_0x0e9c('0xd')]();}else if(_0x236055&&_0x236055[_0x0e9c('0x28')]){_0x3f1c84['body'][_0x0e9c('0x2b')]=_0x236055;_0x4fdfe8[_0x0e9c('0x1a')]=_0x236055[_0x0e9c('0x28')];_0x4fdfe8[_0x0e9c('0x2c')]='amazonlex';_0x4fdfe8[_0x0e9c('0x2d')]=JSON[_0x0e9c('0x21')](_0x236055);return rpc[_0x290f97+_0x0e9c('0x1c')][_0x0e9c('0x1d')](_0x4fdfe8)[_0x0e9c('0x1e')](function(_0x3a3da1){logger[_0x0e9c('0x1f')](_0x0e9c('0xb'),_0x27335d,_0x4fdfe8[_0x0e9c('0x1a')]);if(_0x236055['dialogState']==_0x0e9c('0x2e')){_0x351b8c[_0x0e9c('0xd')]();}else{_0x351b8c[_0x0e9c('0x24')]();}})[_0x0e9c('0x20')](function(_0x252577){logger[_0x0e9c('0x2f')]('[%s][AMAZONLEX]\x20%s',_0x27335d,JSON[_0x0e9c('0x21')](_0x252577));_0x351b8c[_0x0e9c('0xd')]();});}else{_0x351b8c['next']();}});}}catch(_0x8ccbd2){logger[_0x0e9c('0x2f')](_0x0e9c('0xb'),_0x27335d,JSON[_0x0e9c('0x21')](_0x8ccbd2));_0x351b8c['stop']();}};}; \ 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 e15f038..830d566 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 _0x16a9=['upperFirst','account','Message','inReplyTo','messageId','html','replace','','headers','auto-replied','sendMailMessage','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','then','Interaction','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','update','stop','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','channel','mail','body','isAutoreply','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','isNil','interaction','created','info','Autoreply\x20already\x20sent','autoreplyExecuted','One\x20Time\x20already\x20sent','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','from','phone','read','subject','startsWith','chat','ChatWebsiteId'];(function(_0x481bf7,_0x437f69){var _0x461787=function(_0xb3bc9d){while(--_0xb3bc9d){_0x481bf7['push'](_0x481bf7['shift']());}};_0x461787(++_0x437f69);}(_0x16a9,0x9b));var _0x916a=function(_0x112be3,_0x173ae7){_0x112be3=_0x112be3-0x0;var _0x5d4c77=_0x16a9[_0x112be3];return _0x5d4c77;};'use strict';var _=require('lodash');var moment=require('moment');var utils=require(_0x916a('0x0'));var logger=require(_0x916a('0x1'))(_0x916a('0x2'));var rpc={'chatMessage':require(_0x916a('0x3')),'openchannelMessage':require(_0x916a('0x4')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x916a('0x5')),'faxMessage':require(_0x916a('0x6')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0x916a('0x7')),'openchannelInteraction':require(_0x916a('0x8')),'mailInteraction':require('../../rpc/mailInteraction'),'smsInteraction':require(_0x916a('0x9')),'faxInteraction':require(_0x916a('0xa')),'whatsappInteraction':require(_0x916a('0xb'))};var mailRpc=require(_0x916a('0xc'));exports['consequence']=function(_0x195eaf,_0x5c1c49,_0x205a19,_0x410615){return function(_0x50b1e0){try{var _0x3a79bf=this[_0x916a('0xd')];if(_0x3a79bf===_0x916a('0xe')&&_0x410615[_0x916a('0xf')][_0x916a('0x10')]){logger['info'](_0x916a('0x11'),_0x195eaf,_0x916a('0x12'));return _0x50b1e0['next']();}if(_0x5c1c49[0x0]==='1'&&(_[_0x916a('0x13')](this[_0x916a('0x14')][_0x916a('0x15')])||!this[_0x916a('0x14')][_0x916a('0x15')])){logger[_0x916a('0x16')]('[%s][AUTOREPLY]\x20%s',_0x195eaf,_0x916a('0x17'));return _0x50b1e0['next']();}if(_0x5c1c49[0x0]==='2'&&this['interaction'][_0x916a('0x18')]){logger[_0x916a('0x16')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x195eaf,_0x916a('0x19'));return _0x50b1e0[_0x916a('0x1a')]();}var _0x9af02e={'ContactId':this[_0x916a('0x1b')]['id'],'sentAt':moment()[_0x916a('0x1c')](_0x916a('0x1d')),'direction':_0x916a('0x1e')};if(this[_0x916a('0xd')]===_0x916a('0xe')){_0x9af02e['body']=utils[_0x916a('0x1f')](_0x5c1c49[0x2],this);}else{_0x9af02e[_0x916a('0xf')]=utils[_0x916a('0x1f')](_0x5c1c49[0x1],this);}if(this[_0x916a('0x20')]){_0x9af02e['to']=this['message'][_0x916a('0x21')]||'';if(this[_0x916a('0xd')]===_0x916a('0xe')&&_0x5c1c49[0x1]==='1'){_0x9af02e['cc']=this[_0x916a('0x20')]['cc']||'';}_0x9af02e['from']=this[_0x916a('0x20')]['to']||'';_0x9af02e[_0x916a('0x22')]=this[_0x916a('0x20')]['phone']||'';_0x9af02e[_0x916a('0x23')]=!![];if(this[_0x916a('0x20')]['subject']){_0x9af02e[_0x916a('0x24')]='';_0x9af02e['subject']+=_[_0x916a('0x25')](this['message'][_0x916a('0x24')],'Re:')?'':'Re:\x20';_0x9af02e[_0x916a('0x24')]+=this['message'][_0x916a('0x24')];}}if(this[_0x916a('0xd')]===_0x916a('0x26')){_0x9af02e[_0x916a('0x27')]=this['account']['id'];}else{_0x9af02e[_[_0x916a('0x28')](this[_0x916a('0xd')])+'AccountId']=this[_0x916a('0x29')]['id'];}_0x9af02e[_[_0x916a('0x28')](this[_0x916a('0xd')])+'InteractionId']=this[_0x916a('0x14')]['id'];var _0x2aa355=this[_0x916a('0x14')];if(rpc[this[_0x916a('0xd')]+_0x916a('0x2a')]){if(this[_0x916a('0xd')]===_0x916a('0xe')){_0x9af02e[_0x916a('0x2b')]=this['message'][_0x916a('0x2c')];_0x9af02e[_0x916a('0x2d')]=''+_[_0x916a('0x2e')](_0x9af02e['body'],'','replace','';_0x4bb75b['headers']={'Auto-Submitted':_0x5bf6('0x32'),'X-Auto-Response-Suppress':_0x5bf6('0x33'),'Precedence':_0x5bf6('0x34')};return mailRpc[_0x5bf6('0x35')](this[_0x5bf6('0x28')]['smtpOptions'],_0x4bb75b)['then'](function(_0x34d02f){logger[_0x5bf6('0x12')](_0x5bf6('0x36'),_0xeb1e3a);_0x4bb75b['messageId']=_0x34d02f[_0x5bf6('0x1f')]['messageId'];return rpc[_0x4abeb4+_0x5bf6('0x2b')]['create'](_0x4bb75b);})[_0x5bf6('0x37')](function(_0x4e8d53){logger['info'](_0x5bf6('0x13'),_0xeb1e3a,JSON[_0x5bf6('0x38')](_0x4e8d53));})[_0x5bf6('0x39')](function(_0x3e6603){logger[_0x5bf6('0x3a')](_0x5bf6('0x3b'),_0xeb1e3a,JSON['stringify'](_0x3e6603));})['finally'](function(){Promise[_0x5bf6('0x3c')]()[_0x5bf6('0x37')](function(){if(_0x53fa26[0x0]!=='2'||_0x3a0daa[_0x5bf6('0x3d')])return;return rpc[_0x4abeb4+'Interaction']['update'](_0x3a0daa['id'],{'autoreplyExecuted':!![]})[_0x5bf6('0x37')](function(_0x29c073){logger['info'](_0x5bf6('0x19'),_0xeb1e3a,JSON[_0x5bf6('0x38')](_0x29c073));})['catch'](function(_0x5f370d){logger[_0x5bf6('0x3a')](_0x5bf6('0x3e'),_0xeb1e3a,JSON[_0x5bf6('0x38')](_0x5f370d));});})[_0x5bf6('0x37')](function(){_0x5e8e7[_0x5bf6('0x14')]();});});}else{return rpc[this['channel']+_0x5bf6('0x2b')][_0x5bf6('0x3f')](_0x4bb75b)[_0x5bf6('0x37')](function(){logger[_0x5bf6('0x12')](_0x5bf6('0x13'),_0xeb1e3a,_0x4bb75b[_0x5bf6('0x11')]);})['catch'](function(_0x6e336c){logger[_0x5bf6('0x3a')](_0x5bf6('0x13'),_0xeb1e3a,JSON[_0x5bf6('0x38')](_0x6e336c));})['finally'](function(){Promise['resolve']()[_0x5bf6('0x37')](function(){if(_0x53fa26[0x0]!=='2'||_0x3a0daa[_0x5bf6('0x3d')])return;return rpc[_0x4abeb4+_0x5bf6('0x40')][_0x5bf6('0x41')](_0x3a0daa['id'],{'autoreplyExecuted':!![]})[_0x5bf6('0x37')](function(_0x152dd8){logger[_0x5bf6('0x12')](_0x5bf6('0x19'),_0xeb1e3a,JSON[_0x5bf6('0x38')](_0x152dd8));})['catch'](function(_0x15c4dd){logger[_0x5bf6('0x3a')](_0x5bf6('0x3e'),_0xeb1e3a,JSON[_0x5bf6('0x38')](_0x15c4dd));});})[_0x5bf6('0x37')](function(){_0x5e8e7[_0x5bf6('0x14')]();});});}}}catch(_0x4b26b1){logger[_0x5bf6('0x3a')](_0x5bf6('0x13'),_0xeb1e3a,JSON['stringify'](_0x4b26b1));_0x5e8e7[_0x5bf6('0x42')]();}};}; \ 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 6845074..90a1dd3 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 _0xe72b=['Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stringify','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','channel'];(function(_0x5027b1,_0x1409a5){var _0x4a46cf=function(_0x121920){while(--_0x121920){_0x5027b1['push'](_0x5027b1['shift']());}};_0x4a46cf(++_0x1409a5);}(_0xe72b,0x65));var _0xbe72=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xe72b[_0x4c12ec];return _0x3ae42c;};'use strict';var moment=require('moment');var logger=require(_0xbe72('0x0'))(_0xbe72('0x1'));var rpc={'chatInteraction':require(_0xbe72('0x2')),'openchannelInteraction':require(_0xbe72('0x3')),'smsInteraction':require(_0xbe72('0x4')),'mailInteraction':require(_0xbe72('0x5')),'faxInteraction':require(_0xbe72('0x6')),'whatsappInteraction':require(_0xbe72('0x7'))};exports[_0xbe72('0x8')]=function(_0x1e64d1,_0x4f2476,_0x17800f,_0x2415d6){return function(_0x3b96f7){try{logger[_0xbe72('0x9')](_0xbe72('0xa'),_0x1e64d1,_0x4f2476[0x0]);var _0x29919c={'closed':0x1,'closedAt':moment()[_0xbe72('0xb')](_0xbe72('0xc')),'closeReason':'system','disposition':_0x4f2476[0x0]};if(rpc[_0x2415d6[_0xbe72('0xd')]+_0xbe72('0xe')]){rpc[_0x2415d6[_0xbe72('0xd')]+_0xbe72('0xe')][_0xbe72('0xf')](_0x2415d6[_0xbe72('0x10')]['id'],_0x29919c)[_0xbe72('0x11')](function(_0x44b283){logger[_0xbe72('0x9')](_0xbe72('0x12'),_0x1e64d1,_0x2415d6[_0xbe72('0x10')]['id']);})[_0xbe72('0x13')](function(_0x53333f){logger[_0xbe72('0x14')](_0xbe72('0x15'),_0x1e64d1,JSON[_0xbe72('0x16')](_0x53333f));})['finally'](function(){_0x3b96f7['stop']();});}}catch(_0x3ec8b9){logger[_0xbe72('0x14')](_0xbe72('0x15'),_0x1e64d1,JSON[_0xbe72('0x16')](_0x3ec8b9));_0x3b96f7['stop']();}};}; \ No newline at end of file +var _0xdd02=['[%s][CLOSE]\x20%s','stringify','finally','stop','moment','../../../../config/logger','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','system','channel','Interaction','update','interaction','catch','error'];(function(_0x59b59a,_0x3466d6){var _0x5cbbee=function(_0x567eca){while(--_0x567eca){_0x59b59a['push'](_0x59b59a['shift']());}};_0x5cbbee(++_0x3466d6);}(_0xdd02,0xd3));var _0x2dd0=function(_0x1bae3e,_0x530eae){_0x1bae3e=_0x1bae3e-0x0;var _0x4e4f94=_0xdd02[_0x1bae3e];return _0x4e4f94;};'use strict';var moment=require(_0x2dd0('0x0'));var logger=require(_0x2dd0('0x1'))('routing');var rpc={'chatInteraction':require(_0x2dd0('0x2')),'openchannelInteraction':require(_0x2dd0('0x3')),'smsInteraction':require(_0x2dd0('0x4')),'mailInteraction':require(_0x2dd0('0x5')),'faxInteraction':require(_0x2dd0('0x6')),'whatsappInteraction':require(_0x2dd0('0x7'))};exports[_0x2dd0('0x8')]=function(_0x5da2d6,_0x495507,_0x14a48c,_0x196733){return function(_0x174e60){try{logger[_0x2dd0('0x9')](_0x2dd0('0xa'),_0x5da2d6,_0x495507[0x0]);var _0x5cf154={'closed':0x1,'closedAt':moment()[_0x2dd0('0xb')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0x2dd0('0xc'),'disposition':_0x495507[0x0]};if(rpc[_0x196733[_0x2dd0('0xd')]+_0x2dd0('0xe')]){rpc[_0x196733[_0x2dd0('0xd')]+'Interaction'][_0x2dd0('0xf')](_0x196733[_0x2dd0('0x10')]['id'],_0x5cf154)['then'](function(_0x2418c4){logger[_0x2dd0('0x9')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x5da2d6,_0x196733[_0x2dd0('0x10')]['id']);})[_0x2dd0('0x11')](function(_0x257fd8){logger[_0x2dd0('0x12')](_0x2dd0('0x13'),_0x5da2d6,JSON[_0x2dd0('0x14')](_0x257fd8));})[_0x2dd0('0x15')](function(){_0x174e60[_0x2dd0('0x16')]();});}}catch(_0x4f3166){logger[_0x2dd0('0x12')](_0x2dd0('0x13'),_0x5da2d6,JSON[_0x2dd0('0x14')](_0x4f3166));_0x174e60['stop']();}};}; \ 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 6c5dd37..01af801 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 _0xb2ac=['getMustacheRender','then','info','catch','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','result','fulfillment','speech','dialogflow','providerResponse','create','endConversation','error','lodash','moment','apiai-promise','md5','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','UserId','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss','out','sms','phone','interaction','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','created','body'];(function(_0x46700d,_0x66029f){var _0x2a4c5e=function(_0x3af2f7){while(--_0x3af2f7){_0x46700d['push'](_0x46700d['shift']());}};_0x2a4c5e(++_0x66029f);}(_0xb2ac,0x16a));var _0xcb2a=function(_0x5b629f,_0x4d897a){_0x5b629f=_0x5b629f-0x0;var _0x1cb3ea=_0xb2ac[_0x5b629f];return _0x1cb3ea;};'use strict';var _=require(_0xcb2a('0x0'));var moment=require(_0xcb2a('0x1'));var apiai=require(_0xcb2a('0x2'));var md5=require(_0xcb2a('0x3'));var utils=require(_0xcb2a('0x4'));var logger=require(_0xcb2a('0x5'))('routing');var rpc={'chatMessage':require(_0xcb2a('0x6')),'openchannelMessage':require(_0xcb2a('0x7')),'mailMessage':require(_0xcb2a('0x8')),'smsMessage':require(_0xcb2a('0x9')),'faxMessage':require(_0xcb2a('0xa')),'whatsappMessage':require(_0xcb2a('0xb'))};exports['consequence']=function(_0x2a8de8,_0x3e87c1){return function(_0x55dddc){try{if(!_['isNil'](this['interaction'][_0xcb2a('0xc')])){logger['info'](_0xcb2a('0xd'),_0x2a8de8,_0xcb2a('0xe'));return _0x55dddc[_0xcb2a('0xf')]();}var _0x440200={'ContactId':this[_0xcb2a('0x10')]['id'],'sentAt':moment()['format'](_0xcb2a('0x11')),'direction':_0xcb2a('0x12')};if(this['channel']===_0xcb2a('0x13')||this['channel']==='whatsapp'){_0x440200[_0xcb2a('0x14')]=this[_0xcb2a('0x15')][_0xcb2a('0x14')];}var _0x62bd7f=this['channel'];if(_0x62bd7f===_0xcb2a('0x16')){_0x440200[_0xcb2a('0x17')]=this['account']['id'];}else{_0x440200[_[_0xcb2a('0x18')](_0x62bd7f)+_0xcb2a('0x19')]=this[_0xcb2a('0x1a')]['id'];}_0x440200[_[_0xcb2a('0x18')](_0x62bd7f)+_0xcb2a('0x1b')]=this[_0xcb2a('0x15')]['id'];if(this[_0xcb2a('0x15')][_0xcb2a('0x1c')]){var _0x51bba7=_0x3e87c1[0x2];if(!_['isEmpty'](_0x51bba7)){_0x440200[_0xcb2a('0x1d')]=utils[_0xcb2a('0x1e')](_0x51bba7,this);return rpc[_0x62bd7f+'Message']['create'](_0x440200)[_0xcb2a('0x1f')](function(_0x30014d){logger[_0xcb2a('0x20')](_0xcb2a('0xd'),_0x2a8de8,_0x440200[_0xcb2a('0x1d')]);})[_0xcb2a('0x21')](function(_0x2d3faa){logger['error'](_0xcb2a('0xd'),_0x2a8de8,JSON[_0xcb2a('0x22')](_0x2d3faa));})[_0xcb2a('0x23')](function(){logger[_0xcb2a('0x20')](_0xcb2a('0x24'),_0x2a8de8);_0x55dddc[_0xcb2a('0x25')]();});}else{logger[_0xcb2a('0x20')](_0xcb2a('0x26'),_0x2a8de8);_0x55dddc['stop']();}}else{var _0xf6d7f1=this;var _0x269fa1=apiai(_0x3e87c1[0x0],{'language':_0x3e87c1[0x1]||'en'});return _0x269fa1[_0xcb2a('0x27')](this[_0xcb2a('0x28')]['body'],{'sessionId':md5(this[_0xcb2a('0x15')]['id'])})[_0xcb2a('0x1f')](function(_0x20eee4){_0xf6d7f1[_0xcb2a('0x1d')]['dialogflow']=_0x20eee4;_0x440200[_0xcb2a('0x1d')]=_0x20eee4[_0xcb2a('0x29')][_0xcb2a('0x2a')][_0xcb2a('0x2b')];_0x440200['providerName']=_0xcb2a('0x2c');_0x440200[_0xcb2a('0x2d')]=JSON[_0xcb2a('0x22')](_0x20eee4);return rpc[_0x62bd7f+'Message'][_0xcb2a('0x2e')](_0x440200)[_0xcb2a('0x1f')](function(_0x3d093a){logger[_0xcb2a('0x20')](_0xcb2a('0xd'),_0x2a8de8,_0x440200['body']);if(_0x20eee4[_0xcb2a('0x29')]['metadata'][_0xcb2a('0x2f')]){_0x55dddc[_0xcb2a('0xf')]();}else{_0x55dddc[_0xcb2a('0x25')]();}})[_0xcb2a('0x21')](function(_0x2f3191){logger[_0xcb2a('0x30')](_0xcb2a('0xd'),_0x2a8de8,JSON['stringify'](_0x2f3191));_0x55dddc[_0xcb2a('0xf')]();});})[_0xcb2a('0x21')](function(_0x57f7a2){logger[_0xcb2a('0x30')](_0xcb2a('0xd'),_0x2a8de8,_0x57f7a2['message']);_0x55dddc['next']();});}}catch(_0x555267){logger[_0xcb2a('0x30')](_0xcb2a('0xd'),_0x2a8de8,JSON[_0xcb2a('0x22')](_0x555267));_0x55dddc[_0xcb2a('0x25')]();}};}; \ No newline at end of file +var _0x16ce=['catch','moment','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','phone','ChatWebsiteId','account','upperFirst','AccountId','created','isEmpty','body','getMustacheRender','Message','create','info','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','textRequest','message','then','dialogflow','result','fulfillment','providerName','providerResponse','metadata','endConversation'];(function(_0x42e612,_0x4ee2ab){var _0x466dcc=function(_0x740f8b){while(--_0x740f8b){_0x42e612['push'](_0x42e612['shift']());}};_0x466dcc(++_0x4ee2ab);}(_0x16ce,0xfb));var _0xe16c=function(_0x1ec6fb,_0x5633a2){_0x1ec6fb=_0x1ec6fb-0x0;var _0x13b964=_0x16ce[_0x1ec6fb];return _0x13b964;};'use strict';var _=require('lodash');var moment=require(_0xe16c('0x0'));var apiai=require(_0xe16c('0x1'));var md5=require(_0xe16c('0x2'));var utils=require(_0xe16c('0x3'));var logger=require(_0xe16c('0x4'))(_0xe16c('0x5'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xe16c('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xe16c('0x7'))};exports[_0xe16c('0x8')]=function(_0x3b149c,_0x1cf3f9){return function(_0x1d8b72){try{if(!_[_0xe16c('0x9')](this[_0xe16c('0xa')][_0xe16c('0xb')])){logger['info'](_0xe16c('0xc'),_0x3b149c,_0xe16c('0xd'));return _0x1d8b72[_0xe16c('0xe')]();}var _0x2e59ad={'ContactId':this[_0xe16c('0xf')]['id'],'sentAt':moment()[_0xe16c('0x10')](_0xe16c('0x11')),'direction':_0xe16c('0x12')};if(this[_0xe16c('0x13')]===_0xe16c('0x14')||this[_0xe16c('0x13')]==='whatsapp'){_0x2e59ad[_0xe16c('0x15')]=this[_0xe16c('0xa')][_0xe16c('0x15')];}var _0x2c439f=this['channel'];if(_0x2c439f==='chat'){_0x2e59ad[_0xe16c('0x16')]=this[_0xe16c('0x17')]['id'];}else{_0x2e59ad[_[_0xe16c('0x18')](_0x2c439f)+_0xe16c('0x19')]=this['account']['id'];}_0x2e59ad[_[_0xe16c('0x18')](_0x2c439f)+'InteractionId']=this[_0xe16c('0xa')]['id'];if(this[_0xe16c('0xa')][_0xe16c('0x1a')]){var _0x5b7439=_0x1cf3f9[0x2];if(!_[_0xe16c('0x1b')](_0x5b7439)){_0x2e59ad[_0xe16c('0x1c')]=utils[_0xe16c('0x1d')](_0x5b7439,this);return rpc[_0x2c439f+_0xe16c('0x1e')][_0xe16c('0x1f')](_0x2e59ad)['then'](function(_0x99130d){logger[_0xe16c('0x20')](_0xe16c('0xc'),_0x3b149c,_0x2e59ad['body']);})['catch'](function(_0x533933){logger[_0xe16c('0x21')](_0xe16c('0xc'),_0x3b149c,JSON[_0xe16c('0x22')](_0x533933));})[_0xe16c('0x23')](function(){logger[_0xe16c('0x20')](_0xe16c('0x24'),_0x3b149c);_0x1d8b72['stop']();});}else{logger[_0xe16c('0x20')](_0xe16c('0x25'),_0x3b149c);_0x1d8b72[_0xe16c('0x26')]();}}else{var _0x9909dc=this;var _0x5a88ed=apiai(_0x1cf3f9[0x0],{'language':_0x1cf3f9[0x1]||'en'});return _0x5a88ed[_0xe16c('0x27')](this[_0xe16c('0x28')][_0xe16c('0x1c')],{'sessionId':md5(this[_0xe16c('0xa')]['id'])})[_0xe16c('0x29')](function(_0x18669a){_0x9909dc[_0xe16c('0x1c')][_0xe16c('0x2a')]=_0x18669a;_0x2e59ad['body']=_0x18669a[_0xe16c('0x2b')][_0xe16c('0x2c')]['speech'];_0x2e59ad[_0xe16c('0x2d')]='dialogflow';_0x2e59ad[_0xe16c('0x2e')]=JSON['stringify'](_0x18669a);return rpc[_0x2c439f+_0xe16c('0x1e')][_0xe16c('0x1f')](_0x2e59ad)[_0xe16c('0x29')](function(_0x156de3){logger[_0xe16c('0x20')](_0xe16c('0xc'),_0x3b149c,_0x2e59ad[_0xe16c('0x1c')]);if(_0x18669a[_0xe16c('0x2b')][_0xe16c('0x2f')][_0xe16c('0x30')]){_0x1d8b72['next']();}else{_0x1d8b72[_0xe16c('0x26')]();}})[_0xe16c('0x31')](function(_0x397682){logger['error'](_0xe16c('0xc'),_0x3b149c,JSON[_0xe16c('0x22')](_0x397682));_0x1d8b72['next']();});})[_0xe16c('0x31')](function(_0x25ec64){logger['error'](_0xe16c('0xc'),_0x3b149c,_0x25ec64[_0xe16c('0x28')]);_0x1d8b72[_0xe16c('0xe')]();});}}catch(_0x190c73){logger[_0xe16c('0x21')](_0xe16c('0xc'),_0x3b149c,JSON['stringify'](_0x190c73));_0x1d8b72[_0xe16c('0x26')]();}};}; \ 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 3d98c18..e6c6b19 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 _0x8498=['format','out','channel','sms','whatsapp','phone','interaction','chat','ChatWebsiteId','account','upperFirst','AccountId','created','getMustacheRender','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','replace','SessionsClient','sessionPath','message','queryResult','diagnosticInfo','fields','end_conversation','boolValue','action','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','isFallback','DIALOGFLOWV2_LANGUAGECODE','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','dialogflowV2','push','fulfillmentText','all','error','lodash','md5','bluebird','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','body','Message','create','then','info','catch','[%s][DIALOGFLOWV2]\x20%s','stringify','consequence','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8498,0x70));var _0x8849=function(_0x31137d,_0x2314c1){_0x31137d=_0x31137d-0x0;var _0x37b30c=_0x8498[_0x31137d];return _0x37b30c;};'use strict';var _=require(_0x8849('0x0'));var dialogflow=require('dialogflow');var md5=require(_0x8849('0x1'));var moment=require('moment');var Promise=require(_0x8849('0x2'));var logger=require(_0x8849('0x3'))('routing');var utils=require('./utils');var rpc={'chatMessage':require(_0x8849('0x4')),'openchannelMessage':require(_0x8849('0x5')),'mailMessage':require(_0x8849('0x6')),'smsMessage':require(_0x8849('0x7')),'faxMessage':require(_0x8849('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x2e3ba5,_0x48adb8,_0x59a0c4,_0x5a5ab9){return new Promise(function(_0x424824,_0x40e2d6){var _0x28ff0e=_['clone'](_0x59a0c4);_0x28ff0e[_0x8849('0x9')]=_0x5a5ab9;return rpc[_0x48adb8+_0x8849('0xa')][_0x8849('0xb')](_0x28ff0e)[_0x8849('0xc')](function(){logger[_0x8849('0xd')]('[%s][DIALOGFLOWV2]\x20%s',_0x2e3ba5,_0x28ff0e[_0x8849('0x9')]);_0x424824();})[_0x8849('0xe')](function(_0x49ddd7){logger['error'](_0x8849('0xf'),_0x2e3ba5,JSON[_0x8849('0x10')](_0x49ddd7));_0x40e2d6(_0x49ddd7);});});}exports[_0x8849('0x11')]=function(_0x56aa30,_0x5cdce6){return function(_0x3f967e){try{if(!_['isNil'](this['interaction']['UserId'])){logger[_0x8849('0xd')](_0x8849('0xf'),_0x56aa30,_0x8849('0x12'));return _0x3f967e[_0x8849('0x13')]();}var _0x4bfe95={'ContactId':this['contact']['id'],'sentAt':moment()[_0x8849('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x8849('0x15')};if(this[_0x8849('0x16')]===_0x8849('0x17')||this[_0x8849('0x16')]===_0x8849('0x18')){_0x4bfe95[_0x8849('0x19')]=this[_0x8849('0x1a')][_0x8849('0x19')];}var _0x2d38b9=this[_0x8849('0x16')];if(_0x2d38b9===_0x8849('0x1b')){_0x4bfe95[_0x8849('0x1c')]=this[_0x8849('0x1d')]['id'];}else{_0x4bfe95[_[_0x8849('0x1e')](_0x2d38b9)+_0x8849('0x1f')]=this[_0x8849('0x1d')]['id'];}_0x4bfe95[_['upperFirst'](_0x2d38b9)+'InteractionId']=this[_0x8849('0x1a')]['id'];if(this[_0x8849('0x1a')][_0x8849('0x20')]){var _0x22bac7=_0x5cdce6[0x4];if(!_['isEmpty'](_0x22bac7)){_0x4bfe95[_0x8849('0x9')]=utils[_0x8849('0x21')](_0x22bac7,this);return rpc[_0x2d38b9+_0x8849('0xa')][_0x8849('0xb')](_0x4bfe95)[_0x8849('0xc')](function(_0x2fed2c){logger[_0x8849('0xd')]('[%s][DIALOGFLOWV2]\x20%s',_0x56aa30,_0x4bfe95[_0x8849('0x9')]);})[_0x8849('0xe')](function(_0x545eb2){logger['error'](_0x8849('0xf'),_0x56aa30,JSON[_0x8849('0x10')](_0x545eb2));})[_0x8849('0x22')](function(){logger[_0x8849('0xd')](_0x8849('0x23'),_0x56aa30);_0x3f967e['stop']();});}else{logger['info'](_0x8849('0x24'),_0x56aa30);_0x3f967e[_0x8849('0x25')]();}}else{var _0x31a10d=this;var _0x3b622b=_0x5cdce6[0x2][_0x8849('0x26')](/\\n/g,'\x0a');var _0x4ded0f={'credentials':{'private_key':_0x3b622b,'client_email':_0x5cdce6[0x1]}};var _0xfed6f3=new dialogflow[(_0x8849('0x27'))](_0x4ded0f);var _0x51733c=_0xfed6f3[_0x8849('0x28')](_0x5cdce6[0x0],md5(_0x31a10d[_0x8849('0x1a')]['id']));var _0x12a940={'session':_0x51733c,'queryInput':{'text':{'text':_0x31a10d[_0x8849('0x29')]['body'],'languageCode':_0x5cdce6[0x3]||'en'}}};return _0xfed6f3['detectIntent'](_0x12a940)['then'](function(_0x5b6256){if(_0x5b6256&&_0x5b6256['length']){_0x31a10d[_0x8849('0x9')]['dialogflowV2']=_0x5b6256;var _0x292213=_0x5b6256[0x0];var _0x2ff150=_0x292213[_0x8849('0x2a')]['diagnosticInfo']&&_0x292213['queryResult'][_0x8849('0x2b')][_0x8849('0x2c')]?_0x292213[_0x8849('0x2a')][_0x8849('0x2b')][_0x8849('0x2c')][_0x8849('0x2d')][_0x8849('0x2e')]:![];_0x31a10d[_0x8849('0x9')]['DIALOGFLOWV2_ACTION']=_0x292213['queryResult'][_0x8849('0x2f')];_0x31a10d[_0x8849('0x9')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x292213[_0x8849('0x2a')][_0x8849('0x30')];_0x31a10d[_0x8849('0x9')][_0x8849('0x31')]=_0x292213[_0x8849('0x2a')][_0x8849('0x2b')]&&_0x292213[_0x8849('0x2a')][_0x8849('0x2b')]['fields']?_0x292213['queryResult'][_0x8849('0x2b')][_0x8849('0x2c')][_0x8849('0x2d')]['boolValue']:![];_0x31a10d[_0x8849('0x9')][_0x8849('0x32')]=_0x292213[_0x8849('0x2a')][_0x8849('0x33')][_0x8849('0x34')];_0x31a10d[_0x8849('0x9')][_0x8849('0x35')]=_0x292213[_0x8849('0x2a')][_0x8849('0x33')]['displayName'];_0x31a10d[_0x8849('0x9')]['DIALOGFLOWV2_ISFALLBACKINTENT']=_0x292213[_0x8849('0x2a')][_0x8849('0x33')][_0x8849('0x36')];_0x31a10d[_0x8849('0x9')][_0x8849('0x37')]=_0x292213['queryResult']['languageCode'];_0x31a10d[_0x8849('0x9')][_0x8849('0x38')]=_0x292213[_0x8849('0x2a')][_0x8849('0x39')];_0x31a10d[_0x8849('0x9')][_0x8849('0x3a')]=_0x292213[_0x8849('0x2a')][_0x8849('0x3b')];_0x4bfe95[_0x8849('0x3c')]=_0x8849('0x3d');_0x4bfe95['providerResponse']=JSON['stringify'](_0x5b6256);var _0x2c4760=[];for(var _0x3cf640=0x0;_0x3cf640<_0x5b6256['length'];_0x3cf640++){var _0x1017ab=_0x5b6256[_0x3cf640];if(_0x1017ab&&_0x1017ab[_0x8849('0x2a')]&&_0x1017ab[_0x8849('0x2a')]['fulfillmentText']){_0x2c4760[_0x8849('0x3e')](createMessage(_0x56aa30,_0x2d38b9,_0x4bfe95,_0x1017ab[_0x8849('0x2a')][_0x8849('0x3f')]));}}return Promise[_0x8849('0x40')](_0x2c4760)[_0x8849('0xc')](function(){if(_0x2ff150){_0x3f967e[_0x8849('0x13')]();}else{_0x3f967e[_0x8849('0x25')]();}})['catch'](function(_0x2c5ba5){logger[_0x8849('0x41')](_0x8849('0xf'),_0x56aa30,JSON[_0x8849('0x10')](_0x2c5ba5));_0x3f967e['next']();});}})[_0x8849('0xe')](function(_0x3edb2e){logger[_0x8849('0x41')](_0x8849('0xf'),_0x56aa30,_0x3edb2e[_0x8849('0x29')]);_0x3f967e['next']();});}}catch(_0x521346){logger[_0x8849('0x41')](_0x8849('0xf'),_0x56aa30,JSON[_0x8849('0x10')](_0x521346));_0x3f967e[_0x8849('0x25')]();}};}; \ No newline at end of file +var _0x79e5=['../../../../config/logger','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','Message','create','then','info','[%s][DIALOGFLOWV2]\x20%s','body','catch','error','stringify','consequence','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss','sms','whatsapp','phone','interaction','channel','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','created','isEmpty','getMustacheRender','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','SessionsClient','sessionPath','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','DIALOGFLOWV2_LANGUAGECODE','languageCode','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','length','fulfillmentText','push','all','message','lodash','dialogflow','moment','bluebird'];(function(_0x349883,_0x53efaa){var _0x47871e=function(_0x6375a3){while(--_0x6375a3){_0x349883['push'](_0x349883['shift']());}};_0x47871e(++_0x53efaa);}(_0x79e5,0x164));var _0x579e=function(_0x309c40,_0x2ad5b2){_0x309c40=_0x309c40-0x0;var _0x23edfa=_0x79e5[_0x309c40];return _0x23edfa;};'use strict';var _=require(_0x579e('0x0'));var dialogflow=require(_0x579e('0x1'));var md5=require('md5');var moment=require(_0x579e('0x2'));var Promise=require(_0x579e('0x3'));var logger=require(_0x579e('0x4'))('routing');var utils=require(_0x579e('0x5'));var rpc={'chatMessage':require(_0x579e('0x6')),'openchannelMessage':require(_0x579e('0x7')),'mailMessage':require(_0x579e('0x8')),'smsMessage':require(_0x579e('0x9')),'faxMessage':require(_0x579e('0xa')),'whatsappMessage':require(_0x579e('0xb'))};function createMessage(_0x7df6c0,_0x53fc39,_0xd6e0b1,_0x574883){return new Promise(function(_0x4d762e,_0x1a54dd){var _0x983dc7=_['clone'](_0xd6e0b1);_0x983dc7['body']=_0x574883;return rpc[_0x53fc39+_0x579e('0xc')][_0x579e('0xd')](_0x983dc7)[_0x579e('0xe')](function(){logger[_0x579e('0xf')](_0x579e('0x10'),_0x7df6c0,_0x983dc7[_0x579e('0x11')]);_0x4d762e();})[_0x579e('0x12')](function(_0x65371a){logger[_0x579e('0x13')](_0x579e('0x10'),_0x7df6c0,JSON[_0x579e('0x14')](_0x65371a));_0x1a54dd(_0x65371a);});});}exports[_0x579e('0x15')]=function(_0x4fa628,_0x5b8ce3){return function(_0x2e1adf){try{if(!_['isNil'](this['interaction'][_0x579e('0x16')])){logger[_0x579e('0xf')](_0x579e('0x10'),_0x4fa628,_0x579e('0x17'));return _0x2e1adf[_0x579e('0x18')]();}var _0x2b988d={'ContactId':this[_0x579e('0x19')]['id'],'sentAt':moment()['format'](_0x579e('0x1a')),'direction':'out'};if(this['channel']===_0x579e('0x1b')||this['channel']===_0x579e('0x1c')){_0x2b988d[_0x579e('0x1d')]=this[_0x579e('0x1e')][_0x579e('0x1d')];}var _0x33dd97=this[_0x579e('0x1f')];if(_0x33dd97==='chat'){_0x2b988d[_0x579e('0x20')]=this[_0x579e('0x21')]['id'];}else{_0x2b988d[_['upperFirst'](_0x33dd97)+_0x579e('0x22')]=this['account']['id'];}_0x2b988d[_[_0x579e('0x23')](_0x33dd97)+_0x579e('0x24')]=this['interaction']['id'];if(this[_0x579e('0x1e')][_0x579e('0x25')]){var _0x5573a8=_0x5b8ce3[0x4];if(!_[_0x579e('0x26')](_0x5573a8)){_0x2b988d[_0x579e('0x11')]=utils[_0x579e('0x27')](_0x5573a8,this);return rpc[_0x33dd97+_0x579e('0xc')][_0x579e('0xd')](_0x2b988d)['then'](function(_0xd12837){logger['info'](_0x579e('0x10'),_0x4fa628,_0x2b988d[_0x579e('0x11')]);})[_0x579e('0x12')](function(_0x542fd8){logger[_0x579e('0x13')]('[%s][DIALOGFLOWV2]\x20%s',_0x4fa628,JSON[_0x579e('0x14')](_0x542fd8));})['finally'](function(){logger[_0x579e('0xf')](_0x579e('0x28'),_0x4fa628);_0x2e1adf[_0x579e('0x29')]();});}else{logger['info']('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x4fa628);_0x2e1adf[_0x579e('0x29')]();}}else{var _0x270bbb=this;var _0xce01c9=_0x5b8ce3[0x2]['replace'](/\\n/g,'\x0a');var _0x2f2569={'credentials':{'private_key':_0xce01c9,'client_email':_0x5b8ce3[0x1]}};var _0x517a72=new dialogflow[(_0x579e('0x2a'))](_0x2f2569);var _0x2eab50=_0x517a72[_0x579e('0x2b')](_0x5b8ce3[0x0],md5(_0x270bbb[_0x579e('0x1e')]['id']));var _0x202f2f={'session':_0x2eab50,'queryInput':{'text':{'text':_0x270bbb['message'][_0x579e('0x11')],'languageCode':_0x5b8ce3[0x3]||'en'}}};return _0x517a72['detectIntent'](_0x202f2f)[_0x579e('0xe')](function(_0x3bcd5a){if(_0x3bcd5a&&_0x3bcd5a['length']){_0x270bbb[_0x579e('0x11')][_0x579e('0x2c')]=_0x3bcd5a;var _0x103345=_0x3bcd5a[0x0];var _0xec644f=_0x103345[_0x579e('0x2d')][_0x579e('0x2e')]&&_0x103345[_0x579e('0x2d')]['diagnosticInfo'][_0x579e('0x2f')]?_0x103345[_0x579e('0x2d')]['diagnosticInfo'][_0x579e('0x2f')][_0x579e('0x30')][_0x579e('0x31')]:![];_0x270bbb[_0x579e('0x11')][_0x579e('0x32')]=_0x103345['queryResult'][_0x579e('0x33')];_0x270bbb[_0x579e('0x11')][_0x579e('0x34')]=_0x103345['queryResult'][_0x579e('0x35')];_0x270bbb[_0x579e('0x11')][_0x579e('0x36')]=_0x103345[_0x579e('0x2d')]['diagnosticInfo']&&_0x103345[_0x579e('0x2d')][_0x579e('0x2e')][_0x579e('0x2f')]?_0x103345[_0x579e('0x2d')][_0x579e('0x2e')][_0x579e('0x2f')][_0x579e('0x30')]['boolValue']:![];_0x270bbb[_0x579e('0x11')]['DIALOGFLOWV2_INTENTNAME']=_0x103345[_0x579e('0x2d')][_0x579e('0x37')][_0x579e('0x38')];_0x270bbb[_0x579e('0x11')][_0x579e('0x39')]=_0x103345[_0x579e('0x2d')]['intent'][_0x579e('0x3a')];_0x270bbb[_0x579e('0x11')][_0x579e('0x3b')]=_0x103345[_0x579e('0x2d')]['intent']['isFallback'];_0x270bbb[_0x579e('0x11')][_0x579e('0x3c')]=_0x103345[_0x579e('0x2d')][_0x579e('0x3d')];_0x270bbb[_0x579e('0x11')]['DIALOGFLOWV2_QUERYTEXT']=_0x103345[_0x579e('0x2d')][_0x579e('0x3e')];_0x270bbb[_0x579e('0x11')][_0x579e('0x3f')]=_0x103345['queryResult'][_0x579e('0x40')];_0x2b988d[_0x579e('0x41')]=_0x579e('0x2c');_0x2b988d[_0x579e('0x42')]=JSON[_0x579e('0x14')](_0x3bcd5a);var _0x24c2df=[];for(var _0x4aa073=0x0;_0x4aa073<_0x3bcd5a[_0x579e('0x43')];_0x4aa073++){var _0x21771f=_0x3bcd5a[_0x4aa073];if(_0x21771f&&_0x21771f['queryResult']&&_0x21771f[_0x579e('0x2d')][_0x579e('0x44')]){_0x24c2df[_0x579e('0x45')](createMessage(_0x4fa628,_0x33dd97,_0x2b988d,_0x21771f[_0x579e('0x2d')][_0x579e('0x44')]));}}return Promise[_0x579e('0x46')](_0x24c2df)['then'](function(){if(_0xec644f){_0x2e1adf['next']();}else{_0x2e1adf[_0x579e('0x29')]();}})[_0x579e('0x12')](function(_0x4d7b0b){logger['error'](_0x579e('0x10'),_0x4fa628,JSON[_0x579e('0x14')](_0x4d7b0b));_0x2e1adf[_0x579e('0x18')]();});}})['catch'](function(_0x5235e7){logger[_0x579e('0x13')](_0x579e('0x10'),_0x4fa628,_0x5235e7[_0x579e('0x47')]);_0x2e1adf[_0x579e('0x18')]();});}}catch(_0x21e6fc){logger[_0x579e('0x13')]('[%s][DIALOGFLOWV2]\x20%s',_0x4fa628,JSON[_0x579e('0x14')](_0x21e6fc));_0x2e1adf[_0x579e('0x29')]();}};}; \ 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 4c84288..431966a 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 _0xf4af=['condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','message','join','stop','condition','priorityTrue','priorityFalse','info','next','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','html-to-text','./utils','routing'];(function(_0x2bd91b,_0x2380f3){var _0x47b883=function(_0x4d21ef){while(--_0x4d21ef){_0x2bd91b['push'](_0x2bd91b['shift']());}};_0x47b883(++_0x2380f3);}(_0xf4af,0xd3));var _0xff4a=function(_0x28add8,_0x18d6bd){_0x28add8=_0x28add8-0x0;var _0x2b1f4f=_0xf4af[_0x28add8];return _0x2b1f4f;};'use strict';var schema=require(_0xff4a('0x0'));var _=require(_0xff4a('0x1'));var htmlToText=require(_0xff4a('0x2'));var utils=require(_0xff4a('0x3'));var logger=require('../../../../config/logger')(_0xff4a('0x4'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0xff4a('0x5')},'priorityTrue':{'type':_0xff4a('0x6'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':'number','message':_0xff4a('0x7')}});exports[_0xff4a('0x8')]=function(_0x4b6257,_0x4ba801){return function(_0x2c1e1f){try{var _0x186ffd={'condition':htmlToText[_0xff4a('0x9')](utils[_0xff4a('0xa')](_0x4ba801[0x0],this),{'wordwrap':![]})[_0xff4a('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x4ba801[0x1],'priorityFalse':_0x4ba801[0x2]};var _0x23a187=gotoif[_0xff4a('0x0')](_0x186ffd,{'typecast':!![]});if(_0x23a187[_0xff4a('0xc')]){logger[_0xff4a('0xd')](_0xff4a('0xe'),_0x4b6257,_['map'](_0x23a187,_0xff4a('0xf'))[_0xff4a('0x10')](',\x20'));_0x2c1e1f[_0xff4a('0x11')]();}else{try{var _0x24a7ec=eval('('+_0x186ffd[_0xff4a('0x12')]+')');var _0x4bd874=_0x24a7ec?_0x186ffd[_0xff4a('0x13')]:_0x186ffd[_0xff4a('0x14')];logger[_0xff4a('0x15')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x4b6257,_0x186ffd['condition'],_0x24a7ec,_0x4bd874||_0xff4a('0x16'));if(_0x4bd874){var _0x1333ec=_['findIndex'](_0x2c1e1f[_0xff4a('0x17')](),{'p':_0x4bd874});if(_0x1333ec>=0x0){logger[_0xff4a('0x15')](_0xff4a('0x18'),_0x4b6257,_0x4bd874||_0xff4a('0x16'),_0x1333ec);_0x2c1e1f[_0xff4a('0x16')](_0x1333ec);}else{logger[_0xff4a('0x15')](_0xff4a('0x19'),_0x4b6257,_0x4bd874||_0xff4a('0x16'));_0x2c1e1f[_0xff4a('0x11')]();}}else{_0x2c1e1f[_0xff4a('0x16')]();}}catch(_0x1d7ca0){logger[_0xff4a('0xd')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x4b6257,_0x1d7ca0['message']);_0x2c1e1f[_0xff4a('0x11')]();}}}catch(_0x19fb89){logger[_0xff4a('0xd')]('[%s][GOTOIF]\x20%s',_0x4b6257,JSON[_0xff4a('0x1a')](_0x19fb89));_0x2c1e1f[_0xff4a('0x11')]();}};}; \ No newline at end of file +var _0xeb8b=['condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','length','[%s][GOTOIF]\x20%s','map','message','join','stop','condition','priorityTrue','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','error','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','html-to-text','./utils','../../../../config/logger','routing','string'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0xeb8b,0xb4));var _0xbeb8=function(_0x526bf4,_0x4b32ab){_0x526bf4=_0x526bf4-0x0;var _0x55660c=_0xeb8b[_0x526bf4];return _0x55660c;};'use strict';var schema=require(_0xbeb8('0x0'));var _=require('lodash');var htmlToText=require(_0xbeb8('0x1'));var utils=require(_0xbeb8('0x2'));var logger=require(_0xbeb8('0x3'))(_0xbeb8('0x4'));var gotoif=schema({'condition':{'type':_0xbeb8('0x5'),'required':!![],'message':_0xbeb8('0x6')},'priorityTrue':{'type':_0xbeb8('0x7'),'message':_0xbeb8('0x8')},'priorityFalse':{'type':_0xbeb8('0x7'),'message':_0xbeb8('0x9')}});exports[_0xbeb8('0xa')]=function(_0x592426,_0x1f01d9){return function(_0x51e865){try{var _0x4331f8={'condition':htmlToText[_0xbeb8('0xb')](utils[_0xbeb8('0xc')](_0x1f01d9[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x1f01d9[0x1],'priorityFalse':_0x1f01d9[0x2]};var _0x22689d=gotoif[_0xbeb8('0x0')](_0x4331f8,{'typecast':!![]});if(_0x22689d[_0xbeb8('0xd')]){logger['error'](_0xbeb8('0xe'),_0x592426,_[_0xbeb8('0xf')](_0x22689d,_0xbeb8('0x10'))[_0xbeb8('0x11')](',\x20'));_0x51e865[_0xbeb8('0x12')]();}else{try{var _0x2078af=eval('('+_0x4331f8[_0xbeb8('0x13')]+')');var _0x3ea964=_0x2078af?_0x4331f8[_0xbeb8('0x14')]:_0x4331f8['priorityFalse'];logger[_0xbeb8('0x15')](_0xbeb8('0x16'),_0x592426,_0x4331f8['condition'],_0x2078af,_0x3ea964||_0xbeb8('0x17'));if(_0x3ea964){var _0xc934b7=_[_0xbeb8('0x18')](_0x51e865[_0xbeb8('0x19')](),{'p':_0x3ea964});if(_0xc934b7>=0x0){logger[_0xbeb8('0x15')](_0xbeb8('0x1a'),_0x592426,_0x3ea964||_0xbeb8('0x17'),_0xc934b7);_0x51e865[_0xbeb8('0x17')](_0xc934b7);}else{logger[_0xbeb8('0x15')](_0xbeb8('0x1b'),_0x592426,_0x3ea964||_0xbeb8('0x17'));_0x51e865[_0xbeb8('0x12')]();}}else{_0x51e865[_0xbeb8('0x17')]();}}catch(_0xa215c7){logger[_0xbeb8('0x1c')](_0xbeb8('0x1d'),_0x592426,_0xa215c7[_0xbeb8('0x10')]);_0x51e865['stop']();}}}catch(_0x726c86){logger[_0xbeb8('0x1c')](_0xbeb8('0xe'),_0x592426,JSON[_0xbeb8('0x1e')](_0x726c86));_0x51e865[_0xbeb8('0x12')]();}};}; \ 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 51f0e83..c30292c 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 _0x6c22=['[%s][GOTOP]\x20%s','validate','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','length','error','map','message','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found'];(function(_0x45e7ba,_0x2296e1){var _0x3e6ceb=function(_0x42d727){while(--_0x42d727){_0x45e7ba['push'](_0x45e7ba['shift']());}};_0x3e6ceb(++_0x2296e1);}(_0x6c22,0x1e1));var _0x26c2=function(_0xca465b,_0x470663){_0xca465b=_0xca465b-0x0;var _0x3d988d=_0x6c22[_0xca465b];return _0x3d988d;};'use strict';var schema=require(_0x26c2('0x0'));var _=require(_0x26c2('0x1'));var logger=require(_0x26c2('0x2'))(_0x26c2('0x3'));var gotop=schema({'priority':{'type':_0x26c2('0x4'),'required':!![],'message':_0x26c2('0x5')}});exports['consequence']=function(_0x5d9f19,_0x61493f){return function(_0x2be46e){try{var _0x4ca81d={'priority':_0x61493f[0x0]};var _0x3d6623=gotop['validate'](_0x4ca81d,{'typecast':!![]});if(_0x3d6623[_0x26c2('0x6')]){logger[_0x26c2('0x7')]('[%s][GOTOP]\x20%s',_0x5d9f19,_[_0x26c2('0x8')](_0x3d6623,_0x26c2('0x9'))['join'](',\x20'));_0x2be46e[_0x26c2('0xa')]();}else{logger[_0x26c2('0xb')](_0x26c2('0xc'),_0x5d9f19,_0x4ca81d['priority']);if(_0x4ca81d[_0x26c2('0xd')]){var _0x59cd21=_[_0x26c2('0xe')](_0x2be46e[_0x26c2('0xf')](),{'p':_0x4ca81d[_0x26c2('0xd')]});if(_0x59cd21>=0x0){logger['info'](_0x26c2('0x10'),_0x5d9f19,_0x4ca81d[_0x26c2('0xd')]||_0x26c2('0x11'),_0x59cd21);_0x2be46e['next'](_0x59cd21);}else{logger[_0x26c2('0xb')](_0x26c2('0x12'),_0x5d9f19,_0x4ca81d[_0x26c2('0xd')]||_0x26c2('0x11'));_0x2be46e[_0x26c2('0xa')]();}}else{_0x2be46e[_0x26c2('0x11')]();}}}catch(_0x3e93fa){logger[_0x26c2('0x7')](_0x26c2('0x13'),_0x5d9f19,JSON['stringify'](_0x3e93fa));_0x2be46e['stop']();}};}; \ No newline at end of file +var _0xa768=['findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','../../../../config/logger','routing','number','length','error','[%s][GOTOP]\x20%s','map','message','join','stop','info','priority'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xa768,0x11e));var _0x8a76=function(_0x1e691f,_0x215f5f){_0x1e691f=_0x1e691f-0x0;var _0x5b37cb=_0xa768[_0x1e691f];return _0x5b37cb;};'use strict';var schema=require(_0x8a76('0x0'));var _=require(_0x8a76('0x1'));var logger=require(_0x8a76('0x2'))(_0x8a76('0x3'));var gotop=schema({'priority':{'type':_0x8a76('0x4'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x21d63b,_0x1e03d7){return function(_0x40e922){try{var _0x512928={'priority':_0x1e03d7[0x0]};var _0x477322=gotop['validate'](_0x512928,{'typecast':!![]});if(_0x477322[_0x8a76('0x5')]){logger[_0x8a76('0x6')](_0x8a76('0x7'),_0x21d63b,_[_0x8a76('0x8')](_0x477322,_0x8a76('0x9'))[_0x8a76('0xa')](',\x20'));_0x40e922[_0x8a76('0xb')]();}else{logger[_0x8a76('0xc')]('[%s][GOTOP]\x20priority\x20%s',_0x21d63b,_0x512928[_0x8a76('0xd')]);if(_0x512928['priority']){var _0x5e9407=_[_0x8a76('0xe')](_0x40e922[_0x8a76('0xf')](),{'p':_0x512928['priority']});if(_0x5e9407>=0x0){logger[_0x8a76('0xc')](_0x8a76('0x10'),_0x21d63b,_0x512928[_0x8a76('0xd')]||_0x8a76('0x11'),_0x5e9407);_0x40e922[_0x8a76('0x11')](_0x5e9407);}else{logger['info'](_0x8a76('0x12'),_0x21d63b,_0x512928[_0x8a76('0xd')]||'next');_0x40e922['stop']();}}else{_0x40e922[_0x8a76('0x11')]();}}}catch(_0x8cd225){logger['error'](_0x8a76('0x7'),_0x21d63b,JSON[_0x8a76('0x13')](_0x8cd225));_0x40e922['stop']();}};}; \ 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 481a54b..c8c6f34 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 _0xe6e4=['routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','contact','channel','chat','ChatWebsiteId','account','AccountId','upperFirst','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','next','catch','error','stringify','stop','lodash','./utils','../../../../config/logger'];(function(_0x599359,_0x5b620a){var _0x44839e=function(_0x55a138){while(--_0x55a138){_0x599359['push'](_0x599359['shift']());}};_0x44839e(++_0x5b620a);}(_0xe6e4,0xc1));var _0x4e6e=function(_0x444199,_0x1acd8f){_0x444199=_0x444199-0x0;var _0x56cfc8=_0xe6e4[_0x444199];return _0x56cfc8;};'use strict';var _=require(_0x4e6e('0x0'));var utils=require(_0x4e6e('0x1'));var logger=require(_0x4e6e('0x2'))(_0x4e6e('0x3'));var rpc={'chatMessage':require(_0x4e6e('0x4')),'openchannelMessage':require(_0x4e6e('0x5')),'mailMessage':require(_0x4e6e('0x6')),'smsMessage':require(_0x4e6e('0x7')),'faxMessage':require(_0x4e6e('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x4e6e('0x9')]=function(_0x51d2b2,_0x5b7441){return function(_0x3f753a){try{var _0x474042={'body':utils['getMustacheRender'](_0x5b7441[0x0],this),'ContactId':this[_0x4e6e('0xa')]['id']};if(this[_0x4e6e('0xb')]===_0x4e6e('0xc')){_0x474042[_0x4e6e('0xd')]=this[_0x4e6e('0xe')]['id'];}else{_0x474042[_['upperFirst'](this[_0x4e6e('0xb')])+_0x4e6e('0xf')]=this[_0x4e6e('0xe')]['id'];}_0x474042[_[_0x4e6e('0x10')](this[_0x4e6e('0xb')])+'InteractionId']=this[_0x4e6e('0x11')]['id'];if(rpc[this[_0x4e6e('0xb')]+'Message']){return rpc[this[_0x4e6e('0xb')]+_0x4e6e('0x12')][_0x4e6e('0x13')](_0x474042)[_0x4e6e('0x14')](function(_0x1e6595){logger[_0x4e6e('0x15')](_0x4e6e('0x16'),_0x51d2b2,_0x474042['body']);_0x3f753a[_0x4e6e('0x17')]();})[_0x4e6e('0x18')](function(_0x437a88){logger[_0x4e6e('0x19')](_0x4e6e('0x16'),_0x51d2b2,JSON[_0x4e6e('0x1a')](_0x437a88));_0x3f753a['stop']();});}}catch(_0x4f8b21){logger[_0x4e6e('0x19')](_0x4e6e('0x16'),_0x51d2b2,JSON['stringify'](_0x4f8b21));_0x3f753a[_0x4e6e('0x1b')]();}};}; \ No newline at end of file +var _0x86f0=['catch','stringify','stop','error','lodash','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','channel','chat','ChatWebsiteId','account','InteractionId','interaction','Message','create','info','[%s][MESSAGE]\x20%s'];(function(_0x1a5793,_0xa87267){var _0x50c55e=function(_0x2d8d43){while(--_0x2d8d43){_0x1a5793['push'](_0x1a5793['shift']());}};_0x50c55e(++_0xa87267);}(_0x86f0,0x1e4));var _0x086f=function(_0x19c8fb,_0x80481){_0x19c8fb=_0x19c8fb-0x0;var _0xd32e77=_0x86f0[_0x19c8fb];return _0xd32e77;};'use strict';var _=require(_0x086f('0x0'));var utils=require(_0x086f('0x1'));var logger=require(_0x086f('0x2'))('routing');var rpc={'chatMessage':require(_0x086f('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x086f('0x4')),'smsMessage':require(_0x086f('0x5')),'faxMessage':require(_0x086f('0x6')),'whatsappMessage':require(_0x086f('0x7'))};exports[_0x086f('0x8')]=function(_0x4d1276,_0x42ae93){return function(_0x59a01e){try{var _0xaf39cf={'body':utils[_0x086f('0x9')](_0x42ae93[0x0],this),'ContactId':this['contact']['id']};if(this[_0x086f('0xa')]===_0x086f('0xb')){_0xaf39cf[_0x086f('0xc')]=this[_0x086f('0xd')]['id'];}else{_0xaf39cf[_['upperFirst'](this[_0x086f('0xa')])+'AccountId']=this[_0x086f('0xd')]['id'];}_0xaf39cf[_['upperFirst'](this['channel'])+_0x086f('0xe')]=this[_0x086f('0xf')]['id'];if(rpc[this[_0x086f('0xa')]+_0x086f('0x10')]){return rpc[this['channel']+'Message'][_0x086f('0x11')](_0xaf39cf)['then'](function(_0x3750f8){logger[_0x086f('0x12')](_0x086f('0x13'),_0x4d1276,_0xaf39cf['body']);_0x59a01e['next']();})[_0x086f('0x14')](function(_0x1d1073){logger['error'](_0x086f('0x13'),_0x4d1276,JSON[_0x086f('0x15')](_0x1d1073));_0x59a01e[_0x086f('0x16')]();});}}catch(_0x458484){logger[_0x086f('0x17')](_0x086f('0x13'),_0x4d1276,JSON[_0x086f('0x15')](_0x458484));_0x59a01e[_0x086f('0x16')]();}};}; \ 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 e6aede8..56760b9 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 _0xebc7=['getMustacheRender','next','error','stringify','./utils','../../../../config/logger','routing','info','[%s][NOOP]\x20%s'];(function(_0x4dee19,_0x62f9be){var _0x13b5e6=function(_0x727ae3){while(--_0x727ae3){_0x4dee19['push'](_0x4dee19['shift']());}};_0x13b5e6(++_0x62f9be);}(_0xebc7,0x79));var _0x7ebc=function(_0x479160,_0x3ab560){_0x479160=_0x479160-0x0;var _0x47ac6d=_0xebc7[_0x479160];return _0x47ac6d;};'use strict';var utils=require(_0x7ebc('0x0'));var logger=require(_0x7ebc('0x1'))(_0x7ebc('0x2'));exports['consequence']=function(_0x3bc3ed,_0x4153e7){return function(_0x333525){try{logger[_0x7ebc('0x3')](_0x7ebc('0x4'),_0x3bc3ed,utils[_0x7ebc('0x5')](_0x4153e7[0x0],this));_0x333525[_0x7ebc('0x6')]();}catch(_0x1e451d){logger[_0x7ebc('0x7')]('[%s][NOOP]\x20%s',_0x3bc3ed,JSON[_0x7ebc('0x8')](_0x1e451d));_0x333525['stop']();}};}; \ No newline at end of file +var _0x2831=['getMustacheRender','stop','./utils','../../../../config/logger','routing','consequence','[%s][NOOP]\x20%s'];(function(_0x4ff24f,_0x5b177e){var _0x1413ab=function(_0x20c9ff){while(--_0x20c9ff){_0x4ff24f['push'](_0x4ff24f['shift']());}};_0x1413ab(++_0x5b177e);}(_0x2831,0x16e));var _0x1283=function(_0xda4b4b,_0x5bf81f){_0xda4b4b=_0xda4b4b-0x0;var _0xfc676f=_0x2831[_0xda4b4b];return _0xfc676f;};'use strict';var utils=require(_0x1283('0x0'));var logger=require(_0x1283('0x1'))(_0x1283('0x2'));exports[_0x1283('0x3')]=function(_0xb55f3,_0x17dda8){return function(_0x5002c1){try{logger['info'](_0x1283('0x4'),_0xb55f3,utils[_0x1283('0x5')](_0x17dda8[0x0],this));_0x5002c1['next']();}catch(_0x2174c1){logger['error'](_0x1283('0x4'),_0xb55f3,JSON['stringify'](_0x2174c1));_0x5002c1[_0x1283('0x6')]();}};}; \ 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 a13c3c1..10d51ca 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 _0xda11=['%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/whatsappQueueReport','string','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','channel','QueueId','upperFirst','interaction','MessageId','message','chat','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','accepted','update','timeout','toLowerCase','[%s][QUEUE]\x20%s','map','join','Queues','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','stop','[%s][QUEUE]\x20APPLICATION\x20END','next','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','util','seq-queue','../../../../config/environment','../../../../config/logger','./strategy','redis','localhost','socket.io-emitter','queue_id','from','joinAt','emit','clone','queue','account','format'];(function(_0x174ef5,_0x256e8e){var _0x1cc379=function(_0x3eafcf){while(--_0x3eafcf){_0x174ef5['push'](_0x174ef5['shift']());}};_0x1cc379(++_0x256e8e);}(_0xda11,0x113));var _0x1da1=function(_0x9e2feb,_0x1d153f){_0x9e2feb=_0x9e2feb-0x0;var _0x4403c2=_0xda11[_0x9e2feb];return _0x4403c2;};'use strict';var schema=require(_0x1da1('0x0'));var _=require('lodash');var util=require(_0x1da1('0x1'));var seqqueue=require(_0x1da1('0x2'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x1da1('0x3'));var logger=require(_0x1da1('0x4'))('routing');var strategy=require(_0x1da1('0x5'));config['redis']=_['defaults'](config[_0x1da1('0x6')],{'host':_0x1da1('0x7'),'port':0x18eb});var io=require(_0x1da1('0x8'))(new Redis(config[_0x1da1('0x6')]));var attributes=['id',_0x1da1('0x9'),'account','queue',_0x1da1('0xa'),_0x1da1('0xb')];function emit(_0x33413d,_0x558629,_0x12c9e3){io['to'](_0x33413d)[_0x1da1('0xc')](_0x558629,_0x12c9e3);}function emitChannelQueueInteraction(_0x56362b,_0x1ef128,_0x40238d,_0x4c589e,_0x360222,_0x4aed66,_0x37c0f3,_0x497328){var _0x1193b=_[_0x1da1('0xd')](_0x40238d);_0x1193b['queue_id']=_0x497328;_0x1193b[_0x1da1('0xe')]=_0x1ef128;_0x1193b[_0x1da1('0xf')]=_0x4c589e;_0x1193b['id']=_0x360222;if(_0x4aed66){_0x37c0f3[util[_0x1da1('0x10')](_0x1da1('0x11'),_0x56362b)][_0x360222]=_[_0x1da1('0x12')](_0x1193b,attributes);}else{delete _0x37c0f3[util[_0x1da1('0x10')](_0x1da1('0x11'),_0x56362b)][_0x360222];}emit(util['format'](_0x1da1('0x13'),_0x56362b,_0x1ef128),util[_0x1da1('0x10')](_0x1da1('0x14'),_0x56362b,_0x4aed66?_0x1da1('0x15'):'remove'),_[_0x1da1('0x12')](_0x1193b,attributes));}var rpc={'openchannelQueueReport':require(_0x1da1('0x16')),'mailQueueReport':require(_0x1da1('0x17')),'chatQueueReport':require(_0x1da1('0x18')),'smsQueueReport':require(_0x1da1('0x19')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x1da1('0x1a'))};var queue=schema({'name':{'type':_0x1da1('0x1b'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x1da1('0x1c'),'message':_0x1da1('0x1d')}});function startRouting(_0x1915aa,_0x44b70a,_0x2a81e8,_0x1bddd5){if(_0x1915aa&&_0x44b70a&&_0x2a81e8){_0x44b70a[_0x1da1('0x1e')]+=0x1;var _0x919026={'uniqueid':_0x1915aa,'from':_0x2a81e8['body']?_0x2a81e8[_0x1da1('0x1f')][_0x1da1('0xa')]:'','joinAt':moment()[_0x1da1('0x10')](_0x1da1('0x20')),'ContactId':_0x2a81e8[_0x1da1('0x21')]?_0x2a81e8[_0x1da1('0x21')]['id']:null,'ListId':_0x2a81e8[_0x1da1('0x22')]?_0x2a81e8[_0x1da1('0x22')]['id']:null};_0x919026[_['upperFirst'](_0x2a81e8[_0x1da1('0x23')])+_0x1da1('0x24')]=_0x44b70a['id']||null;_0x919026[_[_0x1da1('0x25')](_0x2a81e8[_0x1da1('0x23')])+'InteractionId']=_0x2a81e8[_0x1da1('0x26')]?_0x2a81e8[_0x1da1('0x26')]['id']:null;_0x919026[_['upperFirst'](_0x2a81e8[_0x1da1('0x23')])+_0x1da1('0x27')]=_0x2a81e8[_0x1da1('0x28')]?_0x2a81e8[_0x1da1('0x28')]['id']:null;_0x919026[_[_0x1da1('0x25')](_0x2a81e8[_0x1da1('0x23')])+(_0x2a81e8[_0x1da1('0x23')]!==_0x1da1('0x29')?'AccountId':_0x1da1('0x2a'))]=_0x2a81e8['account']?_0x2a81e8[_0x1da1('0xf')]['id']:null;logger[_0x1da1('0x2b')](util[_0x1da1('0x10')](_0x1da1('0x2c'),_0x1915aa,_0x44b70a[_0x1da1('0x2d')]));emitChannelQueueInteraction(_0x2a81e8[_0x1da1('0x23')],_0x44b70a[_0x1da1('0x2d')],_0x919026,_0x2a81e8['account']['name'],_0x2a81e8[_0x1da1('0x28')]['id'],!![],_0x1bddd5,_0x44b70a['id']);if(rpc[_0x2a81e8[_0x1da1('0x23')]+_0x1da1('0x2e')]){return rpc[_0x2a81e8[_0x1da1('0x23')]+_0x1da1('0x2e')][_0x1da1('0x2f')](_0x919026)[_0x1da1('0x30')](function(_0x137c79){logger[_0x1da1('0x31')](_0x1da1('0x32'));});}}}function stopRouting(_0x3841b0,_0x533d4f,_0xb4a9a2,_0x420120){if(_0x3841b0&&_0x533d4f){_0x533d4f['waiting']-=0x1;var _0x3c5fab={'leaveAt':moment()[_0x1da1('0x10')](_0x1da1('0x20')),'acceptAt':moment()[_0x1da1('0x10')](_0x1da1('0x20')),'reason':_0x1da1('0x33')};logger[_0x1da1('0x2b')](util[_0x1da1('0x10')]('[%s][STOP:QUEUE][NAME:%s]',_0x3841b0,_0x533d4f[_0x1da1('0x2d')]));emitChannelQueueInteraction(_0xb4a9a2[_0x1da1('0x23')],_0x533d4f[_0x1da1('0x2d')],_0xb4a9a2[_0x1da1('0x1f')],_0xb4a9a2[_0x1da1('0xf')]['name'],_0xb4a9a2[_0x1da1('0x28')]['id'],![],_0x420120,_0x533d4f['id']);if(rpc[_0xb4a9a2[_0x1da1('0x23')]+_0x1da1('0x2e')]){return rpc[_0xb4a9a2[_0x1da1('0x23')]+_0x1da1('0x2e')][_0x1da1('0x34')](_0x3841b0,_0x3c5fab)[_0x1da1('0x30')](function(_0x2221cd){logger[_0x1da1('0x31')]('update\x20queue\x20report');});}}}function endRouting(_0xb21940,_0x4b42bb,_0x2ec218,_0x492ef6){if(_0xb21940&&_0x4b42bb){_0x4b42bb[_0x1da1('0x1e')]-=0x1;var _0x3f0e68={'leaveAt':moment()[_0x1da1('0x10')](_0x1da1('0x20')),'exitAt':moment()[_0x1da1('0x10')](_0x1da1('0x20')),'reason':_0x1da1('0x35')};logger[_0x1da1('0x2b')](util['format']('[%s][END:QUEUE][NAME:%s]',_0xb21940,_0x4b42bb[_0x1da1('0x2d')]));emitChannelQueueInteraction(_0x2ec218[_0x1da1('0x23')],_0x4b42bb[_0x1da1('0x2d')],_0x2ec218[_0x1da1('0x1f')],_0x2ec218[_0x1da1('0xf')][_0x1da1('0x2d')],_0x2ec218[_0x1da1('0x28')]['id'],![],_0x492ef6);if(rpc[_0x2ec218[_0x1da1('0x23')]+_0x1da1('0x2e')]){return rpc[_0x2ec218['channel']+_0x1da1('0x2e')][_0x1da1('0x34')](_0xb21940,_0x3f0e68)[_0x1da1('0x30')](function(_0x25b89e){logger['error']('update\x20queue\x20report');});}}}function handleFindQueue(_0x24371e){return function(_0x494572){return _0x494572['name'][_0x1da1('0x36')]()===_0x24371e['toLowerCase']();};}exports['consequence']=function(_0x5b1f3d,_0x2c1a5f,_0x389d16,_0x1403a4){return function(_0x1fecdf){try{var _0x510f49={'name':_0x2c1a5f[0x0],'timeout':_0x2c1a5f[0x1]};var _0x1e5740=queue[_0x1da1('0x0')](_0x510f49,{'typecast':!![]});if(_0x1e5740['length']){logger[_0x1da1('0x31')](_0x1da1('0x37'),_0x5b1f3d,_[_0x1da1('0x38')](_0x1e5740,'message')[_0x1da1('0x39')](',\x20'));_0x1fecdf['stop']();}else{var _0x1902ad=_['find'](_0x389d16[_0x1403a4[_0x1da1('0x23')]+_0x1da1('0x3a')],handleFindQueue(_0x510f49[_0x1da1('0x2d')]));if(_0x1902ad){startRouting(_0x5b1f3d,_0x1902ad,_0x1403a4,_0x389d16);var _0x2e9cc0=(_0x1902ad[_0x1da1('0x35')]||0xa)*0x3e8;var _0x28a0a1=(_0x510f49[_0x1da1('0x35')]||0x14)*0x3e8;var _0x33e8ae,_0x51db59;if(_0x2e9cc0>_0x28a0a1){_0x28a0a1=_0x2e9cc0;}var _0x14be1a=seqqueue['createQueue'](_0x2e9cc0);_0x14be1a['id']=_0x5b1f3d;_0x14be1a[_0x1da1('0x3b')]=_0x2e9cc0;_0x14be1a[_0x1da1('0x3c')]=_0x28a0a1;_0x14be1a[_0x1da1('0x23')]=_0x1403a4[_0x1da1('0x23')];_0x389d16[_0x1da1('0x3d')][_0x5b1f3d]['on'](_0x1da1('0x3e'),function(){logger['info'](_0x1da1('0x3f'),_0x5b1f3d);stopRouting(_0x5b1f3d,_0x1902ad,_0x1403a4,_0x389d16);clearTimeout(_0x33e8ae);_0x33e8ae=undefined;_0x14be1a[_0x1da1('0x40')](!![]);if(_0x389d16['rules'][_0x5b1f3d]){delete _0x389d16[_0x1da1('0x3d')][_0x5b1f3d];}_0x1fecdf[_0x1da1('0x41')]();});_0x389d16[_0x1da1('0x3d')][_0x5b1f3d]['on']('complete',function(){if(_0x389d16[_0x1da1('0x3d')][_0x5b1f3d]){delete _0x389d16['rules'][_0x5b1f3d];}});_0x33e8ae=setTimeout(function(){logger['info'](_0x1da1('0x42'),_0x5b1f3d);endRouting(_0x5b1f3d,_0x1902ad,_0x1403a4,_0x389d16);clearTimeout(_0x33e8ae);_0x14be1a[_0x1da1('0x40')](!![]);_0x1fecdf[_0x1da1('0x43')]();},_0x28a0a1);switch(_0x1902ad['strategy']){case _0x1da1('0x44'):strategy[_0x1da1('0x44')](_0x14be1a,_0x1902ad,_0x389d16,_0x1403a4);break;default:strategy[_0x1da1('0x45')](_0x14be1a,_0x1902ad,_0x389d16,_0x1403a4);}}else{logger[_0x1da1('0x31')](_0x1da1('0x46'),_0x5b1f3d,_0x510f49[_0x1da1('0x2d')]);_0x1fecdf[_0x1da1('0x41')]();}}}catch(_0x4aa881){console[_0x1da1('0x47')](_0x4aa881);logger['error'](_0x1da1('0x37'),_0x5b1f3d,_0x4aa881[_0x1da1('0x48')]);_0x1fecdf[_0x1da1('0x41')]();}};}; \ No newline at end of file +var _0x973c=['name','QueueReport','create','catch','error','create\x20queue\x20report','accepted','info','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','update','toLowerCase','consequence','map','join','stop','Queues','createQueue','atimeout','qtimeout','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','complete','next','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','stack','validate','util','seq-queue','moment','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','queue','from','emit','clone','queue_id','account','format','%sQueuesWaitingInteractions','pick','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/whatsappQueueReport','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','InteractionId','interaction','message','chat','AccountId','WebsiteId','[%s][START:QUEUE][NAME:%s]'];(function(_0x28fe94,_0x120b9b){var _0x3560da=function(_0x4d4e25){while(--_0x4d4e25){_0x28fe94['push'](_0x28fe94['shift']());}};_0x3560da(++_0x120b9b);}(_0x973c,0x6a));var _0xc973=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x973c[_0x3dd15e];return _0x231fd0;};'use strict';var schema=require(_0xc973('0x0'));var _=require('lodash');var util=require(_0xc973('0x1'));var seqqueue=require(_0xc973('0x2'));var moment=require(_0xc973('0x3'));var Redis=require('ioredis');var config=require(_0xc973('0x4'));var logger=require(_0xc973('0x5'))(_0xc973('0x6'));var strategy=require(_0xc973('0x7'));config[_0xc973('0x8')]=_[_0xc973('0x9')](config[_0xc973('0x8')],{'host':_0xc973('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc973('0x8')]));var attributes=['id','queue_id','account',_0xc973('0xb'),_0xc973('0xc'),'joinAt'];function emit(_0x455d0a,_0x53317a,_0x1f2273){io['to'](_0x455d0a)[_0xc973('0xd')](_0x53317a,_0x1f2273);}function emitChannelQueueInteraction(_0x225c00,_0x1b0fd8,_0x472087,_0x191763,_0xe32c5,_0x46217e,_0x567d01,_0x433de7){var _0x1420ee=_[_0xc973('0xe')](_0x472087);_0x1420ee[_0xc973('0xf')]=_0x433de7;_0x1420ee['queue']=_0x1b0fd8;_0x1420ee[_0xc973('0x10')]=_0x191763;_0x1420ee['id']=_0xe32c5;if(_0x46217e){_0x567d01[util[_0xc973('0x11')](_0xc973('0x12'),_0x225c00)][_0xe32c5]=_[_0xc973('0x13')](_0x1420ee,attributes);}else{delete _0x567d01[util['format']('%sQueuesWaitingInteractions',_0x225c00)][_0xe32c5];}emit(util[_0xc973('0x11')]('%s:queue:%s',_0x225c00,_0x1b0fd8),util[_0xc973('0x11')]('%s_queue_waiting_interaction:%s',_0x225c00,_0x46217e?_0xc973('0x14'):_0xc973('0x15')),_[_0xc973('0x13')](_0x1420ee,attributes));}var rpc={'openchannelQueueReport':require(_0xc973('0x16')),'mailQueueReport':require(_0xc973('0x17')),'chatQueueReport':require(_0xc973('0x18')),'smsQueueReport':require(_0xc973('0x19')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0xc973('0x1a'))};var queue=schema({'name':{'type':_0xc973('0x1b'),'required':!![],'message':_0xc973('0x1c')},'timeout':{'type':_0xc973('0x1d'),'message':_0xc973('0x1e')}});function startRouting(_0x16736d,_0x14cf62,_0x1ec4dc,_0x1669bb){if(_0x16736d&&_0x14cf62&&_0x1ec4dc){_0x14cf62[_0xc973('0x1f')]+=0x1;var _0x3ba4b2={'uniqueid':_0x16736d,'from':_0x1ec4dc[_0xc973('0x20')]?_0x1ec4dc[_0xc973('0x20')][_0xc973('0xc')]:'','joinAt':moment()[_0xc973('0x11')](_0xc973('0x21')),'ContactId':_0x1ec4dc[_0xc973('0x22')]?_0x1ec4dc['contact']['id']:null,'ListId':_0x1ec4dc[_0xc973('0x23')]?_0x1ec4dc[_0xc973('0x23')]['id']:null};_0x3ba4b2[_[_0xc973('0x24')](_0x1ec4dc[_0xc973('0x25')])+_0xc973('0x26')]=_0x14cf62['id']||null;_0x3ba4b2[_['upperFirst'](_0x1ec4dc[_0xc973('0x25')])+_0xc973('0x27')]=_0x1ec4dc['interaction']?_0x1ec4dc[_0xc973('0x28')]['id']:null;_0x3ba4b2[_[_0xc973('0x24')](_0x1ec4dc[_0xc973('0x25')])+'MessageId']=_0x1ec4dc['message']?_0x1ec4dc[_0xc973('0x29')]['id']:null;_0x3ba4b2[_[_0xc973('0x24')](_0x1ec4dc[_0xc973('0x25')])+(_0x1ec4dc[_0xc973('0x25')]!==_0xc973('0x2a')?_0xc973('0x2b'):_0xc973('0x2c'))]=_0x1ec4dc['account']?_0x1ec4dc[_0xc973('0x10')]['id']:null;logger['info'](util['format'](_0xc973('0x2d'),_0x16736d,_0x14cf62[_0xc973('0x2e')]));emitChannelQueueInteraction(_0x1ec4dc['channel'],_0x14cf62[_0xc973('0x2e')],_0x3ba4b2,_0x1ec4dc[_0xc973('0x10')][_0xc973('0x2e')],_0x1ec4dc['message']['id'],!![],_0x1669bb,_0x14cf62['id']);if(rpc[_0x1ec4dc['channel']+_0xc973('0x2f')]){return rpc[_0x1ec4dc[_0xc973('0x25')]+'QueueReport'][_0xc973('0x30')](_0x3ba4b2)[_0xc973('0x31')](function(_0x4871b4){logger[_0xc973('0x32')](_0xc973('0x33'));});}}}function stopRouting(_0x2a0d7c,_0x121def,_0x5d31c3,_0x257550){if(_0x2a0d7c&&_0x121def){_0x121def['waiting']-=0x1;var _0x19d415={'leaveAt':moment()[_0xc973('0x11')](_0xc973('0x21')),'acceptAt':moment()[_0xc973('0x11')](_0xc973('0x21')),'reason':_0xc973('0x34')};logger[_0xc973('0x35')](util[_0xc973('0x11')]('[%s][STOP:QUEUE][NAME:%s]',_0x2a0d7c,_0x121def[_0xc973('0x2e')]));emitChannelQueueInteraction(_0x5d31c3[_0xc973('0x25')],_0x121def[_0xc973('0x2e')],_0x5d31c3[_0xc973('0x20')],_0x5d31c3[_0xc973('0x10')][_0xc973('0x2e')],_0x5d31c3['message']['id'],![],_0x257550,_0x121def['id']);if(rpc[_0x5d31c3[_0xc973('0x25')]+'QueueReport']){return rpc[_0x5d31c3[_0xc973('0x25')]+_0xc973('0x2f')]['update'](_0x2a0d7c,_0x19d415)[_0xc973('0x31')](function(_0x31c07c){logger[_0xc973('0x32')](_0xc973('0x36'));});}}}function endRouting(_0x379102,_0x1e81d5,_0x33f9d8,_0x56626b){if(_0x379102&&_0x1e81d5){_0x1e81d5[_0xc973('0x1f')]-=0x1;var _0x125bcd={'leaveAt':moment()[_0xc973('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0xc973('0x11')](_0xc973('0x21')),'reason':_0xc973('0x37')};logger[_0xc973('0x35')](util['format'](_0xc973('0x38'),_0x379102,_0x1e81d5[_0xc973('0x2e')]));emitChannelQueueInteraction(_0x33f9d8[_0xc973('0x25')],_0x1e81d5[_0xc973('0x2e')],_0x33f9d8[_0xc973('0x20')],_0x33f9d8[_0xc973('0x10')][_0xc973('0x2e')],_0x33f9d8['message']['id'],![],_0x56626b);if(rpc[_0x33f9d8[_0xc973('0x25')]+_0xc973('0x2f')]){return rpc[_0x33f9d8[_0xc973('0x25')]+_0xc973('0x2f')][_0xc973('0x39')](_0x379102,_0x125bcd)[_0xc973('0x31')](function(_0x4f094c){logger['error'](_0xc973('0x36'));});}}}function handleFindQueue(_0x4bc70d){return function(_0x5785d4){return _0x5785d4[_0xc973('0x2e')][_0xc973('0x3a')]()===_0x4bc70d[_0xc973('0x3a')]();};}exports[_0xc973('0x3b')]=function(_0x98b0c2,_0x1dfbe0,_0x2a5bf1,_0x48de46){return function(_0x16eb70){try{var _0x409c30={'name':_0x1dfbe0[0x0],'timeout':_0x1dfbe0[0x1]};var _0x45d61e=queue[_0xc973('0x0')](_0x409c30,{'typecast':!![]});if(_0x45d61e['length']){logger[_0xc973('0x32')]('[%s][QUEUE]\x20%s',_0x98b0c2,_[_0xc973('0x3c')](_0x45d61e,_0xc973('0x29'))[_0xc973('0x3d')](',\x20'));_0x16eb70[_0xc973('0x3e')]();}else{var _0x38ce1b=_['find'](_0x2a5bf1[_0x48de46[_0xc973('0x25')]+_0xc973('0x3f')],handleFindQueue(_0x409c30[_0xc973('0x2e')]));if(_0x38ce1b){startRouting(_0x98b0c2,_0x38ce1b,_0x48de46,_0x2a5bf1);var _0x3fe12c=(_0x38ce1b['timeout']||0xa)*0x3e8;var _0x390222=(_0x409c30[_0xc973('0x37')]||0x14)*0x3e8;var _0x4c0e4d,_0x2c3e9b;if(_0x3fe12c>_0x390222){_0x390222=_0x3fe12c;}var _0xe25575=seqqueue[_0xc973('0x40')](_0x3fe12c);_0xe25575['id']=_0x98b0c2;_0xe25575[_0xc973('0x41')]=_0x3fe12c;_0xe25575[_0xc973('0x42')]=_0x390222;_0xe25575[_0xc973('0x25')]=_0x48de46[_0xc973('0x25')];_0x2a5bf1[_0xc973('0x43')][_0x98b0c2]['on']('end',function(){logger[_0xc973('0x35')](_0xc973('0x44'),_0x98b0c2);stopRouting(_0x98b0c2,_0x38ce1b,_0x48de46,_0x2a5bf1);clearTimeout(_0x4c0e4d);_0x4c0e4d=undefined;_0xe25575['close'](!![]);if(_0x2a5bf1[_0xc973('0x43')][_0x98b0c2]){delete _0x2a5bf1['rules'][_0x98b0c2];}_0x16eb70[_0xc973('0x3e')]();});_0x2a5bf1['rules'][_0x98b0c2]['on'](_0xc973('0x45'),function(){if(_0x2a5bf1[_0xc973('0x43')][_0x98b0c2]){delete _0x2a5bf1['rules'][_0x98b0c2];}});_0x4c0e4d=setTimeout(function(){logger['info']('[%s][QUEUE]\x20APPLICATION\x20END',_0x98b0c2);endRouting(_0x98b0c2,_0x38ce1b,_0x48de46,_0x2a5bf1);clearTimeout(_0x4c0e4d);_0xe25575['close'](!![]);_0x16eb70[_0xc973('0x46')]();},_0x390222);switch(_0x38ce1b['strategy']){case _0xc973('0x47'):strategy['rrmemory'](_0xe25575,_0x38ce1b,_0x2a5bf1,_0x48de46);break;default:strategy[_0xc973('0x48')](_0xe25575,_0x38ce1b,_0x2a5bf1,_0x48de46);}}else{logger['error'](_0xc973('0x49'),_0x98b0c2,_0x409c30['name']);_0x16eb70['stop']();}}}catch(_0x506273){console['log'](_0x506273);logger[_0xc973('0x32')](_0xc973('0x4a'),_0x98b0c2,_0x506273[_0xc973('0x4b')]);_0x16eb70[_0xc973('0x3e')]();}};}; \ 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 b4b73f6..cf66ff0 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 _0xd8d4=['push','handleRun','bind','handleTimeout','timeout','prototype','handleDrained','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','info','forcedOwnership','isAgentAvailable','channel','busyQueue','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','notificationId','busy','STOP','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','routing','squeue','agent','realtime'];(function(_0x27694f,_0x150986){var _0xce032d=function(_0x3ffc20){while(--_0x3ffc20){_0x27694f['push'](_0x27694f['shift']());}};_0xce032d(++_0x150986);}(_0xd8d4,0xac));var _0x4d8d=function(_0x16b46c,_0x263d74){_0x16b46c=_0x16b46c-0x0;var _0xa590a=_0xd8d4[_0x16b46c];return _0xa590a;};'use strict';var _=require(_0x4d8d('0x0'));var uuid=require(_0x4d8d('0x1'));var util=require(_0x4d8d('0x2'));var logger=require(_0x4d8d('0x3'))(_0x4d8d('0x4'));var Agent=function(_0x4d53f7,_0x2de7c3,_0x505590,_0x47ce1a){this['notificationId']=uuid['v4']();this[_0x4d8d('0x5')]=_0x4d53f7;this[_0x4d8d('0x6')]=_0x2de7c3;this[_0x4d8d('0x7')]=_0x505590;this[_0x4d8d('0x4')]=_0x47ce1a;this[_0x4d8d('0x5')][_0x4d8d('0x8')](this[_0x4d8d('0x9')][_0x4d8d('0xa')](this),this[_0x4d8d('0xb')][_0x4d8d('0xa')](this));this[_0x4d8d('0x5')]['on'](_0x4d8d('0xc'),this[_0x4d8d('0xb')][_0x4d8d('0xa')](this));this[_0x4d8d('0x5')]['on']('drained',this['handleDrained']['bind'](this));};Agent[_0x4d8d('0xd')]['push']=function(){this[_0x4d8d('0x5')]['push'](this[_0x4d8d('0x9')]['bind'](this),this[_0x4d8d('0xb')][_0x4d8d('0xa')](this));};Agent[_0x4d8d('0xd')][_0x4d8d('0xe')]=function(){this[_0x4d8d('0xb')](!![]);};Agent[_0x4d8d('0xd')][_0x4d8d('0x9')]=function(_0x489714){logger['info'](_0x4d8d('0xf'),this[_0x4d8d('0x5')]['id'],this[_0x4d8d('0x6')]['id']);if(_[_0x4d8d('0x10')](this[_0x4d8d('0x7')][_0x4d8d('0x11')][this['agent']['id']])){logger[_0x4d8d('0x12')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],this[_0x4d8d('0x6')]['id']);setTimeout(this[_0x4d8d('0x8')][_0x4d8d('0xa')](this),0x3e8);}else{if(this[_0x4d8d('0x4')][_0x4d8d('0x13')]||util[_0x4d8d('0x14')](this[_0x4d8d('0x5')]['id'],this[_0x4d8d('0x7')][_0x4d8d('0x11')][this[_0x4d8d('0x6')]['id']],this[_0x4d8d('0x5')][_0x4d8d('0x15')],![])){this[_0x4d8d('0x7')]['agents'][this[_0x4d8d('0x6')]['id']]['busy']=!![];this[_0x4d8d('0x7')][_0x4d8d('0x11')][this[_0x4d8d('0x6')]['id']][_0x4d8d('0x16')]=undefined;util[_0x4d8d('0x17')](this['notificationId'],this[_0x4d8d('0x5')]['id'],this['realtime'][_0x4d8d('0x11')][this[_0x4d8d('0x6')]['id']],null,this[_0x4d8d('0x4')]);util[_0x4d8d('0x18')](this['squeue']['id'],this[_0x4d8d('0x7')][_0x4d8d('0x11')][this[_0x4d8d('0x6')]['id']],_0x4d8d('0x19')+(this[_0x4d8d('0x4')][_0x4d8d('0x13')]?_0x4d8d('0x1a'):''));}else{logger[_0x4d8d('0x12')](_0x4d8d('0x1b'),this[_0x4d8d('0x5')]['id'],this[_0x4d8d('0x6')]['id']);setTimeout(this['push'][_0x4d8d('0xa')](this),0x3e8);}}};Agent['prototype'][_0x4d8d('0xb')]=function(_0x4438fd){if(_['isNil'](this[_0x4d8d('0x7')]['agents'][this['agent']['id']])){return logger[_0x4d8d('0x12')](_0x4d8d('0x1c'),this[_0x4d8d('0x5')]['id'],this[_0x4d8d('0x6')]['id']);}else{logger[_0x4d8d('0x12')](_0x4d8d('0x1d'),this[_0x4d8d('0x5')]['id'],this['agent']['id']);util[_0x4d8d('0x1e')](this[_0x4d8d('0x1f')],this['squeue']['id'],this[_0x4d8d('0x7')][_0x4d8d('0x11')][this[_0x4d8d('0x6')]['id']],null,this['routing']);this[_0x4d8d('0x7')][_0x4d8d('0x11')][this[_0x4d8d('0x6')]['id']][_0x4d8d('0x20')]=![];this[_0x4d8d('0x7')]['agents'][this[_0x4d8d('0x6')]['id']][_0x4d8d('0x16')]=undefined;util[_0x4d8d('0x18')](this['squeue']['id'],this['realtime'][_0x4d8d('0x11')][this[_0x4d8d('0x6')]['id']],_0x4438fd?_0x4d8d('0x21'):_0x4d8d('0x22'));}if(!_0x4438fd){setTimeout(this[_0x4d8d('0x8')][_0x4d8d('0xa')](this),0x3e8);}};function agent(_0x42dc62,_0x74c2a8,_0x155754,_0x580682){return new Agent(_0x42dc62,_0x74c2a8,_0x155754,_0x580682);}module[_0x4d8d('0x23')]=agent; \ No newline at end of file +var _0xe7b8=['push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','info','isNil','realtime','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','channel','busy','busyQueue','showNotification','notificationId','writeLog','RINGING','[%s][AGENT]\x20timeout\x20with\x20%s','STOP','TIMEOUT','exports','uuid','./util','../../../../../config/logger','squeue','agent','routing'];(function(_0x173dfd,_0x1c5e68){var _0x2d008d=function(_0x1820f8){while(--_0x1820f8){_0x173dfd['push'](_0x173dfd['shift']());}};_0x2d008d(++_0x1c5e68);}(_0xe7b8,0x1ea));var _0x8e7b=function(_0x588bd0,_0x31bd38){_0x588bd0=_0x588bd0-0x0;var _0x507d26=_0xe7b8[_0x588bd0];return _0x507d26;};'use strict';var _=require('lodash');var uuid=require(_0x8e7b('0x0'));var util=require(_0x8e7b('0x1'));var logger=require(_0x8e7b('0x2'))('routing');var Agent=function(_0x39d4df,_0x4182f5,_0x200434,_0x4d4bcd){this['notificationId']=uuid['v4']();this[_0x8e7b('0x3')]=_0x39d4df;this[_0x8e7b('0x4')]=_0x4182f5;this['realtime']=_0x200434;this[_0x8e7b('0x5')]=_0x4d4bcd;this[_0x8e7b('0x3')][_0x8e7b('0x6')](this[_0x8e7b('0x7')][_0x8e7b('0x8')](this),this[_0x8e7b('0x9')][_0x8e7b('0x8')](this));this[_0x8e7b('0x3')]['on'](_0x8e7b('0xa'),this[_0x8e7b('0x9')][_0x8e7b('0x8')](this));this['squeue']['on'](_0x8e7b('0xb'),this[_0x8e7b('0xc')][_0x8e7b('0x8')](this));};Agent['prototype'][_0x8e7b('0x6')]=function(){this[_0x8e7b('0x3')][_0x8e7b('0x6')](this[_0x8e7b('0x7')][_0x8e7b('0x8')](this),this[_0x8e7b('0x9')][_0x8e7b('0x8')](this));};Agent['prototype'][_0x8e7b('0xc')]=function(){this['handleTimeout'](!![]);};Agent[_0x8e7b('0xd')]['handleRun']=function(_0x35913d){logger[_0x8e7b('0xe')]('[%s][AGENT]\x20try\x20with\x20%s',this[_0x8e7b('0x3')]['id'],this['agent']['id']);if(_[_0x8e7b('0xf')](this[_0x8e7b('0x10')][_0x8e7b('0x11')][this[_0x8e7b('0x4')]['id']])){logger[_0x8e7b('0xe')](_0x8e7b('0x12'),this['squeue']['id'],this[_0x8e7b('0x4')]['id']);setTimeout(this['push']['bind'](this),0x3e8);}else{if(this[_0x8e7b('0x5')][_0x8e7b('0x13')]||util['isAgentAvailable'](this[_0x8e7b('0x3')]['id'],this[_0x8e7b('0x10')][_0x8e7b('0x11')][this[_0x8e7b('0x4')]['id']],this['squeue'][_0x8e7b('0x14')],![])){this[_0x8e7b('0x10')][_0x8e7b('0x11')][this[_0x8e7b('0x4')]['id']][_0x8e7b('0x15')]=!![];this[_0x8e7b('0x10')][_0x8e7b('0x11')][this[_0x8e7b('0x4')]['id']][_0x8e7b('0x16')]=undefined;util[_0x8e7b('0x17')](this[_0x8e7b('0x18')],this[_0x8e7b('0x3')]['id'],this[_0x8e7b('0x10')][_0x8e7b('0x11')][this[_0x8e7b('0x4')]['id']],null,this[_0x8e7b('0x5')]);util[_0x8e7b('0x19')](this[_0x8e7b('0x3')]['id'],this[_0x8e7b('0x10')][_0x8e7b('0x11')][this[_0x8e7b('0x4')]['id']],_0x8e7b('0x1a')+(this['routing'][_0x8e7b('0x13')]?':FORCED':''));}else{logger[_0x8e7b('0xe')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this['squeue']['id'],this[_0x8e7b('0x4')]['id']);setTimeout(this['push'][_0x8e7b('0x8')](this),0x3e8);}}};Agent[_0x8e7b('0xd')]['handleTimeout']=function(_0x49b7f7){if(_['isNil'](this[_0x8e7b('0x10')][_0x8e7b('0x11')][this[_0x8e7b('0x4')]['id']])){return logger[_0x8e7b('0xe')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],this['agent']['id']);}else{logger['info'](_0x8e7b('0x1b'),this[_0x8e7b('0x3')]['id'],this[_0x8e7b('0x4')]['id']);util['hideNotification'](this[_0x8e7b('0x18')],this[_0x8e7b('0x3')]['id'],this[_0x8e7b('0x10')][_0x8e7b('0x11')][this[_0x8e7b('0x4')]['id']],null,this[_0x8e7b('0x5')]);this[_0x8e7b('0x10')]['agents'][this['agent']['id']][_0x8e7b('0x15')]=![];this['realtime'][_0x8e7b('0x11')][this[_0x8e7b('0x4')]['id']][_0x8e7b('0x16')]=undefined;util[_0x8e7b('0x19')](this[_0x8e7b('0x3')]['id'],this['realtime'][_0x8e7b('0x11')][this['agent']['id']],_0x49b7f7?_0x8e7b('0x1c'):_0x8e7b('0x1d'));}if(!_0x49b7f7){setTimeout(this[_0x8e7b('0x6')][_0x8e7b('0x8')](this),0x3e8);}};function agent(_0x5af815,_0x2c2f40,_0x469928,_0x408c9b){return new Agent(_0x5af815,_0x2c2f40,_0x469928,_0x408c9b);}module[_0x8e7b('0x1e')]=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 d0e7cf4..1c3b3c1 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 _0x1d25=['length','agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','writeLog','RINGING','busy','name','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','TIMEOUT','busyQueue','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','queue','realtime','handleRun','handleTimeout','timeout','bind','handleDrained','prototype','push','isNil','Agents'];(function(_0x3f37c8,_0x2de1ad){var _0x1c3bc2=function(_0x45caf0){while(--_0x45caf0){_0x3f37c8['push'](_0x3f37c8['shift']());}};_0x1c3bc2(++_0x2de1ad);}(_0x1d25,0xba));var _0x51d2=function(_0x26b622,_0x237e9e){_0x26b622=_0x26b622-0x0;var _0x58a028=_0x1d25[_0x26b622];return _0x58a028;};'use strict';var _=require(_0x51d2('0x0'));var uuid=require(_0x51d2('0x1'));var util=require(_0x51d2('0x2'));var logger=require(_0x51d2('0x3'))(_0x51d2('0x4'));var Beepall=function(_0x5aac21,_0x1b276e,_0x3d53fe,_0x4c93f2){this[_0x51d2('0x5')]=uuid['v4']();this[_0x51d2('0x6')]=_0x5aac21;this[_0x51d2('0x7')]=_0x1b276e;this[_0x51d2('0x8')]=_0x3d53fe;this[_0x51d2('0x4')]=_0x4c93f2;this[_0x51d2('0x6')]['push'](this[_0x51d2('0x9')]['bind'](this),this[_0x51d2('0xa')]['bind'](this));this['squeue']['on'](_0x51d2('0xb'),this[_0x51d2('0xa')][_0x51d2('0xc')](this));this[_0x51d2('0x6')]['on']('drained',this[_0x51d2('0xd')][_0x51d2('0xc')](this));};Beepall[_0x51d2('0xe')][_0x51d2('0xf')]=function(){this[_0x51d2('0x6')]['push'](this[_0x51d2('0x9')][_0x51d2('0xc')](this),this['handleTimeout']['bind'](this));};Beepall[_0x51d2('0xe')][_0x51d2('0xd')]=function(_0x43ddf6){this[_0x51d2('0xa')](!![]);};Beepall[_0x51d2('0xe')]['handleRun']=function(_0xa2665e){var _0x5d89b2=!![];if(!_[_0x51d2('0x10')](this[_0x51d2('0x7')])&&!_[_0x51d2('0x10')](this['queue'][_0x51d2('0x11')])&&this[_0x51d2('0x7')][_0x51d2('0x11')][_0x51d2('0x12')]>0x0){for(var _0x31772c=0x0,_0x17f8ea;_0x31772c0x0){for(var _0x3dddb1=0x0,_0x47623a;_0x3dddb10x0&&_0x5dc839[_0x46019d+_0x49fd('0x27')]>=_0x5dc839[_0x46019d+_0x49fd('0x28')]){writeLog(_0x156221,_0x5dc839,_0x46019d[_0x49fd('0x29')]()+_0x49fd('0x2a'));return![];}}return!![];};exports[_0x49fd('0x2b')]=function(_0x54c8bb,_0x2b2710,_0x52b35d,_0x32fc19,_0x89badc){return sendNotification(!![],_0x54c8bb,_0x2b2710,_0x52b35d,_0x32fc19,_0x89badc);};exports['hideNotification']=function(_0x203038,_0x2c8568,_0x23374c,_0x43826f,_0x404bc1){return sendNotification(![],_0x203038,_0x2c8568,_0x23374c,_0x43826f,_0x404bc1);};exports[_0x49fd('0x2c')]=writeLog; \ No newline at end of file +var _0xd046=['save','remove','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','busy','BUSY','online','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','util','../utils','mustache','../../../../../config/environment','redis','emit','user:save','\x20interaction','name','account','notificationSound','notificationShake','body','queue','msg','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','format','message','user:%s','notification:%s'];(function(_0x33dbdf,_0x1be1e1){var _0x179cc5=function(_0x3d5d4c){while(--_0x3d5d4c){_0x33dbdf['push'](_0x33dbdf['shift']());}};_0x179cc5(++_0x1be1e1);}(_0xd046,0x129));var _0x6d04=function(_0xe98cd9,_0x35101e){_0xe98cd9=_0xe98cd9-0x0;var _0x1814e2=_0xd046[_0xe98cd9];return _0x1814e2;};'use strict';var _=require('lodash');var util=require(_0x6d04('0x0'));var utils=require(_0x6d04('0x1'));var Mustache=require(_0x6d04('0x2'));var Redis=require('ioredis');var config=require(_0x6d04('0x3'));var logger=require('../../../../../config/logger')('routing');config[_0x6d04('0x4')]=_['defaults'](config[_0x6d04('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6d04('0x4')]));function emit(_0x1968c4,_0x4f83bc,_0x569c7b){io['to'](_0x1968c4)[_0x6d04('0x5')](_0x4f83bc,_0x569c7b);}function sendNotification(_0x42aa22,_0x52fc0c,_0x533dcf,_0x27a3d6,_0x4b5aae,_0x38bce9){io['to'](util['format']('user:%s',_0x27a3d6['name']))[_0x6d04('0x5')](_0x6d04('0x6'),_0x27a3d6);var _0x3397ea=_0x38bce9||{};var _0x1acfcc=_0x533dcf['split']('.');var _0x26a6ab={'uniqueid':_0x52fc0c,'channel':_0x1acfcc[0x0],'id':_0x1acfcc[0x1],'title':_0x1acfcc[0x0]+_0x6d04('0x7'),'interactionId':_0x1acfcc[0x2],'queue':_0x4b5aae?_0x4b5aae[_0x6d04('0x8')]:null,'sound':_0x3397ea[_0x6d04('0x9')][_0x6d04('0xa')],'shake':_0x3397ea[_0x6d04('0x9')][_0x6d04('0xb')]};try{if(!_0x3397ea[_0x6d04('0xc')]){_0x3397ea[_0x6d04('0xc')]={};}if(_0x4b5aae){_0x3397ea[_0x6d04('0xc')][_0x6d04('0xd')]=_0x4b5aae;}else if(_0x3397ea[_0x6d04('0xc')][_0x6d04('0xd')]){delete _0x3397ea[_0x6d04('0xc')][_0x6d04('0xd')];}_0x26a6ab[_0x6d04('0xe')]=utils[_0x6d04('0xf')](_0x3397ea[_0x6d04('0x9')][_0x6d04('0x10')],_0x3397ea);}catch(_0x1f8252){_0x26a6ab[_0x6d04('0xe')]=_0x6d04('0x11');logger[_0x6d04('0x12')](util[_0x6d04('0x13')]('[%s][QUEUE]\x20%s',_0x52fc0c,_0x1f8252[_0x6d04('0x14')]));}io['to'](util[_0x6d04('0x13')](_0x6d04('0x15'),_0x27a3d6[_0x6d04('0x8')]))[_0x6d04('0x5')](util[_0x6d04('0x13')](_0x6d04('0x16'),_0x42aa22?_0x6d04('0x17'):_0x6d04('0x18')),_0x26a6ab);}function writeLog(_0x27d8eb,_0xbddecb,_0x2994d9){return logger[_0x6d04('0x19')](util['format'](_0x6d04('0x1a'),_0x27d8eb,_0xbddecb[_0x6d04('0x8')],_0x2994d9));}exports['isAgentAvailable']=function(_0x5a0224,_0x3bd862,_0x326276,_0x4386bd){if(_0x3bd862[_0x6d04('0x1b')]){writeLog(_0x5a0224,_0x3bd862,_0x6d04('0x1c'));return![];}if(!_0x3bd862[_0x6d04('0x1d')]){writeLog(_0x5a0224,_0x3bd862,_0x6d04('0x1e'));return![];}if(_0x3bd862[_0x326276+_0x6d04('0x1f')]){writeLog(_0x5a0224,_0x3bd862,_0x6d04('0x20'));return![];}if(_0x4386bd&&_0x3bd862[_0x6d04('0x21')](_0x326276+_0x6d04('0x22'))&&_0x3bd862[_0x6d04('0x21')](_0x326276+_0x6d04('0x23'))){if(_0x3bd862[_0x326276+_0x6d04('0x22')]>0x0&&_0x3bd862[_0x326276+'CurrentCapacity']>=_0x3bd862[_0x326276+_0x6d04('0x22')]){writeLog(_0x5a0224,_0x3bd862,_0x326276[_0x6d04('0x24')]()+_0x6d04('0x25'));return![];}}return!![];};exports[_0x6d04('0x26')]=function(_0x4256a3,_0x3a62d4,_0x549e97,_0x2a3b20,_0x3a7f68){return sendNotification(!![],_0x4256a3,_0x3a62d4,_0x549e97,_0x2a3b20,_0x3a7f68);};exports[_0x6d04('0x27')]=function(_0x40b9e6,_0x2ed2bb,_0x5d2b7e,_0x5d1033,_0x56dd77){return sendNotification(![],_0x40b9e6,_0x2ed2bb,_0x5d2b7e,_0x5d1033,_0x56dd77);};exports['writeLog']=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 6a1de83..b1afac9 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 _0x9d54=['isObject','shelljs','lodash','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','error','map','message','join','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','[%s][SYSTEM]\x20commnad:\x20%s','info','[%s][SYSTEM]\x20result\x20code:\x20%s','isNil','body','[%s][SYSTEM]\x20%s'];(function(_0x3d3750,_0x3fc357){var _0x3b24aa=function(_0x380701){while(--_0x380701){_0x3d3750['push'](_0x3d3750['shift']());}};_0x3b24aa(++_0x3fc357);}(_0x9d54,0x155));var _0x49d5=function(_0x4095b,_0x1e986c){_0x4095b=_0x4095b-0x0;var _0x30b5a3=_0x9d54[_0x4095b];return _0x30b5a3;};'use strict';var schema=require('validate');var sh=require(_0x49d5('0x0'));var _=require(_0x49d5('0x1'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0x49d5('0x2'));var system=schema({'command':{'type':_0x49d5('0x3'),'required':!![],'message':_0x49d5('0x4')}});exports[_0x49d5('0x5')]=function(_0x32755d,_0x3775ae){return function(_0x557460){try{var _0x49eff0={'command':_0x3775ae[0x0]};var _0x2eac1f=system[_0x49d5('0x6')](_0x49eff0,{'typecast':!![]});if(_0x2eac1f['length']){logger[_0x49d5('0x7')]('[%s][SYSTEM]\x20%s',_0x32755d,_[_0x49d5('0x8')](_0x2eac1f,_0x49d5('0x9'))[_0x49d5('0xa')](',\x20'));logger['info'](_0x49d5('0xb'),_0x32755d);_0x557460[_0x49d5('0xc')]();}else{var _0x520be2=this;var _0x1abd6c=utils['getMustacheRender'](_0x3775ae[0x0],this);logger['info'](_0x49d5('0xd'),_0x32755d,_0x1abd6c);sh['exec'](_['trim'](_0x1abd6c),function(_0x2d85aa,_0x291dd4){logger[_0x49d5('0xe')](_0x49d5('0xf'),_0x32755d,_0x2d85aa);if(_0x2d85aa==0x0){var _0x418552=_0x291dd4['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0x49d5('0x10')](_0x3775ae[0x1])||_['isEmpty'](_0x3775ae[0x1])){logger['info']('[%s][SYSTEM]\x20no\x20variable',_0x32755d);_0x520be2['body'][_0x3775ae[0x1]]=_0x418552;}else{logger[_0x49d5('0xe')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x32755d,_0x3775ae[0x1],_0x418552);_0x520be2[_0x49d5('0x11')][_0x3775ae[0x1]]=_0x418552;}}_0x557460[_0x49d5('0xc')]();});}}catch(_0x15ca32){logger[_0x49d5('0x7')](_0x49d5('0x12'),_0x32755d,_[_0x49d5('0x13')](_0x15ca32)?JSON['stringify'](_0x15ca32):_0x15ca32);logger[_0x49d5('0xe')](_0x49d5('0xb'),_0x32755d);_0x557460[_0x49d5('0xc')]();}};}; \ No newline at end of file +var _0xf491=['replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','error','[%s][SYSTEM]\x20%s','isObject','validate','shelljs','lodash','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','map','message','join','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','info','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s'];(function(_0x210b8e,_0x23d896){var _0x252117=function(_0x428b6e){while(--_0x428b6e){_0x210b8e['push'](_0x210b8e['shift']());}};_0x252117(++_0x23d896);}(_0xf491,0x178));var _0x1f49=function(_0x5e4759,_0x1f8793){_0x5e4759=_0x5e4759-0x0;var _0x1aefe3=_0xf491[_0x5e4759];return _0x1aefe3;};'use strict';var schema=require(_0x1f49('0x0'));var sh=require(_0x1f49('0x1'));var _=require(_0x1f49('0x2'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0x1f49('0x3'));var system=schema({'command':{'type':'string','required':!![],'message':_0x1f49('0x4')}});exports['consequence']=function(_0x19162f,_0x394224){return function(_0x464ca0){try{var _0x52d5b5={'command':_0x394224[0x0]};var _0x4c04bb=system[_0x1f49('0x0')](_0x52d5b5,{'typecast':!![]});if(_0x4c04bb['length']){logger['error']('[%s][SYSTEM]\x20%s',_0x19162f,_[_0x1f49('0x5')](_0x4c04bb,_0x1f49('0x6'))[_0x1f49('0x7')](',\x20'));logger['info'](_0x1f49('0x8'),_0x19162f);_0x464ca0[_0x1f49('0x9')]();}else{var _0x3e6501=this;var _0x1d2f05=utils['getMustacheRender'](_0x394224[0x0],this);logger[_0x1f49('0xa')](_0x1f49('0xb'),_0x19162f,_0x1d2f05);sh[_0x1f49('0xc')](_[_0x1f49('0xd')](_0x1d2f05),function(_0x53f4bb,_0x48acba){logger[_0x1f49('0xa')](_0x1f49('0xe'),_0x19162f,_0x53f4bb);if(_0x53f4bb==0x0){var _0x12e6df=_0x48acba[_0x1f49('0xf')](/(\r\n|\n|\r)/gm,'');if(_[_0x1f49('0x10')](_0x394224[0x1])||_[_0x1f49('0x11')](_0x394224[0x1])){logger[_0x1f49('0xa')](_0x1f49('0x12'),_0x19162f);_0x3e6501[_0x1f49('0x13')][_0x394224[0x1]]=_0x12e6df;}else{logger[_0x1f49('0xa')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x19162f,_0x394224[0x1],_0x12e6df);_0x3e6501['body'][_0x394224[0x1]]=_0x12e6df;}}_0x464ca0['next']();});}}catch(_0xb65054){logger[_0x1f49('0x14')](_0x1f49('0x15'),_0x19162f,_[_0x1f49('0x16')](_0xb65054)?JSON['stringify'](_0xb65054):_0xb65054);logger['info'](_0x1f49('0x8'),_0x19162f);_0x464ca0[_0x1f49('0x9')]();}};}; \ 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 15d2ea3..0085168 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 _0x9070=['Interaction','addTags','interaction','then','catch','[%s][TAG]\x20%s','stringify','finally','isObject','validate','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel'];(function(_0x2dae20,_0x5c344f){var _0x17b9cc=function(_0x3bb702){while(--_0x3bb702){_0x2dae20['push'](_0x2dae20['shift']());}};_0x17b9cc(++_0x5c344f);}(_0x9070,0x127));var _0x0907=function(_0x1e17eb,_0x2e15c5){_0x1e17eb=_0x1e17eb-0x0;var _0x4de4c7=_0x9070[_0x1e17eb];return _0x4de4c7;};'use strict';var schema=require(_0x0907('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0x0907('0x1')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x0907('0x2')),'faxInteraction':require(_0x0907('0x3')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require('../../../../config/logger')(_0x0907('0x4'));var tag=schema({'tag':{'type':_0x0907('0x5'),'required':!![],'message':_0x0907('0x6')}});exports[_0x0907('0x7')]=function(_0x111587,_0x55f8bc,_0x2db0ca,_0x398206){return function(_0x2d4b93){try{var _0x193e03={'tag':_0x55f8bc[0x0]};var _0x314cff=tag[_0x0907('0x0')](_0x193e03,{'typecast':!![]});if(_0x314cff[_0x0907('0x8')]){logger[_0x0907('0x9')]('[%s][TAG]\x20%s',_0x111587,_[_0x0907('0xa')](_0x314cff,_0x0907('0xb'))[_0x0907('0xc')](',\x20'));logger[_0x0907('0xd')](_0x0907('0xe'),_0x111587);_0x2d4b93[_0x0907('0xf')]();}else{var _0x1f1845={'ids':[_0x55f8bc[0x0]]};if(rpc[_0x398206[_0x0907('0x10')]+_0x0907('0x11')]){rpc[_0x398206[_0x0907('0x10')]+_0x0907('0x11')][_0x0907('0x12')](_0x398206[_0x0907('0x13')]['id'],_0x1f1845)[_0x0907('0x14')](function(_0x4a3cb6){logger[_0x0907('0xd')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x111587,_0x55f8bc[0x1],_0x398206[_0x0907('0x10')],_0x398206[_0x0907('0x13')]['id']);})[_0x0907('0x15')](function(_0x35fecc){logger[_0x0907('0x9')](_0x0907('0x16'),_0x111587,JSON[_0x0907('0x17')](_0x35fecc));logger[_0x0907('0xd')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x111587);})[_0x0907('0x18')](function(){_0x2d4b93[_0x0907('0xf')]();});}}}catch(_0x574b47){logger[_0x0907('0x9')](_0x0907('0x16'),_0x111587,_[_0x0907('0x19')](_0x574b47)?JSON['stringify'](_0x574b47):_0x574b47);logger[_0x0907('0xd')](_0x0907('0xe'),_0x111587);_0x2d4b93[_0x0907('0xf')]();}};}; \ No newline at end of file +var _0x7011=['next','channel','Interaction','addTags','interaction','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','finally','isObject','stringify','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','number','length','error','[%s][TAG]\x20%s','map','message','join','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next'];(function(_0x95942,_0x85da80){var _0x6d7f81=function(_0x510549){while(--_0x510549){_0x95942['push'](_0x95942['shift']());}};_0x6d7f81(++_0x85da80);}(_0x7011,0x194));var _0x1701=function(_0x5d0207,_0x4000c4){_0x5d0207=_0x5d0207-0x0;var _0xf3e249=_0x7011[_0x5d0207];return _0xf3e249;};'use strict';var schema=require('validate');var _=require(_0x1701('0x0'));var rpc={'chatInteraction':require(_0x1701('0x1')),'openchannelInteraction':require(_0x1701('0x2')),'smsInteraction':require(_0x1701('0x3')),'mailInteraction':require(_0x1701('0x4')),'faxInteraction':require(_0x1701('0x5')),'whatsappInteraction':require(_0x1701('0x6'))};var logger=require(_0x1701('0x7'))('routing');var tag=schema({'tag':{'type':_0x1701('0x8'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x10e467,_0x299183,_0x10e0be,_0x21ae98){return function(_0x47ecc2){try{var _0x4a6a18={'tag':_0x299183[0x0]};var _0x29a1ac=tag['validate'](_0x4a6a18,{'typecast':!![]});if(_0x29a1ac[_0x1701('0x9')]){logger[_0x1701('0xa')](_0x1701('0xb'),_0x10e467,_[_0x1701('0xc')](_0x29a1ac,_0x1701('0xd'))[_0x1701('0xe')](',\x20'));logger['info'](_0x1701('0xf'),_0x10e467);_0x47ecc2[_0x1701('0x10')]();}else{var _0x14d416={'ids':[_0x299183[0x0]]};if(rpc[_0x21ae98[_0x1701('0x11')]+_0x1701('0x12')]){rpc[_0x21ae98['channel']+_0x1701('0x12')][_0x1701('0x13')](_0x21ae98[_0x1701('0x14')]['id'],_0x14d416)[_0x1701('0x15')](function(_0x319790){logger[_0x1701('0x16')](_0x1701('0x17'),_0x10e467,_0x299183[0x1],_0x21ae98[_0x1701('0x11')],_0x21ae98[_0x1701('0x14')]['id']);})[_0x1701('0x18')](function(_0x28a1d6){logger[_0x1701('0xa')](_0x1701('0xb'),_0x10e467,JSON['stringify'](_0x28a1d6));logger['info'](_0x1701('0xf'),_0x10e467);})[_0x1701('0x19')](function(){_0x47ecc2[_0x1701('0x10')]();});}}}catch(_0x560157){logger[_0x1701('0xa')](_0x1701('0xb'),_0x10e467,_[_0x1701('0x1a')](_0x560157)?JSON[_0x1701('0x1b')](_0x560157):_0x560157);logger[_0x1701('0x16')](_0x1701('0xf'),_0x10e467);_0x47ecc2[_0x1701('0x10')]();}};}; \ 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 d9a17ad..e690612 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 _0x8f67=['routing','lodash','consequence','replace','\x20-\x20','includes','push','urlOnAnswer','?params=','urlOnRing','jsonrpc','2.0','login','params','stringify','utf8','POST','application/json-rpc','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&sessionId=','&data=','stop','catch','error','[%s][TVOX]\x20%s','isObject','info','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','request-promise','../../../../config/logger'];(function(_0x124260,_0x10ffcb){var _0x5c68e2=function(_0x14c4ea){while(--_0x14c4ea){_0x124260['push'](_0x124260['shift']());}};_0x5c68e2(++_0x10ffcb);}(_0x8f67,0xec));var _0x78f6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8f67[_0x3dd15e];return _0x231fd0;};'use strict';var rp=require(_0x78f6('0x0'));var logger=require(_0x78f6('0x1'))(_0x78f6('0x2'));var _=require(_0x78f6('0x3'));var arr=[];exports[_0x78f6('0x4')]=function(_0x4ae84b,_0xdd1076){return function(_0xfe42eb){var _0x337bfb=_0xdd1076[0xa];var _0x1307e9=_0xdd1076[0xb];var _0x5b5f98=_0xdd1076[0xc];var _0x59d132=_0xdd1076[0xd];var _0x31ef10=_0xdd1076[0xe];var _0x199ed8=_0xdd1076[0xf][_0x78f6('0x5')](/\n/g,_0x78f6('0x6'));var _0x3afd45=_0xdd1076[0x10][_0x78f6('0x5')](/\n/g,'\x20');if(!arr[_0x78f6('0x7')](_0x1307e9)){arr[_0x78f6('0x8')](_0x1307e9);var _0x3de2fc=_0xdd1076[0x3];var _0x4ac6ee=_0xdd1076[0x4];var _0x40ae7a=_0xdd1076[0x1];var _0x3ce685=_0xdd1076[0x0];var _0x58f98e={};_0x58f98e[_0x78f6('0x9')]=_0xdd1076[0x8]+_0x78f6('0xa')+_0x5b5f98+'|'+_0x337bfb+'|'+_0x59d132+'|'+_0x1307e9+'|'+_0x31ef10;_0x58f98e[_0x78f6('0xb')]=_0xdd1076[0x7]+_0x78f6('0xa')+_0x5b5f98+'|'+_0x337bfb+'|'+_0x59d132+'|'+_0x1307e9+'|'+_0x31ef10+'|'+_0x199ed8+'|'+_0x3afd45;_0x58f98e['title']=_0xdd1076[0x9];var _0x1cbf0e={};_0x1cbf0e[_0x78f6('0xc')]=_0x78f6('0xd');_0x1cbf0e['method']=_0x78f6('0xe');var _0x4e48fd=[];_0x4e48fd['push'](_0xdd1076[0x2]);_0x4e48fd['push'](_0xdd1076[0x5]);_0x4e48fd[_0x78f6('0x8')](_0xdd1076[0x6]);_0x1cbf0e[_0x78f6('0xf')]=_0x4e48fd;_0x1cbf0e['id']=0x1;var _0x3507eb=JSON[_0x78f6('0x10')](_0x1cbf0e);var _0x12f046={'encoding':_0x78f6('0x11'),'method':_0x78f6('0x12'),'timeout':0x2710,'url':_0x3de2fc,'headers':{'Content-Type':_0x78f6('0x13')},'body':_0x3507eb};return rp(_0x12f046)['then'](function(_0x25a5e7){const _0x460073=JSON[_0x78f6('0x14')](_0x25a5e7);if(!_0x460073[_0x78f6('0x15')][_0x78f6('0x16')]){throw new Error(_0x78f6('0x17'));}var _0x461614=_0x1307e9;var _0x22db44=_0x78f6('0x18')+_0x40ae7a+'&serviceId='+_0x3ce685+_0x78f6('0x19')+_0x461614+_0x78f6('0x1a')+JSON[_0x78f6('0x10')](_0x58f98e);var _0x592bfc=_0x4ac6ee+'?'+_0x22db44;return rp(_0x592bfc);})['then'](function(_0xd75910){logger['info']('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x4ae84b,_0xd75910);_0xfe42eb[_0x78f6('0x1b')]();})[_0x78f6('0x1c')](function(_0x58c77d){logger[_0x78f6('0x1d')](_0x78f6('0x1e'),_0x4ae84b,_[_0x78f6('0x1f')](_0x58c77d)?JSON[_0x78f6('0x10')](_0x58c77d):_0x58c77d);_0xfe42eb['stop']();});}else{logger[_0x78f6('0x20')](_0x78f6('0x21'),_0x4ae84b);_0xfe42eb['next']();}};}; \ No newline at end of file +var _0xbe60=['request-promise','../../../../config/logger','routing','replace','\x20-\x20','includes','push','urlOnAnswer','urlOnRing','?params=','jsonrpc','2.0','method','login','stringify','POST','then','parse','result','logged','channelId=','&sessionId=','&data=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','[%s][TVOX]\x20%s','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next'];(function(_0xeebbab,_0x1a81c4){var _0x298137=function(_0x1bb50d){while(--_0x1bb50d){_0xeebbab['push'](_0xeebbab['shift']());}};_0x298137(++_0x1a81c4);}(_0xbe60,0xae));var _0x0be6=function(_0x465cdc,_0x174f85){_0x465cdc=_0x465cdc-0x0;var _0x68c2e8=_0xbe60[_0x465cdc];return _0x68c2e8;};'use strict';var rp=require(_0x0be6('0x0'));var logger=require(_0x0be6('0x1'))(_0x0be6('0x2'));var _=require('lodash');var arr=[];exports['consequence']=function(_0x23001f,_0x5883de){return function(_0xf0f475){var _0x3eda00=_0x5883de[0xa];var _0x338764=_0x5883de[0xb];var _0x593341=_0x5883de[0xc];var _0x30a17b=_0x5883de[0xd];var _0xc0f794=_0x5883de[0xe];var _0x5a4724=_0x5883de[0xf][_0x0be6('0x3')](/\n/g,_0x0be6('0x4'));var _0x343968=_0x5883de[0x10][_0x0be6('0x3')](/\n/g,'\x20');if(!arr[_0x0be6('0x5')](_0x338764)){arr[_0x0be6('0x6')](_0x338764);var _0x106d82=_0x5883de[0x3];var _0x5de82b=_0x5883de[0x4];var _0x2f96b9=_0x5883de[0x1];var _0x216608=_0x5883de[0x0];var _0x44e38b={};_0x44e38b[_0x0be6('0x7')]=_0x5883de[0x8]+'?params='+_0x593341+'|'+_0x3eda00+'|'+_0x30a17b+'|'+_0x338764+'|'+_0xc0f794;_0x44e38b[_0x0be6('0x8')]=_0x5883de[0x7]+_0x0be6('0x9')+_0x593341+'|'+_0x3eda00+'|'+_0x30a17b+'|'+_0x338764+'|'+_0xc0f794+'|'+_0x5a4724+'|'+_0x343968;_0x44e38b['title']=_0x5883de[0x9];var _0x33dd8b={};_0x33dd8b[_0x0be6('0xa')]=_0x0be6('0xb');_0x33dd8b[_0x0be6('0xc')]=_0x0be6('0xd');var _0x3fbcaa=[];_0x3fbcaa[_0x0be6('0x6')](_0x5883de[0x2]);_0x3fbcaa[_0x0be6('0x6')](_0x5883de[0x5]);_0x3fbcaa[_0x0be6('0x6')](_0x5883de[0x6]);_0x33dd8b['params']=_0x3fbcaa;_0x33dd8b['id']=0x1;var _0x2c0237=JSON[_0x0be6('0xe')](_0x33dd8b);var _0x4c0d7d={'encoding':'utf8','method':_0x0be6('0xf'),'timeout':0x2710,'url':_0x106d82,'headers':{'Content-Type':'application/json-rpc'},'body':_0x2c0237};return rp(_0x4c0d7d)[_0x0be6('0x10')](function(_0x182582){const _0x1f38f1=JSON[_0x0be6('0x11')](_0x182582);if(!_0x1f38f1[_0x0be6('0x12')][_0x0be6('0x13')]){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0x44bf5a=_0x338764;var _0x29692a=_0x0be6('0x14')+_0x2f96b9+'&serviceId='+_0x216608+_0x0be6('0x15')+_0x44bf5a+_0x0be6('0x16')+JSON[_0x0be6('0xe')](_0x44e38b);var _0xc689c6=_0x5de82b+'?'+_0x29692a;return rp(_0xc689c6);})['then'](function(_0x2c6a2c){logger[_0x0be6('0x17')](_0x0be6('0x18'),_0x23001f,_0x2c6a2c);_0xf0f475[_0x0be6('0x19')]();})['catch'](function(_0x436b5c){logger['error'](_0x0be6('0x1a'),_0x23001f,_[_0x0be6('0x1b')](_0x436b5c)?JSON[_0x0be6('0xe')](_0x436b5c):_0x436b5c);_0xf0f475['stop']();});}else{logger[_0x0be6('0x17')](_0x0be6('0x1c'),_0x23001f);_0xf0f475['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 acd5955..9effbcd 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 _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0xfc5e67,_0x2d9a20){var _0x39aa50=function(_0x4f59a0){while(--_0x4f59a0){_0xfc5e67['push'](_0xfc5e67['shift']());}};_0x39aa50(++_0x2d9a20);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'use strict';var Mustache=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'getMustacheRender':function(_0x5dd881,_0x550fbc){return Mustache[_0x0a9e('0x3')](_0x5dd881,_['merge'](_0x550fbc[_0x0a9e('0x4')],{'contact':_0x550fbc[_0x0a9e('0x5')],'message':_0x550fbc[_0x0a9e('0x6')],'account':_0x550fbc[_0x0a9e('0x7')],'interaction':_0x550fbc[_0x0a9e('0x8')],'list':_0x550fbc['list']}))||'';}}; \ No newline at end of file +var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x97466,_0x4c86ed){var _0x1a1533=function(_0x25d25c){while(--_0x25d25c){_0x97466['push'](_0x97466['shift']());}};_0x1a1533(++_0x4c86ed);}(_0xe706,0xa3));var _0x6e70=function(_0x5d2dc8,_0x4088bb){_0x5d2dc8=_0x5d2dc8-0x0;var _0x2e6a66=_0xe706[_0x5d2dc8];return _0x2e6a66;};'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 diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 9e508f7..28f8190 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 _0xf17f=['IntervalId','isNil','map','Intervals','interval','listen','message','interaction','isArray','applications','existsSync','join','.js','autoreply','appdata','mail','push','length','slice','split','dialogflowv2','amazonlex','tag','tvox','account','notificationTemplate','ChatWebsiteId','ContactId','body','condition','intervals','./applications/','priority','info','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','app','rules','execute','stringify','emit','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busyQueue','end','channel','QueueReport','update','UserId','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','values','chatQueues','available','loggedIn','name','mailQueues','waiting','openchannelQueues','paused','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','path','bluebird','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0xf17f,0x113));var _0xff17=function(_0x25f271,_0x4e67ed){_0x25f271=_0x25f271-0x0;var _0x104ab9=_0xf17f[_0x25f271];return _0x104ab9;};'use strict';var _=require(_0xff17('0x0'));var util=require(_0xff17('0x1'));var path=require(_0xff17('0x2'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0xff17('0x3'));var uuid=require('uuid');var utils=require('./applications/utils');var config=require(_0xff17('0x4'));var logger=require(_0xff17('0x5'))(_0xff17('0x6'));var rpc={'openchannelQueueReport':require(_0xff17('0x7')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0xff17('0x8')),'smsQueueReport':require(_0xff17('0x9')),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0xff17('0xa'))};var RuleEngine=require(_0xff17('0xb'));function getId(_0x58e9f8,_0x23d331,_0xcf807e){return util[_0xff17('0xc')]('%s.%s.%s',_0x58e9f8,_0x23d331||0x0,_0xcf807e||0x0);}function getIntervals(_0x406e27,_0x1dbb25){var _0xbbca1f=[];if(!_['isNil'](_0x1dbb25[_0xff17('0xd')])&&!_[_0xff17('0xe')](_0x406e27[_0x1dbb25[_0xff17('0xd')]])&&!_[_0xff17('0xe')](_0x406e27[_0x1dbb25['IntervalId']]['Intervals'])){_0xbbca1f=_[_0xff17('0xf')](_0x406e27[_0x1dbb25[_0xff17('0xd')]][_0xff17('0x10')],'interval');}else if(!_[_0xff17('0xe')](_0x1dbb25[_0xff17('0x11')])){_0xbbca1f=[_0x1dbb25['interval']];}return _0xbbca1f;}exports[_0xff17('0x12')]=function(_0x4218bc){_0x4218bc['rules']={};return new BPromise(function(_0x5721de,_0x53f625){var _0x2f97b1={'Start':function(_0x5b7870){var _0x2f501a=this;return new Promise(function(_0x2a6d05,_0x249641){if(_0x5b7870){try{var _0x290c1c=[];var _0x29aae9=getId(_0x5b7870['channel'],_0x5b7870[_0xff17('0x13')]?_0x5b7870[_0xff17('0x13')]['id']:0x0,_0x5b7870[_0xff17('0x14')]?_0x5b7870['interaction']['id']:0x0);if(_0x5b7870['applications']&&_[_0xff17('0x15')](_0x5b7870[_0xff17('0x16')])&&_0x5b7870[_0xff17('0x16')]['length']){for(var _0x47bafc=0x0;_0x47bafc<_0x5b7870['applications']['length'];_0x47bafc+=0x1){var _0x1b6ffb=_0x5b7870['applications'][_0x47bafc];if(fs[_0xff17('0x17')](path[_0xff17('0x18')](__dirname,_0xff17('0x16'),_0x1b6ffb['app']+_0xff17('0x19')))){var _0x244330=[];switch(_0x1b6ffb['app']['toLowerCase']()){case _0xff17('0x1a'):var _0x237b49=_0x1b6ffb[_0xff17('0x1b')]['split'](',');if(_0x5b7870['channel']===_0xff17('0x1c')){_0x244330[_0xff17('0x1d')](_0x237b49[0x0]);_0x244330[_0xff17('0x1d')](_0x237b49[0x1]);_0x244330[_0xff17('0x1d')](_0x237b49['slice'](0x2,_0x237b49[_0xff17('0x1e')])[_0xff17('0x18')](','));}else{_0x244330['push'](_0x237b49[0x0]);_0x244330[_0xff17('0x1d')](_0x237b49[_0xff17('0x1f')](0x1,_0x237b49['length'])[_0xff17('0x18')](','));}break;case'dialogflow':var _0x57513e=_0x1b6ffb['appdata'][_0xff17('0x20')](',');_0x244330[_0xff17('0x1d')](_0x57513e[0x0]);_0x244330[_0xff17('0x1d')](_0x57513e[0x1]);_0x244330[_0xff17('0x1d')](_0x57513e[_0xff17('0x1f')](0x2,_0x57513e[_0xff17('0x1e')])[_0xff17('0x18')](','));break;case _0xff17('0x21'):var _0x2ce834=_0x1b6ffb[_0xff17('0x1b')]['split'](',');_0x244330[_0xff17('0x1d')](_0x2ce834[0x0]);_0x244330[_0xff17('0x1d')](_0x2ce834[0x1]);_0x244330[_0xff17('0x1d')](_0x2ce834[0x2]);_0x244330[_0xff17('0x1d')](_0x2ce834[0x3]);_0x244330[_0xff17('0x1d')](_0x2ce834[_0xff17('0x1f')](0x4,_0x2ce834[_0xff17('0x1e')])[_0xff17('0x18')](','));break;case _0xff17('0x22'):var _0x4305f2=_0x1b6ffb[_0xff17('0x1b')][_0xff17('0x20')](',');_0x244330[_0xff17('0x1d')](_0x4305f2[0x0]);_0x244330[_0xff17('0x1d')](_0x4305f2[0x1]);_0x244330[_0xff17('0x1d')](_0x4305f2[0x2]);_0x244330[_0xff17('0x1d')](_0x4305f2[0x3]);_0x244330[_0xff17('0x1d')](_0x4305f2[_0xff17('0x1f')](0x4,_0x4305f2[_0xff17('0x1e')])[_0xff17('0x18')](','));break;case'message':_0x244330[_0xff17('0x1d')](_0x1b6ffb[_0xff17('0x1b')]);break;case _0xff17('0x23'):_0x244330['push'](_0x1b6ffb['TagId']);_0x244330['push'](_0x1b6ffb['appdata']);break;case _0xff17('0x24'):var _0x266ba7=utils['getMustacheRender'](_0x5b7870[_0xff17('0x25')][_0xff17('0x26')],_0x5b7870);var _0x5e6504=_0x1b6ffb[_0xff17('0x1b')][_0xff17('0x20')](',');_0x244330[_0xff17('0x1d')](_0x5e6504[0x0]);_0x244330['push'](_0x5e6504[0x1]);_0x244330['push'](_0x5e6504[0x2]);_0x244330[_0xff17('0x1d')](_0x5e6504[0x3]);_0x244330[_0xff17('0x1d')](_0x5e6504[0x4]);_0x244330[_0xff17('0x1d')](_0x5e6504[0x5]);_0x244330[_0xff17('0x1d')](_0x5e6504[0x6]);_0x244330[_0xff17('0x1d')](_0x5e6504[0x7]);_0x244330['push'](_0x5e6504[0x8]);_0x244330['push'](_0x5e6504[0x9]);_0x244330[_0xff17('0x1d')](_0x5e6504[0xa]);_0x244330['push'](_0x5b7870[_0xff17('0x14')]['id']);_0x244330['push'](_0x5b7870[_0xff17('0x13')]['id']);_0x244330[_0xff17('0x1d')](_0x1b6ffb[_0xff17('0x27')]);_0x244330[_0xff17('0x1d')](_0x5b7870[_0xff17('0x14')][_0xff17('0x28')]);_0x244330['push'](_0x5b7870[_0xff17('0x29')][_0xff17('0x29')]);_0x244330['push'](_0x266ba7);break;default:_0x244330=_[_0xff17('0xe')](_0x1b6ffb[_0xff17('0x1b')])?[]:_0x1b6ffb[_0xff17('0x1b')][_0xff17('0x20')](',');}var _0x11a0a0={'id':util['format']('%s:%s:%s',_0x29aae9,_0x1b6ffb['id'],_0x1b6ffb['app']),'condition':require('./interval')[_0xff17('0x2a')](_0x29aae9,getIntervals(_0x4218bc[_0xff17('0x2b')],_0x1b6ffb),_0x4218bc),'consequence':require(_0xff17('0x2c')+_0x1b6ffb['app'])['consequence'](_0x29aae9,_0x244330,_0x4218bc,_0x5b7870),'p':_0x1b6ffb[_0xff17('0x2d')]||0x0};logger[_0xff17('0x2e')]('Push\x20new\x20rule',_0x11a0a0['id'],_0xff17('0x2f'),getIntervals(_0x4218bc[_0xff17('0x2b')],_0x1b6ffb)[_0xff17('0x18')](_0xff17('0x30')));_0x290c1c[_0xff17('0x1d')](_0x11a0a0);}else{logger[_0xff17('0x31')](_0xff17('0x32'),path[_0xff17('0x18')](__dirname,'applications',_0x1b6ffb[_0xff17('0x33')]+_0xff17('0x19')));}}_0x4218bc[_0xff17('0x34')][_0x29aae9]=new RuleEngine(_0x290c1c);_0x4218bc[_0xff17('0x34')][_0x29aae9][_0xff17('0x35')](_0x5b7870,function(_0x43d75f){logger[_0xff17('0x2e')]('Applications\x20executed',JSON[_0xff17('0x36')](_0x43d75f['matchPath']));if(_0x4218bc['rules'][_0x29aae9]){_0x4218bc[_0xff17('0x34')][_0x29aae9][_0xff17('0x37')](_0xff17('0x38'));}});return _0x2a6d05({'code':0xc8,'message':_0x5b7870});}else{logger[_0xff17('0x2e')](_0xff17('0x39'));return _0x2a6d05({'code':0xc8,'message':_0x5b7870});}}catch(_0x14fb76){logger['error'](_0x14fb76[_0xff17('0x3a')]);return _0x249641(_0x2f501a[_0xff17('0x31')](0x1f4,_0x14fb76));}}return _0x249641(_0xff17('0x3b'));});},'AcceptMessage':function(_0x5a8c7a){var _0x4e5461=this;return new Promise(function(_0x2bdb50,_0x27ea92){if(_0x5a8c7a[_0xff17('0x3c')]&&_0x5a8c7a[_0xff17('0x3c')]['id']){if(_0x4218bc[_0xff17('0x3d')][_0x5a8c7a[_0xff17('0x3c')]['id']]){_0x4218bc[_0xff17('0x3d')][_0x5a8c7a[_0xff17('0x3c')]['id']]['busy']=![];_0x4218bc['agents'][_0x5a8c7a[_0xff17('0x3c')]['id']][_0xff17('0x3e')]=undefined;}}if(_0x5a8c7a[_0xff17('0x13')]&&_0x5a8c7a[_0xff17('0x13')]['id']){try{var _0x757688=getId(_0x5a8c7a['channel'],_0x5a8c7a[_0xff17('0x13')]?_0x5a8c7a[_0xff17('0x13')]['id']:0x0,_0x5a8c7a[_0xff17('0x14')]?_0x5a8c7a[_0xff17('0x14')]['id']:0x0);if(_0x4218bc[_0xff17('0x34')][_0x757688]){_0x4218bc['rules'][_0x757688][_0xff17('0x37')](_0xff17('0x3f'));if(rpc[_0x5a8c7a[_0xff17('0x40')]+_0xff17('0x41')]){rpc[_0x5a8c7a['channel']+_0xff17('0x41')][_0xff17('0x42')](_0x757688,{'UserId':_0x5a8c7a[_0xff17('0x13')][_0xff17('0x43')]})['catch'](function(_0x13a237){logger[_0xff17('0x31')](_0xff17('0x44'));});}}return _0x2bdb50({'code':0xc8,'message':_0x5a8c7a});}catch(_0x4dab6d){logger[_0xff17('0x31')](_0x4dab6d['stack']);return _0x27ea92(_0x4e5461['error'](0x1f4,_0x4dab6d));}}logger[_0xff17('0x31')]('message\x20is\x20empty');return _0x27ea92(_0x4e5461[_0xff17('0x31')](0x1f4,_0xff17('0x45')));});},'RejectMessage':function(_0x1c7e63){var _0xcdc37b=this;return new Promise(function(_0x370863,_0x12b81e){if(_0x1c7e63[_0xff17('0x3c')]&&_0x1c7e63[_0xff17('0x3c')]['id']){try{if(_0x4218bc['agents'][_0x1c7e63[_0xff17('0x3c')]['id']]){_0x4218bc['agents'][_0x1c7e63[_0xff17('0x3c')]['id']]['busy']=![];_0x4218bc[_0xff17('0x3d')][_0x1c7e63[_0xff17('0x3c')]['id']][_0xff17('0x3e')]=undefined;}return _0x370863({'code':0xc8,'message':_0x1c7e63});}catch(_0x4d189a){logger[_0xff17('0x31')](_0x4d189a[_0xff17('0x3a')]);return _0x12b81e(_0xcdc37b[_0xff17('0x31')](0x1f4,_0x4d189a));}}logger[_0xff17('0x31')](_0xff17('0x45'));return _0x12b81e(_0xcdc37b['error'](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0xa2710f){var _0x463c48=this;return new Promise(function(_0x3e0657,_0x18287a){if(_0xa2710f['channel']&&_0xa2710f['interaction']&&_0xa2710f[_0xff17('0x14')]['id']){try{var _0x5b7f82=getId(_0xa2710f['channel'],_0xa2710f[_0xff17('0x13')]?_0xa2710f['message']['id']:0x0,_0xa2710f[_0xff17('0x14')]?_0xa2710f[_0xff17('0x14')]['id']:0x0);if(_0x4218bc[_0xff17('0x34')][_0x5b7f82]){_0x4218bc[_0xff17('0x34')][_0x5b7f82][_0xff17('0x37')](_0xff17('0x3f'));}return _0x3e0657({'code':0xc8,'message':_0xa2710f});}catch(_0xd071ea){logger[_0xff17('0x31')](_0xd071ea[_0xff17('0x3a')]);return _0x18287a(_0x463c48[_0xff17('0x31')](0x1f4,_0xd071ea));}}logger[_0xff17('0x31')]('message\x20is\x20empty');return _0x18287a(_0x463c48[_0xff17('0x31')](0x1f4,_0xff17('0x45')));});},'AgentCapacity':function(_0x4e3ae7){var _0xca0db2=this;return new Promise(function(_0x4945cc,_0x229651){if(_0x4218bc[_0xff17('0x3d')][_0xff17('0x46')](_0x4e3ae7['id'])){for(var _0x53d4ab in _0x4e3ae7[_0xff17('0x47')]){if(_0x4e3ae7[_0xff17('0x47')][_0xff17('0x46')](_0x53d4ab)){if(_0x4218bc[_0xff17('0x3d')][_0x4e3ae7['id']][_0xff17('0x46')](_0x53d4ab+'CurrentCapacity')){_0x4218bc[_0xff17('0x3d')][_0x4e3ae7['id']][_0x53d4ab+_0xff17('0x48')]=parseInt(_0x4e3ae7[_0xff17('0x47')][_0x53d4ab],0xa);}}}_0x4218bc[_0xff17('0x3d')][_0x4e3ae7['id']][_0xff17('0x49')]();return _0x4945cc({'code':0xc8,'message':_0x4218bc[_0xff17('0x3d')][_0x4e3ae7['id']]});}else{return _0x229651(_0xca0db2['error'](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x464d80){return new Promise(function(_0xf6a089,_0xa0f466){var _0x201ab9=_[_0xff17('0x4a')](_0x4218bc[_0xff17('0x3d')]);_0xf6a089({'count':_0x201ab9[_0xff17('0x1e')],'rows':_0x201ab9});});},'ChatQueues':function(_0x7661a6){return new Promise(function(_0x398e2c,_0x3f44b9){var _0x33ec81=[];for(var _0x77d5f4 in _0x4218bc[_0xff17('0x4b')]){if(_0x4218bc['chatQueues']['hasOwnProperty'](_0x77d5f4)){var _0x339b5a=_0x4218bc['chatQueues'][_0x77d5f4];var _0x3fc5ba={'id':_0x339b5a['id'],'available':_0x339b5a[_0xff17('0x4c')],'loggedIn':_0x339b5a[_0xff17('0x4d')],'name':_0x339b5a[_0xff17('0x4e')],'paused':_0x339b5a['paused'],'waiting':_0x339b5a['waiting']};_0x33ec81[_0xff17('0x1d')](_0x3fc5ba);}}_0x398e2c({'count':_0x33ec81[_0xff17('0x1e')],'rows':_0x33ec81});});},'MailQueues':function(_0x4e97e4){return new Promise(function(_0x1adbc5,_0x536f6b){var _0xce87e5=[];for(var _0x43059a in _0x4218bc['mailQueues']){if(_0x4218bc[_0xff17('0x4f')][_0xff17('0x46')](_0x43059a)){var _0x32fc38=_0x4218bc[_0xff17('0x4f')][_0x43059a];var _0x1884fc={'id':_0x32fc38['id'],'available':_0x32fc38['available'],'loggedIn':_0x32fc38['loggedIn'],'name':_0x32fc38['name'],'paused':_0x32fc38['paused'],'waiting':_0x32fc38[_0xff17('0x50')]};_0xce87e5['push'](_0x1884fc);}}_0x1adbc5({'count':_0xce87e5['length'],'rows':_0xce87e5});});},'OpenchannelQueues':function(_0x40d0dd){return new Promise(function(_0x567c66,_0x2d6233){var _0x27c96f=[];for(var _0x11deaa in _0x4218bc['openchannelQueues']){if(_0x4218bc[_0xff17('0x51')][_0xff17('0x46')](_0x11deaa)){var _0x35d099=_0x4218bc['openchannelQueues'][_0x11deaa];var _0xd4542={'id':_0x35d099['id'],'available':_0x35d099['available'],'loggedIn':_0x35d099[_0xff17('0x4d')],'name':_0x35d099[_0xff17('0x4e')],'paused':_0x35d099[_0xff17('0x52')],'waiting':_0x35d099[_0xff17('0x50')]};_0x27c96f[_0xff17('0x1d')](_0xd4542);}}_0x567c66({'count':_0x27c96f['length'],'rows':_0x27c96f});});},'SmsQueues':function(_0x5dc736){return new Promise(function(_0x19e9b5,_0x4733b5){var _0x43b368=[];for(var _0x3e9f6a in _0x4218bc[_0xff17('0x53')]){if(_0x4218bc[_0xff17('0x53')][_0xff17('0x46')](_0x3e9f6a)){var _0x1f2c40=_0x4218bc[_0xff17('0x53')][_0x3e9f6a];var _0x5f153c={'id':_0x1f2c40['id'],'available':_0x1f2c40['available'],'loggedIn':_0x1f2c40['loggedIn'],'name':_0x1f2c40[_0xff17('0x4e')],'paused':_0x1f2c40[_0xff17('0x52')],'waiting':_0x1f2c40[_0xff17('0x50')]};_0x43b368['push'](_0x5f153c);}}_0x19e9b5({'count':_0x43b368[_0xff17('0x1e')],'rows':_0x43b368});});},'FaxQueues':function(_0x51dcc0){return new Promise(function(_0x3cb6f5,_0x3c228f){var _0x31b943=[];for(var _0x2b0f7f in _0x4218bc[_0xff17('0x54')]){if(_0x4218bc[_0xff17('0x54')][_0xff17('0x46')](_0x2b0f7f)){var _0x3166b3=_0x4218bc['faxQueues'][_0x2b0f7f];var _0x1f8a3f={'id':_0x3166b3['id'],'available':_0x3166b3[_0xff17('0x4c')],'loggedIn':_0x3166b3['loggedIn'],'name':_0x3166b3['name'],'paused':_0x3166b3[_0xff17('0x52')],'waiting':_0x3166b3[_0xff17('0x50')]};_0x31b943['push'](_0x1f8a3f);}}_0x3cb6f5({'count':_0x31b943[_0xff17('0x1e')],'rows':_0x31b943});});},'WhatsappQueues':function(_0x136073){return new Promise(function(_0x3787e6,_0x5a6b63){var _0x484cb2=[];for(var _0x1d072b in _0x4218bc['whatsappQueues']){if(_0x4218bc[_0xff17('0x55')][_0xff17('0x46')](_0x1d072b)){var _0x5e1a43=_0x4218bc[_0xff17('0x55')][_0x1d072b];var _0x5443e3={'id':_0x5e1a43['id'],'available':_0x5e1a43[_0xff17('0x4c')],'loggedIn':_0x5e1a43['loggedIn'],'name':_0x5e1a43[_0xff17('0x4e')],'paused':_0x5e1a43[_0xff17('0x52')],'waiting':_0x5e1a43[_0xff17('0x50')]};_0x484cb2[_0xff17('0x1d')](_0x5443e3);}}_0x3787e6({'count':_0x484cb2[_0xff17('0x1e')],'rows':_0x484cb2});});},'ChatQueuesWaitingInteractions':function(_0x20952a){return new Promise(function(_0x10668b,_0x5a4c7f){var _0x1a0849=_['values'](_0x4218bc[_0xff17('0x56')]);_0x10668b({'count':_0x1a0849[_0xff17('0x1e')],'rows':_0x1a0849});});},'MailQueuesWaitingInteractions':function(_0x3d0eca){return new Promise(function(_0x2e064f,_0x3637d7){var _0x3fd7a2=_[_0xff17('0x4a')](_0x4218bc[_0xff17('0x57')]);_0x2e064f({'count':_0x3fd7a2[_0xff17('0x1e')],'rows':_0x3fd7a2});});},'OpenchannelQueuesWaitingInteractions':function(_0x596fda){return new Promise(function(_0x18add0,_0x522c9d){var _0x5a2b26=_[_0xff17('0x4a')](_0x4218bc[_0xff17('0x58')]);_0x18add0({'count':_0x5a2b26[_0xff17('0x1e')],'rows':_0x5a2b26});});},'SmsQueuesWaitingInteractions':function(_0x2c0f5f){return new Promise(function(_0x3d91f9,_0x8b93ac){var _0x3f9e3b=_['values'](_0x4218bc[_0xff17('0x59')]);_0x3d91f9({'count':_0x3f9e3b['length'],'rows':_0x3f9e3b});});},'FaxQueuesWaitingInteractions':function(_0x152422){return new Promise(function(_0x151757,_0x227960){var _0x50dab5=_[_0xff17('0x4a')](_0x4218bc[_0xff17('0x5a')]);_0x151757({'count':_0x50dab5[_0xff17('0x1e')],'rows':_0x50dab5});});},'WhatsappQueuesWaitingInteractions':function(_0x4c5556){return new Promise(function(_0x17333a,_0x35ac6b){var _0x425aae=_[_0xff17('0x4a')](_0x4218bc[_0xff17('0x5b')]);_0x17333a({'count':_0x425aae['length'],'rows':_0x425aae});});}};var _0x33ab8e=jayson['server'](_0x2f97b1)[_0xff17('0x5c')]();_0x33ab8e['on'](_0xff17('0x31'),function(_0xc3ae71){logger[_0xff17('0x31')](JSON[_0xff17('0x36')](_0xc3ae71));return _0x53f625(_0xc3ae71);});_0x33ab8e[_0xff17('0x12')](0x232c,_0xff17('0x5d'),function(){console[_0xff17('0x5e')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x5721de(_0xff17('0x5f')+0x232c);});});}; \ No newline at end of file +var _0xcf14=['amazonlex','tag','TagId','tvox','getMustacheRender','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','info','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','busy','agents','busyQueue','end','QueueReport','UserId','catch','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','chatQueues','available','loggedIn','paused','waiting','mailQueues','name','openchannelQueues','smsQueues','faxQueues','whatsappQueues','values','chatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','lodash','path','jayson/promise','uuid','./applications/utils','../../../config/environment','../../../config/logger','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','interval','listen','rules','channel','message','interaction','isArray','applications','length','existsSync','join','app','toLowerCase','autoreply','appdata','push','slice','dialogflow','split','dialogflowv2'];(function(_0x5107ef,_0x129c89){var _0xfd9b01=function(_0x3d1e7e){while(--_0x3d1e7e){_0x5107ef['push'](_0x5107ef['shift']());}};_0xfd9b01(++_0x129c89);}(_0xcf14,0xa1));var _0x4cf1=function(_0xd949d8,_0x15e451){_0xd949d8=_0xd949d8-0x0;var _0x28bf15=_0xcf14[_0xd949d8];return _0x28bf15;};'use strict';var _=require(_0x4cf1('0x0'));var util=require('util');var path=require(_0x4cf1('0x1'));var fs=require('fs');var jayson=require(_0x4cf1('0x2'));var BPromise=require('bluebird');var uuid=require(_0x4cf1('0x3'));var utils=require(_0x4cf1('0x4'));var config=require(_0x4cf1('0x5'));var logger=require(_0x4cf1('0x6'))('routing');var rpc={'openchannelQueueReport':require(_0x4cf1('0x7')),'mailQueueReport':require(_0x4cf1('0x8')),'chatQueueReport':require(_0x4cf1('0x9')),'smsQueueReport':require(_0x4cf1('0xa')),'faxQueueReport':require(_0x4cf1('0xb')),'whatsappQueueReport':require(_0x4cf1('0xc'))};var RuleEngine=require(_0x4cf1('0xd'));function getId(_0x50273f,_0x4094d4,_0x208cdd){return util[_0x4cf1('0xe')](_0x4cf1('0xf'),_0x50273f,_0x4094d4||0x0,_0x208cdd||0x0);}function getIntervals(_0x2736c7,_0x3722fa){var _0x207aea=[];if(!_[_0x4cf1('0x10')](_0x3722fa[_0x4cf1('0x11')])&&!_[_0x4cf1('0x10')](_0x2736c7[_0x3722fa[_0x4cf1('0x11')]])&&!_[_0x4cf1('0x10')](_0x2736c7[_0x3722fa[_0x4cf1('0x11')]][_0x4cf1('0x12')])){_0x207aea=_['map'](_0x2736c7[_0x3722fa[_0x4cf1('0x11')]][_0x4cf1('0x12')],_0x4cf1('0x13'));}else if(!_[_0x4cf1('0x10')](_0x3722fa[_0x4cf1('0x13')])){_0x207aea=[_0x3722fa[_0x4cf1('0x13')]];}return _0x207aea;}exports[_0x4cf1('0x14')]=function(_0x3f365c){_0x3f365c[_0x4cf1('0x15')]={};return new BPromise(function(_0x6c10f9,_0x3e320f){var _0xec2510={'Start':function(_0xcfa115){var _0x2a8cf7=this;return new Promise(function(_0xe257a5,_0x4fa520){if(_0xcfa115){try{var _0x3e3cd8=[];var _0x527dca=getId(_0xcfa115[_0x4cf1('0x16')],_0xcfa115[_0x4cf1('0x17')]?_0xcfa115[_0x4cf1('0x17')]['id']:0x0,_0xcfa115[_0x4cf1('0x18')]?_0xcfa115[_0x4cf1('0x18')]['id']:0x0);if(_0xcfa115['applications']&&_[_0x4cf1('0x19')](_0xcfa115[_0x4cf1('0x1a')])&&_0xcfa115[_0x4cf1('0x1a')][_0x4cf1('0x1b')]){for(var _0x52b5a2=0x0;_0x52b5a2<_0xcfa115['applications'][_0x4cf1('0x1b')];_0x52b5a2+=0x1){var _0x83ad6a=_0xcfa115['applications'][_0x52b5a2];if(fs[_0x4cf1('0x1c')](path[_0x4cf1('0x1d')](__dirname,_0x4cf1('0x1a'),_0x83ad6a[_0x4cf1('0x1e')]+'.js'))){var _0x3469ac=[];switch(_0x83ad6a[_0x4cf1('0x1e')][_0x4cf1('0x1f')]()){case _0x4cf1('0x20'):var _0x21eb0c=_0x83ad6a[_0x4cf1('0x21')]['split'](',');if(_0xcfa115[_0x4cf1('0x16')]==='mail'){_0x3469ac[_0x4cf1('0x22')](_0x21eb0c[0x0]);_0x3469ac[_0x4cf1('0x22')](_0x21eb0c[0x1]);_0x3469ac[_0x4cf1('0x22')](_0x21eb0c[_0x4cf1('0x23')](0x2,_0x21eb0c[_0x4cf1('0x1b')])[_0x4cf1('0x1d')](','));}else{_0x3469ac[_0x4cf1('0x22')](_0x21eb0c[0x0]);_0x3469ac[_0x4cf1('0x22')](_0x21eb0c[_0x4cf1('0x23')](0x1,_0x21eb0c[_0x4cf1('0x1b')])[_0x4cf1('0x1d')](','));}break;case _0x4cf1('0x24'):var _0x2a17ce=_0x83ad6a['appdata'][_0x4cf1('0x25')](',');_0x3469ac[_0x4cf1('0x22')](_0x2a17ce[0x0]);_0x3469ac[_0x4cf1('0x22')](_0x2a17ce[0x1]);_0x3469ac[_0x4cf1('0x22')](_0x2a17ce[_0x4cf1('0x23')](0x2,_0x2a17ce[_0x4cf1('0x1b')])[_0x4cf1('0x1d')](','));break;case _0x4cf1('0x26'):var _0x2c0803=_0x83ad6a[_0x4cf1('0x21')][_0x4cf1('0x25')](',');_0x3469ac['push'](_0x2c0803[0x0]);_0x3469ac[_0x4cf1('0x22')](_0x2c0803[0x1]);_0x3469ac[_0x4cf1('0x22')](_0x2c0803[0x2]);_0x3469ac['push'](_0x2c0803[0x3]);_0x3469ac[_0x4cf1('0x22')](_0x2c0803[_0x4cf1('0x23')](0x4,_0x2c0803[_0x4cf1('0x1b')])[_0x4cf1('0x1d')](','));break;case _0x4cf1('0x27'):var _0x2f4b60=_0x83ad6a['appdata'][_0x4cf1('0x25')](',');_0x3469ac['push'](_0x2f4b60[0x0]);_0x3469ac[_0x4cf1('0x22')](_0x2f4b60[0x1]);_0x3469ac[_0x4cf1('0x22')](_0x2f4b60[0x2]);_0x3469ac[_0x4cf1('0x22')](_0x2f4b60[0x3]);_0x3469ac[_0x4cf1('0x22')](_0x2f4b60[_0x4cf1('0x23')](0x4,_0x2f4b60['length'])[_0x4cf1('0x1d')](','));break;case'message':_0x3469ac['push'](_0x83ad6a['appdata']);break;case _0x4cf1('0x28'):_0x3469ac[_0x4cf1('0x22')](_0x83ad6a[_0x4cf1('0x29')]);_0x3469ac[_0x4cf1('0x22')](_0x83ad6a[_0x4cf1('0x21')]);break;case _0x4cf1('0x2a'):var _0x37f6a2=utils[_0x4cf1('0x2b')](_0xcfa115['account']['notificationTemplate'],_0xcfa115);var _0x48d93a=_0x83ad6a[_0x4cf1('0x21')][_0x4cf1('0x25')](',');_0x3469ac[_0x4cf1('0x22')](_0x48d93a[0x0]);_0x3469ac[_0x4cf1('0x22')](_0x48d93a[0x1]);_0x3469ac[_0x4cf1('0x22')](_0x48d93a[0x2]);_0x3469ac[_0x4cf1('0x22')](_0x48d93a[0x3]);_0x3469ac[_0x4cf1('0x22')](_0x48d93a[0x4]);_0x3469ac[_0x4cf1('0x22')](_0x48d93a[0x5]);_0x3469ac[_0x4cf1('0x22')](_0x48d93a[0x6]);_0x3469ac[_0x4cf1('0x22')](_0x48d93a[0x7]);_0x3469ac[_0x4cf1('0x22')](_0x48d93a[0x8]);_0x3469ac[_0x4cf1('0x22')](_0x48d93a[0x9]);_0x3469ac[_0x4cf1('0x22')](_0x48d93a[0xa]);_0x3469ac['push'](_0xcfa115['interaction']['id']);_0x3469ac[_0x4cf1('0x22')](_0xcfa115[_0x4cf1('0x17')]['id']);_0x3469ac[_0x4cf1('0x22')](_0x83ad6a[_0x4cf1('0x2c')]);_0x3469ac[_0x4cf1('0x22')](_0xcfa115[_0x4cf1('0x18')][_0x4cf1('0x2d')]);_0x3469ac['push'](_0xcfa115[_0x4cf1('0x2e')][_0x4cf1('0x2e')]);_0x3469ac[_0x4cf1('0x22')](_0x37f6a2);break;default:_0x3469ac=_[_0x4cf1('0x10')](_0x83ad6a[_0x4cf1('0x21')])?[]:_0x83ad6a[_0x4cf1('0x21')]['split'](',');}var _0x5348f5={'id':util[_0x4cf1('0xe')](_0x4cf1('0x2f'),_0x527dca,_0x83ad6a['id'],_0x83ad6a[_0x4cf1('0x1e')]),'condition':require(_0x4cf1('0x30'))[_0x4cf1('0x31')](_0x527dca,getIntervals(_0x3f365c[_0x4cf1('0x32')],_0x83ad6a),_0x3f365c),'consequence':require(_0x4cf1('0x33')+_0x83ad6a[_0x4cf1('0x1e')])[_0x4cf1('0x34')](_0x527dca,_0x3469ac,_0x3f365c,_0xcfa115),'p':_0x83ad6a[_0x4cf1('0x35')]||0x0};logger[_0x4cf1('0x36')]('Push\x20new\x20rule',_0x5348f5['id'],_0x4cf1('0x37'),getIntervals(_0x3f365c[_0x4cf1('0x32')],_0x83ad6a)['join'](_0x4cf1('0x38')));_0x3e3cd8[_0x4cf1('0x22')](_0x5348f5);}else{logger[_0x4cf1('0x39')](_0x4cf1('0x3a'),path[_0x4cf1('0x1d')](__dirname,'applications',_0x83ad6a[_0x4cf1('0x1e')]+'.js'));}}_0x3f365c['rules'][_0x527dca]=new RuleEngine(_0x3e3cd8);_0x3f365c[_0x4cf1('0x15')][_0x527dca][_0x4cf1('0x3b')](_0xcfa115,function(_0x17f59e){logger[_0x4cf1('0x36')](_0x4cf1('0x3c'),JSON[_0x4cf1('0x3d')](_0x17f59e[_0x4cf1('0x3e')]));if(_0x3f365c[_0x4cf1('0x15')][_0x527dca]){_0x3f365c[_0x4cf1('0x15')][_0x527dca][_0x4cf1('0x3f')](_0x4cf1('0x40'));}});return _0xe257a5({'code':0xc8,'message':_0xcfa115});}else{logger[_0x4cf1('0x36')](_0x4cf1('0x41'));return _0xe257a5({'code':0xc8,'message':_0xcfa115});}}catch(_0x2133fe){logger[_0x4cf1('0x39')](_0x2133fe[_0x4cf1('0x42')]);return _0x4fa520(_0x2a8cf7['error'](0x1f4,_0x2133fe));}}return _0x4fa520(_0x4cf1('0x43'));});},'AcceptMessage':function(_0x2aa51e){var _0x1dbabe=this;return new Promise(function(_0x1ecde5,_0x38d584){if(_0x2aa51e[_0x4cf1('0x44')]&&_0x2aa51e[_0x4cf1('0x44')]['id']){if(_0x3f365c['agents'][_0x2aa51e[_0x4cf1('0x44')]['id']]){_0x3f365c['agents'][_0x2aa51e[_0x4cf1('0x44')]['id']][_0x4cf1('0x45')]=![];_0x3f365c[_0x4cf1('0x46')][_0x2aa51e[_0x4cf1('0x44')]['id']][_0x4cf1('0x47')]=undefined;}}if(_0x2aa51e[_0x4cf1('0x17')]&&_0x2aa51e['message']['id']){try{var _0x4fb90b=getId(_0x2aa51e['channel'],_0x2aa51e[_0x4cf1('0x17')]?_0x2aa51e[_0x4cf1('0x17')]['id']:0x0,_0x2aa51e[_0x4cf1('0x18')]?_0x2aa51e['interaction']['id']:0x0);if(_0x3f365c[_0x4cf1('0x15')][_0x4fb90b]){_0x3f365c[_0x4cf1('0x15')][_0x4fb90b]['emit'](_0x4cf1('0x48'));if(rpc[_0x2aa51e[_0x4cf1('0x16')]+_0x4cf1('0x49')]){rpc[_0x2aa51e[_0x4cf1('0x16')]+_0x4cf1('0x49')]['update'](_0x4fb90b,{'UserId':_0x2aa51e[_0x4cf1('0x17')][_0x4cf1('0x4a')]})[_0x4cf1('0x4b')](function(_0x77418c){logger[_0x4cf1('0x39')]('error\x20update\x20queue\x20report');});}}return _0x1ecde5({'code':0xc8,'message':_0x2aa51e});}catch(_0x3a4723){logger[_0x4cf1('0x39')](_0x3a4723['stack']);return _0x38d584(_0x1dbabe['error'](0x1f4,_0x3a4723));}}logger['error'](_0x4cf1('0x4c'));return _0x38d584(_0x1dbabe[_0x4cf1('0x39')](0x1f4,_0x4cf1('0x4c')));});},'RejectMessage':function(_0x5c26ba){var _0x35049a=this;return new Promise(function(_0x31e3db,_0x296065){if(_0x5c26ba['agent']&&_0x5c26ba[_0x4cf1('0x44')]['id']){try{if(_0x3f365c[_0x4cf1('0x46')][_0x5c26ba[_0x4cf1('0x44')]['id']]){_0x3f365c[_0x4cf1('0x46')][_0x5c26ba['agent']['id']][_0x4cf1('0x45')]=![];_0x3f365c[_0x4cf1('0x46')][_0x5c26ba['agent']['id']][_0x4cf1('0x47')]=undefined;}return _0x31e3db({'code':0xc8,'message':_0x5c26ba});}catch(_0x3e3218){logger[_0x4cf1('0x39')](_0x3e3218['stack']);return _0x296065(_0x35049a[_0x4cf1('0x39')](0x1f4,_0x3e3218));}}logger[_0x4cf1('0x39')](_0x4cf1('0x4c'));return _0x296065(_0x35049a[_0x4cf1('0x39')](0x1f4,_0x4cf1('0x4c')));});},'AbandonInteraction':function(_0x2e93cc){var _0x2d161f=this;return new Promise(function(_0x574411,_0x5bc4c9){if(_0x2e93cc[_0x4cf1('0x16')]&&_0x2e93cc['interaction']&&_0x2e93cc[_0x4cf1('0x18')]['id']){try{var _0x39b15a=getId(_0x2e93cc[_0x4cf1('0x16')],_0x2e93cc[_0x4cf1('0x17')]?_0x2e93cc[_0x4cf1('0x17')]['id']:0x0,_0x2e93cc[_0x4cf1('0x18')]?_0x2e93cc[_0x4cf1('0x18')]['id']:0x0);if(_0x3f365c['rules'][_0x39b15a]){_0x3f365c[_0x4cf1('0x15')][_0x39b15a][_0x4cf1('0x3f')]('end');}return _0x574411({'code':0xc8,'message':_0x2e93cc});}catch(_0x38aa06){logger[_0x4cf1('0x39')](_0x38aa06[_0x4cf1('0x42')]);return _0x5bc4c9(_0x2d161f['error'](0x1f4,_0x38aa06));}}logger[_0x4cf1('0x39')](_0x4cf1('0x4c'));return _0x5bc4c9(_0x2d161f[_0x4cf1('0x39')](0x1f4,_0x4cf1('0x4c')));});},'AgentCapacity':function(_0x4a31cd){var _0x4900a6=this;return new Promise(function(_0x3fe67f,_0x304ca7){if(_0x3f365c['agents'][_0x4cf1('0x4d')](_0x4a31cd['id'])){for(var _0xf04cd1 in _0x4a31cd[_0x4cf1('0x4e')]){if(_0x4a31cd['capacity'][_0x4cf1('0x4d')](_0xf04cd1)){if(_0x3f365c[_0x4cf1('0x46')][_0x4a31cd['id']][_0x4cf1('0x4d')](_0xf04cd1+'CurrentCapacity')){_0x3f365c[_0x4cf1('0x46')][_0x4a31cd['id']][_0xf04cd1+_0x4cf1('0x4f')]=parseInt(_0x4a31cd[_0x4cf1('0x4e')][_0xf04cd1],0xa);}}}_0x3f365c[_0x4cf1('0x46')][_0x4a31cd['id']]['updateRealtime']();return _0x3fe67f({'code':0xc8,'message':_0x3f365c[_0x4cf1('0x46')][_0x4a31cd['id']]});}else{return _0x304ca7(_0x4900a6['error'](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0xc97376){return new Promise(function(_0x32a71a,_0x18cc9f){var _0x1bf6a9=_['values'](_0x3f365c[_0x4cf1('0x46')]);_0x32a71a({'count':_0x1bf6a9[_0x4cf1('0x1b')],'rows':_0x1bf6a9});});},'ChatQueues':function(_0x35001f){return new Promise(function(_0x4ca89f,_0x5ce4da){var _0x7feee=[];for(var _0x3cbab0 in _0x3f365c['chatQueues']){if(_0x3f365c[_0x4cf1('0x50')]['hasOwnProperty'](_0x3cbab0)){var _0x2f8d03=_0x3f365c[_0x4cf1('0x50')][_0x3cbab0];var _0x5138b4={'id':_0x2f8d03['id'],'available':_0x2f8d03[_0x4cf1('0x51')],'loggedIn':_0x2f8d03[_0x4cf1('0x52')],'name':_0x2f8d03['name'],'paused':_0x2f8d03[_0x4cf1('0x53')],'waiting':_0x2f8d03[_0x4cf1('0x54')]};_0x7feee[_0x4cf1('0x22')](_0x5138b4);}}_0x4ca89f({'count':_0x7feee[_0x4cf1('0x1b')],'rows':_0x7feee});});},'MailQueues':function(_0x332886){return new Promise(function(_0x5cebfc,_0x3989ff){var _0x4d2977=[];for(var _0x49603d in _0x3f365c[_0x4cf1('0x55')]){if(_0x3f365c[_0x4cf1('0x55')][_0x4cf1('0x4d')](_0x49603d)){var _0x531898=_0x3f365c[_0x4cf1('0x55')][_0x49603d];var _0x427da1={'id':_0x531898['id'],'available':_0x531898[_0x4cf1('0x51')],'loggedIn':_0x531898[_0x4cf1('0x52')],'name':_0x531898[_0x4cf1('0x56')],'paused':_0x531898[_0x4cf1('0x53')],'waiting':_0x531898[_0x4cf1('0x54')]};_0x4d2977['push'](_0x427da1);}}_0x5cebfc({'count':_0x4d2977[_0x4cf1('0x1b')],'rows':_0x4d2977});});},'OpenchannelQueues':function(_0x1f840b){return new Promise(function(_0x38ab3a,_0x5b19ec){var _0x1e831f=[];for(var _0x40bee0 in _0x3f365c[_0x4cf1('0x57')]){if(_0x3f365c[_0x4cf1('0x57')]['hasOwnProperty'](_0x40bee0)){var _0x3d3c4f=_0x3f365c[_0x4cf1('0x57')][_0x40bee0];var _0x4b0304={'id':_0x3d3c4f['id'],'available':_0x3d3c4f['available'],'loggedIn':_0x3d3c4f['loggedIn'],'name':_0x3d3c4f[_0x4cf1('0x56')],'paused':_0x3d3c4f[_0x4cf1('0x53')],'waiting':_0x3d3c4f[_0x4cf1('0x54')]};_0x1e831f['push'](_0x4b0304);}}_0x38ab3a({'count':_0x1e831f['length'],'rows':_0x1e831f});});},'SmsQueues':function(_0x4dff1c){return new Promise(function(_0x387781,_0x2cee5f){var _0xcfa9b8=[];for(var _0x21a26b in _0x3f365c[_0x4cf1('0x58')]){if(_0x3f365c[_0x4cf1('0x58')]['hasOwnProperty'](_0x21a26b)){var _0x123d5a=_0x3f365c['smsQueues'][_0x21a26b];var _0x4987e2={'id':_0x123d5a['id'],'available':_0x123d5a[_0x4cf1('0x51')],'loggedIn':_0x123d5a[_0x4cf1('0x52')],'name':_0x123d5a[_0x4cf1('0x56')],'paused':_0x123d5a[_0x4cf1('0x53')],'waiting':_0x123d5a['waiting']};_0xcfa9b8['push'](_0x4987e2);}}_0x387781({'count':_0xcfa9b8['length'],'rows':_0xcfa9b8});});},'FaxQueues':function(_0x5df18e){return new Promise(function(_0xcf5d72,_0x3e816d){var _0x472086=[];for(var _0x38f101 in _0x3f365c['faxQueues']){if(_0x3f365c[_0x4cf1('0x59')][_0x4cf1('0x4d')](_0x38f101)){var _0x4ac9b6=_0x3f365c['faxQueues'][_0x38f101];var _0x31345a={'id':_0x4ac9b6['id'],'available':_0x4ac9b6[_0x4cf1('0x51')],'loggedIn':_0x4ac9b6[_0x4cf1('0x52')],'name':_0x4ac9b6[_0x4cf1('0x56')],'paused':_0x4ac9b6[_0x4cf1('0x53')],'waiting':_0x4ac9b6[_0x4cf1('0x54')]};_0x472086[_0x4cf1('0x22')](_0x31345a);}}_0xcf5d72({'count':_0x472086['length'],'rows':_0x472086});});},'WhatsappQueues':function(_0x5323c4){return new Promise(function(_0x3689cc,_0x3a0ed6){var _0x3e4a03=[];for(var _0x19be88 in _0x3f365c[_0x4cf1('0x5a')]){if(_0x3f365c['whatsappQueues'][_0x4cf1('0x4d')](_0x19be88)){var _0x233293=_0x3f365c['whatsappQueues'][_0x19be88];var _0x2f58d4={'id':_0x233293['id'],'available':_0x233293[_0x4cf1('0x51')],'loggedIn':_0x233293[_0x4cf1('0x52')],'name':_0x233293[_0x4cf1('0x56')],'paused':_0x233293['paused'],'waiting':_0x233293[_0x4cf1('0x54')]};_0x3e4a03[_0x4cf1('0x22')](_0x2f58d4);}}_0x3689cc({'count':_0x3e4a03[_0x4cf1('0x1b')],'rows':_0x3e4a03});});},'ChatQueuesWaitingInteractions':function(_0x276913){return new Promise(function(_0x830af9,_0x52cb5c){var _0x2ed0e5=_[_0x4cf1('0x5b')](_0x3f365c[_0x4cf1('0x5c')]);_0x830af9({'count':_0x2ed0e5[_0x4cf1('0x1b')],'rows':_0x2ed0e5});});},'MailQueuesWaitingInteractions':function(_0x13d24a){return new Promise(function(_0x21c13d,_0x2587f5){var _0x2a93d6=_['values'](_0x3f365c['mailQueuesWaitingInteractions']);_0x21c13d({'count':_0x2a93d6[_0x4cf1('0x1b')],'rows':_0x2a93d6});});},'OpenchannelQueuesWaitingInteractions':function(_0x5076e8){return new Promise(function(_0x1fce14,_0x278d2f){var _0x4d1ce3=_[_0x4cf1('0x5b')](_0x3f365c[_0x4cf1('0x5d')]);_0x1fce14({'count':_0x4d1ce3[_0x4cf1('0x1b')],'rows':_0x4d1ce3});});},'SmsQueuesWaitingInteractions':function(_0x250d1e){return new Promise(function(_0x5b6053,_0x171faf){var _0x3d8a82=_['values'](_0x3f365c[_0x4cf1('0x5e')]);_0x5b6053({'count':_0x3d8a82['length'],'rows':_0x3d8a82});});},'FaxQueuesWaitingInteractions':function(_0x24bfbe){return new Promise(function(_0x312dc2,_0x593074){var _0x33a0d4=_[_0x4cf1('0x5b')](_0x3f365c[_0x4cf1('0x5f')]);_0x312dc2({'count':_0x33a0d4['length'],'rows':_0x33a0d4});});},'WhatsappQueuesWaitingInteractions':function(_0x5922b3){return new Promise(function(_0x20d6c2,_0x3d68b7){var _0x5a5327=_[_0x4cf1('0x5b')](_0x3f365c[_0x4cf1('0x60')]);_0x20d6c2({'count':_0x5a5327[_0x4cf1('0x1b')],'rows':_0x5a5327});});}};var _0x12d7b1=jayson[_0x4cf1('0x61')](_0xec2510)[_0x4cf1('0x62')]();_0x12d7b1['on'](_0x4cf1('0x39'),function(_0x24b665){logger[_0x4cf1('0x39')](JSON[_0x4cf1('0x3d')](_0x24b665));return _0x3e320f(_0x24b665);});_0x12d7b1[_0x4cf1('0x14')](0x232c,_0x4cf1('0x63'),function(){console['log']('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x6c10f9('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index e9d1afa..cf3f0be 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 _0x3fec=['result','catch','condition','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','length','push','format','indexOf','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','log','join','stack','util','bluebird','jayson/promise','lodash','routing','http','then','error','message'];(function(_0x546c97,_0x26e00f){var _0x151b4c=function(_0x11050a){while(--_0x11050a){_0x546c97['push'](_0x546c97['shift']());}};_0x151b4c(++_0x26e00f);}(_0x3fec,0x163));var _0xc3fe=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3fec[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0xc3fe('0x0'));var BPromise=require(_0xc3fe('0x1'));var jayson=require(_0xc3fe('0x2'));var _=require(_0xc3fe('0x3'));var logger=require('../../../config/logger')(_0xc3fe('0x4'));var client=jayson['client'][_0xc3fe('0x5')]({'port':0x232a});function request(_0x44cdf2,_0x370f9d){return new BPromise(function(_0x5d4ee5,_0x2ba9e9){return client['request'](_0x44cdf2,_0x370f9d)[_0xc3fe('0x6')](function(_0xe33d9b){if(_0xe33d9b[_0xc3fe('0x7')]){return _0x2ba9e9(_0xe33d9b[_0xc3fe('0x7')][_0xc3fe('0x8')]);}else{return _0x5d4ee5(_0xe33d9b[_0xc3fe('0x9')]);}})[_0xc3fe('0xa')](function(_0x83a0ff){return _0x2ba9e9(_0x83a0ff);});});}exports[_0xc3fe('0xb')]=function(_0x3e317b,_0x161b90,_0x3e5482){return function(_0xbbf8dc){if(_0x3e5482['rules']&&!_0x3e5482[_0xc3fe('0xc')][_0x3e317b]){logger['info'](_0xc3fe('0xd'),_0x3e317b);return _0xbbf8dc['stop']();}var _0x31065f=[];for(var _0x381f70=0x0;_0x381f70<_0x161b90[_0xc3fe('0xe')];_0x381f70+=0x1){_0x31065f[_0xc3fe('0xf')](request('Command',{'command':util[_0xc3fe('0x10')]('iftime\x20%s',_0x161b90[_0x381f70])})[_0xc3fe('0x6')](function(_0x10eb5f){return _0x10eb5f&&_0x10eb5f[_0xc3fe('0x8')]&&_0x10eb5f['message'][_0xc3fe('0x11')]('true')>=0x0?!![]:![];})[_0xc3fe('0xa')](function(_0x13e3d0){logger[_0xc3fe('0x7')](_0xc3fe('0x12'),_0x3e317b,_0x161b90[_0x381f70]);}));}BPromise[_0xc3fe('0x13')](_0x31065f)[_0xc3fe('0x6')](function(_0x358a6b){var _0x55142e=_[_0xc3fe('0x14')](_0x358a6b);logger['info'](_0xc3fe('0x15'),_0x3e317b,_0x161b90['join'](_0xc3fe('0x16')),_0x55142e);_0xbbf8dc['when'](_0x55142e);})[_0xc3fe('0xa')](function(_0x3454bc){console[_0xc3fe('0x17')](_0x3454bc);logger[_0xc3fe('0x7')](_0xc3fe('0x15'),_0x3e317b,_0x161b90[_0xc3fe('0x18')](_0xc3fe('0x16')),_0x3454bc[_0xc3fe('0x19')]);_0xbbf8dc['stop']();});};}; \ No newline at end of file +var _0xcd9e=['indexOf','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','log','stack','util','bluebird','lodash','../../../config/logger','client','http','request','then','error','message','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','iftime\x20%s'];(function(_0x115850,_0x4bb634){var _0xbad084=function(_0xa14074){while(--_0xa14074){_0x115850['push'](_0x115850['shift']());}};_0xbad084(++_0x4bb634);}(_0xcd9e,0xe3));var _0xecd9=function(_0x42ea1a,_0x32a3f0){_0x42ea1a=_0x42ea1a-0x0;var _0x44b998=_0xcd9e[_0x42ea1a];return _0x44b998;};'use strict';var util=require(_0xecd9('0x0'));var BPromise=require(_0xecd9('0x1'));var jayson=require('jayson/promise');var _=require(_0xecd9('0x2'));var logger=require(_0xecd9('0x3'))('routing');var client=jayson[_0xecd9('0x4')][_0xecd9('0x5')]({'port':0x232a});function request(_0x41143f,_0x2a3d1b){return new BPromise(function(_0xa53dfb,_0x769751){return client[_0xecd9('0x6')](_0x41143f,_0x2a3d1b)[_0xecd9('0x7')](function(_0x4156a4){if(_0x4156a4[_0xecd9('0x8')]){return _0x769751(_0x4156a4[_0xecd9('0x8')][_0xecd9('0x9')]);}else{return _0xa53dfb(_0x4156a4['result']);}})[_0xecd9('0xa')](function(_0x333c4c){return _0x769751(_0x333c4c);});});}exports[_0xecd9('0xb')]=function(_0x19eacf,_0x3d6690,_0x25c86e){return function(_0x556aaf){if(_0x25c86e[_0xecd9('0xc')]&&!_0x25c86e[_0xecd9('0xc')][_0x19eacf]){logger[_0xecd9('0xd')](_0xecd9('0xe'),_0x19eacf);return _0x556aaf[_0xecd9('0xf')]();}var _0x26b441=[];for(var _0x51422f=0x0;_0x51422f<_0x3d6690[_0xecd9('0x10')];_0x51422f+=0x1){_0x26b441[_0xecd9('0x11')](request(_0xecd9('0x12'),{'command':util[_0xecd9('0x13')](_0xecd9('0x14'),_0x3d6690[_0x51422f])})['then'](function(_0x458647){return _0x458647&&_0x458647['message']&&_0x458647['message'][_0xecd9('0x15')](_0xecd9('0x16'))>=0x0?!![]:![];})[_0xecd9('0xa')](function(_0x380861){logger['error'](_0xecd9('0x17'),_0x19eacf,_0x3d6690[_0x51422f]);}));}BPromise[_0xecd9('0x18')](_0x26b441)[_0xecd9('0x7')](function(_0x54535e){var _0x775c84=_[_0xecd9('0x19')](_0x54535e);logger[_0xecd9('0xd')](_0xecd9('0x1a'),_0x19eacf,_0x3d6690[_0xecd9('0x1b')](_0xecd9('0x1c')),_0x775c84);_0x556aaf['when'](_0x775c84);})[_0xecd9('0xa')](function(_0x24623c){console[_0xecd9('0x1d')](_0x24623c);logger[_0xecd9('0x8')](_0xecd9('0x1a'),_0x19eacf,_0x3d6690[_0xecd9('0x1b')]('\x20|\x20'),_0x24623c[_0xecd9('0x1e')]);_0x556aaf[_0xecd9('0xf')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 953baca..8337891 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 _0xbee3=['answeredelsewheremembername','[%s][agents][agentconnect]','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diffTime','complete','blindtransfer','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfer','extension','transferuniqueid','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','ATTENDED','transferexten','transfereeuniqueid','agententerreason','clone','calleridnum','secondtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfererexten','transfertargetuniqueid','calleridname','agentconnectAt','hangup','[%s][agents][hangup]','timeout','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agentcompleteAt','agent','util','info','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','membername','interface','connectedlinenum','lastevent','queue','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','format','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswer','agentringnoanswerAt','now','reason','holdtime','ringtime','talktime','push','queuecallerabandon','forIn','includes','abandoned','[%s][agents][queuecallerabandon]','agentconnect','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connectedlinename','answered_elsewhere','answeredelsewheredestinationuniqueid'];(function(_0x1e9161,_0x79aef0){var _0x24c7ec=function(_0x2b5a43){while(--_0x2b5a43){_0x1e9161['push'](_0x1e9161['shift']());}};_0x24c7ec(++_0x79aef0);}(_0xbee3,0xd5));var _0x3bee=function(_0x308375,_0x3a93cc){_0x308375=_0x308375-0x0;var _0x18d40c=_0xbee3[_0x308375];return _0x18d40c;};'use strict';var _=require('lodash');var util=require(_0x3bee('0x0'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x56a879,_0x45a1bf){utils[_0x3bee('0x1')](util['format'](_0x3bee('0x2'),_0x56a879[_0x3bee('0x3')],_0x56a879[_0x3bee('0x4')],_0x56a879['queue'],_0x56a879[_0x3bee('0x5')],_0x56a879[_0x3bee('0x6')],_0x56a879['calleridnum'],_0x56a879[_0x3bee('0x7')],_0x56a879[_0x3bee('0x8')]));if(_0x56a879[_0x3bee('0x9')]){utils[_0x3bee('0xa')](_0x56a879[_0x3bee('0x9')])[_0x3bee('0xb')](function(_0x3485b8){if(_0x3485b8){_0x56a879['type']=_0x3485b8[_0x3bee('0xc')];_0x56a879[_0x3bee('0xd')]=_0x56a879[_0x3bee('0xe')]?_0x3485b8[_0x3bee('0xf')]:![];_0x56a879[_0x3bee('0x10')]=_0x56a879[_0x3bee('0xd')]?_0x3485b8['acwTimeout']:0x0;}utils[_0x3bee('0x11')]('CreateVoiceAgentReport',_0x56a879);});}else{utils[_0x3bee('0x11')](_0x3bee('0x12'),_0x56a879);}if(_0x45a1bf){delete transfers[_0x56a879[_0x3bee('0x3')]];}else{delete agents[_0x56a879[_0x3bee('0x13')]];}}exports[_0x3bee('0x14')]=function(_0x459129){try{utils[_0x3bee('0x15')](util['format'](_0x3bee('0x16'),_0x459129[_0x3bee('0x3')]),_0x459129);agents[_0x459129[_0x3bee('0x13')]]=_0x459129;agents[_0x459129[_0x3bee('0x13')]][_0x3bee('0x17')]=utils['now']();agents[_0x459129['destuniqueid']][_0x3bee('0x8')]='called';agents[_0x459129[_0x3bee('0x13')]][_0x3bee('0x7')]=null;agents[_0x459129['destuniqueid']]['connectedlinename']=null;utils[_0x3bee('0x1')](util[_0x3bee('0x18')](_0x3bee('0x19'),_0x459129[_0x3bee('0x3')],agents[_0x459129['destuniqueid']][_0x3bee('0x5')],_0x459129[_0x3bee('0x13')]));}catch(_0x440644){utils[_0x3bee('0x1a')](util[_0x3bee('0x18')](_0x3bee('0x16'),_0x459129[_0x3bee('0x3')]),_0x440644);}};exports['agentringnoanswer']=function(_0x4f36af){try{if(!_[_0x3bee('0x1b')](agents[_0x4f36af[_0x3bee('0x13')]])){utils['debug'](util[_0x3bee('0x18')](_0x3bee('0x1c'),_0x4f36af[_0x3bee('0x3')]),_0x4f36af);utils[_0x3bee('0x1')](util[_0x3bee('0x18')](_0x3bee('0x1d'),_0x4f36af[_0x3bee('0x3')],agents[_0x4f36af['destuniqueid']][_0x3bee('0x5')],_0x4f36af[_0x3bee('0x13')]));agents[_0x4f36af[_0x3bee('0x13')]][_0x3bee('0x1e')]=!![];agents[_0x4f36af['destuniqueid']][_0x3bee('0x1f')]=utils[_0x3bee('0x20')]();agents[_0x4f36af[_0x3bee('0x13')]]['lastevent']='timeout';agents[_0x4f36af[_0x3bee('0x13')]][_0x3bee('0x21')]='timeout';agents[_0x4f36af[_0x3bee('0x13')]][_0x3bee('0x22')]=_0x4f36af[_0x3bee('0x23')]?parseInt(_0x4f36af['ringtime'])/0x3e8:0x0;agents[_0x4f36af[_0x3bee('0x13')]][_0x3bee('0x24')]=0x0;unanswered[_0x3bee('0x25')](_0x4f36af['destuniqueid']);}}catch(_0x239fa4){utils[_0x3bee('0x1a')](util[_0x3bee('0x18')]('[%s][agents][agentringnoanswer]',_0x4f36af[_0x3bee('0x3')]),_0x239fa4);}};exports[_0x3bee('0x26')]=function(_0x27ed99){try{_[_0x3bee('0x27')](agents,function(_0x3433aa,_0x559c2b){if(_0x3433aa['uniqueid']==_0x27ed99[_0x3bee('0x3')]&&!_[_0x3bee('0x28')](unanswered,_0x3433aa[_0x3bee('0x13')])){utils[_0x3bee('0x15')](util['format']('[%s][agents][queuecallerabandon]',_0x27ed99[_0x3bee('0x3')]),_0x27ed99);utils[_0x3bee('0x1')](util['format']('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x27ed99[_0x3bee('0x3')],_0x3433aa[_0x3bee('0x5')],_0x3433aa[_0x3bee('0x13')]));_0x3433aa[_0x3bee('0x1e')]=!![];_0x3433aa[_0x3bee('0x1f')]=utils[_0x3bee('0x20')]();_0x3433aa[_0x3bee('0x8')]=_0x3bee('0x29');_0x3433aa[_0x3bee('0x21')]=_0x3bee('0x29');_0x3433aa['holdtime']=_0x27ed99['holdtime'];_0x3433aa[_0x3bee('0x24')]=0x0;writeDB(_0x3433aa);}});}catch(_0x4a4706){utils['error'](util[_0x3bee('0x18')](_0x3bee('0x2a'),_0x27ed99[_0x3bee('0x3')]),_0x4a4706);}};exports[_0x3bee('0x2b')]=function(_0xd926f8){try{if(agents[_0xd926f8[_0x3bee('0x13')]]){utils[_0x3bee('0x15')](util[_0x3bee('0x18')]('[%s][agents][agentconnect]',_0xd926f8[_0x3bee('0x3')]),_0xd926f8);utils[_0x3bee('0x1')](util['format'](_0x3bee('0x2c'),_0xd926f8[_0x3bee('0x3')],agents[_0xd926f8[_0x3bee('0x13')]][_0x3bee('0x5')],_0xd926f8[_0x3bee('0x13')]));agents[_0xd926f8['destuniqueid']]['agentconnectAt']=utils[_0x3bee('0x20')]();agents[_0xd926f8[_0x3bee('0x13')]][_0x3bee('0x7')]=_0xd926f8[_0x3bee('0x7')];agents[_0xd926f8[_0x3bee('0x13')]][_0x3bee('0x2d')]=_0xd926f8[_0x3bee('0x2d')];agents[_0xd926f8[_0x3bee('0x13')]][_0x3bee('0x22')]=_0xd926f8[_0x3bee('0x23')];agents[_0xd926f8[_0x3bee('0x13')]][_0x3bee('0x8')]='connect';_[_0x3bee('0x27')](agents,function(_0x1b5eca,_0x25158b){if(_0x1b5eca[_0x3bee('0x13')]!=_0xd926f8[_0x3bee('0x13')]&&_0x1b5eca[_0x3bee('0x3')]==_0xd926f8[_0x3bee('0x3')]){_0x1b5eca[_0x3bee('0x24')]=0x0;_0x1b5eca[_0x3bee('0x22')]=_0xd926f8[_0x3bee('0x23')];_0x1b5eca[_0x3bee('0x1e')]=!![];_0x1b5eca[_0x3bee('0x1f')]=utils[_0x3bee('0x20')]();_0x1b5eca['lastevent']=_0x3bee('0x2e');_0x1b5eca[_0x3bee('0x21')]=_0x3bee('0x2e');_0x1b5eca[_0x3bee('0x2f')]=_0xd926f8[_0x3bee('0x13')];_0x1b5eca[_0x3bee('0x30')]=_0xd926f8[_0x3bee('0x5')];writeDB(_0x1b5eca);}});}}catch(_0xd1140d){utils['error'](util[_0x3bee('0x18')](_0x3bee('0x31'),_0xd926f8[_0x3bee('0x3')]),_0xd1140d);}};exports['agentcomplete']=function(_0x4567f2){try{if(!_['isNil'](agents[_0x4567f2[_0x3bee('0x13')]])){utils['debug'](util['format'](_0x3bee('0x32'),_0x4567f2[_0x3bee('0x3')]),_0x4567f2);utils[_0x3bee('0x1')](util[_0x3bee('0x18')](_0x3bee('0x33'),_0x4567f2['uniqueid'],agents[_0x4567f2['destuniqueid']][_0x3bee('0x5')],_0x4567f2['destuniqueid']));agents[_0x4567f2[_0x3bee('0x13')]]['agentcomplete']=!![];agents[_0x4567f2[_0x3bee('0x13')]]['agentcompleteAt']=utils[_0x3bee('0x20')]();agents[_0x4567f2[_0x3bee('0x13')]][_0x3bee('0x24')]=utils[_0x3bee('0x34')](agents[_0x4567f2['destuniqueid']]['agentcompleteAt'],agents[_0x4567f2[_0x3bee('0x13')]]['agentconnectAt']);agents[_0x4567f2['destuniqueid']]['reason']=_0x4567f2[_0x3bee('0x21')];agents[_0x4567f2['destuniqueid']][_0x3bee('0x8')]=_0x3bee('0x35');writeDB(agents[_0x4567f2[_0x3bee('0x13')]]);}}catch(_0x593427){utils[_0x3bee('0x1a')](util['format'](_0x3bee('0x32'),_0x4567f2['uniqueid']),_0x593427);}};exports[_0x3bee('0x36')]=function(_0x16b096){try{if(!_[_0x3bee('0x1b')](agents[_0x16b096['transfereruniqueid']])){utils[_0x3bee('0x15')](util[_0x3bee('0x18')](_0x3bee('0x37'),_0x16b096['uniqueid']),_0x16b096);utils['info'](util[_0x3bee('0x18')](_0x3bee('0x38'),_0x16b096[_0x3bee('0x3')],agents[_0x16b096[_0x3bee('0x39')]][_0x3bee('0x5')],agents[_0x16b096[_0x3bee('0x39')]][_0x3bee('0x3')]));agents[_0x16b096['transfereruniqueid']][_0x3bee('0x3a')]=!![];agents[_0x16b096[_0x3bee('0x39')]]['transfertype']='blind';agents[_0x16b096[_0x3bee('0x39')]]['transferexten']=_0x16b096[_0x3bee('0x3b')];agents[_0x16b096[_0x3bee('0x39')]][_0x3bee('0x3c')]=agents[_0x16b096['transfereruniqueid']][_0x3bee('0x3')];}}catch(_0x3beac9){utils[_0x3bee('0x1a')](util['format'](_0x3bee('0x37'),_0x16b096[_0x3bee('0x3')]),_0x3beac9);}};exports['attendedtransfer']=function(_0x7e37ed){try{utils[_0x3bee('0x15')](util['format'](_0x3bee('0x3d'),_0x7e37ed[_0x3bee('0x3e')]),_0x7e37ed);if(_0x7e37ed[_0x3bee('0x3e')]==_0x7e37ed[_0x3bee('0x3f')]){if(!_[_0x3bee('0x1b')](agents[_0x7e37ed[_0x3bee('0x40')]])){utils[_0x3bee('0x1')](util[_0x3bee('0x18')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x7e37ed['origtransfereruniqueid'],agents[_0x7e37ed[_0x3bee('0x40')]]['membername']));agents[_0x7e37ed[_0x3bee('0x40')]][_0x3bee('0x3a')]=!![];agents[_0x7e37ed[_0x3bee('0x40')]]['transfertype']=_0x3bee('0x41');agents[_0x7e37ed[_0x3bee('0x40')]][_0x3bee('0x42')]=_0x7e37ed['origtransfererexten'];agents[_0x7e37ed[_0x3bee('0x40')]]['transferuniqueid']=_0x7e37ed[_0x3bee('0x3e')];}if(_0x7e37ed[_0x3bee('0x43')]&&agents[_0x7e37ed[_0x3bee('0x43')]]){agents[_0x7e37ed['transfereeuniqueid']][_0x3bee('0x44')]=0x1;transfers[_0x7e37ed[_0x3bee('0x43')]]=_[_0x3bee('0x45')](agents[_0x7e37ed['transfereeuniqueid']]);transfers[_0x7e37ed['transfereeuniqueid']][_0x3bee('0x46')]=agents[_0x7e37ed[_0x3bee('0x40')]][_0x3bee('0x46')];transfers[_0x7e37ed['transfereeuniqueid']]['calleridname']=agents[_0x7e37ed[_0x3bee('0x40')]]['calleridname'];transfers[_0x7e37ed['transfereeuniqueid']][_0x3bee('0x17')]=utils[_0x3bee('0x20')]();transfers[_0x7e37ed[_0x3bee('0x43')]]['agentconnectAt']=utils['now']();transfers[_0x7e37ed[_0x3bee('0x43')]][_0x3bee('0x22')]=0x0;transfers[_0x7e37ed['transfereeuniqueid']][_0x3bee('0x44')]=0x2;}}else if(_0x7e37ed['secondtransfereruniqueid']==_0x7e37ed[_0x3bee('0x47')]){if(!_[_0x3bee('0x1b')](agents[_0x7e37ed[_0x3bee('0x3e')]])){utils[_0x3bee('0x1')](util[_0x3bee('0x18')](_0x3bee('0x48'),_0x7e37ed[_0x3bee('0x3e')],agents[_0x7e37ed[_0x3bee('0x3e')]][_0x3bee('0x5')]));agents[_0x7e37ed[_0x3bee('0x3e')]][_0x3bee('0x3a')]=!![];agents[_0x7e37ed['origtransfereruniqueid']]['transfertype']='ATTENDED';agents[_0x7e37ed[_0x3bee('0x3e')]][_0x3bee('0x42')]=_0x7e37ed[_0x3bee('0x49')];agents[_0x7e37ed[_0x3bee('0x3e')]]['transferuniqueid']=_0x7e37ed[_0x3bee('0x40')];}if(_0x7e37ed[_0x3bee('0x4a')]&&agents[_0x7e37ed['transfertargetuniqueid']]){agents[_0x7e37ed['transfertargetuniqueid']][_0x3bee('0x44')]=0x1;transfers[_0x7e37ed[_0x3bee('0x4a')]]=_[_0x3bee('0x45')](agents[_0x7e37ed['transfertargetuniqueid']]);transfers[_0x7e37ed[_0x3bee('0x4a')]][_0x3bee('0x46')]=agents[_0x7e37ed[_0x3bee('0x3e')]]['calleridnum'];transfers[_0x7e37ed[_0x3bee('0x4a')]][_0x3bee('0x4b')]=agents[_0x7e37ed[_0x3bee('0x3e')]][_0x3bee('0x4b')];transfers[_0x7e37ed['transfertargetuniqueid']]['agentcalledAt']=utils[_0x3bee('0x20')]();transfers[_0x7e37ed[_0x3bee('0x4a')]][_0x3bee('0x4c')]=utils[_0x3bee('0x20')]();transfers[_0x7e37ed[_0x3bee('0x4a')]]['holdtime']=0x0;transfers[_0x7e37ed[_0x3bee('0x4a')]]['agententerreason']=0x2;}}}catch(_0xddc56b){utils[_0x3bee('0x1a')](util[_0x3bee('0x18')](_0x3bee('0x3d'),_0x7e37ed[_0x3bee('0x3e')]),_0xddc56b);}};exports[_0x3bee('0x4d')]=function(_0x3f7dad){try{utils['debug'](util[_0x3bee('0x18')](_0x3bee('0x4e'),_0x3f7dad[_0x3bee('0x3')]),_0x3f7dad);if(agents[_0x3f7dad[_0x3bee('0x3')]]&&agents[_0x3f7dad['uniqueid']][_0x3bee('0x21')]===_0x3bee('0x4f')){if(_0x3f7dad[_0x3bee('0x50')]==='21'){agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x21')]=_0x3bee('0x51');agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x8')]='rejected';}utils[_0x3bee('0x1')](util[_0x3bee('0x18')](_0x3bee('0x52'),_0x3f7dad['uniqueid'],agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x5')],agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x21')],agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x8')]));writeDB(agents[_0x3f7dad[_0x3bee('0x3')]]);var _0x204843=unanswered[_0x3bee('0x53')](_0x3f7dad[_0x3bee('0x3')]);if(_0x204843>-0x1){unanswered[_0x3bee('0x54')](_0x204843,0x1);}}if(transfers[_0x3f7dad[_0x3bee('0x3')]]){transfers[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0xe')]=!![];transfers[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x55')]=utils[_0x3bee('0x20')]();transfers[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x24')]=utils[_0x3bee('0x34')](transfers[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x55')],transfers[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x4c')]);transfers[_0x3f7dad[_0x3bee('0x3')]]['reason']=_0x3bee('0x56');transfers[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x8')]=_0x3bee('0x35');utils[_0x3bee('0x1')](util[_0x3bee('0x18')](_0x3bee('0x52'),_0x3f7dad[_0x3bee('0x3')],transfers[_0x3f7dad[_0x3bee('0x3')]]['membername'],transfers[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x21')],transfers[_0x3f7dad['uniqueid']][_0x3bee('0x8')]));writeDB(transfers[_0x3f7dad['uniqueid']],!![]);}if(agents[_0x3f7dad[_0x3bee('0x3')]]&&agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x4c')]){agents[_0x3f7dad['uniqueid']]['agentcomplete']=!![];agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x55')]=utils[_0x3bee('0x20')]();agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x24')]=utils[_0x3bee('0x34')](agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x55')],agents[_0x3f7dad['uniqueid']][_0x3bee('0x4c')]);agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x21')]=agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x3a')]?_0x3bee('0x3a'):_0x3bee('0x56');agents[_0x3f7dad['uniqueid']][_0x3bee('0x8')]=_0x3bee('0x35');utils['info'](util[_0x3bee('0x18')](_0x3bee('0x52'),_0x3f7dad['uniqueid'],agents[_0x3f7dad[_0x3bee('0x3')]]['membername'],agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x21')],agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x8')]));writeDB(agents[_0x3f7dad['uniqueid']]);}}catch(_0x62900b){utils[_0x3bee('0x1a')](util[_0x3bee('0x18')]('[%s][agents][hangup]',_0x3f7dad[_0x3bee('0x3')]),_0x62900b);}}; \ No newline at end of file +var _0xf45e=['secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfererexten','transferuniqueid','transfereeuniqueid','clone','calleridname','agentcalledAt','ATTENDED','transfertargetuniqueid','agententerreason','hangup','[%s][agents][hangup]','cause','rejected','indexOf','splice','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','lodash','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentcomplete','acw','acwtime','agentacw','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','called','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','[%s][agents][agentcalled]','agentringnoanswer','debug','[%s][agents][agentringnoanswer]','agentringnoanswerAt','timeout','ringtime','includes','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','holdtime','talktime','agentconnect','[%s][agents][agentconnect]','agentconnectAt','now','connectedlinename','answered_elsewhere','reason','answeredelsewheremembername','isNil','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','blindtransfer','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfer','transfertype','blind','transferexten','extension','[%s][agents][blindtransfer]','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0xf45e,0x115));var _0xef45=function(_0x1e35d3,_0x169415){_0x1e35d3=_0x1e35d3-0x0;var _0x376b33=_0xf45e[_0x1e35d3];return _0x376b33;};'use strict';var _=require(_0xef45('0x0'));var util=require('util');var utils=require(_0xef45('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x5762da,_0x17b897){utils[_0xef45('0x2')](util[_0xef45('0x3')](_0xef45('0x4'),_0x5762da[_0xef45('0x5')],_0x5762da[_0xef45('0x6')],_0x5762da[_0xef45('0x7')],_0x5762da[_0xef45('0x8')],_0x5762da[_0xef45('0x9')],_0x5762da[_0xef45('0xa')],_0x5762da[_0xef45('0xb')],_0x5762da[_0xef45('0xc')]));if(_0x5762da[_0xef45('0x7')]){utils[_0xef45('0xd')](_0x5762da[_0xef45('0x7')])[_0xef45('0xe')](function(_0x134c86){if(_0x134c86){_0x5762da[_0xef45('0xf')]=_0x134c86[_0xef45('0xf')];_0x5762da['agentacw']=_0x5762da[_0xef45('0x10')]?_0x134c86[_0xef45('0x11')]:![];_0x5762da[_0xef45('0x12')]=_0x5762da[_0xef45('0x13')]?_0x134c86[_0xef45('0x14')]:0x0;}utils[_0xef45('0x15')]('CreateVoiceAgentReport',_0x5762da);});}else{utils[_0xef45('0x15')](_0xef45('0x16'),_0x5762da);}if(_0x17b897){delete transfers[_0x5762da[_0xef45('0x5')]];}else{delete agents[_0x5762da[_0xef45('0x17')]];}}exports[_0xef45('0x18')]=function(_0x4a6e5c){try{utils['debug'](util[_0xef45('0x3')]('[%s][agents][agentcalled]',_0x4a6e5c[_0xef45('0x5')]),_0x4a6e5c);agents[_0x4a6e5c[_0xef45('0x17')]]=_0x4a6e5c;agents[_0x4a6e5c[_0xef45('0x17')]]['agentcalledAt']=utils['now']();agents[_0x4a6e5c[_0xef45('0x17')]]['lastevent']=_0xef45('0x19');agents[_0x4a6e5c[_0xef45('0x17')]][_0xef45('0xb')]=null;agents[_0x4a6e5c[_0xef45('0x17')]]['connectedlinename']=null;utils['info'](util[_0xef45('0x3')](_0xef45('0x1a'),_0x4a6e5c[_0xef45('0x5')],agents[_0x4a6e5c[_0xef45('0x17')]]['membername'],_0x4a6e5c['destuniqueid']));}catch(_0x2c57fc){utils[_0xef45('0x1b')](util[_0xef45('0x3')](_0xef45('0x1c'),_0x4a6e5c[_0xef45('0x5')]),_0x2c57fc);}};exports[_0xef45('0x1d')]=function(_0x375cbd){try{if(!_['isNil'](agents[_0x375cbd[_0xef45('0x17')]])){utils[_0xef45('0x1e')](util[_0xef45('0x3')](_0xef45('0x1f'),_0x375cbd[_0xef45('0x5')]),_0x375cbd);utils['info'](util[_0xef45('0x3')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x375cbd['uniqueid'],agents[_0x375cbd[_0xef45('0x17')]][_0xef45('0x8')],_0x375cbd[_0xef45('0x17')]));agents[_0x375cbd[_0xef45('0x17')]][_0xef45('0x1d')]=!![];agents[_0x375cbd[_0xef45('0x17')]][_0xef45('0x20')]=utils['now']();agents[_0x375cbd[_0xef45('0x17')]]['lastevent']=_0xef45('0x21');agents[_0x375cbd[_0xef45('0x17')]]['reason']=_0xef45('0x21');agents[_0x375cbd[_0xef45('0x17')]]['holdtime']=_0x375cbd[_0xef45('0x22')]?parseInt(_0x375cbd['ringtime'])/0x3e8:0x0;agents[_0x375cbd['destuniqueid']]['talktime']=0x0;unanswered['push'](_0x375cbd[_0xef45('0x17')]);}}catch(_0x2f72ef){utils[_0xef45('0x1b')](util[_0xef45('0x3')]('[%s][agents][agentringnoanswer]',_0x375cbd[_0xef45('0x5')]),_0x2f72ef);}};exports['queuecallerabandon']=function(_0x2525da){try{_['forIn'](agents,function(_0x3e6922,_0x5bfd2d){if(_0x3e6922['uniqueid']==_0x2525da[_0xef45('0x5')]&&!_[_0xef45('0x23')](unanswered,_0x3e6922[_0xef45('0x17')])){utils[_0xef45('0x1e')](util[_0xef45('0x3')]('[%s][agents][queuecallerabandon]',_0x2525da['uniqueid']),_0x2525da);utils['info'](util[_0xef45('0x3')](_0xef45('0x24'),_0x2525da[_0xef45('0x5')],_0x3e6922[_0xef45('0x8')],_0x3e6922[_0xef45('0x17')]));_0x3e6922[_0xef45('0x1d')]=!![];_0x3e6922[_0xef45('0x20')]=utils['now']();_0x3e6922['lastevent']=_0xef45('0x25');_0x3e6922['reason']=_0xef45('0x25');_0x3e6922['holdtime']=_0x2525da[_0xef45('0x26')];_0x3e6922[_0xef45('0x27')]=0x0;writeDB(_0x3e6922);}});}catch(_0x2a7c53){utils[_0xef45('0x1b')](util[_0xef45('0x3')]('[%s][agents][queuecallerabandon]',_0x2525da[_0xef45('0x5')]),_0x2a7c53);}};exports[_0xef45('0x28')]=function(_0x9df07e){try{if(agents[_0x9df07e['destuniqueid']]){utils['debug'](util[_0xef45('0x3')](_0xef45('0x29'),_0x9df07e['uniqueid']),_0x9df07e);utils[_0xef45('0x2')](util['format']('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x9df07e[_0xef45('0x5')],agents[_0x9df07e[_0xef45('0x17')]][_0xef45('0x8')],_0x9df07e['destuniqueid']));agents[_0x9df07e[_0xef45('0x17')]][_0xef45('0x2a')]=utils[_0xef45('0x2b')]();agents[_0x9df07e[_0xef45('0x17')]]['connectedlinenum']=_0x9df07e['connectedlinenum'];agents[_0x9df07e[_0xef45('0x17')]][_0xef45('0x2c')]=_0x9df07e[_0xef45('0x2c')];agents[_0x9df07e[_0xef45('0x17')]][_0xef45('0x26')]=_0x9df07e[_0xef45('0x22')];agents[_0x9df07e[_0xef45('0x17')]][_0xef45('0xc')]='connect';_['forIn'](agents,function(_0x13f8b2,_0x35d014){if(_0x13f8b2[_0xef45('0x17')]!=_0x9df07e[_0xef45('0x17')]&&_0x13f8b2[_0xef45('0x5')]==_0x9df07e[_0xef45('0x5')]){_0x13f8b2[_0xef45('0x27')]=0x0;_0x13f8b2[_0xef45('0x26')]=_0x9df07e[_0xef45('0x22')];_0x13f8b2[_0xef45('0x1d')]=!![];_0x13f8b2[_0xef45('0x20')]=utils[_0xef45('0x2b')]();_0x13f8b2[_0xef45('0xc')]=_0xef45('0x2d');_0x13f8b2[_0xef45('0x2e')]=_0xef45('0x2d');_0x13f8b2['answeredelsewheredestinationuniqueid']=_0x9df07e[_0xef45('0x17')];_0x13f8b2[_0xef45('0x2f')]=_0x9df07e[_0xef45('0x8')];writeDB(_0x13f8b2);}});}}catch(_0x82c123){utils['error'](util[_0xef45('0x3')]('[%s][agents][agentconnect]',_0x9df07e[_0xef45('0x5')]),_0x82c123);}};exports['agentcomplete']=function(_0x5faf67){try{if(!_[_0xef45('0x30')](agents[_0x5faf67[_0xef45('0x17')]])){utils[_0xef45('0x1e')](util[_0xef45('0x3')](_0xef45('0x31'),_0x5faf67[_0xef45('0x5')]),_0x5faf67);utils['info'](util[_0xef45('0x3')](_0xef45('0x32'),_0x5faf67[_0xef45('0x5')],agents[_0x5faf67[_0xef45('0x17')]][_0xef45('0x8')],_0x5faf67[_0xef45('0x17')]));agents[_0x5faf67[_0xef45('0x17')]][_0xef45('0x10')]=!![];agents[_0x5faf67[_0xef45('0x17')]][_0xef45('0x33')]=utils[_0xef45('0x2b')]();agents[_0x5faf67[_0xef45('0x17')]][_0xef45('0x27')]=utils[_0xef45('0x34')](agents[_0x5faf67[_0xef45('0x17')]]['agentcompleteAt'],agents[_0x5faf67[_0xef45('0x17')]][_0xef45('0x2a')]);agents[_0x5faf67[_0xef45('0x17')]]['reason']=_0x5faf67['reason'];agents[_0x5faf67['destuniqueid']][_0xef45('0xc')]=_0xef45('0x35');writeDB(agents[_0x5faf67[_0xef45('0x17')]]);}}catch(_0x34e9d5){utils[_0xef45('0x1b')](util[_0xef45('0x3')]('[%s][agents][agentcomplete]',_0x5faf67[_0xef45('0x5')]),_0x34e9d5);}};exports[_0xef45('0x36')]=function(_0x2b2419){try{if(!_['isNil'](agents[_0x2b2419['transfereruniqueid']])){utils[_0xef45('0x1e')](util[_0xef45('0x3')]('[%s][agents][blindtransfer]',_0x2b2419[_0xef45('0x5')]),_0x2b2419);utils[_0xef45('0x2')](util[_0xef45('0x3')](_0xef45('0x37'),_0x2b2419[_0xef45('0x5')],agents[_0x2b2419[_0xef45('0x38')]][_0xef45('0x8')],agents[_0x2b2419[_0xef45('0x38')]][_0xef45('0x5')]));agents[_0x2b2419[_0xef45('0x38')]][_0xef45('0x39')]=!![];agents[_0x2b2419[_0xef45('0x38')]][_0xef45('0x3a')]=_0xef45('0x3b');agents[_0x2b2419['transfereruniqueid']][_0xef45('0x3c')]=_0x2b2419[_0xef45('0x3d')];agents[_0x2b2419[_0xef45('0x38')]]['transferuniqueid']=agents[_0x2b2419[_0xef45('0x38')]][_0xef45('0x5')];}}catch(_0x464bda){utils[_0xef45('0x1b')](util['format'](_0xef45('0x3e'),_0x2b2419[_0xef45('0x5')]),_0x464bda);}};exports[_0xef45('0x3f')]=function(_0x310105){try{utils[_0xef45('0x1e')](util[_0xef45('0x3')](_0xef45('0x40'),_0x310105[_0xef45('0x41')]),_0x310105);if(_0x310105[_0xef45('0x41')]==_0x310105[_0xef45('0x42')]){if(!_[_0xef45('0x30')](agents[_0x310105[_0xef45('0x43')]])){utils['info'](util[_0xef45('0x3')](_0xef45('0x44'),_0x310105[_0xef45('0x41')],agents[_0x310105[_0xef45('0x43')]][_0xef45('0x8')]));agents[_0x310105[_0xef45('0x43')]]['transfer']=!![];agents[_0x310105['secondtransfereruniqueid']][_0xef45('0x3a')]='ATTENDED';agents[_0x310105[_0xef45('0x43')]][_0xef45('0x3c')]=_0x310105[_0xef45('0x45')];agents[_0x310105['secondtransfereruniqueid']][_0xef45('0x46')]=_0x310105[_0xef45('0x41')];}if(_0x310105['transfereeuniqueid']&&agents[_0x310105[_0xef45('0x47')]]){agents[_0x310105['transfereeuniqueid']]['agententerreason']=0x1;transfers[_0x310105[_0xef45('0x47')]]=_[_0xef45('0x48')](agents[_0x310105[_0xef45('0x47')]]);transfers[_0x310105[_0xef45('0x47')]][_0xef45('0xa')]=agents[_0x310105['secondtransfereruniqueid']][_0xef45('0xa')];transfers[_0x310105[_0xef45('0x47')]]['calleridname']=agents[_0x310105[_0xef45('0x43')]][_0xef45('0x49')];transfers[_0x310105[_0xef45('0x47')]][_0xef45('0x4a')]=utils[_0xef45('0x2b')]();transfers[_0x310105[_0xef45('0x47')]][_0xef45('0x2a')]=utils[_0xef45('0x2b')]();transfers[_0x310105['transfereeuniqueid']][_0xef45('0x26')]=0x0;transfers[_0x310105['transfereeuniqueid']]['agententerreason']=0x2;}}else if(_0x310105[_0xef45('0x43')]==_0x310105['secondtransfererlinkedid']){if(!_[_0xef45('0x30')](agents[_0x310105[_0xef45('0x41')]])){utils['info'](util[_0xef45('0x3')](_0xef45('0x44'),_0x310105[_0xef45('0x41')],agents[_0x310105[_0xef45('0x41')]][_0xef45('0x8')]));agents[_0x310105[_0xef45('0x41')]]['transfer']=!![];agents[_0x310105[_0xef45('0x41')]][_0xef45('0x3a')]=_0xef45('0x4b');agents[_0x310105[_0xef45('0x41')]][_0xef45('0x3c')]=_0x310105['secondtransfererexten'];agents[_0x310105[_0xef45('0x41')]]['transferuniqueid']=_0x310105[_0xef45('0x43')];}if(_0x310105[_0xef45('0x4c')]&&agents[_0x310105['transfertargetuniqueid']]){agents[_0x310105[_0xef45('0x4c')]][_0xef45('0x4d')]=0x1;transfers[_0x310105[_0xef45('0x4c')]]=_['clone'](agents[_0x310105['transfertargetuniqueid']]);transfers[_0x310105[_0xef45('0x4c')]][_0xef45('0xa')]=agents[_0x310105[_0xef45('0x41')]]['calleridnum'];transfers[_0x310105[_0xef45('0x4c')]][_0xef45('0x49')]=agents[_0x310105['origtransfereruniqueid']][_0xef45('0x49')];transfers[_0x310105['transfertargetuniqueid']][_0xef45('0x4a')]=utils[_0xef45('0x2b')]();transfers[_0x310105[_0xef45('0x4c')]][_0xef45('0x2a')]=utils[_0xef45('0x2b')]();transfers[_0x310105[_0xef45('0x4c')]][_0xef45('0x26')]=0x0;transfers[_0x310105[_0xef45('0x4c')]]['agententerreason']=0x2;}}}catch(_0x3e6b06){utils[_0xef45('0x1b')](util[_0xef45('0x3')](_0xef45('0x40'),_0x310105[_0xef45('0x41')]),_0x3e6b06);}};exports[_0xef45('0x4e')]=function(_0xef7b79){try{utils[_0xef45('0x1e')](util[_0xef45('0x3')](_0xef45('0x4f'),_0xef7b79[_0xef45('0x5')]),_0xef7b79);if(agents[_0xef7b79['uniqueid']]&&agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0x2e')]===_0xef45('0x21')){if(_0xef7b79[_0xef45('0x50')]==='21'){agents[_0xef7b79[_0xef45('0x5')]]['reason']=_0xef45('0x51');agents[_0xef7b79[_0xef45('0x5')]]['lastevent']='rejected';}utils[_0xef45('0x2')](util[_0xef45('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0xef7b79['uniqueid'],agents[_0xef7b79['uniqueid']][_0xef45('0x8')],agents[_0xef7b79[_0xef45('0x5')]]['reason'],agents[_0xef7b79['uniqueid']][_0xef45('0xc')]));writeDB(agents[_0xef7b79['uniqueid']]);var _0x36586a=unanswered[_0xef45('0x52')](_0xef7b79[_0xef45('0x5')]);if(_0x36586a>-0x1){unanswered[_0xef45('0x53')](_0x36586a,0x1);}}if(transfers[_0xef7b79[_0xef45('0x5')]]){transfers[_0xef7b79[_0xef45('0x5')]][_0xef45('0x10')]=!![];transfers[_0xef7b79['uniqueid']][_0xef45('0x33')]=utils[_0xef45('0x2b')]();transfers[_0xef7b79[_0xef45('0x5')]][_0xef45('0x27')]=utils[_0xef45('0x34')](transfers[_0xef7b79[_0xef45('0x5')]]['agentcompleteAt'],transfers[_0xef7b79['uniqueid']][_0xef45('0x2a')]);transfers[_0xef7b79[_0xef45('0x5')]][_0xef45('0x2e')]=_0xef45('0x54');transfers[_0xef7b79[_0xef45('0x5')]][_0xef45('0xc')]=_0xef45('0x35');utils[_0xef45('0x2')](util['format'](_0xef45('0x55'),_0xef7b79[_0xef45('0x5')],transfers[_0xef7b79[_0xef45('0x5')]][_0xef45('0x8')],transfers[_0xef7b79[_0xef45('0x5')]][_0xef45('0x2e')],transfers[_0xef7b79[_0xef45('0x5')]]['lastevent']));writeDB(transfers[_0xef7b79[_0xef45('0x5')]],!![]);}if(agents[_0xef7b79['uniqueid']]&&agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0x2a')]){agents[_0xef7b79['uniqueid']][_0xef45('0x10')]=!![];agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0x33')]=utils['now']();agents[_0xef7b79[_0xef45('0x5')]]['talktime']=utils[_0xef45('0x34')](agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0x33')],agents[_0xef7b79[_0xef45('0x5')]]['agentconnectAt']);agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0x2e')]=agents[_0xef7b79[_0xef45('0x5')]]['transfer']?_0xef45('0x39'):_0xef45('0x54');agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0xc')]=_0xef45('0x35');utils['info'](util[_0xef45('0x3')](_0xef45('0x55'),_0xef7b79[_0xef45('0x5')],agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0x8')],agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0x2e')],agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0xc')]));writeDB(agents[_0xef7b79['uniqueid']]);}}catch(_0xd3a51e){utils[_0xef45('0x1b')](util[_0xef45('0x3')]('[%s][agents][hangup]',_0xef7b79[_0xef45('0x5')]),_0xd3a51e);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 53476c2..6298982 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 _0x1a0a=['membername','calleridnum','connectedlinenum','lastevent','accountcode','then','UserId','request','recording','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error','newstate','[%s][calls][newstate]','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','isNil','systemanswertime','destinationchannel','answertime','disposition','toNumber','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','diffTime','endtime','starttime','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][musiconholdstop]','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','lastapplication','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','type','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','cdr','split','substring','lastIndexOf','includes','noop','execif','set','gotoif','lodash','./utils','./transfers.controller','FAILED','NO\x20ANSWER','ANSWERED','BUSY','blinds','uniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue'];(function(_0x5ce430,_0x2a4694){var _0x5bfcea=function(_0xb803c2){while(--_0xb803c2){_0x5ce430['push'](_0x5ce430['shift']());}};_0x5bfcea(++_0x2a4694);}(_0x1a0a,0x196));var _0xa1a0=function(_0x56fb02,_0x179d7a){_0x56fb02=_0x56fb02-0x0;var _0x177f5b=_0x1a0a[_0x56fb02];return _0x177f5b;};'use strict';var _=require(_0xa1a0('0x0'));var util=require('util');var utils=require(_0xa1a0('0x1'));var transfers=require(_0xa1a0('0x2'));var dispositions=['NO\x20ANSWER',_0xa1a0('0x3'),_0xa1a0('0x3'),'NO\x20ANSWER',_0xa1a0('0x4'),_0xa1a0('0x4'),_0xa1a0('0x5'),_0xa1a0('0x6'),_0xa1a0('0x3'),_0xa1a0('0x3'),_0xa1a0('0x3')];var channels={};function writeDB(_0x88a1c9){var _0x5f83c4;if(transfers[_0xa1a0('0x7')][_0x88a1c9[_0xa1a0('0x8')]]){_0x5f83c4=_0x88a1c9['uniqueid'];_0x88a1c9[_0xa1a0('0x8')]=transfers['blinds'][_0x88a1c9[_0xa1a0('0x8')]]['transfereeuniqueid'];}utils[_0xa1a0('0x9')](util[_0xa1a0('0xa')](_0xa1a0('0xb'),_0x88a1c9[_0xa1a0('0x8')],_0x88a1c9[_0xa1a0('0xc')],_0x88a1c9[_0xa1a0('0xd')],_0x88a1c9[_0xa1a0('0xe')],_0x88a1c9['interface'],_0x88a1c9[_0xa1a0('0xf')],_0x88a1c9[_0xa1a0('0x10')],_0x88a1c9[_0xa1a0('0x11')]));if(_0x88a1c9[_0xa1a0('0x12')]){utils['getUserByInternal'](_0x88a1c9[_0xa1a0('0x12')])[_0xa1a0('0x13')](function(_0x2c3f9f){if(_0x2c3f9f){_0x88a1c9[_0xa1a0('0x14')]=_0x2c3f9f['id'];}utils[_0xa1a0('0x15')]('CreateVoiceCallReport',_0x88a1c9);});}else{utils[_0xa1a0('0x15')]('CreateVoiceCallReport',_0x88a1c9);}if(channels[_0x88a1c9[_0xa1a0('0x8')]]){delete channels[_0x88a1c9['uniqueid']];}else if(_0x5f83c4&&channels[_0x5f83c4]){if(!transfers[_0xa1a0('0x7')][_0x5f83c4][_0xa1a0('0x16')])delete transfers[_0xa1a0('0x7')][_0x5f83c4];delete channels[_0x5f83c4];}}exports['newchannel']=function(_0x35c791){try{utils[_0xa1a0('0x17')](util[_0xa1a0('0xa')](_0xa1a0('0x18'),_0x35c791[_0xa1a0('0x8')]),_0x35c791);if(_0x35c791['uniqueid']==_0x35c791[_0xa1a0('0x19')]&&_0x35c791[_0xa1a0('0xc')]!=_0xa1a0('0x1a')){utils['info'](util['format'](_0xa1a0('0x1b'),_0x35c791[_0xa1a0('0x8')],_0x35c791[_0xa1a0('0x1c')],_0x35c791[_0xa1a0('0x1d')]));channels[_0x35c791['uniqueid']]={'uniqueid':_0x35c791[_0xa1a0('0x8')],'accountcode':_0x35c791['accountcode'],'source':_0x35c791[_0xa1a0('0xf')],'destination':_0x35c791[_0xa1a0('0x1d')],'destinationcontext':_0x35c791[_0xa1a0('0x1c')],'channel':_0x35c791['channel'],'starttime':utils[_0xa1a0('0x1e')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xa1a0('0x4'),'amaflags':_0xa1a0('0x1f')};}}catch(_0x1a7f4f){utils[_0xa1a0('0x20')](util['format'](_0xa1a0('0x18'),_0x35c791['uniqueid']),_0x1a7f4f);}};exports[_0xa1a0('0x21')]=function(_0xa2242f){try{utils[_0xa1a0('0x17')](util[_0xa1a0('0xa')](_0xa1a0('0x22'),_0xa2242f[_0xa1a0('0x8')]),_0xa2242f);if(!_['isNil'](channels[_0xa2242f[_0xa1a0('0x8')]])&&_0xa2242f[_0xa1a0('0x23')]==0x6){utils['info'](util['format'](_0xa1a0('0x24'),_0xa2242f[_0xa1a0('0x8')],_0xa2242f['context'],_0xa2242f[_0xa1a0('0xc')]));if(_[_0xa1a0('0x25')](channels[_0xa2242f[_0xa1a0('0x8')]][_0xa1a0('0x26')])){channels[_0xa2242f['uniqueid']]['systemanswertime']=utils[_0xa1a0('0x1e')]();}}else if(!_[_0xa1a0('0x25')](channels[_0xa2242f['linkedid']])&&_0xa2242f[_0xa1a0('0x23')]==0x6&&_0xa2242f[_0xa1a0('0x1c')]!='transfer'){utils['info'](util[_0xa1a0('0xa')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0xa2242f['uniqueid'],_0xa2242f[_0xa1a0('0x19')],_0xa2242f[_0xa1a0('0x1c')],_0xa2242f[_0xa1a0('0xc')]));channels[_0xa2242f['linkedid']]['accountcode']=_0xa2242f[_0xa1a0('0x12')];channels[_0xa2242f['linkedid']][_0xa1a0('0x27')]=_0xa2242f[_0xa1a0('0xc')];if(_['isNil'](channels[_0xa2242f['linkedid']][_0xa1a0('0x28')])){channels[_0xa2242f[_0xa1a0('0x19')]][_0xa1a0('0x28')]=utils['now']();}channels[_0xa2242f[_0xa1a0('0x19')]][_0xa1a0('0x29')]=dispositions[_[_0xa1a0('0x2a')](_0xa2242f[_0xa1a0('0x23')])]||_0xa1a0('0x5');}}catch(_0x3052e3){utils[_0xa1a0('0x20')](util[_0xa1a0('0xa')]('[%s][calls][newstate]',_0xa2242f['uniqueid']),_0x3052e3);}};exports[_0xa1a0('0x2b')]=function(_0x5ce841){try{if(!_['isNil'](channels[_0x5ce841[_0xa1a0('0x8')]])){utils['debug'](util[_0xa1a0('0xa')](_0xa1a0('0x2c'),_0x5ce841[_0xa1a0('0x8')]),_0x5ce841);if(_[_0xa1a0('0x25')](channels[_0x5ce841[_0xa1a0('0x8')]][_0xa1a0('0x2d')])){channels[_0x5ce841[_0xa1a0('0x8')]][_0xa1a0('0x2d')]=_0x5ce841[_0xa1a0('0x2e')]+'\x20<'+_0x5ce841[_0xa1a0('0xf')]+'>';}utils[_0xa1a0('0x9')](util['format'](_0xa1a0('0x2f'),_0x5ce841[_0xa1a0('0x8')],channels[_0x5ce841['uniqueid']][_0xa1a0('0x2d')],_0x5ce841[_0xa1a0('0x30')]));channels[_0x5ce841[_0xa1a0('0x8')]]['endtime']=utils[_0xa1a0('0x1e')]();channels[_0x5ce841[_0xa1a0('0x8')]]['duration']=utils[_0xa1a0('0x31')](channels[_0x5ce841[_0xa1a0('0x8')]][_0xa1a0('0x32')],channels[_0x5ce841[_0xa1a0('0x8')]][_0xa1a0('0x33')]);channels[_0x5ce841[_0xa1a0('0x8')]]['billableseconds']=channels[_0x5ce841[_0xa1a0('0x8')]][_0xa1a0('0x28')]?utils[_0xa1a0('0x31')](channels[_0x5ce841[_0xa1a0('0x8')]]['endtime'],channels[_0x5ce841[_0xa1a0('0x8')]][_0xa1a0('0x28')]):0x0;writeDB(channels[_0x5ce841['uniqueid']]);}}catch(_0xf94e12){utils[_0xa1a0('0x20')](util[_0xa1a0('0xa')](_0xa1a0('0x2c'),_0x5ce841[_0xa1a0('0x8')]),_0xf94e12);}};exports[_0xa1a0('0x34')]=function(_0x2ca74d){try{if(!_[_0xa1a0('0x25')](channels[_0x2ca74d[_0xa1a0('0x35')]])){utils[_0xa1a0('0x17')](util[_0xa1a0('0xa')](_0xa1a0('0x36'),_0x2ca74d[_0xa1a0('0x37')]),_0x2ca74d);if(channels[_0x2ca74d['localtwolinkedid']]['channel']==_0x2ca74d['transfereechannel']){utils[_0xa1a0('0x9')](util[_0xa1a0('0xa')](_0xa1a0('0x38'),_0x2ca74d[_0xa1a0('0x37')],_0x2ca74d[_0xa1a0('0x35')],_0x2ca74d['secondtransfererchannel']));channels[_0x2ca74d[_0xa1a0('0x35')]]['destinationchannel']=_0x2ca74d['secondtransfererchannel'];channels[_0x2ca74d['localtwolinkedid']][_0xa1a0('0x39')]=_0xa1a0('0x3a');}else if(channels[_0x2ca74d[_0xa1a0('0x35')]][_0xa1a0('0xc')]=_0x2ca74d[_0xa1a0('0x3b')]){utils['info'](util[_0xa1a0('0xa')](_0xa1a0('0x38'),_0x2ca74d[_0xa1a0('0x37')],_0x2ca74d['localtwolinkedid'],_0x2ca74d[_0xa1a0('0x3c')]));channels[_0x2ca74d[_0xa1a0('0x35')]][_0xa1a0('0x27')]=_0x2ca74d[_0xa1a0('0x3c')];channels[_0x2ca74d[_0xa1a0('0x35')]][_0xa1a0('0x39')]=_0xa1a0('0x3a');}}}catch(_0x547d81){utils['error'](util[_0xa1a0('0xa')](_0xa1a0('0x36'),_0x2ca74d['origtransfereruniqueid']),_0x547d81);}};exports[_0xa1a0('0x3d')]=function(_0xa6442d){try{if(!_[_0xa1a0('0x25')](channels[_0xa6442d[_0xa1a0('0x8')]])){utils[_0xa1a0('0x17')](util[_0xa1a0('0xa')](_0xa1a0('0x3e'),_0xa6442d[_0xa1a0('0x8')]),_0xa6442d);channels[_0xa6442d[_0xa1a0('0x8')]][_0xa1a0('0x3f')]=utils[_0xa1a0('0x1e')]();utils[_0xa1a0('0x9')](util[_0xa1a0('0xa')](_0xa1a0('0x40'),_0xa6442d[_0xa1a0('0x8')],channels[_0xa6442d[_0xa1a0('0x8')]][_0xa1a0('0x3f')]));}}catch(_0xe51ee8){utils[_0xa1a0('0x20')](util[_0xa1a0('0xa')]('[%s][calls][musiconholdstart]',_0xa6442d[_0xa1a0('0x8')]),_0xe51ee8);}};exports['musiconholdstop']=function(_0x3b5f44){try{if(!_[_0xa1a0('0x25')](channels[_0x3b5f44[_0xa1a0('0x8')]])){utils[_0xa1a0('0x17')](util[_0xa1a0('0xa')]('[%s][calls][musiconholdstop]',_0x3b5f44[_0xa1a0('0x8')]),_0x3b5f44);if(!_[_0xa1a0('0x25')](channels[_0x3b5f44[_0xa1a0('0x8')]]['musiconholdstartAt'])){channels[_0x3b5f44['uniqueid']]['mohtime']+=utils['diffTime'](utils[_0xa1a0('0x1e')](),channels[_0x3b5f44[_0xa1a0('0x8')]][_0xa1a0('0x3f')]);utils[_0xa1a0('0x9')](util[_0xa1a0('0xa')](_0xa1a0('0x41'),_0x3b5f44[_0xa1a0('0x8')],channels[_0x3b5f44[_0xa1a0('0x8')]]['mohtime']));delete channels[_0x3b5f44['uniqueid']]['musiconholdstartAt'];}}}catch(_0x3be5a6){utils[_0xa1a0('0x20')](util[_0xa1a0('0xa')](_0xa1a0('0x42'),_0x3b5f44[_0xa1a0('0x8')]),_0x3be5a6);}};exports[_0xa1a0('0x43')]=function(_0x4596b6){try{if(!_['isNil'](channels[_0x4596b6['uniqueid']])){utils[_0xa1a0('0x17')](util[_0xa1a0('0xa')](_0xa1a0('0x44'),_0x4596b6[_0xa1a0('0x8')]),_0x4596b6);if(!_[_0xa1a0('0x25')](_0x4596b6[_0xa1a0('0x45')][_0xa1a0('0x46')])){utils[_0xa1a0('0x9')](util[_0xa1a0('0xa')](_0xa1a0('0x47'),_0x4596b6[_0xa1a0('0x8')],_0x4596b6[_0xa1a0('0x48')]));channels[_0x4596b6['uniqueid']][_0xa1a0('0x49')]=_0x4596b6[_0xa1a0('0x48')];}if(!_[_0xa1a0('0x25')](_0x4596b6[_0xa1a0('0x45')]['xmd-phone'])){utils[_0xa1a0('0x9')](util[_0xa1a0('0xa')](_0xa1a0('0x4a'),_0x4596b6[_0xa1a0('0x8')],_0x4596b6[_0xa1a0('0x48')]));channels[_0x4596b6['uniqueid']][_0xa1a0('0x4b')]=_0x4596b6['value'];channels[_0x4596b6['uniqueid']][_0xa1a0('0x2d')]='\x22'+_0x4596b6[_0xa1a0('0x48')]+_0xa1a0('0x4c')+_0x4596b6[_0xa1a0('0x48')]+'>';}if(!_[_0xa1a0('0x25')](_0x4596b6[_0xa1a0('0x45')]['xmd-callerid-preview'])||!_[_0xa1a0('0x25')](_0x4596b6[_0xa1a0('0x45')]['xmd-callerid'])){utils[_0xa1a0('0x9')](util['format']('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x4596b6['uniqueid'],!_[_0xa1a0('0x25')](_0x4596b6['variable'][_0xa1a0('0x4d')])?'xmd-callerid-preview':'xmd-callerid',_0x4596b6[_0xa1a0('0x48')]));channels[_0x4596b6[_0xa1a0('0x8')]][_0xa1a0('0x2d')]=_0x4596b6[_0xa1a0('0x48')];}if(!_[_0xa1a0('0x25')](_0x4596b6['variable']['xmd-queue'])||!_[_0xa1a0('0x25')](_0x4596b6[_0xa1a0('0x45')]['xmcs-queue'])){utils[_0xa1a0('0x9')](util[_0xa1a0('0xa')](_0xa1a0('0x4e'),_0x4596b6[_0xa1a0('0x8')],!_[_0xa1a0('0x25')](_0x4596b6[_0xa1a0('0x45')]['xmd-queue'])?_0xa1a0('0x4f'):'xmcs-queue',_0x4596b6[_0xa1a0('0x48')]));channels[_0x4596b6[_0xa1a0('0x8')]][_0xa1a0('0x50')]='Queue';channels[_0x4596b6[_0xa1a0('0x8')]][_0xa1a0('0x51')]=_0x4596b6[_0xa1a0('0x48')];channels[_0x4596b6[_0xa1a0('0x8')]][_0xa1a0('0xd')]=!![];}if(!_[_0xa1a0('0x25')](_0x4596b6[_0xa1a0('0x45')][_0xa1a0('0x52')])){utils[_0xa1a0('0x9')](util[_0xa1a0('0xa')](_0xa1a0('0x53'),_0x4596b6['uniqueid'],_0x4596b6[_0xa1a0('0x48')]));channels[_0x4596b6[_0xa1a0('0x8')]][_0xa1a0('0x54')]=_0x4596b6['value'];}if(!_[_0xa1a0('0x25')](_0x4596b6[_0xa1a0('0x45')][_0xa1a0('0x55')])){utils[_0xa1a0('0x9')](util[_0xa1a0('0xa')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x4596b6[_0xa1a0('0x8')],_0x4596b6['value']));channels[_0x4596b6[_0xa1a0('0x8')]][_0xa1a0('0x56')]=_0x4596b6[_0xa1a0('0x48')];}if(!_[_0xa1a0('0x25')](_0x4596b6['variable']['outboundrouteid'])){utils[_0xa1a0('0x9')](util[_0xa1a0('0xa')](_0xa1a0('0x57'),_0x4596b6[_0xa1a0('0x8')],_0x4596b6[_0xa1a0('0x48')]));channels[_0x4596b6[_0xa1a0('0x8')]][_0xa1a0('0x58')]=_0x4596b6['value'];}if(!_[_0xa1a0('0x25')](_0x4596b6['variable']['sipcallid'])){utils['info'](util['format'](_0xa1a0('0x59'),_0x4596b6[_0xa1a0('0x8')],_0x4596b6[_0xa1a0('0x48')]));channels[_0x4596b6[_0xa1a0('0x8')]]['sipcallid']=_0x4596b6[_0xa1a0('0x48')];}}}catch(_0x446985){utils[_0xa1a0('0x20')](util[_0xa1a0('0xa')]('[%s][calls][varset]',_0x4596b6[_0xa1a0('0x8')]),_0x446985);}};exports[_0xa1a0('0x5a')]=function(_0x505032){try{if(!_[_0xa1a0('0x25')](channels[_0x505032[_0xa1a0('0x8')]])){utils['debug'](util['format'](_0xa1a0('0x5b'),_0x505032[_0xa1a0('0x8')]),_0x505032);utils[_0xa1a0('0x9')](util[_0xa1a0('0xa')](_0xa1a0('0x5c'),_0x505032[_0xa1a0('0x8')],_0x505032[_0xa1a0('0x5d')],_0x505032[_0xa1a0('0x5e')]));if(_0x505032[_0xa1a0('0x5d')][_0xa1a0('0x5f')]()=='set'&&_['startsWith'](_0x505032[_0xa1a0('0x5e')][_0xa1a0('0x5f')](),_0xa1a0('0x60'))){var _0x58a3a0=_0x505032[_0xa1a0('0x5e')][_0xa1a0('0x61')]('=');var _0x5e651b=_0x58a3a0[0x0][_0xa1a0('0x62')](_0x58a3a0[0x0][_0xa1a0('0x63')]('(')+0x1,_0x58a3a0[0x0][_0xa1a0('0x63')](')'));var _0x50acc8=_0x58a3a0[0x1];channels[_0x505032['uniqueid']][_0x5e651b]=_0x50acc8;}if(!_[_0xa1a0('0x64')]([_0xa1a0('0x2b'),_0xa1a0('0x65'),_0xa1a0('0x66'),_0xa1a0('0x67'),_0xa1a0('0x68')],_0x505032[_0xa1a0('0x5d')][_0xa1a0('0x5f')]())){channels[_0x505032[_0xa1a0('0x8')]][_0xa1a0('0x50')]=_0x505032[_0xa1a0('0x5d')];channels[_0x505032['uniqueid']][_0xa1a0('0x51')]=_0x505032[_0xa1a0('0x5e')];}}}catch(_0x1d8f4e){utils['error'](util[_0xa1a0('0xa')](_0xa1a0('0x5b'),_0x505032[_0xa1a0('0x8')]),_0x1d8f4e);}}; \ No newline at end of file +var _0xa742=['debug','[%s][calls][newchannel]','linkedid','context','exten','calleridnum','DOCUMENTATION','error','newstate','[%s][calls][newstate]','isNil','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','now','channelstate','transfer','destinationchannel','answertime','disposition','toNumber','[%s][calls][hangup]','callerid','calleridname','cause-txt','duration','diffTime','endtime','starttime','billableseconds','attendedtransfer','[%s][calls][attendedtransfer]','origtransfereruniqueid','localtwolinkedid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','transfertargetchannel','origtransfererchannel','userfield','_attended','musiconholdstart','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstart]','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','\x22\x20<','xmd-callerid-preview','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid','xmd-queue','xmcs-queue','Queue','lastdata','queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','appdata','application','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','includes','noop','execif','./transfers.controller','NO\x20ANSWER','ANSWERED','BUSY','FAILED','blinds','uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','connectedlinenum','getUserByInternal','accountcode','then','UserId','request','CreateVoiceCallReport','recording','newchannel'];(function(_0x352dfc,_0x373b67){var _0x303137=function(_0x5c74ad){while(--_0x5c74ad){_0x352dfc['push'](_0x352dfc['shift']());}};_0x303137(++_0x373b67);}(_0xa742,0xc7));var _0x2a74=function(_0x3b9eca,_0x46cf91){_0x3b9eca=_0x3b9eca-0x0;var _0x116c96=_0xa742[_0x3b9eca];return _0x116c96;};'use strict';var _=require('lodash');var util=require('util');var utils=require('./utils');var transfers=require(_0x2a74('0x0'));var dispositions=[_0x2a74('0x1'),'FAILED','FAILED',_0x2a74('0x1'),'NO\x20ANSWER',_0x2a74('0x1'),_0x2a74('0x2'),_0x2a74('0x3'),_0x2a74('0x4'),_0x2a74('0x4'),_0x2a74('0x4')];var channels={};function writeDB(_0xc06f58){var _0x209234;if(transfers[_0x2a74('0x5')][_0xc06f58[_0x2a74('0x6')]]){_0x209234=_0xc06f58['uniqueid'];_0xc06f58[_0x2a74('0x6')]=transfers['blinds'][_0xc06f58['uniqueid']][_0x2a74('0x7')];}utils[_0x2a74('0x8')](util[_0x2a74('0x9')](_0x2a74('0xa'),_0xc06f58['uniqueid'],_0xc06f58[_0x2a74('0xb')],_0xc06f58['queue'],_0xc06f58['membername'],_0xc06f58['interface'],_0xc06f58['calleridnum'],_0xc06f58[_0x2a74('0xc')],_0xc06f58['lastevent']));if(_0xc06f58['accountcode']){utils[_0x2a74('0xd')](_0xc06f58[_0x2a74('0xe')])[_0x2a74('0xf')](function(_0xb13df0){if(_0xb13df0){_0xc06f58[_0x2a74('0x10')]=_0xb13df0['id'];}utils[_0x2a74('0x11')](_0x2a74('0x12'),_0xc06f58);});}else{utils[_0x2a74('0x11')](_0x2a74('0x12'),_0xc06f58);}if(channels[_0xc06f58[_0x2a74('0x6')]]){delete channels[_0xc06f58[_0x2a74('0x6')]];}else if(_0x209234&&channels[_0x209234]){if(!transfers[_0x2a74('0x5')][_0x209234][_0x2a74('0x13')])delete transfers['blinds'][_0x209234];delete channels[_0x209234];}}exports[_0x2a74('0x14')]=function(_0x5760d6){try{utils[_0x2a74('0x15')](util[_0x2a74('0x9')](_0x2a74('0x16'),_0x5760d6[_0x2a74('0x6')]),_0x5760d6);if(_0x5760d6[_0x2a74('0x6')]==_0x5760d6[_0x2a74('0x17')]&&_0x5760d6[_0x2a74('0xb')]!='OutgoingSpoolFailed'){utils['info'](util[_0x2a74('0x9')]('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x5760d6[_0x2a74('0x6')],_0x5760d6[_0x2a74('0x18')],_0x5760d6[_0x2a74('0x19')]));channels[_0x5760d6[_0x2a74('0x6')]]={'uniqueid':_0x5760d6[_0x2a74('0x6')],'accountcode':_0x5760d6[_0x2a74('0xe')],'source':_0x5760d6[_0x2a74('0x1a')],'destination':_0x5760d6[_0x2a74('0x19')],'destinationcontext':_0x5760d6[_0x2a74('0x18')],'channel':_0x5760d6[_0x2a74('0xb')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0x2a74('0x1b')};}}catch(_0x452808){utils[_0x2a74('0x1c')](util['format']('[%s][calls][newchannel]',_0x5760d6[_0x2a74('0x6')]),_0x452808);}};exports[_0x2a74('0x1d')]=function(_0x3a42f0){try{utils['debug'](util[_0x2a74('0x9')](_0x2a74('0x1e'),_0x3a42f0[_0x2a74('0x6')]),_0x3a42f0);if(!_[_0x2a74('0x1f')](channels[_0x3a42f0[_0x2a74('0x6')]])&&_0x3a42f0['channelstate']==0x6){utils['info'](util[_0x2a74('0x9')](_0x2a74('0x20'),_0x3a42f0['uniqueid'],_0x3a42f0[_0x2a74('0x18')],_0x3a42f0[_0x2a74('0xb')]));if(_[_0x2a74('0x1f')](channels[_0x3a42f0[_0x2a74('0x6')]]['systemanswertime'])){channels[_0x3a42f0[_0x2a74('0x6')]][_0x2a74('0x21')]=utils[_0x2a74('0x22')]();}}else if(!_[_0x2a74('0x1f')](channels[_0x3a42f0[_0x2a74('0x17')]])&&_0x3a42f0[_0x2a74('0x23')]==0x6&&_0x3a42f0[_0x2a74('0x18')]!=_0x2a74('0x24')){utils[_0x2a74('0x8')](util[_0x2a74('0x9')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x3a42f0[_0x2a74('0x6')],_0x3a42f0[_0x2a74('0x17')],_0x3a42f0[_0x2a74('0x18')],_0x3a42f0[_0x2a74('0xb')]));channels[_0x3a42f0['linkedid']]['accountcode']=_0x3a42f0[_0x2a74('0xe')];channels[_0x3a42f0['linkedid']][_0x2a74('0x25')]=_0x3a42f0['channel'];if(_[_0x2a74('0x1f')](channels[_0x3a42f0[_0x2a74('0x17')]]['answertime'])){channels[_0x3a42f0[_0x2a74('0x17')]][_0x2a74('0x26')]=utils[_0x2a74('0x22')]();}channels[_0x3a42f0['linkedid']][_0x2a74('0x27')]=dispositions[_[_0x2a74('0x28')](_0x3a42f0[_0x2a74('0x23')])]||_0x2a74('0x2');}}catch(_0x5d0e24){utils['error'](util[_0x2a74('0x9')]('[%s][calls][newstate]',_0x3a42f0[_0x2a74('0x6')]),_0x5d0e24);}};exports['hangup']=function(_0xf547c8){try{if(!_[_0x2a74('0x1f')](channels[_0xf547c8[_0x2a74('0x6')]])){utils[_0x2a74('0x15')](util[_0x2a74('0x9')](_0x2a74('0x29'),_0xf547c8[_0x2a74('0x6')]),_0xf547c8);if(_['isNil'](channels[_0xf547c8[_0x2a74('0x6')]][_0x2a74('0x2a')])){channels[_0xf547c8[_0x2a74('0x6')]]['callerid']=_0xf547c8[_0x2a74('0x2b')]+'\x20<'+_0xf547c8[_0x2a74('0x1a')]+'>';}utils[_0x2a74('0x8')](util['format']('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0xf547c8[_0x2a74('0x6')],channels[_0xf547c8[_0x2a74('0x6')]][_0x2a74('0x2a')],_0xf547c8[_0x2a74('0x2c')]));channels[_0xf547c8[_0x2a74('0x6')]]['endtime']=utils['now']();channels[_0xf547c8[_0x2a74('0x6')]][_0x2a74('0x2d')]=utils[_0x2a74('0x2e')](channels[_0xf547c8[_0x2a74('0x6')]][_0x2a74('0x2f')],channels[_0xf547c8['uniqueid']][_0x2a74('0x30')]);channels[_0xf547c8[_0x2a74('0x6')]][_0x2a74('0x31')]=channels[_0xf547c8[_0x2a74('0x6')]]['answertime']?utils[_0x2a74('0x2e')](channels[_0xf547c8[_0x2a74('0x6')]]['endtime'],channels[_0xf547c8[_0x2a74('0x6')]][_0x2a74('0x26')]):0x0;writeDB(channels[_0xf547c8[_0x2a74('0x6')]]);}}catch(_0x5d47b6){utils[_0x2a74('0x1c')](util[_0x2a74('0x9')](_0x2a74('0x29'),_0xf547c8[_0x2a74('0x6')]),_0x5d47b6);}};exports[_0x2a74('0x32')]=function(_0x5c4f79){try{if(!_['isNil'](channels[_0x5c4f79['localtwolinkedid']])){utils[_0x2a74('0x15')](util[_0x2a74('0x9')](_0x2a74('0x33'),_0x5c4f79[_0x2a74('0x34')]),_0x5c4f79);if(channels[_0x5c4f79[_0x2a74('0x35')]][_0x2a74('0xb')]==_0x5c4f79[_0x2a74('0x36')]){utils[_0x2a74('0x8')](util['format'](_0x2a74('0x37'),_0x5c4f79[_0x2a74('0x34')],_0x5c4f79['localtwolinkedid'],_0x5c4f79['secondtransfererchannel']));channels[_0x5c4f79[_0x2a74('0x35')]][_0x2a74('0x25')]=_0x5c4f79[_0x2a74('0x38')];channels[_0x5c4f79['localtwolinkedid']]['userfield']='_attended';}else if(channels[_0x5c4f79[_0x2a74('0x35')]]['channel']=_0x5c4f79[_0x2a74('0x39')]){utils[_0x2a74('0x8')](util[_0x2a74('0x9')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x5c4f79[_0x2a74('0x34')],_0x5c4f79['localtwolinkedid'],_0x5c4f79[_0x2a74('0x3a')]));channels[_0x5c4f79[_0x2a74('0x35')]]['destinationchannel']=_0x5c4f79['origtransfererchannel'];channels[_0x5c4f79['localtwolinkedid']][_0x2a74('0x3b')]=_0x2a74('0x3c');}}}catch(_0x110636){utils[_0x2a74('0x1c')](util[_0x2a74('0x9')](_0x2a74('0x33'),_0x5c4f79['origtransfereruniqueid']),_0x110636);}};exports[_0x2a74('0x3d')]=function(_0x516cf3){try{if(!_[_0x2a74('0x1f')](channels[_0x516cf3[_0x2a74('0x6')]])){utils[_0x2a74('0x15')](util['format']('[%s][calls][musiconholdstart]',_0x516cf3['uniqueid']),_0x516cf3);channels[_0x516cf3[_0x2a74('0x6')]][_0x2a74('0x3e')]=utils[_0x2a74('0x22')]();utils[_0x2a74('0x8')](util['format'](_0x2a74('0x3f'),_0x516cf3['uniqueid'],channels[_0x516cf3[_0x2a74('0x6')]][_0x2a74('0x3e')]));}}catch(_0x227162){utils[_0x2a74('0x1c')](util['format'](_0x2a74('0x40'),_0x516cf3[_0x2a74('0x6')]),_0x227162);}};exports[_0x2a74('0x41')]=function(_0x51e4fa){try{if(!_[_0x2a74('0x1f')](channels[_0x51e4fa[_0x2a74('0x6')]])){utils[_0x2a74('0x15')](util[_0x2a74('0x9')](_0x2a74('0x42'),_0x51e4fa[_0x2a74('0x6')]),_0x51e4fa);if(!_[_0x2a74('0x1f')](channels[_0x51e4fa['uniqueid']][_0x2a74('0x3e')])){channels[_0x51e4fa[_0x2a74('0x6')]][_0x2a74('0x43')]+=utils['diffTime'](utils[_0x2a74('0x22')](),channels[_0x51e4fa[_0x2a74('0x6')]]['musiconholdstartAt']);utils[_0x2a74('0x8')](util[_0x2a74('0x9')](_0x2a74('0x44'),_0x51e4fa['uniqueid'],channels[_0x51e4fa[_0x2a74('0x6')]]['mohtime']));delete channels[_0x51e4fa[_0x2a74('0x6')]][_0x2a74('0x3e')];}}}catch(_0x105b09){utils[_0x2a74('0x1c')](util[_0x2a74('0x9')]('[%s][calls][musiconholdstop]',_0x51e4fa[_0x2a74('0x6')]),_0x105b09);}};exports[_0x2a74('0x45')]=function(_0x35ce6a){try{if(!_[_0x2a74('0x1f')](channels[_0x35ce6a['uniqueid']])){utils[_0x2a74('0x15')](util['format'](_0x2a74('0x46'),_0x35ce6a['uniqueid']),_0x35ce6a);if(!_[_0x2a74('0x1f')](_0x35ce6a[_0x2a74('0x47')][_0x2a74('0x48')])){utils['info'](util[_0x2a74('0x9')](_0x2a74('0x49'),_0x35ce6a[_0x2a74('0x6')],_0x35ce6a[_0x2a74('0x4a')]));channels[_0x35ce6a[_0x2a74('0x6')]][_0x2a74('0x4b')]=_0x35ce6a[_0x2a74('0x4a')];}if(!_[_0x2a74('0x1f')](_0x35ce6a[_0x2a74('0x47')][_0x2a74('0x4c')])){utils['info'](util[_0x2a74('0x9')](_0x2a74('0x4d'),_0x35ce6a[_0x2a74('0x6')],_0x35ce6a[_0x2a74('0x4a')]));channels[_0x35ce6a[_0x2a74('0x6')]]['destination']=_0x35ce6a[_0x2a74('0x4a')];channels[_0x35ce6a['uniqueid']][_0x2a74('0x2a')]='\x22'+_0x35ce6a[_0x2a74('0x4a')]+_0x2a74('0x4e')+_0x35ce6a[_0x2a74('0x4a')]+'>';}if(!_[_0x2a74('0x1f')](_0x35ce6a[_0x2a74('0x47')][_0x2a74('0x4f')])||!_[_0x2a74('0x1f')](_0x35ce6a[_0x2a74('0x47')]['xmd-callerid'])){utils[_0x2a74('0x8')](util['format'](_0x2a74('0x50'),_0x35ce6a[_0x2a74('0x6')],!_[_0x2a74('0x1f')](_0x35ce6a['variable'][_0x2a74('0x4f')])?_0x2a74('0x4f'):_0x2a74('0x51'),_0x35ce6a['value']));channels[_0x35ce6a[_0x2a74('0x6')]][_0x2a74('0x2a')]=_0x35ce6a[_0x2a74('0x4a')];}if(!_[_0x2a74('0x1f')](_0x35ce6a[_0x2a74('0x47')]['xmd-queue'])||!_[_0x2a74('0x1f')](_0x35ce6a[_0x2a74('0x47')]['xmcs-queue'])){utils['info'](util[_0x2a74('0x9')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x35ce6a['uniqueid'],!_['isNil'](_0x35ce6a[_0x2a74('0x47')][_0x2a74('0x52')])?_0x2a74('0x52'):_0x2a74('0x53'),_0x35ce6a[_0x2a74('0x4a')]));channels[_0x35ce6a[_0x2a74('0x6')]]['lastapplication']=_0x2a74('0x54');channels[_0x35ce6a[_0x2a74('0x6')]][_0x2a74('0x55')]=_0x35ce6a[_0x2a74('0x4a')];channels[_0x35ce6a[_0x2a74('0x6')]][_0x2a74('0x56')]=!![];}if(!_[_0x2a74('0x1f')](_0x35ce6a['variable'][_0x2a74('0x57')])){utils[_0x2a74('0x8')](util[_0x2a74('0x9')](_0x2a74('0x58'),_0x35ce6a['uniqueid'],_0x35ce6a[_0x2a74('0x4a')]));channels[_0x35ce6a[_0x2a74('0x6')]][_0x2a74('0x59')]=_0x35ce6a['value'];}if(!_[_0x2a74('0x1f')](_0x35ce6a[_0x2a74('0x47')][_0x2a74('0x5a')])){utils[_0x2a74('0x8')](util['format'](_0x2a74('0x5b'),_0x35ce6a['uniqueid'],_0x35ce6a['value']));channels[_0x35ce6a[_0x2a74('0x6')]][_0x2a74('0x5c')]=_0x35ce6a['value'];}if(!_['isNil'](_0x35ce6a[_0x2a74('0x47')]['outboundrouteid'])){utils[_0x2a74('0x8')](util[_0x2a74('0x9')]('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x35ce6a[_0x2a74('0x6')],_0x35ce6a[_0x2a74('0x4a')]));channels[_0x35ce6a[_0x2a74('0x6')]][_0x2a74('0x5d')]=_0x35ce6a['value'];}if(!_[_0x2a74('0x1f')](_0x35ce6a[_0x2a74('0x47')][_0x2a74('0x5e')])){utils[_0x2a74('0x8')](util['format'](_0x2a74('0x5f'),_0x35ce6a[_0x2a74('0x6')],_0x35ce6a[_0x2a74('0x4a')]));channels[_0x35ce6a[_0x2a74('0x6')]]['sipcallid']=_0x35ce6a['value'];}}}catch(_0x5a8dc4){utils[_0x2a74('0x1c')](util[_0x2a74('0x9')](_0x2a74('0x46'),_0x35ce6a[_0x2a74('0x6')]),_0x5a8dc4);}};exports['newexten']=function(_0x3778be){try{if(!_['isNil'](channels[_0x3778be['uniqueid']])){utils['debug'](util['format'](_0x2a74('0x60'),_0x3778be[_0x2a74('0x6')]),_0x3778be);utils[_0x2a74('0x8')](util[_0x2a74('0x9')](_0x2a74('0x61'),_0x3778be[_0x2a74('0x6')],_0x3778be['application'],_0x3778be[_0x2a74('0x62')]));if(_0x3778be[_0x2a74('0x63')][_0x2a74('0x64')]()==_0x2a74('0x65')&&_[_0x2a74('0x66')](_0x3778be['appdata']['toLowerCase'](),_0x2a74('0x67'))){var _0x57aeb1=_0x3778be[_0x2a74('0x62')][_0x2a74('0x68')]('=');var _0x32d526=_0x57aeb1[0x0][_0x2a74('0x69')](_0x57aeb1[0x0][_0x2a74('0x6a')]('(')+0x1,_0x57aeb1[0x0][_0x2a74('0x6a')](')'));var _0x39e8f8=_0x57aeb1[0x1];channels[_0x3778be[_0x2a74('0x6')]][_0x32d526]=_0x39e8f8;}if(!_[_0x2a74('0x6b')](['hangup',_0x2a74('0x6c'),_0x2a74('0x6d'),_0x2a74('0x65'),'gotoif'],_0x3778be[_0x2a74('0x63')][_0x2a74('0x64')]())){channels[_0x3778be[_0x2a74('0x6')]]['lastapplication']=_0x3778be[_0x2a74('0x63')];channels[_0x3778be[_0x2a74('0x6')]]['lastdata']=_0x3778be['appdata'];}}}catch(_0x53b638){utils['error'](util[_0x2a74('0x9')](_0x2a74('0x60'),_0x3778be['uniqueid']),_0x53b638);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index fd8fbc9..97bbeab 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 _0x67d0=['error','[core]\x20error','close','[core]\x20close','managerevent','./utils','connect','info','shutdown','[core]\x20shutdown','[core]\x20fullybooted'];(function(_0x103246,_0x244676){var _0x557629=function(_0x5c79a5){while(--_0x5c79a5){_0x103246['push'](_0x103246['shift']());}};_0x557629(++_0x244676);}(_0x67d0,0x118));var _0x067d=function(_0x1d1b07,_0x123071){_0x1d1b07=_0x1d1b07-0x0;var _0x5b05b9=_0x67d0[_0x1d1b07];return _0x5b05b9;};'use strict';var utils=require(_0x067d('0x0'));exports[_0x067d('0x1')]=function(){utils[_0x067d('0x2')]('[core]\x20connected');};exports[_0x067d('0x3')]=function(){utils[_0x067d('0x2')](_0x067d('0x4'));};exports['fullybooted']=function(){utils[_0x067d('0x2')](_0x067d('0x5'));};exports[_0x067d('0x6')]=function(_0x5c2ba7){utils[_0x067d('0x6')](_0x067d('0x7'),_0x5c2ba7);};exports[_0x067d('0x8')]=function(){utils[_0x067d('0x2')](_0x067d('0x9'));};exports[_0x067d('0xa')]=function(_0x3bc8b0){}; \ No newline at end of file +var _0xd08c=['error','[core]\x20error','close','[core]\x20close','managerevent','info','shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0xd08c,0x13b));var _0xcd08=function(_0x5a44ab,_0x19d0b5){_0x5a44ab=_0x5a44ab-0x0;var _0x5af82e=_0xd08c[_0x5a44ab];return _0x5af82e;};'use strict';var utils=require('./utils');exports['connect']=function(){utils[_0xcd08('0x0')]('[core]\x20connected');};exports[_0xcd08('0x1')]=function(){utils['info'](_0xcd08('0x2'));};exports[_0xcd08('0x3')]=function(){utils[_0xcd08('0x0')](_0xcd08('0x4'));};exports[_0xcd08('0x5')]=function(_0x51106f){utils['error'](_0xcd08('0x6'),_0x51106f);};exports[_0xcd08('0x7')]=function(){utils[_0xcd08('0x0')](_0xcd08('0x8'));};exports[_0xcd08('0x9')]=function(_0x1e4829){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 68883c5..08fc0f9 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 _0x4998=['set','startsWith','appdata','cdr(routeid)','split','error','[%s][dials][varset]','isNil','variable','outboundrouteid','info','value','dialbegin','assign','starttime','now','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialbegin]','dialend','[%s][dials][dialend]','ANSWER','answertime','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','duration','endtime','diffTime','billableseconds','lodash','util','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','dialstring','calleridnum','dialstatus','request','CreateVoiceDialReport','uniqueid','debug','[%s][dials][newexten]','application','toLowerCase'];(function(_0x5b1f99,_0x5400b2){var _0x478845=function(_0x463fdc){while(--_0x463fdc){_0x5b1f99['push'](_0x5b1f99['shift']());}};_0x478845(++_0x5400b2);}(_0x4998,0x13b));var _0x8499=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0x4998[_0x4b73a2];return _0x383c66;};'use strict';var _=require(_0x8499('0x0'));var util=require(_0x8499('0x1'));var utils=require('./utils');var dials={};function writeDB(_0x30b30a){utils['info'](util[_0x8499('0x2')](_0x8499('0x3'),_0x30b30a['uniqueid'],_0x30b30a['channel'],_0x30b30a[_0x8499('0x4')],_0x30b30a[_0x8499('0x5')],_0x30b30a['connectedlinenum'],_0x30b30a[_0x8499('0x6')]));utils[_0x8499('0x7')](_0x8499('0x8'),_0x30b30a);delete dials[_0x30b30a[_0x8499('0x9')]];}exports['newexten']=function(_0x3c60c0){try{utils[_0x8499('0xa')](util[_0x8499('0x2')](_0x8499('0xb'),_0x3c60c0[_0x8499('0x9')]),_0x3c60c0);utils['info'](util[_0x8499('0x2')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x3c60c0[_0x8499('0x9')],_0x3c60c0[_0x8499('0xc')],_0x3c60c0['appdata']));if(_0x3c60c0['application'][_0x8499('0xd')]()==_0x8499('0xe')&&_[_0x8499('0xf')](_0x3c60c0[_0x8499('0x10')][_0x8499('0xd')](),_0x8499('0x11'))){var _0x472e1e=_0x3c60c0['appdata'][_0x8499('0x12')]('=');dials[_0x3c60c0[_0x8499('0x9')]]={'routeId':_0x472e1e[0x1]};}}catch(_0x553ae3){utils[_0x8499('0x13')](util[_0x8499('0x2')](_0x8499('0xb'),_0x3c60c0[_0x8499('0x9')]),_0x553ae3);}};exports['varset']=function(_0x577db2){try{utils[_0x8499('0xa')](util[_0x8499('0x2')](_0x8499('0x14'),_0x577db2[_0x8499('0x9')]),_0x577db2);if(!_[_0x8499('0x15')](_0x577db2[_0x8499('0x16')][_0x8499('0x17')])){utils[_0x8499('0x18')](util[_0x8499('0x2')]('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x577db2[_0x8499('0x9')],_0x577db2[_0x8499('0x19')]));dials[_0x577db2['uniqueid']]={'routeId':_0x577db2[_0x8499('0x19')]};}}catch(_0x36092a){utils[_0x8499('0x13')](util[_0x8499('0x2')]('[%s][dials][varset]',_0x577db2[_0x8499('0x9')]),_0x36092a);}};exports[_0x8499('0x1a')]=function(_0x43a484){try{if(!_[_0x8499('0x15')](dials[_0x43a484['uniqueid']])){utils[_0x8499('0xa')](util[_0x8499('0x2')]('[%s][dials][dialbegin]',_0x43a484[_0x8499('0x9')]),_0x43a484);dials[_0x43a484[_0x8499('0x9')]]=_[_0x8499('0x1b')](dials[_0x43a484[_0x8499('0x9')]],_0x43a484);dials[_0x43a484[_0x8499('0x9')]][_0x8499('0x1c')]=utils[_0x8499('0x1d')]();dials[_0x43a484[_0x8499('0x9')]]['lastevent']=_0x8499('0x1e');utils['info'](util['format'](_0x8499('0x1f'),_0x43a484[_0x8499('0x9')],dials[_0x43a484[_0x8499('0x9')]][_0x8499('0x1c')]));}}catch(_0x40440a){utils['error'](util[_0x8499('0x2')](_0x8499('0x20'),_0x43a484['uniqueid']),_0x40440a);}};exports[_0x8499('0x21')]=function(_0x4f8eff){try{if(!_[_0x8499('0x15')](dials[_0x4f8eff[_0x8499('0x9')]])){utils[_0x8499('0xa')](util[_0x8499('0x2')](_0x8499('0x22'),_0x4f8eff[_0x8499('0x9')]),_0x4f8eff);dials[_0x4f8eff['uniqueid']][_0x8499('0x6')]=_0x4f8eff['dialstatus'];if(_0x4f8eff['dialstatus']==_0x8499('0x23')){dials[_0x4f8eff[_0x8499('0x9')]]=_[_0x8499('0x1b')](dials[_0x4f8eff[_0x8499('0x9')]],_0x4f8eff);dials[_0x4f8eff['uniqueid']][_0x8499('0x24')]=utils['now']();dials[_0x4f8eff[_0x8499('0x9')]]['lastevent']='connect';utils[_0x8499('0x18')](util[_0x8499('0x2')](_0x8499('0x25'),_0x4f8eff[_0x8499('0x9')],_0x4f8eff[_0x8499('0x6')],dials[_0x4f8eff[_0x8499('0x9')]][_0x8499('0x24')]));}else{utils['info'](util[_0x8499('0x2')](_0x8499('0x26'),_0x4f8eff[_0x8499('0x9')],_0x4f8eff[_0x8499('0x6')]));}}}catch(_0x409f8e){utils[_0x8499('0x13')](util[_0x8499('0x2')]('[%s][dials][dialend]',_0x4f8eff[_0x8499('0x9')]),_0x409f8e);}};exports[_0x8499('0x27')]=function(_0x3b7e89){try{if(!_[_0x8499('0x15')](dials[_0x3b7e89[_0x8499('0x9')]])){utils[_0x8499('0xa')](util[_0x8499('0x2')](_0x8499('0x28'),_0x3b7e89[_0x8499('0x9')]),_0x3b7e89);utils[_0x8499('0x18')](util[_0x8499('0x2')](_0x8499('0x29'),_0x3b7e89['uniqueid'],_0x3b7e89[_0x8499('0x5')],_0x3b7e89[_0x8499('0x2a')],_0x3b7e89['cause-txt']));dials[_0x3b7e89[_0x8499('0x9')]]=_['assign'](dials[_0x3b7e89[_0x8499('0x9')]],{'endtime':utils[_0x8499('0x1d')](),'lastevent':'complete'});dials[_0x3b7e89[_0x8499('0x9')]][_0x8499('0x2b')]=utils['diffTime'](dials[_0x3b7e89['uniqueid']][_0x8499('0x2c')],dials[_0x3b7e89[_0x8499('0x9')]]['starttime']);dials[_0x3b7e89[_0x8499('0x9')]]['holdtime']=utils[_0x8499('0x2d')](dials[_0x3b7e89[_0x8499('0x9')]][_0x8499('0x24')]||dials[_0x3b7e89[_0x8499('0x9')]][_0x8499('0x2c')],dials[_0x3b7e89[_0x8499('0x9')]]['starttime']);dials[_0x3b7e89[_0x8499('0x9')]][_0x8499('0x2e')]=dials[_0x3b7e89[_0x8499('0x9')]]['answertime']?utils[_0x8499('0x2d')](dials[_0x3b7e89[_0x8499('0x9')]][_0x8499('0x2c')],dials[_0x3b7e89[_0x8499('0x9')]]['answertime']):0x0;writeDB(dials[_0x3b7e89[_0x8499('0x9')]]);}}catch(_0x1ed4df){utils[_0x8499('0x13')](util[_0x8499('0x2')](_0x8499('0x28'),_0x3b7e89[_0x8499('0x9')]),_0x1ed4df);}}; \ No newline at end of file +var _0x5f93=['application','set','startsWith','appdata','toLowerCase','split','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]','starttime','called','error','dialend','[%s][dials][dialend]','ANSWER','answertime','now','lastevent','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','cause-txt','assign','complete','duration','diffTime','endtime','billableseconds','[%s][dials][hangup]','lodash','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','calleridnum','connectedlinenum','dialstatus','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]'];(function(_0x14de00,_0xdf964e){var _0x55150d=function(_0x5d4d69){while(--_0x5d4d69){_0x14de00['push'](_0x14de00['shift']());}};_0x55150d(++_0xdf964e);}(_0x5f93,0x88));var _0x35f9=function(_0x2e2262,_0xa042db){_0x2e2262=_0x2e2262-0x0;var _0x50f55f=_0x5f93[_0x2e2262];return _0x50f55f;};'use strict';var _=require(_0x35f9('0x0'));var util=require('util');var utils=require(_0x35f9('0x1'));var dials={};function writeDB(_0x1210c9){utils[_0x35f9('0x2')](util[_0x35f9('0x3')](_0x35f9('0x4'),_0x1210c9[_0x35f9('0x5')],_0x1210c9[_0x35f9('0x6')],_0x1210c9['dialstring'],_0x1210c9[_0x35f9('0x7')],_0x1210c9[_0x35f9('0x8')],_0x1210c9[_0x35f9('0x9')]));utils['request'](_0x35f9('0xa'),_0x1210c9);delete dials[_0x1210c9[_0x35f9('0x5')]];}exports[_0x35f9('0xb')]=function(_0x56dc97){try{utils[_0x35f9('0xc')](util[_0x35f9('0x3')](_0x35f9('0xd'),_0x56dc97[_0x35f9('0x5')]),_0x56dc97);utils[_0x35f9('0x2')](util[_0x35f9('0x3')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x56dc97['uniqueid'],_0x56dc97['application'],_0x56dc97['appdata']));if(_0x56dc97[_0x35f9('0xe')]['toLowerCase']()==_0x35f9('0xf')&&_[_0x35f9('0x10')](_0x56dc97[_0x35f9('0x11')][_0x35f9('0x12')](),'cdr(routeid)')){var _0x489c15=_0x56dc97[_0x35f9('0x11')][_0x35f9('0x13')]('=');dials[_0x56dc97[_0x35f9('0x5')]]={'routeId':_0x489c15[0x1]};}}catch(_0x569682){utils['error'](util[_0x35f9('0x3')](_0x35f9('0xd'),_0x56dc97[_0x35f9('0x5')]),_0x569682);}};exports['varset']=function(_0x558b6f){try{utils[_0x35f9('0xc')](util['format'](_0x35f9('0x14'),_0x558b6f[_0x35f9('0x5')]),_0x558b6f);if(!_[_0x35f9('0x15')](_0x558b6f[_0x35f9('0x16')][_0x35f9('0x17')])){utils[_0x35f9('0x2')](util['format'](_0x35f9('0x18'),_0x558b6f[_0x35f9('0x5')],_0x558b6f[_0x35f9('0x19')]));dials[_0x558b6f['uniqueid']]={'routeId':_0x558b6f[_0x35f9('0x19')]};}}catch(_0x4a977c){utils['error'](util[_0x35f9('0x3')](_0x35f9('0x14'),_0x558b6f['uniqueid']),_0x4a977c);}};exports[_0x35f9('0x1a')]=function(_0x5b53b4){try{if(!_[_0x35f9('0x15')](dials[_0x5b53b4[_0x35f9('0x5')]])){utils[_0x35f9('0xc')](util['format'](_0x35f9('0x1b'),_0x5b53b4['uniqueid']),_0x5b53b4);dials[_0x5b53b4[_0x35f9('0x5')]]=_['assign'](dials[_0x5b53b4[_0x35f9('0x5')]],_0x5b53b4);dials[_0x5b53b4['uniqueid']][_0x35f9('0x1c')]=utils['now']();dials[_0x5b53b4[_0x35f9('0x5')]]['lastevent']=_0x35f9('0x1d');utils['info'](util[_0x35f9('0x3')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x5b53b4[_0x35f9('0x5')],dials[_0x5b53b4[_0x35f9('0x5')]][_0x35f9('0x1c')]));}}catch(_0x4120d1){utils[_0x35f9('0x1e')](util['format']('[%s][dials][dialbegin]',_0x5b53b4[_0x35f9('0x5')]),_0x4120d1);}};exports[_0x35f9('0x1f')]=function(_0x38b1b6){try{if(!_[_0x35f9('0x15')](dials[_0x38b1b6[_0x35f9('0x5')]])){utils['debug'](util[_0x35f9('0x3')](_0x35f9('0x20'),_0x38b1b6[_0x35f9('0x5')]),_0x38b1b6);dials[_0x38b1b6[_0x35f9('0x5')]][_0x35f9('0x9')]=_0x38b1b6['dialstatus'];if(_0x38b1b6[_0x35f9('0x9')]==_0x35f9('0x21')){dials[_0x38b1b6['uniqueid']]=_['assign'](dials[_0x38b1b6[_0x35f9('0x5')]],_0x38b1b6);dials[_0x38b1b6[_0x35f9('0x5')]][_0x35f9('0x22')]=utils[_0x35f9('0x23')]();dials[_0x38b1b6['uniqueid']][_0x35f9('0x24')]=_0x35f9('0x25');utils[_0x35f9('0x2')](util[_0x35f9('0x3')](_0x35f9('0x26'),_0x38b1b6[_0x35f9('0x5')],_0x38b1b6[_0x35f9('0x9')],dials[_0x38b1b6['uniqueid']][_0x35f9('0x22')]));}else{utils['info'](util['format'](_0x35f9('0x27'),_0x38b1b6[_0x35f9('0x5')],_0x38b1b6[_0x35f9('0x9')]));}}}catch(_0x35b6d6){utils[_0x35f9('0x1e')](util['format'](_0x35f9('0x20'),_0x38b1b6['uniqueid']),_0x35b6d6);}};exports[_0x35f9('0x28')]=function(_0x336c8c){try{if(!_[_0x35f9('0x15')](dials[_0x336c8c[_0x35f9('0x5')]])){utils[_0x35f9('0xc')](util[_0x35f9('0x3')]('[%s][dials][hangup]',_0x336c8c['uniqueid']),_0x336c8c);utils[_0x35f9('0x2')](util[_0x35f9('0x3')](_0x35f9('0x29'),_0x336c8c[_0x35f9('0x5')],_0x336c8c[_0x35f9('0x7')],_0x336c8c['calleridname'],_0x336c8c[_0x35f9('0x2a')]));dials[_0x336c8c[_0x35f9('0x5')]]=_[_0x35f9('0x2b')](dials[_0x336c8c[_0x35f9('0x5')]],{'endtime':utils[_0x35f9('0x23')](),'lastevent':_0x35f9('0x2c')});dials[_0x336c8c[_0x35f9('0x5')]][_0x35f9('0x2d')]=utils[_0x35f9('0x2e')](dials[_0x336c8c[_0x35f9('0x5')]][_0x35f9('0x2f')],dials[_0x336c8c[_0x35f9('0x5')]][_0x35f9('0x1c')]);dials[_0x336c8c[_0x35f9('0x5')]]['holdtime']=utils['diffTime'](dials[_0x336c8c[_0x35f9('0x5')]][_0x35f9('0x22')]||dials[_0x336c8c[_0x35f9('0x5')]][_0x35f9('0x2f')],dials[_0x336c8c['uniqueid']]['starttime']);dials[_0x336c8c['uniqueid']][_0x35f9('0x30')]=dials[_0x336c8c[_0x35f9('0x5')]]['answertime']?utils['diffTime'](dials[_0x336c8c[_0x35f9('0x5')]][_0x35f9('0x2f')],dials[_0x336c8c[_0x35f9('0x5')]][_0x35f9('0x22')]):0x0;writeDB(dials[_0x336c8c[_0x35f9('0x5')]]);}}catch(_0xa51dba){utils[_0x35f9('0x1e')](util[_0x35f9('0x3')](_0x35f9('0x31'),_0x336c8c[_0x35f9('0x5')]),_0xa51dba);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index b883461..46bb765 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 _0x283b=['[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','[%s][index][hangup]','hangup','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','[%s][index][attendedtransfer]','attendedtransfer','varset','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s][index][dialend]','dialend','../../config/environment','xdr','disabled','env','production','local','asterisk','port','username','password','keepConnected','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./recordings.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','[%s][index][devicestatechange]','device','format','debug','[%s][index][agentcalled]','uniqueid','agentcalled','[%s][index][agentringnoanswer]','agentringnoanswer','[%s][index][agentconnect]','agentconnect','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart'];(function(_0x3ac312,_0x5d3903){var _0x36b673=function(_0x254b25){while(--_0x254b25){_0x3ac312['push'](_0x3ac312['shift']());}};_0x36b673(++_0x5d3903);}(_0x283b,0x9b));var _0xb283=function(_0x58e1b0,_0x64e502){_0x58e1b0=_0x58e1b0-0x0;var _0x321c27=_0x283b[_0x58e1b0];return _0x321c27;};var AsteriskManager=require('asterisk-manager');var config=require(_0xb283('0x0'));var utils=require('./utils');var util=require('util');var isXDREnabled=config[_0xb283('0x1')]&&config[_0xb283('0x1')]['disabled']?!config['xdr'][_0xb283('0x2')]:!![];var isProduction=config[_0xb283('0x3')]===_0xb283('0x4')||![];var isLocalAsterisk=config[_0xb283('0x1')]&&config['xdr'][_0xb283('0x5')]===!![]||![];var ami=new AsteriskManager(config[_0xb283('0x6')][_0xb283('0x7')],config[_0xb283('0x6')]['ip'],config[_0xb283('0x6')][_0xb283('0x8')],config[_0xb283('0x6')][_0xb283('0x9')],!![]);ami[_0xb283('0xa')]();if(!isXDREnabled){utils[_0xb283('0xb')](_0xb283('0xc'));}else if(!isProduction&&!isLocalAsterisk){utils[_0xb283('0xb')](_0xb283('0xd'));}else{var agents=require(_0xb283('0xe'));var calls=require('./calls.controller');var queues=require('./queues.controller');var recordings=require(_0xb283('0xf'));var members=require('./members.controller');var dials=require(_0xb283('0x10'));var transfers=require(_0xb283('0x11'));var core=require(_0xb283('0x12'));ami['on'](_0xb283('0x13'),core[_0xb283('0x13')]);ami['on'](_0xb283('0x14'),core[_0xb283('0x14')]);ami['on'](_0xb283('0x15'),core['fullybooted']);ami['on']('error',core[_0xb283('0x16')]);ami['on']('close',core[_0xb283('0x17')]);ami['on'](_0xb283('0x18'),core['managerevent']);ami['on'](_0xb283('0x19'),function(_0x5a7daa){try{utils['debug'](util['format'](_0xb283('0x1a'),_0x5a7daa[_0xb283('0x1b')]),_0x5a7daa);members['devicestatechange'](_0x5a7daa);}catch(_0xda7695){utils['error'](util[_0xb283('0x1c')](_0xb283('0x1a'),_0x5a7daa['device']),_0xda7695);}});ami['on']('agentcalled',function(_0x40bfe1){try{utils[_0xb283('0x1d')](util[_0xb283('0x1c')](_0xb283('0x1e'),_0x40bfe1[_0xb283('0x1f')]),_0x40bfe1);agents[_0xb283('0x20')](_0x40bfe1);}catch(_0xca5172){utils[_0xb283('0x16')](util[_0xb283('0x1c')](_0xb283('0x1e'),_0x40bfe1[_0xb283('0x1f')]),_0xca5172);}});ami['on']('agentringnoanswer',function(_0x4a4da2){try{utils[_0xb283('0x1d')](util['format'](_0xb283('0x21'),_0x4a4da2[_0xb283('0x1f')]),_0x4a4da2);agents[_0xb283('0x22')](_0x4a4da2);}catch(_0x381b17){utils['error'](util[_0xb283('0x1c')](_0xb283('0x21'),_0x4a4da2['uniqueid']),_0x381b17);}});ami['on']('agentconnect',function(_0x1c3b2f){try{utils['debug'](util[_0xb283('0x1c')](_0xb283('0x23'),_0x1c3b2f['uniqueid']),_0x1c3b2f);agents['agentconnect'](_0x1c3b2f);queues[_0xb283('0x24')](_0x1c3b2f);}catch(_0x32dc64){utils[_0xb283('0x16')](util[_0xb283('0x1c')](_0xb283('0x23'),_0x1c3b2f[_0xb283('0x1f')]),_0x32dc64);}});ami['on'](_0xb283('0x25'),function(_0x34ab23){try{utils[_0xb283('0x1d')](util[_0xb283('0x1c')](_0xb283('0x26'),_0x34ab23[_0xb283('0x1f')]),_0x34ab23);agents[_0xb283('0x25')](_0x34ab23);queues[_0xb283('0x25')](_0x34ab23);members[_0xb283('0x25')](_0x34ab23);}catch(_0x146ce1){utils[_0xb283('0x16')](util['format'](_0xb283('0x26'),_0x34ab23[_0xb283('0x1f')]),_0x146ce1);}});ami['on'](_0xb283('0x27'),function(_0x1422ca){try{utils['debug'](util[_0xb283('0x1c')](_0xb283('0x28'),_0x1422ca['uniqueid']),_0x1422ca);agents['queuecallerabandon'](_0x1422ca);queues[_0xb283('0x27')](_0x1422ca);}catch(_0x523e9f){utils[_0xb283('0x16')](util[_0xb283('0x1c')](_0xb283('0x28'),_0x1422ca['uniqueid']),_0x523e9f);}});ami['on'](_0xb283('0x29'),function(_0x1e03f8){try{utils[_0xb283('0x1d')](util[_0xb283('0x1c')](_0xb283('0x2a'),_0x1e03f8['uniqueid']),_0x1e03f8);queues['queuecallerjoin'](_0x1e03f8);recordings[_0xb283('0x29')](_0x1e03f8);}catch(_0x245ee5){utils[_0xb283('0x16')](util[_0xb283('0x1c')](_0xb283('0x2a'),_0x1e03f8['uniqueid']),_0x245ee5);}});ami['on'](_0xb283('0x2b'),function(_0x32edd2){try{utils[_0xb283('0x1d')](util[_0xb283('0x1c')](_0xb283('0x2c'),_0x32edd2[_0xb283('0x1f')]),_0x32edd2);queues['queuecallerleave'](_0x32edd2);}catch(_0x2676fe){utils['error'](util[_0xb283('0x1c')](_0xb283('0x2c'),_0x32edd2['uniqueid']),_0x2676fe);}});ami['on'](_0xb283('0x2d'),function(_0x27e090){try{utils[_0xb283('0x1d')](util['format'](_0xb283('0x2e'),_0x27e090[_0xb283('0x1f')]),_0x27e090);queues[_0xb283('0x2d')](_0x27e090);calls[_0xb283('0x2d')](_0x27e090);}catch(_0x97ec2f){utils[_0xb283('0x16')](util[_0xb283('0x1c')]('[%s][index][musiconholdstart]',_0x27e090[_0xb283('0x1f')]),_0x97ec2f);}});ami['on'](_0xb283('0x2f'),function(_0x339c67){try{utils[_0xb283('0x1d')](util[_0xb283('0x1c')](_0xb283('0x30'),_0x339c67['uniqueid']),_0x339c67);queues['musiconholdstop'](_0x339c67);calls[_0xb283('0x2f')](_0x339c67);}catch(_0x23ba45){utils['error'](util[_0xb283('0x1c')](_0xb283('0x30'),_0x339c67[_0xb283('0x1f')]),_0x23ba45);}});ami['on'](_0xb283('0x31'),function(_0x288e24){try{utils[_0xb283('0x1d')](util['format'](_0xb283('0x32'),_0x288e24[_0xb283('0x1f')]),_0x288e24);calls[_0xb283('0x31')](_0x288e24);recordings[_0xb283('0x31')](_0x288e24);}catch(_0x312a39){utils['error'](util['format'](_0xb283('0x32'),_0x288e24[_0xb283('0x1f')]),_0x312a39);}});ami['on']('hangup',function(_0x2344ea){try{utils[_0xb283('0x1d')](util[_0xb283('0x1c')](_0xb283('0x33'),_0x2344ea[_0xb283('0x1f')]),_0x2344ea);calls[_0xb283('0x34')](_0x2344ea);recordings[_0xb283('0x34')](_0x2344ea);dials['hangup'](_0x2344ea);agents[_0xb283('0x34')](_0x2344ea);queues['hangup'](_0x2344ea);}catch(_0x2d2893){utils[_0xb283('0x16')](util['format']('[%s][index][hangup]',_0x2344ea[_0xb283('0x1f')]),_0x2d2893);}});ami['on']('cdr',function(_0x53dc99){try{utils['debug'](util[_0xb283('0x1c')]('[%s][index][cdr]',_0x53dc99[_0xb283('0x1f')]),_0x53dc99);members['cdr'](_0x53dc99);}catch(_0x3191fc){utils[_0xb283('0x16')](util[_0xb283('0x1c')](_0xb283('0x35'),_0x53dc99['uniqueid']),_0x3191fc);}});ami['on'](_0xb283('0x36'),function(_0xbe8642){try{utils[_0xb283('0x1d')](util[_0xb283('0x1c')](_0xb283('0x37'),_0xbe8642[_0xb283('0x1f')]),_0xbe8642);queues[_0xb283('0x36')](_0xbe8642);agents[_0xb283('0x36')](_0xbe8642);transfers[_0xb283('0x36')](_0xbe8642);recordings[_0xb283('0x36')](_0xbe8642);}catch(_0x1cbc98){utils[_0xb283('0x16')](util[_0xb283('0x1c')](_0xb283('0x37'),_0xbe8642[_0xb283('0x1f')]),_0x1cbc98);}});ami['on']('attendedtransfer',function(_0x1ab185){try{utils[_0xb283('0x1d')](util[_0xb283('0x1c')](_0xb283('0x38'),_0x1ab185['origtransfereruniqueid']),_0x1ab185);queues['attendedtransfer'](_0x1ab185);transfers['attendedtransfer'](_0x1ab185);agents[_0xb283('0x39')](_0x1ab185);calls[_0xb283('0x39')](_0x1ab185);}catch(_0x522a79){utils[_0xb283('0x16')](util[_0xb283('0x1c')](_0xb283('0x38'),_0x1ab185['origtransfereruniqueid']),_0x522a79);}});ami['on']('varset',function(_0x37459a){try{utils[_0xb283('0x1d')](util[_0xb283('0x1c')]('[%s][index][varset]',_0x37459a[_0xb283('0x1f')]),_0x37459a);queues[_0xb283('0x3a')](_0x37459a);recordings[_0xb283('0x3a')](_0x37459a);calls[_0xb283('0x3a')](_0x37459a);dials[_0xb283('0x3a')](_0x37459a);}catch(_0x5a76cd){utils[_0xb283('0x16')](util[_0xb283('0x1c')]('[%s][index][varset]',_0x37459a[_0xb283('0x1f')]),_0x5a76cd);}});ami['on']('newexten',function(_0x8602e4){try{utils[_0xb283('0x1d')](util['format']('[%s][index][newexten]',_0x8602e4[_0xb283('0x1f')]),_0x8602e4);calls[_0xb283('0x3b')](_0x8602e4);recordings[_0xb283('0x3b')](_0x8602e4);dials[_0xb283('0x3b')](_0x8602e4);}catch(_0x580c14){utils[_0xb283('0x16')](util[_0xb283('0x1c')](_0xb283('0x3c'),_0x8602e4[_0xb283('0x1f')]),_0x580c14);}});ami['on'](_0xb283('0x3d'),function(_0x342369){try{utils[_0xb283('0x1d')](util['format'](_0xb283('0x3e'),_0x342369[_0xb283('0x1f')]),_0x342369);calls[_0xb283('0x3d')](_0x342369);recordings[_0xb283('0x3d')](_0x342369);}catch(_0x2424e2){utils[_0xb283('0x16')](util[_0xb283('0x1c')](_0xb283('0x3e'),_0x342369['uniqueid']),_0x2424e2);}});ami['on'](_0xb283('0x3f'),function(_0x2fcbc7){try{utils[_0xb283('0x1d')](util['format'](_0xb283('0x40'),_0x2fcbc7[_0xb283('0x1f')]),_0x2fcbc7);dials['dialbegin'](_0x2fcbc7);}catch(_0x3571df){utils['error'](util[_0xb283('0x1c')]('[%s]dialbegin',_0x2fcbc7[_0xb283('0x1f')]),_0x3571df);}});ami['on']('dialend',function(_0x414c9b){try{utils['debug'](util[_0xb283('0x1c')](_0xb283('0x41'),_0x414c9b[_0xb283('0x1f')]),_0x414c9b);dials[_0xb283('0x42')](_0x414c9b);}catch(_0x219ab9){utils['error'](util[_0xb283('0x1c')](_0xb283('0x41'),_0x414c9b['uniqueid']),_0x219ab9);}});} \ No newline at end of file +var _0x3ded=['dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','./utils','xdr','disabled','production','local','asterisk','port','username','keepConnected','XDR\x20DISABLED','info','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','devicestatechange','debug','[%s][index][devicestatechange]','device','format','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','[%s][index][agentcomplete]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','[%s][index][musiconholdstart]','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]','[%s][index][dialbegin]'];(function(_0x451ad7,_0x4d26e2){var _0x21665b=function(_0x3fd581){while(--_0x3fd581){_0x451ad7['push'](_0x451ad7['shift']());}};_0x21665b(++_0x4d26e2);}(_0x3ded,0x167));var _0xd3de=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x3ded[_0x5783f4];return _0x28e380;};var AsteriskManager=require(_0xd3de('0x0'));var config=require('../../config/environment');var utils=require(_0xd3de('0x1'));var util=require('util');var isXDREnabled=config[_0xd3de('0x2')]&&config[_0xd3de('0x2')][_0xd3de('0x3')]?!config[_0xd3de('0x2')][_0xd3de('0x3')]:!![];var isProduction=config['env']===_0xd3de('0x4')||![];var isLocalAsterisk=config[_0xd3de('0x2')]&&config[_0xd3de('0x2')][_0xd3de('0x5')]===!![]||![];var ami=new AsteriskManager(config[_0xd3de('0x6')][_0xd3de('0x7')],config['asterisk']['ip'],config[_0xd3de('0x6')][_0xd3de('0x8')],config['asterisk']['password'],!![]);ami[_0xd3de('0x9')]();if(!isXDREnabled){utils['info'](_0xd3de('0xa'));}else if(!isProduction&&!isLocalAsterisk){utils[_0xd3de('0xb')](_0xd3de('0xc'));}else{var agents=require(_0xd3de('0xd'));var calls=require(_0xd3de('0xe'));var queues=require('./queues.controller');var recordings=require(_0xd3de('0xf'));var members=require(_0xd3de('0x10'));var dials=require(_0xd3de('0x11'));var transfers=require(_0xd3de('0x12'));var core=require(_0xd3de('0x13'));ami['on'](_0xd3de('0x14'),core[_0xd3de('0x14')]);ami['on'](_0xd3de('0x15'),core[_0xd3de('0x15')]);ami['on'](_0xd3de('0x16'),core[_0xd3de('0x16')]);ami['on']('error',core[_0xd3de('0x17')]);ami['on'](_0xd3de('0x18'),core[_0xd3de('0x18')]);ami['on']('managerevent',core['managerevent']);ami['on'](_0xd3de('0x19'),function(_0x38a5ed){try{utils[_0xd3de('0x1a')](util['format'](_0xd3de('0x1b'),_0x38a5ed[_0xd3de('0x1c')]),_0x38a5ed);members['devicestatechange'](_0x38a5ed);}catch(_0x41181c){utils[_0xd3de('0x17')](util[_0xd3de('0x1d')]('[%s][index][devicestatechange]',_0x38a5ed['device']),_0x41181c);}});ami['on'](_0xd3de('0x1e'),function(_0x5776c9){try{utils[_0xd3de('0x1a')](util['format'](_0xd3de('0x1f'),_0x5776c9[_0xd3de('0x20')]),_0x5776c9);agents['agentcalled'](_0x5776c9);}catch(_0x552eef){utils[_0xd3de('0x17')](util[_0xd3de('0x1d')](_0xd3de('0x1f'),_0x5776c9[_0xd3de('0x20')]),_0x552eef);}});ami['on'](_0xd3de('0x21'),function(_0x5c8faf){try{utils[_0xd3de('0x1a')](util['format'](_0xd3de('0x22'),_0x5c8faf[_0xd3de('0x20')]),_0x5c8faf);agents[_0xd3de('0x21')](_0x5c8faf);}catch(_0x4d5fd1){utils[_0xd3de('0x17')](util['format'](_0xd3de('0x22'),_0x5c8faf[_0xd3de('0x20')]),_0x4d5fd1);}});ami['on'](_0xd3de('0x23'),function(_0x218554){try{utils[_0xd3de('0x1a')](util[_0xd3de('0x1d')](_0xd3de('0x24'),_0x218554[_0xd3de('0x20')]),_0x218554);agents[_0xd3de('0x23')](_0x218554);queues[_0xd3de('0x23')](_0x218554);}catch(_0x28f20a){utils['error'](util[_0xd3de('0x1d')]('[%s][index][agentconnect]',_0x218554[_0xd3de('0x20')]),_0x28f20a);}});ami['on']('agentcomplete',function(_0x567dfe){try{utils['debug'](util['format'](_0xd3de('0x25'),_0x567dfe[_0xd3de('0x20')]),_0x567dfe);agents[_0xd3de('0x26')](_0x567dfe);queues[_0xd3de('0x26')](_0x567dfe);members[_0xd3de('0x26')](_0x567dfe);}catch(_0xa0c7b1){utils[_0xd3de('0x17')](util[_0xd3de('0x1d')](_0xd3de('0x25'),_0x567dfe[_0xd3de('0x20')]),_0xa0c7b1);}});ami['on'](_0xd3de('0x27'),function(_0x38921b){try{utils[_0xd3de('0x1a')](util['format'](_0xd3de('0x28'),_0x38921b[_0xd3de('0x20')]),_0x38921b);agents[_0xd3de('0x27')](_0x38921b);queues[_0xd3de('0x27')](_0x38921b);}catch(_0xdfe7f6){utils[_0xd3de('0x17')](util[_0xd3de('0x1d')]('[%s][index][queuecallerabandon]',_0x38921b['uniqueid']),_0xdfe7f6);}});ami['on'](_0xd3de('0x29'),function(_0xc6151f){try{utils['debug'](util[_0xd3de('0x1d')](_0xd3de('0x2a'),_0xc6151f['uniqueid']),_0xc6151f);queues['queuecallerjoin'](_0xc6151f);recordings['queuecallerjoin'](_0xc6151f);}catch(_0xd602dc){utils['error'](util['format']('[%s][index][queuecallerjoin]',_0xc6151f[_0xd3de('0x20')]),_0xd602dc);}});ami['on']('queuecallerleave',function(_0x3c812f){try{utils[_0xd3de('0x1a')](util[_0xd3de('0x1d')]('[%s][index][queuecallerleave]',_0x3c812f[_0xd3de('0x20')]),_0x3c812f);queues[_0xd3de('0x2b')](_0x3c812f);}catch(_0x66dee5){utils['error'](util[_0xd3de('0x1d')](_0xd3de('0x2c'),_0x3c812f[_0xd3de('0x20')]),_0x66dee5);}});ami['on']('musiconholdstart',function(_0x4db1ef){try{utils['debug'](util[_0xd3de('0x1d')](_0xd3de('0x2d'),_0x4db1ef[_0xd3de('0x20')]),_0x4db1ef);queues[_0xd3de('0x2e')](_0x4db1ef);calls[_0xd3de('0x2e')](_0x4db1ef);}catch(_0x592b66){utils[_0xd3de('0x17')](util[_0xd3de('0x1d')](_0xd3de('0x2d'),_0x4db1ef[_0xd3de('0x20')]),_0x592b66);}});ami['on'](_0xd3de('0x2f'),function(_0x56f68e){try{utils[_0xd3de('0x1a')](util[_0xd3de('0x1d')](_0xd3de('0x30'),_0x56f68e[_0xd3de('0x20')]),_0x56f68e);queues['musiconholdstop'](_0x56f68e);calls[_0xd3de('0x2f')](_0x56f68e);}catch(_0xa0c9d2){utils[_0xd3de('0x17')](util[_0xd3de('0x1d')]('[%s][index][musiconholdstop]',_0x56f68e[_0xd3de('0x20')]),_0xa0c9d2);}});ami['on']('newstate',function(_0x229e2d){try{utils[_0xd3de('0x1a')](util[_0xd3de('0x1d')](_0xd3de('0x31'),_0x229e2d[_0xd3de('0x20')]),_0x229e2d);calls['newstate'](_0x229e2d);recordings[_0xd3de('0x32')](_0x229e2d);}catch(_0xca81d0){utils[_0xd3de('0x17')](util[_0xd3de('0x1d')](_0xd3de('0x31'),_0x229e2d['uniqueid']),_0xca81d0);}});ami['on'](_0xd3de('0x33'),function(_0x56f895){try{utils[_0xd3de('0x1a')](util[_0xd3de('0x1d')](_0xd3de('0x34'),_0x56f895[_0xd3de('0x20')]),_0x56f895);calls[_0xd3de('0x33')](_0x56f895);recordings[_0xd3de('0x33')](_0x56f895);dials[_0xd3de('0x33')](_0x56f895);agents[_0xd3de('0x33')](_0x56f895);queues[_0xd3de('0x33')](_0x56f895);}catch(_0x2a3904){utils[_0xd3de('0x17')](util['format'](_0xd3de('0x34'),_0x56f895['uniqueid']),_0x2a3904);}});ami['on'](_0xd3de('0x35'),function(_0x1779b9){try{utils['debug'](util['format'](_0xd3de('0x36'),_0x1779b9['uniqueid']),_0x1779b9);members[_0xd3de('0x35')](_0x1779b9);}catch(_0x5379ff){utils[_0xd3de('0x17')](util[_0xd3de('0x1d')]('[%s][index][cdr]',_0x1779b9['uniqueid']),_0x5379ff);}});ami['on'](_0xd3de('0x37'),function(_0x441833){try{utils[_0xd3de('0x1a')](util['format'](_0xd3de('0x38'),_0x441833[_0xd3de('0x20')]),_0x441833);queues[_0xd3de('0x37')](_0x441833);agents['blindtransfer'](_0x441833);transfers[_0xd3de('0x37')](_0x441833);recordings[_0xd3de('0x37')](_0x441833);}catch(_0x45894c){utils[_0xd3de('0x17')](util[_0xd3de('0x1d')]('[%s][index][blindtransfer]',_0x441833[_0xd3de('0x20')]),_0x45894c);}});ami['on'](_0xd3de('0x39'),function(_0xbb9415){try{utils['debug'](util[_0xd3de('0x1d')](_0xd3de('0x3a'),_0xbb9415[_0xd3de('0x3b')]),_0xbb9415);queues[_0xd3de('0x39')](_0xbb9415);transfers[_0xd3de('0x39')](_0xbb9415);agents[_0xd3de('0x39')](_0xbb9415);calls[_0xd3de('0x39')](_0xbb9415);}catch(_0x442899){utils[_0xd3de('0x17')](util[_0xd3de('0x1d')](_0xd3de('0x3a'),_0xbb9415['origtransfereruniqueid']),_0x442899);}});ami['on']('varset',function(_0x572f0e){try{utils[_0xd3de('0x1a')](util['format'](_0xd3de('0x3c'),_0x572f0e[_0xd3de('0x20')]),_0x572f0e);queues[_0xd3de('0x3d')](_0x572f0e);recordings[_0xd3de('0x3d')](_0x572f0e);calls[_0xd3de('0x3d')](_0x572f0e);dials['varset'](_0x572f0e);}catch(_0x4a8a96){utils['error'](util[_0xd3de('0x1d')](_0xd3de('0x3c'),_0x572f0e[_0xd3de('0x20')]),_0x4a8a96);}});ami['on'](_0xd3de('0x3e'),function(_0x3fa512){try{utils[_0xd3de('0x1a')](util[_0xd3de('0x1d')](_0xd3de('0x3f'),_0x3fa512[_0xd3de('0x20')]),_0x3fa512);calls[_0xd3de('0x3e')](_0x3fa512);recordings['newexten'](_0x3fa512);dials['newexten'](_0x3fa512);}catch(_0x368311){utils[_0xd3de('0x17')](util['format'](_0xd3de('0x3f'),_0x3fa512[_0xd3de('0x20')]),_0x368311);}});ami['on'](_0xd3de('0x40'),function(_0x50deca){try{utils['debug'](util['format'](_0xd3de('0x41'),_0x50deca['uniqueid']),_0x50deca);calls[_0xd3de('0x40')](_0x50deca);recordings[_0xd3de('0x40')](_0x50deca);}catch(_0x179c5b){utils[_0xd3de('0x17')](util[_0xd3de('0x1d')](_0xd3de('0x41'),_0x50deca[_0xd3de('0x20')]),_0x179c5b);}});ami['on']('dialbegin',function(_0x406364){try{utils[_0xd3de('0x1a')](util[_0xd3de('0x1d')](_0xd3de('0x42'),_0x406364['uniqueid']),_0x406364);dials[_0xd3de('0x43')](_0x406364);}catch(_0x546b2c){utils['error'](util['format'](_0xd3de('0x44'),_0x406364['uniqueid']),_0x546b2c);}});ami['on'](_0xd3de('0x45'),function(_0x45df28){try{utils['debug'](util[_0xd3de('0x1d')](_0xd3de('0x46'),_0x45df28[_0xd3de('0x20')]),_0x45df28);dials[_0xd3de('0x45')](_0x45df28);}catch(_0x3fec19){utils[_0xd3de('0x17')](util[_0xd3de('0x1d')](_0xd3de('0x46'),_0x45df28[_0xd3de('0x20')]),_0x3fec19);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index df6891f..e7055f6 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 _0xd845=['Local/_attended@transfer','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','interface','channel','data2','membername','type','internal','getUserByName','split','then','name','request','CreateMemberReport','catch','error','[%s][members][writeDB]','uniqueid','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','agent','isNil','exitAt','now','duration','diffTime','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','[%s][members][cdr]','data1','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','lodash','util','./utils'];(function(_0x20b235,_0x437a6a){var _0x5d4293=function(_0x2e7566){while(--_0x2e7566){_0x20b235['push'](_0x20b235['shift']());}};_0x5d4293(++_0x437a6a);}(_0xd845,0x135));var _0x5d84=function(_0x55abd9,_0x1148af){_0x55abd9=_0x55abd9-0x0;var _0x3e5669=_0xd845[_0x55abd9];return _0x3e5669;};'use strict';var _=require(_0x5d84('0x0'));var util=require(_0x5d84('0x1'));var utils=require(_0x5d84('0x2'));var members={};var exclude=[_0x5d84('0x3'),'Queue:'];function writeDB(_0x137388){utils[_0x5d84('0x4')](util[_0x5d84('0x5')](_0x5d84('0x6'),_0x137388['uniqueid'],_0x137388[_0x5d84('0x7')],_0x137388[_0x5d84('0x8')],_0x137388[_0x5d84('0x9')],_0x137388[_0x5d84('0xa')],_0x137388[_0x5d84('0xb')]));if(_0x137388[_0x5d84('0x7')]){utils['getUserByInterface'](_0x137388[_0x5d84('0x7')])['then'](function(_0x8958eb){if(_0x8958eb){_0x137388[_0x5d84('0xa')]=_0x8958eb['name'];_0x137388[_0x5d84('0xc')]=_0x8958eb[_0x5d84('0xc')];utils['request']('CreateMemberReport',_0x137388);}else{utils[_0x5d84('0xd')](_0x137388[_0x5d84('0x7')][_0x5d84('0xe')]('/')[0x1])[_0x5d84('0xf')](function(_0xbd2aa3){if(_0xbd2aa3){_0x137388['membername']=_0xbd2aa3[_0x5d84('0x10')];_0x137388[_0x5d84('0xc')]=_0xbd2aa3[_0x5d84('0xc')];utils[_0x5d84('0x11')](_0x5d84('0x12'),_0x137388);}});}})[_0x5d84('0x13')](function(_0x5b06a9){utils[_0x5d84('0x14')](util['format'](_0x5d84('0x15'),_0x137388[_0x5d84('0x16')]),_0x5b06a9);});}delete members[_0x137388[_0x5d84('0x7')]];}function startsWith(_0x47c2bb,_0x25e6b5){return _[_0x5d84('0x17')](_0x47c2bb,function(_0x206c31){return _[_0x5d84('0x18')](_0x25e6b5,_0x206c31);});}exports[_0x5d84('0x19')]=function(_0x4c4dc6){try{utils[_0x5d84('0x1a')](util['format'](_0x5d84('0x1b'),members[_0x4c4dc6['device']]?members[_0x4c4dc6[_0x5d84('0x1c')]][_0x5d84('0x16')]:_0x4c4dc6[_0x5d84('0x1c')]),_0x4c4dc6);utils[_0x5d84('0x4')](util[_0x5d84('0x5')](_0x5d84('0x1d'),members[_0x4c4dc6[_0x5d84('0x1c')]]?members[_0x4c4dc6['device']]['uniqueid']:_0x4c4dc6['device'],_0x4c4dc6[_0x5d84('0x1e')],_0x4c4dc6[_0x5d84('0x1c')]));switch(_0x4c4dc6[_0x5d84('0x1e')]){case _0x5d84('0x1f'):case _0x5d84('0x20'):if(!startsWith(exclude,_0x4c4dc6[_0x5d84('0x1c')])){members[_0x4c4dc6[_0x5d84('0x1c')]]={'channel':'voice','interface':_0x4c4dc6['device'],'type':'TALKING','enterAt':utils['now'](),'role':_0x5d84('0x21')};}break;case'NOT_INUSE':if(!_[_0x5d84('0x22')](members[_0x4c4dc6[_0x5d84('0x1c')]])){members[_0x4c4dc6[_0x5d84('0x1c')]][_0x5d84('0x23')]=utils[_0x5d84('0x24')]();members[_0x4c4dc6['device']][_0x5d84('0x25')]=utils[_0x5d84('0x26')](members[_0x4c4dc6['device']][_0x5d84('0x23')],members[_0x4c4dc6[_0x5d84('0x1c')]]['enterAt']);if(members[_0x4c4dc6[_0x5d84('0x1c')]]['uniqueid']){writeDB(members[_0x4c4dc6[_0x5d84('0x1c')]]);}}break;default:break;}}catch(_0x201974){utils[_0x5d84('0x14')](util['format'](_0x5d84('0x1b'),members[_0x4c4dc6[_0x5d84('0x1c')]]?members[_0x4c4dc6[_0x5d84('0x1c')]][_0x5d84('0x16')]:_0x4c4dc6['device']),_0x201974);}};exports[_0x5d84('0x27')]=function(_0x1a533e){try{if(!_[_0x5d84('0x22')](members[_0x1a533e['interface']])){utils[_0x5d84('0x1a')](util['format'](_0x5d84('0x28'),_0x1a533e['uniqueid']),_0x1a533e);utils[_0x5d84('0x4')](util[_0x5d84('0x5')](_0x5d84('0x29'),_0x1a533e[_0x5d84('0x16')],_0x1a533e['interface'],_0x1a533e[_0x5d84('0x2a')]));members[_0x1a533e[_0x5d84('0x7')]]=_[_0x5d84('0x2b')](members[_0x1a533e[_0x5d84('0x7')]],{'data4':_0x1a533e[_0x5d84('0x2a')],'uniqueid':_0x1a533e[_0x5d84('0x16')]});}}catch(_0x401f54){utils[_0x5d84('0x14')](util[_0x5d84('0x5')](_0x5d84('0x28'),_0x1a533e[_0x5d84('0x16')]),_0x401f54);}};exports[_0x5d84('0x2c')]=function(_0x3b2459){try{utils['debug'](util[_0x5d84('0x5')](_0x5d84('0x2d'),_0x3b2459['uniqueid']),_0x3b2459);if(_0x3b2459[_0x5d84('0x8')]){var _0x53ac22=_0x3b2459[_0x5d84('0x8')][_0x5d84('0xe')]('-')[0x0];if(!_[_0x5d84('0x22')](members[_0x53ac22])){members[_0x53ac22]=_[_0x5d84('0x2b')](members[_0x53ac22],{'data1':members[_0x53ac22][_0x5d84('0x2e')]||_0x3b2459[_0x5d84('0xb')],'data2':members[_0x53ac22][_0x5d84('0x9')]||_0x3b2459[_0x5d84('0x2f')],'data3':members[_0x53ac22][_0x5d84('0x30')]||_0x3b2459[_0x5d84('0x31')],'uniqueid':members[_0x53ac22]['uniqueid']||_0x3b2459[_0x5d84('0x16')]});utils[_0x5d84('0x4')](util[_0x5d84('0x5')](_0x5d84('0x32'),_0x3b2459[_0x5d84('0x16')],members[_0x53ac22][_0x5d84('0x2e')],members[_0x53ac22][_0x5d84('0x9')],members[_0x53ac22]['data3']));if(members[_0x53ac22]['exitAt']){writeDB(members[_0x53ac22]);}}}if(_0x3b2459[_0x5d84('0x33')]){var _0x1d2a46=_0x3b2459[_0x5d84('0x33')][_0x5d84('0xe')]('-')[0x0];if(!_[_0x5d84('0x22')](members[_0x1d2a46])){members[_0x1d2a46]=_[_0x5d84('0x2b')](members[_0x1d2a46],{'data1':members[_0x1d2a46][_0x5d84('0x2e')]||_0x3b2459['type'],'data2':members[_0x1d2a46]['data2']||_0x3b2459[_0x5d84('0x2f')],'data3':members[_0x1d2a46]['data3']||_0x3b2459[_0x5d84('0x31')],'uniqueid':members[_0x1d2a46][_0x5d84('0x16')]||_0x3b2459[_0x5d84('0x16')]});utils[_0x5d84('0x4')](util['format'](_0x5d84('0x32'),_0x3b2459[_0x5d84('0x16')],members[_0x1d2a46]['data1'],members[_0x1d2a46][_0x5d84('0x9')],members[_0x1d2a46][_0x5d84('0x30')]));if(members[_0x1d2a46][_0x5d84('0x23')]){writeDB(members[_0x1d2a46]);}}}}catch(_0x59a348){utils[_0x5d84('0x14')](util[_0x5d84('0x5')](_0x5d84('0x2d'),_0x3b2459[_0x5d84('0x16')]),_0x59a348);}}; \ No newline at end of file +var _0xb3d3=['destination','[%s][members][cdr]','lodash','Local/_attended@transfer','Queue:','info','format','uniqueid','interface','data2','membername','type','getUserByInterface','then','internal','request','getUserByName','split','CreateMemberReport','error','some','startsWith','debug','[%s][members][devicestatechange]','device','INUSE','now','agent','NOT_INUSE','isNil','exitAt','enterAt','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','cdr','channel','assign','data1','source','data3','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel'];(function(_0x284a61,_0x231686){var _0x220e3c=function(_0x104496){while(--_0x104496){_0x284a61['push'](_0x284a61['shift']());}};_0x220e3c(++_0x231686);}(_0xb3d3,0x1ba));var _0x3b3d=function(_0x186d17,_0x9fa8ef){_0x186d17=_0x186d17-0x0;var _0x5d4b89=_0xb3d3[_0x186d17];return _0x5d4b89;};'use strict';var _=require(_0x3b3d('0x0'));var util=require('util');var utils=require('./utils');var members={};var exclude=[_0x3b3d('0x1'),_0x3b3d('0x2')];function writeDB(_0xae959b){utils[_0x3b3d('0x3')](util[_0x3b3d('0x4')]('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0xae959b[_0x3b3d('0x5')],_0xae959b[_0x3b3d('0x6')],_0xae959b['channel'],_0xae959b[_0x3b3d('0x7')],_0xae959b[_0x3b3d('0x8')],_0xae959b[_0x3b3d('0x9')]));if(_0xae959b[_0x3b3d('0x6')]){utils[_0x3b3d('0xa')](_0xae959b[_0x3b3d('0x6')])[_0x3b3d('0xb')](function(_0x350d2d){if(_0x350d2d){_0xae959b[_0x3b3d('0x8')]=_0x350d2d['name'];_0xae959b['internal']=_0x350d2d[_0x3b3d('0xc')];utils[_0x3b3d('0xd')]('CreateMemberReport',_0xae959b);}else{utils[_0x3b3d('0xe')](_0xae959b[_0x3b3d('0x6')][_0x3b3d('0xf')]('/')[0x1])[_0x3b3d('0xb')](function(_0x4e18e7){if(_0x4e18e7){_0xae959b[_0x3b3d('0x8')]=_0x4e18e7['name'];_0xae959b[_0x3b3d('0xc')]=_0x4e18e7[_0x3b3d('0xc')];utils[_0x3b3d('0xd')](_0x3b3d('0x10'),_0xae959b);}});}})['catch'](function(_0x2f707a){utils[_0x3b3d('0x11')](util[_0x3b3d('0x4')]('[%s][members][writeDB]',_0xae959b[_0x3b3d('0x5')]),_0x2f707a);});}delete members[_0xae959b[_0x3b3d('0x6')]];}function startsWith(_0x5ace44,_0x5af0f6){return _[_0x3b3d('0x12')](_0x5ace44,function(_0xbc607d){return _[_0x3b3d('0x13')](_0x5af0f6,_0xbc607d);});}exports['devicestatechange']=function(_0x2cda55){try{utils[_0x3b3d('0x14')](util[_0x3b3d('0x4')](_0x3b3d('0x15'),members[_0x2cda55['device']]?members[_0x2cda55[_0x3b3d('0x16')]]['uniqueid']:_0x2cda55['device']),_0x2cda55);utils[_0x3b3d('0x3')](util[_0x3b3d('0x4')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x2cda55[_0x3b3d('0x16')]]?members[_0x2cda55[_0x3b3d('0x16')]][_0x3b3d('0x5')]:_0x2cda55[_0x3b3d('0x16')],_0x2cda55['state'],_0x2cda55[_0x3b3d('0x16')]));switch(_0x2cda55['state']){case _0x3b3d('0x17'):case'BUSY':if(!startsWith(exclude,_0x2cda55[_0x3b3d('0x16')])){members[_0x2cda55[_0x3b3d('0x16')]]={'channel':'voice','interface':_0x2cda55[_0x3b3d('0x16')],'type':'TALKING','enterAt':utils[_0x3b3d('0x18')](),'role':_0x3b3d('0x19')};}break;case _0x3b3d('0x1a'):if(!_[_0x3b3d('0x1b')](members[_0x2cda55[_0x3b3d('0x16')]])){members[_0x2cda55[_0x3b3d('0x16')]][_0x3b3d('0x1c')]=utils[_0x3b3d('0x18')]();members[_0x2cda55[_0x3b3d('0x16')]]['duration']=utils['diffTime'](members[_0x2cda55['device']][_0x3b3d('0x1c')],members[_0x2cda55[_0x3b3d('0x16')]][_0x3b3d('0x1d')]);if(members[_0x2cda55[_0x3b3d('0x16')]][_0x3b3d('0x5')]){writeDB(members[_0x2cda55['device']]);}}break;default:break;}}catch(_0x534bcb){utils[_0x3b3d('0x11')](util['format'](_0x3b3d('0x15'),members[_0x2cda55['device']]?members[_0x2cda55[_0x3b3d('0x16')]]['uniqueid']:_0x2cda55[_0x3b3d('0x16')]),_0x534bcb);}};exports[_0x3b3d('0x1e')]=function(_0x2339f2){try{if(!_[_0x3b3d('0x1b')](members[_0x2339f2[_0x3b3d('0x6')]])){utils[_0x3b3d('0x14')](util[_0x3b3d('0x4')](_0x3b3d('0x1f'),_0x2339f2['uniqueid']),_0x2339f2);utils[_0x3b3d('0x3')](util[_0x3b3d('0x4')](_0x3b3d('0x20'),_0x2339f2[_0x3b3d('0x5')],_0x2339f2[_0x3b3d('0x6')],_0x2339f2[_0x3b3d('0x21')]));members[_0x2339f2['interface']]=_['assign'](members[_0x2339f2['interface']],{'data4':_0x2339f2['queue'],'uniqueid':_0x2339f2[_0x3b3d('0x5')]});}}catch(_0x5b84d2){utils['error'](util[_0x3b3d('0x4')](_0x3b3d('0x1f'),_0x2339f2[_0x3b3d('0x5')]),_0x5b84d2);}};exports[_0x3b3d('0x22')]=function(_0x38bfd1){try{utils[_0x3b3d('0x14')](util[_0x3b3d('0x4')]('[%s][members][cdr]',_0x38bfd1[_0x3b3d('0x5')]),_0x38bfd1);if(_0x38bfd1[_0x3b3d('0x23')]){var _0x488224=_0x38bfd1[_0x3b3d('0x23')][_0x3b3d('0xf')]('-')[0x0];if(!_[_0x3b3d('0x1b')](members[_0x488224])){members[_0x488224]=_[_0x3b3d('0x24')](members[_0x488224],{'data1':members[_0x488224][_0x3b3d('0x25')]||_0x38bfd1[_0x3b3d('0x9')],'data2':members[_0x488224][_0x3b3d('0x7')]||_0x38bfd1[_0x3b3d('0x26')],'data3':members[_0x488224][_0x3b3d('0x27')]||_0x38bfd1['destination'],'uniqueid':members[_0x488224][_0x3b3d('0x5')]||_0x38bfd1[_0x3b3d('0x5')]});utils[_0x3b3d('0x3')](util[_0x3b3d('0x4')](_0x3b3d('0x28'),_0x38bfd1[_0x3b3d('0x5')],members[_0x488224][_0x3b3d('0x25')],members[_0x488224]['data2'],members[_0x488224][_0x3b3d('0x27')]));if(members[_0x488224][_0x3b3d('0x1c')]){writeDB(members[_0x488224]);}}}if(_0x38bfd1[_0x3b3d('0x29')]){var _0x469661=_0x38bfd1[_0x3b3d('0x29')][_0x3b3d('0xf')]('-')[0x0];if(!_[_0x3b3d('0x1b')](members[_0x469661])){members[_0x469661]=_[_0x3b3d('0x24')](members[_0x469661],{'data1':members[_0x469661][_0x3b3d('0x25')]||_0x38bfd1[_0x3b3d('0x9')],'data2':members[_0x469661][_0x3b3d('0x7')]||_0x38bfd1[_0x3b3d('0x26')],'data3':members[_0x469661]['data3']||_0x38bfd1[_0x3b3d('0x2a')],'uniqueid':members[_0x469661][_0x3b3d('0x5')]||_0x38bfd1[_0x3b3d('0x5')]});utils['info'](util['format']('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x38bfd1[_0x3b3d('0x5')],members[_0x469661][_0x3b3d('0x25')],members[_0x469661][_0x3b3d('0x7')],members[_0x469661][_0x3b3d('0x27')]));if(members[_0x469661]['exitAt']){writeDB(members[_0x469661]);}}}}catch(_0x2d1545){utils[_0x3b3d('0x11')](util[_0x3b3d('0x4')](_0x3b3d('0x2b'),_0x38bfd1['uniqueid']),_0x2d1545);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index fa332d8..28e8e96 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 _0x334e=['accountcode','queuecallerexitreason','queue','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','position','assign','error','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','variable','queuestatus','value','CONTINUE','now','toUpperCase','queueposition','queuecallerabandonAt','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','connectedlinename','holdtime','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','lastAssignedTo','[%s][queues][agentconnect]','agentcomplete','queuecallercomplete','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]','blindtransfer','[%s][queues][blindtransfer]','transfereeuniqueid','BLIND','transferexten','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','transfertype','ATTENDED','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','calleridnum'];(function(_0x723288,_0x361804){var _0x45fecf=function(_0x39fbe1){while(--_0x39fbe1){_0x723288['push'](_0x723288['shift']());}};_0x45fecf(++_0x361804);}(_0x334e,0x136));var _0xe334=function(_0x102713,_0x460fe0){_0x102713=_0x102713-0x0;var _0x443282=_0x334e[_0x102713];return _0x443282;};'use strict';var _=require(_0xe334('0x0'));var util=require(_0xe334('0x1'));var utils=require('./utils');var queues={};function writeDB(_0x3e02c8){utils[_0xe334('0x2')](util[_0xe334('0x3')](_0xe334('0x4'),_0x3e02c8[_0xe334('0x5')],_0x3e02c8[_0xe334('0x6')],_0x3e02c8['queue'],_0x3e02c8['lastAssignedTo'],_0x3e02c8[_0xe334('0x7')],_0x3e02c8[_0xe334('0x8')],_0x3e02c8[_0xe334('0x9')]));if(_0x3e02c8[_0xe334('0xa')]){utils[_0xe334('0xb')](_0x3e02c8[_0xe334('0xa')])[_0xe334('0xc')](function(_0x55a1d9){if(_0x55a1d9){_0x3e02c8[_0xe334('0xd')]=_0x55a1d9[_0xe334('0xd')];}utils[_0xe334('0xe')](_0xe334('0xf'),_0x3e02c8);});}else{utils[_0xe334('0xe')](_0xe334('0xf'),_0x3e02c8);}if(_0x3e02c8['transfereduniqueid']){delete queues[_0x3e02c8[_0xe334('0x10')]];}else{delete queues[_0x3e02c8[_0xe334('0x5')]];}}exports[_0xe334('0x11')]=function(_0x43e8f7){try{utils[_0xe334('0x12')](util[_0xe334('0x3')](_0xe334('0x13'),_0x43e8f7[_0xe334('0x5')]),_0x43e8f7);utils[_0xe334('0x2')](util[_0xe334('0x3')]('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x43e8f7['uniqueid'],_0x43e8f7[_0xe334('0xa')],_0x43e8f7[_0xe334('0x14')]));queues[_0x43e8f7[_0xe334('0x5')]]=_[_0xe334('0x15')](_0x43e8f7,{'originalposition':_0x43e8f7['position'],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x4f027a){utils[_0xe334('0x16')](util[_0xe334('0x3')](_0xe334('0x13'),_0x43e8f7['uniqueid']),_0x4f027a);}};exports[_0xe334('0x17')]=function(_0x1d90ba){try{if(!_[_0xe334('0x18')](queues[_0x1d90ba[_0xe334('0x5')]])){utils[_0xe334('0x12')](util[_0xe334('0x3')](_0xe334('0x19'),_0x1d90ba[_0xe334('0x5')]),_0x1d90ba);if(queues[_0x1d90ba[_0xe334('0x5')]][_0xe334('0x1a')]){if(!queues[_0x1d90ba[_0xe334('0x5')]][_0xe334('0x1b')]&&!queues[_0x1d90ba[_0xe334('0x5')]][_0xe334('0x1c')]){queues[_0x1d90ba[_0xe334('0x5')]]['queuecallercomplete']=!![];queues[_0x1d90ba[_0xe334('0x5')]][_0xe334('0x1d')]=utils['now']();queues[_0x1d90ba[_0xe334('0x5')]][_0xe334('0x9')]=_0xe334('0x1e');}utils[_0xe334('0x2')](util[_0xe334('0x3')](_0xe334('0x1f'),_0x1d90ba[_0xe334('0x5')],queues[_0x1d90ba[_0xe334('0x5')]][_0xe334('0x20')],queues[_0x1d90ba[_0xe334('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x1d90ba['uniqueid']]);}else if(queues[_0x1d90ba[_0xe334('0x5')]][_0xe334('0x10')]){utils[_0xe334('0x2')](util[_0xe334('0x3')](_0xe334('0x21'),_0x1d90ba['uniqueid'],queues[_0x1d90ba['uniqueid']][_0xe334('0x20')],queues[_0x1d90ba['uniqueid']][_0xe334('0x10')]));queues[queues[_0x1d90ba[_0xe334('0x5')]][_0xe334('0x10')]]=queues[_0x1d90ba[_0xe334('0x5')]];queues[queues[_0x1d90ba['uniqueid']]['transfereduniqueid']][_0xe334('0x22')]=0x2;delete queues[_0x1d90ba[_0xe334('0x5')]];}}}catch(_0x4a4ba4){utils[_0xe334('0x16')](util[_0xe334('0x3')](_0xe334('0x19'),_0x1d90ba[_0xe334('0x5')]),_0x4a4ba4);}};exports['varset']=function(_0x56085b){try{utils[_0xe334('0x12')](util[_0xe334('0x3')]('[%s][queues][varset]',_0x56085b[_0xe334('0x5')]),_0x56085b);if(!_['isNil'](_0x56085b[_0xe334('0x23')][_0xe334('0x24')])&&_0x56085b[_0xe334('0x25')]['toUpperCase']()!==_0xe334('0x26')){if(!_['isNil'](queues[_0x56085b[_0xe334('0x5')]])){queues[_0x56085b[_0xe334('0x5')]]['queuecallerabandon']=![];queues[_0x56085b[_0xe334('0x5')]]['queuecallerabandonAt']=null;queues[_0x56085b['uniqueid']]['queuecallerexit']=!![];queues[_0x56085b['uniqueid']]['queuecallerexitAt']=utils[_0xe334('0x27')]();queues[_0x56085b['uniqueid']][_0xe334('0x9')]=_0x56085b['value'][_0xe334('0x28')]();utils[_0xe334('0x2')](util[_0xe334('0x3')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x56085b[_0xe334('0x5')],queues[_0x56085b[_0xe334('0x5')]]['name'],_0x56085b[_0xe334('0x25')],queues[_0x56085b['uniqueid']][_0xe334('0x9')]));writeDB(queues[_0x56085b[_0xe334('0x5')]]);}}else if(!_[_0xe334('0x18')](_0x56085b[_0xe334('0x23')][_0xe334('0x29')])){if(!_['isNil'](queues[_0x56085b['uniqueid']])&&!queues[_0x56085b[_0xe334('0x5')]]['queuecallerabandon']){queues[_0x56085b[_0xe334('0x5')]][_0xe334('0x1b')]=![];queues[_0x56085b[_0xe334('0x5')]][_0xe334('0x2a')]=null;queues[_0x56085b[_0xe334('0x5')]]['queuecallerexit']=!![];queues[_0x56085b[_0xe334('0x5')]]['queuecallerexitAt']=utils[_0xe334('0x27')]();queues[_0x56085b[_0xe334('0x5')]][_0xe334('0x9')]=_0xe334('0x2b');utils['info'](util[_0xe334('0x3')](_0xe334('0x2c'),_0x56085b[_0xe334('0x5')],queues[_0x56085b[_0xe334('0x5')]][_0xe334('0x20')],_0x56085b['value'],queues[_0x56085b[_0xe334('0x5')]][_0xe334('0x9')]));}}}catch(_0x1fc92c){utils[_0xe334('0x16')](util[_0xe334('0x3')]('[%s][queues][varset]',_0x56085b[_0xe334('0x5')]),_0x1fc92c);}};exports[_0xe334('0x1b')]=function(_0x37e50b){try{if(!_[_0xe334('0x18')](queues[_0x37e50b[_0xe334('0x5')]])){utils['debug'](util[_0xe334('0x3')](_0xe334('0x2d'),_0x37e50b[_0xe334('0x5')]),_0x37e50b);queues[_0x37e50b['uniqueid']]['queuecallerexit']=![];queues[_0x37e50b[_0xe334('0x5')]][_0xe334('0x2e')]=null;queues[_0x37e50b[_0xe334('0x5')]][_0xe334('0x1b')]=!![];queues[_0x37e50b[_0xe334('0x5')]][_0xe334('0x2a')]=utils[_0xe334('0x27')]();queues[_0x37e50b[_0xe334('0x5')]][_0xe334('0x9')]=_0xe334('0x2f');utils['info'](util[_0xe334('0x3')](_0xe334('0x30'),_0x37e50b[_0xe334('0x5')],queues[_0x37e50b[_0xe334('0x5')]][_0xe334('0x20')],queues[_0x37e50b[_0xe334('0x5')]]['queuecallerexitreason']));}}catch(_0x247f81){utils[_0xe334('0x16')](util[_0xe334('0x3')](_0xe334('0x2d'),_0x37e50b[_0xe334('0x5')]),_0x247f81);}};exports[_0xe334('0x31')]=function(_0x4c586b){try{if(!_[_0xe334('0x18')](queues[_0x4c586b[_0xe334('0x5')]])){utils[_0xe334('0x12')](util[_0xe334('0x3')](_0xe334('0x32'),_0x4c586b[_0xe334('0x5')]),_0x4c586b);utils[_0xe334('0x2')](util['format'](_0xe334('0x33'),_0x4c586b[_0xe334('0x5')],queues[_0x4c586b[_0xe334('0x5')]][_0xe334('0x20')],_0x4c586b[_0xe334('0x34')],_0x4c586b[_0xe334('0x35')]));queues[_0x4c586b[_0xe334('0x5')]][_0xe334('0x31')]=!![];queues[_0x4c586b[_0xe334('0x5')]][_0xe334('0x1a')]=utils['now']();queues[_0x4c586b[_0xe334('0x5')]][_0xe334('0x36')]=utils[_0xe334('0x37')](queues[_0x4c586b[_0xe334('0x5')]][_0xe334('0x1a')],queues[_0x4c586b[_0xe334('0x5')]][_0xe334('0x38')]);queues[_0x4c586b['uniqueid']][_0xe334('0x14')]=_0x4c586b[_0xe334('0x14')];queues[_0x4c586b['uniqueid']][_0xe334('0x39')]=_0x4c586b[_0xe334('0x39')];queues[_0x4c586b[_0xe334('0x5')]]['connectedlinenum']=_0x4c586b[_0xe334('0x34')];queues[_0x4c586b[_0xe334('0x5')]][_0xe334('0x35')]=_0x4c586b[_0xe334('0x35')];}}catch(_0x277113){utils[_0xe334('0x16')](util[_0xe334('0x3')](_0xe334('0x32'),_0x4c586b[_0xe334('0x5')]),_0x277113);}};exports[_0xe334('0x3a')]=function(_0x4b1601){try{if(!_[_0xe334('0x18')](queues[_0x4b1601[_0xe334('0x5')]])){utils[_0xe334('0x12')](util[_0xe334('0x3')]('[%s][queues][agentconnect]',_0x4b1601[_0xe334('0x5')]),_0x4b1601);utils['info'](util[_0xe334('0x3')](_0xe334('0x3b'),_0x4b1601[_0xe334('0x5')],queues[_0x4b1601['uniqueid']]['name'],_0x4b1601[_0xe334('0x3c')],_0x4b1601[_0xe334('0x3d')]));queues[_0x4b1601['uniqueid']][_0xe334('0x1b')]=![];queues[_0x4b1601[_0xe334('0x5')]]['queuecallerabandon']=![];queues[_0x4b1601[_0xe334('0x5')]][_0xe334('0x2a')]=null;queues[_0x4b1601[_0xe334('0x5')]][_0xe334('0x1c')]=![];queues[_0x4b1601['uniqueid']][_0xe334('0x9')]=null;queues[_0x4b1601[_0xe334('0x5')]][_0xe334('0x2e')]=null;queues[_0x4b1601['uniqueid']][_0xe334('0x3e')]=!![];queues[_0x4b1601['uniqueid']][_0xe334('0x8')]=_0x4b1601['destaccountcode'];queues[_0x4b1601[_0xe334('0x5')]][_0xe334('0x3f')]=_0x4b1601[_0xe334('0x3c')];}}catch(_0x330927){utils[_0xe334('0x16')](util['format'](_0xe334('0x40'),_0x4b1601[_0xe334('0x5')]),_0x330927);}};exports[_0xe334('0x41')]=function(_0x101414){try{if(!_['isNil'](queues[_0x101414[_0xe334('0x5')]])){if(queues[_0x101414[_0xe334('0x5')]][_0xe334('0x1a')]){utils[_0xe334('0x12')](util[_0xe334('0x3')]('[%s][queues][agentcomplete]',_0x101414[_0xe334('0x5')]),_0x101414);queues[_0x101414[_0xe334('0x5')]][_0xe334('0x1b')]=![];queues[_0x101414[_0xe334('0x5')]][_0xe334('0x1b')]=![];queues[_0x101414[_0xe334('0x5')]][_0xe334('0x2a')]=null;queues[_0x101414[_0xe334('0x5')]][_0xe334('0x1c')]=![];queues[_0x101414[_0xe334('0x5')]][_0xe334('0x2e')]=null;queues[_0x101414[_0xe334('0x5')]]['assigned']=!![];queues[_0x101414[_0xe334('0x5')]][_0xe334('0x3f')]=_0x101414[_0xe334('0x3c')];queues[_0x101414['uniqueid']][_0xe334('0x42')]=!![];queues[_0x101414['uniqueid']]['queuecallercompleteAt']=utils['now']();if(_0x101414[_0xe334('0x43')]=='transfer'){if(!queues[_0x101414['uniqueid']][_0xe334('0x44')]){queues[_0x101414[_0xe334('0x5')]][_0xe334('0x9')]=_0xe334('0x45');}}else{queues[_0x101414[_0xe334('0x5')]][_0xe334('0x9')]=_0xe334('0x46')+_0x101414[_0xe334('0x43')][_0xe334('0x28')]();}utils['info'](util[_0xe334('0x3')]('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x101414[_0xe334('0x5')],queues[_0x101414[_0xe334('0x5')]][_0xe334('0x20')],_0x101414['membername'],queues[_0x101414[_0xe334('0x5')]][_0xe334('0x9')]));writeDB(queues[_0x101414[_0xe334('0x5')]]);}}}catch(_0xc2a6f7){utils[_0xe334('0x16')](util[_0xe334('0x3')](_0xe334('0x47'),_0x101414[_0xe334('0x5')]),_0xc2a6f7);}};exports[_0xe334('0x48')]=function(_0x4fe3b0){try{if(!_[_0xe334('0x18')](queues[_0x4fe3b0['transfereeuniqueid']])){utils[_0xe334('0x12')](util[_0xe334('0x3')](_0xe334('0x49'),_0x4fe3b0['uniqueid']),_0x4fe3b0);queues[_0x4fe3b0[_0xe334('0x4a')]]['transfer']=!![];queues[_0x4fe3b0['transfereeuniqueid']]['transfertype']=_0xe334('0x4b');queues[_0x4fe3b0[_0xe334('0x4a')]][_0xe334('0x4c')]=_0x4fe3b0[_0xe334('0x4d')];queues[_0x4fe3b0[_0xe334('0x4a')]][_0xe334('0x4e')]=_0x4fe3b0[_0xe334('0x4a')];queues[_0x4fe3b0[_0xe334('0x4a')]][_0xe334('0x9')]='BLINDTRANSFER';utils[_0xe334('0x2')](util[_0xe334('0x3')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x4fe3b0[_0xe334('0x5')],queues[_0x4fe3b0['transfereeuniqueid']]['name'],_0x4fe3b0[_0xe334('0x4a')],_0x4fe3b0[_0xe334('0x4d')]));}}catch(_0x4d31c3){utils['error'](util[_0xe334('0x3')](_0xe334('0x49'),_0x4fe3b0[_0xe334('0x5')]),_0x4d31c3);}};exports[_0xe334('0x4f')]=function(_0x24a6d9){try{utils[_0xe334('0x12')](util[_0xe334('0x3')]('[%s][queues][attendedtransfer]',_0x24a6d9[_0xe334('0x50')]),_0x24a6d9);if(_0x24a6d9[_0xe334('0x50')]==_0x24a6d9[_0xe334('0x51')]){if(!_['isNil'](queues[_0x24a6d9[_0xe334('0x52')]])){utils[_0xe334('0x2')](util[_0xe334('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x24a6d9[_0xe334('0x50')],queues[_0x24a6d9['secondtransfererlinkedid']][_0xe334('0x20')],_0x24a6d9['origtransfererexten']));queues[_0x24a6d9['secondtransfererlinkedid']]['transfer']=!![];queues[_0x24a6d9[_0xe334('0x52')]][_0xe334('0x53')]=_0xe334('0x54');queues[_0x24a6d9[_0xe334('0x52')]][_0xe334('0x4c')]=_0x24a6d9[_0xe334('0x55')];queues[_0x24a6d9[_0xe334('0x52')]][_0xe334('0x4e')]=_0x24a6d9['origtransfereruniqueid'];queues[_0x24a6d9[_0xe334('0x52')]][_0xe334('0x9')]=_0xe334('0x56');}if(!_[_0xe334('0x18')](queues[_0x24a6d9[_0xe334('0x51')]])){if(_0x24a6d9[_0xe334('0x57')]&&queues[_0x24a6d9[_0xe334('0x57')]]){queues[_0x24a6d9[_0xe334('0x57')]][_0xe334('0x22')]=0x1;queues[_0x24a6d9[_0xe334('0x4a')]]=_[_0xe334('0x58')](queues[_0x24a6d9[_0xe334('0x57')]]);queues[_0x24a6d9['transfereeuniqueid']][_0xe334('0x10')]=_0x24a6d9[_0xe334('0x59')];queues[_0x24a6d9['transfereeuniqueid']][_0xe334('0x22')]=0x2;queues[_0x24a6d9['transfereeuniqueid']][_0xe334('0x7')]=queues[_0x24a6d9[_0xe334('0x52')]][_0xe334('0x7')];queues[_0x24a6d9[_0xe334('0x4a')]]['calleridname']=queues[_0x24a6d9[_0xe334('0x52')]][_0xe334('0x5a')];queues[_0x24a6d9[_0xe334('0x4a')]][_0xe334('0x38')]=utils['now']();queues[_0x24a6d9[_0xe334('0x4a')]][_0xe334('0x1a')]=utils[_0xe334('0x27')]();queues[_0x24a6d9[_0xe334('0x4a')]][_0xe334('0x36')]=0x0;queues[_0x24a6d9[_0xe334('0x4a')]][_0xe334('0x5b')]=0x0;utils[_0xe334('0x2')](util[_0xe334('0x3')](_0xe334('0x5c'),_0x24a6d9[_0xe334('0x50')],queues[_0x24a6d9[_0xe334('0x4a')]][_0xe334('0x20')],queues[_0x24a6d9[_0xe334('0x4a')]][_0xe334('0x7')],queues[_0x24a6d9['transfereeuniqueid']][_0xe334('0x5a')]));}else{utils[_0xe334('0x2')](util[_0xe334('0x3')](_0xe334('0x5d'),_0x24a6d9[_0xe334('0x50')],queues[_0x24a6d9[_0xe334('0x51')]][_0xe334('0x20')],_0x24a6d9[_0xe334('0x52')]));queues[_0x24a6d9[_0xe334('0x51')]][_0xe334('0x10')]=_0x24a6d9['secondtransfererlinkedid'];}}}else if(_0x24a6d9[_0xe334('0x5e')]==_0x24a6d9[_0xe334('0x52')]){if(!_[_0xe334('0x18')](queues[_0x24a6d9[_0xe334('0x51')]])){utils['info'](util[_0xe334('0x3')](_0xe334('0x5f'),_0x24a6d9[_0xe334('0x50')],queues[_0x24a6d9[_0xe334('0x51')]][_0xe334('0x20')],_0x24a6d9['secondtransfereruniqueid'],_0x24a6d9[_0xe334('0x60')]));queues[_0x24a6d9['origtransfererlinkedid']]['transfer']=!![];queues[_0x24a6d9[_0xe334('0x51')]][_0xe334('0x53')]=_0xe334('0x54');queues[_0x24a6d9['origtransfererlinkedid']][_0xe334('0x4c')]=_0x24a6d9[_0xe334('0x60')];queues[_0x24a6d9[_0xe334('0x51')]][_0xe334('0x4e')]=_0x24a6d9[_0xe334('0x5e')];queues[_0x24a6d9[_0xe334('0x51')]][_0xe334('0x9')]=_0xe334('0x56');}if(!_['isNil'](queues[_0x24a6d9[_0xe334('0x52')]])){if(_0x24a6d9[_0xe334('0x61')]&&queues[_0x24a6d9[_0xe334('0x61')]]){queues[_0x24a6d9[_0xe334('0x61')]][_0xe334('0x22')]=0x1;queues[_0x24a6d9[_0xe334('0x59')]]=_[_0xe334('0x58')](queues[_0x24a6d9['transfertargetlinkedid']]);queues[_0x24a6d9[_0xe334('0x59')]][_0xe334('0x10')]=_0x24a6d9[_0xe334('0x59')];queues[_0x24a6d9['transfertargetuniqueid']][_0xe334('0x22')]=0x2;queues[_0x24a6d9[_0xe334('0x59')]]['calleridnum']=queues[_0x24a6d9[_0xe334('0x51')]][_0xe334('0x7')];queues[_0x24a6d9[_0xe334('0x59')]][_0xe334('0x5a')]=queues[_0x24a6d9[_0xe334('0x51')]][_0xe334('0x5a')];queues[_0x24a6d9[_0xe334('0x59')]][_0xe334('0x38')]=utils['now']();queues[_0x24a6d9['transfertargetuniqueid']]['queuecallerleaveAt']=utils[_0xe334('0x27')]();queues[_0x24a6d9[_0xe334('0x59')]][_0xe334('0x36')]=0x0;queues[_0x24a6d9[_0xe334('0x59')]]['mohtime']=0x0;utils[_0xe334('0x2')](util[_0xe334('0x3')](_0xe334('0x62'),_0x24a6d9['origtransfereruniqueid'],queues[_0x24a6d9[_0xe334('0x59')]]['name'],queues[_0x24a6d9['transfertargetuniqueid']][_0xe334('0x10')],queues[_0x24a6d9[_0xe334('0x59')]][_0xe334('0x7')],queues[_0x24a6d9[_0xe334('0x59')]][_0xe334('0x5a')]));}else{utils[_0xe334('0x2')](util['format'](_0xe334('0x5d'),_0x24a6d9[_0xe334('0x50')],queues[_0x24a6d9['secondtransfererlinkedid']][_0xe334('0x20')],_0x24a6d9[_0xe334('0x51')]));queues[_0x24a6d9[_0xe334('0x52')]][_0xe334('0x10')]=_0x24a6d9[_0xe334('0x51')];}}}}catch(_0x51500d){utils[_0xe334('0x16')](util[_0xe334('0x3')](_0xe334('0x63'),_0x24a6d9[_0xe334('0x50')]),_0x51500d);}};exports[_0xe334('0x64')]=function(_0x47ca78){try{if(!_[_0xe334('0x18')](queues[_0x47ca78['uniqueid']])){utils[_0xe334('0x12')](util[_0xe334('0x3')](_0xe334('0x65'),_0x47ca78['uniqueid']),_0x47ca78);queues[_0x47ca78[_0xe334('0x5')]][_0xe334('0x66')]=utils[_0xe334('0x27')]();utils[_0xe334('0x2')](util[_0xe334('0x3')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x47ca78['uniqueid'],queues[_0x47ca78[_0xe334('0x5')]]['name'],queues[_0x47ca78[_0xe334('0x5')]]['musiconholdstartAt']));}}catch(_0x6d3e79){utils[_0xe334('0x16')](util[_0xe334('0x3')](_0xe334('0x65'),_0x47ca78['uniqueid']),_0x6d3e79);}};exports[_0xe334('0x67')]=function(_0x445cf6){try{if(!_[_0xe334('0x18')](queues[_0x445cf6[_0xe334('0x5')]])){if(!_['isNil'](queues[_0x445cf6[_0xe334('0x5')]][_0xe334('0x66')])){utils['debug'](util[_0xe334('0x3')](_0xe334('0x68'),_0x445cf6[_0xe334('0x5')]),_0x445cf6);queues[_0x445cf6[_0xe334('0x5')]][_0xe334('0x5b')]+=utils['diffTime'](utils[_0xe334('0x27')](),queues[_0x445cf6[_0xe334('0x5')]][_0xe334('0x66')]);utils[_0xe334('0x2')](util[_0xe334('0x3')](_0xe334('0x69'),_0x445cf6['uniqueid'],queues[_0x445cf6[_0xe334('0x5')]]['name'],queues[_0x445cf6[_0xe334('0x5')]]['mohtime']));delete queues[_0x445cf6['uniqueid']][_0xe334('0x66')];}}}catch(_0x5664dd){utils[_0xe334('0x16')](util[_0xe334('0x3')](_0xe334('0x68'),_0x445cf6[_0xe334('0x5')]),_0x5664dd);}}; \ No newline at end of file +var _0x0cb6=['connectedlinename','holdtime','diffTime','queuecallerjoinAt','[%s][queues][queuecallerleave]','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','agentcomplete','[%s][queues][agentcomplete]','queuecallercomplete','queuecallercompleteAt','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','[%s][queues][blindtransfer]','transfereeuniqueid','transfertype','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfereruniqueid','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','clone','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','transfertargetuniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','format','uniqueid','channel','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','queue','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','hangup','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','name','queuecallerenterreason','error','varset','[%s][queues][varset]','isNil','variable','queuestatus','value','toUpperCase','queuecallerexit','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queuecallerabandonAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','connectedlinenum'];(function(_0x5497b8,_0x4afb5b){var _0x4d8e88=function(_0x264e1a){while(--_0x264e1a){_0x5497b8['push'](_0x5497b8['shift']());}};_0x4d8e88(++_0x4afb5b);}(_0x0cb6,0x10a));var _0x60cb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0cb6[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x60cb('0x0'));var util=require(_0x60cb('0x1'));var utils=require(_0x60cb('0x2'));var queues={};function writeDB(_0x44ce9c){utils[_0x60cb('0x3')](util[_0x60cb('0x4')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x44ce9c[_0x60cb('0x5')],_0x44ce9c[_0x60cb('0x6')],_0x44ce9c['queue'],_0x44ce9c[_0x60cb('0x7')],_0x44ce9c[_0x60cb('0x8')],_0x44ce9c[_0x60cb('0x9')],_0x44ce9c[_0x60cb('0xa')]));if(_0x44ce9c['queue']){utils['getVoiceQueueByName'](_0x44ce9c[_0x60cb('0xb')])[_0x60cb('0xc')](function(_0x47dd9b){if(_0x47dd9b){_0x44ce9c[_0x60cb('0xd')]=_0x47dd9b[_0x60cb('0xd')];}utils[_0x60cb('0xe')]('CreateVoiceQueueReport',_0x44ce9c);});}else{utils[_0x60cb('0xe')](_0x60cb('0xf'),_0x44ce9c);}if(_0x44ce9c[_0x60cb('0x10')]){delete queues[_0x44ce9c[_0x60cb('0x10')]];}else{delete queues[_0x44ce9c[_0x60cb('0x5')]];}}exports[_0x60cb('0x11')]=function(_0x2d0d3){try{utils[_0x60cb('0x12')](util[_0x60cb('0x4')](_0x60cb('0x13'),_0x2d0d3[_0x60cb('0x5')]),_0x2d0d3);utils['info'](util[_0x60cb('0x4')](_0x60cb('0x14'),_0x2d0d3[_0x60cb('0x5')],_0x2d0d3[_0x60cb('0xb')],_0x2d0d3[_0x60cb('0x15')]));queues[_0x2d0d3[_0x60cb('0x5')]]=_[_0x60cb('0x16')](_0x2d0d3,{'originalposition':_0x2d0d3[_0x60cb('0x15')],'queuecallerjoinAt':utils[_0x60cb('0x17')](),'mohtime':0x0});}catch(_0x3592fa){utils['error'](util[_0x60cb('0x4')]('[%s][queues][queuecallerjoin]',_0x2d0d3[_0x60cb('0x5')]),_0x3592fa);}};exports[_0x60cb('0x18')]=function(_0x193ca4){try{if(!_['isNil'](queues[_0x193ca4[_0x60cb('0x5')]])){utils[_0x60cb('0x12')](util[_0x60cb('0x4')](_0x60cb('0x19'),_0x193ca4['uniqueid']),_0x193ca4);if(queues[_0x193ca4[_0x60cb('0x5')]][_0x60cb('0x1a')]){if(!queues[_0x193ca4[_0x60cb('0x5')]][_0x60cb('0x1b')]&&!queues[_0x193ca4[_0x60cb('0x5')]]['queuecallerexit']){queues[_0x193ca4['uniqueid']]['queuecallercomplete']=!![];queues[_0x193ca4[_0x60cb('0x5')]]['queuecallercompleteAt']=utils[_0x60cb('0x17')]();queues[_0x193ca4['uniqueid']][_0x60cb('0xa')]=_0x60cb('0x1c');}utils[_0x60cb('0x3')](util['format'](_0x60cb('0x1d'),_0x193ca4['uniqueid'],queues[_0x193ca4['uniqueid']]['name'],queues[_0x193ca4[_0x60cb('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x193ca4[_0x60cb('0x5')]]);}else if(queues[_0x193ca4[_0x60cb('0x5')]][_0x60cb('0x10')]){utils[_0x60cb('0x3')](util[_0x60cb('0x4')](_0x60cb('0x1e'),_0x193ca4['uniqueid'],queues[_0x193ca4[_0x60cb('0x5')]][_0x60cb('0x1f')],queues[_0x193ca4[_0x60cb('0x5')]][_0x60cb('0x10')]));queues[queues[_0x193ca4[_0x60cb('0x5')]]['transfereduniqueid']]=queues[_0x193ca4[_0x60cb('0x5')]];queues[queues[_0x193ca4[_0x60cb('0x5')]][_0x60cb('0x10')]][_0x60cb('0x20')]=0x2;delete queues[_0x193ca4[_0x60cb('0x5')]];}}}catch(_0x12af75){utils[_0x60cb('0x21')](util['format']('[%s][queues][hangup]',_0x193ca4[_0x60cb('0x5')]),_0x12af75);}};exports[_0x60cb('0x22')]=function(_0x32739b){try{utils[_0x60cb('0x12')](util[_0x60cb('0x4')](_0x60cb('0x23'),_0x32739b['uniqueid']),_0x32739b);if(!_[_0x60cb('0x24')](_0x32739b[_0x60cb('0x25')][_0x60cb('0x26')])&&_0x32739b[_0x60cb('0x27')][_0x60cb('0x28')]()!=='CONTINUE'){if(!_['isNil'](queues[_0x32739b[_0x60cb('0x5')]])){queues[_0x32739b[_0x60cb('0x5')]]['queuecallerabandon']=![];queues[_0x32739b[_0x60cb('0x5')]]['queuecallerabandonAt']=null;queues[_0x32739b[_0x60cb('0x5')]][_0x60cb('0x29')]=!![];queues[_0x32739b['uniqueid']][_0x60cb('0x2a')]=utils[_0x60cb('0x17')]();queues[_0x32739b[_0x60cb('0x5')]][_0x60cb('0xa')]=_0x32739b[_0x60cb('0x27')][_0x60cb('0x28')]();utils[_0x60cb('0x3')](util['format'](_0x60cb('0x2b'),_0x32739b['uniqueid'],queues[_0x32739b[_0x60cb('0x5')]]['name'],_0x32739b['value'],queues[_0x32739b['uniqueid']]['queuecallerexitreason']));writeDB(queues[_0x32739b['uniqueid']]);}}else if(!_['isNil'](_0x32739b['variable']['queueposition'])){if(!_[_0x60cb('0x24')](queues[_0x32739b[_0x60cb('0x5')]])&&!queues[_0x32739b[_0x60cb('0x5')]][_0x60cb('0x1b')]){queues[_0x32739b[_0x60cb('0x5')]][_0x60cb('0x1b')]=![];queues[_0x32739b[_0x60cb('0x5')]][_0x60cb('0x2c')]=null;queues[_0x32739b[_0x60cb('0x5')]]['queuecallerexit']=!![];queues[_0x32739b[_0x60cb('0x5')]][_0x60cb('0x2a')]=utils[_0x60cb('0x17')]();queues[_0x32739b[_0x60cb('0x5')]]['queuecallerexitreason']=_0x60cb('0x2d');utils['info'](util[_0x60cb('0x4')](_0x60cb('0x2e'),_0x32739b[_0x60cb('0x5')],queues[_0x32739b['uniqueid']]['name'],_0x32739b[_0x60cb('0x27')],queues[_0x32739b['uniqueid']][_0x60cb('0xa')]));}}}catch(_0x587f1e){utils[_0x60cb('0x21')](util[_0x60cb('0x4')]('[%s][queues][varset]',_0x32739b[_0x60cb('0x5')]),_0x587f1e);}};exports[_0x60cb('0x1b')]=function(_0x489387){try{if(!_[_0x60cb('0x24')](queues[_0x489387[_0x60cb('0x5')]])){utils['debug'](util['format'](_0x60cb('0x2f'),_0x489387[_0x60cb('0x5')]),_0x489387);queues[_0x489387[_0x60cb('0x5')]]['queuecallerexit']=![];queues[_0x489387[_0x60cb('0x5')]]['queuecallerexitAt']=null;queues[_0x489387[_0x60cb('0x5')]][_0x60cb('0x1b')]=!![];queues[_0x489387[_0x60cb('0x5')]]['queuecallerabandonAt']=utils[_0x60cb('0x17')]();queues[_0x489387['uniqueid']]['queuecallerexitreason']=_0x60cb('0x30');utils[_0x60cb('0x3')](util[_0x60cb('0x4')](_0x60cb('0x31'),_0x489387['uniqueid'],queues[_0x489387[_0x60cb('0x5')]][_0x60cb('0x1f')],queues[_0x489387[_0x60cb('0x5')]][_0x60cb('0xa')]));}}catch(_0x43db16){utils[_0x60cb('0x21')](util['format']('[%s][queues][queuecallerabandon]',_0x489387[_0x60cb('0x5')]),_0x43db16);}};exports[_0x60cb('0x32')]=function(_0x16d677){try{if(!_[_0x60cb('0x24')](queues[_0x16d677[_0x60cb('0x5')]])){utils[_0x60cb('0x12')](util[_0x60cb('0x4')]('[%s][queues][queuecallerleave]',_0x16d677[_0x60cb('0x5')]),_0x16d677);utils[_0x60cb('0x3')](util[_0x60cb('0x4')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x16d677['uniqueid'],queues[_0x16d677[_0x60cb('0x5')]][_0x60cb('0x1f')],_0x16d677[_0x60cb('0x33')],_0x16d677[_0x60cb('0x34')]));queues[_0x16d677['uniqueid']]['queuecallerleave']=!![];queues[_0x16d677[_0x60cb('0x5')]]['queuecallerleaveAt']=utils[_0x60cb('0x17')]();queues[_0x16d677[_0x60cb('0x5')]][_0x60cb('0x35')]=utils[_0x60cb('0x36')](queues[_0x16d677[_0x60cb('0x5')]]['queuecallerleaveAt'],queues[_0x16d677[_0x60cb('0x5')]][_0x60cb('0x37')]);queues[_0x16d677[_0x60cb('0x5')]][_0x60cb('0x15')]=_0x16d677[_0x60cb('0x15')];queues[_0x16d677[_0x60cb('0x5')]]['count']=_0x16d677['count'];queues[_0x16d677[_0x60cb('0x5')]][_0x60cb('0x33')]=_0x16d677[_0x60cb('0x33')];queues[_0x16d677[_0x60cb('0x5')]][_0x60cb('0x34')]=_0x16d677['connectedlinename'];}}catch(_0x55b686){utils[_0x60cb('0x21')](util[_0x60cb('0x4')](_0x60cb('0x38'),_0x16d677[_0x60cb('0x5')]),_0x55b686);}};exports[_0x60cb('0x39')]=function(_0x4ba2ca){try{if(!_[_0x60cb('0x24')](queues[_0x4ba2ca[_0x60cb('0x5')]])){utils[_0x60cb('0x12')](util['format'](_0x60cb('0x3a'),_0x4ba2ca['uniqueid']),_0x4ba2ca);utils[_0x60cb('0x3')](util['format'](_0x60cb('0x3b'),_0x4ba2ca[_0x60cb('0x5')],queues[_0x4ba2ca[_0x60cb('0x5')]][_0x60cb('0x1f')],_0x4ba2ca[_0x60cb('0x3c')],_0x4ba2ca[_0x60cb('0x3d')]));queues[_0x4ba2ca[_0x60cb('0x5')]][_0x60cb('0x1b')]=![];queues[_0x4ba2ca[_0x60cb('0x5')]]['queuecallerabandon']=![];queues[_0x4ba2ca[_0x60cb('0x5')]][_0x60cb('0x2c')]=null;queues[_0x4ba2ca[_0x60cb('0x5')]]['queuecallerexit']=![];queues[_0x4ba2ca[_0x60cb('0x5')]][_0x60cb('0xa')]=null;queues[_0x4ba2ca[_0x60cb('0x5')]][_0x60cb('0x2a')]=null;queues[_0x4ba2ca['uniqueid']][_0x60cb('0x3e')]=!![];queues[_0x4ba2ca[_0x60cb('0x5')]][_0x60cb('0x9')]=_0x4ba2ca[_0x60cb('0x3d')];queues[_0x4ba2ca[_0x60cb('0x5')]][_0x60cb('0x7')]=_0x4ba2ca['membername'];}}catch(_0x4a053d){utils[_0x60cb('0x21')](util[_0x60cb('0x4')](_0x60cb('0x3a'),_0x4ba2ca[_0x60cb('0x5')]),_0x4a053d);}};exports[_0x60cb('0x3f')]=function(_0x206387){try{if(!_['isNil'](queues[_0x206387[_0x60cb('0x5')]])){if(queues[_0x206387[_0x60cb('0x5')]]['queuecallerleaveAt']){utils[_0x60cb('0x12')](util[_0x60cb('0x4')](_0x60cb('0x40'),_0x206387[_0x60cb('0x5')]),_0x206387);queues[_0x206387[_0x60cb('0x5')]][_0x60cb('0x1b')]=![];queues[_0x206387[_0x60cb('0x5')]][_0x60cb('0x1b')]=![];queues[_0x206387[_0x60cb('0x5')]][_0x60cb('0x2c')]=null;queues[_0x206387[_0x60cb('0x5')]][_0x60cb('0x29')]=![];queues[_0x206387['uniqueid']]['queuecallerexitAt']=null;queues[_0x206387[_0x60cb('0x5')]][_0x60cb('0x3e')]=!![];queues[_0x206387['uniqueid']][_0x60cb('0x7')]=_0x206387[_0x60cb('0x3c')];queues[_0x206387[_0x60cb('0x5')]][_0x60cb('0x41')]=!![];queues[_0x206387[_0x60cb('0x5')]][_0x60cb('0x42')]=utils[_0x60cb('0x17')]();if(_0x206387[_0x60cb('0x43')]==_0x60cb('0x44')){if(!queues[_0x206387[_0x60cb('0x5')]][_0x60cb('0x44')]){queues[_0x206387[_0x60cb('0x5')]][_0x60cb('0xa')]=_0x60cb('0x45');}}else{queues[_0x206387['uniqueid']][_0x60cb('0xa')]=_0x60cb('0x46')+_0x206387[_0x60cb('0x43')]['toUpperCase']();}utils[_0x60cb('0x3')](util[_0x60cb('0x4')](_0x60cb('0x47'),_0x206387[_0x60cb('0x5')],queues[_0x206387[_0x60cb('0x5')]]['name'],_0x206387[_0x60cb('0x3c')],queues[_0x206387[_0x60cb('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x206387[_0x60cb('0x5')]]);}}}catch(_0x3e2f91){utils['error'](util['format'](_0x60cb('0x40'),_0x206387[_0x60cb('0x5')]),_0x3e2f91);}};exports[_0x60cb('0x48')]=function(_0x1cfbe5){try{if(!_[_0x60cb('0x24')](queues[_0x1cfbe5['transfereeuniqueid']])){utils[_0x60cb('0x12')](util[_0x60cb('0x4')](_0x60cb('0x49'),_0x1cfbe5[_0x60cb('0x5')]),_0x1cfbe5);queues[_0x1cfbe5[_0x60cb('0x4a')]][_0x60cb('0x44')]=!![];queues[_0x1cfbe5[_0x60cb('0x4a')]][_0x60cb('0x4b')]='BLIND';queues[_0x1cfbe5[_0x60cb('0x4a')]][_0x60cb('0x4c')]=_0x1cfbe5[_0x60cb('0x4d')];queues[_0x1cfbe5[_0x60cb('0x4a')]][_0x60cb('0x4e')]=_0x1cfbe5[_0x60cb('0x4a')];queues[_0x1cfbe5[_0x60cb('0x4a')]][_0x60cb('0xa')]=_0x60cb('0x4f');utils['info'](util[_0x60cb('0x4')](_0x60cb('0x50'),_0x1cfbe5[_0x60cb('0x5')],queues[_0x1cfbe5[_0x60cb('0x4a')]][_0x60cb('0x1f')],_0x1cfbe5['transfereeuniqueid'],_0x1cfbe5[_0x60cb('0x4d')]));}}catch(_0x2283f8){utils[_0x60cb('0x21')](util['format'](_0x60cb('0x49'),_0x1cfbe5[_0x60cb('0x5')]),_0x2283f8);}};exports[_0x60cb('0x51')]=function(_0x3cf335){try{utils['debug'](util['format'](_0x60cb('0x52'),_0x3cf335['origtransfereruniqueid']),_0x3cf335);if(_0x3cf335['origtransfereruniqueid']==_0x3cf335[_0x60cb('0x53')]){if(!_['isNil'](queues[_0x3cf335[_0x60cb('0x54')]])){utils[_0x60cb('0x3')](util[_0x60cb('0x4')](_0x60cb('0x55'),_0x3cf335[_0x60cb('0x56')],queues[_0x3cf335[_0x60cb('0x54')]][_0x60cb('0x1f')],_0x3cf335[_0x60cb('0x57')]));queues[_0x3cf335[_0x60cb('0x54')]][_0x60cb('0x44')]=!![];queues[_0x3cf335[_0x60cb('0x54')]][_0x60cb('0x4b')]=_0x60cb('0x58');queues[_0x3cf335[_0x60cb('0x54')]][_0x60cb('0x4c')]=_0x3cf335['origtransfererexten'];queues[_0x3cf335[_0x60cb('0x54')]][_0x60cb('0x4e')]=_0x3cf335[_0x60cb('0x56')];queues[_0x3cf335['secondtransfererlinkedid']][_0x60cb('0xa')]=_0x60cb('0x59');}if(!_[_0x60cb('0x24')](queues[_0x3cf335[_0x60cb('0x53')]])){if(_0x3cf335[_0x60cb('0x5a')]&&queues[_0x3cf335['transfereelinkedid']]){queues[_0x3cf335[_0x60cb('0x5a')]][_0x60cb('0x20')]=0x1;queues[_0x3cf335['transfereeuniqueid']]=_[_0x60cb('0x5b')](queues[_0x3cf335['transfereelinkedid']]);queues[_0x3cf335[_0x60cb('0x4a')]][_0x60cb('0x10')]=_0x3cf335['transfertargetuniqueid'];queues[_0x3cf335[_0x60cb('0x4a')]]['queuecallerenterreason']=0x2;queues[_0x3cf335[_0x60cb('0x4a')]][_0x60cb('0x8')]=queues[_0x3cf335['secondtransfererlinkedid']][_0x60cb('0x8')];queues[_0x3cf335[_0x60cb('0x4a')]][_0x60cb('0x5c')]=queues[_0x3cf335[_0x60cb('0x54')]]['calleridname'];queues[_0x3cf335['transfereeuniqueid']][_0x60cb('0x37')]=utils[_0x60cb('0x17')]();queues[_0x3cf335['transfereeuniqueid']][_0x60cb('0x1a')]=utils['now']();queues[_0x3cf335[_0x60cb('0x4a')]][_0x60cb('0x35')]=0x0;queues[_0x3cf335['transfereeuniqueid']][_0x60cb('0x5d')]=0x0;utils[_0x60cb('0x3')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x3cf335[_0x60cb('0x56')],queues[_0x3cf335[_0x60cb('0x4a')]][_0x60cb('0x1f')],queues[_0x3cf335[_0x60cb('0x4a')]][_0x60cb('0x8')],queues[_0x3cf335[_0x60cb('0x4a')]]['calleridname']));}else{utils[_0x60cb('0x3')](util[_0x60cb('0x4')](_0x60cb('0x5e'),_0x3cf335[_0x60cb('0x56')],queues[_0x3cf335[_0x60cb('0x53')]][_0x60cb('0x1f')],_0x3cf335[_0x60cb('0x54')]));queues[_0x3cf335[_0x60cb('0x53')]][_0x60cb('0x10')]=_0x3cf335[_0x60cb('0x54')];}}}else if(_0x3cf335['secondtransfereruniqueid']==_0x3cf335[_0x60cb('0x54')]){if(!_['isNil'](queues[_0x3cf335['origtransfererlinkedid']])){utils[_0x60cb('0x3')](util[_0x60cb('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x3cf335[_0x60cb('0x56')],queues[_0x3cf335['origtransfererlinkedid']][_0x60cb('0x1f')],_0x3cf335[_0x60cb('0x5f')],_0x3cf335[_0x60cb('0x60')]));queues[_0x3cf335[_0x60cb('0x53')]]['transfer']=!![];queues[_0x3cf335[_0x60cb('0x53')]]['transfertype']=_0x60cb('0x58');queues[_0x3cf335[_0x60cb('0x53')]][_0x60cb('0x4c')]=_0x3cf335['secondtransfererexten'];queues[_0x3cf335['origtransfererlinkedid']][_0x60cb('0x4e')]=_0x3cf335[_0x60cb('0x5f')];queues[_0x3cf335[_0x60cb('0x53')]][_0x60cb('0xa')]=_0x60cb('0x59');}if(!_[_0x60cb('0x24')](queues[_0x3cf335['secondtransfererlinkedid']])){if(_0x3cf335[_0x60cb('0x61')]&&queues[_0x3cf335[_0x60cb('0x61')]]){queues[_0x3cf335[_0x60cb('0x61')]][_0x60cb('0x20')]=0x1;queues[_0x3cf335[_0x60cb('0x62')]]=_[_0x60cb('0x5b')](queues[_0x3cf335[_0x60cb('0x61')]]);queues[_0x3cf335['transfertargetuniqueid']][_0x60cb('0x10')]=_0x3cf335[_0x60cb('0x62')];queues[_0x3cf335[_0x60cb('0x62')]]['queuecallerenterreason']=0x2;queues[_0x3cf335[_0x60cb('0x62')]][_0x60cb('0x8')]=queues[_0x3cf335[_0x60cb('0x53')]]['calleridnum'];queues[_0x3cf335[_0x60cb('0x62')]][_0x60cb('0x5c')]=queues[_0x3cf335['origtransfererlinkedid']][_0x60cb('0x5c')];queues[_0x3cf335[_0x60cb('0x62')]][_0x60cb('0x37')]=utils[_0x60cb('0x17')]();queues[_0x3cf335['transfertargetuniqueid']][_0x60cb('0x1a')]=utils[_0x60cb('0x17')]();queues[_0x3cf335[_0x60cb('0x62')]][_0x60cb('0x35')]=0x0;queues[_0x3cf335[_0x60cb('0x62')]][_0x60cb('0x5d')]=0x0;utils['info'](util[_0x60cb('0x4')](_0x60cb('0x63'),_0x3cf335['origtransfereruniqueid'],queues[_0x3cf335[_0x60cb('0x62')]][_0x60cb('0x1f')],queues[_0x3cf335['transfertargetuniqueid']]['transfereduniqueid'],queues[_0x3cf335['transfertargetuniqueid']][_0x60cb('0x8')],queues[_0x3cf335[_0x60cb('0x62')]]['calleridname']));}else{utils[_0x60cb('0x3')](util['format'](_0x60cb('0x5e'),_0x3cf335['origtransfereruniqueid'],queues[_0x3cf335['secondtransfererlinkedid']][_0x60cb('0x1f')],_0x3cf335[_0x60cb('0x53')]));queues[_0x3cf335[_0x60cb('0x54')]][_0x60cb('0x10')]=_0x3cf335['origtransfererlinkedid'];}}}}catch(_0x13501e){utils[_0x60cb('0x21')](util[_0x60cb('0x4')]('[%s][queues][attendedtransfer]',_0x3cf335['origtransfereruniqueid']),_0x13501e);}};exports[_0x60cb('0x64')]=function(_0x90c782){try{if(!_[_0x60cb('0x24')](queues[_0x90c782['uniqueid']])){utils['debug'](util['format'](_0x60cb('0x65'),_0x90c782['uniqueid']),_0x90c782);queues[_0x90c782[_0x60cb('0x5')]][_0x60cb('0x66')]=utils[_0x60cb('0x17')]();utils[_0x60cb('0x3')](util['format'](_0x60cb('0x67'),_0x90c782[_0x60cb('0x5')],queues[_0x90c782[_0x60cb('0x5')]]['name'],queues[_0x90c782[_0x60cb('0x5')]]['musiconholdstartAt']));}}catch(_0x264132){utils[_0x60cb('0x21')](util[_0x60cb('0x4')]('[%s][queues][musiconholdstart]',_0x90c782[_0x60cb('0x5')]),_0x264132);}};exports['musiconholdstop']=function(_0x5c0185){try{if(!_[_0x60cb('0x24')](queues[_0x5c0185[_0x60cb('0x5')]])){if(!_[_0x60cb('0x24')](queues[_0x5c0185['uniqueid']][_0x60cb('0x66')])){utils['debug'](util[_0x60cb('0x4')](_0x60cb('0x68'),_0x5c0185[_0x60cb('0x5')]),_0x5c0185);queues[_0x5c0185[_0x60cb('0x5')]][_0x60cb('0x5d')]+=utils[_0x60cb('0x36')](utils['now'](),queues[_0x5c0185[_0x60cb('0x5')]][_0x60cb('0x66')]);utils[_0x60cb('0x3')](util[_0x60cb('0x4')](_0x60cb('0x69'),_0x5c0185[_0x60cb('0x5')],queues[_0x5c0185['uniqueid']][_0x60cb('0x1f')],queues[_0x5c0185[_0x60cb('0x5')]][_0x60cb('0x5d')]));delete queues[_0x5c0185['uniqueid']]['musiconholdstartAt'];}}}catch(_0xa25e0){utils[_0x60cb('0x21')](util[_0x60cb('0x4')](_0x60cb('0x68'),_0x5c0185[_0x60cb('0x5')]),_0xa25e0);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 12cdd91..ec8359b 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 _0x01fd=['value','endsWith','.wav49','.WAV','find','monitors','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridname','cause-txt','calleridnum','connectedlinenum','connectedlinename','type','outbound','forEach','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','appdata','cdr','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','transferercalleridnum','transfereruniqueid','recording','util','info','format','uniqueid','blinds','transfereeuniqueid','accountcode','getUserByInternal','then','name','UserId','request','CreateVoiceRecording','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','error','debug','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channel','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','[%s][recordings][newstate]','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s'];(function(_0x1d1da3,_0x387863){var _0x4ea3b1=function(_0x4ee207){while(--_0x4ee207){_0x1d1da3['push'](_0x1d1da3['shift']());}};_0x4ea3b1(++_0x387863);}(_0x01fd,0x1bc));var _0xd01f=function(_0x49052b,_0x3ba709){_0x49052b=_0x49052b-0x0;var _0x48c045=_0x01fd[_0x49052b];return _0x48c045;};'use strict';var _=require('lodash');var util=require(_0xd01f('0x0'));var utils=require('./utils');var transfers=require('./transfers.controller');var recordings={};function writeDB(_0x4091a0){var _0x736eb1;utils[_0xd01f('0x1')](util[_0xd01f('0x2')]('[%s][recordings][writeDB]',_0x4091a0[_0xd01f('0x3')]));if(transfers[_0xd01f('0x4')][_0x4091a0[_0xd01f('0x3')]]){_0x736eb1=_0x4091a0[_0xd01f('0x3')];_0x4091a0[_0xd01f('0x3')]=transfers[_0xd01f('0x4')][_0x4091a0[_0xd01f('0x3')]][_0xd01f('0x5')];}if(_0x4091a0[_0xd01f('0x6')]){utils[_0xd01f('0x7')](_0x4091a0[_0xd01f('0x6')])[_0xd01f('0x8')](function(_0x414019){if(_0x414019){_0x4091a0['membername']=_0x414019[_0xd01f('0x9')];_0x4091a0[_0xd01f('0xa')]=_0x414019['id'];}utils[_0xd01f('0xb')](_0xd01f('0xc'),_0x4091a0);});}else{utils[_0xd01f('0xb')]('CreateVoiceRecording',_0x4091a0);}if(_0x736eb1)delete transfers[_0xd01f('0x4')][_0x736eb1];}exports['newchannel']=function(_0x3475f6){try{utils['debug'](util['format'](_0xd01f('0xd'),_0x3475f6[_0xd01f('0x3')]),_0x3475f6);if(_0x3475f6['uniqueid']==_0x3475f6[_0xd01f('0xe')]){utils[_0xd01f('0x1')](util['format'](_0xd01f('0xf'),_0x3475f6[_0xd01f('0x3')],_0x3475f6[_0xd01f('0x10')],_0x3475f6[_0xd01f('0x11')]));recordings[_0x3475f6['uniqueid']]={'uniqueid':_0x3475f6['uniqueid'],'accountcode':_0x3475f6[_0xd01f('0x6')],'exten':_0x3475f6[_0xd01f('0x11')],'context':_0x3475f6['context'],'channel':_0x3475f6['channel'],'monitors':[]};}}catch(_0x58ccb5){utils[_0xd01f('0x12')](util['format']('[%s][recordings][newchannel]',_0x3475f6['uniqueid']),_0x58ccb5);}};exports['newstate']=function(_0x39fc33){try{utils[_0xd01f('0x13')](util['format']('[%s][recordings][newstate]',_0x39fc33[_0xd01f('0x3')]),_0x39fc33);if(!_[_0xd01f('0x14')](recordings[_0x39fc33['uniqueid']])&&_0x39fc33[_0xd01f('0x15')]==0x6){utils[_0xd01f('0x1')](util[_0xd01f('0x2')](_0xd01f('0x16'),_0x39fc33[_0xd01f('0x3')],_0x39fc33[_0xd01f('0x10')],_0x39fc33[_0xd01f('0x17')]));}else if(!_['isNil'](recordings[_0x39fc33[_0xd01f('0xe')]])&&_0x39fc33['channelstate']==0x6&&_0x39fc33[_0xd01f('0x10')]!=_0xd01f('0x18')){utils[_0xd01f('0x1')](util['format'](_0xd01f('0x19'),_0x39fc33['uniqueid'],_0x39fc33[_0xd01f('0xe')],_0x39fc33[_0xd01f('0x10')],_0x39fc33[_0xd01f('0x17')]));recordings[_0x39fc33[_0xd01f('0xe')]][_0xd01f('0x6')]=_0x39fc33[_0xd01f('0x6')];}}catch(_0x35c610){utils[_0xd01f('0x12')](util[_0xd01f('0x2')](_0xd01f('0x1a'),_0x39fc33[_0xd01f('0x3')]),_0x35c610);}};exports[_0xd01f('0x1b')]=function(_0x546b8c){try{if(!_['isNil'](_0x546b8c[_0xd01f('0x1c')])&&!_['isNil'](_0x546b8c[_0xd01f('0x1c')][_0xd01f('0x1d')])){utils[_0xd01f('0x13')](util['format'](_0xd01f('0x1e'),_0x546b8c[_0xd01f('0x3')]),_0x546b8c);utils['info'](util[_0xd01f('0x2')](_0xd01f('0x1f'),_0x546b8c[_0xd01f('0x3')],_0x546b8c[_0xd01f('0x1c')],_0x546b8c[_0xd01f('0x20')]));if(_[_0xd01f('0x21')](_0x546b8c['value'],_0xd01f('0x22'))){_0x546b8c[_0xd01f('0x20')]=_0x546b8c['value']['replace'](_0xd01f('0x22'),_0xd01f('0x23'));}if(recordings[_0x546b8c[_0xd01f('0xe')]]){var _0x136286=_[_0xd01f('0x24')](recordings[_0x546b8c[_0xd01f('0xe')]]['monitors'],{'value':_0x546b8c[_0xd01f('0x20')]});if(_[_0xd01f('0x14')](_0x136286)){recordings[_0x546b8c[_0xd01f('0xe')]][_0xd01f('0x25')]['push']({'value':_0x546b8c[_0xd01f('0x20')]});}}}}catch(_0x14e3a0){utils[_0xd01f('0x12')](util['format'](_0xd01f('0x1e'),_0x546b8c[_0xd01f('0x3')]),_0x14e3a0);}};exports[_0xd01f('0x26')]=function(_0x502e6e){try{if(!_[_0xd01f('0x14')](recordings[_0x502e6e[_0xd01f('0x3')]])){utils['debug'](util[_0xd01f('0x2')](_0xd01f('0x27'),_0x502e6e[_0xd01f('0x3')]),_0x502e6e);utils[_0xd01f('0x1')](util[_0xd01f('0x2')](_0xd01f('0x28'),_0x502e6e[_0xd01f('0x3')],_0x502e6e['calleridnum'],_0x502e6e[_0xd01f('0x29')],_0x502e6e[_0xd01f('0x2a')]));recordings[_0x502e6e['uniqueid']][_0xd01f('0x2b')]=_0x502e6e['calleridnum'];recordings[_0x502e6e[_0xd01f('0x3')]][_0xd01f('0x29')]=_0x502e6e[_0xd01f('0x29')];recordings[_0x502e6e[_0xd01f('0x3')]][_0xd01f('0x2c')]=_0x502e6e[_0xd01f('0x2c')];recordings[_0x502e6e[_0xd01f('0x3')]][_0xd01f('0x2d')]=_0x502e6e['connectedlinename'];if(recordings[_0x502e6e[_0xd01f('0x3')]][_0xd01f('0x2e')]==_0xd01f('0x2f')&&recordings[_0x502e6e['uniqueid']][_0xd01f('0x6')]){recordings[_0x502e6e['uniqueid']][_0xd01f('0x2c')]=recordings[_0x502e6e[_0xd01f('0x3')]][_0xd01f('0x6')];recordings[_0x502e6e['uniqueid']][_0xd01f('0x2d')]='';}recordings[_0x502e6e['uniqueid']][_0xd01f('0x25')][_0xd01f('0x30')](function(_0xc11312){var _0x34bc9c=_[_0xd01f('0x31')](recordings[_0x502e6e['uniqueid']]);_0x34bc9c[_0xd01f('0x20')]=_0xc11312[_0xd01f('0x20')];writeDB(_0x34bc9c);});delete recordings[_0x502e6e[_0xd01f('0x3')]];}}catch(_0x17c1fe){utils[_0xd01f('0x12')](util[_0xd01f('0x2')]('[%s][recordings][hangup]',_0x502e6e[_0xd01f('0x3')]),_0x17c1fe);}};exports[_0xd01f('0x32')]=function(_0x5e14ca){try{if(!_[_0xd01f('0x14')](recordings[_0x5e14ca['uniqueid']])){utils[_0xd01f('0x13')](util[_0xd01f('0x2')](_0xd01f('0x33'),_0x5e14ca[_0xd01f('0x3')]),_0x5e14ca);utils['info'](util[_0xd01f('0x2')](_0xd01f('0x34'),_0x5e14ca[_0xd01f('0x3')],_0x5e14ca['application'],_0x5e14ca['appdata']));if(_0x5e14ca[_0xd01f('0x35')][_0xd01f('0x36')]()==_0xd01f('0x37')&&_[_0xd01f('0x38')](_0x5e14ca[_0xd01f('0x39')][_0xd01f('0x36')](),_0xd01f('0x3a'))){var _0x17e98b=_0x5e14ca[_0xd01f('0x39')]['split']('=');var _0x5f3596=_0x17e98b[0x0]['substring'](_0x17e98b[0x0][_0xd01f('0x3b')]('(')+0x1,_0x17e98b[0x0][_0xd01f('0x3b')](')'));var _0x2574a1=_0x17e98b[0x1];recordings[_0x5e14ca['uniqueid']][_0x5f3596]=_0x2574a1;}}}catch(_0x3bc01){utils[_0xd01f('0x12')](util[_0xd01f('0x2')]('[%s][recordings][newexten]',_0x5e14ca[_0xd01f('0x3')]),_0x3bc01);}};exports[_0xd01f('0x3c')]=function(_0x48690c){try{if(!_[_0xd01f('0x14')](recordings[_0x48690c[_0xd01f('0x3')]])){utils[_0xd01f('0x13')](util[_0xd01f('0x2')](_0xd01f('0x3d'),_0x48690c[_0xd01f('0x3')]),_0x48690c);utils[_0xd01f('0x1')](util[_0xd01f('0x2')](_0xd01f('0x3e'),_0x48690c[_0xd01f('0x3')],_0x48690c[_0xd01f('0x3f')]));recordings[_0x48690c[_0xd01f('0x3')]][_0xd01f('0x3f')]=_0x48690c[_0xd01f('0x3f')];}}catch(_0x38bc4f){utils[_0xd01f('0x12')](util[_0xd01f('0x2')](_0xd01f('0x3d'),_0x48690c[_0xd01f('0x3')]),_0x38bc4f);}};exports[_0xd01f('0x40')]=function(_0x27f3e7){try{utils['debug'](util[_0xd01f('0x2')]('[%s][recordings][blindtransfer]',_0x27f3e7['uniqueid']),_0x27f3e7);utils['info'](util[_0xd01f('0x2')]('[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x27f3e7[_0xd01f('0x3')],_0x27f3e7[_0xd01f('0x41')],_0x27f3e7['transferercalleridname'],_0x27f3e7['transfereecalleridnum'],_0x27f3e7['transfereecalleridname']));if(recordings[_0x27f3e7[_0xd01f('0x42')]]&&transfers[_0xd01f('0x4')][_0x27f3e7[_0xd01f('0x42')]]){transfers['blinds'][_0x27f3e7[_0xd01f('0x42')]][_0xd01f('0x43')]=!![];}}catch(_0x5d780e){utils[_0xd01f('0x12')](util[_0xd01f('0x2')]('[%s][recordings][blindtransfer]',_0x27f3e7[_0xd01f('0x3')]),_0x5d780e);}}; \ No newline at end of file +var _0x33db=['isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','variable','mixmonitor_filename','debug','value','endsWith','.wav49','.WAV','monitors','push','[%s][recordings][varset]','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','outbound','forEach','clone','newexten','[%s][recordings][newexten]','application','appdata','toLowerCase','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','queue','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','lodash','./utils','./transfers.controller','info','format','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','accountcode','getUserByInternal','membername','name','request','CreateVoiceRecording','newchannel','[%s][recordings][newchannel]','linkedid','exten','context','channel','error','newstate','[%s][recordings][newstate]'];(function(_0x4164f2,_0x38669f){var _0x2575c7=function(_0x24dca1){while(--_0x24dca1){_0x4164f2['push'](_0x4164f2['shift']());}};_0x2575c7(++_0x38669f);}(_0x33db,0x141));var _0xb33d=function(_0x277af0,_0x1f0361){_0x277af0=_0x277af0-0x0;var _0x43bd7c=_0x33db[_0x277af0];return _0x43bd7c;};'use strict';var _=require(_0xb33d('0x0'));var util=require('util');var utils=require(_0xb33d('0x1'));var transfers=require(_0xb33d('0x2'));var recordings={};function writeDB(_0x2ed035){var _0x882762;utils[_0xb33d('0x3')](util[_0xb33d('0x4')](_0xb33d('0x5'),_0x2ed035[_0xb33d('0x6')]));if(transfers[_0xb33d('0x7')][_0x2ed035[_0xb33d('0x6')]]){_0x882762=_0x2ed035[_0xb33d('0x6')];_0x2ed035[_0xb33d('0x6')]=transfers['blinds'][_0x2ed035['uniqueid']][_0xb33d('0x8')];}if(_0x2ed035[_0xb33d('0x9')]){utils[_0xb33d('0xa')](_0x2ed035['accountcode'])['then'](function(_0x1dc4e2){if(_0x1dc4e2){_0x2ed035[_0xb33d('0xb')]=_0x1dc4e2[_0xb33d('0xc')];_0x2ed035['UserId']=_0x1dc4e2['id'];}utils[_0xb33d('0xd')](_0xb33d('0xe'),_0x2ed035);});}else{utils[_0xb33d('0xd')](_0xb33d('0xe'),_0x2ed035);}if(_0x882762)delete transfers[_0xb33d('0x7')][_0x882762];}exports[_0xb33d('0xf')]=function(_0x43f5ad){try{utils['debug'](util[_0xb33d('0x4')](_0xb33d('0x10'),_0x43f5ad['uniqueid']),_0x43f5ad);if(_0x43f5ad[_0xb33d('0x6')]==_0x43f5ad[_0xb33d('0x11')]){utils[_0xb33d('0x3')](util[_0xb33d('0x4')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x43f5ad['uniqueid'],_0x43f5ad['context'],_0x43f5ad['exten']));recordings[_0x43f5ad['uniqueid']]={'uniqueid':_0x43f5ad[_0xb33d('0x6')],'accountcode':_0x43f5ad[_0xb33d('0x9')],'exten':_0x43f5ad[_0xb33d('0x12')],'context':_0x43f5ad[_0xb33d('0x13')],'channel':_0x43f5ad[_0xb33d('0x14')],'monitors':[]};}}catch(_0x11d0e5){utils[_0xb33d('0x15')](util['format'](_0xb33d('0x10'),_0x43f5ad[_0xb33d('0x6')]),_0x11d0e5);}};exports[_0xb33d('0x16')]=function(_0x56f0a4){try{utils['debug'](util[_0xb33d('0x4')](_0xb33d('0x17'),_0x56f0a4['uniqueid']),_0x56f0a4);if(!_[_0xb33d('0x18')](recordings[_0x56f0a4[_0xb33d('0x6')]])&&_0x56f0a4[_0xb33d('0x19')]==0x6){utils[_0xb33d('0x3')](util[_0xb33d('0x4')](_0xb33d('0x1a'),_0x56f0a4[_0xb33d('0x6')],_0x56f0a4[_0xb33d('0x13')],_0x56f0a4[_0xb33d('0x14')]));}else if(!_[_0xb33d('0x18')](recordings[_0x56f0a4[_0xb33d('0x11')]])&&_0x56f0a4['channelstate']==0x6&&_0x56f0a4[_0xb33d('0x13')]!=_0xb33d('0x1b')){utils['info'](util[_0xb33d('0x4')](_0xb33d('0x1c'),_0x56f0a4[_0xb33d('0x6')],_0x56f0a4[_0xb33d('0x11')],_0x56f0a4[_0xb33d('0x13')],_0x56f0a4[_0xb33d('0x14')]));recordings[_0x56f0a4[_0xb33d('0x11')]][_0xb33d('0x9')]=_0x56f0a4[_0xb33d('0x9')];}}catch(_0x574ed7){utils[_0xb33d('0x15')](util['format']('[%s][recordings][newstate]',_0x56f0a4[_0xb33d('0x6')]),_0x574ed7);}};exports['varset']=function(_0x39615c){try{if(!_[_0xb33d('0x18')](_0x39615c[_0xb33d('0x1d')])&&!_['isNil'](_0x39615c[_0xb33d('0x1d')][_0xb33d('0x1e')])){utils[_0xb33d('0x1f')](util['format']('[%s][recordings][varset]',_0x39615c[_0xb33d('0x6')]),_0x39615c);utils[_0xb33d('0x3')](util[_0xb33d('0x4')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x39615c[_0xb33d('0x6')],_0x39615c[_0xb33d('0x1d')],_0x39615c[_0xb33d('0x20')]));if(_[_0xb33d('0x21')](_0x39615c[_0xb33d('0x20')],_0xb33d('0x22'))){_0x39615c[_0xb33d('0x20')]=_0x39615c['value']['replace'](_0xb33d('0x22'),_0xb33d('0x23'));}if(recordings[_0x39615c['linkedid']]){var _0xfbea3a=_['find'](recordings[_0x39615c['linkedid']][_0xb33d('0x24')],{'value':_0x39615c[_0xb33d('0x20')]});if(_[_0xb33d('0x18')](_0xfbea3a)){recordings[_0x39615c[_0xb33d('0x11')]][_0xb33d('0x24')][_0xb33d('0x25')]({'value':_0x39615c['value']});}}}}catch(_0x441d99){utils[_0xb33d('0x15')](util[_0xb33d('0x4')](_0xb33d('0x26'),_0x39615c['uniqueid']),_0x441d99);}};exports[_0xb33d('0x27')]=function(_0x24e967){try{if(!_[_0xb33d('0x18')](recordings[_0x24e967[_0xb33d('0x6')]])){utils['debug'](util[_0xb33d('0x4')](_0xb33d('0x28'),_0x24e967[_0xb33d('0x6')]),_0x24e967);utils[_0xb33d('0x3')](util[_0xb33d('0x4')](_0xb33d('0x29'),_0x24e967[_0xb33d('0x6')],_0x24e967[_0xb33d('0x2a')],_0x24e967[_0xb33d('0x2b')],_0x24e967[_0xb33d('0x2c')]));recordings[_0x24e967['uniqueid']]['calleridnum']=_0x24e967[_0xb33d('0x2a')];recordings[_0x24e967['uniqueid']][_0xb33d('0x2b')]=_0x24e967[_0xb33d('0x2b')];recordings[_0x24e967[_0xb33d('0x6')]][_0xb33d('0x2d')]=_0x24e967[_0xb33d('0x2d')];recordings[_0x24e967[_0xb33d('0x6')]]['connectedlinename']=_0x24e967[_0xb33d('0x2e')];if(recordings[_0x24e967[_0xb33d('0x6')]]['type']==_0xb33d('0x2f')&&recordings[_0x24e967[_0xb33d('0x6')]][_0xb33d('0x9')]){recordings[_0x24e967[_0xb33d('0x6')]][_0xb33d('0x2d')]=recordings[_0x24e967[_0xb33d('0x6')]][_0xb33d('0x9')];recordings[_0x24e967[_0xb33d('0x6')]][_0xb33d('0x2e')]='';}recordings[_0x24e967[_0xb33d('0x6')]]['monitors'][_0xb33d('0x30')](function(_0x5632a7){var _0x43bdc5=_[_0xb33d('0x31')](recordings[_0x24e967[_0xb33d('0x6')]]);_0x43bdc5['value']=_0x5632a7[_0xb33d('0x20')];writeDB(_0x43bdc5);});delete recordings[_0x24e967[_0xb33d('0x6')]];}}catch(_0x4f014f){utils[_0xb33d('0x15')](util[_0xb33d('0x4')]('[%s][recordings][hangup]',_0x24e967[_0xb33d('0x6')]),_0x4f014f);}};exports[_0xb33d('0x32')]=function(_0x4d0b7e){try{if(!_[_0xb33d('0x18')](recordings[_0x4d0b7e[_0xb33d('0x6')]])){utils[_0xb33d('0x1f')](util[_0xb33d('0x4')](_0xb33d('0x33'),_0x4d0b7e[_0xb33d('0x6')]),_0x4d0b7e);utils['info'](util[_0xb33d('0x4')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x4d0b7e[_0xb33d('0x6')],_0x4d0b7e[_0xb33d('0x34')],_0x4d0b7e[_0xb33d('0x35')]));if(_0x4d0b7e[_0xb33d('0x34')][_0xb33d('0x36')]()=='set'&&_['startsWith'](_0x4d0b7e[_0xb33d('0x35')][_0xb33d('0x36')](),'cdr')){var _0x5a502a=_0x4d0b7e[_0xb33d('0x35')][_0xb33d('0x37')]('=');var _0x3b567a=_0x5a502a[0x0][_0xb33d('0x38')](_0x5a502a[0x0][_0xb33d('0x39')]('(')+0x1,_0x5a502a[0x0][_0xb33d('0x39')](')'));var _0x46c906=_0x5a502a[0x1];recordings[_0x4d0b7e[_0xb33d('0x6')]][_0x3b567a]=_0x46c906;}}}catch(_0x5043d){utils[_0xb33d('0x15')](util[_0xb33d('0x4')]('[%s][recordings][newexten]',_0x4d0b7e['uniqueid']),_0x5043d);}};exports[_0xb33d('0x3a')]=function(_0x1edcf3){try{if(!_[_0xb33d('0x18')](recordings[_0x1edcf3[_0xb33d('0x6')]])){utils[_0xb33d('0x1f')](util[_0xb33d('0x4')](_0xb33d('0x3b'),_0x1edcf3['uniqueid']),_0x1edcf3);utils[_0xb33d('0x3')](util['format']('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x1edcf3['uniqueid'],_0x1edcf3[_0xb33d('0x3c')]));recordings[_0x1edcf3[_0xb33d('0x6')]][_0xb33d('0x3c')]=_0x1edcf3[_0xb33d('0x3c')];}}catch(_0x14e15b){utils[_0xb33d('0x15')](util[_0xb33d('0x4')](_0xb33d('0x3b'),_0x1edcf3['uniqueid']),_0x14e15b);}};exports[_0xb33d('0x3d')]=function(_0x520fe7){try{utils[_0xb33d('0x1f')](util['format'](_0xb33d('0x3e'),_0x520fe7[_0xb33d('0x6')]),_0x520fe7);utils[_0xb33d('0x3')](util['format'](_0xb33d('0x3f'),_0x520fe7['uniqueid'],_0x520fe7[_0xb33d('0x40')],_0x520fe7['transferercalleridname'],_0x520fe7[_0xb33d('0x41')],_0x520fe7[_0xb33d('0x42')]));if(recordings[_0x520fe7[_0xb33d('0x43')]]&&transfers[_0xb33d('0x7')][_0x520fe7[_0xb33d('0x43')]]){transfers['blinds'][_0x520fe7[_0xb33d('0x43')]][_0xb33d('0x44')]=!![];}}catch(_0x105029){utils[_0xb33d('0x15')](util[_0xb33d('0x4')](_0xb33d('0x3e'),_0x520fe7[_0xb33d('0x6')]),_0x105029);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 9a20610..9a2b08a 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 _0xada7=['[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','assign','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransferercontext','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','[%s][transfers][attendedtransfer]','./utils','info','format','type','attended','request','CreateVoiceTransferReport','blindtransfer','debug','[%s][transfers][blindtransfer]','uniqueid','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','blinds','transfereruniqueid','error','attendedtransfer','origtransfereruniqueid'];(function(_0x2fb7a3,_0xe7642c){var _0x3940da=function(_0x1c1930){while(--_0x1c1930){_0x2fb7a3['push'](_0x2fb7a3['shift']());}};_0x3940da(++_0xe7642c);}(_0xada7,0xbd));var _0x7ada=function(_0x56cec7,_0x396643){_0x56cec7=_0x56cec7-0x0;var _0x1d5b03=_0xada7[_0x56cec7];return _0x1d5b03;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x7ada('0x0'));function writeDB(_0x316f06){utils[_0x7ada('0x1')](util[_0x7ada('0x2')]('[%s][transfers][writeDB]\x20type:%s',_0x316f06[_0x7ada('0x3')]===_0x7ada('0x4')?_0x316f06['origtransfereruniqueid']:_0x316f06['uniqueid'],_0x316f06[_0x7ada('0x3')]));utils[_0x7ada('0x5')](_0x7ada('0x6'),_0x316f06);}exports['blinds']={};exports[_0x7ada('0x7')]=function(_0x4c7005){try{utils[_0x7ada('0x8')](util['format'](_0x7ada('0x9'),_0x4c7005[_0x7ada('0xa')]),_0x4c7005);utils[_0x7ada('0x1')](util['format']('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x4c7005[_0x7ada('0xa')],_0x4c7005[_0x7ada('0xb')],_0x4c7005[_0x7ada('0xc')],_0x4c7005[_0x7ada('0xd')],_0x4c7005[_0x7ada('0xe')]));_0x4c7005['type']=_0x7ada('0xf');exports[_0x7ada('0x10')][_0x4c7005[_0x7ada('0x11')]]=_0x4c7005;writeDB(_0x4c7005);}catch(_0x14ca16){utils[_0x7ada('0x12')](util[_0x7ada('0x2')]('[%s][transfers][blindtransfer]',_0x4c7005[_0x7ada('0xa')]),_0x14ca16);}};exports[_0x7ada('0x13')]=function(_0x4e9265){try{utils[_0x7ada('0x8')](util[_0x7ada('0x2')]('[%s][transfers][attendedtransfer]',_0x4e9265[_0x7ada('0x14')]),_0x4e9265);utils['info'](util[_0x7ada('0x2')](_0x7ada('0x15'),_0x4e9265[_0x7ada('0x14')],_0x4e9265[_0x7ada('0x16')],_0x4e9265[_0x7ada('0x17')],_0x4e9265[_0x7ada('0x18')],_0x4e9265['transfertargetcalleridname']));_0x4e9265=_[_0x7ada('0x19')](_0x4e9265,{'transfererchannel':_0x4e9265['origtransfererchannel'],'transferercalleridnum':_0x4e9265[_0x7ada('0x16')],'transferercalleridname':_0x4e9265['origtransferercalleridname'],'transfererconnectedlinenum':_0x4e9265[_0x7ada('0x1a')],'transfererconnectedlinename':_0x4e9265[_0x7ada('0x1b')],'transfereraccountcode':_0x4e9265[_0x7ada('0x1c')],'transferercontext':_0x4e9265['secondtransferercontext'],'transfererexten':_0x4e9265[_0x7ada('0x1d')],'transfererlinkedid':_0x4e9265['origtransfererlinkedid'],'context':_0x4e9265[_0x7ada('0x1e')],'extension':_0x4e9265['origtransfererexten'],'type':'attended'});if(_[_0x7ada('0x1f')](_0x4e9265[_0x7ada('0x20')])){_0x4e9265=_[_0x7ada('0x19')](_0x4e9265,{'transfereechannel':_0x4e9265[_0x7ada('0x21')],'transfereecalleridnum':_0x4e9265[_0x7ada('0x18')],'transfereecalleridname':_0x4e9265[_0x7ada('0x22')],'transfereeconnectedlinenum':_0x4e9265[_0x7ada('0x23')],'transfereeconnectedlinename':_0x4e9265[_0x7ada('0x24')],'transfereeaccountcode':_0x4e9265[_0x7ada('0x25')],'transfereecontext':_0x4e9265[_0x7ada('0x26')],'transfereeexten':_0x4e9265[_0x7ada('0x27')],'transfereelinkedid':_0x4e9265[_0x7ada('0x28')]});}writeDB(_0x4e9265);}catch(_0x40cbaa){utils['error'](util[_0x7ada('0x2')](_0x7ada('0x29'),_0x4e9265[_0x7ada('0x14')]),_0x40cbaa);}}; \ No newline at end of file +var _0x234b=['secondtransfererexten','origtransferercontext','origtransfererexten','attended','isNil','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','[%s][transfers][attendedtransfer]','lodash','util','./utils','info','[%s][transfers][writeDB]\x20type:%s','type','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blinds','blindtransfer','debug','format','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','error','[%s][transfers][blindtransfer]','attendedtransfer','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext'];(function(_0x57331f,_0xf1aee4){var _0x5d75a4=function(_0x38a6a9){while(--_0x38a6a9){_0x57331f['push'](_0x57331f['shift']());}};_0x5d75a4(++_0xf1aee4);}(_0x234b,0x191));var _0xb234=function(_0x51fd9b,_0x604558){_0x51fd9b=_0x51fd9b-0x0;var _0x18b2fe=_0x234b[_0x51fd9b];return _0x18b2fe;};'use strict';var _=require(_0xb234('0x0'));var util=require(_0xb234('0x1'));var utils=require(_0xb234('0x2'));function writeDB(_0x27734a){utils[_0xb234('0x3')](util['format'](_0xb234('0x4'),_0x27734a[_0xb234('0x5')]==='attended'?_0x27734a[_0xb234('0x6')]:_0x27734a[_0xb234('0x7')],_0x27734a[_0xb234('0x5')]));utils[_0xb234('0x8')](_0xb234('0x9'),_0x27734a);}exports[_0xb234('0xa')]={};exports[_0xb234('0xb')]=function(_0x5478be){try{utils[_0xb234('0xc')](util[_0xb234('0xd')]('[%s][transfers][blindtransfer]',_0x5478be[_0xb234('0x7')]),_0x5478be);utils[_0xb234('0x3')](util['format'](_0xb234('0xe'),_0x5478be[_0xb234('0x7')],_0x5478be[_0xb234('0xf')],_0x5478be[_0xb234('0x10')],_0x5478be[_0xb234('0x11')],_0x5478be[_0xb234('0x12')]));_0x5478be[_0xb234('0x5')]='blind';exports['blinds'][_0x5478be['transfereruniqueid']]=_0x5478be;writeDB(_0x5478be);}catch(_0x22d17c){utils[_0xb234('0x13')](util['format'](_0xb234('0x14'),_0x5478be[_0xb234('0x7')]),_0x22d17c);}};exports[_0xb234('0x15')]=function(_0x3404c9){try{utils[_0xb234('0xc')](util[_0xb234('0xd')]('[%s][transfers][attendedtransfer]',_0x3404c9[_0xb234('0x6')]),_0x3404c9);utils[_0xb234('0x3')](util['format'](_0xb234('0x16'),_0x3404c9[_0xb234('0x6')],_0x3404c9['origtransferercalleridnum'],_0x3404c9[_0xb234('0x17')],_0x3404c9['transfertargetcalleridnum'],_0x3404c9['transfertargetcalleridname']));_0x3404c9=_[_0xb234('0x18')](_0x3404c9,{'transfererchannel':_0x3404c9[_0xb234('0x19')],'transferercalleridnum':_0x3404c9['origtransferercalleridnum'],'transferercalleridname':_0x3404c9[_0xb234('0x17')],'transfererconnectedlinenum':_0x3404c9[_0xb234('0x1a')],'transfererconnectedlinename':_0x3404c9['secondtransfererconnectedlinename'],'transfereraccountcode':_0x3404c9[_0xb234('0x1b')],'transferercontext':_0x3404c9[_0xb234('0x1c')],'transfererexten':_0x3404c9[_0xb234('0x1d')],'transfererlinkedid':_0x3404c9['origtransfererlinkedid'],'context':_0x3404c9[_0xb234('0x1e')],'extension':_0x3404c9[_0xb234('0x1f')],'type':_0xb234('0x20')});if(_[_0xb234('0x21')](_0x3404c9['transfereechannel'])){_0x3404c9=_[_0xb234('0x18')](_0x3404c9,{'transfereechannel':_0x3404c9['transfertargetchannel'],'transfereecalleridnum':_0x3404c9[_0xb234('0x22')],'transfereecalleridname':_0x3404c9[_0xb234('0x23')],'transfereeconnectedlinenum':_0x3404c9[_0xb234('0x24')],'transfereeconnectedlinename':_0x3404c9[_0xb234('0x25')],'transfereeaccountcode':_0x3404c9[_0xb234('0x26')],'transfereecontext':_0x3404c9[_0xb234('0x27')],'transfereeexten':_0x3404c9[_0xb234('0x28')],'transfereelinkedid':_0x3404c9[_0xb234('0x29')]});}writeDB(_0x3404c9);}catch(_0x28dcdf){utils[_0xb234('0x13')](util[_0xb234('0xd')](_0xb234('0x2a'),_0x3404c9[_0xb234('0x6')]),_0x28dcdf);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 2483a6e..4402022 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 _0x8185=['GetUser','internal','[utils][getUser]\x20where:%s','stringify','result','length','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','name','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','util','client','http','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch'];(function(_0x439f45,_0x542c73){var _0x6aa2e3=function(_0xc3474){while(--_0xc3474){_0x439f45['push'](_0x439f45['shift']());}};_0x6aa2e3(++_0x542c73);}(_0x8185,0x127));var _0x5818=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x8185[_0x5f1391];return _0x50ebe3;};'use strict';var BPromise=require(_0x5818('0x0'));var jayson=require(_0x5818('0x1'));var moment=require('moment');var util=require(_0x5818('0x2'));var client=jayson[_0x5818('0x3')][_0x5818('0x4')]({'port':0x2329});var logger=require('../../config/logger')('xdr');exports[_0x5818('0x5')]=function(_0x45fa9d,_0x3b34d7){logger[_0x5818('0x5')](_0x45fa9d,_0x3b34d7?util[_0x5818('0x6')](_0x3b34d7,{'showHidden':![],'depth':null}):'');};exports[_0x5818('0x7')]=function(_0x1d83b9,_0x3d9106){logger[_0x5818('0x7')](_0x1d83b9,_0x3d9106?util[_0x5818('0x6')](_0x3d9106,{'showHidden':![],'depth':null}):'');};exports[_0x5818('0x8')]=function(_0x2db0e9,_0x2d5164){logger[_0x5818('0x8')](_0x2db0e9,_0x2d5164?util[_0x5818('0x6')](_0x2d5164,{'showHidden':![],'depth':null}):'');};exports[_0x5818('0x9')]=function(_0x57874f,_0x1bcec6){return client[_0x5818('0x9')](_0x57874f,{'body':_0x1bcec6})[_0x5818('0xa')](function(_0x2a15de){logger[_0x5818('0x7')](_0x5818('0xb'),_0x57874f,_0x2a15de?util[_0x5818('0x6')](_0x2a15de,{'showHidden':![],'depth':null}):'');})[_0x5818('0xc')](function(_0x5ba535){logger[_0x5818('0x8')]('[utils][request]\x20name:%s',_0x57874f,_0x5ba535?util[_0x5818('0x6')](_0x5ba535,{'showHidden':![],'depth':null}):'');});};function getUser(_0x5bb41f){return client[_0x5818('0x9')](_0x5818('0xd'),{'options':{'raw':!![],'attributes':['id',_0x5818('0xe'),'name','interface'],'where':_0x5bb41f,'limit':0x1}})[_0x5818('0xa')](function(_0x353496){logger[_0x5818('0x7')](_0x5818('0xf'),JSON[_0x5818('0x10')](_0x5bb41f),_0x353496?util[_0x5818('0x6')](_0x353496,{'showHidden':![],'depth':null}):'');return _0x353496[_0x5818('0x11')][_0x5818('0x12')]?_0x353496[_0x5818('0x11')][0x0]:null;});}exports['getUserByInternal']=function(_0x5a6fc3){return new BPromise(function(_0x1ff999,_0x2d6313){if(_0x5a6fc3){return getUser({'internal':_0x5a6fc3})[_0x5818('0xa')](function(_0x2f339a){logger['info']('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x5a6fc3,_0x2f339a?_0x5818('0x13'):_0x5818('0x14'));return _0x1ff999(_0x2f339a);})['catch'](function(_0x349311){logger[_0x5818('0x8')](_0x5818('0x15'),_0x349311?util[_0x5818('0x6')](_0x349311,{'showHidden':![],'depth':null}):'');return _0x1ff999(null);});}return _0x1ff999(null);});};exports[_0x5818('0x16')]=function(_0x130ce6){return new BPromise(function(_0x4a6224,_0x38c603){if(_0x130ce6){return getUser({'interface':_0x130ce6})['then'](function(_0x2a6fb6){logger[_0x5818('0x5')](_0x5818('0x17'),_0x130ce6,_0x2a6fb6?_0x5818('0x13'):'notfound');return _0x4a6224(_0x2a6fb6);})[_0x5818('0xc')](function(_0x347b6f){logger[_0x5818('0x8')]('[utils][getUserByInterface]',_0x347b6f?util[_0x5818('0x6')](_0x347b6f,{'showHidden':![],'depth':null}):'');return _0x4a6224(null);});}return _0x4a6224(null);});};exports['getUserByName']=function(_0x3b7ee3){return new BPromise(function(_0x386f05,_0x12637f){if(_0x3b7ee3){return getUser({'name':_0x3b7ee3})['then'](function(_0x423847){logger[_0x5818('0x5')]('[utils][getUserByName]\x20name:%s\x20%s',_0x3b7ee3,_0x423847?'found':_0x5818('0x14'));return _0x386f05(_0x423847);})[_0x5818('0xc')](function(_0x54f2d3){logger[_0x5818('0x8')](_0x5818('0x18'),_0x54f2d3?util[_0x5818('0x6')](_0x54f2d3,{'showHidden':![],'depth':null}):'');return _0x386f05(null);});}return _0x386f05(null);});};exports[_0x5818('0x19')]=function(_0x1e40eb){return new BPromise(function(_0x460d3f,_0x571444){if(_0x1e40eb){return client['request']('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0x5818('0x1a'),_0x5818('0x1b'),_0x5818('0x1c'),_0x5818('0x1d')],'where':{'name':_0x1e40eb},'limit':0x1}})[_0x5818('0xa')](function(_0x3cdb9d){logger[_0x5818('0x7')](_0x5818('0x1e'),_0x1e40eb,_0x3cdb9d?util[_0x5818('0x6')](_0x3cdb9d,{'showHidden':![],'depth':null}):'');logger[_0x5818('0x5')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x1e40eb,_0x3cdb9d?_0x5818('0x13'):'notfound');return _0x460d3f(_0x3cdb9d['result'][_0x5818('0x12')]?_0x3cdb9d['result'][0x0]:null);})[_0x5818('0xc')](function(_0x211a0f){logger['error'](_0x5818('0x1f'),_0x211a0f?util[_0x5818('0x6')](_0x211a0f,{'showHidden':![],'depth':null}):'');return _0x460d3f(null);});}return _0x460d3f(null);});};exports[_0x5818('0x20')]=function(_0x1737ca,_0x4354ee){return moment(_0x1737ca)[_0x5818('0x21')](_0x4354ee,_0x5818('0x22'))[_0x5818('0x23')](_0x5818('0x24'));};exports[_0x5818('0x25')]=function(_0x564a65,_0x185991){return moment(_0x564a65)[_0x5818('0x26')](_0x185991,_0x5818('0x22'))[_0x5818('0x23')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x5818('0x27')]=function(_0x6fe5ea,_0x151a62){return moment(_0x6fe5ea)['diff'](moment(_0x151a62),_0x5818('0x22'));};exports[_0x5818('0x28')]=function(_0x2df1f4,_0x146bf8){return parseInt(_0x2df1f4,0xa)+parseInt(_0x146bf8,0xa);};exports[_0x5818('0x29')]=function(){return moment()[_0x5818('0x23')](_0x5818('0x24'));};exports[_0x5818('0x2a')]=function(_0x14eabc,_0x32f880){if(_0x32f880){return moment(_0x14eabc)['isAfter'](_0x32f880);}return!![];};exports[_0x5818('0x2b')]=function(_0x2de3c3,_0x55364f){if(_0x55364f){return moment(_0x2de3c3)[_0x5818('0x2b')](_0x55364f);}else if(_0x2de3c3){return!![];}return![];}; \ No newline at end of file +var _0x622a=['inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','internal','name','interface','[utils][getUser]\x20where:%s','stringify','length','result','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','notfound','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','found','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','getVoiceQueueByName','GetVoiceQueue','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','add','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diff','seconds','sumTime','now','isAfter','isBefore','jayson/promise','moment','util','client','http','../../config/logger','xdr','info'];(function(_0x393d69,_0x3a8c83){var _0x3cee37=function(_0x462682){while(--_0x462682){_0x393d69['push'](_0x393d69['shift']());}};_0x3cee37(++_0x3a8c83);}(_0x622a,0x1ce));var _0xa622=function(_0x1756ed,_0x2b2d98){_0x1756ed=_0x1756ed-0x0;var _0x2b06e2=_0x622a[_0x1756ed];return _0x2b06e2;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xa622('0x0'));var moment=require(_0xa622('0x1'));var util=require(_0xa622('0x2'));var client=jayson[_0xa622('0x3')][_0xa622('0x4')]({'port':0x2329});var logger=require(_0xa622('0x5'))(_0xa622('0x6'));exports[_0xa622('0x7')]=function(_0x1ec487,_0x59f8e2){logger[_0xa622('0x7')](_0x1ec487,_0x59f8e2?util[_0xa622('0x8')](_0x59f8e2,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x3cf6b3,_0x145e8a){logger[_0xa622('0x9')](_0x3cf6b3,_0x145e8a?util[_0xa622('0x8')](_0x145e8a,{'showHidden':![],'depth':null}):'');};exports[_0xa622('0xa')]=function(_0x322ac,_0x5503e4){logger[_0xa622('0xa')](_0x322ac,_0x5503e4?util[_0xa622('0x8')](_0x5503e4,{'showHidden':![],'depth':null}):'');};exports[_0xa622('0xb')]=function(_0xa4029a,_0x4e49bb){return client[_0xa622('0xb')](_0xa4029a,{'body':_0x4e49bb})[_0xa622('0xc')](function(_0x21bd81){logger[_0xa622('0x9')](_0xa622('0xd'),_0xa4029a,_0x21bd81?util[_0xa622('0x8')](_0x21bd81,{'showHidden':![],'depth':null}):'');})[_0xa622('0xe')](function(_0x3ef2af){logger[_0xa622('0xa')](_0xa622('0xd'),_0xa4029a,_0x3ef2af?util[_0xa622('0x8')](_0x3ef2af,{'showHidden':![],'depth':null}):'');});};function getUser(_0x3ede89){return client['request']('GetUser',{'options':{'raw':!![],'attributes':['id',_0xa622('0xf'),_0xa622('0x10'),_0xa622('0x11')],'where':_0x3ede89,'limit':0x1}})['then'](function(_0x23c544){logger['debug'](_0xa622('0x12'),JSON[_0xa622('0x13')](_0x3ede89),_0x23c544?util['inspect'](_0x23c544,{'showHidden':![],'depth':null}):'');return _0x23c544['result'][_0xa622('0x14')]?_0x23c544[_0xa622('0x15')][0x0]:null;});}exports[_0xa622('0x16')]=function(_0x3dfa82){return new BPromise(function(_0x3e4efa,_0x1e2927){if(_0x3dfa82){return getUser({'internal':_0x3dfa82})[_0xa622('0xc')](function(_0x2ec867){logger[_0xa622('0x7')](_0xa622('0x17'),_0x3dfa82,_0x2ec867?'found':_0xa622('0x18'));return _0x3e4efa(_0x2ec867);})[_0xa622('0xe')](function(_0x4e0080){logger[_0xa622('0xa')]('[utils][getUserByInternal]',_0x4e0080?util[_0xa622('0x8')](_0x4e0080,{'showHidden':![],'depth':null}):'');return _0x3e4efa(null);});}return _0x3e4efa(null);});};exports[_0xa622('0x19')]=function(_0x16cdc1){return new BPromise(function(_0x5b1457,_0xbdf04){if(_0x16cdc1){return getUser({'interface':_0x16cdc1})[_0xa622('0xc')](function(_0x2a3195){logger[_0xa622('0x7')](_0xa622('0x1a'),_0x16cdc1,_0x2a3195?_0xa622('0x1b'):_0xa622('0x18'));return _0x5b1457(_0x2a3195);})[_0xa622('0xe')](function(_0x2d0ea3){logger[_0xa622('0xa')](_0xa622('0x1c'),_0x2d0ea3?util[_0xa622('0x8')](_0x2d0ea3,{'showHidden':![],'depth':null}):'');return _0x5b1457(null);});}return _0x5b1457(null);});};exports[_0xa622('0x1d')]=function(_0x456685){return new BPromise(function(_0x3723bf,_0x190478){if(_0x456685){return getUser({'name':_0x456685})['then'](function(_0x506964){logger['info'](_0xa622('0x1e'),_0x456685,_0x506964?_0xa622('0x1b'):_0xa622('0x18'));return _0x3723bf(_0x506964);})[_0xa622('0xe')](function(_0x174c16){logger[_0xa622('0xa')]('[utils][getUserByName]',_0x174c16?util[_0xa622('0x8')](_0x174c16,{'showHidden':![],'depth':null}):'');return _0x3723bf(null);});}return _0x3723bf(null);});};exports[_0xa622('0x1f')]=function(_0x37de64){return new BPromise(function(_0x49e664,_0x1e139a){if(_0x37de64){return client['request'](_0xa622('0x20'),{'options':{'raw':!![],'attributes':['id',_0xa622('0x10'),'type','acw','acwTimeout'],'where':{'name':_0x37de64},'limit':0x1}})['then'](function(_0x3ee3b6){logger[_0xa622('0x9')](_0xa622('0x21'),_0x37de64,_0x3ee3b6?util['inspect'](_0x3ee3b6,{'showHidden':![],'depth':null}):'');logger[_0xa622('0x7')](_0xa622('0x22'),_0x37de64,_0x3ee3b6?'found':'notfound');return _0x49e664(_0x3ee3b6[_0xa622('0x15')][_0xa622('0x14')]?_0x3ee3b6[_0xa622('0x15')][0x0]:null);})[_0xa622('0xe')](function(_0x4ff931){logger['error'](_0xa622('0x23'),_0x4ff931?util[_0xa622('0x8')](_0x4ff931,{'showHidden':![],'depth':null}):'');return _0x49e664(null);});}return _0x49e664(null);});};exports['addTime']=function(_0x1dd397,_0x3e99e6){return moment(_0x1dd397)[_0xa622('0x24')](_0x3e99e6,'seconds')[_0xa622('0x25')](_0xa622('0x26'));};exports[_0xa622('0x27')]=function(_0x2e2e3a,_0x3ba641){return moment(_0x2e2e3a)[_0xa622('0x28')](_0x3ba641,'seconds')[_0xa622('0x25')](_0xa622('0x26'));};exports['diffTime']=function(_0xf25595,_0x493bf6){return moment(_0xf25595)[_0xa622('0x29')](moment(_0x493bf6),_0xa622('0x2a'));};exports[_0xa622('0x2b')]=function(_0x5ae4ac,_0x39b2e1){return parseInt(_0x5ae4ac,0xa)+parseInt(_0x39b2e1,0xa);};exports[_0xa622('0x2c')]=function(){return moment()[_0xa622('0x25')](_0xa622('0x26'));};exports[_0xa622('0x2d')]=function(_0x4f452f,_0x1fc180){if(_0x1fc180){return moment(_0x4f452f)[_0xa622('0x2d')](_0x1fc180);}return!![];};exports[_0xa622('0x2e')]=function(_0xe8f4fe,_0x37c7a0){if(_0x37c7a0){return moment(_0xe8f4fe)['isBefore'](_0x37c7a0);}else if(_0xe8f4fe){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 258ef8b..2075873 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 _0x7de3=['set','use','logger','isEmpty','body','\x20body=%s','format','method','x-forwarded-for','connection','url','statusCode','responseTime','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','headers','remoteAddress','agent_name','fs-extra','lodash','express-winston','path','util','./loggers','fileLogger','./safe-template','safeTemplate','maskSensitiveData','join','/var','log','xcally','client','role','name','ensureDir','catch','user','then','data','timestamp','api','auth'];(function(_0x574617,_0x42eccc){var _0x29de90=function(_0x367aff){while(--_0x367aff){_0x574617['push'](_0x574617['shift']());}};_0x29de90(++_0x42eccc);}(_0x7de3,0x9f));var _0x37de=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x7de3[_0x8c43de];return _0xa6591b;};var fs=require(_0x37de('0x0'));var _=require(_0x37de('0x1'));var ewinston=require(_0x37de('0x2'));var path=require(_0x37de('0x3'));var util=require(_0x37de('0x4'));var fileLogger=require(_0x37de('0x5'))[_0x37de('0x6')];var safeTemplate=require(_0x37de('0x7'))[_0x37de('0x8')];var maskSensitiveData=require('./mask-sensitive-data')[_0x37de('0x9')];function ClientSideLogger(){function _0x520272(_0x3b005e){var _0x5b87cb=path[_0x37de('0xa')](_0x37de('0xb'),_0x37de('0xc'),_0x37de('0xd'));var _0x323cdc=path['join'](_0x37de('0xe'),_0x3b005e[_0x37de('0xf')]+'-'+_0x3b005e[_0x37de('0x10')]);return fs[_0x37de('0x11')](path['join'](_0x5b87cb,_0x323cdc))['then'](function(){var _0x2efbc2=fileLogger(_0x37de('0xe'),path[_0x37de('0xa')](_0x5b87cb,_0x323cdc));return _0x2efbc2;})[_0x37de('0x12')](function(_0x1a66c8){throw _0x1a66c8;});}this['log']=function(_0x4bab43,_0x15ab5c,_0xe05067,_0x47d05f){return _0x520272(_0x4bab43[_0x37de('0x13')])[_0x37de('0x14')](function(_0x3c8370){var _0x305777=_0x3c8370[_0x15ab5c];return _0x305777;})[_0x37de('0x14')](function(_0x1ca002){var _0x25eb08=_0x4bab43[_0x37de('0x13')]?_0x4bab43[_0x37de('0x13')]['id']:'no-user';var _0x13cd33=_0x47d05f[_0x37de('0x15')];var _0x249369=_0x47d05f[_0x37de('0x16')];var _0x3c92a9=new Date(Number(_0x249369));return _0x1ca002(_0x25eb08,_0x3c92a9,_0xe05067,_0x13cd33);})['catch'](function(_0x250e54){fileLogger(_0x37de('0xe'))['error'](_0x250e54);});};}function setupLoggers(_0x333ba3){return new Promise(function(_0x1a0c77){var _0x4a54ec=new ClientSideLogger();var _0x566ffd=fileLogger(_0x37de('0x17'));var _0xbfec7c=fileLogger(_0x37de('0x18'));_0x333ba3[_0x37de('0x19')]('client-side-logger',_0x4a54ec);_0x333ba3[_0x37de('0x1a')](ewinston[_0x37de('0x1b')]({'winstonInstance':_0x566ffd,'meta':![],'statusLevels':!![],'msg':function(_0x4f877e,_0x3ee324){var _0x434746='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0x37de('0x1c')](_0x4f877e[_0x37de('0x1d')])){_0x434746+=_0x37de('0x1e');var _0x161820=_0x4f877e[_0x37de('0x1d')];maskSensitiveData(_0x161820);}return safeTemplate(util[_0x37de('0x1f')](_0x434746,_0x4f877e[_0x37de('0x20')],_0x4f877e['headers'][_0x37de('0x21')]?_0x4f877e['headers'][_0x37de('0x21')]:_0x4f877e[_0x37de('0x22')]['remoteAddress']||_0x4f877e['ip'],_0x4f877e[_0x37de('0x23')],_0x3ee324[_0x37de('0x24')],_0x3ee324[_0x37de('0x25')],_0x4f877e[_0x37de('0x13')]?_0x4f877e[_0x37de('0x13')]['id']:null,_0x4f877e[_0x37de('0x13')]?_0x4f877e[_0x37de('0x13')]['name']:null,_0x4f877e['user']?_0x4f877e['user'][_0x37de('0xf')]:null,_0x161820?util[_0x37de('0x26')](_0x161820,![],null):''));}}));_0x333ba3[_0x37de('0x1a')](ewinston[_0x37de('0x1b')]({'winstonInstance':_0xbfec7c,'meta':![],'statusLevels':!![],'msg':function(_0x3395a9,_0x29a716){var _0x208877=_0x37de('0x27');if(_0x3395a9[_0x37de('0x1d')]&&_0x3395a9[_0x37de('0x1d')][_0x37de('0x28')]&&_0x3395a9[_0x37de('0x1d')][_0x37de('0x29')]){_0x208877=_0x37de('0x2a');}return util[_0x37de('0x1f')](_0x208877,_0x3395a9[_0x37de('0x20')],_0x3395a9[_0x37de('0x2b')][_0x37de('0x21')]?_0x3395a9[_0x37de('0x2b')][_0x37de('0x21')]:_0x3395a9[_0x37de('0x22')][_0x37de('0x2c')]||_0x3395a9['ip'],_0x3395a9['url'],_0x29a716['statusCode'],_0x29a716[_0x37de('0x25')],_0x3395a9[_0x37de('0x13')]?_0x3395a9[_0x37de('0x13')]['id']:null,_0x3395a9['user']?_0x3395a9[_0x37de('0x13')][_0x37de('0x10')]:null,_0x3395a9[_0x37de('0x13')]?_0x3395a9[_0x37de('0x13')][_0x37de('0xf')]:null,_0x3395a9[_0x37de('0x1d')]&&_0x3395a9[_0x37de('0x1d')][_0x37de('0x28')]?_0x3395a9[_0x37de('0x1d')][_0x37de('0x28')]:'other',_0x3395a9[_0x37de('0x1d')]&&_0x3395a9[_0x37de('0x1d')][_0x37de('0x29')]?_0x3395a9[_0x37de('0x1d')][_0x37de('0x29')]:'',_0x3395a9[_0x37de('0x1d')]&&_0x3395a9['body'][_0x37de('0x2d')]?_0x3395a9[_0x37de('0x1d')][_0x37de('0x2d')]:'');},'ignoreRoute':function(_0xf959a4){var _0x416764=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x416764['test'](_0xf959a4[_0x37de('0x23')]);}}));return _0x1a0c77();});}exports['setupLoggers']=setupLoggers; \ No newline at end of file +var _0x12c3=['fs-extra','lodash','express-winston','path','util','fileLogger','./safe-template','safeTemplate','maskSensitiveData','/var','log','xcally','role','name','join','catch','then','user','data','timestamp','error','api','auth','set','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','body','\x20body=%s','format','method','headers','x-forwarded-for','connection','url','statusCode','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','remoteAddress','responseTime','device','other','agent_id','agent_name','test','setupLoggers'];(function(_0x1e381c,_0x47b5b9){var _0x9b5ea9=function(_0x6d2be5){while(--_0x6d2be5){_0x1e381c['push'](_0x1e381c['shift']());}};_0x9b5ea9(++_0x47b5b9);}(_0x12c3,0x149));var _0x312c=function(_0x117349,_0x110d8d){_0x117349=_0x117349-0x0;var _0x5b4c3c=_0x12c3[_0x117349];return _0x5b4c3c;};var fs=require(_0x312c('0x0'));var _=require(_0x312c('0x1'));var ewinston=require(_0x312c('0x2'));var path=require(_0x312c('0x3'));var util=require(_0x312c('0x4'));var fileLogger=require('./loggers')[_0x312c('0x5')];var safeTemplate=require(_0x312c('0x6'))[_0x312c('0x7')];var maskSensitiveData=require('./mask-sensitive-data')[_0x312c('0x8')];function ClientSideLogger(){function _0x57f7f5(_0x11c38f){var _0xe619ad=path['join'](_0x312c('0x9'),_0x312c('0xa'),_0x312c('0xb'));var _0x3d94b5=path['join']('client',_0x11c38f[_0x312c('0xc')]+'-'+_0x11c38f[_0x312c('0xd')]);return fs['ensureDir'](path[_0x312c('0xe')](_0xe619ad,_0x3d94b5))['then'](function(){var _0x5054bc=fileLogger('client',path[_0x312c('0xe')](_0xe619ad,_0x3d94b5));return _0x5054bc;})[_0x312c('0xf')](function(_0x595397){throw _0x595397;});}this[_0x312c('0xa')]=function(_0x1d1e2e,_0x5c137b,_0x184a88,_0x11a31f){return _0x57f7f5(_0x1d1e2e['user'])['then'](function(_0x2cd1d9){var _0x44cf52=_0x2cd1d9[_0x5c137b];return _0x44cf52;})[_0x312c('0x10')](function(_0x425e05){var _0x3971ad=_0x1d1e2e[_0x312c('0x11')]?_0x1d1e2e[_0x312c('0x11')]['id']:'no-user';var _0x28278a=_0x11a31f[_0x312c('0x12')];var _0x5e3c04=_0x11a31f[_0x312c('0x13')];var _0x436365=new Date(Number(_0x5e3c04));return _0x425e05(_0x3971ad,_0x436365,_0x184a88,_0x28278a);})[_0x312c('0xf')](function(_0x502572){fileLogger('client')[_0x312c('0x14')](_0x502572);});};}function setupLoggers(_0x2dfcba){return new Promise(function(_0x51e156){var _0x370b0a=new ClientSideLogger();var _0xe3f945=fileLogger(_0x312c('0x15'));var _0x10c9f8=fileLogger(_0x312c('0x16'));_0x2dfcba[_0x312c('0x17')](_0x312c('0x18'),_0x370b0a);_0x2dfcba[_0x312c('0x19')](ewinston[_0x312c('0x1a')]({'winstonInstance':_0xe3f945,'meta':![],'statusLevels':!![],'msg':function(_0x3ba5ee,_0x22dae6){var _0x222354=_0x312c('0x1b');if(!_['isEmpty'](_0x3ba5ee[_0x312c('0x1c')])){_0x222354+=_0x312c('0x1d');var _0x5af383=_0x3ba5ee[_0x312c('0x1c')];maskSensitiveData(_0x5af383);}return safeTemplate(util[_0x312c('0x1e')](_0x222354,_0x3ba5ee[_0x312c('0x1f')],_0x3ba5ee['headers']['x-forwarded-for']?_0x3ba5ee[_0x312c('0x20')][_0x312c('0x21')]:_0x3ba5ee[_0x312c('0x22')]['remoteAddress']||_0x3ba5ee['ip'],_0x3ba5ee[_0x312c('0x23')],_0x22dae6[_0x312c('0x24')],_0x22dae6['responseTime'],_0x3ba5ee[_0x312c('0x11')]?_0x3ba5ee['user']['id']:null,_0x3ba5ee[_0x312c('0x11')]?_0x3ba5ee[_0x312c('0x11')][_0x312c('0xd')]:null,_0x3ba5ee[_0x312c('0x11')]?_0x3ba5ee['user'][_0x312c('0xc')]:null,_0x5af383?util[_0x312c('0x25')](_0x5af383,![],null):''));}}));_0x2dfcba[_0x312c('0x19')](ewinston[_0x312c('0x1a')]({'winstonInstance':_0x10c9f8,'meta':![],'statusLevels':!![],'msg':function(_0x285ad9,_0x56c747){var _0x5cc7ef='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x285ad9[_0x312c('0x1c')]&&_0x285ad9[_0x312c('0x1c')]['device']&&_0x285ad9['body']['agent_id']){_0x5cc7ef=_0x312c('0x26');}return util['format'](_0x5cc7ef,_0x285ad9['method'],_0x285ad9[_0x312c('0x20')][_0x312c('0x21')]?_0x285ad9[_0x312c('0x20')][_0x312c('0x21')]:_0x285ad9[_0x312c('0x22')][_0x312c('0x27')]||_0x285ad9['ip'],_0x285ad9[_0x312c('0x23')],_0x56c747[_0x312c('0x24')],_0x56c747[_0x312c('0x28')],_0x285ad9[_0x312c('0x11')]?_0x285ad9['user']['id']:null,_0x285ad9['user']?_0x285ad9[_0x312c('0x11')][_0x312c('0xd')]:null,_0x285ad9[_0x312c('0x11')]?_0x285ad9['user'][_0x312c('0xc')]:null,_0x285ad9[_0x312c('0x1c')]&&_0x285ad9[_0x312c('0x1c')]['device']?_0x285ad9['body'][_0x312c('0x29')]:_0x312c('0x2a'),_0x285ad9[_0x312c('0x1c')]&&_0x285ad9['body'][_0x312c('0x2b')]?_0x285ad9[_0x312c('0x1c')][_0x312c('0x2b')]:'',_0x285ad9[_0x312c('0x1c')]&&_0x285ad9[_0x312c('0x1c')]['agent_name']?_0x285ad9[_0x312c('0x1c')][_0x312c('0x2c')]:'');},'ignoreRoute':function(_0x1473f0){var _0x13116c=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x13116c[_0x312c('0x2d')](_0x1473f0[_0x312c('0x23')]);}}));return _0x51e156();});}exports[_0x312c('0x2e')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index 82efc6b..1644185 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc93c=['format','%s-%s.log','message','replace','{{{','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','}}}','meta','keys','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','transports','warn','File','%s-%s','error','Console','fileLogger','util','moment','winston','debugLevel','toLowerCase','info','redBG\x20white','red','bold\x20yellow','white','bold\x20green','gray','bold\x20blue','bold\x20cyan','addColors','join'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xc93c,0x1c4));var _0xcc93=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0xc93c[_0x255d5b];return _0x3e141a;};'use strict';var path=require('path');var util=require(_0xcc93('0x0'));var moment=require(_0xcc93('0x1'));var winston=require(_0xcc93('0x2'));var config=require('../config/environment');var debugLevel=config[_0xcc93('0x3')]?config[_0xcc93('0x3')][_0xcc93('0x4')]():_0xcc93('0x5');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':_0xcc93('0x6'),'error':_0xcc93('0x7'),'warn':_0xcc93('0x8'),'info':_0xcc93('0x9'),'print':'bold\x20white','success':_0xcc93('0xa'),'http':_0xcc93('0xb'),'verbose':'bold\x20magenta','debug':_0xcc93('0xc'),'silly':_0xcc93('0xd')};winston[_0xcc93('0xe')](XC_LOG_COLORS);function getLogFileName(_0x5bad13,_0x382deb,_0x3bdd78){var _0xcbba9=_0x5bad13||'/var/log/xcally';return path[_0xcc93('0xf')](_0xcbba9,util[_0xcc93('0x10')](_0xcc93('0x11'),_0x382deb,_0x3bdd78));}function formatter(_0x2a80a7,_0x3c3470){_0x3c3470[_0xcc93('0x12')]=_0x3c3470[_0xcc93('0x12')][_0xcc93('0x13')](/@@{/g,_0xcc93('0x14'))[_0xcc93('0x13')](/}@@/g,'}}}')['replace'](/@{/g,'{{')[_0xcc93('0x13')](/}@/g,'}}');return util[_0xcc93('0x10')](_0xcc93('0x15'),moment()['format'](_0xcc93('0x16')),_0x3c3470[_0xcc93('0x17')][_0xcc93('0x18')](),_0x2a80a7,_0x3c3470[_0xcc93('0x12')]);}function fileFormat(_0xc0583b,_0x3d00d8){_0x3d00d8[_0xcc93('0x12')]=_0x3d00d8[_0xcc93('0x12')][_0xcc93('0x13')](/@@{/g,_0xcc93('0x14'))[_0xcc93('0x13')](/}@@/g,_0xcc93('0x19'))['replace'](/@{/g,'{{')[_0xcc93('0x13')](/}@/g,'}}');var _0x4df361=_0x3d00d8[_0xcc93('0x1a')]&&Object[_0xcc93('0x1b')](_0x3d00d8[_0xcc93('0x1a')])[_0xcc93('0x1c')]?'\x0a\x09'+JSON[_0xcc93('0x1d')](_0x3d00d8[_0xcc93('0x1a')]):'';return util[_0xcc93('0x10')](_0xcc93('0x1e'),moment()[_0xcc93('0x10')](_0xcc93('0x16')),_0x3d00d8[_0xcc93('0x17')][_0xcc93('0x18')](),_0xc0583b,_0x3d00d8['message'],_0x4df361);}function consoleLogger(){var _0xd60bdf=new winston[(_0xcc93('0x1f'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xcc93('0x20'))]['Console']({'level':_0xcc93('0x21'),'json':![],'formatter':function(_0x453794){return formatter('',_0x453794);}})]});return _0xd60bdf;}function fileLogger(_0x1d964c,_0x452540){var _0x449814=new winston[(_0xcc93('0x1f'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0xcc93('0x22'))]({'name':util[_0xcc93('0x10')](_0xcc93('0x23'),_0x1d964c,_0xcc93('0x24')),'filename':getLogFileName(_0x452540,_0x1d964c,'error'),'level':_0xcc93('0x24'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x38dc41){return fileFormat(_0x1d964c,_0x38dc41);}}),new winston['transports'][(_0xcc93('0x22'))]({'name':util[_0xcc93('0x10')](_0xcc93('0x23'),_0x1d964c,debugLevel),'filename':getLogFileName(_0x452540,_0x1d964c,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x70f378){return fileFormat(_0x1d964c,_0x70f378);}}),new winston[(_0xcc93('0x20'))][(_0xcc93('0x25'))]({'level':_0xcc93('0x21'),'json':![],'formatter':function(_0x4eab40){return fileFormat(_0x1d964c,_0x4eab40);}})]});return _0x449814;}exports['consoleLogger']=consoleLogger;exports[_0xcc93('0x26')]=fileLogger; \ No newline at end of file +var _0x0bee=['toUpperCase','Logger','transports','Console','warn','File','%s-%s','error','consoleLogger','path','moment','winston','debugLevel','toLowerCase','info','redBG\x20white','bold\x20yellow','bold\x20green','bold\x20magenta','/var/log/xcally','format','%s-%s.log','message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','level','meta','keys','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x2a36b8,_0x4675cf){var _0x36736a=function(_0x389c8e){while(--_0x389c8e){_0x2a36b8['push'](_0x2a36b8['shift']());}};_0x36736a(++_0x4675cf);}(_0x0bee,0x119));var _0xe0be=function(_0x25af29,_0x4abb12){_0x25af29=_0x25af29-0x0;var _0x5a3712=_0x0bee[_0x25af29];return _0x5a3712;};'use strict';var path=require(_0xe0be('0x0'));var util=require('util');var moment=require(_0xe0be('0x1'));var winston=require(_0xe0be('0x2'));var config=require('../config/environment');var debugLevel=config['debugLevel']?config[_0xe0be('0x3')][_0xe0be('0x4')]():_0xe0be('0x5');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':_0xe0be('0x6'),'error':'red','warn':_0xe0be('0x7'),'info':'white','print':'bold\x20white','success':_0xe0be('0x8'),'http':'gray','verbose':_0xe0be('0x9'),'debug':'bold\x20blue','silly':'bold\x20cyan'};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x13db96,_0x8c5a29,_0x520200){var _0x1b5c70=_0x13db96||_0xe0be('0xa');return path['join'](_0x1b5c70,util[_0xe0be('0xb')](_0xe0be('0xc'),_0x8c5a29,_0x520200));}function formatter(_0x1e8912,_0x4618e2){_0x4618e2[_0xe0be('0xd')]=_0x4618e2[_0xe0be('0xd')][_0xe0be('0xe')](/@@{/g,_0xe0be('0xf'))[_0xe0be('0xe')](/}@@/g,_0xe0be('0x10'))[_0xe0be('0xe')](/@{/g,'{{')[_0xe0be('0xe')](/}@/g,'}}');return util[_0xe0be('0xb')](_0xe0be('0x11'),moment()[_0xe0be('0xb')]('YYYY-MM-DD\x20HH:mm:ss'),_0x4618e2[_0xe0be('0x12')]['toUpperCase'](),_0x1e8912,_0x4618e2[_0xe0be('0xd')]);}function fileFormat(_0x5ee296,_0x60fdc){_0x60fdc[_0xe0be('0xd')]=_0x60fdc[_0xe0be('0xd')]['replace'](/@@{/g,_0xe0be('0xf'))[_0xe0be('0xe')](/}@@/g,_0xe0be('0x10'))[_0xe0be('0xe')](/@{/g,'{{')[_0xe0be('0xe')](/}@/g,'}}');var _0x98d637=_0x60fdc[_0xe0be('0x13')]&&Object[_0xe0be('0x14')](_0x60fdc[_0xe0be('0x13')])[_0xe0be('0x15')]?'\x0a\x09'+JSON[_0xe0be('0x16')](_0x60fdc[_0xe0be('0x13')]):'';return util[_0xe0be('0xb')](_0xe0be('0x17'),moment()['format'](_0xe0be('0x18')),_0x60fdc[_0xe0be('0x12')][_0xe0be('0x19')](),_0x5ee296,_0x60fdc[_0xe0be('0xd')],_0x98d637);}function consoleLogger(){var _0x5dbf5c=new winston[(_0xe0be('0x1a'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xe0be('0x1b'))][(_0xe0be('0x1c'))]({'level':_0xe0be('0x1d'),'json':![],'formatter':function(_0x44c1a0){return formatter('',_0x44c1a0);}})]});return _0x5dbf5c;}function fileLogger(_0x3ffa82,_0x254a3f){var _0x240929=new winston[(_0xe0be('0x1a'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0xe0be('0x1e'))]({'name':util[_0xe0be('0xb')](_0xe0be('0x1f'),_0x3ffa82,_0xe0be('0x20')),'filename':getLogFileName(_0x254a3f,_0x3ffa82,_0xe0be('0x20')),'level':_0xe0be('0x20'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xc4ba0f){return fileFormat(_0x3ffa82,_0xc4ba0f);}}),new winston[(_0xe0be('0x1b'))][(_0xe0be('0x1e'))]({'name':util[_0xe0be('0xb')](_0xe0be('0x1f'),_0x3ffa82,debugLevel),'filename':getLogFileName(_0x254a3f,_0x3ffa82,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x340c27){return fileFormat(_0x3ffa82,_0x340c27);}}),new winston[(_0xe0be('0x1b'))][(_0xe0be('0x1c'))]({'level':_0xe0be('0x1d'),'json':![],'formatter':function(_0x232678){return fileFormat(_0x3ffa82,_0x232678);}})]});return _0x240929;}exports[_0xe0be('0x21')]=consoleLogger;exports['fileLogger']=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 0c7c161..5d261d9 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(_0xed421a,_0x28de01){var _0xf652ff=function(_0x9707a){while(--_0x9707a){_0xed421a['push'](_0xed421a['shift']());}};_0xf652ff(++_0x28de01);}(_0x66fa,0x117));var _0xa66f=function(_0x4ea52c,_0x3e3415){_0x4ea52c=_0x4ea52c-0x0;var _0x26457c=_0x66fa[_0x4ea52c];return _0x26457c;};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 _0x0b0e=['}@@','lodash','password','apiKey','firstName','lastName','street','phone','mobile','fax','email','clientId','clientSecret','securityToken','tenantId','token','channelSecret','accessToken','authToken','consumerKey','membername','calleridname','exten','vidaooApiKey','clientEmail','accesskeyid','secretaccesskey','key','user','pass','localstationid','dsn','secret','registry','oldPassword','isArray','length','isString','replace'];(function(_0xff6bfb,_0x479ec4){var _0x1f5c4e=function(_0x40665e){while(--_0x40665e){_0xff6bfb['push'](_0xff6bfb['shift']());}};_0x1f5c4e(++_0x479ec4);}(_0x0b0e,0x187));var _0xe0b0=function(_0x35485a,_0x91cdd4){_0x35485a=_0x35485a-0x0;var _0x5148e6=_0x0b0e[_0x35485a];return _0x5148e6;};var _=require(_0xe0b0('0x0'));var sensitiveFields=['username',_0xe0b0('0x1'),'newPassword',_0xe0b0('0x2'),_0xe0b0('0x3'),_0xe0b0('0x4'),_0xe0b0('0x5'),_0xe0b0('0x6'),_0xe0b0('0x7'),_0xe0b0('0x8'),_0xe0b0('0x9'),_0xe0b0('0xa'),_0xe0b0('0xb'),_0xe0b0('0xc'),'code','accessKey',_0xe0b0('0xd'),_0xe0b0('0xe'),_0xe0b0('0xf'),_0xe0b0('0x10'),'accessTokenSecret',_0xe0b0('0x11'),_0xe0b0('0x12'),'consumerSecret',_0xe0b0('0x13'),_0xe0b0('0x14'),'calleridnum',_0xe0b0('0x15'),_0xe0b0('0x16'),_0xe0b0('0x17'),'privateKey',_0xe0b0('0x18'),_0xe0b0('0x19'),_0xe0b0('0x1a'),_0xe0b0('0x1b'),_0xe0b0('0x1c'),'accountSid',_0xe0b0('0x1d'),_0xe0b0('0x1e'),_0xe0b0('0x1f'),_0xe0b0('0x20'),_0xe0b0('0x21')];function maskSensitiveData(_0x55d884){const _0x41a7e2=/(?!^)[\s\S](?!$)/g;if(_['isPlainObject'](_0x55d884)){for(const _0x35cb40 in _0x55d884){if(_[_0xe0b0('0x22')](_0x55d884[_0x35cb40])){for(let _0x519ae8=0x0;_0x519ae8<_0x55d884[_0x35cb40][_0xe0b0('0x23')];_0x519ae8++){maskSensitiveData(_0x55d884[_0x35cb40][_0x519ae8]);}}else if(_['isPlainObject'](_0x55d884[_0x35cb40])){maskSensitiveData(_0x55d884[_0x35cb40]);}else if(_[_0xe0b0('0x24')](_0x55d884[_0x35cb40])){_0x55d884[_0x35cb40]=_0x55d884[_0x35cb40][_0xe0b0('0x25')](/{{{/g,'@@{')['replace'](/}}}/g,_0xe0b0('0x26'))['replace'](/{{/g,'@{')['replace'](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x35cb40)){_0x55d884[_0x35cb40]=_0x55d884[_0x35cb40][_0xe0b0('0x25')](_0x41a7e2,'*');}}}}}module['exports']['maskSensitiveData']=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index 30ed35a..a2d44e9 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 _0x0972=['safeTemplate','\x20}\x20}','string','isArray','map','isPlainObject','keys','reduce','exports'];(function(_0x272509,_0x940b5c){var _0x1852db=function(_0x56c8b4){while(--_0x56c8b4){_0x272509['push'](_0x272509['shift']());}};_0x1852db(++_0x940b5c);}(_0x0972,0x64));var _0x2097=function(_0x113f0d,_0x47a33d){_0x113f0d=_0x113f0d-0x0;var _0x4c0c80=_0x0972[_0x113f0d];return _0x4c0c80;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x1591ae){return _0x1591ae==='{{'?'{\x20{\x20':_0x2097('0x0');}function safeTemplate(_0x4ec7aa){var _0x36912c=_0x4ec7aa;if(typeof _0x4ec7aa===_0x2097('0x1')){_0x36912c=_0x4ec7aa['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x2097('0x2')](_0x4ec7aa)){_0x36912c=_0x4ec7aa[_0x2097('0x3')](function(_0xe6fbae){return safeTemplate(_0xe6fbae);});}else if(_[_0x2097('0x4')](_0x4ec7aa)){_0x36912c=Object[_0x2097('0x5')](_0x4ec7aa)[_0x2097('0x6')](function(_0x2b4f21,_0x59739f){_0x2b4f21[_0x59739f]=safeTemplate(_0x4ec7aa[_0x59739f]);return _0x2b4f21;},{});}return _0x36912c;}module[_0x2097('0x7')][_0x2097('0x8')]=safeTemplate; \ No newline at end of file +var _0x14a0=['string','replace','isPlainObject','keys','exports','safeTemplate','{\x20{\x20','\x20}\x20}'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x14a0,0x8e));var _0x014a=function(_0x43f6a0,_0xe9102c){_0x43f6a0=_0x43f6a0-0x0;var _0x58a774=_0x14a0[_0x43f6a0];return _0x58a774;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x105436){return _0x105436==='{{'?_0x014a('0x0'):_0x014a('0x1');}function safeTemplate(_0x28b0f6){var _0x32e88c=_0x28b0f6;if(typeof _0x28b0f6===_0x014a('0x2')){_0x32e88c=_0x28b0f6[_0x014a('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x28b0f6)){_0x32e88c=_0x28b0f6['map'](function(_0x1730a5){return safeTemplate(_0x1730a5);});}else if(_[_0x014a('0x4')](_0x28b0f6)){_0x32e88c=Object[_0x014a('0x5')](_0x28b0f6)['reduce'](function(_0x5a61ac,_0x11b8ce){_0x5a61ac[_0x11b8ce]=safeTemplate(_0x28b0f6[_0x11b8ce]);return _0x5a61ac;},{});}return _0x32e88c;}module[_0x014a('0x6')][_0x014a('0x7')]=safeTemplate; \ No newline at end of file